end Bounty section -- Source module: OAI.NumberTheory.DirichletL.Arithmetic.EisensteinCoordinates namespace OAI open scoped BigOperators namespace ShortDraft abbrev EisensteinCoordinates := ℤ × ℤ def eisensteinMul (x y : EisensteinCoordinates) : EisensteinCoordinates := (x.1 * y.1 - x.2 * y.2, x.1 * y.2 + x.2 * y.1 - x.2 * y.2) def eisensteinNorm (x : EisensteinCoordinates) : ℤ := x.1 ^ 2 - x.1 * x.2 + x.2 ^ 2 theorem eisenstein_norm_mul (x y : EisensteinCoordinates) : eisensteinNorm (eisensteinMul x y) = eisensteinNorm x * eisensteinNorm y := by rcases x with ⟨a, b⟩ rcases y with ⟨c, d⟩ dsimp [eisensteinNorm, eisensteinMul] ring theorem eisenstein_norm_nonneg (x : EisensteinCoordinates) : 0 ≤ eisensteinNorm x := by rcases x with ⟨a, b⟩ dsimp [eisensteinNorm] nlinarith [sq_nonneg (2 * a - b), sq_nonneg b] theorem eisenstein_norm_eq_zero_iff (x : EisensteinCoordinates) : eisensteinNorm x = 0 ↔ x = (0, 0) := by rcases x with ⟨a, b⟩ dsimp [eisensteinNorm] constructor · intro h have hb : b = 0 := by nlinarith [sq_nonneg (2 * a - b), sq_nonneg b] have ha : a = 0 := by subst b nlinarith [sq_nonneg a] simp [ha, hb] · intro h simp_all def DirichletTarget : Prop := ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) (s : ℂ), (23 / 24 : ℝ) < s.re → ¬ (χ = 1 ∧ s = 1) → DirichletCharacter.LFunction χ s ≠ 0 theorem dirichlet_target_of_one_le_re (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q) (s : ℂ) (hs : 1 ≤ s.re) (hprincipal : ¬ (χ = 1 ∧ s = 1)) : DirichletCharacter.LFunction χ s ≠ 0 := by exact χ.LFunction_ne_zero_of_one_le_re (not_and_or.mp hprincipal) hs private lemma square_le_two_squares {x y e : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (he : 0 ≤ e) (h : x ≤ y + e) : x ^ 2 ≤ 2 * y ^ 2 + 2 * e ^ 2 := by have h₁ : 0 ≤ y + e - x := sub_nonneg.mpr h have h₂ : 0 ≤ y + e + x := by nlinarith have h₃ := mul_nonneg h₁ h₂ have h₄ := sq_nonneg (y - e) nlinarith theorem finite_row_extraction {α β : Type*} [DecidableEq α] [DecidableEq β] (rows : Finset α) (primes : Finset β) (row : β → α) (a : α → ℝ) (a₀ error bound : ℝ) (ha₀ : 0 ≤ a₀) (ha : ∀ u, 0 ≤ a u) (herror : 0 ≤ error) (hrows : primes.image row ⊆ rows) (hinj : Set.InjOn row (primes : Set β)) (happrox : ∀ p ∈ primes, a₀ ≤ a (row p) + error) (hmean : (∑ u ∈ rows, (a u) ^ 2) ≤ bound) : (primes.card : ℝ) * a₀ ^ 2 ≤ 2 * bound + 2 * (primes.card : ℝ) * error ^ 2 := by have hselected : (∑ p ∈ primes, (a (row p)) ^ 2) ≤ bound := by calc (∑ p ∈ primes, (a (row p)) ^ 2) = ∑ u ∈ primes.image row, (a u) ^ 2 := by rw [Finset.sum_image hinj] _ ≤ ∑ u ∈ rows, (a u) ^ 2 := Finset.sum_le_sum_of_subset_of_nonneg hrows (by intro u _ _ positivity) _ ≤ bound := hmean have hpoint (p : β) (hp : p ∈ primes) : a₀ ^ 2 ≤ 2 * (a (row p)) ^ 2 + 2 * error ^ 2 := square_le_two_squares ha₀ (ha _) herror (happrox p hp) have hsum : (∑ p ∈ primes, a₀ ^ 2) ≤ ∑ p ∈ primes, (2 * (a (row p)) ^ 2 + 2 * error ^ 2) := Finset.sum_le_sum hpoint simp only [Finset.sum_add_distrib, ← Finset.mul_sum, Finset.sum_const, nsmul_eq_mul] at hsum nlinarith theorem complex_row_extraction {α β : Type*} [DecidableEq α] [DecidableEq β] (rows : Finset α) (primes : Finset β) (row : β → α) (A : α → ℂ) (untwisted : α) (error bound : ℝ) (herror : 0 ≤ error) (hrows : primes.image row ⊆ rows) (hinj : Set.InjOn row (primes : Set β)) (happrox : ∀ p ∈ primes, ‖A untwisted - A (row p)‖ ≤ error) (hmean : (∑ u ∈ rows, ‖A u‖ ^ 2) ≤ bound) : (primes.card : ℝ) * ‖A untwisted‖ ^ 2 ≤ 2 * bound + 2 * (primes.card : ℝ) * error ^ 2 := by apply finite_row_extraction rows primes row (fun u ↦ ‖A u‖) ‖A untwisted‖ error bound (norm_nonneg _) (fun u ↦ norm_nonneg _) herror hrows hinj ?_ hmean intro p hp calc ‖A untwisted‖ = ‖(A untwisted - A (row p)) + A (row p)‖ := by rw [sub_add_cancel] _ ≤ ‖A untwisted - A (row p)‖ + ‖A (row p)‖ := norm_add_le _ _ _ ≤ ‖A (row p)‖ + error := by linarith [happrox p hp] end ShortDraft open MulChar AddChar namespace ShortDraftLocal variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] omit [Fintype F] [DecidableEq F] in theorem sextic_character_exponent (χ : MulChar F ℂ) (hχ : χ ^ 6 = 1) : χ⁻¹ * χ⁻¹ ^ 2 = χ ^ 3 := by calc χ⁻¹ * χ⁻¹ ^ 2 = χ ^ (-3 : ℤ) := by group _ = χ ^ 3 := by calc χ ^ (-3 : ℤ) = χ ^ ((-3 : ℤ) + 6) := by rw [zpow_add, zpow_ofNat, hχ, mul_one] _ = χ ^ 3 := by norm_num theorem gaussSum_mulShift_any (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (hχ : χ ≠ 1) (a : F) : gaussSum χ (ψ.mulShift a) = χ⁻¹ a * gaussSum χ ψ := by by_cases ha : a = 0 · subst a have hshift : ψ.mulShift (0 : F) = 1 := by ext x simp rw [hshift, gaussSum_one_right hχ] simp · have hu : IsUnit a := isUnit_iff_ne_zero.mpr ha simpa [hu.unit_spec] using gaussSum_mulShift_eq χ ψ hu.unit theorem gaussSum_eq_units_sum (χ : MulChar F ℂ) (ψ : AddChar F ℂ) : gaussSum χ ψ = ∑ y : Fˣ, χ (y : F) * ψ (y : F) := by classical have hzero : χ (0 : F) * ψ (0 : F) = 0 := by simp calc gaussSum χ ψ = ∑ x ∈ (Finset.univ : Finset F).erase 0, χ x * ψ x := by simpa only [gaussSum, hzero, add_zero] using (Finset.sum_erase_add (Finset.univ : Finset F) (fun x => χ x * ψ x) (Finset.mem_univ (0 : F))).symm _ = ∑ x : {x : F // x ≠ 0}, χ x * ψ x := by apply Finset.sum_subtype intro x simp _ = ∑ y : Fˣ, χ (y : F) * ψ (y : F) := by apply (Fintype.sum_equiv (unitsEquivNeZero : Fˣ ≃ {x : F // x ≠ 0}) (fun y : Fˣ => χ (y : F) * ψ (y : F)) (fun x : {x : F // x ≠ 0} => χ x * ψ x) ?_).symm intro y rfl theorem additive_unit_sum (ψ : AddChar F ℂ) (hψ : ψ ≠ 1) (a : F) : (∑ y : Fˣ, ψ (a * (y : F))) = if a = 0 then (Fintype.card Fˣ : ℂ) else -1 := by classical have hgauss : (∑ y : Fˣ, ψ (a * (y : F))) = gaussSum (1 : MulChar F ℂ) (ψ.mulShift a) := by rw [gaussSum_eq_units_sum] simp only [MulChar.one_apply_coe, one_mul, AddChar.mulShift_apply] rw [hgauss] split_ifs with ha · subst a simp only [AddChar.mulShift_zero, gaussSum_one_one] exact_mod_cast (Nat.card_eq_fintype_card (α := Fˣ)) · have hu : IsUnit a := isUnit_iff_ne_zero.mpr ha have hshift : ψ.mulShift a ≠ 1 := by intro heq exact hψ ((AddChar.mulShift_unit_eq_one_iff ψ hu).mp heq) exact gaussSum_one_left hshift theorem sextic_fourth_mask (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (hχ : χ ^ 6 = 1) (hψ : ψ ≠ 1) (a : F) : (∑ h : Fˣ, ((χ⁻¹) ^ 4 * (χ⁻¹) ^ 2) h * ψ (a * ((h⁻¹ : Fˣ) : F))) = if a = 0 then (Fintype.card Fˣ : ℂ) else -1 := by classical have hexp : ((χ⁻¹) ^ 4 * (χ⁻¹) ^ 2) = 1 := by calc ((χ⁻¹) ^ 4 * (χ⁻¹) ^ 2) = (χ ^ 6)⁻¹ := by group _ = 1 := by rw [hχ, inv_one] rw [hexp] simp only [MulChar.one_apply_coe, one_mul] calc (∑ h : Fˣ, ψ (a * ((h⁻¹ : Fˣ) : F))) = ∑ y : Fˣ, ψ (a * (y : F)) := by apply Fintype.sum_equiv (Equiv.inv Fˣ) intro h simp _ = _ := additive_unit_sum ψ hψ a theorem active_zero_local_row (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (hχ₂ : χ ^ 2 ≠ 1) (ε x : F) : (∑ h : Fˣ, ((χ⁻¹) ^ 2) (h : F) * ψ ((ε * x) * ((h⁻¹ : Fˣ) : F))) = (χ ^ 2)⁻¹ ε * gaussSum (χ ^ 2) ψ * (χ ^ 2)⁻¹ x := by classical have hquad : ((χ⁻¹) ^ 2)⁻¹ = χ ^ 2 := by group calc (∑ h : Fˣ, ((χ⁻¹) ^ 2) (h : F) * ψ ((ε * x) * ((h⁻¹ : Fˣ) : F))) = ∑ y : Fˣ, (χ ^ 2) (y : F) * ψ ((ε * x) * (y : F)) := by apply Fintype.sum_equiv (Equiv.inv Fˣ) intro h simp only [Equiv.inv_apply, Units.val_inv_eq_inv_val] rw [← hquad, MulChar.inv_apply', inv_inv] _ = gaussSum (χ ^ 2) (ψ.mulShift (ε * x)) := by rw [gaussSum_eq_units_sum] simp only [AddChar.mulShift_apply] _ = (χ ^ 2)⁻¹ ε * gaussSum (χ ^ 2) ψ * (χ ^ 2)⁻¹ x := by rw [gaussSum_mulShift_any (χ ^ 2) ψ hχ₂ (ε * x)] rw [map_mul] ring theorem nontrivial_fourier_coefficient (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (hχ : χ ≠ 1) (h : F) : (∑ t : F, χ t * ψ (-(h * t))) = χ⁻¹ h * gaussSum χ (ψ.mulShift (-1)) := by calc (∑ t : F, χ t * ψ (-(h * t))) = gaussSum χ ((ψ.mulShift (-1)).mulShift h) := by simp only [gaussSum, AddChar.mulShift_apply] congr 1 funext t congr 1 ring_nf _ = χ⁻¹ h * gaussSum χ (ψ.mulShift (-1)) := gaussSum_mulShift_any χ (ψ.mulShift (-1)) hχ h theorem trivial_fourier_coefficient (ψ : AddChar F ℂ) (hψ : ψ ≠ 1) (h : F) : (∑ t : F, (1 : MulChar F ℂ) t * ψ (-(h * t))) = if h = 0 then (Fintype.card Fˣ : ℂ) else -1 := by calc (∑ t : F, (1 : MulChar F ℂ) t * ψ (-(h * t))) = gaussSum (1 : MulChar F ℂ) (ψ.mulShift (-h)) := by simp only [gaussSum, AddChar.mulShift_apply] congr 1 funext t congr 1 ring_nf _ = ∑ u : Fˣ, ψ ((-h) * (u : F)) := by rw [gaussSum_eq_units_sum] simp only [MulChar.one_apply_coe, one_mul, AddChar.mulShift_apply] _ = if h = 0 then (Fintype.card Fˣ : ℂ) else -1 := by simpa only [neg_eq_zero] using additive_unit_sum ψ hψ (-h) end ShortDraftLocal end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.ExponentialSmoothing namespace OAI open scoped BigOperators open MulChar AddChar open scoped BigOperators namespace AnalyticBridge variable {Ω : Type*} theorem weighted_cauchy_sq (S : Finset Ω) (w U V : Ω → ℂ) : ‖∑ ω ∈ S, w ω * U ω * star (V ω)‖ ^ 2 ≤ (∑ ω ∈ S, ‖w ω‖ * ‖U ω‖ ^ 2) * (∑ ω ∈ S, ‖w ω‖ * ‖V ω‖ ^ 2) := by have htri : ‖∑ ω ∈ S, w ω * U ω * star (V ω)‖ ≤ ∑ ω ∈ S, ‖w ω‖ * ‖U ω‖ * ‖V ω‖ := by calc ‖∑ ω ∈ S, w ω * U ω * star (V ω)‖ ≤ ∑ ω ∈ S, ‖w ω * U ω * star (V ω)‖ := norm_sum_le _ _ _ = ∑ ω ∈ S, ‖w ω‖ * ‖U ω‖ * ‖V ω‖ := by apply Finset.sum_congr rfl intro ω hω simp [ ] have hnonneg : 0 ≤ ∑ ω ∈ S, ‖w ω‖ * ‖U ω‖ * ‖V ω‖ := Finset.sum_nonneg (by intro ω hω; positivity) have hsq : (∑ ω ∈ S, ‖w ω‖ * ‖U ω‖ * ‖V ω‖) ^ 2 ≤ (∑ ω ∈ S, ‖w ω‖ * ‖U ω‖ ^ 2) * (∑ ω ∈ S, ‖w ω‖ * ‖V ω‖ ^ 2) := by apply Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul S (fun ω hω => by positivity) (fun ω hω => by positivity) intro ω hω (convert le_refl ((‖w ω‖ * ‖U ω‖ * ‖V ω‖) ^ 2) using 1 ; ring) exact (sq_le_sq₀ (norm_nonneg _) hnonneg).2 htri |>.trans hsq structure CRTChoice where J : ℕ C : ℕ e : ℕ v : ℕ s : ℕ J2 : ℕ b1 : ℕ b2 : ℕ A1 : ℕ A2 : ℕ d : ℕ kpp : ℕ private def CRTChoice.coordinates (q : CRTChoice) : (ℕ × ℕ × ℕ × ℕ) × (ℕ × ℕ × ℕ × ℕ) × (ℕ × ℕ × ℕ × ℕ) := ((q.J, q.C, q.e, q.v), (q.s, q.J2, q.b1, q.b2), (q.A1, q.A2, q.d, q.kpp)) end AnalyticBridge open Filter Asymptotics MeasureTheory open scoped Topology namespace ExpBound end ExpBound namespace ShortDraftMellin theorem inverse_mellin_analytic (A : ℝ → ℂ) (σ : ℝ) (hlocal : LocallyIntegrableOn A (Set.Ioi 0)) (htop : A =O[atTop] (fun t : ℝ => t ^ σ)) (hzero : A =ᶠ[𝓝[>] (0 : ℝ)] (fun _ => 0)) : AnalyticOnNhd ℂ (fun s : ℂ => mellin A (-s)) {s : ℂ | σ < s.re} := by apply (Complex.analyticOnNhd_iff_differentiableOn (Complex.isOpen_re_gt σ)).2 intro s hs change σ < s.re at hs have htop' : A =O[atTop] (fun t : ℝ => t ^ (-(-σ))) := by simpa only [neg_neg] using htop have hbot : A =O[𝓝[>] (0 : ℝ)] (fun t : ℝ => t ^ (-((-s).re - 1))) := by exact hzero.isBigO.trans (isBigO_zero _ _) have hdiff : DifferentiableAt ℂ (mellin A) (-s) := mellin_differentiableAt_of_isBigO_rpow hlocal htop' (by simpa using neg_lt_neg hs) hbot (by linarith) exact (hdiff.comp s (differentiableAt_id.neg)).differentiableWithinAt end ShortDraftMellin end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.LogProfiles namespace OAI open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology Manifold namespace ShortDraftMellin end ShortDraftMellin namespace FiniteRingSieve variable {R : Type*} [CommRing R] [Fintype R] [DecidableEq R] noncomputable abbrev instFintypeMulCharComplex_oAI : Fintype (MulChar R ℂ) := Fintype.ofFinite _ omit [DecidableEq R] in private theorem sum_chars_zero {a : R} (ha : a ≠ 1) : letI := @OAI.FiniteRingSieve.instFintypeMulCharComplex_oAI (∑ χ : MulChar R ℂ, χ a) = 0 := letI := @OAI.FiniteRingSieve.instFintypeMulCharComplex_oAI by obtain ⟨χ, hχ⟩ := MulChar.exists_apply_ne_one_of_hasEnoughRootsOfUnity R ℂ ha refine eq_zero_of_mul_eq_self_left hχ ?_ simp only [Finset.mul_sum, ← MulChar.mul_apply] exact Fintype.sum_bijective _ (Group.mulLeft_bijective χ) _ _ fun χ' => rfl theorem sum_chars (a : R) : letI := @OAI.FiniteRingSieve.instFintypeMulCharComplex_oAI (∑ χ : MulChar R ℂ, χ a) = if a = 1 then (Fintype.card Rˣ : ℂ) else 0 := letI := @OAI.FiniteRingSieve.instFintypeMulCharComplex_oAI by split_ifs with ha · subst a simp only [map_one, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] have hc : Fintype.card (MulChar R ℂ) = Fintype.card Rˣ := by simpa only [Nat.card_eq_fintype_card] using MulChar.card_eq_card_units_of_hasEnoughRootsOfUnity R ℂ exact_mod_cast hc · exact sum_chars_zero ha theorem unit_char_orthogonal (u v : Rˣ) : letI := @OAI.FiniteRingSieve.instFintypeMulCharComplex_oAI (∑ χ : MulChar R ℂ, star (χ (u : R)) * χ (v : R)) = if u = v then (Fintype.card Rˣ : ℂ) else 0 := letI := @OAI.FiniteRingSieve.instFintypeMulCharComplex_oAI by calc _ = ∑ χ : MulChar R ℂ, χ ((u⁻¹ * v : Rˣ) : R) := by apply Finset.sum_congr rfl intro χ _ rw [MulChar.star_apply', MulChar.inv_apply, Ring.inverse_unit, Units.val_mul, map_mul] _ = if ((u⁻¹ * v : Rˣ) : R) = 1 then (Fintype.card Rˣ : ℂ) else 0 := sum_chars _ _ = _ := by simp only [Units.val_eq_one, inv_mul_eq_one] end FiniteRingSieve namespace FiniteFieldSieve variable {F : Type*} [Field F] [Fintype F] end FiniteFieldSieve namespace ProductResidueSieve variable {R S : Type*} [CommRing R] [CommRing S] end ProductResidueSieve open MeasureTheory Real open scoped FourierTransform SchwartzMap open scoped ContDiff namespace FourierBridge theorem schwartz_log_inversion (g : 𝓢(ℝ, ℂ)) (y : ℝ) : g y = ∫ t : ℝ, Complex.exp ((↑(2 * Real.pi * inner ℝ t y) * Complex.I)) * (𝓕 g) t := by have hinv : (𝓕⁻ (𝓕 g) : 𝓢(ℝ, ℂ)) = g := by simp have h := congrArg (fun f : 𝓢(ℝ, ℂ) => f y) hinv rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq'] at h simpa only [smul_eq_mul] using h.symm theorem fourier_coefficient_moment (g : 𝓢(ℝ, ℂ)) (J : ℕ) : ∫ t : ℝ, ‖t‖ ^ J * ‖(𝓕 g) t‖ ≤ (2 ^ (volume : Measure ℝ).integrablePower * ∫ t : ℝ, (1 + ‖t‖) ^ (-(volume : Measure ℝ).integrablePower : ℝ)) * ((SchwartzMap.seminorm ℝ 0 0) (𝓕 g) + (SchwartzMap.seminorm ℝ (J + (volume : Measure ℝ).integrablePower) 0) (𝓕 g)) := by simpa using SchwartzMap.integral_pow_mul_iteratedFDeriv_le ℝ volume (𝓕 g) J 0 theorem fourier_seminorm_from_derivative_integrals (g : 𝓢(ℝ, ℂ)) (k : ℕ) : (SchwartzMap.seminorm ℝ k 0) (𝓕 g) ≤ (2 : ℝ) ^ k * ∑ p ∈ Finset.range 1 ×ˢ Finset.range (k + 1), ∫ v : ℝ, ‖v‖ ^ p.1 * ‖iteratedFDeriv ℝ p.2 g v‖ := by have hpoint (w : ℝ) := Real.pow_mul_norm_iteratedFDeriv_fourier_le (K := ⊤) (N := ⊤) (f := (g : ℝ → ℂ)) (g.smooth ⊤) (by intro a b ha hb; exact g.integrable_pow_mul_iteratedFDeriv volume a b) (k := 0) (n := k) (by simp) (by simp) w have hpoint' (w : ℝ) : ‖w‖ ^ k * ‖(𝓕 g) w‖ ≤ (2 : ℝ) ^ k * ∑ p ∈ Finset.range 1 ×ˢ Finset.range (k + 1), ∫ v : ℝ, ‖v‖ ^ p.1 * ‖iteratedFDeriv ℝ p.2 g v‖ := by simpa [SchwartzMap.fourier_coe] using hpoint w apply SchwartzMap.seminorm_le_bound ℝ k 0 (𝓕 g) (by positivity) intro w simpa using hpoint' w theorem uniform_fourier_seminorm_transfer (g : 𝓢(ℝ, ℂ)) (k : ℕ) (S C : ℝ) (hS : 0 ≤ S) (_hC : 0 ≤ C) (hsource : ∀ i ≤ k, S * ((SchwartzMap.seminorm ℝ 0 i) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower i) g) ≤ C) : S * (SchwartzMap.seminorm ℝ k 0) (𝓕 g) ≤ (2 : ℝ) ^ k * (k + 1) * (2 ^ (volume : Measure ℝ).integrablePower * ∫ t : ℝ, (1 + ‖t‖) ^ (-(volume : Measure ℝ).integrablePower : ℝ)) * C := by let V : ℝ := 2 ^ (volume : Measure ℝ).integrablePower * ∫ t : ℝ, (1 + ‖t‖) ^ (-(volume : Measure ℝ).integrablePower : ℝ) have hV : 0 ≤ V := by dsimp [V]; positivity have hI (i : ℕ) (hi : i ≤ k) : S * (∫ t : ℝ, ‖iteratedFDeriv ℝ i g t‖) ≤ V * C := by have hbase := SchwartzMap.integral_pow_mul_iteratedFDeriv_le ℝ volume g 0 i have hbase' : (∫ t : ℝ, ‖iteratedFDeriv ℝ i g t‖) ≤ V * ((SchwartzMap.seminorm ℝ 0 i) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower i) g) := by simpa [V] using hbase calc S * (∫ t : ℝ, ‖iteratedFDeriv ℝ i g t‖) ≤ S * (V * ((SchwartzMap.seminorm ℝ 0 i) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower i) g)) := mul_le_mul_of_nonneg_left hbase' hS _ = V * (S * ((SchwartzMap.seminorm ℝ 0 i) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower i) g)) := by ring _ ≤ V * C := mul_le_mul_of_nonneg_left (hsource i hi) hV have hFourier := fourier_seminorm_from_derivative_integrals g k calc S * (SchwartzMap.seminorm ℝ k 0) (𝓕 g) ≤ S * ((2 : ℝ) ^ k * ∑ p ∈ Finset.range 1 ×ˢ Finset.range (k + 1), ∫ t : ℝ, ‖t‖ ^ p.1 * ‖iteratedFDeriv ℝ p.2 g t‖) := mul_le_mul_of_nonneg_left hFourier hS _ = (2 : ℝ) ^ k * ∑ p ∈ Finset.range 1 ×ˢ Finset.range (k + 1), S * (∫ t : ℝ, ‖t‖ ^ p.1 * ‖iteratedFDeriv ℝ p.2 g t‖) := by simp only [Finset.mul_sum] ring_nf _ ≤ (2 : ℝ) ^ k * ∑ _p ∈ Finset.range 1 ×ˢ Finset.range (k + 1), V * C := by apply mul_le_mul_of_nonneg_left _ (by positivity) apply Finset.sum_le_sum intro p hp have hp0 : p.1 = 0 := by have hlt := Finset.mem_range.mp (Finset.mem_product.mp hp).1 omega have hp2 : p.2 ≤ k := Nat.lt_succ_iff.mp (Finset.mem_range.mp (Finset.mem_product.mp hp).2) simpa [hp0] using hI p.2 hp2 _ = (2 : ℝ) ^ k * (k + 1) * V * C := by simp [] ring _ = (2 : ℝ) ^ k * (k + 1) * (2 ^ (volume : Measure ℝ).integrablePower * ∫ t : ℝ, (1 + ‖t‖) ^ (-(volume : Measure ℝ).integrablePower : ℝ)) * C := rfl theorem uniform_fourier_coefficient_moment (g : 𝓢(ℝ, ℂ)) (J : ℕ) (S C : ℝ) (hS : 0 ≤ S) (hC : 0 ≤ C) (hsource : ∀ i ≤ J + (volume : Measure ℝ).integrablePower, S * ((SchwartzMap.seminorm ℝ 0 i) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower i) g) ≤ C) : S * (∫ t : ℝ, ‖t‖ ^ J * ‖(𝓕 g) t‖) ≤ (2 ^ (volume : Measure ℝ).integrablePower * ∫ t : ℝ, (1 + ‖t‖) ^ (-(volume : Measure ℝ).integrablePower : ℝ)) * ((2 : ℝ) ^ 0 * (0 + 1) * (2 ^ (volume : Measure ℝ).integrablePower * ∫ t : ℝ, (1 + ‖t‖) ^ (-(volume : Measure ℝ).integrablePower : ℝ)) * C + (2 : ℝ) ^ (J + (volume : Measure ℝ).integrablePower) * (J + (volume : Measure ℝ).integrablePower + 1) * (2 ^ (volume : Measure ℝ).integrablePower * ∫ t : ℝ, (1 + ‖t‖) ^ (-(volume : Measure ℝ).integrablePower : ℝ)) * C) := by let p := (volume : Measure ℝ).integrablePower let V : ℝ := 2 ^ p * ∫ t : ℝ, (1 + ‖t‖) ^ (-(p : ℝ)) let K := J + p have hV : 0 ≤ V := by dsimp [V]; positivity have hfourier_zero := uniform_fourier_seminorm_transfer g 0 S C hS hC (by intro i hi; exact hsource i (by omega)) have hfourier_K := uniform_fourier_seminorm_transfer g K S C hS hC (by intro i hi; exact hsource i (by simpa [K, p] using hi)) have hmoment := fourier_coefficient_moment g J calc S * (∫ t : ℝ, ‖t‖ ^ J * ‖(𝓕 g) t‖) ≤ S * (V * ((SchwartzMap.seminorm ℝ 0 0) (𝓕 g) + (SchwartzMap.seminorm ℝ K 0) (𝓕 g))) := mul_le_mul_of_nonneg_left (by simpa [V, K, p] using hmoment) hS _ = V * (S * (SchwartzMap.seminorm ℝ 0 0) (𝓕 g) + S * (SchwartzMap.seminorm ℝ K 0) (𝓕 g)) := by ring _ ≤ V * ((2 : ℝ) ^ 0 * (0 + 1) * V * C + (2 : ℝ) ^ K * (K + 1) * V * C) := by apply mul_le_mul_of_nonneg_left _ hV exact add_le_add (by simpa [V] using hfourier_zero) (by simpa [K, V] using hfourier_K) _ = _ := by simp [V, K, p, Nat.cast_add] noncomputable def coefficientMomentBound (J : ℕ) (C : ℝ) : ℝ := let p := (volume : Measure ℝ).integrablePower let V : ℝ := 2 ^ p * ∫ t : ℝ, (1 + ‖t‖) ^ (-(p : ℝ)) V * (V * C + (2 : ℝ) ^ (J + p) * (J + p + 1) * V * C) theorem coefficientMomentBound_nonneg (J : ℕ) (C : ℝ) (hC : 0 ≤ C) : 0 ≤ coefficientMomentBound J C := by unfold coefficientMomentBound positivity theorem uniform_fourier_one_plus_moment (g : 𝓢(ℝ, ℂ)) (J : ℕ) (S C : ℝ) (hS : 0 ≤ S) (hC : 0 ≤ C) (hsource : ∀ i ≤ J + (volume : Measure ℝ).integrablePower, S * ((SchwartzMap.seminorm ℝ 0 i) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower i) g) ≤ C) : S * (∫ t : ℝ, (1 + ‖t‖) ^ J * ‖(𝓕 g) t‖) ≤ (2 : ℝ) ^ J * (coefficientMomentBound 0 C + coefficientMomentBound J C) := by let b := 𝓕 g have hI0 : Integrable (fun t : ℝ => ‖b t‖) volume := by simpa using b.integrable_pow_mul volume 0 have hIJ : Integrable (fun t : ℝ => ‖t‖ ^ J * ‖b t‖) volume := b.integrable_pow_mul volume J have hIrhs : Integrable (fun t : ℝ => (2 : ℝ) ^ J * (‖b t‖ + ‖t‖ ^ J * ‖b t‖)) volume := (hI0.add hIJ).const_mul _ have hpoint (t : ℝ) : (1 + ‖t‖) ^ J * ‖b t‖ ≤ (2 : ℝ) ^ J * (‖b t‖ + ‖t‖ ^ J * ‖b t‖) := by have hpow := add_pow_le (show (0 : ℝ) ≤ 1 by norm_num) (norm_nonneg t) J have htwo : (2 : ℝ) ^ (J - 1) ≤ (2 : ℝ) ^ J := pow_le_pow_right₀ (by norm_num) (Nat.sub_le J 1) calc (1 + ‖t‖) ^ J * ‖b t‖ ≤ (2 : ℝ) ^ (J - 1) * (1 ^ J + ‖t‖ ^ J) * ‖b t‖ := mul_le_mul_of_nonneg_right hpow (norm_nonneg _) _ ≤ (2 : ℝ) ^ J * (1 ^ J + ‖t‖ ^ J) * ‖b t‖ := by gcongr _ = (2 : ℝ) ^ J * (‖b t‖ + ‖t‖ ^ J * ‖b t‖) := by simp; ring have hintegral : (∫ t : ℝ, (1 + ‖t‖) ^ J * ‖b t‖) ≤ (2 : ℝ) ^ J * ((∫ t : ℝ, ‖b t‖) + (∫ t : ℝ, ‖t‖ ^ J * ‖b t‖)) := by calc _ ≤ ∫ t : ℝ, (2 : ℝ) ^ J * (‖b t‖ + ‖t‖ ^ J * ‖b t‖) := integral_mono_of_nonneg (Filter.Eventually.of_forall (by intro t; positivity)) hIrhs (Filter.Eventually.of_forall hpoint) _ = (2 : ℝ) ^ J * ((∫ t : ℝ, ‖b t‖) + (∫ t : ℝ, ‖t‖ ^ J * ‖b t‖)) := by rw [integral_const_mul, integral_add hI0 hIJ] have hbound0 := uniform_fourier_coefficient_moment g 0 S C hS hC (by intro i hi; exact hsource i (by omega)) have hboundJ := uniform_fourier_coefficient_moment g J S C hS hC hsource calc S * (∫ t : ℝ, (1 + ‖t‖) ^ J * ‖b t‖) ≤ S * ((2 : ℝ) ^ J * ((∫ t : ℝ, ‖b t‖) + (∫ t : ℝ, ‖t‖ ^ J * ‖b t‖))) := mul_le_mul_of_nonneg_left hintegral hS _ = (2 : ℝ) ^ J * (S * (∫ t : ℝ, ‖b t‖) + S * (∫ t : ℝ, ‖t‖ ^ J * ‖b t‖)) := by ring _ ≤ (2 : ℝ) ^ J * (coefficientMomentBound 0 C + coefficientMomentBound J C) := by apply mul_le_mul_of_nonneg_left _ (by positivity) apply add_le_add · simpa [coefficientMomentBound, b] using hbound0 · simpa [coefficientMomentBound, b] using hboundJ noncomputable def logPhase (t y : ℝ) : ℂ := Complex.exp (((2 * Real.pi * t * y : ℝ) : ℂ) * Complex.I) theorem logPhase_add (t u v : ℝ) : logPhase t (u + v) = logPhase t u * logPhase t v := by unfold logPhase convert Complex.exp_add _ _ using 1 ; push_cast ; ring_nf theorem logPhase_zero (t : ℝ) : logPhase t 0 = 1 := by simp [logPhase] theorem logPhase_sum {ι : Type*} [DecidableEq ι] (s : Finset ι) (t : ℝ) (z : ι → ℝ) : logPhase t (∑ i ∈ s, z i) = ∏ i ∈ s, logPhase t (z i) := by classical induction s using Finset.induction_on with | empty => simp [logPhase_zero] | @insert i s hi ih => simp [hi, logPhase_add, ih] theorem coupled_cutoff_active {ι : Type*} [Fintype ι] (W : ι → ℝ → ℂ) (V : ℝ → ℂ) (a y M : ι → ℝ) (hwindow : ∀ j z, W j z ≠ 0 → |z| ≤ M j) (hVone : ∀ s, |s| ≤ ∑ j : ι, |a j| * M j → V s = 1) (hprod : (∏ j : ι, W j (y j)) ≠ 0) : V (∑ j : ι, a j * y j) = 1 := by classical apply hVone calc |∑ j : ι, a j * y j| ≤ ∑ j : ι, |a j * y j| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j : ι, |a j| * M j := by apply Finset.sum_le_sum intro j hj have hnonzero : W j (y j) ≠ 0 := (Finset.prod_ne_zero_iff.mp hprod) j (Finset.mem_univ j) rw [abs_mul] exact mul_le_mul_of_nonneg_left (hwindow j (y j) hnonzero) (abs_nonneg _) theorem exists_complex_smooth_cutoff (T : ℝ) (hT : 0 ≤ T) : ∃ V : ℝ → ℂ, HasCompactSupport V ∧ ContDiff ℝ ∞ V ∧ (∀ s, |s| ≤ T → V s = 1) ∧ tsupport V ⊆ Set.Icc (-(T + 1)) (T + 1) ∧ V 0 = 1 := by let U : Set ℝ := Set.Ioo (-(T + 1)) (T + 1) let K : Set ℝ := Set.Icc (-T) T have hU : IsOpen U := isOpen_Ioo have hK : IsClosed K := isClosed_Icc have hKU : K ⊆ U := by intro s hs rcases hs with ⟨hleft, hright⟩ constructor <;> linarith obtain ⟨f, hf, _, hsupport, hone⟩ := exists_contMDiff_support_eq_eq_one_iff (I := 𝓘(ℝ, ℝ)) (n := ⊤) hU hK hKU let V : ℝ → ℂ := fun s => (f s : ℂ) have hf' : ContDiff ℝ ∞ f := by simpa only [contMDiff_iff_contDiff] using hf have hVs : ContDiff ℝ ∞ V := Complex.ofRealCLM.contDiff.comp hf' have hVsupport : Function.support V = Function.support f := by ext s simp [V, Function.mem_support] have hVsupportI : Function.support V ⊆ Set.Icc (-(T + 1)) (T + 1) := by intro s hs rw [hVsupport, hsupport] at hs exact ⟨hs.1.le, hs.2.le⟩ have hVtsupportI : tsupport V ⊆ Set.Icc (-(T + 1)) (T + 1) := closure_minimal hVsupportI isClosed_Icc have hVc : HasCompactSupport V := HasCompactSupport.of_support_subset_isCompact isCompact_Icc hVsupportI have hone' : ∀ s, |s| ≤ T → V s = 1 := by intro s hs have hsK : s ∈ K := by simpa [K, abs_le] using hs have hfs : f s = 1 := (hone s).mp hsK simp [V, hfs] exact ⟨V, hVc, hVs, hone', hVtsupportI, hone' 0 (by simpa using hT)⟩ theorem exists_complex_smooth_cutoff_with_derivative_bounds (T : ℝ) (K : ℕ) (hT : 0 ≤ T) : ∃ (V : ℝ → ℂ) (CW : ℝ), HasCompactSupport V ∧ ContDiff ℝ ∞ V ∧ (∀ s, |s| ≤ T → V s = 1) ∧ 0 ≤ CW ∧ (∀ i ≤ K, ∀ y, ‖iteratedFDeriv ℝ i V y‖ ≤ CW) ∧ (∀ y, (∃ i ≤ K, ‖iteratedFDeriv ℝ i V y‖ ≠ 0) → Real.exp (-(T + 1)) ≤ Real.exp y ∧ Real.exp y ≤ Real.exp (T + 1) ∧ |y| ≤ T + 1) := by obtain ⟨V, hVc, hVs, hVone, hVsupport, _⟩ := exists_complex_smooth_cutoff T hT have hbounds : ∃ CW : ℝ, 0 ≤ CW ∧ ∀ i ≤ K, ∀ y, ‖iteratedFDeriv ℝ i V y‖ ≤ CW := by have key (i : ℕ) : ∃ C, ∀ y, ‖iteratedFDeriv ℝ i V y‖ ≤ C := (hVs.continuous_iteratedFDeriv (by exact_mod_cast (le_top : (i : ℕ∞) ≤ ⊤))).bounded_above_of_compact_support (hVc.iteratedFDeriv i) choose A hA using key refine ⟨max 0 ((Finset.range (K + 1)).sup' ⟨0, by simp⟩ A), le_max_left _ _, ?_⟩ intro i hi y exact (hA i y).trans ((Finset.le_sup' A (by simp only [Finset.mem_range]; omega)).trans (le_max_right _ _)) obtain ⟨CW, hCW, hVderiv⟩ := hbounds refine ⟨V, CW, hVc, hVs, hVone, hCW, hVderiv, ?_⟩ intro y hy obtain ⟨i, hi, hnonzero⟩ := hy have hyderiv : y ∈ Function.support (iteratedFDeriv ℝ i V) := by simpa [Function.mem_support] using hnonzero have hysupport : y ∈ tsupport V := (support_iteratedFDeriv_subset i) hyderiv have hyinterval := hVsupport hysupport have hylower : -(T + 1) ≤ y := hyinterval.1 have hyupper : y ≤ T + 1 := hyinterval.2 constructor · exact Real.exp_le_exp.mpr hylower constructor · exact Real.exp_le_exp.mpr hyupper · exact abs_le.mpr ⟨hylower, hyupper⟩ end FourierBridge end OAI end section -- Source module: OAI.NumberTheory.DirichletL.ChineseRemainder.AdditiveCharacters namespace OAI open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap namespace ShortDraftCRT open AddChar variable {K : Type*} [Field K] theorem addChar_crt_pair (ψ : AddChar K ℂ) (m n u v z : K) (hm : m ≠ 0) (hn : n ≠ 0) (hbez : u * n + v * m = 1) : ψ (z / (m * n)) = ψ (u * z / m) * ψ (v * z / n) := by rw [← map_add_eq_mul] congr 1 calc z / (m * n) = z * (u * n + v * m) / (m * n) := by rw [hbez, mul_one] _ = u * z / m + v * z / n := by field_simp theorem normalized_crt_pair {R : Type*} [CommRing R] (ι : R →+* K) (ψ : AddChar K ℂ) (lam c₀ r d x u w : R) (hlam : ι lam ≠ 0) (hc₀ : ι c₀ ≠ 0) (hr : ι r ≠ 0) (hbez : u * r + (lam ^ 3 * w) * c₀ = 1) : ψ (-(ι d * (ι x / ι lam ^ 4)) / (ι c₀ * ι r)) = ψ (-(ι d * ι u * (ι x / ι lam ^ 4)) / ι c₀) * ψ (ι (-d * w * x) / (ι lam * ι r)) := by have hbezK : ι u * ι r + ι (lam ^ 3 * w) * ι c₀ = 1 := by simpa only [map_add, map_mul, map_one] using congrArg ι hbez have hsplit := addChar_crt_pair ψ (ι c₀) (ι r) (ι u) (ι (lam ^ 3 * w)) (-(ι d * (ι x / ι lam ^ 4))) hc₀ hr hbezK rw [hsplit] congr 1 · congr 1 ring · congr 1 simp only [map_mul, map_pow, map_neg] field_simp variable {R : Type*} [CommRing R] def crossDen (c₀ : R) : List (R × R) → R | [] => c₀ | (p, _) :: xs => crossDen c₀ xs * p def crossNum (a c₀ : R) : List (R × R) → R | [] => a | (p, h) :: xs => crossNum a c₀ xs * p + h * crossDen c₀ xs def GoodRows (c₀ : R) : List (R × R) → Prop | [] => True | (p, h) :: xs => GoodRows c₀ xs ∧ IsCoprime h p ∧ IsCoprime (crossDen c₀ xs) p end ShortDraftCRT namespace ShortDraftDescent end ShortDraftDescent namespace ShortDraftTrace open Complex open scoped ComplexConjugate section Generic variable (ω : ℂ) (hω : ω ^ 2 + ω + 1 = 0) (hconj : conj ω = ω ^ 2) include hω hconj omit hconj in private lemma lam_ne_zero : (1 + 2 * ω : ℂ) ≠ 0 := by intro h have hw : ω = -(1 : ℂ) / 2 := by linear_combination h / 2 rw [hw] at hω norm_num at hω private lemma conj_lam : conj (1 + 2 * ω) = -(1 + 2 * ω) := by rw [map_add, map_one, map_mul, map_ofNat, hconj] linear_combination 2 * hω omit hconj in private lemma omega_sub_square : ω - ω ^ 2 = 1 + 2 * ω := by linear_combination -hω theorem trace_div_lam (a b : ℤ) : ((a : ℂ) + (b : ℂ) * ω) / (1 + 2 * ω) + conj (((a : ℂ) + (b : ℂ) * ω) / (1 + 2 * ω)) = (b : ℂ) := by have hl := lam_ne_zero ω hω simp only [map_div₀, map_add, map_intCast, map_mul, hconj, conj_lam ω hω hconj] rw [div_neg, ← sub_eq_add_neg, ← sub_div] calc ((a : ℂ) + (b : ℂ) * ω - ((a : ℂ) + (b : ℂ) * ω ^ 2)) / (1 + 2 * ω) = (b : ℂ) * (ω - ω ^ 2) / (1 + 2 * ω) := by ring _ = (b : ℂ) := by rw [omega_sub_square ω hω]; field_simp theorem trace_character_period (a b : ℤ) : Complex.exp (2 * Real.pi * Complex.I * ((((a : ℂ) + (b : ℂ) * ω) / (1 + 2 * ω)) + conj (((a : ℂ) + (b : ℂ) * ω) / (1 + 2 * ω)))) = 1 := by rw [trace_div_lam ω hω hconj a b] calc _ = Complex.exp ((b : ℂ) * (2 * Real.pi * Complex.I)) := by congr 1; ring _ = Complex.exp (2 * Real.pi * Complex.I) ^ b := Complex.exp_int_mul _ _ _ = 1 := by rw [Complex.exp_two_pi_mul_I, one_zpow] end Generic noncomputable def ω₃ : ℂ := ((-1 : ℂ) + (Real.sqrt 3 : ℝ) * Complex.I) / 2 private theorem omega_sq : ω₃ ^ 2 = -ω₃ - 1 := by have hs : (Real.sqrt 3 : ℝ) ^ 2 = 3 := Real.sq_sqrt (by norm_num) have hs' : ((Real.sqrt 3 : ℝ) : ℂ) ^ 2 = 3 := by norm_cast have hquad : ω₃ ^ 2 + ω₃ + 1 = (3 + ((Real.sqrt 3 : ℝ) : ℂ) ^ 2 * Complex.I ^ 2) / 4 := by unfold ω₃ ring rw [hs', Complex.I_sq] at hquad norm_num at hquad linear_combination hquad theorem omega_conj : conj ω₃ = ω₃ ^ 2 := by rw [omega_sq] unfold ω₃ simp only [map_div₀, map_add, map_neg, map_one, map_mul, Complex.conj_ofReal, Complex.conj_I, map_ofNat] ring noncomputable def breveE : AddChar ℂ ℂ where toFun z := Complex.exp (2 * Real.pi * Complex.I * (z + conj z)) map_zero_eq_one' := by simp map_add_eq_mul' z w := by have harg : 2 * Real.pi * Complex.I * (z + w + conj (z + w)) = 2 * Real.pi * Complex.I * (z + conj z) + 2 * Real.pi * Complex.I * (w + conj w) := by rw [map_add] ring rw [harg, Complex.exp_add] theorem breveE_period_lam (a b : ℤ) : breveE (((a : ℂ) + (b : ℂ) * ω₃) / (1 + 2 * ω₃)) = 1 := by apply trace_character_period ω₃ · rw [omega_sq]; ring · exact omega_conj private theorem lam_eq_sqrt3_mul_I : 1 + 2 * ω₃ = (Real.sqrt 3 : ℝ) * Complex.I := by unfold ω₃ ring private theorem sub_conj_eq (z : ℂ) : z - conj z = 2 * (z.im : ℂ) * Complex.I := by apply Complex.ext · simp [Complex.mul_re] · simp [Complex.mul_im] ring theorem breveE_div_lam_eq_e (z : ℂ) : breveE (z / (1 + 2 * ω₃)) = Complex.exp (4 * Real.pi * Complex.I * (z.im / Real.sqrt 3)) := by have hs : (Real.sqrt 3 : ℝ) ≠ 0 := ne_of_gt (Real.sqrt_pos.2 (by norm_num)) have hl : ((Real.sqrt 3 : ℝ) : ℂ) * Complex.I ≠ 0 := mul_ne_zero (by exact_mod_cast hs) Complex.I_ne_zero change Complex.exp (2 * Real.pi * Complex.I * (z / (1 + 2 * ω₃) + conj (z / (1 + 2 * ω₃)))) = _ rw [lam_eq_sqrt3_mul_I] have hc : conj (((Real.sqrt 3 : ℝ) : ℂ) * Complex.I) = -(((Real.sqrt 3 : ℝ) : ℂ) * Complex.I) := by simp [map_mul, Complex.conj_ofReal, Complex.conj_I] rw [map_div₀, hc, div_neg, ← sub_eq_add_neg, ← sub_div, sub_conj_eq] congr 1 field_simp ring end ShortDraftTrace end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Arithmetic.EisensteinIdeals namespace OAI open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap noncomputable section namespace ActualEisensteinSieve abbrev K := CyclotomicField 3 ℚ abbrev O := NumberField.RingOfIntegers K private theorem instIsCyclotomicExtensionSingletonNatSetOfNatRatK : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ private theorem instIsPrincipalIdealRingO : IsPrincipalIdealRing O := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact IsCyclotomicExtension.Rat.three_pid K def omega : O := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact (IsCyclotomicExtension.zeta_spec 3 ℚ K).toInteger private def lambda : O := omega - 1 private def lambdaIdeal : Ideal O := Ideal.span {lambda} private theorem lambda_prime : Prime lambda := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK let : Fact (Nat.Prime 3) := ⟨Nat.prime_three⟩ exact (IsCyclotomicExtension.zeta_spec 3 ℚ K).zeta_sub_one_prime' theorem lambda_maximal : lambdaIdeal.IsMaximal := by letI : IsPrincipalIdealRing O := instIsPrincipalIdealRingO have hp : lambdaIdeal.IsPrime := Ideal.isPrime_span_singleton_of_prime lambda_prime have hne : lambdaIdeal ≠ ⊥ := by exact Ideal.span_singleton_eq_bot.not.mpr lambda_prime.ne_zero exact hp.isMaximal hne theorem lambda_card : Nat.card (O ⧸ lambdaIdeal) = 3 := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK let : Fact (Nat.Prime 3) := ⟨Nat.prime_three⟩ rw [lambdaIdeal, lambda, omega, (IsCyclotomicExtension.zeta_spec 3 ℚ K).card_quotient_toInteger_sub_one, (IsCyclotomicExtension.zeta_spec 3 ℚ K).norm_toInteger_sub_one_of_prime_ne_two' (by decide)] norm_num example (P : Ideal O) [P.IsMaximal] : Field (O ⧸ P) := Ideal.Quotient.field P example (P : Ideal O) [P.IsMaximal] : Finite (O ⧸ P) := inferInstance private theorem instIsMaximalOLambdaIdeal : lambdaIdeal.IsMaximal := lambda_maximal theorem lambda_residue_odd : ringChar (O ⧸ lambdaIdeal) ≠ 2 := by letI : lambdaIdeal.IsMaximal := instIsMaximalOLambdaIdeal classical let : Field (O ⧸ lambdaIdeal) := Ideal.Quotient.field lambdaIdeal let : Fintype (O ⧸ lambdaIdeal) := Fintype.ofFinite (O ⧸ lambdaIdeal) intro hchar have hcard := FiniteField.even_card_of_char_two hchar rw [← Nat.card_eq_fintype_card, lambda_card] at hcard norm_num at hcard end ActualEisensteinSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Cusp.MatrixPhases namespace OAI open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap noncomputable section namespace ShortDraftCusp variable {R : Type*} [CommRing R] def U (t : R) : Matrix (Fin 2) (Fin 2) R := !![1,t;0,1] def L (t : R) : Matrix (Fin 2) (Fin 2) R := !![1,0;t,1] def E : Matrix (Fin 2) (Fin 2) R := !![0,-1;1,0] end ShortDraftCusp namespace ShortDraftConcretePhase open ShortDraftTrace end ShortDraftConcretePhase namespace ShortDraftGauss open Complex open scoped ComplexConjugate variable {F : Type*} [Field F] [Fintype F] theorem norm_gaussSum_eq_sqrt_card (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (hχ : χ ≠ 1) (hψ : ψ.IsPrimitive) : ‖gaussSum χ ψ‖ = Real.sqrt (Fintype.card F) := by let g := gaussSum χ ψ have hprod : g * conj g = (Fintype.card F : ℂ) := by have h := gaussSum_mul_gaussSum_eq_card hχ hψ rw [← star_gaussSum_eq] at h simpa only [g, Complex.star_def] using h have hnorm : ‖g‖ ^ 2 = (Fintype.card F : ℝ) := by apply Complex.ofReal_injective calc ((‖g‖ ^ 2 : ℝ) : ℂ) = (‖g‖ : ℂ) ^ 2 := by norm_cast _ = g * conj g := (Complex.mul_conj' g).symm _ = (Fintype.card F : ℂ) := hprod _ = ((Fintype.card F : ℝ) : ℂ) := by norm_cast have hcard : (0 : ℝ) ≤ Fintype.card F := by positivity have hsqrt := Real.sq_sqrt hcard nlinarith [norm_nonneg g, Real.sqrt_nonneg (Fintype.card F)] theorem norm_normalized_gaussSum (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (hχ : χ ≠ 1) (hψ : ψ.IsPrimitive) : ‖((Real.sqrt (Fintype.card F) : ℝ) : ℂ)⁻¹ * gaussSum χ ψ‖ = 1 := by have hcard : (0 : ℝ) < Fintype.card F := by exact_mod_cast Fintype.card_pos_iff.mpr ⟨(0 : F)⟩ have hsqrt : Real.sqrt (Fintype.card F) ≠ 0 := ne_of_gt (Real.sqrt_pos.2 hcard) rw [norm_mul, norm_inv, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (Real.sqrt_pos.2 hcard), norm_gaussSum_eq_sqrt_card χ ψ hχ hψ] exact inv_mul_cancel₀ hsqrt end ShortDraftGauss namespace EisensteinRayPhase abbrev SquareClass := ZMod 2 × ZMod 2 def R (a b : SquareClass) : ℤ := (-1) ^ (a.1.val * b.2.val + a.2.val * b.1.val + a.2.val * b.2.val) end EisensteinRayPhase namespace ShortDraftSextic open scoped Classical variable {R : Type*} [CommRing R] theorem sextic_power_is_unit_mask (χ : MulChar R ℂ) (hχ : χ ^ 6 = 1) (u : R) : χ (u ^ 6) = if IsUnit u then 1 else 0 := by classical rw [map_pow, ← MulChar.pow_apply' χ (by decide : 6 ≠ 0), hχ] by_cases hu : IsUnit u · simp [hu, MulChar.one_apply] · simp [hu] end ShortDraftSextic namespace ShortDraftGaussJacobi open Finset variable {F : Type*} [Field F] [Fintype F] end ShortDraftGaussJacobi namespace ShortDraftQuadraticGauss open Finset variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] theorem quadratic_gauss_as_square_phase (ψ : AddChar F ℂ) (hchar : ringChar F ≠ 2) (hψ : ψ ≠ 1) : gaussSum ((quadraticChar F).ringHomComp (Int.castRingHom ℂ)) ψ = ∑ x : F, ψ (x ^ 2) := by have hfiber : (∑ x : F, ψ (x ^ 2)) = ∑ y : F, (#{x : F | x ^ 2 = y}.toFinset : ℂ) * ψ y := by rw [← Finset.sum_fiberwise (s := Finset.univ) (g := fun x : F => x ^ 2) (f := fun x : F => ψ (x ^ 2))] apply Finset.sum_congr rfl intro y _ have hterm : (∑ x ∈ Finset.univ with x ^ 2 = y, ψ (x ^ 2)) = (#{x : F | x ^ 2 = y}.toFinset : ℂ) * ψ y := by rw [Finset.sum_congr rfl (fun x hx => by simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hx rw [hx])] simp exact hterm have hcount (y : F) : (#{x : F | x ^ 2 = y}.toFinset : ℂ) = (quadraticChar F y : ℂ) + 1 := by exact_mod_cast quadraticChar_card_sqrts hchar y rw [hfiber] simp_rw [hcount, add_mul] rw [Finset.sum_add_distrib] have hzero : (∑ y : F, ψ y) = 0 := AddChar.sum_eq_zero_of_ne_one hψ simp only [one_mul, hzero, add_zero] rfl end ShortDraftQuadraticGauss namespace ShortDraftQuotientPhase variable {A B : Type*} [CommGroup A] [CommGroup B] end ShortDraftQuotientPhase namespace EisensteinEPrimaryPhase abbrev Coord := ZMod 4 × ZMod 4 def mul (x y : Coord) : Coord := (x.1 * y.1 - x.2 * y.2, x.1 * y.2 + x.2 * y.1 - x.2 * y.2) def odd (x : Coord) : Prop := x.1.val % 2 = 1 ∨ x.2.val % 2 = 1 def instDecidablePredCoordOdd : DecidablePred odd := fun x => inferInstanceAs (Decidable (x.1.val % 2 = 1 ∨ x.2.val % 2 = 1)) def norm (x : Coord) : ZMod 4 := x.1 * x.1 - x.1 * x.2 + x.2 * x.2 theorem odd_mul (x y : Coord) (hx : odd x) (hy : odd y) : odd (mul x y) := by simp only [odd] at * decide +revert end EisensteinEPrimaryPhase namespace ShortDraftGaussianPhaseTable abbrev SquareClass := ZMod 2 × ZMod 2 def phase (a : SquareClass) : ZMod 4 := if a.2 = 0 then 0 else if a.1 = 0 then 1 else 3 end ShortDraftGaussianPhaseTable namespace ActualEisensteinCoordinates abbrev K := CyclotomicField 3 ℚ abbrev O := NumberField.RingOfIntegers K private theorem instIsCyclotomicExtensionSingletonNatSetOfNatRatK : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ private theorem hζ : IsPrimitiveRoot (@IsCyclotomicExtension.zeta 3 _ ℚ K _ _ _ instIsCyclotomicExtensionSingletonNatSetOfNatRatK) 3 := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact IsCyclotomicExtension.zeta_spec 3 ℚ K def omega : O := hζ.toInteger private def pb : PowerBasis ℤ O := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact hζ.integralPowerBasis private theorem pb_dim : pb.dim = 2 := by simp [pb, Nat.totient_prime Nat.prime_three] theorem pb_gen : pb.gen = omega := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact hζ.integralPowerBasis_gen theorem exists_coordinates (x : O) : ∃ a b : ℤ, x = (a : O) + (b : O) * omega := by let i0 : Fin pb.dim := ⟨0, by rw [pb_dim]; decide⟩ let i1 : Fin pb.dim := ⟨1, by rw [pb_dim]; decide⟩ let a : ℤ := (pb.basis.repr x) i0 let b : ℤ := (pb.basis.repr x) i1 refine ⟨a, b, ?_⟩ have hsum := pb.basis.sum_repr x have huniv : (Finset.univ : Finset (Fin pb.dim)) = {i0, i1} := by ext i have hi : i.val < 2 := by simpa only [pb_dim] using i.isLt have hv : i.val = 0 ∨ i.val = 1 := by omega simp only [Finset.mem_univ, Finset.mem_insert, Finset.mem_singleton, true_iff] rcases hv with h | h · left; exact Fin.ext h · right; exact Fin.ext h rw [huniv] at hsum have hne : i0 ≠ i1 := by decide have hnot : i0 ∉ ({i1} : Finset (Fin pb.dim)) := by simpa only [Finset.mem_singleton] using hne rw [Finset.sum_insert hnot, Finset.sum_singleton] at hsum simp only [pb.basis_eq_pow] at hsum have hi0 : (i0 : ℕ) = 0 := rfl have hi1 : (i1 : ℕ) = 1 := rfl simpa [a, b, hi0, hi1, pb_gen, smul_eq_mul, mul_comm] using hsum.symm private def i0 : Fin pb.dim := ⟨0, by rw [pb_dim]; decide⟩ private def i1 : Fin pb.dim := ⟨1, by rw [pb_dim]; decide⟩ def eval (a b : ℤ) : O := (a : O) + (b : O) * omega private theorem eval_basis (a b : ℤ) : eval a b = a • pb.basis i0 + b • pb.basis i1 := by simp [eval, PowerBasis.basis_eq_pow, i0, i1, pb_gen, mul_comm] theorem unique_coordinates {a b c d : ℤ} (h : eval a b = eval c d) : a = c ∧ b = d := by have h0 := congrArg (fun x : O => (pb.basis.repr x) i0) h have h1 := congrArg (fun x : O => (pb.basis.repr x) i1) h have hne : i0 ≠ i1 := by decide rw [eval_basis, eval_basis] at h0 h1 constructor · simpa only [map_add, map_smul, pb.basis.repr_self, Finsupp.add_apply, Finsupp.smul_apply, Finsupp.single_apply, ite_eq_left, ite_eq_right hne.symm, smul_eq_mul, mul_one, mul_zero, add_zero] using h0 · simpa only [map_add, map_smul, pb.basis.repr_self, Finsupp.add_apply, Finsupp.smul_apply, Finsupp.single_apply, ite_eq_left, ite_eq_right hne, smul_eq_mul, mul_one, mul_zero, zero_add] using h1 private theorem omega_sq : omega ^ 2 = -omega - 1 := by simpa [omega] using IsCyclotomicExtension.Rat.Three.eta_sq hζ theorem eval_mul (a b c d : ℤ) : eval a b * eval c d = eval (a*c-b*d) (a*d+b*c-b*d) := by simp only [eval] calc ((a : O) + (b : O) * omega) * ((c : O) + (d : O) * omega) = (a : O) * c + ((a : O) * d + (b : O) * c) * omega + ((b : O) * d) * omega ^ 2 := by ring _ = ((a*c-b*d : ℤ) : O) + ((a*d+b*c-b*d : ℤ) : O) * omega := by rw [omega_sq] push_cast ring theorem eval_congr_mod_four {a b c d : ℤ} (ha : (a : ZMod 4) = c) (hb : (b : ZMod 4) = d) : ∃ z : O, eval a b - eval c d = 4 * z := by have ha4 : (4 : ℤ) ∣ a-c := (ZMod.intCast_eq_intCast_iff_dvd_sub c a 4).mp ha.symm have hb4 : (4 : ℤ) ∣ b-d := (ZMod.intCast_eq_intCast_iff_dvd_sub d b 4).mp hb.symm obtain ⟨u, hu⟩ := ha4 obtain ⟨v, hv⟩ := hb4 refine ⟨(u : O) + (v : O) * omega, ?_⟩ dsimp [eval] rw [show a = c + 4*u by omega, show b = d + 4*v by omega] push_cast ring private theorem exists_pair (x : O) : ∃ p : ℤ × ℤ, eval p.1 p.2 = x := by obtain ⟨a, b, h⟩ := exists_coordinates x exact ⟨(a, b), h.symm⟩ def coords (x : O) : ℤ × ℤ := Classical.choose (exists_pair x) theorem eval_coords (x : O) : eval (coords x).1 (coords x).2 = x := Classical.choose_spec (exists_pair x) def residue (x : O) : EisensteinEPrimaryPhase.Coord := ((coords x).1, (coords x).2) theorem residue_eval (a b : ℤ) : residue (eval a b) = ((a : ZMod 4), (b : ZMod 4)) := by have h := unique_coordinates (eval_coords (eval a b)) exact Prod.ext (congrArg (fun n : ℤ => (n : ZMod 4)) h.1) (congrArg (fun n : ℤ => (n : ZMod 4)) h.2) theorem residue_mul (x y : O) : residue (x*y) = EisensteinEPrimaryPhase.mul (residue x) (residue y) := by calc residue (x*y) = residue (eval (coords x).1 (coords x).2 * eval (coords y).1 (coords y).2) := by rw [eval_coords, eval_coords] _ = EisensteinEPrimaryPhase.mul (residue x) (residue y) := by rw [eval_mul, residue_eval] simp [residue, EisensteinEPrimaryPhase.mul] theorem congr_mod_four_of_residue_eq {x y : O} (h : residue x = residue y) : ∃ z : O, x-y = 4*z := by rw [←eval_coords x, ←eval_coords y] apply eval_congr_mod_four · exact congrArg Prod.fst h · exact congrArg Prod.snd h def lift (v : EisensteinEPrimaryPhase.Coord) : O := eval (v.1.val : ℤ) (v.2.val : ℤ) theorem residue_lift (v : EisensteinEPrimaryPhase.Coord) : residue (lift v) = v := by simp [lift, residue_eval] private theorem residue_two : residue (2 : O) = (2, 0) := by have h : eval 2 0 = (2 : O) := by simp [eval] rw [← h, residue_eval] norm_num private theorem not_odd_mul_two (v : EisensteinEPrimaryPhase.Coord) : ¬ EisensteinEPrimaryPhase.odd (EisensteinEPrimaryPhase.mul (2, 0) v) := by simp only [EisensteinEPrimaryPhase.odd] at * decide +revert private theorem not_odd_cast_zero (v : EisensteinEPrimaryPhase.Coord) (h : ¬ EisensteinEPrimaryPhase.odd v) : (ZMod.cast v.1 : ZMod 2) = 0 ∧ (ZMod.cast v.2 : ZMod 2) = 0 := by simp only [EisensteinEPrimaryPhase.odd] at * decide +revert theorem odd_residue_iff_not_two_dvd (x : O) : EisensteinEPrimaryPhase.odd (residue x) ↔ ¬ (2 : O) ∣ x := by constructor · intro hx hdiv obtain ⟨y, hy⟩ := hdiv rw [hy, residue_mul, residue_two] at hx exact not_odd_mul_two (residue y) hx · intro hdiv by_contra hodd obtain ⟨ha, hb⟩ := not_odd_cast_zero (residue x) hodd have ha' : ((coords x).1 : ZMod 2) = 0 := by simpa [residue, ZMod.cast_intCast (by decide : 2 ∣ 4)] using ha have hb' : ((coords x).2 : ZMod 2) = 0 := by simpa [residue, ZMod.cast_intCast (by decide : 2 ∣ 4)] using hb obtain ⟨a, ha2⟩ := (ZMod.intCast_zmod_eq_zero_iff_dvd (coords x).1 2).mp ha' obtain ⟨b, hb2⟩ := (ZMod.intCast_zmod_eq_zero_iff_dvd (coords x).2 2).mp hb' apply hdiv refine ⟨eval a b, ?_⟩ rw [← eval_coords x] dsimp [eval] rw [ha2, hb2] push_cast ring end ActualEisensteinCoordinates end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.FiniteFourier namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap namespace ShortDraftFiniteGaussFourier open scoped Classical open AddChar MulChar variable {F : Type*} [Field F] [Fintype F] theorem gauss_transform (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (hχ : χ ≠ 1) (h : F) : (∑ x : F, χ x * ψ (h * x)) = if h = 0 then 0 else (χ h)⁻¹ * gaussSum χ ψ := by classical by_cases hh : h = 0 · subst h simp only [zero_mul, map_zero_eq_one, mul_one, ite_true] exact MulChar.sum_eq_zero_of_ne_one hχ · have hu : IsUnit h := isUnit_iff_ne_zero.mpr hh have hshift := gaussSum_mulShift_eq χ ψ hu.unit simp only [gaussSum, AddChar.mulShift_apply] at hshift simpa only [hu.unit_spec, ite_eq_right hh, inv_apply_eq_inv' χ h, gaussSum] using hshift theorem product_gauss_transform {ι : Type*} [Fintype ι] (E : ι → Type*) [∀ i, Field (E i)] [∀ i, Fintype (E i)] (χ : ∀ i, MulChar (E i) ℂ) (ψ : ∀ i, AddChar (E i) ℂ) (hχ : ∀ i, χ i ≠ 1) (h : ∀ i, E i) : (∑ x : ∀ i, E i, ∏ i, χ i (x i) * ψ i (h i * x i)) = ∏ i, if h i = 0 then 0 else (χ i (h i))⁻¹ * gaussSum (χ i) (ψ i) := by classical calc (∑ x : ∀ i, E i, ∏ i, χ i (x i) * ψ i (h i * x i)) = ∏ i, ∑ x : E i, χ i x * ψ i (h i * x) := by simpa using (Fintype.prod_sum (fun i (x : E i) => χ i x * ψ i (h i * x))).symm _ = ∏ i, if h i = 0 then 0 else (χ i (h i))⁻¹ * gaussSum (χ i) (ψ i) := by apply Finset.prod_congr rfl intro i _ exact gauss_transform (χ i) (ψ i) (hχ i) (h i) end ShortDraftFiniteGaussFourier namespace PoissonChildCRT open scoped Classical variable (n : ℕ) (χ : MulChar (ZMod n) ℂ) def mask (n m : ℕ) : ℂ := if n.Coprime m then 1 else 0 theorem mask_mul (n a b : ℕ) : mask n (a * b) = mask n a * mask n b := by classical simp only [mask] by_cases hab : n.Coprime (a * b) · have ha : n.Coprime a := (Nat.coprime_mul_iff_right.mp hab).1 have hb : n.Coprime b := (Nat.coprime_mul_iff_right.mp hab).2 rw [ite_eq_left hab, ite_eq_left ha, ite_eq_left hb] norm_num · have hna_or_hnb : ¬ n.Coprime a ∨ ¬ n.Coprime b := by by_contra h exact hab (Nat.coprime_mul_iff_right.mpr ⟨not_not.mp (not_or.mp h).1, not_not.mp (not_or.mp h).2⟩) rcases hna_or_hnb with hna | hnb · rw [ite_eq_right hab, ite_eq_right hna] simp · rw [ite_eq_right hab, ite_eq_right hnb] simp end PoissonChildCRT namespace PoissonFirstLocal open scoped Classical def bit (b : Bool) : ℕ := if b then 1 else 0 def localE (parityBit ε₁ ε₂ : Bool) : ZMod 6 := (bit ε₁ : ZMod 6) - (bit ε₂ : ZMod 6) + 3 * (bit parityBit : ZMod 6) def cExp₁ (parityBit ε₁ ε₂ : Bool) : ℕ := if localE parityBit ε₁ ε₂ = 0 then 0 else ((1 : ZMod 6) + localE parityBit ε₁ ε₂).val def cExp₂ (parityBit ε₁ ε₂ : Bool) : ℕ := if localE parityBit ε₁ ε₂ = 0 then 0 else ((1 : ZMod 6) - localE parityBit ε₁ ε₂).val def EExp (parityBit ε₁ ε₂ : Bool) : ℕ := if parityBit then bit ε₁ + bit ε₂ else 0 def retained (parityBit ε₁ ε₂ : Bool) : Bool := parityBit || (ε₁ && ε₂) def totalExp₁ (parityBit ε₁ ε₂ : Bool) : ℕ := 4 * bit ε₁ + cExp₁ parityBit ε₁ ε₂ + EExp parityBit ε₁ ε₂ def totalExp₂ (parityBit ε₁ ε₂ : Bool) : ℕ := 4 * bit ε₂ + cExp₂ parityBit ε₁ ε₂ + EExp parityBit ε₁ ε₂ theorem exponent_table (parityBit ε₁ ε₂ : Bool) : totalExp₁ parityBit ε₁ ε₂ % 6 = (if retained parityBit ε₁ ε₂ then 4 else 0) ∧ totalExp₂ parityBit ε₁ ε₂ % 6 = (if retained parityBit ε₁ ε₂ then 4 else 0) := by cases parityBit <;> cases ε₁ <;> cases ε₂ <;> decide def mask (n p : ℕ) : ℂ := if n.Coprime p then 1 else 0 private theorem mask_mul (n a b : ℕ) : mask n (a * b) = mask n a * mask n b := by classical simp only [mask] by_cases hab : n.Coprime (a * b) · have ha : n.Coprime a := (Nat.coprime_mul_iff_right.mp hab).1 have hb : n.Coprime b := (Nat.coprime_mul_iff_right.mp hab).2 rw [ite_eq_left hab, ite_eq_left ha, ite_eq_left hb] norm_num · have hna_or_hnb : ¬ n.Coprime a ∨ ¬ n.Coprime b := by by_contra h exact hab (Nat.coprime_mul_iff_right.mpr ⟨not_not.mp (not_or.mp h).1, not_not.mp (not_or.mp h).2⟩) rcases hna_or_hnb with hna | hnb · rw [ite_eq_right hab, ite_eq_right hna] simp · rw [ite_eq_right hab, ite_eq_right hnb] simp private theorem mask_prod (n : ℕ) (S : Finset ℕ) : (∏ p ∈ S, mask n p) = mask n (∏ p ∈ S, p) := by classical induction S using Finset.induction_on with | empty => simp [mask] | @insert p S hp ih => simp [hp, ih] exact (mask_mul n p (∏ p ∈ S, p)).symm end PoissonFirstLocal open Finset Complex namespace ActualCubicChar variable {R F : Type*} [CommRing R] [IsDomain R] [Field F] omit [IsDomain R] in private theorem cubic_roots_surjective (ρ : R →+* F) (ζ : R) (hζ : IsPrimitiveRoot ζ 3) (hζF : IsPrimitiveRoot (ρ ζ) 3) : Function.Surjective (restrictRootsOfUnity ρ 3) := by intro η have hη : ((η : Fˣ) : F) ^ 3 = 1 := by exact (mem_rootsOfUnity' 3 (η : Fˣ)).mp η.property obtain ⟨j, _, hj⟩ := hζF.eq_pow_of_pow_eq_one hη let z : rootsOfUnity 3 R := rootsOfUnity.mkOfPowEq ζ hζ.pow_eq_one refine ⟨z ^ j, ?_⟩ apply rootsOfUnity.coe_injective change ρ (ζ ^ j) = ((η : Fˣ) : F) rw [map_pow] exact hj private noncomputable def cubic_roots_equiv (ρ : R →+* F) (ζ : R) (hζ : IsPrimitiveRoot ζ 3) (hζF : IsPrimitiveRoot (ρ ζ) 3) : rootsOfUnity 3 R ≃* rootsOfUnity 3 F := by classical letI : Fintype (rootsOfUnity 3 R) := Fintype.ofFinite _ letI : Fintype (rootsOfUnity 3 F) := Fintype.ofFinite _ apply MulEquiv.ofBijective (restrictRootsOfUnity ρ 3) apply (Fintype.bijective_iff_surjective_and_card _).2 constructor · exact cubic_roots_surjective ρ ζ hζ hζF · rw [← Nat.card_eq_fintype_card, ← Nat.card_eq_fintype_card, hζ.card_rootsOfUnity, hζF.card_rootsOfUnity] variable [Fintype F] private theorem euler_jacobi_sum_zero (m : ℕ) (hm : 2 * m < Fintype.card F - 1) : (∑ x : F, x ^ m * (1 - x) ^ m) = 0 := by classical simp_rw [sub_eq_add_neg, add_pow] simp only [one_pow, one_mul, mul_sum] rw [Finset.sum_comm] apply Finset.sum_eq_zero intro j hj have he : m + (m - j) < Fintype.card F - 1 := by have hle : m - j ≤ m := Nat.sub_le m j omega calc (∑ x : F, x ^ m * ((-x) ^ (m - j) * ↑(m.choose j))) = ((-1 : F) ^ (m - j) * ↑(m.choose j)) * ∑ x : F, x ^ (m + (m - j)) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ rw [neg_pow, pow_add] ring _ = 0 := by rw [FiniteField.sum_pow_lt_card_sub_one F _ he]; ring private def euler_to_roots (m : ℕ) (hq : Fintype.card F - 1 = m * 3) : Fˣ →* rootsOfUnity 3 F where toFun u := rootsOfUnity.mkOfPowEq ((u : F) ^ m) (by rw [← pow_mul, ← hq] exact FiniteField.pow_card_sub_one_eq_one (u : F) u.ne_zero) map_one' := by apply rootsOfUnity.coe_injective simp map_mul' u v := by apply rootsOfUnity.coe_injective simp [mul_pow] private noncomputable def cubicResidueChar (ρ : R →+* F) (ζ : R) (hζ : IsPrimitiveRoot ζ 3) (hζF : IsPrimitiveRoot (ρ ζ) 3) (m : ℕ) (hq : Fintype.card F - 1 = m * 3) : MulChar F R := MulChar.ofUnitHom <| (Subgroup.subtype _).comp <| (cubic_roots_equiv ρ ζ hζ hζF).symm.toMonoidHom.comp (euler_to_roots m hq) theorem cubicResidueChar_reduce_unit (ρ : R →+* F) (ζ : R) (hζ : IsPrimitiveRoot ζ 3) (hζF : IsPrimitiveRoot (ρ ζ) 3) (m : ℕ) (hq : Fintype.card F - 1 = m * 3) (u : Fˣ) : ρ (cubicResidueChar ρ ζ hζ hζF m hq (u : F)) = (u : F) ^ m := by let e := cubic_roots_equiv ρ ζ hζ hζF simp only [cubicResidueChar, MulChar.ofUnitHom_coe, MonoidHom.comp_apply] change ρ (((e.symm (euler_to_roots m hq u) : rootsOfUnity 3 R) : Rˣ) : R) = (u : F) ^ m have he := e.apply_symm_apply (euler_to_roots m hq u) have he' := congrArg (fun v : rootsOfUnity 3 F => ((v : Fˣ) : F)) he change ρ (((e.symm (euler_to_roots m hq u) : rootsOfUnity 3 R) : Rˣ) : R) = (((euler_to_roots m hq u : rootsOfUnity 3 F) : Fˣ) : F) at he' change ρ (((e.symm (euler_to_roots m hq u) : rootsOfUnity 3 R) : Rˣ) : R) = (u : F) ^ m at he' exact he' theorem cubicResidueChar_pow_three (ρ : R →+* F) (ζ : R) (hζ : IsPrimitiveRoot ζ 3) (hζF : IsPrimitiveRoot (ρ ζ) 3) (m : ℕ) (hq : Fintype.card F - 1 = m * 3) : cubicResidueChar ρ ζ hζ hζF m hq ^ 3 = 1 := by apply MulChar.ext intro u rw [(cubicResidueChar ρ ζ hζ hζF m hq).pow_apply_coe, MulChar.one_apply_coe] simp only [cubicResidueChar, MulChar.ofUnitHom_coe, MonoidHom.comp_apply] let v : rootsOfUnity 3 R := (cubic_roots_equiv ρ ζ hζ hζF).symm (euler_to_roots m hq u) change (((v : Rˣ) : R) ^ 3) = 1 exact (mem_rootsOfUnity' 3 (v : Rˣ)).mp v.property end ActualCubicChar namespace ActualEisensteinCubic section open NumberField abbrev K := CyclotomicField 3 ℚ abbrev O := NumberField.RingOfIntegers K private abbrev instIsCyclotomicExtensionSingletonNatSetOfNatRatK : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ def omega : O := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact (IsCyclotomicExtension.zeta_spec 3 ℚ K).toInteger def lambda : O := omega - 1 noncomputable abbrev quotientFintype (P : Ideal O) [P.IsMaximal] : Fintype (O ⧸ P) := Fintype.ofFinite _ noncomputable abbrev quotientField (P : Ideal O) [P.IsMaximal] : Field (O ⧸ P) := Ideal.Quotient.field P theorem omega_primitive : IsPrimitiveRoot omega 3 := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact (IsCyclotomicExtension.zeta_spec 3 ℚ K).toInteger_isPrimitiveRoot def traceLambda : O := 1 + 2 * omega theorem omega_reduced_primitive (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : IsPrimitiveRoot (Ideal.Quotient.mk P omega) 3 := by let : Field (O ⧸ P) := Ideal.Quotient.field P let ρ : O →+* O ⧸ P := Ideal.Quotient.mk P have hpow : (ρ omega) ^ 3 = 1 := by rw [← map_pow, omega_primitive.pow_eq_one, map_one] have hne : ρ omega ≠ 1 := by intro he apply hgood have hz : ρ (omega - 1) = 0 := by rw [map_sub, he, map_one, sub_self] exact (Ideal.Quotient.eq_zero_iff_mem).mp hz apply IsPrimitiveRoot.mk_of_lt _ (by decide) hpow intro l hl0 hl3 have hl : l = 1 ∨ l = 2 := by omega rcases hl with rfl | rfl · simpa using hne · intro h2 apply hne calc ρ omega = (ρ omega) ^ 2 * ρ omega := by rw [h2, one_mul] _ = (ρ omega) ^ 3 := by ring _ = 1 := hpow theorem card_sub_one_div_three (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : 3 ∣ Nat.card (O ⧸ P) - 1 := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let hζ := omega_reduced_primitive P hgood let u : (O ⧸ P)ˣ := (hζ.isUnit (by decide)).unit have hu : IsPrimitiveRoot u 3 := hζ.isUnit_unit (by decide) have h := orderOf_dvd_natCard u rw [← hu.eq_orderOf] at h simpa only [Nat.card_eq_fintype_card, Fintype.card_units] using h noncomputable def cubicChar (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : MulChar (O ⧸ P) O := by classical letI : Field (O ⧸ P) := Ideal.Quotient.field P letI : Fintype (O ⧸ P) := Fintype.ofFinite _ let m := (Fintype.card (O ⧸ P) - 1) / 3 have hq : Fintype.card (O ⧸ P) - 1 = m * 3 := (Nat.div_mul_cancel (by simpa only [Nat.card_eq_fintype_card] using card_sub_one_div_three P hgood)).symm exact ActualCubicChar.cubicResidueChar (Ideal.Quotient.mk P) omega omega_primitive (omega_reduced_primitive P hgood) m hq theorem cubicChar_reduce (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (x : O ⧸ P) : (Ideal.Quotient.mk P) (cubicChar P hgood x) = x ^ ((Nat.card (O ⧸ P) - 1) / 3) := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let m := (Fintype.card (O ⧸ P) - 1) / 3 have hq : Fintype.card (O ⧸ P) - 1 = m * 3 := (Nat.div_mul_cancel (by simpa only [Nat.card_eq_fintype_card] using card_sub_one_div_three P hgood)).symm have hm : 0 < m := by have hcard : 1 < Fintype.card (O ⧸ P) := Fintype.one_lt_card omega rw [Nat.card_eq_fintype_card] change (Ideal.Quotient.mk P) (ActualCubicChar.cubicResidueChar (Ideal.Quotient.mk P) omega omega_primitive (omega_reduced_primitive P hgood) m hq x) = x ^ m by_cases hx : x = 0 · subst x rw [(ActualCubicChar.cubicResidueChar (Ideal.Quotient.mk P) omega omega_primitive (omega_reduced_primitive P hgood) m hq).map_zero, map_zero, zero_pow hm.ne'] · let u : (O ⧸ P)ˣ := (isUnit_iff_ne_zero.mpr hx).unit have hu : (u : O ⧸ P) = x := (isUnit_iff_ne_zero.mpr hx).unit_spec rw [← hu] exact ActualCubicChar.cubicResidueChar_reduce_unit (Ideal.Quotient.mk P) omega omega_primitive (omega_reduced_primitive P hgood) m hq u theorem cubicChar_pow_three (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : cubicChar P hgood ^ 3 = 1 := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let m := (Fintype.card (O ⧸ P) - 1) / 3 have hq : Fintype.card (O ⧸ P) - 1 = m * 3 := (Nat.div_mul_cancel (by simpa only [Nat.card_eq_fintype_card] using card_sub_one_div_three P hgood)).symm change ActualCubicChar.cubicResidueChar (Ideal.Quotient.mk P) omega omega_primitive (omega_reduced_primitive P hgood) m hq ^ 3 = 1 exact ActualCubicChar.cubicResidueChar_pow_three (Ideal.Quotient.mk P) omega omega_primitive (omega_reduced_primitive P hgood) m hq theorem cubicChar_ne_one (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : cubicChar P hgood ≠ 1 := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let m := (Fintype.card (O ⧸ P) - 1) / 3 have hq : Fintype.card (O ⧸ P) - 1 = m * 3 := (Nat.div_mul_cancel (by simpa only [Nat.card_eq_fintype_card] using card_sub_one_div_three P hgood)).symm have hm : 0 < m := by have hcard : 1 < Fintype.card (O ⧸ P) := Fintype.one_lt_card omega intro hχ have hall : ∀ u : (O ⧸ P)ˣ, u ^ m = 1 := by intro u apply Units.ext have hr := cubicChar_reduce P hgood (u : O ⧸ P) rw [hχ, MulChar.one_apply_coe, map_one] at hr simpa only [Units.val_pow_eq_pow_val, Units.val_one, Nat.card_eq_fintype_card] using hr.symm have hdvd := (FiniteField.forall_pow_eq_one_iff (O ⧸ P) m).mp hall rw [hq] at hdvd have hle := Nat.le_of_dvd hm hdvd omega theorem cubicChar_order (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : orderOf (cubicChar P hgood) = 3 := by have hdvd : orderOf (cubicChar P hgood) ∣ 3 := orderOf_dvd_of_pow_eq_one (cubicChar_pow_three P hgood) rcases (Nat.dvd_prime Nat.prime_three).mp hdvd with h1 | h3 · exact False.elim ((cubicChar_ne_one P hgood) (orderOf_eq_one_iff.mp h1)) · exact h3 theorem cubicJacobi_primary (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : let : Fintype (O ⧸ P) := quotientFintype P ∃ z ∈ Algebra.adjoin ℤ {omega}, jacobiSum (cubicChar P hgood) (cubicChar P hgood) = -1 + z * lambda ^ 2 := by let : Fintype (O ⧸ P) := quotientFintype P change ∃ z ∈ Algebra.adjoin ℤ {omega}, jacobiSum (cubicChar P hgood) (cubicChar P hgood) = -1 + z * lambda ^ 2 classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ simpa only [lambda] using (exists_jacobiSum_eq_neg_one_add (n := 3) (by decide) (cubicChar_pow_three P hgood) (cubicChar_pow_three P hgood) (by simpa only [Nat.card_eq_fintype_card] using card_sub_one_div_three P hgood) omega_primitive) theorem cubicJacobi_mem_prime (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : let : Fintype (O ⧸ P) := quotientFintype P jacobiSum (cubicChar P hgood) (cubicChar P hgood) ∈ P := by let : Fintype (O ⧸ P) := quotientFintype P change jacobiSum (cubicChar P hgood) (cubicChar P hgood) ∈ P classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let m := (Fintype.card (O ⧸ P) - 1) / 3 have hq : Fintype.card (O ⧸ P) - 1 = m * 3 := (Nat.div_mul_cancel (by simpa only [Nat.card_eq_fintype_card] using card_sub_one_div_three P hgood)).symm have hm : 2 * m < Fintype.card (O ⧸ P) - 1 := by have hcard : 1 < Fintype.card (O ⧸ P) := Fintype.one_lt_card omega apply (Ideal.Quotient.eq_zero_iff_mem).mp rw [jacobiSum, map_sum] simp_rw [map_mul, cubicChar_reduce P hgood] simp only [Nat.card_eq_fintype_card] exact ActualCubicChar.euler_jacobi_sum_zero m hm theorem cubicJacobi_product (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : let : Fintype (O ⧸ P) := quotientFintype P jacobiSum (cubicChar P hgood) (cubicChar P hgood) * jacobiSum (cubicChar P hgood)⁻¹ (cubicChar P hgood)⁻¹ = (Nat.card (O ⧸ P) : O) := by let : Fintype (O ⧸ P) := quotientFintype P change jacobiSum (cubicChar P hgood) (cubicChar P hgood) * jacobiSum (cubicChar P hgood)⁻¹ (cubicChar P hgood)⁻¹ = (Nat.card (O ⧸ P) : O) classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let ι : O →+* K := algebraMap O K let ψ := (cubicChar P hgood).ringHomComp ι have hchar : ringChar K ≠ ringChar (O ⧸ P) := by rw [ringChar.eq_zero] exact (CharP.char_is_prime (O ⧸ P) (ringChar (O ⧸ P))).ne_zero.symm have hψ : ψ ≠ 1 := (MulChar.ringHomComp_ne_one_iff RingOfIntegers.coe_injective).mpr (cubicChar_ne_one P hgood) have hχ2 : cubicChar P hgood * cubicChar P hgood ≠ 1 := by intro h have hd : orderOf (cubicChar P hgood) ∣ 2 := by rw [← pow_two] at h exact orderOf_dvd_of_pow_eq_one h rw [cubicChar_order P hgood] at hd norm_num at hd have hψ2 : ψ * ψ ≠ 1 := by rw [show ψ * ψ = (cubicChar P hgood * cubicChar P hgood).ringHomComp ι by exact (MulChar.ringHomComp_mul _ _ _).symm] exact (MulChar.ringHomComp_ne_one_iff RingOfIntegers.coe_injective).mpr hχ2 have hprod := jacobiSum_mul_jacobiSum_inv hchar hψ hψ hψ2 apply RingOfIntegers.coe_injective change ι (jacobiSum (cubicChar P hgood) (cubicChar P hgood) * jacobiSum (cubicChar P hgood)⁻¹ (cubicChar P hgood)⁻¹) = ι (Nat.card (O ⧸ P) : O) rw [map_mul, ← jacobiSum_ringHomComp, ← jacobiSum_ringHomComp, ← MulChar.ringHomComp_inv] simpa only [ψ, Nat.card_eq_fintype_card, map_natCast] using hprod private noncomputable def conjK : K ≃ₐ[ℚ] K := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact IsCyclotomicExtension.fromZetaAut ((IsCyclotomicExtension.zeta_spec 3 ℚ K).pow_of_coprime 2 (by decide)) (Polynomial.cyclotomic.irreducible_rat (by decide)) noncomputable def conjO : O ≃+* O := RingOfIntegers.mapRingEquiv conjK.toRingEquiv theorem conjO_omega : conjO omega = omega ^ 2 := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK apply RingOfIntegers.coe_injective change conjK (IsCyclotomicExtension.zeta 3 ℚ K) = (IsCyclotomicExtension.zeta 3 ℚ K) ^ 2 exact IsCyclotomicExtension.fromZetaAut_spec ((IsCyclotomicExtension.zeta_spec 3 ℚ K).pow_of_coprime 2 (by decide)) (Polynomial.cyclotomic.irreducible_rat (by decide)) private theorem conjO_cubic_root (x : O) (hx : x ^ 3 = 1) : conjO x = x ^ 2 := by obtain ⟨j, _, hj⟩ := omega_primitive.eq_pow_of_pow_eq_one hx rw [← hj, map_pow, conjO_omega] simp only [← pow_mul] rw [Nat.mul_comm] theorem cubicChar_conj_eq_inv (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (x : O ⧸ P) : conjO (cubicChar P hgood x) = (cubicChar P hgood)⁻¹ x := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let χ := cubicChar P hgood have hinv : χ⁻¹ = χ ^ 2 := by apply inv_eq_iff_mul_eq_one.mpr simpa only [pow_succ, mul_comm] using cubicChar_pow_three P hgood rw [hinv, χ.pow_apply' (by decide)] by_cases hx : x = 0 · subst x rw [χ.map_zero, map_zero, zero_pow (by decide)] · have hχ3 : χ x ^ 3 = 1 := by rw [← χ.pow_apply' (by decide), cubicChar_pow_three P hgood] exact MulChar.one_apply (isUnit_iff_ne_zero.mpr hx) exact conjO_cubic_root (χ x) hχ3 theorem cubicJacobi_conj (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : let : Fintype (O ⧸ P) := quotientFintype P conjO (jacobiSum (cubicChar P hgood) (cubicChar P hgood)) = jacobiSum (cubicChar P hgood)⁻¹ (cubicChar P hgood)⁻¹ := by let : Fintype (O ⧸ P) := quotientFintype P change conjO (jacobiSum (cubicChar P hgood) (cubicChar P hgood)) = jacobiSum (cubicChar P hgood)⁻¹ (cubicChar P hgood)⁻¹ classical rw [jacobiSum, map_sum] simp_rw [map_mul, cubicChar_conj_eq_inv P hgood] rfl theorem cubicJacobi_mul_conj (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : let : Fintype (O ⧸ P) := quotientFintype P jacobiSum (cubicChar P hgood) (cubicChar P hgood) * conjO (jacobiSum (cubicChar P hgood) (cubicChar P hgood)) = (Nat.card (O ⧸ P) : O) := by let : Fintype (O ⧸ P) := quotientFintype P change jacobiSum (cubicChar P hgood) (cubicChar P hgood) * conjO (jacobiSum (cubicChar P hgood) (cubicChar P hgood)) = (Nat.card (O ⧸ P) : O) rw [cubicJacobi_conj P hgood] exact cubicJacobi_product P hgood end private noncomputable def quadraticCharO (P : Ideal O) [P.IsMaximal] : MulChar (O ⧸ P) O := by classical letI : Field (O ⧸ P) := Ideal.Quotient.field P letI : Fintype (O ⧸ P) := Fintype.ofFinite _ exact (quadraticChar (O ⧸ P)).ringHomComp (Int.castRingHom O) theorem quadraticCharO_sq (P : Ideal O) [P.IsMaximal] : quadraticCharO P ^ 2 = 1 := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ change ((quadraticChar (O ⧸ P)).ringHomComp (Int.castRingHom O)) ^ 2 = 1 exact ((quadraticChar_isQuadratic (O ⧸ P)).comp (Int.castRingHom O)).sq_eq_one noncomputable def sexticChar (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : MulChar (O ⧸ P) O := cubicChar P hgood ^ 2 * quadraticCharO P theorem sexticChar_powers (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : sexticChar P hgood ^ 2 = cubicChar P hgood ∧ sexticChar P hgood ^ 3 = quadraticCharO P ∧ sexticChar P hgood ^ 6 = 1 := by have hc := cubicChar_pow_three P hgood have hq := quadraticCharO_sq P let c := cubicChar P hgood let q := quadraticCharO P have htwo : (c ^ 2 * q) ^ 2 = c := by calc (c ^ 2 * q) ^ 2 = c ^ 4 * q ^ 2 := by rw [mul_pow, ← pow_mul] _ = c := by rw [hq]; calc c ^ 4 * 1 = c ^ 3 * c := by group _ = c := by rw [hc, one_mul] have hthree : (c ^ 2 * q) ^ 3 = q := by calc (c ^ 2 * q) ^ 3 = (c ^ 3) ^ 2 * (q ^ 2) * q := by simp [mul_pow]; group _ = q := by rw [hc, hq]; group refine ⟨htwo, hthree, ?_⟩ calc (c ^ 2 * q) ^ 6 = ((c ^ 2 * q) ^ 3) ^ 2 := by group _ = 1 := by rw [hthree, hq] theorem lambda_not_dvd_two : ¬ lambda ∣ (2 : O) := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK let : Fact (Nat.Prime 3) := ⟨Nat.prime_three⟩ have hprime : Prime lambda := (IsCyclotomicExtension.zeta_spec 3 ℚ K).zeta_sub_one_prime' let I : Ideal O := Ideal.span {lambda} have hI : I.IsMaximal := by have hp : I.IsPrime := Ideal.isPrime_span_singleton_of_prime hprime have hne : I ≠ ⊥ := Ideal.span_singleton_eq_bot.not.mpr hprime.ne_zero exact hp.isMaximal hne let : I.IsMaximal := hI let : Field (O ⧸ I) := Ideal.Quotient.field I let : Fintype (O ⧸ I) := Fintype.ofFinite _ have hcard : Nat.card (O ⧸ I) = 3 := by change Nat.card (O ⧸ Ideal.span {omega - 1}) = 3 rw [omega, (IsCyclotomicExtension.zeta_spec 3 ℚ K).card_quotient_toInteger_sub_one, (IsCyclotomicExtension.zeta_spec 3 ℚ K).norm_toInteger_sub_one_of_prime_ne_two' (by decide)] norm_num intro hdiv have hmem : (2 : O) ∈ I := (Ideal.mem_span_singleton).mpr hdiv have hzero : (2 : O ⧸ I) = 0 := (Ideal.Quotient.eq_zero_iff_mem).mpr hmem have hchar : ringChar (O ⧸ I) = 2 := by have hdvd : ringChar (O ⧸ I) ∣ 2 := (ringChar.spec (O ⧸ I) 2).mp hzero exact (Nat.prime_dvd_prime_iff_eq (CharP.char_is_prime (O ⧸ I) (ringChar (O ⧸ I))) Nat.prime_two).mp hdvd have heven := FiniteField.even_card_of_char_two hchar rw [← Nat.card_eq_fintype_card, hcard] at heven norm_num at heven private theorem conjK_ne_refl : conjK ≠ AlgEquiv.refl := by intro he have hw : omega ^ 2 = omega := by have hc : conjO omega = omega := by apply NumberField.RingOfIntegers.coe_injective change conjK (omega : K) = (omega : K) rw [he] rfl exact conjO_omega.symm.trans hc have hw1 : omega = 1 := by have hunit : IsUnit omega := omega_primitive.isUnit (by decide) apply (mul_left_cancel₀ hunit.ne_zero) calc omega * omega = omega ^ 2 := by ring _ = omega := hw _ = omega * 1 := by ring exact (omega_primitive.ne_one (by decide)) hw1 private theorem galois_card_two : Fintype.card (K ≃ₐ[ℚ] K) = 2 := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK classical let : IsGalois ℚ K := IsCyclotomicExtension.isGalois {3} ℚ K rw [← Nat.card_eq_fintype_card, IsGalois.card_aut_eq_finrank ℚ K, IsCyclotomicExtension.finrank (n := 3) K (Polynomial.cyclotomic.irreducible_rat (by decide))] decide private theorem galois_univ_pair [DecidableEq (K ≃ₐ[ℚ] K)] : (Finset.univ : Finset (K ≃ₐ[ℚ] K)) = {(AlgEquiv.refl : K ≃ₐ[ℚ] K), conjK} := by symm apply Finset.eq_of_subset_of_card_le (Finset.subset_univ _) rw [Finset.card_univ, galois_card_two, Finset.card_pair] exact conjK_ne_refl.symm private theorem norm_eq_mul_conjK (p : O) : ((Algebra.norm ℚ (p : K) : ℚ) : K) = (p : K) * conjK (p : K) := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK classical let : IsGalois ℚ K := IsCyclotomicExtension.isGalois {3} ℚ K have h := Algebra.norm_eq_prod_automorphisms ℚ (p : K) rw [galois_univ_pair, Finset.prod_pair conjK_ne_refl.symm] at h simpa using h theorem norm_int_eq_mul_conjO (p : O) : ((Algebra.norm ℤ p : ℤ) : O) = p * conjO p := by apply NumberField.RingOfIntegers.coe_injective change ((Algebra.norm ℤ p : ℤ) : K) = (p : K) * conjK (p : K) have h := norm_eq_mul_conjK p rw [← Algebra.coe_norm_int p] at h exact h private theorem generator_mul_conj_eq_sign_card (P : Ideal O) [P.IsMaximal] (p : O) (hP : P = Ideal.span {p}) : p * conjO p = (Nat.card (O ⧸ P) : O) ∨ p * conjO p = -(Nat.card (O ⧸ P) : O) := by let : Fintype (O ⧸ P) := quotientFintype P have habs : (Algebra.norm ℤ p).natAbs = Nat.card (O ⧸ P) := by calc (Algebra.norm ℤ p).natAbs = Ideal.absNorm (Ideal.span {p}) := (Ideal.absNorm_span_singleton p).symm _ = Ideal.absNorm P := by rw [← hP] _ = Nat.card (O ⧸ P) := by rw [Ideal.absNorm_apply, Submodule.cardQuot_apply] have hsq : (Algebra.norm ℤ p) * (Algebra.norm ℤ p) = (Nat.card (O ⧸ P) : ℤ) * (Nat.card (O ⧸ P) : ℤ) := by apply (Int.natAbs_eq_iff_mul_self_eq).mp simpa using habs have hzero : (Algebra.norm ℤ p - (Nat.card (O ⧸ P) : ℤ)) * (Algebra.norm ℤ p + (Nat.card (O ⧸ P) : ℤ)) = 0 := by nlinarith [hsq] rcases mul_eq_zero.mp hzero with hpos | hneg · left have heq : Algebra.norm ℤ p = (Nat.card (O ⧸ P) : ℤ) := sub_eq_zero.mp hpos simp [← norm_int_eq_mul_conjO p, heq] · right have heq : Algebra.norm ℤ p = -(Nat.card (O ⧸ P) : ℤ) := add_eq_zero_iff_eq_neg.mp hneg simp [← norm_int_eq_mul_conjO p, heq] theorem cubicJacobi_unit_multiple_of_principal (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) : let : Fintype (O ⧸ P) := quotientFintype P ∃ u : Oˣ, jacobiSum (cubicChar P hgood) (cubicChar P hgood) = p * u := by let : Fintype (O ⧸ P) := quotientFintype P change ∃ u : Oˣ, jacobiSum (cubicChar P hgood) (cubicChar P hgood) = p * u classical let J := jacobiSum (cubicChar P hgood) (cubicChar P hgood) have hdiv : p ∣ J := (Ideal.mem_span_singleton).mp (hP ▸ cubicJacobi_mem_prime P hgood) obtain ⟨v, hv⟩ := hdiv have hqne : (Nat.card (O ⧸ P) : O) ≠ 0 := by exact_mod_cast Nat.card_pos.ne' have hnorm := generator_mul_conj_eq_sign_card P p hP have hpne : p * conjO p ≠ 0 := by rcases hnorm with h | h · rw [h]; exact hqne · rw [h]; exact neg_ne_zero.mpr hqne have hprod : (p * conjO p) * (v * conjO v) = (Nat.card (O ⧸ P) : O) := by calc (p * conjO p) * (v * conjO v) = (p * v) * conjO (p * v) := by rw [map_mul]; ring _ = J * conjO J := by rw [hv] _ = (Nat.card (O ⧸ P) : O) := cubicJacobi_mul_conj P hgood have hvnorm : v * conjO v = 1 ∨ v * conjO v = -1 := by rcases hnorm with hpos | hneg · left apply mul_left_cancel₀ hpne calc (p * conjO p) * (v * conjO v) = (Nat.card (O ⧸ P) : O) := hprod _ = (p * conjO p) * 1 := by rw [hpos]; ring · right apply mul_left_cancel₀ hpne calc (p * conjO p) * (v * conjO v) = (Nat.card (O ⧸ P) : O) := hprod _ = (p * conjO p) * -1 := by rw [hneg]; ring have hvunit : IsUnit v := by rcases hvnorm with h | h · exact IsUnit.of_mul_eq_one (conjO v) h · apply IsUnit.of_mul_eq_one (-conjO v) rw [mul_neg, h] ring refine ⟨hvunit.unit, ?_⟩ simpa only [hvunit.unit_spec] using hv theorem cubicJacobi_eq_neg_primary_generator_of_principal (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hprimary : lambda ^ 2 ∣ p - 1) : let : Fintype (O ⧸ P) := quotientFintype P jacobiSum (cubicChar P hgood) (cubicChar P hgood) = -p := by let : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK let : Fintype (O ⧸ P) := quotientFintype P change jacobiSum (cubicChar P hgood) (cubicChar P hgood) = -p let J := jacobiSum (cubicChar P hgood) (cubicChar P hgood) obtain ⟨u, hJu⟩ := cubicJacobi_unit_multiple_of_principal P hgood p hP change J = p * (u : O) at hJu obtain ⟨z, _, hJ⟩ := cubicJacobi_primary P hgood have hJmod : lambda ^ 2 ∣ J + 1 := by refine ⟨z, ?_⟩ dsimp [J] rw [hJ] ring have hucong : lambda ^ 2 ∣ (u : O) + 1 := by have heq : (u : O) + 1 = (J + 1) - (p - 1) * (u : O) := by rw [hJu] ring rw [heq] exact dvd_sub hJmod (dvd_mul_of_dvd_left hprimary _) have hunit : u = 1 ∨ u = -1 := by apply IsCyclotomicExtension.Rat.Three.eq_one_or_neg_one_of_unit_of_congruent (IsCyclotomicExtension.zeta_spec 3 ℚ K) u refine ⟨(-1 : ℤ), ?_⟩ simpa only [lambda, omega, Int.cast_neg, Int.cast_one, sub_neg_eq_add] using hucong rcases hunit with h1 | hneg · have htwo : lambda ^ 2 ∣ (2 : O) := by simpa [h1, one_add_one_eq_two] using hucong exact False.elim (lambda_not_dvd_two ((dvd_pow_self lambda (by decide)).trans htwo)) · rw [hneg] at hJu simpa only [Units.val_neg, Units.val_one, mul_neg, mul_one] using hJu theorem cubicJacobi_generates_prime (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : let : Fintype (O ⧸ P) := quotientFintype P P = Ideal.span {jacobiSum (cubicChar P hgood) (cubicChar P hgood)} := by let : Fintype (O ⧸ P) := quotientFintype P change P = Ideal.span {jacobiSum (cubicChar P hgood) (cubicChar P hgood)} classical let J := jacobiSum (cubicChar P hgood) (cubicChar P hgood) have hnormJ : Algebra.norm ℤ J = (Nat.card (O ⧸ P) : ℤ) := by apply (Int.cast_injective : Function.Injective (Int.cast : ℤ → O)) change ((Algebra.norm ℤ J : ℤ) : O) = (Nat.card (O ⧸ P) : O) rw [norm_int_eq_mul_conjO] exact cubicJacobi_mul_conj P hgood have habsJ : Ideal.absNorm (Ideal.span {J}) = Nat.card (O ⧸ P) := by rw [Ideal.absNorm_span_singleton, hnormJ] simp have habsP : Ideal.absNorm P = Nat.card (O ⧸ P) := by rw [Ideal.absNorm_apply, Submodule.cardQuot_apply] have hle : Ideal.span {J} ≤ P := (Ideal.span_singleton_le_iff_mem P).mpr (cubicJacobi_mem_prime P hgood) obtain ⟨Q, hQ⟩ := (Ideal.dvd_iff_le).mpr hle have hq : Nat.card (O ⧸ P) ≠ 0 := Nat.card_pos.ne' have hQnorm : Ideal.absNorm Q = 1 := by have heq : Nat.card (O ⧸ P) = Nat.card (O ⧸ P) * Ideal.absNorm Q := by calc Nat.card (O ⧸ P) = Ideal.absNorm (Ideal.span {J}) := habsJ.symm _ = Ideal.absNorm (P * Q) := by rw [hQ] _ = Ideal.absNorm P * Ideal.absNorm Q := map_mul Ideal.absNorm P Q _ = Nat.card (O ⧸ P) * Ideal.absNorm Q := by rw [habsP] exact (mul_left_cancel₀ hq (heq.symm.trans (by ring))) have hQtop : Q = ⊤ := Ideal.absNorm_eq_one_iff.mp hQnorm change P = Ideal.span {J} rw [hQ, hQtop, ← Ideal.one_eq_top, mul_one] theorem cubicJacobi_exists_primary_generator (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : let : Fintype (O ⧸ P) := quotientFintype P ∃ p : O, P = Ideal.span {p} ∧ lambda ^ 2 ∣ p - 1 ∧ jacobiSum (cubicChar P hgood) (cubicChar P hgood) = -p := by let : Fintype (O ⧸ P) := quotientFintype P change ∃ p : O, P = Ideal.span {p} ∧ lambda ^ 2 ∣ p - 1 ∧ jacobiSum (cubicChar P hgood) (cubicChar P hgood) = -p let J := jacobiSum (cubicChar P hgood) (cubicChar P hgood) refine ⟨-J, ?_, ?_, by simp [J]⟩ · have h := cubicJacobi_generates_prime P hgood simpa only [J, Ideal.span_singleton_neg] using h · obtain ⟨z, _, hJ⟩ := cubicJacobi_primary P hgood refine ⟨-z, ?_⟩ dsimp [J] rw [hJ] ring theorem cubicGauss_cube {E : Type*} [Field E] (ι : O →+* E) (hι : Function.Injective ι) (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hprimary : lambda ^ 2 ∣ p - 1) (ψ : AddChar (O ⧸ P) E) (hψ : ψ.IsPrimitive) : let : Fintype (O ⧸ P) := quotientFintype P gaussSum ((cubicChar P hgood).ringHomComp ι) ψ ^ 3 = -(ι p) * (Nat.card (O ⧸ P) : E) := by let : Fintype (O ⧸ P) := quotientFintype P change gaussSum ((cubicChar P hgood).ringHomComp ι) ψ ^ 3 = -(ι p) * (Nat.card (O ⧸ P) : E) classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let χ := cubicChar P hgood let ξ := χ.ringHomComp ι have hχ3 : χ ^ 3 = 1 := cubicChar_pow_three P hgood have hχne : χ ≠ 1 := cubicChar_ne_one P hgood have hχ2 : χ * χ ≠ 1 := by intro h have hd : orderOf χ ∣ 2 := by rw [← pow_two] at h exact orderOf_dvd_of_pow_eq_one h rw [cubicChar_order P hgood] at hd norm_num at hd have hξne : ξ ≠ 1 := (MulChar.ringHomComp_ne_one_iff hι).mpr hχne have hξ2 : ξ * ξ ≠ 1 := by rw [show ξ * ξ = (χ * χ).ringHomComp ι by exact (MulChar.ringHomComp_mul χ χ ι).symm] exact (MulChar.ringHomComp_ne_one_iff hι).mpr hχ2 have hχinv : χ⁻¹ = χ ^ 2 := by apply inv_eq_iff_mul_eq_one.mpr simpa only [pow_succ, mul_comm] using hχ3 have hξinv : ξ⁻¹ = ξ ^ 2 := by change (χ.ringHomComp ι)⁻¹ = (χ.ringHomComp ι) ^ 2 rw [MulChar.ringHomComp_inv, MulChar.ringHomComp_pow, hχinv] have hξmul : ξ * ξ = ξ⁻¹ := by rw [hξinv, pow_two] have hχneg : χ (-1) = 1 := MulChar.val_neg_one_eq_one_of_odd_order (by decide : Odd 3) hχ3 have hξneg : ξ (-1) = 1 := by change ι (χ (-1)) = 1 rw [hχneg, map_one] have hξinvneg : ξ⁻¹ (-1) = 1 := by rw [MulChar.inv_apply_eq_inv', hξneg, inv_one] have hgs : gaussSum ξ ψ * gaussSum ξ⁻¹ ψ = (Nat.card (O ⧸ P) : E) := by have h := gaussSum_mul_gaussSum_eq_card hξne hψ have hshift := mul_gaussSum_inv_eq_gaussSum ξ⁻¹ ψ rw [hξinvneg, one_mul] at hshift rw [hshift] at h simpa only [Nat.card_eq_fintype_card] using h have hJ : jacobiSum ξ ξ = -(ι p) := by change jacobiSum (χ.ringHomComp ι) (χ.ringHomComp ι) = -(ι p) rw [jacobiSum_ringHomComp] rw [cubicJacobi_eq_neg_primary_generator_of_principal P hgood p hP hprimary, map_neg] have hgj : gaussSum ξ⁻¹ ψ * jacobiSum ξ ξ = gaussSum ξ ψ * gaussSum ξ ψ := by simpa only [hξmul] using jacobiSum_mul_nontrivial hξ2 ψ calc gaussSum ξ ψ ^ 3 = (gaussSum ξ ψ * gaussSum ξ ψ) * gaussSum ξ ψ := by ring _ = (gaussSum ξ⁻¹ ψ * jacobiSum ξ ξ) * gaussSum ξ ψ := by rw [hgj] _ = (gaussSum ξ ψ * gaussSum ξ⁻¹ ψ) * jacobiSum ξ ξ := by ring _ = -(ι p) * (Nat.card (O ⧸ P) : E) := by rw [hgs, hJ]; ring theorem primary_generator_mul_conj_eq_card (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hprimary : lambda ^ 2 ∣ p - 1) : p * conjO p = (Nat.card (O ⧸ P) : O) := by let : Fintype (O ⧸ P) := quotientFintype P have h := cubicJacobi_mul_conj P hgood dsimp only at h rw [cubicJacobi_eq_neg_primary_generator_of_principal P hgood p hP hprimary, map_neg] at h simpa only [neg_mul_neg] using h theorem quadraticCharO_ne_one (P : Ideal O) [P.IsMaximal] (hchar : ringChar (O ⧸ P) ≠ 2) : quadraticCharO P ≠ 1 := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ change (quadraticChar (O ⧸ P)).ringHomComp (Int.castRingHom O) ≠ 1 exact (MulChar.ringHomComp_ne_one_iff (Int.cast_injective (α := O))).2 (quadraticChar_ne_one hchar) theorem sexticChar_order (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) : orderOf (sexticChar P hgood) = 6 := by have h2 := (sexticChar_powers P hgood).1 have h3 := (sexticChar_powers P hgood).2.1 have h6 := (sexticChar_powers P hgood).2.2 have hdiv : orderOf (sexticChar P hgood) ∣ 6 := orderOf_dvd_of_pow_eq_one h6 have hne2 : orderOf (sexticChar P hgood) ≠ 2 := by intro he have hχ2 := pow_orderOf_eq_one (sexticChar P hgood) rw [he, h2] at hχ2 exact cubicChar_ne_one P hgood hχ2 have hne3 : orderOf (sexticChar P hgood) ≠ 3 := by intro he have hχ3 := pow_orderOf_eq_one (sexticChar P hgood) rw [he, h3] at hχ3 exact quadraticCharO_ne_one P hchar hχ3 have hne1 : orderOf (sexticChar P hgood) ≠ 1 := by intro he have hχ1 := orderOf_eq_one_iff.mp he rw [hχ1] at h2 exact cubicChar_ne_one P hgood (by simpa using h2.symm) have hne0 : orderOf (sexticChar P hgood) ≠ 0 := by intro he norm_num [he] at hdiv have hpos : 0 < orderOf (sexticChar P hgood) := Nat.pos_of_ne_zero hne0 have hle : orderOf (sexticChar P hgood) ≤ 6 := Nat.le_of_dvd (by norm_num) hdiv have hne4 : orderOf (sexticChar P hgood) ≠ 4 := by intro he norm_num [he] at hdiv have hne5 : orderOf (sexticChar P hgood) ≠ 5 := by intro he norm_num [he] at hdiv omega theorem sexticChar_reduce_unit (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (u : (O ⧸ P)ˣ) : (Ideal.Quotient.mk P) (sexticChar P hgood (u : O ⧸ P)) = (u : O ⧸ P) ^ ((Nat.card (O ⧸ P) - 1) / 6) := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let N := Fintype.card (O ⧸ P) let m := (N - 1) / 6 have hthree : 3 ∣ N - 1 := by simpa only [N, Nat.card_eq_fintype_card] using card_sub_one_div_three P hgood have hodd : N % 2 = 1 := FiniteField.odd_card_of_char_ne_two hchar have hN : 1 < N := Fintype.one_lt_card have hsix : 6 ∣ N - 1 := by omega have hsize : N - 1 = 6 * m := by dsimp [m] exact (Nat.mul_div_cancel_left' hsix).symm have hthird : (N - 1) / 3 = 2 * m := by omega have hhalf : N / 2 = 3 * m := by omega let ρ : O →+* O ⧸ P := Ideal.Quotient.mk P have hquad : ρ (quadraticCharO P (u : O ⧸ P)) = (u : O ⧸ P) ^ (N / 2) := by change (quadraticChar (O ⧸ P) (u : O ⧸ P) : O ⧸ P) = _ exact quadraticChar_eq_pow_of_char_ne_two' hchar (u : O ⧸ P) have hcub : ρ (cubicChar P hgood (u : O ⧸ P)) = (u : O ⧸ P) ^ ((N - 1) / 3) := by simpa only [N, Nat.card_eq_fintype_card] using cubicChar_reduce P hgood (u : O ⧸ P) have hfermat : (u : O ⧸ P) ^ (N - 1) = 1 := FiniteField.pow_card_sub_one_eq_one _ (Units.ne_zero u) change ρ ((cubicChar P hgood ^ 2 * quadraticCharO P) (u : O ⧸ P)) = _ rw [MulChar.mul_apply, MulChar.pow_apply', map_mul, map_pow, hcub, hquad] rw [hthird, hhalf] simpa only [Nat.card_eq_fintype_card, N, m] using (show ((u : O ⧸ P) ^ (2 * m)) ^ 2 * (u : O ⧸ P) ^ (3 * m) = (u : O ⧸ P) ^ m by calc ((u : O ⧸ P) ^ (2 * m)) ^ 2 * (u : O ⧸ P) ^ (3 * m) = (u : O ⧸ P) ^ (7 * m) := by rw [← pow_mul, ← pow_add] congr 1 omega _ = (u : O ⧸ P) ^ m * (u : O ⧸ P) ^ (N - 1) := by rw [hsize, ← pow_add]; congr 1; omega _ = (u : O ⧸ P) ^ m := by rw [hfermat, mul_one]) all_goals norm_num end ActualEisensteinCubic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.ChineseRemainder namespace OAI open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap noncomputable section open Finset Complex open scoped Classical namespace GaussCRT end GaussCRT open scoped Classical namespace IdealGaussCRT variable {T R S : Type*} [CommRing T] [CommRing R] [CommRing S] noncomputable def quotientAddChar {A : Type*} [CommRing A] (I : Ideal A) (ψ : AddChar A ℂ) (hper : ∀ a : A, a ∈ I → ψ a = 1) : AddChar (A ⧸ I) ℂ where toFun := fun x => Quotient.liftOn' x ψ (by intro a b hab have hsub : a - b ∈ I := I.quotientRel_def.mp hab have h := ψ.map_add_eq_mul (a - b) b rw [sub_add_cancel] at h rw [hper _ hsub, one_mul] at h exact h) map_zero_eq_one' := by change ψ 0 = 1 exact AddChar.map_zero_eq_one ψ map_add_eq_mul' := by intro x y refine Quotient.inductionOn₂' x y ?_ intro a b exact AddChar.map_add_eq_mul ψ a b theorem quotientAddChar_mk {A : Type*} [CommRing A] (I : Ideal A) (ψ : AddChar A ℂ) (hper : ∀ a : A, a ∈ I → ψ a = 1) (a : A) : quotientAddChar I ψ hper (Ideal.Quotient.mk I a) = ψ a := rfl theorem bezout_of_principal_coprime {A : Type*} [CommRing A] {a b : A} (h : IsCoprime (Ideal.span {a}) (Ideal.span {b})) : ∃ u v : A, u * a + v * b = 1 := by obtain ⟨x, hx, y, hy, hxy⟩ := Ideal.isCoprime_iff_exists.mp h obtain ⟨u, hu⟩ := Ideal.mem_span_singleton.mp hx obtain ⟨v, hv⟩ := Ideal.mem_span_singleton.mp hy refine ⟨u, v, ?_⟩ rw [hu, hv] at hxy convert hxy using 1; ring noncomputable def rawTraceChar {A : Type*} [CommRing A] (ι : A →+* ℂ) (ψ : AddChar ℂ ℂ) (lam : ℂ) (c : A) : AddChar A ℂ where toFun x := ψ (ι x / (ι c * lam)) map_zero_eq_one' := by simp map_add_eq_mul' x y := by rw [map_add, add_div, AddChar.map_add_eq_mul] theorem rawTraceChar_period {A : Type*} [CommRing A] (ι : A →+* ℂ) (ψ : AddChar ℂ ℂ) (lam : ℂ) (c : A) (hc : ι c ≠ 0) (hlam : lam ≠ 0) (hbase : ∀ x : A, ψ (ι x / lam) = 1) (x : A) (hx : x ∈ Ideal.span {c}) : rawTraceChar ι ψ lam c x = 1 := by obtain ⟨y, hy⟩ := Ideal.mem_span_singleton.mp hx rw [hy] change ψ (ι (c * y) / (ι c * lam)) = 1 rw [map_mul] have hfrac : ι c * ι y / (ι c * lam) = ι y / lam := by field_simp rw [hfrac] exact hbase y noncomputable def traceModChar {A : Type*} [CommRing A] (ι : A →+* ℂ) (ψ : AddChar ℂ ℂ) (lam : ℂ) (c : A) (hc : ι c ≠ 0) (hlam : lam ≠ 0) (hbase : ∀ x : A, ψ (ι x / lam) = 1) : AddChar (A ⧸ Ideal.span {c}) ℂ := quotientAddChar (Ideal.span {c}) (rawTraceChar ι ψ lam c) (rawTraceChar_period ι ψ lam c hc hlam hbase) theorem traceModChar_mk {A : Type*} [CommRing A] (ι : A →+* ℂ) (ψ : AddChar ℂ ℂ) (lam : ℂ) (c : A) (hc : ι c ≠ 0) (hlam : lam ≠ 0) (hbase : ∀ x : A, ψ (ι x / lam) = 1) (x : A) : traceModChar ι ψ lam c hc hlam hbase (Ideal.Quotient.mk (Ideal.span {c}) x) = ψ (ι x / (ι c * lam)) := rfl theorem bezout_inverse_left {A : Type*} [CommRing A] {a b u v : A} (hbez : u * a + v * b = 1) : (Ideal.Quotient.mk (Ideal.span {a}) b) * (Ideal.Quotient.mk (Ideal.span {a}) v) = 1 := by rw [← map_mul] apply Ideal.Quotient.eq.mpr change b * v - 1 ∈ Ideal.span {a} rw [Ideal.mem_span_singleton] refine ⟨-u, ?_⟩ calc b * v - 1 = b * v - (u * a + v * b) := by rw [hbez] _ = a * -u := by ring theorem gauss_shift_bezout_left {A : Type*} [CommRing A] {a b u v : A} [Fintype (A ⧸ Ideal.span {a})] (hbez : u * a + v * b = 1) (χ : MulChar (A ⧸ Ideal.span {a}) ℂ) (ψ : AddChar (A ⧸ Ideal.span {a}) ℂ) : gaussSum χ (ψ.mulShift (Ideal.Quotient.mk (Ideal.span {a}) v)) = χ (Ideal.Quotient.mk (Ideal.span {a}) b) * gaussSum χ ψ := by let mb := Ideal.Quotient.mk (Ideal.span {a}) b let mv := Ideal.Quotient.mk (Ideal.span {a}) v have hprod : mb * mv = 1 := bezout_inverse_left hbez have hu : IsUnit mv := IsUnit.of_mul_eq_one_right mb hprod have hχ : χ mb * χ mv = 1 := by rw [← map_mul, hprod, map_one] have hshift := gaussSum_mulShift χ ψ hu.unit have hshift' : χ mv * gaussSum χ (ψ.mulShift mv) = gaussSum χ ψ := by simpa only [hu.unit_spec] using hshift calc gaussSum χ (ψ.mulShift mv) = (χ mb * χ mv) * gaussSum χ (ψ.mulShift mv) := by rw [hχ, one_mul] _ = χ mb * (χ mv * gaussSum χ (ψ.mulShift mv)) := by ring _ = χ mb * gaussSum χ ψ := by rw [hshift'] end IdealGaussCRT end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Arithmetic.EisensteinEmbedding namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical namespace EisensteinEmbedding abbrev K := CyclotomicField 3 ℚ abbrev O := NumberField.RingOfIntegers K private theorem instIsCyclotomicExtensionSingletonNatSetOfNatRatK : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ noncomputable def ζ : K := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact IsCyclotomicExtension.zeta 3 ℚ K noncomputable def pb : PowerBasis ℤ O := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact (IsCyclotomicExtension.zeta_spec 3 ℚ K).integralPowerBasis noncomputable def omega3 : ℂ := ((-1 : ℂ) + (Real.sqrt 3 : ℝ) * Complex.I) / 2 theorem omega3_sq : omega3 ^ 2 + omega3 + 1 = 0 := by have hs : (Real.sqrt 3 : ℝ) ^ 2 = 3 := Real.sq_sqrt (by norm_num) have hs' : ((Real.sqrt 3 : ℝ) : ℂ) ^ 2 = 3 := by norm_cast have hquad : omega3 ^ 2 + omega3 + 1 = (3 + ((Real.sqrt 3 : ℝ) : ℂ) ^ 2 * Complex.I ^ 2) / 4 := by unfold omega3 ring rw [hs', Complex.I_sq] at hquad norm_num at hquad exact hquad theorem omega3_im : omega3.im = Real.sqrt 3 / 2 := by simp [omega3] theorem omega3_im_ne_zero : omega3.im ≠ 0 := by rw [omega3_im] exact div_ne_zero (ne_of_gt (Real.sqrt_pos.2 (by norm_num))) (by norm_num) theorem lam_ne_zero (w : ℂ) (hw : w ^ 2 + w + 1 = 0) : 1 + 2 * w ≠ 0 := by intro h have hw' : w = -(1 : ℂ) / 2 := by linear_combination h / 2 rw [hw'] at hw norm_num at hw theorem pb_minpoly : minpoly ℤ pb.gen = (Polynomial.X : Polynomial ℤ) ^ 2 + Polynomial.X + 1 := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK have hζ := IsCyclotomicExtension.zeta_spec 3 ℚ K have hgen : pb.gen = hζ.toInteger := by simpa only [pb] using hζ.integralPowerBasis_gen rw [hgen] calc minpoly ℤ (hζ.toInteger : O) = minpoly ℤ (hζ.toInteger : K) := (NumberField.RingOfIntegers.minpoly_coe hζ.toInteger).symm _ = minpoly ℤ (IsCyclotomicExtension.zeta 3 ℚ K) := by exact congrArg (minpoly ℤ) hζ.coe_toInteger _ = Polynomial.cyclotomic 3 ℤ := (Polynomial.cyclotomic_eq_minpoly hζ (by decide)).symm _ = _ := Polynomial.cyclotomic_three ℤ noncomputable def embedding (w : ℂ) (hw : w ^ 2 + w + 1 = 0) : O →+* ℂ := (pb.lift w (by rw [pb_minpoly] simpa only [map_add, map_pow, map_one, Polynomial.aeval_X] using hw)).toRingHom theorem embedding_gen (w : ℂ) (hw : w ^ 2 + w + 1 = 0) : embedding w hw pb.gen = w := by exact pb.lift_gen w (by rw [pb_minpoly] simpa only [map_add, map_pow, map_one, Polynomial.aeval_X] using hw) theorem pb_dim : pb.dim = 2 := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK have hζ := IsCyclotomicExtension.zeta_spec 3 ℚ K have hdim := hζ.integralPowerBasis_dim have htot : Nat.totient 3 = 2 := by decide simpa only [pb, htot] using hdim theorem exists_ab (x : O) : ∃ a b : ℤ, x = a + b * pb.gen := by let i0 : Fin pb.dim := ⟨0, by rw [pb_dim]; decide⟩ let i1 : Fin pb.dim := ⟨1, by rw [pb_dim]; decide⟩ let c := pb.basis.repr x have h := pb.basis.sum_repr x have huniv : (Finset.univ : Finset (Fin pb.dim)) = {i0, i1} := by ext i simp only [Finset.mem_univ, Finset.mem_insert, Finset.mem_singleton, true_iff] have hi := i.isLt have hd := pb_dim simp only [i0, i1, Fin.ext_iff] omega rw [huniv, Finset.sum_insert (by simp [i0, i1]), Finset.sum_singleton] at h refine ⟨c i0, c i1, ?_⟩ simpa only [pb.coe_basis, i0, i1, Fin.val_zero, Fin.val_one, pow_zero, pow_one, zsmul_eq_mul, mul_one] using h.symm theorem embedding_apply_ab (w : ℂ) (hw : w ^ 2 + w + 1 = 0) (a b : ℤ) : embedding w hw (a + b * pb.gen : O) = (a : ℂ) + (b : ℂ) * w := by simp only [map_add, map_mul, map_intCast, embedding_gen] theorem embedding_injective (w : ℂ) (hw : w ^ 2 + w + 1 = 0) (him : w.im ≠ 0) : Function.Injective (embedding w hw) := by intro x y hxy have hz : embedding w hw (x - y) = 0 := by rw [map_sub, hxy, sub_self] obtain ⟨a, b, hrepr⟩ := exists_ab (x - y) rw [hrepr, embedding_apply_ab] at hz have himz := congrArg Complex.im hz have hb : b = 0 := by simp only [Complex.add_im, Complex.intCast_im, zero_add, Complex.mul_im, Complex.intCast_re, Complex.intCast_im, zero_mul, add_zero, Complex.zero_im] at himz have hbc : (b : ℝ) = 0 := (mul_eq_zero.mp himz).resolve_right him exact_mod_cast hbc have ha : a = 0 := by rw [hb, Int.cast_zero, zero_mul, add_zero] at hz exact_mod_cast hz have hzero : x - y = 0 := by rw [hrepr, ha, hb]; simp exact sub_eq_zero.mp hzero theorem trace_period_on_ringOfIntegers (w : ℂ) (hw : w ^ 2 + w + 1 = 0) (ψ : AddChar ℂ ℂ) (lam : ℂ) (hperiod : ∀ a b : ℤ, ψ (((a : ℂ) + (b : ℂ) * w) / lam) = 1) : ∀ x : O, ψ (embedding w hw x / lam) = 1 := by intro x obtain ⟨a, b, hrepr⟩ := exists_ab x rw [hrepr, embedding_apply_ab] exact hperiod a b end EisensteinEmbedding namespace ConcreteTraceCRT open EisensteinEmbedding IdealGaussCRT noncomputable def eisEmbedding : O →+* ℂ := embedding omega3 omega3_sq theorem eisEmbedding_injective : Function.Injective eisEmbedding := embedding_injective omega3 omega3_sq omega3_im_ne_zero theorem eisEmbedding_ne_zero {a : O} (ha : a ≠ 0) : eisEmbedding a ≠ 0 := by intro h exact ha (eisEmbedding_injective (by simpa using h)) noncomputable def eisLam : ℂ := 1 + 2 * omega3 theorem eisLam_ne_zero : eisLam ≠ 0 := lam_ne_zero omega3 omega3_sq theorem eisPeriod (ψ : AddChar ℂ ℂ) (hperiod : ∀ a b : ℤ, ψ (((a : ℂ) + (b : ℂ) * omega3) / eisLam) = 1) : ∀ x : O, ψ (eisEmbedding x / eisLam) = 1 := trace_period_on_ringOfIntegers omega3 omega3_sq ψ eisLam hperiod def coordinateSubring : Subring ℂ where carrier := {z | ∃ a b : ℤ, z = (a : ℂ) + (b : ℂ) * omega3} zero_mem' := ⟨0, 0, by simp⟩ one_mem' := ⟨1, 0, by simp⟩ add_mem' := by rintro x y ⟨a, b, rfl⟩ ⟨c, d, rfl⟩ refine ⟨a + c, b + d, ?_⟩ push_cast ring neg_mem' := by rintro x ⟨a, b, rfl⟩ refine ⟨-a, -b, ?_⟩ push_cast ring mul_mem' := by rintro x y ⟨a, b, rfl⟩ ⟨c, d, rfl⟩ refine ⟨a * c - b * d, a * d + b * c - b * d, ?_⟩ push_cast linear_combination (b : ℂ) * (d : ℂ) * omega3_sq noncomputable def toCoordinateSubring : O →+* coordinateSubring := eisEmbedding.codRestrict coordinateSubring (by intro x obtain ⟨a, b, hrepr⟩ := exists_ab x rw [hrepr] change embedding omega3 omega3_sq (a + b * pb.gen : O) ∈ coordinateSubring rw [embedding_apply_ab] exact ⟨a, b, rfl⟩) theorem toCoordinateSubring_surjective : Function.Surjective toCoordinateSubring := by rintro ⟨z, a, b, hz⟩ refine ⟨(a + b * pb.gen : O), ?_⟩ apply Subtype.ext change eisEmbedding (a + b * pb.gen : O) = z change embedding omega3 omega3_sq (a + b * pb.gen : O) = z rw [embedding_apply_ab] exact hz.symm noncomputable def eisTraceModChar (ψ : AddChar ℂ ℂ) (hperiod : ∀ a b : ℤ, ψ (((a : ℂ) + (b : ℂ) * omega3) / eisLam) = 1) (a : O) (ha : a ≠ 0) : AddChar (O ⧸ Ideal.span {a}) ℂ := traceModChar eisEmbedding ψ eisLam a (eisEmbedding_ne_zero ha) eisLam_ne_zero (eisPeriod ψ hperiod) theorem finite_quotient_span {a : O} (ha : a ≠ 0) : Finite (O ⧸ Ideal.span {a}) := by apply Ring.HasFiniteQuotients.finiteQuotient intro h exact ha (Ideal.span_singleton_eq_bot.mp h) end ConcreteTraceCRT namespace ConcreteBreveE open EisensteinEmbedding ConcreteTraceCRT theorem breveE_period_coordinates : ∀ c d : ℤ, ShortDraftTrace.breveE (((c : ℂ) + (d : ℂ) * omega3) / eisLam) = 1 := by intro c d change ShortDraftTrace.breveE (((c : ℂ) + (d : ℂ) * ShortDraftTrace.ω₃) / (1 + 2 * ShortDraftTrace.ω₃)) = 1 exact ShortDraftTrace.breveE_period_lam c d end ConcreteBreveE namespace ActualEisensteinCubic theorem eisEmbedding_conjO (x : O) : ConcreteTraceCRT.eisEmbedding (conjO x) = star (ConcreteTraceCRT.eisEmbedding x) := by letI : IsCyclotomicExtension {3} ℚ K := EisensteinEmbedding.instIsCyclotomicExtensionSingletonNatSetOfNatRatK let ι := ConcreteTraceCRT.eisEmbedding let z := ι omega have hz3 : z ^ 3 = 1 := by change ι omega ^ 3 = 1 rw [← map_pow, omega_primitive.pow_eq_one, map_one] have hz0 : z ≠ 0 := by intro h rw [h, zero_pow (by decide)] at hz3 exact zero_ne_one hz3 have hznorm : ‖z‖ = 1 := Complex.norm_eq_one_of_pow_eq_one hz3 (by decide) have hzstar : star z = z ^ 2 := by apply mul_left_cancel₀ hz0 calc z * star z = 1 := by rw [← starRingEnd_apply, Complex.mul_conj', hznorm]; norm_num _ = z * z ^ 2 := by rw [← pow_succ', hz3] have hhom : ι.comp conjO.toRingHom = (starRingEnd ℂ).comp ι := by apply RingHom.toIntAlgHom_injective apply (IsCyclotomicExtension.zeta_spec 3 ℚ K).integralPowerBasis.algHom_ext rw [(IsCyclotomicExtension.zeta_spec 3 ℚ K).integralPowerBasis_gen] change ι (conjO omega) = star (ι omega) rw [conjO_omega, map_pow] exact hzstar.symm have hx := congrArg (fun f : O →+* ℂ => f x) hhom exact hx theorem cubicGauss_normalized_cube_eis (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hprimary : lambda ^ 2 ∣ p - 1) (ψ : AddChar (O ⧸ P) ℂ) (hψ : ψ.IsPrimitive) : let : Fintype (O ⧸ P) := quotientFintype P (gaussSum ((cubicChar P hgood).ringHomComp ConcreteTraceCRT.eisEmbedding) ψ / (‖ConcreteTraceCRT.eisEmbedding p‖ : ℂ)) ^ 3 = -(ConcreteTraceCRT.eisEmbedding p) / (‖ConcreteTraceCRT.eisEmbedding p‖ : ℂ) := by let : Fintype (O ⧸ P) := quotientFintype P change (gaussSum ((cubicChar P hgood).ringHomComp ConcreteTraceCRT.eisEmbedding) ψ / (‖ConcreteTraceCRT.eisEmbedding p‖ : ℂ)) ^ 3 = -(ConcreteTraceCRT.eisEmbedding p) / (‖ConcreteTraceCRT.eisEmbedding p‖ : ℂ) let z := ConcreteTraceCRT.eisEmbedding p let g := gaussSum ((cubicChar P hgood).ringHomComp ConcreteTraceCRT.eisEmbedding) ψ have hnormO := primary_generator_mul_conj_eq_card P hgood p hP hprimary have hnormC := congrArg ConcreteTraceCRT.eisEmbedding hnormO rw [map_mul, eisEmbedding_conjO, map_natCast] at hnormC have hq : (Nat.card (O ⧸ P) : ℂ) = (‖z‖ : ℂ) ^ 2 := by simpa only [z, ← starRingEnd_apply, Complex.mul_conj'] using hnormC.symm have hqne : (Nat.card (O ⧸ P) : ℂ) ≠ 0 := by exact_mod_cast Nat.card_pos.ne' have hn0 : (‖z‖ : ℂ) ≠ 0 := by intro h rw [h, zero_pow (by decide)] at hq exact hqne hq have hg : g ^ 3 = -z * (Nat.card (O ⧸ P) : ℂ) := cubicGauss_cube ConcreteTraceCRT.eisEmbedding ConcreteTraceCRT.eisEmbedding_injective P hgood p hP hprimary ψ hψ change (g / (‖z‖ : ℂ)) ^ 3 = -z / (‖z‖ : ℂ) rw [div_pow, hg, hq] field_simp open AddChar MulChar open AddChar MulChar noncomputable def canonicalSextic (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : MulChar (O ⧸ P) ℂ := (sexticChar P hgood).ringHomComp ConcreteTraceCRT.eisEmbedding theorem canonicalSextic_pow_six (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : canonicalSextic P hgood ^ 6 = 1 := by change ((sexticChar P hgood).ringHomComp ConcreteTraceCRT.eisEmbedding) ^ 6 = 1 rw [MulChar.ringHomComp_pow, (sexticChar_powers P hgood).2.2, MulChar.ringHomComp_one] theorem canonicalSextic_pow_ne_one (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) {j : ℕ} (hj0 : j ≠ 0) (hj6 : j < 6) : canonicalSextic P hgood ^ j ≠ 1 := by change ((sexticChar P hgood).ringHomComp ConcreteTraceCRT.eisEmbedding) ^ j ≠ 1 rw [MulChar.ringHomComp_pow] apply (MulChar.ringHomComp_ne_one_iff ConcreteTraceCRT.eisEmbedding_injective).2 apply pow_ne_one_of_lt_orderOf hj0 rwa [sexticChar_order P hgood hchar] theorem canonical_A5_jfour (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (ψ : AddChar (O ⧸ P) ℂ) (hψ : ψ ≠ 1) (σ : (O ⧸ P)ˣ) (ε x : O ⧸ P) : let : Fintype (O ⧸ P) := quotientFintype P let χ := canonicalSextic P hgood (Nat.card (O ⧸ P) : ℂ)⁻¹ * (∑ h : (O ⧸ P)ˣ, (∑ t : O ⧸ P, (χ ^ 4) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ ((ε * x) * ((h⁻¹ : (O ⧸ P)ˣ) : O ⧸ P))) = (((χ⁻¹) ^ 2) σ) * ((Nat.card (O ⧸ P) : ℂ)⁻¹ * gaussSum (χ ^ 4) (ψ.mulShift (-1)) * (if ε * x = 0 then (Fintype.card (O ⧸ P)ˣ : ℂ) else -1)) := by let : Fintype (O ⧸ P) := quotientFintype P change let χ := canonicalSextic P hgood (Nat.card (O ⧸ P) : ℂ)⁻¹ * (∑ h : (O ⧸ P)ˣ, (∑ t : O ⧸ P, (χ ^ 4) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ ((ε * x) * ((h⁻¹ : (O ⧸ P)ˣ) : O ⧸ P))) = (((χ⁻¹) ^ 2) σ) * ((Nat.card (O ⧸ P) : ℂ)⁻¹ * gaussSum (χ ^ 4) (ψ.mulShift (-1)) * (if ε * x = 0 then (Fintype.card (O ⧸ P)ˣ : ℂ) else -1)) let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let χ := canonicalSextic P hgood have hχ4 : χ ^ 4 ≠ 1 := canonicalSextic_pow_ne_one P hgood hchar (by decide : (4:ℕ) ≠ 0) (by decide : (4:ℕ) < 6) have hχ6 : χ ^ 6 = 1 := canonicalSextic_pow_six P hgood have hsum : (∑ h : (O ⧸ P)ˣ, (∑ t : O ⧸ P, (χ ^ 4) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ ((ε * x) * ((h⁻¹ : (O ⧸ P)ˣ) : O ⧸ P))) = (((χ⁻¹) ^ 2) σ) * gaussSum (χ ^ 4) (ψ.mulShift (-1)) * (∑ h : (O ⧸ P)ˣ, (((χ⁻¹) ^ 4 * (χ⁻¹) ^ 2) h) * ψ ((ε * x) * ((h⁻¹ : (O ⧸ P)ˣ) : O ⧸ P))) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro h _ rw [ShortDraftLocal.nontrivial_fourier_coefficient (χ ^ 4) ψ hχ4 h, map_mul] simp only [inv_pow, MulChar.mul_apply] ring dsimp rw [hsum, ShortDraftLocal.sextic_fourth_mask χ ψ hχ6 hψ (ε * x)] ring theorem canonical_A5_jzero_active (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (ψ : AddChar (O ⧸ P) ℂ) (hψ : ψ ≠ 1) (σ : (O ⧸ P)ˣ) (ε x : O ⧸ P) : let : Fintype (O ⧸ P) := quotientFintype P let χ := canonicalSextic P hgood (Nat.card (O ⧸ P) : ℂ)⁻¹ * (∑ h : (O ⧸ P)ˣ, (∑ t : O ⧸ P, (χ ^ 0) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ ((ε * x) * ((h⁻¹ : (O ⧸ P)ˣ) : O ⧸ P))) = -(((χ⁻¹) ^ 2) σ) * ((Nat.card (O ⧸ P) : ℂ)⁻¹ * ((χ ^ 2)⁻¹ ε * gaussSum (χ ^ 2) ψ * (χ ^ 2)⁻¹ x)) := by let : Fintype (O ⧸ P) := quotientFintype P change let χ := canonicalSextic P hgood (Nat.card (O ⧸ P) : ℂ)⁻¹ * (∑ h : (O ⧸ P)ˣ, (∑ t : O ⧸ P, (χ ^ 0) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ ((ε * x) * ((h⁻¹ : (O ⧸ P)ˣ) : O ⧸ P))) = -(((χ⁻¹) ^ 2) σ) * ((Nat.card (O ⧸ P) : ℂ)⁻¹ * ((χ ^ 2)⁻¹ ε * gaussSum (χ ^ 2) ψ * (χ ^ 2)⁻¹ x)) let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let χ := canonicalSextic P hgood have hχ2 : χ ^ 2 ≠ 1 := canonicalSextic_pow_ne_one P hgood hchar (by decide : (2:ℕ) ≠ 0) (by decide : (2:ℕ) < 6) have hsum : (∑ h : (O ⧸ P)ˣ, (∑ t : O ⧸ P, (χ ^ 0) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ ((ε * x) * ((h⁻¹ : (O ⧸ P)ˣ) : O ⧸ P))) = -(((χ⁻¹) ^ 2) σ) * (∑ h : (O ⧸ P)ˣ, ((χ⁻¹) ^ 2) (h : O ⧸ P) * ψ ((ε * x) * ((h⁻¹ : (O ⧸ P)ˣ) : O ⧸ P))) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro h _ have hh : (h : O ⧸ P) ≠ 0 := Units.ne_zero h rw [pow_zero, ShortDraftLocal.trivial_fourier_coefficient ψ hψ h, ite_eq_right hh, map_mul] ring dsimp rw [hsum, ShortDraftLocal.active_zero_local_row χ ψ hχ2 ε x] ring end ActualEisensteinCubic namespace PrimitiveTrace open Complex open scoped ComplexConjugate open EisensteinEmbedding ConcreteTraceCRT private theorem complex_exp_trace_integer {t : ℂ} (ht : Complex.exp (2 * Real.pi * Complex.I * t) = 1) : ∃ n : ℤ, t = n := by obtain ⟨n, hn⟩ := Complex.exp_eq_one_iff.mp ht refine ⟨n, ?_⟩ have hnonzero : (2 * Real.pi * Complex.I : ℂ) ≠ 0 := by exact mul_ne_zero (by exact_mod_cast mul_ne_zero (by norm_num : (2 : ℝ) ≠ 0) Real.pi_ne_zero) Complex.I_ne_zero apply mul_left_cancel₀ hnonzero calc (2 * Real.pi * Complex.I : ℂ) * t = n * (2 * Real.pi * Complex.I) := by simpa only [mul_assoc] using hn _ = (2 * Real.pi * Complex.I : ℂ) * n := by ring private theorem phase_integer {z : ℂ} (hz : ShortDraftTrace.breveE (z / eisLam) = 1) : ∃ n : ℤ, z / eisLam + conj (z / eisLam) = n := by apply complex_exp_trace_integer exact hz private theorem omega_conj : conj omega3 = omega3 ^ 2 := by have hs : omega3 ^ 2 = -omega3 - 1 := by linear_combination omega3_sq rw [hs] unfold omega3 simp only [map_div₀, map_add, map_neg, map_one, map_mul, Complex.conj_ofReal, Complex.conj_I, map_ofNat] ring private theorem reconstruction (z : ℂ) : z = (z / eisLam + conj (z / eisLam)) + (omega3 * z / eisLam + conj (omega3 * z / eisLam)) + (z / eisLam + conj (z / eisLam)) * omega3 := by have hquad := omega3_sq have hl : eisLam ≠ 0 := eisLam_ne_zero have hcl : conj eisLam = -eisLam := by simp only [eisLam, map_add, map_one, map_mul, map_ofNat, omega_conj] linear_combination 2 * hquad simp only [map_div₀, map_mul, omega_conj, hcl, div_neg] dsimp [eisLam] at * field_simp linear_combination (conj z) * hquad private theorem in_coordinate_lattice_of_two_phases (z : ℂ) (hz : ShortDraftTrace.breveE (z / eisLam) = 1) (hwz : ShortDraftTrace.breveE (omega3 * z / eisLam) = 1) : z ∈ coordinateSubring := by obtain ⟨b, hb⟩ := phase_integer hz obtain ⟨c, hc⟩ := phase_integer hwz change ∃ a b : ℤ, z = (a : ℂ) + (b : ℂ) * omega3 refine ⟨b + c, b, ?_⟩ calc z = (z / eisLam + conj (z / eisLam)) + (omega3 * z / eisLam + conj (omega3 * z / eisLam)) + (z / eisLam + conj (z / eisLam)) * omega3 := reconstruction z _ = ((b + c : ℤ) : ℂ) + (b : ℂ) * omega3 := by rw [hb, hc] push_cast ring theorem eisTraceModChar_breveE_ne_one (P : Ideal O) [P.IsMaximal] (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) : eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp ≠ 1 := by intro hψ let ι := eisEmbedding let z : ℂ := (ι p)⁻¹ have hpι : ι p ≠ 0 := eisEmbedding_ne_zero hp have hbase1 : ∀ x : O, ShortDraftTrace.breveE (ι x / (ι p * eisLam)) = 1 := by intro x have hpoint := congrArg (fun f : AddChar (O ⧸ Ideal.span {p}) ℂ => f (Ideal.Quotient.mk (Ideal.span {p}) x)) hψ simpa only [eisTraceModChar, IdealGaussCRT.traceModChar_mk, AddChar.one_apply] using hpoint have h1 : ShortDraftTrace.breveE (z / eisLam) = 1 := by convert hbase1 1 using 1 ; dsimp [z, ι] ; simp ; field_simp have hw : ShortDraftTrace.breveE (omega3 * z / eisLam) = 1 := by convert hbase1 pb.gen using 1 · rw [show ι pb.gen = omega3 from embedding_gen omega3 omega3_sq] dsimp [z] field_simp have hz := in_coordinate_lattice_of_two_phases z h1 hw obtain ⟨q, hq⟩ := toCoordinateSubring_surjective ⟨z, hz⟩ have hιq : ι q = z := congrArg Subtype.val hq have hpq : p * q = 1 := by apply eisEmbedding_injective rw [map_mul, map_one, hιq] dsimp [z] exact mul_inv_cancel₀ hpι have hunit : IsUnit p := isUnit_iff_dvd_one.mpr ⟨q, hpq.symm⟩ have htop : P = ⊤ := by rw [hP] exact Ideal.span_singleton_eq_top.mpr hunit exact (inferInstance : P.IsMaximal).ne_top htop theorem eisTraceModChar_breveE_primitive (P : Ideal O) [P.IsMaximal] (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) : (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp).IsPrimitive := by have : (Ideal.span {p}).IsMaximal := hP ▸ inferInstance let : Field (O ⧸ Ideal.span {p}) := Ideal.Quotient.field _ exact AddChar.IsPrimitive.of_ne_one (eisTraceModChar_breveE_ne_one P p hP hp) end PrimitiveTrace end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.CubicNormalization namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical namespace ActualEisensteinCubic section open EisensteinEmbedding ConcreteTraceCRT PrimitiveTrace theorem cubicGauss_normalized_cube_breveE (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) (hprimary : lambda ^ 2 ∣ p - 1) : let : Fintype (O ⧸ P) := quotientFintype P (gaussSum ((cubicChar P hgood).ringHomComp eisEmbedding) (hP.symm ▸ eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp) / (‖eisEmbedding p‖ : ℂ)) ^ 3 = -(eisEmbedding p) / (‖eisEmbedding p‖ : ℂ) := by let : Fintype (O ⧸ P) := quotientFintype P change (gaussSum ((cubicChar P hgood).ringHomComp eisEmbedding) (hP.symm ▸ eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp) / (‖eisEmbedding p‖ : ℂ)) ^ 3 = -(eisEmbedding p) / (‖eisEmbedding p‖ : ℂ) subst P exact cubicGauss_normalized_cube_eis (Ideal.span {p}) hgood p rfl hprimary (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp) (eisTraceModChar_breveE_primitive (Ideal.span {p}) p rfl hp) end open EisensteinEmbedding ConcreteTraceCRT noncomputable def breveGamma2 (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) : ℂ := letI : Fintype (O ⧸ P) := quotientFintype P gaussSum (canonicalSextic P hgood ^ 2) (hP.symm ▸ eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp) / (‖eisEmbedding p‖ : ℂ) theorem canonicalSextic_pow_two (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : canonicalSextic P hgood ^ 2 = (cubicChar P hgood).ringHomComp eisEmbedding := by change ((sexticChar P hgood).ringHomComp eisEmbedding) ^ 2 = _ rw [MulChar.ringHomComp_pow, (sexticChar_powers P hgood).1] theorem breveGamma2_cube (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) (hprimary : lambda ^ 2 ∣ p - 1) : (breveGamma2 P hgood p hP hp) ^ 3 = -(eisEmbedding p) / (‖eisEmbedding p‖ : ℂ) := by let : Fintype (O ⧸ P) := quotientFintype P unfold breveGamma2 rw [canonicalSextic_pow_two] exact cubicGauss_normalized_cube_breveE P hgood p hP hp hprimary end ActualEisensteinCubic namespace ShortDraftLocal open AddChar MulChar theorem general_inversion_gauss {F : Type*} [Field F] [Fintype F] [DecidableEq F] (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (j : ℕ) (a : F) : (∑ h : Fˣ, (((χ ^ j)⁻¹ * (χ⁻¹) ^ 2) h) * ψ (a * ((h⁻¹ : Fˣ) : F))) = gaussSum (χ ^ (j + 2)) (ψ.mulShift a) := by classical calc (∑ h : Fˣ, (((χ ^ j)⁻¹ * (χ⁻¹) ^ 2) h) * ψ (a * ((h⁻¹ : Fˣ) : F))) = ∑ y : Fˣ, (((χ ^ j)⁻¹ * (χ⁻¹) ^ 2) (y⁻¹)) * ψ (a * (y : F)) := by apply Fintype.sum_equiv (Equiv.inv Fˣ) intro y simp _ = ∑ y : Fˣ, (χ ^ (j + 2)) y * ψ (a * (y : F)) := by congr 1 funext y congr 1 have hchar : (((χ ^ j)⁻¹ * (χ⁻¹) ^ 2)⁻¹) = χ ^ (j + 2) := by group rw [← hchar, MulChar.inv_apply'] _ = gaussSum (χ ^ (j + 2)) (ψ.mulShift a) := by rw [gaussSum_eq_units_sum] simp only [AddChar.mulShift_apply] theorem sextic_fourier_theta_row_general {F : Type*} [Field F] [Fintype F] [DecidableEq F] (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (j : ℕ) (hχj : χ ^ j ≠ 1) (hχj2 : χ ^ (j + 2) ≠ 1) (σ : Fˣ) (ε x : F) : (Fintype.card F : ℂ)⁻¹ * (∑ h : Fˣ, (∑ t : F, (χ ^ j) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ ((ε * x) * ((h⁻¹ : Fˣ) : F))) = ((χ⁻¹) ^ 2) σ * ((Fintype.card F : ℂ)⁻¹ * gaussSum (χ ^ j) (ψ.mulShift (-1)) * gaussSum (χ ^ (j + 2)) ψ * (χ ^ (j + 2))⁻¹ ε) * (χ ^ (j + 2))⁻¹ x := by classical have hsum : (∑ h : Fˣ, (∑ t : F, (χ ^ j) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ ((ε * x) * ((h⁻¹ : Fˣ) : F))) = ((χ⁻¹) ^ 2) σ * gaussSum (χ ^ j) (ψ.mulShift (-1)) * (∑ h : Fˣ, (((χ ^ j)⁻¹ * (χ⁻¹) ^ 2) h) * ψ ((ε * x) * ((h⁻¹ : Fˣ) : F))) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro h _ rw [nontrivial_fourier_coefficient (χ ^ j) ψ hχj h, map_mul] simp only [MulChar.mul_apply] ring rw [hsum, general_inversion_gauss χ ψ j (ε * x), gaussSum_mulShift_any (χ ^ (j + 2)) ψ hχj2 (ε * x), map_mul] ring end ShortDraftLocal namespace ActualEisensteinCubic section open AddChar MulChar theorem canonical_A5_nonexceptional (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (ψ : AddChar (O ⧸ P) ℂ) (j : ℕ) (hj0 : j ≠ 0) (hj6 : j < 6) (hj4 : j ≠ 4) (σ : (O ⧸ P)ˣ) (ε x : O ⧸ P) : let : Fintype (O ⧸ P) := quotientFintype P let χ := canonicalSextic P hgood (Nat.card (O ⧸ P) : ℂ)⁻¹ * (∑ h : (O ⧸ P)ˣ, (∑ t : O ⧸ P, (χ ^ j) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ ((ε * x) * ((h⁻¹ : (O ⧸ P)ˣ) : O ⧸ P))) = ((χ⁻¹) ^ 2) σ * ((Nat.card (O ⧸ P) : ℂ)⁻¹ * gaussSum (χ ^ j) (ψ.mulShift (-1)) * gaussSum (χ ^ (j + 2)) ψ * (χ ^ (j + 2))⁻¹ ε) * (χ ^ (j + 2))⁻¹ x := by let : Fintype (O ⧸ P) := quotientFintype P change let χ := canonicalSextic P hgood (Nat.card (O ⧸ P) : ℂ)⁻¹ * (∑ h : (O ⧸ P)ˣ, (∑ t : O ⧸ P, (χ ^ j) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ ((ε * x) * ((h⁻¹ : (O ⧸ P)ˣ) : O ⧸ P))) = ((χ⁻¹) ^ 2) σ * ((Nat.card (O ⧸ P) : ℂ)⁻¹ * gaussSum (χ ^ j) (ψ.mulShift (-1)) * gaussSum (χ ^ (j + 2)) ψ * (χ ^ (j + 2))⁻¹ ε) * (χ ^ (j + 2))⁻¹ x let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let χ := canonicalSextic P hgood have hχj : χ ^ j ≠ 1 := canonicalSextic_pow_ne_one P hgood hchar hj0 hj6 have hχj2 : χ ^ (j + 2) ≠ 1 := by have hcases : j = 1 ∨ j = 2 ∨ j = 3 ∨ j = 5 := by omega rcases hcases with rfl | rfl | rfl | rfl · exact canonicalSextic_pow_ne_one P hgood hchar (by decide : (3:ℕ) ≠ 0) (by decide : (3:ℕ) < 6) · exact canonicalSextic_pow_ne_one P hgood hchar (by decide : (4:ℕ) ≠ 0) (by decide : (4:ℕ) < 6) · exact canonicalSextic_pow_ne_one P hgood hchar (by decide : (5:ℕ) ≠ 0) (by decide : (5:ℕ) < 6) · have hχ1 : χ ≠ 1 := by simpa only [pow_one, χ] using canonicalSextic_pow_ne_one P hgood hchar (by decide : (1:ℕ) ≠ 0) (by decide : (1:ℕ) < 6) have hχ7 : χ ^ (5 + 2) = χ := by calc χ ^ (5 + 2) = χ ^ (6 + 1) := by congr 1 _ = χ ^ 6 * χ := by rw [pow_add, pow_one] _ = χ := by rw [canonicalSextic_pow_six P hgood, one_mul] rw [hχ7] exact hχ1 dsimp rw [Nat.card_eq_fintype_card] exact ShortDraftLocal.sextic_fourier_theta_row_general χ ψ j hχj hχj2 σ ε x end open ConcreteTraceCRT PrimitiveTrace end ActualEisensteinCubic namespace AnalyticBridge theorem schwartz_fourier_one_plus_integrable (g : 𝓢(ℝ, ℂ)) (J : ℕ) : Integrable (fun t : ℝ => (1 + ‖t‖) ^ J * ‖(𝓕 g) t‖) volume := by let b := 𝓕 g have hI0 : Integrable (fun t : ℝ => ‖b t‖) volume := by simpa [b] using b.integrable_pow_mul volume 0 have hIJ : Integrable (fun t : ℝ => ‖t‖ ^ J * ‖b t‖) volume := b.integrable_pow_mul volume J have hR : Integrable (fun t : ℝ => (2 : ℝ) ^ J * (‖b t‖ + ‖t‖ ^ J * ‖b t‖)) volume := (hI0.add hIJ).const_mul _ have hpoint (t : ℝ) : (1 + ‖t‖) ^ J * ‖b t‖ ≤ (2 : ℝ) ^ J * (‖b t‖ + ‖t‖ ^ J * ‖b t‖) := by have hp := add_pow_le (show (0 : ℝ) ≤ 1 by norm_num) (norm_nonneg t) J have htwo : (2 : ℝ) ^ (J - 1) ≤ (2 : ℝ) ^ J := pow_le_pow_right₀ (by norm_num) (Nat.sub_le J 1) calc (1 + ‖t‖) ^ J * ‖b t‖ ≤ (2 : ℝ) ^ (J - 1) * (1 ^ J + ‖t‖ ^ J) * ‖b t‖ := mul_le_mul_of_nonneg_right hp (norm_nonneg _) _ ≤ (2 : ℝ) ^ J * (1 ^ J + ‖t‖ ^ J) * ‖b t‖ := by gcongr _ = (2 : ℝ) ^ J * (‖b t‖ + ‖t‖ ^ J * ‖b t‖) := by simp; ring have hcont : Continuous (fun t : ℝ => (1 + ‖t‖) ^ J * ‖b t‖) := by fun_prop exact hR.mono_nonneg hcont.aestronglyMeasurable (Filter.Eventually.of_forall (by intro t; positivity)) (Filter.Eventually.of_forall hpoint) end AnalyticBridge namespace JacobiQuadratic open Finset variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] private def affineDouble (hchar : ringChar F ≠ 2) : F ≃ F where toFun x := 2 * x - 1 invFun t := (t + 1) / 2 left_inv := by intro x have h2 : (2 : F) ≠ 0 := Ring.two_ne_zero hchar field_simp ring right_inv := by intro t have h2 : (2 : F) ≠ 0 := Ring.two_ne_zero hchar field_simp ring private def oneSub : F ≃ F where toFun y := 1 - y invFun y := 1 - y left_inv := by intro y; ring right_inv := by intro y; ring private theorem square_fiber (χ : MulChar F ℂ) (hchar : ringChar F ≠ 2) : (∑ t : F, χ (1 - t ^ 2)) = ∑ y : F, ((quadraticChar F y : ℂ) + 1) * χ (1 - y) := by classical have hfiber : (∑ t : F, χ (1 - t ^ 2)) = ∑ y : F, (#{t : F | t ^ 2 = y}.toFinset : ℂ) * χ (1 - y) := by rw [← Finset.sum_fiberwise (s := Finset.univ) (g := fun t : F => t ^ 2) (f := fun t : F => χ (1 - t ^ 2))] apply Finset.sum_congr rfl intro y _ rw [Finset.sum_congr rfl (fun t ht => by simp only [Finset.mem_filter, Finset.mem_univ, true_and] at ht rw [ht])] simp rw [hfiber] apply Finset.sum_congr rfl intro y _ congr 1 exact_mod_cast quadraticChar_card_sqrts hchar y theorem jacobi_quadratic (χ : MulChar F ℂ) (hchar : ringChar F ≠ 2) (hχ : χ ≠ 1) : jacobiSum χ ((quadraticChar F).ringHomComp (Int.castRingHom ℂ)) = χ (4 : F) * jacobiSum χ χ := by classical let q : MulChar F ℂ := (quadraticChar F).ringHomComp (Int.castRingHom ℂ) have hsum0 : (∑ y : F, χ (1 - y)) = 0 := by have ht := (Equiv.sum_comp (oneSub (F := F)) χ) change (∑ y : F, χ ((oneSub (F := F)) y)) = 0 exact ht.trans (MulChar.sum_eq_zero_of_ne_one hχ) have hfiber := square_fiber χ hchar have hsq : (∑ t : F, χ (1 - t ^ 2)) = jacobiSum χ q := by rw [hfiber] simp_rw [add_mul] rw [Finset.sum_add_distrib] simp only [one_mul, hsum0, add_zero] exact jacobiSum_comm q χ have hchange : (∑ t : F, χ (1 - t ^ 2)) = ∑ x : F, χ (4 * x * (1 - x)) := by have ht := Equiv.sum_comp (affineDouble (F := F) hchar) (fun t : F => χ (1 - t ^ 2)) convert ht.symm using 1 · apply Finset.sum_congr rfl intro x _ congr 1 change 4 * x * (1 - x) = 1 - (2 * x - 1) ^ 2 ring calc jacobiSum χ q = ∑ x : F, χ (4 * x * (1 - x)) := hsq.symm.trans hchange _ = χ (4 : F) * jacobiSum χ χ := by rw [jacobiSum, Finset.mul_sum] apply Finset.sum_congr rfl intro x _ simp only [ map_mul] ring theorem gauss_sextic_relation (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (hchar : ringChar F ≠ 2) (hψ : ψ.IsPrimitive) (hχ1 : χ ≠ 1) (hχ2 : χ ^ 2 ≠ 1) (hχ4 : χ ^ 4 ≠ 1) (hχ3 : χ ^ 3 = (quadraticChar F).ringHomComp (Int.castRingHom ℂ)) (hχ6 : χ ^ 6 = 1) : χ (4 : F) * gaussSum χ ψ * (Fintype.card F : ℂ) = gaussSum (χ ^ 3) ψ * gaussSum (χ ^ 2) ψ ^ 2 := by let g1 := gaussSum χ ψ let g2 := gaussSum (χ ^ 2) ψ let g3 := gaussSum (χ ^ 3) ψ let g4 := gaussSum (χ ^ 4) ψ let J11 := jacobiSum χ χ let J13 := jacobiSum χ (χ ^ 3) have hprod2 : χ * χ = χ ^ 2 := (pow_two χ).symm have hprod4 : χ * χ ^ 3 = χ ^ 4 := by group have hJ12 : g2 * J11 = g1 * g1 := by have h := jacobiSum_mul_nontrivial (by rw [hprod2]; exact hχ2) ψ (χ := χ) (φ := χ) rw [hprod2] at h exact h have hJ13 : g4 * J13 = g1 * g3 := by have h := jacobiSum_mul_nontrivial (by rw [hprod4]; exact hχ4) ψ (χ := χ) (φ := χ ^ 3) rw [hprod4] at h exact h have hJquad : J13 = χ (4 : F) * J11 := by simpa only [J13, J11, hχ3] using jacobi_quadratic χ hchar hχ1 have hg1ne : g1 ≠ 0 := by apply gaussSum_ne_zero_of_nontrivial · exact_mod_cast Fintype.card_pos.ne' · exact hχ1 · exact hψ have h4inv : χ ^ 4 = (χ ^ 2)⁻¹ := by apply (inv_eq_of_mul_eq_one_right ?_).symm calc χ ^ 2 * χ ^ 4 = χ ^ 6 := by group _ = 1 := hχ6 have h4minus : (χ ^ 4) (-1 : F) = 1 := by rw [χ.pow_apply' (by decide : (4 : ℕ) ≠ 0), ← map_pow, show (-1 : F) ^ 4 = 1 by ring, map_one] have hG4inv : gaussSum (χ ^ 4) ψ⁻¹ = g4 := by have h := mul_gaussSum_inv_eq_gaussSum (χ ^ 4) ψ rw [h4minus, one_mul] at h exact h have hG24 : g2 * g4 = (Fintype.card F : ℂ) := by have h := gaussSum_mul_gaussSum_eq_card hχ2 hψ rw [← h4inv, hG4inv] at h exact h have hbasic : g1 * g3 * g2 = χ (4 : F) * g4 * g1 ^ 2 := by calc g1 * g3 * g2 = (g4 * J13) * g2 := by rw [hJ13] _ = χ (4 : F) * g4 * (g2 * J11) := by rw [hJquad]; ring _ = χ (4 : F) * g4 * g1 ^ 2 := by rw [hJ12]; ring have hbasic' : g3 * g2 = χ (4 : F) * g4 * g1 := by apply mul_left_cancel₀ hg1ne calc g1 * (g3 * g2) = g1 * g3 * g2 := by ring _ = χ (4 : F) * g4 * g1 ^ 2 := hbasic _ = g1 * (χ (4 : F) * g4 * g1) := by ring calc χ (4 : F) * g1 * (Fintype.card F : ℂ) = χ (4 : F) * g1 * (g2 * g4) := by rw [hG24] _ = (χ (4 : F) * g4 * g1) * g2 := by ring _ = g3 * g2 ^ 2 := by rw [← hbasic']; ring theorem normalized_gauss_sextic_relation (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (hchar : ringChar F ≠ 2) (hψ : ψ.IsPrimitive) (hχ1 : χ ≠ 1) (hχ2 : χ ^ 2 ≠ 1) (hχ4 : χ ^ 4 ≠ 1) (hχ3 : χ ^ 3 = (quadraticChar F).ringHomComp (Int.castRingHom ℂ)) (hχ6 : χ ^ 6 = 1) (s : ℂ) (hs : s ^ 2 = (Fintype.card F : ℂ)) (hs0 : s ≠ 0) : χ (4 : F) * (gaussSum χ ψ / s) * (gaussSum (χ ^ 2) ψ / s) = (gaussSum (χ ^ 3) ψ / s) * (gaussSum (χ ^ 2) ψ / s) ^ 3 := by have hraw := gauss_sextic_relation χ ψ hchar hψ hχ1 hχ2 hχ4 hχ3 hχ6 rw [← hs] at hraw field_simp linear_combination (gaussSum (χ ^ 2) ψ) * hraw end JacobiQuadratic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.SexticNormalization namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical namespace ActualEisensteinCubic section open EisensteinEmbedding ConcreteTraceCRT PrimitiveTrace noncomputable def breveGamma1 (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) : ℂ := letI : Fintype (O ⧸ P) := quotientFintype P gaussSum (canonicalSextic P hgood) (hP.symm ▸ eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp) / (‖eisEmbedding p‖ : ℂ) noncomputable def breveGamma3 (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) : ℂ := letI : Fintype (O ⧸ P) := quotientFintype P gaussSum (canonicalSextic P hgood ^ 3) (hP.symm ▸ eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp) / (‖eisEmbedding p‖ : ℂ) theorem canonicalSextic_pow_three_quadratic (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : let : Fintype (O ⧸ P) := quotientFintype P let : Field (O ⧸ P) := quotientField P canonicalSextic P hgood ^ 3 = (quadraticChar (O ⧸ P)).ringHomComp (Int.castRingHom ℂ) := by let : Fintype (O ⧸ P) := quotientFintype P let : Field (O ⧸ P) := quotientField P change canonicalSextic P hgood ^ 3 = (quadraticChar (O ⧸ P)).ringHomComp (Int.castRingHom ℂ) change ((sexticChar P hgood).ringHomComp eisEmbedding) ^ 3 = _ rw [MulChar.ringHomComp_pow, (sexticChar_powers P hgood).2.1] ext x change eisEmbedding ((quadraticChar (O ⧸ P) x : ℤ) : O) = ((quadraticChar (O ⧸ P) x : ℤ) : ℂ) simp theorem breveGamma1_gamma2_relation (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) (hprimary : lambda ^ 2 ∣ p - 1) : breveGamma1 P hgood p hP hp * breveGamma2 P hgood p hP hp = (canonicalSextic P hgood (Ideal.Quotient.mk P (4 : O)))⁻¹ * breveGamma3 P hgood p hP hp * (breveGamma2 P hgood p hP hp) ^ 3 := by subst P let : Fintype (O ⧸ Ideal.span {p}) := quotientFintype (Ideal.span {p}) let : Field (O ⧸ Ideal.span {p}) := quotientField (Ideal.span {p}) let χ := canonicalSextic (Ideal.span {p}) hgood let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp let s : ℂ := ‖eisEmbedding p‖ have hψ : ψ.IsPrimitive := eisTraceModChar_breveE_primitive (Ideal.span {p}) p rfl hp have hχ1 : χ ≠ 1 := by simpa only [pow_one] using (canonicalSextic_pow_ne_one (Ideal.span {p}) hgood hchar (by decide : (1 : ℕ) ≠ 0) (by decide : (1 : ℕ) < 6)) have hχ2 : χ ^ 2 ≠ 1 := canonicalSextic_pow_ne_one (Ideal.span {p}) hgood hchar (by decide : (2 : ℕ) ≠ 0) (by decide : (2 : ℕ) < 6) have hχ4 : χ ^ 4 ≠ 1 := canonicalSextic_pow_ne_one (Ideal.span {p}) hgood hchar (by decide : (4 : ℕ) ≠ 0) (by decide : (4 : ℕ) < 6) have hχ3 : χ ^ 3 = (quadraticChar (O ⧸ Ideal.span {p})).ringHomComp (Int.castRingHom ℂ) := canonicalSextic_pow_three_quadratic (Ideal.span {p}) hgood have hχ6 : χ ^ 6 = 1 := canonicalSextic_pow_six (Ideal.span {p}) hgood have hs : s ^ 2 = (Fintype.card (O ⧸ Ideal.span {p}) : ℂ) := by have hnormO := primary_generator_mul_conj_eq_card (Ideal.span {p}) hgood p rfl hprimary have hnormC := congrArg eisEmbedding hnormO rw [map_mul, eisEmbedding_conjO, map_natCast] at hnormC simpa only [s, ← starRingEnd_apply, Complex.mul_conj', Nat.card_eq_fintype_card] using hnormC have hs0 : s ≠ 0 := by dsimp [s] exact_mod_cast (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hp)) have hmul := JacobiQuadratic.normalized_gauss_sextic_relation χ ψ hchar hψ hχ1 hχ2 hχ4 hχ3 hχ6 s hs hs0 have hfour : (4 : O ⧸ Ideal.span {p}) ≠ 0 := by have htwo : (2 : O ⧸ Ideal.span {p}) ≠ 0 := Ring.two_ne_zero hchar convert pow_ne_zero 2 htwo using 1 ; norm_num have hχfour : χ (4 : O ⧸ Ideal.span {p}) ≠ 0 := χ.apply_ne_zero_iff.mpr (isUnit_iff_ne_zero.mpr hfour) change χ 4 * breveGamma1 (Ideal.span {p}) hgood p rfl hp * breveGamma2 (Ideal.span {p}) hgood p rfl hp = breveGamma3 (Ideal.span {p}) hgood p rfl hp * breveGamma2 (Ideal.span {p}) hgood p rfl hp ^ 3 at hmul change breveGamma1 (Ideal.span {p}) hgood p rfl hp * breveGamma2 (Ideal.span {p}) hgood p rfl hp = (χ 4)⁻¹ * breveGamma3 (Ideal.span {p}) hgood p rfl hp * breveGamma2 (Ideal.span {p}) hgood p rfl hp ^ 3 calc breveGamma1 (Ideal.span {p}) hgood p rfl hp * breveGamma2 (Ideal.span {p}) hgood p rfl hp = (χ 4)⁻¹ * (χ 4 * breveGamma1 (Ideal.span {p}) hgood p rfl hp * breveGamma2 (Ideal.span {p}) hgood p rfl hp) := by field_simp _ = (χ 4)⁻¹ * (breveGamma3 (Ideal.span {p}) hgood p rfl hp * breveGamma2 (Ideal.span {p}) hgood p rfl hp ^ 3) := by rw [hmul] _ = _ := by ring end section open EisensteinEmbedding ConcreteTraceCRT IdealGaussCRT end section open EisensteinEmbedding ConcreteTraceCRT PrimitiveTrace noncomputable def breveLocalG (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) : ℂ := (canonicalSextic P hgood (Ideal.Quotient.mk P (4 : O)))⁻¹ * breveGamma3 P hgood p hP hp theorem breveGamma1_gamma2_eq_neg_alpha_G (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) (hprimary : lambda ^ 2 ∣ p - 1) : breveGamma1 P hgood p hP hp * breveGamma2 P hgood p hP hp = (-(eisEmbedding p) / (‖eisEmbedding p‖ : ℂ)) * breveLocalG P hgood p hP hp := by rw [breveGamma1_gamma2_relation P hgood hchar p hP hp hprimary, breveGamma2_cube P hgood p hP hp hprimary] unfold breveLocalG ring end open EisensteinEmbedding ConcreteTraceCRT ConcreteBreveE end ActualEisensteinCubic namespace ConcreteBreveE open EisensteinEmbedding ConcreteTraceCRT noncomputable def normalizedTraceGauss (a : O) (ha : a ≠ 0) (χ : MulChar (O ⧸ Ideal.span {a}) ℂ) : ℂ := by letI : Finite (O ⧸ Ideal.span {a}) := finite_quotient_span ha letI : Fintype (O ⧸ Ideal.span {a}) := Fintype.ofFinite _ exact gaussSum χ (eisTraceModChar ShortDraftTrace.breveE breveE_period_coordinates a ha) / (‖eisEmbedding a‖ : ℂ) end ConcreteBreveE namespace FixedRayActiveSet open scoped BigOperators end FixedRayActiveSet namespace CubeInversion end CubeInversion namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT PrimitiveTrace noncomputable def breveGammaMinus1 (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) : ℂ := letI : Fintype (O ⧸ P) := quotientFintype P gaussSum (canonicalSextic P hgood)⁻¹ (hP.symm ▸ eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp) / (‖eisEmbedding p‖ : ℂ) private theorem canonicalSextic_order_six (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) : orderOf (canonicalSextic P hgood) = 6 := by let Φ : MulChar (O ⧸ P) O →* MulChar (O ⧸ P) ℂ := MulChar.ringHomCompHom eisEmbedding have hΦ : Function.Injective Φ := by intro x y h apply MulChar.ext intro t apply eisEmbedding_injective exact congrArg (fun f : MulChar (O ⧸ P) ℂ => f t) h change orderOf (Φ (sexticChar P hgood)) = 6 rw [orderOf_injective Φ hΦ, sexticChar_order P hgood hchar] theorem breveGamma1_gammaMinus1 (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) (hprimary : lambda ^ 2 ∣ p - 1) : breveGamma1 P hgood p hP hp * breveGammaMinus1 P hgood p hP hp = canonicalSextic P hgood (Ideal.Quotient.mk P (-1 : O)) := by subst P let : Fintype (O ⧸ Ideal.span {p}) := quotientFintype (Ideal.span {p}) let : Field (O ⧸ Ideal.span {p}) := quotientField (Ideal.span {p}) let χ := canonicalSextic (Ideal.span {p}) hgood let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp let s : ℂ := ‖eisEmbedding p‖ have hψ : ψ.IsPrimitive := eisTraceModChar_breveE_primitive (Ideal.span {p}) p rfl hp have hχ1 : χ ≠ 1 := by simpa only [pow_one] using (canonicalSextic_pow_ne_one (Ideal.span {p}) hgood hchar (by decide : (1 : ℕ) ≠ 0) (by decide : (1 : ℕ) < 6)) have hχ6 : χ ^ 6 = 1 := canonicalSextic_pow_six (Ideal.span {p}) hgood have horder : orderOf χ = 6 := canonicalSextic_order_six (Ideal.span {p}) hgood hchar have hχ5 : χ ^ 5 = χ⁻¹ := by apply (inv_eq_of_mul_eq_one_right ?_).symm calc χ * χ ^ 5 = χ ^ 6 := by group _ = 1 := hχ6 have hprod := gaussSum_mul_gaussSum_pow_orderOf_sub_one hχ1 hψ rw [horder, show 6 - 1 = 5 by decide, hχ5] at hprod have hs : s ^ 2 = (Fintype.card (O ⧸ Ideal.span {p}) : ℂ) := by have hnormO := primary_generator_mul_conj_eq_card (Ideal.span {p}) hgood p rfl hprimary have hnormC := congrArg eisEmbedding hnormO rw [map_mul, eisEmbedding_conjO, map_natCast] at hnormC simpa only [s, ← starRingEnd_apply, Complex.mul_conj', Nat.card_eq_fintype_card] using hnormC have hs0 : s ≠ 0 := by dsimp [s] exact_mod_cast (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hp)) change (gaussSum χ ψ / s) * (gaussSum χ⁻¹ ψ / s) = χ (-1) field_simp rw [hs] simpa only [mul_comm] using hprod end ActualEisensteinCubic namespace PowerExtraction end PowerExtraction end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.LocalProductAssembly namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical namespace ActualEisensteinCubic open ConcreteTraceCRT open scoped ComplexConjugate theorem canonicalSextic_inverse_eq_conj_on_units (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (u : (O ⧸ P)ˣ) : (canonicalSextic P hgood (u : O ⧸ P))⁻¹ = star (canonicalSextic P hgood (u : O ⧸ P)) := by let χ := canonicalSextic P hgood have hχ6 : χ ^ 6 = 1 := canonicalSextic_pow_six P hgood have hval : χ (u : O ⧸ P) ^ 6 = 1 := by rw [← χ.pow_apply_coe 6 u, hχ6, MulChar.one_apply_coe] exact Complex.inv_eq_conj (Complex.norm_eq_one_of_pow_eq_one hval (by decide)) end ActualEisensteinCubic namespace FourierBridge open scoped ContDiff FourierTransform SchwartzMap end FourierBridge namespace AnalyticBridge end AnalyticBridge namespace FourierBridge open scoped FourierTransform SchwartzMap theorem logPhase_norm (t y : ℝ) : ‖logPhase t y‖ = 1 := by simpa [logPhase] using Complex.norm_exp_ofReal_mul_I (2 * Real.pi * t * y) theorem logPhase_continuous_left (y : ℝ) : Continuous (fun t : ℝ => logPhase t y) := by unfold logPhase fun_prop end FourierBridge namespace AnalyticBridge open scoped FourierTransform SchwartzMap end AnalyticBridge namespace PowerExtraction end PowerExtraction namespace ActualEisensteinCubic section open AddChar MulChar end theorem canonicalSextic_sixth_power_mask (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (a : O) : canonicalSextic P hgood (Ideal.Quotient.mk P (a ^ 6)) = if a ∈ P then 0 else 1 := by let : Field (O ⧸ P) := Ideal.Quotient.field P rw [map_pow, ShortDraftSextic.sextic_power_is_unit_mask (canonicalSextic P hgood) (canonicalSextic_pow_six P hgood)] by_cases ha : a ∈ P · simp [ha, isUnit_iff_ne_zero, Ideal.Quotient.eq_zero_iff_mem] · simp [ha, isUnit_iff_ne_zero, Ideal.Quotient.eq_zero_iff_mem] end ActualEisensteinCubic namespace PoissonFirstLocal end PoissonFirstLocal end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.RamifiedTracePhase namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical namespace TraceLambdaPhase open EisensteinEmbedding ConcreteTraceCRT Complex open scoped ComplexConjugate theorem eisLam_sq : eisLam ^ 2 = (-3 : ℂ) := by change (1 + 2 * omega3) ^ 2 = -3 linear_combination 4 * omega3_sq theorem exp_minus_four_pi_div_three : Complex.exp (-(4 : ℂ) * Real.pi * Complex.I / 3) = omega3 := by have hshift : Complex.exp (-(4 : ℂ) * Real.pi * Complex.I / 3) = Complex.exp ((2 : ℂ) * Real.pi * Complex.I / 3) := by apply Complex.exp_eq_exp_iff_exists_int.mpr refine ⟨-1, ?_⟩ push_cast ring rw [hshift] have harg : ((2 : ℂ) * Real.pi * Complex.I / 3) = (((2 * Real.pi / 3 : ℝ) : ℂ) * Complex.I) := by push_cast ring rw [harg, Complex.exp_ofReal_mul_I] have htwo : (2 * Real.pi / 3 : ℝ) = Real.pi - Real.pi / 3 := by ring rw [htwo, Real.cos_pi_sub, Real.sin_pi_sub, Real.cos_pi_div_three, Real.sin_pi_div_three] unfold omega3 push_cast ring end TraceLambdaPhase namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT ConcreteBreveE TraceLambdaPhase end ActualEisensteinCubic namespace PoissonFirstLocal open scoped Classical end PoissonFirstLocal namespace ActualEisensteinCubic section open EisensteinEmbedding ConcreteTraceCRT ConcreteBreveE TraceLambdaPhase end noncomputable def finiteSquarefreeRow {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (S : Finset ι) (u : O) : ℂ := ∏ i ∈ S, canonicalSextic (P i) (hgood i) (Ideal.Quotient.mk (P i) u) theorem finiteSquarefreeRow_sixth_power {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (S : Finset ι) (a : O) : finiteSquarefreeRow P hgood S (a ^ 6) = if ∃ i ∈ S, a ∈ P i then 0 else 1 := by classical simp only [finiteSquarefreeRow] by_cases hex : ∃ i ∈ S, a ∈ P i · obtain ⟨i, hi, hai⟩ := hex rw [ite_eq_left ⟨i, hi, hai⟩] apply Finset.prod_eq_zero hi rw [canonicalSextic_sixth_power_mask] simp [hai] · rw [ite_eq_right hex] apply Finset.prod_eq_one intro i hi rw [canonicalSextic_sixth_power_mask] simp [show a ∉ P i by intro hai; exact hex ⟨i, hi, hai⟩] theorem finiteSquarefreeRow_difference {ι N : Type*} [DecidableEq N] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (columns : Finset N) (support : N → Finset ι) (weight : N → ℂ) (a : O) : (∑ n ∈ columns, weight n) - (∑ n ∈ columns, weight n * finiteSquarefreeRow P hgood (support n) (a ^ 6)) = ∑ n ∈ columns.filter (fun n => ∃ i ∈ support n, a ∈ P i), weight n := by classical rw [← Finset.sum_sub_distrib] rw [Finset.sum_filter] apply Finset.sum_congr rfl intro n hn rw [finiteSquarefreeRow_sixth_power] by_cases h : ∃ i ∈ support n, a ∈ P i <;> simp [h] theorem finiteSquarefreeRow_difference_norm {ι N : Type*} [DecidableEq N] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (columns : Finset N) (support : N → Finset ι) (weight : N → ℂ) (a : O) : ‖(∑ n ∈ columns, weight n) - (∑ n ∈ columns, weight n * finiteSquarefreeRow P hgood (support n) (a ^ 6))‖ ≤ ∑ n ∈ columns.filter (fun n => ∃ i ∈ support n, a ∈ P i), ‖weight n‖ := by rw [finiteSquarefreeRow_difference] exact norm_sum_le _ _ end ActualEisensteinCubic namespace AnalyticBridge end AnalyticBridge namespace ShortDraftCusp variable {R : Type*} [CommRing R] end ShortDraftCusp namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT Complex theorem breveE_quarter_trace (a b : ℤ) : ShortDraftTrace.breveE ((((a : ℂ) + (b : ℂ) * omega3) / eisLam) / 4) = Complex.I ^ b := by have htrace := ShortDraftTrace.trace_div_lam omega3 omega3_sq ShortDraftTrace.omega_conj a b have hconj : ∀ z : ℂ, star (z / 4) = star z / 4 := by intro z simp change Complex.exp (2 * Real.pi * Complex.I * (((((a : ℂ) + (b : ℂ) * omega3) / eisLam) / 4) + star (((((a : ℂ) + (b : ℂ) * omega3) / eisLam) / 4)))) = _ rw [hconj] have hL : ((a : ℂ) + (b : ℂ) * omega3) / eisLam + star (((a : ℂ) + (b : ℂ) * omega3) / eisLam) = (b : ℂ) := by simpa only [eisLam, Complex.star_def] using htrace have harg : 2 * Real.pi * Complex.I * (((((a : ℂ) + (b : ℂ) * omega3) / eisLam) / 4) + (star (((a : ℂ) + (b : ℂ) * omega3) / eisLam)) / 4) = (b : ℂ) * (Real.pi / 2 * Complex.I) := by rw [← add_div, hL] ring rw [harg, Complex.exp_int_mul, Complex.exp_pi_div_two_mul_I] noncomputable def breveGaussianFourTerms (a b : ℤ) : ℂ := let c : ℂ := (a : ℂ) + (b : ℂ) * omega3 (ShortDraftTrace.breveE (0 : ℂ) + ShortDraftTrace.breveE (((-c) / eisLam) / 4) + ShortDraftTrace.breveE (((-c * omega3 ^ 2) / eisLam) / 4) + ShortDraftTrace.breveE (((-c * (1 + omega3) ^ 2) / eisLam) / 4)) / 2 theorem breveGaussianFourTerms_formula (a b : ℤ) : breveGaussianFourTerms a b = (1 + Complex.I ^ (-b) + Complex.I ^ a + Complex.I ^ (b-a)) / 2 := by let c : ℂ := (a : ℂ) + (b : ℂ) * omega3 have hfirst : ShortDraftTrace.breveE (((-c) / eisLam) / 4) = Complex.I ^ (-b) := by have hc : -c = ((-a : ℤ) : ℂ) + ((-b : ℤ) : ℂ) * omega3 := by dsimp [c] push_cast ring rw [hc] exact breveE_quarter_trace (-a) (-b) have hsecond : ShortDraftTrace.breveE (((-c * omega3 ^ 2) / eisLam) / 4) = Complex.I ^ a := by have hc : -c * omega3 ^ 2 = ((a-b : ℤ) : ℂ) + (a : ℂ) * omega3 := by dsimp [c] push_cast linear_combination -(a : ℂ) * omega3_sq - (b : ℂ) * (omega3 - 1) * omega3_sq rw [hc] exact breveE_quarter_trace (a-b) a have hthird : ShortDraftTrace.breveE (((-c * (1 + omega3) ^ 2) / eisLam) / 4) = Complex.I ^ (b-a) := by have hω : (1 + omega3) ^ 2 = omega3 := by linear_combination omega3_sq have hc : -c * (1 + omega3) ^ 2 = (b : ℂ) + ((b-a : ℤ) : ℂ) * omega3 := by rw [hω] dsimp [c] push_cast linear_combination -(b : ℂ) * omega3_sq rw [hc] exact breveE_quarter_trace b (b-a) dsimp [breveGaussianFourTerms] rw [hfirst, hsecond, hthird] simp only [map_zero_eq_one] end ActualEisensteinCubic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Arithmetic.LatticeCount namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical namespace ShortDraftLatticeCount def q (x : ℤ × ℤ) : ℤ := x.1 ^ 2 - x.1 * x.2 + x.2 ^ 2 theorem coordinate_squares (a b D : ℤ) (hD : 0 ≤ D) (h : a ^ 2 - a * b + b ^ 2 ≤ D) : a ^ 2 ≤ 2 * D ∧ b ^ 2 ≤ 2 * D := by constructor <;> nlinarith [sq_nonneg (a - 2 * b), sq_nonneg (2 * a - b)] theorem finite_lattice_count (S : Finset (ℤ × ℤ)) (D R : ℕ) (hR : 2 * D < R ^ 2) (hS : ∀ x ∈ S, q x ≤ D) : S.card ≤ (2 * R + 1) ^ 2 := by let I : Finset ℤ := Finset.Icc (-(R : ℤ)) (R : ℤ) have hbox : S ⊆ I.product I := by intro x hx rcases x with ⟨a, b⟩ have hD : (0 : ℤ) ≤ D := by positivity obtain ⟨ha, hb⟩ := coordinate_squares a b D hD (hS (a, b) hx) have hR' : 2 * (D : ℤ) < (R : ℤ) ^ 2 := by exact_mod_cast hR have hRnonneg : (0 : ℤ) ≤ R := by positivity apply Finset.mem_product.mpr constructor <;> simp only [I, Finset.mem_Icc] <;> constructor <;> nlinarith [sq_nonneg (a - R), sq_nonneg (a + R), sq_nonneg (b - R), sq_nonneg (b + R)] have hI : I.card = 2 * R + 1 := by dsimp [I] rw [Int.card_Icc] have hcast : (R : ℤ) + 1 + (R : ℤ) = ((R + 1 + R : ℕ) : ℤ) := by push_cast ring rw [sub_neg_eq_add, hcast, Int.toNat_natCast] ring calc S.card ≤ (I.product I).card := Finset.card_le_card hbox _ = I.card * I.card := Finset.card_product _ _ _ = (2 * R + 1) ^ 2 := by rw [hI]; ring theorem finite_lattice_count_linear (S : Finset (ℤ × ℤ)) (D : ℕ) (hS : ∀ x ∈ S, q x ≤ D) : S.card ≤ 64 * (D + 1) := by have hR : 2 * D < (Nat.sqrt (2 * D) + 1) ^ 2 := by exact Nat.lt_succ_sqrt' _ have hcount := finite_lattice_count S D (Nat.sqrt (2 * D) + 1) hR hS have hsquare : (Nat.sqrt (2 * D)) ^ 2 ≤ 2 * D := Nat.sqrt_le' _ have hroot : Nat.sqrt (2 * D) ≤ 2 * D := Nat.sqrt_le_self _ nlinarith theorem actual_eisenstein_count (S : Finset ActualEisensteinCoordinates.O) (D : ℕ) (hS : ∀ x ∈ S, q (ActualEisensteinCoordinates.coords x) ≤ D) : S.card ≤ 64 * (D + 1) := by have hinj : Function.Injective ActualEisensteinCoordinates.coords := by intro x y hxy calc x = ActualEisensteinCoordinates.eval (ActualEisensteinCoordinates.coords x).1 (ActualEisensteinCoordinates.coords x).2 := (ActualEisensteinCoordinates.eval_coords x).symm _ = ActualEisensteinCoordinates.eval (ActualEisensteinCoordinates.coords y).1 (ActualEisensteinCoordinates.coords y).2 := by rw [hxy] _ = y := ActualEisensteinCoordinates.eval_coords y have himage : (S.image ActualEisensteinCoordinates.coords).card = S.card := Finset.card_image_of_injective S hinj have hbound : ∀ v ∈ S.image ActualEisensteinCoordinates.coords, q v ≤ D := by intro v hv obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp hv exact hS x hx calc S.card = (S.image ActualEisensteinCoordinates.coords).card := himage.symm _ ≤ 64 * (D + 1) := finite_lattice_count_linear _ D hbound end ShortDraftLatticeCount namespace ActualEisensteinCubic open ShortDraftCusp theorem A3_cubicChar_neg_one (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : cubicChar P hgood (-1 : O ⧸ P) = 1 := by let χ := cubicChar P hgood have hcube : χ (-1 : O ⧸ P) ^ 3 = 1 := by rw [← χ.pow_apply' (by decide), cubicChar_pow_three P hgood] exact MulChar.one_apply isUnit_neg_one have hminus : (-1 : O ⧸ P) ^ 3 = -1 := by ring calc χ (-1 : O ⧸ P) = χ ((-1 : O ⧸ P) ^ 3) := by rw [hminus] _ = χ (-1 : O ⧸ P) ^ 3 := by rw [map_pow] _ = 1 := hcube end ActualEisensteinCubic namespace ShortDraftCusp variable {R : Type*} [CommRing R] end ShortDraftCusp namespace ShortDraftLatticeCount open ActualEisensteinCoordinates theorem coords_eval (a b : ℤ) : coords (eval a b) = (a, b) := by have h := unique_coordinates (eval_coords (eval a b)) exact Prod.ext h.1 h.2 theorem qO_mul (x y : O) : q (coords (x * y)) = q (coords x) * q (coords y) := by have hxy : x * y = eval ((coords x).1 * (coords y).1 - (coords x).2 * (coords y).2) ((coords x).1 * (coords y).2 + (coords x).2 * (coords y).1 - (coords x).2 * (coords y).2) := by calc x * y = eval (coords x).1 (coords x).2 * eval (coords y).1 (coords y).2 := by rw [eval_coords, eval_coords] _ = _ := eval_mul _ _ _ _ rw [hxy, coords_eval] exact ShortDraft.eisenstein_norm_mul (coords x) (coords y) theorem qO_nonneg (x : O) : 0 ≤ q (coords x) := by exact ShortDraft.eisenstein_norm_nonneg (coords x) theorem qO_pos {x : O} (hx : x ≠ 0) : 0 < q (coords x) := by have hne : q (coords x) ≠ 0 := by intro hzero have hc : coords x = (0, 0) := (ShortDraft.eisenstein_norm_eq_zero_iff (coords x)).mp hzero apply hx calc x = eval (coords x).1 (coords x).2 := (eval_coords x).symm _ = 0 := by simp [hc, eval] exact lt_of_le_of_ne (qO_nonneg x) (Ne.symm hne) def qNat (x : O) : ℕ := (q (coords x)).toNat theorem qNat_mul (x y : O) : qNat (x * y) = qNat x * qNat y := by unfold qNat rw [qO_mul] exact Int.toNat_mul (qO_nonneg x) (qO_nonneg y) theorem qNat_pos {x : O} (hx : x ≠ 0) : 0 < qNat x := by unfold qNat have hcast := Int.toNat_of_nonneg (qO_nonneg x) have hpos := qO_pos hx omega theorem finite_multiples_count (p : O) (hp : p ≠ 0) (T : Finset O) (D : ℕ) (hT : ∀ x ∈ T, qNat (p * x) ≤ D) : T.card ≤ 64 * (D / qNat p + 1) := by have hbound : ∀ x ∈ T, q (coords x) ≤ (D / qNat p : ℕ) := by intro x hx have hmul := hT x hx rw [qNat_mul] at hmul have hdiv : qNat x ≤ D / qNat p := (Nat.le_div_iff_mul_le (qNat_pos hp)).mpr (by simpa [mul_comm] using hmul) have hnat : qNat x = (q (coords x)) := Int.toNat_of_nonneg (qO_nonneg x) have hdiv' : (qNat x : ℤ) ≤ (D / qNat p : ℕ) := by exact_mod_cast hdiv simpa only [hnat] using hdiv' exact actual_eisenstein_count T (D / qNat p) hbound end ShortDraftLatticeCount namespace AnalyticBridge end AnalyticBridge namespace ShortDraftLatticeCount open ActualEisensteinCoordinates theorem finite_divisible_count (p : O) (hp : p ≠ 0) (S : Finset O) (D : ℕ) (hdiv : ∀ n ∈ S, p ∣ n) (hnorm : ∀ n ∈ S, qNat n ≤ D) : S.card ≤ 64 * (D / qNat p + 1) := by classical let quotient : (x : {n : O // n ∈ S}) → O := fun x => Classical.choose (hdiv x.1 x.2) have hrep : ∀ x : {n : O // n ∈ S}, x.1 = p * quotient x := by intro x exact Classical.choose_spec (hdiv x.1 x.2) have hinj : Function.Injective quotient := by intro x y hxy apply Subtype.ext calc x.1 = p * quotient x := hrep x _ = p * quotient y := by rw [hxy] _ = y.1 := (hrep y).symm let T : Finset O := S.attach.image quotient have hcard : T.card = S.card := by simpa [T] using Finset.card_image_of_injective S.attach hinj have hT : ∀ m ∈ T, qNat (p * m) ≤ D := by intro m hm obtain ⟨x, _, rfl⟩ := Finset.mem_image.mp hm rw [← hrep x] exact hnorm x.1 x.2 calc S.card = T.card := hcard.symm _ ≤ 64 * (D / qNat p + 1) := finite_multiples_count p hp T D hT end ShortDraftLatticeCount namespace IdealGaussCRT open AddChar MulChar end IdealGaussCRT namespace ActualEisensteinCubic section open ShortDraftLatticeCount theorem prime_sixth_row_approx {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (columns : Finset O) (support : O → Finset ι) (weight : O → ℂ) (p : O) (hp : p ≠ 0) (D : ℕ) (hfactor : ∀ n ∈ columns, (∃ i ∈ support n, p ∈ P i) → p ∣ n) (hcolnorm : ∀ n ∈ columns, qNat n ≤ D) (hweight : ∀ n ∈ columns, ‖weight n‖ ≤ 1) : ‖(∑ n ∈ columns, weight n) - (∑ n ∈ columns, weight n * finiteSquarefreeRow P hgood (support n) (p ^ 6))‖ ≤ (64 * (D / qNat p + 1) : ℕ) := by classical let S := columns.filter (fun n => ∃ i ∈ support n, p ∈ P i) have hdiv : ∀ n ∈ S, p ∣ n := by intro n hn obtain ⟨hcol, hsupp⟩ := Finset.mem_filter.mp hn exact hfactor n hcol hsupp have hnorm : ∀ n ∈ S, qNat n ≤ D := by intro n hn exact hcolnorm n (Finset.mem_filter.mp hn).1 have hcount := finite_divisible_count p hp S D hdiv hnorm calc ‖(∑ n ∈ columns, weight n) - (∑ n ∈ columns, weight n * finiteSquarefreeRow P hgood (support n) (p ^ 6))‖ ≤ ∑ n ∈ S, ‖weight n‖ := finiteSquarefreeRow_difference_norm P hgood columns support weight p _ ≤ ∑ n ∈ S, (1 : ℝ) := by apply Finset.sum_le_sum intro n hn exact hweight n (Finset.mem_filter.mp hn).1 _ = (S.card : ℝ) := by simp _ ≤ (64 * (D / qNat p + 1) : ℕ) := by exact_mod_cast hcount end theorem prime_sixth_row_approx_maximal {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (columns : Finset O) (support : O → Finset ι) (weight : O → ℂ) (p : O) (hp : p ≠ 0) (hprime : (Ideal.span {p} : Ideal O).IsMaximal) (D : ℕ) (hsupport : ∀ n ∈ columns, ∀ i ∈ support n, n ∈ P i) (hcolnorm : ∀ n ∈ columns, ShortDraftLatticeCount.qNat n ≤ D) (hweight : ∀ n ∈ columns, ‖weight n‖ ≤ 1) : ‖(∑ n ∈ columns, weight n) - (∑ n ∈ columns, weight n * finiteSquarefreeRow P hgood (support n) (p ^ 6))‖ ≤ (64 * (D / ShortDraftLatticeCount.qNat p + 1) : ℕ) := by apply prime_sixth_row_approx P hgood columns support weight p hp D ?_ hcolnorm hweight intro n hn ⟨i, hi, hpi⟩ have hle : (Ideal.span {p} : Ideal O) ≤ P i := (Ideal.span_singleton_le_iff_mem (P i)).mpr hpi have hne : P i ≠ ⊤ := (inferInstance : (P i).IsMaximal).ne_top have heq : (Ideal.span {p} : Ideal O) = P i := hprime.eq_of_le hne hle have hnP : n ∈ Ideal.span {p} := by rw [heq] exact hsupport n hn i hi exact Ideal.mem_span_singleton.mp hnP open AddChar MulChar end ActualEisensteinCubic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.QuadraticTrace namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical namespace ActualEisensteinCubic section open ActualEisensteinCoordinates ShortDraftLatticeCount theorem omega_sq_for_norm : omega ^ 2 = -omega - 1 := by let : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ simpa [omega] using IsCyclotomicExtension.Rat.Three.eta_sq (IsCyclotomicExtension.zeta_spec 3 ℚ K) theorem conjO_eval_coordinates (a b : ℤ) : conjO (eval a b) = eval (a - b) (-b) := by have hω : ActualEisensteinCoordinates.omega = omega := rfl simp only [eval, map_add, map_mul, map_intCast, hω, conjO_omega] rw [omega_sq_for_norm] push_cast ring theorem coordinate_norm_eq_mul_conjO (p : O) : ((q (coords p) : ℤ) : O) = p * conjO p := by let a := (coords p).1 let b := (coords p).2 have hp : p = eval a b := (eval_coords p).symm symm calc p * conjO p = eval a b * eval (a - b) (-b) := by rw [hp, conjO_eval_coordinates] _ = ((q (coords p) : ℤ) : O) := by rw [eval_mul] simp only [eval, q] dsimp [a, b] push_cast ring theorem algebraNorm_eq_coordinate_norm (p : O) : Algebra.norm ℤ p = q (coords p) := by have h := (norm_int_eq_mul_conjO p).trans (coordinate_norm_eq_mul_conjO p).symm exact_mod_cast h theorem qNat_eq_absNorm_span (p : O) : qNat p = Ideal.absNorm (Ideal.span {p}) := by rw [Ideal.absNorm_span_singleton, algebraNorm_eq_coordinate_norm] unfold qNat apply Nat.cast_injective (R := ℤ) rw [Int.toNat_of_nonneg (qO_nonneg p), Int.natAbs_of_nonneg (qO_nonneg p)] end section theorem prime_sixth_row_approx_ideal_norm {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (columns : Finset O) (support : O → Finset ι) (weight : O → ℂ) (p : O) (hp : p ≠ 0) (hprime : (Ideal.span {p} : Ideal O).IsMaximal) (D : ℕ) (hsupport : ∀ n ∈ columns, ∀ i ∈ support n, n ∈ P i) (hcolnorm : ∀ n ∈ columns, Ideal.absNorm (Ideal.span {n}) ≤ D) (hweight : ∀ n ∈ columns, ‖weight n‖ ≤ 1) : ‖(∑ n ∈ columns, weight n) - (∑ n ∈ columns, weight n * finiteSquarefreeRow P hgood (support n) (p ^ 6))‖ ≤ (64 * (D / Ideal.absNorm (Ideal.span {p}) + 1) : ℕ) := by have hcol : ∀ n ∈ columns, ShortDraftLatticeCount.qNat n ≤ D := by intro n hn rw [qNat_eq_absNorm_span] exact hcolnorm n hn simpa only [qNat_eq_absNorm_span] using (prime_sixth_row_approx_maximal P hgood columns support weight p hp hprime D hsupport hcol hweight) theorem sixth_power_eq_implies_same_prime_ideal (p q : O) (hp : (Ideal.span {p} : Ideal O).IsMaximal) (hq : (Ideal.span {q} : Ideal O).IsMaximal) (h : p ^ 6 = q ^ 6) : (Ideal.span {p} : Ideal O) = Ideal.span {q} := by have hq6 : q ^ 6 ∈ Ideal.span {q} := Ideal.mem_span_singleton.mpr (dvd_pow_self q (by decide)) have hp6 : p ^ 6 ∈ Ideal.span {q} := by rw [h]; exact hq6 have hpmem : p ∈ Ideal.span {q} := hq.isPrime.mem_of_pow_mem 6 hp6 have hle : (Ideal.span {p} : Ideal O) ≤ Ideal.span {q} := (Ideal.span_singleton_le_iff_mem _).mpr hpmem exact hp.eq_of_le hq.ne_top hle theorem sixth_power_rows_injective {ι : Type*} (S : Finset ι) (P : ι → Ideal O) (p : ι → O) (hprime : ∀ i ∈ S, (P i).IsMaximal) (hgen : ∀ i ∈ S, P i = Ideal.span {p i}) (hinj : Set.InjOn P (S : Set ι)) : Set.InjOn (fun i => p i ^ 6) (S : Set ι) := by intro i hi j hj heq have hsame : Ideal.span {p i} = (Ideal.span {p j} : Ideal O) := sixth_power_eq_implies_same_prime_ideal (p i) (p j) (hgen i hi ▸ hprime i hi) (hgen j hj ▸ hprime j hj) heq apply hinj hi hj rw [hgen i hi, hgen j hj] exact hsame open EisensteinEmbedding ConcreteTraceCRT ConcreteBreveE theorem rational_modulus_card (m : ℕ) (_hm : m ≠ 0) : Nat.card (O ⧸ Ideal.span {(m : O)}) = m ^ 2 := by have hnorm : Algebra.norm ℤ (m : O) = (m : ℤ) ^ 2 := by have h := Algebra.norm_algebraMap_of_basis EisensteinEmbedding.pb.basis (m : ℤ) simpa [EisensteinEmbedding.pb_dim] using h calc Nat.card (O ⧸ Ideal.span {(m : O)}) = Ideal.absNorm (Ideal.span {(m : O)}) := by rw [Ideal.absNorm_apply, Submodule.cardQuot_apply] _ = (Algebra.norm ℤ (m : O)).natAbs := Ideal.absNorm_span_singleton (m : O) _ = m ^ 2 := by rw [hnorm]; simp private theorem mk_eval_congr_mod (m : ℕ) (a b c d : ℤ) (ha : (a : ZMod m) = c) (hb : (b : ZMod m) = d) : Ideal.Quotient.mk (Ideal.span {(m : O)}) (ActualEisensteinCoordinates.eval a b) = Ideal.Quotient.mk (Ideal.span {(m : O)}) (ActualEisensteinCoordinates.eval c d) := by apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr have hda : (m : ℤ) ∣ a - c := (ZMod.intCast_eq_intCast_iff_dvd_sub c a m).mp ha.symm have hdb : (m : ℤ) ∣ b - d := (ZMod.intCast_eq_intCast_iff_dvd_sub d b m).mp hb.symm obtain ⟨r, hr⟩ := hda obtain ⟨s, hs⟩ := hdb apply (Ideal.mem_span_singleton).mpr refine ⟨ActualEisensteinCoordinates.eval r s, ?_⟩ dsimp [ActualEisensteinCoordinates.eval] rw [show a = c + m*r by omega, show b = d + m*s by omega] push_cast ring noncomputable def rationalCoordMap (m : ℕ) : ZMod m × ZMod m → (O ⧸ Ideal.span {(m : O)}) := fun ab => Ideal.Quotient.mk (Ideal.span {(m : O)}) (ActualEisensteinCoordinates.eval (ZMod.cast ab.1) (ZMod.cast ab.2)) theorem rationalCoordMap_surjective (m : ℕ) : Function.Surjective (rationalCoordMap m) := by intro x obtain ⟨z, rfl⟩ := Ideal.Quotient.mk_surjective x obtain ⟨a, b, hab⟩ := ActualEisensteinCoordinates.exists_coordinates z refine ⟨((a : ZMod m), (b : ZMod m)), ?_⟩ change Ideal.Quotient.mk (Ideal.span {(m : O)}) (ActualEisensteinCoordinates.eval (ZMod.cast (a : ZMod m)) (ZMod.cast (b : ZMod m))) = _ rw [hab] apply mk_eval_congr_mod · exact ZMod.intCast_zmod_cast _ · exact ZMod.intCast_zmod_cast _ noncomputable def rationalCoordEquiv (m : ℕ) (hm : m ≠ 0) : ZMod m × ZMod m ≃ (O ⧸ Ideal.span {(m : O)}) := by letI : NeZero m := ⟨hm⟩ letI : Finite (O ⧸ Ideal.span {(m : O)}) := finite_quotient_span (by exact_mod_cast hm) letI : Fintype (O ⧸ Ideal.span {(m : O)}) := Fintype.ofFinite _ refine Equiv.ofBijective (rationalCoordMap m) ?_ apply (Fintype.bijective_iff_surjective_and_card _).mpr constructor · exact rationalCoordMap_surjective m · have hq : Fintype.card (O ⧸ Ideal.span {(m : O)}) = m ^ 2 := by simpa only [Nat.card_eq_fintype_card] using rational_modulus_card m hm simp [hq, Fintype.card_prod, sq] theorem eisEmbedding_eval (a b : ℤ) : eisEmbedding (ActualEisensteinCoordinates.eval a b) = (a : ℂ) + (b : ℂ) * omega3 := by have hgen : ActualEisensteinCoordinates.omega = EisensteinEmbedding.pb.gen := by rw [← ActualEisensteinCoordinates.pb_gen] rfl rw [ActualEisensteinCoordinates.eval, hgen] change EisensteinEmbedding.embedding omega3 omega3_sq (a + b * EisensteinEmbedding.pb.gen : O) = _ exact EisensteinEmbedding.embedding_apply_ab omega3 omega3_sq a b theorem rationalCoordEquiv_apply (m : ℕ) (hm : m ≠ 0) (a b : ZMod m) : rationalCoordEquiv m hm (a,b) = Ideal.Quotient.mk (Ideal.span {(m : O)}) (ActualEisensteinCoordinates.eval (ZMod.cast a) (ZMod.cast b)) := rfl end section theorem cubic_roots_reduce_injective (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) {x y : O} (hx : x ^ 3 = 1) (hy : y ^ 3 = 1) (hxy : Ideal.Quotient.mk P x = Ideal.Quotient.mk P y) : x = y := by obtain ⟨i, hi, rfl⟩ := omega_primitive.eq_pow_of_pow_eq_one hx obtain ⟨j, hj, rfl⟩ := omega_primitive.eq_pow_of_pow_eq_one hy have hij : i = j := by apply (omega_reduced_primitive P hgood).pow_inj hi hj simpa only [map_pow] using hxy rw [hij] theorem cubicChar_omega (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) : cubicChar P hgood (Ideal.Quotient.mk P omega) = omega ^ ((Nat.card (O ⧸ P) - 1) / 3) := by let χ := cubicChar P hgood have hx : (χ (Ideal.Quotient.mk P omega)) ^ 3 = 1 := by rw [← χ.pow_apply' (by decide), cubicChar_pow_three P hgood] exact MulChar.one_apply ((omega_reduced_primitive P hgood).isUnit (by decide)) have hy : (omega ^ ((Nat.card (O ⧸ P) - 1) / 3)) ^ 3 = 1 := by rw [← pow_mul, Nat.mul_comm, pow_mul, omega_primitive.pow_eq_one, one_pow] apply cubic_roots_reduce_injective P hgood hx hy rw [map_pow] exact cubicChar_reduce P hgood (Ideal.Quotient.mk P omega) theorem finiteSquarefreeRow_one {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (S : Finset ι) : finiteSquarefreeRow P hgood S 1 = 1 := by classical unfold finiteSquarefreeRow apply Finset.prod_eq_one intro i hi simp open EisensteinEmbedding ConcreteTraceCRT Complex theorem breveE_int_trace_div (q u v : ℤ) (_hq : q ≠ 0) : ShortDraftTrace.breveE ((((u : ℂ) + (v : ℂ) * omega3) / eisLam) / q) = Complex.exp (2 * Real.pi * Complex.I * (v : ℂ) / q) := by have htrace := ShortDraftTrace.trace_div_lam omega3 omega3_sq ShortDraftTrace.omega_conj u v have hL : ((u : ℂ) + (v : ℂ) * omega3) / eisLam + star (((u : ℂ) + (v : ℂ) * omega3) / eisLam) = (v : ℂ) := by simpa only [eisLam, Complex.star_def] using htrace change Complex.exp (2 * Real.pi * Complex.I * (((((u : ℂ) + (v : ℂ) * omega3) / eisLam) / q) + star (((((u : ℂ) + (v : ℂ) * omega3) / eisLam) / q)))) = _ rw [show star (((u : ℂ) + (v : ℂ) * omega3) / eisLam / q) = star (((u : ℂ) + (v : ℂ) * omega3) / eisLam) / q by simp] rw [← add_div, hL] congr 1 ring theorem breveE_quadratic_coordinate (a b x y : ℤ) (hq : a*a - a*b + b*b ≠ 0) : let c : ℂ := (a : ℂ) + (b : ℂ) * omega3 let z : ℂ := (x : ℂ) + (y : ℂ) * omega3 ShortDraftTrace.breveE (z ^ 2 / (c * eisLam)) = Complex.exp (2 * Real.pi * Complex.I * ((-b*x*x + 2*a*x*y + (b-a)*y*y : ℤ) : ℂ) / ((a*a-a*b+b*b : ℤ) : ℂ)) := by let c : ℂ := (a : ℂ) + (b : ℂ) * omega3 let z : ℂ := (x : ℂ) + (y : ℂ) * omega3 let cb : ℂ := ((a-b : ℤ) : ℂ) - (b : ℂ) * omega3 let q : ℤ := a*a-a*b+b*b let U : ℤ := (x*x-y*y)*(a-b)+b*(2*x*y-y*y) let V : ℤ := -b*x*x+2*a*x*y+(b-a)*y*y have hnorm : c * cb = (q : ℂ) := by dsimp [c, cb, q] push_cast linear_combination -(b : ℂ)^2 * omega3_sq have hnum : z ^ 2 * cb = (U : ℂ) + (V : ℂ) * omega3 := by dsimp [z, cb, U, V] push_cast linear_combination ((y : ℂ)^2 * ((a : ℂ)-(b : ℂ)-(b : ℂ)*omega3) - (b : ℂ) * (2*(x : ℂ)*(y : ℂ)-(y : ℂ)^2)) * omega3_sq have hqC : (q : ℂ) ≠ 0 := by dsimp [q] exact_mod_cast hq have hc : c ≠ 0 := by intro hc apply hqC rw [← hnorm, hc, zero_mul] have hcb : cb ≠ 0 := by intro hcb apply hqC rw [← hnorm, hcb, mul_zero] have hdiv : z ^ 2 / (c * eisLam) = ((z ^ 2 * cb) / eisLam) / q := by rw [← hnorm] field_simp [hc, hcb, eisLam_ne_zero] change ShortDraftTrace.breveE (z ^ 2 / (c * eisLam)) = _ rw [hdiv, hnum, breveE_int_trace_div q U V (by simpa [q] using hq)] end end ActualEisensteinCubic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.QuadraticNormalization namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT ConcreteBreveE noncomputable def quadraticGammaO (c : O) (hc : c ≠ 0) : ℂ := by letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let ψ := eisTraceModChar ShortDraftTrace.breveE breveE_period_coordinates c hc exact (∑ x : O ⧸ Ideal.span {c}, ψ (x ^ 2)) / (‖eisEmbedding c‖ : ℂ) end ActualEisensteinCubic namespace PowerExtraction theorem from_mean_square_and_prime_rows_with_constant (D ε J A C : ℝ) (hD : 1 ≤ D) (hε : 0 ≤ ε) (hA : 0 ≤ A) (hC : 1 ≤ C) (hJ : D ^ ((11 / 60 : ℝ) - ε) ≤ J) (hmean : J * A ^ 2 ≤ 2 * D ^ ((21 / 10 : ℝ) + ε) + 2 * J * C ^ 2 * D ^ (49 / 30 : ℝ)) : A ≤ 2 * C * D ^ ((23 / 24 : ℝ) + ε) := by let E : ℝ := (23 / 24 : ℝ) + ε have hDpos : 0 < D := lt_of_lt_of_le zero_lt_one hD have hJpos : 0 < J := lt_of_lt_of_le (Real.rpow_pos_of_pos hDpos _) hJ have hpow : D ^ ((21 / 10 : ℝ) + ε) ≤ J * D ^ ((23 / 12 : ℝ) + 2 * ε) := by calc D ^ ((21 / 10 : ℝ) + ε) = D ^ ((11 / 60 : ℝ) - ε) * D ^ ((23 / 12 : ℝ) + 2 * ε) := by rw [← Real.rpow_add hDpos] congr 1 ring _ ≤ J * D ^ ((23 / 12 : ℝ) + 2 * ε) := mul_le_mul_of_nonneg_right hJ (by positivity) have herr : D ^ (49 / 30 : ℝ) ≤ D ^ ((23 / 12 : ℝ) + 2 * ε) := by apply Real.rpow_le_rpow_of_exponent_le hD linarith have hC2 : 1 ≤ C ^ 2 := by nlinarith have hP : 0 ≤ J * D ^ ((23 / 12 : ℝ) + 2 * ε) := by positivity have hsq : A ^ 2 ≤ 4 * C ^ 2 * D ^ ((23 / 12 : ℝ) + 2 * ε) := by have hmain : J * A ^ 2 ≤ 4 * J * C ^ 2 * D ^ ((23 / 12 : ℝ) + 2 * ε) := by calc J * A ^ 2 ≤ 2 * D ^ ((21 / 10 : ℝ) + ε) + 2 * J * C ^ 2 * D ^ (49 / 30 : ℝ) := hmean _ ≤ 2 * (J * D ^ ((23 / 12 : ℝ) + 2 * ε)) + 2 * J * C ^ 2 * D ^ ((23 / 12 : ℝ) + 2 * ε) := by gcongr _ ≤ 4 * J * C ^ 2 * D ^ ((23 / 12 : ℝ) + 2 * ε) := by nlinarith [mul_nonneg (sub_nonneg.mpr hC2) hP] nlinarith have hexp : (23 / 12 : ℝ) + 2 * ε = E * 2 := by dsimp [E] ring have hpow2 : (D ^ E) ^ 2 = D ^ ((23 / 12 : ℝ) + 2 * ε) := by calc (D ^ E) ^ 2 = D ^ (E * 2) := (Real.rpow_mul_natCast hDpos.le E 2).symm _ = D ^ ((23 / 12 : ℝ) + 2 * ε) := by rw [hexp] have htwo : 0 ≤ 2 * C * D ^ E := by positivity apply (sq_le_sq₀ hA htwo).mp rw [mul_pow, mul_pow, hpow2] nlinarith theorem from_finite_sixth_power_rows_with_constant {α β : Type*} [DecidableEq α] [DecidableEq β] (rows : Finset α) (primes : Finset β) (row : β → α) (A : α → ℂ) (untwisted : α) (D ε C : ℝ) (hD : 1 ≤ D) (hε : 0 ≤ ε) (hC : 1 ≤ C) (hrows : primes.image row ⊆ rows) (hinj : Set.InjOn row (primes : Set β)) (happrox : ∀ p ∈ primes, ‖A untwisted - A (row p)‖ ≤ C * D ^ (49 / 60 : ℝ)) (hcount : D ^ ((11 / 60 : ℝ) - ε) ≤ (primes.card : ℝ)) (hmean : (∑ u ∈ rows, ‖A u‖ ^ 2) ≤ D ^ ((21 / 10 : ℝ) + ε)) : ‖A untwisted‖ ≤ 2 * C * D ^ ((23 / 24 : ℝ) + ε) := by have hDpos : 0 < D := lt_of_lt_of_le zero_lt_one hD have hextract := ShortDraft.complex_row_extraction rows primes row A untwisted (C * D ^ (49 / 60 : ℝ)) (D ^ ((21 / 10 : ℝ) + ε)) (by positivity) hrows hinj happrox hmean have herror : (C * D ^ (49 / 60 : ℝ)) ^ 2 = C ^ 2 * D ^ (49 / 30 : ℝ) := by rw [mul_pow] congr 1 calc (D ^ (49 / 60 : ℝ)) ^ 2 = D ^ ((49 / 60 : ℝ) * 2) := (Real.rpow_mul_natCast hDpos.le _ 2).symm _ = D ^ (49 / 30 : ℝ) := by congr 1; norm_num rw [herror] at hextract exact from_mean_square_and_prime_rows_with_constant D ε (primes.card : ℝ) ‖A untwisted‖ C hD hε (norm_nonneg _) hC hcount (by simpa only [mul_assoc] using hextract) end PowerExtraction namespace ActualEisensteinCubic theorem finite_actual_prime_extraction_with_constant {ι β : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (columns : Finset O) (support : O → Finset ι) (weight : O → ℂ) (selected : Finset β) (p : β → O) (rows : Finset O) (D : ℕ) (ε C : ℝ) (hD : 1 ≤ D) (hε : 0 ≤ ε) (hC : 1 ≤ C) (hp : ∀ i ∈ selected, p i ≠ 0) (hprime : ∀ i ∈ selected, (Ideal.span {p i} : Ideal O).IsMaximal) (hinj : Set.InjOn (fun i => (Ideal.span {p i} : Ideal O)) (selected : Set β)) (hrows : selected.image (fun i => p i ^ 6) ⊆ rows) (hsupport : ∀ n ∈ columns, ∀ i ∈ support n, n ∈ P i) (hcolnorm : ∀ n ∈ columns, Ideal.absNorm (Ideal.span {n}) ≤ D) (hweight : ∀ n ∈ columns, ‖weight n‖ ≤ 1) (hrowbound : ∀ i ∈ selected, ((64 * (D / Ideal.absNorm (Ideal.span {p i}) + 1) : ℕ) : ℝ) ≤ C * (D : ℝ) ^ (49 / 60 : ℝ)) (hcount : (D : ℝ) ^ ((11 / 60 : ℝ) - ε) ≤ (selected.card : ℝ)) (hmean : (∑ u ∈ rows, ‖∑ n ∈ columns, weight n * finiteSquarefreeRow P hgood (support n) u‖ ^ 2) ≤ (D : ℝ) ^ ((21 / 10 : ℝ) + ε)) : ‖∑ n ∈ columns, weight n‖ ≤ 2 * C * (D : ℝ) ^ ((23 / 24 : ℝ) + ε) := by classical let A : O → ℂ := fun u => ∑ n ∈ columns, weight n * finiteSquarefreeRow P hgood (support n) u have hone : A 1 = ∑ n ∈ columns, weight n := by dsimp [A] apply Finset.sum_congr rfl intro n hn rw [finiteSquarefreeRow_one] ring have hinjRows : Set.InjOn (fun i => p i ^ 6) (selected : Set β) := by apply sixth_power_rows_injective selected (fun i => (Ideal.span {p i} : Ideal O)) p · exact hprime · intro i hi; rfl · exact hinj have happrox : ∀ i ∈ selected, ‖A 1 - A (p i ^ 6)‖ ≤ C * (D : ℝ) ^ (49 / 60 : ℝ) := by intro i hi rw [hone] change ‖(∑ n ∈ columns, weight n) - (∑ n ∈ columns, weight n * finiteSquarefreeRow P hgood (support n) (p i ^ 6))‖ ≤ _ exact (prime_sixth_row_approx_ideal_norm P hgood columns support weight (p i) (hp i hi) (hprime i hi) D hsupport hcolnorm hweight).trans (hrowbound i hi) have hmean' : (∑ u ∈ rows, ‖A u‖ ^ 2) ≤ (D : ℝ) ^ ((21 / 10 : ℝ) + ε) := hmean have hbound := PowerExtraction.from_finite_sixth_power_rows_with_constant rows selected (fun i => p i ^ 6) A 1 (D : ℝ) ε C (by exact_mod_cast hD) hε hC hrows hinjRows happrox hcount hmean' simpa only [hone] using hbound end ActualEisensteinCubic namespace PowerExtraction theorem dyadic_prime_error_bound (D N : ℕ) (hD : 1 ≤ D) (hN : (D : ℝ) ^ (11 / 60 : ℝ) / 2 ≤ (N : ℝ)) : ((64 * (D / N + 1) : ℕ) : ℝ) ≤ 192 * (D : ℝ) ^ (49 / 60 : ℝ) := by have hDreal : (1 : ℝ) ≤ D := by exact_mod_cast hD have hDpos : (0 : ℝ) < D := lt_of_lt_of_le zero_lt_one hDreal have hYpos : 0 < (D : ℝ) ^ (11 / 60 : ℝ) := Real.rpow_pos_of_pos hDpos _ have hNpos : (0 : ℝ) < N := by linarith have hpow : (D : ℝ) ^ (49 / 60 : ℝ) * (D : ℝ) ^ (11 / 60 : ℝ) = D := by rw [← Real.rpow_add hDpos] norm_num have hfrac : (D : ℝ) / N ≤ 2 * (D : ℝ) ^ (49 / 60 : ℝ) := by apply (div_le_iff₀ hNpos).mpr calc (D : ℝ) = (D : ℝ) ^ (49 / 60 : ℝ) * (D : ℝ) ^ (11 / 60 : ℝ) := hpow.symm _ = (2 * (D : ℝ) ^ (49 / 60 : ℝ)) * ((D : ℝ) ^ (11 / 60 : ℝ) / 2) := by ring _ ≤ (2 * (D : ℝ) ^ (49 / 60 : ℝ)) * N := mul_le_mul_of_nonneg_left hN (by positivity) have hcast : ((D / N : ℕ) : ℝ) ≤ (D : ℝ) / N := Nat.cast_div_le have hone : (1 : ℝ) ≤ (D : ℝ) ^ (49 / 60 : ℝ) := Real.one_le_rpow hDreal (by norm_num) have hnatcast : ((64 * (D / N + 1) : ℕ) : ℝ) = 64 * (((D / N : ℕ) : ℝ) + 1) := by push_cast; ring rw [hnatcast] nlinarith end PowerExtraction namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT Complex theorem eisenstein_coord_norm_zero (a b : ℤ) (h : a*a-a*b+b*b = 0) : a = 0 ∧ b = 0 := by have hs : (a-b)^2 + a^2 + b^2 = 0 := by nlinarith [h] have ha : a^2 = 0 := by nlinarith [sq_nonneg (a-b), sq_nonneg b] have hb : b^2 = 0 := by nlinarith [sq_nonneg (a-b), sq_nonneg a] constructor <;> nlinarith theorem quadraticTraceModChar_coordinate (a b x y : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) : let c : O := ActualEisensteinCoordinates.eval a b let z : O := ActualEisensteinCoordinates.eval x y (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) = Complex.exp (2 * Real.pi * Complex.I * ((-b*x*x + 2*a*x*y + (b-a)*y*y : ℤ) : ℂ) / ((a*a-a*b+b*b : ℤ) : ℂ)) := by have hq : a*a-a*b+b*b ≠ 0 := by intro h obtain ⟨ha,hb⟩ := eisenstein_coord_norm_zero a b h subst a subst b exact hc (by simp [ActualEisensteinCoordinates.eval]) change ShortDraftTrace.breveE (eisEmbedding (ActualEisensteinCoordinates.eval x y ^ 2) / (eisEmbedding (ActualEisensteinCoordinates.eval a b) * eisLam)) = _ rw [map_pow, eisEmbedding_eval, eisEmbedding_eval] exact breveE_quadratic_coordinate a b x y hq end ActualEisensteinCubic namespace GaussianAbelPartition theorem tsum_by_finite_fibers {A B : Type*} [Fintype B] (q : A → B) (f : A → ℂ) (hf : Summable f) : (∑' a : A, f a) = ∑ b : B, ∑' a : (q ⁻¹' {b}), f a.1 := by have h := (hf.hasSum.tsum_fiberwise q).tsum_eq simpa only [tsum_fintype] using h.symm theorem tsum_periodic_weighted_partition {A B : Type*} [Fintype B] (q : A → B) (P : B → ℂ) (W : A → ℂ) (hf : Summable (fun a => P (q a) * W a)) : (∑' a : A, P (q a) * W a) = ∑ b : B, P b * ∑' a : (q ⁻¹' {b}), W a.1 := by rw [tsum_by_finite_fibers q _ hf] apply Finset.sum_congr rfl intro b hb calc (∑' a : (q ⁻¹' {b}), P (q a.1) * W a.1) = ∑' a : (q ⁻¹' {b}), P b * W a.1 := by apply tsum_congr intro a have ha : q a.1 = b := by simpa only [Set.mem_preimage, Set.mem_singleton_iff] using a.property rw [ha] _ = P b * ∑' a : (q ⁻¹' {b}), W a.1 := tsum_mul_left open ConcreteTraceCRT ConcreteBreveE ActualEisensteinCubic theorem actual_quadratic_gaussian_partition (c : O) (hc : c ≠ 0) (W : O → ℂ) (hsum : Summable (fun z : O => (eisTraceModChar ShortDraftTrace.breveE breveE_period_coordinates c hc) ((Ideal.Quotient.mk (Ideal.span {c}) z) ^ 2) * W z)) : letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ (∑' z : O, (eisTraceModChar ShortDraftTrace.breveE breveE_period_coordinates c hc) ((Ideal.Quotient.mk (Ideal.span {c}) z) ^ 2) * W z) = ∑ r : O ⧸ Ideal.span {c}, (eisTraceModChar ShortDraftTrace.breveE breveE_period_coordinates c hc) (r ^ 2) * ∑' z : ((Ideal.Quotient.mk (Ideal.span {c})) ⁻¹' {r}), W z.1 := by let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ exact tsum_periodic_weighted_partition (Ideal.Quotient.mk (Ideal.span {c})) (fun r => (eisTraceModChar ShortDraftTrace.breveE breveE_period_coordinates c hc) (r ^ 2)) W hsum end GaussianAbelPartition namespace ActualEisensteinCubic theorem finite_actual_prime_extraction_dyadic {ι β : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (columns : Finset O) (support : O → Finset ι) (weight : O → ℂ) (selected : Finset β) (p : β → O) (rows : Finset O) (D : ℕ) (ε : ℝ) (hD : 1 ≤ D) (hε : 0 ≤ ε) (hp : ∀ i ∈ selected, p i ≠ 0) (hprime : ∀ i ∈ selected, (Ideal.span {p i} : Ideal O).IsMaximal) (hinj : Set.InjOn (fun i => (Ideal.span {p i} : Ideal O)) (selected : Set β)) (hrows : selected.image (fun i => p i ^ 6) ⊆ rows) (hsupport : ∀ n ∈ columns, ∀ i ∈ support n, n ∈ P i) (hcolnorm : ∀ n ∈ columns, Ideal.absNorm (Ideal.span {n}) ≤ D) (hweight : ∀ n ∈ columns, ‖weight n‖ ≤ 1) (hnormlower : ∀ i ∈ selected, (D : ℝ) ^ (11 / 60 : ℝ) / 2 ≤ (Ideal.absNorm (Ideal.span {p i}) : ℝ)) (hcount : (D : ℝ) ^ ((11 / 60 : ℝ) - ε) ≤ (selected.card : ℝ)) (hmean : (∑ u ∈ rows, ‖∑ n ∈ columns, weight n * finiteSquarefreeRow P hgood (support n) u‖ ^ 2) ≤ (D : ℝ) ^ ((21 / 10 : ℝ) + ε)) : ‖∑ n ∈ columns, weight n‖ ≤ 384 * (D : ℝ) ^ ((23 / 24 : ℝ) + ε) := by have hbound := finite_actual_prime_extraction_with_constant P hgood columns support weight selected p rows D ε 192 hD hε (by norm_num) hp hprime hinj hrows hsupport hcolnorm hweight (by intro i hi exact PowerExtraction.dyadic_prime_error_bound D (Ideal.absNorm (Ideal.span {p i})) hD (hnormlower i hi)) hcount hmean simpa only [show (2 : ℝ) * 192 = 384 by norm_num] using hbound end ActualEisensteinCubic namespace GaussianFiberEquiv open ActualEisensteinCubic def fiberMap (c : O) (r : O ⧸ Ideal.span {c}) (r0 : O) (hr : Ideal.Quotient.mk (Ideal.span {c}) r0 = r) (w : O) : ((Ideal.Quotient.mk (Ideal.span {c})) ⁻¹' {r}) := by refine ⟨r0 + c*w, ?_⟩ change Ideal.Quotient.mk (Ideal.span {c}) (r0 + c*w) = r rw [map_add, map_mul] have hc0 : Ideal.Quotient.mk (Ideal.span {c}) c = 0 := (Ideal.Quotient.eq_zero_iff_mem).mpr (Ideal.subset_span (Set.mem_singleton c)) rw [hc0, zero_mul, add_zero, hr] private theorem fiberMap_injective (c : O) (hc : c ≠ 0) (r : O ⧸ Ideal.span {c}) (r0 : O) (hr : Ideal.Quotient.mk (Ideal.span {c}) r0 = r) : Function.Injective (fiberMap c r r0 hr) := by intro u v h have hval := congrArg Subtype.val h change r0 + c*u = r0 + c*v at hval exact mul_left_cancel₀ hc (add_left_cancel hval) private theorem fiberMap_surjective (c : O) (r : O ⧸ Ideal.span {c}) (r0 : O) (hr : Ideal.Quotient.mk (Ideal.span {c}) r0 = r) : Function.Surjective (fiberMap c r r0 hr) := by rintro ⟨z, hz⟩ have hz' : Ideal.Quotient.mk (Ideal.span {c}) z = r := by simpa only [Set.mem_preimage, Set.mem_singleton_iff] using hz have hdiff : z-r0 ∈ Ideal.span {c} := (Ideal.Quotient.mk_eq_mk_iff_sub_mem z r0).mp (hz'.trans hr.symm) obtain ⟨w, hw⟩ := (Ideal.mem_span_singleton).mp hdiff refine ⟨w, ?_⟩ apply Subtype.ext change r0 + c*w = z rw [← hw] ring noncomputable def fiberEquiv (c : O) (hc : c ≠ 0) (r : O ⧸ Ideal.span {c}) (r0 : O) (hr : Ideal.Quotient.mk (Ideal.span {c}) r0 = r) : O ≃ ((Ideal.Quotient.mk (Ideal.span {c})) ⁻¹' {r}) := Equiv.ofBijective (fiberMap c r r0 hr) ⟨fiberMap_injective c hc r r0 hr, fiberMap_surjective c r r0 hr⟩ theorem fiber_tsum (c : O) (hc : c ≠ 0) (r : O ⧸ Ideal.span {c}) (r0 : O) (hr : Ideal.Quotient.mk (Ideal.span {c}) r0 = r) (W : O → ℂ) : (∑' z : ((Ideal.Quotient.mk (Ideal.span {c})) ⁻¹' {r}), W z.1) = ∑' w : O, W (r0 + c*w) := by have h := (fiberEquiv c hc r r0 hr).tsum_eq (fun z => W z.1) have happ (w : O) : ((fiberEquiv c hc r r0 hr) w).1 = r0 + c*w := rfl simpa only [happ] using h.symm end GaussianFiberEquiv namespace RankTwoPoisson open Real private theorem gauss_int_summable {a : ℂ} (ha : 0 < a.re) : Summable (fun n : ℤ => Complex.exp (-((Real.pi : ℂ) * a) * (n : ℂ) ^ 2)) := by have hpa : 0 < ((Real.pi : ℂ) * a).re := by simpa using mul_pos Real.pi_pos ha exact summable_of_isBigO (Real.summable_abs_int_rpow (show (1 : ℝ) < 2 by norm_num)) ((isLittleO_exp_neg_mul_sq_cocompact hpa (-2)).isBigO.comp_tendsto Int.tendsto_coe_cofinite) noncomputable def cg (a : ℂ) (n : ℤ) : ℂ := Complex.exp (-((Real.pi : ℂ) * a) * (n : ℂ) ^ 2) private theorem cg_summable {a : ℂ} (ha : 0 < a.re) : Summable (cg a) := gauss_int_summable ha theorem real_gauss_summable {t : ℝ} (ht : 0 < t) : Summable (fun n : ℤ => Real.exp (-Real.pi * t * (n : ℝ) ^ 2)) := by have htc : 0 < (t : ℂ).re := by simpa using ht have h := (cg_summable htc).norm simpa [cg, Complex.norm_exp, ← Complex.ofReal_intCast, ← Complex.ofReal_pow, mul_assoc] using h noncomputable def eisQ (z : ℤ × ℤ) : ℝ := (z.1 : ℝ) ^ 2 - (z.1 : ℝ) * (z.2 : ℝ) + (z.2 : ℝ) ^ 2 noncomputable def eisGauss (t : ℝ) (z : ℤ × ℤ) : ℂ := Complex.exp ((-Real.pi * t * eisQ z : ℝ) : ℂ) theorem eisQ_lower (z : ℤ × ℤ) : ((z.1 : ℝ) ^ 2 + (z.2 : ℝ) ^ 2) / 2 ≤ eisQ z := by dsimp [eisQ] nlinarith [sq_nonneg ((z.1 : ℝ) - (z.2 : ℝ))] theorem eis_gauss_summable {t : ℝ} (ht : 0 < t) : Summable (eisGauss t) := by have ht2 : 0 < t / 2 := by positivity have h1 := real_gauss_summable ht2 have hmaj : Summable (fun z : ℤ × ℤ => Real.exp (-Real.pi * (t / 2) * (z.1 : ℝ) ^ 2) * Real.exp (-Real.pi * (t / 2) * (z.2 : ℝ) ^ 2)) := h1.mul_of_nonneg h1 (fun _ => (Real.exp_pos _).le) (fun _ => (Real.exp_pos _).le) refine hmaj.of_norm_bounded ?_ intro z have hq := eisQ_lower z have hpi : 0 ≤ Real.pi * t := (mul_pos Real.pi_pos ht).le have hmul := mul_le_mul_of_nonneg_left hq hpi have hexp : -Real.pi * t * eisQ z ≤ -Real.pi * (t / 2) * (z.1 : ℝ) ^ 2 + -Real.pi * (t / 2) * (z.2 : ℝ) ^ 2 := by nlinarith [hmul] simpa [eisGauss, Complex.norm_exp, Real.exp_add] using (Real.exp_le_exp.mpr hexp) private noncomputable def phase (k n : ℤ) : ℂ := Complex.exp (((-Real.pi * (k : ℝ) * (n : ℝ) : ℝ) : ℂ) * Complex.I) private noncomputable def g1 (t : ℝ) (z : ℤ × ℤ) : ℂ := cg ((t⁻¹ : ℝ) : ℂ) z.1 * cg (((3 * t) / 4 : ℝ) : ℂ) z.2 * phase z.1 z.2 private theorem phase_norm (k n : ℤ) : ‖phase k n‖ = 1 := by simp [phase, Complex.norm_exp, Complex.mul_re] private theorem eisGauss_split (t : ℝ) (m n : ℤ) : eisGauss t (m, n) = Complex.exp ((-Real.pi * t * (n : ℝ) ^ 2 : ℝ) : ℂ) * Complex.exp (-(Real.pi : ℂ) * (t : ℂ) * (m : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * (((t : ℂ) * (n : ℂ)) / 2) * (m : ℂ)) := by dsimp [eisGauss, eisQ] rw [← Complex.exp_add] congr 1 push_cast ring private theorem eis_exponent_identity {t : ℝ} (ht : 0 < t) (k n : ℤ) : (-(Real.pi : ℂ) * (t : ℂ) * (n : ℂ) ^ 2) + (-(Real.pi : ℂ) / (t : ℂ) * ((k : ℂ) + Complex.I * ((t : ℂ) * (n : ℂ) / 2)) ^ 2) = (-(Real.pi : ℂ) * (((t⁻¹ : ℝ) : ℂ)) * (k : ℂ) ^ 2) + (-(Real.pi : ℂ) * ((((3 * t) / 4 : ℝ) : ℂ)) * (n : ℂ) ^ 2) + (((-Real.pi * (k : ℝ) * (n : ℝ) : ℝ) : ℂ) * Complex.I) := by have ht0 : (t : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt ht push_cast field_simp [ht0] ring_nf simp [Complex.I_sq] ring private theorem first_transform_term {t : ℝ} (ht : 0 < t) (k n : ℤ) : Complex.exp ((-Real.pi * t * (n : ℝ) ^ 2 : ℝ) : ℂ) * Complex.exp (-(Real.pi : ℂ) / (t : ℂ) * ((k : ℂ) + Complex.I * (((t : ℂ) * (n : ℂ)) / 2)) ^ 2) = g1 t (k, n) := by have hn : ((-Real.pi * t * (n : ℝ) ^ 2 : ℝ) : ℂ) = -(Real.pi : ℂ) * (t : ℂ) * (n : ℂ) ^ 2 := by push_cast ring rw [hn, ← Complex.exp_add, eis_exponent_identity ht k n] simp only [Complex.exp_add] dsimp [g1, cg, phase] push_cast ring_nf private theorem first_poisson_slice {t : ℝ} (ht : 0 < t) (n : ℤ) : (∑' m : ℤ, eisGauss t (m, n)) = (1 / (t : ℂ) ^ (1 / 2 : ℂ)) * ∑' k : ℤ, g1 t (k, n) := by have htc : 0 < (t : ℂ).re := by simpa using ht let C : ℂ := Complex.exp ((-Real.pi * t * (n : ℝ) ^ 2 : ℝ) : ℂ) let B : ℂ := ((t : ℂ) * (n : ℂ)) / 2 let F : ℤ → ℂ := fun m => Complex.exp (-(Real.pi : ℂ) * (t : ℂ) * (m : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * B * (m : ℂ)) let H : ℤ → ℂ := fun k => Complex.exp (-(Real.pi : ℂ) / (t : ℂ) * ((k : ℂ) + Complex.I * B) ^ 2) have hsplit : (∑' m : ℤ, eisGauss t (m, n)) = C * ∑' m : ℤ, F m := by rw [← tsum_mul_left] apply tsum_congr intro m exact eisGauss_split t m n have hpoisson : (∑' m : ℤ, F m) = (1 / (t : ℂ) ^ (1 / 2 : ℂ)) * ∑' k : ℤ, H k := by exact Complex.tsum_exp_neg_quadratic htc B calc (∑' m : ℤ, eisGauss t (m, n)) = C * ∑' m : ℤ, F m := hsplit _ = C * ((1 / (t : ℂ) ^ (1 / 2 : ℂ)) * ∑' k : ℤ, H k) := by rw [hpoisson] _ = (1 / (t : ℂ) ^ (1 / 2 : ℂ)) * (C * ∑' k : ℤ, H k) := by ring _ = (1 / (t : ℂ) ^ (1 / 2 : ℂ)) * ∑' k : ℤ, g1 t (k, n) := by congr 1 rw [← tsum_mul_left] apply tsum_congr intro k exact first_transform_term ht k n private noncomputable def dualTerm (t : ℝ) (z : ℤ × ℤ) : ℂ := cg ((t⁻¹ : ℝ) : ℂ) z.1 * Complex.exp (-(Real.pi : ℂ) / (((3 * t) / 4 : ℝ) : ℂ) * ((z.2 : ℂ) + (z.1 : ℂ) / 2) ^ 2) private theorem second_transform_term (t : ℝ) (k n : ℤ) : cg ((((3 * t) / 4 : ℝ) : ℂ)) n * phase k n = Complex.exp (-(Real.pi : ℂ) * ((((3 * t) / 4 : ℝ) : ℂ)) * (n : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * (-(Complex.I * (k : ℂ)) / 2) * (n : ℂ)) := by dsimp [cg, phase] rw [← Complex.exp_add] congr 1 push_cast ring private theorem second_poisson_slice {t : ℝ} (ht : 0 < t) (k : ℤ) : (∑' n : ℤ, g1 t (k, n)) = (1 / ((((3 * t) / 4 : ℝ) : ℂ)) ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualTerm t (k, l) := by have ht3 : 0 < 3 * t / 4 := by positivity have ht3c : 0 < (((3 * t) / 4 : ℝ) : ℂ).re := by simpa using ht3 let A : ℂ := (((3 * t) / 4 : ℝ) : ℂ) let B : ℂ := -(Complex.I * (k : ℂ)) / 2 let C : ℂ := cg ((t⁻¹ : ℝ) : ℂ) k let F : ℤ → ℂ := fun n => Complex.exp (-(Real.pi : ℂ) * A * (n : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * B * (n : ℂ)) let H : ℤ → ℂ := fun l => Complex.exp (-(Real.pi : ℂ) / A * ((l : ℂ) + Complex.I * B) ^ 2) have hsplit : (∑' n : ℤ, g1 t (k,n)) = C * ∑' n : ℤ, F n := by rw [← tsum_mul_left] apply tsum_congr intro n calc g1 t (k, n) = C * (cg A n * phase k n) := by dsimp [g1, C, A] ring _ = C * F n := by rw [second_transform_term t k n] have hpoisson : (∑' n : ℤ, F n) = (1 / A ^ (1 / 2 : ℂ)) * ∑' l : ℤ, H l := Complex.tsum_exp_neg_quadratic ht3c B have hterm (l : ℤ) : C * H l = dualTerm t (k,l) := by have hb : Complex.I * B = (k : ℂ) / 2 := by dsimp [B] field_simp ring_nf simp [Complex.I_sq] dsimp [H, dualTerm, C, A] rw [hb] calc (∑' n : ℤ, g1 t (k,n)) = C * ∑' n : ℤ, F n := hsplit _ = C * ((1 / A ^ (1 / 2 : ℂ)) * ∑' l : ℤ, H l) := by rw [hpoisson] _ = (1 / A ^ (1 / 2 : ℂ)) * (C * ∑' l : ℤ, H l) := by ring _ = (1 / ((((3 * t) / 4 : ℝ) : ℂ)) ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualTerm t (k,l) := by change (1 / A ^ (1 / 2 : ℂ)) * (C * ∑' l : ℤ, H l) = (1 / A ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualTerm t (k,l) congr 1 rw [← tsum_mul_left] exact tsum_congr hterm end RankTwoPoisson end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Poisson.BinaryGaussian namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical namespace RankTwoComplex open Real theorem lattice_gaussian_summable_of_re_bound (F : ℤ × ℤ → ℂ) {eps : ℝ} (heps : 0 < eps) (hbound : ∀ z : ℤ × ℤ, eps * ((z.1 : ℝ) ^ 2 + (z.2 : ℝ) ^ 2) ≤ (F z).re) : Summable (fun z : ℤ × ℤ => Complex.exp (-(Real.pi : ℂ) * F z)) := by have h1 := RankTwoPoisson.real_gauss_summable heps have hmaj : Summable (fun z : ℤ × ℤ => Real.exp (-Real.pi * eps * (z.1 : ℝ) ^ 2) * Real.exp (-Real.pi * eps * (z.2 : ℝ) ^ 2)) := h1.mul_of_nonneg h1 (fun _ => (Real.exp_pos _).le) (fun _ => (Real.exp_pos _).le) refine hmaj.of_norm_bounded ?_ intro z have hb := hbound z have hpi : 0 ≤ Real.pi := Real.pi_pos.le have hm := mul_le_mul_of_nonneg_left hb hpi have hexp : (-(Real.pi : ℂ) * F z).re ≤ -Real.pi * eps * (z.1 : ℝ) ^ 2 + -Real.pi * eps * (z.2 : ℝ) ^ 2 := by simp [Complex.mul_re] at * nlinarith [hm] simpa only [Complex.norm_exp, Real.exp_add] using (Real.exp_le_exp.mpr hexp) noncomputable def schur (a b d : ℂ) : ℂ := d - b ^ 2 / a noncomputable def binaryGaussian (a b d : ℂ) (z : ℤ × ℤ) : ℂ := Complex.exp (-(Real.pi : ℂ) * (a * (z.1 : ℂ) ^ 2 + 2 * b * (z.1 : ℂ) * (z.2 : ℂ) + d * (z.2 : ℂ) ^ 2)) noncomputable def firstGaussian (a b d : ℂ) (z : ℤ × ℤ) : ℂ := Complex.exp (-(Real.pi : ℂ) / a * (z.1 : ℂ) ^ 2) * Complex.exp (-(Real.pi : ℂ) * schur a b d * (z.2 : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * (Complex.I * b / a * (z.1 : ℂ)) * (z.2 : ℂ)) noncomputable def dualGaussian (a b d : ℂ) (z : ℤ × ℤ) : ℂ := Complex.exp (-(Real.pi : ℂ) / a * (z.1 : ℂ) ^ 2) * Complex.exp (-(Real.pi : ℂ) / (schur a b d) * ((z.2 : ℂ) - b / a * (z.1 : ℂ)) ^ 2) private theorem binary_split (a b d : ℂ) (m n : ℤ) : binaryGaussian a b d (m,n) = Complex.exp (-(Real.pi : ℂ) * d * (n : ℂ) ^ 2) * Complex.exp (-(Real.pi : ℂ) * a * (m : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * (-(b * (n : ℂ))) * (m : ℂ)) := by dsimp [binaryGaussian] rw [← Complex.exp_add] congr 1 ring private theorem first_exponent_identity {a b d : ℂ} (ha : a ≠ 0) (k n : ℤ) : (-(Real.pi : ℂ) * d * (n : ℂ) ^ 2) + (-(Real.pi : ℂ) / a * ((k : ℂ) + Complex.I * (-(b * (n : ℂ)))) ^ 2) = (-(Real.pi : ℂ) / a * (k : ℂ) ^ 2) + (-(Real.pi : ℂ) * schur a b d * (n : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * (Complex.I * b / a * (k : ℂ)) * (n : ℂ)) := by dsimp [schur] field_simp [ha] ring_nf simp [Complex.I_sq] private theorem first_transform_term {a b d : ℂ} (ha : a ≠ 0) (k n : ℤ) : Complex.exp (-(Real.pi : ℂ) * d * (n : ℂ) ^ 2) * Complex.exp (-(Real.pi : ℂ) / a * ((k : ℂ) + Complex.I * (-(b * (n : ℂ)))) ^ 2) = firstGaussian a b d (k,n) := by rw [← Complex.exp_add, first_exponent_identity ha k n, Complex.exp_add] rfl private theorem first_poisson_slice {a b d : ℂ} (ha : 0 < a.re) (n : ℤ) : (∑' m : ℤ, binaryGaussian a b d (m,n)) = (1 / a ^ (1 / 2 : ℂ)) * ∑' k : ℤ, firstGaussian a b d (k,n) := by have ha0 : a ≠ 0 := by intro h simp [h] at ha let C : ℂ := Complex.exp (-(Real.pi : ℂ) * d * (n : ℂ) ^ 2) let B : ℂ := -(b * (n : ℂ)) let F : ℤ → ℂ := fun m => Complex.exp (-(Real.pi : ℂ) * a * (m : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * B * (m : ℂ)) let H : ℤ → ℂ := fun k => Complex.exp (-(Real.pi : ℂ) / a * ((k : ℂ) + Complex.I * B) ^ 2) have hsplit : (∑' m : ℤ, binaryGaussian a b d (m,n)) = C * ∑' m : ℤ, F m := by rw [← tsum_mul_left] apply tsum_congr intro m exact binary_split a b d m n have hpoisson : (∑' m : ℤ, F m) = (1 / a ^ (1 / 2 : ℂ)) * ∑' k : ℤ, H k := Complex.tsum_exp_neg_quadratic ha B calc (∑' m : ℤ, binaryGaussian a b d (m,n)) = C * ∑' m : ℤ, F m := hsplit _ = C * ((1 / a ^ (1 / 2 : ℂ)) * ∑' k : ℤ, H k) := by rw [hpoisson] _ = (1 / a ^ (1 / 2 : ℂ)) * (C * ∑' k : ℤ, H k) := by ring _ = (1 / a ^ (1 / 2 : ℂ)) * ∑' k : ℤ, firstGaussian a b d (k,n) := by congr 1 rw [← tsum_mul_left] apply tsum_congr intro k exact first_transform_term ha0 k n private theorem second_poisson_slice {a b d : ℂ} (hδ : 0 < (schur a b d).re) (k : ℤ) : (∑' n : ℤ, firstGaussian a b d (k,n)) = (1 / (schur a b d) ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualGaussian a b d (k,l) := by have hδ0 : schur a b d ≠ 0 := by intro h simp [h] at hδ let A : ℂ := schur a b d let B : ℂ := Complex.I * b / a * (k : ℂ) let C : ℂ := Complex.exp (-(Real.pi : ℂ) / a * (k : ℂ) ^ 2) let F : ℤ → ℂ := fun n => Complex.exp (-(Real.pi : ℂ) * A * (n : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * B * (n : ℂ)) let H : ℤ → ℂ := fun l => Complex.exp (-(Real.pi : ℂ) / A * ((l : ℂ) + Complex.I * B) ^ 2) have hsplit : (∑' n : ℤ, firstGaussian a b d (k,n)) = C * ∑' n : ℤ, F n := by rw [← tsum_mul_left] apply tsum_congr intro n rfl have hpoisson : (∑' n : ℤ, F n) = (1 / A ^ (1 / 2 : ℂ)) * ∑' l : ℤ, H l := Complex.tsum_exp_neg_quadratic hδ B have hterm (l : ℤ) : C * H l = dualGaussian a b d (k,l) := by have hb : Complex.I * B = -(b / a * (k : ℂ)) := by dsimp [B] field_simp ring_nf simp [Complex.I_sq] dsimp [H, dualGaussian, C, A] rw [hb] ring_nf calc (∑' n : ℤ, firstGaussian a b d (k,n)) = C * ∑' n : ℤ, F n := hsplit _ = C * ((1 / A ^ (1 / 2 : ℂ)) * ∑' l : ℤ, H l) := by rw [hpoisson] _ = (1 / A ^ (1 / 2 : ℂ)) * (C * ∑' l : ℤ, H l) := by ring _ = (1 / (schur a b d) ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualGaussian a b d (k,l) := by change (1 / A ^ (1 / 2 : ℂ)) * (C * ∑' l : ℤ, H l) = (1 / A ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualGaussian a b d (k,l) congr 1 rw [← tsum_mul_left] exact tsum_congr hterm theorem binary_gaussian_poisson {a b d : ℂ} (ha : 0 < a.re) (hδ : 0 < (schur a b d).re) (hO : Summable (binaryGaussian a b d)) (hM : Summable (firstGaussian a b d)) (hD : Summable (dualGaussian a b d)) : (∑' z : ℤ × ℤ, binaryGaussian a b d z) = (1 / a ^ (1 / 2 : ℂ)) * (1 / (schur a b d) ^ (1 / 2 : ℂ)) * ∑' z : ℤ × ℤ, dualGaussian a b d z := by have hOcomm : (∑' n : ℤ, ∑' m : ℤ, binaryGaussian a b d (m,n)) = ∑' m : ℤ, ∑' n : ℤ, binaryGaussian a b d (m,n) := (show Summable (Function.uncurry (fun m n : ℤ => binaryGaussian a b d (m,n))) from hO).tsum_comm have hMcomm : (∑' n : ℤ, ∑' k : ℤ, firstGaussian a b d (k,n)) = ∑' k : ℤ, ∑' n : ℤ, firstGaussian a b d (k,n) := (show Summable (Function.uncurry (fun k n : ℤ => firstGaussian a b d (k,n))) from hM).tsum_comm calc (∑' z : ℤ × ℤ, binaryGaussian a b d z) = ∑' m : ℤ, ∑' n : ℤ, binaryGaussian a b d (m,n) := hO.tsum_prod _ = ∑' n : ℤ, ∑' m : ℤ, binaryGaussian a b d (m,n) := hOcomm.symm _ = ∑' n : ℤ, (1 / a ^ (1 / 2 : ℂ)) * ∑' k : ℤ, firstGaussian a b d (k,n) := by apply tsum_congr intro n exact first_poisson_slice ha n _ = (1 / a ^ (1 / 2 : ℂ)) * (∑' n : ℤ, ∑' k : ℤ, firstGaussian a b d (k,n)) := tsum_mul_left _ = (1 / a ^ (1 / 2 : ℂ)) * (∑' k : ℤ, ∑' n : ℤ, firstGaussian a b d (k,n)) := by rw [hMcomm] _ = (1 / a ^ (1 / 2 : ℂ)) * (∑' k : ℤ, (1 / (schur a b d) ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualGaussian a b d (k,l)) := by congr 1 apply tsum_congr intro k exact second_poisson_slice hδ k _ = (1 / a ^ (1 / 2 : ℂ)) * (1 / (schur a b d) ^ (1 / 2 : ℂ)) * (∑' k : ℤ, ∑' l : ℤ, dualGaussian a b d (k,l)) := by rw [tsum_mul_left] ring _ = (1 / a ^ (1 / 2 : ℂ)) * (1 / (schur a b d) ^ (1 / 2 : ℂ)) * ∑' z : ℤ × ℤ, dualGaussian a b d z := by rw [hD.tsum_prod] end RankTwoComplex namespace GaussianShiftedPartition open ActualEisensteinCubic ConcreteTraceCRT ConcreteBreveE noncomputable def representative (c : O) (r : O ⧸ Ideal.span {c}) : O := Classical.choose (Ideal.Quotient.mk_surjective r) theorem representative_spec (c : O) (r : O ⧸ Ideal.span {c}) : Ideal.Quotient.mk (Ideal.span {c}) (representative c r) = r := Classical.choose_spec (Ideal.Quotient.mk_surjective r) theorem actual_quadratic_shifted_partition (c : O) (hc : c ≠ 0) (W : O → ℂ) (hsum : Summable (fun z : O => (eisTraceModChar ShortDraftTrace.breveE breveE_period_coordinates c hc) ((Ideal.Quotient.mk (Ideal.span {c}) z) ^ 2) * W z)) : letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ (∑' z : O, (eisTraceModChar ShortDraftTrace.breveE breveE_period_coordinates c hc) ((Ideal.Quotient.mk (Ideal.span {c}) z) ^ 2) * W z) = ∑ r : O ⧸ Ideal.span {c}, (eisTraceModChar ShortDraftTrace.breveE breveE_period_coordinates c hc) (r ^ 2) * ∑' w : O, W (representative c r + c*w) := by let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ rw [GaussianAbelPartition.actual_quadratic_gaussian_partition c hc W hsum] apply Finset.sum_congr rfl intro r hr congr 1 exact GaussianFiberEquiv.fiber_tsum c hc r (representative c r) (representative_spec c r) W end GaussianShiftedPartition namespace RankTwoAffine open RankTwoComplex noncomputable def binaryGaussian (a b d u v : ℂ) (z : ℤ × ℤ) : ℂ := Complex.exp (-(Real.pi : ℂ) * (a * (z.1 : ℂ) ^ 2 + 2 * b * (z.1 : ℂ) * (z.2 : ℂ) + d * (z.2 : ℂ) ^ 2) + 2 * (Real.pi : ℂ) * (u * (z.1 : ℂ) + v * (z.2 : ℂ))) noncomputable def firstGaussian (a b d u v : ℂ) (z : ℤ × ℤ) : ℂ := Complex.exp (-(Real.pi : ℂ) / a * ((z.1 : ℂ) + Complex.I * u) ^ 2) * Complex.exp (-(Real.pi : ℂ) * schur a b d * (z.2 : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * (v + Complex.I * b / a * ((z.1 : ℂ) + Complex.I * u)) * (z.2 : ℂ)) noncomputable def dualGaussian (a b d u v : ℂ) (z : ℤ × ℤ) : ℂ := Complex.exp (-(Real.pi : ℂ) / a * ((z.1 : ℂ) + Complex.I * u) ^ 2) * Complex.exp (-(Real.pi : ℂ) / (schur a b d) * ((z.2 : ℂ) + Complex.I * (v + Complex.I * b / a * ((z.1 : ℂ) + Complex.I * u))) ^ 2) private theorem binary_split (a b d u v : ℂ) (m n : ℤ) : binaryGaussian a b d u v (m,n) = Complex.exp (-(Real.pi : ℂ) * d * (n : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * v * (n : ℂ)) * Complex.exp (-(Real.pi : ℂ) * a * (m : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * (u - b * (n : ℂ)) * (m : ℂ)) := by dsimp [binaryGaussian] rw [← Complex.exp_add] congr 1 ring private theorem first_exponent_identity {a b d u v : ℂ} (ha : a ≠ 0) (k n : ℤ) : (-(Real.pi : ℂ) * d * (n : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * v * (n : ℂ)) + (-(Real.pi : ℂ) / a * ((k : ℂ) + Complex.I * (u - b * (n : ℂ))) ^ 2) = (-(Real.pi : ℂ) / a * ((k : ℂ) + Complex.I * u) ^ 2) + (-(Real.pi : ℂ) * schur a b d * (n : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * (v + Complex.I * b / a * ((k : ℂ) + Complex.I * u)) * (n : ℂ)) := by dsimp [schur] field_simp [ha] ring_nf simp [Complex.I_sq] private theorem first_transform_term {a b d u v : ℂ} (ha : a ≠ 0) (k n : ℤ) : Complex.exp (-(Real.pi : ℂ) * d * (n : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * v * (n : ℂ)) * Complex.exp (-(Real.pi : ℂ) / a * ((k : ℂ) + Complex.I * (u - b * (n : ℂ))) ^ 2) = firstGaussian a b d u v (k,n) := by rw [← Complex.exp_add, first_exponent_identity ha k n, Complex.exp_add] rfl private theorem first_poisson_slice {a b d u v : ℂ} (ha : 0 < a.re) (n : ℤ) : (∑' m : ℤ, binaryGaussian a b d u v (m,n)) = (1 / a ^ (1 / 2 : ℂ)) * ∑' k : ℤ, firstGaussian a b d u v (k,n) := by have ha0 : a ≠ 0 := by intro h simp [h] at ha let C : ℂ := Complex.exp (-(Real.pi : ℂ) * d * (n : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * v * (n : ℂ)) let B : ℂ := u - b * (n : ℂ) let F : ℤ → ℂ := fun m => Complex.exp (-(Real.pi : ℂ) * a * (m : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * B * (m : ℂ)) let H : ℤ → ℂ := fun k => Complex.exp (-(Real.pi : ℂ) / a * ((k : ℂ) + Complex.I * B) ^ 2) have hsplit : (∑' m : ℤ, binaryGaussian a b d u v (m,n)) = C * ∑' m : ℤ, F m := by rw [← tsum_mul_left] apply tsum_congr intro m exact binary_split a b d u v m n have hpoisson : (∑' m : ℤ, F m) = (1 / a ^ (1 / 2 : ℂ)) * ∑' k : ℤ, H k := Complex.tsum_exp_neg_quadratic ha B calc (∑' m : ℤ, binaryGaussian a b d u v (m,n)) = C * ∑' m : ℤ, F m := hsplit _ = C * ((1 / a ^ (1 / 2 : ℂ)) * ∑' k : ℤ, H k) := by rw [hpoisson] _ = (1 / a ^ (1 / 2 : ℂ)) * (C * ∑' k : ℤ, H k) := by ring _ = (1 / a ^ (1 / 2 : ℂ)) * ∑' k : ℤ, firstGaussian a b d u v (k,n) := by congr 1 rw [← tsum_mul_left] apply tsum_congr intro k exact first_transform_term ha0 k n private theorem second_poisson_slice {a b d u v : ℂ} (hδ : 0 < (schur a b d).re) (k : ℤ) : (∑' n : ℤ, firstGaussian a b d u v (k,n)) = (1 / (schur a b d) ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualGaussian a b d u v (k,l) := by let A : ℂ := schur a b d let B : ℂ := v + Complex.I * b / a * ((k : ℂ) + Complex.I * u) let C : ℂ := Complex.exp (-(Real.pi : ℂ) / a * ((k : ℂ) + Complex.I * u) ^ 2) let F : ℤ → ℂ := fun n => Complex.exp (-(Real.pi : ℂ) * A * (n : ℂ) ^ 2 + 2 * (Real.pi : ℂ) * B * (n : ℂ)) let H : ℤ → ℂ := fun l => Complex.exp (-(Real.pi : ℂ) / A * ((l : ℂ) + Complex.I * B) ^ 2) have hsplit : (∑' n : ℤ, firstGaussian a b d u v (k,n)) = C * ∑' n : ℤ, F n := by rw [← tsum_mul_left] apply tsum_congr intro n rfl have hpoisson : (∑' n : ℤ, F n) = (1 / A ^ (1 / 2 : ℂ)) * ∑' l : ℤ, H l := Complex.tsum_exp_neg_quadratic hδ B calc (∑' n : ℤ, firstGaussian a b d u v (k,n)) = C * ∑' n : ℤ, F n := hsplit _ = C * ((1 / A ^ (1 / 2 : ℂ)) * ∑' l : ℤ, H l) := by rw [hpoisson] _ = (1 / A ^ (1 / 2 : ℂ)) * (C * ∑' l : ℤ, H l) := by ring _ = (1 / (schur a b d) ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualGaussian a b d u v (k,l) := by change (1 / A ^ (1 / 2 : ℂ)) * (C * ∑' l : ℤ, H l) = (1 / A ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualGaussian a b d u v (k,l) congr 1 rw [← tsum_mul_left] rfl theorem affine_gaussian_poisson {a b d u v : ℂ} (ha : 0 < a.re) (hδ : 0 < (schur a b d).re) (hO : Summable (binaryGaussian a b d u v)) (hM : Summable (firstGaussian a b d u v)) (hD : Summable (dualGaussian a b d u v)) : (∑' z : ℤ × ℤ, binaryGaussian a b d u v z) = (1 / a ^ (1 / 2 : ℂ)) * (1 / (schur a b d) ^ (1 / 2 : ℂ)) * ∑' z : ℤ × ℤ, dualGaussian a b d u v z := by have hOcomm : (∑' n : ℤ, ∑' m : ℤ, binaryGaussian a b d u v (m,n)) = ∑' m : ℤ, ∑' n : ℤ, binaryGaussian a b d u v (m,n) := (show Summable (Function.uncurry (fun m n : ℤ => binaryGaussian a b d u v (m,n))) from hO).tsum_comm have hMcomm : (∑' n : ℤ, ∑' k : ℤ, firstGaussian a b d u v (k,n)) = ∑' k : ℤ, ∑' n : ℤ, firstGaussian a b d u v (k,n) := (show Summable (Function.uncurry (fun k n : ℤ => firstGaussian a b d u v (k,n))) from hM).tsum_comm calc (∑' z : ℤ × ℤ, binaryGaussian a b d u v z) = ∑' m : ℤ, ∑' n : ℤ, binaryGaussian a b d u v (m,n) := hO.tsum_prod _ = ∑' n : ℤ, ∑' m : ℤ, binaryGaussian a b d u v (m,n) := hOcomm.symm _ = ∑' n : ℤ, (1 / a ^ (1 / 2 : ℂ)) * ∑' k : ℤ, firstGaussian a b d u v (k,n) := by apply tsum_congr intro n exact first_poisson_slice ha n _ = (1 / a ^ (1 / 2 : ℂ)) * (∑' n : ℤ, ∑' k : ℤ, firstGaussian a b d u v (k,n)) := tsum_mul_left _ = (1 / a ^ (1 / 2 : ℂ)) * (∑' k : ℤ, ∑' n : ℤ, firstGaussian a b d u v (k,n)) := by rw [hMcomm] _ = (1 / a ^ (1 / 2 : ℂ)) * (∑' k : ℤ, (1 / (schur a b d) ^ (1 / 2 : ℂ)) * ∑' l : ℤ, dualGaussian a b d u v (k,l)) := by congr 1 apply tsum_congr intro k exact second_poisson_slice hδ k _ = (1 / a ^ (1 / 2 : ℂ)) * (1 / (schur a b d) ^ (1 / 2 : ℂ)) * (∑' k : ℤ, ∑' l : ℤ, dualGaussian a b d u v (k,l)) := by rw [tsum_mul_left] ring _ = (1 / a ^ (1 / 2 : ℂ)) * (1 / (schur a b d) ^ (1 / 2 : ℂ)) * ∑' z : ℤ × ℤ, dualGaussian a b d u v z := by rw [hD.tsum_prod] end RankTwoAffine namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT Complex theorem eisEmbedding_eval_norm_sq (x y : ℤ) : ‖eisEmbedding (ActualEisensteinCoordinates.eval x y)‖ ^ 2 = (x*x-x*y+y*y : ℤ) := by rw [eisEmbedding_eval, ← Complex.normSq_eq_norm_sq] have hre : ((x : ℂ) + (y : ℂ) * omega3).re = (x : ℝ) - (y : ℝ) / 2 := by simp [omega3, Complex.add_re, Complex.mul_re] ring have him : ((x : ℂ) + (y : ℂ) * omega3).im = (y : ℝ) * Real.sqrt 3 / 2 := by simp [omega3, Complex.add_im, Complex.mul_im] ring rw [Complex.normSq_apply, hre, him] have hs : (Real.sqrt 3)^2 = (3:ℝ) := Real.sq_sqrt (by norm_num) push_cast nlinarith theorem fiber_coordinates (a b x y m n : ℤ) : ActualEisensteinCoordinates.eval x y + ActualEisensteinCoordinates.eval a b * ActualEisensteinCoordinates.eval m n = ActualEisensteinCoordinates.eval (x + a*m-b*n) (y+b*m+(a-b)*n) := by rw [ActualEisensteinCoordinates.eval_mul] simp only [ActualEisensteinCoordinates.eval] push_cast ring theorem fiber_quadratic_expansion (a b x y m n : ℤ) : let q := a*a-a*b+b*b let X := x+a*m-b*n let Y := y+b*m+(a-b)*n X*X-X*Y+Y*Y = q*(m*m-m*n+n*n) + ((2*a-b)*x+(2*b-a)*y)*m + (-(a+b)*x+(2*a-b)*y)*n + (x*x-x*y+y*y) := by dsimp ring theorem eisEmbedding_fiber_norm_sq (a b x y m n : ℤ) : ‖eisEmbedding (ActualEisensteinCoordinates.eval x y + ActualEisensteinCoordinates.eval a b * ActualEisensteinCoordinates.eval m n)‖ ^ 2 = ((a*a-a*b+b*b)*(m*m-m*n+n*n) + ((2*a-b)*x+(2*b-a)*y)*m + (-(a+b)*x+(2*a-b)*y)*n + (x*x-x*y+y*y) : ℤ) := by rw [fiber_coordinates, eisEmbedding_eval_norm_sq] exact_mod_cast fiber_quadratic_expansion a b x y m n theorem coordinate_norm_pos_of_nonzero (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) : 0 < a*a-a*b+b*b := by have he : eisEmbedding (ActualEisensteinCoordinates.eval a b) ≠ 0 := ConcreteTraceCRT.eisEmbedding_ne_zero hc have hn : 0 < ‖eisEmbedding (ActualEisensteinCoordinates.eval a b)‖ := norm_pos_iff.mpr he have heq := eisEmbedding_eval_norm_sq a b exact_mod_cast (show (0:ℝ) < (a*a-a*b+b*b : ℤ) by rw [← heq] positivity) end ActualEisensteinCubic namespace RankTwoEisShift noncomputable def Q (x y : ℝ) : ℝ := x ^ 2 - x * y + y ^ 2 noncomputable def shifted (t x y : ℝ) (z : ℤ × ℤ) : ℂ := Complex.exp (((-Real.pi * t * Q ((z.1 : ℝ) + x) ((z.2 : ℝ) + y) : ℝ) : ℂ)) noncomputable def A (t : ℝ) : ℂ := (t : ℂ) noncomputable def B (t : ℝ) : ℂ := ((-t / 2 : ℝ) : ℂ) noncomputable def D (t : ℝ) : ℂ := (t : ℂ) noncomputable def U (t x y : ℝ) : ℂ := ((-t * (x - y / 2) : ℝ) : ℂ) noncomputable def V (t x y : ℝ) : ℂ := ((-t * (y - x / 2) : ℝ) : ℂ) noncomputable def C (t x y : ℝ) : ℂ := Complex.exp (((-Real.pi * t * Q x y : ℝ) : ℂ)) private theorem shifted_eq_affine (t x y : ℝ) (m n : ℤ) : shifted t x y (m,n) = C t x y * RankTwoAffine.binaryGaussian (A t) (B t) (D t) (U t x y) (V t x y) (m,n) := by dsimp [shifted, C, Q, RankTwoAffine.binaryGaussian, A, B, D, U, V] rw [← Complex.exp_add] congr 1 push_cast ring private theorem schur_eis {t : ℝ} (ht : 0 < t) : RankTwoComplex.schur (A t) (B t) (D t) = (((3 * t) / 4 : ℝ) : ℂ) := by have ht0 : (t : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt ht dsimp [RankTwoComplex.schur, A, B, D] push_cast field_simp [ht0] ring private theorem schur_eis_pos {t : ℝ} (ht : 0 < t) : 0 < (RankTwoComplex.schur (A t) (B t) (D t)).re := by rw [schur_eis ht] have h : 0 < 3 * t / 4 := by positivity simpa using h noncomputable def dualPhase (k l : ℤ) (x y : ℝ) : ℂ := Complex.exp ((((2 * Real.pi * ((k : ℝ) * x + (l : ℝ) * y) : ℝ) : ℂ)) * Complex.I) private theorem shifted_dual_term {t : ℝ} (ht : 0 < t) (x y : ℝ) (k l : ℤ) : C t x y * RankTwoAffine.dualGaussian (A t) (B t) (D t) (U t x y) (V t x y) (k,l) = RankTwoPoisson.eisGauss (4 / (3 * t)) (k,-l) * dualPhase k l x y := by have ht0 : (t : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt ht dsimp [C, Q, RankTwoAffine.dualGaussian, RankTwoPoisson.eisGauss, RankTwoPoisson.eisQ, dualPhase, A, B, D, U, V] rw [show RankTwoComplex.schur (t : ℂ) ((-t / 2 : ℝ) : ℂ) (t : ℂ) = (((3 * t) / 4 : ℝ) : ℂ) from schur_eis ht] rw [← Complex.exp_add, ← Complex.exp_add, ← Complex.exp_add] congr 1 push_cast field_simp [ht0] ring_nf simp [Complex.I_sq] ring private theorem shifted_real_gauss_summable {t : ℝ} (ht : 0 < t) (y : ℝ) : Summable (fun n : ℤ => Real.exp (-Real.pi * t * ((n : ℝ) + y) ^ 2)) := by have ht2 : 0 < t / 2 := by positivity have hbase := RankTwoPoisson.real_gauss_summable ht2 have hmaj : Summable (fun n : ℤ => Real.exp (Real.pi * t * y ^ 2) * Real.exp (-Real.pi * (t / 2) * (n : ℝ) ^ 2)) := hbase.mul_left _ refine hmaj.of_norm_bounded ?_ intro n have hs : (n : ℝ) ^ 2 / 2 - y ^ 2 ≤ ((n : ℝ) + y) ^ 2 := by nlinarith [sq_nonneg ((n : ℝ) + 2 * y)] have hm := mul_le_mul_of_nonneg_left hs (mul_pos Real.pi_pos ht).le have he : -Real.pi * t * ((n : ℝ) + y) ^ 2 ≤ Real.pi * t * y ^ 2 + -Real.pi * (t / 2) * (n : ℝ) ^ 2 := by nlinarith [hm] simpa [Real.norm_eq_abs, abs_of_pos (Real.exp_pos _), Real.exp_add] using (Real.exp_le_exp.mpr he) noncomputable def middlePhase (k n : ℤ) (x y : ℝ) : ℂ := Complex.exp ((((2 * Real.pi * (k : ℝ) * (x - ((n : ℝ) + y) / 2) : ℝ) : ℂ)) * Complex.I) private theorem middlePhase_norm (k n : ℤ) (x y : ℝ) : ‖middlePhase k n x y‖ = 1 := by simp [middlePhase, Complex.norm_exp, Complex.mul_re] private theorem shifted_middle_term {t : ℝ} (ht : 0 < t) (x y : ℝ) (k n : ℤ) : C t x y * RankTwoAffine.firstGaussian (A t) (B t) (D t) (U t x y) (V t x y) (k,n) = RankTwoPoisson.cg ((t⁻¹ : ℝ) : ℂ) k * Complex.exp (((-Real.pi * (3 * t / 4) * ((n : ℝ) + y) ^ 2 : ℝ) : ℂ)) * middlePhase k n x y := by have ht0 : (t : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt ht dsimp [C, Q, RankTwoAffine.firstGaussian, RankTwoPoisson.cg, middlePhase, A, B, D, U, V] rw [show RankTwoComplex.schur (t : ℂ) ((-t / 2 : ℝ) : ℂ) (t : ℂ) = (((3 * t) / 4 : ℝ) : ℂ) from schur_eis ht] rw [← Complex.exp_add, ← Complex.exp_add, ← Complex.exp_add, ← Complex.exp_add] congr 1 push_cast field_simp [ht0] ring_nf simp [Complex.I_sq] ring private theorem middle_norm {t : ℝ} (ht : 0 < t) (x y : ℝ) (k n : ℤ) : ‖C t x y * RankTwoAffine.firstGaussian (A t) (B t) (D t) (U t x y) (V t x y) (k,n)‖ = Real.exp (-Real.pi * t⁻¹ * (k : ℝ) ^ 2) * Real.exp (-Real.pi * (3 * t / 4) * ((n : ℝ) + y) ^ 2) := by rw [shifted_middle_term ht] simp [ middlePhase_norm, RankTwoPoisson.cg, Complex.norm_exp, ← Complex.ofReal_intCast, ← Complex.ofReal_pow, mul_assoc] private theorem affine_middle_summable {t : ℝ} (ht : 0 < t) (x y : ℝ) : Summable (RankTwoAffine.firstGaussian (A t) (B t) (D t) (U t x y) (V t x y)) := by have htinv : 0 < t⁻¹ := inv_pos.mpr ht have ht3 : 0 < 3 * t / 4 := by positivity have h1 := RankTwoPoisson.real_gauss_summable htinv have h2 := shifted_real_gauss_summable ht3 y have hmaj : Summable (fun z : ℤ × ℤ => Real.exp (-Real.pi * t⁻¹ * (z.1 : ℝ) ^ 2) * Real.exp (-Real.pi * (3 * t / 4) * ((z.2 : ℝ) + y) ^ 2)) := h1.mul_of_nonneg h2 (fun _ => (Real.exp_pos _).le) (fun _ => (Real.exp_pos _).le) have hCmid : Summable (fun z : ℤ × ℤ => C t x y * RankTwoAffine.firstGaussian (A t) (B t) (D t) (U t x y) (V t x y) z) := by refine hmaj.of_norm_bounded ?_ intro z rw [middle_norm ht] have hC : C t x y ≠ 0 := Complex.exp_ne_zero _ have h := hCmid.mul_left (C t x y)⁻¹ simpa only [inv_mul_cancel_left₀ hC] using h theorem dualPhase_norm (k l : ℤ) (x y : ℝ) : ‖dualPhase k l x y‖ = 1 := by simp [dualPhase, Complex.norm_exp, Complex.mul_re] private theorem affine_dual_summable {t : ℝ} (ht : 0 < t) (x y : ℝ) : Summable (RankTwoAffine.dualGaussian (A t) (B t) (D t) (U t x y) (V t x y)) := by have htd : 0 < 4 / (3 * t) := by positivity let e : ℤ × ℤ ≃ ℤ × ℤ := Equiv.prodCongr (Equiv.refl ℤ) (Equiv.neg ℤ) have hE : Summable (fun z : ℤ × ℤ => RankTwoPoisson.eisGauss (4 / (3 * t)) (z.1,-z.2)) := (e.summable_iff).2 (RankTwoPoisson.eis_gauss_summable htd) have hCdual : Summable (fun z : ℤ × ℤ => C t x y * RankTwoAffine.dualGaussian (A t) (B t) (D t) (U t x y) (V t x y) z) := by refine hE.norm.of_norm_bounded ?_ intro z rw [shifted_dual_term ht] simp [ dualPhase_norm] have hC : C t x y ≠ 0 := Complex.exp_ne_zero _ have h := hCdual.mul_left (C t x y)⁻¹ simpa only [inv_mul_cancel_left₀ hC] using h private theorem shifted_summable {t : ℝ} (ht : 0 < t) (x y : ℝ) : Summable (shifted t x y) := by have ht4 : 0 < t / 4 := by positivity have h1 := RankTwoPoisson.real_gauss_summable ht4 have hbase : Summable (fun z : ℤ × ℤ => Real.exp (-Real.pi * (t / 4) * (z.1 : ℝ) ^ 2) * Real.exp (-Real.pi * (t / 4) * (z.2 : ℝ) ^ 2)) := h1.mul_of_nonneg h1 (fun _ => (Real.exp_pos _).le) (fun _ => (Real.exp_pos _).le) have hmaj : Summable (fun z : ℤ × ℤ => Real.exp (Real.pi * t * (x ^ 2 + y ^ 2) / 2) * (Real.exp (-Real.pi * (t / 4) * (z.1 : ℝ) ^ 2) * Real.exp (-Real.pi * (t / 4) * (z.2 : ℝ) ^ 2))) := hbase.mul_left _ refine hmaj.of_norm_bounded ?_ intro z have hq : (((z.1 : ℝ) + x) ^ 2 + ((z.2 : ℝ) + y) ^ 2) / 2 ≤ Q ((z.1 : ℝ) + x) ((z.2 : ℝ) + y) := by dsimp [Q] nlinarith [sq_nonneg (((z.1 : ℝ) + x) - ((z.2 : ℝ) + y))] have hm : (z.1 : ℝ) ^ 2 / 2 - x ^ 2 ≤ ((z.1 : ℝ) + x) ^ 2 := by nlinarith [sq_nonneg ((z.1 : ℝ) + 2 * x)] have hn : (z.2 : ℝ) ^ 2 / 2 - y ^ 2 ≤ ((z.2 : ℝ) + y) ^ 2 := by nlinarith [sq_nonneg ((z.2 : ℝ) + 2 * y)] have hl : ((z.1 : ℝ) ^ 2 + (z.2 : ℝ) ^ 2) / 4 - (x ^ 2 + y ^ 2) / 2 ≤ Q ((z.1 : ℝ) + x) ((z.2 : ℝ) + y) := by nlinarith [hq, hm, hn] have hpt : 0 ≤ Real.pi * t := (mul_pos Real.pi_pos ht).le have hmul := mul_le_mul_of_nonneg_left hl hpt have he : -Real.pi * t * Q ((z.1 : ℝ) + x) ((z.2 : ℝ) + y) ≤ Real.pi * t * (x ^ 2 + y ^ 2) / 2 + (-Real.pi * (t / 4) * (z.1 : ℝ) ^ 2 + -Real.pi * (t / 4) * (z.2 : ℝ) ^ 2) := by nlinarith [hmul] simpa [shifted, Complex.norm_exp, Real.exp_add, mul_assoc] using (Real.exp_le_exp.mpr he) private theorem affine_original_summable {t : ℝ} (ht : 0 < t) (x y : ℝ) : Summable (RankTwoAffine.binaryGaussian (A t) (B t) (D t) (U t x y) (V t x y)) := by have hS := shifted_summable ht x y have hC : C t x y ≠ 0 := Complex.exp_ne_zero _ have hCA : Summable (fun z : ℤ × ℤ => C t x y * RankTwoAffine.binaryGaussian (A t) (B t) (D t) (U t x y) (V t x y) z) := hS.congr (fun z => shifted_eq_affine t x y z.1 z.2) have h := hCA.mul_left (C t x y)⁻¹ simpa only [inv_mul_cancel_left₀ hC] using h theorem shifted_eisenstein_gaussian_poisson {t : ℝ} (ht : 0 < t) (x y : ℝ) : (∑' z : ℤ × ℤ, shifted t x y z) = (1 / (t : ℂ) ^ (1 / 2 : ℂ)) * (1 / ((((3 * t) / 4 : ℝ) : ℂ)) ^ (1 / 2 : ℂ)) * ∑' z : ℤ × ℤ, RankTwoPoisson.eisGauss (4 / (3 * t)) (z.1,-z.2) * dualPhase z.1 z.2 x y := by have ha : 0 < (A t).re := by simpa [A] using ht have hδ := schur_eis_pos ht have hO := affine_original_summable ht x y have hM := affine_middle_summable ht x y have hD := affine_dual_summable ht x y let pref : ℂ := (1 / (t : ℂ) ^ (1 / 2 : ℂ)) * (1 / ((((3 * t) / 4 : ℝ) : ℂ)) ^ (1 / 2 : ℂ)) have haff : (∑' z : ℤ × ℤ, RankTwoAffine.binaryGaussian (A t) (B t) (D t) (U t x y) (V t x y) z) = pref * (∑' z : ℤ × ℤ, RankTwoAffine.dualGaussian (A t) (B t) (D t) (U t x y) (V t x y) z) := by have h := RankTwoAffine.affine_gaussian_poisson ha hδ hO hM hD rw [schur_eis ht] at h exact h calc (∑' z : ℤ × ℤ, shifted t x y z) = C t x y * (∑' z : ℤ × ℤ, RankTwoAffine.binaryGaussian (A t) (B t) (D t) (U t x y) (V t x y) z) := by rw [← tsum_mul_left] apply tsum_congr intro z exact shifted_eq_affine t x y z.1 z.2 _ = C t x y * (pref * (∑' z : ℤ × ℤ, RankTwoAffine.dualGaussian (A t) (B t) (D t) (U t x y) (V t x y) z)) := by rw [haff] _ = pref * (∑' z : ℤ × ℤ, C t x y * RankTwoAffine.dualGaussian (A t) (B t) (D t) (U t x y) (V t x y) z) := by rw [tsum_mul_left] ring _ = pref * (∑' z : ℤ × ℤ, RankTwoPoisson.eisGauss (4 / (3 * t)) (z.1,-z.2) * dualPhase z.1 z.2 x y) := by congr 1 apply tsum_congr intro z exact shifted_dual_term ht x y z.1 z.2 end RankTwoEisShift end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.GaussianDualLimit namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical namespace ActualEisensteinCubic theorem principal_absNorm_pow (p : O) (k : ℕ) : Ideal.absNorm (Ideal.span {p ^ k}) = (Ideal.absNorm (Ideal.span {p})) ^ k := by rw [← Ideal.span_singleton_pow] exact map_pow Ideal.absNorm (Ideal.span {p}) k end ActualEisensteinCubic namespace OscillatoryDeterminant open Complex private def q (a b : ℂ) : ℂ := a*a-a*b+b*b private noncomputable def A (t a b : ℂ) : ℂ := t + 2*Complex.I*b/q a b private noncomputable def B (t a b : ℂ) : ℂ := -t/2-2*Complex.I*a/q a b private noncomputable def D (t a b : ℂ) : ℂ := t + 2*Complex.I*(a-b)/q a b end OscillatoryDeterminant namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT Complex end ActualEisensteinCubic namespace EisensteinFiberShift def Q (x y : ℝ) : ℝ := x*x-x*y+y*y def q (a b : ℝ) : ℝ := Q a b noncomputable def shiftX (a b x y : ℝ) : ℝ := ((a-b)*x+b*y)/q a b noncomputable def shiftY (a b x y : ℝ) : ℝ := (-b*x+a*y)/q a b theorem exact_shift (a b x y m n : ℝ) (hq : q a b ≠ 0) : Q (x+a*m-b*n) (y+b*m+(a-b)*n) = q a b * Q (m+shiftX a b x y) (n+shiftY a b x y) := by dsimp [shiftX, shiftY, Q] field_simp [hq] dsimp [q, Q] ring end EisensteinFiberShift namespace ShortDraftLatticeCount open ActualEisensteinCoordinates noncomputable def rowNormBall (H : ℕ) : Finset O := by classical let I : Finset ℤ := Finset.Icc (-((H : ℤ) + 1)) ((H : ℤ) + 1) exact (I.product I).image (fun v => eval v.1 v.2) theorem mem_rowNormBall_of_qNat_le (H : ℕ) (u : O) (h : qNat u ≤ H) : u ∈ rowNormBall H := by classical have hq : q (coords u) ≤ (H : ℤ) := by change (q (coords u)).toNat ≤ H at h have hnonneg := qO_nonneg u omega let a := (coords u).1 let b := (coords u).2 have hab : a ^ 2 - a * b + b ^ 2 ≤ (H : ℤ) := hq obtain ⟨ha2, hb2⟩ := coordinate_squares a b (H : ℤ) (by positivity) hab have hH : (0 : ℤ) ≤ H := by positivity have haL : -((H : ℤ) + 1) ≤ a := by nlinarith [sq_nonneg (H : ℤ)] have haU : a ≤ (H : ℤ) + 1 := by nlinarith [sq_nonneg (H : ℤ)] have hbL : -((H : ℤ) + 1) ≤ b := by nlinarith [sq_nonneg (H : ℤ)] have hbU : b ≤ (H : ℤ) + 1 := by nlinarith [sq_nonneg (H : ℤ)] unfold rowNormBall apply Finset.mem_image.mpr refine ⟨coords u, ?_, eval_coords u⟩ exact Finset.mem_product.mpr ⟨Finset.mem_Icc.mpr ⟨haL, haU⟩, Finset.mem_Icc.mpr ⟨hbL, hbU⟩⟩ theorem mem_rowNormBall_of_absNorm_le (H : ℕ) (u : O) (h : Ideal.absNorm (Ideal.span {u}) ≤ H) : u ∈ rowNormBall H := by apply mem_rowNormBall_of_qNat_le simpa only [ActualEisensteinCubic.qNat_eq_absNorm_span] using h end ShortDraftLatticeCount namespace EisensteinGaussianPrefactor theorem sqrt_product (t : ℝ) (ht : 0 ≤ t) : Real.sqrt t * Real.sqrt (3*t/4) = Real.sqrt 3 * t / 2 := by have h3 : Real.sqrt (3/4 : ℝ) = Real.sqrt 3 / 2 := by rw [Real.sqrt_div (by norm_num : (0:ℝ) ≤ 3)] rw [show (4:ℝ) = 2^2 by norm_num, Real.sqrt_sq (by norm_num : (0:ℝ) ≤ 2)] have harg : 3*t/4 = (3/4:ℝ)*t := by ring rw [harg, Real.sqrt_mul (by norm_num : (0:ℝ) ≤ 3/4), h3] calc Real.sqrt t * (Real.sqrt 3 / 2 * Real.sqrt t) = Real.sqrt 3 / 2 * (Real.sqrt t)^2 := by ring _ = Real.sqrt 3 * t / 2 := by rw [Real.sq_sqrt ht]; ring theorem eta_times_prefactor (η q : ℝ) (hη : 0 < η) (hq : 0 < q) : η * (1 / Real.sqrt (η*q)) * (1 / Real.sqrt (3*(η*q)/4)) = 2 / (Real.sqrt 3 * q) := by have ht : 0 < η*q := mul_pos hη hq have hsqrt : Real.sqrt (η*q) * Real.sqrt (3*(η*q)/4) = Real.sqrt 3 * (η*q) / 2 := sqrt_product (η*q) ht.le have hne1 : Real.sqrt (η*q) ≠ 0 := ne_of_gt (Real.sqrt_pos.2 ht) have hne2 : Real.sqrt (3*(η*q)/4) ≠ 0 := by apply ne_of_gt apply Real.sqrt_pos.2 positivity have hne3 : Real.sqrt 3 ≠ 0 := ne_of_gt (Real.sqrt_pos.2 (by norm_num)) calc η * (1 / Real.sqrt (η*q)) * (1 / Real.sqrt (3*(η*q)/4)) = η / (Real.sqrt (η*q) * Real.sqrt (3*(η*q)/4)) := by ring _ = η / (Real.sqrt 3 * (η*q) / 2) := by rw [hsqrt] _ = 2 / (Real.sqrt 3 * q) := by field_simp end EisensteinGaussianPrefactor namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT Complex theorem actual_oscillatory_gaussian_coordinate (a b m n : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) (η : ℝ) : let c : O := ActualEisensteinCoordinates.eval a b let z : O := ActualEisensteinCoordinates.eval m n (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ)) = Complex.exp (-(Real.pi : ℂ) * ((η : ℂ) * ((m*m-m*n+n*n : ℤ) : ℂ) - 2 * Complex.I * (((-b*m*m+2*a*m*n+(b-a)*n*n : ℤ) : ℂ) / ((a*a-a*b+b*b : ℤ) : ℂ)))) := by dsimp only rw [quadraticTraceModChar_coordinate a b m n hc] have hnormC : ((‖eisEmbedding (ActualEisensteinCoordinates.eval m n)‖ : ℂ)^2) = ((m*m-m*n+n*n : ℤ) : ℂ) := by exact_mod_cast eisEmbedding_eval_norm_sq m n rw [hnormC] rw [← Complex.exp_add] congr 1 push_cast ring end ActualEisensteinCubic namespace EisensteinGaussianPrefactor theorem complex_eta_times_prefactor (η q : ℝ) (hη : 0 < η) (hq : 0 < q) : (η : ℂ) * (1 / ((η*q : ℝ) : ℂ) ^ (1/2 : ℂ)) * (1 / (((3*(η*q)/4 : ℝ) : ℂ) ^ (1/2 : ℂ))) = ((2 / (Real.sqrt 3 * q) : ℝ) : ℂ) := by have ht : 0 ≤ η*q := (mul_pos hη hq).le have hs : 0 ≤ 3*(η*q)/4 := by positivity have hpow1 : ((η*q : ℝ) : ℂ) ^ (1/2 : ℂ) = (Real.sqrt (η*q) : ℂ) := by calc ((η*q : ℝ) : ℂ) ^ (1/2 : ℂ) = ((η*q : ℝ) : ℂ) ^ (((1/2 : ℝ) : ℂ)) := by norm_num _ = (((η*q) ^ (1/2 : ℝ) : ℝ) : ℂ) := (Complex.ofReal_cpow ht (1/2 : ℝ)).symm _ = (Real.sqrt (η*q) : ℂ) := by rw [← Real.sqrt_eq_rpow] have hpow2 : (((3*(η*q)/4 : ℝ) : ℂ) ^ (1/2 : ℂ)) = (Real.sqrt (3*(η*q)/4) : ℂ) := by calc (((3*(η*q)/4 : ℝ) : ℂ) ^ (1/2 : ℂ)) = (((3*(η*q)/4 : ℝ) : ℂ) ^ (((1/2 : ℝ) : ℂ))) := by norm_num _ = (((3*(η*q)/4) ^ (1/2 : ℝ) : ℝ) : ℂ) := (Complex.ofReal_cpow hs (1/2 : ℝ)).symm _ = (Real.sqrt (3*(η*q)/4) : ℂ) := by rw [← Real.sqrt_eq_rpow] rw [hpow1, hpow2] exact_mod_cast eta_times_prefactor η q hη hq end EisensteinGaussianPrefactor namespace ActualEisensteinCubic end ActualEisensteinCubic namespace OscillatoryDeterminant open Complex noncomputable def r (t a b : ℂ) : ℂ := 1 + 3 * q a b * t^2 / 16 end OscillatoryDeterminant open Filter Real Asymptotics namespace RankTwoLimit section open scoped Topology open RankTwoPoisson RankTwoEisShift Filter private theorem eisQ_nonneg (z : ℤ × ℤ) : 0 ≤ RankTwoPoisson.eisQ z := by have h := RankTwoPoisson.eisQ_lower z nlinarith [sq_nonneg (z.1 : ℝ), sq_nonneg (z.2 : ℝ)] private theorem eisQ_pos {z : ℤ × ℤ} (hz : z ≠ (0,0)) : 0 < RankTwoPoisson.eisQ z := by by_cases hm : z.1 = 0 · have hn : z.2 ≠ 0 := by intro h0 exact hz (Prod.ext hm h0) have hnR : (z.2 : ℝ) ≠ 0 := by exact_mod_cast hn have h := RankTwoPoisson.eisQ_lower z nlinarith [sq_pos_of_ne_zero hnR] · have hmR : (z.1 : ℝ) ≠ 0 := by exact_mod_cast hm have h := RankTwoPoisson.eisQ_lower z nlinarith [sq_pos_of_ne_zero hmR, sq_nonneg (z.2 : ℝ)] private theorem eisGauss_norm (T : ℝ) (z : ℤ × ℤ) : ‖RankTwoPoisson.eisGauss T z‖ = Real.exp (-Real.pi * T * RankTwoPoisson.eisQ z) := by simp [RankTwoPoisson.eisGauss, Complex.norm_exp] noncomputable def dualTerm (T : ℝ) (x y : ℝ) (z : ℤ × ℤ) : ℂ := RankTwoPoisson.eisGauss T (z.1,-z.2) * RankTwoEisShift.dualPhase z.1 z.2 x y noncomputable def limitTerm (z : ℤ × ℤ) : ℂ := if z = (0,0) then 1 else 0 private theorem dualTerm_tendsto (x y : ℝ) (z : ℤ × ℤ) : Tendsto (fun T : ℝ => dualTerm T x y z) atTop (𝓝 (limitTerm z)) := by by_cases hz : z = (0,0) · subst z simp [dualTerm, limitTerm, RankTwoPoisson.eisGauss, RankTwoPoisson.eisQ, RankTwoEisShift.dualPhase] · have hz' : (z.1,-z.2) ≠ ((0,0) : ℤ × ℤ) := by intro h apply hz have h1 : z.1 = 0 := by simpa using congrArg Prod.fst h have h2 : z.2 = 0 := by simpa using congrArg Prod.snd h exact Prod.ext h1 h2 have hq := eisQ_pos hz' have hneg : -Real.pi * RankTwoPoisson.eisQ (z.1,-z.2) < 0 := by nlinarith [mul_pos Real.pi_pos hq] have harg : Tendsto (fun T : ℝ => -Real.pi * T * RankTwoPoisson.eisQ (z.1,-z.2)) atTop atBot := by convert tendsto_id.const_mul_atTop_of_neg hneg using 1 ext T simp [mul_assoc, mul_comm] have hexp : Tendsto (fun T : ℝ => Real.exp (-Real.pi * T * RankTwoPoisson.eisQ (z.1,-z.2))) atTop (𝓝 0) := Real.tendsto_exp_atBot.comp harg have hc : Tendsto (fun T : ℝ => RankTwoPoisson.eisGauss T (z.1,-z.2)) atTop (𝓝 (0 : ℂ)) := by have hh := Complex.continuous_ofReal.continuousAt.tendsto.comp hexp have heq : (fun T : ℝ => ((Real.exp (-Real.pi * T * RankTwoPoisson.eisQ (z.1,-z.2)) : ℝ) : ℂ)) = (fun T : ℝ => RankTwoPoisson.eisGauss T (z.1,-z.2)) := by funext T simp [RankTwoPoisson.eisGauss, Complex.ofReal_exp] change Tendsto (fun T : ℝ => ((Real.exp (-Real.pi * T * RankTwoPoisson.eisQ (z.1,-z.2)) : ℝ) : ℂ)) atTop (𝓝 (0 : ℂ)) at hh rw [heq] at hh exact hh simpa [dualTerm, limitTerm, hz] using hc.mul_const (RankTwoEisShift.dualPhase z.1 z.2 x y) theorem dual_sum_tendsto_one (x y : ℝ) : Tendsto (fun T : ℝ => ∑' z : ℤ × ℤ, dualTerm T x y z) atTop (𝓝 (1 : ℂ)) := by let e : ℤ × ℤ ≃ ℤ × ℤ := Equiv.prodCongr (Equiv.refl ℤ) (Equiv.neg ℤ) have hE : Summable (fun z : ℤ × ℤ => RankTwoPoisson.eisGauss 1 (z.1,-z.2)) := (e.summable_iff).2 (RankTwoPoisson.eis_gauss_summable (by norm_num)) have hbound : ∀ᶠ T : ℝ in atTop, ∀ z : ℤ × ℤ, ‖dualTerm T x y z‖ ≤ ‖RankTwoPoisson.eisGauss 1 (z.1,-z.2)‖ := by filter_upwards [eventually_ge_atTop (1 : ℝ)] with T hT z rw [dualTerm, norm_mul, RankTwoEisShift.dualPhase_norm, mul_one, eisGauss_norm, eisGauss_norm] have hq := eisQ_nonneg (z.1,-z.2) have hpq : 0 ≤ Real.pi * RankTwoPoisson.eisQ (z.1,-z.2) := mul_nonneg Real.pi_pos.le hq have hm := mul_le_mul_of_nonneg_right hT hpq apply Real.exp_le_exp.mpr nlinarith [hm] have h := tendsto_tsum_of_dominated_convergence hE.norm (dualTerm_tendsto x y) hbound simpa [limitTerm] using h end open scoped Topology open Filter theorem dual_sum_tendsto_one_small_t (x y : ℝ) : Tendsto (fun t : ℝ => ∑' z : ℤ × ℤ, dualTerm (4 / (3 * t)) x y z) (𝓝[>] (0 : ℝ)) (𝓝 (1 : ℂ)) := by have hT : Tendsto (fun t : ℝ => (4 / 3 : ℝ) * t⁻¹) (𝓝[>] (0 : ℝ)) atTop := (tendsto_const_mul_atTop_of_pos (by norm_num : (0 : ℝ) < 4 / 3)).2 tendsto_inv_nhdsGT_zero have h := (dual_sum_tendsto_one x y).comp hT simpa [Function.comp_def, div_eq_mul_inv, mul_inv_rev, mul_assoc, mul_comm, mul_left_comm] using h end RankTwoLimit end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.GaussianFiberMass namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT Complex theorem breveE_real_trace_div (r : ℝ) (u v : ℤ) : ShortDraftTrace.breveE ((((u : ℂ) + (v : ℂ) * omega3) / eisLam) / (r : ℂ)) = Complex.exp (2 * Real.pi * Complex.I * (v : ℂ) / (r : ℂ)) := by have htrace := ShortDraftTrace.trace_div_lam omega3 omega3_sq ShortDraftTrace.omega_conj u v have hL : ((u : ℂ) + (v : ℂ) * omega3) / eisLam + star (((u : ℂ) + (v : ℂ) * omega3) / eisLam) = (v : ℂ) := by simpa only [eisLam, Complex.star_def] using htrace change Complex.exp (2 * Real.pi * Complex.I * (((((u : ℂ) + (v : ℂ) * omega3) / eisLam) / (r : ℂ)) + star (((((u : ℂ) + (v : ℂ) * omega3) / eisLam) / (r : ℂ))))) = _ rw [show star (((u : ℂ) + (v : ℂ) * omega3) / eisLam / (r : ℂ)) = star (((u : ℂ) + (v : ℂ) * omega3) / eisLam) / (r : ℂ) by simp] rw [← add_div, hL] congr 1 ring theorem breveE_real_trace_of_O (r : ℝ) (z : O) : ShortDraftTrace.breveE (eisEmbedding z / eisLam / (r : ℂ)) = Complex.exp (2 * Real.pi * Complex.I * ((ActualEisensteinCoordinates.coords z).2 : ℂ) / (r : ℂ)) := by rw [← ActualEisensteinCoordinates.eval_coords z] rw [eisEmbedding_eval] simp only [ShortDraftLatticeCount.coords_eval] exact breveE_real_trace_div r _ _ end ActualEisensteinCubic namespace SqrtBranch open Complex private theorem arg_ne_pi_of_re_pos {a : ℂ} (ha : 0 < a.re) : a.arg ≠ Real.pi := by intro h have := (Complex.arg_eq_pi_iff.mp h).1 linarith theorem cpow_half_product {a : ℂ} {r : ℝ} (ha : 0 < a.re) (hr : 0 < r) : a ^ (1 / 2 : ℂ) * (((r : ℂ) / a) ^ (1 / 2 : ℂ)) = (r : ℂ) ^ (1 / 2 : ℂ) := by have ha0 : a ≠ 0 := by intro h simp [h] at ha have harg := arg_ne_pi_of_re_pos ha have hlog : Complex.log ((r : ℂ) / a) = (Real.log r : ℂ) - Complex.log a := by rw [div_eq_mul_inv, Complex.log_ofReal_mul hr (inv_ne_zero ha0), Complex.log_inv a harg] ring have hr0 : (r : ℂ) ≠ 0 := by exact_mod_cast hr.ne' have hdiv : (r : ℂ) / a ≠ 0 := div_ne_zero hr0 ha0 rw [Complex.cpow_def_of_ne_zero ha0, Complex.cpow_def_of_ne_zero hdiv, Complex.cpow_def_of_ne_zero hr0, hlog, ← Complex.exp_add] congr 1 rw [Complex.ofReal_log hr.le] ring theorem prefactor_product {a : ℂ} {r : ℝ} (ha : 0 < a.re) (hr : 0 < r) : (1 / a ^ (1 / 2 : ℂ)) * (1 / (((r : ℂ) / a) ^ (1 / 2 : ℂ))) = 1 / ((r : ℂ) ^ (1 / 2 : ℂ)) := by simpa [div_eq_mul_inv, mul_inv_rev, mul_comm] using congrArg (fun z : ℂ => z⁻¹) (cpow_half_product ha hr) end SqrtBranch namespace PowerExtraction end PowerExtraction namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT Complex theorem actual_fiber_gaussian_eq_shifted (a b x y m n : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) (η : ℝ) : Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding (ActualEisensteinCoordinates.eval x y + ActualEisensteinCoordinates.eval a b * ActualEisensteinCoordinates.eval m n)‖ ^ 2 : ℂ)) = RankTwoEisShift.shifted (η * ((a*a-a*b+b*b : ℤ) : ℝ)) (EisensteinFiberShift.shiftX (a : ℝ) (b : ℝ) (x : ℝ) (y : ℝ)) (EisensteinFiberShift.shiftY (a : ℝ) (b : ℝ) (x : ℝ) (y : ℝ)) (m,n) := by have hqZ : a*a-a*b+b*b ≠ 0 := ne_of_gt (coordinate_norm_pos_of_nonzero a b hc) have hqR : EisensteinFiberShift.q (a : ℝ) (b : ℝ) ≠ 0 := by dsimp [EisensteinFiberShift.q, EisensteinFiberShift.Q] exact_mod_cast hqZ have hshift := EisensteinFiberShift.exact_shift (a : ℝ) (b : ℝ) (x : ℝ) (y : ℝ) (m : ℝ) (n : ℝ) hqR have hnormC : ((‖eisEmbedding (ActualEisensteinCoordinates.eval x y + ActualEisensteinCoordinates.eval a b * ActualEisensteinCoordinates.eval m n)‖ : ℂ)^2) = (((a*a-a*b+b*b)*(m*m-m*n+n*n) + ((2*a-b)*x+(2*b-a)*y)*m + (-(a+b)*x+(2*a-b)*y)*n + (x*x-x*y+y*y) : ℤ) : ℂ) := by exact_mod_cast eisEmbedding_fiber_norm_sq a b x y m n rw [hnormC] dsimp [RankTwoEisShift.shifted, RankTwoEisShift.Q] congr 1 dsimp [EisensteinFiberShift.Q, EisensteinFiberShift.q] at hshift have hshiftC := congrArg (fun v : ℝ => (v : ℂ)) hshift push_cast at hshiftC ⊢ linear_combination -(Real.pi : ℂ) * (η : ℂ) * hshiftC end ActualEisensteinCubic namespace EisensteinAbelFiber open scoped Topology open Filter theorem shifted_gaussian_mass (x y : ℝ) : Tendsto (fun t : ℝ => (t : ℂ) * (∑' z : ℤ × ℤ, RankTwoEisShift.shifted t x y z)) (𝓝[>] (0 : ℝ)) (𝓝 (((2 / Real.sqrt 3 : ℝ) : ℂ))) := by have hpoint (t : ℝ) (ht : 0 < t) : (t : ℂ) * (∑' z : ℤ × ℤ, RankTwoEisShift.shifted t x y z) = ((2 / Real.sqrt 3 : ℝ) : ℂ) * (∑' z : ℤ × ℤ, RankTwoLimit.dualTerm (4 / (3 * t)) x y z) := by rw [RankTwoEisShift.shifted_eisenstein_gaussian_poisson ht x y] have hpre := EisensteinGaussianPrefactor.complex_eta_times_prefactor t 1 ht (by norm_num) simp only [mul_one] at hpre change (t : ℂ) * ((1 / (t : ℂ) ^ (1 / 2 : ℂ)) * (1 / (((3 * t / 4 : ℝ) : ℂ) ^ (1 / 2 : ℂ))) * (∑' z : ℤ × ℤ, RankTwoLimit.dualTerm (4 / (3 * t)) x y z)) = _ calc (t : ℂ) * ((1 / (t : ℂ) ^ (1 / 2 : ℂ)) * (1 / (((3 * t / 4 : ℝ) : ℂ) ^ (1 / 2 : ℂ))) * (∑' z : ℤ × ℤ, RankTwoLimit.dualTerm (4 / (3 * t)) x y z)) = (((t : ℂ) * (1 / (t : ℂ) ^ (1 / 2 : ℂ))) * (1 / (((3 * t / 4 : ℝ) : ℂ) ^ (1 / 2 : ℂ)))) * (∑' z : ℤ × ℤ, RankTwoLimit.dualTerm (4 / (3 * t)) x y z) := by ring _ = _ := by rw [hpre] have hlim := (RankTwoLimit.dual_sum_tendsto_one_small_t x y).const_mul (((2 / Real.sqrt 3 : ℝ) : ℂ)) have heq : (fun t : ℝ => (t : ℂ) * (∑' z : ℤ × ℤ, RankTwoEisShift.shifted t x y z)) =ᶠ[𝓝[>] (0 : ℝ)] (fun t : ℝ => ((2 / Real.sqrt 3 : ℝ) : ℂ) * (∑' z : ℤ × ℤ, RankTwoLimit.dualTerm (4 / (3 * t)) x y z)) := by filter_upwards [self_mem_nhdsWithin] with t ht exact hpoint t ht simpa using hlim.congr' heq.symm theorem scaled_shifted_gaussian_mass (q : ℝ) (hq : 0 < q) (x y : ℝ) : Tendsto (fun η : ℝ => (η : ℂ) * (∑' z : ℤ × ℤ, RankTwoEisShift.shifted (η*q) x y z)) (𝓝[>] (0 : ℝ)) (𝓝 (((2 / (Real.sqrt 3 * q) : ℝ) : ℂ))) := by have hscale : Tendsto (fun η : ℝ => η*q) (𝓝[>] (0 : ℝ)) (𝓝[>] (0 : ℝ)) := by apply tendsto_nhdsWithin_iff.mpr constructor · have hid : Tendsto (fun η : ℝ => η) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := tendsto_id.mono_right nhdsWithin_le_nhds simpa using hid.mul_const q · filter_upwards [self_mem_nhdsWithin] with η hη exact mul_pos hη hq have hlim := (shifted_gaussian_mass x y).comp hscale have hqC : (q : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt hq have hlim' := hlim.const_mul (1 / (q : ℂ)) convert hlim' using 1 · funext η dsimp push_cast field_simp [hqC] · push_cast field_simp [hqC] end EisensteinAbelFiber namespace ActualEisensteinCubic section open scoped Topology open Filter EisensteinEmbedding ConcreteTraceCRT Complex theorem actual_fiber_gaussian_mass (a b x y : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) : Tendsto (fun η : ℝ => (η : ℂ) * (∑' z : ℤ × ℤ, Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding (ActualEisensteinCoordinates.eval x y + ActualEisensteinCoordinates.eval a b * ActualEisensteinCoordinates.eval z.1 z.2)‖ ^ 2 : ℂ)))) (𝓝[>] (0 : ℝ)) (𝓝 (((2 / (Real.sqrt 3 * (((a*a-a*b+b*b : ℤ) : ℝ))) : ℝ) : ℂ))) := by have hq : 0 < (((a*a-a*b+b*b : ℤ) : ℝ)) := by exact_mod_cast coordinate_norm_pos_of_nonzero a b hc let u := EisensteinFiberShift.shiftX (a : ℝ) (b : ℝ) (x : ℝ) (y : ℝ) let v := EisensteinFiberShift.shiftY (a : ℝ) (b : ℝ) (x : ℝ) (y : ℝ) have h := EisensteinAbelFiber.scaled_shifted_gaussian_mass (((a*a-a*b+b*b : ℤ) : ℝ)) hq u v convert h using 1 funext η congr 1 apply tsum_congr intro z exact actual_fiber_gaussian_eq_shifted a b x y z.1 z.2 hc η end section open EisensteinEmbedding ConcreteTraceCRT Complex def latticeCoordEquiv : O ≃ ℤ × ℤ where toFun := ActualEisensteinCoordinates.coords invFun z := ActualEisensteinCoordinates.eval z.1 z.2 left_inv := ActualEisensteinCoordinates.eval_coords right_inv z := ShortDraftLatticeCount.coords_eval z.1 z.2 theorem eis_gaussian_summable {η : ℝ} (hη : 0 < η) : Summable (fun z : O => Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ))) := by have hbase := RankTwoPoisson.eis_gauss_summable hη have hcomp : Summable (fun z : O => RankTwoPoisson.eisGauss η (latticeCoordEquiv z)) := (latticeCoordEquiv.summable_iff).2 hbase convert hcomp using 1 funext z let p := ActualEisensteinCoordinates.coords z have hz : z = ActualEisensteinCoordinates.eval p.1 p.2 := (ActualEisensteinCoordinates.eval_coords z).symm rw [hz] have hnormC : ((‖eisEmbedding (ActualEisensteinCoordinates.eval p.1 p.2)‖ : ℂ)^2) = ((p.1*p.1-p.1*p.2+p.2*p.2 : ℤ) : ℂ) := by exact_mod_cast eisEmbedding_eval_norm_sq p.1 p.2 rw [hnormC] change _ = RankTwoPoisson.eisGauss η (ActualEisensteinCoordinates.coords (ActualEisensteinCoordinates.eval p.1 p.2)) rw [ShortDraftLatticeCount.coords_eval] dsimp [RankTwoPoisson.eisGauss, RankTwoPoisson.eisQ] congr 1 push_cast ring theorem actual_oscillatory_kernel_summable (c : O) (hc : c ≠ 0) {η : ℝ} (hη : 0 < η) : Summable (fun z : O => (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ))) := by let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc have hbase := (eis_gaussian_summable hη).norm apply hbase.of_norm_bounded intro z simp only [norm_mul] rw [AddChar.norm_apply] simp end end ActualEisensteinCubic namespace GaussianPhasePointwise theorem exp_imag_diff_le (u v : ℝ) : ‖Complex.exp (Complex.I * (u : ℂ)) - Complex.exp (Complex.I * (v : ℂ))‖ ≤ |u - v| := by have heq : Complex.exp (Complex.I * (u : ℂ)) - Complex.exp (Complex.I * (v : ℂ)) = (Complex.exp (Complex.I * ((u - v : ℝ) : ℂ)) - 1) * Complex.exp (Complex.I * (v : ℂ)) := by rw [sub_mul, one_mul, ← Complex.exp_add] congr 1 push_cast ring_nf rw [heq, norm_mul, Complex.norm_exp_I_mul_ofReal, mul_one] simpa only [Real.norm_eq_abs] using (Real.norm_exp_I_mul_ofReal_sub_one_le (x := u - v)) theorem exp_imag_denominator_error (θ A η : ℝ) (hA : 0 ≤ A) : ‖Complex.exp (Complex.I * ((θ / (1 + A * η ^ 2) : ℝ) : ℂ)) - Complex.exp (Complex.I * (θ : ℂ))‖ ≤ |θ| * (A * η ^ 2) := by let r : ℝ := 1 + A * η ^ 2 have hAη : 0 ≤ A * η ^ 2 := mul_nonneg hA (sq_nonneg _) have hr : 1 ≤ r := by dsimp [r]; linarith have hrpos : 0 < r := lt_of_lt_of_le zero_lt_one hr have hdiff : |θ / r - θ| = |θ| * ((r - 1) / r) := by have heq : θ / r - θ = -θ * ((r - 1) / r) := by field_simp ring rw [heq, abs_mul, abs_neg, abs_of_nonneg (div_nonneg (by linarith) hrpos.le)] have hfrac : (r - 1) / r ≤ r - 1 := by apply (div_le_iff₀ hrpos).mpr nlinarith [mul_nonneg (sub_nonneg.mpr hr) (sub_nonneg.mpr hr)] have hbound := exp_imag_diff_le (θ / r) θ dsimp [r] at hbound ⊢ calc ‖Complex.exp (Complex.I * ((θ / (1 + A * η ^ 2) : ℝ) : ℂ)) - Complex.exp (Complex.I * (θ : ℂ))‖ ≤ |θ / (1 + A * η ^ 2) - θ| := hbound _ = |θ| * (((1 + A * η ^ 2) - 1) / (1 + A * η ^ 2)) := hdiff _ ≤ |θ| * (A * η ^ 2) := by have hfrac' := hfrac dsimp [r] at hfrac' nlinarith [mul_nonneg (abs_nonneg θ) (sub_nonneg.mpr hfrac')] end GaussianPhasePointwise namespace ActualEisensteinCubic open scoped Topology open Filter EisensteinEmbedding ConcreteTraceCRT Complex theorem actual_O_fiber_gaussian_mass (c r : O) (hc : c ≠ 0) : let a := (ActualEisensteinCoordinates.coords c).1 let b := (ActualEisensteinCoordinates.coords c).2 Tendsto (fun η : ℝ => (η : ℂ) * (∑' w : O, Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding (r+c*w)‖ ^ 2 : ℂ)))) (𝓝[>] (0 : ℝ)) (𝓝 (((2 / (Real.sqrt 3 * (((a*a-a*b+b*b : ℤ) : ℝ))) : ℝ) : ℂ))) := by dsimp only let a := (ActualEisensteinCoordinates.coords c).1 let b := (ActualEisensteinCoordinates.coords c).2 let x := (ActualEisensteinCoordinates.coords r).1 let y := (ActualEisensteinCoordinates.coords r).2 have hceq : c = ActualEisensteinCoordinates.eval a b := (ActualEisensteinCoordinates.eval_coords c).symm have hreq : r = ActualEisensteinCoordinates.eval x y := (ActualEisensteinCoordinates.eval_coords r).symm have hcE : ActualEisensteinCoordinates.eval a b ≠ 0 := by rw [← hceq] exact hc have hmass := actual_fiber_gaussian_mass a b x y hcE convert hmass using 1 funext η congr 1 let W : O → ℂ := fun w => Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding (r+c*w)‖ ^ 2 : ℂ)) have hsum := (latticeCoordEquiv.symm.tsum_eq W).symm have happly (z : ℤ × ℤ) : latticeCoordEquiv.symm z = ActualEisensteinCoordinates.eval z.1 z.2 := rfl simpa only [W, hceq, hreq, happly] using hsum theorem original_abel_gauss_limit (c : O) (hc : c ≠ 0) : letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let a := (ActualEisensteinCoordinates.coords c).1 let b := (ActualEisensteinCoordinates.coords c).2 let K : ℂ := ((2 / (Real.sqrt 3 * (((a*a-a*b+b*b : ℤ) : ℝ))) : ℝ) : ℂ) Tendsto (fun η : ℝ => (η : ℂ) * (∑' z : O, (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ)))) (𝓝[>] (0 : ℝ)) (𝓝 (K * ∑ r : O ⧸ Ideal.span {c}, (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (r ^ 2))) := by let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let a := (ActualEisensteinCoordinates.coords c).1 let b := (ActualEisensteinCoordinates.coords c).2 let K : ℂ := ((2 / (Real.sqrt 3 * (((a*a-a*b+b*b : ℤ) : ℝ))) : ℝ) : ℂ) let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc let W (η : ℝ) (z : O) := Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ)) have hfiber (r : O ⧸ Ideal.span {c}) : Tendsto (fun η : ℝ => (η : ℂ) * (∑' w : O, W η (GaussianShiftedPartition.representative c r + c*w))) (𝓝[>] (0 : ℝ)) (𝓝 K) := by simpa only [K, a, b, W] using actual_O_fiber_gaussian_mass c (GaussianShiftedPartition.representative c r) hc have hsum : Tendsto (fun η : ℝ => ∑ r : O ⧸ Ideal.span {c}, ψ (r ^ 2) * ((η : ℂ) * (∑' w : O, W η (GaussianShiftedPartition.representative c r + c*w)))) (𝓝[>] (0 : ℝ)) (𝓝 (∑ r : O ⧸ Ideal.span {c}, ψ (r ^ 2) * K)) := by apply tendsto_finsetSum Finset.univ intro r hr exact (hfiber r).const_mul (ψ (r ^ 2)) have hpoint (η : ℝ) (hη : 0 < η) : (η : ℂ) * (∑' z : O, ψ (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * W η z) = ∑ r : O ⧸ Ideal.span {c}, ψ (r ^ 2) * ((η : ℂ) * (∑' w : O, W η (GaussianShiftedPartition.representative c r + c*w))) := by have hpart := GaussianShiftedPartition.actual_quadratic_shifted_partition c hc (W η) (actual_oscillatory_kernel_summable c hc hη) change (∑' z : O, ψ (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * W η z) = ∑ r : O ⧸ Ideal.span {c}, ψ (r ^ 2) * ∑' w : O, W η (GaussianShiftedPartition.representative c r + c*w) at hpart rw [hpart, Finset.mul_sum] apply Finset.sum_congr rfl intro r hr ring have heq : (fun η : ℝ => (η : ℂ) * (∑' z : O, ψ (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * W η z)) =ᶠ[ 𝓝[>] (0 : ℝ)] (fun η : ℝ => ∑ r : O ⧸ Ideal.span {c}, ψ (r ^ 2) * ((η : ℂ) * (∑' w : O, W η (GaussianShiftedPartition.representative c r + c*w)))) := by filter_upwards [self_mem_nhdsWithin] with η hη exact hpoint η hη have hlim := hsum.congr' heq.symm simpa only [K, ψ, W, Finset.mul_sum, mul_comm] using hlim end ActualEisensteinCubic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Poisson.GaussianMoments namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics namespace GaussianMoment theorem x_exp_neg_le (x : ℝ) (_hx : 0 ≤ x) : x * Real.exp (-x) ≤ 2 * Real.exp (-(x / 2)) := by have hlin : x / 2 ≤ Real.exp (x / 2) := by have h := Real.add_one_le_exp (x / 2) linarith have hmul := mul_le_mul_of_nonneg_right hlin (Real.exp_pos (-x)).le calc x * Real.exp (-x) = 2 * ((x / 2) * Real.exp (-x)) := by ring _ ≤ 2 * (Real.exp (x / 2) * Real.exp (-x)) := by gcongr _ = 2 * Real.exp (-(x / 2)) := by rw [← Real.exp_add] congr 1 ring_nf theorem gaussian_moment_term_bound (q t : ℝ) (hq : 0 ≤ q) (ht : 0 < t) : q * Real.exp (-t * q) ≤ (2 / t) * Real.exp (-(t * q / 2)) := by have h := x_exp_neg_le (t * q) (mul_nonneg ht.le hq) have hpos : 0 ≤ t := ht.le calc q * Real.exp (-t * q) = ((t * q) * Real.exp (-(t * q))) / t := by field_simp _ ≤ (2 * Real.exp (-(t * q / 2))) / t := div_le_div_of_nonneg_right h hpos _ = (2 / t) * Real.exp (-(t * q / 2)) := by ring end GaussianMoment namespace ActualEisensteinCubic section open ShortDraftLatticeCount theorem rational_qNat (r : ℕ) (hr : r ≠ 0) : qNat (r : O) = r ^ 2 := by calc qNat (r : O) = Ideal.absNorm (Ideal.span {(r : O)}) := qNat_eq_absNorm_span _ _ = Nat.card (O ⧸ Ideal.span {(r : O)}) := by rw [Ideal.absNorm_apply, Submodule.cardQuot_apply] _ = r ^ 2 := rational_modulus_card r hr theorem rational_qNat_eq_one_iff (x : O) : qNat x = 1 ↔ IsUnit x := by rw [qNat_eq_absNorm_span, Ideal.absNorm_eq_one_iff, Ideal.span_singleton_eq_top] theorem rational_prime_factor_cases (r : ℕ) (hr : r.Prime) : (Ideal.span {(r : O)} : Ideal O).IsMaximal ∨ ∃ a b : O, a ≠ 0 ∧ b ≠ 0 ∧ (r : O) = a * b ∧ qNat a = r ∧ qNat b = r ∧ (Ideal.span {a} : Ideal O).IsMaximal ∧ (Ideal.span {b} : Ideal O).IsMaximal := by let : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ let : IsPrincipalIdealRing O := IsCyclotomicExtension.Rat.three_pid K have hru : ¬ IsUnit (r : O) := by rw [← rational_qNat_eq_one_iff, rational_qNat r hr.ne_zero] have htwo := hr.two_le nlinarith rcases irreducible_or_factor hru with hirr | ⟨a, b, hna, hnb, hab⟩ · left exact PrincipalIdealRing.isMaximal_of_irreducible hirr · right have hqa1 : qNat a ≠ 1 := by intro h exact hna ((rational_qNat_eq_one_iff a).mp h) have hqb1 : qNat b ≠ 1 := by intro h exact hnb ((rational_qNat_eq_one_iff b).mp h) have hqprod : qNat a * qNat b = r ^ 2 := by rw [← qNat_mul, ← hab, rational_qNat r hr.ne_zero] obtain ⟨hqa, hqb⟩ := (hr.mul_eq_prime_sq_iff hqa1 hqb1).mp hqprod have ha0 : a ≠ 0 := by intro h have hqa0 : qNat a = 0 := by simp [h, qNat_eq_absNorm_span] rw [hqa] at hqa0 exact hr.ne_zero hqa0 have hb0 : b ≠ 0 := by intro h have hqb0 : qNat b = 0 := by simp [h, qNat_eq_absNorm_span] rw [hqb] at hqb0 exact hr.ne_zero hqb0 have hpa : Prime a := by apply Ideal.prime_of_irreducible_absNorm_span ha0 rw [← qNat_eq_absNorm_span, hqa] exact hr.prime.irreducible have hpb : Prime b := by apply Ideal.prime_of_irreducible_absNorm_span hb0 rw [← qNat_eq_absNorm_span, hqb] exact hr.prime.irreducible exact ⟨a, b, ha0, hb0, hab, hqa, hqb, PrincipalIdealRing.isMaximal_of_irreducible hpa.irreducible, PrincipalIdealRing.isMaximal_of_irreducible hpb.irreducible⟩ theorem maximal_ideal_eq_span_of_mem (Q : Ideal O) (hQ : Q.IsMaximal) (a : O) (ha : (Ideal.span {a} : Ideal O).IsMaximal) (hamem : a ∈ Q) : Q = Ideal.span {a} := by have hle : (Ideal.span {a} : Ideal O) ≤ Q := (Ideal.span_singleton_le_iff_mem _).mpr hamem exact (ha.eq_of_le hQ.ne_top hle).symm theorem rational_prime_ideal_cover (r : ℕ) (hr : r.Prime) : ∃ a b : O, a ≠ 0 ∧ b ≠ 0 ∧ r ≤ qNat a ∧ r ≤ qNat b ∧ ∀ (Q : Ideal O), Q.IsMaximal → (r : O) ∈ Q → Q = Ideal.span {a} ∨ Q = Ideal.span {b} := by rcases rational_prime_factor_cases r hr with hmax | ⟨a, b, ha0, hb0, hab, hqa, hqb, hma, hmb⟩ · have hr0 : (r : O) ≠ 0 := by exact_mod_cast hr.ne_zero have hq : qNat (r : O) = r ^ 2 := rational_qNat r hr.ne_zero have hrle : r ≤ r ^ 2 := by nlinarith [hr.two_le] refine ⟨(r : O), (r : O), hr0, hr0, ?_, ?_, ?_⟩ · rw [hq]; exact hrle · rw [hq]; exact hrle · intro Q hQ hrQ exact Or.inl (maximal_ideal_eq_span_of_mem Q hQ (r : O) hmax hrQ) · refine ⟨a, b, ha0, hb0, ?_, ?_, ?_⟩ · rw [hqa] · rw [hqb] · intro Q hQ hrQ rw [hab] at hrQ rcases hQ.isPrime.mem_or_mem hrQ with haQ | hbQ · exact Or.inl (maximal_ideal_eq_span_of_mem Q hQ a hma haQ) · exact Or.inr (maximal_ideal_eq_span_of_mem Q hQ b hmb hbQ) end end ActualEisensteinCubic open ActualEisensteinCubic namespace RationalPrimeExtraction noncomputable def selected (Y : ℝ) : Finset ℕ := (Finset.Ioc ⌊Y / 3⌋₊ ⌊Y⌋₊).filter Nat.Prime end RationalPrimeExtraction namespace OscSpecial private theorem real_quadratic_lower {u v w : ℝ} (hu : 0 < u) (hv : 0 < v) (_hdet : 0 < u * v - w ^ 2) (x y : ℝ) : ((u * v - w ^ 2) / (u + v)) * (x ^ 2 + y ^ 2) ≤ u * x ^ 2 - 2 * w * x * y + v * y ^ 2 := by have hsum : 0 < u + v := add_pos hu hv have hid : (u + v) * (u * x ^ 2 - 2 * w * x * y + v * y ^ 2) - (u * v - w ^ 2) * (x ^ 2 + y ^ 2) = (u * x - w * y) ^ 2 + (w * x - v * y) ^ 2 := by ring have hsq := add_nonneg (sq_nonneg (u * x - w * y)) (sq_nonneg (w * x - v * y)) have hnum : (u * v - w ^ 2) * (x ^ 2 + y ^ 2) ≤ (u + v) * (u * x ^ 2 - 2 * w * x * y + v * y ^ 2) := by linarith have h : ((u * v - w ^ 2) * (x ^ 2 + y ^ 2)) / (u + v) ≤ u * x ^ 2 - 2 * w * x * y + v * y ^ 2 := (div_le_iff₀ hsum).2 (by simpa only [mul_comm] using hnum) simpa only [div_mul_eq_mul_div] using h private theorem schur_eq_real_det_div {a b d : ℂ} {R : ℝ} (ha : a ≠ 0) (hdet : a * d - b ^ 2 = (R : ℂ)) : RankTwoComplex.schur a b d = (R : ℂ) / a := by unfold RankTwoComplex.schur rw [← hdet] field_simp [ha] private theorem determinant_real_components {a b d : ℂ} {R : ℝ} (hdet : a * d - b ^ 2 = (R : ℂ)) : a.re * d.re - a.im * d.im - b.re ^ 2 + b.im ^ 2 = R ∧ a.re * d.im + a.im * d.re - 2 * b.re * b.im = 0 := by constructor · have h := congrArg Complex.re hdet simp only [Complex.sub_re, Complex.mul_re, Complex.ofReal_re] at h have hb : (b ^ 2).re = b.re ^ 2 - b.im ^ 2 := by rw [pow_two, Complex.mul_re] ring rw [hb] at h linarith · have h := congrArg Complex.im hdet simp only [Complex.sub_im, Complex.mul_im, Complex.ofReal_im] at h have hb : (b ^ 2).im = 2 * b.re * b.im := by rw [pow_two, Complex.mul_im] ring rw [hb] at h linarith private theorem first_real_coefficients {a b d : ℂ} {R : ℝ} (ha : a ≠ 0) (hdet : a * d - b ^ 2 = (R : ℂ)) : (a⁻¹).re = a.re / Complex.normSq a ∧ (RankTwoComplex.schur a b d).re = R * a.re / Complex.normSq a ∧ (Complex.I * b / a).re = (b.re * a.im - b.im * a.re) / Complex.normSq a := by constructor · exact Complex.inv_re a constructor · rw [schur_eq_real_det_div ha hdet] simp [Complex.div_re] · rw [Complex.div_re] simp [Complex.mul_re, Complex.mul_im] ring private theorem first_real_determinant {a b d : ℂ} {R : ℝ} (ha : a ≠ 0) (hdet : a * d - b ^ 2 = (R : ℂ)) : (a.re / Complex.normSq a) * (R * a.re / Complex.normSq a) - ((b.re * a.im - b.im * a.re) / Complex.normSq a) ^ 2 = (a.re * d.re - b.re ^ 2) / Complex.normSq a := by have hN : Complex.normSq a ≠ 0 := (Complex.normSq_pos.mpr ha).ne' obtain ⟨hr, hi⟩ := determinant_real_components hdet have hid : R * a.re ^ 2 - (b.re * a.im - b.im * a.re) ^ 2 = (a.re ^ 2 + a.im ^ 2) * (a.re * d.re - b.re ^ 2) - a.im * a.re * (a.re * d.im + a.im * d.re - 2 * b.re * b.im) := by rw [← hr] ring rw [hi, mul_zero, sub_zero] at hid simp only [Complex.normSq_apply] at hN ⊢ have hN' : a.re ^ 2 + a.im ^ 2 ≠ 0 := by simpa [pow_two] using hN field_simp [hN'] nlinarith [hid] private noncomputable def middleForm (a b d : ℂ) (z : ℤ × ℤ) : ℂ := a⁻¹ * (z.1 : ℂ) ^ 2 - 2 * (Complex.I * b / a) * (z.1 : ℂ) * (z.2 : ℂ) + RankTwoComplex.schur a b d * (z.2 : ℂ) ^ 2 private theorem middleForm_real (a b d : ℂ) (z : ℤ × ℤ) : (middleForm a b d z).re = (a⁻¹).re * (z.1 : ℝ) ^ 2 - 2 * (Complex.I * b / a).re * (z.1 : ℝ) * (z.2 : ℝ) + (RankTwoComplex.schur a b d).re * (z.2 : ℝ) ^ 2 := by simp [middleForm, Complex.add_re, Complex.sub_re, Complex.mul_re, pow_two] private theorem middleForm_exp (a b d : ℂ) (z : ℤ × ℤ) : RankTwoComplex.firstGaussian a b d z = Complex.exp (-(Real.pi : ℂ) * middleForm a b d z) := by simp only [RankTwoComplex.firstGaussian, middleForm] rw [← Complex.exp_add] congr 1 simp [div_eq_mul_inv] ring private theorem firstGaussian_summable {a b d : ℂ} {R : ℝ} (ha : 0 < a.re) (hR : 0 < R) (hdet : a * d - b ^ 2 = (R : ℂ)) (hpd : 0 < a.re * d.re - b.re ^ 2) : Summable (RankTwoComplex.firstGaussian a b d) := by have ha0 : a ≠ 0 := by intro h simp [h] at ha have hN : 0 < Complex.normSq a := Complex.normSq_pos.mpr ha0 let u : ℝ := a.re / Complex.normSq a let v : ℝ := R * a.re / Complex.normSq a let w : ℝ := (b.re * a.im - b.im * a.re) / Complex.normSq a have hu : 0 < u := div_pos ha hN have hv : 0 < v := div_pos (mul_pos hR ha) hN have hq : 0 < u * v - w ^ 2 := by dsimp [u, v, w] rw [first_real_determinant ha0 hdet] exact div_pos hpd hN let eps : ℝ := (u * v - w ^ 2) / (u + v) have heps : 0 < eps := div_pos hq (add_pos hu hv) have hcoeff := first_real_coefficients ha0 hdet have hbound (z : ℤ × ℤ) : eps * ((z.1 : ℝ) ^ 2 + (z.2 : ℝ) ^ 2) ≤ (middleForm a b d z).re := by rw [middleForm_real, hcoeff.1, hcoeff.2.1, hcoeff.2.2] exact real_quadratic_lower hu hv hq (z.1 : ℝ) (z.2 : ℝ) exact (RankTwoComplex.lattice_gaussian_summable_of_re_bound (middleForm a b d) heps hbound).congr (fun z => (middleForm_exp a b d z).symm) private noncomputable def originalForm (a b d : ℂ) (z : ℤ × ℤ) : ℂ := a * (z.1 : ℂ) ^ 2 + 2 * b * (z.1 : ℂ) * (z.2 : ℂ) + d * (z.2 : ℂ) ^ 2 private theorem originalForm_real (a b d : ℂ) (z : ℤ × ℤ) : (originalForm a b d z).re = a.re * (z.1 : ℝ) ^ 2 + 2 * b.re * (z.1 : ℝ) * (z.2 : ℝ) + d.re * (z.2 : ℝ) ^ 2 := by simp [originalForm, Complex.add_re, Complex.mul_re, pow_two] private theorem originalGaussian_summable {a b d : ℂ} (ha : 0 < a.re) (hpd : 0 < a.re * d.re - b.re ^ 2) : Summable (RankTwoComplex.binaryGaussian a b d) := by have hd : 0 < d.re := by by_contra h have h' : d.re ≤ 0 := le_of_not_gt h have hm := mul_nonpos_of_nonneg_of_nonpos ha.le h' nlinarith [sq_nonneg b.re] let eps : ℝ := (a.re * d.re - b.re ^ 2) / (a.re + d.re) have heps : 0 < eps := div_pos hpd (add_pos ha hd) have hbound (z : ℤ × ℤ) : eps * ((z.1 : ℝ) ^ 2 + (z.2 : ℝ) ^ 2) ≤ (originalForm a b d z).re := by rw [originalForm_real] dsimp [eps] convert real_quadratic_lower (w := -b.re) ha hd (by simpa using hpd) (z.1 : ℝ) (z.2 : ℝ) using 1 <;> ring exact (RankTwoComplex.lattice_gaussian_summable_of_re_bound (originalForm a b d) heps hbound).congr (fun z => by rfl) noncomputable def inverseForm (a b d : ℂ) (R : ℝ) (z : ℤ × ℤ) : ℂ := (d * (z.1 : ℂ) ^ 2 - 2 * b * (z.1 : ℂ) * (z.2 : ℂ) + a * (z.2 : ℂ) ^ 2) / (R : ℂ) private theorem inverseForm_real (a b d : ℂ) {R : ℝ} (hR : R ≠ 0) (z : ℤ × ℤ) : (inverseForm a b d R z).re = (d.re * (z.1 : ℝ) ^ 2 - 2 * b.re * (z.1 : ℝ) * (z.2 : ℝ) + a.re * (z.2 : ℝ) ^ 2) / R := by simp [inverseForm, Complex.div_re, Complex.add_re, Complex.sub_re, Complex.mul_re, Complex.normSq_apply, pow_two] field_simp [hR] theorem dualGaussian_inverseForm {a b d : ℂ} {R : ℝ} (ha : a ≠ 0) (hR : R ≠ 0) (hdet : a * d - b ^ 2 = (R : ℂ)) (z : ℤ × ℤ) : RankTwoComplex.dualGaussian a b d z = Complex.exp (-(Real.pi : ℂ) * inverseForm a b d R z) := by unfold RankTwoComplex.dualGaussian rw [← Complex.exp_add] congr 1 rw [schur_eq_real_det_div ha hdet] dsimp [inverseForm] have hdet0 : a * d - b ^ 2 ≠ 0 := by rw [hdet]; exact_mod_cast hR rw [← hdet] field_simp [ha, hdet0] ; ring private theorem dualGaussian_summable {a b d : ℂ} {R : ℝ} (ha : 0 < a.re) (hR : 0 < R) (hdet : a * d - b ^ 2 = (R : ℂ)) (hpd : 0 < a.re * d.re - b.re ^ 2) : Summable (RankTwoComplex.dualGaussian a b d) := by have hd : 0 < d.re := by by_contra h have h' : d.re ≤ 0 := le_of_not_gt h have hm := mul_nonpos_of_nonneg_of_nonpos ha.le h' nlinarith [sq_nonneg b.re] let eps : ℝ := ((d.re * a.re - b.re ^ 2) / (d.re + a.re)) / R have heps : 0 < eps := div_pos (div_pos (by nlinarith [hpd]) (add_pos hd ha)) hR have hbound (z : ℤ × ℤ) : eps * ((z.1 : ℝ) ^ 2 + (z.2 : ℝ) ^ 2) ≤ (inverseForm a b d R z).re := by rw [inverseForm_real a b d hR.ne'] have hbase := real_quadratic_lower (u := d.re) (v := a.re) (w := b.re) hd ha (by nlinarith [hpd]) (z.1 : ℝ) (z.2 : ℝ) have hdivide := div_le_div_of_nonneg_right hbase hR.le simpa [eps, div_eq_mul_inv, mul_assoc, mul_comm, mul_left_comm] using hdivide have ha0 : a ≠ 0 := by intro h; simp [h] at ha exact (RankTwoComplex.lattice_gaussian_summable_of_re_bound (inverseForm a b d R) heps hbound).congr (fun z => (dualGaussian_inverseForm ha0 hR.ne' hdet z).symm) theorem binary_gaussian_poisson_real_det {a b d : ℂ} {R : ℝ} (ha : 0 < a.re) (hR : 0 < R) (hdet : a * d - b ^ 2 = (R : ℂ)) (hpd : 0 < a.re * d.re - b.re ^ 2) : (∑' z : ℤ × ℤ, RankTwoComplex.binaryGaussian a b d z) = (1 / ((R : ℂ) ^ (1 / 2 : ℂ))) * ∑' z : ℤ × ℤ, RankTwoComplex.dualGaussian a b d z := by have ha0 : a ≠ 0 := by intro h; simp [h] at ha have hN : 0 < Complex.normSq a := Complex.normSq_pos.mpr ha0 have hδ : 0 < (RankTwoComplex.schur a b d).re := by rw [schur_eq_real_det_div ha0 hdet] simpa [Complex.div_re] using div_pos (mul_pos hR ha) hN have hO := originalGaussian_summable ha hpd have hM := firstGaussian_summable ha hR hdet hpd have hD := dualGaussian_summable ha hR hdet hpd calc (∑' z : ℤ × ℤ, RankTwoComplex.binaryGaussian a b d z) = (1 / a ^ (1 / 2 : ℂ)) * (1 / (RankTwoComplex.schur a b d) ^ (1 / 2 : ℂ)) * ∑' z : ℤ × ℤ, RankTwoComplex.dualGaussian a b d z := RankTwoComplex.binary_gaussian_poisson ha hδ hO hM hD _ = (1 / ((R : ℂ) ^ (1 / 2 : ℂ))) * ∑' z : ℤ × ℤ, RankTwoComplex.dualGaussian a b d z := by rw [schur_eq_real_det_div ha0 hdet, SqrtBranch.prefactor_product ha hR] noncomputable def q (a b : ℝ) : ℝ := a ^ 2 - a * b + b ^ 2 noncomputable def A (η a b : ℝ) : ℂ := (η : ℂ) + 2 * Complex.I * (b : ℂ) / (q a b : ℂ) noncomputable def B (η a b : ℝ) : ℂ := -(η : ℂ) / 2 - 2 * Complex.I * (a : ℂ) / (q a b : ℂ) noncomputable def D (η a b : ℝ) : ℂ := (η : ℂ) + 2 * Complex.I * ((a-b : ℝ) : ℂ) / (q a b : ℂ) noncomputable def R (η a b : ℝ) : ℝ := 4 / q a b + 3 * η ^ 2 / 4 theorem coefficient_re (η a b : ℝ) (_hq : q a b ≠ 0) : (A η a b).re = η ∧ (B η a b).re = -η / 2 ∧ (D η a b).re = η := by simp [A, B, D, Complex.div_re, Complex.normSq_apply] theorem oscillatory_determinant (η a b : ℝ) (hq : q a b ≠ 0) : A η a b * D η a b - (B η a b) ^ 2 = (R η a b : ℂ) := by have hqc : (q a b : ℂ) ≠ 0 := by exact_mod_cast hq have hqexpr : (q a b : ℂ) = (a : ℂ) ^ 2 - (a : ℂ) * (b : ℂ) + (b : ℂ) ^ 2 := by simp [q] have hRcast : (R η a b : ℂ) = 4 / (q a b : ℂ) + 3 * (η : ℂ) ^ 2 / 4 := by simp [R] rw [hRcast] dsimp [A, B, D] field_simp [hqc] rw [hqexpr] ring_nf simp [Complex.I_sq] ring theorem real_positive_definite {η a b : ℝ} (hη : 0 < η) (hq : q a b ≠ 0) : 0 < (A η a b).re * (D η a b).re - (B η a b).re ^ 2 := by obtain ⟨hA, hB, hD⟩ := coefficient_re η a b hq rw [hA, hB, hD] nlinarith [sq_pos_of_pos hη] end OscSpecial end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Poisson.OscillatoryGaussian namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic namespace OscSpecial theorem oscillatory_gaussian_poisson {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) : (∑' z : ℤ × ℤ, RankTwoComplex.binaryGaussian (A η a b) (B η a b) (D η a b) z) = (1 / ((R η a b : ℂ) ^ (1 / 2 : ℂ))) * ∑' z : ℤ × ℤ, RankTwoComplex.dualGaussian (A η a b) (B η a b) (D η a b) z := by have hq0 : q a b ≠ 0 := hq.ne' have ha : 0 < (A η a b).re := by rw [(coefficient_re η a b hq0).1] exact hη have hR : 0 < R η a b := by unfold R positivity exact binary_gaussian_poisson_real_det ha hR (oscillatory_determinant η a b hq0) (real_positive_definite hη hq0) noncomputable def r (η a b : ℝ) : ℝ := 1 + 3 * q a b * η ^ 2 / 16 theorem r_pos {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) : 0 < r η a b := by unfold r positivity private theorem inverseForm_explicit {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) (z : ℤ × ℤ) : inverseForm (A η a b) (B η a b) (D η a b) (R η a b) z = ((η : ℂ) * (q a b : ℂ) / (4 * (r η a b : ℂ))) * ((z.1 : ℂ) ^ 2 + (z.1 : ℂ) * (z.2 : ℂ) + (z.2 : ℂ) ^ 2) + Complex.I / (2 * (r η a b : ℂ)) * (((a-b : ℝ) : ℂ) * (z.1 : ℂ) ^ 2 + 2 * (a : ℂ) * (z.1 : ℂ) * (z.2 : ℂ) + (b : ℂ) * (z.2 : ℂ) ^ 2) := by have hq0 : q a b ≠ 0 := hq.ne' have hqc : (q a b : ℂ) ≠ 0 := by exact_mod_cast hq0 have hr0 : r η a b ≠ 0 := (r_pos hη hq).ne' have hrc : (r η a b : ℂ) ≠ 0 := by exact_mod_cast hr0 have hR : 0 < R η a b := by unfold R; positivity have hRc : (R η a b : ℂ) ≠ 0 := by exact_mod_cast hR.ne' have hRexpr : (R η a b : ℂ) = 4 * (r η a b : ℂ) / (q a b : ℂ) := by simp [R, r] field_simp [hqc] ring have hqexpr : (q a b : ℂ) = (a : ℂ) ^ 2 - (a : ℂ) * (b : ℂ) + (b : ℂ) ^ 2 := by simp [q] have hrexpr : (r η a b : ℂ) = 1 + 3 * (q a b : ℂ) * (η : ℂ) ^ 2 / 16 := by simp [r] dsimp [inverseForm, A, B, D] rw [hRexpr] field_simp [hqc, hrc] push_cast ring theorem dualGaussian_explicit {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) (z : ℤ × ℤ) : RankTwoComplex.dualGaussian (A η a b) (B η a b) (D η a b) z = Complex.exp (-(Real.pi : ℂ) * (((η : ℂ) * (q a b : ℂ) / (4 * (r η a b : ℂ))) * ((z.1 : ℂ) ^ 2 + (z.1 : ℂ) * (z.2 : ℂ) + (z.2 : ℂ) ^ 2) + Complex.I / (2 * (r η a b : ℂ)) * (((a-b : ℝ) : ℂ) * (z.1 : ℂ) ^ 2 + 2 * (a : ℂ) * (z.1 : ℂ) * (z.2 : ℂ) + (b : ℂ) * (z.2 : ℂ) ^ 2))) := by have hq0 : q a b ≠ 0 := hq.ne' have hA0 : A η a b ≠ 0 := by intro h have hAr : (A η a b).re = η := (coefficient_re η a b hq0).1 simp [h] at hAr linarith have hR : 0 < R η a b := by unfold R; positivity rw [dualGaussian_inverseForm hA0 hR.ne' (oscillatory_determinant η a b hq0) z, inverseForm_explicit hη hq z] end OscSpecial namespace ActualEisensteinCubic section open EisensteinEmbedding ConcreteTraceCRT Complex theorem dual_quadratic_trace_coeff (a b k l : ℤ) : (ActualEisensteinCoordinates.coords (ActualEisensteinCoordinates.eval a b * (ActualEisensteinCoordinates.eval (k+l) k)^2)).2 = (a-b)*k^2+2*a*k*l+b*l^2 := by rw [pow_two, ActualEisensteinCoordinates.eval_mul (k+l) k (k+l) k] rw [ActualEisensteinCoordinates.eval_mul] rw [ShortDraftLatticeCount.coords_eval] ring private theorem coords_neg_second (z : O) : (ActualEisensteinCoordinates.coords (-z)).2 = -(ActualEisensteinCoordinates.coords z).2 := by let a := (ActualEisensteinCoordinates.coords z).1 let b := (ActualEisensteinCoordinates.coords z).2 have hz : z = ActualEisensteinCoordinates.eval a b := (ActualEisensteinCoordinates.eval_coords z).symm rw [hz] have hneg : -ActualEisensteinCoordinates.eval a b = ActualEisensteinCoordinates.eval (-a) (-b) := by simp only [ActualEisensteinCoordinates.eval] push_cast ring rw [hneg, ShortDraftLatticeCount.coords_eval, ShortDraftLatticeCount.coords_eval] theorem breveE_dual_quadratic_real_scale (r : ℝ) (a b k l : ℤ) : ShortDraftTrace.breveE (eisEmbedding (-(ActualEisensteinCoordinates.eval a b * (ActualEisensteinCoordinates.eval (k+l) k)^2)) / eisLam / ((4*r : ℝ) : ℂ)) = Complex.exp (-(2 * Real.pi * Complex.I * (((a-b)*k^2+2*a*k*l+b*l^2 : ℤ) : ℂ)) / ((4*r : ℝ) : ℂ)) := by rw [breveE_real_trace_of_O] have hneg : (ActualEisensteinCoordinates.coords (-(ActualEisensteinCoordinates.eval a b * (ActualEisensteinCoordinates.eval (k+l) k)^2))).2 = -((a-b)*k^2+2*a*k*l+b*l^2) := by have hp := dual_quadratic_trace_coeff a b k l rw [coords_neg_second] simpa using congrArg Neg.neg hp rw [hneg] congr 1 push_cast ring_nf end section open scoped Topology open Filter EisensteinEmbedding ConcreteTraceCRT Complex theorem original_abel_gamma_limit (c : O) (hc : c ≠ 0) : letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ Tendsto (fun η : ℝ => (η : ℂ) * (∑' z : O, (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ)))) (𝓝[>] (0 : ℝ)) (𝓝 ((((2 / (Real.sqrt 3 * ‖eisEmbedding c‖) : ℝ) : ℂ) * quadraticGammaO c hc))) := by let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let a := (ActualEisensteinCoordinates.coords c).1 let b := (ActualEisensteinCoordinates.coords c).2 let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc let S : ℂ := ∑ r : O ⧸ Ideal.span {c}, ψ (r ^ 2) have hceq : c = ActualEisensteinCoordinates.eval a b := (ActualEisensteinCoordinates.eval_coords c).symm have hq : (((a*a-a*b+b*b : ℤ) : ℝ)) = ‖eisEmbedding c‖ ^ 2 := by calc (((a*a-a*b+b*b : ℤ) : ℝ)) = ‖eisEmbedding (ActualEisensteinCoordinates.eval a b)‖ ^ 2 := (eisEmbedding_eval_norm_sq a b).symm _ = ‖eisEmbedding c‖ ^ 2 := by rw [← hceq] have hn : ‖eisEmbedding c‖ ≠ 0 := ne_of_gt (norm_pos_iff.mpr (ConcreteTraceCRT.eisEmbedding_ne_zero hc)) have hnC : (‖eisEmbedding c‖ : ℂ) ≠ 0 := by exact_mod_cast hn have hsqrtC : (Real.sqrt 3 : ℂ) ≠ 0 := by exact_mod_cast (ne_of_gt (Real.sqrt_pos.2 (by norm_num : (0:ℝ) < 3))) have hgamma : quadraticGammaO c hc = S / (‖eisEmbedding c‖ : ℂ) := rfl have h := original_abel_gauss_limit c hc convert h using 1 rw [hgamma, hq] push_cast field_simp [hnC, hsqrtC] dsimp only [S] end open EisensteinEmbedding ConcreteTraceCRT Complex theorem actual_oscillatory_binary_coordinate (a b m n : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) (η : ℝ) : let c : O := ActualEisensteinCoordinates.eval a b let z : O := ActualEisensteinCoordinates.eval m n (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ)) = RankTwoComplex.binaryGaussian (OscSpecial.A η (a : ℝ) (b : ℝ)) (OscSpecial.B η (a : ℝ) (b : ℝ)) (OscSpecial.D η (a : ℝ) (b : ℝ)) (m,n) := by have hqZ : a*a-a*b+b*b ≠ 0 := (coordinate_norm_pos_of_nonzero a b hc).ne' have hqC : (((a*a-a*b+b*b : ℤ) : ℂ)) ≠ 0 := by exact_mod_cast hqZ dsimp only rw [actual_oscillatory_gaussian_coordinate a b m n hc η] unfold RankTwoComplex.binaryGaussian OscSpecial.A OscSpecial.B OscSpecial.D OscSpecial.q congr 1 push_cast field_simp [hqC] ring theorem actual_oscillatory_sum_eq_binary (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) (η : ℝ) : let c : O := ActualEisensteinCoordinates.eval a b (∑' z : O, (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ))) = ∑' p : ℤ × ℤ, RankTwoComplex.binaryGaussian (OscSpecial.A η (a : ℝ) (b : ℝ)) (OscSpecial.B η (a : ℝ) (b : ℝ)) (OscSpecial.D η (a : ℝ) (b : ℝ)) p := by let W : O → ℂ := fun z => (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (ActualEisensteinCoordinates.eval a b) hc) (Ideal.Quotient.mk (Ideal.span {ActualEisensteinCoordinates.eval a b}) z ^ 2) * Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ)) have h := (latticeCoordEquiv.symm.tsum_eq W).symm simpa only [W, latticeCoordEquiv] using (show (∑' z : O, W z) = ∑' p : ℤ × ℤ, RankTwoComplex.binaryGaussian (OscSpecial.A η (a : ℝ) (b : ℝ)) (OscSpecial.B η (a : ℝ) (b : ℝ)) (OscSpecial.D η (a : ℝ) (b : ℝ)) p from by calc (∑' z : O, W z) = ∑' p : ℤ × ℤ, W (latticeCoordEquiv.symm p) := h _ = _ := by apply tsum_congr intro p have hp : latticeCoordEquiv.symm p = ActualEisensteinCoordinates.eval p.1 p.2 := rfl rw [hp] exact actual_oscillatory_binary_coordinate a b p.1 p.2 hc η) def dualFrequencyEquiv : (ℤ × ℤ) ≃ O where toFun p := ActualEisensteinCoordinates.eval (p.1 + p.2) p.1 invFun y := ((ActualEisensteinCoordinates.coords y).2, (ActualEisensteinCoordinates.coords y).1 - (ActualEisensteinCoordinates.coords y).2) left_inv p := by rcases p with ⟨k,l⟩ simp only [ ShortDraftLatticeCount.coords_eval] ext <;> ring right_inv y := by change ActualEisensteinCoordinates.eval ((ActualEisensteinCoordinates.coords y).2 + ((ActualEisensteinCoordinates.coords y).1 - (ActualEisensteinCoordinates.coords y).2)) (ActualEisensteinCoordinates.coords y).2 = y convert ActualEisensteinCoordinates.eval_coords y using 1 ; ring_nf theorem dualFrequencyEquiv_norm_sq (k l : ℤ) : ‖eisEmbedding (dualFrequencyEquiv (k,l))‖ ^ 2 = (((k^2+k*l+l^2 : ℤ) : ℝ)) := by change ‖eisEmbedding (ActualEisensteinCoordinates.eval (k+l) k)‖ ^ 2 = _ rw [eisEmbedding_eval_norm_sq] ring_nf theorem dualFrequencyEquiv_trace_phase (r : ℝ) (a b k l : ℤ) : ShortDraftTrace.breveE (eisEmbedding (-(ActualEisensteinCoordinates.eval a b * (dualFrequencyEquiv (k,l))^2)) / eisLam / ((4*r : ℝ) : ℂ)) = Complex.exp (-(2 * Real.pi * Complex.I * (((a-b)*k^2+2*a*k*l+b*l^2 : ℤ) : ℂ)) / ((4*r : ℝ) : ℂ)) := by exact breveE_dual_quadratic_real_scale r a b k l end ActualEisensteinCubic namespace GaussianMoment open scoped Topology open Filter noncomputable def realGauss (t : ℝ) (z : ℤ × ℤ) : ℝ := Real.exp (-Real.pi * t * RankTwoPoisson.eisQ z) theorem realGauss_nonneg (t : ℝ) (z : ℤ × ℤ) : 0 ≤ realGauss t z := (Real.exp_pos _).le theorem realGauss_summable {t : ℝ} (ht : 0 < t) : Summable (realGauss t) := by have h := (RankTwoPoisson.eis_gauss_summable ht).norm convert h using 1 funext z dsimp [realGauss, RankTwoPoisson.eisGauss] rw [Complex.norm_exp] simp theorem realGauss_cast (t : ℝ) (z : ℤ × ℤ) : (realGauss t z : ℂ) = RankTwoEisShift.shifted t 0 0 z := by dsimp [realGauss, RankTwoPoisson.eisQ, RankTwoEisShift.shifted, RankTwoEisShift.Q] rw [← Complex.ofReal_exp] congr 1 ring_nf theorem real_gaussian_mass : Tendsto (fun t : ℝ => t * (∑' z : ℤ × ℤ, realGauss t z)) (𝓝[>] (0 : ℝ)) (𝓝 (2 / Real.sqrt 3)) := by have hC := EisensteinAbelFiber.shifted_gaussian_mass 0 0 have hRe := (Complex.continuous_re.tendsto (((2 / Real.sqrt 3 : ℝ) : ℂ))).comp hC have hsum (t : ℝ) : (∑' z : ℤ × ℤ, RankTwoEisShift.shifted t 0 0 z) = (((∑' z : ℤ × ℤ, realGauss t z) : ℝ) : ℂ) := by calc (∑' z : ℤ × ℤ, RankTwoEisShift.shifted t 0 0 z) = ∑' z : ℤ × ℤ, (realGauss t z : ℂ) := by apply tsum_congr intro z exact (realGauss_cast t z).symm _ = (((∑' z : ℤ × ℤ, realGauss t z) : ℝ) : ℂ) := (Complex.ofReal_tsum (realGauss t)).symm have hfun (t : ℝ) : t * (∑' z : ℤ × ℤ, realGauss t z) = (((t : ℂ) * (∑' z : ℤ × ℤ, RankTwoEisShift.shifted t 0 0 z)).re) := by rw [hsum] norm_cast have hEq : (fun t : ℝ => t * (∑' z : ℤ × ℤ, realGauss t z)) = (Complex.re ∘ (fun t : ℝ => (t : ℂ) * (∑' z : ℤ × ℤ, RankTwoEisShift.shifted t 0 0 z))) := by funext t exact hfun t rw [← hEq] at hRe simpa only [Complex.ofReal_re] using hRe end GaussianMoment namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT Complex theorem dual_gaussian_is_actual_trace_phase (a b k l : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) (η : ℝ) (hη : 0 < η) : let c : O := ActualEisensteinCoordinates.eval a b let y : O := dualFrequencyEquiv (k,l) let q : ℝ := OscSpecial.q (a : ℝ) (b : ℝ) let r : ℝ := OscSpecial.r η (a : ℝ) (b : ℝ) RankTwoComplex.dualGaussian (OscSpecial.A η (a : ℝ) (b : ℝ)) (OscSpecial.B η (a : ℝ) (b : ℝ)) (OscSpecial.D η (a : ℝ) (b : ℝ)) (k,l) = Complex.exp (-(Real.pi : ℂ) * ((η : ℂ) * (q : ℂ) / (4 * (r : ℂ))) * (‖eisEmbedding y‖ ^ 2 : ℂ)) * ShortDraftTrace.breveE (eisEmbedding (-(c * y^2)) / eisLam / ((4*r : ℝ) : ℂ)) := by have hqZ := coordinate_norm_pos_of_nonzero a b hc have hq : 0 < OscSpecial.q (a : ℝ) (b : ℝ) := by change 0 < (a : ℝ)^2 - (a : ℝ)*(b : ℝ)+(b : ℝ)^2 exact_mod_cast (show 0 < a^2-a*b+b^2 by simpa only [pow_two] using hqZ) dsimp only rw [OscSpecial.dualGaussian_explicit hη hq (k,l)] rw [dualFrequencyEquiv_trace_phase (OscSpecial.r η (a : ℝ) (b : ℝ)) a b k l] have hnormC : ((‖eisEmbedding (dualFrequencyEquiv (k,l))‖ : ℂ)^2) = (((k^2+k*l+l^2 : ℤ) : ℂ)) := by exact_mod_cast dualFrequencyEquiv_norm_sq k l rw [hnormC] rw [← Complex.exp_add] congr 1 push_cast ring theorem actual_oscillatory_poisson (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) (η : ℝ) (hη : 0 < η) : let c : O := ActualEisensteinCoordinates.eval a b let q : ℝ := OscSpecial.q (a : ℝ) (b : ℝ) let r : ℝ := OscSpecial.r η (a : ℝ) (b : ℝ) (∑' z : O, (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ))) = (1 / ((OscSpecial.R η (a : ℝ) (b : ℝ) : ℂ) ^ (1 / 2 : ℂ))) * ∑' y : O, Complex.exp (-(Real.pi : ℂ) * ((η : ℂ) * (q : ℂ) / (4 * (r : ℂ))) * (‖eisEmbedding y‖ ^ 2 : ℂ)) * ShortDraftTrace.breveE (eisEmbedding (-(c * y^2)) / eisLam / ((4*r : ℝ) : ℂ)) := by have hqZ := coordinate_norm_pos_of_nonzero a b hc have hq : 0 < OscSpecial.q (a : ℝ) (b : ℝ) := by change 0 < (a : ℝ)^2 - (a : ℝ)*(b : ℝ)+(b : ℝ)^2 exact_mod_cast (show 0 < a^2-a*b+b^2 by simpa only [pow_two] using hqZ) dsimp only rw [actual_oscillatory_sum_eq_binary a b hc η, OscSpecial.oscillatory_gaussian_poisson hη hq] congr 1 let W : O → ℂ := fun y => Complex.exp (-(Real.pi : ℂ) * ((η : ℂ) * (OscSpecial.q (a : ℝ) (b : ℝ) : ℂ) / (4 * (OscSpecial.r η (a : ℝ) (b : ℝ) : ℂ))) * (‖eisEmbedding y‖ ^ 2 : ℂ)) * ShortDraftTrace.breveE (eisEmbedding (-(ActualEisensteinCoordinates.eval a b * y^2)) / eisLam / ((4 * OscSpecial.r η (a : ℝ) (b : ℝ) : ℝ) : ℂ)) calc (∑' p : ℤ × ℤ, RankTwoComplex.dualGaussian (OscSpecial.A η (a : ℝ) (b : ℝ)) (OscSpecial.B η (a : ℝ) (b : ℝ)) (OscSpecial.D η (a : ℝ) (b : ℝ)) p) = ∑' p : ℤ × ℤ, W (dualFrequencyEquiv p) := by apply tsum_congr intro p simpa only [W] using dual_gaussian_is_actual_trace_phase a b p.1 p.2 hc η hη _ = ∑' y : O, W y := dualFrequencyEquiv.tsum_eq W end ActualEisensteinCubic namespace OscSpecial private theorem R_eq_four_r_div_q {η a b : ℝ} (hq : q a b ≠ 0) : R η a b = 4 * r η a b / q a b := by unfold R r field_simp [hq] ring private theorem sqrt_R_eq {η a b : ℝ} (_hη : 0 < η) (hq : 0 < q a b) : Real.sqrt (R η a b) = 2 * Real.sqrt (r η a b) / Real.sqrt (q a b) := by rw [R_eq_four_r_div_q hq.ne'] rw [Real.sqrt_div' (4 * r η a b) hq.le] rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 4)] have hs4 : Real.sqrt (4 : ℝ) = 2 := by rw [show (4 : ℝ) = 2 ^ 2 by norm_num, Real.sqrt_sq (by norm_num : (0 : ℝ) ≤ 2)] rw [hs4] theorem prefactor_eq_real_sqrt {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) : (1 / ((R η a b : ℂ) ^ (1 / 2 : ℂ))) = ((Real.sqrt (q a b) / (2 * Real.sqrt (r η a b)) : ℝ) : ℂ) := by have hR : 0 ≤ R η a b := by unfold R; positivity have hqS : Real.sqrt (q a b) ≠ 0 := (Real.sqrt_pos.mpr hq).ne' have hrS : Real.sqrt (r η a b) ≠ 0 := (Real.sqrt_pos.mpr (r_pos hη hq)).ne' have hcpow : (R η a b : ℂ) ^ (1 / 2 : ℂ) = ((R η a b) ^ (1 / 2 : ℝ) : ℝ) := by simpa using (Complex.ofReal_cpow hR (1 / 2 : ℝ)).symm rw [hcpow] simp only [Complex.ofReal_div] rw [← Real.sqrt_eq_rpow, sqrt_R_eq hη hq] push_cast field_simp [hqS, hrS] open scoped Topology open Filter theorem prefactor_tendsto {a b : ℝ} (hq : 0 < q a b) : Tendsto (fun η : ℝ => 1 / ((R η a b : ℂ) ^ (1 / 2 : ℂ))) (𝓝[>] (0 : ℝ)) (𝓝 (((Real.sqrt (q a b) / 2 : ℝ) : ℂ))) := by have hrcont : Continuous (fun η : ℝ => r η a b) := by unfold r fun_prop have hr : Tendsto (fun η : ℝ => r η a b) (𝓝[>] (0 : ℝ)) (𝓝 (1 : ℝ)) := by simpa [r] using (hrcont.tendsto 0).mono_left nhdsWithin_le_nhds have hs : Tendsto (fun η : ℝ => Real.sqrt (r η a b)) (𝓝[>] (0 : ℝ)) (𝓝 (1 : ℝ)) := by simpa only [Function.comp_def, Real.sqrt_one] using Real.continuous_sqrt.continuousAt.tendsto.comp hr have hd : Tendsto (fun η : ℝ => Real.sqrt (q a b) / (2 * Real.sqrt (r η a b))) (𝓝[>] (0 : ℝ)) (𝓝 (Real.sqrt (q a b) / 2)) := by have hden : Tendsto (fun η : ℝ => 2 * Real.sqrt (r η a b)) (𝓝[>] (0 : ℝ)) (𝓝 (2 : ℝ)) := by simpa only [mul_one] using tendsto_const_nhds.mul hs exact tendsto_const_nhds.div hden (by norm_num) have hc : Tendsto (fun η : ℝ => ((Real.sqrt (q a b) / (2 * Real.sqrt (r η a b)) : ℝ) : ℂ)) (𝓝[>] (0 : ℝ)) (𝓝 (((Real.sqrt (q a b) / 2 : ℝ) : ℂ))) := Complex.continuous_ofReal.continuousAt.tendsto.comp hd have heq : (fun η : ℝ => 1 / ((R η a b : ℂ) ^ (1 / 2 : ℂ))) =ᶠ[𝓝[>] (0 : ℝ)] (fun η : ℝ => ((Real.sqrt (q a b) / (2 * Real.sqrt (r η a b)) : ℝ) : ℂ)) := by filter_upwards [self_mem_nhdsWithin] with η hη exact prefactor_eq_real_sqrt hη hq exact hc.congr' heq.symm end OscSpecial namespace GaussianMoment open scoped Topology open Filter private theorem eisQ_nonneg (z : ℤ × ℤ) : 0 ≤ RankTwoPoisson.eisQ z := by have h := RankTwoPoisson.eisQ_lower z nlinarith [sq_nonneg (z.1 : ℝ), sq_nonneg (z.2 : ℝ)] private theorem moment_term_bound {t : ℝ} (ht : 0 < t) (z : ℤ × ℤ) : RankTwoPoisson.eisQ z * realGauss t z ≤ (2 / (Real.pi * t)) * realGauss (t / 2) z := by have h := gaussian_moment_term_bound (RankTwoPoisson.eisQ z) (Real.pi * t) (eisQ_nonneg z) (mul_pos Real.pi_pos ht) convert h using 1 <;> dsimp [realGauss] <;> ring_nf private theorem moment_summable {t : ℝ} (ht : 0 < t) : Summable (fun z : ℤ × ℤ => RankTwoPoisson.eisQ z * realGauss t z) := by have hmajor : Summable (fun z : ℤ × ℤ => (2 / (Real.pi * t)) * realGauss (t / 2) z) := (realGauss_summable (t := t / 2) (half_pos ht)).mul_left _ exact hmajor.of_nonneg_of_le (fun z => mul_nonneg (eisQ_nonneg z) (realGauss_nonneg t z)) (moment_term_bound ht) private theorem moment_tsum_bound {t : ℝ} (ht : 0 < t) : (∑' z : ℤ × ℤ, RankTwoPoisson.eisQ z * realGauss t z) ≤ (2 / (Real.pi * t)) * (∑' z : ℤ × ℤ, realGauss (t / 2) z) := by have hmajor : Summable (fun z : ℤ × ℤ => (2 / (Real.pi * t)) * realGauss (t / 2) z) := (realGauss_summable (t := t / 2) (half_pos ht)).mul_left _ have h := Summable.tsum_le_tsum (moment_term_bound ht) (moment_summable ht) hmajor simpa only [tsum_mul_left] using h private theorem moment_tsum_nonneg (t : ℝ) : 0 ≤ (∑' z : ℤ × ℤ, RankTwoPoisson.eisQ z * realGauss t z) := by exact tsum_nonneg fun z => mul_nonneg (eisQ_nonneg z) (realGauss_nonneg t z) private theorem half_tendsto_within : Tendsto (fun t : ℝ => t / 2) (𝓝[>] (0 : ℝ)) (𝓝[>] (0 : ℝ)) := by apply tendsto_nhdsWithin_iff.mpr constructor · have hc : ContinuousAt (fun t : ℝ => t / 2) 0 := by fun_prop simpa using hc.tendsto.mono_left nhdsWithin_le_nhds · filter_upwards [self_mem_nhdsWithin] with t ht change 0 < t at ht exact half_pos ht private theorem t_tendsto_zero : Tendsto (fun t : ℝ => t) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := tendsto_id.mono_left nhdsWithin_le_nhds private theorem scaled_half_mass_tendsto : Tendsto (fun t : ℝ => (t / 2) * (∑' z : ℤ × ℤ, realGauss (t / 2) z)) (𝓝[>] (0 : ℝ)) (𝓝 (2 / Real.sqrt 3)) := by simpa only [Function.comp_def] using real_gaussian_mass.comp half_tendsto_within theorem scaled_moment_vanishes : Tendsto (fun t : ℝ => t ^ 3 * (∑' z : ℤ × ℤ, RankTwoPoisson.eisQ z * realGauss t z)) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by have hright : Tendsto (fun t : ℝ => (4 / Real.pi) * t * ((t / 2) * (∑' z : ℤ × ℤ, realGauss (t / 2) z))) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by have h := (t_tendsto_zero.mul scaled_half_mass_tendsto).const_mul (4 / Real.pi) simpa only [zero_mul, mul_zero, Function.comp_def, mul_assoc] using h have hleft : Tendsto (fun _ : ℝ => (0 : ℝ)) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := tendsto_const_nhds apply tendsto_of_tendsto_of_tendsto_of_le_of_le' hleft hright · filter_upwards [self_mem_nhdsWithin] with t ht change 0 < t at ht exact mul_nonneg (pow_nonneg ht.le _) (moment_tsum_nonneg t) · filter_upwards [self_mem_nhdsWithin] with t ht change 0 < t at ht have h := moment_tsum_bound ht have ht3 : 0 ≤ t ^ 3 := pow_nonneg ht.le _ have hmul := mul_le_mul_of_nonneg_left h ht3 calc t ^ 3 * (∑' z : ℤ × ℤ, RankTwoPoisson.eisQ z * realGauss t z) ≤ t ^ 3 * ((2 / (Real.pi * t)) * (∑' z : ℤ × ℤ, realGauss (t / 2) z)) := hmul _ = (4 / Real.pi) * t * ((t / 2) * (∑' z : ℤ × ℤ, realGauss (t / 2) z)) := by field_simp [ht.ne'] ring end GaussianMoment end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.PrimeRows.RationalApproximation namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter namespace RationalQuant end RationalQuant open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount namespace RationalPrimeExtraction end RationalPrimeExtraction open ActualEisensteinCubic ShortDraftLatticeCount namespace RationalPrimeExtraction open ActualEisensteinCubic ShortDraftLatticeCount end RationalPrimeExtraction namespace OscSpecial noncomputable def phaseBoundConstant (a b : ℝ) : ℝ := 2 * (|a - b| + |a| + |b|) + 1 theorem phaseBoundConstant_pos (a b : ℝ) : 0 < phaseBoundConstant a b := by unfold phaseBoundConstant positivity theorem quadratic_phase_abs_le (a b k l : ℝ) : |(a - b) * k ^ 2 + 2 * a * k * l + b * l ^ 2| ≤ phaseBoundConstant a b * (k ^ 2 + k * l + l ^ 2) := by let Q : ℝ := k ^ 2 + k * l + l ^ 2 have hQ : 0 ≤ Q := by dsimp [Q] nlinarith [sq_nonneg (k + l), sq_nonneg k, sq_nonneg l] have hsum : k ^ 2 + l ^ 2 ≤ 2 * Q := by dsimp [Q] nlinarith [sq_nonneg (k + l)] have hcross : 2 * |k| * |l| ≤ k ^ 2 + l ^ 2 := by nlinarith [sq_nonneg (|k| - |l|), sq_abs k, sq_abs l] have hk : k ^ 2 ≤ 2 * Q := by nlinarith [hsum, sq_nonneg l] have hl : l ^ 2 ≤ 2 * Q := by nlinarith [hsum, sq_nonneg k] have hkl : 2 * |k| * |l| ≤ 2 * Q := hcross.trans hsum have h1 := mul_le_mul_of_nonneg_left hk (abs_nonneg (a - b)) have h2 := mul_le_mul_of_nonneg_left hkl (abs_nonneg a) have h3 := mul_le_mul_of_nonneg_left hl (abs_nonneg b) have htri : |(a - b) * k ^ 2 + 2 * a * k * l + b * l ^ 2| ≤ |a - b| * k ^ 2 + 2 * |a| * |k| * |l| + |b| * l ^ 2 := by calc |(a - b) * k ^ 2 + 2 * a * k * l + b * l ^ 2| ≤ |(a - b) * k ^ 2| + |2 * a * k * l| + |b * l ^ 2| := by calc _ ≤ |(a - b) * k ^ 2 + 2 * a * k * l| + |b * l ^ 2| := abs_add_le _ _ _ ≤ _ := by have hh := abs_add_le ((a - b) * k ^ 2) (2 * a * k * l) linarith _ = _ := by simp [abs_mul, abs_of_nonneg (sq_nonneg k), abs_of_nonneg (sq_nonneg l)] unfold phaseBoundConstant nlinarith [htri, h1, h2, h3, hQ] end OscSpecial namespace GaussianMoment open scoped Topology open Filter theorem scaled_moment_vanishes_const (K : ℝ) (hK : 0 < K) : Tendsto (fun η : ℝ => η ^ 3 * (∑' z : ℤ × ℤ, RankTwoPoisson.eisQ z * realGauss (K * η) z)) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by have hscale : Tendsto (fun η : ℝ => K * η) (𝓝[>] (0 : ℝ)) (𝓝[>] (0 : ℝ)) := by apply tendsto_nhdsWithin_iff.mpr constructor · have hc : ContinuousAt (fun η : ℝ => K * η) 0 := by fun_prop simpa using hc.tendsto.mono_left nhdsWithin_le_nhds · filter_upwards [self_mem_nhdsWithin] with η hη change 0 < η at hη exact mul_pos hK hη have h := scaled_moment_vanishes.comp hscale have h' := h.const_mul (1 / K ^ 3) convert h' using 1 · funext η dsimp [Function.comp_def] field_simp [hK.ne'] · simp end GaussianMoment namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT Complex private theorem breveE_period_div_lam_O (z : O) : ShortDraftTrace.breveE (eisEmbedding z / eisLam) = 1 := by let a := (ActualEisensteinCoordinates.coords z).1 let b := (ActualEisensteinCoordinates.coords z).2 have hz : z = ActualEisensteinCoordinates.eval a b := (ActualEisensteinCoordinates.eval_coords z).symm rw [hz, eisEmbedding_eval] exact ConcreteBreveE.breveE_period_coordinates a b noncomputable def fixedDualPhase (c y : O) : ℂ := ShortDraftTrace.breveE (eisEmbedding (-(c*y^2)) / eisLam / (4 : ℂ)) theorem fixedDualPhase_period_two (c y w : O) : fixedDualPhase c (y + 2*w) = fixedDualPhase c y := by let d : O := -(c * (y*w+w^2)) have hO : -(c * (y + 2*w)^2) = -(c*y^2) + 4*d := by dsimp [d] ring have h4 : eisEmbedding (4*d) = 4 * eisEmbedding d := by simp only [map_mul, map_ofNat] have harg : eisEmbedding (-(c * (y + 2*w)^2)) / eisLam / (4 : ℂ) = eisEmbedding (-(c*y^2)) / eisLam / (4 : ℂ) + eisEmbedding d / eisLam := by rw [hO, map_add, h4] ring unfold fixedDualPhase rw [harg, AddChar.map_add_eq_mul, breveE_period_div_lam_O, mul_one] theorem fixedDualPhase_eq_of_mod_two (c y z : O) (h : Ideal.Quotient.mk (Ideal.span {(2 : O)}) y = Ideal.Quotient.mk (Ideal.span {(2 : O)}) z) : fixedDualPhase c y = fixedDualPhase c z := by have hsub : y-z ∈ Ideal.span {(2 : O)} := (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp h obtain ⟨w, hw⟩ := (Ideal.mem_span_singleton).mp hsub have hy : y = z + 2*w := by calc y = z+(y-z) := by ring _ = z+2*w := by rw [hw] rw [hy, fixedDualPhase_period_two] theorem fixedDualPhase_weighted_partition (c : O) (W : O → ℂ) (hsum : Summable (fun y : O => fixedDualPhase c y * W y)) : letI : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span (by norm_num : (2 : O) ≠ 0) letI : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ (∑' y : O, fixedDualPhase c y * W y) = ∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r) * ∑' w : O, W (GaussianShiftedPartition.representative 2 r + 2*w) := by let h2 : (2 : O) ≠ 0 := by norm_num let : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span h2 let : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ rw [GaussianAbelPartition.tsum_by_finite_fibers (Ideal.Quotient.mk (Ideal.span {(2 : O)})) _ hsum] apply Finset.sum_congr rfl intro r hr calc (∑' z : ((Ideal.Quotient.mk (Ideal.span {(2 : O)})) ⁻¹' {r}), fixedDualPhase c z.1 * W z.1) = ∑' w : O, fixedDualPhase c (GaussianShiftedPartition.representative 2 r + 2*w) * W (GaussianShiftedPartition.representative 2 r + 2*w) := GaussianFiberEquiv.fiber_tsum 2 h2 r (GaussianShiftedPartition.representative 2 r) (GaussianShiftedPartition.representative_spec 2 r) (fun y => fixedDualPhase c y * W y) _ = ∑' w : O, fixedDualPhase c (GaussianShiftedPartition.representative 2 r) * W (GaussianShiftedPartition.representative 2 r + 2*w) := by apply tsum_congr intro w rw [fixedDualPhase_period_two] _ = _ := tsum_mul_left end ActualEisensteinCubic namespace OscSpecial open scoped Topology open Filter noncomputable def dualScale (η a b : ℝ) : ℝ := η * q a b / (4 * r η a b) theorem dualScale_tendsto (a b : ℝ) (hq : 0 < q a b) : Tendsto (fun η : ℝ => dualScale η a b) (𝓝[>] (0 : ℝ)) (𝓝[>] (0 : ℝ)) := by have hnum : ContinuousAt (fun η : ℝ => η * q a b) 0 := by fun_prop have hden : ContinuousAt (fun η : ℝ => 4 * r η a b) 0 := by change ContinuousAt (fun η : ℝ => 4 * (1 + 3 * q a b * η ^ 2 / 16)) 0 fun_prop have hden0 : 4 * r 0 a b ≠ 0 := by simp [r] have hcont : ContinuousAt (fun η : ℝ => dualScale η a b) 0 := by exact hnum.div hden hden0 have hlim : Tendsto (fun η : ℝ => dualScale η a b) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by simpa [dualScale] using hcont.tendsto.mono_left nhdsWithin_le_nhds apply tendsto_nhdsWithin_iff.mpr constructor · exact hlim · filter_upwards [self_mem_nhdsWithin] with η hη change 0 < η at hη have hr : 0 < r η a b := by unfold r positivity exact div_pos (mul_pos hη hq) (mul_pos (by norm_num) hr) theorem abel_mass_dual_scale (a b : ℝ) (hq : 0 < q a b) (F : ℝ → ℂ) (L : ℂ) (hF : Tendsto (fun t : ℝ => (t : ℂ) * F t) (𝓝[>] (0 : ℝ)) (𝓝 L)) : Tendsto (fun η : ℝ => (η : ℂ) * F (dualScale η a b)) (𝓝[>] (0 : ℝ)) (𝓝 (((4 / q a b : ℝ) : ℂ) * L)) := by have hscale := dualScale_tendsto a b hq have hF' := hF.comp hscale have hrcont : ContinuousAt (fun η : ℝ => ((4 * r η a b / q a b : ℝ) : ℂ)) 0 := by change ContinuousAt (fun η : ℝ => ((4 * (1 + 3 * q a b * η ^ 2 / 16) / q a b : ℝ) : ℂ)) 0 fun_prop have hr : Tendsto (fun η : ℝ => ((4 * r η a b / q a b : ℝ) : ℂ)) (𝓝[>] (0 : ℝ)) (𝓝 ((4 / q a b : ℝ) : ℂ)) := by simpa [r] using hrcont.tendsto.mono_left nhdsWithin_le_nhds have hprod := hr.mul hF' have heq : ∀ᶠ η : ℝ in 𝓝[>] (0 : ℝ), (η : ℂ) * F (dualScale η a b) = ((4 * r η a b / q a b : ℝ) : ℂ) * (((dualScale η a b : ℝ) : ℂ) * F (dualScale η a b)) := by filter_upwards [self_mem_nhdsWithin] with η hη change 0 < η at hη have hrpos : 0 < r η a b := by unfold r positivity have hqC : (q a b : ℂ) ≠ 0 := by exact_mod_cast hq.ne' have hrC : (r η a b : ℂ) ≠ 0 := by exact_mod_cast hrpos.ne' dsimp [dualScale] push_cast field_simp [hqC, hrC] exact hprod.congr' (heq.mono fun η h => h.symm) end OscSpecial end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.AbelPhaseLimit namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT Complex private theorem sum_zmod_two_square (f : ZMod 2 × ZMod 2 → ℂ) : (∑ p : ZMod 2 × ZMod 2, f p) = f (0,0) + f (0,1) + f (1,0) + f (1,1) := by rw [Fintype.sum_prod_type] have hu : (Finset.univ : Finset (ZMod 2)) = {0,1} := rfl simp [hu] ring theorem fixedDualPhase_quotient_two_four_residues (c : O) : letI : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span (by norm_num : (2 : O) ≠ 0) letI : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ (∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r)) = fixedDualPhase c (ActualEisensteinCoordinates.eval 0 0) + fixedDualPhase c (ActualEisensteinCoordinates.eval 0 1) + fixedDualPhase c (ActualEisensteinCoordinates.eval 1 0) + fixedDualPhase c (ActualEisensteinCoordinates.eval 1 1) := by let h2 : (2 : O) ≠ 0 := by norm_num let : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span h2 let : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ let e := rationalCoordEquiv 2 (by norm_num) let P : O ⧸ Ideal.span {(2 : O)} → ℂ := fun r => fixedDualPhase c (GaussianShiftedPartition.representative 2 r) have hpoint (p : ZMod 2 × ZMod 2) : P (e p) = fixedDualPhase c (ActualEisensteinCoordinates.eval (ZMod.cast p.1) (ZMod.cast p.2)) := by dsimp only [P] apply fixedDualPhase_eq_of_mod_two rw [GaussianShiftedPartition.representative_spec] exact rationalCoordEquiv_apply 2 (by norm_num) p.1 p.2 have hsum : (∑ r : O ⧸ Ideal.span {(2 : O)}, P r) = ∑ p : ZMod 2 × ZMod 2, fixedDualPhase c (ActualEisensteinCoordinates.eval (ZMod.cast p.1) (ZMod.cast p.2)) := by calc (∑ r : O ⧸ Ideal.span {(2 : O)}, P r) = ∑ p : ZMod 2 × ZMod 2, P (e p) := (e.sum_comp P).symm _ = _ := by apply Finset.sum_congr rfl intro p hp exact hpoint p rw [show (∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r)) = ∑ r : O ⧸ Ideal.span {(2 : O)}, P r from rfl] rw [hsum, sum_zmod_two_square] have hcast1 : (ZMod.cast (1 : ZMod 2) : ℤ) = 1 := by decide simp only [ZMod.cast_zero, hcast1] theorem fixedDualPhase_coordinates (a b x y : ℤ) : fixedDualPhase (ActualEisensteinCoordinates.eval a b) (ActualEisensteinCoordinates.eval x y) = ShortDraftTrace.breveE ((-(((a : ℂ)+(b : ℂ)*omega3) * (((x : ℂ)+(y : ℂ)*omega3)^2))) / eisLam / 4) := by unfold fixedDualPhase rw [map_neg, map_mul, map_pow, eisEmbedding_eval, eisEmbedding_eval] theorem fixedDualPhase_four_terms (a b : ℤ) : letI : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span (by norm_num : (2 : O) ≠ 0) letI : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ (∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase (ActualEisensteinCoordinates.eval a b) (GaussianShiftedPartition.representative 2 r)) / 2 = breveGaussianFourTerms a b := by let : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span (by norm_num : (2 : O) ≠ 0) let : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ rw [fixedDualPhase_quotient_two_four_residues] rw [fixedDualPhase_coordinates a b 0 0, fixedDualPhase_coordinates a b 0 1, fixedDualPhase_coordinates a b 1 0, fixedDualPhase_coordinates a b 1 1] unfold breveGaussianFourTerms norm_num ring_nf end ActualEisensteinCubic namespace OscSpecial noncomputable def dualQ (z : ℤ × ℤ) : ℝ := (z.1 : ℝ) ^ 2 + (z.1 : ℝ) * (z.2 : ℝ) + (z.2 : ℝ) ^ 2 noncomputable def dualTrace (a b : ℝ) (z : ℤ × ℤ) : ℝ := (a - b) * (z.1 : ℝ) ^ 2 + 2 * a * (z.1 : ℝ) * (z.2 : ℝ) + b * (z.2 : ℝ) ^ 2 noncomputable def phaseA (a b : ℝ) : ℝ := 3 * q a b / 16 noncomputable def phaseAngle (a b : ℝ) (z : ℤ × ℤ) : ℝ := -(Real.pi / 2) * dualTrace a b z noncomputable def dualAmp (η a b : ℝ) (z : ℤ × ℤ) : ℝ := Real.exp (-Real.pi * (η * q a b / (4 * r η a b)) * dualQ z) noncomputable def dualVarTerm (η a b : ℝ) (z : ℤ × ℤ) : ℂ := (dualAmp η a b z : ℂ) * Complex.exp (Complex.I * ((phaseAngle a b z / r η a b : ℝ) : ℂ)) noncomputable def dualFixedTerm (η a b : ℝ) (z : ℤ × ℤ) : ℂ := (dualAmp η a b z : ℂ) * Complex.exp (Complex.I * (phaseAngle a b z : ℂ)) private theorem dualQ_nonneg (z : ℤ × ℤ) : 0 ≤ dualQ z := by unfold dualQ nlinarith [sq_nonneg ((z.1 : ℝ) + (z.2 : ℝ)), sq_nonneg (z.1 : ℝ), sq_nonneg (z.2 : ℝ)] private theorem phaseAngle_bound (a b : ℝ) (z : ℤ × ℤ) : |phaseAngle a b z| ≤ (Real.pi / 2) * phaseBoundConstant a b * dualQ z := by have h := quadratic_phase_abs_le a b (z.1 : ℝ) (z.2 : ℝ) dsimp [phaseAngle, dualTrace, dualQ] rw [abs_mul, abs_neg, abs_of_pos (half_pos Real.pi_pos)] simpa only [mul_assoc] using mul_le_mul_of_nonneg_left h (half_pos Real.pi_pos).le private theorem r_eq_one_add_phaseA (η a b : ℝ) : r η a b = 1 + phaseA a b * η ^ 2 := by unfold r phaseA ring private theorem phaseA_nonneg {a b : ℝ} (hq : 0 ≤ q a b) : 0 ≤ phaseA a b := by unfold phaseA positivity theorem dual_phase_term_error {η a b : ℝ} (_hη : 0 < η) (hq : 0 < q a b) (z : ℤ × ℤ) : ‖dualVarTerm η a b z - dualFixedTerm η a b z‖ ≤ dualAmp η a b z * ((Real.pi / 2) * phaseBoundConstant a b * dualQ z) * (phaseA a b * η ^ 2) := by have hA : 0 ≤ phaseA a b := phaseA_nonneg hq.le have hamp : 0 ≤ dualAmp η a b z := (Real.exp_pos _).le have hphase := GaussianPhasePointwise.exp_imag_denominator_error (phaseAngle a b z) (phaseA a b) η hA rw [← r_eq_one_add_phaseA η a b] at hphase have hangle := phaseAngle_bound a b z have hangle' := mul_le_mul_of_nonneg_right hangle (mul_nonneg hA (sq_nonneg η)) dsimp [dualVarTerm, dualFixedTerm] rw [← mul_sub, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hamp] nlinarith [mul_le_mul_of_nonneg_left hphase hamp, mul_le_mul_of_nonneg_left hangle' hamp] noncomputable def dualRealGauss (t : ℝ) (z : ℤ × ℤ) : ℝ := Real.exp (-Real.pi * t * dualQ z) private theorem dualRealGauss_summable {t : ℝ} (ht : 0 < t) : Summable (dualRealGauss t) := by let e : ℤ × ℤ ≃ ℤ × ℤ := Equiv.prodCongr (Equiv.refl ℤ) (Equiv.neg ℤ) have hE : Summable (fun z : ℤ × ℤ => RankTwoPoisson.eisGauss t (z.1,-z.2)) := (e.summable_iff).2 (RankTwoPoisson.eis_gauss_summable ht) convert hE.norm using 1 funext z dsimp [dualRealGauss, RankTwoPoisson.eisGauss] rw [Complex.norm_exp] simp only [Complex.ofReal_re] congr 1 dsimp [dualQ, RankTwoPoisson.eisQ] push_cast ring private theorem dualMoment_summable {t : ℝ} (ht : 0 < t) : Summable (fun z : ℤ × ℤ => dualQ z * dualRealGauss t z) := by have hmaj : Summable (fun z : ℤ × ℤ => (2 / (Real.pi * t)) * dualRealGauss (t / 2) z) := (dualRealGauss_summable (half_pos ht)).mul_left _ apply hmaj.of_nonneg_of_le · intro z exact mul_nonneg (dualQ_nonneg z) (Real.exp_pos _).le · intro z have h := GaussianMoment.gaussian_moment_term_bound (dualQ z) (Real.pi * t) (dualQ_nonneg z) (mul_pos Real.pi_pos ht) convert h using 1 <;> dsimp [dualRealGauss] <;> ring_nf private theorem dualAmp_eq_realGauss (η a b : ℝ) (z : ℤ × ℤ) : dualAmp η a b z = dualRealGauss (η * q a b / (4 * r η a b)) z := rfl private theorem dualAmp_norm_var (η a b : ℝ) (z : ℤ × ℤ) : ‖dualVarTerm η a b z‖ = dualAmp η a b z := by dsimp [dualVarTerm] rw [norm_mul, Complex.norm_exp_I_mul_ofReal, mul_one, Complex.norm_real] exact abs_of_nonneg (Real.exp_pos _).le private theorem dualAmp_norm_fixed (η a b : ℝ) (z : ℤ × ℤ) : ‖dualFixedTerm η a b z‖ = dualAmp η a b z := by dsimp [dualFixedTerm] rw [norm_mul, Complex.norm_exp_I_mul_ofReal, mul_one, Complex.norm_real] exact abs_of_nonneg (Real.exp_pos _).le private theorem dualAmp_summable {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) : Summable (dualAmp η a b) := by have hr : 0 < r η a b := r_pos hη hq have ht : 0 < η * q a b / (4 * r η a b) := by positivity convert dualRealGauss_summable ht using 1 funext z exact dualAmp_eq_realGauss η a b z private theorem dualVar_summable {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) : Summable (dualVarTerm η a b) := (dualAmp_summable hη hq).of_norm_bounded (fun z => le_of_eq (dualAmp_norm_var η a b z)) private theorem dualFixed_summable {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) : Summable (dualFixedTerm η a b) := (dualAmp_summable hη hq).of_norm_bounded (fun z => le_of_eq (dualAmp_norm_fixed η a b z)) private theorem dualAmp_le_small {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) (hrle : r η a b ≤ 2) (z : ℤ × ℤ) : dualAmp η a b z ≤ dualRealGauss (η * q a b / 8) z := by have hr : 0 < r η a b := r_pos hη hq have hp : 0 < η * q a b := mul_pos hη hq have ht : η * q a b / 8 ≤ η * q a b / (4 * r η a b) := by apply (div_le_div_iff₀ (by norm_num : (0 : ℝ) < 8) (by positivity : 0 < 4 * r η a b)).2 nlinarith [mul_le_mul_of_nonneg_left hrle hp.le] dsimp [dualAmp, dualRealGauss] apply Real.exp_le_exp.mpr have hm := mul_le_mul_of_nonneg_right ht (mul_nonneg Real.pi_pos.le (dualQ_nonneg z)) nlinarith [hm] noncomputable def phaseErrorConstant (a b : ℝ) : ℝ := (Real.pi / 2) * phaseBoundConstant a b * phaseA a b private theorem phaseErrorConstant_nonneg {a b : ℝ} (hq : 0 < q a b) : 0 ≤ phaseErrorConstant a b := by unfold phaseErrorConstant exact mul_nonneg (mul_nonneg (half_pos Real.pi_pos).le (phaseBoundConstant_pos a b).le) (phaseA_nonneg hq.le) theorem normalized_dual_phase_sum_error {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) (hrle : r η a b ≤ 2) : η * ‖(∑' z : ℤ × ℤ, dualVarTerm η a b z) - (∑' z : ℤ × ℤ, dualFixedTerm η a b z)‖ ≤ phaseErrorConstant a b * η ^ 3 * (∑' z : ℤ × ℤ, dualQ z * dualRealGauss (η * q a b / 8) z) := by let t : ℝ := η * q a b / 8 have ht : 0 < t := by dsimp [t]; positivity have hK : 0 ≤ phaseErrorConstant a b := phaseErrorConstant_nonneg hq have hpoint (z : ℤ × ℤ) : ‖dualVarTerm η a b z - dualFixedTerm η a b z‖ ≤ (phaseErrorConstant a b * η ^ 2) * (dualQ z * dualRealGauss t z) := by have hbase := dual_phase_term_error hη hq z have hamp := dualAmp_le_small hη hq hrle z have hfac : 0 ≤ ((Real.pi / 2) * phaseBoundConstant a b * dualQ z) * (phaseA a b * η ^ 2) := by exact mul_nonneg (mul_nonneg (mul_nonneg (half_pos Real.pi_pos).le (phaseBoundConstant_pos a b).le) (dualQ_nonneg z)) (mul_nonneg (phaseA_nonneg hq.le) (sq_nonneg η)) have hmul := mul_le_mul_of_nonneg_right hamp hfac dsimp [t, phaseErrorConstant] calc ‖dualVarTerm η a b z - dualFixedTerm η a b z‖ ≤ dualAmp η a b z * ((Real.pi / 2) * phaseBoundConstant a b * dualQ z) * (phaseA a b * η ^ 2) := hbase _ ≤ dualRealGauss (η * q a b / 8) z * ((Real.pi / 2) * phaseBoundConstant a b * dualQ z) * (phaseA a b * η ^ 2) := by nlinarith [hmul] _ = ((Real.pi / 2 * phaseBoundConstant a b * phaseA a b) * η ^ 2) * (dualQ z * dualRealGauss (η * q a b / 8) z) := by ring have hmajor : Summable (fun z : ℤ × ℤ => (phaseErrorConstant a b * η ^ 2) * (dualQ z * dualRealGauss t z)) := (dualMoment_summable ht).mul_left _ have hnorm : Summable (fun z : ℤ × ℤ => ‖dualVarTerm η a b z - dualFixedTerm η a b z‖) := hmajor.of_nonneg_of_le (fun z => norm_nonneg _) hpoint have hsum := norm_tsum_le_tsum_norm hnorm have htsum := Summable.tsum_le_tsum hpoint hnorm hmajor have hvar := dualVar_summable hη hq have hfixed := dualFixed_summable hη hq calc η * ‖(∑' z : ℤ × ℤ, dualVarTerm η a b z) - (∑' z : ℤ × ℤ, dualFixedTerm η a b z)‖ = η * ‖(∑' z : ℤ × ℤ, (dualVarTerm η a b z - dualFixedTerm η a b z))‖ := by rw [hvar.tsum_sub hfixed] _ ≤ η * (∑' z : ℤ × ℤ, ‖dualVarTerm η a b z - dualFixedTerm η a b z‖) := mul_le_mul_of_nonneg_left hsum hη.le _ ≤ η * (∑' z : ℤ × ℤ, (phaseErrorConstant a b * η ^ 2) * (dualQ z * dualRealGauss t z)) := mul_le_mul_of_nonneg_left htsum hη.le _ = phaseErrorConstant a b * η ^ 3 * (∑' z : ℤ × ℤ, dualQ z * dualRealGauss (η * q a b / 8) z) := by rw [tsum_mul_left] dsimp [t] ring open scoped Topology open Filter private theorem dual_moment_reindex (t : ℝ) : (∑' z : ℤ × ℤ, dualQ z * dualRealGauss t z) = ∑' z : ℤ × ℤ, RankTwoPoisson.eisQ z * GaussianMoment.realGauss t z := by let e : ℤ × ℤ ≃ ℤ × ℤ := Equiv.prodCongr (Equiv.refl ℤ) (Equiv.neg ℤ) calc (∑' z : ℤ × ℤ, dualQ z * dualRealGauss t z) = ∑' z : ℤ × ℤ, RankTwoPoisson.eisQ (e z) * GaussianMoment.realGauss t (e z) := by apply tsum_congr intro z have hQ : RankTwoPoisson.eisQ (e z) = dualQ z := by rcases z with ⟨k,l⟩ change (k : ℝ) ^ 2 - (k : ℝ) * ((-l : ℤ) : ℝ) + ((-l : ℤ) : ℝ) ^ 2 = (k : ℝ) ^ 2 + (k : ℝ) * (l : ℝ) + (l : ℝ) ^ 2 push_cast ring simp only [GaussianMoment.realGauss, dualRealGauss, hQ] _ = ∑' z : ℤ × ℤ, RankTwoPoisson.eisQ z * GaussianMoment.realGauss t z := e.tsum_eq (fun z : ℤ × ℤ => RankTwoPoisson.eisQ z * GaussianMoment.realGauss t z) theorem normalized_dual_phase_sum_error_tendsto_zero {a b : ℝ} (hq : 0 < q a b) : Tendsto (fun η : ℝ => η * ‖(∑' z : ℤ × ℤ, dualVarTerm η a b z) - (∑' z : ℤ × ℤ, dualFixedTerm η a b z)‖) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by let K : ℝ := q a b / 8 have hK : 0 < K := by dsimp [K]; positivity have hmoment : Tendsto (fun η : ℝ => η ^ 3 * (∑' z : ℤ × ℤ, dualQ z * dualRealGauss (η * q a b / 8) z)) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by convert GaussianMoment.scaled_moment_vanishes_const K hK using 1 funext η dsimp [K] rw [dual_moment_reindex] ring_nf have hright : Tendsto (fun η : ℝ => phaseErrorConstant a b * η ^ 3 * (∑' z : ℤ × ℤ, dualQ z * dualRealGauss (η * q a b / 8) z)) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by convert hmoment.const_mul (phaseErrorConstant a b) using 1 · funext η ring · simp have hr_lim : Tendsto (fun η : ℝ => r η a b) (𝓝[>] (0 : ℝ)) (𝓝 (1 : ℝ)) := by have hc : ContinuousAt (fun η : ℝ => r η a b) 0 := by unfold r fun_prop simpa [r] using hc.tendsto.mono_left nhdsWithin_le_nhds have hrle : ∀ᶠ η : ℝ in 𝓝[>] (0 : ℝ), r η a b ≤ 2 := by have hevent : ∀ᶠ x : ℝ in 𝓝 (1 : ℝ), x ≤ 2 := eventually_le_nhds (by norm_num) exact hr_lim.eventually hevent apply tendsto_of_tendsto_of_tendsto_of_le_of_le' (tendsto_const_nhds (x := (0 : ℝ))) hright · filter_upwards [self_mem_nhdsWithin] with η hη exact mul_nonneg hη.le (norm_nonneg _) · filter_upwards [self_mem_nhdsWithin, hrle] with η hη hbound exact normalized_dual_phase_sum_error hη hq hbound theorem dualGaussian_eq_dualVarTerm {η a b : ℝ} (hη : 0 < η) (hq : 0 < q a b) (z : ℤ × ℤ) : RankTwoComplex.dualGaussian (A η a b) (B η a b) (D η a b) z = dualVarTerm η a b z := by rw [dualGaussian_explicit hη hq z] have hQ : ((z.1 : ℂ) ^ 2 + (z.1 : ℂ) * (z.2 : ℂ) + (z.2 : ℂ) ^ 2) = (dualQ z : ℂ) := by dsimp [dualQ] push_cast ring have hT : (((a-b : ℝ) : ℂ) * (z.1 : ℂ) ^ 2 + 2 * (a : ℂ) * (z.1 : ℂ) * (z.2 : ℂ) + (b : ℂ) * (z.2 : ℂ) ^ 2) = (dualTrace a b z : ℂ) := by dsimp [dualTrace] push_cast ring rw [hQ, hT] have hrC : (r η a b : ℂ) ≠ 0 := by exact_mod_cast (r_pos hη hq).ne' have harg : -(Real.pi : ℂ) * ((η : ℂ) * (q a b : ℂ) / (4 * (r η a b : ℂ)) * (dualQ z : ℂ) + Complex.I / (2 * (r η a b : ℂ)) * (dualTrace a b z : ℂ)) = (((-Real.pi * (η * q a b / (4 * r η a b)) * dualQ z : ℝ) : ℂ)) + Complex.I * ((phaseAngle a b z / r η a b : ℝ) : ℂ) := by dsimp [phaseAngle] push_cast field_simp [hrC] ring rw [harg, Complex.exp_add, ← Complex.ofReal_exp] rfl end OscSpecial namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT theorem osc_q_eq_eis_norm_sq (a b : ℤ) : OscSpecial.q (a : ℝ) (b : ℝ) = ‖eisEmbedding (ActualEisensteinCoordinates.eval a b)‖ ^ 2 := by rw [eisEmbedding_eval_norm_sq] dsimp [OscSpecial.q] push_cast ring theorem two_coordinate_norm_four : let a := (ActualEisensteinCoordinates.coords (2 : O)).1 let b := (ActualEisensteinCoordinates.coords (2 : O)).2 (((a*a-a*b+b*b : ℤ) : ℝ)) = 4 := by have h2 : (2 : O) = ActualEisensteinCoordinates.eval 2 0 := by simp [ActualEisensteinCoordinates.eval] rw [h2, ShortDraftLatticeCount.coords_eval] norm_num end ActualEisensteinCubic open Filter open scoped Topology theorem abel_transfer (P V W : ℝ → ℂ) (p w : ℂ) (hP : Tendsto P (𝓝[>] (0 : ℝ)) (𝓝 p)) (hW : Tendsto (fun η : ℝ => (η : ℂ) * W η) (𝓝[>] (0 : ℝ)) (𝓝 w)) (hE : Tendsto (fun η => η * ‖V η - W η‖) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ))) : Tendsto (fun η : ℝ => (η : ℂ) * (P η * V η)) (𝓝[>] (0 : ℝ)) (𝓝 (p * w)) := by have hdiff : Tendsto (fun η : ℝ => (η : ℂ) * (V η - W η)) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℂ)) := by rw [tendsto_zero_iff_norm_tendsto_zero] have heq : (fun η : ℝ => ‖(η : ℂ) * (V η - W η)‖) =ᶠ[𝓝[>] (0 : ℝ)] (fun η => η * ‖V η - W η‖) := by filter_upwards [self_mem_nhdsWithin] with η hη rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hη] exact hE.congr' heq.symm have hV : Tendsto (fun η : ℝ => (η : ℂ) * V η) (𝓝[>] (0 : ℝ)) (𝓝 w) := by convert hW.add hdiff using 1 · funext η; ring · simp convert hP.mul hV using 1 · funext η; ring namespace ActualEisensteinCubic section open EisensteinEmbedding ConcreteTraceCRT Complex private theorem breveE_norm_one_all (z : ℂ) : ‖ShortDraftTrace.breveE z‖ = 1 := by change ‖Complex.exp (2 * Real.pi * Complex.I * (z + star z))‖ = 1 rw [Complex.norm_exp] have hr : (2 * (Real.pi : ℂ) * Complex.I * (z + star z)).re = 0 := by simp [Complex.mul_re] rw [hr, Real.exp_zero] theorem fixedDualPhase_norm_one (c y : O) : ‖fixedDualPhase c y‖ = 1 := by unfold fixedDualPhase exact breveE_norm_one_all _ end open scoped Topology open Filter EisensteinEmbedding ConcreteTraceCRT Complex theorem variableDualPhase_abel_limit (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) : letI : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span (by norm_num : (2 : O) ≠ 0) letI : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ let c : O := ActualEisensteinCoordinates.eval a b let a2 := (ActualEisensteinCoordinates.coords (2 : O)).1 let b2 := (ActualEisensteinCoordinates.coords (2 : O)).2 let L2 : ℂ := ((2 / (Real.sqrt 3 * (((a2*a2-a2*b2+b2*b2 : ℤ) : ℝ))) : ℝ) : ℂ) let K : ℂ := (((4 / OscSpecial.q (a : ℝ) (b : ℝ) : ℝ) : ℂ) * L2) Tendsto (fun η : ℝ => (η : ℂ) * (∑' y : O, fixedDualPhase c y * Complex.exp (-(Real.pi : ℂ) * (OscSpecial.dualScale η (a : ℝ) (b : ℝ) : ℂ) * (‖eisEmbedding y‖ ^ 2 : ℂ)))) (𝓝[>] (0 : ℝ)) (𝓝 (K * ∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r))) := by let h2 : (2 : O) ≠ 0 := by norm_num let : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span h2 let : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ let c : O := ActualEisensteinCoordinates.eval a b let a2 := (ActualEisensteinCoordinates.coords (2 : O)).1 let b2 := (ActualEisensteinCoordinates.coords (2 : O)).2 let L2 : ℂ := ((2 / (Real.sqrt 3 * (((a2*a2-a2*b2+b2*b2 : ℤ) : ℝ))) : ℝ) : ℂ) let K : ℂ := (((4 / OscSpecial.q (a : ℝ) (b : ℝ) : ℝ) : ℂ) * L2) let W (η : ℝ) (y : O) := Complex.exp (-(Real.pi : ℂ) * (OscSpecial.dualScale η (a : ℝ) (b : ℝ) : ℂ) * (‖eisEmbedding y‖ ^ 2 : ℂ)) have hqZ := coordinate_norm_pos_of_nonzero a b hc have hq : 0 < OscSpecial.q (a : ℝ) (b : ℝ) := by change 0 < (a : ℝ)^2 - (a : ℝ)*(b : ℝ)+(b : ℝ)^2 exact_mod_cast (show 0 < a^2-a*b+b^2 by simpa only [pow_two] using hqZ) have hfiber (r : O ⧸ Ideal.span {(2 : O)}) : Tendsto (fun η : ℝ => (η : ℂ) * (∑' w : O, W η (GaussianShiftedPartition.representative 2 r + 2*w))) (𝓝[>] (0 : ℝ)) (𝓝 K) := by let F : ℝ → ℂ := fun t => ∑' w : O, Complex.exp (-(Real.pi : ℂ) * (t : ℂ) * (‖eisEmbedding (GaussianShiftedPartition.representative 2 r + 2*w)‖ ^ 2 : ℂ)) have hbase : Tendsto (fun t : ℝ => (t : ℂ) * F t) (𝓝[>] (0 : ℝ)) (𝓝 L2) := by simpa only [F, L2, a2, b2] using actual_O_fiber_gaussian_mass (2 : O) (GaussianShiftedPartition.representative 2 r) h2 have h := OscSpecial.abel_mass_dual_scale (a : ℝ) (b : ℝ) hq F L2 hbase simpa only [W, F, K] using h have hsum : Tendsto (fun η : ℝ => ∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r) * ((η : ℂ) * (∑' w : O, W η (GaussianShiftedPartition.representative 2 r + 2*w)))) (𝓝[>] (0 : ℝ)) (𝓝 (∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r) * K)) := by apply tendsto_finsetSum Finset.univ intro r hr exact (hfiber r).const_mul _ have hpoint (η : ℝ) (hη : 0 < η) : (η : ℂ) * (∑' y : O, fixedDualPhase c y * W η y) = ∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r) * ((η : ℂ) * (∑' w : O, W η (GaussianShiftedPartition.representative 2 r + 2*w))) := by have hrpos : 0 < OscSpecial.r η (a : ℝ) (b : ℝ) := by unfold OscSpecial.r positivity have htpos : 0 < OscSpecial.dualScale η (a : ℝ) (b : ℝ) := by unfold OscSpecial.dualScale positivity have hbase := (eis_gaussian_summable htpos).norm have hkernel : Summable (fun y : O => fixedDualPhase c y * W η y) := by apply hbase.of_norm_bounded intro y simp only [norm_mul] have hp : ‖fixedDualPhase c y‖ = 1 := fixedDualPhase_norm_one c y rw [hp, one_mul] have hpart := fixedDualPhase_weighted_partition c (W η) hkernel rw [hpart, Finset.mul_sum] apply Finset.sum_congr rfl intro r hr ring have heq : (fun η : ℝ => (η : ℂ) * (∑' y : O, fixedDualPhase c y * W η y)) =ᶠ[ 𝓝[>] (0 : ℝ)] (fun η : ℝ => ∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r) * ((η : ℂ) * (∑' w : O, W η (GaussianShiftedPartition.representative 2 r + 2*w)))) := by filter_upwards [self_mem_nhdsWithin] with η hη exact hpoint η hη have hlim := hsum.congr' heq.symm have hKsum : (∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r) * K) = K * ∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r) := by rw [← Finset.sum_mul, mul_comm] rw [hKsum] at hlim exact hlim end ActualEisensteinCubic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.ThetaLocalRows namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology namespace ActualEisensteinCubic section open EisensteinEmbedding ConcreteTraceCRT Complex theorem actual_fixed_kernel_eq_dualFixedTerm (a b k l : ℤ) (η : ℝ) : let c : O := ActualEisensteinCoordinates.eval a b let y : O := dualFrequencyEquiv (k,l) Complex.exp (-(Real.pi : ℂ) * (OscSpecial.dualScale η (a : ℝ) (b : ℝ) : ℂ) * (‖eisEmbedding y‖ ^ 2 : ℂ)) * fixedDualPhase c y = OscSpecial.dualFixedTerm η (a : ℝ) (b : ℝ) (k,l) := by let c : O := ActualEisensteinCoordinates.eval a b let y : O := dualFrequencyEquiv (k,l) have hnormC : ((‖eisEmbedding y‖ : ℂ)^2) = (((k^2+k*l+l^2 : ℤ) : ℂ)) := by exact_mod_cast dualFrequencyEquiv_norm_sq k l have hreal : Complex.exp (-(Real.pi : ℂ) * (OscSpecial.dualScale η (a : ℝ) (b : ℝ) : ℂ) * (‖eisEmbedding y‖ ^ 2 : ℂ)) = (OscSpecial.dualAmp η (a : ℝ) (b : ℝ) (k,l) : ℂ) := by rw [hnormC] dsimp [OscSpecial.dualAmp, OscSpecial.dualScale, OscSpecial.dualQ] rw [Complex.ofReal_exp] congr 1 push_cast ring have hphase : fixedDualPhase c y = Complex.exp (Complex.I * (OscSpecial.phaseAngle (a : ℝ) (b : ℝ) (k,l) : ℂ)) := by have h := breveE_dual_quadratic_real_scale 1 a b k l have harg : fixedDualPhase c y = Complex.exp (-(2 * Real.pi * Complex.I * (((a-b)*k^2+2*a*k*l+b*l^2 : ℤ) : ℂ)) / (4 : ℂ)) := by change ShortDraftTrace.breveE (eisEmbedding (-(ActualEisensteinCoordinates.eval a b * (ActualEisensteinCoordinates.eval (k+l) k)^2)) / eisLam / (4 : ℂ)) = _ simpa using h rw [harg] congr 1 dsimp [OscSpecial.phaseAngle, OscSpecial.dualTrace] push_cast ring dsimp only rw [hreal, hphase] rfl open EisensteinEmbedding ConcreteTraceCRT Complex open scoped Topology open Filter noncomputable def actualVariableDualKernel (a b : ℤ) (η : ℝ) (y : O) : ℂ := Complex.exp (-(Real.pi : ℂ) * (OscSpecial.dualScale η (a : ℝ) (b : ℝ) : ℂ) * (‖eisEmbedding y‖ ^ 2 : ℂ)) * ShortDraftTrace.breveE (eisEmbedding (-(ActualEisensteinCoordinates.eval a b * y^2)) / eisLam / ((4 * OscSpecial.r η (a : ℝ) (b : ℝ) : ℝ) : ℂ)) noncomputable def actualFixedDualKernel (a b : ℤ) (η : ℝ) (y : O) : ℂ := Complex.exp (-(Real.pi : ℂ) * (OscSpecial.dualScale η (a : ℝ) (b : ℝ) : ℂ) * (‖eisEmbedding y‖ ^ 2 : ℂ)) * fixedDualPhase (ActualEisensteinCoordinates.eval a b) y private theorem dualScale_cast (η a b : ℝ) : (OscSpecial.dualScale η a b : ℂ) = (η : ℂ) * (OscSpecial.q a b : ℂ) / (4 * (OscSpecial.r η a b : ℂ)) := by dsimp [OscSpecial.dualScale] push_cast ring theorem actual_variable_kernel_eq_dualVarTerm (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) (η : ℝ) (hη : 0 < η) (z : ℤ × ℤ) : actualVariableDualKernel a b η (dualFrequencyEquiv z) = OscSpecial.dualVarTerm η (a : ℝ) (b : ℝ) z := by have hqZ := coordinate_norm_pos_of_nonzero a b hc have hq : 0 < OscSpecial.q (a : ℝ) (b : ℝ) := by change 0 < (a : ℝ)^2 - (a : ℝ)*(b : ℝ)+(b : ℝ)^2 exact_mod_cast (show 0 < a^2-a*b+b^2 by simpa only [pow_two] using hqZ) have h := (dual_gaussian_is_actual_trace_phase a b z.1 z.2 hc η hη).symm.trans (OscSpecial.dualGaussian_eq_dualVarTerm hη hq z) unfold actualVariableDualKernel rw [dualScale_cast] exact h theorem actual_fixed_kernel_eq_dualFixedTerm_point (a b : ℤ) (η : ℝ) (z : ℤ × ℤ) : actualFixedDualKernel a b η (dualFrequencyEquiv z) = OscSpecial.dualFixedTerm η (a : ℝ) (b : ℝ) z := by rcases z with ⟨k,l⟩ exact actual_fixed_kernel_eq_dualFixedTerm a b k l η theorem actual_dual_phase_error_tendsto_zero (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) : Tendsto (fun η : ℝ => η * ‖ (∑' y : O, actualVariableDualKernel a b η y) - (∑' y : O, actualFixedDualKernel a b η y)‖) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by have hqZ := coordinate_norm_pos_of_nonzero a b hc have hq : 0 < OscSpecial.q (a : ℝ) (b : ℝ) := by change 0 < (a : ℝ)^2 - (a : ℝ)*(b : ℝ)+(b : ℝ)^2 exact_mod_cast (show 0 < a^2-a*b+b^2 by simpa only [pow_two] using hqZ) have hbase := OscSpecial.normalized_dual_phase_sum_error_tendsto_zero hq apply hbase.congr' filter_upwards [self_mem_nhdsWithin] with η hη change 0 < η at hη have hvar : (∑' y : O, actualVariableDualKernel a b η y) = ∑' z : ℤ × ℤ, OscSpecial.dualVarTerm η (a : ℝ) (b : ℝ) z := by calc (∑' y : O, actualVariableDualKernel a b η y) = ∑' z : ℤ × ℤ, actualVariableDualKernel a b η (dualFrequencyEquiv z) := (dualFrequencyEquiv.tsum_eq (actualVariableDualKernel a b η)).symm _ = _ := by apply tsum_congr intro z exact actual_variable_kernel_eq_dualVarTerm a b hc η hη z have hfixed : (∑' y : O, actualFixedDualKernel a b η y) = ∑' z : ℤ × ℤ, OscSpecial.dualFixedTerm η (a : ℝ) (b : ℝ) z := by calc (∑' y : O, actualFixedDualKernel a b η y) = ∑' z : ℤ × ℤ, actualFixedDualKernel a b η (dualFrequencyEquiv z) := (dualFrequencyEquiv.tsum_eq (actualFixedDualKernel a b η)).symm _ = _ := by apply tsum_congr intro z exact actual_fixed_kernel_eq_dualFixedTerm_point a b η z rw [hvar, hfixed] end section open scoped Topology open Filter EisensteinEmbedding ConcreteTraceCRT Complex theorem actualFixedAbelLimit (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) : letI : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span (by norm_num : (2 : O) ≠ 0) letI : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ let c : O := ActualEisensteinCoordinates.eval a b let a2 := (ActualEisensteinCoordinates.coords (2 : O)).1 let b2 := (ActualEisensteinCoordinates.coords (2 : O)).2 let L2 : ℂ := ((2 / (Real.sqrt 3 * (((a2*a2-a2*b2+b2*b2 : ℤ) : ℝ))) : ℝ) : ℂ) let K : ℂ := (((4 / OscSpecial.q (a : ℝ) (b : ℝ) : ℝ) : ℂ) * L2) Tendsto (fun η : ℝ => (η : ℂ) * (∑' y : O, actualFixedDualKernel a b η y)) (𝓝[>] (0 : ℝ)) (𝓝 (K * ∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r))) := by simpa only [actualFixedDualKernel, mul_comm] using variableDualPhase_abel_limit a b hc end section open EisensteinEmbedding ConcreteTraceCRT Complex theorem actual_oscillatory_poisson_kernel (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) (η : ℝ) (hη : 0 < η) : let c : O := ActualEisensteinCoordinates.eval a b (∑' z : O, (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ))) = (1 / ((OscSpecial.R η (a : ℝ) (b : ℝ) : ℂ) ^ (1 / 2 : ℂ))) * ∑' y : O, actualVariableDualKernel a b η y := by dsimp only rw [actual_oscillatory_poisson a b hc η hη] congr 1 apply tsum_congr intro y unfold actualVariableDualKernel rw [dualScale_cast] end section open scoped Topology open Filter EisensteinEmbedding ConcreteTraceCRT Complex theorem actualVariableAbelLimit (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) : letI : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span (by norm_num : (2 : O) ≠ 0) letI : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ let c : O := ActualEisensteinCoordinates.eval a b let a2 := (ActualEisensteinCoordinates.coords (2 : O)).1 let b2 := (ActualEisensteinCoordinates.coords (2 : O)).2 let L2 : ℂ := ((2 / (Real.sqrt 3 * (((a2*a2-a2*b2+b2*b2 : ℤ) : ℝ))) : ℝ) : ℂ) let K : ℂ := (((4 / OscSpecial.q (a : ℝ) (b : ℝ) : ℝ) : ℂ) * L2) Tendsto (fun η : ℝ => (η : ℂ) * ((1 / ((OscSpecial.R η (a : ℝ) (b : ℝ) : ℂ) ^ (1/2 : ℂ))) * (∑' y : O, actualVariableDualKernel a b η y))) (𝓝[>] (0 : ℝ)) (𝓝 ((((Real.sqrt (OscSpecial.q (a : ℝ) (b : ℝ)) / 2 : ℝ) : ℂ) * (K * ∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r))))) := by have hqZ := coordinate_norm_pos_of_nonzero a b hc have hq : 0 < OscSpecial.q (a : ℝ) (b : ℝ) := by change 0 < (a : ℝ)^2 - (a : ℝ)*(b : ℝ)+(b : ℝ)^2 exact_mod_cast (show 0 < a^2-a*b+b^2 by simpa only [pow_two] using hqZ) exact abel_transfer (fun η => 1 / ((OscSpecial.R η (a : ℝ) (b : ℝ) : ℂ) ^ (1/2 : ℂ))) (fun η => ∑' y : O, actualVariableDualKernel a b η y) (fun η => ∑' y : O, actualFixedDualKernel a b η y) _ _ (OscSpecial.prefactor_tendsto hq) (actualFixedAbelLimit a b hc) (actual_dual_phase_error_tendsto_zero a b hc) theorem actualOriginalAbelDualLimit (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) : letI : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span (by norm_num : (2 : O) ≠ 0) letI : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ let c : O := ActualEisensteinCoordinates.eval a b let a2 := (ActualEisensteinCoordinates.coords (2 : O)).1 let b2 := (ActualEisensteinCoordinates.coords (2 : O)).2 let L2 : ℂ := ((2 / (Real.sqrt 3 * (((a2*a2-a2*b2+b2*b2 : ℤ) : ℝ))) : ℝ) : ℂ) let K : ℂ := (((4 / OscSpecial.q (a : ℝ) (b : ℝ) : ℝ) : ℂ) * L2) Tendsto (fun η : ℝ => (η : ℂ) * (∑' z : O, (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc) (Ideal.Quotient.mk (Ideal.span {c}) z ^ 2) * Complex.exp (-(Real.pi : ℂ) * (η : ℂ) * (‖eisEmbedding z‖ ^ 2 : ℂ)))) (𝓝[>] (0 : ℝ)) (𝓝 ((((Real.sqrt (OscSpecial.q (a : ℝ) (b : ℝ)) / 2 : ℝ) : ℂ) * (K * ∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r))))) := by apply (actualVariableAbelLimit a b hc).congr' filter_upwards [self_mem_nhdsWithin] with η hη change 0 < η at hη rw [actual_oscillatory_poisson_kernel a b hc η hη] end section theorem dual_abel_coefficient (a b : ℤ) (hq : 0 < OscSpecial.q (a : ℝ) (b : ℝ)) : let a2 := (ActualEisensteinCoordinates.coords (2 : O)).1 let b2 := (ActualEisensteinCoordinates.coords (2 : O)).2 (((4 / OscSpecial.q (a : ℝ) (b : ℝ) : ℝ) : ℂ) * ((2 / (Real.sqrt 3 * (((a2*a2-a2*b2+b2*b2 : ℤ) : ℝ))) : ℝ) : ℂ)) = ((2 / (Real.sqrt 3 * OscSpecial.q (a : ℝ) (b : ℝ)) : ℝ) : ℂ) := by dsimp only rw [two_coordinate_norm_four] have hqC : (OscSpecial.q (a : ℝ) (b : ℝ) : ℂ) ≠ 0 := by exact_mod_cast hq.ne' have hsC : (Real.sqrt 3 : ℂ) ≠ 0 := by exact_mod_cast (ne_of_gt (Real.sqrt_pos.2 (by norm_num : (0:ℝ) < 3))) push_cast field_simp [hqC, hsC] theorem full_dual_abel_coefficient (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) : let c : O := ActualEisensteinCoordinates.eval a b let q : ℝ := OscSpecial.q (a : ℝ) (b : ℝ) let a2 := (ActualEisensteinCoordinates.coords (2 : O)).1 let b2 := (ActualEisensteinCoordinates.coords (2 : O)).2 (((Real.sqrt q / 2 : ℝ) : ℂ) * (((4 / q : ℝ) : ℂ) * ((2 / (Real.sqrt 3 * (((a2*a2-a2*b2+b2*b2 : ℤ) : ℝ))) : ℝ) : ℂ))) = (((2 / (Real.sqrt 3 * ‖ConcreteTraceCRT.eisEmbedding c‖) : ℝ) : ℂ) / 2) := by dsimp only have hqZ := coordinate_norm_pos_of_nonzero a b hc have hq : 0 < OscSpecial.q (a : ℝ) (b : ℝ) := by change 0 < (a : ℝ)^2 - (a : ℝ)*(b : ℝ)+(b : ℝ)^2 exact_mod_cast (show 0 < a^2-a*b+b^2 by simpa only [pow_two] using hqZ) rw [dual_abel_coefficient a b hq] have hqnorm := osc_q_eq_eis_norm_sq a b have hsqrt : Real.sqrt (OscSpecial.q (a : ℝ) (b : ℝ)) = ‖ConcreteTraceCRT.eisEmbedding (ActualEisensteinCoordinates.eval a b)‖ := by rw [hqnorm, Real.sqrt_sq_eq_abs, abs_of_nonneg (norm_nonneg _)] rw [hsqrt, hqnorm] have hn : (‖ConcreteTraceCRT.eisEmbedding (ActualEisensteinCoordinates.eval a b)‖ : ℂ) ≠ 0 := by exact_mod_cast (ne_of_gt (norm_pos_iff.mpr (ConcreteTraceCRT.eisEmbedding_ne_zero hc))) have hs : (Real.sqrt 3 : ℂ) ≠ 0 := by exact_mod_cast (ne_of_gt (Real.sqrt_pos.2 (by norm_num : (0:ℝ) < 3))) push_cast field_simp [hn, hs] open scoped Topology open Filter EisensteinEmbedding ConcreteTraceCRT Complex theorem quadraticGammaO_eq_fourTerms (a b : ℤ) (hc : ActualEisensteinCoordinates.eval a b ≠ 0) : quadraticGammaO (ActualEisensteinCoordinates.eval a b) hc = breveGaussianFourTerms a b := by let c : O := ActualEisensteinCoordinates.eval a b let n : ℝ := ‖eisEmbedding c‖ let q : ℝ := OscSpecial.q (a : ℝ) (b : ℝ) let a2 := (ActualEisensteinCoordinates.coords (2 : O)).1 let b2 := (ActualEisensteinCoordinates.coords (2 : O)).2 let L2 : ℂ := ((2 / (Real.sqrt 3 * (((a2*a2-a2*b2+b2*b2 : ℤ) : ℝ))) : ℝ) : ℂ) let : Finite (O ⧸ Ideal.span {(2 : O)}) := finite_quotient_span (by norm_num : (2 : O) ≠ 0) let : Fintype (O ⧸ Ideal.span {(2 : O)}) := Fintype.ofFinite _ let S : ℂ := ∑ r : O ⧸ Ideal.span {(2 : O)}, fixedDualPhase c (GaussianShiftedPartition.representative 2 r) have hEq0 := tendsto_nhds_unique (original_abel_gamma_limit c hc) (actualOriginalAbelDualLimit a b hc) have hEq : (((2 / (Real.sqrt 3 * n) : ℝ) : ℂ) * quadraticGammaO c hc) = (((Real.sqrt q / 2 : ℝ) : ℂ) * ((((4 / q : ℝ) : ℂ) * L2) * S)) := by simpa only [c, n, q, a2, b2, L2, S, mul_assoc] using hEq0 have hC : (((Real.sqrt q / 2 : ℝ) : ℂ) * (((4 / q : ℝ) : ℂ) * L2)) = (((2 / (Real.sqrt 3 * n) : ℝ) : ℂ) / 2) := by simpa only [c, n, q, a2, b2, L2] using full_dual_abel_coefficient a b hc have hA : ((2 / (Real.sqrt 3 * n) : ℝ) : ℂ) ≠ 0 := by have hn : 0 < n := norm_pos_iff.mpr (eisEmbedding_ne_zero hc) have hs : 0 < Real.sqrt 3 := Real.sqrt_pos.2 (by norm_num) exact_mod_cast (ne_of_gt (div_pos (by norm_num : (0 : ℝ) < 2) (mul_pos hs hn))) have hG : quadraticGammaO c hc = S / 2 := by apply mul_left_cancel₀ hA calc ((2 / (Real.sqrt 3 * n) : ℝ) : ℂ) * quadraticGammaO c hc = ((Real.sqrt q / 2 : ℝ) : ℂ) * ((((4 / q : ℝ) : ℂ) * L2) * S) := hEq _ = (((2 / (Real.sqrt 3 * n) : ℝ) : ℂ) / 2) * S := by rw [← mul_assoc, hC] _ = ((2 / (Real.sqrt 3 * n) : ℝ) : ℂ) * (S / 2) := by ring change quadraticGammaO c hc = breveGaussianFourTerms a b calc quadraticGammaO c hc = S / 2 := hG _ = breveGaussianFourTerms a b := fixedDualPhase_four_terms a b end end ActualEisensteinCubic theorem theta_counter_lambda_eq : ActualEisensteinCubic.lambda = ActualEisensteinCoordinates.eval (-1) 1 := by have homega : ActualEisensteinCubic.omega = ActualEisensteinCoordinates.omega := by rfl rw [ActualEisensteinCubic.lambda, ActualEisensteinCoordinates.eval, homega] ring open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar namespace ShortDraftLocal variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] end ShortDraftLocal end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.LocalNonvanishing namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics namespace TargetLocalReduction end TargetLocalReduction namespace ActualEisensteinCubic open AddChar MulChar end ActualEisensteinCubic open scoped ArithmeticFunction.Moebius open Filter namespace ShortDraftHeckeBridge abbrev O := ActualEisensteinSieve.O noncomputable def normFiberCoeff (weight : Ideal O → ℂ) (n : ℕ) : ℂ := by classical exact ∑ I ∈ (Ideal.finite_setOfPred_absNorm_eq (S := O) n).toFinset, weight I noncomputable def pairInverseCoeff {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) : ℕ → ℂ := LSeries.convolution (fun n : ℕ => χ n * (ArithmeticFunction.moebius n : ℂ)) (fun n : ℕ => ψ n * (ArithmeticFunction.moebius n : ℂ)) theorem normFiber_LSeries_eq_pair_inverse {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (weight : Ideal O → ℂ) (hcoeff : ∀ n : ℕ, n ≠ 0 → normFiberCoeff weight n = pairInverseCoeff χ ψ n) (s : ℂ) : LSeries (normFiberCoeff weight) s = LSeries (pairInverseCoeff χ ψ) s := by exact LSeries_congr (fun {n} hn => hcoeff n hn) s theorem pair_inverse_euler_identity {q r : ℕ} [NeZero q] [NeZero r] (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (s : ℂ) (hs : 1 < s.re) : χ.LFunction s * ψ.LFunction s * LSeries (pairInverseCoeff χ ψ) s = 1 := by have hχsum : LSeriesSummable (fun n : ℕ => χ n * (ArithmeticFunction.moebius n : ℂ)) s := by exact DirichletCharacter.LSeriesSummable_mul χ (ArithmeticFunction.LSeriesSummable_moebius_iff.mpr hs) have hψsum : LSeriesSummable (fun n : ℕ => ψ n * (ArithmeticFunction.moebius n : ℂ)) s := by exact DirichletCharacter.LSeriesSummable_mul ψ (ArithmeticFunction.LSeriesSummable_moebius_iff.mpr hs) rw [pairInverseCoeff, LSeries_convolution' hχsum hψsum, χ.LFunction_eq_LSeries hs, ψ.LFunction_eq_LSeries hs] have hχ := DirichletCharacter.LSeries.mul_mu_eq_one χ hs have hψ := DirichletCharacter.LSeries.mul_mu_eq_one ψ hs change LSeries (χ ·) s * LSeries (fun n : ℕ => χ n * (ArithmeticFunction.moebius n : ℂ)) s = 1 at hχ change LSeries (ψ ·) s * LSeries (fun n : ℕ => ψ n * (ArithmeticFunction.moebius n : ℂ)) s = 1 at hψ calc LSeries (χ ·) s * LSeries (ψ ·) s * (LSeries (fun n : ℕ => χ n * (ArithmeticFunction.moebius n : ℂ)) s * LSeries (fun n : ℕ => ψ n * (ArithmeticFunction.moebius n : ℂ)) s) = (LSeries (χ ·) s * LSeries (fun n : ℕ => χ n * (ArithmeticFunction.moebius n : ℂ)) s) * (LSeries (ψ ·) s * LSeries (fun n : ℕ => ψ n * (ArithmeticFunction.moebius n : ℂ)) s) := by ring _ = 1 := by rw [hχ, hψ]; ring end ShortDraftHeckeBridge private theorem pairing_algebra (g1 g2 gm G alpha eps t : ℂ) (halpha : alpha * star alpha = 1) (hg1 : g1 * star g1 = 1) (hprod : g1 * g2 = -alpha * G) (hpair : g1 * gm = eps) : (-star g1) * G * t = (star alpha * g2) * t ∧ (-gm) * G * t = eps * (star alpha * g2) * t ∧ (-g1) * star G * t⁻¹ = (alpha * star g2) * t⁻¹ ∧ (-star gm) * star G * t⁻¹ = star eps * (alpha * star g2) * t⁻¹ := by have h2 : g2 = -(star g1) * alpha * G := by calc g2 = (g1 * star g1) * g2 := by rw [hg1]; ring _ = star g1 * (g1 * g2) := by ring _ = star g1 * (-alpha * G) := by rw [hprod] _ = _ := by ring have hA : star alpha * g2 = (-star g1) * G := by rw [h2] calc star alpha * (-(star g1) * alpha * G) = (alpha * star alpha) * ((-star g1) * G) := by ring _ = (-star g1) * G := by rw [halpha]; ring have hm : gm = eps * star g1 := by calc gm = (g1 * star g1) * gm := by rw [hg1]; ring _ = star g1 * (g1 * gm) := by ring _ = eps * star g1 := by rw [hpair]; ring have hB : (-gm) * G = eps * (star alpha * g2) := by rw [hm, hA] ring have hC : (-g1) * star G = alpha * star g2 := by have h := congrArg (fun z : ℂ => star z) hA simp only [star_mul, star_neg, star_star] at h calc (-g1) * star G = star G * (-g1) := by ring _ = star g2 * alpha := h.symm _ = alpha * star g2 := by ring have hD : (-star gm) * star G = star eps * (alpha * star g2) := by have h := congrArg (fun z : ℂ => star z) hB simpa only [star_mul, star_neg, star_star, mul_comm, mul_left_comm, mul_assoc] using h exact ⟨by rw [hA], by rw [hB], by rw [hC], by rw [hD]⟩ namespace ActualEisensteinCubic open EisensteinEmbedding ConcreteTraceCRT PrimitiveTrace open scoped ComplexConjugate private theorem breveGamma1_mul_star_one (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) (hprimary : lambda ^ 2 ∣ p - 1) : breveGamma1 P hgood p hP hp * star (breveGamma1 P hgood p hP hp) = 1 := by subst P let : Field (O ⧸ Ideal.span {p}) := quotientField (Ideal.span {p}) let : Fintype (O ⧸ Ideal.span {p}) := quotientFintype (Ideal.span {p}) let χ := canonicalSextic (Ideal.span {p}) hgood let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp let s : ℝ := ‖eisEmbedding p‖ have hψ : ψ.IsPrimitive := eisTraceModChar_breveE_primitive (Ideal.span {p}) p rfl hp have hχ1 : χ ≠ 1 := by simpa only [pow_one] using (canonicalSextic_pow_ne_one (Ideal.span {p}) hgood hchar (by decide : (1 : ℕ) ≠ 0) (by decide : (1 : ℕ) < 6)) have hnormO := primary_generator_mul_conj_eq_card (Ideal.span {p}) hgood p rfl hprimary have hnormC := congrArg eisEmbedding hnormO rw [map_mul, eisEmbedding_conjO, map_natCast] at hnormC have hs : (s : ℂ) ^ 2 = (Fintype.card (O ⧸ Ideal.span {p}) : ℂ) := by simpa only [s, ← starRingEnd_apply, Complex.mul_conj', Nat.card_eq_fintype_card] using hnormC have hsreal : s ^ 2 = (Fintype.card (O ⧸ Ideal.span {p}) : ℝ) := by exact Complex.ofReal_injective (by exact_mod_cast hs) have hcard : 0 < (Fintype.card (O ⧸ Ideal.span {p}) : ℝ) := by positivity have hsroot : s = Real.sqrt (Fintype.card (O ⧸ Ideal.span {p})) := by nlinarith [Real.sq_sqrt hcard.le, Real.sqrt_nonneg (Fintype.card (O ⧸ Ideal.span {p})), norm_nonneg (eisEmbedding p)] have hs0 : s ≠ 0 := by dsimp [s] exact (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hp)) have hnorm : ‖breveGamma1 (Ideal.span {p}) hgood p rfl hp‖ = 1 := by change ‖gaussSum χ ψ / (s : ℂ)‖ = 1 rw [norm_div, ShortDraftGauss.norm_gaussSum_eq_sqrt_card χ ψ hχ1 hψ] rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (norm_nonneg (eisEmbedding p))] rw [← hsroot] exact div_self hs0 rw [← starRingEnd_apply, Complex.mul_conj', hnorm] norm_num theorem first_poisson_prime_sign_pairing (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (p : O) (hP : P = Ideal.span {p}) (hp : p ≠ 0) (hprimary : lambda ^ 2 ∣ p - 1) (h : O) : let alpha : ℂ := eisEmbedding p / (‖eisEmbedding p‖ : ℂ) let g1 := breveGamma1 P hgood p hP hp let g2 := breveGamma2 P hgood p hP hp let gm := breveGammaMinus1 P hgood p hP hp let G := breveLocalG P hgood p hP hp let t := canonicalSextic P hgood (Ideal.Quotient.mk P h) let eps := canonicalSextic P hgood (Ideal.Quotient.mk P (-1 : O)) (-star g1) * G * t = (star alpha * g2) * t ∧ (-gm) * G * t = eps * (star alpha * g2) * t ∧ (-g1) * star G * t⁻¹ = (alpha * star g2) * t⁻¹ ∧ (-star gm) * star G * t⁻¹ = star eps * (alpha * star g2) * t⁻¹ := by have hz : eisEmbedding p ≠ 0 := eisEmbedding_ne_zero hp have hs : (‖eisEmbedding p‖ : ℂ) ≠ 0 := by exact_mod_cast (norm_ne_zero_iff.mpr hz) have hanorm : ‖eisEmbedding p / (‖eisEmbedding p‖ : ℂ)‖ = 1 := by rw [norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (norm_nonneg (eisEmbedding p))] exact div_self (norm_ne_zero_iff.mpr hz) have ha : (eisEmbedding p / (‖eisEmbedding p‖ : ℂ)) * star (eisEmbedding p / (‖eisEmbedding p‖ : ℂ)) = 1 := by rw [← starRingEnd_apply, Complex.mul_conj', hanorm] norm_num have hg1 := breveGamma1_mul_star_one P hgood hchar p hP hp hprimary have hprod := breveGamma1_gamma2_eq_neg_alpha_G P hgood hchar p hP hp hprimary have hprod' : breveGamma1 P hgood p hP hp * breveGamma2 P hgood p hP hp = -(eisEmbedding p / (‖eisEmbedding p‖ : ℂ)) * breveLocalG P hgood p hP hp := by simpa only [neg_div] using hprod have hpair := breveGamma1_gammaMinus1 P hgood hchar p hP hp hprimary dsimp only exact pairing_algebra (breveGamma1 P hgood p hP hp) (breveGamma2 P hgood p hP hp) (breveGammaMinus1 P hgood p hP hp) (breveLocalG P hgood p hP hp) (eisEmbedding p / (‖eisEmbedding p‖ : ℂ)) (canonicalSextic P hgood (Ideal.Quotient.mk P (-1 : O))) (canonicalSextic P hgood (Ideal.Quotient.mk P h)) ha hg1 hprod' hpair end ActualEisensteinCubic open MulChar AddChar namespace ShortDraftLocal variable {F : Type*} [Field F] [Fintype F] [DecidableEq F] end ShortDraftLocal end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Arithmetic.NormFiberMellin namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar namespace ShortDraftLocal end ShortDraftLocal open MulChar AddChar namespace ActualEisensteinCubic end ActualEisensteinCubic namespace ShortDraftHeckeBridge noncomputable def chiMinusThree : DirichletCharacter ℂ 3 := (quadraticChar (ZMod 3)).ringHomComp (Int.castRingHom ℂ) noncomputable def baseChangeWeight {q : ℕ} (χ : DirichletCharacter ℂ q) (I : Ideal O) : ℂ := (UniqueFactorizationMonoid.moebius I : ℂ) * χ (Ideal.absNorm I) theorem baseChangeWeight_prime {q : ℕ} (χ : DirichletCharacter ℂ q) (P : Ideal O) (hP : Prime P) : baseChangeWeight χ P = -χ (Ideal.absNorm P) := by rw [baseChangeWeight, hP.irreducible.moebius_eq] norm_num noncomputable def invCharAF {q : ℕ} (χ : DirichletCharacter ℂ q) : ArithmeticFunction ℂ := (toArithmeticFunction (χ ·)).pmul (ArithmeticFunction.moebius : ArithmeticFunction ℂ) theorem invCharAF_apply {q : ℕ} (χ : DirichletCharacter ℂ q) {n : ℕ} (hn : n ≠ 0) : invCharAF χ n = χ n * (ArithmeticFunction.moebius n : ℂ) := by change ((toArithmeticFunction (χ ·)).pmul (ArithmeticFunction.moebius : ArithmeticFunction ℂ)) n = _ rw [ArithmeticFunction.pmul_apply] simp [toArithmeticFunction, hn] private theorem invCharAF_mult {q : ℕ} (χ : DirichletCharacter ℂ q) : (invCharAF χ).IsMultiplicative := by exact (χ.isMultiplicative_toArithmeticFunction).pmul (ArithmeticFunction.isMultiplicative_moebius.intCast) noncomputable def pairAF {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) : ArithmeticFunction ℂ := invCharAF χ * invCharAF ψ theorem pairAF_mult {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) : (pairAF χ ψ).IsMultiplicative := (invCharAF_mult χ).mul (invCharAF_mult ψ) theorem pairAF_eq_pairInverseCoeff {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (n : ℕ) : pairAF χ ψ n = pairInverseCoeff χ ψ n := by rw [pairAF, ← ArithmeticFunction.coe_mul] apply congrFun exact (LSeries.convolution_congr (fun {k} hk => invCharAF_apply χ hk) (fun {k} hk => invCharAF_apply ψ hk)) theorem normFiber_eq_pair_of_prime_powers {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (weight : Ideal O → ℂ) (hb : (toArithmeticFunction (normFiberCoeff weight)).IsMultiplicative) (hlocal : ∀ p k : ℕ, p.Prime → (toArithmeticFunction (normFiberCoeff weight)) (p ^ k) = pairAF χ ψ (p ^ k)) (n : ℕ) (hn : n ≠ 0) : normFiberCoeff weight n = pairInverseCoeff χ ψ n := by have heq : toArithmeticFunction (normFiberCoeff weight) = pairAF χ ψ := (ArithmeticFunction.IsMultiplicative.eq_iff_eq_on_prime_powers _ hb _ (pairAF_mult χ ψ)).2 hlocal have h := congrFun (congrArg DFunLike.coe heq) n calc normFiberCoeff weight n = (toArithmeticFunction (normFiberCoeff weight)) n := by simp [toArithmeticFunction, hn] _ = pairAF χ ψ n := h _ = pairInverseCoeff χ ψ n := pairAF_eq_pairInverseCoeff χ ψ n theorem pairAF_prime {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) {p : ℕ} (hp : p.Prime) : pairAF χ ψ p = -(χ p + ψ p) := by have h1χ : invCharAF χ 1 = 1 := (invCharAF_mult χ).map_one have h1ψ : invCharAF ψ 1 = 1 := (invCharAF_mult ψ).map_one have hpχ : invCharAF χ p = -χ p := by rw [invCharAF_apply χ hp.ne_zero, ArithmeticFunction.moebius_apply_prime hp] simp have hpψ : invCharAF ψ p = -ψ p := by rw [invCharAF_apply ψ hp.ne_zero, ArithmeticFunction.moebius_apply_prime hp] simp rw [pairAF, ArithmeticFunction.mul_apply] conv_lhs => rw [Nat.sum_divisorsAntidiagonal (fun a b => invCharAF χ a * invCharAF ψ b)] rw [hp.divisors] have hnot : 1 ∉ ({p} : Finset ℕ) := by simpa using hp.ne_one.symm rw [Finset.sum_insert hnot, Finset.sum_singleton] simp [Nat.div_one, Nat.div_self hp.pos, h1χ, h1ψ, hpχ, hpψ] theorem pairAF_prime_sq {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) {p : ℕ} (hp : p.Prime) : pairAF χ ψ (p ^ 2) = χ p * ψ p := by have h1χ : invCharAF χ 1 = 1 := (invCharAF_mult χ).map_one have h1ψ : invCharAF ψ 1 = 1 := (invCharAF_mult ψ).map_one have hpχ : invCharAF χ p = -χ p := by rw [invCharAF_apply χ hp.ne_zero, ArithmeticFunction.moebius_apply_prime hp] simp have hpψ : invCharAF ψ p = -ψ p := by rw [invCharAF_apply ψ hp.ne_zero, ArithmeticFunction.moebius_apply_prime hp] simp have hp2χ : invCharAF χ (p ^ 2) = 0 := by rw [invCharAF_apply χ (pow_ne_zero 2 hp.ne_zero), ArithmeticFunction.moebius_apply_prime_pow hp (by decide)] simp have hp2ψ : invCharAF ψ (p ^ 2) = 0 := by rw [invCharAF_apply ψ (pow_ne_zero 2 hp.ne_zero), ArithmeticFunction.moebius_apply_prime_pow hp (by decide)] simp have hdiv : (p ^ 2).divisors = ({1, p, p ^ 2} : Finset ℕ) := by ext x rw [Nat.mem_divisors_prime_pow hp 2] simp only [Finset.mem_insert, Finset.mem_singleton] constructor · rintro ⟨j, hj, rfl⟩ interval_cases j <;> simp · rintro (rfl | rfl | rfl) · exact ⟨0, by decide, by simp⟩ · exact ⟨1, by decide, by simp⟩ · exact ⟨2, by decide, by simp⟩ rw [pairAF, ArithmeticFunction.mul_apply] conv_lhs => rw [Nat.sum_divisorsAntidiagonal (fun a b => invCharAF χ a * invCharAF ψ b)] rw [hdiv] have hpge : 2 ≤ p := hp.two_le have h1p2 : 1 ≠ p ^ 2 := by nlinarith have hpp2 : p ≠ p ^ 2 := by nlinarith have hnot1 : 1 ∉ ({p, p ^ 2} : Finset ℕ) := by simp [hp.ne_one.symm, h1p2] have hnotp : p ∉ ({p ^ 2} : Finset ℕ) := by simp [hpp2] rw [Finset.sum_insert hnot1, Finset.sum_insert hnotp, Finset.sum_singleton] have hdivp : p ^ 2 / p = p := by simp [pow_two, hp.pos] simp [Nat.div_one, hdivp, h1χ, hpχ, hpψ, hp2χ, hp2ψ] theorem chiMinusThree_two : chiMinusThree (2 : ℕ) = -1 := by have h3 : ringChar (ZMod 3) ≠ 2 := by rw [ZMod.ringChar_zmod_n]; decide have h2 : (2 : ZMod 3) ≠ 0 := by decide have h21 : (2 : ZMod 3) ≠ 1 := by decide change ((quadraticChar (ZMod 3) (2 : ZMod 3) : ℤ) : ℂ) = -1 rw [quadraticChar_eq_pow_of_char_ne_two h3 h2] simp [h21] theorem chiMinusThree_ne_one : chiMinusThree ≠ 1 := by intro h have hh := congrArg (fun ξ : DirichletCharacter ℂ 3 => ξ (2 : ℕ)) h rw [chiMinusThree_two] at hh have hunit : IsUnit (2 : ZMod 3) := by decide change (-1 : ℂ) = (1 : DirichletCharacter ℂ 3) (2 : ZMod 3) at hh rw [MulChar.one_apply hunit] at hh norm_num at hh theorem not_both_principal {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) : ¬ ((χ.changeLevel (Nat.dvd_mul_right q 3) = 1) ∧ χ.changeLevel (Nat.dvd_mul_right q 3) * chiMinusThree.changeLevel (Nat.dvd_mul_left 3 q) = 1) := by rintro ⟨hχ, hprod⟩ rw [hχ, one_mul] at hprod have hη : chiMinusThree = 1 := (DirichletCharacter.changeLevel_eq_one_iff (Nat.dvd_mul_left 3 q)).mp hprod exact chiMinusThree_ne_one hη end ShortDraftHeckeBridge open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology namespace ShortDraftHeckeBridge end ShortDraftHeckeBridge end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Hecke.NormFiberCharacters namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology namespace ShortDraftHeckeBridge noncomputable def baseChangeChar {q : ℕ} (χ : DirichletCharacter ℂ q) : DirichletCharacter ℂ (q * 3) := χ.changeLevel (Nat.dvd_mul_right q 3) * chiMinusThree.changeLevel (Nat.dvd_mul_left 3 q) theorem baseChangeChar_ne_one_of_one {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) (hχ : χ = 1) : baseChangeChar χ ≠ 1 := by intro h apply not_both_principal χ constructor · simp [hχ] · exact h end ShortDraftHeckeBridge namespace ActualEisensteinCubic open MulChar AddChar end ActualEisensteinCubic namespace ShortDraftHeckeBridge theorem ideals_isRelPrime_of_norms_coprime (I J : Ideal O) (h : (Ideal.absNorm I).Coprime (Ideal.absNorm J)) : IsRelPrime I J := by have hcast : IsCoprime ((Ideal.absNorm I : ℕ) : O) ((Ideal.absNorm J : ℕ) : O) := by simpa only [map_natCast] using (Nat.Coprime.isCoprime h).map (Int.castRingHom O) obtain ⟨a, b, hab⟩ := hcast apply IsCoprime.isRelPrime apply Ideal.isCoprime_iff_exists.mpr refine ⟨a * (Ideal.absNorm I : O), I.mul_mem_left a (Ideal.absNorm_mem I), b * (Ideal.absNorm J : O), J.mul_mem_left b (Ideal.absNorm_mem J), hab⟩ theorem baseChangeWeight_mul_of_coprime_norms {q : ℕ} (χ : DirichletCharacter ℂ q) (I J : Ideal O) (h : (Ideal.absNorm I).Coprime (Ideal.absNorm J)) : baseChangeWeight χ (I * J) = baseChangeWeight χ I * baseChangeWeight χ J := by have hrel := ideals_isRelPrime_of_norms_coprime I J h simp only [baseChangeWeight, map_mul, hrel.moebius_mul, Int.cast_mul, Nat.cast_mul] ring theorem baseChangeChar_apply_of_coprime {q : ℕ} (χ : DirichletCharacter ℂ q) (n : ℕ) (h : n.Coprime (q * 3)) : baseChangeChar χ n = χ n * chiMinusThree n := by have hc : IsCoprime (n : ℤ) (q * 3 : ℕ) := by simpa [Int.isCoprime_iff_nat_coprime, Int.natAbs_mul] using h rw [baseChangeChar, MulChar.mul_apply] have hχ : χ.changeLevel (Nat.dvd_mul_right q 3) n = χ n := by simpa using (DirichletCharacter.changeLevel_eq_cast_of_dvd' χ (Nat.dvd_mul_right q 3) hc) have hη : chiMinusThree.changeLevel (Nat.dvd_mul_left 3 q) n = chiMinusThree n := by simpa using (DirichletCharacter.changeLevel_eq_cast_of_dvd' chiMinusThree (Nat.dvd_mul_left 3 q) hc) rw [hχ, hη] theorem chiMinusThree_three : chiMinusThree (3 : ℕ) = 0 := by simpa using (DirichletCharacter.apply_eq_zero_iff chiMinusThree 3).mpr (by simp [Int.isCoprime_iff_nat_coprime]) theorem baseChangeChar_three {q : ℕ} (χ : DirichletCharacter ℂ q) : baseChangeChar χ (3 : ℕ) = 0 := by simpa using (DirichletCharacter.apply_eq_zero_iff (baseChangeChar χ) 3).mpr (by intro hc have hn : Nat.Coprime 3 (q * 3) := by simpa [Int.isCoprime_iff_nat_coprime, Int.natAbs_mul] using hc have hself : Nat.Coprime 3 3 := hn.of_dvd_right (Nat.dvd_mul_left 3 q) norm_num at hself) private abbrev K := CyclotomicField 3 ℚ private theorem instIsCyclotomicExtensionSingletonNatSetOfNatRatK : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ private theorem instIsGaloisRatK : IsGalois ℚ K := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK exact IsCyclotomicExtension.isGalois {3} ℚ K private theorem orderOf_mod3_eq_one {p : ℕ} (h : p % 3 = 1) : orderOf (p : ZMod 3) = 1 := by have hc : (p : ZMod 3) = 1 := (ZMod.natCast_eq_natCast_iff' p 1 3).2 (by simpa using h) simp [hc] private theorem orderOf_mod3_eq_two {p : ℕ} (h : p % 3 = 2) : orderOf (p : ZMod 3) = 2 := by have hc : (p : ZMod 3) = 2 := (ZMod.natCast_eq_natCast_iff' p 2 3).2 (by simpa using h) rw [hc] have hdvd : orderOf (2 : ZMod 3) ∣ 2 := orderOf_dvd_of_pow_eq_one (by decide : (2 : ZMod 3) ^ 2 = 1) rcases (Nat.dvd_prime (by decide : Nat.Prime 2)).1 hdvd with h1 | h2 · have h21 : (2 : ZMod 3) = 1 := orderOf_eq_one_iff.mp h1 exact False.elim ((by decide : (2 : ZMod 3) ≠ 1) h21) · exact h2 private theorem degree_two : Module.finrank ℚ K = 2 := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK rw [IsCyclotomicExtension.Rat.finrank 3 K] decide private theorem gal_card_two : Nat.card Gal(K/ℚ) = 2 := by letI : IsGalois ℚ K := instIsGaloisRatK rw [IsGaloisGroup.card_eq_finrank Gal(K/ℚ) ℚ K] exact degree_two private theorem not_dvd_three {p : ℕ} (hp : p.Prime) (hneq : p ≠ 3) : ¬ p ∣ 3 := by intro hd have h := (Nat.dvd_prime (by decide : Nat.Prime 3)).1 hd rcases h with h1 | h3 · exact hp.ne_one h1 · exact hneq h3 theorem split_count_of_mod_one {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 1) : ((Ideal.span {(p : ℤ)}).primesOver O).ncard = 2 := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK letI : IsGalois ℚ K := instIsGaloisRatK let : Fact p.Prime := ⟨hp⟩ have hneq : p ≠ 3 := by intro heq subst p norm_num at hmod have hnd := not_dvd_three hp hneq have hmain := Ideal.ncard_primesOver_mul_ramificationIdxIn_mul_inertiaDegIn (Ideal.span {(p : ℤ)}) O Gal(K/ℚ) rw [IsCyclotomicExtension.Rat.ramificationIdxIn_eq_of_not_dvd p K hnd, IsCyclotomicExtension.Rat.inertiaDegIn_eq_of_not_dvd p K hnd, orderOf_mod3_eq_one hmod, gal_card_two] at hmain omega theorem inert_count_of_mod_two {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 2) : ((Ideal.span {(p : ℤ)}).primesOver O).ncard = 1 := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK letI : IsGalois ℚ K := instIsGaloisRatK let : Fact p.Prime := ⟨hp⟩ have hneq : p ≠ 3 := by intro heq subst p norm_num at hmod have hnd := not_dvd_three hp hneq have hmain := Ideal.ncard_primesOver_mul_ramificationIdxIn_mul_inertiaDegIn (Ideal.span {(p : ℤ)}) O Gal(K/ℚ) rw [IsCyclotomicExtension.Rat.ramificationIdxIn_eq_of_not_dvd p K hnd, IsCyclotomicExtension.Rat.inertiaDegIn_eq_of_not_dvd p K hnd, orderOf_mod3_eq_two hmod, gal_card_two] at hmain omega theorem ramified_count : ((Ideal.span {(3 : ℤ)}).primesOver O).ncard = 1 := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK let : Fact (Nat.Prime 3) := ⟨by decide⟩ exact IsCyclotomicExtension.Rat.ncard_primesOver_of_prime 3 K theorem absNorm_split {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 1) (P : Ideal O) [P.IsPrime] [P.LiesOver (Ideal.span {(p : ℤ)})] : Ideal.absNorm P = p := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK letI : IsGalois ℚ K := instIsGaloisRatK let : Fact p.Prime := ⟨hp⟩ have hneq : p ≠ 3 := by intro heq subst p norm_num at hmod have hnd := not_dvd_three hp hneq have hf : P.inertiaDeg ℤ = 1 := by rw [← Ideal.inertiaDegIn_eq_inertiaDeg (Ideal.span {(p : ℤ)}) P Gal(K/ℚ), IsCyclotomicExtension.Rat.inertiaDegIn_eq_of_not_dvd p K hnd, orderOf_mod3_eq_one hmod] rw [← Ideal.pow_inertiaDeg p P, hf, pow_one] theorem absNorm_inert {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 2) (P : Ideal O) [P.IsPrime] [P.LiesOver (Ideal.span {(p : ℤ)})] : Ideal.absNorm P = p ^ 2 := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK letI : IsGalois ℚ K := instIsGaloisRatK let : Fact p.Prime := ⟨hp⟩ have hneq : p ≠ 3 := by intro heq subst p norm_num at hmod have hnd := not_dvd_three hp hneq have hf : P.inertiaDeg ℤ = 2 := by rw [← Ideal.inertiaDegIn_eq_inertiaDeg (Ideal.span {(p : ℤ)}) P Gal(K/ℚ), IsCyclotomicExtension.Rat.inertiaDegIn_eq_of_not_dvd p K hnd, orderOf_mod3_eq_two hmod] rw [← Ideal.pow_inertiaDeg p P, hf] theorem absNorm_ramified (P : Ideal O) [P.IsPrime] [P.LiesOver (Ideal.span {(3 : ℤ)})] : Ideal.absNorm P = 3 := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK letI : IsGalois ℚ K := instIsGaloisRatK let : Fact (Nat.Prime 3) := ⟨by decide⟩ have hfin : (Ideal.span {(3 : ℤ)}).inertiaDegIn O = 1 := by simpa using IsCyclotomicExtension.Rat.inertiaDegIn_eq_of_prime 3 K have hf : P.inertiaDeg ℤ = 1 := by rw [← Ideal.inertiaDegIn_eq_inertiaDeg (Ideal.span {(3 : ℤ)}) P Gal(K/ℚ)] exact hfin rw [← Ideal.pow_inertiaDeg 3 P, hf, pow_one] theorem norm_prime_implies_over {p : ℕ} (hp : p.Prime) (I : Ideal O) (hI : Ideal.absNorm I = p) : I ∈ (Ideal.span {(p : ℤ)}).primesOver O := by have hprime : I.IsPrime := Ideal.isPrime_of_irreducible_absNorm (by rw [hI] exact (Nat.irreducible_iff_nat_prime p).2 hp) have hover : I.LiesOver (Ideal.span {(p : ℤ)}) := by rw [Ideal.liesOver_iff] rw [Ideal.under_def, algebraMap_int_eq] simpa [hI] using Ideal.span_singleton_absNorm (I := I) (hI ▸ hp) exact ⟨hprime, hover⟩ theorem norm_p_fiber_split {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 1) : {I : Ideal O | Ideal.absNorm I = p} = (Ideal.span {(p : ℤ)}).primesOver O := by ext I constructor · exact norm_prime_implies_over hp I · intro hI let : I.IsPrime := hI.1 let : I.LiesOver (Ideal.span {(p : ℤ)}) := hI.2 exact absNorm_split hp hmod I theorem norm_p_fiber_inert {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 2) : {I : Ideal O | Ideal.absNorm I = p} = ∅ := by ext I simp only [Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false] intro hI have hOver := norm_prime_implies_over hp I hI let : I.IsPrime := hOver.1 let : I.LiesOver (Ideal.span {(p : ℤ)}) := hOver.2 have hNorm := absNorm_inert hp hmod I have hpge := hp.two_le nlinarith theorem norm_three_fiber : {I : Ideal O | Ideal.absNorm I = 3} = (Ideal.span {(3 : ℤ)}).primesOver O := by ext I constructor · exact norm_prime_implies_over (by decide) I · intro hI let : I.IsPrime := hI.1 let : I.LiesOver (Ideal.span {(3 : ℤ)}) := hI.2 exact absNorm_ramified I theorem norm_p_sq_fiber_inert {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 2) : {I : Ideal O | Ideal.absNorm I = p ^ 2} = (Ideal.span {(p : ℤ)}).primesOver O := by ext I constructor · intro hI have hdiv : p ∣ Ideal.absNorm I := by rw [hI] exact dvd_pow_self p (by decide) obtain ⟨P, hPmax, hPunder, hPdiv⟩ := Ideal.exists_isMaximal_dvd_of_dvd_absNorm' hp I hdiv have : P.IsPrime := hPmax.isPrime have : P.LiesOver (Ideal.span {(p : ℤ)}) := ⟨hPunder.symm⟩ have hPN : Ideal.absNorm P = p ^ 2 := absNorm_inert hp hmod P obtain ⟨J, hIJ⟩ := hPdiv have hJN : Ideal.absNorm J = 1 := by have heq := congrArg Ideal.absNorm hIJ simp only [map_mul] at heq rw [hI, hPN] at heq have hp2 : 0 < p ^ 2 := pow_pos hp.pos 2 nlinarith have hJtop : J = ⊤ := Ideal.absNorm_eq_one_iff.mp hJN subst J simp only [Ideal.mul_top] at hIJ subst I exact ⟨inferInstance, inferInstance⟩ · intro hI let : I.IsPrime := hI.1 let : I.LiesOver (Ideal.span {(p : ℤ)}) := hI.2 exact absNorm_inert hp hmod I theorem norm_p_sq_split_factors {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 1) (I : Ideal O) (hI : Ideal.absNorm I = p ^ 2) : ∃ P Q : Ideal O, P ∈ (Ideal.span {(p : ℤ)}).primesOver O ∧ Q ∈ (Ideal.span {(p : ℤ)}).primesOver O ∧ I = P * Q := by have hdiv : p ∣ Ideal.absNorm I := by rw [hI] exact dvd_pow_self p (by decide) obtain ⟨P, hPmax, hPunder, hPdiv⟩ := Ideal.exists_isMaximal_dvd_of_dvd_absNorm' hp I hdiv have : P.IsPrime := hPmax.isPrime have : P.LiesOver (Ideal.span {(p : ℤ)}) := ⟨hPunder.symm⟩ have hPN : Ideal.absNorm P = p := absNorm_split hp hmod P obtain ⟨Q, hIQ⟩ := hPdiv have hQN : Ideal.absNorm Q = p := by have heq := congrArg Ideal.absNorm hIQ simp only [map_mul] at heq rw [hI, hPN] at heq have hppos := hp.pos nlinarith exact ⟨P, Q, ⟨inferInstance, inferInstance⟩, norm_prime_implies_over hp Q hQN, hIQ⟩ theorem norm_nine_fiber_ramified : {I : Ideal O | Ideal.absNorm I = 9} = {I : Ideal O | ∃ P : Ideal O, P ∈ (Ideal.span {(3 : ℤ)}).primesOver O ∧ I = P ^ 2} := by ext I constructor · intro hI have hdiv : 3 ∣ Ideal.absNorm I := by rw [hI] decide obtain ⟨P, hPmax, hPunder, hPdiv⟩ := Ideal.exists_isMaximal_dvd_of_dvd_absNorm' (by decide : Nat.Prime 3) I hdiv have : P.IsPrime := hPmax.isPrime have : P.LiesOver (Ideal.span {(3 : ℤ)}) := ⟨hPunder.symm⟩ have hPN : Ideal.absNorm P = 3 := absNorm_ramified P obtain ⟨Q, hIQ⟩ := hPdiv have hQN : Ideal.absNorm Q = 3 := by have heq := congrArg Ideal.absNorm hIQ simp only [map_mul] at heq rw [hI, hPN] at heq omega have hQover := norm_prime_implies_over (by decide : Nat.Prime 3) Q hQN have hPover : P ∈ (Ideal.span {(3 : ℤ)}).primesOver O := ⟨inferInstance, inferInstance⟩ have hfinite : ((Ideal.span {(3 : ℤ)}).primesOver O).Finite := by rw [← norm_three_fiber] exact Ideal.finite_setOfPred_absNorm_eq 3 have hsub : ∀ {A B : Ideal O}, A ∈ (Ideal.span {(3 : ℤ)}).primesOver O → B ∈ (Ideal.span {(3 : ℤ)}).primesOver O → A = B := (Set.ncard_le_one_iff hfinite).mp (by rw [ramified_count]) have hPQ : P = Q := hsub hPover hQover refine ⟨P, hPover, ?_⟩ rw [hIQ, ← hPQ, pow_two] · rintro ⟨P, hP, rfl⟩ have : P.IsPrime := hP.1 have : P.LiesOver (Ideal.span {(3 : ℤ)}) := hP.2 change Ideal.absNorm (P ^ 2) = 9 rw [map_pow, absNorm_ramified P] norm_num theorem local_inert_p {q : ℕ} (χ : DirichletCharacter ℂ q) {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 2) : normFiberCoeff (baseChangeWeight χ) p = 0 := by have hf := norm_p_fiber_inert hp hmod unfold normFiberCoeff simp [hf] theorem local_split_p {q : ℕ} (χ : DirichletCharacter ℂ q) {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 1) : normFiberCoeff (baseChangeWeight χ) p = -(2 : ℂ) * χ p := by classical let hf := Ideal.finite_setOfPred_absNorm_eq (S := O) p have hcard : hf.toFinset.card = 2 := by rw [← Set.ncard_eq_toFinset_card {I : Ideal O | Ideal.absNorm I = p} hf] rw [norm_p_fiber_split hp hmod] exact split_count_of_mod_one hp hmod have hsum : normFiberCoeff (baseChangeWeight χ) p = ∑ I ∈ hf.toFinset, -χ p := by unfold normFiberCoeff apply Finset.sum_congr rfl intro I hI have hnorm : Ideal.absNorm I = p := hf.mem_toFinset.mp hI have hprime : Prime I := UniqueFactorizationMonoid.irreducible_iff_prime.mp (Ideal.irreducible_of_irreducible_absNorm (by rw [hnorm] exact (Nat.irreducible_iff_nat_prime p).2 hp)) rw [baseChangeWeight_prime χ I hprime, hnorm] rw [hsum] simp [hcard] theorem local_ramified_three {q : ℕ} (χ : DirichletCharacter ℂ q) : normFiberCoeff (baseChangeWeight χ) 3 = -χ 3 := by classical let hf := Ideal.finite_setOfPred_absNorm_eq (S := O) 3 have hcard : hf.toFinset.card = 1 := by rw [← Set.ncard_eq_toFinset_card {I : Ideal O | Ideal.absNorm I = 3} hf] rw [norm_three_fiber] exact ramified_count have hsum : normFiberCoeff (baseChangeWeight χ) 3 = ∑ I ∈ hf.toFinset, -χ 3 := by unfold normFiberCoeff apply Finset.sum_congr rfl intro I hI have hnorm : Ideal.absNorm I = 3 := hf.mem_toFinset.mp hI have hprime : Prime I := UniqueFactorizationMonoid.irreducible_iff_prime.mp (Ideal.irreducible_of_irreducible_absNorm (by rw [hnorm] exact (Nat.irreducible_iff_nat_prime 3).2 (by decide))) simpa only [hnorm, Nat.cast_ofNat] using baseChangeWeight_prime χ I hprime rw [hsum] simp [hcard] theorem local_inert_p_sq {q : ℕ} (χ : DirichletCharacter ℂ q) {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 2) : normFiberCoeff (baseChangeWeight χ) (p ^ 2) = -χ (p ^ 2) := by classical let hf := Ideal.finite_setOfPred_absNorm_eq (S := O) (p ^ 2) have hcard : hf.toFinset.card = 1 := by rw [← Set.ncard_eq_toFinset_card {I : Ideal O | Ideal.absNorm I = p ^ 2} hf] rw [norm_p_sq_fiber_inert hp hmod] exact inert_count_of_mod_two hp hmod have hsum : normFiberCoeff (baseChangeWeight χ) (p ^ 2) = ∑ I ∈ hf.toFinset, -χ (p ^ 2) := by unfold normFiberCoeff apply Finset.sum_congr rfl intro I hI have hover : I ∈ (Ideal.span {(p : ℤ)}).primesOver O := by rw [← norm_p_sq_fiber_inert hp hmod] exact hf.mem_toFinset.mp hI have hnorm : Ideal.absNorm I = p ^ 2 := hf.mem_toFinset.mp hI let : I.IsPrime := hover.1 have hprime : Prime I := Ideal.prime_of_isPrime (by intro hbot have : Ideal.absNorm I = 0 := by rw [hbot]; simp rw [hnorm] at this exact (pow_ne_zero 2 hp.ne_zero) this) inferInstance simpa only [hnorm, Nat.cast_pow] using baseChangeWeight_prime χ I hprime rw [hsum] simp [hcard] theorem local_ramified_nine {q : ℕ} (χ : DirichletCharacter ℂ q) : normFiberCoeff (baseChangeWeight χ) 9 = 0 := by classical let hf := Ideal.finite_setOfPred_absNorm_eq (S := O) 9 unfold normFiberCoeff apply Finset.sum_eq_zero intro I hI have hnorm : Ideal.absNorm I = 9 := hf.mem_toFinset.mp hI have hfactor : I ∈ {I : Ideal O | ∃ P : Ideal O, P ∈ (Ideal.span {(3 : ℤ)}).primesOver O ∧ I = P ^ 2} := by rw [← norm_nine_fiber_ramified] exact hnorm obtain ⟨P, hP, rfl⟩ := hfactor have : P.IsPrime := hP.1 have : P.LiesOver (Ideal.span {(3 : ℤ)}) := hP.2 have hPN : Ideal.absNorm P = 3 := absNorm_ramified P have hnotunit : ¬ IsUnit P := by intro hunit have htop : P = ⊤ := Ideal.isUnit_iff.mp hunit rw [htop, Ideal.absNorm_top] at hPN norm_num at hPN have hnot : ¬ Squarefree (P ^ 2) := by intro hsq apply hnotunit exact hsq P (by rw [pow_two]) rw [baseChangeWeight, UniqueFactorizationMonoid.moebius_of_not_squarefree hnot] simp private theorem baseChangeWeight_prime_sq_zero {q : ℕ} (χ : DirichletCharacter ℂ q) (P : Ideal O) (hP : Prime P) : baseChangeWeight χ (P ^ 2) = 0 := by have hnot : ¬ Squarefree (P ^ 2) := by intro hsq have hunit : IsUnit P := hsq P (by rw [pow_two]) exact hP.irreducible.not_isUnit hunit rw [baseChangeWeight, UniqueFactorizationMonoid.moebius_of_not_squarefree hnot] simp theorem local_split_p_sq {q : ℕ} (χ : DirichletCharacter ℂ q) {p : ℕ} (hp : p.Prime) (hmod : p % 3 = 1) : normFiberCoeff (baseChangeWeight χ) (p ^ 2) = χ (p ^ 2) := by classical let s : Set (Ideal O) := (Ideal.span {(p : ℤ)}).primesOver O obtain ⟨P, Q, hPQ, hset⟩ := Set.ncard_eq_two.mp (split_count_of_mod_one hp hmod) have hPover : P ∈ s := by change P ∈ (Ideal.span {(p : ℤ)}).primesOver O rw [hset] simp have hQover : Q ∈ s := by change Q ∈ (Ideal.span {(p : ℤ)}).primesOver O rw [hset] simp let : P.IsPrime := hPover.1 let : P.LiesOver (Ideal.span {(p : ℤ)}) := hPover.2 let : Q.IsPrime := hQover.1 let : Q.LiesOver (Ideal.span {(p : ℤ)}) := hQover.2 have hPN : Ideal.absNorm P = p := absNorm_split hp hmod P have hQN : Ideal.absNorm Q = p := absNorm_split hp hmod Q have hPne : P ≠ ⊥ := by intro h rw [h, Ideal.absNorm_bot] at hPN exact hp.ne_zero hPN.symm have hQne : Q ≠ ⊥ := by intro h rw [h, Ideal.absNorm_bot] at hQN exact hp.ne_zero hQN.symm have hPprime : Prime P := Ideal.prime_of_isPrime hPne inferInstance have hQprime : Prime Q := Ideal.prime_of_isPrime hQne inferInstance have : P.IsMaximal := (inferInstance : P.IsPrime).isMaximal hPne have : Q.IsMaximal := (inferInstance : Q.IsPrime).isMaximal hQne have hrel : IsRelPrime P Q := (Ideal.isCoprime_of_isMaximal hPQ).isRelPrime have hmu : UniqueFactorizationMonoid.moebius (P * Q) = 1 := by rw [hrel.moebius_mul, hPprime.irreducible.moebius_eq, hQprime.irreducible.moebius_eq] norm_num let hf := Ideal.finite_setOfPred_absNorm_eq (S := O) (p ^ 2) have hmem : P * Q ∈ hf.toFinset := by rw [hf.mem_toFinset] change Ideal.absNorm (P * Q) = p ^ 2 rw [map_mul, hPN, hQN, pow_two] calc normFiberCoeff (baseChangeWeight χ) (p ^ 2) = ∑ I ∈ hf.toFinset, baseChangeWeight χ I := by rfl _ = baseChangeWeight χ (P * Q) := by apply Finset.sum_eq_single (P * Q) · intro I hImem hneq have hnorm : Ideal.absNorm I = p ^ 2 := hf.mem_toFinset.mp hImem obtain ⟨A, B, hA, hB, rfl⟩ := norm_p_sq_split_factors hp hmod I hnorm rw [hset] at hA hB simp only [Set.mem_insert_iff, Set.mem_singleton_iff] at hA hB rcases hA with hAP | hAQ <;> rcases hB with hBP | hBQ · rw [hAP, hBP] simpa only [pow_two] using baseChangeWeight_prime_sq_zero χ P hPprime · exact False.elim (hneq (by rw [hAP, hBQ])) · exact False.elim (hneq (by rw [hAQ, hBP, mul_comm])) · rw [hAQ, hBQ] simpa only [pow_two] using baseChangeWeight_prime_sq_zero χ Q hQprime · intro hnot exact False.elim (hnot hmem) _ = χ (p ^ 2) := by rw [baseChangeWeight, hmu] have hnorm : Ideal.absNorm (P * Q) = p ^ 2 := by rw [map_mul, hPN, hQN, pow_two] simp [hnorm, Nat.cast_pow] end ShortDraftHeckeBridge end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Hecke.LocalEulerIdentities namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology namespace ShortDraftHeckeBridge theorem chiMinusThree_mod_one (n : ℕ) (h : n % 3 = 1) : chiMinusThree n = 1 := by have hc : (n : ZMod 3) = 1 := by calc (n : ZMod 3) = ((n % 3 : ℕ) : ZMod 3) := by simp _ = 1 := by rw [h]; simp change ((quadraticChar (ZMod 3) (n : ZMod 3) : ℤ) : ℂ) = 1 rw [hc] simp theorem chiMinusThree_mod_two (n : ℕ) (h : n % 3 = 2) : chiMinusThree n = -1 := by have hc : (n : ZMod 3) = 2 := by calc (n : ZMod 3) = ((n % 3 : ℕ) : ZMod 3) := by simp _ = 2 := by rw [h]; simp change ((quadraticChar (ZMod 3) (n : ZMod 3) : ℤ) : ℂ) = -1 rw [hc] change chiMinusThree (2 : ℕ) = -1 exact chiMinusThree_two private theorem invCharAF_prime_pow_ge_two {q : ℕ} (χ : DirichletCharacter ℂ q) {p j : ℕ} (hp : p.Prime) (hj : 2 ≤ j) : invCharAF χ (p ^ j) = 0 := by rw [invCharAF_apply χ (pow_ne_zero j hp.ne_zero), ArithmeticFunction.moebius_apply_prime_pow hp (by omega)] simp [show j ≠ 1 by omega] theorem pairAF_prime_pow_ge_three {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) {p k : ℕ} (hp : p.Prime) (hk : 3 ≤ k) : pairAF χ ψ (p ^ k) = 0 := by rw [pairAF, ArithmeticFunction.mul_apply] conv_lhs => rw [Nat.sum_divisorsAntidiagonal (fun a b => invCharAF χ a * invCharAF ψ b)] rw [Nat.sum_divisors_prime_pow hp] apply Finset.sum_eq_zero intro i hi have hik : i ≤ k := by simpa only [Finset.mem_range, Nat.lt_succ_iff] using hi have hdiv : p ^ k / p ^ i = p ^ (k - i) := by have heq : k - i + i = k := Nat.sub_add_cancel hik calc p ^ k / p ^ i = (p ^ (k - i) * p ^ i) / p ^ i := by rw [← pow_add, heq] _ = p ^ (k - i) := by simp [hp.ne_zero] rw [hdiv] by_cases hii : 2 ≤ i · rw [invCharAF_prime_pow_ge_two χ hp hii, zero_mul] · have hki : 2 ≤ k - i := by omega rw [invCharAF_prime_pow_ge_two ψ hp hki, mul_zero] private theorem localEulerCyclotomicWitness : IsCyclotomicExtension {3} ℚ ActualEisensteinSieve.K := CyclotomicField.isCyclotomicExtension 3 ℚ private theorem base_ring_rank_two : Module.finrank ℤ O = 2 := by letI : IsCyclotomicExtension {3} ℚ ActualEisensteinSieve.K := localEulerCyclotomicWitness rw [NumberField.RingOfIntegers.rank ActualEisensteinSieve.K, IsCyclotomicExtension.Rat.finrank 3 ActualEisensteinSieve.K] decide theorem baseChangeWeight_zero_of_norm_prime_pow_ge_three {q p k : ℕ} (χ : DirichletCharacter ℂ q) (hp : p.Prime) (hk : 3 ≤ k) (I : Ideal O) (hI : Ideal.absNorm I = p ^ k) : baseChangeWeight χ I = 0 := by by_cases hμ : UniqueFactorizationMonoid.moebius I = 0 · simp [baseChangeWeight, hμ] have hsq : Squarefree I := by by_contra hnsq exact hμ (UniqueFactorizationMonoid.moebius_of_not_squarefree hnsq) have hmem : ((p ^ k : ℕ) : O) ∈ I := by simpa only [hI] using Ideal.absNorm_mem I have hspanle : Ideal.span {((p : O) ^ k)} ≤ I := (Ideal.span_singleton_le_iff_mem I).mpr (by simpa using hmem) have hpowdiv : I ∣ (Ideal.span {(p : O)}) ^ k := by rw [Ideal.span_singleton_pow] exact Ideal.dvd_iff_le.mpr hspanle have hdiv : I ∣ Ideal.span {(p : O)} := (hsq.dvd_pow_iff_dvd (by omega : k ≠ 0)).mp hpowdiv have hnormdiv := map_dvd Ideal.absNorm hdiv rw [hI, Ideal.absNorm_span_natCast, base_ring_rank_two] at hnormdiv have hk2 : k ≤ 2 := (Nat.pow_dvd_pow_iff_le_right hp.one_lt).mp hnormdiv omega theorem normFiberCoeff_baseChangeWeight_prime_pow_ge_three {q p k : ℕ} (χ : DirichletCharacter ℂ q) (hp : p.Prime) (hk : 3 ≤ k) : normFiberCoeff (baseChangeWeight χ) (p ^ k) = 0 := by classical unfold normFiberCoeff apply Finset.sum_eq_zero intro I hI have hnorm : Ideal.absNorm I = p ^ k := by simpa using hI exact baseChangeWeight_zero_of_norm_prime_pow_ge_three χ hp hk I hnorm theorem normFiberCoeff_eq_pairAF_prime_pow_ge_three {q p k : ℕ} (χ : DirichletCharacter ℂ q) (hp : p.Prime) (hk : 3 ≤ k) : normFiberCoeff (baseChangeWeight χ) (p ^ k) = pairAF χ (baseChangeChar χ) (p ^ k) := by rw [normFiberCoeff_baseChangeWeight_prime_pow_ge_three χ hp hk, pairAF_prime_pow_ge_three χ (baseChangeChar χ) hp hk] theorem char_prime_zero_of_dvd_level {q p : ℕ} (χ : DirichletCharacter ℂ q) (hp : p.Prime) (hd : p ∣ q) : χ p = 0 := by have hnot : ¬ IsCoprime (p : ℤ) (q : ℕ) := by intro hc have hn : p.Coprime q := by simpa [Int.isCoprime_iff_nat_coprime] using hc exact (hp.coprime_iff_not_dvd.mp hn) hd simpa using (DirichletCharacter.apply_eq_zero_iff χ (p : ℤ)).mpr hnot theorem baseChangeChar_prime_zero_of_dvd_q {q p : ℕ} (χ : DirichletCharacter ℂ q) (hp : p.Prime) (hd : p ∣ q) : baseChangeChar χ p = 0 := by have hd' : p ∣ q * 3 := dvd_mul_of_dvd_left hd 3 exact char_prime_zero_of_dvd_level (baseChangeChar χ) hp hd' end ShortDraftHeckeBridge namespace NormSplitArithmetic theorem eq_parts_of_coprime_square_bounds {a b m n : ℕ} (hcop : m.Coprime n) (ha2 : a ∣ m ^ 2) (hb2 : b ∣ n ^ 2) (hprod : a * b = m * n) : a = m ∧ b = n := by have hm2n : (m ^ 2).Coprime n := (Nat.coprime_pow_left_iff (by decide) m n).mpr hcop have hmn2 : m.Coprime (n ^ 2) := (Nat.coprime_pow_right_iff (by decide) m n).mpr hcop have han : a.Coprime n := hm2n.coprime_dvd_left ha2 have hmb : m.Coprime b := hmn2.coprime_dvd_right hb2 have ha_mn : a ∣ m * n := ⟨b, hprod.symm⟩ have hm_ab : m ∣ a * b := ⟨n, hprod⟩ have hn_ab : n ∣ a * b := ⟨m, by rw [hprod, mul_comm]⟩ have ha_m : a ∣ m := han.dvd_of_dvd_mul_right ha_mn have hm_a : m ∣ a := hmb.dvd_of_dvd_mul_right hm_ab have hb_n : b ∣ n := by have hbn : b.Coprime m := (hmn2.symm).coprime_dvd_left hb2 have hb_mn : b ∣ n * m := ⟨a, by calc n * m = m * n := mul_comm n m _ = a * b := hprod.symm _ = b * a := mul_comm a b⟩ exact hbn.dvd_of_dvd_mul_right hb_mn have hn_b : n ∣ b := han.symm.dvd_of_dvd_mul_left hn_ab exact ⟨Nat.dvd_antisymm ha_m hm_a, Nat.dvd_antisymm hb_n hn_b⟩ end NormSplitArithmetic namespace NormFiberCRT abbrev O := ActualEisensteinSieve.O abbrev K := ActualEisensteinSieve.K private theorem instIsCyclotomicExtensionSingletonNatSetOfNatRatK : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ private theorem ring_rank_two : Module.finrank ℤ O = 2 := by letI : IsCyclotomicExtension {3} ℚ K := instIsCyclotomicExtensionSingletonNatSetOfNatRatK rw [NumberField.RingOfIntegers.rank K, IsCyclotomicExtension.Rat.finrank 3 K] decide theorem ideal_eq_factors (I : Ideal O) (m n : ℕ) (hcop : m.Coprime n) (hI : Ideal.absNorm I = m * n) : I = (I ⊔ Ideal.span {(m : O)}) * (I ⊔ Ideal.span {(n : O)}) := by let A : Ideal O := Ideal.span {(m : O)} let B : Ideal O := Ideal.span {(n : O)} have hcast : IsCoprime (m : O) (n : O) := by simpa only [map_natCast] using (Nat.Coprime.isCoprime hcop).map (Int.castRingHom O) have hAB : A ⊔ B = ⊤ := by exact Ideal.isCoprime_iff_sup_eq.mp ((Ideal.isCoprime_span_singleton_iff (m : O) (n : O)).mpr hcast) have hmnmem : ((m * n : ℕ) : O) ∈ I := by simpa only [hI] using Ideal.absNorm_mem I have hABle : A * B ≤ I := by change Ideal.span {(m : O)} * Ideal.span {(n : O)} ≤ I rw [Ideal.span_singleton_mul_span_singleton] exact (Ideal.span_singleton_le_iff_mem I).mpr (by simpa using hmnmem) have hJcop : (I ⊔ A) ⊔ (I ⊔ B) = ⊤ := by calc (I ⊔ A) ⊔ (I ⊔ B) = I ⊔ (A ⊔ B) := by ac_rfl _ = ⊤ := by rw [hAB, sup_top_eq] apply le_antisymm · rw [Ideal.mul_eq_inf_of_coprime hJcop] exact le_inf le_sup_left le_sup_left · rw [Ideal.sup_mul, Ideal.mul_sup, Ideal.mul_sup] exact sup_le (sup_le Ideal.mul_le_left Ideal.mul_le_left) (sup_le Ideal.mul_le_right hABle) theorem ideal_factor_norms (I : Ideal O) (m n : ℕ) (hcop : m.Coprime n) (hI : Ideal.absNorm I = m * n) : Ideal.absNorm (I ⊔ Ideal.span {(m : O)}) = m ∧ Ideal.absNorm (I ⊔ Ideal.span {(n : O)}) = n := by have hAm : Ideal.absNorm (Ideal.span {(m : O)}) = m ^ 2 := by rw [Ideal.absNorm_span_natCast, ring_rank_two] have hBn : Ideal.absNorm (Ideal.span {(n : O)}) = n ^ 2 := by rw [Ideal.absNorm_span_natCast, ring_rank_two] have hmdiv : Ideal.absNorm (I ⊔ Ideal.span {(m : O)}) ∣ m ^ 2 := by rw [← hAm] exact Ideal.absNorm_dvd_absNorm_of_le le_sup_right have hndiv : Ideal.absNorm (I ⊔ Ideal.span {(n : O)}) ∣ n ^ 2 := by rw [← hBn] exact Ideal.absNorm_dvd_absNorm_of_le le_sup_right have hprod := congrArg Ideal.absNorm (ideal_eq_factors I m n hcop hI) rw [map_mul, hI] at hprod exact NormSplitArithmetic.eq_parts_of_coprime_square_bounds hcop hmdiv hndiv hprod.symm end NormFiberCRT namespace NormFiberMult abbrev O := ActualEisensteinSieve.O private theorem ideal_sup_span_norm_left (I J : Ideal O) (m n : ℕ) (hcop : m.Coprime n) (hI : Ideal.absNorm I = m) (hJ : Ideal.absNorm J = n) : I * J ⊔ Ideal.span {(m : O)} = I := by let A : Ideal O := Ideal.span {(m : O)} have hmI : A ≤ I := by apply (Ideal.span_singleton_le_iff_mem _).mpr simpa only [hI] using Ideal.absNorm_mem I have hnJ : (n : O) ∈ J := by simpa only [hJ] using Ideal.absNorm_mem J have hnspan : Ideal.span {(n : O)} ≤ J := (Ideal.span_singleton_le_iff_mem _).mpr hnJ have hcast : IsCoprime (m : O) (n : O) := by simpa only [map_natCast] using (Nat.Coprime.isCoprime hcop).map (Int.castRingHom O) have hAB : A ⊔ Ideal.span {(n : O)} = ⊤ := by exact Ideal.isCoprime_iff_sup_eq.mp ((Ideal.isCoprime_span_singleton_iff (m : O) (n : O)).mpr hcast) have hJA : J ⊔ A = ⊤ := by apply top_unique calc ⊤ = A ⊔ Ideal.span {(n : O)} := hAB.symm _ ≤ J ⊔ A := sup_le le_sup_right (hnspan.trans le_sup_left) apply le_antisymm · exact sup_le Ideal.mul_le_left hmI · calc I = I * (J ⊔ A) := by rw [hJA]; simp _ = I * J ⊔ I * A := by rw [Ideal.mul_sup] _ ≤ I * J ⊔ A := sup_le le_sup_left (Ideal.mul_le_right.trans le_sup_right) private theorem ideal_sup_span_norm_right (I J : Ideal O) (m n : ℕ) (hcop : m.Coprime n) (hI : Ideal.absNorm I = m) (hJ : Ideal.absNorm J = n) : I * J ⊔ Ideal.span {(n : O)} = J := by simpa only [mul_comm] using ideal_sup_span_norm_left J I n m hcop.symm hJ hI theorem weighted_norm_fiber_mul (weight : Ideal O → ℂ) (hweight : ∀ I J : Ideal O, (Ideal.absNorm I).Coprime (Ideal.absNorm J) → weight (I * J) = weight I * weight J) (m n : ℕ) (hcop : m.Coprime n) : (∑ K ∈ (Ideal.finite_setOfPred_absNorm_eq (S := O) (m * n)).toFinset, weight K) = (∑ I ∈ (Ideal.finite_setOfPred_absNorm_eq (S := O) m).toFinset, weight I) * (∑ J ∈ (Ideal.finite_setOfPred_absNorm_eq (S := O) n).toFinset, weight J) := by let F (k : ℕ) : Finset (Ideal O) := (Ideal.finite_setOfPred_absNorm_eq (S := O) k).toFinset have hmem (k : ℕ) (I : Ideal O) : I ∈ F k ↔ Ideal.absNorm I = k := by simp [F] change (∑ K ∈ F (m * n), weight K) = (∑ I ∈ F m, weight I) * (∑ J ∈ F n, weight J) calc (∑ K ∈ F (m * n), weight K) = ∑ p ∈ (F m).product (F n), weight (p.1 * p.2) := by refine Finset.sum_bij' (fun K _ => (K ⊔ Ideal.span {(m : O)}, K ⊔ Ideal.span {(n : O)})) (fun p _ => p.1 * p.2) ?_ ?_ ?_ ?_ ?_ · intro K hK have hKnorm : Ideal.absNorm K = m * n := (hmem _ _).mp hK obtain ⟨hm, hn⟩ := NormFiberCRT.ideal_factor_norms K m n hcop hKnorm simp [Finset.mem_product, hmem, hm, hn] · intro p hp have hm : Ideal.absNorm p.1 = m := (hmem _ _).mp (Finset.mem_product.mp hp).1 have hn : Ideal.absNorm p.2 = n := (hmem _ _).mp (Finset.mem_product.mp hp).2 exact (hmem _ _).mpr (by rw [map_mul, hm, hn]) · intro K hK exact (NormFiberCRT.ideal_eq_factors K m n hcop ((hmem _ _).mp hK)).symm · intro p hp have hm : Ideal.absNorm p.1 = m := (hmem _ _).mp (Finset.mem_product.mp hp).1 have hn : Ideal.absNorm p.2 = n := (hmem _ _).mp (Finset.mem_product.mp hp).2 apply Prod.ext · exact ideal_sup_span_norm_left p.1 p.2 m n hcop hm hn · exact ideal_sup_span_norm_right p.1 p.2 m n hcop hm hn · intro K hK exact congrArg weight (NormFiberCRT.ideal_eq_factors K m n hcop ((hmem _ _).mp hK)) _ = ∑ p ∈ (F m).product (F n), weight p.1 * weight p.2 := by apply Finset.sum_congr rfl intro p hp have hm : Ideal.absNorm p.1 = m := (hmem _ _).mp (Finset.mem_product.mp hp).1 have hn : Ideal.absNorm p.2 = n := (hmem _ _).mp (Finset.mem_product.mp hp).2 exact hweight p.1 p.2 (by simpa [hm, hn] using hcop) _ = (∑ I ∈ F m, weight I) * (∑ J ∈ F n, weight J) := by calc (∑ p ∈ (F m).product (F n), weight p.1 * weight p.2) = ∑ I ∈ F m, ∑ J ∈ F n, weight I * weight J := by exact Finset.sum_product' (F m) (F n) (fun I J => weight I * weight J) _ = (∑ I ∈ F m, weight I) * (∑ J ∈ F n, weight J) := by simp only [← Finset.mul_sum, ← Finset.sum_mul] end NormFiberMult namespace ShortDraftHeckeBridge theorem baseChange_normFiber_mul {q : ℕ} (χ : DirichletCharacter ℂ q) (m n : ℕ) (hcop : m.Coprime n) : normFiberCoeff (baseChangeWeight χ) (m * n) = normFiberCoeff (baseChangeWeight χ) m * normFiberCoeff (baseChangeWeight χ) n := by exact NormFiberMult.weighted_norm_fiber_mul (baseChangeWeight χ) (fun I J h => baseChangeWeight_mul_of_coprime_norms χ I J h) m n hcop theorem normFiberCoeff_baseChangeWeight_one {q : ℕ} (χ : DirichletCharacter ℂ q) : normFiberCoeff (baseChangeWeight χ) 1 = 1 := by have hsingle : (Ideal.finite_setOfPred_absNorm_eq (S := O) 1).toFinset = {⊤} := by ext I simp [Ideal.absNorm_eq_one_iff] unfold normFiberCoeff rw [hsingle] simp [baseChangeWeight, ← Ideal.one_eq_top] theorem baseChange_normFiber_isMultiplicative {q : ℕ} (χ : DirichletCharacter ℂ q) : (toArithmeticFunction (normFiberCoeff (baseChangeWeight χ))).IsMultiplicative := by constructor · simp [toArithmeticFunction, normFiberCoeff_baseChangeWeight_one] · intro m n hcop by_cases hm : m = 0 · simp [hm, toArithmeticFunction] by_cases hn : n = 0 · simp [hn, toArithmeticFunction] simpa [toArithmeticFunction, hm, hn, mul_ne_zero hm hn] using baseChange_normFiber_mul χ m n hcop theorem baseChangeChar_prime_apply {q p : ℕ} (χ : DirichletCharacter ℂ q) (hp : p.Prime) : baseChangeChar χ p = χ p * chiMinusThree p := by by_cases hq : p ∣ q · rw [baseChangeChar_prime_zero_of_dvd_q χ hp hq, char_prime_zero_of_dvd_level χ hp hq, zero_mul] by_cases h3 : p = 3 · subst p rw [baseChangeChar_three, chiMinusThree_three, mul_zero] have hn3 : ¬p ∣ 3 := by intro hd rcases (Nat.dvd_prime (by decide : Nat.Prime 3)).1 hd with h1 | h3' · exact hp.ne_one h1 · exact h3 h3' have hnot : ¬p ∣ q * 3 := by intro hd rcases hp.dvd_mul.mp hd with hq' | h3' · exact hq hq' · exact hn3 h3' exact baseChangeChar_apply_of_coprime χ p (hp.coprime_iff_not_dvd.mpr hnot) theorem normFiberCoeff_eq_pairAF_prime {q p : ℕ} (χ : DirichletCharacter ℂ q) (hp : p.Prime) : normFiberCoeff (baseChangeWeight χ) p = pairAF χ (baseChangeChar χ) p := by have hlt : p % 3 < 3 := Nat.mod_lt p (by decide) have hcase : p % 3 = 0 ∨ p % 3 = 1 ∨ p % 3 = 2 := by omega rcases hcase with h0 | h1 | h2 · have hdiv : 3 ∣ p := Nat.dvd_of_mod_eq_zero h0 have heq : p = 3 := by rcases (Nat.dvd_prime hp).1 hdiv with h1' | h3 · norm_num at h1' · exact h3.symm subst p rw [local_ramified_three χ, pairAF_prime χ (baseChangeChar χ) (by decide), baseChangeChar_three χ] ring_nf · rw [local_split_p χ hp h1, pairAF_prime χ (baseChangeChar χ) hp, baseChangeChar_prime_apply χ hp, chiMinusThree_mod_one p h1] ring · rw [local_inert_p χ hp h2, pairAF_prime χ (baseChangeChar χ) hp, baseChangeChar_prime_apply χ hp, chiMinusThree_mod_two p h2] ring theorem normFiberCoeff_eq_pairAF_prime_sq {q p : ℕ} (χ : DirichletCharacter ℂ q) (hp : p.Prime) : normFiberCoeff (baseChangeWeight χ) (p ^ 2) = pairAF χ (baseChangeChar χ) (p ^ 2) := by have hlt : p % 3 < 3 := Nat.mod_lt p (by decide) have hcase : p % 3 = 0 ∨ p % 3 = 1 ∨ p % 3 = 2 := by omega rcases hcase with h0 | h1 | h2 · have hdiv : 3 ∣ p := Nat.dvd_of_mod_eq_zero h0 have heq : p = 3 := by rcases (Nat.dvd_prime hp).1 hdiv with h1' | h3 · norm_num at h1' · exact h3.symm subst p have h3 : pairAF χ (baseChangeChar χ) 9 = χ (3 : ℕ) * baseChangeChar χ (3 : ℕ) := by simpa only [show (3 : ℕ) ^ 2 = 9 by norm_num] using (pairAF_prime_sq χ (baseChangeChar χ) (by decide : Nat.Prime 3)) rw [show (3 : ℕ) ^ 2 = 9 by norm_num, local_ramified_nine χ, h3, baseChangeChar_three χ] ring · rw [local_split_p_sq χ hp h1, pairAF_prime_sq χ (baseChangeChar χ) hp, baseChangeChar_prime_apply χ hp, chiMinusThree_mod_one p h1] simp only [map_pow] ring · rw [local_inert_p_sq χ hp h2, pairAF_prime_sq χ (baseChangeChar χ) hp, baseChangeChar_prime_apply χ hp, chiMinusThree_mod_two p h2] simp only [map_pow] ring theorem normFiberCoeff_eq_pairInverseCoeff_of_local {q : ℕ} (χ : DirichletCharacter ℂ q) (hprime : ∀ p : ℕ, p.Prime → normFiberCoeff (baseChangeWeight χ) p = pairAF χ (baseChangeChar χ) p) (hprimeSq : ∀ p : ℕ, p.Prime → normFiberCoeff (baseChangeWeight χ) (p ^ 2) = pairAF χ (baseChangeChar χ) (p ^ 2)) (n : ℕ) (hn : n ≠ 0) : normFiberCoeff (baseChangeWeight χ) n = pairInverseCoeff χ (baseChangeChar χ) n := by apply normFiber_eq_pair_of_prime_powers χ (baseChangeChar χ) (baseChangeWeight χ) (baseChange_normFiber_isMultiplicative χ) ?_ n hn intro p k hp by_cases hk0 : k = 0 · simpa [hk0] using (baseChange_normFiber_isMultiplicative χ).map_one.trans ((pairAF_mult χ (baseChangeChar χ)).map_one).symm by_cases hk1 : k = 1 · simpa [hk1, toArithmeticFunction, hp.ne_zero] using hprime p hp by_cases hk2 : k = 2 · simpa [hk2, toArithmeticFunction, hp.ne_zero] using hprimeSq p hp have hk3 : 3 ≤ k := by omega change (if p ^ k = 0 then (0 : ℂ) else normFiberCoeff (baseChangeWeight χ) (p ^ k)) = _ rw [ite_eq_right (pow_ne_zero k hp.ne_zero)] exact normFiberCoeff_eq_pairAF_prime_pow_ge_three χ hp hk3 theorem normFiberCoeff_baseChange_eq_pairInverseCoeff {q : ℕ} (χ : DirichletCharacter ℂ q) (n : ℕ) (hn : n ≠ 0) : normFiberCoeff (baseChangeWeight χ) n = pairInverseCoeff χ (baseChangeChar χ) n := by exact normFiberCoeff_eq_pairInverseCoeff_of_local χ (fun p hp => normFiberCoeff_eq_pairAF_prime χ hp) (fun p hp => normFiberCoeff_eq_pairAF_prime_sq χ hp) n hn end ShortDraftHeckeBridge open Filter Asymptotics namespace ShortDraftHeckeBridge end ShortDraftHeckeBridge end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Hecke.PrimeExtraction namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics namespace ShortDraftHeckeBridge end ShortDraftHeckeBridge open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid namespace FiniteSFactor abbrev O := NumberField.RingOfIntegers (CyclotomicField 3 ℚ) theorem extract_prime_of_squarefree {I P : Ideal O} (hI : I ≠ ⊥) (hP : Prime P) (hsq : Squarefree I) (hdvd : P ∣ I) : ∃ J : Ideal O, IsRelPrime P J ∧ I = P * J := by let : P.IsMaximal := (Ideal.isPrime_of_prime hP).isMaximal hP.ne_zero obtain ⟨J, hcop, hfactor⟩ := Ideal.eq_prime_pow_mul_coprime hI P have hmem : P ∈ normalizedFactors I := by rw [Ideal.mem_normalizedFactors_iff hI] exact ⟨Ideal.isPrime_of_prime hP, (Ideal.dvd_iff_le).mp hdvd⟩ have hpos : 0 < (normalizedFactors I).count P := Multiset.count_pos.mpr hmem have hnodup : (normalizedFactors I).Nodup := (UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors hI).mp hsq have hle : (normalizedFactors I).count P ≤ 1 := (Multiset.nodup_iff_count_le_one.mp hnodup) P have he : (normalizedFactors I).count P = 1 := by omega refine ⟨J, ?_, ?_⟩ · exact IsCoprime.isRelPrime ((Ideal.isCoprime_iff_gcd).mpr (by simpa using hcop)) · simpa [he] using hfactor noncomputable def outsideWeight (S : Finset (Ideal O)) (w : Ideal O → ℂ) (I : Ideal O) : ℂ := by classical exact if ∀ P ∈ S, ¬ P ∣ I then w I else 0 theorem outsideWeight_mul (S : Finset (Ideal O)) (hprime : ∀ P ∈ S, Prime P) (w : Ideal O → ℂ) (I J : Ideal O) (hweight : w (I * J) = w I * w J) : outsideWeight S w (I * J) = outsideWeight S w I * outsideWeight S w J := by classical let good (K : Ideal O) : Prop := ∀ P ∈ S, ¬ P ∣ K have hleft : good (I * J) → good I := by intro h P hP hd exact h P hP (dvd_mul_of_dvd_left hd J) have hright : good (I * J) → good J := by intro h P hP hd exact h P hP (dvd_mul_of_dvd_right hd I) have hboth : good I → good J → good (I * J) := by intro hI hJ P hP hd rcases (hprime P hP).dvd_mul.mp hd with hdI | hdJ · exact hI P hP hdI · exact hJ P hP hdJ change (if good (I * J) then w (I * J) else 0) = (if good I then w I else 0) * (if good J then w J else 0) by_cases hI : good I · by_cases hJ : good J · have hIJ := hboth hI hJ simp [hI, hJ, hIJ, hweight] · have hIJ : ¬good (I * J) := fun h => hJ (hright h) simp [hI, hJ, hIJ] · have hIJ : ¬good (I * J) := fun h => hI (hleft h) simp [hI, hIJ] noncomputable def fiber (n : ℕ) : Finset (Ideal O) := (Ideal.finite_setOfPred_absNorm_eq (S := O) n).toFinset theorem mem_fiber {n : ℕ} {I : Ideal O} : I ∈ fiber n ↔ Ideal.absNorm I = n := by simp [fiber] noncomputable def badFiber (P : Ideal O) (m : ℕ) : Finset (Ideal O) := by classical exact (fiber (Ideal.absNorm P * m)).filter (fun I => Squarefree I ∧ P ∣ I) noncomputable def goodFiber (P : Ideal O) (m : ℕ) : Finset (Ideal O) := by classical exact (fiber m).filter (fun J => Squarefree J ∧ ¬ P ∣ J) theorem mem_badFiber {P : Ideal O} {m : ℕ} {I : Ideal O} : I ∈ badFiber P m ↔ Ideal.absNorm I = Ideal.absNorm P * m ∧ Squarefree I ∧ P ∣ I := by classical simp [badFiber, mem_fiber] theorem mem_goodFiber {P : Ideal O} {m : ℕ} {J : Ideal O} : J ∈ goodFiber P m ↔ Ideal.absNorm J = m ∧ Squarefree J ∧ ¬P ∣ J := by classical simp [goodFiber, mem_fiber] private noncomputable def pick (P : Ideal O) (hP : Prime P) (m : ℕ) (I : Ideal O) (hI : I ∈ badFiber P m) : Ideal O := Classical.choose (extract_prime_of_squarefree ((mem_badFiber.mp hI).2.1.ne_zero) hP (mem_badFiber.mp hI).2.1 (mem_badFiber.mp hI).2.2) private theorem pick_spec (P : Ideal O) (hP : Prime P) (m : ℕ) (I : Ideal O) (hI : I ∈ badFiber P m) : IsRelPrime P (pick P hP m I hI) ∧ I = P * pick P hP m I hI := by unfold pick exact Classical.choose_spec (extract_prime_of_squarefree ((mem_badFiber.mp hI).2.1.ne_zero) hP (mem_badFiber.mp hI).2.1 (mem_badFiber.mp hI).2.2) theorem squarefree_prime_fiber_sum (P : Ideal O) (hP : Prime P) (m : ℕ) (w : Ideal O → ℂ) : (∑ I ∈ badFiber P m, w I) = ∑ J ∈ goodFiber P m, w (P * J) := by classical have hPnorm : Ideal.absNorm P ≠ 0 := (Ideal.absNorm_eq_zero_iff).not.mpr hP.ne_zero refine Finset.sum_bij' (pick P hP m) (fun J _ => P * J) ?_ ?_ ?_ ?_ ?_ · intro I hI have hinfo := pick_spec P hP m I hI have hJnorm : Ideal.absNorm (pick P hP m I hI) = m := by have hInorm := (mem_badFiber.mp hI).1 rw [hinfo.2, map_mul] at hInorm exact Nat.eq_of_mul_eq_mul_left (Nat.pos_of_ne_zero hPnorm) hInorm have hJsq : Squarefree (pick P hP m I hI) := by have hsqI := (mem_badFiber.mp hI).2.1 rw [hinfo.2] at hsqI exact hsqI.of_mul_right have hJnot : ¬P ∣ pick P hP m I hI := hP.irreducible.isRelPrime_iff_not_dvd.mp hinfo.1 exact mem_goodFiber.mpr ⟨hJnorm, hJsq, hJnot⟩ · intro J hJ have hJnorm := (mem_goodFiber.mp hJ).1 have hJsq := (mem_goodFiber.mp hJ).2.1 have hJnot := (mem_goodFiber.mp hJ).2.2 have hsq : Squarefree (P * J) := squarefree_mul_iff.mpr ⟨hP.irreducible.isRelPrime_iff_not_dvd.mpr hJnot, hP.irreducible.squarefree, hJsq⟩ exact mem_badFiber.mpr ⟨by rw [map_mul, hJnorm], hsq, dvd_mul_right P J⟩ · intro I hI exact (pick_spec P hP m I hI).2.symm · intro J hJ have hPJ : P * J ∈ badFiber P m := by have hJnorm := (mem_goodFiber.mp hJ).1 have hJsq := (mem_goodFiber.mp hJ).2.1 have hJnot := (mem_goodFiber.mp hJ).2.2 exact mem_badFiber.mpr ⟨by rw [map_mul, hJnorm], squarefree_mul_iff.mpr ⟨hP.irreducible.isRelPrime_iff_not_dvd.mpr hJnot, hP.irreducible.squarefree, hJsq⟩, dvd_mul_right P J⟩ have hchosen := (pick_spec P hP m (P * J) hPJ).2 exact (mul_left_cancel₀ hP.ne_zero hchosen).symm · intro I hI exact congrArg w (pick_spec P hP m I hI).2 open scoped Classical noncomputable def exceptPrimeCoeff (P : Ideal O) (w : Ideal O → ℂ) (n : ℕ) : ℂ := by classical exact ∑ I ∈ fiber n, if ¬P ∣ I then w I else 0 private theorem sum_filter_squarefree (pred : Ideal O → Prop) (w : Ideal O → ℂ) (hzero : ∀ I, ¬Squarefree I → w I = 0) (n : ℕ) : (∑ I ∈ fiber n, if pred I then w I else 0) = ∑ I ∈ (fiber n).filter (fun I => Squarefree I ∧ pred I), w I := by classical rw [Finset.sum_filter] apply Finset.sum_congr rfl intro I hI by_cases hsq : Squarefree I · simp [hsq] · simp [hsq, hzero I hsq] theorem restore_one_prime (P : Ideal O) (hP : Prime P) (w : Ideal O → ℂ) (hzero : ∀ I, ¬Squarefree I → w I = 0) (hmul : ∀ J, ¬P ∣ J → w (P * J) = w P * w J) (m : ℕ) : (∑ I ∈ fiber (Ideal.absNorm P * m), w I) = exceptPrimeCoeff P w (Ideal.absNorm P * m) + w P * exceptPrimeCoeff P w m := by classical let n := Ideal.absNorm P * m have hsplit : (∑ I ∈ fiber n, w I) = (∑ I ∈ fiber n, if ¬P ∣ I then w I else 0) + (∑ I ∈ fiber n, if P ∣ I then w I else 0) := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro I hI by_cases h : P ∣ I <;> simp [h] have hbad : (∑ I ∈ fiber n, if P ∣ I then w I else 0) = ∑ I ∈ badFiber P m, w I := by rw [badFiber] exact sum_filter_squarefree (fun I => P ∣ I) w hzero n have hgood : (∑ J ∈ goodFiber P m, w J) = exceptPrimeCoeff P w m := by rw [goodFiber, exceptPrimeCoeff, Finset.sum_filter] apply Finset.sum_congr rfl intro J hJ by_cases hsq : Squarefree J · simp [hsq] · simp [hsq, hzero J hsq] calc (∑ I ∈ fiber n, w I) = (∑ I ∈ fiber n, if ¬P ∣ I then w I else 0) + (∑ I ∈ fiber n, if P ∣ I then w I else 0) := hsplit _ = exceptPrimeCoeff P w n + ∑ I ∈ badFiber P m, w I := by rw [hbad] rfl _ = exceptPrimeCoeff P w n + ∑ J ∈ goodFiber P m, w (P * J) := by rw [squarefree_prime_fiber_sum P hP m w] _ = exceptPrimeCoeff P w n + w P * ∑ J ∈ goodFiber P m, w J := by rw [Finset.mul_sum] congr 1 apply Finset.sum_congr rfl intro J hJ exact hmul J (mem_goodFiber.mp hJ).2.2 _ = exceptPrimeCoeff P w n + w P * exceptPrimeCoeff P w m := by rw [hgood] theorem restore_one_prime_all (P : Ideal O) (hP : Prime P) (w : Ideal O → ℂ) (hzero : ∀ I, ¬Squarefree I → w I = 0) (hmul : ∀ J, ¬P ∣ J → w (P * J) = w P * w J) (n : ℕ) : (∑ I ∈ fiber n, w I) = exceptPrimeCoeff P w n + (if Ideal.absNorm P ∣ n then w P * exceptPrimeCoeff P w (n / Ideal.absNorm P) else 0) := by classical by_cases hdiv : Ideal.absNorm P ∣ n · have hn : Ideal.absNorm P * (n / Ideal.absNorm P) = n := Nat.mul_div_cancel' hdiv rw [← hn] have hPnorm : Ideal.absNorm P ≠ 0 := (Ideal.absNorm_eq_zero_iff).not.mpr hP.ne_zero simpa [Nat.mul_div_cancel_left, hPnorm] using restore_one_prime P hP w hzero hmul (n / Ideal.absNorm P) · have hnone : ∀ I ∈ fiber n, ¬P ∣ I := by intro I hI hd apply hdiv have hnorm : Ideal.absNorm I = n := mem_fiber.mp hI rw [← hnorm] exact Ideal.absNorm_dvd_absNorm_of_le (Ideal.dvd_iff_le.mp hd) simp only [ite_eq_right hdiv, add_zero] rw [exceptPrimeCoeff] apply Finset.sum_congr rfl intro I hI simp [hnone I hI] open scoped Classical noncomputable def outsideCoeff (S : Finset (Ideal O)) (w : Ideal O → ℂ) (n : ℕ) : ℂ := ∑ I ∈ fiber n, outsideWeight S w I private theorem outsideWeight_zero_of_not_squarefree (S : Finset (Ideal O)) (w : Ideal O → ℂ) (hzero : ∀ I, ¬Squarefree I → w I = 0) (I : Ideal O) (hsq : ¬Squarefree I) : outsideWeight S w I = 0 := by by_cases hg : ∀ P ∈ S, ¬P ∣ I · simp [outsideWeight, hzero I hsq] · simp [outsideWeight, hg] private theorem outsideWeight_prime_of_not_mem (S : Finset (Ideal O)) (hprime : ∀ Q ∈ S, Prime Q) (P : Ideal O) (hP : Prime P) (hPnot : P ∉ S) (w : Ideal O → ℂ) : outsideWeight S w P = w P := by have hgood : ∀ Q ∈ S, ¬Q ∣ P := by intro Q hQ hd have heq : Q = P := associated_iff_eq.mp ((hprime Q hQ).associated_of_dvd hP hd) exact hPnot (heq ▸ hQ) change (if ∀ Q ∈ S, ¬Q ∣ P then w P else 0) = w P exact ite_eq_left hgood private theorem exceptPrimeCoeff_outsideWeight (S : Finset (Ideal O)) (P : Ideal O) (w : Ideal O → ℂ) (n : ℕ) : exceptPrimeCoeff P (outsideWeight S w) n = outsideCoeff (insert P S) w n := by classical unfold exceptPrimeCoeff outsideCoeff apply Finset.sum_congr rfl intro I hI by_cases hd : P ∣ I · simp [outsideWeight, hd] · by_cases hs : ∀ Q ∈ S, ¬Q ∣ I · simp [outsideWeight, hd] · simp [outsideWeight, hd, hs] theorem restore_insert_prime (S : Finset (Ideal O)) (hprime : ∀ Q ∈ S, Prime Q) (P : Ideal O) (hP : Prime P) (hPnot : P ∉ S) (w : Ideal O → ℂ) (hzero : ∀ I, ¬Squarefree I → w I = 0) (hmul : ∀ I J, IsRelPrime I J → w (I * J) = w I * w J) (n : ℕ) : outsideCoeff S w n = outsideCoeff (insert P S) w n + (if Ideal.absNorm P ∣ n then w P * outsideCoeff (insert P S) w (n / Ideal.absNorm P) else 0) := by have hzeroS : ∀ I, ¬Squarefree I → outsideWeight S w I = 0 := outsideWeight_zero_of_not_squarefree S w hzero have hmulS : ∀ J, ¬P ∣ J → outsideWeight S w (P * J) = outsideWeight S w P * outsideWeight S w J := by intro J hnot apply outsideWeight_mul S hprime w P J exact hmul P J (hP.irreducible.isRelPrime_iff_not_dvd.mpr hnot) have hrest := restore_one_prime_all P hP (outsideWeight S w) hzeroS hmulS n unfold outsideCoeff at hrest ⊢ rw [exceptPrimeCoeff_outsideWeight S P w n, exceptPrimeCoeff_outsideWeight S P w (n / Ideal.absNorm P), outsideWeight_prime_of_not_mem S hprime P hP hPnot w] at hrest exact hrest end FiniteSFactor namespace ShortDraftHeckeBridge theorem baseChangeWeight_zero_of_not_squarefree {q : ℕ} (χ : DirichletCharacter ℂ q) (I : Ideal O) (hsq : ¬Squarefree I) : baseChangeWeight χ I = 0 := by rw [baseChangeWeight, UniqueFactorizationMonoid.moebius_of_not_squarefree hsq] simp theorem baseChangeWeight_mul_of_isRelPrime {q : ℕ} (χ : DirichletCharacter ℂ q) (I J : Ideal O) (h : IsRelPrime I J) : baseChangeWeight χ (I * J) = baseChangeWeight χ I * baseChangeWeight χ J := by simp only [baseChangeWeight, map_mul, h.moebius_mul, Int.cast_mul, Nat.cast_mul] ring end ShortDraftHeckeBridge namespace DyadicTransfer end DyadicTransfer open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid namespace FiniteSFactor end FiniteSFactor end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.PrimeRows.NormFiberExtraction namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology namespace ConcretePrimeRowBridge section open ActualEisensteinCubic ShortDraftHeckeBridge abbrev K := CyclotomicField 3 ℚ abbrev O := NumberField.RingOfIntegers K theorem instIsCyclotomicExtensionSingletonNatSetOfNatRatK : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ theorem instIsPrincipalIdealRingO : IsPrincipalIdealRing O := letI := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK IsCyclotomicExtension.Rat.three_pid K noncomputable def idealGenerator (I : Ideal O) : O := letI := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO Submodule.IsPrincipal.generator I theorem span_idealGenerator (I : Ideal O) : Ideal.span {idealGenerator I} = I := letI := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO by exact Submodule.IsPrincipal.span_singleton_generator I theorem idealGenerator_injective : Function.Injective idealGenerator := by intro I J h calc I = Ideal.span {idealGenerator I} := (span_idealGenerator I).symm _ = Ideal.span {idealGenerator J} := by rw [h] _ = J := span_idealGenerator J noncomputable def idealsUpTo (D : ℕ) : Finset (Ideal O) := (Finset.Icc 1 D).biUnion (fun n => (Ideal.finite_setOfPred_absNorm_eq (S := O) n).toFinset) theorem mem_idealsUpTo {D : ℕ} {I : Ideal O} : I ∈ idealsUpTo D ↔ 1 ≤ Ideal.absNorm I ∧ Ideal.absNorm I ≤ D := by classical simp [idealsUpTo, Finset.mem_biUnion, Finset.mem_Icc] noncomputable def columnsUpTo (D : ℕ) : Finset O := by classical exact (idealsUpTo D).image idealGenerator noncomputable def columnWeight {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℕ → ℂ) (x : O) : ℂ := baseChangeWeight χ (Ideal.span {x}) * W (Ideal.absNorm (Ideal.span {x})) theorem columnWeight_idealGenerator {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℕ → ℂ) (I : Ideal O) : columnWeight χ W (idealGenerator I) = baseChangeWeight χ I * W (Ideal.absNorm I) := by simp [columnWeight, span_idealGenerator] noncomputable def goodLambda : O := letI := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK (IsCyclotomicExtension.zeta_spec 3 ℚ K).toInteger - 1 noncomputable def primePool (F : Finset (Ideal O)) : Finset (Ideal O) := F.biUnion (fun I => (UniqueFactorizationMonoid.normalizedFactors I).toFinset) theorem mem_primePool_iff {F : Finset (Ideal O)} {P : Ideal O} : P ∈ primePool F ↔ ∃ I ∈ F, P ∈ UniqueFactorizationMonoid.normalizedFactors I := by classical simp only [primePool, Finset.mem_biUnion, Multiset.mem_toFinset] theorem primePool_maximal (F : Finset (Ideal O)) (_hFpos : ∀ I ∈ F, I ≠ ⊥) (i : primePool F) : (i.1).IsMaximal := by obtain ⟨I, hIF, hfac⟩ := mem_primePool_iff.mp i.property have hp : Prime i.1 := UniqueFactorizationMonoid.prime_of_normalized_factor i.1 hfac exact (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero theorem primePool_good (F : Finset (Ideal O)) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (i : primePool F) : goodLambda ∉ i.1 := by obtain ⟨I, hIF, hfac⟩ := mem_primePool_iff.mp i.property exact hFgood I hIF i.1 hfac noncomputable def idealSupport (F : Finset (Ideal O)) (I : Ideal O) : Finset (primePool F) := Finset.univ.filter (fun i => i.1 ∈ UniqueFactorizationMonoid.normalizedFactors I) theorem mem_idealSupport_iff (F : Finset (Ideal O)) (I : Ideal O) (i : primePool F) : i ∈ idealSupport F I ↔ i.1 ∈ UniqueFactorizationMonoid.normalizedFactors I := by classical simp [idealSupport] theorem idealGenerator_mem_prime_of_support (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (I : Ideal O) (hIF : I ∈ F) (i : primePool F) (hi : i ∈ idealSupport F I) : idealGenerator I ∈ i.1 := by have hfac := (mem_idealSupport_iff F I i).mp hi have hle := ((Ideal.mem_normalizedFactors_iff (hFpos I hIF)).mp hfac).2 have hmem : idealGenerator I ∈ Ideal.span {idealGenerator I} := Ideal.subset_span (Set.mem_singleton _) rw [span_idealGenerator I] at hmem exact hle hmem noncomputable def idealSexticRow (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (I : Ideal O) (u : O) : ℂ := by letI : ∀ i : primePool F, (i.1).IsMaximal := primePool_maximal F hFpos exact ActualEisensteinCubic.finiteSquarefreeRow (fun i : primePool F => i.1) (primePool_good F hFgood) (idealSupport F I) u theorem baseChangeWeight_zero_of_not_squarefree {q : ℕ} (χ : DirichletCharacter ℂ q) (I : Ideal O) (hI : ¬ Squarefree I) : baseChangeWeight χ I = 0 := by rw [baseChangeWeight, UniqueFactorizationMonoid.moebius_of_not_squarefree hI] simp private theorem idealMoebius_norm_le_one (I : Ideal O) : ‖((UniqueFactorizationMonoid.moebius I : ℤ) : ℂ)‖ ≤ 1 := by classical by_cases h : Squarefree I · rw [h.moebius_eq] simp · rw [UniqueFactorizationMonoid.moebius_of_not_squarefree h] simp theorem baseChangeWeight_norm_le_one {q : ℕ} (χ : DirichletCharacter ℂ q) (I : Ideal O) : ‖baseChangeWeight χ I‖ ≤ 1 := by rw [baseChangeWeight, norm_mul] have hμ := idealMoebius_norm_le_one I have hχ := χ.norm_le_one (Ideal.absNorm I) exact (mul_le_mul hμ hχ (norm_nonneg _) (by positivity)).trans (by norm_num) theorem columnWeight_norm_le_one {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℕ → ℂ) (hW : ∀ n, ‖W n‖ ≤ 1) (x : O) : ‖columnWeight χ W x‖ ≤ 1 := by rw [columnWeight, norm_mul] have hμ := baseChangeWeight_norm_le_one χ (Ideal.span {x}) have hW' := hW (Ideal.absNorm (Ideal.span {x})) exact (mul_le_mul hμ hW' (norm_nonneg _) (by positivity)).trans (by norm_num) noncomputable def elementRow (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℕ → ℂ) (u : O) : ℂ := by classical letI : ∀ i : primePool F, (i.1).IsMaximal := primePool_maximal F hFpos exact ∑ x ∈ F.image idealGenerator, columnWeight χ W x * finiteSquarefreeRow (fun i : primePool F => i.1) (primePool_good F hFgood) (idealSupport F (Ideal.span {x})) u noncomputable def idealRowSum (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℕ → ℂ) (u : O) : ℂ := ∑ I ∈ F, baseChangeWeight χ I * W (Ideal.absNorm I) * idealSexticRow F hFpos hFgood I u theorem elementRow_eq_idealRowSum (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℕ → ℂ) (u : O) : elementRow F hFpos hFgood χ W u = idealRowSum F hFpos hFgood χ W u := by classical let : ∀ i : primePool F, (i.1).IsMaximal := primePool_maximal F hFpos unfold elementRow idealRowSum rw [Finset.sum_image] · apply Finset.sum_congr rfl intro I hI rw [columnWeight_idealGenerator, span_idealGenerator] rfl · intro I hI J hJ h exact idealGenerator_injective h open ActualEisensteinCubic ShortDraftHeckeBridge open scoped Classical noncomputable def rowNormDisk (H : ℕ) : Finset O := by classical exact (ShortDraftLatticeCount.rowNormBall H).filter (fun u => 0 < Ideal.absNorm (Ideal.span {u}) ∧ Ideal.absNorm (Ideal.span {u}) ≤ H) theorem mem_rowNormDisk {H : ℕ} {u : O} : u ∈ rowNormDisk H ↔ 0 < Ideal.absNorm (Ideal.span {u}) ∧ Ideal.absNorm (Ideal.span {u}) ≤ H := by classical constructor · intro h exact (Finset.mem_filter.mp h).2 · intro h exact Finset.mem_filter.mpr ⟨ShortDraftLatticeCount.mem_rowNormBall_of_absNorm_le H u h.2, h⟩ theorem sixth_power_rows_in_rowNormDisk {β : Type*} (selected : Finset β) (p : β → O) (D H : ℕ) (hD : 1 ≤ D) (hp : ∀ i ∈ selected, p i ≠ 0) (hnormupper : ∀ i ∈ selected, (Ideal.absNorm (Ideal.span {p i}) : ℝ) ≤ (D : ℝ) ^ (11 / 60 : ℝ)) (hH : Nat.floor ((D : ℝ) ^ (11 / 10 : ℝ)) ≤ H) : selected.image (fun i => p i ^ 6) ⊆ rowNormDisk H := by classical intro u hu obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hu rw [mem_rowNormDisk] have hpNorm : Ideal.absNorm (Ideal.span {p i}) ≠ 0 := (Ideal.absNorm_eq_zero_iff).not.mpr (Ideal.span_singleton_eq_bot.not.mpr (hp i hi)) have hDreal : (1 : ℝ) ≤ D := by exact_mod_cast hD have hDpos : (0 : ℝ) < D := lt_of_lt_of_le zero_lt_one hDreal have hupper : (Ideal.absNorm (Ideal.span {p i ^ 6}) : ℝ) ≤ (D : ℝ) ^ (11 / 10 : ℝ) := by calc (Ideal.absNorm (Ideal.span {p i ^ 6}) : ℝ) = (Ideal.absNorm (Ideal.span {p i}) : ℝ) ^ 6 := by exact_mod_cast ActualEisensteinCubic.principal_absNorm_pow (p i) 6 _ ≤ ((D : ℝ) ^ (11 / 60 : ℝ)) ^ 6 := by gcongr exact hnormupper i hi _ = (D : ℝ) ^ (11 / 10 : ℝ) := by rw [← Real.rpow_mul_natCast hDpos.le (11 / 60 : ℝ) 6] congr 1 norm_num constructor · rw [ActualEisensteinCubic.principal_absNorm_pow] exact pow_pos (Nat.pos_of_ne_zero hpNorm) 6 · exact (Nat.le_floor hupper).trans hH theorem baseChange_prime_extraction_from_MS {β : Type*} {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℕ → ℂ) (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (hW : ∀ n, ‖W n‖ ≤ 1) (selected : Finset β) (p : β → O) (D H : ℕ) (ε : ℝ) (hD : 1 ≤ D) (hε : 0 ≤ ε) (hFnorm : ∀ I ∈ F, Ideal.absNorm I ≤ D) (hp : ∀ i ∈ selected, p i ≠ 0) (hprime : ∀ i ∈ selected, (Ideal.span {p i} : Ideal O).IsMaximal) (hinj : Set.InjOn (fun i => (Ideal.span {p i} : Ideal O)) (selected : Set β)) (hnormlower : ∀ i ∈ selected, (D : ℝ) ^ (11 / 60 : ℝ) / 2 ≤ (Ideal.absNorm (Ideal.span {p i}) : ℝ)) (hnormupper : ∀ i ∈ selected, (Ideal.absNorm (Ideal.span {p i}) : ℝ) ≤ (D : ℝ) ^ (11 / 60 : ℝ)) (hH : Nat.floor ((D : ℝ) ^ (11 / 10 : ℝ)) ≤ H) (hcount : (D : ℝ) ^ ((11 / 60 : ℝ) - ε) ≤ (selected.card : ℝ)) (hmean : (∑ u ∈ rowNormDisk H, ‖idealRowSum F hFpos hFgood χ W u‖ ^ 2) ≤ (D : ℝ) ^ ((21 / 10 : ℝ) + ε)) : ‖∑ I ∈ F, baseChangeWeight χ I * W (Ideal.absNorm I)‖ ≤ 384 * (D : ℝ) ^ ((23 / 24 : ℝ) + ε) := by classical let : ∀ i : primePool F, (i.1).IsMaximal := primePool_maximal F hFpos let P : primePool F → Ideal O := fun i => i.1 let support : O → Finset (primePool F) := fun x => idealSupport F (Ideal.span {x}) let columns : Finset O := F.image idealGenerator let weight : O → ℂ := columnWeight χ W have hsupport : ∀ x ∈ columns, ∀ i ∈ support x, x ∈ P i := by intro x hx i hi obtain ⟨I, hIF, rfl⟩ := Finset.mem_image.mp hx dsimp [support, P] at hi ⊢ rw [span_idealGenerator I] at hi exact idealGenerator_mem_prime_of_support F hFpos I hIF i hi have hcolnorm : ∀ x ∈ columns, Ideal.absNorm (Ideal.span {x}) ≤ D := by intro x hx obtain ⟨I, hIF, rfl⟩ := Finset.mem_image.mp hx rw [span_idealGenerator I] exact hFnorm I hIF have hweight : ∀ x ∈ columns, ‖weight x‖ ≤ 1 := by intro x hx exact columnWeight_norm_le_one χ W hW x have hmean' : (∑ u ∈ rowNormDisk H, ‖∑ x ∈ columns, weight x * finiteSquarefreeRow P (primePool_good F hFgood) (support x) u‖ ^ 2) ≤ (D : ℝ) ^ ((21 / 10 : ℝ) + ε) := by calc _ = ∑ u ∈ rowNormDisk H, ‖idealRowSum F hFpos hFgood χ W u‖ ^ 2 := by apply Finset.sum_congr rfl intro u hu change ‖elementRow F hFpos hFgood χ W u‖ ^ 2 = ‖idealRowSum F hFpos hFgood χ W u‖ ^ 2 rw [elementRow_eq_idealRowSum] _ ≤ _ := hmean have hrows : selected.image (fun i => p i ^ 6) ⊆ rowNormDisk H := sixth_power_rows_in_rowNormDisk selected p D H hD hp hnormupper hH have hbound := finite_actual_prime_extraction_dyadic P (primePool_good F hFgood) columns support weight selected p (rowNormDisk H) D ε hD hε hp hprime hinj hrows hsupport hcolnorm hweight hnormlower hcount hmean' have hsum : (∑ x ∈ columns, weight x) = ∑ I ∈ F, baseChangeWeight χ I * W (Ideal.absNorm I) := by change (∑ x ∈ F.image idealGenerator, columnWeight χ W x) = _ rw [Finset.sum_image] · apply Finset.sum_congr rfl intro I hIF exact columnWeight_idealGenerator χ W I · intro I hIF J hJF h exact idealGenerator_injective h rwa [hsum] at hbound end open ShortDraftHeckeBridge FiniteSFactor noncomputable def outsideIdealsUpTo (S : Finset (Ideal O)) (D : ℕ) : Finset (Ideal O) := by classical exact (idealsUpTo D).filter (fun I => ∀ P ∈ S, ¬ P ∣ I) theorem mem_outsideIdealsUpTo {S : Finset (Ideal O)} {D : ℕ} {I : Ideal O} : I ∈ outsideIdealsUpTo S D ↔ 1 ≤ Ideal.absNorm I ∧ Ideal.absNorm I ≤ D ∧ (∀ P ∈ S, ¬ P ∣ I) := by classical simp [outsideIdealsUpTo, mem_idealsUpTo, and_assoc] theorem outsideIdealsUpTo_ne_bot (S : Finset (Ideal O)) (D : ℕ) (I : Ideal O) (hI : I ∈ outsideIdealsUpTo S D) : I ≠ ⊥ := by have hn := (mem_outsideIdealsUpTo.mp hI).1 intro h subst I simp at hn theorem outsideIdealsUpTo_norm_le (S : Finset (Ideal O)) (D : ℕ) (I : Ideal O) (hI : I ∈ outsideIdealsUpTo S D) : Ideal.absNorm I ≤ D := (mem_outsideIdealsUpTo.mp hI).2.1 theorem goodLambda_prime : Prime goodLambda := by let : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ let : Fact (Nat.Prime 3) := ⟨Nat.prime_three⟩ exact (IsCyclotomicExtension.zeta_spec 3 ℚ K).zeta_sub_one_prime' theorem goodLambdaIdeal_maximal : (Ideal.span {goodLambda} : Ideal O).IsMaximal := by have hp : (Ideal.span {goodLambda} : Ideal O).IsPrime := Ideal.isPrime_span_singleton_of_prime goodLambda_prime have hne : (Ideal.span {goodLambda} : Ideal O) ≠ ⊥ := Ideal.span_singleton_eq_bot.not.mpr goodLambda_prime.ne_zero exact hp.isMaximal hne theorem badPrime_cover_of_lambdaIdeal_mem (S : Finset (Ideal O)) (hS : (Ideal.span {goodLambda} : Ideal O) ∈ S) : ∀ P : Ideal O, P.IsMaximal → goodLambda ∈ P → P ∈ S := by intro P hP hmem have hle : (Ideal.span {goodLambda} : Ideal O) ≤ P := (Ideal.span_singleton_le_iff_mem P).mpr hmem have heq : (Ideal.span {goodLambda} : Ideal O) = P := goodLambdaIdeal_maximal.eq_of_le hP.ne_top hle rwa [heq] at hS theorem outsideIdealsUpTo_good (S : Finset (Ideal O)) (D : ℕ) (hSbad : ∀ P : Ideal O, P.IsMaximal → goodLambda ∈ P → P ∈ S) (I : Ideal O) (hI : I ∈ outsideIdealsUpTo S D) (Q : Ideal O) (hQ : Q ∈ UniqueFactorizationMonoid.normalizedFactors I) : goodLambda ∉ Q := by intro hmemLam have hne : I ≠ ⊥ := outsideIdealsUpTo_ne_bot S D I hI have hp : Prime Q := UniqueFactorizationMonoid.prime_of_normalized_factor Q hQ have hmax : Q.IsMaximal := (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero have hQS : Q ∈ S := hSbad Q hmax hmemLam have hdiv : Q ∣ I := (Ideal.dvd_iff_le).mpr ((Ideal.mem_normalizedFactors_iff hne).mp hQ).2 exact (mem_outsideIdealsUpTo.mp hI).2.2 Q hQS hdiv theorem idealsUpTo_eq_biUnion_fibers (D : ℕ) : idealsUpTo D = (Finset.Icc 1 D).biUnion FiniteSFactor.fiber := by rfl private theorem normFibers_pairwiseDisjoint (D : ℕ) : ((Finset.Icc 1 D : Finset ℕ) : Set ℕ).PairwiseDisjoint FiniteSFactor.fiber := by intro n hn m hm hnm apply Finset.disjoint_left.mpr intro I hIn hIm exact hnm ((FiniteSFactor.mem_fiber.mp hIn).symm.trans (FiniteSFactor.mem_fiber.mp hIm)) theorem outsideIdealSum_eq_outsideCoeff_sum (S : Finset (Ideal O)) (D : ℕ) (w : Ideal O → ℂ) (W : ℕ → ℂ) : (∑ I ∈ outsideIdealsUpTo S D, w I * W (Ideal.absNorm I)) = ∑ n ∈ Finset.Icc 1 D, FiniteSFactor.outsideCoeff S w n * W n := by classical have hsets : outsideIdealsUpTo S D = (Finset.Icc 1 D).biUnion (fun n => (FiniteSFactor.fiber n).filter (fun I => ∀ P ∈ S, ¬P ∣ I)) := by ext I simp [outsideIdealsUpTo, idealsUpTo_eq_biUnion_fibers, FiniteSFactor.mem_fiber, Finset.mem_biUnion] rw [hsets, Finset.sum_biUnion] · apply Finset.sum_congr rfl intro n hn rw [FiniteSFactor.outsideCoeff, Finset.sum_mul, Finset.sum_filter] apply Finset.sum_congr rfl intro I hI rw [FiniteSFactor.mem_fiber.mp hI] by_cases hgood : ∀ P ∈ S, ¬P ∣ I <;> simp [FiniteSFactor.outsideWeight, hgood] · intro n hn m hm hnm exact Finset.disjoint_filter_filter (normFibers_pairwiseDisjoint D hn hm hnm) theorem outsideCoeff_prime_extraction_from_MS {β : Type*} {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℕ → ℂ) (S : Finset (Ideal O)) (hSbad : ∀ P : Ideal O, P.IsMaximal → goodLambda ∈ P → P ∈ S) (hW : ∀ n, ‖W n‖ ≤ 1) (selected : Finset β) (p : β → O) (D H : ℕ) (ε : ℝ) (hD : 1 ≤ D) (hε : 0 ≤ ε) (hp : ∀ i ∈ selected, p i ≠ 0) (hprime : ∀ i ∈ selected, (Ideal.span {p i} : Ideal O).IsMaximal) (hinj : Set.InjOn (fun i => (Ideal.span {p i} : Ideal O)) (selected : Set β)) (hnormlower : ∀ i ∈ selected, (D : ℝ) ^ (11 / 60 : ℝ) / 2 ≤ (Ideal.absNorm (Ideal.span {p i}) : ℝ)) (hnormupper : ∀ i ∈ selected, (Ideal.absNorm (Ideal.span {p i}) : ℝ) ≤ (D : ℝ) ^ (11 / 60 : ℝ)) (hH : Nat.floor ((D : ℝ) ^ (11 / 10 : ℝ)) ≤ H) (hcount : (D : ℝ) ^ ((11 / 60 : ℝ) - ε) ≤ (selected.card : ℝ)) (hmean : (∑ u ∈ rowNormDisk H, ‖idealRowSum (outsideIdealsUpTo S D) (outsideIdealsUpTo_ne_bot S D) (outsideIdealsUpTo_good S D hSbad) χ W u‖ ^ 2) ≤ (D : ℝ) ^ ((21 / 10 : ℝ) + ε)) : ‖∑ n ∈ Finset.Icc 1 D, FiniteSFactor.outsideCoeff S (baseChangeWeight χ) n * W n‖ ≤ 384 * (D : ℝ) ^ ((23 / 24 : ℝ) + ε) := by let F := outsideIdealsUpTo S D have hbound := baseChange_prime_extraction_from_MS χ W F (outsideIdealsUpTo_ne_bot S D) (outsideIdealsUpTo_good S D hSbad) hW selected p D H ε hD hε (outsideIdealsUpTo_norm_le S D) hp hprime hinj hnormlower hnormupper hH hcount hmean simpa only [F, outsideIdealSum_eq_outsideCoeff_sum] using hbound open ShortDraftHeckeBridge FiniteSFactor Filter end ConcretePrimeRowBridge end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.FiniteEulerRestoration namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics namespace FiniteEulerRestoration theorem tsum_dvd_shift {N : ℕ} (hN : 0 < N) (b : ℕ → ℂ) (φ : ℕ → ℂ) : (∑' n : ℕ, if N ∣ n then b (n / N) * φ n else 0) = ∑' m : ℕ, b m * φ (N * m) := by classical let f : ℕ → ℂ := fun n => if N ∣ n then b (n / N) * φ n else 0 let g : ℕ → ℂ := fun m => b m * φ (N * m) have hindex (m : ℕ) : f (N * m) = g m := by simp [f, g, hN] change (∑' n : ℕ, f n) = ∑' m : ℕ, g m refine tsum_eq_tsum_of_ne_zero_bij (fun x : Function.support g => N * x.1) ?_ ?_ ?_ · intro x y hxy apply Subtype.ext exact Nat.mul_left_cancel hN hxy · intro n hn have hdiv : N ∣ n := by by_contra hnot have : f n = 0 := by simp [f, hnot] exact hn this let m := n / N have hnm : N * m = n := Nat.mul_div_cancel' hdiv have hgm : g m ≠ 0 := by intro hg apply hn rw [← hnm, hindex, hg] exact ⟨⟨m, hgm⟩, hnm⟩ · intro x exact hindex x.1 theorem tsum_restore_one_prime {N : ℕ} (hN : 0 < N) (c : ℂ) (a b φ : ℕ → ℂ) (hcoeff : ∀ n, a n = b n + if N ∣ n then c * b (n / N) else 0) (hb : Summable (fun n => b n * φ n)) (hshift : Summable (fun m => b m * φ (N * m))) : (∑' n : ℕ, a n * φ n) = (∑' n : ℕ, b n * φ n) + c * (∑' m : ℕ, b m * φ (N * m)) := by classical let f : ℕ → ℂ := fun n => if N ∣ n then b (n / N) * φ n else 0 have hcomp : (fun m => f (N * m)) = (fun m => b m * φ (N * m)) := by funext m simp [f, hN] have hinj : Function.Injective (fun m : ℕ => N * m) := fun _ _ h => Nat.mul_left_cancel hN h have hsupport : ∀ n, n ∉ Set.range (fun m : ℕ => N * m) → f n = 0 := by intro n hn have hnot : ¬N ∣ n := by intro hd exact hn ⟨n / N, Nat.mul_div_cancel' hd⟩ simp [f, hnot] have hf : Summable f := by rw [← (hinj.summable_iff hsupport)] change Summable (fun m => f (N * m)) rw [hcomp] exact hshift have hfc : Summable (fun n => c * f n) := hf.mul_left c have hpoint (n : ℕ) : a n * φ n = b n * φ n + c * f n := by rw [hcoeff n] by_cases hd : N ∣ n · simp [f, hd] ring · simp [f, hd] calc (∑' n : ℕ, a n * φ n) = ∑' n : ℕ, (b n * φ n + c * f n) := by congr 1 funext n exact hpoint n _ = (∑' n : ℕ, b n * φ n) + ∑' n : ℕ, c * f n := hb.tsum_add hfc _ = (∑' n : ℕ, b n * φ n) + c * (∑' m : ℕ, b m * φ (N * m)) := by rw [tsum_mul_left, tsum_dvd_shift hN b φ] end FiniteEulerRestoration namespace FiniteSFactor end FiniteSFactor open Filter Asymptotics MeasureTheory open scoped Topology namespace CompactMellinBridge theorem mellin_weighted_sum (a : ℕ → ℂ) (W F : ℝ → ℂ) (s : ℂ) (ha0 : a 0 = 0) (hF : ∀ t : ℝ, 0 < t → HasSum (fun n : ℕ => a n * W ((n : ℝ) * t)) (F t)) (hint : ∀ n : ℕ, IntegrableOn (fun t : ℝ => (t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t))) (Set.Ioi 0)) (hsumint : Summable (fun n : ℕ => ∫ t : ℝ in Set.Ioi 0, ‖(t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t))‖)) (hlsum : LSeriesSummable a s) : mellin (fun D : ℝ => F D⁻¹) (-s) = mellin W s * LSeries a s := by have hterm (n : ℕ) : (∫ t : ℝ in Set.Ioi 0, (t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t))) = mellin W s * LSeries.term a s n := by by_cases hn : n = 0 · subst n simp [ha0, LSeries.term_zero] · have hnpos : (0 : ℝ) < n := by exact_mod_cast Nat.pos_of_ne_zero hn have hscale := mellin_comp_mul_left W s hnpos have hmul : mellin (fun t : ℝ => a n * W ((n : ℝ) * t)) s = a n * mellin (fun t : ℝ => W ((n : ℝ) * t)) s := by simpa only [smul_eq_mul] using (mellin_const_smul (fun t : ℝ => W ((n : ℝ) * t)) s (a n)) change mellin (fun t : ℝ => a n * W ((n : ℝ) * t)) s = _ rw [hmul, hscale, LSeries.term_of_ne_zero hn] simp only [smul_eq_mul, Complex.ofReal_natCast, Complex.cpow_neg] ring have hsum : (∑' n : ℕ, ∫ t : ℝ in Set.Ioi 0, (t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t))) = ∫ t : ℝ in Set.Ioi 0, ∑' n : ℕ, (t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t)) := integral_tsum_of_summable_integral_norm hint hsumint have hseries : (∑' n : ℕ, mellin W s * LSeries.term a s n) = mellin W s * LSeries a s := by simpa only [LSeries] using hlsum.hasSum.mul_left (mellin W s) |>.tsum_eq calc mellin (fun D : ℝ => F D⁻¹) (-s) = mellin F s := by simpa using mellin_comp_inv F (-s) _ = ∫ t : ℝ in Set.Ioi 0, ∑' n : ℕ, (t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t)) := by unfold mellin apply setIntegral_congr_fun measurableSet_Ioi intro t ht change (t : ℂ) ^ (s - 1) * F t = ∑' n : ℕ, (t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t)) rw [← (hF t ht).tsum_eq] rw [← tsum_mul_left] _ = ∑' n : ℕ, ∫ t : ℝ in Set.Ioi 0, (t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t)) := hsum.symm _ = ∑' n : ℕ, mellin W s * LSeries.term a s n := by simp_rw [hterm] _ = mellin W s * LSeries a s := hseries theorem weighted_sum_zero_of_large_t (a : ℕ → ℂ) (ha0 : a 0 = 0) (W F : ℝ → ℂ) (hW : ∀ y : ℝ, 2 ≤ y → W y = 0) (hF : ∀ t : ℝ, 0 < t → HasSum (fun n : ℕ => a n * W ((n : ℝ) * t)) (F t)) (t : ℝ) (ht : 2 ≤ t) : F t = 0 := by have hterm (n : ℕ) : a n * W ((n : ℝ) * t) = 0 := by by_cases hn : n = 0 · simp [hn, ha0] · have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr hn have hnt : 2 ≤ (n : ℝ) * t := by calc 2 ≤ t := ht _ = (1 : ℝ) * t := by ring _ ≤ (n : ℝ) * t := mul_le_mul_of_nonneg_right hn1 (by linarith) simp [hW _ hnt] have hzero : HasSum (fun n : ℕ => a n * W ((n : ℝ) * t)) 0 := by simpa only [hterm] using (hasSum_zero : HasSum (fun _ : ℕ => (0 : ℂ)) 0) exact (hF t (lt_of_lt_of_le (by norm_num) ht)).unique hzero theorem weighted_sum_zero_near_small_D (a : ℕ → ℂ) (ha0 : a 0 = 0) (W F : ℝ → ℂ) (hW : ∀ y : ℝ, 2 ≤ y → W y = 0) (hF : ∀ t : ℝ, 0 < t → HasSum (fun n : ℕ => a n * W ((n : ℝ) * t)) (F t)) : (fun D : ℝ => F D⁻¹) =ᶠ[𝓝[>] (0 : ℝ)] (fun _ => 0) := by filter_upwards [Ioo_mem_nhdsGT (by norm_num : (0 : ℝ) < 1 / 2)] with D hD have hDpos : 0 < D := hD.1 have hDsmall : D < 1 / 2 := hD.2 have hDinvpos : 0 < D⁻¹ := inv_pos.mpr hDpos have hmul := mul_le_mul_of_nonneg_right (le_of_lt hDsmall) hDinvpos.le have hinv : 2 ≤ D⁻¹ := by rw [mul_inv_cancel₀ (ne_of_gt hDpos)] at hmul nlinarith exact weighted_sum_zero_of_large_t a ha0 W F hW hF D⁻¹ hinv theorem compact_weight_mellin_analytic (W : ℝ → ℂ) (hW : ContDiff ℝ (↑(⊤ : ℕ∞)) W) (hsupp : ∀ y : ℝ, y ≤ 1 ∨ 2 ≤ y → W y = 0) (σ : ℝ) : AnalyticOnNhd ℂ (mellin W) {s : ℂ | σ < s.re} := by let A : ℝ → ℂ := fun D => W D⁻¹ have hcont : ContinuousOn A (Set.Ioi (0 : ℝ)) := by have hcontW : ContinuousOn W Set.univ := hW.continuous.continuousOn apply hcontW.comp (continuousOn_inv₀.mono (by intro D hD exact ne_of_gt hD)) intro D hD simp have hlocal : LocallyIntegrableOn A (Set.Ioi (0 : ℝ)) := hcont.locallyIntegrableOn measurableSet_Ioi have hzero : A =ᶠ[𝓝[>] (0 : ℝ)] (fun _ => 0) := by filter_upwards [Ioo_mem_nhdsGT (by norm_num : (0 : ℝ) < 1 / 2)] with D hD have hDpos : 0 < D := hD.1 have hDsmall : D < 1 / 2 := hD.2 have hDinvpos : 0 < D⁻¹ := inv_pos.mpr hDpos have hmul := mul_le_mul_of_nonneg_right (le_of_lt hDsmall) hDinvpos.le have hinv : 2 ≤ D⁻¹ := by rw [mul_inv_cancel₀ (ne_of_gt hDpos)] at hmul nlinarith exact hsupp D⁻¹ (Or.inr hinv) have hzeroTop : A =ᶠ[atTop] (fun _ => 0) := by filter_upwards [eventually_ge_atTop (1 : ℝ)] with D hD have hDpos : 0 < D := lt_of_lt_of_le zero_lt_one hD have hDinvpos : 0 < D⁻¹ := inv_pos.mpr hDpos have hmul := mul_le_mul_of_nonneg_right hD hDinvpos.le have hinv : D⁻¹ ≤ 1 := by rw [mul_inv_cancel₀ (ne_of_gt hDpos)] at hmul nlinarith exact hsupp D⁻¹ (Or.inl hinv) have htop : A =O[atTop] (fun D : ℝ => D ^ σ) := hzeroTop.isBigO.trans (isBigO_zero _ _) have hM := ShortDraftMellin.inverse_mellin_analytic A σ hlocal htop hzero simpa only [A, mellin_comp_inv, neg_neg] using hM structure BaseChangeCompactTest {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) (ρ : ℂ) where W : ℝ → ℂ F : ℝ → ℂ sigma : ℝ sigma_pos : 0 < sigma sigma_lt : sigma < ρ.re smooth : ContDiff ℝ (↑(⊤ : ℕ∞)) W support : ∀ y : ℝ, y ≤ 1 ∨ 2 ≤ y → W y = 0 sum_eq : ∀ t : ℝ, 0 < t → HasSum (fun n : ℕ => ShortDraftHeckeBridge.normFiberCoeff (ShortDraftHeckeBridge.baseChangeWeight χ) n * W ((n : ℝ) * t)) (F t) term_integrable : ∀ (s : ℂ), 1 < s.re → ∀ n : ℕ, IntegrableOn (fun t : ℝ => (t : ℂ) ^ (s - 1) * (ShortDraftHeckeBridge.normFiberCoeff (ShortDraftHeckeBridge.baseChangeWeight χ) n * W ((n : ℝ) * t))) (Set.Ioi 0) fubini : ∀ (s : ℂ), 1 < s.re → Summable (fun n : ℕ => ∫ t : ℝ in Set.Ioi 0, ‖(t : ℂ) ^ (s - 1) * (ShortDraftHeckeBridge.normFiberCoeff (ShortDraftHeckeBridge.baseChangeWeight χ) n * W ((n : ℝ) * t))‖) locally_integrable : LocallyIntegrableOn (fun D : ℝ => F D⁻¹) (Set.Ioi 0) power_bound : (fun D : ℝ => F D⁻¹) =O[atTop] (fun D : ℝ => D ^ sigma) mellin_nonzero : mellin W ρ ≠ 0 end CompactMellinBridge end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Hecke.FiniteEulerFactors namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField namespace FiniteSFactor private theorem fiber_card_natCard (n : ℕ) : (fiber n).card = Nat.card {I : Ideal O // Ideal.absNorm I = n} := by change (Ideal.finite_setOfPred_absNorm_eq (S := O) n).toFinset.card = Set.ncard {I : Ideal O | Ideal.absNorm I = n} exact (Set.ncard_eq_toFinset_card _ _).symm private theorem fiber_card_le_count (n : ℕ) : (fiber n).card ≤ Nat.card {I : Ideal O // Ideal.absNorm I ≤ n} := by let f : {I : Ideal O // Ideal.absNorm I = n} → {I : Ideal O // Ideal.absNorm I ≤ n} := fun I => ⟨I.1, I.2.le⟩ have hinj : Function.Injective f := by intro I J h have hval : I.1 = J.1 := congrArg (fun x : {I : Ideal O // Ideal.absNorm I ≤ n} => x.1) h exact Subtype.ext hval have hfin : Finite {I : Ideal O // Ideal.absNorm I ≤ n} := Ideal.finite_setOfPred_absNorm_le n simpa only [fiber_card_natCard] using Nat.card_le_card_of_injective f hinj private theorem count_isBigO : (fun n : ℕ => (Nat.card {I : Ideal O // Ideal.absNorm I ≤ n} : ℝ)) =O[atTop] (fun n : ℕ => (n : ℝ)) := by have hlim := (NumberField.Ideal.tendsto_norm_le_div_atTop (CyclotomicField 3 ℚ)).comp tendsto_natCast_atTop_atTop have hlim' : Filter.Tendsto (fun n : ℕ => (Nat.card {I : Ideal O // Ideal.absNorm I ≤ n} : ℝ) / (n : ℝ)) atTop (nhds ((2 ^ NumberField.InfinitePlace.nrRealPlaces (CyclotomicField 3 ℚ) * (2 * Real.pi) ^ NumberField.InfinitePlace.nrComplexPlaces (CyclotomicField 3 ℚ) * NumberField.Units.regulator (CyclotomicField 3 ℚ) * (NumberField.classNumber (CyclotomicField 3 ℚ) : ℝ)) / ((NumberField.Units.torsionOrder (CyclotomicField 3 ℚ) : ℝ) * Real.sqrt |(NumberField.discr (CyclotomicField 3 ℚ) : ℝ)|))) := by simpa [Function.comp_def] using hlim have hzero : ∀ᶠ n : ℕ in atTop, (n : ℝ) = 0 → (Nat.card {I : Ideal O // Ideal.absNorm I ≤ n} : ℝ) = 0 := by filter_upwards [eventually_ge_atTop (1 : ℕ)] with n hn hz have hn0 : n = 0 := by exact_mod_cast hz exact (Nat.ne_of_gt hn hn0).elim exact Asymptotics.isBigO_of_div_tendsto_nhds hzero _ hlim' private theorem fiber_card_eventually_le_linear : ∃ C : ℝ, ∀ᶠ n : ℕ in atTop, ((fiber n).card : ℝ) ≤ C * n := by obtain ⟨C, hC⟩ := count_isBigO.bound refine ⟨C, ?_⟩ filter_upwards [hC] with n hn calc ((fiber n).card : ℝ) ≤ (Nat.card {I : Ideal O // Ideal.absNorm I ≤ n} : ℝ) := by exact_mod_cast fiber_card_le_count n _ = ‖(Nat.card {I : Ideal O // Ideal.absNorm I ≤ n} : ℝ)‖ := by simp _ ≤ C * ‖(n : ℝ)‖ := hn _ = C * n := by simp private theorem outsideCoeff_norm_le_card (S : Finset (Ideal O)) (w : Ideal O → ℂ) (hw : ∀ I, ‖w I‖ ≤ 1) (n : ℕ) : ‖outsideCoeff S w n‖ ≤ ((fiber n).card : ℝ) := by classical have hweight (I : Ideal O) : ‖outsideWeight S w I‖ ≤ 1 := by by_cases hgood : ∀ P ∈ S, ¬P ∣ I · change ‖if ∀ P ∈ S, ¬P ∣ I then w I else 0‖ ≤ 1 rw [ite_eq_left hgood] exact hw I · change ‖if ∀ P ∈ S, ¬P ∣ I then w I else 0‖ ≤ 1 rw [ite_eq_right hgood] simp unfold outsideCoeff calc ‖∑ I ∈ fiber n, outsideWeight S w I‖ ≤ ∑ I ∈ fiber n, ‖outsideWeight S w I‖ := norm_sum_le _ _ _ ≤ ∑ _I ∈ fiber n, (1 : ℝ) := by apply Finset.sum_le_sum intro I hI exact hweight I _ = ((fiber n).card : ℝ) := by simp private theorem baseChangeWeight_norm_le_one {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) (I : Ideal O) : ‖ShortDraftHeckeBridge.baseChangeWeight χ I‖ ≤ 1 := by have hμ : ‖(UniqueFactorizationMonoid.moebius I : ℂ)‖ ≤ 1 := by by_cases hsq : Squarefree I · simp [hsq.moebius_eq] · simp [UniqueFactorizationMonoid.moebius_of_not_squarefree hsq] have hχ : ‖χ (Ideal.absNorm I)‖ ≤ 1 := χ.norm_le_one _ rw [ShortDraftHeckeBridge.baseChangeWeight, norm_mul] calc ‖(UniqueFactorizationMonoid.moebius I : ℂ)‖ * ‖χ (Ideal.absNorm I)‖ ≤ 1 * ‖χ (Ideal.absNorm I)‖ := mul_le_mul_of_nonneg_right hμ (norm_nonneg _) _ ≤ 1 := by simpa using hχ private theorem outsideCoeff_baseChange_isBigO_linear {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) (S : Finset (Ideal O)) : (fun n : ℕ => outsideCoeff S (ShortDraftHeckeBridge.baseChangeWeight χ) n) =O[atTop] (fun n : ℕ => (n : ℝ)) := by obtain ⟨C, hC⟩ := fiber_card_eventually_le_linear apply Asymptotics.IsBigO.of_bound C filter_upwards [hC] with n hn calc ‖outsideCoeff S (ShortDraftHeckeBridge.baseChangeWeight χ) n‖ ≤ ((fiber n).card : ℝ) := outsideCoeff_norm_le_card S (ShortDraftHeckeBridge.baseChangeWeight χ) (baseChangeWeight_norm_le_one χ) n _ ≤ C * (n : ℝ) := hn _ = C * ‖(n : ℝ)‖ := by simp theorem outsideCoeff_LSeriesSummable_baseChange {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) (S : Finset (Ideal O)) (s : ℂ) (hs : 2 < s.re) : LSeriesSummable (outsideCoeff S (ShortDraftHeckeBridge.baseChangeWeight χ)) s := by have hO : (fun n : ℕ => outsideCoeff S (ShortDraftHeckeBridge.baseChangeWeight χ) n) =O[atTop] (fun n : ℕ => (n : ℝ) ^ ((2 : ℝ) - 1)) := by simpa only [show ((2 : ℝ) - 1) = 1 by norm_num, Real.rpow_one] using outsideCoeff_baseChange_isBigO_linear χ S exact LSeriesSummable_of_isBigO_rpow hs hO private noncomputable def dirichletKernel (s : ℂ) (n : ℕ) : ℂ := if n = 0 then 0 else (n : ℂ) ^ (-s) private theorem term_eq_mul_kernel (a : ℕ → ℂ) (s : ℂ) (n : ℕ) : LSeries.term a s n = a n * dirichletKernel s n := by by_cases hn : n = 0 · subst n simp [LSeries.term, dirichletKernel] · simp [LSeries.term, dirichletKernel, hn, div_eq_mul_inv, Complex.cpow_neg] private theorem kernel_shift {N : ℕ} (hN : 0 < N) (s : ℂ) (m : ℕ) : dirichletKernel s (N * m) = (N : ℂ) ^ (-s) * dirichletKernel s m := by by_cases hm : m = 0 · subst m simp [dirichletKernel] · have hNm : N * m ≠ 0 := mul_ne_zero hN.ne' hm simp only [dirichletKernel, ite_eq_right hNm, ite_eq_right hm] simpa only [Nat.cast_mul] using Complex.natCast_mul_natCast_cpow N m (-s) private theorem tsum_mul_kernel_eq_LSeries (a : ℕ → ℂ) (s : ℂ) : (∑' n : ℕ, a n * dirichletKernel s n) = LSeries a s := by unfold LSeries apply tsum_congr intro n exact (term_eq_mul_kernel a s n).symm theorem outsideLSeries_restore_baseChange {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) (S : Finset (Ideal O)) (hS : ∀ Q ∈ S, Prime Q) (P : Ideal O) (hP : Prime P) (hPnot : P ∉ S) (s : ℂ) (hs : 2 < s.re) : LSeries (outsideCoeff S (ShortDraftHeckeBridge.baseChangeWeight χ)) s = (1 + ShortDraftHeckeBridge.baseChangeWeight χ P * (Ideal.absNorm P : ℂ) ^ (-s)) * LSeries (outsideCoeff (insert P S) (ShortDraftHeckeBridge.baseChangeWeight χ)) s := by let N : ℕ := Ideal.absNorm P let a : ℕ → ℂ := outsideCoeff S (ShortDraftHeckeBridge.baseChangeWeight χ) let b : ℕ → ℂ := outsideCoeff (insert P S) (ShortDraftHeckeBridge.baseChangeWeight χ) let c : ℂ := ShortDraftHeckeBridge.baseChangeWeight χ P have hN : 0 < N := Nat.pos_of_ne_zero (Ideal.absNorm_eq_zero_iff.not.mpr hP.1) have hcoeff (n : ℕ) : a n = b n + if N ∣ n then c * b (n / N) else 0 := restore_insert_prime S hS P hP hPnot (ShortDraftHeckeBridge.baseChangeWeight χ) (ShortDraftHeckeBridge.baseChangeWeight_zero_of_not_squarefree χ) (ShortDraftHeckeBridge.baseChangeWeight_mul_of_isRelPrime χ) n have hbsum : LSeriesSummable b s := outsideCoeff_LSeriesSummable_baseChange χ (insert P S) s hs change Summable (LSeries.term b s) at hbsum have hb : Summable (fun n : ℕ => b n * dirichletKernel s n) := by simpa only [← term_eq_mul_kernel b s] using hbsum have hshiftPoint (m : ℕ) : b m * dirichletKernel s (N * m) = (N : ℂ) ^ (-s) * LSeries.term b s m := by rw [kernel_shift hN s m, term_eq_mul_kernel] ring have hshift : Summable (fun m : ℕ => b m * dirichletKernel s (N * m)) := by simpa only [hshiftPoint] using hbsum.mul_left ((N : ℂ) ^ (-s)) have hgeneric := FiniteEulerRestoration.tsum_restore_one_prime hN c a b (dirichletKernel s) hcoeff hb hshift rw [tsum_mul_kernel_eq_LSeries a s, tsum_mul_kernel_eq_LSeries b s] at hgeneric have hshiftSum : (∑' m : ℕ, b m * dirichletKernel s (N * m)) = (N : ℂ) ^ (-s) * LSeries b s := by calc (∑' m : ℕ, b m * dirichletKernel s (N * m)) = ∑' m : ℕ, (N : ℂ) ^ (-s) * LSeries.term b s m := by apply tsum_congr exact hshiftPoint _ = (N : ℂ) ^ (-s) * LSeries b s := by rw [tsum_mul_left] rfl rw [hshiftSum] at hgeneric change LSeries a s = (1 + c * (N : ℂ) ^ (-s)) * LSeries b s calc LSeries a s = LSeries b s + c * ((N : ℂ) ^ (-s) * LSeries b s) := hgeneric _ = (1 + c * (N : ℂ) ^ (-s)) * LSeries b s := by ring theorem outsideLSeries_finiteEuler_baseChange {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) (S : Finset (Ideal O)) (hS : ∀ P ∈ S, Prime P) (s : ℂ) (hs : 2 < s.re) : LSeries (outsideCoeff ∅ (ShortDraftHeckeBridge.baseChangeWeight χ)) s = (∏ P ∈ S, (1 + ShortDraftHeckeBridge.baseChangeWeight χ P * (Ideal.absNorm P : ℂ) ^ (-s))) * LSeries (outsideCoeff S (ShortDraftHeckeBridge.baseChangeWeight χ)) s := by classical induction S using Finset.induction_on with | empty => simp | @insert P S hPnot ih => have hSP : ∀ Q ∈ S, Prime Q := by intro Q hQ exact hS Q (Finset.mem_insert_of_mem hQ) have hPP : Prime P := hS P (Finset.mem_insert_self P S) have hrest := outsideLSeries_restore_baseChange χ S hSP P hPP hPnot s hs calc LSeries (outsideCoeff ∅ (ShortDraftHeckeBridge.baseChangeWeight χ)) s = (∏ Q ∈ S, (1 + ShortDraftHeckeBridge.baseChangeWeight χ Q * (Ideal.absNorm Q : ℂ) ^ (-s))) * LSeries (outsideCoeff S (ShortDraftHeckeBridge.baseChangeWeight χ)) s := ih hSP _ = (∏ Q ∈ S, (1 + ShortDraftHeckeBridge.baseChangeWeight χ Q * (Ideal.absNorm Q : ℂ) ^ (-s))) * ((1 + ShortDraftHeckeBridge.baseChangeWeight χ P * (Ideal.absNorm P : ℂ) ^ (-s)) * LSeries (outsideCoeff (insert P S) (ShortDraftHeckeBridge.baseChangeWeight χ)) s) := by rw [hrest] _ = (∏ Q ∈ insert P S, (1 + ShortDraftHeckeBridge.baseChangeWeight χ Q * (Ideal.absNorm Q : ℂ) ^ (-s))) * LSeries (outsideCoeff (insert P S) (ShortDraftHeckeBridge.baseChangeWeight χ)) s := by rw [Finset.prod_insert hPnot] ring theorem outsideCoeff_empty_eq_normFiberCoeff (w : Ideal O → ℂ) (n : ℕ) : outsideCoeff ∅ w n = ShortDraftHeckeBridge.normFiberCoeff w n := by simp [outsideCoeff, outsideWeight, fiber, ShortDraftHeckeBridge.normFiberCoeff] theorem normFiberLSeries_finiteEuler_baseChange {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) (S : Finset (Ideal O)) (hS : ∀ P ∈ S, Prime P) (s : ℂ) (hs : 2 < s.re) : LSeries (ShortDraftHeckeBridge.normFiberCoeff (ShortDraftHeckeBridge.baseChangeWeight χ)) s = (∏ P ∈ S, (1 - χ (Ideal.absNorm P) * (Ideal.absNorm P : ℂ) ^ (-s))) * LSeries (outsideCoeff S (ShortDraftHeckeBridge.baseChangeWeight χ)) s := by have h := outsideLSeries_finiteEuler_baseChange χ S hS s hs have hfun : outsideCoeff ∅ (ShortDraftHeckeBridge.baseChangeWeight χ) = ShortDraftHeckeBridge.normFiberCoeff (ShortDraftHeckeBridge.baseChangeWeight χ) := by funext n exact outsideCoeff_empty_eq_normFiberCoeff _ n rw [hfun] at h have hprod : (∏ P ∈ S, (1 + ShortDraftHeckeBridge.baseChangeWeight χ P * (Ideal.absNorm P : ℂ) ^ (-s))) = (∏ P ∈ S, (1 - χ (Ideal.absNorm P) * (Ideal.absNorm P : ℂ) ^ (-s))) := by apply Finset.prod_congr rfl intro P hPS rw [ShortDraftHeckeBridge.baseChangeWeight_prime χ P (hS P hPS)] ring rw [hprod] at h exact h end FiniteSFactor open Filter namespace CompactScaleBridge open ConcretePrimeRowBridge ShortDraftHeckeBridge abbrev O := ConcretePrimeRowBridge.O theorem idealsUpTo_card_le (N : ℕ) : (idealsUpTo N).card ≤ 64 * (N + 1) := by classical have himage : (columnsUpTo N).card = (idealsUpTo N).card := by unfold columnsUpTo exact Finset.card_image_of_injective _ idealGenerator_injective rw [← himage] apply ShortDraftLatticeCount.actual_eisenstein_count intro x hx obtain ⟨I, hI, rfl⟩ := Finset.mem_image.mp hx have hnorm : Ideal.absNorm I ≤ N := (mem_idealsUpTo.mp hI).2 have hqNat : ShortDraftLatticeCount.qNat (idealGenerator I) ≤ N := by rw [ActualEisensteinCubic.qNat_eq_absNorm_span, span_idealGenerator] exact hnorm have hnonneg := ShortDraftLatticeCount.qO_nonneg (idealGenerator I) have hcast : ((ShortDraftLatticeCount.q (ActualEisensteinCoordinates.coords (idealGenerator I))).toNat : ℤ) = ShortDraftLatticeCount.q (ActualEisensteinCoordinates.coords (idealGenerator I)) := Int.toNat_of_nonneg hnonneg change (ShortDraftLatticeCount.q (ActualEisensteinCoordinates.coords (idealGenerator I))).toNat ≤ N at hqNat have hqInt : ((ShortDraftLatticeCount.q (ActualEisensteinCoordinates.coords (idealGenerator I))).toNat : ℤ) ≤ N := by exact_mod_cast hqNat simpa only [hcast] using hqInt noncomputable def fixedTestWeight (W : ℝ → ℂ) (m n : ℕ) : ℂ := W (2 * ((n : ℝ) / (2 * m : ℕ))) theorem fixedTestWeight_eq (W : ℝ → ℂ) {m : ℕ} (hm : 0 < m) (n : ℕ) : fixedTestWeight W m n = W ((n : ℝ) / (m : ℝ)) := by unfold fixedTestWeight congr 1 have hm0 : (m : ℝ) ≠ 0 := by exact_mod_cast Nat.ne_of_gt hm push_cast field_simp structure FixedTestPrimeMS {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal O)) (hSbad : ∀ P : Ideal O, P.IsMaximal → goodLambda ∈ P → P ∈ S) (W : ℝ → ℂ) (m : ℕ) (ε : ℝ) where H : ℕ selected : Finset O hp : ∀ p ∈ selected, p ≠ 0 hprime : ∀ p ∈ selected, (Ideal.span {p} : Ideal O).IsMaximal hinj : Set.InjOn (fun p : O => (Ideal.span {p} : Ideal O)) (selected : Set O) hnormlower : ∀ p ∈ selected, ((2 * m : ℕ) : ℝ) ^ (11 / 60 : ℝ) / 2 ≤ (Ideal.absNorm (Ideal.span {p}) : ℝ) hnormupper : ∀ p ∈ selected, (Ideal.absNorm (Ideal.span {p}) : ℝ) ≤ ((2 * m : ℕ) : ℝ) ^ (11 / 60 : ℝ) hH : Nat.floor (((2 * m : ℕ) : ℝ) ^ (11 / 10 : ℝ)) ≤ H hcount : ((2 * m : ℕ) : ℝ) ^ ((11 / 60 : ℝ) - ε) ≤ (selected.card : ℝ) hmean : (∑ u ∈ rowNormDisk H, ‖idealRowSum (outsideIdealsUpTo S (2 * m)) (outsideIdealsUpTo_ne_bot S (2 * m)) (outsideIdealsUpTo_good S (2 * m) hSbad) χ (fixedTestWeight W m) u‖ ^ 2) ≤ ((2 * m : ℕ) : ℝ) ^ ((21 / 10 : ℝ) + ε) theorem FixedTestPrimeMS.bound {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal O)) (hSbad : ∀ P : Ideal O, P.IsMaximal → goodLambda ∈ P → P ∈ S) (W : ℝ → ℂ) (m : ℕ) (ε : ℝ) (h : FixedTestPrimeMS χ S hSbad W m ε) (hm : 0 < m) (hε : 0 ≤ ε) (hW : ∀ y : ℝ, ‖W y‖ ≤ 1) : ‖∑ I ∈ outsideIdealsUpTo S (2 * m), baseChangeWeight χ I * W ((Ideal.absNorm I : ℝ) / (m : ℝ))‖ ≤ 384 * ((2 * m : ℕ) : ℝ) ^ ((23 / 24 : ℝ) + ε) := by have hWeight : ∀ n : ℕ, ‖fixedTestWeight W m n‖ ≤ 1 := by intro n exact hW _ have hD : 1 ≤ 2 * m := by omega have hbound := outsideCoeff_prime_extraction_from_MS χ (fixedTestWeight W m) S hSbad hWeight h.selected (fun p : O => p) (2 * m) h.H ε hD hε h.hp h.hprime h.hinj h.hnormlower h.hnormupper h.hH h.hcount h.hmean rw [← outsideIdealSum_eq_outsideCoeff_sum] at hbound simpa only [fixedTestWeight_eq W hm] using hbound end CompactScaleBridge end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.CompactScale namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter namespace CompactScaleBridge open ConcretePrimeRowBridge ShortDraftHeckeBridge Filter Asymptotics structure FixedTestPrimeMSConstants {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal O)) (hSbad : ∀ P : Ideal O, P.IsMaximal → goodLambda ∈ P → P ∈ S) (W : ℝ → ℂ) (m : ℕ) (ε Cmean Ccount : ℝ) where H : ℕ selected : Finset O hp : ∀ p ∈ selected, p ≠ 0 hprime : ∀ p ∈ selected, (Ideal.span {p} : Ideal O).IsMaximal hinj : Set.InjOn (fun p : O => (Ideal.span {p} : Ideal O)) (selected : Set O) hnormlower : ∀ p ∈ selected, ((2 * m : ℕ) : ℝ) ^ (11 / 60 : ℝ) / 2 ≤ (Ideal.absNorm (Ideal.span {p}) : ℝ) hnormupper : ∀ p ∈ selected, (Ideal.absNorm (Ideal.span {p}) : ℝ) ≤ ((2 * m : ℕ) : ℝ) ^ (11 / 60 : ℝ) hH : Nat.floor (((2 * m : ℕ) : ℝ) ^ (11 / 10 : ℝ)) ≤ H hcount : Ccount * ((2 * m : ℕ) : ℝ) ^ ((11 / 60 : ℝ) - ε) ≤ (selected.card : ℝ) hmean : (∑ u ∈ rowNormDisk H, ‖idealRowSum (outsideIdealsUpTo S (2 * m)) (outsideIdealsUpTo_ne_bot S (2 * m)) (outsideIdealsUpTo_good S (2 * m) hSbad) χ (fixedTestWeight W m) u‖ ^ 2) ≤ Cmean * ((2 * m : ℕ) : ℝ) ^ ((21 / 10 : ℝ) + ε) end CompactScaleBridge open Filter Asymptotics MeasureTheory open scoped Topology namespace CompactMellinBridge theorem compact_weight_mellin_convergent (W : ℝ → ℂ) (hW : ContDiff ℝ (↑(⊤ : ℕ∞)) W) (hsupp : ∀ y : ℝ, y ≤ 1 ∨ 2 ≤ y → W y = 0) (s : ℂ) : MellinConvergent W s := by have hlocal : LocallyIntegrableOn W (Set.Ioi (0 : ℝ)) := hW.continuous.continuousOn.locallyIntegrableOn measurableSet_Ioi have htopzero : W =ᶠ[atTop] (fun _ => 0) := by filter_upwards [eventually_ge_atTop (2 : ℝ)] with y hy exact hsupp y (Or.inr hy) have hbotzero : W =ᶠ[𝓝[>] (0 : ℝ)] (fun _ => 0) := by filter_upwards [Ioo_mem_nhdsGT (by norm_num : (0 : ℝ) < 1)] with y hy exact hsupp y (Or.inl hy.2.le) have htop : W =O[atTop] (fun y : ℝ => y ^ (-(s.re + 1))) := htopzero.isBigO.trans (isBigO_zero _ _) have hbot : W =O[𝓝[>] (0 : ℝ)] (fun y : ℝ => y ^ (-(s.re - 1))) := hbotzero.isBigO.trans (isBigO_zero _ _) exact mellinConvergent_of_isBigO_rpow hlocal htop (by linarith) hbot (by linarith) theorem weighted_term_integrable (a : ℕ → ℂ) (ha0 : a 0 = 0) (W : ℝ → ℂ) (s : ℂ) (hW : MellinConvergent W s) (n : ℕ) : IntegrableOn (fun t : ℝ => (t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t))) (Set.Ioi 0) := by by_cases hn : n = 0 · subst n simp [ha0] · have hnpos : (0 : ℝ) < n := by exact_mod_cast Nat.pos_of_ne_zero hn have hscale : MellinConvergent (fun t : ℝ => W ((n : ℝ) * t)) s := (MellinConvergent.comp_mul_left hnpos).mpr hW have hscaled := hscale.const_smul (a n) simpa only [MellinConvergent, smul_eq_mul, mul_assoc] using hscaled theorem weighted_sum_continuousOn_pos (a : ℕ → ℂ) (W F : ℝ → ℂ) (hW : ContDiff ℝ (↑(⊤ : ℕ∞)) W) (hsupp : ∀ y : ℝ, 2 ≤ y → W y = 0) (hF : ∀ t : ℝ, 0 < t → HasSum (fun n : ℕ => a n * W ((n : ℝ) * t)) (F t)) : ContinuousOn F (Set.Ioi (0 : ℝ)) := by intro t0 ht0 have ht0pos : 0 < t0 := ht0 obtain ⟨N, hN⟩ := exists_nat_gt (4 / t0) have hNmul := mul_lt_mul_of_pos_right hN (by positivity : 0 < t0 / 2) have hNtwo : 2 < (N : ℝ) * (t0 / 2) := by have hdiv : (4 / t0) * (t0 / 2) = 2 := by field_simp ring rw [hdiv] at hNmul exact hNmul have hsumEq (u : ℝ) (hu : t0 / 2 ≤ u) : F u = ∑ n ∈ Finset.range N, a n * W ((n : ℝ) * u) := by have hupos : 0 < u := lt_of_lt_of_le (by positivity : 0 < t0 / 2) hu have htail (n : ℕ) (hn : n ∉ Finset.range N) : a n * W ((n : ℝ) * u) = 0 := by have hnNat : N ≤ n := Nat.le_of_not_gt (by simpa using hn) have hnReal : (N : ℝ) ≤ n := by exact_mod_cast hnNat have hnu : 2 ≤ (n : ℝ) * u := by calc 2 ≤ (N : ℝ) * (t0 / 2) := hNtwo.le _ ≤ (N : ℝ) * u := mul_le_mul_of_nonneg_left hu (Nat.cast_nonneg (α := ℝ) N) _ ≤ (n : ℝ) * u := mul_le_mul_of_nonneg_right hnReal hupos.le simp [hsupp _ hnu] calc F u = ∑' n : ℕ, a n * W ((n : ℝ) * u) := (hF u hupos).tsum_eq.symm _ = ∑ n ∈ Finset.range N, a n * W ((n : ℝ) * u) := tsum_eq_sum htail have hcontW : Continuous W := hW.continuous have hcontSum : Continuous (fun u : ℝ => ∑ n ∈ Finset.range N, a n * W ((n : ℝ) * u)) := by fun_prop have hevent : F =ᶠ[𝓝 t0] (fun u : ℝ => ∑ n ∈ Finset.range N, a n * W ((n : ℝ) * u)) := by filter_upwards [Ioi_mem_nhds (by linarith : t0 / 2 < t0)] with u hu exact hsumEq u hu.le exact (hcontSum.continuousAt.congr_of_eventuallyEq hevent).continuousWithinAt theorem weighted_sum_inv_locallyIntegrableOn_pos (a : ℕ → ℂ) (W F : ℝ → ℂ) (hW : ContDiff ℝ (↑(⊤ : ℕ∞)) W) (hsupp : ∀ y : ℝ, 2 ≤ y → W y = 0) (hF : ∀ t : ℝ, 0 < t → HasSum (fun n : ℕ => a n * W ((n : ℝ) * t)) (F t)) : LocallyIntegrableOn (fun D : ℝ => F D⁻¹) (Set.Ioi 0) := by have hcont : ContinuousOn (fun D : ℝ => F D⁻¹) (Set.Ioi 0) := by apply (weighted_sum_continuousOn_pos a W F hW hsupp hF).comp (continuousOn_inv₀.mono (by intro D hD exact ne_of_gt hD)) intro D hD exact inv_pos.mpr (show 0 < D from hD) exact hcont.locallyIntegrableOn measurableSet_Ioi private theorem weighted_norm_scale (a : ℂ) (W : ℝ → ℂ) (s : ℂ) (N t : ℝ) (hN : 0 < N) (ht : 0 < t) : ‖(t : ℂ) ^ (s - 1) * (a * W (N * t))‖ = (‖a‖ / N ^ (s.re - 1)) * ‖(N * t : ℂ) ^ (s - 1) * W (N * t)‖ := by have hNt : 0 < N * t := mul_pos hN ht have hNpow : 0 < N ^ (s.re - 1) := Real.rpow_pos_of_pos hN _ rw [norm_mul, norm_mul, norm_mul] rw [← Complex.ofReal_mul] rw [Complex.norm_cpow_eq_rpow_re_of_pos ht, Complex.norm_cpow_eq_rpow_re_of_pos hNt] simp only [Complex.sub_re, Complex.one_re] rw [Real.mul_rpow hN.le ht.le] field_simp private theorem weighted_norm_integral (a : ℕ → ℂ) (ha0 : a 0 = 0) (W : ℝ → ℂ) (s : ℂ) (n : ℕ) : (∫ t : ℝ in Set.Ioi 0, ‖(t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t))‖) = ‖LSeries.term a s n‖ * (∫ u : ℝ in Set.Ioi 0, ‖(u : ℂ) ^ (s - 1) * W u‖) := by by_cases hn : n = 0 · subst n simp [ha0, LSeries.term_zero] · have hN : (0 : ℝ) < n := by exact_mod_cast Nat.pos_of_ne_zero hn let G : ℝ → ℝ := fun u => ‖(u : ℂ) ^ (s - 1) * W u‖ have hscale : (∫ t : ℝ in Set.Ioi 0, ‖(t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t))‖) = (‖a n‖ / (n : ℝ) ^ (s.re - 1)) * (∫ t : ℝ in Set.Ioi 0, G ((n : ℝ) * t)) := by rw [← integral_const_mul] apply setIntegral_congr_fun measurableSet_Ioi intro t ht simpa only [G, Complex.ofReal_mul] using weighted_norm_scale (a n) W s n t hN ht rw [hscale, integral_comp_mul_left_Ioi G 0 hN] simp only [mul_zero, smul_eq_mul] have hpow : (n : ℝ) ^ (s.re - 1) * (n : ℝ) = (n : ℝ) ^ s.re := by calc (n : ℝ) ^ (s.re - 1) * (n : ℝ) = (n : ℝ) ^ (s.re - 1) * (n : ℝ) ^ (1 : ℝ) := by rw [Real.rpow_one] _ = (n : ℝ) ^ ((s.re - 1) + 1) := (Real.rpow_add hN (s.re - 1) 1).symm _ = (n : ℝ) ^ s.re := by congr 1; ring rw [LSeries.norm_term_eq] simp only [ite_eq_right hn, G] have hinv : ((n : ℝ) ^ (s.re - 1))⁻¹ * (n : ℝ)⁻¹ = ((n : ℝ) ^ s.re)⁻¹ := by rw [← mul_inv_rev, mul_comm, hpow] simp only [div_eq_mul_inv] calc ‖a n‖ * ((n : ℝ) ^ (s.re - 1))⁻¹ * ((n : ℝ)⁻¹ * (∫ u : ℝ in Set.Ioi 0, ‖(u : ℂ) ^ (s - 1) * W u‖)) = (‖a n‖ * (((n : ℝ) ^ (s.re - 1))⁻¹ * (n : ℝ)⁻¹)) * (∫ u : ℝ in Set.Ioi 0, ‖(u : ℂ) ^ (s - 1) * W u‖) := by ring _ = (‖a n‖ * ((n : ℝ) ^ s.re)⁻¹) * (∫ u : ℝ in Set.Ioi 0, ‖(u : ℂ) ^ (s - 1) * W u‖) := by rw [hinv] theorem weighted_terms_fubini (a : ℕ → ℂ) (ha0 : a 0 = 0) (W : ℝ → ℂ) (s : ℂ) (hlsum : LSeriesSummable a s) : Summable (fun n : ℕ => ∫ t : ℝ in Set.Ioi 0, ‖(t : ℂ) ^ (s - 1) * (a n * W ((n : ℝ) * t))‖) := by let C : ℝ := ∫ u : ℝ in Set.Ioi 0, ‖(u : ℂ) ^ (s - 1) * W u‖ have hnorm : Summable (fun n : ℕ => ‖LSeries.term a s n‖) := hlsum.norm have hsum : Summable (fun n : ℕ => ‖LSeries.term a s n‖ * C) := hnorm.mul_right C exact hsum.congr (fun n => (weighted_norm_integral a ha0 W s n).symm) noncomputable def finiteEulerFactor {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ShortDraftHeckeBridge.O)) (s : ℂ) : ℂ := ∏ P ∈ S, (1 - χ (Ideal.absNorm P) * ((Ideal.absNorm P : ℂ) ^ (-s))) theorem finiteEulerFactor_analytic {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ShortDraftHeckeBridge.O)) (hprime : ∀ P ∈ S, Prime P) (σ : ℝ) : AnalyticOnNhd ℂ (finiteEulerFactor χ S) {s : ℂ | σ < s.re} := by have hE : Differentiable ℂ (finiteEulerFactor χ S) := by unfold finiteEulerFactor apply Differentiable.fun_finsetProd intro P hPS have hN : Ideal.absNorm P ≠ 0 := Ideal.absNorm_eq_zero_iff.not.mpr (hprime P hPS).1 have hNc : (Ideal.absNorm P : ℂ) ≠ 0 := by exact_mod_cast hN have hcpow : Differentiable ℂ (fun s : ℂ => ((Ideal.absNorm P : ℂ) ^ (-s))) := (differentiable_id.neg).const_cpow (Or.inl hNc) exact (differentiable_const (1 : ℂ)).sub ((differentiable_const (χ (Ideal.absNorm P))).mul hcpow) exact (Complex.analyticOnNhd_iff_differentiableOn (Complex.isOpen_re_gt σ)).2 hE.differentiableOn theorem zero_free_of_analytic_identity_gt_two (σ : ℝ) (hσ : σ < 2) (G M W : ℂ → ℂ) (hG : AnalyticOnNhd ℂ G {s | σ < s.re}) (hM : AnalyticOnNhd ℂ M {s | σ < s.re}) (hW : AnalyticOnNhd ℂ W {s | σ < s.re}) (heq : ∀ s : ℂ, 2 < s.re → G s * M s = W s) (ρ : ℂ) (hρ : σ < ρ.re) (hWρ : W ρ ≠ 0) : G ρ ≠ 0 := by have hthree : (3 : ℂ) ∈ {s : ℂ | σ < s.re} := by change σ < (3 : ℂ).re norm_num at * linarith have heventual : (fun s : ℂ => G s * M s) =ᶠ[𝓝 (3 : ℂ)] W := by filter_upwards [((Complex.isOpen_re_gt 2).mem_nhds (by norm_num : (3 : ℂ) ∈ {s : ℂ | 2 < s.re}))] with s hs exact heq s hs have hident : Set.EqOn (fun s : ℂ => G s * M s) W {s | σ < s.re} := (hG.mul hM).eqOn_of_preconnected_of_eventuallyEq hW ((convex_halfSpace_re_gt σ).isPreconnected) hthree heventual intro hGρ have heqρ := hident hρ change G ρ * M ρ = W ρ at heqρ rw [hGρ, zero_mul] at heqρ exact hWρ heqρ.symm theorem zero_free_of_regularized_identity_gt_two (σ : ℝ) (hσ : σ < 2) (G Lregular M W : ℂ → ℂ) (hLregular : AnalyticOnNhd ℂ Lregular {s | σ < s.re}) (hM : AnalyticOnNhd ℂ M {s | σ < s.re}) (hW : AnalyticOnNhd ℂ W {s | σ < s.re}) (hregular : ∀ s : ℂ, σ < s.re → s ≠ 1 → Lregular s = (s - 1) * G s) (heq : ∀ s : ℂ, 2 < s.re → Lregular s * M s = (s - 1) * W s) (ρ : ℂ) (hρ : σ < ρ.re) (hρone : ρ ≠ 1) (hWρ : W ρ ≠ 0) : G ρ ≠ 0 := by have hWregular : AnalyticOnNhd ℂ (fun s : ℂ => (s - 1) * W s) {s | σ < s.re} := (analyticOnNhd_id.sub analyticOnNhd_const).mul hW have hWregularρ : (ρ - 1) * W ρ ≠ 0 := mul_ne_zero (sub_ne_zero.mpr hρone) hWρ have hLregularρ := zero_free_of_analytic_identity_gt_two σ hσ Lregular M (fun s : ℂ => (s - 1) * W s) hLregular hM hWregular heq ρ hρ hWregularρ rw [hregular ρ hρ hρone] at hLregularρ exact (mul_ne_zero_iff.mp hLregularρ).2 noncomputable def outsideCompactSum {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal FiniteSFactor.O)) (W : ℝ → ℂ) (t : ℝ) : ℂ := ∑' n : ℕ, FiniteSFactor.outsideCoeff S (ShortDraftHeckeBridge.baseChangeWeight χ) n * W ((n : ℝ) * t) theorem pair_zero_free_of_identity_gt_two {q r : ℕ} [NeZero q] [NeZero r] (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (hnotboth : χ ≠ 1 ∨ ψ ≠ 1) (σ : ℝ) (hσ : σ < 1) (M W : ℂ → ℂ) (hM : AnalyticOnNhd ℂ M {s : ℂ | σ < s.re}) (hW : AnalyticOnNhd ℂ W {s : ℂ | σ < s.re}) (heq : ∀ s : ℂ, 2 < s.re → (χ.LFunction s * ψ.LFunction s) * M s = W s) (ρ : ℂ) (hρ : σ < ρ.re) (hρone : ρ ≠ 1) (hWρ : W ρ ≠ 0) : χ.LFunction ρ ≠ 0 ∧ ψ.LFunction ρ ≠ 0 := by let U : Set ℂ := {s : ℂ | σ < s.re} have hopen : IsOpen U := Complex.isOpen_re_gt σ have hσtwo : σ < 2 := by linarith by_cases hχ : χ = 1 · have hψ : ψ ≠ 1 := by intro hψ rcases hnotboth with h | h · exact h hχ · exact h hψ subst χ have hLregular₁ : AnalyticOnNhd ℂ (DirichletCharacter.LFunctionTrivChar₁ q) U := (Complex.analyticOnNhd_iff_differentiableOn hopen).2 (DirichletCharacter.differentiable_LFunctionTrivChar₁ q).differentiableOn have hLψ : AnalyticOnNhd ℂ ψ.LFunction U := (Complex.analyticOnNhd_iff_differentiableOn hopen).2 (ψ.differentiable_LFunction hψ).differentiableOn have hLregular : AnalyticOnNhd ℂ (fun s => DirichletCharacter.LFunctionTrivChar₁ q s * ψ.LFunction s) U := hLregular₁.mul hLψ have hregular : ∀ s : ℂ, σ < s.re → s ≠ 1 → DirichletCharacter.LFunctionTrivChar₁ q s * ψ.LFunction s = (s - 1) * ((1 : DirichletCharacter ℂ q).LFunction s * ψ.LFunction s) := by intro s _ hs simp [DirichletCharacter.LFunctionTrivChar₁, DirichletCharacter.LFunctionTrivChar, Function.update_of_ne hs] ring have heqregular : ∀ s : ℂ, 2 < s.re → (DirichletCharacter.LFunctionTrivChar₁ q s * ψ.LFunction s) * M s = (s - 1) * W s := by intro s hs rw [hregular s (lt_trans hσ (by linarith : 1 < s.re)) (by intro h; subst s; norm_num at hs)] calc (s - 1) * ((1 : DirichletCharacter ℂ q).LFunction s * ψ.LFunction s) * M s = (s - 1) * (((1 : DirichletCharacter ℂ q).LFunction s * ψ.LFunction s) * M s) := by ring _ = (s - 1) * W s := by rw [heq s hs] have hprod := zero_free_of_regularized_identity_gt_two σ hσtwo (fun s => (1 : DirichletCharacter ℂ q).LFunction s * ψ.LFunction s) (fun s => DirichletCharacter.LFunctionTrivChar₁ q s * ψ.LFunction s) M W hLregular hM hW hregular heqregular ρ hρ hρone hWρ exact mul_ne_zero_iff.mp hprod · by_cases hψ : ψ = 1 · subst ψ have hLregular₁ : AnalyticOnNhd ℂ (DirichletCharacter.LFunctionTrivChar₁ r) U := (Complex.analyticOnNhd_iff_differentiableOn hopen).2 (DirichletCharacter.differentiable_LFunctionTrivChar₁ r).differentiableOn have hLχ : AnalyticOnNhd ℂ χ.LFunction U := (Complex.analyticOnNhd_iff_differentiableOn hopen).2 (χ.differentiable_LFunction hχ).differentiableOn have hLregular : AnalyticOnNhd ℂ (fun s => χ.LFunction s * DirichletCharacter.LFunctionTrivChar₁ r s) U := hLχ.mul hLregular₁ have hregular : ∀ s : ℂ, σ < s.re → s ≠ 1 → χ.LFunction s * DirichletCharacter.LFunctionTrivChar₁ r s = (s - 1) * (χ.LFunction s * (1 : DirichletCharacter ℂ r).LFunction s) := by intro s _ hs simp [DirichletCharacter.LFunctionTrivChar₁, DirichletCharacter.LFunctionTrivChar, Function.update_of_ne hs] ring have heqregular : ∀ s : ℂ, 2 < s.re → (χ.LFunction s * DirichletCharacter.LFunctionTrivChar₁ r s) * M s = (s - 1) * W s := by intro s hs rw [hregular s (lt_trans hσ (by linarith : 1 < s.re)) (by intro h; subst s; norm_num at hs)] calc (s - 1) * (χ.LFunction s * (1 : DirichletCharacter ℂ r).LFunction s) * M s = (s - 1) * ((χ.LFunction s * (1 : DirichletCharacter ℂ r).LFunction s) * M s) := by ring _ = (s - 1) * W s := by rw [heq s hs] have hprod := zero_free_of_regularized_identity_gt_two σ hσtwo (fun s => χ.LFunction s * (1 : DirichletCharacter ℂ r).LFunction s) (fun s => χ.LFunction s * DirichletCharacter.LFunctionTrivChar₁ r s) M W hLregular hM hW hregular heqregular ρ hρ hρone hWρ exact mul_ne_zero_iff.mp hprod · have hLχ : AnalyticOnNhd ℂ χ.LFunction U := (Complex.analyticOnNhd_iff_differentiableOn hopen).2 (χ.differentiable_LFunction hχ).differentiableOn have hLψ : AnalyticOnNhd ℂ ψ.LFunction U := (Complex.analyticOnNhd_iff_differentiableOn hopen).2 (ψ.differentiable_LFunction hψ).differentiableOn have hprod := zero_free_of_analytic_identity_gt_two σ hσtwo (fun s => χ.LFunction s * ψ.LFunction s) M W (hLχ.mul hLψ) hM hW heq ρ hρ hWρ exact mul_ne_zero_iff.mp hprod structure BaseChangeOutsideCompactTest {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) (ρ : ℂ) where S : Finset (Ideal FiniteSFactor.O) S_prime : ∀ P ∈ S, Prime P W : ℝ → ℂ sigma : ℝ sigma_lt : sigma < ρ.re smooth : ContDiff ℝ (↑(⊤ : ℕ∞)) W support : ∀ y : ℝ, y ≤ 1 ∨ 2 ≤ y → W y = 0 power_bound : (fun D : ℝ => outsideCompactSum χ S W D⁻¹) =O[atTop] (fun D : ℝ => D ^ sigma) mellin_nonzero : mellin W ρ ≠ 0 end CompactMellinBridge end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.CompactWeights namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology namespace CompactScaleBridge section open ConcretePrimeRowBridge ShortDraftHeckeBridge FiniteSFactor end open ConcretePrimeRowBridge ShortDraftHeckeBridge Filter Asymptotics end CompactScaleBridge open Filter Asymptotics MeasureTheory open scoped Topology namespace ConcreteCompactWeight noncomputable def bumpData : ContDiffBump (3 / 2 : ℝ) := ⟨1 / 8, 1 / 4, by norm_num, by norm_num⟩ noncomputable def bump (y : ℝ) : ℝ := bumpData y theorem bump_smooth : ContDiff ℝ (↑(⊤ : ℕ∞)) bump := by change ContDiff ℝ (↑(⊤ : ℕ∞)) (bumpData : ℝ → ℝ) exact bumpData.contDiff (n := ⊤) theorem bump_nonneg (y : ℝ) : 0 ≤ bump y := bumpData.nonneg theorem bump_one : bump (3 / 2 : ℝ) = 1 := by change bumpData (3 / 2 : ℝ) = 1 exact bumpData.one_of_mem_closedBall (by simp only [Metric.mem_closedBall, dist_self] exact bumpData.rIn_pos.le) theorem bump_support (y : ℝ) (hy : y ≤ 1 ∨ 2 ≤ y) : bump y = 0 := by change bumpData y = 0 apply bumpData.zero_of_le_dist rw [Real.dist_eq] change (1 / 4 : ℝ) ≤ |y - 3 / 2| rcases hy with h | h · rw [abs_of_nonpos (by linarith)] linarith · rw [abs_of_nonneg (by linarith)] linarith theorem bump_compact : HasCompactSupport bump := bumpData.hasCompactSupport noncomputable def positiveExtension (y : ℝ) : ℝ := 1 + (y - 1) * Real.smoothTransition (2 * y - 1) theorem positiveExtension_smooth : ContDiff ℝ (↑(⊤ : ℕ∞)) positiveExtension := by unfold positiveExtension have ht : ContDiff ℝ (↑(⊤ : ℕ∞)) (fun y : ℝ => 2 * y - 1) := by fun_prop exact contDiff_const.add ((contDiff_id.sub contDiff_const).mul ((Real.smoothTransition.contDiff (n := ⊤)).comp ht)) theorem positiveExtension_pos (y : ℝ) : 0 < positiveExtension y := by unfold positiveExtension by_cases hhalf : y ≤ 1 / 2 · have ht : 2 * y - 1 ≤ 0 := by linarith rw [Real.smoothTransition.zero_of_nonpos ht] norm_num · by_cases hone : 1 ≤ y · have ht : 1 ≤ 2 * y - 1 := by linarith rw [Real.smoothTransition.one_of_one_le ht] linarith · have hle := Real.smoothTransition.le_one (2 * y - 1) have hnonneg := Real.smoothTransition.nonneg (2 * y - 1) have hprod : (1 - y) * Real.smoothTransition (2 * y - 1) ≤ 1 - y := by exact (mul_le_mul_of_nonneg_left hle (by linarith)).trans_eq (mul_one _) nlinarith theorem positiveExtension_eq (y : ℝ) (hy : 1 ≤ y) : positiveExtension y = y := by unfold positiveExtension rw [Real.smoothTransition.one_of_one_le (by linarith : 1 ≤ 2 * y - 1)] ring noncomputable def weight (ρ : ℂ) (y : ℝ) : ℂ := (bump y : ℂ) * Complex.exp ((Real.log (positiveExtension y) : ℂ) * (-ρ)) theorem weight_smooth (ρ : ℂ) : ContDiff ℝ (↑(⊤ : ℕ∞)) (weight ρ) := by have hb : ContDiff ℝ (↑(⊤ : ℕ∞)) (fun y : ℝ => (bump y : ℂ)) := by exact Complex.ofRealCLM.contDiff.comp bump_smooth have hlog : ContDiff ℝ (↑(⊤ : ℕ∞)) (fun y : ℝ => Real.log (positiveExtension y)) := positiveExtension_smooth.log (fun y => ne_of_gt (positiveExtension_pos y)) have hc : ContDiff ℝ (↑(⊤ : ℕ∞)) (fun y : ℝ => (Real.log (positiveExtension y) : ℂ)) := by exact Complex.ofRealCLM.contDiff.comp hlog have hexp : ContDiff ℝ (↑(⊤ : ℕ∞)) (fun y : ℝ => Complex.exp ((Real.log (positiveExtension y) : ℂ) * (-ρ))) := (hc.mul contDiff_const).cexp exact hb.mul hexp theorem weight_support (ρ : ℂ) (y : ℝ) (hy : y ≤ 1 ∨ 2 ≤ y) : weight ρ y = 0 := by simp [weight, bump_support y hy] theorem weight_eq_cpow (ρ : ℂ) (y : ℝ) (hy : 0 < y) : weight ρ y = (y : ℂ) ^ (-ρ) * (bump y : ℂ) := by by_cases hy1 : y ≤ 1 · simp [weight, bump_support y (Or.inl hy1)] · have hgy : positiveExtension y = y := positiveExtension_eq y (le_of_lt (lt_of_not_ge hy1)) rw [weight, hgy, Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr (ne_of_gt hy))] rw [← Complex.ofReal_log hy.le] ring theorem weight_mellin_eq_bump (ρ : ℂ) : mellin (weight ρ) ρ = mellin (fun y : ℝ => (bump y : ℂ)) 0 := by have hpoint : Set.EqOn (weight ρ) (fun y : ℝ => (y : ℂ) ^ (-ρ) * (bump y : ℂ)) (Set.Ioi 0) := by intro y hy exact weight_eq_cpow ρ y hy rw [mellin] have heq : (∫ y : ℝ in Set.Ioi 0, (y : ℂ) ^ (ρ - 1) * weight ρ y) = mellin (fun y : ℝ => (y : ℂ) ^ (-ρ) * (bump y : ℂ)) ρ := by rw [mellin] exact setIntegral_congr_fun measurableSet_Ioi (fun y hy => by simp only [smul_eq_mul] rw [hpoint hy]) simp only [smul_eq_mul] rw [heq] simpa only [smul_eq_mul, add_neg_cancel] using (mellin_cpow_smul (fun y : ℝ => (bump y : ℂ)) ρ (-ρ)) noncomputable def weightedBump (y : ℝ) : ℝ := bump y / positiveExtension y theorem weightedBump_continuous : Continuous weightedBump := by exact bump_smooth.continuous.div positiveExtension_smooth.continuous (fun y => ne_of_gt (positiveExtension_pos y)) theorem weightedBump_compact : HasCompactSupport weightedBump := by change HasCompactSupport (fun y : ℝ => bump y * (positiveExtension y)⁻¹) exact bump_compact.mul_right theorem weightedBump_nonneg (y : ℝ) : 0 ≤ weightedBump y := by exact div_nonneg (bump_nonneg y) (positiveExtension_pos y).le theorem weightedBump_nonzero : weightedBump (3 / 2 : ℝ) ≠ 0 := by simp [weightedBump, bump_one, positiveExtension_eq (3 / 2) (by norm_num)] theorem weightedBump_integral_pos : 0 < ∫ y : ℝ, weightedBump y := by exact Continuous.integral_pos_of_hasCompactSupport_nonneg_nonzero weightedBump_continuous weightedBump_compact weightedBump_nonneg weightedBump_nonzero theorem weightedBump_eq_zero_of_nonpos (y : ℝ) (hy : y ≤ 0) : weightedBump y = 0 := by simp [weightedBump, bump_support y (Or.inl (by linarith))] theorem mellin_bump_zero_eq_integral_weightedBump : mellin (fun y : ℝ => (bump y : ℂ)) 0 = (∫ y : ℝ, weightedBump y : ℝ) := by rw [mellin] have hpoint : ∀ y : ℝ, 0 < y → (y : ℂ) ^ ((0 : ℂ) - 1) • (bump y : ℂ) = (weightedBump y : ℂ) := by intro y hy by_cases hy1 : y ≤ 1 · simp [weightedBump, bump_support y (Or.inl hy1)] · have hgy : positiveExtension y = y := positiveExtension_eq y (le_of_lt (lt_of_not_ge hy1)) simp [weightedBump, hgy, Complex.cpow_neg_one, smul_eq_mul, div_eq_mul_inv, mul_comm] rw [setIntegral_congr_fun measurableSet_Ioi (fun y hy => hpoint y hy)] rw [integral_complex_ofReal] congr 1 exact setIntegral_eq_integral_of_forall_compl_eq_zero (fun y hy => by exact weightedBump_eq_zero_of_nonpos y (le_of_not_gt hy)) theorem weight_mellin_ne_zero (ρ : ℂ) : mellin (weight ρ) ρ ≠ 0 := by rw [weight_mellin_eq_bump, mellin_bump_zero_eq_integral_weightedBump] exact Complex.ofReal_ne_zero.mpr weightedBump_integral_pos.ne' end ConcreteCompactWeight namespace CompactScaleBridge section open ConcreteCompactWeight end end CompactScaleBridge namespace ActualEisensteinCubic open ShortDraftCusp end ActualEisensteinCubic namespace TwoPassProfiles end TwoPassProfiles end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.SecondPoissonScale namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap namespace ActualEisensteinCubic section open scoped ComplexConjugate theorem canonicalSextic_conj_as_row_label (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (e : O) : star (canonicalSextic P hgood (Ideal.Quotient.mk P e)) = canonicalSextic P hgood (Ideal.Quotient.mk P e) * (canonicalSextic P hgood (Ideal.Quotient.mk P e)) ^ 4 := by let χ := canonicalSextic P hgood let x : O ⧸ P := Ideal.Quotient.mk P e have hconj : star (χ x) = (χ x)⁻¹ := by by_cases hx : IsUnit x · let u : (O ⧸ P)ˣ := hx.unit have hu : (u : O ⧸ P) = x := hx.unit_spec rw [← hu] exact (canonicalSextic_inverse_eq_conj_on_units P hgood u).symm · have hzero : χ x = 0 := MulChar.map_nonunit χ hx simp [hzero] rw [hconj] by_cases hx : IsUnit x · have h6 : (χ x) ^ 6 = 1 := by rw [← MulChar.pow_apply' χ (by decide : 6 ≠ 0), canonicalSextic_pow_six P hgood] exact MulChar.one_apply hx apply inv_eq_of_mul_eq_one_right calc χ x * (χ x * (χ x) ^ 4) = (χ x) ^ 6 := by ring _ = 1 := h6 · have hzero : χ x = 0 := MulChar.map_nonunit χ hx change (χ x)⁻¹ = χ x * (χ x) ^ 4 simp [hzero] theorem finiteSquarefreeRow_mul {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (S : Finset ι) (a b : O) : finiteSquarefreeRow P hgood S (a * b) = finiteSquarefreeRow P hgood S a * finiteSquarefreeRow P hgood S b := by classical simp only [finiteSquarefreeRow, map_mul, Finset.prod_mul_distrib] theorem finiteSquarefreeRow_conj_as_row_label {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (S : Finset ι) (e : O) : star (finiteSquarefreeRow P hgood S e) = finiteSquarefreeRow P hgood S e * (finiteSquarefreeRow P hgood S e) ^ 4 := by classical simp only [finiteSquarefreeRow, star_prod] rw [← Finset.prod_pow, ← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i hi exact canonicalSextic_conj_as_row_label (P i) (hgood i) e theorem finiteSquarefreeRow_second_child {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (S : Finset ι) (d e k J C v : O) : star (finiteSquarefreeRow P hgood S e) * finiteSquarefreeRow P hgood S d * finiteSquarefreeRow P hgood S k * (finiteSquarefreeRow P hgood S (J * C)) ^ 4 * (finiteSquarefreeRow P hgood S v) ^ 4 = finiteSquarefreeRow P hgood S (d * e * k) * (finiteSquarefreeRow P hgood S (J * C * e * v)) ^ 4 := by rw [finiteSquarefreeRow_conj_as_row_label P hgood S e] simp only [finiteSquarefreeRow_mul] ring end noncomputable def rowCoprimeMask {ι : Type*} (P : ι → Ideal O) (S : Finset ι) (u : O) : ℂ := by classical exact if ∃ i ∈ S, u ∈ P i then 0 else 1 theorem finiteSquarefreeRow_self_pair {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : letI importedCyclotomicWitness := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK ∀ i, (IsCyclotomicExtension.zeta_spec 3 ℚ K).toInteger - 1 ∉ P i) (S : Finset ι) (u : O) : letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK star (finiteSquarefreeRow P hgood S u) * finiteSquarefreeRow P hgood S u = rowCoprimeMask P S u := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK classical unfold finiteSquarefreeRow rowCoprimeMask rw [star_prod, ← Finset.prod_mul_distrib] by_cases h : ∃ i ∈ S, u ∈ P i · rw [ite_eq_left h] obtain ⟨i, hi, hui⟩ := h apply Finset.prod_eq_zero hi rw [Ideal.Quotient.eq_zero_iff_mem.mpr hui, MulChar.map_zero] simp · rw [ite_eq_right h] apply Finset.prod_eq_one intro i hi rw [MulChar.star_apply', ← MulChar.mul_apply, inv_mul_cancel] apply MulChar.one_apply let : Field (O ⧸ P i) := Ideal.Quotient.field (P i) exact isUnit_iff_ne_zero.mpr fun hui => h ⟨i, hi, Ideal.Quotient.eq_zero_iff_mem.mp hui⟩ theorem finiteSquarefreeRow_pair_kernel {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : letI importedCyclotomicWitness := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK ∀ i, (IsCyclotomicExtension.zeta_spec 3 ℚ K).toInteger - 1 ∉ P i) (S T : Finset ι) (u : O) : letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK star (finiteSquarefreeRow P hgood S u) * finiteSquarefreeRow P hgood T u = rowCoprimeMask P (S ∩ T) u * star (finiteSquarefreeRow P hgood (S \ T) u) * finiteSquarefreeRow P hgood (T \ S) u := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK have hsplit (A B : Finset ι) : finiteSquarefreeRow P hgood A u = finiteSquarefreeRow P hgood (A ∩ B) u * finiteSquarefreeRow P hgood (A \ B) u := by exact (Finset.prod_inter_mul_prod_sdiff A B _).symm rw [hsplit S T, hsplit T S, Finset.inter_comm T S, star_mul] calc _ = (star (finiteSquarefreeRow P hgood (S ∩ T) u) * finiteSquarefreeRow P hgood (S ∩ T) u) * star (finiteSquarefreeRow P hgood (S \ T) u) * finiteSquarefreeRow P hgood (T \ S) u := by ring _ = _ := by rw [finiteSquarefreeRow_self_pair] private theorem mask_powerset {ι : Type*} [DecidableEq ι] (S : Finset ι) (p : ι → Prop) [DecidablePred p] : (if ∃ i ∈ S, p i then (0 : ℂ) else 1) = ∑ E ∈ S.powerset, (-1 : ℂ) ^ E.card * if ∀ i ∈ E, p i then 1 else 0 := by have hprod : (if ∃ i ∈ S, p i then (0 : ℂ) else 1) = ∏ i ∈ S, (1 - if p i then (1 : ℂ) else 0) := by by_cases h : ∃ i ∈ S, p i · rw [ite_eq_left h] obtain ⟨i, hi, hp⟩ := h symm apply Finset.prod_eq_zero hi simp [hp] · rw [ite_eq_right h] symm apply Finset.prod_eq_one intro i hi simp [show ¬p i from fun hp => h ⟨i, hi, hp⟩] rw [hprod, Finset.prod_sub] apply Finset.sum_congr rfl intro E hE simp only [Finset.prod_const_one, mul_one] congr 1 by_cases h : ∀ i ∈ E, p i · rw [ite_eq_left h] apply Finset.prod_eq_one intro i hi simp [h i hi] · rw [ite_eq_right h] push Not at h obtain ⟨i, hi, hp⟩ := h apply Finset.prod_eq_zero hi simp [hp] theorem rowCoprimeMask_subsets {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) (S : Finset ι) (u : O) : rowCoprimeMask P S u = ∑ E ∈ S.powerset, (-1 : ℂ) ^ E.card * if ∀ i ∈ E, u ∈ P i then 1 else 0 := by classical exact mask_powerset S (fun i => u ∈ P i) theorem prime_product_moebius {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hprime : ∀ i, Prime (P i)) (hinj : Function.Injective P) (S : Finset ι) : (UniqueFactorizationMonoid.moebius (∏ i ∈ S, P i) : ℂ) = (-1 : ℂ) ^ S.card := by induction S using Finset.induction_on with | empty => simp only [Finset.prod_empty, UniqueFactorizationMonoid.moebius_one, Int.cast_one, Finset.card_empty, pow_zero] | @insert i S hi ih => have hcop : IsCoprime (P i) (∏ j ∈ S, P j) := by apply IsCoprime.prod_right intro j hj apply Ideal.isCoprime_of_isMaximal exact hinj.ne (by intro h; subst j; exact hi hj) rw [Finset.prod_insert hi, hcop.isRelPrime.moebius_mul, (hprime i).irreducible.moebius_eq, Int.cast_mul, Int.cast_neg, Int.cast_one, ih, Finset.card_insert_of_notMem hi, pow_succ] ring theorem mem_prime_product_iff {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (u : O) : u ∈ (∏ i ∈ S, P i) ↔ ∀ i ∈ S, u ∈ P i := by rw [Ideal.prod_eq_iInf_of_pairwise_isCoprime] · simp · intro i hi j hj hij exact Ideal.isCoprime_of_isMaximal (hinj.ne hij) end ActualEisensteinCubic namespace ConcretePrimeRowBridge section open ActualEisensteinCubic ShortDraftHeckeBridge open scoped BigOperators Classical end open ActualEisensteinCubic end ConcretePrimeRowBridge namespace EisensteinSchwartzPoisson open MeasureTheory Filter LineDeriv open scoped FourierTransform SchwartzMap Real RealInnerProductSpace abbrev LogPlane := WithLp 2 (ℝ × ℝ) theorem fourier_prod_eq_iterated (f : LogPlane → ℂ) (hf : Integrable f) (ξ η : ℝ) : 𝓕 f (WithLp.toLp 2 (ξ, η)) = 𝓕 (fun x : ℝ => 𝓕 (fun y : ℝ => f (WithLp.toLp 2 (x, y))) η) ξ := by let w : LogPlane := WithLp.toLp 2 (ξ, η) let G : LogPlane → ℂ := fun z => Real.fourierChar (-⟪z, w⟫) • f z have hG : Integrable G := (Real.fourierIntegral_convergent_iff w).mpr hf have hGp : Integrable (fun z : ℝ × ℝ => G (WithLp.toLp 2 z)) := (WithLp.volume_preserving_toLp ℝ ℝ).integrable_comp_of_integrable hG calc 𝓕 f (WithLp.toLp 2 (ξ, η)) = ∫ z : LogPlane, G z := rfl _ = ∫ z : ℝ × ℝ, G (WithLp.toLp 2 z) := ((WithLp.volume_preserving_toLp ℝ ℝ).integral_comp (MeasurableEquiv.toLp 2 (ℝ × ℝ)).measurableEmbedding G).symm _ = ∫ x : ℝ, ∫ y : ℝ, G (WithLp.toLp 2 (x, y)) := integral_prod _ hGp _ = 𝓕 (fun x : ℝ => 𝓕 (fun y : ℝ => f (WithLp.toLp 2 (x, y))) η) ξ := by simp only [Real.fourier_eq, Circle.smul_def, smul_eq_mul] apply integral_congr_ae exact Filter.Eventually.of_forall fun x => by dsimp only rw [← integral_const_mul] apply integral_congr_ae exact Filter.Eventually.of_forall fun y => by simp only [G, w, WithLp.prod_inner_apply, neg_add, Real.fourierChar.map_add_eq_mul, Circle.smul_def, smul_eq_mul, Circle.coe_mul, mul_assoc] def complexPoint (x y : ℝ) : ℂ := ⟨x, y⟩ theorem complexPoint_eq (x y : ℝ) : complexPoint x y = (x : ℂ) + Complex.I * (y : ℂ) := by apply Complex.ext <;> simp [complexPoint] def planeComplexIso : LogPlane ≃ₗᵢ[ℝ] ℂ where toLinearEquiv := (WithLp.linearEquiv 2 ℝ (ℝ × ℝ)).trans Complex.equivRealProdCLM.toLinearEquiv.symm norm_map' z := by apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp rw [WithLp.prod_norm_sq_eq_of_L2] change ‖complexPoint (WithLp.ofLp z).1 (WithLp.ofLp z).2‖ ^ 2 = ‖(WithLp.ofLp z).1‖ ^ 2 + ‖(WithLp.ofLp z).2‖ ^ 2 rw [Complex.sq_norm] simp [Complex.normSq_apply, complexPoint, Real.norm_eq_abs, sq] theorem planeComplexIso_apply (x y : ℝ) : planeComplexIso (WithLp.toLp 2 (x, y)) = complexPoint x y := rfl theorem horizontal_isometry (η : ℝ) : Isometry (fun x : ℝ => complexPoint x η) := by apply Isometry.of_dist_eq intro x y have h : complexPoint x η - complexPoint y η = ((x - y : ℝ) : ℂ) := by apply Complex.ext <;> simp [complexPoint] simp only [dist_eq_norm, h, Complex.norm_real] theorem horizontal_temperate (η : ℝ) : (fun x : ℝ => complexPoint x η).HasTemperateGrowth := by have heq : (fun x : ℝ => complexPoint x η) = (fun x : ℝ => Complex.ofRealCLM x + Complex.I * (η : ℂ)) := by funext x exact complexPoint_eq x η rw [heq] fun_prop def horizontalSlice (f : SchwartzMap ℂ ℂ) (η : ℝ) : SchwartzMap ℝ ℂ := SchwartzMap.compCLMOfAntilipschitz ℂ (horizontal_temperate η) (horizontal_isometry η).antilipschitzWith f theorem horizontalSlice_apply (f : SchwartzMap ℂ ℂ) (η x : ℝ) : horizontalSlice f η x = f (complexPoint x η) := rfl def partialFourier (f : SchwartzMap ℂ ℂ) (η x : ℝ) : ℂ := 𝓕 (fun y : ℝ => f (complexPoint x y)) η theorem partialFourier_eq_integral (f : SchwartzMap ℂ ℂ) (η x : ℝ) : partialFourier f η x = ∫ y : ℝ, Real.fourierChar (-inner ℝ y η) • f (complexPoint x y) := rfl def verticalMajorant (f : SchwartzMap ℂ ℂ) (y : ℝ) : ℝ := ((SchwartzMap.seminorm ℝ 0 0) f + (SchwartzMap.seminorm ℝ 2 0) f) * (1 + y ^ 2)⁻¹ theorem verticalMajorant_integrable (f : SchwartzMap ℂ ℂ) : Integrable (verticalMajorant f) := integrable_inv_one_add_sq.const_mul _ theorem norm_le_verticalMajorant (f : SchwartzMap ℂ ℂ) (x y : ℝ) : ‖f (complexPoint x y)‖ ≤ verticalMajorant f y := by have h0 := SchwartzMap.norm_le_seminorm ℝ f (complexPoint x y) have h2 := SchwartzMap.norm_pow_mul_le_seminorm ℝ f 2 (complexPoint x y) have hy : y ^ 2 ≤ ‖complexPoint x y‖ ^ 2 := by simp only [Complex.sq_norm, Complex.normSq_apply, complexPoint] nlinarith [sq_nonneg x] have hym := mul_le_mul_of_nonneg_right hy (norm_nonneg (f (complexPoint x y))) have hden : 0 < 1 + y ^ 2 := by positivity rw [verticalMajorant, ← div_eq_mul_inv] apply (le_div_iff₀ hden).mpr nlinarith theorem partialFourier_continuous (f : SchwartzMap ℂ ℂ) (η : ℝ) : Continuous (partialFourier f η) := by change Continuous (fun x : ℝ => ∫ y : ℝ, Real.fourierChar (-inner ℝ y η) • f (complexPoint x y)) apply continuous_of_dominated (bound := verticalMajorant f) · intro x have hline : Continuous (fun y : ℝ => complexPoint x y) := Complex.equivRealProdCLM.symm.continuous.comp (continuous_const.prodMk continuous_id) exact ((by fun_prop : Continuous (fun y : ℝ => Real.fourierChar (-inner ℝ y η))).smul (f.continuous.comp hline)).aestronglyMeasurable · intro x exact Eventually.of_forall fun y => by simpa only [Circle.smul_def, smul_eq_mul, norm_mul, Circle.norm_coe, one_mul] using norm_le_verticalMajorant f x y · exact verticalMajorant_integrable f · exact Eventually.of_forall fun y => by have hf : Continuous (fun x : ℝ => f (complexPoint x y)) := f.continuous.comp (horizontal_isometry y).continuous exact continuous_const.smul hf theorem partialFourier_integrable (f : SchwartzMap ℂ ℂ) (η : ℝ) : Integrable (partialFourier f η) := by let G : ℂ → ℂ := fun z => Real.fourierChar (-inner ℝ z.im η) • f z have hG : Integrable G := f.integrable.norm.mono' (by fun_prop : Continuous G).aestronglyMeasurable (Eventually.of_forall fun z => by simp only [G, Circle.smul_def, smul_eq_mul, norm_mul, Circle.norm_coe, one_mul] exact le_rfl) have hGp : Integrable (fun z : ℝ × ℝ => G (Complex.measurableEquivRealProd.symm z)) := Complex.volume_preserving_equiv_real_prod.symm.integrable_comp_of_integrable hG change Integrable (fun x : ℝ => ∫ y : ℝ, Real.fourierChar (-inner ℝ y η) • f (complexPoint x y)) simpa only [G, Complex.measurableEquivRealProd_symm_apply, complexPoint] using hGp.integral_prod_left theorem fourier_partialFourier (f : SchwartzMap ℂ ℂ) (ξ η : ℝ) : 𝓕 (partialFourier f η) ξ = 𝓕 (f : ℂ → ℂ) (complexPoint ξ η) := by let fp : SchwartzMap LogPlane ℂ := SchwartzMap.compCLMOfContinuousLinearEquiv ℂ planeComplexIso.toContinuousLinearEquiv f have hprod := fourier_prod_eq_iterated (fp : LogPlane → ℂ) fp.integrable ξ η have hcoe : (fp : LogPlane → ℂ) = (f : ℂ → ℂ) ∘ planeComplexIso := rfl rw [hcoe, Real.fourier_comp_linearIsometry] at hprod change 𝓕 (fun x : ℝ => 𝓕 (fun y : ℝ => f (complexPoint x y)) η) ξ = _ simpa only [Function.comp_apply, planeComplexIso_apply] using hprod.symm def partialFourierSchwartz (f : SchwartzMap ℂ ℂ) (η : ℝ) : SchwartzMap ℝ ℂ := 𝓕⁻ (horizontalSlice (𝓕 f) η) theorem partialFourierSchwartz_apply (f : SchwartzMap ℂ ℂ) (η x : ℝ) : partialFourierSchwartz f η x = partialFourier f η x := by have heq : 𝓕 (partialFourier f η) = (horizontalSlice (𝓕 f) η : ℝ → ℂ) := by funext ξ rw [fourier_partialFourier, horizontalSlice_apply] exact (congrFun (SchwartzMap.fourier_coe f) (complexPoint ξ η)).symm have hi : Integrable (𝓕 (partialFourier f η)) := by rw [heq] exact (horizontalSlice (𝓕 f) η).integrable change (𝓕⁻ (horizontalSlice (𝓕 f) η)) x = _ rw [congrFun (SchwartzMap.fourierInv_coe (horizontalSlice (𝓕 f) η)) x, ← heq] exact (partialFourier_integrable f η).fourierInv_fourier_eq hi (partialFourier_continuous f η).continuousAt theorem partialFourierSchwartz_coe (f : SchwartzMap ℂ ℂ) (η : ℝ) : (partialFourierSchwartz f η : ℝ → ℂ) = partialFourier f η := funext (partialFourierSchwartz_apply f η) theorem horizontal_hasFDerivAt (η x : ℝ) : HasFDerivAt (fun y : ℝ => complexPoint y η) Complex.ofRealCLM x := by have heq : (fun y : ℝ => complexPoint y η) = (fun y : ℝ => Complex.ofRealCLM y + Complex.I * (η : ℂ)) := by funext y exact complexPoint_eq y η rw [heq] exact Complex.ofRealCLM.hasFDerivAt.add_const _ theorem horizontalSlice_lineDerivOp (F : SchwartzMap ℂ ℂ) (η : ℝ) : ∂_{(1 : ℝ)} (horizontalSlice F η) = horizontalSlice (∂_{(1 : ℂ)} F) η := by apply SchwartzMap.ext intro x rw [SchwartzMap.lineDerivOp_apply_eq_fderiv, horizontalSlice_apply, SchwartzMap.lineDerivOp_apply_eq_fderiv] have hcomp := (F.hasFDerivAt (complexPoint x η)).comp x (horizontal_hasFDerivAt η x) change fderiv ℝ (fun y : ℝ => F (complexPoint y η)) x (1 : ℝ) = _ change fderiv ℝ ((F : ℂ → ℂ) ∘ (fun y => complexPoint y η)) x (1 : ℝ) = _ rw [hcomp.fderiv] simp only [ContinuousLinearMap.comp_apply, Complex.ofRealCLM_apply, Complex.ofReal_one] theorem horizontalSlice_lineDerivOp_twice (F : SchwartzMap ℂ ℂ) (η : ℝ) : ∂_{(1 : ℝ)} (∂_{(1 : ℝ)} (horizontalSlice F η)) = horizontalSlice (∂_{(1 : ℂ)} (∂_{(1 : ℂ)} F)) η := by rw [horizontalSlice_lineDerivOp, horizontalSlice_lineDerivOp] theorem summable_int_cauchy_weight : Summable (fun n : ℤ => (1 + (n : ℝ) ^ 2)⁻¹) := by classical have hp : Summable (fun n : ℤ => 1 / (n : ℝ) ^ 2) := Real.summable_one_div_int_pow.mpr (by norm_num) rw [← Finset.summable_compl_iff (s := ({0} : Finset ℤ))] apply Summable.of_nonneg_of_le (fun _ => by positivity) _ (hp.subtype (fun n : ℤ => n ∉ ({0} : Finset ℤ))) intro n have hn : n.val ≠ 0 := by simpa only [Finset.mem_singleton] using n.property have hnr : (n.val : ℝ) ≠ 0 := by exact_mod_cast hn have hsq : 0 < (n.val : ℝ) ^ 2 := sq_pos_of_ne_zero hnr change (1 + (n.val : ℝ) ^ 2)⁻¹ ≤ 1 / (n.val : ℝ) ^ 2 simpa only [one_div] using one_div_le_one_div_of_le hsq (show (n.val : ℝ) ^ 2 ≤ 1 + (n.val : ℝ) ^ 2 by linarith) theorem summable_int_cauchy_product : Summable (fun p : ℤ × ℤ => (1 + (p.1 : ℝ) ^ 2)⁻¹ * (1 + (p.2 : ℝ) ^ 2)⁻¹) := summable_int_cauchy_weight.mul_of_nonneg summable_int_cauchy_weight (fun _ => by positivity) (fun _ => by positivity) theorem summable_norm_of_cauchy_product (F : ℤ × ℤ → ℂ) (C : ℝ) (hF : ∀ p, ‖F p‖ ≤ C * ((1 + (p.1 : ℝ) ^ 2)⁻¹ * (1 + (p.2 : ℝ) ^ 2)⁻¹)) : Summable (fun p => ‖F p‖) := Summable.of_nonneg_of_le (fun _ => norm_nonneg _) hF (summable_int_cauchy_product.mul_left C) def planeDecayConstant (F : SchwartzMap ℂ ℂ) : ℝ := SchwartzMap.seminorm ℝ 0 0 F + SchwartzMap.seminorm ℝ 2 0 F + SchwartzMap.seminorm ℝ 4 0 F theorem plane_schwartz_product_decay (F : SchwartzMap ℂ ℂ) (ξ η : ℝ) : ((1 + ξ ^ 2) * (1 + η ^ 2)) * ‖F (complexPoint ξ η)‖ ≤ planeDecayConstant F := by let z := complexPoint ξ η have hz : ‖z‖ ^ 2 = ξ ^ 2 + η ^ 2 := by rw [Complex.sq_norm] simp [z, Complex.normSq_apply, complexPoint, sq] have h0 := SchwartzMap.norm_le_seminorm ℝ F z have h2 := SchwartzMap.norm_pow_mul_le_seminorm ℝ F 2 z have h4 := SchwartzMap.norm_pow_mul_le_seminorm ℝ F 4 z have hz4 : ‖z‖ ^ 4 = (ξ ^ 2 + η ^ 2) ^ 2 := by calc ‖z‖ ^ 4 = (‖z‖ ^ 2) ^ 2 := by ring _ = (ξ ^ 2 + η ^ 2) ^ 2 := congrArg (fun t : ℝ => t ^ 2) hz have hxy : ξ ^ 2 * η ^ 2 ≤ ‖z‖ ^ 4 := by rw [hz4] nlinarith [sq_nonneg (ξ ^ 2), sq_nonneg (η ^ 2), mul_nonneg (sq_nonneg ξ) (sq_nonneg η)] have hm := mul_le_mul_of_nonneg_right hxy (norm_nonneg (F z)) rw [hz] at h2 change ((1 + ξ ^ 2) * (1 + η ^ 2)) * ‖F z‖ ≤ _ unfold planeDecayConstant nlinarith theorem norm_horizontalSlice_le (F : SchwartzMap ℂ ℂ) (η ξ : ℝ) : ‖horizontalSlice F η ξ‖ ≤ (planeDecayConstant F / (1 + η ^ 2)) * (1 + ξ ^ 2)⁻¹ := by rw [horizontalSlice_apply, ← div_eq_mul_inv, div_div] apply (le_div_iff₀ (by positivity : 0 < (1 + η ^ 2) * (1 + ξ ^ 2))).mpr nlinarith [plane_schwartz_product_decay F ξ η] theorem norm_inverse_horizontalSlice_le (F : SchwartzMap ℂ ℂ) (η x : ℝ) : ‖(𝓕⁻ (horizontalSlice F η)) x‖ ≤ (planeDecayConstant F / (1 + η ^ 2)) * Real.pi := by rw [congrFun (SchwartzMap.fourierInv_coe (horizontalSlice F η)) x, Real.fourierInv_eq] have hb : Integrable (fun ξ : ℝ => (planeDecayConstant F / (1 + η ^ 2)) * (1 + ξ ^ 2)⁻¹) := integrable_inv_one_add_sq.const_mul _ have h := norm_integral_le_of_norm_le (f := fun ξ : ℝ => Real.fourierChar (inner ℝ ξ x) • horizontalSlice F η ξ) hb (Eventually.of_forall fun ξ => by simpa only [Circle.smul_def, smul_eq_mul, norm_mul, Circle.norm_coe, one_mul] using norm_horizontalSlice_le F η ξ) simpa only [integral_const_mul, integral_univ_inv_one_add_sq] using h theorem norm_inverse_lineDeriv (g : SchwartzMap ℝ ℂ) (x : ℝ) : ‖(𝓕⁻ (∂_{(1 : ℝ)} g)) x‖ = (2 * Real.pi) * |x| * ‖(𝓕⁻ g) x‖ := by have ht : (fun u : ℝ => inner ℝ u (1 : ℝ)).HasTemperateGrowth := by fun_prop have hc : ‖(-(2 * Real.pi * Complex.I) : ℂ)‖ = 2 * Real.pi := by simp [ Complex.norm_real, Real.norm_eq_abs, abs_of_pos Real.pi_pos] rw [SchwartzMap.fourierInv_lineDerivOp_eq] simp only [_root_.smul_apply, SchwartzMap.smulLeftCLM_apply_apply ht, norm_smul, hc] simp [RCLike.inner_apply, Real.norm_eq_abs, mul_assoc] theorem sq_mul_norm_inverse_le_second (g : SchwartzMap ℝ ℂ) (x : ℝ) : x ^ 2 * ‖(𝓕⁻ g) x‖ ≤ ‖(𝓕⁻ (∂_{(1 : ℝ)} (∂_{(1 : ℝ)} g))) x‖ := by rw [norm_inverse_lineDeriv, norm_inverse_lineDeriv] have hp : 1 ≤ (2 * Real.pi) ^ 2 := by nlinarith [Real.pi_gt_three] calc x ^ 2 * ‖(𝓕⁻ g) x‖ ≤ ((2 * Real.pi) ^ 2 * x ^ 2) * ‖(𝓕⁻ g) x‖ := mul_le_mul_of_nonneg_right (le_mul_of_one_le_left (sq_nonneg x) hp) (norm_nonneg _) _ = ((2 * Real.pi) ^ 2 * |x| ^ 2) * ‖(𝓕⁻ g) x‖ := by rw [sq_abs] _ = _ := by ring theorem inverse_horizontalSlice_product_decay (F : SchwartzMap ℂ ℂ) (η x : ℝ) : ((1 + x ^ 2) * (1 + η ^ 2)) * ‖(𝓕⁻ (horizontalSlice F η)) x‖ ≤ Real.pi * (planeDecayConstant F + planeDecayConstant (∂_{(1 : ℂ)} (∂_{(1 : ℂ)} F))) := by have h0 := norm_inverse_horizontalSlice_le F η x have h2a := sq_mul_norm_inverse_le_second (horizontalSlice F η) x rw [horizontalSlice_lineDerivOp_twice] at h2a have h2 := h2a.trans (norm_inverse_horizontalSlice_le (∂_{(1 : ℂ)} (∂_{(1 : ℂ)} F)) η x) have hden : 0 < 1 + η ^ 2 := by positivity have h0' : ‖(𝓕⁻ (horizontalSlice F η)) x‖ * (1 + η ^ 2) ≤ planeDecayConstant F * Real.pi := by apply (le_div_iff₀ hden).mp simpa only [div_mul_eq_mul_div] using h0 have h2' : (x ^ 2 * ‖(𝓕⁻ (horizontalSlice F η)) x‖) * (1 + η ^ 2) ≤ planeDecayConstant (∂_{(1 : ℂ)} (∂_{(1 : ℂ)} F)) * Real.pi := by apply (le_div_iff₀ hden).mp simpa only [div_mul_eq_mul_div] using h2 nlinarith def partialFourierDecayConstant (f : SchwartzMap ℂ ℂ) : ℝ := Real.pi * (planeDecayConstant (𝓕 f) + planeDecayConstant (∂_{(1 : ℂ)} (∂_{(1 : ℂ)} (𝓕 f)))) theorem partialFourier_product_decay (f : SchwartzMap ℂ ℂ) (η x : ℝ) : ((1 + x ^ 2) * (1 + η ^ 2)) * ‖partialFourier f η x‖ ≤ partialFourierDecayConstant f := by rw [← partialFourierSchwartz_apply] exact inverse_horizontalSlice_product_decay (𝓕 f) η x theorem norm_partialFourier_le (f : SchwartzMap ℂ ℂ) (η x : ℝ) : ‖partialFourier f η x‖ ≤ partialFourierDecayConstant f * ((1 + x ^ 2)⁻¹ * (1 + η ^ 2)⁻¹) := by rw [← mul_inv, ← div_eq_mul_inv] apply (le_div_iff₀ (by positivity : 0 < (1 + x ^ 2) * (1 + η ^ 2))).mpr nlinarith [partialFourier_product_decay f η x] theorem partialFourier_gaussian_summable_norm (f : SchwartzMap ℂ ℂ) : Summable (fun p : ℤ × ℤ => ‖partialFourier f (p.2 : ℝ) (p.1 : ℝ)‖) := by apply summable_norm_of_cauchy_product (fun p : ℤ × ℤ => partialFourier f (p.2 : ℝ) (p.1 : ℝ)) (partialFourierDecayConstant f) intro p exact norm_partialFourier_le f (p.2 : ℝ) (p.1 : ℝ) theorem partialFourier_gaussian_summable (f : SchwartzMap ℂ ℂ) : Summable (fun p : ℤ × ℤ => partialFourier f (p.2 : ℝ) (p.1 : ℝ)) := (partialFourier_gaussian_summable_norm f).of_norm theorem plane_lattice_summable_norm (f : 𝓢(ℂ, ℂ)) : Summable (fun p : ℤ × ℤ => ‖f (complexPoint (p.1 : ℝ) (p.2 : ℝ))‖) := by apply summable_norm_of_cauchy_product _ (planeDecayConstant f) intro p rw [← mul_inv, ← div_eq_mul_inv] apply (le_div_iff₀ (by positivity : 0 < (1 + (p.1 : ℝ) ^ 2) * (1 + (p.2 : ℝ) ^ 2))).mpr nlinarith [plane_schwartz_product_decay f (p.1 : ℝ) (p.2 : ℝ)] theorem plane_lattice_summable (f : 𝓢(ℂ, ℂ)) : Summable (fun p : ℤ × ℤ => f (complexPoint (p.1 : ℝ) (p.2 : ℝ))) := (plane_lattice_summable_norm f).of_norm theorem vertical_isometry (x : ℝ) : Isometry (fun y : ℝ => complexPoint x y) := by apply Isometry.of_dist_eq intro y z have h : complexPoint x y - complexPoint x z = Complex.I * ((y - z : ℝ) : ℂ) := by apply Complex.ext <;> simp [complexPoint] simp only [dist_eq_norm, h, norm_mul, Complex.norm_I, one_mul, Complex.norm_real] theorem vertical_temperate (x : ℝ) : (fun y : ℝ => complexPoint x y).HasTemperateGrowth := by have heq : (fun y : ℝ => complexPoint x y) = (fun y : ℝ => (x : ℂ) + Complex.I * Complex.ofRealCLM y) := by funext y exact complexPoint_eq x y rw [heq] fun_prop def verticalSlice (f : 𝓢(ℂ, ℂ)) (x : ℝ) : 𝓢(ℝ, ℂ) := SchwartzMap.compCLMOfAntilipschitz ℂ (vertical_temperate x) (vertical_isometry x).antilipschitzWith f theorem schwartz_poisson_zero (g : 𝓢(ℝ, ℂ)) : (∑' n : ℤ, g (n : ℝ)) = ∑' n : ℤ, 𝓕 (g : ℝ → ℂ) (n : ℝ) := by simpa [fourier_eval_zero, SchwartzMap.fourier_coe] using g.tsum_eq_tsum_fourier 0 theorem vertical_poisson (f : 𝓢(ℂ, ℂ)) (x : ℝ) : (∑' n : ℤ, f (complexPoint x (n : ℝ))) = ∑' n : ℤ, partialFourier f (n : ℝ) x := by exact schwartz_poisson_zero (verticalSlice f x) private theorem horizontal_poisson (f : 𝓢(ℂ, ℂ)) (n : ℤ) : (∑' m : ℤ, partialFourier f (n : ℝ) (m : ℝ)) = ∑' k : ℤ, (𝓕 f) (complexPoint (k : ℝ) (n : ℝ)) := by have h := schwartz_poisson_zero (partialFourierSchwartz f n) simpa only [partialFourierSchwartz_apply, partialFourierSchwartz_coe, fourier_partialFourier, SchwartzMap.fourier_coe] using h private theorem iterated_poisson_pair_sum (f g h : ℤ → ℤ → ℂ) (hf : Summable (Function.uncurry f)) (hg : Summable (Function.uncurry g)) (hh : Summable (Function.uncurry h)) (hvertical : ∀ m, (∑' n, f m n) = ∑' n, h m n) (hhorizontal : ∀ n, (∑' m, h m n) = ∑' m, g m n) : (∑' p : ℤ × ℤ, f p.1 p.2) = ∑' p : ℤ × ℤ, g p.1 p.2 := by calc (∑' p : ℤ × ℤ, f p.1 p.2) = ∑' m, ∑' n, f m n := hf.tsum_prod _ = ∑' m, ∑' n, h m n := tsum_congr hvertical _ = ∑' n, ∑' m, h m n := hh.tsum_comm.symm _ = ∑' n, ∑' m, g m n := tsum_congr hhorizontal _ = ∑' m, ∑' n, g m n := hg.tsum_comm _ = ∑' p : ℤ × ℤ, g p.1 p.2 := hg.tsum_prod.symm theorem integer_pair_poisson (f : 𝓢(ℂ, ℂ)) : (∑' p : ℤ × ℤ, f (complexPoint (p.1 : ℝ) (p.2 : ℝ))) = ∑' p : ℤ × ℤ, (𝓕 f) (complexPoint (p.1 : ℝ) (p.2 : ℝ)) := by exact iterated_poisson_pair_sum (fun m n => f (complexPoint (m : ℝ) (n : ℝ))) (fun m n : ℤ => (𝓕 f : 𝓢(ℂ, ℂ)) (complexPoint (m : ℝ) (n : ℝ))) (fun m n => partialFourier f (n : ℝ) (m : ℝ)) (plane_lattice_summable f) (plane_lattice_summable (𝓕 f)) (partialFourier_gaussian_summable f) (fun m => vertical_poisson f m) (horizontal_poisson f) end EisensteinSchwartzPoisson end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Poisson.EisensteinLattice namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical namespace EisensteinSchwartzPoisson section open MeasureTheory open scoped FourierTransform SchwartzMap RealInnerProductSpace def inverseJacobian (A : ℂ ≃L[ℝ] ℂ) : ℝ := |(LinearMap.det (A : ℂ →ₗ[ℝ] ℂ))⁻¹| theorem integral_comp_linearEquiv (A : ℂ ≃L[ℝ] ℂ) (f : ℂ → ℂ) : (∫ x : ℂ, f (A x)) = inverseJacobian A • ∫ x : ℂ, f x := by have h := integral_map_equiv («μ» := (volume : Measure ℂ)) A.toHomeomorph.toMeasurableEquiv f have hm : Measure.map A (volume : Measure ℂ) = ENNReal.ofReal (inverseJacobian A) • volume := by exact Measure.map_linearMap_addHaar_eq_smul_addHaar volume A.toLinearEquiv.isUnit_det'.ne_zero change (∫ y : ℂ, f y ∂Measure.map A volume) = (∫ x : ℂ, f (A x)) at h rw [hm, integral_smul_measure, ENNReal.toReal_ofReal (show 0 ≤ inverseJacobian A from abs_nonneg _)] at h exact h.symm def dualMap (A : ℂ ≃L[ℝ] ℂ) : ℂ →L[ℝ] ℂ := A.symm.toContinuousLinearMap.adjoint theorem inner_linear_dual (A : ℂ ≃L[ℝ] ℂ) (x y : ℂ) : inner ℝ (A x) (dualMap A y) = inner ℝ x y := by rw [dualMap, ContinuousLinearMap.adjoint_inner_right] simp theorem fourier_comp_linearEquiv (A : ℂ ≃L[ℝ] ℂ) (f : ℂ → ℂ) (w : ℂ) : 𝓕 (f ∘ A) w = inverseJacobian A • 𝓕 f (dualMap A w) := by let H : ℂ → ℂ := fun z => Real.fourierChar (-inner ℝ z (dualMap A w)) • f z calc 𝓕 (f ∘ A) w = ∫ x : ℂ, H (A x) := by apply integral_congr_ae exact Filter.Eventually.of_forall fun x => by simp only [H, inner_linear_dual, Function.comp_apply] rfl _ = inverseJacobian A • ∫ z : ℂ, H z := integral_comp_linearEquiv A H _ = inverseJacobian A • 𝓕 f (dualMap A w) := rfl def translateSchwartz (f : 𝓢(ℂ, ℂ)) (b : ℂ) : 𝓢(ℂ, ℂ) := SchwartzMap.compCLMOfAntilipschitz ℂ (g := fun z : ℂ => z + b) (by fun_prop) (isometry_add_right b).antilipschitzWith f theorem fourier_translate (f : ℂ → ℂ) (b w : ℂ) : 𝓕 (fun z => f (z + b)) w = Real.fourierChar (inner ℝ b w) • 𝓕 f w := by exact congrFun (VectorFourier.fourierIntegral_comp_add_right Real.fourierChar (volume : Measure ℂ) (innerₗ ℂ) f b) w def affinePullback (f : 𝓢(ℂ, ℂ)) (A : ℂ ≃L[ℝ] ℂ) (b : ℂ) : 𝓢(ℂ, ℂ) := SchwartzMap.compCLMOfContinuousLinearEquiv ℂ A (translateSchwartz f b) theorem affinePullback_apply (f : 𝓢(ℂ, ℂ)) (A : ℂ ≃L[ℝ] ℂ) (b z : ℂ) : affinePullback f A b z = f (A z + b) := rfl theorem fourier_affinePullback (f : 𝓢(ℂ, ℂ)) (A : ℂ ≃L[ℝ] ℂ) (b w : ℂ) : (𝓕 (affinePullback f A b)) w = inverseJacobian A • (Real.fourierChar (inner ℝ b (dualMap A w)) • (𝓕 f) (dualMap A w)) := by rw [congrFun (SchwartzMap.fourier_coe _) w] change 𝓕 ((fun z => f (z + b)) ∘ A) w = _ rw [fourier_comp_linearEquiv, fourier_translate] rw [congrFun (SchwartzMap.fourier_coe f) (dualMap A w)] theorem affine_lattice_poisson (f : 𝓢(ℂ, ℂ)) (A : ℂ ≃L[ℝ] ℂ) (b : ℂ) : (∑' p : ℤ × ℤ, f (A (complexPoint (p.1 : ℝ) (p.2 : ℝ)) + b)) = inverseJacobian A • ∑' p : ℤ × ℤ, Real.fourierChar (inner ℝ b (dualMap A (complexPoint (p.1 : ℝ) (p.2 : ℝ)))) • (𝓕 f) (dualMap A (complexPoint (p.1 : ℝ) (p.2 : ℝ))) := by have h := integer_pair_poisson (affinePullback f A b) simp only [affinePullback_apply, fourier_affinePullback] at h rw [tsum_const_smul''] at h exact h end section open scoped RealInnerProductSpace def basisMap (w : ℂ) : ℂ →L[ℝ] ℂ := Complex.ofRealCLM.comp Complex.reCLM + w • (Complex.ofRealCLM.comp Complex.imCLM) theorem basisMap_apply (w z : ℂ) : basisMap w z = (z.re : ℂ) + w * (z.im : ℂ) := rfl def basisEquiv (w : ℂ) (hw : w.im ≠ 0) : ℂ ≃L[ℝ] ℂ where toLinearEquiv := { toLinearMap := (basisMap w).toLinearMap invFun z := complexPoint (z.re - z.im * w.re / w.im) (z.im / w.im) left_inv z := by change complexPoint ((basisMap w z).re - (basisMap w z).im * w.re / w.im) ((basisMap w z).im / w.im) = z apply Complex.ext · simp only [basisMap_apply, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, mul_zero, sub_zero, Complex.add_im, Complex.mul_im, zero_add, complexPoint] field_simp [hw] ring · simp [basisMap_apply, complexPoint, hw] right_inv z := by change basisMap w (complexPoint (z.re - z.im * w.re / w.im) (z.im / w.im)) = z apply Complex.ext · simp only [basisMap_apply, complexPoint, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, mul_zero, sub_zero] field_simp [hw] ring · simp only [basisMap_apply, complexPoint, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, mul_zero, zero_add] field_simp [hw] } continuous_toFun := (basisMap w).continuous continuous_invFun := by simp only [complexPoint_eq] fun_prop theorem basisEquiv_apply (w : ℂ) (hw : w.im ≠ 0) (z : ℂ) : basisEquiv w hw z = (z.re : ℂ) + w * (z.im : ℂ) := rfl theorem basisEquiv_symm_apply (w : ℂ) (hw : w.im ≠ 0) (z : ℂ) : (basisEquiv w hw).symm z = complexPoint (z.re - z.im * w.re / w.im) (z.im / w.im) := rfl theorem basisEquiv_det (w : ℂ) (hw : w.im ≠ 0) : LinearMap.det ((basisEquiv w hw) : ℂ →ₗ[ℝ] ℂ) = w.im := by rw [← LinearMap.det_toMatrix Complex.basisOneI, Matrix.det_fin_two] simp [LinearMap.toMatrix_apply, Complex.coe_basisOneI, Complex.coe_basisOneI_repr, basisEquiv_apply] def complexMulEquiv (c : ℂ) (hc : c ≠ 0) : ℂ ≃L[ℝ] ℂ := ContinuousLinearEquiv.smulLeft (R₁ := ℝ) (M₁ := ℂ) (Units.mk0 c hc) theorem complexMulEquiv_apply (c : ℂ) (hc : c ≠ 0) (z : ℂ) : complexMulEquiv c hc z = c * z := rfl theorem complexMulEquiv_det (c : ℂ) (hc : c ≠ 0) : LinearMap.det ((complexMulEquiv c hc) : ℂ →ₗ[ℝ] ℂ) = Complex.normSq c := by rw [← LinearMap.det_toMatrix Complex.basisOneI, Matrix.det_fin_two] simp [LinearMap.toMatrix_apply, Complex.coe_basisOneI, Complex.coe_basisOneI_repr, complexMulEquiv_apply, Complex.normSq_apply] def scaledBasisEquiv (w : ℂ) (hw : w.im ≠ 0) (c : ℂ) (hc : c ≠ 0) : ℂ ≃L[ℝ] ℂ := (basisEquiv w hw).trans (complexMulEquiv c hc) theorem scaledBasisEquiv_apply (w : ℂ) (hw : w.im ≠ 0) (c : ℂ) (hc : c ≠ 0) (z : ℂ) : scaledBasisEquiv w hw c hc z = c * ((z.re : ℂ) + w * (z.im : ℂ)) := rfl theorem scaledBasisEquiv_det (w : ℂ) (hw : w.im ≠ 0) (c : ℂ) (hc : c ≠ 0) : LinearMap.det ((scaledBasisEquiv w hw c hc) : ℂ →ₗ[ℝ] ℂ) = Complex.normSq c * w.im := by change LinearMap.det (((complexMulEquiv c hc) : ℂ →ₗ[ℝ] ℂ).comp ((basisEquiv w hw) : ℂ →ₗ[ℝ] ℂ)) = _ rw [LinearMap.det_comp, complexMulEquiv_det, basisEquiv_det] end section open MeasureTheory EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open scoped FourierTransform SchwartzMap RealInnerProductSpace abbrev O := ActualEisensteinCubic.O def eisensteinLatticeMap (c : ℂ) (hc : c ≠ 0) : ℂ ≃L[ℝ] ℂ := scaledBasisEquiv omega3 omega3_im_ne_zero c hc theorem eisensteinLatticeMap_point (c : ℂ) (hc : c ≠ 0) (p : ℤ × ℤ) : eisensteinLatticeMap c hc (complexPoint (p.1 : ℝ) (p.2 : ℝ)) = c * eisEmbedding (ActualEisensteinCoordinates.eval p.1 p.2) := by simp [eisensteinLatticeMap, scaledBasisEquiv_apply, complexPoint, eisEmbedding_eval, mul_comm] theorem eisenstein_inverseJacobian (c : ℂ) (hc : c ≠ 0) : inverseJacobian (eisensteinLatticeMap c hc) = 2 / (Real.sqrt 3 * ‖c‖ ^ 2) := by have hs : 0 < Real.sqrt 3 := Real.sqrt_pos.mpr (by norm_num) have hn : 0 < ‖c‖ ^ 2 := sq_pos_of_pos (norm_pos_iff.mpr hc) unfold inverseJacobian eisensteinLatticeMap rw [scaledBasisEquiv_det, omega3_im, Complex.normSq_eq_norm_sq] rw [abs_of_pos (inv_pos.mpr (mul_pos hn (div_pos hs (by norm_num))))] field_simp def eisensteinDualFrequency (c : ℂ) (hc : c ≠ 0) (p : ℤ × ℤ) : ℂ := dualMap (eisensteinLatticeMap c hc) (complexPoint (p.1 : ℝ) (p.2 : ℝ)) theorem actual_eisenstein_coset_poisson (f : 𝓢(ℂ, ℂ)) (b c : O) (hc : c ≠ 0) : (∑' z : O, f (eisEmbedding (b + c * z))) = (2 / (Real.sqrt 3 * ‖eisEmbedding c‖ ^ 2)) • ∑' p : ℤ × ℤ, Real.fourierChar (inner ℝ (eisEmbedding b) (eisensteinDualFrequency (eisEmbedding c) (eisEmbedding_ne_zero hc) p)) • (𝓕 f) (eisensteinDualFrequency (eisEmbedding c) (eisEmbedding_ne_zero hc) p) := by let A := eisensteinLatticeMap (eisEmbedding c) (eisEmbedding_ne_zero hc) have h := affine_lattice_poisson f A (eisEmbedding b) rw [eisenstein_inverseJacobian] at h calc (∑' z : O, f (eisEmbedding (b + c * z))) = ∑' p : ℤ × ℤ, f (eisEmbedding (b + c * latticeCoordEquiv.symm p)) := (latticeCoordEquiv.symm.tsum_eq _).symm _ = ∑' p : ℤ × ℤ, f (A (complexPoint (p.1 : ℝ) (p.2 : ℝ)) + eisEmbedding b) := by apply tsum_congr intro p congr 1 rw [map_add, map_mul] change eisEmbedding b + eisEmbedding c * eisEmbedding (ActualEisensteinCoordinates.eval p.1 p.2) = _ rw [← eisensteinLatticeMap_point] exact add_comm _ _ _ = _ := h theorem actual_eisenstein_coset_summable_norm (f : 𝓢(ℂ, ℂ)) (b c : O) (hc : c ≠ 0) : Summable (fun z : O => ‖f (eisEmbedding (b + c * z))‖) := by let A := eisensteinLatticeMap (eisEmbedding c) (eisEmbedding_ne_zero hc) have hp := plane_lattice_summable_norm (affinePullback f A (eisEmbedding b)) have hpair : Summable (fun p : ℤ × ℤ => ‖f (eisEmbedding (b + c * latticeCoordEquiv.symm p))‖) := by convert hp using 1 funext p rw [affinePullback_apply] apply congrArg norm apply congrArg f rw [map_add, map_mul] change eisEmbedding b + eisEmbedding c * eisEmbedding (ActualEisensteinCoordinates.eval p.1 p.2) = _ rw [← eisensteinLatticeMap_point] exact add_comm _ _ exact (latticeCoordEquiv.symm.summable_iff).mp hpair theorem actual_eisenstein_summable_norm (f : 𝓢(ℂ, ℂ)) : Summable (fun z : O => ‖f (eisEmbedding z)‖) := by simpa using actual_eisenstein_coset_summable_norm f 0 1 one_ne_zero theorem actual_eisenstein_periodic_summable (f : 𝓢(ℂ, ℂ)) {R : Type*} [Fintype R] (q : O → R) (P : R → ℂ) : Summable (fun z : O => P (q z) * f (eisEmbedding z)) := by classical let C : ℝ := ∑ r : R, ‖P r‖ have hP (r : R) : ‖P r‖ ≤ C := Finset.single_le_sum (fun a _ => norm_nonneg (P a)) (Finset.mem_univ r) apply Summable.of_norm apply Summable.of_nonneg_of_le (fun z => norm_nonneg _) _ ((actual_eisenstein_summable_norm f).mul_left C) intro z rw [norm_mul] exact mul_le_mul_of_nonneg_right (hP (q z)) (norm_nonneg _) theorem actual_eisenstein_periodic_poisson (f : 𝓢(ℂ, ℂ)) (c : O) (hc : c ≠ 0) (P : O ⧸ Ideal.span {c} → ℂ) : letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ (∑' z : O, P (Ideal.Quotient.mk (Ideal.span {c}) z) * f (eisEmbedding z)) = ∑ r : O ⧸ Ideal.span {c}, P r * ((2 / (Real.sqrt 3 * ‖eisEmbedding c‖ ^ 2)) • ∑' p : ℤ × ℤ, Real.fourierChar (inner ℝ (eisEmbedding (GaussianShiftedPartition.representative c r)) (eisensteinDualFrequency (eisEmbedding c) (eisEmbedding_ne_zero hc) p)) • (𝓕 f) (eisensteinDualFrequency (eisEmbedding c) (eisEmbedding_ne_zero hc) p)) := by classical let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ rw [GaussianAbelPartition.tsum_periodic_weighted_partition (Ideal.Quotient.mk (Ideal.span {c})) P (fun z => f (eisEmbedding z)) (actual_eisenstein_periodic_summable f _ P)] apply Finset.sum_congr rfl intro r hr congr 1 exact (GaussianFiberEquiv.fiber_tsum c hc r (GaussianShiftedPartition.representative c r) (GaussianShiftedPartition.representative_spec c r) (fun z => f (eisEmbedding z))).trans (actual_eisenstein_coset_poisson f _ c hc) theorem inverseJacobian_pos (A : ℂ ≃L[ℝ] ℂ) : 0 < inverseJacobian A := abs_pos.mpr (inv_ne_zero A.toLinearEquiv.isUnit_det'.ne_zero) theorem dual_lattice_summable_norm (f : 𝓢(ℂ, ℂ)) (A : ℂ ≃L[ℝ] ℂ) : Summable (fun p : ℤ × ℤ => ‖(𝓕 f) (dualMap A (complexPoint (p.1 : ℝ) (p.2 : ℝ)))‖) := by have hJ := inverseJacobian_pos A have hp := plane_lattice_summable_norm (𝓕 (affinePullback f A 0)) have hn (p : ℤ × ℤ) : ‖(𝓕 (affinePullback f A 0)) (complexPoint (p.1 : ℝ) (p.2 : ℝ))‖ = inverseJacobian A * ‖(𝓕 f) (dualMap A (complexPoint (p.1 : ℝ) (p.2 : ℝ)))‖ := by rw [fourier_affinePullback] simp [ abs_of_pos hJ] simp_rw [hn] at hp have hi := hp.mul_left (inverseJacobian A)⁻¹ simpa only [← mul_assoc, inv_mul_cancel₀ hJ.ne', one_mul] using hi theorem finite_phase_sum {R : Type*} [Fintype R] (f : 𝓢(ℂ, ℂ)) (A : ℂ ≃L[ℝ] ℂ) (b : R → ℂ) (P : R → ℂ) : (∑ r : R, P r * (inverseJacobian A • ∑' p : ℤ × ℤ, Real.fourierChar (inner ℝ (b r) (dualMap A (complexPoint (p.1 : ℝ) (p.2 : ℝ)))) • (𝓕 f) (dualMap A (complexPoint (p.1 : ℝ) (p.2 : ℝ))))) = inverseJacobian A • ∑' p : ℤ × ℤ, (∑ r : R, P r * (Real.fourierChar (inner ℝ (b r) (dualMap A (complexPoint (p.1 : ℝ) (p.2 : ℝ)))) : ℂ)) * (𝓕 f) (dualMap A (complexPoint (p.1 : ℝ) (p.2 : ℝ))) := by classical have hs (r : R) : Summable (fun p : ℤ × ℤ => P r * (Real.fourierChar (inner ℝ (b r) (dualMap A (complexPoint (p.1 : ℝ) (p.2 : ℝ)))) • (𝓕 f) (dualMap A (complexPoint (p.1 : ℝ) (p.2 : ℝ))))) := by apply Summable.mul_left apply Summable.of_norm simpa only [Circle.norm_smul] using dual_lattice_summable_norm f A simp_rw [mul_smul_comm, ← tsum_mul_left] rw [← Finset.smul_sum, ← Summable.tsum_finsetSum (fun r _ => hs r)] congr 1 apply tsum_congr intro p simp only [Circle.smul_def, smul_eq_mul, Finset.sum_mul, mul_assoc] theorem actual_eisenstein_periodic_fourier (f : 𝓢(ℂ, ℂ)) (c : O) (hc : c ≠ 0) (P : O ⧸ Ideal.span {c} → ℂ) : letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ (∑' z : O, P (Ideal.Quotient.mk (Ideal.span {c}) z) * f (eisEmbedding z)) = (2 / (Real.sqrt 3 * ‖eisEmbedding c‖ ^ 2)) • ∑' p : ℤ × ℤ, (∑ r : O ⧸ Ideal.span {c}, P r * (Real.fourierChar (inner ℝ (eisEmbedding (GaussianShiftedPartition.representative c r)) (eisensteinDualFrequency (eisEmbedding c) (eisEmbedding_ne_zero hc) p)) : ℂ)) * (𝓕 f) (eisensteinDualFrequency (eisEmbedding c) (eisEmbedding_ne_zero hc) p) := by classical let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ rw [actual_eisenstein_periodic_poisson f c hc P] have h := finite_phase_sum f (eisensteinLatticeMap (eisEmbedding c) (eisEmbedding_ne_zero hc)) (fun r => eisEmbedding (GaussianShiftedPartition.representative c r)) P rw [eisenstein_inverseJacobian] at h exact h end open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open scoped FourierTransform SchwartzMap RealInnerProductSpace theorem dualMap_trans (A B : ℂ ≃L[ℝ] ℂ) (z : ℂ) : dualMap (A.trans B) z = dualMap B (dualMap A z) := by change (ContinuousLinearMap.adjoint (A.symm.toContinuousLinearMap.comp B.symm.toContinuousLinearMap)) z = _ rw [ContinuousLinearMap.adjoint_comp] rfl theorem dual_basis_apply (w : ℂ) (hw : w.im ≠ 0) (z : ℂ) : dualMap (basisEquiv w hw) z = complexPoint z.re ((z.im - w.re * z.re) / w.im) := by apply ext_inner_left ℝ intro v rw [dualMap, ContinuousLinearMap.adjoint_inner_right] change inner ℝ ((basisEquiv w hw).symm v) z = _ simp only [basisEquiv_symm_apply, Complex.inner, complexPoint, Complex.mul_re, Complex.conj_re, Complex.conj_im] field_simp [hw] ring theorem dual_mul_apply (c : ℂ) (hc : c ≠ 0) (z : ℂ) : dualMap (complexMulEquiv c hc) z = (starRingEnd ℂ c)⁻¹ * z := by apply ext_inner_left ℝ intro v rw [dualMap, ContinuousLinearMap.adjoint_inner_right] change inner ℝ (c⁻¹ * v) z = _ simp only [Complex.inner, map_mul, map_inv₀] congr 1 ring theorem eisensteinDualFrequency_explicit (c : ℂ) (hc : c ≠ 0) (p : ℤ × ℤ) : eisensteinDualFrequency c hc p = complexPoint (p.1 : ℝ) (((p.1 : ℝ) + 2 * (p.2 : ℝ)) / Real.sqrt 3) / starRingEnd ℂ c := by unfold eisensteinDualFrequency eisensteinLatticeMap scaledBasisEquiv rw [dualMap_trans, dual_basis_apply, dual_mul_apply] have he : complexPoint (complexPoint (p.1 : ℝ) (p.2 : ℝ)).re (((complexPoint (p.1 : ℝ) (p.2 : ℝ)).im - omega3.re * (complexPoint (p.1 : ℝ) (p.2 : ℝ)).re) / omega3.im) = complexPoint (p.1 : ℝ) (((p.1 : ℝ) + 2 * (p.2 : ℝ)) / Real.sqrt 3) := by apply Complex.ext · rfl · simp only [complexPoint, omega3_im] have hr : omega3.re = -(1 / 2 : ℝ) := by norm_num [omega3] rw [hr] ring rw [he] ring def explicitDualFrequency (c : ℂ) (p : ℤ × ℤ) : ℂ := complexPoint (p.1 : ℝ) (((p.1 : ℝ) + 2 * (p.2 : ℝ)) / Real.sqrt 3) / starRingEnd ℂ c theorem actual_eisenstein_poisson_explicit (f : 𝓢(ℂ, ℂ)) (c : O) (hc : c ≠ 0) (P : O ⧸ Ideal.span {c} → ℂ) : letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ (∑' z : O, P (Ideal.Quotient.mk (Ideal.span {c}) z) * f (eisEmbedding z)) = (2 / (Real.sqrt 3 * ‖eisEmbedding c‖ ^ 2)) • ∑' p : ℤ × ℤ, (∑ r : O ⧸ Ideal.span {c}, P r * (Real.fourierChar (inner ℝ (eisEmbedding (GaussianShiftedPartition.representative c r)) (explicitDualFrequency (eisEmbedding c) p)) : ℂ)) * (𝓕 f) (explicitDualFrequency (eisEmbedding c) p) := by simpa only [eisensteinDualFrequency_explicit, explicitDualFrequency] using actual_eisenstein_periodic_fourier f c hc P open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open scoped FourierTransform SchwartzMap RealInnerProductSpace ContDiff def radialTest (W : 𝓢(ℝ, ℂ)) : 𝓢(ℂ, ℂ) := SchwartzMap.compCLM ℂ (Function.hasTemperateGrowth_norm_sq ℂ) ⟨1, 1, fun z => by simp only [pow_one, one_mul, norm_pow, Real.norm_of_nonneg (norm_nonneg z)] nlinarith [sq_nonneg (‖z‖ - 1)]⟩ W theorem radialTest_apply (W : 𝓢(ℝ, ℂ)) (z : ℂ) : radialTest W z = W (‖z‖ ^ 2) := rfl end EisensteinSchwartzPoisson open scoped BigOperators Classical namespace IdealGaussCRT noncomputable def coordinateAddChar {ι T : Type*} [Fintype ι] (R : ι → Type*) [CommRing T] [∀ i, CommRing (R i)] (e : T ≃+* ∀ i, R i) (ψ : AddChar T ℂ) (i : ι) : AddChar (R i) ℂ := by classical exact { toFun := fun z => ψ (e.symm (Pi.single i z)) map_zero_eq_one' := by simp map_add_eq_mul' := by intro z w rw [Pi.single_add, map_add, AddChar.map_add_eq_mul] } private theorem addChar_finite_sum {ι T : Type*} [AddCommMonoid T] (ψ : AddChar T ℂ) (s : Finset ι) (f : ι → T) : ψ (∑ i ∈ s, f i) = ∏ i ∈ s, ψ (f i) := by classical induction s using Finset.induction_on with | empty => simp | @insert a s ha ih => simp [ha, AddChar.map_add_eq_mul, ih] theorem addChar_finite_crt_factor {ι T : Type*} [Fintype ι] (R : ι → Type*) [CommRing T] [∀ i, CommRing (R i)] (e : T ≃+* ∀ i, R i) (ψ : AddChar T ℂ) (x : T) : ψ x = ∏ i, coordinateAddChar R e ψ i (e x i) := by classical have hx : (∑ i, e.symm (Pi.single i (e x i))) = x := by rw [← map_sum, Finset.univ_sum_single, e.symm_apply_apply] calc ψ x = ψ (∑ i, e.symm (Pi.single i (e x i))) := congrArg ψ hx.symm _ = ∏ i, ψ (e.symm (Pi.single i (e x i))) := addChar_finite_sum ψ _ _ _ = _ := rfl theorem gauss_transform_finite_crt {ι T : Type*} [Fintype ι] (R : ι → Type*) [CommRing T] [∀ i, Field (R i)] [Fintype T] [∀ i, Fintype (R i)] (e : T ≃+* ∀ i, R i) (χ : ∀ i, MulChar (R i) ℂ) (ψ : AddChar T ℂ) (hχ : ∀ i, χ i ≠ 1) (h : T) : (∑ x : T, (∏ i, χ i (e x i)) * ψ (h * x)) = ∏ i, if e h i = 0 then 0 else (χ i (e h i))⁻¹ * gaussSum (χ i) (coordinateAddChar R e ψ i) := by classical calc (∑ x : T, (∏ i, χ i (e x i)) * ψ (h * x)) = ∑ x : T, ∏ i, χ i (e x i) * coordinateAddChar R e ψ i (e h i * e x i) := by apply Finset.sum_congr rfl intro x _ rw [addChar_finite_crt_factor R e ψ (h * x)] simp only [map_mul, Pi.mul_apply, Finset.prod_mul_distrib] _ = ∑ x : ∀ i, R i, ∏ i, χ i (x i) * coordinateAddChar R e ψ i (e h i * x i) := Equiv.sum_comp e.toEquiv (fun z : ∀ i, R i => ∏ i, χ i (z i) * coordinateAddChar R e ψ i (e h i * z i)) _ = _ := ShortDraftFiniteGaussFourier.product_gauss_transform R χ (coordinateAddChar R e ψ) hχ (e h) theorem gauss_transform_finite_crt_scalar {ι T : Type*} [Fintype ι] (R : ι → Type*) [CommRing T] [∀ i, Field (R i)] [Fintype T] [∀ i, Fintype (R i)] (e : T ≃+* ∀ i, R i) (χ : ∀ i, MulChar (R i) ℂ) (ψ : AddChar T ℂ) (hχ : ∀ i, χ i ≠ 1) (h : T) : (∑ x : T, (∏ i, χ i (e x i)) * ψ (h * x)) = (∏ i, χ i (e h i))⁻¹ * ∑ x : T, (∏ i, χ i (e x i)) * ψ x := by classical have hbase := gauss_transform_finite_crt R e χ ψ hχ (1 : T) simp only [one_mul, map_one, Pi.one_apply, one_ne_zero, ↓reduceIte, inv_one, one_mul] at hbase rw [gauss_transform_finite_crt R e χ ψ hχ h, hbase] have hlocal (i : ι) : (if e h i = 0 then 0 else (χ i (e h i))⁻¹ * gaussSum (χ i) (coordinateAddChar R e ψ i)) = (χ i (e h i))⁻¹ * gaussSum (χ i) (coordinateAddChar R e ψ i) := by split_ifs with hi · simp [hi] · rfl simp_rw [hlocal] rw [Finset.prod_mul_distrib, Finset.prod_inv_distrib] theorem finite_prod_eq_iInf {ι A : Type*} [Fintype ι] [CommRing A] (P : ι → Ideal A) (hc : Pairwise (Function.onFun IsCoprime P)) : (∏ i, P i) = ⨅ i, P i := by simpa using (Ideal.prod_eq_iInf_of_pairwise_isCoprime (s := Finset.univ) (J := P) (by intro i _ j _ hij exact hc hij)) noncomputable def quotientProdEquivPi {ι A : Type*} [Fintype ι] [CommRing A] (P : ι → Ideal A) (hc : Pairwise (Function.onFun IsCoprime P)) : (A ⧸ ∏ i, P i) ≃+* ∀ i, A ⧸ P i := (Ideal.quotEquivOfEq (finite_prod_eq_iInf P hc)).trans (Ideal.quotientInfRingEquivPiQuotient P hc) theorem quotientProdEquivPi_mk {ι A : Type*} [Fintype ι] [CommRing A] (P : ι → Ideal A) (hc : Pairwise (Function.onFun IsCoprime P)) (a : A) (i : ι) : quotientProdEquivPi P hc (Ideal.Quotient.mk (∏ j, P j) a) i = Ideal.Quotient.mk (P i) a := by simp only [quotientProdEquivPi, RingEquiv.trans_apply, Ideal.quotEquivOfEq_mk] rfl end IdealGaussCRT end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.SexticRadialPoisson namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace ActualEisensteinCubic noncomputable def finiteSexticQuotientRow {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hc : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (x : O ⧸ ∏ i, P i) : ℂ := ∏ i, (canonicalSextic (P i) (hgood i) ^ j i) (IdealGaussCRT.quotientProdEquivPi P hc x i) theorem finiteSexticQuotientRow_mk_eq_zero_iff {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hc : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (a : O) : finiteSexticQuotientRow P hc hgood j (Ideal.Quotient.mk (∏ i, P i) a) = 0 ↔ ∃ i, a ∈ P i := by classical let (i : ι) : Field (O ⧸ P i) := Ideal.Quotient.field (P i) simp only [finiteSexticQuotientRow, IdealGaussCRT.quotientProdEquivPi_mk, Finset.prod_eq_zero_iff, Finset.mem_univ, true_and, MulChar.apply_eq_zero_iff, isUnit_iff_ne_zero, not_not, Ideal.Quotient.eq_zero_iff_mem] theorem canonical_finite_prime_gauss_transform_scalar {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hc : Pairwise (Function.onFun IsCoprime P)) [Fintype (O ⧸ ∏ i, P i)] [∀ i, Fintype (O ⧸ P i)] (hgood : ∀ i, lambda ∉ P i) (hchar : ∀ i, ringChar (O ⧸ P i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) (ψ : AddChar (O ⧸ ∏ i, P i) ℂ) (h : O ⧸ ∏ i, P i) : (∑ x : O ⧸ ∏ i, P i, finiteSexticQuotientRow P hc hgood j x * ψ (h * x)) = (finiteSexticQuotientRow P hc hgood j h)⁻¹ * ∑ x : O ⧸ ∏ i, P i, finiteSexticQuotientRow P hc hgood j x * ψ x := by let (i : ι) : Field (O ⧸ P i) := Ideal.Quotient.field (P i) exact IdealGaussCRT.gauss_transform_finite_crt_scalar (fun i => O ⧸ P i) (IdealGaussCRT.quotientProdEquivPi P hc) (fun i => canonicalSextic (P i) (hgood i) ^ j i) ψ (fun i => canonicalSextic_pow_ne_one (P i) (hgood i) (hchar i) (hj0 i) (hj6 i)) h theorem finiteSexticQuotientRow_inv_eq_star {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hc : Pairwise (Function.onFun IsCoprime P)) [∀ i, Fintype (O ⧸ P i)] (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (h : O ⧸ ∏ i, P i) : (finiteSexticQuotientRow P hc hgood j h)⁻¹ = star (finiteSexticQuotientRow P hc hgood j h) := by classical simp only [finiteSexticQuotientRow, star_prod] rw [← Finset.prod_inv_distrib] apply Finset.prod_congr rfl intro i _ rw [MulChar.star_apply', MulChar.inv_apply_eq_inv'] theorem canonical_finite_prime_gauss_transform_conj {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hc : Pairwise (Function.onFun IsCoprime P)) [Fintype (O ⧸ ∏ i, P i)] [∀ i, Fintype (O ⧸ P i)] (hgood : ∀ i, lambda ∉ P i) (hchar : ∀ i, ringChar (O ⧸ P i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) (ψ : AddChar (O ⧸ ∏ i, P i) ℂ) (h : O ⧸ ∏ i, P i) : (∑ x : O ⧸ ∏ i, P i, finiteSexticQuotientRow P hc hgood j x * ψ (h * x)) = star (finiteSexticQuotientRow P hc hgood j h) * ∑ x : O ⧸ ∏ i, P i, finiteSexticQuotientRow P hc hgood j x * ψ x := by rw [canonical_finite_prime_gauss_transform_scalar P hc hgood hchar j hj0 hj6 ψ, finiteSexticQuotientRow_inv_eq_star] end ActualEisensteinCubic namespace EisensteinSchwartzPoisson open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic MeasureTheory open scoped FourierTransform SchwartzMap RealInnerProductSpace def paperE (z : ℂ) : ℂ := ShortDraftTrace.breveE (z / eisLam) def paperFrequency (u : ℂ) : ℂ := (2 * Complex.I / (Real.sqrt 3 : ℂ)) * (starRingEnd ℂ u) theorem paperE_eq_exp (z : ℂ) : paperE z = Complex.exp (4 * Real.pi * Complex.I * (z.im / Real.sqrt 3)) := by exact ShortDraftTrace.breveE_div_lam_eq_e z theorem inner_paperFrequency (z u : ℂ) : inner ℝ z (paperFrequency u) = 2 * (z * u).im / Real.sqrt 3 := by have hs : Real.sqrt 3 ≠ 0 := ne_of_gt (Real.sqrt_pos.mpr (by norm_num)) rw [Complex.inner] simp only [paperFrequency, Complex.mul_re, Complex.mul_im, Complex.div_re, Complex.div_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, Complex.conj_re, Complex.conj_im, Complex.normSq_ofReal] norm_num field_simp rw [Real.sq_sqrt (by norm_num)] theorem fourierChar_paperFrequency (z u : ℂ) : (Real.fourierChar (inner ℝ z (paperFrequency u)) : ℂ) = paperE (z * u) := by rw [inner_paperFrequency, paperE_eq_exp, Real.fourierChar_apply] congr 1 push_cast ring theorem dualFrequencyEquiv_coordinates (p : ℤ × ℤ) : eisEmbedding (dualFrequencyEquiv p) = complexPoint ((p.1 : ℝ) / 2 + (p.2 : ℝ)) (Real.sqrt 3 * (p.1 : ℝ) / 2) := by change eisEmbedding (ActualEisensteinCoordinates.eval (p.1 + p.2) p.1) = _ rw [eisEmbedding_eval] apply Complex.ext <;> norm_num [complexPoint, omega3] <;> ring theorem explicitDualFrequency_eq_paperFrequency (c : ℂ) (p : ℤ × ℤ) : explicitDualFrequency c p = paperFrequency (eisEmbedding (dualFrequencyEquiv p) / c) := by have hs : Real.sqrt 3 ≠ 0 := ne_of_gt (Real.sqrt_pos.mpr (by norm_num)) have hnum : complexPoint (p.1 : ℝ) (((p.1 : ℝ) + 2 * (p.2 : ℝ)) / Real.sqrt 3) = (2 * Complex.I / (Real.sqrt 3 : ℂ)) * starRingEnd ℂ (eisEmbedding (dualFrequencyEquiv p)) := by rw [dualFrequencyEquiv_coordinates] apply Complex.ext <;> norm_num [complexPoint, Complex.div_re, Complex.div_im] <;> field_simp <;> simp only [Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 3)] unfold explicitDualFrequency paperFrequency rw [map_div₀, hnum] ring theorem explicitDualFrequency_phase (r c : ℂ) (p : ℤ × ℤ) : (Real.fourierChar (inner ℝ r (explicitDualFrequency c p)) : ℂ) = paperE (r * eisEmbedding (dualFrequencyEquiv p) / c) := by rw [explicitDualFrequency_eq_paperFrequency, fourierChar_paperFrequency] congr 1 ring theorem paperFrequency_norm_sq (u : ℂ) : ‖paperFrequency u‖ ^ 2 = (4 / 3 : ℝ) * ‖u‖ ^ 2 := by have hnorm : ‖(2 * Complex.I / (Real.sqrt 3 : ℂ))‖ ^ 2 = (4 / 3 : ℝ) := by rw [norm_div, norm_mul] norm_num [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg 3), div_pow, Real.sq_sqrt] rw [paperFrequency, norm_mul, mul_pow, Complex.norm_conj, hnorm] def paperFourier (f : ℂ → ℂ) (u : ℂ) : ℂ := (2 / Real.sqrt 3 : ℝ) • ∫ z : ℂ, paperE (-(z * u)) * f z theorem paperFourier_eq_standard (f : ℂ → ℂ) (u : ℂ) : paperFourier f u = (2 / Real.sqrt 3 : ℝ) • 𝓕 f (paperFrequency u) := by unfold paperFourier congr 1 rw [Real.fourier_eq] apply integral_congr_ae filter_upwards [] with z simp only [Circle.smul_def, smul_eq_mul] have hp : (Real.fourierChar (-inner ℝ z (paperFrequency u)) : ℂ) = paperE (-(z * u)) := by simpa only [inner_neg_left, neg_mul] using fourierChar_paperFrequency (-z) u rw [hp] theorem eisTraceModChar_eq_paperE (c : O) (hc : c ≠ 0) (z : O) : eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc (Ideal.Quotient.mk (Ideal.span {c}) z) = paperE (eisEmbedding z / eisEmbedding c) := by rw [eisTraceModChar, IdealGaussCRT.traceModChar_mk] unfold paperE congr 1 ring theorem eisTraceModChar_frequency (c : O) (hc : c ≠ 0) (h : O) (r : O ⧸ Ideal.span {c}) : eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc (Ideal.Quotient.mk (Ideal.span {c}) h * r) = paperE (eisEmbedding (GaussianShiftedPartition.representative c r) * eisEmbedding h / eisEmbedding c) := by conv_lhs => rw [← GaussianShiftedPartition.representative_spec c r, ← map_mul] rw [eisTraceModChar_eq_paperE, map_mul] congr 1 ring theorem actual_eisenstein_paper_poisson (f : 𝓢(ℂ, ℂ)) (c : O) (hc : c ≠ 0) (P : O ⧸ Ideal.span {c} → ℂ) : letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ (∑' z : O, P (Ideal.Quotient.mk (Ideal.span {c}) z) * f (eisEmbedding z)) = (1 / ‖eisEmbedding c‖ ^ 2 : ℝ) • ∑' h : O, (∑ r : O ⧸ Ideal.span {c}, P r * paperE (eisEmbedding (GaussianShiftedPartition.representative c r) * eisEmbedding h / eisEmbedding c)) * paperFourier f (eisEmbedding h / eisEmbedding c) := by classical let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let A : O → ℂ := fun h => ∑ r : O ⧸ Ideal.span {c}, P r * paperE (eisEmbedding (GaussianShiftedPartition.representative c r) * eisEmbedding h / eisEmbedding c) have ht : (∑' h : O, A h * paperFourier f (eisEmbedding h / eisEmbedding c)) = (2 / Real.sqrt 3 : ℝ) • ∑' p : ℤ × ℤ, A (dualFrequencyEquiv p) * (𝓕 f) (explicitDualFrequency (eisEmbedding c) p) := by calc _ = ∑' p : ℤ × ℤ, A (dualFrequencyEquiv p) * paperFourier f (eisEmbedding (dualFrequencyEquiv p) / eisEmbedding c) := (dualFrequencyEquiv.tsum_eq _).symm _ = ∑' p : ℤ × ℤ, (2 / Real.sqrt 3 : ℝ) • (A (dualFrequencyEquiv p) * (𝓕 f) (explicitDualFrequency (eisEmbedding c) p)) := by apply tsum_congr intro p rw [paperFourier_eq_standard, ← explicitDualFrequency_eq_paperFrequency] change A (dualFrequencyEquiv p) * ((2 / Real.sqrt 3 : ℝ) • (𝓕 f) (explicitDualFrequency (eisEmbedding c) p)) = _ simp only [Algebra.smul_def] ring _ = _ := tsum_const_smul'' _ rfl have hp := actual_eisenstein_poisson_explicit f c hc P simp_rw [explicitDualFrequency_phase] at hp change _ = (1 / ‖eisEmbedding c‖ ^ 2 : ℝ) • ∑' h : O, A h * paperFourier f (eisEmbedding h / eisEmbedding c) rw [ht, smul_smul] convert hp using 1 congr 1 ring theorem actual_eisenstein_paper_poisson_trace (f : 𝓢(ℂ, ℂ)) (c : O) (hc : c ≠ 0) (P : O ⧸ Ideal.span {c} → ℂ) : letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc (∑' z : O, P (Ideal.Quotient.mk (Ideal.span {c}) z) * f (eisEmbedding z)) = (1 / ‖eisEmbedding c‖ ^ 2 : ℝ) • ∑' h : O, (∑ r : O ⧸ Ideal.span {c}, P r * ψ (Ideal.Quotient.mk (Ideal.span {c}) h * r)) * paperFourier f (eisEmbedding h / eisEmbedding c) := by classical let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ simpa only [eisTraceModChar_frequency] using actual_eisenstein_paper_poisson f c hc P open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic MeasureTheory open scoped FourierTransform SchwartzMap RealInnerProductSpace ContDiff theorem paperFourier_comp_mul (f : ℂ → ℂ) (a : ℂ) (ha : a ≠ 0) (u : ℂ) : paperFourier (fun z => f (a * z)) u = (1 / ‖a‖ ^ 2 : ℝ) • paperFourier f (u / a) := by have hd : dualMap (complexMulEquiv a ha) (paperFrequency u) = paperFrequency (u / a) := by rw [dual_mul_apply] unfold paperFrequency rw [map_div₀] ring have hj : inverseJacobian (complexMulEquiv a ha) = 1 / ‖a‖ ^ 2 := by rw [inverseJacobian, complexMulEquiv_det, abs_inv, abs_of_nonneg (Complex.normSq_nonneg a), Complex.sq_norm] ring rw [paperFourier_eq_standard, paperFourier_eq_standard] have hF := fourier_comp_linearEquiv (complexMulEquiv a ha) f (paperFrequency u) simp only [Function.comp_def, complexMulEquiv_apply] at hF rw [hF, hd, hj, smul_smul, smul_smul] congr 1 ring def paperRadialFourier (W : ℝ → ℂ) (t : ℝ) : ℂ := paperFourier (fun z => W (‖z‖ ^ 2)) (Real.sqrt t : ℂ) theorem paperFourier_radial (W : ℝ → ℂ) (u : ℂ) : paperFourier (fun z => W (‖z‖ ^ 2)) u = paperRadialFourier W (‖u‖ ^ 2) := by unfold paperRadialFourier rw [Real.sqrt_sq (norm_nonneg u)] by_cases hu : u = 0 · simp [hu] have hn : ‖u‖ ≠ 0 := norm_ne_zero_iff.mpr hu have hnC : (‖u‖ : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hn let a : ℂ := u / (‖u‖ : ℂ) have ha : a ≠ 0 := div_ne_zero hu hnC have hna : ‖a‖ = 1 := by simp [a, Complex.norm_real, hn] have hq : u / a = (‖u‖ : ℂ) := by dsimp [a] field_simp have hfun : (fun z : ℂ => W (‖a * z‖ ^ 2)) = fun z : ℂ => W (‖z‖ ^ 2) := by funext z rw [norm_mul, hna, one_mul] have hF := paperFourier_comp_mul (fun z => W (‖z‖ ^ 2)) a ha u rw [hfun, hna, hq] at hF simpa using hF theorem inverseSqrt_ne_zero (K : ℝ) (hK : 0 < K) : (Real.sqrt K : ℂ)⁻¹ ≠ 0 := inv_ne_zero (Complex.ofReal_ne_zero.mpr (ne_of_gt (Real.sqrt_pos.mpr hK))) theorem inverseSqrt_norm_sq (K : ℝ) (hK : 0 < K) : ‖(Real.sqrt K : ℂ)⁻¹‖ ^ 2 = 1 / K := by rw [norm_inv, inv_pow] simp only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg K), Real.sq_sqrt hK.le, one_div] theorem paperFourier_radial_scaled (W : ℝ → ℂ) (K : ℝ) (hK : 0 < K) (u : ℂ) : paperFourier (fun z => W (‖z‖ ^ 2 / K)) u = K • paperRadialFourier W (K * ‖u‖ ^ 2) := by let a : ℂ := (Real.sqrt K : ℂ)⁻¹ have ha : a ≠ 0 := inverseSqrt_ne_zero K hK have hna : ‖a‖ ^ 2 = 1 / K := inverseSqrt_norm_sq K hK have hfun : (fun z : ℂ => W (‖a * z‖ ^ 2)) = fun z : ℂ => W (‖z‖ ^ 2 / K) := by funext z rw [norm_mul, mul_pow, hna] congr 1 ring have hnorm : ‖u / a‖ ^ 2 = K * ‖u‖ ^ 2 := by rw [norm_div, div_pow, hna] field_simp have hF := paperFourier_comp_mul (fun z => W (‖z‖ ^ 2)) a ha u rw [hfun, hna, one_div_one_div, paperFourier_radial, hnorm] at hF exact hF def scaledRadialTest (W : 𝓢(ℝ, ℂ)) (K : ℝ) (hK : 0 < K) : 𝓢(ℂ, ℂ) := affinePullback (radialTest W) (complexMulEquiv ((Real.sqrt K : ℂ)⁻¹) (inverseSqrt_ne_zero K hK)) 0 theorem scaledRadialTest_apply (W : 𝓢(ℝ, ℂ)) (K : ℝ) (hK : 0 < K) (z : ℂ) : scaledRadialTest W K hK z = W (‖z‖ ^ 2 / K) := by simp only [scaledRadialTest, affinePullback_apply, complexMulEquiv_apply, add_zero, radialTest_apply, norm_mul, mul_pow, inverseSqrt_norm_sq K hK] congr 1 ring theorem paperFourier_scaledRadialTest (W : 𝓢(ℝ, ℂ)) (K : ℝ) (hK : 0 < K) (u : ℂ) : paperFourier (scaledRadialTest W K hK) u = K • paperRadialFourier W (K * ‖u‖ ^ 2) := by change paperFourier (fun z => scaledRadialTest W K hK z) u = _ simp only [scaledRadialTest_apply] exact paperFourier_radial_scaled W K hK u theorem actual_radial_paper_poisson_trace (W : 𝓢(ℝ, ℂ)) (K : ℝ) (hK : 0 < K) (c : O) (hc : c ≠ 0) (P : O ⧸ Ideal.span {c} → ℂ) : letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc (∑' z : O, P (Ideal.Quotient.mk (Ideal.span {c}) z) * W (‖eisEmbedding z‖ ^ 2 / K)) = (K / ‖eisEmbedding c‖ ^ 2 : ℝ) • ∑' h : O, (∑ r : O ⧸ Ideal.span {c}, P r * ψ (Ideal.Quotient.mk (Ideal.span {c}) h * r)) * paperRadialFourier W (K * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2) := by classical let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc let A : O → ℂ := fun h => ∑ r : O ⧸ Ideal.span {c}, P r * ψ (Ideal.Quotient.mk (Ideal.span {c}) h * r) have ht : (∑' h : O, A h * paperFourier (scaledRadialTest W K hK) (eisEmbedding h / eisEmbedding c)) = K • ∑' h : O, A h * paperRadialFourier W (K * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2) := by calc _ = ∑' h : O, K • (A h * paperRadialFourier W (K * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2)) := by apply tsum_congr intro h rw [paperFourier_scaledRadialTest, norm_div, div_pow] have hr : K * (‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2) = K * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2 := by ring rw [hr] simp only [Algebra.smul_def] ring _ = _ := tsum_const_smul'' _ have hp := actual_eisenstein_paper_poisson_trace (scaledRadialTest W K hK) c hc P change (∑' z : O, P (Ideal.Quotient.mk (Ideal.span {c}) z) * scaledRadialTest W K hK (eisEmbedding z)) = (1 / ‖eisEmbedding c‖ ^ 2 : ℝ) • ∑' h : O, A h * paperFourier (scaledRadialTest W K hK) (eisEmbedding h / eisEmbedding c) at hp rw [ht, smul_smul] at hp simpa only [scaledRadialTest_apply, one_div_mul_eq_div] using hp end EisensteinSchwartzPoisson open scoped BigOperators Classical SchwartzMap ContDiff namespace ActualEisensteinCubic open ConcreteTraceCRT EisensteinSchwartzPoisson def finiteSexticRow {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (a : O) : ℂ := ∏ i, (canonicalSextic (P i) (hgood i) ^ j i) (Ideal.Quotient.mk (P i) a) theorem finiteSexticRow_mul {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (a b : O) : finiteSexticRow P hgood j (a * b) = finiteSexticRow P hgood j a * finiteSexticRow P hgood j b := by simp only [finiteSexticRow, map_mul, Finset.prod_mul_distrib] theorem finite_prime_product_ne_bot {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] : (∏ i, P i) ≠ ⊥ := by change (∏ i, P i) ≠ 0 apply Finset.prod_ne_zero_iff.mpr intro i _ exact NeZero.ne (P i) def finitePrimeModulus {ι : Type*} [Fintype ι] (P : ι → Ideal O) : O := ConcretePrimeRowBridge.idealGenerator (∏ i, P i) theorem span_finitePrimeModulus {ι : Type*} [Fintype ι] (P : ι → Ideal O) : Ideal.span {finitePrimeModulus P} = ∏ i, P i := ConcretePrimeRowBridge.span_idealGenerator _ theorem finitePrimeModulus_ne_zero {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] : finitePrimeModulus P ≠ 0 := by intro hz have hspan := span_finitePrimeModulus P rw [hz] at hspan exact finite_prime_product_ne_bot P (by simpa using hspan.symm) theorem eisEmbedding_norm_sq_eq_absNorm_span (a : O) : ‖eisEmbedding a‖ ^ 2 = (Ideal.absNorm (Ideal.span {a}) : ℝ) := by open ActualEisensteinCoordinates ShortDraftLatticeCount in have hnorm : ‖eisEmbedding a‖ ^ 2 = (q (coords a) : ℝ) := by simpa only [eval_coords, q, pow_two] using eisEmbedding_eval_norm_sq (coords a).1 (coords a).2 have hNat : (qNat a : ℤ) = q (coords a) := Int.toNat_of_nonneg (qO_nonneg a) have hNatR := congrArg (fun n : ℤ => (n : ℝ)) hNat simp only [Int.cast_natCast] at hNatR rw [← qNat_eq_absNorm_span, hNatR] exact hnorm theorem finitePrimeModulus_norm_sq {ι : Type*} [Fintype ι] (P : ι → Ideal O) : ‖eisEmbedding (finitePrimeModulus P)‖ ^ 2 = (Ideal.absNorm (∏ i, P i) : ℝ) := by rw [eisEmbedding_norm_sq_eq_absNorm_span, span_finitePrimeModulus] def principalSexticRow {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (c : O) (hc : Ideal.span {c} = ∏ i, P i) (r : O ⧸ Ideal.span {c}) : ℂ := finiteSexticQuotientRow P hcop hgood j (Ideal.quotEquivOfEq hc r) theorem principalSexticRow_mk {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (c : O) (hc : Ideal.span {c} = ∏ i, P i) (a : O) : principalSexticRow P hcop hgood j c hc (Ideal.Quotient.mk (Ideal.span {c}) a) = finiteSexticRow P hgood j a := by simp only [principalSexticRow, finiteSexticQuotientRow, Ideal.quotEquivOfEq_mk, IdealGaussCRT.quotientProdEquivPi_mk, finiteSexticRow] theorem canonical_principal_gauss_transform {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) [Fintype (O ⧸ ∏ i, P i)] [∀ i, Fintype (O ⧸ P i)] (hgood : ∀ i, lambda ∉ P i) (hchar : ∀ i, ringChar (O ⧸ P i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) (c : O) (hc : Ideal.span {c} = ∏ i, P i) [Fintype (O ⧸ Ideal.span {c})] (ψ : AddChar (O ⧸ Ideal.span {c}) ℂ) (h : O ⧸ Ideal.span {c}) : (∑ r : O ⧸ Ideal.span {c}, principalSexticRow P hcop hgood j c hc r * ψ (h * r)) = star (principalSexticRow P hcop hgood j c hc h) * ∑ r : O ⧸ Ideal.span {c}, principalSexticRow P hcop hgood j c hc r * ψ r := by let e := Ideal.quotEquivOfEq hc let row := finiteSexticQuotientRow P hcop hgood j let φ : AddChar (O ⧸ ∏ i, P i) ℂ := ψ.compAddMonoidHom e.symm.toAddMonoidHom have hleft : (∑ r : O ⧸ Ideal.span {c}, row (e r) * ψ (h * r)) = ∑ x : O ⧸ ∏ i, P i, row x * φ (e h * x) := by rw [← Equiv.sum_comp e.toEquiv (fun x => row x * φ (e h * x))] apply Finset.sum_congr rfl intro r _ change row (e r) * ψ (h * r) = row (e r) * ψ (e.symm (e h * e r)) rw [← map_mul, e.symm_apply_apply] have hbase : (∑ r : O ⧸ Ideal.span {c}, row (e r) * ψ r) = ∑ x : O ⧸ ∏ i, P i, row x * φ x := by rw [← Equiv.sum_comp e.toEquiv (fun x => row x * φ x)] apply Finset.sum_congr rfl intro r _ change row (e r) * ψ r = row (e r) * ψ (e.symm (e r)) rw [e.symm_apply_apply] change (∑ r : O ⧸ Ideal.span {c}, row (e r) * ψ (h * r)) = star (row (e h)) * ∑ r : O ⧸ Ideal.span {c}, row (e r) * ψ r rw [hleft, hbase] exact canonical_finite_prime_gauss_transform_conj P hcop hgood hchar j hj0 hj6 φ (e h) theorem canonical_radial_poisson {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (hchar : ∀ i, ringChar (O ⧸ P i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : let c := finitePrimeModulus P let hc0 := finitePrimeModulus_ne_zero P letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc0 letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let row := principalSexticRow P hcop hgood j c (span_finitePrimeModulus P) let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc0 (∑' z : O, finiteSexticRow P hgood j z * W (‖eisEmbedding z‖ ^ 2 / scale)) = (scale / ‖eisEmbedding c‖ ^ 2 : ℝ) • ∑' h : O, (star (finiteSexticRow P hgood j h) * (∑ r, row r * ψ r)) * paperRadialFourier W (scale * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2) := by classical let c := finitePrimeModulus P have hc0 : c ≠ 0 := finitePrimeModulus_ne_zero P let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc0 let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let e := Ideal.quotEquivOfEq (span_finitePrimeModulus P) let : Fintype (O ⧸ ∏ i, P i) := Fintype.ofEquiv (O ⧸ Ideal.span {c}) e.toEquiv let (i : ι) : Fintype (O ⧸ P i) := Fintype.ofFinite _ let row := principalSexticRow P hcop hgood j c (span_finitePrimeModulus P) let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc0 have ht (h : O) : (∑ r : O ⧸ Ideal.span {c}, row r * ψ (Ideal.Quotient.mk (Ideal.span {c}) h * r)) = star (finiteSexticRow P hgood j h) * (∑ r, row r * ψ r) := by rw [canonical_principal_gauss_transform P hcop hgood hchar j hj0 hj6 c (span_finitePrimeModulus P) ψ, principalSexticRow_mk] have hp := actual_radial_paper_poisson_trace W scale hscale c hc0 row change (∑' z : O, row (Ideal.Quotient.mk (Ideal.span {c}) z) * W (‖eisEmbedding z‖ ^ 2 / scale)) = (scale / ‖eisEmbedding c‖ ^ 2 : ℝ) • ∑' h : O, (∑ r : O ⧸ Ideal.span {c}, row r * ψ (Ideal.Quotient.mk (Ideal.span {c}) h * r)) * paperRadialFourier W (scale * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2) at hp simp_rw [ht] at hp simpa only [row, principalSexticRow_mk] using hp def canonicalGaussSum {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) : ℂ := by let c := finitePrimeModulus P have hc0 : c ≠ 0 := finitePrimeModulus_ne_zero P letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc0 letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let row := principalSexticRow P hcop hgood j c (span_finitePrimeModulus P) let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc0 exact ∑ r, row r * ψ r def canonicalNormalizedGauss {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) : ℂ := canonicalGaussSum P hcop hgood j / (‖eisEmbedding (finitePrimeModulus P)‖ : ℂ) theorem canonical_radial_poisson_normalized {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (hchar : ∀ i, ringChar (O ⧸ P i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : let c := finitePrimeModulus P (∑' z : O, finiteSexticRow P hgood j z * W (‖eisEmbedding z‖ ^ 2 / scale)) = ((scale : ℂ) * canonicalNormalizedGauss P hcop hgood j / (‖eisEmbedding c‖ : ℂ)) * ∑' h : O, star (finiteSexticRow P hgood j h) * paperRadialFourier W (scale * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2) := by classical let c := finitePrimeModulus P let G := canonicalGaussSum P hcop hgood j let F : O → ℂ := fun h => star (finiteSexticRow P hgood j h) * paperRadialFourier W (scale * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2) have hp := canonical_radial_poisson P hcop hgood hchar j hj0 hj6 W scale hscale change (∑' z : O, finiteSexticRow P hgood j z * W (‖eisEmbedding z‖ ^ 2 / scale)) = (scale / ‖eisEmbedding c‖ ^ 2 : ℝ) • ∑' h : O, (star (finiteSexticRow P hgood j h) * G) * paperRadialFourier W (scale * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2) at hp have hsum : (∑' h : O, (star (finiteSexticRow P hgood j h) * G) * paperRadialFourier W (scale * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2)) = G * ∑' h : O, F h := by rw [← tsum_mul_left] apply tsum_congr intro h dsimp [F] ring rw [hsum] at hp rw [hp] change ((scale / ‖eisEmbedding c‖ ^ 2 : ℝ) : ℂ) * (G * ∑' h : O, F h) = ((scale : ℂ) * (G / (‖eisEmbedding c‖ : ℂ)) / (‖eisEmbedding c‖ : ℂ)) * ∑' h : O, F h have hn : (‖eisEmbedding c‖ : ℂ) ≠ 0 := by exact Complex.ofReal_ne_zero.mpr (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero (finitePrimeModulus_ne_zero P))) push_cast field_simp theorem finiteSexticRow_eq_zero_iff {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (a : O) : finiteSexticRow P hgood j a = 0 ↔ ∃ i, a ∈ P i := by classical let (i : ι) : Field (O ⧸ P i) := Ideal.Quotient.field (P i) simp only [finiteSexticRow, Finset.prod_eq_zero_iff, Finset.mem_univ, true_and, MulChar.apply_eq_zero_iff, isUnit_iff_ne_zero, not_not, Ideal.Quotient.eq_zero_iff_mem] theorem finiteSexticRow_zero {ι : Type*} [Fintype ι] [Nonempty ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) : finiteSexticRow P hgood j 0 = 0 := by rw [finiteSexticRow_eq_zero_iff] exact ⟨Classical.arbitrary ι, Ideal.zero_mem _⟩ theorem finiteSexticRow_radial_summable {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : Summable (fun z : O => finiteSexticRow P hgood j z * W (‖eisEmbedding z‖ ^ 2 / scale)) := by let c := finitePrimeModulus P have hc0 : c ≠ 0 := finitePrimeModulus_ne_zero P let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc0 let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ have hs := actual_eisenstein_periodic_summable (scaledRadialTest W scale hscale) (Ideal.Quotient.mk (Ideal.span {c})) (principalSexticRow P hcop hgood j c (span_finitePrimeModulus P)) simpa only [principalSexticRow_mk, scaledRadialTest_apply] using hs end ActualEisensteinCubic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.PrimeRows.IdealGenerators namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical namespace ConcretePrimeRowBridge theorem idealGenerator_ne_zero (J : Ideal O) (hJ : J ≠ ⊥) : idealGenerator J ≠ 0 := by intro h apply hJ rw [← span_idealGenerator J, h] simp theorem tsum_ideal_eq_tsum_generator (J : Ideal O) (hJ : J ≠ ⊥) (f : O → ℂ) : (∑' u : O, if u ∈ J then f u else 0) = ∑' z : O, f (idealGenerator J * z) := by let d := idealGenerator J have hd : d ≠ 0 := idealGenerator_ne_zero J hJ let F : O → ℂ := fun u => if u ∈ J then f u else 0 have hrange : Function.support F ⊆ Set.range (fun z : O => d * z) := by intro u hu have huJ : u ∈ J := by by_contra hn exact hu (by simp [F, hn]) rw [← span_idealGenerator J, Ideal.mem_span_singleton] at huJ obtain ⟨z, hz⟩ := huJ exact ⟨z, hz.symm⟩ have ht := (mul_right_injective₀ hd).tsum_eq hrange calc (∑' u : O, if u ∈ J then f u else 0) = ∑' z : O, F (d * z) := ht.symm _ = ∑' z : O, f (d * z) := by apply tsum_congr intro z have hz : d * z ∈ J := by rw [← span_idealGenerator J, Ideal.mem_span_singleton] exact ⟨z, rfl⟩ simp only [F, ite_eq_left hz] end ConcretePrimeRowBridge namespace ActualEisensteinCubic theorem tsum_rowCoprimeMask_subsets {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) (S : Finset ι) (f : O → ℂ) (hf : Summable f) : (∑' u : O, rowCoprimeMask P S u * f u) = ∑ E ∈ S.powerset, (-1 : ℂ) ^ E.card * ∑' u : O, if ∀ i ∈ E, u ∈ P i then f u else 0 := by have hterm (u : O) : rowCoprimeMask P S u * f u = ∑ E ∈ S.powerset, (-1 : ℂ) ^ E.card * (if ∀ i ∈ E, u ∈ P i then f u else 0) := by rw [rowCoprimeMask_subsets, Finset.sum_mul] apply Finset.sum_congr rfl intro E hE by_cases h : ∀ i ∈ E, u ∈ P i <;> simp [h] have hsum (E : Finset ι) : Summable (fun u : O => (-1 : ℂ) ^ E.card * (if ∀ i ∈ E, u ∈ P i then f u else 0)) := by have hi := hf.indicator {u : O | ∀ i ∈ E, u ∈ P i} simpa only [Set.indicator_apply, Set.mem_ofPred_eq] using hi.mul_left ((-1 : ℂ) ^ E.card) simp_rw [hterm] rw [Summable.tsum_finsetSum (fun E _ => hsum E)] apply Finset.sum_congr rfl intro E hE exact tsum_mul_left noncomputable def primeSubsetGenerator {ι : Type*} (P : ι → Ideal O) (E : Finset ι) : O := ConcretePrimeRowBridge.idealGenerator (∏ i ∈ E, P i) theorem primeSubsetGenerator_ne_zero {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (E : Finset ι) : primeSubsetGenerator P E ≠ 0 := by apply ConcretePrimeRowBridge.idealGenerator_ne_zero change (∏ i ∈ E, P i) ≠ 0 exact Finset.prod_ne_zero_iff.mpr (fun i _ => NeZero.ne (P i)) theorem tsum_rowCoprimeMask_dilations {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (f : O → ℂ) (hf : Summable f) : (∑' u : O, rowCoprimeMask P S u * f u) = ∑ E ∈ S.powerset, (UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) * ∑' z : O, f (primeSubsetGenerator P E * z) := by rw [tsum_rowCoprimeMask_subsets P S f hf] have hprime (i : ι) : Prime (P i) := Ideal.prime_of_isPrime (NeZero.ne (P i)) inferInstance apply Finset.sum_congr rfl intro E hE rw [prime_product_moebius P hprime hinj E] congr 1 have hJ : (∏ i ∈ E, P i) ≠ ⊥ := by change (∏ i ∈ E, P i) ≠ 0 exact Finset.prod_ne_zero_iff.mpr (fun i _ => NeZero.ne (P i)) calc _ = ∑' u : O, if u ∈ (∏ i ∈ E, P i) then f u else 0 := by apply tsum_congr intro u rw [mem_prime_product_iff P hinj E u] by_cases h : ∀ i ∈ E, u ∈ P i <;> simp [h] _ = _ := ConcretePrimeRowBridge.tsum_ideal_eq_tsum_generator _ hJ f open ConcreteTraceCRT theorem tsum_masked_radial_dilations {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (r : O → ℂ) (hr : ∀ a b, r (a * b) = r a * r b) (W : ℝ → ℂ) (scale : ℝ) (hsum : Summable (fun u : O => r u * W (‖eisEmbedding u‖ ^ 2 / scale))) : (∑' u : O, rowCoprimeMask P S u * r u * W (‖eisEmbedding u‖ ^ 2 / scale)) = ∑ E ∈ S.powerset, (UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) * r (primeSubsetGenerator P E) * ∑' z : O, r z * W (‖eisEmbedding z‖ ^ 2 / (scale / ‖eisEmbedding (primeSubsetGenerator P E)‖ ^ 2)) := by calc _ = ∑' u : O, rowCoprimeMask P S u * (r u * W (‖eisEmbedding u‖ ^ 2 / scale)) := by apply tsum_congr intro u ring _ = _ := by rw [tsum_rowCoprimeMask_dilations P hinj S _ hsum] apply Finset.sum_congr rfl intro E hE rw [mul_assoc] congr 1 rw [← tsum_mul_left] apply tsum_congr intro z rw [hr, map_mul, norm_mul, mul_pow, div_div_eq_mul_div] ring_nf open ConcreteTraceCRT EisensteinSchwartzPoisson theorem primeSubset_reducedScale_pos {α : Type*} (P : α → Ideal O) [∀ i, (P i).IsMaximal] (E : Finset α) {scale : ℝ} (hscale : 0 < scale) : 0 < scale / ‖eisEmbedding (primeSubsetGenerator P E)‖ ^ 2 := by exact div_pos hscale (sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero (primeSubsetGenerator_ne_zero P E)))) theorem canonical_masked_radial_dilations {α ι : Type*} [DecidableEq α] [Fintype ι] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset α) (Q : ι → Ideal O) [∀ i, (Q i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime Q)) (hgood : ∀ i, lambda ∉ Q i) (j : ι → ℕ) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : (∑' u : O, rowCoprimeMask P S u * finiteSexticRow Q hgood j u * W (‖eisEmbedding u‖ ^ 2 / scale)) = ∑ E ∈ S.powerset, (UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) * finiteSexticRow Q hgood j (primeSubsetGenerator P E) * ∑' z : O, finiteSexticRow Q hgood j z * W (‖eisEmbedding z‖ ^ 2 / (scale / ‖eisEmbedding (primeSubsetGenerator P E)‖ ^ 2)) := by exact tsum_masked_radial_dilations P hinj S (finiteSexticRow Q hgood j) (finiteSexticRow_mul Q hgood j) W scale (finiteSexticRow_radial_summable Q hcop hgood j W scale hscale) theorem canonical_masked_radial_poisson {α ι : Type*} [DecidableEq α] [Fintype ι] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset α) (Q : ι → Ideal O) [∀ i, (Q i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime Q)) (hgood : ∀ i, lambda ∉ Q i) (hchar : ∀ i, ringChar (O ⧸ Q i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : let c := finitePrimeModulus Q (∑' u : O, rowCoprimeMask P S u * finiteSexticRow Q hgood j u * W (‖eisEmbedding u‖ ^ 2 / scale)) = ∑ E ∈ S.powerset, let d := primeSubsetGenerator P E let reducedScale := scale / ‖eisEmbedding d‖ ^ 2 (UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) * finiteSexticRow Q hgood j d * ((reducedScale : ℂ) * canonicalNormalizedGauss Q hcop hgood j / (‖eisEmbedding c‖ : ℂ)) * ∑' h : O, star (finiteSexticRow Q hgood j h) * paperRadialFourier W (reducedScale * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2) := by dsimp only rw [canonical_masked_radial_dilations P hinj S Q hcop hgood j W scale hscale] apply Finset.sum_congr rfl intro E hE rw [canonical_radial_poisson_normalized Q hcop hgood hchar j hj0 hj6 W (scale / ‖eisEmbedding (primeSubsetGenerator P E)‖ ^ 2) (primeSubset_reducedScale_pos P E hscale)] ring theorem canonical_masked_radial_poisson_collected {α ι : Type*} [DecidableEq α] [Fintype ι] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset α) (Q : ι → Ideal O) [∀ i, (Q i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime Q)) (hgood : ∀ i, lambda ∉ Q i) (hchar : ∀ i, ringChar (O ⧸ Q i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : let c := finitePrimeModulus Q (∑' u : O, rowCoprimeMask P S u * finiteSexticRow Q hgood j u * W (‖eisEmbedding u‖ ^ 2 / scale)) = ((scale : ℂ) * canonicalNormalizedGauss Q hcop hgood j / (‖eisEmbedding c‖ : ℂ)) * ∑ E ∈ S.powerset, let d := primeSubsetGenerator P E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) * finiteSexticRow Q hgood j d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * ∑' h : O, star (finiteSexticRow Q hgood j h) * paperRadialFourier W (scale * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding c‖ ^ 2)) := by dsimp only rw [canonical_masked_radial_poisson P hinj S Q hcop hgood hchar j hj0 hj6 W scale hscale] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro E hE dsimp only have harg (h : O) : scale / ‖eisEmbedding (primeSubsetGenerator P E)‖ ^ 2 * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding (finitePrimeModulus Q)‖ ^ 2 = scale * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding (primeSubsetGenerator P E)‖ ^ 2 * ‖eisEmbedding (finitePrimeModulus Q)‖ ^ 2) := by simp only [div_eq_mul_inv, mul_inv_rev] ring simp_rw [harg] push_cast simp only [div_eq_mul_inv, mul_inv_rev] ring end ActualEisensteinCubic namespace GeneralPrimitiveTrace open Complex EisensteinEmbedding ConcreteTraceCRT open scoped ComplexConjugate theorem complex_exp_trace_integer {t : ℂ} (ht : Complex.exp (2 * Real.pi * Complex.I * t) = 1) : ∃ n : ℤ, t = n := by obtain ⟨n, hn⟩ := Complex.exp_eq_one_iff.mp ht refine ⟨n, ?_⟩ have hnonzero : (2 * Real.pi * Complex.I : ℂ) ≠ 0 := by exact mul_ne_zero (by exact_mod_cast (mul_ne_zero (by norm_num : (2 : ℝ) ≠ 0) Real.pi_ne_zero)) Complex.I_ne_zero apply mul_left_cancel₀ hnonzero calc (2 * Real.pi * Complex.I : ℂ) * t = n * (2 * Real.pi * Complex.I) := by simpa only [mul_assoc] using hn _ = (2 * Real.pi * Complex.I : ℂ) * n := by ring theorem phase_integer {z : ℂ} (hz : ShortDraftTrace.breveE (z / eisLam) = 1) : ∃ n : ℤ, z / eisLam + conj (z / eisLam) = n := complex_exp_trace_integer hz theorem omega_conj : conj omega3 = omega3 ^ 2 := by have hs : omega3 ^ 2 = -omega3 - 1 := by linear_combination omega3_sq rw [hs] unfold omega3 simp only [map_div₀, map_add, map_neg, map_one, map_mul, Complex.conj_ofReal, Complex.conj_I, map_ofNat] ring theorem reconstruction (z : ℂ) : z = (z / eisLam + conj (z / eisLam)) + (omega3 * z / eisLam + conj (omega3 * z / eisLam)) + (z / eisLam + conj (z / eisLam)) * omega3 := by have hquad := omega3_sq have hl : eisLam ≠ 0 := eisLam_ne_zero have hcl : conj eisLam = -eisLam := by simp only [eisLam, map_add, map_one, map_mul, map_ofNat, omega_conj] linear_combination 2 * hquad simp only [map_div₀, map_mul, omega_conj, hcl, div_neg] dsimp [eisLam] at * field_simp linear_combination (conj z) * hquad theorem in_coordinate_lattice_of_two_phases (z : ℂ) (hz : ShortDraftTrace.breveE (z / eisLam) = 1) (hwz : ShortDraftTrace.breveE (omega3 * z / eisLam) = 1) : z ∈ coordinateSubring := by obtain ⟨b, hb⟩ := phase_integer hz obtain ⟨c, hc⟩ := phase_integer hwz change ∃ a b : ℤ, z = (a : ℂ) + (b : ℂ) * omega3 refine ⟨b + c, b, ?_⟩ calc z = (z / eisLam + conj (z / eisLam)) + (omega3 * z / eisLam + conj (omega3 * z / eisLam)) + (z / eisLam + conj (z / eisLam)) * omega3 := reconstruction z _ = ((b + c : ℤ) : ℂ) + (b : ℂ) * omega3 := by rw [hb, hc] push_cast ring theorem eisTraceModChar_breveE_primitive (c : ActualEisensteinCubic.O) (hc : c ≠ 0) : (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc).IsPrimitive := by intro a ha hshift obtain ⟨x, rfl⟩ := Ideal.Quotient.mk_surjective a let z : ℂ := eisEmbedding x / eisEmbedding c have hci : eisEmbedding c ≠ 0 := eisEmbedding_ne_zero hc have hbase : ∀ y : ActualEisensteinCubic.O, ShortDraftTrace.breveE (eisEmbedding (x * y) / (eisEmbedding c * eisLam)) = 1 := by intro y have hp := congrArg (fun f : AddChar (ActualEisensteinCubic.O ⧸ Ideal.span {c}) ℂ => f (Ideal.Quotient.mk (Ideal.span {c}) y)) hshift simpa only [AddChar.mulShift_apply, ← map_mul, eisTraceModChar, IdealGaussCRT.traceModChar_mk, AddChar.one_apply] using hp have h1 : ShortDraftTrace.breveE (z / eisLam) = 1 := by convert hbase 1 using 1 simp only [mul_one] dsimp [z] ring_nf have hw : ShortDraftTrace.breveE (omega3 * z / eisLam) = 1 := by convert hbase pb.gen using 1 rw [map_mul, show eisEmbedding pb.gen = omega3 from embedding_gen omega3 omega3_sq] dsimp [z] ring_nf have hz := in_coordinate_lattice_of_two_phases z h1 hw obtain ⟨q, hq⟩ := toCoordinateSubring_surjective ⟨z, hz⟩ have hiq : eisEmbedding q = z := congrArg Subtype.val hq have hcq : c * q = x := by apply eisEmbedding_injective rw [map_mul, hiq] dsimp [z] field_simp apply ha apply Ideal.Quotient.eq_zero_iff_mem.mpr exact Ideal.mem_span_singleton.mpr ⟨q, hcq.symm⟩ end GeneralPrimitiveTrace namespace IdealGaussCRT theorem coordinateAddChar_isPrimitive {ι T : Type*} [Fintype ι] (R : ι → Type*) [CommRing T] [∀ i, CommRing (R i)] (e : T ≃+* ∀ i, R i) (ψ : AddChar T ℂ) (hψ : ψ.IsPrimitive) (i : ι) : (coordinateAddChar R e ψ i).IsPrimitive := by classical intro a ha hshift let b : T := e.symm (Pi.single i a) have hb : b ≠ 0 := by intro hz have hh := congrArg (fun z : T => e z i) hz exact ha (by simpa [b] using hh) apply hψ hb ext x change ψ (b * x) = 1 have hx := congrArg (fun φ : AddChar (R i) ℂ => φ (e x i)) hshift change ψ (e.symm (Pi.single i (a * e x i))) = 1 at hx have hvec : Pi.single i a * e x = Pi.single i (a * e x i) := by funext j by_cases hij : i = j · subst j simp · simp [Pi.single_eq_of_ne (Ne.symm hij)] have hprod : b * x = e.symm (Pi.single i (a * e x i)) := by apply e.injective rw [map_mul] simp only [b, e.apply_symm_apply] exact hvec rw [hprod] exact hx theorem norm_gauss_finite_crt_sq {ι T : Type*} [Fintype ι] (R : ι → Type*) [CommRing T] [∀ i, Field (R i)] [Fintype T] [∀ i, Fintype (R i)] (e : T ≃+* ∀ i, R i) (χ : ∀ i, MulChar (R i) ℂ) (ψ : AddChar T ℂ) (hχ : ∀ i, χ i ≠ 1) (hψ : ∀ i, (coordinateAddChar R e ψ i).IsPrimitive) : ‖∑ x : T, (∏ i, χ i (e x i)) * ψ x‖ ^ 2 = (Fintype.card T : ℝ) := by classical have hbase := gauss_transform_finite_crt R e χ ψ hχ (1 : T) simp only [one_mul, map_one, Pi.one_apply, one_ne_zero, ↓reduceIte, inv_one, one_mul] at hbase rw [hbase, norm_prod, ← Finset.prod_pow] have hlocal (i : ι) : ‖gaussSum (χ i) (coordinateAddChar R e ψ i)‖ ^ 2 = (Fintype.card (R i) : ℝ) := by rw [ShortDraftGauss.norm_gaussSum_eq_sqrt_card (χ i) (coordinateAddChar R e ψ i) (hχ i) (hψ i), Real.sq_sqrt (by positivity)] simp_rw [hlocal] rw [Fintype.card_congr e.toEquiv, Fintype.card_pi, Nat.cast_prod] end IdealGaussCRT namespace ActualEisensteinCubic open ConcreteTraceCRT EisensteinSchwartzPoisson theorem norm_canonicalGaussSum {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (hchar : ∀ i, ringChar (O ⧸ P i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) : ‖canonicalGaussSum P hcop hgood j‖ = ‖eisEmbedding (finitePrimeModulus P)‖ := by classical let c := finitePrimeModulus P have hc0 : c ≠ 0 := finitePrimeModulus_ne_zero P let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc0 let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let (i : ι) : Fintype (O ⧸ P i) := Fintype.ofFinite _ let (i : ι) : Field (O ⧸ P i) := Ideal.Quotient.field (P i) let e : (O ⧸ Ideal.span {c}) ≃+* ∀ i, O ⧸ P i := (Ideal.quotEquivOfEq (span_finitePrimeModulus P)).trans (IdealGaussCRT.quotientProdEquivPi P hcop) let χ : ∀ i, MulChar (O ⧸ P i) ℂ := fun i => canonicalSextic (P i) (hgood i) ^ j i let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc0 have hψ : ψ.IsPrimitive := GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive c hc0 have hχ : ∀ i, χ i ≠ 1 := fun i => canonicalSextic_pow_ne_one (P i) (hgood i) (hchar i) (hj0 i) (hj6 i) have hnormsq := IdealGaussCRT.norm_gauss_finite_crt_sq (fun i => O ⧸ P i) e χ ψ hχ (fun i => IdealGaussCRT.coordinateAddChar_isPrimitive (fun i => O ⧸ P i) e ψ hψ i) change ‖canonicalGaussSum P hcop hgood j‖ ^ 2 = (Fintype.card (O ⧸ Ideal.span {c}) : ℝ) at hnormsq have hcard : (Fintype.card (O ⧸ Ideal.span {c}) : ℝ) = ‖eisEmbedding c‖ ^ 2 := by symm simpa only [Ideal.absNorm_apply, Submodule.cardQuot_apply, Nat.card_eq_fintype_card] using eisEmbedding_norm_sq_eq_absNorm_span c rw [hcard] at hnormsq exact (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp hnormsq theorem norm_canonicalNormalizedGauss {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (hchar : ∀ i, ringChar (O ⧸ P i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) : ‖canonicalNormalizedGauss P hcop hgood j‖ = 1 := by have hn : ‖eisEmbedding (finitePrimeModulus P)‖ ≠ 0 := norm_ne_zero_iff.mpr (eisEmbedding_ne_zero (finitePrimeModulus_ne_zero P)) rw [canonicalNormalizedGauss, norm_div, norm_canonicalGaussSum P hcop hgood hchar j hj0 hj6, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (norm_nonneg _), div_self hn] theorem finiteSquarefreeRow_norm_le_one {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (S : Finset ι) (u : O) : ‖finiteSquarefreeRow P hgood S u‖ ≤ 1 := by have hpair := finiteSquarefreeRow_self_pair P hgood S u have hmask : ‖rowCoprimeMask P S u‖ ≤ 1 := by unfold rowCoprimeMask split_ifs <;> simp have hsq : ‖finiteSquarefreeRow P hgood S u‖ ^ 2 ≤ 1 := by calc _ = ‖star (finiteSquarefreeRow P hgood S u) * finiteSquarefreeRow P hgood S u‖ := by rw [norm_mul, norm_star, pow_two] _ = ‖rowCoprimeMask P S u‖ := congrArg norm hpair _ ≤ 1 := hmask nlinarith [norm_nonneg (finiteSquarefreeRow P hgood S u)] theorem finiteSquarefreeRow_pair_radial_summable {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (S T : Finset ι) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : Summable (fun u : O => (star (finiteSquarefreeRow P hgood S u) * finiteSquarefreeRow P hgood T u) * W (‖eisEmbedding u‖ ^ 2 / scale)) := by have hW : Summable (fun u : O => ‖W (‖eisEmbedding u‖ ^ 2 / scale)‖) := by simpa only [scaledRadialTest_apply] using actual_eisenstein_summable_norm (scaledRadialTest W scale hscale) apply Summable.of_norm apply Summable.of_nonneg_of_le (fun u => norm_nonneg _) _ hW intro u simp only [norm_mul, norm_star] calc ‖finiteSquarefreeRow P hgood S u‖ * ‖finiteSquarefreeRow P hgood T u‖ * ‖W (‖eisEmbedding u‖ ^ 2 / scale)‖ ≤ 1 * 1 * ‖W (‖eisEmbedding u‖ ^ 2 / scale)‖ := by gcongr · exact finiteSquarefreeRow_norm_le_one P hgood S u · exact finiteSquarefreeRow_norm_le_one P hgood T u _ = _ := by ring private theorem norm_sq_finite_row_sum {β : Type*} (C : Finset β) (a r : β → ℂ) : (↑(‖∑ n ∈ C, a n * r n‖ ^ 2) : ℂ) = ∑ n ∈ C, ∑ m ∈ C, (star (a n) * a m) * (star (r n) * r m) := by rw [Complex.sq_norm, Complex.normSq_eq_conj_mul_self] simp only [map_sum, map_mul, starRingEnd_apply] rw [Finset.sum_mul_sum] apply Finset.sum_congr rfl intro n hn apply Finset.sum_congr rfl intro m hm ring theorem finiteSquarefreeRow_smoothed_mean_square_summable {ι β : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (C : Finset β) (support : β → Finset ι) (a : β → ℂ) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : Summable (fun u : O => W (‖eisEmbedding u‖ ^ 2 / scale) * (↑(‖∑ n ∈ C, a n * finiteSquarefreeRow P hgood (support n) u‖ ^ 2) : ℂ)) := by have hs := summable_sum (s := C) (fun n hn => summable_sum (s := C) (fun m hm => (finiteSquarefreeRow_pair_radial_summable P hgood (support n) (support m) W scale hscale).mul_left (star (a n) * a m))) apply hs.congr intro u rw [norm_sq_finite_row_sum] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro n hn apply Finset.sum_congr rfl intro m hm ring theorem finiteSquarefreeRow_smoothed_mean_square_expand {ι β : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (C : Finset β) (support : β → Finset ι) (a : β → ℂ) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : (∑' u : O, W (‖eisEmbedding u‖ ^ 2 / scale) * (↑(‖∑ n ∈ C, a n * finiteSquarefreeRow P hgood (support n) u‖ ^ 2) : ℂ)) = ∑ n ∈ C, ∑ m ∈ C, (star (a n) * a m) * ∑' u : O, (star (finiteSquarefreeRow P hgood (support n) u) * finiteSquarefreeRow P hgood (support m) u) * W (‖eisEmbedding u‖ ^ 2 / scale) := by let f : β → β → O → ℂ := fun n m u => (star (a n) * a m) * ((star (finiteSquarefreeRow P hgood (support n) u) * finiteSquarefreeRow P hgood (support m) u) * W (‖eisEmbedding u‖ ^ 2 / scale)) have hf (n m : β) : Summable (f n m) := (finiteSquarefreeRow_pair_radial_summable P hgood (support n) (support m) W scale hscale).mul_left (star (a n) * a m) have hterm (u : O) : W (‖eisEmbedding u‖ ^ 2 / scale) * (↑(‖∑ n ∈ C, a n * finiteSquarefreeRow P hgood (support n) u‖ ^ 2) : ℂ) = ∑ n ∈ C, ∑ m ∈ C, f n m u := by rw [norm_sq_finite_row_sum] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro n hn apply Finset.sum_congr rfl intro m hm dsimp [f] ring calc _ = ∑' u : O, ∑ n ∈ C, ∑ m ∈ C, f n m u := tsum_congr hterm _ = ∑ n ∈ C, ∑' u : O, ∑ m ∈ C, f n m u := Summable.tsum_finsetSum (fun n hn => summable_sum (fun m hm => hf n m)) _ = _ := by apply Finset.sum_congr rfl intro n hn rw [Summable.tsum_finsetSum (fun m hm => hf n m)] apply Finset.sum_congr rfl intro m hm exact tsum_mul_left end ActualEisensteinCubic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.PrimeRows.ActiveGaussFactorization namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff namespace ConcretePrimeRowBridge open ActualEisensteinCubic ShortDraftHeckeBridge ConcreteTraceCRT end ConcretePrimeRowBridge open scoped BigOperators Classical namespace ActualEisensteinCubic def activeSupport {α : Type*} [DecidableEq α] (S T : Finset α) : Finset α := (S \ T) ∪ (T \ S) abbrev activePrimes {α : Type*} [DecidableEq α] (P : α → Ideal O) (S T : Finset α) (i : activeSupport S T) : Ideal O := P i.val def activeExponent {α : Type*} [DecidableEq α] (S T : Finset α) (i : activeSupport S T) : ℕ := if i.val ∈ S \ T then 5 else 1 theorem activeExponent_ne_zero {α : Type*} [DecidableEq α] (S T : Finset α) (i : activeSupport S T) : activeExponent S T i ≠ 0 := by unfold activeExponent split_ifs <;> decide theorem activeExponent_lt_six {α : Type*} [DecidableEq α] (S T : Finset α) (i : activeSupport S T) : activeExponent S T i < 6 := by unfold activeExponent split_ifs <;> decide theorem activePrimes_injective {α : Type*} [DecidableEq α] (P : α → Ideal O) (hinj : Function.Injective P) (S T : Finset α) : Function.Injective (activePrimes P S T) := by intro a b h apply Subtype.ext exact hinj h theorem activePrimes_pairwise_isCoprime {α : Type*} [DecidableEq α] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S T : Finset α) : Pairwise (Function.onFun IsCoprime (activePrimes P S T)) := by intro a b hab exact Ideal.isCoprime_of_isMaximal (fun h => hab (activePrimes_injective P hinj S T h)) theorem finiteSexticRow_activeSupport {α : Type*} [DecidableEq α] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (S T : Finset α) (u : O) : finiteSexticRow (activePrimes P S T) (fun i => hgood i.val) (activeExponent S T) u = star (finiteSquarefreeRow P hgood (S \ T) u) * finiteSquarefreeRow P hgood (T \ S) u := by classical have hd : Disjoint (S \ T) (T \ S) := by apply Finset.disjoint_left.mpr intro i hi hj exact (Finset.mem_sdiff.mp hi).2 (Finset.mem_sdiff.mp hj).1 have hpow5 (i : α) : (canonicalSextic (P i) (hgood i) ^ 5) (Ideal.Quotient.mk (P i) u) = star (canonicalSextic (P i) (hgood i) (Ideal.Quotient.mk (P i) u)) := by rw [MulChar.pow_apply' _ (by decide : (5 : ℕ) ≠ 0)] rw [canonicalSextic_conj_as_row_label] ring unfold finiteSexticRow activePrimes activeExponent let f : α → ℂ := fun i => (canonicalSextic (P i) (hgood i) ^ (if i ∈ S \ T then 5 else 1)) (Ideal.Quotient.mk (P i) u) change (∏ i : activeSupport S T, f i.val) = _ rw [Finset.prod_coe_sort (s := activeSupport S T) (f := f)] change (∏ i ∈ (S \ T) ∪ (T \ S), (canonicalSextic (P i) (hgood i) ^ (if i ∈ S \ T then 5 else 1)) (Ideal.Quotient.mk (P i) u)) = _ rw [Finset.prod_union hd] simp only [finiteSquarefreeRow, star_prod] congr 1 · apply Finset.prod_congr rfl intro i hi rw [ite_eq_left hi, hpow5] · apply Finset.prod_congr rfl intro i hi have hnot : i ∉ S \ T := fun h => Finset.disjoint_left.mp hd h hi rw [ite_eq_right hnot, pow_one] theorem finiteSquarefreeRow_pair_activeSupport {α : Type*} [DecidableEq α] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (S T : Finset α) (u : O) : star (finiteSquarefreeRow P hgood S u) * finiteSquarefreeRow P hgood T u = rowCoprimeMask P (S ∩ T) u * finiteSexticRow (activePrimes P S T) (fun i => hgood i.val) (activeExponent S T) u := by rw [finiteSexticRow_activeSupport P hgood S T u] have hk := finiteSquarefreeRow_pair_kernel P hgood S T u simpa only [mul_assoc] using hk open ConcreteTraceCRT EisensteinSchwartzPoisson noncomputable def squarefreePairPoissonKernel {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (hgood : ∀ i, lambda ∉ P i) (S T : Finset ι) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) : ℂ := let Q := activePrimes P S T let hQ := activePrimes_pairwise_isCoprime P hinj S T let row := finiteSexticRow Q (fun i => hgood i.val) (activeExponent S T) let c := finitePrimeModulus Q ((scale : ℂ) * canonicalNormalizedGauss Q hQ (fun i => hgood i.val) (activeExponent S T) / (‖eisEmbedding c‖ : ℂ)) * ∑ E ∈ (S ∩ T).powerset, let d := primeSubsetGenerator P E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) * row d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * ∑' h : O, star (row h) * paperRadialFourier W (scale * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding c‖ ^ 2)) theorem finiteSquarefreeRow_pair_radial_poisson {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (hgood : ∀ i, lambda ∉ P i) (hchar : ∀ i, ringChar (O ⧸ P i) ≠ 2) (S T : Finset ι) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : (∑' u : O, (star (finiteSquarefreeRow P hgood S u) * finiteSquarefreeRow P hgood T u) * W (‖eisEmbedding u‖ ^ 2 / scale)) = squarefreePairPoissonKernel P hinj hgood S T W scale := by calc _ = ∑' u : O, rowCoprimeMask P (S ∩ T) u * finiteSexticRow (activePrimes P S T) (fun i => hgood i.val) (activeExponent S T) u * W (‖eisEmbedding u‖ ^ 2 / scale) := by apply tsum_congr intro u rw [finiteSquarefreeRow_pair_activeSupport] _ = _ := canonical_masked_radial_poisson_collected P hinj (S ∩ T) (activePrimes P S T) (activePrimes_pairwise_isCoprime P hinj S T) (fun i => hgood i.val) (fun i => hchar i.val) (activeExponent S T) (activeExponent_ne_zero S T) (activeExponent_lt_six S T) W scale hscale end ActualEisensteinCubic namespace ConcretePrimeRowBridge open ActualEisensteinCubic ShortDraftHeckeBridge ConcreteTraceCRT EisensteinSchwartzPoisson noncomputable def idealPairPoissonKernel (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) : ℂ := by letI : ∀ i : primePool F, (i.1).IsMaximal := primePool_maximal F hFpos exact squarefreePairPoissonKernel (fun i : primePool F => i.1) Subtype.val_injective (primePool_good F hFgood) (idealSupport F I) (idealSupport F J) W scale end ConcretePrimeRowBridge open scoped BigOperators Classical namespace IdealGaussCRT theorem gauss_sum_finite_crt {ι T : Type*} [Fintype ι] (R : ι → Type*) [CommRing T] [∀ i, CommRing (R i)] [Fintype T] [∀ i, Fintype (R i)] (e : T ≃+* ∀ i, R i) (χ : ∀ i, MulChar (R i) ℂ) (ψ : AddChar T ℂ) : (∑ x : T, (∏ i, χ i (e x i)) * ψ x) = ∏ i, gaussSum (χ i) (coordinateAddChar R e ψ i) := by classical calc _ = ∑ x : T, ∏ i, χ i (e x i) * coordinateAddChar R e ψ i (e x i) := by apply Finset.sum_congr rfl intro x _ rw [addChar_finite_crt_factor R e ψ x, Finset.prod_mul_distrib] _ = ∑ x : ∀ i, R i, ∏ i, χ i (x i) * coordinateAddChar R e ψ i (x i) := Equiv.sum_comp e.toEquiv (fun x : ∀ i, R i => ∏ i, χ i (x i) * coordinateAddChar R e ψ i (x i)) _ = _ := by simpa only [gaussSum] using (Fintype.prod_sum (fun i (x : R i) => χ i x * coordinateAddChar R e ψ i x)).symm end IdealGaussCRT namespace FiniteGaussPhase abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson def cofactor {ι : Type*} [Fintype ι] (p : ι → O) (i : ι) : O := ∏ k ∈ Finset.univ.erase i, p k theorem prime_mul_cofactor {ι : Type*} [Fintype ι] (p : ι → O) (i : ι) : p i * cofactor p i = ∏ k, p k := Finset.mul_prod_erase Finset.univ p (Finset.mem_univ i) theorem span_finset_prod {ι : Type*} (s : Finset ι) (p : ι → O) : Ideal.span {∏ i ∈ s, p i} = ∏ i ∈ s, Ideal.span {p i} := by classical induction s using Finset.induction_on with | empty => simp | @insert a s ha ih => rw [Finset.prod_insert ha, Finset.prod_insert ha, ← Ideal.span_singleton_mul_span_singleton, ih] theorem cofactor_coprime {ι : Type*} [Fintype ι] (p : ι → O) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (i : ι) : IsCoprime (Ideal.span {p i}) (Ideal.span {cofactor p i}) := by rw [cofactor, span_finset_prod] exact IsCoprime.prod_right (fun k hk => hcop (Ne.symm (Finset.mem_erase.mp hk).1)) def productElementCRT {ι : Type*} [Fintype ι] (p : ι → O) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) : (O ⧸ Ideal.span {∏ i, p i}) ≃+* ∀ i, O ⧸ Ideal.span {p i} := (Ideal.quotEquivOfEq (span_finset_prod Finset.univ p)).trans (IdealGaussCRT.quotientProdEquivPi (fun i => Ideal.span {p i}) hcop) theorem productElementCRT_mk {ι : Type*} [Fintype ι] (p : ι → O) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (a : O) (i : ι) : productElementCRT p hcop (Ideal.Quotient.mk (Ideal.span {∏ k, p k}) a) i = Ideal.Quotient.mk (Ideal.span {p i}) a := by simp only [productElementCRT, RingEquiv.trans_apply, Ideal.quotEquivOfEq_mk, IdealGaussCRT.quotientProdEquivPi_mk] theorem productElementCRT_axis {ι : Type*} [Fintype ι] (p : ι → O) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (i : ι) (u v : O) (hbez : u * p i + v * cofactor p i = 1) (x : O) : (productElementCRT p hcop).symm (Pi.single i (Ideal.Quotient.mk (Ideal.span {p i}) x)) = Ideal.Quotient.mk (Ideal.span {∏ k, p k}) (x * v * cofactor p i) := by apply (productElementCRT p hcop).injective rw [RingEquiv.apply_symm_apply] funext k rw [productElementCRT_mk] by_cases hk : k = i · subst k simp only [Pi.single_eq_same, map_mul] have hlocal := IdealGaussCRT.bezout_inverse_left hbez calc Ideal.Quotient.mk (Ideal.span {p i}) x = Ideal.Quotient.mk (Ideal.span {p i}) x * (Ideal.Quotient.mk (Ideal.span {p i}) (cofactor p i) * Ideal.Quotient.mk (Ideal.span {p i}) v) := by rw [hlocal, mul_one] _ = _ := by ring · have hd : p k ∣ cofactor p i := Finset.dvd_prod_of_mem p (by simp [hk]) have hz : Ideal.Quotient.mk (Ideal.span {p k}) (cofactor p i) = 0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr hd) simp only [Pi.single_eq_of_ne hk, map_mul, hz, mul_zero] theorem coordinate_trace_character {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (i : ι) (u v : O) (hbez : u * p i + v * cofactor p i = 1) : IdealGaussCRT.coordinateAddChar (fun i => O ⧸ Ideal.span {p i}) (productElementCRT p hcop) (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (∏ k, p k) (Finset.prod_ne_zero_iff.mpr (fun k _ => hp k))) i = (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (p i) (hp i)).mulShift (Ideal.Quotient.mk (Ideal.span {p i}) v) := by classical ext z obtain ⟨x, rfl⟩ := Ideal.Quotient.mk_surjective z change eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (∏ k, p k) (Finset.prod_ne_zero_iff.mpr (fun k _ => hp k)) ((productElementCRT p hcop).symm (Pi.single i (Ideal.Quotient.mk (Ideal.span {p i}) x))) = eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (p i) (hp i) (Ideal.Quotient.mk (Ideal.span {p i}) v * Ideal.Quotient.mk (Ideal.span {p i}) x) rw [productElementCRT_axis p hcop i u v hbez x, ← map_mul, eisTraceModChar_eq_paperE, eisTraceModChar_eq_paperE] congr 1 have hb : eisEmbedding (cofactor p i) ≠ 0 := eisEmbedding_ne_zero (Finset.prod_ne_zero_iff.mpr (fun k _ => hp k)) rw [← prime_mul_cofactor p i] simp only [map_mul] field_simp theorem gauss_sum_product_element {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) [Fintype (O ⧸ Ideal.span {∏ i, p i})] [∀ i, Fintype (O ⧸ Ideal.span {p i})] (χ : ∀ i, MulChar (O ⧸ Ideal.span {p i}) ℂ) : (∑ x : O ⧸ Ideal.span {∏ i, p i}, (∏ i, χ i (productElementCRT p hcop x i)) * eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (∏ i, p i) (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i)) x) = ∏ i, χ i (Ideal.Quotient.mk (Ideal.span {p i}) (cofactor p i)) * gaussSum (χ i) (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (p i) (hp i)) := by rw [IdealGaussCRT.gauss_sum_finite_crt] apply Finset.prod_congr rfl intro i _ obtain ⟨u, v, hbez⟩ := IdealGaussCRT.bezout_of_principal_coprime (cofactor_coprime p hcop i) rw [coordinate_trace_character p hp hcop i u v hbez] exact IdealGaussCRT.gauss_shift_bezout_left hbez (χ i) _ def normalizedProductTraceGauss {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (χ : ∀ i, MulChar (O ⧸ Ideal.span {p i}) ℂ) : ℂ := by let hpall : (∏ i, p i) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i _ => hp i) letI : Finite (O ⧸ Ideal.span {∏ i, p i}) := finite_quotient_span hpall letI : Fintype (O ⧸ Ideal.span {∏ i, p i}) := Fintype.ofFinite _ exact (∑ x : O ⧸ Ideal.span {∏ i, p i}, (∏ i, χ i (productElementCRT p hcop x i)) * eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (∏ i, p i) hpall x) / (‖eisEmbedding (∏ i, p i)‖ : ℂ) theorem normalizedProductTraceGauss_crt {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (χ : ∀ i, MulChar (O ⧸ Ideal.span {p i}) ℂ) : normalizedProductTraceGauss p hp hcop χ = ∏ i, χ i (Ideal.Quotient.mk (Ideal.span {p i}) (cofactor p i)) * ConcreteBreveE.normalizedTraceGauss (p i) (hp i) (χ i) := by let hpall : (∏ i, p i) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i _ => hp i) let : Finite (O ⧸ Ideal.span {∏ i, p i}) := finite_quotient_span hpall let : Fintype (O ⧸ Ideal.span {∏ i, p i}) := Fintype.ofFinite _ let (i : ι) : Finite (O ⧸ Ideal.span {p i}) := finite_quotient_span (hp i) let (i : ι) : Fintype (O ⧸ Ideal.span {p i}) := Fintype.ofFinite _ have hn : (‖eisEmbedding (∏ i, p i)‖ : ℂ) = ∏ i, (‖eisEmbedding (p i)‖ : ℂ) := by rw [map_prod, norm_prod] norm_cast change (∑ x : O ⧸ Ideal.span {∏ i, p i}, (∏ i, χ i (productElementCRT p hcop x i)) * eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (∏ i, p i) hpall x) / (‖eisEmbedding (∏ i, p i)‖ : ℂ) = _ rw [gauss_sum_product_element p hp hcop χ, hn, ← Finset.prod_div_distrib] apply Finset.prod_congr rfl intro i _ change (_ * _) / _ = _ * (_ / _) ring theorem normalizedProductTraceGauss_cross_factors {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (χ : ∀ i, MulChar (O ⧸ Ideal.span {p i}) ℂ) : normalizedProductTraceGauss p hp hcop χ = (∏ i, ∏ k ∈ Finset.univ.erase i, χ i (Ideal.Quotient.mk (Ideal.span {p i}) (p k))) * ∏ i, ConcreteBreveE.normalizedTraceGauss (p i) (hp i) (χ i) := by rw [normalizedProductTraceGauss_crt, Finset.prod_mul_distrib] congr 1 apply Finset.prod_congr rfl intro i _ simp only [cofactor, map_prod] def canonicalProductGauss {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (j : ι → ℕ) : ℂ := normalizedProductTraceGauss p hp hcop (fun i => canonicalSextic (Ideal.span {p i}) (hgood i) ^ j i) theorem canonicalProductGauss_cross_factors {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (j : ι → ℕ) : canonicalProductGauss p hp hcop hgood j = (∏ i, ∏ k ∈ Finset.univ.erase i, (canonicalSextic (Ideal.span {p i}) (hgood i) ^ j i) (Ideal.Quotient.mk (Ideal.span {p i}) (p k))) * ∏ i, ConcreteBreveE.normalizedTraceGauss (p i) (hp i) (canonicalSextic (Ideal.span {p i}) (hgood i) ^ j i) := normalizedProductTraceGauss_cross_factors p hp hcop _ theorem canonicalProductGauss_constant_power {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (j : ℕ) (hj : j ≠ 0) : canonicalProductGauss p hp hcop hgood (fun _ => j) = (∏ i, ∏ k ∈ Finset.univ.erase i, canonicalSextic (Ideal.span {p i}) (hgood i) (Ideal.Quotient.mk (Ideal.span {p i}) (p k))) ^ j * ∏ i, ConcreteBreveE.normalizedTraceGauss (p i) (hp i) (canonicalSextic (Ideal.span {p i}) (hgood i) ^ j) := by rw [canonicalProductGauss_cross_factors] simp only [MulChar.pow_apply' _ hj, Finset.prod_pow] open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson def angularFactor (a : O) : ℂ := eisEmbedding a / (‖eisEmbedding a‖ : ℂ) theorem angularFactor_prod {ι : Type*} [Fintype ι] (p : ι → O) : angularFactor (∏ i, p i) = ∏ i, angularFactor (p i) := by unfold angularFactor rw [map_prod, norm_prod, Complex.ofReal_prod, Finset.prod_div_distrib] def canonicalCrossFactor {ι : Type*} [Fintype ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hgood : ∀ i, lambda ∉ Ideal.span {p i}) : ℂ := ∏ i, ∏ k ∈ Finset.univ.erase i, canonicalSextic (Ideal.span {p i}) (hgood i) (Ideal.Quotient.mk (Ideal.span {p i}) (p k)) theorem prime_generator_not_mem_other {ι : Type*} [Fintype ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (i k : ι) (hik : i ≠ k) : p k ∉ Ideal.span {p i} := by intro h have hle : Ideal.span {p k} ≤ Ideal.span {p i} := Ideal.span_le.mpr (Set.singleton_subset_iff.mpr h) have ht := (hcop hik).sup_eq rw [sup_eq_left.mpr hle] at ht exact (inferInstance : (Ideal.span {p i}).IsMaximal).ne_top ht theorem canonicalCrossFactor_pow_six {ι : Type*} [Fintype ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) : canonicalCrossFactor p hgood ^ 6 = 1 := by unfold canonicalCrossFactor rw [← Finset.prod_pow] apply Finset.prod_eq_one intro i _ rw [← Finset.prod_pow] apply Finset.prod_eq_one intro k hk have hnot := prime_generator_not_mem_other p hcop i k (Ne.symm (Finset.mem_erase.mp hk).1) simpa only [map_pow, ite_eq_right hnot] using (canonicalSextic_sixth_power_mask (Ideal.span {p i}) (hgood i) (p k)) def canonicalProductCoefficient {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) : ℂ := star (angularFactor (∏ i, p i)) * canonicalProductGauss p hp hcop hgood (fun _ => 2) theorem canonicalProductCoefficient_crt {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) : canonicalProductCoefficient p hp hcop hgood = canonicalCrossFactor p hgood ^ 2 * ∏ i, star (angularFactor (p i)) * ConcreteBreveE.normalizedTraceGauss (p i) (hp i) (canonicalSextic (Ideal.span {p i}) (hgood i) ^ 2) := by rw [canonicalProductCoefficient, canonicalProductGauss_constant_power p hp hcop hgood 2 (by decide), angularFactor_prod, star_prod, Finset.prod_mul_distrib] unfold canonicalCrossFactor ring theorem product_moebius_eq_sign {ι : Type*} [Fintype ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) : (UniqueFactorizationMonoid.moebius (Ideal.span {∏ i, p i}) : ℂ) = (-1 : ℂ) ^ Fintype.card ι := by have hinj : Function.Injective (fun i => Ideal.span {p i}) := by intro i k h by_contra hik have ht := (hcop hik).sup_eq rw [h, sup_idem] at ht exact (inferInstance : (Ideal.span {p k}).IsMaximal).ne_top ht have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance rw [span_finset_prod] simpa only [Finset.card_univ] using prime_product_moebius (fun i => Ideal.span {p i}) hprime hinj Finset.univ def canonicalProductG {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) : ℂ := (∏ i, canonicalSextic (Ideal.span {p i}) (hgood i) (Ideal.Quotient.mk (Ideal.span {p i}) (4 : O)))⁻¹ * canonicalProductGauss p hp hcop hgood (fun _ => 3) theorem norm_angularFactor (a : O) (ha : a ≠ 0) : ‖angularFactor a‖ = 1 := by rw [angularFactor, norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (norm_nonneg _)] exact div_self (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero ha)) theorem norm_canonicalProductGauss {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) : ‖canonicalProductGauss p hp hcop hgood j‖ = 1 := by let c := ∏ i, p i have hc : c ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i _ => hp i) let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let (i : ι) : Fintype (O ⧸ Ideal.span {p i}) := Fintype.ofFinite _ let (i : ι) : Field (O ⧸ Ideal.span {p i}) := Ideal.Quotient.field _ let e := productElementCRT p hcop let χ : ∀ i, MulChar (O ⧸ Ideal.span {p i}) ℂ := fun i => canonicalSextic (Ideal.span {p i}) (hgood i) ^ j i let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc have hψ : ψ.IsPrimitive := GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive c hc have hχ : ∀ i, χ i ≠ 1 := fun i => canonicalSextic_pow_ne_one (Ideal.span {p i}) (hgood i) (hchar i) (hj0 i) (hj6 i) have hnormsq := IdealGaussCRT.norm_gauss_finite_crt_sq (fun i => O ⧸ Ideal.span {p i}) e χ ψ hχ (fun i => IdealGaussCRT.coordinateAddChar_isPrimitive (fun i => O ⧸ Ideal.span {p i}) e ψ hψ i) have hcard : (Fintype.card (O ⧸ Ideal.span {c}) : ℝ) = ‖eisEmbedding c‖ ^ 2 := by symm simpa only [Ideal.absNorm_apply, Submodule.cardQuot_apply, Nat.card_eq_fintype_card] using eisEmbedding_norm_sq_eq_absNorm_span c rw [hcard] at hnormsq have hnorm := (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp hnormsq change ‖(∑ x : O ⧸ Ideal.span {c}, (∏ i, χ i (e x i)) * ψ x) / (‖eisEmbedding c‖ : ℂ)‖ = 1 rw [norm_div, hnorm, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (norm_nonneg _)] exact div_self (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hc)) end FiniteGaussPhase end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.CubicTrace namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical namespace ActualEisensteinCubic theorem cubicChar_reduce_ne_one (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hPgood : lambda ∉ P) (hQgood : lambda ∉ Q) : (cubicChar P hPgood).ringHomComp (Ideal.Quotient.mk Q) ≠ 1 := by intro hred apply cubicChar_ne_one P hPgood apply MulChar.ext intro u apply cubic_roots_reduce_injective Q hQgood · rw [← (cubicChar P hPgood).pow_apply_coe, cubicChar_pow_three] exact MulChar.one_apply_coe u · simp · have h := congrArg (fun χ : MulChar (O ⧸ P) (O ⧸ Q) => χ (u : O ⧸ P)) hred simpa only [MulChar.ringHomComp_apply, MulChar.one_apply_coe, map_one] using h theorem cubicGauss_cube_of_nontrivial {E : Type*} [Field E] (ι : O →+* E) (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hprimary : lambda ^ 2 ∣ p - 1) (hξ : (cubicChar P hgood).ringHomComp ι ≠ 1) (ψ : AddChar (O ⧸ P) E) (hψ : ψ.IsPrimitive) : let : Fintype (O ⧸ P) := quotientFintype P gaussSum ((cubicChar P hgood).ringHomComp ι) ψ ^ 3 = -(ι p) * (Nat.card (O ⧸ P) : E) := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ let χ := cubicChar P hgood let ξ := χ.ringHomComp ι have hξ3 : ξ ^ 3 = 1 := by rw [MulChar.ringHomComp_pow, cubicChar_pow_three, MulChar.ringHomComp_one] have hξ2 : ξ * ξ ≠ 1 := by intro h2 apply hξ calc ξ = ξ * (ξ * ξ) := by rw [h2, mul_one] _ = ξ ^ 3 := by rw [pow_succ, pow_two]; ac_rfl _ = 1 := hξ3 have hξinv : ξ⁻¹ = ξ ^ 2 := by apply inv_eq_iff_mul_eq_one.mpr simpa only [pow_succ, mul_comm] using hξ3 have hξmul : ξ * ξ = ξ⁻¹ := by rw [hξinv, pow_two] have hξneg : ξ (-1) = 1 := MulChar.val_neg_one_eq_one_of_odd_order (by decide : Odd 3) hξ3 have hξinvneg : ξ⁻¹ (-1) = 1 := by rw [MulChar.inv_apply_eq_inv', hξneg, inv_one] have hgs : gaussSum ξ ψ * gaussSum ξ⁻¹ ψ = (Nat.card (O ⧸ P) : E) := by have h := gaussSum_mul_gaussSum_eq_card hξ hψ have hshift := mul_gaussSum_inv_eq_gaussSum ξ⁻¹ ψ rw [hξinvneg, one_mul] at hshift rw [hshift] at h simpa only [Nat.card_eq_fintype_card] using h have hJ : jacobiSum ξ ξ = -(ι p) := by change jacobiSum (χ.ringHomComp ι) (χ.ringHomComp ι) = -(ι p) rw [jacobiSum_ringHomComp] rw [cubicJacobi_eq_neg_primary_generator_of_principal P hgood p hP hprimary, map_neg] have hgj : gaussSum ξ⁻¹ ψ * jacobiSum ξ ξ = gaussSum ξ ψ * gaussSum ξ ψ := by simpa only [hξmul] using jacobiSum_mul_nontrivial hξ2 ψ calc gaussSum ξ ψ ^ 3 = (gaussSum ξ ψ * gaussSum ξ ψ) * gaussSum ξ ψ := by ring _ = (gaussSum ξ⁻¹ ψ * jacobiSum ξ ξ) * gaussSum ξ ψ := by rw [hgj] _ = (gaussSum ξ ψ * gaussSum ξ⁻¹ ψ) * jacobiSum ξ ξ := by ring _ = -(ι p) * (Nat.card (O ⧸ P) : E) := by rw [hgs, hJ]; ring theorem cubicGauss_cube_reduce {E : Type*} [Field E] (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hPgood : lambda ∉ P) (hQgood : lambda ∉ Q) (p : O) (hP : P = Ideal.span {p}) (hprimary : lambda ^ 2 ∣ p - 1) (η : (O ⧸ Q) →+* E) (ψ : AddChar (O ⧸ P) E) (hψ : ψ.IsPrimitive) : let : Fintype (O ⧸ P) := quotientFintype P gaussSum ((cubicChar P hPgood).ringHomComp (η.comp (Ideal.Quotient.mk Q))) ψ ^ 3 = -(η (Ideal.Quotient.mk Q p)) * (Nat.card (O ⧸ P) : E) := by let : Field (O ⧸ Q) := quotientField Q apply cubicGauss_cube_of_nontrivial _ P hPgood p hP hprimary _ ψ hψ have h := (MulChar.ringHomComp_ne_one_iff η.injective).mpr (cubicChar_reduce_ne_one P Q hPgood hQgood) exact h end ActualEisensteinCubic namespace CubicFrobenius theorem card_cast_ne_zero (F F' : Type*) [Field F] [Fintype F] [Field F'] [Fintype F'] (hchar : ringChar F' ≠ ringChar F) : (Fintype.card F : F') ≠ 0 := by obtain ⟨n, hp, hcard⟩ := FiniteField.card F (ringChar F) rw [hcard, Nat.cast_pow] apply pow_ne_zero intro hz have hd := (CharP.cast_eq_zero_iff F' (ringChar F') (ringChar F)).mp hz exact hchar ((Nat.prime_dvd_prime_iff_eq (CharP.char_is_prime F' _) hp).mp hd) theorem gaussSum_pow_card (F F' E : Type*) [Field F] [Fintype F] [Field F'] [Fintype F'] [Field E] [Algebra F' E] (χ : MulChar F F') (ψ : AddChar F E) : gaussSum (χ.ringHomComp (algebraMap F' E)) ψ ^ Fintype.card F' = gaussSum (χ.ringHomComp (algebraMap F' E)) (ψ.mulShift (Fintype.card F' : F)) := by obtain ⟨n, hp, hcard⟩ := FiniteField.card F' (ringChar F') have hchar := Algebra.ringChar_eq F' E have hpE : (ringChar E).Prime := hchar ▸ hp let : Fact (ringChar E).Prime := ⟨hpE⟩ have hcardE : Fintype.card F' = ringChar E ^ (n : ℕ) := by simpa only [hchar] using hcard unfold gaussSum rw [hcardE, sum_pow_char_pow] apply Finset.sum_congr rfl intro x hx rw [mul_pow, ← hcardE] change (algebraMap F' E (χ x)) ^ Fintype.card F' * ψ x ^ Fintype.card F' = _ rw [← map_pow, FiniteField.pow_card, ← AddChar.mulShift_spec'] rfl theorem gauss_cube_residue_relation (F F' E : Type*) [Field F] [Fintype F] [Field F'] [Fintype F'] [Field E] [Algebra F' E] (hchar : ringChar F' ≠ ringChar F) (χ : MulChar F F') (hχ : χ ≠ 1) (ψ : AddChar F E) (hψ : ψ.IsPrimitive) (a : F') (m : ℕ) (hm : Fintype.card F' = 3 * m + 1) (hcube : gaussSum (χ.ringHomComp (algebraMap F' E)) ψ ^ 3 = algebraMap F' E a) : χ (Fintype.card F' : F) * a ^ m = 1 := by let ξ := χ.ringHomComp (algebraMap F' E) have hξ : ξ ≠ 1 := (MulChar.ringHomComp_ne_one_iff (algebraMap F' E).injective).mpr hχ have hcard : (Fintype.card F : E) ≠ 0 := by rw [← map_natCast (algebraMap F' E)] exact (map_ne_zero (algebraMap F' E)).mpr (card_cast_ne_zero F F' hchar) have hg : gaussSum ξ ψ ≠ 0 := gaussSum_ne_zero_of_nontrivial hcard hξ hψ have hq : (Fintype.card F' : F) ≠ 0 := card_cast_ne_zero F' F hchar.symm let u : Fˣ := (isUnit_iff_ne_zero.mpr hq).unit have hu : (u : F) = Fintype.card F' := (isUnit_iff_ne_zero.mpr hq).unit_spec have hshift := gaussSum_mulShift ξ ψ u rw [hu, ← gaussSum_pow_card F F' E χ ψ] at hshift have hp : gaussSum ξ ψ ^ Fintype.card F' = algebraMap F' E (a ^ m) * gaussSum ξ ψ := by rw [hm, pow_succ, pow_mul, hcube, map_pow] rw [hp] at hshift have hone : ξ (Fintype.card F' : F) * algebraMap F' E (a ^ m) = 1 := by apply mul_right_cancel₀ hg simpa only [mul_assoc, one_mul] using hshift apply (algebraMap F' E).injective simpa only [ξ, map_mul, map_one, MulChar.ringHomComp_apply] using hone end CubicFrobenius namespace ActualEisensteinCubic theorem cubic_primary_frobenius_relation (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hPgood : lambda ∉ P) (hQgood : lambda ∉ Q) (hchar : ringChar (O ⧸ Q) ≠ ringChar (O ⧸ P)) (p : O) (hP : P = Ideal.span {p}) (hprimary : lambda ^ 2 ∣ p - 1) : cubicChar P hPgood (Nat.card (O ⧸ Q) : O ⧸ P) * cubicChar Q hQgood (Ideal.Quotient.mk Q (p * (Nat.card (O ⧸ P) : O))) = 1 := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Field (O ⧸ Q) := Ideal.Quotient.field Q let : Fintype (O ⧸ P) := Fintype.ofFinite _ let : Fintype (O ⧸ Q) := Fintype.ofFinite _ let ψ := AddChar.FiniteField.primitiveChar (O ⧸ P) (O ⧸ Q) hchar let E := CyclotomicField ψ.n (O ⧸ Q) let η : (O ⧸ Q) →+* E := algebraMap (O ⧸ Q) E let χ := (cubicChar P hPgood).ringHomComp (Ideal.Quotient.mk Q) let a : O ⧸ Q := -(Ideal.Quotient.mk Q p) * (Fintype.card (O ⧸ P) : O ⧸ Q) let m := (Fintype.card (O ⧸ Q) - 1) / 3 have hqdiv : 3 ∣ Fintype.card (O ⧸ Q) - 1 := by simpa only [Nat.card_eq_fintype_card] using card_sub_one_div_three Q hQgood have hqpos : 0 < Fintype.card (O ⧸ Q) := Fintype.card_pos have hm : Fintype.card (O ⧸ Q) = 3 * m + 1 := by dsimp [m] omega have hcube : gaussSum (χ.ringHomComp η) ψ.char ^ 3 = η a := by have hc := cubicGauss_cube_reduce P Q hPgood hQgood p hP hprimary η ψ.char ψ.prim convert hc using 1 · rfl · simp only [a, map_mul, map_neg, map_natCast, Nat.card_eq_fintype_card] have hrel := CubicFrobenius.gauss_cube_residue_relation (O ⧸ P) (O ⧸ Q) E hchar χ (cubicChar_reduce_ne_one P Q hPgood hQgood) ψ.char ψ.prim a m hm hcube have heuler := cubicChar_reduce Q hQgood (Ideal.Quotient.mk Q (-p * (Nat.card (O ⧸ P) : O))) have heuler' : Ideal.Quotient.mk Q (cubicChar Q hQgood (Ideal.Quotient.mk Q (-p * (Nat.card (O ⧸ P) : O)))) = a ^ m := by simpa only [a, m, map_mul, map_neg, map_natCast, Nat.card_eq_fintype_card] using heuler rw [← heuler'] at hrel change Ideal.Quotient.mk Q (cubicChar P hPgood (Fintype.card (O ⧸ Q) : O ⧸ P)) * Ideal.Quotient.mk Q (cubicChar Q hQgood (Ideal.Quotient.mk Q (-p * (Nat.card (O ⧸ P) : O)))) = 1 at hrel have hx : (Fintype.card (O ⧸ Q) : O ⧸ P) ≠ 0 := CubicFrobenius.card_cast_ne_zero (O ⧸ Q) (O ⧸ P) hchar.symm have hy : Ideal.Quotient.mk Q (-p * (Nat.card (O ⧸ P) : O)) ≠ 0 := by intro hz rw [hz, MulChar.map_zero, map_zero, mul_zero] at hrel exact zero_ne_one hrel have hxcube : (cubicChar P hPgood (Fintype.card (O ⧸ Q) : O ⧸ P)) ^ 3 = 1 := by rw [← MulChar.pow_apply' _ (by decide : (3 : ℕ) ≠ 0), cubicChar_pow_three] exact MulChar.one_apply (isUnit_iff_ne_zero.mpr hx) have hycube : (cubicChar Q hQgood (Ideal.Quotient.mk Q (-p * (Nat.card (O ⧸ P) : O)))) ^ 3 = 1 := by rw [← MulChar.pow_apply' _ (by decide : (3 : ℕ) ≠ 0), cubicChar_pow_three] exact MulChar.one_apply (isUnit_iff_ne_zero.mpr hy) have hprod : cubicChar P hPgood (Fintype.card (O ⧸ Q) : O ⧸ P) * cubicChar Q hQgood (Ideal.Quotient.mk Q (-p * (Nat.card (O ⧸ P) : O))) = 1 := by apply cubic_roots_reduce_injective Q hQgood · rw [mul_pow, hxcube, hycube, mul_one] · simp · simpa only [map_mul, map_one] using hrel have hminus : cubicChar Q hQgood (-1 : O ⧸ Q) = 1 := MulChar.val_neg_one_eq_one_of_odd_order (by decide : Odd 3) (cubicChar_pow_three Q hQgood) have hneg : Ideal.Quotient.mk Q (-p * (Nat.card (O ⧸ P) : O)) = (-1) * Ideal.Quotient.mk Q (p * (Nat.card (O ⧸ P) : O)) := by simp only [map_mul, map_neg, map_natCast] ring rw [hneg, map_mul, hminus, one_mul] at hprod simpa only [Nat.card_eq_fintype_card] using hprod theorem cubic_reciprocity_distinct_residue_char (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hPgood : lambda ∉ P) (hQgood : lambda ∉ Q) (hchar : ringChar (O ⧸ Q) ≠ ringChar (O ⧸ P)) (p q : O) (hP : P = Ideal.span {p}) (hQ : Q = Ideal.span {q}) (hpprimary : lambda ^ 2 ∣ p - 1) (hqprimary : lambda ^ 2 ∣ q - 1) : cubicChar P hPgood (Ideal.Quotient.mk P q) = cubicChar Q hQgood (Ideal.Quotient.mk Q p) := by have hPQ := cubic_primary_frobenius_relation P Q hPgood hQgood hchar p hP hpprimary have hQP := cubic_primary_frobenius_relation Q P hQgood hPgood hchar.symm q hQ hqprimary simp only [map_mul, map_natCast] at hPQ hQP let U := cubicChar P hPgood (Nat.card (O ⧸ Q) : O ⧸ P) let V := cubicChar Q hQgood (Nat.card (O ⧸ P) : O ⧸ Q) have hB : cubicChar Q hQgood (Ideal.Quotient.mk Q p) * (U * V) = 1 := by simpa only [U, V, mul_comm, mul_left_comm, mul_assoc] using hPQ have hA : cubicChar P hPgood (Ideal.Quotient.mk P q) * (U * V) = 1 := by simpa only [U, V, mul_comm, mul_left_comm, mul_assoc] using hQP have hUV : U * V ≠ 0 := by intro hz rw [hz, mul_zero] at hA exact zero_ne_one hA exact mul_right_cancel₀ hUV (hA.trans hB.symm) end ActualEisensteinCubic open scoped BigOperators Classical SchwartzMap ContDiff namespace GaussGeneratorTransport abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson FiniteGaussPhase theorem norm_eisEmbedding_unit (u : Oˣ) : ‖eisEmbedding (u : O)‖ = 1 := by have h := eisEmbedding_norm_sq_eq_absNorm_span (u : O) rw [Ideal.span_singleton_eq_top.mpr u.isUnit, Ideal.absNorm_top, Nat.cast_one] at h nlinarith [norm_nonneg (eisEmbedding (u : O))] theorem norm_eisEmbedding_unit_mul (u : Oˣ) (a : O) : ‖eisEmbedding ((u : O) * a)‖ = ‖eisEmbedding a‖ := by rw [map_mul, norm_mul, norm_eisEmbedding_unit, one_mul] theorem finiteSexticRow_unit_mul_star {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (u : Oˣ) : finiteSexticRow P hgood j (u : O) * star (finiteSexticRow P hgood j (u : O)) = 1 := by unfold finiteSexticRow rw [star_prod, ← Finset.prod_mul_distrib] apply Finset.prod_eq_one intro i _ rw [MulChar.star_apply', ← MulChar.mul_apply, mul_inv_cancel] exact MulChar.one_apply (u.isUnit.map (Ideal.Quotient.mk (P i))) def principalNormalizedGauss {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (c : O) (hc : Ideal.span {c} = ∏ i, P i) (hc0 : c ≠ 0) : ℂ := by letI : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc0 letI : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ exact (∑ r : O ⧸ Ideal.span {c}, principalSexticRow P hcop hgood j c hc r * eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc0 r) / (‖eisEmbedding c‖ : ℂ) theorem canonicalNormalizedGauss_eq_principal {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) : canonicalNormalizedGauss P hcop hgood j = principalNormalizedGauss P hcop hgood j (finitePrimeModulus P) (span_finitePrimeModulus P) (finitePrimeModulus_ne_zero P) := rfl theorem principal_gauss_sum_unit_change {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (c n : O) (hc : Ideal.span {c} = ∏ i, P i) (hn : Ideal.span {n} = ∏ i, P i) (hc0 : c ≠ 0) (hn0 : n ≠ 0) (u : Oˣ) (hcn : c = (u : O) * n) [Fintype (O ⧸ Ideal.span {c})] [Fintype (O ⧸ Ideal.span {n})] : (∑ r : O ⧸ Ideal.span {c}, principalSexticRow P hcop hgood j c hc r * eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc0 r) = finiteSexticRow P hgood j (u : O) * ∑ r : O ⧸ Ideal.span {n}, principalSexticRow P hcop hgood j n hn r * eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates n hn0 r := by let e₀ := Ideal.quotEquivOfEq (hn.trans hc.symm) let ū : (O ⧸ Ideal.span {n})ˣ := Units.map (Ideal.Quotient.mk (Ideal.span {n})).toMonoidHom u let e : (O ⧸ Ideal.span {n}) ≃ (O ⧸ Ideal.span {c}) := ū.mulLeft.trans e₀.toEquiv have he (a : O) : e (Ideal.Quotient.mk (Ideal.span {n}) a) = Ideal.Quotient.mk (Ideal.span {c}) ((u : O) * a) := by change e₀ (Ideal.Quotient.mk (Ideal.span {n}) (u : O) * Ideal.Quotient.mk (Ideal.span {n}) a) = _ rw [← map_mul, Ideal.quotEquivOfEq_mk] rw [← Equiv.sum_comp e, Finset.mul_sum] apply Finset.sum_congr rfl intro x _ obtain ⟨a, rfl⟩ := Ideal.Quotient.mk_surjective x rw [he, principalSexticRow_mk, principalSexticRow_mk, finiteSexticRow_mul] have hphase : eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc0 (Ideal.Quotient.mk (Ideal.span {c}) ((u : O) * a)) = eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates n hn0 (Ideal.Quotient.mk (Ideal.span {n}) a) := by rw [eisTraceModChar_eq_paperE, eisTraceModChar_eq_paperE, hcn, map_mul, map_mul] congr 1 field_simp [eisEmbedding_ne_zero u.ne_zero] rw [hphase] ring theorem principalNormalizedGauss_unit_change {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (c n : O) (hc : Ideal.span {c} = ∏ i, P i) (hn : Ideal.span {n} = ∏ i, P i) (hc0 : c ≠ 0) (hn0 : n ≠ 0) (u : Oˣ) (hcn : c = (u : O) * n) : principalNormalizedGauss P hcop hgood j c hc hc0 = finiteSexticRow P hgood j (u : O) * principalNormalizedGauss P hcop hgood j n hn hn0 := by let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc0 let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let : Finite (O ⧸ Ideal.span {n}) := finite_quotient_span hn0 let : Fintype (O ⧸ Ideal.span {n}) := Fintype.ofFinite _ unfold principalNormalizedGauss rw [principal_gauss_sum_unit_change P hcop hgood j c n hc hn hc0 hn0 u hcn] rw [hcn, norm_eisEmbedding_unit_mul] ring theorem principalNormalizedGauss_eq_product {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (j : ι → ℕ) : principalNormalizedGauss (fun i => Ideal.span {p i}) hcop hgood j (∏ i, p i) (span_finset_prod Finset.univ p) (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i)) = canonicalProductGauss p hp hcop hgood j := rfl theorem exists_modulus_unit {ι : Type*} [Fintype ι] (p : ι → O) : ∃ u : Oˣ, finitePrimeModulus (fun i => Ideal.span {p i}) = (u : O) * ∏ i, p i := by have hs : Ideal.span {∏ i, p i} = Ideal.span {finitePrimeModulus (fun i => Ideal.span {p i})} := by rw [span_finitePrimeModulus, span_finset_prod] obtain ⟨u, hu⟩ := Ideal.span_singleton_eq_span_singleton.mp hs exact ⟨u, by simpa only [mul_comm] using hu.symm⟩ def modulusUnit {ι : Type*} [Fintype ι] (p : ι → O) : Oˣ := Classical.choose (exists_modulus_unit p) theorem modulusUnit_spec {ι : Type*} [Fintype ι] (p : ι → O) : finitePrimeModulus (fun i => Ideal.span {p i}) = (modulusUnit p : O) * ∏ i, p i := Classical.choose_spec (exists_modulus_unit p) theorem canonicalNormalizedGauss_eq_product {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (j : ι → ℕ) : canonicalNormalizedGauss (fun i => Ideal.span {p i}) hcop hgood j = finiteSexticRow (fun i => Ideal.span {p i}) hgood j (modulusUnit p : O) * canonicalProductGauss p hp hcop hgood j := by rw [canonicalNormalizedGauss_eq_principal, principalNormalizedGauss_unit_change (fun i => Ideal.span {p i}) hcop hgood j (finitePrimeModulus (fun i => Ideal.span {p i})) (∏ i, p i) (span_finitePrimeModulus _) (span_finset_prod Finset.univ p) (finitePrimeModulus_ne_zero _) (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i)) (modulusUnit p) (modulusUnit_spec p), principalNormalizedGauss_eq_product] theorem canonicalNormalizedGauss_frequency_transport {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (j : ι → ℕ) (h : O) : canonicalNormalizedGauss (fun i => Ideal.span {p i}) hcop hgood j * star (finiteSexticRow (fun i => Ideal.span {p i}) hgood j ((modulusUnit p : O) * h)) = canonicalProductGauss p hp hcop hgood j * star (finiteSexticRow (fun i => Ideal.span {p i}) hgood j h) := by rw [canonicalNormalizedGauss_eq_product p hp hcop hgood j, finiteSexticRow_mul, star_mul] calc _ = (finiteSexticRow (fun i => Ideal.span {p i}) hgood j (modulusUnit p : O) * star (finiteSexticRow (fun i => Ideal.span {p i}) hgood j (modulusUnit p : O))) * (canonicalProductGauss p hp hcop hgood j * star (finiteSexticRow (fun i => Ideal.span {p i}) hgood j h)) := by ring _ = _ := by rw [finiteSexticRow_unit_mul_star, one_mul] theorem gauss_weighted_radial_sum_transport {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (j : ι → ℕ) (F : ℝ → ℂ) : canonicalNormalizedGauss (fun i => Ideal.span {p i}) hcop hgood j * (∑' h : O, star (finiteSexticRow (fun i => Ideal.span {p i}) hgood j h) * F (‖eisEmbedding h‖ ^ 2)) = canonicalProductGauss p hp hcop hgood j * (∑' h : O, star (finiteSexticRow (fun i => Ideal.span {p i}) hgood j h) * F (‖eisEmbedding h‖ ^ 2)) := by rw [← tsum_mul_left, ← tsum_mul_left] calc _ = ∑' h : O, canonicalNormalizedGauss (fun i => Ideal.span {p i}) hcop hgood j * (star (finiteSexticRow (fun i => Ideal.span {p i}) hgood j ((modulusUnit p : O) * h)) * F (‖eisEmbedding ((modulusUnit p : O) * h)‖ ^ 2)) := ((modulusUnit p).mulLeft.tsum_eq _).symm _ = _ := by apply tsum_congr intro h rw [norm_eisEmbedding_unit_mul, ← mul_assoc, canonicalNormalizedGauss_frequency_transport p hp hcop hgood j, mul_assoc] theorem gauss_weighted_finite_radial_sum_transport {ι κ : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (j : ι → ℕ) (D : Finset κ) (a : κ → ℂ) (F : κ → ℝ → ℂ) : canonicalNormalizedGauss (fun i => Ideal.span {p i}) hcop hgood j * (∑ k ∈ D, a k * ∑' h : O, star (finiteSexticRow (fun i => Ideal.span {p i}) hgood j h) * F k (‖eisEmbedding h‖ ^ 2)) = canonicalProductGauss p hp hcop hgood j * (∑ k ∈ D, a k * ∑' h : O, star (finiteSexticRow (fun i => Ideal.span {p i}) hgood j h) * F k (‖eisEmbedding h‖ ^ 2)) := by rw [Finset.mul_sum, Finset.mul_sum] apply Finset.sum_congr rfl intro k _ calc _ = a k * (canonicalNormalizedGauss (fun i => Ideal.span {p i}) hcop hgood j * ∑' h : O, star (finiteSexticRow (fun i => Ideal.span {p i}) hgood j h) * F k (‖eisEmbedding h‖ ^ 2)) := by ring _ = _ := by rw [gauss_weighted_radial_sum_transport p hp hcop hgood j]; ring theorem finitePrimeModulus_norm_eq_product {ι : Type*} [Fintype ι] (p : ι → O) : ‖eisEmbedding (finitePrimeModulus (fun i => Ideal.span {p i}))‖ = ‖eisEmbedding (∏ i, p i)‖ := by rw [modulusUnit_spec p, norm_eisEmbedding_unit_mul] open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson FiniteGaussPhase end GaussGeneratorTransport end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Fourier.PositiveLogProfiles namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic open ActualEisensteinCubic open Filter open scoped Topology open ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology namespace TwoPassProfiles end TwoPassProfiles namespace ActualEisensteinCubic theorem A3_primary_unit_eq_one (x : O) (hx : IsUnit x) (hprimary : lambda ^ 2 ∣ x - 1) : x = 1 := by let : IsCyclotomicExtension {3} ℚ K := CyclotomicField.isCyclotomicExtension 3 ℚ let v : Oˣ := hx.unit have hv : (v : O) = x := hx.unit_spec have hvprimary : lambda ^ 2 ∣ (v : O) - 1 := by simpa only [hv] using hprimary have hunit : v = 1 ∨ v = -1 := by apply IsCyclotomicExtension.Rat.Three.eq_one_or_neg_one_of_unit_of_congruent (IsCyclotomicExtension.zeta_spec 3 ℚ K) v refine ⟨(1 : ℤ), ?_⟩ simpa only [lambda, omega, Int.cast_one] using hvprimary rcases hunit with h1 | hneg · calc x = (v : O) := hv.symm _ = 1 := by rw [h1]; rfl · have heq : (v : O) - 1 = -(2 : O) := by rw [hneg] norm_num rw [heq] at hvprimary have htwo : lambda ^ 2 ∣ (2 : O) := (dvd_neg).mp hvprimary exact False.elim (lambda_not_dvd_two ((dvd_pow_self lambda (by decide)).trans htwo)) end ActualEisensteinCubic namespace FourierBridge open scoped ContDiff FourierTransform SchwartzMap end FourierBridge namespace InitialMeanSquareProfile end InitialMeanSquareProfile open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap namespace LocalLogFourier noncomputable def eulerDeriv (F : ℝ → ℂ) (j : ℕ) (x : ℝ) : ℂ := iteratedDeriv j (fun t : ℝ => F (x * Real.exp t)) 0 theorem iteratedDeriv_log_eq_euler (F : ℝ → ℂ) (R s : ℝ) (j : ℕ) : iteratedDeriv j (fun z : ℝ => F (R * Real.exp z)) s = eulerDeriv F j (R * Real.exp s) := by let G : ℝ → ℂ := fun z => F (R * Real.exp z) have hshift : (fun t : ℝ => F ((R * Real.exp s) * Real.exp t)) = (fun t : ℝ => G (s + t)) := by funext t simp only [G, Real.exp_add, mul_assoc] unfold eulerDeriv rw [hshift] simpa [G] using (congrArg (fun h : ℝ → ℂ => h 0) (iteratedDeriv_comp_const_add j G s)).symm theorem euler_two_regime_bound (F : ℝ → ℂ) (A K : ℕ) (Csmall Clarge : ℝ) (hCs : 0 ≤ Csmall) (hCl : 0 ≤ Clarge) (hsmall : ∀ i ≤ K, ∀ x : ℝ, 0 < x → x ≤ 1 → ‖eulerDeriv F i x‖ ≤ Csmall) (hlarge : ∀ i ≤ K, ∀ x : ℝ, 1 ≤ x → x ^ A * ‖eulerDeriv F i x‖ ≤ Clarge) (i : ℕ) (hi : i ≤ K) (x : ℝ) (hx : 0 < x) : (1 + x) ^ A * ‖eulerDeriv F i x‖ ≤ (2 : ℝ) ^ A * (Csmall + Clarge) := by by_cases hsmallx : x ≤ 1 · have hpow : (1 + x) ^ A ≤ (2 : ℝ) ^ A := by gcongr; linarith calc (1 + x) ^ A * ‖eulerDeriv F i x‖ ≤ (2 : ℝ) ^ A * ‖eulerDeriv F i x‖ := mul_le_mul_of_nonneg_right hpow (norm_nonneg _) _ ≤ (2 : ℝ) ^ A * Csmall := mul_le_mul_of_nonneg_left (hsmall i hi x hx hsmallx) (by positivity) _ ≤ (2 : ℝ) ^ A * (Csmall + Clarge) := by gcongr; linarith · have hx1 : 1 ≤ x := le_of_lt (lt_of_not_ge hsmallx) have hpow : (1 + x) ^ A ≤ ((2 : ℝ) * x) ^ A := by gcongr linarith calc (1 + x) ^ A * ‖eulerDeriv F i x‖ ≤ ((2 : ℝ) * x) ^ A * ‖eulerDeriv F i x‖ := mul_le_mul_of_nonneg_right hpow (norm_nonneg _) _ = (2 : ℝ) ^ A * (x ^ A * ‖eulerDeriv F i x‖) := by rw [mul_pow]; ring _ ≤ (2 : ℝ) ^ A * Clarge := mul_le_mul_of_nonneg_left (hlarge i hi x hx1) (by positivity) _ ≤ (2 : ℝ) ^ A * (Csmall + Clarge) := by gcongr; linarith noncomputable def positiveLogProfile (V F : ℝ → ℂ) (R : ℝ) (hVc : HasCompactSupport V) (hVs : ContDiff ℝ ∞ V) (hFpos : ContDiffOn ℝ ∞ F (Set.Ioi 0)) (hR : 0 < R) : 𝓢(ℝ, ℂ) := by let arg : ℝ → ℝ := fun s => R * Real.exp s have harg : ContDiff ℝ ∞ arg := by dsimp [arg] fun_prop have hargpos : ∀ s, arg s ∈ Set.Ioi (0 : ℝ) := by intro s exact mul_pos hR (Real.exp_pos _) have hG : ContDiff ℝ ∞ (fun s => F (arg s)) := by simpa only [Function.comp_def] using hFpos.comp_contDiff harg hargpos have hH : ContDiff ℝ ∞ (fun s => V s * F (arg s)) := hVs.mul hG have hc : HasCompactSupport (fun s => V s * F (arg s)) := hVc.mul_right exact hc.toSchwartzMap hH theorem positiveLogProfile_apply (V F : ℝ → ℂ) (R s : ℝ) (hVc : HasCompactSupport V) (hVs : ContDiff ℝ ∞ V) (hFpos : ContDiffOn ℝ ∞ F (Set.Ioi 0)) (hR : 0 < R) : positiveLogProfile V F R hVc hVs hFpos hR s = V s * F (R * Real.exp s) := rfl theorem positive_log_separation (V F : ℝ → ℂ) (R s : ℝ) (hVc : HasCompactSupport V) (hVs : ContDiff ℝ ∞ V) (hFpos : ContDiffOn ℝ ∞ F (Set.Ioi 0)) (hR : 0 < R) : V s * F (R * Real.exp s) = ∫ t : ℝ, Complex.exp (↑(2 * Real.pi * inner ℝ t s) * Complex.I) * (𝓕 (positiveLogProfile V F R hVc hVs hFpos hR)) t := by rw [← positiveLogProfile_apply V F R s hVc hVs hFpos hR] exact FourierBridge.schwartz_log_inversion _ _ theorem euler_derivative_scale (F : ℝ → ℂ) (R s m CF : ℝ) (A i : ℕ) (hR : 0 < R) (hm : 0 < m) (hm1 : m ≤ 1) (hms : m ≤ Real.exp s) (hF : (1 + R * Real.exp s) ^ A * ‖eulerDeriv F i (R * Real.exp s)‖ ≤ CF) : m ^ A * (1 + R) ^ A * ‖iteratedFDeriv ℝ i (fun z : ℝ => F (R * Real.exp z)) s‖ ≤ CF := by have hscale : m * (1 + R) ≤ 1 + R * Real.exp s := by nlinarith [mul_nonneg hR.le (sub_nonneg.mpr hms)] have hpow : (m * (1 + R)) ^ A ≤ (1 + R * Real.exp s) ^ A := by gcongr rw [norm_iteratedFDeriv_eq_norm_iteratedDeriv, iteratedDeriv_log_eq_euler] calc m ^ A * (1 + R) ^ A * ‖eulerDeriv F i (R * Real.exp s)‖ = (m * (1 + R)) ^ A * ‖eulerDeriv F i (R * Real.exp s)‖ := by rw [mul_pow] _ ≤ (1 + R * Real.exp s) ^ A * ‖eulerDeriv F i (R * Real.exp s)‖ := mul_le_mul_of_nonneg_right hpow (norm_nonneg _) _ ≤ CF := hF theorem positive_log_product_derivative_bound (V F : ℝ → ℂ) (R m CW CF : ℝ) (A n : ℕ) (hVs : ContDiff ℝ ∞ V) (hFpos : ContDiffOn ℝ ∞ F (Set.Ioi 0)) (hR : 0 < R) (hm : 0 < m) (hm1 : m ≤ 1) (hCW : 0 ≤ CW) (hCF : 0 ≤ CF) (hVderiv : ∀ i ≤ n, ∀ s, ‖iteratedFDeriv ℝ i V s‖ ≤ CW) (hwindow : ∀ s, (∃ i ≤ n, ‖iteratedFDeriv ℝ i V s‖ ≠ 0) → m ≤ Real.exp s) (hEuler : ∀ i ≤ n, ∀ x : ℝ, 0 < x → (1 + x) ^ A * ‖eulerDeriv F i x‖ ≤ CF) (s : ℝ) : m ^ A * (1 + R) ^ A * ‖iteratedFDeriv ℝ n (fun z : ℝ => V z * F (R * Real.exp z)) s‖ ≤ ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * CW * CF := by let G : ℝ → ℂ := fun z => F (R * Real.exp z) have harg : ContDiff ℝ ∞ (fun z : ℝ => R * Real.exp z) := by fun_prop have hG : ContDiff ℝ ∞ G := by dsimp [G] simpa only [Function.comp_def] using hFpos.comp_contDiff harg (by intro z; exact mul_pos hR (Real.exp_pos _)) have hprod := norm_iteratedFDeriv_mul_le hVs hG s (n := n) (by exact_mod_cast (le_top : (n : ℕ∞) ≤ ⊤)) have hS : 0 ≤ m ^ A * (1 + R) ^ A := by positivity calc m ^ A * (1 + R) ^ A * ‖iteratedFDeriv ℝ n (fun z : ℝ => V z * F (R * Real.exp z)) s‖ ≤ (m ^ A * (1 + R) ^ A) * (∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * ‖iteratedFDeriv ℝ i V s‖ * ‖iteratedFDeriv ℝ (n - i) G s‖) := mul_le_mul_of_nonneg_left (by simpa [G] using hprod) hS _ = ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * ‖iteratedFDeriv ℝ i V s‖ * ((m ^ A * (1 + R) ^ A) * ‖iteratedFDeriv ℝ (n - i) G s‖) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i hi ring _ ≤ ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * CW * CF := by apply Finset.sum_le_sum intro i hi have hi' : i ≤ n := Nat.lt_succ_iff.mp (Finset.mem_range.mp hi) by_cases hVi : ‖iteratedFDeriv ℝ i V s‖ = 0 · simp [hVi] positivity have hms := hwindow s ⟨i, hi', hVi⟩ have hx : 0 < R * Real.exp s := mul_pos hR (Real.exp_pos _) have hGi := euler_derivative_scale F R s m CF A (n - i) hR hm hm1 hms (hEuler (n - i) (Nat.sub_le n i) _ hx) have hVi' := hVderiv i hi' s gcongr theorem positive_log_uniform_seminorm (V F : ℝ → ℂ) (R m Lwin CW CF : ℝ) (A n k : ℕ) (hVc : HasCompactSupport V) (hVs : ContDiff ℝ ∞ V) (hFpos : ContDiffOn ℝ ∞ F (Set.Ioi 0)) (hR : 0 < R) (hm : 0 < m) (hm1 : m ≤ 1) (hL : 0 ≤ Lwin) (hCW : 0 ≤ CW) (hCF : 0 ≤ CF) (hVderiv : ∀ i ≤ n, ∀ s, ‖iteratedFDeriv ℝ i V s‖ ≤ CW) (hwindow : ∀ s, (∃ i ≤ n, ‖iteratedFDeriv ℝ i V s‖ ≠ 0) → m ≤ Real.exp s ∧ |s| ≤ Lwin) (hEuler : ∀ i ≤ n, ∀ x : ℝ, 0 < x → (1 + x) ^ A * ‖eulerDeriv F i x‖ ≤ CF) : m ^ A * (1 + R) ^ A * (SchwartzMap.seminorm ℝ k n) (positiveLogProfile V F R hVc hVs hFpos hR) ≤ Lwin ^ k * (∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * CW * CF) := by let g := positiveLogProfile V F R hVc hVs hFpos hR let S := m ^ A * (1 + R) ^ A let C := ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * CW * CF have hS : 0 < S := by dsimp [S]; positivity have hC : 0 ≤ C := by dsimp [C]; positivity have hLC : 0 ≤ Lwin ^ k * C := by positivity have hgeq : (g : ℝ → ℂ) = fun z => V z * F (R * Real.exp z) := by funext z exact positiveLogProfile_apply V F R z hVc hVs hFpos hR have hpoint (s : ℝ) : S * (|s| ^ k * ‖iteratedDeriv n g s‖) ≤ Lwin ^ k * C := by by_cases hactive : ∃ i ≤ n, ‖iteratedFDeriv ℝ i V s‖ ≠ 0 · obtain ⟨hms, habs⟩ := hwindow s hactive have hraw := positive_log_product_derivative_bound V F R m CW CF A n hVs hFpos hR hm hm1 hCW hCF hVderiv (by intro z hz; exact (hwindow z hz).1) hEuler s have hnorm : S * ‖iteratedDeriv n g s‖ ≤ C := by rw [hgeq] simpa [S, C, norm_iteratedFDeriv_eq_norm_iteratedDeriv] using hraw calc S * (|s| ^ k * ‖iteratedDeriv n g s‖) = |s| ^ k * (S * ‖iteratedDeriv n g s‖) := by ring _ ≤ |s| ^ k * C := mul_le_mul_of_nonneg_left hnorm (pow_nonneg (abs_nonneg _) _) _ ≤ Lwin ^ k * C := mul_le_mul_of_nonneg_right (by gcongr) hC · have hzero (i : ℕ) (hi : i ≤ n) : ‖iteratedFDeriv ℝ i V s‖ = 0 := by by_contra hne exact hactive ⟨i, hi, hne⟩ have harg : ContDiff ℝ ∞ (fun z : ℝ => R * Real.exp z) := by fun_prop have hG : ContDiff ℝ ∞ (fun z : ℝ => F (R * Real.exp z)) := by simpa only [Function.comp_def] using hFpos.comp_contDiff harg (by intro z; exact mul_pos hR (Real.exp_pos _)) have hprod := norm_iteratedFDeriv_mul_le hVs hG s (n := n) (by exact_mod_cast (le_top : (n : ℕ∞) ≤ ⊤)) have hsumzero : (∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * ‖iteratedFDeriv ℝ i V s‖ * ‖iteratedFDeriv ℝ (n - i) (fun z : ℝ => F (R * Real.exp z)) s‖) = 0 := by apply Finset.sum_eq_zero intro i hi rw [hzero i (Nat.lt_succ_iff.mp (Finset.mem_range.mp hi))] ring have hnormzero : ‖iteratedDeriv n g s‖ = 0 := by have hzero' : ‖iteratedFDeriv ℝ n (fun z : ℝ => V z * F (R * Real.exp z)) s‖ = 0 := le_antisymm (hprod.trans_eq hsumzero) (norm_nonneg _) rw [hgeq] simpa [norm_iteratedFDeriv_eq_norm_iteratedDeriv] using hzero' simp [hnormzero, hLC] have hsemi : (SchwartzMap.seminorm ℝ k n) g ≤ Lwin ^ k * C / S := by apply SchwartzMap.seminorm_le_bound' ℝ k n g (div_nonneg hLC hS.le) intro s exact (le_div_iff₀ hS).mpr (by simpa [mul_comm, mul_left_comm, mul_assoc] using hpoint s) calc S * (SchwartzMap.seminorm ℝ k n) g ≤ S * (Lwin ^ k * C / S) := mul_le_mul_of_nonneg_left hsemi hS.le _ = Lwin ^ k * C := by field_simp noncomputable def derivativeConstant (n : ℕ) (CW CF : ℝ) : ℝ := ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * CW * CF noncomputable def momentConstant (K : ℕ) (Lwin CW CF : ℝ) : ℝ := ∑ n ∈ Finset.range (K + 1), (1 + Lwin ^ (volume : Measure ℝ).integrablePower) * derivativeConstant n CW CF theorem derivativeConstant_nonneg (n : ℕ) (CW CF : ℝ) (hCW : 0 ≤ CW) (hCF : 0 ≤ CF) : 0 ≤ derivativeConstant n CW CF := by unfold derivativeConstant positivity theorem momentConstant_nonneg (K : ℕ) (Lwin CW CF : ℝ) (hL : 0 ≤ Lwin) (hCW : 0 ≤ CW) (hCF : 0 ≤ CF) : 0 ≤ momentConstant K Lwin CW CF := by unfold momentConstant apply Finset.sum_nonneg intro n hn exact mul_nonneg (by positivity) (derivativeConstant_nonneg n CW CF hCW hCF) theorem momentConstant_dominates (K n : ℕ) (Lwin CW CF : ℝ) (hL : 0 ≤ Lwin) (hCW : 0 ≤ CW) (hCF : 0 ≤ CF) (hn : n ≤ K) : (1 + Lwin ^ (volume : Measure ℝ).integrablePower) * derivativeConstant n CW CF ≤ momentConstant K Lwin CW CF := by unfold momentConstant apply Finset.single_le_sum (f := fun i : ℕ => (1 + Lwin ^ (volume : Measure ℝ).integrablePower) * derivativeConstant i CW CF) (a := n) · intro i hi exact mul_nonneg (by positivity) (derivativeConstant_nonneg i CW CF hCW hCF) · exact Finset.mem_range.mpr (Nat.lt_succ_iff.mpr hn) theorem positive_log_source_pair (V F : ℝ → ℂ) (R m Lwin CW CF C : ℝ) (A K n : ℕ) (hVc : HasCompactSupport V) (hVs : ContDiff ℝ ∞ V) (hFpos : ContDiffOn ℝ ∞ F (Set.Ioi 0)) (hR : 0 < R) (hm : 0 < m) (hm1 : m ≤ 1) (hL : 0 ≤ Lwin) (hCW : 0 ≤ CW) (hCF : 0 ≤ CF) (hn : n ≤ K) (hVderiv : ∀ i ≤ K, ∀ s, ‖iteratedFDeriv ℝ i V s‖ ≤ CW) (hwindow : ∀ s, (∃ i ≤ K, ‖iteratedFDeriv ℝ i V s‖ ≠ 0) → m ≤ Real.exp s ∧ |s| ≤ Lwin) (hEuler : ∀ i ≤ K, ∀ x : ℝ, 0 < x → (1 + x) ^ A * ‖eulerDeriv F i x‖ ≤ CF) (hCbound : ∀ j ≤ K, (1 + Lwin ^ (volume : Measure ℝ).integrablePower) * derivativeConstant j CW CF ≤ C) : (m ^ A * (1 + R) ^ A) * ((SchwartzMap.seminorm ℝ 0 n) (positiveLogProfile V F R hVc hVs hFpos hR) + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower n) (positiveLogProfile V F R hVc hVs hFpos hR)) ≤ C := by let p := (volume : Measure ℝ).integrablePower let D : ℝ := derivativeConstant n CW CF let g := positiveLogProfile V F R hVc hVs hFpos hR have hVderiv_n : ∀ i ≤ n, ∀ s, ‖iteratedFDeriv ℝ i V s‖ ≤ CW := by intro i hi s exact hVderiv i (hi.trans hn) s have hwindow_n : ∀ s, (∃ i ≤ n, ‖iteratedFDeriv ℝ i V s‖ ≠ 0) → m ≤ Real.exp s ∧ |s| ≤ Lwin := by intro s hs obtain ⟨i, hi, hnonzero⟩ := hs exact hwindow s ⟨i, hi.trans hn, hnonzero⟩ have hEuler_n : ∀ i ≤ n, ∀ x : ℝ, 0 < x → (1 + x) ^ A * ‖eulerDeriv F i x‖ ≤ CF := by intro i hi x hx exact hEuler i (hi.trans hn) x hx have hzero := positive_log_uniform_seminorm V F R m Lwin CW CF A n 0 hVc hVs hFpos hR hm hm1 hL hCW hCF hVderiv_n hwindow_n hEuler_n have hp := positive_log_uniform_seminorm V F R m Lwin CW CF A n p hVc hVs hFpos hR hm hm1 hL hCW hCF hVderiv_n hwindow_n hEuler_n calc (m ^ A * (1 + R) ^ A) * ((SchwartzMap.seminorm ℝ 0 n) g + (SchwartzMap.seminorm ℝ p n) g) = (m ^ A * (1 + R) ^ A) * (SchwartzMap.seminorm ℝ 0 n) g + (m ^ A * (1 + R) ^ A) * (SchwartzMap.seminorm ℝ p n) g := by ring _ ≤ D + Lwin ^ p * D := by apply add_le_add · simpa [D, derivativeConstant, g] using hzero · simpa [D, derivativeConstant, g, p] using hp _ = (1 + Lwin ^ p) * D := by ring _ ≤ C := by simpa [D, p] using hCbound n hn theorem positive_log_fourier_moment (V F : ℝ → ℂ) (R m Lwin CW CF : ℝ) (A J : ℕ) (hVc : HasCompactSupport V) (hVs : ContDiff ℝ ∞ V) (hFpos : ContDiffOn ℝ ∞ F (Set.Ioi 0)) (hR : 0 < R) (hm : 0 < m) (hm1 : m ≤ 1) (hL : 0 ≤ Lwin) (hCW : 0 ≤ CW) (hCF : 0 ≤ CF) (hVderiv : ∀ i ≤ J + (volume : Measure ℝ).integrablePower, ∀ s, ‖iteratedFDeriv ℝ i V s‖ ≤ CW) (hwindow : ∀ s, (∃ i ≤ J + (volume : Measure ℝ).integrablePower, ‖iteratedFDeriv ℝ i V s‖ ≠ 0) → m ≤ Real.exp s ∧ |s| ≤ Lwin) (hEuler : ∀ i ≤ J + (volume : Measure ℝ).integrablePower, ∀ x : ℝ, 0 < x → (1 + x) ^ A * ‖eulerDeriv F i x‖ ≤ CF) : (m ^ A * (1 + R) ^ A) * (∫ t : ℝ, (1 + ‖t‖) ^ J * ‖(𝓕 (positiveLogProfile V F R hVc hVs hFpos hR)) t‖) ≤ (2 : ℝ) ^ J * (FourierBridge.coefficientMomentBound 0 (momentConstant (J + (volume : Measure ℝ).integrablePower) Lwin CW CF) + FourierBridge.coefficientMomentBound J (momentConstant (J + (volume : Measure ℝ).integrablePower) Lwin CW CF)) := by let K := J + (volume : Measure ℝ).integrablePower let C := momentConstant K Lwin CW CF have hC : 0 ≤ C := momentConstant_nonneg K Lwin CW CF hL hCW hCF apply FourierBridge.uniform_fourier_one_plus_moment _ J _ C (by positivity) hC intro n hn exact positive_log_source_pair V F R m Lwin CW CF C A K n hVc hVs hFpos hR hm hm1 hL hCW hCF (by simpa [K] using hn) (by simpa [K] using hVderiv) (by simpa [K] using hwindow) (by simpa [K] using hEuler) (by intro j hj simpa [C] using momentConstant_dominates K j Lwin CW CF hL hCW hCF hj) theorem positive_log_fourier_bound (V F : ℝ → ℂ) (R m Lwin CW CF : ℝ) (A J : ℕ) (hVc : HasCompactSupport V) (hVs : ContDiff ℝ ∞ V) (hFpos : ContDiffOn ℝ ∞ F (Set.Ioi 0)) (hR : 0 < R) (hm : 0 < m) (hm1 : m ≤ 1) (hL : 0 ≤ Lwin) (hCW : 0 ≤ CW) (hCF : 0 ≤ CF) (hVderiv : ∀ i ≤ J + (volume : Measure ℝ).integrablePower, ∀ s, ‖iteratedFDeriv ℝ i V s‖ ≤ CW) (hwindow : ∀ s, (∃ i ≤ J + (volume : Measure ℝ).integrablePower, ‖iteratedFDeriv ℝ i V s‖ ≠ 0) → m ≤ Real.exp s ∧ |s| ≤ Lwin) (hEuler : ∀ i ≤ J + (volume : Measure ℝ).integrablePower, ∀ x : ℝ, 0 < x → (1 + x) ^ A * ‖eulerDeriv F i x‖ ≤ CF) : (1 + R) ^ A * (∫ t : ℝ, (1 + ‖t‖) ^ J * ‖(𝓕 (positiveLogProfile V F R hVc hVs hFpos hR)) t‖) ≤ ((2 : ℝ) ^ J * (FourierBridge.coefficientMomentBound 0 (momentConstant (J + (volume : Measure ℝ).integrablePower) Lwin CW CF) + FourierBridge.coefficientMomentBound J (momentConstant (J + (volume : Measure ℝ).integrablePower) Lwin CW CF))) / m ^ A := by have hpow : 0 < m ^ A := pow_pos hm _ apply (le_div_iff₀ hpow).mpr have hbase := positive_log_fourier_moment V F R m Lwin CW CF A J hVc hVs hFpos hR hm hm1 hL hCW hCF hVderiv hwindow hEuler simpa [mul_assoc, mul_left_comm, mul_comm] using hbase theorem coupled_positive_log_separation {ι : Type*} [Fintype ι] (W : ι → ℝ → ℂ) (F V : ℝ → ℂ) (R : ℝ) (a y : ι → ℝ) (hVc : HasCompactSupport V) (hVs : ContDiff ℝ ∞ V) (hFpos : ContDiffOn ℝ ∞ F (Set.Ioi 0)) (hR : 0 < R) (hactive : (∏ j : ι, W j (y j)) ≠ 0 → V (∑ j : ι, a j * y j) = 1) : (∏ j : ι, W j (y j)) * F (R * Real.exp (∑ j : ι, a j * y j)) = ∫ t : ℝ, (∏ j : ι, W j (y j) * FourierBridge.logPhase t (a j * y j)) * (𝓕 (positiveLogProfile V F R hVc hVs hFpos hR)) t := by classical let s : ℝ := ∑ j : ι, a j * y j let P : ℂ := ∏ j : ι, W j (y j) let b := 𝓕 (positiveLogProfile V F R hVc hVs hFpos hR) have hsep : V s * F (R * Real.exp s) = ∫ t : ℝ, FourierBridge.logPhase t s * b t := by calc V s * F (R * Real.exp s) = ∫ t : ℝ, Complex.exp (↑(2 * Real.pi * inner ℝ t s) * Complex.I) * b t := by simpa [b] using (positive_log_separation V F R s hVc hVs hFpos hR) _ = ∫ t : ℝ, FourierBridge.logPhase t s * b t := by apply integral_congr_ae filter_upwards [] with t congr 1 simp only [FourierBridge.logPhase, Real.inner_apply] congr 1 push_cast ring have hcut : P * F (R * Real.exp s) = P * (V s * F (R * Real.exp s)) := by by_cases hP : P = 0 · simp [hP] · rw [hactive (by simpa [P, s] using hP)] ring calc P * F (R * Real.exp s) = P * (V s * F (R * Real.exp s)) := hcut _ = P * (∫ t : ℝ, FourierBridge.logPhase t s * b t) := by rw [hsep] _ = ∫ t : ℝ, P * (FourierBridge.logPhase t s * b t) := by rw [integral_const_mul] _ = ∫ t : ℝ, (∏ j : ι, W j (y j) * FourierBridge.logPhase t (a j * y j)) * b t := by apply integral_congr_ae filter_upwards [] with t rw [show FourierBridge.logPhase t s = ∏ j : ι, FourierBridge.logPhase t (a j * y j) by simpa [s] using FourierBridge.logPhase_sum (Finset.univ : Finset ι) t (fun j => a j * y j)] rw [Finset.prod_mul_distrib] simp only [P] ring end LocalLogFourier end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.SquarePhaseFactorization namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators namespace ActualEisensteinCubic theorem primary_associated_eq (x y : O) (hxy : Associated x y) (hx : lambda ^ 2 ∣ x - 1) (hy : lambda ^ 2 ∣ y - 1) : x = y := by obtain ⟨u, hu⟩ := hxy have huprimary : lambda ^ 2 ∣ (u : O) - 1 := by have heq : (u : O) - 1 = (y - 1) - (x - 1) * (u : O) := by rw [← hu] ring rw [heq] exact dvd_sub hy (dvd_mul_of_dvd_left hx _) have huone : (u : O) = 1 := A3_primary_unit_eq_one _ u.isUnit huprimary simpa only [huone, mul_one] using hu theorem primary_multiset_prod (s : Multiset O) (hs : ∀ x ∈ s, lambda ^ 2 ∣ x - 1) : lambda ^ 2 ∣ s.prod - 1 := by induction s using Multiset.induction_on with | empty => simp | @cons a s ih => have ha := hs a (Multiset.mem_cons_self _ _) have hb := ih (fun x hx => hs x (Multiset.mem_cons_of_mem hx)) rw [Multiset.prod_cons] have heq : a * s.prod - 1 = (a - 1) * s.prod + (s.prod - 1) := by ring rw [heq] exact dvd_add (dvd_mul_of_dvd_left ha _) hb theorem primary_maximal_divisor_good (t : O) (ht : lambda ^ 2 ∣ t - 1) (P : Ideal O) [P.IsMaximal] (htP : t ∈ P) : lambda ∉ P := by intro hlam have hlam2 : lambda ^ 2 ∈ P := by simpa only [pow_two] using P.mul_mem_left lambda hlam have hsub : t - 1 ∈ P := Ideal.mem_of_dvd P ht hlam2 have hone : (1 : O) ∈ P := by simpa using P.sub_mem htP hsub exact (Ideal.IsMaximal.ne_top (inferInstance : P.IsMaximal)) ((Ideal.eq_top_iff_one _).mpr hone) theorem exists_primary_prime_factorization (t : O) (ht0 : t ≠ 0) (ht : lambda ^ 2 ∣ t - 1) : ∃ s : Multiset O, s.prod = t ∧ ∀ r ∈ s, Prime r ∧ lambda ^ 2 ∣ r - 1 := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO classical obtain ⟨f, hf, hft⟩ := UniqueFactorizationMonoid.exists_prime_factors t ht0 have hfgood : ∀ r ∈ f, lambda ∉ (Ideal.span {r} : Ideal O) := by intro r hr have hp := hf r hr let : (Ideal.span {r} : Ideal O).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible apply primary_maximal_divisor_good t ht exact Ideal.mem_span_singleton.mpr ((Multiset.dvd_prod hr).trans hft.dvd) have hreplace : ∃ s : Multiset O, Associated s.prod f.prod ∧ ∀ r ∈ s, Prime r ∧ lambda ^ 2 ∣ r - 1 := by clear hft induction f using Multiset.induction_on with | empty => exact ⟨0, Associated.refl _, by simp⟩ | @cons a f ih => have ha := hf a (Multiset.mem_cons_self _ _) let : (Ideal.span {a} : Ideal O).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible ha.irreducible obtain ⟨r, hrspan, hrprimary, _⟩ := cubicJacobi_exists_primary_generator (Ideal.span {a}) (hfgood a (Multiset.mem_cons_self _ _)) have har : Associated a r := Ideal.span_singleton_eq_span_singleton.mp hrspan obtain ⟨s, hsf, hs⟩ := ih (fun r hr => hf r (Multiset.mem_cons_of_mem hr)) (fun r hr => hfgood r (Multiset.mem_cons_of_mem hr)) refine ⟨r ::ₘ s, ?_, ?_⟩ · simpa only [Multiset.prod_cons] using har.symm.mul_mul hsf · intro x hx rcases Multiset.mem_cons.mp hx with rfl | hx · exact ⟨har.prime_iff.mp ha, hrprimary⟩ · exact hs x hx obtain ⟨s, hsf, hs⟩ := hreplace refine ⟨s, ?_, hs⟩ exact primary_associated_eq _ _ (hsf.trans hft) (primary_multiset_prod s (fun r hr => (hs r hr).2)) ht theorem residue_char_mem (P : Ideal O) : (ringChar (O ⧸ P) : O) ∈ P := by apply Ideal.Quotient.eq_zero_iff_mem.mp rw [map_natCast] exact CharP.cast_eq_zero (O ⧸ P) (ringChar (O ⧸ P)) theorem maximal_eq_or_eq_of_same_residue_char (P Q R : Ideal O) [P.IsMaximal] [Q.IsMaximal] [R.IsMaximal] (hne : P ≠ Q) (hPQ : ringChar (O ⧸ Q) = ringChar (O ⧸ P)) (hRP : ringChar (O ⧸ R) = ringChar (O ⧸ P)) : R = P ∨ R = Q := by classical let : Field (O ⧸ P) := Ideal.Quotient.field P let : Fintype (O ⧸ P) := Fintype.ofFinite _ obtain ⟨a, b, _, _, _, _, hcover⟩ := rational_prime_ideal_cover (ringChar (O ⧸ P)) (CharP.char_is_prime (O ⧸ P) _) have hp := hcover P inferInstance (residue_char_mem P) have hq := hcover Q inferInstance (by rw [← hPQ]; exact residue_char_mem Q) have hr := hcover R inferInstance (by rw [← hRP]; exact residue_char_mem R) rcases hp with hp | hp <;> rcases hq with hq | hq <;> rcases hr with hr | hr <;> simp_all theorem prime_divisor_residue_char_ne (P Q R : Ideal O) [P.IsMaximal] [Q.IsMaximal] [R.IsMaximal] (hne : P ≠ Q) (hPQ : ringChar (O ⧸ Q) = ringChar (O ⧸ P)) (t : O) (htP : t ∉ P) (htQ : t ∉ Q) (htR : t ∈ R) : ringChar (O ⧸ R) ≠ ringChar (O ⧸ P) := by intro hRP rcases maximal_eq_or_eq_of_same_residue_char P Q R hne hPQ hRP with rfl | rfl · exact htP htR · exact htQ htR theorem lambda_sq_dvd_three : lambda ^ 2 ∣ (3 : O) := by have hlam : lambda ^ 2 = -3 * omega := by change (omega - 1) ^ 2 = -3 * omega linear_combination omega_sq_for_norm refine ⟨-omega ^ 2, ?_⟩ rw [hlam] calc (3 : O) = 3 * omega ^ 3 := by rw [omega_primitive.pow_eq_one]; ring _ = -3 * omega * -omega ^ 2 := by ring theorem neg_two_primary : lambda ^ 2 ∣ (-2 : O) - 1 := by convert dvd_neg.mpr lambda_sq_dvd_three using 1 ; ring theorem neg_add_primary (p q : O) (hp : lambda ^ 2 ∣ p - 1) (hq : lambda ^ 2 ∣ q - 1) : lambda ^ 2 ∣ -(p + q) - 1 := by have hd := dvd_neg.mpr (dvd_add (dvd_add hp hq) lambda_sq_dvd_three) convert hd using 1 ; ring theorem prime_generator_not_mem_of_ne (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hne : P ≠ Q) (q : O) (hQ : Q = Ideal.span {q}) : q ∉ P := by intro hq have hle : Q ≤ P := by rw [hQ] exact (Ideal.span_singleton_le_iff_mem _).mpr hq exact hne (Ideal.IsMaximal.eq_of_le (inferInstance : Q.IsMaximal) (Ideal.IsMaximal.ne_top (inferInstance : P.IsMaximal)) hle).symm theorem cubic_reciprocity_equal_residue_char (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hPgood : lambda ∉ P) (hQgood : lambda ∉ Q) (hne : P ≠ Q) (hchar : ringChar (O ⧸ Q) = ringChar (O ⧸ P)) (p q : O) (hP : P = Ideal.span {p}) (hQ : Q = Ideal.span {q}) (hpprimary : lambda ^ 2 ∣ p - 1) (hqprimary : lambda ^ 2 ∣ q - 1) : cubicChar P hPgood (Ideal.Quotient.mk P q) = cubicChar Q hQgood (Ideal.Quotient.mk Q p) := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO classical let t : O := -(p + q) have hpP : p ∈ P := by rw [hP]; exact Ideal.subset_span (by simp) have hqQ : q ∈ Q := by rw [hQ]; exact Ideal.subset_span (by simp) have hqP : q ∉ P := prime_generator_not_mem_of_ne P Q hne q hQ have hpQ : p ∉ Q := prime_generator_not_mem_of_ne Q P hne.symm p hP have htP : t ∉ P := by intro ht have hs : p + q ∈ P := by simpa only [t, neg_neg] using P.neg_mem ht exact hqP (by simpa only [add_sub_cancel_left] using P.sub_mem hs hpP) have htQ : t ∉ Q := by intro ht have hs : p + q ∈ Q := by simpa only [t, neg_neg] using Q.neg_mem ht exact hpQ (by simpa only [add_sub_cancel_right] using Q.sub_mem hs hqQ) have ht0 : t ≠ 0 := fun h => htP (h ▸ P.zero_mem) obtain ⟨s, hst, hs⟩ := exists_primary_prime_factorization t ht0 (neg_add_primary p q hpprimary hqprimary) have hlocal : ∀ r ∈ s, cubicChar P hPgood (Ideal.Quotient.mk P r) = cubicChar Q hQgood (Ideal.Quotient.mk Q r) := by intro r hr let R : Ideal O := Ideal.span {r} let : R.IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible (hs r hr).1.irreducible have hrR : r ∈ R := Ideal.subset_span (by simp) have htR : t ∈ R := Ideal.mem_span_singleton.mpr (hst ▸ Multiset.dvd_prod hr) have hRgood : lambda ∉ R := primary_maximal_divisor_good t (neg_add_primary p q hpprimary hqprimary) R htR have hRP := prime_divisor_residue_char_ne P Q R hne hchar t htP htQ htR have hRQ : ringChar (O ⧸ R) ≠ ringChar (O ⧸ Q) := by rwa [hchar] rw [cubic_reciprocity_distinct_residue_char P R hPgood hRgood hRP p r hP rfl hpprimary (hs r hr).2, cubic_reciprocity_distinct_residue_char Q R hQgood hRgood hRQ q r hQ rfl hqprimary (hs r hr).2] have hsum : Ideal.Quotient.mk R p + Ideal.Quotient.mk R q = 0 := by have hz := Ideal.Quotient.eq_zero_iff_mem.mpr htR simpa only [t, map_neg, map_add, neg_eq_zero] using hz have heq : Ideal.Quotient.mk R p = -Ideal.Quotient.mk R q := eq_neg_of_add_eq_zero_left hsum rw [heq, ← neg_one_mul (Ideal.Quotient.mk R q), map_mul, A3_cubicChar_neg_one, one_mul] have hmul : ∀ f : Multiset O, (∀ r ∈ f, cubicChar P hPgood (Ideal.Quotient.mk P r) = cubicChar Q hQgood (Ideal.Quotient.mk Q r)) → cubicChar P hPgood (Ideal.Quotient.mk P f.prod) = cubicChar Q hQgood (Ideal.Quotient.mk Q f.prod) := by intro f induction f using Multiset.induction_on with | empty => intro _; simp | @cons r f ih => intro hf simp only [Multiset.prod_cons, map_mul] rw [hf r (Multiset.mem_cons_self _ _), ih (fun x hx => hf x (Multiset.mem_cons_of_mem hx))] have htval := hmul s hlocal rw [hst] at htval have hpzero : Ideal.Quotient.mk P p = 0 := Ideal.Quotient.eq_zero_iff_mem.mpr hpP have hqzero : Ideal.Quotient.mk Q q = 0 := Ideal.Quotient.eq_zero_iff_mem.mpr hqQ simp only [t, map_neg, map_add, hpzero, hqzero, zero_add, add_zero] at htval rw [← neg_one_mul (Ideal.Quotient.mk P q), map_mul, A3_cubicChar_neg_one, one_mul, ← neg_one_mul (Ideal.Quotient.mk Q p), map_mul, A3_cubicChar_neg_one, one_mul] at htval exact htval theorem cubic_reciprocity_primary (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hPgood : lambda ∉ P) (hQgood : lambda ∉ Q) (p q : O) (hP : P = Ideal.span {p}) (hQ : Q = Ideal.span {q}) (hpprimary : lambda ^ 2 ∣ p - 1) (hqprimary : lambda ^ 2 ∣ q - 1) : cubicChar P hPgood (Ideal.Quotient.mk P q) = cubicChar Q hQgood (Ideal.Quotient.mk Q p) := by by_cases hPQ : P = Q · have hqP : q ∈ P := by rw [hPQ, hQ]; exact Ideal.subset_span (by simp) have hpQ : p ∈ Q := by rw [← hPQ, hP]; exact Ideal.subset_span (by simp) rw [Ideal.Quotient.eq_zero_iff_mem.mpr hqP, Ideal.Quotient.eq_zero_iff_mem.mpr hpQ, MulChar.map_zero, MulChar.map_zero] · by_cases hchar : ringChar (O ⧸ Q) = ringChar (O ⧸ P) · exact cubic_reciprocity_equal_residue_char P Q hPgood hQgood hPQ hchar p q hP hQ hpprimary hqprimary · exact cubic_reciprocity_distinct_residue_char P Q hPgood hQgood hchar p q hP hQ hpprimary hqprimary theorem canonicalSextic_sq_reciprocity_primary (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hPgood : lambda ∉ P) (hQgood : lambda ∉ Q) (p q : O) (hP : P = Ideal.span {p}) (hQ : Q = Ideal.span {q}) (hpprimary : lambda ^ 2 ∣ p - 1) (hqprimary : lambda ^ 2 ∣ q - 1) : (canonicalSextic P hPgood (Ideal.Quotient.mk P q)) ^ 2 = (canonicalSextic Q hQgood (Ideal.Quotient.mk Q p)) ^ 2 := by have hP2 : (canonicalSextic P hPgood (Ideal.Quotient.mk P q)) ^ 2 = ConcreteTraceCRT.eisEmbedding (cubicChar P hPgood (Ideal.Quotient.mk P q)) := by rw [← MulChar.pow_apply' _ (by decide : (2 : ℕ) ≠ 0), canonicalSextic_pow_two] rfl have hQ2 : (canonicalSextic Q hQgood (Ideal.Quotient.mk Q p)) ^ 2 = ConcreteTraceCRT.eisEmbedding (cubicChar Q hQgood (Ideal.Quotient.mk Q p)) := by rw [← MulChar.pow_apply' _ (by decide : (2 : ℕ) ≠ 0), canonicalSextic_pow_two] rfl rw [hP2, hQ2, cubic_reciprocity_primary P Q hPgood hQgood p q hP hQ hpprimary hqprimary] def cubicTwoIdeal : Ideal O := Ideal.span {(-2 : O)} def cubicTwoIdeal_isMaximal : cubicTwoIdeal.IsMaximal := by rcases rational_prime_factor_cases 2 Nat.prime_two with hm | ⟨a, b, _, _, _, ha, _, _, _⟩ · simpa only [cubicTwoIdeal, Ideal.span_singleton_neg, Nat.cast_ofNat] using hm · have hin : (Ideal.span {a} : Ideal O) ∈ {I : Ideal O | Ideal.absNorm I = 2} := by change Ideal.absNorm (Ideal.span {a}) = 2 rwa [← qNat_eq_absNorm_span] rw [ShortDraftHeckeBridge.norm_p_fiber_inert Nat.prime_two (by decide)] at hin exact False.elim hin theorem cubicTwoIdeal_good : lambda ∉ cubicTwoIdeal := by letI := cubicTwoIdeal_isMaximal apply primary_maximal_divisor_good (-2 : O) neg_two_primary exact Ideal.subset_span (by simp) theorem cubicTwoIdeal_residue_char : ringChar (O ⧸ cubicTwoIdeal) = 2 := by letI := cubicTwoIdeal_isMaximal let : Field (O ⧸ cubicTwoIdeal) := Ideal.Quotient.field cubicTwoIdeal let : Fintype (O ⧸ cubicTwoIdeal) := Fintype.ofFinite _ have hmem : (2 : O) ∈ cubicTwoIdeal := by rw [cubicTwoIdeal, Ideal.span_singleton_neg] exact Ideal.subset_span (by simp) have hz : (2 : O ⧸ cubicTwoIdeal) = 0 := by simpa only [map_ofNat] using Ideal.Quotient.eq_zero_iff_mem.mpr hmem exact (Nat.prime_dvd_prime_iff_eq (CharP.char_is_prime (O ⧸ cubicTwoIdeal) _) Nat.prime_two).mp ((ringChar.spec (O ⧸ cubicTwoIdeal) 2).mp hz) theorem canonicalSextic_four_eq_fixed_two (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (p : O) (hP : P = Ideal.span {p}) (hprimary : lambda ^ 2 ∣ p - 1) : letI := cubicTwoIdeal_isMaximal canonicalSextic P hgood (Ideal.Quotient.mk P (4 : O)) = ConcreteTraceCRT.eisEmbedding (cubicChar cubicTwoIdeal cubicTwoIdeal_good (Ideal.Quotient.mk cubicTwoIdeal p)) := by letI := cubicTwoIdeal_isMaximal have hfour : Ideal.Quotient.mk P (4 : O) = (Ideal.Quotient.mk P (-2 : O)) ^ 2 := by simp only [map_ofNat, map_neg] ring rw [hfour, map_pow, ← MulChar.pow_apply' _ (by decide : (2 : ℕ) ≠ 0), canonicalSextic_pow_two] change ConcreteTraceCRT.eisEmbedding (cubicChar P hgood (Ideal.Quotient.mk P (-2 : O))) = _ congr 1 exact cubic_reciprocity_primary P cubicTwoIdeal hgood cubicTwoIdeal_good p (-2) hP rfl hprimary neg_two_primary theorem canonicalSextic_four_prod_eq_fixed_two {ι : Type*} (s : Finset ι) (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (p : ι → O) (hP : ∀ i ∈ s, P i = Ideal.span {p i}) (hprimary : ∀ i ∈ s, lambda ^ 2 ∣ p i - 1) : letI := cubicTwoIdeal_isMaximal (∏ i ∈ s, canonicalSextic (P i) (hgood i) (Ideal.Quotient.mk (P i) (4 : O))) = ConcreteTraceCRT.eisEmbedding (cubicChar cubicTwoIdeal cubicTwoIdeal_good (Ideal.Quotient.mk cubicTwoIdeal (∏ i ∈ s, p i))) := by letI := cubicTwoIdeal_isMaximal simp only [map_prod] apply Finset.prod_congr rfl intro i hi exact canonicalSextic_four_eq_fixed_two (P i) (hgood i) (p i) (hP i hi) (hprimary i hi) end ActualEisensteinCubic open scoped BigOperators Classical namespace IdealGaussCRT theorem sum_square_phase_finite_crt {ι T : Type*} [Fintype ι] (R : ι → Type*) [CommRing T] [∀ i, CommRing (R i)] [Fintype T] [∀ i, Fintype (R i)] (e : T ≃+* ∀ i, R i) (ψ : AddChar T ℂ) : (∑ x : T, ψ (x ^ 2)) = ∏ i, ∑ y : R i, coordinateAddChar R e ψ i (y ^ 2) := by calc _ = ∑ x : T, ∏ i, coordinateAddChar R e ψ i ((e x i) ^ 2) := by apply Finset.sum_congr rfl intro x _ rw [addChar_finite_crt_factor R e ψ (x ^ 2)] simp only [map_pow, Pi.pow_apply] _ = ∑ x : ∀ i, R i, ∏ i, coordinateAddChar R e ψ i ((x i) ^ 2) := Equiv.sum_comp e.toEquiv (fun x : ∀ i, R i => ∏ i, coordinateAddChar R e ψ i ((x i) ^ 2)) _ = _ := (Fintype.prod_sum (fun i (x : R i) => coordinateAddChar R e ψ i (x ^ 2))).symm theorem quadratic_gauss_finite_crt_eq_square_sum {ι T : Type*} [Fintype ι] (R : ι → Type*) [CommRing T] [∀ i, Field (R i)] [Fintype T] [∀ i, Fintype (R i)] (e : T ≃+* ∀ i, R i) (ψ : AddChar T ℂ) (hψ : ψ.IsPrimitive) (hchar : ∀ i, ringChar (R i) ≠ 2) : (∑ x : T, (∏ i, ((quadraticChar (R i)).ringHomComp (Int.castRingHom ℂ)) (e x i)) * ψ x) = ∑ x : T, ψ (x ^ 2) := by rw [gauss_sum_finite_crt R e (fun i => (quadraticChar (R i)).ringHomComp (Int.castRingHom ℂ)) ψ, sum_square_phase_finite_crt R e ψ] apply Finset.prod_congr rfl intro i _ have hp := coordinateAddChar_isPrimitive R e ψ hψ i have hn : coordinateAddChar R e ψ i ≠ 1 := by simpa only [AddChar.mulShift_one] using hp (a := 1) one_ne_zero exact ShortDraftQuadraticGauss.quadratic_gauss_as_square_phase _ (hchar i) hn end IdealGaussCRT namespace QuadraticGaussRay abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase ActualEisensteinCoordinates theorem canonicalProductGauss_three_eq_quadraticGamma {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) : canonicalProductGauss p hp hcop hgood (fun _ => 3) = quadraticGammaO (∏ i, p i) (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i)) := by let c := ∏ i, p i have hc : c ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i _ => hp i) let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let (i : ι) : Fintype (O ⧸ Ideal.span {p i}) := Fintype.ofFinite _ let (i : ι) : Field (O ⧸ Ideal.span {p i}) := Ideal.Quotient.field _ let e := productElementCRT p hcop let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc change (∑ x : O ⧸ Ideal.span {c}, (∏ i, (canonicalSextic (Ideal.span {p i}) (hgood i) ^ 3) (e x i)) * ψ x) / (‖eisEmbedding c‖ : ℂ) = (∑ x : O ⧸ Ideal.span {c}, ψ (x ^ 2)) / (‖eisEmbedding c‖ : ℂ) congr 1 simp_rw [canonicalSextic_pow_three_quadratic] exact IdealGaussCRT.quadratic_gauss_finite_crt_eq_square_sum (fun i => O ⧸ Ideal.span {p i}) e ψ (GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive c hc) hchar theorem I_zpow_eq_of_mod_four {a b : ℤ} (h : (a : ZMod 4) = b) : Complex.I ^ a = Complex.I ^ b := by obtain ⟨k, hk⟩ := (ZMod.intCast_eq_intCast_iff_dvd_sub b a 4).mp h.symm have ha : a = b + 4 * k := by omega rw [ha, zpow_add₀ Complex.I_ne_zero, zpow_mul] norm_num theorem fourTerms_eq_of_mod_four {a b c d : ℤ} (ha : (a : ZMod 4) = c) (hb : (b : ZMod 4) = d) : breveGaussianFourTerms a b = breveGaussianFourTerms c d := by have hn : ((-b : ℤ) : ZMod 4) = (-d : ℤ) := by simpa using congrArg Neg.neg hb have hs : ((b-a : ℤ) : ZMod 4) = (d-c : ℤ) := by push_cast rw [ha, hb] rw [breveGaussianFourTerms_formula, breveGaussianFourTerms_formula, I_zpow_eq_of_mod_four ha, I_zpow_eq_of_mod_four hn, I_zpow_eq_of_mod_four hs] def quadraticRayValue (r : EisensteinEPrimaryPhase.Coord) : ℂ := breveGaussianFourTerms (r.1.val : ℤ) (r.2.val : ℤ) theorem quadraticGammaO_eq_rayValue (c : O) (hc : c ≠ 0) : quadraticGammaO c hc = quadraticRayValue (residue c) := by have h := quadraticGammaO_eq_fourTerms (coords c).1 (coords c).2 (by rwa [eval_coords]) have h' : quadraticGammaO c hc = breveGaussianFourTerms (coords c).1 (coords c).2 := by simpa only [eval_coords] using h rw [h'] unfold quadraticRayValue _root_.OAI.ActualEisensteinCoordinates.residue exact fourTerms_eq_of_mod_four (by simp) (by simp) theorem canonicalProductGauss_three_eq_rayValue {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) : canonicalProductGauss p hp hcop hgood (fun _ => 3) = quadraticRayValue (residue (∏ i, p i)) := by rw [canonicalProductGauss_three_eq_quadraticGamma p hp hcop hgood hchar, quadraticGammaO_eq_rayValue] open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase ActualEisensteinCoordinates theorem fixed_two_mk_eq_residue_lift (c : O) : Ideal.Quotient.mk cubicTwoIdeal c = Ideal.Quotient.mk cubicTwoIdeal (lift (residue c)) := by obtain ⟨z, hz⟩ := congr_mod_four_of_residue_eq (residue_lift (residue c)).symm apply Ideal.Quotient.eq.mpr rw [cubicTwoIdeal, Ideal.mem_span_singleton] refine ⟨(-2 : O) * z, ?_⟩ calc c - lift (residue c) = 4 * z := hz _ = (-2 : O) * (-2 * z) := by ring def fixedGValue (r : EisensteinEPrimaryPhase.Coord) : ℂ := letI := cubicTwoIdeal_isMaximal (eisEmbedding (cubicChar cubicTwoIdeal cubicTwoIdeal_good (Ideal.Quotient.mk cubicTwoIdeal (lift r))))⁻¹ * quadraticRayValue r theorem residue_eq_of_four_dvd_sub (c d : O) (h : (4 : O) ∣ c - d) : residue c = residue d := by obtain ⟨z, hz⟩ := h have he : c = eval ((coords d).1 + 4 * (coords z).1) ((coords d).2 + 4 * (coords z).2) := by calc c = d + 4 * z := by linear_combination hz _ = eval (coords d).1 (coords d).2 + 4 * eval (coords z).1 (coords z).2 := by rw [eval_coords, eval_coords] _ = _ := by simp only [eval]; push_cast; ring rw [he, residue_eval] simp only [_root_.OAI.ActualEisensteinCoordinates.residue, Int.cast_add, Int.cast_mul, Int.cast_ofNat, show (4 : ZMod 4) = 0 by decide, zero_mul, add_zero] theorem residue_eq_of_quotient_four_eq (c d : O) (h : Ideal.Quotient.mk (Ideal.span {(4 : O)}) c = Ideal.Quotient.mk (Ideal.span {(4 : O)}) d) : residue c = residue d := residue_eq_of_four_dvd_sub c d (Ideal.mem_span_singleton.mp (Ideal.Quotient.eq.mp h)) def residueQuotientFour : (O ⧸ Ideal.span {(4 : O)}) → EisensteinEPrimaryPhase.Coord := Quotient.lift residue (fun c d h => residue_eq_of_quotient_four_eq c d (Quotient.sound h)) theorem residueQuotientFour_mk (c : O) : residueQuotientFour (Ideal.Quotient.mk (Ideal.span {(4 : O)}) c) = residue c := rfl def fixedGQuotientValue (r : O ⧸ Ideal.span {(4 : O)}) : ℂ := fixedGValue (residueQuotientFour r) theorem canonicalProductG_eq_fixedGValue {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hprimary : ∀ i, lambda ^ 2 ∣ p i - 1) : canonicalProductG p hp hcop hgood = fixedGValue (residue (∏ i, p i)) := by rw [canonicalProductG, canonicalSextic_four_prod_eq_fixed_two Finset.univ (fun i => Ideal.span {p i}) hgood p (fun i _ => rfl) (fun i _ => hprimary i), canonicalProductGauss_three_eq_rayValue p hp hcop hgood hchar, fixed_two_mk_eq_residue_lift] rfl theorem canonicalProductG_eq_fixed_quotient {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hprimary : ∀ i, lambda ^ 2 ∣ p i - 1) : canonicalProductG p hp hcop hgood = fixedGQuotientValue (Ideal.Quotient.mk (Ideal.span {(4 : O)}) (∏ i, p i)) := canonicalProductG_eq_fixedGValue p hp hcop hgood hchar hprimary end QuadraticGaussRay end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Poisson.RadialFourier namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff namespace EisensteinSchwartzPoisson section open MeasureTheory open scoped FourierTransform SchwartzMap RealInnerProductSpace ContDiff def radialTestCLM : 𝓢(ℝ, ℂ) →L[ℝ] 𝓢(ℂ, ℂ) := SchwartzMap.compCLM ℝ (Function.hasTemperateGrowth_norm_sq ℂ) ⟨1, 1, fun z => by simp only [pow_one, one_mul, norm_pow, Real.norm_of_nonneg (norm_nonneg z)] nlinarith [sq_nonneg (‖z‖ - 1)]⟩ theorem radialTestCLM_apply (W : 𝓢(ℝ, ℂ)) : radialTestCLM W = radialTest W := by ext z rfl def radialFourierCLM : 𝓢(ℝ, ℂ) →L[ℝ] 𝓢(ℂ, ℂ) := (FourierTransform.fourierCLM ℝ 𝓢(ℂ, ℂ)).comp radialTestCLM theorem radialFourierCLM_apply (W : 𝓢(ℝ, ℂ)) : radialFourierCLM W = 𝓕 (radialTest W) := by simp [radialFourierCLM, radialTestCLM_apply] theorem paperRadialFourier_eq_plane (W : 𝓢(ℝ, ℂ)) (t : ℝ) : paperRadialFourier W t = (2 / Real.sqrt 3 : ℝ) • radialFourierCLM W (paperFrequency (Real.sqrt t : ℂ)) := by rw [paperRadialFourier, paperFourier_eq_standard, radialFourierCLM_apply] rfl theorem paperFrequency_sqrt_norm_sq (t : ℝ) (ht : 0 ≤ t) : ‖paperFrequency (Real.sqrt t : ℂ)‖ ^ 2 = (4 / 3 : ℝ) * t := by rw [paperFrequency_norm_sq] simp only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg t), Real.sq_sqrt ht] theorem paperRadialFourier_weighted_bound (W : 𝓢(ℝ, ℂ)) (A : ℕ) (t : ℝ) (ht : 0 ≤ t) : (1 + t) ^ A * ‖paperRadialFourier W t‖ ≤ (2 / Real.sqrt 3 : ℝ) * 2 ^ (2 * A) * (Finset.Iic (2 * A, 0)).sup (schwartzSeminormFamily ℝ ℂ ℂ) (radialFourierCLM W) := by let ξ : ℂ := paperFrequency (Real.sqrt t : ℂ) have hn : ‖ξ‖ ^ 2 = (4 / 3 : ℝ) * t := paperFrequency_sqrt_norm_sq t ht have hscale : 0 ≤ (2 / Real.sqrt 3 : ℝ) := by positivity have hpow : (1 + t) ^ A ≤ (1 + ‖ξ‖) ^ (2 * A) := by have hbase : 1 + t ≤ (1 + ‖ξ‖) ^ 2 := by nlinarith [norm_nonneg ξ] calc (1 + t) ^ A ≤ ((1 + ‖ξ‖) ^ 2) ^ A := pow_le_pow_left₀ (by positivity) hbase A _ = _ := by rw [← pow_mul] have hb := SchwartzMap.one_add_le_sup_seminorm_apply (𝕜 := ℝ) (m := (2 * A, 0)) (k := 2 * A) (n := 0) le_rfl le_rfl (radialFourierCLM W) ξ simp only [norm_iteratedFDeriv_zero] at hb rw [paperRadialFourier_eq_plane, norm_smul, Real.norm_eq_abs, abs_of_nonneg hscale] change (1 + t) ^ A * ((2 / Real.sqrt 3) * ‖radialFourierCLM W ξ‖) ≤ _ calc _ = (2 / Real.sqrt 3) * ((1 + t) ^ A * ‖radialFourierCLM W ξ‖) := by ring _ ≤ (2 / Real.sqrt 3) * ((1 + ‖ξ‖) ^ (2 * A) * ‖radialFourierCLM W ξ‖) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hpow (norm_nonneg _)) hscale _ ≤ _ := by convert mul_le_mul_of_nonneg_left hb hscale using 1 <;> first | rfl | (ring_nf <;> rfl) theorem schwartzCLM_finite_seminorm_control {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (T : 𝓢(ℝ, ℂ) →L[ℝ] 𝓢(E, ℂ)) (S : Finset (ℕ × ℕ)) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ W : 𝓢(ℝ, ℂ), S.sup (schwartzSeminormFamily ℝ E ℂ) (T W) ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by let q : Seminorm ℝ 𝓢(ℝ, ℂ) := (S.sup (schwartzSeminormFamily ℝ E ℂ)).comp T.toLinearMap have hq : Continuous q := (((schwartz_withSeminorms ℝ E ℂ).finset_sups).continuous_seminorm S).comp T.continuous obtain ⟨s, C, hC, hbound⟩ := Seminorm.bound_of_continuous (schwartz_withSeminorms ℝ ℝ ℂ) q hq refine ⟨s, C, ?_, ?_⟩ · exact_mod_cast (pos_iff_ne_zero.mpr hC : 0 < C) · intro W exact Seminorm.le_def.mp hbound W theorem paperRadialFourier_source_weighted_bound (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (W : 𝓢(ℝ, ℂ)) (t : ℝ), 0 ≤ t → (1 + t) ^ A * ‖paperRadialFourier W t‖ ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by obtain ⟨s, C, hC, hbound⟩ := schwartzCLM_finite_seminorm_control radialFourierCLM (Finset.Iic (2 * A, 0)) refine ⟨s, (2 / Real.sqrt 3) * 2 ^ (2 * A) * C, by positivity, ?_⟩ intro W t ht apply (paperRadialFourier_weighted_bound W A t ht).trans simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (hbound W) (show 0 ≤ (2 / Real.sqrt 3) * 2 ^ (2 * A) by positivity) end section open MeasureTheory open scoped SchwartzMap ContDiff def halfEulerCLM : 𝓢(ℝ, ℂ) →L[ℂ] 𝓢(ℝ, ℂ) := (SchwartzMap.smulLeftCLM ℂ (fun x : ℝ => ((x / 2 : ℝ) : ℂ))).comp (SchwartzMap.derivCLM ℂ ℂ) theorem halfEulerCLM_apply (g : 𝓢(ℝ, ℂ)) (s : ℝ) : halfEulerCLM g s = (s / 2 : ℝ) • deriv g s := by have hg : (fun x : ℝ => ((x / 2 : ℝ) : ℂ)).HasTemperateGrowth := by simp only [div_eq_mul_inv] fun_prop simp only [halfEulerCLM, ContinuousLinearMap.comp_apply, SchwartzMap.smulLeftCLM_apply_apply hg, SchwartzMap.derivCLM_apply] rfl theorem hasDerivAt_halfFlow (g : 𝓢(ℝ, ℂ)) (a t : ℝ) : HasDerivAt (fun y : ℝ => g (a * Real.exp (y / 2))) (halfEulerCLM g (a * Real.exp (t / 2))) t := by have hf : HasDerivAt (fun y : ℝ => a * Real.exp (y / 2)) ((a * Real.exp (t / 2)) / 2) t := by simpa only [id_eq, one_div, div_eq_mul_inv, mul_assoc, one_mul] using (((hasDerivAt_id t).div_const 2).exp.const_mul a) simpa only [halfEulerCLM_apply, Function.comp_def] using (g.hasDerivAt (a * Real.exp (t / 2))).scomp t hf theorem iteratedDeriv_halfFlow (g : 𝓢(ℝ, ℂ)) (a : ℝ) (j : ℕ) (t : ℝ) : iteratedDeriv j (fun y : ℝ => g (a * Real.exp (y / 2))) t = ((halfEulerCLM : 𝓢(ℝ, ℂ) → 𝓢(ℝ, ℂ))^[j] g) (a * Real.exp (t / 2)) := by induction j generalizing g with | zero => simp | succ j ih => rw [iteratedDeriv_succ'] have hd : deriv (fun y : ℝ => g (a * Real.exp (y / 2))) = fun y : ℝ => halfEulerCLM g (a * Real.exp (y / 2)) := funext (fun y => (hasDerivAt_halfFlow g a y).deriv) rw [hd, ih (halfEulerCLM g), Function.iterate_succ_apply] theorem sqrt_exp_half (t : ℝ) : Real.sqrt (Real.exp t) = Real.exp (t / 2) := by rw [Real.sqrt_eq_iff_eq_sq (le_of_lt (Real.exp_pos _)) (le_of_lt (Real.exp_pos _))] rw [← Real.exp_nat_mul] congr 1 ring theorem eulerDeriv_sqrt_profile (g : 𝓢(ℝ, ℂ)) (j : ℕ) (x : ℝ) (hx : 0 ≤ x) : LocalLogFourier.eulerDeriv (fun s => g (Real.sqrt s)) j x = ((halfEulerCLM : 𝓢(ℝ, ℂ) → 𝓢(ℝ, ℂ))^[j] g) (Real.sqrt x) := by unfold LocalLogFourier.eulerDeriv have hflow : (fun t : ℝ => g (Real.sqrt (x * Real.exp t))) = fun t : ℝ => g (Real.sqrt x * Real.exp (t / 2)) := by funext t rw [Real.sqrt_mul hx, sqrt_exp_half] rw [hflow, iteratedDeriv_halfFlow] simp theorem contDiffOn_sqrt_profile (g : 𝓢(ℝ, ℂ)) : ContDiffOn ℝ ∞ (fun x : ℝ => g (Real.sqrt x)) (Set.Ioi 0) := by intro x hx exact ((g.smooth ⊤).contDiffAt.comp x (Real.contDiffAt_sqrt (ne_of_gt hx))).contDiffWithinAt theorem sqrt_profile_rapid_bound (g : 𝓢(ℝ, ℂ)) (A : ℕ) (x : ℝ) (hx : 0 ≤ x) : (1 + x) ^ A * ‖g (Real.sqrt x)‖ ≤ 2 ^ A * (SchwartzMap.seminorm ℝ 0 0 g + SchwartzMap.seminorm ℝ (2 * A) 0 g) := by have hsmall := SchwartzMap.norm_le_seminorm ℝ g (Real.sqrt x) have hlarge := SchwartzMap.norm_pow_mul_le_seminorm ℝ g (2 * A) (Real.sqrt x) have hsqrt : ‖Real.sqrt x‖ ^ (2 * A) = x ^ A := by rw [Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg x), pow_mul, Real.sq_sqrt hx] rw [hsqrt] at hlarge have hs0 : 0 ≤ SchwartzMap.seminorm ℝ 0 0 g := by positivity have hsA : 0 ≤ SchwartzMap.seminorm ℝ (2 * A) 0 g := by positivity by_cases hx1 : x ≤ 1 · have hp : (1 + x) ^ A ≤ (2 : ℝ) ^ A := by gcongr; linarith calc _ ≤ 2 ^ A * ‖g (Real.sqrt x)‖ := mul_le_mul_of_nonneg_right hp (norm_nonneg _) _ ≤ 2 ^ A * SchwartzMap.seminorm ℝ 0 0 g := by gcongr _ ≤ _ := by gcongr; linarith · have hp : (1 + x) ^ A ≤ (2 * x) ^ A := by gcongr; linarith calc _ ≤ (2 * x) ^ A * ‖g (Real.sqrt x)‖ := mul_le_mul_of_nonneg_right hp (norm_nonneg _) _ = 2 ^ A * (x ^ A * ‖g (Real.sqrt x)‖) := by rw [mul_pow]; ring _ ≤ 2 ^ A * SchwartzMap.seminorm ℝ (2 * A) 0 g := by gcongr _ ≤ _ := by gcongr; linarith theorem paperFrequency_real_temperate : (fun s : ℝ => paperFrequency (s : ℂ)).HasTemperateGrowth := by have heq : (fun s : ℝ => paperFrequency (s : ℂ)) = fun s : ℝ => (2 * Complex.I / (Real.sqrt 3 : ℂ)) * (s : ℂ) := by funext s simp [paperFrequency] rw [heq] fun_prop theorem paperFrequency_real_growth (s : ℝ) : ‖s‖ ≤ 1 + ‖paperFrequency (s : ℂ)‖ := by have hn := paperFrequency_norm_sq (s : ℂ) have heq : ‖(s : ℂ)‖ = ‖s‖ := by simp rw [heq] at hn have hns := norm_nonneg s have hnf := norm_nonneg (paperFrequency (s : ℂ)) nlinarith [sq_nonneg (‖s‖ - ‖paperFrequency (s : ℂ)‖)] def paperRealRayCLM : 𝓢(ℂ, ℂ) →L[ℝ] 𝓢(ℝ, ℂ) := SchwartzMap.compCLM ℝ paperFrequency_real_temperate ⟨1, 1, by simpa using paperFrequency_real_growth⟩ theorem paperRealRayCLM_apply (g : 𝓢(ℂ, ℂ)) (s : ℝ) : paperRealRayCLM g s = g (paperFrequency (s : ℂ)) := rfl def halfEulerIterateCLM : ℕ → 𝓢(ℝ, ℂ) →L[ℝ] 𝓢(ℝ, ℂ) | 0 => ContinuousLinearMap.id ℝ _ | j + 1 => (halfEulerCLM.restrictScalars ℝ).comp (halfEulerIterateCLM j) theorem halfEulerIterateCLM_apply (j : ℕ) (g : 𝓢(ℝ, ℂ)) : halfEulerIterateCLM j g = (halfEulerCLM : 𝓢(ℝ, ℂ) → 𝓢(ℝ, ℂ))^[j] g := by induction j with | zero => rfl | succ j ih => simp only [halfEulerIterateCLM, ContinuousLinearMap.comp_apply, ih, Function.iterate_succ_apply'] rfl def paperFourierRayCLM : 𝓢(ℝ, ℂ) →L[ℝ] 𝓢(ℝ, ℂ) := (2 / Real.sqrt 3 : ℝ) • (paperRealRayCLM.comp radialFourierCLM) theorem paperFourierRayCLM_apply (W : 𝓢(ℝ, ℂ)) (s : ℝ) : paperFourierRayCLM W s = (2 / Real.sqrt 3 : ℝ) • radialFourierCLM W (paperFrequency (s : ℂ)) := by simp [paperFourierRayCLM, paperRealRayCLM_apply] theorem paperRadialFourier_eq_ray (W : 𝓢(ℝ, ℂ)) : paperRadialFourier W = fun x : ℝ => paperFourierRayCLM W (Real.sqrt x) := by funext x rw [paperRadialFourier_eq_plane, paperFourierRayCLM_apply] def paperEulerCLM (j : ℕ) : 𝓢(ℝ, ℂ) →L[ℝ] 𝓢(ℝ, ℂ) := (halfEulerIterateCLM j).comp paperFourierRayCLM theorem paperRadialFourier_eulerDeriv (W : 𝓢(ℝ, ℂ)) (j : ℕ) (x : ℝ) (hx : 0 ≤ x) : LocalLogFourier.eulerDeriv (paperRadialFourier W) j x = paperEulerCLM j W (Real.sqrt x) := by rw [paperRadialFourier_eq_ray, eulerDeriv_sqrt_profile _ j x hx] simp only [paperEulerCLM, ContinuousLinearMap.comp_apply, halfEulerIterateCLM_apply] theorem paperRadialFourier_contDiffOn (W : 𝓢(ℝ, ℂ)) : ContDiffOn ℝ ∞ (paperRadialFourier W) (Set.Ioi 0) := by rw [paperRadialFourier_eq_ray] exact contDiffOn_sqrt_profile _ theorem paperRadialFourier_euler_weighted_bound (W : 𝓢(ℝ, ℂ)) (A j : ℕ) (x : ℝ) (hx : 0 ≤ x) : (1 + x) ^ A * ‖LocalLogFourier.eulerDeriv (paperRadialFourier W) j x‖ ≤ 2 ^ A * (SchwartzMap.seminorm ℝ 0 0 (paperEulerCLM j W) + SchwartzMap.seminorm ℝ (2 * A) 0 (paperEulerCLM j W)) := by rw [paperRadialFourier_eulerDeriv W j x hx] exact sqrt_profile_rapid_bound _ A x hx theorem schwartzCLM_family_finite_seminorm_control (T : ℕ → 𝓢(ℝ, ℂ) →L[ℝ] 𝓢(ℝ, ℂ)) (A K : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (W : 𝓢(ℝ, ℂ)) (j : ℕ), j ≤ K → SchwartzMap.seminorm ℝ 0 0 (T j W) + SchwartzMap.seminorm ℝ (2 * A) 0 (T j W) ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by let qj : ℕ → Seminorm ℝ 𝓢(ℝ, ℂ) := fun j => (SchwartzMap.seminorm ℝ 0 0 + SchwartzMap.seminorm ℝ (2 * A) 0).comp (T j).toLinearMap let q : Seminorm ℝ 𝓢(ℝ, ℂ) := ∑ j ∈ Finset.range (K + 1), qj j have hqfun : (q : 𝓢(ℝ, ℂ) → ℝ) = fun W => ∑ j ∈ Finset.range (K + 1), (SchwartzMap.seminorm ℝ 0 0 (T j W) + SchwartzMap.seminorm ℝ (2 * A) 0 (T j W)) := by funext W simp [q, qj] have hq : Continuous q := by rw [hqfun] apply continuous_finsetSum intro j hj exact (((schwartz_withSeminorms ℝ ℝ ℂ).continuous_seminorm (0, 0)).comp (T j).continuous).add (((schwartz_withSeminorms ℝ ℝ ℂ).continuous_seminorm (2 * A, 0)).comp (T j).continuous) obtain ⟨s, C, hC, hbound⟩ := Seminorm.bound_of_continuous (schwartz_withSeminorms ℝ ℝ ℂ) q hq refine ⟨s, C, ?_, ?_⟩ · exact_mod_cast (pos_iff_ne_zero.mpr hC : 0 < C) · intro W j hj apply le_trans ?_ (Seminorm.le_def.mp hbound W) rw [hqfun] exact Finset.single_le_sum (f := fun i => SchwartzMap.seminorm ℝ 0 0 (T i W) + SchwartzMap.seminorm ℝ (2 * A) 0 (T i W)) (by intro i hi; positivity) (Finset.mem_range.mpr (Nat.lt_succ_of_le hj)) theorem paperRadialFourier_euler_source_weighted_bound (A K : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (W : 𝓢(ℝ, ℂ)) (j : ℕ), j ≤ K → ∀ (x : ℝ), 0 ≤ x → (1 + x) ^ A * ‖LocalLogFourier.eulerDeriv (paperRadialFourier W) j x‖ ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by obtain ⟨s, C, hC, hbound⟩ := schwartzCLM_family_finite_seminorm_control paperEulerCLM A K refine ⟨s, 2 ^ A * C, by positivity, ?_⟩ intro W j hj x hx apply (paperRadialFourier_euler_weighted_bound W A j x hx).trans simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (hbound W j hj) (show 0 ≤ (2 : ℝ) ^ A by positivity) theorem paperRadialFourier_euler_bound (W : 𝓢(ℝ, ℂ)) (A K : ℕ) : ∃ CF : ℝ, 0 ≤ CF ∧ ∀ j ≤ K, ∀ x : ℝ, 0 < x → (1 + x) ^ A * ‖LocalLogFourier.eulerDeriv (paperRadialFourier W) j x‖ ≤ CF := by obtain ⟨s, C, hC, hbound⟩ := paperRadialFourier_euler_source_weighted_bound A K refine ⟨C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W, by positivity, ?_⟩ intro j hj x hx exact hbound W j hj x hx.le end open ConcreteTraceCRT ActualEisensteinCubic open scoped SchwartzMap theorem inverse_square_le_cauchy_product (a b q : ℝ) (hq : 0 ≤ q) (hQ : (a ^ 2 + b ^ 2) / 2 ≤ q) : ((1 + q) ^ 2)⁻¹ ≤ 4 * ((1 + a ^ 2)⁻¹ * (1 + b ^ 2)⁻¹) := by have hsum : 1 + a ^ 2 + b ^ 2 ≤ 2 * (1 + q) := by linarith have hsquare : (1 + a ^ 2 + b ^ 2) ^ 2 ≤ (2 * (1 + q)) ^ 2 := by apply pow_le_pow_left₀ (by positivity) hsum have hden : (1 + a ^ 2) * (1 + b ^ 2) ≤ 4 * (1 + q) ^ 2 := by nlinarith [sq_nonneg (a ^ 2), sq_nonneg (b ^ 2), mul_nonneg (sq_nonneg a) (sq_nonneg b)] calc _ = 1 / (1 + q) ^ 2 := by simp only [one_div] _ ≤ 4 / ((1 + a ^ 2) * (1 + b ^ 2)) := (div_le_div_iff₀ (by positivity) (by positivity)).mpr (by simpa using hden) _ = _ := by simp only [div_eq_mul_inv, mul_inv_rev]; ring theorem eisenstein_cauchy_summable : Summable (fun h : O => ((1 + ‖eisEmbedding h‖ ^ 2) ^ 2)⁻¹) := by apply (latticeCoordEquiv.symm.summable_iff).mp change Summable (fun p : ℤ × ℤ => ((1 + ‖eisEmbedding (latticeCoordEquiv.symm p)‖ ^ 2) ^ 2)⁻¹) apply Summable.of_nonneg_of_le (fun _ => inv_nonneg.mpr (sq_nonneg _)) _ (summable_int_cauchy_product.mul_left 4) intro p apply inverse_square_le_cauchy_product (p.1 : ℝ) (p.2 : ℝ) (‖eisEmbedding (latticeCoordEquiv.symm p)‖ ^ 2) (sq_nonneg _) change ((p.1 : ℝ) ^ 2 + (p.2 : ℝ) ^ 2) / 2 ≤ ‖eisEmbedding (ActualEisensteinCoordinates.eval p.1 p.2)‖ ^ 2 rw [eisEmbedding_eval_norm_sq] push_cast nlinarith [sq_nonneg ((p.1 : ℝ) - (p.2 : ℝ))] def eisensteinCauchyMass : ℝ := ∑' h : O, ((1 + ‖eisEmbedding h‖ ^ 2) ^ 2)⁻¹ theorem eisensteinCauchyMass_nonneg : 0 ≤ eisensteinCauchyMass := tsum_nonneg (fun _ => by positivity) theorem eisensteinCauchyMass_subtype (S : Set O) : (∑' h : S, ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹) ≤ eisensteinCauchyMass := by exact (eisenstein_cauchy_summable.subtype S).tsum_le_tsum_of_inj Subtype.val Subtype.val_injective (fun _ _ => by positivity) (fun _ => le_rfl) eisenstein_cauchy_summable theorem polynomial_tail_majorant (A : ℕ) (K T q B f : ℝ) (hK : 0 < K) (hT : 0 ≤ T) (hq : 0 ≤ q) (hf : 0 ≤ f) (htail : T ≤ K * q) (hbound : (1 + K * q) ^ (A + 2) * f ≤ B) : f ≤ (B / ((min 1 K) ^ 2 * (1 + T) ^ A)) * ((1 + q) ^ 2)⁻¹ := by have hm : 0 < min 1 K := lt_min (by norm_num) hK have hm1 : min 1 K ≤ 1 := min_le_left _ _ have hmK : min 1 K ≤ K := min_le_right _ _ have hbase : min 1 K * (1 + q) ≤ 1 + K * q := by nlinarith [mul_le_mul_of_nonneg_right hmK hq] have htwo : (min 1 K) ^ 2 * (1 + q) ^ 2 ≤ (1 + K * q) ^ 2 := by rw [← mul_pow] exact pow_le_pow_left₀ (by positivity) hbase _ have hpow : (1 + T) ^ A ≤ (1 + K * q) ^ A := pow_le_pow_left₀ (by positivity) (by linarith) _ have hden : ((min 1 K) ^ 2 * (1 + T) ^ A) * (1 + q) ^ 2 ≤ (1 + K * q) ^ (A + 2) := by have hh := mul_le_mul hpow htwo (by positivity) (by positivity) rw [pow_add] nlinarith have hprod : f * (((min 1 K) ^ 2 * (1 + T) ^ A) * (1 + q) ^ 2) ≤ B := by calc _ = (((min 1 K) ^ 2 * (1 + T) ^ A) * (1 + q) ^ 2) * f := mul_comm _ _ _ ≤ (1 + K * q) ^ (A + 2) * f := mul_le_mul_of_nonneg_right hden hf _ ≤ B := hbound have hraw := (le_div_iff₀ (show 0 < ((min 1 K) ^ 2 * (1 + T) ^ A) * (1 + q) ^ 2 by positivity)).mpr hprod simpa only [div_eq_mul_inv, mul_inv_rev, mul_comm, mul_left_comm, mul_assoc] using hraw theorem paperRadialFourier_lattice_summable_norm (W : 𝓢(ℝ, ℂ)) (K : ℝ) (hK : 0 < K) : Summable (fun h : O => ‖paperRadialFourier W (K * ‖eisEmbedding h‖ ^ 2)‖) := by obtain ⟨s, C, hC, hb⟩ := paperRadialFourier_source_weighted_bound 2 let B := C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W let D := (min 1 K) ^ 2 * (1 + (0 : ℝ)) ^ (0 : ℕ) apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ (eisenstein_cauchy_summable.mul_left (B / D)) intro h exact polynomial_tail_majorant 0 K 0 _ B _ hK (by norm_num) (sq_nonneg _) (norm_nonneg _) (by positivity) (hb W _ (by positivity)) theorem paperRadialFourier_lattice_tail (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (W : 𝓢(ℝ, ℂ)) (K T : ℝ), 0 < K → 0 ≤ T → (∑' h : {h : O // T ≤ K * ‖eisEmbedding h‖ ^ 2}, ‖paperRadialFourier W (K * ‖eisEmbedding h.val‖ ^ 2)‖) ≤ (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / ((min 1 K) ^ 2 * (1 + T) ^ A) := by obtain ⟨s, C, hC, hb⟩ := paperRadialFourier_source_weighted_bound (A + 2) refine ⟨s, C * (eisensteinCauchyMass + 1), by have := eisensteinCauchyMass_nonneg positivity, ?_⟩ intro W K T hK hT let B := C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W let D := (min 1 K) ^ 2 * (1 + T) ^ A have hB : 0 ≤ B := by dsimp [B]; positivity have hm : 0 < min 1 K := lt_min (by norm_num) hK have hD : 0 < D := by dsimp [D]; positivity let S := {h : O | T ≤ K * ‖eisEmbedding h‖ ^ 2} have hp (h : S) : ‖paperRadialFourier W (K * ‖eisEmbedding h.val‖ ^ 2)‖ ≤ (B / D) * ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹ := by exact polynomial_tail_majorant A K T _ B _ hK hT (sq_nonneg _) (norm_nonneg _) h.property (hb W _ (by positivity)) have hmajor : Summable (fun h : S => (B / D) * ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹) := (eisenstein_cauchy_summable.subtype S).mul_left (B / D) have hs : Summable (fun h : S => ‖paperRadialFourier W (K * ‖eisEmbedding h.val‖ ^ 2)‖) := Summable.of_nonneg_of_le (fun _ => norm_nonneg _) hp hmajor calc _ ≤ ∑' h : S, (B / D) * ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹ := hs.tsum_le_tsum hp hmajor _ = (B / D) * ∑' h : S, ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹ := tsum_mul_left _ ≤ (B / D) * eisensteinCauchyMass := mul_le_mul_of_nonneg_left (eisensteinCauchyMass_subtype S) (div_nonneg hB hD.le) _ ≤ (B / D) * (eisensteinCauchyMass + 1) := by gcongr linarith _ = _ := by dsimp [B, D]; ring end EisensteinSchwartzPoisson open scoped BigOperators Classical SchwartzMap ContDiff namespace ConcretePrimeRowBridge open ActualEisensteinCubic ShortDraftHeckeBridge theorem idealSupport_injective_on_squarefree (F : Finset (Ideal O)) {I J : Ideal O} (hI : I ∈ F) (hJ : J ∈ F) (hsI : Squarefree I) (hsJ : Squarefree J) (h : idealSupport F I = idealSupport F J) : I = J := by have hfac : UniqueFactorizationMonoid.normalizedFactors I = UniqueFactorizationMonoid.normalizedFactors J := by rw [Multiset.Nodup.ext ((UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors hsI.ne_zero).mp hsI) ((UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors hsJ.ne_zero).mp hsJ)] intro P constructor · intro hP let p : primePool F := ⟨P, mem_primePool_iff.mpr ⟨I, hI, hP⟩⟩ have hp : p ∈ idealSupport F I := (mem_idealSupport_iff F I p).mpr hP rw [h] at hp exact (mem_idealSupport_iff F J p).mp hp · intro hP let p : primePool F := ⟨P, mem_primePool_iff.mpr ⟨J, hJ, hP⟩⟩ have hp : p ∈ idealSupport F J := (mem_idealSupport_iff F J p).mpr hP rw [← h] at hp exact (mem_idealSupport_iff F I p).mp hp rw [← Ideal.prod_normalizedFactors_eq_self hsI.ne_zero, ← Ideal.prod_normalizedFactors_eq_self hsJ.ne_zero, hfac] end ConcretePrimeRowBridge end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.ActiveConductor namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff namespace ActualEisensteinCubic section theorem activeSupport_nonempty_of_ne {α : Type*} [DecidableEq α] {S T : Finset α} (h : S ≠ T) : (activeSupport S T).Nonempty := by by_contra hn apply h have he : activeSupport S T = ∅ := Finset.not_nonempty_iff_eq_empty.mp hn ext i simp only [activeSupport, Finset.union_eq_empty, Finset.sdiff_eq_empty_iff_subset] at he exact ⟨fun hi => he.1 hi, fun hi => he.2 hi⟩ open ConcreteTraceCRT EisensteinSchwartzPoisson theorem finiteSexticRow_of_isEmpty {ι : Type*} [Fintype ι] [IsEmpty ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) (a : O) : finiteSexticRow P hgood j a = 1 := by simp [finiteSexticRow] theorem finitePrimeModulus_norm_of_isEmpty {ι : Type*} [Fintype ι] [IsEmpty ι] (P : ι → Ideal O) : ‖eisEmbedding (finitePrimeModulus P)‖ = 1 := by have h := finitePrimeModulus_norm_sq P simp only [Finset.univ_eq_empty, Finset.prod_empty, map_one, Nat.cast_one] at h nlinarith [norm_nonneg (eisEmbedding (finitePrimeModulus P))] theorem canonicalGaussSum_of_isEmpty {ι : Type*} [Fintype ι] [IsEmpty ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) : canonicalGaussSum P hcop hgood j = 1 := by let c := finitePrimeModulus P have hc : Ideal.span {c} = ⊤ := by simpa only [c, Finset.univ_eq_empty, Finset.prod_empty, Ideal.one_eq_top] using span_finitePrimeModulus P have hzero (r : O ⧸ Ideal.span {c}) : r = 0 := by obtain ⟨a, rfl⟩ := Ideal.Quotient.mk_surjective r exact Ideal.Quotient.eq_zero_iff_mem.mpr (by rw [hc]; trivial) let : Subsingleton (O ⧸ Ideal.span {c}) := ⟨fun a b => (hzero a).trans (hzero b).symm⟩ let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span (finitePrimeModulus_ne_zero P) let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ unfold canonicalGaussSum change (∑ r : O ⧸ Ideal.span {c}, _ ) = 1 rw [Fintype.sum_subsingleton _ 0] simp [principalSexticRow, finiteSexticQuotientRow] theorem canonicalNormalizedGauss_of_isEmpty {ι : Type*} [Fintype ι] [IsEmpty ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hgood : ∀ i, lambda ∉ P i) (j : ι → ℕ) : canonicalNormalizedGauss P hcop hgood j = 1 := by rw [canonicalNormalizedGauss, canonicalGaussSum_of_isEmpty, finitePrimeModulus_norm_of_isEmpty, Complex.ofReal_one, div_one] noncomputable def squarefreePairPoissonZeroMode {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (hgood : ∀ i, lambda ∉ P i) (S T : Finset ι) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) : ℂ := let Q := activePrimes P S T let hQ := activePrimes_pairwise_isCoprime P hinj S T let row := finiteSexticRow Q (fun i => hgood i.val) (activeExponent S T) let c := finitePrimeModulus Q ((scale : ℂ) * canonicalNormalizedGauss Q hQ (fun i => hgood i.val) (activeExponent S T) / (‖eisEmbedding c‖ : ℂ)) * ∑ E ∈ (S ∩ T).powerset, let d := primeSubsetGenerator P E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) * row d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * (star (row 0) * paperRadialFourier W 0) end open EisensteinSchwartzPoisson theorem primeSubset_moebius_norm_sum {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hprime : ∀ i, Prime (P i)) (hinj : Function.Injective P) (S : Finset ι) : (∑ E ∈ S.powerset, (UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) / (Ideal.absNorm (∏ i ∈ E, P i) : ℂ)) = ∏ i ∈ S, (1 - (1 : ℂ) / Ideal.absNorm (P i)) := by rw [Finset.prod_sub] apply Finset.sum_congr rfl intro E hE rw [prime_product_moebius P hprime hinj E] simp only [Finset.prod_const_one, mul_one, map_prod, Nat.cast_prod, Finset.prod_inv_distrib, div_eq_mul_inv, one_mul] theorem primeDensity_nonneg_le_one {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (S : Finset ι) : 0 ≤ (∏ i ∈ S, (1 - (1 : ℝ) / Ideal.absNorm (P i))) ∧ (∏ i ∈ S, (1 - (1 : ℝ) / Ideal.absNorm (P i))) ≤ 1 := by have hfactor (i : ι) : 0 ≤ 1 - (1 : ℝ) / Ideal.absNorm (P i) ∧ 1 - (1 : ℝ) / Ideal.absNorm (P i) ≤ 1 := by have hnorm : (1 : ℝ) ≤ Ideal.absNorm (P i) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (NeZero.ne (P i))) constructor · exact sub_nonneg.mpr ((div_le_one (by linarith)).mpr hnorm) · have : 0 ≤ (1 : ℝ) / Ideal.absNorm (P i) := by positivity linarith exact ⟨Finset.prod_nonneg (fun i _ => (hfactor i).1), Finset.prod_le_one₀ (fun i _ => (hfactor i).1) (fun i _ => (hfactor i).2)⟩ end ActualEisensteinCubic namespace ConcretePrimeRowBridge open ActualEisensteinCubic ShortDraftHeckeBridge EisensteinSchwartzPoisson noncomputable def idealPairPoissonZeroMode (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) : ℂ := by letI : ∀ i : primePool F, (i.1).IsMaximal := primePool_maximal F hFpos exact squarefreePairPoissonZeroMode (fun i : primePool F => i.1) Subtype.val_injective (primePool_good F hFgood) (idealSupport F I) (idealSupport F J) W scale end ConcretePrimeRowBridge open scoped BigOperators Classical SchwartzMap ContDiff namespace ActualEisensteinCubic open ConcreteTraceCRT EisensteinSchwartzPoisson end ActualEisensteinCubic namespace ConcretePrimeRowBridge open ActualEisensteinCubic ShortDraftHeckeBridge ConcreteTraceCRT EisensteinSchwartzPoisson noncomputable def idealPrimeDensity (F : Finset (Ideal O)) (I : Ideal O) : ℝ := ∏ i ∈ idealSupport F I, (1 - (1 : ℝ) / Ideal.absNorm i.val) theorem idealPrimeDensity_mem_Icc (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (I : Ideal O) : idealPrimeDensity F I ∈ Set.Icc (0 : ℝ) 1 := by let : ∀ i : primePool F, (i.val).IsMaximal := primePool_maximal F hFpos exact primeDensity_nonneg_le_one (fun i : primePool F => i.val) (idealSupport F I) end ConcretePrimeRowBridge namespace ShortDraftHeckeBridge end ShortDraftHeckeBridge namespace ConcretePrimeRowBridge section open ActualEisensteinCubic ShortDraftHeckeBridge EisensteinSchwartzPoisson end open ActualEisensteinCubic ShortDraftHeckeBridge theorem idealSupport_image_eq_factors (F : Finset (Ideal O)) {I : Ideal O} (hI : I ∈ F) : (idealSupport F I).image Subtype.val = (UniqueFactorizationMonoid.normalizedFactors I).toFinset := by ext P simp only [Finset.mem_image, Multiset.mem_toFinset] constructor · rintro ⟨p, hp, rfl⟩ exact (mem_idealSupport_iff F I p).mp hp · intro hP let p : primePool F := ⟨P, mem_primePool_iff.mpr ⟨I, hI, hP⟩⟩ exact ⟨p, (mem_idealSupport_iff F I p).mpr hP, rfl⟩ theorem idealSupport_product_eq (F : Finset (Ideal O)) {I : Ideal O} (hI : I ∈ F) (hsI : Squarefree I) : (∏ i ∈ idealSupport F I, i.val) = I := by have hnodup := (UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors hsI.ne_zero).mp hsI calc _ = ∏ P ∈ (idealSupport F I).image Subtype.val, P := by rw [Finset.prod_image] exact fun a ha b hb h => Subtype.val_injective h _ = ∏ P ∈ (UniqueFactorizationMonoid.normalizedFactors I).toFinset, P := by rw [idealSupport_image_eq_factors F hI] _ = (UniqueFactorizationMonoid.normalizedFactors I).prod := by change ((UniqueFactorizationMonoid.normalizedFactors I).toFinset.val.map id).prod = _ rw [Multiset.map_id, Multiset.toFinset_val, Multiset.dedup_eq_self.mpr hnodup] _ = I := Ideal.prod_normalizedFactors_eq_self hsI.ne_zero end ConcretePrimeRowBridge namespace ActualEisensteinCubic theorem activeSupport_product_mul_common_sq {ι M : Type*} [DecidableEq ι] [CommMonoid M] (P : ι → M) (S T : Finset ι) : (∏ i ∈ activeSupport S T, P i) * (∏ i ∈ S ∩ T, P i) ^ 2 = (∏ i ∈ S, P i) * (∏ i ∈ T, P i) := by have hset : activeSupport S T = (S ∪ T) \ (S ∩ T) := by ext i simp only [activeSupport, Finset.mem_union, Finset.mem_sdiff, Finset.mem_inter] tauto have hsub : S ∩ T ⊆ S ∪ T := Finset.inter_subset_left.trans Finset.subset_union_left calc _ = ((∏ i ∈ activeSupport S T, P i) * (∏ i ∈ S ∩ T, P i)) * (∏ i ∈ S ∩ T, P i) := by rw [pow_two, mul_assoc] _ = (∏ i ∈ S ∪ T, P i) * (∏ i ∈ S ∩ T, P i) := by rw [hset, Finset.prod_sdiff hsub] _ = _ := Finset.prod_union_inter theorem activePrimeModulus_norm_sq {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) (S T : Finset ι) : ‖ConcreteTraceCRT.eisEmbedding (finitePrimeModulus (activePrimes P S T))‖ ^ 2 = (Ideal.absNorm (∏ i ∈ activeSupport S T, P i) : ℝ) := by rw [finitePrimeModulus_norm_sq] congr 2 exact Finset.prod_coe_sort (activeSupport S T) P end ActualEisensteinCubic namespace ConcretePrimeRowBridge open ActualEisensteinCubic ShortDraftHeckeBridge end ConcretePrimeRowBridge end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.MixedConversion namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical namespace MixedGaussConversion abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase def localGauss (p : O) (hp : p ≠ 0) [ (Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) (j : ℕ) : ℂ := ConcreteBreveE.normalizedTraceGauss p hp (canonicalSextic (Ideal.span {p}) hg ^ j) def localCoefficient (p : O) (hp : p ≠ 0) [ (Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) : ℂ := star (angularFactor p) * localGauss p hp hg 2 def localG (p : O) (hp : p ≠ 0) [ (Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) : ℂ := breveLocalG (Ideal.span {p}) hg p rfl hp theorem norm_localGauss (p : O) (hp : p ≠ 0) [ (Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) (hchar : ringChar (O ⧸ Ideal.span {p}) ≠ 2) (j : ℕ) (hj0 : j ≠ 0) (hj6 : j < 6) : ‖localGauss p hp hg j‖ = 1 := by let q : Unit → O := fun _ => p have hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {q i})) := by intro i k hik exact (hik (Subsingleton.elim i k)).elim have h := norm_canonicalProductGauss q (fun _ => hp) hcop (fun _ => hg) (fun _ => hchar) (fun _ => j) (fun _ => hj0) (fun _ => hj6) rw [canonicalProductGauss_constant_power q (fun _ => hp) hcop (fun _ => hg) j hj0] at h simpa only [q, Fintype.prod_unique, Finset.univ_unique, Finset.erase_singleton, Finset.prod_empty, Finset.prod_singleton, one_pow, one_mul, localGauss] using h theorem canonicalSextic_fifth_eq_inverse (p : O) [(Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) : canonicalSextic (Ideal.span {p}) hg ^ 5 = (canonicalSextic (Ideal.span {p}) hg)⁻¹ := by apply DFunLike.ext intro x obtain ⟨a, rfl⟩ := Ideal.Quotient.mk_surjective x rw [MulChar.pow_apply' _ (by decide : (5 : ℕ) ≠ 0), ← MulChar.star_apply', canonicalSextic_conj_as_row_label] ring theorem localGauss_five_eq (p : O) (hp : p ≠ 0) [(Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) : localGauss p hp hg 5 = breveGammaMinus1 (Ideal.span {p}) hg p rfl hp := by rw [localGauss, canonicalSextic_fifth_eq_inverse] rfl theorem local_sign_conversion (p : O) (hp : p ≠ 0) [(Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) (hchar : ringChar (O ⧸ Ideal.span {p}) ≠ 2) (hprimary : lambda ^ 2 ∣ p - 1) : (-localGauss p hp hg 1) * star (localG p hp hg) = star (localCoefficient p hp hg) ∧ (-localGauss p hp hg 5) * localG p hp hg = canonicalSextic (Ideal.span {p}) hg (Ideal.Quotient.mk (Ideal.span {p}) (-1 : O)) * localCoefficient p hp hg := by have h := first_poisson_prime_sign_pairing (Ideal.span {p}) hg hchar p rfl hp hprimary 1 dsimp only at h simp only [map_one, mul_one, inv_one] at h constructor · simpa only [localGauss, localG, localCoefficient, angularFactor, pow_one, ConcreteBreveE.normalizedTraceGauss, breveGamma1, breveGamma2, star_mul, star_star, mul_comm] using h.2.2.1 · rw [localGauss_five_eq] exact h.2.1 theorem norm_localG (p : O) (hp : p ≠ 0) [(Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) (hchar : ringChar (O ⧸ Ideal.span {p}) ≠ 2) (hprimary : lambda ^ 2 ∣ p - 1) : ‖localG p hp hg‖ = 1 := by have h := congrArg norm (local_sign_conversion p hp hg hchar hprimary).1 simp only [norm_mul, norm_neg, norm_star, localCoefficient] at h rw [norm_localGauss p hp hg hchar 1 (by decide) (by decide), one_mul, norm_angularFactor p hp, norm_localGauss p hp hg hchar 2 (by decide) (by decide), one_mul] at h exact h def convertedLocal (p : O) (hp : p ≠ 0) [(Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) (inverse : Bool) : ℂ := if inverse then (canonicalSextic (Ideal.span {p}) hg (Ideal.Quotient.mk (Ideal.span {p}) (-1 : O)) * localCoefficient p hp hg) / localG p hp hg else star (localCoefficient p hp hg) / star (localG p hp hg) theorem neg_localGauss_eq_converted (p : O) (hp : p ≠ 0) [(Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) (hchar : ringChar (O ⧸ Ideal.span {p}) ≠ 2) (hprimary : lambda ^ 2 ∣ p - 1) (inverse : Bool) : -localGauss p hp hg (if inverse then 5 else 1) = convertedLocal p hp hg inverse := by have hG : localG p hp hg ≠ 0 := by intro hz have hn := norm_localG p hp hg hchar hprimary rw [hz, norm_zero] at hn exact zero_ne_one hn cases inverse · exact (eq_div_iff (star_ne_zero.mpr hG)).mpr (local_sign_conversion p hp hg hchar hprimary).1 · exact (eq_div_iff hG).mpr (local_sign_conversion p hp hg hchar hprimary).2 theorem moebius_mixed_gauss_conversion {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hprimary : ∀ i, lambda ^ 2 ∣ p i - 1) (inverse : ι → Bool) : (UniqueFactorizationMonoid.moebius (Ideal.span {∏ i, p i}) : ℂ) * canonicalProductGauss p hp hcop hgood (fun i => if inverse i then 5 else 1) = (∏ i, ∏ k ∈ Finset.univ.erase i, (canonicalSextic (Ideal.span {p i}) (hgood i) ^ (if inverse i then 5 else 1)) (Ideal.Quotient.mk (Ideal.span {p i}) (p k))) * ∏ i, convertedLocal (p i) (hp i) (hgood i) (inverse i) := by rw [product_moebius_eq_sign p hcop, canonicalProductGauss_cross_factors] have hprod : (-1 : ℂ) ^ Fintype.card ι * (∏ i, localGauss (p i) (hp i) (hgood i) (if inverse i then 5 else 1)) = ∏ i, convertedLocal (p i) (hp i) (hgood i) (inverse i) := by rw [← Finset.card_univ, ← Finset.prod_neg] apply Finset.prod_congr rfl intro i _ exact neg_localGauss_eq_converted (p i) (hp i) (hgood i) (hchar i) (hprimary i) (inverse i) calc _ = (∏ i, ∏ k ∈ Finset.univ.erase i, (canonicalSextic (Ideal.span {p i}) (hgood i) ^ (if inverse i then 5 else 1)) (Ideal.Quotient.mk (Ideal.span {p i}) (p k))) * ((-1 : ℂ) ^ Fintype.card ι * ∏ i, localGauss (p i) (hp i) (hgood i) (if inverse i then 5 else 1)) := by unfold localGauss ring _ = _ := by rw [hprod] end MixedGaussConversion open scoped BigOperators Classical SchwartzMap ContDiff namespace GaussGeneratorTransport open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson FiniteGaussPhase open MixedGaussConversion theorem pair_moebius_eq_active {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (S T : Finset ι) : (UniqueFactorizationMonoid.moebius (∏ i ∈ S, Ideal.span {p i}) : ℂ) * (UniqueFactorizationMonoid.moebius (∏ i ∈ T, Ideal.span {p i}) : ℂ) = (UniqueFactorizationMonoid.moebius (Ideal.span {∏ i : activeSupport S T, p i.val}) : ℂ) := by have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance have hcop := activePrimes_pairwise_isCoprime (fun i => Ideal.span {p i}) hinj S T rw [prime_product_moebius (fun i => Ideal.span {p i}) hprime hinj S, prime_product_moebius (fun i => Ideal.span {p i}) hprime hinj T, product_moebius_eq_sign (fun i : activeSupport S T => p i.val) hcop, ← pow_add] have hd : Disjoint (S \ T) (T \ S) := by apply Finset.disjoint_left.mpr intro i hi hj exact (Finset.mem_sdiff.mp hi).2 (Finset.mem_sdiff.mp hj).1 have ha : Fintype.card (activeSupport S T) = (S \ T).card + (T \ S).card := by rw [Fintype.card_coe, activeSupport, Finset.card_union_of_disjoint hd] have hs := Finset.card_sdiff_add_card_inter S T have ht := Finset.card_sdiff_add_card_inter T S rw [Finset.inter_comm T S] at ht have hcard : S.card + T.card = Fintype.card (activeSupport S T) + 2 * (S ∩ T).card := by omega rw [hcard, pow_add, pow_mul] norm_num def activeConvertedGauss {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (S T : Finset ι) : ℂ := (∏ i : activeSupport S T, ∏ k ∈ @Finset.erase (activeSupport S T) (fun a b => Classical.propDecidable (a = b)) Finset.univ i, (canonicalSextic (Ideal.span {p i.val}) (hgood i.val) ^ activeExponent S T i) (Ideal.Quotient.mk (Ideal.span {p i.val}) (p k.val))) * ∏ i : activeSupport S T, convertedLocal (p i.val) (hp i.val) (hgood i.val) (decide (i.val ∈ S \ T)) end GaussGeneratorTransport open scoped BigOperators Classical SchwartzMap ContDiff namespace ConcretePrimeRowBridge open ActualEisensteinCubic ShortDraftHeckeBridge ConcreteTraceCRT EisensteinSchwartzPoisson noncomputable def mobiusIdealColumn (C : Ideal O → ℂ) (I : Ideal O) : ℂ := (UniqueFactorizationMonoid.moebius I : ℂ) * C I noncomputable def conjugateIdealRowSum (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (C : Ideal O → ℂ) (y : O) : ℂ := ∑ I ∈ F, mobiusIdealColumn C I * star (idealSexticRow F hFpos hFgood I y) theorem conjugateIdealRowSum_eq_star (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (C : Ideal O → ℂ) (y : O) : conjugateIdealRowSum F hFpos hFgood C y = star (∑ I ∈ F, star (mobiusIdealColumn C I) * idealSexticRow F hFpos hFgood I y) := by simp only [conjugateIdealRowSum, star_sum, star_mul, star_star, mul_comm] theorem conjugateIdealRowSum_smoothed_summable (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (C : Ideal O → ℂ) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : Summable (fun y : O => W (‖eisEmbedding y‖ ^ 2 / scale) * (↑(‖conjugateIdealRowSum F hFpos hFgood C y‖ ^ 2) : ℂ)) := by simp_rw [conjugateIdealRowSum_eq_star, norm_star] let : ∀ i : primePool F, (i.val).IsMaximal := primePool_maximal F hFpos exact finiteSquarefreeRow_smoothed_mean_square_summable (fun i : primePool F => i.val) (primePool_good F hFgood) F (idealSupport F) (fun I => star (mobiusIdealColumn C I)) W scale hscale theorem conjugateIdealRowSum_smoothed_poisson (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (hchar : ∀ i : primePool F, ringChar (O ⧸ i.val) ≠ 2) (C : Ideal O → ℂ) (W : 𝓢(ℝ, ℂ)) (scale : ℝ) (hscale : 0 < scale) : (∑' y : O, W (‖eisEmbedding y‖ ^ 2 / scale) * (↑(‖conjugateIdealRowSum F hFpos hFgood C y‖ ^ 2) : ℂ)) = ∑ I ∈ F, ∑ J ∈ F, (star (mobiusIdealColumn C I) * mobiusIdealColumn C J) * idealPairPoissonKernel F hFpos hFgood J I W scale := by simp_rw [conjugateIdealRowSum_eq_star, norm_star] let : ∀ i : primePool F, (i.val).IsMaximal := primePool_maximal F hFpos change (∑' y : O, W (‖eisEmbedding y‖ ^ 2 / scale) * (↑(‖∑ I ∈ F, star (mobiusIdealColumn C I) * finiteSquarefreeRow (fun i : primePool F => i.val) (primePool_good F hFgood) (idealSupport F I) y‖ ^ 2) : ℂ)) = _ rw [finiteSquarefreeRow_smoothed_mean_square_expand (fun i : primePool F => i.val) (primePool_good F hFgood) F (idealSupport F) (fun I => star (mobiusIdealColumn C I)) W scale hscale, Finset.sum_comm] apply Finset.sum_congr rfl intro I hI apply Finset.sum_congr rfl intro J hJ rw [finiteSquarefreeRow_pair_radial_poisson (fun i : primePool F => i.val) Subtype.val_injective (primePool_good F hFgood) hchar (idealSupport F J) (idealSupport F I) W scale hscale, star_star] rw [mul_comm (mobiusIdealColumn C J)] rfl end ConcretePrimeRowBridge open MeasureTheory Set open scoped BigOperators namespace EisensteinSchwartzPoisson theorem scaled_cauchy_antitone (b : ℝ) : AntitoneOn (fun x : ℝ => (1 + (b * x) ^ 2)⁻¹) (Ici 0) := by intro x hx y hy hxy change 0 ≤ x at hx change 0 ≤ y at hy apply inv_anti₀ (by positivity) nlinarith [sq_nonneg b, sq_nonneg (y - x), mul_nonneg (sq_nonneg b) (show 0 ≤ y ^ 2 - x ^ 2 by nlinarith)] theorem scaled_cauchy_nat_bound (b : ℝ) (hb : 0 < b) : (∑' n : ℕ, (1 + (b * (n : ℝ)) ^ 2)⁻¹) ≤ 1 + Real.pi / (2 * b) := by have hi := (integrable_inv_one_add_sq.comp_mul_left' hb.ne').integrableOn (s := Ioi 0) have ht := (scaled_cauchy_antitone b).tsum_le_integral hi (fun t ht => by positivity) have he : (∫ x : ℝ in Ioi 0, (1 + (b * x) ^ 2)⁻¹) = Real.pi / (2 * b) := by rw [integral_comp_mul_left_Ioi (fun x : ℝ => (1 + x ^ 2)⁻¹) 0 hb] simp only [mul_zero, integral_Ioi_inv_one_add_sq, Real.arctan_zero, sub_zero, smul_eq_mul] ring simpa [he] using ht theorem summable_scaled_cauchy_nat (b : ℝ) (hb : 0 < b) : Summable (fun n : ℕ => (1 + (b * (n : ℝ)) ^ 2)⁻¹) := by exact (scaled_cauchy_antitone b).summable_of_integrableOn_Ioi_zero (integrable_inv_one_add_sq.comp_mul_left' hb.ne').integrableOn (fun _ _ => by positivity) theorem summable_scaled_cauchy_int (b : ℝ) (hb : 0 < b) : Summable (fun n : ℤ => (1 + (b * (n : ℝ)) ^ 2)⁻¹) := by rw [summable_int_iff_summable_nat_and_neg] constructor · simpa using summable_scaled_cauchy_nat b hb · simpa [mul_neg] using summable_scaled_cauchy_nat b hb theorem scaled_cauchy_int_bound (b : ℝ) (hb : 0 < b) : (∑' n : ℤ, (1 + (b * (n : ℝ)) ^ 2)⁻¹) ≤ 1 + Real.pi / b := by have hs := summable_scaled_cauchy_nat b hb have hs1 := (summable_nat_add_iff 1).mpr hs have hneg : Summable (fun n : ℕ => (1 + (b * ((-(n + 1) : ℤ) : ℝ)) ^ 2)⁻¹) := by apply hs1.congr intro n push_cast ring rw [tsum_of_nat_of_neg_add_one (f := fun n : ℤ => (1 + (b * (n : ℝ)) ^ 2)⁻¹) (by simpa only [Int.cast_natCast] using hs) hneg] simp only [Int.cast_natCast, Int.cast_neg, Int.cast_add, Int.cast_one, mul_neg, neg_sq] have hz := hs.tsum_eq_zero_add have he : (∑' n : ℕ, (1 + (b * (↑n + 1)) ^ 2)⁻¹) = (∑' n : ℕ, (1 + (b * (n : ℝ)) ^ 2)⁻¹) - 1 := by apply eq_sub_iff_add_eq.mpr simpa [add_comm] using hz.symm rw [he] have := scaled_cauchy_nat_bound b hb have hh : Real.pi / (2 * b) = (Real.pi / b) / 2 := by ring rw [hh] at this linarith open ConcreteTraceCRT ActualEisensteinCubic theorem scaled_eisenstein_cauchy_summable (K : ℝ) (hK : 0 < K) : Summable (fun h : O => ((1 + K * ‖eisEmbedding h‖ ^ 2) ^ 2)⁻¹) := by let b := Real.sqrt K have hb : 0 < b := Real.sqrt_pos.mpr hK have hbsq : b ^ 2 = K := Real.sq_sqrt hK.le have hs := summable_scaled_cauchy_int b hb have hp := hs.mul_of_nonneg hs (fun _ => by positivity) (fun _ => by positivity) apply (latticeCoordEquiv.symm.summable_iff).mp change Summable (fun p : ℤ × ℤ => ((1 + K * ‖eisEmbedding (latticeCoordEquiv.symm p)‖ ^ 2) ^ 2)⁻¹) apply Summable.of_nonneg_of_le (fun _ => by positivity) _ (hp.mul_left 4) intro p apply inverse_square_le_cauchy_product (b * (p.1 : ℝ)) (b * (p.2 : ℝ)) (K * ‖eisEmbedding (latticeCoordEquiv.symm p)‖ ^ 2) (by positivity) change ((b * (p.1 : ℝ)) ^ 2 + (b * (p.2 : ℝ)) ^ 2) / 2 ≤ K * ‖eisEmbedding (ActualEisensteinCoordinates.eval p.1 p.2)‖ ^ 2 rw [eisEmbedding_eval_norm_sq] push_cast nlinarith [mul_nonneg hK.le (sq_nonneg ((p.1 : ℝ) - (p.2 : ℝ)))] theorem scaled_eisenstein_cauchy_bound (K : ℝ) (hK : 0 < K) : (∑' h : O, ((1 + K * ‖eisEmbedding h‖ ^ 2) ^ 2)⁻¹) ≤ 4 * (1 + Real.pi / Real.sqrt K) ^ 2 := by let b := Real.sqrt K have hb : 0 < b := Real.sqrt_pos.mpr hK have hbsq : b ^ 2 = K := Real.sq_sqrt hK.le have hs := summable_scaled_cauchy_int b hb have hp := hs.mul_of_nonneg hs (fun _ => by positivity) (fun _ => by positivity) have he : (∑' h : O, ((1 + K * ‖eisEmbedding h‖ ^ 2) ^ 2)⁻¹) = ∑' p : ℤ × ℤ, ((1 + K * ‖eisEmbedding (latticeCoordEquiv.symm p)‖ ^ 2) ^ 2)⁻¹ := (latticeCoordEquiv.symm.tsum_eq _).symm rw [he] calc _ ≤ ∑' p : ℤ × ℤ, 4 * ((1 + (b * (p.1 : ℝ)) ^ 2)⁻¹ * (1 + (b * (p.2 : ℝ)) ^ 2)⁻¹) := by apply ((latticeCoordEquiv.symm.summable_iff).mpr (scaled_eisenstein_cauchy_summable K hK)).tsum_le_tsum _ (hp.mul_left 4) intro p apply inverse_square_le_cauchy_product _ _ _ (by positivity) change ((b * (p.1 : ℝ)) ^ 2 + (b * (p.2 : ℝ)) ^ 2) / 2 ≤ K * ‖eisEmbedding (ActualEisensteinCoordinates.eval p.1 p.2)‖ ^ 2 rw [eisEmbedding_eval_norm_sq] push_cast nlinarith [mul_nonneg hK.le (sq_nonneg ((p.1 : ℝ) - (p.2 : ℝ)))] _ = 4 * (∑' n : ℤ, (1 + (b * (n : ℝ)) ^ 2)⁻¹) ^ 2 := by rw [tsum_mul_left, ← hs.tsum_mul_tsum hs hp, pow_two] _ ≤ 4 * (1 + Real.pi / b) ^ 2 := by gcongr exact scaled_cauchy_int_bound b hb theorem scaled_eisenstein_cauchy_small (K : ℝ) (hK : 0 < K) (hK1 : K ≤ 1) : K * (∑' h : O, ((1 + K * ‖eisEmbedding h‖ ^ 2) ^ 2)⁻¹) ≤ 4 * (1 + Real.pi) ^ 2 := by have hs := scaled_eisenstein_cauchy_bound K hK have hb : 0 < Real.sqrt K := Real.sqrt_pos.mpr hK have hb1 : Real.sqrt K ≤ 1 := by simpa using Real.sqrt_le_sqrt hK1 have hsq := Real.sq_sqrt hK.le calc _ ≤ K * (4 * (1 + Real.pi / Real.sqrt K) ^ 2) := mul_le_mul_of_nonneg_left hs hK.le _ = 4 * (Real.sqrt K + Real.pi) ^ 2 := by nth_rw 1 [← hsq] field_simp _ ≤ _ := by gcongr theorem one_le_eisenstein_norm_sq (h : O) (hh : h ≠ 0) : 1 ≤ ‖eisEmbedding h‖ ^ 2 := by rw [eisEmbedding_norm_sq_eq_absNorm_span] exact_mod_cast Nat.one_le_iff_ne_zero.mpr (show Ideal.absNorm (Ideal.span {h}) ≠ 0 by rw [ne_eq, Ideal.absNorm_eq_zero_iff, Ideal.span_singleton_eq_bot] exact hh) theorem cauchy_large_scale_pointwise (K q : ℝ) (hK : 1 ≤ K) (hq : 1 ≤ q) : K * ((1 + K * q) ^ 2)⁻¹ ≤ 4 * ((1 + q) ^ 2)⁻¹ := by have hKp : 0 < K := by linarith have hqp : 0 < q := by linarith have h1 : K * (1 + q) ≤ 2 * (1 + K * q) := by nlinarith have h2 := pow_le_pow_left₀ (by positivity : 0 ≤ K * (1 + q)) h1 2 have h3 : K * (1 + q) ^ 2 ≤ K ^ 2 * (1 + q) ^ 2 := by nlinarith [sq_nonneg (1 + q)] apply (div_le_div_iff₀ (by positivity : 0 < (1 + K * q) ^ 2) (by positivity : 0 < (1 + q) ^ 2)).mpr nlinarith theorem lattice_profile_nonzero_scaled_bound (F : ℝ → ℂ) (B : ℝ) (hB : 0 ≤ B) (hF : ∀ t : ℝ, 0 ≤ t → (1 + t) ^ 2 * ‖F t‖ ≤ B) (K : ℝ) (hK : 0 < K) : K * (∑' h : {h : O // h ≠ 0}, ‖F (K * ‖eisEmbedding h.val‖ ^ 2)‖) ≤ (4 * (1 + Real.pi) ^ 2 + 4 * eisensteinCauchyMass) * B := by have hm (h : O) : ‖F (K * ‖eisEmbedding h‖ ^ 2)‖ ≤ B * ((1 + K * ‖eisEmbedding h‖ ^ 2) ^ 2)⁻¹ := by rw [← div_eq_mul_inv] apply (le_div_iff₀ (by positivity)).mpr simpa only [mul_comm] using hF (K * ‖eisEmbedding h‖ ^ 2) (by positivity) have hs := scaled_eisenstein_cauchy_summable K hK have hf : Summable (fun h : O => ‖F (K * ‖eisEmbedding h‖ ^ 2)‖) := Summable.of_nonneg_of_le (fun _ => norm_nonneg _) hm (hs.mul_left B) have hsub := hf.subtype (fun h : O => h ≠ 0) have hc := eisenstein_cauchy_summable.subtype (fun h : O => h ≠ 0) by_cases hK1 : K ≤ 1 · have htotal : (∑' h : {h : O // h ≠ 0}, ‖F (K * ‖eisEmbedding h.val‖ ^ 2)‖) ≤ ∑' h : O, ‖F (K * ‖eisEmbedding h‖ ^ 2)‖ := hsub.tsum_le_tsum_of_inj Subtype.val Subtype.val_injective (fun _ _ => norm_nonneg _) (fun _ => le_rfl) hf have hbound := hf.tsum_le_tsum hm (hs.mul_left B) rw [tsum_mul_left] at hbound calc _ ≤ K * (B * ∑' h : O, ((1 + K * ‖eisEmbedding h‖ ^ 2) ^ 2)⁻¹) := mul_le_mul_of_nonneg_left (htotal.trans hbound) hK.le _ = B * (K * ∑' h : O, ((1 + K * ‖eisEmbedding h‖ ^ 2) ^ 2)⁻¹) := by ring _ ≤ B * (4 * (1 + Real.pi) ^ 2) := mul_le_mul_of_nonneg_left (scaled_eisenstein_cauchy_small K hK hK1) hB _ ≤ _ := by nlinarith [eisensteinCauchyMass_nonneg] · have hp (h : {h : O // h ≠ 0}) : K * ‖F (K * ‖eisEmbedding h.val‖ ^ 2)‖ ≤ (4 * B) * ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹ := by calc _ ≤ K * (B * ((1 + K * ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹) := mul_le_mul_of_nonneg_left (hm h.val) hK.le _ = B * (K * ((1 + K * ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹) := by ring _ ≤ B * (4 * ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹) := mul_le_mul_of_nonneg_left (cauchy_large_scale_pointwise K _ (le_of_not_ge hK1) (one_le_eisenstein_norm_sq h.val h.property)) hB _ = _ := by ring calc _ = ∑' h : {h : O // h ≠ 0}, K * ‖F (K * ‖eisEmbedding h.val‖ ^ 2)‖ := tsum_mul_left.symm _ ≤ ∑' h : {h : O // h ≠ 0}, (4 * B) * ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹ := (hsub.mul_left K).tsum_le_tsum hp (hc.mul_left (4 * B)) _ = (4 * B) * ∑' h : {h : O // h ≠ 0}, ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹ := tsum_mul_left _ ≤ (4 * B) * eisensteinCauchyMass := mul_le_mul_of_nonneg_left (eisensteinCauchyMass_subtype (fun h : O => h ≠ 0)) (by positivity) _ ≤ _ := by nlinarith [sq_nonneg (1 + Real.pi)] theorem paperRadialFourier_nonzero_lattice_uniform : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (W : SchwartzMap ℝ ℂ) (K : ℝ), 0 < K → K * (∑' h : {h : O // h ≠ 0}, ‖paperRadialFourier W (K * ‖eisEmbedding h.val‖ ^ 2)‖) ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by obtain ⟨s, C, hC, hb⟩ := paperRadialFourier_source_weighted_bound 2 refine ⟨s, (4 * (1 + Real.pi) ^ 2 + 4 * eisensteinCauchyMass) * C, ?_, ?_⟩ · have := eisensteinCauchyMass_nonneg have := Real.pi_pos positivity · intro W K hK simpa only [mul_assoc] using lattice_profile_nonzero_scaled_bound (paperRadialFourier W) (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) (by positivity) (hb W) K hK end EisensteinSchwartzPoisson end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.CrossSeparation namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical namespace MixedCrossSeparation abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase MixedGaussConversion private theorem ordered_cross_partition {ι : Type*} [Fintype ι] [DecidableEq ι] (x : ι → ι → ℂ) (l : ι → ℂ) (A B : Finset ι) (hd : Disjoint A B) (hu : A ∪ B = Finset.univ) : (∏ i, ((∏ k ∈ Finset.univ.erase i, x i k ^ (if i ∈ A then 5 else 1)) * l i)) = (∏ i ∈ A, (∏ k ∈ A.erase i, x i k ^ 5) * l i) * (∏ i ∈ B, (∏ k ∈ B.erase i, x i k) * l i) * (∏ i ∈ A, ∏ k ∈ B, x i k ^ 5 * x k i) := by have hA (i : ι) (hi : i ∈ A) : (∏ k ∈ Finset.univ.erase i, x i k ^ (if i ∈ A then 5 else 1)) = (∏ k ∈ A.erase i, x i k ^ 5) * (∏ k ∈ B, x i k ^ 5) := by have hn : i ∉ B := fun hb => Finset.disjoint_left.mp hd hi hb have he : Finset.univ.erase i = A.erase i ∪ B := by rw [← hu] ext k by_cases hk : k = i · subst k; simp [hn] · simp [hk] rw [he, ite_eq_left hi, Finset.prod_union (hd.mono_left (Finset.erase_subset _ _))] have hB (i : ι) (hi : i ∈ B) : (∏ k ∈ Finset.univ.erase i, x i k ^ (if i ∈ A then 5 else 1)) = (∏ k ∈ B.erase i, x i k) * (∏ k ∈ A, x i k) := by have hn : i ∉ A := fun ha => Finset.disjoint_left.mp hd ha hi have he : Finset.univ.erase i = B.erase i ∪ A := by rw [← hu] ext k by_cases hk : k = i · subst k; simp [hn] · simp [hk, or_comm] rw [he, ite_eq_right hn, Finset.prod_union (hd.symm.mono_left (Finset.erase_subset _ _))] simp only [pow_one] have hpA : (∏ i ∈ A, ((∏ k ∈ Finset.univ.erase i, x i k ^ (if i ∈ A then 5 else 1)) * l i)) = (∏ i ∈ A, (∏ k ∈ A.erase i, x i k ^ 5) * l i) * (∏ i ∈ A, ∏ k ∈ B, x i k ^ 5) := by rw [← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i hi rw [hA i hi] ring have hpB : (∏ i ∈ B, ((∏ k ∈ Finset.univ.erase i, x i k ^ (if i ∈ A then 5 else 1)) * l i)) = (∏ i ∈ B, (∏ k ∈ B.erase i, x i k) * l i) * (∏ i ∈ B, ∏ k ∈ A, x i k) := by rw [← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i hi rw [hB i hi] ring calc _ = (∏ i ∈ A, ((∏ k ∈ Finset.univ.erase i, x i k ^ (if i ∈ A then 5 else 1)) * l i)) * (∏ i ∈ B, ((∏ k ∈ Finset.univ.erase i, x i k ^ (if i ∈ A then 5 else 1)) * l i)) := by rw [← Finset.prod_union hd, hu] _ = _ := by rw [hpA, hpB] rw [Finset.prod_comm (s := B) (t := A)] simp only [Finset.prod_mul_distrib] ring def crossSymbol {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (i k : ι) : ℂ := canonicalSextic (Ideal.span {p i}) (hg i) (Ideal.Quotient.mk (Ideal.span {p i}) (p k)) theorem mixed_cross_eq_quadratic {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (i k : ι) (hpi : lambda ^ 2 ∣ p i - 1) (hpk : lambda ^ 2 ∣ p k - 1) : crossSymbol p hg i k ^ 5 * crossSymbol p hg k i = crossSymbol p hg i k ^ 3 * crossSymbol p hg k i ^ 3 := by have hs : crossSymbol p hg i k ^ 2 = crossSymbol p hg k i ^ 2 := canonicalSextic_sq_reciprocity_primary (Ideal.span {p i}) (Ideal.span {p k}) (hg i) (hg k) (p i) (p k) rfl rfl hpi hpk calc _ = crossSymbol p hg i k ^ 3 * crossSymbol p hg i k ^ 2 * crossSymbol p hg k i := by ring _ = _ := by rw [hs]; ring def convertedColumnBlock {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (inverse : Bool) : ℂ := ∏ i ∈ S, (∏ k ∈ S.erase i, crossSymbol p hg i k ^ (if inverse then 5 else 1)) * convertedLocal (p i) (hp i) (hg i) inverse def quadraticCrossPhase {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (A B : Finset ι) : ℂ := ∏ i ∈ A, ∏ k ∈ B, crossSymbol p hg i k ^ 3 * crossSymbol p hg k i ^ 3 theorem mixed_converted_gauss_separation {ι : Type*} [Fintype ι] [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (inverse : ι → Bool) (hprimary : ∀ i, lambda ^ 2 ∣ p i - 1) : (∏ i, ∏ k ∈ Finset.univ.erase i, (canonicalSextic (Ideal.span {p i}) (hg i) ^ (if inverse i then 5 else 1)) (Ideal.Quotient.mk (Ideal.span {p i}) (p k))) * (∏ i, convertedLocal (p i) (hp i) (hg i) (inverse i)) = convertedColumnBlock p hp hg (Finset.univ.filter fun i => inverse i = true) true * convertedColumnBlock p hp hg (Finset.univ.filter fun i => inverse i = false) false * quadraticCrossPhase p hg (Finset.univ.filter fun i => inverse i = true) (Finset.univ.filter fun i => inverse i = false) := by let A := Finset.univ.filter (fun i => inverse i = true) let B := Finset.univ.filter (fun i => inverse i = false) have hA (i : ι) : i ∈ A ↔ inverse i = true := by simp [A] have hB (i : ι) : i ∈ B ↔ inverse i = false := by simp [B] have hd : Disjoint A B := by apply Finset.disjoint_left.mpr intro i hi hj have ht := (hA i).mp hi have hf := (hB i).mp hj rw [ht] at hf contradiction have hu : A ∪ B = Finset.univ := by ext i simp only [Finset.mem_union, hA, hB, Finset.mem_univ, iff_true] cases inverse i <;> simp have hpow (i k : ι) : (canonicalSextic (Ideal.span {p i}) (hg i) ^ (if inverse i then 5 else 1)) (Ideal.Quotient.mk (Ideal.span {p i}) (p k)) = crossSymbol p hg i k ^ (if i ∈ A then 5 else 1) := by rw [MulChar.pow_apply' _ (by cases inverse i <;> decide)] simp only [hA, crossSymbol] simp_rw [hpow] rw [← Finset.prod_mul_distrib, ordered_cross_partition (crossSymbol p hg) (fun i => convertedLocal (p i) (hp i) (hg i) (inverse i)) A B hd hu] have hn : (∏ i ∈ A, (∏ k ∈ A.erase i, crossSymbol p hg i k ^ 5) * convertedLocal (p i) (hp i) (hg i) (inverse i)) = convertedColumnBlock p hp hg A true := by apply Finset.prod_congr rfl intro i hi simp only [(hA i).mp hi, ↓reduceIte] have hp' : (∏ i ∈ B, (∏ k ∈ B.erase i, crossSymbol p hg i k) * convertedLocal (p i) (hp i) (hg i) (inverse i)) = convertedColumnBlock p hp hg B false := by unfold convertedColumnBlock simp only [Bool.false_eq_true, ↓reduceIte, pow_one] apply Finset.prod_congr rfl intro i hi rw [(hB i).mp hi] have hc : (∏ i ∈ A, ∏ k ∈ B, crossSymbol p hg i k ^ 5 * crossSymbol p hg k i) = quadraticCrossPhase p hg A B := by apply Finset.prod_congr rfl intro i hi apply Finset.prod_congr rfl intro k hk exact mixed_cross_eq_quadratic p hg i k (hprimary i) (hprimary k) rw [hn, hp', hc] theorem activeConvertedGauss_separated {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hprimary : ∀ i, lambda ^ 2 ∣ p i - 1) (S T : Finset ι) : let q : activeSupport S T → O := fun i => p i.val let hq : ∀ i, q i ≠ 0 := fun i => hp i.val let hgood : ∀ i, lambda ∉ Ideal.span {q i} := fun i => hg i.val let A : Finset (activeSupport S T) := Finset.univ.filter fun i => i.val ∈ S \ T let B : Finset (activeSupport S T) := Finset.univ.filter fun i => i.val ∉ S \ T GaussGeneratorTransport.activeConvertedGauss p hp hg S T = convertedColumnBlock q hq hgood A true * convertedColumnBlock q hq hgood B false * quadraticCrossPhase q hgood A B := by dsimp only have h := mixed_converted_gauss_separation (fun i : activeSupport S T => p i.val) (fun i => hp i.val) (fun i => hg i.val) (fun i => decide (i.val ∈ S \ T)) (fun i => hprimary i.val) simp only [GaussGeneratorTransport.activeConvertedGauss, activeExponent, decide_eq_true_eq, decide_eq_false_iff_not] at h ⊢ convert h using 1 ; congr 2 funext i apply Finset.prod_congr · ext k; simp · intro k hk; rfl open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase MixedGaussConversion open QuadraticGaussRay ActualEisensteinCoordinates private theorem prod_subtype_erase {ι M : Type*} [DecidableEq ι] [CommMonoid M] (A : Finset ι) (i : A) (f : ι → M) : (∏ k ∈ (Finset.univ : Finset A).erase i, f k.val) = ∏ k ∈ A.erase i.val, f k := by apply Finset.prod_bij (fun k _ => k.val) · intro k hk apply Finset.mem_erase.mpr refine ⟨?_, k.property⟩ exact fun h => (Finset.mem_erase.mp hk).1 (Subtype.ext h) · intro a ha b hb h exact Subtype.ext h · intro k hk refine ⟨⟨k, (Finset.mem_erase.mp hk).2⟩, ?_, rfl⟩ apply Finset.mem_erase.mpr exact ⟨fun h => (Finset.mem_erase.mp hk).1 (congrArg Subtype.val h), Finset.mem_univ _⟩ · intro a ha rfl private theorem restricted_prime_coprime {ι : Type*} (p : ι → O) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (A : Finset ι) : Pairwise (Function.onFun IsCoprime (fun i : A => Ideal.span {p i.val})) := by intro i k hik exact hcop (fun h => hik (Subtype.ext h)) def quadraticBlock {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (A : Finset ι) : ℂ := ∏ i ∈ A, (∏ k ∈ A.erase i, crossSymbol p hg i k ^ 3) * localGauss (p i) (hp i) (hg i) 3 theorem quadraticBlock_eq_productGauss {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (A : Finset ι) : quadraticBlock p hp hg A = canonicalProductGauss (fun i : A => p i.val) (fun i => hp i.val) (restricted_prime_coprime p hcop A) (fun i => hg i.val) (fun _ => 3) := by rw [canonicalProductGauss_cross_factors, ← Finset.prod_mul_distrib] unfold quadraticBlock rw [← Finset.prod_coe_sort A] apply Finset.prod_congr rfl intro i hi congr 1 rw [← prod_subtype_erase A i (fun k => crossSymbol p hg i.val k ^ 3)] apply Finset.prod_congr · ext k; simp · intro k hk exact (MulChar.pow_apply' _ (by decide : (3 : ℕ) ≠ 0) _).symm theorem quadraticBlock_eq_rayValue {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (A : Finset ι) : quadraticBlock p hp hg A = quadraticRayValue (residue (∏ i ∈ A, p i)) := by rw [quadraticBlock_eq_productGauss p hp hcop hg A, canonicalProductGauss_three_eq_rayValue (fun i : A => p i.val) (fun i => hp i.val) (restricted_prime_coprime p hcop A) (fun i => hg i.val) (fun i => hchar i.val), Finset.prod_coe_sort] theorem quadraticBlock_union {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (A B : Finset ι) (hd : Disjoint A B) : quadraticBlock p hp hg (A ∪ B) = quadraticBlock p hp hg A * quadraticBlock p hp hg B * quadraticCrossPhase p hg A B := by let x := crossSymbol p hg let l := fun i => localGauss (p i) (hp i) (hg i) 3 have hA (i : ι) (hi : i ∈ A) : (∏ k ∈ (A ∪ B).erase i, x i k ^ 3) = (∏ k ∈ A.erase i, x i k ^ 3) * (∏ k ∈ B, x i k ^ 3) := by have hn : i ∉ B := fun hb => Finset.disjoint_left.mp hd hi hb have he : (A ∪ B).erase i = A.erase i ∪ B := by ext k by_cases hk : k = i · subst k; simp [hn] · simp [hk] rw [he, Finset.prod_union (hd.mono_left (Finset.erase_subset _ _))] have hB (i : ι) (hi : i ∈ B) : (∏ k ∈ (A ∪ B).erase i, x i k ^ 3) = (∏ k ∈ B.erase i, x i k ^ 3) * (∏ k ∈ A, x i k ^ 3) := by have hn : i ∉ A := fun ha => Finset.disjoint_left.mp hd ha hi have he : (A ∪ B).erase i = B.erase i ∪ A := by ext k by_cases hk : k = i · subst k; simp [hn] · simp [hk, or_comm] rw [he, Finset.prod_union (hd.symm.mono_left (Finset.erase_subset _ _))] have hpA : (∏ i ∈ A, ((∏ k ∈ (A ∪ B).erase i, x i k ^ 3) * l i)) = (∏ i ∈ A, (∏ k ∈ A.erase i, x i k ^ 3) * l i) * (∏ i ∈ A, ∏ k ∈ B, x i k ^ 3) := by rw [← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i hi rw [hA i hi] ring have hpB : (∏ i ∈ B, ((∏ k ∈ (A ∪ B).erase i, x i k ^ 3) * l i)) = (∏ i ∈ B, (∏ k ∈ B.erase i, x i k ^ 3) * l i) * (∏ i ∈ B, ∏ k ∈ A, x i k ^ 3) := by rw [← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i hi rw [hB i hi] ring change (∏ i ∈ A ∪ B, ((∏ k ∈ (A ∪ B).erase i, x i k ^ 3) * l i)) = _ rw [Finset.prod_union hd, hpA, hpB, Finset.prod_comm (s := B) (t := A)] unfold quadraticBlock quadraticCrossPhase simp only [Finset.prod_mul_distrib] dsimp only [x, l] ring theorem norm_quadraticBlock {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (A : Finset ι) : ‖quadraticBlock p hp hg A‖ = 1 := by rw [quadraticBlock_eq_productGauss p hp hcop hg A] exact norm_canonicalProductGauss (fun i : A => p i.val) (fun i => hp i.val) (restricted_prime_coprime p hcop A) (fun i => hg i.val) (fun i => hchar i.val) (fun _ => 3) (fun _ => by decide) (fun _ => by decide) def quadraticRayPair (a b : EisensteinEPrimaryPhase.Coord) : ℂ := quadraticRayValue (EisensteinEPrimaryPhase.mul a b) / (quadraticRayValue a * quadraticRayValue b) theorem quadraticCrossPhase_eq_rayPair {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (A B : Finset ι) (hd : Disjoint A B) : quadraticCrossPhase p hg A B = quadraticRayPair (residue (∏ i ∈ A, p i)) (residue (∏ i ∈ B, p i)) := by have hA0 : quadraticBlock p hp hg A ≠ 0 := by intro hz have hn := norm_quadraticBlock p hp hcop hg hchar A rw [hz, norm_zero] at hn exact zero_ne_one hn have hB0 : quadraticBlock p hp hg B ≠ 0 := by intro hz have hn := norm_quadraticBlock p hp hcop hg hchar B rw [hz, norm_zero] at hn exact zero_ne_one hn have h := quadraticBlock_union p hp hg A B hd have hdiv : quadraticCrossPhase p hg A B = quadraticBlock p hp hg (A ∪ B) / (quadraticBlock p hp hg A * quadraticBlock p hp hg B) := by apply (eq_div_iff (mul_ne_zero hA0 hB0)).mpr rw [h] ring rw [hdiv, quadraticBlock_eq_rayValue p hp hcop hg hchar (A ∪ B), quadraticBlock_eq_rayValue p hp hcop hg hchar A, quadraticBlock_eq_rayValue p hp hcop hg hchar B, Finset.prod_union hd, residue_mul] rfl end MixedCrossSeparation open scoped BigOperators Classical namespace CoprimeMobiusExtension abbrev O := ActualEisensteinCubic.O theorem sum_subset_sign {ι : Type*} [DecidableEq ι] (S : Finset ι) : (∑ D ∈ S.powerset, (-1 : ℂ) ^ D.card) = if S = ∅ then 1 else 0 := by have hp := Finset.prod_sub (fun _ : ι => (1 : ℂ)) (fun _ => 1) S by_cases hS : S = ∅ · simp [hS] · have hc : S.card ≠ 0 := Finset.card_ne_zero.mpr (Finset.nonempty_iff_ne_empty.mpr hS) simpa [hS, hc] using hp.symm theorem disjoint_indicator_expansion {ι : Type*} [DecidableEq ι] (B S T : Finset ι) (hS : S ⊆ B) (_hT : T ⊆ B) : (if Disjoint S T then (1 : ℂ) else 0) = ∑ D ∈ B.powerset, if D ⊆ S ∧ D ⊆ T then (-1 : ℂ) ^ D.card else 0 := by have hsub : (S ∩ T).powerset ⊆ B.powerset := Finset.powerset_mono.mpr (Finset.inter_subset_left.trans hS) have heq : (∑ D ∈ B.powerset, if D ⊆ S ∧ D ⊆ T then (-1 : ℂ) ^ D.card else 0) = ∑ D ∈ (S ∩ T).powerset, (-1 : ℂ) ^ D.card := by calc _ = ∑ D ∈ (S ∩ T).powerset, if D ⊆ S ∧ D ⊆ T then (-1 : ℂ) ^ D.card else 0 := by symm apply Finset.sum_subset hsub intro D hD hnot have hn : ¬(D ⊆ S ∧ D ⊆ T) := by simpa only [Finset.mem_powerset, Finset.subset_inter_iff] using hnot simp [hn] _ = _ := by apply Finset.sum_congr rfl intro D hD have hh : D ⊆ S ∧ D ⊆ T := by simpa only [Finset.mem_powerset, Finset.subset_inter_iff] using hD simp [hh] rw [heq, sum_subset_sign] simp only [Finset.disjoint_iff_inter_eq_empty] theorem double_sum_disjoint_expansion {ι : Type*} [DecidableEq ι] (B : Finset ι) (Z : Finset ι → Finset ι → ℂ) : (∑ S ∈ B.powerset, ∑ T ∈ B.powerset, if Disjoint S T then Z S T else 0) = ∑ D ∈ B.powerset, (-1 : ℂ) ^ D.card * ∑ S ∈ B.powerset, ∑ T ∈ B.powerset, if D ⊆ S ∧ D ⊆ T then Z S T else 0 := by have hp (S T : Finset ι) (hS : S ∈ B.powerset) (hT : T ∈ B.powerset) : (if Disjoint S T then Z S T else 0) = ∑ D ∈ B.powerset, (-1 : ℂ) ^ D.card * if D ⊆ S ∧ D ⊆ T then Z S T else 0 := by calc _ = (if Disjoint S T then (1 : ℂ) else 0) * Z S T := by split_ifs <;> simp _ = (∑ D ∈ B.powerset, if D ⊆ S ∧ D ⊆ T then (-1 : ℂ) ^ D.card else 0) * Z S T := by rw [disjoint_indicator_expansion B S T (Finset.mem_powerset.mp hS) (Finset.mem_powerset.mp hT)] _ = _ := by rw [Finset.sum_mul] apply Finset.sum_congr rfl intro D hD split_ifs <;> simp calc _ = ∑ S ∈ B.powerset, ∑ T ∈ B.powerset, ∑ D ∈ B.powerset, (-1 : ℂ) ^ D.card * if D ⊆ S ∧ D ⊆ T then Z S T else 0 := by apply Finset.sum_congr rfl intro S hS exact Finset.sum_congr rfl (fun T hT => hp S T hS hT) _ = _ := by simp_rw [Finset.mul_sum] calc _ = ∑ S ∈ B.powerset, ∑ D ∈ B.powerset, ∑ T ∈ B.powerset, (-1 : ℂ) ^ D.card * if D ⊆ S ∧ D ⊆ T then Z S T else 0 := by apply Finset.sum_congr rfl intro S hS exact Finset.sum_comm _ = _ := Finset.sum_comm theorem sum_supersets {ι : Type*} [DecidableEq ι] (B D : Finset ι) (hD : D ⊆ B) (f : Finset ι → ℂ) : (∑ S ∈ B.powerset, if D ⊆ S then f S else 0) = ∑ U ∈ (B \ D).powerset, f (D ∪ U) := by rw [← Finset.sum_filter] refine Finset.sum_bij (fun S _ => S \ D) ?_ ?_ ?_ ?_ · intro S hS simp only [Finset.mem_filter, Finset.mem_powerset] at hS ⊢ exact Finset.sdiff_subset_sdiff hS.1 (Finset.Subset.refl _) · intro S hS T hT heq simp only [Finset.mem_filter, Finset.mem_powerset] at hS hT have he := congrArg (fun U => D ∪ U) heq simpa [Finset.union_sdiff_of_subset hS.2, Finset.union_sdiff_of_subset hT.2] using he · intro U hU have hUB : U ⊆ B \ D := Finset.mem_powerset.mp hU refine ⟨D ∪ U, ?_, ?_⟩ · simp only [Finset.mem_filter, Finset.mem_powerset] exact ⟨Finset.union_subset hD (hUB.trans Finset.sdiff_subset), Finset.subset_union_left⟩ · apply Finset.union_sdiff_cancel_left exact (Finset.disjoint_of_subset_right hUB disjoint_sdiff_self_right) · intro S hS simp only [Finset.mem_filter, Finset.mem_powerset] at hS rw [Finset.union_sdiff_of_subset hS.2] theorem double_sum_disjoint_reindexed {ι : Type*} [DecidableEq ι] (B : Finset ι) (Z : Finset ι → Finset ι → ℂ) : (∑ S ∈ B.powerset, ∑ T ∈ B.powerset, if Disjoint S T then Z S T else 0) = ∑ D ∈ B.powerset, (-1 : ℂ) ^ D.card * ∑ U ∈ (B \ D).powerset, ∑ V ∈ (B \ D).powerset, Z (D ∪ U) (D ∪ V) := by rw [double_sum_disjoint_expansion] apply Finset.sum_congr rfl intro D hD congr 1 have hDB := Finset.mem_powerset.mp hD calc _ = ∑ S ∈ B.powerset, if D ⊆ S then (∑ T ∈ B.powerset, if D ⊆ T then Z S T else 0) else 0 := by apply Finset.sum_congr rfl intro S hS by_cases hh : D ⊆ S <;> simp [hh] _ = _ := by rw [sum_supersets B D hDB] apply Finset.sum_congr rfl intro U hU exact sum_supersets B D hDB (Z (D ∪ U)) open ActualEisensteinCubic end CoprimeMobiusExtension end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Arithmetic.IdealMobius namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid namespace IdealMobiusDivisorSum abbrev O := ActualEisensteinCubic.O def idealDivisors (I : Ideal O) : Finset (Ideal O) := (Ideal.finite_setOfPred_absNorm_le (S := O) (Ideal.absNorm I)).toFinset.filter (fun J => J ∣ I) theorem mem_idealDivisors {I J : Ideal O} (hI : I ≠ ⊥) : J ∈ idealDivisors I ↔ J ∣ I := by simp only [idealDivisors, Finset.mem_filter, Set.Finite.mem_toFinset, Set.mem_ofPred_eq] constructor · exact And.right · intro hJI have hn : 0 < Ideal.absNorm I := Nat.pos_iff_ne_zero.mpr (fun hz => hI (Ideal.absNorm_eq_zero_iff.mp hz)) exact ⟨Nat.le_of_dvd hn (map_dvd Ideal.absNorm hJI), hJI⟩ def primeSupport (I : Ideal O) : Finset (Ideal O) := (normalizedFactors I).toFinset theorem support_prime {I : Ideal O} {P : Ideal O} (hP : P ∈ primeSupport I) : Prime P := prime_of_normalized_factor P (Multiset.mem_toFinset.mp hP) theorem support_product_ne_zero {I : Ideal O} {S : Finset (Ideal O)} (hS : S ⊆ primeSupport I) : (∏ P ∈ S, P) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun _P hP => (support_prime (hS hP)).ne_zero) theorem factors_support_product {I : Ideal O} {S : Finset (Ideal O)} (hS : S ⊆ primeSupport I) : normalizedFactors (∏ P ∈ S, P) = S.val := by have hp : ∀ P ∈ S.val, Prime P := fun P hP => support_prime (hS hP) simpa using normalizedFactors_prod_of_prime hp theorem squarefree_support_product {I : Ideal O} {S : Finset (Ideal O)} (hS : S ⊆ primeSupport I) : Squarefree (∏ P ∈ S, P) := by apply (squarefree_iff_nodup_normalizedFactors (support_product_ne_zero hS)).mpr rw [factors_support_product hS] exact S.nodup theorem support_product_dvd {I : Ideal O} (hI : I ≠ ⊥) {S : Finset (Ideal O)} (hS : S ⊆ primeSupport I) : (∏ P ∈ S, P) ∣ I := by apply (dvd_iff_normalizedFactors_le_normalizedFactors (support_product_ne_zero hS) hI).mpr rw [factors_support_product hS] apply (Multiset.le_iff_subset S.nodup).mpr intro P hP exact Multiset.mem_toFinset.mp (hS hP) theorem moebius_support_product {I : Ideal O} {S : Finset (Ideal O)} (hS : S ⊆ primeSupport I) : (moebius (∏ P ∈ S, P) : ℂ) = (-1 : ℂ) ^ S.card := by rw [(squarefree_support_product hS).moebius_eq, factors_eq_normalizedFactors, factors_support_product hS] simp theorem support_product_injective {I : Ideal O} {S T : Finset (Ideal O)} (hS : S ⊆ primeSupport I) (hT : T ⊆ primeSupport I) (h : (∏ P ∈ S, P) = ∏ P ∈ T, P) : S = T := by have hf := congrArg normalizedFactors h rw [factors_support_product hS, factors_support_product hT] at hf exact Finset.val_inj.mp hf theorem squarefree_divisor_support {I J : Ideal O} (hI : I ≠ ⊥) (hJ : Squarefree J) (hJI : J ∣ I) : primeSupport J ⊆ primeSupport I := by have hf := (dvd_iff_normalizedFactors_le_normalizedFactors hJ.ne_zero hI).mp hJI intro P hP exact Multiset.mem_toFinset.mpr (Multiset.mem_of_le hf (Multiset.mem_toFinset.mp hP)) theorem squarefree_support_product_self {J : Ideal O} (hJ : Squarefree J) : (∏ P ∈ primeSupport J, P) = J := by have hn : (normalizedFactors J).Nodup := (squarefree_iff_nodup_normalizedFactors hJ.ne_zero).mp hJ have hv : (primeSupport J).val = normalizedFactors J := by simpa only [primeSupport, Multiset.toFinset_val] using hn.dedup calc _ = (primeSupport J).val.prod := (Finset.prod_val _).symm _ = (normalizedFactors J).prod := by rw [hv] _ = J := Ideal.prod_normalizedFactors_eq_self hJ.ne_zero theorem squarefree_divisors_eq_image (I : Ideal O) (hI : I ≠ ⊥) : (idealDivisors I).filter Squarefree = (primeSupport I).powerset.image (fun S => ∏ P ∈ S, P) := by ext J simp only [Finset.mem_filter, mem_idealDivisors hI, Finset.mem_image, Finset.mem_powerset] constructor · rintro ⟨hJI, hJ⟩ exact ⟨primeSupport J, squarefree_divisor_support hI hJ hJI, squarefree_support_product_self hJ⟩ · rintro ⟨S, hS, rfl⟩ exact ⟨support_product_dvd hI hS, squarefree_support_product hS⟩ theorem primeSupport_empty_iff (I : Ideal O) (hI : I ≠ ⊥) : primeSupport I = ∅ ↔ I = ⊤ := by constructor · intro h have hz : normalizedFactors I = 0 := by apply Multiset.toFinset_eq_empty.mp exact h have hp := Ideal.prod_normalizedFactors_eq_self hI rw [hz, Multiset.prod_zero] at hp simpa only [Ideal.one_eq_top] using hp.symm · intro h subst I simp [primeSupport, ← Ideal.one_eq_top] theorem sum_moebius_divisors (I : Ideal O) (hI : I ≠ ⊥) : (∑ J ∈ idealDivisors I, (moebius J : ℂ)) = if I = ⊤ then 1 else 0 := by have hfilter : (∑ J ∈ idealDivisors I, (moebius J : ℂ)) = ∑ J ∈ (idealDivisors I).filter Squarefree, (moebius J : ℂ) := by symm apply Finset.sum_subset (Finset.filter_subset _ _) intro J hJ hnot have hn : ¬ Squarefree J := by simpa [hJ] using hnot rw [moebius_of_not_squarefree hn, Int.cast_zero] rw [hfilter, squarefree_divisors_eq_image I hI, Finset.sum_image] · have heq : (∑ S ∈ (primeSupport I).powerset, (moebius (∏ P ∈ S, P) : ℂ)) = ∑ S ∈ (primeSupport I).powerset, (-1 : ℂ) ^ S.card := by exact Finset.sum_congr rfl (fun S hS => moebius_support_product (Finset.mem_powerset.mp hS)) rw [heq, CoprimeMobiusExtension.sum_subset_sign] simp only [primeSupport_empty_iff I hI] · intro S hS T hT hST exact support_product_injective (Finset.mem_powerset.mp hS) (Finset.mem_powerset.mp hT) hST end IdealMobiusDivisorSum open scoped BigOperators Classical namespace CompletedGauss section abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic def primaryPrime (P : Ideal O) : O := if h : P.IsMaximal ∧ lambda ∉ P then letI : P.IsMaximal := h.1 (cubicJacobi_exists_primary_generator P h.2).choose else 0 theorem primaryPrime_spec (P : Ideal O) (h : primaryPrime P ≠ 0) : P.IsMaximal ∧ lambda ∉ P ∧ Ideal.span {primaryPrime P} = P ∧ lambda ^ 2 ∣ primaryPrime P - 1 := by classical by_cases hg : P.IsMaximal ∧ lambda ∉ P · let : P.IsMaximal := hg.1 have hs := (cubicJacobi_exists_primary_generator P hg.2).choose_spec simpa only [primaryPrime, dite_eq_left hg] using ⟨hg.1, hg.2, hs.1.symm, hs.2.1⟩ · simp only [primaryPrime, dite_eq_right hg, ne_eq, not_true_eq_false] at h theorem primaryPrime_ne_zero (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) : primaryPrime P ≠ 0 := by classical have hs := (cubicJacobi_exists_primary_generator P hg).choose_spec have htest : P.IsMaximal ∧ lambda ∉ P := ⟨inferInstance, hg⟩ intro hz have hp0 : (cubicJacobi_exists_primary_generator P hg).choose = 0 := by simpa only [primaryPrime, dite_eq_left htest] using hz rw [hp0] at hs exact (NeZero.ne P) (by simpa using hs.1) def primaryGenerator (I : Ideal O) : O := if I = 0 then 0 else ((UniqueFactorizationMonoid.normalizedFactors I).map primaryPrime).prod theorem primaryGenerator_zero : primaryGenerator 0 = 0 := by rw [primaryGenerator, ite_eq_left rfl] theorem primaryGenerator_bot : primaryGenerator ⊥ = 0 := primaryGenerator_zero theorem primaryGenerator_one : primaryGenerator 1 = 1 := by rw [primaryGenerator, ite_eq_right one_ne_zero, UniqueFactorizationMonoid.normalizedFactors_one] rfl theorem primaryGenerator_mul (I J : Ideal O) : primaryGenerator (I * J) = primaryGenerator I * primaryGenerator J := by classical by_cases hI : I = 0 · simp [hI, primaryGenerator_bot] by_cases hJ : J = 0 · simp [hJ, primaryGenerator_bot] simp only [primaryGenerator, ite_eq_right hI, ite_eq_right hJ, ite_eq_right (mul_ne_zero hI hJ), UniqueFactorizationMonoid.normalizedFactors_mul hI hJ, Multiset.map_add, Multiset.prod_add] def primaryGeneratorHom : Ideal O →*₀ O where toFun := primaryGenerator map_zero' := primaryGenerator_zero map_one' := primaryGenerator_one map_mul' := primaryGenerator_mul theorem primaryGenerator_ne_zero_ideal (I : Ideal O) (h : primaryGenerator I ≠ 0) : I ≠ 0 := by intro hI exact h (by simp [hI, primaryGenerator_bot]) theorem primaryPrime_factor_ne_zero (I P : Ideal O) (hI : primaryGenerator I ≠ 0) (hP : P ∈ UniqueFactorizationMonoid.normalizedFactors I) : primaryPrime P ≠ 0 := by have hI0 := primaryGenerator_ne_zero_ideal I hI have hprod : ((UniqueFactorizationMonoid.normalizedFactors I).map primaryPrime).prod ≠ 0 := by simpa only [primaryGenerator, ite_eq_right hI0] using hI intro hz exact hprod (Multiset.prod_eq_zero_iff.mpr (Multiset.mem_map.mpr ⟨P, hP, hz⟩)) theorem span_multiset_prod (s : Multiset O) : Ideal.span {s.prod} = (s.map (fun x => Ideal.span {x})).prod := by induction s using Multiset.induction_on with | empty => simp | @cons a s ih => simp only [Multiset.prod_cons, Multiset.map_cons, ← Ideal.span_singleton_mul_span_singleton, ih] theorem primaryGenerator_spec (I : Ideal O) (h : primaryGenerator I ≠ 0) : Ideal.span {primaryGenerator I} = I ∧ lambda ^ 2 ∣ primaryGenerator I - 1 := by classical have hI0 := primaryGenerator_ne_zero_ideal I h have hprime : ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, Ideal.span {primaryPrime P} = P ∧ lambda ^ 2 ∣ primaryPrime P - 1 := by intro P hP exact (primaryPrime_spec P (primaryPrime_factor_ne_zero I P h hP)).2.2 rw [primaryGenerator, ite_eq_right hI0] constructor · rw [span_multiset_prod, Multiset.map_map] have hm : (UniqueFactorizationMonoid.normalizedFactors I).map ((fun x => Ideal.span {x}) ∘ primaryPrime) = UniqueFactorizationMonoid.normalizedFactors I := by calc _ = (UniqueFactorizationMonoid.normalizedFactors I).map id := Multiset.map_congr rfl (fun P hP => (hprime P hP).1) _ = _ := Multiset.map_id' _ rw [hm] exact Ideal.prod_normalizedFactors_eq_self hI0 · apply primary_multiset_prod intro r hr obtain ⟨P, hP, rfl⟩ := Multiset.mem_map.mp hr exact (hprime P hP).2 theorem primaryGenerator_span (n : O) (hn : n ≠ 0) (hprimary : lambda ^ 2 ∣ n - 1) : primaryGenerator (Ideal.span {n}) = n := by classical have hI0 : (Ideal.span {n} : Ideal O) ≠ 0 := Ideal.span_singleton_eq_bot.not.mpr hn have hgen : primaryGenerator (Ideal.span {n}) ≠ 0 := by rw [primaryGenerator, ite_eq_right hI0] apply Multiset.prod_ne_zero intro hzero obtain ⟨P, hP, hz⟩ := Multiset.mem_map.mp hzero have hp := UniqueFactorizationMonoid.prime_of_normalized_factor P hP let : P.IsMaximal := (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero have hle := ((Ideal.mem_normalizedFactors_iff hI0).mp hP).2 have hnP : n ∈ P := hle (Ideal.subset_span (by simp)) exact primaryPrime_ne_zero P (primary_maximal_divisor_good n hprimary P hnP) hz have hspec := primaryGenerator_spec (Ideal.span {n}) hgen exact primary_associated_eq _ _ (Ideal.span_singleton_eq_span_singleton.mp hspec.1) hspec.2 hprimary theorem primaryGenerator_norm_sq (I : Ideal O) (h : primaryGenerator I ≠ 0) : ‖ConcreteTraceCRT.eisEmbedding (primaryGenerator I)‖ ^ 2 = (Ideal.absNorm I : ℝ) := by rw [eisEmbedding_norm_sq_eq_absNorm_span, (primaryGenerator_spec I h).1] open ActualEisensteinCubic theorem compact_window_bound (W : ℝ → ℂ) (hW : HasCompactSupport W) : ∃ B : ℝ, 0 < B ∧ ∀ y, W y ≠ 0 → y ≤ B := by obtain ⟨B, hB⟩ := hW.bddAbove refine ⟨max B 1, lt_of_lt_of_le zero_lt_one (le_max_right _ _), ?_⟩ intro y hy exact (hB (subset_tsupport W hy)).trans (le_max_left _ _) theorem norm_at_least_one (I : Ideal O) (hI : I ≠ 0) : (1 : ℝ) ≤ Ideal.absNorm I := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr hI) theorem triple_scale_bounds (a b c : ℝ) (ha : 1 ≤ a) (hb : 1 ≤ b) (hc : 1 ≤ c) : a ≤ a * b ^ 3 * c ^ 3 ∧ b ≤ a * b ^ 3 * c ^ 3 ∧ c ≤ a * b ^ 3 * c ^ 3 := by have ha0 : 0 ≤ a := by linarith have hb0 : 0 ≤ b := by linarith have hc0 : 0 ≤ c := by linarith have hb3 : 1 ≤ b ^ 3 := one_le_pow₀ hb have hc3 : 1 ≤ c ^ 3 := one_le_pow₀ hc constructor · calc a = a * 1 * 1 := by ring _ ≤ a * b ^ 3 * c ^ 3 := by gcongr constructor · calc b ≤ b ^ 3 := le_self_pow₀ hb (by decide) _ = 1 * b ^ 3 * 1 := by ring _ ≤ a * b ^ 3 * c ^ 3 := by gcongr · calc c ≤ c ^ 3 := le_self_pow₀ hc (by decide) _ = 1 * 1 * c ^ 3 := by ring _ ≤ a * b ^ 3 * c ^ 3 := by gcongr theorem finite_support_norm_triple (W : ℝ → ℂ) (hW : HasCompactSupport W) (X : ℝ) (hX : 0 < X) (F : Ideal O × Ideal O × Ideal O → ℂ) (hzero : ∀ I J H, I = 0 ∨ J = 0 ∨ H = 0 → F (I, J, H) = 0) (hwindow : ∀ I J H, W ((Ideal.absNorm I : ℝ) * (Ideal.absNorm J : ℝ) ^ 3 * (Ideal.absNorm H : ℝ) ^ 3 / X) = 0 → F (I, J, H) = 0) : (Function.support F).Finite := by obtain ⟨B, hB, hbound⟩ := compact_window_bound W hW obtain ⟨M, hM⟩ := exists_nat_gt (B * X) let S := {I : Ideal O | Ideal.absNorm I ≤ M} have hS : S.Finite := Ideal.finite_setOfPred_absNorm_le M apply (hS.prod (hS.prod hS)).subset rintro ⟨I, J, H⟩ hF have hF0 : F (I, J, H) ≠ 0 := hF have hI : I ≠ 0 := fun h => hF0 (hzero I J H (Or.inl h)) have hJ : J ≠ 0 := fun h => hF0 (hzero I J H (Or.inr (Or.inl h))) have hH : H ≠ 0 := fun h => hF0 (hzero I J H (Or.inr (Or.inr h))) have hw : W ((Ideal.absNorm I : ℝ) * (Ideal.absNorm J : ℝ) ^ 3 * (Ideal.absNorm H : ℝ) ^ 3 / X) ≠ 0 := fun h => hF0 (hwindow I J H h) have hsize := (div_le_iff₀ hX).mp (hbound _ hw) have hb := triple_scale_bounds _ _ _ (norm_at_least_one I hI) (norm_at_least_one J hJ) (norm_at_least_one H hH) have hIM : Ideal.absNorm I ≤ M := by exact_mod_cast (hb.1.trans hsize).trans hM.le have hJM : Ideal.absNorm J ≤ M := by exact_mod_cast (hb.2.1.trans hsize).trans hM.le have hHM : Ideal.absNorm H ≤ M := by exact_mod_cast (hb.2.2.trans hsize).trans hM.le exact ⟨hIM, hJM, hHM⟩ end section open ActualEisensteinCubic ConcreteTraceCRT def primeSupport (I : Ideal O) : Finset (Ideal O) := (UniqueFactorizationMonoid.normalizedFactors I).toFinset abbrev PrimeIndex (I : Ideal O) := {P : Ideal O // P ∈ primeSupport I} theorem primeIndexMaximal (I : Ideal O) (P : PrimeIndex I) : P.val.IsMaximal := by have hp := UniqueFactorizationMonoid.prime_of_normalized_factor P.val (Multiset.mem_toFinset.mp P.property) exact (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero theorem primeIndex_good (I : Ideal O) (hI : primaryGenerator I ≠ 0) (P : PrimeIndex I) : lambda ∉ P.val := (primaryPrime_spec P.val (primaryPrime_factor_ne_zero I P.val hI (Multiset.mem_toFinset.mp P.property))).2.1 theorem primeIndex_le (I : Ideal O) (hI : I ≠ 0) (P : PrimeIndex I) : I ≤ P.val := ((Ideal.mem_normalizedFactors_iff hI).mp (Multiset.mem_toFinset.mp P.property)).2 def cubicRow (I : Ideal O) (hI : primaryGenerator I ≠ 0) (x : O ⧸ I) : ℂ := ∏ P : PrimeIndex I, let : P.val.IsMaximal := primeIndexMaximal I P (canonicalSextic P.val (primeIndex_good I hI P) ^ 2) (Ideal.Quotient.factor (primeIndex_le I (primaryGenerator_ne_zero_ideal I hI) P) x) def gaussTwo (I : Ideal O) (hI : primaryGenerator I ≠ 0) : ℂ := by let n := primaryGenerator I letI : Finite (O ⧸ Ideal.span {n}) := finite_quotient_span hI letI : Fintype (O ⧸ Ideal.span {n}) := Fintype.ofFinite _ let e := Ideal.quotEquivOfEq (primaryGenerator_spec I hI).1 let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates n hI exact (∑ x : O ⧸ Ideal.span {n}, cubicRow I hI (e x) * ψ x) / (‖eisEmbedding n‖ : ℂ) def squarefreeGaussCoefficient (I : Ideal O) : ℂ := if h : Squarefree I ∧ primaryGenerator I ≠ 0 then star (FiniteGaussPhase.angularFactor (primaryGenerator I)) * gaussTwo I h.2 else 0 theorem squarefreeGaussCoefficient_zero : squarefreeGaussCoefficient 0 = 0 := by simp [squarefreeGaussCoefficient, primaryGenerator_bot] theorem squarefreeGaussCoefficient_bot : squarefreeGaussCoefficient ⊥ = 0 := squarefreeGaussCoefficient_zero theorem squarefreeGaussCoefficient_eq (I : Ideal O) (hs : Squarefree I) (hI : primaryGenerator I ≠ 0) : squarefreeGaussCoefficient I = star (FiniteGaussPhase.angularFactor (primaryGenerator I)) * gaussTwo I hI := by rw [squarefreeGaussCoefficient, dite_eq_left ⟨hs, hI⟩] theorem angularFactor_mul (a b : O) : FiniteGaussPhase.angularFactor (a * b) = FiniteGaussPhase.angularFactor a * FiniteGaussPhase.angularFactor b := by simp only [FiniteGaussPhase.angularFactor, map_mul, norm_mul, Complex.ofReal_mul] ring def cubeWeight (Ψ : O →* ℂ) : Ideal O →* ℂ where toFun I := star (FiniteGaussPhase.angularFactor (primaryGenerator I)) ^ 3 * Ψ (primaryGenerator I) ^ 3 / (Ideal.absNorm I : ℂ) map_one' := by simp only [primaryGenerator_one, FiniteGaussPhase.angularFactor, map_one, norm_one, Complex.ofReal_one, div_one, star_one, one_pow, one_mul, Nat.cast_one] map_mul' I J := by simp only [primaryGenerator_mul, angularFactor_mul, map_mul, star_mul, mul_pow, Nat.cast_mul] ring theorem cubeWeight_zero (Ψ : O →* ℂ) : cubeWeight Ψ 0 = 0 := by simp [cubeWeight, FiniteGaussPhase.angularFactor] theorem cubeWeight_bot (Ψ : O →* ℂ) : cubeWeight Ψ ⊥ = 0 := cubeWeight_zero Ψ def columnWeight (Ψ : O →* ℂ) (I : Ideal O) : ℂ := squarefreeGaussCoefficient I * Ψ (primaryGenerator I) theorem columnWeight_zero (Ψ : O →* ℂ) : columnWeight Ψ 0 = 0 := by simp [columnWeight, squarefreeGaussCoefficient_bot] theorem columnWeight_bot (Ψ : O →* ℂ) : columnWeight Ψ ⊥ = 0 := columnWeight_zero Ψ def Vstar (W : ℝ → ℂ) (y : ℝ) : ℂ := (Real.sqrt y : ℂ) * W y def summand (Ψ : O →* ℂ) (W : ℝ → ℂ) (X : ℝ) (I J : Ideal O) : ℂ := columnWeight Ψ I / (Real.sqrt (Ideal.absNorm I : ℝ) : ℂ) * cubeWeight Ψ J * Vstar W ((Ideal.absNorm I : ℝ) * (Ideal.absNorm J : ℝ) ^ 3 / X) def completedT (Ψ : O →* ℂ) (W : ℝ → ℂ) (X : ℝ) : ℂ := ∑' I : Ideal O, ∑' J : Ideal O, summand Ψ W X I J theorem summand_zero_left (Ψ : O →* ℂ) (W : ℝ → ℂ) (X : ℝ) (J : Ideal O) : summand Ψ W X 0 J = 0 := by simp [summand] theorem summand_zero_right (Ψ : O →* ℂ) (W : ℝ → ℂ) (X : ℝ) (I : Ideal O) : summand Ψ W X I 0 = 0 := by simp [summand, cubeWeight_bot] theorem summand_zero_window (Ψ : O →* ℂ) (W : ℝ → ℂ) (X : ℝ) (I J : Ideal O) (h : W ((Ideal.absNorm I : ℝ) * (Ideal.absNorm J : ℝ) ^ 3 / X) = 0) : summand Ψ W X I J = 0 := by simp [summand, Vstar, h] theorem cubicRow_mk (I : Ideal O) (hI : primaryGenerator I ≠ 0) (a : O) : cubicRow I hI (Ideal.Quotient.mk I a) = ∏ P : PrimeIndex I, let : P.val.IsMaximal := primeIndexMaximal I P (canonicalSextic P.val (primeIndex_good I hI P) ^ 2) (Ideal.Quotient.mk P.val a) := by simp only [cubicRow, Ideal.Quotient.factor_mk] theorem primaryGenerator_norm (I : Ideal O) (hI : primaryGenerator I ≠ 0) : ‖eisEmbedding (primaryGenerator I)‖ = Real.sqrt (Ideal.absNorm I : ℝ) := by rw [← primaryGenerator_norm_sq I hI, Real.sqrt_sq_eq_abs, abs_of_nonneg (norm_nonneg _)] theorem columnWeight_eq (Ψ : O →* ℂ) (I : Ideal O) (hs : Squarefree I) (hI : primaryGenerator I ≠ 0) : columnWeight Ψ I = star (FiniteGaussPhase.angularFactor (primaryGenerator I)) * gaussTwo I hI * Ψ (primaryGenerator I) := by rw [columnWeight, squarefreeGaussCoefficient_eq I hs hI] theorem columnWeight_zero_of_mask (Ψ : O →* ℂ) (I : Ideal O) (h : Ψ (primaryGenerator I) = 0) : columnWeight Ψ I = 0 := by simp only [columnWeight, h, mul_zero] theorem cubeWeight_zero_of_mask (Ψ : O →* ℂ) (I : Ideal O) (h : Ψ (primaryGenerator I) = 0) : cubeWeight Ψ I = 0 := by change _ * Ψ (primaryGenerator I) ^ 3 / _ = 0 rw [h, zero_pow (by decide), mul_zero, zero_div] end open ActualEisensteinCubic open IdealMobiusDivisorSum (idealDivisors mem_idealDivisors sum_moebius_divisors) def MulFiber (B : Ideal O) := {p : Ideal O × Ideal O // p.1 * p.2 = B} def mulFiberDivisorEquiv (B : Ideal O) (hB : B ≠ 0) : MulFiber B ≃ {D : Ideal O // D ∈ idealDivisors B} := by let f : MulFiber B → {D : Ideal O // D ∈ idealDivisors B} := fun p => ⟨p.val.1, (mem_idealDivisors hB).mpr ⟨p.val.2, p.property.symm⟩⟩ apply Equiv.ofBijective f constructor · intro p q hpq have hfst : p.val.1 = q.val.1 := congrArg Subtype.val hpq apply Subtype.ext apply Prod.ext hfst have hn : p.val.1 ≠ 0 := by intro hz have he := p.property rw [hz, zero_mul] at he exact hB he.symm apply mul_left_cancel₀ hn rw [p.property, hfst, q.property] · intro D obtain ⟨J, hJ⟩ := (mem_idealDivisors hB).mp D.property exact ⟨⟨(D.val, J), hJ.symm⟩, rfl⟩ theorem mulFiber_moebius_sum (B : Ideal O) (hB : B ≠ 0) : (∑' p : MulFiber B, (UniqueFactorizationMonoid.moebius p.val.1 : ℂ)) = if B = 1 then 1 else 0 := by let e := mulFiberDivisorEquiv B hB calc _ = ∑' D : {D : Ideal O // D ∈ idealDivisors B}, (UniqueFactorizationMonoid.moebius D.val : ℂ) := by exact e.tsum_eq (fun D => (UniqueFactorizationMonoid.moebius D.val : ℂ)) _ = ∑ D ∈ idealDivisors B, (UniqueFactorizationMonoid.moebius D : ℂ) := by rw [tsum_fintype] exact (Finset.sum_subtype (idealDivisors B) (fun D => Iff.rfl) (fun D => (UniqueFactorizationMonoid.moebius D : ℂ))).symm _ = if B = 1 then 1 else 0 := by simpa only [Ideal.one_eq_top] using sum_moebius_divisors B hB theorem ideal_cube_convolution (c : Ideal O →* ℂ) (hc0 : c 0 = 0) (f : Ideal O → ℂ) (hfinite : (Function.support (fun p : Ideal O × Ideal O => (UniqueFactorizationMonoid.moebius p.1 : ℂ) * c (p.1 * p.2) * f (p.1 * p.2))).Finite) : (∑' H : Ideal O, ∑' J : Ideal O, (UniqueFactorizationMonoid.moebius H : ℂ) * c (H * J) * f (H * J)) = f 1 := by let F : Ideal O × Ideal O → ℂ := fun p => (UniqueFactorizationMonoid.moebius p.1 : ℂ) * c (p.1 * p.2) * f (p.1 * p.2) have hF : Summable F := summable_of_hasFiniteSupport hfinite have hfiber (B : Ideal O) : (∑' p : MulFiber B, F p.val) = if B = 1 then f 1 else 0 := by by_cases hB : B = 0 · subst B have heach : ∀ p : MulFiber 0, F p.val = 0 := by intro p dsimp [F] rw [p.property, hc0, mul_zero, zero_mul] simp only [heach, tsum_zero, zero_ne_one, ite_false] · calc _ = ∑' p : MulFiber B, (UniqueFactorizationMonoid.moebius p.val.1 : ℂ) * (c B * f B) := by apply tsum_congr intro p dsimp [F] rw [p.property, mul_assoc] _ = (∑' p : MulFiber B, (UniqueFactorizationMonoid.moebius p.val.1 : ℂ)) * (c B * f B) := by rw [tsum_mul_right] _ = if B = 1 then f 1 else 0 := by rw [mulFiber_moebius_sum B hB] split_ifs with h · subst B; simp only [map_one, one_mul] · simp have hs := hF.hasSum.tsum_fiberwise (fun p : Ideal O × Ideal O => p.1 * p.2) change HasSum (fun B : Ideal O => ∑' p : MulFiber B, F p.val) (∑' p, F p) at hs simp_rw [hfiber] at hs have hsum : (∑' p, F p) = f 1 := by have he := hs.tsum_eq.symm simpa only [tsum_ite_eq, one_ne_zero] using he rw [← hF.tsum_prod] exact hsum end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.CompletedExpansion namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace CompletedGauss open ActualEisensteinCubic def expandedTerm (Ψ : O →* ℂ) (W : ℝ → ℂ) (X : ℝ) (I H J : Ideal O) : ℂ := (UniqueFactorizationMonoid.moebius H : ℂ) * cubeWeight Ψ (H * J) * (columnWeight Ψ I / (Real.sqrt (Ideal.absNorm I : ℝ) : ℂ) * Vstar W ((Ideal.absNorm I : ℝ) * (Ideal.absNorm H : ℝ) ^ 3 * (Ideal.absNorm J : ℝ) ^ 3 / X)) theorem finite_support_expandedTerm (Ψ : O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X : ℝ) (hX : 0 < X) : (Function.support (fun p : Ideal O × Ideal O × Ideal O => expandedTerm Ψ W X p.1 p.2.1 p.2.2)).Finite := by apply finite_support_norm_triple W hW X hX · intro I H J hz rcases hz with rfl | rfl | rfl <;> simp [expandedTerm, cubeWeight_bot] · intro I H J hw simp [expandedTerm, Vstar, hw] theorem expandedTerm_scale (Ψ : O →* ℂ) (W : ℝ → ℂ) (X : ℝ) (I H J : Ideal O) : (UniqueFactorizationMonoid.moebius H : ℂ) * cubeWeight Ψ H * summand Ψ W (X / (Ideal.absNorm H : ℝ) ^ 3) I J = expandedTerm Ψ W X I H J := by have harg : (Ideal.absNorm I : ℝ) * (Ideal.absNorm J : ℝ) ^ 3 / (X / (Ideal.absNorm H : ℝ) ^ 3) = (Ideal.absNorm I : ℝ) * (Ideal.absNorm H : ℝ) ^ 3 * (Ideal.absNorm J : ℝ) ^ 3 / X := by rw [div_div_eq_mul_div] ring simp only [summand, expandedTerm, harg, map_mul] ring theorem expandedTerm_one (Ψ : O →* ℂ) (W : ℝ → ℂ) (X : ℝ) (I J : Ideal O) : expandedTerm Ψ W X I 1 J = summand Ψ W X I J := by simp only [expandedTerm, summand, UniqueFactorizationMonoid.moebius_one, Int.cast_one, one_mul, map_one, Nat.cast_one, one_pow, mul_one] ring theorem completedT_finite_support (Ψ : O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X : ℝ) (hX : 0 < X) : (Function.support (fun p : Ideal O × Ideal O => summand Ψ W X p.1 p.2)).Finite := by have hf := finite_support_expandedTerm Ψ W hW X hX have hinj : Function.Injective (fun p : Ideal O × Ideal O => (p.1, (1 : Ideal O), p.2)) := by intro a b hab exact Prod.ext (Prod.mk.inj hab).1 (Prod.mk.inj (Prod.mk.inj hab).2).2 have hp := Set.Finite.preimage hinj.injOn hf change (Function.support (fun p : Ideal O × Ideal O => expandedTerm Ψ W X p.1 1 p.2)).Finite at hp simpa only [expandedTerm_one] using hp theorem completedT_summable (Ψ : O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X : ℝ) (hX : 0 < X) : Summable (fun p : Ideal O × Ideal O => summand Ψ W X p.1 p.2) := summable_of_hasFiniteSupport (completedT_finite_support Ψ W hW X hX) theorem weighted_completedT_reopen (Ψ : O →* ℂ) (W : ℝ → ℂ) (X : ℝ) (H : Ideal O) : (UniqueFactorizationMonoid.moebius H : ℂ) * cubeWeight Ψ H * completedT Ψ W (X / (Ideal.absNorm H : ℝ) ^ 3) = ∑' I : Ideal O, ∑' J : Ideal O, expandedTerm Ψ W X I H J := by simp only [completedT, ← tsum_mul_left, expandedTerm_scale] theorem cube_inverse_finite_support (Ψ : O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X : ℝ) (hX : 0 < X) : (Function.support (fun H : Ideal O => (UniqueFactorizationMonoid.moebius H : ℂ) * cubeWeight Ψ H * completedT Ψ W (X / (Ideal.absNorm H : ℝ) ^ 3))).Finite := by have hf := finite_support_expandedTerm Ψ W hW X hX apply (hf.image (fun p => p.2.1)).subset intro H hH by_contra hn have hzero : ∀ I J, expandedTerm Ψ W X I H J = 0 := by intro I J by_contra hz exact hn ⟨(I, H, J), hz, rfl⟩ apply hH dsimp only rw [weighted_completedT_reopen] simp only [hzero, tsum_zero] theorem cube_inner_inverse (Ψ : O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X : ℝ) (hX : 0 < X) (I : Ideal O) : (∑' H : Ideal O, ∑' J : Ideal O, expandedTerm Ψ W X I H J) = columnWeight Ψ I / (Real.sqrt (Ideal.absNorm I : ℝ) : ℂ) * Vstar W ((Ideal.absNorm I : ℝ) / X) := by let f : Ideal O → ℂ := fun B => columnWeight Ψ I / (Real.sqrt (Ideal.absNorm I : ℝ) : ℂ) * Vstar W ((Ideal.absNorm I : ℝ) * (Ideal.absNorm B : ℝ) ^ 3 / X) have heq (H J : Ideal O) : (UniqueFactorizationMonoid.moebius H : ℂ) * cubeWeight Ψ (H * J) * f (H * J) = expandedTerm Ψ W X I H J := by simp only [f, expandedTerm, map_mul, Nat.cast_mul, mul_pow, mul_assoc] have hf := finite_support_expandedTerm Ψ W hW X hX have hp : (Function.support (fun p : Ideal O × Ideal O => expandedTerm Ψ W X I p.1 p.2)).Finite := by change ((fun p : Ideal O × Ideal O => (I, p)) ⁻¹' Function.support (fun p : Ideal O × Ideal O × Ideal O => expandedTerm Ψ W X p.1 p.2.1 p.2.2)).Finite exact Set.Finite.preimage (fun a _ b _ hab => (Prod.mk.inj hab).2) hf have hgeneric := ideal_cube_convolution (cubeWeight Ψ) (cubeWeight_zero Ψ) f (by simpa only [heq] using hp) simpa only [heq, f, map_one, Nat.cast_one, one_pow, mul_one] using hgeneric theorem completed_cube_inverse_vstar (Ψ : O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X : ℝ) (hX : 0 < X) : (∑' H : Ideal O, (UniqueFactorizationMonoid.moebius H : ℂ) * cubeWeight Ψ H * completedT Ψ W (X / (Ideal.absNorm H : ℝ) ^ 3)) = ∑' I : Ideal O, columnWeight Ψ I / (Real.sqrt (Ideal.absNorm I : ℝ) : ℂ) * Vstar W ((Ideal.absNorm I : ℝ) / X) := by let F : Ideal O × Ideal O × Ideal O → ℂ := fun p => expandedTerm Ψ W X p.1 p.2.1 p.2.2 have hF : Summable F := summable_of_hasFiniteSupport (finite_support_expandedTerm Ψ W hW X hX) let e : (Ideal O × Ideal O × Ideal O) ≃ (Ideal O × Ideal O × Ideal O) := { toFun := fun p => (p.2.1, p.1, p.2.2) invFun := fun p => (p.2.1, p.1, p.2.2) left_inv := by rintro ⟨I, H, J⟩; rfl right_inv := by rintro ⟨I, H, J⟩; rfl } have hswap : Summable (fun p => F (e p)) := e.summable_iff.mpr hF calc _ = ∑' H : Ideal O, ∑' I : Ideal O, ∑' J : Ideal O, expandedTerm Ψ W X I H J := by simp only [completedT, ← tsum_mul_left, expandedTerm_scale] _ = ∑' p : Ideal O × Ideal O × Ideal O, F (e p) := by rw [hswap.tsum_prod] apply tsum_congr intro H exact (hswap.prod_factor H).tsum_prod.symm _ = ∑' p : Ideal O × Ideal O × Ideal O, F p := e.tsum_eq F _ = ∑' I : Ideal O, ∑' H : Ideal O, ∑' J : Ideal O, expandedTerm Ψ W X I H J := by rw [hF.tsum_prod] apply tsum_congr intro I exact (hF.prod_factor I).tsum_prod _ = _ := tsum_congr (cube_inner_inverse Ψ W hW X hX) theorem vstar_source_normalization (Ψ : O →* ℂ) (W : ℝ → ℂ) (X : ℝ) (hX : 0 < X) (I : Ideal O) : columnWeight Ψ I / (Real.sqrt (Ideal.absNorm I : ℝ) : ℂ) * Vstar W ((Ideal.absNorm I : ℝ) / X) = (Real.sqrt X : ℂ)⁻¹ * columnWeight Ψ I * W ((Ideal.absNorm I : ℝ) / X) := by by_cases hI : I = 0 · subst I; simp [columnWeight_bot] have hN : (0 : ℝ) < Ideal.absNorm I := lt_of_lt_of_le zero_lt_one (norm_at_least_one I hI) have hsN : (Real.sqrt (Ideal.absNorm I : ℝ) : ℂ) ≠ 0 := by exact_mod_cast (Real.sqrt_pos.2 hN).ne' have hsX : (Real.sqrt X : ℂ) ≠ 0 := by exact_mod_cast (Real.sqrt_pos.2 hX).ne' rw [Vstar, Real.sqrt_div hN.le, Complex.ofReal_div] field_simp theorem completed_cube_inverse (Ψ : O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X : ℝ) (hX : 0 < X) : (Real.sqrt X : ℂ)⁻¹ * (∑' I : Ideal O, columnWeight Ψ I * W ((Ideal.absNorm I : ℝ) / X)) = ∑' H : Ideal O, (UniqueFactorizationMonoid.moebius H : ℂ) * cubeWeight Ψ H * completedT Ψ W (X / (Ideal.absNorm H : ℝ) ^ 3) := by rw [completed_cube_inverse_vstar Ψ W hW X hX, ← tsum_mul_left] apply tsum_congr intro I simpa only [mul_assoc] using (vstar_source_normalization Ψ W X hX I).symm open ActualEisensteinCubic ConcreteTraceCRT theorem normalizedFactors_product {ι : Type*} [Fintype ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] : UniqueFactorizationMonoid.normalizedFactors (Ideal.span {∏ i, p i}) = Finset.univ.val.map (fun i => Ideal.span {p i}) := by have hp (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne _) inferInstance have h := UniqueFactorizationMonoid.normalizedFactors_prod_of_prime (m := Finset.univ.val.map (fun i => Ideal.span {p i})) (by intro P hP obtain ⟨i, _, rfl⟩ := Multiset.mem_map.mp hP exact hp i) rw [FiniteGaussPhase.span_finset_prod] exact h theorem product_primary {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, lambda ^ 2 ∣ p i - 1) : lambda ^ 2 ∣ (∏ i, p i) - 1 := by apply primary_multiset_prod (Finset.univ.val.map p) intro r hr obtain ⟨i, _, rfl⟩ := Multiset.mem_map.mp hr exact hp i def productPrimeIndexEquiv {ι : Type*} [Fintype ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) : ι ≃ PrimeIndex (Ideal.span {∏ i, p i}) := by have hinj : Function.Injective (fun i => (Ideal.span {p i} : Ideal O)) := by intro i j hij by_contra hne have ht := (hcop hne).sup_eq rw [hij, sup_idem] at ht exact (inferInstance : (Ideal.span {p j}).IsMaximal).ne_top ht have hmem (i : ι) : (Ideal.span {p i} : Ideal O) ∈ primeSupport (Ideal.span {∏ i, p i}) := by rw [primeSupport, normalizedFactors_product] exact Multiset.mem_toFinset.mpr (Multiset.mem_map.mpr ⟨i, Finset.mem_univ _, rfl⟩) let f : ι → PrimeIndex (Ideal.span {∏ i, p i}) := fun i => ⟨Ideal.span {p i}, hmem i⟩ apply Equiv.ofBijective f constructor · intro i j hij exact hinj (congrArg Subtype.val hij) · intro P have hm := Multiset.mem_toFinset.mp P.property rw [normalizedFactors_product] at hm obtain ⟨i, _, hi⟩ := Multiset.mem_map.mp hm exact ⟨i, Subtype.ext hi⟩ theorem cubicRow_product_mk {ι : Type*} [Fintype ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (hI : primaryGenerator (Ideal.span {∏ i, p i}) ≠ 0) (a : O) : cubicRow (Ideal.span {∏ i, p i}) hI (Ideal.Quotient.mk (Ideal.span {∏ i, p i}) a) = ∏ i, (canonicalSextic (Ideal.span {p i}) (hgood i) ^ 2) (Ideal.Quotient.mk (Ideal.span {p i}) a) := by rw [cubicRow_mk] symm exact (productPrimeIndexEquiv p hcop).prod_comp (fun P => let : P.val.IsMaximal := primeIndexMaximal _ P (canonicalSextic P.val (primeIndex_good _ hI P) ^ 2) (Ideal.Quotient.mk P.val a)) theorem gaussTwo_eq_canonicalProductGauss {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (hprimary : ∀ i, lambda ^ 2 ∣ p i - 1) (hI : primaryGenerator (Ideal.span {∏ i, p i}) ≠ 0) : gaussTwo (Ideal.span {∏ i, p i}) hI = FiniteGaussPhase.canonicalProductGauss p hp hcop hgood (fun _ => 2) := by have hpall : (∏ i, p i) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i _ => hp i) have hgen := primaryGenerator_span (∏ i, p i) hpall (product_primary p hprimary) let : Finite (O ⧸ Ideal.span {∏ i, p i}) := finite_quotient_span hpall let : Fintype (O ⧸ Ideal.span {∏ i, p i}) := Fintype.ofFinite _ let : Finite (O ⧸ Ideal.span {primaryGenerator (Ideal.span {∏ i, p i})}) := finite_quotient_span hI let : Fintype (O ⧸ Ideal.span {primaryGenerator (Ideal.span {∏ i, p i})}) := Fintype.ofFinite _ let e := Ideal.quotEquivOfEq (primaryGenerator_spec (Ideal.span {∏ i, p i}) hI).1 have hsum : (∑ x : O ⧸ Ideal.span {primaryGenerator (Ideal.span {∏ i, p i})}, cubicRow (Ideal.span {∏ i, p i}) hI (e x) * eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (primaryGenerator (Ideal.span {∏ i, p i})) hI x) = (∑ x : O ⧸ Ideal.span {∏ i, p i}, (∏ i, (canonicalSextic (Ideal.span {p i}) (hgood i) ^ 2) (FiniteGaussPhase.productElementCRT p hcop x i)) * eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (∏ i, p i) hpall x) := by apply Fintype.sum_equiv e.toEquiv intro x change cubicRow (Ideal.span {∏ i, p i}) hI (e x) * eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (primaryGenerator (Ideal.span {∏ i, p i})) hI x = (∏ i, (canonicalSextic (Ideal.span {p i}) (hgood i) ^ 2) (FiniteGaussPhase.productElementCRT p hcop (e x) i)) * eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (∏ i, p i) hpall (e x) obtain ⟨a, rfl⟩ := Ideal.Quotient.mk_surjective x simp only [e, Ideal.quotEquivOfEq_mk, cubicRow_product_mk p hcop hgood hI, FiniteGaussPhase.productElementCRT_mk, eisTraceModChar, IdealGaussCRT.traceModChar_mk, hgen] change _ / _ = _ / _ rw [hsum, hgen] theorem squarefreeGaussCoefficient_eq_canonicalProductCoefficient {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (hprimary : ∀ i, lambda ^ 2 ∣ p i - 1) : squarefreeGaussCoefficient (Ideal.span {∏ i, p i}) = FiniteGaussPhase.canonicalProductCoefficient p hp hcop hgood := by have hpall : (∏ i, p i) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i _ => hp i) have hgen := primaryGenerator_span (∏ i, p i) hpall (product_primary p hprimary) have hI : primaryGenerator (Ideal.span {∏ i, p i}) ≠ 0 := by rwa [hgen] have hsq : Squarefree (Ideal.span {∏ i, p i}) := by apply (UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors (Ideal.span_singleton_eq_bot.not.mpr hpall)).mpr rw [normalizedFactors_product] apply Multiset.Nodup.map · intro i j hij by_contra hne have ht := (hcop hne).sup_eq rw [hij, sup_idem] at ht exact (inferInstance : (Ideal.span {p j}).IsMaximal).ne_top ht · exact Finset.univ.nodup rw [squarefreeGaussCoefficient_eq _ hsq hI, gaussTwo_eq_canonicalProductGauss p hp hcop hgood hprimary hI, hgen] rfl end CompletedGauss namespace FiniteRayExpansion variable {R : Type*} [CommRing R] [Fintype R] noncomputable abbrev instFintypeMulCharComplex_oAI : Fintype (MulChar R ℂ) := Fintype.ofFinite _ def unitFourierCoeff (f : Rˣ → ℂ) (χ : MulChar R ℂ) : ℂ := (∑ u : Rˣ, f u * star (χ (u : R))) / (Fintype.card Rˣ : ℂ) theorem unit_fourier_inversion (f : Rˣ → ℂ) (v : Rˣ) : letI : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI (∑ χ : MulChar R ℂ, unitFourierCoeff f χ * χ (v : R)) = f v := by let : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI have hN : (Fintype.card Rˣ : ℂ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero simp_rw [unitFourierCoeff, div_mul_eq_mul_div, Finset.sum_mul, mul_assoc] rw [← Finset.sum_div, Finset.sum_comm] simp_rw [← Finset.mul_sum, FiniteRingSieve.unit_char_orthogonal] simp only [mul_ite, mul_zero, Finset.sum_ite_eq', Finset.mem_univ, ite_true] exact mul_div_cancel_right₀ (f v) hN theorem norm_char_unit (χ : MulChar R ℂ) (u : Rˣ) : ‖χ (u : R)‖ = 1 := by simpa only [MulChar.coe_equivToUnitHom] using Complex.norm_eq_one_of_mem_rootsOfUnity (χ.apply_mem_rootsOfUnity u) theorem norm_char_le_one (χ : MulChar R ℂ) (r : R) : ‖χ r‖ ≤ 1 := by by_cases hr : IsUnit r · obtain ⟨u, rfl⟩ := hr exact (norm_char_unit χ u).le · rw [MulChar.map_nonunit χ hr, norm_zero] norm_num theorem unitFourierCoeff_norm_le_average (f : Rˣ → ℂ) (χ : MulChar R ℂ) : ‖unitFourierCoeff f χ‖ ≤ (∑ u : Rˣ, ‖f u‖) / (Fintype.card Rˣ : ℝ) := by rw [unitFourierCoeff, norm_div, Complex.norm_natCast] apply div_le_div_of_nonneg_right _ (by positivity) calc _ ≤ ∑ u : Rˣ, ‖f u * star (χ (u : R))‖ := norm_sum_le _ _ _ = _ := by simp only [norm_mul, norm_star, norm_char_unit, mul_one] theorem unitFourierCoeff_norm_le (f : Rˣ → ℂ) (B : ℝ) (hf : ∀ u, ‖f u‖ ≤ B) (χ : MulChar R ℂ) : ‖unitFourierCoeff f χ‖ ≤ B := by have hN : (Fintype.card Rˣ : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero calc _ ≤ (∑ u : Rˣ, ‖f u‖) / (Fintype.card Rˣ : ℝ) := unitFourierCoeff_norm_le_average f χ _ ≤ (∑ _u : Rˣ, B) / (Fintype.card Rˣ : ℝ) := div_le_div_of_nonneg_right (Finset.sum_le_sum (fun u _ => hf u)) (by positivity) _ = B := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul]; field_simp theorem character_card_eq_units : letI : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI Fintype.card (MulChar R ℂ) = Fintype.card Rˣ := by let : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI simpa only [Nat.card_eq_fintype_card] using MulChar.card_eq_card_units_of_hasEnoughRootsOfUnity R ℂ theorem unitFourierCoeff_sum_norm_le (f : Rˣ → ℂ) (B : ℝ) (hf : ∀ u, ‖f u‖ ≤ B) : letI : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI (∑ χ : MulChar R ℂ, ‖unitFourierCoeff f χ‖) ≤ (Fintype.card Rˣ : ℝ) * B := by let : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI calc _ ≤ ∑ _χ : MulChar R ℂ, B := Finset.sum_le_sum (fun χ _ => unitFourierCoeff_norm_le f B hf χ) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, character_card_eq_units] def zeroExtendUnits (f : Rˣ → ℂ) (r : R) : ℂ := if hr : IsUnit r then f hr.unit else 0 theorem zeroExtendUnits_unit (f : Rˣ → ℂ) (u : Rˣ) : zeroExtendUnits f (u : R) = f u := by rw [zeroExtendUnits, dite_eq_left u.isUnit] congr 1 exact Units.ext u.isUnit.unit_spec theorem zeroExtendUnits_nonunit (f : Rˣ → ℂ) (r : R) (hr : ¬ IsUnit r) : zeroExtendUnits f r = 0 := dite_eq_right hr theorem zeroExtendUnits_fourier (f : Rˣ → ℂ) (r : R) : letI : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI zeroExtendUnits f r = ∑ χ : MulChar R ℂ, unitFourierCoeff f χ * χ r := by let : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI by_cases hr : IsUnit r · obtain ⟨u, rfl⟩ := hr rw [zeroExtendUnits_unit] exact (unit_fourier_inversion f u).symm · rw [zeroExtendUnits_nonunit f r hr] simp only [MulChar.map_nonunit _ hr, mul_zero, Finset.sum_const_zero] theorem zeroExtendUnits_restrict (f : R → ℂ) (r : R) : zeroExtendUnits (fun u : Rˣ => f (u : R)) r = (if IsUnit r then 1 else 0) * f r := by by_cases hr : IsUnit r · obtain ⟨u, rfl⟩ := hr simp only [zeroExtendUnits_unit, u.isUnit, ite_true, one_mul] · simp only [zeroExtendUnits_nonunit _ _ hr, hr, ite_false, zero_mul] def unitTensorCoeff (f : Rˣ → Rˣ → ℂ) (χ η : MulChar R ℂ) : ℂ := unitFourierCoeff (fun u => unitFourierCoeff (f u) η) χ theorem unit_tensor_fourier_inversion (f : Rˣ → Rˣ → ℂ) (u v : Rˣ) : letI : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI (∑ χ : MulChar R ℂ, ∑ η : MulChar R ℂ, unitTensorCoeff f χ η * χ (u : R) * η (v : R)) = f u v := by let : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI calc _ = ∑ η : MulChar R ℂ, (∑ χ : MulChar R ℂ, unitTensorCoeff f χ η * χ (u : R)) * η (v : R) := by rw [Finset.sum_comm] simp only [Finset.sum_mul] _ = ∑ η : MulChar R ℂ, unitFourierCoeff (f u) η * η (v : R) := by apply Finset.sum_congr rfl intro η _ change (∑ χ : MulChar R ℂ, unitFourierCoeff (fun a => unitFourierCoeff (f a) η) χ * χ (u : R)) * η (v : R) = _ rw [unit_fourier_inversion] _ = _ := unit_fourier_inversion (f u) v theorem unitTensorCoeff_norm_le (f : Rˣ → Rˣ → ℂ) (B : ℝ) (hf : ∀ u v, ‖f u v‖ ≤ B) (χ η : MulChar R ℂ) : ‖unitTensorCoeff f χ η‖ ≤ B := unitFourierCoeff_norm_le _ B (fun u => unitFourierCoeff_norm_le (f u) B (hf u) η) χ theorem unitTensorCoeff_sum_norm_le (f : Rˣ → Rˣ → ℂ) (B : ℝ) (hf : ∀ u v, ‖f u v‖ ≤ B) : letI : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI (∑ χ : MulChar R ℂ, ∑ η : MulChar R ℂ, ‖unitTensorCoeff f χ η‖) ≤ (Fintype.card Rˣ : ℝ) ^ 2 * B := by let : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI calc _ ≤ ∑ _χ : MulChar R ℂ, ∑ _η : MulChar R ℂ, B := Finset.sum_le_sum (fun χ _ => Finset.sum_le_sum (fun η _ => unitTensorCoeff_norm_le f B hf χ η)) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, character_card_eq_units] ring def zeroExtendUnitPair (f : Rˣ → Rˣ → ℂ) (r s : R) : ℂ := zeroExtendUnits (fun u => zeroExtendUnits (f u) s) r theorem zeroExtendUnitPair_fourier (f : Rˣ → Rˣ → ℂ) (r s : R) : letI : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI zeroExtendUnitPair f r s = ∑ χ : MulChar R ℂ, ∑ η : MulChar R ℂ, unitTensorCoeff f χ η * χ r * η s := by let : Fintype (MulChar R ℂ) := instFintypeMulCharComplex_oAI by_cases hr : IsUnit r · obtain ⟨u, rfl⟩ := hr by_cases hs : IsUnit s · obtain ⟨v, rfl⟩ := hs simp only [zeroExtendUnitPair, zeroExtendUnits_unit] exact (unit_tensor_fourier_inversion f u v).symm · simp only [zeroExtendUnitPair, zeroExtendUnits_unit, zeroExtendUnits_nonunit _ _ hs, MulChar.map_nonunit _ hs, mul_zero, Finset.sum_const_zero] · simp only [zeroExtendUnitPair, zeroExtendUnits_nonunit _ _ hr, MulChar.map_nonunit _ hr, mul_zero, zero_mul, Finset.sum_const_zero] theorem zeroExtendUnitPair_restrict (f : R → R → ℂ) (r s : R) : zeroExtendUnitPair (fun u v : Rˣ => f (u : R) (v : R)) r s = (if IsUnit r then 1 else 0) * (if IsUnit s then 1 else 0) * f r s := by by_cases hr : IsUnit r · obtain ⟨u, rfl⟩ := hr simp only [zeroExtendUnitPair, zeroExtendUnits_unit, zeroExtendUnits_restrict, u.isUnit, ite_true, one_mul] · simp only [zeroExtendUnitPair, zeroExtendUnits_nonunit _ _ hr, hr, ite_false, zero_mul] end FiniteRayExpansion open scoped BigOperators Classical namespace RayFourExpansion abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic ConcreteTraceCRT ActualEisensteinCoordinates QuadraticGaussRay open FiniteRayExpansion abbrev RayRing := O ⧸ Ideal.span {(4 : O)} noncomputable abbrev rayRingFintype : Fintype RayRing := by letI : Finite RayRing := finite_quotient_span (by norm_num : (4 : O) ≠ 0) exact Fintype.ofFinite _ abbrev RayCharacter := MulChar RayRing ℂ noncomputable abbrev rayCharacterFintype : Fintype RayCharacter := by letI : Fintype RayRing := rayRingFintype exact Fintype.ofFinite _ def rayCharacter (χ : RayCharacter) (a : O) : ℂ := χ (Ideal.Quotient.mk (Ideal.span {(4 : O)}) a) theorem rayCharacter_mul (χ : RayCharacter) (a b : O) : rayCharacter χ (a * b) = rayCharacter χ a * rayCharacter χ b := by simp only [rayCharacter, map_mul] theorem rayCharacter_eq_of_mod_four (χ : RayCharacter) (a b : O) (h : (4 : O) ∣ a - b) : rayCharacter χ a = rayCharacter χ b := by unfold rayCharacter congr 1 exact Ideal.Quotient.eq.mpr (Ideal.mem_span_singleton.mpr h) def rayMask (a : O) : ℂ := letI : Fintype RayRing := rayRingFintype if IsUnit (Ideal.Quotient.mk (Ideal.span {(4 : O)}) a) then 1 else 0 theorem rayRing_card : letI : Fintype RayRing := rayRingFintype Fintype.card RayRing = 16 := by let : Fintype RayRing := rayRingFintype have h := rational_modulus_card 4 (by decide) simpa only [Nat.card_eq_fintype_card, Nat.cast_ofNat, show (4 : ℕ) ^ 2 = 16 by decide] using h theorem rayUnit_card_le : letI : Fintype RayRing := rayRingFintype Fintype.card RayRingˣ ≤ 16 := by let : Fintype RayRing := rayRingFintype calc _ ≤ Fintype.card RayRing := Fintype.card_le_of_injective _ Units.val_injective _ = 16 := rayRing_card def phaseCoeff (f : RayRing → ℂ) (χ : RayCharacter) : ℂ := by letI : Fintype RayRing := rayRingFintype exact unitFourierCoeff (fun u : RayRingˣ => f (u : RayRing)) χ theorem phase_expansion (f : RayRing → ℂ) (a : O) : letI : Fintype RayCharacter := rayCharacterFintype rayMask a * f (Ideal.Quotient.mk (Ideal.span {(4 : O)}) a) = ∑ χ : RayCharacter, phaseCoeff f χ * rayCharacter χ a := by let : Fintype RayRing := rayRingFintype let : Fintype RayCharacter := rayCharacterFintype rw [rayMask, ← zeroExtendUnits_restrict (R := RayRing) f] exact zeroExtendUnits_fourier _ _ theorem phaseCoeff_sum_norm_le (f : RayRing → ℂ) (B : ℝ) (hf : ∀ u : RayRingˣ, ‖f (u : RayRing)‖ ≤ B) : letI : Fintype RayCharacter := rayCharacterFintype (∑ χ : RayCharacter, ‖phaseCoeff f χ‖) ≤ 16 * B := by let : Fintype RayRing := rayRingFintype let : Fintype RayCharacter := rayCharacterFintype have hB : 0 ≤ B := (norm_nonneg _).trans (hf 1) exact (unitFourierCoeff_sum_norm_le _ B hf).trans (mul_le_mul_of_nonneg_right (by exact_mod_cast rayUnit_card_le) hB) def pairCoeff (f : RayRing → RayRing → ℂ) (χ η : RayCharacter) : ℂ := by letI : Fintype RayRing := rayRingFintype exact unitTensorCoeff (fun u v : RayRingˣ => f (u : RayRing) (v : RayRing)) χ η theorem pair_phase_expansion (f : RayRing → RayRing → ℂ) (a b : O) : letI : Fintype RayCharacter := rayCharacterFintype rayMask a * rayMask b * f (Ideal.Quotient.mk (Ideal.span {(4 : O)}) a) (Ideal.Quotient.mk (Ideal.span {(4 : O)}) b) = ∑ χ : RayCharacter, ∑ η : RayCharacter, pairCoeff f χ η * rayCharacter χ a * rayCharacter η b := by let : Fintype RayRing := rayRingFintype let : Fintype RayCharacter := rayCharacterFintype rw [rayMask, rayMask, ← zeroExtendUnitPair_restrict (R := RayRing) f] exact zeroExtendUnitPair_fourier _ _ _ theorem pairCoeff_sum_norm_le (f : RayRing → RayRing → ℂ) (B : ℝ) (hf : ∀ u v : RayRingˣ, ‖f (u : RayRing) (v : RayRing)‖ ≤ B) : letI : Fintype RayCharacter := rayCharacterFintype (∑ χ : RayCharacter, ∑ η : RayCharacter, ‖pairCoeff f χ η‖) ≤ 256 * B := by let : Fintype RayRing := rayRingFintype let : Fintype RayCharacter := rayCharacterFintype have hB : 0 ≤ B := (norm_nonneg _).trans (hf 1 1) have hcard : (Fintype.card RayRingˣ : ℝ) ^ 2 ≤ 256 := by have h : (Fintype.card RayRingˣ : ℝ) ≤ 16 := by exact_mod_cast rayUnit_card_le nlinarith [Nat.cast_nonneg (α := ℝ) (Fintype.card RayRingˣ)] exact (unitTensorCoeff_sum_norm_le _ B hf).trans (mul_le_mul_of_nonneg_right hcard hB) theorem quadraticRayValue_bounds (r : EisensteinEPrimaryPhase.Coord) : ‖quadraticRayValue r‖ ≤ 2 ∧ ‖(quadraticRayValue r)⁻¹‖ ≤ 1 := by rcases r with ⟨a, b⟩ fin_cases a <;> fin_cases b <;> norm_num [quadraticRayValue, breveGaussianFourTerms_formula, zpow_neg, Complex.I_sq, Complex.I_pow_three, Complex.inv_I, ZMod.val] <;> ring_nf <;> norm_num [Complex.I_sq, Complex.inv_I] theorem fixedGQuotientValue_norm_le_two (r : RayRing) : ‖fixedGQuotientValue r‖ ≤ 2 := by letI := cubicTwoIdeal_isMaximal let : Fintype (O ⧸ cubicTwoIdeal) := Fintype.ofFinite _ let χ : MulChar (O ⧸ cubicTwoIdeal) ℂ := (cubicChar cubicTwoIdeal cubicTwoIdeal_good).ringHomComp eisEmbedding let x := Ideal.Quotient.mk cubicTwoIdeal (lift (residueQuotientFour r)) have hc : ‖(χ x)⁻¹‖ ≤ 1 := by simpa only [MulChar.inv_apply_eq_inv'] using norm_char_le_one (χ⁻¹) x change ‖(χ x)⁻¹ * quadraticRayValue (residueQuotientFour r)‖ ≤ 2 rw [norm_mul] calc _ ≤ 1 * 2 := mul_le_mul hc (quadraticRayValue_bounds _).1 (norm_nonneg _) (by norm_num) _ = 2 := by norm_num def gCoeff : RayCharacter → ℂ := phaseCoeff fixedGQuotientValue theorem gCoeff_sum_norm_le : letI : Fintype RayCharacter := rayCharacterFintype (∑ χ : RayCharacter, ‖gCoeff χ‖) ≤ 32 := by let : Fintype RayRing := rayRingFintype let : Fintype RayCharacter := rayCharacterFintype exact (phaseCoeff_sum_norm_le _ 2 (fun u => fixedGQuotientValue_norm_le_two u)).trans_eq (by norm_num) theorem fixedG_character_expansion (a : O) : letI : Fintype RayCharacter := rayCharacterFintype rayMask a * fixedGQuotientValue (Ideal.Quotient.mk (Ideal.span {(4 : O)}) a) = ∑ χ : RayCharacter, gCoeff χ * rayCharacter χ a := by let : Fintype RayRing := rayRingFintype let : Fintype RayCharacter := rayCharacterFintype exact phase_expansion _ a def crossQuotientPhase (r s : RayRing) : ℂ := MixedCrossSeparation.quadraticRayPair (residueQuotientFour r) (residueQuotientFour s) theorem crossQuotientPhase_norm_le_two (r s : RayRing) : ‖crossQuotientPhase r s‖ ≤ 2 := by unfold crossQuotientPhase MixedCrossSeparation.quadraticRayPair rw [div_eq_mul_inv, mul_inv_rev, norm_mul, norm_mul] calc _ ≤ 2 * (1 * 1) := mul_le_mul (quadraticRayValue_bounds _).1 (mul_le_mul (quadraticRayValue_bounds _).2 (quadraticRayValue_bounds _).2 (norm_nonneg _) (by norm_num)) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) (by norm_num) _ = 2 := by norm_num def crossCoeff : RayCharacter → RayCharacter → ℂ := pairCoeff crossQuotientPhase theorem crossCoeff_sum_norm_le : letI : Fintype RayCharacter := rayCharacterFintype (∑ χ : RayCharacter, ∑ η : RayCharacter, ‖crossCoeff χ η‖) ≤ 512 := by let : Fintype RayRing := rayRingFintype let : Fintype RayCharacter := rayCharacterFintype exact (pairCoeff_sum_norm_le _ 2 (fun u v => crossQuotientPhase_norm_le_two u v)).trans_eq (by norm_num) theorem quadraticRayPair_character_expansion (a b : O) : letI : Fintype RayCharacter := rayCharacterFintype rayMask a * rayMask b * MixedCrossSeparation.quadraticRayPair (residue a) (residue b) = ∑ χ : RayCharacter, ∑ η : RayCharacter, crossCoeff χ η * rayCharacter χ a * rayCharacter η b := by let : Fintype RayRing := rayRingFintype let : Fintype RayCharacter := rayCharacterFintype simpa only [crossCoeff, crossQuotientPhase, residueQuotientFour_mk] using pair_phase_expansion crossQuotientPhase a b end RayFourExpansion end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.RayCharacters namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace RayFourExpansion open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase QuadraticGaussRay open ActualEisensteinCoordinates MixedCrossSeparation theorem prime_unit_mod_four (p : O) [(Ideal.span {p}).IsMaximal] (hchar : ringChar (O ⧸ Ideal.span {p}) ≠ 2) : IsUnit (Ideal.Quotient.mk (Ideal.span {(4 : O)}) p) := by let : Field (O ⧸ Ideal.span {p}) := Ideal.Quotient.field _ let : Fintype (O ⧸ Ideal.span {p}) := Fintype.ofFinite _ have h2 : (2 : O) ∉ Ideal.span {p} := by intro hm have hz : (2 : O ⧸ Ideal.span {p}) = 0 := by simpa only [map_ofNat] using Ideal.Quotient.eq_zero_iff_mem.mpr hm apply hchar exact (Nat.prime_dvd_prime_iff_eq (CharP.char_is_prime (O ⧸ Ideal.span {p}) _) Nat.prime_two).mp ((ringChar.spec (O ⧸ Ideal.span {p}) 2).mp hz) let : (Ideal.span {(2 : O)}).IsMaximal := by simpa only [cubicTwoIdeal, Ideal.span_singleton_neg] using cubicTwoIdeal_isMaximal have hcop : IsCoprime (Ideal.span {p}) (Ideal.span {(2 : O)}) := by apply Ideal.isCoprime_of_isMaximal intro heq apply h2 rw [heq] exact Ideal.subset_span (by simp) obtain ⟨a, b, hab⟩ := IdealGaussCRT.bezout_of_principal_coprime hcop have hcp : IsCoprime p (2 : O) := ⟨a, b, hab⟩ have hcp4 : IsCoprime p (4 : O) := by simpa only [show (2 : O) ^ 2 = 4 by norm_num] using (hcp.pow_right : IsCoprime p ((2 : O) ^ 2)) obtain ⟨a, b, hab⟩ := hcp4 have hz : Ideal.Quotient.mk (Ideal.span {(4 : O)}) (4 : O) = 0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.subset_span (by simp)) have hm := congrArg (Ideal.Quotient.mk (Ideal.span {(4 : O)})) hab simp only [map_add, map_mul, map_one, hz, mul_zero, add_zero] at hm exact IsUnit.of_mul_eq_one_right _ hm theorem prime_product_unit_mod_four {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (S : Finset ι) : IsUnit (Ideal.Quotient.mk (Ideal.span {(4 : O)}) (∏ i ∈ S, p i)) := by rw [map_prod] exact IsUnit.prod_iff.mpr (fun i _ => prime_unit_mod_four (p i) (hchar i)) theorem rayMask_prime_product {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (S : Finset ι) : rayMask (∏ i ∈ S, p i) = 1 := by rw [rayMask, ite_eq_left (prime_product_unit_mod_four p hchar S)] theorem canonicalProductG_character_expansion {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hgood : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hprimary : ∀ i, lambda ^ 2 ∣ p i - 1) : letI : Fintype OAI.RayFourExpansion.RayCharacter := OAI.RayFourExpansion.rayCharacterFintype canonicalProductG p hp hcop hgood = ∑ χ : RayCharacter, gCoeff χ * rayCharacter χ (∏ i, p i) := by let : Fintype OAI.RayFourExpansion.RayCharacter := OAI.RayFourExpansion.rayCharacterFintype rw [canonicalProductG_eq_fixed_quotient p hp hcop hgood hchar hprimary] have h := fixedG_character_expansion (∏ i, p i) rw [rayMask_prime_product p hchar Finset.univ, one_mul] at h exact h theorem quadraticCrossPhase_character_expansion {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (A B : Finset ι) (hd : Disjoint A B) : letI : Fintype OAI.RayFourExpansion.RayCharacter := OAI.RayFourExpansion.rayCharacterFintype quadraticCrossPhase p hg A B = ∑ χ : RayCharacter, ∑ η : RayCharacter, crossCoeff χ η * rayCharacter χ (∏ i ∈ A, p i) * rayCharacter η (∏ i ∈ B, p i) := by let : Fintype OAI.RayFourExpansion.RayCharacter := OAI.RayFourExpansion.rayCharacterFintype rw [quadraticCrossPhase_eq_rayPair p hp hcop hg hchar A B hd] have h := quadraticRayPair_character_expansion (∏ i ∈ A, p i) (∏ i ∈ B, p i) rw [rayMask_prime_product p hchar A, rayMask_prime_product p hchar B, one_mul, one_mul] at h exact h end RayFourExpansion namespace MixedCrossSeparation open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase MixedGaussConversion open QuadraticGaussRay ActualEisensteinCoordinates GaussGeneratorTransport theorem convertedColumnBlock_image {ι κ : Type*} [DecidableEq ι] [DecidableEq κ] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (e : κ → ι) (he : Function.Injective e) (A : Finset κ) (inverse : Bool) : convertedColumnBlock (fun i => p (e i)) (fun i => hp (e i)) (fun i => hg (e i)) A inverse = convertedColumnBlock p hp hg (A.image e) inverse := by unfold convertedColumnBlock rw [Finset.prod_image (fun a ha b hb hab => he hab)] apply Finset.prod_congr rfl intro i hi rw [← Finset.image_erase he A i, Finset.prod_image (fun a ha b hb hab => he hab)] rfl theorem quadraticCrossPhase_image {ι κ : Type*} [DecidableEq ι] [DecidableEq κ] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (e : κ → ι) (he : Function.Injective e) (A B : Finset κ) : quadraticCrossPhase (fun i => p (e i)) (fun i => hg (e i)) A B = quadraticCrossPhase p hg (A.image e) (B.image e) := by unfold quadraticCrossPhase rw [Finset.prod_image (fun a ha b hb hab => he hab)] apply Finset.prod_congr rfl intro i hi rw [Finset.prod_image (fun a ha b hb hab => he hab)] rfl private theorem negative_active_image {ι : Type*} [DecidableEq ι] (S T : Finset ι) : (Finset.univ.filter (fun i : activeSupport S T => i.val ∈ S \ T)).image Subtype.val = S \ T := by ext i constructor · intro hi obtain ⟨a, ha, rfl⟩ := Finset.mem_image.mp hi exact (Finset.mem_filter.mp ha).2 · intro hi exact Finset.mem_image.mpr ⟨⟨i, Finset.mem_union_left _ hi⟩, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hi⟩, rfl⟩ private theorem positive_active_image {ι : Type*} [DecidableEq ι] (S T : Finset ι) : (Finset.univ.filter (fun i : activeSupport S T => i.val ∉ S \ T)).image Subtype.val = T \ S := by ext i constructor · intro hi obtain ⟨a, ha, rfl⟩ := Finset.mem_image.mp hi have hm := a.property rcases Finset.mem_union.mp hm with hleft | hright · exact ((Finset.mem_filter.mp ha).2 hleft).elim · exact hright · intro hi have hn : i ∉ S \ T := fun h => (Finset.mem_sdiff.mp hi).2 (Finset.mem_sdiff.mp h).1 exact Finset.mem_image.mpr ⟨⟨i, Finset.mem_union_right _ hi⟩, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hn⟩, rfl⟩ theorem activeConvertedGauss_eq_columnBlocks {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hprimary : ∀ i, lambda ^ 2 ∣ p i - 1) (S T : Finset ι) : activeConvertedGauss p hp hg S T = convertedColumnBlock p hp hg (S \ T) true * convertedColumnBlock p hp hg (T \ S) false * quadraticCrossPhase p hg (S \ T) (T \ S) := by rw [activeConvertedGauss_separated p hp hg hprimary S T] rw [convertedColumnBlock_image p hp hg Subtype.val Subtype.val_injective, convertedColumnBlock_image p hp hg Subtype.val Subtype.val_injective, quadraticCrossPhase_image p hg Subtype.val Subtype.val_injective, negative_active_image, positive_active_image] end MixedCrossSeparation namespace FirstCauchyArithmetic section abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic CoprimeMobiusExtension def supportMobius {ι : Type*} (P : ι → Ideal O) (S : Finset ι) : ℂ := (UniqueFactorizationMonoid.moebius (∏ i ∈ S, P i) : ℂ) def supportConjugateSum {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (B : Finset ι) (C : Finset ι → ℂ) (h : O) : ℂ := ∑ S ∈ B.powerset, supportMobius P S * C S * star (finiteSquarefreeRow P hg S h) private theorem supportMobius_union {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hprime : ∀ i, Prime (P i)) (hinj : Function.Injective P) (S T : Finset ι) (hd : Disjoint S T) : supportMobius P (S ∪ T) = supportMobius P S * supportMobius P T := by simp only [supportMobius, prime_product_moebius P hprime hinj, Finset.card_union_of_disjoint hd, pow_add] theorem supportMobius_sq {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hprime : ∀ i, Prime (P i)) (hinj : Function.Injective P) (S : Finset ι) : supportMobius P S * supportMobius P S = 1 := by rw [supportMobius, prime_product_moebius P hprime hinj, ← mul_pow] norm_num theorem star_supportMobius {ι : Type*} (P : ι → Ideal O) (S : Finset ι) : star (supportMobius P S) = supportMobius P S := by simp [supportMobius] private theorem finiteSquarefreeRow_union {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S T : Finset ι) (hd : Disjoint S T) (h : O) : finiteSquarefreeRow P hg (S ∪ T) h = finiteSquarefreeRow P hg S h * finiteSquarefreeRow P hg T h := by exact Finset.prod_union hd theorem coprime_pair_sum_reindexed {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hprime : ∀ i, Prime (P i)) (hinj : Function.Injective P) (hg : ∀ i, lambda ∉ P i) (B : Finset ι) (C₁ C₂ : Finset ι → ℂ) (h : O) : (∑ S ∈ B.powerset, ∑ T ∈ B.powerset, if Disjoint S T then star (supportMobius P S * C₁ S * star (finiteSquarefreeRow P hg S h)) * (supportMobius P T * C₂ T * star (finiteSquarefreeRow P hg T h)) else 0) = ∑ D ∈ B.powerset, supportMobius P D * rowCoprimeMask P D h * star (supportConjugateSum P hg (B \ D) (fun U => C₁ (D ∪ U)) h) * supportConjugateSum P hg (B \ D) (fun V => C₂ (D ∪ V)) h := by rw [double_sum_disjoint_reindexed] apply Finset.sum_congr rfl intro D hD rw [← prime_product_moebius P hprime hinj D] change supportMobius P D * _ = _ have ht (U V : Finset ι) (hU : U ∈ (B \ D).powerset) (hV : V ∈ (B \ D).powerset) : star (supportMobius P (D ∪ U) * C₁ (D ∪ U) * star (finiteSquarefreeRow P hg (D ∪ U) h)) * (supportMobius P (D ∪ V) * C₂ (D ∪ V) * star (finiteSquarefreeRow P hg (D ∪ V) h)) = rowCoprimeMask P D h * star (supportMobius P U * C₁ (D ∪ U) * star (finiteSquarefreeRow P hg U h)) * (supportMobius P V * C₂ (D ∪ V) * star (finiteSquarefreeRow P hg V h)) := by have hdU : Disjoint D U := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hU) disjoint_sdiff_self_right have hdV : Disjoint D V := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hV) disjoint_sdiff_self_right rw [supportMobius_union P hprime hinj D U hdU, supportMobius_union P hprime hinj D V hdV, finiteSquarefreeRow_union P hg D U hdU, finiteSquarefreeRow_union P hg D V hdV] simp only [star_mul, star_star, star_supportMobius] have hmu := supportMobius_sq P hprime hinj D have hrow := finiteSquarefreeRow_self_pair P hg D h calc _ = (supportMobius P D * supportMobius P D) * (star (finiteSquarefreeRow P hg D h) * finiteSquarefreeRow P hg D h) * (finiteSquarefreeRow P hg U h * star (C₁ (D ∪ U)) * supportMobius P U) * (supportMobius P V * C₂ (D ∪ V) * star (finiteSquarefreeRow P hg V h)) := by ring _ = _ := by rw [hmu, hrow]; ring have heq : (∑ U ∈ (B \ D).powerset, ∑ V ∈ (B \ D).powerset, star (supportMobius P (D ∪ U) * C₁ (D ∪ U) * star (finiteSquarefreeRow P hg (D ∪ U) h)) * (supportMobius P (D ∪ V) * C₂ (D ∪ V) * star (finiteSquarefreeRow P hg (D ∪ V) h))) = rowCoprimeMask P D h * star (supportConjugateSum P hg (B \ D) (fun U => C₁ (D ∪ U)) h) * supportConjugateSum P hg (B \ D) (fun V => C₂ (D ∪ V)) h := by simp only [supportConjugateSum, star_sum] rw [mul_assoc, Finset.sum_mul_sum] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro U hU apply Finset.sum_congr rfl intro V hV simpa only [mul_assoc] using ht U V hU hV rw [heq] ring end section open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase MixedCrossSeparation RayFourExpansion def supportRay {ι : Type*} (p : ι → O) (χ : RayCharacter) (S : Finset ι) : ℂ := rayCharacter χ (∏ i ∈ S, p i) private theorem supportRay_union {ι : Type*} [DecidableEq ι] (p : ι → O) (χ : RayCharacter) (S T : Finset ι) (hd : Disjoint S T) : supportRay p χ (S ∪ T) = supportRay p χ S * supportRay p χ T := by rw [supportRay, Finset.prod_union hd, rayCharacter_mul] rfl theorem supportConjugateSum_ray_common {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B D : Finset ι) (C : Finset ι → ℂ) (χ : RayCharacter) (h : O) : supportConjugateSum (fun i => Ideal.span {p i}) hg (B \ D) (fun U => supportRay p χ (D ∪ U) * C (D ∪ U)) h = supportRay p χ D * supportConjugateSum (fun i => Ideal.span {p i}) hg (B \ D) (fun U => supportRay p χ U * C (D ∪ U)) h := by rw [supportConjugateSum, supportConjugateSum, Finset.mul_sum] apply Finset.sum_congr rfl intro U hU have hdU : Disjoint D U := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hU) disjoint_sdiff_self_right rw [supportRay_union p χ D U hdU] ring theorem supportConjugateSum_star_ray_common {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B D : Finset ι) (C : Finset ι → ℂ) (χ : RayCharacter) (h : O) : supportConjugateSum (fun i => Ideal.span {p i}) hg (B \ D) (fun U => star (supportRay p χ (D ∪ U)) * C (D ∪ U)) h = star (supportRay p χ D) * supportConjugateSum (fun i => Ideal.span {p i}) hg (B \ D) (fun U => star (supportRay p χ U) * C (D ∪ U)) h := by rw [supportConjugateSum, supportConjugateSum, Finset.mul_sum] apply Finset.sum_congr rfl intro U hU have hdU : Disjoint D U := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hU) disjoint_sdiff_self_right rw [supportRay_union p χ D U hdU, star_mul] ring theorem quadratic_phase_coprime_ray_reindex {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (B : Finset ι) (C₁ C₂ : Finset ι → ℂ) (h : O) : letI : Fintype OAI.RayFourExpansion.RayCharacter := OAI.RayFourExpansion.rayCharacterFintype let P : ι → Ideal O := fun i => Ideal.span {p i} (∑ S ∈ B.powerset, ∑ T ∈ B.powerset, if Disjoint S T then quadraticCrossPhase p hg S T * star (supportMobius P S * C₁ S * star (finiteSquarefreeRow P hg S h)) * (supportMobius P T * C₂ T * star (finiteSquarefreeRow P hg T h)) else 0) = ∑ r : RayCharacter × RayCharacter, crossCoeff r.1 r.2 * ∑ D ∈ B.powerset, (supportMobius P D * rowCoprimeMask P D h * supportRay p r.1 D * supportRay p r.2 D) * star (supportConjugateSum P hg (B \ D) (fun U => star (supportRay p r.1 U) * C₁ (D ∪ U)) h) * supportConjugateSum P hg (B \ D) (fun V => supportRay p r.2 V * C₂ (D ∪ V)) h := by let : Fintype OAI.RayFourExpansion.RayCharacter := OAI.RayFourExpansion.rayCharacterFintype dsimp only let P : ι → Ideal O := fun i => Ideal.span {p i} have hcop : Pairwise (Function.onFun IsCoprime P) := by intro i k hik exact Ideal.isCoprime_of_isMaximal (hinj.ne hik) have hprime (i : ι) : Prime (P i) := Ideal.prime_of_isPrime (NeZero.ne (P i)) inferInstance let Z (r : RayCharacter × RayCharacter) (S T : Finset ι) : ℂ := if Disjoint S T then star (supportMobius P S * (star (supportRay p r.1 S) * C₁ S) * star (finiteSquarefreeRow P hg S h)) * (supportMobius P T * (supportRay p r.2 T * C₂ T) * star (finiteSquarefreeRow P hg T h)) else 0 have ht (S T : Finset ι) : (if Disjoint S T then quadraticCrossPhase p hg S T * star (supportMobius P S * C₁ S * star (finiteSquarefreeRow P hg S h)) * (supportMobius P T * C₂ T * star (finiteSquarefreeRow P hg T h)) else 0) = ∑ r : RayCharacter × RayCharacter, crossCoeff r.1 r.2 * Z r S T := by by_cases hd : Disjoint S T · rw [ite_eq_left hd, quadraticCrossPhase_character_expansion p hp hcop hg hchar S T hd] simp only [Fintype.sum_prod_type, Z, ite_eq_left hd, Finset.sum_mul] apply Finset.sum_congr rfl intro χ hχ apply Finset.sum_congr rfl intro η hη simp only [supportRay, star_mul, star_star] ring · simp [Z, hd] calc _ = ∑ S ∈ B.powerset, ∑ T ∈ B.powerset, ∑ r : RayCharacter × RayCharacter, crossCoeff r.1 r.2 * Z r S T := by apply Finset.sum_congr rfl intro S hS exact Finset.sum_congr rfl (fun T hT => ht S T) _ = ∑ r : RayCharacter × RayCharacter, crossCoeff r.1 r.2 * ∑ S ∈ B.powerset, ∑ T ∈ B.powerset, Z r S T := by simp only [Finset.mul_sum] calc _ = ∑ S ∈ B.powerset, ∑ r : RayCharacter × RayCharacter, ∑ T ∈ B.powerset, crossCoeff r.1 r.2 * Z r S T := by apply Finset.sum_congr rfl intro S hS exact Finset.sum_comm _ = _ := Finset.sum_comm _ = _ := by apply Finset.sum_congr rfl intro r hr congr 1 change (∑ S ∈ B.powerset, ∑ T ∈ B.powerset, if Disjoint S T then star (supportMobius P S * (star (supportRay p r.1 S) * C₁ S) * star (finiteSquarefreeRow P hg S h)) * (supportMobius P T * (supportRay p r.2 T * C₂ T) * star (finiteSquarefreeRow P hg T h)) else 0) = _ rw [coprime_pair_sum_reindexed P hprime hinj hg B] apply Finset.sum_congr rfl intro D hD rw [supportConjugateSum_star_ray_common p hg B D C₁ r.1 h, supportConjugateSum_ray_common p hg B D C₂ r.2 h] simp only [star_mul, star_star] ring end open ActualEisensteinCubic ConcretePrimeRowBridge private theorem family_prime {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (i : ι) : Prime (P i) := Ideal.prime_of_isPrime (NeZero.ne (P i)) inferInstance private theorem family_prod_ne_zero {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (S : Finset ι) : (∏ i ∈ S, P i) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i _ => (family_prime P i).ne_zero) theorem family_prime_dvd_product_iff {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (i : ι) : P i ∣ ∏ j ∈ S, P j ↔ i ∈ S := by constructor · intro h obtain ⟨j, hj, hd⟩ := ((family_prime P i).dvd_finsetProd_iff P).mp h have he : P i = P j := associated_iff_eq.mp ((family_prime P i).associated_of_dvd (family_prime P j) hd) exact hinj he ▸ hj · exact fun hi => Finset.dvd_prod_of_mem P hi theorem family_product_injective {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) : Function.Injective (fun S : Finset ι => ∏ i ∈ S, P i) := by intro S T h change (∏ i ∈ S, P i) = (∏ i ∈ T, P i) at h ext i rw [← family_prime_dvd_product_iff P hinj S i, h, family_prime_dvd_product_iff P hinj T i] def supportIdealFamily {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) (B : Finset ι) : Finset (Ideal O) := B.powerset.image (fun S => ∏ i ∈ S, P i) theorem supportIdealFamily_pos {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (B : Finset ι) : ∀ I ∈ supportIdealFamily P B, I ≠ ⊥ := by intro I hI obtain ⟨S, hS, rfl⟩ := Finset.mem_image.mp hI exact family_prod_ne_zero P S private theorem factor_family_product_iff {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (S : Finset ι) (Q : Ideal O) : Q ∈ UniqueFactorizationMonoid.normalizedFactors (∏ i ∈ S, P i) ↔ ∃ i ∈ S, Q = P i := by rw [UniqueFactorizationMonoid.mem_normalizedFactors_iff (family_prod_ne_zero P S)] constructor · rintro ⟨hQ, hd⟩ obtain ⟨i, hi, hdiv⟩ := (hQ.dvd_finsetProd_iff P).mp hd exact ⟨i, hi, associated_iff_eq.mp (hQ.associated_of_dvd (family_prime P i) hdiv)⟩ · rintro ⟨i, hi, rfl⟩ exact ⟨family_prime P i, Finset.dvd_prod_of_mem P hi⟩ theorem supportIdealFamily_good {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (B : Finset ι) : ∀ I ∈ supportIdealFamily P B, ∀ Q ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ Q := by intro I hI Q hQ obtain ⟨S, hS, rfl⟩ := Finset.mem_image.mp hI obtain ⟨i, hi, rfl⟩ := (factor_family_product_iff P S Q).mp hQ exact hg i def recoveredSupport {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) (B : Finset ι) (I : Ideal O) : Finset ι := B.filter (fun i => P i ∣ I) theorem recoveredSupport_product {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (B S : Finset ι) (hS : S ⊆ B) : recoveredSupport P B (∏ i ∈ S, P i) = S := by ext i simp only [recoveredSupport, Finset.mem_filter, family_prime_dvd_product_iff P hinj S i] exact and_iff_right_of_imp (fun hi => hS hi) theorem idealSexticRow_support_product {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (hg : ∀ i, lambda ∉ P i) (B S : Finset ι) (hS : S ⊆ B) (h : O) : idealSexticRow (supportIdealFamily P B) (supportIdealFamily_pos P B) (supportIdealFamily_good P hg B) (∏ i ∈ S, P i) h = finiteSquarefreeRow P hg S h := by let F := supportIdealFamily P B have hIF : (∏ i ∈ S, P i) ∈ F := Finset.mem_image.mpr ⟨S, Finset.mem_powerset.mpr hS, rfl⟩ let idx (i : ι) (hi : i ∈ S) : primePool F := ⟨P i, mem_primePool_iff.mpr ⟨∏ j ∈ S, P j, hIF, (factor_family_product_iff P S (P i)).mpr ⟨i, hi, rfl⟩⟩⟩ symm unfold idealSexticRow finiteSquarefreeRow apply Finset.prod_bij idx · intro i hi exact (mem_idealSupport_iff F _ (idx i hi)).mpr ((factor_family_product_iff P S (P i)).mpr ⟨i, hi, rfl⟩) · intro i hi j hj hij exact hinj (congrArg Subtype.val hij) · intro Q hQ have hm := (mem_idealSupport_iff F _ Q).mp hQ obtain ⟨i, hi, he⟩ := (factor_family_product_iff P S Q.val).mp hm exact ⟨i, hi, Subtype.ext he.symm⟩ · intro i hi rfl theorem supportConjugateSum_eq_conjugateIdealRowSum {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (hg : ∀ i, lambda ∉ P i) (B : Finset ι) (C : Finset ι → ℂ) (h : O) : supportConjugateSum P hg B C h = conjugateIdealRowSum (supportIdealFamily P B) (supportIdealFamily_pos P B) (supportIdealFamily_good P hg B) (fun I => C (recoveredSupport P B I)) h := by let f : Ideal O → ℂ := fun I => mobiusIdealColumn (fun I => C (recoveredSupport P B I)) I * star (idealSexticRow (supportIdealFamily P B) (supportIdealFamily_pos P B) (supportIdealFamily_good P hg B) I h) change supportConjugateSum P hg B C h = ∑ I ∈ B.powerset.image (fun S => ∏ i ∈ S, P i), f I rw [Finset.sum_image (fun S hS T hT h => family_product_injective P hinj h)] unfold supportConjugateSum apply Finset.sum_congr rfl intro S hS have hSB := Finset.mem_powerset.mp hS dsimp only [f] rw [idealSexticRow_support_product P hinj hg B S hSB h] simp only [mobiusIdealColumn, supportMobius, recoveredSupport_product P hinj B S hSB] theorem quadratic_phase_reindex_to_ideal_rows {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (B : Finset ι) (C₁ C₂ : Finset ι → ℂ) (h : O) : letI : Fintype OAI.RayFourExpansion.RayCharacter := OAI.RayFourExpansion.rayCharacterFintype let P : ι → Ideal O := fun i => Ideal.span {p i} (∑ S ∈ B.powerset, ∑ T ∈ B.powerset, if Disjoint S T then MixedCrossSeparation.quadraticCrossPhase p hg S T * star (supportMobius P S * C₁ S * star (finiteSquarefreeRow P hg S h)) * (supportMobius P T * C₂ T * star (finiteSquarefreeRow P hg T h)) else 0) = ∑ r : RayFourExpansion.RayCharacter × RayFourExpansion.RayCharacter, RayFourExpansion.crossCoeff r.1 r.2 * ∑ D ∈ B.powerset, (supportMobius P D * rowCoprimeMask P D h * supportRay p r.1 D * supportRay p r.2 D) * star (conjugateIdealRowSum (supportIdealFamily P (B \ D)) (supportIdealFamily_pos P (B \ D)) (supportIdealFamily_good P hg (B \ D)) (fun I => star (supportRay p r.1 (recoveredSupport P (B \ D) I)) * C₁ (D ∪ recoveredSupport P (B \ D) I)) h) * conjugateIdealRowSum (supportIdealFamily P (B \ D)) (supportIdealFamily_pos P (B \ D)) (supportIdealFamily_good P hg (B \ D)) (fun I => supportRay p r.2 (recoveredSupport P (B \ D) I) * C₂ (D ∪ recoveredSupport P (B \ D) I)) h := by let : Fintype OAI.RayFourExpansion.RayCharacter := OAI.RayFourExpansion.rayCharacterFintype dsimp only rw [quadratic_phase_coprime_ray_reindex p hp hinj hg hchar B C₁ C₂ h] apply Finset.sum_congr rfl intro r hr congr 1 apply Finset.sum_congr rfl intro D hD rw [supportConjugateSum_eq_conjugateIdealRowSum (fun i => Ideal.span {p i}) hinj hg, supportConjugateSum_eq_conjugateIdealRowSum (fun i => Ideal.span {p i}) hinj hg] end FirstCauchyArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.CoefficientCancellation namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace MixedCrossSeparation open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase MixedGaussConversion theorem norm_localCoefficient (p : O) (hp : p ≠ 0) [(Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) (hc : ringChar (O ⧸ Ideal.span {p}) ≠ 2) : ‖localCoefficient p hp hg‖ = 1 := by rw [localCoefficient, norm_mul, norm_star, norm_angularFactor p hp, norm_localGauss p hp hg hc 2 (by decide) (by decide), one_mul] theorem local_coefficient_cancel (p : O) (hp : p ≠ 0) [(Ideal.span {p}).IsMaximal] (hg : lambda ∉ Ideal.span {p}) (hc : ringChar (O ⧸ Ideal.span {p}) ≠ 2) (hpr : lambda ^ 2 ∣ p - 1) : localCoefficient p hp hg * convertedLocal p hp hg false = localG p hp hg ∧ star (localCoefficient p hp hg) * convertedLocal p hp hg true = canonicalSextic (Ideal.span {p}) hg (Ideal.Quotient.mk (Ideal.span {p}) (-1 : O)) * star (localG p hp hg) := by have hA : localCoefficient p hp hg * star (localCoefficient p hp hg) = 1 := by rw [← starRingEnd_apply, Complex.mul_conj', norm_localCoefficient p hp hg hc] norm_num have hG : localG p hp hg * star (localG p hp hg) = 1 := by rw [← starRingEnd_apply, Complex.mul_conj', norm_localG p hp hg hc hpr] norm_num have hGn : localG p hp hg ≠ 0 := by intro h simp [h] at hG have hGsn := star_ne_zero.mpr hGn constructor · simp only [convertedLocal, Bool.false_eq_true, ↓reduceIte] rw [← mul_div_assoc] apply (div_eq_iff hGsn).mpr rw [hA, hG] · simp only [convertedLocal, ↓reduceIte] rw [← mul_div_assoc] apply (div_eq_iff hGn).mpr calc _ = canonicalSextic (Ideal.span {p}) hg (Ideal.Quotient.mk (Ideal.span {p}) (-1 : O)) * (localCoefficient p hp hg * star (localCoefficient p hp hg)) := by ring _ = _ := by rw [hA] calc _ = canonicalSextic (Ideal.span {p}) hg (Ideal.Quotient.mk (Ideal.span {p}) (-1 : O)) * (localG p hp hg * star (localG p hp hg)) := by rw [hG] _ = _ := by ring theorem canonicalProductG_crt {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) : canonicalProductG p hp hcop hg = canonicalCrossFactor p hg ^ 3 * ∏ i, localG (p i) (hp i) (hg i) := by rw [canonicalProductG, canonicalProductGauss_constant_power p hp hcop hg 3 (by decide)] change (∏ i, canonicalSextic (Ideal.span {p i}) (hg i) (Ideal.Quotient.mk (Ideal.span {p i}) (4 : O)))⁻¹ * (canonicalCrossFactor p hg ^ 3 * ∏ i, localGauss (p i) (hp i) (hg i) 3) = _ simp only [localG, breveLocalG, Finset.prod_mul_distrib, Finset.prod_inv_distrib] change (∏ i, canonicalSextic (Ideal.span {p i}) (hg i) (Ideal.Quotient.mk (Ideal.span {p i}) (4 : O)))⁻¹ * (canonicalCrossFactor p hg ^ 3 * ∏ i, localGauss (p i) (hp i) (hg i) 3) = canonicalCrossFactor p hg ^ 3 * ((∏ i, canonicalSextic (Ideal.span {p i}) (hg i) (Ideal.Quotient.mk (Ideal.span {p i}) (4 : O)))⁻¹ * ∏ i, localGauss (p i) (hp i) (hg i) 3) ring theorem convertedColumnBlock_univ {ι : Type*} [Fintype ι] [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (b : Bool) : convertedColumnBlock p hp hg Finset.univ b = canonicalCrossFactor p hg ^ (if b then 5 else 1) * ∏ i, convertedLocal (p i) (hp i) (hg i) b := by simp only [convertedColumnBlock, Finset.prod_mul_distrib, ← Finset.prod_pow, canonicalCrossFactor, crossSymbol] congr 2 funext i congr 1 ext k simp theorem coefficient_cancel_univ_false {ι : Type*} [Fintype ι] [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) : canonicalProductCoefficient p hp hcop hg * convertedColumnBlock p hp hg Finset.univ false = canonicalProductG p hp hcop hg := by rw [canonicalProductCoefficient_crt, convertedColumnBlock_univ, canonicalProductG_crt] change (canonicalCrossFactor p hg ^ 2 * ∏ i, localCoefficient (p i) (hp i) (hg i)) * (canonicalCrossFactor p hg ^ 1 * ∏ i, convertedLocal (p i) (hp i) (hg i) false) = _ calc _ = canonicalCrossFactor p hg ^ 3 * ∏ i, localCoefficient (p i) (hp i) (hg i) * convertedLocal (p i) (hp i) (hg i) false := by rw [Finset.prod_mul_distrib] ring _ = _ := by congr 1 exact Finset.prod_congr rfl (fun i _ => (local_coefficient_cancel (p i) (hp i) (hg i) (hc i) (hpr i)).1) theorem coefficient_cancel_univ_true {ι : Type*} [Fintype ι] [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) : star (canonicalProductCoefficient p hp hcop hg) * convertedColumnBlock p hp hg Finset.univ true = (∏ i, canonicalSextic (Ideal.span {p i}) (hg i) (Ideal.Quotient.mk (Ideal.span {p i}) (-1 : O))) * star (canonicalProductG p hp hcop hg) := by let C := canonicalCrossFactor p hg have hC6 : C ^ 6 = 1 := canonicalCrossFactor_pow_six p hcop hg have hCn : ‖C‖ = 1 := Complex.norm_eq_one_of_pow_eq_one hC6 (by decide) have hCC : C * star C = 1 := by rw [← starRingEnd_apply, Complex.mul_conj', hCn] norm_num have hC3 : star C ^ 3 = C ^ 3 := by have hh : (C ^ 3) ^ 2 = 1 := by simpa only [← pow_mul] using hC6 rw [← star_pow] rcases (sq_eq_one_iff).mp hh with h | h <;> simp [h] rw [canonicalProductCoefficient_crt, convertedColumnBlock_univ, canonicalProductG_crt] change star (C ^ 2 * ∏ i, localCoefficient (p i) (hp i) (hg i)) * (C ^ 5 * ∏ i, convertedLocal (p i) (hp i) (hg i) true) = _ * star (C ^ 3 * ∏ i, localG (p i) (hp i) (hg i)) simp only [star_mul, star_pow, star_prod, hC3] calc _ = (C * star C) ^ 2 * C ^ 3 * ∏ i, star (localCoefficient (p i) (hp i) (hg i)) * convertedLocal (p i) (hp i) (hg i) true := by rw [Finset.prod_mul_distrib] ring _ = C ^ 3 * ∏ i, canonicalSextic (Ideal.span {p i}) (hg i) (Ideal.Quotient.mk (Ideal.span {p i}) (-1 : O)) * star (localG (p i) (hp i) (hg i)) := by rw [hCC, one_pow, one_mul] congr 1 exact Finset.prod_congr rfl (fun i _ => (local_coefficient_cancel (p i) (hp i) (hg i) (hc i) (hpr i)).2) _ = _ := by rw [Finset.prod_mul_distrib]; ring theorem columnPrimeCoprime {ι : Type*} (p : ι → O) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (S : Finset ι) : Pairwise (Function.onFun IsCoprime (fun i : S => Ideal.span {p i.val})) := by intro i j hij exact hcop (fun h => hij (Subtype.ext h)) def columnCoefficient {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) : ℂ := canonicalProductCoefficient (fun i : S => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop S) (fun i => hg i.val) def columnG {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) : ℂ := canonicalProductG (fun i : S => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop S) (fun i => hg i.val) theorem convertedColumnBlock_subtype {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (b : Bool) : convertedColumnBlock (fun i : S => p i.val) (fun i => hp i.val) (fun i => hg i.val) Finset.univ b = convertedColumnBlock p hp hg S b := by have h := convertedColumnBlock_image p hp hg (Subtype.val : S → ι) Subtype.val_injective Finset.univ b have he : (Finset.univ : Finset S).image Subtype.val = S := by ext; simp simpa only [he] using h theorem columnCoefficient_cancel_false {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (S : Finset ι) : columnCoefficient p hp hcop hg S * convertedColumnBlock p hp hg S false = columnG p hp hcop hg S := by have h := coefficient_cancel_univ_false (fun i : S => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop S) (fun i => hg i.val) (fun i => hc i.val) (fun i => hpr i.val) rw [convertedColumnBlock_subtype] at h exact h theorem columnCoefficient_cancel_true {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (S : Finset ι) : star (columnCoefficient p hp hcop hg S) * convertedColumnBlock p hp hg S true = finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (-1) * star (columnG p hp hcop hg S) := by have h := coefficient_cancel_univ_true (fun i : S => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop S) (fun i => hg i.val) (fun i => hc i.val) (fun i => hpr i.val) have hprod : (∏ i : S, canonicalSextic (Ideal.span {p i.val}) (hg i.val) (Ideal.Quotient.mk (Ideal.span {p i.val}) (-1 : O))) = finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (-1) := by simpa only [finiteSquarefreeRow] using (Finset.prod_coe_sort S (fun i => canonicalSextic (Ideal.span {p i}) (hg i) (Ideal.Quotient.mk (Ideal.span {p i}) (-1 : O)))) rw [convertedColumnBlock_subtype, hprod] at h exact h end MixedCrossSeparation open scoped BigOperators Classical SchwartzMap ContDiff namespace FirstCauchyArithmetic open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase MixedGaussConversion open MixedCrossSeparation GaussGeneratorTransport ConcretePrimeRowBridge EisensteinSchwartzPoisson def firstPassColumnMinus {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (C : Finset ι → ℂ) (d : O) (S : Finset ι) : ℂ := star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (-1)) * columnG p hp hcop hg S * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S d * C S def firstPassColumnPlus {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (C : Finset ι → ℂ) (d : O) (S : Finset ι) : ℂ := columnG p hp hcop hg S * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S d * C S theorem active_productGauss_eq_mobius_converted {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (S T : Finset ι) : let q : activeSupport S T → O := fun i => p i.val canonicalProductGauss q (fun i => hp i.val) (activePrimes_pairwise_isCoprime (fun i => Ideal.span {p i}) hinj S T) (fun i => hg i.val) (activeExponent S T) = supportMobius (fun i => Ideal.span {p i}) S * supportMobius (fun i => Ideal.span {p i}) T * activeConvertedGauss p hp hg S T := by dsimp only let : DecidableEq (activeSupport S T) := fun a b => Classical.propDecidable (a = b) let q : activeSupport S T → O := fun i => p i.val let hq := activePrimes_pairwise_isCoprime (fun i => Ideal.span {p i}) hinj S T have he : activeExponent S T = (fun i : activeSupport S T => if decide (i.val ∈ S \ T) then 5 else 1) := by funext i simp only [activeExponent, decide_eq_true_eq] have h' : (supportMobius (fun i => Ideal.span {p i}) S * supportMobius (fun i => Ideal.span {p i}) T) * canonicalProductGauss q (fun i => hp i.val) hq (fun i => hg i.val) (activeExponent S T) = activeConvertedGauss p hp hg S T := by rw [supportMobius, supportMobius, pair_moebius_eq_active p hinj S T] unfold activeConvertedGauss rw [he] exact moebius_mixed_gauss_conversion q (fun i => hp i.val) hq (fun i => hg i.val) (fun i => hc i.val) (fun i => hpr i.val) (fun i => decide (i.val ∈ S \ T)) have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance have hs := supportMobius_sq (fun i => Ideal.span {p i}) hprime hinj S have ht := supportMobius_sq (fun i => Ideal.span {p i}) hprime hinj T calc _ = (supportMobius (fun i => Ideal.span {p i}) S * supportMobius (fun i => Ideal.span {p i}) S) * (supportMobius (fun i => Ideal.span {p i}) T * supportMobius (fun i => Ideal.span {p i}) T) * canonicalProductGauss q (fun i => hp i.val) hq (fun i => hg i.val) (activeExponent S T) := by rw [hs, ht]; ring _ = _ := by rw [← h']; ring def activeGaussRowFactor {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S T : Finset ι) (d h : O) : ℂ := let P : ι → Ideal O := fun i => Ideal.span {p i} let row := finiteSexticRow (activePrimes P S T) (fun i => hg i.val) (activeExponent S T) canonicalProductGauss (fun i : activeSupport S T => p i.val) (fun i => hp i.val) (activePrimes_pairwise_isCoprime P hinj S T) (fun i => hg i.val) (activeExponent S T) * (row d * star (row h)) end FirstCauchyArithmetic open scoped BigOperators Classical SchwartzMap namespace QuadraticInitialBound abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson def pvSeminorms : Finset (ℕ × ℕ) := Classical.choose paperRadialFourier_nonzero_lattice_uniform def pvConstant : ℝ := Classical.choose (Classical.choose_spec paperRadialFourier_nonzero_lattice_uniform) theorem pvConstant_pos : 0 < pvConstant := (Classical.choose_spec (Classical.choose_spec paperRadialFourier_nonzero_lattice_uniform)).1 def pvControl (W : 𝓢(ℝ, ℂ)) : ℝ := pvConstant * pvSeminorms.sup (schwartzSeminormFamily ℝ ℝ ℂ) W theorem pvControl_nonneg (W : 𝓢(ℝ, ℂ)) : 0 ≤ pvControl W := mul_nonneg pvConstant_pos.le (apply_nonneg _ _) theorem pv_lattice_bound (W : 𝓢(ℝ, ℂ)) (t : ℝ) (ht : 0 < t) : t * (∑' h : {h : O // h ≠ 0}, ‖paperRadialFourier W (t * ‖eisEmbedding h.val‖ ^ 2)‖) ≤ pvControl W := (Classical.choose_spec (Classical.choose_spec paperRadialFourier_nonzero_lattice_uniform)).2 W t ht theorem norm_finite_character_le_one {R : Type*} [CommRing R] [Fintype R] (χ : MulChar R ℂ) (r : R) : ‖χ r‖ ≤ 1 := by by_cases hr : IsUnit r · obtain ⟨u, rfl⟩ := hr simpa only [MulChar.coe_equivToUnitHom] using (Complex.norm_eq_one_of_mem_rootsOfUnity (χ.apply_mem_rootsOfUnity u)).le · rw [MulChar.map_nonunit χ hr, norm_zero] exact zero_le_one theorem finiteSexticRow_norm_le_one {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (j : ι → ℕ) (a : O) : ‖finiteSexticRow P hg j a‖ ≤ 1 := by let (i : ι) : Fintype (O ⧸ P i) := Fintype.ofFinite _ let (i : ι) : Field (O ⧸ P i) := Ideal.Quotient.field _ rw [finiteSexticRow, norm_prod] calc _ ≤ ∏ i : ι, (1 : ℝ) := Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun i _ => norm_finite_character_le_one (canonicalSextic (P i) (hg i) ^ j i) _) _ = 1 := by simp theorem canonical_polya_vinogradov {ι : Type*} [Fintype ι] [Nonempty ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hg : ∀ i, lambda ∉ P i) (hc : ∀ i, ringChar (O ⧸ P i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : ‖∑' z : O, finiteSexticRow P hg j z * W (‖eisEmbedding z‖ ^ 2 / M)‖ ≤ pvControl W * ‖eisEmbedding (finitePrimeModulus P)‖ := by let c := finitePrimeModulus P let q := ‖eisEmbedding c‖ have hq : 0 < q := norm_pos_iff.mpr (eisEmbedding_ne_zero (finitePrimeModulus_ne_zero P)) let t := M / q ^ 2 have ht : 0 < t := div_pos hM (sq_pos_of_pos hq) let F : O → ℂ := fun h => star (finiteSexticRow P hg j h) * paperRadialFourier W (t * ‖eisEmbedding h‖ ^ 2) have hF (h : O) : ‖F h‖ ≤ ‖paperRadialFourier W (t * ‖eisEmbedding h‖ ^ 2)‖ := by dsimp only [F] rw [norm_mul, norm_star] exact mul_le_of_le_one_left (norm_nonneg _) (finiteSexticRow_norm_le_one P hg j h) have hs := paperRadialFourier_lattice_summable_norm W t ht have hFs : Summable (fun h : O => ‖F h‖) := Summable.of_nonneg_of_le (fun _ => norm_nonneg _) hF hs have hzero : F 0 = 0 := by simp only [F, finiteSexticRow_zero, star_zero, zero_mul] have heq : (∑' h : O, F h) = ∑' h : {h : O // h ≠ 0}, F h := by symm apply tsum_subtype_eq_of_support_subset intro h hh hz subst h exact hh hzero have hn : ‖∑' h : O, F h‖ ≤ ∑' h : {h : O // h ≠ 0}, ‖paperRadialFourier W (t * ‖eisEmbedding h.val‖ ^ 2)‖ := by rw [heq] exact (norm_tsum_le_tsum_norm (hFs.subtype _)).trans ((hFs.subtype _).tsum_le_tsum (fun h => hF h) (hs.subtype _)) have hbound : t * ‖∑' h : O, F h‖ ≤ pvControl W := (mul_le_mul_of_nonneg_left hn ht.le).trans (pv_lattice_bound W t ht) rw [canonical_radial_poisson_normalized P hcop hg hc j hj0 hj6 W M hM] have hargs (h : O) : M * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2 = t * ‖eisEmbedding h‖ ^ 2 := by dsimp [t, q]; ring change ‖((M : ℂ) * canonicalNormalizedGauss P hcop hg j / (q : ℂ)) * ∑' h : O, star (finiteSexticRow P hg j h) * paperRadialFourier W (M * ‖eisEmbedding h‖ ^ 2 / ‖eisEmbedding c‖ ^ 2)‖ ≤ _ simp_rw [hargs] change ‖((M : ℂ) * canonicalNormalizedGauss P hcop hg j / (q : ℂ)) * ∑' h : O, F h‖ ≤ _ rw [norm_mul, norm_div, norm_mul, norm_canonicalNormalizedGauss P hcop hg hc j hj0 hj6, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hM, mul_one, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hq] change M / q * ‖∑' h : O, F h‖ ≤ pvControl W * q calc _ = q * (t * ‖∑' h : O, F h‖) := by dsimp [t]; field_simp _ ≤ q * pvControl W := mul_le_mul_of_nonneg_left hbound hq.le _ = _ := mul_comm _ _ theorem norm_ideal_moebius_le_one (I : Ideal O) : ‖(UniqueFactorizationMonoid.moebius I : ℂ)‖ ≤ 1 := by unfold UniqueFactorizationMonoid.moebius split_ifs <;> simp theorem canonical_masked_polya_vinogradov {α ι : Type*} [DecidableEq α] [Fintype ι] [Nonempty ι] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset α) (Q : ι → Ideal O) [∀ i, (Q i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime Q)) (hg : ∀ i, lambda ∉ Q i) (hc : ∀ i, ringChar (O ⧸ Q i) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : ‖∑' z : O, rowCoprimeMask P S z * finiteSexticRow Q hg j z * W (‖eisEmbedding z‖ ^ 2 / M)‖ ≤ (2 : ℝ) ^ S.card * (pvControl W * ‖eisEmbedding (finitePrimeModulus Q)‖) := by rw [canonical_masked_radial_dilations P hinj S Q hcop hg j W M hM] calc _ ≤ ∑ E ∈ S.powerset, ‖(UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) * finiteSexticRow Q hg j (primeSubsetGenerator P E) * ∑' z : O, finiteSexticRow Q hg j z * W (‖eisEmbedding z‖ ^ 2 / (M / ‖eisEmbedding (primeSubsetGenerator P E)‖ ^ 2))‖ := norm_sum_le _ _ _ ≤ ∑ _E ∈ S.powerset, pvControl W * ‖eisEmbedding (finitePrimeModulus Q)‖ := by apply Finset.sum_le_sum intro E hE rw [norm_mul, norm_mul] have hp := canonical_polya_vinogradov Q hcop hg hc j hj0 hj6 W _ (primeSubset_reducedScale_pos P E hM) have hmul : ‖(UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ)‖ * ‖finiteSexticRow Q hg j (primeSubsetGenerator P E)‖ ≤ 1 := by calc _ ≤ 1 * 1 := mul_le_mul (norm_ideal_moebius_le_one _) (finiteSexticRow_norm_le_one Q hg j _) (norm_nonneg _) zero_le_one _ = 1 := one_mul _ exact (mul_le_of_le_one_left (norm_nonneg _) hmul).trans hp _ = _ := by simp only [Finset.sum_const, Finset.card_powerset, nsmul_eq_mul, Nat.cast_pow, Nat.cast_ofNat] end QuadraticInitialBound end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.InitialBound namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical SchwartzMap namespace QuadraticInitialBound open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson def quadraticRow {α : Type*} (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S : Finset α) (z : O) : ℂ := (finiteSquarefreeRow P hg S z) ^ 3 theorem quadraticRow_eq_canonical {α : Type*} (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S : Finset α) (z : O) : quadraticRow P hg S z = finiteSexticRow (fun i : S => P i.val) (fun i => hg i.val) (fun _ => 3) z := by simp only [quadraticRow, finiteSexticRow, finiteSquarefreeRow, MulChar.pow_apply' _ (by decide : (3 : ℕ) ≠ 0), Finset.prod_pow] rw [Finset.prod_coe_sort (s := S) (f := fun i => canonicalSextic (P i) (hg i) (Ideal.Quotient.mk (P i) z))] theorem quadraticRow_star {α : Type*} (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S : Finset α) (z : O) : star (quadraticRow P hg S z) = quadraticRow P hg S z := by rw [quadraticRow_eq_canonical] simp only [finiteSexticRow, star_prod] apply Finset.prod_congr rfl intro i _ rw [canonicalSextic_pow_three_quadratic] simp only [MulChar.ringHomComp_apply, Int.coe_castRingHom, star_intCast] theorem quadraticRow_disjoint_union {α : Type*} [DecidableEq α] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S T : Finset α) (hd : Disjoint S T) (z : O) : quadraticRow P hg (S ∪ T) z = quadraticRow P hg S z * quadraticRow P hg T z := by simp only [quadraticRow, finiteSquarefreeRow, Finset.prod_union hd, mul_pow] theorem quadraticRow_pair_kernel {α : Type*} [DecidableEq α] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S T : Finset α) (z : O) : star (quadraticRow P hg S z) * quadraticRow P hg T z = rowCoprimeMask P (S ∩ T) z * finiteSexticRow (activePrimes P S T) (fun i => hg i.val) (fun _ => 3) z := by have h := congrArg (fun v : ℂ => v ^ 3) (finiteSquarefreeRow_pair_kernel P hg S T z) have hm : rowCoprimeMask P (S ∩ T) z ^ 3 = rowCoprimeMask P (S ∩ T) z := by unfold rowCoprimeMask split_ifs <;> simp have hd : Disjoint (S \ T) (T \ S) := by apply Finset.disjoint_left.mpr intro i hi hj exact (Finset.mem_sdiff.mp hi).2 (Finset.mem_sdiff.mp hj).1 simp only [mul_pow, ← star_pow, hm] at h change star (quadraticRow P hg S z) * quadraticRow P hg T z = rowCoprimeMask P (S ∩ T) z * star (quadraticRow P hg (S \ T) z) * quadraticRow P hg (T \ S) z at h simp only [quadraticRow_star] at h ⊢ rw [← quadraticRow_eq_canonical] change _ = rowCoprimeMask P (S ∩ T) z * quadraticRow P hg ((S \ T) ∪ (T \ S)) z rw [quadraticRow_disjoint_union P hg _ _ hd] simpa only [mul_assoc] using h theorem quadratic_gram_offdiagonal {α : Type*} [DecidableEq α] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (hg : ∀ i, lambda ∉ P i) (hc : ∀ i, ringChar (O ⧸ P i) ≠ 2) (S T : Finset α) (hne : S ≠ T) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : ‖∑' z : O, (star (quadraticRow P hg S z) * quadraticRow P hg T z) * W (‖eisEmbedding z‖ ^ 2 / M)‖ ≤ (2 : ℝ) ^ (S ∩ T).card * (pvControl W * ‖eisEmbedding (finitePrimeModulus (activePrimes P S T))‖) := by let : Nonempty (activeSupport S T) := (activeSupport_nonempty_of_ne hne).to_subtype simp_rw [quadraticRow_pair_kernel P hg S T] exact canonical_masked_polya_vinogradov P hinj (S ∩ T) (activePrimes P S T) (activePrimes_pairwise_isCoprime P hinj S T) (fun i => hg i.val) (fun i => hc i.val) (fun _ => 3) (fun _ => by decide) (fun _ => by decide) W M hM def supportNorm {α : Type*} (P : α → Ideal O) (S : Finset α) : ℝ := Ideal.absNorm (∏ i ∈ S, P i) theorem supportNorm_nonneg {α : Type*} (P : α → Ideal O) (S : Finset α) : 0 ≤ supportNorm P S := Nat.cast_nonneg _ theorem two_pow_card_le_supportNorm {α : Type*} (P : α → Ideal O) [∀ i, (P i).IsMaximal] (S : Finset α) : (2 : ℝ) ^ S.card ≤ supportNorm P S := by have hnorm (i : α) : (2 : ℝ) ≤ Ideal.absNorm (P i) := by have h0 : Ideal.absNorm (P i) ≠ 0 := by rw [ne_eq, Ideal.absNorm_eq_zero_iff] exact NeZero.ne (P i) have h1 : Ideal.absNorm (P i) ≠ 1 := by rw [ne_eq, Ideal.absNorm_eq_one_iff] exact (inferInstance : (P i).IsMaximal).ne_top exact_mod_cast (show 2 ≤ Ideal.absNorm (P i) by omega) change (2 : ℝ) ^ S.card ≤ (Ideal.absNorm (∏ i ∈ S, P i) : ℝ) rw [map_prod, Nat.cast_prod] calc _ = ∏ _i ∈ S, (2 : ℝ) := by simp _ ≤ _ := Finset.prod_le_prod₀ (fun _ _ => by norm_num) (fun i _ => hnorm i) theorem divisor_conductor_bound {α : Type*} [DecidableEq α] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (S T : Finset α) (N : ℝ) (hN : 0 ≤ N) (hS : supportNorm P S ≤ N) (hT : supportNorm P T ≤ N) : (2 : ℝ) ^ (S ∩ T).card * ‖eisEmbedding (finitePrimeModulus (activePrimes P S T))‖ ≤ N := by have hid := congrArg (fun I : Ideal O => (Ideal.absNorm I : ℝ)) (activeSupport_product_mul_common_sq P S T) simp only [map_mul, map_pow, Nat.cast_mul, Nat.cast_pow] at hid rw [← activePrimeModulus_norm_sq] at hid change ‖eisEmbedding (finitePrimeModulus (activePrimes P S T))‖ ^ 2 * (supportNorm P (S ∩ T)) ^ 2 = supportNorm P S * supportNorm P T at hid have hpow := two_pow_card_le_supportNorm P (S ∩ T) have hmul := mul_le_mul_of_nonneg_right hpow (norm_nonneg (eisEmbedding (finitePrimeModulus (activePrimes P S T)))) have hsq := pow_le_pow_left₀ (by positivity : 0 ≤ (2 : ℝ) ^ (S ∩ T).card * ‖eisEmbedding (finitePrimeModulus (activePrimes P S T))‖) hmul 2 have hprod := mul_le_mul hS hT (supportNorm_nonneg P T) hN nlinarith theorem quadratic_gram_offdiagonal_of_norm_le {α : Type*} [DecidableEq α] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (hg : ∀ i, lambda ∉ P i) (hc : ∀ i, ringChar (O ⧸ P i) ≠ 2) (S T : Finset α) (hne : S ≠ T) (N : ℝ) (hN : 0 ≤ N) (hS : supportNorm P S ≤ N) (hT : supportNorm P T ≤ N) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : ‖∑' z : O, (star (quadraticRow P hg S z) * quadraticRow P hg T z) * W (‖eisEmbedding z‖ ^ 2 / M)‖ ≤ pvControl W * N := by apply (quadratic_gram_offdiagonal P hinj hg hc S T hne W M hM).trans rw [mul_left_comm] exact mul_le_mul_of_nonneg_left (divisor_conductor_bound P S T N hN hS hT) (pvControl_nonneg W) def diagonalControl (W : 𝓢(ℝ, ℂ)) : ℝ := 16 * (1 + Real.pi) ^ 2 * (Finset.Iic (2, 0)).sup (schwartzSeminormFamily ℝ ℝ ℂ) W theorem diagonalControl_nonneg (W : 𝓢(ℝ, ℂ)) : 0 ≤ diagonalControl W := by unfold diagonalControl positivity theorem radial_weight_lattice_bound (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 1 ≤ M) : (∑' z : O, ‖W (‖eisEmbedding z‖ ^ 2 / M)‖) ≤ diagonalControl W * M := by have hMp : 0 < M := by linarith let t := M⁻¹ have ht : 0 < t := inv_pos.mpr hMp have ht1 : t ≤ 1 := (inv_le_one₀ hMp).mpr hM let B := 4 * (Finset.Iic (2, 0)).sup (schwartzSeminormFamily ℝ ℝ ℂ) W have hB : 0 ≤ B := by dsimp [B]; positivity have hp (z : O) : ‖W (‖eisEmbedding z‖ ^ 2 / M)‖ ≤ B * ((1 + t * ‖eisEmbedding z‖ ^ 2) ^ 2)⁻¹ := by have hq : 0 ≤ ‖eisEmbedding z‖ ^ 2 / M := div_nonneg (sq_nonneg _) hMp.le have hh := SchwartzMap.one_add_le_sup_seminorm_apply (𝕜 := ℝ) (m := (2, 0)) (k := 2) (n := 0) le_rfl le_rfl W (‖eisEmbedding z‖ ^ 2 / M) simp only [norm_iteratedFDeriv_zero, Real.norm_of_nonneg hq] at hh norm_num only [show (2 : ℝ) ^ 2 = 4 by norm_num] at hh change (1 + ‖eisEmbedding z‖ ^ 2 / M) ^ 2 * ‖W (‖eisEmbedding z‖ ^ 2 / M)‖ ≤ B at hh rw [← div_eq_mul_inv] apply (le_div_iff₀ (by positivity)).mpr simpa only [t, div_eq_mul_inv, mul_comm, mul_left_comm, mul_assoc] using hh have hs : Summable (fun z : O => ‖W (‖eisEmbedding z‖ ^ 2 / M)‖) := by simpa only [scaledRadialTest_apply] using actual_eisenstein_summable_norm (scaledRadialTest W M hMp) have hb := hs.tsum_le_tsum hp ((scaled_eisenstein_cauchy_summable t ht).mul_left B) rw [tsum_mul_left] at hb have hsmall := scaled_eisenstein_cauchy_small t ht ht1 have hmul := mul_le_mul_of_nonneg_left hb ht.le have hcontrol := mul_le_mul_of_nonneg_left hsmall hB have hfinal : t * (∑' z : O, ‖W (‖eisEmbedding z‖ ^ 2 / M)‖) ≤ diagonalControl W := by unfold diagonalControl dsimp [B] at hcontrol hmul nlinarith have hh := mul_le_mul_of_nonneg_left hfinal hMp.le simpa only [t, ← mul_assoc, mul_inv_cancel₀ hMp.ne', one_mul, mul_comm] using hh theorem quadraticRow_norm_le_one {α : Type*} (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S : Finset α) (z : O) : ‖quadraticRow P hg S z‖ ≤ 1 := by rw [quadraticRow_eq_canonical] exact finiteSexticRow_norm_le_one _ _ _ _ theorem quadratic_pair_summable {α : Type*} (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S T : Finset α) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : Summable (fun z : O => (star (quadraticRow P hg S z) * quadraticRow P hg T z) * W (‖eisEmbedding z‖ ^ 2 / M)) := by have hW : Summable (fun z : O => ‖W (‖eisEmbedding z‖ ^ 2 / M)‖) := by simpa only [scaledRadialTest_apply] using actual_eisenstein_summable_norm (scaledRadialTest W M hM) apply Summable.of_norm apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ hW intro z rw [norm_mul, norm_mul, norm_star] exact mul_le_of_le_one_left (norm_nonneg _) ((mul_le_mul (quadraticRow_norm_le_one P hg S z) (quadraticRow_norm_le_one P hg T z) (norm_nonneg _) zero_le_one).trans_eq (one_mul 1)) theorem quadratic_gram_diagonal {α : Type*} (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S : Finset α) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 1 ≤ M) : ‖∑' z : O, (star (quadraticRow P hg S z) * quadraticRow P hg S z) * W (‖eisEmbedding z‖ ^ 2 / M)‖ ≤ diagonalControl W * M := by have hMp : 0 < M := by linarith have hs := (quadratic_pair_summable P hg S S W M hMp).norm have hW : Summable (fun z : O => ‖W (‖eisEmbedding z‖ ^ 2 / M)‖) := by simpa only [scaledRadialTest_apply] using actual_eisenstein_summable_norm (scaledRadialTest W M hMp) refine (norm_tsum_le_tsum_norm hs).trans ((hs.tsum_le_tsum ?_ hW).trans (radial_weight_lattice_bound W M hM)) intro z rw [norm_mul, norm_mul, norm_star] exact mul_le_of_le_one_left (norm_nonneg _) ((mul_le_mul (quadraticRow_norm_le_one P hg S z) (quadraticRow_norm_le_one P hg S z) (norm_nonneg _) zero_le_one).trans_eq (one_mul 1)) private theorem norm_sq_finite_sum {β : Type*} (C : Finset β) (a r : β → ℂ) : (↑(‖∑ n ∈ C, a n * r n‖ ^ 2) : ℂ) = ∑ n ∈ C, ∑ m ∈ C, (star (a n) * a m) * (star (r n) * r m) := by rw [Complex.sq_norm, Complex.normSq_eq_conj_mul_self] simp only [map_sum, map_mul, starRingEnd_apply] rw [Finset.sum_mul_sum] apply Finset.sum_congr rfl intro n hn apply Finset.sum_congr rfl intro m hm ring theorem quadratic_mean_summable {α β : Type*} (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (C : Finset β) (support : β → Finset α) (a : β → ℂ) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : Summable (fun z : O => W (‖eisEmbedding z‖ ^ 2 / M) * (↑(‖∑ n ∈ C, a n * quadraticRow P hg (support n) z‖ ^ 2) : ℂ)) := by have hs := summable_sum (s := C) (fun n hn => summable_sum (s := C) (fun m hm => (quadratic_pair_summable P hg (support n) (support m) W M hM).mul_left (star (a n) * a m))) apply hs.congr intro z rw [norm_sq_finite_sum] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro n hn apply Finset.sum_congr rfl intro m hm ring theorem quadratic_mean_expand {α β : Type*} (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (C : Finset β) (support : β → Finset α) (a : β → ℂ) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : (∑' z : O, W (‖eisEmbedding z‖ ^ 2 / M) * (↑(‖∑ n ∈ C, a n * quadraticRow P hg (support n) z‖ ^ 2) : ℂ)) = ∑ n ∈ C, ∑ m ∈ C, (star (a n) * a m) * ∑' z : O, (star (quadraticRow P hg (support n) z) * quadraticRow P hg (support m) z) * W (‖eisEmbedding z‖ ^ 2 / M) := by let f : β → β → O → ℂ := fun n m z => (star (a n) * a m) * ((star (quadraticRow P hg (support n) z) * quadraticRow P hg (support m) z) * W (‖eisEmbedding z‖ ^ 2 / M)) have hf (n m : β) : Summable (f n m) := (quadratic_pair_summable P hg (support n) (support m) W M hM).mul_left _ have heq (z : O) : W (‖eisEmbedding z‖ ^ 2 / M) * (↑(‖∑ n ∈ C, a n * quadraticRow P hg (support n) z‖ ^ 2) : ℂ) = ∑ n ∈ C, ∑ m ∈ C, f n m z := by rw [norm_sq_finite_sum] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro n hn apply Finset.sum_congr rfl intro m hm dsimp [f] ring rw [tsum_congr heq, Summable.tsum_finsetSum (fun n hn => summable_sum (fun m hm => hf n m))] apply Finset.sum_congr rfl intro n hn rw [Summable.tsum_finsetSum (fun m hm => hf n m)] apply Finset.sum_congr rfl intro m hm exact tsum_mul_left theorem quadratic_initial_mean_bound {α β : Type*} [DecidableEq α] [DecidableEq β] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (hg : ∀ i, lambda ∉ P i) (hc : ∀ i, ringChar (O ⧸ P i) ≠ 2) (C : Finset β) (support : β → Finset α) (hsupp : Set.InjOn support (↑C : Set β)) (N : ℝ) (hN : 0 ≤ N) (hNorm : ∀ n ∈ C, supportNorm P (support n) ≤ N) (a : β → ℂ) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 1 ≤ M) : ‖∑' z : O, W (‖eisEmbedding z‖ ^ 2 / M) * (↑(‖∑ n ∈ C, a n * quadraticRow P hg (support n) z‖ ^ 2) : ℂ)‖ ≤ (diagonalControl W * M + pvControl W * N * C.card) * ∑ n ∈ C, ‖a n‖ ^ 2 := by have hMp : 0 < M := by linarith let D := diagonalControl W * M let B := pvControl W * N have hB : 0 ≤ B := mul_nonneg (pvControl_nonneg W) hN let K : β → β → ℂ := fun n m => ∑' z : O, (star (quadraticRow P hg (support n) z) * quadraticRow P hg (support m) z) * W (‖eisEmbedding z‖ ^ 2 / M) have hK (n : β) (hn : n ∈ C) (m : β) (hm : m ∈ C) : ‖K n m‖ ≤ (if n = m then D else 0) + B := by by_cases hnm : n = m · subst m simp only [ite_true] exact (quadratic_gram_diagonal P hg (support n) W M hM).trans (le_add_of_nonneg_right hB) · simp only [hnm, ite_false, zero_add] exact quadratic_gram_offdiagonal_of_norm_le P hinj hg hc _ _ (fun h => hnm (hsupp hn hm h)) N hN (hNorm n hn) (hNorm m hm) W M hMp have heq (n : β) (hn : n ∈ C) : (∑ m ∈ C, ‖a n‖ * ‖a m‖ * ((if n = m then D else 0) + B)) = D * ‖a n‖ ^ 2 + B * ‖a n‖ * ∑ m ∈ C, ‖a m‖ := by simp only [mul_add, Finset.sum_add_distrib, mul_ite, mul_zero] simp only [Finset.sum_ite_eq, hn, ite_true] rw [← Finset.sum_mul, ← Finset.mul_sum] ring have hcalc : (∑ n ∈ C, ∑ m ∈ C, ‖a n‖ * ‖a m‖ * ((if n = m then D else 0) + B)) = D * (∑ n ∈ C, ‖a n‖ ^ 2) + B * (∑ n ∈ C, ‖a n‖) ^ 2 := by rw [Finset.sum_congr rfl heq] simp only [Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.sum_mul] ring rw [quadratic_mean_expand P hg C support a W M hMp] calc _ ≤ ∑ n ∈ C, ∑ m ∈ C, ‖(star (a n) * a m) * K n m‖ := by exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun _ _ => norm_sum_le _ _)) _ ≤ ∑ n ∈ C, ∑ m ∈ C, ‖a n‖ * ‖a m‖ * ((if n = m then D else 0) + B) := by apply Finset.sum_le_sum intro n hn apply Finset.sum_le_sum intro m hm simp only [norm_mul, norm_star] exact mul_le_mul_of_nonneg_left (hK n hn m hm) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) _ = D * (∑ n ∈ C, ‖a n‖ ^ 2) + B * (∑ n ∈ C, ‖a n‖) ^ 2 := hcalc _ ≤ D * (∑ n ∈ C, ‖a n‖ ^ 2) + B * ((C.card : ℝ) * ∑ n ∈ C, ‖a n‖ ^ 2) := by apply add_le_add le_rfl apply mul_le_mul_of_nonneg_left _ hB simpa only [mul_one, one_pow, Finset.sum_const, nsmul_eq_mul, mul_one, mul_comm] using Finset.sum_mul_sq_le_sq_mul_sq C (fun n => ‖a n‖) (fun _ => (1 : ℝ)) _ = _ := by dsimp [D, B]; ring def sieveBump : ContDiffBump (0 : ℝ) where rIn := 1 rOut := 2 rIn_pos := by norm_num rIn_lt_rOut := by norm_num def sieveCutoff : 𝓢(ℝ, ℂ) := by have hc : HasCompactSupport (fun t : ℝ => (sieveBump t : ℂ)) := sieveBump.hasCompactSupport.comp_left Complex.ofReal_zero have hs : ContDiff ℝ ∞ (fun t : ℝ => (sieveBump t : ℂ)) := Complex.ofRealCLM.contDiff.comp sieveBump.contDiff exact hc.toSchwartzMap hs theorem sieveCutoff_apply (t : ℝ) : sieveCutoff t = (sieveBump t : ℂ) := rfl theorem sieveBump_eq_one {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t ≤ 1) : sieveBump t = 1 := by apply sieveBump.one_of_mem_closedBall change dist t 0 ≤ 1 simpa only [dist_zero_right, Real.norm_eq_abs, abs_of_nonneg ht0] using ht1 theorem quadratic_initial_finite_bound {α β : Type*} [DecidableEq α] [DecidableEq β] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (hg : ∀ i, lambda ∉ P i) (hc : ∀ i, ringChar (O ⧸ P i) ≠ 2) (C : Finset β) (support : β → Finset α) (hsupp : Set.InjOn support (↑C : Set β)) (N : ℝ) (hN : 0 ≤ N) (hNorm : ∀ n ∈ C, supportNorm P (support n) ≤ N) (a : β → ℂ) (M : ℝ) (hM : 1 ≤ M) (R : Finset O) (hR : ∀ z ∈ R, ‖eisEmbedding z‖ ^ 2 ≤ M) : (∑ z ∈ R, ‖∑ n ∈ C, a n * quadraticRow P hg (support n) z‖ ^ 2) ≤ (diagonalControl sieveCutoff * M + pvControl sieveCutoff * N * C.card) * ∑ n ∈ C, ‖a n‖ ^ 2 := by have hMp : 0 < M := by linarith let E : O → ℝ := fun z => ‖∑ n ∈ C, a n * quadraticRow P hg (support n) z‖ ^ 2 let F : O → ℝ := fun z => sieveBump (‖eisEmbedding z‖ ^ 2 / M) * E z let H : O → ℂ := fun z => sieveCutoff (‖eisEmbedding z‖ ^ 2 / M) * (E z : ℂ) have hF (z : O) : 0 ≤ F z := mul_nonneg sieveBump.nonneg (sq_nonneg _) have hH (z : O) : H z = (F z : ℂ) := by simp only [H, F, sieveCutoff_apply, Complex.ofReal_mul] have hHs : Summable H := quadratic_mean_summable P hg C support a sieveCutoff M hMp have hFs : Summable F := hHs.norm.congr (fun z => by rw [hH, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hF z)]) have hsum : ‖∑' z : O, H z‖ = ∑' z : O, F z := by rw [tsum_congr hH, ← Complex.ofReal_tsum, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (tsum_nonneg hF)] calc _ = ∑ z ∈ R, F z := by apply Finset.sum_congr rfl intro z hz have ht0 : 0 ≤ ‖eisEmbedding z‖ ^ 2 / M := div_nonneg (sq_nonneg _) hMp.le have ht1 : ‖eisEmbedding z‖ ^ 2 / M ≤ 1 := (div_le_one hMp).mpr (hR z hz) simp only [F, sieveBump_eq_one ht0 ht1, one_mul, E] _ ≤ ∑' z : O, F z := hFs.sum_le_tsum R (fun z _ => hF z) _ = ‖∑' z : O, H z‖ := hsum.symm _ ≤ _ := quadratic_initial_mean_bound P hinj hg hc C support hsupp N hN hNorm a sieveCutoff M hM open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson open ConcretePrimeRowBridge ShortDraftHeckeBridge def initialSieveConstant : ℝ := diagonalControl sieveCutoff + 128 * pvControl sieveCutoff + 1 theorem initialSieveConstant_pos : 0 < initialSieveConstant := by have := diagonalControl_nonneg sieveCutoff have := pvControl_nonneg sieveCutoff unfold initialSieveConstant positivity theorem ideal_initial_quadratic_sieve (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (hsq : ∀ I ∈ F, Squarefree I) (hchar : ∀ i : primePool F, ringChar (O ⧸ i.val) ≠ 2) (N : ℕ) (hN : 1 ≤ N) (hnorm : ∀ I ∈ F, Ideal.absNorm I ≤ N) (a : Ideal O → ℂ) (M : ℝ) (hM : 1 ≤ M) (R : Finset O) (hR : ∀ z ∈ R, ‖eisEmbedding z‖ ^ 2 ≤ M) : (∑ z ∈ R, ‖∑ I ∈ F, a I * (idealSexticRow F hFpos hFgood I z) ^ 3‖ ^ 2) ≤ initialSieveConstant * (M + (N : ℝ) ^ 2) * ∑ I ∈ F, ‖a I‖ ^ 2 := by let : ∀ i : primePool F, (i.val).IsMaximal := primePool_maximal F hFpos have hNr : (1 : ℝ) ≤ N := by exact_mod_cast hN have hsupp : Set.InjOn (idealSupport F) (↑F : Set (Ideal O)) := by intro I hI J hJ h exact idealSupport_injective_on_squarefree F hI hJ (hsq I hI) (hsq J hJ) h have hNorm (I : Ideal O) (hI : I ∈ F) : supportNorm (fun i : primePool F => i.val) (idealSupport F I) ≤ (N : ℝ) := by unfold supportNorm rw [idealSupport_product_eq F hI (hsq I hI)] exact_mod_cast hnorm I hI have hb := quadratic_initial_finite_bound (fun i : primePool F => i.val) Subtype.val_injective (primePool_good F hFgood) hchar F (idealSupport F) hsupp (N : ℝ) (by positivity) hNorm a M hM R hR change (∑ z ∈ R, ‖∑ I ∈ F, a I * (idealSexticRow F hFpos hFgood I z) ^ 3‖ ^ 2) ≤ (diagonalControl sieveCutoff * M + pvControl sieveCutoff * (N : ℝ) * F.card) * ∑ I ∈ F, ‖a I‖ ^ 2 at hb have hsub : F ⊆ idealsUpTo N := by intro I hI apply mem_idealsUpTo.mpr constructor · apply Nat.one_le_iff_ne_zero.mpr rw [ne_eq, Ideal.absNorm_eq_zero_iff] exact hFpos I hI · exact hnorm I hI have hcardNat : F.card ≤ 64 * (N + 1) := (Finset.card_le_card hsub).trans (CompactScaleBridge.idealsUpTo_card_le N) have hcard : (F.card : ℝ) ≤ 128 * (N : ℝ) := by have hh : (F.card : ℝ) ≤ 64 * ((N : ℝ) + 1) := by exact_mod_cast hcardNat linarith refine hb.trans (mul_le_mul_of_nonneg_right ?_ (Finset.sum_nonneg fun _ _ => sq_nonneg _)) have hdiag := diagonalControl_nonneg sieveCutoff have hpv := pvControl_nonneg sieveCutoff have hmul := mul_le_mul_of_nonneg_left hcard (mul_nonneg hpv (by positivity : (0 : ℝ) ≤ N)) unfold initialSieveConstant nlinarith [mul_nonneg hdiag (sq_nonneg (N : ℝ)), mul_nonneg hpv (show 0 ≤ M by linarith)] end QuadraticInitialBound open scoped Classical FourierTransform SchwartzMap ContDiff open MeasureTheory namespace CubicReflectionKernel def gammaMultiplier (s : ℂ) : ℂ := Complex.Gamma ((7 / 6 : ℂ) + s) * Complex.Gamma ((5 / 6 : ℂ) + s) / (Complex.Gamma ((7 / 6 : ℂ) - s) * Complex.Gamma ((5 / 6 : ℂ) - s)) theorem gammaMultiplier_neg (s : ℂ) : gammaMultiplier (-s) = (gammaMultiplier s)⁻¹ := by simp only [gammaMultiplier, sub_neg_eq_add, ← sub_eq_add_neg, inv_div] theorem Gamma_vertical_ne_zero (a u : ℝ) (ha : 0 < a) : Complex.Gamma ((a : ℂ) + u * Complex.I) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos simpa using ha theorem Gamma_vertical_conj (a u : ℝ) : Complex.Gamma ((a : ℂ) - u * Complex.I) = star (Complex.Gamma ((a : ℂ) + u * Complex.I)) := by change _ = (starRingEnd ℂ) (Complex.Gamma ((a : ℂ) + u * Complex.I)) rw [← Complex.Gamma_conj] congr 1 simp [sub_eq_add_neg] theorem gammaMultiplier_norm_imaginary (u : ℝ) : ‖gammaMultiplier (u * Complex.I)‖ = 1 := by have ha := Gamma_vertical_ne_zero (7 / 6) u (by norm_num) have hb := Gamma_vertical_ne_zero (5 / 6) u (by norm_num) have hca := Gamma_vertical_conj (7 / 6) u have hcb := Gamma_vertical_conj (5 / 6) u push_cast at ha hb hca hcb rw [gammaMultiplier, hca, hcb, norm_div, norm_mul, norm_mul, norm_star, norm_star] exact div_self (mul_ne_zero (norm_ne_zero_iff.mpr ha) (norm_ne_zero_iff.mpr hb)) theorem Gamma_vertical_continuous (a : ℝ) (ha : 0 < a) : Continuous (fun u : ℝ => Complex.Gamma ((a : ℂ) + u * Complex.I)) := by apply continuous_iff_continuousAt.mpr intro u apply (Complex.continuousAt_Gamma _ ?_).comp · fun_prop · intro n hn have heq := congrArg Complex.re hn simp only [Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, zero_mul, sub_zero, add_zero, Complex.neg_re, Complex.natCast_re] at heq have : (0 : ℝ) ≤ n := Nat.cast_nonneg n linarith def axisMultiplier (u : ℝ) : ℂ := gammaMultiplier ((2 * Real.pi * u : ℝ) * Complex.I) theorem axisMultiplier_norm (u : ℝ) : ‖axisMultiplier u‖ = 1 := gammaMultiplier_norm_imaginary _ theorem axisMultiplier_continuous : Continuous axisMultiplier := by have h1 := (Gamma_vertical_continuous (7 / 6) (by norm_num)).comp (show Continuous (fun u : ℝ => 2 * Real.pi * u) by fun_prop) have h2 := (Gamma_vertical_continuous (5 / 6) (by norm_num)).comp (show Continuous (fun u : ℝ => 2 * Real.pi * u) by fun_prop) have h3 := (Gamma_vertical_continuous (7 / 6) (by norm_num)).comp (show Continuous (fun u : ℝ => -(2 * Real.pi * u)) by fun_prop) have h4 := (Gamma_vertical_continuous (5 / 6) (by norm_num)).comp (show Continuous (fun u : ℝ => -(2 * Real.pi * u)) by fun_prop) have hd := h3.mul h4 have hne (u : ℝ) : Complex.Gamma ((7 / 6 : ℝ) + (-(2 * Real.pi * u) : ℝ) * Complex.I) * Complex.Gamma ((5 / 6 : ℝ) + (-(2 * Real.pi * u) : ℝ) * Complex.I) ≠ 0 := mul_ne_zero (Gamma_vertical_ne_zero _ _ (by norm_num)) (Gamma_vertical_ne_zero _ _ (by norm_num)) convert (h1.mul h2).div hd hne using 1 ext u simp only [axisMultiplier, gammaMultiplier, Function.comp_def, Complex.ofReal_div, Complex.ofReal_ofNat, Complex.ofReal_neg, neg_mul, ← sub_eq_add_neg, Pi.div_apply, Pi.mul_apply] def spectralProfile (logSource : SchwartzMap ℝ ℂ) (u : ℝ) : ℂ := axisMultiplier u * (𝓕 logSource) u theorem spectralProfile_norm (logSource : SchwartzMap ℝ ℂ) (u : ℝ) : ‖spectralProfile logSource u‖ = ‖(𝓕 logSource) u‖ := by rw [spectralProfile, norm_mul, axisMultiplier_norm, one_mul] theorem spectralProfile_continuous (logSource : SchwartzMap ℝ ℂ) : Continuous (spectralProfile logSource) := axisMultiplier_continuous.mul (𝓕 logSource).continuous theorem spectralProfile_moment_integrable (logSource : SchwartzMap ℝ ℂ) (j : ℕ) : Integrable (fun u : ℝ => ‖u‖ ^ j * ‖spectralProfile logSource u‖) := by simpa only [spectralProfile_norm] using (𝓕 logSource).integrable_pow_mul volume j theorem spectralProfile_pow_integrable (logSource : SchwartzMap ℝ ℂ) (j : ℕ) : Integrable (fun u : ℝ => u ^ j • spectralProfile logSource u) := by apply (spectralProfile_moment_integrable logSource j).mono' ((show Continuous (fun u : ℝ => u ^ j • spectralProfile logSource u) by exact (continuous_id.pow j).smul (spectralProfile_continuous logSource)).aestronglyMeasurable) exact Filter.Eventually.of_forall (fun u => by simp only [norm_smul, norm_pow, le_rfl]) def reflectedLogProfile (logSource : SchwartzMap ℝ ℂ) : ℝ → ℂ := 𝓕 (spectralProfile logSource) theorem reflectedLogProfile_smooth (logSource : SchwartzMap ℝ ℂ) : ContDiff ℝ ∞ (reflectedLogProfile logSource) := Real.contDiff_fourier (fun j _ => spectralProfile_moment_integrable logSource j) theorem reflectedLogProfile_deriv (logSource : SchwartzMap ℝ ℂ) (j : ℕ) : iteratedDeriv j (reflectedLogProfile logSource) = 𝓕 (fun u : ℝ => (-2 * Real.pi * Complex.I * u) ^ j * spectralProfile logSource u) := by simpa only [reflectedLogProfile, smul_eq_mul] using (Real.iteratedDeriv_fourier (N := (⊤ : ℕ∞)) (fun n _ => spectralProfile_pow_integrable logSource n) (by simp : (j : ℕ∞) ≤ ⊤)) end CubicReflectionKernel end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.ReflectedKernel namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid namespace CubicReflectionKernel section open scoped Classical FourierTransform SchwartzMap ContDiff open MeasureTheory def momentScale : ℝ := 2 ^ (volume : Measure ℝ).integrablePower * ∫ u : ℝ, (1 + ‖u‖) ^ (-(volume : Measure ℝ).integrablePower : ℝ) end open scoped Classical FourierTransform SchwartzMap ContDiff Topology open MeasureTheory Filter Asymptotics def paperScale : ℝ := (2 * Real.pi) ^ 4 / 27 theorem paperScale_pos : 0 < paperScale := by unfold paperScale positivity def paperKernel (V : ℝ → ℂ) (x : ℝ) : ℂ := mellinInv 0 (fun t => mellin V (-t) * gammaMultiplier t) (paperScale * x) theorem logProfile_compact (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) : HasCompactSupport (fun u : ℝ => V (Real.exp u)) := by apply HasCompactSupport.of_support_subset_isCompact (K := Set.Icc (Real.log a) (Real.log b)) isCompact_Icc intro u hu have huv : V (Real.exp u) ≠ 0 := hu have hm := hsupp huv constructor · simpa only [Real.log_exp] using Real.log_le_log ha hm.1 · simpa only [Real.log_exp] using Real.log_le_log (Real.exp_pos u) hm.2 def logSchwartz (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) : SchwartzMap ℝ ℂ := (logProfile_compact V a b ha hsupp).toSchwartzMap (hV.comp Real.contDiff_exp) theorem logSchwartz_apply (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (u : ℝ) : logSchwartz V a b ha hsupp hV u = V (Real.exp u) := rfl theorem compact_source_mellin_convergent (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (s : ℂ) : MellinConvergent V s := by have hlocal : LocallyIntegrableOn V (Set.Ioi (0 : ℝ)) := hV.continuous.continuousOn.locallyIntegrableOn measurableSet_Ioi have htopzero : V =ᶠ[atTop] (fun _ => 0) := by filter_upwards [eventually_gt_atTop b] with y hy by_contra hn exact (not_le_of_gt hy) (hsupp hn).2 have hbotzero : V =ᶠ[𝓝[>] (0 : ℝ)] (fun _ => 0) := by filter_upwards [Ioo_mem_nhdsGT ha] with y hy by_contra hn exact (not_le_of_gt hy.2) (hsupp hn).1 have htop : V =O[atTop] (fun y : ℝ => y ^ (-(s.re + 1))) := htopzero.isBigO.trans (isBigO_zero _ _) have hbot : V =O[𝓝[>] (0 : ℝ)] (fun y : ℝ => y ^ (-(s.re - 1))) := hbotzero.isBigO.trans (isBigO_zero _ _) exact mellinConvergent_of_isBigO_rpow hlocal htop (by linarith) hbot (by linarith) theorem mellin_axis_eq_fourier (V : ℝ → ℂ) (logSource : SchwartzMap ℝ ℂ) (hL : ∀ u, logSource u = V (Real.exp u)) (u : ℝ) : mellin V (-((2 * Real.pi * u : ℝ) * Complex.I)) = (𝓕 logSource) u := by rw [mellin_eq_fourier] have hfreq : (-((2 * Real.pi * u : ℝ) * Complex.I) : ℂ).im / (2 * Real.pi) = -u := by simp only [Complex.neg_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, Complex.ofReal_im, Complex.I_re, mul_one, mul_zero, add_zero] field_simp rw [hfreq] have hfun : (fun v : ℝ => Real.exp (-(-((2 * Real.pi * u : ℝ) * Complex.I) : ℂ).re * v) • V (Real.exp (-v))) = (logSource : ℝ → ℂ) ∘ LinearIsometryEquiv.neg ℝ := by funext v simp [hL] rw [hfun, Real.fourier_comp_linearIsometry] simp rfl theorem paperKernel_eq_logFourier (V : ℝ → ℂ) (logSource : SchwartzMap ℝ ℂ) (hL : ∀ u, logSource u = V (Real.exp u)) (x : ℝ) (hx : 0 < x) : paperKernel V x = reflectedLogProfile logSource (Real.log (paperScale * x)) := by unfold paperKernel rw [mellinInv_eq_fourierInv 0 _ (mul_pos paperScale_pos hx)] simp only [Complex.ofReal_zero, neg_zero, Complex.cpow_zero, one_smul] rw [Real.fourierInv_eq_fourier_neg, neg_neg] have hfun : (fun y : ℝ => mellin V (-(0 + 2 * Real.pi * y * Complex.I)) * gammaMultiplier (0 + 2 * Real.pi * y * Complex.I)) = spectralProfile logSource := by funext y have hy : (0 + 2 * Real.pi * y * Complex.I : ℂ) = ((2 * Real.pi * y : ℝ) : ℂ) * Complex.I := by push_cast; ring rw [hy, mellin_axis_eq_fourier V logSource hL] exact mul_comm _ _ rw [hfun] rfl end CubicReflectionKernel open scoped Classical FourierTransform SchwartzMap ContDiff Topology open MeasureTheory Filter namespace CubicReflectionKernel theorem paperKernel_contDiffOn (V : ℝ → ℂ) (logSource : SchwartzMap ℝ ℂ) (hL : ∀ u, logSource u = V (Real.exp u)) : ContDiffOn ℝ ∞ (paperKernel V) (Set.Ioi 0) := by have hg : ContDiffOn ℝ ∞ (fun x => reflectedLogProfile logSource (Real.log (paperScale * x))) (Set.Ioi 0) := by intro x hx apply (reflectedLogProfile_smooth logSource).contDiffAt.comp_contDiffWithinAt x exact ((contDiffAt_const.mul contDiffAt_id).log (ne_of_gt (mul_pos paperScale_pos hx))).contDiffWithinAt apply hg.congr intro x hx exact paperKernel_eq_logFourier V logSource hL x hx theorem paperKernel_euler_eq (V : ℝ → ℂ) (logSource : SchwartzMap ℝ ℂ) (hL : ∀ u, logSource u = V (Real.exp u)) (j : ℕ) (x : ℝ) (hx : 0 < x) : LocalLogFourier.eulerDeriv (paperKernel V) j x = iteratedDeriv j (reflectedLogProfile logSource) (Real.log (paperScale * x)) := by have hfun : (fun t : ℝ => paperKernel V (x * Real.exp t)) = (fun t : ℝ => reflectedLogProfile logSource (Real.log (paperScale * x) + t)) := by funext t rw [paperKernel_eq_logFourier V logSource hL _ (mul_pos hx (Real.exp_pos t))] rw [← mul_assoc, Real.log_mul (ne_of_gt (mul_pos paperScale_pos hx)) (ne_of_gt (Real.exp_pos t)), Real.log_exp] rw [LocalLogFourier.eulerDeriv, hfun, iteratedDeriv_comp_const_add] simp theorem paperKernel_compact_source_smooth (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) : ContDiffOn ℝ ∞ (paperKernel V) (Set.Ioi 0) := paperKernel_contDiffOn V (logSchwartz V a b ha hsupp hV) (by intro u; rfl) open scoped Classical FourierTransform SchwartzMap ContDiff Topology open MeasureTheory Filter Asymptotics theorem compact_source_mellin_hasDerivAt (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (s : ℂ) : HasDerivAt (mellin V) (mellin (fun t => Real.log t • V t) s) s := by have hlocal : LocallyIntegrableOn V (Set.Ioi (0 : ℝ)) := hV.continuous.continuousOn.locallyIntegrableOn measurableSet_Ioi have htopzero : V =ᶠ[atTop] (fun _ => 0) := by filter_upwards [eventually_gt_atTop b] with y hy by_contra hn exact (not_le_of_gt hy) (hsupp hn).2 have hbotzero : V =ᶠ[𝓝[>] (0 : ℝ)] (fun _ => 0) := by filter_upwards [Ioo_mem_nhdsGT ha] with y hy by_contra hn exact (not_le_of_gt hy.2) (hsupp hn).1 have htop : V =O[atTop] (fun y : ℝ => y ^ (-(s.re + 1))) := htopzero.isBigO.trans (isBigO_zero _ _) have hbot : V =O[𝓝[>] (0 : ℝ)] (fun y : ℝ => y ^ (-(s.re - 1))) := hbotzero.isBigO.trans (isBigO_zero _ _) exact (mellin_hasDerivAt_of_isBigO_rpow hlocal htop (by linarith) hbot (by linarith)).2 theorem compact_source_mellin_differentiable (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) : Differentiable ℂ (mellin V) := fun s => (compact_source_mellin_hasDerivAt V a b ha hsupp hV s).differentiableAt theorem Gamma_differentiableAt_of_re_pos (z : ℂ) (hz : 0 < z.re) : DifferentiableAt ℂ Complex.Gamma z := by apply Complex.differentiableAt_Gamma intro m hm have hr := congrArg Complex.re hm simp only [Complex.neg_re, Complex.natCast_re] at hr have hn : (0 : ℝ) ≤ m := Nat.cast_nonneg m linarith theorem gammaMultiplier_differentiableAt (s : ℂ) (hs : -(5 / 6 : ℝ) < s.re) : DifferentiableAt ℂ gammaMultiplier s := by have h1 := (Gamma_differentiableAt_of_re_pos ((7 / 6 : ℂ) + s) (by norm_num [Complex.add_re, Complex.div_re] linarith)).comp s (differentiableAt_const _ |>.add differentiableAt_id) have h2 := (Gamma_differentiableAt_of_re_pos ((5 / 6 : ℂ) + s) (by norm_num [Complex.add_re, Complex.div_re] linarith)).comp s (differentiableAt_const _ |>.add differentiableAt_id) have h3 := (Complex.differentiable_one_div_Gamma ((7 / 6 : ℂ) - s)).comp s (differentiableAt_const _ |>.sub differentiableAt_id) have h4 := (Complex.differentiable_one_div_Gamma ((5 / 6 : ℂ) - s)).comp s (differentiableAt_const _ |>.sub differentiableAt_id) convert ((h1.mul h2).mul (h3.mul h4)) using 1 <;> first | rfl | (ext z; simp only [gammaMultiplier, Function.comp_def, div_eq_mul_inv, mul_inv_rev, Pi.mul_apply] <;> ring) theorem kernelMellinIntegrand_differentiableAt (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (s : ℂ) (hs : -(5 / 6 : ℝ) < s.re) : DifferentiableAt ℂ (fun t => mellin V (-t) * gammaMultiplier t) s := by exact ((compact_source_mellin_differentiable V a b ha hsupp hV (-s)).comp s differentiableAt_id.neg).mul (gammaMultiplier_differentiableAt s hs) end CubicReflectionKernel open scoped BigOperators Classical namespace DescentWeightedCauchy theorem weighted_cauchy_sq {ι : Type*} (s : Finset ι) (w U V : ι → ℂ) : ‖∑ i ∈ s, w i * U i * star (V i)‖ ^ 2 ≤ (∑ i ∈ s, ‖w i‖ * ‖U i‖ ^ 2) * (∑ i ∈ s, ‖w i‖ * ‖V i‖ ^ 2) := by have hnorm : ‖∑ i ∈ s, w i * U i * star (V i)‖ ≤ ∑ i ∈ s, ‖w i‖ * ‖U i‖ * ‖V i‖ := by simpa only [norm_mul, norm_star] using norm_sum_le s (fun i => w i * U i * star (V i)) calc _ ≤ (∑ i ∈ s, ‖w i‖ * ‖U i‖ * ‖V i‖) ^ 2 := sq_le_sq₀ (norm_nonneg _) (Finset.sum_nonneg (fun i _ => by positivity)) |>.mpr hnorm _ ≤ _ := Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul s (fun i _ => by positivity) (fun i _ => by positivity) (fun i _ => by ring_nf; exact le_rfl) theorem weighted_cauchy {ι : Type*} (s : Finset ι) (w U V : ι → ℂ) : ‖∑ i ∈ s, w i * U i * star (V i)‖ ≤ Real.sqrt (∑ i ∈ s, ‖w i‖ * ‖U i‖ ^ 2) * Real.sqrt (∑ i ∈ s, ‖w i‖ * ‖V i‖ ^ 2) := by have h1 : 0 ≤ ∑ i ∈ s, ‖w i‖ * ‖U i‖ ^ 2 := Finset.sum_nonneg (fun i _ => by positivity) have h2 : 0 ≤ ∑ i ∈ s, ‖w i‖ * ‖V i‖ ^ 2 := Finset.sum_nonneg (fun i _ => by positivity) have hs := weighted_cauchy_sq s w U V have he1 := Real.sq_sqrt h1 have he2 := Real.sq_sqrt h2 have hp : (Real.sqrt (∑ i ∈ s, ‖w i‖ * ‖U i‖ ^ 2) * Real.sqrt (∑ i ∈ s, ‖w i‖ * ‖V i‖ ^ 2)) ^ 2 = (∑ i ∈ s, ‖w i‖ * ‖U i‖ ^ 2) * (∑ i ∈ s, ‖w i‖ * ‖V i‖ ^ 2) := by rw [mul_pow, he1, he2] exact (sq_le_sq₀ (norm_nonneg _) (by positivity)).mp (hp ▸ hs) theorem weighted_energy_pushforward {ι κ : Type*} [DecidableEq κ] (s : Finset ι) (t : Finset κ) (f : ι → κ) (w : ι → ℂ) (P : κ → ℂ) (B : κ → ℝ) (hmap : ∀ i ∈ s, f i ∈ t) (hfib : ∀ y ∈ t, (∑ i ∈ s with f i = y, ‖w i‖) ≤ B y) : (∑ i ∈ s, ‖w i‖ * ‖P (f i)‖ ^ 2) ≤ ∑ y ∈ t, B y * ‖P y‖ ^ 2 := by calc _ = ∑ y ∈ t, ∑ i ∈ s with f i = y, ‖w i‖ * ‖P (f i)‖ ^ 2 := by symm exact Finset.sum_fiberwise_of_maps_to hmap _ _ = ∑ y ∈ t, (∑ i ∈ s with f i = y, ‖w i‖) * ‖P y‖ ^ 2 := by apply Finset.sum_congr rfl intro y hy rw [Finset.sum_mul] apply Finset.sum_congr rfl intro i hi rw [(Finset.mem_filter.mp hi).2] _ ≤ _ := Finset.sum_le_sum (fun y hy => mul_le_mul_of_nonneg_right (hfib y hy) (sq_nonneg _)) theorem bounded_energy_pushforward {ι κ : Type*} [DecidableEq κ] (s : Finset ι) (t : Finset κ) (f : ι → κ) (w : ι → ℂ) (P : κ → ℂ) (C : ℝ) (hmap : ∀ i ∈ s, f i ∈ t) (hw : ∀ i ∈ s, ‖w i‖ ≤ C) : (∑ i ∈ s, ‖w i‖ * ‖P (f i)‖ ^ 2) ≤ ∑ y ∈ t, C * (s.filter (fun i => f i = y)).card * ‖P y‖ ^ 2 := by apply weighted_energy_pushforward s t f w P _ hmap intro y hy calc _ ≤ ∑ i ∈ s with f i = y, C := Finset.sum_le_sum (fun i hi => hw i (Finset.mem_filter.mp hi).1) _ = _ := by simp [mul_comm] abbrev O := ActualEisensteinCubic.O def firstElementRowMap (e : O) (x : Ideal O × O) : O := x.2 * ConcretePrimeRowBridge.idealGenerator x.1 ^ 2 * e theorem firstElementRowMap_label_dvd (e : O) (x : Ideal O × O) : x.1 ∣ Ideal.span {firstElementRowMap e x} := by rw [← ConcretePrimeRowBridge.span_idealGenerator x.1] apply Ideal.span_singleton_dvd_span_singleton_iff_dvd.mpr refine ⟨x.2 * ConcretePrimeRowBridge.idealGenerator x.1 * e, ?_⟩ simp only [firstElementRowMap] ring end DescentWeightedCauchy end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Arithmetic.SquarefreeDivisors namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid namespace SquarefreeDivisorBound open scoped BigOperators Classical open Filter IdealMobiusDivisorSum abbrev O := ActualEisensteinCubic.O theorem squarefree_divisor_card_le (I : Ideal O) (hI : I ≠ ⊥) : ((idealDivisors I).filter Squarefree).card ≤ 2 ^ (primeSupport I).card := by rw [squarefree_divisors_eq_image I hI] exact Finset.card_image_le.trans_eq (Finset.card_powerset _) theorem prime_support_subsets_bound (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ I : Ideal O, I ≠ ⊥ → (2 : ℝ) ^ (primeSupport I).card ≤ C * (Ideal.absNorm I : ℝ) ^ ε := by have ht : Tendsto (fun n : ℕ => (n : ℝ) ^ ε) atTop atTop := (tendsto_rpow_atTop hε).comp tendsto_natCast_atTop_atTop obtain ⟨N, hN⟩ := eventually_atTop.mp (ht.eventually (eventually_ge_atTop (2 : ℝ))) let small : Finset (Ideal O) := (Ideal.finite_setOfPred_absNorm_le (S := O) N).toFinset refine ⟨(2 : ℝ) ^ small.card, by positivity, ?_⟩ intro I hI let S := primeSupport I let A := S ∩ small let B := S \ small have hBS : B ⊆ primeSupport I := Finset.sdiff_subset have hlarge (P : Ideal O) (hP : P ∈ B) : (2 : ℝ) ≤ (Ideal.absNorm P : ℝ) ^ ε := by apply hN have hn : P ∉ small := (Finset.mem_sdiff.mp hP).2 have hgt : N < Ideal.absNorm P := by apply Nat.lt_of_not_ge intro hp exact hn (by simpa [small] using hp) exact hgt.le have hpowB : (2 : ℝ) ^ B.card ≤ (Ideal.absNorm (∏ P ∈ B, P) : ℝ) ^ ε := by calc _ = ∏ P ∈ B, (2 : ℝ) := by simp _ ≤ ∏ P ∈ B, (Ideal.absNorm P : ℝ) ^ ε := Finset.prod_le_prod₀ (fun _ _ => by positivity) hlarge _ = (∏ P ∈ B, (Ideal.absNorm P : ℝ)) ^ ε := (Real.finsetProd_rpow B (fun P => (Ideal.absNorm P : ℝ)) (fun _ _ => by positivity) ε) _ = _ := by simp only [map_prod, Nat.cast_prod] have hNI : 0 < Ideal.absNorm I := Nat.pos_iff_ne_zero.mpr (fun h => hI (Ideal.absNorm_eq_zero_iff.mp h)) have hnorm : Ideal.absNorm (∏ P ∈ B, P) ≤ Ideal.absNorm I := Nat.le_of_dvd hNI (map_dvd Ideal.absNorm (support_product_dvd hI hBS)) have hpowBI : (2 : ℝ) ^ B.card ≤ (Ideal.absNorm I : ℝ) ^ ε := hpowB.trans (Real.rpow_le_rpow (by positivity) (by exact_mod_cast hnorm) hε.le) have hAc : A.card ≤ small.card := Finset.card_le_card Finset.inter_subset_right have hcard : S.card = A.card + B.card := by simp [A, B] change (2 : ℝ) ^ S.card ≤ _ rw [hcard, pow_add] exact mul_le_mul (pow_le_pow_right₀ (by norm_num) hAc) hpowBI (by positivity) (by positivity) theorem squarefree_divisor_small_power (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ I : Ideal O, I ≠ ⊥ → (((idealDivisors I).filter Squarefree).card : ℝ) ≤ C * (Ideal.absNorm I : ℝ) ^ ε := by obtain ⟨C, hC, h⟩ := prime_support_subsets_bound ε hε refine ⟨C, hC, fun I hI => ?_⟩ have hc : (((idealDivisors I).filter Squarefree).card : ℝ) ≤ (2 : ℝ) ^ (primeSupport I).card := by exact_mod_cast squarefree_divisor_card_le I hI exact hc.trans (h I hI) open DescentWeightedCauchy theorem first_element_squarefree_fiber (s : Finset (Ideal O × O)) (hs : ∀ x ∈ s, Squarefree x.1) (e y : O) (hy : y ≠ 0) : (s.filter (fun x => firstElementRowMap e x = y)).card ≤ ((idealDivisors (Ideal.span {y})).filter Squarefree).card := by have hyI : (Ideal.span {y} : Ideal O) ≠ ⊥ := by intro h have hm : y ∈ (Ideal.span {y} : Ideal O) := Ideal.subset_span (by simp) rw [h] at hm exact hy hm apply Finset.card_le_card_of_injOn Prod.fst · intro x hx change x.1 ∈ (idealDivisors (Ideal.span {y})).filter Squarefree have hx' := Finset.mem_filter.mp hx apply Finset.mem_filter.mpr refine ⟨?_, hs x hx'.1⟩ rw [mem_idealDivisors hyI, ← hx'.2] exact firstElementRowMap_label_dvd e x · intro x hx z hz hfst have hx' := (Finset.mem_filter.mp hx).2 have hz' := (Finset.mem_filter.mp hz).2 have hfac : ConcretePrimeRowBridge.idealGenerator x.1 ^ 2 * e ≠ 0 := by intro he apply hy rw [← hx'] simp [firstElementRowMap, mul_assoc, he] apply Prod.ext hfst apply mul_right_cancel₀ hfac calc x.2 * (ConcretePrimeRowBridge.idealGenerator x.1 ^ 2 * e) = y := by simpa [firstElementRowMap, mul_assoc] using hx' _ = z.2 * (ConcretePrimeRowBridge.idealGenerator x.1 ^ 2 * e) := by simpa [firstElementRowMap, mul_assoc, hfst] using hz'.symm theorem first_element_fiber_small_power (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ (s : Finset (Ideal O × O)), (∀ x ∈ s, Squarefree x.1) → ∀ e y : O, y ≠ 0 → ((s.filter (fun x => firstElementRowMap e x = y)).card : ℝ) ≤ C * (Ideal.absNorm (Ideal.span {y}) : ℝ) ^ ε := by obtain ⟨C, hC, h⟩ := squarefree_divisor_small_power ε hε refine ⟨C, hC, ?_⟩ intro s hs e y hy have hyI : (Ideal.span {y} : Ideal O) ≠ ⊥ := by intro he have hm : y ∈ (Ideal.span {y} : Ideal O) := Ideal.subset_span (by simp) rw [he] at hm exact hy hm have hc : ((s.filter (fun x => firstElementRowMap e x = y)).card : ℝ) ≤ (((idealDivisors (Ideal.span {y})).filter Squarefree).card : ℝ) := by exact_mod_cast first_element_squarefree_fiber s hs e y hy exact hc.trans (h _ hyI) theorem first_element_energy_small_power (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ (s : Finset (Ideal O × O)) (t : Finset O) (e : O) (w : Ideal O × O → ℂ) (P : O → ℂ) (B Y : ℝ), 0 ≤ B → 0 ≤ Y → (∀ x ∈ s, Squarefree x.1) → (∀ x ∈ s, firstElementRowMap e x ∈ t) → (∀ y ∈ t, y ≠ 0) → (∀ y ∈ t, (Ideal.absNorm (Ideal.span {y}) : ℝ) ≤ Y) → (∀ x ∈ s, ‖w x‖ ≤ B) → (∑ x ∈ s, ‖w x‖ * ‖P (firstElementRowMap e x)‖ ^ 2) ≤ B * C * Y ^ ε * ∑ y ∈ t, ‖P y‖ ^ 2 := by obtain ⟨C, hC, hc⟩ := first_element_fiber_small_power ε hε refine ⟨C, hC, ?_⟩ intro s t e w P B Y hB hY hs hmap ht hnorm hw have hpush := bounded_energy_pushforward s t (firstElementRowMap e) w P B hmap hw apply hpush.trans rw [Finset.mul_sum] apply Finset.sum_le_sum intro y hy have hcard := (hc s hs e y (ht y hy)).trans (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (by positivity) (hnorm y hy) hε.le) hC.le) have hterm := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hcard hB) (sq_nonneg ‖P y‖) simpa only [mul_assoc] using hterm end SquarefreeDivisorBound namespace VerticalContourShift open MeasureTheory Filter Set open scoped Topology theorem horizontal_integral_tendsto_zero (f : ℂ → ℂ) (a b C : ℝ) (hab : a ≤ b) (hbound : ∀ σ ∈ Icc a b, ∀ t : ℝ, ‖f ((σ : ℂ) + t * Complex.I)‖ ≤ C / (1 + t ^ 2)) : Tendsto (fun t : ℝ => ∫ σ : ℝ in a..b, f ((σ : ℂ) + t * Complex.I)) atTop (𝓝 0) := by have ht : Tendsto (fun t : ℝ => 1 + t ^ 2) atTop atTop := tendsto_atTop_add_const_left atTop 1 (tendsto_pow_atTop (by decide : (2 : ℕ) ≠ 0)) have hz : Tendsto (fun t : ℝ => C / (1 + t ^ 2) * |b - a|) atTop (𝓝 0) := by simpa using (tendsto_const_nhds.div_atTop ht).mul_const |b - a| apply tendsto_zero_iff_norm_tendsto_zero.mpr apply squeeze_zero (fun _ => norm_nonneg _) _ hz intro t apply intervalIntegral.norm_integral_le_of_norm_le_const intro σ hσ exact hbound σ (Ioc_subset_Icc_self (by simpa [uIoc_of_le hab] using hσ)) t theorem integral_eq_of_strip_decay (f : ℂ → ℂ) (a b C : ℝ) (hab : a ≤ b) (hdiff : ∀ z : ℂ, a ≤ z.re → z.re ≤ b → DifferentiableAt ℂ f z) (ha : Integrable (fun t : ℝ => f ((a : ℂ) + t * Complex.I))) (hb : Integrable (fun t : ℝ => f ((b : ℂ) + t * Complex.I))) (hbound : ∀ σ ∈ Icc a b, ∀ t : ℝ, ‖f ((σ : ℂ) + t * Complex.I)‖ ≤ C / (1 + t ^ 2)) : (∫ t : ℝ, f ((a : ℂ) + t * Complex.I)) = ∫ t : ℝ, f ((b : ℂ) + t * Complex.I) := by let H (t : ℝ) : ℂ := ∫ σ : ℝ in a..b, f ((σ : ℂ) + t * Complex.I) let V (σ t : ℝ) : ℂ := ∫ u : ℝ in -t..t, f ((σ : ℂ) + u * Complex.I) have htop : Tendsto H atTop (𝓝 0) := horizontal_integral_tendsto_zero f a b C hab hbound have hbottom : Tendsto (fun t : ℝ => H (-t)) atTop (𝓝 0) := by let g (z : ℂ) := f (star z) have hg : ∀ σ ∈ Icc a b, ∀ t : ℝ, ‖g ((σ : ℂ) + t * Complex.I)‖ ≤ C / (1 + t ^ 2) := by intro σ hσ t simpa [g] using hbound σ hσ (-t) convert horizontal_integral_tendsto_zero g a b C hab hg using 1 ; simp [g, H] have hVa : Tendsto (V a) atTop (𝓝 (∫ t : ℝ, f ((a : ℂ) + t * Complex.I))) := intervalIntegral_tendsto_integral ha tendsto_neg_atTop_atBot tendsto_id have hVb : Tendsto (V b) atTop (𝓝 (∫ t : ℝ, f ((b : ℂ) + t * Complex.I))) := intervalIntegral_tendsto_integral hb tendsto_neg_atTop_atBot tendsto_id have hrect (t : ℝ) : H (-t) - H t + Complex.I * V b t - Complex.I * V a t = 0 := by have hd : DifferentiableOn ℂ f (uIcc (((a : ℂ) - t * Complex.I).re) (((b : ℂ) + t * Complex.I).re) ×ℂ uIcc (((a : ℂ) - t * Complex.I).im) (((b : ℂ) + t * Complex.I).im)) := by intro z hz apply (hdiff z ?_ ?_).differentiableWithinAt · have hz' : z.re ∈ Icc a b := by simpa [uIcc_of_le hab] using hz.1 exact hz'.1 · have hz' : z.re ∈ Icc a b := by simpa [uIcc_of_le hab] using hz.1 exact hz'.2 have hr := Complex.integral_boundary_rect_eq_zero_of_differentiableOn f ((a : ℂ) - t * Complex.I) ((b : ℂ) + t * Complex.I) hd simpa [H, V, smul_eq_mul] using hr have hlim : Tendsto (fun t : ℝ => H (-t) - H t + Complex.I * V b t - Complex.I * V a t) atTop (𝓝 (0 - 0 + Complex.I * (∫ t : ℝ, f ((b : ℂ) + t * Complex.I)) - Complex.I * (∫ t : ℝ, f ((a : ℂ) + t * Complex.I)))) := ((hbottom.sub htop).add (tendsto_const_nhds.mul hVb)).sub (tendsto_const_nhds.mul hVa) have heq : Complex.I * (∫ t : ℝ, f ((b : ℂ) + t * Complex.I)) - Complex.I * (∫ t : ℝ, f ((a : ℂ) + t * Complex.I)) = 0 := by have hzero : Tendsto (fun t : ℝ => H (-t) - H t + Complex.I * V b t - Complex.I * V a t) atTop (𝓝 0) := by simpa only [hrect] using (tendsto_const_nhds : Tendsto (fun _ : ℝ => (0 : ℂ)) atTop (𝓝 0)) simpa using tendsto_nhds_unique hlim hzero exact (mul_left_cancel₀ Complex.I_ne_zero (sub_eq_zero.mp heq)).symm end VerticalContourShift open scoped BigOperators Classical namespace FirstPassCubeLabels abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic def bit (b : Bool) : ℕ := if b then 1 else 0 def conductorExponent (parityBit ε₁ ε₂ : Bool) : ZMod 6 := (bit ε₁ : ZMod 6) - (bit ε₂ : ZMod 6) + 3 * (bit parityBit : ZMod 6) def crtExponent (side parityBit ε₁ ε₂ : Bool) : ℕ := if conductorExponent parityBit ε₁ ε₂ = 0 then 0 else ((1 : ZMod 6) + if side then -conductorExponent parityBit ε₁ ε₂ else conductorExponent parityBit ε₁ ε₂).val def dilationExponent (parityBit ε₁ ε₂ : Bool) : ℕ := if parityBit then bit ε₁ + bit ε₂ else 0 def retained (parityBit ε₁ ε₂ : Bool) : Bool := parityBit || (ε₁ && ε₂) theorem exponent_table (side parityBit ε₁ ε₂ : Bool) : (4 * bit (if side then ε₂ else ε₁) + crtExponent side parityBit ε₁ ε₂ + dilationExponent parityBit ε₁ ε₂) % 6 = if retained parityBit ε₁ ε₂ then 4 else 0 := by cases side <;> cases parityBit <;> cases ε₁ <;> cases ε₂ <;> decide section Rows variable {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S : Finset ι) theorem row_pow (a : O) (m : ℕ) : finiteSquarefreeRow P hg S (a ^ m) = finiteSquarefreeRow P hg S a ^ m := by simp only [finiteSquarefreeRow, map_pow, Finset.prod_pow] theorem row_prod {κ : Type*} (B : Finset κ) (a : κ → O) : finiteSquarefreeRow P hg S (∏ j ∈ B, a j) = ∏ j ∈ B, finiteSquarefreeRow P hg S (a j) := by classical induction B using Finset.induction_on with | empty => simp [finiteSquarefreeRow] | @insert j B hj ih => simp only [Finset.prod_insert hj, finiteSquarefreeRow_mul, ih] theorem row_sixth (a : O) : finiteSquarefreeRow P hg S a ^ 6 = rowCoprimeMask P S a := by rw [← row_pow, finiteSquarefreeRow_sixth_power] rfl include hg theorem mask_mul (a b : O) : rowCoprimeMask P S (a * b) = rowCoprimeMask P S a * rowCoprimeMask P S b := by simp only [← row_sixth P hg S, finiteSquarefreeRow_mul, mul_pow] theorem mask_pow (a : O) (m : ℕ) : rowCoprimeMask P S (a ^ m) = rowCoprimeMask P S a ^ m := by rw [← row_sixth P hg S, row_pow, ← row_sixth P hg S] simp only [← pow_mul, Nat.mul_comm] theorem mask_prod {κ : Type*} (B : Finset κ) (a : κ → O) : rowCoprimeMask P S (∏ j ∈ B, a j) = ∏ j ∈ B, rowCoprimeMask P S (a j) := by rw [← row_sixth P hg S, row_prod, ← Finset.prod_pow] simp only [row_sixth] theorem row_zero_of_mask_zero (a : O) (h : rowCoprimeMask P S a = 0) : finiteSquarefreeRow P hg S a = 0 := by have hq := row_sixth P hg S a rw [h] at hq exact (pow_eq_zero_iff (by decide : (6 : ℕ) ≠ 0)).mp hq theorem row_power_mul_mask_power (a : O) (k m : ℕ) (hk : 0 < k) : finiteSquarefreeRow P hg S a ^ k * rowCoprimeMask P S a ^ m = finiteSquarefreeRow P hg S a ^ k := by by_cases h : ∃ i ∈ S, a ∈ P i · have hm : rowCoprimeMask P S a = 0 := by simp [rowCoprimeMask, h] rw [row_zero_of_mask_zero P hg S a hm] simp [Nat.ne_of_gt hk] · simp [rowCoprimeMask, h] def localFactor (side parityBit ε₁ ε₂ : Bool) (a : O) : ℂ := rowCoprimeMask P S a * finiteSquarefreeRow P hg S a ^ (4 * bit (if side then ε₂ else ε₁)) * finiteSquarefreeRow P hg S a ^ crtExponent side parityBit ε₁ ε₂ * finiteSquarefreeRow P hg S a ^ dilationExponent parityBit ε₁ ε₂ theorem localFactor_eq (side parityBit ε₁ ε₂ : Bool) (a : O) : localFactor P hg S side parityBit ε₁ ε₂ a = if retained parityBit ε₁ ε₂ then finiteSquarefreeRow P hg S a ^ 4 else rowCoprimeMask P S a := by by_cases h : ∃ i ∈ S, a ∈ P i · have hm : rowCoprimeMask P S a = 0 := by simp [rowCoprimeMask, h] have hz := row_zero_of_mask_zero P hg S a hm simp [localFactor, hm, hz] · have hm : rowCoprimeMask P S a = 1 := by simp [rowCoprimeMask, h] have h6 : finiteSquarefreeRow P hg S a ^ 6 = 1 := (row_sixth P hg S a).trans hm simp only [localFactor, hm, one_mul, ← pow_add] rw [pow_eq_pow_mod _ h6, exponent_table] split <;> simp end Rows def parity (m : ℕ) : Bool := decide (m % 2 = 1) def evenDouble (m : ℕ) (ε₁ ε₂ : Bool) : Bool := !parity m && ε₁ && ε₂ def b0Exponent (m : ℕ) (ε₁ ε₂ : Bool) : ℕ := m / 2 - bit (evenDouble m ε₁ ε₂) theorem multiplicity_decomposition (m : ℕ) (ε₁ ε₂ : Bool) (hm : 0 < m) : 2 * b0Exponent m ε₁ ε₂ + 2 * bit (evenDouble m ε₁ ε₂) + bit (parity m) = m := by have hmod := Nat.mod_lt m (by decide : 0 < 2) have hdiv := Nat.mod_add_div m 2 cases ε₁ <;> cases ε₂ <;> by_cases h : m % 2 = 1 <;> simp [b0Exponent, evenDouble, parity, bit, h] <;> omega theorem b0Exponent_pos_of_not_retained (m : ℕ) (ε₁ ε₂ : Bool) (hm : 0 < m) (hret : retained (parity m) ε₁ ε₂ = false) : 0 < b0Exponent m ε₁ ε₂ := by have hmod := Nat.mod_lt m (by decide : 0 < 2) have hdiv := Nat.mod_add_div m 2 cases ε₁ <;> cases ε₂ <;> by_cases h : m % 2 = 1 <;> simp_all [b0Exponent, evenDouble, parity, retained, bit] <;> omega section Reassembly variable {ι κ : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S : Finset ι) theorem localFactor_eq_b0 (side ε₁ ε₂ : Bool) (a : O) (m : ℕ) (hm : 0 < m) : localFactor P hg S side (parity m) ε₁ ε₂ a = (finiteSquarefreeRow P hg S (a ^ bit (retained (parity m) ε₁ ε₂))) ^ 4 * rowCoprimeMask P S (a ^ b0Exponent m ε₁ ε₂) := by rw [localFactor_eq, row_pow, mask_pow P hg S] cases hr : retained (parity m) ε₁ ε₂ · have hpos := b0Exponent_pos_of_not_retained m ε₁ ε₂ hm hr simp only [Bool.false_eq_true, ↓reduceIte, bit, Bool.false_eq_true, pow_zero, one_pow, one_mul] unfold rowCoprimeMask split <;> simp [Nat.ne_of_gt hpos] · simp only [↓reduceIte, bit, pow_one] exact (row_power_mul_mask_power P hg S a 4 _ (by decide)).symm def primeProduct (p : κ → O) (B : Finset κ) (v : κ → ℕ) : O := ∏ j ∈ B, p j ^ v j def cubeRadical (p : κ → O) (B : Finset κ) : O := ∏ j ∈ B, p j def aLabel (p : κ → O) (B : Finset κ) (ε : κ → Bool) : O := primeProduct p B (fun j => bit (ε j)) def crtLabel (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (side : Bool) : O := primeProduct p B (fun j => crtExponent side (parity (v j)) (ε₁ j) (ε₂ j)) def dilationLabel (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) : O := primeProduct p B (fun j => dilationExponent (parity (v j)) (ε₁ j) (ε₂ j)) def jLabel (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) : O := primeProduct p B (fun j => bit (retained (parity (v j)) (ε₁ j) (ε₂ j))) def j2Label (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) : O := primeProduct p B (fun j => bit (evenDouble (v j) (ε₁ j) (ε₂ j))) def squarefreeLabel (p : κ → O) (B : Finset κ) (v : κ → ℕ) : O := primeProduct p B (fun j => bit (parity (v j))) def b0Label (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) : O := primeProduct p B (fun j => b0Exponent (v j) (ε₁ j) (ε₂ j)) theorem first_pass_label_identity (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (hv : ∀ j ∈ B, 0 < v j) (side : Bool) : rowCoprimeMask P S (cubeRadical p B) * finiteSquarefreeRow P hg S (aLabel p B (if side then ε₂ else ε₁)) ^ 4 * finiteSquarefreeRow P hg S (crtLabel p B v ε₁ ε₂ side) * finiteSquarefreeRow P hg S (dilationLabel p B v ε₁ ε₂) = finiteSquarefreeRow P hg S (jLabel p B v ε₁ ε₂) ^ 4 * rowCoprimeMask P S (b0Label p B v ε₁ ε₂) := by classical simp only [cubeRadical, aLabel, crtLabel, dilationLabel, jLabel, b0Label, primeProduct, mask_prod P hg S, row_prod, ← Finset.prod_pow, ← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro j hj rw [row_pow, row_pow, row_pow] convert localFactor_eq_b0 P hg S side (ε₁ j) (ε₂ j) (p j) (v j) (hv j hj) using 1 cases side <;> simp only [localFactor, Bool.false_eq_true, ↓reduceIte, ← _root_.pow_mul, _root_.Nat.mul_comm] theorem cube_product_decomposition (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (hv : ∀ j ∈ B, 0 < v j) : primeProduct p B v = b0Label p B v ε₁ ε₂ ^ 2 * j2Label p B v ε₁ ε₂ ^ 2 * squarefreeLabel p B v := by simp only [b0Label, j2Label, squarefreeLabel, primeProduct, ← Finset.prod_pow, ← Finset.prod_mul_distrib, ← pow_mul, ← pow_add] apply Finset.prod_congr rfl intro j hj congr 1 have h := multiplicity_decomposition (v j) (ε₁ j) (ε₂ j) (hv j hj) omega theorem jLabel_eq_squarefree_mul_j2 (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) : jLabel p B v ε₁ ε₂ = squarefreeLabel p B v * j2Label p B v ε₁ ε₂ := by simp only [jLabel, squarefreeLabel, j2Label, primeProduct, ← Finset.prod_mul_distrib, ← pow_add] apply Finset.prod_congr rfl intro j hj congr 1 cases hp : parity (v j) <;> cases ε₁ j <;> cases ε₂ j <;> simp [bit, retained, evenDouble, hp] include hg in theorem radical_mask_absorbs (p : κ → O) (B : Finset κ) (v : κ → ℕ) : rowCoprimeMask P S (cubeRadical p B) * rowCoprimeMask P S (primeProduct p B v) = rowCoprimeMask P S (cubeRadical p B) := by simp only [cubeRadical, primeProduct, mask_prod P hg S, mask_pow P hg S, ← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro j hj unfold rowCoprimeMask split <;> simp theorem masked_dual_dilation (p : κ → O) (B : Finset κ) (v : κ → ℕ) (z : O) (c : ℂ) : rowCoprimeMask P S (cubeRadical p B) * c * star (finiteSquarefreeRow P hg S z) = (rowCoprimeMask P S (cubeRadical p B) * c * finiteSquarefreeRow P hg S (primeProduct p B v)) * star (finiteSquarefreeRow P hg S (z * primeProduct p B v)) := by rw [finiteSquarefreeRow_mul, star_mul] calc _ = (rowCoprimeMask P S (cubeRadical p B) * rowCoprimeMask P S (primeProduct p B v)) * c * star (finiteSquarefreeRow P hg S z) := by rw [radical_mask_absorbs P hg S] _ = _ := by rw [← finiteSquarefreeRow_self_pair P hg S (primeProduct p B v)]; ring theorem first_pass_after_dual_dilation (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (hv : ∀ j ∈ B, 0 < v j) (side : Bool) (z : O) : (rowCoprimeMask P S (cubeRadical p B) * finiteSquarefreeRow P hg S (aLabel p B (if side then ε₂ else ε₁)) ^ 4 * finiteSquarefreeRow P hg S (crtLabel p B v ε₁ ε₂ side)) * star (finiteSquarefreeRow P hg S z) = (finiteSquarefreeRow P hg S (jLabel p B v ε₁ ε₂) ^ 4 * rowCoprimeMask P S (b0Label p B v ε₁ ε₂)) * star (finiteSquarefreeRow P hg S (z * dilationLabel p B v ε₁ ε₂)) := by have hd := masked_dual_dilation P hg S p B (fun j => dilationExponent (parity (v j)) (ε₁ j) (ε₂ j)) z (finiteSquarefreeRow P hg S (aLabel p B (if side then ε₂ else ε₁)) ^ 4 * finiteSquarefreeRow P hg S (crtLabel p B v ε₁ ε₂ side)) change _ = (_ * finiteSquarefreeRow P hg S (dilationLabel p B v ε₁ ε₂)) * _ at hd simp only [← mul_assoc] at hd rw [first_pass_label_identity P hg S p B v ε₁ ε₂ hv side] at hd exact hd theorem cube_pair_product_decomposition (p : κ → O) (B : Finset κ) (v₁ v₂ : κ → ℕ) (ε₁ ε₂ : κ → Bool) (hv : ∀ j ∈ B, 0 < v₁ j + v₂ j) : primeProduct p B v₁ * primeProduct p B v₂ = b0Label p B (fun j => v₁ j + v₂ j) ε₁ ε₂ ^ 2 * j2Label p B (fun j => v₁ j + v₂ j) ε₁ ε₂ ^ 2 * squarefreeLabel p B (fun j => v₁ j + v₂ j) := by rw [← cube_product_decomposition p B (fun j => v₁ j + v₂ j) ε₁ ε₂ hv] simp only [primeProduct, pow_add, Finset.prod_mul_distrib] end Reassembly end FirstPassCubeLabels open scoped BigOperators Classical SchwartzMap namespace QuadraticInitialBound open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson open FiniteGaussPhase MixedCrossSeparation ActualEisensteinCoordinates QuadraticGaussRay open RayFourExpansion def quadraticSymbol {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (A B : Finset ι) : ℂ := quadraticRow (fun i => Ideal.span {p i}) hg A (∏ i ∈ B, p i) theorem quadraticSymbol_eq_cross_product {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (A B : Finset ι) : quadraticSymbol p hg A B = ∏ i ∈ A, ∏ k ∈ B, crossSymbol p hg i k ^ 3 := by simp only [quadraticSymbol, quadraticRow, finiteSquarefreeRow, map_prod, ← Finset.prod_pow, crossSymbol] theorem quadraticSymbol_mul_reverse {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (A B : Finset ι) : quadraticSymbol p hg A B * quadraticSymbol p hg B A = quadraticCrossPhase p hg A B := by rw [quadraticSymbol_eq_cross_product, quadraticSymbol_eq_cross_product] rw [Finset.prod_comm (s := B) (t := A)] simp only [quadraticCrossPhase, Finset.prod_mul_distrib] theorem quadraticSymbol_eq_zero_of_not_disjoint {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (A B : Finset ι) (h : ¬ Disjoint A B) : quadraticSymbol p hg A B = 0 := by obtain ⟨i, hiA, hiB⟩ := Finset.not_disjoint_iff.mp h rw [quadraticSymbol_eq_cross_product] apply Finset.prod_eq_zero hiA apply Finset.prod_eq_zero hiB have hz : Ideal.Quotient.mk (Ideal.span {p i}) (p i) = 0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.subset_span (by simp)) simp only [crossSymbol, hz, MulChar.map_zero, zero_pow (by decide : 3 ≠ 0)] theorem quadraticSymbol_sq_eq_one {ι : Type*} [Fintype ι] [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (A B : Finset ι) (hd : Disjoint A B) : quadraticSymbol p hg A B ^ 2 = 1 := by rw [quadraticSymbol_eq_cross_product, ← Finset.prod_pow] apply Finset.prod_eq_one intro i hi rw [← Finset.prod_pow] apply Finset.prod_eq_one intro k hk have hik : i ≠ k := by intro h subst k exact Finset.disjoint_left.mp hd hi hk rw [← pow_mul] simpa only [crossSymbol, show 3 * 2 = 6 by decide, map_pow, ite_eq_right (prime_generator_not_mem_other p hcop i k hik)] using canonicalSextic_sixth_power_mask (Ideal.span {p i}) (hg i) (p k) theorem quadraticSymbol_reciprocity {ι : Type*} [Fintype ι] [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (A B : Finset ι) : quadraticSymbol p hg A B = quadraticRayPair (residue (∏ i ∈ A, p i)) (residue (∏ i ∈ B, p i)) * quadraticSymbol p hg B A := by by_cases hd : Disjoint A B · have hprod := quadraticSymbol_mul_reverse p hg A B rw [quadraticCrossPhase_eq_rayPair p hp hcop hg hc A B hd] at hprod have hsq := quadraticSymbol_sq_eq_one p hcop hg B A hd.symm calc _ = quadraticSymbol p hg A B * (quadraticSymbol p hg B A) ^ 2 := by rw [hsq, mul_one] _ = _ := by rw [pow_two, ← mul_assoc, hprod] · rw [quadraticSymbol_eq_zero_of_not_disjoint p hg A B hd, quadraticSymbol_eq_zero_of_not_disjoint p hg B A (fun h => hd h.symm), mul_zero] theorem quadraticSymbol_reciprocity_characters {ι : Type*} [Fintype ι] [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (A B : Finset ι) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype quadraticSymbol p hg A B = ∑ χ : RayCharacter, ∑ η : RayCharacter, crossCoeff χ η * rayCharacter χ (∏ i ∈ A, p i) * rayCharacter η (∏ i ∈ B, p i) * quadraticSymbol p hg B A := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype rw [quadraticSymbol_reciprocity p hp hcop hg hc] have hr := quadraticRayPair_character_expansion (∏ i ∈ A, p i) (∏ i ∈ B, p i) rw [rayMask_prime_product p hc A, rayMask_prime_product p hc B, one_mul, one_mul] at hr rw [hr] simp only [Finset.sum_mul] end QuadraticInitialBound end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.CubeLabels namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid section open scoped BigOperators Classical namespace FirstPassCubeLabels open ActualEisensteinCubic open MixedCrossSeparation (crossSymbol quadraticCrossPhase) private theorem cross_sixth {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (i k : ι) (hik : i ≠ k) : crossSymbol p hg i k ^ 6 = 1 := by have hnot : p k ∉ Ideal.span {p i} := by intro hm have hle : Ideal.span {p k} ≤ Ideal.span {p i} := Ideal.span_le.mpr (Set.singleton_subset_iff.mpr hm) have ht := (hcop hik).sup_eq rw [sup_eq_left.mpr hle] at ht exact (inferInstance : (Ideal.span {p i}).IsMaximal).ne_top ht simpa only [crossSymbol, map_pow, ite_eq_right hnot] using canonicalSextic_sixth_power_mask (Ideal.span {p i}) (hg i) (p k) theorem reverse_cross_eq_quadratic {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (i k : ι) (hik : i ≠ k) : crossSymbol p hg k i = crossSymbol p hg i k * (crossSymbol p hg i k ^ 3 * crossSymbol p hg k i ^ 3) := by have hr : crossSymbol p hg i k ^ 2 = crossSymbol p hg k i ^ 2 := canonicalSextic_sq_reciprocity_primary (Ideal.span {p i}) (Ideal.span {p k}) (hg i) (hg k) (p i) (p k) rfl rfl (hpr i) (hpr k) symm calc _ = crossSymbol p hg i k ^ 4 * (crossSymbol p hg k i ^ 2 * crossSymbol p hg k i) := by ring _ = crossSymbol p hg i k ^ 6 * crossSymbol p hg k i := by rw [← hr]; ring _ = _ := by rw [cross_sixth p hcop hg i k hik, one_mul] private theorem local_quadratic_sq {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (i k : ι) (hik : i ≠ k) : (crossSymbol p hg i k ^ 3 * crossSymbol p hg k i ^ 3) ^ 2 = 1 := by rw [mul_pow, ← pow_mul, ← pow_mul] norm_num only [show 3 * 2 = 6 by decide, cross_sixth p hcop hg i k hik, cross_sixth p hcop hg k i hik.symm, one_mul] private theorem crt_exponent_table (side parityBit ε₁ ε₂ : Bool) (he : conductorExponent parityBit ε₁ ε₂ ≠ 0) : ((if side then 5 else 1) + (conductorExponent parityBit ε₁ ε₂).val) % 6 = ((if side then 5 else 1) * crtExponent side parityBit ε₁ ε₂) % 6 := by cases side <;> cases parityBit <;> cases ε₁ <;> cases ε₂ <;> first | exact False.elim (he (by decide)) | decide theorem active_cube_cross_local {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (i k : ι) (hik : i ≠ k) (side parityBit ε₁ ε₂ : Bool) (he : conductorExponent parityBit ε₁ ε₂ ≠ 0) : crossSymbol p hg i k ^ (if side then 5 else 1) * crossSymbol p hg k i ^ (conductorExponent parityBit ε₁ ε₂).val = (if side then star (crossSymbol p hg i k ^ crtExponent side parityBit ε₁ ε₂) else crossSymbol p hg i k ^ crtExponent side parityBit ε₁ ε₂) * (crossSymbol p hg i k ^ 3 * crossSymbol p hg k i ^ 3) ^ (conductorExponent parityBit ε₁ ε₂).val := by let x := crossSymbol p hg i k let q := crossSymbol p hg i k ^ 3 * crossSymbol p hg k i ^ 3 have hrev : crossSymbol p hg k i = x * q := reverse_cross_eq_quadratic p hcop hg hpr i k hik have h6 : x ^ 6 = 1 := cross_sixth p hcop hg i k hik have hs : star x = x ^ 5 := by have h := canonicalSextic_conj_as_row_label (Ideal.span {p i}) (hg i) (p k) change star x = x * x ^ 4 at h rw [h] ring calc _ = x ^ ((if side then 5 else 1) + (conductorExponent parityBit ε₁ ε₂).val) * q ^ (conductorExponent parityBit ε₁ ε₂).val := by rw [hrev, mul_pow, pow_add]; ring _ = _ := by congr 1 cases side · change x ^ (1 + (conductorExponent parityBit ε₁ ε₂).val) = x ^ crtExponent false parityBit ε₁ ε₂ conv_lhs => rw [pow_eq_pow_mod _ h6] conv_rhs => rw [pow_eq_pow_mod _ h6] congr 1 simpa only [Bool.false_eq_true, ↓reduceIte, one_mul] using crt_exponent_table false parityBit ε₁ ε₂ he · change x ^ (5 + (conductorExponent parityBit ε₁ ε₂).val) = star (x ^ crtExponent true parityBit ε₁ ε₂) rw [star_pow, hs, ← pow_mul] conv_lhs => rw [pow_eq_pow_mod _ h6] conv_rhs => rw [pow_eq_pow_mod _ h6] congr 1 exact crt_exponent_table true parityBit ε₁ ε₂ he def cubeOddSupport {ι : Type*} (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) : Finset ι := B.filter fun k => (conductorExponent (parity (v k)) (ε₁ k) (ε₂ k)).val % 2 = 1 def mixedCubeCross {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (U B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (side : Bool) : ℂ := ∏ i ∈ U, ∏ k ∈ B.filter (fun k => conductorExponent (parity (v k)) (ε₁ k) (ε₂ k) ≠ 0), crossSymbol p hg i k ^ (if side then 5 else 1) * crossSymbol p hg k i ^ (conductorExponent (parity (v k)) (ε₁ k) (ε₂ k)).val private theorem cube_cross_local_if {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (i k : ι) (hik : i ≠ k) (side parityBit ε₁ ε₂ : Bool) : (if conductorExponent parityBit ε₁ ε₂ ≠ 0 then crossSymbol p hg i k ^ (if side then 5 else 1) * crossSymbol p hg k i ^ (conductorExponent parityBit ε₁ ε₂).val else 1) = (if side then star (crossSymbol p hg i k ^ crtExponent side parityBit ε₁ ε₂) else crossSymbol p hg i k ^ crtExponent side parityBit ε₁ ε₂) * (if (conductorExponent parityBit ε₁ ε₂).val % 2 = 1 then crossSymbol p hg i k ^ 3 * crossSymbol p hg k i ^ 3 else 1) := by by_cases he : conductorExponent parityBit ε₁ ε₂ = 0 · simp [he, crtExponent] · rw [ite_eq_left he, active_cube_cross_local p hcop hg hpr i k hik side parityBit ε₁ ε₂ he] congr 1 rw [pow_eq_pow_mod _ (local_quadratic_sq p hcop hg i k hik)] by_cases ho : (conductorExponent parityBit ε₁ ε₂).val % 2 = 1 · simp [ho] · have hz : (conductorExponent parityBit ε₁ ε₂).val % 2 = 0 := by omega simp [ hz] theorem mixedCubeCross_eq_row_quadratic {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (U B : Finset ι) (hd : Disjoint U B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (side : Bool) : mixedCubeCross p hg U B v ε₁ ε₂ side = (if side then star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U (crtLabel p B v ε₁ ε₂ side)) else finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U (crtLabel p B v ε₁ ε₂ side)) * quadraticCrossPhase p hg U (cubeOddSupport B v ε₁ ε₂) := by have hr : finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U (crtLabel p B v ε₁ ε₂ side) = ∏ i ∈ U, ∏ k ∈ B, crossSymbol p hg i k ^ crtExponent side (parity (v k)) (ε₁ k) (ε₂ k) := by simp only [finiteSquarefreeRow, crtLabel, primeProduct, map_prod, map_pow, crossSymbol] calc _ = (∏ i ∈ U, ∏ k ∈ B, if side then star (crossSymbol p hg i k ^ crtExponent side (parity (v k)) (ε₁ k) (ε₂ k)) else crossSymbol p hg i k ^ crtExponent side (parity (v k)) (ε₁ k) (ε₂ k)) * (∏ i ∈ U, ∏ k ∈ B, if (conductorExponent (parity (v k)) (ε₁ k) (ε₂ k)).val % 2 = 1 then crossSymbol p hg i k ^ 3 * crossSymbol p hg k i ^ 3 else 1) := by simp only [mixedCubeCross, Finset.prod_filter, ← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i hi apply Finset.prod_congr rfl intro k hk apply cube_cross_local_if p hcop hg hpr i k exact fun he => Finset.disjoint_left.mp hd hi (he ▸ hk) _ = _ := by congr 1 · rw [hr] cases side <;> simp only [Bool.false_eq_true, ↓reduceIte, star_prod] · simp only [quadraticCrossPhase, cubeOddSupport, Finset.prod_filter] end FirstPassCubeLabels open scoped BigOperators Classical open UniqueFactorizationMonoid namespace QuadraticSquarefreeKernel abbrev O := ActualEisensteinCubic.O -- Backport of Mathlib Algebra/Squarefree/Basic, specialized to these ideals. private theorem exists_sq_mul_squarefree (x : Ideal O) : ∃ e d : Ideal O, e ^ 2 * d = x ∧ Squarefree d := by induction x using WfDvdMonoid.induction_on_irreducible with | zero => exact ⟨0, 1, by simp, squarefree_one⟩ | unit u hu => exact ⟨1, u, by rw [one_pow, one_mul], hu.squarefree⟩ | mul z p _hz hp ih => obtain ⟨e, d, rfl, hd⟩ := ih by_cases hpd : p ∣ d · obtain ⟨d', rfl⟩ := hpd exact ⟨e * p, d', by simp only [pow_two]; ac_rfl, hd.of_mul_right⟩ · refine ⟨e, d * p, by ac_rfl, ?_⟩ rw [squarefree_mul_iff] exact ⟨(hp.isRelPrime_iff_not_dvd.mpr hpd).symm, hd, hp.squarefree⟩ def squarePart (I : Ideal O) : Ideal O := (exists_sq_mul_squarefree I).choose def squarefreePart (I : Ideal O) : Ideal O := (exists_sq_mul_squarefree I).choose_spec.choose theorem squarePart_sq_mul_squarefreePart (I : Ideal O) : squarePart I ^ 2 * squarefreePart I = I := (exists_sq_mul_squarefree I).choose_spec.choose_spec.1 theorem squarefree_squarefreePart (I : Ideal O) : Squarefree (squarefreePart I) := (exists_sq_mul_squarefree I).choose_spec.choose_spec.2 theorem squarePart_ne_zero {I : Ideal O} (hI : I ≠ 0) : squarePart I ≠ 0 := by intro hz have h := squarePart_sq_mul_squarefreePart I rw [hz, zero_pow (by decide : 2 ≠ 0), zero_mul] at h exact hI h.symm theorem squarefree_decomposition_unique {A B D E : Ideal O} (hA : A ≠ 0) (hB : B ≠ 0) (hD : Squarefree D) (hE : Squarefree E) (h : A ^ 2 * D = B ^ 2 * E) : A = B ∧ D = E := by have hf := congrArg normalizedFactors h rw [normalizedFactors_mul (pow_ne_zero _ hA) hD.ne_zero, normalizedFactors_mul (pow_ne_zero _ hB) hE.ne_zero, normalizedFactors_pow, normalizedFactors_pow] at hf have hd := (squarefree_iff_nodup_normalizedFactors hD.ne_zero).mp hD have he := (squarefree_iff_nodup_normalizedFactors hE.ne_zero).mp hE have hcount (P : Ideal O) : (normalizedFactors A).count P = (normalizedFactors B).count P ∧ (normalizedFactors D).count P = (normalizedFactors E).count P := by have hc := congrArg (Multiset.count P) hf simp only [Multiset.count_add, Multiset.count_nsmul] at hc have hd1 := Multiset.nodup_iff_count_le_one.mp hd P have he1 := Multiset.nodup_iff_count_le_one.mp he P omega constructor · apply associated_iff_eq.mp apply (associated_iff_normalizedFactors_eq_normalizedFactors hA hB).mpr exact Multiset.ext.mpr (fun P => (hcount P).1) · apply associated_iff_eq.mp apply (associated_iff_normalizedFactors_eq_normalizedFactors hD.ne_zero hE.ne_zero).mpr exact Multiset.ext.mpr (fun P => (hcount P).2) theorem squarePart_mul_squarefree {A D : Ideal O} (hA : A ≠ 0) (hD : Squarefree D) : squarePart (A ^ 2 * D) = A ∧ squarefreePart (A ^ 2 * D) = D := squarefree_decomposition_unique (squarePart_ne_zero (mul_ne_zero (pow_ne_zero _ hA) hD.ne_zero)) hA (squarefree_squarefreePart _) hD (squarePart_sq_mul_squarefreePart _) def decompositionEquiv : {I : Ideal O // I ≠ 0} ≃ {A : Ideal O // A ≠ 0} × {D : Ideal O // Squarefree D} where toFun I := (⟨squarePart I.val, squarePart_ne_zero I.property⟩, ⟨squarefreePart I.val, squarefree_squarefreePart I.val⟩) invFun p := ⟨p.1.val ^ 2 * p.2.val, mul_ne_zero (pow_ne_zero _ p.1.property) p.2.property.ne_zero⟩ left_inv I := Subtype.ext (squarePart_sq_mul_squarefreePart I.val) right_inv p := by apply Prod.ext · exact Subtype.ext (squarePart_mul_squarefree p.1.property p.2.property).1 · exact Subtype.ext (squarePart_mul_squarefree p.1.property p.2.property).2 theorem norm_decomposition (I : Ideal O) : Ideal.absNorm (squarePart I) ^ 2 * Ideal.absNorm (squarefreePart I) = Ideal.absNorm I := by simpa only [map_mul, map_pow] using congrArg Ideal.absNorm (squarePart_sq_mul_squarefreePart I) open ActualEisensteinCubic QuadraticInitialBound CompletedGauss theorem quadraticRow_mul {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S : Finset ι) (a b : O) : quadraticRow P hg S (a * b) = quadraticRow P hg S a * quadraticRow P hg S b := by rw [quadraticRow, finiteSquarefreeRow_mul, mul_pow] rfl theorem quadraticRow_square {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S : Finset ι) (a : O) : quadraticRow P hg S (a ^ 2) = rowCoprimeMask P S a := by have heq : quadraticRow P hg S (a ^ 2) = finiteSquarefreeRow P hg S (a ^ 6) := by simp only [quadraticRow, finiteSquarefreeRow, map_pow, ← Finset.prod_pow, ← pow_mul] rw [heq, finiteSquarefreeRow_sixth_power] rfl end QuadraticSquarefreeKernel end namespace QuadraticMainBoundary open scoped BigOperators Classical open UniqueFactorizationMonoid abbrev O := ActualEisensteinCubic.O open QuadraticSquarefreeKernel def cutoffDifference (K : ℝ) (H D : Ideal O) : ℝ := (if (Ideal.absNorm (H * D) : ℝ) ≤ K then 1 else 0) - (if (Ideal.absNorm H : ℝ) ≤ K then 1 else 0) theorem norm_one_le {I : Ideal O} (hI : I ≠ 0) : 1 ≤ (Ideal.absNorm I : ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun h => hI (Ideal.absNorm_eq_zero_iff.mp h)) theorem cutoffDifference_nonzero_iff (K : ℝ) (H D : Ideal O) (hD : D ≠ 0) : cutoffDifference K H D ≠ 0 ↔ (Ideal.absNorm H : ℝ) ≤ K ∧ K < (Ideal.absNorm (H * D) : ℝ) := by have hmono : (Ideal.absNorm H : ℝ) ≤ Ideal.absNorm (H * D) := by rw [map_mul, Nat.cast_mul] nlinarith [norm_one_le hD, Nat.cast_nonneg (α := ℝ) (Ideal.absNorm H)] unfold cutoffDifference split_ifs <;> simp_all ; linarith theorem cutoffDifference_eq_neg_one_of_nonzero (K : ℝ) (H D : Ideal O) (hD : D ≠ 0) (h : cutoffDifference K H D ≠ 0) : cutoffDifference K H D = -1 := by obtain ⟨hH, hHD⟩ := (cutoffDifference_nonzero_iff K H D hD).mp h simp only [cutoffDifference, ite_eq_right (not_le.mpr hHD), ite_eq_left hH] norm_num theorem cutoffDifference_eq_zero_of_product_le (K : ℝ) {H D E : Ideal O} (hD : D ≠ 0) (hE : E ≠ 0) (hB : (Ideal.absNorm (H * D * E) : ℝ) ≤ K) : cutoffDifference K H D = 0 := by by_contra h have hh := (cutoffDifference_nonzero_iff K H D hD).mp h have he := norm_one_le hE rw [map_mul, Nat.cast_mul] at hB have hp := Nat.cast_nonneg (Ideal.absNorm (H * D)) (α := ℝ) nlinarith end QuadraticMainBoundary open scoped BigOperators Classical namespace QuadraticDivisorCancellation abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic ConcreteTraceCRT QuadraticInitialBound QuadraticSquarefreeKernel theorem double_divisor_factorization {κ : Type*} [DecidableEq κ] (z : κ → ℂ) (T U : Finset κ) (hTU : Disjoint T U) : (∑ D ∈ T.powerset, ∑ E ∈ (T ∪ U).powerset, (-1 : ℂ) ^ E.card * (∏ i ∈ D, z i) * ∏ i ∈ E, z i) = (∏ i ∈ T, (1 - z i ^ 2)) * ∑ E ∈ U.powerset, (-1 : ℂ) ^ E.card * ∏ i ∈ E, z i := by have hm (V : Finset κ) : (∑ E ∈ V.powerset, (-1 : ℂ) ^ E.card * ∏ i ∈ E, z i) = ∏ i ∈ V, (1 - z i) := by rw [Finset.prod_sub] simp only [Finset.prod_const_one, mul_one] calc _ = (∑ D ∈ T.powerset, ∏ i ∈ D, z i) * (∑ E ∈ (T ∪ U).powerset, (-1 : ℂ) ^ E.card * ∏ i ∈ E, z i) := by rw [Finset.sum_mul] apply Finset.sum_congr rfl intro D _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro E _ ring _ = (∏ i ∈ T, (1 + z i)) * ((∏ i ∈ T, (1 - z i)) * ∏ i ∈ U, (1 - z i)) := by rw [← Finset.prod_one_add, hm, Finset.prod_union hTU] _ = (∏ i ∈ T, (1 - z i ^ 2)) * ∏ i ∈ U, (1 - z i) := by rw [← mul_assoc, ← Finset.prod_mul_distrib] congr 1 apply Finset.prod_congr rfl intro i _ ring _ = _ := by rw [hm] end QuadraticDivisorCancellation end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.MainTermDifference namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace QuadraticMainTermDifference abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic QuadraticDivisorCancellation QuadraticMainBoundary end QuadraticMainTermDifference open scoped Classical FourierTransform SchwartzMap ContDiff Topology open MeasureTheory Filter namespace CubicReflectionKernel def realBeta (a b : ℝ) : ℝ := ∫ x : ℝ in 0..1, x ^ (a - 1) * (1 - x) ^ (b - 1) theorem betaIntegral_ofReal (a b : ℝ) : Complex.betaIntegral (a : ℂ) (b : ℂ) = (realBeta a b : ℂ) := by rw [Complex.betaIntegral, realBeta, ← intervalIntegral.integral_ofReal] apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) intro x hx dsimp only rw [Complex.ofReal_mul, Complex.ofReal_cpow hx.1.le, Complex.ofReal_cpow (sub_pos.mpr hx.2).le] push_cast rfl theorem norm_betaIntegral_le (u v : ℂ) : ‖Complex.betaIntegral u v‖ ≤ realBeta u.re v.re := by apply (intervalIntegral.norm_integral_le_integral_norm (by norm_num : (0 : ℝ) ≤ 1)).trans_eq apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) intro x hx dsimp only rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hx.1] have hcast : (1 - (x : ℂ)) = ((1 - x : ℝ) : ℂ) := by push_cast; rfl rw [hcast, Complex.norm_cpow_eq_rpow_re_of_pos (sub_pos.mpr hx.2)] simp theorem realBeta_eq_Gamma (a b : ℝ) (ha : 0 < a) (hb : 0 < b) : realBeta a b = Real.Gamma a * Real.Gamma b / Real.Gamma (a + b) := by apply Complex.ofReal_injective rw [← betaIntegral_ofReal] rw [Complex.betaIntegral_eq_Gamma_mul_div _ _ (by simpa using ha) (by simpa using hb)] rw [← Complex.ofReal_add] simp only [Complex.Gamma_ofReal, Complex.ofReal_div, Complex.ofReal_mul] theorem Gamma_ratio_eq_beta (z : ℂ) (d : ℝ) (hz : 0 < z.re) (hd : 0 < d) : Complex.Gamma z / Complex.Gamma (z + d) = Complex.betaIntegral z d / Complex.Gamma d := by rw [Complex.betaIntegral_eq_Gamma_mul_div _ _ hz (by simpa using hd)] have hdn : Complex.Gamma (d : ℂ) ≠ 0 := Complex.Gamma_ne_zero_of_re_pos (by simpa using hd) field_simp theorem Gamma_vertical_ratio_bound (a d t : ℝ) (ha : 0 < a) (hd : 0 < d) : ‖Complex.Gamma ((a : ℂ) + t * Complex.I) / Complex.Gamma ((a : ℂ) + t * Complex.I + d)‖ ≤ Real.Gamma a / Real.Gamma (a + d) := by rw [Gamma_ratio_eq_beta _ d (by simpa using ha) hd, norm_div] have hg := Real.Gamma_pos_of_pos hd have hb := norm_betaIntegral_le ((a : ℂ) + t * Complex.I) (d : ℂ) simp only [Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, mul_zero, zero_mul, sub_zero, add_zero] at hb rw [Complex.Gamma_ofReal, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hg] calc _ ≤ realBeta a d / Real.Gamma d := div_le_div_of_nonneg_right hb hg.le _ = _ := by rw [realBeta_eq_Gamma a d ha hd]; field_simp theorem inverse_Gamma_shift (z : ℂ) (n : ℕ) : (Complex.Gamma z)⁻¹ = (∏ k ∈ Finset.range n, (z + k)) * (Complex.Gamma (z + n))⁻¹ := by induction n with | zero => simp | succ n ih => rw [ih, Complex.one_div_Gamma_eq_self_mul_one_div_Gamma_add_one (z + n), Finset.prod_range_succ] push_cast ring_nf theorem Gamma_shifted_pair_bound (a σ t : ℝ) (n : ℕ) (ha : 0 < a + σ) (hd : 0 < (n : ℝ) - 2 * σ) : ‖Complex.Gamma ((a : ℂ) + (σ + t * Complex.I)) / Complex.Gamma ((a : ℂ) - (σ + t * Complex.I) + n)‖ ≤ Real.Gamma (a + σ) / Real.Gamma (a - σ + n) := by have hb := Gamma_vertical_ratio_bound (a + σ) ((n : ℝ) - 2 * σ) t ha hd have hn : ((a + σ : ℝ) : ℂ) + t * Complex.I = (a : ℂ) + (σ + t * Complex.I) := by push_cast; ring have hdp : ((a + σ : ℝ) : ℂ) + t * Complex.I + ((n : ℝ) - 2 * σ : ℝ) = ((a - σ + n : ℝ) : ℂ) + t * Complex.I := by push_cast; ring have hdm : (a : ℂ) - (σ + t * Complex.I) + n = ((a - σ + n : ℝ) : ℂ) - t * Complex.I := by push_cast; ring have hr : a + σ + ((n : ℝ) - 2 * σ) = a - σ + n := by ring rw [hdp, hn, hr] at hb rw [hdm, Gamma_vertical_conj, norm_div, norm_star] simpa only [norm_div] using hb theorem norm_Gamma_shift_factor (z : ℂ) (n : ℕ) : ‖∏ k ∈ Finset.range n, (z + k)‖ ≤ (‖z‖ + n) ^ n := by rw [norm_prod] calc _ ≤ ∏ _k ∈ Finset.range n, (‖z‖ + n) := by apply Finset.prod_le_prod₀ · intro k hk exact norm_nonneg _ · intro k hk have hk' : (k : ℝ) ≤ n := by exact_mod_cast (Finset.mem_range.mp hk).le exact (norm_add_le _ _).trans (by simpa using add_le_add_left hk' ‖z‖) _ = _ := by simp end CubicReflectionKernel open scoped Classical FourierTransform SchwartzMap ContDiff Topology open MeasureTheory Filter Set namespace CubicReflectionKernel theorem Gamma_pair_strip_bound (a : ℝ) (ha : 1 / 4 < a) (A : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ), ∀ t : ℝ, ‖Complex.Gamma ((a : ℂ) + (σ + t * Complex.I)) / Complex.Gamma ((a : ℂ) - (σ + t * Complex.I))‖ ≤ C * (1 + |t|) ^ (2 * A + 2) := by let n : ℕ := 2 * A + 2 let I : Set ℝ := Set.Icc (-(1 / 4 : ℝ)) (A : ℝ) have hapos (σ : ℝ) (hσ : σ ∈ I) : 0 < a + σ := by have := hσ.1 linarith have hdpos (σ : ℝ) (hσ : σ ∈ I) : 0 < (n : ℝ) - 2 * σ := by have := hσ.2 dsimp [n] push_cast linarith have hdenpos (σ : ℝ) (hσ : σ ∈ I) : 0 < a - σ + n := by have h1 := hapos σ hσ have h2 := hdpos σ hσ linarith have hc1 : ContinuousOn (fun σ : ℝ => Real.Gamma (a + σ)) I := Real.differentiableOn_Gamma_Ioi.continuousOn.comp (continuous_const.add continuous_id).continuousOn hapos have hc2 : ContinuousOn (fun σ : ℝ => Real.Gamma (a - σ + n)) I := Real.differentiableOn_Gamma_Ioi.continuousOn.comp ((continuous_const.sub continuous_id).add continuous_const).continuousOn hdenpos have hc : ContinuousOn (fun σ : ℝ => Real.Gamma (a + σ) / Real.Gamma (a - σ + n)) I := hc1.div hc2 (fun σ hσ => (Real.Gamma_pos_of_pos (hdenpos σ hσ)).ne') obtain ⟨C₀, hC₀⟩ := (isCompact_Icc : IsCompact I).bddAbove_image hc let C₁ : ℝ := |C₀| + 1 have hC₁ : 0 < C₁ := by dsimp [C₁]; positivity have hreal (σ : ℝ) (hσ : σ ∈ I) : Real.Gamma (a + σ) / Real.Gamma (a - σ + n) ≤ C₁ := by exact (hC₀ (Set.mem_image_of_mem _ hσ)).trans (by dsimp [C₁]; linarith [le_abs_self C₀]) let B : ℝ := |a| + A + 1 + n + 1 have hB : 0 < B := by dsimp [B]; positivity refine ⟨B ^ n * C₁, mul_pos (pow_pos hB n) hC₁, ?_⟩ intro σ hσ t have hσ' : σ ∈ I := hσ have hσabs : |σ| ≤ (A : ℝ) + 1 := by apply abs_le.mpr constructor <;> linarith [hσ.1, hσ.2, (Nat.cast_nonneg A : (0 : ℝ) ≤ A)] have hz : ‖(a : ℂ) - (σ + t * Complex.I)‖ ≤ |a| + A + 1 + |t| := by calc _ ≤ ‖(a : ℂ)‖ + ‖(σ : ℂ) + t * Complex.I‖ := norm_sub_le _ _ _ ≤ ‖(a : ℂ)‖ + (‖(σ : ℂ)‖ + ‖(t : ℂ) * Complex.I‖) := add_le_add le_rfl (norm_add_le _ _) _ = |a| + (|σ| + |t|) := by simp _ ≤ _ := by linarith have hzB : ‖(a : ℂ) - (σ + t * Complex.I)‖ + n ≤ B * (1 + |t|) := by dsimp [B] nlinarith [abs_nonneg a, abs_nonneg t, (Nat.cast_nonneg A : (0 : ℝ) ≤ A), (Nat.cast_nonneg n : (0 : ℝ) ≤ n)] have hprod : ‖∏ k ∈ Finset.range n, ((a : ℂ) - (σ + t * Complex.I) + k)‖ ≤ B ^ n * (1 + |t|) ^ n := by apply (norm_Gamma_shift_factor _ n).trans rw [← mul_pow] exact pow_le_pow_left₀ (by positivity) hzB n have hratio := (Gamma_shifted_pair_bound a σ t n (hapos σ hσ') (hdpos σ hσ')).trans (hreal σ hσ') have heq : Complex.Gamma ((a : ℂ) + (σ + t * Complex.I)) / Complex.Gamma ((a : ℂ) - (σ + t * Complex.I)) = (∏ k ∈ Finset.range n, ((a : ℂ) - (σ + t * Complex.I) + k)) * (Complex.Gamma ((a : ℂ) + (σ + t * Complex.I)) / Complex.Gamma ((a : ℂ) - (σ + t * Complex.I) + n)) := by rw [div_eq_mul_inv, inverse_Gamma_shift _ n, div_eq_mul_inv] ring rw [heq, norm_mul] calc _ ≤ (B ^ n * (1 + |t|) ^ n) * C₁ := mul_le_mul hprod hratio (norm_nonneg _) (by positivity) _ = _ := by dsimp [n]; ring theorem gammaMultiplier_strip_bound (A : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ), ∀ t : ℝ, ‖gammaMultiplier ((σ : ℂ) + t * Complex.I)‖ ≤ C * (1 + |t|) ^ (4 * A + 4) := by obtain ⟨C₁, hC₁, h1⟩ := Gamma_pair_strip_bound (7 / 6) (by norm_num) A obtain ⟨C₂, hC₂, h2⟩ := Gamma_pair_strip_bound (5 / 6) (by norm_num) A refine ⟨C₁ * C₂, mul_pos hC₁ hC₂, ?_⟩ intro σ hσ t have heq : gammaMultiplier ((σ : ℂ) + t * Complex.I) = (Complex.Gamma (((7 / 6 : ℝ) : ℂ) + (σ + t * Complex.I)) / Complex.Gamma (((7 / 6 : ℝ) : ℂ) - (σ + t * Complex.I))) * (Complex.Gamma (((5 / 6 : ℝ) : ℂ) + (σ + t * Complex.I)) / Complex.Gamma (((5 / 6 : ℝ) : ℂ) - (σ + t * Complex.I))) := by simp only [gammaMultiplier, Complex.ofReal_div, Complex.ofReal_ofNat] exact div_mul_div_comm _ _ _ _ |>.symm rw [heq, norm_mul] calc _ ≤ (C₁ * (1 + |t|) ^ (2 * A + 2)) * (C₂ * (1 + |t|) ^ (2 * A + 2)) := mul_le_mul (h1 σ hσ t) (h2 σ hσ t) (norm_nonneg _) (by positivity) _ = _ := by rw [mul_mul_mul_comm, ← pow_add] congr 2 omega theorem section_deriv_smooth (F : ℝ → ℝ → ℂ) (hF : ContDiff ℝ ∞ (Function.uncurry F)) : ContDiff ℝ ∞ (fun p : ℝ × ℝ => deriv (F p.1) p.2) := by have hFp : ContDiff ℝ ∞ (Function.uncurry (fun p : ℝ × ℝ => F p.1)) := hF.comp (contDiff_fst.fst.prodMk contDiff_snd) have hd := hFp.fderiv contDiff_snd (by simp : (∞ : ℕ∞ω) + 1 ≤ ∞) simpa only [deriv] using hd.clm_apply (contDiff_const (c := (1 : ℝ))) theorem section_iteratedDeriv_smooth (F : ℝ → ℝ → ℂ) (hF : ContDiff ℝ ∞ (Function.uncurry F)) (j : ℕ) : ContDiff ℝ ∞ (fun p : ℝ × ℝ => iteratedDeriv j (F p.1) p.2) := by induction j with | zero => simpa only [iteratedDeriv_zero, Function.uncurry_def] using hF | succ j ih => simpa only [iteratedDeriv_succ] using section_deriv_smooth (fun σ => iteratedDeriv j (F σ)) ih theorem tsupport_iteratedDeriv_subset (f : ℝ → ℂ) (j : ℕ) : tsupport (iteratedDeriv j f) ⊆ tsupport f := by induction j with | zero => simp | succ j ih => rw [iteratedDeriv_succ] exact tsupport_deriv_subset.trans ih theorem compact_family_deriv_integrable (F : ℝ → ℝ → ℂ) (hF : ContDiff ℝ ∞ (Function.uncurry F)) (K : Set ℝ) (hK : IsCompact K) (hsupp : ∀ σ, Function.support (F σ) ⊆ K) (σ : ℝ) (j : ℕ) : Integrable (iteratedDeriv j (F σ)) := by have hs : ContDiff ℝ ∞ (F σ) := hF.comp (contDiff_const.prodMk contDiff_id) have hc : HasCompactSupport (iteratedDeriv j (F σ)) := by apply HasCompactSupport.of_support_subset_isCompact hK exact (subset_tsupport _).trans ((tsupport_iteratedDeriv_subset (F σ) j).trans (closure_minimal (hsupp σ) hK.isClosed)) exact (hs.continuous_iteratedDeriv j (by exact_mod_cast (le_top : (j : ℕ∞) ≤ ⊤))).integrable_of_hasCompactSupport hc theorem compact_family_deriv_L1_bound (F : ℝ → ℝ → ℂ) (hF : ContDiff ℝ ∞ (Function.uncurry F)) (K : Set ℝ) (hK : IsCompact K) (hsupp : ∀ σ, Function.support (F σ) ⊆ K) (J : Set ℝ) (hJ : IsCompact J) (j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ J, (∫ u : ℝ, ‖iteratedDeriv j (F σ) u‖) ≤ C := by have hc := (section_iteratedDeriv_smooth F hF j).continuous.norm obtain ⟨M, hM⟩ := (hJ.prod hK).bddAbove_image hc.continuousOn let C : ℝ := (|M| + 1) * (volume.real K + 1) refine ⟨C, by dsimp [C]; positivity, ?_⟩ intro σ hσ have hbound : ∀ u ∈ K, ‖iteratedDeriv j (F σ) u‖ ≤ |M| + 1 := by intro u hu exact (hM (Set.mem_image_of_mem _ (show (σ, u) ∈ J ×ˢ K from ⟨hσ, hu⟩))).trans (by linarith [le_abs_self M]) have hs : Function.support (iteratedDeriv j (F σ)) ⊆ K := (subset_tsupport _).trans ((tsupport_iteratedDeriv_subset (F σ) j).trans (closure_minimal (hsupp σ) hK.isClosed)) have hzero : ∀ u, u ∉ K → ‖iteratedDeriv j (F σ) u‖ = 0 := by intro u hu have hz : iteratedDeriv j (F σ) u = 0 := by by_contra hn exact hu (hs hn) simp [hz] have hi := norm_setIntegral_le_of_norm_le_const («μ» := volume) (f := fun u => ‖iteratedDeriv j (F σ) u‖) hK.measure_lt_top (C := |M| + 1) (fun u hu => by simpa using hbound u hu) rw [setIntegral_eq_integral_of_forall_compl_eq_zero hzero] at hi rw [Real.norm_of_nonneg (integral_nonneg (fun u => norm_nonneg _))] at hi exact hi.trans (by dsimp [C]; nlinarith [abs_nonneg M]) theorem compact_family_fourier_power_bound (F : ℝ → ℝ → ℂ) (hF : ContDiff ℝ ∞ (Function.uncurry F)) (K : Set ℝ) (hK : IsCompact K) (hsupp : ∀ σ, Function.support (F σ) ⊆ K) (J : Set ℝ) (hJ : IsCompact J) (j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ J, ∀ w : ℝ, |w| ^ j * ‖𝓕 (F σ) w‖ ≤ C := by obtain ⟨C, hC, hb⟩ := compact_family_deriv_L1_bound F hF K hK hsupp J hJ j refine ⟨C / (2 * Real.pi) ^ j, by positivity, ?_⟩ intro σ hσ w have hs : ContDiff ℝ ∞ (F σ) := hF.comp (contDiff_const.prodMk contDiff_id) have hfour := Real.fourier_iteratedDeriv (N := (⊤ : ℕ∞)) hs (fun k _ => compact_family_deriv_integrable F hF K hK hsupp σ k) (by simp : (j : ℕ∞) ≤ ⊤) have hid : (2 * Real.pi) ^ j * (|w| ^ j * ‖𝓕 (F σ) w‖) = ‖𝓕 (iteratedDeriv j (F σ)) w‖ := by rw [hfour] simp only [norm_smul, norm_pow, norm_mul, Complex.norm_I, mul_one, Complex.norm_real, Real.norm_eq_abs, abs_of_pos Real.pi_pos] norm_num ring have hn : ‖𝓕 (iteratedDeriv j (F σ)) w‖ ≤ C := by apply (VectorFourier.norm_fourierIntegral_le_integral_norm Real.fourierChar volume (innerₗ ℝ) (iteratedDeriv j (F σ)) w).trans exact hb σ hσ apply (le_div_iff₀ (by positivity : 0 < (2 * Real.pi) ^ j)).mpr rw [← hid] at hn calc _ = (2 * Real.pi) ^ j * (|w| ^ j * ‖𝓕 (F σ) w‖) := mul_comm _ _ _ ≤ C := hn theorem compact_family_fourier_weighted_bound (F : ℝ → ℝ → ℂ) (hF : ContDiff ℝ ∞ (Function.uncurry F)) (K : Set ℝ) (hK : IsCompact K) (hsupp : ∀ σ, Function.support (F σ) ⊆ K) (J : Set ℝ) (hJ : IsCompact J) (j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ J, ∀ w : ℝ, (1 + |w|) ^ j * ‖𝓕 (F σ) w‖ ≤ C := by obtain ⟨C₀, hC₀, h0⟩ := compact_family_fourier_power_bound F hF K hK hsupp J hJ 0 obtain ⟨Cj, hCj, hj⟩ := compact_family_fourier_power_bound F hF K hK hsupp J hJ j refine ⟨2 ^ j * (C₀ + Cj), by positivity, ?_⟩ intro σ hσ w have hbase : ‖𝓕 (F σ) w‖ ≤ C₀ := by simpa using h0 σ hσ w by_cases hw : |w| ≤ 1 · calc _ ≤ 2 ^ j * ‖𝓕 (F σ) w‖ := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (by positivity) (by linarith) j) (norm_nonneg _) _ ≤ 2 ^ j * C₀ := mul_le_mul_of_nonneg_left hbase (by positivity) _ ≤ _ := mul_le_mul_of_nonneg_left (by linarith) (by positivity) · have hw' : 1 ≤ |w| := le_of_lt (lt_of_not_ge hw) calc _ ≤ (2 * |w|) ^ j * ‖𝓕 (F σ) w‖ := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (by positivity) (by linarith) j) (norm_nonneg _) _ = 2 ^ j * (|w| ^ j * ‖𝓕 (F σ) w‖) := by rw [mul_pow, mul_assoc] _ ≤ 2 ^ j * Cj := mul_le_mul_of_nonneg_left (hj σ hσ w) (by positivity) _ ≤ _ := mul_le_mul_of_nonneg_left (by linarith) (by positivity) def mellinLogFamily (V : ℝ → ℂ) (σ u : ℝ) : ℂ := Real.exp (-σ * u) • V (Real.exp (-u)) theorem mellinLogFamily_smooth (V : ℝ → ℂ) (hV : ContDiff ℝ ∞ V) : ContDiff ℝ ∞ (Function.uncurry (mellinLogFamily V)) := by change ContDiff ℝ ∞ (fun p : ℝ × ℝ => Real.exp (-p.1 * p.2) • V (Real.exp (-p.2))) exact (Real.contDiff_exp.comp (contDiff_fst.neg.mul contDiff_snd)).smul (hV.comp (Real.contDiff_exp.comp contDiff_snd.neg)) theorem mellinLogFamily_support (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (σ : ℝ) : Function.support (mellinLogFamily V σ) ⊆ Set.Icc (-Real.log b) (-Real.log a) := by intro u hu have hv : V (Real.exp (-u)) ≠ 0 := by intro hv exact hu (by simp [mellinLogFamily, hv]) have hm := hsupp hv have hlow := Real.log_le_log ha hm.1 have hhigh := Real.log_le_log (Real.exp_pos (-u)) hm.2 simp only [Real.log_exp] at hlow hhigh constructor <;> linarith theorem mellin_eq_logFamily_fourier (V : ℝ → ℂ) (σ t : ℝ) : mellin V ((σ : ℂ) + t * Complex.I) = 𝓕 (mellinLogFamily V σ) (t / (2 * Real.pi)) := by rw [mellin_eq_fourier] simp only [Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, mul_zero, sub_zero, add_zero, Complex.add_im, Complex.mul_im, Complex.I_im, mul_one, zero_add] rfl theorem compact_source_mellin_strip_decay (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (lo hi : ℝ) (j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ Set.Icc lo hi, ∀ t : ℝ, (1 + |t|) ^ j * ‖mellin V ((σ : ℂ) + t * Complex.I)‖ ≤ C := by obtain ⟨C, hC, hb⟩ := compact_family_fourier_weighted_bound (mellinLogFamily V) (mellinLogFamily_smooth V hV) (Set.Icc (-Real.log b) (-Real.log a)) isCompact_Icc (mellinLogFamily_support V a b ha hsupp) (Set.Icc lo hi) isCompact_Icc j refine ⟨(1 + 2 * Real.pi) ^ j * C, by positivity, ?_⟩ intro σ hσ t rw [mellin_eq_logFamily_fourier] have ht : |t| = (2 * Real.pi) * |t / (2 * Real.pi)| := by rw [abs_div, abs_of_pos (by positivity : 0 < 2 * Real.pi)] field_simp have hbase : 1 + |t| ≤ (1 + 2 * Real.pi) * (1 + |t / (2 * Real.pi)|) := by rw [ht] nlinarith [Real.pi_pos, abs_nonneg (t / (2 * Real.pi))] calc _ ≤ ((1 + 2 * Real.pi) * (1 + |t / (2 * Real.pi)|)) ^ j * ‖𝓕 (mellinLogFamily V σ) (t / (2 * Real.pi))‖ := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (by positivity) hbase j) (norm_nonneg _) _ = (1 + 2 * Real.pi) ^ j * ((1 + |t / (2 * Real.pi)|) ^ j * ‖𝓕 (mellinLogFamily V σ) (t / (2 * Real.pi))‖) := by rw [mul_pow, mul_assoc] _ ≤ _ := mul_le_mul_of_nonneg_left (hb σ hσ _) (by positivity) end CubicReflectionKernel open scoped Classical FourierTransform SchwartzMap ContDiff Topology open MeasureTheory Filter Set namespace CubicReflectionKernel def mellinData (V : ℝ → ℂ) (s : ℂ) : ℂ := mellin V (-s) * gammaMultiplier s def mellinEulerData (V : ℝ → ℂ) (j : ℕ) (s : ℂ) : ℂ := (-s) ^ j * mellinData V s theorem mellinData_strip_decay (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (A j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ), ∀ t : ℝ, (1 + |t|) ^ j * ‖mellinData V ((σ : ℂ) + t * Complex.I)‖ ≤ C := by let g : ℕ := 4 * A + 4 obtain ⟨Cγ, hCγ, hγ⟩ := gammaMultiplier_strip_bound A obtain ⟨CV, hCV, hVb⟩ := compact_source_mellin_strip_decay V a b ha hsupp hV (-(A : ℝ)) (1 / 4) (g + j) refine ⟨Cγ * CV, mul_pos hCγ hCV, ?_⟩ intro σ hσ t have hσ' : -σ ∈ Set.Icc (-(A : ℝ)) (1 / 4) := by constructor <;> linarith [hσ.1, hσ.2] have hmb := hVb (-σ) hσ' (-t) have heq : (-σ : ℝ) + (-t : ℝ) * Complex.I = -((σ : ℂ) + t * Complex.I) := by push_cast ring rw [heq, abs_neg] at hmb have hgb : ‖gammaMultiplier ((σ : ℂ) + t * Complex.I)‖ ≤ Cγ * (1 + |t|) ^ g := hγ σ hσ t rw [mellinData, norm_mul] calc _ = ((1 + |t|) ^ j * ‖mellin V (-((σ : ℂ) + t * Complex.I))‖) * ‖gammaMultiplier ((σ : ℂ) + t * Complex.I)‖ := by ring _ ≤ ((1 + |t|) ^ j * ‖mellin V (-((σ : ℂ) + t * Complex.I))‖) * (Cγ * (1 + |t|) ^ g) := mul_le_mul_of_nonneg_left hgb (by positivity) _ = Cγ * ((1 + |t|) ^ (g + j) * ‖mellin V (-((σ : ℂ) + t * Complex.I))‖) := by rw [pow_add] ring _ ≤ _ := mul_le_mul_of_nonneg_left hmb hCγ.le theorem weighted_two_to_cauchy {C B : ℝ} (hB : 0 ≤ B) (t : ℝ) (h : (1 + |t|) ^ 2 * B ≤ C) : B ≤ C / (1 + t ^ 2) := by apply (le_div_iff₀ (by positivity : 0 < 1 + t ^ 2)).mpr have hpow : 1 + t ^ 2 ≤ (1 + |t|) ^ 2 := by nlinarith [abs_nonneg t, sq_abs t] exact (mul_le_mul_of_nonneg_left hpow hB).trans (by simpa only [mul_comm] using h) theorem mellinEulerData_strip_bound (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (A j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ), ∀ t : ℝ, ‖mellinEulerData V j ((σ : ℂ) + t * Complex.I)‖ ≤ C / (1 + t ^ 2) := by obtain ⟨C, hC, hb⟩ := mellinData_strip_decay V a b ha hsupp hV A (j + 2) refine ⟨((A : ℝ) + 2) ^ j * C, by positivity, ?_⟩ intro σ hσ t apply weighted_two_to_cauchy (norm_nonneg _) t have hσabs : |σ| ≤ (A : ℝ) + 1 := by apply abs_le.mpr constructor <;> linarith [hσ.1, hσ.2, (Nat.cast_nonneg A : (0 : ℝ) ≤ A)] have hz : ‖(σ : ℂ) + t * Complex.I‖ ≤ ((A : ℝ) + 2) * (1 + |t|) := by have hnorm := norm_add_le (σ : ℂ) ((t : ℂ) * Complex.I) simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, Complex.norm_I, mul_one] at hnorm nlinarith [abs_nonneg t, (Nat.cast_nonneg A : (0 : ℝ) ≤ A)] rw [mellinEulerData, norm_mul, norm_pow, norm_neg] calc _ ≤ (1 + |t|) ^ 2 * ((((A : ℝ) + 2) * (1 + |t|)) ^ j * ‖mellinData V ((σ : ℂ) + t * Complex.I)‖) := by gcongr _ = ((A : ℝ) + 2) ^ j * ((1 + |t|) ^ (j + 2) * ‖mellinData V ((σ : ℂ) + t * Complex.I)‖) := by rw [mul_pow, pow_add]; ring _ ≤ _ := mul_le_mul_of_nonneg_left (hb σ hσ t) (by positivity) theorem mellinEulerData_differentiableAt (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (j : ℕ) (s : ℂ) (hs : -(5 / 6 : ℝ) < s.re) : DifferentiableAt ℂ (mellinEulerData V j) s := (differentiableAt_id.neg.pow j).mul (kernelMellinIntegrand_differentiableAt V a b ha hsupp hV s hs) theorem mellinEulerData_vertical_integrable (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (A j : ℕ) (σ : ℝ) (hσ : σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ)) : Integrable (fun t : ℝ => mellinEulerData V j ((σ : ℂ) + t * Complex.I)) := by obtain ⟨C, hC, hb⟩ := mellinEulerData_strip_bound V a b ha hsupp hV A j have hc : Continuous (fun t : ℝ => mellinEulerData V j ((σ : ℂ) + t * Complex.I)) := by apply continuous_iff_continuousAt.mpr intro t apply (mellinEulerData_differentiableAt V a b ha hsupp hV j _ ?_).continuousAt.comp · fun_prop · simp only [Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, mul_zero, zero_mul, sub_zero, add_zero] linarith [hσ.1] apply (integrable_inv_one_add_sq.const_mul C).mono' hc.aestronglyMeasurable exact Filter.Eventually.of_forall (fun t => by simpa only [div_eq_mul_inv] using hb σ hσ t) end CubicReflectionKernel end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.InverseContour namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid namespace CubicReflectionKernel open scoped Classical FourierTransform SchwartzMap ContDiff Topology open MeasureTheory Filter Set def inverseMellinIntegrand (V : ℝ → ℂ) (j : ℕ) (y : ℝ) (s : ℂ) : ℂ := (y : ℂ) ^ (-s) * mellinEulerData V j s theorem inverseMellinIntegrand_differentiableAt (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (j : ℕ) (y : ℝ) (hy : 0 < y) (s : ℂ) (hs : -(5 / 6 : ℝ) < s.re) : DifferentiableAt ℂ (inverseMellinIntegrand V j y) s := by exact (differentiableAt_id.neg.const_cpow (Or.inl (Complex.ofReal_ne_zero.mpr hy.ne'))).mul (mellinEulerData_differentiableAt V a b ha hsupp hV j s hs) theorem inverseMellinIntegrand_vertical_integrable (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (A j : ℕ) (σ : ℝ) (hσ : σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ)) (y : ℝ) (hy : 0 < y) : Integrable (fun t : ℝ => inverseMellinIntegrand V j y ((σ : ℂ) + t * Complex.I)) := by apply (mellinEulerData_vertical_integrable V a b ha hsupp hV A j σ hσ).bdd_mul (c := y ^ (-σ)) · exact ((show Continuous (fun t : ℝ => -((σ : ℂ) + t * Complex.I)) by fun_prop).const_cpow (Or.inl (Complex.ofReal_ne_zero.mpr hy.ne'))).aestronglyMeasurable · filter_upwards [] with t rw [Complex.norm_cpow_eq_rpow_re_of_pos hy] simp theorem inverseMellinIntegrand_strip_bound (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (A j : ℕ) (y : ℝ) (hy : 0 < y) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ), ∀ t : ℝ, ‖inverseMellinIntegrand V j y ((σ : ℂ) + t * Complex.I)‖ ≤ C / (1 + t ^ 2) := by obtain ⟨C, hC, hb⟩ := mellinEulerData_strip_bound V a b ha hsupp hV A j have hc : Continuous (fun σ : ℝ => y ^ (-σ)) := (Real.continuous_const_rpow hy.ne').comp continuous_neg obtain ⟨B, hB⟩ := (isCompact_Icc : IsCompact (Set.Icc (-(1 / 4 : ℝ)) (A : ℝ))).bddAbove_image hc.continuousOn refine ⟨(|B| + 1) * C, by positivity, ?_⟩ intro σ hσ t have hby : y ^ (-σ) ≤ |B| + 1 := (hB (Set.mem_image_of_mem _ hσ)).trans (by linarith [le_abs_self B]) rw [inverseMellinIntegrand, norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hy] simp only [Complex.neg_re, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, mul_zero, zero_mul, sub_zero, add_zero] calc _ ≤ (|B| + 1) * (C / (1 + t ^ 2)) := mul_le_mul hby (hb σ hσ t) (norm_nonneg _) (by positivity) _ = _ := by ring theorem mellinInv_euler_shift (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (A j : ℕ) (σ : ℝ) (hσ : σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ)) (y : ℝ) (hy : 0 < y) : mellinInv 0 (mellinEulerData V j) y = mellinInv σ (mellinEulerData V j) y := by obtain ⟨C, hC, hb⟩ := inverseMellinIntegrand_strip_bound V a b ha hsupp hV A j y hy have h0 : (0 : ℝ) ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ) := by constructor · norm_num · exact Nat.cast_nonneg A have hshift (ρ : ℝ) (hρ : ρ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ)) : (∫ t : ℝ, inverseMellinIntegrand V j y ((-(1 / 4) : ℝ) + t * Complex.I)) = ∫ t : ℝ, inverseMellinIntegrand V j y ((ρ : ℂ) + t * Complex.I) := by apply VerticalContourShift.integral_eq_of_strip_decay (inverseMellinIntegrand V j y) (-(1 / 4)) ρ C hρ.1 · intro z hzlo hzhi apply inverseMellinIntegrand_differentiableAt V a b ha hsupp hV j y hy z linarith · apply inverseMellinIntegrand_vertical_integrable V a b ha hsupp hV A j (-(1 / 4)) ⟨le_rfl, hρ.1.trans hρ.2⟩ y hy · exact inverseMellinIntegrand_vertical_integrable V a b ha hsupp hV A j ρ hρ y hy · intro r hr t exact hb r ⟨hr.1, hr.2.trans hρ.2⟩ t have heq := (hshift 0 h0).symm.trans (hshift σ hσ) simpa only [mellinInv, smul_eq_mul, inverseMellinIntegrand] using congrArg (fun z : ℂ => (1 / (2 * Real.pi) : ℝ) • z) heq theorem mellinInv_euler_line_bound (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (A j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ), ∀ y : ℝ, 0 < y → ‖mellinInv σ (mellinEulerData V j) y‖ ≤ C * y ^ (-σ) := by obtain ⟨C, hC, hb⟩ := mellinEulerData_strip_bound V a b ha hsupp hV A j refine ⟨C / 2, by positivity, ?_⟩ intro σ hσ y hy have hint : ‖∫ t : ℝ, (y : ℂ) ^ (-((σ : ℂ) + t * Complex.I)) * mellinEulerData V j ((σ : ℂ) + t * Complex.I)‖ ≤ (y ^ (-σ) * C) * Real.pi := by calc _ ≤ ∫ t : ℝ, (y ^ (-σ) * C) * (1 + t ^ 2)⁻¹ := by apply norm_integral_le_of_norm_le (integrable_inv_one_add_sq.const_mul _) filter_upwards [] with t rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hy] simp only [Complex.neg_re, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, mul_zero, zero_mul, sub_zero, add_zero] simpa only [div_eq_mul_inv, mul_assoc] using mul_le_mul_of_nonneg_left (hb σ hσ t) (Real.rpow_nonneg hy.le (-σ)) _ = _ := by rw [integral_const_mul, integral_univ_inv_one_add_sq] rw [mellinInv, norm_smul, Real.norm_of_nonneg (by positivity : (0 : ℝ) ≤ 1 / (2 * Real.pi))] simp only [smul_eq_mul] calc _ ≤ (1 / (2 * Real.pi)) * ((y ^ (-σ) * C) * Real.pi) := mul_le_mul_of_nonneg_left hint (by positivity) _ = _ := by field_simp def paperEulerKernel (V : ℝ → ℂ) (j : ℕ) (x : ℝ) : ℂ := mellinInv 0 (mellinEulerData V j) (paperScale * x) theorem mellinEulerData_axis (V : ℝ → ℂ) (logSource : SchwartzMap ℝ ℂ) (hlog : ∀ u, logSource u = V (Real.exp u)) (j : ℕ) (u : ℝ) : mellinEulerData V j (2 * Real.pi * u * Complex.I) = (-2 * Real.pi * Complex.I * u) ^ j * spectralProfile logSource u := by have hu : (2 * Real.pi * u * Complex.I : ℂ) = ((2 * Real.pi * u : ℝ) : ℂ) * Complex.I := by push_cast; ring rw [mellinEulerData, mellinData, hu, mellin_axis_eq_fourier V logSource hlog] have hb : -(((2 * Real.pi * u : ℝ) : ℂ) * Complex.I) = -2 * Real.pi * Complex.I * u := by push_cast; ring rw [hb, spectralProfile, axisMultiplier] ring theorem paperEulerKernel_eq_euler (V : ℝ → ℂ) (logSource : SchwartzMap ℝ ℂ) (hlog : ∀ u, logSource u = V (Real.exp u)) (j : ℕ) (x : ℝ) (hx : 0 < x) : paperEulerKernel V j x = LocalLogFourier.eulerDeriv (paperKernel V) j x := by rw [paperKernel_euler_eq V logSource hlog j x hx, reflectedLogProfile_deriv] unfold paperEulerKernel rw [mellinInv_eq_fourierInv 0 _ (mul_pos paperScale_pos hx)] simp only [Complex.ofReal_zero, neg_zero, Complex.cpow_zero, one_smul, Real.fourierInv_eq_fourier_neg, neg_neg, zero_add] have hfun : (fun u : ℝ => mellinEulerData V j (2 * Real.pi * u * Complex.I)) = (fun u : ℝ => (-2 * Real.pi * Complex.I * u) ^ j * spectralProfile logSource u) := by funext u exact mellinEulerData_axis V logSource hlog j u rw [hfun] theorem paperKernel_euler_decay_at_line (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (A j : ℕ) (σ : ℝ) (hσ : σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ)) : ∃ C : ℝ, 0 < C ∧ ∀ x : ℝ, 0 < x → ‖LocalLogFourier.eulerDeriv (paperKernel V) j x‖ ≤ C * x ^ (-σ) := by obtain ⟨C, hC, hb⟩ := mellinInv_euler_line_bound V a b ha hsupp hV A j refine ⟨C * paperScale ^ (-σ), mul_pos hC (Real.rpow_pos_of_pos paperScale_pos _), ?_⟩ intro x hx rw [← paperEulerKernel_eq_euler V (logSchwartz V a b ha hsupp hV) (by intro u; rfl) j x hx] unfold paperEulerKernel rw [mellinInv_euler_shift V a b ha hsupp hV A j σ hσ _ (mul_pos paperScale_pos hx)] have hbound := hb σ hσ (paperScale * x) (mul_pos paperScale_pos hx) rw [Real.mul_rpow paperScale_pos.le hx.le] at hbound simpa only [mul_assoc] using hbound theorem paperKernel_euler_power_decay (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (A j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ x : ℝ, 0 < x → (‖LocalLogFourier.eulerDeriv (paperKernel V) j x‖ ≤ C * x ^ (1 / 4 : ℝ)) ∧ (‖LocalLogFourier.eulerDeriv (paperKernel V) j x‖ ≤ C * x ^ (-(A : ℝ))) := by have hleft : -(1 / 4 : ℝ) ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ) := by constructor · rfl · linarith [show (0 : ℝ) ≤ A from Nat.cast_nonneg A] have hright : (A : ℝ) ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ) := by constructor · linarith [show (0 : ℝ) ≤ A from Nat.cast_nonneg A] · rfl obtain ⟨CL, hCL, hL⟩ := paperKernel_euler_decay_at_line V a b ha hsupp hV A j _ hleft obtain ⟨CR, hCR, hR⟩ := paperKernel_euler_decay_at_line V a b ha hsupp hV A j _ hright refine ⟨max CL CR, lt_of_lt_of_le hCL (le_max_left _ _), ?_⟩ intro x hx constructor · have hh : ‖LocalLogFourier.eulerDeriv (paperKernel V) j x‖ ≤ CL * x ^ (1 / 4 : ℝ) := by simpa only [neg_neg] using hL x hx exact hh.trans (mul_le_mul_of_nonneg_right (le_max_left CL CR) (Real.rpow_nonneg hx.le _)) · exact (hR x hx).trans (mul_le_mul_of_nonneg_right (le_max_right CL CR) (Real.rpow_nonneg hx.le _)) theorem paperKernel_euler_uniform_weighted_bound (V : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hsupp : Function.support V ⊆ Set.Icc a b) (hV : ContDiff ℝ ∞ V) (A K : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ i ≤ K, ∀ x : ℝ, 0 < x → (1 + x) ^ A * ‖LocalLogFourier.eulerDeriv (paperKernel V) i x‖ ≤ C := by choose c hc hb using fun i : Fin (K + 1) => paperKernel_euler_power_decay V a b ha hsupp hV A i.val let D : ℝ := (∑ i : Fin (K + 1), c i) + 1 have hD : 0 < D := by have hs : (0 : ℝ) ≤ ∑ i : Fin (K + 1), c i := Finset.sum_nonneg (fun i _ => (hc i).le) dsimp [D] linarith have hci (i : Fin (K + 1)) : c i ≤ D := by have hs : c i ≤ ∑ k : Fin (K + 1), c k := Finset.single_le_sum (fun k _ => (hc k).le) (Finset.mem_univ i) dsimp [D] linarith have hsmall : ∀ i ≤ K, ∀ x : ℝ, 0 < x → x ≤ 1 → ‖LocalLogFourier.eulerDeriv (paperKernel V) i x‖ ≤ D := by intro i hi x hx hx1 let k : Fin (K + 1) := ⟨i, by omega⟩ have hp : x ^ (1 / 4 : ℝ) ≤ 1 := Real.rpow_le_one hx.le hx1 (by norm_num) calc _ ≤ c k * x ^ (1 / 4 : ℝ) := (hb k x hx).1 _ ≤ c k := by simpa using mul_le_mul_of_nonneg_left hp (hc k).le _ ≤ D := hci k have hlarge : ∀ i ≤ K, ∀ x : ℝ, 1 ≤ x → x ^ A * ‖LocalLogFourier.eulerDeriv (paperKernel V) i x‖ ≤ D := by intro i hi x hx1 have hx : 0 < x := lt_of_lt_of_le zero_lt_one hx1 let k : Fin (K + 1) := ⟨i, by omega⟩ have hxpow : x ^ A ≠ 0 := pow_ne_zero A hx.ne' calc _ ≤ x ^ A * (c k * x ^ (-(A : ℝ))) := mul_le_mul_of_nonneg_left (hb k x hx).2 (pow_nonneg hx.le A) _ = c k := by rw [Real.rpow_neg hx.le, Real.rpow_natCast] field_simp _ ≤ D := hci k refine ⟨2 ^ A * (D + D), by positivity, ?_⟩ intro i hi x hx exact LocalLogFourier.euler_two_regime_bound (paperKernel V) A K D D hD.le hD.le hsmall hlarge i hi x hx end CubicReflectionKernel namespace DescentFiberCost open scoped BigOperators Classical open ConcretePrimeRowBridge abbrev O := ActualEisensteinCubic.O theorem finite_ideal_count_real (s : Finset (Ideal O)) (H : ℝ) (hH : 1 ≤ H) (hpos : ∀ I ∈ s, I ≠ ⊥) (hN : ∀ I ∈ s, (Ideal.absNorm I : ℝ) ≤ H) : (s.card : ℝ) ≤ 128 * H := by have hs : s ⊆ idealsUpTo ⌊H⌋₊ := by intro I hI apply mem_idealsUpTo.mpr refine ⟨?_, Nat.le_floor (hN I hI)⟩ exact Nat.one_le_iff_ne_zero.mpr (fun h => hpos I hI (Ideal.absNorm_eq_zero_iff.mp h)) have hc := (Finset.card_le_card hs).trans (CompactScaleBridge.idealsUpTo_card_le ⌊H⌋₊) have hfloor : (⌊H⌋₊ : ℝ) ≤ H := Nat.floor_le (by linarith) have hr : (s.card : ℝ) ≤ 64 * ((⌊H⌋₊ : ℝ) + 1) := by exact_mod_cast hc linarith theorem fixed_triple_count (s : Finset (Ideal O × Ideal O × Ideal O)) (B T W : ℝ) (hB : 1 ≤ B) (hT : 1 ≤ T) (hW : 1 ≤ W) (hpos : ∀ x ∈ s, x.1 ≠ ⊥ ∧ x.2.1 ≠ ⊥ ∧ x.2.2 ≠ ⊥) (hN : ∀ x ∈ s, (Ideal.absNorm x.1 : ℝ) ≤ B ∧ (Ideal.absNorm x.2.1 : ℝ) ≤ T ∧ (Ideal.absNorm x.2.2 : ℝ) ≤ W) : (s.card : ℝ) ≤ 128 ^ 3 * B * T * W := by let a := s.image Prod.fst let b := s.image (fun x => x.2.1) let c := s.image (fun x => x.2.2) have hsub : s ⊆ a ×ˢ (b ×ˢ c) := by intro x hx exact Finset.mem_product.mpr ⟨Finset.mem_image.mpr ⟨x, hx, rfl⟩, Finset.mem_product.mpr ⟨Finset.mem_image.mpr ⟨x, hx, rfl⟩, Finset.mem_image.mpr ⟨x, hx, rfl⟩⟩⟩ have ha : (a.card : ℝ) ≤ 128 * B := by apply finite_ideal_count_real a B hB · intro I hI obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp hI exact (hpos x hx).1 · intro I hI obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp hI exact (hN x hx).1 have hb : (b.card : ℝ) ≤ 128 * T := by apply finite_ideal_count_real b T hT · intro I hI obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp hI exact (hpos x hx).2.1 · intro I hI obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp hI exact (hN x hx).2.1 have hc : (c.card : ℝ) ≤ 128 * W := by apply finite_ideal_count_real c W hW · intro I hI obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp hI exact (hpos x hx).2.2 · intro I hI obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp hI exact (hN x hx).2.2 have hs : (s.card : ℝ) ≤ (a.card : ℝ) * ((b.card : ℝ) * c.card) := by have hcard := Finset.card_le_card hsub simp only [Finset.card_product] at hcard exact_mod_cast hcard apply hs.trans calc _ ≤ (128 * B) * ((128 * T) * (128 * W)) := by gcongr _ = _ := by ring end DescentFiberCost namespace EisensteinSchwartzPoisson open MeasureTheory Set open scoped FourierTransform SchwartzMap RealInnerProductSpace theorem fourier_real_line_integrable (f : 𝓢(ℂ, ℂ)) : Integrable (fun x : ℝ => 𝓕 (f : ℂ → ℂ) (x : ℂ)) := by have h : Integrable (fun x : ℝ => horizontalSlice (𝓕 f) 0 x) := (horizontalSlice (𝓕 f) 0).integrable simpa only [horizontalSlice_apply, complexPoint_eq, mul_zero, add_zero, Complex.ofReal_zero, SchwartzMap.fourier_coe] using h theorem fourier_real_line_integral (f : 𝓢(ℂ, ℂ)) : (∫ x : ℝ, 𝓕 (f : ℂ → ℂ) (x : ℂ)) = ∫ y : ℝ, f (Complex.I * (y : ℂ)) := by let g : ℝ → ℂ := partialFourier f 0 have hF : 𝓕 g = fun x : ℝ => 𝓕 (f : ℂ → ℂ) (x : ℂ) := by funext x simpa only [g, complexPoint_eq, Complex.ofReal_zero, mul_zero, add_zero] using fourier_partialFourier f x 0 have hgi : Integrable (𝓕 g) := by rw [hF]; exact fourier_real_line_integrable f have hinv : 𝓕⁻ (𝓕 g) (0 : ℝ) = g 0 := (partialFourier_integrable f 0).fourierInv_fourier_eq hgi (partialFourier_continuous f 0).continuousAt calc _ = ∫ x : ℝ, 𝓕 g x := by rw [hF] _ = 𝓕⁻ (𝓕 g) 0 := by simp [Real.fourierInv_eq] _ = g 0 := hinv _ = _ := by simp [g, partialFourier_eq_integral, complexPoint_eq] theorem paperFrequency_imaginary (x : ℝ) : paperFrequency ((x : ℂ) * Complex.I) = (((2 / Real.sqrt 3) * x : ℝ) : ℂ) := by simp [paperFrequency] ring_nf simp theorem paperRadialFourier_square (W : ℝ → ℂ) (x : ℝ) : paperRadialFourier W (x ^ 2) = (2 / Real.sqrt 3 : ℝ) • 𝓕 (fun z : ℂ => W (‖z‖ ^ 2)) ((((2 / Real.sqrt 3) * x : ℝ) : ℂ)) := by have h := paperFourier_radial W ((x : ℂ) * Complex.I) have hn : ‖(x : ℂ) * Complex.I‖ ^ 2 = x ^ 2 := by simp [ Complex.norm_real, Real.norm_eq_abs, sq_abs] rw [hn, paperFourier_eq_standard, paperFrequency_imaginary] at h exact h.symm theorem radial_square_integrable (W : 𝓢(ℝ, ℂ)) : Integrable (fun x : ℝ => W (x ^ 2)) := by have h : Integrable (fun x : ℝ => horizontalSlice (radialTest W) 0 x) := (horizontalSlice (radialTest W) 0).integrable simpa [horizontalSlice_apply, complexPoint_eq, radialTest_apply, Complex.norm_real, Real.norm_eq_abs, sq_abs] using h theorem paperRadialFourier_square_integrable (W : 𝓢(ℝ, ℂ)) : Integrable (fun x : ℝ => paperRadialFourier W (x ^ 2)) := by have he : (radialTest W : ℂ → ℂ) = fun z : ℂ => W (‖z‖ ^ 2) := rfl have hc : (2 / Real.sqrt 3 : ℝ) ≠ 0 := by positivity have h := ((fourier_real_line_integrable (radialTest W)).comp_mul_left' hc).smul (2 / Real.sqrt 3 : ℝ) change Integrable (fun x : ℝ => (2 / Real.sqrt 3 : ℝ) • 𝓕 (radialTest W : ℂ → ℂ) ((((2 / Real.sqrt 3) * x : ℝ) : ℂ))) at h simpa only [paperRadialFourier_square, he] using h theorem paperRadialFourier_square_integral (W : 𝓢(ℝ, ℂ)) : (∫ x : ℝ, paperRadialFourier W (x ^ 2)) = ∫ x : ℝ, W (x ^ 2) := by have hc : (0 : ℝ) < 2 / Real.sqrt 3 := by positivity have he : (radialTest W : ℂ → ℂ) = fun z : ℂ => W (‖z‖ ^ 2) := rfl calc _ = (2 / Real.sqrt 3 : ℝ) • ∫ x : ℝ, 𝓕 (radialTest W : ℂ → ℂ) ((((2 / Real.sqrt 3) * x : ℝ) : ℂ)) := by simp only [paperRadialFourier_square, he, integral_smul] _ = ∫ x : ℝ, 𝓕 (radialTest W : ℂ → ℂ) (x : ℂ) := by rw [Measure.integral_comp_mul_left (fun x : ℝ => 𝓕 (radialTest W : ℂ → ℂ) (x : ℂ)) (2 / Real.sqrt 3)] rw [abs_of_pos (inv_pos.mpr hc), smul_smul, mul_inv_cancel₀ hc.ne', one_smul] _ = ∫ y : ℝ, radialTest W (Complex.I * (y : ℂ)) := fourier_real_line_integral _ _ = _ := by apply integral_congr_ae filter_upwards [] with y simp [radialTest_apply, Complex.norm_real, Real.norm_eq_abs, sq_abs] theorem integral_even_eq_twice_Ioi (F : ℝ → ℂ) (hF : Integrable F) (heven : ∀ x : ℝ, F (-x) = F x) : (∫ x : ℝ, F x) = 2 * ∫ x : ℝ in Ioi 0, F x := by have hneg : (∫ x : ℝ in Iic 0, F x) = ∫ x : ℝ in Ioi 0, F x := by calc _ = ∫ x : ℝ in Ioi 0, F (-x) := by simp _ = _ := setIntegral_congr_fun measurableSet_Ioi (fun x _ => heven x) rw [← integral_add_compl (s := Ioi 0) measurableSet_Ioi hF, compl_Ioi, hneg] ring theorem paperRadialFourier_halfline_integral (W : 𝓢(ℝ, ℂ)) : (∫ x : ℝ in Ioi 0, paperRadialFourier W (x ^ 2)) = ∫ x : ℝ in Ioi 0, W (x ^ 2) := by have h := paperRadialFourier_square_integral W rw [integral_even_eq_twice_Ioi _ (paperRadialFourier_square_integrable W) (by intro x; simp), integral_even_eq_twice_Ioi _ (radial_square_integrable W) (by intro x; simp)] at h exact mul_left_cancel₀ (by norm_num : (2 : ℂ) ≠ 0) h end EisensteinSchwartzPoisson open scoped Classical FourierTransform SchwartzMap ContDiff Topology open MeasureTheory Filter Set namespace CubicReflectionKernel def logRadius (a b : ℝ) : ℝ := |Real.log a| + |Real.log b| + 1 theorem logRadius_pos (a b : ℝ) : 0 < logRadius a b := by unfold logRadius; positivity def logCutoff (a b : ℝ) : ContDiffBump (0 : ℝ) where rIn := logRadius a b rOut := logRadius a b + 1 rIn_pos := logRadius_pos a b rIn_lt_rOut := by linarith def logOuterCutoff (a b : ℝ) : ContDiffBump (0 : ℝ) where rIn := logRadius a b + 1 rOut := logRadius a b + 2 rIn_pos := by have := logRadius_pos a b; linarith rIn_lt_rOut := by linarith def expCorrection (a b u : ℝ) : ℝ := logOuterCutoff a b u * (Real.exp u - u) def patchedExp (a b u : ℝ) : ℝ := u + expCorrection a b u theorem expCorrection_compact (a b : ℝ) : HasCompactSupport (expCorrection a b) := (logOuterCutoff a b).hasCompactSupport.mul_right theorem expCorrection_smooth (a b : ℝ) : ContDiff ℝ ∞ (expCorrection a b) := (logOuterCutoff a b).contDiff.mul (Real.contDiff_exp.sub contDiff_id) theorem patchedExp_temperate (a b : ℝ) : Function.HasTemperateGrowth (patchedExp a b) := Function.HasTemperateGrowth.id'.add ((expCorrection_compact a b).hasTemperateGrowth (expCorrection_smooth a b)) theorem patchedExp_proper (a b : ℝ) : ∃ (k : ℕ) (C : ℝ), ∀ u : ℝ, ‖u‖ ≤ C * (1 + ‖patchedExp a b u‖) ^ k := by obtain ⟨u₀, hu₀⟩ := (expCorrection_smooth a b).continuous.norm.exists_forall_ge_of_hasCompactSupport (expCorrection_compact a b).norm refine ⟨1, ‖expCorrection a b u₀‖ + 1, ?_⟩ intro u have htriangle : ‖u‖ ≤ ‖patchedExp a b u‖ + ‖expCorrection a b u‖ := by simpa only [patchedExp, add_sub_cancel_right] using norm_sub_le (patchedExp a b u) (expCorrection a b u) have hbound := hu₀ u simp only [pow_one] nlinarith [norm_nonneg (patchedExp a b u), norm_nonneg (expCorrection a b u₀)] def logPullbackCLM (a b : ℝ) : SchwartzMap ℝ ℂ →L[ℝ] SchwartzMap ℝ ℂ := (SchwartzMap.smulLeftCLM ℂ (logCutoff a b)).comp (SchwartzMap.compCLM ℝ (patchedExp_temperate a b) (patchedExp_proper a b)) theorem logPullbackCLM_apply (a b : ℝ) (W : SchwartzMap ℝ ℂ) (u : ℝ) : logPullbackCLM a b W u = logCutoff a b u • W (patchedExp a b u) := by rw [logPullbackCLM, ContinuousLinearMap.comp_apply, SchwartzMap.smulLeftCLM_apply_apply ((logCutoff a b).hasCompactSupport.hasTemperateGrowth (logCutoff a b).contDiff)] rfl theorem logCutoff_eq_one_of_source (a b : ℝ) (ha : 0 < a) (u : ℝ) (hu : Real.exp u ∈ Set.Icc a b) : logCutoff a b u = 1 := by apply (logCutoff a b).one_of_mem_closedBall have hl := Real.log_le_log ha hu.1 have hr := Real.log_le_log (Real.exp_pos u) hu.2 simp only [Real.log_exp] at hl hr change dist u 0 ≤ logRadius a b rw [Real.dist_eq, sub_zero] apply abs_le.mpr constructor <;> dsimp [logRadius] <;> linarith [neg_abs_le (Real.log a), le_abs_self (Real.log b), abs_nonneg (Real.log a), abs_nonneg (Real.log b)] theorem patchedExp_eq_exp_of_cutoff_ne_zero (a b u : ℝ) (hu : logCutoff a b u ≠ 0) : patchedExp a b u = Real.exp u := by have hmem : u ∈ Function.support (logCutoff a b) := hu rw [(logCutoff a b).support_eq] at hmem have heta : logOuterCutoff a b u = 1 := by apply (logOuterCutoff a b).one_of_mem_closedBall change dist u 0 ≤ logRadius a b + 1 change dist u 0 < logRadius a b + 1 at hmem exact le_of_lt hmem simp [patchedExp, expCorrection, heta] theorem logPullbackCLM_eq_actual (a b : ℝ) (ha : 0 < a) (W : SchwartzMap ℝ ℂ) (hsupp : Function.support (W : ℝ → ℂ) ⊆ Set.Icc a b) (u : ℝ) : logPullbackCLM a b W u = W (Real.exp u) := by rw [logPullbackCLM_apply] by_cases hW : W (Real.exp u) = 0 · by_cases hcut : logCutoff a b u = 0 · simp [hcut, hW] · rw [patchedExp_eq_exp_of_cutoff_ne_zero a b u hcut, hW, smul_zero] · have hcut := logCutoff_eq_one_of_source a b ha u (hsupp hW) rw [patchedExp_eq_exp_of_cutoff_ne_zero a b u (by rw [hcut]; norm_num), hcut, one_smul] end CubicReflectionKernel open scoped Classical FourierTransform SchwartzMap ContDiff Topology open MeasureTheory Filter Set namespace CubicReflectionKernel theorem compact_family_deriv_sup_bound (F : ℝ → ℝ → ℂ) (hF : ContDiff ℝ ∞ (Function.uncurry F)) (K : Set ℝ) (hK : IsCompact K) (hsupp : ∀ σ, Function.support (F σ) ⊆ K) (J : Set ℝ) (hJ : IsCompact J) (j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ σ ∈ J, ∀ u : ℝ, ‖iteratedFDeriv ℝ j (F σ) u‖ ≤ C := by have hc := (section_iteratedDeriv_smooth F hF j).continuous.norm obtain ⟨M, hM⟩ := (hJ.prod hK).bddAbove_image hc.continuousOn refine ⟨|M| + 1, by positivity, ?_⟩ intro σ hσ u rw [norm_iteratedFDeriv_eq_norm_iteratedDeriv] by_cases hu : u ∈ K · exact (hM (Set.mem_image_of_mem _ (show (σ, u) ∈ J ×ˢ K from ⟨hσ, hu⟩))).trans (by linarith [le_abs_self M]) · have hs : Function.support (iteratedDeriv j (F σ)) ⊆ K := (subset_tsupport _).trans ((tsupport_iteratedDeriv_subset (F σ) j).trans (closure_minimal (hsupp σ) hK.isClosed)) have hz : iteratedDeriv j (F σ) u = 0 := by by_contra hn; exact hu (hs hn) simp only [hz, norm_zero] positivity theorem compact_family_mul_deriv_L1_source_bound (F : ℝ → ℝ → ℂ) (hF : ContDiff ℝ ∞ (Function.uncurry F)) (K : Set ℝ) (hK : IsCompact K) (hsupp : ∀ σ, Function.support (F σ) ⊆ K) (J : Set ℝ) (hJ : IsCompact J) (j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ W : SchwartzMap ℝ ℂ, ∀ σ ∈ J, (∫ u : ℝ, ‖iteratedDeriv j (fun u => F σ u * W u) u‖) ≤ C * (Finset.Iic (0, j)).sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by choose c hc hcb using fun i : Fin (j + 1) => compact_family_deriv_sup_bound F hF K hK hsupp J hJ i.val let D := (∑ i : Fin (j + 1), c i) + 1 have hD : 0 < D := by have : 0 ≤ ∑ i : Fin (j + 1), c i := Finset.sum_nonneg (fun i _ => (hc i).le) dsimp [D] linarith have hder (i : ℕ) (hi : i ≤ j) (σ : ℝ) (hσ : σ ∈ J) (u : ℝ) : ‖iteratedFDeriv ℝ i (F σ) u‖ ≤ D := by let k : Fin (j + 1) := ⟨i, by omega⟩ have hsum : c k ≤ ∑ l : Fin (j + 1), c l := Finset.single_le_sum (fun l _ => (hc l).le) (Finset.mem_univ k) exact (hcb k σ hσ u).trans (by dsimp [D]; linarith) let B : ℝ := ∑ i ∈ Finset.range (j + 1), (j.choose i : ℝ) * D have hB : 0 ≤ B := by dsimp [B]; positivity refine ⟨(B + 1) * (volume.real K + 1), by positivity, ?_⟩ intro W σ hσ let S : ℝ := (Finset.Iic (0, j)).sup (schwartzSeminormFamily ℝ ℝ ℂ) W have hS : 0 ≤ S := by dsimp [S]; positivity have hWder (k : ℕ) (hk : k ≤ j) (u : ℝ) : ‖iteratedFDeriv ℝ k W u‖ ≤ S := by have hle : schwartzSeminormFamily ℝ ℝ ℂ (0, k) ≤ (Finset.Iic (0, j)).sup (schwartzSeminormFamily ℝ ℝ ℂ) := Finset.le_sup (f := schwartzSeminormFamily ℝ ℝ ℂ) (by simp [hk]) exact (SchwartzMap.norm_iteratedFDeriv_le_seminorm ℝ W k u).trans (Seminorm.le_def.mp hle W) have hb (u : ℝ) : ‖iteratedDeriv j (fun u => F σ u * W u) u‖ ≤ (B + 1) * S := by rw [← norm_iteratedFDeriv_eq_norm_iteratedDeriv] have hfσ : ContDiff ℝ ∞ (F σ) := hF.comp (contDiff_const.prodMk contDiff_id) apply (norm_iteratedFDeriv_mul_le hfσ (W.smooth ⊤) u (n := j) (by exact_mod_cast (le_top : (j : ℕ∞) ≤ ⊤))).trans calc _ ≤ ∑ i ∈ Finset.range (j + 1), (j.choose i : ℝ) * D * S := by apply Finset.sum_le_sum intro i hi exact mul_le_mul (mul_le_mul_of_nonneg_left (hder i (Nat.le_of_lt_succ (Finset.mem_range.mp hi)) σ hσ u) (by positivity)) (hWder (j - i) (Nat.sub_le _ _) u) (norm_nonneg _) (by positivity) _ = B * S := by rw [← Finset.sum_mul] _ ≤ (B + 1) * S := mul_le_mul_of_nonneg_right (by linarith) hS have hmul : Function.support (fun u => F σ u * W u) ⊆ K := by intro u hu exact hsupp σ (mul_ne_zero_iff.mp hu).1 have hs : Function.support (iteratedDeriv j (fun u => F σ u * W u)) ⊆ K := (subset_tsupport _).trans ((tsupport_iteratedDeriv_subset _ j).trans (closure_minimal hmul hK.isClosed)) have hzero : ∀ u, u ∉ K → ‖iteratedDeriv j (fun u => F σ u * W u) u‖ = 0 := by intro u hu have hz : iteratedDeriv j (fun u => F σ u * W u) u = 0 := by by_contra hn; exact hu (hs hn) simp [hz] have hi := norm_setIntegral_le_of_norm_le_const («μ» := volume) (f := fun u => ‖iteratedDeriv j (fun u => F σ u * W u) u‖) hK.measure_lt_top (C := (B + 1) * S) (fun u _ => by simpa using hb u) rw [setIntegral_eq_integral_of_forall_compl_eq_zero hzero, Real.norm_of_nonneg (integral_nonneg (fun u => norm_nonneg _))] at hi calc _ ≤ ((B + 1) * S) * volume.real K := hi _ ≤ ((B + 1) * S) * (volume.real K + 1) := by gcongr; linarith _ = _ := by dsimp [S]; ring end CubicReflectionKernel end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.UniformKernelBounds namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid namespace CubicReflectionKernel open scoped Classical FourierTransform SchwartzMap ContDiff Topology open MeasureTheory Filter Set theorem compact_family_mul_fourier_power_source_bound (F : ℝ → ℝ → ℂ) (hF : ContDiff ℝ ∞ (Function.uncurry F)) (K : Set ℝ) (hK : IsCompact K) (hsupp : ∀ σ, Function.support (F σ) ⊆ K) (J : Set ℝ) (hJ : IsCompact J) (j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ W : SchwartzMap ℝ ℂ, ∀ σ ∈ J, ∀ w : ℝ, |w| ^ j * ‖𝓕 (fun u => F σ u * W u) w‖ ≤ C * (Finset.Iic (0, j)).sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by obtain ⟨C, hC, hb⟩ := compact_family_mul_deriv_L1_source_bound F hF K hK hsupp J hJ j refine ⟨C / (2 * Real.pi) ^ j, by positivity, ?_⟩ intro W σ hσ w have hFW : ContDiff ℝ ∞ (Function.uncurry (fun σ u => F σ u * W u)) := hF.mul ((W.smooth ⊤).comp contDiff_snd) have hsupport : ∀ σ, Function.support (fun u => F σ u * W u) ⊆ K := by intro σ u hu exact hsupp σ (mul_ne_zero_iff.mp hu).1 have hs : ContDiff ℝ ∞ (fun u => F σ u * W u) := hFW.comp (contDiff_const.prodMk contDiff_id) have hfour := Real.fourier_iteratedDeriv (N := (⊤ : ℕ∞)) hs (fun k _ => compact_family_deriv_integrable (fun σ u => F σ u * W u) hFW K hK hsupport σ k) (by simp : (j : ℕ∞) ≤ ⊤) have hid : (2 * Real.pi) ^ j * (|w| ^ j * ‖𝓕 (fun u => F σ u * W u) w‖) = ‖𝓕 (iteratedDeriv j (fun u => F σ u * W u)) w‖ := by rw [hfour] simp only [norm_smul, norm_pow, norm_mul, Complex.norm_I, mul_one, Complex.norm_real, Real.norm_eq_abs, abs_of_pos Real.pi_pos] norm_num ring have hn : ‖𝓕 (iteratedDeriv j (fun u => F σ u * W u)) w‖ ≤ C * (Finset.Iic (0, j)).sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by apply (VectorFourier.norm_fourierIntegral_le_integral_norm Real.fourierChar volume (innerₗ ℝ) (iteratedDeriv j (fun u => F σ u * W u)) w).trans exact hb W σ hσ rw [div_mul_eq_mul_div] apply (le_div_iff₀ (by positivity : 0 < (2 * Real.pi) ^ j)).mpr rw [← hid] at hn calc _ = (2 * Real.pi) ^ j * (|w| ^ j * ‖𝓕 (fun u => F σ u * W u) w‖) := mul_comm _ _ _ ≤ _ := hn theorem compact_family_mul_fourier_weighted_source_bound (F : ℝ → ℝ → ℂ) (hF : ContDiff ℝ ∞ (Function.uncurry F)) (K : Set ℝ) (hK : IsCompact K) (hsupp : ∀ σ, Function.support (F σ) ⊆ K) (J : Set ℝ) (hJ : IsCompact J) (j : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ W : SchwartzMap ℝ ℂ, ∀ σ ∈ J, ∀ w : ℝ, (1 + |w|) ^ j * ‖𝓕 (fun u => F σ u * W u) w‖ ≤ C * (Finset.Iic (0, j)).sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by obtain ⟨C₀, hC₀, h0⟩ := compact_family_mul_fourier_power_source_bound F hF K hK hsupp J hJ 0 obtain ⟨Cj, hCj, hj⟩ := compact_family_mul_fourier_power_source_bound F hF K hK hsupp J hJ j refine ⟨2 ^ j * (C₀ + Cj), by positivity, ?_⟩ intro W σ hσ w let S := (Finset.Iic (0, j)).sup (schwartzSeminormFamily ℝ ℝ ℂ) W have hS : 0 ≤ S := by dsimp [S]; positivity have hsubset : Finset.Iic (0, 0) ⊆ Finset.Iic (0, j) := by intro p hp exact Finset.mem_Iic.mpr ((Finset.mem_Iic.mp hp).trans (by simp)) have hseminorm : (Finset.Iic (0, 0)).sup (schwartzSeminormFamily ℝ ℝ ℂ) W ≤ S := Seminorm.le_def.mp (Finset.sup_mono hsubset) W have hbase : ‖𝓕 (fun u => F σ u * W u) w‖ ≤ C₀ * S := by have hh : ‖𝓕 (fun u => F σ u * W u) w‖ ≤ C₀ * (Finset.Iic (0, 0)).sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by simpa using h0 W σ hσ w exact hh.trans (mul_le_mul_of_nonneg_left hseminorm hC₀.le) have hpower : |w| ^ j * ‖𝓕 (fun u => F σ u * W u) w‖ ≤ Cj * S := hj W σ hσ w by_cases hw : |w| ≤ 1 · calc _ ≤ 2 ^ j * ‖𝓕 (fun u => F σ u * W u) w‖ := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (by positivity) (by linarith) j) (norm_nonneg _) _ ≤ 2 ^ j * (C₀ * S) := mul_le_mul_of_nonneg_left hbase (by positivity) _ ≤ 2 ^ j * ((C₀ + Cj) * S) := by gcongr; linarith _ = _ := by dsimp [S]; ring · have hw' : 1 ≤ |w| := le_of_lt (lt_of_not_ge hw) calc _ ≤ (2 * |w|) ^ j * ‖𝓕 (fun u => F σ u * W u) w‖ := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (by positivity) (by linarith) j) (norm_nonneg _) _ = 2 ^ j * (|w| ^ j * ‖𝓕 (fun u => F σ u * W u) w‖) := by rw [mul_pow, mul_assoc] _ ≤ 2 ^ j * (Cj * S) := mul_le_mul_of_nonneg_left hpower (by positivity) _ ≤ 2 ^ j * ((C₀ + Cj) * S) := by gcongr; linarith _ = _ := by dsimp [S]; ring def negativeLogPullbackCLM (a b : ℝ) : SchwartzMap ℝ ℂ →L[ℝ] SchwartzMap ℝ ℂ := (SchwartzMap.compCLMOfContinuousLinearEquiv ℝ (LinearIsometryEquiv.neg ℝ).toContinuousLinearEquiv).comp (logPullbackCLM a b) theorem negativeLogPullbackCLM_eq_actual (a b : ℝ) (ha : 0 < a) (W : SchwartzMap ℝ ℂ) (hsupp : Function.support (W : ℝ → ℂ) ⊆ Set.Icc a b) (u : ℝ) : negativeLogPullbackCLM a b W u = W (Real.exp (-u)) := by change logPullbackCLM a b W (-u) = _ exact logPullbackCLM_eq_actual a b ha W hsupp (-u) def logWeight (a b σ u : ℝ) : ℂ := (Real.exp (-σ * u) * logCutoff a b (-u) : ℝ) theorem logWeight_smooth (a b : ℝ) : ContDiff ℝ ∞ (Function.uncurry (logWeight a b)) := by change ContDiff ℝ ∞ (fun p : ℝ × ℝ => ((Real.exp (-p.1 * p.2) * logCutoff a b (-p.2) : ℝ) : ℂ)) exact Complex.ofRealCLM.contDiff.comp ((Real.contDiff_exp.comp (contDiff_fst.neg.mul contDiff_snd)).mul ((logCutoff a b).contDiff.comp contDiff_snd.neg)) theorem logWeight_support (a b σ : ℝ) : Function.support (logWeight a b σ) ⊆ Metric.closedBall 0 (logRadius a b + 1) := by intro u hu have hc : logCutoff a b (-u) ≠ 0 := by intro hc exact hu (by simp [logWeight, hc]) have hm : -u ∈ Function.support (logCutoff a b) := hc rw [(logCutoff a b).support_eq] at hm change dist (-u) 0 < logRadius a b + 1 at hm change dist u 0 ≤ logRadius a b + 1 simpa only [dist_zero_right, norm_neg] using hm.le theorem logWeight_mul_pullback (a b : ℝ) (ha : 0 < a) (W : SchwartzMap ℝ ℂ) (hsupp : Function.support (W : ℝ → ℂ) ⊆ Set.Icc a b) (σ u : ℝ) : logWeight a b σ u * negativeLogPullbackCLM a b W u = mellinLogFamily W σ u := by rw [negativeLogPullbackCLM_eq_actual a b ha W hsupp] by_cases hW : W (Real.exp (-u)) = 0 · simp [logWeight, mellinLogFamily, hW] · have hc := logCutoff_eq_one_of_source a b ha (-u) (hsupp hW) simp [logWeight, mellinLogFamily, hc] theorem mellin_strip_source_bound (a b : ℝ) (ha : 0 < a) (lo hi : ℝ) (j : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ W : SchwartzMap ℝ ℂ, Function.support (W : ℝ → ℂ) ⊆ Set.Icc a b → ∀ σ ∈ Set.Icc lo hi, ∀ t : ℝ, (1 + |t|) ^ j * ‖mellin W ((σ : ℂ) + t * Complex.I)‖ ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by obtain ⟨C, hC, hb⟩ := compact_family_mul_fourier_weighted_source_bound (logWeight a b) (logWeight_smooth a b) (Metric.closedBall 0 (logRadius a b + 1)) (isCompact_closedBall _ _) (logWeight_support a b) (Set.Icc lo hi) isCompact_Icc j obtain ⟨s, D, hD, hDbd⟩ := EisensteinSchwartzPoisson.schwartzCLM_finite_seminorm_control (negativeLogPullbackCLM a b) (Finset.Iic (0, j)) refine ⟨s, (1 + 2 * Real.pi) ^ j * C * D, by positivity, ?_⟩ intro W hsupp σ hσ t have hfun : (fun u => logWeight a b σ u * negativeLogPullbackCLM a b W u) = mellinLogFamily W σ := funext (logWeight_mul_pullback a b ha W hsupp σ) have hfour := hb (negativeLogPullbackCLM a b W) σ hσ (t / (2 * Real.pi)) rw [hfun] at hfour have ht : |t| = (2 * Real.pi) * |t / (2 * Real.pi)| := by rw [abs_div, abs_of_pos (by positivity : 0 < 2 * Real.pi)] field_simp have hbase : 1 + |t| ≤ (1 + 2 * Real.pi) * (1 + |t / (2 * Real.pi)|) := by rw [ht] nlinarith [Real.pi_pos, abs_nonneg (t / (2 * Real.pi))] rw [mellin_eq_logFamily_fourier] calc _ ≤ ((1 + 2 * Real.pi) * (1 + |t / (2 * Real.pi)|)) ^ j * ‖𝓕 (mellinLogFamily W σ) (t / (2 * Real.pi))‖ := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (by positivity) hbase j) (norm_nonneg _) _ = (1 + 2 * Real.pi) ^ j * ((1 + |t / (2 * Real.pi)|) ^ j * ‖𝓕 (mellinLogFamily W σ) (t / (2 * Real.pi))‖) := by rw [mul_pow, mul_assoc] _ ≤ (1 + 2 * Real.pi) ^ j * (C * (D * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W)) := mul_le_mul_of_nonneg_left (hfour.trans (mul_le_mul_of_nonneg_left (hDbd W) hC.le)) (by positivity) _ = _ := by ring theorem mellinData_strip_source_bound (a b : ℝ) (ha : 0 < a) (A j : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ W : SchwartzMap ℝ ℂ, Function.support (W : ℝ → ℂ) ⊆ Set.Icc a b → ∀ σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ), ∀ t : ℝ, (1 + |t|) ^ j * ‖mellinData W ((σ : ℂ) + t * Complex.I)‖ ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by let g : ℕ := 4 * A + 4 obtain ⟨Cγ, hCγ, hγ⟩ := gammaMultiplier_strip_bound A obtain ⟨s, CV, hCV, hVb⟩ := mellin_strip_source_bound a b ha (-(A : ℝ)) (1 / 4) (g + j) refine ⟨s, Cγ * CV, mul_pos hCγ hCV, ?_⟩ intro W hsupp σ hσ t have hσ' : -σ ∈ Set.Icc (-(A : ℝ)) (1 / 4) := by constructor <;> linarith [hσ.1, hσ.2] have hmb := hVb W hsupp (-σ) hσ' (-t) have heq : (-σ : ℝ) + (-t : ℝ) * Complex.I = -((σ : ℂ) + t * Complex.I) := by push_cast ring rw [heq, abs_neg] at hmb have hgb : ‖gammaMultiplier ((σ : ℂ) + t * Complex.I)‖ ≤ Cγ * (1 + |t|) ^ g := hγ σ hσ t rw [mellinData, norm_mul] calc _ = ((1 + |t|) ^ j * ‖mellin W (-((σ : ℂ) + t * Complex.I))‖) * ‖gammaMultiplier ((σ : ℂ) + t * Complex.I)‖ := by ring _ ≤ ((1 + |t|) ^ j * ‖mellin W (-((σ : ℂ) + t * Complex.I))‖) * (Cγ * (1 + |t|) ^ g) := mul_le_mul_of_nonneg_left hgb (by positivity) _ = Cγ * ((1 + |t|) ^ (g + j) * ‖mellin W (-((σ : ℂ) + t * Complex.I))‖) := by rw [pow_add] ring _ ≤ Cγ * (CV * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) := mul_le_mul_of_nonneg_left hmb hCγ.le _ = _ := by ring theorem mellinEulerData_strip_source_bound (a b : ℝ) (ha : 0 < a) (A j : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ W : SchwartzMap ℝ ℂ, Function.support (W : ℝ → ℂ) ⊆ Set.Icc a b → ∀ σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ), ∀ t : ℝ, ‖mellinEulerData W j ((σ : ℂ) + t * Complex.I)‖ ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W / (1 + t ^ 2) := by obtain ⟨s, C, hC, hb⟩ := mellinData_strip_source_bound a b ha A (j + 2) refine ⟨s, ((A : ℝ) + 2) ^ j * C, by positivity, ?_⟩ intro W hsupp σ hσ t apply weighted_two_to_cauchy (norm_nonneg _) t have hσabs : |σ| ≤ (A : ℝ) + 1 := by apply abs_le.mpr constructor <;> linarith [hσ.1, hσ.2, (Nat.cast_nonneg A : (0 : ℝ) ≤ A)] have hz : ‖(σ : ℂ) + t * Complex.I‖ ≤ ((A : ℝ) + 2) * (1 + |t|) := by have hnorm := norm_add_le (σ : ℂ) ((t : ℂ) * Complex.I) simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, Complex.norm_I, mul_one] at hnorm nlinarith [abs_nonneg t, (Nat.cast_nonneg A : (0 : ℝ) ≤ A)] rw [mellinEulerData, norm_mul, norm_pow, norm_neg] calc _ ≤ (1 + |t|) ^ 2 * ((((A : ℝ) + 2) * (1 + |t|)) ^ j * ‖mellinData W ((σ : ℂ) + t * Complex.I)‖) := by gcongr _ = ((A : ℝ) + 2) ^ j * ((1 + |t|) ^ (j + 2) * ‖mellinData W ((σ : ℂ) + t * Complex.I)‖) := by rw [mul_pow, pow_add]; ring _ ≤ ((A : ℝ) + 2) ^ j * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) := mul_le_mul_of_nonneg_left (hb W hsupp σ hσ t) (by positivity) _ = _ := by ring theorem mellinInv_euler_line_source_bound (a b : ℝ) (ha : 0 < a) (A j : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ W : SchwartzMap ℝ ℂ, Function.support (W : ℝ → ℂ) ⊆ Set.Icc a b → ∀ σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ), ∀ y : ℝ, 0 < y → ‖mellinInv σ (mellinEulerData W j) y‖ ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W * y ^ (-σ) := by obtain ⟨s, C, hC, hb⟩ := mellinEulerData_strip_source_bound a b ha A j refine ⟨s, C / 2, by positivity, ?_⟩ intro W hsupp σ hσ y hy let Q := s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W have hint : ‖∫ t : ℝ, (y : ℂ) ^ (-((σ : ℂ) + t * Complex.I)) * mellinEulerData W j ((σ : ℂ) + t * Complex.I)‖ ≤ (y ^ (-σ) * (C * Q)) * Real.pi := by calc _ ≤ ∫ t : ℝ, (y ^ (-σ) * (C * Q)) * (1 + t ^ 2)⁻¹ := by apply norm_integral_le_of_norm_le (integrable_inv_one_add_sq.const_mul _) filter_upwards [] with t rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hy] simp only [Complex.neg_re, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, mul_zero, zero_mul, sub_zero, add_zero] simpa only [div_eq_mul_inv, mul_assoc] using mul_le_mul_of_nonneg_left (hb W hsupp σ hσ t) (Real.rpow_nonneg hy.le (-σ)) _ = _ := by rw [integral_const_mul, integral_univ_inv_one_add_sq] rw [mellinInv, norm_smul, Real.norm_of_nonneg (by positivity : (0 : ℝ) ≤ 1 / (2 * Real.pi))] simp only [smul_eq_mul] calc _ ≤ (1 / (2 * Real.pi)) * ((y ^ (-σ) * (C * Q)) * Real.pi) := mul_le_mul_of_nonneg_left hint (by positivity) _ = _ := by dsimp [Q]; field_simp theorem paperKernel_euler_source_power_decay (a b : ℝ) (ha : 0 < a) (A j : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ W : SchwartzMap ℝ ℂ, Function.support (W : ℝ → ℂ) ⊆ Set.Icc a b → ∀ x : ℝ, 0 < x → (‖LocalLogFourier.eulerDeriv (paperKernel W) j x‖ ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W * x ^ (1 / 4 : ℝ)) ∧ (‖LocalLogFourier.eulerDeriv (paperKernel W) j x‖ ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W * x ^ (-(A : ℝ))) := by obtain ⟨s, C, hC, hb⟩ := mellinInv_euler_line_source_bound a b ha A j let B := max (paperScale ^ (1 / 4 : ℝ)) (paperScale ^ (-(A : ℝ))) have hB : 0 < B := lt_of_lt_of_le (Real.rpow_pos_of_pos paperScale_pos _) (le_max_left _ _) refine ⟨s, C * B, mul_pos hC hB, ?_⟩ intro W hsupp x hx let Q := s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W have hQ : 0 ≤ Q := by dsimp [Q]; positivity have hline (σ : ℝ) (hσ : σ ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ)) : ‖LocalLogFourier.eulerDeriv (paperKernel W) j x‖ ≤ C * Q * (paperScale * x) ^ (-σ) := by rw [← paperEulerKernel_eq_euler W (logPullbackCLM a b W) (logPullbackCLM_eq_actual a b ha W hsupp) j x hx] unfold paperEulerKernel rw [mellinInv_euler_shift W a b ha hsupp (W.smooth ⊤) A j σ hσ _ (mul_pos paperScale_pos hx)] exact hb W hsupp σ hσ (paperScale * x) (mul_pos paperScale_pos hx) have hleft : -(1 / 4 : ℝ) ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ) := by constructor · rfl · linarith [show (0 : ℝ) ≤ A from Nat.cast_nonneg A] have hright : (A : ℝ) ∈ Set.Icc (-(1 / 4 : ℝ)) (A : ℝ) := by constructor · linarith [show (0 : ℝ) ≤ A from Nat.cast_nonneg A] · rfl constructor · have hh := hline _ hleft rw [neg_neg, Real.mul_rpow paperScale_pos.le hx.le] at hh calc _ ≤ C * Q * (paperScale ^ (1 / 4 : ℝ) * x ^ (1 / 4 : ℝ)) := hh _ = (C * paperScale ^ (1 / 4 : ℝ)) * Q * x ^ (1 / 4 : ℝ) := by ring _ ≤ (C * B) * Q * x ^ (1 / 4 : ℝ) := by gcongr exact le_max_left _ _ · have hh := hline _ hright rw [Real.mul_rpow paperScale_pos.le hx.le] at hh calc _ ≤ C * Q * (paperScale ^ (-(A : ℝ)) * x ^ (-(A : ℝ))) := hh _ = (C * paperScale ^ (-(A : ℝ))) * Q * x ^ (-(A : ℝ)) := by ring _ ≤ (C * B) * Q * x ^ (-(A : ℝ)) := by gcongr exact le_max_right _ _ theorem paperKernel_euler_source_uniform_weighted_bound (a b : ℝ) (ha : 0 < a) (A K : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ W : SchwartzMap ℝ ℂ, Function.support (W : ℝ → ℂ) ⊆ Set.Icc a b → ∀ i ≤ K, ∀ x : ℝ, 0 < x → (1 + x) ^ A * ‖LocalLogFourier.eulerDeriv (paperKernel W) i x‖ ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by choose s c hc hb using fun i : Fin (K + 1) => paperKernel_euler_source_power_decay a b ha A i.val let S : Finset (ℕ × ℕ) := Finset.univ.biUnion s let D : ℝ := (∑ i : Fin (K + 1), c i) + 1 have hD : 0 < D := by have hs : (0 : ℝ) ≤ ∑ i : Fin (K + 1), c i := Finset.sum_nonneg (fun i _ => (hc i).le) dsimp [D] linarith have hci (i : Fin (K + 1)) : c i ≤ D := by have hs : c i ≤ ∑ k : Fin (K + 1), c k := Finset.single_le_sum (fun k _ => (hc k).le) (Finset.mem_univ i) dsimp [D] linarith refine ⟨S, 2 ^ A * (D + D), by positivity, ?_⟩ intro W hsupp let Q := S.sup (schwartzSeminormFamily ℝ ℝ ℂ) W have hQ : 0 ≤ Q := by dsimp [Q]; positivity have hsource (i : Fin (K + 1)) : c i * (s i).sup (schwartzSeminormFamily ℝ ℝ ℂ) W ≤ D * Q := by have hsub : s i ⊆ S := Finset.subset_biUnion_of_mem s (Finset.mem_univ i) have hq : (s i).sup (schwartzSeminormFamily ℝ ℝ ℂ) W ≤ Q := Seminorm.le_def.mp (Finset.sup_mono hsub) W exact mul_le_mul (hci i) hq (by positivity) hD.le have hsmall : ∀ i ≤ K, ∀ x : ℝ, 0 < x → x ≤ 1 → ‖LocalLogFourier.eulerDeriv (paperKernel W) i x‖ ≤ D * Q := by intro i hi x hx hx1 let k : Fin (K + 1) := ⟨i, by omega⟩ have hp : x ^ (1 / 4 : ℝ) ≤ 1 := Real.rpow_le_one hx.le hx1 (by norm_num) calc _ ≤ (c k * (s k).sup (schwartzSeminormFamily ℝ ℝ ℂ) W) * x ^ (1 / 4 : ℝ) := (hb k W hsupp x hx).1 _ ≤ c k * (s k).sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by simpa using mul_le_mul_of_nonneg_left hp (mul_nonneg (hc k).le (by positivity)) _ ≤ D * Q := hsource k have hlarge : ∀ i ≤ K, ∀ x : ℝ, 1 ≤ x → x ^ A * ‖LocalLogFourier.eulerDeriv (paperKernel W) i x‖ ≤ D * Q := by intro i hi x hx1 have hx : 0 < x := lt_of_lt_of_le zero_lt_one hx1 let k : Fin (K + 1) := ⟨i, by omega⟩ have hxpow : x ^ A ≠ 0 := pow_ne_zero A hx.ne' calc _ ≤ x ^ A * ((c k * (s k).sup (schwartzSeminormFamily ℝ ℝ ℂ) W) * x ^ (-(A : ℝ))) := mul_le_mul_of_nonneg_left (hb k W hsupp x hx).2 (pow_nonneg hx.le A) _ = c k * (s k).sup (schwartzSeminormFamily ℝ ℝ ℂ) W := by rw [Real.rpow_neg hx.le, Real.rpow_natCast] field_simp _ ≤ D * Q := hsource k intro i hi x hx have hh := LocalLogFourier.euler_two_regime_bound (paperKernel W) A K (D * Q) (D * Q) (mul_nonneg hD.le hQ) (mul_nonneg hD.le hQ) hsmall hlarge i hi x hx convert hh using 1 ; dsimp [Q] ; ring end CubicReflectionKernel open scoped BigOperators Classical namespace FirstPassCubeLabels open ActualEisensteinCubic open MixedCrossSeparation (crossSymbol quadraticCrossPhase columnPrimeCoprime) open FiniteGaussPhase (canonicalProductGauss canonicalProductGauss_cross_factors) open MixedGaussConversion (localGauss) def gaussBlock {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (e : ι → ℕ) : ℂ := ∏ i ∈ S, (∏ k ∈ S.erase i, crossSymbol p hg i k ^ e i) * localGauss (p i) (hp i) (hg i) (e i) theorem canonicalProductGauss_eq_gaussBlock {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (e : ι → ℕ) (he : ∀ i ∈ S, e i ≠ 0) : canonicalProductGauss (fun i : S => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop S) (fun i => hg i.val) (fun i => e i.val) = gaussBlock p hp hg S e := by let : DecidableEq S := fun a b => Classical.propDecidable (a = b) rw [canonicalProductGauss_cross_factors, ← Finset.prod_mul_distrib] have hin (i : S) : (∏ k ∈ (Finset.univ : Finset S).erase i, (canonicalSextic (Ideal.span {p i.val}) (hg i.val) ^ e i.val) (Ideal.Quotient.mk (Ideal.span {p i.val}) (p k.val))) = ∏ k ∈ S.erase i.val, crossSymbol p hg i.val k ^ e i.val := by apply Finset.prod_bij (fun k _ => k.val) · intro k hk exact Finset.mem_erase.mpr ⟨fun h => (Finset.mem_erase.mp hk).1 (Subtype.ext h), k.property⟩ · intro a ha b hb hab exact Subtype.ext hab · intro k hk refine ⟨⟨k, (Finset.mem_erase.mp hk).2⟩, ?_, rfl⟩ exact Finset.mem_erase.mpr ⟨fun h => (Finset.mem_erase.mp hk).1 (congrArg Subtype.val h), Finset.mem_univ _⟩ · intro k hk exact MulChar.pow_apply' _ (he i.val i.property) _ calc _ = ∏ i : S, (∏ k ∈ S.erase i.val, crossSymbol p hg i.val k ^ e i.val) * localGauss (p i.val) (hp i.val) (hg i.val) (e i.val) := by apply Finset.prod_congr rfl intro i hi rw [hin i] rfl _ = _ := Finset.prod_coe_sort S (fun i => (∏ k ∈ S.erase i, crossSymbol p hg i k ^ e i) * localGauss (p i) (hp i) (hg i) (e i)) def blockCross {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S T : Finset ι) (e : ι → ℕ) : ℂ := ∏ i ∈ S, ∏ k ∈ T, crossSymbol p hg i k ^ e i * crossSymbol p hg k i ^ e k theorem gaussBlock_union {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S T : Finset ι) (hd : Disjoint S T) (e : ι → ℕ) : gaussBlock p hp hg (S ∪ T) e = gaussBlock p hp hg S e * gaussBlock p hp hg T e * blockCross p hg S T e := by have hS (i : ι) (hi : i ∈ S) : (∏ k ∈ (S ∪ T).erase i, crossSymbol p hg i k ^ e i) = (∏ k ∈ S.erase i, crossSymbol p hg i k ^ e i) * ∏ k ∈ T, crossSymbol p hg i k ^ e i := by have hn : i ∉ T := fun h => Finset.disjoint_left.mp hd hi h rw [Finset.erase_union_distrib, Finset.erase_eq_of_notMem hn, Finset.prod_union (hd.mono_left (Finset.erase_subset _ _))] have hT (i : ι) (hi : i ∈ T) : (∏ k ∈ (S ∪ T).erase i, crossSymbol p hg i k ^ e i) = (∏ k ∈ T.erase i, crossSymbol p hg i k ^ e i) * ∏ k ∈ S, crossSymbol p hg i k ^ e i := by have hn : i ∉ S := fun h => Finset.disjoint_left.mp hd h hi rw [Finset.union_comm S T, Finset.erase_union_distrib, Finset.erase_eq_of_notMem hn, Finset.prod_union (hd.symm.mono_left (Finset.erase_subset _ _))] have hpS : (∏ i ∈ S, (∏ k ∈ (S ∪ T).erase i, crossSymbol p hg i k ^ e i) * localGauss (p i) (hp i) (hg i) (e i)) = gaussBlock p hp hg S e * (∏ i ∈ S, ∏ k ∈ T, crossSymbol p hg i k ^ e i) := by rw [gaussBlock, ← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i hi rw [hS i hi] ring have hpT : (∏ i ∈ T, (∏ k ∈ (S ∪ T).erase i, crossSymbol p hg i k ^ e i) * localGauss (p i) (hp i) (hg i) (e i)) = gaussBlock p hp hg T e * (∏ i ∈ T, ∏ k ∈ S, crossSymbol p hg i k ^ e i) := by rw [gaussBlock, ← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i hi rw [hT i hi] ring rw [gaussBlock, Finset.prod_union hd, hpS, hpT, Finset.prod_comm (s := T) (t := S)] simp only [blockCross, Finset.prod_mul_distrib] ring theorem gaussBlock_congr {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (e f : ι → ℕ) (he : ∀ i ∈ S, e i = f i) : gaussBlock p hp hg S e = gaussBlock p hp hg S f := by apply Finset.prod_congr rfl intro i hi rw [he i hi] def cubeActiveSupport {ι : Type*} (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) : Finset ι := B.filter (fun k => conductorExponent (parity (v k)) (ε₁ k) (ε₂ k) ≠ 0) theorem columnCoefficient_eq_gaussBlock {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) : MixedCrossSeparation.columnCoefficient p hp hcop hg S = star (FiniteGaussPhase.angularFactor (∏ i ∈ S, p i)) * gaussBlock p hp hg S (fun _ => 2) := by unfold MixedCrossSeparation.columnCoefficient FiniteGaussPhase.canonicalProductCoefficient rw [Finset.prod_coe_sort] rw [canonicalProductGauss_eq_gaussBlock p hp hcop hg S (fun _ => 2) (fun _ _ => by decide)] theorem blockCross_two_eq_row_four {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (S T : Finset ι) : blockCross p hg S T (fun _ => 2) = finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (∏ k ∈ T, p k) ^ 4 := by simp only [blockCross, finiteSquarefreeRow, map_prod, ← Finset.prod_pow] apply Finset.prod_congr rfl intro i hi apply Finset.prod_congr rfl intro k hk have hr : crossSymbol p hg i k ^ 2 = crossSymbol p hg k i ^ 2 := canonicalSextic_sq_reciprocity_primary (Ideal.span {p i}) (Ideal.span {p k}) (hg i) (hg k) (p i) (p k) rfl rfl (hpr i) (hpr k) change crossSymbol p hg i k ^ 2 * crossSymbol p hg k i ^ 2 = crossSymbol p hg i k ^ 4 rw [← hr] ring theorem columnCoefficient_union_row_four {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (S T : Finset ι) (hd : Disjoint S T) : MixedCrossSeparation.columnCoefficient p hp hcop hg (S ∪ T) = MixedCrossSeparation.columnCoefficient p hp hcop hg S * MixedCrossSeparation.columnCoefficient p hp hcop hg T * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (∏ k ∈ T, p k) ^ 4 := by have ha : FiniteGaussPhase.angularFactor (∏ i ∈ S ∪ T, p i) = FiniteGaussPhase.angularFactor (∏ i ∈ S, p i) * FiniteGaussPhase.angularFactor (∏ i ∈ T, p i) := by rw [Finset.prod_union hd] simp only [FiniteGaussPhase.angularFactor, map_mul, norm_mul, Complex.ofReal_mul, div_eq_mul_inv, mul_inv_rev] ring rw [columnCoefficient_eq_gaussBlock, columnCoefficient_eq_gaussBlock, columnCoefficient_eq_gaussBlock, ha, star_mul, gaussBlock_union p hp hg S T hd, blockCross_two_eq_row_four p hg hpr S T] ring theorem gaussBlock_norm_one {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (S : Finset ι) (e : ι → ℕ) (he : ∀ i ∈ S, e i ≠ 0) (he6 : ∀ i ∈ S, e i < 6) : ‖gaussBlock p hp hg S e‖ = 1 := by rw [← canonicalProductGauss_eq_gaussBlock p hp hcop hg S e he] exact FiniteGaussPhase.norm_canonicalProductGauss (fun i : S => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop S) (fun i => hg i.val) (fun i => hc i.val) (fun i => e i.val) (fun i => he i.val i.property) (fun i => he6 i.val i.property) end FirstPassCubeLabels end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.FiniteOperator namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace FiniteSieveOperator variable {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] def operator (A : Matrix m n ℂ) : EuclideanSpace ℂ n →L[ℂ] EuclideanSpace ℂ m := A.toEuclideanLin.toContinuousLinearMap omit [DecidableEq m] in theorem operator_apply (A : Matrix m n ℂ) (x : EuclideanSpace ℂ n) (i : m) : operator A x i = ∑ j, A i j * x j := rfl theorem operator_conjTranspose (A : Matrix m n ℂ) : operator A.conjTranspose = (operator A).adjoint := by unfold operator rw [Matrix.toEuclideanLin_conjTranspose_eq_adjoint, LinearMap.adjoint_toContinuousLinearMap] theorem operator_conjTranspose_norm (A : Matrix m n ℂ) : ‖operator A.conjTranspose‖ = ‖operator A‖ := by rw [operator_conjTranspose] exact ContinuousLinearMap.adjoint.norm_map _ omit [DecidableEq m] in theorem operator_zero : operator (0 : Matrix m n ℂ) = 0 := by ext x i simp [operator_apply] omit [DecidableEq m] in theorem operator_add (A B : Matrix m n ℂ) : operator (A + B) = operator A + operator B := by ext x i simp [operator_apply, add_mul, Finset.sum_add_distrib] omit [DecidableEq m] in theorem operator_smul (c : ℂ) (A : Matrix m n ℂ) : operator (c • A) = c • operator A := by ext x i simp [operator_apply, Finset.mul_sum, mul_assoc] omit [DecidableEq m] in theorem operator_sum {κ : Type*} (S : Finset κ) (A : κ → Matrix m n ℂ) : operator (∑ k ∈ S, A k) = ∑ k ∈ S, operator (A k) := by classical induction S using Finset.induction_on with | empty => simp [operator_zero] | @insert a S ha ih => simp only [Finset.sum_insert ha, operator_add, ih] omit [DecidableEq m] in theorem diagonal_twist_norm_le (A : Matrix m n ℂ) (l : m → ℂ) (r : n → ℂ) (hl : ∀ i, ‖l i‖ ≤ 1) (hr : ∀ j, ‖r j‖ ≤ 1) : ‖operator (fun i j => l i * A i j * r j)‖ ≤ ‖operator A‖ := by apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) intro x let y : EuclideanSpace ℂ n := WithLp.toLp 2 (fun j => r j * x j) have hy : ‖y‖ ≤ ‖x‖ := by apply (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mp rw [EuclideanSpace.norm_sq_eq, EuclideanSpace.norm_sq_eq] apply Finset.sum_le_sum intro j _ change ‖r j * x j‖ ^ 2 ≤ ‖x j‖ ^ 2 apply pow_le_pow_left₀ (norm_nonneg _) rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (hr j) have heq (i : m) : operator (fun i j => l i * A i j * r j) x i = l i * operator A y i := by simp only [operator_apply, Finset.mul_sum] apply Finset.sum_congr rfl intro j _ change l i * A i j * r j * x j = l i * (A i j * (r j * x j)) ring have hz : ‖operator (fun i j => l i * A i j * r j) x‖ ≤ ‖operator A y‖ := by apply (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mp rw [EuclideanSpace.norm_sq_eq, EuclideanSpace.norm_sq_eq] apply Finset.sum_le_sum intro i _ rw [heq, norm_mul] apply pow_le_pow_left₀ (by positivity) exact mul_le_of_le_one_left (norm_nonneg _) (hl i) exact hz.trans ((operator A).le_opNorm y |>.trans (mul_le_mul_of_nonneg_left hy (norm_nonneg _))) omit [DecidableEq m] in theorem separated_phase_norm_le {κ : Type*} [Fintype κ] (A B : Matrix m n ℂ) (c : κ → ℂ) (l : κ → m → ℂ) (r : κ → n → ℂ) (hl : ∀ k i, ‖l k i‖ ≤ 1) (hr : ∀ k j, ‖r k j‖ ≤ 1) (heq : ∀ i j, A i j = ∑ k, c k * (l k i * B i j * r k j)) : ‖operator A‖ ≤ (∑ k, ‖c k‖) * ‖operator B‖ := by let T : κ → Matrix m n ℂ := fun k i j => l k i * B i j * r k j have hA : A = ∑ k, c k • T k := by ext i j rw [Matrix.sum_apply] exact heq i j have hOp : operator A = ∑ k, c k • operator (T k) := by calc _ = operator (∑ k, c k • T k) := congrArg operator hA _ = ∑ k, operator (c k • T k) := operator_sum _ _ _ = _ := Finset.sum_congr rfl (fun k _ => operator_smul (c k) (T k)) rw [hOp] calc _ ≤ ∑ k, ‖c k • operator (T k)‖ := norm_sum_le _ _ _ ≤ ∑ k, ‖c k‖ * ‖operator B‖ := by apply Finset.sum_le_sum intro k _ rw [norm_smul] exact mul_le_mul_of_nonneg_left (diagonal_twist_norm_le B (l k) (r k) (hl k) (hr k)) (norm_nonneg _) _ = _ := (Finset.sum_mul ..).symm omit [DecidableEq m] in theorem energy_bound (A : Matrix m n ℂ) (u : n → ℂ) : (∑ i, ‖∑ j, A i j * u j‖ ^ 2) ≤ ‖operator A‖ ^ 2 * ∑ j, ‖u j‖ ^ 2 := by let x : EuclideanSpace ℂ n := WithLp.toLp 2 u have h := (operator A).le_opNorm x have hs := pow_le_pow_left₀ (norm_nonneg _) h 2 simpa only [mul_pow, EuclideanSpace.norm_sq_eq, operator_apply, x, PiLp.toLp_apply] using hs end FiniteSieveOperator section open scoped BigOperators Classical namespace QuadraticInitialBound open ActualEisensteinCubic ConcreteTraceCRT RayFourExpansion def quadraticMatrix {ι m n : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (rows : m → Finset ι) (cols : n → Finset ι) : Matrix m n ℂ := fun i j => quadraticSymbol p hg (cols j) (rows i) def quadraticSieveNorm {ι m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (rows : m → Finset ι) (cols : n → Finset ι) : ℝ := ‖FiniteSieveOperator.operator (quadraticMatrix p hg rows cols)‖ ^ 2 theorem quadratic_matrix_norm_reverse_le {ι m n : Type*} [Fintype ι] [DecidableEq ι] [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (rows : m → Finset ι) (cols : n → Finset ι) : ‖FiniteSieveOperator.operator (quadraticMatrix p hg rows cols)‖ ≤ 512 * ‖FiniteSieveOperator.operator (quadraticMatrix p hg cols rows)‖ := by letI := @OAI.RayFourExpansion.rayRingFintype letI := @OAI.RayFourExpansion.rayCharacterFintype let A := quadraticMatrix p hg rows cols let B := (quadraticMatrix p hg cols rows).conjTranspose let c : RayCharacter × RayCharacter → ℂ := fun k => crossCoeff k.1 k.2 let l : RayCharacter × RayCharacter → m → ℂ := fun k i => rayCharacter k.2 (∏ s ∈ rows i, p s) let r : RayCharacter × RayCharacter → n → ℂ := fun k j => rayCharacter k.1 (∏ s ∈ cols j, p s) have hB (i : m) (j : n) : B i j = quadraticSymbol p hg (rows i) (cols j) := by change star (quadraticSymbol p hg (rows i) (cols j)) = _ exact quadraticRow_star _ _ _ _ have hl (k : RayCharacter × RayCharacter) (i : m) : ‖l k i‖ ≤ 1 := FiniteRayExpansion.norm_char_le_one k.2 _ have hr (k : RayCharacter × RayCharacter) (j : n) : ‖r k j‖ ≤ 1 := FiniteRayExpansion.norm_char_le_one k.1 _ have hA (i : m) (j : n) : A i j = ∑ k, c k * (l k i * B i j * r k j) := by rw [hB, Fintype.sum_prod_type] change quadraticSymbol p hg (cols j) (rows i) = _ rw [quadraticSymbol_reciprocity_characters p hp hcop hg hc] apply Finset.sum_congr rfl intro χ _ apply Finset.sum_congr rfl intro η _ dsimp [c, l, r] ring have hmass : (∑ k, ‖c k‖) ≤ 512 := by simpa only [c, Fintype.sum_prod_type] using crossCoeff_sum_norm_le calc _ ≤ (∑ k, ‖c k‖) * ‖FiniteSieveOperator.operator B‖ := FiniteSieveOperator.separated_phase_norm_le A B c l r hl hr hA _ ≤ 512 * ‖FiniteSieveOperator.operator B‖ := mul_le_mul_of_nonneg_right hmass (norm_nonneg _) _ = _ := by change 512 * ‖FiniteSieveOperator.operator (quadraticMatrix p hg cols rows).conjTranspose‖ = _ rw [FiniteSieveOperator.operator_conjTranspose_norm] theorem quadraticSieveNorm_reverse_le {ι m n : Type*} [Fintype ι] [DecidableEq ι] [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (rows : m → Finset ι) (cols : n → Finset ι) : quadraticSieveNorm p hg rows cols ≤ 262144 * quadraticSieveNorm p hg cols rows := by have h := pow_le_pow_left₀ (norm_nonneg _) (quadratic_matrix_norm_reverse_le p hp hcop hg hc rows cols) 2 simpa only [quadraticSieveNorm, mul_pow, show (512 : ℝ) ^ 2 = 262144 by norm_num] using h end QuadraticInitialBound open scoped BigOperators Classical open Filter IdealMobiusDivisorSum UniqueFactorizationMonoid namespace IdealDivisorBound abbrev O := ActualEisensteinCubic.O theorem divisor_ne_zero {I J : Ideal O} (hI : I ≠ ⊥) (hJ : J ∈ idealDivisors I) : J ≠ 0 := by intro hz have hd := (mem_idealDivisors hI).mp hJ rw [hz, zero_dvd_iff] at hd exact hI hd theorem divisor_card_le_product (I : Ideal O) (hI : I ≠ ⊥) : (idealDivisors I).card ≤ ∏ P ∈ primeSupport I, ((normalizedFactors I).count P + 1) := by change (idealDivisors I).card ≤ ∏ P ∈ (normalizedFactors I).toFinset, ((normalizedFactors I).count P + 1) rw [← Multiset.card_Iic] apply Finset.card_le_card_of_injOn normalizedFactors · intro J hJ change normalizedFactors J ∈ Finset.Iic (normalizedFactors I) rw [Finset.mem_Iic] exact (dvd_iff_normalizedFactors_le_normalizedFactors (divisor_ne_zero hI hJ) hI).mp ((mem_idealDivisors hI).mp hJ) · intro J hJ K hK he calc J = (normalizedFactors J).prod := (Ideal.prod_normalizedFactors_eq_self (divisor_ne_zero hI hJ)).symm _ = (normalizedFactors K).prod := congrArg Multiset.prod he _ = K := Ideal.prod_normalizedFactors_eq_self (divisor_ne_zero hI hK) theorem linear_le_geometric (b : ℝ) (hb : 1 < b) (n : ℕ) : (n : ℝ) + 1 ≤ (1 + (b - 1)⁻¹) * b ^ n := by have hδ : 0 < b - 1 := sub_pos.mpr hb have hn := one_add_mul_sub_le_pow (show (-1 : ℝ) ≤ b by linarith) n have hn' : (n : ℝ) ≤ b ^ n / (b - 1) := by apply (le_div_iff₀ hδ).mpr linarith have h1 : (1 : ℝ) ≤ b ^ n := one_le_pow₀ hb.le calc (n : ℝ) + 1 ≤ b ^ n / (b - 1) + b ^ n := add_le_add hn' h1 _ = _ := by ring theorem support_norm_two_le {I P : Ideal O} (hP : P ∈ primeSupport I) : 2 ≤ Ideal.absNorm P := by have hp := support_prime hP have h0 : Ideal.absNorm P ≠ 0 := by intro h exact hp.ne_zero (Ideal.absNorm_eq_zero_iff.mp h) have h1 : Ideal.absNorm P ≠ 1 := by intro h have ht := Ideal.absNorm_eq_one_iff.mp h apply hp.not_isUnit rw [ht] simpa only [Ideal.one_eq_top] using (show IsUnit (1 : Ideal O) from isUnit_one) omega theorem norm_factor_product (I : Ideal O) (hI : I ≠ ⊥) : (∏ P ∈ primeSupport I, (Ideal.absNorm P : ℝ) ^ (normalizedFactors I).count P) = Ideal.absNorm I := by have he := congrArg (fun J : Ideal O => (Ideal.absNorm J : ℝ)) (Ideal.prod_normalizedFactors_eq_self hI) rw [Finset.prod_multiset_count] at he simpa only [primeSupport, map_prod, map_pow, Nat.cast_prod, Nat.cast_pow] using he theorem ideal_divisor_small_power (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ I : Ideal O, I ≠ ⊥ → ((idealDivisors I).card : ℝ) ≤ C * (Ideal.absNorm I : ℝ) ^ ε := by have ht : Tendsto (fun n : ℕ => (n : ℝ) ^ ε) atTop atTop := (tendsto_rpow_atTop hε).comp tendsto_natCast_atTop_atTop obtain ⟨N, hN⟩ := eventually_atTop.mp (ht.eventually (eventually_ge_atTop (2 : ℝ))) let small : Finset (Ideal O) := (Ideal.finite_setOfPred_absNorm_le (S := O) N).toFinset let b : ℝ := (2 : ℝ) ^ ε have hb : 1 < b := by dsimp [b] exact Real.one_lt_rpow (by norm_num) hε let c : ℝ := 1 + (b - 1)⁻¹ have hc : 1 ≤ c := by dsimp [c] have hi : 0 ≤ (b - 1)⁻¹ := inv_nonneg.mpr (sub_nonneg.mpr hb.le) linarith refine ⟨c ^ small.card, by positivity, ?_⟩ intro I hI let S := primeSupport I let e := fun P : Ideal O => (normalizedFactors I).count P have hfac (P : Ideal O) (hP : P ∈ S) : ((e P + 1 : ℕ) : ℝ) ≤ (if P ∈ small then c else 1) * ((Ideal.absNorm P : ℝ) ^ ε) ^ e P := by have hnorm : (2 : ℝ) ≤ Ideal.absNorm P := by exact_mod_cast support_norm_two_le hP have hbase : b ≤ (Ideal.absNorm P : ℝ) ^ ε := Real.rpow_le_rpow (by norm_num) hnorm hε.le by_cases hp : P ∈ small · rw [ite_eq_left hp] have hlin := linear_le_geometric b hb (e P) have hl : ((e P + 1 : ℕ) : ℝ) ≤ c * b ^ e P := by simpa only [Nat.cast_add, Nat.cast_one, c] using hlin apply hl.trans exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (by positivity) hbase _) (by positivity) · rw [ite_eq_right hp, one_mul] have hn : N ≤ Ideal.absNorm P := by have : ¬ Ideal.absNorm P ≤ N := fun h => hp (by simpa [small] using h) omega have hp2 := hN _ hn calc _ ≤ (2 : ℝ) ^ e P := by have hh := one_add_mul_sub_le_pow (by norm_num : (-1 : ℝ) ≤ 2) (e P) norm_num at hh ⊢ linarith _ ≤ _ := pow_le_pow_left₀ (by norm_num) hp2 _ have hprod := Finset.prod_le_prod₀ (fun P (_ : P ∈ S) => (by positivity : (0 : ℝ) ≤ ((e P + 1 : ℕ) : ℝ))) hfac have hconst : (∏ P ∈ S, if P ∈ small then c else 1) ≤ c ^ small.card := by have he : (∏ P ∈ S, if P ∈ small then c else 1) = c ^ (S ∩ small).card := by simp [] rw [he] exact pow_le_pow_right₀ hc (Finset.card_le_card Finset.inter_subset_right) have hpow : (∏ P ∈ S, ((Ideal.absNorm P : ℝ) ^ ε) ^ e P) = (Ideal.absNorm I : ℝ) ^ ε := by calc _ = ∏ P ∈ S, ((Ideal.absNorm P : ℝ) ^ e P) ^ ε := by apply Finset.prod_congr rfl intro P hP rw [← Real.rpow_natCast, ← Real.rpow_mul (by positivity), ← Real.rpow_natCast, ← Real.rpow_mul (by positivity)] rw [mul_comm] _ = (∏ P ∈ S, (Ideal.absNorm P : ℝ) ^ e P) ^ ε := Real.finsetProd_rpow S _ (fun _ _ => by positivity) ε _ = _ := by rw [norm_factor_product I hI] have hcard : ((idealDivisors I).card : ℝ) ≤ ∏ P ∈ S, ((e P + 1 : ℕ) : ℝ) := by exact_mod_cast divisor_card_le_product I hI apply hcard.trans rw [Finset.prod_mul_distrib, hpow] at hprod exact hprod.trans (mul_le_mul_of_nonneg_right hconst (by positivity)) end IdealDivisorBound end namespace SecondPassFiber open scoped BigOperators Classical open IdealMobiusDivisorSum ConcretePrimeRowBridge abbrev O := ActualEisensteinCubic.O structure OldTuple where core : Fin 8 → Ideal O v : Ideal O j2 : Ideal O b2 : Ideal O row : O protected theorem OldTuple.ext : ∀ {x y : OldTuple}, ∀ (core : x.core = y.core) (v : x.v = y.v) (j2 : x.j2 = y.j2) (b2 : x.b2 = y.b2) (row : x.row = y.row), x = y := fun {x} {h} => match x with | OldTuple.mk core v j2 b2 row => match h with | OldTuple.mk core v j2 b2 row => fun h0 h1 h2 h3 h4 => by cases h0 cases h1 cases h2 cases h3 cases h4 rfl structure Valid (x : OldTuple) (F b0 : Ideal O) (y : O) : Prop where label : x.core 0 * x.core 1 * x.core 2 * x.v = F j_split : x.core 3 * x.j2 = x.core 0 b_split : x.core 4 * x.b2 = b0 ^ 2 * x.j2 ^ 2 * x.core 3 a1 : x.core 5 ∣ x.core 4 * x.b2 a2 : x.core 6 ∣ x.core 4 * x.b2 d : x.core 7 ∣ F * b0 row_eq : idealGenerator (x.core 7) * idealGenerator (x.core 2) * x.row = y def divisorTarget (F b0 : Ideal O) : Ideal O := (F * b0) ^ 2 theorem core_dvd_target (x : OldTuple) (F b0 : Ideal O) (y : O) (h : Valid x F b0 y) (i : Fin 8) : x.core i ∣ divisorTarget F b0 := by have hJ : x.core 0 ∣ F := by rw [← h.label] exact dvd_mul_of_dvd_left (dvd_mul_of_dvd_left (dvd_mul_right _ _) _) _ have hC : x.core 1 ∣ F := by rw [← h.label] exact dvd_mul_of_dvd_left (dvd_mul_of_dvd_left (dvd_mul_left _ _) _) _ have he : x.core 2 ∣ F := by rw [← h.label] exact dvd_mul_of_dvd_left (dvd_mul_left _ _) _ have hs : x.core 3 ∣ F := by apply dvd_trans _ hJ rw [← h.j_split] exact dvd_mul_right _ _ have hFT : F ∣ divisorTarget F b0 := by dsimp [divisorTarget] exact (dvd_mul_right F b0).trans (dvd_pow_self _ (by decide)) have hbprod : x.core 4 * x.b2 ∣ divisorTarget F b0 := by apply dvd_trans (b := b0 ^ 2 * x.core 0 ^ 2) · refine ⟨x.core 3, ?_⟩ rw [h.b_split, ← h.j_split] ring · dsimp [divisorTarget] rw [mul_pow, mul_comm (F ^ 2)] exact mul_dvd_mul_left _ (pow_dvd_pow_of_dvd hJ 2) fin_cases i · exact hJ.trans hFT · exact hC.trans hFT · exact he.trans hFT · exact hs.trans hFT · exact (dvd_mul_right _ _).trans hbprod · exact h.a1.trans hbprod · exact h.a2.trans hbprod · exact h.d.trans (dvd_pow_self _ (by decide)) theorem target_ne_zero (F b0 : Ideal O) (hF : F ≠ ⊥) (hb0 : b0 ≠ ⊥) : divisorTarget F b0 ≠ 0 := pow_ne_zero _ (mul_ne_zero hF hb0) theorem core_ne_zero (x : OldTuple) (F b0 : Ideal O) (y : O) (hF : F ≠ ⊥) (hb0 : b0 ≠ ⊥) (h : Valid x F b0 y) (i : Fin 8) : x.core i ≠ 0 := by intro he have hd := core_dvd_target x F b0 y h i rw [he, zero_dvd_iff] at hd exact target_ne_zero F b0 hF hb0 hd theorem valid_core_injective (F b0 : Ideal O) (y : O) (hF : F ≠ ⊥) (hb0 : b0 ≠ ⊥) {x z : OldTuple} (hx : Valid x F b0 y) (hz : Valid z F b0 y) (hcore : x.core = z.core) : x = z := by have hc (i : Fin 8) : x.core i = z.core i := congrFun hcore i have hv : x.v = z.v := by apply mul_left_cancel₀ (mul_ne_zero (mul_ne_zero (core_ne_zero x F b0 y hF hb0 hx 0) (core_ne_zero x F b0 y hF hb0 hx 1)) (core_ne_zero x F b0 y hF hb0 hx 2)) calc _ = F := hx.label _ = _ := by simpa only [hc] using hz.label.symm have hj : x.j2 = z.j2 := by apply mul_left_cancel₀ (core_ne_zero x F b0 y hF hb0 hx 3) calc _ = x.core 0 := hx.j_split _ = _ := by simpa only [hc] using hz.j_split.symm have hb : x.b2 = z.b2 := by apply mul_left_cancel₀ (core_ne_zero x F b0 y hF hb0 hx 4) calc _ = b0 ^ 2 * x.j2 ^ 2 * x.core 3 := hx.b_split _ = _ := by simpa only [hc, hj] using hz.b_split.symm have hgen (i : Fin 8) : idealGenerator (x.core i) ≠ 0 := by intro he apply core_ne_zero x F b0 y hF hb0 hx i rw [← span_idealGenerator (x.core i), he] simp have hr : x.row = z.row := by apply mul_left_cancel₀ (mul_ne_zero (hgen 7) (hgen 2)) calc _ = y := hx.row_eq _ = _ := by simpa only [hc] using hz.row_eq.symm exact OldTuple.ext hcore hv hj hb hr theorem valid_tuple_card_le (s : Finset OldTuple) (F b0 : Ideal O) (y : O) (hF : F ≠ ⊥) (hb0 : b0 ≠ ⊥) (hs : ∀ x ∈ s, Valid x F b0 y) : s.card ≤ (idealDivisors (divisorTarget F b0)).card ^ 8 := by let D := idealDivisors (divisorTarget F b0) let encode (x : s) : Fin 8 → D := fun i => ⟨x.val.core i, by apply (mem_idealDivisors (target_ne_zero F b0 hF hb0)).mpr exact core_dvd_target x.val F b0 y (hs x.val x.property) i⟩ have hinj : Function.Injective encode := by intro x z he apply Subtype.ext apply valid_core_injective F b0 y hF hb0 (hs x.val x.property) (hs z.val z.property) funext i exact congrArg Subtype.val (congrFun he i) have hc := Fintype.card_le_of_injective encode hinj simpa [D] using hc theorem valid_tuple_small_power (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ (s : Finset OldTuple) (F b0 : Ideal O) (y : O), F ≠ ⊥ → b0 ≠ ⊥ → (∀ x ∈ s, Valid x F b0 y) → (s.card : ℝ) ≤ C * ((Ideal.absNorm F : ℝ) * Ideal.absNorm b0) ^ ε := by obtain ⟨C, hC, h⟩ := IdealDivisorBound.ideal_divisor_small_power (ε / 16) (by positivity) refine ⟨C ^ 8, by positivity, ?_⟩ intro s F b0 y hF hb0 hs have hc : (s.card : ℝ) ≤ ((idealDivisors (divisorTarget F b0)).card : ℝ) ^ 8 := by exact_mod_cast valid_tuple_card_le s F b0 y hF hb0 hs have hd := pow_le_pow_left₀ (by positivity) (h (divisorTarget F b0) (target_ne_zero F b0 hF hb0)) 8 apply hc.trans (hd.trans_eq ?_) rw [mul_pow] congr 1 simp only [divisorTarget, map_pow, map_mul, Nat.cast_pow, Nat.cast_mul] rw [← Real.rpow_natCast, ← Real.rpow_mul (by positivity), ← Real.rpow_natCast, ← Real.rpow_mul (by positivity)] congr 1 ring def newLabel (x : OldTuple) : Ideal O := x.core 0 * x.core 1 * x.core 2 * x.v def newRow (x : OldTuple) : O := idealGenerator (x.core 7) * idealGenerator (x.core 2) * x.row theorem second_energy_pushforward (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ (s : Finset OldTuple) (t : Finset (Ideal O × O)) (b0 : Ideal O) (w : OldTuple → ℂ) (P : Ideal O × O → ℂ) (B H : ℝ), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ H → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ t) → (∀ z ∈ t, z.1 ≠ ⊥) → (∀ z ∈ t, (Ideal.absNorm z.1 : ℝ) ≤ H) → (∀ x ∈ s, ‖w x‖ ≤ B) → (∑ x ∈ s, ‖w x‖ * ‖P (newLabel x, newRow x)‖ ^ 2) ≤ B * C * (H * Ideal.absNorm b0) ^ ε * ∑ z ∈ t, ‖P z‖ ^ 2 := by obtain ⟨C, hC, hc⟩ := valid_tuple_small_power ε hε refine ⟨C, hC, ?_⟩ intro s t b0 w P B H hb0 hB hH hvalid hmap ht hnorm hw have hpush := DescentWeightedCauchy.bounded_energy_pushforward s t (fun x => (newLabel x, newRow x)) w P B hmap hw apply hpush.trans rw [Finset.mul_sum] apply Finset.sum_le_sum intro z hz have hval : ∀ x ∈ s.filter (fun x => (newLabel x, newRow x) = z), Valid x z.1 b0 z.2 := by intro x hx have he := (Finset.mem_filter.mp hx).2 have hv := hvalid x (Finset.mem_filter.mp hx).1 have h1 : newLabel x = z.1 := congrArg Prod.fst he have h2 : newRow x = z.2 := congrArg Prod.snd he simpa only [h1, h2] using hv have hfiber := hc (s.filter (fun x => (newLabel x, newRow x) = z)) z.1 b0 z.2 (ht z hz) hb0 hval have hgrowth : (Ideal.absNorm z.1 : ℝ) * Ideal.absNorm b0 ≤ H * Ideal.absNorm b0 := mul_le_mul_of_nonneg_right (hnorm z hz) (by positivity) have hcard := hfiber.trans (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (by positivity) hgrowth hε.le) hC.le) have hterm := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hcard hB) (sq_nonneg ‖P z‖) simpa only [mul_assoc] using hterm end SecondPassFiber open scoped BigOperators Classical namespace FirstPassCubeLabels open ActualEisensteinCubic theorem conductorExponent_val (parityBit ε₁ ε₂ : Bool) : (conductorExponent parityBit ε₁ ε₂).val = (bit ε₁ + 5 * bit ε₂ + 3 * bit parityBit) % 6 := by cases parityBit <;> cases ε₁ <;> cases ε₂ <;> decide theorem cube_pair_exponent_mod (m₁ m₂ : ℕ) (ε₁ ε₂ : Bool) : (bit ε₁ + 5 * bit ε₂ + 3 * m₁ + 15 * m₂) % 6 = (conductorExponent (parity (m₁ + m₂)) ε₁ ε₂).val := by have hmod := Nat.mod_lt (m₁ + m₂) (by decide : 0 < 2) rw [conductorExponent_val] cases ε₁ <;> cases ε₂ <;> by_cases h : (m₁ + m₂) % 2 = 1 <;> norm_num [parity, bit, h] <;> omega def cubePairLocal (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (m₁ m₂ : ℕ) (ε₁ ε₂ : Bool) (z : O) : ℂ := let q := canonicalSextic P hg (Ideal.Quotient.mk P z) q ^ bit ε₁ * star (q ^ bit ε₂) * q ^ (3 * m₁) * star (q ^ (3 * m₂)) theorem cubePairLocal_eq_character (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (m₁ m₂ : ℕ) (ε₁ ε₂ : Bool) (hm : 0 < m₁ + m₂ + bit ε₁ + bit ε₂) (z : O) : cubePairLocal P hg m₁ m₂ ε₁ ε₂ z = (canonicalSextic P hg ^ (conductorExponent (parity (m₁ + m₂)) ε₁ ε₂).val) (Ideal.Quotient.mk P z) := by let q := canonicalSextic P hg (Ideal.Quotient.mk P z) have hstar : star q = q ^ 5 := by have hs := canonicalSextic_conj_as_row_label P hg z change star q = q * q ^ 4 at hs rw [hs] ring have hleft : cubePairLocal P hg m₁ m₂ ε₁ ε₂ z = q ^ (bit ε₁ + 5 * bit ε₂ + 3 * m₁ + 15 * m₂) := by change q ^ bit ε₁ * star (q ^ bit ε₂) * q ^ (3 * m₁) * star (q ^ (3 * m₂)) = _ simp only [star_pow, hstar, ← pow_mul, ← pow_add] congr 1 omega rw [hleft] by_cases hz : z ∈ P · have hq : q = 0 := by change canonicalSextic P hg (Ideal.Quotient.mk P z) = 0 rw [Ideal.Quotient.eq_zero_iff_mem.mpr hz, MulChar.map_zero] rw [hq, Ideal.Quotient.eq_zero_iff_mem.mpr hz, MulChar.map_zero] exact zero_pow (by omega) · have hu : IsUnit (Ideal.Quotient.mk P z) := by let : Field (O ⧸ P) := Ideal.Quotient.field P exact isUnit_iff_ne_zero.mpr (fun h => hz (Ideal.Quotient.eq_zero_iff_mem.mp h)) have h6 : q ^ 6 = 1 := by have h := canonicalSextic_sixth_power_mask P hg z simp only [map_pow, ite_eq_right hz] at h exact h rw [pow_eq_pow_mod _ h6, cube_pair_exponent_mod] exact (MulChar.pow_apply_coe _ _ hu.unit).symm def cubeConductorSupport {κ : Type*} (B : Finset κ) (v₁ v₂ : κ → ℕ) (ε₁ ε₂ : κ → Bool) : Finset κ := B.filter (fun j => conductorExponent (parity (v₁ j + v₂ j)) (ε₁ j) (ε₂ j) ≠ 0) def cubePrincipalSupport {κ : Type*} (B : Finset κ) (v₁ v₂ : κ → ℕ) (ε₁ ε₂ : κ → Bool) : Finset κ := B.filter (fun j => conductorExponent (parity (v₁ j + v₂ j)) (ε₁ j) (ε₂ j) = 0) def multiplicityRow {κ : Type*} (P : κ → Ideal O) [∀ j, (P j).IsMaximal] (hg : ∀ j, lambda ∉ P j) (B : Finset κ) (v : κ → ℕ) (z : O) : ℂ := ∏ j ∈ B, canonicalSextic (P j) (hg j) (Ideal.Quotient.mk (P j) z) ^ v j def cubePairRow {κ : Type*} (P : κ → Ideal O) [∀ j, (P j).IsMaximal] (hg : ∀ j, lambda ∉ P j) (B : Finset κ) (v₁ v₂ : κ → ℕ) (ε₁ ε₂ : κ → Bool) (z : O) : ℂ := finiteSquarefreeRow P hg (B.filter fun j => ε₁ j) z * star (finiteSquarefreeRow P hg (B.filter fun j => ε₂ j) z) * multiplicityRow P hg B v₁ z ^ 3 * star (multiplicityRow P hg B v₂ z ^ 3) private theorem row_filter_eq_power_product {κ : Type*} (P : κ → Ideal O) [∀ j, (P j).IsMaximal] (hg : ∀ j, lambda ∉ P j) (B : Finset κ) (ε : κ → Bool) (z : O) : finiteSquarefreeRow P hg (B.filter fun j => ε j) z = ∏ j ∈ B, canonicalSextic (P j) (hg j) (Ideal.Quotient.mk (P j) z) ^ bit (ε j) := by simp only [finiteSquarefreeRow, Finset.prod_filter] apply Finset.prod_congr rfl intro j hj cases ε j <;> simp [bit] theorem cubePairRow_eq_product {κ : Type*} (P : κ → Ideal O) [∀ j, (P j).IsMaximal] (hg : ∀ j, lambda ∉ P j) (B : Finset κ) (v₁ v₂ : κ → ℕ) (ε₁ ε₂ : κ → Bool) (z : O) : cubePairRow P hg B v₁ v₂ ε₁ ε₂ z = ∏ j ∈ B, cubePairLocal (P j) (hg j) (v₁ j) (v₂ j) (ε₁ j) (ε₂ j) z := by simp only [cubePairRow, row_filter_eq_power_product, multiplicityRow, ← Finset.prod_pow, star_prod, ← Finset.prod_mul_distrib, ← pow_mul] apply Finset.prod_congr rfl intro j hj simp only [cubePairLocal, Nat.mul_comm] private theorem principal_product_eq_mask {κ : Type*} (P : κ → Ideal O) [∀ j, (P j).IsMaximal] (B : Finset κ) (z : O) : (∏ j ∈ B, (1 : MulChar (O ⧸ P j) ℂ) (Ideal.Quotient.mk (P j) z)) = rowCoprimeMask P B z := by by_cases h : ∃ j ∈ B, z ∈ P j · rw [rowCoprimeMask, ite_eq_left h] obtain ⟨j, hj, hz⟩ := h apply Finset.prod_eq_zero hj rw [Ideal.Quotient.eq_zero_iff_mem.mpr hz, MulChar.map_zero] · rw [rowCoprimeMask, ite_eq_right h] apply Finset.prod_eq_one intro j hj apply MulChar.one_apply let : Field (O ⧸ P j) := Ideal.Quotient.field (P j) apply isUnit_iff_ne_zero.mpr exact fun hz => h ⟨j, hj, Ideal.Quotient.eq_zero_iff_mem.mp hz⟩ theorem cubePairRow_conductor_selection {κ : Type*} (P : κ → Ideal O) [∀ j, (P j).IsMaximal] (hg : ∀ j, lambda ∉ P j) (B : Finset κ) (v₁ v₂ : κ → ℕ) (ε₁ ε₂ : κ → Bool) (hcover : ∀ j ∈ B, 0 < v₁ j + v₂ j + bit (ε₁ j) + bit (ε₂ j)) (z : O) : cubePairRow P hg B v₁ v₂ ε₁ ε₂ z = rowCoprimeMask P (cubePrincipalSupport B v₁ v₂ ε₁ ε₂) z * finiteSexticRow (fun j : cubeConductorSupport B v₁ v₂ ε₁ ε₂ => P j.val) (fun j => hg j.val) (fun j => (conductorExponent (parity (v₁ j.val + v₂ j.val)) (ε₁ j.val) (ε₂ j.val)).val) z := by let e := fun j => conductorExponent (parity (v₁ j + v₂ j)) (ε₁ j) (ε₂ j) let f := fun j => (canonicalSextic (P j) (hg j) ^ (e j).val) (Ideal.Quotient.mk (P j) z) have hlocal : cubePairRow P hg B v₁ v₂ ε₁ ε₂ z = ∏ j ∈ B, f j := by rw [cubePairRow_eq_product] apply Finset.prod_congr rfl intro j hj exact cubePairLocal_eq_character (P j) (hg j) (v₁ j) (v₂ j) (ε₁ j) (ε₂ j) (hcover j hj) z have hzero : (∏ j ∈ B.filter (fun j => e j = 0), f j) = rowCoprimeMask P (cubePrincipalSupport B v₁ v₂ ε₁ ε₂) z := by rw [← principal_product_eq_mask] apply Finset.prod_congr rfl intro j hj have he : e j = 0 := (Finset.mem_filter.mp hj).2 simp only [f, he, ZMod.val_zero, pow_zero] rw [hlocal, ← Finset.prod_filter_mul_prod_filter_not B (fun j => e j = 0) f, hzero] congr 1 exact (Finset.prod_coe_sort (s := cubeConductorSupport B v₁ v₂ ε₁ ε₂) (f := f)).symm open scoped SchwartzMap ContDiff open ConcreteTraceCRT open EisensteinSchwartzPoisson (paperRadialFourier) end FirstPassCubeLabels end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.CrossFactorization namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace FirstPassCubeLabels open ActualEisensteinCubic open MixedCrossSeparation (crossSymbol quadraticCrossPhase columnPrimeCoprime) open FiniteGaussPhase (canonicalProductGauss) theorem blockCross_union_left {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S T C : Finset ι) (hd : Disjoint S T) (e : ι → ℕ) : blockCross p hg (S ∪ T) C e = blockCross p hg S C e * blockCross p hg T C e := Finset.prod_union hd def threeBlockExponent {ι : Type*} [DecidableEq ι] (N P : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (i : ι) : ℕ := if i ∈ N then 5 else if i ∈ P then 1 else (conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val theorem gaussBlock_three_cube_partition {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (N P B : Finset ι) (hNP : Disjoint N P) (hNB : Disjoint N B) (hPB : Disjoint P B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) : gaussBlock p hp hg ((N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂) (threeBlockExponent N P v ε₁ ε₂) = gaussBlock p hp hg N (fun _ => 5) * gaussBlock p hp hg P (fun _ => 1) * gaussBlock p hp hg (cubeActiveSupport B v ε₁ ε₂) (fun k => (conductorExponent (parity (v k)) (ε₁ k) (ε₂ k)).val) * quadraticCrossPhase p hg N P * mixedCubeCross p hg N B v ε₁ ε₂ true * mixedCubeCross p hg P B v ε₁ ε₂ false := by let C := cubeActiveSupport B v ε₁ ε₂ let e := threeBlockExponent N P v ε₁ ε₂ have hNC : Disjoint N C := hNB.mono_right (Finset.filter_subset _ _) have hPC : Disjoint P C := hPB.mono_right (Finset.filter_subset _ _) have hNPC : Disjoint (N ∪ P) C := Finset.disjoint_union_left.mpr ⟨hNC, hPC⟩ have hN (i : ι) (hi : i ∈ N) : e i = 5 := by simp [e, threeBlockExponent, hi] have hP (i : ι) (hi : i ∈ P) : e i = 1 := by have hn : i ∉ N := fun h => Finset.disjoint_left.mp hNP h hi simp [e, threeBlockExponent, hn, hi] have hC (i : ι) (hi : i ∈ C) : e i = (conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val := by have hn : i ∉ N := fun h => Finset.disjoint_left.mp hNC h hi have hp' : i ∉ P := fun h => Finset.disjoint_left.mp hPC h hi simp [e, threeBlockExponent, hn, hp'] have hcrossNP : blockCross p hg N P e = quadraticCrossPhase p hg N P := by apply Finset.prod_congr rfl intro i hi apply Finset.prod_congr rfl intro k hk rw [hN i hi, hP k hk, pow_one] exact MixedCrossSeparation.mixed_cross_eq_quadratic p hg i k (hpr i) (hpr k) have hcrossNC : blockCross p hg N C e = mixedCubeCross p hg N B v ε₁ ε₂ true := by apply Finset.prod_congr rfl intro i hi apply Finset.prod_congr rfl intro k hk rw [hN i hi, hC k hk] rfl have hcrossPC : blockCross p hg P C e = mixedCubeCross p hg P B v ε₁ ε₂ false := by apply Finset.prod_congr rfl intro i hi apply Finset.prod_congr rfl intro k hk rw [hP i hi, hC k hk] rfl change gaussBlock p hp hg ((N ∪ P) ∪ C) e = _ rw [gaussBlock_union p hp hg (N ∪ P) C hNPC, gaussBlock_union p hp hg N P hNP, blockCross_union_left p hg N P C hNP, gaussBlock_congr p hp hg N e (fun _ => 5) hN, gaussBlock_congr p hp hg P e (fun _ => 1) hP, gaussBlock_congr p hp hg C e _ hC, hcrossNP, hcrossNC, hcrossPC] ring theorem canonicalProductGauss_three_cube_partition {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (N P B : Finset ι) (hNP : Disjoint N P) (hNB : Disjoint N B) (hPB : Disjoint P B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) : canonicalProductGauss (fun i : ↥((N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂) => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop _) (fun i => hg i.val) (fun i => threeBlockExponent N P v ε₁ ε₂ i.val) = gaussBlock p hp hg N (fun _ => 5) * gaussBlock p hp hg P (fun _ => 1) * gaussBlock p hp hg (cubeActiveSupport B v ε₁ ε₂) (fun k => (conductorExponent (parity (v k)) (ε₁ k) (ε₂ k)).val) * quadraticCrossPhase p hg N P * (star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N (crtLabel p B v ε₁ ε₂ true)) * quadraticCrossPhase p hg N (cubeOddSupport B v ε₁ ε₂)) * (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg P (crtLabel p B v ε₁ ε₂ false) * quadraticCrossPhase p hg P (cubeOddSupport B v ε₁ ε₂)) := by have he : ∀ i ∈ (N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂, threeBlockExponent N P v ε₁ ε₂ i ≠ 0 := by intro i hi by_cases hn : i ∈ N · simp [threeBlockExponent, hn] by_cases hp' : i ∈ P · simp [threeBlockExponent, hn, hp'] · have hiC : i ∈ cubeActiveSupport B v ε₁ ε₂ := by simpa [hn, hp'] using hi simp only [threeBlockExponent, ite_eq_right hn, ite_eq_right hp'] exact (ZMod.val_eq_zero _).not.mpr (Finset.mem_filter.mp hiC).2 rw [canonicalProductGauss_eq_gaussBlock p hp hcop hg _ _ he, gaussBlock_three_cube_partition p hp hg hpr N P B hNP hNB hPB, mixedCubeCross_eq_row_quadratic p hcop hg hpr N B hNB, mixedCubeCross_eq_row_quadratic p hcop hg hpr P B hPB] rfl theorem gaussBlock_eq_mobius_converted {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (S : Finset ι) (side : Bool) : gaussBlock p hp hg S (fun _ => if side then 5 else 1) = FirstCauchyArithmetic.supportMobius (fun i => Ideal.span {p i}) S * MixedCrossSeparation.convertedColumnBlock p hp hg S side := by have hinj : Function.Injective (fun i => Ideal.span {p i}) := by intro i k hik by_contra hne have ht := (hcop hne).sup_eq rw [hik, sup_idem] at ht exact (inferInstance : (Ideal.span {p k}).IsMaximal).ne_top ht have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance rw [FirstCauchyArithmetic.supportMobius, prime_product_moebius (fun i => Ideal.span {p i}) hprime hinj S] unfold gaussBlock MixedCrossSeparation.convertedColumnBlock rw [← Finset.prod_neg] apply Finset.prod_congr rfl intro i hi have hl := MixedGaussConversion.neg_localGauss_eq_converted (p i) (hp i) (hg i) (hc i) (hpr i) side change (∏ k ∈ S.erase i, crossSymbol p hg i k ^ (if side then 5 else 1)) * MixedGaussConversion.localGauss (p i) (hp i) (hg i) (if side then 5 else 1) = -((∏ k ∈ S.erase i, crossSymbol p hg i k ^ (if side then 5 else 1)) * MixedGaussConversion.convertedLocal (p i) (hp i) (hg i) side) rw [← hl] ring theorem a_weighted_three_cube_gauss {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (N P B : Finset ι) (hNP : Disjoint N P) (hNB : Disjoint N B) (hPB : Disjoint P B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) : star (MixedCrossSeparation.columnCoefficient p hp hcop hg N * C₁ N) * (MixedCrossSeparation.columnCoefficient p hp hcop hg P * C₂ P) * canonicalProductGauss (fun i : ↥((N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂) => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop _) (fun i => hg i.val) (fun i => threeBlockExponent N P v ε₁ ε₂ i.val) = (gaussBlock p hp hg (cubeActiveSupport B v ε₁ ε₂) (fun k => (conductorExponent (parity (v k)) (ε₁ k) (ε₂ k)).val) * quadraticCrossPhase p hg N P * quadraticCrossPhase p hg N (cubeOddSupport B v ε₁ ε₂) * quadraticCrossPhase p hg P (cubeOddSupport B v ε₁ ε₂)) * star (FirstCauchyArithmetic.supportMobius (fun i => Ideal.span {p i}) N * FirstCauchyArithmetic.firstPassColumnMinus p hp hcop hg C₁ (crtLabel p B v ε₁ ε₂ true) N) * (FirstCauchyArithmetic.supportMobius (fun i => Ideal.span {p i}) P * FirstCauchyArithmetic.firstPassColumnPlus p hp hcop hg C₂ (crtLabel p B v ε₁ ε₂ false) P) := by rw [canonicalProductGauss_three_cube_partition p hp hcop hg hpr N P B hNP hNB hPB] have hconvN := gaussBlock_eq_mobius_converted p hp hcop hg hc hpr N true have hconvP := gaussBlock_eq_mobius_converted p hp hcop hg hc hpr P false simp only [Bool.false_eq_true, ↓reduceIte] at hconvN hconvP rw [hconvN, hconvP] have hn := MixedCrossSeparation.columnCoefficient_cancel_true p hp hcop hg hc hpr N have hp' := MixedCrossSeparation.columnCoefficient_cancel_false p hp hcop hg hc hpr P simp only [FirstCauchyArithmetic.firstPassColumnMinus, FirstCauchyArithmetic.firstPassColumnPlus, star_mul, star_star, FirstCauchyArithmetic.star_supportMobius] calc _ = (star (MixedCrossSeparation.columnCoefficient p hp hcop hg N) * MixedCrossSeparation.convertedColumnBlock p hp hg N true) * (MixedCrossSeparation.columnCoefficient p hp hcop hg P * MixedCrossSeparation.convertedColumnBlock p hp hg P false) * (star (C₁ N) * C₂ P * FirstCauchyArithmetic.supportMobius (fun i => Ideal.span {p i}) N * FirstCauchyArithmetic.supportMobius (fun i => Ideal.span {p i}) P * gaussBlock p hp hg (cubeActiveSupport B v ε₁ ε₂) (fun k => (conductorExponent (parity (v k)) (ε₁ k) (ε₂ k)).val) * quadraticCrossPhase p hg N P * quadraticCrossPhase p hg N (cubeOddSupport B v ε₁ ε₂) * quadraticCrossPhase p hg P (cubeOddSupport B v ε₁ ε₂) * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N (crtLabel p B v ε₁ ε₂ true)) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg P (crtLabel p B v ε₁ ε₂ false)) := by ring _ = _ := by rw [hn, hp']; ring end FirstPassCubeLabels namespace QuadraticGaussRay open EisensteinEPrimaryPhase ActualEisensteinCoordinates ActualEisensteinCubic theorem quadraticRayValue_square (r : Coord) (hr : odd r) : quadraticRayValue (mul r r) = 1 := by have hi : (Complex.I : ℂ)⁻¹ = -Complex.I := by apply inv_eq_of_mul_eq_one_right norm_num have h : mul r r = (1, 0) ∨ mul r r = (3, 3) ∨ mul r r = (0, 1) := by unfold EisensteinEPrimaryPhase.odd at hr decide +revert rcases h with h | h | h · rw [h] change breveGaussianFourTerms 1 0 = 1 rw [breveGaussianFourTerms_formula] norm_num [hi] · rw [h] change breveGaussianFourTerms 3 3 = 1 rw [breveGaussianFourTerms_formula] norm_num [hi] · rw [h] change breveGaussianFourTerms 0 1 = 1 rw [breveGaussianFourTerms_formula] norm_num [hi] ring theorem quadraticRayValue_same_residue_product (a b : ActualEisensteinCubic.O) (ha : odd (residue a)) (hab : residue a = residue b) : quadraticRayValue (residue (a * b)) = 1 := by rw [residue_mul, ← hab] exact quadraticRayValue_square _ ha end QuadraticGaussRay namespace QuadraticMainBoundaryFibers abbrev O := ActualEisensteinCubic.O open IdealMobiusDivisorSum QuadraticMainBoundary end QuadraticMainBoundaryFibers namespace CoprimeSieveOperator open FiniteSieveOperator CoprimeMobiusExtension theorem square_norm_sum {n : Type*} [Fintype n] (z : n → ℂ) : (↑(‖∑ j, z j‖ ^ 2) : ℂ) = ∑ j, ∑ k, star (z j) * z k := by rw [Complex.sq_norm, Complex.normSq_eq_conj_mul_self] simp only [map_sum, starRingEnd_apply] rw [Finset.sum_mul_sum] theorem disjoint_gram_expansion {ι n : Type*} [DecidableEq ι] [Fintype n] (B : Finset ι) (support : n → Finset ι) (hs : ∀ j, support j ⊆ B) (z : n → ℂ) : (∑ j, ∑ k, if Disjoint (support j) (support k) then star (z j) * z k else 0) = ∑ D ∈ B.powerset, (-1 : ℂ) ^ D.card * (↑(‖∑ j, if D ⊆ support j then z j else 0‖ ^ 2) : ℂ) := by have hp (j k : n) : (if Disjoint (support j) (support k) then star (z j) * z k else 0) = ∑ D ∈ B.powerset, (-1 : ℂ) ^ D.card * (if D ⊆ support j ∧ D ⊆ support k then star (z j) * z k else 0) := by calc _ = (if Disjoint (support j) (support k) then (1 : ℂ) else 0) * (star (z j) * z k) := by split_ifs <;> simp _ = _ := by rw [disjoint_indicator_expansion B _ _ (hs j) (hs k), Finset.sum_mul] apply Finset.sum_congr rfl intro D _ split_ifs <;> simp simp_rw [hp] calc _ = ∑ j, ∑ D ∈ B.powerset, ∑ k, (-1 : ℂ) ^ D.card * (if D ⊆ support j ∧ D ⊆ support k then star (z j) * z k else 0) := by apply Finset.sum_congr rfl intro j _ exact Finset.sum_comm _ = ∑ D ∈ B.powerset, ∑ j, ∑ k, (-1 : ℂ) ^ D.card * (if D ⊆ support j ∧ D ⊆ support k then star (z j) * z k else 0) := Finset.sum_comm _ = _ := by apply Finset.sum_congr rfl intro D _ simp_rw [← Finset.mul_sum] congr 1 rw [square_norm_sum] apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ by_cases hj : D ⊆ support j <;> by_cases hk : D ⊆ support k <;> simp [hj, hk] theorem masked_coefficient_energy {ι n : Type*} [DecidableEq ι] [Fintype n] (B : Finset ι) (support : n → Finset ι) (hs : ∀ j, support j ⊆ B) (a : n → ℂ) : (∑ D ∈ B.powerset, ∑ j, ‖if D ⊆ support j then a j else 0‖ ^ 2) = ∑ j, (2 : ℝ) ^ (support j).card * ‖a j‖ ^ 2 := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ have heq : B.powerset.filter (fun D => D ⊆ support j) = (support j).powerset := by ext D simp only [Finset.mem_filter, Finset.mem_powerset] exact ⟨And.right, fun h => ⟨h.trans (hs j), h⟩⟩ have hite (D : Finset ι) : ‖if D ⊆ support j then a j else 0‖ ^ 2 = if D ⊆ support j then ‖a j‖ ^ 2 else 0 := by split_ifs <;> simp simp_rw [hite] rw [← Finset.sum_filter, heq] simp theorem weighted_energy_bound {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (A : Matrix m n ℂ) (a : n → ℂ) (w : m → ℂ) (W : ℝ) (hW : 0 ≤ W) (hw : ∀ i, ‖w i‖ ≤ W) : ‖∑ i, w i * (↑(‖∑ j, A i j * a j‖ ^ 2) : ℂ)‖ ≤ W * ‖operator A‖ ^ 2 * ∑ j, ‖a j‖ ^ 2 := by calc _ ≤ ∑ i, ‖w i * (↑(‖∑ j, A i j * a j‖ ^ 2) : ℂ)‖ := norm_sum_le _ _ _ ≤ ∑ i, W * ‖∑ j, A i j * a j‖ ^ 2 := by apply Finset.sum_le_sum intro i _ rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] exact mul_le_mul_of_nonneg_right (hw i) (sq_nonneg _) _ = W * ∑ i, ‖∑ j, A i j * a j‖ ^ 2 := (Finset.mul_sum ..).symm _ ≤ _ := by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (energy_bound A a) hW theorem coprime_gram_operator_bound {ι m n : Type*} [DecidableEq ι] [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (B : Finset ι) (support : n → Finset ι) (hs : ∀ j, support j ⊆ B) (A : Matrix m n ℂ) (a : n → ℂ) (w : m → ℂ) (W : ℝ) (hW : 0 ≤ W) (hw : ∀ i, ‖w i‖ ≤ W) : ‖∑ i, w i * (∑ j, ∑ k, if Disjoint (support j) (support k) then star (A i j * a j) * (A i k * a k) else 0)‖ ≤ W * ‖operator A‖ ^ 2 * ∑ j, (2 : ℝ) ^ (support j).card * ‖a j‖ ^ 2 := by have heq : (∑ i, w i * (∑ j, ∑ k, if Disjoint (support j) (support k) then star (A i j * a j) * (A i k * a k) else 0)) = ∑ D ∈ B.powerset, (-1 : ℂ) ^ D.card * ∑ i, w i * (↑(‖∑ j, A i j * (if D ⊆ support j then a j else 0)‖ ^ 2) : ℂ) := by simp_rw [disjoint_gram_expansion B support hs, Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro D _ apply Finset.sum_congr rfl intro i _ have hz : (∑ j, if D ⊆ support j then A i j * a j else 0) = ∑ j, A i j * (if D ⊆ support j then a j else 0) := by apply Finset.sum_congr rfl intro j _ split_ifs <;> simp rw [hz] ring rw [heq] calc _ ≤ ∑ D ∈ B.powerset, ‖(-1 : ℂ) ^ D.card * ∑ i, w i * (↑(‖∑ j, A i j * (if D ⊆ support j then a j else 0)‖ ^ 2) : ℂ)‖ := norm_sum_le _ _ _ ≤ ∑ D ∈ B.powerset, W * ‖operator A‖ ^ 2 * ∑ j, ‖if D ⊆ support j then a j else 0‖ ^ 2 := by apply Finset.sum_le_sum intro D _ simp only [norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul] exact weighted_energy_bound A (fun j => if D ⊆ support j then a j else 0) w W hW hw _ = _ := by rw [← Finset.mul_sum, masked_coefficient_energy B support hs a] end CoprimeSieveOperator namespace IdealCoprimeSieveOperator abbrev O := ActualEisensteinCubic.O open IdealMobiusDivisorSum CoprimeSieveOperator FiniteSieveOperator open UniqueFactorizationMonoid theorem primeSupport_disjoint_iff {I J : Ideal O} (hI : I ≠ 0) (hJ : J ≠ 0) : Disjoint (primeSupport I) (primeSupport J) ↔ IsCoprime I J := by constructor · intro h have hr : IsRelPrime I J := (isRelPrime_iff_no_prime_factors hI).mpr (by intro P hPI hPJ hP apply Finset.disjoint_left.mp h · apply Multiset.mem_toFinset.mpr exact (Ideal.mem_normalizedFactors_iff hI).mpr ⟨Ideal.isPrime_of_prime hP, Ideal.dvd_iff_le.mp hPI⟩ · apply Multiset.mem_toFinset.mpr exact (Ideal.mem_normalizedFactors_iff hJ).mpr ⟨Ideal.isPrime_of_prime hP, Ideal.dvd_iff_le.mp hPJ⟩) apply Ideal.isCoprime_iff_gcd.mpr exact associated_iff_eq.mp (associated_one_iff_isUnit.mpr (gcd_isUnit_iff_isRelPrime.mpr hr)) · intro h exact Multiset.disjoint_toFinset.mpr (disjoint_normalizedFactors h.isRelPrime) def supportConstant (ε : ℝ) (hε : 0 < ε) : ℝ := (SquarefreeDivisorBound.prime_support_subsets_bound ε hε).choose theorem supportConstant_pos (ε : ℝ) (hε : 0 < ε) : 0 < supportConstant ε hε := (SquarefreeDivisorBound.prime_support_subsets_bound ε hε).choose_spec.1 theorem support_card_bound (ε : ℝ) (hε : 0 < ε) (I : Ideal O) (hI : I ≠ 0) : (2 : ℝ) ^ (primeSupport I).card ≤ supportConstant ε hε * (Ideal.absNorm I : ℝ) ^ ε := (SquarefreeDivisorBound.prime_support_subsets_bound ε hε).choose_spec.2 I hI theorem ideal_coprime_gram_operator_bound {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (ε : ℝ) (hε : 0 < ε) (column : n → Ideal O) (hcol : ∀ j, column j ≠ 0) (N : ℝ) (_hN : 0 ≤ N) (hnorm : ∀ j, (Ideal.absNorm (column j) : ℝ) ≤ N) (A : Matrix m n ℂ) (a : n → ℂ) (w : m → ℂ) (W : ℝ) (hW : 0 ≤ W) (hw : ∀ i, ‖w i‖ ≤ W) : ‖∑ i, w i * (∑ j, ∑ k, if IsCoprime (column j) (column k) then star (A i j * a j) * (A i k * a k) else 0)‖ ≤ W * ‖operator A‖ ^ 2 * (supportConstant ε hε * N ^ ε) * ∑ j, ‖a j‖ ^ 2 := by let B : Finset (Ideal O) := Finset.univ.biUnion (fun j => primeSupport (column j)) have hs (j : n) : primeSupport (column j) ⊆ B := by intro P hP exact Finset.mem_biUnion.mpr ⟨j, Finset.mem_univ j, hP⟩ have h := coprime_gram_operator_bound B (fun j => primeSupport (column j)) hs A a w W hW hw simp_rw [primeSupport_disjoint_iff (hcol _) (hcol _)] at h apply h.trans have hmass : (∑ j, (2 : ℝ) ^ (primeSupport (column j)).card * ‖a j‖ ^ 2) ≤ (supportConstant ε hε * N ^ ε) * ∑ j, ‖a j‖ ^ 2 := by rw [Finset.mul_sum] apply Finset.sum_le_sum intro j _ apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) exact (support_card_bound ε hε (column j) (hcol j)).trans (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (Nat.cast_nonneg _) (hnorm j) hε.le) (supportConstant_pos ε hε).le) simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hmass (mul_nonneg hW (sq_nonneg ‖operator A‖)) open ConcretePrimeRowBridge end IdealCoprimeSieveOperator open scoped BigOperators Classical namespace QuadraticMainOperatorBound abbrev O := ActualEisensteinCubic.O open IdealMobiusDivisorSum QuadraticMainBoundary IdealCoprimeSieveOperator FiniteSieveOperator def mainWeight (K : ℝ) (H D E : Ideal O) : ℂ := (cutoffDifference K H D : ℂ) / (Real.sqrt (Ideal.absNorm (H * D * E) : ℝ) : ℂ) theorem mainWeight_norm_le (K : ℝ) (hK : 0 < K) (H D E : Ideal O) (hD : D ≠ 0) (hE : E ≠ 0) : ‖mainWeight K H D E‖ ≤ 1 / Real.sqrt K := by by_cases hc : cutoffDifference K H D = 0 · simp [mainWeight, hc] have hn : K < (Ideal.absNorm (H * D * E) : ℝ) := by exact lt_of_not_ge (fun h => hc (cutoffDifference_eq_zero_of_product_le K hD hE h)) have hsq : 0 < Real.sqrt K := Real.sqrt_pos.mpr hK have hle := Real.sqrt_le_sqrt hn.le rw [mainWeight, cutoffDifference_eq_neg_one_of_nonzero K H D hD hc] simp only [norm_div, Complex.ofReal_neg, Complex.ofReal_one, norm_neg, norm_one, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg _)] exact one_div_le_one_div_of_le hsq hle theorem main_difference_operator_bound {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (ε : ℝ) (hε : 0 < ε) (K : ℝ) (hK : 0 < K) (G : Ideal O) (hG : G ≠ 0) (H : m → Ideal O) (column : n → Ideal O) (hcol : ∀ j, column j ≠ 0) (N : ℝ) (hN : 0 ≤ N) (hnorm : ∀ j, (Ideal.absNorm (column j) : ℝ) ≤ N) (A : Matrix m n ℂ) (a : n → ℂ) (r : Ideal O → Ideal O → n → ℂ) (hr : ∀ D E j, ‖r D E j‖ ≤ 1) : ‖∑ D ∈ idealDivisors G, ∑ E ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius E : ℂ) * (∑ i, mainWeight K (H i) D E * (∑ j, ∑ k, if IsCoprime (column j) (column k) then star (A i j * (a j * r D E j)) * (A i k * (a k * r D E k)) else 0))‖ ≤ ((idealDivisors G).card : ℝ) ^ 2 * ((1 / Real.sqrt K) * ‖operator A‖ ^ 2 * (supportConstant ε hε * N ^ ε) * ∑ j, ‖a j‖ ^ 2) := by let B := (1 / Real.sqrt K) * ‖operator A‖ ^ 2 * (supportConstant ε hε * N ^ ε) * ∑ j, ‖a j‖ ^ 2 have hB : 0 ≤ B := by have hC := (supportConstant_pos ε hε).le dsimp [B] positivity have hterm (D : Ideal O) (hD : D ∈ idealDivisors G) (E : Ideal O) (hE : E ∈ idealDivisors G) : ‖(UniqueFactorizationMonoid.moebius E : ℂ) * (∑ i, mainWeight K (H i) D E * (∑ j, ∑ k, if IsCoprime (column j) (column k) then star (A i j * (a j * r D E j)) * (A i k * (a k * r D E k)) else 0))‖ ≤ B := by have hD0 := IdealDivisorBound.divisor_ne_zero hG hD have hE0 := IdealDivisorBound.divisor_ne_zero hG hE have he := ideal_coprime_gram_operator_bound ε hε column hcol N hN hnorm A (fun j => a j * r D E j) (fun i => mainWeight K (H i) D E) (1 / Real.sqrt K) (by positivity) (fun i => mainWeight_norm_le K hK (H i) D E hD0 hE0) have hm : (∑ j, ‖a j * r D E j‖ ^ 2) ≤ ∑ j, ‖a j‖ ^ 2 := by apply Finset.sum_le_sum intro j _ apply pow_le_pow_left₀ (norm_nonneg _) rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (hr D E j) have heB : ‖∑ i, mainWeight K (H i) D E * (∑ j, ∑ k, if IsCoprime (column j) (column k) then star (A i j * (a j * r D E j)) * (A i k * (a k * r D E k)) else 0)‖ ≤ B := by apply he.trans exact mul_le_mul_of_nonneg_left hm (by have hC := (supportConstant_pos ε hε).le positivity) have hmu : ‖(UniqueFactorizationMonoid.moebius E : ℂ)‖ ≤ 1 := by unfold UniqueFactorizationMonoid.moebius split_ifs <;> simp rw [norm_mul] calc _ ≤ 1 * B := mul_le_mul hmu heB (norm_nonneg _) (by norm_num) _ = B := one_mul B calc _ ≤ ∑ D ∈ idealDivisors G, ‖∑ E ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius E : ℂ) * (∑ i, mainWeight K (H i) D E * (∑ j, ∑ k, if IsCoprime (column j) (column k) then star (A i j * (a j * r D E j)) * (A i k * (a k * r D E k)) else 0))‖ := norm_sum_le _ _ _ ≤ ∑ D ∈ idealDivisors G, ∑ E ∈ idealDivisors G, B := by apply Finset.sum_le_sum intro D hD exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun E hE => hterm D hD E hE)) _ = _ := by simp only [Finset.sum_const, nsmul_eq_mul, B]; ring open ConcretePrimeRowBridge ActualEisensteinCubic theorem ideal_quadraticRow_norm_le_one (F : Finset (Ideal O)) (hFpos : ∀ I ∈ F, I ≠ ⊥) (hFgood : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (J : Ideal O) (z : O) : ‖(idealSexticRow F hFpos hFgood J z) ^ 3‖ ≤ 1 := by let : ∀ i : primePool F, (i.val).IsMaximal := primePool_maximal F hFpos rw [norm_pow] apply pow_le_one₀ (norm_nonneg _) exact finiteSquarefreeRow_norm_le_one (fun i : primePool F => i.val) (primePool_good F hFgood) (idealSupport F J) z end QuadraticMainOperatorBound end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.CoprimeBilinearBound namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace CoprimeBilinearSieve open FiniteSieveOperator CoprimeSieveOperator CoprimeMobiusExtension theorem disjoint_bilinear_expansion {ι n p : Type*} [DecidableEq ι] [Fintype n] [Fintype p] (B : Finset ι) (left : n → Finset ι) (right : p → Finset ι) (hl : ∀ j, left j ⊆ B) (hr : ∀ k, right k ⊆ B) (z : n → ℂ) (v : p → ℂ) : (∑ j, ∑ k, if Disjoint (left j) (right k) then star (z j) * v k else 0) = ∑ D ∈ B.powerset, (-1 : ℂ) ^ D.card * (star (∑ j, if D ⊆ left j then z j else 0) * (∑ k, if D ⊆ right k then v k else 0)) := by have hp (j : n) (k : p) : (if Disjoint (left j) (right k) then star (z j) * v k else 0) = ∑ D ∈ B.powerset, (-1 : ℂ) ^ D.card * (if D ⊆ left j ∧ D ⊆ right k then star (z j) * v k else 0) := by calc _ = (if Disjoint (left j) (right k) then (1 : ℂ) else 0) * (star (z j) * v k) := by split_ifs <;> simp _ = _ := by rw [disjoint_indicator_expansion B _ _ (hl j) (hr k), Finset.sum_mul] apply Finset.sum_congr rfl intro D _ split_ifs <;> simp simp_rw [hp] calc _ = ∑ j, ∑ D ∈ B.powerset, ∑ k, (-1 : ℂ) ^ D.card * (if D ⊆ left j ∧ D ⊆ right k then star (z j) * v k else 0) := by apply Finset.sum_congr rfl intro j _ exact Finset.sum_comm _ = ∑ D ∈ B.powerset, ∑ j, ∑ k, (-1 : ℂ) ^ D.card * (if D ⊆ left j ∧ D ⊆ right k then star (z j) * v k else 0) := Finset.sum_comm _ = _ := by apply Finset.sum_congr rfl intro D _ simp_rw [← Finset.mul_sum] congr 1 simp only [star_sum, Finset.sum_mul_sum] apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ by_cases hj : D ⊆ left j <;> by_cases hk : D ⊆ right k <;> simp [hj, hk] theorem coprime_bilinear_operator_bound {ι m n p : Type*} [DecidableEq ι] [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] (B : Finset ι) (left : n → Finset ι) (right : p → Finset ι) (hl : ∀ j, left j ⊆ B) (hr : ∀ k, right k ⊆ B) (A : Matrix m n ℂ) (C : Matrix m p ℂ) (a : n → ℂ) (b : p → ℂ) : (∑ i, ‖∑ j, ∑ k, if Disjoint (left j) (right k) then star (A i j * a j) * (C i k * b k) else 0‖) ^ 2 ≤ (‖operator A‖ ^ 2 * ∑ j, (2 : ℝ) ^ (left j).card * ‖a j‖ ^ 2) * (‖operator C‖ ^ 2 * ∑ k, (2 : ℝ) ^ (right k).card * ‖b k‖ ^ 2) := by let X (D : Finset ι) (i : m) : ℂ := ∑ j, A i j * (if D ⊆ left j then a j else 0) let Y (D : Finset ι) (i : m) : ℂ := ∑ k, C i k * (if D ⊆ right k then b k else 0) have heq (i : m) : (∑ j, ∑ k, if Disjoint (left j) (right k) then star (A i j * a j) * (C i k * b k) else 0) = ∑ D ∈ B.powerset, (-1 : ℂ) ^ D.card * (star (X D i) * Y D i) := by simpa only [X, Y, mul_ite, mul_zero] using disjoint_bilinear_expansion B left right hl hr (fun j => A i j * a j) (fun k => C i k * b k) have hnorm : (∑ i, ‖∑ j, ∑ k, if Disjoint (left j) (right k) then star (A i j * a j) * (C i k * b k) else 0‖) ≤ ∑ D ∈ B.powerset, ∑ i, ‖X D i‖ * ‖Y D i‖ := by rw [Finset.sum_comm] apply Finset.sum_le_sum intro i _ rw [heq] apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro D _ simp only [norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul, norm_star] exact le_rfl have hCS := Finset.sum_mul_sq_le_sq_mul_sq (B.powerset ×ˢ (Finset.univ : Finset m)) (fun di => ‖X di.1 di.2‖) (fun di => ‖Y di.1 di.2‖) simp only [Finset.sum_product] at hCS have hX : (∑ D ∈ B.powerset, ∑ i, ‖X D i‖ ^ 2) ≤ ‖operator A‖ ^ 2 * ∑ j, (2 : ℝ) ^ (left j).card * ‖a j‖ ^ 2 := by calc _ ≤ ∑ D ∈ B.powerset, ‖operator A‖ ^ 2 * ∑ j, ‖if D ⊆ left j then a j else 0‖ ^ 2 := by apply Finset.sum_le_sum intro D _ exact energy_bound A _ _ = _ := by rw [← Finset.mul_sum, masked_coefficient_energy B left hl a] have hY : (∑ D ∈ B.powerset, ∑ i, ‖Y D i‖ ^ 2) ≤ ‖operator C‖ ^ 2 * ∑ k, (2 : ℝ) ^ (right k).card * ‖b k‖ ^ 2 := by calc _ ≤ ∑ D ∈ B.powerset, ‖operator C‖ ^ 2 * ∑ k, ‖if D ⊆ right k then b k else 0‖ ^ 2 := by apply Finset.sum_le_sum intro D _ exact energy_bound C _ _ = _ := by rw [← Finset.mul_sum, masked_coefficient_energy B right hr b] exact (pow_le_pow_left₀ (Finset.sum_nonneg (fun _ _ => norm_nonneg _)) hnorm 2).trans (hCS.trans (mul_le_mul hX hY (by positivity) (by positivity))) end CoprimeBilinearSieve namespace IdealCoprimeBilinearSieve abbrev O := ActualEisensteinCubic.O open IdealMobiusDivisorSum IdealCoprimeSieveOperator FiniteSieveOperator theorem support_weighted_energy_bound {n : Type*} [Fintype n] (ε : ℝ) (hε : 0 < ε) (column : n → Ideal O) (hcol : ∀ j, column j ≠ 0) (N : ℝ) (hnorm : ∀ j, (Ideal.absNorm (column j) : ℝ) ≤ N) (a : n → ℂ) : (∑ j, (2 : ℝ) ^ (primeSupport (column j)).card * ‖a j‖ ^ 2) ≤ (supportConstant ε hε * N ^ ε) * ∑ j, ‖a j‖ ^ 2 := by rw [Finset.mul_sum] apply Finset.sum_le_sum intro j _ apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) exact (support_card_bound ε hε (column j) (hcol j)).trans (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (Nat.cast_nonneg _) (hnorm j) hε.le) (supportConstant_pos ε hε).le) theorem ideal_coprime_bilinear_operator_bound {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] (ε : ℝ) (hε : 0 < ε) (left : n → Ideal O) (right : p → Ideal O) (hl0 : ∀ j, left j ≠ 0) (hr0 : ∀ k, right k ≠ 0) (N₁ N₂ : ℝ) (hN₁ : 0 ≤ N₁) (_hN₂ : 0 ≤ N₂) (hlN : ∀ j, (Ideal.absNorm (left j) : ℝ) ≤ N₁) (hrN : ∀ k, (Ideal.absNorm (right k) : ℝ) ≤ N₂) (A : Matrix m n ℂ) (C : Matrix m p ℂ) (a : n → ℂ) (b : p → ℂ) : (∑ i, ‖∑ j, ∑ k, if IsCoprime (left j) (right k) then star (A i j * a j) * (C i k * b k) else 0‖) ^ 2 ≤ (‖operator A‖ ^ 2 * (supportConstant ε hε * N₁ ^ ε) * ∑ j, ‖a j‖ ^ 2) * (‖operator C‖ ^ 2 * (supportConstant ε hε * N₂ ^ ε) * ∑ k, ‖b k‖ ^ 2) := by let B : Finset (Ideal O) := (Finset.univ.biUnion (fun j => primeSupport (left j))) ∪ (Finset.univ.biUnion (fun k => primeSupport (right k))) have hl (j : n) : primeSupport (left j) ⊆ B := by intro P hP exact Finset.mem_union.mpr (Or.inl (Finset.mem_biUnion.mpr ⟨j, Finset.mem_univ j, hP⟩)) have hr (k : p) : primeSupport (right k) ⊆ B := by intro P hP exact Finset.mem_union.mpr (Or.inr (Finset.mem_biUnion.mpr ⟨k, Finset.mem_univ k, hP⟩)) have h := CoprimeBilinearSieve.coprime_bilinear_operator_bound B (fun j => primeSupport (left j)) (fun k => primeSupport (right k)) hl hr A C a b simp_rw [primeSupport_disjoint_iff (hl0 _) (hr0 _)] at h apply h.trans apply mul_le_mul · simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (support_weighted_energy_bound ε hε left hl0 N₁ hlN a) (sq_nonneg ‖operator A‖) · simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (support_weighted_energy_bound ε hε right hr0 N₂ hrN b) (sq_nonneg ‖operator C‖) · positivity · have hpos := (supportConstant_pos ε hε).le positivity end IdealCoprimeBilinearSieve namespace DivisorBlockCauchy abbrev O := ActualEisensteinCubic.O open IdealMobiusDivisorSum FiniteSieveOperator IdealCoprimeSieveOperator theorem divisor_mask_energy {n : Type*} [Fintype n] (S : Finset (Ideal O)) (column : n → Ideal O) (hcol : ∀ j, column j ≠ 0) (a : n → ℂ) : (∑ D ∈ S, ∑ j, ‖if D ∣ column j then a j else 0‖ ^ 2) ≤ ∑ j, ((idealDivisors (column j)).card : ℝ) * ‖a j‖ ^ 2 := by rw [Finset.sum_comm] apply Finset.sum_le_sum intro j _ have hsub : S.filter (fun D => D ∣ column j) ⊆ idealDivisors (column j) := by intro D hD exact (mem_idealDivisors (hcol j)).mpr (Finset.mem_filter.mp hD).2 have hite (D : Ideal O) : ‖if D ∣ column j then a j else 0‖ ^ 2 = if D ∣ column j then ‖a j‖ ^ 2 else 0 := by split_ifs <;> simp simp_rw [hite] rw [← Finset.sum_filter, Finset.sum_const, nsmul_eq_mul] exact mul_le_mul_of_nonneg_right (by exact_mod_cast Finset.card_le_card hsub) (sq_nonneg _) def divisorConstant (ε : ℝ) (hε : 0 < ε) : ℝ := (IdealDivisorBound.ideal_divisor_small_power ε hε).choose theorem divisorConstant_pos (ε : ℝ) (hε : 0 < ε) : 0 < divisorConstant ε hε := (IdealDivisorBound.ideal_divisor_small_power ε hε).choose_spec.1 theorem divisor_mask_energy_small_power {n : Type*} [Fintype n] (ε : ℝ) (hε : 0 < ε) (S : Finset (Ideal O)) (column : n → Ideal O) (hcol : ∀ j, column j ≠ 0) (N : ℝ) (hnorm : ∀ j, (Ideal.absNorm (column j) : ℝ) ≤ N) (a : n → ℂ) : (∑ D ∈ S, ∑ j, ‖if D ∣ column j then a j else 0‖ ^ 2) ≤ (divisorConstant ε hε * N ^ ε) * ∑ j, ‖a j‖ ^ 2 := by apply (divisor_mask_energy S column hcol a).trans rw [Finset.mul_sum] apply Finset.sum_le_sum intro j _ apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) apply ((IdealDivisorBound.ideal_divisor_small_power ε hε).choose_spec.2 (column j) (hcol j)).trans exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (Nat.cast_nonneg _) (hnorm j) hε.le) (divisorConstant_pos ε hε).le theorem rectangular_cauchy {α β : Type*} (S : Finset α) (T : Finset β) (H : α → β → ℝ) (E : α → ℝ) (F : β → ℝ) (C : ℝ) (_hC : 0 ≤ C) (hH : ∀ d ∈ S, ∀ e ∈ T, (H d e) ^ 2 ≤ C * E d * F e) : (∑ d ∈ S, ∑ e ∈ T, H d e) ^ 2 ≤ (S.card : ℝ) * T.card * C * (∑ d ∈ S, E d) * (∑ e ∈ T, F e) := by classical have hCS := Finset.sum_mul_sq_le_sq_mul_sq (S ×ˢ T) (fun _ => (1 : ℝ)) (fun x => H x.1 x.2) simp only [one_mul, one_pow, Finset.sum_const, nsmul_eq_mul, mul_one, Finset.card_product, Nat.cast_mul, Finset.sum_product] at hCS have hsum : (∑ d ∈ S, ∑ e ∈ T, (H d e) ^ 2) ≤ C * (∑ d ∈ S, E d) * (∑ e ∈ T, F e) := by calc _ ≤ ∑ d ∈ S, ∑ e ∈ T, C * E d * F e := by apply Finset.sum_le_sum intro d hd exact Finset.sum_le_sum (fun e he => hH d hd e he) _ = _ := by simp only [← Finset.mul_sum, ← Finset.sum_mul] apply hCS.trans simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hsum (show (0 : ℝ) ≤ (S.card : ℝ) * T.card by positivity) end DivisorBlockCauchy namespace IdealDivisorBilinearBlocks abbrev O := ActualEisensteinCubic.O open FiniteSieveOperator IdealCoprimeSieveOperator DivisorBlockCauchy def blockValue {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] (left : n → Ideal O) (right : p → Ideal O) (A : Ideal O → Matrix m n ℂ) (B : Ideal O → Matrix m p ℂ) (a : n → ℂ) (b : p → ℂ) (D E : Ideal O) : ℝ := ∑ i, ‖∑ j, ∑ k, if IsCoprime (left j) (right k) then star (A D i j * (if D ∣ left j then a j else 0)) * (B E i k * (if E ∣ right k then b k else 0)) else 0‖ theorem blockValue_nonneg {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] (left : n → Ideal O) (right : p → Ideal O) (A : Ideal O → Matrix m n ℂ) (B : Ideal O → Matrix m p ℂ) (a : n → ℂ) (b : p → ℂ) (D E : Ideal O) : 0 ≤ blockValue left right A B a b D E := Finset.sum_nonneg (fun _ _ => norm_nonneg _) theorem divisor_block_bound {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (left : n → Ideal O) (right : p → Ideal O) (hl0 : ∀ j, left j ≠ 0) (hr0 : ∀ k, right k ≠ 0) (N₁ N₂ : ℝ) (hN₁ : 0 ≤ N₁) (hN₂ : 0 ≤ N₂) (hlN : ∀ j, (Ideal.absNorm (left j) : ℝ) ≤ N₁) (hrN : ∀ k, (Ideal.absNorm (right k) : ℝ) ≤ N₂) (A : Ideal O → Matrix m n ℂ) (B : Ideal O → Matrix m p ℂ) (a : n → ℂ) (b : p → ℂ) (UA UB : ℝ) (hUA : 0 ≤ UA) (hUB : 0 ≤ UB) (hA : ∀ D ∈ S, ‖operator (A D)‖ ^ 2 ≤ UA) (hB : ∀ E ∈ T, ‖operator (B E)‖ ^ 2 ≤ UB) : (∑ D ∈ S, ∑ E ∈ T, blockValue left right A B a b D E) ^ 2 ≤ (S.card : ℝ) * T.card * (UA * UB * (supportConstant ε hε * N₁ ^ ε) * (supportConstant ε hε * N₂ ^ ε)) * ((divisorConstant ε hε * N₁ ^ ε) * ∑ j, ‖a j‖ ^ 2) * ((divisorConstant ε hε * N₂ ^ ε) * ∑ k, ‖b k‖ ^ 2) := by let EL (D : Ideal O) : ℝ := ∑ j, ‖if D ∣ left j then a j else 0‖ ^ 2 let ER (E : Ideal O) : ℝ := ∑ k, ‖if E ∣ right k then b k else 0‖ ^ 2 let C : ℝ := UA * UB * (supportConstant ε hε * N₁ ^ ε) * (supportConstant ε hε * N₂ ^ ε) have hs := (supportConstant_pos ε hε).le have hd := (divisorConstant_pos ε hε).le have hC : 0 ≤ C := by dsimp [C]; positivity have hEL (D) : 0 ≤ EL D := by dsimp [EL]; positivity have hER (E) : 0 ≤ ER E := by dsimp [ER]; positivity have hp (D : Ideal O) (hD : D ∈ S) (E : Ideal O) (hE : E ∈ T) : (blockValue left right A B a b D E) ^ 2 ≤ C * EL D * ER E := by have hh := IdealCoprimeBilinearSieve.ideal_coprime_bilinear_operator_bound ε hε left right hl0 hr0 N₁ N₂ hN₁ hN₂ hlN hrN (A D) (B E) (fun j => if D ∣ left j then a j else 0) (fun k => if E ∣ right k then b k else 0) change (blockValue left right A B a b D E) ^ 2 ≤ (‖operator (A D)‖ ^ 2 * (supportConstant ε hε * N₁ ^ ε) * EL D) * (‖operator (B E)‖ ^ 2 * (supportConstant ε hε * N₂ ^ ε) * ER E) at hh apply hh.trans calc _ ≤ (UA * (supportConstant ε hε * N₁ ^ ε) * EL D) * (UB * (supportConstant ε hε * N₂ ^ ε) * ER E) := by gcongr · exact hA D hD · exact hB E hE _ = _ := by dsimp [C]; ring have hc := rectangular_cauchy S T (blockValue left right A B a b) EL ER C hC hp have he1 := divisor_mask_energy_small_power ε hε S left hl0 N₁ hlN a have he2 := divisor_mask_energy_small_power ε hε T right hr0 N₂ hrN b apply hc.trans change (S.card : ℝ) * T.card * C * (∑ D ∈ S, EL D) * (∑ E ∈ T, ER E) ≤ _ change (∑ D ∈ S, EL D) ≤ _ at he1 change (∑ E ∈ T, ER E) ≤ _ at he2 dsimp only [C] gcongr end IdealDivisorBilinearBlocks namespace FiniteSieveRestriction open FiniteSieveOperator variable {n p : Type*} [Fintype n] [Fintype p] [DecidableEq n] [DecidableEq p] def extendByZero (S : Finset n) (f : n → p) (u : n → ℂ) (k : p) : ℂ := ∑ j ∈ S, if f j = k then u j else 0 omit [Fintype n] [Fintype p] [DecidableEq n] in theorem extendByZero_apply_image (S : Finset n) (f : n → p) (u : n → ℂ) (hf : Set.InjOn f S) (j : n) (hj : j ∈ S) : extendByZero S f u (f j) = u j := by unfold extendByZero rw [Finset.sum_eq_single j] · simp · intro k hk hkj simp only [ite_eq_right (fun h => hkj (hf hk hj h))] · exact fun h => (h hj).elim omit [Fintype n] [Fintype p] [DecidableEq n] in theorem extendByZero_zero (S : Finset n) (f : n → p) (u : n → ℂ) (k : p) (hk : k ∉ S.image f) : extendByZero S f u k = 0 := by apply Finset.sum_eq_zero intro j hj exact ite_eq_right (fun h => hk (Finset.mem_image.mpr ⟨j, hj, h⟩)) omit [Fintype n] [DecidableEq n] in theorem extendByZero_energy (S : Finset n) (f : n → p) (u : n → ℂ) (hf : Set.InjOn f S) : (∑ k, ‖extendByZero S f u k‖ ^ 2) = ∑ j ∈ S, ‖u j‖ ^ 2 := by calc _ = ∑ k ∈ S.image f, ‖extendByZero S f u k‖ ^ 2 := by symm apply Finset.sum_subset (Finset.subset_univ _) intro k _ hk simp [extendByZero_zero S f u k hk] _ = ∑ j ∈ S, ‖extendByZero S f u (f j)‖ ^ 2 := by rw [Finset.sum_image] exact fun j hj k hk h => hf hj hk h _ = _ := Finset.sum_congr rfl (fun j hj => by rw [extendByZero_apply_image S f u hf j hj]) omit [Fintype n] [DecidableEq n] in theorem extendByZero_matrix {m : Type*} (S : Finset n) (f : n → p) (u : n → ℂ) (A : Matrix m p ℂ) (i : m) : (∑ k, A i k * extendByZero S f u k) = ∑ j ∈ S, A i (f j) * u j := by simp only [extendByZero, Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ rw [Finset.sum_eq_single (f j)] · simp · intro k _ hkj simp [Ne.symm hkj] · simp theorem masked_column_restriction_norm_le {m : Type*} [Fintype m] [DecidableEq m] (S : Finset n) (f : n → p) (hf : Set.InjOn f S) (A : Matrix m p ℂ) : ‖operator (fun i j => if j ∈ S then A i (f j) else 0)‖ ≤ ‖operator A‖ := by apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) intro u let v : EuclideanSpace ℂ p := WithLp.toLp 2 (extendByZero S f u) have hv : ‖v‖ ≤ ‖u‖ := by apply (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mp rw [EuclideanSpace.norm_sq_eq, EuclideanSpace.norm_sq_eq] change (∑ k, ‖extendByZero S f u k‖ ^ 2) ≤ ∑ j, ‖u j‖ ^ 2 rw [extendByZero_energy S f u hf] exact Finset.sum_le_univ_sum_of_nonneg (fun j => sq_nonneg ‖u j‖) have heq : operator (fun i j => if j ∈ S then A i (f j) else 0) u = operator A v := by ext i change (∑ j, (if j ∈ S then A i (f j) else 0) * u j) = ∑ k, A i k * extendByZero S f u k rw [extendByZero_matrix] simp only [ite_mul, zero_mul, ← Finset.sum_filter] simp rw [heq] exact ((operator A).le_opNorm v).trans (mul_le_mul_of_nonneg_left hv (norm_nonneg _)) theorem column_restriction_norm_le {m : Type*} [Fintype m] [DecidableEq m] (f : n → p) (hf : Function.Injective f) (A : Matrix m p ℂ) : ‖operator (fun i j => A i (f j))‖ ≤ ‖operator A‖ := by simpa only [Finset.mem_univ, ite_true] using masked_column_restriction_norm_le Finset.univ f hf.injOn A theorem row_restriction_norm_le {m : Type*} [Fintype m] [DecidableEq m] (f : n → p) (hf : Function.Injective f) (A : Matrix p m ℂ) : ‖operator (fun i j => A (f i) j)‖ ≤ ‖operator A‖ := by let B : Matrix n m ℂ := fun i j => A (f i) j have h := column_restriction_norm_le f hf A.conjTranspose change ‖operator B.conjTranspose‖ ≤ ‖operator A.conjTranspose‖ at h rw [operator_conjTranspose_norm B, operator_conjTranspose_norm A] at h exact h theorem submatrix_norm_le {m q : Type*} [Fintype m] [Fintype q] [DecidableEq m] [DecidableEq q] (r : m → q) (hr : Function.Injective r) (c : n → p) (hc : Function.Injective c) (A : Matrix q p ℂ) : ‖operator (fun i j => A (r i) (c j))‖ ≤ ‖operator A‖ := (row_restriction_norm_le r hr (fun i j => A i (c j))).trans (column_restriction_norm_le c hc A) end FiniteSieveRestriction open scoped BigOperators namespace FiniteSieveOperator theorem squared_norm_le_of_energy {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (A : Matrix m n ℂ) (C : ℝ) (hC : 0 ≤ C) (h : ∀ a : n → ℂ, (∑ i, ‖∑ j, A i j * a j‖ ^ 2) ≤ C * ∑ j, ‖a j‖ ^ 2) : ‖operator A‖ ^ 2 ≤ C := by have hop : ‖operator A‖ ≤ Real.sqrt C := by apply ContinuousLinearMap.opNorm_le_bound _ (Real.sqrt_nonneg C) intro a apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg C) (norm_nonneg a))).mp simpa only [mul_pow, Real.sq_sqrt hC, EuclideanSpace.norm_sq_eq, operator_apply] using h a simpa only [Real.sq_sqrt hC] using pow_le_pow_left₀ (norm_nonneg _) hop 2 end FiniteSieveOperator open scoped BigOperators Classical namespace CanonicalQuadraticSieve abbrev O := ActualEisensteinCubic.O open ConcretePrimeRowBridge ActualEisensteinCubic CompletedGauss theorem idealSexticRow_ambient (F G : Finset (Ideal O)) (hFp : ∀ I ∈ F, I ≠ ⊥) (hGp : ∀ I ∈ G, I ≠ ⊥) (hFg : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (hGg : ∀ I ∈ G, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) (I : Ideal O) (hIF : I ∈ F) (hIG : I ∈ G) (z : O) : idealSexticRow F hFp hFg I z = idealSexticRow G hGp hGg I z := by let idx (i : primePool F) (hi : i ∈ idealSupport F I) : primePool G := ⟨i.val, mem_primePool_iff.mpr ⟨I, hIG, (mem_idealSupport_iff F I i).mp hi⟩⟩ unfold idealSexticRow finiteSquarefreeRow apply Finset.prod_bij idx · intro i hi exact (mem_idealSupport_iff G I (idx i hi)).mpr ((mem_idealSupport_iff F I i).mp hi) · intro i hi j hj hij exact Subtype.ext (congrArg (fun k : primePool G => k.val) hij) · intro j hj let i : primePool F := ⟨j.val, mem_primePool_iff.mpr ⟨I, hIF, (mem_idealSupport_iff G I j).mp hj⟩⟩ have hi : i ∈ idealSupport F I := (mem_idealSupport_iff F I i).mpr ((mem_idealSupport_iff G I j).mp hj) exact ⟨i, hi, Subtype.ext rfl⟩ · intro i hi rfl def Admissible (I : Ideal O) : Prop := I ≠ 0 ∧ Squarefree I ∧ ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, lambda ∉ P ∧ ringChar (O ⧸ P) ≠ 2 theorem singletonPositive (I : Ideal O) (h : Admissible I) : ∀ J ∈ ({I} : Finset (Ideal O)), J ≠ ⊥ := by intro J hJ rcases Finset.mem_singleton.mp hJ with rfl exact h.1 theorem singletonGood (I : Ideal O) (h : Admissible I) : ∀ J ∈ ({I} : Finset (Ideal O)), ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors J, goodLambda ∉ P := by intro J hJ P hP rcases Finset.mem_singleton.mp hJ with rfl exact (h.2.2 P hP).1 def quadraticRow (I : Ideal O) (z : O) : ℂ := if h : Admissible I then (idealSexticRow {I} (singletonPositive I h) (singletonGood I h) I z) ^ 3 else 0 theorem quadraticRow_eq (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (I : Ideal O) (hI : I ∈ F) (z : O) : quadraticRow I z = (idealSexticRow F (fun J hJ => (hF J hJ).1) (fun J hJ P hP => (hF J hJ).2.2 P hP |>.1) I z) ^ 3 := by rw [quadraticRow, dite_eq_left (hF I hI)] congr 1 exact idealSexticRow_ambient {I} F (singletonPositive I (hF I hI)) (fun J hJ => (hF J hJ).1) (singletonGood I (hF I hI)) (fun J hJ P hP => (hF J hJ).2.2 P hP |>.1) I (Finset.mem_singleton_self I) hI z def idealRange (X : ℝ) : Finset (Ideal O) := (idealsUpTo ⌊X⌋₊).filter Admissible theorem mem_idealRange {X : ℝ} {I : Ideal O} : I ∈ idealRange X ↔ Admissible I ∧ (Ideal.absNorm I : ℝ) ≤ X := by rw [idealRange, Finset.mem_filter, mem_idealsUpTo] constructor · rintro ⟨⟨hp, hN⟩, ha⟩ refine ⟨ha, ?_⟩ have hX : 0 ≤ X := by by_contra hn have hz : ⌊X⌋₊ = 0 := Nat.floor_eq_zero.mpr (by linarith) omega exact (Nat.cast_le.mpr hN).trans (Nat.floor_le hX) · rintro ⟨ha, hN⟩ exact ⟨⟨Nat.one_le_iff_ne_zero.mpr (fun h => ha.1 (Ideal.absNorm_eq_zero_iff.mp h)), Nat.le_floor hN⟩, ha⟩ theorem idealRange_mono {X Y : ℝ} (h : X ≤ Y) : idealRange X ⊆ idealRange Y := by intro I hI rcases mem_idealRange.mp hI with ⟨ha, hN⟩ exact mem_idealRange.mpr ⟨ha, hN.trans h⟩ def matrix (M N : ℝ) : Matrix (idealRange M) (idealRange N) ℂ := fun I J => quadraticRow J.val (primaryGenerator I.val) def sieveNorm (M N : ℝ) : ℝ := ‖FiniteSieveOperator.operator (matrix M N)‖ ^ 2 theorem sieveNorm_nonneg (M N : ℝ) : 0 ≤ sieveNorm M N := sq_nonneg _ def rangeInclusion {X Y : ℝ} (h : X ≤ Y) (I : idealRange X) : idealRange Y := ⟨I.val, idealRange_mono h I.property⟩ theorem rangeInclusion_injective {X Y : ℝ} (h : X ≤ Y) : Function.Injective (rangeInclusion h) := by intro I J heq exact Subtype.ext (congrArg (fun x : idealRange Y => x.val) heq) theorem sieveNorm_mono {M N M' N' : ℝ} (hM : M ≤ M') (hN : N ≤ N') : sieveNorm M N ≤ sieveNorm M' N' := by have h := FiniteSieveRestriction.submatrix_norm_le (rangeInclusion hM) (rangeInclusion_injective hM) (rangeInclusion hN) (rangeInclusion_injective hN) (matrix M' N') change ‖FiniteSieveOperator.operator (matrix M N)‖ ≤ ‖FiniteSieveOperator.operator (matrix M' N')‖ at h exact pow_le_pow_left₀ (norm_nonneg _) h 2 theorem family_squared_norm_le {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (M N : ℝ) (hrows : ∀ i, Admissible (rows i) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ M) (hcols : ∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) : ‖FiniteSieveOperator.operator (fun i j => quadraticRow (cols j) (primaryGenerator (rows i)))‖ ^ 2 ≤ sieveNorm M N := by let r : m → idealRange M := fun i => ⟨rows i, mem_idealRange.mpr (hrows i)⟩ let c : n → idealRange N := fun j => ⟨cols j, mem_idealRange.mpr (hcols j)⟩ have hri : Function.Injective r := fun i j h => hr (congrArg Subtype.val h) have hci : Function.Injective c := fun i j h => hc (congrArg Subtype.val h) have h := FiniteSieveRestriction.submatrix_norm_le r hri c hci (matrix M N) exact pow_le_pow_left₀ (norm_nonneg _) h 2 theorem energy_bound (M N : ℝ) (a : idealRange N → ℂ) : (∑ I : idealRange M, ‖∑ J : idealRange N, quadraticRow J.val (primaryGenerator I.val) * a J‖ ^ 2) ≤ sieveNorm M N * ∑ J, ‖a J‖ ^ 2 := FiniteSieveOperator.energy_bound (matrix M N) a end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.LocalBrackets namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical SchwartzMap ContDiff namespace FirstPassCubeLabels open ActualEisensteinCubic open MixedCrossSeparation (columnPrimeCoprime quadraticCrossPhase) open FiniteGaussPhase (canonicalProductGauss) open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) def blockRow {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (e : ι → ℕ) (u : O) : ℂ := finiteSexticRow (fun i : S => Ideal.span {p i.val}) (fun i => hg i.val) (fun i => e i.val) u theorem blockRow_eq_product {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (e : ι → ℕ) (u : O) : blockRow p hg S e u = ∏ i ∈ S, (canonicalSextic (Ideal.span {p i}) (hg i) ^ e i) (Ideal.Quotient.mk (Ideal.span {p i}) u) := Finset.prod_coe_sort S (fun i => (canonicalSextic (Ideal.span {p i}) (hg i) ^ e i) (Ideal.Quotient.mk (Ideal.span {p i}) u)) theorem blockRow_union {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S T : Finset ι) (hd : Disjoint S T) (e : ι → ℕ) (u : O) : blockRow p hg (S ∪ T) e u = blockRow p hg S e u * blockRow p hg T e u := by simp only [blockRow_eq_product, Finset.prod_union hd] theorem blockRow_congr {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (e f : ι → ℕ) (hef : ∀ i ∈ S, e i = f i) (u : O) : blockRow p hg S e u = blockRow p hg S f u := by simp only [blockRow_eq_product] exact Finset.prod_congr rfl (fun i hi => by rw [hef i hi]) theorem blockRow_one {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (u : O) : blockRow p hg S (fun _ => 1) u = finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S u := by simp only [blockRow_eq_product, pow_one, finiteSquarefreeRow] theorem blockRow_five {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (u : O) : blockRow p hg S (fun _ => 5) u = star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S u) := by simp only [blockRow_eq_product, finiteSquarefreeRow, star_prod] apply Finset.prod_congr rfl intro i hi rw [MulChar.pow_apply' _ (by decide : (5 : ℕ) ≠ 0), canonicalSextic_conj_as_row_label] ring theorem threeBlockRow_factor {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (N P B : Finset ι) (hNP : Disjoint N P) (hNB : Disjoint N B) (hPB : Disjoint P B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (u : O) : blockRow p hg ((N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂) (threeBlockExponent N P v ε₁ ε₂) u = star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N u) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg P u * blockRow p hg (cubeActiveSupport B v ε₁ ε₂) (fun i => (conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val) u := by have hNC : Disjoint N (cubeActiveSupport B v ε₁ ε₂) := hNB.mono_right (Finset.filter_subset _ _) have hPC : Disjoint P (cubeActiveSupport B v ε₁ ε₂) := hPB.mono_right (Finset.filter_subset _ _) have hN : ∀ i ∈ N, threeBlockExponent N P v ε₁ ε₂ i = 5 := by intro i hi; simp [threeBlockExponent, hi] have hP : ∀ i ∈ P, threeBlockExponent N P v ε₁ ε₂ i = 1 := by intro i hi simp [threeBlockExponent, hi, show i ∉ N from fun hn => Finset.disjoint_left.mp hNP hn hi] have hC : ∀ i ∈ cubeActiveSupport B v ε₁ ε₂, threeBlockExponent N P v ε₁ ε₂ i = (conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val := by intro i hi simp [threeBlockExponent, show i ∉ N from fun hn => Finset.disjoint_left.mp hNC hn hi, show i ∉ P from fun hp => Finset.disjoint_left.mp hPC hp hi] rw [blockRow_union p hg (N ∪ P) _ (Finset.disjoint_union_left.mpr ⟨hNC, hPC⟩), blockRow_union p hg N P hNP, blockRow_congr p hg N _ _ hN, blockRow_congr p hg P _ _ hP, blockRow_congr p hg _ _ _ hC, blockRow_five, blockRow_one] theorem masked_block_radial_poisson_product {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (M S : Finset ι) (e : ι → ℕ) (he : ∀ i ∈ S, e i ≠ 0) (he6 : ∀ i ∈ S, e i < 6) (W : 𝓢(ℝ, ℂ)) (lengthScale : ℝ) (hL : 0 < lengthScale) : (∑' z : O, rowCoprimeMask (fun i => Ideal.span {p i}) M z * blockRow p hg S e z * W (‖eisEmbedding z‖ ^ 2 / lengthScale)) = ((lengthScale : ℂ) * canonicalProductGauss (fun i : S => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop S) (fun i => hg i.val) (fun i => e i.val) / (‖eisEmbedding (∏ i ∈ S, p i)‖ : ℂ)) * ∑ E ∈ M.powerset, let d := primeSubsetGenerator (fun i => Ideal.span {p i}) E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, Ideal.span {p i}) : ℂ) * blockRow p hg S e d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * ∑' h : O, star (blockRow p hg S e h) * paperRadialFourier W (lengthScale * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding (∏ i ∈ S, p i)‖ ^ 2)) := by let Q := fun i : S => Ideal.span {p i.val} let q := fun i : S => p i.val let hQ := columnPrimeCoprime p hcop S let j := fun i : S => e i.val have h := canonical_masked_radial_poisson_collected (fun i => Ideal.span {p i}) hinj M Q hQ (fun i => hg i.val) (fun i => hc i.val) j (fun i => he i.val i.property) (fun i => he6 i.val i.property) W lengthScale hL have hn : ‖eisEmbedding (finitePrimeModulus Q)‖ = ‖eisEmbedding (∏ i ∈ S, p i)‖ := by rw [GaussGeneratorTransport.finitePrimeModulus_norm_eq_product q, Finset.prod_coe_sort] dsimp only at h rw [hn] at h have hrow : finiteSexticRow Q (fun i => hg i.val) j = blockRow p hg S e := rfl rw [hrow] at h rw [h] let a := fun E : Finset ι => let d := primeSubsetGenerator (fun i => Ideal.span {p i}) E (UniqueFactorizationMonoid.moebius (∏ i ∈ E, Ideal.span {p i}) : ℂ) * blockRow p hg S e d / (‖eisEmbedding d‖ ^ 2 : ℝ) let F := fun E : Finset ι => fun t : ℝ => let d := primeSubsetGenerator (fun i => Ideal.span {p i}) E paperRadialFourier W (lengthScale * t / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding (∏ i ∈ S, p i)‖ ^ 2)) have ht := GaussGeneratorTransport.gauss_weighted_finite_radial_sum_transport q (fun i => hp i.val) hQ (fun i => hg i.val) j M.powerset a F rw [hrow] at ht change ((lengthScale : ℂ) * canonicalNormalizedGauss Q hQ (fun i => hg i.val) j / (‖eisEmbedding (∏ i ∈ S, p i)‖ : ℂ)) * _ = _ calc _ = ((lengthScale : ℂ) / (‖eisEmbedding (∏ i ∈ S, p i)‖ : ℂ)) * (canonicalNormalizedGauss Q hQ (fun i => hg i.val) j * ∑ E ∈ M.powerset, a E * ∑' h : O, star (blockRow p hg S e h) * F E (‖eisEmbedding h‖ ^ 2)) := by ring _ = _ := by rw [ht]; ring def cubeBaseFactor {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (d h : O) : ℂ := let C := cubeActiveSupport B v ε₁ ε₂ let e := fun i => (conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val gaussBlock p hp hg C e * blockRow p hg C e d * star (blockRow p hg C e h) def threeGaussRowFactor {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (N P B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (d h : O) : ℂ := let S := (N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂ let e := threeBlockExponent N P v ε₁ ε₂ star (MixedCrossSeparation.columnCoefficient p hp hcop hg N * C₁ N) * (MixedCrossSeparation.columnCoefficient p hp hcop hg P * C₂ P) * canonicalProductGauss (fun i : S => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop S) (fun i => hg i.val) (fun i => e i.val) * (blockRow p hg S e d * star (blockRow p hg S e h)) def cubeTransformedPair {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (N P B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (d h : O) : ℂ := cubeBaseFactor p hp hg B v ε₁ ε₂ d h * quadraticCrossPhase p hg N P * quadraticCrossPhase p hg N (cubeOddSupport B v ε₁ ε₂) * quadraticCrossPhase p hg P (cubeOddSupport B v ε₁ ε₂) * star (FirstCauchyArithmetic.supportMobius (fun i => Ideal.span {p i}) N * FirstCauchyArithmetic.firstPassColumnMinus p hp hcop hg C₁ (d * crtLabel p B v ε₁ ε₂ true) N * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N h)) * (FirstCauchyArithmetic.supportMobius (fun i => Ideal.span {p i}) P * FirstCauchyArithmetic.firstPassColumnPlus p hp hcop hg C₂ (d * crtLabel p B v ε₁ ε₂ false) P * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg P h)) theorem threeGaussRowFactor_eq_transformedPair {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (N P B : Finset ι) (hNP : Disjoint N P) (hNB : Disjoint N B) (hPB : Disjoint P B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (d h : O) : threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h = cubeTransformedPair p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h := by unfold threeGaussRowFactor dsimp only rw [a_weighted_three_cube_gauss p hp hcop hg hc hpr N P B hNP hNB hPB, threeBlockRow_factor p hg N P B hNP hNB hPB, threeBlockRow_factor p hg N P B hNP hNB hPB] simp only [cubeTransformedPair, cubeBaseFactor, FirstCauchyArithmetic.firstPassColumnMinus, FirstCauchyArithmetic.firstPassColumnPlus, finiteSquarefreeRow_mul, star_mul, star_star] ring end FirstPassCubeLabels section open MeasureTheory open scoped FourierTransform SchwartzMap ContDiff namespace LocalLogFourier end LocalLogFourier namespace EisensteinSchwartzPoisson end EisensteinSchwartzPoisson end open scoped Classical BigOperators open AddChar MulChar namespace LocalReflectionBrackets section abbrev O := ActualEisensteinCubic.O variable {F : Type*} [Field F] [Fintype F] def rootCard (F : Type*) [Fintype F] : ℝ := Real.sqrt (Fintype.card F) theorem rootCard_pos : 0 < rootCard F := by apply Real.sqrt_pos.mpr exact_mod_cast Fintype.card_pos_iff.mpr ⟨(0 : F)⟩ theorem rootCard_sq : rootCard F ^ 2 = (Fintype.card F : ℝ) := Real.sq_sqrt (by positivity) def tau (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (j : ℕ) : ℂ := (rootCard F : ℂ)⁻¹ * gaussSum (χ ^ j) ψ def bracket (χ : MulChar F ℂ) (j : ℕ) (x : F) : ℂ := if j = 4 then (rootCard F : ℂ)⁻¹ * (-1 + (Fintype.card F : ℂ) * if x = 0 then 1 else 0) else if j = 0 then (rootCard F : ℂ)⁻¹ * (χ ^ 2)⁻¹ x else (χ ^ (j + 2))⁻¹ x def phase (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (j : ℕ) (ε : Fˣ) : ℂ := if j = 4 then tau χ (ψ.mulShift (-1)) 4 else if j = 0 then -tau χ ψ 2 * (χ ^ 2)⁻¹ ε else tau χ (ψ.mulShift (-1)) j * tau χ ψ (j + 2) * (χ ^ (j + 2))⁻¹ ε theorem norm_tau (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (j : ℕ) (hχ : χ ^ j ≠ 1) (hψ : ψ.IsPrimitive) : ‖tau χ ψ j‖ = 1 := ShortDraftGauss.norm_normalized_gaussSum (χ ^ j) ψ hχ hψ theorem bracket_four_split (χ : MulChar F ℂ) (x : F) : bracket χ 4 x = -(rootCard F : ℂ)⁻¹ + (rootCard F : ℂ) * if x = 0 then 1 else 0 := by have hr : (rootCard F : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt rootCard_pos) have hsq : (rootCard F : ℂ) ^ 2 = (Fintype.card F : ℂ) := by exact_mod_cast (rootCard_sq (F := F)) simp only [bracket, ↓reduceIte] rw [← hsq] field_simp theorem bracket_four_cube_split (χ : MulChar F ℂ) (n b : F) : bracket χ 4 (n * b ^ 3) = -(rootCard F : ℂ)⁻¹ + (rootCard F : ℂ) * (if n = 0 then 1 else 0) + (rootCard F : ℂ) * (if n ≠ 0 ∧ b = 0 then 1 else 0) := by rw [bracket_four_split] by_cases hn : n = 0 <;> by_cases hb : b = 0 <;> simp [hn, hb] theorem norm_bracket_nonexceptional (χ : MulChar F ℂ) (j : ℕ) (hj4 : j ≠ 4) (hj0 : j ≠ 0) (x : F) : ‖bracket χ j x‖ = if x = 0 then 0 else 1 := by simp only [bracket, ite_eq_right hj4, ite_eq_right hj0] by_cases hx : x = 0 · simp [hx] · rw [ite_eq_right hx] exact FiniteRayExpansion.norm_char_unit ((χ ^ (j + 2))⁻¹) (Units.mk0 x hx) theorem norm_bracket_zero (χ : MulChar F ℂ) (x : F) : ‖bracket χ 0 x‖ = (rootCard F)⁻¹ * if x = 0 then 0 else 1 := by simp only [bracket, show (0 : ℕ) ≠ 4 by decide, ↓reduceIte, norm_mul, norm_inv, Complex.norm_real, Real.norm_of_nonneg rootCard_pos.le] congr 1 by_cases hx : x = 0 · simp [hx] · rw [ite_eq_right hx] exact FiniteRayExpansion.norm_char_unit ((χ ^ 2)⁻¹) (Units.mk0 x hx) end section variable {F : Type*} [Field F] [Fintype F] omit [Fintype F] in theorem shifted_power_nontrivial (χ : MulChar F ℂ) (h6 : χ ^ 6 = 1) (hn : ∀ k : ℕ, k ≠ 0 → k < 6 → χ ^ k ≠ 1) (j : ℕ) (hj0 : j ≠ 0) (hj6 : j < 6) (hj4 : j ≠ 4) : χ ^ (j + 2) ≠ 1 := by by_cases hj : j = 5 · subst j have heq : χ ^ (5 + 2) = χ ^ 1 := by rw [show (5 + 2 : ℕ) = 6 + 1 by decide, pow_add, h6, one_mul] rw [heq] exact hn 1 (by decide) (by decide) · exact hn (j + 2) (by omega) (by omega) theorem phase_norm (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (h6 : χ ^ 6 = 1) (hn : ∀ k : ℕ, k ≠ 0 → k < 6 → χ ^ k ≠ 1) (hψ : ψ.IsPrimitive) (j : ℕ) (hj6 : j < 6) (ε : Fˣ) : ‖phase χ ψ j ε‖ = 1 := by have hψminus : (ψ.mulShift (-1)).IsPrimitive := AddChar.IsPrimitive.of_ne_one (hψ (a := (-1 : F)) (by simp)) by_cases hj4 : j = 4 · subst j simp only [phase, ↓reduceIte] exact norm_tau χ _ 4 (hn 4 (by decide) (by decide)) hψminus by_cases hj0 : j = 0 · subst j simp only [phase, ite_eq_right hj4, ↓reduceIte, norm_mul, norm_neg] rw [norm_tau χ ψ 2 (hn 2 (by decide) (by decide)) hψ, FiniteRayExpansion.norm_char_unit] norm_num · simp only [phase, ite_eq_right hj4, ite_eq_right hj0, norm_mul] rw [norm_tau χ _ j (hn j hj0 hj6) hψminus, norm_tau χ ψ (j + 2) (shifted_power_nontrivial χ h6 hn j hj0 hj6 hj4) hψ, FiniteRayExpansion.norm_char_unit] norm_num end open ActualEisensteinCubic noncomputable abbrev quotientField (P : Ideal O) [P.IsMaximal] : Field (O ⧸ P) := Ideal.Quotient.field P noncomputable abbrev quotientFintype (P : Ideal O) [P.IsMaximal] : Fintype (O ⧸ P) := Fintype.ofFinite _ theorem canonical_phase_norm (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (ψ : AddChar (O ⧸ P) ℂ) (hψ : ψ.IsPrimitive) (j : ℕ) (hj6 : j < 6) (ε : (O ⧸ P)ˣ) : let : Field (O ⧸ P) := quotientField P let : Fintype (O ⧸ P) := quotientFintype P ‖phase (canonicalSextic P hgood) ψ j ε‖ = 1 := by let : Field (O ⧸ P) := quotientField P let : Fintype (O ⧸ P) := quotientFintype P dsimp only let : Field (O ⧸ P) := Ideal.Quotient.field P exact phase_norm (canonicalSextic P hgood) ψ (canonicalSextic_pow_six P hgood) (fun k hk0 hk6 => canonicalSextic_pow_ne_one P hgood hchar hk0 hk6) hψ j hj6 ε end LocalReflectionBrackets open scoped Classical BigOperators open AddChar MulChar namespace LocalReflectionBrackets variable {F : Type*} [Field F] [Fintype F] def activeRow (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (j : ℕ) (σ ε : Fˣ) (x : F) : ℂ := (Fintype.card F : ℂ)⁻¹ * ∑ h : Fˣ, (∑ t : F, (χ ^ j) t * ψ (-(h * t))) * (((χ⁻¹) ^ 2) (σ * h)) * ψ (((ε : F) * x) * ((h⁻¹ : Fˣ) : F)) open ActualEisensteinCubic noncomputable abbrev quotientFieldNormalized (P : Ideal O) [P.IsMaximal] : Field (O ⧸ P) := Ideal.Quotient.field P noncomputable abbrev quotientFintypeNormalized (P : Ideal O) [P.IsMaximal] : Fintype (O ⧸ P) := Fintype.ofFinite _ theorem canonical_A5_normalized (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (ψ : AddChar (O ⧸ P) ℂ) (hψ : ψ.IsPrimitive) (j : ℕ) (hj6 : j < 6) (σ ε : (O ⧸ P)ˣ) (x : O ⧸ P) : let : Field (O ⧸ P) := quotientFieldNormalized P let : Fintype (O ⧸ P) := quotientFintypeNormalized P activeRow (canonicalSextic P hgood) ψ j σ ε x = (((canonicalSextic P hgood)⁻¹) ^ 2) σ * phase (canonicalSextic P hgood) ψ j ε * bracket (canonicalSextic P hgood) j x := by let : Field (O ⧸ P) := quotientFieldNormalized P let : Fintype (O ⧸ P) := quotientFintypeNormalized P dsimp only let χ := canonicalSextic P hgood have hψne : ψ ≠ 1 := by simpa only [AddChar.mulShift_one] using hψ (a := 1) one_ne_zero have hr : (rootCard (O ⧸ P) : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt rootCard_pos) have hsq : (rootCard (O ⧸ P) : ℂ) ^ 2 = (Fintype.card (O ⧸ P) : ℂ) := by exact_mod_cast (rootCard_sq (F := O ⧸ P)) by_cases hj0 : j = 0 · subst j have hh := canonical_A5_jzero_active P hgood hchar ψ hψne σ ε x simp only [Nat.card_eq_fintype_card] at hh rw [activeRow, hh] simp only [phase, bracket, tau, show (0 : ℕ) ≠ 4 by decide, ↓reduceIte] rw [← hsq] field_simp by_cases hj4 : j = 4 · subst j have hh := canonical_A5_jfour P hgood hchar ψ hψne σ ε x simp only [Nat.card_eq_fintype_card] at hh rw [activeRow, hh] have hqNat : 1 ≤ Fintype.card (O ⧸ P) := Fintype.card_pos_iff.mpr ⟨0⟩ have hcardunits : (Fintype.card (O ⧸ P)ˣ : ℂ) = (Fintype.card (O ⧸ P) : ℂ) - 1 := by rw [Fintype.card_units, Nat.cast_sub hqNat, Nat.cast_one] have hsum : (if (ε : O ⧸ P) * x = 0 then (Fintype.card (O ⧸ P)ˣ : ℂ) else -1) = -1 + (Fintype.card (O ⧸ P) : ℂ) * if x = 0 then 1 else 0 := by by_cases hx : x = 0 · simp [hx, hcardunits] ring · simp [hx, mul_ne_zero (Units.ne_zero ε) hx] rw [hsum] simp only [phase, bracket, tau, ↓reduceIte] rw [← hsq] field_simp · have hh := canonical_A5_nonexceptional P hgood hchar ψ j hj0 hj6 hj4 σ ε x simp only [Nat.card_eq_fintype_card] at hh rw [activeRow, hh] simp only [phase, bracket, tau, ite_eq_right hj4, ite_eq_right hj0] rw [← hsq] field_simp theorem canonical_bracket_four_cube_split (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (n b : O) : let : Field (O ⧸ P) := quotientFieldNormalized P let : Fintype (O ⧸ P) := quotientFintypeNormalized P bracket (canonicalSextic P hgood) 4 (Ideal.Quotient.mk P (n * b ^ 3)) = -(rootCard (O ⧸ P) : ℂ)⁻¹ + (rootCard (O ⧸ P) : ℂ) * (if n ∈ P then 1 else 0) + (rootCard (O ⧸ P) : ℂ) * (if n ∉ P ∧ b ∈ P then 1 else 0) := by let : Field (O ⧸ P) := quotientFieldNormalized P let : Fintype (O ⧸ P) := quotientFintypeNormalized P dsimp only rw [map_mul, map_pow, bracket_four_cube_split] simp only [ne_eq, Ideal.Quotient.eq_zero_iff_mem] end LocalReflectionBrackets end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.RayExpansion namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace FirstPassCubeLabels section open ActualEisensteinCubic open MixedCrossSeparation (quadraticCrossPhase) open FirstCauchyArithmetic (supportMobius supportRay supportIdealFamily supportIdealFamily_pos supportIdealFamily_good recoveredSupport firstPassColumnMinus firstPassColumnPlus) open ConcretePrimeRowBridge (conjugateIdealRowSum) open RayFourExpansion (RayCharacter crossCoeff) def fixedRayExpansion {ι : Type*} (p : ι → O) (F S : Finset ι) : ℂ := letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype ∑ χ : RayCharacter, ∑ η : RayCharacter, crossCoeff χ η * supportRay p χ S * supportRay p η F theorem fixedRayExpansion_eq_cross {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (F S : Finset ι) (hd : Disjoint S F) : fixedRayExpansion p F S = quadraticCrossPhase p hg S F := letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype (RayFourExpansion.quadraticCrossPhase_character_expansion p hp hcop hg hc S F hd).symm def cubeMinusCoefficient {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C : Finset ι → ℂ) (d : O) (S : Finset ι) : ℂ := star (fixedRayExpansion p (cubeOddSupport B v ε₁ ε₂) S) * firstPassColumnMinus p hp hcop hg C (d * crtLabel p B v ε₁ ε₂ true) S def cubePlusCoefficient {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C : Finset ι → ℂ) (d : O) (S : Finset ι) : ℂ := fixedRayExpansion p (cubeOddSupport B v ε₁ ε₂) S * firstPassColumnPlus p hp hcop hg C (d * crtLabel p B v ε₁ ε₂ false) S def idealPairReindex {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (R : Finset ι) (C₁ C₂ : Finset ι → ℂ) (h : O) : ℂ := letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype let P := fun i => Ideal.span {p i} ∑ r : RayCharacter × RayCharacter, crossCoeff r.1 r.2 * ∑ D ∈ R.powerset, (supportMobius P D * rowCoprimeMask P D h * supportRay p r.1 D * supportRay p r.2 D) * star (conjugateIdealRowSum (supportIdealFamily P (R \ D)) (supportIdealFamily_pos P (R \ D)) (supportIdealFamily_good P hg (R \ D)) (fun I => star (supportRay p r.1 (recoveredSupport P (R \ D) I)) * C₁ (D ∪ recoveredSupport P (R \ D) I)) h) * conjugateIdealRowSum (supportIdealFamily P (R \ D)) (supportIdealFamily_pos P (R \ D)) (supportIdealFamily_good P hg (R \ D)) (fun I => supportRay p r.2 (recoveredSupport P (R \ D) I) * C₂ (D ∪ recoveredSupport P (R \ D) I)) h theorem threeGaussRowFactor_eq_ray_columns {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (N P B : Finset ι) (hNP : Disjoint N P) (hNB : Disjoint N B) (hPB : Disjoint P B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (d h : O) : threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h = cubeBaseFactor p hp hg B v ε₁ ε₂ d h * quadraticCrossPhase p hg N P * star (supportMobius (fun i => Ideal.span {p i}) N * cubeMinusCoefficient p hp hcop hg B v ε₁ ε₂ C₁ d N * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N h)) * (supportMobius (fun i => Ideal.span {p i}) P * cubePlusCoefficient p hp hcop hg B v ε₁ ε₂ C₂ d P * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg P h)) := by rw [threeGaussRowFactor_eq_transformedPair p hp hcop hg hc hpr N P B hNP hNB hPB] unfold cubeTransformedPair cubeMinusCoefficient cubePlusCoefficient rw [fixedRayExpansion_eq_cross p hp hcop hg hc (cubeOddSupport B v ε₁ ε₂) N (hNB.mono_right (Finset.filter_subset _ _)), fixedRayExpansion_eq_cross p hp hcop hg hc (cubeOddSupport B v ε₁ ε₂) P (hPB.mono_right (Finset.filter_subset _ _))] simp only [star_mul, star_star] ring theorem sum_threeGaussRowFactor_eq_ideal_rows {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (R B : Finset ι) (hRB : Disjoint R B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (d h : O) : (∑ N ∈ R.powerset, ∑ P ∈ R.powerset, if Disjoint N P then threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h else 0) = cubeBaseFactor p hp hg B v ε₁ ε₂ d h * idealPairReindex p hg R (cubeMinusCoefficient p hp hcop hg B v ε₁ ε₂ C₁ d) (cubePlusCoefficient p hp hcop hg B v ε₁ ε₂ C₂ d) h := by let A := cubeMinusCoefficient p hp hcop hg B v ε₁ ε₂ C₁ d let C := cubePlusCoefficient p hp hcop hg B v ε₁ ε₂ C₂ d have hsum : (∑ N ∈ R.powerset, ∑ P ∈ R.powerset, if Disjoint N P then threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h else 0) = cubeBaseFactor p hp hg B v ε₁ ε₂ d h * (∑ N ∈ R.powerset, ∑ P ∈ R.powerset, if Disjoint N P then quadraticCrossPhase p hg N P * star (supportMobius (fun i => Ideal.span {p i}) N * A N * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N h)) * (supportMobius (fun i => Ideal.span {p i}) P * C P * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg P h)) else 0) := by simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro N hN apply Finset.sum_congr rfl intro P hP by_cases hd : Disjoint N P · rw [ite_eq_left hd, ite_eq_left hd, threeGaussRowFactor_eq_ray_columns p hp hcop hg hc hpr N P B hd (hRB.mono_left (Finset.mem_powerset.mp hN)) (hRB.mono_left (Finset.mem_powerset.mp hP))] dsimp only [A, C] ring · simp [hd] rw [hsum] congr 1 exact FirstCauchyArithmetic.quadratic_phase_reindex_to_ideal_rows p hp hinj hg hc R A C h end open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory section open ActualEisensteinCubic open FourierBridge (logPhase logPhase_norm logPhase_continuous_left) open EisensteinSchwartzPoisson (paperRadialFourier) def logTwistMinus {ι : Type*} (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (t : ℝ) (S : Finset ι) : ℂ := C S * star (V (y S) * logPhase t (-(y S))) def logTwistPlus {ι : Type*} (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (t : ℝ) (S : Finset ι) : ℂ := C S * (V (y S) * logPhase t (-(y S))) theorem threeGaussRowFactor_log_twist {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (N P B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (d h : O) (V₁ V₂ : ℝ → ℂ) (y₁ y₂ : Finset ι → ℝ) (t : ℝ) : threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ (logTwistMinus C₁ V₁ y₁ t) (logTwistPlus C₂ V₂ y₂ t) d h = (V₁ (y₁ N) * logPhase t (-(y₁ N))) * (V₂ (y₂ P) * logPhase t (-(y₂ P))) * threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h := by simp only [threeGaussRowFactor, logTwistMinus, logTwistPlus, star_mul, star_star] ring theorem integrable_log_pair (b : 𝓢(ℝ, ℂ)) (x y : ℝ) (c : ℂ) : Integrable (fun t : ℝ => b t * (logPhase t x * logPhase t y * c)) volume := by apply b.integrable.mul_bdd (c := ‖c‖) · exact (((logPhase_continuous_left x).mul (logPhase_continuous_left y)).mul_const c).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun t => by simp only [norm_mul, logPhase_norm, one_mul, le_refl]) end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) open EisensteinSchwartzPoisson (paperRadialFourier) def primeProductNorm {ι : Type*} (p : ι → O) (S : Finset ι) : ℝ := ‖eisEmbedding (∏ i ∈ S, p i)‖ ^ 2 theorem primeProductNorm_pos {ι : Type*} (p : ι → O) (hp : ∀ i, p i ≠ 0) (S : Finset ι) : 0 < primeProductNorm p S := pow_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i)))) 2 theorem primeProductNorm_union {ι : Type*} [DecidableEq ι] (p : ι → O) (S T : Finset ι) (hd : Disjoint S T) : primeProductNorm p (S ∪ T) = primeProductNorm p S * primeProductNorm p T := by simp only [primeProductNorm, Finset.prod_union hd, map_mul, norm_mul, mul_pow] def columnLog {ι : Type*} (p : ι → O) (X : ℝ) (S : Finset ι) : ℝ := Real.log (primeProductNorm p S / X) def firstDualScale {ι : Type*} (p : ι → O) (C : Finset ι) (lengthScale X₁ X₂ : ℝ) (d h : O) : ℝ := lengthScale * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * primeProductNorm p C * X₁ * X₂) theorem actual_radial_argument {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (N P C : Finset ι) (hNP : Disjoint N P) (hNC : Disjoint N C) (hPC : Disjoint P C) (lengthScale X₁ X₂ : ℝ) (hX₁ : 0 < X₁) (hX₂ : 0 < X₂) (d h : O) : firstDualScale p C lengthScale X₁ X₂ d h * Real.exp (-(columnLog p X₁ N) - columnLog p X₂ P) = lengthScale * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * primeProductNorm p ((N ∪ P) ∪ C)) := by rw [primeProductNorm_union p (N ∪ P) C (Finset.disjoint_union_left.mpr ⟨hNC, hPC⟩), primeProductNorm_union p N P hNP] simp only [columnLog, sub_eq_add_neg, Real.exp_add, Real.exp_neg] rw [Real.exp_log (div_pos (primeProductNorm_pos p hp N) hX₁), Real.exp_log (div_pos (primeProductNorm_pos p hp P) hX₂)] simp only [firstDualScale, div_eq_mul_inv, mul_inv_rev, inv_inv] field_simp [ne_of_gt hX₁, ne_of_gt hX₂] def normalizedColumn {ι : Type*} (p : ι → O) (C : Finset ι → ℂ) (S : Finset ι) : ℂ := C S / (‖eisEmbedding (∏ i ∈ S, p i)‖ : ℂ) theorem threeGaussRowFactor_normalized {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (N P B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (d h : O) : threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ (normalizedColumn p C₁) (normalizedColumn p C₂) d h = ((‖eisEmbedding (∏ i ∈ N, p i)‖ : ℂ)⁻¹ * (‖eisEmbedding (∏ i ∈ P, p i)‖ : ℂ)⁻¹) * threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h := by have hs (x : ℝ) : star (x : ℂ) = (x : ℂ) := by simp have hsi (x : ℝ) : star ((x : ℂ)⁻¹) = (x : ℂ)⁻¹ := by simp simp only [threeGaussRowFactor, normalizedColumn, div_eq_mul_inv, star_mul, hsi] ring theorem actual_pair_prefactor {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (N P B : Finset ι) (hNP : Disjoint N P) (hNB : Disjoint N B) (hPB : Disjoint P B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (lengthScale : ℝ) (d h : O) : ((lengthScale : ℂ) / (‖eisEmbedding (∏ i ∈ (N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂, p i)‖ : ℂ)) * threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h = ((lengthScale : ℂ) / (‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂, p i)‖ : ℂ)) * threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ (normalizedColumn p C₁) (normalizedColumn p C₂) d h := by rw [threeGaussRowFactor_normalized] have hNC : Disjoint N (cubeActiveSupport B v ε₁ ε₂) := hNB.mono_right (Finset.filter_subset _ _) have hPC : Disjoint P (cubeActiveSupport B v ε₁ ε₂) := hPB.mono_right (Finset.filter_subset _ _) rw [Finset.prod_union (Finset.disjoint_union_left.mpr ⟨hNC, hPC⟩), Finset.prod_union hNP] simp only [map_mul, norm_mul, Complex.ofReal_mul, div_eq_mul_inv, mul_inv_rev] ring theorem cube_integral_of_radial_separation {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F B : Finset ι) (hFB : Disjoint F B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (d h : O) (W : 𝓢(ℝ, ℂ)) (V₁ V₂ : ℝ → ℂ) (y₁ y₂ : Finset ι → ℝ) (R : ℝ) (b : 𝓢(ℝ, ℂ)) (hsep : ∀ x y : ℝ, V₁ x * V₂ y * paperRadialFourier W (R * Real.exp (-x-y)) = ∫ t : ℝ, (V₁ x * FourierBridge.logPhase t (-x)) * (V₂ y * FourierBridge.logPhase t (-y)) * b t) : Integrable (fun t : ℝ => b t * cubeBaseFactor p hp hg B v ε₁ ε₂ d h * idealPairReindex p hg F (cubeMinusCoefficient p hp hcop hg B v ε₁ ε₂ (logTwistMinus C₁ V₁ y₁ t) d) (cubePlusCoefficient p hp hcop hg B v ε₁ ε₂ (logTwistPlus C₂ V₂ y₂ t) d) h) volume ∧ (∑ N ∈ F.powerset, ∑ P ∈ F.powerset, if Disjoint N P then (V₁ (y₁ N) * V₂ (y₂ P) * paperRadialFourier W (R * Real.exp (-(y₁ N)-y₂ P))) * threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h else 0) = ∫ t : ℝ, b t * cubeBaseFactor p hp hg B v ε₁ ε₂ d h * idealPairReindex p hg F (cubeMinusCoefficient p hp hcop hg B v ε₁ ε₂ (logTwistMinus C₁ V₁ y₁ t) d) (cubePlusCoefficient p hp hcop hg B v ε₁ ε₂ (logTwistPlus C₂ V₂ y₂ t) d) h := by let G : ℝ → Finset ι → Finset ι → ℂ := fun t N P => if Disjoint N P then b t * threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ (logTwistMinus C₁ V₁ y₁ t) (logTwistPlus C₂ V₂ y₂ t) d h else 0 have hGint (N P : Finset ι) : Integrable (fun t => G t N P) volume := by by_cases hd : Disjoint N P · simp only [G, ite_eq_left hd] convert integrable_log_pair b (-(y₁ N)) (-(y₂ P)) (V₁ (y₁ N) * V₂ (y₂ P) * threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h) using 1 funext t rw [threeGaussRowFactor_log_twist] ring · simp only [G, ite_eq_right hd] exact integrable_zero _ _ _ have hGsum (t : ℝ) : (∑ N ∈ F.powerset, ∑ P ∈ F.powerset, G t N P) = b t * cubeBaseFactor p hp hg B v ε₁ ε₂ d h * idealPairReindex p hg F (cubeMinusCoefficient p hp hcop hg B v ε₁ ε₂ (logTwistMinus C₁ V₁ y₁ t) d) (cubePlusCoefficient p hp hcop hg B v ε₁ ε₂ (logTwistPlus C₂ V₂ y₂ t) d) h := by calc _ = b t * (∑ N ∈ F.powerset, ∑ P ∈ F.powerset, if Disjoint N P then threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ (logTwistMinus C₁ V₁ y₁ t) (logTwistPlus C₂ V₂ y₂ t) d h else 0) := by simp only [G, Finset.mul_sum, mul_ite, mul_zero] _ = _ := by rw [sum_threeGaussRowFactor_eq_ideal_rows p hp hinj hcop hg hc hpr F B hFB] ring have hint : Integrable (fun t => ∑ N ∈ F.powerset, ∑ P ∈ F.powerset, G t N P) volume := integrable_finsetSum _ (fun N _ => integrable_finsetSum _ (fun P _ => hGint N P)) constructor · simpa only [hGsum] using hint · have hterm (N P : Finset ι) : (if Disjoint N P then (V₁ (y₁ N) * V₂ (y₂ P) * paperRadialFourier W (R * Real.exp (-(y₁ N)-y₂ P))) * threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h else 0) = ∫ t : ℝ, G t N P := by by_cases hd : Disjoint N P · simp only [G, ite_eq_left hd] rw [hsep (y₁ N) (y₂ P), ← integral_mul_const] apply integral_congr_ae filter_upwards [] with t rw [threeGaussRowFactor_log_twist] ring · simp [G, hd] calc _ = ∑ N ∈ F.powerset, ∑ P ∈ F.powerset, ∫ t : ℝ, G t N P := by apply Finset.sum_congr rfl intro N hN exact Finset.sum_congr rfl (fun P hP => hterm N P) _ = ∫ t : ℝ, ∑ N ∈ F.powerset, ∑ P ∈ F.powerset, G t N P := by rw [integral_finsetSum _ (fun N _ => integrable_finsetSum _ (fun P _ => hGint N P))] apply Finset.sum_congr rfl intro N hN exact (integral_finsetSum _ (fun P _ => hGint N P)).symm _ = _ := by apply integral_congr_ae filter_upwards [] with t exact hGsum t end FirstPassCubeLabels open scoped BigOperators Classical namespace QuadraticDivisorSplit abbrev O := ActualEisensteinCubic.O theorem exists_unique_split (B C D : Ideal O) (hBC : IsCoprime B C) (hD : D ∣ B * C) : ∃! x : Ideal O × Ideal O, x.1 ∣ B ∧ x.2 ∣ C ∧ x.1 * x.2 = D := by obtain ⟨D₁, D₂, h₁, h₂, hprod⟩ := exists_dvd_and_dvd_of_dvd_mul hD refine ⟨(D₁, D₂), ⟨h₁, h₂, hprod.symm⟩, ?_⟩ intro y hy apply Prod.ext · apply associated_iff_eq.mp apply associated_of_dvd_dvd · apply (hBC.mono hy.1 h₂).dvd_of_dvd_mul_right rw [← hprod, ← hy.2.2] exact dvd_mul_right _ _ · apply (hBC.mono h₁ hy.2.1).dvd_of_dvd_mul_right rw [hy.2.2, hprod] exact dvd_mul_right _ _ · apply associated_iff_eq.mp apply associated_of_dvd_dvd · apply (hBC.symm.mono hy.2.1 h₁).dvd_of_dvd_mul_left rw [← hprod, ← hy.2.2] exact dvd_mul_left _ _ · apply (hBC.symm.mono h₂ hy.1).dvd_of_dvd_mul_left rw [hy.2.2, hprod] exact dvd_mul_left _ _ theorem split_product_injective (B C : Ideal O) (hBC : IsCoprime B C) : Function.Injective (fun x : {x : Ideal O × Ideal O // x.1 ∣ B ∧ x.2 ∣ C} => x.val.1 * x.val.2) := by intro x y hxy have hD : x.val.1 * x.val.2 ∣ B * C := mul_dvd_mul x.property.1 x.property.2 obtain ⟨z, hz, huniq⟩ := exists_unique_split B C (x.val.1 * x.val.2) hBC hD apply Subtype.ext exact (huniq x.val ⟨x.property.1, x.property.2, rfl⟩).trans (huniq y.val ⟨y.property.1, y.property.2, hxy.symm⟩).symm open IdealMobiusDivisorSum theorem divisors_coprime_product (B C : Ideal O) (hB : B ≠ 0) (hC : C ≠ 0) (hBC : IsCoprime B C) : idealDivisors (B * C) = ((idealDivisors B) ×ˢ (idealDivisors C)).image (fun x => x.1 * x.2) := by ext D rw [mem_idealDivisors (mul_ne_zero hB hC), Finset.mem_image] constructor · intro hD obtain ⟨x, hx, _⟩ := exists_unique_split B C D hBC hD exact ⟨x, Finset.mem_product.mpr ⟨(mem_idealDivisors hB).mpr hx.1, (mem_idealDivisors hC).mpr hx.2.1⟩, hx.2.2⟩ · rintro ⟨x, hx, rfl⟩ exact mul_dvd_mul ((mem_idealDivisors hB).mp (Finset.mem_product.mp hx).1) ((mem_idealDivisors hC).mp (Finset.mem_product.mp hx).2) theorem sum_divisors_coprime_product (B C : Ideal O) (hB : B ≠ 0) (hC : C ≠ 0) (hBC : IsCoprime B C) (f : Ideal O → ℂ) : (∑ D ∈ idealDivisors (B * C), f D) = ∑ D₁ ∈ idealDivisors B, ∑ D₂ ∈ idealDivisors C, f (D₁ * D₂) := by rw [divisors_coprime_product B C hB hC hBC, Finset.sum_image] · exact Finset.sum_product _ _ _ · intro x hx y hy hxy have hx' : x.1 ∣ B ∧ x.2 ∣ C := ⟨(mem_idealDivisors hB).mp (Finset.mem_product.mp hx).1, (mem_idealDivisors hC).mp (Finset.mem_product.mp hx).2⟩ have hy' : y.1 ∣ B ∧ y.2 ∣ C := ⟨(mem_idealDivisors hB).mp (Finset.mem_product.mp hy).1, (mem_idealDivisors hC).mp (Finset.mem_product.mp hy).2⟩ have he : (⟨x, hx'⟩ : {z : Ideal O × Ideal O // z.1 ∣ B ∧ z.2 ∣ C}) = ⟨y, hy'⟩ := split_product_injective B C hBC hxy exact congrArg Subtype.val he end QuadraticDivisorSplit end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.ReflectionBrackets namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid namespace LocalReflectionBrackets open scoped Classical BigOperators open AddChar MulChar section variable {F : Type*} [Field F] [Fintype F] theorem norm_bracket_nonexceptional_le_one (χ : MulChar F ℂ) (j : ℕ) (hj4 : j ≠ 4) (hj0 : j ≠ 0) (x : F) : ‖bracket χ j x‖ ≤ 1 := by rw [norm_bracket_nonexceptional χ j hj4 hj0] split_ifs <;> norm_num theorem norm_bracket_zero_le (χ : MulChar F ℂ) (x : F) : ‖bracket χ 0 x‖ ≤ (rootCard F)⁻¹ := by rw [norm_bracket_zero] split_ifs <;> simp only [mul_zero, mul_one, le_refl] exact inv_nonneg.mpr rootCard_pos.le open ActualEisensteinCubic noncomputable abbrev quotientFintypeBounds (P : Ideal O) [P.IsMaximal] : Fintype (O ⧸ P) := Fintype.ofFinite _ end variable {F : Type*} [Field F] [Fintype F] def zeroFourierCoefficient (χ : MulChar F ℂ) (j : ℕ) : ℂ := (Fintype.card F : ℂ)⁻¹ * ∑ t : F, (χ ^ j) t theorem zeroFourierCoefficient_zero (χ : MulChar F ℂ) : zeroFourierCoefficient χ 0 = 1 - (Fintype.card F : ℂ)⁻¹ := by have hq : 1 ≤ Fintype.card F := Fintype.card_pos_iff.mpr ⟨0⟩ have hq0 : (Fintype.card F : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt hq rw [zeroFourierCoefficient, pow_zero, MulChar.sum_one_eq_card_units, Fintype.card_units, Nat.cast_sub hq, Nat.cast_one] field_simp theorem zeroFourierCoefficient_nontrivial (χ : MulChar F ℂ) (j : ℕ) (hj : χ ^ j ≠ 1) : zeroFourierCoefficient χ j = 0 := by rw [zeroFourierCoefficient, MulChar.sum_eq_zero_of_ne_one hj, mul_zero] theorem zeroFourierCoefficient_zero_norm_le_one (χ : MulChar F ℂ) : ‖zeroFourierCoefficient χ 0‖ ≤ 1 := by rw [zeroFourierCoefficient_zero] have hq : (1 : ℝ) ≤ Fintype.card F := by exact_mod_cast Fintype.card_pos_iff.mpr ⟨(0 : F)⟩ have hqpos : (0 : ℝ) < Fintype.card F := lt_of_lt_of_le zero_lt_one hq have hinv : (Fintype.card F : ℝ)⁻¹ ≤ 1 := by apply (inv_le_one₀ hqpos).mpr exact hq have hnonneg : 0 ≤ 1 - (Fintype.card F : ℝ)⁻¹ := sub_nonneg.mpr hinv have heq : (1 : ℂ) - (Fintype.card F : ℂ)⁻¹ = ((1 - (Fintype.card F : ℝ)⁻¹ : ℝ) : ℂ) := by push_cast rfl rw [heq, Complex.norm_real, Real.norm_of_nonneg hnonneg] exact sub_le_self _ (inv_nonneg.mpr hqpos.le) open ActualEisensteinCubic noncomputable abbrev quotientFieldInactive (P : Ideal O) [P.IsMaximal] : Field (O ⧸ P) := Ideal.Quotient.field P noncomputable abbrev quotientFintypeInactive (P : Ideal O) [P.IsMaximal] : Fintype (O ⧸ P) := Fintype.ofFinite _ theorem canonical_zeroFourierCoefficient (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (hchar : ringChar (O ⧸ P) ≠ 2) (j : ℕ) (hj6 : j < 6) : let : Field (O ⧸ P) := quotientFieldInactive P let : Fintype (O ⧸ P) := quotientFintypeInactive P zeroFourierCoefficient (canonicalSextic P hgood) j = if j = 0 then 1 - (Fintype.card (O ⧸ P) : ℂ)⁻¹ else 0 := by let : Field (O ⧸ P) := quotientFieldInactive P let : Fintype (O ⧸ P) := quotientFintypeInactive P dsimp only by_cases hj : j = 0 · subst j simpa using zeroFourierCoefficient_zero (canonicalSextic P hgood) · rw [ite_eq_right hj] exact zeroFourierCoefficient_nontrivial _ j (canonicalSextic_pow_ne_one P hgood hchar hj hj6) end LocalReflectionBrackets namespace EisensteinSchwartzPoisson open MeasureTheory MeasureTheory.Measure Set Real open scoped SchwartzMap FourierTransform theorem complex_radial_norm_sq_integral (F : ℝ → ℂ) : (∫ z : ℂ, F (‖z‖ ^ 2)) = (Real.pi : ℂ) * ∫ t : ℝ in Ioi 0, F t := by have hsub : (∫ r : ℝ in Ioi 0, (2 * r) • F (r ^ 2)) = ∫ t : ℝ in Ioi 0, F t := by simpa only [show (2 : ℝ) - 1 = 1 by norm_num, Real.rpow_one, Real.rpow_two] using (integral_comp_rpow_Ioi_of_pos (g := F) (by norm_num : (0 : ℝ) < 2)) have hsub' : (2 : ℂ) * (∫ r : ℝ in Ioi 0, (r : ℂ) * F (r ^ 2)) = ∫ t : ℝ in Ioi 0, F t := by simpa only [Complex.real_smul, Complex.ofReal_mul, Complex.ofReal_ofNat, mul_assoc, integral_const_mul] using hsub calc _ = ∫ p : ℝ × ℝ in Ioi (0 : ℝ) ×ˢ Ioo (-Real.pi) Real.pi, (p.1 : ℂ) * F (p.1 ^ 2) := by rw [← Complex.integral_comp_polarCoord_symm, polarCoord_target] simp only [Complex.norm_polarCoord_symm, sq_abs, Complex.real_smul] _ = (∫ r : ℝ in Ioi 0, (r : ℂ) * F (r ^ 2)) * ∫ _θ : ℝ in Ioo (-Real.pi) Real.pi, (1 : ℂ) := by rw [← setIntegral_prod_mul, volume_eq_prod] simp only [mul_one] _ = (∫ r : ℝ in Ioi 0, (r : ℂ) * F (r ^ 2)) * (2 * Real.pi : ℂ) := by congr 1 simp only [integral_const, measureReal_restrict_apply MeasurableSet.univ, Set.univ_inter, volume_real_Ioo_of_le (a := -Real.pi) (b := Real.pi) (by linarith [Real.pi_pos]), sub_neg_eq_add, Complex.real_smul, mul_one] push_cast ring _ = (Real.pi : ℂ) * ∫ t : ℝ in Ioi 0, F t := by rw [← hsub']; ring theorem paperRadialFourier_zero_eq_halfline (F : ℝ → ℂ) : paperRadialFourier F 0 = (2 * Real.pi / Real.sqrt 3 : ℂ) * ∫ t : ℝ in Ioi 0, F t := by have he : paperE 0 = 1 := by simp [paperE_eq_exp] simp only [paperRadialFourier, paperFourier, Real.sqrt_zero, Complex.ofReal_zero, mul_zero, neg_zero, he, one_mul] rw [complex_radial_norm_sq_integral] simp only [Complex.real_smul, Complex.ofReal_div, Complex.ofReal_ofNat] ring theorem quadratic_principal_zero_modes_equal (W : 𝓢(ℝ, ℂ)) : paperRadialFourier (fun t : ℝ => paperRadialFourier W (t ^ 2)) 0 = paperRadialFourier (fun t : ℝ => W (t ^ 2)) 0 := by rw [paperRadialFourier_zero_eq_halfline, paperRadialFourier_zero_eq_halfline, paperRadialFourier_halfline_integral] def quadraticSquareProfile (W : 𝓢(ℝ, ℂ)) : 𝓢(ℝ, ℂ) := horizontalSlice (radialTest W) 0 theorem quadraticSquareProfile_apply (W : 𝓢(ℝ, ℂ)) (x : ℝ) : quadraticSquareProfile W x = W (x ^ 2) := by simp [quadraticSquareProfile, horizontalSlice_apply, complexPoint_eq, radialTest_apply, Complex.norm_real, Real.norm_eq_abs, sq_abs] def quadraticTransformedSquareProfile (W : 𝓢(ℝ, ℂ)) : 𝓢(ℝ, ℂ) := (2 / Real.sqrt 3 : ℝ) • SchwartzMap.compCLMOfContinuousLinearEquiv ℂ (ContinuousLinearEquiv.unitsEquivAut ℝ (Units.mk0 (2 / Real.sqrt 3) (by positivity))) (horizontalSlice (𝓕 (radialTest W)) 0) theorem quadraticTransformedSquareProfile_apply (W : 𝓢(ℝ, ℂ)) (x : ℝ) : quadraticTransformedSquareProfile W x = paperRadialFourier W (x ^ 2) := by simp only [quadraticTransformedSquareProfile, _root_.smul_apply, SchwartzMap.compCLMOfContinuousLinearEquiv_apply, Function.comp_apply, ContinuousLinearEquiv.unitsEquivAut_apply, Units.val_mk0, horizontalSlice_apply] rw [paperRadialFourier_square] simp only [complexPoint_eq, Complex.ofReal_zero, mul_zero, add_zero, SchwartzMap.fourier_coe, mul_comm x (2 / Real.sqrt 3)] rfl theorem quadraticSquareProfile_principal_equal (W : 𝓢(ℝ, ℂ)) : paperRadialFourier (quadraticTransformedSquareProfile W) 0 = paperRadialFourier (quadraticSquareProfile W) 0 := by have h1 : (quadraticTransformedSquareProfile W : ℝ → ℂ) = fun x => paperRadialFourier W (x ^ 2) := by funext x; exact quadraticTransformedSquareProfile_apply W x have h2 : (quadraticSquareProfile W : ℝ → ℂ) = fun x => W (x ^ 2) := by funext x; exact quadraticSquareProfile_apply W x rw [h1, h2, quadratic_principal_zero_modes_equal] end EisensteinSchwartzPoisson open scoped BigOperators Classical SchwartzMap namespace ActualEisensteinCubic open ConcreteTraceCRT ConcretePrimeRowBridge ActualEisensteinCoordinates EisensteinSchwartzPoisson theorem primeSubsetGenerator_norm_sq {ι : Type*} (P : ι → Ideal O) (E : Finset ι) : ‖eisEmbedding (primeSubsetGenerator P E)‖ ^ 2 = (Ideal.absNorm (∏ i ∈ E, P i) : ℝ) := by rw [eisEmbedding_norm_sq_eq_absNorm_span] exact congrArg (fun I : Ideal O => (Ideal.absNorm I : ℝ)) (span_idealGenerator _) theorem masked_principal_radial_poisson {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (V : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : (∑' z : O, rowCoprimeMask P S z * V (‖eisEmbedding z‖ ^ 2 / M)) = (M : ℂ) * ∑ E ∈ S.powerset, ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) / (Ideal.absNorm (∏ i ∈ E, P i) : ℂ)) * ∑' h : O, paperRadialFourier V (M * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm (∏ i ∈ E, P i) : ℝ)) := by let Q : Empty → Ideal O := Empty.elim let : ∀ i, (Q i).IsMaximal := fun i => nomatch i have hcop : Pairwise (Function.onFun IsCoprime Q) := by intro i; cases i have hg : ∀ i, lambda ∉ Q i := fun i => nomatch i have hc : ∀ i, ringChar (O ⧸ Q i) ≠ 2 := fun i => nomatch i have hj0 : ∀ i : Empty, (1 : ℕ) ≠ 0 := fun i => nomatch i have hj6 : ∀ i : Empty, (1 : ℕ) < 6 := fun i => nomatch i have hp := canonical_masked_radial_poisson_collected P hinj S Q hcop hg hc (fun _ => 1) hj0 hj6 V M hM simpa only [finiteSexticRow_of_isEmpty, canonicalNormalizedGauss_of_isEmpty, finitePrimeModulus_norm_of_isEmpty, Complex.ofReal_one, mul_one, div_one, star_one, one_mul, one_pow, primeSubsetGenerator_norm_sq, Complex.ofReal_natCast] using hp def maskedPrincipalRemainder {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) (S : Finset ι) (V : ℝ → ℂ) (M : ℝ) : ℂ := (M : ℂ) * ∑ E ∈ S.powerset, ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) / (Ideal.absNorm (∏ i ∈ E, P i) : ℂ)) * ∑' h : O, if h = 0 then 0 else paperRadialFourier V (M * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm (∏ i ∈ E, P i) : ℝ)) theorem masked_principal_radial_poisson_zero_split {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (V : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : (∑' z : O, rowCoprimeMask P S z * V (‖eisEmbedding z‖ ^ 2 / M)) = (M : ℂ) * paperRadialFourier V 0 * (∏ i ∈ S, (1 - (1 : ℂ) / Ideal.absNorm (P i))) + maskedPrincipalRemainder P S V M := by have hp (E : Finset ι) : 0 < (Ideal.absNorm (∏ i ∈ E, P i) : ℝ) := by rw [← primeSubsetGenerator_norm_sq] exact sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero (primeSubsetGenerator_ne_zero P E))) have hs (E : Finset ι) : (∑' h : O, paperRadialFourier V (M * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm (∏ i ∈ E, P i) : ℝ))) = paperRadialFourier V 0 + ∑' h : O, if h = 0 then 0 else paperRadialFourier V (M * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm (∏ i ∈ E, P i) : ℝ)) := by have hsum := (paperRadialFourier_lattice_summable_norm V (M / (Ideal.absNorm (∏ i ∈ E, P i) : ℝ)) (div_pos hM (hp E))).of_norm have heq (h : O) : M / (Ideal.absNorm (∏ i ∈ E, P i) : ℝ) * ‖eisEmbedding h‖ ^ 2 = M * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm (∏ i ∈ E, P i) : ℝ) := by ring simp_rw [heq] at hsum simpa only [map_zero, norm_zero, zero_pow (by decide : 2 ≠ 0), mul_zero, zero_div] using hsum.tsum_eq_add_tsum_ite 0 have hprime : ∀ i, Prime (P i) := fun i => Ideal.prime_of_isPrime (NeZero.ne (P i)) inferInstance rw [masked_principal_radial_poisson P hinj S V M hM] simp_rw [hs, mul_add] rw [Finset.sum_add_distrib, ← Finset.sum_mul, mul_add] rw [primeSubset_moebius_norm_sum P hprime hinj S] unfold maskedPrincipalRemainder ring end ActualEisensteinCubic open scoped BigOperators Classical namespace PrimaryIdealUnitReindex abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic CompletedGauss ConcretePrimeRowBridge abbrev GoodIdeal := {I : Ideal O // primaryGenerator I ≠ 0} abbrev GoodElement := {z : O // primaryGenerator (Ideal.span {z}) ≠ 0} theorem finite_units : Finite Oˣ := by let f : Oˣ → {z : O // z ∈ rowNormDisk 1} := fun u => ⟨u.val, by rw [mem_rowNormDisk] rw [Ideal.span_singleton_eq_top.mpr u.isUnit] norm_num⟩ exact Finite.of_injective f (fun u v h => Units.ext (congrArg Subtype.val h)) theorem span_unit_primary (u : Oˣ) (I : GoodIdeal) : Ideal.span {(u : O) * primaryGenerator I.val} = I.val := by rw [Ideal.span_singleton_mul_left_unit u.isUnit] exact (primaryGenerator_spec I.val I.property).1 def unitIdealToElement (p : Oˣ × GoodIdeal) : GoodElement := ⟨p.1.val * primaryGenerator p.2.val, by rw [span_unit_primary]; exact p.2.property⟩ theorem unitIdealToElement_injective : Function.Injective unitIdealToElement := by intro p q hpq have he : p.1.val * primaryGenerator p.2.val = q.1.val * primaryGenerator q.2.val := congrArg Subtype.val hpq have hI : p.2 = q.2 := by apply Subtype.ext simpa only [span_unit_primary] using congrArg (fun z : O => Ideal.span {z}) he have hu : p.1 = q.1 := by apply Units.ext rw [hI] at he exact mul_right_cancel₀ q.2.property he exact Prod.ext hu hI theorem unitIdealToElement_surjective : Function.Surjective unitIdealToElement := by intro z let I : GoodIdeal := ⟨Ideal.span {z.val}, z.property⟩ have ha : Associated (primaryGenerator I.val) z.val := Ideal.span_singleton_eq_span_singleton.mp (primaryGenerator_spec I.val I.property).1 obtain ⟨u, hu⟩ := ha refine ⟨(u, I), Subtype.ext ?_⟩ change u.val * primaryGenerator I.val = z.val simpa only [mul_comm] using hu def unitIdealEquiv : Oˣ × GoodIdeal ≃ GoodElement := Equiv.ofBijective unitIdealToElement ⟨unitIdealToElement_injective, unitIdealToElement_surjective⟩ theorem tsum_good_elements_product (f : O → ℂ) : (∑' z : GoodElement, f z.val) = ∑' p : Oˣ × GoodIdeal, f (p.1.val * primaryGenerator p.2.val) := by exact (unitIdealEquiv.tsum_eq (fun z : GoodElement => f z.val)).symm theorem tsum_good_elements_unit_invariant (f : O → ℂ) (hf : Summable (fun z : GoodElement => f z.val)) (hu : ∀ (u : Oˣ) (I : GoodIdeal), f (u.val * primaryGenerator I.val) = f (primaryGenerator I.val)) : (∑' z : GoodElement, f z.val) = (Nat.card Oˣ : ℂ) * ∑' I : GoodIdeal, f (primaryGenerator I.val) := by let : Finite Oˣ := finite_units let : Fintype Oˣ := Fintype.ofFinite _ have hp : Summable (fun p : Oˣ × GoodIdeal => f (p.1.val * primaryGenerator p.2.val)) := unitIdealEquiv.summable_iff.mpr hf rw [tsum_good_elements_product, hp.tsum_prod] simp only [hu, tsum_fintype, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, Nat.card_eq_fintype_card] theorem lambda_prime_actual : Prime lambda := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK let : Fact (Nat.Prime 3) := ⟨Nat.prime_three⟩ exact (IsCyclotomicExtension.zeta_spec 3 ℚ ActualEisensteinCubic.K).zeta_sub_one_prime' theorem primaryGenerator_ne_zero_of_good_factors (I : Ideal O) (hI : I ≠ 0) (hg : ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, lambda ∉ P) : primaryGenerator I ≠ 0 := by rw [primaryGenerator, ite_eq_right hI] apply Multiset.prod_ne_zero intro hz obtain ⟨P, hP, hzero⟩ := Multiset.mem_map.mp hz have hp := UniqueFactorizationMonoid.prime_of_normalized_factor P hP let : P.IsMaximal := (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero exact primaryPrime_ne_zero P (hg P hP) hzero theorem primaryGenerator_span_ne_zero_iff (z : O) : primaryGenerator (Ideal.span {z}) ≠ 0 ↔ ¬ lambda ∣ z := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO constructor · intro hg hdiv have hs := primaryGenerator_spec (Ideal.span {z}) hg have hzgen : z ∣ primaryGenerator (Ideal.span {z}) := by apply Ideal.mem_span_singleton.mp exact hs.1.le (Ideal.subset_span (by simp)) have hgen := hdiv.trans hzgen have hminus : lambda ∣ primaryGenerator (Ideal.span {z}) - 1 := (dvd_pow_self lambda (by decide : 2 ≠ 0)).trans hs.2 have hone : lambda ∣ (1 : O) := by convert dvd_sub hgen hminus using 1 ; ring exact lambda_prime_actual.not_isUnit (isUnit_of_dvd_one hone) · intro hdiv have hz : z ≠ 0 := by intro h; subst z; exact hdiv (dvd_zero _) have hI : (Ideal.span {z} : Ideal O) ≠ 0 := Ideal.span_singleton_eq_bot.not.mpr hz apply primaryGenerator_ne_zero_of_good_factors _ hI intro P hP hlam have hp := UniqueFactorizationMonoid.prime_of_normalized_factor P hP let : P.IsMaximal := (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero have hzin : z ∈ P := ((Ideal.mem_normalizedFactors_iff hI).mp hP).2 (Ideal.subset_span (by simp)) have hcop : IsCoprime lambda z := lambda_prime_actual.irreducible.coprime_iff_not_dvd.mpr hdiv obtain ⟨a, b, hab⟩ := hcop have hone : (1 : O) ∈ P := by rw [← hab] exact P.add_mem (P.mul_mem_left a hlam) (P.mul_mem_left b hzin) exact (inferInstance : P.IsMaximal).ne_top ((Ideal.eq_top_iff_one P).mpr hone) theorem tsum_ramified_mask (f : O → ℂ) : (∑' z : O, if lambda ∣ z then 0 else f z) = ∑' z : GoodElement, f z.val := by calc _ = ∑' z : O, ({z : O | primaryGenerator (Ideal.span {z}) ≠ 0} : Set O).indicator f z := by apply tsum_congr intro z simp only [Set.indicator, Set.mem_ofPred_eq, primaryGenerator_span_ne_zero_iff] split_ifs <;> rfl _ = _ := (tsum_subtype ({z : O | primaryGenerator (Ideal.span {z}) ≠ 0} : Set O) f).symm theorem tsum_ramified_mask_unit_invariant (f : O → ℂ) (hf : Summable f) (hu : ∀ (u : Oˣ) (I : GoodIdeal), f (u.val * primaryGenerator I.val) = f (primaryGenerator I.val)) : (∑' z : O, if lambda ∣ z then 0 else f z) = (Nat.card Oˣ : ℂ) * ∑' I : GoodIdeal, f (primaryGenerator I.val) := by rw [tsum_ramified_mask] exact tsum_good_elements_unit_invariant f (hf.subtype _) hu end PrimaryIdealUnitReindex open scoped BigOperators Classical namespace QuadraticUnitInvariance abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase ActualEisensteinCoordinates open GaussGeneratorTransport QuadraticGaussRay theorem principalNormalizedGauss_three_eq_quadraticGamma {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hg : ∀ i, lambda ∉ P i) (hchar : ∀ i, ringChar (O ⧸ P i) ≠ 2) (c : O) (hc : Ideal.span {c} = ∏ i, P i) (hc0 : c ≠ 0) : principalNormalizedGauss P hcop hg (fun _ => 3) c hc hc0 = quadraticGammaO c hc0 := by let : Finite (O ⧸ Ideal.span {c}) := finite_quotient_span hc0 let : Fintype (O ⧸ Ideal.span {c}) := Fintype.ofFinite _ let (i : ι) : Fintype (O ⧸ P i) := Fintype.ofFinite _ let (i : ι) : Field (O ⧸ P i) := Ideal.Quotient.field _ let e := (Ideal.quotEquivOfEq hc).trans (IdealGaussCRT.quotientProdEquivPi P hcop) let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc0 change (∑ x : O ⧸ Ideal.span {c}, (∏ i, (canonicalSextic (P i) (hg i) ^ 3) (e x i)) * ψ x) / (‖eisEmbedding c‖ : ℂ) = (∑ x : O ⧸ Ideal.span {c}, ψ (x ^ 2)) / (‖eisEmbedding c‖ : ℂ) congr 1 simp_rw [canonicalSextic_pow_three_quadratic] exact IdealGaussCRT.quadratic_gauss_finite_crt_eq_square_sum (fun i => O ⧸ P i) e ψ (GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive c hc0) hchar theorem principalNormalizedGauss_three_eq_rayValue {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime P)) (hg : ∀ i, lambda ∉ P i) (hchar : ∀ i, ringChar (O ⧸ P i) ≠ 2) (c : O) (hc : Ideal.span {c} = ∏ i, P i) (hc0 : c ≠ 0) : principalNormalizedGauss P hcop hg (fun _ => 3) c hc hc0 = quadraticRayValue (residue c) := by rw [principalNormalizedGauss_three_eq_quadraticGamma P hcop hg hchar c hc hc0, quadraticGammaO_eq_rayValue] theorem quadratic_unit_phase {ι : Type*} [Fintype ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (u : Oˣ) : finiteSexticRow (fun i => Ideal.span {p i}) hg (fun _ => 3) u.val * quadraticRayValue (residue (∏ i, p i)) = quadraticRayValue (residue (u.val * ∏ i, p i)) := by have hn0 : (∏ i, p i) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i _ => hp i) have hn : Ideal.span {∏ i, p i} = ∏ i, Ideal.span {p i} := span_finset_prod _ _ have hc : Ideal.span {u.val * ∏ i, p i} = ∏ i, Ideal.span {p i} := by rw [Ideal.span_singleton_mul_left_unit u.isUnit, hn] have h := principalNormalizedGauss_unit_change (fun i => Ideal.span {p i}) hcop hg (fun _ => 3) (u.val * ∏ i, p i) (∏ i, p i) hc hn (mul_ne_zero u.ne_zero hn0) hn0 u rfl rw [principalNormalizedGauss_three_eq_rayValue _ hcop hg hchar, principalNormalizedGauss_three_eq_rayValue _ hcop hg hchar] at h exact h.symm theorem finiteSexticRow_three_star {ι : Type*} [Fintype ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (z : O) : star (finiteSexticRow P hg (fun _ => 3) z) = finiteSexticRow P hg (fun _ => 3) z := by simp only [finiteSexticRow, star_prod] apply Finset.prod_congr rfl intro i _ rw [canonicalSextic_pow_three_quadratic] simp only [MulChar.ringHomComp_apply, Int.coe_castRingHom, star_intCast] theorem quadratic_unit_value_eq_of_same_ray {ι κ : Type*} [Fintype ι] [Fintype κ] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (q : κ → O) (hq : ∀ i, q i ≠ 0) [∀ i, (Ideal.span {q i}).IsMaximal] (hcopq : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {q i}))) (hgq : ∀ i, lambda ∉ Ideal.span {q i}) (hcharq : ∀ i, ringChar (O ⧸ Ideal.span {q i}) ≠ 2) (hray : residue (∏ i, p i) = residue (∏ i, q i)) (u : Oˣ) : finiteSexticRow (fun i => Ideal.span {p i}) hg (fun _ => 3) u.val = finiteSexticRow (fun i => Ideal.span {q i}) hgq (fun _ => 3) u.val := by have hne : quadraticRayValue (residue (∏ i, p i)) ≠ 0 := by rw [← canonicalProductGauss_three_eq_rayValue p hp hcop hg hchar] exact norm_ne_zero_iff.mp (by rw [norm_canonicalProductGauss p hp hcop hg hchar (fun _ => 3) (fun _ => by decide) (fun _ => by decide)]; norm_num) apply mul_right_cancel₀ hne rw [quadratic_unit_phase p hp hcop hg hchar, hray, quadratic_unit_phase q hq hcopq hgq hcharq, residue_mul, residue_mul, hray] theorem quadratic_pair_unit_invariant {ι κ : Type*} [Fintype ι] [Fintype κ] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (q : κ → O) (hq : ∀ i, q i ≠ 0) [∀ i, (Ideal.span {q i}).IsMaximal] (hcopq : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {q i}))) (hgq : ∀ i, lambda ∉ Ideal.span {q i}) (hcharq : ∀ i, ringChar (O ⧸ Ideal.span {q i}) ≠ 2) (hray : residue (∏ i, p i) = residue (∏ i, q i)) (u : Oˣ) (z : O) : finiteSexticRow (fun i => Ideal.span {p i}) hg (fun _ => 3) (u.val * z) * finiteSexticRow (fun i => Ideal.span {q i}) hgq (fun _ => 3) (u.val * z) = finiteSexticRow (fun i => Ideal.span {p i}) hg (fun _ => 3) z * finiteSexticRow (fun i => Ideal.span {q i}) hgq (fun _ => 3) z := by have hu := quadratic_unit_value_eq_of_same_ray p hp hcop hg hchar q hq hcopq hgq hcharq hray u have hs := finiteSexticRow_unit_mul_star (fun i => Ideal.span {q i}) hgq (fun _ => 3) u rw [finiteSexticRow_three_star] at hs rw [finiteSexticRow_mul, finiteSexticRow_mul, hu] calc _ = (finiteSexticRow (fun i => Ideal.span {q i}) hgq (fun _ => 3) u.val * finiteSexticRow (fun i => Ideal.span {q i}) hgq (fun _ => 3) u.val) * (finiteSexticRow (fun i => Ideal.span {p i}) hg (fun _ => 3) z * finiteSexticRow (fun i => Ideal.span {q i}) hgq (fun _ => 3) z) := by ring _ = _ := by rw [hs, one_mul] end QuadraticUnitInvariance end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.IdealQuotients namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ConcretePrimeRowBridge ActualEisensteinCubic CompletedGauss ConcreteTraceCRT theorem primaryGenerator_admissible (I : Ideal O) (hI : Admissible I) : primaryGenerator I ≠ 0 := PrimaryIdealUnitReindex.primaryGenerator_ne_zero_of_good_factors I hI.1 (fun P hP => (hI.2.2 P hP).1) theorem primaryGenerator_inj_on_admissible {I J : Ideal O} (hI : Admissible I) (hJ : Admissible J) (heq : primaryGenerator I = primaryGenerator J) : I = J := by calc I = Ideal.span {primaryGenerator I} := (primaryGenerator_spec I (primaryGenerator_admissible I hI)).1.symm _ = Ideal.span {primaryGenerator J} := by rw [heq] _ = J := (primaryGenerator_spec J (primaryGenerator_admissible J hJ)).1 theorem sieveNorm_initial (M N : ℝ) (hM : 1 ≤ M) (hN : 1 ≤ N) : sieveNorm M N ≤ QuadraticInitialBound.initialSieveConstant * (M + (⌈N⌉₊ : ℝ) ^ 2) := by let F := idealRange N let R := (idealRange M).image primaryGenerator have hF : ∀ I ∈ F, Admissible I := fun I hI => (mem_idealRange.mp hI).1 have hFp : ∀ I ∈ F, I ≠ ⊥ := fun I hI => (hF I hI).1 have hFg : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P := fun I hI P hP => (hF I hI).2.2 P hP |>.1 have hchar : ∀ i : primePool F, ringChar (O ⧸ i.val) ≠ 2 := by intro i obtain ⟨I, hI, hP⟩ := mem_primePool_iff.mp i.property exact (hF I hI).2.2 i.val hP |>.2 have hnat : 1 ≤ ⌈N⌉₊ := Nat.one_le_ceil_iff.mpr (by linarith) have hnorm : ∀ I ∈ F, Ideal.absNorm I ≤ ⌈N⌉₊ := by intro I hI exact Nat.cast_le.mp ((mem_idealRange.mp hI).2.trans (Nat.le_ceil N)) have hR : ∀ z ∈ R, ‖eisEmbedding z‖ ^ 2 ≤ M := by intro z hz obtain ⟨I, hI, rfl⟩ := Finset.mem_image.mp hz rw [primaryGenerator_norm_sq I (primaryGenerator_admissible I (mem_idealRange.mp hI).1)] exact (mem_idealRange.mp hI).2 have hgen : Set.InjOn primaryGenerator (idealRange M) := by intro I hI J hJ heq exact primaryGenerator_inj_on_admissible (mem_idealRange.mp hI).1 (mem_idealRange.mp hJ).1 heq apply FiniteSieveOperator.squared_norm_le_of_energy (matrix M N) · have hc := (QuadraticInitialBound.initialSieveConstant_pos).le positivity intro a let aext (I : Ideal O) : ℂ := if h : I ∈ F then a ⟨I, h⟩ else 0 have hinner (z : O) : (∑ I ∈ F, aext I * (idealSexticRow F hFp hFg I z) ^ 3) = ∑ J : F, quadraticRow J.val z * a J := by rw [← Finset.sum_coe_sort] apply Finset.sum_congr rfl intro J _ rw [quadraticRow_eq F hF J.val J.property z] simp only [aext, dif_pos J.property] change a J * (idealSexticRow F hFp hFg J.val z) ^ 3 = (idealSexticRow F hFp hFg J.val z) ^ 3 * a J exact mul_comm _ _ have he := QuadraticInitialBound.ideal_initial_quadratic_sieve F hFp hFg (fun I hI => (hF I hI).2.1) hchar ⌈N⌉₊ hnat hnorm aext M hM R hR have heR : (∑ z ∈ R, ‖∑ I ∈ F, aext I * (idealSexticRow F hFp hFg I z) ^ 3‖ ^ 2) = ∑ I : idealRange M, ‖∑ J : F, quadraticRow J.val (primaryGenerator I.val) * a J‖ ^ 2 := by dsimp only [R] rw [Finset.sum_image (fun I hI J hJ heq => hgen hI hJ heq)] simp_rw [hinner] exact (Finset.sum_coe_sort _ _).symm have hea : (∑ I ∈ F, ‖aext I‖ ^ 2) = ∑ J : F, ‖a J‖ ^ 2 := by rw [← Finset.sum_coe_sort] apply Finset.sum_congr rfl intro J _ simp only [aext, dif_pos J.property] rfl rw [heR, hea] at he exact he end open ActualEisensteinCubic CompletedGauss def idealQuotient (D I : Ideal O) : Ideal O := if h : D ∣ I then h.choose else 0 theorem idealQuotient_mul {D I : Ideal O} (h : D ∣ I) : D * idealQuotient D I = I := by rw [idealQuotient, dif_pos h] exact h.choose_spec.symm theorem idealQuotient_dvd {D I : Ideal O} (h : D ∣ I) : idealQuotient D I ∣ I := by refine ⟨D, ?_⟩ rw [mul_comm, idealQuotient_mul h] theorem idealQuotient_injective_on (D : Ideal O) : Set.InjOn (idealQuotient D) {I | D ∣ I} := by intro I hI J hJ heq calc I = D * idealQuotient D I := (idealQuotient_mul hI).symm _ = D * idealQuotient D J := by rw [heq] _ = J := idealQuotient_mul hJ theorem admissible_of_dvd {I J : Ideal O} (hI : Admissible I) (hJI : J ∣ I) : Admissible J := by have hJ : J ≠ 0 := ne_zero_of_dvd_ne_zero hI.1 hJI refine ⟨hJ, hI.2.1.squarefree_of_dvd hJI, ?_⟩ intro P hP have hfac := (UniqueFactorizationMonoid.dvd_iff_normalizedFactors_le_normalizedFactors hJ hI.1).mp hJI exact hI.2.2 P (Multiset.mem_of_le hfac hP) theorem admissible_idealQuotient {D I : Ideal O} (hI : Admissible I) (hD : D ∣ I) : Admissible (idealQuotient D I) := admissible_of_dvd hI (idealQuotient_dvd hD) theorem idealQuotient_norm_le {D I : Ideal O} (hD0 : D ≠ 0) (hD : D ∣ I) (N : ℝ) (hN : (Ideal.absNorm I : ℝ) ≤ N) : (Ideal.absNorm (idealQuotient D I) : ℝ) ≤ N / (Ideal.absNorm D : ℝ) := by have hp : (0 : ℝ) < Ideal.absNorm D := by exact_mod_cast Nat.pos_of_ne_zero (fun h => hD0 (Ideal.absNorm_eq_zero_iff.mp h)) apply (le_div_iff₀ hp).mpr calc _ = (Ideal.absNorm (D * idealQuotient D I) : ℝ) := by rw [map_mul, Nat.cast_mul, mul_comm] _ = (Ideal.absNorm I : ℝ) := by rw [idealQuotient_mul hD] _ ≤ N := hN theorem quotient_family_squared_norm_le {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (D : Ideal O) (hD : D ≠ 0) (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (hdiv : ∀ j, D ∣ cols j) (M N : ℝ) (hrows : ∀ i, Admissible (rows i) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ M) (hcols : ∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) : ‖FiniteSieveOperator.operator (fun i j => quadraticRow (idealQuotient D (cols j)) (primaryGenerator (rows i)))‖ ^ 2 ≤ sieveNorm M (N / (Ideal.absNorm D : ℝ)) := by apply family_squared_norm_le rows (fun j => idealQuotient D (cols j)) hr · intro j k heq exact hc (idealQuotient_injective_on D (hdiv j) (hdiv k) heq) · exact hrows · intro j exact ⟨admissible_idealQuotient (hcols j).1 (hdiv j), idealQuotient_norm_le hD (hdiv j) N (hcols j).2⟩ def quotientMatrix {m n : Type*} (D : Ideal O) (rows : m → Ideal O) (cols : n → Ideal O) : Matrix m n ℂ := fun i j => if D ∣ cols j then quadraticRow (idealQuotient D (cols j)) (primaryGenerator (rows i)) else 0 theorem quotientMatrix_squared_norm_le {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (D : Ideal O) (hD : D ≠ 0) (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (M N : ℝ) (hrows : ∀ i, Admissible (rows i) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ M) (hcols : ∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) : ‖FiniteSieveOperator.operator (quotientMatrix D rows cols)‖ ^ 2 ≤ sieveNorm M (N / (Ideal.absNorm D : ℝ)) := by let S : Finset n := Finset.univ.filter (fun j => D ∣ cols j) let A : Matrix m S ℂ := fun i j => quadraticRow (idealQuotient D (cols j.val)) (primaryGenerator (rows i)) have hnorm : ‖FiniteSieveOperator.operator A‖ ^ 2 ≤ sieveNorm M (N / (Ideal.absNorm D : ℝ)) := by apply quotient_family_squared_norm_le D hD rows (fun j : S => cols j.val) hr (hc.comp Subtype.val_injective) · intro j exact (Finset.mem_filter.mp j.property).2 · exact hrows · intro j exact hcols j.val apply FiniteSieveOperator.squared_norm_le_of_energy _ _ (sieveNorm_nonneg _ _) intro a have hinner (i : m) : (∑ j, quotientMatrix D rows cols i j * a j) = ∑ j : S, A i j * a j.val := by change (∑ j, (if D ∣ cols j then quadraticRow (idealQuotient D (cols j)) (primaryGenerator (rows i)) else 0) * a j) = ∑ j : S, quadraticRow (idealQuotient D (cols j.val)) (primaryGenerator (rows i)) * a j.val rw [Finset.sum_coe_sort S (fun j : n => quadraticRow (idealQuotient D (cols j)) (primaryGenerator (rows i)) * a j)] simp only [S, Finset.sum_filter, ite_mul, zero_mul] simp_rw [hinner] have henergy := FiniteSieveOperator.energy_bound A (fun j : S => a j.val) apply henergy.trans calc _ ≤ sieveNorm M (N / (Ideal.absNorm D : ℝ)) * ∑ j : S, ‖a j.val‖ ^ 2 := mul_le_mul_of_nonneg_right hnorm (by positivity) _ ≤ _ := by apply mul_le_mul_of_nonneg_left _ (sieveNorm_nonneg _ _) rw [Finset.sum_coe_sort S (fun j : n => ‖a j‖ ^ 2)] exact Finset.sum_le_univ_sum_of_nonneg (fun j => sq_nonneg ‖a j‖) end CanonicalQuadraticSieve section open MeasureTheory open scoped FourierTransform SchwartzMap ContDiff namespace FourierBridge def fourierSeminormBound (k : ℕ) (C : ℝ) : ℝ := (2 : ℝ) ^ k * (k + 1) * (2 ^ (volume : Measure ℝ).integrablePower * ∫ t : ℝ, (1 + ‖t‖) ^ (-(volume : Measure ℝ).integrablePower : ℝ)) * C def fourierPointBound (k : ℕ) (C : ℝ) : ℝ := 2 ^ k * (fourierSeminormBound 0 C + fourierSeminormBound k C) theorem fourierPointBound_nonneg (k : ℕ) (C : ℝ) (hC : 0 ≤ C) : 0 ≤ fourierPointBound k C := by unfold fourierPointBound fourierSeminormBound; positivity theorem uniform_fourier_pointwise (g : 𝓢(ℝ, ℂ)) (k : ℕ) (S C : ℝ) (hS : 0 ≤ S) (hC : 0 ≤ C) (hsource : ∀ i ≤ k, S * ((SchwartzMap.seminorm ℝ 0 i) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower i) g) ≤ C) (t : ℝ) : S * (1 + ‖t‖) ^ k * ‖(𝓕 g) t‖ ≤ fourierPointBound k C := by have h0 : S * (SchwartzMap.seminorm ℝ 0 0) (𝓕 g) ≤ fourierSeminormBound 0 C := uniform_fourier_seminorm_transfer g 0 S C hS hC (fun i hi => hsource i (hi.trans (Nat.zero_le k))) have hk : S * (SchwartzMap.seminorm ℝ k 0) (𝓕 g) ≤ fourierSeminormBound k C := uniform_fourier_seminorm_transfer g k S C hS hC hsource have hpow : (1 + ‖t‖) ^ k ≤ (2 : ℝ) ^ k * (1 + ‖t‖ ^ k) := by have h := add_pow_le (show (0 : ℝ) ≤ 1 by norm_num) (norm_nonneg t) k have he : (2 : ℝ) ^ (k - 1) ≤ (2 : ℝ) ^ k := pow_le_pow_right₀ (by norm_num) (Nat.sub_le k 1) simp only [one_pow] at h exact h.trans (mul_le_mul_of_nonneg_right he (by positivity)) have hn0 := SchwartzMap.norm_le_seminorm ℝ (𝓕 g) t have hnk := SchwartzMap.norm_pow_mul_le_seminorm ℝ (𝓕 g) k t calc _ ≤ S * ((2 : ℝ) ^ k * (1 + ‖t‖ ^ k)) * ‖(𝓕 g) t‖ := by gcongr _ = (2 : ℝ) ^ k * (S * ‖(𝓕 g) t‖ + S * (‖t‖ ^ k * ‖(𝓕 g) t‖)) := by ring _ ≤ (2 : ℝ) ^ k * (S * (SchwartzMap.seminorm ℝ 0 0) (𝓕 g) + S * (SchwartzMap.seminorm ℝ k 0) (𝓕 g)) := by gcongr _ ≤ fourierPointBound k C := by exact mul_le_mul_of_nonneg_left (add_le_add h0 hk) (by positivity) end FourierBridge namespace LocalLogFourier theorem coupled_positive_log_separation_envelope {ι : Type*} [Fintype ι] (W : ι → ℝ → ℂ) (F : ℝ → ℂ) (a M : ι → ℝ) (hM : ∀ j, 0 ≤ M j) (hWwindow : ∀ j z, W j z ≠ 0 → |z| ≤ M j) (hFpos : ContDiffOn ℝ ∞ F (Set.Ioi 0)) (A J : ℕ) (CF : ℝ) (hCF : 0 ≤ CF) (hEuler : ∀ i ≤ J + (volume : Measure ℝ).integrablePower, ∀ x : ℝ, 0 < x → (1 + x) ^ A * ‖eulerDeriv F i x‖ ≤ CF) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), (∀ y : ι → ℝ, (∏ j : ι, W j (y j)) * F (R * Real.exp (∑ j : ι, a j * y j)) = ∫ t : ℝ, (∏ j : ι, W j (y j) * FourierBridge.logPhase t (a j * y j)) * b t) ∧ Integrable (fun t : ℝ => (1 + ‖t‖) ^ J * ‖b t‖) volume ∧ (1 + R) ^ A * (∫ t : ℝ, (1 + ‖t‖) ^ J * ‖b t‖) ≤ C ∧ (∀ t : ℝ, (1 + R) ^ A * (1 + ‖t‖) ^ J * ‖b t‖ ≤ C) := by classical let T : ℝ := ∑ j : ι, |a j| * M j have hT : 0 ≤ T := by dsimp [T] apply Finset.sum_nonneg intro j hj exact mul_nonneg (abs_nonneg _) (hM j) let K : ℕ := J + (volume : Measure ℝ).integrablePower let Lwin : ℝ := T + 1 let m : ℝ := Real.exp (-Lwin) have hL : 0 ≤ Lwin := by dsimp [Lwin]; linarith have hm : 0 < m := Real.exp_pos _ have hm1 : m ≤ 1 := by dsimp [m] simpa using (Real.exp_le_exp.mpr (show -Lwin ≤ 0 by linarith)) obtain ⟨V, CW, hVc, hVs, hVone, hCW, hVderiv, hwindow⟩ := FourierBridge.exists_complex_smooth_cutoff_with_derivative_bounds T K hT let P : ℝ := momentConstant K Lwin CW CF let B : ℝ := (2 : ℝ) ^ J * (FourierBridge.coefficientMomentBound 0 P + FourierBridge.coefficientMomentBound J P) let Bpoint : ℝ := FourierBridge.fourierPointBound J P let C : ℝ := (B + Bpoint) / m ^ A have hP : 0 ≤ P := momentConstant_nonneg K Lwin CW CF hL hCW hCF have hB : 0 ≤ B := by dsimp [B] exact mul_nonneg (by positivity) (add_nonneg (FourierBridge.coefficientMomentBound_nonneg 0 P hP) (FourierBridge.coefficientMomentBound_nonneg J P hP)) have hBpoint : 0 ≤ Bpoint := FourierBridge.fourierPointBound_nonneg J P hP have hC : 0 ≤ C := by dsimp [C]; positivity refine ⟨C, hC, ?_⟩ intro R hR let b : 𝓢(ℝ, ℂ) := 𝓕 (positiveLogProfile V F R hVc hVs hFpos hR) refine ⟨b, ?_, ?_, ?_, ?_⟩ · intro y have hactive : (∏ j : ι, W j (y j)) ≠ 0 → V (∑ j : ι, a j * y j) = 1 := FourierBridge.coupled_cutoff_active W V a y M hWwindow (by simpa [T] using hVone) simpa [b] using coupled_positive_log_separation W F V R a y hVc hVs hFpos hR hactive · exact AnalyticBridge.schwartz_fourier_one_plus_integrable (positiveLogProfile V F R hVc hVs hFpos hR) J · have hwindow' : ∀ s, (∃ i ≤ K, ‖iteratedFDeriv ℝ i V s‖ ≠ 0) → m ≤ Real.exp s ∧ |s| ≤ Lwin := by intro s hs exact ⟨(hwindow s hs).1, (hwindow s hs).2.2⟩ have hbound := positive_log_fourier_bound V F R m Lwin CW CF A J hVc hVs hFpos hR hm hm1 hL hCW hCF (by simpa [K] using hVderiv) (by simpa only [K] using hwindow') (by simpa [K] using hEuler) have hb : (1 + R) ^ A * (∫ t : ℝ, (1 + ‖t‖) ^ J * ‖b t‖) ≤ B / m ^ A := by simpa [B, P, b, K, Lwin, m] using hbound exact hb.trans (div_le_div_of_nonneg_right (le_add_of_nonneg_right hBpoint) (by positivity)) · intro t let g := positiveLogProfile V F R hVc hVs hFpos hR have hwindow' : ∀ s, (∃ i ≤ K, ‖iteratedFDeriv ℝ i V s‖ ≠ 0) → m ≤ Real.exp s ∧ |s| ≤ Lwin := by intro s hs exact ⟨(hwindow s hs).1, (hwindow s hs).2.2⟩ have hsource (n : ℕ) (hn : n ≤ J) : (m ^ A * (1 + R) ^ A) * ((SchwartzMap.seminorm ℝ 0 n) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower n) g) ≤ P := by apply positive_log_source_pair V F R m Lwin CW CF P A K n hVc hVs hFpos hR hm hm1 hL hCW hCF · dsimp [K]; omega · exact hVderiv · exact hwindow' · exact hEuler · intro i hi exact momentConstant_dominates K i Lwin CW CF hL hCW hCF hi have hpoint := FourierBridge.uniform_fourier_pointwise g J (m ^ A * (1 + R) ^ A) P (by positivity) hP hsource t have hb : (1 + R) ^ A * (1 + ‖t‖) ^ J * ‖b t‖ ≤ Bpoint / m ^ A := by apply (le_div_iff₀ (pow_pos hm A)).mpr simpa only [g, b, Bpoint, mul_assoc, mul_left_comm, mul_comm] using hpoint exact hb.trans (div_le_div_of_nonneg_right (le_add_of_nonneg_left hB) (by positivity)) end LocalLogFourier namespace EisensteinSchwartzPoisson theorem paperRadialFourier_log_separation_envelope {ι : Type*} [Fintype ι] (W : 𝓢(ℝ, ℂ)) (V : ι → ℝ → ℂ) (a M : ι → ℝ) (hM : ∀ j, 0 ≤ M j) (hVwindow : ∀ j z, V j z ≠ 0 → |z| ≤ M j) (A J : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), (∀ y : ι → ℝ, (∏ j : ι, V j (y j)) * paperRadialFourier W (R * Real.exp (∑ j : ι, a j * y j)) = ∫ t : ℝ, (∏ j : ι, V j (y j) * FourierBridge.logPhase t (a j * y j)) * b t) ∧ Integrable (fun t : ℝ => (1 + ‖t‖) ^ J * ‖b t‖) volume ∧ (1 + R) ^ A * (∫ t : ℝ, (1 + ‖t‖) ^ J * ‖b t‖) ≤ C ∧ (∀ t : ℝ, (1 + R) ^ A * (1 + ‖t‖) ^ J * ‖b t‖ ≤ C) := by obtain ⟨CF, hCF, hEuler⟩ := paperRadialFourier_euler_bound W A (J + (MeasureTheory.volume : MeasureTheory.Measure ℝ).integrablePower) exact LocalLogFourier.coupled_positive_log_separation_envelope V (paperRadialFourier W) a M hM hVwindow (paperRadialFourier_contDiffOn W) A J CF hCF hEuler end EisensteinSchwartzPoisson end open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory namespace FirstPassCubeLabels open ActualEisensteinCubic open FirstCauchyArithmetic (supportMobius supportRay supportIdealFamily supportIdealFamily_pos supportIdealFamily_good recoveredSupport) open ConcretePrimeRowBridge (conjugateIdealRowSum) open RayFourExpansion (RayCharacter crossCoeff) open ConcreteTraceCRT (eisEmbedding) def rayIdealRow {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C : Finset ι → ℂ) (negative : Bool) (χ : RayCharacter) (D : Finset ι) (h : O) : ℂ := let P := fun i => Ideal.span {p i} conjugateIdealRowSum (supportIdealFamily P (F \ D)) (supportIdealFamily_pos P (F \ D)) (supportIdealFamily_good P hg (F \ D)) (fun I => (if negative then star (supportRay p χ (recoveredSupport P (F \ D) I)) else supportRay p χ (recoveredSupport P (F \ D) I)) * C (D ∪ recoveredSupport P (F \ D) I)) h def rayPairWeight {ι : Type*} (p : ι → O) (r : RayCharacter × RayCharacter) (D : Finset ι) (h : O) : ℂ := crossCoeff r.1 r.2 * (supportMobius (fun i => Ideal.span {p i}) D * rowCoprimeMask (fun i => Ideal.span {p i}) D h * supportRay p r.1 D * supportRay p r.2 D) def rayIdealEnergy {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C : Finset ι → ℂ) (negative : Bool) (h : O) : ℝ := letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype ∑ r : RayCharacter × RayCharacter, ∑ D ∈ F.powerset, ‖rayPairWeight p r D h‖ * ‖rayIdealRow p hg F C negative (if negative then r.1 else r.2) D h‖ ^ 2 theorem rayIdealEnergy_nonneg {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C : Finset ι → ℂ) (negative : Bool) (h : O) : 0 ≤ rayIdealEnergy p hg F C negative h := by unfold rayIdealEnergy positivity theorem idealPairReindex_eq_ray_rows {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C₁ C₂ : Finset ι → ℂ) (h : O) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype idealPairReindex p hg F C₁ C₂ h = ∑ r : RayCharacter × RayCharacter, ∑ D ∈ F.powerset, rayPairWeight p r D h * rayIdealRow p hg F C₂ false r.2 D h * star (rayIdealRow p hg F C₁ true r.1 D h) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype simp only [idealPairReindex, rayPairWeight, rayIdealRow, Bool.false_eq_true, ite_false, ite_true, Finset.mul_sum] apply Finset.sum_congr rfl intro r hr exact Finset.sum_congr rfl (fun D hD => by ring) theorem idealPairReindex_norm_le {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C₁ C₂ : Finset ι → ℂ) (h : O) : ‖idealPairReindex p hg F C₁ C₂ h‖ ≤ Real.sqrt (rayIdealEnergy p hg F C₁ true h) * Real.sqrt (rayIdealEnergy p hg F C₂ false h) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype rw [idealPairReindex_eq_ray_rows] have hc := DescentWeightedCauchy.weighted_cauchy ((Finset.univ : Finset (RayCharacter × RayCharacter)) ×ˢ F.powerset) (fun z => rayPairWeight p z.1 z.2 h) (fun z => rayIdealRow p hg F C₂ false z.1.2 z.2 h) (fun z => rayIdealRow p hg F C₁ true z.1.1 z.2 h) simp only [Finset.sum_product] at hc change ‖∑ r : RayCharacter × RayCharacter, ∑ D ∈ F.powerset, rayPairWeight p r D h * rayIdealRow p hg F C₂ false r.2 D h * star (rayIdealRow p hg F C₁ true r.1 D h)‖ ≤ Real.sqrt (rayIdealEnergy p hg F C₂ false h) * Real.sqrt (rayIdealEnergy p hg F C₁ true h) at hc exact hc.trans_eq (mul_comm _ _) theorem norm_rayPairWeight {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (r : RayCharacter × RayCharacter) (D : Finset ι) (h : O) : ‖rayPairWeight p r D h‖ = ‖crossCoeff r.1 r.2‖ * ‖rowCoprimeMask (fun i => Ideal.span {p i}) D h‖ := by letI importedWitness0 := @OAI.RayFourExpansion.rayRingFintype have hmu : ‖supportMobius (fun i => Ideal.span {p i}) D‖ = 1 := by have hh := FirstCauchyArithmetic.supportMobius_sq (fun i => Ideal.span {p i}) (fun i => Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance) hinj D have hh' := congrArg norm hh simp only [norm_mul, norm_one] at hh' nlinarith [norm_nonneg (supportMobius (fun i => Ideal.span {p i}) D)] have hr (χ : RayCharacter) : ‖supportRay p χ D‖ = 1 := by obtain ⟨u, hu⟩ := RayFourExpansion.prime_product_unit_mod_four p hc D change ‖χ (Ideal.Quotient.mk (Ideal.span {(4 : O)}) (∏ i ∈ D, p i))‖ = 1 rw [← hu] exact FiniteRayExpansion.norm_char_unit χ u simp only [rayPairWeight, norm_mul, hmu, hr, one_mul, mul_one] def cubeLogCoefficient {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (t : ℝ) (d : O) : Finset ι → ℂ := if negative then cubeMinusCoefficient p hp hcop hg B v ε₁ ε₂ (logTwistMinus C V y t) d else cubePlusCoefficient p hp hcop hg B v ε₁ ε₂ (logTwistPlus C V y t) d theorem cubeLogCoefficient_continuous {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (d : O) (S : Finset ι) : Continuous (fun t : ℝ => cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t d S) := by cases negative <;> simp only [cubeLogCoefficient, Bool.false_eq_true, ite_false, ite_true, cubeMinusCoefficient, cubePlusCoefficient, FirstCauchyArithmetic.firstPassColumnMinus, FirstCauchyArithmetic.firstPassColumnPlus, logTwistMinus, logTwistPlus] all_goals have hp := FourierBridge.logPhase_continuous_left (-(y S)) fun_prop theorem norm_cubeLogCoefficient_eq_zero {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (t : ℝ) (d : O) (S : Finset ι) : ‖cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t d S‖ = ‖cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y 0 d S‖ := by cases negative <;> simp only [cubeLogCoefficient, Bool.false_eq_true, ite_false, ite_true, cubeMinusCoefficient, cubePlusCoefficient, FirstCauchyArithmetic.firstPassColumnMinus, FirstCauchyArithmetic.firstPassColumnPlus, logTwistMinus, logTwistPlus, norm_mul, norm_star, FourierBridge.logPhase_norm] private theorem rayIdealRow_continuous {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C : ℝ → Finset ι → ℂ) (hC : ∀ S, Continuous (fun t => C t S)) (negative : Bool) (χ : RayCharacter) (D : Finset ι) (h : O) : Continuous (fun t => rayIdealRow p hg F (C t) negative χ D h) := by simp only [rayIdealRow, ConcretePrimeRowBridge.conjugateIdealRowSum, ConcretePrimeRowBridge.mobiusIdealColumn] fun_prop private theorem rayIdealRow_uniform_bound {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C : ℝ → Finset ι → ℂ) (hC : ∀ t S, ‖C t S‖ = ‖C 0 S‖) (negative : Bool) (χ : RayCharacter) (D : Finset ι) (h : O) : ∃ M : ℝ, 0 ≤ M ∧ ∀ t, ‖rayIdealRow p hg F (C t) negative χ D h‖ ≤ M := by let P := fun i => Ideal.span {p i} let s := supportIdealFamily P (F \ D) let T := fun (t : ℝ) (I : Ideal O) => ConcretePrimeRowBridge.mobiusIdealColumn (fun I => (if negative then star (supportRay p χ (recoveredSupport P (F \ D) I)) else supportRay p χ (recoveredSupport P (F \ D) I)) * C t (D ∪ recoveredSupport P (F \ D) I)) I * star (ConcretePrimeRowBridge.idealSexticRow s (supportIdealFamily_pos P (F \ D)) (supportIdealFamily_good P hg (F \ D)) I h) refine ⟨∑ I ∈ s, ‖T 0 I‖, Finset.sum_nonneg (fun _ _ => norm_nonneg _), ?_⟩ intro t change ‖∑ I ∈ s, T t I‖ ≤ _ apply (norm_sum_le s (T t)).trans_eq apply Finset.sum_congr rfl intro I hI simp only [T, ConcretePrimeRowBridge.mobiusIdealColumn, norm_mul, hC] private theorem rayIdealEnergy_continuous {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C : ℝ → Finset ι → ℂ) (hC : ∀ S, Continuous (fun t => C t S)) (negative : Bool) (h : O) : Continuous (fun t => rayIdealEnergy p hg F (C t) negative h) := by unfold rayIdealEnergy apply continuous_finsetSum _ intro r hr apply continuous_finsetSum _ intro D hD exact continuous_const.mul ((rayIdealRow_continuous p hg F C hC negative _ D h).norm.pow 2) private theorem rayIdealEnergy_uniform_bound {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C : ℝ → Finset ι → ℂ) (hC : ∀ t S, ‖C t S‖ = ‖C 0 S‖) (negative : Bool) (h : O) : ∃ M : ℝ, 0 ≤ M ∧ ∀ t, rayIdealEnergy p hg F (C t) negative h ≤ M := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype choose M hM hbound using fun (r : RayCharacter × RayCharacter) (D : Finset ι) => rayIdealRow_uniform_bound p hg F C hC negative (if negative then r.1 else r.2) D h refine ⟨∑ r : RayCharacter × RayCharacter, ∑ D ∈ F.powerset, ‖rayPairWeight p r D h‖ * (M r D)^2, by positivity, ?_⟩ intro t apply Finset.sum_le_sum intro r hr apply Finset.sum_le_sum intro D hD exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) (hbound r D t) 2) (norm_nonneg _) private theorem integrable_rayIdealEnergy {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C : ℝ → Finset ι → ℂ) (hc : ∀ S, Continuous (fun t => C t S)) (hn : ∀ t S, ‖C t S‖ = ‖C 0 S‖) (negative : Bool) (h : O) (b : 𝓢(ℝ, ℂ)) : Integrable (fun t : ℝ => ‖b t‖ * rayIdealEnergy p hg F (C t) negative h) volume := by obtain ⟨M, hM, hb⟩ := rayIdealEnergy_uniform_bound p hg F C hn negative h apply b.integrable.norm.mul_bdd (c := M) · exact (rayIdealEnergy_continuous p hg F C hc negative h).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun t => by rw [Real.norm_of_nonneg (rayIdealEnergy_nonneg p hg F (C t) negative h)] exact hb t) theorem cube_integral_norm_le_energy {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (C₁ C₂ : ℝ → Finset ι → ℂ) (hc₁ : ∀ S, Continuous (fun t => C₁ t S)) (hc₂ : ∀ S, Continuous (fun t => C₂ t S)) (hn₁ : ∀ t S, ‖C₁ t S‖ = ‖C₁ 0 S‖) (hn₂ : ∀ t S, ‖C₂ t S‖ = ‖C₂ 0 S‖) (h : O) (b : 𝓢(ℝ, ℂ)) (a : ℂ) : ‖∫ t : ℝ, b t * a * idealPairReindex p hg F (C₁ t) (C₂ t) h‖ ≤ Real.sqrt (∫ t : ℝ, ‖b t‖ * ‖a‖ * rayIdealEnergy p hg F (C₁ t) true h) * Real.sqrt (∫ t : ℝ, ‖b t‖ * ‖a‖ * rayIdealEnergy p hg F (C₂ t) false h) := by let E₁ := fun t => rayIdealEnergy p hg F (C₁ t) true h let E₂ := fun t => rayIdealEnergy p hg F (C₂ t) false h let w := fun t : ℝ => ‖b t‖ * ‖a‖ have hE₁ : ∀ t, 0 ≤ E₁ t := fun t => rayIdealEnergy_nonneg p hg F (C₁ t) true h have hE₂ : ∀ t, 0 ≤ E₂ t := fun t => rayIdealEnergy_nonneg p hg F (C₂ t) false h have hw : ∀ t, 0 ≤ w t := fun t => mul_nonneg (norm_nonneg _) (norm_nonneg _) have i₁ : Integrable (fun t => w t * E₁ t) volume := by convert (integrable_rayIdealEnergy p hg F C₁ hc₁ hn₁ true h b).mul_const ‖a‖ using 1 funext t dsimp only [w, E₁] ring have i₂ : Integrable (fun t => w t * E₂ t) volume := by convert (integrable_rayIdealEnergy p hg F C₂ hc₂ hn₂ false h b).mul_const ‖a‖ using 1 funext t dsimp only [w, E₂] ring let f := fun t => Real.sqrt (w t * E₁ t) let g := fun t => Real.sqrt (w t * E₂ t) have hf : Continuous f := Real.continuous_sqrt.comp (((b.continuous.norm.mul_const ‖a‖).mul (rayIdealEnergy_continuous p hg F C₁ hc₁ true h))) have hg' : Continuous g := Real.continuous_sqrt.comp (((b.continuous.norm.mul_const ‖a‖).mul (rayIdealEnergy_continuous p hg F C₂ hc₂ false h))) have hfsq (t : ℝ) : f t ^ 2 = w t * E₁ t := Real.sq_sqrt (mul_nonneg (hw t) (hE₁ t)) have hgsq (t : ℝ) : g t ^ 2 = w t * E₂ t := Real.sq_sqrt (mul_nonneg (hw t) (hE₂ t)) have mf : MemLp f 2 volume := (memLp_two_iff_integrable_sq hf.aestronglyMeasurable).mpr (by simpa only [hfsq] using i₁) have mg : MemLp g 2 volume := (memLp_two_iff_integrable_sq hg'.aestronglyMeasurable).mpr (by simpa only [hgsq] using i₂) have hfg (t : ℝ) : f t * g t = w t * (Real.sqrt (E₁ t) * Real.sqrt (E₂ t)) := by dsimp only [f, g] rw [Real.sqrt_mul (hw t), Real.sqrt_mul (hw t)] calc _ = (Real.sqrt (w t))^2 * (Real.sqrt (E₁ t) * Real.sqrt (E₂ t)) := by ring _ = _ := by rw [Real.sq_sqrt (hw t)] have hnorm : ‖∫ t : ℝ, b t * a * idealPairReindex p hg F (C₁ t) (C₂ t) h‖ ≤ ∫ t : ℝ, f t * g t := by apply norm_integral_le_of_norm_le (mf.integrable_mul mg) exact Filter.Eventually.of_forall (fun t => by simp only [Pi.mul_apply] rw [hfg, norm_mul, norm_mul] exact mul_le_mul_of_nonneg_left (idealPairReindex_norm_le p hg F (C₁ t) (C₂ t) h) (hw t)) have hh := integral_mul_le_Lp_mul_Lq_of_nonneg Real.HolderConjugate.two_two (Filter.Eventually.of_forall (fun t => Real.sqrt_nonneg (w t * E₁ t))) (Filter.Eventually.of_forall (fun t => Real.sqrt_nonneg (w t * E₂ t))) (show MemLp f (ENNReal.ofReal (2 : ℝ)) volume by simpa using mf) (show MemLp g (ENNReal.ofReal (2 : ℝ)) volume by simpa using mg) have hfinal : (∫ t : ℝ, f t * g t) ≤ Real.sqrt (∫ t : ℝ, w t * E₁ t) * Real.sqrt (∫ t : ℝ, w t * E₂ t) := by simp only [Real.rpow_two, ← Real.sqrt_eq_rpow] at hh change (∫ t : ℝ, f t * g t) ≤ Real.sqrt (∫ t : ℝ, f t ^ 2) * Real.sqrt (∫ t : ℝ, g t ^ 2) at hh simpa only [hfsq, hgsq] using hh exact hnorm.trans hfinal end FirstPassCubeLabels end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.DivisorBlocks namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open IdealCoprimeSieveOperator DivisorBlockCauchy IdealDivisorBilinearBlocks def quotientBlock {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (D E : Ideal O) : ℝ := blockValue left right (fun D => quotientMatrix D rows left) (fun E => quotientMatrix E rows right) a b D E theorem canonical_divisor_block_bound {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ M N : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hN : 1 ≤ N) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ M) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) : (∑ D ∈ S, ∑ E ∈ T, quotientBlock rows left right a b D E) ^ 2 ≤ 256 ^ 2 * D₁ * D₂ * sieveNorm M (N / D₁) * sieveNorm M (N / D₂) * (supportConstant ε hε * divisorConstant ε hε) ^ 2 * (N ^ ε) ^ 4 * (∑ j, ‖a j‖ ^ 2) * (∑ k, ‖b k‖ ^ 2) := by have hS0 (D) (hD : D ∈ S) : D ≠ 0 := by intro hz have hh := (hS D hD).1 simp only [hz, map_zero, Nat.cast_zero] at hh linarith have hT0 (E) (hE : E ∈ T) : E ≠ 0 := by intro hz have hh := (hT E hE).1 simp only [hz, map_zero, Nat.cast_zero] at hh linarith have hA (D) (hD : D ∈ S) : ‖FiniteSieveOperator.operator (quotientMatrix D rows left)‖ ^ 2 ≤ sieveNorm M (N / D₁) := by apply (quotientMatrix_squared_norm_le D (hS0 D hD) rows left hr hl M N hrows hleft).trans exact sieveNorm_mono le_rfl (div_le_div_of_nonneg_left (by linarith) (by linarith) (hS D hD).1) have hB (E) (hE : E ∈ T) : ‖FiniteSieveOperator.operator (quotientMatrix E rows right)‖ ^ 2 ≤ sieveNorm M (N / D₂) := by apply (quotientMatrix_squared_norm_le E (hT0 E hE) rows right hr hri M N hrows hright).trans exact sieveNorm_mono le_rfl (div_le_div_of_nonneg_left (by linarith) (by linarith) (hT E hE).1) have hsCard := DescentFiberCost.finite_ideal_count_real S (2 * D₁) (by linarith) hS0 (fun D hD => (hS D hD).2) have htCard := DescentFiberCost.finite_ideal_count_real T (2 * D₂) (by linarith) hT0 (fun E hE => (hT E hE).2) have hh := divisor_block_bound ε hε S T left right (fun j => (hleft j).1.1) (fun k => (hright k).1.1) N N (by linarith) (by linarith) (fun j => (hleft j).2) (fun k => (hright k).2) (fun D => quotientMatrix D rows left) (fun E => quotientMatrix E rows right) a b (sieveNorm M (N / D₁)) (sieveNorm M (N / D₂)) (sieveNorm_nonneg _ _) (sieveNorm_nonneg _ _) hA hB have hs := (supportConstant_pos ε hε).le have hd := (divisorConstant_pos ε hε).le have hb1 := sieveNorm_nonneg M (N / D₁) have hb2 := sieveNorm_nonneg M (N / D₂) change (∑ D ∈ S, ∑ E ∈ T, quotientBlock rows left right a b D E) ^ 2 ≤ _ at hh apply hh.trans calc _ ≤ (128 * (2 * D₁)) * (128 * (2 * D₂)) * (sieveNorm M (N / D₁) * sieveNorm M (N / D₂) * (supportConstant ε hε * N ^ ε) * (supportConstant ε hε * N ^ ε)) * ((divisorConstant ε hε * N ^ ε) * ∑ j, ‖a j‖ ^ 2) * ((divisorConstant ε hε * N ^ ε) * ∑ k, ‖b k‖ ^ 2) := by gcongr _ = _ := by ring end section open ConcretePrimeRowBridge ActualEisensteinCubic theorem quadraticRow_norm_le_one (I : Ideal O) (z : O) : ‖quadraticRow I z‖ ≤ 1 := by by_cases hI : Admissible I · rw [quadraticRow, dif_pos hI] exact QuadraticMainOperatorBound.ideal_quadraticRow_norm_le_one {I} (singletonPositive I hI) (singletonGood I hI) I z · simp [quadraticRow, hI] theorem quadraticRow_mul (I J : Ideal O) (hIJ : Admissible (I * J)) (z : O) : quadraticRow (I * J) z = quadraticRow I z * quadraticRow J z := by have hI : Admissible I := admissible_of_dvd hIJ (dvd_mul_right I J) have hJ : Admissible J := admissible_of_dvd hIJ (dvd_mul_left J I) let F : Finset (Ideal O) := {I, J, I * J} have hF : ∀ K ∈ F, Admissible K := by intro K hK simp only [F, Finset.mem_insert, Finset.mem_singleton] at hK rcases hK with rfl | rfl | rfl · exact hI · exact hJ · exact hIJ have hIF : I ∈ F := by simp [F] have hJF : J ∈ F := by simp [F] have hIJF : I * J ∈ F := by simp [F] have hu : idealSupport F (I * J) = idealSupport F I ∪ idealSupport F J := by ext P simp only [mem_idealSupport_iff, UniqueFactorizationMonoid.normalizedFactors_mul hI.1 hJ.1, Multiset.mem_add, Finset.mem_union] have hd : Disjoint (idealSupport F I) (idealSupport F J) := by apply Finset.disjoint_left.mpr intro P hPI hPJ have hpI := (mem_idealSupport_iff F I P).mp hPI have hpJ := (mem_idealSupport_iff F J P).mp hPJ have hp := UniqueFactorizationMonoid.prime_of_normalized_factor P.val hpI have hi : P.val ∣ I := UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors hpI have hj : P.val ∣ J := UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors hpJ exact hp.not_isUnit ((IsRelPrime.of_squarefree_mul hIJ.2.1) hi hj) rw [quadraticRow_eq F hF (I * J) hIJF z, quadraticRow_eq F hF I hIF z, quadraticRow_eq F hF J hJF z] unfold idealSexticRow finiteSquarefreeRow rw [hu, Finset.prod_union hd, mul_pow] theorem quadraticRow_divisor_factor (I D : Ideal O) (hI : Admissible I) (hD : D ∣ I) (z : O) : quadraticRow I z = quadraticRow D z * quadraticRow (idealQuotient D I) z := by have h := quadraticRow_mul D (idealQuotient D I) (by rwa [idealQuotient_mul hD]) z simpa only [idealQuotient_mul hD] using h end open IdealDivisorBilinearBlocks CompletedGauss IdealCoprimeSieveOperator DivisorBlockCauchy def originalBlock {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (D E : Ideal O) : ℝ := blockValue left right (fun _ i j => quadraticRow (left j) (primaryGenerator (rows i))) (fun _ i k => quadraticRow (right k) (primaryGenerator (rows i))) a b D E theorem original_entry_factor {m n : Type*} (rows : m → Ideal O) (cols : n → Ideal O) (hcols : ∀ j, Admissible (cols j)) (a : n → ℂ) (D : Ideal O) (i : m) (j : n) : quadraticRow (cols j) (primaryGenerator (rows i)) * (if D ∣ cols j then a j else 0) = quadraticRow D (primaryGenerator (rows i)) * (quotientMatrix D rows cols i j * (if D ∣ cols j then a j else 0)) := by by_cases h : D ∣ cols j · simp only [h, ite_true, quotientMatrix] rw [quadraticRow_divisor_factor (cols j) D (hcols j) h] ring · simp [h, quotientMatrix] theorem originalBlock_le_quotientBlock {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hleft : ∀ j, Admissible (left j)) (hright : ∀ k, Admissible (right k)) (a : n → ℂ) (b : p → ℂ) (D E : Ideal O) : originalBlock rows left right a b D E ≤ quotientBlock rows left right a b D E := by change (∑ i, _) ≤ ∑ i, _ apply Finset.sum_le_sum intro i _ have heq : (∑ j, ∑ k, if IsCoprime (left j) (right k) then star (quadraticRow (left j) (primaryGenerator (rows i)) * (if D ∣ left j then a j else 0)) * (quadraticRow (right k) (primaryGenerator (rows i)) * (if E ∣ right k then b k else 0)) else 0) = (star (quadraticRow D (primaryGenerator (rows i))) * quadraticRow E (primaryGenerator (rows i))) * (∑ j, ∑ k, if IsCoprime (left j) (right k) then star (quotientMatrix D rows left i j * (if D ∣ left j then a j else 0)) * (quotientMatrix E rows right i k * (if E ∣ right k then b k else 0)) else 0) := by simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ by_cases h : IsCoprime (left j) (right k) · rw [if_pos h, if_pos h] rw [original_entry_factor rows left hleft a D i j, original_entry_factor rows right hright b E i k, star_mul] ring · simp only [if_neg h, mul_zero] change ‖∑ j, ∑ k, if IsCoprime (left j) (right k) then star (quadraticRow (left j) (primaryGenerator (rows i)) * (if D ∣ left j then a j else 0)) * (quadraticRow (right k) (primaryGenerator (rows i)) * (if E ∣ right k then b k else 0)) else 0‖ ≤ _ rw [heq, norm_mul] apply mul_le_of_le_one_left (norm_nonneg _) rw [norm_mul, norm_star] exact (mul_le_mul (quadraticRow_norm_le_one D _) (quadraticRow_norm_le_one E _) (norm_nonneg _) (by norm_num)).trans_eq (by norm_num) theorem original_rectangular_bound {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hleft : ∀ j, Admissible (left j)) (hright : ∀ k, Admissible (right k)) (a : n → ℂ) (b : p → ℂ) : (∑ D ∈ S, ∑ E ∈ T, originalBlock rows left right a b D E) ^ 2 ≤ (∑ D ∈ S, ∑ E ∈ T, quotientBlock rows left right a b D E) ^ 2 := by apply pow_le_pow_left₀ · exact Finset.sum_nonneg (fun D _ => Finset.sum_nonneg (fun E _ => blockValue_nonneg left right _ _ a b D E)) · apply Finset.sum_le_sum intro D hD exact Finset.sum_le_sum (fun E hE => originalBlock_le_quotientBlock rows left right hleft hright a b D E) theorem canonical_original_divisor_block_bound {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ M N : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hN : 1 ≤ N) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ M) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) : (∑ D ∈ S, ∑ E ∈ T, originalBlock rows left right a b D E) ^ 2 ≤ 256 ^ 2 * D₁ * D₂ * sieveNorm M (N / D₁) * sieveNorm M (N / D₂) * (supportConstant ε hε * divisorConstant ε hε) ^ 2 * (N ^ ε) ^ 4 * (∑ j, ‖a j‖ ^ 2) * (∑ k, ‖b k‖ ^ 2) := by exact (original_rectangular_bound S T rows left right (fun j => (hleft j).1) (fun k => (hright k).1) a b).trans (canonical_divisor_block_bound ε hε S T D₁ D₂ M N hD₁ hD₂ hN hS hT rows left right hr hl hri hrows hleft hright a b) end CanonicalQuadraticSieve namespace FiniteSieveRestriction open FiniteSieveOperator end FiniteSieveRestriction namespace CanonicalQuadraticSieve open ActualEisensteinCubic ConcretePrimeRowBridge CompletedGauss open QuadraticSquarefreeKernel FiniteSieveOperator def Supported (I : Ideal O) : Prop := I ≠ 0 ∧ ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, lambda ∉ P ∧ ringChar (O ⧸ P) ≠ 2 def fullRange (M : ℝ) : Finset (Ideal O) := (idealsUpTo ⌊M⌋₊).filter Supported theorem mem_fullRange {M : ℝ} {I : Ideal O} : I ∈ fullRange M ↔ Supported I ∧ (Ideal.absNorm I : ℝ) ≤ M := by rw [fullRange, Finset.mem_filter, mem_idealsUpTo] constructor · rintro ⟨⟨hp, hN⟩, ha⟩ refine ⟨ha, ?_⟩ have hM : 0 ≤ M := by by_contra hn have hz : ⌊M⌋₊ = 0 := Nat.floor_eq_zero.mpr (by linarith) omega exact (Nat.cast_le.mpr hN).trans (Nat.floor_le hM) · rintro ⟨ha, hN⟩ exact ⟨⟨Nat.one_le_iff_ne_zero.mpr (fun h => ha.1 (Ideal.absNorm_eq_zero_iff.mp h)), Nat.le_floor hN⟩, ha⟩ theorem admissible_supported {I : Ideal O} (hI : Admissible I) : Supported I := ⟨hI.1, hI.2.2⟩ def highKernelRange (M K : ℝ) : Finset (Ideal O) := (fullRange M).filter (fun I => K < (Ideal.absNorm (squarefreePart I) : ℝ)) theorem mem_highKernelRange {M K : ℝ} {I : Ideal O} : I ∈ highKernelRange M K ↔ Supported I ∧ (Ideal.absNorm I : ℝ) ≤ M ∧ K < (Ideal.absNorm (squarefreePart I) : ℝ) := by simp only [highKernelRange, Finset.mem_filter, mem_fullRange, and_assoc] def highKernelMatrix (M N K : ℝ) : Matrix (highKernelRange M K) (idealRange N) ℂ := fun I J => quadraticRow J.val (primaryGenerator I.val) def highKernelNorm (M N K : ℝ) : ℝ := ‖operator (highKernelMatrix M N K)‖ ^ 2 theorem highKernelNorm_nonneg (M N K : ℝ) : 0 ≤ highKernelNorm M N K := sq_nonneg _ end CanonicalQuadraticSieve open MeasureTheory open scoped BigOperators Classical SchwartzMap namespace QuadraticKernelTransfer open FourierBridge EisensteinSchwartzPoisson theorem sum_norm_integral_bound {ι : Type*} [Fintype ι] (b : ℝ → ℂ) (φ : ι → ℝ → ℂ) (H : ℝ) (hint : ∀ i, Integrable (fun t => b t * φ i t)) (hb : Integrable (fun t => ‖b t‖)) (hφ : ∀ t, (∑ i, ‖φ i t‖) ≤ H) : (∑ i, ‖∫ t, b t * φ i t‖) ≤ H * ∫ t, ‖b t‖ := by calc _ ≤ ∑ i, ∫ t, ‖b t * φ i t‖ := Finset.sum_le_sum (fun i _ => norm_integral_le_integral_norm _) _ = ∫ t, ∑ i, ‖b t * φ i t‖ := (integral_finsetSum _ (fun i _ => (hint i).norm)).symm _ ≤ ∫ t, H * ‖b t‖ := by apply integral_mono_of_nonneg (Filter.Eventually.of_forall (fun t => by positivity)) (hb.const_mul H) filter_upwards [] with t simp only [norm_mul, ← Finset.mul_sum] calc _ ≤ ‖b t‖ * H := mul_le_mul_of_nonneg_left (hφ t) (norm_nonneg _) _ = _ := mul_comm _ _ _ = _ := integral_const_mul _ _ theorem radial_two_variable_window (W : 𝓢(ℝ, ℂ)) (L₁ L₂ : ℝ) (hL₁ : 0 ≤ L₁) (hL₂ : 0 ≤ L₂) (A : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), (∀ x y : ℝ, |x| ≤ L₁ → |y| ≤ L₂ → paperRadialFourier W (R * Real.exp (x+y)) = ∫ t, logPhase t x * logPhase t y * b t) ∧ (1 + R) ^ A * (∫ t, ‖b t‖) ≤ C := by let V₁ : ℝ → ℂ := fun x => if |x| ≤ L₁ then 1 else 0 let V₂ : ℝ → ℂ := fun x => if |x| ≤ L₂ then 1 else 0 let V : Bool → ℝ → ℂ := fun j => if j then V₂ else V₁ let lengthScale : Bool → ℝ := fun j => if j then L₂ else L₁ have hL : ∀ j, 0 ≤ lengthScale j := by intro j; cases j <;> assumption have hV : ∀ j x, V j x ≠ 0 → |x| ≤ lengthScale j := by intro j x h cases j · change |x| ≤ L₁ change (if |x| ≤ L₁ then (1 : ℂ) else 0) ≠ 0 at h by_contra hx exact h (by simp [hx]) · change |x| ≤ L₂ change (if |x| ≤ L₂ then (1 : ℂ) else 0) ≠ 0 at h by_contra hx exact h (by simp [hx]) obtain ⟨C, hC, hs⟩ := paperRadialFourier_log_separation_envelope W V (fun _ => 1) lengthScale hL hV A 0 refine ⟨C, hC, ?_⟩ intro R hR obtain ⟨b, hb, _, hmass, _⟩ := hs R hR refine ⟨b, ?_, ?_⟩ · intro x y hx hy have h := hb (fun j => if j then y else x) simpa only [V, V₁, V₂, lengthScale, Fintype.prod_bool, Fintype.sum_bool, Bool.false_eq_true, ↓reduceIte, if_pos hx, if_pos hy, one_mul, mul_one, add_comm, mul_comm, mul_left_comm, mul_assoc] using h · simpa only [pow_zero, one_mul] using hmass theorem radial_phase_integrable (b : 𝓢(ℝ, ℂ)) (c : ℂ) (x y : ℝ) : Integrable (fun t => b t * (logPhase t x * (c * logPhase t y))) := by apply (b.integrable.norm.mul_const ‖c‖).mono' · have hx := logPhase_continuous_left x have hy := logPhase_continuous_left y exact (by fun_prop : Continuous (fun t => b t * (logPhase t x * (c * logPhase t y)))).aestronglyMeasurable · filter_upwards [] with t simp only [norm_mul, logPhase_norm, one_mul, mul_one] exact le_rfl theorem radial_matrix_kernel_transfer (W : 𝓢(ℝ, ℂ)) (L₁ L₂ : ℝ) (hL₁ : 0 ≤ L₁) (hL₂ : 0 ≤ L₂) (A : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∀ {m n : Type*} [Fintype m] [Fintype n] (c : m → n → ℂ) (x : m → ℝ) (y : n → ℝ) (H : ℝ), 0 ≤ H → (∀ i, |x i| ≤ L₁) → (∀ j, |y j| ≤ L₂) → (∀ t, (∑ i, ‖∑ j, c i j * logPhase t (y j)‖) ≤ H) → (1 + R) ^ A * (∑ i, ‖∑ j, c i j * paperRadialFourier W (R * Real.exp (x i + y j))‖) ≤ C * H := by obtain ⟨C, hC, hs⟩ := radial_two_variable_window W L₁ L₂ hL₁ hL₂ A refine ⟨C, hC, ?_⟩ intro R hR m n _ _ c x y H hH hx hy hphase obtain ⟨b, hb, hmass⟩ := hs R hR let φ : m → ℝ → ℂ := fun i t => logPhase t (x i) * ∑ j, c i j * logPhase t (y j) have hint (i : m) : Integrable (fun t => b t * φ i t) := by have h := integrable_finsetSum (Finset.univ : Finset n) (fun j _ => radial_phase_integrable b (c i j) (x i) (y j)) simpa only [φ, Finset.mul_sum] using h have hid (i : m) : (∑ j, c i j * paperRadialFourier W (R * Real.exp (x i + y j))) = ∫ t, b t * φ i t := by rw [show (fun t => b t * φ i t) = fun t => ∑ j, b t * (logPhase t (x i) * (c i j * logPhase t (y j))) by funext t; simp only [φ, Finset.mul_sum]] rw [integral_finsetSum _ (fun j _ => radial_phase_integrable b (c i j) (x i) (y j))] apply Finset.sum_congr rfl intro j _ rw [hb _ _ (hx i) (hy j), ← integral_const_mul] congr 1 funext t ring have hp (t : ℝ) : (∑ i, ‖φ i t‖) ≤ H := by simpa only [φ, norm_mul, logPhase_norm, one_mul] using hphase t have hi := sum_norm_integral_bound b φ H hint b.integrable.norm hp simp only [← hid] at hi calc _ ≤ (1 + R) ^ A * (H * ∫ t, ‖b t‖) := mul_le_mul_of_nonneg_left hi (by positivity) _ = H * ((1 + R) ^ A * ∫ t, ‖b t‖) := by ring _ ≤ H * C := mul_le_mul_of_nonneg_left hmass hH _ = _ := mul_comm _ _ end QuadraticKernelTransfer namespace CanonicalQuadraticSieve open FourierBridge EisensteinSchwartzPoisson QuadraticKernelTransfer open IdealCoprimeSieveOperator DivisorBlockCauchy IdealDivisorBilinearBlocks section variable {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def quotientTerm (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (D E : Ideal O) (i : m) (j : n) (k : p) : ℂ := if IsCoprime (left j) (right k) then star (quotientMatrix D rows left i j * (if D ∣ left j then a j else 0)) * (quotientMatrix E rows right i k * (if E ∣ right k then b k else 0)) else 0 def divisorBlockCost (ε : ℝ) (hε : 0 < ε) (D₁ D₂ M N : ℝ) (a : n → ℂ) (b : p → ℂ) : ℝ := 256 ^ 2 * D₁ * D₂ * sieveNorm M (N / D₁) * sieveNorm M (N / D₂) * (supportConstant ε hε * divisorConstant ε hε) ^ 2 * (N ^ ε) ^ 4 * (∑ j, ‖a j‖ ^ 2) * (∑ k, ‖b k‖ ^ 2) end end CanonicalQuadraticSieve open MeasureTheory open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve open FourierBridge EisensteinSchwartzPoisson QuadraticKernelTransfer open IdealCoprimeSieveOperator DivisorBlockCauchy IdealDivisorBilinearBlocks section variable {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def originalTerm (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (D E : Ideal O) (i : m) (j : n) (k : p) : ℂ := if IsCoprime (left j) (right k) then star (quadraticRow (left j) (CompletedGauss.primaryGenerator (rows i)) * (if D ∣ left j then a j else 0)) * (quadraticRow (right k) (CompletedGauss.primaryGenerator (rows i)) * (if E ∣ right k then b k else 0)) else 0 omit [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalTerm_phase (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (D E : Ideal O) (i : m) (j : n) (k : p) (y : n → ℝ) (z : p → ℝ) (t : ℝ) : originalTerm rows left right (fun j => a j * star (logPhase t (y j))) (fun k => b k * logPhase t (z k)) D E i j k = originalTerm rows left right a b D E i j k * logPhase t (y j + z k) := by unfold originalTerm rw [logPhase_add] by_cases hc : IsCoprime (left j) (right k) <;> by_cases hD : D ∣ left j <;> by_cases hE : E ∣ right k <;> simp only [hc, hD, hE, ↓reduceIte, mul_zero, zero_mul, star_zero, star_mul, star_star] ; ring theorem canonical_original_divisor_block_phase_bound (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ M N : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hN : 1 ≤ N) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ M) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (y : n → ℝ) (z : p → ℝ) (t : ℝ) : (∑ D ∈ S, ∑ E ∈ T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k * logPhase t (y j + z k)‖) ≤ Real.sqrt (divisorBlockCost ε hε D₁ D₂ M N a b) := by have hb := canonical_original_divisor_block_bound ε hε S T D₁ D₂ M N hD₁ hD₂ hN hS hT rows left right hr hl hri hrows hleft hright (fun j => a j * star (logPhase t (y j))) (fun k => b k * logPhase t (z k)) simp only [norm_mul, norm_star, logPhase_norm, mul_one] at hb change (∑ D ∈ S, ∑ E ∈ T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right (fun j => a j * star (logPhase t (y j))) (fun k => b k * logPhase t (z k)) D E i j k‖) ^ 2 ≤ divisorBlockCost ε hε D₁ D₂ M N a b at hb simp only [originalTerm_phase] at hb have hcost : 0 ≤ divisorBlockCost ε hε D₁ D₂ M N a b := (sq_nonneg _).trans hb have hs := Real.sq_sqrt hcost have hp := Real.sqrt_nonneg (divisorBlockCost ε hε D₁ D₂ M N a b) have hsum : 0 ≤ ∑ D ∈ S, ∑ E ∈ T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k * logPhase t (y j + z k)‖ := by positivity nlinarith end theorem canonical_original_radial_divisor_block_bound (W : 𝓢(ℝ, ℂ)) (L₁ L₂ L₃ : ℝ) (hL₁ : 0 ≤ L₁) (hL₂ : 0 ≤ L₂) (hL₃ : 0 ≤ L₃) (A : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∀ {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ M N : ℝ) (_hD₁ : 1 ≤ D₁) (_hD₂ : 1 ≤ D₂) (_hN : 1 ≤ N) (_hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (_hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (_hr : Function.Injective rows) (_hl : Function.Injective left) (_hri : Function.Injective right) (_hrows : ∀ i, Admissible (rows i) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ M) (_hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (_hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (x : S → T → m → ℝ) (y : n → ℝ) (z : p → ℝ), (∀ D E i, |x D E i| ≤ L₁) → (∀ j, |y j| ≤ L₂) → (∀ k, |z k| ≤ L₃) → (1 + R) ^ A * (∑ D : S, ∑ E : T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D.val E.val i j k * paperRadialFourier W (R * Real.exp (x D E i + (y j + z k)))‖) ≤ C * Real.sqrt (divisorBlockCost ε hε D₁ D₂ M N a b) := by obtain ⟨C, hC, hker⟩ := radial_matrix_kernel_transfer W L₁ (L₂ + L₃) hL₁ (add_nonneg hL₂ hL₃) A refine ⟨C, hC, ?_⟩ intro R hR m n p _ _ _ _ _ _ ε hε S T D₁ D₂ M N hD₁ hD₂ hN hS hT rows left right hr hl hri hrows hleft hright a b x y z hx hy hz let c : (S × T × m) → (n × p) → ℂ := fun i j => originalTerm rows left right a b i.1.val i.2.1.val i.2.2 j.1 j.2 have hp (t : ℝ) : (∑ i : S × T × m, ‖∑ j : n × p, c i j * logPhase t (y j.1 + z j.2)‖) ≤ Real.sqrt (divisorBlockCost ε hε D₁ D₂ M N a b) := by have hb := canonical_original_divisor_block_phase_bound ε hε S T D₁ D₂ M N hD₁ hD₂ hN hS hT rows left right hr hl hri hrows hleft hright a b y z t simp only [c, Fintype.sum_prod_type] let v : Ideal O → Ideal O → ℝ := fun D E => ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k * logPhase t (y j + z k)‖ change (∑ D : S, ∑ E : T, v D.val E.val) ≤ _ rw [Finset.sum_coe_sort S (fun D => ∑ E : T, v D E.val)] have he (D : Ideal O) := Finset.sum_coe_sort T (v D) simp_rw [he] exact hb have hb := hker R hR c (fun i => x i.1 i.2.1 i.2.2) (fun j => y j.1 + z j.2) (Real.sqrt (divisorBlockCost ε hε D₁ D₂ M N a b)) (Real.sqrt_nonneg _) (fun i => hx i.1 i.2.1 i.2.2) (fun j => (abs_add_le _ _).trans (add_le_add (hy j.1) (hz j.2))) hp simpa only [c, Fintype.sum_prod_type] using hb end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Reciprocity.CubicJacobi namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace CubicJacobiGlobal abbrev O := ActualEisensteinCubic.O abbrev K := ActualEisensteinCubic.K open ActualEisensteinCubic CompletedGauss def primeValue (P : Ideal O) (x : O) : O := if h : P.IsMaximal ∧ lambda ∉ P then letI : P.IsMaximal := h.1 cubicChar P h.2 (Ideal.Quotient.mk P x) else 0 theorem primeValue_eq (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (x : O) : primeValue P x = cubicChar P hgood (Ideal.Quotient.mk P x) := by simp only [primeValue, dite_eq_left (show P.IsMaximal ∧ lambda ∉ P from ⟨inferInstance, hgood⟩)] def idealSymbol (I : Ideal O) (x : O) : O := if I = 0 then 0 else ((UniqueFactorizationMonoid.normalizedFactors I).map (fun P => primeValue P x)).prod theorem idealSymbol_zero (x : O) : idealSymbol 0 x = 0 := by simp [idealSymbol] theorem idealSymbol_bot (x : O) : idealSymbol ⊥ x = 0 := idealSymbol_zero x theorem idealSymbol_one (x : O) : idealSymbol 1 x = 1 := by rw [idealSymbol, ite_eq_right one_ne_zero, UniqueFactorizationMonoid.normalizedFactors_one] rfl theorem idealSymbol_top (x : O) : idealSymbol ⊤ x = 1 := by simpa only [Ideal.one_eq_top] using idealSymbol_one x theorem idealSymbol_mul (I J : Ideal O) (x : O) : idealSymbol (I * J) x = idealSymbol I x * idealSymbol J x := by classical by_cases hI : I = 0 · simp [hI, idealSymbol_bot] by_cases hJ : J = 0 · simp [hJ, idealSymbol_bot] simp only [idealSymbol, ite_eq_right hI, ite_eq_right hJ, ite_eq_right (mul_ne_zero hI hJ), UniqueFactorizationMonoid.normalizedFactors_mul hI hJ, Multiset.map_add, Multiset.prod_add] def symbol (x y : O) : O := idealSymbol (Ideal.span {y}) x theorem symbol_one (x : O) : symbol x 1 = 1 := by simp [symbol, idealSymbol_top] theorem symbol_mul_denominator (x y z : O) : symbol x (y * z) = symbol x y * symbol x z := by rw [symbol, ← Ideal.span_singleton_mul_span_singleton, idealSymbol_mul] rfl theorem idealSymbol_prime (P : Ideal O) [P.IsMaximal] (hgood : lambda ∉ P) (x : O) : idealSymbol P x = cubicChar P hgood (Ideal.Quotient.mk P x) := by have hP0 : P ≠ 0 := NeZero.ne _ have hp : Prime P := Ideal.prime_of_isPrime hP0 (inferInstance : P.IsPrime) rw [idealSymbol, ite_eq_right hP0, UniqueFactorizationMonoid.normalizedFactors_irreducible hp.irreducible] simpa using primeValue_eq P hgood x private theorem factor_good (I : Ideal O) (hI : primaryGenerator I ≠ 0) (P : Ideal O) (hP : P ∈ UniqueFactorizationMonoid.normalizedFactors I) : P.IsMaximal ∧ lambda ∉ P := by exact ⟨(primaryPrime_spec P (primaryPrime_factor_ne_zero I P hI hP)).1, (primaryPrime_spec P (primaryPrime_factor_ne_zero I P hI hP)).2.1⟩ theorem idealSymbol_map_mul (I : Ideal O) (hI : primaryGenerator I ≠ 0) (x y : O) : idealSymbol I (x * y) = idealSymbol I x * idealSymbol I y := by have hI0 := primaryGenerator_ne_zero_ideal I hI simp only [idealSymbol, ite_eq_right hI0] rw [← Multiset.prod_map_mul] apply congrArg Multiset.prod apply Multiset.map_congr rfl intro P hP have hg := factor_good I hI P hP let : P.IsMaximal := hg.1 simp only [primeValue_eq P hg.2, map_mul] theorem idealSymbol_map_one (I : Ideal O) (hI : primaryGenerator I ≠ 0) : idealSymbol I 1 = 1 := by have hI0 := primaryGenerator_ne_zero_ideal I hI rw [idealSymbol, ite_eq_right hI0] apply Multiset.prod_eq_one intro y hy obtain ⟨P, hP, rfl⟩ := Multiset.mem_map.mp hy have hg := factor_good I hI P hP let : P.IsMaximal := hg.1 simp only [primeValue_eq P hg.2, map_one] theorem idealSymbol_map_multiset_prod (I : Ideal O) (hI : primaryGenerator I ≠ 0) (s : Multiset O) : idealSymbol I s.prod = (s.map (idealSymbol I)).prod := by induction s using Multiset.induction_on with | empty => simp [idealSymbol_map_one I hI] | @cons a s ih => simp [idealSymbol_map_mul I hI, ih] theorem symbol_prime (p : O) (hp : Prime p) (hprimary : lambda ^ 2 ∣ p - 1) (x : O) : symbol x p = primeValue (Ideal.span {p}) x := by letI := OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let : (Ideal.span {p} : Ideal O).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible have hg : lambda ∉ (Ideal.span {p} : Ideal O) := primary_maximal_divisor_good p hprimary _ (Ideal.subset_span (by simp)) rw [symbol, idealSymbol_prime _ hg, primeValue_eq _ hg] theorem idealSymbol_reciprocity (I J : Ideal O) (hI : primaryGenerator I ≠ 0) (hJ : primaryGenerator J ≠ 0) : idealSymbol I (primaryGenerator J) = idealSymbol J (primaryGenerator I) := by classical have hI0 := primaryGenerator_ne_zero_ideal I hI have hJ0 := primaryGenerator_ne_zero_ideal J hJ rw [primaryGenerator, ite_eq_right hJ0, idealSymbol_map_multiset_prod I hI, primaryGenerator, ite_eq_right hI0, idealSymbol_map_multiset_prod J hJ] simp only [Multiset.map_map, Function.comp_def, idealSymbol, ite_eq_right hI0, ite_eq_right hJ0] rw [Multiset.prod_map_prod_map] apply congrArg Multiset.prod apply Multiset.map_congr rfl intro P hP apply congrArg Multiset.prod apply Multiset.map_congr rfl intro Q hQ have hgP := factor_good I hI P hP have hgQ := factor_good J hJ Q hQ let : P.IsMaximal := hgP.1 let : Q.IsMaximal := hgQ.1 have hp := (primaryPrime_spec P (primaryPrime_factor_ne_zero I P hI hP)).2.2 have hq := (primaryPrime_spec Q (primaryPrime_factor_ne_zero J Q hJ hQ)).2.2 rw [primeValue_eq P hgP.2, primeValue_eq Q hgQ.2] exact cubic_reciprocity_primary P Q hgP.2 hgQ.2 (primaryPrime P) (primaryPrime Q) hp.1.symm hq.1.symm hp.2 hq.2 theorem symbol_reciprocity (a b : O) (ha : a ≠ 0) (hb : b ≠ 0) (hap : lambda ^ 2 ∣ a - 1) (hbp : lambda ^ 2 ∣ b - 1) : symbol a b = symbol b a := by have haG := primaryGenerator_span a ha hap have hbG := primaryGenerator_span b hb hbp have h := idealSymbol_reciprocity (Ideal.span {b}) (Ideal.span {a}) (by rwa [hbG]) (by rwa [haG]) simpa only [symbol, haG, hbG] using h theorem idealSymbol_congr (I : Ideal O) {x y : O} (hxy : x - y ∈ I) : idealSymbol I x = idealSymbol I y := by classical by_cases hI : I = 0 · simp only [hI, idealSymbol_zero] simp only [idealSymbol, ite_eq_right hI] apply congrArg Multiset.prod apply Multiset.map_congr rfl intro P hP have hle := ((Ideal.mem_normalizedFactors_iff hI).mp hP).2 by_cases hg : P.IsMaximal ∧ lambda ∉ P · let : P.IsMaximal := hg.1 rw [primeValue_eq P hg.2, primeValue_eq P hg.2, (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr (hle hxy)] · simp only [primeValue, dite_eq_right hg] theorem symbol_congr {x y d : O} (hxy : d ∣ x - y) : symbol x d = symbol y d := idealSymbol_congr _ (Ideal.mem_span_singleton.mpr hxy) end CubicJacobiGlobal namespace CubicRamified abbrev O := ActualEisensteinCubic.O abbrev K := ActualEisensteinCubic.K open ActualEisensteinCubic CubicJacobiGlobal CompletedGauss lemma lambda_def : lambda = omega - 1 := rfl theorem cubicValue_cube (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (x : O) (hx : x ∉ P) : (cubicChar P hg (Ideal.Quotient.mk P x)) ^ 3 = 1 := by let : Field (O ⧸ P) := quotientField P rw [← MulChar.pow_apply' _ (by decide : (3 : ℕ) ≠ 0), cubicChar_pow_three] exact MulChar.one_apply (isUnit_iff_ne_zero.mpr (Ideal.Quotient.eq_zero_iff_mem.not.mpr hx)) theorem cubicValue_ne_zero (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (x : O) (hx : x ∉ P) : cubicChar P hg (Ideal.Quotient.mk P x) ≠ 0 := by have h := cubicValue_cube P hg x hx intro hz rw [hz, zero_pow (by decide)] at h exact zero_ne_one h theorem ramified_comparison (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hgP : lambda ∉ P) (hgQ : lambda ∉ Q) (p q u r : O) (hP : P = Ideal.span {p}) (hQ : Q = Ideal.span {q}) (hp : lambda ^ 2 ∣ p - 1) (hq : lambda ^ 2 ∣ q - 1) (hqP : q ∉ P) (_hpQ : p ∉ Q) (hr0 : r ≠ 0) (hr : lambda ^ 2 ∣ r - 1) (hfactor : p - q = lambda ^ 2 * u * r) : (cubicChar P hgP (Ideal.Quotient.mk P lambda)) ^ 2 * cubicChar P hgP (Ideal.Quotient.mk P u) = (cubicChar Q hgQ (Ideal.Quotient.mk Q lambda)) ^ 2 * cubicChar Q hgQ (Ideal.Quotient.mk Q u) := by have hp0 : p ≠ 0 := by intro hz apply (NeZero.ne P) simp [hP, hz] have hq0 : q ≠ 0 := by intro hz apply (NeZero.ne Q) simp [hQ, hz] have hpP : p ∈ P := by rw [hP]; exact Ideal.subset_span (by simp) have hqQ : q ∈ Q := by rw [hQ]; exact Ideal.subset_span (by simp) have hrP : r ∉ P := by intro hrP have hd : p - q ∈ P := by rw [hfactor]; exact P.mul_mem_left _ hrP have hmem := P.sub_mem hpP hd exact hqP (by convert hmem using 1 ; ring) have hrr : cubicChar P hgP (Ideal.Quotient.mk P r) = cubicChar Q hgQ (Ideal.Quotient.mk Q r) := by have heq : symbol p r = symbol q r := symbol_congr (by rw [hfactor]; exact dvd_mul_left r _) have h := (symbol_reciprocity r p hr0 hp0 hr hp).trans (heq.trans (symbol_reciprocity q r hq0 hr0 hq hr)) simpa only [symbol, ← hP, ← hQ, idealSymbol_prime _ hgP, idealSymbol_prime _ hgQ] using h have heq : cubicChar P hgP (Ideal.Quotient.mk P (p - q)) = cubicChar Q hgQ (Ideal.Quotient.mk Q (p - q)) := by rw [map_sub, Ideal.Quotient.eq_zero_iff_mem.mpr hpP, zero_sub, neg_eq_neg_one_mul, map_mul, A3_cubicChar_neg_one P hgP, one_mul, map_sub, Ideal.Quotient.eq_zero_iff_mem.mpr hqQ, sub_zero] exact cubic_reciprocity_primary P Q hgP hgQ p q hP hQ hp hq simp only [hfactor, map_mul, map_pow] at heq rw [← hrr] at heq exact mul_right_cancel₀ (cubicValue_ne_zero P hgP r hrP) heq def sevenPrime : O := 1 + 3 * omega def sevenIdeal : Ideal O := Ideal.span {sevenPrime} theorem sevenPrime_norm : ShortDraftLatticeCount.qNat sevenPrime = 7 := by change ShortDraftLatticeCount.qNat (ActualEisensteinCoordinates.eval 1 3) = 7 unfold ShortDraftLatticeCount.qNat rw [ShortDraftLatticeCount.coords_eval] norm_num [ShortDraftLatticeCount.q] theorem sevenPrime_ne_zero : sevenPrime ≠ 0 := by intro hz change ActualEisensteinCoordinates.eval 1 3 = 0 at hz have hh : ActualEisensteinCoordinates.eval 1 3 = ActualEisensteinCoordinates.eval 0 0 := hz.trans (by simp [ActualEisensteinCoordinates.eval]) have h := (ActualEisensteinCoordinates.unique_coordinates hh).1 norm_num at h theorem sevenIdeal_norm : Ideal.absNorm sevenIdeal = 7 := by rw [sevenIdeal, ← qNat_eq_absNorm_span, sevenPrime_norm] theorem sevenIdeal_isMaximal : sevenIdeal.IsMaximal := by have hp : sevenIdeal.IsPrime := Ideal.isPrime_of_irreducible_absNorm (by rw [sevenIdeal_norm, Nat.irreducible_iff_nat_prime] decide) exact hp.isMaximal (Ideal.span_singleton_eq_bot.not.mpr sevenPrime_ne_zero) theorem sevenPrime_primary : lambda ^ 2 ∣ sevenPrime - 1 := by refine ⟨-1, ?_⟩ rw [lambda_def] dsimp [sevenPrime] linear_combination omega_sq_for_norm theorem sevenIdeal_good : lambda ∉ sevenIdeal := letI := @OAI.CubicRamified.sevenIdeal_isMaximal primary_maximal_divisor_good sevenPrime sevenPrime_primary sevenIdeal (Ideal.subset_span (by simp [])) theorem twoIdeal_card : Nat.card (O ⧸ cubicTwoIdeal) = 4 := by change Ideal.absNorm cubicTwoIdeal = 4 rw [cubicTwoIdeal, ← qNat_eq_absNorm_span] rw [show (-2 : O) = ActualEisensteinCoordinates.eval (-2) 0 by simp [ActualEisensteinCoordinates.eval]] unfold ShortDraftLatticeCount.qNat rw [ShortDraftLatticeCount.coords_eval] norm_num [ShortDraftLatticeCount.q] theorem sevenIdeal_card : Nat.card (O ⧸ sevenIdeal) = 7 := sevenIdeal_norm theorem cubicValue_lambda_two : letI := cubicTwoIdeal_isMaximal cubicChar cubicTwoIdeal cubicTwoIdeal_good (Ideal.Quotient.mk cubicTwoIdeal lambda) = omega ^ 2 := by letI := cubicTwoIdeal_isMaximal have heq : Ideal.Quotient.mk cubicTwoIdeal lambda = Ideal.Quotient.mk cubicTwoIdeal (omega ^ 2) := by apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr rw [cubicTwoIdeal, Ideal.mem_span_singleton] refine ⟨-omega, ?_⟩ rw [lambda_def] linear_combination -omega_sq_for_norm rw [heq, map_pow, map_pow, cubicChar_omega, twoIdeal_card] norm_num theorem cubicValue_lambda_seven : letI := @OAI.CubicRamified.sevenIdeal_isMaximal cubicChar sevenIdeal sevenIdeal_good (Ideal.Quotient.mk sevenIdeal lambda) = 1 := letI := @OAI.CubicRamified.sevenIdeal_isMaximal by apply cubic_roots_reduce_injective sevenIdeal sevenIdeal_good (cubicValue_cube sevenIdeal sevenIdeal_good lambda sevenIdeal_good) (by simp) rw [cubicChar_reduce, sevenIdeal_card] norm_num only [Nat.reduceSub, Nat.reduceDiv] rw [← map_pow] apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr rw [sevenIdeal, Ideal.mem_span_singleton] refine ⟨-1, ?_⟩ rw [lambda_def] dsimp [sevenPrime] linear_combination omega_sq_for_norm open ActualEisensteinCubic CubicJacobiGlobal CompletedGauss def primaryCoord (A B : ℤ) : O := ActualEisensteinCoordinates.eval (1 + 3 * A) (3 * B) theorem primaryCoord_eq (A B : ℤ) : primaryCoord A B = 1 + 3 * (A : O) + 3 * (B : O) * omega := by simp only [primaryCoord, ActualEisensteinCoordinates.eval] push_cast rfl theorem primaryCoord_primary (A B : ℤ) : lambda ^ 2 ∣ primaryCoord A B - 1 := by rw [primaryCoord_eq] apply lambda_sq_dvd_three.trans exact ⟨(A : O) + (B : O) * omega, by ring⟩ theorem primaryCoord_ne_zero (A B : ℤ) : primaryCoord A B ≠ 0 := by intro hz have hcoord : ActualEisensteinCoordinates.eval (1 + 3 * A) (3 * B) = ActualEisensteinCoordinates.eval 0 0 := by exact hz.trans (by simp [ActualEisensteinCoordinates.eval]) have h := (ActualEisensteinCoordinates.unique_coordinates hcoord).1 omega lemma primary_card_exponent (N : ℕ) (A B : ℤ) (hN : 1 < N) (hn : (N : ℤ) = 1 + 9*(A^2-A*B+B^2)+3*(2*A-B)) : ((N-1)/3)%3 = ((2*A-B)%3).toNat %3 := by have hsub : ((N-1 : ℕ) : ℤ) = (N : ℤ)-1 := by omega have hdiv : (((N-1)/3 : ℕ) : ℤ) = 3*(A^2-A*B+B^2)+(2*A-B) := by rw [Int.natCast_ediv, hsub] have hh : (N : ℤ)-1 = 3*(3*(A^2-A*B+B^2)+(2*A-B)) := by omega rw [hh] omega have hrem : (((2*A-B)%3).toNat : ℤ) = (2*A-B)%3 := Int.toNat_of_nonneg (Int.emod_nonneg _ (by norm_num)) omega theorem cubicValue_omega_primary (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (A B : ℤ) (hP : P = Ideal.span {primaryCoord A B}) : cubicChar P hg (Ideal.Quotient.mk P omega) = omega ^ ((2 * A - B) % 3).toNat := by have hn : (Nat.card (O ⧸ P) : ℤ) = (1 + 3 * A)^2 - (1 + 3 * A)*(3 * B) + (3 * B)^2 := by change (Ideal.absNorm P : ℤ) = _ rw [hP, ← qNat_eq_absNorm_span] unfold ShortDraftLatticeCount.qNat rw [Int.toNat_of_nonneg (ShortDraftLatticeCount.qO_nonneg _)] rw [primaryCoord, ShortDraftLatticeCount.coords_eval] rfl have hn' : (Nat.card (O ⧸ P) : ℤ) = 1 + 9*(A^2 - A*B + B^2) + 3*(2*A-B) := by nlinarith [hn] rw [cubicChar_omega] apply ((omega_primitive.isOfFinOrder (by decide)).pow_inj_mod).mpr rw [← omega_primitive.eq_orderOf] let : Fintype (O ⧸ P) := Fintype.ofFinite _ have hcard : 1 < Nat.card (O ⧸ P) := by rw [Nat.card_eq_fintype_card] exact Fintype.one_lt_card exact primary_card_exponent (Nat.card (O ⧸ P)) A B hcard hn' theorem ramified_comparison_of_factor (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hgP : lambda ∉ P) (hgQ : lambda ∉ Q) (p q u r : O) (hP : P = Ideal.span {p}) (hQ : Q = Ideal.span {q}) (hp : lambda ^ 2 ∣ p - 1) (hq : lambda ^ 2 ∣ q - 1) (hu : u ≠ 0) (hr0 : r ≠ 0) (hr : lambda ^ 2 ∣ r - 1) (hfactor : p - q = lambda ^ 2 * u * r) : (cubicChar P hgP (Ideal.Quotient.mk P lambda)) ^ 2 * cubicChar P hgP (Ideal.Quotient.mk P u) = (cubicChar Q hgQ (Ideal.Quotient.mk Q lambda)) ^ 2 * cubicChar Q hgQ (Ideal.Quotient.mk Q u) := by have hlam : lambda ≠ 0 := fun hz => hgP (hz ▸ P.zero_mem) have hne : P ≠ Q := by intro heq have hpq : p = q := primary_associated_eq p q (Ideal.span_singleton_eq_span_singleton.mp (hP.symm.trans (heq.trans hQ))) hp hq have hz : lambda ^ 2 * u * r = 0 := by rw [← hfactor, hpq, sub_self] exact mul_ne_zero (mul_ne_zero (pow_ne_zero 2 hlam) hu) hr0 hz exact ramified_comparison P Q hgP hgQ p q u r hP hQ hp hq (prime_generator_not_mem_of_ne P Q hne q hQ) (prime_generator_not_mem_of_ne Q P hne.symm p hP) hr0 hr hfactor open ActualEisensteinCubic CubicJacobiGlobal CompletedGauss lemma omega_isUnit : IsUnit omega := omega_primitive.isUnit (by decide) lemma omega_four : omega ^ 4 = omega := by calc _ = omega ^ 3 * omega := by ring _ = omega := by rw [omega_primitive.pow_eq_one, one_mul] lemma omega_five : omega ^ 5 = omega ^ 2 := by calc _ = omega ^ 3 * omega ^ 2 := by ring _ = _ := by rw [omega_primitive.pow_eq_one, one_mul] lemma cubicValue_neg (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (x : O) : cubicChar P hg (Ideal.Quotient.mk P (-x)) = cubicChar P hg (Ideal.Quotient.mk P x) := by rw [map_neg, neg_eq_neg_one_mul, map_mul, A3_cubicChar_neg_one, one_mul] lemma cubicValue_omega_two : letI := cubicTwoIdeal_isMaximal cubicChar cubicTwoIdeal cubicTwoIdeal_good (Ideal.Quotient.mk cubicTwoIdeal omega) = omega := by letI := cubicTwoIdeal_isMaximal rw [cubicChar_omega, twoIdeal_card] ; norm_num lemma cubicValue_omega_seven : letI := @OAI.CubicRamified.sevenIdeal_isMaximal cubicChar sevenIdeal sevenIdeal_good (Ideal.Quotient.mk sevenIdeal omega) = omega ^ 2 := letI := @OAI.CubicRamified.sevenIdeal_isMaximal by rw [cubicChar_omega, sevenIdeal_card] lemma eq_of_cube_one_of_sq_eq (z w : O) (hz : z ^ 3 = 1) (hw : w ^ 3 = 1) (hsq : z ^ 2 = w ^ 2) : z = w := by have hw0 : w ≠ 0 := by intro h; rw [h, zero_pow (by decide)] at hw; exact zero_ne_one hw apply mul_right_cancel₀ (pow_ne_zero 2 hw0) calc z * w ^ 2 = z ^ 3 := by rw [← hsq]; ring _ = 1 := hz _ = w * w ^ 2 := by rw [← hw]; ring lemma supplement_of_factor (P Q : Ideal O) [P.IsMaximal] [Q.IsMaximal] (hgP : lambda ∉ P) (hgQ : lambda ∉ Q) (p q u r : O) (hP : P = Ideal.span {p}) (hQ : Q = Ideal.span {q}) (hp : lambda ^ 2 ∣ p - 1) (hq : lambda ^ 2 ∣ q - 1) (hu : IsUnit u) (hr0 : r ≠ 0) (hr : lambda ^ 2 ∣ r - 1) (hfactor : p - q = lambda ^ 2 * u * r) (j : ℕ) (hscalar : (cubicChar Q hgQ (Ideal.Quotient.mk Q lambda)) ^ 2 * cubicChar Q hgQ (Ideal.Quotient.mk Q u) = (omega ^ j)^2 * cubicChar P hgP (Ideal.Quotient.mk P u)) : cubicChar P hgP (Ideal.Quotient.mk P lambda) = omega ^ j := by apply eq_of_cube_one_of_sq_eq · exact cubicValue_cube P hgP lambda hgP · rw [← pow_mul, Nat.mul_comm j, pow_mul, omega_primitive.pow_eq_one, one_pow] · apply mul_right_cancel₀ (cubicValue_ne_zero P hgP u (Ideal.notMem_of_isUnit P hu)) exact (ramified_comparison_of_factor P Q hgP hgQ p q u r hP hQ hp hq hu.ne_zero hr0 hr hfactor).trans hscalar lemma omega_six : omega ^ 6 = 1 := by calc _ = omega ^ 3 * omega ^ 3 := by ring _ = 1 := by rw [omega_primitive.pow_eq_one, one_mul] private theorem supplement_case00 (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (k l : ℤ) (hP : P = Ideal.span {primaryCoord (3*k+0) (3*l+0)}) : cubicChar P hg (Ideal.Quotient.mk P lambda) = omega ^ 0 := by letI := cubicTwoIdeal_isMaximal have hw : cubicChar P hg (Ideal.Quotient.mk P omega) = omega ^ 0 := by rw [cubicValue_omega_primary P hg _ _ hP] congr 1 omega refine supplement_of_factor P cubicTwoIdeal hg cubicTwoIdeal_good (primaryCoord (3*k+0) (3*l+0)) (-2) (-(omega ^ 2)) (primaryCoord (k) (l)) hP rfl (primaryCoord_primary _ _) neg_two_primary (omega_isUnit.pow 2).neg (primaryCoord_ne_zero _ _) (primaryCoord_primary _ _) ?_ 0 ?_ · simp only [primaryCoord_eq, lambda_def] push_cast all_goals ring_nf all_goals simp only [omega_five, omega_four, omega_primitive.pow_eq_one, omega_sq_for_norm] all_goals ring · simp only [cubicValue_neg, map_pow, cubicValue_lambda_two, cubicValue_omega_two, hw, pow_zero, ] all_goals ring_nf all_goals simp only [ omega_six, ] private theorem supplement_case01 (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (k l : ℤ) (hP : P = Ideal.span {primaryCoord (3*k+0) (3*l+1)}) : cubicChar P hg (Ideal.Quotient.mk P lambda) = omega ^ 0 := by letI := cubicTwoIdeal_isMaximal have hw : cubicChar P hg (Ideal.Quotient.mk P omega) = omega ^ 2 := by rw [cubicValue_omega_primary P hg _ _ hP] congr 1 omega refine supplement_of_factor P cubicTwoIdeal hg cubicTwoIdeal_good (primaryCoord (3*k+0) (3*l+1)) (-2) (omega ^ 1) (primaryCoord (l) (-k + l)) hP rfl (primaryCoord_primary _ _) neg_two_primary (omega_isUnit.pow 1) (primaryCoord_ne_zero _ _) (primaryCoord_primary _ _) ?_ 0 ?_ · simp only [primaryCoord_eq, lambda_def] push_cast all_goals ring_nf all_goals simp only [ omega_four, omega_primitive.pow_eq_one, omega_sq_for_norm] all_goals ring · simp only [ cubicValue_lambda_two, cubicValue_omega_two, hw, pow_zero, pow_one] all_goals ring_nf all_goals simp only [ omega_five, omega_sq_for_norm] private theorem supplement_case02 (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (k l : ℤ) (hP : P = Ideal.span {primaryCoord (3*k+0) (3*l+2)}) : cubicChar P hg (Ideal.Quotient.mk P lambda) = omega ^ 0 := letI := @OAI.CubicRamified.sevenIdeal_isMaximal by have hw : cubicChar P hg (Ideal.Quotient.mk P omega) = omega ^ 1 := by rw [cubicValue_omega_primary P hg _ _ hP] congr 1 omega refine supplement_of_factor P sevenIdeal hg sevenIdeal_good (primaryCoord (3*k+0) (3*l+2)) sevenPrime (-(omega ^ 0)) (primaryCoord (-k + l) (-k)) hP rfl (primaryCoord_primary _ _) sevenPrime_primary (omega_isUnit.pow 0).neg (primaryCoord_ne_zero _ _) (primaryCoord_primary _ _) ?_ 0 ?_ · simp only [primaryCoord_eq, lambda_def, sevenPrime] push_cast all_goals ring_nf all_goals simp only [ omega_primitive.pow_eq_one, omega_sq_for_norm] all_goals ring · simp only [cubicValue_neg, cubicValue_lambda_seven, pow_zero, map_one] private theorem supplement_case10 (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (k l : ℤ) (hP : P = Ideal.span {primaryCoord (3*k+1) (3*l+0)}) : cubicChar P hg (Ideal.Quotient.mk P lambda) = omega ^ 1 := by letI := cubicTwoIdeal_isMaximal have hw : cubicChar P hg (Ideal.Quotient.mk P omega) = omega ^ 2 := by rw [cubicValue_omega_primary P hg _ _ hP] congr 1 omega refine supplement_of_factor P cubicTwoIdeal hg cubicTwoIdeal_good (primaryCoord (3*k+1) (3*l+0)) (-2) (omega ^ 2) (primaryCoord (-k - 1) (-l)) hP rfl (primaryCoord_primary _ _) neg_two_primary (omega_isUnit.pow 2) (primaryCoord_ne_zero _ _) (primaryCoord_primary _ _) ?_ 1 ?_ · simp only [primaryCoord_eq, lambda_def] push_cast all_goals ring_nf all_goals simp only [omega_five, omega_four, omega_primitive.pow_eq_one, omega_sq_for_norm] all_goals ring · simp only [ map_pow, cubicValue_lambda_two, cubicValue_omega_two, hw, pow_one] all_goals ring_nf private theorem supplement_case11 (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (k l : ℤ) (hP : P = Ideal.span {primaryCoord (3*k+1) (3*l+1)}) : cubicChar P hg (Ideal.Quotient.mk P lambda) = omega ^ 1 := letI := @OAI.CubicRamified.sevenIdeal_isMaximal by have hw : cubicChar P hg (Ideal.Quotient.mk P omega) = omega ^ 1 := by rw [cubicValue_omega_primary P hg _ _ hP] congr 1 omega refine supplement_of_factor P sevenIdeal hg sevenIdeal_good (primaryCoord (3*k+1) (3*l+1)) sevenPrime (-(omega ^ 2)) (primaryCoord (k) (l)) hP rfl (primaryCoord_primary _ _) sevenPrime_primary (omega_isUnit.pow 2).neg (primaryCoord_ne_zero _ _) (primaryCoord_primary _ _) ?_ 1 ?_ · simp only [primaryCoord_eq, lambda_def, sevenPrime] push_cast all_goals ring_nf all_goals simp only [omega_five, omega_four, omega_primitive.pow_eq_one, omega_sq_for_norm] all_goals ring · simp only [cubicValue_neg, map_pow, cubicValue_lambda_seven, cubicValue_omega_seven, hw, pow_one] all_goals ring_nf private theorem supplement_case12 (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (k l : ℤ) (hP : P = Ideal.span {primaryCoord (3*k+1) (3*l+2)}) : cubicChar P hg (Ideal.Quotient.mk P lambda) = omega ^ 1 := by letI := cubicTwoIdeal_isMaximal have hw : cubicChar P hg (Ideal.Quotient.mk P omega) = omega ^ 0 := by rw [cubicValue_omega_primary P hg _ _ hP] congr 1 omega refine supplement_of_factor P cubicTwoIdeal hg cubicTwoIdeal_good (primaryCoord (3*k+1) (3*l+2)) (-2) (-(omega ^ 1)) (primaryCoord (-l - 1) (k - l)) hP rfl (primaryCoord_primary _ _) neg_two_primary (omega_isUnit.pow 1).neg (primaryCoord_ne_zero _ _) (primaryCoord_primary _ _) ?_ 1 ?_ · simp only [primaryCoord_eq, lambda_def] push_cast all_goals ring_nf all_goals simp only [ omega_four, omega_primitive.pow_eq_one, omega_sq_for_norm] all_goals ring · simp only [cubicValue_neg, cubicValue_lambda_two, cubicValue_omega_two, hw, pow_zero, pow_one] all_goals ring_nf all_goals simp only [ omega_five, omega_sq_for_norm] private theorem supplement_case20 (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (k l : ℤ) (hP : P = Ideal.span {primaryCoord (3*k+2) (3*l+0)}) : cubicChar P hg (Ideal.Quotient.mk P lambda) = omega ^ 2 := letI := @OAI.CubicRamified.sevenIdeal_isMaximal by have hw : cubicChar P hg (Ideal.Quotient.mk P omega) = omega ^ 1 := by rw [cubicValue_omega_primary P hg _ _ hP] congr 1 omega refine supplement_of_factor P sevenIdeal hg sevenIdeal_good (primaryCoord (3*k+2) (3*l+0)) sevenPrime (-(omega ^ 1)) (primaryCoord (-l) (k - l + 1)) hP rfl (primaryCoord_primary _ _) sevenPrime_primary (omega_isUnit.pow 1).neg (primaryCoord_ne_zero _ _) (primaryCoord_primary _ _) ?_ 2 ?_ · simp only [primaryCoord_eq, lambda_def, sevenPrime] push_cast all_goals ring_nf all_goals simp only [ omega_four, omega_primitive.pow_eq_one, omega_sq_for_norm] all_goals ring · simp only [cubicValue_neg, cubicValue_lambda_seven, cubicValue_omega_seven, hw, pow_one] all_goals ring_nf all_goals simp only [ omega_five, omega_sq_for_norm] private theorem supplement_case21 (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (k l : ℤ) (hP : P = Ideal.span {primaryCoord (3*k+2) (3*l+1)}) : cubicChar P hg (Ideal.Quotient.mk P lambda) = omega ^ 2 := by letI := cubicTwoIdeal_isMaximal have hw : cubicChar P hg (Ideal.Quotient.mk P omega) = omega ^ 0 := by rw [cubicValue_omega_primary P hg _ _ hP] congr 1 omega refine supplement_of_factor P cubicTwoIdeal hg cubicTwoIdeal_good (primaryCoord (3*k+2) (3*l+1)) (-2) (-(omega ^ 0)) (primaryCoord (-k + l - 1) (-k - 1)) hP rfl (primaryCoord_primary _ _) neg_two_primary (omega_isUnit.pow 0).neg (primaryCoord_ne_zero _ _) (primaryCoord_primary _ _) ?_ 2 ?_ · simp only [primaryCoord_eq, lambda_def] push_cast all_goals ring_nf all_goals simp only [ omega_primitive.pow_eq_one, omega_sq_for_norm] all_goals ring · simp only [cubicValue_neg, cubicValue_lambda_two, pow_zero, map_one] private theorem supplement_case22 (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (k l : ℤ) (hP : P = Ideal.span {primaryCoord (3*k+2) (3*l+2)}) : cubicChar P hg (Ideal.Quotient.mk P lambda) = omega ^ 2 := by letI := cubicTwoIdeal_isMaximal have hw : cubicChar P hg (Ideal.Quotient.mk P omega) = omega ^ 2 := by rw [cubicValue_omega_primary P hg _ _ hP] congr 1 omega refine supplement_of_factor P cubicTwoIdeal hg cubicTwoIdeal_good (primaryCoord (3*k+2) (3*l+2)) (-2) (omega ^ 0) (primaryCoord (k - l) (k + 1)) hP rfl (primaryCoord_primary _ _) neg_two_primary (omega_isUnit.pow 0) (primaryCoord_ne_zero _ _) (primaryCoord_primary _ _) ?_ 2 ?_ · simp only [primaryCoord_eq, lambda_def] push_cast all_goals ring_nf all_goals simp only [ omega_primitive.pow_eq_one, omega_sq_for_norm] all_goals ring · simp only [ cubicValue_lambda_two, pow_zero, map_one] theorem cubicValue_lambda_primary (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (A B : ℤ) (hP : P = Ideal.span {primaryCoord A B}) : cubicChar P hg (Ideal.Quotient.mk P lambda) = omega ^ (A % 3).toNat := by have hA : A = 3 * (A / 3) + A % 3 := by omega have hB : B = 3 * (B / 3) + B % 3 := by omega have hAa : A % 3 = 0 ∨ A % 3 = 1 ∨ A % 3 = 2 := by omega have hBb : B % 3 = 0 ∨ B % 3 = 1 ∨ B % 3 = 2 := by omega rcases hAa with ha | ha | ha <;> rcases hBb with hb | hb | hb · have hp : P = Ideal.span {primaryCoord (3*(A/3)+0) (3*(B/3)+0)} := by rw [show 3*(A/3)+0 = A by omega, show 3*(B/3)+0 = B by omega] exact hP simpa only [ha, Int.reduceToNat] using supplement_case00 P hg (A/3) (B/3) hp · have hp : P = Ideal.span {primaryCoord (3*(A/3)+0) (3*(B/3)+1)} := by rw [show 3*(A/3)+0 = A by omega, show 3*(B/3)+1 = B by omega] exact hP simpa only [ha, Int.reduceToNat] using supplement_case01 P hg (A/3) (B/3) hp · have hp : P = Ideal.span {primaryCoord (3*(A/3)+0) (3*(B/3)+2)} := by rw [show 3*(A/3)+0 = A by omega, show 3*(B/3)+2 = B by omega] exact hP simpa only [ha, Int.reduceToNat] using supplement_case02 P hg (A/3) (B/3) hp · have hp : P = Ideal.span {primaryCoord (3*(A/3)+1) (3*(B/3)+0)} := by rw [show 3*(A/3)+1 = A by omega, show 3*(B/3)+0 = B by omega] exact hP simpa only [ha, Int.reduceToNat] using supplement_case10 P hg (A/3) (B/3) hp · have hp : P = Ideal.span {primaryCoord (3*(A/3)+1) (3*(B/3)+1)} := by rw [show 3*(A/3)+1 = A by omega, show 3*(B/3)+1 = B by omega] exact hP simpa only [ha, Int.reduceToNat] using supplement_case11 P hg (A/3) (B/3) hp · have hp : P = Ideal.span {primaryCoord (3*(A/3)+1) (3*(B/3)+2)} := by rw [show 3*(A/3)+1 = A by omega, show 3*(B/3)+2 = B by omega] exact hP simpa only [ha, Int.reduceToNat] using supplement_case12 P hg (A/3) (B/3) hp · have hp : P = Ideal.span {primaryCoord (3*(A/3)+2) (3*(B/3)+0)} := by rw [show 3*(A/3)+2 = A by omega, show 3*(B/3)+0 = B by omega] exact hP simpa only [ha, Int.reduceToNat] using supplement_case20 P hg (A/3) (B/3) hp · have hp : P = Ideal.span {primaryCoord (3*(A/3)+2) (3*(B/3)+1)} := by rw [show 3*(A/3)+2 = A by omega, show 3*(B/3)+1 = B by omega] exact hP simpa only [ha, Int.reduceToNat] using supplement_case21 P hg (A/3) (B/3) hp · have hp : P = Ideal.span {primaryCoord (3*(A/3)+2) (3*(B/3)+2)} := by rw [show 3*(A/3)+2 = A by omega, show 3*(B/3)+2 = B by omega] exact hP simpa only [ha, Int.reduceToNat] using supplement_case22 P hg (A/3) (B/3) hp end CubicRamified end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Reciprocity.RamifiedSymbol namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace CubicRamified open ActualEisensteinCubic CubicJacobiGlobal CompletedGauss def cubicExp (n : ℤ) : O := omega ^ (n % 3).toNat lemma cubicExp_eq_of_dvd_sub {a b : ℤ} (h : 3 ∣ a - b) : cubicExp a = cubicExp b := by obtain ⟨k, hk⟩ := h have heq : a % 3 = b % 3 := by omega simp only [cubicExp, heq] lemma cubicExp_add (a b : ℤ) : cubicExp (a + b) = cubicExp a * cubicExp b := by simp only [cubicExp, ← pow_add] apply ((omega_primitive.isOfFinOrder (by decide)).pow_inj_mod).mpr rw [← omega_primitive.eq_orderOf] omega lemma cubicExp_zero : cubicExp 0 = 1 := by simp [cubicExp] def linearRay (u v : ℤ) (x : O) : O := cubicExp (u * (((ActualEisensteinCoordinates.coords x).1 - 1) / 3) + v * ((ActualEisensteinCoordinates.coords x).2 / 3)) lemma linearRay_primaryCoord (u v A B : ℤ) : linearRay u v (primaryCoord A B) = cubicExp (u*A + v*B) := by simp only [linearRay, primaryCoord, ShortDraftLatticeCount.coords_eval] rw [show (1 + 3*A - 1) / 3 = A by omega, show 3*B / 3 = B by omega] lemma exists_primaryCoord (x : O) (hx : lambda ^ 2 ∣ x - 1) : ∃ A B : ℤ, x = primaryCoord A B := by have hthree : (3 : O) ∣ lambda ^ 2 := by refine ⟨-omega, ?_⟩ rw [lambda_def] linear_combination omega_sq_for_norm obtain ⟨z, hz⟩ := hthree.trans hx obtain ⟨A, B, hAB⟩ := ActualEisensteinCoordinates.exists_coordinates z change z = (A : O) + (B : O) * omega at hAB refine ⟨A, B, ?_⟩ rw [primaryCoord_eq] rw [hAB] at hz linear_combination hz lemma primaryCoord_mul (A B C D : ℤ) : primaryCoord A B * primaryCoord C D = primaryCoord (A+C+3*(A*C-B*D)) (B+D+3*(A*D+B*C-B*D)) := by simp only [primaryCoord, ActualEisensteinCoordinates.eval_mul] congr 1 <;> ring lemma linearRay_one (u v : ℤ) : linearRay u v 1 = 1 := by have hone : (1 : O) = primaryCoord 0 0 := by rw [primaryCoord_eq]; simp conv_lhs => rw [hone, linearRay_primaryCoord] simp [cubicExp_zero] lemma linearRay_mul (u v : ℤ) (x y : O) (hx : lambda ^ 2 ∣ x - 1) (hy : lambda ^ 2 ∣ y - 1) : linearRay u v (x*y) = linearRay u v x * linearRay u v y := by obtain ⟨A,B,rfl⟩ := exists_primaryCoord x hx obtain ⟨C,D,rfl⟩ := exists_primaryCoord y hy rw [primaryCoord_mul] simp only [linearRay_primaryCoord] rw [← cubicExp_add] apply cubicExp_eq_of_dvd_sub refine ⟨u*(A*C-B*D)+v*(A*D+B*C-B*D), ?_⟩ ring theorem symbol_eq_linearRay_of_prime (x : O) (u v : ℤ) (hprime : ∀ p : O, Prime p → lambda ^ 2 ∣ p-1 → symbol x p = linearRay u v p) (y : O) (hy : lambda ^ 2 ∣ y-1) : symbol x y = linearRay u v y := by obtain ⟨A,B,hyAB⟩ := exists_primaryCoord y hy have hy0 : y ≠ 0 := by rw [hyAB]; exact primaryCoord_ne_zero A B obtain ⟨s,hsprod,hs⟩ := exists_primary_prime_factorization y hy0 hy rw [← hsprod] clear hsprod hyAB hy hy0 A B y induction s using Multiset.induction_on with | empty => simp only [Multiset.prod_zero, symbol_one, linearRay_one] | @cons p s ih => have hp := hs p (Multiset.mem_cons_self _ _) have hss : ∀ r ∈ s, Prime r ∧ lambda ^ 2 ∣ r-1 := fun r hr => hs r (Multiset.mem_cons_of_mem hr) rw [Multiset.prod_cons, symbol_mul_denominator, hprime p hp.1 hp.2, ih hss, linearRay_mul u v p s.prod hp.2 (primary_multiset_prod s (fun r hr => (hss r hr).2))] theorem symbol_lambda_eq_linearRay (y : O) (hy : lambda ^ 2 ∣ y-1) : symbol lambda y = linearRay 1 0 y := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO apply symbol_eq_linearRay_of_prime lambda 1 0 _ y hy intro p hp hprimary let : (Ideal.span {p} : Ideal O).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible have hg : lambda ∉ (Ideal.span {p} : Ideal O) := primary_maximal_divisor_good p hprimary _ (Ideal.subset_span (by simp)) obtain ⟨A,B,hpAB⟩ := exists_primaryCoord p hprimary rw [symbol, idealSymbol_prime _ hg] have hc := cubicValue_lambda_primary (Ideal.span {p}) hg A B (by rw [hpAB]) rw [hc, hpAB, linearRay_primaryCoord] simp [cubicExp] theorem symbol_omega_eq_linearRay (y : O) (hy : lambda ^ 2 ∣ y-1) : symbol omega y = linearRay 2 (-1) y := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO apply symbol_eq_linearRay_of_prime omega 2 (-1) _ y hy intro p hp hprimary let : (Ideal.span {p} : Ideal O).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible have hg : lambda ∉ (Ideal.span {p} : Ideal O) := primary_maximal_divisor_good p hprimary _ (Ideal.subset_span (by simp)) obtain ⟨A,B,hpAB⟩ := exists_primaryCoord p hprimary rw [symbol, idealSymbol_prime _ hg] have hc := cubicValue_omega_primary (Ideal.span {p}) hg A B (by rw [hpAB]) rw [hc, hpAB, linearRay_primaryCoord] simp [cubicExp, sub_eq_add_neg] theorem cubicValue_traceLambda_primary (P : Ideal O) [P.IsMaximal] (hg : lambda ∉ P) (A B : ℤ) (hP : P = Ideal.span {primaryCoord A B}) : cubicChar P hg (Ideal.Quotient.mk P traceLambda) = cubicExp (-B) := by have htrace : traceLambda = -omega * lambda := by change 1 + 2 * omega = -omega * (omega - 1) linear_combination omega_sq_for_norm rw [htrace, map_mul, map_mul, cubicValue_neg, cubicValue_omega_primary P hg A B hP, cubicValue_lambda_primary P hg A B hP] change cubicExp (2*A-B) * cubicExp A = cubicExp (-B) rw [← cubicExp_add] exact cubicExp_eq_of_dvd_sub ⟨A, by ring⟩ theorem symbol_traceLambda_eq_linearRay (y : O) (hy : lambda ^ 2 ∣ y-1) : symbol traceLambda y = linearRay 0 (-1) y := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO apply symbol_eq_linearRay_of_prime traceLambda 0 (-1) _ y hy intro p hp hprimary let : (Ideal.span {p} : Ideal O).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible have hg : lambda ∉ (Ideal.span {p} : Ideal O) := primary_maximal_divisor_good p hprimary _ (Ideal.subset_span (by simp)) obtain ⟨A,B,hpAB⟩ := exists_primaryCoord p hprimary rw [symbol, idealSymbol_prime _ hg] have hc := cubicValue_traceLambda_primary (Ideal.span {p}) hg A B (by rw [hpAB]) rw [hc, hpAB, linearRay_primaryCoord] simp theorem linearRay_congr_mod_nine (u v : ℤ) (x y : O) (hx : lambda ^ 2 ∣ x-1) (hy : lambda ^ 2 ∣ y-1) (hxy : (9 : O) ∣ x-y) : linearRay u v x = linearRay u v y := by obtain ⟨A,B,rfl⟩ := exists_primaryCoord x hx obtain ⟨C,D,rfl⟩ := exists_primaryCoord y hy obtain ⟨z,hz⟩ := hxy obtain ⟨E,F,hEF⟩ := ActualEisensteinCoordinates.exists_coordinates z change z = (E : O) + (F : O) * omega at hEF have hcoords : ActualEisensteinCoordinates.eval (3*(A-C)) (3*(B-D)) = ActualEisensteinCoordinates.eval (9*E) (9*F) := by have he (a b : ℤ) : ActualEisensteinCoordinates.eval a b = (a : O) + (b : O) * omega := rfl simp only [he] rw [hEF, primaryCoord_eq, primaryCoord_eq] at hz push_cast linear_combination hz have hab := ActualEisensteinCoordinates.unique_coordinates hcoords have ha : A-C = 3*E := by omega have hb : B-D = 3*F := by omega rw [linearRay_primaryCoord, linearRay_primaryCoord] apply cubicExp_eq_of_dvd_sub refine ⟨u*E+v*F, ?_⟩ linear_combination u*ha + v*hb theorem symbol_lambda_congr_mod_nine (x y : O) (hx : lambda ^ 2 ∣ x-1) (hy : lambda ^ 2 ∣ y-1) (hxy : (9 : O) ∣ x-y) : symbol lambda x = symbol lambda y := by rw [symbol_lambda_eq_linearRay x hx, symbol_lambda_eq_linearRay y hy] exact linearRay_congr_mod_nine 1 0 x y hx hy hxy theorem symbol_traceLambda_congr_mod_nine (x y : O) (hx : lambda ^ 2 ∣ x-1) (hy : lambda ^ 2 ∣ y-1) (hxy : (9 : O) ∣ x-y) : symbol traceLambda x = symbol traceLambda y := by rw [symbol_traceLambda_eq_linearRay x hx, symbol_traceLambda_eq_linearRay y hy] exact linearRay_congr_mod_nine 0 (-1) x y hx hy hxy end CubicRamified namespace CubicJacobiGlobal open ActualEisensteinCubic CompletedGauss CubicRamified theorem primary_ne_zero (a : O) (ha : lambda ^ 2 ∣ a-1) : a ≠ 0 := by obtain ⟨A,B,rfl⟩ := exists_primaryCoord a ha exact primaryCoord_ne_zero A B theorem symbol_one_numerator (a : O) (ha : lambda ^ 2 ∣ a-1) : symbol 1 a = 1 := by apply idealSymbol_map_one rw [primaryGenerator_span a (primary_ne_zero a ha) ha] exact primary_ne_zero a ha theorem symbol_mul_numerator (x y a : O) (ha : lambda ^ 2 ∣ a-1) : symbol (x*y) a = symbol x a * symbol y a := by apply idealSymbol_map_mul rw [primaryGenerator_span a (primary_ne_zero a ha) ha] exact primary_ne_zero a ha theorem symbol_pow_numerator (x a : O) (ha : lambda ^ 2 ∣ a-1) (n : ℕ) : symbol (x^n) a = symbol x a ^ n := by induction n with | zero => simp only [pow_zero, symbol_one_numerator a ha] | succ n ih => rw [pow_succ, symbol_mul_numerator _ _ a ha, ih, pow_succ] theorem symbol_neg_one (a : O) (ha : lambda ^ 2 ∣ a-1) : symbol (-1) a = 1 := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO have h := symbol_eq_linearRay_of_prime (-1) 0 0 (fun p hp hprimary => by let : (Ideal.span {p} : Ideal O).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible have hg : lambda ∉ (Ideal.span {p} : Ideal O) := primary_maximal_divisor_good p hprimary _ (Ideal.subset_span (by simp)) rw [symbol, idealSymbol_prime _ hg, map_neg, map_one, A3_cubicChar_neg_one] simp [linearRay, cubicExp_zero]) a ha simpa [linearRay, cubicExp_zero] using h theorem symbol_neg_numerator (x a : O) (ha : lambda ^ 2 ∣ a-1) : symbol (-x) a = symbol x a := by rw [neg_eq_neg_one_mul, symbol_mul_numerator _ _ a ha, symbol_neg_one a ha, one_mul] theorem symbol_isUnit_ne_zero (x a : O) (hx : IsUnit x) (ha : lambda ^ 2 ∣ a-1) : symbol x a ≠ 0 := by obtain ⟨u,rfl⟩ := hx have h : symbol (u : O) a * symbol (↑u⁻¹ : O) a = 1 := by rw [← symbol_mul_numerator _ _ a ha, ← Units.val_mul, mul_inv_cancel, Units.val_one, symbol_one_numerator a ha] intro hz rw [hz, zero_mul] at h exact zero_ne_one h theorem symbol_unit_congr_mod_nine (x a b : O) (hx : IsUnit x) (ha : lambda ^ 2 ∣ a-1) (hb : lambda ^ 2 ∣ b-1) (hab : (9 : O) ∣ a-b) : symbol x a = symbol x b := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK obtain ⟨u,rfl⟩ := hx let ζ := IsCyclotomicExtension.zeta_spec 3 ℚ K let η : Oˣ := (ζ.toInteger_isPrimitiveRoot.isUnit (by decide)).unit have hη : (η : O) = omega := rfl have hu : u ∈ ([1, -1, η, -η, η^2, -η^2] : List Oˣ) := IsCyclotomicExtension.Rat.Three.Units.mem ζ u have hω : symbol omega a = symbol omega b := by rw [symbol_omega_eq_linearRay a ha, symbol_omega_eq_linearRay b hb] exact linearRay_congr_mod_nine 2 (-1) a b ha hb hab simp only [List.mem_cons, List.mem_nil_iff, or_false] at hu rcases hu with h | h | h | h | h | h · simp only [h, Units.val_one, symbol_one_numerator _ ha, symbol_one_numerator _ hb] · simp only [h, Units.val_neg, Units.val_one, symbol_neg_one _ ha, symbol_neg_one _ hb] · simpa only [h, hη] using hω · simpa only [h, Units.val_neg, hη, symbol_neg_numerator _ _ ha, symbol_neg_numerator _ _ hb] using hω · simpa only [h, Units.val_pow_eq_pow_val, hη, symbol_pow_numerator _ _ ha, symbol_pow_numerator _ _ hb] using congrArg (fun t : O => t^2) hω · simpa only [h, Units.val_neg, Units.val_pow_eq_pow_val, hη, symbol_neg_numerator _ _ ha, symbol_neg_numerator _ _ hb, symbol_pow_numerator _ _ ha, symbol_pow_numerator _ _ hb] using congrArg (fun t : O => t^2) hω private theorem associated_congr_denominator {x y a b : O} (hxy : Associated x y) (ha : lambda ^ 2 ∣ a-1) (hb : lambda ^ 2 ∣ b-1) (hab : (9 : O) ∣ a-b) (hy : symbol y a = symbol y b) : symbol x a = symbol x b := by obtain ⟨u,hu⟩ := hxy apply mul_right_cancel₀ (symbol_isUnit_ne_zero (u : O) a u.isUnit ha) calc symbol x a * symbol (u : O) a = symbol y a := by rw [← symbol_mul_numerator _ _ a ha, hu] _ = symbol y b := hy _ = symbol x b * symbol (u : O) b := by rw [← hu, symbol_mul_numerator _ _ b hb] _ = symbol x b * symbol (u : O) a := by rw [symbol_unit_congr_mod_nine (u : O) b a u.isUnit hb ha (by simpa only [neg_sub] using dvd_neg.mpr hab)] private theorem ramified_prime : Prime lambda := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK let : Fact (Nat.Prime 3) := ⟨Nat.prime_three⟩ exact (IsCyclotomicExtension.zeta_spec 3 ℚ K).zeta_sub_one_prime' private theorem symbol_prime_denominator_congr (p a b : O) (hp : Prime p) (ha : lambda ^ 2 ∣ a-1) (hb : lambda ^ 2 ∣ b-1) (h9 : (9 : O) ∣ a-b) (hpab : p ∣ a-b) : symbol p a = symbol p b := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let : (Ideal.span {p} : Ideal O).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible by_cases hg : lambda ∉ (Ideal.span {p} : Ideal O) · obtain ⟨q,hq,hprimary,-⟩ := cubicJacobi_exists_primary_generator (Ideal.span {p}) hg have hpq : Associated p q := Ideal.span_singleton_eq_span_singleton.mp hq apply associated_congr_denominator hpq ha hb h9 have hq0 : q ≠ 0 := (hpq.prime_iff.mp hp).ne_zero rw [symbol_reciprocity q a hq0 (primary_ne_zero a ha) hprimary ha, symbol_reciprocity q b hq0 (primary_ne_zero b hb) hprimary hb] exact symbol_congr (hpq.dvd'.trans hpab) · have hdiv : p ∣ lambda := Ideal.mem_span_singleton.mp (not_not.mp hg) apply associated_congr_denominator (hp.associated_of_dvd ramified_prime hdiv) ha hb h9 exact symbol_lambda_congr_mod_nine a b ha hb h9 theorem symbol_denominator_congr (x a b : O) (ha : lambda ^ 2 ∣ a-1) (hb : lambda ^ 2 ∣ b-1) (h9 : (9 : O) ∣ a-b) (hx : x ∣ a-b) : symbol x a = symbol x b := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO induction x using UniqueFactorizationMonoid.induction_on_prime with | h₁ => have heq : a = b := sub_eq_zero.mp (zero_dvd_iff.mp hx); rw [heq] | h₂ u hu => exact symbol_unit_congr_mod_nine u a b hu ha hb h9 | h₃ x p hx0 hp ih => have hpab : p ∣ a-b := (dvd_mul_right p x).trans hx have hxab : x ∣ a-b := (dvd_mul_left x p).trans hx rw [symbol_mul_numerator _ _ a ha, symbol_mul_numerator _ _ b hb, symbol_prime_denominator_congr p a b hp ha hb h9, ih hxab] exact hpab end CubicJacobiGlobal namespace PrimaryIdealUnitReindex open ActualEisensteinCubic ActualEisensteinCoordinates ShortDraftLatticeCount def unitCoordinates : Finset (ℤ × ℤ) := {(1, 0), (-1, 0), (0, 1), (0, -1), (1, 1), (-1, -1)} theorem q_eq_one_iff_unitCoordinates (z : ℤ × ℤ) : q z = 1 ↔ z ∈ unitCoordinates := by rcases z with ⟨a, b⟩ constructor · intro h have hs := coordinate_squares a b 1 (by norm_num) (le_of_eq h) have ha : -1 ≤ a ∧ a ≤ 1 := by constructor <;> nlinarith [sq_nonneg (a - 1), sq_nonneg (a + 1)] have hb : -1 ≤ b ∧ b ≤ 1 := by constructor <;> nlinarith [sq_nonneg (b - 1), sq_nonneg (b + 1)] rcases ha with ⟨ha1, ha2⟩ rcases hb with ⟨hb1, hb2⟩ interval_cases a <;> interval_cases b <;> norm_num [q, unitCoordinates] at * · intro h simp only [unitCoordinates, Finset.mem_insert, Finset.mem_singleton] at h rcases h with h | h | h | h | h | h <;> rw [h] <;> norm_num [q] theorem unit_coordinate_mem (u : Oˣ) : coords u.val ∈ unitCoordinates := by apply (q_eq_one_iff_unitCoordinates _).mp have hn := (rational_qNat_eq_one_iff u.val).mpr u.isUnit have hz := qO_nonneg u.val change (q (coords u.val)).toNat = 1 at hn have hi : ((q (coords u.val)).toNat : ℤ) = 1 := by exact_mod_cast hn simpa only [Int.toNat_of_nonneg hz] using hi def unitCoordinateMap (u : Oˣ) : {z : ℤ × ℤ // z ∈ unitCoordinates} := ⟨coords u.val, unit_coordinate_mem u⟩ theorem unitCoordinateMap_bijective : Function.Bijective unitCoordinateMap := by constructor · intro u v huv apply Units.ext have hc := congrArg Subtype.val huv have he := congrArg (fun z : ℤ × ℤ => eval z.1 z.2) hc simpa only [unitCoordinateMap, eval_coords] using he · intro z have hq := (q_eq_one_iff_unitCoordinates z.val).mpr z.property have hu : IsUnit (eval z.val.1 z.val.2) := by apply (rational_qNat_eq_one_iff _).mp simp only [qNat, coords_eval, hq] norm_num refine ⟨hu.unit, Subtype.ext ?_⟩ change coords hu.unit.val = z.val rw [hu.unit_spec, coords_eval] def unitCoordinateEquiv : Oˣ ≃ {z : ℤ × ℤ // z ∈ unitCoordinates} := Equiv.ofBijective unitCoordinateMap unitCoordinateMap_bijective theorem card_units_eq_six : Nat.card Oˣ = 6 := by rw [Nat.card_congr unitCoordinateEquiv, Nat.card_eq_fintype_card, Fintype.card_coe] norm_num [unitCoordinates] end PrimaryIdealUnitReindex open scoped BigOperators Classical SchwartzMap namespace QuadraticUnitInvariance open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase ActualEisensteinCoordinates open GaussGeneratorTransport QuadraticGaussRay EisensteinSchwartzPoisson open PrimaryIdealUnitReindex CompletedGauss theorem rowCoprimeMask_unit_mul {α : Type*} (R : α → Ideal O) (S : Finset α) (u : Oˣ) (z : O) : rowCoprimeMask R S (u.val * z) = rowCoprimeMask R S z := by simp only [rowCoprimeMask, Ideal.unit_mul_mem_iff_mem _ u.isUnit] theorem rowCoprimeMask_norm_le_one {α : Type*} (R : α → Ideal O) (S : Finset α) (z : O) : ‖rowCoprimeMask R S z‖ ≤ 1 := by unfold rowCoprimeMask split_ifs <;> simp end QuadraticUnitInvariance namespace GaussGeneratorTransport open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson FiniteGaussPhase theorem canonical_masked_radial_poisson_product {α ι : Type*} [DecidableEq α] [Fintype ι] (R : α → Ideal O) [∀ i, (R i).IsMaximal] (hinj : Function.Injective R) (S : Finset α) (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (j : ι → ℕ) (hj0 : ∀ i, j i ≠ 0) (hj6 : ∀ i, j i < 6) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : (∑' z : O, rowCoprimeMask R S z * finiteSexticRow (fun i => Ideal.span {p i}) hg j z * W (‖eisEmbedding z‖ ^ 2 / M)) = ((M : ℂ) * canonicalProductGauss p hp hcop hg j / (‖eisEmbedding (∏ i, p i)‖ : ℂ)) * ∑ E ∈ S.powerset, let d := primeSubsetGenerator R E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, R i) : ℂ) * finiteSexticRow (fun i => Ideal.span {p i}) hg j d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * ∑' h : O, star (finiteSexticRow (fun i => Ideal.span {p i}) hg j h) * paperRadialFourier W (M * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding (∏ i, p i)‖ ^ 2)) := by have ht := canonical_masked_radial_poisson_collected R hinj S (fun i => Ideal.span {p i}) hcop hg hchar j hj0 hj6 W M hM dsimp only at ht rw [finitePrimeModulus_norm_eq_product p] at ht rw [ht] let a : Finset α → ℂ := fun E => (UniqueFactorizationMonoid.moebius (∏ i ∈ E, R i) : ℂ) * finiteSexticRow (fun i => Ideal.span {p i}) hg j (primeSubsetGenerator R E) / (‖eisEmbedding (primeSubsetGenerator R E)‖ ^ 2 : ℝ) let F : Finset α → ℝ → ℂ := fun E t => paperRadialFourier W (M * t / (‖eisEmbedding (primeSubsetGenerator R E)‖ ^ 2 * ‖eisEmbedding (∏ i, p i)‖ ^ 2)) have hu := gauss_weighted_finite_radial_sum_transport p hp hcop hg j S.powerset a F change ((M : ℂ) * canonicalNormalizedGauss (fun i => Ideal.span {p i}) hcop hg j / (‖eisEmbedding (∏ i, p i)‖ : ℂ)) * (∑ E ∈ S.powerset, a E * ∑' h : O, star (finiteSexticRow (fun i => Ideal.span {p i}) hg j h) * F E (‖eisEmbedding h‖ ^ 2)) = _ calc _ = ((M : ℂ) / (‖eisEmbedding (∏ i, p i)‖ : ℂ)) * (canonicalNormalizedGauss (fun i => Ideal.span {p i}) hcop hg j * ∑ E ∈ S.powerset, a E * ∑' h : O, star (finiteSexticRow (fun i => Ideal.span {p i}) hg j h) * F E (‖eisEmbedding h‖ ^ 2)) := by ring _ = _ := by rw [hu]; ring end GaussGeneratorTransport namespace QuadraticUnitInvariance open ActualEisensteinCubic ConcreteTraceCRT FiniteGaussPhase ActualEisensteinCoordinates open QuadraticGaussRay MixedCrossSeparation QuadraticInitialBound open GaussGeneratorTransport EisensteinSchwartzPoisson theorem odd_of_quadraticRayValue_norm_eq_one (r : EisensteinEPrimaryPhase.Coord) (hr : ‖quadraticRayValue r‖ = 1) : EisensteinEPrimaryPhase.odd r := by rcases r with ⟨a, b⟩ fin_cases a <;> fin_cases b <;> norm_num [EisensteinEPrimaryPhase.odd, quadraticRayValue, breveGaussianFourTerms_formula, zpow_neg, Complex.I_sq, Complex.I_pow_three, Complex.inv_I, ZMod.val] at * theorem quadraticBlock_union_eq_one_of_same_ray {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (A B : Finset ι) (hd : Disjoint A B) (hray : residue (∏ i ∈ A, p i) = residue (∏ i ∈ B, p i)) : quadraticBlock p hp hg (A ∪ B) = 1 := by have hnorm := norm_quadraticBlock p hp hcop hg hchar A rw [quadraticBlock_eq_rayValue p hp hcop hg hchar A] at hnorm have hodd := odd_of_quadraticRayValue_norm_eq_one _ hnorm rw [quadraticBlock_eq_rayValue p hp hcop hg hchar (A ∪ B), Finset.prod_union hd] exact quadraticRayValue_same_residue_product _ _ hodd hray theorem same_ray_quadratic_pair_poisson {α ι : Type*} [DecidableEq α] [DecidableEq ι] (R : α → Ideal O) [∀ i, (R i).IsMaximal] (hinj : Function.Injective R) (S : Finset α) (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hchar : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (A B : Finset ι) (hd : Disjoint A B) (hray : residue (∏ i ∈ A, p i) = residue (∏ i ∈ B, p i)) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : let n := ∏ i ∈ A ∪ B, p i let χ := fun z => quadraticRow (fun i => Ideal.span {p i}) hg A z * quadraticRow (fun i => Ideal.span {p i}) hg B z (∑' z : O, rowCoprimeMask R S z * χ z * W (‖eisEmbedding z‖ ^ 2 / M)) = ((M : ℂ) / (‖eisEmbedding n‖ : ℂ)) * ∑ E ∈ S.powerset, let d := primeSubsetGenerator R E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, R i) : ℂ) * χ d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * ∑' h : O, χ h * paperRadialFourier W (M * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) := by have hcAB : Pairwise (Function.onFun IsCoprime (fun i : (A ∪ B : Finset ι) => Ideal.span {p i.val})) := by intro i k hik exact hcop (fun h => hik (Subtype.ext h)) have ht := canonical_masked_radial_poisson_product R hinj S (fun i : (A ∪ B : Finset ι) => p i.val) (fun i => hp i.val) hcAB (fun i => hg i.val) (fun i => hchar i.val) (fun _ => 3) (fun _ => by decide) (fun _ => by decide) W M hM have hγ := quadraticBlock_union_eq_one_of_same_ray p hp hcop hg hchar A B hd hray rw [quadraticBlock_eq_productGauss p hp hcop hg (A ∪ B)] at hγ rw [hγ, mul_one, Finset.prod_coe_sort] at ht have hrow (z : O) : finiteSexticRow (fun i : (A ∪ B : Finset ι) => Ideal.span {p i.val}) (fun i => hg i.val) (fun _ => 3) z = quadraticRow (fun i => Ideal.span {p i}) hg A z * quadraticRow (fun i => Ideal.span {p i}) hg B z := by rw [← quadraticRow_eq_canonical (fun i => Ideal.span {p i}) hg (A ∪ B) z, quadraticRow_disjoint_union _ _ _ _ hd] simp only [hrow, star_mul, quadraticRow_star] at ht simpa only [mul_comm] using ht end QuadraticUnitInvariance open scoped BigOperators Classical SchwartzMap namespace EisensteinSchwartzPoisson open ActualEisensteinCubic ConcreteTraceCRT end EisensteinSchwartzPoisson end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.KernelEnergy namespace OAI noncomputable section namespace FirstPassCubeLabels open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid section open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) def actualFirstKernel {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ lengthScale : ℝ) (d h : O) : ℂ := ∑ N ∈ F.powerset, ∑ P ∈ F.powerset, if Disjoint N P then (V₁ (columnLog p X₁ N) * V₂ (columnLog p X₂ P)) * ((lengthScale : ℂ) / (‖eisEmbedding (∏ i ∈ (N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂, p i)‖ : ℂ)) * paperRadialFourier W (lengthScale * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * primeProductNorm p ((N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂))) * threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h else 0 def firstColumnEnergy {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (C : Finset ι → ℂ) (V : ℝ → ℂ) (X : ℝ) (d h : O) (b : 𝓢(ℝ, ℂ)) : ℝ := ∫ t : ℝ, ‖b t‖ * ‖cubeBaseFactor p hp hg B v ε₁ ε₂ d h‖ * rayIdealEnergy p hg F (cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ negative (normalizedColumn p C) V (columnLog p X) t d) negative h theorem firstColumnEnergy_nonneg {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (C : Finset ι → ℂ) (V : ℝ → ℂ) (X : ℝ) (d h : O) (b : 𝓢(ℝ, ℂ)) : 0 ≤ firstColumnEnergy p hp hcop hg F B v ε₁ ε₂ negative C V X d h b := by apply integral_nonneg intro t exact mul_nonneg (mul_nonneg (norm_nonneg _) (norm_nonneg _)) (rayIdealEnergy_nonneg _ _ _ _ _ _) end section open ActualEisensteinCubic open FirstCauchyArithmetic (supportMobius supportRay supportConjugateSum) open RayFourExpansion (RayCharacter) section Local variable {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) theorem row_union (S T : Finset ι) (hd : Disjoint S T) (a : O) : finiteSquarefreeRow P hg (S ∪ T) a = finiteSquarefreeRow P hg S a * finiteSquarefreeRow P hg T a := by exact Finset.prod_union hd include hg in theorem mask_union (S T : Finset ι) (hd : Disjoint S T) (a : O) : rowCoprimeMask P (S ∪ T) a = rowCoprimeMask P S a * rowCoprimeMask P T a := by simp only [← row_sixth P hg, row_union P hg S T hd, mul_pow] omit [DecidableEq ι] in theorem row_four_star (S : Finset ι) (f h : O) : finiteSquarefreeRow P hg S f ^ 4 * star (finiteSquarefreeRow P hg S h) = star (finiteSquarefreeRow P hg S (h * f ^ 2)) := by have hf : star (finiteSquarefreeRow P hg S (f ^ 2)) = finiteSquarefreeRow P hg S f ^ 4 := by rw [row_pow, star_pow, finiteSquarefreeRow_conj_as_row_label] calc _ = finiteSquarefreeRow P hg S f ^ 4 * finiteSquarefreeRow P hg S f ^ 6 := by ring _ = _ := by rw [row_sixth] simpa only [pow_one] using row_power_mul_mask_power P hg S f 4 1 (by decide) rw [finiteSquarefreeRow_mul, star_mul, hf] def beforeDilationLabel {κ : Type*} (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (side : Bool) (c d f : O) (S : Finset ι) : ℂ := finiteSquarefreeRow P hg S c ^ 4 * finiteSquarefreeRow P hg S d * (rowCoprimeMask P S (cubeRadical p B) * finiteSquarefreeRow P hg S (aLabel p B (if side then ε₂ else ε₁)) ^ 4 * finiteSquarefreeRow P hg S (crtLabel p B v ε₁ ε₂ side)) * finiteSquarefreeRow P hg S f ^ 4 def afterDilationLabel {κ : Type*} (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (c d : O) (S : Finset ι) : ℂ := finiteSquarefreeRow P hg S (c * jLabel p B v ε₁ ε₂) ^ 4 * finiteSquarefreeRow P hg S d * rowCoprimeMask P S (b0Label p B v ε₁ ε₂) theorem beforeDilationLabel_union {κ : Type*} (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (side : Bool) (c d f : O) (S T : Finset ι) (hd : Disjoint S T) : beforeDilationLabel P hg p B v ε₁ ε₂ side c d f (S ∪ T) = beforeDilationLabel P hg p B v ε₁ ε₂ side c d f S * beforeDilationLabel P hg p B v ε₁ ε₂ side c d f T := by simp only [beforeDilationLabel, row_union P hg S T hd, mask_union P hg S T hd, mul_pow] ring omit [DecidableEq ι] in theorem beforeDilationLabel_norm_le_one {κ : Type*} (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (side : Bool) (c d f : O) (S : Finset ι) : ‖beforeDilationLabel P hg p B v ε₁ ε₂ side c d f S‖ ≤ 1 := by have hm : ‖rowCoprimeMask P S (cubeRadical p B)‖ ≤ 1 := by unfold rowCoprimeMask split_ifs <;> simp simp only [beforeDilationLabel, norm_mul, norm_pow] calc _ ≤ (1:ℝ)^4 * 1 * (1 * 1^4 * 1) * 1^4 := by gcongr <;> first | exact hm | exact finiteSquarefreeRow_norm_le_one P hg S _ _ = 1 := by norm_num omit [DecidableEq ι] in theorem beforeDilationLabel_star_row {κ : Type*} (p : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (hv : ∀ j ∈ B, 0 < v j) (side : Bool) (c d f h : O) (S : Finset ι) : beforeDilationLabel P hg p B v ε₁ ε₂ side c d f S * star (finiteSquarefreeRow P hg S h) = afterDilationLabel P hg p B v ε₁ ε₂ c d S * star (finiteSquarefreeRow P hg S (h * f^2 * dilationLabel p B v ε₁ ε₂)) := by unfold beforeDilationLabel afterDilationLabel calc _ = (finiteSquarefreeRow P hg S c ^ 4 * finiteSquarefreeRow P hg S d) * ((rowCoprimeMask P S (cubeRadical p B) * finiteSquarefreeRow P hg S (aLabel p B (if side then ε₂ else ε₁)) ^ 4 * finiteSquarefreeRow P hg S (crtLabel p B v ε₁ ε₂ side)) * (finiteSquarefreeRow P hg S f ^ 4 * star (finiteSquarefreeRow P hg S h))) := by ring _ = _ := by rw [row_four_star, first_pass_after_dual_dilation P hg S p B v ε₁ ε₂ hv side] simp only [finiteSquarefreeRow_mul, mul_pow] ring end Local theorem rayIdealRow_eq_supportRow {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F D : Finset ι) (C : Finset ι → ℂ) (negative : Bool) (χ : RayCharacter) (h : O) : rayIdealRow p hg F C negative χ D h = supportConjugateSum (fun i => Ideal.span {p i}) hg (F \ D) (fun U => (if negative then star (supportRay p χ U) else supportRay p χ U) * C (D ∪ U)) h := by symm exact FirstCauchyArithmetic.supportConjugateSum_eq_conjugateIdealRowSum (fun i => Ideal.span {p i}) hinj hg (F \ D) _ h def dilatedRayColumn {ι κ : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F D : Finset ι) (C : Finset ι → ℂ) (negative : Bool) (χ : RayCharacter) (q : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (c d y : O) : ℂ := supportConjugateSum (fun i => Ideal.span {p i}) hg (F \ D) (fun U => (if negative then star (supportRay p χ U) else supportRay p χ U) * C (D ∪ U) * afterDilationLabel (fun i => Ideal.span {p i}) hg q B v ε₁ ε₂ c d U) y theorem rayIdealRow_beforeDilation {ι κ : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F D : Finset ι) (C : Finset ι → ℂ) (negative : Bool) (χ : RayCharacter) (q : κ → O) (B : Finset κ) (v : κ → ℕ) (ε₁ ε₂ : κ → Bool) (hv : ∀ j ∈ B, 0 < v j) (side : Bool) (c d f h : O) : rayIdealRow p hg F (fun S => C S * beforeDilationLabel (fun i => Ideal.span {p i}) hg q B v ε₁ ε₂ side c d f S) negative χ D h = beforeDilationLabel (fun i => Ideal.span {p i}) hg q B v ε₁ ε₂ side c d f D * dilatedRayColumn p hg F D C negative χ q B v ε₁ ε₂ c d (h * f ^ 2 * dilationLabel q B v ε₁ ε₂) := by rw [rayIdealRow_eq_supportRow p hinj] unfold dilatedRayColumn supportConjugateSum rw [Finset.mul_sum] apply Finset.sum_congr rfl intro U hU have hd : Disjoint D U := by exact Finset.disjoint_left.mpr (fun i hiD hiU => (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hU) hiU)).2 hiD) dsimp only rw [beforeDilationLabel_union _ hg q B v ε₁ ε₂ side c d f D U hd] calc _ = beforeDilationLabel (fun i => Ideal.span {p i}) hg q B v ε₁ ε₂ side c d f D * supportMobius (fun i => Ideal.span {p i}) U * ((if negative then star (supportRay p χ U) else supportRay p χ U) * C (D ∪ U)) * (beforeDilationLabel (fun i => Ideal.span {p i}) hg q B v ε₁ ε₂ side c d f U * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U h)) := by ring _ = _ := by rw [beforeDilationLabel_star_row _ hg q B v ε₁ ε₂ hv side c d f h U] ring def originalLabelColumn {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B : Finset ι) (ε₁ ε₂ : ι → Bool) (negative : Bool) (C : Finset ι → ℂ) (c f : O) (S : Finset ι) : ℂ := C S * rowCoprimeMask (fun i => Ideal.span {p i}) S (cubeRadical p B) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (aLabel p B (if negative then ε₂ else ε₁) * c) ^ 4 * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S f ^ 4 def cubeCoreCoefficient {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (t : ℝ) (S : Finset ι) : ℂ := if negative then star (fixedRayExpansion p (cubeOddSupport B v ε₁ ε₂) S) * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (-1)) * MixedCrossSeparation.columnG p hp hcop hg S * C S * star (V (y S) * FourierBridge.logPhase t (-(y S))) else fixedRayExpansion p (cubeOddSupport B v ε₁ ε₂) S * MixedCrossSeparation.columnG p hp hcop hg S * C S * (V (y S) * FourierBridge.logPhase t (-(y S))) theorem rayIdealRow_cube_labels {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ j ∈ B, 0 < v j) (negative : Bool) (χ : RayCharacter) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (t : ℝ) (c d f h : O) : rayIdealRow p hg F (cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ negative (originalLabelColumn p hg B ε₁ ε₂ negative C c f) V y t d) negative χ D h = beforeDilationLabel (fun i => Ideal.span {p i}) hg p B v ε₁ ε₂ negative c d f D * dilatedRayColumn p hg F D (cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t) negative χ p B v ε₁ ε₂ c d (h * f ^ 2 * dilationLabel p B v ε₁ ε₂) := by have he : cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ negative (originalLabelColumn p hg B ε₁ ε₂ negative C c f) V y t d = fun S => cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t S * beforeDilationLabel (fun i => Ideal.span {p i}) hg p B v ε₁ ε₂ negative c d f S := by funext S exact (by cases negative <;> simp only [cubeLogCoefficient, cubeCoreCoefficient, cubeMinusCoefficient, cubePlusCoefficient, FirstCauchyArithmetic.firstPassColumnMinus, FirstCauchyArithmetic.firstPassColumnPlus, logTwistMinus, logTwistPlus, originalLabelColumn, beforeDilationLabel, Bool.false_eq_true, ite_false, ite_true, finiteSquarefreeRow_mul, mul_pow] <;> ring ) rw [he] exact rayIdealRow_beforeDilation p hinj hg F D _ negative χ p B v ε₁ ε₂ hv negative c d f h theorem first_cube_energy_small_power (deltaLoss : ℝ) (hδ : 0 < deltaLoss) : ∃ K : ℝ, 0 < K ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (_hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (_hv : ∀ j ∈ B, 0 < v j) (negative : Bool) (χ : RayCharacter) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (t : ℝ) (c d : O) (s : Finset (Ideal O × O)) (T : Finset O) (w : Ideal O × O → ℂ) (M Y : ℝ), 0 ≤ M → 0 ≤ Y → (∀ x ∈ s, Squarefree x.1) → (∀ x ∈ s, DescentWeightedCauchy.firstElementRowMap (dilationLabel p B v ε₁ ε₂) x ∈ T) → (∀ z ∈ T, z ≠ 0) → (∀ z ∈ T, (Ideal.absNorm (Ideal.span {z}) : ℝ) ≤ Y) → (∀ x ∈ s, ‖w x‖ ≤ M) → (∑ x ∈ s, ‖w x‖ * ‖rayIdealRow p hg F (cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ negative (originalLabelColumn p hg B ε₁ ε₂ negative C c (ConcretePrimeRowBridge.idealGenerator x.1)) V y t d) negative χ D x.2‖ ^ 2) ≤ M * K * Y ^ deltaLoss * ∑ z ∈ T, ‖dilatedRayColumn p hg F D (cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t) negative χ p B v ε₁ ε₂ c d z‖ ^ 2 := by obtain ⟨K, hK, hpush⟩ := SquarefreeDivisorBound.first_element_energy_small_power deltaLoss hδ refine ⟨K, hK, ?_⟩ intro ι _ p hp _ hinj hcop hg F D B v ε₁ ε₂ hv negative χ C V y t c d s T w M Y hM hY hs hmap hT hnorm hw apply le_trans _ (hpush s T (dilationLabel p B v ε₁ ε₂) w (dilatedRayColumn p hg F D (cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t) negative χ p B v ε₁ ε₂ c d) M Y hM hY hs hmap hT hnorm hw) apply Finset.sum_le_sum intro x hx apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) apply pow_le_pow_left₀ (norm_nonneg _) rw [rayIdealRow_cube_labels p hp hinj hcop hg F D B v ε₁ ε₂ hv negative χ C V y t c d, norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (beforeDilationLabel_norm_le_one _ hg p B v ε₁ ε₂ negative c d (ConcretePrimeRowBridge.idealGenerator x.1) D) theorem normalized_originalLabelColumn {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (B : Finset ι) (ε₁ ε₂ : ι → Bool) (negative : Bool) (C : Finset ι → ℂ) (c f : O) : normalizedColumn p (originalLabelColumn p hg B ε₁ ε₂ negative C c f) = originalLabelColumn p hg B ε₁ ε₂ negative (normalizedColumn p C) c f := by funext S simp only [normalizedColumn, originalLabelColumn, div_eq_mul_inv] ring end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) end section open scoped BigOperators Classical open ActualEisensteinCubic open RayFourExpansion (RayCharacter crossCoeff) theorem blockRow_norm_le_one {ι : Type*} (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (S : Finset ι) (e : ι → ℕ) (a : O) : ‖blockRow p hg S e a‖ ≤ 1 := by rw [blockRow_eq_product, norm_prod] calc _ ≤ ∏ i ∈ S, (1 : ℝ) := by apply Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) intro i hi let : Fintype (O ⧸ Ideal.span {p i}) := Fintype.ofFinite _ exact FiniteRayExpansion.norm_char_le_one _ _ _ = 1 := by simp theorem cubeBaseFactor_norm_le_one {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (d h : O) : ‖cubeBaseFactor p hp hg B v ε₁ ε₂ d h‖ ≤ 1 := by have he : ∀ i ∈ cubeActiveSupport B v ε₁ ε₂, (conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val ≠ 0 := by intro i hi exact (ZMod.val_eq_zero _).not.mpr (Finset.mem_filter.mp hi).2 simp only [cubeBaseFactor, norm_mul, norm_star, gaussBlock_norm_one p hp hcop hg hc _ _ he (fun _ _ => ZMod.val_lt _), one_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (blockRow_norm_le_one p hg _ _ _)).trans (blockRow_norm_le_one p hg _ _ _) theorem rayPairWeight_norm_le {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (r : RayCharacter × RayCharacter) (D : Finset ι) (h : O) : ‖rayPairWeight p r D h‖ ≤ ‖crossCoeff r.1 r.2‖ := by rw [norm_rayPairWeight p hinj hc] have hm : ‖rowCoprimeMask (fun i => Ideal.span {p i}) D h‖ ≤ 1 := by unfold rowCoprimeMask split_ifs <;> simp exact mul_le_of_le_one_right (norm_nonneg _) hm end open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) open EisensteinSchwartzPoisson (paperRadialFourier) open FourierBridge (logPhase) def firstLogDensity (J : ℕ) (t : ℝ) : ℝ := ((1 + ‖t‖) ^ (J + 2))⁻¹ theorem firstLogDensity_nonneg (J : ℕ) (t : ℝ) : 0 ≤ firstLogDensity J t := by unfold firstLogDensity positivity theorem firstLogDensity_integrable (J : ℕ) : Integrable (firstLogDensity J) volume := by have h := integrable_one_add_norm (E := ℝ) («μ» := (volume : Measure ℝ)) (r := (J + 2 : ℕ)) (by norm_num; linarith [Nat.cast_nonneg (α := ℝ) J]) convert h using 1 funext t rw [Real.rpow_neg (by positivity), Real.rpow_natCast] rfl theorem two_variable_radial_envelope (W : 𝓢(ℝ, ℂ)) (V₁ V₂ : ℝ → ℂ) (M₁ M₂ : ℝ) (hM₁ : 0 ≤ M₁) (hM₂ : 0 ≤ M₂) (hV₁ : ∀ x, V₁ x ≠ 0 → |x| ≤ M₁) (hV₂ : ∀ y, V₂ y ≠ 0 → |y| ≤ M₂) (A J : ℕ) : ∃ K : ℝ, 0 ≤ K ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), (∀ x y : ℝ, V₁ x * V₂ y * paperRadialFourier W (R * Real.exp (-x-y)) = ∫ t : ℝ, (V₁ x * logPhase t (-x)) * (V₂ y * logPhase t (-y)) * b t) ∧ (∀ t : ℝ, (1 + R) ^ A * ‖b t‖ ≤ K * firstLogDensity J t) := by let V : Bool → ℝ → ℂ := fun j => if j then V₂ else V₁ let M : Bool → ℝ := fun j => if j then M₂ else M₁ have hM : ∀ j, 0 ≤ M j := by intro j; cases j <;> assumption have hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j := by intro j; cases j · exact hV₁ · exact hV₂ obtain ⟨K, hK, hsep⟩ := EisensteinSchwartzPoisson.paperRadialFourier_log_separation_envelope W V (fun _ => -1) M hM hV A (J + 2) refine ⟨K, hK, ?_⟩ intro R hR obtain ⟨b, hb, _, _, hpoint⟩ := hsep R hR refine ⟨b, ?_, ?_⟩ · intro x y have hs := hb (fun j => if j then y else x) simpa only [V, Fintype.prod_bool, Fintype.sum_bool, Bool.false_eq_true, ↓reduceIte, neg_one_mul, mul_neg_one, sub_eq_add_neg, add_comm, mul_comm, mul_left_comm, mul_assoc] using hs · intro t rw [firstLogDensity, ← div_eq_mul_inv] apply (le_div_iff₀ (pow_pos (by positivity : 0 < 1 + ‖t‖) (J + 2))).mpr simpa only [mul_assoc, mul_left_comm, mul_comm] using hpoint t theorem actualFirstKernel_eq_separated {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F B : Finset ι) (hFB : Disjoint F B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (C₁ C₂ : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ : ℝ) (hX₁ : 0 < X₁) (hX₂ : 0 < X₂) (lengthScale : ℝ) (d h : O) (b : 𝓢(ℝ, ℂ)) (hsep : ∀ x y : ℝ, V₁ x * V₂ y * paperRadialFourier W (firstDualScale p (cubeActiveSupport B v ε₁ ε₂) lengthScale X₁ X₂ d h * Real.exp (-x-y)) = ∫ t : ℝ, (V₁ x * logPhase t (-x)) * (V₂ y * logPhase t (-y)) * b t) : actualFirstKernel p hp hcop hg F B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ lengthScale d h = ((lengthScale : ℂ) / (‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂, p i)‖ : ℂ)) * ∫ t : ℝ, b t * cubeBaseFactor p hp hg B v ε₁ ε₂ d h * idealPairReindex p hg F (cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ true (normalizedColumn p C₁) V₁ (columnLog p X₁) t d) (cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ false (normalizedColumn p C₂) V₂ (columnLog p X₂) t d) h := by have hs := cube_integral_of_radial_separation p hp hinj hcop hg hc hpr F B hFB v ε₁ ε₂ (normalizedColumn p C₁) (normalizedColumn p C₂) d h W V₁ V₂ (columnLog p X₁) (columnLog p X₂) (firstDualScale p (cubeActiveSupport B v ε₁ ε₂) lengthScale X₁ X₂ d h) b hsep simp only [cubeLogCoefficient, Bool.false_eq_true, ite_false, ite_true] rw [← hs.2] unfold actualFirstKernel rw [Finset.mul_sum] apply Finset.sum_congr rfl intro N hN rw [Finset.mul_sum] apply Finset.sum_congr rfl intro P hP by_cases hNP : Disjoint N P · rw [if_pos hNP, if_pos hNP] have hNB := hFB.mono_left (Finset.mem_powerset.mp hN) have hPB := hFB.mono_left (Finset.mem_powerset.mp hP) rw [actual_radial_argument p hp N P (cubeActiveSupport B v ε₁ ε₂) hNP (hNB.mono_right (Finset.filter_subset _ _)) (hPB.mono_right (Finset.filter_subset _ _)) lengthScale X₁ X₂ hX₁ hX₂ d h] have hpre := actual_pair_prefactor p hp hcop hg N P B hNP hNB hPB v ε₁ ε₂ C₁ C₂ lengthScale d h calc _ = (V₁ (columnLog p X₁ N) * V₂ (columnLog p X₂ P) * paperRadialFourier W (lengthScale * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * primeProductNorm p ((N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂)))) * (((lengthScale : ℂ) / (‖eisEmbedding (∏ i ∈ (N ∪ P) ∪ cubeActiveSupport B v ε₁ ε₂, p i)‖ : ℂ)) * threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h) := by ring _ = _ := by rw [hpre]; ring · simp [hNP] end FirstPassCubeLabels end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Poisson.QuadraticProfiles namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical SchwartzMap FourierTransform namespace EisensteinSchwartzPoisson open ActualEisensteinCubic ConcreteTraceCRT open ActualEisensteinCubic ConcreteTraceCRT QuadraticInitialBound theorem paperRadialFourier_nonzero_sum_uniform (W : 𝓢(ℝ, ℂ)) (K : ℝ) (hK : 0 < K) : K * ‖∑' h : O, if h = 0 then 0 else paperRadialFourier W (K * ‖eisEmbedding h‖ ^ 2)‖ ≤ pvControl W := by have hs := paperRadialFourier_lattice_summable_norm W K hK have he : (∑' h : O, if h = 0 then 0 else paperRadialFourier W (K * ‖eisEmbedding h‖ ^ 2)) = ∑' h : {h : O // h ≠ 0}, paperRadialFourier W (K * ‖eisEmbedding h.val‖ ^ 2) := by rw [← tsum_subtype_eq_of_support_subset (s := {h : O | h ≠ 0}) (by intro h hh hz subst h exact hh (by simp))] apply tsum_congr intro h simp only [if_neg h.property] rw [he] exact (mul_le_mul_of_nonneg_left (norm_tsum_le_tsum_norm (hs.subtype _)) hK.le).trans (pv_lattice_bound W K hK) theorem maskedPrincipalRemainder_uniform {α : Type*} [DecidableEq α] (P : α → Ideal O) [∀ i, (P i).IsMaximal] (S : Finset α) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : ‖maskedPrincipalRemainder P S W M‖ ≤ (2 : ℝ) ^ S.card * pvControl W := by let n := fun E : Finset α => (Ideal.absNorm (∏ i ∈ E, P i) : ℝ) have hn (E : Finset α) : 0 < n E := by dsimp [n] rw [← primeSubsetGenerator_norm_sq] exact sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero (primeSubsetGenerator_ne_zero P E))) let f := fun E : Finset α => ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) / (Ideal.absNorm (∏ i ∈ E, P i) : ℂ)) * ∑' h : O, if h = 0 then 0 else paperRadialFourier W (M * ‖eisEmbedding h‖ ^ 2 / n E) have hf (E : Finset α) : M * ‖f E‖ ≤ pvControl W := by have ht := paperRadialFourier_nonzero_sum_uniform W (M / n E) (div_pos hM (hn E)) have he (h : O) : M / n E * ‖eisEmbedding h‖ ^ 2 = M * ‖eisEmbedding h‖ ^ 2 / n E := by ring simp only [he] at ht have hm := norm_ideal_moebius_le_one (∏ i ∈ E, P i) dsimp only [f] rw [norm_mul, norm_div, Complex.norm_natCast] calc _ = ‖(UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ)‖ * ((M / n E) * ‖∑' h : O, if h = 0 then 0 else paperRadialFourier W (M * ‖eisEmbedding h‖ ^ 2 / n E)‖) := by dsimp [n]; ring _ ≤ 1 * pvControl W := mul_le_mul hm ht (by positivity) zero_le_one _ = _ := one_mul _ change ‖(M : ℂ) * ∑ E ∈ S.powerset, f E‖ ≤ _ rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hM] calc _ ≤ M * ∑ E ∈ S.powerset, ‖f E‖ := mul_le_mul_of_nonneg_left (norm_sum_le _ _) hM.le _ = ∑ E ∈ S.powerset, M * ‖f E‖ := Finset.mul_sum _ _ _ _ ≤ ∑ E ∈ S.powerset, pvControl W := Finset.sum_le_sum (fun E _ => hf E) _ = _ := by simp only [Finset.sum_const, Finset.card_powerset, nsmul_eq_mul, Nat.cast_pow, Nat.cast_ofNat] end EisensteinSchwartzPoisson open scoped BigOperators Classical namespace FirstPassCubeLabels open ActualEisensteinCubic MixedCrossSeparation FirstCauchyArithmetic RayFourExpansion theorem supportRay_star {ι : Type*} (p : ι → ActualEisensteinCubic.O) (χ : RayCharacter) (S : Finset ι) : supportRay p (star χ) S = star (supportRay p χ S) := by simp only [supportRay, rayCharacter, MulChar.star_apply] theorem supportRay_mul {ι : Type*} (p : ι → ActualEisensteinCubic.O) (χ η : RayCharacter) (S : Finset ι) : supportRay p (χ * η) S = supportRay p χ S * supportRay p η S := by simp only [supportRay, rayCharacter, MulChar.mul_apply] theorem columnG_ray_expansion {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (ActualEisensteinCubic.O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (S : Finset ι) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype columnG p hp hcop hg S = ∑ χ : RayCharacter, gCoeff χ * supportRay p χ S := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype have h := canonicalProductG_character_expansion (fun i : S => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop S) (fun i => hg i.val) (fun i => hc i.val) (fun i => hpr i.val) simpa only [columnG, supportRay, Finset.prod_coe_sort] using h def coreRayCharacter (negative : Bool) (χ ξ : RayCharacter) : RayCharacter := (if negative then star χ else χ) * ξ def coreRayCoefficient {ι : Type*} (p : ι → ActualEisensteinCubic.O) (F : Finset ι) (negative : Bool) (χ η ξ : RayCharacter) : ℂ := (if negative then star (crossCoeff χ η * supportRay p η F) else crossCoeff χ η * supportRay p η F) * gCoeff ξ theorem core_phase_ray_expansion {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (ActualEisensteinCubic.O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F S : Finset ι) (negative : Bool) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype (if negative then star (fixedRayExpansion p F S) else fixedRayExpansion p F S) * columnG p hp hcop hg S = ∑ χ : RayCharacter, ∑ η : RayCharacter, ∑ ξ : RayCharacter, coreRayCoefficient p F negative χ η ξ * supportRay p (coreRayCharacter negative χ ξ) S := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype rw [columnG_ray_expansion p hp hcop hg hc hpr S] cases negative <;> simp only [Bool.false_eq_true, ite_false, ite_true, fixedRayExpansion, star_sum, star_mul, Finset.sum_mul, Finset.mul_sum, coreRayCoefficient, coreRayCharacter, supportRay_mul, supportRay_star] · conv_lhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro χ _ conv_lhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro η _ apply Finset.sum_congr rfl intro ξ _ ring · conv_lhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro χ _ conv_lhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro η _ apply Finset.sum_congr rfl intro ξ _ ring theorem coreRayCoefficient_norm_le {ι : Type*} (p : ι → ActualEisensteinCubic.O) (F : Finset ι) (negative : Bool) (χ η ξ : RayCharacter) : ‖coreRayCoefficient p F negative χ η ξ‖ ≤ ‖crossCoeff χ η‖ * ‖gCoeff ξ‖ := by letI importedWitness0 := @OAI.RayFourExpansion.rayRingFintype have hη : ‖supportRay p η F‖ ≤ 1 := FiniteRayExpansion.norm_char_le_one η _ have hmul : ‖crossCoeff χ η‖ * ‖supportRay p η F‖ ≤ ‖crossCoeff χ η‖ := mul_le_of_le_one_right (norm_nonneg _) hη cases negative <;> simp only [coreRayCoefficient, Bool.false_eq_true, ite_false, ite_true, norm_mul, norm_star] all_goals exact mul_le_mul_of_nonneg_right hmul (norm_nonneg _) theorem coreRayCoefficient_mass {ι : Type*} (p : ι → ActualEisensteinCubic.O) (F : Finset ι) (negative : Bool) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype (∑ χ : RayCharacter, ∑ η : RayCharacter, ∑ ξ : RayCharacter, ‖coreRayCoefficient p F negative χ η ξ‖) ≤ 32 * 512 := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype calc _ ≤ ∑ χ : RayCharacter, ∑ η : RayCharacter, ∑ ξ : RayCharacter, ‖crossCoeff χ η‖ * ‖gCoeff ξ‖ := by gcongr with χ _ η _ ξ _ exact coreRayCoefficient_norm_le p F negative χ η ξ _ = (∑ χ : RayCharacter, ∑ η : RayCharacter, ‖crossCoeff χ η‖) * (∑ ξ : RayCharacter, ‖gCoeff ξ‖) := by simp only [← Finset.mul_sum, ← Finset.sum_mul] _ ≤ 512 * 32 := mul_le_mul crossCoeff_sum_norm_le gCoeff_sum_norm_le (by positivity) (by norm_num) _ = 32 * 512 := by ring def coreRayTwist (negative : Bool) (χ ξ : RayCharacter) : ActualEisensteinCubic.O →* ℂ where toFun a := rayCharacter (coreRayCharacter negative χ ξ) a map_one' := by simp [rayCharacter] map_mul' a b := rayCharacter_mul _ a b theorem coreRayTwist_prod {ι : Type*} (p : ι → ActualEisensteinCubic.O) (S : Finset ι) (negative : Bool) (χ ξ : RayCharacter) : coreRayTwist negative χ ξ (∏ i ∈ S, p i) = supportRay p (coreRayCharacter negative χ ξ) S := rfl end FirstPassCubeLabels open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory namespace FirstPassCubeLabels open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) end FirstPassCubeLabels open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory namespace FirstPassCubeLabels open ActualEisensteinCubic open FirstCauchyArithmetic (supportConjugateSum) open RayFourExpansion (RayCharacter crossCoeff) section FixedColumn variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) def dilatedCoreRow (t : ℝ) (z : O) : ℂ := dilatedRayColumn p hg F D (cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t) negative χ p B v ε₁ ε₂ c d z private theorem cubeCoreCoefficient_continuous (S : Finset ι) : Continuous (fun t : ℝ => cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t S) := by cases negative <;> simp only [cubeCoreCoefficient, Bool.false_eq_true, ite_false, ite_true] all_goals have h := FourierBridge.logPhase_continuous_left (-(y S)) fun_prop private theorem norm_cubeCoreCoefficient (S : Finset ι) (t : ℝ) : ‖cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t S‖ = ‖cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y 0 S‖ := by cases negative <;> simp only [cubeCoreCoefficient, Bool.false_eq_true, ite_false, ite_true, norm_mul, norm_star, FourierBridge.logPhase_norm] theorem dilatedCoreRow_continuous (z : O) : Continuous (fun t : ℝ => dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative χ C V y c d t z) := by unfold dilatedCoreRow dilatedRayColumn supportConjugateSum apply continuous_finsetSum intro U hU have h := cubeCoreCoefficient_continuous p hp hcop hg B v ε₁ ε₂ negative C V y (D ∪ U) fun_prop theorem dilatedCoreRow_uniform_bound (z : O) : ∃ M : ℝ, 0 ≤ M ∧ ∀ t, ‖dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative χ C V y c d t z‖ ≤ M := by let q := fun (t : ℝ) (U : Finset ι) => FirstCauchyArithmetic.supportMobius (fun i => Ideal.span {p i}) U * ((if negative then star (FirstCauchyArithmetic.supportRay p χ U) else FirstCauchyArithmetic.supportRay p χ U) * cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t (D ∪ U) * afterDilationLabel (fun i => Ideal.span {p i}) hg p B v ε₁ ε₂ c d U) * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U z) refine ⟨∑ U ∈ (F \ D).powerset, ‖q 0 U‖, by positivity, ?_⟩ intro t change ‖∑ U ∈ (F \ D).powerset, q t U‖ ≤ _ apply (norm_sum_le _ _).trans_eq apply Finset.sum_congr rfl intro U hU simp only [q, norm_mul, norm_cubeCoreCoefficient] theorem dilatedCoreRow_integrable (z : O) {k : ℝ → ℝ} (hk : Integrable k volume) : Integrable (fun t : ℝ => k t * ‖dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative χ C V y c d t z‖ ^ 2) volume := by obtain ⟨M, hM, hb⟩ := dilatedCoreRow_uniform_bound p hp hcop hg F D B v ε₁ ε₂ negative χ C V y c d z apply hk.mul_bdd (c := M ^ 2) · exact ((dilatedCoreRow_continuous p hp hcop hg F D B v ε₁ ε₂ negative χ C V y c d z).norm.pow 2).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun t => by rw [Real.norm_of_nonneg (sq_nonneg _)] exact pow_le_pow_left₀ (norm_nonneg _) (hb t) 2) end FixedColumn def firstRayIntegrand {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (r : RayCharacter × RayCharacter) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d f h : O) (b : 𝓢(ℝ, ℂ)) (t : ℝ) : ℝ := ‖b t‖ * ‖cubeBaseFactor p hp hg B v ε₁ ε₂ d h‖ * ‖rayPairWeight p r D h‖ * ‖rayIdealRow p hg F (cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ negative (originalLabelColumn p hg B ε₁ ε₂ negative C c f) V y t d) negative (if negative then r.1 else r.2) D h‖ ^ 2 theorem firstRayIntegrand_integrable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ j ∈ B, 0 < v j) (negative : Bool) (r : RayCharacter × RayCharacter) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d f h : O) (b : 𝓢(ℝ, ℂ)) : Integrable (firstRayIntegrand p hp hcop hg F D B v ε₁ ε₂ negative r C V y c d f h b) volume := by have hi := dilatedCoreRow_integrable p hp hcop hg F D B v ε₁ ε₂ negative (if negative then r.1 else r.2) C V y c d (h * f ^ 2 * dilationLabel p B v ε₁ ε₂) b.integrable.norm convert hi.mul_const (‖cubeBaseFactor p hp hg B v ε₁ ε₂ d h‖ * ‖rayPairWeight p r D h‖ * ‖beforeDilationLabel (fun i => Ideal.span {p i}) hg p B v ε₁ ε₂ negative c d f D‖ ^ 2) using 1 funext t simp only [firstRayIntegrand, rayIdealRow_cube_labels p hp hinj hcop hg F D B v ε₁ ε₂ hv, norm_mul, mul_pow, dilatedCoreRow] ring theorem first_ray_energy_integral (deltaLoss : ℝ) (hδ : 0 < deltaLoss) : ∃ K : ℝ, 0 < K ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (_hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (_hv : ∀ j ∈ B, 0 < v j) (negative : Bool) (r : RayCharacter × RayCharacter) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (s : Finset (Ideal O × O)) (T : Finset O) (w : Ideal O × O → ℂ) (b : Ideal O × O → 𝓢(ℝ, ℂ)) (J : ℕ) (M H Y : ℝ), 0 ≤ M → 0 ≤ H → 0 ≤ Y → (∀ x ∈ s, Squarefree x.1) → (∀ x ∈ s, DescentWeightedCauchy.firstElementRowMap (dilationLabel p B v ε₁ ε₂) x ∈ T) → (∀ z ∈ T, z ≠ 0) → (∀ z ∈ T, (Ideal.absNorm (Ideal.span {z}) : ℝ) ≤ Y) → (∀ x ∈ s, ‖w x‖ ≤ M) → (∀ x ∈ s, ∀ t : ℝ, ‖b x t‖ ≤ H * firstLogDensity J t) → (∑ x ∈ s, ‖w x‖ * ∫ t : ℝ, firstRayIntegrand p hp hcop hg F D B v ε₁ ε₂ negative r C V y c d (ConcretePrimeRowBridge.idealGenerator x.1) x.2 (b x) t) ≤ (M * H * K * Y ^ deltaLoss * ‖crossCoeff r.1 r.2‖) * ∫ t : ℝ, firstLogDensity J t * ∑ z ∈ T, ‖dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative (if negative then r.1 else r.2) C V y c d t z‖ ^ 2 := by obtain ⟨K, hK, hpoint⟩ := first_cube_energy_small_power deltaLoss hδ refine ⟨K, hK, ?_⟩ intro ι _ p hp _ hinj hcop hg hc F D B v ε₁ ε₂ hv negative r C V y c d s T w b J M H Y hM hH hY hs hmap hT hnorm hw hdom let Ψ := fun t z => dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative (if negative then r.1 else r.2) C V y c d t z let source := fun t : ℝ => ∑ x ∈ s, ‖w x‖ * firstRayIntegrand p hp hcop hg F D B v ε₁ ε₂ negative r C V y c d (ConcretePrimeRowBridge.idealGenerator x.1) x.2 (b x) t let target := fun t : ℝ => firstLogDensity J t * ∑ z ∈ T, ‖Ψ t z‖ ^ 2 have isource : Integrable source volume := by apply integrable_finsetSum intro x hx exact (firstRayIntegrand_integrable p hp hinj hcop hg F D B v ε₁ ε₂ hv negative r C V y c d _ _ (b x)).const_mul ‖w x‖ have itarget : Integrable target volume := by simp only [target, Finset.mul_sum] exact integrable_finsetSum _ (fun z hz => dilatedCoreRow_integrable p hp hcop hg F D B v ε₁ ε₂ negative (if negative then r.1 else r.2) C V y c d z (firstLogDensity_integrable J)) have hst (t : ℝ) : source t ≤ (M * H * K * Y ^ deltaLoss * ‖crossCoeff r.1 r.2‖) * target t := by let wt := fun x : Ideal O × O => w x * (b x t) * cubeBaseFactor p hp hg B v ε₁ ε₂ d x.2 * rayPairWeight p r D x.2 have hwt (x) (hx : x ∈ s) : ‖wt x‖ ≤ M * H * firstLogDensity J t * ‖crossCoeff r.1 r.2‖ := by simp only [wt, norm_mul] calc _ ≤ M * (H * firstLogDensity J t) * 1 * ‖crossCoeff r.1 r.2‖ := by have hden := firstLogDensity_nonneg J t gcongr <;> first | positivity | exact hw x hx | exact hdom x hx t | exact cubeBaseFactor_norm_le_one p hp hcop hg hc B v ε₁ ε₂ d x.2 | exact rayPairWeight_norm_le p hinj hc r D x.2 _ = _ := by ring have hh := hpoint p hp hinj hcop hg F D B v ε₁ ε₂ hv negative (if negative then r.1 else r.2) C V y t c d s T wt (M * H * firstLogDensity J t * ‖crossCoeff r.1 r.2‖) Y (by exact mul_nonneg (mul_nonneg (mul_nonneg hM hH) (firstLogDensity_nonneg J t)) (norm_nonneg _)) hY hs hmap hT hnorm hwt convert hh using 1 · apply Finset.sum_congr rfl intro x hx simp only [firstRayIntegrand, wt, norm_mul] ring · dsimp only [target, Ψ, dilatedCoreRow] ring calc _ = ∫ t : ℝ, source t := by rw [integral_finsetSum _ (fun x hx => (firstRayIntegrand_integrable p hp hinj hcop hg F D B v ε₁ ε₂ hv negative r C V y c d _ _ (b x)).const_mul ‖w x‖)] exact Finset.sum_congr rfl (fun x hx => (integral_const_mul _ _).symm) _ ≤ ∫ t : ℝ, (M * H * K * Y ^ deltaLoss * ‖crossCoeff r.1 r.2‖) * target t := integral_mono isource (itarget.const_mul _) hst _ = _ := integral_const_mul _ _ end FirstPassCubeLabels end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.FirstPassage namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid namespace FirstPassCubeLabels section open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory open ActualEisensteinCubic open RayFourExpansion (RayCharacter crossCoeff) theorem firstColumnEnergy_eq_sum_integrals {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ j ∈ B, 0 < v j) (negative : Bool) (C : Finset ι → ℂ) (V : ℝ → ℂ) (X : ℝ) (c d f h : O) (b : 𝓢(ℝ, ℂ)) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype firstColumnEnergy p hp hcop hg F B v ε₁ ε₂ negative (originalLabelColumn p hg B ε₁ ε₂ negative C c f) V X d h b = ∑ r : RayCharacter × RayCharacter, ∑ D ∈ F.powerset, ∫ t : ℝ, firstRayIntegrand p hp hcop hg F D B v ε₁ ε₂ negative r (normalizedColumn p C) V (columnLog p X) c d f h b t := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype have hi (r : RayCharacter × RayCharacter) (D : Finset ι) := firstRayIntegrand_integrable p hp hinj hcop hg F D B v ε₁ ε₂ hv negative r (normalizedColumn p C) V (columnLog p X) c d f h b calc _ = ∫ t : ℝ, ∑ r : RayCharacter × RayCharacter, ∑ D ∈ F.powerset, firstRayIntegrand p hp hcop hg F D B v ε₁ ε₂ negative r (normalizedColumn p C) V (columnLog p X) c d f h b t := by unfold firstColumnEnergy rw [normalized_originalLabelColumn] apply integral_congr_ae filter_upwards [] with t simp only [rayIdealEnergy, firstRayIntegrand, Finset.mul_sum, mul_assoc] _ = _ := by rw [integral_finsetSum _ (fun r hr => integrable_finsetSum _ (fun D hD => hi r D))] apply Finset.sum_congr rfl intro r hr exact integral_finsetSum _ (fun D hD => hi r D) theorem first_column_energy_integral (deltaLoss : ℝ) (hδ : 0 < deltaLoss) : ∃ K : ℝ, 0 < K ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (_hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (F B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (_hv : ∀ j ∈ B, 0 < v j) (negative : Bool) (C : Finset ι → ℂ) (V : ℝ → ℂ) (X : ℝ) (c d : O) (s : Finset (Ideal O × O)) (T : Finset O) (w : Ideal O × O → ℂ) (b : Ideal O × O → 𝓢(ℝ, ℂ)) (J : ℕ) (M H Y : ℝ), letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype 0 ≤ M → 0 ≤ H → 0 ≤ Y → (∀ x ∈ s, Squarefree x.1) → (∀ x ∈ s, DescentWeightedCauchy.firstElementRowMap (dilationLabel p B v ε₁ ε₂) x ∈ T) → (∀ z ∈ T, z ≠ 0) → (∀ z ∈ T, (Ideal.absNorm (Ideal.span {z}) : ℝ) ≤ Y) → (∀ x ∈ s, ‖w x‖ ≤ M) → (∀ x ∈ s, ∀ t : ℝ, ‖b x t‖ ≤ H * firstLogDensity J t) → (∑ x ∈ s, ‖w x‖ * firstColumnEnergy p hp hcop hg F B v ε₁ ε₂ negative (originalLabelColumn p hg B ε₁ ε₂ negative C c (ConcretePrimeRowBridge.idealGenerator x.1)) V X d x.2 (b x)) ≤ (M * H * K * Y ^ deltaLoss) * ∑ r : RayCharacter × RayCharacter, ∑ D ∈ F.powerset, ‖crossCoeff r.1 r.2‖ * ∫ t : ℝ, firstLogDensity J t * ∑ z ∈ T, ‖dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative (if negative then r.1 else r.2) (normalizedColumn p C) V (columnLog p X) c d t z‖ ^ 2 := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype obtain ⟨K, hK, hbound⟩ := first_ray_energy_integral deltaLoss hδ refine ⟨K, hK, ?_⟩ intro ι _ p hp _ hinj hcop hg hc F B v ε₁ ε₂ hv negative C V X c d s T w b J M H Y hM hH hY hs hmap hT hnorm hw hdom simp_rw [firstColumnEnergy_eq_sum_integrals p hp hinj hcop hg F B v ε₁ ε₂ hv, Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_le_sum intro r hr rw [Finset.sum_comm] apply Finset.sum_le_sum intro D hD have h := hbound p hp hinj hcop hg hc F D B v ε₁ ε₂ hv negative r (normalizedColumn p C) V (columnLog p X) c d s T w b J M H Y hM hH hY hs hmap hT hnorm hw hdom simpa only [mul_assoc, Finset.mul_sum] using h open ActualEisensteinCubic open RayFourExpansion (RayCharacter crossCoeff) open ConcreteTraceCRT (eisEmbedding) def firstOutputEnergy {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (C : Finset ι → ℂ) (V : ℝ → ℂ) (X : ℝ) (c d : O) (J : ℕ) (T : Finset O) : ℝ := letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype ∑ r : RayCharacter × RayCharacter, ∑ D ∈ F.powerset, ‖crossCoeff r.1 r.2‖ * ∫ t : ℝ, firstLogDensity J t * ∑ z ∈ T, ‖dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative (if negative then r.1 else r.2) (normalizedColumn p C) V (columnLog p X) c d t z‖ ^ 2 end open ActualEisensteinCubic open ConcretePrimeRowBridge (conjugateIdealRowSum mobiusIdealColumn idealPairPoissonKernel primePool mem_primePool_iff conjugateIdealRowSum_smoothed_summable conjugateIdealRowSum_smoothed_poisson) open FirstCauchyArithmetic (supportIdealFamily supportIdealFamily_pos supportIdealFamily_good recoveredSupport supportRay) open RayFourExpansion (RayCharacter) open ConcreteTraceCRT (eisEmbedding) end FirstPassCubeLabels namespace SecondPassArithmetic section abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic open MixedCrossSeparation (columnCoefficient columnG convertedColumnBlock quadraticCrossPhase columnPrimeCoprime columnCoefficient_cancel_false columnCoefficient_cancel_true) open FirstCauchyArithmetic (supportMobius activeGaussRowFactor) theorem columnCoefficient_norm_one {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (S : Finset ι) : ‖columnCoefficient p hp hcop hg S‖ = 1 := by rw [FirstPassCubeLabels.columnCoefficient_eq_gaussBlock, norm_mul, norm_star, FiniteGaussPhase.norm_angularFactor _ (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i)), FirstPassCubeLabels.gaussBlock_norm_one p hp hcop hg hc S (fun _ => 2) (fun _ _ => by decide) (fun _ _ => by decide), one_mul] theorem columnCoefficient_mul_star {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (S : Finset ι) : columnCoefficient p hp hcop hg S * star (columnCoefficient p hp hcop hg S) = 1 := by rw [← starRingEnd_apply, Complex.mul_conj', columnCoefficient_norm_one p hp hcop hg hc S] norm_num theorem convertedColumnBlock_restore {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (S : Finset ι) : convertedColumnBlock p hp hg S false = star (columnCoefficient p hp hcop hg S) * columnG p hp hcop hg S ∧ convertedColumnBlock p hp hg S true = columnCoefficient p hp hcop hg S * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (-1) * star (columnG p hp hcop hg S) := by have ha := columnCoefficient_mul_star p hp hcop hg hc S constructor · have h := congrArg (fun z => star (columnCoefficient p hp hcop hg S) * z) (columnCoefficient_cancel_false p hp hcop hg hc hpr S) calc _ = (columnCoefficient p hp hcop hg S * star (columnCoefficient p hp hcop hg S)) * convertedColumnBlock p hp hg S false := by rw [ha, one_mul] _ = _ := by convert h using 1 ; ring · have h := congrArg (fun z => columnCoefficient p hp hcop hg S * z) (columnCoefficient_cancel_true p hp hcop hg hc hpr S) calc _ = (columnCoefficient p hp hcop hg S * star (columnCoefficient p hp hcop hg S)) * convertedColumnBlock p hp hg S true := by rw [ha, one_mul] _ = _ := by convert h using 1 <;> ring def secondColumnMinus {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (C : Finset ι → ℂ) (e k : O) (S : Finset ι) : ℂ := columnCoefficient p hp hcop hg S * star (columnG p hp hcop hg S) * C S * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S e) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S k def secondColumnPlus {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (C : Finset ι → ℂ) (e k : O) (S : Finset ι) : ℂ := columnCoefficient p hp hcop hg S * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (-1) * star (columnG p hp hcop hg S) * C S * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S e) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S k theorem mobius_second_gauss_restore {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (S T : Finset ι) (hd : Disjoint S T) (C₁ C₂ : Finset ι → ℂ) (e k : O) : star (supportMobius (fun i => Ideal.span {p i}) S * C₁ S) * (supportMobius (fun i => Ideal.span {p i}) T * C₂ T) * activeGaussRowFactor p hp hinj hg T S e k = quadraticCrossPhase p hg T S * star (secondColumnMinus p hp hcop hg C₁ e k S) * secondColumnPlus p hp hcop hg C₂ e k T := by have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance have hmS := FirstCauchyArithmetic.supportMobius_sq _ hprime hinj S have hmT := FirstCauchyArithmetic.supportMobius_sq _ hprime hinj T have hr (u : O) : finiteSexticRow (activePrimes (fun i => Ideal.span {p i}) T S) (fun i => hg i.val) (activeExponent T S) u = star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg T u) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S u := by have hh := finiteSquarefreeRow_pair_activeSupport (fun i => Ideal.span {p i}) hg T S u simpa [Finset.disjoint_iff_inter_eq_empty.mp hd.symm, rowCoprimeMask] using hh.symm unfold activeGaussRowFactor dsimp only rw [FirstCauchyArithmetic.active_productGauss_eq_mobius_converted p hp hinj hg hc hpr, MixedCrossSeparation.activeConvertedGauss_eq_columnBlocks p hp hg hpr T S, Finset.sdiff_eq_self_of_disjoint hd.symm, Finset.sdiff_eq_self_of_disjoint hd, (convertedColumnBlock_restore p hp hcop hg hc hpr S).1, (convertedColumnBlock_restore p hp hcop hg hc hpr T).2, hr e, hr k] simp only [secondColumnMinus, secondColumnPlus, star_mul, star_star, FirstCauchyArithmetic.star_supportMobius] calc _ = (supportMobius (fun i => Ideal.span {p i}) S * supportMobius (fun i => Ideal.span {p i}) S) * (supportMobius (fun i => Ideal.span {p i}) T * supportMobius (fun i => Ideal.span {p i}) T) * (quadraticCrossPhase p hg T S * (star (columnCoefficient p hp hcop hg S) * columnG p hp hcop hg S * star (C₁ S) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S e * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S k)) * (columnCoefficient p hp hcop hg T * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg T (-1) * star (columnG p hp hcop hg T) * C₂ T * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg T e) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg T k)) := by ring _ = _ := by rw [hmS, hmT]; ring end section open ActualEisensteinCubic open MixedCrossSeparation (columnCoefficient) open FirstPassCubeLabels (row_union mask_union mask_mul) section Masks variable {ι : Type*} (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hg : ∀ i, lambda ∉ P i) (S : Finset ι) theorem mask_star_row (e : O) : rowCoprimeMask P S e * star (finiteSquarefreeRow P hg S e) = star (finiteSquarefreeRow P hg S e) := by by_cases h : ∃ i ∈ S, e ∈ P i · have hm : rowCoprimeMask P S e = 0 := by simp [rowCoprimeMask, h] rw [FirstPassCubeLabels.row_zero_of_mask_zero P hg S e hm] simp · simp [rowCoprimeMask, h] theorem second_child_masked (m r c d e k v : O) : rowCoprimeMask P S (m * (e * r)) * star (finiteSquarefreeRow P hg S e) * finiteSquarefreeRow P hg S d * finiteSquarefreeRow P hg S k * finiteSquarefreeRow P hg S c ^ 4 * finiteSquarefreeRow P hg S v ^ 4 = rowCoprimeMask P S (m * r) * finiteSquarefreeRow P hg S (d * e * k) * finiteSquarefreeRow P hg S (c * e * v) ^ 4 := by have hr := finiteSquarefreeRow_second_child P hg S d e k c 1 v simp only [mul_one] at hr rw [mask_mul P hg S m (e * r), mask_mul P hg S e r, mask_mul P hg S m r] calc _ = (rowCoprimeMask P S m * rowCoprimeMask P S r) * (rowCoprimeMask P S e * star (finiteSquarefreeRow P hg S e)) * finiteSquarefreeRow P hg S d * finiteSquarefreeRow P hg S k * finiteSquarefreeRow P hg S c ^ 4 * finiteSquarefreeRow P hg S v ^ 4 := by ring _ = _ := by rw [mask_star_row] have hh := congrArg (fun z : ℂ => (rowCoprimeMask P S m * rowCoprimeMask P S r) * z) hr convert hh using 1 <;> ring end Masks variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def secondPreColumn (Ψ : O →* ℂ) (m c d e k : O) (H : Finset ι → ℂ) (S : Finset ι) : ℂ := columnCoefficient p hp hcop hg S * Ψ (∏ i ∈ S, p i) * rowCoprimeMask (fun i => Ideal.span {p i}) S m * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S c ^ 4 * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S d * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S e) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S k * H S def secondChildColumn (Ψ : O →* ℂ) (m f y : O) (H : Finset ι → ℂ) (S : Finset ι) : ℂ := columnCoefficient p hp hcop hg S * Ψ (∏ i ∈ S, p i) * rowCoprimeMask (fun i => Ideal.span {p i}) S m * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S f ^ 4 * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S y * H S theorem secondPreColumn_union (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (Ψ : O →* ℂ) (m r c d e k : O) (H : Finset ι → ℂ) (V N : Finset ι) (hd : Disjoint V N) : secondPreColumn p hp hcop hg Ψ (m * (e * r)) c d e k H (V ∪ N) = secondPreColumn p hp hcop hg Ψ (m * (e * r)) c d e k (fun _ => 1) V * secondChildColumn p hp hcop hg Ψ (m * r) (c * e * ∏ i ∈ V, p i) (d * e * k) (fun U => H (V ∪ U)) N := by have hA := FirstPassCubeLabels.columnCoefficient_union_row_four p hp hcop hg hpr N V hd.symm rw [Finset.union_comm N V] at hA have hrow := second_child_masked (fun i => Ideal.span {p i}) hg N m r c d e k (∏ i ∈ V, p i) simp only [secondPreColumn, secondChildColumn, hA, Finset.prod_union hd, map_mul, row_union _ hg V N hd, mask_union _ hg V N hd, mul_pow, star_mul, mul_one] calc _ = (columnCoefficient p hp hcop hg V * Ψ (∏ i ∈ V, p i) * rowCoprimeMask (fun i => Ideal.span {p i}) V (m * (e * r)) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg V c ^ 4 * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg V d * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg V e) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg V k) * (columnCoefficient p hp hcop hg N * Ψ (∏ i ∈ N, p i) * (rowCoprimeMask (fun i => Ideal.span {p i}) N (m * (e * r)) * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N e) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N d * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N k * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N c ^ 4 * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N (∏ i ∈ V, p i) ^ 4) * H (V ∪ N)) := by ring _ = _ := by rw [hrow]; ring end open ActualEisensteinCubic open FirstCauchyArithmetic (supportMobius) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def secondCommonWeight (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k₁ k₂ : O) (V : Finset ι) : ℂ := supportMobius (fun i => Ideal.span {p i}) V * star (secondPreColumn p hp hcop hg Ψ₁ (m * (e * r)) c d e k₁ (fun _ => 1) V) * secondPreColumn p hp hcop hg Ψ₂ (m * (e * r)) c d e k₂ (fun _ => 1) V end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.RayCoefficients namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open MixedCrossSeparation (columnG columnPrimeCoprime quadraticCrossPhase) open FirstCauchyArithmetic (supportMobius activeGaussRowFactor) open RayFourExpansion (RayCharacter rayCharacter gCoeff crossCoeff) def rayMonoid (χ : RayCharacter) : O →* ℂ where toFun := rayCharacter χ map_one' := by simp [rayCharacter] map_mul' := RayFourExpansion.rayCharacter_mul χ def conjugateRayMonoid (χ : RayCharacter) : O →* ℂ := (starRingEnd ℂ).toMonoidHom.comp (rayMonoid χ) theorem rayMonoid_apply (χ : RayCharacter) (a : O) : rayMonoid χ a = rayCharacter χ a := rfl theorem conjugateRayMonoid_apply (χ : RayCharacter) (a : O) : conjugateRayMonoid χ a = star (rayCharacter χ a) := rfl variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem columnG_eq_ray_sum (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (S : Finset ι) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype columnG p hp hcop hg S = ∑ χ : RayCharacter, gCoeff χ * rayCharacter χ (∏ i ∈ S, p i) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype have h := RayFourExpansion.canonicalProductG_character_expansion (fun i : S => p i.val) (fun i => hp i.val) (columnPrimeCoprime p hcop S) (fun i => hg i.val) (fun i => hc i.val) (fun i => hpr i.val) simpa only [columnG, Finset.prod_coe_sort] using h def secondInputCoefficient (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (S : Finset ι) : ℂ := Ψ (∏ i ∈ S, p i) * rowCoprimeMask (fun i => Ideal.span {p i}) S m * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S c ^ 4 * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S d * H S theorem secondColumnMinus_ray_expansion (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (Ψ : O →* ℂ) (m c d e k : O) (H : Finset ι → ℂ) (S : Finset ι) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype secondColumnMinus p hp hcop hg (secondInputCoefficient p hg Ψ m c d H) e k S = ∑ χ : RayCharacter, star (gCoeff χ) * secondPreColumn p hp hcop hg (conjugateRayMonoid χ * Ψ) m c d e k H S := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype simp only [secondColumnMinus, columnG_eq_ray_sum p hp hcop hg hc hpr, star_sum, star_mul, Finset.mul_sum, Finset.sum_mul] apply Finset.sum_congr rfl intro χ hχ simp only [secondPreColumn, secondInputCoefficient, MonoidHom.mul_apply, conjugateRayMonoid_apply] ring theorem secondColumnPlus_ray_expansion (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (Ψ : O →* ℂ) (m c d e k : O) (H : Finset ι → ℂ) (S : Finset ι) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype secondColumnPlus p hp hcop hg (secondInputCoefficient p hg Ψ m c d H) e k S = ∑ χ : RayCharacter, star (gCoeff χ) * secondPreColumn p hp hcop hg (conjugateRayMonoid χ * Ψ) m c d e (-k) H S := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype have hk : finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (-k) = finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (-1) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S k := by simpa only [neg_one_mul] using finiteSquarefreeRow_mul (fun i => Ideal.span {p i}) hg S (-1) k simp only [secondColumnPlus, columnG_eq_ray_sum p hp hcop hg hc hpr, star_sum, star_mul, Finset.mul_sum, Finset.sum_mul] apply Finset.sum_congr rfl intro χ hχ simp only [secondPreColumn, secondInputCoefficient, MonoidHom.mul_apply, conjugateRayMonoid_apply, hk] ring theorem second_gauss_ray_expansion (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (Ψ₁ Ψ₂ : O →* ℂ) (m c d e k : O) (H₁ H₂ : Finset ι → ℂ) (S T : Finset ι) (hd : Disjoint S T) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype star (supportMobius (fun i => Ideal.span {p i}) S * secondInputCoefficient p hg Ψ₁ m c d H₁ S) * (supportMobius (fun i => Ideal.span {p i}) T * secondInputCoefficient p hg Ψ₂ m c d H₂ T) * activeGaussRowFactor p hp hinj hg T S e k = ∑ b : RayCharacter, ∑ a : RayCharacter, ∑ χ : RayCharacter, ∑ η : RayCharacter, (crossCoeff χ η * gCoeff a * star (gCoeff b)) * star (secondPreColumn p hp hcop hg (conjugateRayMonoid η * (conjugateRayMonoid a * Ψ₁)) m c d e k H₁ S) * secondPreColumn p hp hcop hg (rayMonoid χ * (conjugateRayMonoid b * Ψ₂)) m c d e (-k) H₂ T := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype rw [mobius_second_gauss_restore p hp hinj hcop hg hc hpr S T hd, secondColumnMinus_ray_expansion p hp hcop hg hc hpr, secondColumnPlus_ray_expansion p hp hcop hg hc hpr, RayFourExpansion.quadraticCrossPhase_character_expansion p hp hcop hg hc T S hd.symm] simp only [star_sum, star_mul, star_star, Finset.sum_mul, Finset.mul_sum] apply Finset.sum_congr rfl intro b hb apply Finset.sum_congr rfl intro a ha apply Finset.sum_congr rfl intro χ hχ apply Finset.sum_congr rfl intro η hη simp only [secondPreColumn, MonoidHom.mul_apply, conjugateRayMonoid_apply, rayMonoid_apply, star_mul, star_star] ring end section open ActualEisensteinCubic open FirstCauchyArithmetic (supportMobius activeGaussRowFactor) open RayFourExpansion (RayCharacter gCoeff crossCoeff) abbrev SecondRayIndex := (RayCharacter × RayCharacter) × (RayCharacter × RayCharacter) def secondRayCoefficient (r : SecondRayIndex) : ℂ := crossCoeff r.2.1 r.2.2 * gCoeff r.1.2 * star (gCoeff r.1.1) def secondRayMinus (Ψ : O →* ℂ) (r : SecondRayIndex) : O →* ℂ := conjugateRayMonoid r.2.2 * (conjugateRayMonoid r.1.2 * Ψ) def secondRayPlus (Ψ : O →* ℂ) (r : SecondRayIndex) : O →* ℂ := rayMonoid r.2.1 * (conjugateRayMonoid r.1.1 * Ψ) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def secondTotalWeight (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (z : SecondRayIndex × Finset ι) : ℂ := secondRayCoefficient z.1 * secondCommonWeight p hp hcop hg (secondRayMinus Ψ₁ z.1) (secondRayPlus Ψ₂ z.1) m r c d e k (-k) z.2 end open ActualEisensteinCubic variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem secondChildColumn_zero_of_overlap (Ψ : O →* ℂ) (m c e y : O) (H : Finset ι → ℂ) (V N : Finset ι) (hd : ¬ Disjoint V N) : secondChildColumn p hp hcop hg Ψ m (c * e * ∏ i ∈ V, p i) y H N = 0 := by obtain ⟨i, hiV, hiN⟩ := Finset.not_disjoint_iff.mp hd have hdiv : p i ∣ c * e * ∏ j ∈ V, p j := dvd_mul_of_dvd_right (Finset.dvd_prod_of_mem p hiV) (c * e) have hmask : rowCoprimeMask (fun i => Ideal.span {p i}) N (c * e * ∏ j ∈ V, p j) = 0 := by have hx : ∃ j ∈ N, c * e * ∏ a ∈ V, p a ∈ Ideal.span {p j} := ⟨i, hiN, Ideal.mem_span_singleton.mpr hdiv⟩ simp [rowCoprimeMask, hx] have hzero := FirstPassCubeLabels.row_zero_of_mask_zero (fun i => Ideal.span {p i}) hg N _ hmask simp only [secondChildColumn, hzero, zero_pow (by decide : (4 : ℕ) ≠ 0), mul_zero, zero_mul] end SecondPassArithmetic namespace CubicJacobiGlobal open ActualEisensteinCubic CompletedGauss CubicRamified theorem symbol_ne_zero_of_isCoprime (x a : O) (ha : lambda ^ 2 ∣ a-1) (hcop : IsCoprime x a) : symbol x a ≠ 0 := by classical have ha0 := primary_ne_zero a ha have hI0 : (Ideal.span {a} : Ideal O) ≠ 0 := Ideal.span_singleton_eq_bot.not.mpr ha0 rw [symbol, idealSymbol, if_neg hI0] apply Multiset.prod_ne_zero intro hzero obtain ⟨P,hP,hzero⟩ := Multiset.mem_map.mp hzero have hprime := UniqueFactorizationMonoid.prime_of_normalized_factor P hP let : P.IsMaximal := (Ideal.isPrime_of_prime hprime).isMaximal hprime.ne_zero have hle := ((Ideal.mem_normalizedFactors_iff hI0).mp hP).2 have haP : a ∈ P := hle (Ideal.subset_span (by simp)) have hg := primary_maximal_divisor_good a ha P haP have hxP : x ∉ P := by intro hxP obtain ⟨r,s,hrs⟩ := hcop have hmem := P.add_mem (P.mul_mem_left r hxP) (P.mul_mem_left s haP) rw [hrs] at hmem exact (Ideal.IsMaximal.ne_top (inferInstance : P.IsMaximal)) ((Ideal.eq_top_iff_one P).mpr hmem) rw [primeValue_eq P hg] at hzero exact cubicValue_ne_zero P hg x hxP hzero theorem primary_mul (a b : O) (ha : lambda ^ 2 ∣ a-1) (hb : lambda ^ 2 ∣ b-1) : lambda ^ 2 ∣ a*b-1 := by have h := dvd_add (dvd_mul_of_dvd_left ha b) hb convert h using 1 ; ring theorem primary_add_multiple_three (a c t : O) (ha : lambda ^ 2 ∣ a-1) : lambda ^ 2 ∣ (a+3*t*c)-1 := by have h := dvd_add ha (dvd_mul_of_dvd_left (dvd_mul_of_dvd_left lambda_sq_dvd_three t) c) convert h using 1 ; ring theorem kubota_mul_of_isCoprime (a b c d e g : O) (hdet : a*d-b*c=1) (ha : lambda ^ 2 ∣ a-1) (he : lambda ^ 2 ∣ e-1) (hb : (3 : O) ∣ b) (hg : (3 : O) ∣ g) (hag : IsCoprime a g) : symbol (c*e+d*g) (a*e+b*g) = symbol c a * symbol g e := by let productA := a*e+b*g let productC := c*e+d*g have hA : lambda ^ 2 ∣ productA-1 := by have h := dvd_add (primary_mul a e ha he) (dvd_mul_of_dvd_left (lambda_sq_dvd_three.trans hb) g) convert h using 1 ; dsimp [productA] ; ring have hrelation : a*productC-c*productA=g := by dsimp [productA,productC] linear_combination g*hdet have hcop : IsCoprime a productA := by obtain ⟨r,s,hrs⟩ := hag refine ⟨r+s*productC,-s*c,?_⟩ linear_combination hrs + s*hrelation have hnonzero := symbol_ne_zero_of_isCoprime a productA hA hcop have h1 : symbol a productA * symbol productC productA = symbol g productA := by rw [← symbol_mul_numerator _ _ productA hA] exact symbol_congr ⟨c, by linear_combination hrelation⟩ have h2 : symbol a productA * symbol c a = symbol g a := by rw [symbol_reciprocity a productA (primary_ne_zero a ha) (primary_ne_zero productA hA) ha hA, ← symbol_mul_numerator _ _ a ha] calc symbol (productA*c) a = symbol (-g) a := by apply symbol_congr refine ⟨productC,?_⟩ linear_combination -hrelation _ = symbol g a := symbol_neg_numerator g a ha have h3 : symbol g productA = symbol g a * symbol g e := by rw [← symbol_mul_denominator] apply symbol_denominator_congr g productA (a*e) hA (primary_mul a e ha he) · obtain ⟨b0,hb0⟩ := hb obtain ⟨g0,hg0⟩ := hg refine ⟨b0*g0,?_⟩ dsimp [productA] rw [hb0,hg0] ring · exact ⟨b,by dsimp [productA];ring⟩ change symbol productC productA = _ apply mul_left_cancel₀ hnonzero rw [h1,h3,← h2] ring lemma three_dvd_primary_sub_one (a : O) (ha : lambda ^ 2 ∣ a-1) : (3 : O) ∣ a-1 := by obtain ⟨A,B,rfl⟩ := exists_primaryCoord a ha rw [primaryCoord_eq] exact ⟨(A : O)+(B : O)*omega,by ring⟩ theorem exists_coprime_three_shift (a c g : O) (ha : lambda ^ 2 ∣ a-1) (hac : IsCoprime a c) (hg0 : g ≠ 0) : ∃ t : O, IsCoprime (a+3*t*c) g := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO classical let : StrongNormalizationMonoid O := UniqueFactorizationMonoid.strongNormalizationMonoid let s := (UniqueFactorizationMonoid.normalizedFactors g).filter (fun p => ¬p ∣ a) refine ⟨s.prod, ?_⟩ apply IsCoprime.symm apply isCoprime_of_prime_dvd (by rintro ⟨h,-⟩; exact hg0 h) intro p hp hpg hpnew by_cases hpa : p ∣ a · have hp3 : ¬p ∣ (3 : O) := by intro h3 have hsub : p ∣ a-1 := h3.trans (three_dvd_primary_sub_one a ha) have hone : p ∣ (1 : O) := by convert dvd_sub hpa hsub using 1 ; ring exact hp.not_dvd_one hone have hpc : ¬p ∣ c := by intro hpc exact hp.not_isUnit (hac.isUnit_of_dvd' hpa hpc) have hps : ¬p ∣ s.prod := by intro hdiv obtain ⟨q,hqs,hpq⟩ := hp.exists_mem_multiset_dvd hdiv have hqs' : q ∈ UniqueFactorizationMonoid.normalizedFactors g ∧ ¬q ∣ a := Multiset.mem_filter.mp hqs have hqprime := UniqueFactorizationMonoid.prime_of_normalized_factor q hqs'.1 have hqp : q ∣ p := (hp.associated_of_dvd hqprime hpq).dvd' exact hqs'.2 (hqp.trans hpa) have hpterm : p ∣ 3*s.prod*c := by convert dvd_sub hpnew hpa using 1 ; ring rcases hp.dvd_or_dvd hpterm with hleft | hright · rcases hp.dvd_or_dvd hleft with h3 | hs · exact hp3 h3 · exact hps hs · exact hpc hright · obtain ⟨q,hq,hpq⟩ := UniqueFactorizationMonoid.exists_mem_normalizedFactors_of_dvd hg0 hp.irreducible hpg have hqa : ¬q ∣ a := fun hqa => hpa (hpq.dvd.trans hqa) have hqs : q ∈ s := Multiset.mem_filter.mpr ⟨hq,hqa⟩ have hps : p ∣ s.prod := hpq.dvd.trans (Multiset.dvd_prod hqs) have hpterm : p ∣ 3*s.prod*c := dvd_mul_of_dvd_left (dvd_mul_of_dvd_right hps 3) c have hpa' : p ∣ a := by convert dvd_sub hpnew hpterm using 1 ; ring exact hpa hpa' lemma symbol_three_shift (c a t : O) (ha : lambda ^ 2 ∣ a-1) (hc : (3 : O) ∣ c) : symbol c (a+3*t*c) = symbol c a := by apply symbol_denominator_congr c (a+3*t*c) a (primary_add_multiple_three a c t ha) ha · obtain ⟨c0,hc0⟩ := hc refine ⟨t*c0,?_⟩ rw [hc0] ring · exact ⟨3*t,by ring⟩ theorem kubota_mul (a b c d e f g h : O) (hdet : a*d-b*c=1) (hdet' : e*h-f*g=1) (ha : lambda ^ 2 ∣ a-1) (he : lambda ^ 2 ∣ e-1) (hb : (3 : O) ∣ b) (hc : (3 : O) ∣ c) (hg : (3 : O) ∣ g) : symbol (c*e+d*g) (a*e+b*g) = symbol c a * symbol g e := by by_cases hg0 : g = 0 · have heh : e*h=1 := by simpa only [hg0,mul_zero,sub_zero] using hdet' have he1 : e=1 := A3_primary_unit_eq_one e (IsUnit.of_mul_eq_one h heh) he simp only [hg0,he1,mul_one,mul_zero,add_zero,symbol_one] have hac : IsCoprime a c := by refine ⟨d,-b,?_⟩ linear_combination hdet obtain ⟨t,ht⟩ := exists_coprime_three_shift a c g ha hac hg0 have hdetShift : (a+3*t*c)*d-(b+3*t*d)*c=1 := by linear_combination hdet have hbShift : (3 : O) ∣ b+3*t*d := dvd_add hb (dvd_mul_of_dvd_left (dvd_mul_right 3 t) d) have hcalc := kubota_mul_of_isCoprime (a+3*t*c) (b+3*t*d) c d e g hdetShift (primary_add_multiple_three a c t ha) he hbShift hg ht have hC : (3 : O) ∣ c*e+d*g := dvd_add (dvd_mul_of_dvd_left hc e) (dvd_mul_of_dvd_right hg d) have hA : lambda ^ 2 ∣ (a*e+b*g)-1 := by have hh := dvd_add (primary_mul a e ha he) (dvd_mul_of_dvd_left (lambda_sq_dvd_three.trans hb) g) convert hh using 1 ; ring calc symbol (c*e+d*g) (a*e+b*g) = symbol (c*e+d*g) ((a*e+b*g)+3*t*(c*e+d*g)) := (symbol_three_shift _ _ _ hA hC).symm _ = symbol c (a+3*t*c) * symbol g e := by convert hcalc using 1 ; congr 1 ; ring _ = symbol c a * symbol g e := by rw [symbol_three_shift c a t ha hc] end CubicJacobiGlobal open scoped BigOperators Classical MatrixGroups namespace CubicJacobiGlobal open ActualEisensteinCubic CubicRamified theorem symbol_cube_of_isCoprime (x a : O) (ha : lambda ^ 2 ∣ a-1) (hcop : IsCoprime x a) : symbol x a ^ 3 = 1 := by classical have hI0 : (Ideal.span {a} : Ideal O) ≠ 0 := Ideal.span_singleton_eq_bot.not.mpr (primary_ne_zero a ha) rw [symbol, idealSymbol, if_neg hI0, ← Multiset.prod_map_pow] apply Multiset.prod_eq_one intro y hy obtain ⟨P,hP,rfl⟩ := Multiset.mem_map.mp hy have hprime := UniqueFactorizationMonoid.prime_of_normalized_factor P hP let : P.IsMaximal := (Ideal.isPrime_of_prime hprime).isMaximal hprime.ne_zero have hle := ((Ideal.mem_normalizedFactors_iff hI0).mp hP).2 have haP : a ∈ P := hle (Ideal.subset_span (by simp)) have hg := primary_maximal_divisor_good a ha P haP have hxP : x ∉ P := by intro hxP obtain ⟨r,t,hrt⟩ := hcop have hmem := P.add_mem (P.mul_mem_left r hxP) (P.mul_mem_left t haP) rw [hrt] at hmem exact (Ideal.IsMaximal.ne_top (inferInstance : P.IsMaximal)) ((Ideal.eq_top_iff_one P).mpr hmem) rw [primeValue_eq P hg] exact cubicValue_cube P hg x hxP end CubicJacobiGlobal namespace CubicKubota abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic CubicJacobiGlobal CubicRamified def levelThree : Subgroup (SL(2, O)) := (Matrix.SpecialLinearGroup.map (n := Fin 2) (Ideal.Quotient.mk (Ideal.span {(3 : O)}))).ker lemma levelThree_entry (M : levelThree) (i j : Fin 2) : (3 : O) ∣ (M : SL(2,O)) i j - (if i=j then 1 else 0) := by have hm : Matrix.SpecialLinearGroup.map (n := Fin 2) (Ideal.Quotient.mk (Ideal.span {(3 : O)})) (M : SL(2,O)) = 1 := M.property have h := congrArg (fun N : SL(2, O ⧸ (Ideal.span {(3 : O)})) => N i j) hm change (Ideal.Quotient.mk (Ideal.span {(3 : O)})) ((M : SL(2,O)) i j) = (1 : Matrix (Fin 2) (Fin 2) (O ⧸ (Ideal.span {(3 : O)}))) i j at h apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp simpa only [Matrix.one_apply, apply_ite, map_one, map_zero] using h lemma levelThree_primary (M : levelThree) : lambda ^ 2 ∣ (M : SL(2,O)) 0 0 - 1 := by exact lambda_sq_dvd_three.trans (by simpa using levelThree_entry M 0 0) lemma levelThree_upper (M : levelThree) : (3 : O) ∣ (M : SL(2,O)) 0 1 := by simpa using levelThree_entry M 0 1 lemma levelThree_lower (M : levelThree) : (3 : O) ∣ (M : SL(2,O)) 1 0 := by simpa using levelThree_entry M 1 0 def value (M : levelThree) : O := symbol ((M : SL(2,O)) 1 0) ((M : SL(2,O)) 0 0) theorem value_mul (M N : levelThree) : value (M*N) = value M * value N := by have hM : (M : SL(2,O)) 0 0 * (M : SL(2,O)) 1 1 - (M : SL(2,O)) 0 1 * (M : SL(2,O)) 1 0 = 1 := by simpa only [Matrix.det_fin_two] using (M : SL(2,O)).property have hN : (N : SL(2,O)) 0 0 * (N : SL(2,O)) 1 1 - (N : SL(2,O)) 0 1 * (N : SL(2,O)) 1 0 = 1 := by simpa only [Matrix.det_fin_two] using (N : SL(2,O)).property have hh := kubota_mul ((M : SL(2,O)) 0 0) ((M : SL(2,O)) 0 1) ((M : SL(2,O)) 1 0) ((M : SL(2,O)) 1 1) ((N : SL(2,O)) 0 0) ((N : SL(2,O)) 0 1) ((N : SL(2,O)) 1 0) ((N : SL(2,O)) 1 1) hM hN (levelThree_primary M) (levelThree_primary N) (levelThree_upper M) (levelThree_lower M) (levelThree_lower N) change symbol (((M : SL(2,O)) * (N : SL(2,O))) 1 0) (((M : SL(2,O)) * (N : SL(2,O))) 0 0) = _ simpa only [value, Matrix.SpecialLinearGroup.coe_mul, Matrix.mul_apply, Fin.sum_univ_two] using hh theorem value_one : value 1 = 1 := by change symbol (0 : O) 1 = 1 exact symbol_one 0 def character : levelThree →* O where toFun := value map_one' := value_one map_mul' := value_mul theorem value_zero_lower_left (M : levelThree) (hc : (M : SL(2,O)) 1 0 = 0) : value M = 1 := by have hm : (M : SL(2,O)) 0 0 * (M : SL(2,O)) 1 1 = 1 := by have hd := (M : SL(2,O)).property simpa only [Matrix.det_fin_two, hc, mul_zero, sub_zero] using hd have ha := A3_primary_unit_eq_one _ (IsUnit.of_mul_eq_one _ hm) (levelThree_primary M) simp only [value, hc, ha, symbol_one] theorem value_cube (M : levelThree) : value M ^ 3 = 1 := by apply symbol_cube_of_isCoprime _ _ (levelThree_primary M) have hd : (M : SL(2,O)) 0 0 * (M : SL(2,O)) 1 1 - (M : SL(2,O)) 0 1 * (M : SL(2,O)) 1 0 = 1 := by simpa only [Matrix.det_fin_two] using (M : SL(2,O)).property refine ⟨-(M : SL(2,O)) 0 1, (M : SL(2,O)) 1 1, ?_⟩ linear_combination hd def complexCharacter : levelThree →* ℂ := ConcreteTraceCRT.eisEmbedding.toMonoidHom.comp character theorem complexCharacter_cube (M : levelThree) : complexCharacter M ^ 3 = 1 := by change ConcreteTraceCRT.eisEmbedding (value M) ^ 3 = 1 rw [← map_pow, value_cube, map_one] theorem norm_complexCharacter (M : levelThree) : ‖complexCharacter M‖ = 1 := by apply (pow_eq_one_iff_of_nonneg (norm_nonneg _) (by decide : (3 : ℕ) ≠ 0)).mp simpa only [norm_pow, norm_one] using congrArg norm (complexCharacter_cube M) end CubicKubota end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.SecondPoisson namespace OAI noncomputable section namespace SecondPassArithmetic open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid section open scoped BigOperators Classical SchwartzMap ContDiff section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open FirstCauchyArithmetic (activeGaussRowFactor) theorem masked_pair_second_poisson {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (M S T : Finset ι) (hd : Disjoint S T) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) : let n := ∏ i : activeSupport T S, p i.val (∑' z : O, rowCoprimeMask (fun i => Ideal.span {p i}) M z * (star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg T z) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S z) * W (‖eisEmbedding z‖ ^ 2 / Y)) = ((Y : ℂ) / (‖eisEmbedding n‖ : ℂ)) * ∑ E ∈ M.powerset, let e := primeSubsetGenerator (fun i => Ideal.span {p i}) E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, Ideal.span {p i}) : ℂ) / (‖eisEmbedding e‖ ^ 2 : ℝ)) * ∑' k : O, paperRadialFourier W (Y * ‖eisEmbedding k‖ ^ 2 / (‖eisEmbedding e‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) * activeGaussRowFactor p hp hinj hg T S e k := by dsimp only let P : ι → Ideal O := fun i => Ideal.span {p i} let Q := activePrimes P T S let q : activeSupport T S → O := fun i => p i.val let hQ := activePrimes_pairwise_isCoprime P hinj T S let j := activeExponent T S let row := finiteSexticRow Q (fun i => hg i.val) j let n := ∏ i, q i have hr (z : O) : star (finiteSquarefreeRow P hg T z) * finiteSquarefreeRow P hg S z = row z := by rw [finiteSquarefreeRow_pair_activeSupport] simp [Finset.disjoint_iff_inter_eq_empty.mp hd.symm, rowCoprimeMask, row, Q, j] have h := canonical_masked_radial_poisson_collected P hinj M Q hQ (fun i => hg i.val) (fun i => hc i.val) j (activeExponent_ne_zero T S) (activeExponent_lt_six T S) W Y hY have hn : ‖eisEmbedding (finitePrimeModulus Q)‖ = ‖eisEmbedding n‖ := GaussGeneratorTransport.finitePrimeModulus_norm_eq_product q dsimp only at h rw [hn] at h have ht := GaussGeneratorTransport.gauss_weighted_finite_radial_sum_transport q (fun i => hp i.val) hQ (fun i => hg i.val) j M.powerset (fun E => let e := primeSubsetGenerator P E (UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) * row e / (‖eisEmbedding e‖ ^ 2 : ℝ)) (fun E t => let e := primeSubsetGenerator P E paperRadialFourier W (Y * t / (‖eisEmbedding e‖ ^ 2 * ‖eisEmbedding n‖ ^ 2))) calc _ = ∑' z : O, rowCoprimeMask P M z * row z * W (‖eisEmbedding z‖ ^ 2 / Y) := by apply tsum_congr intro z rw [hr] _ = ((Y : ℂ) / (‖eisEmbedding n‖ : ℂ)) * (canonicalNormalizedGauss Q hQ (fun i => hg i.val) j * ∑ E ∈ M.powerset, ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) : ℂ) * row (primeSubsetGenerator P E) / (‖eisEmbedding (primeSubsetGenerator P E)‖ ^ 2 : ℝ)) * ∑' k : O, star (row k) * paperRadialFourier W (Y * ‖eisEmbedding k‖ ^ 2 / (‖eisEmbedding (primeSubsetGenerator P E)‖ ^ 2 * ‖eisEmbedding n‖ ^ 2))) := by rw [h] ring _ = _ := by rw [ht] simp only [Finset.mul_sum, ← tsum_mul_left] apply Finset.sum_congr rfl intro E hE apply tsum_congr intro k dsimp only [activeGaussRowFactor] ring end open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open FirstCauchyArithmetic (supportMobius activeGaussRowFactor) open FirstPassCubeLabels (columnLog primeProductNorm firstDualScale normalizedColumn) open FourierBridge (logPhase) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) def secondGaussTerm (hinj : Function.Injective (fun i => Ideal.span {p i})) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (H₁ H₂ : Finset ι → ℂ) (S T : Finset ι) : ℂ := star (supportMobius (fun i => Ideal.span {p i}) S * secondInputCoefficient p hg Ψ₁ (m * (e * r)) c d H₁ S) * (supportMobius (fun i => Ideal.span {p i}) T * secondInputCoefficient p hg Ψ₂ (m * (e * r)) c d H₂ T) * activeGaussRowFactor p hp hinj hg T S e k end section open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory section open ActualEisensteinCubic variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) open FirstPassCubeLabels (firstDualScale firstLogDensity primeProductNorm_pos) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end section open scoped BigOperators Classical open ActualEisensteinCubic open SecondPassFiber (OldTuple newLabel newRow Valid) theorem second_energy_selected_family {κ : Type*} [Fintype κ] (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ (s : Finset OldTuple) (t : Finset (Ideal O × O)) (b0 : Ideal O) (w : OldTuple → ℂ) (B lengthScale : ℝ) (P : κ → Ideal O × O → ℂ) (sel : OldTuple → κ), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ t) → (∀ z ∈ t, z.1 ≠ ⊥) → (∀ z ∈ t, (Ideal.absNorm z.1 : ℝ) ≤ lengthScale) → (∀ x ∈ s, ‖w x‖ ≤ B) → (∑ x ∈ s, ‖w x‖ * ‖P (sel x) (newLabel x, newRow x)‖ ^ 2) ≤ B * C * (lengthScale * Ideal.absNorm b0) ^ ε * ∑ u : κ, ∑ z ∈ t, ‖P u z‖ ^ 2 := by obtain ⟨C, hC, hb⟩ := SecondPassFiber.second_energy_pushforward ε hε refine ⟨C, hC, ?_⟩ intro s t b0 w B lengthScale P sel hb0 hB hL hvalid hmap ht hnorm hw calc _ ≤ ∑ x ∈ s, ‖w x‖ * ∑ u : κ, ‖P u (newLabel x, newRow x)‖ ^ 2 := by apply Finset.sum_le_sum intro x hx apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) exact Finset.single_le_sum (s := Finset.univ) (a := sel x) (f := fun u : κ => ‖P u (newLabel x, newRow x)‖ ^ 2) (fun u _ => sq_nonneg _) (Finset.mem_univ (sel x)) _ = ∑ u : κ, ∑ x ∈ s, ‖w x‖ * ‖P u (newLabel x, newRow x)‖ ^ 2 := by simp only [Finset.mul_sum] exact Finset.sum_comm _ ≤ ∑ u : κ, B * C * (lengthScale * Ideal.absNorm b0) ^ ε * ∑ z ∈ t, ‖P u z‖ ^ 2 := by exact Finset.sum_le_sum (fun u _ => hb s t b0 w (P u) B lengthScale hb0 hB hL hvalid hmap ht hnorm hw) _ = _ := by rw [Finset.mul_sum] end open scoped BigOperators Classical open ActualEisensteinCubic open ConcretePrimeRowBridge (idealGenerator span_idealGenerator) open SecondPassFiber (OldTuple newLabel newRow Valid) abbrev instFintypeUnitsO : Fintype Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units theorem exists_label_unit (f : O) (I : Ideal O) (hf : Ideal.span {f} = I) : ∃ u : Oˣ, f = (u : O) * idealGenerator I := by have hs : Ideal.span {idealGenerator I} = Ideal.span {f} := (span_idealGenerator I).trans hf.symm obtain ⟨u, hu⟩ := Ideal.span_singleton_eq_span_singleton.mp hs exact ⟨u, by simpa only [mul_comm] using hu.symm⟩ variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def fixedChildRow (F : Finset ι) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (f y : O) : ℂ := ∑ N ∈ F.powerset, secondChildColumn p hp hcop hg Ψ m f y H N def idealChildRow (F : Finset ι) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (negative : Bool) (u : Oˣ) (z : Ideal O × O) : ℂ := fixedChildRow p hp hcop hg F Ψ m H ((u : O) * idealGenerator z.1) (if negative then -z.2 else z.2) theorem idealChildRow_unit_energy_le (F : Finset ι) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (negative : Bool) (t : Finset (Ideal O × O)) (E : ℝ) (hE : ∀ u : Oˣ, (∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ m H negative u z‖ ^ 2) ≤ E) : let : Fintype Oˣ := instFintypeUnitsO (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ m H negative u z‖ ^ 2) ≤ 6 * E := by let : Fintype Oˣ := instFintypeUnitsO have hc : Fintype.card Oˣ = 6 := by simpa only [Nat.card_eq_fintype_card] using PrimaryIdealUnitReindex.card_units_eq_six calc _ ≤ ∑ u : Oˣ, E := Finset.sum_le_sum (fun u _ => hE u) _ = _ := by simp [hc] end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.Rows namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid section open scoped BigOperators Classical MatrixGroups section abbrev K := ActualEisensteinCubic.K abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic CubicKubota ConcreteTraceCRT def row (M : levelThree) : Fin 2 → O := (M : SL(2,O)) 1 lemma row_mul (M N : levelThree) : row (M*N) = Matrix.vecMul (row M) (N : SL(2,O)) := by funext j simp only [row, Subgroup.coe_mul, Matrix.SpecialLinearGroup.coe_mul, Matrix.mul_apply, Matrix.vecMul, dotProduct] lemma row_ne_zero (M : levelThree) : row M ≠ 0 := by intro hz have hc : (M : SL(2,O)) 1 0 = 0 := congrFun hz 0 have hd : (M : SL(2,O)) 1 1 = 0 := congrFun hz 1 have h : (M : SL(2,O)) 0 0 * (M : SL(2,O)) 1 1 - (M : SL(2,O)) 0 1 * (M : SL(2,O)) 1 0 = 1 := by simpa only [Matrix.det_fin_two] using (M : SL(2,O)).property simp only [hc, hd, mul_zero, sub_zero] at h exact zero_ne_one h lemma character_eq_of_row_eq (M N : levelThree) (hr : row M = row N) : complexCharacter M = complexCharacter N := by have hrow : row (M*N⁻¹) = row 1 := by rw [row_mul, hr, ← row_mul] simp have hc : ((M*N⁻¹ : levelThree) : SL(2,O)) 1 0 = 0 := by simpa [row, Matrix.one_apply] using congrFun hrow 0 have hchar : complexCharacter (M*N⁻¹) = 1 := by change eisEmbedding (value (M*N⁻¹)) = 1 rw [value_zero_lower_left _ hc, map_one] calc complexCharacter M = complexCharacter ((M*N⁻¹)*N) := by congr 1; group _ = complexCharacter (M*N⁻¹) * complexCharacter N := map_mul _ _ _ _ = complexCharacter N := by rw [hchar, one_mul] lemma row_eq_one_of_lower_left_zero (M : levelThree) (hc : (M : SL(2,O)) 1 0 = 0) : row M = row 1 := by have hdet : (M : SL(2,O)) 0 0 * (M : SL(2,O)) 1 1 = 1 := by have hd : (M : SL(2,O)) 0 0 * (M : SL(2,O)) 1 1 - (M : SL(2,O)) 0 1 * (M : SL(2,O)) 1 0 = 1 := by simpa only [Matrix.det_fin_two] using (M : SL(2,O)).property simpa only [hc, mul_zero, sub_zero] using hd have ha := A3_primary_unit_eq_one _ (IsUnit.of_mul_eq_one _ hdet) (levelThree_primary M) have hd : (M : SL(2,O)) 1 1 = 1 := by simpa only [ha, one_mul] using hdet funext j fin_cases j <;> simp [row, hc, hd] def cuspStabilizer : Subgroup levelThree where carrier := {M | row M = row 1} one_mem' := rfl mul_mem' := by intro M N hM hN change row (M*N) = row 1 rw [row_mul, hM, ← row_mul] simpa using hN inv_mem' := by intro M hM have h : row (M*M⁻¹) = row 1 := by simp rw [row_mul, hM, ← row_mul] at h simpa using h lemma mem_cuspStabilizer_iff (M : levelThree) : M ∈ cuspStabilizer ↔ (M : SL(2,O)) 1 0 = 0 := by constructor · intro h simpa [row, Matrix.one_apply] using congrFun h 0 · exact row_eq_one_of_lower_left_zero M lemma row_eq_iff_left_cusp (M N : levelThree) : row M = row N ↔ ∃ T : levelThree, T ∈ cuspStabilizer ∧ M = T*N := by constructor · intro h refine ⟨M*N⁻¹, ?_, by group⟩ change row (M*N⁻¹) = row 1 rw [row_mul, h, ← row_mul] simp · rintro ⟨T,hT,rfl⟩ change row T = row 1 at hT rw [row_mul, hT, ← row_mul, one_mul] def cuspRelation : Setoid levelThree := Setoid.ker row abbrev CuspCosets := Quotient cuspRelation def cosetOf (M : levelThree) : CuspCosets := Quotient.mk _ M lemma cosetOf_eq_iff (M N : levelThree) : cosetOf M = cosetOf N ↔ ∃ T : levelThree, T ∈ cuspStabilizer ∧ M = T*N := by rw [← row_eq_iff_left_cusp] exact Quotient.eq def cosetRow : CuspCosets → (Fin 2 → O) := Quotient.lift row (fun _ _ h => h) lemma cosetRow_cosetOf (M : levelThree) : cosetRow (cosetOf M) = row M := rfl lemma cosetRow_injective : Function.Injective cosetRow := by intro x y induction x using Quotient.inductionOn with | _ M => induction y using Quotient.inductionOn with | _ N => intro h exact Quotient.sound h lemma cosetRow_ne_zero (x : CuspCosets) : cosetRow x ≠ 0 := by induction x using Quotient.inductionOn with | _ M => exact row_ne_zero M def cosetCharacter : CuspCosets → ℂ := Quotient.lift complexCharacter (fun M N h => character_eq_of_row_eq M N h) lemma norm_cosetCharacter (x : CuspCosets) : ‖cosetCharacter x‖ = 1 := by induction x using Quotient.inductionOn with | _ M => exact norm_complexCharacter M def rightTranslate (M : levelThree) : CuspCosets → CuspCosets := Quotient.map (fun N => N*M) (by intro A B h change row (A*M) = row (B*M) rw [row_mul, row_mul, show row A = row B from h]) lemma rightTranslate_mul (M N : levelThree) (x : CuspCosets) : rightTranslate N (rightTranslate M x) = rightTranslate (M*N) x := by induction x using Quotient.inductionOn with | _ A => change cosetOf ((A*M)*N) = cosetOf (A*(M*N)) rw [mul_assoc] lemma rightTranslate_one (x : CuspCosets) : rightTranslate 1 x = x := by induction x using Quotient.inductionOn with | _ A => change cosetOf (A*1) = cosetOf A rw [mul_one] def rightEquiv (M : levelThree) : CuspCosets ≃ CuspCosets where toFun := rightTranslate M invFun := rightTranslate M⁻¹ left_inv x := by rw [rightTranslate_mul, mul_inv_cancel, rightTranslate_one] right_inv x := by rw [rightTranslate_mul, inv_mul_cancel, rightTranslate_one] lemma cosetRow_rightEquiv (M : levelThree) (x : CuspCosets) : cosetRow (rightEquiv M x) = Matrix.vecMul (cosetRow x) (M : SL(2,O)) := by induction x using Quotient.inductionOn with | _ N => exact row_mul N M lemma cosetCharacter_rightEquiv (M : levelThree) (x : CuspCosets) : cosetCharacter (rightEquiv M x) = cosetCharacter x * complexCharacter M := by induction x using Quotient.inductionOn with | _ N => exact map_mul _ _ _ def complexMatrix : levelThree →* SL(2,ℂ) := (Matrix.SpecialLinearGroup.map (n := Fin 2) eisEmbedding).comp levelThree.subtype lemma complexMatrix_apply (M : levelThree) (i j : Fin 2) : complexMatrix M i j = eisEmbedding ((M : SL(2,O)) i j) := rfl def embeddedRow (x : CuspCosets) : Fin 2 → ℂ := eisEmbedding ∘ cosetRow x lemma embeddedRow_ne_zero (x : CuspCosets) : embeddedRow x ≠ 0 := by intro hz apply cosetRow_ne_zero x funext i apply eisEmbedding_injective simpa only [embeddedRow, Function.comp_apply, Pi.zero_apply, map_zero] using congrFun hz i lemma embeddedRow_rightEquiv (M : levelThree) (x : CuspCosets) : embeddedRow (rightEquiv M x) = Matrix.vecMul (embeddedRow x) (complexMatrix M : SL(2,ℂ)) := by funext j simp only [embeddedRow, Function.comp_apply, cosetRow_rightEquiv, Matrix.vecMul, dotProduct, map_sum, map_mul, complexMatrix_apply] end section open ActualEisensteinCubic ConcreteTraceCRT def integerLattice : Submodule ℤ ((Fin 2 × Fin 2) → ℝ) := Submodule.span ℤ (Set.range (Pi.basisFun ℝ (Fin 2 × Fin 2))) def instDiscreteTopologySubtypeForallProdFinOfNatNatRealMemSubmoduleIntIntegerLattice : DiscreteTopology integerLattice := by unfold integerLattice infer_instance def instIsZLatticeRealForallProdFinOfNatNatIntegerLattice : letI : DiscreteTopology integerLattice := instDiscreteTopologySubtypeForallProdFinOfNatNatRealMemSubmoduleIntIntegerLattice IsZLattice ℝ integerLattice := by letI : DiscreteTopology integerLattice := instDiscreteTopologySubtypeForallProdFinOfNatNatRealMemSubmoduleIntIntegerLattice unfold integerLattice infer_instance def integerPoint (n : (Fin 2 × Fin 2) → ℤ) : integerLattice := ⟨fun i => (n i : ℝ), by rw [integerLattice, (Pi.basisFun ℝ (Fin 2 × Fin 2)).mem_span_iff_repr_mem ℤ] intro i exact ⟨n i, by simp⟩⟩ lemma integerPoint_injective : Function.Injective integerPoint := by intro a b hab funext i have h := congrArg (fun x : integerLattice => (x : (Fin 2 × Fin 2) → ℝ) i) hab change (a i : ℝ) = (b i : ℝ) at h exact_mod_cast h lemma integerPoint_norm (n : (Fin 2 × Fin 2) → ℤ) : ‖integerPoint n‖ = ‖n‖ := by change ‖fun i => (n i : ℝ)‖ = ‖n‖ apply le_antisymm · apply (pi_norm_le_iff_of_nonneg (norm_nonneg _)).mpr intro i simpa only [Real.norm_eq_abs, ← Int.norm_eq_abs] using norm_le_pi_norm n i · apply (pi_norm_le_iff_of_nonneg (norm_nonneg _)).mpr intro i simpa only [Real.norm_eq_abs, ← Int.norm_eq_abs] using norm_le_pi_norm (fun i => (n i : ℝ)) i lemma summable_integer_four_rpow (k : ℝ) (hk : 4 < k) : Summable (fun n : (Fin 2 × Fin 2) → ℤ => ‖n‖ ^ (-k)) := by letI : DiscreteTopology integerLattice := instDiscreteTopologySubtypeForallProdFinOfNatNatRealMemSubmoduleIntIntegerLattice letI : IsZLattice ℝ integerLattice := instIsZLatticeRealForallProdFinOfNatNatIntegerLattice have hf : Module.finrank ℤ integerLattice = 4 := by rw [ZLattice.rank ℝ integerLattice] simp have hs := ZLattice.summable_norm_rpow integerLattice (-k) (by rw [hf]; norm_num; linarith) apply (hs.comp_injective integerPoint_injective).congr intro n change ‖integerPoint n‖ ^ (-k) = ‖n‖ ^ (-k) rw [integerPoint_norm] def rowCoordinates (v : Fin 2 → O) : (Fin 2 × Fin 2) → ℤ := fun i => if i.2 = 0 then (ActualEisensteinCoordinates.coords (v i.1)).1 else (ActualEisensteinCoordinates.coords (v i.1)).2 lemma rowCoordinates_injective : Function.Injective rowCoordinates := by intro v w hvw funext i apply latticeCoordEquiv.injective apply Prod.ext · exact congrFun hvw (i,0) · exact congrFun hvw (i,1) lemma coordinates_norm_bound (v : Fin 2 → O) : ‖rowCoordinates v‖ ≤ 2 * ‖fun i => eisEmbedding (v i)‖ := by apply (pi_norm_le_iff_of_nonneg (by positivity)).mpr intro i have hi := norm_le_pi_norm (fun j => eisEmbedding (v j)) i.1 have hq := eisEmbedding_eval_norm_sq (ActualEisensteinCoordinates.coords (v i.1)).1 (ActualEisensteinCoordinates.coords (v i.1)).2 rw [ActualEisensteinCoordinates.eval_coords] at hq push_cast at hq have hcoord (a b : ℝ) (t : ℝ) (ht : 0 ≤ t) (heq : t ^ 2 = a*a-a*b+b*b) : |a| ≤ 2*t ∧ |b| ≤ 2*t := by constructor <;> apply (abs_le).mpr <;> constructor <;> nlinarith [sq_nonneg (a-b), sq_nonneg (a+b), sq_nonneg (a-2*b), sq_nonneg (b-2*a)] have hh := hcoord _ _ ‖eisEmbedding (v i.1)‖ (norm_nonneg _) hq dsimp only [rowCoordinates] split_ifs · simpa only [Int.norm_eq_abs] using hh.1.trans (mul_le_mul_of_nonneg_left hi (by norm_num)) · simpa only [Int.norm_eq_abs] using hh.2.trans (mul_le_mul_of_nonneg_left hi (by norm_num)) end open ActualEisensteinCubic CubicKubota ConcreteTraceCRT def rowEnergy (v : Fin 2 → ℂ) : ℝ := ‖v 0‖ ^ 2 + ‖v 1‖ ^ 2 lemma rowEnergy_nonneg (v : Fin 2 → ℂ) : 0 ≤ rowEnergy v := by unfold rowEnergy; positivity lemma norm_le_sqrt_rowEnergy (v : Fin 2 → ℂ) : ‖v‖ ≤ Real.sqrt (rowEnergy v) := by apply (pi_norm_le_iff_of_nonneg (Real.sqrt_nonneg _)).mpr intro i apply Real.le_sqrt_of_sq_le fin_cases i <;> dsimp [rowEnergy] <;> nlinarith [sq_nonneg ‖v 0‖, sq_nonneg ‖v 1‖] lemma rowEnergy_pos (v : Fin 2 → ℂ) (hv : v ≠ 0) : 0 < rowEnergy v := by have h := norm_le_sqrt_rowEnergy v have hn := norm_pos_iff.mpr hv exact Real.sqrt_pos.mp (lt_of_lt_of_le hn h) def rowOperator (g : SL(2,ℂ)) : (Fin 2 → ℂ) →L[ℂ] (Fin 2 → ℂ) := (Matrix.toLinearMapRight' (g : Matrix (Fin 2) (Fin 2) ℂ)).toContinuousLinearMap lemma rowOperator_apply (g : SL(2,ℂ)) (v : Fin 2 → ℂ) : rowOperator g v = Matrix.vecMul v (g : Matrix (Fin 2) (Fin 2) ℂ) := rfl lemma rowOperator_mul (g h : SL(2,ℂ)) (v : Fin 2 → ℂ) : rowOperator h (rowOperator g v) = rowOperator (g*h) v := by simp only [rowOperator_apply, Matrix.vecMul_vecMul, Matrix.SpecialLinearGroup.coe_mul] lemma rowOperator_one (v : Fin 2 → ℂ) : rowOperator 1 v = v := by simp only [rowOperator_apply, Matrix.SpecialLinearGroup.coe_one, Matrix.vecMul_one] lemma rowOperator_ne_zero (g : SL(2,ℂ)) (v : Fin 2 → ℂ) (hv : v ≠ 0) : rowOperator g v ≠ 0 := by intro hz have h := congrArg (rowOperator g⁻¹) hz rw [rowOperator_mul, mul_inv_cancel, rowOperator_one, map_zero] at h exact hv h def rowBound (g : SL(2,ℂ)) : ℝ := 2 * (1 + ‖rowOperator g⁻¹‖) lemma rowBound_pos (g : SL(2,ℂ)) : 0 < rowBound g := by unfold rowBound; positivity lemma coordinates_le_transformed_energy (g : SL(2,ℂ)) (v : Fin 2 → O) : ‖rowCoordinates v‖ ≤ rowBound g * Real.sqrt (rowEnergy (rowOperator g (fun i => eisEmbedding (v i)))) := by have hi := (rowOperator g⁻¹).le_opNorm (rowOperator g (fun i => eisEmbedding (v i))) rw [rowOperator_mul, mul_inv_cancel, rowOperator_one] at hi have hb := coordinates_norm_bound v have he := norm_le_sqrt_rowEnergy (rowOperator g (fun i => eisEmbedding (v i))) have hm := mul_le_mul_of_nonneg_left he (norm_nonneg (rowOperator g⁻¹)) dsimp only [rowBound] nlinarith [Real.sqrt_nonneg (rowEnergy (rowOperator g (fun i => eisEmbedding (v i))))] lemma norm_coordinates_ne_zero (x : CuspCosets) : 0 < ‖rowCoordinates (cosetRow x)‖ := by apply norm_pos_iff.mpr intro hz apply cosetRow_ne_zero x apply rowCoordinates_injective have hz0 : rowCoordinates (0 : Fin 2 → O) = 0 := by apply norm_le_zero_iff.mp have he : (fun i : Fin 2 => eisEmbedding ((0 : Fin 2 → O) i)) = (0 : Fin 2 → ℂ) := by funext i exact map_zero _ have hh := coordinates_norm_bound (0 : Fin 2 → O) rw [he, norm_zero, mul_zero] at hh exact hh rw [hz0] exact hz def summand (g : SL(2,ℂ)) (s : ℂ) (x : CuspCosets) : ℂ := (cosetCharacter x)⁻¹ * (rowEnergy (rowOperator g (embeddedRow x)) : ℂ) ^ (-s) lemma norm_summand (g : SL(2,ℂ)) (s : ℂ) (x : CuspCosets) : ‖summand g s x‖ = rowEnergy (rowOperator g (embeddedRow x)) ^ (-s.re) := by rw [summand, norm_mul, norm_inv, norm_cosetCharacter, inv_one, one_mul, Complex.norm_cpow_eq_rpow_re_of_pos (rowEnergy_pos _ (rowOperator_ne_zero g _ (embeddedRow_ne_zero x)))] rfl lemma norm_summand_bound (g : SL(2,ℂ)) (s : ℂ) (hs : 0 < s.re) (x : CuspCosets) : ‖summand g s x‖ ≤ (rowBound g) ^ (2*s.re) * ‖rowCoordinates (cosetRow x)‖ ^ (-(2*s.re)) := by rw [norm_summand] have hn := norm_coordinates_ne_zero x have hb := rowBound_pos g have he := rowEnergy_pos _ (rowOperator_ne_zero g _ (embeddedRow_ne_zero x)) have hbd := coordinates_le_transformed_energy g (cosetRow x) change ‖rowCoordinates (cosetRow x)‖ ≤ rowBound g * Real.sqrt (rowEnergy (rowOperator g (embeddedRow x))) at hbd have hle : (‖rowCoordinates (cosetRow x)‖ / rowBound g) ^ 2 ≤ rowEnergy (rowOperator g (embeddedRow x)) := by have hd : ‖rowCoordinates (cosetRow x)‖ / rowBound g ≤ Real.sqrt (rowEnergy (rowOperator g (embeddedRow x))) := (div_le_iff₀ hb).mpr (by simpa only [mul_comm] using hbd) have hsq := Real.sq_sqrt he.le nlinarith [div_pos hn hb, Real.sqrt_nonneg (rowEnergy (rowOperator g (embeddedRow x)))] have hp := Real.rpow_le_rpow_of_nonpos (sq_pos_of_pos (div_pos hn hb)) hle (by linarith : -s.re ≤ 0) convert hp using 1 rw [← Real.rpow_natCast_mul (div_nonneg hn.le hb.le) 2 (-s.re), Real.div_rpow hn.le hb.le] simp only [Nat.cast_ofNat, mul_neg, Real.rpow_neg hb.le, div_eq_mul_inv, inv_inv] exact mul_comm _ _ theorem summable_norm_summand (g : SL(2,ℂ)) (s : ℂ) (hs : 2 < s.re) : Summable (fun x : CuspCosets => ‖summand g s x‖) := by have hsum := summable_integer_four_rpow (2*s.re) (by linarith) have hinj : Function.Injective (fun x : CuspCosets => rowCoordinates (cosetRow x)) := rowCoordinates_injective.comp cosetRow_injective have hcomp : Summable (fun x : CuspCosets => ‖rowCoordinates (cosetRow x)‖ ^ (-(2*s.re))) := by apply (hsum.comp_injective hinj).congr intro x rfl exact (hcomp.mul_left ((rowBound g) ^ (2*s.re))).of_nonneg_of_le (fun _ => norm_nonneg _) (fun x => norm_summand_bound g s (by linarith) x) theorem summable_summand (g : SL(2,ℂ)) (s : ℂ) (hs : 2 < s.re) : Summable (summand g s) := (summable_norm_summand g s hs).of_norm def eisenstein (g : SL(2,ℂ)) (s : ℂ) : ℂ := ∑' x : CuspCosets, summand g s x lemma transformedRow_rightEquiv (M : levelThree) (g : SL(2,ℂ)) (x : CuspCosets) : rowOperator g (embeddedRow (rightEquiv M x)) = rowOperator (complexMatrix M * g) (embeddedRow x) := by rw [embeddedRow_rightEquiv, ← rowOperator_apply, rowOperator_mul] lemma summand_automorphy (M : levelThree) (g : SL(2,ℂ)) (s : ℂ) (x : CuspCosets) : summand (complexMatrix M * g) s x = complexCharacter M * summand g s (rightEquiv M x) := by have hM : complexCharacter M ≠ 0 := by intro h have hn := norm_complexCharacter M rw [h, norm_zero] at hn exact zero_ne_one hn simp only [summand, cosetCharacter_rightEquiv, transformedRow_rightEquiv, mul_inv_rev] rw [← mul_assoc, ← mul_assoc, mul_inv_cancel₀ hM, one_mul] theorem eisenstein_automorphy (M : levelThree) (g : SL(2,ℂ)) (s : ℂ) (hs : 2 < s.re) : eisenstein (complexMatrix M * g) s = complexCharacter M * eisenstein g s := by have hleft := summable_summand (complexMatrix M * g) s hs have hright := summable_summand g s hs have hreindex : HasSum (fun x : CuspCosets => summand g s (rightEquiv M x)) (eisenstein g s) := (rightEquiv M).hasSum_iff.mpr hright.hasSum have hscale := hreindex.mul_left (complexCharacter M) exact hleft.hasSum.unique (hscale.congr_fun (fun x => summand_automorphy M g s x)) lemma norm_summand_strip (g : SL(2,ℂ)) (a b : ℝ) (s : ℂ) (ha : a ≤ s.re) (hb : s.re ≤ b) (x : CuspCosets) : ‖summand g s x‖ ≤ ‖summand g (a : ℂ) x‖ + ‖summand g (b : ℂ) x‖ := by simp only [norm_summand, Complex.ofReal_re] have hq := rowEnergy_pos _ (rowOperator_ne_zero g _ (embeddedRow_ne_zero x)) by_cases hq1 : 1 ≤ rowEnergy (rowOperator g (embeddedRow x)) · exact (Real.rpow_le_rpow_of_exponent_le hq1 (neg_le_neg ha)).trans (le_add_of_nonneg_right (Real.rpow_nonneg hq.le _)) · exact (Real.rpow_le_rpow_of_exponent_ge hq (le_of_not_ge hq1) (neg_le_neg hb)).trans (le_add_of_nonneg_left (Real.rpow_nonneg hq.le _)) end open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic CubicKubota ConcreteTraceCRT def upperSection (z : ℂ) (v : ℝ) (hv : 0 < v) : SL(2,ℂ) := ⟨!![(Real.sqrt v : ℂ), z / (Real.sqrt v : ℂ); 0, (Real.sqrt v : ℂ)⁻¹], by have hr : (Real.sqrt v : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (Real.sqrt_pos.mpr hv).ne' simp [Matrix.det_fin_two, hr]⟩ lemma rowOperator_upperSection_zero (z : ℂ) (v : ℝ) (hv : 0 < v) (u : Fin 2 → ℂ) : rowOperator (upperSection z v hv) u 0 = u 0 * (Real.sqrt v : ℂ) := by change Matrix.vecMul u (!![(Real.sqrt v : ℂ), z / (Real.sqrt v : ℂ); 0, (Real.sqrt v : ℂ)⁻¹]) _ = _ simp [Matrix.vecMul, dotProduct, Fin.sum_univ_two] lemma rowOperator_upperSection_one (z : ℂ) (v : ℝ) (hv : 0 < v) (u : Fin 2 → ℂ) : rowOperator (upperSection z v hv) u 1 = (u 0*z + u 1) / (Real.sqrt v : ℂ) := by change Matrix.vecMul u (!![(Real.sqrt v : ℂ), z / (Real.sqrt v : ℂ); 0, (Real.sqrt v : ℂ)⁻¹]) _ = _ simp [Matrix.vecMul, dotProduct, Fin.sum_univ_two] ring def heightDenominator (z : ℂ) (v : ℝ) (u : Fin 2 → ℂ) : ℝ := ‖u 0*z + u 1‖ ^ 2 + ‖u 0‖ ^ 2 * v ^ 2 lemma rowEnergy_upperSection (z : ℂ) (v : ℝ) (hv : 0 < v) (u : Fin 2 → ℂ) : rowEnergy (rowOperator (upperSection z v hv) u) = heightDenominator z v u / v := by rw [rowEnergy, rowOperator_upperSection_zero, rowOperator_upperSection_one, norm_mul, norm_div, Complex.norm_real, Real.norm_of_nonneg (Real.sqrt_nonneg v), mul_pow, div_pow, Real.sq_sqrt hv.le] unfold heightDenominator field_simp ring lemma heightDenominator_pos (z : ℂ) (v : ℝ) (hv : 0 < v) (u : Fin 2 → ℂ) (hu : u ≠ 0) : 0 < heightDenominator z v u := by have h := rowEnergy_pos _ (rowOperator_ne_zero (upperSection z v hv) u hu) rw [rowEnergy_upperSection] at h exact ((div_pos_iff.mp h).resolve_right (by rintro ⟨_,hneg⟩; linarith)).1 def transformedHeight (z : ℂ) (v : ℝ) (u : Fin 2 → ℂ) : ℝ := v / heightDenominator z v u lemma summand_upperSection (z : ℂ) (v : ℝ) (hv : 0 < v) (s : ℂ) (x : CuspCosets) : summand (upperSection z v hv) s x = (cosetCharacter x)⁻¹ * (transformedHeight z v (embeddedRow x) : ℂ) ^ s := by rw [summand, rowEnergy_upperSection] congr 1 have hq := heightDenominator_pos z v hv (embeddedRow x) (embeddedRow_ne_zero x) have hinv : (transformedHeight z v (embeddedRow x) : ℂ) = ((heightDenominator z v (embeddedRow x) / v : ℝ) : ℂ)⁻¹ := by simp only [transformedHeight, Complex.ofReal_div, inv_div] rw [hinv, Complex.inv_cpow_ofReal_nonneg (div_nonneg hq.le hv.le), Complex.cpow_neg] def upperEisenstein (z : ℂ) (v : ℝ) (hv : 0 < v) (s : ℂ) : ℂ := eisenstein (upperSection z v hv) s lemma ofReal_rowEnergy (u : Fin 2 → ℂ) : (rowEnergy u : ℂ) = dotProduct u (star u) := by simp only [rowEnergy, Complex.ofReal_add, ← Complex.normSq_eq_norm_sq, dotProduct, Fin.sum_univ_two, Pi.star_apply, Complex.star_def, Complex.mul_conj] lemma rowEnergy_unitary (k : SL(2,ℂ)) (hk : (k : Matrix (Fin 2) (Fin 2) ℂ) ∈ Matrix.unitaryGroup (Fin 2) ℂ) (u : Fin 2 → ℂ) : rowEnergy (rowOperator k u) = rowEnergy u := by apply Complex.ofReal_injective rw [ofReal_rowEnergy, ofReal_rowEnergy, rowOperator_apply, Matrix.star_vecMul, Matrix.dotProduct_mulVec, Matrix.vecMul_vecMul] have hu := Matrix.mem_unitaryGroup_iff.mp hk change (k : Matrix (Fin 2) (Fin 2) ℂ) * Matrix.conjTranspose (k : Matrix (Fin 2) (Fin 2) ℂ) = 1 at hu rw [hu, Matrix.vecMul_one] theorem eisenstein_right_unitary (g k : SL(2,ℂ)) (s : ℂ) (hk : (k : Matrix (Fin 2) (Fin 2) ℂ) ∈ Matrix.unitaryGroup (Fin 2) ℂ) : eisenstein (g*k) s = eisenstein g s := by apply tsum_congr intro x simp only [summand, ← rowOperator_mul, rowEnergy_unitary k hk] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.PrimitiveRows /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid namespace CubicEisenstein open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic CubicKubota ConcreteTraceCRT lemma levelThree_of_entries (M : SL(2,O)) (h : ∀ i j : Fin 2, (3 : O) ∣ M i j - (if i=j then 1 else 0)) : M ∈ levelThree := by change Matrix.SpecialLinearGroup.map (n := Fin 2) (Ideal.Quotient.mk (Ideal.span {(3 : O)})) M = 1 apply Subtype.ext funext i j change Ideal.Quotient.mk (Ideal.span {(3 : O)}) (M i j) = (1 : Matrix (Fin 2) (Fin 2) (O ⧸ Ideal.span {(3 : O)})) i j have hh : Ideal.Quotient.mk (Ideal.span {(3 : O)}) (M i j) = Ideal.Quotient.mk (Ideal.span {(3 : O)}) (if i=j then 1 else 0) := (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr (Ideal.mem_span_singleton.mpr (h i j)) simpa only [Matrix.one_apply, apply_ite, map_one, map_zero] using hh lemma row_coprime (M : levelThree) : IsCoprime (row M 0) (row M 1) := by have h : (M : SL(2,O)) 0 0*(M : SL(2,O)) 1 1 - (M : SL(2,O)) 0 1*(M : SL(2,O)) 1 0 = 1 := by simpa only [Matrix.det_fin_two] using (M : SL(2,O)).property refine ⟨-(M : SL(2,O)) 0 1, (M : SL(2,O)) 0 0, ?_⟩ change -(M : SL(2,O)) 0 1*(M : SL(2,O)) 1 0 + (M : SL(2,O)) 0 0*(M : SL(2,O)) 1 1 = 1 linear_combination h lemma exists_matrix_of_primitive_row (c d : O) (hcop : IsCoprime c d) (hc : (3 : O) ∣ c) (hd : (3 : O) ∣ d-1) : ∃ M : levelThree, row M = ![c,d] := by obtain ⟨r,s,hrs⟩ := hcop let M : SL(2,O) := ⟨!![s+r*c,r*(d-1); c,d], by rw [Matrix.det_fin_two] change (s+r*c)*d-(r*(d-1))*c=1 linear_combination hrs⟩ have hA : s+r*c-1 = -s*(d-1) := by linear_combination hrs have hM : M ∈ levelThree := by apply levelThree_of_entries intro i j fin_cases i <;> fin_cases j · change (3 : O) ∣ s+r*c-1 rw [hA] exact hd.mul_left (-s) · change (3 : O) ∣ r*(d-1)-0 simpa only [sub_zero] using hd.mul_left r · change (3 : O) ∣ c-(if (1 : Fin 2)=0 then 1 else 0) simpa only [show (1 : Fin 2) ≠ 0 by decide, ite_false, sub_zero] using hc · change (3 : O) ∣ d-1 exact hd exact ⟨⟨M,hM⟩, rfl⟩ def PrimitiveRow := {v : Fin 2 → O // IsCoprime (v 0) (v 1) ∧ (3 : O) ∣ v 0 ∧ (3 : O) ∣ v 1-1} def cosetPrimitiveRow (x : CuspCosets) : PrimitiveRow := ⟨cosetRow x, by induction x using Quotient.inductionOn with | _ M => change IsCoprime (row M 0) (row M 1) ∧ (3 : O) ∣ row M 0 ∧ (3 : O) ∣ row M 1-1 exact ⟨row_coprime M, levelThree_lower M, by simpa [row] using levelThree_entry M 1 1⟩⟩ lemma cosetPrimitiveRow_bijective : Function.Bijective cosetPrimitiveRow := by constructor · intro x y hxy exact cosetRow_injective (congrArg Subtype.val hxy) · intro v obtain ⟨M,hM⟩ := exists_matrix_of_primitive_row (v.1 0) (v.1 1) v.2.1 v.2.2.1 v.2.2.2 refine ⟨cosetOf M, ?_⟩ apply Subtype.ext change row M = v.1 rw [hM] funext i fin_cases i <;> rfl def primitiveRowEquiv : CuspCosets ≃ PrimitiveRow := Equiv.ofBijective _ cosetPrimitiveRow_bijective open ActualEisensteinCubic CubicKubota ConcreteTraceCRT CubicJacobiGlobal lemma inverse_character_eq_row_symbol (M : levelThree) : (complexCharacter M)⁻¹ = eisEmbedding (symbol (row M 0) (row M 1)) := by let a := (M : SL(2,O)) 0 0 let b := (M : SL(2,O)) 0 1 let c := (M : SL(2,O)) 1 0 let d := (M : SL(2,O)) 1 1 have hdet : a*d-b*c=1 := by simpa only [a,b,c,d,Matrix.det_fin_two] using (M : SL(2,O)).property have had : a*d-1=b*c := by linear_combination hdet have ha : lambda^2 ∣ a-1 := levelThree_primary M have hd3 : (3 : O) ∣ d-1 := by simpa [d] using levelThree_entry M 1 1 have hd : lambda^2 ∣ d-1 := lambda_sq_dvd_three.trans hd3 obtain ⟨b0,hb⟩ := levelThree_upper M obtain ⟨c0,hc⟩ := levelThree_lower M change b=3*b0 at hb change c=3*c0 at hc have h9 : (9 : O) ∣ a*d-1 := by refine ⟨b0*c0, ?_⟩ rw [had,hb,hc] ring have hcd : c ∣ a*d-1 := by rw [had]; exact dvd_mul_left c b have hs := symbol_denominator_congr c (a*d) 1 (primary_mul a d ha hd) (by simp) h9 hcd rw [symbol_mul_denominator, symbol_one] at hs have hm : eisEmbedding (symbol c a)*eisEmbedding (symbol c d)=1 := by simpa only [map_mul, map_one] using congrArg eisEmbedding hs change (eisEmbedding (symbol c a))⁻¹ = eisEmbedding (symbol c d) exact inv_eq_of_mul_eq_one_right hm lemma inverse_cosetCharacter_eq_row_symbol (x : CuspCosets) : (cosetCharacter x)⁻¹ = eisEmbedding (symbol (cosetRow x 0) (cosetRow x 1)) := by induction x using Quotient.inductionOn with | _ M => exact inverse_character_eq_row_symbol M lemma primitiveRowEquiv_symm_row (v : PrimitiveRow) : cosetRow (primitiveRowEquiv.symm v) = v.1 := by exact congrArg Subtype.val (primitiveRowEquiv.apply_symm_apply v) end CubicEisenstein open scoped BigOperators Classical SchwartzMap namespace TruncatedPrincipalPoisson section namespace RootNotationPrimitiveRows01 abbrev O := ActualEisensteinCubic.O end RootNotationPrimitiveRows01 open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson def radialSource (W : ℝ → ℂ) (X : ℝ) : ℂ := ∑' z : RootNotationPrimitiveRows01.O, if z = 0 then 0 else W (‖eisEmbedding z‖ ^ 2 / X) def radialDual (W : ℝ → ℂ) (X : ℝ) : ℂ := ∑' h : RootNotationPrimitiveRows01.O, if h = 0 then 0 else paperRadialFourier W (X * ‖eisEmbedding h‖ ^ 2) theorem radialSource_summable (W : 𝓢(ℝ, ℂ)) (X : ℝ) (hX : 0 < X) : Summable (fun z : RootNotationPrimitiveRows01.O => if z = 0 then 0 else W (‖eisEmbedding z‖ ^ 2 / X)) := by have hs : Summable (fun z : RootNotationPrimitiveRows01.O => W (‖eisEmbedding z‖ ^ 2 / X)) := by simpa only [scaledRadialTest_apply] using (actual_eisenstein_summable_norm (scaledRadialTest W X hX)).of_norm apply (hs.indicator {z : RootNotationPrimitiveRows01.O | z ≠ 0}).congr intro z by_cases hz : z = 0 <;> simp [hz] theorem radialSource_poisson (W : 𝓢(ℝ, ℂ)) (X : ℝ) (hX : 0 < X) : radialSource W X = (X : ℂ) * paperRadialFourier W 0 - W 0 + (X : ℂ) * radialDual W X := by let P : Empty → Ideal RootNotationPrimitiveRows01.O := Empty.elim let : ∀ i, (P i).IsMaximal := fun i => nomatch i have hi : Function.Injective P := by intro i; cases i have hp := masked_principal_radial_poisson_zero_split P hi ∅ W X hX simp only [maskedPrincipalRemainder, Finset.prod_empty, Finset.powerset_empty, Finset.sum_singleton, UniqueFactorizationMonoid.moebius_one, map_one, Int.cast_one, Nat.cast_one, div_one, mul_one] at hp simp only [rowCoprimeMask, Finset.notMem_empty, false_and, exists_false, ite_false, one_mul] at hp have hs : Summable (fun z : RootNotationPrimitiveRows01.O => W (‖eisEmbedding z‖ ^ 2 / X)) := by simpa only [scaledRadialTest_apply] using (actual_eisenstein_summable_norm (scaledRadialTest W X hX)).of_norm have hz := hs.tsum_eq_add_tsum_ite 0 simp only [map_zero, norm_zero, zero_pow (by decide : 2 ≠ 0), zero_div] at hz change (∑' z : RootNotationPrimitiveRows01.O, W (‖eisEmbedding z‖ ^ 2 / X)) = (X : ℂ) * paperRadialFourier W 0 + (X : ℂ) * radialDual W X at hp change (∑' z : RootNotationPrimitiveRows01.O, W (‖eisEmbedding z‖ ^ 2 / X)) = W 0 + radialSource W X at hz linear_combination hp - hz def subsetNorm {ι : Type*} (P : ι → Ideal RootNotationPrimitiveRows01.O) (E : Finset ι) : ℝ := Ideal.absNorm (∏ i ∈ E, P i) def subsetMobius {ι : Type*} (P : ι → Ideal RootNotationPrimitiveRows01.O) (E : Finset ι) : ℂ := UniqueFactorizationMonoid.moebius (∏ i ∈ E, P i) def smallDivisors {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows01.O) (S : Finset ι) (Z : ℝ) := S.powerset.filter (fun E => subsetNorm P E ≤ Z) def largeDivisors {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows01.O) (S : Finset ι) (Z : ℝ) := S.powerset.filter (fun E => Z < subsetNorm P E) theorem subsetNorm_pos {ι : Type*} (P : ι → Ideal RootNotationPrimitiveRows01.O) [∀ i, (P i).IsMaximal] (E : Finset ι) : 0 < subsetNorm P E := by rw [subsetNorm, ← primeSubsetGenerator_norm_sq] exact sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero (primeSubsetGenerator_ne_zero P E))) theorem sum_small_add_large {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows01.O) (S : Finset ι) (Z : ℝ) (f : Finset ι → ℂ) : (∑ E ∈ smallDivisors P S Z, f E) + (∑ E ∈ largeDivisors P S Z, f E) = ∑ E ∈ S.powerset, f E := by simpa only [smallDivisors, largeDivisors, not_le] using Finset.sum_filter_add_sum_filter_not S.powerset (fun E => subsetNorm P E ≤ Z) f theorem masked_radialSource_dilations {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows01.O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (W : 𝓢(ℝ, ℂ)) (X : ℝ) (hX : 0 < X) : (∑' z : RootNotationPrimitiveRows01.O, rowCoprimeMask P S z * (if z = 0 then 0 else W (‖eisEmbedding z‖ ^ 2 / X))) = ∑ E ∈ S.powerset, subsetMobius P E * radialSource W (X / subsetNorm P E) := by rw [tsum_rowCoprimeMask_dilations P hinj S _ (radialSource_summable W X hX)] apply Finset.sum_congr rfl intro E hE change subsetMobius P E * _ = _ congr 1 apply tsum_congr intro z rw [mul_eq_zero, or_iff_right (primeSubsetGenerator_ne_zero P E)] by_cases hz : z = 0 · simp [hz] · rw [ite_eq_right hz, ite_eq_right hz, map_mul, norm_mul, mul_pow, primeSubsetGenerator_norm_sq] congr 1 simp only [subsetNorm, div_div_eq_mul_div] ring theorem masked_radialSource_truncated {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows01.O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (W : 𝓢(ℝ, ℂ)) (X Z : ℝ) (hX : 0 < X) : (∑' z : RootNotationPrimitiveRows01.O, rowCoprimeMask P S z * (if z = 0 then 0 else W (‖eisEmbedding z‖ ^ 2 / X))) = (X : ℂ) * paperRadialFourier W 0 * (∑ E ∈ smallDivisors P S Z, subsetMobius P E / (subsetNorm P E : ℂ)) - W 0 * (∑ E ∈ smallDivisors P S Z, subsetMobius P E) + (X : ℂ) * (∑ E ∈ smallDivisors P S Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * radialDual W (X / subsetNorm P E)) + (∑ E ∈ largeDivisors P S Z, subsetMobius P E * radialSource W (X / subsetNorm P E)) := by rw [masked_radialSource_dilations P hinj S W X hX, ← sum_small_add_large P S Z] congr 1 simp only [Finset.mul_sum, ← Finset.sum_sub_distrib, ← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro E hE rw [radialSource_poisson W _ (div_pos hX (subsetNorm_pos P E))] push_cast ring theorem masked_radialSource_truncated_euler {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows01.O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (W : 𝓢(ℝ, ℂ)) (X Z : ℝ) (hX : 0 < X) : (∑' z : RootNotationPrimitiveRows01.O, rowCoprimeMask P S z * (if z = 0 then 0 else W (‖eisEmbedding z‖ ^ 2 / X))) = (X : ℂ) * paperRadialFourier W 0 * (∏ i ∈ S, (1 - (1 : ℂ) / Ideal.absNorm (P i))) - (X : ℂ) * paperRadialFourier W 0 * (∑ E ∈ largeDivisors P S Z, subsetMobius P E / (subsetNorm P E : ℂ)) - W 0 * (∑ E ∈ smallDivisors P S Z, subsetMobius P E) + (X : ℂ) * (∑ E ∈ smallDivisors P S Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * radialDual W (X / subsetNorm P E)) + (∑ E ∈ largeDivisors P S Z, subsetMobius P E * radialSource W (X / subsetNorm P E)) := by rw [masked_radialSource_truncated P hinj S W X Z hX] have hs := sum_small_add_large P S Z (fun E => subsetMobius P E / (subsetNorm P E : ℂ)) have hprime : ∀ i, Prime (P i) := fun i => Ideal.prime_of_isPrime (NeZero.ne (P i)) inferInstance have he := primeSubset_moebius_norm_sum P hprime hinj S change (∑ E ∈ S.powerset, subsetMobius P E / (subsetNorm P E : ℂ)) = _ at he rw [he] at hs linear_combination (X : ℂ) * paperRadialFourier W 0 * hs end namespace RootNotationPrimitiveRows02 abbrev O := ActualEisensteinCubic.O end RootNotationPrimitiveRows02 open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson def middleDivisors {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows02.O) (S : Finset ι) (Y Z : ℝ) := (smallDivisors P S Z).filter (fun E => Y < subsetNorm P E) def dualNear (W : ℝ → ℂ) (X lengthScale : ℝ) : ℂ := ∑' h : RootNotationPrimitiveRows02.O, if ‖eisEmbedding h‖ ^ 2 ≤ lengthScale then (if h = 0 then 0 else paperRadialFourier W (X * ‖eisEmbedding h‖ ^ 2)) else 0 def dualFar (W : ℝ → ℂ) (X lengthScale : ℝ) : ℂ := ∑' h : RootNotationPrimitiveRows02.O, if lengthScale < ‖eisEmbedding h‖ ^ 2 then (if h = 0 then 0 else paperRadialFourier W (X * ‖eisEmbedding h‖ ^ 2)) else 0 theorem radialDual_summable (W : 𝓢(ℝ, ℂ)) (X : ℝ) (hX : 0 < X) : Summable (fun h : RootNotationPrimitiveRows02.O => if h = 0 then 0 else paperRadialFourier W (X * ‖eisEmbedding h‖ ^ 2)) := by have hs := (paperRadialFourier_lattice_summable_norm W X hX).of_norm apply (hs.indicator {z : RootNotationPrimitiveRows02.O | z ≠ 0}).congr intro z by_cases hz : z = 0 <;> simp [hz] theorem radialDual_near_add_far (W : 𝓢(ℝ, ℂ)) (X lengthScale : ℝ) (hX : 0 < X) : radialDual W X = dualNear W X lengthScale + dualFar W X lengthScale := by have hs := radialDual_summable W X hX have hn : Summable (fun h : RootNotationPrimitiveRows02.O => if ‖eisEmbedding h‖ ^ 2 ≤ lengthScale then (if h = 0 then 0 else paperRadialFourier W (X * ‖eisEmbedding h‖ ^ 2)) else 0) := by exact hs.indicator {h : RootNotationPrimitiveRows02.O | ‖eisEmbedding h‖ ^ 2 ≤ lengthScale} have hf : Summable (fun h : RootNotationPrimitiveRows02.O => if lengthScale < ‖eisEmbedding h‖ ^ 2 then (if h = 0 then 0 else paperRadialFourier W (X * ‖eisEmbedding h‖ ^ 2)) else 0) := by exact hs.indicator {h : RootNotationPrimitiveRows02.O | lengthScale < ‖eisEmbedding h‖ ^ 2} unfold radialDual dualNear dualFar rw [← hn.tsum_add hf] apply tsum_congr intro h by_cases hL : ‖eisEmbedding h‖ ^ 2 ≤ lengthScale <;> simp [hL, not_lt_of_ge, lt_of_not_ge] theorem sum_small_add_middle {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows02.O) (S : Finset ι) (Y Z : ℝ) (hYZ : Y ≤ Z) (f : Finset ι → ℂ) : (∑ E ∈ smallDivisors P S Y, f E) + (∑ E ∈ middleDivisors P S Y Z, f E) = ∑ E ∈ smallDivisors P S Z, f E := by have hsmall : (smallDivisors P S Z).filter (fun E => subsetNorm P E ≤ Y) = smallDivisors P S Y := by ext E simp only [Finset.mem_filter, smallDivisors] constructor · rintro ⟨⟨hE, hEZ⟩, hEY⟩ exact ⟨hE, hEY⟩ · rintro ⟨hE, hEY⟩ exact ⟨⟨hE, hEY.trans hYZ⟩, hEY⟩ have hs := Finset.sum_filter_add_sum_filter_not (smallDivisors P S Z) (fun E => subsetNorm P E ≤ Y) f rw [hsmall] at hs simpa only [middleDivisors, not_le] using hs theorem masked_radialSource_five_pieces {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows02.O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (W : 𝓢(ℝ, ℂ)) (X Y Z lengthScale : ℝ) (hX : 0 < X) (hYZ : Y ≤ Z) : (∑' z : RootNotationPrimitiveRows02.O, rowCoprimeMask P S z * (if z = 0 then 0 else W (‖eisEmbedding z‖ ^ 2 / X))) = (X : ℂ) * paperRadialFourier W 0 * (∏ i ∈ S, (1 - (1 : ℂ) / Ideal.absNorm (P i))) - (X : ℂ) * paperRadialFourier W 0 * (∑ E ∈ largeDivisors P S Z, subsetMobius P E / (subsetNorm P E : ℂ)) - W 0 * (∑ E ∈ smallDivisors P S Z, subsetMobius P E) + (X : ℂ) * (∑ E ∈ middleDivisors P S Y Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * dualNear W (X / subsetNorm P E) lengthScale) + (X : ℂ) * (∑ E ∈ smallDivisors P S Y, (subsetMobius P E / (subsetNorm P E : ℂ)) * radialDual W (X / subsetNorm P E)) + (X : ℂ) * (∑ E ∈ middleDivisors P S Y Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * dualFar W (X / subsetNorm P E) lengthScale) + (∑ E ∈ largeDivisors P S Z, subsetMobius P E * radialSource W (X / subsetNorm P E)) := by rw [masked_radialSource_truncated_euler P hinj S W X Z hX] have hs := sum_small_add_middle P S Y Z hYZ (fun E => (subsetMobius P E / (subsetNorm P E : ℂ)) * radialDual W (X / subsetNorm P E)) rw [← hs] have hm : (∑ E ∈ middleDivisors P S Y Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * radialDual W (X / subsetNorm P E)) = (∑ E ∈ middleDivisors P S Y Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * dualNear W (X / subsetNorm P E) lengthScale) + (∑ E ∈ middleDivisors P S Y Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * dualFar W (X / subsetNorm P E) lengthScale) := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro E hE rw [radialDual_near_add_far W _ lengthScale (div_pos hX (subsetNorm_pos P E)), mul_add] rw [hm] ring end TruncatedPrincipalPoisson namespace EisensteinSchwartzPoisson open ConcreteTraceCRT theorem radial_source_nonzero_lattice_decay (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (W : 𝓢(ℝ, ℂ)) (K : ℝ), 1 ≤ K → (∑' h : {h : O // h ≠ 0}, ‖W (K * ‖eisEmbedding h.val‖ ^ 2)‖) ≤ (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / (1 + K) ^ A := by let s : Finset (ℕ × ℕ) := Finset.Iic (A + 2, 0) let C : ℝ := 2 ^ (A + 2) * (eisensteinCauchyMass + 1) have hC : 0 < C := by have hm := eisensteinCauchyMass_nonneg dsimp [C] positivity refine ⟨s, C, hC, ?_⟩ intro W K hK have hK0 : 0 < K := lt_of_lt_of_le zero_lt_one hK let B : ℝ := 2 ^ (A + 2) * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W have hB : 0 ≤ B := by dsimp [B]; positivity have hb (q : ℝ) (hq : 0 ≤ q) : (1 + q) ^ (A + 2) * ‖W q‖ ≤ B := by have hh := SchwartzMap.one_add_le_sup_seminorm_apply (𝕜 := ℝ) (m := (A + 2, 0)) (k := A + 2) (n := 0) le_rfl le_rfl W q simp only [norm_iteratedFDeriv_zero, Real.norm_of_nonneg hq] at hh change (1 + q) ^ (A + 2) * ‖W q‖ ≤ B at hh exact hh have hp (h : {h : O // h ≠ 0}) : ‖W (K * ‖eisEmbedding h.val‖ ^ 2)‖ ≤ (B / (1 + K) ^ A) * ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹ := by have hq : K ≤ K * ‖eisEmbedding h.val‖ ^ 2 := by nlinarith [one_le_eisenstein_norm_sq h.val h.property] have hh := polynomial_tail_majorant A K K (‖eisEmbedding h.val‖ ^ 2) B ‖W (K * ‖eisEmbedding h.val‖ ^ 2)‖ hK0 hK0.le (sq_nonneg _) (norm_nonneg _) hq (hb _ (by positivity)) simpa only [min_eq_left hK, one_pow, one_mul] using hh have hmajor := (eisenstein_cauchy_summable.subtype (fun h => h ≠ 0)).mul_left (B / (1 + K) ^ A) have hs : Summable (fun h : {h : O // h ≠ 0} => ‖W (K * ‖eisEmbedding h.val‖ ^ 2)‖) := Summable.of_nonneg_of_le (fun _ => norm_nonneg _) hp hmajor calc _ ≤ ∑' h : {h : O // h ≠ 0}, (B / (1 + K) ^ A) * ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹ := hs.tsum_le_tsum hp hmajor _ = (B / (1 + K) ^ A) * ∑' h : {h : O // h ≠ 0}, ((1 + ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹ := tsum_mul_left _ ≤ (B / (1 + K) ^ A) * eisensteinCauchyMass := mul_le_mul_of_nonneg_left (eisensteinCauchyMass_subtype {h : O | h ≠ 0}) (by positivity) _ ≤ (B / (1 + K) ^ A) * (eisensteinCauchyMass + 1) := by gcongr linarith _ = _ := by dsimp [B, C]; ring end EisensteinSchwartzPoisson open scoped BigOperators Classical SchwartzMap namespace TruncatedPrincipalPoisson namespace RootNotationPrimitiveRows03 abbrev O := ActualEisensteinCubic.O end RootNotationPrimitiveRows03 open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson private theorem zero_removed_tsum (f : RootNotationPrimitiveRows03.O → ℂ) : (∑' h : RootNotationPrimitiveRows03.O, if h = 0 then 0 else f h) = ∑' h : {h : RootNotationPrimitiveRows03.O // h ≠ 0}, f h.val := by rw [← tsum_subtype_eq_of_support_subset (s := {h : RootNotationPrimitiveRows03.O | h ≠ 0}) (by intro h hh hz subst h exact hh (by simp))] apply tsum_congr intro h simp only [ite_eq_right h.property] theorem radialSource_inverse_decay (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (W : 𝓢(ℝ, ℂ)) (K : ℝ), 1 ≤ K → ‖radialSource W K⁻¹‖ ≤ (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / (1 + K) ^ A := by obtain ⟨s, C, hC, hb⟩ := radial_source_nonzero_lattice_decay A refine ⟨s, C, hC, ?_⟩ intro W K hK have hK0 : 0 < K := lt_of_lt_of_le zero_lt_one hK have hs : Summable (fun h : RootNotationPrimitiveRows03.O => W (K * ‖eisEmbedding h‖ ^ 2)) := by simpa only [scaledRadialTest_apply, div_inv_eq_mul, mul_comm] using (actual_eisenstein_summable_norm (scaledRadialTest W K⁻¹ (inv_pos.mpr hK0))).of_norm unfold radialSource rw [zero_removed_tsum] simp only [div_inv_eq_mul, mul_comm (‖eisEmbedding _‖ ^ 2) K] exact (norm_tsum_le_tsum_norm (hs.norm.subtype _)).trans (hb W K hK) theorem radialDual_decay (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (W : 𝓢(ℝ, ℂ)) (K : ℝ), 1 ≤ K → ‖radialDual W K‖ ≤ (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / (1 + K) ^ A := by obtain ⟨s, C, hC, hb⟩ := paperRadialFourier_lattice_tail A refine ⟨s, C, hC, ?_⟩ intro W K hK have hK0 : 0 < K := lt_of_lt_of_le zero_lt_one hK have hs := paperRadialFourier_lattice_summable_norm W K hK0 let f : {h : RootNotationPrimitiveRows03.O // h ≠ 0} → {h : RootNotationPrimitiveRows03.O // K ≤ K * ‖eisEmbedding h‖ ^ 2} := fun h => ⟨h.val, by nlinarith [one_le_eisenstein_norm_sq h.val h.property]⟩ have hf : Function.Injective f := by intro a b hab exact Subtype.ext (congrArg (fun z : {h : RootNotationPrimitiveRows03.O // K ≤ K * ‖eisEmbedding h‖ ^ 2} => z.val) hab) have hi : (∑' h : {h : RootNotationPrimitiveRows03.O // h ≠ 0}, ‖paperRadialFourier W (K * ‖eisEmbedding h.val‖ ^ 2)‖) ≤ ∑' h : {h : RootNotationPrimitiveRows03.O // K ≤ K * ‖eisEmbedding h‖ ^ 2}, ‖paperRadialFourier W (K * ‖eisEmbedding h.val‖ ^ 2)‖ := (hs.subtype _).tsum_le_tsum_of_inj f hf (fun _ _ => norm_nonneg _) (fun _ => le_rfl) (hs.subtype _) have ht := hb W K K hK0 hK0.le simp only [min_eq_left hK, one_pow, one_mul] at ht unfold radialDual rw [zero_removed_tsum] exact (norm_tsum_le_tsum_norm (hs.subtype _)).trans (hi.trans ht) theorem subsetMobius_norm_le_one {ι : Type*} (P : ι → Ideal RootNotationPrimitiveRows03.O) (E : Finset ι) : ‖subsetMobius P E‖ ≤ 1 := QuadraticInitialBound.norm_ideal_moebius_le_one _ private theorem scale_tail_bound (A : ℕ) (B x Y X : ℝ) (hB : 0 ≤ B) (hx : 0 < x) (hxY : x ≤ Y) (hX : 0 < X) : (X / x) * (B / (1 + X / x) ^ (A + 1)) ≤ B * (Y / X) ^ A := by have hu : 0 < X / x := div_pos hX hx calc _ ≤ (X / x) * (B / (X / x) ^ (A + 1)) := by apply mul_le_mul_of_nonneg_left _ hu.le exact div_le_div_of_nonneg_left hB (pow_pos hu _) (pow_le_pow_left₀ hu.le (by linarith) _) _ = B * (x / X) ^ A := by simp only [div_pow, pow_succ] field_simp _ ≤ B * (Y / X) ^ A := by gcongr private theorem norm_sum_subsets_le {ι : Type*} [DecidableEq ι] (S : Finset ι) (T : Finset (Finset ι)) (hT : T ⊆ S.powerset) (f : Finset ι → ℂ) (B : ℝ) (hB : 0 ≤ B) (hf : ∀ E ∈ T, ‖f E‖ ≤ B) : ‖∑ E ∈ T, f E‖ ≤ (2 : ℝ) ^ S.card * B := by calc _ ≤ ∑ E ∈ T, ‖f E‖ := norm_sum_le _ _ _ ≤ ∑ E ∈ T, B := Finset.sum_le_sum hf _ = (T.card : ℝ) * B := by simp _ ≤ (2 : ℝ) ^ S.card * B := by apply mul_le_mul_of_nonneg_right _ hB have hc := Finset.card_le_card hT rw [Finset.card_powerset] at hc exact_mod_cast hc theorem small_divisor_dual_tail (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows03.O) [∀ i, (P i).IsMaximal] (S : Finset ι) (W : 𝓢(ℝ, ℂ)) (X Y : ℝ), 0 < X → 0 ≤ Y → Y ≤ X → ‖(X : ℂ) * ∑ E ∈ smallDivisors P S Y, (subsetMobius P E / (subsetNorm P E : ℂ)) * radialDual W (X / subsetNorm P E)‖ ≤ (2 : ℝ) ^ S.card * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) * (Y / X) ^ A := by obtain ⟨s, C, hC, hb⟩ := radialDual_decay (A + 1) refine ⟨s, C, hC, ?_⟩ intro ι _ P _ S W X Y hX hY hYX let B := C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W have hB : 0 ≤ B := by dsimp [B]; positivity rw [Finset.mul_sum] have hf (E : Finset ι) (hE : E ∈ smallDivisors P S Y) : ‖(X : ℂ) * ((subsetMobius P E / (subsetNorm P E : ℂ)) * radialDual W (X / subsetNorm P E))‖ ≤ B * (Y / X) ^ A := by have hn := subsetNorm_pos P E have hEY : subsetNorm P E ≤ Y := (Finset.mem_filter.mp hE).2 have hscale : 1 ≤ X / subsetNorm P E := (le_div_iff₀ hn).mpr (by simpa using hEY.trans hYX) calc _ = (X / subsetNorm P E) * ‖subsetMobius P E‖ * ‖radialDual W (X / subsetNorm P E)‖ := by simp only [norm_mul, norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hX, abs_of_pos hn] ring _ ≤ (X / subsetNorm P E) * 1 * (B / (1 + X / subsetNorm P E) ^ (A + 1)) := by gcongr · exact subsetMobius_norm_le_one P E · exact hb W _ hscale _ ≤ B * (Y / X) ^ A := by simpa only [mul_one] using scale_tail_bound A B (subsetNorm P E) Y X hB hn hEY hX exact (norm_sum_subsets_le S _ (Finset.filter_subset _ _) _ _ (by positivity) hf).trans_eq (by ring) theorem large_divisor_source_tail (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrimitiveRows03.O) [∀ i, (P i).IsMaximal] (S : Finset ι) (W : 𝓢(ℝ, ℂ)) (X Z : ℝ), 0 < X → X ≤ Z → ‖∑ E ∈ largeDivisors P S Z, subsetMobius P E * radialSource W (X / subsetNorm P E)‖ ≤ (2 : ℝ) ^ S.card * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / (1 + Z / X) ^ A := by obtain ⟨s, C, hC, hb⟩ := radialSource_inverse_decay A refine ⟨s, C, hC, ?_⟩ intro ι _ P _ S W X Z hX hXZ let B := C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W have hB : 0 ≤ B := by dsimp [B]; positivity have hZ : 0 < Z := hX.trans_le hXZ have hf (E : Finset ι) (hE : E ∈ largeDivisors P S Z) : ‖subsetMobius P E * radialSource W (X / subsetNorm P E)‖ ≤ B / (1 + Z / X) ^ A := by have hn := subsetNorm_pos P E have hEZ : Z < subsetNorm P E := (Finset.mem_filter.mp hE).2 have hscale : 1 ≤ subsetNorm P E / X := (le_div_iff₀ hX).mpr (by simpa using hXZ.trans hEZ.le) have hh := hb W (subsetNorm P E / X) hscale rw [inv_div] at hh calc _ = ‖subsetMobius P E‖ * ‖radialSource W (X / subsetNorm P E)‖ := norm_mul _ _ _ ≤ 1 * (B / (1 + subsetNorm P E / X) ^ A) := mul_le_mul (subsetMobius_norm_le_one P E) hh (norm_nonneg _) (by norm_num) _ ≤ B / (1 + Z / X) ^ A := by simp only [one_mul] apply div_le_div_of_nonneg_left hB (by positivity) exact pow_le_pow_left₀ (by positivity) (by gcongr) A exact (norm_sum_subsets_le S _ (Finset.filter_subset _ _) _ _ (by positivity) hf).trans_eq (by ring) end TruncatedPrincipalPoisson end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Poisson.PrincipalTruncation /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators Classical SchwartzMap namespace TruncatedPrincipalPoisson section namespace RootNotationPrincipalTruncation01 abbrev O := ActualEisensteinCubic.O end RootNotationPrincipalTruncation01 open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson theorem mem_rowNormDisk_floor {lengthScale : ℝ} (hL : 0 ≤ lengthScale) (z : RootNotationPrincipalTruncation01.O) : z ∈ rowNormDisk ⌊lengthScale⌋₊ ↔ z ≠ 0 ∧ ‖eisEmbedding z‖ ^ 2 ≤ lengthScale := by rw [mem_rowNormDisk] constructor · rintro ⟨hp, hN⟩ refine ⟨?_, ?_⟩ · intro hz subst z simp at hp · rw [eisEmbedding_norm_sq_eq_absNorm_span] exact (Nat.cast_le.mpr hN).trans (Nat.floor_le hL) · rintro ⟨hz, hN⟩ have hp := sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hz)) rw [eisEmbedding_norm_sq_eq_absNorm_span] at hp hN exact ⟨by exact_mod_cast hp, Nat.le_floor hN⟩ theorem dualNear_eq_finite (W : ℝ → ℂ) (X lengthScale : ℝ) (hL : 0 ≤ lengthScale) : dualNear W X lengthScale = ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, paperRadialFourier W (X * ‖eisEmbedding h‖ ^ 2) := by unfold dualNear rw [tsum_eq_sum (s := rowNormDisk ⌊lengthScale⌋₊) (fun h hh => ?_)] · apply Finset.sum_congr rfl intro h hh have hd := (mem_rowNormDisk_floor hL h).mp hh simp only [ite_eq_left hd.2, ite_eq_right hd.1] · by_cases hz : h = 0 · simp [hz] · have hn : ¬ ‖eisEmbedding h‖ ^ 2 ≤ lengthScale := fun hn => hh ((mem_rowNormDisk_floor hL h).mpr ⟨hz, hn⟩) simp only [ite_eq_right hn] theorem dualFar_decay (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (W : 𝓢(ℝ, ℂ)) (K lengthScale : ℝ), 0 < K → 0 ≤ lengthScale → ‖dualFar W K lengthScale‖ ≤ (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / ((min 1 K) ^ 2 * (1 + K * lengthScale) ^ A) := by obtain ⟨s, C, hC, hb⟩ := paperRadialFourier_lattice_tail A refine ⟨s, C, hC, ?_⟩ intro W K lengthScale hK hL have he : dualFar W K lengthScale = ∑' h : {h : RootNotationPrincipalTruncation01.O // lengthScale < ‖eisEmbedding h‖ ^ 2}, paperRadialFourier W (K * ‖eisEmbedding h.val‖ ^ 2) := by unfold dualFar rw [← tsum_subtype_eq_of_support_subset (s := {h : RootNotationPrincipalTruncation01.O | lengthScale < ‖eisEmbedding h‖ ^ 2}) (by intro h hh by_contra hn change ¬ lengthScale < ‖eisEmbedding h‖ ^ 2 at hn exact hh (by simp only [ite_eq_right hn]))] apply tsum_congr intro h have hqh : lengthScale < ‖eisEmbedding h.val‖ ^ 2 := h.property have hz : h.val ≠ 0 := by intro hz have hp := hqh simp only [hz, map_zero, norm_zero, zero_pow (by decide : 2 ≠ 0)] at hp linarith simp only [ite_eq_left hqh, ite_eq_right hz] rw [he] have hs := paperRadialFourier_lattice_summable_norm W K hK let f : {h : RootNotationPrincipalTruncation01.O // lengthScale < ‖eisEmbedding h‖ ^ 2} → {h : RootNotationPrincipalTruncation01.O // K * lengthScale ≤ K * ‖eisEmbedding h‖ ^ 2} := fun h => ⟨h.val, mul_le_mul_of_nonneg_left h.property.le hK.le⟩ have hf : Function.Injective f := by intro a b hab exact Subtype.ext (congrArg (fun z : {h : RootNotationPrincipalTruncation01.O // K * lengthScale ≤ K * ‖eisEmbedding h‖ ^ 2} => z.val) hab) have hi : (∑' h : {h : RootNotationPrincipalTruncation01.O // lengthScale < ‖eisEmbedding h‖ ^ 2}, ‖paperRadialFourier W (K * ‖eisEmbedding h.val‖ ^ 2)‖) ≤ ∑' h : {h : RootNotationPrincipalTruncation01.O // K * lengthScale ≤ K * ‖eisEmbedding h‖ ^ 2}, ‖paperRadialFourier W (K * ‖eisEmbedding h.val‖ ^ 2)‖ := (hs.subtype _).tsum_le_tsum_of_inj f hf (fun _ _ => norm_nonneg _) (fun _ => le_rfl) (hs.subtype _) exact (norm_tsum_le_tsum_norm (hs.subtype _)).trans (hi.trans (hb W K (K * lengthScale) hK (mul_nonneg hK.le hL))) end section namespace RootNotationPrincipalTruncation02 abbrev O := ActualEisensteinCubic.O end RootNotationPrincipalTruncation02 open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson theorem middle_divisor_frequency_tail (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrincipalTruncation02.O) [∀ i, (P i).IsMaximal] (S : Finset ι) (W : 𝓢(ℝ, ℂ)) (X Y Z lengthScale : ℝ), 0 < X → 0 < Y → Y ≤ Z → 0 ≤ lengthScale → ‖(X : ℂ) * ∑ E ∈ middleDivisors P S Y Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * dualFar W (X / subsetNorm P E) lengthScale‖ ≤ (2 : ℝ) ^ S.card * (X / Y) * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / ((min 1 (X / Z)) ^ 2 * (1 + X * lengthScale / Z) ^ A) := by obtain ⟨s, C, hC, hb⟩ := dualFar_decay A refine ⟨s, C, hC, ?_⟩ intro ι _ P _ S W X Y Z lengthScale hX hY hYZ hL let B := C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W let Q := (min 1 (X / Z)) ^ 2 * (1 + X * lengthScale / Z) ^ A have hB : 0 ≤ B := by dsimp [B]; positivity have hZ : 0 < Z := hY.trans_le hYZ have hQ : 0 < Q := by dsimp [Q]; positivity rw [Finset.mul_sum] have hf (E : Finset ι) (hE : E ∈ middleDivisors P S Y Z) : ‖(X : ℂ) * ((subsetMobius P E / (subsetNorm P E : ℂ)) * dualFar W (X / subsetNorm P E) lengthScale)‖ ≤ (X / Y) * (B / Q) := by have hn := subsetNorm_pos P E have hEY : Y < subsetNorm P E := (Finset.mem_filter.mp hE).2 have hEZ : subsetNorm P E ≤ Z := (Finset.mem_filter.mp (Finset.mem_filter.mp hE).1).2 have hk : X / Z ≤ X / subsetNorm P E := div_le_div_of_nonneg_left hX.le hn hEZ have hden : Q ≤ (min 1 (X / subsetNorm P E)) ^ 2 * (1 + (X / subsetNorm P E) * lengthScale) ^ A := by dsimp [Q] have hmul : X * lengthScale / Z ≤ (X / subsetNorm P E) * lengthScale := by calc _ = (X / Z) * lengthScale := by ring _ ≤ _ := mul_le_mul_of_nonneg_right hk hL apply mul_le_mul · exact pow_le_pow_left₀ (by positivity) (min_le_min_left _ hk) 2 · exact pow_le_pow_left₀ (by positivity) (by linarith) A · positivity · positivity have hh : ‖dualFar W (X / subsetNorm P E) lengthScale‖ ≤ B / Q := (hb W _ lengthScale (div_pos hX hn) hL).trans (div_le_div_of_nonneg_left hB hQ hden) calc _ = (X / subsetNorm P E) * ‖subsetMobius P E‖ * ‖dualFar W (X / subsetNorm P E) lengthScale‖ := by simp only [norm_mul, norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hX, abs_of_pos hn] ring _ ≤ (X / Y) * 1 * (B / Q) := by apply mul_le_mul · exact mul_le_mul (div_le_div_of_nonneg_left hX.le hY hEY.le) (subsetMobius_norm_le_one P E) (norm_nonneg _) (by positivity) · exact hh · exact norm_nonneg _ · positivity _ = _ := by ring calc _ ≤ ∑ E ∈ middleDivisors P S Y Z, ‖(X : ℂ) * ((subsetMobius P E / (subsetNorm P E : ℂ)) * dualFar W (X / subsetNorm P E) lengthScale)‖ := norm_sum_le _ _ _ ≤ ∑ E ∈ middleDivisors P S Y Z, (X / Y) * (B / Q) := Finset.sum_le_sum hf _ = ((middleDivisors P S Y Z).card : ℝ) * ((X / Y) * (B / Q)) := by simp _ ≤ (2 : ℝ) ^ S.card * ((X / Y) * (B / Q)) := by apply mul_le_mul_of_nonneg_right _ (by positivity) have hsub : middleDivisors P S Y Z ⊆ S.powerset := (Finset.filter_subset _ _).trans (Finset.filter_subset _ _) have hc := Finset.card_le_card hsub rw [Finset.card_powerset] at hc exact_mod_cast hc _ = _ := by dsimp [B, Q]; ring end namespace RootNotationPrincipalTruncation03 abbrev O := ActualEisensteinCubic.O end RootNotationPrincipalTruncation03 open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson def principalTruncation {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrincipalTruncation03.O) (S : Finset ι) (W : ℝ → ℂ) (X Z : ℝ) : ℂ := (X : ℂ) * paperRadialFourier W 0 * (∏ i ∈ S, (1 - (1 : ℂ) / Ideal.absNorm (P i))) - (X : ℂ) * paperRadialFourier W 0 * (∑ E ∈ largeDivisors P S Z, subsetMobius P E / (subsetNorm P E : ℂ)) - W 0 * (∑ E ∈ smallDivisors P S Z, subsetMobius P E) def middleTruncation {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrincipalTruncation03.O) (S : Finset ι) (W : ℝ → ℂ) (X Y Z lengthScale : ℝ) : ℂ := (X : ℂ) * ∑ E ∈ middleDivisors P S Y Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, paperRadialFourier W ((X / subsetNorm P E) * ‖eisEmbedding h‖ ^ 2) def truncationError {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrincipalTruncation03.O) (S : Finset ι) (W : ℝ → ℂ) (X Y Z lengthScale : ℝ) : ℂ := (∑' z : RootNotationPrincipalTruncation03.O, rowCoprimeMask P S z * (if z = 0 then 0 else W (‖eisEmbedding z‖ ^ 2 / X))) - (principalTruncation P S W X Z + middleTruncation P S W X Y Z lengthScale) theorem truncationError_eq {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrincipalTruncation03.O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) (S : Finset ι) (W : 𝓢(ℝ, ℂ)) (X Y Z lengthScale : ℝ) (hX : 0 < X) (hYZ : Y ≤ Z) (hL : 0 ≤ lengthScale) : truncationError P S W X Y Z lengthScale = (X : ℂ) * (∑ E ∈ smallDivisors P S Y, (subsetMobius P E / (subsetNorm P E : ℂ)) * radialDual W (X / subsetNorm P E)) + (X : ℂ) * (∑ E ∈ middleDivisors P S Y Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * dualFar W (X / subsetNorm P E) lengthScale) + (∑ E ∈ largeDivisors P S Z, subsetMobius P E * radialSource W (X / subsetNorm P E)) := by unfold truncationError principalTruncation middleTruncation rw [masked_radialSource_five_pieces P hinj S W X Y Z lengthScale hX hYZ] simp_rw [dualNear_eq_finite W _ lengthScale hL] ring theorem truncationError_bound (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (P : ι → Ideal RootNotationPrincipalTruncation03.O) [∀ i, (P i).IsMaximal] (_hinj : Function.Injective P) (S : Finset ι) (W : 𝓢(ℝ, ℂ)) (X Y Z lengthScale : ℝ), 0 < X → 0 < Y → Y ≤ X → X ≤ Z → 0 ≤ lengthScale → ‖truncationError P S W X Y Z lengthScale‖ ≤ (2 : ℝ) ^ S.card * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) * ((Y / X) ^ A + (1 / (1 + Z / X) ^ A) + (X / Y) / ((min 1 (X / Z)) ^ 2 * (1 + X * lengthScale / Z) ^ A)) := by obtain ⟨s₀, C₀, hC₀, h₀⟩ := small_divisor_dual_tail A obtain ⟨s₁, C₁, hC₁, h₁⟩ := large_divisor_source_tail A obtain ⟨s₂, C₂, hC₂, h₂⟩ := middle_divisor_frequency_tail A refine ⟨(s₀ ∪ s₁) ∪ s₂, C₀ + C₁ + C₂, by positivity, ?_⟩ intro ι _ P _ hinj S W X Y Z lengthScale hX hY hYX hXZ hL let Q := ((s₀ ∪ s₁) ∪ s₂).sup (schwartzSeminormFamily ℝ ℝ ℂ) W let C := C₀ + C₁ + C₂ have hQ : 0 ≤ Q := apply_nonneg _ _ have hc₀ : C₀ ≤ C := by dsimp [C]; linarith have hc₁ : C₁ ≤ C := by dsimp [C]; linarith have hc₂ : C₂ ≤ C := by dsimp [C]; linarith have hq₀ : s₀.sup (schwartzSeminormFamily ℝ ℝ ℂ) W ≤ Q := Seminorm.le_def.mp (Finset.sup_mono (Finset.subset_union_left.trans Finset.subset_union_left)) W have hq₁ : s₁.sup (schwartzSeminormFamily ℝ ℝ ℂ) W ≤ Q := Seminorm.le_def.mp (Finset.sup_mono (Finset.subset_union_right.trans Finset.subset_union_left)) W have hq₂ : s₂.sup (schwartzSeminormFamily ℝ ℝ ℂ) W ≤ Q := Seminorm.le_def.mp (Finset.sup_mono Finset.subset_union_right) W have hz : 0 < Z := hX.trans_le hXZ let lo : ℂ := (X : ℂ) * ∑ E ∈ smallDivisors P S Y, (subsetMobius P E / (subsetNorm P E : ℂ)) * radialDual W (X / subsetNorm P E) let mid : ℂ := (X : ℂ) * ∑ E ∈ middleDivisors P S Y Z, (subsetMobius P E / (subsetNorm P E : ℂ)) * dualFar W (X / subsetNorm P E) lengthScale let hi : ℂ := ∑ E ∈ largeDivisors P S Z, subsetMobius P E * radialSource W (X / subsetNorm P E) have hlo : ‖lo‖ ≤ (2 : ℝ) ^ S.card * (C * Q) * (Y / X) ^ A := by apply (h₀ P S W X Y hX hY.le hYX).trans gcongr have hhi : ‖hi‖ ≤ (2 : ℝ) ^ S.card * (C * Q) / (1 + Z / X) ^ A := by apply (h₁ P S W X Z hX hXZ).trans gcongr have hmid : ‖mid‖ ≤ (2 : ℝ) ^ S.card * (X / Y) * (C * Q) / ((min 1 (X / Z)) ^ 2 * (1 + X * lengthScale / Z) ^ A) := by apply (h₂ P S W X Y Z lengthScale hX hY (hYX.trans hXZ) hL).trans gcongr rw [truncationError_eq P hinj S W X Y Z lengthScale hX (hYX.trans hXZ) hL] change ‖lo + mid + hi‖ ≤ _ calc _ ≤ ‖lo‖ + ‖mid‖ + ‖hi‖ := (norm_add_le _ _).trans (add_le_add (norm_add_le lo mid) le_rfl) _ ≤ (2 : ℝ) ^ S.card * (C * Q) * (Y / X) ^ A + (2 : ℝ) ^ S.card * (X / Y) * (C * Q) / ((min 1 (X / Z)) ^ 2 * (1 + X * lengthScale / Z) ^ A) + (2 : ℝ) ^ S.card * (C * Q) / (1 + Z / X) ^ A := add_le_add (add_le_add hlo hmid) hhi _ = _ := by change _ = (2 : ℝ) ^ S.card * (C * Q) * _; ring end TruncatedPrincipalPoisson namespace JointLogSeparation open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform section open FourierBridge FirstPassCubeLabels lemma schwartz_phase_inversion (g : 𝓢(ℝ, ℂ)) (x : ℝ) : g x = ∫ t : ℝ, logPhase t x * (𝓕 g) t := by simpa only [logPhase, Real.inner_apply, mul_assoc, mul_comm, mul_left_comm] using FourierBridge.schwartz_log_inversion g x lemma product_three_integrals (f g h : ℝ → ℂ) : (∫ t, f t) * (∫ t, g t) * (∫ t, h t) = ∫ t₁, ∫ t₂, ∫ t₃, f t₁ * g t₂ * h t₃ := by simp_rw [integral_const_mul, integral_mul_const] simp_rw [integral_const_mul, integral_mul_const] def profileSourceBound (g : 𝓢(ℝ, ℂ)) (J : ℕ) : ℝ := ∑ i ∈ Finset.range (J + 1), ((SchwartzMap.seminorm ℝ 0 i) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower i) g) lemma profileSourceBound_nonneg (g : 𝓢(ℝ, ℂ)) (J : ℕ) : 0 ≤ profileSourceBound g J := by unfold profileSourceBound positivity lemma source_le_profileSourceBound (g : 𝓢(ℝ, ℂ)) (J i : ℕ) (hi : i ≤ J) : (SchwartzMap.seminorm ℝ 0 i) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower i) g ≤ profileSourceBound g J := by unfold profileSourceBound apply Finset.single_le_sum (s := Finset.range (J + 1)) (a := i) (f := fun k : ℕ => (SchwartzMap.seminorm ℝ 0 k) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower k) g) · intro j hj positivity · exact Finset.mem_range.mpr (by omega) lemma profile_fourier_envelope (g : 𝓢(ℝ, ℂ)) (J : ℕ) (t : ℝ) : ‖(𝓕 g) t‖ ≤ fourierPointBound (J + 2) (profileSourceBound g (J + 2)) * firstLogDensity J t := by have h := uniform_fourier_pointwise g (J + 2) 1 (profileSourceBound g (J + 2)) (by norm_num) (profileSourceBound_nonneg g _) (fun i hi => by simpa using source_le_profileSourceBound g (J + 2) i hi) t rw [firstLogDensity, ← div_eq_mul_inv] apply (le_div_iff₀ (pow_pos (by positivity : 0 < 1 + ‖t‖) (J + 2))).mpr simpa only [one_mul, mul_comm] using h theorem joint_separation_identity (A₁ A₂ : 𝓢(ℝ, ℂ)) (b : 𝓢(ℝ, ℂ)) (P F : ℂ) (s₁ s₂ s₃ : ℝ) (hr : P * F = ∫ t : ℝ, P * logPhase t s₃ * b t) : P * A₁ s₁ * A₂ s₂ * F = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, P * logPhase t₁ s₁ * logPhase t₂ s₂ * logPhase t₃ s₃ * ((𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃) := by calc _ = A₁ s₁ * A₂ s₂ * (P * F) := by ring _ = (∫ t : ℝ, logPhase t s₁ * (𝓕 A₁) t) * (∫ t : ℝ, logPhase t s₂ * (𝓕 A₂) t) * (∫ t : ℝ, P * logPhase t s₃ * b t) := by rw [← schwartz_phase_inversion, ← schwartz_phase_inversion, ← hr] _ = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, (logPhase t₁ s₁ * (𝓕 A₁) t₁) * (logPhase t₂ s₂ * (𝓕 A₂) t₂) * (P * logPhase t₃ s₃ * b t₃) := by exact product_three_integrals (fun t : ℝ => logPhase t s₁ * (𝓕 A₁) t) (fun t : ℝ => logPhase t s₂ * (𝓕 A₂) t) (fun t : ℝ => P * logPhase t s₃ * b t) _ = _ := by apply integral_congr_ae filter_upwards [] with t₁ apply integral_congr_ae filter_upwards [] with t₂ apply integral_congr_ae filter_upwards [] with t₃ ring theorem joint_separation_envelope {ι : Type*} [Fintype ι] (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : ι → ℝ → ℂ) (a₁ a₂ a₃ M : ι → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), (∀ y : ι → ℝ, (∏ j, V j (y j)) * A₁ (∑ j, a₁ j * y j) * A₂ (∑ j, a₂ j * y j) * EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp (∑ j, a₃ j * y j)) = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, (∏ j, V j (y j)) * logPhase t₁ (∑ j, a₁ j * y j) * logPhase t₂ (∑ j, a₂ j * y j) * logPhase t₃ (∑ j, a₃ j * y j) * ((𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃)) ∧ (∀ t₁ t₂ t₃ : ℝ, (1 + R) ^ A * ‖(𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃‖ ≤ C * firstLogDensity J t₁ * firstLogDensity J t₂ * firstLogDensity J t₃) ∧ Integrable (fun t : ℝ => (1 + ‖t‖) ^ J * ‖b t‖) := by classical obtain ⟨C₃, hC₃, hsep⟩ := EisensteinSchwartzPoisson.paperRadialFourier_log_separation_envelope W V a₃ M hM hV A (J + 2) let C₁ := fourierPointBound (J + 2) (profileSourceBound A₁ (J + 2)) let C₂ := fourierPointBound (J + 2) (profileSourceBound A₂ (J + 2)) have hC₁ : 0 ≤ C₁ := fourierPointBound_nonneg _ _ (profileSourceBound_nonneg _ _) have hC₂ : 0 ≤ C₂ := fourierPointBound_nonneg _ _ (profileSourceBound_nonneg _ _) refine ⟨C₁ * C₂ * C₃, by positivity, ?_⟩ intro R hR obtain ⟨b, hb, _, _, hpoint⟩ := hsep R hR refine ⟨b, ?_, ?_, AnalyticBridge.schwartz_fourier_one_plus_integrable (𝓕⁻ b) J |>.congr ?_⟩ · intro y let P : ℂ := ∏ j, V j (y j) let s₁ : ℝ := ∑ j, a₁ j * y j let s₂ : ℝ := ∑ j, a₂ j * y j let s₃ : ℝ := ∑ j, a₃ j * y j have hr : P * EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp s₃) = ∫ t, P * logPhase t s₃ * b t := by have hh := hb y simpa only [Finset.prod_mul_distrib, ← logPhase_sum, P, s₃] using hh exact joint_separation_identity A₁ A₂ b P (EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp s₃)) s₁ s₂ s₃ hr · intro t₁ t₂ t₃ have hb₃ : (1 + R) ^ A * ‖b t₃‖ ≤ C₃ * firstLogDensity J t₃ := by rw [firstLogDensity, ← div_eq_mul_inv] apply (le_div_iff₀ (pow_pos (by positivity : 0 < 1 + ‖t₃‖) (J + 2))).mpr simpa only [mul_comm, mul_left_comm, mul_assoc] using hpoint t₃ have h₁ := profile_fourier_envelope A₁ J t₁ have h₂ := profile_fourier_envelope A₂ J t₂ simp only [norm_mul] calc _ = ‖(𝓕 A₁) t₁‖ * ‖(𝓕 A₂) t₂‖ * ((1 + R)^A * ‖b t₃‖) := by ring _ ≤ (C₁ * firstLogDensity J t₁) * (C₂ * firstLogDensity J t₂) * (C₃ * firstLogDensity J t₃) := by exact mul_le_mul (mul_le_mul h₁ h₂ (norm_nonneg _) (mul_nonneg hC₁ (firstLogDensity_nonneg _ _))) hb₃ (by positivity) (mul_nonneg (mul_nonneg hC₁ (firstLogDensity_nonneg _ _)) (mul_nonneg hC₂ (firstLogDensity_nonneg _ _))) _ = _ := by ring · filter_upwards [] with t simp lemma seven_phase_factor (z ud ue uv kap x₁ x₂ t₁ t₂ t₃ : ℝ) : logPhase t₁ (z + x₁) * logPhase t₂ (z + x₂) * logPhase t₃ (kap - ud - 2 * ue - 2 * uv - x₁ - x₂) = logPhase (t₁ + t₂) z * logPhase t₃ (kap - ud - 2 * ue - 2 * uv) * logPhase (t₁ - t₃) x₁ * logPhase (t₂ - t₃) x₂ := by unfold logPhase simp only [← Complex.exp_add] congr 1 push_cast ring def outerWindow (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap : ℝ) : ℂ := V 0 z * V 1 ud * V 2 ue * V 3 uv * V 4 kap def fixedColumnTest (V : ℝ → ℂ) (t : ℝ) (x : ℝ) : ℂ := V x * logPhase t x theorem seven_kernel_separation (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), (∀ z ud ue uv kap x₁ x₂ : ℝ, outerWindow V z ud ue uv kap * V 5 x₁ * V 6 x₂ * A₁ (z + x₁) * A₂ (z + x₂) * EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp (kap - ud - 2 * ue - 2 * uv - x₁ - x₂)) = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, outerWindow V z ud ue uv kap * logPhase (t₁ + t₂) z * logPhase t₃ (kap - ud - 2 * ue - 2 * uv) * fixedColumnTest (V 5) (t₁ - t₃) x₁ * fixedColumnTest (V 6) (t₂ - t₃) x₂ * ((𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃)) ∧ (∀ t₁ t₂ t₃ : ℝ, (1 + R) ^ A * ‖(𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃‖ ≤ C * firstLogDensity J t₁ * firstLogDensity J t₂ * firstLogDensity J t₃) ∧ Integrable (fun t : ℝ => (1 + ‖t‖) ^ J * ‖b t‖) := by let a₁ : Fin 7 → ℝ := ![1, 0, 0, 0, 0, 1, 0] let a₂ : Fin 7 → ℝ := ![1, 0, 0, 0, 0, 0, 1] let a₃ : Fin 7 → ℝ := ![0, -1, -2, -2, 1, -1, -1] obtain ⟨C, hC, hsep⟩ := joint_separation_envelope A₁ A₂ W V a₁ a₂ a₃ M hM hV A J refine ⟨C, hC, ?_⟩ intro R hR obtain ⟨b, hb, hpoint, hint⟩ := hsep R hR refine ⟨b, ?_, hpoint, hint⟩ intro z ud ue uv kap x₁ x₂ let y : Fin 7 → ℝ := ![z, ud, ue, uv, kap, x₁, x₂] have h₁ : (∑ j, a₁ j * y j) = z + x₁ := by simp [a₁, y, Fin.sum_univ_succ] have h₂ : (∑ j, a₂ j * y j) = z + x₂ := by simp [a₂, y, Fin.sum_univ_succ] have h₃ : (∑ j, a₃ j * y j) = kap - ud - 2 * ue - 2 * uv - x₁ - x₂ := by simp [a₃, y, Fin.sum_univ_succ] ring have hp : (∏ j, V j (y j)) = outerWindow V z ud ue uv kap * V 5 x₁ * V 6 x₂ := by simp [outerWindow, y, Fin.prod_univ_succ, mul_assoc] have h := hb y rw [h₁, h₂, h₃, hp] at h rw [h] apply integral_congr_ae filter_upwards [] with t₁ apply integral_congr_ae filter_upwards [] with t₂ apply integral_congr_ae filter_upwards [] with t₃ have heq := seven_phase_factor z ud ue uv kap x₁ x₂ t₁ t₂ t₃ unfold fixedColumnTest calc _ = (outerWindow V z ud ue uv kap * V 5 x₁ * V 6 x₂) * (logPhase t₁ (z + x₁) * logPhase t₂ (z + x₂) * logPhase t₃ (kap - ud - 2 * ue - 2 * uv - x₁ - x₂)) * ((𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃) := by ring _ = _ := by rw [heq]; ring end open FirstPassCubeLabels lemma weighted_schwartz_integrable (b : 𝓢(ℝ, ℂ)) (J : ℕ) : Integrable (fun t : ℝ => (1 + ‖t‖) ^ J * ‖b t‖) := by simpa using AnalyticBridge.schwartz_fourier_one_plus_integrable (𝓕⁻ b) J lemma density_weight_identity (J : ℕ) (t : ℝ) : (1 + ‖t‖) ^ J * firstLogDensity J t = firstLogDensity 0 t := by have ht : 1 + ‖t‖ ≠ 0 := ne_of_gt (by positivity) simp only [firstLogDensity, zero_add, pow_add, mul_inv_rev] field_simp end JointLogSeparation open scoped BigOperators namespace FiniteOverlapDecomposition variable {ι : Type*} [DecidableEq ι] abbrev Triple (ι : Type*) := Σ _ : Finset ι, Finset ι × Finset ι def triples (F : Finset ι) : Finset (Triple ι) := F.powerset.sigma fun G => ((F \ G).powerset ×ˢ (F \ G).powerset).filter fun UV => Disjoint UV.1 UV.2 def split (ST : Finset ι × Finset ι) : Triple ι := ⟨ST.1 ∩ ST.2, ST.1 \ ST.2, ST.2 \ ST.1⟩ def join (GUV : Triple ι) : Finset ι × Finset ι := (GUV.1 ∪ GUV.2.1, GUV.1 ∪ GUV.2.2) lemma join_split (ST : Finset ι × Finset ι) : join (split ST) = ST := by apply Prod.ext · ext i simp only [join, split, Finset.mem_union, Finset.mem_inter, Finset.mem_sdiff] tauto · ext i simp only [join, split, Finset.mem_union, Finset.mem_inter, Finset.mem_sdiff] tauto lemma split_mem {F : Finset ι} {ST : Finset ι × Finset ι} (hST : ST ∈ F.powerset ×ˢ F.powerset) : split ST ∈ triples F := by rcases Finset.mem_product.mp hST with ⟨hS, hT⟩ have hSF := Finset.mem_powerset.mp hS have hTF := Finset.mem_powerset.mp hT simp only [triples, split, Finset.mem_sigma, Finset.mem_filter, Finset.mem_product, Finset.mem_powerset] refine ⟨Finset.inter_subset_left.trans hSF, ⟨?_, ?_⟩, ?_⟩ · intro i hi simp only [Finset.mem_sdiff, Finset.mem_inter] at hi ⊢ exact ⟨hSF hi.1, by tauto⟩ · intro i hi simp only [Finset.mem_sdiff, Finset.mem_inter] at hi ⊢ exact ⟨hTF hi.1, by tauto⟩ · apply Finset.disjoint_left.mpr intro i hi hj exact (Finset.mem_sdiff.mp hi).2 (Finset.mem_sdiff.mp hj).1 lemma join_mem {F : Finset ι} {GUV : Triple ι} (h : GUV ∈ triples F) : join GUV ∈ F.powerset ×ˢ F.powerset := by rcases (by simpa only [triples, Finset.mem_sigma, Finset.mem_filter, Finset.mem_product, Finset.mem_powerset] using h) with ⟨hG, ⟨hU, hV⟩, _⟩ apply Finset.mem_product.mpr constructor <;> apply Finset.mem_powerset.mpr · exact Finset.union_subset hG (hU.trans Finset.sdiff_subset) · exact Finset.union_subset hG (hV.trans Finset.sdiff_subset) lemma split_join {F : Finset ι} {GUV : Triple ι} (h : GUV ∈ triples F) : split (join GUV) = GUV := by rcases GUV with ⟨G, U, V⟩ have hh : G ⊆ F ∧ (U ⊆ F \ G ∧ V ⊆ F \ G) ∧ Disjoint U V := by simpa only [triples, Finset.mem_sigma, Finset.mem_filter, Finset.mem_product, Finset.mem_powerset] using h rcases hh with ⟨_, ⟨hU, hV⟩, hd⟩ have hUG : Disjoint U G := Finset.disjoint_left.mpr (fun i hi hg => (Finset.mem_sdiff.mp (hU hi)).2 hg) have hVG : Disjoint V G := Finset.disjoint_left.mpr (fun i hi hg => (Finset.mem_sdiff.mp (hV hi)).2 hg) have h₀ : (G ∪ U) ∩ (G ∪ V) = G := by ext i have hi : i ∈ U → i ∈ V → False := fun hi hj => Finset.disjoint_left.mp hd hi hj simp only [Finset.mem_union, Finset.mem_inter] tauto have h₁ : (G ∪ U) \ (G ∪ V) = U := by ext i have hi : i ∈ U → i ∈ V → False := fun hi hj => Finset.disjoint_left.mp hd hi hj have hj : i ∈ U → i ∈ G → False := fun hi hj => Finset.disjoint_left.mp hUG hi hj simp only [Finset.mem_union, Finset.mem_sdiff] tauto have h₂ : (G ∪ V) \ (G ∪ U) = V := by ext i have hi : i ∈ V → i ∈ U → False := fun hi hj => Finset.disjoint_left.mp hd.symm hi hj have hj : i ∈ V → i ∈ G → False := fun hi hj => Finset.disjoint_left.mp hVG hi hj simp only [Finset.mem_union, Finset.mem_sdiff] tauto simp only [split, join, h₀, h₁, h₂] theorem sum_pair_eq_overlap {β : Type*} [AddCommMonoid β] (F : Finset ι) (C : Finset ι → Finset ι → β) : (∑ S ∈ F.powerset, ∑ T ∈ F.powerset, C S T) = ∑ G ∈ F.powerset, ∑ U ∈ (F \ G).powerset, ∑ V ∈ (F \ G).powerset, if Disjoint U V then C (G ∪ U) (G ∪ V) else 0 := by classical have hs : (∑ ST ∈ F.powerset ×ˢ F.powerset, C ST.1 ST.2) = ∑ GUV ∈ triples F, C (join GUV).1 (join GUV).2 := by apply Finset.sum_bij (fun ST _ => split ST) · intro ST hST exact split_mem hST · intro ST hST SU hSU heq have hh := congrArg join heq simpa only [join_split] using hh · intro GUV hGUV exact ⟨join GUV, join_mem hGUV, split_join hGUV⟩ · intro ST hST rw [join_split] simpa only [triples, Finset.sum_sigma, Finset.sum_filter, Finset.sum_product, join] using hs end FiniteOverlapDecomposition end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Fourier.FrequencyTwists namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace JointLogSeparation open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform open FourierBridge lemma logPhase_temperate (t : ℝ) : (logPhase t).HasTemperateGrowth := by have hl : Function.HasTemperateGrowth (fun x : ℝ => (2 * Real.pi * t) * x) := by simpa [Pi.smul_def, smul_eq_mul] using (((2 * Real.pi * t) • ContinuousLinearMap.id ℝ ℝ).hasTemperateGrowth) have hsin : Real.sin.HasTemperateGrowth := by refine ⟨Real.contDiff_sin, fun n => ⟨0, 1, fun x => ?_⟩⟩ simpa [norm_iteratedFDeriv_eq_norm_iteratedDeriv] using Real.abs_iteratedDeriv_sin_le_one n x have hcos : Real.cos.HasTemperateGrowth := by refine ⟨Real.contDiff_cos, fun n => ⟨0, 1, fun x => ?_⟩⟩ simpa [norm_iteratedFDeriv_eq_norm_iteratedDeriv] using Real.abs_iteratedDeriv_cos_le_one n x have hexp : (fun x : ℝ => Complex.exp (x * Complex.I)).HasTemperateGrowth := by simp only [Complex.exp_ofReal_mul_I] fun_prop exact hexp.comp hl def frequencyTwist (g : 𝓢(ℝ, ℂ)) (t : ℝ) : 𝓢(ℝ, ℂ) := SchwartzMap.smulLeftCLM ℂ (logPhase t) g lemma frequencyTwist_apply (g : 𝓢(ℝ, ℂ)) (t x : ℝ) : frequencyTwist g t x = logPhase t x * g x := by exact SchwartzMap.smulLeftCLM_apply_apply (logPhase_temperate t) g x lemma logPhase_add_frequency (t s x : ℝ) : logPhase (t + s) x = logPhase t x * logPhase s x := by unfold logPhase rw [← Complex.exp_add] congr 1 push_cast ring lemma frequencyTwist_norm (g : 𝓢(ℝ, ℂ)) (t x : ℝ) : ‖frequencyTwist g t x‖ = ‖g x‖ := by simp [frequencyTwist_apply, logPhase_norm] def phaseDerivative (t : ℝ) : ℂ := ((2 * Real.pi * t : ℝ) : ℂ) * Complex.I lemma logPhase_hasDerivAt (t x : ℝ) : HasDerivAt (logPhase t) (phaseDerivative t * logPhase t x) x := by have h := ((Complex.ofRealCLM.hasDerivAt (x := x)).const_mul (phaseDerivative t)).cexp simp only [Complex.ofRealCLM_apply, Complex.ofReal_one, mul_one] at h have he (y : ℝ) : Complex.exp (phaseDerivative t * (y : ℂ)) = logPhase t y := by unfold phaseDerivative logPhase congr 1 push_cast ring simp_rw [he] at h simpa only [mul_comm] using h lemma logPhase_iteratedDeriv (t : ℝ) (n : ℕ) : iteratedDeriv n (logPhase t) = fun x => phaseDerivative t ^ n * logPhase t x := by induction n with | zero => funext x; simp | succ n ih => rw [iteratedDeriv_succ, ih] funext x rw [show deriv (fun y => phaseDerivative t ^ n * logPhase t y) x = phaseDerivative t ^ n * (phaseDerivative t * logPhase t x) from ((logPhase_hasDerivAt t x).const_mul _).deriv] simp only [pow_succ] ring lemma phaseDerivative_norm (t : ℝ) : ‖phaseDerivative t‖ = 2 * Real.pi * ‖t‖ := by simp only [phaseDerivative, norm_mul, Complex.norm_real, Complex.norm_I, mul_one] rw [Real.norm_of_nonneg (by norm_num : (0 : ℝ) ≤ 2), Real.norm_of_nonneg Real.pi_pos.le] lemma logPhase_iteratedFDeriv_norm (t x : ℝ) (n : ℕ) : ‖iteratedFDeriv ℝ n (logPhase t) x‖ = (2 * Real.pi * ‖t‖) ^ n := by rw [norm_iteratedFDeriv_eq_norm_iteratedDeriv, logPhase_iteratedDeriv] simp only [norm_mul, norm_pow, phaseDerivative_norm, logPhase_norm, mul_one] def derivativeSeminormSum (g : 𝓢(ℝ, ℂ)) (k n : ℕ) : ℝ := ∑ i ∈ Finset.range (n + 1), (SchwartzMap.seminorm ℝ k i) g lemma derivativeSeminormSum_nonneg (g : 𝓢(ℝ, ℂ)) (k n : ℕ) : 0 ≤ derivativeSeminormSum g k n := by unfold derivativeSeminormSum; positivity lemma seminorm_le_derivativeSeminormSum (g : 𝓢(ℝ, ℂ)) (k n i : ℕ) (hi : i ≤ n) : (SchwartzMap.seminorm ℝ k i) g ≤ derivativeSeminormSum g k n := by apply Finset.single_le_sum (s := Finset.range (n + 1)) (f := fun j => (SchwartzMap.seminorm ℝ k j) g) (a := i) · intro j hj; positivity · exact Finset.mem_range.mpr (by omega) theorem frequencyTwist_seminorm_bound (g : 𝓢(ℝ, ℂ)) (t : ℝ) (k n : ℕ) : (SchwartzMap.seminorm ℝ k n) (frequencyTwist g t) ≤ (2 : ℝ)^n * (1 + 2 * Real.pi * ‖t‖)^n * derivativeSeminormSum g k n := by apply SchwartzMap.seminorm_le_bound ℝ k n _ (mul_nonneg (mul_nonneg (by positivity) (by positivity)) (derivativeSeminormSum_nonneg _ _ _)) intro x have hh := norm_iteratedFDeriv_mul_le (logPhase_temperate t).1 (g.smooth ⊤) x (n := n) (by exact_mod_cast le_top) have hfun : (frequencyTwist g t : ℝ → ℂ) = fun x => logPhase t x * g x := by funext x; exact frequencyTwist_apply g t x rw [hfun] calc _ ≤ ‖x‖^k * ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * ‖iteratedFDeriv ℝ i (logPhase t) x‖ * ‖iteratedFDeriv ℝ (n-i) g x‖ := by gcongr _ = ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * (2 * Real.pi * ‖t‖)^i * (‖x‖^k * ‖iteratedFDeriv ℝ (n-i) g x‖) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i hi rw [logPhase_iteratedFDeriv_norm] ring _ ≤ ∑ i ∈ Finset.range (n + 1), (n.choose i : ℝ) * (1 + 2 * Real.pi * ‖t‖)^n * derivativeSeminormSum g k n := by apply Finset.sum_le_sum intro i hi have hin : i ≤ n := Finset.mem_range_succ_iff.mp hi have hp : (2 * Real.pi * ‖t‖)^i ≤ (1 + 2 * Real.pi * ‖t‖)^n := by calc _ ≤ (1 + 2 * Real.pi * ‖t‖)^i := by gcongr; linarith _ ≤ _ := pow_le_pow_right₀ (by have hc : 0 ≤ 2 * Real.pi * ‖t‖ := by positivity linarith) hin have hs := (SchwartzMap.le_seminorm ℝ k (n-i) g x).trans (seminorm_le_derivativeSeminormSum g k n (n-i) (Nat.sub_le n i)) exact mul_le_mul (mul_le_mul_of_nonneg_left hp (by positivity)) hs (by positivity) (by positivity) _ = _ := by rw [← Finset.sum_mul, ← Finset.sum_mul, ← Nat.cast_sum, Nat.sum_range_choose] norm_cast theorem frequencyTwist_seminorm_polynomial (g : 𝓢(ℝ, ℂ)) (t : ℝ) (k n : ℕ) : (SchwartzMap.seminorm ℝ k n) (frequencyTwist g t) ≤ ((2 : ℝ)^n * (1 + 2 * Real.pi)^n * derivativeSeminormSum g k n) * (1 + ‖t‖)^n := by have hsum := derivativeSeminormSum_nonneg g k n have hp : 1 + 2 * Real.pi * ‖t‖ ≤ (1 + 2 * Real.pi) * (1 + ‖t‖) := by nlinarith [Real.pi_pos, norm_nonneg t] calc _ ≤ (2 : ℝ)^n * (1 + 2 * Real.pi * ‖t‖)^n * derivativeSeminormSum g k n := frequencyTwist_seminorm_bound g t k n _ ≤ (2 : ℝ)^n * ((1 + 2 * Real.pi) * (1 + ‖t‖))^n * derivativeSeminormSum g k n := by gcongr _ = _ := by rw [mul_pow]; ring def twistSourceBound (g : 𝓢(ℝ, ℂ)) (K : ℕ) : ℝ := ∑ i ∈ Finset.range (K + 1), ((2 : ℝ)^i * (1 + 2 * Real.pi)^i * (derivativeSeminormSum g 0 i + derivativeSeminormSum g (volume : Measure ℝ).integrablePower i)) lemma twistSourceBound_nonneg (g : 𝓢(ℝ, ℂ)) (K : ℕ) : 0 ≤ twistSourceBound g K := by apply Finset.sum_nonneg intro i hi exact mul_nonneg (mul_nonneg (by positivity) (by positivity)) (add_nonneg (derivativeSeminormSum_nonneg _ _ _) (derivativeSeminormSum_nonneg _ _ _)) theorem profileSourceBound_frequencyTwist (g : 𝓢(ℝ, ℂ)) (t : ℝ) (K : ℕ) : profileSourceBound (frequencyTwist g t) K ≤ twistSourceBound g K * (1 + ‖t‖)^K := by unfold profileSourceBound twistSourceBound rw [Finset.sum_mul] apply Finset.sum_le_sum intro i hi have hin : i ≤ K := Finset.mem_range_succ_iff.mp hi have hb := add_le_add (frequencyTwist_seminorm_polynomial g t 0 i) (frequencyTwist_seminorm_polynomial g t (volume : Measure ℝ).integrablePower i) have hn : 0 ≤ (2 : ℝ)^i * (1 + 2 * Real.pi)^i * (derivativeSeminormSum g 0 i + derivativeSeminormSum g (volume : Measure ℝ).integrablePower i) := mul_nonneg (mul_nonneg (by positivity) (by positivity)) (add_nonneg (derivativeSeminormSum_nonneg _ _ _) (derivativeSeminormSum_nonneg _ _ _)) calc _ ≤ ((2 : ℝ)^i * (1 + 2 * Real.pi)^i * (derivativeSeminormSum g 0 i + derivativeSeminormSum g (volume : Measure ℝ).integrablePower i)) * (1 + ‖t‖)^i := by convert hb using 1; ring_nf _ ≤ _ := mul_le_mul_of_nonneg_left (pow_le_pow_right₀ (by linarith [norm_nonneg t]) hin) hn lemma fourierPointBound_mono (K : ℕ) {C D : ℝ} (hCD : C ≤ D) : fourierPointBound K C ≤ fourierPointBound K D := by unfold fourierPointBound fourierSeminormBound gcongr lemma fourierPointBound_mul (K : ℕ) (C D : ℝ) : fourierPointBound K (C * D) = fourierPointBound K C * D := by unfold fourierPointBound fourierSeminormBound ring theorem twisted_profile_fourier_envelope (g : 𝓢(ℝ, ℂ)) (t s : ℝ) (J : ℕ) : ‖(𝓕 (frequencyTwist g t)) s‖ ≤ fourierPointBound (J + 2) (twistSourceBound g (J + 2)) * (1 + ‖t‖)^(J + 2) * FirstPassCubeLabels.firstLogDensity J s := by calc _ ≤ fourierPointBound (J + 2) (profileSourceBound (frequencyTwist g t) (J + 2)) * FirstPassCubeLabels.firstLogDensity J s := profile_fourier_envelope _ _ _ _ ≤ fourierPointBound (J + 2) (twistSourceBound g (J + 2) * (1 + ‖t‖)^(J + 2)) * FirstPassCubeLabels.firstLogDensity J s := mul_le_mul_of_nonneg_right (fourierPointBound_mono _ (profileSourceBound_frequencyTwist _ _ _)) (FirstPassCubeLabels.firstLogDensity_nonneg _ _) _ = _ := by rw [fourierPointBound_mul] end JointLogSeparation section open scoped BigOperators Classical SchwartzMap FourierTransform open MeasureTheory namespace JointLogSeparation open FourierBridge lemma integrable_phase_schwartz (b : 𝓢(ℝ, ℂ)) (x : ℝ) : Integrable (fun t : ℝ => logPhase t x * b t) := by have h := FirstPassCubeLabels.integrable_log_pair b x 0 1 convert h using 1 funext t simp [logPhase, mul_comm] theorem finite_triple_phase_integral {α : Type*} (s : Finset α) (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) (x y z : α → ℝ) (c : α → ℂ) : (∑ i ∈ s, ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, (logPhase t₁ (x i) * b₁ t₁) * ((logPhase t₂ (y i) * b₂ t₂) * ((logPhase t₃ (z i) * b₃ t₃) * c i))) = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, ∑ i ∈ s, (logPhase t₁ (x i) * b₁ t₁) * ((logPhase t₂ (y i) * b₂ t₂) * ((logPhase t₃ (z i) * b₃ t₃) * c i)) := by let f := fun i (t₁ t₂ t₃ : ℝ) => (logPhase t₁ (x i) * b₁ t₁) * ((logPhase t₂ (y i) * b₂ t₂) * ((logPhase t₃ (z i) * b₃ t₃) * c i)) have hi₃ (i : α) (t₁ t₂ : ℝ) : Integrable (f i t₁ t₂) := (((integrable_phase_schwartz b₃ (z i)).mul_const (c i)).const_mul _).const_mul _ have hi₂ (i : α) (t₁ : ℝ) : Integrable (fun t₂ => ∫ t₃ : ℝ, f i t₁ t₂ t₃) := by simp only [f, integral_const_mul, integral_mul_const] exact ((integrable_phase_schwartz b₂ (y i)).mul_const _).const_mul _ have hi₁ (i : α) : Integrable (fun t₁ => ∫ t₂ : ℝ, ∫ t₃ : ℝ, f i t₁ t₂ t₃) := by simp only [f, integral_const_mul, integral_mul_const] exact (integrable_phase_schwartz b₁ (x i)).mul_const _ change (∑ i ∈ s, ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, f i t₁ t₂ t₃) = _ rw [← integral_finsetSum _ (fun i _ => hi₁ i)] apply integral_congr_ae filter_upwards [] with t₁ rw [← integral_finsetSum _ (fun i _ => hi₂ i t₁)] apply integral_congr_ae filter_upwards [] with t₂ exact (integral_finsetSum _ (fun i _ => hi₃ i t₁ t₂)).symm end JointLogSeparation namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (columnLog firstLogDensity) open JointLogSeparation (outerWindow fixedColumnTest) open FourierBridge (logPhase) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def postCommonSmoothPair (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m f y₁ y₂ : O) (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap X₁ X₂ R : ℝ) : ℂ := ∑ N ∈ F.powerset, ∑ M ∈ F.powerset, star (secondChildColumn p hp hcop hg Ψ₁ m f y₁ (fun _ => 1) N) * secondChildColumn p hp hcop hg Ψ₂ m f y₂ (fun _ => 1) M * (outerWindow V z ud ue uv kap * V 5 (columnLog p X₁ N) * V 6 (columnLog p X₂ M) * A₁ (z + columnLog p X₁ N) * A₂ (z + columnLog p X₂ M) * EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp (kap - ud - 2 * ue - 2 * uv - columnLog p X₁ N - columnLog p X₂ M))) def fixedSecondTest (V : ℝ → ℂ) (X t s : ℝ) (negative : Bool) (N : Finset ι) : ℂ := if negative then star (fixedColumnTest V (t-s) (columnLog p X N)) else fixedColumnTest V (t-s) (columnLog p X N) theorem postCommonSmoothPair_fixed_tests (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m f y₁ y₂ : O) (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap X₁ X₂ R : ℝ) (b : 𝓢(ℝ, ℂ)) (hsep : ∀ a a' : ℝ, outerWindow V z ud ue uv kap * V 5 a * V 6 a' * A₁ (z+a) * A₂ (z+a') * EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp (kap-ud-2*ue-2*uv-a-a')) = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, outerWindow V z ud ue uv kap * logPhase (t₁+t₂) z * logPhase t₃ (kap-ud-2*ue-2*uv) * fixedColumnTest (V 5) (t₁-t₃) a * fixedColumnTest (V 6) (t₂-t₃) a' * ((𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃)) : postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ A₁ A₂ W V z ud ue uv kap X₁ X₂ R = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, (outerWindow V z ud ue uv kap * logPhase (t₁+t₂) z * logPhase t₃ (kap-ud-2*ue-2*uv) * ((𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃)) * star (fixedChildRow p hp hcop hg F Ψ₁ m (fixedSecondTest p (V 5) X₁ t₁ t₃ true) f y₁) * fixedChildRow p hp hcop hg F Ψ₂ m (fixedSecondTest p (V 6) X₂ t₂ t₃ false) f y₂ := by let B₁ := fun N => secondChildColumn p hp hcop hg Ψ₁ m f y₁ (fun _ => 1) N let B₂ := fun M => secondChildColumn p hp hcop hg Ψ₂ m f y₂ (fun _ => 1) M let q := fun (i : Finset ι × Finset ι) => outerWindow V z ud ue uv kap * V 5 (columnLog p X₁ i.1) * V 6 (columnLog p X₂ i.2) * star (B₁ i.1) * B₂ i.2 let K := fun (i : Finset ι × Finset ι) (t₁ t₂ t₃ : ℝ) => (logPhase t₁ (z + columnLog p X₁ i.1) * (𝓕 A₁) t₁) * ((logPhase t₂ (z + columnLog p X₂ i.2) * (𝓕 A₂) t₂) * ((logPhase t₃ (kap-ud-2*ue-2*uv-columnLog p X₁ i.1-columnLog p X₂ i.2) * b t₃) * q i)) have hterm (N M : Finset ι) : star (B₁ N) * B₂ M * (outerWindow V z ud ue uv kap * V 5 (columnLog p X₁ N) * V 6 (columnLog p X₂ M) * A₁ (z+columnLog p X₁ N) * A₂ (z+columnLog p X₂ M) * EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp (kap-ud-2*ue-2*uv-columnLog p X₁ N-columnLog p X₂ M))) = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, K (N,M) t₁ t₂ t₃ := by rw [hsep] simp_rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with t₁ apply integral_congr_ae filter_upwards [] with t₂ apply integral_congr_ae filter_upwards [] with t₃ have hphase := JointLogSeparation.seven_phase_factor z ud ue uv kap (columnLog p X₁ N) (columnLog p X₂ M) t₁ t₂ t₃ dsimp only [K, q] unfold fixedColumnTest calc _ = (outerWindow V z ud ue uv kap * V 5 (columnLog p X₁ N) * V 6 (columnLog p X₂ M) * star (B₁ N) * B₂ M) * (logPhase (t₁+t₂) z * logPhase t₃ (kap-ud-2*ue-2*uv) * logPhase (t₁-t₃) (columnLog p X₁ N) * logPhase (t₂-t₃) (columnLog p X₂ M)) * ((𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃) := by ring _ = _ := by rw [← hphase]; ring calc _ = ∑ i ∈ F.powerset ×ˢ F.powerset, ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, K i t₁ t₂ t₃ := by simp only [postCommonSmoothPair, Finset.sum_product] exact Finset.sum_congr rfl (fun N _ => Finset.sum_congr rfl (fun M _ => hterm N M)) _ = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, ∑ i ∈ F.powerset ×ˢ F.powerset, K i t₁ t₂ t₃ := JointLogSeparation.finite_triple_phase_integral _ (𝓕 A₁) (𝓕 A₂) b _ _ _ q _ = _ := by apply integral_congr_ae filter_upwards [] with t₁ apply integral_congr_ae filter_upwards [] with t₂ apply integral_congr_ae filter_upwards [] with t₃ simp only [Finset.sum_product] have hcols : (∑ N ∈ F.powerset, ∑ M ∈ F.powerset, K (N,M) t₁ t₂ t₃) = (outerWindow V z ud ue uv kap * logPhase (t₁+t₂) z * logPhase t₃ (kap-ud-2*ue-2*uv) * ((𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃)) * (∑ N ∈ F.powerset, star (B₁ N) * fixedColumnTest (V 5) (t₁-t₃) (columnLog p X₁ N)) * (∑ M ∈ F.powerset, B₂ M * fixedColumnTest (V 6) (t₂-t₃) (columnLog p X₂ M)) := by simp only [Finset.mul_sum, Finset.sum_mul] conv_rhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro N hN apply Finset.sum_congr rfl intro M hM have hphase := JointLogSeparation.seven_phase_factor z ud ue uv kap (columnLog p X₁ N) (columnLog p X₂ M) t₁ t₂ t₃ dsimp only [K, q] unfold fixedColumnTest calc _ = (outerWindow V z ud ue uv kap * V 5 (columnLog p X₁ N) * V 6 (columnLog p X₂ M) * star (B₁ N) * B₂ M) * (logPhase t₁ (z+columnLog p X₁ N) * logPhase t₂ (z+columnLog p X₂ M) * logPhase t₃ (kap-ud-2*ue-2*uv-columnLog p X₁ N-columnLog p X₂ M)) * ((𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃) := by ring _ = _ := by rw [hphase]; ring rw [hcols] have hleft : (∑ N ∈ F.powerset, star (B₁ N) * fixedColumnTest (V 5) (t₁-t₃) (columnLog p X₁ N)) = star (fixedChildRow p hp hcop hg F Ψ₁ m (fixedSecondTest p (V 5) X₁ t₁ t₃ true) f y₁) := by simp only [fixedChildRow, star_sum] apply Finset.sum_congr rfl intro N hN simp only [secondChildColumn, fixedSecondTest, ite_true, B₁, star_mul, star_star, mul_one] ring have hright : (∑ N ∈ F.powerset, B₂ N * fixedColumnTest (V 6) (t₂-t₃) (columnLog p X₂ N)) = fixedChildRow p hp hcop hg F Ψ₂ m (fixedSecondTest p (V 6) X₂ t₂ t₃ false) f y₂ := by apply Finset.sum_congr rfl intro N hN simp only [secondChildColumn, fixedSecondTest, Bool.false_eq_true, ite_false, B₂, mul_one] rw [hleft, hright] def separatedPostCommon (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m f y₁ y₂ : O) (A₁ A₂ b : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap X₁ X₂ : ℝ) : ℂ := ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, (outerWindow V z ud ue uv kap * logPhase (t₁+t₂) z * logPhase t₃ (kap-ud-2*ue-2*uv) * ((𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃)) * star (fixedChildRow p hp hcop hg F Ψ₁ m (fixedSecondTest p (V 5) X₁ t₁ t₃ true) f y₁) * fixedChildRow p hp hcop hg F Ψ₂ m (fixedSecondTest p (V 6) X₂ t₂ t₃ false) f y₂ theorem postCommonSmoothPair_uniform_fixed_tests (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), (∀ t₁ t₂ t₃ : ℝ, (1+R)^A * ‖(𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃‖ ≤ C * firstLogDensity J t₁ * firstLogDensity J t₂ * firstLogDensity J t₃) ∧ ∀ (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m f y₁ y₂ : O) (z ud ue uv kap X₁ X₂ : ℝ), postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ A₁ A₂ W V z ud ue uv kap X₁ X₂ R = separatedPostCommon p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ A₁ A₂ b V z ud ue uv kap X₁ X₂ := by obtain ⟨C, hC, hsep⟩ := JointLogSeparation.seven_kernel_separation A₁ A₂ W V M hM hV A J refine ⟨C, hC, ?_⟩ intro R hR obtain ⟨b, hb, hpoint, hint⟩ := hsep R hR refine ⟨b, hpoint, ?_⟩ intro F Ψ₁ Ψ₂ m f y₁ y₂ z ud ue uv kap X₁ X₂ exact postCommonSmoothPair_fixed_tests p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ A₁ A₂ W V z ud ue uv kap X₁ X₂ R b (hb z ud ue uv kap) end SecondPassArithmetic end open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open ConcretePrimeRowBridge (idealGenerator span_idealGenerator) open SecondPassFiber (OldTuple newLabel newRow Valid) abbrev instFintypeUnitsO_1 : Fintype Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem labeled_child_second_energy_pushforward (ε : ℝ) (hε : 0 < ε) : let : Fintype Oˣ := instFintypeUnitsO_1 ∃ C : ℝ, 0 < C ∧ ∀ (s : Finset OldTuple) (t : Finset (Ideal O × O)) (b0 : Ideal O) (w : OldTuple → ℂ) (B lengthScale : ℝ) (label : OldTuple → O) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (negative : Bool), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ t) → (∀ z ∈ t, z.1 ≠ ⊥) → (∀ z ∈ t, (Ideal.absNorm z.1 : ℝ) ≤ lengthScale) → (∀ x ∈ s, ‖w x‖ ≤ B) → (∀ x ∈ s, Ideal.span {label x} = newLabel x) → (∑ x ∈ s, ‖w x‖ * ‖fixedChildRow p hp hcop hg F Ψ m H (label x) (if negative then -newRow x else newRow x)‖ ^ 2) ≤ B * C * (lengthScale * Ideal.absNorm b0) ^ ε * ∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ m H negative u z‖ ^ 2 := by let : Fintype Oˣ := instFintypeUnitsO_1 obtain ⟨C, hC, hb⟩ := second_energy_selected_family (κ := Oˣ) ε hε refine ⟨C, hC, ?_⟩ intro s t b0 w B lengthScale label F Ψ m H negative hb0 hB hL hvalid hmap ht hnorm hw hlabel let sel : OldTuple → Oˣ := fun x => if hx : x ∈ s then Classical.choose (exists_label_unit (label x) (newLabel x) (hlabel x hx)) else 1 have hsel (x : OldTuple) (hx : x ∈ s) : label x = (sel x : O) * idealGenerator (newLabel x) := by simp only [sel, dite_eq_left hx] exact Classical.choose_spec (exists_label_unit (label x) (newLabel x) (hlabel x hx)) have hh := hb s t b0 w B lengthScale (idealChildRow p hp hcop hg F Ψ m H negative) sel hb0 hB hL hvalid hmap ht hnorm hw convert hh using 1 apply Finset.sum_congr rfl intro x hx rw [hsel x hx] rfl end open ActualEisensteinCubic open FirstCauchyArithmetic (supportMobius) open RayFourExpansion (RayCharacter gCoeff crossCoeff) lemma secondRayMinus_norm_le (Ψ : O →* ℂ) (z : SecondRayIndex) (a : O) : ‖secondRayMinus Ψ z a‖ ≤ ‖Ψ a‖ := by letI importedWitness0 := @OAI.RayFourExpansion.rayRingFintype simp only [secondRayMinus, MonoidHom.mul_apply, norm_mul, conjugateRayMonoid_apply, norm_star] calc _ ≤ 1 * (1 * ‖Ψ a‖) := by gcongr <;> exact FiniteRayExpansion.norm_char_le_one _ _ _ = _ := by ring lemma secondRayPlus_norm_le (Ψ : O →* ℂ) (z : SecondRayIndex) (a : O) : ‖secondRayPlus Ψ z a‖ ≤ ‖Ψ a‖ := by letI importedWitness0 := @OAI.RayFourExpansion.rayRingFintype simp only [secondRayPlus, MonoidHom.mul_apply, norm_mul, conjugateRayMonoid_apply, rayMonoid_apply, norm_star] calc _ ≤ 1 * (1 * ‖Ψ a‖) := by gcongr <;> exact FiniteRayExpansion.norm_char_le_one _ _ _ = _ := by ring section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem secondPreColumn_norm_le (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (Ψ : O →* ℂ) (m c d e k : O) (S : Finset ι) : ‖secondPreColumn p hp hcop hg Ψ m c d e k (fun _ => 1) S‖ ≤ ‖Ψ (∏ i ∈ S, p i)‖ := by have hm : ‖rowCoprimeMask (fun i => Ideal.span {p i}) S m‖ ≤ 1 := by unfold rowCoprimeMask split_ifs <;> norm_num simp only [secondPreColumn, norm_mul, norm_pow, norm_star, norm_one, columnCoefficient_norm_one p hp hcop hg hc S] calc _ ≤ 1 * ‖Ψ (∏ i ∈ S, p i)‖ * 1 * 1 ^ 4 * 1 * 1 * 1 * 1 := by gcongr <;> first | exact hm | exact finiteSquarefreeRow_norm_le_one _ hg S _ _ = _ := by ring theorem secondCommonWeight_norm_le (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k₁ k₂ : O) (S : Finset ι) : ‖secondCommonWeight p hp hcop hg Ψ₁ Ψ₂ m r c d e k₁ k₂ S‖ ≤ ‖Ψ₁ (∏ i ∈ S, p i)‖ * ‖Ψ₂ (∏ i ∈ S, p i)‖ := by have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance have hmu : ‖supportMobius (fun i => Ideal.span {p i}) S‖ = 1 := by have h := congrArg norm (FirstCauchyArithmetic.supportMobius_sq _ hprime hinj S) simp only [norm_mul, norm_one] at h nlinarith [norm_nonneg (supportMobius (fun i => Ideal.span {p i}) S)] simp only [secondCommonWeight, norm_mul, norm_star, hmu, one_mul] exact mul_le_mul (secondPreColumn_norm_le p hp hcop hg hc Ψ₁ _ _ _ _ _ S) (secondPreColumn_norm_le p hp hcop hg hc Ψ₂ _ _ _ _ _ S) (norm_nonneg _) (norm_nonneg _) theorem secondTotalWeight_norm_le (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (z : SecondRayIndex) (S : Finset ι) (hΨ₁ : ‖Ψ₁ (∏ i ∈ S, p i)‖ ≤ 1) (hΨ₂ : ‖Ψ₂ (∏ i ∈ S, p i)‖ ≤ 1) : ‖secondTotalWeight p hp hcop hg Ψ₁ Ψ₂ m r c d e k (z,S)‖ ≤ ‖secondRayCoefficient z‖ := by have h := secondCommonWeight_norm_le p hp hcop hg hinj hc (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m r c d e k (-k) S have h₁ := (secondRayMinus_norm_le Ψ₁ z (∏ i ∈ S, p i)).trans hΨ₁ have h₂ := (secondRayPlus_norm_le Ψ₂ z (∏ i ∈ S, p i)).trans hΨ₂ have hc' : ‖secondCommonWeight p hp hcop hg (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m r c d e k (-k) S‖ ≤ 1 := by apply h.trans simpa using mul_le_mul h₁ h₂ (norm_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) simp only [secondTotalWeight, norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) hc' end theorem secondRayCoefficient_mass : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype (∑ z : SecondRayIndex, ‖secondRayCoefficient z‖) ≤ 512 * 32 ^ 2 := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype have hG := RayFourExpansion.gCoeff_sum_norm_le have hQ := RayFourExpansion.crossCoeff_sum_norm_le have heq : (∑ z : SecondRayIndex, ‖secondRayCoefficient z‖) = (∑ χ : RayCharacter, ∑ η : RayCharacter, ‖crossCoeff χ η‖) * (∑ a : RayCharacter, ‖gCoeff a‖) ^ 2 := by simp only [secondRayCoefficient, Fintype.sum_prod_type, norm_mul, norm_star, pow_two, Finset.sum_mul, Finset.mul_sum] apply Finset.sum_congr rfl intro a ha apply Finset.sum_congr rfl intro b hb apply Finset.sum_congr rfl intro χ hχ apply Finset.sum_congr rfl intro η hη ring rw [heq] exact mul_le_mul hQ (pow_le_pow_left₀ (by positivity) hG 2) (by positivity) (by norm_num) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.ChildTransfer namespace OAI noncomputable section namespace SecondPassArithmetic open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators section open scoped BigOperators Classical section open ActualEisensteinCubic open SecondPassFiber (OldTuple newLabel newRow Valid) abbrev instFintypeUnitsO_2 : Fintype Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def fixedSecondMode (s : Finset OldTuple) (w : OldTuple → ℂ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (H₁ H₂ : Finset ι → ℂ) : ℂ := ∑ x ∈ s, w x * star (fixedChildRow p hp hcop hg F Ψ₁ m H₁ (label x) (newRow x)) * fixedChildRow p hp hcop hg F Ψ₂ m H₂ (label x) (-newRow x) theorem fixed_second_mode_transfer (ε : ℝ) (hε : 0 < ε) : let : Fintype Oˣ := instFintypeUnitsO_2 ∃ C : ℝ, 0 < C ∧ ∀ (s : Finset OldTuple) (t : Finset (Ideal O × O)) (b0 : Ideal O) (w : OldTuple → ℂ) (B lengthScale : ℝ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (H₁ H₂ : Finset ι → ℂ), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ t) → (∀ z ∈ t, z.1 ≠ ⊥) → (∀ z ∈ t, (Ideal.absNorm z.1 : ℝ) ≤ lengthScale) → (∀ x ∈ s, ‖w x‖ ≤ B) → (∀ x ∈ s, Ideal.span {label x} = newLabel x) → ‖fixedSecondMode p hp hcop hg s w label F Ψ₁ Ψ₂ m H₁ H₂‖ ≤ (B * C * (lengthScale * Ideal.absNorm b0)^ε) * Real.sqrt (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₁ m H₁ false u z‖ ^ 2) * Real.sqrt (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₂ m H₂ true u z‖ ^ 2) := by let : Fintype Oˣ := instFintypeUnitsO_2 obtain ⟨C, hC, hpush⟩ := labeled_child_second_energy_pushforward p hp hcop hg ε hε refine ⟨C, hC, ?_⟩ intro s t b0 w B lengthScale label F Ψ₁ Ψ₂ m H₁ H₂ hb0 hB hL hv hm ht hn hw hl let P₁ := fun x => fixedChildRow p hp hcop hg F Ψ₁ m H₁ (label x) (newRow x) let P₂ := fun x => fixedChildRow p hp hcop hg F Ψ₂ m H₂ (label x) (-newRow x) have h₁ := hpush s t b0 w B lengthScale label F Ψ₁ m H₁ false hb0 hB hL hv hm ht hn hw hl have h₂ := hpush s t b0 w B lengthScale label F Ψ₂ m H₂ true hb0 hB hL hv hm ht hn hw hl simp only [Bool.false_eq_true, ite_false, ite_true] at h₁ h₂ let D : ℝ := B * C * (lengthScale * Ideal.absNorm b0)^ε have hD : 0 ≤ D := by dsimp [D]; positivity have hCau := DescentWeightedCauchy.weighted_cauchy s w P₂ P₁ have hmode : fixedSecondMode p hp hcop hg s w label F Ψ₁ Ψ₂ m H₁ H₂ = ∑ x ∈ s, w x * P₂ x * star (P₁ x) := by unfold fixedSecondMode apply Finset.sum_congr rfl intro x hx dsimp [P₁, P₂] ring rw [hmode] apply hCau.trans calc _ ≤ Real.sqrt (D * (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₂ m H₂ true u z‖ ^ 2)) * Real.sqrt (D * (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₁ m H₁ false u z‖ ^ 2)) := by gcongr _ = _ := by rw [Real.sqrt_mul hD, Real.sqrt_mul hD] calc _ = (Real.sqrt D)^2 * Real.sqrt (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₁ m H₁ false u z‖ ^ 2) * Real.sqrt (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₂ m H₂ true u z‖ ^ 2) := by ring _ = _ := by rw [Real.sq_sqrt hD] end section open ActualEisensteinCubic open FirstCauchyArithmetic (supportMobius supportConjugateSum) variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem secondInputCoefficient_union (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (G U : Finset ι) (hd : Disjoint G U) : secondInputCoefficient p hg Ψ m c d H (G ∪ U) = secondInputCoefficient p hg Ψ m c d (fun _ => 1) G * secondInputCoefficient p hg Ψ m c d (fun V => H (G ∪ V)) U := by simp only [secondInputCoefficient, Finset.prod_union hd, map_mul, FirstPassCubeLabels.mask_union _ hg G U hd, FirstPassCubeLabels.row_union _ hg G U hd, mul_pow, mul_one] ring def inputConjugateRow (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (z : O) : ℂ := supportConjugateSum (fun i => Ideal.span {p i}) hg F (secondInputCoefficient p hg Ψ m c d H) z theorem supportMobius_disjoint_mul (hinj : Function.Injective (fun i => Ideal.span {p i})) (G U : Finset ι) (hd : Disjoint G U) : supportMobius (fun i => Ideal.span {p i}) (G ∪ U) = supportMobius (fun i => Ideal.span {p i}) G * supportMobius (fun i => Ideal.span {p i}) U := by have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance simp only [supportMobius, prime_product_moebius _ hprime hinj, Finset.card_union_of_disjoint hd, pow_add] theorem inputConjugateRow_sq_overlap (hinj : Function.Injective (fun i => Ideal.span {p i})) (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (z : O) : (↑(‖inputConjugateRow p hg F Ψ m c d H z‖ ^ 2) : ℂ) = ∑ G ∈ F.powerset, ∑ U ∈ (F \ G).powerset, ∑ V ∈ (F \ G).powerset, if Disjoint U V then (↑(‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) G‖ ^ 2) : ℂ) * rowCoprimeMask (fun i => Ideal.span {p i}) G z * (star (supportMobius (fun i => Ideal.span {p i}) U * secondInputCoefficient p hg Ψ m c d (fun S => H (G ∪ S)) U) * (supportMobius (fun i => Ideal.span {p i}) V * secondInputCoefficient p hg Ψ m c d (fun S => H (G ∪ S)) V) * (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U z * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg V z))) else 0 := by have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance have hnorm (a : ℂ) : (↑(‖a‖ ^ 2) : ℂ) = star a * a := by rw [Complex.sq_norm, Complex.normSq_eq_conj_mul_self] rfl rw [hnorm] unfold inputConjugateRow supportConjugateSum rw [star_sum, Finset.sum_mul] simp only [Finset.mul_sum] rw [FiniteOverlapDecomposition.sum_pair_eq_overlap] apply Finset.sum_congr rfl intro G hG apply Finset.sum_congr rfl intro U hU apply Finset.sum_congr rfl intro V hV by_cases hd : Disjoint U V · rw [ite_eq_left hd, ite_eq_left hd] have hGU : Disjoint G U := Finset.disjoint_left.mpr (fun i hi hu => (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hU) hu)).2 hi) have hGV : Disjoint G V := Finset.disjoint_left.mpr (fun i hi hv => (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hV) hv)).2 hi) rw [supportMobius_disjoint_mul p hinj G U hGU, supportMobius_disjoint_mul p hinj G V hGV, secondInputCoefficient_union p hg Ψ m c d H G U hGU, secondInputCoefficient_union p hg Ψ m c d H G V hGV, FirstPassCubeLabels.row_union _ hg G U hGU, FirstPassCubeLabels.row_union _ hg G V hGV] simp only [star_mul, star_star, FirstCauchyArithmetic.star_supportMobius] have hmu := FirstCauchyArithmetic.supportMobius_sq _ hprime hinj G have hrow := finiteSquarefreeRow_self_pair (fun i => Ideal.span {p i}) hg G z rw [hnorm] calc _ = (supportMobius (fun i => Ideal.span {p i}) G * supportMobius (fun i => Ideal.span {p i}) G) * (star (secondInputCoefficient p hg Ψ m c d (fun _ => 1) G) * secondInputCoefficient p hg Ψ m c d (fun _ => 1) G) * (star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg G z) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg G z) * (star (supportMobius (fun i => Ideal.span {p i}) U * secondInputCoefficient p hg Ψ m c d (fun S => H (G ∪ S)) U) * (supportMobius (fun i => Ideal.span {p i}) V * secondInputCoefficient p hg Ψ m c d (fun S => H (G ∪ S)) V) * (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U z * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg V z))) := by simp only [star_mul, FirstCauchyArithmetic.star_supportMobius] ring _ = _ := by rw [hmu, hrow] simp only [star_mul, FirstCauchyArithmetic.star_supportMobius] ring · simp [hd] end section open ActualEisensteinCubic variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) include hg theorem commonProduct_mask (hinj : Function.Injective (fun i => Ideal.span {p i})) (U G : Finset ι) : rowCoprimeMask (fun i => Ideal.span {p i}) U (∏ i ∈ G, p i) = if Disjoint U G then 1 else 0 := by by_cases hd : Disjoint U G · rw [ite_eq_left hd, FirstPassCubeLabels.mask_prod _ hg U G p] apply Finset.prod_eq_one intro j hj have hh : ¬ ∃ i ∈ U, p j ∈ Ideal.span {p i} := by rintro ⟨i, hi, hpi⟩ have hij : i ≠ j := fun he => Finset.disjoint_left.mp hd hi (he ▸ hj) exact (prime_generator_not_mem_of_ne (Ideal.span {p i}) (Ideal.span {p j}) (fun he => hij (hinj he)) (p j) rfl) hpi simp [rowCoprimeMask, hh] · rw [ite_eq_right hd] obtain ⟨i, hiU, hiG⟩ := Finset.not_disjoint_iff.mp hd have hh : ∃ j ∈ U, (∏ i ∈ G, p i) ∈ Ideal.span {p j} := ⟨i, hiU, Ideal.mem_span_singleton.mpr (Finset.dvd_prod_of_mem p hiG)⟩ simp [rowCoprimeMask, hh] theorem sum_remove_common_pool (hinj : Function.Injective (fun i => Ideal.span {p i})) (F G : Finset ι) (A : Finset ι → ℂ) : (∑ U ∈ (F \ G).powerset, A U) = ∑ U ∈ F.powerset, rowCoprimeMask (fun i => Ideal.span {p i}) U (∏ i ∈ G, p i) * A U := by have hsub : (F \ G).powerset ⊆ F.powerset := Finset.powerset_mono.mpr Finset.sdiff_subset calc _ = ∑ U ∈ (F \ G).powerset, rowCoprimeMask (fun i => Ideal.span {p i}) U (∏ i ∈ G, p i) * A U := by apply Finset.sum_congr rfl intro U hU have hd : Disjoint U G := Finset.disjoint_left.mpr (fun i hi hG => (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hU) hi)).2 hG) rw [commonProduct_mask p hg hinj U G, ite_eq_left hd, one_mul] _ = _ := by apply Finset.sum_subset hsub intro U hUF hUG have hd : ¬ Disjoint U G := by intro hd apply hUG apply Finset.mem_powerset.mpr intro i hi exact Finset.mem_sdiff.mpr ⟨(Finset.mem_powerset.mp hUF) hi, fun hG => Finset.disjoint_left.mp hd hi hG⟩ rw [commonProduct_mask p hg hinj U G, ite_eq_right hd, zero_mul] omit [DecidableEq ι] in theorem secondInputCoefficient_fixed_mask (Ψ : O →* ℂ) (m g c d : O) (H : Finset ι → ℂ) (U : Finset ι) : secondInputCoefficient p hg Ψ (m*g) c d H U = rowCoprimeMask (fun i => Ideal.span {p i}) U g * secondInputCoefficient p hg Ψ m c d H U := by rw [secondInputCoefficient, FirstPassCubeLabels.mask_mul _ hg U m g] unfold secondInputCoefficient ring end section open ActualEisensteinCubic open FirstCauchyArithmetic (supportMobius) variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) include hg theorem sum_pair_remove_common_pool (hinj : Function.Injective (fun i => Ideal.span {p i})) (F G : Finset ι) (A : Finset ι → Finset ι → ℂ) : (∑ U ∈ (F \ G).powerset, ∑ V ∈ (F \ G).powerset, A U V) = ∑ U ∈ F.powerset, ∑ V ∈ F.powerset, rowCoprimeMask (fun i => Ideal.span {p i}) U (∏ i ∈ G, p i) * rowCoprimeMask (fun i => Ideal.span {p i}) V (∏ i ∈ G, p i) * A U V := by rw [sum_remove_common_pool p hg hinj F G] apply Finset.sum_congr rfl intro U hU rw [sum_remove_common_pool p hg hinj F G, Finset.mul_sum] apply Finset.sum_congr rfl intro V hV ring omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] hg in lemma star_mask (P : ι → Ideal O) (S : Finset ι) (a : O) : star (rowCoprimeMask P S a) = rowCoprimeMask P S a := by unfold rowCoprimeMask split_ifs <;> simp theorem input_pair_fixed_pool (hinj : Function.Injective (fun i => Ideal.span {p i})) (F G : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m c d : O) (H₁ H₂ : Finset ι → ℂ) (K : Finset ι → Finset ι → ℂ) : (∑ U ∈ (F \ G).powerset, ∑ V ∈ (F \ G).powerset, if Disjoint U V then star (supportMobius (fun i => Ideal.span {p i}) U * secondInputCoefficient p hg Ψ₁ m c d H₁ U) * (supportMobius (fun i => Ideal.span {p i}) V * secondInputCoefficient p hg Ψ₂ m c d H₂ V) * K U V else 0) = ∑ U ∈ F.powerset, ∑ V ∈ F.powerset, if Disjoint U V then star (supportMobius (fun i => Ideal.span {p i}) U * secondInputCoefficient p hg Ψ₁ (m * ∏ i ∈ G, p i) c d H₁ U) * (supportMobius (fun i => Ideal.span {p i}) V * secondInputCoefficient p hg Ψ₂ (m * ∏ i ∈ G, p i) c d H₂ V) * K U V else 0 := by rw [sum_pair_remove_common_pool p hg hinj F G] apply Finset.sum_congr rfl intro U hU apply Finset.sum_congr rfl intro V hV by_cases hd : Disjoint U V · rw [ite_eq_left hd, ite_eq_left hd, secondInputCoefficient_fixed_mask, secondInputCoefficient_fixed_mask] simp only [star_mul, star_mask] ring · simp [hd] omit hg in omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem poisson_mask_generator_dvd (E G : Finset ι) (hEG : E ⊆ G) : primeSubsetGenerator (fun i => Ideal.span {p i}) E ∣ ∏ i ∈ G, p i := by have hs : Ideal.span {primeSubsetGenerator (fun i => Ideal.span {p i}) E} = Ideal.span {∏ i ∈ E, p i} := by rw [primeSubsetGenerator, ConcretePrimeRowBridge.span_idealGenerator, FiniteGaussPhase.span_finset_prod] have ha := Ideal.span_singleton_eq_span_singleton.mp hs exact (dvd_dvd_iff_associated.mpr ha).1.trans (Finset.prod_dvd_prod_of_subset E G p hEG) omit hg in def secondMaskQuotient (E G : Finset ι) (hEG : E ⊆ G) : O := Classical.choose (poisson_mask_generator_dvd p E G hEG) omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] hg in theorem secondMaskQuotient_spec (E G : Finset ι) (hEG : E ⊆ G) : (∏ i ∈ G, p i) = primeSubsetGenerator (fun i => Ideal.span {p i}) E * secondMaskQuotient p E G hEG := Classical.choose_spec (poisson_mask_generator_dvd p E G hEG) end open ActualEisensteinCubic theorem secondMaskQuotient_span {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (E G : Finset ι) (hEG : E ⊆ G) : Ideal.span {secondMaskQuotient p E G hEG} = ∏ i ∈ G \ E, Ideal.span {p i} := by have hE : (∏ i ∈ E, Ideal.span {p i}) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i _ => NeZero.ne (Ideal.span {p i})) have he : Ideal.span {primeSubsetGenerator (fun i => Ideal.span {p i}) E} = ∏ i ∈ E, Ideal.span {p i} := by rw [primeSubsetGenerator, ConcretePrimeRowBridge.span_idealGenerator] apply mul_left_cancel₀ hE calc _ = Ideal.span {primeSubsetGenerator (fun i => Ideal.span {p i}) E * secondMaskQuotient p E G hEG} := by rw [← he, Ideal.span_singleton_mul_span_singleton] _ = Ideal.span {∏ i ∈ G, p i} := by rw [← secondMaskQuotient_spec] _ = ∏ i ∈ G, Ideal.span {p i} := FiniteGaussPhase.span_finset_prod G p _ = _ := by simpa only [mul_comm] using (Finset.prod_sdiff (f := fun i => Ideal.span {p i}) hEG).symm end section open scoped BigOperators Classical SchwartzMap ContDiff open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open FirstCauchyArithmetic (supportMobius) open EisensteinSchwartzPoisson (paperRadialFourier) variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) def maskedSecondSource (G U V : Finset ι) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : ℂ := ∑' z : O, rowCoprimeMask (fun i => Ideal.span {p i}) G z * (star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg V z) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U z) * W (‖eisEmbedding z‖ ^ 2 / Y) def overlapPairWeight (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (G U V : Finset ι) : ℂ := (↑(‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) G‖ ^ 2) : ℂ) * star (supportMobius (fun i => Ideal.span {p i}) U * secondInputCoefficient p hg Ψ m c d (fun S => H (G ∪ S)) U) * (supportMobius (fun i => Ideal.span {p i}) V * secondInputCoefficient p hg Ψ m c d (fun S => H (G ∪ S)) V) omit [DecidableEq ι] in theorem maskedSecondSource_summable (G U V : Finset ι) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) : Summable (fun z : O => rowCoprimeMask (fun i => Ideal.span {p i}) G z * (star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg V z) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U z) * W (‖eisEmbedding z‖ ^ 2 / Y)) := by have h := finiteSquarefreeRow_pair_radial_summable (fun i => Ideal.span {p i}) hg V U W Y hY apply Summable.of_norm apply Summable.of_nonneg_of_le (fun z => norm_nonneg _) _ h.norm intro z have hm : ‖rowCoprimeMask (fun i => Ideal.span {p i}) G z‖ ≤ 1 := by unfold rowCoprimeMask split_ifs <;> norm_num simpa only [norm_mul, one_mul, mul_assoc] using mul_le_mul_of_nonneg_right hm (norm_nonneg ((star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg V z) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U z) * W (‖eisEmbedding z‖ ^ 2 / Y))) theorem inputConjugateRow_smoothed_overlap (hinj : Function.Injective (fun i => Ideal.span {p i})) (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) : (∑' z : O, W (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖inputConjugateRow p hg F Ψ m c d H z‖ ^ 2) : ℂ)) = ∑ G ∈ F.powerset, ∑ U ∈ (F \ G).powerset, ∑ V ∈ (F \ G).powerset, if Disjoint U V then overlapPairWeight p hg Ψ m c d H G U V * maskedSecondSource p hg G U V W Y else 0 := by let f := fun (G U V : Finset ι) (z : O) => if Disjoint U V then overlapPairWeight p hg Ψ m c d H G U V * (rowCoprimeMask (fun i => Ideal.span {p i}) G z * (star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg V z) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U z) * W (‖eisEmbedding z‖ ^ 2 / Y)) else 0 have hf (G U V : Finset ι) : Summable (f G U V) := by by_cases hd : Disjoint U V · simpa only [f, ite_eq_left hd] using (maskedSecondSource_summable p hg G U V W Y hY).mul_left (overlapPairWeight p hg Ψ m c d H G U V) · simp only [f, ite_eq_right hd] exact summable_zero have he (z : O) : W (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖inputConjugateRow p hg F Ψ m c d H z‖ ^ 2) : ℂ) = ∑ G ∈ F.powerset, ∑ U ∈ (F \ G).powerset, ∑ V ∈ (F \ G).powerset, f G U V z := by rw [inputConjugateRow_sq_overlap p hg hinj] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro G hG apply Finset.sum_congr rfl intro U hU apply Finset.sum_congr rfl intro V hV by_cases hd : Disjoint U V · simp only [f, ite_eq_left hd, overlapPairWeight] ring · simp [f, hd] rw [tsum_congr he] rw [Summable.tsum_finsetSum (fun G _ => summable_sum (fun U _ => summable_sum (fun V _ => hf G U V)))] apply Finset.sum_congr rfl intro G hG rw [Summable.tsum_finsetSum (fun U _ => summable_sum (fun V _ => hf G U V))] apply Finset.sum_congr rfl intro U hU rw [Summable.tsum_finsetSum (fun V _ => hf G U V)] apply Finset.sum_congr rfl intro V hV by_cases hd : Disjoint U V · simp only [f, ite_eq_left hd, maskedSecondSource] exact tsum_mul_left · simp [f, hd] def maskedSecondDual (hp : ∀ i, p i ≠ 0) (hinj : Function.Injective (fun i => Ideal.span {p i})) (G U V : Finset ι) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : ℂ := let n := ∏ i : activeSupport V U, p i.val ((Y : ℂ) / (‖eisEmbedding n‖ : ℂ)) * ∑ E ∈ G.powerset, let e := primeSubsetGenerator (fun i => Ideal.span {p i}) E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, Ideal.span {p i}) : ℂ) / (‖eisEmbedding e‖ ^ 2 : ℝ)) * ∑' k : O, paperRadialFourier W (Y * ‖eisEmbedding k‖ ^ 2 / (‖eisEmbedding e‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) * FirstCauchyArithmetic.activeGaussRowFactor p hp hinj hg V U e k theorem inputConjugateRow_smoothed_second_poisson (hp : ∀ i, p i ≠ 0) (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) : (∑' z : O, W (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖inputConjugateRow p hg F Ψ m c d H z‖ ^ 2) : ℂ)) = ∑ G ∈ F.powerset, ∑ U ∈ (F \ G).powerset, ∑ V ∈ (F \ G).powerset, if Disjoint U V then overlapPairWeight p hg Ψ m c d H G U V * maskedSecondDual p hg hp hinj G U V W Y else 0 := by rw [inputConjugateRow_smoothed_overlap p hg hinj F Ψ m c d H W Y hY] apply Finset.sum_congr rfl intro G hG apply Finset.sum_congr rfl intro U hU apply Finset.sum_congr rfl intro V hV by_cases hd : Disjoint U V · rw [ite_eq_left hd, ite_eq_left hd] congr 1 exact masked_pair_second_poisson p hp hinj hg hc G U V hd W Y hY · simp [hd] end open scoped BigOperators Classical open ActualEisensteinCubic open FirstPassCubeLabels (cubeCoreCoefficient cubeOddSupport coreRayCoefficient coreRayTwist coreRayCharacter dilatedCoreRow dilatedRayColumn afterDilationLabel b0Label jLabel) open FirstCauchyArithmetic (supportMobius supportRay supportConjugateSum) open RayFourExpansion (RayCharacter) open FourierBridge (logPhase) abbrev FirstCoreIndex := RayCharacter × (RayCharacter × RayCharacter) def sideRayMonoid (negative : Bool) (χ : RayCharacter) : O →* ℂ := if negative then conjugateRayMonoid χ else rayMonoid χ variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def multiplicativeCoreColumn (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (S : Finset ι) : ℂ := Ψ (∏ i ∈ S, p i) * rowCoprimeMask (fun i => Ideal.span {p i}) S m * H S def firstCoreTest (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (negative : Bool) (t : ℝ) (D U : Finset ι) : ℂ := H (D ∪ U) * (if negative then star (V (y (D ∪ U)) * logPhase t (-(y (D ∪ U)))) else V (y (D ∪ U)) * logPhase t (-(y (D ∪ U)))) def firstCoreOuter (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (Ψ : O →* ℂ) (m : O) (D : Finset ι) (r : FirstCoreIndex) : ℂ := coreRayCoefficient p (cubeOddSupport B v ε₁ ε₂) negative r.1 r.2.1 r.2.2 * (Ψ * coreRayTwist negative r.1 r.2.2) (∏ i ∈ D, p i) * rowCoprimeMask (fun i => Ideal.span {p i}) D m * (if negative then star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg D (-1)) else 1) def firstCoreTwist (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (r : FirstCoreIndex) : O →* ℂ := sideRayMonoid negative χ * (Ψ * coreRayTwist negative r.1 r.2.2) theorem cubeCoreCoefficient_ray_family (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (C : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (t : ℝ) (S : Finset ι) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t S = ∑ r : FirstCoreIndex, coreRayCoefficient p (cubeOddSupport B v ε₁ ε₂) negative r.1 r.2.1 r.2.2 * supportRay p (coreRayCharacter negative r.1 r.2.2) S * C S * (if negative then star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (-1)) else 1) * (if negative then star (V (y S) * logPhase t (-(y S))) else V (y S) * logPhase t (-(y S))) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype have hphase := FirstPassCubeLabels.core_phase_ray_expansion p hp hcop hg hc hpr (cubeOddSupport B v ε₁ ε₂) S negative have he : cubeCoreCoefficient p hp hcop hg B v ε₁ ε₂ negative C V y t S = ((if negative then star (FirstPassCubeLabels.fixedRayExpansion p (cubeOddSupport B v ε₁ ε₂) S) else FirstPassCubeLabels.fixedRayExpansion p (cubeOddSupport B v ε₁ ε₂) S) * MixedCrossSeparation.columnG p hp hcop hg S) * C S * (if negative then star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (-1)) else 1) * (if negative then star (V (y S) * logPhase t (-(y S))) else V (y S) * logPhase t (-(y S))) := by cases negative <;> simp only [cubeCoreCoefficient, Bool.false_eq_true, ite_false, ite_true] <;> ring rw [he, hphase] simp only [Fintype.sum_prod_type, Finset.sum_mul] theorem dilatedCoreRow_eq_input_family (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (t : ℝ) (z : O) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative χ (multiplicativeCoreColumn p Ψ m H) V y c d t z = ∑ r : FirstCoreIndex, firstCoreOuter p hg B v ε₁ ε₂ negative Ψ m D r * inputConjugateRow p hg (F \ D) (firstCoreTwist negative χ Ψ r) (m * b0Label p B v ε₁ ε₂) (c * jLabel p B v ε₁ ε₂) d (firstCoreTest H V y negative t D) (if negative then -z else z) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype unfold dilatedCoreRow dilatedRayColumn supportConjugateSum simp_rw [cubeCoreCoefficient_ray_family p hp hcop hg hc hpr] simp only [Finset.mul_sum, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro r hr simp only [inputConjugateRow, supportConjugateSum, Finset.mul_sum] apply Finset.sum_congr rfl intro U hU have hDU : Disjoint D U := Finset.disjoint_left.mpr (fun i hi hu => (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hU) hu)).2 hi) have hz : finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U (-z) = finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U (-1) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U z := by simpa only [neg_one_mul] using finiteSquarefreeRow_mul (fun i => Ideal.span {p i}) hg U (-1) z cases negative <;> simp only [multiplicativeCoreColumn, firstCoreOuter, firstCoreTwist, sideRayMonoid, firstCoreTest, secondInputCoefficient, afterDilationLabel, Bool.false_eq_true, ite_false, ite_true, Finset.prod_union hDU, map_mul, FirstPassCubeLabels.mask_union _ hg D U hDU, FirstPassCubeLabels.row_union _ hg D U hDU, FirstPassCubeLabels.mask_mul _ hg U, FirstPassCubeLabels.coreRayTwist_prod, MonoidHom.mul_apply, conjugateRayMonoid_apply, rayMonoid_apply, supportRay, coreRayCharacter, RayFourExpansion.rayCharacter_mul, hz, star_mul, mul_one] <;> ring end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.IntegratedTransfer namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace SecondPassArithmetic section open scoped BigOperators Classical open MeasureTheory section open ActualEisensteinCubic open FirstPassCubeLabels (cubeOddSupport coreRayCoefficient coreRayTwist dilatedCoreRow b0Label jLabel firstLogDensity columnLog normalizedColumn firstOutputEnergy) open FirstCauchyArithmetic (supportMobius supportConjugateSum) open RayFourExpansion (RayCharacter crossCoeff) open FourierBridge (logPhase) lemma sideRayMonoid_norm_le_one (negative : Bool) (χ : RayCharacter) (a : O) : ‖sideRayMonoid negative χ a‖ ≤ 1 := by letI importedWitness0 := @OAI.RayFourExpansion.rayRingFintype cases negative <;> simp only [sideRayMonoid, Bool.false_eq_true, ite_false, ite_true, conjugateRayMonoid_apply, rayMonoid_apply, norm_star] all_goals exact FiniteRayExpansion.norm_char_le_one _ _ lemma firstCoreTwist_norm_le (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (r : FirstCoreIndex) (a : O) : ‖firstCoreTwist negative χ Ψ r a‖ ≤ ‖Ψ a‖ := by letI importedWitness0 := @OAI.RayFourExpansion.rayRingFintype have hc : ‖coreRayTwist negative r.1 r.2.2 a‖ ≤ 1 := by change ‖RayFourExpansion.rayCharacter (FirstPassCubeLabels.coreRayCharacter negative r.1 r.2.2) a‖ ≤ 1 exact FiniteRayExpansion.norm_char_le_one _ _ simp only [firstCoreTwist, MonoidHom.mul_apply, norm_mul] calc _ ≤ 1 * (‖Ψ a‖ * 1) := by gcongr; exact sideRayMonoid_norm_le_one _ _ _ _ = _ := by ring variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) omit [DecidableEq ι] in theorem firstCoreOuter_norm_le (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (Ψ : O →* ℂ) (m : O) (D : Finset ι) (r : FirstCoreIndex) : ‖firstCoreOuter p hg B v ε₁ ε₂ negative Ψ m D r‖ ≤ ‖coreRayCoefficient p (cubeOddSupport B v ε₁ ε₂) negative r.1 r.2.1 r.2.2‖ * ‖Ψ (∏ i ∈ D, p i)‖ := by letI importedWitness0 := @OAI.RayFourExpansion.rayRingFintype have hm : ‖rowCoprimeMask (fun i => Ideal.span {p i}) D m‖ ≤ 1 := by unfold rowCoprimeMask split_ifs <;> norm_num have hc : ‖coreRayTwist negative r.1 r.2.2 (∏ i ∈ D, p i)‖ ≤ 1 := by change ‖RayFourExpansion.rayCharacter (FirstPassCubeLabels.coreRayCharacter negative r.1 r.2.2) (∏ i ∈ D, p i)‖ ≤ 1 exact FiniteRayExpansion.norm_char_le_one _ _ have hs : ‖(if negative then star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg D (-1)) else 1 : ℂ)‖ ≤ 1 := by cases negative <;> simp only [Bool.false_eq_true, ite_false, ite_true, norm_one, norm_star] · exact le_rfl · exact finiteSquarefreeRow_norm_le_one _ hg D _ simp only [firstCoreOuter, norm_mul, MonoidHom.mul_apply] calc _ ≤ ‖coreRayCoefficient p (cubeOddSupport B v ε₁ ε₂) negative r.1 r.2.1 r.2.2‖ * (‖Ψ (∏ i ∈ D, p i)‖ * 1) * 1 * 1 := by gcongr _ = _ := by ring omit [DecidableEq ι] in theorem firstCoreOuter_mass (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (Ψ : O →* ℂ) (m : O) (D : Finset ι) (hΨ : ‖Ψ (∏ i ∈ D, p i)‖ ≤ 1) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype (∑ r : FirstCoreIndex, ‖firstCoreOuter p hg B v ε₁ ε₂ negative Ψ m D r‖) ≤ 32 * 512 := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype calc _ ≤ ∑ r : FirstCoreIndex, ‖coreRayCoefficient p (cubeOddSupport B v ε₁ ε₂) negative r.1 r.2.1 r.2.2‖ := by apply Finset.sum_le_sum intro r hr exact (firstCoreOuter_norm_le p hg B v ε₁ ε₂ negative Ψ m D r).trans (mul_le_of_le_one_right (norm_nonneg _) hΨ) _ ≤ 32 * 512 := by simpa only [Fintype.sum_prod_type] using FirstPassCubeLabels.coreRayCoefficient_mass p (cubeOddSupport B v ε₁ ε₂) negative theorem dilatedCoreRow_sq_le_input_family (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (t : ℝ) (z : O) (hΨ : ‖Ψ (∏ i ∈ D, p i)‖ ≤ 1) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype ‖dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative χ (multiplicativeCoreColumn p Ψ m H) V y c d t z‖ ^ 2 ≤ (32 * 512) * ∑ r : FirstCoreIndex, ‖firstCoreOuter p hg B v ε₁ ε₂ negative Ψ m D r‖ * ‖inputConjugateRow p hg (F \ D) (firstCoreTwist negative χ Ψ r) (m * b0Label p B v ε₁ ε₂) (c * jLabel p B v ε₁ ε₂) d (firstCoreTest H V y negative t D) (if negative then -z else z)‖ ^ 2 := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype rw [dilatedCoreRow_eq_input_family p hp hcop hg hc hpr] let w := firstCoreOuter p hg B v ε₁ ε₂ negative Ψ m D let Q := fun r : FirstCoreIndex => inputConjugateRow p hg (F \ D) (firstCoreTwist negative χ Ψ r) (m * b0Label p B v ε₁ ε₂) (c * jLabel p B v ε₁ ε₂) d (firstCoreTest H V y negative t D) (if negative then -z else z) have h := DescentWeightedCauchy.weighted_cauchy_sq Finset.univ w (fun _ => 1) (fun r => star (Q r)) simp only [mul_one, star_star, norm_one, one_pow, norm_star] at h exact h.trans (mul_le_mul_of_nonneg_right (firstCoreOuter_mass p hg B v ε₁ ε₂ negative Ψ m D hΨ) (by positivity)) theorem firstCoreTest_continuous (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (negative : Bool) (D U : Finset ι) : Continuous (fun t : ℝ => firstCoreTest H V y negative t D U) := by have h := FourierBridge.logPhase_continuous_left (-(y (D ∪ U))) cases negative <;> simp only [firstCoreTest, Bool.false_eq_true, ite_false, ite_true] <;> fun_prop theorem firstCoreTest_norm (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (negative : Bool) (D U : Finset ι) (t : ℝ) : ‖firstCoreTest H V y negative t D U‖ = ‖firstCoreTest H V y negative 0 D U‖ := by cases negative <;> simp only [firstCoreTest, Bool.false_eq_true, ite_false, ite_true, norm_mul, norm_star, FourierBridge.logPhase_norm] def firstCoreInputRow (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (r : FirstCoreIndex) (t : ℝ) (z : O) : ℂ := inputConjugateRow p hg (F \ D) (firstCoreTwist negative χ Ψ r) (m * b0Label p B v ε₁ ε₂) (c * jLabel p B v ε₁ ε₂) d (firstCoreTest H V y negative t D) (if negative then -z else z) theorem firstCoreInputRow_continuous (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (r : FirstCoreIndex) (z : O) : Continuous (fun t : ℝ => firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t z) := by unfold firstCoreInputRow inputConjugateRow supportConjugateSum secondInputCoefficient apply continuous_finsetSum intro U hU have ht := firstCoreTest_continuous H V y negative D U fun_prop theorem firstCoreInputRow_uniform_bound (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (r : FirstCoreIndex) (z : O) : ∃ M : ℝ, 0 ≤ M ∧ ∀ t, ‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t z‖ ≤ M := by let q := fun (t : ℝ) (U : Finset ι) => supportMobius (fun i => Ideal.span {p i}) U * secondInputCoefficient p hg (firstCoreTwist negative χ Ψ r) (m * b0Label p B v ε₁ ε₂) (c * jLabel p B v ε₁ ε₂) d (firstCoreTest H V y negative t D) U * star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg U (if negative then -z else z)) refine ⟨∑ U ∈ (F \ D).powerset, ‖q 0 U‖, by positivity, ?_⟩ intro t change ‖∑ U ∈ (F \ D).powerset, q t U‖ ≤ _ apply (norm_sum_le _ _).trans_eq apply Finset.sum_congr rfl intro U hU simp only [q, secondInputCoefficient, norm_mul, firstCoreTest_norm] theorem firstCoreInputRow_integrable (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (r : FirstCoreIndex) (z : O) {k : ℝ → ℝ} (hk : Integrable k volume) : Integrable (fun t : ℝ => k t * ‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t z‖ ^ 2) volume := by obtain ⟨M, hM, hb⟩ := firstCoreInputRow_uniform_bound p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r z apply hk.mul_bdd (c := M ^ 2) · exact ((firstCoreInputRow_continuous p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r z).norm.pow 2).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun t => by rw [Real.norm_of_nonneg (sq_nonneg _)] exact pow_le_pow_left₀ (norm_nonneg _) (hb t) 2) end open ActualEisensteinCubic open FirstPassCubeLabels (cubeOddSupport coreRayCoefficient dilatedCoreRow b0Label jLabel firstLogDensity columnLog normalizedColumn firstOutputEnergy) open RayFourExpansion (RayCharacter crossCoeff) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem dilatedCoreRow_energy_le_input_family (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (T : Finset O) (k : ℝ → ℝ) (hk : Integrable k volume) (hk0 : ∀ t, 0 ≤ k t) (hΨ : ‖Ψ (∏ i ∈ D, p i)‖ ≤ 1) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype (∫ t : ℝ, k t * ∑ z ∈ T, ‖dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative χ (multiplicativeCoreColumn p Ψ m H) V y c d t z‖ ^ 2) ≤ (32 * 512) * ∑ r : FirstCoreIndex, ‖firstCoreOuter p hg B v ε₁ ε₂ negative Ψ m D r‖ * ∫ t : ℝ, k t * ∑ z ∈ T, ‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t z‖ ^ 2 := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype let P := fun t z => dilatedCoreRow p hp hcop hg F D B v ε₁ ε₂ negative χ (multiplicativeCoreColumn p Ψ m H) V y c d t z let Q := fun r t z => firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t z let w := fun r => ‖firstCoreOuter p hg B v ε₁ ε₂ negative Ψ m D r‖ have iP : Integrable (fun t : ℝ => k t * ∑ z ∈ T, ‖P t z‖ ^ 2) volume := by simp only [Finset.mul_sum] apply integrable_finsetSum intro z hz exact FirstPassCubeLabels.dilatedCoreRow_integrable p hp hcop hg F D B v ε₁ ε₂ negative χ (multiplicativeCoreColumn p Ψ m H) V y c d z hk have iQ (r : FirstCoreIndex) : Integrable (fun t : ℝ => k t * ∑ z ∈ T, ‖Q r t z‖ ^ 2) volume := by simp only [Finset.mul_sum] apply integrable_finsetSum intro z hz exact firstCoreInputRow_integrable p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r z hk have iR : Integrable (fun t : ℝ => ∑ r : FirstCoreIndex, w r * (k t * ∑ z ∈ T, ‖Q r t z‖ ^ 2)) volume := integrable_finsetSum _ (fun r hr => (iQ r).const_mul (w r)) have hpoint (t : ℝ) : k t * (∑ z ∈ T, ‖P t z‖ ^ 2) ≤ (32 * 512) * ∑ r : FirstCoreIndex, w r * (k t * ∑ z ∈ T, ‖Q r t z‖ ^ 2) := by calc _ ≤ k t * ∑ z ∈ T, ((32 * 512) * ∑ r : FirstCoreIndex, w r * ‖Q r t z‖ ^ 2) := by apply mul_le_mul_of_nonneg_left _ (hk0 t) apply Finset.sum_le_sum intro z hz exact dilatedCoreRow_sq_le_input_family p hp hcop hg hc hpr F D B v ε₁ ε₂ negative χ Ψ m H V y c d t z hΨ _ = _ := by simp only [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro r hr apply Finset.sum_congr rfl intro z hz ring calc _ ≤ ∫ t : ℝ, (32 * 512) * ∑ r : FirstCoreIndex, w r * (k t * ∑ z ∈ T, ‖Q r t z‖ ^ 2) := integral_mono iP (iR.const_mul _) hpoint _ = _ := by rw [integral_const_mul, integral_finsetSum _ (fun r hr => (iQ r).const_mul (w r))] simp only [integral_const_mul] rfl omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem normalizedColumn_multiplicativeCoreColumn (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) : normalizedColumn p (multiplicativeCoreColumn p Ψ m H) = multiplicativeCoreColumn p Ψ m (normalizedColumn p H) := by funext S simp only [normalizedColumn, multiplicativeCoreColumn, div_eq_mul_inv] ring def firstInputFamilyEnergy (F B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (X : ℝ) (c d : O) (J : ℕ) (T : Finset O) : ℝ := letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype ∑ a : RayCharacter × RayCharacter, ∑ D ∈ F.powerset, ‖crossCoeff a.1 a.2‖ * ∑ r : FirstCoreIndex, ‖firstCoreOuter p hg B v ε₁ ε₂ negative Ψ m D r‖ * ∫ t : ℝ, firstLogDensity J t * ∑ z ∈ T, ‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative (if negative then a.1 else a.2) Ψ m (normalizedColumn p H) V (columnLog p X) c d r t z‖ ^ 2 theorem firstInputFamilyEnergy_nonneg (F B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (X : ℝ) (c d : O) (J : ℕ) (T : Finset O) : 0 ≤ firstInputFamilyEnergy p hg F B v ε₁ ε₂ negative Ψ m H V X c d J T := by unfold firstInputFamilyEnergy apply Finset.sum_nonneg intro a ha apply Finset.sum_nonneg intro D hD apply mul_nonneg (norm_nonneg _) apply Finset.sum_nonneg intro r hr apply mul_nonneg (norm_nonneg _) apply integral_nonneg intro t exact mul_nonneg (FirstPassCubeLabels.firstLogDensity_nonneg J t) (Finset.sum_nonneg (fun z hz => sq_nonneg _)) theorem firstOutputEnergy_le_input_family (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (X : ℝ) (c d : O) (J : ℕ) (T : Finset O) (hΨ : ∀ D ∈ F.powerset, ‖Ψ (∏ i ∈ D, p i)‖ ≤ 1) : firstOutputEnergy p hp hcop hg F B v ε₁ ε₂ negative (multiplicativeCoreColumn p Ψ m H) V X c d J T ≤ (32 * 512) * firstInputFamilyEnergy p hg F B v ε₁ ε₂ negative Ψ m H V X c d J T := by unfold firstOutputEnergy firstInputFamilyEnergy rw [normalizedColumn_multiplicativeCoreColumn] simp only [Finset.mul_sum] apply Finset.sum_le_sum intro a ha apply Finset.sum_le_sum intro D hD have h := dilatedCoreRow_energy_le_input_family p hp hcop hg hc hpr F D B v ε₁ ε₂ negative (if negative then a.1 else a.2) Ψ m (normalizedColumn p H) V (columnLog p X) c d T (firstLogDensity J) (FirstPassCubeLabels.firstLogDensity_integrable J) (FirstPassCubeLabels.firstLogDensity_nonneg J) (hΨ D hD) have hh := mul_le_mul_of_nonneg_left h (norm_nonneg (crossCoeff a.1 a.2)) simpa only [Finset.mul_sum, mul_assoc, mul_left_comm, mul_comm] using hh end open ActualEisensteinCubic open FirstPassCubeLabels (b0Label jLabel) open RayFourExpansion (RayCharacter) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) end SecondPassArithmetic open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform namespace JointLogSeparation abbrev Frequency := ℝ × ℝ × ℝ def tripleCoefficient (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) (t : Frequency) : ℂ := b₁ t.1 * (b₂ t.2.1 * b₃ t.2.2) lemma tripleCoefficient_integrable (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) : Integrable (tripleCoefficient b₁ b₂ b₃) := b₁.integrable.mul_prod (b₂.integrable.mul_prod b₃.integrable) lemma tripleCoefficient_bounded_integrable (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) (F : Frequency → ℂ) (hF : Continuous F) (M : ℝ) (hM : ∀ t, ‖F t‖ ≤ M) : Integrable (fun t => tripleCoefficient b₁ b₂ b₃ t * F t) := (tripleCoefficient_integrable b₁ b₂ b₃).mul_bdd hF.aestronglyMeasurable (Filter.Eventually.of_forall hM) lemma tripleCoefficient_norm_bounded_integrable (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) (G : Frequency → ℝ) (hG : Continuous G) (M : ℝ) (hM : ∀ t, ‖G t‖ ≤ M) : Integrable (fun t => ‖tripleCoefficient b₁ b₂ b₃ t‖ * G t) := (tripleCoefficient_integrable b₁ b₂ b₃).norm.mul_bdd hG.aestronglyMeasurable (Filter.Eventually.of_forall hM) lemma tripleCoefficient_slice_integrable (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) (F : Frequency → ℂ) (hF : Continuous F) (M : ℝ) (hM : ∀ t, ‖F t‖ ≤ M) (x : ℝ) : Integrable (fun t : ℝ × ℝ => tripleCoefficient b₁ b₂ b₃ (x,t) * F (x,t)) := by have hc : Integrable (fun t : ℝ × ℝ => b₁ x * (b₂ t.1 * b₃ t.2)) := (b₂.integrable.mul_prod b₃.integrable).const_mul (b₁ x) apply hc.mul_bdd · exact (hF.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun t => hM (x,t)) lemma tripleCoefficient_norm_slice_integrable (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) (G : Frequency → ℝ) (hG : Continuous G) (M : ℝ) (hM : ∀ t, ‖G t‖ ≤ M) (x : ℝ) : Integrable (fun t : ℝ × ℝ => ‖tripleCoefficient b₁ b₂ b₃ (x,t)‖ * G (x,t)) := by have hc : Integrable (fun t : ℝ × ℝ => ‖b₁ x * (b₂ t.1 * b₃ t.2)‖) := ((b₂.integrable.mul_prod b₃.integrable).const_mul (b₁ x)).norm apply hc.mul_bdd · exact (hG.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun t => hM (x,t)) lemma nested_eq_integral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] (f : Frequency → E) (hf : Integrable f) (hslice : ∀ x : ℝ, Integrable (fun yz : ℝ × ℝ => f (x,yz))) : (∫ x : ℝ, ∫ y : ℝ, ∫ z : ℝ, f (x,y,z)) = ∫ t : Frequency, f t := by rw [Measure.volume_eq_prod ℝ (ℝ × ℝ), integral_prod _ hf] apply integral_congr_ae filter_upwards [] with x simpa only [Measure.volume_eq_prod] using (integral_prod _ (hslice x)).symm theorem triple_integral_bound (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) (F : Frequency → ℂ) (G : Frequency → ℝ) (hF : Continuous F) (hG : Continuous G) (hG0 : ∀ t, 0 ≤ G t) (D M : ℝ) (hD : 0 ≤ D) (hM : ∀ t, G t ≤ M) (hpoint : ∀ t, ‖F t‖ ≤ D * G t) : ‖∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, tripleCoefficient b₁ b₂ b₃ (t₁,t₂,t₃) * F (t₁,t₂,t₃)‖ ≤ D * (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, ‖tripleCoefficient b₁ b₂ b₃ (t₁,t₂,t₃)‖ * G (t₁,t₂,t₃)) := by have hFb : ∀ t, ‖F t‖ ≤ D * M := fun t => (hpoint t).trans (mul_le_mul_of_nonneg_left (hM t) hD) have hGb : ∀ t, ‖G t‖ ≤ M := fun t => by simpa [Real.norm_of_nonneg (hG0 t)] using hM t have hfi := tripleCoefficient_bounded_integrable b₁ b₂ b₃ F hF (D*M) hFb have hgi := tripleCoefficient_norm_bounded_integrable b₁ b₂ b₃ G hG M hGb rw [nested_eq_integral _ hfi (tripleCoefficient_slice_integrable b₁ b₂ b₃ F hF (D*M) hFb), nested_eq_integral _ hgi (tripleCoefficient_norm_slice_integrable b₁ b₂ b₃ G hG M hGb)] calc _ ≤ ∫ t : Frequency, ‖tripleCoefficient b₁ b₂ b₃ t * F t‖ := norm_integral_le_integral_norm _ _ ≤ ∫ t : Frequency, D * (‖tripleCoefficient b₁ b₂ b₃ t‖ * G t) := by apply integral_mono hfi.norm (hgi.const_mul D) intro t simp only [norm_mul] calc _ ≤ ‖tripleCoefficient b₁ b₂ b₃ t‖ * (D * G t) := mul_le_mul_of_nonneg_left (hpoint t) (norm_nonneg _) _ = _ := by ring _ = _ := integral_const_mul _ _ end JointLogSeparation namespace SecondPassIntegration abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation open FirstPassCubeLabels (columnLog) abbrev instFintypeUnitsO : Fintype Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma fixedTest_continuous (V : ℝ → ℂ) (X : ℝ) (negative : Bool) (N : Finset ι) (τ σ : Frequency → ℝ) (hτ : Continuous τ) (hσ : Continuous σ) : Continuous (fun t => fixedSecondTest p V X (τ t) (σ t) negative N) := by have hh := (FourierBridge.logPhase_continuous_left (columnLog p X N)).comp (hτ.sub hσ) cases negative <;> simp only [fixedSecondTest, Bool.false_eq_true, ite_false, ite_true, fixedColumnTest] <;> fun_prop lemma fixedColumn_norm_frequency (Ψ : O →* ℂ) (m f y : O) (V : ℝ → ℂ) (X a b : ℝ) (negative : Bool) (N : Finset ι) : ‖secondChildColumn p hp hcop hg Ψ m f y (fixedSecondTest p V X a b negative) N‖ = ‖secondChildColumn p hp hcop hg Ψ m f y (fixedSecondTest p V X 0 0 negative) N‖ := by cases negative <;> simp only [secondChildColumn, fixedSecondTest, Bool.false_eq_true, ite_false, ite_true, fixedColumnTest, norm_mul, norm_star, FourierBridge.logPhase_norm] lemma fixedRow_continuous (F : Finset ι) (Ψ : O →* ℂ) (m f y : O) (V : ℝ → ℂ) (X : ℝ) (negative : Bool) (τ σ : Frequency → ℝ) (hτ : Continuous τ) (hσ : Continuous σ) : Continuous (fun t => fixedChildRow p hp hcop hg F Ψ m (fixedSecondTest p V X (τ t) (σ t) negative) f y) := by unfold fixedChildRow apply continuous_finsetSum intro N hN have hh := fixedTest_continuous p V X negative N τ σ hτ hσ unfold secondChildColumn fun_prop def rowMagnitude (F : Finset ι) (Ψ : O →* ℂ) (m f y : O) (V : ℝ → ℂ) (X : ℝ) (negative : Bool) : ℝ := ∑ N ∈ F.powerset, ‖secondChildColumn p hp hcop hg Ψ m f y (fixedSecondTest p V X 0 0 negative) N‖ lemma rowMagnitude_nonneg (F : Finset ι) (Ψ : O →* ℂ) (m f y : O) (V : ℝ → ℂ) (X : ℝ) (negative : Bool) : 0 ≤ rowMagnitude p hp hcop hg F Ψ m f y V X negative := by unfold rowMagnitude positivity lemma fixedRow_norm_le (F : Finset ι) (Ψ : O →* ℂ) (m f y : O) (V : ℝ → ℂ) (X a b : ℝ) (negative : Bool) : ‖fixedChildRow p hp hcop hg F Ψ m (fixedSecondTest p V X a b negative) f y‖ ≤ rowMagnitude p hp hcop hg F Ψ m f y V X negative := by unfold fixedChildRow rowMagnitude apply (norm_sum_le _ _).trans_eq exact Finset.sum_congr rfl (fun N hN => fixedColumn_norm_frequency p hp hcop hg Ψ m f y V X a b negative N) def childEnergy (F : Finset ι) (Ψ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V : ℝ → ℂ) (X : ℝ) (testNegative rowNegative : Bool) (a b : ℝ) : ℝ := let : Fintype Oˣ := instFintypeUnitsO ∑ u : Oˣ, ∑ z ∈ T, ‖idealChildRow p hp hcop hg F Ψ m (fixedSecondTest p V X a b testNegative) rowNegative u z‖ ^ 2 def energyMagnitude (F : Finset ι) (Ψ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V : ℝ → ℂ) (X : ℝ) (testNegative rowNegative : Bool) : ℝ := let : Fintype Oˣ := instFintypeUnitsO ∑ u : Oˣ, ∑ z ∈ T, (rowMagnitude p hp hcop hg F Ψ m ((u : O) * ConcretePrimeRowBridge.idealGenerator z.1) (if rowNegative then -z.2 else z.2) V X testNegative) ^ 2 lemma childEnergy_le (F : Finset ι) (Ψ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V : ℝ → ℂ) (X : ℝ) (testNegative rowNegative : Bool) (a b : ℝ) : childEnergy p hp hcop hg F Ψ m T V X testNegative rowNegative a b ≤ energyMagnitude p hp hcop hg F Ψ m T V X testNegative rowNegative := by unfold childEnergy energyMagnitude idealChildRow apply Finset.sum_le_sum intro u hu apply Finset.sum_le_sum intro z hz exact pow_le_pow_left₀ (norm_nonneg _) (fixedRow_norm_le p hp hcop hg F Ψ m _ _ V X a b testNegative) 2 lemma childEnergy_continuous (F : Finset ι) (Ψ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V : ℝ → ℂ) (X : ℝ) (testNegative rowNegative : Bool) (τ σ : Frequency → ℝ) (hτ : Continuous τ) (hσ : Continuous σ) : Continuous (fun t => childEnergy p hp hcop hg F Ψ m T V X testNegative rowNegative (τ t) (σ t)) := by unfold childEnergy apply continuous_finsetSum intro u hu apply continuous_finsetSum intro z hz unfold idealChildRow exact (fixedRow_continuous p hp hcop hg F Ψ m _ _ V X testNegative τ σ hτ hσ).norm.pow 2 end SecondPassIntegration open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation open SecondPassFiber (OldTuple newLabel newRow Valid) abbrev instFintypeUnitsO_1 : Fintype Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def integratedSecondMode (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) (s : Finset OldTuple) (w : Frequency → OldTuple → ℂ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ : ℝ) : ℂ := ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, tripleCoefficient b₁ b₂ b₃ (t₁,t₂,t₃) * fixedSecondMode p hp hcop hg s (w (t₁,t₂,t₃)) label F Ψ₁ Ψ₂ m (fixedSecondTest p V₁ X₁ t₁ t₃ true) (fixedSecondTest p V₂ X₂ t₂ t₃ false) def childGeometricMean (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ : ℝ) (q : Frequency) : ℝ := Real.sqrt (childEnergy p hp hcop hg F Ψ₁ m T V₁ X₁ true false q.1 q.2.2) * Real.sqrt (childEnergy p hp hcop hg F Ψ₂ m T V₂ X₂ false true q.2.1 q.2.2) theorem integrated_fixed_second_mode_transfer (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ (s : Finset OldTuple) (T : Finset (Ideal O × O)) (b0 : Ideal O) (w : Frequency → OldTuple → ℂ) (B lengthScale : ℝ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ : ℝ) (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ T) → (∀ z ∈ T, z.1 ≠ ⊥) → (∀ z ∈ T, (Ideal.absNorm z.1 : ℝ) ≤ lengthScale) → (∀ q, ∀ x ∈ s, ‖w q x‖ ≤ B) → (∀ x ∈ s, Continuous (fun q => w q x)) → (∀ x ∈ s, Ideal.span {label x} = newLabel x) → ‖integratedSecondMode p hp hcop hg b₁ b₂ b₃ s w label F Ψ₁ Ψ₂ m V₁ V₂ X₁ X₂‖ ≤ (B * C * (lengthScale * Ideal.absNorm b0)^ε) * (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, ‖tripleCoefficient b₁ b₂ b₃ (t₁,t₂,t₃)‖ * childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ (t₁,t₂,t₃)) := by obtain ⟨C, hC, hb⟩ := fixed_second_mode_transfer p hp hcop hg ε hε refine ⟨C, hC, ?_⟩ intro s T b0 w B lengthScale label F Ψ₁ Ψ₂ m V₁ V₂ X₁ X₂ b₁ b₂ b₃ hb0 hB hL hv hm ht hn hw hwc hl let f : Frequency → ℂ := fun q => fixedSecondMode p hp hcop hg s (w q) label F Ψ₁ Ψ₂ m (fixedSecondTest p V₁ X₁ q.1 q.2.2 true) (fixedSecondTest p V₂ X₂ q.2.1 q.2.2 false) let G := childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ have hc₁ := childEnergy_continuous p hp hcop hg F Ψ₁ m T V₁ X₁ true false (fun q : Frequency => q.1) (fun q : Frequency => q.2.2) continuous_fst continuous_snd.snd have hc₂ := childEnergy_continuous p hp hcop hg F Ψ₂ m T V₂ X₂ false true (fun q : Frequency => q.2.1) (fun q : Frequency => q.2.2) continuous_snd.fst continuous_snd.snd have hG : Continuous G := (Real.continuous_sqrt.comp hc₁).mul (Real.continuous_sqrt.comp hc₂) have hG0 : ∀ q, 0 ≤ G q := fun q => mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) let M := Real.sqrt (energyMagnitude p hp hcop hg F Ψ₁ m T V₁ X₁ true false) * Real.sqrt (energyMagnitude p hp hcop hg F Ψ₂ m T V₂ X₂ false true) have hM : ∀ q, G q ≤ M := by intro q dsimp [G, childGeometricMean, M] gcongr · exact childEnergy_le p hp hcop hg F Ψ₁ m T V₁ X₁ true false q.1 q.2.2 · exact childEnergy_le p hp hcop hg F Ψ₂ m T V₂ X₂ false true q.2.1 q.2.2 have hf : Continuous f := by unfold f fixedSecondMode apply continuous_finsetSum intro x hx have hwx := hwc x hx have hc₁ := fixedRow_continuous p hp hcop hg F Ψ₁ m (label x) (newRow x) V₁ X₁ true (fun q : Frequency => q.1) (fun q : Frequency => q.2.2) continuous_fst continuous_snd.snd have hc₂ := fixedRow_continuous p hp hcop hg F Ψ₂ m (label x) (-newRow x) V₂ X₂ false (fun q : Frequency => q.2.1) (fun q : Frequency => q.2.2) continuous_snd.fst continuous_snd.snd exact (hwx.mul hc₁.star).mul hc₂ have hpoint : ∀ q, ‖f q‖ ≤ (B * C * (lengthScale * Ideal.absNorm b0)^ε) * G q := by intro q have hh := hb s T b0 (w q) B lengthScale label F Ψ₁ Ψ₂ m (fixedSecondTest p V₁ X₁ q.1 q.2.2 true) (fixedSecondTest p V₂ X₂ q.2.1 q.2.2 false) hb0 hB hL hv hm ht hn (hw q) hl simpa only [f, G, childGeometricMean, childEnergy, mul_assoc] using hh exact triple_integral_bound b₁ b₂ b₃ f G hf hG hG0 (B * C * (lengthScale * Ideal.absNorm b0)^ε) M (by positivity) hM hpoint end SecondPassIntegration end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Fourier.TupleWeights namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform namespace JointLogSeparation theorem finite_triple_bounded_integral {α : Type*} (s : Finset α) (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) (F : α → Frequency → ℂ) (hF : ∀ i ∈ s, Continuous (F i)) (M : α → ℝ) (hM : ∀ i ∈ s, ∀ q, ‖F i q‖ ≤ M i) : (∑ i ∈ s, ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, tripleCoefficient b₁ b₂ b₃ (t₁,t₂,t₃) * F i (t₁,t₂,t₃)) = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, tripleCoefficient b₁ b₂ b₃ (t₁,t₂,t₃) * (∑ i ∈ s, F i (t₁,t₂,t₃)) := by have hc : Continuous (fun q => ∑ i ∈ s, F i q) := continuous_finsetSum _ hF have hb (q : Frequency) : ‖∑ i ∈ s, F i q‖ ≤ ∑ i ∈ s, M i := (norm_sum_le _ _).trans (Finset.sum_le_sum (fun i hi => hM i hi q)) have hi (i : α) (hi : i ∈ s) := tripleCoefficient_bounded_integrable b₁ b₂ b₃ (F i) (hF i hi) (M i) (hM i hi) have hs := tripleCoefficient_bounded_integrable b₁ b₂ b₃ (fun q => ∑ i ∈ s, F i q) hc _ hb calc _ = ∑ i ∈ s, ∫ q : Frequency, tripleCoefficient b₁ b₂ b₃ q * F i q := by apply Finset.sum_congr rfl intro i hmem exact nested_eq_integral _ (hi i hmem) (tripleCoefficient_slice_integrable b₁ b₂ b₃ (F i) (hF i hmem) (M i) (hM i hmem)) _ = ∫ q : Frequency, ∑ i ∈ s, tripleCoefficient b₁ b₂ b₃ q * F i q := (integral_finsetSum s hi).symm _ = ∫ q : Frequency, tripleCoefficient b₁ b₂ b₃ q * (∑ i ∈ s, F i q) := by simp only [Finset.mul_sum] _ = _ := (nested_eq_integral _ hs (tripleCoefficient_slice_integrable b₁ b₂ b₃ (fun q => ∑ i ∈ s, F i q) hc _ hb)).symm end JointLogSeparation namespace SecondPassIntegration section open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation open SecondPassFiber (OldTuple newLabel newRow Valid) open FourierBridge (logPhase) def tupleOuterWeight (V : Fin 7 → ℝ → ℂ) (w : OldTuple → ℂ) (z ud ue uv kap : OldTuple → ℝ) (q : Frequency) (x : OldTuple) : ℂ := w x * outerWindow V (z x) (ud x) (ue x) (uv x) (kap x) * logPhase (q.1 + q.2.1) (z x) * logPhase q.2.2 (kap x - ud x - 2 * ue x - 2 * uv x) lemma tupleOuterWeight_continuous (V : Fin 7 → ℝ → ℂ) (w : OldTuple → ℂ) (z ud ue uv kap : OldTuple → ℝ) (x : OldTuple) : Continuous (fun q => tupleOuterWeight V w z ud ue uv kap q x) := by have h₁ : Continuous (fun q : Frequency => logPhase (q.1 + q.2.1) (z x)) := (FourierBridge.logPhase_continuous_left (z x)).comp (continuous_fst.add continuous_snd.fst) have h₂ : Continuous (fun q : Frequency => logPhase q.2.2 (kap x - ud x - 2 * ue x - 2 * uv x)) := (FourierBridge.logPhase_continuous_left (kap x - ud x - 2 * ue x - 2 * uv x)).comp continuous_snd.snd unfold tupleOuterWeight fun_prop lemma tupleOuterWeight_norm (V : Fin 7 → ℝ → ℂ) (w : OldTuple → ℂ) (z ud ue uv kap : OldTuple → ℝ) (q : Frequency) (x : OldTuple) : ‖tupleOuterWeight V w z ud ue uv kap q x‖ = ‖w x‖ * ‖outerWindow V (z x) (ud x) (ue x) (uv x) (kap x)‖ := by simp only [tupleOuterWeight, norm_mul, FourierBridge.logPhase_norm, mul_one] variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def tupleSourceSum (s : Finset OldTuple) (w : OldTuple → ℂ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap : OldTuple → ℝ) (X₁ X₂ R : ℝ) : ℂ := ∑ x ∈ s, w x * postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ m (label x) (newRow x) (-newRow x) A₁ A₂ W V (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂ R theorem tupleSource_eq_integratedSecondMode (s : Finset OldTuple) (w : OldTuple → ℂ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (A₁ A₂ W b : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap : OldTuple → ℝ) (X₁ X₂ R : ℝ) (hsep : ∀ x ∈ s, postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ m (label x) (newRow x) (-newRow x) A₁ A₂ W V (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂ R = separatedPostCommon p hp hcop hg F Ψ₁ Ψ₂ m (label x) (newRow x) (-newRow x) A₁ A₂ b V (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂) : tupleSourceSum p hp hcop hg s w label F Ψ₁ Ψ₂ m A₁ A₂ W V z ud ue uv kap X₁ X₂ R = integratedSecondMode p hp hcop hg (𝓕 A₁) (𝓕 A₂) b s (tupleOuterWeight V w z ud ue uv kap) label F Ψ₁ Ψ₂ m (V 5) (V 6) X₁ X₂ := by let Q : OldTuple → Frequency → ℂ := fun x q => tupleOuterWeight V w z ud ue uv kap q x * star (fixedChildRow p hp hcop hg F Ψ₁ m (fixedSecondTest p (V 5) X₁ q.1 q.2.2 true) (label x) (newRow x)) * fixedChildRow p hp hcop hg F Ψ₂ m (fixedSecondTest p (V 6) X₂ q.2.1 q.2.2 false) (label x) (-newRow x) let M : OldTuple → ℝ := fun x => (‖w x‖ * ‖outerWindow V (z x) (ud x) (ue x) (uv x) (kap x)‖) * rowMagnitude p hp hcop hg F Ψ₁ m (label x) (newRow x) (V 5) X₁ true * rowMagnitude p hp hcop hg F Ψ₂ m (label x) (-newRow x) (V 6) X₂ false have hc (x : OldTuple) : Continuous (Q x) := by have hw := tupleOuterWeight_continuous V w z ud ue uv kap x have h₁ := fixedRow_continuous p hp hcop hg F Ψ₁ m (label x) (newRow x) (V 5) X₁ true (fun q : Frequency => q.1) (fun q : Frequency => q.2.2) continuous_fst continuous_snd.snd have h₂ := fixedRow_continuous p hp hcop hg F Ψ₂ m (label x) (-newRow x) (V 6) X₂ false (fun q : Frequency => q.2.1) (fun q : Frequency => q.2.2) continuous_snd.fst continuous_snd.snd exact (hw.mul h₁.star).mul h₂ have hbound (x : OldTuple) (q : Frequency) : ‖Q x q‖ ≤ M x := by dsimp only [Q, M] rw [norm_mul, norm_mul, norm_star, tupleOuterWeight_norm] have h₁ := fixedRow_norm_le p hp hcop hg F Ψ₁ m (label x) (newRow x) (V 5) X₁ q.1 q.2.2 true have h₂ := fixedRow_norm_le p hp hcop hg F Ψ₂ m (label x) (-newRow x) (V 6) X₂ q.2.1 q.2.2 false have hn₁ := rowMagnitude_nonneg p hp hcop hg F Ψ₁ m (label x) (newRow x) (V 5) X₁ true have hn₂ := rowMagnitude_nonneg p hp hcop hg F Ψ₂ m (label x) (-newRow x) (V 6) X₂ false gcongr calc _ = ∑ x ∈ s, ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, tripleCoefficient (𝓕 A₁) (𝓕 A₂) b (t₁,t₂,t₃) * Q x (t₁,t₂,t₃) := by apply Finset.sum_congr rfl intro x hx rw [hsep x hx] unfold separatedPostCommon simp_rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with t₁ apply integral_congr_ae filter_upwards [] with t₂ apply integral_congr_ae filter_upwards [] with t₃ dsimp [tripleCoefficient, Q, tupleOuterWeight] ring _ = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, tripleCoefficient (𝓕 A₁) (𝓕 A₂) b (t₁,t₂,t₃) * (∑ x ∈ s, Q x (t₁,t₂,t₃)) := finite_triple_bounded_integral s (𝓕 A₁) (𝓕 A₂) b Q (fun x _ => hc x) M (fun x _ => hbound x) _ = _ := rfl end open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation open SecondPassFiber (OldTuple newLabel newRow Valid) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem tupleSource_uniform_transfer (ε : ℝ) (hε : 0 < ε) (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ Cₐ : ℝ, 0 < Cₐ ∧ ∃ Cₛ : ℝ, 0 ≤ Cₛ ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), (∀ t₁ t₂ t₃ : ℝ, (1 + R)^A * ‖(𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃‖ ≤ Cₛ * FirstPassCubeLabels.firstLogDensity J t₁ * FirstPassCubeLabels.firstLogDensity J t₂ * FirstPassCubeLabels.firstLogDensity J t₃) ∧ ∀ (s : Finset OldTuple) (T : Finset (Ideal O × O)) (b0 : Ideal O) (w : OldTuple → ℂ) (B lengthScale : ℝ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (z ud ue uv kap : OldTuple → ℝ) (X₁ X₂ : ℝ), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ T) → (∀ z ∈ T, z.1 ≠ ⊥) → (∀ z ∈ T, (Ideal.absNorm z.1 : ℝ) ≤ lengthScale) → (∀ x ∈ s, ‖w x‖ * ‖outerWindow V (z x) (ud x) (ue x) (uv x) (kap x)‖ ≤ B) → (∀ x ∈ s, Ideal.span {label x} = newLabel x) → ‖tupleSourceSum p hp hcop hg s w label F Ψ₁ Ψ₂ m A₁ A₂ W V z ud ue uv kap X₁ X₂ R‖ ≤ (B * Cₐ * (lengthScale * Ideal.absNorm b0)^ε) * (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, ‖tripleCoefficient (𝓕 A₁) (𝓕 A₂) b (t₁,t₂,t₃)‖ * childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T (V 5) (V 6) X₁ X₂ (t₁,t₂,t₃)) := by obtain ⟨Cₐ, hCₐ, htrans⟩ := integrated_fixed_second_mode_transfer p hp hcop hg ε hε obtain ⟨Cₛ, hCₛ, hsep⟩ := postCommonSmoothPair_uniform_fixed_tests p hp hcop hg A₁ A₂ W V M hM hV A J refine ⟨Cₐ, hCₐ, Cₛ, hCₛ, ?_⟩ intro R hR obtain ⟨b, hpoint, hid⟩ := hsep R hR refine ⟨b, hpoint, ?_⟩ intro s T b0 w B lengthScale label F Ψ₁ Ψ₂ m z ud ue uv kap X₁ X₂ hb0 hB hL hv hm ht hn hw hl have hsource := tupleSource_eq_integratedSecondMode p hp hcop hg s w label F Ψ₁ Ψ₂ m A₁ A₂ W b V z ud ue uv kap X₁ X₂ R (fun x hx => hid F Ψ₁ Ψ₂ m (label x) (newRow x) (-newRow x) (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂) rw [hsource] apply htrans s T b0 (tupleOuterWeight V w z ud ue uv kap) B lengthScale label F Ψ₁ Ψ₂ m (V 5) (V 6) X₁ X₂ (𝓕 A₁) (𝓕 A₂) b hb0 hB hL hv hm ht hn · intro q x hx rw [tupleOuterWeight_norm] exact hw x hx · intro x hx exact tupleOuterWeight_continuous V w z ud ue uv kap x · exact hl end SecondPassIntegration section open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform ContDiff namespace JointLogSeparation def halfNormalizationMultiplier (U : ℝ → ℂ) (s : ℝ) : ℂ := U s * (Real.exp (-s / 2) : ℂ) lemma halfNormalization_temperate (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) : (halfNormalizationMultiplier U).HasTemperateGrowth := by apply (hUc.mul_right : HasCompactSupport (halfNormalizationMultiplier U)).hasTemperateGrowth change ContDiff ℝ ∞ (fun s : ℝ => U s * (Real.exp (-s / 2) : ℂ)) have he : ContDiff ℝ ∞ (fun s : ℝ => Real.exp (-s / 2)) := by fun_prop exact hUs.mul (Complex.ofRealCLM.contDiff.comp he) def halfNormalizationCLM (U : ℝ → ℂ) : 𝓢(ℝ, ℂ) →L[ℝ] 𝓢(ℝ, ℂ) := (SchwartzMap.smulLeftCLM ℂ (halfNormalizationMultiplier U)).restrictScalars ℝ lemma halfNormalizationCLM_apply (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g : 𝓢(ℝ, ℂ)) (s : ℝ) : halfNormalizationCLM U g s = U s * (Real.exp (-s / 2) : ℂ) * g s := by exact SchwartzMap.smulLeftCLM_apply_apply (halfNormalization_temperate U hUc hUs) g s lemma sqrt_exp_half (s : ℝ) : Real.sqrt (Real.exp s) = Real.exp (s / 2) := by apply (Real.sqrt_eq_iff_mul_self_eq (Real.exp_pos s).le (Real.exp_pos (s / 2)).le).mpr rw [← Real.exp_add] congr 1 ring theorem halfNormalization_exact (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g : 𝓢(ℝ, ℂ)) (hU : ∀ s, g s ≠ 0 → U s = 1) (s : ℝ) : halfNormalizationCLM U g s = g s / (Real.sqrt (Real.exp s) : ℂ) := by rw [halfNormalizationCLM_apply U hUc hUs] by_cases hg : g s = 0 · simp [hg] rw [hU s hg, one_mul, sqrt_exp_half] have he : (Real.exp (-s / 2) : ℂ) = ((Real.exp (s / 2) : ℂ))⁻¹ := by rw [← Complex.ofReal_inv, ← Real.exp_neg] congr 2 ring rw [he] exact (div_eq_inv_mul (g s) (Real.exp (s / 2) : ℂ)).symm lemma halfNormalization_twist (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g : 𝓢(ℝ, ℂ)) (t : ℝ) : halfNormalizationCLM U (frequencyTwist g t) = frequencyTwist (halfNormalizationCLM U g) t := by ext s simp only [halfNormalizationCLM_apply U hUc hUs, frequencyTwist_apply] ring end JointLogSeparation namespace SecondPassIntegration open ActualEisensteinCubic JointLogSeparation FirstPassCubeLabels lemma sqrtProductNorm {ι : Type*} (p : ι → O) (S : Finset ι) : Real.sqrt (primeProductNorm p S) = ‖ConcreteTraceCRT.eisEmbedding (∏ i ∈ S, p i)‖ := by simp only [primeProductNorm, Real.sqrt_sq_eq_abs, abs_of_nonneg (norm_nonneg _)] theorem columnLog_union_scale {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (V N : Finset ι) (hVN : Disjoint V N) (X X₀ : ℝ) (hX : 0 < X) (hX₀ : 0 < X₀) : columnLog p X (V ∪ N) = Real.log (primeProductNorm p V * X₀ / X) + columnLog p X₀ N := by have hV := primeProductNorm_pos p hp V have hN := primeProductNorm_pos p hp N unfold columnLog rw [primeProductNorm_union p V N hVN, ← Real.log_mul (ne_of_gt (div_pos (mul_pos hV hX₀) hX)) (ne_of_gt (div_pos hN hX₀))] congr 1 field_simp lemma halfNormalization_at_ratio (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g : 𝓢(ℝ, ℂ)) (hU : ∀ s, g s ≠ 0 → U s = 1) (N X : ℝ) (hN : 0 < N) (hX : 0 < X) : halfNormalizationCLM U g (Real.log (N / X)) / (Real.sqrt X : ℂ) = g (Real.log (N / X)) / (Real.sqrt N : ℂ) := by rw [halfNormalization_exact U hUc hUs g hU, Real.exp_log (div_pos hN hX), div_div] congr 1 rw [← Complex.ofReal_mul, ← Real.sqrt_mul (div_pos hN hX).le] congr 2 field_simp theorem normalizedColumn_union_test {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (V N : Finset ι) (hVN : Disjoint V N) (X X₀ : ℝ) (hX : 0 < X) (hX₀ : 0 < X₀) (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g : 𝓢(ℝ, ℂ)) (hU : ∀ s, g s ≠ 0 → U s = 1) : normalizedColumn p (fun S => g (columnLog p X S)) (V ∪ N) = halfNormalizationCLM U g (Real.log (primeProductNorm p V * X₀ / X) + columnLog p X₀ N) / (Real.sqrt X : ℂ) := by rw [← columnLog_union_scale p hp V N hVN X X₀ hX hX₀] change g (Real.log (primeProductNorm p (V ∪ N) / X)) / (‖ConcreteTraceCRT.eisEmbedding (∏ i ∈ V ∪ N, p i)‖ : ℂ) = _ rw [← sqrtProductNorm] exact (halfNormalization_at_ratio U hUc hUs g hU (primeProductNorm p (V ∪ N)) X (primeProductNorm_pos p hp _) hX).symm end SecondPassIntegration end open scoped BigOperators Classical namespace CanonicalQuadraticSieve open ActualEisensteinCubic lemma lambdaIdeal_maximal : (Ideal.span {lambda} : Ideal O).IsMaximal := letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO PrincipalIdealRing.isMaximal_of_irreducible PrimaryIdealUnitReindex.lambda_prime_actual.irreducible lemma twoIdeal_maximal : (Ideal.span {(2 : O)} : Ideal O).IsMaximal := by simpa only [cubicTwoIdeal, Ideal.span_singleton_neg] using cubicTwoIdeal_isMaximal lemma twoIdeal_characteristic : ringChar (O ⧸ Ideal.span {(2 : O)}) = 2 := by rw [← Ideal.span_singleton_neg (2 : O)] exact cubicTwoIdeal_residue_char theorem supported_span_iff (z : O) : Supported (Ideal.span {z}) ↔ ¬lambda ∣ z ∧ ¬(2 : O) ∣ z := by constructor · intro h constructor · intro hz have hm : (Ideal.span {lambda} : Ideal O) ∈ UniqueFactorizationMonoid.normalizedFactors (Ideal.span {z}) := by apply (Ideal.mem_normalizedFactors_iff h.1).mpr exact ⟨lambdaIdeal_maximal.isPrime, (Ideal.span_singleton_le_iff_mem _).mpr (Ideal.mem_span_singleton.mpr hz)⟩ exact (h.2 _ hm).1 (Ideal.subset_span (by simp)) · intro hz have hm : (Ideal.span {(2 : O)} : Ideal O) ∈ UniqueFactorizationMonoid.normalizedFactors (Ideal.span {z}) := by apply (Ideal.mem_normalizedFactors_iff h.1).mpr exact ⟨twoIdeal_maximal.isPrime, (Ideal.span_singleton_le_iff_mem _).mpr (Ideal.mem_span_singleton.mpr hz)⟩ exact (h.2 _ hm).2 twoIdeal_characteristic · rintro ⟨hLam, htwo⟩ have hz : z ≠ 0 := fun heq => hLam (heq ▸ dvd_zero lambda) refine ⟨Ideal.span_singleton_eq_bot.not.mpr hz, ?_⟩ intro P hP have hp := UniqueFactorizationMonoid.prime_of_normalized_factor P hP let : P.IsMaximal := (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero have hzP : z ∈ P := ((Ideal.mem_normalizedFactors_iff (Ideal.span_singleton_eq_bot.not.mpr hz)).mp hP).2 (Ideal.subset_span (by simp)) constructor · intro hlambdaP have heq := maximal_ideal_eq_span_of_mem P inferInstance lambda lambdaIdeal_maximal hlambdaP rw [heq] at hzP exact hLam (Ideal.mem_span_singleton.mp hzP) · intro hchar have htwoP : (2 : O) ∈ P := by apply Ideal.Quotient.eq_zero_iff_mem.mp have hzero : (2 : O ⧸ P) = 0 := (ringChar.spec (O ⧸ P) 2).mpr (by rw [hchar]) simpa only [map_ofNat] using hzero have heq := maximal_ideal_eq_span_of_mem P inferInstance (2 : O) twoIdeal_maximal htwoP rw [heq] at hzP exact htwo (Ideal.mem_span_singleton.mp hzP) def badPrime (i : Bool) : Ideal O := if i then Ideal.span {(2 : O)} else Ideal.span {lambda} theorem badPrime_mask (z : O) : rowCoprimeMask badPrime Finset.univ z = if Supported (Ideal.span {z}) then 1 else 0 := by rw [supported_span_iff] simp only [rowCoprimeMask, Finset.mem_univ, true_and, Bool.exists_bool, badPrime, Bool.false_eq_true, ite_false, ite_true, Ideal.mem_span_singleton] by_cases hLam : lambda ∣ z <;> by_cases htwo : (2 : O) ∣ z <;> simp [hLam, htwo] open ActualEisensteinCubic CompletedGauss FiniteSieveOperator theorem highKernelNorm_mono {M N K M' N' K' : ℝ} (hM : M ≤ M') (hN : N ≤ N') (hK : K' ≤ K) : highKernelNorm M N K ≤ highKernelNorm M' N' K' := by let r : highKernelRange M K → highKernelRange M' K' := fun I => ⟨I.val, by obtain ⟨hs, hn, hk⟩ := mem_highKernelRange.mp I.property exact mem_highKernelRange.mpr ⟨hs, hn.trans hM, hK.trans_lt hk⟩⟩ have hr : Function.Injective r := fun I J h => Subtype.ext (congrArg (fun I : highKernelRange M' K' => I.val) h) have h := FiniteSieveRestriction.submatrix_norm_le r hr (rangeInclusion hN) (rangeInclusion_injective hN) (highKernelMatrix M' N' K') exact pow_le_pow_left₀ (norm_nonneg _) h 2 theorem highKernel_family_squared_norm_le {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (M N K : ℝ) (hrows : ∀ i, rows i ∈ highKernelRange M K) (hcols : ∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) : ‖operator (fun i j => quadraticRow (cols j) (primaryGenerator (rows i)))‖ ^ 2 ≤ highKernelNorm M N K := by let r : m → highKernelRange M K := fun i => ⟨rows i, hrows i⟩ let c : n → idealRange N := fun j => ⟨cols j, mem_idealRange.mpr (hcols j)⟩ have hri : Function.Injective r := fun i j h => hr (congrArg Subtype.val h) have hci : Function.Injective c := fun i j h => hc (congrArg Subtype.val h) have h := FiniteSieveRestriction.submatrix_norm_le r hri c hci (highKernelMatrix M N K) exact pow_le_pow_left₀ (norm_nonneg _) h 2 theorem highKernel_quotient_family_squared_norm_le {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (D : Ideal O) (hD : D ≠ 0) (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (hdiv : ∀ j, D ∣ cols j) (M N K : ℝ) (hrows : ∀ i, rows i ∈ highKernelRange M K) (hcols : ∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) : ‖FiniteSieveOperator.operator (fun i j => quadraticRow (idealQuotient D (cols j)) (primaryGenerator (rows i)))‖ ^ 2 ≤ highKernelNorm M (N / (Ideal.absNorm D : ℝ)) K := by apply highKernel_family_squared_norm_le rows (fun j => idealQuotient D (cols j)) hr · intro j k heq exact hc (idealQuotient_injective_on D (hdiv j) (hdiv k) heq) · exact hrows · intro j exact ⟨admissible_idealQuotient (hcols j).1 (hdiv j), idealQuotient_norm_le hD (hdiv j) N (hcols j).2⟩ theorem highKernel_quotientMatrix_squared_norm_le {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (D : Ideal O) (hD : D ≠ 0) (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (M N K : ℝ) (hrows : ∀ i, rows i ∈ highKernelRange M K) (hcols : ∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) : ‖FiniteSieveOperator.operator (quotientMatrix D rows cols)‖ ^ 2 ≤ highKernelNorm M (N / (Ideal.absNorm D : ℝ)) K := by let S : Finset n := Finset.univ.filter (fun j => D ∣ cols j) let A : Matrix m S ℂ := fun i j => quadraticRow (idealQuotient D (cols j.val)) (primaryGenerator (rows i)) have hnorm : ‖FiniteSieveOperator.operator A‖ ^ 2 ≤ highKernelNorm M (N / (Ideal.absNorm D : ℝ)) K := by apply highKernel_quotient_family_squared_norm_le D hD rows (fun j : S => cols j.val) hr (hc.comp Subtype.val_injective) · intro j exact (Finset.mem_filter.mp j.property).2 · exact hrows · intro j exact hcols j.val apply FiniteSieveOperator.squared_norm_le_of_energy _ _ (highKernelNorm_nonneg _ _ _) intro a have hinner (i : m) : (∑ j, quotientMatrix D rows cols i j * a j) = ∑ j : S, A i j * a j.val := by change (∑ j, (if D ∣ cols j then quadraticRow (idealQuotient D (cols j)) (primaryGenerator (rows i)) else 0) * a j) = ∑ j : S, quadraticRow (idealQuotient D (cols j.val)) (primaryGenerator (rows i)) * a j.val rw [Finset.sum_coe_sort S (fun j : n => quadraticRow (idealQuotient D (cols j)) (primaryGenerator (rows i)) * a j)] simp only [S, Finset.sum_filter, ite_mul, zero_mul] simp_rw [hinner] have henergy := FiniteSieveOperator.energy_bound A (fun j : S => a j.val) apply henergy.trans calc _ ≤ highKernelNorm M (N / (Ideal.absNorm D : ℝ)) K * ∑ j : S, ‖a j.val‖ ^ 2 := mul_le_mul_of_nonneg_right hnorm (by positivity) _ ≤ _ := by apply mul_le_mul_of_nonneg_left _ (highKernelNorm_nonneg _ _ _) rw [Finset.sum_coe_sort S (fun j : n => ‖a j‖ ^ 2)] exact Finset.sum_le_univ_sum_of_nonneg (fun j => sq_nonneg ‖a j‖) open ActualEisensteinCubic CompletedGauss FiniteSieveOperator IdealCoprimeSieveOperator def totalQuotient (D I : Ideal O) : Ideal O := if D ∣ I then idealQuotient D I else 1 theorem totalQuotient_ne_zero (D I : Ideal O) (hI : Admissible I) : totalQuotient D I ≠ 0 := by by_cases h : D ∣ I · simpa only [totalQuotient, if_pos h] using (admissible_idealQuotient hI h).1 · simp [totalQuotient, h] theorem totalQuotient_norm_le (D I : Ideal O) (hI : Admissible I) (N : ℝ) (hN : 1 ≤ N) (hIN : (Ideal.absNorm I : ℝ) ≤ N) : (Ideal.absNorm (totalQuotient D I) : ℝ) ≤ N := by by_cases h : D ∣ I · rw [totalQuotient, if_pos h] have hn : 0 < Ideal.absNorm I := Nat.pos_iff_ne_zero.mpr (fun hz => hI.1 (Ideal.absNorm_eq_zero_iff.mp hz)) exact (Nat.cast_le.mpr (Nat.le_of_dvd hn (map_dvd Ideal.absNorm (idealQuotient_dvd h)))).trans hIN · simpa only [totalQuotient, if_neg h, map_one, Nat.cast_one] using hN theorem gcd_eq_iff_quotient_coprime (D I J : Ideal O) (hD : D ≠ 0) (hDI : D ∣ I) (hDJ : D ∣ J) : gcd I J = D ↔ IsCoprime (idealQuotient D I) (idealQuotient D J) := by have he : gcd I J = D * gcd (idealQuotient D I) (idealQuotient D J) := by calc gcd I J = gcd (D * idealQuotient D I) (D * idealQuotient D J) := by rw [idealQuotient_mul hDI, idealQuotient_mul hDJ] _ = _ := by rw [_root_.gcd_mul_left, normalize_eq] rw [he, Ideal.isCoprime_iff_gcd] constructor · intro h exact mul_left_cancel₀ hD (h.trans (mul_one D).symm) · intro h rw [h, mul_one] def gcdTerm {m n : Type*} (D : Ideal O) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (i : m) (j k : n) : ℂ := if gcd (cols j) (cols k) = D then star (quadraticRow (cols j) (primaryGenerator (rows i)) * a j) * (quadraticRow (cols k) (primaryGenerator (rows i)) * a k) else 0 def gcdBlock {m n : Type*} [Fintype m] [Fintype n] (D : Ideal O) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) : ℂ := ∑ i, ∑ j, ∑ k, gcdTerm D rows cols a i j k theorem gcdTerm_eq_quotient {m n : Type*} (D : Ideal O) (hD : D ≠ 0) (rows : m → Ideal O) (cols : n → Ideal O) (hcols : ∀ j, Admissible (cols j)) (a : n → ℂ) (i : m) (j k : n) : gcdTerm D rows cols a i j k = (star (quadraticRow D (primaryGenerator (rows i))) * quadraticRow D (primaryGenerator (rows i))) * (if IsCoprime (totalQuotient D (cols j)) (totalQuotient D (cols k)) then star (quotientMatrix D rows cols i j * (if D ∣ cols j then a j else 0)) * (quotientMatrix D rows cols i k * (if D ∣ cols k then a k else 0)) else 0) := by by_cases hj : D ∣ cols j · by_cases hk : D ∣ cols k · simp only [gcdTerm, totalQuotient, quotientMatrix, if_pos hj, if_pos hk] rw [← gcd_eq_iff_quotient_coprime D (cols j) (cols k) hD hj hk] by_cases hg : gcd (cols j) (cols k) = D · rw [if_pos hg, if_pos hg, quadraticRow_divisor_factor _ D (hcols j) hj, quadraticRow_divisor_factor _ D (hcols k) hk] simp only [star_mul] ring · simp only [if_neg hg, mul_zero] · have hg : gcd (cols j) (cols k) ≠ D := by intro he exact hk (he ▸ gcd_dvd_right (cols j) (cols k)) simp only [gcdTerm, if_neg hg] simp [quotientMatrix, hk] · have hg : gcd (cols j) (cols k) ≠ D := by intro he exact hj (he ▸ gcd_dvd_left (cols j) (cols k)) simp only [gcdTerm, if_neg hg] simp [quotientMatrix, hj] end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.GcdReduction namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve open ActualEisensteinCubic CompletedGauss FiniteSieveOperator IdealCoprimeSieveOperator DivisorBlockCauchy def gcdPool {n : Type*} [Fintype n] (cols : n → Ideal O) : Finset (Ideal O) := Finset.univ.image (fun p : n × n => gcd (cols p.1) (cols p.2)) theorem mem_gcdPool {n : Type*} [Fintype n] (cols : n → Ideal O) (j k : n) : gcd (cols j) (cols k) ∈ gcdPool cols := Finset.mem_image.mpr ⟨(j, k), Finset.mem_univ _, rfl⟩ theorem energy_eq_gcd_blocks {m n : Type*} [Fintype m] [Fintype n] (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) : ((∑ i, ‖∑ j, quadraticRow (cols j) (primaryGenerator (rows i)) * a j‖ ^ 2 : ℝ) : ℂ) = ∑ D ∈ gcdPool cols, gcdBlock D rows cols a := by have hp (i : m) (j k : n) : (∑ D ∈ gcdPool cols, gcdTerm D rows cols a i j k) = star (quadraticRow (cols j) (primaryGenerator (rows i)) * a j) * (quadraticRow (cols k) (primaryGenerator (rows i)) * a k) := by rw [Finset.sum_eq_single (gcd (cols j) (cols k))] · simp only [gcdTerm, ite_true] · intro D hD hne exact if_neg (Ne.symm hne) · exact fun h => (h (mem_gcdPool cols j k)).elim have hi (i : m) : (∑ D ∈ gcdPool cols, ∑ j, ∑ k, gcdTerm D rows cols a i j k) = ∑ j, ∑ k, star (quadraticRow (cols j) (primaryGenerator (rows i)) * a j) * (quadraticRow (cols k) (primaryGenerator (rows i)) * a k) := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ rw [Finset.sum_comm] exact Finset.sum_congr rfl (fun k _ => hp i j k) simp only [gcdBlock] rw [Finset.sum_comm] simp_rw [hi] push_cast apply Finset.sum_congr rfl intro i _ simpa only [Complex.ofReal_pow] using CoprimeSieveOperator.square_norm_sum (fun j => quadraticRow (cols j) (primaryGenerator (rows i)) * a j) end CanonicalQuadraticSieve namespace FiniteSieveRestriction def sectorCoefficient {n r : Type*} [DecidableEq r] (σ : n → r) (c : r) (a : n → ℂ) (j : n) : ℂ := if σ j = c then a j else 0 theorem sectorCoefficient_energy {n r : Type*} [Fintype n] [Fintype r] [DecidableEq r] (σ : n → r) (a : n → ℂ) : (∑ c, ∑ j, ‖sectorCoefficient σ c a j‖ ^ 2) = ∑ j, ‖a j‖ ^ 2 := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ rw [Finset.sum_eq_single (σ j)] · simp [sectorCoefficient] · intro c hc hne simp [sectorCoefficient, Ne.symm hne] · simp private theorem norm_sum_square_card {r : Type*} [Fintype r] (f : r → ℂ) : ‖∑ c, f c‖ ^ 2 ≤ (Fintype.card r : ℝ) * ∑ c, ‖f c‖ ^ 2 := by have h := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (fun _ : r => (1 : ℝ)) (fun c => ‖f c‖) have hh : ‖∑ c, f c‖ ^ 2 ≤ (∑ c, ‖f c‖) ^ 2 := pow_le_pow_left₀ (norm_nonneg _) (norm_sum_le _ _) 2 exact hh.trans (by simpa using h) theorem sector_energy_bound {m n r : Type*} [Fintype m] [Fintype n] [Fintype r] [DecidableEq r] (A : Matrix m n ℂ) (σ : n → r) (a : n → ℂ) : (∑ i, ‖∑ j, A i j * a j‖ ^ 2) ≤ (Fintype.card r : ℝ) * ∑ c, ∑ i, ‖∑ j, A i j * sectorCoefficient σ c a j‖ ^ 2 := by have hi (i : m) : (∑ j, A i j * a j) = ∑ c, ∑ j, A i j * sectorCoefficient σ c a j := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ rw [← Finset.mul_sum, Finset.sum_eq_single (σ j)] · simp [sectorCoefficient] · intro c hc hne simp [sectorCoefficient, Ne.symm hne] · simp calc _ ≤ ∑ i, (Fintype.card r : ℝ) * ∑ c, ‖∑ j, A i j * sectorCoefficient σ c a j‖ ^ 2 := by apply Finset.sum_le_sum intro i _ rw [hi] exact norm_sum_square_card _ _ = _ := by rw [← Finset.mul_sum, Finset.sum_comm] end FiniteSieveRestriction namespace CanonicalQuadraticSieve open ActualEisensteinCubic CompletedGauss IdealCoprimeSieveOperator DivisorBlockCauchy open FiniteSieveRestriction def columnRay (I : Ideal O) : EisensteinEPrimaryPhase.Coord := ActualEisensteinCoordinates.residue (primaryGenerator I) def rayGcdBlock {m n : Type*} [Fintype m] [Fintype n] (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) : ℂ := gcdBlock D rows cols (sectorCoefficient (fun j => columnRay (cols j)) c a) theorem rayGcdBlock_eq {m n : Type*} [Fintype m] [Fintype n] (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) : rayGcdBlock D c rows cols a = ∑ i, ∑ j, ∑ k, if gcd (cols j) (cols k) = D ∧ columnRay (cols j) = c ∧ columnRay (cols k) = c then star (quadraticRow (cols j) (primaryGenerator (rows i)) * a j) * (quadraticRow (cols k) (primaryGenerator (rows i)) * a k) else 0 := by unfold rayGcdBlock gcdBlock gcdTerm sectorCoefficient apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ by_cases hg : gcd (cols j) (cols k) = D <;> by_cases hj : columnRay (cols j) = c <;> by_cases hk : columnRay (cols k) = c <;> simp only [hg, hj, hk, ↓reduceIte, true_and, false_and, and_false, mul_zero, zero_mul, star_zero] end CanonicalQuadraticSieve namespace FiniteSieveOperator end FiniteSieveOperator namespace CanonicalQuadraticSieve open ActualEisensteinCubic CompletedGauss FiniteSieveOperator open IdealCoprimeSieveOperator DivisorBlockCauchy open ActualEisensteinCubic CompletedGauss FiniteSieveOperator IdealCoprimeSieveOperator DivisorBlockCauchy def weightedGcdBlock {m n : Type*} [Fintype m] [Fintype n] (D : Ideal O) (rows : m → Ideal O) (cols : n → Ideal O) (w : m → ℂ) (a : n → ℂ) : ℂ := ∑ i, w i * ∑ j, ∑ k, gcdTerm D rows cols a i j k theorem highKernel_weightedGcdBlock_bound {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (ε : ℝ) (hε : 0 < ε) (D : Ideal O) (hD : D ≠ 0) (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (M N K : ℝ) (hN : 1 ≤ N) (hrows : ∀ i, rows i ∈ highKernelRange M K) (hcols : ∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) (w : m → ℂ) (W : ℝ) (hW : 0 ≤ W) (hw : ∀ i, ‖w i‖ ≤ W) (a : n → ℂ) : ‖weightedGcdBlock D rows cols w a‖ ≤ W * highKernelNorm M (N / (Ideal.absNorm D : ℝ)) K * (supportConstant ε hε * N ^ ε) * ∑ j, ‖if D ∣ cols j then a j else 0‖ ^ 2 := by let v : m → ℂ := fun i => w i * (star (quadraticRow D (primaryGenerator (rows i))) * quadraticRow D (primaryGenerator (rows i))) have hv (i : m) : ‖v i‖ ≤ W := by dsimp only [v] simp only [norm_mul, norm_star] calc _ ≤ W * (1 * 1) := by apply mul_le_mul (hw i) · exact mul_le_mul (quadraticRow_norm_le_one D _) (quadraticRow_norm_le_one D _) (norm_nonneg _) (by norm_num) · positivity · exact hW _ = W := by ring have he : weightedGcdBlock D rows cols w a = ∑ i, v i * ∑ j, ∑ k, if IsCoprime (totalQuotient D (cols j)) (totalQuotient D (cols k)) then star (quotientMatrix D rows cols i j * (if D ∣ cols j then a j else 0)) * (quotientMatrix D rows cols i k * (if D ∣ cols k then a k else 0)) else 0 := by unfold weightedGcdBlock simp_rw [gcdTerm_eq_quotient D hD rows cols (fun j => (hcols j).1) a] simp only [v, ← Finset.mul_sum, mul_assoc] rw [he] have hb := ideal_coprime_gram_operator_bound ε hε (fun j => totalQuotient D (cols j)) (fun j => totalQuotient_ne_zero D _ (hcols j).1) N (by linarith) (fun j => totalQuotient_norm_le D _ (hcols j).1 N hN (hcols j).2) (quotientMatrix D rows cols) (fun j => if D ∣ cols j then a j else 0) v W hW hv apply hb.trans exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (highKernel_quotientMatrix_squared_norm_le D hD rows cols hr hc M N K hrows hcols) hW) (mul_nonneg (supportConstant_pos ε hε).le (Real.rpow_nonneg (by linarith) _))) (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) theorem highKernel_large_weighted_gcd_blocks {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (ε : ℝ) (hε : 0 < ε) (S : Finset (Ideal O)) (G : ℝ) (hG : 0 < G) (hS : ∀ D ∈ S, G ≤ (Ideal.absNorm D : ℝ)) (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (M N K : ℝ) (hN : 1 ≤ N) (hrows : ∀ i, rows i ∈ highKernelRange M K) (hcols : ∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) (w : m → ℂ) (W : ℝ) (hW : 0 ≤ W) (hw : ∀ i, ‖w i‖ ≤ W) (a : n → ℂ) : (∑ D ∈ S, ‖weightedGcdBlock D rows cols w a‖) ≤ W * highKernelNorm M (N / G) K * (supportConstant ε hε * divisorConstant ε hε) * (N ^ ε) ^ 2 * ∑ j, ‖a j‖ ^ 2 := by have hfac : 0 ≤ supportConstant ε hε * N ^ ε := mul_nonneg (supportConstant_pos ε hε).le (Real.rpow_nonneg (by linarith) _) have hB : 0 ≤ highKernelNorm M (N / G) K := highKernelNorm_nonneg _ _ _ have hb (D : Ideal O) (hD : D ∈ S) : ‖weightedGcdBlock D rows cols w a‖ ≤ W * highKernelNorm M (N / G) K * (supportConstant ε hε * N ^ ε) * ∑ j, ‖if D ∣ cols j then a j else 0‖ ^ 2 := by have hn : 0 < (Ideal.absNorm D : ℝ) := hG.trans_le (hS D hD) have hD0 : D ≠ 0 := by intro hz; simp [hz] at hn have hmono := highKernelNorm_mono (M := M) (K := K) (M' := M) (K' := K) le_rfl (div_le_div_of_nonneg_left (by linarith : 0 ≤ N) hG (hS D hD)) le_rfl exact (highKernel_weightedGcdBlock_bound ε hε D hD0 rows cols hr hc M N K hN hrows hcols w W hW hw a).trans (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hmono hW) hfac) (by positivity)) calc _ ≤ ∑ D ∈ S, W * highKernelNorm M (N / G) K * (supportConstant ε hε * N ^ ε) * ∑ j, ‖if D ∣ cols j then a j else 0‖ ^ 2 := Finset.sum_le_sum hb _ = W * highKernelNorm M (N / G) K * (supportConstant ε hε * N ^ ε) * ∑ D ∈ S, ∑ j, ‖if D ∣ cols j then a j else 0‖ ^ 2 := (Finset.mul_sum ..).symm _ ≤ W * highKernelNorm M (N / G) K * (supportConstant ε hε * N ^ ε) * ((divisorConstant ε hε * N ^ ε) * ∑ j, ‖a j‖ ^ 2) := mul_le_mul_of_nonneg_left (divisor_mask_energy_small_power ε hε S cols (fun j => (hcols j).1.1) N (fun j => (hcols j).2) a) (mul_nonneg (mul_nonneg hW hB) hfac) _ = _ := by ring end CanonicalQuadraticSieve namespace FiniteSieveRestriction theorem sector_weighted_energy_bound {m n r : Type*} [Fintype m] [Fintype n] [Fintype r] [DecidableEq r] (A : Matrix m n ℂ) (σ : n → r) (a : n → ℂ) (v : m → ℝ) (hv : ∀ i, 0 ≤ v i) : (∑ i, v i * ‖∑ j, A i j * a j‖ ^ 2) ≤ (Fintype.card r : ℝ) * ∑ c, ∑ i, v i * ‖∑ j, A i j * sectorCoefficient σ c a j‖ ^ 2 := by have hi (i : m) : ‖∑ j, A i j * a j‖ ^ 2 ≤ (Fintype.card r : ℝ) * ∑ c, ‖∑ j, A i j * sectorCoefficient σ c a j‖ ^ 2 := by simpa only [Fintype.sum_unique] using sector_energy_bound (fun _ : Unit => A i) σ a calc _ ≤ ∑ i, v i * ((Fintype.card r : ℝ) * ∑ c, ‖∑ j, A i j * sectorCoefficient σ c a j‖ ^ 2) := Finset.sum_le_sum (fun i _ => mul_le_mul_of_nonneg_left (hi i) (hv i)) _ = _ := by simp only [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro c _ apply Finset.sum_congr rfl intro i _ ring end FiniteSieveRestriction namespace CanonicalQuadraticSieve section open ActualEisensteinCubic CompletedGauss IdealCoprimeSieveOperator DivisorBlockCauchy FiniteSieveRestriction theorem weighted_energy_eq_gcd_blocks {m n : Type*} [Fintype m] [Fintype n] (rows : m → Ideal O) (cols : n → Ideal O) (v : m → ℝ) (a : n → ℂ) : ((∑ i, v i * ‖∑ j, quadraticRow (cols j) (primaryGenerator (rows i)) * a j‖ ^ 2 : ℝ) : ℂ) = ∑ D ∈ gcdPool cols, weightedGcdBlock D rows cols (fun i => (v i : ℂ)) a := by have hi (i : m) : ((‖∑ j, quadraticRow (cols j) (primaryGenerator (rows i)) * a j‖ ^ 2 : ℝ) : ℂ) = ∑ D ∈ gcdPool cols, ∑ j, ∑ k, gcdTerm D rows cols a i j k := by simpa only [gcdBlock, Fintype.sum_unique, gcdTerm] using energy_eq_gcd_blocks (fun _ : Unit => rows i) cols a simp only [Complex.ofReal_sum, Complex.ofReal_mul, hi, Finset.mul_sum, weightedGcdBlock] rw [Finset.sum_comm] theorem weighted_energy_le_gcd_blocks {m n : Type*} [Fintype m] [Fintype n] (rows : m → Ideal O) (cols : n → Ideal O) (v : m → ℝ) (hv : ∀ i, 0 ≤ v i) (a : n → ℂ) : (∑ i, v i * ‖∑ j, quadraticRow (cols j) (primaryGenerator (rows i)) * a j‖ ^ 2) ≤ ∑ D ∈ gcdPool cols, ‖weightedGcdBlock D rows cols (fun i => (v i : ℂ)) a‖ := by have he := congrArg norm (weighted_energy_eq_gcd_blocks rows cols v a) rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (Finset.sum_nonneg (fun i _ => mul_nonneg (hv i) (sq_nonneg _)))] at he rw [he] exact norm_sum_le _ _ theorem highKernel_weighted_energy_gcd_reduction {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (ε : ℝ) (hε : 0 < ε) (G : ℝ) (hG : 0 < G) (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (M N K : ℝ) (hN : 1 ≤ N) (hrows : ∀ i, rows i ∈ highKernelRange M K) (hcols : ∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) (v : m → ℝ) (W : ℝ) (hW : 0 ≤ W) (hv : ∀ i, 0 ≤ v i ∧ v i ≤ W) (a : n → ℂ) : (∑ i, v i * ‖∑ j, quadraticRow (cols j) (primaryGenerator (rows i)) * a j‖ ^ 2) ≤ (∑ D ∈ (gcdPool cols).filter (fun D => (Ideal.absNorm D : ℝ) ≤ G), ‖weightedGcdBlock D rows cols (fun i => (v i : ℂ)) a‖) + W * highKernelNorm M (N / G) K * (supportConstant ε hε * divisorConstant ε hε) * (N ^ ε) ^ 2 * ∑ j, ‖a j‖ ^ 2 := by have he := weighted_energy_le_gcd_blocks rows cols v (fun i => (hv i).1) a rw [← Finset.sum_filter_add_sum_filter_not (gcdPool cols) (fun D => (Ideal.absNorm D : ℝ) ≤ G)] at he exact he.trans (add_le_add le_rfl (highKernel_large_weighted_gcd_blocks ε hε _ G hG (fun D hD => (lt_of_not_ge (Finset.mem_filter.mp hD).2).le) rows cols hr hc M N K hN hrows hcols (fun i => (v i : ℂ)) W hW (fun i => by simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hv i).1] using (hv i).2) a)) def weightedRayGcdBlock {m n : Type*} [Fintype m] [Fintype n] (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (rows : m → Ideal O) (cols : n → Ideal O) (v : m → ℝ) (a : n → ℂ) : ℂ := weightedGcdBlock D rows cols (fun i => (v i : ℂ)) (sectorCoefficient (fun j => columnRay (cols j)) c a) theorem highKernel_weighted_energy_ray_gcd_reduction {m n : Type*} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (ε : ℝ) (hε : 0 < ε) (G : ℝ) (hG : 0 < G) (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (M N K : ℝ) (hN : 1 ≤ N) (hrows : ∀ i, rows i ∈ highKernelRange M K) (hcols : ∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) (v : m → ℝ) (W : ℝ) (hW : 0 ≤ W) (hv : ∀ i, 0 ≤ v i ∧ v i ≤ W) (a : n → ℂ) : (∑ i, v i * ‖∑ j, quadraticRow (cols j) (primaryGenerator (rows i)) * a j‖ ^ 2) ≤ 16 * ((∑ c : EisensteinEPrimaryPhase.Coord, ∑ D ∈ (gcdPool cols).filter (fun D => (Ideal.absNorm D : ℝ) ≤ G), ‖weightedRayGcdBlock D c rows cols v a‖) + W * highKernelNorm M (N / G) K * (supportConstant ε hε * divisorConstant ε hε) * (N ^ ε) ^ 2 * ∑ j, ‖a j‖ ^ 2) := by let σ : n → EisensteinEPrimaryPhase.Coord := fun j => columnRay (cols j) let C := W * highKernelNorm M (N / G) K * (supportConstant ε hε * divisorConstant ε hε) * (N ^ ε) ^ 2 have hs := sector_weighted_energy_bound (fun i j => quadraticRow (cols j) (primaryGenerator (rows i))) σ a v (fun i => (hv i).1) have hcard : Fintype.card EisensteinEPrimaryPhase.Coord = 16 := by decide rw [hcard] at hs norm_num only [Nat.cast_ofNat] at hs apply hs.trans apply mul_le_mul_of_nonneg_left _ (by norm_num) calc _ ≤ ∑ c : EisensteinEPrimaryPhase.Coord, ((∑ D ∈ (gcdPool cols).filter (fun D => (Ideal.absNorm D : ℝ) ≤ G), ‖weightedRayGcdBlock D c rows cols v a‖) + C * ∑ j, ‖sectorCoefficient σ c a j‖ ^ 2) := by apply Finset.sum_le_sum intro c _ exact highKernel_weighted_energy_gcd_reduction ε hε G hG rows cols hr hc M N K hN hrows hcols v W hW hv (sectorCoefficient σ c a) _ = _ := by rw [Finset.sum_add_distrib, ← Finset.mul_sum, sectorCoefficient_energy] end open ActualEisensteinCubic CompletedGauss IdealCoprimeSieveOperator DivisorBlockCauchy end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.AnnularRecursion namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ActualEisensteinCubic CompletedGauss FiniteSieveOperator open IdealCoprimeSieveOperator DivisorBlockCauchy FiniteSieveRestriction def weightedRayGramMatrix {m n : Type*} [Fintype m] (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (rows : m → Ideal O) (cols : n → Ideal O) (v : m → ℝ) : Matrix n n ℂ := fun j k => ∑ i, (v i : ℂ) * (if gcd (cols j) (cols k) = D ∧ columnRay (cols j) = c ∧ columnRay (cols k) = c then star (quadraticRow (cols j) (primaryGenerator (rows i))) * quadraticRow (cols k) (primaryGenerator (rows i)) else 0) end section open ActualEisensteinCubic CompletedGauss FiniteSieveRestriction open QuadraticSquarefreeKernel def rayPairValue (N : ℝ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (a : idealRange N → ℂ) (I : Ideal O) : ℂ := ∑ J : idealRange N, ∑ lengthScale : idealRange N, gcdTerm D (fun _ : Unit => I) (fun J : idealRange N => J.val) (sectorCoefficient (fun J : idealRange N => columnRay J.val) c a) () J lengthScale theorem rayPairValue_eq (N : ℝ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (a : idealRange N → ℂ) (I : Ideal O) : rayPairValue N D c a I = ∑ J : idealRange N, ∑ lengthScale : idealRange N, if gcd J.val lengthScale.val = D ∧ columnRay J.val = c ∧ columnRay lengthScale.val = c then star (quadraticRow J.val (primaryGenerator I) * a J) * (quadraticRow lengthScale.val (primaryGenerator I) * a lengthScale) else 0 := by simpa only [rayPairValue, rayGcdBlock, gcdBlock, Fintype.sum_unique, gcdTerm] using rayGcdBlock_eq D c (fun _ : Unit => I) (fun J : idealRange N => J.val) a end open ActualEisensteinCubic CompletedGauss FiniteSieveOperator def highKernelShellRange (M K : ℝ) : Finset (Ideal O) := (highKernelRange M K).filter (fun I => M / 2 < (Ideal.absNorm I : ℝ)) theorem exists_dyadic_shell (n lengthScale : ℕ) (hn : 1 ≤ n) (hL : (n : ℝ) ≤ (2 : ℝ) ^ lengthScale) : ∃ j ∈ Finset.range (lengthScale + 1), (2 : ℝ) ^ j / 2 < n ∧ (n : ℝ) ≤ (2 : ℝ) ^ j := by have hex : ∃ j : ℕ, (n : ℝ) ≤ (2 : ℝ) ^ j := ⟨lengthScale, hL⟩ let j := Nat.find hex have hj : (n : ℝ) ≤ (2 : ℝ) ^ j := Nat.find_spec hex have hjL : j ≤ lengthScale := Nat.find_min' hex hL refine ⟨j, Finset.mem_range.mpr (by omega), ?_, hj⟩ have hjfind : j = Nat.find hex := rfl rcases j with _ | j · have hnR : (1 : ℝ) ≤ n := by exact_mod_cast hn norm_num linarith · have hprev : ¬ (n : ℝ) ≤ (2 : ℝ) ^ j := Nat.find_min hex (by omega) have hp := lt_of_not_ge hprev simpa only [pow_succ, mul_div_cancel_right₀ _ (by norm_num : (2 : ℝ) ≠ 0)] using hp end CanonicalQuadraticSieve open scoped SchwartzMap ContDiff namespace QuadraticInitialBound def annularSieveBump : ContDiffBump (3 / 4 : ℝ) where rIn := 1 / 4 rOut := 1 / 2 rIn_pos := by norm_num rIn_lt_rOut := by norm_num def annularSieveCutoff : 𝓢(ℝ, ℂ) := by have hc : HasCompactSupport (fun t : ℝ => (annularSieveBump t : ℂ)) := annularSieveBump.hasCompactSupport.comp_left Complex.ofReal_zero have hs : ContDiff ℝ ∞ (fun t : ℝ => (annularSieveBump t : ℂ)) := Complex.ofRealCLM.contDiff.comp annularSieveBump.contDiff exact hc.toSchwartzMap hs theorem annularSieveCutoff_apply (t : ℝ) : annularSieveCutoff t = (annularSieveBump t : ℂ) := rfl theorem annularSieveBump_eq_one {t : ℝ} (ht0 : 1 / 2 ≤ t) (ht1 : t ≤ 1) : annularSieveBump t = 1 := by apply annularSieveBump.one_of_mem_closedBall change dist t (3 / 4) ≤ 1 / 4 rw [Real.dist_eq, abs_le] constructor <;> linarith theorem annularSieveBump_zero_of_le {t : ℝ} (ht : t ≤ 1 / 4) : annularSieveBump t = 0 := by apply annularSieveBump.zero_of_le_dist change 1 / 2 ≤ dist t (3 / 4) rw [Real.dist_eq, abs_of_nonpos (by linarith)] linarith theorem annularSieveBump_zero_of_ge {t : ℝ} (ht : 5 / 4 ≤ t) : annularSieveBump t = 0 := by apply annularSieveBump.zero_of_le_dist change 1 / 2 ≤ dist t (3 / 4) rw [Real.dist_eq, abs_of_nonneg (by linarith)] linarith theorem annularSieveCutoff_zero : annularSieveCutoff 0 = 0 := by rw [annularSieveCutoff_apply, annularSieveBump_zero_of_le (by norm_num), Complex.ofReal_zero] end QuadraticInitialBound open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ActualEisensteinCubic CompletedGauss IdealCoprimeSieveOperator DivisorBlockCauchy def annularHighWeight (M : ℝ) (I : Ideal O) : ℝ := QuadraticInitialBound.annularSieveBump ((Ideal.absNorm I : ℝ) / M) def annularHighEnergy (M N K : ℝ) (a : idealRange N → ℂ) : ℝ := ∑ I : highKernelRange (2 * M) K, annularHighWeight M I.val * ‖∑ J : idealRange N, quadraticRow J.val (primaryGenerator I.val) * a J‖ ^ 2 def annularRayGcdBlock (M N K : ℝ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (a : idealRange N → ℂ) : ℂ := weightedRayGcdBlock D c (fun I : highKernelRange (2 * M) K => I.val) (fun J : idealRange N => J.val) (fun I => annularHighWeight M I.val) a end section open ActualEisensteinCubic CompletedGauss FiniteSieveOperator open IdealCoprimeSieveOperator DivisorBlockCauchy FiniteSieveRestriction end open ActualEisensteinCubic CompletedGauss FiniteSieveRestriction open QuadraticSquarefreeKernel theorem annularHighWeight_eq_zero (M : ℝ) (hM : 0 < M) (I : Ideal O) (hI : 2 * M ≤ (Ideal.absNorm I : ℝ)) : annularHighWeight M I = 0 := by have ht : 2 ≤ (Ideal.absNorm I : ℝ) / M := (le_div_iff₀ hM).mpr (by linarith) exact QuadraticInitialBound.annularSieveBump_zero_of_ge (by linarith) theorem annularRayGcdBlock_eq_finite (M N K : ℝ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (a : idealRange N → ℂ) : annularRayGcdBlock M N K D c a = ∑ I : highKernelRange (2 * M) K, (annularHighWeight M I.val : ℂ) * rayPairValue N D c a I.val := by rfl theorem annularRayGcdBlock_eq_tsum (M N K : ℝ) (hM : 0 < M) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (a : idealRange N → ℂ) : annularRayGcdBlock M N K D c a = ∑' I : Ideal O, if Supported I ∧ K < (Ideal.absNorm (squarefreePart I) : ℝ) then QuadraticInitialBound.annularSieveCutoff ((Ideal.absNorm I : ℝ) / M) * rayPairValue N D c a I else 0 := by rw [annularRayGcdBlock_eq_finite, Finset.sum_coe_sort (highKernelRange (2 * M) K) (fun I => (annularHighWeight M I : ℂ) * rayPairValue N D c a I)] symm rw [tsum_eq_sum (s := highKernelRange (2 * M) K) (fun I hI => ?_)] · apply Finset.sum_congr rfl intro I hI have hp : Supported I ∧ K < (Ideal.absNorm (squarefreePart I) : ℝ) := by have h := mem_highKernelRange.mp hI exact ⟨h.1, h.2.2⟩ rw [if_pos hp, QuadraticInitialBound.annularSieveCutoff_apply] rfl · by_cases hp : Supported I ∧ K < (Ideal.absNorm (squarefreePart I) : ℝ) · have hn : 2 * M < (Ideal.absNorm I : ℝ) := by by_contra hh exact hI (mem_highKernelRange.mpr ⟨hp.1, le_of_not_gt hh, hp.2⟩) rw [if_pos hp, QuadraticInitialBound.annularSieveCutoff_apply] change (annularHighWeight M I : ℂ) * _ = 0 rw [annularHighWeight_eq_zero M hM I hn.le] simp · exact if_neg hp end CanonicalQuadraticSieve namespace FiniteSieveOperator end FiniteSieveOperator namespace CanonicalQuadraticSieve section open FiniteSieveOperator end open IdealCoprimeSieveOperator DivisorBlockCauchy end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.HyperbolicSpace namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid section open scoped BigOperators Classical MatrixGroups Matrix section open CubicKubota def compactSubgroup : Subgroup (SL(2,ℂ)) where carrier := {k | (k : Matrix (Fin 2) (Fin 2) ℂ) ∈ Matrix.unitaryGroup (Fin 2) ℂ} one_mem' := (Matrix.unitaryGroup (Fin 2) ℂ).one_mem mul_mem' := by intro a b ha hb exact (Matrix.unitaryGroup (Fin 2) ℂ).mul_mem ha hb inv_mem' := by intro k hk have hinv : (k⁻¹ : SL(2,ℂ)) * k = 1 := inv_mul_cancel k have hmat : ((k⁻¹ : SL(2,ℂ)) : Matrix (Fin 2) (Fin 2) ℂ) * (k : Matrix (Fin 2) (Fin 2) ℂ) = 1 := congrArg (fun a : SL(2,ℂ) => (a : Matrix (Fin 2) (Fin 2) ℂ)) hinv have he := Matrix.left_inv_eq_left_inv hmat (Matrix.mem_unitaryGroup_iff'.mp hk) change ((k⁻¹ : SL(2,ℂ)) : Matrix (Fin 2) (Fin 2) ℂ) ∈ Matrix.unitaryGroup (Fin 2) ℂ rw [he] exact Unitary.star_mem hk abbrev HyperbolicSpace := SL(2,ℂ) ⧸ compactSubgroup def hyperbolicEisenstein (s : ℂ) : HyperbolicSpace → ℂ := Quotient.lift (fun g => eisenstein g s) (by intro g h hgh have hk : g⁻¹*h ∈ compactSubgroup := QuotientGroup.leftRel_apply.mp hgh have hh : h = g*(g⁻¹*h) := by group rw [hh] exact (eisenstein_right_unitary g (g⁻¹*h) s hk).symm) theorem hyperbolicEisenstein_automorphy (M : levelThree) (s : ℂ) (hs : 2 < s.re) (w : HyperbolicSpace) : hyperbolicEisenstein s (complexMatrix M • w) = complexCharacter M * hyperbolicEisenstein s w := by induction w using Quotient.inductionOn with | _ g => exact eisenstein_automorphy M g s hs def upperPoint (z : ℂ) (v : ℝ) (hv : 0 < v) : HyperbolicSpace := (upperSection z v hv : HyperbolicSpace) lemma hyperbolicEisenstein_upperPoint (s : ℂ) (z : ℂ) (v : ℝ) (hv : 0 < v) : hyperbolicEisenstein s (upperPoint z v hv) = upperEisenstein z v hv s := rfl def complexBottomRow (g : SL(2,ℂ)) : Fin 2 → ℂ := g 1 lemma complexBottomRow_mul (g h : SL(2,ℂ)) : complexBottomRow (g*h) = rowOperator h (complexBottomRow g) := by funext j simp only [complexBottomRow, rowOperator_apply, Matrix.SpecialLinearGroup.coe_mul, Matrix.mul_apply, Matrix.vecMul, dotProduct] lemma complexBottomRow_ne_zero (g : SL(2,ℂ)) : complexBottomRow g ≠ 0 := by intro hz have hc : g 1 0 = 0 := congrFun hz 0 have hd : g 1 1 = 0 := congrFun hz 1 have h : g 0 0 * g 1 1 - g 0 1 * g 1 0 = 1 := by simpa only [Matrix.det_fin_two] using g.property simp only [hc, hd, mul_zero, sub_zero] at h exact zero_ne_one h def liftedHeight (g : SL(2,ℂ)) : ℝ := (rowEnergy (complexBottomRow g))⁻¹ lemma liftedHeight_pos (g : SL(2,ℂ)) : 0 < liftedHeight g := inv_pos.mpr (rowEnergy_pos _ (complexBottomRow_ne_zero g)) lemma liftedHeight_right_unitary (g k : SL(2,ℂ)) (hk : k ∈ compactSubgroup) : liftedHeight (g*k) = liftedHeight g := by simp only [liftedHeight, complexBottomRow_mul, rowEnergy_unitary k hk] def hyperbolicHeight : HyperbolicSpace → ℝ := Quotient.lift liftedHeight (by intro g h hgh have hk : g⁻¹*h ∈ compactSubgroup := QuotientGroup.leftRel_apply.mp hgh have hh : h = g*(g⁻¹*h) := by group rw [hh] exact (liftedHeight_right_unitary g (g⁻¹*h) hk).symm) lemma hyperbolicHeight_pos (w : HyperbolicSpace) : 0 < hyperbolicHeight w := by induction w using Quotient.inductionOn with | _ g => exact liftedHeight_pos g theorem hyperbolicHeight_action_upperPoint (g : SL(2,ℂ)) (z : ℂ) (v : ℝ) (hv : 0 < v) : hyperbolicHeight (g • upperPoint z v hv) = v / (‖g 1 0*z + g 1 1‖ ^ 2 + ‖g 1 0‖ ^ 2 * v ^ 2) := by change liftedHeight (g * upperSection z v hv) = _ rw [liftedHeight, complexBottomRow_mul, rowEnergy_upperSection, inv_div] rfl def cosetHeight (x : CuspCosets) : HyperbolicSpace → ℝ := Quotient.lift (fun g : SL(2,ℂ) => (rowEnergy (rowOperator g (embeddedRow x)))⁻¹) (by intro g h hgh have hk : g⁻¹*h ∈ compactSubgroup := QuotientGroup.leftRel_apply.mp hgh have hh : h = g*(g⁻¹*h) := by group rw [hh, ← rowOperator_mul, rowEnergy_unitary (g⁻¹*h) hk]) lemma cosetHeight_cosetOf (M : levelThree) (w : HyperbolicSpace) : cosetHeight (cosetOf M) w = hyperbolicHeight (complexMatrix M • w) := by induction w using Quotient.inductionOn with | _ g => change (rowEnergy (rowOperator g (embeddedRow (cosetOf M))))⁻¹ = liftedHeight (complexMatrix M * g) rw [liftedHeight, complexBottomRow_mul] rfl theorem hyperbolicEisenstein_eq_height_series (s : ℂ) (w : HyperbolicSpace) : hyperbolicEisenstein s w = ∑' x : CuspCosets, (cosetCharacter x)⁻¹ * (cosetHeight x w : ℂ) ^ s := by induction w using Quotient.inductionOn with | _ g => apply tsum_congr intro x change (cosetCharacter x)⁻¹ * (rowEnergy (rowOperator g (embeddedRow x)) : ℂ) ^ (-s) = (cosetCharacter x)⁻¹ * ((rowEnergy (rowOperator g (embeddedRow x)))⁻¹ : ℝ) ^ s rw [Complex.ofReal_inv, Complex.inv_cpow_ofReal_nonneg (rowEnergy_nonneg _), Complex.cpow_neg] theorem height_series_summable_norm (s : ℂ) (hs : 2 < s.re) (w : HyperbolicSpace) : Summable (fun x : CuspCosets => ‖(cosetCharacter x)⁻¹ * (cosetHeight x w : ℂ) ^ s‖) := by induction w using Quotient.inductionOn with | _ g => apply (summable_norm_summand g s hs).congr intro x congr 1 change (cosetCharacter x)⁻¹ * (rowEnergy (rowOperator g (embeddedRow x)) : ℂ) ^ (-s) = (cosetCharacter x)⁻¹ * ((rowEnergy (rowOperator g (embeddedRow x)))⁻¹ : ℝ) ^ s rw [Complex.ofReal_inv, Complex.inv_cpow_ofReal_nonneg (rowEnergy_nonneg _), Complex.cpow_neg] end open ActualEisensteinCubic CubicKubota ConcreteTraceCRT def upperTranslation (a : O) : levelThree := by let M : SL(2,O) := ⟨!![1, 3*a; 0, 1], by simp⟩ refine ⟨M, ?_⟩ change Matrix.SpecialLinearGroup.map (n := Fin 2) (Ideal.Quotient.mk (Ideal.span {(3 : O)})) M = 1 have h3 : Ideal.Quotient.mk (Ideal.span {(3 : O)}) (3 : O) = 0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.subset_span (by simp)) apply Subtype.ext funext i j change Ideal.Quotient.mk (Ideal.span {(3 : O)}) ((!![(1 : O), 3*a; 0, 1]) i j) = (1 : Matrix (Fin 2) (Fin 2) (O ⧸ Ideal.span {(3 : O)})) i j fin_cases i <;> fin_cases j <;> simp [h3, map_mul] lemma complexCharacter_upperTranslation (a : O) : complexCharacter (upperTranslation a) = 1 := by change eisEmbedding (value (upperTranslation a)) = 1 rw [value_zero_lower_left _ (by rfl), map_one] lemma upperTranslation_section (a : O) (z : ℂ) (v : ℝ) (hv : 0 < v) : complexMatrix (upperTranslation a) * upperSection z v hv = upperSection (z + 3*eisEmbedding a) v hv := by apply Subtype.ext funext i j change (((!![(1 : O), 3*a; 0, 1]).map eisEmbedding) * !![(Real.sqrt v : ℂ), z/(Real.sqrt v : ℂ); 0, (Real.sqrt v : ℂ)⁻¹]) i j = (!![(Real.sqrt v : ℂ), (z+3*eisEmbedding a)/(Real.sqrt v : ℂ); 0, (Real.sqrt v : ℂ)⁻¹]) i j fin_cases i <;> fin_cases j <;> simp [Matrix.mul_apply, Fin.sum_univ_two, map_mul] ; norm_num only [map_ofNat] ; ring end open MeasureTheory Set Filter open scoped BigOperators Classical lemma integral_radial_sq (f : ℝ → ℂ) : (∫ z : ℂ, f (‖z‖ ^ 2)) = (Real.pi : ℂ) * ∫ t : ℝ in Set.Ioi 0, f t := by have hball : (volume : Measure ℂ).real (Metric.ball 0 1) = Real.pi := by simp [Measure.real, Complex.volume_ball] have hpolar := integral_fun_norm_addHaar (volume : Measure ℂ) (fun r : ℝ => f (r^2)) have hsub := integral_comp_rpow_Ioi (E := ℂ) f (p := 2) (by norm_num) norm_num [Real.rpow_two, Real.rpow_one] at hsub simp only [Complex.finrank_real_complex, hball, Nat.reduceSub, pow_one, nsmul_eq_mul, Complex.real_smul, ] at hpolar hsub rw [hpolar] rw [← hsub] rw [show (fun x : ℝ => (2:ℂ)*x*f (x^2)) = (fun x : ℝ => (2:ℂ)*(x*f (x^2))) by funext x; ring, integral_const_mul] ring lemma integrable_radial_sq_iff (f : ℝ → ℂ) : Integrable (fun z : ℂ => f (‖z‖ ^ 2)) ↔ IntegrableOn f (Set.Ioi 0) := by rw [integrable_fun_norm_addHaar (volume : Measure ℂ) (f := fun r : ℝ => f (r^2))] have h := integrableOn_Ioi_comp_rpow_iff' (E := ℂ) f (p := 2) (by norm_num) simpa only [Complex.finrank_real_complex, Nat.reduceSub, pow_one, show (2:ℝ)-1=1 by norm_num, Real.rpow_one, Real.rpow_two] using h lemma add_one_image_Ioi : (fun x : ℝ => x+1) '' Set.Ioi 0 = Set.Ioi 1 := by ext y constructor · rintro ⟨x,hx,rfl⟩ simp only [Set.mem_Ioi] at * linarith · intro hy refine ⟨y-1, ?_, by ring⟩ simp only [Set.mem_Ioi] at * linarith lemma integrable_add_one_Ioi_iff (f : ℝ → ℂ) : IntegrableOn (fun x : ℝ => f (x+1)) (Set.Ioi 0) ↔ IntegrableOn f (Set.Ioi 1) := by have h := integrableOn_image_iff_integrableOn_abs_deriv_smul measurableSet_Ioi (fun x (hx : x ∈ Set.Ioi (0:ℝ)) => (hasDerivAt_id x |>.add_const 1).hasDerivWithinAt) (fun x hx y hy hxy => by dsimp at hxy; linarith : InjOn (fun x : ℝ => x+1) (Set.Ioi 0)) f simp only [id_eq] at h rw [add_one_image_Ioi] at h simpa only [abs_one, one_smul] using h.symm lemma integral_add_one_Ioi (f : ℝ → ℂ) : (∫ x : ℝ in Set.Ioi 0, f (x+1)) = ∫ x : ℝ in Set.Ioi 1, f x := by have h := integral_image_eq_integral_abs_deriv_smul measurableSet_Ioi (fun x (hx : x ∈ Set.Ioi (0:ℝ)) => (hasDerivAt_id x |>.add_const 1).hasDerivWithinAt) (fun x hx y hy hxy => by dsimp at hxy; linarith : InjOn (fun x : ℝ => x+1) (Set.Ioi 0)) f simp only [id_eq] at h rw [add_one_image_Ioi] at h simpa only [abs_one, one_smul] using h.symm def hyperbolicKernel (s : ℂ) (z : ℂ) : ℂ := ((1+‖z‖^2 : ℝ) : ℂ) ^ (-s) lemma hyperbolicKernel_integrable (s : ℂ) (hs : 1 < s.re) : Integrable (hyperbolicKernel s) := by unfold hyperbolicKernel rw [integrable_radial_sq_iff (fun t : ℝ => ((1+t : ℝ) : ℂ)^(-s))] have h := (integrable_add_one_Ioi_iff (fun x : ℝ => (x : ℂ)^(-s))).mpr (integrableOn_Ioi_cpow_of_lt (by simpa using neg_lt_neg hs) (by norm_num : (0:ℝ)<1)) simpa only [add_comm] using h theorem integral_hyperbolicKernel (s : ℂ) (hs : 1 < s.re) : (∫ z : ℂ, hyperbolicKernel s z) = (Real.pi : ℂ) / (s-1) := by unfold hyperbolicKernel rw [integral_radial_sq (fun t : ℝ => ((1+t : ℝ) : ℂ)^(-s))] simp_rw [add_comm (1:ℝ)] rw [integral_add_one_Ioi (fun t : ℝ => (t : ℂ)^(-s))] rw [integral_Ioi_cpow_of_lt (by simpa using neg_lt_neg hs) (by norm_num : (0:ℝ)<1)] simp only [Complex.ofReal_one, Complex.one_cpow] have hn : (-s+1)⁻¹ = -(s-1)⁻¹ := by rw [show -s+1=-(s-1) by ring, inv_neg] simp only [div_eq_mul_inv, hn] ring open MeasureTheory Set Filter open scoped BigOperators Classical FourierTransform RealInnerProductSpace lemma breveE_norm (z : ℂ) : ‖ShortDraftTrace.breveE z‖ = 1 := by change ‖Complex.exp (2 * Real.pi * Complex.I * (z + starRingEnd ℂ z))‖ = 1 rw [Complex.norm_exp] have hre : (2 * Real.pi * Complex.I * (z + starRingEnd ℂ z)).re = 0 := by simp [Complex.mul_re, Complex.mul_im] rw [hre, Real.exp_zero] def sourceFourierKernel (s freq : ℂ) : ℂ := ∫ z : ℂ, hyperbolicKernel s z * ShortDraftTrace.breveE (-freq*z) lemma sourceFourierKernel_integrable (s freq : ℂ) (hs : 1 < s.re) : Integrable (fun z : ℂ => hyperbolicKernel s z * ShortDraftTrace.breveE (-freq*z)) := by apply (hyperbolicKernel_integrable s hs).norm.mono' · have hker : Continuous (hyperbolicKernel s) := by unfold hyperbolicKernel apply Continuous.cpow · fun_prop · exact continuous_const · intro z exact Complex.ofReal_mem_slitPlane.mpr (by positivity) have hchar : Continuous (fun z : ℂ => ShortDraftTrace.breveE (-freq*z)) := by change Continuous (fun z : ℂ => Complex.exp (2*Real.pi*Complex.I* ((-freq*z)+starRingEnd ℂ (-freq*z)))) fun_prop exact (hker.mul hchar).aestronglyMeasurable · exact Eventually.of_forall (fun z => by simp only [norm_mul, breveE_norm, mul_one, le_refl]) lemma sourceFourierKernel_zero (s : ℂ) (hs : 1 < s.re) : sourceFourierKernel s 0 = (Real.pi : ℂ)/(s-1) := by simpa only [sourceFourierKernel, neg_zero, zero_mul, AddChar.map_zero_eq_one, mul_one] using integral_hyperbolicKernel s hs lemma sourceFrequency_inner (z freq : ℂ) : inner ℝ z (2*starRingEnd ℂ freq) = 2*(freq*z).re := by rw [real_inner_eq_re_inner (𝕜 := ℂ), RCLike.inner_apply] change ((2 * starRingEnd ℂ freq) * starRingEnd ℂ z).re = _ simp [Complex.mul_re, Complex.mul_im] ring lemma traceIntegral_eq_fourier (f : ℂ → ℂ) (freq : ℂ) : (∫ z : ℂ, f z * ShortDraftTrace.breveE (-freq*z)) = 𝓕 f (2*starRingEnd ℂ freq) := by rw [Real.fourier_eq'] apply integral_congr_ae exact Eventually.of_forall (fun z => by dsimp only rw [sourceFrequency_inner] change f z * Complex.exp (2*Real.pi*Complex.I*((-freq*z)+starRingEnd ℂ (-freq*z))) = _ simp only [smul_eq_mul] rw [mul_comm (f z)] congr 1 congr 1 apply Complex.ext <;> simp [Complex.mul_re, Complex.mul_im] <;> ring) lemma hyperbolicKernel_laplace (s : ℂ) (hs : 0 < s.re) (z : ℂ) : hyperbolicKernel s z * Complex.Gamma s = ∫ t : ℝ in Set.Ioi 0, (t : ℂ)^(s-1) * Complex.exp (-((1+‖z‖^2 : ℝ) : ℂ) * t) := by have h := Complex.integral_cpow_mul_exp_neg_mul_Ioi hs (by positivity : 0 < 1+‖z‖^2) simp only [neg_mul] rw [h] congr 1 rw [hyperbolicKernel, one_div, Complex.inv_cpow_ofReal_nonneg (by positivity), Complex.cpow_neg] lemma source_gaussian_fourier (t : ℝ) (ht : 0 < t) (freq : ℂ) : 𝓕 (fun z : ℂ => Complex.exp (-(t : ℂ)*‖z‖^2)) (2*starRingEnd ℂ freq) = (Real.pi : ℂ)/t * Complex.exp (-(4*Real.pi^2*‖freq‖^2 : ℝ)/t) := by rw [fourier_gaussian_innerProductSpace (by simpa using ht)] norm_num only [Complex.finrank_real_complex, Nat.cast_ofNat, div_self (by norm_num : (2:ℂ)≠0), Complex.cpow_one, norm_mul, Complex.norm_conj, Complex.norm_ofNat] congr 2 push_cast ring def gaussianMixture (s freq : ℂ) (t : ℝ) (z : ℂ) : ℂ := (t : ℂ)^(s-1) * Complex.exp (-t) * Complex.exp (-(t : ℂ)*‖z‖^2) * ShortDraftTrace.breveE (-freq*z) lemma norm_gaussianMixture (s freq : ℂ) (t : ℝ) (ht : 0 < t) (z : ℂ) : ‖gaussianMixture s freq t z‖ = t ^ (s.re-1) * Real.exp (-t) * Real.exp (-t*‖z‖^2) := by simp only [gaussianMixture, norm_mul, breveE_norm, mul_one, Complex.norm_cpow_eq_rpow_re_of_pos ht, Complex.sub_re, Complex.one_re, Complex.norm_exp, Complex.neg_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, ← Complex.ofReal_pow, Complex.neg_im, neg_zero, zero_mul, sub_zero] lemma gaussianMixture_slice_integrable (s freq : ℂ) (t : ℝ) (ht : 0 < t) : Integrable (gaussianMixture s freq t) := by have hg : Integrable (fun z : ℂ => Complex.exp (-(t : ℂ)*‖z‖^2)) := by simpa only [zero_mul, add_zero] using GaussianFourier.integrable_cexp_neg_mul_sq_norm_add (by simpa using ht : 0 < (t : ℂ).re) 0 (0 : ℂ) apply ((hg.const_mul ((t : ℂ)^(s-1)*Complex.exp (-t))).norm).mono' · unfold gaussianMixture change AEStronglyMeasurable (fun z : ℂ => (t : ℂ)^(s-1)*Complex.exp (-t)* Complex.exp (-(t : ℂ)*‖z‖^2) * Complex.exp (2*Real.pi*Complex.I*((-freq*z)+starRingEnd ℂ (-freq*z)))) fun_prop · exact Eventually.of_forall fun z => by simp only [gaussianMixture, norm_mul, breveE_norm, mul_one, le_refl] lemma integral_norm_gaussianMixture (s freq : ℂ) (t : ℝ) (ht : 0 < t) : (∫ z : ℂ, ‖gaussianMixture s freq t z‖) = Real.pi * (Real.exp (-t)*t^(s.re-2)) := by simp_rw [norm_gaussianMixture s freq t ht] rw [integral_const_mul, GaussianFourier.integral_rexp_neg_mul_sq_norm ht] norm_num only [Complex.finrank_real_complex, Nat.cast_ofNat, div_self (by norm_num : (2:ℝ)≠0), Real.rpow_one] have hp : t^(s.re-1)/t = t^(s.re-2) := by calc t^(s.re-1)/t = t^(s.re-1)/t^(1:ℝ) := by rw [Real.rpow_one] _ = t^((s.re-1)-1) := (Real.rpow_sub ht _ _).symm _ = _ := by congr 1; ring calc t^(s.re-1)*Real.exp (-t)*(Real.pi/t) = Real.pi*(Real.exp (-t)*(t^(s.re-1)/t)) := by ring _ = _ := by rw [hp] theorem gaussianMixture_integrable (s freq : ℂ) (hs : 1 < s.re) : Integrable (fun p : ℝ × ℂ => gaussianMixture s freq p.1 p.2) ((volume.restrict (Set.Ioi 0)).prod volume) := by have hmeas : AEStronglyMeasurable (fun p : ℝ × ℂ => gaussianMixture s freq p.1 p.2) ((volume.restrict (Set.Ioi 0)).prod volume) := by unfold gaussianMixture change AEStronglyMeasurable (fun p : ℝ × ℂ => (p.1 : ℂ)^(s-1)*Complex.exp (-p.1)*Complex.exp (-(p.1 : ℂ)*‖p.2‖^2)* Complex.exp (2*Real.pi*Complex.I*((-freq*p.2)+starRingEnd ℂ (-freq*p.2)))) _ fun_prop apply (integrable_prod_iff hmeas).mpr constructor · filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht exact gaussianMixture_slice_integrable s freq t ht · have hgamma := (Real.GammaIntegral_convergent (by linarith : 0 < s.re-1)).const_mul Real.pi apply hgamma.congr filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht rw [integral_norm_gaussianMixture s freq t ht] congr 2 ring_nf open MeasureTheory Set Filter open scoped BigOperators Classical FourierTransform RealInnerProductSpace lemma gaussianMixture_laplace_form (s freq : ℂ) (t : ℝ) (z : ℂ) : gaussianMixture s freq t z = ((t : ℂ)^(s-1) * Complex.exp (-((1+‖z‖^2 : ℝ) : ℂ)*t)) * ShortDraftTrace.breveE (-freq*z) := by have he : Complex.exp (-(t : ℂ))*Complex.exp (-(t : ℂ)*‖z‖^2) = Complex.exp (-((1+‖z‖^2 : ℝ) : ℂ)*t) := by rw [← Complex.exp_add] congr 1 push_cast ring calc _ = (t : ℂ)^(s-1) * (Complex.exp (-(t : ℂ))*Complex.exp (-(t : ℂ)*‖z‖^2)) * ShortDraftTrace.breveE (-freq*z) := by unfold gaussianMixture; ring _ = _ := by rw [he] lemma integral_gaussianMixture_t (s freq : ℂ) (hs : 0 < s.re) (z : ℂ) : (∫ t : ℝ in Set.Ioi 0, gaussianMixture s freq t z) = (hyperbolicKernel s z * Complex.Gamma s)*ShortDraftTrace.breveE (-freq*z) := by simp_rw [gaussianMixture_laplace_form] rw [integral_mul_const, ← hyperbolicKernel_laplace s hs z] lemma integral_gaussianMixture_z (s freq : ℂ) (t : ℝ) (ht : 0 < t) : (∫ z : ℂ, gaussianMixture s freq t z) = (Real.pi : ℂ) * ((t : ℂ)^(s-2) * Complex.exp (-(t : ℂ) - (4*Real.pi^2*‖freq‖^2 : ℝ)/t)) := by have hfac : (fun z : ℂ => gaussianMixture s freq t z) = (fun z : ℂ => ((t : ℂ)^(s-1)*Complex.exp (-t))* (Complex.exp (-(t : ℂ)*‖z‖^2)*ShortDraftTrace.breveE (-freq*z))) := by funext z unfold gaussianMixture ring rw [hfac, integral_const_mul, traceIntegral_eq_fourier, source_gaussian_fourier t ht freq] have hp : (t : ℂ)^(s-1)/(t : ℂ) = (t : ℂ)^(s-2) := by calc _ = (t : ℂ)^(s-1)/(t : ℂ)^(1 : ℂ) := by rw [Complex.cpow_one] _ = (t : ℂ)^((s-1)-1) := (Complex.cpow_sub _ _ (Complex.ofReal_ne_zero.mpr ht.ne')).symm _ = _ := by congr 1; ring calc _ = (Real.pi : ℂ)*(((t : ℂ)^(s-1)/t)* (Complex.exp (-(t : ℂ))*Complex.exp (-(4*Real.pi^2*‖freq‖^2 : ℝ)/t))) := by ring _ = _ := by rw [hp, ← Complex.exp_add]; congr 2; ring_nf theorem sourceFourierKernel_gamma (s freq : ℂ) (hs : 1 < s.re) : sourceFourierKernel s freq * Complex.Gamma s = (Real.pi : ℂ) * ∫ t : ℝ in Set.Ioi 0, (t : ℂ)^(s-2) * Complex.exp (-(t : ℂ) - (4*Real.pi^2*‖freq‖^2 : ℝ)/t) := by have hmix := gaussianMixture_integrable s freq hs calc _ = ∫ z : ℂ, (hyperbolicKernel s z * Complex.Gamma s)* ShortDraftTrace.breveE (-freq*z) := by rw [sourceFourierKernel, ← integral_mul_const] apply integral_congr_ae exact Eventually.of_forall fun z => by ring _ = ∫ z : ℂ, ∫ t : ℝ in Set.Ioi 0, gaussianMixture s freq t z := by apply integral_congr_ae exact Eventually.of_forall fun z => (integral_gaussianMixture_t s freq (by linarith) z).symm _ = ∫ t : ℝ in Set.Ioi 0, ∫ z : ℂ, gaussianMixture s freq t z := (integral_integral_swap hmix).symm _ = _ := by rw [← integral_const_mul] apply setIntegral_congr_fun measurableSet_Ioi intro t ht exact integral_gaussianMixture_z s freq t ht def schlafliIntegral (ν : ℂ) (x : ℝ) : ℂ := ∫ t : ℝ in Set.Ioi 0, (t : ℂ)^(ν-1)* Complex.exp (-(t : ℂ) - (x : ℂ)^2/(4*t)) lemma schlafliIntegral_integrable (ν : ℂ) (x : ℝ) (hν : 0 < ν.re) : IntegrableOn (fun t : ℝ => (t : ℂ)^(ν-1)* Complex.exp (-(t : ℂ)-(x : ℂ)^2/(4*t))) (Set.Ioi 0) := by apply (Real.GammaIntegral_convergent hν).mono' · fun_prop · filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht change 0 < t at ht have hre : (-(t : ℂ)-(x : ℂ)^2/(4*t)).re = -t-x^2/(4*t) := by rw [show -(t : ℂ)-(x : ℂ)^2/(4*t) = ((-t-x^2/(4*t) : ℝ) : ℂ) by push_cast; rfl] rfl rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos ht, Complex.norm_exp, hre] simp only [Complex.sub_re, Complex.one_re] have he := Real.exp_le_exp.mpr (show -t-x^2/(4*t) ≤ -t by linarith [div_nonneg (sq_nonneg x) (show 0 ≤ 4*t by positivity)]) have hb := mul_le_mul_of_nonneg_left he (Real.rpow_nonneg ht.le (ν.re-1)) simpa only [mul_comm] using hb def schlafliBesselK (ν : ℂ) (x : ℝ) : ℂ := (1/2 : ℂ)*(x/2 : ℂ)^(-ν)*schlafliIntegral ν x lemma sourceFourierKernel_gamma_schlafli (s freq : ℂ) (hs : 1 < s.re) : sourceFourierKernel s freq * Complex.Gamma s = (Real.pi : ℂ)*schlafliIntegral (s-1) (4*Real.pi*‖freq‖) := by rw [sourceFourierKernel_gamma s freq hs] congr 1 apply setIntegral_congr_fun measurableSet_Ioi intro t ht rw [show s-2=(s-1)-1 by ring] apply congrArg (fun w : ℂ => (t : ℂ)^((s-1)-1)*Complex.exp w) push_cast ring theorem sourceFourierKernel_bessel (s freq : ℂ) (hs : 1 < s.re) (hf : freq ≠ 0) : sourceFourierKernel s freq = (2*Real.pi : ℂ)/Complex.Gamma s * (2*Real.pi*‖freq‖ : ℂ)^(s-1) * schlafliBesselK (s-1) (4*Real.pi*‖freq‖) := by have hg := Complex.Gamma_ne_zero_of_re_pos (show 0 < s.re by linarith) have hz : (2*Real.pi*‖freq‖ : ℂ) ≠ 0 := by exact mul_ne_zero (mul_ne_zero (by norm_num) (Complex.ofReal_ne_zero.mpr Real.pi_ne_zero)) (Complex.ofReal_ne_zero.mpr (norm_ne_zero_iff.mpr hf)) have hp : (2*Real.pi*‖freq‖ : ℂ)^(s-1) * (2*Real.pi*‖freq‖ : ℂ)^(-(s-1)) = 1 := by rw [← Complex.cpow_add _ _ hz, add_neg_cancel, Complex.cpow_zero] have hreorder : (2*Real.pi : ℂ)/Complex.Gamma s * (2*Real.pi*‖freq‖ : ℂ)^(s-1) * schlafliBesselK (s-1) (4*Real.pi*‖freq‖) = ((2*Real.pi : ℂ)*(2*Real.pi*‖freq‖ : ℂ)^(s-1)* schlafliBesselK (s-1) (4*Real.pi*‖freq‖))/Complex.Gamma s := by ring rw [hreorder] apply (eq_div_iff hg).mpr rw [sourceFourierKernel_gamma_schlafli s freq hs] unfold schlafliBesselK push_cast have hhalf : (4*(Real.pi : ℂ)*‖freq‖)/2 = 2*Real.pi*‖freq‖ := by ring rw [hhalf] linear_combination -((Real.pi : ℂ)*schlafliIntegral (s-1) (4*Real.pi*‖freq‖))*hp theorem sourceFourierKernel_four_thirds (freq : ℂ) (hf : freq ≠ 0) : sourceFourierKernel (4/3 : ℂ) freq = (2*Real.pi : ℂ)/Complex.Gamma (4/3) * (2*Real.pi*‖freq‖ : ℂ)^(1/3 : ℂ) * schlafliBesselK (1/3) (4*Real.pi*‖freq‖) := by convert sourceFourierKernel_bessel (4/3) freq (by norm_num) hf using 1 ; norm_num end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.RowMajorants namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (actualFirstKernel originalLabelColumn cubeActiveSupport dilationLabel) open ConcreteTraceCRT (eisEmbedding) end section open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter) theorem exists_rowMajorant : ∃ W : 𝓢(ℝ, ℂ), (∀ s : ℝ, 0 ≤ (W s).re) ∧ (∀ s : ℝ, |s| ≤ 1 → W s = 1) ∧ (∀ s : ℝ, 2 < s → W s = 0) := by obtain ⟨U, hUc, hUs, hUone, hUts, hUzero⟩ := FourierBridge.exists_complex_smooth_cutoff 1 (by norm_num) let f : ℝ → ℂ := fun s => U s * star (U s) have hfc : HasCompactSupport f := hUc.mul_right have hfs : ContDiff ℝ ∞ f := hUs.mul (Complex.conjCLE.contDiff.comp hUs) refine ⟨hfc.toSchwartzMap hfs, ?_, ?_, ?_⟩ · intro s change 0 ≤ (U s * star (U s)).re simp only [Complex.mul_re, Complex.star_def, Complex.conj_re, Complex.conj_im] nlinarith [sq_nonneg (U s).re, sq_nonneg (U s).im] · intro s hs change U s * star (U s) = 1 rw [hUone s hs] norm_num · intro s hs change U s * star (U s) = 0 have hUz : U s = 0 := by by_contra hne have hu := hUts (subset_tsupport U (by exact hne)) norm_num at hu linarith [hu.2] simp [hUz] def rowMajorant : 𝓢(ℝ, ℂ) := Classical.choose exists_rowMajorant lemma rowMajorant_nonneg (s : ℝ) : 0 ≤ (rowMajorant s).re := (Classical.choose_spec exists_rowMajorant).1 s lemma rowMajorant_one (s : ℝ) (hs : |s| ≤ 1) : rowMajorant s = 1 := (Classical.choose_spec exists_rowMajorant).2.1 s hs lemma rowMajorant_zero (s : ℝ) (hs : 2 < s) : rowMajorant s = 0 := (Classical.choose_spec exists_rowMajorant).2.2 s hs def rowMajorantBall (Y : ℝ) : Finset O := ShortDraftLatticeCount.rowNormBall (Nat.ceil (2 * Y)) lemma rowMajorant_zero_outside (Y : ℝ) (hY : 0 < Y) (z : O) (hz : z ∉ rowMajorantBall Y) : rowMajorant (‖eisEmbedding z‖ ^ 2 / Y) = 0 := by have hn : Nat.ceil (2 * Y) < Ideal.absNorm (Ideal.span {z}) := by apply Nat.lt_of_not_ge intro hn exact hz (ShortDraftLatticeCount.mem_rowNormBall_of_absNorm_le _ z hn) have hn' : (Nat.ceil (2 * Y) : ℝ) < (Ideal.absNorm (Ideal.span {z}) : ℝ) := by exact_mod_cast hn apply rowMajorant_zero rw [eisEmbedding_norm_sq_eq_absNorm_span] apply (lt_div_iff₀ hY).2 linarith [Nat.le_ceil (2 * Y)] lemma rowMajorant_summable (P : O → ℂ) (Y : ℝ) (hY : 0 < Y) : Summable (fun z : O => rowMajorant (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖P z‖ ^ 2) : ℂ)) := by apply (hasSum_sum_of_ne_finset_zero (s := rowMajorantBall Y) ?_).summable intro z hz rw [rowMajorant_zero_outside Y hY z hz, zero_mul] variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) end open ActualEisensteinCubic open FirstCauchyArithmetic (supportMobius) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def secondPreKernelPair (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k₁ k₂ : O) (K : Finset ι → Finset ι → ℂ) : ℂ := ∑ S ∈ F.powerset, ∑ T ∈ F.powerset, if Disjoint S T then star (secondPreColumn p hp hcop hg Ψ₁ (m * (e * r)) c d e k₁ (fun _ => 1) S) * secondPreColumn p hp hcop hg Ψ₂ (m * (e * r)) c d e k₂ (fun _ => 1) T * K S T else 0 def secondChildKernelPair (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k₁ k₂ : O) (K : Finset ι → Finset ι → ℂ) : ℂ := ∑ N ∈ (F \ V).powerset, ∑ M ∈ (F \ V).powerset, star (secondChildColumn p hp hcop hg Ψ₁ (m * r) (c * e * ∏ i ∈ V, p i) (d * e * k₁) (fun _ => 1) N) * secondChildColumn p hp hcop hg Ψ₂ (m * r) (c * e * ∏ i ∈ V, p i) (d * e * k₂) (fun _ => 1) M * K (V ∪ N) (V ∪ M) theorem secondPreKernelPair_eq_children (hinj : Function.Injective (fun i => Ideal.span {p i})) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k₁ k₂ : O) (K : Finset ι → Finset ι → ℂ) : secondPreKernelPair p hp hcop hg F Ψ₁ Ψ₂ m r c d e k₁ k₂ K = ∑ V ∈ F.powerset, secondCommonWeight p hp hcop hg Ψ₁ Ψ₂ m r c d e k₁ k₂ V * secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k₁ k₂ K := by have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance unfold secondPreKernelPair rw [CoprimeMobiusExtension.double_sum_disjoint_reindexed] apply Finset.sum_congr rfl intro V hV rw [secondCommonWeight, supportMobius, prime_product_moebius _ hprime hinj] simp only [secondChildKernelPair, Finset.mul_sum] apply Finset.sum_congr rfl intro N hN apply Finset.sum_congr rfl intro M hM have hdN : Disjoint V N := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hN) disjoint_sdiff_self_right have hdM : Disjoint V M := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hM) disjoint_sdiff_self_right rw [secondPreColumn_union p hp hcop hg hpr Ψ₁ m r c d e k₁ (fun _ => 1) V N hdN, secondPreColumn_union p hp hcop hg hpr Ψ₂ m r c d e k₂ (fun _ => 1) V M hdM, star_mul] ring def secondKernelPair (hinj : Function.Injective (fun i => Ideal.span {p i})) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (K : Finset ι → Finset ι → ℂ) : ℂ := ∑ S ∈ F.powerset, ∑ T ∈ F.powerset, if Disjoint S T then secondGaussTerm p hp hg hinj Ψ₁ Ψ₂ m r c d e k (fun _ => 1) (fun _ => 1) S T * K S T else 0 theorem secondKernelPair_eq_pre (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (K : Finset ι → Finset ι → ℂ) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype secondKernelPair p hp hg hinj F Ψ₁ Ψ₂ m r c d e k K = ∑ z : SecondRayIndex, secondRayCoefficient z * secondPreKernelPair p hp hcop hg F (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m r c d e k (-k) K := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype have hterm (S T : Finset ι) : (if Disjoint S T then secondGaussTerm p hp hg hinj Ψ₁ Ψ₂ m r c d e k (fun _ => 1) (fun _ => 1) S T * K S T else 0) = ∑ z : SecondRayIndex, secondRayCoefficient z * (if Disjoint S T then star (secondPreColumn p hp hcop hg (secondRayMinus Ψ₁ z) (m * (e * r)) c d e k (fun _ => 1) S) * secondPreColumn p hp hcop hg (secondRayPlus Ψ₂ z) (m * (e * r)) c d e (-k) (fun _ => 1) T * K S T else 0) := by by_cases hd : Disjoint S T · simp only [ite_eq_left hd, secondGaussTerm] have h := congrArg (fun a : ℂ => a * K S T) (second_gauss_ray_expansion p hp hcop hg hinj hc hpr Ψ₁ Ψ₂ (m * (e * r)) c d e k (fun _ => 1) (fun _ => 1) S T hd) simpa only [Fintype.sum_prod_type, secondRayCoefficient, secondRayMinus, secondRayPlus, Finset.sum_mul, mul_assoc] using h · simp [hd] unfold secondKernelPair simp_rw [hterm] calc _ = ∑ S ∈ F.powerset, ∑ z : SecondRayIndex, ∑ T ∈ F.powerset, secondRayCoefficient z * (if Disjoint S T then star (secondPreColumn p hp hcop hg (secondRayMinus Ψ₁ z) (m * (e * r)) c d e k (fun _ => 1) S) * secondPreColumn p hp hcop hg (secondRayPlus Ψ₂ z) (m * (e * r)) c d e (-k) (fun _ => 1) T * K S T else 0) := by apply Finset.sum_congr rfl intro S hS exact Finset.sum_comm _ = _ := by rw [Finset.sum_comm] simp only [secondPreKernelPair, Finset.mul_sum] theorem secondKernelPair_eq_children (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (K : Finset ι → Finset ι → ℂ) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype secondKernelPair p hp hg hinj F Ψ₁ Ψ₂ m r c d e k K = ∑ z : SecondRayIndex, ∑ V ∈ F.powerset, secondTotalWeight p hp hcop hg Ψ₁ Ψ₂ m r c d e k (z,V) * secondChildKernelPair p hp hcop hg F V (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m r c d e k (-k) K := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype rw [secondKernelPair_eq_pre p hp hcop hg hinj hc hpr] simp only [secondPreKernelPair_eq_children p hp hcop hg hinj hpr, secondTotalWeight, Finset.mul_sum, mul_assoc] end SecondPassArithmetic namespace CubicEisenstein open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic CubicKubota ConcreteTraceCRT CubicJacobiGlobal def denominatorCondition (c d : O) : Prop := IsCoprime c d ∧ (3 : O) ∣ d-1 abbrev AdmissibleDenominator (c : O) := {d : O // denominatorCondition c d} abbrev LevelLower := {c : O // (3 : O) ∣ c} lemma denominatorCondition_shift (c d n : O) : denominatorCondition c (d+3*c*n) ↔ denominatorCondition c d := by constructor · rintro ⟨⟨a,b,h⟩,hd⟩ refine ⟨⟨a+b*3*n,b,by linear_combination h⟩, ?_⟩ have h3 : (3 : O) ∣ 3*c*n := ⟨c*n,by ring⟩ convert dvd_sub hd h3 using 1 ; ring · rintro ⟨⟨a,b,h⟩,hd⟩ refine ⟨⟨a-b*3*n,b,by linear_combination h⟩, ?_⟩ have h3 : (3 : O) ∣ 3*c*n := ⟨c*n,by ring⟩ convert dvd_add hd h3 using 1 ; ring lemma row_symbol_shift (c d n : O) (hc : (3 : O) ∣ c) (hd : (3 : O) ∣ d-1) : symbol c (d+3*c*n)=symbol c d := by have hdn : (3 : O) ∣ d+3*c*n-1 := by convert dvd_add hd (show (3 : O) ∣ 3*c*n from ⟨c*n,by ring⟩) using 1 ; ring have h9 : (9 : O) ∣ d+3*c*n-d := by obtain ⟨c0,rfl⟩ := hc exact ⟨c0*n,by ring⟩ exact symbol_denominator_congr c (d+3*c*n) d (lambda_sq_dvd_three.trans hdn) (lambda_sq_dvd_three.trans hd) h9 ⟨3*n,by ring⟩ def primitiveSigmaEquiv : PrimitiveRow ≃ Σ c : LevelLower, AdmissibleDenominator c.1 where toFun r := ⟨⟨r.1 0,r.2.2.1⟩,⟨r.1 1,r.2.1,r.2.2.2⟩⟩ invFun p := ⟨![p.1.1,p.2.1],p.2.2.1,p.1.2,p.2.2.2⟩ left_inv r := by apply Subtype.ext funext i fin_cases i <;> rfl right_inv p := by rfl abbrev DenominatorResidue (c : O) := O ⧸ Ideal.span {3*c} def denominatorRep (c : O) (r : DenominatorResidue c) : O := GaussianShiftedPartition.representative (3*c) r lemma denominatorRep_spec (c : O) (r : DenominatorResidue c) : Ideal.Quotient.mk (Ideal.span {3*c}) (denominatorRep c r)=r := GaussianShiftedPartition.representative_spec (3*c) r abbrev AdmissibleResidue (c : O) := {r : DenominatorResidue c // denominatorCondition c (denominatorRep c r)} lemma finite_admissibleResidue (c : O) (hc : c ≠ 0) : Finite (AdmissibleResidue c) := by let : Finite (DenominatorResidue c) := finite_quotient_span (mul_ne_zero (by norm_num) hc) infer_instance def residueDenominatorMap (c : O) (p : AdmissibleResidue c × O) : AdmissibleDenominator c := ⟨denominatorRep c p.1.1+3*c*p.2,(denominatorCondition_shift c _ _).2 p.1.2⟩ lemma residueDenominatorMap_bijective (c : O) (hc : c ≠ 0) : Function.Bijective (residueDenominatorMap c) := by have h3c : 3*c ≠ 0 := mul_ne_zero (by norm_num) hc have hq (r : DenominatorResidue c) (n : O) : Ideal.Quotient.mk (Ideal.span {3*c}) (denominatorRep c r+3*c*n)=r := by have hzero : Ideal.Quotient.mk (Ideal.span {3*c}) (3*c)=0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.subset_span (by simp)) rw [map_add, map_mul, hzero, zero_mul, add_zero, denominatorRep_spec] constructor · rintro ⟨r,n⟩ ⟨t,m⟩ heq have h := congrArg Subtype.val heq change denominatorRep c r.1+3*c*n=denominatorRep c t.1+3*c*m at h have hrt : r=t := by apply Subtype.ext simpa only [hq] using congrArg (Ideal.Quotient.mk (Ideal.span {3*c})) h subst t have hnm : n=m := mul_left_cancel₀ h3c (add_left_cancel h) subst m rfl · intro d let r : DenominatorResidue c := Ideal.Quotient.mk (Ideal.span {3*c}) d.1 have hr : Ideal.Quotient.mk (Ideal.span {3*c}) (denominatorRep c r)=r := denominatorRep_spec c r have hdiv : 3*c ∣ d.1-denominatorRep c r := by apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp exact hr.symm obtain ⟨n,hn⟩ := hdiv have hd : d.1=denominatorRep c r+3*c*n := by linear_combination hn have hrcond : denominatorCondition c (denominatorRep c r) := by apply (denominatorCondition_shift c _ n).1 rw [← hd] exact d.2 refine ⟨(⟨r,hrcond⟩,n), ?_⟩ apply Subtype.ext exact hd.symm def residueDenominatorEquiv (c : O) (hc : c ≠ 0) : AdmissibleResidue c × O ≃ AdmissibleDenominator c := Equiv.ofBijective (residueDenominatorMap c) (residueDenominatorMap_bijective c hc) def primitiveTerm (z : ℂ) (v : ℝ) (s : ℂ) (c d : O) : ℂ := eisEmbedding (symbol c d) * ((v/(‖eisEmbedding c*z+eisEmbedding d‖^2+‖eisEmbedding c‖^2*v^2):ℝ):ℂ)^s theorem denominator_sum_residues (c : O) (hc : c ≠ 0) (f : O → ℂ) (hf : Summable (fun d : AdmissibleDenominator c => f d.1)) : (∑' d : AdmissibleDenominator c, f d.1)= ∑' r : AdmissibleResidue c, ∑' n : O, f (denominatorRep c r.1+3*c*n) := by have hsum := (residueDenominatorEquiv c hc).summable_iff.mpr hf exact ((residueDenominatorEquiv c hc).tsum_eq (fun d : AdmissibleDenominator c => f d.1)).symm.trans hsum.tsum_prod lemma primitiveTerm_shift (z : ℂ) (v : ℝ) (s : ℂ) (c d n : O) (hc : (3 : O) ∣ c) (hd : (3 : O) ∣ d-1) : primitiveTerm z v s c (d+3*c*n)= primitiveTerm (z+3*eisEmbedding n) v s c d := by unfold primitiveTerm rw [row_symbol_shift c d n hc hd] have harg : eisEmbedding c*z+eisEmbedding (d+3*c*n)= eisEmbedding c*(z+3*eisEmbedding n)+eisEmbedding d := by simp only [map_add,map_mul,map_ofNat] ring rw [harg] lemma denominator_zero_unique (d : AdmissibleDenominator 0) : d.1=1 := by apply A3_primary_unit_eq_one _ _ (lambda_sq_dvd_three.trans d.2.2) simpa only [isCoprime_zero_left] using d.2.1 end CubicEisenstein open MeasureTheory Set Module open scoped BigOperators Classical ENNReal namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT EisensteinEmbedding EisensteinSchwartzPoisson namespace CurrentNotationRowMajorants01 abbrev O := ActualEisensteinCubic.O end CurrentNotationRowMajorants01 open CurrentNotationRowMajorants01 (O) def periodBasis : Basis (Fin 2) ℝ ℂ := Complex.basisOneI.map (eisensteinLatticeMap 3 (by norm_num)).toLinearEquiv lemma periodBasis_zero : periodBasis 0=3 := by simp [periodBasis,eisensteinLatticeMap,scaledBasisEquiv_apply] lemma periodBasis_one : periodBasis 1=3*omega3 := by simp [periodBasis,eisensteinLatticeMap,scaledBasisEquiv_apply] def periodLattice : Submodule ℤ ℂ := Submodule.span ℤ (Set.range periodBasis) def periodDomain : Set ℂ := ZSpan.fundamentalDomain periodBasis abbrev instCountableSubtypeComplexMemSubmoduleIntPeriodLattice : Countable periodLattice := by unfold periodLattice infer_instance abbrev instVAddInvariantMeasureSubtypeComplexMemSubmoduleIntPeriodLatticeVolume : VAddInvariantMeasure periodLattice ℂ volume := inferInstanceAs (VAddInvariantMeasure periodLattice.toAddSubgroup ℂ volume) lemma periodDomain_fundamental : IsAddFundamentalDomain periodLattice periodDomain volume := ZSpan.isAddFundamentalDomain periodBasis volume lemma periodDomain_measurable : MeasurableSet periodDomain := ZSpan.fundamentalDomain_measurableSet periodBasis lemma three_embedding_mem (n : O) : 3*eisEmbedding n ∈ periodLattice := by have hzero : periodBasis 0 ∈ periodLattice := Submodule.subset_span ⟨0,rfl⟩ have hone : periodBasis 1 ∈ periodLattice := Submodule.subset_span ⟨1,rfl⟩ have h := periodLattice.add_mem (periodLattice.smul_mem (ActualEisensteinCoordinates.coords n).1 hzero) (periodLattice.smul_mem (ActualEisensteinCoordinates.coords n).2 hone) rw [periodBasis_zero,periodBasis_one] at h convert h using 1 conv_lhs => rw [← ActualEisensteinCoordinates.eval_coords n,eisEmbedding_eval] simp only [zsmul_eq_mul,] ring def periodPoint (n : O) : periodLattice := ⟨3*eisEmbedding n,three_embedding_mem n⟩ lemma periodPoint_bijective : Function.Bijective periodPoint := by constructor · intro n m h apply eisEmbedding_injective exact mul_left_cancel₀ (by norm_num : (3:ℂ)≠0) (congrArg Subtype.val h) · intro p have h := (periodBasis.mem_span_iff_repr_mem ℤ p.1).mp p.2 obtain ⟨a,ha⟩ := h 0 obtain ⟨b,hb⟩ := h 1 change (a:ℝ)=_ at ha change (b:ℝ)=_ at hb refine ⟨ActualEisensteinCoordinates.eval a b, ?_⟩ apply Subtype.ext change 3*eisEmbedding (ActualEisensteinCoordinates.eval a b)=p.1 rw [← periodBasis.sum_repr p.1,Fin.sum_univ_two,← ha,← hb, periodBasis_zero,periodBasis_one,eisEmbedding_eval] simp only [Complex.real_smul,Complex.ofReal_intCast] ring def periodEquiv : O ≃ periodLattice := Equiv.ofBijective _ periodPoint_bijective theorem integral_eq_period_integrals (f : ℂ → ℂ) (hf : Integrable f) : (∫ z : ℂ, f z)=∑' n : O,∫ z in periodDomain,f (z+3*eisEmbedding n) := by let : Countable periodLattice := instCountableSubtypeComplexMemSubmoduleIntPeriodLattice let : VAddInvariantMeasure periodLattice ℂ volume := instVAddInvariantMeasureSubtypeComplexMemSubmoduleIntPeriodLatticeVolume rw [periodDomain_fundamental.integral_eq_tsum'' f hf] rw [← periodEquiv.tsum_eq] apply tsum_congr intro n apply setIntegral_congr_fun periodDomain_measurable intro z hz change f (3*eisEmbedding n+z)=f (z+3*eisEmbedding n) rw [add_comm] theorem lintegral_eq_period_lintegrals (f : ℂ → ℝ≥0∞) : (∫⁻ z : ℂ, f z)=∑' n : O,∫⁻ z in periodDomain,f (z+3*eisEmbedding n) := by let : Countable periodLattice := instCountableSubtypeComplexMemSubmoduleIntPeriodLattice let : VAddInvariantMeasure periodLattice ℂ volume := instVAddInvariantMeasureSubtypeComplexMemSubmoduleIntPeriodLatticeVolume rw [periodDomain_fundamental.lintegral_eq_tsum'' f] rw [← periodEquiv.tsum_eq] apply tsum_congr intro n apply setLIntegral_congr_fun periodDomain_measurable intro z hz change f (3*eisEmbedding n+z)=f (z+3*eisEmbedding n) rw [add_comm] lemma periodDomain_volume : volume periodDomain=ENNReal.ofReal (9*Real.sqrt 3/2) := by have hunit : volume (ZSpan.fundamentalDomain Complex.basisOneI)=1 := by rw [measure_congr (ZSpan.fundamentalDomain_ae_parallelepiped Complex.basisOneI volume)] exact Complex.orthonormalBasisOneI.volume_parallelepiped rw [periodDomain,ZSpan.measure_fundamentalDomain periodBasis volume Complex.basisOneI,hunit,mul_one] congr 1 rw [Basis.det_apply,Matrix.det_fin_two] norm_num [Basis.toMatrix_apply,periodBasis_zero,periodBasis_one, Complex.coe_basisOneI_repr,EisensteinEmbedding.omega3_im] rw [abs_of_nonneg (by positivity)] ring end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.FourierCoefficients namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators section open MeasureTheory Set Filter open scoped BigOperators Classical ENNReal open ActualEisensteinCubic ConcreteTraceCRT lemma breveE_embedding_div_traceLambda (n : O) : ShortDraftTrace.breveE (eisEmbedding n/eisLam)=1 := by rw [← ActualEisensteinCoordinates.eval_coords n,eisEmbedding_eval] exact ConcreteBreveE.breveE_period_coordinates _ _ def cuspFrequency (h : O) : ℂ := eisEmbedding h/(3*eisLam) lemma cuspFrequency_period (h n : O) : ShortDraftTrace.breveE (cuspFrequency h*(3*eisEmbedding n))=1 := by have heq : cuspFrequency h*(3*eisEmbedding n)=eisEmbedding (h*n)/eisLam := by rw [cuspFrequency,map_mul] field_simp rw [heq] exact breveE_embedding_div_traceLambda (h*n) lemma cuspFrequency_negative_period (h n : O) (z : ℂ) : ShortDraftTrace.breveE (-cuspFrequency h*(z+3*eisEmbedding n))= ShortDraftTrace.breveE (-cuspFrequency h*z) := by rw [mul_add,AddChar.map_add_eq_mul] have hp : ShortDraftTrace.breveE (-cuspFrequency h*(3*eisEmbedding n))=1 := by rw [neg_mul,AddChar.map_neg_eq_inv,cuspFrequency_period,inv_one] rw [hp,mul_one] lemma trace_mul_integrable (f : ℂ → ℂ) (hf : Integrable f) (freq : ℂ) : Integrable (fun z => f z*ShortDraftTrace.breveE (-freq*z)) := by have hchar : Continuous (fun z : ℂ => ShortDraftTrace.breveE (-freq*z)) := by change Continuous (fun z : ℂ => Complex.exp (2*Real.pi*Complex.I* ((-freq*z)+starRingEnd ℂ (-freq*z)))) fun_prop refine hf.norm.mono' (hf.aestronglyMeasurable.mul hchar.aestronglyMeasurable) ?_ exact Eventually.of_forall fun z => by simp only [norm_mul,breveE_norm,mul_one,le_refl] end section open MeasureTheory Set Filter Module open scoped BigOperators Classical ENNReal MatrixGroups Matrix open ActualEisensteinCubic ConcreteTraceCRT lemma continuous_inverse_upper_operator (v : ℝ) (hv : 0 < v) : Continuous (fun z : ℂ => rowOperator (upperSection z v hv)⁻¹) := by apply continuous_clm_apply.mpr intro u apply continuous_pi intro i simp only [rowOperator_apply,upperSection, Matrix.vecMul,dotProduct,Fin.sum_univ_two] fin_cases i <;> simp only [] <;> fun_prop lemma continuous_upper_rowBound (v : ℝ) (hv : 0 < v) : Continuous (fun z : ℂ => rowBound (upperSection z v hv)) := continuous_const.mul (continuous_const.add (continuous_inverse_upper_operator v hv).norm) lemma norm_mem_periodDomain (z : ℂ) (hz : z ∈ periodDomain) : ‖z‖ ≤ ∑ i : Fin 2, ‖periodBasis i‖ := by have heq := (ZSpan.fract_eq_self (b := periodBasis)).mpr hz simpa only [heq] using ZSpan.norm_fract_le periodBasis z lemma exists_upper_rowBound (v : ℝ) (hv : 0 < v) : ∃ C : ℝ, 0 < C ∧ ∀ z ∈ periodDomain, rowBound (upperSection z v hv) ≤ C := by let R : ℝ := ∑ i : Fin 2, ‖periodBasis i‖ obtain ⟨C,hC⟩ := (isCompact_closedBall (0:ℂ) R).bddAbove_image (continuous_upper_rowBound v hv).continuousOn refine ⟨max 1 C,lt_of_lt_of_le (by norm_num) (le_max_left _ _),?_⟩ intro z hz apply (hC ?_).trans (le_max_right _ _) exact ⟨z,by simpa only [Metric.mem_closedBall,dist_zero_right] using norm_mem_periodDomain z hz,rfl⟩ lemma continuous_upper_summand (v : ℝ) (hv : 0 < v) (s : ℂ) (x : CuspCosets) : Continuous (fun z : ℂ => summand (upperSection z v hv) s x) := by simp_rw [summand_upperSection] apply continuous_const.mul apply Continuous.cpow · apply Complex.continuous_ofReal.comp apply continuous_const.div · unfold heightDenominator fun_prop · intro z exact (heightDenominator_pos z v hv _ (embeddedRow_ne_zero x)).ne' · exact continuous_const · intro z apply Complex.ofReal_mem_slitPlane.mpr exact div_pos hv (heightDenominator_pos z v hv _ (embeddedRow_ne_zero x)) lemma upper_summable_majorant (v : ℝ) (hv : 0 < v) (s : ℂ) (hs : 2 < s.re) : ∃ M : CuspCosets → ℝ, Summable M ∧ (∀ x,0 ≤ M x) ∧ ∀ z ∈ periodDomain, ∀ x, ‖summand (upperSection z v hv) s x‖ ≤ M x := by obtain ⟨C,hC,hbound⟩ := exists_upper_rowBound v hv refine ⟨fun x => C^(2*s.re)*‖rowCoordinates (cosetRow x)‖^(-(2*s.re)),?_,?_,?_⟩ · have hsumm := summable_integer_four_rpow (2*s.re) (by linarith) have hinj : Function.Injective (fun x : CuspCosets => rowCoordinates (cosetRow x)) := rowCoordinates_injective.comp cosetRow_injective exact (hsumm.comp_injective hinj).mul_left _ · intro x positivity · intro z hz x apply (norm_summand_bound (upperSection z v hv) s (by linarith) x).trans exact mul_le_mul_of_nonneg_right (Real.rpow_le_rpow (rowBound_pos _).le (hbound z hz) (by linarith)) (by positivity) lemma periodDomain_finiteMeasure : IsFiniteMeasure (volume.restrict periodDomain) := by constructor rw [Measure.restrict_apply_univ,periodDomain_volume] exact ENNReal.ofReal_lt_top theorem hasSum_integral_upperEisenstein (v : ℝ) (hv : 0 < v) (s freq : ℂ) (hs : 2 < s.re) : HasSum (fun x : CuspCosets => ∫ z in periodDomain, summand (upperSection z v hv) s x*ShortDraftTrace.breveE (-freq*z)) (∫ z in periodDomain,upperEisenstein z v hv s*ShortDraftTrace.breveE (-freq*z)) := by let : Countable CuspCosets := (rowCoordinates_injective.comp cosetRow_injective).countable let := periodDomain_finiteMeasure obtain ⟨M,hM,hMnonneg,hbound⟩ := upper_summable_majorant v hv s hs have hchar : Continuous (fun z : ℂ => ShortDraftTrace.breveE (-freq*z)) := by change Continuous (fun z : ℂ => Complex.exp (2*Real.pi*Complex.I* ((-freq*z)+starRingEnd ℂ (-freq*z)))) fun_prop have hsum := hasSum_integral_of_dominated_convergence («μ» := volume.restrict periodDomain) (fun (x : CuspCosets) (_ : ℂ) => M x) (fun x => ((continuous_upper_summand v hv s x).mul hchar).aestronglyMeasurable.restrict) (fun x => (ae_restrict_mem periodDomain_measurable).mono fun z hz => by simpa only [Pi.mul_apply,norm_mul,breveE_norm,mul_one] using hbound z hz x) (Eventually.of_forall fun _ => hM) (integrable_const (∑' x,M x)) (Eventually.of_forall fun z => (summable_summand (upperSection z v hv) s hs).hasSum.mul_right (ShortDraftTrace.breveE (-freq*z))) exact hsum end section open MeasureTheory Set Filter open scoped BigOperators Classical open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal def shiftedHeightKernel (v : ℝ) (s b z : ℂ) : ℂ := (v:ℂ)^(-s)*hyperbolicKernel s ((z+b)/(v:ℂ)) lemma shiftedHeightKernel_integrable (v : ℝ) (hv : 0 < v) (s b : ℂ) (hs : 1 < s.re) : Integrable (shiftedHeightKernel v s b) := by have h := ((hyperbolicKernel_integrable s hs).comp_smul (inv_ne_zero hv.ne')).comp_add_right b apply (h.const_mul ((v:ℂ)^(-s))).congr exact Eventually.of_forall fun z => by simp only [shiftedHeightKernel,Complex.real_smul,Complex.ofReal_inv,div_eq_mul_inv,mul_comm] lemma primitiveTerm_eq_shiftedHeightKernel (z : ℂ) (v : ℝ) (hv : 0 < v) (s : ℂ) (c d : O) (hc : c ≠ 0) : primitiveTerm z v s c d = (eisEmbedding (symbol c d)*(‖eisEmbedding c‖^2:ℝ) ^ (-s:ℂ))* shiftedHeightKernel v s (eisEmbedding d/eisEmbedding c) z := by have hc' := eisEmbedding_ne_zero hc have hnorm : 0 < ‖eisEmbedding c‖^2 := sq_pos_of_pos (norm_pos_iff.mpr hc') have hfac : eisEmbedding c*z+eisEmbedding d = eisEmbedding c*(z+eisEmbedding d/eisEmbedding c) := by field_simp have heq : v/(‖eisEmbedding c*z+eisEmbedding d‖^2+‖eisEmbedding c‖^2*v^2) = ((‖eisEmbedding c‖^2*v)*(1+‖(z+eisEmbedding d/eisEmbedding c)/(v:ℂ)‖^2))⁻¹ := by rw [hfac,norm_mul,mul_pow,norm_div,Complex.norm_real,Real.norm_of_nonneg hv.le] field_simp ; ring unfold primitiveTerm shiftedHeightKernel hyperbolicKernel rw [heq,Complex.ofReal_inv,Complex.inv_cpow_ofReal_nonneg (by positivity),← Complex.cpow_neg] rw [Complex.ofReal_mul,Complex.mul_cpow_ofReal_nonneg (mul_nonneg hnorm.le hv.le) (by positivity), Complex.ofReal_mul,Complex.mul_cpow_ofReal_nonneg hnorm.le hv.le] ring lemma primitiveTerm_integrable (v : ℝ) (hv : 0 < v) (s : ℂ) (hs : 1 < s.re) (c d : O) (hc : c ≠ 0) : Integrable (fun z => primitiveTerm z v s c d) := by simp_rw [primitiveTerm_eq_shiftedHeightKernel _ v hv s c d hc] exact (shiftedHeightKernel_integrable v hv s _ hs).const_mul _ lemma traceIntegral_translate (f : ℂ → ℂ) (b freq : ℂ) : (∫ z : ℂ,f (z+b)*ShortDraftTrace.breveE (-freq*z))= ShortDraftTrace.breveE (freq*b)*(∫ z : ℂ,f z*ShortDraftTrace.breveE (-freq*z)) := by have heq (z : ℂ) : f (z+b)*ShortDraftTrace.breveE (-freq*z)= ShortDraftTrace.breveE (freq*b)*(f (z+b)*ShortDraftTrace.breveE (-freq*(z+b))) := by rw [mul_left_comm (ShortDraftTrace.breveE (freq*b)), ← AddChar.map_add_eq_mul] congr 2 ring simp_rw [heq] rw [integral_const_mul,integral_add_right_eq_self (fun z => f z*ShortDraftTrace.breveE (-freq*z)) b] lemma traceIntegral_scale (v : ℝ) (hv : 0 < v) (s freq : ℂ) : (∫ z : ℂ,hyperbolicKernel s (z/(v:ℂ))*ShortDraftTrace.breveE (-freq*z))= (v:ℂ)^2*sourceFourierKernel s (freq*v) := by have heq (z : ℂ) : hyperbolicKernel s (z/(v:ℂ))*ShortDraftTrace.breveE (-freq*z)= (fun w : ℂ => hyperbolicKernel s w*ShortDraftTrace.breveE (-(freq*v)*w)) (v⁻¹ • z) := by simp only [Complex.real_smul,Complex.ofReal_inv] congr 2 · ring · field_simp [Complex.ofReal_ne_zero.mpr hv.ne'] simp_rw [heq] have h := Measure.integral_comp_inv_smul_of_nonneg (volume : Measure ℂ) (fun w : ℂ => hyperbolicKernel s w*ShortDraftTrace.breveE (-(freq*v)*w)) hv.le simpa only [Complex.finrank_real_complex,Complex.real_smul,Complex.ofReal_pow,sourceFourierKernel] using h lemma traceIntegral_shiftedHeightKernel (v : ℝ) (hv : 0 < v) (s b freq : ℂ) : (∫ z : ℂ,shiftedHeightKernel v s b z*ShortDraftTrace.breveE (-freq*z))= (v:ℂ)^(2-s)*ShortDraftTrace.breveE (freq*b)*sourceFourierKernel s (freq*v) := by simp only [shiftedHeightKernel,mul_assoc] rw [integral_const_mul,traceIntegral_translate (fun z => hyperbolicKernel s (z/(v:ℂ))) b freq, traceIntegral_scale v hv s freq] have hp : (v:ℂ)^(-s)*(v:ℂ)^2=(v:ℂ)^(2-s) := by rw [← Complex.cpow_natCast,← Complex.cpow_add _ _ (Complex.ofReal_ne_zero.mpr hv.ne')] congr 1 ring calc _ = ((v:ℂ)^(-s)*(v:ℂ)^2)*ShortDraftTrace.breveE (freq*b)*sourceFourierKernel s (freq*v) := by ring _ = _ := by rw [hp]; ring end section open MeasureTheory Set Filter open scoped BigOperators Classical ENNReal Pointwise open ActualEisensteinCubic ConcreteTraceCRT lemma period_integral_translation (f : ℂ → ℂ) (hperiod : ∀ (n : O) (z : ℂ), f (z+3*eisEmbedding n)=f z) (b : ℂ) : (∫ z in periodDomain,f (b+z))=∫ z in periodDomain,f z := by let : Countable periodLattice := instCountableSubtypeComplexMemSubmoduleIntPeriodLattice let : VAddInvariantMeasure periodLattice ℂ volume := instVAddInvariantMeasureSubtypeComplexMemSubmoduleIntPeriodLatticeVolume have hperiod' (n : periodLattice) (z : ℂ) : f (n+ᵥz)=f z := by obtain ⟨m,rfl⟩ := periodEquiv.surjective n change f (3*eisEmbedding m+z)=f z simpa only [add_comm] using hperiod m z have hD := periodDomain_fundamental.vadd_of_comm b have heq := periodDomain_fundamental.setIntegral_eq hD hperiod' have hchange := (measurePreserving_add_left volume b).setIntegral_image_emb (measurableEmbedding_const_vadd b) f periodDomain exact hchange.symm.trans heq.symm lemma breveE_quarter_eq_neg_one : ShortDraftTrace.breveE (1/4:ℂ)=-1 := by change Complex.exp (2*Real.pi*Complex.I*((1/4:ℂ)+starRingEnd ℂ (1/4:ℂ)))=-1 norm_num only [map_div₀,map_one,map_ofNat] convert Complex.exp_pi_mul_I using 1 ; congr 1 ; ring lemma cuspFrequency_ne_zero (h : O) (hh : h ≠ 0) : cuspFrequency h ≠ 0 := div_ne_zero (eisEmbedding_ne_zero hh) (mul_ne_zero (by norm_num) eisLam_ne_zero) theorem integral_cusp_character (h : O) : (∫ z in periodDomain,ShortDraftTrace.breveE (-cuspFrequency h*z))= if h=0 then ((9*Real.sqrt 3/2:ℝ):ℂ) else 0 := by by_cases hh : h=0 · subst h simp only [cuspFrequency,map_zero,zero_div,neg_zero,zero_mul, AddChar.map_zero_eq_one,ite_true,setIntegral_const,measureReal_def,periodDomain_volume, ENNReal.toReal_ofReal (by positivity : (0:ℝ) ≤ 9*Real.sqrt 3/2),Complex.real_smul,mul_one] · rw [if_neg hh] let freq := cuspFrequency h let b : ℂ := -(4*freq)⁻¹ have hfreq : freq ≠ 0 := cuspFrequency_ne_zero h hh have harg : -freq*b=(1/4:ℂ) := by dsimp [b]; field_simp have hphase : ShortDraftTrace.breveE (-freq*b)=-1 := by rw [harg,breveE_quarter_eq_neg_one] have heq := period_integral_translation (fun z => ShortDraftTrace.breveE (-freq*z)) (fun n z => cuspFrequency_negative_period h n z) b have hpoint (z : ℂ) : ShortDraftTrace.breveE (-freq*(b+z))= -ShortDraftTrace.breveE (-freq*z) := by rw [mul_add,AddChar.map_add_eq_mul,hphase,neg_one_mul] simp_rw [hpoint,integral_neg] at heq linear_combination (-1/2:ℂ)*heq end section open MeasureTheory Set Filter open scoped BigOperators Classical ENNReal open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal def primitiveRowIntegral (v : ℝ) (s freq : ℂ) (c d : O) : ℂ := ∫ z in periodDomain,primitiveTerm z v s c d*ShortDraftTrace.breveE (-freq*z) lemma integral_summand_eq_primitiveRowIntegral (v : ℝ) (hv : 0 < v) (s freq : ℂ) (x : CuspCosets) : (∫ z in periodDomain,summand (upperSection z v hv) s x*ShortDraftTrace.breveE (-freq*z))= primitiveRowIntegral v s freq (cosetRow x 0) (cosetRow x 1) := by apply integral_congr_ae exact Eventually.of_forall fun z => by dsimp only rw [summand_upperSection,inverse_cosetCharacter_eq_row_symbol] rfl lemma hasSum_primitiveRowIntegrals (v : ℝ) (hv : 0 < v) (s freq : ℂ) (hs : 2 < s.re) : HasSum (fun p : Σ c : LevelLower,AdmissibleDenominator c.1 => primitiveRowIntegral v s freq p.1.1 p.2.1) (∫ z in periodDomain,upperEisenstein z v hv s*ShortDraftTrace.breveE (-freq*z)) := by apply primitiveSigmaEquiv.hasSum_iff.mp apply primitiveRowEquiv.hasSum_iff.mp exact (hasSum_integral_upperEisenstein v hv s freq hs).congr_fun fun x => (integral_summand_eq_primitiveRowIntegral v hv s freq x).symm lemma primitiveRowIntegral_sum_translate (v : ℝ) (hv : 0 < v) (s : ℂ) (hs : 1 < s.re) (h c d : O) (hc : c ≠ 0) (hlevel : (3:O) ∣ c) (hd : (3:O) ∣ d-1) : (∑' n : O,primitiveRowIntegral v s (cuspFrequency h) c (d+3*c*n))= ∫ z : ℂ,primitiveTerm z v s c d*ShortDraftTrace.breveE (-cuspFrequency h*z) := by have hint := trace_mul_integrable (fun z => primitiveTerm z v s c d) (primitiveTerm_integrable v hv s hs c d hc) (cuspFrequency h) rw [integral_eq_period_integrals _ hint] apply tsum_congr intro n apply integral_congr_ae exact Eventually.of_forall fun z => by dsimp only rw [primitiveTerm_shift z v s c d n hlevel hd,cuspFrequency_negative_period] lemma primitiveTerm_fourier_integral (v : ℝ) (hv : 0 < v) (s freq : ℂ) (c d : O) (hc : c ≠ 0) : (∫ z : ℂ,primitiveTerm z v s c d*ShortDraftTrace.breveE (-freq*z))= ((v:ℂ)^(2-s)*sourceFourierKernel s (freq*v))* ((‖eisEmbedding c‖^2:ℝ):ℂ)^(-s)* (eisEmbedding (symbol c d)*ShortDraftTrace.breveE (freq*eisEmbedding d/eisEmbedding c)) := by simp_rw [primitiveTerm_eq_shiftedHeightKernel _ v hv s c d hc,mul_assoc] rw [integral_const_mul,integral_const_mul,traceIntegral_shiftedHeightKernel v hv s (eisEmbedding d/eisEmbedding c) freq] ring_nf def arithmeticResidueSum (h c : O) : ℂ := ∑' r : AdmissibleResidue c,eisEmbedding (symbol c (denominatorRep c r.1))* ShortDraftTrace.breveE (cuspFrequency h*eisEmbedding (denominatorRep c r.1)/eisEmbedding c) lemma denominator_integral_formula (v : ℝ) (hv : 0 < v) (s : ℂ) (hs : 2 < s.re) (h : O) (c : LevelLower) (hc : c.1 ≠ 0) : (∑' d : AdmissibleDenominator c.1,primitiveRowIntegral v s (cuspFrequency h) c.1 d.1)= ((v:ℂ)^(2-s)*sourceFourierKernel s (cuspFrequency h*v))* ((‖eisEmbedding c.1‖^2:ℝ):ℂ)^(-s)*arithmeticResidueSum h c.1 := by have hsum : Summable (fun d : AdmissibleDenominator c.1 => primitiveRowIntegral v s (cuspFrequency h) c.1 d.1) := (hasSum_primitiveRowIntegrals v hv s (cuspFrequency h) hs).summable.sigma_factor c rw [denominator_sum_residues c.1 hc (fun d : O => primitiveRowIntegral v s (cuspFrequency h) c.1 d) hsum] calc _ = ∑' r : AdmissibleResidue c.1, ∫ z : ℂ, primitiveTerm z v s c.1 (denominatorRep c.1 r.1)* ShortDraftTrace.breveE (-cuspFrequency h*z) := by apply tsum_congr intro r exact primitiveRowIntegral_sum_translate v hv s (by linarith) h c.1 (denominatorRep c.1 r.1) hc c.2 r.2.2 _ = _ := by simp_rw [primitiveTerm_fourier_integral v hv s (cuspFrequency h) c.1 _ hc] exact tsum_mul_left end section open MeasureTheory Set Filter open scoped BigOperators Classical ENNReal Matrix open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal theorem instDiscreteTopologySubtypeComplexMemSubmoduleIntPeriodLattice : DiscreteTopology periodLattice := by unfold periodLattice; infer_instance theorem instIsZLatticeRealComplexPeriodLattice : letI : DiscreteTopology periodLattice := instDiscreteTopologySubtypeComplexMemSubmoduleIntPeriodLattice IsZLattice ℝ periodLattice := by let : DiscreteTopology periodLattice := instDiscreteTopologySubtypeComplexMemSubmoduleIntPeriodLattice unfold periodLattice infer_instance lemma summable_embedding_rpow (k : ℝ) (hk : k < -2) : Summable (fun n : O => ‖eisEmbedding n‖^k) := by let : DiscreteTopology periodLattice := instDiscreteTopologySubtypeComplexMemSubmoduleIntPeriodLattice let : IsZLattice ℝ periodLattice := instIsZLatticeRealComplexPeriodLattice have hrank : Module.finrank ℤ periodLattice=2 := by rw [ZLattice.rank ℝ periodLattice,Complex.finrank_real_complex] have hs := ZLattice.summable_norm_rpow periodLattice k (by rw [hrank]; norm_num; exact hk) have hcomp := periodEquiv.summable_iff.mpr hs have hscale := hcomp.mul_left (((3:ℝ)^k)⁻¹) apply hscale.congr intro n change ((3:ℝ)^k)⁻¹*‖(3:ℂ)*eisEmbedding n‖^k=‖eisEmbedding n‖^k rw [norm_mul,show ‖(3:ℂ)‖=(3:ℝ) by norm_num, Real.mul_rpow (by norm_num) (norm_nonneg _)] rw [← mul_assoc,inv_mul_cancel₀ (Real.rpow_pos_of_pos (by norm_num) k).ne',one_mul] lemma norm_row_symbol (c d : O) (hc : (3:O) ∣ c) (hd : denominatorCondition c d) : ‖eisEmbedding (symbol c d)‖=1 := by let r : PrimitiveRow := ⟨![c,d],hd.1,hc,hd.2⟩ let x := primitiveRowEquiv.symm r have heq : (cosetCharacter x)⁻¹=eisEmbedding (symbol c d) := by rw [inverse_cosetCharacter_eq_row_symbol] change eisEmbedding (symbol (cosetRow (primitiveRowEquiv.symm r) 0) (cosetRow (primitiveRowEquiv.symm r) 1))=eisEmbedding (symbol c d) rw [primitiveRowEquiv_symm_row r] rfl rw [← heq,norm_inv,norm_cosetCharacter,inv_one] lemma norm_arithmeticResidueSum_le (h c : O) (hc : c ≠ 0) (hlevel : (3:O) ∣ c) : ‖arithmeticResidueSum h c‖ ≤ 9*‖eisEmbedding c‖^2 := by let : Finite (DenominatorResidue c) := finite_quotient_span (mul_ne_zero (by norm_num) hc) let : Fintype (DenominatorResidue c) := Fintype.ofFinite _ let : Fintype (AdmissibleResidue c) := Fintype.ofFinite _ have hcard : (Fintype.card (DenominatorResidue c):ℝ)=9*‖eisEmbedding c‖^2 := by have hh := eisEmbedding_norm_sq_eq_absNorm_span (3*c) simp only [Ideal.absNorm_apply,Submodule.cardQuot_apply,Nat.card_eq_fintype_card] at hh rw [← hh,map_mul,map_ofNat,norm_mul,mul_pow] norm_num rw [arithmeticResidueSum,tsum_fintype] calc _ ≤ ∑ r : AdmissibleResidue c, ‖eisEmbedding (symbol c (denominatorRep c r.1))* ShortDraftTrace.breveE (cuspFrequency h*eisEmbedding (denominatorRep c r.1)/eisEmbedding c)‖ := norm_sum_le _ _ _ = (Fintype.card (AdmissibleResidue c):ℝ) := by have hr (r : AdmissibleResidue c) : ‖eisEmbedding (symbol c (denominatorRep c r.1))‖=1 := norm_row_symbol c (denominatorRep c r.1) hlevel r.2 simp only [norm_mul,hr,breveE_norm,Finset.sum_const,Finset.card_univ,nsmul_eq_mul,mul_one] _ ≤ (Fintype.card (DenominatorResidue c):ℝ) := by exact_mod_cast Fintype.card_subtype_le (fun r => denominatorCondition c (denominatorRep c r)) _ = _ := hcard def arithmeticDirichletTerm (s : ℂ) (h : O) (c : LevelLower) : ℂ := if c.1=0 then 0 else ((‖eisEmbedding c.1‖^2:ℝ):ℂ)^(-s)*arithmeticResidueSum h c.1 lemma norm_arithmeticDirichletTerm_le (s : ℂ) (h : O) (c : LevelLower) : ‖arithmeticDirichletTerm s h c‖ ≤ 9*‖eisEmbedding c.1‖^(2-2*s.re) := by unfold arithmeticDirichletTerm split_ifs with hc · simp only [norm_zero] positivity · have hn : 0 < ‖eisEmbedding c.1‖ := norm_pos_iff.mpr (eisEmbedding_ne_zero hc) rw [norm_mul,Complex.norm_cpow_eq_rpow_re_of_pos (sq_pos_of_pos hn)] change (‖eisEmbedding c.1‖^2)^(-s.re)*‖arithmeticResidueSum h c.1‖ ≤ _ calc _ ≤ (‖eisEmbedding c.1‖^2)^(-s.re)*(9*‖eisEmbedding c.1‖^2) := mul_le_mul_of_nonneg_left (norm_arithmeticResidueSum_le h c.1 hc c.2) (by positivity) _ = _ := by rw [← Real.rpow_natCast_mul hn.le 2 (-s.re)] rw [show 2-2*s.re=2+2*(-s.re) by ring,Real.rpow_add hn] norm_num only [Nat.cast_ofNat,Real.rpow_two] ring theorem arithmeticDirichletTerm_summable_norm (s : ℂ) (hs : 2 < s.re) (h : O) : Summable (fun c : LevelLower => ‖arithmeticDirichletTerm s h c‖) := by have hbase := (summable_embedding_rpow (2-2*s.re) (by linarith)).subtype (fun c : O => (3:O) ∣ c) exact (hbase.mul_left 9).of_nonneg_of_le (fun _ => norm_nonneg _) (norm_arithmeticDirichletTerm_le s h) def arithmeticDirichletSeries (s : ℂ) (h : O) : ℂ := ∑' c : LevelLower,arithmeticDirichletTerm s h c def scatteringCoefficient (s : ℂ) (h : O) : ℂ := arithmeticDirichletSeries s h/((9*Real.sqrt 3/2:ℝ):ℂ) end open MeasureTheory Set Filter open scoped BigOperators Classical open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma zero_lower_integral (v : ℝ) (s : ℂ) (h : O) : (∑' d : AdmissibleDenominator 0,primitiveRowIntegral v s (cuspFrequency h) 0 d.1)= (v:ℂ)^s*(if h=0 then ((9*Real.sqrt 3/2:ℝ):ℂ) else 0) := by let d0 : AdmissibleDenominator 0 := ⟨1,isCoprime_one_right,by simp⟩ rw [tsum_eq_single d0] · simp only [d0,primitiveRowIntegral,primitiveTerm,map_zero,map_one,zero_mul,zero_add, norm_one,norm_zero,one_pow,zero_pow (by decide : (2:ℕ) ≠ 0),add_zero, div_one,symbol_one,map_one] rw [integral_const_mul,integral_cusp_character,one_mul] · intro d hd exact False.elim (hd (Subtype.ext (denominator_zero_unique d))) lemma integral_upperEisenstein_arithmetic (v : ℝ) (hv : 0 < v) (s : ℂ) (hs : 2 < s.re) (h : O) : (∫ z in periodDomain,upperEisenstein z v hv s*ShortDraftTrace.breveE (-cuspFrequency h*z))= (v:ℂ)^s*(if h=0 then ((9*Real.sqrt 3/2:ℝ):ℂ) else 0)+ ((v:ℂ)^(2-s)*sourceFourierKernel s (cuspFrequency h*v))*arithmeticDirichletSeries s h := by let c0 : LevelLower := ⟨0,dvd_zero _⟩ let F (c : LevelLower) := ∑' d : AdmissibleDenominator c.1, primitiveRowIntegral v s (cuspFrequency h) c.1 d.1 have hsum := hasSum_primitiveRowIntegrals v hv s (cuspFrequency h) hs have hF : Summable F := hsum.summable.sigma have hzero : F c0=(v:ℂ)^s*(if h=0 then ((9*Real.sqrt 3/2:ℝ):ℂ) else 0) := zero_lower_integral v s h calc _ = ∑' c : LevelLower,F c := hsum.tsum_eq.symm.trans hsum.summable.tsum_sigma _ = F c0+∑' c : LevelLower,if c=c0 then 0 else F c := hF.tsum_eq_add_tsum_ite c0 _ = _ := by rw [hzero] congr 1 rw [arithmeticDirichletSeries,← tsum_mul_left] apply tsum_congr intro c by_cases hc : c.1=0 · have heq : c=c0 := Subtype.ext hc simp only [heq,ite_true,arithmeticDirichletTerm,c0,mul_zero] · have heq : c ≠ c0 := fun heq => hc (congrArg Subtype.val heq) rw [if_neg heq] change (∑' d : AdmissibleDenominator c.1, primitiveRowIntegral v s (cuspFrequency h) c.1 d.1)=_ rw [denominator_integral_formula v hv s hs h c hc] simp only [arithmeticDirichletTerm,if_neg hc] ring def eisensteinFourierCoefficient (v : ℝ) (hv : 0 < v) (s : ℂ) (h : O) : ℂ := (∫ z in periodDomain,upperEisenstein z v hv s*ShortDraftTrace.breveE (-cuspFrequency h*z))/ ((9*Real.sqrt 3/2:ℝ):ℂ) theorem eisensteinFourierCoefficient_formula (v : ℝ) (hv : 0 < v) (s : ℂ) (hs : 2 < s.re) (h : O) : eisensteinFourierCoefficient v hv s h=(if h=0 then (v:ℂ)^s else 0)+ (v:ℂ)^(2-s)*sourceFourierKernel s (cuspFrequency h*v)*scatteringCoefficient s h := by rw [eisensteinFourierCoefficient,integral_upperEisenstein_arithmetic v hv s hs h,scatteringCoefficient] have hvol : ((9*Real.sqrt 3/2:ℝ):ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (by positivity) split_ifs <;> field_simp ; ring theorem eisensteinConstantCoefficient_formula (v : ℝ) (hv : 0 < v) (s : ℂ) (hs : 2 < s.re) : eisensteinFourierCoefficient v hv s 0=(v:ℂ)^s+ (v:ℂ)^(2-s)*((Real.pi:ℂ)/(s-1))*scatteringCoefficient s 0 := by rw [eisensteinFourierCoefficient_formula v hv s hs 0] simp only [ite_true,cuspFrequency,map_zero,zero_div,zero_mul] rw [sourceFourierKernel_zero s (by linarith)] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.PrimePools namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ActualEisensteinCubic CompletedGauss ConcretePrimeRowBridge theorem canonicalPoolMaximal (F : Finset (Ideal O)) (i : primePool F) : i.val.IsMaximal := by obtain ⟨I, hIF, hi⟩ := mem_primePool_iff.mp i.property have hp := UniqueFactorizationMonoid.prime_of_normalized_factor i.val hi exact (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero theorem poolGood (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (i : primePool F) : lambda ∉ i.val := by obtain ⟨I, hIF, hi⟩ := mem_primePool_iff.mp i.property exact ((hF I hIF).2.2 i.val hi).1 theorem poolOdd (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (i : primePool F) : ringChar (O ⧸ i.val) ≠ 2 := by obtain ⟨I, hIF, hi⟩ := mem_primePool_iff.mp i.property exact ((hF I hIF).2.2 i.val hi).2 def poolPrimary (F : Finset (Ideal O)) (i : primePool F) : O := primaryPrime i.val theorem poolPrimary_ne_zero (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (i : primePool F) : poolPrimary F i ≠ 0 := letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal primaryPrime_ne_zero i.val (poolGood F hF i) theorem poolPrimary_span (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (i : primePool F) : Ideal.span {poolPrimary F i} = i.val := (primaryPrime_spec i.val (poolPrimary_ne_zero F hF i)).2.2.1 theorem primaryPrime_eq_primaryGenerator (P : Ideal O) [P.IsMaximal] : primaryPrime P = primaryGenerator P := by have hp : Prime P := Ideal.prime_of_isPrime (NeZero.ne P) inferInstance rw [primaryGenerator, if_neg hp.ne_zero, UniqueFactorizationMonoid.normalizedFactors_irreducible hp.irreducible, normalize_eq] simp only [Multiset.map_singleton, Multiset.prod_singleton] theorem primaryGenerator_eq_poolProduct (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (I : Ideal O) (hIF : I ∈ F) : primaryGenerator I = ∏ i ∈ idealSupport F I, poolPrimary F i := letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal by calc _ = primaryGenerator (∏ i ∈ idealSupport F I, i.val) := congrArg primaryGenerator (idealSupport_product_eq F hIF (hF I hIF).2.1).symm _ = ∏ i ∈ idealSupport F I, primaryGenerator i.val := by change primaryGeneratorHom (∏ i ∈ idealSupport F I, i.val) = ∏ i ∈ idealSupport F I, primaryGeneratorHom i.val rw [map_prod] _ = _ := Finset.prod_congr rfl (fun i hi => (primaryPrime_eq_primaryGenerator i.val).symm) theorem quadraticRow_eq_pool (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (I : Ideal O) (hIF : I ∈ F) (z : O) : letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal quadraticRow I z = QuadraticInitialBound.quadraticRow (fun i : primePool F => i.val) (poolGood F hF) (idealSupport F I) z := letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal by rw [quadraticRow_eq F hF I hIF z] rfl theorem poolPrimary_coprime (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) : Pairwise (Function.onFun IsCoprime (fun i : primePool F => Ideal.span {poolPrimary F i})) := letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal by intro i j hij change IsCoprime (Ideal.span {poolPrimary F i}) (Ideal.span {poolPrimary F j}) rw [poolPrimary_span F hF i, poolPrimary_span F hF j] exact Ideal.isCoprime_of_isMaximal (fun he => hij (Subtype.ext he)) theorem poolPrimary_good (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (i : primePool F) : lambda ∉ Ideal.span {poolPrimary F i} := by rw [poolPrimary_span F hF i]; exact poolGood F hF i theorem poolPrimary_odd (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (i : primePool F) : ringChar (O ⧸ Ideal.span {poolPrimary F i}) ≠ 2 := by rw [poolPrimary_span F hF i]; exact poolOdd F hF i open ActualEisensteinCubic CompletedGauss ConcretePrimeRowBridge ActualEisensteinCoordinates theorem quadraticRow_eq_primaryPool (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (I : Ideal O) (hIF : I ∈ F) (z : O) : letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal letI : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal fun i => by rw [poolPrimary_span F hF i]; infer_instance quadraticRow I z = QuadraticInitialBound.quadraticRow (fun i : primePool F => Ideal.span {poolPrimary F i}) (poolPrimary_good F hF) (idealSupport F I) z := by have he : (fun i : primePool F => Ideal.span {poolPrimary F i}) = (fun i : primePool F => i.val) := funext (poolPrimary_span F hF) simpa only [he] using quadraticRow_eq_pool F hF I hIF z theorem quadraticRow_eq_primeSubset (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (I : Ideal O) (hIF : I ∈ F) (z : O) : letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal quadraticRow I z = finiteSexticRow (fun i : idealSupport F I => i.val.val) (fun i => poolGood F hF i.val) (fun _ => 3) z := letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal by rw [quadraticRow_eq_pool F hF I hIF z, QuadraticInitialBound.quadraticRow_eq_canonical] theorem idealSupport_disjoint_of_coprime (F : Finset (Ideal O)) (I J : Ideal O) (hIJ : IsCoprime I J) : Disjoint (idealSupport F I) (idealSupport F J) := by apply Finset.disjoint_left.mpr intro P hPI hPJ have hi := (mem_idealSupport_iff F I P).mp hPI have hj := (mem_idealSupport_iff F J P).mp hPJ have hp := UniqueFactorizationMonoid.prime_of_normalized_factor P.val hi exact hp.not_isUnit (hIJ.isRelPrime (UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors hi) (UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors hj)) theorem primaryGenerator_unit_mod_four (I : Ideal O) (hI : Admissible I) : IsUnit (Ideal.Quotient.mk (Ideal.span {(4 : O)}) (primaryGenerator I)) := letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal by let F : Finset (Ideal O) := {I} have hF : ∀ J ∈ F, Admissible J := by intro J hJ have hJI : J = I := Finset.mem_singleton.mp hJ simpa only [hJI] using hI let : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance rw [primaryGenerator_eq_poolProduct F hF I (Finset.mem_singleton_self I)] exact RayFourExpansion.prime_product_unit_mod_four (poolPrimary F) (poolPrimary_odd F hF) _ theorem columnRay_idealQuotient_eq (D I J : Ideal O) (hI : Admissible I) (_hJ : Admissible J) (hDI : D ∣ I) (hDJ : D ∣ J) (hIJ : columnRay I = columnRay J) : columnRay (idealQuotient D I) = columnRay (idealQuotient D J) := by have hD : Admissible D := admissible_of_dvd hI hDI have hu := primaryGenerator_unit_mod_four D hD obtain ⟨u, hu⟩ := hu have hray : residue (primaryGenerator I) = residue (primaryGenerator J) := hIJ obtain ⟨z, hz⟩ := congr_mod_four_of_residue_eq hray have hquot : Ideal.Quotient.mk (Ideal.span {(4 : O)}) (primaryGenerator I) = Ideal.Quotient.mk (Ideal.span {(4 : O)}) (primaryGenerator J) := by apply Ideal.Quotient.eq.mpr apply Ideal.mem_span_singleton.mpr exact ⟨z, hz⟩ have hprodI : primaryGenerator I = primaryGenerator D * primaryGenerator (idealQuotient D I) := by rw [← primaryGenerator_mul, idealQuotient_mul hDI] have hprodJ : primaryGenerator J = primaryGenerator D * primaryGenerator (idealQuotient D J) := by rw [← primaryGenerator_mul, idealQuotient_mul hDJ] rw [hprodI, hprodJ, map_mul, map_mul, ← hu] at hquot have heq := (Units.mul_right_inj u).mp hquot exact QuadraticGaussRay.residue_eq_of_quotient_four_eq _ _ heq end section open ActualEisensteinCubic CompletedGauss ConcretePrimeRowBridge ActualEisensteinCoordinates open EisensteinSchwartzPoisson GaussGeneratorTransport theorem quadraticRow_eq_primarySubset (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (I : Ideal O) (hIF : I ∈ F) (z : O) : letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal letI : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal fun i => by rw [poolPrimary_span F hF i]; infer_instance quadraticRow I z = finiteSexticRow (fun i : idealSupport F I => Ideal.span {poolPrimary F i.val}) (fun i => poolPrimary_good F hF i.val) (fun _ => 3) z := by have he : (fun i : idealSupport F I => Ideal.span {poolPrimary F i.val}) = (fun i : idealSupport F I => i.val.val) := funext (fun i => poolPrimary_span F hF i.val) simpa only [he] using quadraticRow_eq_primeSubset F hF I hIF z end open ActualEisensteinCubic CompletedGauss ConcretePrimeRowBridge theorem quadraticRow_zero_of_ne_one (I : Ideal O) (hI : Admissible I) (hI1 : I ≠ 1) : quadraticRow I 0 = 0 := letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal by let F : Finset (Ideal O) := {I} have hIF : I ∈ F := Finset.mem_singleton_self I have hF : ∀ J ∈ F, Admissible J := by intro J hJ have hJI := Finset.mem_singleton.mp hJ simpa only [hJI] using hI have hS : (idealSupport F I).Nonempty := by by_contra hn have he : idealSupport F I = ∅ := Finset.not_nonempty_iff_eq_empty.mp hn have hp := idealSupport_product_eq F hIF hI.2.1 rw [he, Finset.prod_empty] at hp exact hI1 hp.symm let : Nonempty (idealSupport F I) := ⟨⟨hS.choose, hS.choose_spec⟩⟩ rw [quadraticRow_eq_primeSubset F hF I hIF] exact finiteSexticRow_zero _ _ _ theorem quadratic_pair_zero_of_nontrivial (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (h : I ≠ 1 ∨ J ≠ 1) : quadraticRow I 0 * quadraticRow J 0 = 0 := by rcases h with h | h · rw [quadraticRow_zero_of_ne_one I hI h, zero_mul] · rw [quadraticRow_zero_of_ne_one J hJ h, mul_zero] end CanonicalQuadraticSieve open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open FirstPassCubeLabels (columnLog primeProductNorm normalizedColumn) open EisensteinSchwartzPoisson (paperRadialFourier) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def radialPairKernel (e k : O) (W : 𝓢(ℝ, ℂ)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ Y : ℝ) (S T : Finset ι) : ℂ := star (normalizedColumn p (fun U => V₁ (columnLog p X₁ U)) S) * normalizedColumn p (fun U => V₂ (columnLog p X₂ U)) T * paperRadialFourier W (Y * ‖eisEmbedding k‖ ^ 2 / (‖eisEmbedding e‖ ^ 2 * primeProductNorm p S * primeProductNorm p T)) theorem secondChildKernelPair_fixed_pool (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k₁ k₂ : O) (K : Finset ι → Finset ι → ℂ) : secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k₁ k₂ K = ∑ N ∈ F.powerset, ∑ M ∈ F.powerset, star (secondChildColumn p hp hcop hg Ψ₁ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k₁) (fun _ => 1) N) * secondChildColumn p hp hcop hg Ψ₂ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k₂) (fun _ => 1) M * K (V∪N) (V∪M) := by have hzero (N : Finset ι) (hNF : N ∈ F.powerset) (hNV : N ∉ (F \ V).powerset) : ¬ Disjoint V N := by intro hd apply hNV apply Finset.mem_powerset.mpr intro i hi exact Finset.mem_sdiff.mpr ⟨(Finset.mem_powerset.mp hNF) hi, fun hiv => Finset.disjoint_left.mp hd hiv hi⟩ unfold secondChildKernelPair calc _ = ∑ N ∈ (F \ V).powerset, ∑ M ∈ F.powerset, star (secondChildColumn p hp hcop hg Ψ₁ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k₁) (fun _ => 1) N) * secondChildColumn p hp hcop hg Ψ₂ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k₂) (fun _ => 1) M * K (V∪N) (V∪M) := by apply Finset.sum_congr rfl intro N hN apply Finset.sum_subset (Finset.powerset_mono.mpr Finset.sdiff_subset) intro M hMF hMV rw [secondChildColumn_zero_of_overlap p hp hcop hg Ψ₂ (m*r) c e (d*e*k₂) (fun _ => 1) V M (hzero M hMF hMV), mul_zero, zero_mul] _ = _ := by apply Finset.sum_subset (Finset.powerset_mono.mpr Finset.sdiff_subset) intro N hNF hNV rw [secondChildColumn_zero_of_overlap p hp hcop hg Ψ₁ (m*r) c e (d*e*k₁) (fun _ => 1) V N (hzero N hNF hNV), star_zero] simp only [zero_mul, Finset.sum_const_zero] end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap ContDiff namespace SecondPassIntegration open ActualEisensteinCubic JointLogSeparation FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) def elementNorm (a : O) : ℝ := ‖eisEmbedding a‖ ^ 2 lemma elementNorm_pos (a : O) (ha : a ≠ 0) : 0 < elementNorm a := by exact sq_pos_of_pos (norm_pos_iff.mpr (ConcreteTraceCRT.eisEmbedding_ne_zero ha)) lemma elementNorm_mul (a b : O) : elementNorm (a*b) = elementNorm a * elementNorm b := by simp only [elementNorm, map_mul, norm_mul, mul_pow] theorem seven_radial_ratio (d e v n₁ n₂ k D E V X K Y : ℝ) (hd : 0 < d) (he : 0 < e) (hv : 0 < v) (hn₁ : 0 < n₁) (hn₂ : 0 < n₂) (hk : 0 < k) (hD : 0 < D) (hE : 0 < E) (hV : 0 < V) (hX : 0 < X) (hK : 0 < K) : Y * k / (e * v ^ 2 * n₁ * n₂) = (Y * K / (D * E ^ 2 * V ^ 2 * X ^ 2)) * Real.exp (Real.log (d*e*k/K) - Real.log (d/D) - 2*Real.log (e/E) - 2*Real.log (v/V) - Real.log (n₁/X) - Real.log (n₂/X)) := by rw [show 2 * Real.log (e/E) = Real.log (e/E) + Real.log (e/E) by ring, show 2 * Real.log (v/V) = Real.log (v/V) + Real.log (v/V) by ring] simp only [Real.exp_sub, Real.exp_add, Real.exp_log (div_pos hd hD), Real.exp_log (div_pos he hE), Real.exp_log (div_pos hv hV), Real.exp_log (div_pos hn₁ hX), Real.exp_log (div_pos hn₂ hX), Real.exp_log (div_pos (mul_pos (mul_pos hd he) hk) hK)] field_simp theorem second_radial_dyadic_argument {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (V N M : Finset ι) (hVN : Disjoint V N) (hVM : Disjoint V M) (d e k : O) (hd : d ≠ 0) (he : e ≠ 0) (hk : k ≠ 0) (D E V₀ X₀ K Y : ℝ) (hD : 0 < D) (hE : 0 < E) (hV₀ : 0 < V₀) (hX₀ : 0 < X₀) (hK : 0 < K) : Y * ‖eisEmbedding k‖ ^ 2 / (‖eisEmbedding e‖ ^ 2 * primeProductNorm p (V∪N) * primeProductNorm p (V∪M)) = (Y * K / (D * E ^ 2 * V₀ ^ 2 * X₀ ^ 2)) * Real.exp (Real.log (elementNorm (d*e*k) / K) - Real.log (elementNorm d / D) - 2*Real.log (elementNorm e / E) - 2*Real.log (primeProductNorm p V / V₀) - columnLog p X₀ N - columnLog p X₀ M) := by rw [primeProductNorm_union p V N hVN, primeProductNorm_union p V M hVM] simp only [elementNorm_mul, columnLog] have h := seven_radial_ratio (elementNorm d) (elementNorm e) (primeProductNorm p V) (primeProductNorm p N) (primeProductNorm p M) (elementNorm k) D E V₀ X₀ K Y (elementNorm_pos d hd) (elementNorm_pos e he) (primeProductNorm_pos p hp V) (primeProductNorm_pos p hp N) (primeProductNorm_pos p hp M) (elementNorm_pos k hk) hD hE hV₀ hX₀ hK convert h using 1 ; unfold elementNorm ; ring def conjugateProfile (g : 𝓢(ℝ, ℂ)) : 𝓢(ℝ, ℂ) := SchwartzMap.postcompCLM Complex.conjCLE.toContinuousLinearMap g lemma conjugateProfile_apply (g : 𝓢(ℝ, ℂ)) (s : ℝ) : conjugateProfile g s = star (g s) := rfl theorem normalizedColumn_pair_union {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (V N M : Finset ι) (hVN : Disjoint V N) (hVM : Disjoint V M) (X X₀ : ℝ) (hX : 0 < X) (hX₀ : 0 < X₀) (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g₁ g₂ : 𝓢(ℝ, ℂ)) (hU₁ : ∀ s, g₁ s ≠ 0 → U s = 1) (hU₂ : ∀ s, g₂ s ≠ 0 → U s = 1) : star (normalizedColumn p (fun S => g₁ (columnLog p X S)) (V∪N)) * normalizedColumn p (fun S => g₂ (columnLog p X S)) (V∪M) = (X : ℂ)⁻¹ * conjugateProfile (halfNormalizationCLM U g₁) (Real.log (primeProductNorm p V * X₀ / X) + columnLog p X₀ N) * halfNormalizationCLM U g₂ (Real.log (primeProductNorm p V * X₀ / X) + columnLog p X₀ M) := by rw [normalizedColumn_union_test p hp V N hVN X X₀ hX hX₀ U hUc hUs g₁ hU₁, normalizedColumn_union_test p hp V M hVM X X₀ hX hX₀ U hUc hUs g₂ hU₂] simp only [conjugateProfile_apply, star_div₀, Complex.star_def, Complex.conj_ofReal] have hs : (Real.sqrt X : ℂ) * (Real.sqrt X : ℂ) = (X : ℂ) := by rw [← Complex.ofReal_mul, Real.mul_self_sqrt hX.le] simp only [div_eq_mul_inv] calc _ = ((Real.sqrt X : ℂ) * (Real.sqrt X : ℂ))⁻¹ * star (halfNormalizationCLM U g₁ (Real.log (primeProductNorm p V * X₀ / X) + columnLog p X₀ N)) * halfNormalizationCLM U g₂ (Real.log (primeProductNorm p V * X₀ / X) + columnLog p X₀ M) := by rw [mul_inv_rev] simp only [Complex.star_def, div_eq_mul_inv] ring _ = _ := by rw [hs]; simp only [Complex.star_def, div_eq_mul_inv] end SecondPassIntegration open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) open EisensteinSchwartzPoisson (paperRadialFourier) open FirstCauchyArithmetic (supportMobius activeGaussRowFactor) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) private theorem active_row_norm_le_one (S T : Finset ι) (a : O) : ‖finiteSexticRow (activePrimes (fun i => Ideal.span {p i}) S T) (fun i => hg i.val) (activeExponent S T) a‖ ≤ 1 := by rw [finiteSexticRow_activeSupport, norm_mul, norm_star] exact (mul_le_mul (finiteSquarefreeRow_norm_le_one _ hg _ _) (finiteSquarefreeRow_norm_le_one _ hg _ _) (norm_nonneg _) zero_le_one).trans_eq (one_mul 1) def secondPairRadialMode (S T : Finset ι) (e k : O) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : ℂ := let n := ∏ i : activeSupport T S, p i.val ((Y : ℂ) / (‖eisEmbedding n‖ : ℂ)) * paperRadialFourier W (Y * ‖eisEmbedding k‖ ^ 2 / (‖eisEmbedding e‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) * activeGaussRowFactor p hp hinj hg T S e k theorem secondPairRadialMode_summable (S T : Finset ι) (e : O) (he : e ≠ 0) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) : Summable (fun k : O => secondPairRadialMode p hp hg hinj S T e k W Y) := by let n := ∏ i : activeSupport T S, p i.val let G := FiniteGaussPhase.canonicalProductGauss (fun i : activeSupport T S => p i.val) (fun i => hp i.val) (activePrimes_pairwise_isCoprime (fun i => Ideal.span {p i}) hinj T S) (fun i => hg i.val) (activeExponent T S) have hn : n ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i hi => hp i.val) have hK : 0 < Y / (‖eisEmbedding e‖ ^ 2 * ‖eisEmbedding n‖ ^ 2) := div_pos hY (mul_pos (sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero he))) (sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hn)))) have hs := EisensteinSchwartzPoisson.paperRadialFourier_lattice_summable_norm W _ hK have hgk (k : O) : ‖activeGaussRowFactor p hp hinj hg T S e k‖ ≤ ‖G‖ := by simp only [activeGaussRowFactor, norm_mul, norm_star] change ‖G‖ * (_ * _) ≤ ‖G‖ have hb : ‖finiteSexticRow (activePrimes (fun i => Ideal.span {p i}) T S) (fun i => hg i.val) (activeExponent T S) e‖ * ‖finiteSexticRow (activePrimes (fun i => Ideal.span {p i}) T S) (fun i => hg i.val) (activeExponent T S) k‖ ≤ 1 := by simpa only [one_mul] using mul_le_mul (active_row_norm_le_one p hg T S e) (active_row_norm_le_one p hg T S k) (norm_nonneg _) zero_le_one exact mul_le_of_le_one_right (norm_nonneg _) hb have harg (k : O) : Y * ‖eisEmbedding k‖ ^ 2 / (‖eisEmbedding e‖ ^ 2 * ‖eisEmbedding n‖ ^ 2) = (Y / (‖eisEmbedding e‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) * ‖eisEmbedding k‖ ^ 2 := by ring apply Summable.of_norm apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ ((hs.mul_left ‖(Y : ℂ) / (‖eisEmbedding n‖ : ℂ)‖).mul_right ‖G‖) intro k simp only [secondPairRadialMode, norm_mul] rw [show (∏ i : activeSupport T S, p i.val) = n from rfl, harg] exact mul_le_mul_of_nonneg_left (hgk k) (by positivity) theorem maskedSecondDual_eq_modes (G S T : Finset ι) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : maskedSecondDual p hg hp hinj G S T W Y = ∑ E ∈ G.powerset, ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, Ideal.span {p i}) : ℂ) / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖ ^ 2 : ℝ)) * ∑' k : O, secondPairRadialMode p hp hg hinj S T (primeSubsetGenerator (fun i => Ideal.span {p i}) E) k W Y := by simp only [maskedSecondDual, secondPairRadialMode, mul_assoc, tsum_mul_left, Finset.mul_sum] apply Finset.sum_congr rfl intro E hE ring def residualSecondMode (F G : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m c d : O) (H₁ H₂ : Finset ι → ℂ) (e k : O) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : ℂ := ∑ S ∈ (F \ G).powerset, ∑ T ∈ (F \ G).powerset, if Disjoint S T then star (supportMobius (fun i => Ideal.span {p i}) S * secondInputCoefficient p hg Ψ₁ m c d H₁ S) * (supportMobius (fun i => Ideal.span {p i}) T * secondInputCoefficient p hg Ψ₂ m c d H₂ T) * secondPairRadialMode p hp hg hinj S T e k W Y else 0 theorem residualSecondMode_summable (F G : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m c d : O) (H₁ H₂ : Finset ι → ℂ) (e : O) (he : e ≠ 0) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) : Summable (fun k : O => residualSecondMode p hp hg hinj F G Ψ₁ Ψ₂ m c d H₁ H₂ e k W Y) := by apply summable_sum intro S hS apply summable_sum intro T hT by_cases hd : Disjoint S T · simp only [if_pos hd] exact (secondPairRadialMode_summable p hp hg hinj S T e he W Y hY).mul_left _ · simp only [if_neg hd] exact summable_zero end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open FirstCauchyArithmetic (supportMobius activeGaussRowFactor) open FirstPassCubeLabels (primeProductNorm) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) def secondFrequencyKernel (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (H₁ H₂ : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : ℂ := ∑ S ∈ F.powerset, ∑ T ∈ F.powerset, if Disjoint S T then ((Y : ℂ) / (‖eisEmbedding (∏ i ∈ S ∪ T, p i)‖ : ℂ)) * paperRadialFourier W (Y * ‖eisEmbedding k‖ ^ 2 / (‖eisEmbedding e‖ ^ 2 * primeProductNorm p (S ∪ T))) * secondGaussTerm p hp hg hinj Ψ₁ Ψ₂ m r c d e k H₁ H₂ S T else 0 theorem residualSecondMode_tsum (F G : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m c d : O) (H₁ H₂ : Finset ι → ℂ) (e : O) (he : e ≠ 0) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) : (∑' k : O, residualSecondMode p hp hg hinj F G Ψ₁ Ψ₂ m c d H₁ H₂ e k W Y) = ∑ S ∈ (F \ G).powerset, ∑ T ∈ (F \ G).powerset, ∑' k : O, if Disjoint S T then star (supportMobius (fun i => Ideal.span {p i}) S * secondInputCoefficient p hg Ψ₁ m c d H₁ S) * (supportMobius (fun i => Ideal.span {p i}) T * secondInputCoefficient p hg Ψ₂ m c d H₂ T) * secondPairRadialMode p hp hg hinj S T e k W Y else 0 := by have hs (S T : Finset ι) : Summable (fun k : O => if Disjoint S T then star (supportMobius (fun i => Ideal.span {p i}) S * secondInputCoefficient p hg Ψ₁ m c d H₁ S) * (supportMobius (fun i => Ideal.span {p i}) T * secondInputCoefficient p hg Ψ₂ m c d H₂ T) * secondPairRadialMode p hp hg hinj S T e k W Y else 0) := by by_cases hd : Disjoint S T · simp only [if_pos hd] exact (secondPairRadialMode_summable p hp hg hinj S T e he W Y hY).mul_left _ · simp only [if_neg hd] exact summable_zero unfold residualSecondMode rw [Summable.tsum_finsetSum (fun S _ => summable_sum (fun T _ => hs S T))] apply Finset.sum_congr rfl intro S hS exact Summable.tsum_finsetSum (fun T _ => hs S T) def secondOverlapBlock (F G : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : ℂ := ∑ S ∈ (F \ G).powerset, ∑ T ∈ (F \ G).powerset, if Disjoint S T then overlapPairWeight p hg Ψ m c d H G S T * maskedSecondDual p hg hp hinj G S T W Y else 0 theorem secondOverlapBlock_eq_modes (F G : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) : secondOverlapBlock p hp hg hinj F G Ψ m c d H W Y = (↑(‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) G‖ ^ 2) : ℂ) * ∑ E ∈ G.powerset, ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, Ideal.span {p i}) : ℂ) / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖ ^ 2 : ℝ)) * ∑' k : O, residualSecondMode p hp hg hinj F G Ψ Ψ m c d (fun U => H (G ∪ U)) (fun U => H (G ∪ U)) (primeSubsetGenerator (fun i => Ideal.span {p i}) E) k W Y := by let a := (↑(‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) G‖ ^ 2) : ℂ) let w := fun E : Finset ι => (UniqueFactorizationMonoid.moebius (∏ i ∈ E, Ideal.span {p i}) : ℂ) / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖ ^ 2 : ℝ) let f := fun (E S T : Finset ι) (k : O) => if Disjoint S T then star (supportMobius (fun i => Ideal.span {p i}) S * secondInputCoefficient p hg Ψ m c d (fun U => H (G ∪ U)) S) * (supportMobius (fun i => Ideal.span {p i}) T * secondInputCoefficient p hg Ψ m c d (fun U => H (G ∪ U)) T) * secondPairRadialMode p hp hg hinj S T (primeSubsetGenerator (fun i => Ideal.span {p i}) E) k W Y else 0 have hterm (S T : Finset ι) : (if Disjoint S T then overlapPairWeight p hg Ψ m c d H G S T * maskedSecondDual p hg hp hinj G S T W Y else 0) = a * ∑ E ∈ G.powerset, w E * ∑' k : O, f E S T k := by by_cases hd : Disjoint S T · simp only [if_pos hd, maskedSecondDual_eq_modes p hp hg hinj, overlapPairWeight, f, Finset.mul_sum, tsum_mul_left] apply Finset.sum_congr rfl intro E hE dsimp only [a, w] ring · simp [hd, f] calc _ = a * ∑ S ∈ (F \ G).powerset, ∑ T ∈ (F \ G).powerset, ∑ E ∈ G.powerset, w E * ∑' k : O, f E S T k := by simp only [secondOverlapBlock, hterm, Finset.mul_sum] _ = a * ∑ S ∈ (F \ G).powerset, ∑ E ∈ G.powerset, ∑ T ∈ (F \ G).powerset, w E * ∑' k : O, f E S T k := by congr 1 apply Finset.sum_congr rfl intro S hS rw [Finset.sum_comm] _ = a * ∑ E ∈ G.powerset, ∑ S ∈ (F \ G).powerset, ∑ T ∈ (F \ G).powerset, w E * ∑' k : O, f E S T k := by congr 1 rw [Finset.sum_comm] _ = _ := by congr 1 apply Finset.sum_congr rfl intro E hE rw [residualSecondMode_tsum p hp hg hinj F G Ψ Ψ m c d (fun U => H (G ∪ U)) (fun U => H (G ∪ U)) (primeSubsetGenerator (fun i => Ideal.span {p i}) E) (primeSubsetGenerator_ne_zero _ E) W Y hY] simp only [Finset.mul_sum] rfl theorem residualSecondMode_eq_frequencyKernel (F G E : Finset ι) (hEG : E ⊆ G) (Ψ₁ Ψ₂ : O →* ℂ) (m c d : O) (H₁ H₂ : Finset ι → ℂ) (k : O) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : residualSecondMode p hp hg hinj F G Ψ₁ Ψ₂ m c d H₁ H₂ (primeSubsetGenerator (fun i => Ideal.span {p i}) E) k W Y = secondFrequencyKernel p hp hg hinj F Ψ₁ Ψ₂ m (secondMaskQuotient p E G hEG) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) E) k H₁ H₂ W Y := by unfold residualSecondMode rw [input_pair_fixed_pool p hg hinj F G Ψ₁ Ψ₂ m c d H₁ H₂] unfold secondFrequencyKernel apply Finset.sum_congr rfl intro S hS apply Finset.sum_congr rfl intro T hT by_cases hd : Disjoint S T · rw [if_pos hd, if_pos hd] have hn : (∏ i : activeSupport T S, p i.val) = ∏ i ∈ S ∪ T, p i := by rw [Finset.prod_coe_sort] simp only [activeSupport, Finset.sdiff_eq_self_of_disjoint hd, Finset.sdiff_eq_self_of_disjoint hd.symm, Finset.union_comm T S] simp only [secondPairRadialMode, secondGaussTerm, hn, primeProductNorm, ← secondMaskQuotient_spec p E G hEG] ring · simp [hd] end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.FrequencyBlocks namespace OAI noncomputable section namespace SecondPassArithmetic open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators section open scoped BigOperators Classical SchwartzMap section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) theorem inputConjugateRow_smoothed_frequency_blocks (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) : (∑' z : O, W (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖inputConjugateRow p hg F Ψ m c d H z‖ ^ 2) : ℂ)) = ∑ G ∈ F.powerset, (↑(‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) G‖ ^ 2) : ℂ) * ∑ E : G.powerset, ((UniqueFactorizationMonoid.moebius (∏ i ∈ E.val, Ideal.span {p i}) : ℂ) / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val)‖ ^ 2 : ℝ)) * ∑' k : O, secondFrequencyKernel p hp hg hinj F Ψ Ψ m (secondMaskQuotient p E.val G (Finset.mem_powerset.mp E.property)) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) k (fun U => H (G ∪ U)) (fun U => H (G ∪ U)) W Y := by rw [inputConjugateRow_smoothed_second_poisson p hg hp hinj hc F Ψ m c d H W Y hY] apply Finset.sum_congr rfl intro G hG change secondOverlapBlock p hp hg hinj F G Ψ m c d H W Y = _ rw [secondOverlapBlock_eq_modes p hp hg hinj F G Ψ m c d H W Y hY] congr 1 rw [← Finset.sum_coe_sort (s := G.powerset)] apply Finset.sum_congr rfl intro E hE congr 1 apply tsum_congr intro k exact residualSecondMode_eq_frequencyKernel p hp hg hinj F G E.val (Finset.mem_powerset.mp E.property) Ψ Ψ m c d (fun U => H (G ∪ U)) (fun U => H (G ∪ U)) k W Y end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open FirstCauchyArithmetic (supportConjugateSum supportMobius) open RayFourExpansion (RayCharacter) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) omit [DecidableEq ι] in lemma finiteSquarefreeRow_zero_of_nonempty (S : Finset ι) (hS : S.Nonempty) : finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S 0 = 0 := by obtain ⟨i, hi⟩ := hS apply FirstPassCubeLabels.row_zero_of_mask_zero (fun i => Ideal.span {p i}) hg S 0 have h : ∃ j ∈ S, (0 : O) ∈ Ideal.span {p j} := ⟨i, hi, Ideal.zero_mem _⟩ simp only [rowCoprimeMask, ite_eq_left h] theorem inputConjugateRow_zero (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) : inputConjugateRow p hg F Ψ m c d H 0 = H ∅ := by unfold inputConjugateRow supportConjugateSum rw [Finset.sum_eq_single ∅] · have hm : supportMobius (fun i => Ideal.span {p i}) ∅ = 1 := by simp only [supportMobius, Finset.prod_empty, UniqueFactorizationMonoid.moebius_one, Int.cast_one] rw [hm] simp [secondInputCoefficient, rowCoprimeMask, finiteSquarefreeRow] · intro S hS hne rw [finiteSquarefreeRow_zero_of_nonempty p hg S (Finset.nonempty_iff_ne_empty.mpr hne), star_zero, mul_zero] · simp theorem firstCoreInputRow_zero (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (r : FirstCoreIndex) (t : ℝ) : firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t 0 = firstCoreTest H V y negative t D ∅ := by unfold firstCoreInputRow simp only [neg_zero, ite_self, inputConjugateRow_zero] end def nonzeroRowMajorantSum (P : O → ℂ) (Y : ℝ) : ℂ := ∑' z : O, if z = 0 then 0 else rowMajorant (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖P z‖ ^ 2) : ℂ) lemma nonzeroRowMajorant_summable (P : O → ℂ) (Y : ℝ) (hY : 0 < Y) : Summable (fun z : O => if z = 0 then 0 else rowMajorant (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖P z‖ ^ 2) : ℂ)) := by apply (hasSum_sum_of_ne_finset_zero (s := rowMajorantBall Y) ?_).summable intro z hz rw [rowMajorant_zero_outside Y hY z hz] simp theorem nonzeroRowMajorantSum_eq_sub (P : O → ℂ) (Y : ℝ) (hY : 0 < Y) : nonzeroRowMajorantSum P Y = (∑' z : O, rowMajorant (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖P z‖ ^ 2) : ℂ)) - (↑(‖P 0‖ ^ 2) : ℂ) := by have h := (rowMajorant_summable P Y hY).tsum_eq_add_tsum_ite 0 have h0 : rowMajorant (0 : ℝ) = 1 := rowMajorant_one 0 (by norm_num) simp only [map_zero, norm_zero, zero_pow (by decide : (2 : ℕ) ≠ 0), zero_div, h0, one_mul] at h change _ = _ + nonzeroRowMajorantSum P Y at h rw [h] ring theorem finite_nonzero_row_energy_le_majorant (P : O → ℂ) (T : Finset O) (Y : ℝ) (hY : 0 < Y) (hT : ∀ z ∈ T, (Ideal.absNorm (Ideal.span {z}) : ℝ) ≤ Y) (hT0 : ∀ z ∈ T, z ≠ 0) : (∑ z ∈ T, ‖P z‖ ^ 2) ≤ (nonzeroRowMajorantSum P Y).re := by have hs := nonzeroRowMajorant_summable P Y hY unfold nonzeroRowMajorantSum rw [Complex.re_tsum hs] calc _ = ∑ z ∈ T, (if z = 0 then (0 : ℂ) else rowMajorant (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖P z‖ ^ 2) : ℂ)).re := by apply Finset.sum_congr rfl intro z hz have hratio : |‖eisEmbedding z‖ ^ 2 / Y| ≤ 1 := by rw [abs_of_nonneg (div_nonneg (sq_nonneg _) hY.le)] apply (div_le_one hY).2 rw [eisEmbedding_norm_sq_eq_absNorm_span] exact hT z hz rw [ite_eq_right (hT0 z hz), rowMajorant_one _ hratio, one_mul, Complex.ofReal_re] _ ≤ _ := by apply (Complex.hasSum_re hs.hasSum).summable.sum_le_tsum intro z hz split_ifs · norm_num · simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] exact mul_nonneg (rowMajorant_nonneg _) (sq_nonneg _) variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem inputConjugateRow_nonzero_correction (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (Y : ℝ) (hY : 0 < Y) : nonzeroRowMajorantSum (inputConjugateRow p hg F Ψ m c d H) Y = (∑' z : O, rowMajorant (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖inputConjugateRow p hg F Ψ m c d H z‖ ^ 2) : ℂ)) - (↑(‖H ∅‖ ^ 2) : ℂ) := by rw [nonzeroRowMajorantSum_eq_sub _ Y hY, inputConjugateRow_zero] theorem firstCoreInputRow_nonzero_correction (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (r : FirstCoreIndex) (t : ℝ) (Y : ℝ) (hY : 0 < Y) : nonzeroRowMajorantSum (firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t) Y = (∑' z : O, rowMajorant (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t z‖ ^ 2) : ℂ)) - (↑(‖firstCoreTest H V y negative t D ∅‖ ^ 2) : ℂ) := by rw [nonzeroRowMajorantSum_eq_sub _ Y hY, firstCoreInputRow_zero] theorem firstCoreInputRow_finite_le_corrected_source (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (V : ℝ → ℂ) (y : Finset ι → ℝ) (c d : O) (r : FirstCoreIndex) (t : ℝ) (T : Finset O) (Y : ℝ) (hY : 0 < Y) (hT : ∀ z ∈ T, (Ideal.absNorm (Ideal.span {z}) : ℝ) ≤ Y) (hT0 : ∀ z ∈ T, z ≠ 0) : (∑ z ∈ T, ‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t z‖ ^ 2) ≤ (∑' z : O, rowMajorant (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t z‖ ^ 2) : ℂ)).re - ‖firstCoreTest H V y negative t D ∅‖ ^ 2 := by have h := finite_nonzero_row_energy_le_majorant (firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t) T Y hY hT hT0 rw [firstCoreInputRow_nonzero_correction p hg F D B v ε₁ ε₂ negative χ Ψ m H V y c d r t Y hY, Complex.sub_re, Complex.ofReal_re] at h exact h end section open scoped BigOperators Classical open MeasureTheory open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter) end section open scoped BigOperators Classical section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct cubeRadical aLabel jLabel j2Label squarefreeLabel b0Label bit retained parity b0Exponent) lemma span_dvd_of_element_dvd {a b : O} (h : a ∣ b) : (Ideal.span {a} : Ideal O) ∣ Ideal.span {b} := by obtain ⟨c, rfl⟩ := h exact ⟨Ideal.span {c}, (Ideal.span_singleton_mul_span_singleton a c).symm⟩ variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma primeProduct_add (B : Finset ι) (u v : ι → ℕ) : primeProduct p B (fun i => u i + v i) = primeProduct p B u * primeProduct p B v := by simp only [primeProduct, pow_add, Finset.prod_mul_distrib] omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma aLabel_dvd_primeProduct (B : Finset ι) (v : ι → ℕ) (ε : ι → Bool) (hv : ∀ i ∈ B, 0 < v i) : aLabel p B ε ∣ primeProduct p B v := by unfold aLabel primeProduct apply Finset.prod_dvd_prod_of_dvd intro i hi apply pow_dvd_pow cases h : ε i <;> simp only [bit, h, Bool.false_eq_true, ite_false, ite_true] · exact Nat.zero_le _ · exact hv i hi omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem cubeRadical_dvd_jLabel_b0 (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ i ∈ B, 0 < v i) : cubeRadical p B ∣ jLabel p B v ε₁ ε₂ * b0Label p B v ε₁ ε₂ := by have hle (i : ι) (hi : i ∈ B) : 1 ≤ bit (retained (parity (v i)) (ε₁ i) (ε₂ i)) + b0Exponent (v i) (ε₁ i) (ε₂ i) := by cases h : retained (parity (v i)) (ε₁ i) (ε₂ i) · have hp := FirstPassCubeLabels.b0Exponent_pos_of_not_retained (v i) (ε₁ i) (ε₂ i) (hv i hi) h simp only [bit, Bool.false_eq_true, ite_false, zero_add] omega · simp only [bit, ite_true] omega have hd := Finset.prod_dvd_prod_of_dvd (s := B) (fun i => p i ^ 1) (fun i => p i ^ (bit (retained (parity (v i)) (ε₁ i) (ε₂ i)) + b0Exponent (v i) (ε₁ i) (ε₂ i))) (fun i hi => pow_dvd_pow (p i) (hle i hi)) simpa only [cubeRadical, jLabel, b0Label, primeProduct, pow_one, pow_add, Finset.prod_mul_distrib] using hd def actualSecondTuple (B C D E V : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (k : O) : SecondPassFiber.OldTuple where core := ![Ideal.span {jLabel p B (fun i => v₁ i + v₂ i) ε₁ ε₂}, ∏ i ∈ C, Ideal.span {p i}, ∏ i ∈ E, Ideal.span {p i}, Ideal.span {squarefreeLabel p B (fun i => v₁ i + v₂ i)}, Ideal.span {primeProduct p B v₁}, Ideal.span {aLabel p B ε₁}, Ideal.span {aLabel p B ε₂}, ∏ i ∈ D, Ideal.span {p i}] v := ∏ i ∈ V, Ideal.span {p i} j2 := Ideal.span {j2Label p B (fun i => v₁ i + v₂ i) ε₁ ε₂} b2 := Ideal.span {primeProduct p B v₂} row := k def actualSecondLabel (B C E V : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) : Ideal O := Ideal.span {jLabel p B (fun i => v₁ i + v₂ i) ε₁ ε₂} * (∏ i ∈ C, Ideal.span {p i}) * (∏ i ∈ E, Ideal.span {p i}) * (∏ i ∈ V, Ideal.span {p i}) def actualSecondRow (D E : Finset ι) (k : O) : O := primeSubsetGenerator (fun i => Ideal.span {p i}) D * primeSubsetGenerator (fun i => Ideal.span {p i}) E * k omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem actualSecondTuple_valid (B C D E V : Finset ι) (hCB : Disjoint C B) (hD : D ⊆ C ∪ B) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ i ∈ B, 0 < v₁ i + v₂ i) (k : O) : SecondPassFiber.Valid (actualSecondTuple p B C D E V v₁ v₂ ε₁ ε₂ k) (actualSecondLabel p B C E V v₁ v₂ ε₁ ε₂) (Ideal.span {b0Label p B (fun i => v₁ i + v₂ i) ε₁ ε₂}) (actualSecondRow p D E k) := by have hJ := congrArg (fun a : O => (Ideal.span {a} : Ideal O)) (FirstPassCubeLabels.jLabel_eq_squarefree_mul_j2 p B (fun i => v₁ i + v₂ i) ε₁ ε₂) have hb := congrArg (fun a : O => (Ideal.span {a} : Ideal O)) (FirstPassCubeLabels.cube_product_decomposition p B (fun i => v₁ i + v₂ i) ε₁ ε₂ hv) rw [primeProduct_add] at hb have hA₁ := span_dvd_of_element_dvd (aLabel_dvd_primeProduct p B (fun i => v₁ i + v₂ i) ε₁ hv) have hA₂ := span_dvd_of_element_dvd (aLabel_dvd_primeProduct p B (fun i => v₁ i + v₂ i) ε₂ hv) rw [primeProduct_add, ← Ideal.span_singleton_mul_span_singleton] at hA₁ hA₂ have hrad := span_dvd_of_element_dvd (cubeRadical_dvd_jLabel_b0 p B (fun i => v₁ i + v₂ i) ε₁ ε₂ hv) rw [← Ideal.span_singleton_mul_span_singleton] at hrad have hD' : (∏ i ∈ D, Ideal.span {p i}) ∣ (∏ i ∈ C, Ideal.span {p i}) * Ideal.span {cubeRadical p B} := by have hh := Finset.prod_dvd_prod_of_subset D (C ∪ B) (fun i => (Ideal.span {p i} : Ideal O)) hD rw [Finset.prod_union hCB] at hh simpa only [cubeRadical, FiniteGaussPhase.span_finset_prod] using hh have hD'' := hD'.trans (mul_dvd_mul_left (∏ i ∈ C, (Ideal.span {p i} : Ideal O)) hrad) constructor · rfl · change Ideal.span {squarefreeLabel p B (fun i => v₁ i + v₂ i)} * Ideal.span {j2Label p B (fun i => v₁ i + v₂ i) ε₁ ε₂} = Ideal.span {jLabel p B (fun i => v₁ i + v₂ i) ε₁ ε₂} simpa only [← Ideal.span_singleton_mul_span_singleton] using hJ.symm · change Ideal.span {primeProduct p B v₁} * Ideal.span {primeProduct p B v₂} = Ideal.span {b0Label p B (fun i => v₁ i + v₂ i) ε₁ ε₂} ^ 2 * Ideal.span {j2Label p B (fun i => v₁ i + v₂ i) ε₁ ε₂} ^ 2 * Ideal.span {squarefreeLabel p B (fun i => v₁ i + v₂ i)} simpa only [pow_two, ← Ideal.span_singleton_mul_span_singleton] using hb · exact hA₁ · exact hA₂ · apply hD''.trans refine ⟨(∏ i ∈ E, Ideal.span {p i}) * (∏ i ∈ V, Ideal.span {p i}), ?_⟩ simp only [actualSecondLabel] ring · rfl omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem actualSecondLabel_span (B C E V : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) : Ideal.span {(primeSubsetGenerator (fun i => Ideal.span {p i}) C * jLabel p B (fun i => v₁ i + v₂ i) ε₁ ε₂ * primeSubsetGenerator (fun i => Ideal.span {p i}) E * (∏ i ∈ V, p i))} = actualSecondLabel p B C E V v₁ v₂ ε₁ ε₂ := by simp only [actualSecondLabel, ← Ideal.span_singleton_mul_span_singleton, primeSubsetGenerator, ConcretePrimeRowBridge.span_idealGenerator, FiniteGaussPhase.span_finset_prod] ring end open ActualEisensteinCubic open FirstPassCubeLabels (jLabel b0Label primeProductNorm) structure SecondSupportData (ι : Type*) where common : Finset ι firstDivisor : Finset ι secondDivisor : Finset ι overlap : Finset ι frequency : O protected theorem SecondSupportData.ext {ι : Type*} {x y : SecondSupportData ι} (common : x.common = y.common) (firstDivisor : x.firstDivisor = y.firstDivisor) (secondDivisor : x.secondDivisor = y.secondDivisor) (overlap : x.overlap = y.overlap) (frequency : x.frequency = y.frequency) : x = y := by cases x cases y cases common cases firstDivisor cases secondDivisor cases overlap cases frequency rfl variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] def secondSupportLabel (B : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (x : SecondSupportData ι) : O := primeSubsetGenerator (fun i => Ideal.span {p i}) x.common * jLabel p B (fun i => v₁ i + v₂ i) ε₁ ε₂ * primeSubsetGenerator (fun i => Ideal.span {p i}) x.secondDivisor * (∏ i ∈ x.overlap, p i) def secondSupportNewLabel (B : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (x : SecondSupportData ι) : Ideal O := actualSecondLabel p B x.common x.secondDivisor x.overlap v₁ v₂ ε₁ ε₂ def secondSupportRow (x : SecondSupportData ι) : O := actualSecondRow p x.firstDivisor x.secondDivisor x.frequency omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem secondSupportLabel_span (B : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (x : SecondSupportData ι) : Ideal.span {secondSupportLabel p B v₁ v₂ ε₁ ε₂ x} = secondSupportNewLabel p B v₁ v₂ ε₁ ε₂ x := actualSecondLabel_span p B x.common x.secondDivisor x.overlap v₁ v₂ ε₁ ε₂ omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem sector_b0_ne_bot (hp : ∀ i, p i ≠ 0) (B : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) : (Ideal.span {b0Label p B (fun i => v₁ i + v₂ i) ε₁ ε₂} : Ideal O) ≠ ⊥ := by apply Ideal.span_singleton_eq_bot.not.mpr exact Finset.prod_ne_zero_iff.mpr (fun i hi => pow_ne_zero _ (hp i)) def secondSectorZ (X X₀ : ℝ) (x : SecondSupportData ι) : ℝ := Real.log (primeProductNorm p x.overlap * X₀ / X) def secondSectorUd (D : ℝ) (x : SecondSupportData ι) : ℝ := Real.log (‖ConcreteTraceCRT.eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) x.firstDivisor)‖ ^ 2 / D) def secondSectorUe (E : ℝ) (x : SecondSupportData ι) : ℝ := Real.log (‖ConcreteTraceCRT.eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) x.secondDivisor)‖ ^ 2 / E) def secondSectorUv (V₀ : ℝ) (x : SecondSupportData ι) : ℝ := Real.log (primeProductNorm p x.overlap / V₀) def secondSectorKap (K : ℝ) (x : SecondSupportData ι) : ℝ := Real.log (‖ConcreteTraceCRT.eisEmbedding (secondSupportRow p x)‖ ^ 2 / K) end open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform open ActualEisensteinCubic open SecondPassIntegration (tupleSourceSum tupleSource_uniform_transfer childGeometricMean) open JointLogSeparation open FirstPassCubeLabels (b0Label) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.FixedProfiles namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (columnLog) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) theorem secondGaussTerm_test_factors (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (H₁ H₂ : Finset ι → ℂ) (S T : Finset ι) : secondGaussTerm p hp hg hinj Ψ₁ Ψ₂ m r c d e k H₁ H₂ S T = star (H₁ S) * H₂ T * secondGaussTerm p hp hg hinj Ψ₁ Ψ₂ m r c d e k (fun _ => 1) (fun _ => 1) S T := by simp only [secondGaussTerm, secondInputCoefficient, star_mul, mul_one] ring end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap ContDiff namespace SecondPassIntegration section open ActualEisensteinCubic JointLogSeparation FirstPassCubeLabels SecondPassArithmetic open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) include hp in theorem radialPairKernel_dyadic_normalization (V N M : Finset ι) (hVN : Disjoint V N) (hVM : Disjoint V M) (d e k : O) (hd : d ≠ 0) (he : e ≠ 0) (hk : k ≠ 0) (D E V₀ X X₀ K Y : ℝ) (hD : 0 < D) (hE : 0 < E) (hV₀ : 0 < V₀) (hX : 0 < X) (hX₀ : 0 < X₀) (hK : 0 < K) (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g₁ g₂ W : 𝓢(ℝ, ℂ)) (hU₁ : ∀ s, g₁ s ≠ 0 → U s = 1) (hU₂ : ∀ s, g₂ s ≠ 0 → U s = 1) : radialPairKernel p e k W g₁ g₂ X X Y (V∪N) (V∪M) = (X : ℂ)⁻¹ * (conjugateProfile (halfNormalizationCLM U g₁) (Real.log (primeProductNorm p V * X₀ / X) + columnLog p X₀ N) * halfNormalizationCLM U g₂ (Real.log (primeProductNorm p V * X₀ / X) + columnLog p X₀ M) * EisensteinSchwartzPoisson.paperRadialFourier W ((Y * K / (D * E ^ 2 * V₀ ^ 2 * X₀ ^ 2)) * Real.exp (Real.log (elementNorm (d*e*k) / K) - Real.log (elementNorm d / D) - 2*Real.log (elementNorm e / E) - 2*Real.log (primeProductNorm p V / V₀) - columnLog p X₀ N - columnLog p X₀ M))) := by unfold radialPairKernel rw [normalizedColumn_pair_union p hp V N M hVN hVM X X₀ hX hX₀ U hUc hUs g₁ g₂ hU₁ hU₂, second_radial_dyadic_argument p hp V N M hVN hVM d e k hd he hk D E V₀ X₀ K Y hD hE hV₀ hX₀ hK] ring variable [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem secondChildKernelPair_eq_postCommon (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (hd : d ≠ 0) (he : e ≠ 0) (hk : k ≠ 0) (D E V₀ X X₀ K Y : ℝ) (hD : 0 < D) (hE : 0 < E) (hV₀ : 0 < V₀) (hX : 0 < X) (hX₀ : 0 < X₀) (hK : 0 < K) (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g₁ g₂ W : 𝓢(ℝ, ℂ)) (hU₁ : ∀ s, g₁ s ≠ 0 → U s = 1) (hU₂ : ∀ s, g₂ s ≠ 0 → U s = 1) (windows : Fin 7 → ℝ → ℂ) : let A₁ := conjugateProfile (halfNormalizationCLM U g₁) let A₂ := halfNormalizationCLM U g₂ let z := Real.log (primeProductNorm p V * X₀ / X) let ud := Real.log (elementNorm d / D) let ue := Real.log (elementNorm e / E) let uv := Real.log (primeProductNorm p V / V₀) let kap := Real.log (elementNorm (d*e*k) / K) outerWindow windows z ud ue uv kap = 1 → (∀ a : ℝ, A₁ (z+a) ≠ 0 → windows 5 a = 1) → (∀ a : ℝ, A₂ (z+a) ≠ 0 → windows 6 a = 1) → secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k (-k) (radialPairKernel p e k W g₁ g₂ X X Y) = (X : ℂ)⁻¹ * postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k) (d*e*(-k)) A₁ A₂ W windows z ud ue uv kap X₀ X₀ (Y*K/(D*E^2*V₀^2*X₀^2)) := by dsimp only intro houter hcut₁ hcut₂ rw [secondChildKernelPair_fixed_pool] simp only [postCommonSmoothPair, Finset.mul_sum] apply Finset.sum_congr rfl intro N hN apply Finset.sum_congr rfl intro M hM by_cases hVN : Disjoint V N · by_cases hVM : Disjoint V M · rw [radialPairKernel_dyadic_normalization p hp V N M hVN hVM d e k hd he hk D E V₀ X X₀ K Y hD hE hV₀ hX hX₀ hK U hUc hUs g₁ g₂ W hU₁ hU₂, houter] by_cases h₁ : conjugateProfile (halfNormalizationCLM U g₁) (Real.log (primeProductNorm p V * X₀ / X) + columnLog p X₀ N) = 0 · rw [h₁]; ring · by_cases h₂ : halfNormalizationCLM U g₂ (Real.log (primeProductNorm p V * X₀ / X) + columnLog p X₀ M) = 0 · rw [h₂]; ring · rw [hcut₁ _ h₁, hcut₂ _ h₂]; ring · rw [secondChildColumn_zero_of_overlap p hp hcop hg Ψ₂ (m*r) c e (d*e*(-k)) (fun _ => 1) V M hVM] ring · rw [secondChildColumn_zero_of_overlap p hp hcop hg Ψ₁ (m*r) c e (d*e*k) (fun _ => 1) V N hVN, star_zero] ring end section open JointLogSeparation theorem halfNormalization_support_bound (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g : 𝓢(ℝ, ℂ)) (A : ℝ) (hg : ∀ s, g s ≠ 0 → |s| ≤ A) : ∀ s, halfNormalizationCLM U g s ≠ 0 → |s| ≤ A := by intro s hs apply hg s intro hzero apply hs rw [halfNormalizationCLM_apply U hUc hUs, hzero, mul_zero] lemma translated_support_bound (g : ℝ → ℂ) (A B z x : ℝ) (hg : ∀ s, g s ≠ 0 → |s| ≤ A) (hz : |z| ≤ B) (hx : g (z+x) ≠ 0) : |x| ≤ A+B := by have ht := hg (z+x) hx have ha : |x| ≤ |z+x| + |z| := by calc |x| = |(z+x)-z| := by congr 1; ring _ ≤ |z+x| + |z| := abs_sub _ _ linarith theorem exists_fixed_sector_windows (A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) : ∃ windows : Fin 7 → ℝ → ℂ, (∀ j, HasCompactSupport (windows j)) ∧ (∀ j, ContDiff ℝ ∞ (windows j)) ∧ (∀ j s, windows j s ≠ 0 → |s| ≤ A+B+1) ∧ (∀ z ud ue uv kap : ℝ, |z| ≤ B → |ud| ≤ B → |ue| ≤ B → |uv| ≤ B → |kap| ≤ B → outerWindow windows z ud ue uv kap = 1) ∧ (∀ (g : ℝ → ℂ) (z : ℝ), (∀ s, g s ≠ 0 → |s| ≤ A) → |z| ≤ B → ∀ j x, g (z+x) ≠ 0 → windows j x = 1) := by obtain ⟨w, hwc, hws, hweq, hwsupp, hwzero⟩ := FourierBridge.exists_complex_smooth_cutoff (A+B) (add_nonneg hA hB) refine ⟨fun _ => w, fun _ => hwc, fun _ => hws, ?_, ?_, ?_⟩ · intro j s hs have hh := hwsupp (subset_closure hs) exact abs_le.mpr hh · intro z ud ue uv kap hz hd he hv hk have heq (s : ℝ) (hs : |s| ≤ B) : w s = 1 := hweq s (by linarith) simp only [outerWindow, heq z hz, heq ud hd, heq ue he, heq uv hv, heq kap hk, one_mul] · intro g z hg hz j x hx exact hweq x (translated_support_bound g A B z x hg hz hx) end open ActualEisensteinCubic JointLogSeparation FirstPassCubeLabels SecondPassArithmetic theorem exists_fixed_normalized_child_tests {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (g₁ g₂ W : 𝓢(ℝ, ℂ)) (A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hg₁ : ∀ s, g₁ s ≠ 0 → |s| ≤ A) (hg₂ : ∀ s, g₂ s ≠ 0 → |s| ≤ A) : ∃ (A₁ A₂ : 𝓢(ℝ, ℂ)) (windows : Fin 7 → ℝ → ℂ), (∀ j, HasCompactSupport (windows j)) ∧ (∀ j, ContDiff ℝ ∞ (windows j)) ∧ (∀ j s, windows j s ≠ 0 → |s| ≤ A+B+1) ∧ ∀ (D E V₀ X X₀ K Y : ℝ), 0 < D → 0 < E → 0 < V₀ → 0 < X → 0 < X₀ → 0 < K → ∀ (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O), d ≠ 0 → e ≠ 0 → k ≠ 0 → |Real.log (primeProductNorm p V * X₀ / X)| ≤ B → |Real.log (elementNorm d / D)| ≤ B → |Real.log (elementNorm e / E)| ≤ B → |Real.log (primeProductNorm p V / V₀)| ≤ B → |Real.log (elementNorm (d*e*k) / K)| ≤ B → secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k (-k) (radialPairKernel p e k W g₁ g₂ X X Y) = (X : ℂ)⁻¹ * postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k) (d*e*(-k)) A₁ A₂ W windows (Real.log (primeProductNorm p V * X₀ / X)) (Real.log (elementNorm d / D)) (Real.log (elementNorm e / E)) (Real.log (primeProductNorm p V / V₀)) (Real.log (elementNorm (d*e*k) / K)) X₀ X₀ (Y*K/(D*E^2*V₀^2*X₀^2)) := by obtain ⟨U, hUc, hUs, hUone, hUsupp, hUzero⟩ := FourierBridge.exists_complex_smooth_cutoff A hA have hU₁ : ∀ s, g₁ s ≠ 0 → U s = 1 := fun s hs => hUone s (hg₁ s hs) have hU₂ : ∀ s, g₂ s ≠ 0 → U s = 1 := fun s hs => hUone s (hg₂ s hs) let A₁ := conjugateProfile (halfNormalizationCLM U g₁) let A₂ := halfNormalizationCLM U g₂ have hA₁ : ∀ s, A₁ s ≠ 0 → |s| ≤ A := by intro s hs apply halfNormalization_support_bound U hUc hUs g₁ A hg₁ s intro hz exact hs (by simp [A₁, conjugateProfile_apply, hz]) have hA₂ : ∀ s, A₂ s ≠ 0 → |s| ≤ A := halfNormalization_support_bound U hUc hUs g₂ A hg₂ obtain ⟨windows, hwc, hws, hwb, hwo, hwt⟩ := exists_fixed_sector_windows A B hA hB refine ⟨A₁, A₂, windows, hwc, hws, hwb, ?_⟩ intro D E V₀ X X₀ K Y hD hE hV₀ hX hX₀ hK F V Ψ₁ Ψ₂ m r c d e k hd he hk hz hud hue huv hkap apply secondChildKernelPair_eq_postCommon p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k hd he hk D E V₀ X X₀ K Y hD hE hV₀ hX hX₀ hK U hUc hUs g₁ g₂ W hU₁ hU₂ windows · exact hwo _ _ _ _ _ hz hud hue huv hkap · exact fun a ha => hwt A₁ _ hA₁ hz 5 a ha · exact fun a ha => hwt A₂ _ hA₂ hz 6 a ha end SecondPassIntegration namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (jLabel) open SecondPassIntegration (exists_fixed_normalized_child_tests elementNorm) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end open ActualEisensteinCubic open FiniteGaussPhase (canonicalProductGauss_cross_factors) open FirstCauchyArithmetic (activeGaussRowFactor supportMobius) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) theorem activeGaussRowFactor_zero_of_ne (S T : Finset ι) (hne : S ≠ T) (e : O) : activeGaussRowFactor p hp hinj hg S T e 0 = 0 := by have hs : (activeSupport S T).Nonempty := by by_contra hn apply hne have he : activeSupport S T = ∅ := Finset.not_nonempty_iff_eq_empty.mp hn simp only [activeSupport, Finset.union_eq_empty, Finset.sdiff_eq_empty_iff_subset] at he exact Finset.Subset.antisymm he.1 he.2 let : Nonempty (activeSupport S T) := hs.to_subtype unfold activeGaussRowFactor simp only [finiteSexticRow_zero, star_zero, mul_zero] theorem activeGaussRowFactor_empty (e k : O) : activeGaussRowFactor p hp hinj hg ∅ ∅ e k = 1 := by have hempty : activeSupport (∅ : Finset ι) ∅ = ∅ := by simp [activeSupport] let : IsEmpty (activeSupport (∅ : Finset ι) ∅) := ⟨fun x => by simpa [hempty] using x.property⟩ simp only [activeGaussRowFactor, finiteSexticRow, star_one, mul_one, canonicalProductGauss_cross_factors, Fintype.prod_empty] theorem secondGaussTerm_empty (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (H₁ H₂ : Finset ι → ℂ) : secondGaussTerm p hp hg hinj Ψ₁ Ψ₂ m r c d e k H₁ H₂ ∅ ∅ = star (H₁ ∅) * H₂ ∅ := by have hm : supportMobius (fun i => Ideal.span {p i}) ∅ = 1 := by change (UniqueFactorizationMonoid.moebius (1 : Ideal O) : ℂ) = 1 exact_mod_cast UniqueFactorizationMonoid.moebius_one simp only [secondGaussTerm, hm, one_mul, secondInputCoefficient, Finset.prod_empty, map_one, activeGaussRowFactor_empty, mul_one] simp [rowCoprimeMask, finiteSquarefreeRow] theorem secondFrequencyKernel_zero (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e : O) (H₁ H₂ : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : secondFrequencyKernel p hp hg hinj F Ψ₁ Ψ₂ m r c d e 0 H₁ H₂ W Y = (Y : ℂ) * EisensteinSchwartzPoisson.paperRadialFourier W 0 * star (H₁ ∅) * H₂ ∅ := by have hz (S T : Finset ι) (hne : S ≠ T) : secondGaussTerm p hp hg hinj Ψ₁ Ψ₂ m r c d e 0 H₁ H₂ S T = 0 := by unfold secondGaussTerm rw [activeGaussRowFactor_zero_of_ne p hp hg hinj T S (Ne.symm hne) e, mul_zero] unfold secondFrequencyKernel rw [Finset.sum_eq_single ∅] · rw [Finset.sum_eq_single ∅] · simp [secondGaussTerm_empty, mul_assoc] · intro T hT hne rw [hz ∅ T (Ne.symm hne)] simp · simp · intro S hS hne apply Finset.sum_eq_zero intro T hT by_cases hd : Disjoint S T · have hneq : S ≠ T := by intro heq subst T exact hne ((show S = ∅ by simpa using Finset.disjoint_iff_inter_eq_empty.mp hd)) rw [hz S T hneq] simp · simp [hd] · simp end SecondPassArithmetic open MeasureTheory Set Filter open scoped BigOperators Classical namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma symbol_cube_numerator (a d : O) (hd : denominatorCondition (a^3) d) : symbol (a^3) d=1 := by have hprimary : lambda^2 ∣ d-1 := lambda_sq_dvd_three.trans hd.2 rw [symbol_pow_numerator a d hprimary 3] apply symbol_cube_of_isCoprime a d hprimary exact hd.1.of_isCoprime_of_dvd_left ⟨a^2,by ring⟩ theorem arithmeticResidueSum_cube (a : O) (ha : a ≠ 0) : arithmeticResidueSum 0 (a^3)=(Nat.card (AdmissibleResidue (a^3)):ℂ) := by let : Finite (AdmissibleResidue (a^3)) := finite_admissibleResidue _ (pow_ne_zero 3 ha) let : Fintype (AdmissibleResidue (a^3)) := Fintype.ofFinite _ rw [arithmeticResidueSum,tsum_fintype] have hterm (r : AdmissibleResidue (a^3)) : eisEmbedding (symbol (a^3) (denominatorRep (a^3) r.1))* ShortDraftTrace.breveE (cuspFrequency 0*eisEmbedding (denominatorRep (a^3) r.1)/ eisEmbedding (a^3))=1 := by rw [symbol_cube_numerator a _ r.2,map_one] simp [cuspFrequency] simp only [hterm,Finset.sum_const,Finset.card_univ,nsmul_eq_mul,mul_one,Nat.card_eq_fintype_card] lemma admissibleResidue_nonempty (c : O) (hc : c ≠ 0) : Nonempty (AdmissibleResidue c) := by let d : AdmissibleDenominator c := ⟨1,isCoprime_one_right,by simp⟩ exact ⟨((residueDenominatorEquiv c hc).symm d).1⟩ theorem arithmeticResidueSum_cube_ne_zero (a : O) (ha : a ≠ 0) : arithmeticResidueSum 0 (a^3) ≠ 0 := by rw [arithmeticResidueSum_cube a ha] let : Finite (AdmissibleResidue (a^3)) := finite_admissibleResidue _ (pow_ne_zero 3 ha) let : Nonempty (AdmissibleResidue (a^3)) := admissibleResidue_nonempty _ (pow_ne_zero 3 ha) exact Nat.cast_ne_zero.mpr (Nat.card_pos (α := AdmissibleResidue (a^3))).ne' lemma denominatorCondition_congr (c d e : O) (h : 3*c ∣ d-e) : denominatorCondition c d ↔ denominatorCondition c e := by obtain ⟨n,hn⟩ := h have hd : d=e+3*c*n := by linear_combination hn rw [hd] exact denominatorCondition_shift c e n lemma denominatorCondition_mul (c d t : O) (hd : denominatorCondition c d) (ht : denominatorCondition c t) : denominatorCondition c (d*t) := by refine ⟨hd.1.mul_right ht.1,?_⟩ convert dvd_add (hd.2.mul_right t) ht.2 using 1 ; ring lemma row_symbol_congr_modulus (c d e : O) (hlevel : (3:O) ∣ c) (he : (3:O) ∣ e-1) (h : 3*c ∣ d-e) : symbol c d=symbol c e := by obtain ⟨n,hn⟩ := h have hd : d=e+3*c*n := by linear_combination hn rw [hd] exact row_symbol_shift c e n hlevel he lemma denominatorRep_product_congr (c t : O) (r : DenominatorResidue c) : 3*c ∣ denominatorRep c (Ideal.Quotient.mk (Ideal.span {3*c}) t*r)-t*denominatorRep c r := by apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp rw [denominatorRep_spec,map_mul,denominatorRep_spec] def residueMultiplication (c t : O) (ht : denominatorCondition c t) (r : AdmissibleResidue c) : AdmissibleResidue c := ⟨Ideal.Quotient.mk (Ideal.span {3*c}) t*r.1, (denominatorCondition_congr c _ _ (denominatorRep_product_congr c t r.1)).2 (denominatorCondition_mul c t _ ht r.2)⟩ lemma denominatorCondition_coprime_modulus (c t : O) (ht : denominatorCondition c t) : IsCoprime (3*c) t := by obtain ⟨n,hn⟩ := ht.2 have h3 : IsCoprime (3:O) t := ⟨-n,1,by linear_combination hn⟩ exact h3.mul_left ht.1 lemma residueMultiplication_injective (c t : O) (ht : denominatorCondition c t) : Function.Injective (residueMultiplication c t ht) := by have hunit : IsUnit (Ideal.Quotient.mk (Ideal.span {3*c}) t) := by have hh := (denominatorCondition_coprime_modulus c t ht).map (Ideal.Quotient.mk (Ideal.span {3*c})) have hz : Ideal.Quotient.mk (Ideal.span {3*c}) (3*c)=0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.subset_span (by simp)) simpa only [hz,isCoprime_zero_left] using hh intro r q heq apply Subtype.ext exact hunit.mul_left_cancel (congrArg Subtype.val heq) def residueMultiplicationEquiv (c : O) (hc : c ≠ 0) (t : O) (ht : denominatorCondition c t) : AdmissibleResidue c ≃ AdmissibleResidue c := by letI : Finite (AdmissibleResidue c) := finite_admissibleResidue c hc exact Equiv.ofBijective (residueMultiplication c t ht) ⟨residueMultiplication_injective c t ht, Finite.surjective_of_injective (residueMultiplication_injective c t ht)⟩ lemma residueMultiplication_phase (c : O) (hlevel : (3:O) ∣ c) (t : O) (ht : denominatorCondition c t) (r : AdmissibleResidue c) : symbol c (denominatorRep c (residueMultiplication c t ht r).1)= symbol c t*symbol c (denominatorRep c r.1) := by change symbol c (denominatorRep c (Ideal.Quotient.mk (Ideal.span {3*c}) t*r.1))= symbol c t*symbol c (denominatorRep c r.1) rw [row_symbol_congr_modulus c _ (t*denominatorRep c r.1) hlevel (denominatorCondition_mul c t _ ht r.2).2 (denominatorRep_product_congr c t r.1)] exact symbol_mul_denominator c t (denominatorRep c r.1) lemma arithmeticResidueSum_zero (c : O) : arithmeticResidueSum 0 c=∑' r : AdmissibleResidue c, eisEmbedding (symbol c (denominatorRep c r.1)) := by simp only [arithmeticResidueSum,cuspFrequency,map_zero,zero_div,zero_mul, AddChar.map_zero_eq_one,mul_one] theorem arithmeticResidueSum_constant_eigen (c : O) (hc : c ≠ 0) (hlevel : (3:O) ∣ c) (t : O) (ht : denominatorCondition c t) : eisEmbedding (symbol c t)*arithmeticResidueSum 0 c=arithmeticResidueSum 0 c := by rw [arithmeticResidueSum_zero] have heq := (residueMultiplicationEquiv c hc t ht).tsum_eq (fun r : AdmissibleResidue c => eisEmbedding (symbol c (denominatorRep c r.1))) calc _ = ∑' r : AdmissibleResidue c,eisEmbedding (symbol c t*symbol c (denominatorRep c r.1)) := by simp only [map_mul,tsum_mul_left] _ = _ := by convert heq using 1 apply tsum_congr intro r exact congrArg eisEmbedding (residueMultiplication_phase c hlevel t ht r).symm theorem arithmeticResidueSum_ne_zero_forces_trivial (c : O) (hc : c ≠ 0) (hlevel : (3:O) ∣ c) (hA : arithmeticResidueSum 0 c ≠ 0) : ∀ t : O, denominatorCondition c t → symbol c t=1 := by intro t ht apply eisEmbedding_injective rw [map_one] apply (mul_right_cancel₀ hA) rw [arithmeticResidueSum_constant_eigen c hc hlevel t ht,one_mul] end CubicEisenstein open MeasureTheory Set Filter open scoped BigOperators Classical namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma coprime_of_dvd_sub_one (a b : O) (h : a ∣ b-1) : IsCoprime a b := by obtain ⟨r,hr⟩ := h exact ⟨-r,1,by linear_combination hr⟩ lemma primary_coprime_three (p : O) (hp : lambda^2 ∣ p-1) : IsCoprime p (3:O) := (coprime_of_dvd_sub_one 3 p (three_dvd_primary_sub_one p hp)).symm lemma exists_one_mod_and_prescribed (p m x : O) (hpm : IsCoprime p m) : ∃ t : O, m ∣ t-1 ∧ p ∣ t-x := by obtain ⟨r,u,hu⟩ := hpm refine ⟨1+m*u*(x-1),⟨u*(x-1),by ring⟩,⟨-r*(x-1),?_⟩⟩ linear_combination (x-1)*hu theorem constant_coefficient_primary_prime_exponent (c p b : O) (n : ℕ) (hc : c ≠ 0) (hlevel : (3:O) ∣ c) (hp : Prime p) (hprimary : lambda^2 ∣ p-1) (hpb : ¬p ∣ b) (hfactor : c=p^n*b) (hA : arithmeticResidueSum 0 c ≠ 0) : 3 ∣ n := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO by_contra hn let P : Ideal O := Ideal.span {p} let : P.IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible have hg : lambda ∉ P := primary_maximal_divisor_good p hprimary P (Ideal.subset_span (by simp [])) have hchar : (cubicChar P hg)^n ≠ 1 := by intro heq have hd := orderOf_dvd_of_pow_eq_one heq rw [cubicChar_order P hg] at hd exact hn hd obtain ⟨u,hu⟩ := MulChar.ne_one_iff.mp hchar rw [MulChar.pow_apply_coe] at hu obtain ⟨x,hx⟩ := Ideal.Quotient.mk_surjective (u : O ⧸ P) have hp9 : IsCoprime p (9:O) := by simpa only [show (3:O)^2=9 by norm_num] using (primary_coprime_three p hprimary).pow_right (n := 2) have hpm : IsCoprime p (9*b) := hp9.mul_right (hp.coprime_iff_not_dvd.mpr hpb) obtain ⟨t,htm,htp⟩ := exists_one_mod_and_prescribed p (9*b) x hpm have h9 : (9:O) ∣ t-1 := (dvd_mul_right 9 b).trans htm have hb : b ∣ t-1 := (dvd_mul_left b 9).trans htm have h3 : (3:O) ∣ t-1 := (show (3:O) ∣ 9 from ⟨3,by norm_num⟩).trans h9 have htprimary : lambda^2 ∣ t-1 := lambda_sq_dvd_three.trans h3 have htu : Ideal.Quotient.mk P t=(u : O ⧸ P) := by rw [← hx] exact (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr (Ideal.mem_span_singleton.mpr htp) have hpt : IsCoprime p t := hp.coprime_iff_not_dvd.mpr (by intro hdiv have hz : Ideal.Quotient.mk P t=0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr hdiv) rw [htu] at hz exact Units.ne_zero u hz) have hbt : IsCoprime b t := coprime_of_dvd_sub_one b t hb have hct : IsCoprime c t := by rw [hfactor] exact hpt.pow_left.mul_left hbt have htriv := arithmeticResidueSum_ne_zero_forces_trivial c hc hlevel hA t ⟨hct,h3⟩ have hbsym : symbol b t=1 := by have hh := symbol_denominator_congr b t 1 htprimary (by simp) h9 hb simpa only [symbol_one] using hh have hpsym : symbol p t=cubicChar P hg (u : O ⧸ P) := by rw [symbol_reciprocity p t hp.ne_zero (primary_ne_zero t htprimary) hprimary htprimary] change idealSymbol P t=_ rw [idealSymbol_prime P hg,htu] rw [hfactor,symbol_mul_numerator _ _ t htprimary,symbol_pow_numerator p t htprimary, hbsym,mul_one,hpsym] at htriv exact hu htriv end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ConstantTermSupport namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CubicEisenstein open MeasureTheory Set Filter open scoped BigOperators Classical section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal UniqueFactorizationMonoid lemma multiset_cube_remainder {α : Type*} [DecidableEq α] (s : Multiset α) (p : α) (hdiv : ∀ q, q ≠ p → 3 ∣ s.count q) : ∃ t : Multiset α, s=(s.count p % 3) • {p} + 3 • t := by let t := Finsupp.toMultiset (s.toFinsupp.mapRange (fun n : ℕ => n/3) (by decide)) refine ⟨t,?_⟩ apply Multiset.ext.mpr intro q simp only [Multiset.count_add,Multiset.count_nsmul,Multiset.count_singleton, t,Finsupp.count_toMultiset,Finsupp.mapRange_apply,Multiset.toFinsupp_apply] by_cases hq : q=p · subst q simp only [ite_true,mul_one] omega · simp only [hq,ite_false,mul_zero,zero_add] exact (Nat.mul_div_cancel' (hdiv q hq)).symm lemma residue_lambda_prime : Prime lambda := by letI := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK let : Fact (Nat.Prime 3) := ⟨Nat.prime_three⟩ exact (IsCyclotomicExtension.zeta_spec 3 ℚ K).zeta_sub_one_prime' lemma constant_coefficient_unramified_count [NormalizationMonoid O] (c : O) (hc : c ≠ 0) (hlevel : (3:O) ∣ c) (hA : arithmeticResidueSum 0 c ≠ 0) (q : O) (hq : q ≠ normalize lambda) : letI := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO 3 ∣ (normalizedFactors c).count q := by letI := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO by_cases hmem : q ∈ normalizedFactors c · have hprime := prime_of_normalized_factor q hmem let P : Ideal O := Ideal.span {q} let : P.IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hprime.irreducible have hg : lambda ∉ P := by intro hl have ha : Associated q lambda := hprime.associated_of_dvd residue_lambda_prime (Ideal.mem_span_singleton.mp hl) apply hq exact (normalize_normalized_factor q hmem).symm.trans (normalize_eq_normalize_iff_associated.mpr ha) obtain ⟨p,hP,hprimary,-⟩ := cubicJacobi_exists_primary_generator P hg have hqp : Associated q p := Ideal.span_singleton_eq_span_singleton.mp hP have hp : Prime p := hqp.prime_iff.mp hprime obtain ⟨b,hfactor,hpb⟩ := (FiniteMultiplicity.of_prime_left hp hc).exists_eq_pow_mul_and_not_dvd have hd := constant_coefficient_primary_prime_exponent c p b (multiplicity p c) hc hlevel hp hprimary hpb hfactor hA have hcount := multiplicity_eq_count_normalizedFactors hprime.irreducible hc rw [normalize_normalized_factor q hmem] at hcount rw [← hcount,← multiplicity_eq_of_associated_left hqp] exact hd · rw [Multiset.count_eq_zero.mpr hmem] exact dvd_zero _ theorem constant_coefficient_cube_reduction (c : O) (hc : c ≠ 0) (hlevel : (3:O) ∣ c) (hA : arithmeticResidueSum 0 c ≠ 0) : ∃ (u : Oˣ) (r : ℕ) (a : O), r < 3 ∧ c=(u:O)*lambda^r*a^3 := by letI := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let : StrongNormalizationMonoid O := UniqueFactorizationMonoid.strongNormalizationMonoid let s := normalizedFactors c obtain ⟨t,ht⟩ := multiset_cube_remainder s (normalize lambda) (constant_coefficient_unramified_count c hc hlevel hA) let r := s.count (normalize lambda) % 3 have hprod : s.prod=(normalize lambda)^r*t.prod^3 := by rw [ht,Multiset.prod_add,Multiset.prod_nsmul,Multiset.prod_singleton,Multiset.prod_nsmul] have hassoc : Associated (lambda^r*t.prod^3) c := by have hnorm : Associated ((normalize lambda)^r*t.prod^3) (lambda^r*t.prod^3) := (normalize_associated lambda).pow_pow.mul_right _ apply hnorm.symm.trans rw [← hprod] exact prod_normalizedFactors hc obtain ⟨u,hu⟩ := hassoc refine ⟨u,r,t.prod,Nat.mod_lt _ (by decide),?_⟩ rw [← hu] ring end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified lemma constant_coefficient_ramified_equation (c : O) (hc : c ≠ 0) (hlevel : (3:O) ∣ c) (hA : arithmeticResidueSum 0 c ≠ 0) (u : Oˣ) (r : ℕ) (a : O) (ha : a ≠ 0) (hfactor : c=(u:O)*lambda^r*a^3) (A B : ℤ) : symbol (u:O) (primaryCoord A B)*(cubicExp A)^r=1 := by let t0 := primaryCoord A B have ht0 : lambda^2 ∣ t0-1 := primaryCoord_primary A B obtain ⟨w,hw⟩ := exists_coprime_three_shift t0 3 a ht0 (primary_coprime_three t0 ht0) ha let t := t0+3*w*3 have ht : lambda^2 ∣ t-1 := primary_add_multiple_three t0 3 w ht0 have h9 : (9:O) ∣ t-t0 := ⟨w,by dsimp [t]; ring⟩ have hat : IsCoprime a t := hw.symm have hlt : IsCoprime lambda t := coprime_of_dvd_sub_one lambda t ((show lambda ∣ lambda^2 from ⟨lambda,by ring⟩).trans ht) have hct : IsCoprime c t := by rw [hfactor,show (u:O)*lambda^r*a^3=(u:O)*(lambda^r*a^3) by ring] apply (isCoprime_mul_unit_left_left u.isUnit _ _).mpr exact hlt.pow_left.mul_left hat.pow_left have htriv := arithmeticResidueSum_ne_zero_forces_trivial c hc hlevel hA t ⟨hct,three_dvd_primary_sub_one t ht⟩ have hacube : symbol (a^3) t=1 := by rw [symbol_pow_numerator a t ht 3] exact symbol_cube_of_isCoprime a t ht hat rw [hfactor,symbol_mul_numerator _ _ t ht,symbol_mul_numerator _ _ t ht, symbol_pow_numerator lambda t ht r,hacube,mul_one, symbol_unit_congr_mod_nine (u:O) t t0 u.isUnit ht ht0 h9, symbol_lambda_congr_mod_nine t t0 ht ht0 h9, symbol_lambda_eq_linearRay t0 ht0] at htriv simpa only [t0,linearRay_primaryCoord,one_mul,zero_mul,add_zero] using htriv lemma unit_eq_sign_of_symbol_class (u : Oˣ) (hu : symbol (u:O) (primaryCoord 0 1)=1) : (u:O)=1 ∨ (u:O)=-1 := by letI := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK let ζ := IsCyclotomicExtension.zeta_spec 3 ℚ K let η : Oˣ := (ζ.toInteger_isPrimitiveRoot.isUnit (by decide)).unit have hη : (η:O)=omega := rfl have hlist : u ∈ ([1,-1,η,-η,η^2,-η^2] : List Oˣ) := IsCyclotomicExtension.Rat.Three.Units.mem ζ u have hω : symbol omega (primaryCoord 0 1)=omega^2 := by rw [symbol_omega_eq_linearRay _ (primaryCoord_primary 0 1),linearRay_primaryCoord] norm_num [cubicExp] have hω2 : symbol (omega^2) (primaryCoord 0 1)=omega^4 := by rw [symbol_pow_numerator omega _ (primaryCoord_primary 0 1) 2,hω,← pow_mul] have hn2 : omega^2 ≠ 1 := (omega_primitive.pow_eq_one_iff_dvd 2).not.mpr (by decide) have hn4 : omega^4 ≠ 1 := (omega_primitive.pow_eq_one_iff_dvd 4).not.mpr (by decide) simp only [List.mem_cons,List.mem_nil_iff,or_false] at hlist rcases hlist with h | h | h | h | h | h · exact Or.inl (by rw [h,Units.val_one]) · exact Or.inr (by rw [h,Units.val_neg,Units.val_one]) · exact False.elim (hn2 (by simpa only [h,hη,hω] using hu)) · exact False.elim (hn2 (by simpa only [h,Units.val_neg,hη, (symbol_neg_numerator _ _ (primaryCoord_primary 0 1)),hω] using hu)) · exact False.elim (hn4 (by simpa only [h,Units.val_pow_eq_pow_val,hη,hω2] using hu)) · exact False.elim (hn4 (by simpa only [h,Units.val_neg,Units.val_pow_eq_pow_val,hη, (symbol_neg_numerator _ _ (primaryCoord_primary 0 1)),hω2] using hu)) theorem arithmeticResidueSum_ne_zero_implies_cube (c : O) (hc : c ≠ 0) (hlevel : (3:O) ∣ c) (hA : arithmeticResidueSum 0 c ≠ 0) : ∃ a : O,c=a^3 := by obtain ⟨u,r,a,hr,hfactor⟩ := constant_coefficient_cube_reduction c hc hlevel hA have ha : a ≠ 0 := by intro hz rw [hz,zero_pow (by decide : (3:ℕ) ≠ 0),mul_zero] at hfactor exact hc hfactor have h01 := constant_coefficient_ramified_equation c hc hlevel hA u r a ha hfactor 0 1 have husign := unit_eq_sign_of_symbol_class u (by simpa only [cubicExp_zero,one_pow,mul_one] using h01) have h10 := constant_coefficient_ramified_equation c hc hlevel hA u r a ha hfactor 1 0 have hωr : omega^r=1 := by rcases husign with hu | hu · simpa only [hu,symbol_one_numerator _ (primaryCoord_primary 1 0),one_mul, cubicExp,Int.reduceMod,Int.toNat_one,pow_one] using h10 · simpa only [hu,symbol_neg_one _ (primaryCoord_primary 1 0),one_mul, cubicExp,Int.reduceMod,Int.toNat_one,pow_one] using h10 have hdiv : 3 ∣ r := (omega_primitive.pow_eq_one_iff_dvd r).mp hωr have hr0 : r=0 := by omega rw [hr0,pow_zero,mul_one] at hfactor rcases husign with hu | hu · refine ⟨a,?_⟩ simpa only [hu,one_mul] using hfactor · refine ⟨-a,?_⟩ rw [hfactor,hu] ring end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal theorem arithmeticResidueSum_ne_zero_iff_cube (c : O) (hc : c ≠ 0) (hlevel : (3:O) ∣ c) : arithmeticResidueSum 0 c ≠ 0 ↔ ∃ a : O,c=a^3 := by constructor · exact arithmeticResidueSum_ne_zero_implies_cube c hc hlevel · rintro ⟨a,rfl⟩ have ha : a ≠ 0 := fun h => hc (by rw [h]; norm_num) exact arithmeticResidueSum_cube_ne_zero a ha end CubicEisenstein open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ActualEisensteinCubic CompletedGauss ConcretePrimeRowBridge def idealZeroMask (D : Ideal O) (z : O) : ℂ := if ∃ P ∈ UniqueFactorizationMonoid.normalizedFactors D, z ∈ P then 0 else 1 theorem idealSupport_singleton_univ (D : Ideal O) : idealSupport {D} D = Finset.univ := by apply Finset.eq_univ_of_forall intro P apply (mem_idealSupport_iff {D} D P).mpr obtain ⟨I, hI, hP⟩ := mem_primePool_iff.mp P.property have hID : I = D := Finset.mem_singleton.mp hI simpa only [hID] using hP theorem singleton_rowCoprimeMask_eq_idealZeroMask (D : Ideal O) (z : O) : rowCoprimeMask (fun P : primePool {D} => P.val) Finset.univ z = idealZeroMask D z := by have he : (∃ P ∈ (Finset.univ : Finset (primePool {D})), z ∈ P.val) ↔ ∃ P ∈ UniqueFactorizationMonoid.normalizedFactors D, z ∈ P := by constructor · rintro ⟨P, _, hz⟩ obtain ⟨I, hI, hP⟩ := mem_primePool_iff.mp P.property have hID : I = D := Finset.mem_singleton.mp hI exact ⟨P.val, hID ▸ hP, hz⟩ · rintro ⟨P, hP, hz⟩ have hp : P ∈ primePool {D} := mem_primePool_iff.mpr ⟨D, Finset.mem_singleton_self D, hP⟩ exact ⟨⟨P, hp⟩, Finset.mem_univ _, hz⟩ simp only [rowCoprimeMask, idealZeroMask, he] theorem canonical_quadraticRow_star (D : Ideal O) (hD : Admissible D) (z : O) : star (quadraticRow D z) = quadraticRow D z := by letI := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F : Finset (Ideal O) := {D} have hF : ∀ I ∈ F, Admissible I := by intro I hI have hID := Finset.mem_singleton.mp hI simpa only [hID] using hD rw [quadraticRow_eq_pool F hF D (Finset.mem_singleton_self D)] exact QuadraticInitialBound.quadraticRow_star _ _ _ _ theorem canonical_quadraticRow_squared (D : Ideal O) (hD : Admissible D) (z : O) : quadraticRow D z * quadraticRow D z = idealZeroMask D z := by letI := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F : Finset (Ideal O) := {D} have hF : ∀ I ∈ F, Admissible I := by intro I hI have hID := Finset.mem_singleton.mp hI simpa only [hID] using hD rw [quadraticRow_eq_pool F hF D (Finset.mem_singleton_self D)] rw [← QuadraticSquarefreeKernel.quadraticRow_mul _ _ _ z z, ← pow_two, QuadraticSquarefreeKernel.quadraticRow_square, idealSupport_singleton_univ] exact singleton_rowCoprimeMask_eq_idealZeroMask D z def gcdMaskPrimes (D : Ideal O) : Finset (Ideal O) := {Ideal.span {lambda}, Ideal.span {(2 : O)}} ∪ (UniqueFactorizationMonoid.normalizedFactors D).toFinset theorem gcdMaskPrimes_maximal (D : Ideal O) (P : gcdMaskPrimes D) : P.val.IsMaximal := by rcases Finset.mem_union.mp P.property with hp | hp · rcases Finset.mem_insert.mp hp with hp | hp · rw [hp] exact lambdaIdeal_maximal · rw [Finset.mem_singleton.mp hp] exact twoIdeal_maximal · have h := UniqueFactorizationMonoid.prime_of_normalized_factor P.val (Multiset.mem_toFinset.mp hp) exact (Ideal.isPrime_of_prime h).isMaximal h.ne_zero theorem gcdMaskPrimes_mask (D : Ideal O) (z : O) : rowCoprimeMask (fun P : gcdMaskPrimes D => P.val) Finset.univ z = rowCoprimeMask badPrime Finset.univ z * idealZeroMask D z := by have he : (∃ P ∈ (Finset.univ : Finset (gcdMaskPrimes D)), z ∈ P.val) ↔ (lambda ∣ z ∨ (2 : O) ∣ z) ∨ ∃ P ∈ UniqueFactorizationMonoid.normalizedFactors D, z ∈ P := by constructor · rintro ⟨P, _, hz⟩ rcases Finset.mem_union.mp P.property with hp | hp · rcases Finset.mem_insert.mp hp with hp | hp · exact Or.inl (Or.inl (Ideal.mem_span_singleton.mp (hp ▸ hz))) · exact Or.inl (Or.inr (Ideal.mem_span_singleton.mp ((Finset.mem_singleton.mp hp) ▸ hz))) · exact Or.inr ⟨P.val, Multiset.mem_toFinset.mp hp, hz⟩ · rintro ((hz | hz) | ⟨P, hP, hz⟩) · exact ⟨⟨Ideal.span {lambda}, Finset.mem_union_left _ (Finset.mem_insert_self _ _)⟩, Finset.mem_univ _, Ideal.mem_span_singleton.mpr hz⟩ · exact ⟨⟨Ideal.span {(2 : O)}, Finset.mem_union_left _ (Finset.mem_insert_of_mem (Finset.mem_singleton_self _))⟩, Finset.mem_univ _, Ideal.mem_span_singleton.mpr hz⟩ · exact ⟨⟨P, Finset.mem_union_right _ (Multiset.mem_toFinset.mpr hP)⟩, Finset.mem_univ _, hz⟩ change (if ∃ P ∈ (Finset.univ : Finset (gcdMaskPrimes D)), z ∈ P.val then (0 : ℂ) else 1) = _ simp only [he] rw [badPrime_mask, supported_span_iff] unfold idealZeroMask by_cases hl : lambda ∣ z <;> by_cases ht : (2 : O) ∣ z <;> by_cases hd : ∃ P ∈ UniqueFactorizationMonoid.normalizedFactors D, z ∈ P <;> simp [hl, ht, hd] end section open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss ConcretePrimeRowBridge ActualEisensteinCoordinates open EisensteinSchwartzPoisson GaussGeneratorTransport QuadraticUnitInvariance theorem canonical_same_ray_pair_poisson {α : Type*} [DecidableEq α] (R : α → Ideal O) [∀ i, (R i).IsMaximal] (hinj : Function.Injective R) (S : Finset α) (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hcop : IsCoprime I J) (hray : columnRay I = columnRay J) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : let n := primaryGenerator I * primaryGenerator J let χ := fun z => quadraticRow I z * quadraticRow J z (∑' z : O, rowCoprimeMask R S z * χ z * W (‖eisEmbedding z‖ ^ 2 / M)) = ((M : ℂ) / (‖eisEmbedding n‖ : ℂ)) * ∑ E ∈ S.powerset, let d := primeSubsetGenerator R E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, R i) : ℂ) * χ d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * ∑' h : O, χ h * paperRadialFourier W (M * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) := by letI := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F : Finset (Ideal O) := {I, J} have hF : ∀ lengthScale ∈ F, Admissible lengthScale := by intro lengthScale hL rcases Finset.mem_insert.mp hL with rfl | hL · exact hI · have hLJ := Finset.mem_singleton.mp hL simpa only [hLJ] using hJ have hIF : I ∈ F := by simp [F] have hJF : J ∈ F := by simp [F] let p := poolPrimary F let A := idealSupport F I let B := idealSupport F J let : ∀ i : primePool F, (Ideal.span {p i}).IsMaximal := fun i => by change (Ideal.span {poolPrimary F i}).IsMaximal; rw [poolPrimary_span F hF i]; infer_instance have hd : Disjoint A B := idealSupport_disjoint_of_coprime F I J hcop have hpgI : primaryGenerator I = ∏ i ∈ A, p i := primaryGenerator_eq_poolProduct F hF I hIF have hpgJ : primaryGenerator J = ∏ i ∈ B, p i := primaryGenerator_eq_poolProduct F hF J hJF have hr : residue (∏ i ∈ A, p i) = residue (∏ i ∈ B, p i) := by rw [← hpgI, ← hpgJ] exact hray have hn : (∏ i ∈ A ∪ B, p i) = primaryGenerator I * primaryGenerator J := by rw [Finset.prod_union hd, ← hpgI, ← hpgJ] have hrowI (z : O) : QuadraticInitialBound.quadraticRow (fun i => Ideal.span {p i}) (poolPrimary_good F hF) A z = quadraticRow I z := (quadraticRow_eq_primaryPool F hF I hIF z).symm have hrowJ (z : O) : QuadraticInitialBound.quadraticRow (fun i => Ideal.span {p i}) (poolPrimary_good F hF) B z = quadraticRow J z := (quadraticRow_eq_primaryPool F hF J hJF z).symm have ht := same_ray_quadratic_pair_poisson R hinj S p (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) (poolPrimary_odd F hF) A B hd hr W M hM simpa only [hn, hrowI, hrowJ] using ht open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss ConcretePrimeRowBridge ActualEisensteinCoordinates open EisensteinSchwartzPoisson GaussGeneratorTransport QuadraticUnitInvariance PrimaryIdealUnitReindex theorem canonical_pair_unit_invariant (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (u : Oˣ) (z : O) : quadraticRow I (u.val * z) * quadraticRow J (u.val * z) = quadraticRow I z * quadraticRow J z := by letI := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F : Finset (Ideal O) := {I, J} have hF : ∀ lengthScale ∈ F, Admissible lengthScale := by intro lengthScale hL rcases Finset.mem_insert.mp hL with rfl | hL · exact hI · have hLJ := Finset.mem_singleton.mp hL simpa only [hLJ] using hJ have hIF : I ∈ F := by simp [F] have hJF : J ∈ F := by simp [F] let p := poolPrimary F let A := idealSupport F I let B := idealSupport F J let : ∀ i : primePool F, (Ideal.span {p i}).IsMaximal := fun i => by change (Ideal.span {poolPrimary F i}).IsMaximal; rw [poolPrimary_span F hF i]; infer_instance have hcA : Pairwise (Function.onFun IsCoprime (fun i : A => Ideal.span {p i.val})) := fun i j hij => poolPrimary_coprime F hF (fun h => hij (Subtype.ext h)) have hcB : Pairwise (Function.onFun IsCoprime (fun i : B => Ideal.span {p i.val})) := fun i j hij => poolPrimary_coprime F hF (fun h => hij (Subtype.ext h)) have hr : residue (∏ i : A, p i.val) = residue (∏ i : B, p i.val) := by rw [Finset.prod_coe_sort, Finset.prod_coe_sort, ← primaryGenerator_eq_poolProduct F hF I hIF, ← primaryGenerator_eq_poolProduct F hF J hJF] exact hray have h := quadratic_pair_unit_invariant (fun i : A => p i.val) (fun i => poolPrimary_ne_zero F hF i.val) hcA (fun i => poolPrimary_good F hF i.val) (fun i => poolPrimary_odd F hF i.val) (fun i : B => p i.val) (fun i => poolPrimary_ne_zero F hF i.val) hcB (fun i => poolPrimary_good F hF i.val) (fun i => poolPrimary_odd F hF i.val) hr u z have hrowI (w : O) : finiteSexticRow (fun i : A => Ideal.span {p i.val}) (fun i => poolPrimary_good F hF i.val) (fun _ => 3) w = quadraticRow I w := (quadraticRow_eq_primarySubset F hF I hIF w).symm have hrowJ (w : O) : finiteSexticRow (fun i : B => Ideal.span {p i.val}) (fun i => poolPrimary_good F hF i.val) (fun _ => 3) w = quadraticRow J w := (quadraticRow_eq_primarySubset F hF J hJF w).symm simpa only [hrowI, hrowJ] using h theorem canonical_masked_pair_summable {α : Type*} (R : α → Ideal O) (S : Finset α) (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : Summable (fun z : O => rowCoprimeMask R S z * (quadraticRow I z * quadraticRow J z) * W (‖eisEmbedding z‖ ^ 2 / M)) := by have hW : Summable (fun z : O => ‖W (‖eisEmbedding z‖ ^ 2 / M)‖) := by simpa only [scaledRadialTest_apply] using actual_eisenstein_summable_norm (scaledRadialTest W M hM) apply Summable.of_norm apply Summable.of_nonneg_of_le (fun z => norm_nonneg _) _ hW intro z simp only [norm_mul] calc _ ≤ 1 * (1 * 1) * ‖W (‖eisEmbedding z‖ ^ 2 / M)‖ := by gcongr · exact rowCoprimeMask_norm_le_one R S z · exact quadraticRow_norm_le_one I z · exact quadraticRow_norm_le_one J z _ = _ := by ring theorem canonical_pair_lattice_eq_primary_ideal_sum {α : Type*} (R : α → Ideal O) (S : Finset α) (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : (∑' z : O, if lambda ∣ z then 0 else rowCoprimeMask R S z * (quadraticRow I z * quadraticRow J z) * W (‖eisEmbedding z‖ ^ 2 / M)) = (Nat.card Oˣ : ℂ) * ∑' lengthScale : GoodIdeal, rowCoprimeMask R S (primaryGenerator lengthScale.val) * (quadraticRow I (primaryGenerator lengthScale.val) * quadraticRow J (primaryGenerator lengthScale.val)) * W ((Ideal.absNorm lengthScale.val : ℝ) / M) := by have hs := canonical_masked_pair_summable R S I J W M hM have hu (u : Oˣ) (lengthScale : GoodIdeal) : rowCoprimeMask R S (u.val * primaryGenerator lengthScale.val) * (quadraticRow I (u.val * primaryGenerator lengthScale.val) * quadraticRow J (u.val * primaryGenerator lengthScale.val)) * W (‖eisEmbedding (u.val * primaryGenerator lengthScale.val)‖ ^ 2 / M) = rowCoprimeMask R S (primaryGenerator lengthScale.val) * (quadraticRow I (primaryGenerator lengthScale.val) * quadraticRow J (primaryGenerator lengthScale.val)) * W (‖eisEmbedding (primaryGenerator lengthScale.val)‖ ^ 2 / M) := by rw [rowCoprimeMask_unit_mul, canonical_pair_unit_invariant I J hI hJ hray, norm_eisEmbedding_unit_mul] have ht := tsum_ramified_mask_unit_invariant _ hs hu change (∑' z : O, if lambda ∣ z then (0 : ℂ) else _) = _ at ht have hn (lengthScale : GoodIdeal) := primaryGenerator_norm_sq lengthScale.val lengthScale.property simpa only [hn] using ht theorem canonical_mask_lattice_eq_six_all_ideals {α : Type*} (R : α → Ideal O) (S : Finset α) (hmask : ∀ z : O, lambda ∣ z → rowCoprimeMask R S z = 0) (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : (∑' z : O, rowCoprimeMask R S z * (quadraticRow I z * quadraticRow J z) * W (‖eisEmbedding z‖ ^ 2 / M)) = (6 : ℂ) * ∑' lengthScale : Ideal O, rowCoprimeMask R S (primaryGenerator lengthScale) * (quadraticRow I (primaryGenerator lengthScale) * quadraticRow J (primaryGenerator lengthScale)) * W ((Ideal.absNorm lengthScale : ℝ) / M) := by have ht := canonical_pair_lattice_eq_primary_ideal_sum R S I J hI hJ hray W M hM rw [card_units_eq_six] at ht have hl : (∑' z : O, if lambda ∣ z then 0 else rowCoprimeMask R S z * (quadraticRow I z * quadraticRow J z) * W (‖eisEmbedding z‖ ^ 2 / M)) = ∑' z : O, rowCoprimeMask R S z * (quadraticRow I z * quadraticRow J z) * W (‖eisEmbedding z‖ ^ 2 / M) := by apply tsum_congr intro z by_cases hz : lambda ∣ z · simp [hz, hmask z hz] · rw [ite_eq_right hz] rw [hl] at ht rw [ht] congr 1 let f : Ideal O → ℂ := fun lengthScale => rowCoprimeMask R S (primaryGenerator lengthScale) * (quadraticRow I (primaryGenerator lengthScale) * quadraticRow J (primaryGenerator lengthScale)) * W ((Ideal.absNorm lengthScale : ℝ) / M) change (∑' lengthScale : GoodIdeal, f lengthScale.val) = ∑' lengthScale : Ideal O, f lengthScale have hsub : (∑' lengthScale : GoodIdeal, f lengthScale.val) = ∑' lengthScale : Ideal O, ({lengthScale : Ideal O | primaryGenerator lengthScale ≠ 0} : Set (Ideal O)).indicator f lengthScale := tsum_subtype _ f rw [hsub] apply tsum_congr intro lengthScale by_cases hg : primaryGenerator lengthScale ≠ 0 · exact Set.indicator_of_mem hg f · rw [Set.indicator_of_notMem hg] have hz : primaryGenerator lengthScale = 0 := not_not.mp hg dsimp only [f] rw [hz, hmask 0 (dvd_zero _)] simp only [zero_mul] end open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss ConcretePrimeRowBridge open EisensteinSchwartzPoisson GaussGeneratorTransport PrimaryIdealUnitReindex theorem badPrime_injective : Function.Injective badPrime := by have hgood : lambda ∉ (Ideal.span {(2 : O)} : Ideal O) := by have hg := cubicTwoIdeal_good change lambda ∉ cubicTwoIdeal at hg simpa only [cubicTwoIdeal, Ideal.span_singleton_neg] using hg intro i j hij cases i <;> cases j · rfl · exfalso apply hgood have he : (Ideal.span {lambda} : Ideal O) = Ideal.span {(2 : O)} := hij rw [← he] exact Ideal.subset_span (by simp) · exfalso apply hgood have he : (Ideal.span {(2 : O)} : Ideal O) = Ideal.span {lambda} := hij rw [he] exact Ideal.subset_span (by simp) · rfl theorem supported_primaryGenerator_ne_zero (lengthScale : Ideal O) (hL : Supported lengthScale) : primaryGenerator lengthScale ≠ 0 := primaryGenerator_ne_zero_of_good_factors lengthScale hL.1 (fun P hP => (hL.2 P hP).1) theorem supported_span_primaryGenerator_iff (lengthScale : Ideal O) : Supported (Ideal.span {primaryGenerator lengthScale}) ↔ Supported lengthScale := by constructor · intro h have hn : primaryGenerator lengthScale ≠ 0 := by intro hz apply h.1 simp [hz] rwa [(primaryGenerator_spec lengthScale hn).1] at h · intro h rw [(primaryGenerator_spec lengthScale (supported_primaryGenerator_ne_zero lengthScale h)).1] exact h theorem badPrime_mask_primaryGenerator (lengthScale : Ideal O) : rowCoprimeMask badPrime Finset.univ (primaryGenerator lengthScale) = if Supported lengthScale then 1 else 0 := by rw [badPrime_mask, supported_span_primaryGenerator_iff] end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.SquareParts namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ActualEisensteinCubic CompletedGauss ConcretePrimeRowBridge QuadraticSquarefreeKernel theorem supported_mul_iff (A B : Ideal O) : Supported (A * B) ↔ Supported A ∧ Supported B := by constructor · intro h have hA : A ≠ 0 := left_ne_zero_of_mul h.1 have hB : B ≠ 0 := right_ne_zero_of_mul h.1 refine ⟨⟨hA, ?_⟩, ⟨hB, ?_⟩⟩ · intro P hP apply h.2 P rw [UniqueFactorizationMonoid.normalizedFactors_mul hA hB] exact Multiset.mem_add.mpr (Or.inl hP) · intro P hP apply h.2 P rw [UniqueFactorizationMonoid.normalizedFactors_mul hA hB] exact Multiset.mem_add.mpr (Or.inr hP) · rintro ⟨hA, hB⟩ refine ⟨mul_ne_zero hA.1 hB.1, ?_⟩ intro P hP rw [UniqueFactorizationMonoid.normalizedFactors_mul hA.1 hB.1] at hP rcases Multiset.mem_add.mp hP with hP | hP · exact hA.2 P hP · exact hB.2 P hP theorem supported_sq_iff (A : Ideal O) : Supported (A ^ 2) ↔ Supported A := by rw [pow_two, supported_mul_iff, and_self] theorem supported_square_parts (lengthScale : Ideal O) : Supported lengthScale ↔ Supported (squarePart lengthScale) ∧ Admissible (squarefreePart lengthScale) := by have he := supported_mul_iff (squarePart lengthScale ^ 2) (squarefreePart lengthScale) rw [squarePart_sq_mul_squarefreePart, supported_sq_iff] at he rw [he] have hsf := squarefree_squarefreePart lengthScale constructor · rintro ⟨hA, hB⟩ exact ⟨hA, hB.1, hsf, hB.2⟩ · rintro ⟨hA, hB⟩ exact ⟨hA, hB.1, hB.2.2⟩ def supportedSquarefreeEquiv : {lengthScale : Ideal O // Supported lengthScale} ≃ ({A : Ideal O // Supported A} × {B : Ideal O // Admissible B}) where toFun lengthScale := (⟨squarePart lengthScale.val, ((supported_square_parts lengthScale.val).mp lengthScale.property).1⟩, ⟨squarefreePart lengthScale.val, ((supported_square_parts lengthScale.val).mp lengthScale.property).2⟩) invFun p := ⟨p.1.val ^ 2 * p.2.val, (supported_mul_iff _ _).mpr ⟨(supported_sq_iff _).mpr p.1.property, admissible_supported p.2.property⟩⟩ left_inv lengthScale := Subtype.ext (squarePart_sq_mul_squarefreePart lengthScale.val) right_inv p := by apply Prod.ext · exact Subtype.ext (squarePart_mul_squarefree p.1.property.1 p.2.property.2.1).1 · exact Subtype.ext (squarePart_mul_squarefree p.1.property.1 p.2.property.2.1).2 theorem canonical_quadraticRow_argument_mul (D : Ideal O) (hD : Admissible D) (a b : O) : quadraticRow D (a * b) = quadraticRow D a * quadraticRow D b := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F : Finset (Ideal O) := {D} have hF : ∀ I ∈ F, Admissible I := by intro I hI have hID := Finset.mem_singleton.mp hI simpa only [hID] using hD simp only [quadraticRow_eq_pool F hF D (Finset.mem_singleton_self D)] exact QuadraticSquarefreeKernel.quadraticRow_mul _ _ _ a b theorem canonical_quadraticRow_square_argument (D : Ideal O) (hD : Admissible D) (a : O) : quadraticRow D (a ^ 2) = idealZeroMask D a := by rw [pow_two, canonical_quadraticRow_argument_mul D hD, canonical_quadraticRow_squared D hD] theorem canonical_quadraticRow_primary_squarefree (D : Ideal O) (hD : Admissible D) (A B : Ideal O) : quadraticRow D (primaryGenerator (A ^ 2 * B)) = idealZeroMask D (primaryGenerator A) * quadraticRow D (primaryGenerator B) := by rw [primaryGenerator_mul] have hpow : primaryGenerator (A ^ 2) = primaryGenerator A ^ 2 := map_pow primaryGeneratorHom A 2 rw [hpow, canonical_quadraticRow_argument_mul D hD, canonical_quadraticRow_square_argument D hD] end section open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss open EisensteinSchwartzPoisson PrimaryIdealUnitReindex QuadraticSquarefreeKernel theorem supported_generator_injective : Function.Injective (fun lengthScale : {lengthScale : Ideal O // Supported lengthScale} => primaryGenerator lengthScale.val) := by intro I J h change primaryGenerator I.val = primaryGenerator J.val at h have hi := primaryGenerator_ne_zero_of_good_factors I.val I.property.1 (fun P hP => (I.property.2 P hP).1) have hj := primaryGenerator_ne_zero_of_good_factors J.val J.property.1 (fun P hP => (J.property.2 P hP).1) apply Subtype.ext rw [← (primaryGenerator_spec I.val hi).1, ← (primaryGenerator_spec J.val hj).1, h] theorem supported_radial_norm_summable (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : Summable (fun lengthScale : Ideal O => if Supported lengthScale then ‖W ((Ideal.absNorm lengthScale : ℝ) / M)‖ else 0) := by have hs : Summable (fun z : O => ‖W (‖eisEmbedding z‖ ^ 2 / M)‖) := by simpa only [scaledRadialTest_apply] using actual_eisenstein_summable_norm (scaledRadialTest W M hM) have hp := hs.comp_injective supported_generator_injective have hi : Summable (fun lengthScale : {lengthScale : Ideal O // Supported lengthScale} => ‖W ((Ideal.absNorm lengthScale.val : ℝ) / M)‖) := by apply hp.congr intro lengthScale dsimp only [Function.comp_def] rw [primaryGenerator_norm_sq lengthScale.val (primaryGenerator_ne_zero_of_good_factors lengthScale.val lengthScale.property.1 (fun P hP => (lengthScale.property.2 P hP).1))] have ht : Summable (({lengthScale : Ideal O | Supported lengthScale} : Set (Ideal O)).indicator (fun lengthScale => ‖W ((Ideal.absNorm lengthScale : ℝ) / M)‖)) := (summable_subtype_iff_indicator).mp hi exact ht def originalPairSource (I J : Ideal O) (W : ℝ → ℂ) (M : ℝ) (lengthScale : Ideal O) : ℂ := if Supported lengthScale then (star (quadraticRow I (primaryGenerator lengthScale)) * quadraticRow J (primaryGenerator lengthScale)) * W ((Ideal.absNorm lengthScale : ℝ) / M) else 0 def originalPairLow (I J : Ideal O) (W : ℝ → ℂ) (M K : ℝ) (lengthScale : Ideal O) : ℂ := if (Ideal.absNorm (squarefreePart lengthScale) : ℝ) ≤ K then originalPairSource I J W M lengthScale else 0 def originalPairHigh (I J : Ideal O) (W : ℝ → ℂ) (M K : ℝ) (lengthScale : Ideal O) : ℂ := if K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ) then originalPairSource I J W M lengthScale else 0 theorem originalPairSource_summable (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : Summable (originalPairSource I J W M) := by apply Summable.of_norm apply Summable.of_nonneg_of_le (fun lengthScale => norm_nonneg _) _ (supported_radial_norm_summable W M hM) intro lengthScale by_cases hL : Supported lengthScale · simp only [originalPairSource, if_pos hL, norm_mul, norm_star] calc _ ≤ (1 * 1) * ‖W ((Ideal.absNorm lengthScale : ℝ) / M)‖ := by gcongr · exact quadraticRow_norm_le_one I _ · exact quadraticRow_norm_le_one J _ _ = _ := by ring · simp only [originalPairSource, if_neg hL, norm_zero, le_refl] theorem originalPairLow_summable (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (M K : ℝ) (hM : 0 < M) : Summable (originalPairLow I J W M K) := (originalPairSource_summable I J W M hM).indicator _ theorem originalPairHigh_summable (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (M K : ℝ) (hM : 0 < M) : Summable (originalPairHigh I J W M K) := (originalPairSource_summable I J W M hM).indicator _ theorem originalPairHigh_eq_source_sub_low (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (M K : ℝ) (hM : 0 < M) : (∑' lengthScale : Ideal O, originalPairHigh I J W M K lengthScale) = (∑' lengthScale : Ideal O, originalPairSource I J W M lengthScale) - ∑' lengthScale : Ideal O, originalPairLow I J W M K lengthScale := by calc _ = ∑' lengthScale : Ideal O, (originalPairSource I J W M lengthScale - originalPairLow I J W M K lengthScale) := by apply tsum_congr intro lengthScale by_cases hK : (Ideal.absNorm (squarefreePart lengthScale) : ℝ) ≤ K · simp [originalPairHigh, originalPairLow, hK, not_lt.mpr hK] · simp [originalPairHigh, originalPairLow, hK, lt_of_not_ge hK] _ = _ := (originalPairSource_summable I J W M hM).tsum_sub (originalPairLow_summable I J W M K hM) end section open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss open EisensteinSchwartzPoisson GaussGeneratorTransport theorem canonical_gcd_masked_pair_poisson (D I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hcop : IsCoprime I J) (hray : columnRay I = columnRay J) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : let n := primaryGenerator I * primaryGenerator J let χ := fun z => quadraticRow I z * quadraticRow J z let R := fun P : gcdMaskPrimes D => P.val (∑' lengthScale : Ideal O, if Supported lengthScale then idealZeroMask D (primaryGenerator lengthScale) * χ (primaryGenerator lengthScale) * W ((Ideal.absNorm lengthScale : ℝ) / M) else 0) = ((M : ℂ) / (6 * ‖eisEmbedding n‖ : ℂ)) * ∑ E ∈ (Finset.univ : Finset (gcdMaskPrimes D)).powerset, let d := primeSubsetGenerator R E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, R i) : ℂ) * χ d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * ∑' h : O, χ h * paperRadialFourier W (M * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.gcdMaskPrimes_maximal let R := fun P : gcdMaskPrimes D => P.val have hm (z : O) (hz : lambda ∣ z) : rowCoprimeMask R Finset.univ z = 0 := by rw [gcdMaskPrimes_mask, badPrime_mask] have hns : ¬Supported (Ideal.span {z}) := fun h => (supported_span_iff z).mp h |>.1 hz simp only [if_neg hns, zero_mul] have hlat := canonical_same_ray_pair_poisson R Subtype.val_injective Finset.univ I J hI hJ hcop hray W M hM have hid := canonical_mask_lattice_eq_six_all_ideals R Finset.univ hm I J hI hJ hray W M hM have he : (∑' lengthScale : Ideal O, rowCoprimeMask R Finset.univ (primaryGenerator lengthScale) * (quadraticRow I (primaryGenerator lengthScale) * quadraticRow J (primaryGenerator lengthScale)) * W ((Ideal.absNorm lengthScale : ℝ) / M)) = ∑' lengthScale : Ideal O, if Supported lengthScale then idealZeroMask D (primaryGenerator lengthScale) * (quadraticRow I (primaryGenerator lengthScale) * quadraticRow J (primaryGenerator lengthScale)) * W ((Ideal.absNorm lengthScale : ℝ) / M) else 0 := by apply tsum_congr intro lengthScale rw [gcdMaskPrimes_mask, badPrime_mask_primaryGenerator] by_cases hL : Supported lengthScale <;> simp [hL] rw [he] at hid dsimp only at hlat ⊢ rw [hid] at hlat calc _ = (6 : ℂ)⁻¹ * ((M : ℂ) / ‖eisEmbedding (primaryGenerator I * primaryGenerator J)‖ * _) := by rw [← hlat] ring _ = _ := by ring theorem canonical_pair_divisor_mask (D I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hDI : D ∣ I) (hDJ : D ∣ J) (z : O) : star (quadraticRow I z) * quadraticRow J z = idealZeroMask D z * (quadraticRow (idealQuotient D I) z * quadraticRow (idealQuotient D J) z) := by rw [canonical_quadraticRow_star I hI, quadraticRow_divisor_factor I D hI hDI, quadraticRow_divisor_factor J D hJ hDJ] calc _ = (quadraticRow D z * quadraticRow D z) * (quadraticRow (idealQuotient D I) z * quadraticRow (idealQuotient D J) z) := by ring _ = _ := by rw [canonical_quadraticRow_squared D (admissible_of_dvd hI hDI)] theorem canonical_original_pair_poisson (D I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hgcd : gcd I J = D) (hray : columnRay I = columnRay J) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : let I' := idealQuotient D I let J' := idealQuotient D J let n := primaryGenerator I' * primaryGenerator J' let χ := fun z => quadraticRow I' z * quadraticRow J' z let R := fun P : gcdMaskPrimes D => P.val (∑' lengthScale : Ideal O, if Supported lengthScale then (star (quadraticRow I (primaryGenerator lengthScale)) * quadraticRow J (primaryGenerator lengthScale)) * W ((Ideal.absNorm lengthScale : ℝ) / M) else 0) = ((M : ℂ) / (6 * ‖eisEmbedding n‖ : ℂ)) * ∑ E ∈ (Finset.univ : Finset (gcdMaskPrimes D)).powerset, let d := primeSubsetGenerator R E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, R i) : ℂ) * χ d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * ∑' h : O, χ h * paperRadialFourier W (M * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) := by have hDI : D ∣ I := hgcd ▸ gcd_dvd_left I J have hDJ : D ∣ J := hgcd ▸ gcd_dvd_right I J have hD := admissible_of_dvd hI hDI have hIq := admissible_idealQuotient hI hDI have hJq := admissible_idealQuotient hJ hDJ have hcop := (gcd_eq_iff_quotient_coprime D I J hD.1 hDI hDJ).mp hgcd have hqray := columnRay_idealQuotient_eq D I J hI hJ hDI hDJ hray have h := canonical_gcd_masked_pair_poisson D (idealQuotient D I) (idealQuotient D J) hIq hJq hcop hqray W M hM simpa only [canonical_pair_divisor_mask D I J hI hJ hDI hDJ] using h theorem residual_pair_nontrivial (D I J : Ideal O) (hDI : D ∣ I) (hDJ : D ∣ J) (hIJ : I ≠ J) : idealQuotient D I ≠ 1 ∨ idealQuotient D J ≠ 1 := by by_contra hn push Not at hn apply hIJ calc I = D * idealQuotient D I := (idealQuotient_mul hDI).symm _ = D := by rw [hn.1, mul_one] _ = D * idealQuotient D J := by rw [hn.2, mul_one] _ = J := idealQuotient_mul hDJ end section open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss QuadraticSquarefreeKernel def rayPairCoefficient (N : ℝ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (a : idealRange N → ℂ) (I J : idealRange N) : ℂ := if gcd I.val J.val = D ∧ columnRay I.val = c ∧ columnRay J.val = c then star (a I) * a J else 0 theorem annularRayGcdBlock_eq_pair_high (M N K : ℝ) (hM : 0 < M) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (a : idealRange N → ℂ) : annularRayGcdBlock M N K D c a = ∑ I : idealRange N, ∑ J : idealRange N, rayPairCoefficient N D c a I J * ∑' lengthScale : Ideal O, originalPairHigh I.val J.val QuadraticInitialBound.annularSieveCutoff M K lengthScale := by let W := QuadraticInitialBound.annularSieveCutoff let f := fun (I J : idealRange N) (lengthScale : Ideal O) => rayPairCoefficient N D c a I J * originalPairHigh I.val J.val W M K lengthScale have hf (I J : idealRange N) : Summable (f I J) := (originalPairHigh_summable I.val J.val W M K hM).mul_left _ have hterm (lengthScale : Ideal O) : (if Supported lengthScale ∧ K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ) then W ((Ideal.absNorm lengthScale : ℝ) / M) * rayPairValue N D c a lengthScale else 0) = ∑ I : idealRange N, ∑ J : idealRange N, f I J lengthScale := by rw [rayPairValue_eq] by_cases hs : Supported lengthScale · by_cases hk : K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ) · have hsk : Supported lengthScale ∧ K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ) := ⟨hs, hk⟩ rw [if_pos hsk] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro I _ apply Finset.sum_congr rfl intro J _ dsimp only [f, rayPairCoefficient, originalPairHigh, originalPairSource] rw [if_pos hk, if_pos hs] by_cases hc : gcd I.val J.val = D ∧ columnRay I.val = c ∧ columnRay J.val = c · rw [if_pos hc, if_pos hc] simp only [star_mul] ring · rw [if_neg hc, if_neg hc, zero_mul, mul_zero] · simp [f, originalPairHigh, hk] · simp [f, originalPairHigh, originalPairSource, hs] rw [annularRayGcdBlock_eq_tsum M N K hM D c a] change (∑' lengthScale : Ideal O, if Supported lengthScale ∧ K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ) then W ((Ideal.absNorm lengthScale : ℝ) / M) * rayPairValue N D c a lengthScale else 0) = _ calc _ = ∑' lengthScale : Ideal O, ∑ I : idealRange N, ∑ J : idealRange N, f I J lengthScale := tsum_congr hterm _ = ∑ I : idealRange N, ∑' lengthScale : Ideal O, ∑ J : idealRange N, f I J lengthScale := Summable.tsum_finsetSum (fun I _ => summable_sum (fun J _ => hf I J)) _ = _ := by apply Finset.sum_congr rfl intro I _ rw [Summable.tsum_finsetSum (fun J _ => hf I J)] apply Finset.sum_congr rfl intro J _ exact tsum_mul_left end open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss open EisensteinSchwartzPoisson GaussGeneratorTransport def originalPairDualKernel (D I J : Ideal O) (W : ℝ → ℂ) (M : ℝ) : ℂ := let I' := idealQuotient D I let J' := idealQuotient D J let n := primaryGenerator I' * primaryGenerator J' let χ := fun z => quadraticRow I' z * quadraticRow J' z let R := fun P : gcdMaskPrimes D => P.val ((M : ℂ) / (6 * ‖eisEmbedding n‖ : ℂ)) * ∑ E ∈ (Finset.univ : Finset (gcdMaskPrimes D)).powerset, let d := primeSubsetGenerator R E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, R i) : ℂ) * χ d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * ∑' h : O, χ h * paperRadialFourier W (M * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) theorem originalPairSource_poisson (D I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hgcd : gcd I J = D) (hray : columnRay I = columnRay J) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : (∑' lengthScale : Ideal O, originalPairSource I J W M lengthScale) = originalPairDualKernel D I J W M := canonical_original_pair_poisson D I J hI hJ hgcd hray W M hM end CanonicalQuadraticSieve open scoped BigOperators Classical SchwartzMap ContDiff namespace SecondPassIntegration open ActualEisensteinCubic FirstPassCubeLabels JointLogSeparation theorem columnLog_extract_common {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (G N : Finset ι) (hd : Disjoint G N) (X : ℝ) (hX : 0 < X) : columnLog p X (G∪N) = columnLog p (X / primeProductNorm p G) N := by have hG := primeProductNorm_pos p hp G unfold columnLog rw [primeProductNorm_union p G N hd] congr 1 field_simp theorem normalizedColumn_pair_extract_fixed_profiles {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (G N M : Finset ι) (hGN : Disjoint G N) (hGM : Disjoint G M) (X : ℝ) (hX : 0 < X) (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g₁ g₂ : 𝓢(ℝ, ℂ)) (hU₁ : ∀ s, g₁ s ≠ 0 → U s = 1) (hU₂ : ∀ s, g₂ s ≠ 0 → U s = 1) : star (normalizedColumn p (fun S => g₁ (columnLog p X S)) (G∪N)) * normalizedColumn p (fun S => g₂ (columnLog p X S)) (G∪M) = (X : ℂ)⁻¹ * conjugateProfile (halfNormalizationCLM U g₁) (columnLog p (X / primeProductNorm p G) N) * halfNormalizationCLM U g₂ (columnLog p (X / primeProductNorm p G) M) := by have hG := primeProductNorm_pos p hp G rw [normalizedColumn_pair_union p hp G N M hGN hGM X (X / primeProductNorm p G) hX (div_pos hX hG) U hUc hUs g₁ g₂ hU₁ hU₂] have he : primeProductNorm p G * (X / primeProductNorm p G) / X = 1 := by field_simp rw [he, Real.log_one, zero_add, zero_add] end SecondPassIntegration open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform namespace SecondPassArithmetic open ActualEisensteinCubic open SecondPassIntegration (tupleSourceSum tupleSource_uniform_transfer childGeometricMean) open JointLogSeparation open FirstPassCubeLabels (b0Label) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.ResidualSectors namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic theorem second_common_support_reconstruct {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (E G G' : Finset ι) (hEG : E ⊆ G) (hEG' : E ⊆ G') (hr : Ideal.span {secondMaskQuotient p E G hEG} = Ideal.span {secondMaskQuotient p E G' hEG'}) : G = G' := by apply FirstCauchyArithmetic.family_product_injective (fun i => Ideal.span {p i}) hinj have hprod (A : Finset ι) (hEA : E ⊆ A) : (∏ i ∈ A, (Ideal.span {p i} : Ideal O)) = (∏ i ∈ E, Ideal.span {p i}) * Ideal.span {secondMaskQuotient p E A hEA} := by rw [secondMaskQuotient_span] simpa only [mul_comm] using (Finset.prod_sdiff (f := fun i => (Ideal.span {p i} : Ideal O)) hEA).symm change (∏ i ∈ G, (Ideal.span {p i} : Ideal O)) = ∏ i ∈ G', Ideal.span {p i} rw [hprod G hEG, hprod G' hEG', hr] open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open FirstPassCubeLabels (primeProductNorm) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) def secondSourcePairKernel (e k : O) (H₁ H₂ : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (S T : Finset ι) : ℂ := (star (H₁ S) * H₂ T / ((‖eisEmbedding (∏ i ∈ S, p i)‖ : ℂ) * (‖eisEmbedding (∏ i ∈ T, p i)‖ : ℂ))) * paperRadialFourier W (Y * ‖eisEmbedding k‖ ^ 2 / (‖eisEmbedding e‖ ^ 2 * (primeProductNorm p S * primeProductNorm p T))) theorem secondFrequencyKernel_eq_kernelPair (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (H₁ H₂ : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : secondFrequencyKernel p hp hg hinj F Ψ₁ Ψ₂ m r c d e k H₁ H₂ W Y = (Y : ℂ) * secondKernelPair p hp hg hinj F Ψ₁ Ψ₂ m r c d e k (secondSourcePairKernel p e k H₁ H₂ W Y) := by unfold secondFrequencyKernel secondKernelPair simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro S hS apply Finset.sum_congr rfl intro T hT by_cases hd : Disjoint S T · simp only [if_pos hd, secondSourcePairKernel] rw [secondGaussTerm_test_factors, Finset.prod_union hd, map_mul, norm_mul, Complex.ofReal_mul, FirstPassCubeLabels.primeProductNorm_union p S T hd] ring · simp [hd] theorem secondFrequencyKernel_eq_child_sectors (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O) (H₁ H₂ : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype secondFrequencyKernel p hp hg hinj F Ψ₁ Ψ₂ m r c d e k H₁ H₂ W Y = (Y : ℂ) * ∑ z : SecondRayIndex, ∑ V ∈ F.powerset, secondTotalWeight p hp hcop hg Ψ₁ Ψ₂ m r c d e k (z,V) * secondChildKernelPair p hp hcop hg F V (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m r c d e k (-k) (secondSourcePairKernel p e k H₁ H₂ W Y) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype rw [secondFrequencyKernel_eq_kernelPair, secondKernelPair_eq_children p hp hcop hg hinj hc hpr] def secondSourceCommonCoefficient (Ψ : O →* ℂ) (m c d : O) (G E : Finset ι) : ℂ := (↑(‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) G‖ ^ 2) : ℂ) * ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, Ideal.span {p i}) : ℂ) / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖ ^ 2 : ℝ)) def truncatedSecondSource (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (K : Finset ι → Finset ι → Finset O) : ℂ := ∑ G ∈ F.powerset, ∑ E : G.powerset, ∑ k ∈ K G E.val, secondSourceCommonCoefficient p hg Ψ m c d G E.val * secondFrequencyKernel p hp hg hinj F Ψ Ψ m (secondMaskQuotient p E.val G (Finset.mem_powerset.mp E.property)) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) k (fun U => H (G ∪ U)) (fun U => H (G ∪ U)) W Y def secondSourceTail (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (K : Finset ι → Finset ι → Finset O) : ℂ := ∑ G ∈ F.powerset, ∑ E : G.powerset, secondSourceCommonCoefficient p hg Ψ m c d G E.val * ∑' k : {k : O // k ∉ K G E.val}, secondFrequencyKernel p hp hg hinj F Ψ Ψ m (secondMaskQuotient p E.val G (Finset.mem_powerset.mp E.property)) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) k.val (fun U => H (G ∪ U)) (fun U => H (G ∪ U)) W Y theorem inputConjugateRow_eq_truncated_add_tail (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) (K : Finset ι → Finset ι → Finset O) : (∑' z : O, W (‖eisEmbedding z‖ ^ 2 / Y) * (↑(‖inputConjugateRow p hg F Ψ m c d H z‖ ^ 2) : ℂ)) = truncatedSecondSource p hp hg hinj F Ψ m c d H W Y K + secondSourceTail p hp hg hinj F Ψ m c d H W Y K := by rw [inputConjugateRow_smoothed_frequency_blocks p hp hg hinj hc F Ψ m c d H W Y hY] unfold truncatedSecondSource secondSourceTail rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro G hG simp only [Finset.mul_sum] rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro E hE have hs : Summable (fun k : O => secondFrequencyKernel p hp hg hinj F Ψ Ψ m (secondMaskQuotient p E.val G (Finset.mem_powerset.mp E.property)) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) k (fun U => H (G ∪ U)) (fun U => H (G ∪ U)) W Y) := by simp_rw [← residualSecondMode_eq_frequencyKernel p hp hg hinj F G E.val (Finset.mem_powerset.mp E.property) Ψ Ψ m c d (fun U => H (G ∪ U)) (fun U => H (G ∪ U))] exact residualSecondMode_summable p hp hg hinj F G Ψ Ψ m c d (fun U => H (G ∪ U)) (fun U => H (G ∪ U)) (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) (primeSubsetGenerator_ne_zero _ _) W Y hY rw [← hs.sum_add_tsum_subtype_compl (K G E.val)] simp only [secondSourceCommonCoefficient, mul_add, Finset.mul_sum] ring_nf theorem truncatedSecondSource_eq_child_sectors (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (K : Finset ι → Finset ι → Finset O) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype truncatedSecondSource p hp hg hinj F Ψ m c d H W Y K = ∑ G ∈ F.powerset, ∑ E : G.powerset, ∑ z : SecondRayIndex, ∑ V ∈ F.powerset, ∑ k ∈ K G E.val, ((Y : ℂ) * secondSourceCommonCoefficient p hg Ψ m c d G E.val * secondTotalWeight p hp hcop hg Ψ Ψ m (secondMaskQuotient p E.val G (Finset.mem_powerset.mp E.property)) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) k (z,V)) * secondChildKernelPair p hp hcop hg F V (secondRayMinus Ψ z) (secondRayPlus Ψ z) m (secondMaskQuotient p E.val G (Finset.mem_powerset.mp E.property)) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) k (-k) (secondSourcePairKernel p (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) k (fun U => H (G ∪ U)) (fun U => H (G ∪ U)) W Y) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype unfold truncatedSecondSource apply Finset.sum_congr rfl intro G hG apply Finset.sum_congr rfl intro E hE simp_rw [secondFrequencyKernel_eq_child_sectors p hp hg hinj hcop hc hpr] simp only [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro z hz rw [Finset.sum_comm] apply Finset.sum_congr rfl intro V hV apply Finset.sum_congr rfl intro k hk ring end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) structure SecondExpansionData (ι : Type*) where sourceCommon : Finset ι divisor : Finset ι overlap : Finset ι frequency : O def instDecidableEqSecondExpansionData.decEq {ι : Type*} [DecidableEq ι] (x y : SecondExpansionData ι) : Decidable (x = y) := match x, y with | SecondExpansionData.mk a0 a1 a2 a3, SecondExpansionData.mk b0 b1 b2 b3 => if h : a0 = b0 then by subst h exact if h : a1 = b1 then by subst h exact if h : a2 = b2 then by subst h exact if h : a3 = b3 then by subst h exact isTrue rfl else isFalse (by intro n; injection n; apply h _; assumption) else isFalse (by intro n; injection n; apply h _; assumption) else isFalse (by intro n; injection n; apply h _; assumption) else isFalse (by intro n; injection n; apply h _; assumption) def instDecidableEqSecondExpansionData {ι : Type*} [DecidableEq ι] : DecidableEq (SecondExpansionData ι) := instDecidableEqSecondExpansionData.decEq protected theorem SecondExpansionData.ext : ∀ {ι : Type*} {x y : SecondExpansionData ι}, ∀ (sourceCommon : x.sourceCommon = y.sourceCommon) (divisor : x.divisor = y.divisor) (overlap : x.overlap = y.overlap) (frequency : x.frequency = y.frequency), x = y := fun {ι} {x} {y} => match x with | SecondExpansionData.mk G E V k => match y with | SecondExpansionData.mk G' E' V' k' => fun hG hE hV hk => by cases hG cases hE cases hV cases hk rfl section variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] def InSecondQuotientSector (r : O) (x : SecondExpansionData ι) : Prop := ∃ h : x.divisor ⊆ x.sourceCommon, Ideal.span {secondMaskQuotient p x.divisor x.sourceCommon h} = Ideal.span {r} def expansionSupportData (C D : Finset ι) (x : SecondExpansionData ι) : SecondSupportData ι where common := C firstDivisor := D secondDivisor := x.divisor overlap := x.overlap frequency := x.frequency theorem expansionSupportData_injOn (hinj : Function.Injective (fun i => Ideal.span {p i})) (C D : Finset ι) (r : O) : Set.InjOn (expansionSupportData (ι := ι) C D) {x | InSecondQuotientSector p r x} := by intro x hx y hy h obtain ⟨hxE, hxr⟩ := hx obtain ⟨hyE, hyr⟩ := hy have he := congrArg SecondSupportData.secondDivisor h have hv := congrArg SecondSupportData.overlap h have hk := congrArg SecondSupportData.frequency h change x.divisor = y.divisor at he change x.overlap = y.overlap at hv change x.frequency = y.frequency at hk have hg : x.sourceCommon = y.sourceCommon := by cases x with | mk G E V k => cases y with | mk G' E' V' k' => dsimp only at he hxE hyE hxr hyr ⊢ subst E' exact second_common_support_reconstruct p hinj E G G' hxE hyE (hxr.trans hyr.symm) exact SecondExpansionData.ext hg he hv hk omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem primeProductNorm_quotient_sector (E G : Finset ι) (hEG : E ⊆ G) (r : O) (hr : Ideal.span {secondMaskQuotient p E G hEG} = Ideal.span {r}) : primeProductNorm p G = ‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖ ^ 2 * ‖eisEmbedding r‖ ^ 2 := by unfold primeProductNorm rw [secondMaskQuotient_spec p E G hEG, map_mul, norm_mul, mul_pow] congr 1 rw [eisEmbedding_norm_sq_eq_absNorm_span, eisEmbedding_norm_sq_eq_absNorm_span, hr] omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem residual_scale_quotient_sector (X : ℝ) (E G : Finset ι) (hEG : E ⊆ G) (r : O) (hr : Ideal.span {secondMaskQuotient p E G hEG} = Ideal.span {r}) : X / primeProductNorm p G = X / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖ ^ 2 * ‖eisEmbedding r‖ ^ 2) := by rw [primeProductNorm_quotient_sector p E G hEG r hr] end theorem rowCoprimeMask_eq_of_span_eq {ι : Type*} (P : ι → Ideal O) (S : Finset ι) {a b : O} (hab : Ideal.span {a} = Ideal.span {b}) : rowCoprimeMask P S a = rowCoprimeMask P S b := by have hm (i : ι) : a ∈ P i ↔ b ∈ P i := by rw [← Ideal.span_singleton_le_iff_mem, ← Ideal.span_singleton_le_iff_mem, hab] simp only [rowCoprimeMask, hm] theorem rowCoprimeMask_mul_eq_of_span_eq {ι : Type*} (P : ι → Ideal O) (S : Finset ι) (m : O) {a b : O} (hab : Ideal.span {a} = Ideal.span {b}) : rowCoprimeMask P S (m*a) = rowCoprimeMask P S (m*b) := by apply rowCoprimeMask_eq_of_span_eq P S rw [← Ideal.span_singleton_mul_span_singleton, ← Ideal.span_singleton_mul_span_singleton, hab] end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap namespace SecondPassIntegration open ActualEisensteinCubic FirstPassCubeLabels open SecondPassArithmetic (SecondSupportData secondSectorZ) end SecondPassIntegration open scoped BigOperators Classical SchwartzMap ContDiff namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (jLabel) open SecondPassIntegration (exists_fixed_normalized_child_tests elementNorm) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end section open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform open ActualEisensteinCubic open FirstPassCubeLabels (b0Label firstLogDensity) open SecondPassIntegration (childGeometricMean) open JointLogSeparation theorem outerWindow_global_bound (windows : Fin 7 → ℝ → ℂ) (hc : ∀ j, HasCompactSupport (windows j)) (hs : ∀ j, Continuous (windows j)) : ∃ Cw : ℝ, 0 ≤ Cw ∧ ∀ z ud ue uv kap : ℝ, ‖outerWindow windows z ud ue uv kap‖ ≤ Cw := by have hb (j : Fin 7) : ∃ B : ℝ, 0 ≤ B ∧ ∀ x : ℝ, ‖windows j x‖ ≤ B := by obtain ⟨B,hB⟩ := ((hc j).isCompact_range (hs j)).bddAbove_image continuous_norm.continuousOn have he (x : ℝ) : ‖windows j x‖ ≤ B := hB ⟨windows j x, ⟨x,rfl⟩,rfl⟩ exact ⟨B,(norm_nonneg _).trans (he 0),he⟩ choose B hB hbound using hb have h0 := hB 0 have h1 := hB 1 have h2 := hB 2 have h3 := hB 3 have h4 := hB 4 refine ⟨B 0 * B 1 * B 2 * B 3 * B 4, by positivity, ?_⟩ intro z ud ue uv kap simp only [outerWindow, norm_mul] gcongr all_goals first | positivity | apply hbound end open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm) open JointLogSeparation (halfNormalizationCLM) open SecondPassIntegration (normalizedColumn_pair_extract_fixed_profiles conjugateProfile) theorem secondSourcePairKernel_normalized_shift {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (G S T : Finset ι) (hGS : Disjoint G S) (hGT : Disjoint G T) (e k : O) (X Y : ℝ) (hX : 0 < X) (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g₁ g₂ W : 𝓢(ℝ, ℂ)) (hU₁ : ∀ s, g₁ s ≠ 0 → U s = 1) (hU₂ : ∀ s, g₂ s ≠ 0 → U s = 1) : secondSourcePairKernel p e k (fun A => normalizedColumn p (fun B => g₁ (columnLog p X B)) (G∪A)) (fun A => normalizedColumn p (fun B => g₂ (columnLog p X B)) (G∪A)) W Y S T = (X : ℂ)⁻¹ * radialPairKernel p e k W (halfNormalizationCLM U g₁) (halfNormalizationCLM U g₂) (X / primeProductNorm p G) (X / primeProductNorm p G) Y S T := by unfold secondSourcePairKernel rw [normalizedColumn_pair_extract_fixed_profiles p hp G S T hGS hGT X hX U hUc hUs g₁ g₂ hU₁ hU₂] simp only [radialPairKernel, normalizedColumn, SecondPassIntegration.conjugateProfile_apply, Complex.star_def, Complex.conj_ofReal, div_eq_mul_inv, mul_inv_rev, map_inv₀, map_mul] ring_nf end SecondPassArithmetic open scoped BigOperators Classical namespace UnrestrictedIdealReindex abbrev O := ActualEisensteinCubic.O open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge open PrimaryIdealUnitReindex CanonicalQuadraticSieve abbrev NonzeroIdeal := {I : Ideal O // I ≠ 0} abbrev NonzeroElement := {z : O // z ≠ 0} theorem span_unit_generator (u : Oˣ) (I : NonzeroIdeal) : Ideal.span {u.val * idealGenerator I.val} = I.val := by rw [Ideal.span_singleton_mul_left_unit u.isUnit, span_idealGenerator] def unitIdealToElement (p : Oˣ × NonzeroIdeal) : NonzeroElement := ⟨p.1.val * idealGenerator p.2.val, mul_ne_zero p.1.ne_zero (idealGenerator_ne_zero p.2.val p.2.property)⟩ theorem unitIdealToElement_bijective : Function.Bijective unitIdealToElement := by constructor · intro p q hpq have he : p.1.val * idealGenerator p.2.val = q.1.val * idealGenerator q.2.val := congrArg Subtype.val hpq have hi : p.2 = q.2 := by apply Subtype.ext simpa only [span_unit_generator] using congrArg (fun z : O => Ideal.span {z}) he have hu : p.1 = q.1 := by apply Units.ext rw [hi] at he exact mul_right_cancel₀ (idealGenerator_ne_zero q.2.val q.2.property) he exact Prod.ext hu hi · intro z let I : NonzeroIdeal := ⟨Ideal.span {z.val}, Ideal.span_singleton_eq_bot.not.mpr z.property⟩ have ha : Associated (idealGenerator I.val) z.val := Ideal.span_singleton_eq_span_singleton.mp (span_idealGenerator I.val) obtain ⟨u, hu⟩ := ha refine ⟨(u, I), Subtype.ext ?_⟩ change u.val * idealGenerator I.val = z.val simpa only [mul_comm] using hu def unitIdealEquiv : Oˣ × NonzeroIdeal ≃ NonzeroElement := Equiv.ofBijective unitIdealToElement unitIdealToElement_bijective theorem tsum_nonzero_unit_invariant (f : O → ℂ) (hf : Summable f) (hu : ∀ (u : Oˣ) (z : O), f (u.val * z) = f z) : (∑' z : NonzeroElement, f z.val) = (6 : ℂ) * ∑' I : NonzeroIdeal, f (idealGenerator I.val) := by let : Finite Oˣ := finite_units let : Fintype Oˣ := Fintype.ofFinite _ have he : (∑' z : NonzeroElement, f z.val) = ∑' p : Oˣ × NonzeroIdeal, f (p.1.val * idealGenerator p.2.val) := (unitIdealEquiv.tsum_eq (fun z : NonzeroElement => f z.val)).symm have hs : Summable (fun p : Oˣ × NonzeroIdeal => f (p.1.val * idealGenerator p.2.val)) := unitIdealEquiv.summable_iff.mpr (hf.subtype _) rw [he, hs.tsum_prod] simp only [hu, tsum_fintype, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] have hc : Fintype.card Oˣ = 6 := by simpa only [Nat.card_eq_fintype_card] using card_units_eq_six rw [hc] norm_num theorem tsum_unit_invariant_of_zero (f : O → ℂ) (hf : Summable f) (h0 : f 0 = 0) (hu : ∀ (u : Oˣ) (z : O), f (u.val * z) = f z) : (∑' z : O, f z) = (6 : ℂ) * ∑' I : NonzeroIdeal, f (idealGenerator I.val) := by have he : (∑' z : NonzeroElement, f z.val) = ∑' z : O, f z := by apply tsum_subtype_eq_of_support_subset intro z hz exact fun hz0 => hz (hz0 ▸ h0) rw [← he] exact tsum_nonzero_unit_invariant f hf hu end UnrestrictedIdealReindex end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.UnrestrictedCharacters namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss def unrestrictedPairCharacter (I J lengthScale : Ideal O) : ℂ := quadraticRow I (idealGenerator lengthScale) * quadraticRow J (idealGenerator lengthScale) theorem unrestrictedPairCharacter_span (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (z : O) : unrestrictedPairCharacter I J (Ideal.span {z}) = quadraticRow I z * quadraticRow J z := by have ha : Associated (idealGenerator (Ideal.span {z})) z := Ideal.span_singleton_eq_span_singleton.mp (span_idealGenerator _) obtain ⟨u, hu⟩ := ha have hv := canonical_pair_unit_invariant I J hI hJ hray u (idealGenerator (Ideal.span {z})) have he : u.val * idealGenerator (Ideal.span {z}) = z := by simpa only [mul_comm] using hu rw [he] at hv exact hv.symm theorem unrestrictedPairCharacter_mul (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (A B : Ideal O) : unrestrictedPairCharacter I J (A * B) = unrestrictedPairCharacter I J A * unrestrictedPairCharacter I J B := by have hs : Ideal.span {idealGenerator A * idealGenerator B} = A * B := by rw [← Ideal.span_singleton_mul_span_singleton, span_idealGenerator, span_idealGenerator] rw [← hs, unrestrictedPairCharacter_span I J hI hJ hray] rw [canonical_quadraticRow_argument_mul I hI, canonical_quadraticRow_argument_mul J hJ] unfold unrestrictedPairCharacter ring theorem unrestrictedPairCharacter_eq_primary (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (lengthScale : Ideal O) (hL : Supported lengthScale) : unrestrictedPairCharacter I J lengthScale = quadraticRow I (primaryGenerator lengthScale) * quadraticRow J (primaryGenerator lengthScale) := by have hz := PrimaryIdealUnitReindex.primaryGenerator_ne_zero_of_good_factors lengthScale hL.1 (fun P hP => (hL.2 P hP).1) have h := unrestrictedPairCharacter_span I J hI hJ hray (primaryGenerator lengthScale) rw [(primaryGenerator_spec lengthScale hz).1] at h exact h open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open EisensteinSchwartzPoisson UnrestrictedIdealReindex GaussGeneratorTransport theorem idealGenerator_norm_sq (lengthScale : Ideal O) : ‖eisEmbedding (idealGenerator lengthScale)‖ ^ 2 = (Ideal.absNorm lengthScale : ℝ) := by rw [eisEmbedding_norm_sq_eq_absNorm_span, span_idealGenerator] theorem canonical_pair_fourier_summable (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (t : ℝ) (ht : 0 < t) : Summable (fun h : O => (quadraticRow I h * quadraticRow J h) * paperRadialFourier W (t * ‖eisEmbedding h‖ ^ 2)) := by apply Summable.of_norm apply Summable.of_nonneg_of_le (fun h => norm_nonneg _) _ (paperRadialFourier_lattice_summable_norm W t ht) intro h simp only [norm_mul] calc _ ≤ (1 * 1) * ‖paperRadialFourier W (t * ‖eisEmbedding h‖ ^ 2)‖ := by gcongr · exact quadraticRow_norm_le_one I h · exact quadraticRow_norm_le_one J h _ = _ := by ring theorem canonical_nonprincipal_dual_ideal_reindex (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (hnt : I ≠ 1 ∨ J ≠ 1) (W : 𝓢(ℝ, ℂ)) (t : ℝ) (ht : 0 < t) : (∑' h : O, (quadraticRow I h * quadraticRow J h) * paperRadialFourier W (t * ‖eisEmbedding h‖ ^ 2)) = (6 : ℂ) * ∑' lengthScale : NonzeroIdeal, unrestrictedPairCharacter I J lengthScale.val * paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ)) := by let f : O → ℂ := fun h => (quadraticRow I h * quadraticRow J h) * paperRadialFourier W (t * ‖eisEmbedding h‖ ^ 2) have hf : Summable f := canonical_pair_fourier_summable I J W t ht have h0 : f 0 = 0 := by dsimp only [f] rw [quadratic_pair_zero_of_nontrivial I J hI hJ hnt, zero_mul] have hu (u : Oˣ) (z : O) : f (u.val * z) = f z := by dsimp only [f] rw [canonical_pair_unit_invariant I J hI hJ hray, norm_eisEmbedding_unit_mul] have he := tsum_unit_invariant_of_zero f hf h0 hu simpa only [f, idealGenerator_norm_sq, unrestrictedPairCharacter] using he end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open IdealMobiusDivisorSum def fixedBadPrimes : Finset (Ideal O) := {Ideal.span {lambda}, Ideal.span {(2 : O)}} theorem prime_good_iff_not_bad (P : Ideal O) [P.IsMaximal] : (lambda ∉ P ∧ ringChar (O ⧸ P) ≠ 2) ↔ P ∉ fixedBadPrimes := by constructor · rintro ⟨hl, hc⟩ hp rcases Finset.mem_insert.mp hp with hp | hp · exact hl (hp ▸ Ideal.subset_span (by simp)) · have he : P = Ideal.span {(2 : O)} := Finset.mem_singleton.mp hp exact hc (he ▸ twoIdeal_characteristic) · intro hp constructor · intro hl have he := maximal_ideal_eq_span_of_mem P inferInstance lambda lambdaIdeal_maximal hl exact hp (he ▸ Finset.mem_insert_self _ _) · intro hc have ht : (2 : O) ∈ P := by apply Ideal.Quotient.eq_zero_iff_mem.mp have hz : (2 : O ⧸ P) = 0 := (ringChar.spec (O ⧸ P) 2).mpr (by rw [hc]) simpa only [map_ofNat] using hz have he := maximal_ideal_eq_span_of_mem P inferInstance (2 : O) twoIdeal_maximal ht exact hp (he ▸ Finset.mem_insert_of_mem (Finset.mem_singleton_self _)) def badPrimeSupport (I : Ideal O) : Finset (Ideal O) := IdealMobiusDivisorSum.primeSupport I ∩ fixedBadPrimes def goodPrimeSupport (I : Ideal O) : Finset (Ideal O) := IdealMobiusDivisorSum.primeSupport I \ fixedBadPrimes def goodSquarefreePart (I : Ideal O) : Ideal O := ∏ P ∈ goodPrimeSupport I, P theorem badPrimeSupport_subset (I : Ideal O) : badPrimeSupport I ⊆ fixedBadPrimes := Finset.inter_subset_right theorem goodSquarefreePart_admissible (I : Ideal O) : Admissible (goodSquarefreePart I) := by have hs : goodPrimeSupport I ⊆ IdealMobiusDivisorSum.primeSupport I := Finset.sdiff_subset refine ⟨support_product_ne_zero hs, squarefree_support_product hs, ?_⟩ intro P hP change P ∈ UniqueFactorizationMonoid.normalizedFactors (∏ Q ∈ goodPrimeSupport I, Q) at hP rw [factors_support_product hs] at hP have hp : P ∈ goodPrimeSupport I := hP have hprime := support_prime (hs hp) let : P.IsMaximal := (Ideal.isPrime_of_prime hprime).isMaximal hprime.ne_zero exact (prime_good_iff_not_bad P).mpr (Finset.mem_sdiff.mp hp).2 theorem squarefree_bad_good_product (I : Ideal O) (hI : Squarefree I) : (∏ P ∈ badPrimeSupport I, P) * goodSquarefreePart I = I := by have hu : badPrimeSupport I ∪ goodPrimeSupport I = IdealMobiusDivisorSum.primeSupport I := by ext P simp only [badPrimeSupport, goodPrimeSupport, Finset.mem_union, Finset.mem_inter, Finset.mem_sdiff] tauto have hd : Disjoint (badPrimeSupport I) (goodPrimeSupport I) := by apply Finset.disjoint_left.mpr intro P hp hq exact (Finset.mem_sdiff.mp hq).2 (Finset.mem_inter.mp hp).2 rw [goodSquarefreePart, ← Finset.prod_union hd, hu] exact squarefree_support_product_self hI theorem unrestrictedPairCharacter_squarefree_bad_split (I J B : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (hB : Squarefree B) : unrestrictedPairCharacter I J B = unrestrictedPairCharacter I J (∏ P ∈ badPrimeSupport B, P) * (quadraticRow I (primaryGenerator (goodSquarefreePart B)) * quadraticRow J (primaryGenerator (goodSquarefreePart B))) := by conv_lhs => rw [← squarefree_bad_good_product B hB] rw [unrestrictedPairCharacter_mul I J hI hJ hray, unrestrictedPairCharacter_eq_primary I J hI hJ hray _ (admissible_supported (goodSquarefreePart_admissible B))] end section open ActualEisensteinCubic ConcretePrimeRowBridge theorem fixedBadPrimes_card : fixedBadPrimes.card = 2 := by have hn : (Ideal.span {lambda} : Ideal O) ≠ Ideal.span {(2 : O)} := by intro h have hb : badPrime false = badPrime true := h have := badPrime_injective hb cases this simp [fixedBadPrimes, hn] theorem fixedBadPrimes_powerset_card : fixedBadPrimes.powerset.card = 4 := by rw [Finset.card_powerset, fixedBadPrimes_card] norm_num def badPrimeSector (I : Ideal O) : fixedBadPrimes.powerset := ⟨badPrimeSupport I, Finset.mem_powerset.mpr (badPrimeSupport_subset I)⟩ theorem goodSquarefreePart_injective_on_sector (I J : Ideal O) (hI : Squarefree I) (hJ : Squarefree J) (hs : badPrimeSector I = badPrimeSector J) (hg : goodSquarefreePart I = goodSquarefreePart J) : I = J := by have he : badPrimeSupport I = badPrimeSupport J := congrArg Subtype.val hs calc I = (∏ P ∈ badPrimeSupport I, P) * goodSquarefreePart I := (squarefree_bad_good_product I hI).symm _ = (∏ P ∈ badPrimeSupport J, P) * goodSquarefreePart J := by rw [he, hg] _ = J := squarefree_bad_good_product J hJ theorem goodSquarefreePart_norm_le (I : Ideal O) (hI : Squarefree I) : Ideal.absNorm (goodSquarefreePart I) ≤ Ideal.absNorm I := by have hd : goodSquarefreePart I ∣ I := by exact ⟨∏ P ∈ badPrimeSupport I, P, (squarefree_bad_good_product I hI).symm.trans (mul_comm _ _)⟩ apply Nat.le_of_dvd · exact Nat.pos_iff_ne_zero.mpr (fun hn => hI.ne_zero (Ideal.absNorm_eq_zero_iff.mp hn)) · exact map_dvd Ideal.absNorm hd theorem goodSquarefreePart_mem_idealRange (I : Ideal O) (hI : Squarefree I) (M : ℝ) (hM : (Ideal.absNorm I : ℝ) ≤ M) : goodSquarefreePart I ∈ idealRange M := by apply mem_idealRange.mpr exact ⟨goodSquarefreePart_admissible I, (Nat.cast_le.mpr (goodSquarefreePart_norm_le I hI)).trans hM⟩ end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open FiniteSieveOperator end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open EisensteinSchwartzPoisson GaussGeneratorTransport UnrestrictedIdealReindex def originalPairIdealDualKernel (D I J : Ideal O) (W : ℝ → ℂ) (M : ℝ) : ℂ := let I' := idealQuotient D I let J' := idealQuotient D J let n := primaryGenerator I' * primaryGenerator J' let χ := fun z => quadraticRow I' z * quadraticRow J' z let R := fun P : gcdMaskPrimes D => P.val ((M : ℂ) / (‖eisEmbedding n‖ : ℂ)) * ∑ E ∈ (Finset.univ : Finset (gcdMaskPrimes D)).powerset, let d := primeSubsetGenerator R E ((UniqueFactorizationMonoid.moebius (∏ i ∈ E, R i) : ℂ) * χ d / (‖eisEmbedding d‖ ^ 2 : ℝ)) * ∑' lengthScale : NonzeroIdeal, unrestrictedPairCharacter I' J' lengthScale.val * paperRadialFourier W (M * (Ideal.absNorm lengthScale.val : ℝ) / (‖eisEmbedding d‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) theorem originalPairDualKernel_eq_ideal (D I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hDI : D ∣ I) (hDJ : D ∣ J) (hIJ : I ≠ J) (hray : columnRay I = columnRay J) (W : 𝓢(ℝ, ℂ)) (M : ℝ) (hM : 0 < M) : originalPairDualKernel D I J W M = originalPairIdealDualKernel D I J W M := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.gcdMaskPrimes_maximal let Q := idealQuotient D I let T := idealQuotient D J let n := primaryGenerator Q * primaryGenerator T let R := fun P : gcdMaskPrimes D => P.val let χ := fun z => quadraticRow Q z * quadraticRow T z let a := fun E : Finset (gcdMaskPrimes D) => (UniqueFactorizationMonoid.moebius (∏ i ∈ E, R i) : ℂ) * χ (primeSubsetGenerator R E) / (‖eisEmbedding (primeSubsetGenerator R E)‖ ^ 2 : ℝ) let f := fun E : Finset (gcdMaskPrimes D) => ∑' h : O, χ h * paperRadialFourier W (M * ‖eisEmbedding h‖ ^ 2 / (‖eisEmbedding (primeSubsetGenerator R E)‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) let g := fun E : Finset (gcdMaskPrimes D) => ∑' lengthScale : NonzeroIdeal, unrestrictedPairCharacter Q T lengthScale.val * paperRadialFourier W (M * (Ideal.absNorm lengthScale.val : ℝ) / (‖eisEmbedding (primeSubsetGenerator R E)‖ ^ 2 * ‖eisEmbedding n‖ ^ 2)) have hQ : Admissible Q := admissible_idealQuotient hI hDI have hT : Admissible T := admissible_idealQuotient hJ hDJ have hn0 : n ≠ 0 := mul_ne_zero (supported_primaryGenerator_ne_zero Q (admissible_supported hQ)) (supported_primaryGenerator_ne_zero T (admissible_supported hT)) have hn : 0 < ‖eisEmbedding n‖ := norm_pos_iff.mpr (eisEmbedding_ne_zero hn0) have hfg (E : Finset (gcdMaskPrimes D)) : f E = 6 * g E := by have hd : 0 < ‖eisEmbedding (primeSubsetGenerator R E)‖ := norm_pos_iff.mpr (eisEmbedding_ne_zero (primeSubsetGenerator_ne_zero R E)) let X := M / (‖eisEmbedding (primeSubsetGenerator R E)‖ ^ 2 * ‖eisEmbedding n‖ ^ 2) have hX : 0 < X := div_pos hM (mul_pos (sq_pos_of_pos hd) (sq_pos_of_pos hn)) have he := canonical_nonprincipal_dual_ideal_reindex Q T hQ hT (columnRay_idealQuotient_eq D I J hI hJ hDI hDJ hray) (residual_pair_nontrivial D I J hDI hDJ hIJ) W X hX have harg (r : ℝ) : X * r = M * r / (‖eisEmbedding (primeSubsetGenerator R E)‖ ^ 2 * ‖eisEmbedding n‖ ^ 2) := by dsimp only [X] ring simpa only [harg, f, g, χ] using he have hs : (∑ E ∈ (Finset.univ : Finset (gcdMaskPrimes D)).powerset, a E * f E) = 6 * ∑ E ∈ (Finset.univ : Finset (gcdMaskPrimes D)).powerset, a E * g E := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro E _ rw [hfg] ring change ((M : ℂ) / (6 * ‖eisEmbedding n‖ : ℂ)) * (∑ E ∈ (Finset.univ : Finset (gcdMaskPrimes D)).powerset, a E * f E) = ((M : ℂ) / (‖eisEmbedding n‖ : ℂ)) * (∑ E ∈ (Finset.univ : Finset (gcdMaskPrimes D)).powerset, a E * g E) rw [hs] ring end open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open QuadraticSquarefreeKernel UnrestrictedIdealReindex theorem unrestrictedPairCharacter_square (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (A : Ideal O) : unrestrictedPairCharacter I J (A ^ 2) = idealZeroMask I (idealGenerator A) * idealZeroMask J (idealGenerator A) := by rw [pow_two, unrestrictedPairCharacter_mul I J hI hJ hray] unfold unrestrictedPairCharacter calc _ = (quadraticRow I (idealGenerator A) * quadraticRow I (idealGenerator A)) * (quadraticRow J (idealGenerator A) * quadraticRow J (idealGenerator A)) := by ring _ = _ := by rw [canonical_quadraticRow_squared I hI, canonical_quadraticRow_squared J hJ] end CanonicalQuadraticSieve open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform namespace JointLogSeparation open FourierBridge FirstPassCubeLabels theorem joint_separation_twisted_profiles {ι : Type*} [Fintype ι] (g₁ g₂ W : 𝓢(ℝ, ℂ)) (V : ι → ℝ → ℂ) (a₁ a₂ a₃ M : ι → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), ∀ θ₁ θ₂ : ℝ, (∀ y : ι → ℝ, (∏ j, V j (y j)) * (frequencyTwist g₁ θ₁) (∑ j, a₁ j * y j) * (frequencyTwist g₂ θ₂) (∑ j, a₂ j * y j) * EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp (∑ j, a₃ j * y j)) = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, (∏ j, V j (y j)) * logPhase t₁ (∑ j, a₁ j * y j) * logPhase t₂ (∑ j, a₂ j * y j) * logPhase t₃ (∑ j, a₃ j * y j) * ((𝓕 (frequencyTwist g₁ θ₁)) t₁ * (𝓕 (frequencyTwist g₂ θ₂)) t₂ * b t₃)) ∧ (∀ t₁ t₂ t₃ : ℝ, (1 + R) ^ A * ‖(𝓕 (frequencyTwist g₁ θ₁)) t₁ * (𝓕 (frequencyTwist g₂ θ₂)) t₂ * b t₃‖ ≤ C * (1 + ‖θ₁‖)^(J+2) * (1 + ‖θ₂‖)^(J+2) * firstLogDensity J t₁ * firstLogDensity J t₂ * firstLogDensity J t₃) ∧ Integrable (fun t : ℝ => (1 + ‖t‖) ^ J * ‖b t‖) := by classical obtain ⟨C₃, hC₃, hsep⟩ := EisensteinSchwartzPoisson.paperRadialFourier_log_separation_envelope W V a₃ M hM hV A (J + 2) let C₁ := fourierPointBound (J + 2) (twistSourceBound g₁ (J + 2)) let C₂ := fourierPointBound (J + 2) (twistSourceBound g₂ (J + 2)) have hC₁ : 0 ≤ C₁ := fourierPointBound_nonneg _ _ (twistSourceBound_nonneg _ _) have hC₂ : 0 ≤ C₂ := fourierPointBound_nonneg _ _ (twistSourceBound_nonneg _ _) refine ⟨C₁ * C₂ * C₃, by positivity, ?_⟩ intro R hR obtain ⟨b, hb, _, _, hpoint⟩ := hsep R hR refine ⟨b, ?_⟩ intro θ₁ θ₂ let A₁ := frequencyTwist g₁ θ₁ let A₂ := frequencyTwist g₂ θ₂ refine ⟨?_, ?_, AnalyticBridge.schwartz_fourier_one_plus_integrable (𝓕⁻ b) J |>.congr ?_⟩ · intro y let P : ℂ := ∏ j, V j (y j) let s₁ : ℝ := ∑ j, a₁ j * y j let s₂ : ℝ := ∑ j, a₂ j * y j let s₃ : ℝ := ∑ j, a₃ j * y j have hr : P * EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp s₃) = ∫ t, P * logPhase t s₃ * b t := by have hh := hb y simpa only [Finset.prod_mul_distrib, ← logPhase_sum, P, s₃] using hh exact joint_separation_identity A₁ A₂ b P (EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp s₃)) s₁ s₂ s₃ hr · intro t₁ t₂ t₃ have hr₁ := firstLogDensity_nonneg J t₁ have hr₂ := firstLogDensity_nonneg J t₂ have hr₃ := firstLogDensity_nonneg J t₃ have hb₃ : (1 + R) ^ A * ‖b t₃‖ ≤ C₃ * firstLogDensity J t₃ := by rw [firstLogDensity, ← div_eq_mul_inv] apply (le_div_iff₀ (pow_pos (by positivity : 0 < 1 + ‖t₃‖) (J + 2))).mpr simpa only [mul_comm, mul_left_comm, mul_assoc] using hpoint t₃ have h₁ := twisted_profile_fourier_envelope g₁ θ₁ t₁ J have h₂ := twisted_profile_fourier_envelope g₂ θ₂ t₂ J simp only [norm_mul] calc _ = ‖(𝓕 (frequencyTwist g₁ θ₁)) t₁‖ * ‖(𝓕 (frequencyTwist g₂ θ₂)) t₂‖ * ((1 + R)^A * ‖b t₃‖) := by ring _ ≤ (C₁ * (1 + ‖θ₁‖)^(J+2) * firstLogDensity J t₁) * (C₂ * (1 + ‖θ₂‖)^(J+2) * firstLogDensity J t₂) * (C₃ * firstLogDensity J t₃) := by apply mul_le_mul · exact mul_le_mul h₁ h₂ (norm_nonneg _) (by positivity) · exact hb₃ · positivity · positivity _ = _ := by ring · filter_upwards [] with t simp end JointLogSeparation end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.ConjugateProfiles namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap ContDiff FourierTransform namespace SecondPassIntegration open JointLogSeparation FourierBridge lemma logPhase_conjugate (t x : ℝ) : star (logPhase t x) = logPhase (-t) x := by unfold logPhase simp only [Complex.star_def, ← Complex.exp_conj, map_mul, Complex.conj_ofReal, Complex.conj_I] congr 1 push_cast ring theorem conjugateProfile_frequencyTwist (g : 𝓢(ℝ, ℂ)) (t : ℝ) : conjugateProfile (frequencyTwist g t) = frequencyTwist (conjugateProfile g) (-t) := by ext x simp only [conjugateProfile_apply, frequencyTwist_apply, star_mul, logPhase_conjugate] ring theorem normalized_conjugate_frequencyTwist (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g : 𝓢(ℝ, ℂ)) (t : ℝ) : conjugateProfile (halfNormalizationCLM U (frequencyTwist g t)) = frequencyTwist (conjugateProfile (halfNormalizationCLM U g)) (-t) := by rw [halfNormalization_twist U hUc hUs, conjugateProfile_frequencyTwist] end SecondPassIntegration namespace JointLogSeparation open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform open FourierBridge FirstPassCubeLabels theorem seven_kernel_twisted_profiles (g₁ g₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), ∀ θ₁ θ₂ : ℝ, (∀ z ud ue uv kap x₁ x₂ : ℝ, outerWindow V z ud ue uv kap * V 5 x₁ * V 6 x₂ * (frequencyTwist g₁ θ₁) (z + x₁) * (frequencyTwist g₂ θ₂) (z + x₂) * EisensteinSchwartzPoisson.paperRadialFourier W (R * Real.exp (kap - ud - 2 * ue - 2 * uv - x₁ - x₂)) = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, outerWindow V z ud ue uv kap * logPhase (t₁ + t₂) z * logPhase t₃ (kap - ud - 2 * ue - 2 * uv) * fixedColumnTest (V 5) (t₁ - t₃) x₁ * fixedColumnTest (V 6) (t₂ - t₃) x₂ * ((𝓕 (frequencyTwist g₁ θ₁)) t₁ * (𝓕 (frequencyTwist g₂ θ₂)) t₂ * b t₃)) ∧ (∀ t₁ t₂ t₃ : ℝ, (1 + R) ^ A * ‖(𝓕 (frequencyTwist g₁ θ₁)) t₁ * (𝓕 (frequencyTwist g₂ θ₂)) t₂ * b t₃‖ ≤ C * (1+‖θ₁‖)^(J+2) * (1+‖θ₂‖)^(J+2) * firstLogDensity J t₁ * firstLogDensity J t₂ * firstLogDensity J t₃) ∧ Integrable (fun t : ℝ => (1 + ‖t‖) ^ J * ‖b t‖) := by let a₁ : Fin 7 → ℝ := ![1, 0, 0, 0, 0, 1, 0] let a₂ : Fin 7 → ℝ := ![1, 0, 0, 0, 0, 0, 1] let a₃ : Fin 7 → ℝ := ![0, -1, -2, -2, 1, -1, -1] obtain ⟨C, hC, hsep⟩ := joint_separation_twisted_profiles g₁ g₂ W V a₁ a₂ a₃ M hM hV A J refine ⟨C, hC, ?_⟩ intro R hR obtain ⟨b, hb⟩ := hsep R hR refine ⟨b, ?_⟩ intro θ₁ θ₂ obtain ⟨hb, hpoint, hint⟩ := hb θ₁ θ₂ refine ⟨?_, hpoint, hint⟩ intro z ud ue uv kap x₁ x₂ let y : Fin 7 → ℝ := ![z, ud, ue, uv, kap, x₁, x₂] have h₁ : (∑ j, a₁ j * y j) = z + x₁ := by simp [a₁, y, Fin.sum_univ_succ] have h₂ : (∑ j, a₂ j * y j) = z + x₂ := by simp [a₂, y, Fin.sum_univ_succ] have h₃ : (∑ j, a₃ j * y j) = kap - ud - 2 * ue - 2 * uv - x₁ - x₂ := by simp [a₃, y, Fin.sum_univ_succ] ring have hp : (∏ j, V j (y j)) = outerWindow V z ud ue uv kap * V 5 x₁ * V 6 x₂ := by simp [outerWindow, y, Fin.prod_univ_succ, mul_assoc] have h := hb y rw [h₁, h₂, h₃, hp] at h rw [h] apply integral_congr_ae filter_upwards [] with t₁ apply integral_congr_ae filter_upwards [] with t₂ apply integral_congr_ae filter_upwards [] with t₃ have heq := seven_phase_factor z ud ue uv kap x₁ x₂ t₁ t₂ t₃ unfold fixedColumnTest calc _ = (outerWindow V z ud ue uv kap * V 5 x₁ * V 6 x₂) * (logPhase t₁ (z + x₁) * logPhase t₂ (z + x₂) * logPhase t₃ (kap - ud - 2 * ue - 2 * uv - x₁ - x₂)) * ((𝓕 (frequencyTwist g₁ θ₁)) t₁ * (𝓕 (frequencyTwist g₂ θ₂)) t₂ * b t₃) := by ring _ = _ := by rw [heq]; ring end JointLogSeparation open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstCauchyArithmetic (supportMobius) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) include hinj theorem secondPreColumn_zero_of_common_overlap (Ψ : O →* ℂ) (m c d e k : O) (H : Finset ι → ℂ) (G S : Finset ι) (hSG : ¬ Disjoint S G) : secondPreColumn p hp hcop hg Ψ (m * ∏ i ∈ G, p i) c d e k H S = 0 := by have hm : rowCoprimeMask (fun i => Ideal.span {p i}) S (m * ∏ i ∈ G, p i) = 0 := by rw [FirstPassCubeLabels.mask_mul _ hg S, commonProduct_mask p hg hinj S G, if_neg hSG, mul_zero] simp only [secondPreColumn, hm, mul_zero, zero_mul] theorem weighted_secondChildKernelPair_congr_off_common (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (G E : Finset ι) (hEG : E ⊆ G) (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m c d k₁ k₂ : O) (K lengthScale : Finset ι → Finset ι → ℂ) (hKL : ∀ S T, Disjoint G S → Disjoint G T → K S T = lengthScale S T) : let e := primeSubsetGenerator (fun i => Ideal.span {p i}) E let r := secondMaskQuotient p E G hEG secondCommonWeight p hp hcop hg Ψ₁ Ψ₂ m r c d e k₁ k₂ V * secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k₁ k₂ K = secondCommonWeight p hp hcop hg Ψ₁ Ψ₂ m r c d e k₁ k₂ V * secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k₁ k₂ lengthScale := by dsimp only let e := primeSubsetGenerator (fun i => Ideal.span {p i}) E let r := secondMaskQuotient p E G hEG let w := secondCommonWeight p hp hcop hg Ψ₁ Ψ₂ m r c d e k₁ k₂ V unfold secondChildKernelPair simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro N hN apply Finset.sum_congr rfl intro M hM have hVN : Disjoint V N := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hN) disjoint_sdiff_self_right have hVM : Disjoint V M := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hM) disjoint_sdiff_self_right have hcoeff : w * (star (secondChildColumn p hp hcop hg Ψ₁ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k₁) (fun _ => 1) N) * secondChildColumn p hp hcop hg Ψ₂ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k₂) (fun _ => 1) M) = supportMobius (fun i => Ideal.span {p i}) V * star (secondPreColumn p hp hcop hg Ψ₁ (m*(e*r)) c d e k₁ (fun _ => 1) (V∪N)) * secondPreColumn p hp hcop hg Ψ₂ (m*(e*r)) c d e k₂ (fun _ => 1) (V∪M) := by rw [secondPreColumn_union p hp hcop hg hpr Ψ₁ m r c d e k₁ (fun _ => 1) V N hVN, secondPreColumn_union p hp hcop hg hpr Ψ₂ m r c d e k₂ (fun _ => 1) V M hVM] simp only [w, secondCommonWeight, star_mul] ring change w * (_ * K (V∪N) (V∪M)) = w * (_ * lengthScale (V∪N) (V∪M)) conv_lhs => rw [← mul_assoc w, hcoeff] conv_rhs => rw [← mul_assoc w, hcoeff] by_cases hGN : Disjoint G (V∪N) · by_cases hGM : Disjoint G (V∪M) · rw [hKL _ _ hGN hGM] · have hz := secondPreColumn_zero_of_common_overlap p hp hcop hg hinj Ψ₂ m c d e k₂ (fun _ => 1) G (V∪M) (fun h => hGM h.symm) rw [secondMaskQuotient_spec p E G hEG] at hz change secondPreColumn p hp hcop hg Ψ₂ (m*(e*r)) c d e k₂ (fun _ => 1) (V∪M) = 0 at hz rw [hz] ring · have hz := secondPreColumn_zero_of_common_overlap p hp hcop hg hinj Ψ₁ m c d e k₁ (fun _ => 1) G (V∪N) (fun h => hGN h.symm) rw [secondMaskQuotient_spec p E G hEG] at hz change secondPreColumn p hp hcop hg Ψ₁ (m*(e*r)) c d e k₁ (fun _ => 1) (V∪N) = 0 at hz rw [hz, star_zero] ring theorem weighted_secondRayChild_congr_off_common (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (G E : Finset ι) (hEG : E ⊆ G) (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m c d k : O) (z : SecondRayIndex) (K lengthScale : Finset ι → Finset ι → ℂ) (hKL : ∀ S T, Disjoint G S → Disjoint G T → K S T = lengthScale S T) : let e := primeSubsetGenerator (fun i => Ideal.span {p i}) E let r := secondMaskQuotient p E G hEG secondTotalWeight p hp hcop hg Ψ₁ Ψ₂ m r c d e k (z,V) * secondChildKernelPair p hp hcop hg F V (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m r c d e k (-k) K = secondTotalWeight p hp hcop hg Ψ₁ Ψ₂ m r c d e k (z,V) * secondChildKernelPair p hp hcop hg F V (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m r c d e k (-k) lengthScale := by dsimp only simp only [secondTotalWeight, mul_assoc] congr 1 exact weighted_secondChildKernelPair_congr_off_common p hp hcop hg hinj hpr G E hEG F V (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m c d k (-k) K lengthScale hKL end section open ActualEisensteinCubic variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem secondChildKernelPair_eq_of_quotient_span (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r r' c d e k₁ k₂ : O) (hr : Ideal.span {r} = Ideal.span {r'}) (K : Finset ι → Finset ι → ℂ) : secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k₁ k₂ K = secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r' c d e k₁ k₂ K := by have hc (Ψ : O →* ℂ) (y : O) (N : Finset ι) : secondChildColumn p hp hcop hg Ψ (m*r) (c*e*∏ i ∈ V, p i) y (fun _ => 1) N = secondChildColumn p hp hcop hg Ψ (m*r') (c*e*∏ i ∈ V, p i) y (fun _ => 1) N := by simp only [secondChildColumn, rowCoprimeMask_mul_eq_of_span_eq (fun i => Ideal.span {p i}) N m hr] simp only [secondChildKernelPair, hc] theorem secondChildKernelPair_const_kernel (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k₁ k₂ : O) (a : ℂ) (K : Finset ι → Finset ι → ℂ) : secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k₁ k₂ (fun S T => a * K S T) = a * secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k₁ k₂ K := by simp only [secondChildKernelPair, Finset.mul_sum] apply Finset.sum_congr rfl intro N hN apply Finset.sum_congr rfl intro M hM ring end section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm) open JointLogSeparation (halfNormalizationCLM) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) include hinj theorem weighted_secondRayChild_normalized (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (G E : Finset ι) (hEG : E ⊆ G) (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m c d k r : O) (z : SecondRayIndex) (hr : Ideal.span {secondMaskQuotient p E G hEG} = Ideal.span {r}) (X Y : ℝ) (hX : 0 < X) (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g₁ g₂ W : 𝓢(ℝ, ℂ)) (hU₁ : ∀ t, g₁ t ≠ 0 → U t = 1) (hU₂ : ∀ t, g₂ t ≠ 0 → U t = 1) : let e := primeSubsetGenerator (fun i => Ideal.span {p i}) E let q := secondMaskQuotient p E G hEG let X' := X / (‖eisEmbedding e‖ ^ 2 * ‖eisEmbedding r‖ ^ 2) secondTotalWeight p hp hcop hg Ψ₁ Ψ₂ m q c d e k (z,V) * secondChildKernelPair p hp hcop hg F V (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m q c d e k (-k) (secondSourcePairKernel p e k (fun A => normalizedColumn p (fun B => g₁ (columnLog p X B)) (G∪A)) (fun A => normalizedColumn p (fun B => g₂ (columnLog p X B)) (G∪A)) W Y) = ((X : ℂ)⁻¹ * secondTotalWeight p hp hcop hg Ψ₁ Ψ₂ m q c d e k (z,V)) * secondChildKernelPair p hp hcop hg F V (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m r c d e k (-k) (radialPairKernel p e k W (halfNormalizationCLM U g₁) (halfNormalizationCLM U g₂) X' X' Y) := by dsimp only let e := primeSubsetGenerator (fun i => Ideal.span {p i}) E let q := secondMaskQuotient p E G hEG let K := secondSourcePairKernel p e k (fun A => normalizedColumn p (fun B => g₁ (columnLog p X B)) (G∪A)) (fun A => normalizedColumn p (fun B => g₂ (columnLog p X B)) (G∪A)) W Y let lengthScale := radialPairKernel p e k W (halfNormalizationCLM U g₁) (halfNormalizationCLM U g₂) (X / primeProductNorm p G) (X / primeProductNorm p G) Y have hn := weighted_secondRayChild_congr_off_common p hp hcop hg hinj hpr G E hEG F V Ψ₁ Ψ₂ m c d k z K (fun S T => (X : ℂ)⁻¹ * lengthScale S T) (fun S T hGS hGT => secondSourcePairKernel_normalized_shift p hp G S T hGS hGT e k X Y hX U hUc hUs g₁ g₂ W hU₁ hU₂) dsimp only at hn rw [secondChildKernelPair_const_kernel] at hn rw [secondChildKernelPair_eq_of_quotient_span p hp hcop hg F V (secondRayMinus Ψ₁ z) (secondRayPlus Ψ₂ z) m q r c d e k (-k) hr lengthScale] at hn dsimp only [K, lengthScale, e, q] at hn rw [residual_scale_quotient_sector p X E G hEG r hr] at hn simpa only [mul_left_comm, mul_assoc] using hn end section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm jLabel) open JointLogSeparation (halfNormalizationCLM) open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] def secondExpansionQuotient (x : SecondExpansionData ι) : O := if h : x.divisor ⊆ x.sourceCommon then secondMaskQuotient p x.divisor x.sourceCommon h else 0 omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem secondExpansionQuotient_of_subset (x : SecondExpansionData ι) (h : x.divisor ⊆ x.sourceCommon) : secondExpansionQuotient p x = secondMaskQuotient p x.divisor x.sourceCommon h := by simp [secondExpansionQuotient, h] def secondExpansionScale (X : ℝ) (r : O) (x : SecondSupportData ι) : ℝ := X / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) x.secondDivisor)‖ ^ 2 * ‖eisEmbedding r‖ ^ 2) end variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) def secondExpansionSource (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (z : SecondRayIndex) (s : Finset (SecondExpansionData ι)) (H₁ H₂ : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) : ℂ := ∑ x ∈ s, ((Y : ℂ) * secondSourceCommonCoefficient p hg Ψ m c d x.sourceCommon x.divisor) * (secondTotalWeight p hp hcop hg Ψ Ψ m (secondExpansionQuotient p x) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) x.frequency (z,x.overlap) * secondChildKernelPair p hp hcop hg F x.overlap (secondRayMinus Ψ z) (secondRayPlus Ψ z) m (secondExpansionQuotient p x) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) x.frequency (-x.frequency) (secondSourcePairKernel p (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) x.frequency (fun A => H₁ (x.sourceCommon∪A)) (fun A => H₂ (x.sourceCommon∪A)) W Y)) def secondNormalizedExpansionWeight (Ψ : O →* ℂ) (m c d : O) (z : SecondRayIndex) (X Y : ℝ) (x : SecondExpansionData ι) : ℂ := ((Y : ℂ) * secondSourceCommonCoefficient p hg Ψ m c d x.sourceCommon x.divisor) * ((X : ℂ)⁻¹ * secondTotalWeight p hp hcop hg Ψ Ψ m (secondExpansionQuotient p x) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) x.frequency (z,x.overlap)) end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open FirstCauchyArithmetic (supportMobius) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) omit [DecidableEq ι] in theorem secondInputCoefficient_norm_le (Ψ : O →* ℂ) (m c d : O) (G : Finset ι) : ‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) G‖ ≤ ‖Ψ (∏ i ∈ G, p i)‖ := by have hm : ‖rowCoprimeMask (fun i => Ideal.span {p i}) G m‖ ≤ 1 := by unfold rowCoprimeMask split_ifs <;> norm_num simp only [secondInputCoefficient, norm_mul, norm_pow, mul_one] calc _ ≤ ‖Ψ (∏ i ∈ G, p i)‖ * 1 * 1 ^ 4 * 1 := by gcongr <;> first | exact hm | exact finiteSquarefreeRow_norm_le_one _ hg G _ _ = _ := by ring theorem secondNormalizedExpansionWeight_after_scale (C D : Finset ι) (Ψ : O →* ℂ) (m c d r : O) (z : SecondRayIndex) (X Y : ℝ) (hX : 0 < X) (x : SecondExpansionData ι) : secondNormalizedExpansionWeight p hp hcop hg Ψ m c d z X Y x * (secondExpansionScale p X r (expansionSupportData C D x) : ℂ)⁻¹ = ((Y : ℂ) * (‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) x.sourceCommon‖ ^ 2 : ℝ) * (UniqueFactorizationMonoid.moebius (∏ i ∈ x.divisor, Ideal.span {p i}) : ℂ) * (‖eisEmbedding r‖ ^ 2 : ℝ) / (X : ℂ) ^ 2) * secondTotalWeight p hp hcop hg Ψ Ψ m (secondExpansionQuotient p x) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) x.frequency (z,x.overlap) := by have hNe : (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor)‖ ^ 2 : ℝ) ≠ 0 := by exact ne_of_gt (SecondPassIntegration.elementNorm_pos _ (primeSubsetGenerator_ne_zero _ _)) have hNec : ((‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor)‖ ^ 2 : ℝ) : ℂ) ≠ 0 := by exact_mod_cast hNe have hXc : (X : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt hX simp only [secondNormalizedExpansionWeight, secondSourceCommonCoefficient, secondExpansionScale, expansionSupportData, Complex.ofReal_div, Complex.ofReal_mul] field_simp include hinj in theorem secondNormalizedExpansionWeight_norm_le (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (C D : Finset ι) (Ψ : O →* ℂ) (m c d r : O) (z : SecondRayIndex) (X Y : ℝ) (hX : 0 < X) (hY : 0 ≤ Y) (x : SecondExpansionData ι) (hΨG : ‖Ψ (∏ i ∈ x.sourceCommon, p i)‖ ≤ 1) (hΨV : ‖Ψ (∏ i ∈ x.overlap, p i)‖ ≤ 1) : ‖secondNormalizedExpansionWeight p hp hcop hg Ψ m c d z X Y x * (secondExpansionScale p X r (expansionSupportData C D x) : ℂ)⁻¹‖ ≤ Y * ‖eisEmbedding r‖ ^ 2 / X ^ 2 * ‖secondRayCoefficient z‖ := by have hA := (secondInputCoefficient_norm_le p hg Ψ m c d x.sourceCommon).trans hΨG have hA2 : ‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) x.sourceCommon‖ ^ 2 ≤ 1 := by simpa using pow_le_pow_left₀ (norm_nonneg _) hA 2 have hT := secondTotalWeight_norm_le p hp hcop hg hinj hc Ψ Ψ m (secondExpansionQuotient p x) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) x.frequency z x.overlap hΨV hΨV have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance have hmu : ‖(UniqueFactorizationMonoid.moebius (∏ i ∈ x.divisor, Ideal.span {p i}) : ℂ)‖ = 1 := by have hm := congrArg norm (FirstCauchyArithmetic.supportMobius_sq _ hprime hinj x.divisor) simp only [norm_mul, norm_one] at hm change ‖supportMobius (fun i => Ideal.span {p i}) x.divisor‖ = 1 nlinarith [norm_nonneg (supportMobius (fun i => Ideal.span {p i}) x.divisor)] rw [secondNormalizedExpansionWeight_after_scale p hp hcop hg C D Ψ m c d r z X Y hX x] simp only [norm_mul, norm_div, norm_pow, Complex.norm_of_nonneg hY, Complex.norm_of_nonneg (sq_nonneg _), Complex.norm_of_nonneg (le_of_lt hX), hmu, mul_one] calc _ ≤ Y * 1 * ‖eisEmbedding r‖ ^ 2 / X ^ 2 * ‖secondRayCoefficient z‖ := by gcongr _ = _ := by ring end SecondPassArithmetic open scoped BigOperators Classical namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma isUnit_quotient_span_iff (c d : O) : IsUnit (Ideal.Quotient.mk (Ideal.span {c}) d) ↔ IsCoprime c d := by constructor · intro hd obtain ⟨b, hb⟩ := isUnit_iff_exists_inv.mp hd obtain ⟨b, rfl⟩ := Ideal.Quotient.mk_surjective b have hdiv : c ∣ d*b-1 := by apply Ideal.mem_span_singleton.mp apply Ideal.Quotient.eq_zero_iff_mem.mp simpa only [map_sub,map_mul,map_one,sub_eq_zero] using hb obtain ⟨k,hk⟩ := hdiv exact ⟨-k,b,by linear_combination hk⟩ · rintro ⟨a,b,hab⟩ apply isUnit_iff_exists_inv.mpr refine ⟨Ideal.Quotient.mk (Ideal.span {c}) b, ?_⟩ have hc : Ideal.Quotient.mk (Ideal.span {c}) c=0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.subset_span (by simp)) have h := congrArg (Ideal.Quotient.mk (Ideal.span {c})) hab simpa only [map_add,map_mul,map_one,hc,mul_zero,zero_mul,zero_add,mul_comm] using h abbrev AffineUnitResidue (c : O) := {u : O ⧸ Ideal.span {c} // IsUnit (1+3*u)} lemma affine_representative_condition (c : O) (u : AffineUnitResidue c) : denominatorCondition c (1+3*GaussianShiftedPartition.representative c u.1) := by refine ⟨(isUnit_quotient_span_iff c _).mp ?_, ⟨_,by ring⟩⟩ simpa only [map_add,map_mul,map_one,map_ofNat, GaussianShiftedPartition.representative_spec] using u.2 def affineResidueMap (c : O) (u : AffineUnitResidue c) : AdmissibleResidue c := ⟨Ideal.Quotient.mk (Ideal.span {3*c}) (1+3*GaussianShiftedPartition.representative c u.1), by apply (denominatorCondition_congr c _ (1+3*GaussianShiftedPartition.representative c u.1) ?_).mpr (affine_representative_condition c u) apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp exact denominatorRep_spec c _⟩ lemma affineResidueMap_bijective (c : O) : Function.Bijective (affineResidueMap c) := by constructor · intro u v huv have hdiv : 3*c ∣ (1+3*GaussianShiftedPartition.representative c u.1)- (1+3*GaussianShiftedPartition.representative c v.1) := by apply Ideal.mem_span_singleton.mp exact (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp (congrArg Subtype.val huv) obtain ⟨k,hk⟩ := hdiv have hk' : GaussianShiftedPartition.representative c u.1- GaussianShiftedPartition.representative c v.1=c*k := by have h3 : (3:O) ≠ 0 := by norm_num apply mul_left_cancel₀ h3 linear_combination hk apply Subtype.ext rw [← GaussianShiftedPartition.representative_spec c u.1, ← GaussianShiftedPartition.representative_spec c v.1] exact (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr (Ideal.mem_span_singleton.mpr ⟨k,hk'⟩) · intro r obtain ⟨u,hu⟩ := r.2.2 have hd : denominatorRep c r.1=1+3*u := by linear_combination hu let q : AffineUnitResidue c := ⟨Ideal.Quotient.mk (Ideal.span {c}) u, by have hh := (isUnit_quotient_span_iff c _).mpr r.2.1 simpa only [hd,map_add,map_one,map_mul,map_ofNat] using hh⟩ refine ⟨q,Subtype.ext ?_⟩ change Ideal.Quotient.mk (Ideal.span {3*c}) (1+3*GaussianShiftedPartition.representative c q.1)=r.1 rw [← denominatorRep_spec c r.1,hd] apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr apply Ideal.mem_span_singleton.mpr have hrep : c ∣ GaussianShiftedPartition.representative c q.1-u := by apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp exact GaussianShiftedPartition.representative_spec c q.1 obtain ⟨k,hk⟩ := hrep exact ⟨k,by linear_combination 3*hk⟩ def affineResidueEquiv (c : O) : AffineUnitResidue c ≃ AdmissibleResidue c := Equiv.ofBijective (affineResidueMap c) (affineResidueMap_bijective c) def unitsSubtypeEquiv (R : Type*) [Monoid R] : Rˣ ≃ {x : R // IsUnit x} where toFun u := ⟨u,u.isUnit⟩ invFun x := x.2.unit left_inv u := Units.ext u.isUnit.unit_spec right_inv x := Subtype.ext x.2.unit_spec def quotientProductEquiv (a b : O) (hab : IsCoprime a b) : (O ⧸ Ideal.span {a*b}) ≃+* (O ⧸ Ideal.span {a}) × (O ⧸ Ideal.span {b}) := (Ideal.quotEquivOfEq (Ideal.span_singleton_mul_span_singleton a b).symm).trans (Ideal.quotientMulEquivQuotientProd _ _ ((Ideal.isCoprime_span_singleton_iff a b).mpr hab)) def affineCRTEq (a b : O) (hab : IsCoprime a b) : AffineUnitResidue (a*b) ≃ AffineUnitResidue a × AffineUnitResidue b := ((quotientProductEquiv a b hab).toEquiv.subtypeEquiv (fun q => by rw [← MulEquiv.isUnit_map (quotientProductEquiv a b hab) (x := 1+3*q)] simp only [map_add,map_one,map_mul,map_ofNat,Prod.isUnit_iff] rfl)).trans Equiv.subtypeProdEquivProd lemma affine_ramified_unit (n : ℕ) (q : O ⧸ Ideal.span {lambda^n}) : IsUnit (1+3*q) := by obtain ⟨d,rfl⟩ := Ideal.Quotient.mk_surjective q have hlam3 : lambda ∣ (3:O) := (dvd_pow_self lambda (by decide : 2 ≠ 0)).trans lambda_sq_dvd_three have hcop : IsCoprime lambda (1+3*d) := coprime_of_dvd_sub_one _ _ (by convert hlam3.mul_right d using 1 ; ring) have h := (isUnit_quotient_span_iff (lambda^n) (1+3*d)).mpr hcop.pow_left simpa only [map_add,map_one,map_mul,map_ofNat] using h def affineRamifiedEquiv (n : ℕ) : AffineUnitResidue (lambda^n) ≃ (O ⧸ Ideal.span {lambda^n}) := Equiv.subtypeUnivEquiv (affine_ramified_unit n) def affineUnramifiedEquiv (m : O) (hm : IsCoprime m (3:O)) : AffineUnitResidue m ≃ (O ⧸ Ideal.span {m})ˣ := by let h3 : IsUnit (3 : O ⧸ Ideal.span {m}) := by simpa only [map_ofNat] using (isUnit_quotient_span_iff m 3).mpr hm let e : (O ⧸ Ideal.span {m}) ≃ (O ⧸ Ideal.span {m}) := h3.unit.mulLeft.trans (Equiv.addLeft 1) refine (e.subtypeEquiv (fun q => ?_)).trans (unitsSubtypeEquiv _).symm change IsUnit (1+3*q) ↔ IsUnit (1+(h3.unit : O ⧸ Ideal.span {m})*q) rw [h3.unit_spec] def idealTotient (I : Ideal O) : ℕ := Nat.card (O ⧸ I)ˣ lemma card_admissible_ramified_product (n : ℕ) (m : O) (hm : IsCoprime m (3:O)) (hlamm : IsCoprime lambda m) : Nat.card (AdmissibleResidue (lambda^n*m)) = Nat.card (O ⧸ Ideal.span {lambda^n}) * idealTotient (Ideal.span {m}) := by calc _ = Nat.card (AffineUnitResidue (lambda^n*m)) := Nat.card_congr (affineResidueEquiv _).symm _ = Nat.card (AffineUnitResidue (lambda^n) × AffineUnitResidue m) := Nat.card_congr (affineCRTEq _ _ hlamm.pow_left) _ = Nat.card ((O ⧸ Ideal.span {lambda^n}) × (O ⧸ Ideal.span {m})ˣ) := Nat.card_congr (Equiv.prodCongr (affineRamifiedEquiv n) (affineUnramifiedEquiv m hm)) _ = _ := Nat.card_prod _ _ lemma absNorm_span_lambda : Ideal.absNorm (Ideal.span {lambda})=3 := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK let : Fact (Nat.Prime 3) := ⟨Nat.prime_three⟩ let : IsCyclotomicExtension {3^(0+1)} ℚ ActualEisensteinCubic.K := by simpa using (inferInstance : IsCyclotomicExtension {3} ℚ ActualEisensteinCubic.K) exact IsCyclotomicExtension.Rat.absNorm_span_zeta_sub_one 3 0 (IsCyclotomicExtension.zeta_spec 3 ℚ ActualEisensteinCubic.K) lemma card_quotient_lambda_pow (n : ℕ) : Nat.card (O ⧸ Ideal.span {lambda^n})=3^n := by change Ideal.absNorm (Ideal.span {lambda^n})=3^n rw [← Ideal.span_singleton_pow,map_pow,absNorm_span_lambda] theorem card_admissible_lambda_pow_mul (n : ℕ) (m : O) (hm : IsCoprime m (3:O)) : Nat.card (AdmissibleResidue (lambda^n*m)) = 3^n * idealTotient (Ideal.span {m}) := by have hlam3 : lambda ∣ (3:O) := (dvd_pow_self lambda (by decide : 2 ≠ 0)).trans lambda_sq_dvd_three rw [card_admissible_ramified_product n m hm (hm.symm.of_isCoprime_of_dvd_left hlam3),card_quotient_lambda_pow] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.RamifiedNormWeights namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal private def predicateFiberEquiv {R S : Type*} (f : R → S) (P : S → Prop) : {x : R // P (f x)} ≃ Σ y : {y : S // P y}, {x : R // f x=y.1} where toFun x := ⟨⟨f x.1,x.2⟩,⟨x.1,rfl⟩⟩ invFun y := ⟨y.2.1,by rw [y.2.2]; exact y.1.2⟩ left_inv x := rfl right_inv y := by rcases y with ⟨⟨y,hy⟩,x,hx⟩ dsimp at hx cases hx rfl private def predicateKernelEquiv {R S : Type*} [AddGroup R] [AddGroup S] (f : R →+ S) (hf : Function.Surjective f) (P : S → Prop) : {x : R // P (f x)} ≃ {y : S // P y} × f.ker := (predicateFiberEquiv f P).trans ((Equiv.sigmaCongrRight (fun y : {y : S // P y} => AddMonoidHom.fiberEquivKerOfSurjective hf y.1)).trans (Equiv.sigmaEquivProd _ _)) lemma card_ring_eq_card_mul_kernel {R S : Type*} [Ring R] [Ring S] (f : R →+* S) (hf : Function.Surjective f) : Nat.card R=Nat.card S*Nat.card f.toAddMonoidHom.ker := by have h := Nat.card_congr (predicateKernelEquiv f.toAddMonoidHom hf (fun _ => True)) simpa only [Nat.card_prod,Nat.card_congr (Equiv.subtypeUnivEquiv (fun _ => True.intro))] using h lemma card_units_eq_card_mul_kernel {R S : Type*} [CommRing R] [CommRing S] (f : R →+* S) (hf : Function.Surjective f) (hunit : ∀x, IsUnit (f x) ↔ IsUnit x) : Nat.card Rˣ=Nat.card Sˣ*Nat.card f.toAddMonoidHom.ker := by let e : Rˣ ≃ {x : R // IsUnit (f x)} := (unitsSubtypeEquiv R).trans (Equiv.subtypeEquivRight (fun x => (hunit x).symm)) calc _ = Nat.card ({y : S // IsUnit y} × f.toAddMonoidHom.ker) := Nat.card_congr (e.trans (predicateKernelEquiv f.toAddMonoidHom hf IsUnit)) _ = Nat.card {y : S // IsUnit y} * Nat.card f.toAddMonoidHom.ker := Nat.card_prod _ _ _ = _ := by rw [← Nat.card_congr (unitsSubtypeEquiv S)] lemma card_units_mul_card_target {R S : Type*} [CommRing R] [CommRing S] (f : R →+* S) (hf : Function.Surjective f) (hunit : ∀x, IsUnit (f x) ↔ IsUnit x) : Nat.card S*Nat.card Rˣ=Nat.card R*Nat.card Sˣ := by rw [card_units_eq_card_mul_kernel f hf hunit,card_ring_eq_card_mul_kernel f hf] ring theorem idealTotient_pow_succ (I : Ideal O) (hI : I ≠ 0) (n : ℕ) : idealTotient (I ^(n+1))=Ideal.absNorm I ^n*idealTotient I := by let f : (O ⧸ I ^(n+1)) →+* (O ⧸ I) := Ideal.Quotient.factor (Ideal.pow_le_self (Nat.succ_ne_zero n)) have hf : Function.Surjective f := Ideal.Quotient.factor_surjective _ have hu (x : O ⧸ I ^(n+1)) : IsUnit (f x) ↔ IsUnit x := by obtain ⟨x,rfl⟩ := Ideal.Quotient.mk_surjective x exact (Ideal.Quotient.isUnit_mk_pow_iff_isUnit_mk I (Nat.succ_ne_zero n)).symm have h := card_units_mul_card_target f hf hu change Ideal.absNorm I*idealTotient (I ^(n+1))= Ideal.absNorm (I ^(n+1))*idealTotient I at h rw [map_pow] at h have hpos : 0 Quotient.out r ∈ J)=idealDivisors G := by ext J simp only [Finset.mem_filter,mem_idealDivisors hI,mem_idealDivisors hG, Ideal.dvd_iff_le,G,sup_le_iff,Ideal.span_le,Set.singleton_subset_iff,SetLike.mem_coe] rw [← Finset.sum_filter,hdiv,sum_moebius_divisors G hG] have hu : IsUnit r ↔ G=⊤ := by rw [← Ideal.Quotient.mk_out r] exact isUnit_quotient_iff_sup I (Quotient.out r) simp only [hu] lemma sum_indicator_const {R : Type*} [Fintype R] (P : R → Prop) (z : ℂ) : (∑ r : R, if P r then z else 0)=(Nat.card {r : R // P r}:ℂ)*z := by rw [← Finset.sum_filter] simp only [Finset.sum_const,nsmul_eq_mul,Nat.card_eq_fintype_card,Fintype.card_subtype] lemma card_quotient_multiples (I J : Ideal O) (hI : I ≠ 0) (hIJ : I ≤ J) : (Nat.card {r : O ⧸ I // Quotient.out r ∈ J}:ℂ)= (Ideal.absNorm I:ℂ)/(Ideal.absNorm J:ℂ) := by let f : (O ⧸ I) →+* (O ⧸ J) := Ideal.Quotient.factor hIJ have hf : Function.Surjective f := Ideal.Quotient.factor_surjective hIJ have hpred (r : O ⧸ I) : Quotient.out r ∈ J ↔ f r=0 := by have hfr : f r=Ideal.Quotient.mk J (Quotient.out r) := by calc f r = f (Ideal.Quotient.mk I (Quotient.out r)) := congrArg f (Ideal.Quotient.mk_out r).symm _ = _ := Ideal.Quotient.factor_mk hIJ _ rw [← Ideal.Quotient.eq_zero_iff_mem,hfr] let e : {r : O ⧸ I // Quotient.out r ∈ J} ≃ f.toAddMonoidHom.ker := Equiv.subtypeEquivRight hpred have hcard := card_ring_eq_card_mul_kernel f hf have hJ : J ≠ 0 := fun h => hI (le_antisymm (h ▸ hIJ) bot_le) have hnJ : (Ideal.absNorm J:ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr hJ) rw [Nat.card_congr e] apply (eq_div_iff hnJ).mpr have hh : Nat.card f.toAddMonoidHom.ker * Ideal.absNorm J = Ideal.absNorm I := (Nat.mul_comm _ _).trans hcard.symm exact_mod_cast hh theorem idealTotient_moebius (I : Ideal O) (hI : I ≠ 0) : (idealTotient I:ℂ)=(Ideal.absNorm I:ℂ)* ∑ J ∈ idealDivisors I, (moebius J:ℂ)/(Ideal.absNorm J:ℂ) := by let : Finite (O ⧸ I) := I.finiteQuotientOfFreeOfNeBot hI let : Fintype (O ⧸ I) := Fintype.ofFinite _ classical have hcount : (idealTotient I:ℂ)=∑ r : O ⧸ I, @ite ℂ (IsUnit r) (Classical.propDecidable _) 1 0 := by have h := sum_indicator_const (R := O ⧸ I) IsUnit (1:ℂ) rw [mul_one] at h calc _ = (Nat.card {r : O ⧸ I // IsUnit r}:ℂ) := by exact_mod_cast Nat.card_congr (unitsSubtypeEquiv (O ⧸ I)) _ = _ := h.symm rw [hcount] have hs : (∑ r : O ⧸ I, @ite ℂ (IsUnit r) (Classical.propDecidable _) 1 0) = ∑ r : O ⧸ I, ∑ J ∈ idealDivisors I, if Quotient.out r ∈ J then (moebius J:ℂ) else 0 := by apply Finset.sum_congr rfl intro r hr exact residue_unit_mobius I hI r rw [hs] rw [Finset.sum_comm] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro J hJ rw [sum_indicator_const,card_quotient_multiples I J hI (Ideal.dvd_iff_le.mp ((mem_idealDivisors hI).mp hJ))] ring end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal UniqueFactorizationMonoid CompletedGauss open PrimaryIdealUnitReindex (GoodIdeal) def unramifiedNormWeight (s : ℂ) : Ideal O →*₀ ℂ where toFun I := if primaryGenerator I=0 then 0 else (Ideal.absNorm I:ℂ)^(-s) map_zero' := by simp [primaryGenerator_bot] map_one' := by rw [primaryGenerator_one,if_neg one_ne_zero,map_one,Nat.cast_one,Complex.one_cpow] map_mul' I J := by by_cases hI : primaryGenerator I=0 · simp [primaryGenerator_mul,hI] by_cases hJ : primaryGenerator J=0 · simp [primaryGenerator_mul,hJ] simp only [primaryGenerator_mul,mul_eq_zero,hI,hJ,false_or,ite_false,map_mul,Nat.cast_mul] exact Complex.natCast_mul_natCast_cpow _ _ _ lemma unramifiedNormWeight_of_good (s : ℂ) (I : Ideal O) (hI : primaryGenerator I ≠ 0) : unramifiedNormWeight s I=(Ideal.absNorm I:ℂ)^(-s) := if_neg hI lemma unramifiedNormWeight_of_bad (s : ℂ) (I : Ideal O) (hI : primaryGenerator I=0) : unramifiedNormWeight s I=0 := if_pos hI lemma primaryGenerator_injective_good : Function.Injective (fun I : GoodIdeal => primaryGenerator I.1) := by intro I J h dsimp only at h apply Subtype.ext rw [← (primaryGenerator_spec I.1 I.2).1,← (primaryGenerator_spec J.1 J.2).1,h] lemma norm_unramifiedNormWeight (s : ℂ) (I : GoodIdeal) : ‖unramifiedNormWeight s I.1‖=‖eisEmbedding (primaryGenerator I.1)‖^(-2*s.re) := by rw [unramifiedNormWeight_of_good s I.1 I.2] have hnorm : ‖eisEmbedding (primaryGenerator I.1)‖^2=(Ideal.absNorm I.1:ℝ) := by rw [eisEmbedding_norm_sq_eq_absNorm_span,(primaryGenerator_spec I.1 I.2).1] have hn : 0<‖eisEmbedding (primaryGenerator I.1)‖ := norm_pos_iff.mpr (eisEmbedding_ne_zero I.2) have hcast : (Ideal.absNorm I.1:ℂ)=((‖eisEmbedding (primaryGenerator I.1)‖^2:ℝ):ℂ) := by exact_mod_cast hnorm.symm rw [hcast,Complex.norm_cpow_eq_rpow_re_of_pos (sq_pos_of_pos hn)] rw [← Real.rpow_natCast_mul hn.le 2] congr 1 simp only [Complex.neg_re,Nat.cast_ofNat] ring theorem unramifiedNormWeight_summable_norm (s : ℂ) (hs : 1 ‖unramifiedNormWeight s I‖) := by have hlat := (summable_embedding_rpow (-2*s.re) (by linarith)).comp_injective primaryGenerator_injective_good have hsub : Summable (fun I : GoodIdeal => ‖unramifiedNormWeight s I.1‖) := by simpa only [Function.comp_def, norm_unramifiedNormWeight] using hlat have hind := (summable_subtype_iff_indicator (s := {I : Ideal O | primaryGenerator I ≠ 0}) (f := fun I => ‖unramifiedNormWeight s I‖)).mp hsub apply hind.congr intro I by_cases hI : primaryGenerator I=0 · simp [Set.indicator,hI,unramifiedNormWeight_of_bad s I hI] · simp [Set.indicator,hI] lemma norm_ideal_moebius_le_one (I : Ideal O) : ‖(moebius I:ℂ)‖≤1 := by by_cases hI : Squarefree I · simp [hI.moebius_eq] · simp [moebius_of_not_squarefree hI] lemma moebius_unramifiedNormWeight_summable_norm (s : ℂ) (hs : 1 ‖(moebius I:ℂ)*unramifiedNormWeight s I‖) := by apply (unramifiedNormWeight_summable_norm s hs).of_nonneg_of_le (fun _ => norm_nonneg _) intro I rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (norm_ideal_moebius_le_one I) def unramifiedIdealZeta (s : ℂ) : ℂ := ∑' I : Ideal O, unramifiedNormWeight s I def unramifiedMobiusSeries (s : ℂ) : ℂ := ∑' I : Ideal O, (moebius I:ℂ)*unramifiedNormWeight s I end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal UniqueFactorizationMonoid CompletedGauss open IdealMobiusDivisorSum (idealDivisors mem_idealDivisors sum_moebius_divisors) theorem unramifiedMobiusSeries_mul_zeta (s : ℂ) (hs : 1 (moebius p.1:ℂ)*unramifiedNormWeight s (p.1*p.2) have hprod := (moebius_unramifiedNormWeight_summable_norm s hs).mul_norm (unramifiedNormWeight_summable_norm s hs) have hF : Summable F := by apply hprod.of_norm.congr intro p dsimp only [F] rw [map_mul] ring have hfiber (B : Ideal O) : (∑' p : MulFiber B,F p.1)=if B=1 then 1 else 0 := by by_cases hB : B=0 · subst B have hz (p : MulFiber 0) : F p.1=0 := by simp only [F,p.2,map_zero,mul_zero] simp only [hz,tsum_zero,zero_ne_one,ite_false] · calc _ = (∑' p : MulFiber B,(moebius p.1.1:ℂ))*unramifiedNormWeight s B := by rw [← tsum_mul_right] apply tsum_congr intro p simp only [F,p.2] _ = _ := by rw [mulFiber_moebius_sum B hB] split_ifs with hB1 · subst B; simp only [map_one,mul_one] · simp only [zero_mul] have hsum := hF.hasSum.tsum_fiberwise (fun p : Ideal O × Ideal O => p.1*p.2) change HasSum (fun B : Ideal O => ∑' p : MulFiber B,F p.1) (∑' p,F p) at hsum simp_rw [hfiber] at hsum have hFone : (∑' p,F p)=1 := by simpa using hsum.tsum_eq.symm calc _ = ∑' p : Ideal O × Ideal O, ((moebius p.1:ℂ)*unramifiedNormWeight s p.1)*unramifiedNormWeight s p.2 := tsum_mul_tsum_of_summable_norm (moebius_unramifiedNormWeight_summable_norm s hs) (unramifiedNormWeight_summable_norm s hs) _ = ∑' p,F p := by apply tsum_congr intro p simp only [F,map_mul] ring _ = 1 := hFone theorem unramifiedIdealZeta_ne_zero (s : ℂ) (hs : 1 (Ideal.absNorm I:ℂ)) p.2.symm _ = _ := by rw [map_mul,Nat.cast_mul] rw [heq] field_simp calc _ = ∑' p : MulFiber B,(Ideal.absNorm B:ℂ)* ((moebius p.1.1:ℂ)/(Ideal.absNorm p.1.1:ℂ)) := tsum_congr hp _ = (Ideal.absNorm B:ℂ)* ∑' D : {D : Ideal O // D ∈ idealDivisors B}, ((moebius D.1:ℂ)/(Ideal.absNorm D.1:ℂ)) := by rw [← tsum_mul_left] exact e.tsum_eq (fun D => (Ideal.absNorm B:ℂ)*((moebius D.1:ℂ)/(Ideal.absNorm D.1:ℂ))) _ = (Ideal.absNorm B:ℂ)* ∑ D ∈ idealDivisors B,((moebius D:ℂ)/(Ideal.absNorm D:ℂ)) := by rw [tsum_fintype] apply congrArg (fun z : ℂ => (Ideal.absNorm B:ℂ)*z) exact (Finset.sum_subtype (idealDivisors B) (fun _ => Iff.rfl) (fun D => (moebius D:ℂ)/(Ideal.absNorm D:ℂ))).symm _ = _ := (idealTotient_moebius B hB).symm def unramifiedTotientSeries (s : ℂ) : ℂ := ∑' I : Ideal O,(idealTotient I:ℂ)*unramifiedNormWeight s I theorem unramifiedTotientSeries_product (s : ℂ) (hs : 2 (moebius p.1:ℂ)*(Ideal.absNorm p.2:ℂ)*unramifiedNormWeight s (p.1*p.2) have hprod := (moebius_unramifiedNormWeight_summable_norm s hs1).mul_norm (unramifiedNormWeight_summable_norm (s-1) hs2) have heq (p : Ideal O × Ideal O) : ((moebius p.1:ℂ)*unramifiedNormWeight s p.1)*unramifiedNormWeight (s-1) p.2=F p := by simp only [F,unramifiedNormWeight_shift,map_mul] ring have hF : Summable F := hprod.of_norm.congr heq have hfiber (B : Ideal O) : (∑' p : MulFiber B,F p.1)= (idealTotient B:ℂ)*unramifiedNormWeight s B := by by_cases hB : B=0 · subst B have hz (p : MulFiber 0) : F p.1=0 := by simp only [F,p.2,map_zero,mul_zero] simp only [hz,tsum_zero,map_zero,mul_zero] · calc _ = (∑' p : MulFiber B,(moebius p.1.1:ℂ)*(Ideal.absNorm p.1.2:ℂ))* unramifiedNormWeight s B := by rw [← tsum_mul_right] apply tsum_congr intro p simp only [F,p.2] _ = _ := by rw [mulFiber_totient_sum B hB] have hsum := hF.hasSum.tsum_fiberwise (fun p : Ideal O × Ideal O => p.1*p.2) change HasSum (fun B : Ideal O => ∑' p : MulFiber B,F p.1) (∑' p,F p) at hsum simp_rw [hfiber] at hsum calc _ = ∑' p,F p := hsum.tsum_eq _ = _ := by rw [unramifiedMobiusSeries,unramifiedIdealZeta, tsum_mul_tsum_of_summable_norm (moebius_unramifiedNormWeight_summable_norm s hs1) (unramifiedNormWeight_summable_norm (s-1) hs2)] exact tsum_congr (fun p => (heq p).symm) theorem unramifiedTotientSeries_quotient (s : ℂ) (hs : 2 ‖(idealTotient I:ℂ)*unramifiedNormWeight s I‖) := by have hs1 : 1<(s-1).re := by simp only [Complex.sub_re,Complex.one_re]; linarith apply (unramifiedNormWeight_summable_norm (s-1) hs1).of_nonneg_of_le (fun _ => norm_nonneg _) intro I by_cases hI : I=0 · subst I; simp only [map_zero,mul_zero,norm_zero,le_refl] · rw [norm_mul,Complex.norm_natCast,unramifiedNormWeight_shift,norm_mul,Complex.norm_natCast] exact mul_le_mul_of_nonneg_right (Nat.cast_le.mpr (idealTotient_le_absNorm I hI)) (norm_nonneg _) end CubicEisenstein open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss QuadraticSquarefreeKernel theorem originalPairLow_squarefree_tsum (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (W : SchwartzMap ℝ ℂ) (M K : ℝ) (hM : 0 < M) : (∑' lengthScale : Ideal O, originalPairLow I J W M K lengthScale) = ∑' B : {B : Ideal O // Admissible B}, if (Ideal.absNorm B.val : ℝ) ≤ K then (quadraticRow I (primaryGenerator B.val) * quadraticRow J (primaryGenerator B.val)) * ∑' A : {A : Ideal O // Supported A}, (idealZeroMask I (primaryGenerator A.val) * idealZeroMask J (primaryGenerator A.val)) * W (((Ideal.absNorm A.val : ℝ) ^ 2 * (Ideal.absNorm B.val : ℝ)) / M) else 0 := by let F : ({A : Ideal O // Supported A} × {B : Ideal O // Admissible B}) → ℂ := fun p => if (Ideal.absNorm p.2.val : ℝ) ≤ K then (idealZeroMask I (primaryGenerator p.1.val) * idealZeroMask J (primaryGenerator p.1.val)) * (quadraticRow I (primaryGenerator p.2.val) * quadraticRow J (primaryGenerator p.2.val)) * W (((Ideal.absNorm p.1.val : ℝ) ^ 2 * (Ideal.absNorm p.2.val : ℝ)) / M) else 0 have hterm (p : {A : Ideal O // Supported A} × {B : Ideal O // Admissible B}) : originalPairLow I J W M K (p.1.val ^ 2 * p.2.val) = F p := by have hs : Supported (p.1.val ^ 2 * p.2.val) := (supported_mul_iff _ _).mpr ⟨(supported_sq_iff _).mpr p.1.property, admissible_supported p.2.property⟩ unfold originalPairLow rw [(squarePart_mul_squarefree p.1.property.1 p.2.property.2.1).2] by_cases hk : (Ideal.absNorm p.2.val : ℝ) ≤ K · rw [if_pos hk] unfold originalPairSource rw [if_pos hs, canonical_quadraticRow_star I hI, canonical_quadraticRow_primary_squarefree I hI, canonical_quadraticRow_primary_squarefree J hJ] simp only [F, if_pos hk, map_mul, map_pow, Nat.cast_mul, Nat.cast_pow] ring · simp only [if_neg hk, F] have hsub : Summable (fun lengthScale : {lengthScale : Ideal O // Supported lengthScale} => originalPairLow I J W M K lengthScale.val) := (originalPairLow_summable I J W M K hM).subtype _ have hp0 : Summable (fun p : {A : Ideal O // Supported A} × {B : Ideal O // Admissible B} => originalPairLow I J W M K (p.1.val ^ 2 * p.2.val)) := supportedSquarefreeEquiv.symm.summable_iff.mpr hsub have hp : Summable F := hp0.congr hterm have he : (∑' lengthScale : {lengthScale : Ideal O // Supported lengthScale}, originalPairLow I J W M K lengthScale.val) = ∑' lengthScale : Ideal O, originalPairLow I J W M K lengthScale := by apply tsum_subtype_eq_of_support_subset intro lengthScale hL by_contra hs change ¬Supported lengthScale at hs exact hL (by simp [originalPairLow, originalPairSource, hs]) calc _ = ∑' lengthScale : {lengthScale : Ideal O // Supported lengthScale}, originalPairLow I J W M K lengthScale.val := he.symm _ = ∑' p : {A : Ideal O // Supported A} × {B : Ideal O // Admissible B}, originalPairLow I J W M K (p.1.val ^ 2 * p.2.val) := (supportedSquarefreeEquiv.symm.tsum_eq (fun lengthScale => originalPairLow I J W M K lengthScale.val)).symm _ = ∑' p, F p := tsum_congr hterm _ = ∑' p : {B : Ideal O // Admissible B} × {A : Ideal O // Supported A}, F (p.2, p.1) := (Equiv.prodComm _ _).tsum_eq (fun p => F (p.2, p.1)) _ = ∑' B : {B : Ideal O // Admissible B}, ∑' A : {A : Ideal O // Supported A}, F (A, B) := hp.prod_symm.tsum_prod _ = _ := by apply tsum_congr intro B by_cases hk : (Ideal.absNorm B.val : ℝ) ≤ K · rw [if_pos hk, ← tsum_mul_left] apply tsum_congr intro A simp only [F, if_pos hk] ring · simp only [F, if_neg hk, tsum_zero] end open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss theorem idealZeroMask_span_eq (D : Ideal O) (x y : O) (hxy : Ideal.span {x} = Ideal.span {y}) : idealZeroMask D x = idealZeroMask D y := by have hm (P : Ideal O) : x ∈ P ↔ y ∈ P := by constructor · intro h exact (Ideal.span_singleton_le_iff_mem P).mp (hxy ▸ (Ideal.span_singleton_le_iff_mem P).mpr h) · intro h exact (Ideal.span_singleton_le_iff_mem P).mp (hxy.symm ▸ (Ideal.span_singleton_le_iff_mem P).mpr h) unfold idealZeroMask simp_rw [hm] theorem idealZeroMask_mul (I J : Ideal O) (hI : I ≠ 0) (hJ : J ≠ 0) (z : O) : idealZeroMask (I * J) z = idealZeroMask I z * idealZeroMask J z := by have he : (∃ P ∈ UniqueFactorizationMonoid.normalizedFactors (I * J), z ∈ P) ↔ (∃ P ∈ UniqueFactorizationMonoid.normalizedFactors I, z ∈ P) ∨ (∃ P ∈ UniqueFactorizationMonoid.normalizedFactors J, z ∈ P) := by simp only [UniqueFactorizationMonoid.normalizedFactors_mul hI hJ, Multiset.mem_add, or_and_right, exists_or] unfold idealZeroMask simp only [he] by_cases h₁ : ∃ P ∈ UniqueFactorizationMonoid.normalizedFactors I, z ∈ P <;> by_cases h₂ : ∃ P ∈ UniqueFactorizationMonoid.normalizedFactors J, z ∈ P <;> simp [h₁, h₂] theorem jointMask_generator (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (lengthScale : Ideal O) : rowCoprimeMask (fun P : gcdMaskPrimes (I * J) => P.val) Finset.univ (idealGenerator lengthScale) = if Supported lengthScale then idealZeroMask I (primaryGenerator lengthScale) * idealZeroMask J (primaryGenerator lengthScale) else 0 := by rw [gcdMaskPrimes_mask, idealZeroMask_mul I J hI.1 hJ.1, badPrime_mask, span_idealGenerator] by_cases hL : Supported lengthScale · rw [if_pos hL, if_pos hL, one_mul] have hs : Ideal.span {idealGenerator lengthScale} = Ideal.span {primaryGenerator lengthScale} := (span_idealGenerator lengthScale).trans (primaryGenerator_spec lengthScale (supported_primaryGenerator_ne_zero lengthScale hL)).1.symm rw [idealZeroMask_span_eq I _ _ hs, idealZeroMask_span_eq J _ _ hs] · simp only [if_neg hL, zero_mul] theorem jointMask_zero (I J : Ideal O) : rowCoprimeMask (fun P : gcdMaskPrimes (I * J) => P.val) Finset.univ 0 = 0 := by rw [gcdMaskPrimes_mask, badPrime_mask] have h : ¬Supported (Ideal.span {(0 : O)}) := by intro h exact h.1 (by simp) rw [if_neg h, zero_mul] end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.PrincipalTruncation namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open EisensteinSchwartzPoisson GaussGeneratorTransport UnrestrictedIdealReindex def lowPrincipalIdeal (I J : Ideal O) (W : ℝ → ℂ) (X : ℝ) : ℂ := ∑' A : {A : Ideal O // Supported A}, (idealZeroMask I (primaryGenerator A.val) * idealZeroMask J (primaryGenerator A.val)) * W (((Ideal.absNorm A.val : ℝ) / X) ^ 2) def lowPrincipalLattice (I J : Ideal O) (W : ℝ → ℂ) (X : ℝ) : ℂ := ∑' z : O, rowCoprimeMask (fun P : gcdMaskPrimes (I * J) => P.val) Finset.univ z * W ((‖eisEmbedding z‖ ^ 2 / X) ^ 2) theorem lowPrincipalLattice_eq_six_ideal (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (W : SchwartzMap ℝ ℂ) (X : ℝ) (hX : 0 < X) : lowPrincipalLattice I J W X = 6 * lowPrincipalIdeal I J W X := by let R := fun P : gcdMaskPrimes (I * J) => P.val let V := quadraticSquareProfile W let f : O → ℂ := fun z => rowCoprimeMask R Finset.univ z * V (‖eisEmbedding z‖ ^ 2 / X) have hV : Summable (fun z : O => ‖V (‖eisEmbedding z‖ ^ 2 / X)‖) := by simpa only [scaledRadialTest_apply] using actual_eisenstein_summable_norm (scaledRadialTest V X hX) have hf : Summable f := by apply Summable.of_norm apply Summable.of_nonneg_of_le (fun z => norm_nonneg _) _ hV intro z dsimp only [f] rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (QuadraticUnitInvariance.rowCoprimeMask_norm_le_one R Finset.univ z) have h0 : f 0 = 0 := by dsimp only [f, R] rw [jointMask_zero, zero_mul] have hu (u : Oˣ) (z : O) : f (u.val * z) = f z := by dsimp only [f] rw [QuadraticUnitInvariance.rowCoprimeMask_unit_mul, norm_eisEmbedding_unit_mul] have he := tsum_unit_invariant_of_zero f hf h0 hu have hnorm (A : Ideal O) : ‖eisEmbedding (idealGenerator A)‖ ^ 2 = (Ideal.absNorm A : ℝ) := by rw [eisEmbedding_norm_sq_eq_absNorm_span, span_idealGenerator] simp only [f, V, quadraticSquareProfile_apply, hnorm] at he have hid : (∑' A : NonzeroIdeal, rowCoprimeMask R Finset.univ (idealGenerator A.val) * W (((Ideal.absNorm A.val : ℝ) / X) ^ 2)) = lowPrincipalIdeal I J W X := by let F : Ideal O → ℂ := fun A => if Supported A then (idealZeroMask I (primaryGenerator A) * idealZeroMask J (primaryGenerator A)) * W (((Ideal.absNorm A : ℝ) / X) ^ 2) else 0 calc _ = ∑' A : NonzeroIdeal, F A.val := by apply tsum_congr intro A rw [jointMask_generator I J hI hJ] by_cases hA : Supported A.val <;> simp [hA, F] _ = ∑' A : Ideal O, F A := by apply tsum_subtype_eq_of_support_subset intro A hA hz subst A exact hA (by simp [F, Supported]) _ = _ := by calc _ = ∑' A : Ideal O, ({A : Ideal O | Supported A} : Set (Ideal O)).indicator (fun A => (idealZeroMask I (primaryGenerator A) * idealZeroMask J (primaryGenerator A)) * W (((Ideal.absNorm A : ℝ) / X) ^ 2)) A := by apply tsum_congr intro A rfl _ = _ := (_root_.tsum_subtype _ _).symm rw [hid] at he exact he theorem lowPrincipalIdeal_eq_lattice (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (W : SchwartzMap ℝ ℂ) (X : ℝ) (hX : 0 < X) : lowPrincipalIdeal I J W X = (6 : ℂ)⁻¹ * lowPrincipalLattice I J W X := by rw [lowPrincipalLattice_eq_six_ideal I J hI hJ W X hX] ring theorem originalPairLow_principal_lattice (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (W : SchwartzMap ℝ ℂ) (M K : ℝ) (hM : 0 < M) : (∑' lengthScale : Ideal O, originalPairLow I J W M K lengthScale) = ∑' B : {B : Ideal O // Admissible B}, if (Ideal.absNorm B.val : ℝ) ≤ K then (quadraticRow I (primaryGenerator B.val) * quadraticRow J (primaryGenerator B.val)) * ((6 : ℂ)⁻¹ * lowPrincipalLattice I J W (Real.sqrt (M / (Ideal.absNorm B.val : ℝ)))) else 0 := by rw [originalPairLow_squarefree_tsum I J hI hJ W M K hM] apply tsum_congr intro B by_cases hB : (Ideal.absNorm B.val : ℝ) ≤ K · rw [if_pos hB, if_pos hB] congr 1 have hN : 0 < (Ideal.absNorm B.val : ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun h => B.property.1 (Ideal.absNorm_eq_zero_iff.mp h)) have hX : 0 < Real.sqrt (M / (Ideal.absNorm B.val : ℝ)) := Real.sqrt_pos.mpr (div_pos hM hN) rw [← lowPrincipalIdeal_eq_lattice I J hI hJ W _ hX] unfold lowPrincipalIdeal apply tsum_congr intro A congr 2 rw [div_pow, Real.sq_sqrt (div_pos hM hN).le] field_simp · simp only [if_neg hB] end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge open EisensteinSchwartzPoisson TruncatedPrincipalPoisson IdealCoprimeSieveOperator end open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss theorem tsum_admissible_norm_cutoff (K : ℝ) (f : Ideal O → ℂ) : (∑' B : {B : Ideal O // Admissible B}, if (Ideal.absNorm B.val : ℝ) ≤ K then f B.val else 0) = ∑ B : idealRange K, f B.val := by let e : idealRange K → {B : Ideal O // Admissible B} := fun B => ⟨B.val, (mem_idealRange.mp B.property).1⟩ have he : Function.Injective e := by intro B C h apply Subtype.ext exact congrArg (fun D : {B : Ideal O // Admissible B} => D.val) h let F : {B : Ideal O // Admissible B} → ℂ := fun B => if (Ideal.absNorm B.val : ℝ) ≤ K then f B.val else 0 have hs : Function.support F ⊆ Set.range e := by intro B hB have hN : (Ideal.absNorm B.val : ℝ) ≤ K := by by_contra hn exact hB (if_neg hn) exact ⟨⟨B.val, mem_idealRange.mpr ⟨B.property, hN⟩⟩, Subtype.ext rfl⟩ have ht := he.tsum_eq hs change (∑' B, F B) = _ rw [← ht, tsum_fintype] apply Finset.sum_congr rfl intro B _ exact if_pos (mem_idealRange.mp B.property).2 theorem originalPairLow_principal_finite (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (W : SchwartzMap ℝ ℂ) (M K : ℝ) (hM : 0 < M) : (∑' lengthScale : Ideal O, originalPairLow I J W M K lengthScale) = ∑ B : idealRange K, (quadraticRow I (primaryGenerator B.val) * quadraticRow J (primaryGenerator B.val)) * ((6 : ℂ)⁻¹ * lowPrincipalLattice I J W (Real.sqrt (M / (Ideal.absNorm B.val : ℝ)))) := by rw [originalPairLow_principal_lattice I J hI hJ W M K hM] exact tsum_admissible_norm_cutoff K (fun B : Ideal O => (quadraticRow I (primaryGenerator B) * quadraticRow J (primaryGenerator B)) * ((6 : ℂ)⁻¹ * lowPrincipalLattice I J W (Real.sqrt (M / (Ideal.absNorm B : ℝ))))) end CanonicalQuadraticSieve open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) open FirstCauchyArithmetic (activeGaussRowFactor) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) theorem activeGaussRowFactor_norm_le_one (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (S T : Finset ι) (e k : O) : ‖activeGaussRowFactor p hp hinj hg S T e k‖ ≤ 1 := by have hr (a : O) : ‖finiteSexticRow (activePrimes (fun i => Ideal.span {p i}) S T) (fun i => hg i.val) (activeExponent S T) a‖ ≤ 1 := by rw [finiteSexticRow_activeSupport, norm_mul, norm_star] exact (mul_le_mul (finiteSquarefreeRow_norm_le_one _ hg _ _) (finiteSquarefreeRow_norm_le_one _ hg _ _) (norm_nonneg _) zero_le_one).trans_eq (one_mul 1) have hGauss := FiniteGaussPhase.norm_canonicalProductGauss (fun i : activeSupport S T => p i.val) (fun i => hp i.val) (activePrimes_pairwise_isCoprime (fun i => Ideal.span {p i}) hinj S T) (fun i => hg i.val) (fun i => hc i.val) (activeExponent S T) (activeExponent_ne_zero S T) (activeExponent_lt_six S T) simp only [activeGaussRowFactor, norm_mul, norm_star, hGauss, one_mul] exact (mul_le_mul (hr e) (hr k) (norm_nonneg _) zero_le_one).trans_eq (one_mul 1) end section open ActualEisensteinCubic def secondExpansionPool {ι : Type*} [DecidableEq ι] (F : Finset ι) (K : Finset ι → Finset ι → Finset O) : Finset (SecondExpansionData ι) := let : DecidableEq (SecondExpansionData ι) := instDecidableEqSecondExpansionData F.powerset.biUnion (fun G => G.powerset.biUnion (fun E => F.powerset.biUnion (fun V => (K G E).image (fun k => ⟨G,E,V,k⟩)))) theorem mem_secondExpansionPool {ι : Type*} [DecidableEq ι] (F : Finset ι) (K : Finset ι → Finset ι → Finset O) (x : SecondExpansionData ι) : x ∈ secondExpansionPool F K ↔ x.sourceCommon ⊆ F ∧ x.divisor ⊆ x.sourceCommon ∧ x.overlap ⊆ F ∧ x.frequency ∈ K x.sourceCommon x.divisor := by let : DecidableEq (SecondExpansionData ι) := instDecidableEqSecondExpansionData simp only [secondExpansionPool, Finset.mem_biUnion, Finset.mem_powerset, Finset.mem_image] constructor · rintro ⟨G,hG,E,hE,V,hV,k,hk,hx⟩ subst x exact ⟨hG,hE,hV,hk⟩ · rintro ⟨hG,hE,hV,hk⟩ exact ⟨x.sourceCommon,hG,x.divisor,hE,x.overlap,hV,x.frequency,hk,rfl⟩ theorem sum_secondExpansionPool {ι : Type*} [DecidableEq ι] (F : Finset ι) (K : Finset ι → Finset ι → Finset O) (H : SecondExpansionData ι → ℂ) : (∑ x ∈ secondExpansionPool F K, H x) = ∑ G ∈ F.powerset, ∑ E ∈ G.powerset, ∑ V ∈ F.powerset, ∑ k ∈ K G E, H ⟨G,E,V,k⟩ := by let : DecidableEq (SecondExpansionData ι) := instDecidableEqSecondExpansionData unfold secondExpansionPool rw [Finset.sum_biUnion] · apply Finset.sum_congr rfl intro G hG rw [Finset.sum_biUnion] · apply Finset.sum_congr rfl intro E hE rw [Finset.sum_biUnion] · apply Finset.sum_congr rfl intro V hV rw [Finset.sum_image] intro k hk k' hk' heq exact congrArg SecondExpansionData.frequency heq · intro V hV V' hV' hne apply Finset.disjoint_left.mpr intro x hx hx' obtain ⟨k,hk,rfl⟩ := Finset.mem_image.mp hx obtain ⟨k',hk',heq⟩ := Finset.mem_image.mp hx' exact hne (congrArg SecondExpansionData.overlap heq).symm · intro E hE E' hE' hne apply Finset.disjoint_left.mpr intro x hx hx' obtain ⟨V,hV,hx⟩ := Finset.mem_biUnion.mp hx obtain ⟨V',hV',hx'⟩ := Finset.mem_biUnion.mp hx' obtain ⟨k,hk,rfl⟩ := Finset.mem_image.mp hx obtain ⟨k',hk',heq⟩ := Finset.mem_image.mp hx' exact hne (congrArg SecondExpansionData.divisor heq).symm · intro G hG G' hG' hne apply Finset.disjoint_left.mpr intro x hx hx' obtain ⟨E,hE,V,hV,hx⟩ := (by simpa only [Finset.mem_biUnion] using hx) obtain ⟨E',hE',V',hV',hx'⟩ := (by simpa only [Finset.mem_biUnion] using hx') obtain ⟨k,hk,rfl⟩ := Finset.mem_image.mp hx obtain ⟨k',hk',heq⟩ := Finset.mem_image.mp hx' exact hne (congrArg SecondExpansionData.sourceCommon heq).symm def secondExpansionSector {ι : Type*} [DecidableEq ι] (F : Finset ι) (K : Finset ι → Finset ι → Finset O) (R : Finset ι) : Finset (SecondExpansionData ι) := (secondExpansionPool F K).filter (fun x => x.sourceCommon \ x.divisor = R) theorem sum_secondExpansionSector {ι : Type*} [DecidableEq ι] (F : Finset ι) (K : Finset ι → Finset ι → Finset O) (H : SecondExpansionData ι → ℂ) : (∑ R ∈ F.powerset, ∑ x ∈ secondExpansionSector F K R, H x) = ∑ x ∈ secondExpansionPool F K, H x := by simp only [secondExpansionSector, Finset.sum_filter] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x hx have hR : x.sourceCommon \ x.divisor ∈ F.powerset := Finset.mem_powerset.mpr ((Finset.sdiff_subset).trans ((mem_secondExpansionPool F K x).mp hx).1) rw [Finset.sum_eq_single_of_mem (x.sourceCommon \ x.divisor) hR] · simp · intro R hR hne simp [Ne.symm hne] variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) theorem secondExpansionSector_valid (F : Finset ι) (K : Finset ι → Finset ι → Finset O) (R : Finset ι) (x : SecondExpansionData ι) (hx : x ∈ secondExpansionSector F K R) : InSecondQuotientSector p (primeSubsetGenerator (fun i => Ideal.span {p i}) R) x := by obtain ⟨hx,hR⟩ := Finset.mem_filter.mp hx have hE := ((mem_secondExpansionPool F K x).mp hx).2.1 refine ⟨hE,?_⟩ rw [secondMaskQuotient_span, hR, primeSubsetGenerator, ConcretePrimeRowBridge.span_idealGenerator] theorem truncatedSecondSource_eq_expansionPool (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (K : Finset ι → Finset ι → Finset O) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype truncatedSecondSource p hp hg hinj F Ψ m c d H W Y K = ∑ z : SecondRayIndex, secondExpansionSource p hp hcop hg F Ψ m c d z (secondExpansionPool F K) H H W Y := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype rw [truncatedSecondSource_eq_child_sectors p hp hg hinj hcop hc hpr] simp only [secondExpansionSource, sum_secondExpansionPool] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro G hG rw [Finset.sum_comm] apply Finset.sum_congr rfl intro z hz rw [← Finset.sum_coe_sort (s := G.powerset)] apply Finset.sum_congr rfl intro E hE apply Finset.sum_congr rfl intro V hV apply Finset.sum_congr rfl intro k hk have hs : (⟨G,E.val,V,k⟩ : SecondExpansionData ι).divisor ⊆ (⟨G,E.val,V,k⟩ : SecondExpansionData ι).sourceCommon := Finset.mem_powerset.mp E.property simp only [secondExpansionQuotient_of_subset p _ hs] simp only [mul_assoc] theorem truncatedSecondSource_eq_fixed_sectors (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (K : Finset ι → Finset ι → Finset O) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype truncatedSecondSource p hp hg hinj F Ψ m c d H W Y K = ∑ z : SecondRayIndex, ∑ R ∈ F.powerset, secondExpansionSource p hp hcop hg F Ψ m c d z (secondExpansionSector F K R) H H W Y := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype rw [truncatedSecondSource_eq_expansionPool p hp hcop hg hinj hc hpr] apply Finset.sum_congr rfl intro z hz simp only [secondExpansionSource, sum_secondExpansionSector] end section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn jLabel) open JointLogSeparation (halfNormalizationCLM) end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) include hc theorem secondPairRadialMode_summable_norm (S T : Finset ι) (e : O) (he : e ≠ 0) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) : Summable (fun k : O => ‖secondPairRadialMode p hp hg hinj S T e k W Y‖) := by let n := ∏ i : activeSupport T S, p i.val let scale := Y / (‖eisEmbedding e‖^2 * ‖eisEmbedding n‖^2) have hn : n ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i hi => hp i.val) have hs : 0 < scale := div_pos hY (mul_pos (sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero he))) (sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hn)))) have hmajor := (EisensteinSchwartzPoisson.paperRadialFourier_lattice_summable_norm W scale hs).mul_left ‖(Y : ℂ)/(‖eisEmbedding n‖ : ℂ)‖ apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ hmajor intro k have ha : Y * ‖eisEmbedding k‖^2 / (‖eisEmbedding e‖^2 * ‖eisEmbedding n‖^2) = scale * ‖eisEmbedding k‖^2 := by dsimp [scale]; ring simp only [secondPairRadialMode, norm_mul] change ‖(Y : ℂ)/(‖eisEmbedding n‖ : ℂ)‖ * _ * _ ≤ _ rw [ha] exact mul_le_of_le_one_right (by positivity) (activeGaussRowFactor_norm_le_one p hp hg hinj hc T S e k) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.FrequencyCutoffs namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog primeProductNorm primeProductNorm_pos) open ConcreteTraceCRT (eisEmbedding) theorem columnLog_norm_upper {ι : Type*} (p : ι → O) (hp : ∀ i, p i ≠ 0) (X M : ℝ) (hX : 0 < X) (S : Finset ι) (hS : columnLog p X S ≤ M) : primeProductNorm p S ≤ X * Real.exp M := by have he := Real.exp_le_exp.mpr hS rw [columnLog, Real.exp_log (div_pos (primeProductNorm_pos p hp S) hX)] at he exact (div_le_iff₀ hX).mp he |>.trans_eq (mul_comm _ _) def secondFrequencyCutoff (scale H : ℝ) : Finset O := ShortDraftLatticeCount.rowNormBall ⌈H/scale⌉₊ theorem mem_secondFrequencyCutoff (scale H : ℝ) (k : O) (hk : ‖eisEmbedding k‖^2 ≤ H/scale) : k ∈ secondFrequencyCutoff scale H := by apply ShortDraftLatticeCount.mem_rowNormBall_of_absNorm_le rw [eisEmbedding_norm_sq_eq_absNorm_span] at hk exact_mod_cast hk.trans (Nat.le_ceil (H/scale)) theorem secondFrequencyCutoff_zero (scale H : ℝ) : (0 : O) ∈ secondFrequencyCutoff scale H := by apply ShortDraftLatticeCount.mem_rowNormBall_of_absNorm_le simp theorem outside_secondFrequencyCutoff (scale H : ℝ) (hs : 0 < scale) (k : O) (hk : k ∉ secondFrequencyCutoff scale H) : H < scale * ‖eisEmbedding k‖^2 := by have hnorm : H/scale < ‖eisEmbedding k‖^2 := lt_of_not_ge (fun h => hk (mem_secondFrequencyCutoff scale H k h)) have h := (div_lt_iff₀ hs).mp hnorm simpa only [mul_comm] using h theorem active_norm_sq_disjoint {ι : Type*} [DecidableEq ι] (p : ι → O) (S T : Finset ι) (hd : Disjoint S T) : ‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖^2 = primeProductNorm p S * primeProductNorm p T := by rw [Finset.prod_coe_sort] simp only [activeSupport, Finset.sdiff_eq_self_of_disjoint hd, Finset.sdiff_eq_self_of_disjoint hd.symm, Finset.prod_union hd.symm, map_mul, norm_mul, mul_pow] simp only [primeProductNorm] ring theorem secondFrequencyCutoff_uniform {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) (X Y M H : ℝ) (hX : 0 < X) (hY : 0 < Y) (e : O) (he : e ≠ 0) (S T : Finset ι) (hd : Disjoint S T) (hS : columnLog p X S ≤ M) (hT : columnLog p X T ≤ M) (k : O) (hk : k ∉ secondFrequencyCutoff (Y/(‖eisEmbedding e‖^2*(X*Real.exp M)^2)) H) : H ≤ (Y/(‖eisEmbedding e‖^2*‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖^2)) * ‖eisEmbedding k‖^2 := by have hNe : 0 < ‖eisEmbedding e‖^2 := sq_pos_of_pos (norm_pos_iff.mpr (ConcreteTraceCRT.eisEmbedding_ne_zero he)) have hU : 0 < X*Real.exp M := mul_pos hX (Real.exp_pos M) have hslow : 0 < Y/(‖eisEmbedding e‖^2*(X*Real.exp M)^2) := div_pos hY (mul_pos hNe (sq_pos_of_pos hU)) have hbS := columnLog_norm_upper p hp X M hX S hS have hbT := columnLog_norm_upper p hp X M hX T hT have hprod : primeProductNorm p S * primeProductNorm p T ≤ (X*Real.exp M)^2 := by simpa only [pow_two] using mul_le_mul hbS hbT (primeProductNorm_pos p hp T).le hU.le have hscale : Y/(‖eisEmbedding e‖^2*(X*Real.exp M)^2) ≤ Y/(‖eisEmbedding e‖^2*‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖^2) := by rw [active_norm_sq_disjoint p S T hd] exact div_le_div_of_nonneg_left hY.le (mul_pos hNe (mul_pos (primeProductNorm_pos p hp S) (primeProductNorm_pos p hp T))) (mul_le_mul_of_nonneg_left hprod hNe.le) exact (outside_secondFrequencyCutoff _ H hslow k hk).le.trans (mul_le_mul_of_nonneg_right hscale (sq_nonneg _)) end section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) def truncatedSecondZero (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (K : Finset ι → Finset ι → Finset O) : ℂ := (Y : ℂ) * paperRadialFourier W 0 * ∑ G ∈ F.powerset, (‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) G‖ ^ 2 : ℝ) * star (H G) * H G * ∑ E : G.powerset, if 0 ∈ K G E.val then (UniqueFactorizationMonoid.moebius (∏ i ∈ E.val, Ideal.span {p i}) : ℂ) / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val)‖ ^ 2 : ℝ) else 0 theorem truncatedSecondSource_eq_nonzero_add_zero (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (K : Finset ι → Finset ι → Finset O) : truncatedSecondSource p hp hg hinj F Ψ m c d H W Y K = truncatedSecondSource p hp hg hinj F Ψ m c d H W Y (fun G E => (K G E).erase 0) + truncatedSecondZero p hg F Ψ m c d H W Y K := by unfold truncatedSecondSource truncatedSecondZero simp only [Finset.mul_sum] rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro G hG rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro E hE by_cases h0 : 0 ∈ K G E.val · rw [← Finset.sum_erase_add _ _ h0] congr 1 simp only [if_pos h0, secondFrequencyKernel_zero, Finset.union_empty, secondSourceCommonCoefficient] ring · simp only [Finset.erase_eq_of_notMem h0, if_neg h0, mul_zero, add_zero] end open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff FourierTransform open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open FirstPassCubeLabels (columnLog normalizedColumn jLabel b0Label firstLogDensity) open JointLogSeparation (halfNormalizationCLM halfNormalizationCLM_apply outerWindow tripleCoefficient) open SecondPassIntegration (childGeometricMean) end SecondPassArithmetic open scoped BigOperators Classical namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal UniqueFactorizationMonoid CompletedGauss open PrimaryIdealUnitReindex (GoodIdeal) def ramifiedIdeal : Ideal O := Ideal.span {lambda} lemma ramifiedIdeal_prime : Prime ramifiedIdeal := by exact Ideal.prime_of_isPrime (Ideal.span_singleton_eq_bot.not.mpr residue_lambda_prime.ne_zero) ((Ideal.span_singleton_prime residue_lambda_prime.ne_zero).mpr residue_lambda_prime) lemma goodIdeal_iff_not_ramified (I : Ideal O) : primaryGenerator I ≠ 0 ↔ ¬ ramifiedIdeal ∣ I := by rw [← ConcretePrimeRowBridge.span_idealGenerator I, PrimaryIdealUnitReindex.primaryGenerator_span_ne_zero_iff, Ideal.dvd_iff_le,ramifiedIdeal,Ideal.span_singleton_le_span_singleton] lemma ramifiedIdeal_absNorm : Ideal.absNorm ramifiedIdeal=3 := absNorm_span_lambda lemma prime_power_remainder_multiplicity {R : Type*} [CommMonoidWithZero R] [IsCancelMulZero R] {p a : R} (hp : Prime p) (ha : ¬ p ∣ a) (n : ℕ) : multiplicity p (p^n*a)=n := by apply multiplicity_eq_of_dvd_of_not_dvd ⟨a,rfl⟩ intro hd rw [pow_succ] at hd exact ha ((mul_dvd_mul_iff_left (pow_ne_zero n hp.ne_zero)).mp hd) abbrev NonzeroIdeal := {I : Ideal O // I ≠ 0} def lambdaFactorMap (p : ℕ × GoodIdeal) : NonzeroIdeal := ⟨ramifiedIdeal^p.1*p.2.1,mul_ne_zero (pow_ne_zero _ ramifiedIdeal_prime.ne_zero) (primaryGenerator_ne_zero_ideal _ p.2.2)⟩ lemma lambdaFactorMap_bijective : Function.Bijective lambdaFactorMap := by constructor · rintro ⟨n,I⟩ ⟨m,J⟩ heq have hh : ramifiedIdeal^n*I.1=ramifiedIdeal^m*J.1 := congrArg Subtype.val heq have hn : n=m := by have hm := congrArg (multiplicity ramifiedIdeal) hh rw [prime_power_remainder_multiplicity ramifiedIdeal_prime ((goodIdeal_iff_not_ramified I.1).mp I.2), prime_power_remainder_multiplicity ramifiedIdeal_prime ((goodIdeal_iff_not_ramified J.1).mp J.2)] at hm exact hm subst m have hIJ : I=J := Subtype.ext (mul_left_cancel₀ (pow_ne_zero n ramifiedIdeal_prime.ne_zero) hh) subst J rfl · intro I obtain ⟨J,hJ,hnot⟩ := (FiniteMultiplicity.of_prime_left ramifiedIdeal_prime I.2).exists_eq_pow_mul_and_not_dvd refine ⟨(multiplicity ramifiedIdeal I.1,⟨J,(goodIdeal_iff_not_ramified J).mpr hnot⟩), ?_⟩ exact Subtype.ext hJ.symm def lambdaFactorEquiv : ℕ × GoodIdeal ≃ NonzeroIdeal := Equiv.ofBijective lambdaFactorMap lambdaFactorMap_bijective lemma ideal_pow_injective {n : ℕ} (hn : n ≠ 0) : Function.Injective (fun I : Ideal O => I ^n) := by intro I J h dsimp only at h apply le_antisymm · apply Ideal.dvd_iff_le.mp apply (pow_dvd_pow_iff_dvd hn).mp rw [h] · apply Ideal.dvd_iff_le.mp apply (pow_dvd_pow_iff_dvd hn).mp rw [h] lemma lambdaFactor_generator_span (n : ℕ) (I : GoodIdeal) : Ideal.span {lambda^n*primaryGenerator I.1}=ramifiedIdeal^n*I.1 := by rw [← Ideal.span_singleton_mul_span_singleton,← Ideal.span_singleton_pow, (primaryGenerator_spec I.1 I.2).1] rfl lemma three_dvd_lambda_sq : (3:O) ∣ lambda^2 := by have h := three_dvd_primary_sub_one (lambda^2+1) (show lambda^2 ∣ lambda^2+1-1 by simp) simpa only [add_sub_cancel_right] using h lemma unit_cube_eq_sign (u : Oˣ) : (u:O)^3=1 ∨ (u:O)^3= -1 := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK let ζ := IsCyclotomicExtension.zeta_spec 3 ℚ ActualEisensteinCubic.K let η : Oˣ := (ζ.toInteger_isPrimitiveRoot.isUnit (by decide)).unit have hη : (η:O)=omega := rfl have hlist : u ∈ ([1,-1,η,-η,η^2,-η^2] : List Oˣ) := IsCyclotomicExtension.Rat.Three.Units.mem ζ u simp only [List.mem_cons,List.mem_nil_iff,or_false] at hlist rcases hlist with h | h | h | h | h | h · left; simp [h] · right; norm_num [h] · left; simpa only [h,hη] using omega_primitive.pow_eq_one · right rw [h,Units.val_neg,hη] have hh := omega_primitive.pow_eq_one linear_combination -hh · left rw [h,Units.val_pow_eq_pow_val,hη,show (omega^2)^3=(omega^3)^2 by ring,omega_primitive.pow_eq_one] simp · right rw [h,Units.val_neg,Units.val_pow_eq_pow_val,hη] simp only [neg_pow,show (-1:O)^3= -1 by norm_num, show (omega^2)^3=(omega^3)^2 by ring,omega_primitive.pow_eq_one,one_pow,mul_one] def cubeSign : Bool → O | false => 1 | true => -1 lemma cubeSign_isUnit (b : Bool) : IsUnit (cubeSign b) := by cases b <;> simp [cubeSign] lemma cubeSign_cube (b : Bool) : (cubeSign b)^3=cubeSign b := by cases b <;> norm_num [cubeSign] lemma cubeSign_injective : Function.Injective cubeSign := by intro a b h cases a <;> cases b <;> try rfl all_goals norm_num [cubeSign] at h def cubeBase (n : ℕ) (I : GoodIdeal) : O := lambda^(n+1)*primaryGenerator I.1 def cubeColumn (b : Bool) (n : ℕ) (I : GoodIdeal) : O := cubeSign b*(cubeBase n I)^3 lemma cubeBase_ne_zero (n : ℕ) (I : GoodIdeal) : cubeBase n I ≠ 0 := mul_ne_zero (pow_ne_zero _ residue_lambda_prime.ne_zero) I.2 lemma cubeColumn_ne_zero (b : Bool) (n : ℕ) (I : GoodIdeal) : cubeColumn b n I ≠ 0 := mul_ne_zero (cubeSign_isUnit b).ne_zero (pow_ne_zero 3 (cubeBase_ne_zero n I)) lemma cubeColumn_cube (b : Bool) (n : ℕ) (I : GoodIdeal) : cubeColumn b n I=(cubeSign b*cubeBase n I)^3 := by rw [mul_pow,cubeSign_cube] rfl lemma cubeColumn_level (b : Bool) (n : ℕ) (I : GoodIdeal) : (3:O) ∣ cubeColumn b n I := by have h3 : (3:O) ∣ lambda^(3*(n+1)) := three_dvd_lambda_sq.trans (pow_dvd_pow lambda (by omega)) have heq : cubeColumn b n I=cubeSign b*(lambda^(3*(n+1))*(primaryGenerator I.1)^3) := by simp only [cubeColumn,cubeBase,mul_pow,← pow_mul] congr 2 ring rw [heq] exact (h3.mul_right _).mul_left _ lemma cubeColumn_span (b : Bool) (n : ℕ) (I : GoodIdeal) : Ideal.span {cubeColumn b n I}=(ramifiedIdeal^(n+1)*I.1)^3 := by rw [cubeColumn,Ideal.span_singleton_mul_left_unit (cubeSign_isUnit b), ← Ideal.span_singleton_pow] change (Ideal.span {lambda^(n+1)*primaryGenerator I.1})^3=_ rw [lambdaFactor_generator_span] abbrev CubeLower := {c : LevelLower // c.1 ≠ 0 ∧ ∃ a : O,c.1=a^3} def cubeColumnMap (p : Bool × ℕ × GoodIdeal) : CubeLower := ⟨⟨cubeColumn p.1 p.2.1 p.2.2,cubeColumn_level p.1 p.2.1 p.2.2⟩, cubeColumn_ne_zero p.1 p.2.1 p.2.2,⟨cubeSign p.1*cubeBase p.2.1 p.2.2, cubeColumn_cube p.1 p.2.1 p.2.2⟩⟩ lemma cubeColumnMap_injective : Function.Injective cubeColumnMap := by rintro ⟨b,n,I⟩ ⟨d,m,J⟩ h have hc : cubeColumn b n I=cubeColumn d m J := congrArg (fun c : CubeLower => c.1.1) h have hs := congrArg (fun a : O => Ideal.span {a}) hc rw [cubeColumn_span,cubeColumn_span] at hs have hr := ideal_pow_injective (by decide : (3:ℕ) ≠ 0) hs have hp : lambdaFactorMap (n+1,I)=lambdaFactorMap (m+1,J) := Subtype.ext hr have he := lambdaFactorMap_bijective.1 hp have hnm : n=m := Nat.succ.inj (congrArg Prod.fst he) have hIJ : I=J := congrArg Prod.snd he subst m; subst J have hbd : b=d := cubeSign_injective (mul_right_cancel₀ (pow_ne_zero 3 (cubeBase_ne_zero n I)) hc) subst d rfl lemma cubeColumnMap_surjective : Function.Surjective cubeColumnMap := by intro c obtain ⟨a,ha⟩ := c.2.2 have ha0 : a ≠ 0 := by intro h; rw [h,zero_pow (by decide)] at ha; exact c.2.1 ha let A : NonzeroIdeal := ⟨Ideal.span {a},Ideal.span_singleton_eq_bot.not.mpr ha0⟩ obtain ⟨⟨k,I⟩,hAI⟩ := lambdaFactorMap_bijective.2 A have hfact : ramifiedIdeal^k*I.1=Ideal.span {a} := congrArg Subtype.val hAI have hla : lambda ∣ a := by apply residue_lambda_prime.dvd_of_dvd_pow have hlam3 : lambda ∣ (3:O) := (dvd_pow_self lambda (by decide : 2 ≠ 0)).trans lambda_sq_dvd_three rw [← ha] exact hlam3.trans c.1.2 have hk : k ≠ 0 := by intro hk have hIeq : I.1=Ideal.span {a} := by simpa only [hk,pow_zero,one_mul] using hfact apply (goodIdeal_iff_not_ramified I.1).mp I.2 rw [hIeq,Ideal.dvd_iff_le,ramifiedIdeal,Ideal.span_singleton_le_span_singleton] exact hla obtain ⟨n,rfl⟩ := Nat.exists_eq_succ_of_ne_zero hk have hspan : Ideal.span {cubeBase n I}=Ideal.span {a} := (lambdaFactor_generator_span (n+1) I).trans hfact obtain ⟨u,hu⟩ := Ideal.span_singleton_eq_span_singleton.mp hspan rcases unit_cube_eq_sign u with hu1 | hum1 · refine ⟨(false,n,I),Subtype.ext (Subtype.ext ?_)⟩ change cubeColumn false n I=c.1.1 rw [ha,← hu,mul_pow,hu1,mul_one] simp only [cubeColumn,cubeSign,one_mul] · refine ⟨(true,n,I),Subtype.ext (Subtype.ext ?_)⟩ change cubeColumn true n I=c.1.1 rw [ha,← hu,mul_pow,hum1] simp only [cubeColumn,cubeSign] ring def cubeColumnEquiv : Bool × ℕ × GoodIdeal ≃ CubeLower := Equiv.ofBijective cubeColumnMap ⟨cubeColumnMap_injective,cubeColumnMap_surjective⟩ lemma cubeColumn_expanded (b : Bool) (n : ℕ) (I : GoodIdeal) : cubeColumn b n I=lambda^(3*(n+1))*(cubeSign b*primaryGenerator I.1)^3 := by simp only [cubeColumn,cubeBase,mul_pow,cubeSign_cube,← pow_mul] rw [Nat.mul_comm (n+1) 3] ring lemma cubeColumn_arithmetic_sum (b : Bool) (n : ℕ) (I : GoodIdeal) : arithmeticResidueSum 0 (cubeColumn b n I)= (3^(3*(n+1))*Ideal.absNorm I.1^2*idealTotient I.1:ℕ) := by have ha : cubeSign b*cubeBase n I ≠ 0 := mul_ne_zero (cubeSign_isUnit b).ne_zero (cubeBase_ne_zero n I) have hA := arithmeticResidueSum_cube _ ha rw [← cubeColumn_cube] at hA rw [hA,cubeColumn_expanded] have hc : IsCoprime (cubeSign b*primaryGenerator I.1) (3:O) := (isCoprime_mul_unit_left_left (cubeSign_isUnit b) _ _).mpr (primary_coprime_three _ (primaryGenerator_spec I.1 I.2).2) have hs : Ideal.span {cubeSign b*primaryGenerator I.1}=I.1 := by rw [Ideal.span_singleton_mul_left_unit (cubeSign_isUnit b),(primaryGenerator_spec I.1 I.2).1] rw [card_admissible_cube_product (n+1) _ (mul_ne_zero (cubeSign_isUnit b).ne_zero I.2) hc,hs] lemma cubeColumn_norm (b : Bool) (n : ℕ) (I : GoodIdeal) : Ideal.absNorm (Ideal.span {cubeColumn b n I})=3^(3*(n+1))*Ideal.absNorm I.1^3 := by rw [cubeColumn_span,map_pow,map_mul,map_pow,ramifiedIdeal_absNorm,mul_pow,← pow_mul] rw [Nat.mul_comm (n+1) 3] def ramifiedRatio (s : ℂ) : ℂ := (3:ℂ)^(3-3*s) lemma cube_norm_weight_algebra (s : ℂ) (n N : ℕ) (hN : N ≠ 0) : ((3^(3*(n+1))*N^3:ℕ):ℂ)^(-s) * (3^(3*(n+1))*N^2:ℕ) = ramifiedRatio s^(n+1) * (N:ℂ)^(-(3*s-2)) := by have hNc : (N:ℂ) ≠ 0 := Nat.cast_ne_zero.mpr hN simp only [Nat.cast_mul,Nat.cast_pow,Nat.cast_ofNat] have hsplit : ((3:ℂ)^(3*(n+1):ℕ)*(N:ℂ)^3)^(-s)= (3:ℂ)^((3*(n+1):ℕ)*(-s))*(N:ℂ)^(3*(-s)) := by have hm := Complex.natCast_mul_natCast_cpow (3^(3*(n+1))) (N^3) (-s) simp only [Nat.cast_pow,Nat.cast_ofNat] at hm rw [hm] have h3 : ((3:ℂ)^(3*(n+1):ℕ))^(-s)=(3:ℂ)^((3*(n+1):ℕ)*(-s)) := by simpa only [Nat.cast_ofNat] using (Complex.natCast_cpow_natCast_mul 3 (3*(n+1)) (-s)).symm have hN' : ((N:ℂ)^3)^(-s)=(N:ℂ)^(3*(-s)) := by simpa only [Nat.cast_ofNat] using (Complex.natCast_cpow_natCast_mul N 3 (-s)).symm rw [h3,hN'] rw [hsplit] have hpoly : (3:ℂ)^(3*(n+1):ℕ)*(N:ℂ)^2 = (3:ℂ)^((3*(n+1):ℕ):ℂ)*(N:ℂ)^(2:ℂ) := by norm_num only [Complex.cpow_natCast,Complex.cpow_ofNat] rw [hpoly] calc _ = ((3:ℂ)^((3*(n+1):ℕ)*(-s))*(3:ℂ)^((3*(n+1):ℕ):ℂ))* ((N:ℂ)^(3*(-s))*(N:ℂ)^(2:ℂ)) := by ring _ = (3:ℂ)^((3*(n+1):ℕ)*(-s)+(3*(n+1):ℕ)) * (N:ℂ)^(3*(-s)+2) := by rw [← Complex.cpow_add _ _ (by norm_num : (3:ℂ) ≠ 0),← Complex.cpow_add _ _ hNc] _ = ramifiedRatio s^(n+1) * (N:ℂ)^(-(3*s-2)) := by unfold ramifiedRatio rw [← Complex.cpow_mul_nat] congr 1 <;> congr 1 <;> push_cast <;> ring lemma cubeColumn_dirichletTerm (s : ℂ) (b : Bool) (n : ℕ) (I : GoodIdeal) : arithmeticDirichletTerm s 0 (cubeColumnMap (b,n,I)).1 = ramifiedRatio s^(n+1) * ((idealTotient I.1:ℂ)*unramifiedNormWeight (3*s-2) I.1) := by have hI : Ideal.absNorm I.1 ≠ 0 := Ideal.absNorm_eq_zero_iff.not.mpr (primaryGenerator_ne_zero_ideal I.1 I.2) change (if cubeColumn b n I=0 then 0 else ((‖eisEmbedding (cubeColumn b n I)‖^2:ℝ):ℂ)^(-s)* arithmeticResidueSum 0 (cubeColumn b n I)) = _ rw [if_neg (cubeColumn_ne_zero b n I),eisEmbedding_norm_sq_eq_absNorm_span, Complex.ofReal_natCast,cubeColumn_norm,cubeColumn_arithmetic_sum, unramifiedNormWeight_of_good _ _ I.2] calc _ = (((3^(3*(n+1))*Ideal.absNorm I.1^3:ℕ):ℂ)^(-s) * (3^(3*(n+1))*Ideal.absNorm I.1^2:ℕ))*(idealTotient I.1:ℂ) := by push_cast ring _ = (ramifiedRatio s^(n+1)*(Ideal.absNorm I.1:ℂ)^(-(3*s-2)))*(idealTotient I.1:ℂ) := by rw [cube_norm_weight_algebra s n (Ideal.absNorm I.1) hI] _ = _ := by ring end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ConstantDirichletSeries namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal UniqueFactorizationMonoid CompletedGauss open PrimaryIdealUnitReindex (GoodIdeal) lemma constant_dirichlet_support (s : ℂ) : Function.support (arithmeticDirichletTerm s 0) ⊆ {c : LevelLower | c.1 ≠ 0 ∧ ∃ a : O,c.1=a^3} := by intro c hc change arithmeticDirichletTerm s 0 c ≠ 0 at hc by_cases hzero : c.1=0 · simp [arithmeticDirichletTerm,hzero] at hc · refine ⟨hzero, ?_⟩ have hA : arithmeticResidueSum 0 c.1 ≠ 0 := by intro hA apply hc simp only [arithmeticDirichletTerm,if_neg hzero,hA,mul_zero] exact (arithmeticResidueSum_ne_zero_iff_cube c.1 hzero c.2).mp hA lemma totient_sum_good (s : ℂ) : (∑' I : GoodIdeal,(idealTotient I.1:ℂ)*unramifiedNormWeight s I.1)=unramifiedTotientSeries s := by unfold unramifiedTotientSeries apply tsum_subtype_eq_of_support_subset (s := {I : Ideal O | primaryGenerator I ≠ 0}) (f := fun I : Ideal O => (idealTotient I:ℂ)*unramifiedNormWeight s I) intro I hI change (idealTotient I:ℂ)*unramifiedNormWeight s I ≠ 0 at hI change primaryGenerator I ≠ 0 intro hg apply hI rw [unramifiedNormWeight_of_bad _ I hg,mul_zero] lemma norm_ramifiedRatio_lt_one (s : ℂ) (hs : 1 ‖arithmeticDirichletTerm s 0 c‖) := by have hs1 : 1 ‖ramifiedRatio s^(n+1)‖) := by have hh := (summable_geometric_of_lt_one (norm_nonneg (ramifiedRatio s)) hq).mul_right ‖ramifiedRatio s‖ simpa only [pow_succ,norm_mul,norm_pow] using hh have hi := (unramifiedTotientSeries_summable_norm (3*s-2) hw).subtype (fun I : Ideal O => primaryGenerator I ≠ 0) have hni := hqn.mul_norm hi have hb : Summable (fun _ : Bool => ‖(1:ℂ)‖) := summable_of_hasFiniteSupport (Set.toFinite _) have hfull := hb.mul_norm hni have hp : Summable (fun p : Bool × ℕ × GoodIdeal => ‖arithmeticDirichletTerm s 0 (cubeColumnMap p).1‖) := by apply hfull.congr rintro ⟨b,n,I⟩ simp only [one_mul,cubeColumn_dirichletTerm] have hsub : Summable (fun c : CubeLower => ‖arithmeticDirichletTerm s 0 c.1‖) := cubeColumnEquiv.summable_iff.mp hp have hind := (summable_subtype_iff_indicator (s := {c : LevelLower | c.1 ≠ 0 ∧ ∃ a : O,c.1=a^3}) (f := fun c => ‖arithmeticDirichletTerm s 0 c‖)).mp hsub apply hind.congr intro c by_cases hc : c.1 ≠ 0 ∧ ∃ a : O,c.1=a^3 · simp [Set.indicator,hc] · have hz : arithmeticDirichletTerm s 0 c=0 := by by_contra h exact hc (constant_dirichlet_support s h) simp [Set.indicator,hc,hz] lemma ramified_geometric_sum (s : ℂ) (hs : 1 arithmeticDirichletTerm s 0 c.1) := hc.subtype _ have hp := cubeColumnEquiv.summable_iff.mpr hsub change Summable (fun p : Bool × ℕ × GoodIdeal => arithmeticDirichletTerm s 0 (cubeColumnMap p).1) at hp calc _ = ∑' c : CubeLower,arithmeticDirichletTerm s 0 c.1 := (tsum_subtype_eq_of_support_subset (constant_dirichlet_support s)).symm _ = ∑' p : Bool × ℕ × GoodIdeal,arithmeticDirichletTerm s 0 (cubeColumnMap p).1 := (cubeColumnEquiv.tsum_eq _).symm _ = ∑' b : Bool,∑' n : ℕ,∑' I : GoodIdeal, arithmeticDirichletTerm s 0 (cubeColumnMap (b,n,I)).1 := by rw [hp.tsum_prod] apply tsum_congr intro b exact (hp.prod_factor b).tsum_prod _ = ∑' b : Bool,∑' n : ℕ,∑' I : GoodIdeal, ramifiedRatio s^(n+1)*((idealTotient I.1:ℂ)*unramifiedNormWeight (3*s-2) I.1) := by apply tsum_congr; intro b apply tsum_congr; intro n exact tsum_congr (fun I => cubeColumn_dirichletTerm s b n I) _ = ∑' _ : Bool,∑' n : ℕ,ramifiedRatio s^(n+1)*unramifiedTotientSeries (3*s-2) := by apply tsum_congr; intro b apply tsum_congr; intro n rw [tsum_mul_left,totient_sum_good] _ = ∑' _ : Bool,((3:ℂ)^(3*s-3)-1)⁻¹*unramifiedTotientSeries (3*s-2) := by apply tsum_congr; intro b rw [tsum_mul_right,ramified_geometric_sum s (by linarith)] _ = _ := by rw [tsum_fintype] simp only [Finset.sum_const,Finset.card_univ,Fintype.card_bool,nsmul_eq_mul] ring theorem scatteringCoefficient_zero_zeta (s : ℂ) (hs : (4:ℝ)/3 by rw [poolPrimary_span F hF i]; infer_instance matrix M N = QuadraticInitialBound.quadraticMatrix (poolPrimary F) (poolPrimary_good F hF) (fun I : idealRange M => idealSupport F I.val) (fun J : idealRange N => idealSupport F J.val) := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal ext I J change quadraticRow J.val (primaryGenerator I.val) = _ rw [quadraticRow_eq_primaryPool F hF J.val (hN J.property)] rw [primaryGenerator_eq_poolProduct F hF I.val (hM I.property)] rfl theorem sieveNorm_reverse_le (M N : ℝ) : sieveNorm M N ≤ 262144 * sieveNorm N M := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F := idealRange M ∪ idealRange N have hF : ∀ I ∈ F, Admissible I := by intro I hI rcases Finset.mem_union.mp hI with hI | hI · exact (mem_idealRange.mp hI).1 · exact (mem_idealRange.mp hI).1 have hM : idealRange M ⊆ F := Finset.subset_union_left have hN : idealRange N ⊆ F := Finset.subset_union_right let : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance have h := QuadraticInitialBound.quadraticSieveNorm_reverse_le (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) (poolPrimary_odd F hF) (fun I : idealRange M => idealSupport F I.val) (fun J : idealRange N => idealSupport F J.val) simpa only [QuadraticInitialBound.quadraticSieveNorm, ← matrix_eq_primePool M N F hF hM hN, ← matrix_eq_primePool N M F hF hN hM, sieveNorm] using h end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open EisensteinSchwartzPoisson GaussGeneratorTransport UnrestrictedIdealReindex open TruncatedPrincipalPoisson QuadraticSquarefreeKernel def dualPrincipalIdeal (I J : Ideal O) (V : ℝ → ℂ) (X : ℝ) : ℂ := ∑' A : NonzeroIdeal, (idealZeroMask I (idealGenerator A.val) * idealZeroMask J (idealGenerator A.val)) * V ((Ideal.absNorm A.val : ℝ) / X) theorem canonical_pair_ideal_fourier_summable (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (t : ℝ) (ht : 0 < t) : Summable (fun lengthScale : NonzeroIdeal => unrestrictedPairCharacter I J lengthScale.val * paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ))) := by have hi : Function.Injective (fun lengthScale : NonzeroIdeal => idealGenerator lengthScale.val) := by intro A B he apply Subtype.ext have hs := congrArg (fun z : O => Ideal.span {z}) he simpa only [span_idealGenerator] using hs have h := (canonical_pair_fourier_summable I J W t ht).comp_injective hi simpa only [Function.comp_def, idealGenerator_norm_sq, unrestrictedPairCharacter] using h end section open ActualEisensteinCubic CompletedGauss IdealMobiusDivisorSum open QuadraticMainOperatorBound IdealCoprimeSieveOperator DivisorBlockCauchy end open ActualEisensteinCubic CompletedGauss FiniteSieveRestriction def CoefficientOnShell (N X : ℝ) (a : idealRange N → ℂ) : Prop := ∀ J, a J ≠ 0 → X / 2 < (Ideal.absNorm J.val : ℝ) ∧ (Ideal.absNorm J.val : ℝ) ≤ X theorem column_dyadic_exists (N : ℝ) (lengthScale : ℕ) (hNL : N ≤ (2 : ℝ) ^ lengthScale) (J : idealRange N) : ∃ j ∈ Finset.range (lengthScale + 1), (2 : ℝ) ^ j / 2 < (Ideal.absNorm J.val : ℝ) ∧ (Ideal.absNorm J.val : ℝ) ≤ (2 : ℝ) ^ j := by have hn : 1 ≤ Ideal.absNorm J.val := Nat.one_le_iff_ne_zero.mpr (fun hz => (mem_idealRange.mp J.property).1.1 (Ideal.absNorm_eq_zero_iff.mp hz)) exact exists_dyadic_shell (Ideal.absNorm J.val) lengthScale hn ((mem_idealRange.mp J.property).2.trans hNL) def columnDyadicSector (N : ℝ) (lengthScale : ℕ) (hNL : N ≤ (2 : ℝ) ^ lengthScale) (J : idealRange N) : Fin (lengthScale + 1) := ⟨(column_dyadic_exists N lengthScale hNL J).choose, Finset.mem_range.mp (column_dyadic_exists N lengthScale hNL J).choose_spec.1⟩ def dyadicColumnCoefficient (N : ℝ) (lengthScale : ℕ) (hNL : N ≤ (2 : ℝ) ^ lengthScale) (j : Fin (lengthScale + 1)) (a : idealRange N → ℂ) : idealRange N → ℂ := sectorCoefficient (columnDyadicSector N lengthScale hNL) j a theorem dyadicColumnCoefficient_shell (N : ℝ) (lengthScale : ℕ) (hNL : N ≤ (2 : ℝ) ^ lengthScale) (j : Fin (lengthScale + 1)) (a : idealRange N → ℂ) : CoefficientOnShell N ((2 : ℝ) ^ j.val) (dyadicColumnCoefficient N lengthScale hNL j a) := by intro J hJ have he : columnDyadicSector N lengthScale hNL J = j := by by_contra hn exact hJ (by simp only [dyadicColumnCoefficient, sectorCoefficient, if_neg hn]) have hs := (column_dyadic_exists N lengthScale hNL J).choose_spec.2 have hv : (columnDyadicSector N lengthScale hNL J).val = j.val := congrArg Fin.val he change (column_dyadic_exists N lengthScale hNL J).choose = j.val at hv simpa only [hv] using hs theorem dyadicColumnCoefficient_energy (N : ℝ) (lengthScale : ℕ) (hNL : N ≤ (2 : ℝ) ^ lengthScale) (a : idealRange N → ℂ) : (∑ j : Fin (lengthScale + 1), ∑ J, ‖dyadicColumnCoefficient N lengthScale hNL j a J‖ ^ 2) = ∑ J, ‖a J‖ ^ 2 := sectorCoefficient_energy (columnDyadicSector N lengthScale hNL) a theorem weighted_energy_column_shells {m : Type*} [Fintype m] (N : ℝ) (lengthScale : ℕ) (hNL : N ≤ (2 : ℝ) ^ lengthScale) (A : Matrix m (idealRange N) ℂ) (v : m → ℝ) (hv : ∀ i, 0 ≤ v i) (a : idealRange N → ℂ) : (∑ i, v i * ‖∑ J, A i J * a J‖ ^ 2) ≤ (lengthScale + 1 : ℝ) * ∑ j : Fin (lengthScale + 1), ∑ i, v i * ‖∑ J, A i J * dyadicColumnCoefficient N lengthScale hNL j a J‖ ^ 2 := by simpa only [Fintype.card_fin, Nat.cast_add, Nat.cast_one, dyadicColumnCoefficient] using sector_weighted_energy_bound A (columnDyadicSector N lengthScale hNL) a v hv def coefficientAtScale (N X : ℝ) (a : idealRange N → ℂ) (J : idealRange X) : ℂ := if h : J.val ∈ idealRange N then a ⟨J.val, h⟩ else 0 theorem coefficientAtScale_shell (N X : ℝ) (a : idealRange N → ℂ) (ha : CoefficientOnShell N X a) : CoefficientOnShell X X (coefficientAtScale N X a) := by intro J hJ unfold coefficientAtScale at hJ split_ifs at hJ with h · exact ha ⟨J.val, h⟩ hJ · exact (hJ rfl).elim theorem coefficientAtScale_row_sum (N X : ℝ) (a : idealRange N → ℂ) (ha : ∀ J, a J ≠ 0 → (Ideal.absNorm J.val : ℝ) ≤ X) (z : O) : (∑ J : idealRange N, quadraticRow J.val z * a J) = ∑ J : idealRange X, quadraticRow J.val z * coefficientAtScale N X a J := by let f : Ideal O → ℂ := fun I => if h : I ∈ idealRange N then quadraticRow I z * a ⟨I, h⟩ else 0 have hleft : (∑ J : idealRange N, quadraticRow J.val z * a J) = ∑ I ∈ idealRange N, f I := by rw [← Finset.sum_coe_sort (idealRange N) f] apply Finset.sum_congr rfl intro J _ simp only [f, dif_pos J.property] have hright : (∑ J : idealRange X, quadraticRow J.val z * coefficientAtScale N X a J) = ∑ I ∈ idealRange X, f I := by rw [← Finset.sum_coe_sort (idealRange X) f] apply Finset.sum_congr rfl intro J _ unfold coefficientAtScale split_ifs with h <;> simp only [f, h, ↓reduceDIte, mul_zero] rw [hleft, hright] rcases le_total N X with hNX | hXN · apply Finset.sum_subset (idealRange_mono hNX) intro I hIX hIN simp only [f, dif_neg hIN] · symm apply Finset.sum_subset (idealRange_mono hXN) intro I hIN hIX have haI : a ⟨I, hIN⟩ = 0 := by by_contra hn exact hIX (mem_idealRange.mpr ⟨(mem_idealRange.mp hIN).1, ha ⟨I, hIN⟩ hn⟩) simp only [f, dif_pos hIN, haI, mul_zero] theorem coefficientAtScale_energy (N X : ℝ) (a : idealRange N → ℂ) (ha : ∀ J, a J ≠ 0 → (Ideal.absNorm J.val : ℝ) ≤ X) : (∑ J : idealRange N, ‖a J‖ ^ 2) = ∑ J : idealRange X, ‖coefficientAtScale N X a J‖ ^ 2 := by let f : Ideal O → ℝ := fun I => if h : I ∈ idealRange N then ‖a ⟨I, h⟩‖ ^ 2 else 0 have hleft : (∑ J : idealRange N, ‖a J‖ ^ 2) = ∑ I ∈ idealRange N, f I := by rw [← Finset.sum_coe_sort (idealRange N) f] apply Finset.sum_congr rfl intro J _ simp only [f, dif_pos J.property] have hright : (∑ J : idealRange X, ‖coefficientAtScale N X a J‖ ^ 2) = ∑ I ∈ idealRange X, f I := by rw [← Finset.sum_coe_sort (idealRange X) f] apply Finset.sum_congr rfl intro J _ unfold coefficientAtScale split_ifs with h <;> simp only [f, h, ↓reduceDIte, norm_zero, zero_pow (by decide : 2 ≠ 0)] rw [hleft, hright] rcases le_total N X with hNX | hXN · apply Finset.sum_subset (idealRange_mono hNX) intro I hIX hIN simp only [f, dif_neg hIN] · symm apply Finset.sum_subset (idealRange_mono hXN) intro I hIN hIX have haI : a ⟨I, hIN⟩ = 0 := by by_contra hn exact hIX (mem_idealRange.mpr ⟨(mem_idealRange.mp hIN).1, ha ⟨I, hIN⟩ hn⟩) simp only [f, dif_pos hIN, haI, norm_zero, zero_pow (by decide : 2 ≠ 0)] theorem annularHighEnergy_coefficientAtScale (M N X K : ℝ) (a : idealRange N → ℂ) (ha : ∀ J, a J ≠ 0 → (Ideal.absNorm J.val : ℝ) ≤ X) : annularHighEnergy M N K a = annularHighEnergy M X K (coefficientAtScale N X a) := by unfold annularHighEnergy simp_rw [coefficientAtScale_row_sum N X a ha] theorem dyadicColumnCoefficient_at_scale_energy (N : ℝ) (lengthScale : ℕ) (hNL : N ≤ (2 : ℝ) ^ lengthScale) (a : idealRange N → ℂ) : (∑ j : Fin (lengthScale + 1), ∑ J : idealRange ((2 : ℝ) ^ j.val), ‖coefficientAtScale N ((2 : ℝ) ^ j.val) (dyadicColumnCoefficient N lengthScale hNL j a) J‖ ^ 2) = ∑ J : idealRange N, ‖a J‖ ^ 2 := by calc _ = ∑ j : Fin (lengthScale + 1), ∑ J : idealRange N, ‖dyadicColumnCoefficient N lengthScale hNL j a J‖ ^ 2 := by apply Finset.sum_congr rfl intro j _ exact (coefficientAtScale_energy N _ _ (fun J hJ => (dyadicColumnCoefficient_shell N lengthScale hNL j a J hJ).2)).symm _ = _ := dyadicColumnCoefficient_energy N lengthScale hNL a end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.DyadicColumns namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve def columnDyadicLength (N : ℝ) : ℕ := ⌈Real.log N / Real.log 2⌉₊ theorem columnDyadicLength_cover (N : ℝ) : N ≤ (2 : ℝ) ^ columnDyadicLength N := by apply Real.pow_le_of_le_log (by norm_num : (0 : ℝ) < 2) have hlog : 0 < Real.log 2 := Real.log_pos (by norm_num) exact (div_le_iff₀ hlog).mp (Nat.le_ceil (Real.log N / Real.log 2)) theorem columnDyadicLength_small_power (ε : ℝ) (hε : 0 < ε) (N : ℝ) (hN : 1 ≤ N) : (columnDyadicLength N + 1 : ℝ) ≤ (2 + 1 / (ε * Real.log 2)) * N ^ ε := by have hlog : 0 < Real.log 2 := Real.log_pos (by norm_num) have hq : 0 ≤ Real.log N / Real.log 2 := div_nonneg (Real.log_nonneg hN) hlog.le have hceil := Nat.ceil_lt_add_one hq have hL : (columnDyadicLength N + 1 : ℝ) ≤ 2 + Real.log N / Real.log 2 := by dsimp only [columnDyadicLength] linarith have hr : 1 ≤ N ^ ε := Real.one_le_rpow hN hε.le have hb : Real.log N / Real.log 2 ≤ (N ^ ε / ε) / Real.log 2 := div_le_div_of_nonneg_right (Real.log_le_rpow_div (by linarith) hε) hlog.le calc _ ≤ 2 + Real.log N / Real.log 2 := hL _ ≤ 2 * N ^ ε + (N ^ ε / ε) / Real.log 2 := add_le_add (by linarith) hb _ = _ := by field_simp open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open EisensteinSchwartzPoisson UnrestrictedIdealReindex QuadraticSquarefreeKernel theorem squarefreePart_norm_le (lengthScale : Ideal O) (hL : lengthScale ≠ 0) : Ideal.absNorm (squarefreePart lengthScale) ≤ Ideal.absNorm lengthScale := by have hd : squarefreePart lengthScale ∣ lengthScale := ⟨squarePart lengthScale ^ 2, (squarePart_sq_mul_squarefreePart lengthScale).symm.trans (mul_comm _ _)⟩ exact Nat.le_of_dvd (Nat.pos_iff_ne_zero.mpr (fun h => hL (Ideal.absNorm_eq_zero_iff.mp h))) (map_dvd Ideal.absNorm hd) def dualSquarefreeTail (I J : Ideal O) (W : ℝ → ℂ) (t K : ℝ) : ℂ := ∑' lengthScale : {lengthScale : Ideal O // lengthScale ≠ 0 ∧ K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ)}, unrestrictedPairCharacter I J lengthScale.val * paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ)) theorem dualSquarefreeTail_bound (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (t K : ℝ), 0 < t → 0 ≤ K → ‖dualSquarefreeTail I J W t K‖ ≤ (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / ((min 1 t) ^ 2 * (1 + t * K) ^ A) := by obtain ⟨s, C, hC, hb⟩ := paperRadialFourier_lattice_tail A refine ⟨s, C, hC, ?_⟩ intro I J W t K ht hK let Q := {lengthScale : Ideal O // lengthScale ≠ 0 ∧ K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ)} have hgen : Function.Injective (fun lengthScale : Q => idealGenerator lengthScale.val) := by intro lengthScale R h apply Subtype.ext simpa only [span_idealGenerator] using congrArg (fun z : O => Ideal.span {z}) h have hlat := paperRadialFourier_lattice_summable_norm W t ht have hQ : Summable (fun lengthScale : Q => ‖paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ))‖) := by have hs := hlat.comp_injective hgen simpa only [Function.comp_def, idealGenerator_norm_sq] using hs have hp (lengthScale : Q) : ‖unrestrictedPairCharacter I J lengthScale.val * paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ))‖ ≤ ‖paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ))‖ := by rw [norm_mul] apply mul_le_of_le_one_left (norm_nonneg _) unfold unrestrictedPairCharacter rw [norm_mul] calc _ ≤ 1 * 1 := mul_le_mul (quadraticRow_norm_le_one I _) (quadraticRow_norm_le_one J _) (norm_nonneg _) (by norm_num) _ = 1 := by ring have hnorm : Summable (fun lengthScale : Q => ‖unrestrictedPairCharacter I J lengthScale.val * paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ))‖) := Summable.of_nonneg_of_le (fun _ => norm_nonneg _) hp hQ let f : Q → {z : O // t * K ≤ t * ‖eisEmbedding z‖ ^ 2} := fun lengthScale => ⟨idealGenerator lengthScale.val, by rw [idealGenerator_norm_sq] apply mul_le_mul_of_nonneg_left _ ht.le exact lengthScale.property.2.le.trans (Nat.cast_le.mpr (squarefreePart_norm_le lengthScale.val lengthScale.property.1))⟩ have hf : Function.Injective f := by intro lengthScale R h apply hgen exact congrArg (fun z : {z : O // t * K ≤ t * ‖eisEmbedding z‖ ^ 2} => z.val) h have hi : (∑' lengthScale : Q, ‖paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ))‖) ≤ ∑' z : {z : O // t * K ≤ t * ‖eisEmbedding z‖ ^ 2}, ‖paperRadialFourier W (t * ‖eisEmbedding z.val‖ ^ 2)‖ := by apply hQ.tsum_le_tsum_of_inj f hf (fun _ _ => norm_nonneg _) _ (hlat.subtype _) intro lengthScale simp only [f, idealGenerator_norm_sq] rfl exact (norm_tsum_le_tsum_norm hnorm).trans ((hnorm.tsum_le_tsum hp hQ).trans (hi.trans (hb W t (t * K) ht (mul_nonneg ht.le hK)))) end CanonicalQuadraticSieve open scoped BigOperators Classical namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal UniqueFactorizationMonoid CompletedGauss open PrimaryIdealUnitReindex (GoodIdeal) def fullIdealWeight (s : ℂ) (I : Ideal O) : ℂ := if I=0 then 0 else (Ideal.absNorm I:ℂ)^(-s) lemma norm_fullIdealWeight (s : ℂ) (I : NonzeroIdeal) : ‖fullIdealWeight s I.1‖=‖eisEmbedding (ConcretePrimeRowBridge.idealGenerator I.1)‖^(-2*s.re) := by rw [fullIdealWeight,if_neg I.2] have hn : 0<‖eisEmbedding (ConcretePrimeRowBridge.idealGenerator I.1)‖ := norm_pos_iff.mpr (eisEmbedding_ne_zero (ConcretePrimeRowBridge.idealGenerator_ne_zero _ I.2)) have hnorm : ‖eisEmbedding (ConcretePrimeRowBridge.idealGenerator I.1)‖^2=(Ideal.absNorm I.1:ℝ) := by rw [eisEmbedding_norm_sq_eq_absNorm_span,ConcretePrimeRowBridge.span_idealGenerator] have hcast : (Ideal.absNorm I.1:ℂ)=((‖eisEmbedding (ConcretePrimeRowBridge.idealGenerator I.1)‖^2:ℝ):ℂ) := by exact_mod_cast hnorm.symm rw [hcast,Complex.norm_cpow_eq_rpow_re_of_pos (sq_pos_of_pos hn),← Real.rpow_natCast_mul hn.le 2] congr 1 simp only [Complex.neg_re,Nat.cast_ofNat] ring theorem fullIdealWeight_summable_norm (s : ℂ) (hs : 1 ‖fullIdealWeight s I‖) := by have hinj : Function.Injective (fun I : NonzeroIdeal => ConcretePrimeRowBridge.idealGenerator I.1) := ConcretePrimeRowBridge.idealGenerator_injective.comp Subtype.val_injective have hlat := (summable_embedding_rpow (-2*s.re) (by linarith)).comp_injective hinj have hsub : Summable (fun I : NonzeroIdeal => ‖fullIdealWeight s I.1‖) := by simpa only [Function.comp_def,norm_fullIdealWeight] using hlat have hind := (summable_subtype_iff_indicator (s := {I : Ideal O | I ≠ 0}) (f := fun I => ‖fullIdealWeight s I‖)).mp hsub apply hind.congr intro I by_cases hI : I=0 · subst I simp [Set.indicator,fullIdealWeight] · have hIbot : I ≠ ⊥ := hI simp [Set.indicator,hIbot,fullIdealWeight] def fullIdealZeta (s : ℂ) : ℂ := ∑' I : Ideal O,fullIdealWeight s I lemma fullIdealWeight_norm_fiber (s : ℂ) (n : ℕ) : (∑' I : {I : Ideal O // Ideal.absNorm I=n},fullIdealWeight s I.1)= LSeries.term (fun n => (Nat.card {I : Ideal O // Ideal.absNorm I=n}:ℂ)) s n := by by_cases hn : n=0 · subst n have hzero (I : {I : Ideal O // Ideal.absNorm I=0}) : fullIdealWeight s I.1=0 := by have hz : I.1=(0:Ideal O) := Ideal.absNorm_eq_zero_iff.mp I.2 rw [fullIdealWeight,if_pos hz] simp only [hzero,tsum_zero,LSeries.term_zero] · let : Fintype {I : Ideal O // Ideal.absNorm I=n} := (Ideal.finite_setOfPred_absNorm_eq (S := O) n).fintype have hterm (I : {I : Ideal O // Ideal.absNorm I=n}) : fullIdealWeight s I.1=(n:ℂ)^(-s) := by have hI : I.1 ≠ 0 := fun h => hn (by rw [← I.2,h,map_zero]) rw [fullIdealWeight,if_neg hI,I.2] simp only [hterm,tsum_fintype,Finset.sum_const,Finset.card_univ,nsmul_eq_mul, LSeries.term_of_ne_zero hn,Nat.card_eq_fintype_card,Complex.cpow_neg,div_eq_mul_inv] theorem fullIdealZeta_eq_dedekindZeta (s : ℂ) (hs : 1 ∑' I : {I : Ideal O // Ideal.absNorm I=n},fullIdealWeight s I.1) (fullIdealZeta s) at h simp_rw [fullIdealWeight_norm_fiber] at h exact h.tsum_eq.symm lemma fullIdealWeight_lambdaFactor (s : ℂ) (n : ℕ) (I : GoodIdeal) : fullIdealWeight s (lambdaFactorMap (n,I)).1=((3:ℂ)^(-s))^n*unramifiedNormWeight s I.1 := by rw [fullIdealWeight,if_neg (lambdaFactorMap (n,I)).2] change (Ideal.absNorm (ramifiedIdeal^n*I.1):ℂ)^(-s)=_ rw [map_mul,map_pow,ramifiedIdeal_absNorm,Nat.cast_mul, unramifiedNormWeight_of_good _ _ I.2] rw [Complex.natCast_mul_natCast_cpow] congr 1 have h := (Complex.natCast_cpow_natCast_mul 3 n (-s)).symm.trans (Complex.cpow_nat_mul 3 n (-s)) simpa only [Nat.cast_pow,Nat.cast_ofNat] using h theorem unramifiedIdealZeta_eq_dedekindZeta (s : ℂ) (hs : 1 fullIdealWeight s I.1) := (fullIdealWeight_summable_norm s hs).of_norm.subtype _ have hp := lambdaFactorEquiv.summable_iff.mpr hsub change Summable (fun p : ℕ × GoodIdeal => fullIdealWeight s (lambdaFactorMap p).1) at hp have hfull : fullIdealZeta s=(1-(3:ℂ)^(-s))⁻¹*unramifiedIdealZeta s := by calc _ = ∑' I : NonzeroIdeal,fullIdealWeight s I.1 := by symm apply tsum_subtype_eq_of_support_subset intro I hI change I ≠ 0 intro hz exact hI (by simp [fullIdealWeight,hz]) _ = ∑' p : ℕ × GoodIdeal,fullIdealWeight s (lambdaFactorMap p).1 := (lambdaFactorEquiv.tsum_eq _).symm _ = ∑' n : ℕ,∑' I : GoodIdeal,((3:ℂ)^(-s))^n*unramifiedNormWeight s I.1 := by rw [hp.tsum_prod] apply tsum_congr; intro n exact tsum_congr (fun I => fullIdealWeight_lambdaFactor s n I) _ = ∑' n : ℕ,((3:ℂ)^(-s))^n*unramifiedIdealZeta s := by apply tsum_congr; intro n rw [tsum_mul_left] apply congrArg (fun z : ℂ => ((3:ℂ)^(-s))^n*z) apply tsum_subtype_eq_of_support_subset (f := unramifiedNormWeight s) (s := {I : Ideal O | primaryGenerator I ≠ 0}) intro I hI change primaryGenerator I ≠ 0 intro hz exact hI (unramifiedNormWeight_of_bad s I hz) _ = _ := by rw [tsum_mul_right,tsum_geometric_of_norm_lt_one hnorm] rw [← fullIdealZeta_eq_dedekindZeta s hs,hfull,← mul_assoc,mul_inv_cancel₀ hne,one_mul] end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss lemma constantDirichletTerm_differentiable (c : LevelLower) : Differentiable ℂ (fun s : ℂ => arithmeticDirichletTerm s 0 c) := by by_cases hc : c.1=0 · simp only [arithmeticDirichletTerm,if_pos hc] exact differentiable_const _ · have hq : ((‖eisEmbedding c.1‖^2:ℝ):ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (pow_ne_zero 2 (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hc))) simp only [arithmeticDirichletTerm,if_neg hc] exact (differentiable_id.neg.const_cpow (Or.inl hq)).mul_const _ lemma constantDirichletTerm_norm_mono (a : ℝ) (s : ℂ) (ha : a ≤ s.re) (c : LevelLower) : ‖arithmeticDirichletTerm s 0 c‖ ≤ ‖arithmeticDirichletTerm (a:ℂ) 0 c‖ := by by_cases hc : c.1=0 · simp only [arithmeticDirichletTerm,if_pos hc,norm_zero,le_refl] · have hpos : 0<‖eisEmbedding c.1‖^2 := sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hc)) have hq : 1≤‖eisEmbedding c.1‖^2 := by rw [eisEmbedding_norm_sq_eq_absNorm_span] exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (Ideal.span_singleton_eq_bot.not.mpr hc)) simp only [arithmeticDirichletTerm,if_neg hc,norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hpos,Complex.neg_re,Complex.ofReal_re] exact mul_le_mul_of_nonneg_right (Real.rpow_le_rpow_of_exponent_le hq (neg_le_neg ha)) (norm_nonneg _) theorem arithmeticDirichletSeries_zero_differentiableAt (s : ℂ) (hs : (4:ℝ)/3 arithmeticDirichletSeries z 0) s := by let a : ℝ := ((4:ℝ)/3+s.re)/2 have ha : (4:ℝ)/3 arithmeticDirichletSeries z 0) {z : ℂ | a (constantDirichletTerm_differentiable c).differentiableOn) hopen intro c z hz exact constantDirichletTerm_norm_mono a z hz.le c exact (hd s has).differentiableAt (hopen.mem_nhds has) lemma unramifiedNormWeight_differentiable (I : Ideal O) : Differentiable ℂ (fun s : ℂ => unramifiedNormWeight s I) := by by_cases hI : primaryGenerator I=0 · simp only [unramifiedNormWeight_of_bad _ I hI] exact differentiable_const _ · have hn : (Ideal.absNorm I:ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (primaryGenerator_ne_zero_ideal I hI)) simp only [unramifiedNormWeight_of_good _ I hI] exact differentiable_id.neg.const_cpow (Or.inl hn) lemma unramifiedNormWeight_norm_mono (a : ℝ) (s : ℂ) (ha : a ≤ s.re) (I : Ideal O) : ‖unramifiedNormWeight s I‖≤‖unramifiedNormWeight (a:ℂ) I‖ := by by_cases hI : primaryGenerator I=0 · simp only [unramifiedNormWeight_of_bad _ I hI,norm_zero,le_refl] · have hn : Ideal.absNorm I ≠ 0 := Ideal.absNorm_eq_zero_iff.not.mpr (primaryGenerator_ne_zero_ideal I hI) have hpos : (0:ℝ) (unramifiedNormWeight_differentiable I).differentiableOn) hopen intro I z hz exact unramifiedNormWeight_norm_mono a z hz.le I exact (hd s has).differentiableAt (hopen.mem_nhds has) end open Filter open scoped BigOperators Classical Topology open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss def unramifiedZetaResidue : ℂ := (2/3:ℂ)*(NumberField.dedekindZeta_residue ActualEisensteinCubic.K:ℂ) lemma unramifiedZetaResidue_ne_zero : unramifiedZetaResidue ≠ 0 := by apply mul_ne_zero (by norm_num) exact Complex.ofReal_ne_zero.mpr (NumberField.dedekindZeta_residue_pos ActualEisensteinCubic.K).ne' theorem unramifiedIdealZeta_oneSidedResidue : Tendsto (fun x : ℝ => ((x:ℂ)-1)*unramifiedIdealZeta (x:ℂ)) (𝓝[>] (1:ℝ)) (𝓝 unramifiedZetaResidue) := by have hcont : Continuous (fun x : ℝ => 1-(3:ℂ)^(-(x:ℂ))) := continuous_const.sub (Complex.continuous_ofReal.neg.const_cpow (Or.inl (by norm_num))) have heuler : Tendsto (fun x : ℝ => 1-(3:ℂ)^(-(x:ℂ))) (𝓝[>] (1:ℝ)) (𝓝 (2/3:ℂ)) := by apply (hcont.tendsto' 1 (2/3:ℂ) ?_).mono_left nhdsWithin_le_nhds norm_num [Complex.cpow_neg] have h := heuler.mul (NumberField.tendsto_sub_one_mul_dedekindZeta_nhdsGT ActualEisensteinCubic.K) change Tendsto (fun x : ℝ => (1-(3:ℂ)^(-(x:ℂ)))* (((x:ℂ)-1)*NumberField.dedekindZeta ActualEisensteinCubic.K (x:ℂ))) (𝓝[>] (1:ℝ)) (𝓝 unramifiedZetaResidue) at h apply h.congr' filter_upwards [self_mem_nhdsWithin] with x hx have hx' : 1<(x:ℂ).re := by simpa only [Set.mem_Ioi,Complex.ofReal_re] using hx rw [unramifiedIdealZeta_eq_dedekindZeta (x:ℂ) hx'] ring lemma cusp_volume_ne_zero : ((9*Real.sqrt 3/2:ℝ):ℂ) ≠ 0 := by apply Complex.ofReal_ne_zero.mpr positivity def constantArithmeticResidue : ℂ := unramifiedZetaResidue / (3*((9*Real.sqrt 3/2:ℝ):ℂ)*unramifiedIdealZeta 2) lemma constantArithmeticResidue_ne_zero : constantArithmeticResidue ≠ 0 := by apply div_ne_zero unramifiedZetaResidue_ne_zero exact mul_ne_zero (mul_ne_zero (by norm_num) cusp_volume_ne_zero) (unramifiedIdealZeta_ne_zero 2 (by norm_num)) lemma tendsto_three_mul_sub_three_four_thirds : Tendsto (fun x : ℝ => 3*x-3) (𝓝[>] ((4:ℝ)/3)) (𝓝[>] (1:ℝ)) := by apply tendsto_nhdsWithin_iff.mpr constructor · apply ((continuous_const.mul continuous_id).sub continuous_const).tendsto' _ _ (by norm_num) |>.mono_left nhdsWithin_le_nhds · filter_upwards [self_mem_nhdsWithin] with x hx simp only [Set.mem_Ioi] at hx ⊢ linarith theorem scatteringCoefficient_zero_oneSidedResidue : Tendsto (fun x : ℝ => ((x:ℂ)-(4/3:ℂ))*scatteringCoefficient (x:ℂ) 0) (𝓝[>] ((4:ℝ)/3)) (𝓝 constantArithmeticResidue) := by have hn0 := unramifiedIdealZeta_oneSidedResidue.comp tendsto_three_mul_sub_three_four_thirds have hn : Tendsto (fun x : ℝ => ((x:ℂ)-(4/3:ℂ))*unramifiedIdealZeta (3*(x:ℂ)-3)) (𝓝[>] ((4:ℝ)/3)) (𝓝 (unramifiedZetaResidue/3)) := by convert hn0.div_const (3:ℂ) using 1 ext x dsimp only [Function.comp_def] push_cast ring have harg : Tendsto (fun x : ℝ => 3*(x:ℂ)-2) (𝓝[>] ((4:ℝ)/3)) (𝓝 (2:ℂ)) := by apply (((Complex.continuous_ofReal.const_mul 3).sub continuous_const).tendsto' _ _ ?_).mono_left nhdsWithin_le_nhds norm_num have hz := (unramifiedIdealZeta_differentiableAt 2 (by norm_num)).continuousAt.tendsto.comp harg have hdncont : Continuous (fun x : ℝ => (3:ℂ)^(3*(x:ℂ)-3)-1) := (((Complex.continuous_ofReal.const_mul 3).sub continuous_const).const_cpow (Or.inl (by norm_num))).sub continuous_const have hdn : Tendsto (fun x : ℝ => (3:ℂ)^(3*(x:ℂ)-3)-1) (𝓝[>] ((4:ℝ)/3)) (𝓝 (2:ℂ)) := by apply (hdncont.tendsto' _ _ ?_).mono_left nhdsWithin_le_nhds norm_num have hp := ((hdn.inv₀ (by norm_num)).const_mul (2/((9*Real.sqrt 3/2:ℝ):ℂ))).mul (hn.div hz (unramifiedIdealZeta_ne_zero 2 (by norm_num))) have hlimit : (2/((9*Real.sqrt 3/2:ℝ):ℂ))*(2:ℂ)⁻¹* ((unramifiedZetaResidue/3)/unramifiedIdealZeta 2)=constantArithmeticResidue := by unfold constantArithmeticResidue ring rw [hlimit] at hp apply hp.congr' filter_upwards [self_mem_nhdsWithin] with x hx have hx' : (4:ℝ)/3<(x:ℂ).re := by simpa only [Set.mem_Ioi,Complex.ofReal_re] using hx rw [scatteringCoefficient_zero_zeta (x:ℂ) hx'] dsimp only [Pi.div_apply,Function.comp_def] ring end CubicEisenstein open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss end open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open EisensteinSchwartzPoisson UnrestrictedIdealReindex QuadraticSquarefreeKernel def dualSquarefreeLow (I J : Ideal O) (W : ℝ → ℂ) (t K : ℝ) : ℂ := ∑' lengthScale : NonzeroIdeal, if (Ideal.absNorm (squarefreePart lengthScale.val) : ℝ) ≤ K then unrestrictedPairCharacter I J lengthScale.val * paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ)) else 0 theorem dual_ideal_low_add_tail (I J : Ideal O) (W : 𝓢(ℝ, ℂ)) (t K : ℝ) (ht : 0 < t) : (∑' lengthScale : NonzeroIdeal, unrestrictedPairCharacter I J lengthScale.val * paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ))) = dualSquarefreeLow I J W t K + dualSquarefreeTail I J W t K := by let F : Ideal O → ℂ := fun lengthScale => unrestrictedPairCharacter I J lengthScale * paperRadialFourier W (t * (Ideal.absNorm lengthScale : ℝ)) have hs : Summable (fun lengthScale : NonzeroIdeal => F lengthScale.val) := canonical_pair_ideal_fourier_summable I J W t ht have hl : Summable (fun lengthScale : NonzeroIdeal => if (Ideal.absNorm (squarefreePart lengthScale.val) : ℝ) ≤ K then F lengthScale.val else 0) := hs.indicator _ have hh : Summable (fun lengthScale : NonzeroIdeal => if K < (Ideal.absNorm (squarefreePart lengthScale.val) : ℝ) then F lengthScale.val else 0) := hs.indicator _ have htail : (∑' lengthScale : NonzeroIdeal, if K < (Ideal.absNorm (squarefreePart lengthScale.val) : ℝ) then F lengthScale.val else 0) = dualSquarefreeTail I J W t K := by have hleft : (∑' lengthScale : NonzeroIdeal, if K < (Ideal.absNorm (squarefreePart lengthScale.val) : ℝ) then F lengthScale.val else 0) = ∑' lengthScale : Ideal O, ({lengthScale : Ideal O | lengthScale ≠ 0} : Set (Ideal O)).indicator (fun lengthScale => if K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ) then F lengthScale else 0) lengthScale := by exact tsum_subtype {lengthScale : Ideal O | lengthScale ≠ 0} (fun lengthScale : Ideal O => if K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ) then F lengthScale else 0) have hright : (∑' lengthScale : {lengthScale : Ideal O // lengthScale ≠ 0 ∧ K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ)}, F lengthScale.val) = ∑' lengthScale : Ideal O, ({lengthScale : Ideal O | lengthScale ≠ 0 ∧ K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ)} : Set (Ideal O)).indicator F lengthScale := tsum_subtype _ _ change _ = ∑' lengthScale : {lengthScale : Ideal O // lengthScale ≠ 0 ∧ K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ)}, F lengthScale.val rw [hleft, hright] apply tsum_congr intro lengthScale by_cases h0 : lengthScale = 0 <;> by_cases hK : K < (Ideal.absNorm (squarefreePart lengthScale) : ℝ) <;> simp [Set.indicator, h0, hK, F] rw [← htail, dualSquarefreeLow, ← hl.tsum_add hh] apply tsum_congr intro lengthScale by_cases hK : (Ideal.absNorm (squarefreePart lengthScale.val) : ℝ) ≤ K · simp only [hK, not_lt_of_ge hK, ite_true, ite_false, add_zero, F] · simp only [hK, lt_of_not_ge hK, ite_true, ite_false, zero_add, F] theorem dualSquarefreeLow_principal (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (W : 𝓢(ℝ, ℂ)) (t K : ℝ) (ht : 0 < t) : dualSquarefreeLow I J W t K = ∑' B : {B : Ideal O // Squarefree B}, if (Ideal.absNorm B.val : ℝ) ≤ K then unrestrictedPairCharacter I J B.val * dualPrincipalIdeal I J (quadraticTransformedSquareProfile W) (Real.sqrt (1 / (t * (Ideal.absNorm B.val : ℝ)))) else 0 := by let G : NonzeroIdeal → ℂ := fun lengthScale => if (Ideal.absNorm (squarefreePart lengthScale.val) : ℝ) ≤ K then unrestrictedPairCharacter I J lengthScale.val * paperRadialFourier W (t * (Ideal.absNorm lengthScale.val : ℝ)) else 0 let F : (NonzeroIdeal × {B : Ideal O // Squarefree B}) → ℂ := fun p => if (Ideal.absNorm p.2.val : ℝ) ≤ K then (idealZeroMask I (idealGenerator p.1.val) * idealZeroMask J (idealGenerator p.1.val)) * unrestrictedPairCharacter I J p.2.val * paperRadialFourier W (t * ((Ideal.absNorm p.1.val : ℝ) ^ 2 * (Ideal.absNorm p.2.val : ℝ))) else 0 have hg : Summable G := (canonical_pair_ideal_fourier_summable I J W t ht).indicator _ have hterm (p : NonzeroIdeal × {B : Ideal O // Squarefree B}) : G (decompositionEquiv.symm p) = F p := by change (if (Ideal.absNorm (squarefreePart (p.1.val ^ 2 * p.2.val)) : ℝ) ≤ K then unrestrictedPairCharacter I J (p.1.val ^ 2 * p.2.val) * paperRadialFourier W (t * (Ideal.absNorm (p.1.val ^ 2 * p.2.val) : ℝ)) else 0) = F p rw [(squarePart_mul_squarefree p.1.property p.2.property).2] by_cases hK : (Ideal.absNorm p.2.val : ℝ) ≤ K · simp only [hK, ite_true, F, unrestrictedPairCharacter_mul I J hI hJ hray, unrestrictedPairCharacter_square I J hI hJ hray, map_mul, map_pow, Nat.cast_mul, Nat.cast_pow] · simp only [hK, ite_false, F] have hf : Summable F := (decompositionEquiv.symm.summable_iff.mpr hg).congr hterm calc _ = ∑' p : NonzeroIdeal × {B : Ideal O // Squarefree B}, G (decompositionEquiv.symm p) := (decompositionEquiv.symm.tsum_eq G).symm _ = ∑' p, F p := tsum_congr hterm _ = ∑' p : ({B : Ideal O // Squarefree B} × NonzeroIdeal), F (p.2, p.1) := (Equiv.prodComm _ _).tsum_eq (fun p => F (p.2, p.1)) _ = ∑' B : {B : Ideal O // Squarefree B}, ∑' A : NonzeroIdeal, F (A, B) := hf.prod_symm.tsum_prod _ = _ := by apply tsum_congr intro B by_cases hK : (Ideal.absNorm B.val : ℝ) ≤ K · rw [if_pos hK, dualPrincipalIdeal, ← tsum_mul_left] apply tsum_congr intro A have hB : 0 < (Ideal.absNorm B.val : ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun h => B.property.ne_zero (Ideal.absNorm_eq_zero_iff.mp h)) have htb : 0 < t * (Ideal.absNorm B.val : ℝ) := mul_pos ht hB have harg : ((Ideal.absNorm A.val : ℝ) / Real.sqrt (1 / (t * (Ideal.absNorm B.val : ℝ)))) ^ 2 = t * ((Ideal.absNorm A.val : ℝ) ^ 2 * (Ideal.absNorm B.val : ℝ)) := by rw [div_pow, Real.sq_sqrt (one_div_pos.mpr htb).le] field_simp simp only [F, if_pos hK, quadraticTransformedSquareProfile_apply, harg] ring · simp only [F, if_neg hK, tsum_zero] end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.TruncatedSecondTransfer namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open EisensteinSchwartzPoisson UnrestrictedIdealReindex TruncatedPrincipalPoisson def squarefreeIdealRange (K : ℝ) : Finset (Ideal O) := (idealsUpTo ⌊K⌋₊).filter Squarefree theorem mem_squarefreeIdealRange {K : ℝ} {I : Ideal O} : I ∈ squarefreeIdealRange K ↔ Squarefree I ∧ (Ideal.absNorm I : ℝ) ≤ K := by rw [squarefreeIdealRange, Finset.mem_filter, mem_idealsUpTo] constructor · rintro ⟨⟨hp, hN⟩, hs⟩ refine ⟨hs, ?_⟩ have hK : 0 ≤ K := by by_contra hn have hz : ⌊K⌋₊ = 0 := Nat.floor_eq_zero.mpr (by linarith) omega exact (Nat.cast_le.mpr hN).trans (Nat.floor_le hK) · rintro ⟨hs, hN⟩ exact ⟨⟨Nat.one_le_iff_ne_zero.mpr (fun h => hs.ne_zero (Ideal.absNorm_eq_zero_iff.mp h)), Nat.le_floor hN⟩, hs⟩ theorem tsum_squarefree_norm_cutoff (K : ℝ) (f : Ideal O → ℂ) : (∑' B : {B : Ideal O // Squarefree B}, if (Ideal.absNorm B.val : ℝ) ≤ K then f B.val else 0) = ∑ B : squarefreeIdealRange K, f B.val := by let e : squarefreeIdealRange K → {B : Ideal O // Squarefree B} := fun B => ⟨B.val, (mem_squarefreeIdealRange.mp B.property).1⟩ have he : Function.Injective e := by intro B C h apply Subtype.ext exact congrArg (fun D : {B : Ideal O // Squarefree B} => D.val) h let F : {B : Ideal O // Squarefree B} → ℂ := fun B => if (Ideal.absNorm B.val : ℝ) ≤ K then f B.val else 0 have hs : Function.support F ⊆ Set.range e := by intro B hB have hN : (Ideal.absNorm B.val : ℝ) ≤ K := by by_contra hn exact hB (if_neg hn) exact ⟨⟨B.val, mem_squarefreeIdealRange.mpr ⟨B.property, hN⟩⟩, Subtype.ext rfl⟩ have ht := he.tsum_eq hs change (∑' B, F B) = _ rw [← ht, tsum_fintype] apply Finset.sum_congr rfl intro B _ exact if_pos (mem_squarefreeIdealRange.mp B.property).2 theorem dualSquarefreeLow_principal_finite (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (W : 𝓢(ℝ, ℂ)) (t K : ℝ) (ht : 0 < t) : dualSquarefreeLow I J W t K = ∑ B : squarefreeIdealRange K, unrestrictedPairCharacter I J B.val * dualPrincipalIdeal I J (quadraticTransformedSquareProfile W) (Real.sqrt (1 / (t * (Ideal.absNorm B.val : ℝ)))) := by rw [dualSquarefreeLow_principal I J hI hJ hray W t K ht] exact tsum_squarefree_norm_cutoff K (fun B => unrestrictedPairCharacter I J B * dualPrincipalIdeal I J (quadraticTransformedSquareProfile W) (Real.sqrt (1 / (t * (Ideal.absNorm B : ℝ))))) end CanonicalQuadraticSieve namespace SecondPassArithmetic section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) def secondDiagonalMass (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) : ℝ := ∑ G ∈ F.powerset, ‖secondInputCoefficient p hg Ψ m c d H G‖ ^ 2 * ∏ i ∈ G, (1 - (1 : ℝ) / Ideal.absNorm (Ideal.span {p i})) include hinj in theorem truncatedSecondZero_eq_density (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (K : Finset ι → Finset ι → Finset O) (hzero : ∀ G ∈ F.powerset, ∀ E ∈ G.powerset, (0 : O) ∈ K G E) : truncatedSecondZero p hg F Ψ m c d H W Y K = (Y : ℂ) * paperRadialFourier W 0 * (secondDiagonalMass p hg F Ψ m c d H : ℂ) := by have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance unfold truncatedSecondZero secondDiagonalMass congr 1 simp only [Complex.ofReal_sum, Complex.ofReal_mul, Complex.ofReal_prod, Complex.ofReal_sub, Complex.ofReal_one, Complex.ofReal_div, Complex.ofReal_natCast] apply Finset.sum_congr rfl intro G hG have hd : (∑ E : G.powerset, if (0 : O) ∈ K G E.val then (UniqueFactorizationMonoid.moebius (∏ i ∈ E.val, Ideal.span {p i}) : ℂ) / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val)‖ ^ 2 : ℝ) else 0) = ∏ i ∈ G, (1 - (1 : ℂ) / Ideal.absNorm (Ideal.span {p i})) := by have hi (E : G.powerset) := hzero G hG E.val E.property simp only [hi, ite_true, primeSubsetGenerator_norm_sq, Complex.ofReal_natCast] rw [Finset.sum_coe_sort (s := G.powerset) (f := fun E : Finset ι => (UniqueFactorizationMonoid.moebius (∏ i ∈ E, Ideal.span {p i}) : ℂ) / (Ideal.absNorm (∏ i ∈ E, Ideal.span {p i}) : ℂ))] exact primeSubset_moebius_norm_sum _ hprime hinj G rw [hd] have hi : secondInputCoefficient p hg Ψ m c d H G = secondInputCoefficient p hg Ψ m c d (fun _ => 1) G * H G := by simp only [secondInputCoefficient, mul_one] have hh : star (H G) * H G = (‖H G‖ ^ 2 : ℝ) := by rw [mul_comm, Complex.star_def, Complex.mul_conj, Complex.normSq_eq_norm_sq] rw [hi, norm_mul, mul_pow, Complex.ofReal_mul] rw [mul_assoc (↑(‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) G‖ ^ 2)) (star (H G)), hh] omit [DecidableEq ι] in theorem secondDiagonalMass_nonneg_le (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) : 0 ≤ secondDiagonalMass p hg F Ψ m c d H ∧ secondDiagonalMass p hg F Ψ m c d H ≤ ∑ G ∈ F.powerset, ‖secondInputCoefficient p hg Ψ m c d H G‖ ^ 2 := by constructor · exact Finset.sum_nonneg (fun G hG => mul_nonneg (sq_nonneg _) (primeDensity_nonneg_le_one (fun i => Ideal.span {p i}) G).1) · apply Finset.sum_le_sum intro G hG exact mul_le_of_le_one_right (sq_nonneg _) (primeDensity_nonneg_le_one (fun i => Ideal.span {p i}) G).2 include hinj in theorem truncatedSecondZero_norm_le (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (K : Finset ι → Finset ι → Finset O) (hzero : ∀ G ∈ F.powerset, ∀ E ∈ G.powerset, (0 : O) ∈ K G E) : ‖truncatedSecondZero p hg F Ψ m c d H W Y K‖ ≤ |Y| * ‖paperRadialFourier W 0‖ * ∑ G ∈ F.powerset, ‖secondInputCoefficient p hg Ψ m c d H G‖ ^ 2 := by rw [truncatedSecondZero_eq_density p hg hinj F Ψ m c d H W Y K hzero] rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, Complex.norm_of_nonneg (secondDiagonalMass_nonneg_le p hg F Ψ m c d H).1] exact mul_le_mul_of_nonneg_left (secondDiagonalMass_nonneg_le p hg F Ψ m c d H).2 (mul_nonneg (abs_nonneg _) (norm_nonneg _)) end section open ActualEisensteinCubic variable {ι κ : Type*} [DecidableEq ι] [DecidableEq κ] [Fintype κ] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) end section open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff FourierTransform open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open FirstPassCubeLabels (columnLog normalizedColumn jLabel b0Label firstLogDensity) open JointLogSeparation (tripleCoefficient) open SecondPassIntegration (childGeometricMean) end open scoped BigOperators Classical SchwartzMap FourierTransform open MeasureTheory open ActualEisensteinCubic open FirstPassCubeLabels (firstLogDensity) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem postCommonSmoothPair_twisted_fixed_tests (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), ∀ θ₁ θ₂ : ℝ, (∀ t₁ t₂ t₃ : ℝ, (1+R)^A * ‖(𝓕 (JointLogSeparation.frequencyTwist A₁ θ₁)) t₁ * (𝓕 (JointLogSeparation.frequencyTwist A₂ θ₂)) t₂ * b t₃‖ ≤ C * (1+‖θ₁‖)^(J+2) * (1+‖θ₂‖)^(J+2) * firstLogDensity J t₁ * firstLogDensity J t₂ * firstLogDensity J t₃) ∧ ∀ (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m f y₁ y₂ : O) (z ud ue uv kap X₁ X₂ : ℝ), postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V z ud ue uv kap X₁ X₂ R = separatedPostCommon p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) b V z ud ue uv kap X₁ X₂ := by obtain ⟨C, hC, hsep⟩ := JointLogSeparation.seven_kernel_twisted_profiles A₁ A₂ W V M hM hV A J refine ⟨C, hC, ?_⟩ intro R hR obtain ⟨b, hb⟩ := hsep R hR refine ⟨b, ?_⟩ intro θ₁ θ₂ obtain ⟨hid, hpoint, hint⟩ := hb θ₁ θ₂ refine ⟨hpoint, ?_⟩ intro F Ψ₁ Ψ₂ m f y₁ y₂ z ud ue uv kap X₁ X₂ exact postCommonSmoothPair_fixed_tests p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V z ud ue uv kap X₁ X₂ R b (hid z ud ue uv kap) end SecondPassArithmetic namespace SecondPassIntegration section open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation open SecondPassFiber (OldTuple newLabel newRow Valid) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem tupleSource_twisted_uniform_transfer (ε : ℝ) (hε : 0 < ε) (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ Cₐ : ℝ, 0 < Cₐ ∧ ∃ Cₛ : ℝ, 0 ≤ Cₛ ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), ∀ θ₁ θ₂ : ℝ, (∀ t₁ t₂ t₃ : ℝ, (1 + R)^A * ‖(𝓕 (JointLogSeparation.frequencyTwist A₁ θ₁)) t₁ * (𝓕 (JointLogSeparation.frequencyTwist A₂ θ₂)) t₂ * b t₃‖ ≤ Cₛ * (1+‖θ₁‖)^(J+2) * (1+‖θ₂‖)^(J+2) * FirstPassCubeLabels.firstLogDensity J t₁ * FirstPassCubeLabels.firstLogDensity J t₂ * FirstPassCubeLabels.firstLogDensity J t₃) ∧ ∀ (s : Finset OldTuple) (T : Finset (Ideal O × O)) (b0 : Ideal O) (w : OldTuple → ℂ) (B lengthScale : ℝ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (z ud ue uv kap : OldTuple → ℝ) (X₁ X₂ : ℝ), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ T) → (∀ z ∈ T, z.1 ≠ ⊥) → (∀ z ∈ T, (Ideal.absNorm z.1 : ℝ) ≤ lengthScale) → (∀ x ∈ s, ‖w x‖ * ‖outerWindow V (z x) (ud x) (ue x) (uv x) (kap x)‖ ≤ B) → (∀ x ∈ s, Ideal.span {label x} = newLabel x) → ‖tupleSourceSum p hp hcop hg s w label F Ψ₁ Ψ₂ m (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V z ud ue uv kap X₁ X₂ R‖ ≤ (B * Cₐ * (lengthScale * Ideal.absNorm b0)^ε) * (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, ‖tripleCoefficient (𝓕 (JointLogSeparation.frequencyTwist A₁ θ₁)) (𝓕 (JointLogSeparation.frequencyTwist A₂ θ₂)) b (t₁,t₂,t₃)‖ * childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T (V 5) (V 6) X₁ X₂ (t₁,t₂,t₃)) := by obtain ⟨Cₐ, hCₐ, htrans⟩ := integrated_fixed_second_mode_transfer p hp hcop hg ε hε obtain ⟨Cₛ, hCₛ, hsep⟩ := postCommonSmoothPair_twisted_fixed_tests p hp hcop hg A₁ A₂ W V M hM hV A J refine ⟨Cₐ, hCₐ, Cₛ, hCₛ, ?_⟩ intro R hR obtain ⟨b, hb⟩ := hsep R hR refine ⟨b, ?_⟩ intro θ₁ θ₂ obtain ⟨hpoint, hid⟩ := hb θ₁ θ₂ refine ⟨hpoint, ?_⟩ intro s T b0 w B lengthScale label F Ψ₁ Ψ₂ m z ud ue uv kap X₁ X₂ hb0 hB hL hv hm ht hn hw hl have hsource := tupleSource_eq_integratedSecondMode p hp hcop hg s w label F Ψ₁ Ψ₂ m (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W b V z ud ue uv kap X₁ X₂ R (fun x hx => hid F Ψ₁ Ψ₂ m (label x) (newRow x) (-newRow x) (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂) rw [hsource] apply htrans s T b0 (tupleOuterWeight V w z ud ue uv kap) B lengthScale label F Ψ₁ Ψ₂ m (V 5) (V 6) X₁ X₂ (𝓕 (JointLogSeparation.frequencyTwist A₁ θ₁)) (𝓕 (JointLogSeparation.frequencyTwist A₂ θ₂)) b hb0 hB hL hv hm ht hn · intro q x hx rw [tupleOuterWeight_norm] exact hw x hx · intro x hx exact tupleOuterWeight_continuous V w z ud ue uv kap x · exact hl end open ActualEisensteinCubic JointLogSeparation FirstPassCubeLabels SecondPassArithmetic theorem exists_fixed_twisted_normalized_child_tests {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (g₁ g₂ W : 𝓢(ℝ, ℂ)) (A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hg₁ : ∀ s, g₁ s ≠ 0 → |s| ≤ A) (hg₂ : ∀ s, g₂ s ≠ 0 → |s| ≤ A) : ∃ (A₁ A₂ : 𝓢(ℝ, ℂ)) (windows : Fin 7 → ℝ → ℂ), (∀ j, HasCompactSupport (windows j)) ∧ (∀ j, ContDiff ℝ ∞ (windows j)) ∧ (∀ j s, windows j s ≠ 0 → |s| ≤ A+B+1) ∧ ∀ (θ₁ θ₂ D E V₀ X X₀ K Y : ℝ), 0 < D → 0 < E → 0 < V₀ → 0 < X → 0 < X₀ → 0 < K → ∀ (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O), d ≠ 0 → e ≠ 0 → k ≠ 0 → |Real.log (primeProductNorm p V * X₀ / X)| ≤ B → |Real.log (elementNorm d / D)| ≤ B → |Real.log (elementNorm e / E)| ≤ B → |Real.log (primeProductNorm p V / V₀)| ≤ B → |Real.log (elementNorm (d*e*k) / K)| ≤ B → secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k (-k) (radialPairKernel p e k W (frequencyTwist g₁ θ₁) (frequencyTwist g₂ θ₂) X X Y) = (X : ℂ)⁻¹ * postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k) (d*e*(-k)) (frequencyTwist A₁ (-θ₁)) (frequencyTwist A₂ θ₂) W windows (Real.log (primeProductNorm p V * X₀ / X)) (Real.log (elementNorm d / D)) (Real.log (elementNorm e / E)) (Real.log (primeProductNorm p V / V₀)) (Real.log (elementNorm (d*e*k) / K)) X₀ X₀ (Y*K/(D*E^2*V₀^2*X₀^2)) := by obtain ⟨U, hUc, hUs, hUone, hUsupp, hUzero⟩ := FourierBridge.exists_complex_smooth_cutoff A hA have hU₁ : ∀ s, g₁ s ≠ 0 → U s = 1 := fun s hs => hUone s (hg₁ s hs) have hU₂ : ∀ s, g₂ s ≠ 0 → U s = 1 := fun s hs => hUone s (hg₂ s hs) let A₁ := conjugateProfile (halfNormalizationCLM U g₁) let A₂ := halfNormalizationCLM U g₂ have hA₁ : ∀ s, A₁ s ≠ 0 → |s| ≤ A := by intro s hs apply halfNormalization_support_bound U hUc hUs g₁ A hg₁ s intro hz exact hs (by simp [A₁, conjugateProfile_apply, hz]) have hA₂ : ∀ s, A₂ s ≠ 0 → |s| ≤ A := halfNormalization_support_bound U hUc hUs g₂ A hg₂ obtain ⟨windows, hwc, hws, hwb, hwo, hwt⟩ := exists_fixed_sector_windows A B hA hB refine ⟨A₁, A₂, windows, hwc, hws, hwb, ?_⟩ intro θ₁ θ₂ D E V₀ X X₀ K Y hD hE hV₀ hX hX₀ hK F V Ψ₁ Ψ₂ m r c d e k hd he hk hz hud hue huv hkap have htw₁ : ∀ s, frequencyTwist g₁ θ₁ s ≠ 0 → U s = 1 := by intro s hs apply hU₁ s intro hz exact hs (by simp [frequencyTwist_apply, hz]) have htw₂ : ∀ s, frequencyTwist g₂ θ₂ s ≠ 0 → U s = 1 := by intro s hs apply hU₂ s intro hz exact hs (by simp [frequencyTwist_apply, hz]) have hsupp₁ : ∀ s, frequencyTwist A₁ (-θ₁) s ≠ 0 → |s| ≤ A := by intro s hs apply hA₁ s intro hz exact hs (by simp [frequencyTwist_apply, hz]) have hsupp₂ : ∀ s, frequencyTwist A₂ θ₂ s ≠ 0 → |s| ≤ A := by intro s hs apply hA₂ s intro hz exact hs (by simp [frequencyTwist_apply, hz]) have hh := secondChildKernelPair_eq_postCommon p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k hd he hk D E V₀ X X₀ K Y hD hE hV₀ hX hX₀ hK U hUc hUs (frequencyTwist g₁ θ₁) (frequencyTwist g₂ θ₂) W htw₁ htw₂ windows dsimp only at hh rw [normalized_conjugate_frequencyTwist U hUc hUs, halfNormalization_twist U hUc hUs] at hh exact hh (hwo _ _ _ _ _ hz hud hue huv hkap) (fun a ha => hwt (frequencyTwist A₁ (-θ₁)) _ hsupp₁ hz 5 a ha) (fun a ha => hwt (frequencyTwist A₂ θ₂) _ hsupp₂ hz 6 a ha) end SecondPassIntegration open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform namespace SecondPassArithmetic open ActualEisensteinCubic open SecondPassIntegration (tupleSourceSum tupleSource_twisted_uniform_transfer childGeometricMean) open JointLogSeparation open FirstPassCubeLabels (b0Label) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Fourier.LogDensity namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators section open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform namespace JointLogSeparation open FirstPassCubeLabels def tripleLogDensity (J : ℕ) (t : Frequency) : ℝ := firstLogDensity J t.1 * (firstLogDensity J t.2.1 * firstLogDensity J t.2.2) lemma tripleLogDensity_integrable (J : ℕ) : Integrable (tripleLogDensity J) := (firstLogDensity_integrable J).mul_prod ((firstLogDensity_integrable J).mul_prod (firstLogDensity_integrable J)) lemma tripleLogDensity_nonneg (J : ℕ) (t : Frequency) : 0 ≤ tripleLogDensity J t := mul_nonneg (firstLogDensity_nonneg _ _) (mul_nonneg (firstLogDensity_nonneg _ _) (firstLogDensity_nonneg _ _)) lemma tripleLogDensity_bounded_integrable (J : ℕ) (G : Frequency → ℝ) (hG : Continuous G) (M : ℝ) (hM : ∀ t, ‖G t‖ ≤ M) : Integrable (fun t => tripleLogDensity J t * G t) := (tripleLogDensity_integrable J).mul_bdd hG.aestronglyMeasurable (Filter.Eventually.of_forall hM) lemma tripleLogDensity_slice_integrable (J : ℕ) (G : Frequency → ℝ) (hG : Continuous G) (M : ℝ) (hM : ∀ t, ‖G t‖ ≤ M) (x : ℝ) : Integrable (fun yz : ℝ × ℝ => tripleLogDensity J (x,yz) * G (x,yz)) := by have hc : Integrable (fun yz : ℝ × ℝ => firstLogDensity J x * (firstLogDensity J yz.1 * firstLogDensity J yz.2)) := ((firstLogDensity_integrable J).mul_prod (firstLogDensity_integrable J)).const_mul _ apply hc.mul_bdd · exact (hG.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun t => hM (x,t)) end JointLogSeparation namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation def densityChildEnergy {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ : ℝ) (J : ℕ) : ℝ := ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, tripleLogDensity J (t₁,t₂,t₃) * childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ (t₁,t₂,t₃) theorem child_coefficient_density_bound {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ : ℝ) (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)) (J : ℕ) (S C : ℝ) (hpoint : ∀ t₁ t₂ t₃ : ℝ, S * ‖b₁ t₁*b₂ t₂*b₃ t₃‖ ≤ C * FirstPassCubeLabels.firstLogDensity J t₁ * FirstPassCubeLabels.firstLogDensity J t₂ * FirstPassCubeLabels.firstLogDensity J t₃) : S * (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, ‖tripleCoefficient b₁ b₂ b₃ (t₁,t₂,t₃)‖ * childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ (t₁,t₂,t₃)) ≤ C * densityChildEnergy p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ J := by let G := childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ have hc₁ := childEnergy_continuous p hp hcop hg F Ψ₁ m T V₁ X₁ true false (fun q : Frequency => q.1) (fun q : Frequency => q.2.2) continuous_fst continuous_snd.snd have hc₂ := childEnergy_continuous p hp hcop hg F Ψ₂ m T V₂ X₂ false true (fun q : Frequency => q.2.1) (fun q : Frequency => q.2.2) continuous_snd.fst continuous_snd.snd have hG : Continuous G := (Real.continuous_sqrt.comp hc₁).mul (Real.continuous_sqrt.comp hc₂) have hG0 : ∀ q, 0 ≤ G q := fun q => mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) let M := Real.sqrt (energyMagnitude p hp hcop hg F Ψ₁ m T V₁ X₁ true false) * Real.sqrt (energyMagnitude p hp hcop hg F Ψ₂ m T V₂ X₂ false true) have hM : ∀ q, G q ≤ M := by intro q dsimp [G, childGeometricMean, M] gcongr · exact childEnergy_le p hp hcop hg F Ψ₁ m T V₁ X₁ true false q.1 q.2.2 · exact childEnergy_le p hp hcop hg F Ψ₂ m T V₂ X₂ false true q.2.1 q.2.2 exact (by unfold densityChildEnergy have hGb : ∀ t, ‖G t‖ ≤ M := fun t => by simpa only [Real.norm_of_nonneg (hG0 t)] using hM t have hc := tripleCoefficient_norm_bounded_integrable b₁ b₂ b₃ G hG M hGb have hd := tripleLogDensity_bounded_integrable J G hG M hGb rw [nested_eq_integral _ hc (tripleCoefficient_norm_slice_integrable b₁ b₂ b₃ G hG M hGb), nested_eq_integral _ hd (tripleLogDensity_slice_integrable J G hG M hGb), ← integral_const_mul, ← integral_const_mul] apply integral_mono (hc.const_mul S) (hd.const_mul C) intro t have hh := mul_le_mul_of_nonneg_right (hpoint t.1 t.2.1 t.2.2) (hG0 t) simpa only [tripleCoefficient, tripleLogDensity, mul_assoc] using hh ) end SecondPassIntegration namespace JointLogSeparation open FirstPassCubeLabels lemma one_add_norm_sub_le (x y : ℝ) : 1 + ‖x-y‖ ≤ (1+‖x‖)*(1+‖y‖) := by have hn := norm_sub_le x y have hprod := mul_nonneg (norm_nonneg x) (norm_nonneg y) nlinarith theorem difference_height_weight_le (x y z : ℝ) (J : ℕ) : (1+‖x-z‖)^J * (1+‖y-z‖)^J ≤ (1+‖x‖)^(2*J) * (1+‖y‖)^(2*J) * (1+‖z‖)^(2*J) := by have hx := pow_le_pow_left₀ (by positivity : 0 ≤ 1+‖x-z‖) (one_add_norm_sub_le x z) J have hy := pow_le_pow_left₀ (by positivity : 0 ≤ 1+‖y-z‖) (one_add_norm_sub_le y z) J calc _ ≤ ((1+‖x‖)*(1+‖z‖))^J * ((1+‖y‖)*(1+‖z‖))^J := mul_le_mul hx hy (by positivity) (by positivity) _ = (1+‖x‖)^J * (1+‖y‖)^J * (1+‖z‖)^(2*J) := by rw [mul_pow, mul_pow, two_mul, pow_add] ring _ ≤ _ := by apply mul_le_mul_of_nonneg_right _ (by positivity) exact mul_le_mul (pow_le_pow_right₀ (by linarith [norm_nonneg x] : 1 ≤ 1+‖x‖) (by omega : J ≤ 2*J)) (pow_le_pow_right₀ (by linarith [norm_nonneg y] : 1 ≤ 1+‖y‖) (by omega : J ≤ 2*J)) (by positivity) (by positivity) theorem triple_density_polynomial_bound (G : Frequency → ℝ) (hG : Continuous G) (hG0 : ∀ t, 0 ≤ G t) (M : ℝ) (hM : ∀ t, G t ≤ M) (J : ℕ) (D : ℝ) (hbound : ∀ t, G t ≤ D * (1+‖t.1‖)^J * (1+‖t.2.1‖)^J * (1+‖t.2.2‖)^J) : (∫ x : ℝ, ∫ y : ℝ, ∫ z : ℝ, tripleLogDensity J (x,y,z) * G (x,y,z)) ≤ D * (∫ t : ℝ, firstLogDensity 0 t)^3 := by have hGb : ∀ t, ‖G t‖ ≤ M := fun t => by simpa only [Real.norm_of_nonneg (hG0 t)] using hM t have hi := tripleLogDensity_bounded_integrable J G hG M hGb rw [nested_eq_integral _ hi (tripleLogDensity_slice_integrable J G hG M hGb)] have hh : ∀ t : Frequency, tripleLogDensity J t * G t ≤ D * tripleLogDensity 0 t := by intro t calc _ ≤ tripleLogDensity J t * (D * (1+‖t.1‖)^J * (1+‖t.2.1‖)^J * (1+‖t.2.2‖)^J) := mul_le_mul_of_nonneg_left (hbound t) (tripleLogDensity_nonneg J t) _ = _ := by dsimp only [tripleLogDensity] rw [← density_weight_identity J t.1, ← density_weight_identity J t.2.1, ← density_weight_identity J t.2.2] ring calc _ ≤ ∫ t : Frequency, D * tripleLogDensity 0 t := integral_mono hi ((tripleLogDensity_integrable 0).const_mul D) hh _ = D * (∫ t : Frequency, tripleLogDensity 0 t) := integral_const_mul _ _ _ = _ := by have hslice (x : ℝ) : Integrable (fun yz : ℝ × ℝ => tripleLogDensity 0 (x,yz)) := by simpa only [tripleLogDensity, Measure.volume_eq_prod] using ((firstLogDensity_integrable 0).mul_prod (firstLogDensity_integrable 0)).const_mul (firstLogDensity 0 x) rw [← nested_eq_integral _ (tripleLogDensity_integrable 0) hslice] simp only [tripleLogDensity, integral_const_mul, integral_mul_const] ring end JointLogSeparation end open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ActualEisensteinCubic CompletedGauss IdealMobiusDivisorSum theorem ideals_coprime_of_relprime (A B : Ideal O) (h : IsRelPrime A B) : IsCoprime A B := by apply Ideal.isCoprime_iff_gcd.mpr simpa only [Ideal.one_eq_top] using Ideal.isUnit_iff.mp (h (GCDMonoid.gcd_dvd_left A B) (GCDMonoid.gcd_dvd_right A B)) theorem squarefree_quotient_gcd_coprime (B G : Ideal O) (hB : Squarefree B) : IsCoprime (idealQuotient (gcd B G) B) G := by let D := gcd B G have hDB : D ∣ B := GCDMonoid.gcd_dvd_left B G have hDG : D ∣ G := GCDMonoid.gcd_dvd_right B G have hD : D ≠ 0 := ne_zero_of_dvd_ne_zero hB.ne_zero hDB have hc : IsCoprime (idealQuotient D B) (idealQuotient D G) := (gcd_eq_iff_quotient_coprime D B G hD hDB hDG).mp rfl have hmul : Squarefree (D * idealQuotient D B) := by rw [idealQuotient_mul hDB]; exact hB have hdq : IsCoprime D (idealQuotient D B) := ideals_coprime_of_relprime _ _ (squarefree_mul_iff.mp hmul).1 have hh := hdq.symm.mul_right hc rw [idealQuotient_mul hDG] at hh exact hh theorem gcd_mul_of_coprime_divisor (D H G : Ideal O) (hDG : D ∣ G) (hHG : IsCoprime H G) : gcd (D * H) G = D := by have hleft : D ∣ gcd (D * H) G := GCDMonoid.dvd_gcd (dvd_mul_right D H) hDG have hcop : IsCoprime (gcd (D * H) G) H := (hHG.mono (dvd_refl H) (GCDMonoid.gcd_dvd_right (D * H) G)).symm have hright : gcd (D * H) G ∣ D := hcop.dvd_of_dvd_mul_right (GCDMonoid.gcd_dvd_left _ _) exact associated_iff_eq.mp (associated_of_dvd_dvd hright hleft) def squarefreeGcdEquiv (G : Ideal O) (hG : Squarefree G) : {B : Ideal O // Squarefree B} ≃ (idealDivisors G) × {H : Ideal O // Squarefree H ∧ IsCoprime H G} where toFun B := (⟨gcd B.val G, (mem_idealDivisors hG.ne_zero).mpr (GCDMonoid.gcd_dvd_right _ _)⟩, ⟨idealQuotient (gcd B.val G) B.val, B.property.squarefree_of_dvd (idealQuotient_dvd (GCDMonoid.gcd_dvd_left _ _)), squarefree_quotient_gcd_coprime B.val G B.property⟩) invFun p := ⟨p.1.val * p.2.val, squarefree_mul_iff.mpr ⟨(p.2.property.2.mono (dvd_refl _) ((mem_idealDivisors hG.ne_zero).mp p.1.property)).symm.isRelPrime, hG.squarefree_of_dvd ((mem_idealDivisors hG.ne_zero).mp p.1.property), p.2.property.1⟩⟩ left_inv B := Subtype.ext (idealQuotient_mul (GCDMonoid.gcd_dvd_left B.val G)) right_inv p := by apply Prod.ext · apply Subtype.ext exact gcd_mul_of_coprime_divisor p.1.val p.2.val G ((mem_idealDivisors hG.ne_zero).mp p.1.property) p.2.property.2 · apply Subtype.ext change idealQuotient (gcd (p.1.val * p.2.val) G) (p.1.val * p.2.val) = p.2.val rw [gcd_mul_of_coprime_divisor p.1.val p.2.val G ((mem_idealDivisors hG.ne_zero).mp p.1.property) p.2.property.2] have hD : p.1.val ≠ 0 := ne_zero_of_dvd_ne_zero hG.ne_zero ((mem_idealDivisors hG.ne_zero).mp p.1.property) exact mul_left_cancel₀ hD (idealQuotient_mul (dvd_mul_right p.1.val p.2.val)) def coprimeSquarefreeRange (G : Ideal O) (K : ℝ) : Finset (Ideal O) := (squarefreeIdealRange K).filter (fun H => IsCoprime H G) theorem squarefree_cutoff_summable (K : ℝ) (f : Ideal O → ℂ) : Summable (fun B : {B : Ideal O // Squarefree B} => if (Ideal.absNorm B.val : ℝ) ≤ K then f B.val else 0) := by let e : squarefreeIdealRange K → {B : Ideal O // Squarefree B} := fun B => ⟨B.val, (mem_squarefreeIdealRange.mp B.property).1⟩ apply summable_of_hasFiniteSupport apply (Set.finite_range e).subset intro B hB have hN : (Ideal.absNorm B.val : ℝ) ≤ K := by by_contra hn exact hB (if_neg hn) exact ⟨⟨B.val, mem_squarefreeIdealRange.mpr ⟨B.property, hN⟩⟩, Subtype.ext rfl⟩ theorem norm_le_mul_of_ne_zero (D H : Ideal O) (hD : D ≠ 0) : Ideal.absNorm H ≤ Ideal.absNorm (D * H) := by have hD1 : 1 ≤ Ideal.absNorm D := Nat.one_le_iff_ne_zero.mpr (fun h => hD (Ideal.absNorm_eq_zero_iff.mp h)) simpa only [one_mul, map_mul] using Nat.mul_le_mul_right (Ideal.absNorm H) hD1 theorem coprime_squarefree_cutoff (G D : Ideal O) (hD : D ≠ 0) (K : ℝ) (f : Ideal O → ℂ) : (∑' H : {H : Ideal O // Squarefree H ∧ IsCoprime H G}, if (Ideal.absNorm (D * H.val) : ℝ) ≤ K then f (D * H.val) else 0) = ∑ H : coprimeSquarefreeRange G K, if (Ideal.absNorm (D * H.val) : ℝ) ≤ K then f (D * H.val) else 0 := by let e : coprimeSquarefreeRange G K → {H : Ideal O // Squarefree H ∧ IsCoprime H G} := fun H => ⟨H.val, (mem_squarefreeIdealRange.mp (Finset.mem_filter.mp H.property).1).1, (Finset.mem_filter.mp H.property).2⟩ have he : Function.Injective e := by intro H J h apply Subtype.ext exact congrArg (fun C : {H : Ideal O // Squarefree H ∧ IsCoprime H G} => C.val) h let F : {H : Ideal O // Squarefree H ∧ IsCoprime H G} → ℂ := fun H => if (Ideal.absNorm (D * H.val) : ℝ) ≤ K then f (D * H.val) else 0 have hs : Function.support F ⊆ Set.range e := by intro H hH have hN : (Ideal.absNorm (D * H.val) : ℝ) ≤ K := by by_contra hn exact hH (if_neg hn) have hHN : (Ideal.absNorm H.val : ℝ) ≤ K := (Nat.cast_le.mpr (norm_le_mul_of_ne_zero D H.val hD)).trans hN exact ⟨⟨H.val, Finset.mem_filter.mpr ⟨mem_squarefreeIdealRange.mpr ⟨H.property.1, hHN⟩, H.property.2⟩⟩, Subtype.ext rfl⟩ simpa only [tsum_fintype, F, e] using (he.tsum_eq hs).symm theorem squarefree_gcd_finite_sum (G : Ideal O) (hG : Squarefree G) (K : ℝ) (f : Ideal O → ℂ) : (∑ B : squarefreeIdealRange K, f B.val) = ∑ D : idealDivisors G, ∑ H : coprimeSquarefreeRange G K, if (Ideal.absNorm (D.val * H.val) : ℝ) ≤ K then f (D.val * H.val) else 0 := by let F : {B : Ideal O // Squarefree B} → ℂ := fun B => if (Ideal.absNorm B.val : ℝ) ≤ K then f B.val else 0 have hs := (squarefreeGcdEquiv G hG).symm.summable_iff.mpr (squarefree_cutoff_summable K f) have he := ((squarefreeGcdEquiv G hG).symm.tsum_eq F).symm calc _ = ∑' B : {B : Ideal O // Squarefree B}, F B := (tsum_squarefree_norm_cutoff K f).symm _ = ∑' p : (idealDivisors G) × {H : Ideal O // Squarefree H ∧ IsCoprime H G}, F ((squarefreeGcdEquiv G hG).symm p) := he _ = ∑' D : idealDivisors G, ∑' H : {H : Ideal O // Squarefree H ∧ IsCoprime H G}, F ((squarefreeGcdEquiv G hG).symm (D, H)) := hs.tsum_prod _ = _ := by rw [tsum_fintype] apply Finset.sum_congr rfl intro D _ change (∑' H : {H : Ideal O // Squarefree H ∧ IsCoprime H G}, if (Ideal.absNorm (D.val * H.val) : ℝ) ≤ K then f (D.val * H.val) else 0) = _ exact coprime_squarefree_cutoff G D.val (ne_zero_of_dvd_ne_zero hG.ne_zero ((mem_idealDivisors hG.ne_zero).mp D.property)) K f end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open IdealMobiusDivisorSum theorem canonical_quadraticRow_one (I : Ideal O) (hI : Admissible I) : quadraticRow I 1 = 1 := by rw [quadraticRow, dif_pos hI] simp [idealSexticRow, finiteSquarefreeRow] theorem unrestrictedPairCharacter_one (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) : unrestrictedPairCharacter I J 1 = 1 := by have h := unrestrictedPairCharacter_span I J hI hJ hray 1 simpa only [Ideal.span_singleton_one, canonical_quadraticRow_one I hI, canonical_quadraticRow_one J hJ, one_mul, Ideal.one_eq_top] using h def normalizedIdealPair (I J lengthScale : Ideal O) : ℂ := unrestrictedPairCharacter I J lengthScale / (Real.sqrt (Ideal.absNorm lengthScale : ℝ) : ℂ) theorem normalizedIdealPair_mul (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (A B : Ideal O) : normalizedIdealPair I J (A * B) = normalizedIdealPair I J A * normalizedIdealPair I J B := by simp only [normalizedIdealPair, unrestrictedPairCharacter_mul I J hI hJ hray, map_mul, Nat.cast_mul, Real.sqrt_mul (Nat.cast_nonneg _), Complex.ofReal_mul, div_mul_div_comm] def normalizedIdealPairHom (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) : Ideal O →* ℂ where toFun := normalizedIdealPair I J map_one' := by rw [normalizedIdealPair, unrestrictedPairCharacter_one I J hI hJ hray, map_one] norm_num map_mul' := normalizedIdealPair_mul I J hI hJ hray theorem normalizedIdealPair_square (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (lengthScale : Ideal O) : normalizedIdealPair I J lengthScale ^ 2 = (idealZeroMask I (idealGenerator lengthScale) * idealZeroMask J (idealGenerator lengthScale)) / (Ideal.absNorm lengthScale : ℂ) := by have hc : unrestrictedPairCharacter I J lengthScale ^ 2 = idealZeroMask I (idealGenerator lengthScale) * idealZeroMask J (idealGenerator lengthScale) := by unfold unrestrictedPairCharacter calc _ = (quadraticRow I (idealGenerator lengthScale) * quadraticRow I (idealGenerator lengthScale)) * (quadraticRow J (idealGenerator lengthScale) * quadraticRow J (idealGenerator lengthScale)) := by ring _ = _ := by rw [canonical_quadraticRow_squared I hI, canonical_quadraticRow_squared J hJ] have hn : (Real.sqrt (Ideal.absNorm lengthScale : ℝ) : ℂ) ^ 2 = (Ideal.absNorm lengthScale : ℂ) := by exact_mod_cast Real.sq_sqrt (Nat.cast_nonneg (Ideal.absNorm lengthScale) : (0 : ℝ) ≤ _) rw [normalizedIdealPair, div_pow, hc, hn] theorem squarefree_divisor_sum_eq_support (G : Ideal O) (hG : Squarefree G) (f : Ideal O → ℂ) : (∑ D ∈ idealDivisors G, f D) = ∑ S ∈ (IdealMobiusDivisorSum.primeSupport G).powerset, f (∏ P ∈ S, P) := by have hfilter : (idealDivisors G).filter Squarefree = idealDivisors G := by apply Finset.filter_eq_self.mpr intro D hD exact hG.squarefree_of_dvd ((mem_idealDivisors hG.ne_zero).mp hD) rw [← hfilter, squarefree_divisors_eq_image G hG.ne_zero, Finset.sum_image] intro S hS T hT hST exact support_product_injective (Finset.mem_powerset.mp hS) (Finset.mem_powerset.mp hT) hST theorem normalizedIdealPair_double_divisor (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (G : Ideal O) (hG : Squarefree G) : (∑ D ∈ idealDivisors G, ∑ E ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius E : ℂ) * normalizedIdealPair I J (D * E)) = ∏ P ∈ IdealMobiusDivisorSum.primeSupport G, (1 - (idealZeroMask I (idealGenerator P) * idealZeroMask J (idealGenerator P)) / (Ideal.absNorm P : ℂ)) := by rw [squarefree_divisor_sum_eq_support G hG] simp_rw [squarefree_divisor_sum_eq_support G hG] have hprod (S : Finset (Ideal O)) : normalizedIdealPair I J (∏ P ∈ S, P) = ∏ P ∈ S, normalizedIdealPair I J P := map_prod (normalizedIdealPairHom I J hI hJ hray) (fun P => P) S have hm (E : Finset (Ideal O)) (hE : E ∈ (IdealMobiusDivisorSum.primeSupport G).powerset) : (UniqueFactorizationMonoid.moebius (∏ P ∈ E, P) : ℂ) = (-1 : ℂ) ^ E.card := moebius_support_product (Finset.mem_powerset.mp hE) have heq : (∑ D ∈ (IdealMobiusDivisorSum.primeSupport G).powerset, ∑ E ∈ (IdealMobiusDivisorSum.primeSupport G).powerset, (UniqueFactorizationMonoid.moebius (∏ P ∈ E, P) : ℂ) * normalizedIdealPair I J ((∏ P ∈ D, P) * ∏ P ∈ E, P)) = ∑ D ∈ (IdealMobiusDivisorSum.primeSupport G).powerset, ∑ E ∈ (IdealMobiusDivisorSum.primeSupport G).powerset, (-1 : ℂ) ^ E.card * (∏ P ∈ D, normalizedIdealPair I J P) * ∏ P ∈ E, normalizedIdealPair I J P := by apply Finset.sum_congr rfl intro D hD apply Finset.sum_congr rfl intro E hE rw [hm E hE, normalizedIdealPair_mul I J hI hJ hray, hprod D, hprod E] ring rw [heq] have hh := QuadraticDivisorCancellation.double_divisor_factorization (normalizedIdealPair I J) (IdealMobiusDivisorSum.primeSupport G) ∅ (by simp) simpa only [Finset.union_empty, Finset.powerset_empty, Finset.sum_singleton, Finset.prod_empty, Finset.card_empty, pow_zero, mul_one, normalizedIdealPair_square I J hI hJ] using hh end section open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss open IdealMobiusDivisorSum QuadraticMainBoundary def idealNormCutoff (K : ℝ) (H : Ideal O) : ℂ := if (Ideal.absNorm H : ℝ) ≤ K then 1 else 0 def normalizedPairPartial (I J : Ideal O) (K : ℝ) : ℂ := ∑ B : squarefreeIdealRange K, normalizedIdealPair I J B.val def normalizedPairCoprimePartial (I J G : Ideal O) (K : ℝ) : ℂ := ∑ H : coprimeSquarefreeRange G K, normalizedIdealPair I J H.val def normalizedPairDivisors (I J G : Ideal O) : ℂ := ∑ E ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius E : ℂ) * normalizedIdealPair I J E def normalizedPairDensity (I J G : Ideal O) : ℂ := ∏ P ∈ IdealMobiusDivisorSum.primeSupport G, (1 - (idealZeroMask I (ConcretePrimeRowBridge.idealGenerator P) * idealZeroMask J (ConcretePrimeRowBridge.idealGenerator P)) / (Ideal.absNorm P : ℂ)) theorem normalizedPairPartial_split (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (G : Ideal O) (hG : Squarefree G) (K : ℝ) : normalizedPairPartial I J K = ∑ H : coprimeSquarefreeRange G K, ∑ D ∈ idealDivisors G, normalizedIdealPair I J H.val * normalizedIdealPair I J D * idealNormCutoff K (H.val * D) := by rw [normalizedPairPartial, squarefree_gcd_finite_sum G hG K] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro H _ rw [Finset.sum_coe_sort (idealDivisors G) (fun D => if (Ideal.absNorm (D * H.val) : ℝ) ≤ K then normalizedIdealPair I J (D * H.val) else 0)] apply Finset.sum_congr rfl intro D hD rw [mul_comm D H.val] rw [normalizedIdealPair_mul I J hI hJ hray] unfold idealNormCutoff split_ifs <;> ring theorem normalizedPair_main_difference (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hray : columnRay I = columnRay J) (G : Ideal O) (hG : Squarefree G) (K : ℝ) : normalizedPairPartial I J K * normalizedPairDivisors I J G - normalizedPairCoprimePartial I J G K * normalizedPairDensity I J G = ∑ H : coprimeSquarefreeRange G K, ∑ D ∈ idealDivisors G, ∑ E ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius E : ℂ) * normalizedIdealPair I J (H.val * D * E) * (cutoffDifference K H.val D : ℂ) := by have hd : normalizedPairDensity I J G = ∑ D ∈ idealDivisors G, ∑ E ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius E : ℂ) * (normalizedIdealPair I J D * normalizedIdealPair I J E) := by rw [normalizedPairDensity, ← normalizedIdealPair_double_divisor I J hI hJ hray G hG] simp only [normalizedIdealPair_mul I J hI hJ hray] rw [normalizedPairPartial_split I J hI hJ hray G hG K, hd] unfold normalizedPairDivisors normalizedPairCoprimePartial simp only [Finset.sum_mul] simp only [Finset.mul_sum] rw [← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro H _ rw [← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro D hD rw [← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro E hE have hHN : (Ideal.absNorm H.val : ℝ) ≤ K := (mem_squarefreeIdealRange.mp (Finset.mem_filter.mp H.property).1).2 have hc : (cutoffDifference K H.val D : ℂ) = idealNormCutoff K (H.val * D) - 1 := by unfold cutoffDifference idealNormCutoff rw [if_pos hHN] split_ifs <;> norm_num rw [hc, normalizedIdealPair_mul I J hI hJ hray, normalizedIdealPair_mul I J hI hJ hray] ring end open ActualEisensteinCubic ConcretePrimeRowBridge CompletedGauss IdealMobiusDivisorSum def commonMaskIdeal (D : Ideal O) : Ideal O := ∏ P ∈ gcdMaskPrimes D, P theorem commonMaskIdeal_squarefree (D : Ideal O) : Squarefree (commonMaskIdeal D) := by have hp (P : Ideal O) (hP : P ∈ gcdMaskPrimes D) : Prime P := by let : P.IsMaximal := gcdMaskPrimes_maximal D ⟨P, hP⟩ exact Ideal.prime_of_isPrime (NeZero.ne P) inferInstance apply Finset.squarefree_prod_of_pairwise_isCoprime · intro P hP Q hQ hne let : P.IsMaximal := gcdMaskPrimes_maximal D ⟨P, hP⟩ let : Q.IsMaximal := gcdMaskPrimes_maximal D ⟨Q, hQ⟩ exact (Ideal.isCoprime_of_isMaximal hne).isRelPrime · intro P hP exact (hp P hP).squarefree theorem fixedBadPrimes_dvd_commonMaskIdeal (D P : Ideal O) (hP : P ∈ fixedBadPrimes) : P ∣ commonMaskIdeal D := by apply Finset.dvd_prod_of_mem exact Finset.mem_union_left _ hP theorem admissible_of_squarefree_coprime_bad (H G : Ideal O) (hH : Squarefree H) (hc : IsCoprime H G) (hbad : ∀ P ∈ fixedBadPrimes, P ∣ G) : Admissible H := by refine ⟨hH.ne_zero, hH, ?_⟩ intro P hP have hp : Prime P := UniqueFactorizationMonoid.prime_of_normalized_factor P hP let : P.IsMaximal := (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero apply (prime_good_iff_not_bad P).mpr intro hb exact hp.not_isUnit (hc.isRelPrime (UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors hP) (hbad P hb)) theorem coprimeSquarefreeRange_subset_idealRange (G : Ideal O) (hbad : ∀ P ∈ fixedBadPrimes, P ∣ G) (K : ℝ) : coprimeSquarefreeRange G K ⊆ idealRange K := by intro H hH obtain ⟨hHs, hc⟩ := Finset.mem_filter.mp hH obtain ⟨hsf, hN⟩ := mem_squarefreeIdealRange.mp hHs exact mem_idealRange.mpr ⟨admissible_of_squarefree_coprime_bad H G hsf hc hbad, hN⟩ theorem commonMaskIdeal_eq_fixed_mul (D : Ideal O) (hD : Admissible D) : commonMaskIdeal D = (∏ P ∈ fixedBadPrimes, P) * D := by have hd : Disjoint fixedBadPrimes (IdealMobiusDivisorSum.primeSupport D) := by apply Finset.disjoint_left.mpr intro P hp hP have hfac := Multiset.mem_toFinset.mp hP have hprime := UniqueFactorizationMonoid.prime_of_normalized_factor P hfac let : P.IsMaximal := (Ideal.isPrime_of_prime hprime).isMaximal hprime.ne_zero exact (prime_good_iff_not_bad P).mp (hD.2.2 P hfac) hp change (∏ P ∈ fixedBadPrimes ∪ IdealMobiusDivisorSum.primeSupport D, P) = _ rw [Finset.prod_union hd, squarefree_support_product_self hD.2.1] theorem commonMaskIdeal_norm (D : Ideal O) (hD : Admissible D) : Ideal.absNorm (commonMaskIdeal D) = Ideal.absNorm (∏ P ∈ fixedBadPrimes, P) * Ideal.absNorm D := by rw [commonMaskIdeal_eq_fixed_mul D hD, map_mul] end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.TwistedProfiles namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap ContDiff namespace SecondPassArithmetic section open ActualEisensteinCubic open JointLogSeparation open FirstPassCubeLabels (jLabel) open SecondPassIntegration (exists_fixed_twisted_normalized_child_tests elementNorm) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end section open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform open ActualEisensteinCubic open FirstPassCubeLabels (b0Label firstLogDensity) open SecondPassIntegration (childGeometricMean) open JointLogSeparation end open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm b0Label jLabel) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter) open JointLogSeparation (frequencyTwist frequencyTwist_apply) open FourierBridge (logPhase) open SecondPassIntegration (conjugateProfile) def firstCoreBaseProfile (g V : 𝓢(ℝ, ℂ)) (negative : Bool) : 𝓢(ℝ, ℂ) := SchwartzMap.smulLeftCLM ℂ (if negative then conjugateProfile V else V) g def firstCoreModeHeight (negative : Bool) (t : ℝ) : ℝ := if negative then t else -t def firstCoreModeProfile (g V : 𝓢(ℝ, ℂ)) (negative : Bool) (t : ℝ) : 𝓢(ℝ, ℂ) := frequencyTwist (firstCoreBaseProfile g V negative) (firstCoreModeHeight negative t) theorem firstCoreBaseProfile_apply (g V : 𝓢(ℝ, ℂ)) (negative : Bool) (s : ℝ) : firstCoreBaseProfile g V negative s = g s * (if negative then star (V s) else V s) := by cases negative <;> simp only [firstCoreBaseProfile, Bool.false_eq_true, ite_false, ite_true, SchwartzMap.smulLeftCLM_apply_apply (SchwartzMap.hasTemperateGrowth _), smul_eq_mul, SecondPassIntegration.conjugateProfile_apply] <;> ring lemma logPhase_neg_argument (t s : ℝ) : logPhase t (-s) = logPhase (-t) s := by unfold logPhase congr 1 push_cast ring theorem firstCoreModeProfile_apply (g V : 𝓢(ℝ, ℂ)) (negative : Bool) (t s : ℝ) : firstCoreModeProfile g V negative t s = g s * (if negative then star (V s * logPhase t (-s)) else V s * logPhase t (-s)) := by cases negative <;> simp only [firstCoreModeProfile, frequencyTwist_apply, firstCoreModeHeight, firstCoreBaseProfile_apply, Bool.false_eq_true, ite_false, ite_true, star_mul, logPhase_neg_argument, SecondPassIntegration.logPhase_conjugate, neg_neg] <;> ring theorem firstCoreModeProfile_norm (g V : 𝓢(ℝ, ℂ)) (negative : Bool) (t s : ℝ) : ‖firstCoreModeProfile g V negative t s‖ = ‖g s‖ * ‖V s‖ := by rw [firstCoreModeProfile_apply] cases negative <;> simp [FourierBridge.logPhase_norm] theorem firstCoreModeProfile_support (g V : 𝓢(ℝ, ℂ)) (negative : Bool) (t s : ℝ) (h : firstCoreModeProfile g V negative t s ≠ 0) : g s ≠ 0 ∧ V s ≠ 0 := by have hn : ‖g s‖ * ‖V s‖ ≠ 0 := by rw [← firstCoreModeProfile_norm g V negative t s] exact norm_ne_zero_iff.mpr h exact ⟨norm_ne_zero_iff.mp (mul_ne_zero_iff.mp hn).1, norm_ne_zero_iff.mp (mul_ne_zero_iff.mp hn).2⟩ variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) include hp omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem firstCoreTest_eq_normalized_mode (g V : 𝓢(ℝ, ℂ)) (negative : Bool) (t : ℝ) (D S : Finset ι) (hDS : Disjoint D S) (X : ℝ) (hX : 0 < X) : firstCoreTest (normalizedColumn p (fun A => g (columnLog p X A))) V (columnLog p X) negative t D S = (‖eisEmbedding (∏ i ∈ D, p i)‖ : ℂ)⁻¹ * normalizedColumn p (fun A => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) A)) S := by simp only [firstCoreTest, normalizedColumn, SecondPassIntegration.columnLog_extract_common p hp D S hDS X hX, Finset.prod_union hDS, map_mul, norm_mul, Complex.ofReal_mul, firstCoreModeProfile_apply] ring theorem firstCoreInputRow_eq_mode_row (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ, ℂ)) (X : ℝ) (hX : 0 < X) (c d : O) (r : FirstCoreIndex) (t : ℝ) (z : O) : firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m (normalizedColumn p (fun A => g (columnLog p X A))) V (columnLog p X) c d r t z = (‖eisEmbedding (∏ i ∈ D, p i)‖ : ℂ)⁻¹ * inputConjugateRow p hg (F\D) (firstCoreTwist negative χ Ψ r) (m * b0Label p B v ε₁ ε₂) (c * jLabel p B v ε₁ ε₂) d (normalizedColumn p (fun A => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) A))) (if negative then -z else z) := by unfold firstCoreInputRow inputConjugateRow FirstCauchyArithmetic.supportConjugateSum simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro S hS have hDS : Disjoint D S := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hS) disjoint_sdiff_self_right simp only [secondInputCoefficient, firstCoreTest_eq_normalized_mode p hp g V negative t D S hDS X hX] ring theorem firstCoreInputRow_mode_norm_sq (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ, ℂ)) (X : ℝ) (hX : 0 < X) (c d : O) (r : FirstCoreIndex) (t : ℝ) (z : O) : ‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m (normalizedColumn p (fun A => g (columnLog p X A))) V (columnLog p X) c d r t z‖ ^ 2 = (primeProductNorm p D)⁻¹ * ‖inputConjugateRow p hg (F\D) (firstCoreTwist negative χ Ψ r) (m * b0Label p B v ε₁ ε₂) (c * jLabel p B v ε₁ ε₂) d (normalizedColumn p (fun A => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) A))) (if negative then -z else z)‖ ^ 2 := by rw [firstCoreInputRow_eq_mode_row p hp hg F D B v ε₁ ε₂ negative χ Ψ m g V X hX c d r t z] simp only [norm_mul, norm_inv, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (norm_nonneg _), mul_pow, inv_pow, primeProductNorm] end SecondPassArithmetic namespace CubicEisenstein open Filter open scoped BigOperators Classical MatrixGroups Matrix Topology open ActualEisensteinCubic CubicKubota ConcreteTraceCRT abbrev UpperCoordinates := {p : ℂ × ℝ // 0 < p.2} def coordinateSection (w : UpperCoordinates) : SL(2,ℂ) := upperSection w.1.1 w.1.2 w.2 lemma continuous_coordinate_inverse_operator : Continuous (fun w : UpperCoordinates => rowOperator (coordinateSection w)⁻¹) := by have hroot : Continuous (fun w : UpperCoordinates => (Real.sqrt w.1.2 : ℂ)) := Complex.continuous_ofReal.comp (Real.continuous_sqrt.comp (continuous_snd.comp continuous_subtype_val)) have hne : ∀ w : UpperCoordinates, (Real.sqrt w.1.2 : ℂ) ≠ 0 := fun w => Complex.ofReal_ne_zero.mpr (Real.sqrt_pos.mpr w.2).ne' apply continuous_clm_apply.mpr intro u apply continuous_pi intro i change Continuous (fun w : UpperCoordinates => Matrix.vecMul u (Matrix.adjugate (coordinateSection w : Matrix (Fin 2) (Fin 2) ℂ)) i) simp only [Matrix.vecMul,dotProduct,Fin.sum_univ_two,coordinateSection,upperSection, Matrix.SpecialLinearGroup.coe_mk,Matrix.adjugate_fin_two] fin_cases i · change Continuous (fun w : UpperCoordinates => u 0 * (Real.sqrt w.1.2 : ℂ)⁻¹ + u 1 * (-0)) exact (continuous_const.mul (hroot.inv₀ hne)).add (continuous_const.mul continuous_const) · change Continuous (fun w : UpperCoordinates => u 0 * (-(w.1.1 / (Real.sqrt w.1.2 : ℂ))) + u 1 * (Real.sqrt w.1.2 : ℂ)) exact (continuous_const.mul ((continuous_fst.comp continuous_subtype_val).div hroot hne).neg).add (continuous_const.mul hroot) lemma continuous_coordinate_rowBound : Continuous (fun w : UpperCoordinates => rowBound (coordinateSection w)) := continuous_const.mul (continuous_const.add continuous_coordinate_inverse_operator.norm) lemma continuous_coordinate_summand (x : CuspCosets) : Continuous (fun p : UpperCoordinates × ℂ => summand (coordinateSection p.1) p.2 x) := by have hv : Continuous (fun p : UpperCoordinates × ℂ => p.1.1.2) := (continuous_snd.comp continuous_subtype_val).comp continuous_fst have hz : Continuous (fun p : UpperCoordinates × ℂ => p.1.1.1) := (continuous_fst.comp continuous_subtype_val).comp continuous_fst simp only [coordinateSection,summand_upperSection] apply continuous_const.mul apply Continuous.cpow · apply Complex.continuous_ofReal.comp apply hv.div · unfold heightDenominator exact ((continuous_const.mul hz).add continuous_const).norm.pow 2 |>.add (continuous_const.mul (hv.pow 2)) · intro p exact (heightDenominator_pos _ _ p.1.2 _ (embeddedRow_ne_zero x)).ne' · exact continuous_snd · intro p exact Complex.ofReal_mem_slitPlane.mpr (div_pos p.1.2 (heightDenominator_pos _ _ p.1.2 _ (embeddedRow_ne_zero x))) lemma coordinate_summable_majorant (C a b : ℝ) (hC : 0 < C) (ha : 2 < a) (hb : 2 < b) : ∃ M : CuspCosets → ℝ, Summable M ∧ (∀ x,0 ≤ M x) ∧ ∀ p : UpperCoordinates × ℂ, rowBound (coordinateSection p.1) ≤ C → a ≤ p.2.re → p.2.re ≤ b → ∀ x, ‖summand (coordinateSection p.1) p.2 x‖ ≤ M x := by let weight (t : ℝ) (x : CuspCosets) := C^(2*t)*‖rowCoordinates (cosetRow x)‖^(-(2*t)) have hsum (t : ℝ) (ht : 2 rowCoordinates (cosetRow x)) := rowCoordinates_injective.comp cosetRow_injective exact ((summable_integer_four_rpow (2*t) (by linarith)).comp_injective hinj).mul_left _ refine ⟨fun x => weight a x + weight b x,(hsum a ha).add (hsum b hb),?_,?_⟩ · intro x dsimp [weight] positivity · intro p hbound hpa hpb x apply (norm_summand_strip (coordinateSection p.1) a b p.2 hpa hpb x).trans apply add_le_add · apply (norm_summand_bound (coordinateSection p.1) (a:ℂ) (by simpa using lt_trans (by norm_num) ha) x).trans exact mul_le_mul_of_nonneg_right (Real.rpow_le_rpow (rowBound_pos _).le hbound (by simpa only [Complex.ofReal_re] using (show 0 ≤ 2*a by linarith))) (by positivity) · apply (norm_summand_bound (coordinateSection p.1) (b:ℂ) (by simpa using lt_trans (by norm_num) hb) x).trans exact mul_le_mul_of_nonneg_right (Real.rpow_le_rpow (rowBound_pos _).le hbound (by simpa only [Complex.ofReal_re] using (show 0 ≤ 2*b by linarith))) (by positivity) theorem coordinate_eisenstein_continuousAt (p : UpperCoordinates × ℂ) (hp : 2 < p.2.re) : ContinuousAt (fun q : UpperCoordinates × ℂ => eisenstein (coordinateSection q.1) q.2) p := by let a : ℝ := (2+p.2.re)/2 let b : ℝ := p.2.re+1 let C : ℝ := rowBound (coordinateSection p.1)+1 let region : Set (UpperCoordinates × ℂ) := {q | rowBound (coordinateSection q.1) < C ∧ a < q.2.re ∧ q.2.re < b} have ha : 2 linarith have hcont : ContinuousOn (fun q : UpperCoordinates × ℂ => ∑' x : CuspCosets, summand (coordinateSection q.1) q.2 x) region := by apply continuousOn_tsum (fun x => (continuous_coordinate_summand x).continuousOn) hM intro x q hq exact hbound q hq.1.le hq.2.1.le hq.2.2.le x exact (hcont p hmem).continuousAt (hopen.mem_nhds hmem) theorem upperEisenstein_joint_continuousAt (p : UpperCoordinates × ℂ) (hp : 2 < p.2.re) : ContinuousAt (fun q : UpperCoordinates × ℂ => upperEisenstein q.1.1.1 q.1.1.2 q.1.2 q.2) p := coordinate_eisenstein_continuousAt p hp end CubicEisenstein open Filter open scoped BigOperators Classical Topology namespace CubicEisenstein def logRatioPower (s : ℂ) (v q : ℝ) : ℂ := Complex.exp (s * ((Real.log v - Real.log q : ℝ) : ℂ)) lemma logRatioPower_eq_cpow (s : ℂ) {v q : ℝ} (hv : 0 logRatioPower s (f t) (g t)) (logRatioPower s (f x) (g x) * s * ((f'/f x-g'/g x : ℝ):ℂ)) x := by convert (((hf.log hf0).sub (hg.log hg0)).ofReal_comp.const_mul s).cexp using 1 <;> dsimp [logRatioPower] ; ring lemma hasDerivAt_deriv_logRatioPower (s : ℂ) (f g df dg : ℝ → ℝ) (x ddf ddg : ℝ) (hf : ∀t, HasDerivAt f (df t) t) (hg : ∀t, HasDerivAt g (dg t) t) (hdf : HasDerivAt df ddf x) (hdg : HasDerivAt dg ddg x) (hf0 : f x ≠ 0) (hg0 : g x ≠ 0) : HasDerivAt (deriv (fun t => logRatioPower s (f t) (g t))) (logRatioPower s (f x) (g x) * (s^2 * ((df x/f x-dg x/g x : ℝ):ℂ)^2 + s * (((ddf*f x-df x*df x)/(f x)^2 - (ddg*g x-dg x*dg x)/(g x)^2 : ℝ):ℂ))) x := by have hnear : ∀ᶠ t in 𝓝 x, f t ≠ 0 ∧ g t ≠ 0 := ((hf x).continuousAt.eventually_ne hf0).and ((hg x).continuousAt.eventually_ne hg0) have heq : (deriv (fun t => logRatioPower s (f t) (g t))) =ᶠ[𝓝 x] (fun t => logRatioPower s (f t) (g t) * s * ((df t/f t-dg t/g t : ℝ):ℂ)) := by filter_upwards [hnear] with t ht exact (hasDerivAt_logRatioPower s (hf t) (hg t) ht.1 ht.2).deriv have hfirst := hasDerivAt_logRatioPower s (hf x) (hg x) hf0 hg0 have hsecond := ((hdf.div (hf x) hf0).sub (hdg.div (hg x) hg0)).ofReal_comp apply HasDerivAt.congr_of_eventuallyEq _ heq convert (hfirst.mul_const s).mul hsecond using 1 <;> first | rfl | ((try simp only [Pi.sub_apply,Pi.div_apply]); ring) def quadraticHeightDenominator (A B C D x y v : ℝ) : ℝ := A*(x^2+y^2+v^2)+2*(B*x+C*y)+D lemma quadraticHeightDenominator_hasDerivAt_x (A B C D x y v : ℝ) : HasDerivAt (fun t => quadraticHeightDenominator A B C D t y v) (2*(A*x+B)) x := by convert (((((hasDerivAt_id x).pow 2).add_const (y^2)).add_const (v^2)).const_mul A).add ((((hasDerivAt_id x).const_mul B).add_const (C*y)).const_mul 2) |>.add_const D using 1 <;> first | rfl | (funext t; dsimp [quadraticHeightDenominator]; ring) | (ring_nf <;> rfl) lemma quadraticHeightDenominator_hasDerivAt_y (A B C D x y v : ℝ) : HasDerivAt (fun t => quadraticHeightDenominator A B C D x t v) (2*(A*y+C)) y := by convert (((((hasDerivAt_id y).pow 2).const_add (x^2)).add_const (v^2)).const_mul A).add ((((hasDerivAt_id y).const_mul C).const_add (B*x)).const_mul 2) |>.add_const D using 1 <;> first | rfl | (funext t; dsimp [quadraticHeightDenominator]; ring) | (ring_nf <;> rfl) lemma quadraticHeightDenominator_hasDerivAt_v (A B C D x y v : ℝ) : HasDerivAt (fun t => quadraticHeightDenominator A B C D x y t) (2*A*v) v := by convert ((((hasDerivAt_id v).pow 2).const_add (x^2+y^2)).const_mul A).add_const (2*(B*x+C*y)+D) using 1 <;> first | rfl | (funext t; dsimp [quadraticHeightDenominator]; ring) | (ring_nf <;> rfl) def spatialHeightPower (s : ℂ) (A B C D x y v : ℝ) : ℂ := logRatioPower s v (quadraticHeightDenominator A B C D x y v) def heightLogDx (A B C D x y v : ℝ) : ℝ := -(2*(A*x+B)/quadraticHeightDenominator A B C D x y v) def heightLogDy (A B C D x y v : ℝ) : ℝ := -(2*(A*y+C)/quadraticHeightDenominator A B C D x y v) def heightLogDv (A B C D x y v : ℝ) : ℝ := 1/v - 2*A*v/quadraticHeightDenominator A B C D x y v def heightLogDxx (A B C D x y v : ℝ) : ℝ := -((2*A*quadraticHeightDenominator A B C D x y v - (2*(A*x+B))*(2*(A*x+B)))/(quadraticHeightDenominator A B C D x y v)^2) def heightLogDyy (A B C D x y v : ℝ) : ℝ := -((2*A*quadraticHeightDenominator A B C D x y v - (2*(A*y+C))*(2*(A*y+C)))/(quadraticHeightDenominator A B C D x y v)^2) def heightLogDvv (A B C D x y v : ℝ) : ℝ := -(1/v^2) - ((2*A*quadraticHeightDenominator A B C D x y v - (2*A*v)*(2*A*v))/(quadraticHeightDenominator A B C D x y v)^2) lemma deriv_spatialHeightPower_v (s : ℂ) (A B C D x y v : ℝ) (hv : v≠0) (hq : quadraticHeightDenominator A B C D x y v≠0) : deriv (spatialHeightPower s A B C D x y) v = spatialHeightPower s A B C D x y v * s * (heightLogDv A B C D x y v : ℂ) := by exact (hasDerivAt_logRatioPower s (hasDerivAt_id v) (quadraticHeightDenominator_hasDerivAt_v A B C D x y v) hv hq).deriv lemma deriv2_spatialHeightPower_x (s : ℂ) (A B C D x y v : ℝ) (hv : v≠0) (hq : quadraticHeightDenominator A B C D x y v≠0) : deriv (deriv (fun t => spatialHeightPower s A B C D t y v)) x = spatialHeightPower s A B C D x y v * (s^2*(heightLogDx A B C D x y v : ℂ)^2 + s*(heightLogDxx A B C D x y v : ℂ)) := by have h := hasDerivAt_deriv_logRatioPower s (fun _ => v) (fun t => quadraticHeightDenominator A B C D t y v) (fun _ => 0) (fun t => 2*(A*t+B)) x 0 (2*A) (fun t => hasDerivAt_const t v) (fun t => quadraticHeightDenominator_hasDerivAt_x A B C D t y v) (hasDerivAt_const x 0) (by simpa only [id_eq,mul_one] using ((hasDerivAt_id x).const_mul A |>.add_const B).const_mul 2) hv hq simpa only [spatialHeightPower,heightLogDx,heightLogDxx,zero_div,zero_sub,zero_mul,sub_zero] using h.deriv lemma deriv2_spatialHeightPower_y (s : ℂ) (A B C D x y v : ℝ) (hv : v≠0) (hq : quadraticHeightDenominator A B C D x y v≠0) : deriv (deriv (fun t => spatialHeightPower s A B C D x t v)) y = spatialHeightPower s A B C D x y v * (s^2*(heightLogDy A B C D x y v : ℂ)^2 + s*(heightLogDyy A B C D x y v : ℂ)) := by have h := hasDerivAt_deriv_logRatioPower s (fun _ => v) (fun t => quadraticHeightDenominator A B C D x t v) (fun _ => 0) (fun t => 2*(A*t+C)) y 0 (2*A) (fun t => hasDerivAt_const t v) (fun t => quadraticHeightDenominator_hasDerivAt_y A B C D x t v) (hasDerivAt_const y 0) (by simpa only [id_eq,mul_one] using ((hasDerivAt_id y).const_mul A |>.add_const C).const_mul 2) hv hq simpa only [spatialHeightPower,heightLogDy,heightLogDyy,zero_div,zero_sub,zero_mul,sub_zero] using h.deriv lemma deriv2_spatialHeightPower_v (s : ℂ) (A B C D x y v : ℝ) (hv : v≠0) (hq : quadraticHeightDenominator A B C D x y v≠0) : deriv (deriv (spatialHeightPower s A B C D x y)) v = spatialHeightPower s A B C D x y v * (s^2*(heightLogDv A B C D x y v : ℂ)^2 + s*(heightLogDvv A B C D x y v : ℂ)) := by change deriv (deriv (fun t => logRatioPower s t (quadraticHeightDenominator A B C D x y t))) v = _ have h := hasDerivAt_deriv_logRatioPower s (fun t => t) (fun t => quadraticHeightDenominator A B C D x y t) (fun _ => 1) (fun t => 2*A*t) v 0 (2*A) (fun t => hasDerivAt_id t) (fun t => quadraticHeightDenominator_hasDerivAt_v A B C D x y t) (hasDerivAt_const v 1) (by simpa only [id_eq,mul_one] using (hasDerivAt_id v).const_mul (2*A)) hv hq simpa only [spatialHeightPower,heightLogDv,heightLogDvv,zero_mul,zero_sub,one_mul,neg_div] using h.deriv lemma quadraticHeight_gradient_square (A B C D x y v : ℝ) (hrel : A*D=B^2+C^2) : (A*x+B)^2 + (A*y+C)^2 + (A*v)^2 = A*quadraticHeightDenominator A B C D x y v := by unfold quadraticHeightDenominator nlinarith [hrel] lemma heightLog_eikonal (A B C D x y v : ℝ) (hrel : A*D=B^2+C^2) (hv : v≠0) (hq : quadraticHeightDenominator A B C D x y v≠0) : v^2 * ((heightLogDx A B C D x y v)^2 + (heightLogDy A B C D x y v)^2 + (heightLogDv A B C D x y v)^2) = 1 := by calc _ = 1 + 4*v^2/(quadraticHeightDenominator A B C D x y v)^2 * ((A*x+B)^2+(A*y+C)^2+(A*v)^2 - A*quadraticHeightDenominator A B C D x y v) := by unfold heightLogDx heightLogDy heightLogDv field_simp [hv,hq] ; ring _ = 1 := by rw [quadraticHeight_gradient_square A B C D x y v hrel]; ring lemma heightLog_laplacian (A B C D x y v : ℝ) (hrel : A*D=B^2+C^2) (hv : v≠0) (hq : quadraticHeightDenominator A B C D x y v≠0) : v^2 * (heightLogDxx A B C D x y v + heightLogDyy A B C D x y v + heightLogDvv A B C D x y v) - v*heightLogDv A B C D x y v = -2 := by calc _ = -2 + 4*v^2/(quadraticHeightDenominator A B C D x y v)^2 * ((A*x+B)^2+(A*y+C)^2+(A*v)^2 - A*quadraticHeightDenominator A B C D x y v) := by unfold heightLogDxx heightLogDyy heightLogDvv heightLogDv field_simp [hv,hq] ; ring _ = -2 := by rw [quadraticHeight_gradient_square A B C D x y v hrel]; ring def hyperbolicLaplacian (f : ℝ → ℝ → ℝ → ℂ) (x y v : ℝ) : ℂ := (v:ℂ)^2 * (deriv (deriv (fun t => f t y v)) x + deriv (deriv (fun t => f x t v)) y + deriv (deriv (f x y)) v) - (v:ℂ)*deriv (f x y) v theorem spatialHeightPower_eigenfunction (s : ℂ) (A B C D x y v : ℝ) (hrel : A*D=B^2+C^2) (hv : v≠0) (hq : quadraticHeightDenominator A B C D x y v≠0) : hyperbolicLaplacian (spatialHeightPower s A B C D) x y v = s*(s-2)*spatialHeightPower s A B C D x y v := by have he : (v:ℂ)^2 * ((heightLogDx A B C D x y v : ℂ)^2 + (heightLogDy A B C D x y v : ℂ)^2 + (heightLogDv A B C D x y v : ℂ)^2) = 1 := by exact_mod_cast heightLog_eikonal A B C D x y v hrel hv hq have hl : (v:ℂ)^2 * ((heightLogDxx A B C D x y v : ℂ) + (heightLogDyy A B C D x y v : ℂ) + (heightLogDvv A B C D x y v : ℂ)) - (v:ℂ)*(heightLogDv A B C D x y v : ℂ) = -2 := by exact_mod_cast heightLog_laplacian A B C D x y v hrel hv hq unfold hyperbolicLaplacian rw [deriv2_spatialHeightPower_x s A B C D x y v hv hq, deriv2_spatialHeightPower_y s A B C D x y v hv hq, deriv2_spatialHeightPower_v s A B C D x y v hv hq, deriv_spatialHeightPower_v s A B C D x y v hv hq] calc _ = spatialHeightPower s A B C D x y v * (s^2*((v:ℂ)^2*((heightLogDx A B C D x y v : ℂ)^2 + (heightLogDy A B C D x y v : ℂ)^2 + (heightLogDv A B C D x y v : ℂ)^2)) + s*((v:ℂ)^2*((heightLogDxx A B C D x y v : ℂ) + (heightLogDyy A B C D x y v : ℂ) + (heightLogDvv A B C D x y v : ℂ)) - (v:ℂ)*(heightLogDv A B C D x y v : ℂ))) := by ring _ = _ := by rw [he,hl]; ring lemma complex_row_quadratic_relation (c d : ℂ) : Complex.normSq c * Complex.normSq d = (c*star d).re^2 + (-(c*star d).im)^2 := by simp only [Complex.normSq_apply,Complex.mul_re,Complex.mul_im,Complex.star_def, Complex.conj_re,Complex.conj_im] ring lemma heightDenominator_eq_quadratic (u : Fin 2 → ℂ) (x y v : ℝ) : heightDenominator ((x:ℂ)+(y:ℂ)*Complex.I) v u = quadraticHeightDenominator (Complex.normSq (u 0)) ((u 0*star (u 1)).re) (-(u 0*star (u 1)).im) (Complex.normSq (u 1)) x y v := by unfold heightDenominator quadraticHeightDenominator simp only [← Complex.normSq_eq_norm_sq,Complex.normSq_apply,Complex.add_re,Complex.add_im, Complex.mul_re,Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im,Complex.I_re, Complex.I_im,Complex.star_def,Complex.conj_re,Complex.conj_im] ring def actualHeightPower (s : ℂ) (u : Fin 2 → ℂ) (x y v : ℝ) : ℂ := ((transformedHeight ((x:ℂ)+(y:ℂ)*Complex.I) v u : ℝ) : ℂ)^s lemma actualHeightPower_eq_spatial (s : ℂ) (u : Fin 2 → ℂ) (hu : u≠0) (x y v : ℝ) (hv : 0 c*f x y v) x y v = c*hyperbolicLaplacian f x y v := by unfold hyperbolicLaplacian simp only [deriv_const_mul_field',deriv_const_mul_field] ring lemma eigenfunction_summand_eq_actual_series (s : ℂ) (r : CuspCosets) (x y v : ℝ) (hv : 0 quadraticRow (cols j) (primaryGenerator H.val) let r : Ideal O → Ideal O → n → ℂ := fun D E j => quadraticRow (cols j) (idealGenerator D * idealGenerator E) have hpoint (j k : n) : (if IsCoprime (cols j) (cols k) then star (a j) * a k * (normalizedPairPartial (cols j) (cols k) K * normalizedPairDivisors (cols j) (cols k) G - normalizedPairCoprimePartial (cols j) (cols k) G K * normalizedPairDensity (cols j) (cols k) G) else 0) = ∑ D ∈ idealDivisors G, ∑ E ∈ idealDivisors G, ∑ H : S, (UniqueFactorizationMonoid.moebius E : ℂ) * mainWeight K H.val D E * (if IsCoprime (cols j) (cols k) then star (A H j * (a j * r D E j)) * (A H k * (a k * r D E k)) else 0) := by dsimp only [A, r] by_cases hc : IsCoprime (cols j) (cols k) · rw [if_pos hc, normalizedPair_main_difference (cols j) (cols k) (hcols j).1 (hcols k).1 (hray j k) G hG K] simp only [Finset.mul_sum] simp_rw [Finset.sum_comm (s := (Finset.univ : Finset (coprimeSquarefreeRange G K))) (t := idealDivisors G)] apply Finset.sum_congr rfl intro D hD apply Finset.sum_congr rfl intro E hE apply Finset.sum_congr rfl intro H _ rw [if_pos hc] exact normalizedPair_boundary_term (cols j) (cols k) H.val D E (hcols j).1 (hcols k).1 (hray j k) (admissible_supported (mem_idealRange.mp (hS H.property)).1) K (a j) (a k) · simp only [hc, ite_false, mul_zero, Finset.sum_const_zero] have heq : actualPrincipalDifference cols a G K = ∑ D ∈ idealDivisors G, ∑ E ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius E : ℂ) * (∑ H : S, mainWeight K H.val D E * (∑ j, ∑ k, if IsCoprime (cols j) (cols k) then star (A H j * (a j * r D E j)) * (A H k * (a k * r D E k)) else 0)) := by dsimp only [A, r] unfold actualPrincipalDifference simp_rw [hpoint] simp_rw [Finset.sum_comm (s := (Finset.univ : Finset n)) (t := idealDivisors G), Finset.sum_comm (s := (Finset.univ : Finset n)) (t := (Finset.univ : Finset S))] simp only [Finset.mul_sum, mul_assoc, A, r] rw [heq] have hb := main_difference_operator_bound ε hε K hK G hG.ne_zero (fun H : S => H.val) cols (fun j => (hcols j).1.1) N hN (fun j => (hcols j).2) A a r (fun D E j => quadraticRow_norm_le_one (cols j) _) have hA : ‖FiniteSieveOperator.operator A‖ ^ 2 ≤ sieveNorm K N := family_squared_norm_le (fun H : S => H.val) cols Subtype.val_injective hinj K N (fun H => mem_idealRange.mp (hS H.property)) hcols apply hb.trans have hs : 0 ≤ supportConstant ε hε := (supportConstant_pos ε hε).le gcongr end open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson def middleRatio (B b D₁ d D₂ e : ℝ) : ℝ := Real.sqrt (B / b) * (D₁ / d) * (D₂ / e) theorem middleRatio_bounds (B b D₁ d D₂ e : ℝ) (hB : 0 < B) (hb : B / 2 ≤ b ∧ b ≤ B) (hD₁ : 0 < D₁) (hd : D₁ ≤ d ∧ d ≤ 2 * D₁) (hD₂ : 0 < D₂) (he : D₂ ≤ e ∧ e ≤ 2 * D₂) : 1 / 4 ≤ middleRatio B b D₁ d D₂ e ∧ middleRatio B b D₁ d D₂ e ≤ 2 := by have hb0 : 0 < b := by linarith have hd0 : 0 < d := hD₁.trans_le hd.1 have he0 : 0 < e := hD₂.trans_le he.1 have hu1 : 1 ≤ Real.sqrt (B / b) := by have hq : 1 ≤ B / b := (le_div_iff₀ hb0).mpr (by simpa using hb.2) simpa only [Real.sqrt_one] using Real.sqrt_le_sqrt hq have hu2 : Real.sqrt (B / b) ≤ 2 := by apply Real.sqrt_le_iff.mpr refine ⟨by norm_num, ?_⟩ apply (div_le_iff₀ hb0).mpr nlinarith have hv : (1 / 2 : ℝ) ≤ D₁ / d ∧ D₁ / d ≤ 1 := ⟨(le_div_iff₀ hd0).mpr (by linarith), (div_le_one hd0).mpr hd.1⟩ have hw : (1 / 2 : ℝ) ≤ D₂ / e ∧ D₂ / e ≤ 1 := ⟨(le_div_iff₀ he0).mpr (by linarith), (div_le_one he0).mpr he.1⟩ have hv0 : 0 ≤ D₁ / d := (by norm_num : (0 : ℝ) ≤ 1 / 2).trans hv.1 have hw0 : 0 ≤ D₂ / e := (by norm_num : (0 : ℝ) ≤ 1 / 2).trans hw.1 have hvw1 : (1 / 4 : ℝ) ≤ (D₁ / d) * (D₂ / e) := by nlinarith [mul_le_mul hv.1 hw.1 (by norm_num : (0 : ℝ) ≤ 1 / 2) hv0] have hvw2 : (D₁ / d) * (D₂ / e) ≤ 1 := by nlinarith [mul_le_mul hv.2 hw.2 hw0 (by norm_num : (0 : ℝ) ≤ 1)] unfold middleRatio constructor · nlinarith [mul_le_mul hu1 hvw1 (by norm_num : (0 : ℝ) ≤ 1 / 4) (Real.sqrt_nonneg (B / b))] · nlinarith [mul_le_mul hu2 hvw2 (mul_nonneg hv0 hw0) (by norm_num : (0 : ℝ) ≤ 2)] theorem middleRatio_log_bound (r : ℝ) (hr : (1 / 4 : ℝ) ≤ r ∧ r ≤ 2) : |Real.log r| ≤ 4 := by have hr0 : 0 < r := by linarith have hi : r⁻¹ ≤ 4 := by have h : (1 : ℝ) / r ≤ 4 := (div_le_iff₀ hr0).mpr (by linarith) simpa only [one_div] using h have h₁ := Real.log_le_sub_one_of_pos hr0 have h₂ := Real.log_le_sub_one_of_pos (inv_pos.mpr hr0) rw [Real.log_inv] at h₂ exact abs_le.mpr ⟨by linarith, by linarith⟩ theorem middleRatio_argument (M B b D₁ d D₂ e q : ℝ) (hM : 0 < M) (hB : 0 < B) (hb : B / 2 ≤ b ∧ b ≤ B) (hD₁ : 0 < D₁) (hd : D₁ ≤ d ∧ d ≤ 2 * D₁) (hD₂ : 0 < D₂) (he : D₂ ≤ e ∧ e ≤ 2 * D₂) : (Real.sqrt (M / B) * q / (D₁ * D₂)) * Real.exp (Real.log (middleRatio B b D₁ d D₂ e)) = Real.sqrt (M / b) * q / (d * e) := by have hb0 : 0 < b := by linarith have hd0 : 0 < d := hD₁.trans_le hd.1 have he0 : 0 < e := hD₂.trans_le he.1 have hr : 0 < middleRatio B b D₁ d D₂ e := by have hh := middleRatio_bounds B b D₁ d D₂ e hB hb hD₁ hd hD₂ he linarith rw [Real.exp_log hr] have hs : Real.sqrt (M / B) * Real.sqrt (B / b) = Real.sqrt (M / b) := by rw [← Real.sqrt_mul (div_nonneg hM.le hB.le)] congr 1 field_simp unfold middleRatio calc _ = (Real.sqrt (M / B) * Real.sqrt (B / b)) * q / (d * e) := by field_simp _ = _ := by rw [hs] theorem actual_middle_radial_block_bound (W : 𝓢(ℝ, ℂ)) (A : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M : ℝ) (_hD₁ : 1 ≤ D₁) (_hD₂ : 1 ≤ D₂) (_hB : 1 ≤ B) (_hN : 1 ≤ N) (_hM : 0 < M) (_hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (_hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (_hr : Function.Injective rows) (_hl : Function.Injective left) (_hri : Function.Injective right) (_hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (_hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (_hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (h : O), h ≠ 0 → (1 + Real.sqrt (M / B) * ‖eisEmbedding h‖ ^ 2 / (D₁ * D₂)) ^ A * (∑ D : S, ∑ E : T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D.val E.val i j k * paperRadialFourier W (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ)))‖) ≤ C * Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N a b) := by obtain ⟨C, hC, hb⟩ := canonical_original_radial_divisor_block_bound W 4 0 0 (by norm_num) (by norm_num) (by norm_num) A refine ⟨C, hC, ?_⟩ intro m n p _ _ _ _ _ _ ε hε S T D₁ D₂ B N M hD₁ hD₂ hB hN hM hS hT rows left right hr hl hri hrows hleft hright a b h hh have hD₁0 : 0 < D₁ := by linarith have hD₂0 : 0 < D₂ := by linarith have hB0 : 0 < B := by linarith let R := Real.sqrt (M / B) * ‖eisEmbedding h‖ ^ 2 / (D₁ * D₂) have hR : 0 < R := div_pos (mul_pos (Real.sqrt_pos.mpr (div_pos hM hB0)) (sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hh)))) (mul_pos hD₁0 hD₂0) let x : S → T → m → ℝ := fun D E i => Real.log (middleRatio B (Ideal.absNorm (rows i)) D₁ (Ideal.absNorm D.val) D₂ (Ideal.absNorm E.val)) have hx (D : S) (E : T) (i : m) : |x D E i| ≤ 4 := middleRatio_log_bound _ (middleRatio_bounds _ _ _ _ _ _ hB0 (hrows i).2 hD₁0 (hS D.val D.property) hD₂0 (hT E.val E.property)) have he := hb R hR ε hε S T D₁ D₂ B N hD₁ hD₂ hN hS hT rows left right hr hl hri (fun i => ⟨(hrows i).1, (hrows i).2.2⟩) hleft hright a b x (fun _ => 0) (fun _ => 0) hx (fun _ => by simp) (fun _ => by simp) have harg (D : S) (E : T) (i : m) : R * Real.exp (x D E i + (0 + 0)) = Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ)) := by simp only [add_zero] exact middleRatio_argument _ _ _ _ _ _ _ _ hM hB0 (hrows i).2 hD₁0 (hS D.val D.property) hD₂0 (hT E.val E.property) simpa only [harg, R] using he end CanonicalQuadraticSieve namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm b0Label jLabel) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) include hp theorem firstCoreInputRow_smoothed_mode (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (g V W : 𝓢(ℝ, ℂ)) (X : ℝ) (hX : 0 < X) (Y : ℝ) (c d : O) (r : FirstCoreIndex) (t : ℝ) : (∑' z : O, W (‖eisEmbedding z‖ ^ 2 / Y) * (‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m (normalizedColumn p (fun A => g (columnLog p X A))) V (columnLog p X) c d r t z‖ ^ 2 : ℝ)) = ((primeProductNorm p D)⁻¹ : ℝ) * ∑' z : O, W (‖eisEmbedding z‖ ^ 2 / Y) * (‖inputConjugateRow p hg (F\D) (firstCoreTwist negative χ Ψ r) (m * b0Label p B v ε₁ ε₂) (c * jLabel p B v ε₁ ε₂) d (normalizedColumn p (fun A => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) A))) z‖ ^ 2 : ℝ) := by let P := inputConjugateRow p hg (F\D) (firstCoreTwist negative χ Ψ r) (m * b0Label p B v ε₁ ε₂) (c * jLabel p B v ε₁ ε₂) d (normalizedColumn p (fun A => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) A))) have he (z : O) : W (‖eisEmbedding z‖ ^ 2 / Y) * (‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m (normalizedColumn p (fun A => g (columnLog p X A))) V (columnLog p X) c d r t z‖ ^ 2 : ℝ) = (((primeProductNorm p D)⁻¹ : ℝ) : ℂ) * (W (‖eisEmbedding z‖ ^ 2 / Y) * (‖P (if negative then -z else z)‖ ^ 2 : ℝ)) := by rw [firstCoreInputRow_mode_norm_sq p hp hg F D B v ε₁ ε₂ negative χ Ψ m g V X hX c d r t z] push_cast ring simp_rw [he] rw [tsum_mul_left] have hsign : (∑' z : O, W (‖eisEmbedding z‖ ^ 2 / Y) * (‖P (if negative then -z else z)‖ ^ 2 : ℝ)) = ∑' z : O, W (‖eisEmbedding z‖ ^ 2 / Y) * (‖P z‖ ^ 2 : ℝ) := by cases negative · rfl · simpa only [Bool.true_eq, ite_true, Equiv.neg_apply, map_neg, norm_neg] using (Equiv.neg O).tsum_eq (fun z : O => W (‖eisEmbedding z‖ ^ 2 / Y) * (‖P z‖ ^ 2 : ℝ)) rw [hsign] theorem firstCoreInputRow_smoothed_truncated (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (F D B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (negative : Bool) (χ : RayCharacter) (Ψ : O →* ℂ) (m : O) (g V W : 𝓢(ℝ, ℂ)) (X : ℝ) (hX : 0 < X) (Y : ℝ) (hY : 0 < Y) (c d : O) (r : FirstCoreIndex) (t : ℝ) (K : Finset ι → Finset ι → Finset O) : let Hmode := normalizedColumn p (fun A => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) A)) let Ψmode := firstCoreTwist negative χ Ψ r let m' := m * b0Label p B v ε₁ ε₂ let c' := c * jLabel p B v ε₁ ε₂ (∑' z : O, W (‖eisEmbedding z‖ ^ 2 / Y) * (‖firstCoreInputRow p hg F D B v ε₁ ε₂ negative χ Ψ m (normalizedColumn p (fun A => g (columnLog p X A))) V (columnLog p X) c d r t z‖ ^ 2 : ℝ)) = ((primeProductNorm p D)⁻¹ : ℝ) * (truncatedSecondSource p hp hg hinj (F\D) Ψmode m' c' d Hmode W Y K + secondSourceTail p hp hg hinj (F\D) Ψmode m' c' d Hmode W Y K) := by dsimp only rw [firstCoreInputRow_smoothed_mode p hp hg F D B v ε₁ ε₂ negative χ Ψ m g V W X hX Y c d r t, inputConjugateRow_eq_truncated_add_tail p hp hg hinj hc] exact hY end SecondPassArithmetic namespace SecondPassIntegration open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) lemma childEnergy_eq_difference (F : Finset ι) (Ψ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V : ℝ → ℂ) (X a b : ℝ) (testNegative rowNegative : Bool) : childEnergy p hp hcop hg F Ψ m T V X testNegative rowNegative a b = childEnergy p hp hcop hg F Ψ m T V X testNegative rowNegative (a-b) 0 := by have he : fixedSecondTest p V X a b testNegative = fixedSecondTest p V X (a-b) 0 testNegative := by funext N simp only [fixedSecondTest, sub_zero] simp only [childEnergy, he] theorem densityChildEnergy_polynomial_bound (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ : ℝ) (J : ℕ) (B₁ B₂ : ℝ) (hB₁ : 0 ≤ B₁) (hB₂ : 0 ≤ B₂) (h₁ : ∀ a : ℝ, childEnergy p hp hcop hg F Ψ₁ m T V₁ X₁ true false a 0 ≤ B₁ * (1+‖a‖)^(2*J)) (h₂ : ∀ a : ℝ, childEnergy p hp hcop hg F Ψ₂ m T V₂ X₂ false true a 0 ≤ B₂ * (1+‖a‖)^(2*J)) : densityChildEnergy p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ (2*J) ≤ (Real.sqrt B₁ * Real.sqrt B₂) * (∫ t : ℝ, FirstPassCubeLabels.firstLogDensity 0 t)^3 := by let G := childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ have hc₁ := childEnergy_continuous p hp hcop hg F Ψ₁ m T V₁ X₁ true false (fun q : Frequency => q.1) (fun q : Frequency => q.2.2) continuous_fst continuous_snd.snd have hc₂ := childEnergy_continuous p hp hcop hg F Ψ₂ m T V₂ X₂ false true (fun q : Frequency => q.2.1) (fun q : Frequency => q.2.2) continuous_snd.fst continuous_snd.snd have hG : Continuous G := (Real.continuous_sqrt.comp hc₁).mul (Real.continuous_sqrt.comp hc₂) have hG0 : ∀ q, 0 ≤ G q := fun q => mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) let M := Real.sqrt (energyMagnitude p hp hcop hg F Ψ₁ m T V₁ X₁ true false) * Real.sqrt (energyMagnitude p hp hcop hg F Ψ₂ m T V₂ X₂ false true) have hM : ∀ q, G q ≤ M := by intro q dsimp [G, childGeometricMean, M] gcongr · exact childEnergy_le p hp hcop hg F Ψ₁ m T V₁ X₁ true false q.1 q.2.2 · exact childEnergy_le p hp hcop hg F Ψ₂ m T V₂ X₂ false true q.2.1 q.2.2 have hsqrt (B a e : ℝ) (hB : 0 ≤ B) (he : e ≤ B*(1+‖a‖)^(2*J)) : Real.sqrt e ≤ Real.sqrt B * (1+‖a‖)^J := by calc _ ≤ Real.sqrt (B*(1+‖a‖)^(2*J)) := Real.sqrt_le_sqrt he _ = _ := by rw [Real.sqrt_mul hB, mul_comm 2 J, pow_mul, Real.sqrt_sq (by positivity)] have hbound (q : Frequency) : G q ≤ (Real.sqrt B₁ * Real.sqrt B₂) * (1+‖q.1‖)^(2*J)*(1+‖q.2.1‖)^(2*J)*(1+‖q.2.2‖)^(2*J) := by have hleft := h₁ (q.1-q.2.2) have hright := h₂ (q.2.1-q.2.2) rw [← childEnergy_eq_difference p hp hcop hg F Ψ₁ m T V₁ X₁ q.1 q.2.2 true false] at hleft rw [← childEnergy_eq_difference p hp hcop hg F Ψ₂ m T V₂ X₂ q.2.1 q.2.2 false true] at hright calc _ ≤ (Real.sqrt B₁ * (1+‖q.1-q.2.2‖)^J) * (Real.sqrt B₂ * (1+‖q.2.1-q.2.2‖)^J) := mul_le_mul (hsqrt B₁ _ _ hB₁ hleft) (hsqrt B₂ _ _ hB₂ hright) (Real.sqrt_nonneg _) (by positivity) _ = (Real.sqrt B₁ * Real.sqrt B₂) * ((1+‖q.1-q.2.2‖)^J * (1+‖q.2.1-q.2.2‖)^J) := by ring _ ≤ _ := by have hh := mul_le_mul_of_nonneg_left (difference_height_weight_le q.1 q.2.1 q.2.2 J) (mul_nonneg (Real.sqrt_nonneg B₁) (Real.sqrt_nonneg B₂)) simpa only [mul_assoc] using hh exact triple_density_polynomial_bound G hG hG0 M hM (2*J) (Real.sqrt B₁ * Real.sqrt B₂) hbound end SecondPassIntegration open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open FirstCauchyArithmetic (supportMobius) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) def residualPairWeight (Ψ₁ Ψ₂ : O →* ℂ) (m c d : O) (H₁ H₂ : Finset ι → ℂ) (S T : Finset ι) : ℂ := star (supportMobius (fun i => Ideal.span {p i}) S * secondInputCoefficient p hg Ψ₁ m c d H₁ S) * (supportMobius (fun i => Ideal.span {p i}) T * secondInputCoefficient p hg Ψ₂ m c d H₂ T) theorem residualSecondMode_tail_eq (F G : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m c d : O) (H₁ H₂ : Finset ι → ℂ) (e : O) (he : e ≠ 0) (W : 𝓢(ℝ, ℂ)) (Y : ℝ) (hY : 0 < Y) (K : Finset O) : (∑' k : {k : O // k ∉ K}, residualSecondMode p hp hg hinj F G Ψ₁ Ψ₂ m c d H₁ H₂ e k.val W Y) = ∑ S ∈ (F\G).powerset, ∑ T ∈ (F\G).powerset, if Disjoint S T then residualPairWeight p hg Ψ₁ Ψ₂ m c d H₁ H₂ S T * ∑' k : {k : O // k ∉ K}, secondPairRadialMode p hp hg hinj S T e k.val W Y else 0 := by have hs (S T : Finset ι) : Summable (fun k : {k : O // k ∉ K} => if Disjoint S T then residualPairWeight p hg Ψ₁ Ψ₂ m c d H₁ H₂ S T * secondPairRadialMode p hp hg hinj S T e k.val W Y else 0) := by by_cases hd : Disjoint S T · simp only [if_pos hd] exact ((secondPairRadialMode_summable p hp hg hinj S T e he W Y hY).subtype _).mul_left _ · simp only [if_neg hd] exact summable_zero change (∑' k : {k : O // k ∉ K}, ∑ S ∈ (F\G).powerset, ∑ T ∈ (F\G).powerset, if Disjoint S T then residualPairWeight p hg Ψ₁ Ψ₂ m c d H₁ H₂ S T * secondPairRadialMode p hp hg hinj S T e k.val W Y else 0) = _ rw [Summable.tsum_finsetSum (fun S _ => summable_sum (fun T _ => hs S T))] apply Finset.sum_congr rfl intro S hS rw [Summable.tsum_finsetSum (fun T _ => hs S T)] apply Finset.sum_congr rfl intro T hT by_cases hd : Disjoint S T · simp only [if_pos hd, tsum_mul_left] · simp [hd] def residualTailCost (F G : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m c d : O) (H₁ H₂ : Finset ι → ℂ) (e : O) (Y H : ℝ) (A : ℕ) (P : ℝ) : ℝ := ∑ S ∈ (F\G).powerset, ∑ T ∈ (F\G).powerset, if Disjoint S T then let n := ∏ i : activeSupport T S, p i.val let scale := Y / (‖eisEmbedding e‖^2 * ‖eisEmbedding n‖^2) ‖residualPairWeight p hg Ψ₁ Ψ₂ m c d H₁ H₂ S T‖ * ((Y/‖eisEmbedding n‖) * (P / ((min 1 scale)^2 * (1+H)^A))) else 0 end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem primeProductNorm_eq_ideal_norm (S : Finset ι) : primeProductNorm p S = (Ideal.absNorm (∏ i ∈ S, Ideal.span {p i}) : ℝ) := by rw [primeProductNorm, ActualEisensteinCubic.eisEmbedding_norm_sq_eq_absNorm_span, FiniteGaussPhase.span_finset_prod] include hp in omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem primeProductNorm_ge_one (S : Finset ι) : 1 ≤ primeProductNorm p S := by rw [primeProductNorm, ActualEisensteinCubic.eisEmbedding_norm_sq_eq_absNorm_span] exact_mod_cast Nat.one_le_iff_ne_zero.mpr (show Ideal.absNorm (Ideal.span {∏ i ∈ S, p i}) ≠ 0 by rw [ne_eq, Ideal.absNorm_eq_zero_iff, Ideal.span_singleton_eq_bot] exact Finset.prod_ne_zero_iff.mpr (fun i hi => hp i)) include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem primeProductNorm_mono {S T : Finset ι} (hST : S ⊆ T) : primeProductNorm p S ≤ primeProductNorm p T := by have hd : Disjoint S (T\S) := Finset.disjoint_sdiff have hu : S ∪ (T\S) = T := Finset.union_sdiff_of_subset hST rw [← hu, FirstPassCubeLabels.primeProductNorm_union p S (T\S) hd] exact le_mul_of_one_le_right (FirstPassCubeLabels.primeProductNorm_pos p hp S).le (primeProductNorm_ge_one p hp _) def boundedPrimeSupports (F : Finset ι) (X : ℝ) : Finset (Finset ι) := F.powerset.filter (fun S => primeProductNorm p S ≤ X) include hinj in theorem boundedPrimeSupports_card (F : Finset ι) (X : ℝ) (hX : 1 ≤ X) : ((boundedPrimeSupports p F X).card : ℝ) ≤ 128*X := by let q : Finset ι → Ideal O := fun S => ∏ i ∈ S, Ideal.span {p i} have hq : Function.Injective q := FirstCauchyArithmetic.family_product_injective _ hinj let I := (boundedPrimeSupports p F X).image q have hcard : I.card = (boundedPrimeSupports p F X).card := Finset.card_image_of_injective _ hq rw [← hcard] apply DescentFiberCost.finite_ideal_count_real I X hX · intro J hJ obtain ⟨S,hS,rfl⟩ := Finset.mem_image.mp hJ exact Finset.prod_ne_zero_iff.mpr (fun i hi => NeZero.ne (Ideal.span {p i})) · intro J hJ obtain ⟨S,hS,rfl⟩ := Finset.mem_image.mp hJ rw [← primeProductNorm_eq_ideal_norm p S] exact (Finset.mem_filter.mp hS).2 include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem normalizedColumn_subset_norm_bound (g : 𝓢(ℝ, ℂ)) (A X : ℝ) (hX : 0 < X) (hgA : ∀ t, g t ≠ 0 → |t| ≤ A) (G S U : Finset ι) (hU : U ⊆ G∪S) (hn : FirstPassCubeLabels.normalizedColumn p (fun R => g (FirstPassCubeLabels.columnLog p X R)) (G∪S) ≠ 0) : primeProductNorm p U ≤ X*Real.exp A := by have hval : g (FirstPassCubeLabels.columnLog p X (G∪S)) ≠ 0 := by intro h apply hn simp only [FirstPassCubeLabels.normalizedColumn,h,zero_div] exact (primeProductNorm_mono p hp hU).trans (columnLog_norm_upper p hp X A hX (G∪S) ((le_abs_self _).trans (hgA _ hval))) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.SpatialDerivatives namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson theorem column_sqrt_ratio_bounds (N n : ℝ) (hN : 0 < N) (hn : N / 2 ≤ n ∧ n ≤ N) : 1 / 4 ≤ Real.sqrt (n / N) ∧ Real.sqrt (n / N) ≤ 2 := by have hq0 : 0 ≤ n / N := div_nonneg (by linarith) hN.le have hq1 : (1 / 2 : ℝ) ≤ n / N := (le_div_iff₀ hN).mpr (by linarith) have hq2 : n / N ≤ 1 := (div_le_one hN).mpr hn.2 have hs := Real.sq_sqrt hq0 have hp := Real.sqrt_nonneg (n / N) constructor <;> nlinarith theorem dual_middle_sqrt_identity (M B b N i j F : ℝ) (hM : 0 < M) (hB : 0 < B) (hb : 0 < b) (hN : 0 < N) (hi : 0 < i) (hj : 0 < j) (hF : 0 < F) : N * Real.sqrt (F / (M * B)) * Real.sqrt (B / b) * Real.sqrt (i / N) * Real.sqrt (j / N) = Real.sqrt (F * i * j / (M * b)) := by apply (sq_eq_sq₀ (by positivity) (Real.sqrt_nonneg _)).mp simp only [mul_pow, Real.sq_sqrt (show 0 ≤ F / (M * B) by positivity), Real.sq_sqrt (show 0 ≤ B / b by positivity), Real.sq_sqrt (show 0 ≤ i / N by positivity), Real.sq_sqrt (show 0 ≤ j / N by positivity), Real.sq_sqrt (show 0 ≤ F * i * j / (M * b) by positivity)] field_simp theorem dual_middle_argument (M B b N i j F D₁ d D₂ e q : ℝ) (hM : 0 < M) (hB : 0 < B) (hb : B / 2 ≤ b ∧ b ≤ B) (hN : 0 < N) (hi : N / 2 ≤ i ∧ i ≤ N) (hj : N / 2 ≤ j ∧ j ≤ N) (hF : 0 < F) (hD₁ : 0 < D₁) (hd : D₁ ≤ d ∧ d ≤ 2 * D₁) (hD₂ : 0 < D₂) (he : D₂ ≤ e ∧ e ≤ 2 * D₂) : (N * Real.sqrt (F / (M * B)) * q / (D₁ * D₂)) * Real.exp (Real.log (middleRatio B b D₁ d D₂ e) + (Real.log (Real.sqrt (i / N)) + Real.log (Real.sqrt (j / N)))) = Real.sqrt (F * i * j / (M * b)) * q / (d * e) := by have hb0 : 0 < b := by linarith have hi0 : 0 < i := by linarith have hj0 : 0 < j := by linarith have hd0 : 0 < d := hD₁.trans_le hd.1 have he0 : 0 < e := hD₂.trans_le he.1 have hr : 0 < middleRatio B b D₁ d D₂ e := by have hh := middleRatio_bounds B b D₁ d D₂ e hB hb hD₁ hd hD₂ he linarith rw [Real.exp_add, Real.exp_add, Real.exp_log hr, Real.exp_log (Real.sqrt_pos.mpr (div_pos hi0 hN)), Real.exp_log (Real.sqrt_pos.mpr (div_pos hj0 hN))] unfold middleRatio calc _ = (N * Real.sqrt (F / (M * B)) * Real.sqrt (B / b) * Real.sqrt (i / N) * Real.sqrt (j / N)) * q / (d * e) := by field_simp _ = _ := by rw [dual_middle_sqrt_identity M B b N i j F hM hB hb0 hN hi0 hj0 hF] theorem actual_dual_middle_radial_block_bound (W : 𝓢(ℝ, ℂ)) (A : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M F : ℝ) (_hD₁ : 1 ≤ D₁) (_hD₂ : 1 ≤ D₂) (_hB : 1 ≤ B) (_hN : 1 ≤ N) (_hM : 0 < M) (_hF : 0 < F) (_hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (_hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (_hr : Function.Injective rows) (_hl : Function.Injective left) (_hri : Function.Injective right) (_hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (_hleft : ∀ j, Admissible (left j) ∧ N / 2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (_hright : ∀ k, Admissible (right k) ∧ N / 2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (h : O), h ≠ 0 → (1 + N * Real.sqrt (F / (M * B)) * ‖eisEmbedding h‖ ^ 2 / (D₁ * D₂)) ^ A * (∑ D : S, ∑ E : T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D.val E.val i j k * paperRadialFourier W (Real.sqrt (F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ))) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ)))‖) ≤ C * Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N a b) := by obtain ⟨C, hC, hb⟩ := canonical_original_radial_divisor_block_bound W 4 4 4 (by norm_num) (by norm_num) (by norm_num) A refine ⟨C, hC, ?_⟩ intro m n p _ _ _ _ _ _ ε hε S T D₁ D₂ B N M F hD₁ hD₂ hB hN hM hF hS hT rows left right hr hl hri hrows hleft hright a b h hh have hD₁0 : 0 < D₁ := by linarith have hD₂0 : 0 < D₂ := by linarith have hB0 : 0 < B := by linarith have hN0 : 0 < N := by linarith let R := N * Real.sqrt (F / (M * B)) * ‖eisEmbedding h‖ ^ 2 / (D₁ * D₂) have hR : 0 < R := div_pos (mul_pos (mul_pos hN0 (Real.sqrt_pos.mpr (by positivity))) (sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hh)))) (mul_pos hD₁0 hD₂0) let x : S → T → m → ℝ := fun D E i => Real.log (middleRatio B (Ideal.absNorm (rows i)) D₁ (Ideal.absNorm D.val) D₂ (Ideal.absNorm E.val)) let y : n → ℝ := fun j => Real.log (Real.sqrt ((Ideal.absNorm (left j) : ℝ) / N)) let z : p → ℝ := fun k => Real.log (Real.sqrt ((Ideal.absNorm (right k) : ℝ) / N)) have hx (D : S) (E : T) (i : m) : |x D E i| ≤ 4 := middleRatio_log_bound _ (middleRatio_bounds _ _ _ _ _ _ hB0 (hrows i).2 hD₁0 (hS D.val D.property) hD₂0 (hT E.val E.property)) have hy (j : n) : |y j| ≤ 4 := middleRatio_log_bound _ (column_sqrt_ratio_bounds N _ hN0 (hleft j).2) have hz (k : p) : |z k| ≤ 4 := middleRatio_log_bound _ (column_sqrt_ratio_bounds N _ hN0 (hright k).2) have he := hb R hR ε hε S T D₁ D₂ B N hD₁ hD₂ hN hS hT rows left right hr hl hri (fun i => ⟨(hrows i).1, (hrows i).2.2⟩) (fun j => ⟨(hleft j).1, (hleft j).2.2⟩) (fun k => ⟨(hright k).1, (hright k).2.2⟩) a b x y z hx hy hz have harg (D : S) (E : T) (i : m) (j : n) (k : p) : R * Real.exp (x D E i + (y j + z k)) = Real.sqrt (F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ))) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ)) := dual_middle_argument _ _ _ _ _ _ _ _ _ _ _ _ hM hB0 (hrows i).2 hN0 (hleft j).2 (hright k).2 hF hD₁0 (hS D.val D.property) hD₂0 (hT E.val E.property) simpa only [harg, R] using he theorem principal_middle_prefactor_bound (M B b D₁ d D₂ e : ℝ) (hM : 0 < M) (hB : 0 < B) (hb : B / 2 ≤ b) (hD₁ : 0 < D₁) (hd : D₁ ≤ d) (hD₂ : 0 < D₂) (he : D₂ ≤ e) : Real.sqrt (M / b) / (d * e) ≤ 2 * Real.sqrt (M / B) / (D₁ * D₂) := by have hb0 : 0 < b := by linarith have hd0 : 0 < d := hD₁.trans_le hd have he0 : 0 < e := hD₂.trans_le he have hq : M / b ≤ 4 * (M / B) := by calc _ ≤ (4 * M) / B := (div_le_div_iff₀ hb0 hB).mpr (by nlinarith [mul_nonneg hM.le (show 0 ≤ 4 * b - B by linarith)]) _ = _ := by ring have hs : Real.sqrt (M / b) ≤ 2 * Real.sqrt (M / B) := by have hh := Real.sqrt_le_sqrt hq rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 4)] at hh have hs4 : Real.sqrt (4 : ℝ) = 2 := by simpa only [show (2 : ℝ) ^ 2 = 4 by norm_num] using Real.sqrt_sq (show (0 : ℝ) ≤ 2 by norm_num) rw [hs4] at hh exact hh calc _ ≤ (2 * Real.sqrt (M / B)) / (d * e) := div_le_div_of_nonneg_right hs (mul_pos hd0 he0).le _ ≤ _ := div_le_div_of_nonneg_left (by positivity) (mul_pos hD₁ hD₂) (mul_le_mul hd he hD₂.le hd0.le) theorem principal_middle_prefactor_sum {m : Type*} [Fintype m] (S T : Finset (Ideal O)) (rows : m → Ideal O) (f : S → T → m → ℝ) (hf : ∀ D E i, 0 ≤ f D E i) (M B D₁ D₂ : ℝ) (hM : 0 < M) (hB : 0 < B) (hD₁ : 0 < D₁) (hD₂ : 0 < D₂) (hrows : ∀ i, B / 2 ≤ (Ideal.absNorm (rows i) : ℝ)) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ)) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ)) : (∑ D : S, ∑ E : T, ∑ i, (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ))) * f D E i) ≤ (2 * Real.sqrt (M / B) / (D₁ * D₂)) * ∑ D : S, ∑ E : T, ∑ i, f D E i := by simp only [Finset.mul_sum] apply Finset.sum_le_sum intro D _ apply Finset.sum_le_sum intro E _ apply Finset.sum_le_sum intro i _ apply mul_le_mul_of_nonneg_right _ (hf D E i) exact principal_middle_prefactor_bound M B _ D₁ _ D₂ _ hM hB (hrows i) hD₁ (hS D.val D.property) hD₂ (hT E.val E.property) theorem dual_principal_prefactor_identity (M F b i j : ℝ) (hM : 0 < M) (hF : 0 < F) (hb : 0 < b) (hi : 0 < i) (hj : 0 < j) : (M / (Real.sqrt (i * j) * F)) * Real.sqrt (F * i * j / (M * b)) = Real.sqrt ((M / F) / b) := by apply (sq_eq_sq₀ (by positivity) (Real.sqrt_nonneg _)).mp simp only [mul_pow, div_pow, Real.sq_sqrt (show 0 ≤ i * j by positivity), Real.sq_sqrt (show 0 ≤ F * i * j / (M * b) by positivity), Real.sq_sqrt (show 0 ≤ (M / F) / b by positivity)] field_simp variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] variable (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a : n → ℂ) (b : p → ℂ) (h : O) (hh : h ≠ 0) include hD₁ hD₂ hB hN hM hS hT hr hl hri hrows hh end CanonicalQuadraticSieve open Filter open scoped BigOperators Classical Topology namespace CubicEisenstein lemma abs_le_inv_of_mul_sq_le_one {v t : ℝ} (hv : 0 f (Function.update p j t) def spatialLogD (A B C D : ℝ) (p : SpatialCoordinates) : Fin 3 → ℝ := ![heightLogDx A B C D (p 0) (p 1) (p 2), heightLogDy A B C D (p 0) (p 1) (p 2), heightLogDv A B C D (p 0) (p 1) (p 2)] def spatialLogDD (A B C D : ℝ) (p : SpatialCoordinates) : Fin 3 → ℝ := ![heightLogDxx A B C D (p 0) (p 1) (p 2), heightLogDyy A B C D (p 0) (p 1) (p 2), heightLogDvv A B C D (p 0) (p 1) (p 2)] lemma spatial_axis_hasDerivAt (s : ℂ) (A B C D : ℝ) (p : SpatialCoordinates) (j : Fin 3) (hv : p 2≠0) (hq : quadraticHeightDenominator A B C D (p 0) (p 1) (p 2)≠0) : HasDerivAt (axisSlice (fun q => spatialHeightPower s A B C D (q 0) (q 1) (q 2)) p j) (spatialHeightPower s A B C D (p 0) (p 1) (p 2)*s*(spatialLogD A B C D p j:ℂ)) (p j) := by unfold axisSlice fin_cases j · have h := hasDerivAt_logRatioPower s (hasDerivAt_const (p 0) (p 2)) (quadraticHeightDenominator_hasDerivAt_x A B C D (p 0) (p 1) (p 2)) hv hq simpa [axisSlice,Function.update,spatialHeightPower,spatialLogD,heightLogDx] using h · have h := hasDerivAt_logRatioPower s (hasDerivAt_const (p 1) (p 2)) (quadraticHeightDenominator_hasDerivAt_y A B C D (p 0) (p 1) (p 2)) hv hq simpa [axisSlice,Function.update,spatialHeightPower,spatialLogD,heightLogDy] using h · have h := hasDerivAt_logRatioPower s (hasDerivAt_id (p 2)) (quadraticHeightDenominator_hasDerivAt_v A B C D (p 0) (p 1) (p 2)) hv hq simpa [axisSlice,Function.update,spatialHeightPower,spatialLogD,heightLogDv] using h lemma spatial_axis_hasDerivAt_deriv (s : ℂ) (A B C D : ℝ) (p : SpatialCoordinates) (j : Fin 3) (hv : p 2≠0) (hq : quadraticHeightDenominator A B C D (p 0) (p 1) (p 2)≠0) : HasDerivAt (deriv (axisSlice (fun q => spatialHeightPower s A B C D (q 0) (q 1) (q 2)) p j)) (spatialHeightPower s A B C D (p 0) (p 1) (p 2)* (s^2*(spatialLogD A B C D p j:ℂ)^2+s*(spatialLogDD A B C D p j:ℂ))) (p j) := by unfold axisSlice fin_cases j · have h := hasDerivAt_deriv_logRatioPower s (fun _ => p 2) (fun t => quadraticHeightDenominator A B C D t (p 1) (p 2)) (fun _ => 0) (fun t => 2*(A*t+B)) (p 0) 0 (2*A) (fun t => hasDerivAt_const t (p 2)) (fun t => quadraticHeightDenominator_hasDerivAt_x A B C D t (p 1) (p 2)) (hasDerivAt_const (p 0) 0) (by simpa only [id_eq,mul_one] using ((hasDerivAt_id (p 0)).const_mul A |>.add_const B).const_mul 2) hv hq simpa [axisSlice,Function.update,spatialHeightPower,spatialLogD,spatialLogDD,heightLogDx,heightLogDxx] using h · have h := hasDerivAt_deriv_logRatioPower s (fun _ => p 2) (fun t => quadraticHeightDenominator A B C D (p 0) t (p 2)) (fun _ => 0) (fun t => 2*(A*t+C)) (p 1) 0 (2*A) (fun t => hasDerivAt_const t (p 2)) (fun t => quadraticHeightDenominator_hasDerivAt_y A B C D (p 0) t (p 2)) (hasDerivAt_const (p 1) 0) (by simpa only [id_eq,mul_one] using ((hasDerivAt_id (p 1)).const_mul A |>.add_const C).const_mul 2) hv hq simpa [axisSlice,Function.update,spatialHeightPower,spatialLogD,spatialLogDD,heightLogDy,heightLogDyy] using h · have h := hasDerivAt_deriv_logRatioPower s (fun t => t) (fun t => quadraticHeightDenominator A B C D (p 0) (p 1) t) (fun _ => 1) (fun t => 2*A*t) (p 2) 0 (2*A) (fun t => hasDerivAt_id t) (fun t => quadraticHeightDenominator_hasDerivAt_v A B C D (p 0) (p 1) t) (hasDerivAt_const (p 2) 1) (by simpa only [id_eq,mul_one] using (hasDerivAt_id (p 2)).const_mul (2*A)) hv hq simpa [axisSlice,Function.update,spatialHeightPower,spatialLogD,spatialLogDD,heightLogDv,heightLogDvv,div_eq_mul_inv] using h def rowSmoothPower (s : ℂ) (u : Fin 2 → ℂ) (p : SpatialCoordinates) : ℂ := spatialHeightPower s (Complex.normSq (u 0)) ((u 0*star (u 1)).re) (-(u 0*star (u 1)).im) (Complex.normSq (u 1)) (p 0) (p 1) (p 2) def rowLogD (u : Fin 2 → ℂ) (p : SpatialCoordinates) (j : Fin 3) : ℝ := spatialLogD (Complex.normSq (u 0)) ((u 0*star (u 1)).re) (-(u 0*star (u 1)).im) (Complex.normSq (u 1)) p j def rowLogDD (u : Fin 2 → ℂ) (p : SpatialCoordinates) (j : Fin 3) : ℝ := spatialLogDD (Complex.normSq (u 0)) ((u 0*star (u 1)).re) (-(u 0*star (u 1)).im) (Complex.normSq (u 1)) p j lemma row_denominator_pos (u : Fin 2 → ℂ) (hu : u≠0) (p : SpatialCoordinates) (hv : 0

simp only [rowLogD,spatialLogD,] · exact h.1 · exact h.2.1 · exact h.2.2 lemma rowLogDD_bound (u : Fin 2 → ℂ) (hu : u≠0) (p : SpatialCoordinates) (hv : 0

simp only [rowLogDD,spatialLogDD,] · exact h.1 · exact h.2.1 · exact h.2.2 lemma row_axis_hasDerivAt (s : ℂ) (u : Fin 2 → ℂ) (hu : u≠0) (p : SpatialCoordinates) (hv : 0

f i x)) : HasDerivAt (deriv (fun y => ∑'i,f i y)) (∑'i,deriv (deriv (f i)) x) x := by have hfirstSum (y : ℝ) (hy : y∈U) := hasDerivAt_tsum_of_isPreconnected hM₁ hU hUc (fun i z hz => (hfirst i z hz).hasDerivAt) hbound₁ hx hsum hy have hsumFirst : Summable (fun i => deriv (f i) x) := Summable.of_norm_bounded hM₁ (fun i => hbound₁ i x hx) have hsecondSum := hasDerivAt_tsum_of_isPreconnected hM₂ hU hUc (fun i z hz => (hsecond i z hz).hasDerivAt) hbound₂ hx hsumFirst hx apply hsecondSum.congr_of_eventuallyEq filter_upwards [hU.mem_nhds hx] with y hy exact (hfirstSum y hy).deriv lemma norm_row_axis_deriv (s : ℂ) (u : Fin 2 → ℂ) (hu : u≠0) (p : SpatialCoordinates) (hv : 0

(cosetCharacter r)⁻¹ * axisSlice (rowSmoothPower s (embeddedRow r)) p j t)) (p j) rw [deriv_const_mul_field'] exact ((row_axis_hasDerivAt_deriv s (embeddedRow r) (embeddedRow_ne_zero r) p hv j).const_mul _).differentiableAt lemma norm_smooth_axis_deriv (s : ℂ) (r : CuspCosets) (p : SpatialCoordinates) (hv : 0

Function.update p j t) := by apply continuous_pi intro k by_cases h : k=j · subst k simp only [Function.update_self] fun_prop · simpa only [Function.update_of_ne h] using (continuous_const : Continuous (fun _ : ℝ => p k)) lemma smoothSummand_eq_clamped (s : ℂ) (r : CuspCosets) (p : SpatialCoordinates) (deltaLoss : ℝ) (hδ : 0 clampedCoordinates deltaLoss hδ (Function.update p j t) have hpath : Continuous path := (continuous_clampedCoordinates deltaLoss hδ).comp (continuous_axis_update p j) let C := rowBound (coordinateSection (path (p j)))+1 have hC : 0 M r*c₁,fun r => M r*c₂,hM,hM.mul_right _,hM.mul_right _,?_⟩ intro t ht obtain ⟨hht,hbt⟩ := hball t ht have hpos : 0 < (Function.update p j t) 2 := lt_trans hδ hht refine ⟨hpos,fun r => ?_⟩ have hm : ‖smoothSummand s r (Function.update p j t)‖≤M r := by rw [smoothSummand_eq_clamped s r _ deltaLoss hδ hht.le] exact hbound (path t,s) hbt.le le_rfl le_rfl r have hfrac : 1 / (Function.update p j t) 2 ≤ 1/deltaLoss := one_div_le_one_div_of_le hδ hht.le have hfrac₂ : 7 / ((Function.update p j t) 2)^2 ≤ 7/deltaLoss^2 := by apply div_le_div_of_nonneg_left (by norm_num) (sq_pos_of_pos hδ) nlinarith have hd₁ := norm_smooth_axis_deriv s r (Function.update p j t) hpos j have hd₂ := norm_smooth_axis_deriv2 s r (Function.update p j t) hpos j rw [smoothSummand_axis_update,Function.update_self] at hd₁ hd₂ refine ⟨hm,hd₁.trans ?_,hd₂.trans ?_⟩ · apply mul_le_mul hm _ (by positivity) (hMnonneg r) exact mul_le_mul_of_nonneg_left hfrac (norm_nonneg s) · apply mul_le_mul hm _ (by positivity) (hMnonneg r) dsimp [c₂] gcongr lemma smooth_axis_differentiable_at (s : ℂ) (r : CuspCosets) (p : SpatialCoordinates) (j : Fin 3) (t : ℝ) (hv : 0<(Function.update p j t) 2) : DifferentiableAt ℝ (axisSlice (smoothSummand s r) p j) t := by have h := smooth_axis_differentiable s r (Function.update p j t) hv j simpa only [smoothSummand_axis_update,Function.update_self] using h lemma smooth_axis_deriv_differentiable_at (s : ℂ) (r : CuspCosets) (p : SpatialCoordinates) (j : Fin 3) (t : ℝ) (hv : 0<(Function.update p j t) 2) : DifferentiableAt ℝ (deriv (axisSlice (smoothSummand s r) p j)) t := by have h := smooth_axis_deriv_differentiable s r (Function.update p j t) hv j simpa only [smoothSummand_axis_update,Function.update_self] using h end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.FirstCoreCutoff namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm) open ConcreteTraceCRT (eisEmbedding) def firstCoreSecondCutoff {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (D : Finset ι) (X Y A H : ℝ) (G E : Finset ι) : Finset O := secondFrequencyCutoff (Y / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖ ^ 2 * (((X / primeProductNorm p D) / primeProductNorm p G) * Real.exp A)^2)) H theorem firstCoreSecondCutoff_zero {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (D : Finset ι) (X Y A H : ℝ) (G E : Finset ι) : (0 : O) ∈ firstCoreSecondCutoff p D X Y A H G E := secondFrequencyCutoff_zero _ _ theorem firstCoreSecondCutoff_uniform {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (g V : 𝓢(ℝ, ℂ)) (negative : Bool) (t A : ℝ) (hgA : ∀ s, g s ≠ 0 → |s| ≤ A) (D G E S T : Finset ι) (hGS : Disjoint G S) (hGT : Disjoint G T) (hST : Disjoint S T) (X Y H : ℝ) (hX : 0 < X) (hY : 0 < Y) (hS : normalizedColumn p (fun A => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) A)) (G∪S) ≠ 0) (hT : normalizedColumn p (fun A => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) A)) (G∪T) ≠ 0) (k : O) (hk : k ∉ firstCoreSecondCutoff p D X Y A H G E) : H ≤ (Y / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖^2 * ‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖^2)) * ‖eisEmbedding k‖^2 := by have hXD : 0 < X / primeProductNorm p D := div_pos hX (FirstPassCubeLabels.primeProductNorm_pos p hp D) have hXG : 0 < (X / primeProductNorm p D) / primeProductNorm p G := div_pos hXD (FirstPassCubeLabels.primeProductNorm_pos p hp G) have hSup (S : Finset ι) (hGS : Disjoint G S) (hS : normalizedColumn p (fun A => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) A)) (G∪S) ≠ 0) : columnLog p ((X / primeProductNorm p D) / primeProductNorm p G) S ≤ A := by have hs : firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) (G∪S)) ≠ 0 := by intro hz apply hS simp only [normalizedColumn, hz, zero_div] have ha := hgA _ (firstCoreModeProfile_support g V negative t _ hs).1 rw [SecondPassIntegration.columnLog_extract_common p hp G S hGS _ hXD] at ha exact le_trans (le_abs_self _) ha exact secondFrequencyCutoff_uniform p hp ((X / primeProductNorm p D) / primeProductNorm p G) Y A H hXG hY (primeSubsetGenerator (fun i => Ideal.span {p i}) E) (primeSubsetGenerator_ne_zero _ _) S T hST (hSup S hGS hS) (hSup T hGT hT) k hk end section open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff FourierTransform section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open FirstPassCubeLabels (columnLog normalizedColumn jLabel b0Label firstLogDensity) open JointLogSeparation (halfNormalizationCLM halfNormalizationCLM_apply halfNormalization_twist frequencyTwist frequencyTwist_apply outerWindow tripleCoefficient) open SecondPassIntegration (childGeometricMean) end section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open FirstPassCubeLabels (columnLog normalizedColumn jLabel b0Label firstLogDensity) open JointLogSeparation (halfNormalizationCLM halfNormalizationCLM_apply halfNormalization_twist frequencyTwist frequencyTwist_apply outerWindow tripleCoefficient) open SecondPassIntegration (childGeometricMean densityChildEnergy child_coefficient_density_bound) end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open FirstPassCubeLabels (columnLog normalizedColumn jLabel b0Label firstLogDensity) open JointLogSeparation (tripleCoefficient frequencyTwist frequencyTwist_apply) open SecondPassIntegration (childGeometricMean densityChildEnergy) end open JointLogSeparation (frequencyTwist frequencyTwist_apply) end SecondPassArithmetic open scoped BigOperators Classical namespace CanonicalQuadraticSieve def HasSieveExponent (α : ℝ) : Prop := ∀ ε : ℝ, 0 < ε → ∃ C : ℝ, 0 < C ∧ ∀ M N : ℝ, 1 ≤ M → 1 ≤ N → sieveNorm M N ≤ C * (M * N) ^ ε * (M + N ^ α) theorem hasSieveExponent_two : HasSieveExponent 2 := by intro ε hε let C := QuadraticInitialBound.initialSieveConstant have hC : 0 < C := QuadraticInitialBound.initialSieveConstant_pos refine ⟨4 * C, by positivity, ?_⟩ intro M N hM hN have hc : (⌈N⌉₊ : ℝ) ≤ 2 * N := by have h := Nat.ceil_lt_add_one (show 0 ≤ N by linarith) linarith have hc2 : (⌈N⌉₊ : ℝ) ^ 2 ≤ 4 * N ^ 2 := by nlinarith [Nat.cast_nonneg (α := ℝ) ⌈N⌉₊] have hmn : 1 ≤ M * N := by nlinarith [mul_le_mul hM hN (by norm_num : (0 : ℝ) ≤ 1) (show 0 ≤ M by linarith)] have he : 1 ≤ (M * N) ^ ε := Real.one_le_rpow hmn hε.le rw [Real.rpow_two] calc _ ≤ C * (M + (⌈N⌉₊ : ℝ) ^ 2) := sieveNorm_initial M N hM hN _ ≤ 4 * C * (M + N ^ 2) := by nlinarith _ ≤ (4 * C) * (M * N) ^ ε * (M + N ^ 2) := by nlinarith [show 0 ≤ (4 * C) * (M + N ^ 2) by positivity] theorem HasSieveExponent.reverse {α : ℝ} (h : HasSieveExponent α) : ∀ ε : ℝ, 0 < ε → ∃ C : ℝ, 0 < C ∧ ∀ M N : ℝ, 1 ≤ M → 1 ≤ N → sieveNorm M N ≤ C * (M * N) ^ ε * (N + M ^ α) := by intro ε hε obtain ⟨C, hC, hb⟩ := h ε hε refine ⟨262144 * C, by positivity, ?_⟩ intro M N hM hN calc _ ≤ 262144 * sieveNorm N M := sieveNorm_reverse_le M N _ ≤ 262144 * (C * (N * M) ^ ε * (N + M ^ α)) := mul_le_mul_of_nonneg_left (hb N M hN hM) (by norm_num) _ = _ := by rw [mul_comm N M]; ring theorem sqrt_divisor_sieve_pair_le (M N D₁ D₂ Q C : ℝ) (hN : 0 ≤ N) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hQ : 0 ≤ Q) (hC : 0 ≤ C) (h₁ : sieveNorm M (N / D₁) ≤ C * (N / D₁ + Q)) (h₂ : sieveNorm M (N / D₂) ≤ C * (N / D₂ + Q)) : Real.sqrt (D₁ * D₂ * sieveNorm M (N / D₁) * sieveNorm M (N / D₂)) ≤ C * (N + Q * (D₁ * D₂)) := by have hD₁0 : 0 < D₁ := by linarith have hD₂0 : 0 < D₂ := by linarith have hD₁le : D₁ ≤ D₁ * D₂ := by nlinarith have hD₂le : D₂ ≤ D₁ * D₂ := by nlinarith apply Real.sqrt_le_iff.mpr refine ⟨by positivity, ?_⟩ calc _ ≤ D₁ * D₂ * (C * (N / D₁ + Q)) * (C * (N / D₂ + Q)) := by gcongr exact sieveNorm_nonneg _ _ _ = C ^ 2 * ((N + Q * D₁) * (N + Q * D₂)) := by field_simp _ ≤ C ^ 2 * ((N + Q * (D₁ * D₂)) * (N + Q * (D₁ * D₂))) := by gcongr _ = _ := by ring theorem HasSieveExponent.divisor_pair {α : ℝ} (h : HasSieveExponent α) : ∀ ε : ℝ, 0 < ε → ∃ C : ℝ, 0 < C ∧ ∀ M N D₁ D₂ : ℝ, 1 ≤ M → 1 ≤ N → 1 ≤ D₁ → 1 ≤ D₂ → D₁ ≤ N → D₂ ≤ N → Real.sqrt (D₁ * D₂ * sieveNorm M (N / D₁) * sieveNorm M (N / D₂)) ≤ C * (M * N) ^ ε * (N + M ^ α * (D₁ * D₂)) := by intro ε hε obtain ⟨C, hC, hb⟩ := h.reverse ε hε refine ⟨C, hC, ?_⟩ intro M N D₁ D₂ hM hN hD₁ hD₂ hD₁N hD₂N have hbound (D : ℝ) (hD : 1 ≤ D) (hDN : D ≤ N) : sieveNorm M (N / D) ≤ (C * (M * N) ^ ε) * (N / D + M ^ α) := by have hD0 : 0 < D := by linarith have hND : 1 ≤ N / D := (le_div_iff₀ hD0).mpr (by simpa using hDN) apply (hb M (N / D) hM hND).trans have hprod : M * (N / D) ≤ M * N := by apply mul_le_mul_of_nonneg_left _ (by linarith) exact div_le_self (by linarith) hD gcongr exact sqrt_divisor_sieve_pair_le M N D₁ D₂ (M ^ α) (C * (M * N) ^ ε) (by linarith) hD₁ hD₂ (Real.rpow_nonneg (by linarith) _) (by positivity) (hbound D₁ hD₁ hD₁N) (hbound D₂ hD₂ hD₂N) open IdealCoprimeSieveOperator DivisorBlockCauchy variable {n p : Type*} [Fintype n] [Fintype p] def divisorEnergyFactor (ε : ℝ) (hε : 0 < ε) (N : ℝ) (a : n → ℂ) (b : p → ℂ) : ℝ := 256 * (supportConstant ε hε * divisorConstant ε hε) * (N ^ ε) ^ 2 * Real.sqrt (∑ j, ‖a j‖ ^ 2) * Real.sqrt (∑ k, ‖b k‖ ^ 2) theorem divisorEnergyFactor_nonneg (ε : ℝ) (hε : 0 < ε) (N : ℝ) (a : n → ℂ) (b : p → ℂ) : 0 ≤ divisorEnergyFactor ε hε N a b := by have hs := (supportConstant_pos ε hε).le have hd := (divisorConstant_pos ε hε).le unfold divisorEnergyFactor positivity theorem divisorBlockCost_sqrt (ε : ℝ) (hε : 0 < ε) (D₁ D₂ M N : ℝ) (hD₁ : 0 ≤ D₁) (hD₂ : 0 ≤ D₂) (a : n → ℂ) (b : p → ℂ) : Real.sqrt (divisorBlockCost ε hε D₁ D₂ M N a b) = divisorEnergyFactor ε hε N a b * Real.sqrt (D₁ * D₂ * sieveNorm M (N / D₁) * sieveNorm M (N / D₂)) := by have hA := sieveNorm_nonneg M (N / D₁) have hB := sieveNorm_nonneg M (N / D₂) have hp : 0 ≤ D₁ * D₂ * sieveNorm M (N / D₁) * sieveNorm M (N / D₂) := by positivity have ha : 0 ≤ ∑ j, ‖a j‖ ^ 2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) have hb : 0 ≤ ∑ k, ‖b k‖ ^ 2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) have hc : 0 ≤ divisorBlockCost ε hε D₁ D₂ M N a b := by unfold divisorBlockCost positivity apply (sq_eq_sq₀ (Real.sqrt_nonneg _) (mul_nonneg (divisorEnergyFactor_nonneg ε hε N a b) (Real.sqrt_nonneg _))).mp rw [Real.sq_sqrt hc] simp only [divisorEnergyFactor, mul_pow, Real.sq_sqrt ha, Real.sq_sqrt hb, Real.sq_sqrt hp] unfold divisorBlockCost ring end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.SmoothSummands namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CubicEisenstein open Filter open scoped BigOperators Classical Topology Matrix def smoothEisenstein (s : ℂ) (p : SpatialCoordinates) : ℂ := ∑'r, smoothSummand s r p lemma smoothEisenstein_eq_actual (s : ℂ) (p : SpatialCoordinates) (hv : 0

smoothSummand_eq_actual s r p hv) theorem eisenstein_axis_termwise (s : ℂ) (hs : 2 deriv (axisSlice (smoothSummand s r) p j) (p j)) ∧ Summable (fun r => deriv (deriv (axisSlice (smoothSummand s r) p j)) (p j)) ∧ HasDerivAt (axisSlice (smoothEisenstein s) p j) (∑'r,deriv (axisSlice (smoothSummand s r) p j) (p j)) (p j) ∧ HasDerivAt (deriv (axisSlice (smoothEisenstein s) p j)) (∑'r,deriv (deriv (axisSlice (smoothSummand s r) p j)) (p j)) (p j) := by obtain ⟨ε,hε,M₀,M₁,M₂,hM₀,hM₁,hM₂,hbound⟩ := axis_summable_derivative_bounds s hs p hv j have hx : p j ∈ Metric.ball (p j) ε := Metric.mem_ball_self hε have hs₀ : Summable (fun r => axisSlice (smoothSummand s r) p j (p j)) := Summable.of_norm_bounded hM₀ (fun r => ((hbound (p j) hx).2 r).1) have hs₁ : Summable (fun r => deriv (axisSlice (smoothSummand s r) p j) (p j)) := Summable.of_norm_bounded hM₁ (fun r => ((hbound (p j) hx).2 r).2.1) have hs₂ : Summable (fun r => deriv (deriv (axisSlice (smoothSummand s r) p j)) (p j)) := Summable.of_norm_bounded hM₂ (fun r => ((hbound (p j) hx).2 r).2.2) have hd₁ (r : CuspCosets) (t : ℝ) (ht : t∈Metric.ball (p j) ε) : DifferentiableAt ℝ (axisSlice (smoothSummand s r) p j) t := smooth_axis_differentiable_at s r p j t (hbound t ht).1 have hd₂ (r : CuspCosets) (t : ℝ) (ht : t∈Metric.ball (p j) ε) : DifferentiableAt ℝ (deriv (axisSlice (smoothSummand s r) p j)) t := smooth_axis_deriv_differentiable_at s r p j t (hbound t ht).1 refine ⟨hs₁,hs₂,?_,?_⟩ · exact hasDerivAt_tsum_of_isPreconnected hM₁ Metric.isOpen_ball Metric.isPreconnected_ball (fun r t ht => (hd₁ r t ht).hasDerivAt) (fun r t ht => ((hbound t ht).2 r).2.1) hx hs₀ hx · exact hasDerivAt_deriv_tsum_of_bounds (fun r => axisSlice (smoothSummand s r) p j) M₁ M₂ _ (p j) Metric.isOpen_ball Metric.isPreconnected_ball hx hM₁ hM₂ hd₁ hd₂ (fun r t ht => ((hbound t ht).2 r).2.1) (fun r t ht => ((hbound t ht).2 r).2.2) hs₀ def axisLaplacian (f : SpatialCoordinates → ℂ) (p : SpatialCoordinates) : ℂ := (p 2:ℂ)^2 * (∑ j : Fin 3, deriv (deriv (axisSlice f p j)) (p j)) - (p 2:ℂ)*deriv (axisSlice f p 2) (p 2) lemma axisSlice_zero (f : ℝ → ℝ → ℝ → ℂ) (p : SpatialCoordinates) : axisSlice (fun q => f (q 0) (q 1) (q 2)) p 0 = fun t => f t (p 1) (p 2) := by funext t simp [axisSlice,Function.update] lemma axisSlice_one (f : ℝ → ℝ → ℝ → ℂ) (p : SpatialCoordinates) : axisSlice (fun q => f (q 0) (q 1) (q 2)) p 1 = fun t => f (p 0) t (p 2) := by funext t simp [axisSlice,Function.update] lemma axisSlice_two (f : ℝ → ℝ → ℝ → ℂ) (p : SpatialCoordinates) : axisSlice (fun q => f (q 0) (q 1) (q 2)) p 2 = fun t => f (p 0) (p 1) t := by funext t simp [axisSlice,Function.update] lemma axisLaplacian_eq_hyperbolicLaplacian (f : ℝ → ℝ → ℝ → ℂ) (p : SpatialCoordinates) : axisLaplacian (fun q => f (q 0) (q 1) (q 2)) p = hyperbolicLaplacian f (p 0) (p 1) (p 2) := by simp only [axisLaplacian,Fin.sum_univ_three,axisSlice_zero,axisSlice_one,axisSlice_two, hyperbolicLaplacian] lemma smoothSummand_axisLaplacian (s : ℂ) (r : CuspCosets) (p : SpatialCoordinates) (hv : 0

(cosetCharacter r)⁻¹ * spatialHeightPower s (Complex.normSq (embeddedRow r 0)) ((embeddedRow r 0*star (embeddedRow r 1)).re) (-(embeddedRow r 0*star (embeddedRow r 1)).im) (Complex.normSq (embeddedRow r 1)) x y v) p, hyperbolicLaplacian_const_mul,spatialHeightPower_eigenfunction] · ring · exact complex_row_quadratic_relation _ _ · exact hv.ne' · exact (row_denominator_pos _ (embeddedRow_ne_zero r) p hv).ne' theorem smoothEisenstein_eigenfunction (s : ℂ) (hs : 2 deriv (deriv (axisSlice (smoothSummand s r) p j)) (p j) let first := fun r : CuspCosets => deriv (axisSlice (smoothSummand s r) p 2) (p 2) have hsecond (j : Fin 3) : Summable (second j) := (hterms j).2.1 have hfirst : Summable first := (hterms 2).1 have hsum : Summable (fun r => ∑ j : Fin 3, second j r) := by simpa only [Fin.sum_univ_three] using ((hsecond 0).add (hsecond 1)).add (hsecond 2) have hcomm : (∑ j : Fin 3, ∑'r,second j r) = ∑'r,∑ j : Fin 3,second j r := by exact (Summable.tsum_finsetSum (fun j _ => hsecond j)).symm unfold axisLaplacian simp_rw [fun j => (hterms j).2.2.2.deriv] rw [(hterms 2).2.2.1.deriv] change (p 2:ℂ)^2*(∑j : Fin 3,∑'r,second j r) - (p 2:ℂ)*(∑'r,first r) = _ rw [hcomm,← tsum_mul_left,← tsum_mul_left,← (hsum.mul_left _).tsum_sub (hfirst.mul_left _)] change (∑'r,axisLaplacian (smoothSummand s r) p) = _ simp_rw [smoothSummand_axisLaplacian s _ p hv] rw [tsum_mul_left] rfl lemma axisSlice_eventuallyEq_of_positive (f g : SpatialCoordinates → ℂ) (heq : ∀ q, 0 normalizedColumn p (fun U => (frequencyTwist g θ) (columnLog p X U)) (G∪S)) (fun S => normalizedColumn p (fun U => (frequencyTwist g θ) (columnLog p X U)) (G∪S)) e Y H A P = residualTailCost p hg F G Ψ₁ Ψ₂ m c d (fun S => normalizedColumn p (fun U => g (columnLog p X U)) (G∪S)) (fun S => normalizedColumn p (fun U => g (columnLog p X U)) (G∪S)) e Y H A P := by simp only [residualTailCost, residualPairWeight, secondInputCoefficient, normalizedColumn, frequencyTwist_apply, norm_mul, norm_star, norm_div, FourierBridge.logPhase_norm, one_mul] end end SecondPassArithmetic open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ActualEisensteinCubic IdealMobiusDivisorSum IdealCoprimeSieveOperator lemma divisorPool_filter (S : Finset (Ideal O)) (B : Ideal O) (hB : B ≠ 0) (hS : ∀ D, D ∣ B → D ∈ S) : S.filter (fun D => D ∣ B) = idealDivisors B := by ext D simp only [Finset.mem_filter, mem_idealDivisors hB] exact ⟨And.right, fun h => ⟨hS D h,h⟩⟩ lemma divisor_product_delta (S T : Finset (Ideal O)) (B C d : Ideal O) (hB : B ≠ 0) (hC : C ≠ 0) (hBC : IsCoprime B C) (hS : ∀ D, D ∣ B → D ∈ S) (hT : ∀ E, E ∣ C → E ∈ T) (f : Ideal O → ℂ) : (∑ D ∈ S, if D ∣ B then ∑ E ∈ T, if E ∣ C then (if D*E=d then f (D*E) else 0) else 0 else 0) = if d ∣ B*C then f d else 0 := by have hs := QuadraticDivisorSplit.sum_divisors_coprime_product B C hB hC hBC (fun q => if q=d then f q else 0) have hleft : (∑ q ∈ idealDivisors (B*C), if q=d then f q else 0) = if d ∣ B*C then f d else 0 := by simp [mem_idealDivisors (mul_ne_zero hB hC)] rw [hleft] at hs rw [← divisorPool_filter S B hB hS, ← divisorPool_filter T C hC hT] at hs simpa only [Finset.sum_filter] using hs.symm private lemma four_sums_exchange {α β γ deltaLoss : Type*} (S : Finset α) (T : Finset β) (U : Finset γ) (V : Finset deltaLoss) (f : α → β → γ → deltaLoss → ℂ) : (∑ a ∈ S, ∑ b ∈ T, ∑ c ∈ U, ∑ d ∈ V, f a b c d) = ∑ c ∈ U, ∑ d ∈ V, ∑ a ∈ S, ∑ b ∈ T, f a b c d := by have h : (∑ ab ∈ S ×ˢ T, ∑ cd ∈ U ×ˢ V, f ab.1 ab.2 cd.1 cd.2) = ∑ cd ∈ U ×ˢ V, ∑ ab ∈ S ×ˢ T, f ab.1 ab.2 cd.1 cd.2 := Finset.sum_comm simpa only [Finset.sum_product] using h private lemma three_sums_exchange {α β γ : Type*} (S : Finset α) (T : Finset β) (U : Finset γ) (f : α → β → γ → ℝ) : (∑ a ∈ S, ∑ b ∈ T, ∑ c ∈ U, f a b c) = ∑ b ∈ T, ∑ c ∈ U, ∑ a ∈ S, f a b c := by have h : (∑ a ∈ S, ∑ bc ∈ T ×ˢ U, f a bc.1 bc.2) = ∑ bc ∈ T ×ˢ U, ∑ a ∈ S, f a bc.1 bc.2 := Finset.sum_comm simpa only [Finset.sum_product] using h variable {m n p : Type*} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] omit [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalTerm_product_divisor (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (d : Ideal O) (i : m) (j : n) (k : p) (hleft : ∀ j, left j ≠ 0) (hright : ∀ k, right k ≠ 0) (hS : ∀ j D, D ∣ left j → D ∈ S) (hT : ∀ k E, E ∣ right k → E ∈ T) (F : Ideal O → m → n → p → ℂ) : (∑ D ∈ S, ∑ E ∈ T, if D*E=d then originalTerm rows left right a b D E i j k * F (D*E) i j k else 0) = (if d ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * F d i j k else 0) := by by_cases hc : IsCoprime (left j) (right k) · have hd := divisor_product_delta S T (left j) (right k) d (hleft j) (hright k) hc (hS j) (hT k) (fun q => star (quadraticRow (left j) (CompletedGauss.primaryGenerator (rows i)) * a j) * (quadraticRow (right k) (CompletedGauss.primaryGenerator (rows i)) * b k) * F q i j k) calc _ = (∑ D ∈ S, if D ∣ left j then ∑ E ∈ T, if E ∣ right k then (if D*E=d then star (quadraticRow (left j) (CompletedGauss.primaryGenerator (rows i)) * a j) * (quadraticRow (right k) (CompletedGauss.primaryGenerator (rows i)) * b k) * F (D*E) i j k else 0) else 0 else 0) := by apply Finset.sum_congr rfl intro D hD by_cases hd : D ∣ left j · simp only [if_pos hd] apply Finset.sum_congr rfl intro E hE by_cases he : E ∣ right k <;> by_cases hde : D*E=d <;> simp [originalTerm,hc,hd,he,hde] · simp [originalTerm,hc,hd] _ = _ := by simpa [originalTerm,hc] using hd · simp [originalTerm,hc] omit [Fintype m] [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalColumnSum_product_divisor (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (d : Ideal O) (i : m) (hleft : ∀ j, left j ≠ 0) (hright : ∀ k, right k ≠ 0) (hS : ∀ j D, D ∣ left j → D ∈ S) (hT : ∀ k E, E ∣ right k → E ∈ T) (F : Ideal O → m → n → p → ℂ) : (∑ j, ∑ k, if d ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * F d i j k else 0) = ∑ D ∈ S, ∑ E ∈ T, if D*E=d then (∑ j, ∑ k, originalTerm rows left right a b D E i j k * F (D*E) i j k) else 0 := by calc _ = ∑ j, ∑ k, ∑ D ∈ S, ∑ E ∈ T, if D*E=d then originalTerm rows left right a b D E i j k * F (D*E) i j k else 0 := by apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro k hk exact (originalTerm_product_divisor S T rows left right a b d i j k hleft hright hS hT F).symm _ = ∑ D ∈ S, ∑ E ∈ T, ∑ j, ∑ k, if D*E=d then originalTerm rows left right a b D E i j k * F (D*E) i j k else 0 := four_sums_exchange Finset.univ Finset.univ S T _ _ = _ := by apply Finset.sum_congr rfl intro D hD apply Finset.sum_congr rfl intro E hE by_cases h : D*E=d <;> simp [h] omit [Fintype m] [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalColumnSum_divisor_rectangles (K S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (i : m) (hleft : ∀ j, left j ≠ 0) (hright : ∀ k, right k ≠ 0) (hS : ∀ j D, D ∣ left j → D ∈ S) (hT : ∀ k E, E ∣ right k → E ∈ T) (P : Ideal O → m → Prop) [DecidablePred (fun d => P d i)] (F : Ideal O → m → n → p → ℂ) : (∑ d ∈ K, if P d i then ‖∑ j, ∑ k, if d ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * F d i j k else 0‖ else 0) ≤ ∑ D ∈ S, ∑ E ∈ T, if D*E ∈ K then if P (D*E) i then ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k * F (D*E) i j k‖ else 0 else 0 := by let B := fun D E => ∑ j, ∑ k, originalTerm rows left right a b D E i j k * F (D*E) i j k have hpoint (d : Ideal O) : (if P d i then ‖∑ j, ∑ k, if d ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * F d i j k else 0‖ else 0) ≤ ∑ D ∈ S, ∑ E ∈ T, if D*E=d ∧ P d i then ‖B D E‖ else 0 := by by_cases hp : P d i · simp only [hp, and_true] rw [originalColumnSum_product_divisor S T rows left right a b d i hleft hright hS hT F] apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro D hD apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro E hE by_cases h : D*E=d <;> simp [h,B] · simp [hp] calc _ ≤ ∑ d ∈ K, ∑ D ∈ S, ∑ E ∈ T, if D*E=d ∧ P d i then ‖B D E‖ else 0 := Finset.sum_le_sum (fun d hd => hpoint d) _ = ∑ D ∈ S, ∑ E ∈ T, ∑ d ∈ K, if D*E=d ∧ P d i then ‖B D E‖ else 0 := three_sums_exchange K S T _ _ = _ := by apply Finset.sum_congr rfl intro D hD apply Finset.sum_congr rfl intro E hE have heq (d : Ideal O) : (if D*E=d ∧ P d i then ‖B D E‖ else 0) = if d=D*E then (if P (D*E) i then ‖B D E‖ else 0) else 0 := by by_cases h : d=D*E · subst d simp · simp [h,Ne.symm h] simp_rw [heq] simp only [Finset.sum_ite_eq', B] end open ActualEisensteinCubic lemma positive_ideal_dyadic_exists (N : ℝ) (D : Ideal O) (hD : 1 ≤ (Ideal.absNorm D : ℝ)) (hDN : (Ideal.absNorm D : ℝ) ≤ N) : ∃ j ∈ Finset.range (columnDyadicLength N + 1), (2 : ℝ)^j/2 < (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ (2 : ℝ)^j := by have hp : 1 ≤ Ideal.absNorm D := by exact_mod_cast hD exact exists_dyadic_shell (Ideal.absNorm D) (columnDyadicLength N) hp (hDN.trans (columnDyadicLength_cover N)) def divisorDyadicLabel (N : ℝ) (D : Ideal O) : Fin (columnDyadicLength N+1) := if h : 1 ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ N then ⟨(positive_ideal_dyadic_exists N D h.1 h.2).choose, Finset.mem_range.mp (positive_ideal_dyadic_exists N D h.1 h.2).choose_spec.1⟩ else ⟨0,by omega⟩ def divisorDyadicBin (S : Finset (Ideal O)) (N : ℝ) (j : Fin (columnDyadicLength N+1)) : Finset (Ideal O) := S.filter (fun D => divisorDyadicLabel N D = j) def divisorDyadicScale (j : ℕ) : ℝ := max 1 ((2 : ℝ)^j/2) lemma divisorDyadicLabel_bounds (N : ℝ) (D : Ideal O) (hD : 1 ≤ (Ideal.absNorm D : ℝ)) (hDN : (Ideal.absNorm D : ℝ) ≤ N) : (2 : ℝ)^(divisorDyadicLabel N D).val/2 < (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ (2 : ℝ)^(divisorDyadicLabel N D).val := by unfold divisorDyadicLabel rw [dif_pos ⟨hD,hDN⟩] exact (positive_ideal_dyadic_exists N D hD hDN).choose_spec.2 lemma divisorDyadicScale_ge_one (j : ℕ) : 1 ≤ divisorDyadicScale j := le_max_left _ _ theorem divisorDyadicBin_bounds (S : Finset (Ideal O)) (N : ℝ) (hS : ∀ D ∈ S, 1 ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ N) (j : Fin (columnDyadicLength N+1)) (D : Ideal O) (hD : D ∈ divisorDyadicBin S N j) : divisorDyadicScale j.val ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * divisorDyadicScale j.val := by obtain ⟨hDS,hj⟩ := Finset.mem_filter.mp hD have hd := hS D hDS have hb := divisorDyadicLabel_bounds N D hd.1 hd.2 rw [hj] at hb refine ⟨max_le hd.1 hb.1.le, ?_⟩ have hm : (2 : ℝ)^j.val/2 ≤ divisorDyadicScale j.val := le_max_right _ _ linarith [hb.2] theorem divisorDyadicBin_scale_le (S : Finset (Ideal O)) (N : ℝ) (hS : ∀ D ∈ S, 1 ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ N) (j : Fin (columnDyadicLength N+1)) (hj : (divisorDyadicBin S N j).Nonempty) : divisorDyadicScale j.val ≤ N := by obtain ⟨D,hD⟩ := hj exact (divisorDyadicBin_bounds S N hS j D hD).1.trans (hS D (Finset.mem_filter.mp hD).1).2 theorem sum_divisorDyadicBins {A : Type*} [AddCommMonoid A] (S : Finset (Ideal O)) (N : ℝ) (f : Ideal O → A) : (∑ D ∈ S, f D) = ∑ j : Fin (columnDyadicLength N+1), ∑ D ∈ divisorDyadicBin S N j, f D := by simp only [divisorDyadicBin,Finset.sum_filter] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro D hD simp theorem sum_divisorDyadicRectangles {A : Type*} [AddCommMonoid A] (S T : Finset (Ideal O)) (N : ℝ) (f : Ideal O → Ideal O → A) : (∑ D ∈ S, ∑ E ∈ T, f D E) = ∑ j : Fin (columnDyadicLength N+1), ∑ k : Fin (columnDyadicLength N+1), ∑ D ∈ divisorDyadicBin S N j, ∑ E ∈ divisorDyadicBin T N k, f D E := by calc _ = ∑ j : Fin (columnDyadicLength N+1), ∑ D ∈ divisorDyadicBin S N j, ∑ E ∈ T, f D E := sum_divisorDyadicBins S N _ _ = ∑ j : Fin (columnDyadicLength N+1), ∑ D ∈ divisorDyadicBin S N j, ∑ k : Fin (columnDyadicLength N+1), ∑ E ∈ divisorDyadicBin T N k, f D E := by apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro D hD exact sum_divisorDyadicBins T N (f D) _ = _ := by apply Finset.sum_congr rfl intro j hj exact Finset.sum_comm def columnDivisorPool {n : Type*} [Fintype n] (left : n → Ideal O) : Finset (Ideal O) := Finset.univ.biUnion (fun j => IdealMobiusDivisorSum.idealDivisors (left j)) theorem mem_columnDivisorPool_of_dvd {n : Type*} [Fintype n] (left : n → Ideal O) (hleft : ∀ j, left j ≠ 0) (j : n) (D : Ideal O) (hD : D ∣ left j) : D ∈ columnDivisorPool left := by apply Finset.mem_biUnion.mpr exact ⟨j,Finset.mem_univ j,(IdealMobiusDivisorSum.mem_idealDivisors (hleft j)).mpr hD⟩ theorem columnDivisorPool_norm_bounds {n : Type*} [Fintype n] (left : n → Ideal O) (hleft : ∀ j, left j ≠ 0) (N : ℝ) (hN : ∀ j, (Ideal.absNorm (left j) : ℝ) ≤ N) (D : Ideal O) (hD : D ∈ columnDivisorPool left) : 1 ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ N := by obtain ⟨j,hj,hDj⟩ := Finset.mem_biUnion.mp hD have hd := (IdealMobiusDivisorSum.mem_idealDivisors (hleft j)).mp hDj have hDz : D ≠ 0 := by intro hz rw [hz,zero_dvd_iff] at hd exact hleft j hd have hDN : Ideal.absNorm D ≤ Ideal.absNorm (left j) := Nat.le_of_dvd (Nat.pos_iff_ne_zero.mpr (fun h => hleft j (Ideal.absNorm_eq_zero_iff.mp h))) (map_dvd Ideal.absNorm hd) refine ⟨?_,(Nat.cast_le.mpr hDN).trans (hN j)⟩ exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun h => hDz (Ideal.absNorm_eq_zero_iff.mp h)) end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Poisson.LatticeEnvelopes namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace EisensteinSchwartzPoisson open ActualEisensteinCubic ConcreteTraceCRT def nonzeroLatticeEnvelopeConstant : ℝ := 4 * (1 + Real.pi) ^ 2 + 4 * eisensteinCauchyMass theorem nonzeroLatticeEnvelopeConstant_nonneg : 0 ≤ nonzeroLatticeEnvelopeConstant := by have := eisensteinCauchyMass_nonneg unfold nonzeroLatticeEnvelopeConstant positivity theorem scaled_cauchy_nonzero_mass (t : ℝ) (ht : 0 < t) : t * (∑' h : {h : O // h ≠ 0}, ((1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹) ≤ nonzeroLatticeEnvelopeConstant := by let F : ℝ → ℂ := fun x => (((1 + x) ^ 2)⁻¹ : ℝ) have hF (x : ℝ) (hx : 0 ≤ x) : (1 + x) ^ 2 * ‖F x‖ ≤ 1 := by dsimp only [F] rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (by positivity)] rw [mul_inv_cancel₀ (by positivity : (1 + x) ^ 2 ≠ 0)] have hh := lattice_profile_nonzero_scaled_bound F 1 (by norm_num) hF t ht change t * (∑' h : {h : O // h ≠ 0}, ‖F (t * ‖eisEmbedding h.val‖ ^ 2)‖) ≤ nonzeroLatticeEnvelopeConstant * 1 at hh simpa only [F, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (show 0 ≤ ((1 + t * ‖eisEmbedding _‖ ^ 2) ^ 2)⁻¹ by positivity), mul_one] using hh theorem nonzero_lattice_envelope_sum (t C : ℝ) (ht : 0 < t) (hC : 0 ≤ C) (f : {h : O // h ≠ 0} → ℝ) (hf : ∀ h, 0 ≤ f h) (hbound : ∀ h, (1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2 * f h ≤ C) : Summable f ∧ t * (∑' h, f h) ≤ nonzeroLatticeEnvelopeConstant * C := by have hp (h : {h : O // h ≠ 0}) : f h ≤ C * ((1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹ := by rw [← div_eq_mul_inv] apply (le_div_iff₀ (by positivity)).mpr simpa only [mul_comm] using hbound h have hs := (scaled_eisenstein_cauchy_summable t ht).subtype (fun h : O => h ≠ 0) have hfs : Summable f := Summable.of_nonneg_of_le hf hp (hs.mul_left C) refine ⟨hfs, ?_⟩ have hh := hfs.tsum_le_tsum hp (hs.mul_left C) rw [tsum_mul_left] at hh calc _ ≤ t * (C * ∑' h : {h : O // h ≠ 0}, ((1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹) := mul_le_mul_of_nonneg_left hh ht.le _ = C * (t * ∑' h : {h : O // h ≠ 0}, ((1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2)⁻¹) := by ring _ ≤ C * nonzeroLatticeEnvelopeConstant := mul_le_mul_of_nonneg_left (scaled_cauchy_nonzero_mass t ht) hC _ = _ := mul_comm _ _ end EisensteinSchwartzPoisson namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson def originalMiddleDecayConstant (W : 𝓢(ℝ, ℂ)) : ℝ := (actual_middle_radial_block_bound.{0, 0, 0} W 2).choose def dualMiddleDecayConstant (W : 𝓢(ℝ, ℂ)) : ℝ := (actual_dual_middle_radial_block_bound.{0, 0, 0} W 2).choose theorem originalMiddleDecayConstant_nonneg (W : 𝓢(ℝ, ℂ)) : 0 ≤ originalMiddleDecayConstant W := (actual_middle_radial_block_bound.{0, 0, 0} W 2).choose_spec.1 theorem dualMiddleDecayConstant_nonneg (W : 𝓢(ℝ, ℂ)) : 0 ≤ dualMiddleDecayConstant W := (actual_dual_middle_radial_block_bound.{0, 0, 0} W 2).choose_spec.1 theorem divisorBlockCost_mono_coefficients {n p : Type*} [Fintype n] [Fintype p] (ε : ℝ) (hε : 0 < ε) (D₁ D₂ B N : ℝ) (hD₁ : 0 ≤ D₁) (hD₂ : 0 ≤ D₂) (a a₀ : n → ℂ) (b b₀ : p → ℂ) (ha : ∀ j, ‖a j‖ ≤ ‖a₀ j‖) (hb : ∀ k, ‖b k‖ ≤ ‖b₀ k‖) : divisorBlockCost ε hε D₁ D₂ B N a b ≤ divisorBlockCost ε hε D₁ D₂ B N a₀ b₀ := by have hA := sieveNorm_nonneg B (N / D₁) have hB := sieveNorm_nonneg B (N / D₂) unfold divisorBlockCost gcongr · exact ha _ · exact hb _ section variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def originalMiddleAt (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (h : O) : ℝ := ∑ D : S, ∑ E : T, ∑ i, (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ))) * ‖∑ j, ∑ k, originalTerm rows left right a b D.val E.val i j k * paperRadialFourier W (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ)))‖ def dualMiddleAt (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (h : O) : ℝ := ∑ D : S, ∑ E : T, ∑ i, (Real.sqrt ((M / F) / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ))) * ‖∑ j, ∑ k, originalTerm rows left right a b D.val E.val i j k * paperRadialFourier W (Real.sqrt (F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ))) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ)))‖ omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalMiddleAt_nonneg (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (h : O) : 0 ≤ originalMiddleAt W S T rows left right a b M h := by unfold originalMiddleAt positivity omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem dualMiddleAt_nonneg (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (h : O) : 0 ≤ dualMiddleAt W S T rows left right a b M F h := by unfold dualMiddleAt positivity variable (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a₀ : n → ℂ) (b₀ : p → ℂ) (a : O → n → ℂ) (b : O → p → ℂ) (ha : ∀ h j, ‖a h j‖ ≤ ‖a₀ j‖) (hb : ∀ h k, ‖b h k‖ ≤ ‖b₀ k‖) include hD₁ hD₂ hB hN hM hS hT hr hl hri hrows ha hb theorem actual_original_middle_all_frequencies (W : 𝓢(ℝ, ℂ)) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) : Summable (fun h : {h : O // h ≠ 0} => originalMiddleAt W S T rows left right (a h.val) (b h.val) M h.val) ∧ (∑' h : {h : O // h ≠ 0}, originalMiddleAt W S T rows left right (a h.val) (b h.val) M h.val) ≤ 2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W * Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N a₀ b₀) := by let t := Real.sqrt (M / B) / (D₁ * D₂) have ht : 0 < t := by dsimp only [t]; positivity let C := originalMiddleDecayConstant W * Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N a₀ b₀) have hC : 0 ≤ C := mul_nonneg (originalMiddleDecayConstant_nonneg W) (Real.sqrt_nonneg _) have hpoint (h : {h : O // h ≠ 0}) : (1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2 * originalMiddleAt W S T rows left right (a h.val) (b h.val) M h.val ≤ 2 * t * C := by have hk := (actual_middle_radial_block_bound.{0, 0, 0} W 2).choose_spec.2 ε hε S T D₁ D₂ B N M hD₁ hD₂ hB hN hM hS hT rows left right hr hl hri hrows hleft hright (a h.val) (b h.val) h.val h.property change _ ≤ originalMiddleDecayConstant W * Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N (a h.val) (b h.val)) at hk have hcost := divisorBlockCost_mono_coefficients ε hε D₁ D₂ B N (by linarith) (by linarith) (a h.val) a₀ (b h.val) b₀ (ha h.val) (hb h.val) have hk' := hk.trans (mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hcost) (originalMiddleDecayConstant_nonneg W)) have hp := principal_middle_prefactor_sum S T rows (fun D E i => ‖∑ j, ∑ k, originalTerm rows left right (a h.val) (b h.val) D.val E.val i j k * paperRadialFourier W (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) * ‖eisEmbedding h.val‖ ^ 2 / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ)))‖) (fun _ _ _ => norm_nonneg _) M B D₁ D₂ hM (by linarith) (by linarith) (by linarith) (fun i => (hrows i).2.1) (fun D hD => (hS D hD).1) (fun E hE => (hT E hE).1) have harg : Real.sqrt (M / B) * ‖eisEmbedding h.val‖ ^ 2 / (D₁ * D₂) = t * ‖eisEmbedding h.val‖ ^ 2 := by dsimp only [t]; ring rw [harg] at hk' have hpre : 2 * Real.sqrt (M / B) / (D₁ * D₂) = 2 * t := by dsimp only [t]; ring rw [hpre] at hp change originalMiddleAt W S T rows left right (a h.val) (b h.val) M h.val ≤ _ at hp calc _ ≤ (1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2 * (2 * t * _) := mul_le_mul_of_nonneg_left hp (sq_nonneg _) _ = 2 * t * ((1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2 * _) := by ring _ ≤ 2 * t * C := mul_le_mul_of_nonneg_left hk' (by positivity) obtain ⟨hs, hv⟩ := nonzero_lattice_envelope_sum t (2 * t * C) ht (by positivity) _ (fun h => originalMiddleAt_nonneg W S T rows left right (a h.val) (b h.val) M h.val) hpoint refine ⟨hs, (mul_le_mul_iff_right₀ ht).mp ?_⟩ calc _ ≤ nonzeroLatticeEnvelopeConstant * (2 * t * C) := hv _ = _ := by dsimp only [C]; ring end theorem dual_middle_scale_identity (M F B N : ℝ) (hM : 0 < M) (hF : 0 < F) (hB : 0 < B) (hN : 0 < N) : Real.sqrt ((M / F) / B) = (M / (F * N)) * (N * Real.sqrt (F / (M * B))) := by apply (sq_eq_sq₀ (Real.sqrt_nonneg _) (by positivity)).mp simp only [mul_pow, div_pow, Real.sq_sqrt (show 0 ≤ (M / F) / B by positivity), Real.sq_sqrt (show 0 ≤ F / (M * B) by positivity)] field_simp variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] theorem actual_dual_middle_all_frequencies (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M F : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a₀ : n → ℂ) (b₀ : p → ℂ) (a : O → n → ℂ) (b : O → p → ℂ) (ha : ∀ h j, ‖a h j‖ ≤ ‖a₀ j‖) (hb : ∀ h k, ‖b h k‖ ≤ ‖b₀ k‖) (W : 𝓢(ℝ, ℂ)) (hleft : ∀ j, Admissible (left j) ∧ N / 2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N / 2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) : Summable (fun h : {h : O // h ≠ 0} => dualMiddleAt W S T rows left right (a h.val) (b h.val) M F h.val) ∧ (∑' h : {h : O // h ≠ 0}, dualMiddleAt W S T rows left right (a h.val) (b h.val) M F h.val) ≤ (2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * (M / (F * N)) * Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N a₀ b₀) := by let t := (N * Real.sqrt (F / (M * B))) / (D₁ * D₂) let r := M / (F * N) have ht : 0 < t := by dsimp only [t]; positivity have hr0 : 0 < r := by dsimp only [r]; positivity let C := dualMiddleDecayConstant W * Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N a₀ b₀) have hC : 0 ≤ C := mul_nonneg (dualMiddleDecayConstant_nonneg W) (Real.sqrt_nonneg _) have hpoint (h : {h : O // h ≠ 0}) : (1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2 * dualMiddleAt W S T rows left right (a h.val) (b h.val) M F h.val ≤ (2 * t * r) * C := by have hk := (actual_dual_middle_radial_block_bound.{0, 0, 0} W 2).choose_spec.2 ε hε S T D₁ D₂ B N M F hD₁ hD₂ hB hN hM hF hS hT rows left right hr hl hri hrows hleft hright (a h.val) (b h.val) h.val h.property change _ ≤ dualMiddleDecayConstant W * Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N (a h.val) (b h.val)) at hk have hcost := divisorBlockCost_mono_coefficients ε hε D₁ D₂ B N (by linarith) (by linarith) (a h.val) a₀ (b h.val) b₀ (ha h.val) (hb h.val) have hk' := hk.trans (mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hcost) (dualMiddleDecayConstant_nonneg W)) have hp := principal_middle_prefactor_sum S T rows (fun D E i => ‖∑ j, ∑ k, originalTerm rows left right (a h.val) (b h.val) D.val E.val i j k * paperRadialFourier W (Real.sqrt (F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ))) * ‖eisEmbedding h.val‖ ^ 2 / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ)))‖) (fun _ _ _ => norm_nonneg _) (M / F) B D₁ D₂ (div_pos hM hF) (by linarith) (by linarith) (by linarith) (fun i => (hrows i).2.1) (fun D hD => (hS D hD).1) (fun E hE => (hT E hE).1) have harg : N * Real.sqrt (F / (M * B)) * ‖eisEmbedding h.val‖ ^ 2 / (D₁ * D₂) = t * ‖eisEmbedding h.val‖ ^ 2 := by dsimp only [t]; ring rw [harg] at hk' have hpre : 2 * Real.sqrt ((M / F) / B) / (D₁ * D₂) = 2 * t * r := by rw [dual_middle_scale_identity M F B N hM hF (by linarith) (by linarith)] dsimp only [t, r] ring rw [hpre] at hp change dualMiddleAt W S T rows left right (a h.val) (b h.val) M F h.val ≤ _ at hp calc _ ≤ (1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2 * ((2 * t * r) * _) := mul_le_mul_of_nonneg_left hp (sq_nonneg _) _ = (2 * t * r) * ((1 + t * ‖eisEmbedding h.val‖ ^ 2) ^ 2 * _) := by ring _ ≤ (2 * t * r) * C := mul_le_mul_of_nonneg_left hk' (by positivity) obtain ⟨hs, hv⟩ := nonzero_lattice_envelope_sum t ((2 * t * r) * C) ht (by positivity) _ (fun h => dualMiddleAt_nonneg W S T rows left right (a h.val) (b h.val) M F h.val) hpoint refine ⟨hs, (mul_le_mul_iff_right₀ ht).mp ?_⟩ calc _ ≤ nonzeroLatticeEnvelopeConstant * ((2 * t * r) * C) := hv _ = _ := by dsimp only [C, r]; ring end open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson def divisorExponentConstant {α : ℝ} (h : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) : ℝ := (h.divisor_pair deltaLoss hδ).choose theorem divisorExponentConstant_pos {α : ℝ} (h : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) : 0 < divisorExponentConstant h deltaLoss hδ := (h.divisor_pair deltaLoss hδ).choose_spec.1 theorem divisor_cost_with_constant {α : ℝ} (h : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) {n p : Type*} [Fintype n] [Fintype p] (ε : ℝ) (hε : 0 < ε) (B N D₁ D₂ : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hD₁N : D₁ ≤ N) (hD₂N : D₂ ≤ N) (a : n → ℂ) (b : p → ℂ) : Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N a b) ≤ divisorEnergyFactor ε hε N a b * (divisorExponentConstant h deltaLoss hδ * (B * N) ^ deltaLoss * (N + B ^ α * (D₁ * D₂))) := by rw [divisorBlockCost_sqrt ε hε D₁ D₂ B N (by linarith) (by linarith) a b] exact mul_le_mul_of_nonneg_left ((h.divisor_pair deltaLoss hδ).choose_spec.2 B N D₁ D₂ hB hN hD₁ hD₂ hD₁N hD₂N) (divisorEnergyFactor_nonneg ε hε N a b) theorem sqrt_div_mul_rpow (M B α : ℝ) (hM : 0 ≤ M) (hB : 0 < B) : Real.sqrt (M / B) * B ^ α = Real.sqrt M * B ^ (α - 1 / 2) := by rw [Real.rpow_sub hB, ← Real.sqrt_eq_rpow, Real.sqrt_div hM] ring theorem original_middle_scale_shape (M B N D T α : ℝ) (hM : 0 ≤ M) (hB : 0 < B) (hD : D ≤ T * Real.sqrt (M / B)) : N + B ^ α * D ≤ N + T * Real.sqrt M * B ^ (α - 1 / 2) := by calc _ ≤ N + B ^ α * (T * Real.sqrt (M / B)) := add_le_add le_rfl (mul_le_mul_of_nonneg_left hD (Real.rpow_nonneg hB.le α)) _ = _ := by rw [mul_left_comm (B ^ α) T, mul_comm (B ^ α), sqrt_div_mul_rpow M B α hM hB]; ring theorem dual_middle_scale_shape (M F B N D T α : ℝ) (hM : 0 < M) (hF : 0 < F) (hB : 0 < B) (hN : 0 < N) (hD : D ≤ T * (N * Real.sqrt (F / (M * B)))) : (M / (F * N)) * (N + B ^ α * D) ≤ M / F + T * Real.sqrt (M / F) * B ^ (α - 1 / 2) := by have hratio : 0 ≤ M / (F * N) := by positivity calc _ ≤ (M / (F * N)) * (N + B ^ α * (T * (N * Real.sqrt (F / (M * B))))) := by gcongr _ = M / F + T * (Real.sqrt ((M / F) / B) * B ^ α) := by rw [dual_middle_scale_identity M F B N hM hF hB hN] field_simp _ = _ := by rw [sqrt_div_mul_rpow (M / F) B α (by positivity) hB]; ring variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] variable {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M U : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hB : 1 ≤ B) (hN : 1 ≤ N) (hD₁N : D₁ ≤ N) (hD₂N : D₂ ≤ N) (hM : 0 < M) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a₀ : n → ℂ) (b₀ : p → ℂ) (a : O → n → ℂ) (b : O → p → ℂ) (ha : ∀ h j, ‖a h j‖ ≤ ‖a₀ j‖) (hb : ∀ h k, ‖b h k‖ ≤ ‖b₀ k‖) include hD₁ hD₂ hB hN hD₁N hD₂N hM hS hT hr hl hri hrows ha hb theorem HasSieveExponent.original_middle_block (W : 𝓢(ℝ, ℂ)) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hcut : D₁ * D₂ ≤ U * Real.sqrt (M / B)) : (∑' h : {h : O // h ≠ 0}, originalMiddleAt W S T rows left right (a h.val) (b h.val) M h.val) ≤ (2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (N + U * Real.sqrt M * B ^ (α - 1 / 2)) := by have hc := divisor_cost_with_constant hexp deltaLoss hδ ε hε B N D₁ D₂ hB hN hD₁ hD₂ hD₁N hD₂N a₀ b₀ have hs := (actual_original_middle_all_frequencies ε hε S T D₁ D₂ B N M hD₁ hD₂ hB hN hM hS hT rows left right hr hl hri hrows a₀ b₀ a b ha hb W hleft hright).2 have hk : 0 ≤ 2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W := mul_nonneg (mul_nonneg (by norm_num) nonzeroLatticeEnvelopeConstant_nonneg) (originalMiddleDecayConstant_nonneg W) have hf := divisorEnergyFactor_nonneg ε hε N a₀ b₀ have hconst := (divisorExponentConstant_pos hexp deltaLoss hδ).le calc _ ≤ (2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W) * (divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss * (N + B ^ α * (D₁ * D₂)))) := hs.trans (mul_le_mul_of_nonneg_left hc hk) _ = ((2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss)) * (N + B ^ α * (D₁ * D₂)) := by ring _ ≤ _ := mul_le_mul_of_nonneg_left (original_middle_scale_shape M B N (D₁ * D₂) U α hM.le (by linarith) hcut) (by positivity) theorem HasSieveExponent.dual_middle_block (W : 𝓢(ℝ, ℂ)) (F : ℝ) (hF : 0 < F) (hleft : ∀ j, Admissible (left j) ∧ N / 2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N / 2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hcut : D₁ * D₂ ≤ U * (N * Real.sqrt (F / (M * B)))) : (∑' h : {h : O // h ≠ 0}, dualMiddleAt W S T rows left right (a h.val) (b h.val) M F h.val) ≤ (2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (M / F + U * Real.sqrt (M / F) * B ^ (α - 1 / 2)) := by have hc := divisor_cost_with_constant hexp deltaLoss hδ ε hε B N D₁ D₂ hB hN hD₁ hD₂ hD₁N hD₂N a₀ b₀ have hs := (actual_dual_middle_all_frequencies ε hε S T D₁ D₂ B N M F hD₁ hD₂ hB hN hM hF hS hT rows left right hr hl hri hrows a₀ b₀ a b ha hb W hleft hright).2 have hk : 0 ≤ 2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W := mul_nonneg (mul_nonneg (by norm_num) nonzeroLatticeEnvelopeConstant_nonneg) (dualMiddleDecayConstant_nonneg W) have hf := divisorEnergyFactor_nonneg ε hε N a₀ b₀ have hconst := (divisorExponentConstant_pos hexp deltaLoss hδ).le calc _ ≤ ((2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * (M / (F * N))) * (divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss * (N + B ^ α * (D₁ * D₂)))) := hs.trans (mul_le_mul_of_nonneg_left hc (by positivity)) _ = ((2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss)) * ((M / (F * N)) * (N + B ^ α * (D₁ * D₂))) := by ring _ ≤ _ := mul_le_mul_of_nonneg_left (dual_middle_scale_shape M F B N (D₁ * D₂) U α hM hF (by linarith) (by linarith) hcut) (by positivity) end CanonicalQuadraticSieve namespace CubicEisenstein open Filter open scoped BigOperators Classical Topology Matrix MatrixGroups open ActualEisensteinCubic CubicKubota ConcreteTraceCRT def integralComplexMatrix : SL(2,O) →* SL(2,ℂ) := Matrix.SpecialLinearGroup.map eisEmbedding lemma integralComplexMatrix_apply (M : SL(2,O)) (i j : Fin 2) : integralComplexMatrix M i j = eisEmbedding (M i j) := rfl lemma integralComplexMatrix_levelThree (M : levelThree) : integralComplexMatrix (M : SL(2,O)) = complexMatrix M := rfl lemma row_wedge_gram (u v : Fin 2 → ℂ) : Complex.normSq (u 0*v 1-u 1*v 0) + Complex.normSq (u 0*star (v 0)+u 1*star (v 1)) = rowEnergy u * rowEnergy v := by simp only [rowEnergy,← Complex.normSq_eq_norm_sq,Complex.normSq_apply, Complex.add_re,Complex.add_im,Complex.sub_re,Complex.sub_im,Complex.mul_re,Complex.mul_im, Complex.star_def,Complex.conj_re,Complex.conj_im] ring lemma row_wedge_le_energy (u v : Fin 2 → ℂ) : Complex.normSq (u 0*v 1-u 1*v 0) ≤ rowEnergy u * rowEnergy v := by rw [← row_wedge_gram u v] exact le_add_of_nonneg_right (Complex.normSq_nonneg _) lemma bottom_row_wedge_mul (g h : SL(2,ℂ)) : complexBottomRow (g*h) 0 * complexBottomRow h 1 - complexBottomRow (g*h) 1 * complexBottomRow h 0 = g 1 0 := by have hd : h 0 0*h 1 1-h 0 1*h 1 0=1 := by simpa only [Matrix.det_fin_two] using h.property simp only [complexBottomRow,Matrix.SpecialLinearGroup.coe_mul,Matrix.mul_apply,Fin.sum_univ_two] linear_combination g 1 0 * hd theorem hyperbolicHeight_mul_bound (g : SL(2,ℂ)) (w : HyperbolicSpace) : hyperbolicHeight (g • w) * hyperbolicHeight w * Complex.normSq (g 1 0) ≤ 1 := by induction w using Quotient.inductionOn with | _ h => change liftedHeight (g*h) * liftedHeight h * Complex.normSq (g 1 0) ≤ 1 have hw := row_wedge_le_energy (complexBottomRow (g*h)) (complexBottomRow h) rw [bottom_row_wedge_mul] at hw have hp : 0 < rowEnergy (complexBottomRow (g*h)) * rowEnergy (complexBottomRow h) := mul_pos (rowEnergy_pos _ (complexBottomRow_ne_zero _)) (rowEnergy_pos _ (complexBottomRow_ne_zero _)) have he : liftedHeight (g*h) * liftedHeight h * Complex.normSq (g 1 0) = Complex.normSq (g 1 0) / (rowEnergy (complexBottomRow (g*h))*rowEnergy (complexBottomRow h)) := by simp only [liftedHeight,div_eq_mul_inv,mul_inv] ring rw [he] exact (div_le_one hp).mpr hw lemma one_le_normSq_embedding (c : O) (hc : c≠0) : 1 ≤ Complex.normSq (eisEmbedding c) := by rw [Complex.normSq_eq_norm_sq,eisEmbedding_norm_sq_eq_absNorm_span] exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (Ideal.span_singleton_eq_bot.not.mpr hc)) theorem integral_hyperbolicHeight_mul_le_one (M : SL(2,O)) (hc : M 1 0≠0) (w : HyperbolicSpace) : hyperbolicHeight (integralComplexMatrix M • w) * hyperbolicHeight w ≤ 1 := by have hb := hyperbolicHeight_mul_bound (integralComplexMatrix M) w have hc1 := one_le_normSq_embedding (M 1 0) hc have hp := mul_pos (hyperbolicHeight_pos (integralComplexMatrix M • w)) (hyperbolicHeight_pos w) change _ * _ * Complex.normSq (eisEmbedding (M 1 0)) ≤ 1 at hb nlinarith end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace CubicEisenstein open ActualEisensteinCubic CubicKubota ConcreteTraceCRT lemma cosetHeight_pos (x : CuspCosets) (w : HyperbolicSpace) : 0 exact (cosetHeight_cosetOf M w).symm ▸ hyperbolicHeight_pos _ lemma cosetHeight_rightEquiv (M : levelThree) (x : CuspCosets) (w : HyperbolicSpace) : cosetHeight (rightEquiv M x) w = cosetHeight x (complexMatrix M • w) := by induction x using Quotient.inductionOn with | _ N => change cosetHeight (cosetOf (N*M)) w = cosetHeight (cosetOf N) (complexMatrix M • w) rw [cosetHeight_cosetOf,cosetHeight_cosetOf,map_mul,mul_smul] lemma high_coset_unique (Y : ℝ) (hY : 1≤Y) (w : HyperbolicSpace) (x y : CuspCosets) (hx : Y induction y using Quotient.inductionOn with | _ N => by_contra hne have hc : ((M*N⁻¹ : levelThree) : SL(2,O)) 1 0≠0 := by intro hc have hT : M*N⁻¹ ∈ cuspStabilizer := (mem_cuspStabilizer_iff _).mpr hc exact hne ((cosetOf_eq_iff M N).mpr ⟨M*N⁻¹,hT,by group⟩) have hp := integral_hyperbolicHeight_mul_le_one ((M*N⁻¹ : levelThree) : SL(2,O)) hc (complexMatrix N • w) rw [integralComplexMatrix_levelThree,map_mul,map_inv,mul_smul,inv_smul_smul] at hp change Y high_coset_unique Y hY w x y hx hy exact h.finite def cuspCutoffTerm (Y : ℝ) (F : ℝ → ℂ) (x : CuspCosets) (w : HyperbolicSpace) : ℂ := if Y cuspCutoffTerm Y F x w) := by apply (high_cosets_finite Y hY w).subset intro x hx by_contra hn simp only [Function.mem_support] at hx change ¬Y cuspCutoffTerm Y F x w) := summable_of_hasFiniteSupport (cuspCutoffTerm_finiteSupport Y hY F w) def cuspCutoffCorrection (Y : ℝ) (F : ℝ → ℂ) (w : HyperbolicSpace) : ℂ := ∑'x,cuspCutoffTerm Y F x w lemma cuspCutoffTerm_automorphy (Y : ℝ) (F : ℝ → ℂ) (M : levelThree) (x : CuspCosets) (w : HyperbolicSpace) : cuspCutoffTerm Y F x (complexMatrix M • w) = complexCharacter M * cuspCutoffTerm Y F (rightEquiv M x) w := by have hM : complexCharacter M≠0 := by intro h have hn := norm_complexCharacter M rw [h,norm_zero] at hn exact zero_ne_one hn simp only [cuspCutoffTerm,cosetHeight_rightEquiv,cosetCharacter_rightEquiv] split_ifs <;> simp [mul_inv_rev,hM,mul_assoc,mul_left_comm,mul_comm] theorem cuspCutoffCorrection_automorphy (Y : ℝ) (hY : 1≤Y) (F : ℝ → ℂ) (M : levelThree) (w : HyperbolicSpace) : cuspCutoffCorrection Y F (complexMatrix M • w) = complexCharacter M*cuspCutoffCorrection Y F w := by have hsum := cuspCutoffTerm_summable Y hY F w have hreindex := (rightEquiv M).hasSum_iff.mpr hsum.hasSum have hscale := hreindex.mul_left (complexCharacter M) exact (cuspCutoffTerm_summable Y hY F (complexMatrix M • w)).hasSum.unique (hscale.congr_fun (fun x => cuspCutoffTerm_automorphy Y F M x w)) lemma cuspCutoffCorrection_eq (Y : ℝ) (hY : 1≤Y) (F : ℝ → ℂ) (w : HyperbolicSpace) (x : CuspCosets) (hx : Y hy (high_coset_unique Y hY w y x hh hx) simp [cuspCutoffTerm,hn] lemma hyperbolicHeight_upperPoint (z : ℂ) (v : ℝ) (hv : 0 Ideal.span {p i})) include hinj in theorem sourceSupportMobius_norm (E : Finset ι) : ‖supportMobius (fun i => Ideal.span {p i}) E‖ = 1 := by have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance have h := congrArg norm (FirstCauchyArithmetic.supportMobius_sq _ hprime hinj E) simp only [norm_mul, norm_one] at h nlinarith [norm_nonneg (supportMobius (fun i => Ideal.span {p i}) E)] omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem primeSubsetGenerator_norm_eq_productNorm (E : Finset ι) : ‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖ ^ 2 = primeProductNorm p E := by rw [primeSubsetGenerator_norm_sq, primeProductNorm_eq_ideal_norm] include hp in omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem norm_primeProduct_ge_one (S : Finset ι) : 1 ≤ ‖eisEmbedding (∏ i ∈ S, p i)‖ := by have h := primeProductNorm_ge_one p hp S dsimp only [primeProductNorm] at h nlinarith [norm_nonneg (eisEmbedding (∏ i ∈ S, p i))] include hp hinj in theorem secondSourceCommonCoefficient_norm_le_one (Ψ : O →* ℂ) (hΨ : ∀ a, ‖Ψ a‖ ≤ 1) (m c d : O) (G E : Finset ι) : ‖secondSourceCommonCoefficient p hg Ψ m c d G E‖ ≤ 1 := by have hA := (secondInputCoefficient_norm_le p hg Ψ m c d G).trans (hΨ _) have hA2 : ‖secondInputCoefficient p hg Ψ m c d (fun _ => 1) G‖ ^ 2 ≤ 1 := by simpa using pow_le_pow_left₀ (norm_nonneg _) hA 2 have hN := primeProductNorm_ge_one p hp E have hμ := sourceSupportMobius_norm p hinj E change ‖(UniqueFactorizationMonoid.moebius (∏ i ∈ E, Ideal.span {p i}) : ℂ)‖ = 1 at hμ simp only [secondSourceCommonCoefficient, norm_mul, norm_div, Complex.norm_of_nonneg (sq_nonneg _), primeSubsetGenerator_norm_eq_productNorm, Complex.norm_of_nonneg (FirstPassCubeLabels.primeProductNorm_pos p hp E).le, hμ] exact (mul_le_of_le_one_left (div_nonneg zero_le_one (zero_le_one.trans hN)) hA2).trans ((div_le_one (by linarith)).mpr hN) omit [DecidableEq ι] in theorem secondInputCoefficient_norm_le_test (Ψ : O →* ℂ) (hΨ : ∀ a, ‖Ψ a‖ ≤ 1) (m c d : O) (H : Finset ι → ℂ) (S : Finset ι) : ‖secondInputCoefficient p hg Ψ m c d H S‖ ≤ ‖H S‖ := by have he : secondInputCoefficient p hg Ψ m c d H S = secondInputCoefficient p hg Ψ m c d (fun _ => 1) S * H S := by simp only [secondInputCoefficient, mul_one] rw [he, norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) ((secondInputCoefficient_norm_le p hg Ψ m c d S).trans (hΨ _)) include hp in omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem normalizedColumn_schwartz_bound (g : 𝓢(ℝ, ℂ)) (X : ℝ) (S : Finset ι) : ‖normalizedColumn p (fun U => g (columnLog p X U)) S‖ ≤ SchwartzMap.seminorm ℝ 0 0 g := by simp only [normalizedColumn, norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (norm_nonneg _)] exact (div_le_self (norm_nonneg _) (norm_primeProduct_ge_one p hp S)).trans (g.norm_le_seminorm ℝ _) include hp hinj in theorem residualPairWeight_schwartz_bound (Ψ : O →* ℂ) (hΨ : ∀ a, ‖Ψ a‖ ≤ 1) (m c d : O) (g : 𝓢(ℝ, ℂ)) (X : ℝ) (G S T : Finset ι) : ‖residualPairWeight p hg Ψ Ψ m c d (fun U => normalizedColumn p (fun V => g (columnLog p X V)) (G∪U)) (fun U => normalizedColumn p (fun V => g (columnLog p X V)) (G∪U)) S T‖ ≤ (SchwartzMap.seminorm ℝ 0 0 g) ^ 2 := by simp only [residualPairWeight, norm_mul, norm_star, sourceSupportMobius_norm p hinj, one_mul] have hS := (secondInputCoefficient_norm_le_test p hg Ψ hΨ m c d (fun U => normalizedColumn p (fun V => g (columnLog p X V)) (G∪U)) S).trans (normalizedColumn_schwartz_bound p hp g X (G∪S)) have hT := (secondInputCoefficient_norm_le_test p hg Ψ hΨ m c d (fun U => normalizedColumn p (fun V => g (columnLog p X V)) (G∪U)) T).trans (normalizedColumn_schwartz_bound p hp g X (G∪T)) simpa only [pow_two] using mul_le_mul hS hT (norm_nonneg _) (apply_nonneg _ _) include hp in theorem residualPairWeight_support_bounds (Ψ : O →* ℂ) (m c d : O) (g : 𝓢(ℝ, ℂ)) (M X : ℝ) (hX : 0 < X) (hgM : ∀ u, g u ≠ 0 → |u| ≤ M) (G E S T : Finset ι) (hEG : E ⊆ G) (hw : residualPairWeight p hg Ψ Ψ m c d (fun U => normalizedColumn p (fun V => g (columnLog p X V)) (G∪U)) (fun U => normalizedColumn p (fun V => g (columnLog p X V)) (G∪U)) S T ≠ 0) : primeProductNorm p G ≤ X*Real.exp M ∧ primeProductNorm p E ≤ X*Real.exp M ∧ primeProductNorm p S ≤ X*Real.exp M ∧ primeProductNorm p T ≤ X*Real.exp M := by obtain ⟨hS,hT⟩ := residualPairWeight_test_ne_zero p hg Ψ Ψ m c d _ _ S T hw have hG := normalizedColumn_subset_norm_bound p hp g M X hX hgM G S G Finset.subset_union_left hS exact ⟨hG, (primeProductNorm_mono p hp hEG).trans hG, normalizedColumn_subset_norm_bound p hp g M X hX hgM G S S Finset.subset_union_right hS, normalizedColumn_subset_norm_bound p hp g M X hX hgM G T T Finset.subset_union_right hT⟩ end section theorem tail_radial_scalar_le (Y E n lengthScale H P : ℝ) (A : ℕ) (hY : 0 < Y) (hE : 0 < E) (hn : 1 ≤ n) (hL : 1 ≤ lengthScale) (hden : E*n^2 ≤ lengthScale^3) (hH : 0 ≤ H) (hP : 0 ≤ P) : (Y/n) * (P / ((min 1 (Y/(E*n^2)))^2 * (1+H)^A)) ≤ Y*P*(1+lengthScale^3/Y)^2 / (1+H)^A := by have hn0 : 0 < n := lt_of_lt_of_le zero_lt_one hn have he : 0 < E*n^2 := mul_pos hE (sq_pos_of_pos hn0) have hs : 0 < Y/(E*n^2) := div_pos hY he have hr : 0 ≤ lengthScale^3/Y := div_nonneg (pow_nonneg (zero_le_one.trans hL) _) hY.le have hi : (min 1 (Y/(E*n^2)))⁻¹ ≤ 1+lengthScale^3/Y := by by_cases h : 1 ≤ Y/(E*n^2) · rw [min_eq_left h, inv_one] linarith · rw [min_eq_right (le_of_lt (lt_of_not_ge h)), inv_div] exact (div_le_div_of_nonneg_right hden hY.le).trans (by linarith) have hi0 : 0 ≤ (min 1 (Y/(E*n^2)))⁻¹ := inv_nonneg.mpr (le_min zero_le_one hs.le) have hi2 := pow_le_pow_left₀ hi0 hi 2 have hyn : Y/n ≤ Y := div_le_self hY.le hn calc _ = (Y/n)*P*((min 1 (Y/(E*n^2)))⁻¹)^2 / (1+H)^A := by simp only [div_eq_mul_inv, mul_inv_rev, inv_pow] ring _ ≤ _ := by apply div_le_div_of_nonneg_right _ (pow_nonneg (by linarith) _) exact mul_le_mul (mul_le_mul_of_nonneg_right hyn hP) hi2 (sq_nonneg _) (mul_nonneg hY.le hP) theorem sum_pair_indicator {α : Type*} (s : Finset α) (P : α → Prop) [DecidablePred P] (U : ℝ) : (∑ a ∈ s, ∑ b ∈ s, if P a ∧ P b then U else 0) = ((s.filter P).card : ℝ)^2 * U := by calc _ = ∑ a ∈ s.filter P, ∑ b ∈ s.filter P, U := by simp only [Finset.sum_filter] apply Finset.sum_congr rfl intro a ha by_cases h : P a · simp only [h, true_and, ite_true] · simp only [h, false_and, ite_false, Finset.sum_const_zero] _ = _ := by simp only [Finset.sum_const, nsmul_eq_mul, pow_two]; ring section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) include hp hinj theorem residualTailCost_polynomial (F G E : Finset ι) (hEG : E ⊆ G) (Ψ : O →* ℂ) (hΨ : ∀ a, ‖Ψ a‖ ≤ 1) (m c d : O) (g : 𝓢(ℝ, ℂ)) (M X Y H lengthScale P : ℝ) (A : ℕ) (hX : 0 < X) (hY : 0 < Y) (hH : 0 ≤ H) (hP : 0 ≤ P) (hL : 1 ≤ lengthScale) (hXL : X * Real.exp M ≤ lengthScale) (hgM : ∀ u, g u ≠ 0 → |u| ≤ M) : residualTailCost p hg F G Ψ Ψ m c d (fun S => normalizedColumn p (fun U => g (columnLog p X U)) (G∪S)) (fun S => normalizedColumn p (fun U => g (columnLog p X U)) (G∪S)) (primeSubsetGenerator (fun i => Ideal.span {p i}) E) Y H A P ≤ if primeProductNorm p G ≤ lengthScale then (128*lengthScale)^2 * ((SchwartzMap.seminorm ℝ 0 0 g)^2 * (Y*P*(1+lengthScale^3/Y)^2/(1+H)^A)) else 0 := by let C := (SchwartzMap.seminorm ℝ 0 0 g)^2 * (Y*P*(1+lengthScale^3/Y)^2/(1+H)^A) have hC : 0 ≤ C := by dsimp [C]; positivity let w := residualPairWeight p hg Ψ Ψ m c d (fun S => normalizedColumn p (fun U => g (columnLog p X U)) (G∪S)) (fun S => normalizedColumn p (fun U => g (columnLog p X U)) (G∪S)) have hsupp (S T : Finset ι) (hw : w S T ≠ 0) : primeProductNorm p G ≤ lengthScale ∧ primeProductNorm p E ≤ lengthScale ∧ primeProductNorm p S ≤ lengthScale ∧ primeProductNorm p T ≤ lengthScale := by obtain ⟨hG,hE,hS,hT⟩ := residualPairWeight_support_bounds p hp hg Ψ m c d g M X hX hgM G E S T hEG hw exact ⟨hG.trans hXL,hE.trans hXL,hS.trans hXL,hT.trans hXL⟩ by_cases hG : primeProductNorm p G ≤ lengthScale · rw [if_pos hG] calc _ ≤ ∑ S ∈ (F\G).powerset, ∑ T ∈ (F\G).powerset, if primeProductNorm p S ≤ lengthScale ∧ primeProductNorm p T ≤ lengthScale then C else 0 := by unfold residualTailCost apply Finset.sum_le_sum intro S hS apply Finset.sum_le_sum intro T hT by_cases hd : Disjoint S T · rw [if_pos hd] dsimp only by_cases hw : w S T = 0 · change ‖w S T‖ * _ ≤ _ rw [hw, norm_zero, zero_mul] split_ifs <;> positivity · obtain ⟨_,hE,hSn,hTn⟩ := hsupp S T hw rw [if_pos ⟨hSn,hTn⟩] have hn2 : ‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖^2 = primeProductNorm p S * primeProductNorm p T := active_norm_sq_disjoint p S T hd have hn : 1 ≤ ‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖ := by have hpS := primeProductNorm_ge_one p hp S have hpT := primeProductNorm_ge_one p hp T have hpST : 1 ≤ primeProductNorm p S * primeProductNorm p T := one_le_mul_of_one_le_of_one_le hpS hpT rw [← hn2] at hpST nlinarith [norm_nonneg (eisEmbedding (∏ i : activeSupport T S, p i.val))] have hNe : 0 < ‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖^2 := SecondPassIntegration.elementNorm_pos _ (primeSubsetGenerator_ne_zero _ _) have hden : ‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖^2 * ‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖^2 ≤ lengthScale^3 := by rw [primeSubsetGenerator_norm_eq_productNorm, hn2] have hST := mul_le_mul hSn hTn (FirstPassCubeLabels.primeProductNorm_pos p hp T).le (zero_le_one.trans hL) have hEST := mul_le_mul hE hST (mul_nonneg (FirstPassCubeLabels.primeProductNorm_pos p hp S).le (FirstPassCubeLabels.primeProductNorm_pos p hp T).le) (zero_le_one.trans hL) nlinarith have hscalar := tail_radial_scalar_le Y (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖^2) (‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖) lengthScale H P A hY hNe hn hL hden hH hP exact mul_le_mul (residualPairWeight_schwartz_bound p hp hg hinj Ψ hΨ m c d g X G S T) hscalar (by positivity) (sq_nonneg _) · rw [if_neg hd] split_ifs <;> positivity _ = ((boundedPrimeSupports p (F\G) lengthScale).card : ℝ)^2 * C := sum_pair_indicator (F\G).powerset (fun S => primeProductNorm p S ≤ lengthScale) C _ ≤ (128*lengthScale)^2 * C := by exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (by positivity) (boundedPrimeSupports_card p hinj (F\G) lengthScale hL) 2) hC · rw [if_neg hG] have hz : residualTailCost p hg F G Ψ Ψ m c d (fun S => normalizedColumn p (fun U => g (columnLog p X U)) (G∪S)) (fun S => normalizedColumn p (fun U => g (columnLog p X U)) (G∪S)) (primeSubsetGenerator (fun i => Ideal.span {p i}) E) Y H A P = 0 := by unfold residualTailCost apply Finset.sum_eq_zero intro S hS apply Finset.sum_eq_zero intro T hT by_cases hd : Disjoint S T · rw [if_pos hd] have hw : w S T = 0 := by by_contra hw exact hG (hsupp S T hw).1 change ‖w S T‖ * _ = 0 rw [hw, norm_zero, zero_mul] · rw [if_neg hd] exact hz.le theorem secondSourceTailCost_polynomial (F : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a, ‖Ψ a‖ ≤ 1) (m c d : O) (g : 𝓢(ℝ, ℂ)) (M X Y H lengthScale P : ℝ) (A : ℕ) (hX : 0 < X) (hY : 0 < Y) (hH : 0 ≤ H) (hP : 0 ≤ P) (hL : 1 ≤ lengthScale) (hXL : X * Real.exp M ≤ lengthScale) (hgM : ∀ u, g u ≠ 0 → |u| ≤ M) : (∑ G ∈ F.powerset, ∑ E : G.powerset, ‖secondSourceCommonCoefficient p hg Ψ m c d G E.val‖ * residualTailCost p hg F G Ψ Ψ m c d (fun S => normalizedColumn p (fun U => g (columnLog p X U)) (G∪S)) (fun S => normalizedColumn p (fun U => g (columnLog p X U)) (G∪S)) (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) Y H A P) ≤ (128*lengthScale)^4 * ((SchwartzMap.seminorm ℝ 0 0 g)^2 * (Y*P*(1+lengthScale^3/Y)^2/(1+H)^A)) := by let C := (SchwartzMap.seminorm ℝ 0 0 g)^2 * (Y*P*(1+lengthScale^3/Y)^2/(1+H)^A) have hC : 0 ≤ C := by dsimp [C]; positivity have hB : 0 ≤ 128*lengthScale := by positivity calc _ ≤ ∑ G ∈ F.powerset, if primeProductNorm p G ≤ lengthScale then (128*lengthScale)^3*C else 0 := by apply Finset.sum_le_sum intro G hG by_cases hGn : primeProductNorm p G ≤ lengthScale · rw [if_pos hGn] have heq : boundedPrimeSupports p G lengthScale = G.powerset := by apply Finset.filter_eq_self.mpr intro E hE exact (primeProductNorm_mono p hp (Finset.mem_powerset.mp hE)).trans hGn have hcard : (G.powerset.card : ℝ) ≤ 128*lengthScale := by simpa only [heq] using boundedPrimeSupports_card p hinj G lengthScale hL calc _ ≤ ∑ E : G.powerset, (128*lengthScale)^2*C := by apply Finset.sum_le_sum intro E hE have hr := residualTailCost_polynomial p hp hg hinj F G E.val (Finset.mem_powerset.mp E.property) Ψ hΨ m c d g M X Y H lengthScale P A hX hY hH hP hL hXL hgM rw [if_pos hGn] at hr have hc := secondSourceCommonCoefficient_norm_le_one p hp hg hinj Ψ hΨ m c d G E.val exact (mul_le_mul_of_nonneg_left hr (norm_nonneg _)).trans (by simpa only [one_mul] using mul_le_mul_of_nonneg_right hc (mul_nonneg (sq_nonneg _) hC)) _ = (G.powerset.card : ℝ)*((128*lengthScale)^2*C) := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_coe, nsmul_eq_mul] _ ≤ (128*lengthScale)*((128*lengthScale)^2*C) := mul_le_mul_of_nonneg_right hcard (mul_nonneg (sq_nonneg _) hC) _ = _ := by ring · rw [if_neg hGn] apply Finset.sum_nonpos intro E hE have hr := residualTailCost_polynomial p hp hg hinj F G E.val (Finset.mem_powerset.mp E.property) Ψ hΨ m c d g M X Y H lengthScale P A hX hY hH hP hL hXL hgM rw [if_neg hGn] at hr exact mul_nonpos_of_nonneg_of_nonpos (norm_nonneg _) hr _ = ((boundedPrimeSupports p F lengthScale).card : ℝ)*((128*lengthScale)^3*C) := by rw [← Finset.sum_filter] simp only [boundedPrimeSupports, Finset.sum_const, nsmul_eq_mul] _ ≤ (128*lengthScale)*((128*lengthScale)^3*C) := mul_le_mul_of_nonneg_right (boundedPrimeSupports_card p hinj F lengthScale hL) (mul_nonneg (pow_nonneg hB _) hC) _ = _ := by ring end open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm) end open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm b0Label jLabel) open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open RayFourExpansion (RayCharacter) open SecondPassIntegration (densityChildEnergy) end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson theorem sqrt_scale_shell_upper (M B b : ℝ) (hM : 0 < M) (hB : 0 < B) (hb : B / 2 ≤ b) : Real.sqrt (M / b) ≤ 2 * Real.sqrt (M / B) := by simpa only [one_mul, div_one] using principal_middle_prefactor_bound M B b 1 1 1 1 hM hB hb (by norm_num) le_rfl (by norm_num) le_rfl theorem original_middle_rectangle_upper (M B b D₁ D₂ d e U : ℝ) (hM : 0 < M) (hB : 0 < B) (hb : B / 2 ≤ b) (hU : 0 ≤ U) (hD₁ : 0 ≤ D₁) (hD₂ : 0 ≤ D₂) (hd : D₁ ≤ d) (he : D₂ ≤ e) (hcut : d * e ≤ U * Real.sqrt (M / b)) : D₁ * D₂ ≤ (2 * U) * Real.sqrt (M / B) := by calc _ ≤ d * e := mul_le_mul hd he hD₂ (hD₁.trans hd) _ ≤ U * Real.sqrt (M / b) := hcut _ ≤ U * (2 * Real.sqrt (M / B)) := mul_le_mul_of_nonneg_left (sqrt_scale_shell_upper M B b hM hB hb) hU _ = _ := by ring theorem dual_middle_rectangle_upper (M F B b N D₁ D₂ d e U : ℝ) (hM : 0 < M) (hF : 0 < F) (hB : 0 < B) (hb : B / 2 ≤ b) (hN : 0 ≤ N) (hU : 0 ≤ U) (hD₁ : 0 ≤ D₁) (hD₂ : 0 ≤ D₂) (hd : D₁ ≤ d) (he : D₂ ≤ e) (hcut : d * e ≤ U * (N * Real.sqrt (F / (M * b)))) : D₁ * D₂ ≤ (2 * U) * (N * Real.sqrt (F / (M * B))) := by have harg (z : ℝ) : F / (M * z) = (F / M) / z := by ring simp only [harg] at hcut ⊢ have hh := original_middle_rectangle_upper (F / M) B b D₁ D₂ d e (U * N) (div_pos hF hM) hB hb (mul_nonneg hU hN) hD₁ hD₂ hd he (by simpa only [mul_assoc] using hcut) simpa only [mul_assoc] using hh variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def originalMiddleWindowAt (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) (h : O) : ℝ := by classical exact ∑ D : S, ∑ E : T, ∑ i, if P (D.val * E.val) i then (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ))) * ‖∑ j, ∑ k, originalTerm rows left right a b D.val E.val i j k * paperRadialFourier W (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ)))‖ else 0 def dualMiddleWindowAt (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (P : Ideal O → m → Prop) (h : O) : ℝ := by classical exact ∑ D : S, ∑ E : T, ∑ i, if P (D.val * E.val) i then (Real.sqrt ((M / F) / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ))) * ‖∑ j, ∑ k, originalTerm rows left right a b D.val E.val i j k * paperRadialFourier W (Real.sqrt (F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ))) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ)))‖ else 0 omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalMiddleWindowAt_bounds (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) (h : O) : 0 ≤ originalMiddleWindowAt W S T rows left right a b M P h ∧ originalMiddleWindowAt W S T rows left right a b M P h ≤ originalMiddleAt W S T rows left right a b M h := by classical constructor · unfold originalMiddleWindowAt positivity · unfold originalMiddleWindowAt originalMiddleAt gcongr with D _ E _ i _ split_ifs <;> first | exact le_rfl | positivity omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem dualMiddleWindowAt_bounds (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (P : Ideal O → m → Prop) (h : O) : 0 ≤ dualMiddleWindowAt W S T rows left right a b M F P h ∧ dualMiddleWindowAt W S T rows left right a b M F P h ≤ dualMiddleAt W S T rows left right a b M F h := by classical constructor · unfold dualMiddleWindowAt positivity · unfold dualMiddleWindowAt dualMiddleAt gcongr with D _ E _ i _ split_ifs <;> first | exact le_rfl | positivity omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalMiddleWindowAt_eq_zero (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) (h : O) (hP : ∀ (D : S) (E : T) i, ¬ P (D.val * E.val) i) : originalMiddleWindowAt W S T rows left right a b M P h = 0 := by classical simp only [originalMiddleWindowAt, hP, ite_false, Finset.sum_const_zero] omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem dualMiddleWindowAt_eq_zero (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (P : Ideal O → m → Prop) (h : O) (hP : ∀ (D : S) (E : T) i, ¬ P (D.val * E.val) i) : dualMiddleWindowAt W S T rows left right a b M F P h = 0 := by classical simp only [dualMiddleWindowAt, hP, ite_false, Finset.sum_const_zero] end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.MiddleWindows namespace OAI noncomputable section namespace CanonicalQuadraticSieve open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators section open scoped BigOperators Classical SchwartzMap section open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] variable {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M U : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hB : 1 ≤ B) (hN : 1 ≤ N) (hD₁N : D₁ ≤ N) (hD₂N : D₂ ≤ N) (hM : 0 < M) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a₀ : n → ℂ) (b₀ : p → ℂ) (a : O → n → ℂ) (b : O → p → ℂ) (ha : ∀ h j, ‖a h j‖ ≤ ‖a₀ j‖) (hb : ∀ h k, ‖b h k‖ ≤ ‖b₀ k‖) include hD₁ hD₂ hB hN hD₁N hD₂N hM hS hT hr hl hri hrows ha hb theorem HasSieveExponent.original_middle_window (hU : 0 ≤ U) (W : 𝓢(ℝ, ℂ)) (P : Ideal O → m → Prop) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hP : ∀ (D : S) (E : T) i, P (D.val * E.val) i → (Ideal.absNorm (D.val * E.val) : ℝ) ≤ U * Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ))) : Summable (fun h : {h : O // h ≠ 0} => originalMiddleWindowAt W S T rows left right (a h.val) (b h.val) M P h.val) ∧ (∑' h : {h : O // h ≠ 0}, originalMiddleWindowAt W S T rows left right (a h.val) (b h.val) M P h.val) ≤ (2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (N + (2 * U) * Real.sqrt M * B ^ (α - 1 / 2)) := by have hs0 := (actual_original_middle_all_frequencies ε hε S T D₁ D₂ B N M hD₁ hD₂ hB hN hM hS hT rows left right hr hl hri hrows a₀ b₀ a b ha hb W hleft hright).1 have hbounds (h : {h : O // h ≠ 0}) := originalMiddleWindowAt_bounds W S T rows left right (a h.val) (b h.val) M P h.val have hs := Summable.of_nonneg_of_le (fun h => (hbounds h).1) (fun h => (hbounds h).2) hs0 refine ⟨hs, ?_⟩ by_cases hcut : D₁ * D₂ ≤ (2 * U) * Real.sqrt (M / B) · exact (hs.tsum_le_tsum (fun h => (hbounds h).2) hs0).trans (hexp.original_middle_block deltaLoss hδ ε hε S T D₁ D₂ B N M (2 * U) hD₁ hD₂ hB hN hD₁N hD₂N hM hS hT rows left right hr hl hri hrows a₀ b₀ a b ha hb W hleft hright hcut) · have hp (D : S) (E : T) (i : m) : ¬ P (D.val * E.val) i := by intro hh apply hcut apply original_middle_rectangle_upper M B (Ideal.absNorm (rows i)) D₁ D₂ (Ideal.absNorm D.val) (Ideal.absNorm E.val) U hM (by linarith) (hrows i).2.1 hU (by linarith) (by linarith) (hS D.val D.property).1 (hT E.val E.property).1 simpa only [map_mul, Nat.cast_mul] using hP D E i hh have hz : (fun h : {h : O // h ≠ 0} => originalMiddleWindowAt W S T rows left right (a h.val) (b h.val) M P h.val) = fun _ => 0 := funext (fun h => originalMiddleWindowAt_eq_zero W S T rows left right (a h.val) (b h.val) M P h.val hp) rw [hz, tsum_zero] have h1 := nonzeroLatticeEnvelopeConstant_nonneg have h2 := originalMiddleDecayConstant_nonneg W have h3 := divisorEnergyFactor_nonneg ε hε N a₀ b₀ have h4 := (divisorExponentConstant_pos hexp deltaLoss hδ).le positivity theorem HasSieveExponent.dual_middle_window (hU : 0 ≤ U) (W : 𝓢(ℝ, ℂ)) (F : ℝ) (hF : 0 < F) (P : Ideal O → m → Prop) (hleft : ∀ j, Admissible (left j) ∧ N / 2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N / 2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hP : ∀ (D : S) (E : T) i, P (D.val * E.val) i → (Ideal.absNorm (D.val * E.val) : ℝ) ≤ U * (N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ))))) : Summable (fun h : {h : O // h ≠ 0} => dualMiddleWindowAt W S T rows left right (a h.val) (b h.val) M F P h.val) ∧ (∑' h : {h : O // h ≠ 0}, dualMiddleWindowAt W S T rows left right (a h.val) (b h.val) M F P h.val) ≤ (2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (M / F + (2 * U) * Real.sqrt (M / F) * B ^ (α - 1 / 2)) := by have hs0 := (actual_dual_middle_all_frequencies ε hε S T D₁ D₂ B N M F hD₁ hD₂ hB hN hM hF hS hT rows left right hr hl hri hrows a₀ b₀ a b ha hb W hleft hright).1 have hbounds (h : {h : O // h ≠ 0}) := dualMiddleWindowAt_bounds W S T rows left right (a h.val) (b h.val) M F P h.val have hs := Summable.of_nonneg_of_le (fun h => (hbounds h).1) (fun h => (hbounds h).2) hs0 refine ⟨hs, ?_⟩ by_cases hcut : D₁ * D₂ ≤ (2 * U) * (N * Real.sqrt (F / (M * B))) · exact (hs.tsum_le_tsum (fun h => (hbounds h).2) hs0).trans (hexp.dual_middle_block deltaLoss hδ ε hε S T D₁ D₂ B N M (2 * U) hD₁ hD₂ hB hN hD₁N hD₂N hM hS hT rows left right hr hl hri hrows a₀ b₀ a b ha hb W F hF hleft hright hcut) · have hp (D : S) (E : T) (i : m) : ¬ P (D.val * E.val) i := by intro hh apply hcut apply dual_middle_rectangle_upper M F B (Ideal.absNorm (rows i)) N D₁ D₂ (Ideal.absNorm D.val) (Ideal.absNorm E.val) U hM hF (by linarith) (hrows i).2.1 (by linarith) hU (by linarith) (by linarith) (hS D.val D.property).1 (hT E.val E.property).1 simpa only [map_mul, Nat.cast_mul] using hP D E i hh have hz : (fun h : {h : O // h ≠ 0} => dualMiddleWindowAt W S T rows left right (a h.val) (b h.val) M F P h.val) = fun _ => 0 := funext (fun h => dualMiddleWindowAt_eq_zero W S T rows left right (a h.val) (b h.val) M F P h.val hp) rw [hz, tsum_zero] have h1 := nonzeroLatticeEnvelopeConstant_nonneg have h2 := dualMiddleDecayConstant_nonneg W have h3 := divisorEnergyFactor_nonneg ε hε N a₀ b₀ have h4 := (divisorExponentConstant_pos hexp deltaLoss hδ).le positivity end section open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson FourierBridge theorem large_principal_scale_shape (X N Q D V : ℝ) (hD : 0 < D) (hcut : X * N ≤ V * D) : (X / D) * (N + Q * D) ≤ V + X * Q := by have hh : X * N / D ≤ V := (div_le_iff₀ hD).mpr hcut calc _ = X * N / D + X * Q := by field_simp _ ≤ _ := add_le_add hh le_rfl variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def principalCorrectionAt (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) : ℝ := ∑ D : S, ∑ E : T, ∑ i, (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D.val : ℝ) * (Ideal.absNorm E.val : ℝ))) * ‖∑ j, ∑ k, originalTerm rows left right a b D.val E.val i j k‖ variable (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2 * D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2 * D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) include hD₁ hD₂ hB hN hM hS hT hr hl hri hrows hleft hright theorem principalCorrectionAt_bound : principalCorrectionAt S T rows left right a b M ≤ (2 * Real.sqrt (M / B) / (D₁ * D₂)) * Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N a b) := by have hh := canonical_original_divisor_block_phase_bound ε hε S T D₁ D₂ B N hD₁ hD₂ hN hS hT rows left right hr hl hri (fun i => ⟨(hrows i).1, (hrows i).2.2⟩) hleft hright a b (fun _ => 0) (fun _ => 0) 0 simp only [zero_add, logPhase_zero, mul_one] at hh have heq : (∑ D : S, ∑ E : T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D.val E.val i j k‖) = ∑ D ∈ S, ∑ E ∈ T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k‖ := by rw [Finset.sum_coe_sort S (fun D => ∑ E : T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D E.val i j k‖)] apply Finset.sum_congr rfl intro D hD exact Finset.sum_coe_sort T (fun E => ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k‖) have hp := principal_middle_prefactor_sum S T rows (fun D E i => ‖∑ j, ∑ k, originalTerm rows left right a b D.val E.val i j k‖) (fun _ _ _ => norm_nonneg _) M B D₁ D₂ hM (by linarith) (by linarith) (by linarith) (fun i => (hrows i).2.1) (fun D hD => (hS D hD).1) (fun E hE => (hT E hE).1) change principalCorrectionAt S T rows left right a b M ≤ _ at hp rw [heq] at hp exact hp.trans (mul_le_mul_of_nonneg_left hh (by positivity)) theorem HasSieveExponent.large_principal_correction {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (hD₁N : D₁ ≤ N) (hD₂N : D₂ ≤ N) (V : ℝ) (hcut : Real.sqrt (M / B) * N ≤ V * (D₁ * D₂)) : principalCorrectionAt S T rows left right a b M ≤ 2 * divisorEnergyFactor ε hε N a b * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (V + Real.sqrt M * B ^ (α - 1 / 2)) := by have hb := principalCorrectionAt_bound ε hε S T D₁ D₂ B N M hD₁ hD₂ hB hN hM hS hT rows left right hr hl hri hrows hleft hright a b have hc := divisor_cost_with_constant hexp deltaLoss hδ ε hε B N D₁ D₂ hB hN hD₁ hD₂ hD₁N hD₂N a b have hf := divisorEnergyFactor_nonneg ε hε N a b have hconst := (divisorExponentConstant_pos hexp deltaLoss hδ).le calc _ ≤ (2 * Real.sqrt (M / B) / (D₁ * D₂)) * (divisorEnergyFactor ε hε N a b * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss * (N + B ^ α * (D₁ * D₂)))) := hb.trans (mul_le_mul_of_nonneg_left hc (by positivity)) _ = (2 * divisorEnergyFactor ε hε N a b * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss)) * ((Real.sqrt (M / B) / (D₁ * D₂)) * (N + B ^ α * (D₁ * D₂))) := by ring _ ≤ (2 * divisorEnergyFactor ε hε N a b * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss)) * (V + Real.sqrt (M / B) * B ^ α) := mul_le_mul_of_nonneg_left (large_principal_scale_shape _ _ _ _ _ (by positivity) hcut) (by positivity) _ = _ := by rw [sqrt_div_mul_rpow M B α hM.le (by linarith)] end section open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] theorem sum_two_subtype_pools {A : Type*} [AddCommMonoid A] (S T : Finset (Ideal O)) (f : Ideal O → Ideal O → A) : (∑ D : S, ∑ E : T, f D.val E.val) = ∑ D ∈ S, ∑ E ∈ T, f D E := by rw [Finset.sum_coe_sort S (fun D => ∑ E : T, f D E.val)] apply Finset.sum_congr rfl intro D hD exact Finset.sum_coe_sort T (f D) omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalMiddleWindowAt_eq_finset (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) (h : O) : originalMiddleWindowAt W S T rows left right a b M P h = ∑ D ∈ S, ∑ E ∈ T, ∑ i, if P (D * E) i then (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D : ℝ) * (Ideal.absNorm E : ℝ))) * ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k * paperRadialFourier W (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D : ℝ) * (Ideal.absNorm E : ℝ)))‖ else 0 := by classical unfold originalMiddleWindowAt exact sum_two_subtype_pools (A := ℝ) S T (fun D E => ∑ i, if P (D * E) i then (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D : ℝ) * (Ideal.absNorm E : ℝ))) * ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k * paperRadialFourier W (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D : ℝ) * (Ideal.absNorm E : ℝ)))‖ else 0) omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalMiddleWindowAt_dyadic (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (N : ℝ) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) (h : O) : originalMiddleWindowAt W S T rows left right a b M P h = ∑ j : Fin (columnDyadicLength N + 1), ∑ k : Fin (columnDyadicLength N + 1), originalMiddleWindowAt W (divisorDyadicBin S N j) (divisorDyadicBin T N k) rows left right a b M P h := by classical simp_rw [originalMiddleWindowAt_eq_finset] exact sum_divisorDyadicRectangles (A := ℝ) S T N _ theorem HasSieveExponent.original_middle_pool {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (B N M U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hU : 0 ≤ U) (hS : ∀ D ∈ S, 1 ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ N) (hT : ∀ E ∈ T, 1 ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ N) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a₀ : n → ℂ) (b₀ : p → ℂ) (a : O → n → ℂ) (b : O → p → ℂ) (ha : ∀ h j, ‖a h j‖ ≤ ‖a₀ j‖) (hb : ∀ h k, ‖b h k‖ ≤ ‖b₀ k‖) (W : 𝓢(ℝ, ℂ)) (P : Ideal O → m → Prop) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hP : ∀ (D : S) (E : T) i, P (D.val * E.val) i → (Ideal.absNorm (D.val * E.val) : ℝ) ≤ U * Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ))) : Summable (fun h : {h : O // h ≠ 0} => originalMiddleWindowAt W S T rows left right (a h.val) (b h.val) M P h.val) ∧ (∑' h : {h : O // h ≠ 0}, originalMiddleWindowAt W S T rows left right (a h.val) (b h.val) M P h.val) ≤ ((columnDyadicLength N + 1 : ℕ) : ℝ) ^ 2 * ((2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (N + (2 * U) * Real.sqrt M * B ^ (α - 1 / 2))) := by classical let V := (2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (N + (2 * U) * Real.sqrt M * B ^ (α - 1 / 2)) have hV : 0 ≤ V := by have h1 := nonzeroLatticeEnvelopeConstant_nonneg have h2 := originalMiddleDecayConstant_nonneg W have h3 := divisorEnergyFactor_nonneg ε hε N a₀ b₀ have h4 := (divisorExponentConstant_pos hexp deltaLoss hδ).le dsimp only [V] positivity let f := fun (j k : Fin (columnDyadicLength N + 1)) (h : {h : O // h ≠ 0}) => originalMiddleWindowAt W (divisorDyadicBin S N j) (divisorDyadicBin T N k) rows left right (a h.val) (b h.val) M P h.val have hf (j k : Fin (columnDyadicLength N + 1)) : Summable (f j k) ∧ (∑' h, f j k h) ≤ V := by by_cases hSj : (divisorDyadicBin S N j).Nonempty · by_cases hTk : (divisorDyadicBin T N k).Nonempty · exact hexp.original_middle_window deltaLoss hδ ε hε (divisorDyadicBin S N j) (divisorDyadicBin T N k) (divisorDyadicScale j.val) (divisorDyadicScale k.val) B N M U (divisorDyadicScale_ge_one _) (divisorDyadicScale_ge_one _) hB hN (divisorDyadicBin_scale_le S N hS j hSj) (divisorDyadicBin_scale_le T N hT k hTk) hM (divisorDyadicBin_bounds S N hS j) (divisorDyadicBin_bounds T N hT k) rows left right hr hl hri hrows a₀ b₀ a b ha hb hU W P hleft hright (fun D E i hp => hP ⟨D.val, (Finset.mem_filter.mp D.property).1⟩ ⟨E.val, (Finset.mem_filter.mp E.property).1⟩ i hp) · have hz := Finset.not_nonempty_iff_eq_empty.mp hTk have he : f j k = fun _ => 0 := by funext h apply originalMiddleWindowAt_eq_zero intro D E i hp have hh := E.property simp only [hz, Finset.notMem_empty] at hh rw [he] simpa only [tsum_zero] using And.intro (summable_zero : Summable (fun _ : {h : O // h ≠ 0} => (0 : ℝ))) hV · have hz := Finset.not_nonempty_iff_eq_empty.mp hSj have he : f j k = fun _ => 0 := by funext h apply originalMiddleWindowAt_eq_zero intro D E i hp have hh := D.property simp only [hz, Finset.notMem_empty] at hh rw [he] simpa only [tsum_zero] using And.intro (summable_zero : Summable (fun _ : {h : O // h ≠ 0} => (0 : ℝ))) hV have he : (fun h : {h : O // h ≠ 0} => originalMiddleWindowAt W S T rows left right (a h.val) (b h.val) M P h.val) = fun h => ∑ j, ∑ k, f j k h := by funext h exact originalMiddleWindowAt_dyadic W S T N rows left right (a h.val) (b h.val) M P h.val rw [he] refine ⟨summable_sum (fun j _ => summable_sum (fun k _ => (hf j k).1)), ?_⟩ rw [Summable.tsum_finsetSum (fun j _ => summable_sum (fun k _ => (hf j k).1))] calc _ = ∑ j, ∑ k, ∑' h, f j k h := by apply Finset.sum_congr rfl intro j hj exact Summable.tsum_finsetSum (fun k _ => (hf j k).1) _ ≤ ∑ j : Fin (columnDyadicLength N + 1), ∑ k : Fin (columnDyadicLength N + 1), V := Finset.sum_le_sum (fun j _ => Finset.sum_le_sum (fun k _ => (hf j k).2)) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, V, pow_two]; ring end open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem dualMiddleWindowAt_eq_finset (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (P : Ideal O → m → Prop) (h : O) : dualMiddleWindowAt W S T rows left right a b M F P h = ∑ D ∈ S, ∑ E ∈ T, ∑ i, if P (D * E) i then (Real.sqrt ((M / F) / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D : ℝ) * (Ideal.absNorm E : ℝ))) * ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k * paperRadialFourier W (Real.sqrt (F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ))) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D : ℝ) * (Ideal.absNorm E : ℝ)))‖ else 0 := by classical unfold dualMiddleWindowAt exact sum_two_subtype_pools (A := ℝ) S T (fun D E => ∑ i, if P (D * E) i then (Real.sqrt ((M / F) / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D : ℝ) * (Ideal.absNorm E : ℝ))) * ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k * paperRadialFourier W (Real.sqrt (F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ))) * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm D : ℝ) * (Ideal.absNorm E : ℝ)))‖ else 0) omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem dualMiddleWindowAt_dyadic (W : 𝓢(ℝ, ℂ)) (S T : Finset (Ideal O)) (N : ℝ) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (P : Ideal O → m → Prop) (h : O) : dualMiddleWindowAt W S T rows left right a b M F P h = ∑ j : Fin (columnDyadicLength N + 1), ∑ k : Fin (columnDyadicLength N + 1), dualMiddleWindowAt W (divisorDyadicBin S N j) (divisorDyadicBin T N k) rows left right a b M F P h := by classical simp_rw [dualMiddleWindowAt_eq_finset] exact sum_divisorDyadicRectangles (A := ℝ) S T N _ theorem HasSieveExponent.dual_middle_pool {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (B N M F U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hU : 0 ≤ U) (hS : ∀ D ∈ S, 1 ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ N) (hT : ∀ E ∈ T, 1 ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ N) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a₀ : n → ℂ) (b₀ : p → ℂ) (a : O → n → ℂ) (b : O → p → ℂ) (ha : ∀ h j, ‖a h j‖ ≤ ‖a₀ j‖) (hb : ∀ h k, ‖b h k‖ ≤ ‖b₀ k‖) (W : 𝓢(ℝ, ℂ)) (P : Ideal O → m → Prop) (hleft : ∀ j, Admissible (left j) ∧ N / 2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N / 2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hP : ∀ (D : S) (E : T) i, P (D.val * E.val) i → (Ideal.absNorm (D.val * E.val) : ℝ) ≤ U * (N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ))))) : Summable (fun h : {h : O // h ≠ 0} => dualMiddleWindowAt W S T rows left right (a h.val) (b h.val) M F P h.val) ∧ (∑' h : {h : O // h ≠ 0}, dualMiddleWindowAt W S T rows left right (a h.val) (b h.val) M F P h.val) ≤ ((columnDyadicLength N + 1 : ℕ) : ℝ) ^ 2 * ((2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (M / F + (2 * U) * Real.sqrt (M / F) * B ^ (α - 1 / 2))) := by classical let V := (2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (M / F + (2 * U) * Real.sqrt (M / F) * B ^ (α - 1 / 2)) have hV : 0 ≤ V := by have h1 := nonzeroLatticeEnvelopeConstant_nonneg have h2 := dualMiddleDecayConstant_nonneg W have h3 := divisorEnergyFactor_nonneg ε hε N a₀ b₀ have h4 := (divisorExponentConstant_pos hexp deltaLoss hδ).le dsimp only [V] positivity let f := fun (j k : Fin (columnDyadicLength N + 1)) (h : {h : O // h ≠ 0}) => dualMiddleWindowAt W (divisorDyadicBin S N j) (divisorDyadicBin T N k) rows left right (a h.val) (b h.val) M F P h.val have hf (j k : Fin (columnDyadicLength N + 1)) : Summable (f j k) ∧ (∑' h, f j k h) ≤ V := by by_cases hSj : (divisorDyadicBin S N j).Nonempty · by_cases hTk : (divisorDyadicBin T N k).Nonempty · exact hexp.dual_middle_window deltaLoss hδ ε hε (divisorDyadicBin S N j) (divisorDyadicBin T N k) (divisorDyadicScale j.val) (divisorDyadicScale k.val) B N M U (divisorDyadicScale_ge_one _) (divisorDyadicScale_ge_one _) hB hN (divisorDyadicBin_scale_le S N hS j hSj) (divisorDyadicBin_scale_le T N hT k hTk) hM (divisorDyadicBin_bounds S N hS j) (divisorDyadicBin_bounds T N hT k) rows left right hr hl hri hrows a₀ b₀ a b ha hb hU W F hF P hleft hright (fun D E i hp => hP ⟨D.val, (Finset.mem_filter.mp D.property).1⟩ ⟨E.val, (Finset.mem_filter.mp E.property).1⟩ i hp) · have hz := Finset.not_nonempty_iff_eq_empty.mp hTk have he : f j k = fun _ => 0 := by funext h apply dualMiddleWindowAt_eq_zero intro D E i hp have hh := E.property simp only [hz, Finset.notMem_empty] at hh rw [he] simpa only [tsum_zero] using And.intro (summable_zero : Summable (fun _ : {h : O // h ≠ 0} => (0 : ℝ))) hV · have hz := Finset.not_nonempty_iff_eq_empty.mp hSj have he : f j k = fun _ => 0 := by funext h apply dualMiddleWindowAt_eq_zero intro D E i hp have hh := D.property simp only [hz, Finset.notMem_empty] at hh rw [he] simpa only [tsum_zero] using And.intro (summable_zero : Summable (fun _ : {h : O // h ≠ 0} => (0 : ℝ))) hV have he : (fun h : {h : O // h ≠ 0} => dualMiddleWindowAt W S T rows left right (a h.val) (b h.val) M F P h.val) = fun h => ∑ j, ∑ k, f j k h := by funext h exact dualMiddleWindowAt_dyadic W S T N rows left right (a h.val) (b h.val) M F P h.val rw [he] refine ⟨summable_sum (fun j _ => summable_sum (fun k _ => (hf j k).1)), ?_⟩ rw [Summable.tsum_finsetSum (fun j _ => summable_sum (fun k _ => (hf j k).1))] calc _ = ∑ j, ∑ k, ∑' h, f j k h := by apply Finset.sum_congr rfl intro j hj exact Summable.tsum_finsetSum (fun k _ => (hf j k).1) _ ≤ ∑ j : Fin (columnDyadicLength N + 1), ∑ k : Fin (columnDyadicLength N + 1), V := Finset.sum_le_sum (fun j _ => Finset.sum_le_sum (fun k _ => (hf j k).2)) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, V, pow_two]; ring end open scoped BigOperators Classical SchwartzMap open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson theorem norm_double_sum_real_factor {n p : Type*} [Fintype n] [Fintype p] (u : n → p → ℂ) (z : ℂ) (c : ℝ) (hc : 0 ≤ c) : ‖∑ j, ∑ k, u j k * ((c : ℂ) * z)‖ = c * ‖∑ j, ∑ k, u j k * z‖ := by simp only [← Finset.sum_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hc] ring variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def originalPrincipalKernel (W : 𝓢(ℝ, ℂ)) (rows : m → Ideal O) (M : ℝ) (h : O) (d : Ideal O) (i : m) : ℂ := ((Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) / (Ideal.absNorm d : ℝ) : ℝ) : ℂ) * paperRadialFourier W (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm d : ℝ)) def originalProductDivisorMiddleAt (W : 𝓢(ℝ, ℂ)) (K : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) (h : O) : ℝ := by classical exact ∑ i, ∑ d ∈ K, if P d i then ‖∑ j, ∑ k, if d ∣ left j * right k then originalTerm rows left right a b 1 1 i j k * originalPrincipalKernel W rows M h d i else 0‖ else 0 omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalProductDivisorMiddleAt_nonneg (W : 𝓢(ℝ, ℂ)) (K : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) (h : O) : 0 ≤ originalProductDivisorMiddleAt W K rows left right a b M P h := by classical unfold originalProductDivisorMiddleAt positivity omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalProductDivisorMiddleAt_le_window (W : 𝓢(ℝ, ℂ)) (K S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) (h : O) (hleft : ∀ j, left j ≠ 0) (hright : ∀ k, right k ≠ 0) (hS : ∀ j D, D ∣ left j → D ∈ S) (hT : ∀ k E, E ∣ right k → E ∈ T) : originalProductDivisorMiddleAt W K rows left right a b M P h ≤ originalMiddleWindowAt W S T rows left right a b M (fun d i => d ∈ K ∧ P d i) h := by classical have hp (i : m) := originalColumnSum_divisor_rectangles K S T rows left right a b i hleft hright hS hT P (fun d i _ _ => originalPrincipalKernel W rows M h d i) apply (Finset.sum_le_sum (fun i _ => hp i)).trans_eq rw [originalMiddleWindowAt_eq_finset] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro D hD rw [Finset.sum_comm] apply Finset.sum_congr rfl intro E hE apply Finset.sum_congr rfl intro i hi by_cases hd : D * E ∈ K · by_cases hpi : P (D * E) i · simp only [hd, hpi, and_self, ite_true] unfold originalPrincipalKernel simp only [map_mul, Nat.cast_mul] exact norm_double_sum_real_factor _ _ _ (by positivity) · simp only [hd, hpi, and_false, ite_false, ite_true] · simp only [hd, false_and, ite_false] theorem HasSieveExponent.original_product_divisor_middle {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (K : Finset (Ideal O)) (B N M U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hU : 0 ≤ U) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a₀ : n → ℂ) (b₀ : p → ℂ) (a : O → n → ℂ) (b : O → p → ℂ) (ha : ∀ h j, ‖a h j‖ ≤ ‖a₀ j‖) (hb : ∀ h k, ‖b h k‖ ≤ ‖b₀ k‖) (W : 𝓢(ℝ, ℂ)) (P : Ideal O → m → Prop) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hP : ∀ d ∈ K, ∀ i, P d i → (Ideal.absNorm d : ℝ) ≤ U * Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ))) : Summable (fun h : {h : O // h ≠ 0} => originalProductDivisorMiddleAt W K rows left right (a h.val) (b h.val) M P h.val) ∧ (∑' h : {h : O // h ≠ 0}, originalProductDivisorMiddleAt W K rows left right (a h.val) (b h.val) M P h.val) ≤ ((columnDyadicLength N + 1 : ℕ) : ℝ) ^ 2 * ((2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (N + (2 * U) * Real.sqrt M * B ^ (α - 1 / 2))) := by let S := columnDivisorPool left let T := columnDivisorPool right have hl0 : ∀ j, left j ≠ 0 := fun j => (hleft j).1.1 have hr0 : ∀ k, right k ≠ 0 := fun k => (hright k).1.1 have hs := hexp.original_middle_pool deltaLoss hδ ε hε S T B N M U hB hN hM hU (columnDivisorPool_norm_bounds left hl0 N (fun j => (hleft j).2)) (columnDivisorPool_norm_bounds right hr0 N (fun k => (hright k).2)) rows left right hr hl hri hrows a₀ b₀ a b ha hb W (fun d i => d ∈ K ∧ P d i) hleft hright (fun D E i hp => hP _ hp.1 i hp.2) have hdom (h : {h : O // h ≠ 0}) := originalProductDivisorMiddleAt_le_window W K S T rows left right (a h.val) (b h.val) M P h.val hl0 hr0 (mem_columnDivisorPool_of_dvd left hl0) (mem_columnDivisorPool_of_dvd right hr0) have ht := Summable.of_nonneg_of_le (fun h : {h : O // h ≠ 0} => originalProductDivisorMiddleAt_nonneg W K rows left right (a h.val) (b h.val) M P h.val) hdom hs.1 exact ⟨ht, (ht.tsum_le_tsum hdom hs.1).trans hs.2⟩ end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.GreenIntegrals namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve open ActualEisensteinCubic ConcreteTraceCRT EisensteinSchwartzPoisson theorem norm_double_sum_real_factor_fun {n p : Type*} [Fintype n] [Fintype p] (u z : n → p → ℂ) (c : ℝ) (hc : 0 ≤ c) : ‖∑ j, ∑ k, u j k * ((c : ℂ) * z j k)‖ = c * ‖∑ j, ∑ k, u j k * z j k‖ := by have he : (∑ j, ∑ k, u j k * ((c : ℂ) * z j k)) = (c : ℂ) * ∑ j, ∑ k, u j k * z j k := by simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro k hk ring rw [he, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hc] variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def dualPrincipalKernel (W : 𝓢(ℝ, ℂ)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (M F : ℝ) (h : O) (d : Ideal O) (i : m) (j : n) (k : p) : ℂ := ((Real.sqrt ((M / F) / (Ideal.absNorm (rows i) : ℝ)) / (Ideal.absNorm d : ℝ) : ℝ) : ℂ) * paperRadialFourier W (Real.sqrt (F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ))) * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm d : ℝ)) def dualProductDivisorMiddleAt (W : 𝓢(ℝ, ℂ)) (K : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (P : Ideal O → m → Prop) (h : O) : ℝ := by classical exact ∑ i, ∑ d ∈ K, if P d i then ‖∑ j, ∑ k, if d ∣ left j * right k then originalTerm rows left right a b 1 1 i j k * dualPrincipalKernel W rows left right M F h d i j k else 0‖ else 0 omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem dualProductDivisorMiddleAt_nonneg (W : 𝓢(ℝ, ℂ)) (K : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (P : Ideal O → m → Prop) (h : O) : 0 ≤ dualProductDivisorMiddleAt W K rows left right a b M F P h := by classical unfold dualProductDivisorMiddleAt positivity omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem dualProductDivisorMiddleAt_le_window (W : 𝓢(ℝ, ℂ)) (K S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (P : Ideal O → m → Prop) (h : O) (hleft : ∀ j, left j ≠ 0) (hright : ∀ k, right k ≠ 0) (hS : ∀ j D, D ∣ left j → D ∈ S) (hT : ∀ k E, E ∣ right k → E ∈ T) : dualProductDivisorMiddleAt W K rows left right a b M F P h ≤ dualMiddleWindowAt W S T rows left right a b M F (fun d i => d ∈ K ∧ P d i) h := by classical have hp (i : m) := originalColumnSum_divisor_rectangles K S T rows left right a b i hleft hright hS hT P (fun d i j k => dualPrincipalKernel W rows left right M F h d i j k) apply (Finset.sum_le_sum (fun i _ => hp i)).trans_eq rw [dualMiddleWindowAt_eq_finset] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro D hD rw [Finset.sum_comm] apply Finset.sum_congr rfl intro E hE apply Finset.sum_congr rfl intro i hi by_cases hd : D * E ∈ K · by_cases hpi : P (D * E) i · simp only [hd, hpi, and_self, ite_true] unfold dualPrincipalKernel simp only [map_mul, Nat.cast_mul] exact norm_double_sum_real_factor_fun _ _ _ (by positivity) · simp only [hd, hpi, and_false, ite_false, ite_true] · simp only [hd, false_and, ite_false] theorem HasSieveExponent.dual_product_divisor_middle {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (K : Finset (Ideal O)) (B N M F U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hU : 0 ≤ U) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a₀ : n → ℂ) (b₀ : p → ℂ) (a : O → n → ℂ) (b : O → p → ℂ) (ha : ∀ h j, ‖a h j‖ ≤ ‖a₀ j‖) (hb : ∀ h k, ‖b h k‖ ≤ ‖b₀ k‖) (W : 𝓢(ℝ, ℂ)) (P : Ideal O → m → Prop) (hleft : ∀ j, Admissible (left j) ∧ N / 2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N / 2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hP : ∀ d ∈ K, ∀ i, P d i → (Ideal.absNorm d : ℝ) ≤ U * (N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ))))) : Summable (fun h : {h : O // h ≠ 0} => dualProductDivisorMiddleAt W K rows left right (a h.val) (b h.val) M F P h.val) ∧ (∑' h : {h : O // h ≠ 0}, dualProductDivisorMiddleAt W K rows left right (a h.val) (b h.val) M F P h.val) ≤ ((columnDyadicLength N + 1 : ℕ) : ℝ) ^ 2 * ((2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * divisorEnergyFactor ε hε N a₀ b₀ * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (M / F + (2 * U) * Real.sqrt (M / F) * B ^ (α - 1 / 2))) := by let S := columnDivisorPool left let T := columnDivisorPool right have hl0 : ∀ j, left j ≠ 0 := fun j => (hleft j).1.1 have hr0 : ∀ k, right k ≠ 0 := fun k => (hright k).1.1 have hs := hexp.dual_middle_pool deltaLoss hδ ε hε S T B N M F U hB hN hM hF hU (columnDivisorPool_norm_bounds left hl0 N (fun j => (hleft j).2.2)) (columnDivisorPool_norm_bounds right hr0 N (fun k => (hright k).2.2)) rows left right hr hl hri hrows a₀ b₀ a b ha hb W (fun d i => d ∈ K ∧ P d i) hleft hright (fun D E i hp => hP _ hp.1 i hp.2) have hdom (h : {h : O // h ≠ 0}) := dualProductDivisorMiddleAt_le_window W K S T rows left right (a h.val) (b h.val) M F P h.val hl0 hr0 (mem_columnDivisorPool_of_dvd left hl0) (mem_columnDivisorPool_of_dvd right hr0) have ht := Summable.of_nonneg_of_le (fun h : {h : O // h ≠ 0} => dualProductDivisorMiddleAt_nonneg W K rows left right (a h.val) (b h.val) M F P h.val) hdom hs.1 exact ⟨ht, (ht.tsum_le_tsum hdom hs.1).trans hs.2⟩ end CanonicalQuadraticSieve namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) include hc in theorem secondChildColumn_norm_le_test (Ψ : O →* ℂ) (hΨ : ∀ a, ‖Ψ a‖ ≤ 1) (m f y : O) (H : Finset ι → ℂ) (S : Finset ι) : ‖secondChildColumn p hp hcop hg Ψ m f y H S‖ ≤ ‖H S‖ := by have hm : ‖rowCoprimeMask (fun i => Ideal.span {p i}) S m‖ ≤ 1 := by unfold rowCoprimeMask split_ifs <;> norm_num simp only [secondChildColumn,norm_mul,norm_pow,columnCoefficient_norm_one p hp hcop hg hc] calc _ ≤ 1 * 1 * 1 * 1^4 * 1 * ‖H S‖ := by gcongr <;> first | exact hΨ _ | exact hm | exact finiteSquarefreeRow_norm_le_one _ hg S f | exact finiteSquarefreeRow_norm_le_one _ hg S y _ = _ := by ring include hc in theorem fixedChildRow_elementary (hinj : Function.Injective (fun i => Ideal.span {p i})) (F : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a, ‖Ψ a‖ ≤ 1) (m f y : O) (H : Finset ι → ℂ) (X M : ℝ) (hX : 1 ≤ X) (hM : 0 ≤ M) (hH : ∀ S, ‖H S‖ ≤ M) (hSupp : ∀ S, H S ≠ 0 → primeProductNorm p S ≤ X) : ‖fixedChildRow p hp hcop hg F Ψ m H f y‖ ≤ 128 * X * M := by have heq : fixedChildRow p hp hcop hg F Ψ m H f y = ∑ S ∈ boundedPrimeSupports p F X, secondChildColumn p hp hcop hg Ψ m f y H S := by symm apply Finset.sum_subset (Finset.filter_subset _ _) intro S hS hn have hHS : H S = 0 := by by_contra h exact hn (Finset.mem_filter.mpr ⟨hS,hSupp S h⟩) simp only [secondChildColumn,hHS,mul_zero] rw [heq] calc _ ≤ ∑ S ∈ boundedPrimeSupports p F X, ‖secondChildColumn p hp hcop hg Ψ m f y H S‖ := norm_sum_le _ _ _ ≤ ∑ S ∈ boundedPrimeSupports p F X, M := Finset.sum_le_sum (fun S hS => (secondChildColumn_norm_le_test p hp hcop hg hc Ψ hΨ m f y H S).trans (hH S)) _ = ((boundedPrimeSupports p F X).card : ℝ) * M := by simp _ ≤ _ := mul_le_mul_of_nonneg_right (boundedPrimeSupports_card p hinj F X hX) hM end SecondPassArithmetic namespace DescentFiberCost open ActualEisensteinCubic ConcreteTraceCRT open ShortDraftLatticeCount ActualEisensteinCoordinates theorem finite_element_count_real (S : Finset O) (K : ℝ) (hK : 1 ≤ K) (hS : ∀ z ∈ S, ‖eisEmbedding z‖^2 ≤ K) : (S.card : ℝ) ≤ 128*K := by have hbound : ∀ z ∈ S, q (coords z) ≤ (⌊K⌋₊ : ℕ) := by intro z hz have hq : (qNat z : ℝ) ≤ K := by rw [qNat_eq_absNorm_span, ← eisEmbedding_norm_sq_eq_absNorm_span] exact hS z hz have hn := Nat.le_floor hq have he : (qNat z : ℤ) = q (coords z) := Int.toNat_of_nonneg (qO_nonneg z) rw [← he] exact_mod_cast hn have hcard := actual_eisenstein_count S ⌊K⌋₊ hbound have hr : (S.card : ℝ) ≤ 64*((⌊K⌋₊ : ℝ)+1) := by exact_mod_cast hcard have hf : (⌊K⌋₊ : ℝ) ≤ K := Nat.floor_le (by linarith) linarith theorem finite_label_row_count (T : Finset (Ideal O × O)) (F K : ℝ) (hF : 1 ≤ F) (hK : 1 ≤ K) (hT : ∀ z ∈ T, z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ F ∧ ‖eisEmbedding z.2‖^2 ≤ K) : (T.card : ℝ) ≤ 128^2 * F * K := by let I := T.image Prod.fst let R := T.image Prod.snd have hI : (I.card : ℝ) ≤ 128*F := by apply finite_ideal_count_real I F hF · intro J hJ obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hJ exact (hT z hz).1 · intro J hJ obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hJ exact (hT z hz).2.1 have hR : (R.card : ℝ) ≤ 128*K := by apply finite_element_count_real R K hK intro a ha obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp ha exact (hT z hz).2.2 have hsub : T ⊆ I ×ˢ R := by intro z hz exact Finset.mem_product.mpr ⟨Finset.mem_image.mpr ⟨z,hz,rfl⟩,Finset.mem_image.mpr ⟨z,hz,rfl⟩⟩ have hn := Finset.card_le_card hsub rw [Finset.card_product] at hn calc _ ≤ (I.card : ℝ) * R.card := by exact_mod_cast hn _ ≤ (128*F)*(128*K) := mul_le_mul hI hR (Nat.cast_nonneg _) (by linarith) _ = _ := by ring end DescentFiberCost namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation open FirstPassCubeLabels (primeProductNorm columnLog) theorem childEnergy_elementary_normalized {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a, ‖Ψ a‖ ≤ 1) (m : O) (T : Finset (Ideal O × O)) (V : ℝ → ℂ) (X F K A M a b : ℝ) (hX : 0 < X) (hF : 1 ≤ F) (hK : 1 ≤ K) (_hA : 0 ≤ A) (hM : 0 ≤ M) (hV : ∀ s, ‖V s‖ ≤ M) (hVsupp : ∀ s, V s ≠ 0 → |s| ≤ A) (hT : ∀ z ∈ T, z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ F ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ K) (testNegative rowNegative : Bool) : childEnergy p hp hcop hg pool Ψ m T V X testNegative rowNegative a b / (X*F) ≤ 6 * 128^4 * K * (max 1 (X*Real.exp A))^2 * M^2 / X := by let H := fixedSecondTest p V X a b testNegative let Y := max 1 (X*Real.exp A) have hX0 : 0 < X := hX have hF0 : 0 < F := by linarith have hY : 1 ≤ Y := le_max_left _ _ have hH : ∀ S, ‖H S‖ ≤ M := by intro S cases testNegative <;> simpa only [H,fixedSecondTest,Bool.false_eq_true,ite_false,ite_true, fixedColumnTest,norm_mul,norm_star,FourierBridge.logPhase_norm,mul_one] using hV (columnLog p X S) have hSupp : ∀ S, H S ≠ 0 → primeProductNorm p S ≤ Y := by intro S hS have hv : V (columnLog p X S) ≠ 0 := by intro hz apply hS cases testNegative <;> simp [H,fixedSecondTest,fixedColumnTest,hz] exact (columnLog_norm_upper p hp X A hX0 S ((le_abs_self _).trans (hVsupp _ hv))).trans (le_max_right _ _) have hrow (f y : O) : ‖fixedChildRow p hp hcop hg pool Ψ m H f y‖ ≤ 128*Y*M := fixedChildRow_elementary p hp hcop hg hc hinj pool Ψ hΨ m f y H Y M hY hM hH hSupp have hu (u : Oˣ) : (∑ z ∈ T, ‖idealChildRow p hp hcop hg pool Ψ m H rowNegative u z‖^2) ≤ (T.card : ℝ) * (128*Y*M)^2 := by calc _ ≤ ∑ z ∈ T, (128*Y*M)^2 := by apply Finset.sum_le_sum intro z hz exact pow_le_pow_left₀ (norm_nonneg _) (hrow _ _) 2 _ = _ := by simp have he := idealChildRow_unit_energy_le p hp hcop hg pool Ψ m H rowNegative T ((T.card : ℝ)*(128*Y*M)^2) hu change childEnergy p hp hcop hg pool Ψ m T V X testNegative rowNegative a b ≤ _ at he have ht := DescentFiberCost.finite_label_row_count T F K hF hK hT apply (div_le_iff₀ (mul_pos hX0 hF0)).mpr calc _ ≤ 6*((T.card : ℝ)*(128*Y*M)^2) := he _ ≤ 6*((128^2*F*K)*(128*Y*M)^2) := by gcongr _ = (6*128^4*K*(max 1 (X*Real.exp A))^2*M^2/X)*(X*F) := by dsimp [Y] field_simp end SecondPassIntegration namespace ShortDraftLatticeCount open ActualEisensteinCubic ActualEisensteinCoordinates ConcreteTraceCRT theorem rowNormBall_norm_sq_le (H : ℕ) (k : ActualEisensteinCubic.O) (hk : k ∈ rowNormBall H) : ‖eisEmbedding k‖^2 ≤ 3*((H : ℝ)+1)^2 := by obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hk obtain ⟨ha,hb⟩ := Finset.mem_product.mp hv obtain ⟨haL,haU⟩ := Finset.mem_Icc.mp ha obtain ⟨hbL,hbU⟩ := Finset.mem_Icc.mp hb have ha2 : v.1^2 ≤ ((H : ℤ)+1)^2 := by nlinarith [mul_nonneg (sub_nonneg.mpr haU) (show 0 ≤ (H : ℤ)+1+v.1 by linarith)] have hb2 : v.2^2 ≤ ((H : ℤ)+1)^2 := by nlinarith [mul_nonneg (sub_nonneg.mpr hbU) (show 0 ≤ (H : ℤ)+1+v.2 by linarith)] have hq : v.1*v.1-v.1*v.2+v.2*v.2 ≤ 3*((H : ℤ)+1)^2 := by nlinarith [sq_nonneg (v.1+v.2)] rw [eisEmbedding_eval_norm_sq] exact_mod_cast hq end ShortDraftLatticeCount namespace SecondPassArithmetic open ActualEisensteinCubic ConcreteTraceCRT theorem secondFrequencyCutoff_norm_sq_le (scale H : ℝ) (k : ActualEisensteinCubic.O) (hk : k ∈ secondFrequencyCutoff scale H) : ‖eisEmbedding k‖^2 ≤ 3*((⌈H/scale⌉₊ : ℝ)+1)^2 := ShortDraftLatticeCount.rowNormBall_norm_sq_le _ k hk end SecondPassArithmetic open Filter MeasureTheory open scoped BigOperators Classical Topology namespace CubicEisenstein lemma axisSlice_update (f : SpatialCoordinates → ℂ) (p : SpatialCoordinates) (j : Fin 3) (t : ℝ) : axisSlice f (Function.update p j t) j = axisSlice f p j := by funext z simp only [axisSlice,Function.update_idem] end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT def cuspRectangle : Set (ℝ × ℝ) := Set.Icc 0 3 ×ˢ Set.Icc 0 (3*Real.sqrt 3) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.GreenIdentity namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology end CubicEisenstein namespace CanonicalQuadraticSieve theorem symmetric_truncation_scales (X₀ X T : ℝ) (hX₀ : 0 < X₀) (hlo : X₀/2 ≤ X) (hhi : X ≤ 2*X₀) (hT : 4 ≤ T) : 0 < X ∧ 0 < X₀/T ∧ X₀/T ≤ X ∧ X ≤ T*X₀ ∧ 0 ≤ T^4 := by have hT0 : 0 < T := by linarith have hX : 0 < X := by linarith refine ⟨hX,div_pos hX₀ hT0,?_,?_,by positivity⟩ · apply (div_le_iff₀ hT0).mpr nlinarith · nlinarith theorem symmetric_truncation_scalar_bound (m : ℕ) (X₀ X T : ℝ) (hX₀ : 0 < X₀) (hlo : X₀/2 ≤ X) (hhi : X ≤ 2*X₀) (hT : 4 ≤ T) : ((X₀/T)/X)^(m+3) + 1/(1+(T*X₀)/X)^(m+3) + (X/(X₀/T))/((min 1 (X/(T*X₀)))^2*(1+X*T^4/(T*X₀))^(m+3)) ≤ (2 : ℝ)^(m+10)/T^m := by have hT0 : 0 < T := by linarith have hT1 : 1 ≤ T := by linarith have hX : 0 < X := by linarith have hY : 0 < X₀/T := div_pos hX₀ hT0 have hratio : (X₀/T)/X ≤ 2/T := by apply (div_le_iff₀ hX).mpr calc X₀/T ≤ (2*X)/T := div_le_div_of_nonneg_right (by linarith) hT0.le _ = (2/T)*X := by ring have hinv : 1/(1+(T*X₀)/X) ≤ 2/T := by have hz : T/2 ≤ (T*X₀)/X := (le_div_iff₀ hX).mpr (by nlinarith) calc _ ≤ 1/(T/2) := div_le_div_of_nonneg_left (by norm_num) (by positivity) (by linarith) _ = 2/T := by field_simp have hpow : (2/T)^(m+3) ≤ (2 : ℝ)^(m+3)/T^m := by rw [div_pow] exact div_le_div_of_nonneg_left (by positivity) (pow_pos hT0 m) (pow_le_pow_right₀ hT1 (by omega : m ≤ m+3)) have h₁ : ((X₀/T)/X)^(m+3) ≤ (2 : ℝ)^(m+3)/T^m := (pow_le_pow_left₀ (by positivity) hratio _).trans hpow have h₂ : 1/(1+(T*X₀)/X)^(m+3) ≤ (2 : ℝ)^(m+3)/T^m := by simpa only [div_pow,one_pow] using (pow_le_pow_left₀ (by positivity) hinv (m+3)).trans hpow have hnum : X/(X₀/T) ≤ 2*T := by apply (div_le_iff₀ hY).mpr have he : 2*T*(X₀/T) = 2*X₀ := by field_simp rw [he] exact hhi have hmin : 1/(2*T) ≤ min 1 (X/(T*X₀)) := by apply le_min · apply (div_le_iff₀ (by positivity : 0 < 2*T)).mpr linarith · apply (le_div_iff₀ (mul_pos hT0 hX₀)).mpr have he : 1/(2*T)*(T*X₀)=X₀/2 := by field_simp rwa [he] have hfreq : T ≤ 1+X*T^4/(T*X₀) := by have ht2 : 2 ≤ T^2 := by nlinarith have ht4 : 2*T^2 ≤ T^4 := by nlinarith [sq_nonneg (T^2-2)] have hprod : T*(T*X₀) ≤ X*T^4 := by nlinarith [mul_nonneg (sub_nonneg.mpr hlo) (sq_nonneg (T^2))] have hh := (le_div_iff₀ (mul_pos hT0 hX₀)).mpr hprod linarith have hden : (1/(2*T))^2*T^(m+3) ≤ (min 1 (X/(T*X₀)))^2*(1+X*T^4/(T*X₀))^(m+3) := by exact mul_le_mul (pow_le_pow_left₀ (by positivity) hmin 2) (pow_le_pow_left₀ hT0.le hfreq (m+3)) (by positivity) (by positivity) have h₃ : (X/(X₀/T))/((min 1 (X/(T*X₀)))^2*(1+X*T^4/(T*X₀))^(m+3)) ≤ 8/T^m := by calc _ ≤ (2*T)/((1/(2*T))^2*T^(m+3)) := div_le_div₀ (by positivity) hnum (by positivity) hden _ = _ := by rw [pow_add]; field_simp; ring have hc : 2*(2 : ℝ)^(m+3)+8 ≤ (2 : ℝ)^(m+10) := by have hm : 1 ≤ (2 : ℝ)^m := one_le_pow₀ (by norm_num) rw [pow_add,pow_add] norm_num nlinarith calc _ ≤ (2 : ℝ)^(m+3)/T^m + (2 : ℝ)^(m+3)/T^m + 8/T^m := add_le_add (add_le_add h₁ h₂) h₃ _ = (2*(2 : ℝ)^(m+3)+8)/T^m := by ring _ ≤ _ := div_le_div_of_nonneg_right hc (by positivity) end CanonicalQuadraticSieve open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm) def SecondSourceSupport {ι : Type*} [DecidableEq ι] (p : ι → O) (X M : ℝ) (x : SecondExpansionData ι) : Prop := Disjoint x.sourceCommon x.overlap ∧ primeProductNorm p x.sourceCommon * primeProductNorm p x.overlap ≤ X * Real.exp M variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) include hinj in theorem secondExpansionSource_singleton_zero_of_not_support (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (z : SecondRayIndex) (g W : 𝓢(ℝ, ℂ)) (X Y M : ℝ) (hX : 0 < X) (hgM : ∀ u, g u ≠ 0 → |u| ≤ M) (x : SecondExpansionData ι) (hE : x.divisor ⊆ x.sourceCommon) (hs : ¬ SecondSourceSupport p X M x) : secondExpansionSource p hp hcop hg F Ψ m c d z {x} (fun S => normalizedColumn p (fun A => g (columnLog p X A)) S) (fun S => normalizedColumn p (fun A => g (columnLog p X A)) S) W Y = 0 := by by_cases hd : Disjoint x.sourceCommon x.overlap · have hb : ¬ primeProductNorm p x.sourceCommon * primeProductNorm p x.overlap ≤ X * Real.exp M := fun hb => hs ⟨hd,hb⟩ have hz (N : Finset ι) : normalizedColumn p (fun A => g (columnLog p X A)) (x.sourceCommon ∪ (x.overlap ∪ N)) = 0 := by by_contra hn have h := normalizedColumn_subset_norm_bound p hp g M X hX hgM x.sourceCommon (x.overlap ∪ N) (x.sourceCommon ∪ x.overlap) (Finset.union_subset_union Finset.Subset.rfl Finset.subset_union_left) hn rw [FirstPassCubeLabels.primeProductNorm_union p _ _ hd] at h exact hb h simp only [secondExpansionSource, Finset.sum_singleton] have hk : secondChildKernelPair p hp hcop hg F x.overlap (secondRayMinus Ψ z) (secondRayPlus Ψ z) m (secondExpansionQuotient p x) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) x.frequency (-x.frequency) (secondSourcePairKernel p (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) x.frequency (fun S => normalizedColumn p (fun A => g (columnLog p X A)) (x.sourceCommon ∪ S)) (fun S => normalizedColumn p (fun A => g (columnLog p X A)) (x.sourceCommon ∪ S)) W Y) = 0 := by unfold secondChildKernelPair apply Finset.sum_eq_zero intro N hN apply Finset.sum_eq_zero intro Q hQ simp only [secondSourcePairKernel, hz N, star_zero, zero_mul, zero_div, mul_zero] rw [hk] ring · have hz := secondPreColumn_zero_of_common_overlap p hp hcop hg hinj (secondRayPlus Ψ z) m c d (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) (-x.frequency) (fun _ => 1) x.sourceCommon x.overlap (fun h => hd h.symm) rw [secondMaskQuotient_spec p x.divisor x.sourceCommon hE] at hz simp only [secondExpansionSource, Finset.sum_singleton, secondExpansionQuotient_of_subset p x hE, secondTotalWeight, secondCommonWeight, hz, mul_zero, zero_mul] include hinj in theorem secondExpansionSource_eq_supported (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (z : SecondRayIndex) (g W : 𝓢(ℝ, ℂ)) (X Y M : ℝ) (hX : 0 < X) (hgM : ∀ u, g u ≠ 0 → |u| ≤ M) (s : Finset (SecondExpansionData ι)) (hE : ∀ x ∈ s, x.divisor ⊆ x.sourceCommon) : secondExpansionSource p hp hcop hg F Ψ m c d z s (fun S => normalizedColumn p (fun A => g (columnLog p X A)) S) (fun S => normalizedColumn p (fun A => g (columnLog p X A)) S) W Y = secondExpansionSource p hp hcop hg F Ψ m c d z (s.filter (SecondSourceSupport p X M)) (fun S => normalizedColumn p (fun A => g (columnLog p X A)) S) (fun S => normalizedColumn p (fun A => g (columnLog p X A)) S) W Y := by classical unfold secondExpansionSource rw [Finset.sum_filter] apply Finset.sum_congr rfl intro x hx by_cases hs : SecondSourceSupport p X M x · rw [if_pos hs] · rw [if_neg hs] have hz := secondExpansionSource_singleton_zero_of_not_support p hp hcop hg hinj F Ψ m c d z g W X Y M hX hgM x (hE x hx) hs simpa only [secondExpansionSource, Finset.sum_singleton] using hz end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) def normLogBin (u : ℝ) : ℕ := ⌊Real.log u⌋₊ def normLogScale (j : ℕ) : ℝ := Real.exp (j : ℝ) lemma normLogScale_pos (j : ℕ) : 0 < normLogScale j := Real.exp_pos _ lemma normLogScale_ge_one (j : ℕ) : 1 ≤ normLogScale j := Real.one_le_exp (by positivity) lemma normLogBin_error (u : ℝ) (hu : 1 ≤ u) : 0 ≤ Real.log (u / normLogScale (normLogBin u)) ∧ Real.log (u / normLogScale (normLogBin u)) ≤ 1 := by rw [Real.log_div (by linarith) (normLogScale_pos _).ne', normLogScale, Real.log_exp] exact ⟨sub_nonneg.mpr (Nat.floor_le (Real.log_nonneg hu)), by have h := Nat.lt_floor_add_one (Real.log u); dsimp [normLogBin]; linarith⟩ lemma normLogBin_scale_bounds (u : ℝ) (hu : 1 ≤ u) : normLogScale (normLogBin u) ≤ u ∧ u ≤ normLogScale (normLogBin u) * Real.exp 1 := by have hu0 : 0 < u := by linarith constructor · have h := Real.exp_le_exp.mpr (Nat.floor_le (Real.log_nonneg hu)) simpa only [Real.exp_log hu0, normLogScale, normLogBin] using h · have h := Real.exp_le_exp.mpr (Nat.lt_floor_add_one (Real.log u)).le simpa only [Real.exp_log hu0, Real.exp_add, normLogScale, normLogBin] using h lemma normLogBin_mono {u v : ℝ} (hu : 0 < u) (huv : u ≤ v) : normLogBin u ≤ normLogBin v := Nat.floor_mono (Real.log_le_log hu huv) abbrev SecondLogIndex := ℕ × ℕ × ℕ def secondLogE (j : SecondLogIndex) : ℝ := normLogScale j.1 def secondLogV (j : SecondLogIndex) : ℝ := normLogScale j.2.1 def secondLogK (j : SecondLogIndex) : ℝ := normLogScale j.2.2 variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] def secondLogIndex (D : Finset ι) (x : SecondExpansionData ι) : SecondLogIndex := (normLogBin (primeProductNorm p x.divisor), normLogBin (primeProductNorm p x.overlap), normLogBin (‖eisEmbedding (actualSecondRow p D x.divisor x.frequency)‖^2)) omit [DecidableEq ι] in lemma actualSecondRow_ne_zero (D E : Finset ι) (k : O) (hk : k ≠ 0) : actualSecondRow p D E k ≠ 0 := mul_ne_zero (mul_ne_zero (primeSubsetGenerator_ne_zero _ _) (primeSubsetGenerator_ne_zero _ _)) hk lemma element_norm_ge_one (a : O) (ha : a ≠ 0) : 1 ≤ ‖eisEmbedding a‖^2 := by rw [eisEmbedding_norm_sq_eq_absNorm_span] exact_mod_cast Nat.one_le_iff_ne_zero.mpr (show Ideal.absNorm (Ideal.span {a}) ≠ 0 by rw [ne_eq, Ideal.absNorm_eq_zero_iff, Ideal.span_singleton_eq_bot] exact ha) end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm jLabel) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] def secondBaseLabel (B C : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) : O := primeSubsetGenerator (fun i => Ideal.span {p i}) C * jLabel p B (fun i => v₁ i+v₂ i) ε₁ ε₂ include hp in omit [DecidableEq ι] in lemma secondBaseLabel_ne_zero (B C : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) : secondBaseLabel p B C v₁ v₂ ε₁ ε₂ ≠ 0 := by apply mul_ne_zero (primeSubsetGenerator_ne_zero _ _) apply Finset.prod_ne_zero_iff.mpr intro i hi exact pow_ne_zero _ (hp i) omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem secondSupportNewLabel_norm (B C D : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (x : SecondExpansionData ι) : (Ideal.absNorm (secondSupportNewLabel p B v₁ v₂ ε₁ ε₂ (expansionSupportData C D x)) : ℝ) = ‖eisEmbedding (secondBaseLabel p B C v₁ v₂ ε₁ ε₂)‖^2 * primeProductNorm p x.divisor * primeProductNorm p x.overlap := by rw [← secondSupportLabel_span, ← eisEmbedding_norm_sq_eq_absNorm_span] simp only [secondSupportLabel, expansionSupportData, secondBaseLabel, map_mul, norm_mul, mul_pow, primeSubsetGenerator_norm_eq_productNorm, primeProductNorm] include hp in omit [DecidableEq ι] in lemma secondSupportNewLabel_ne_bot (B C D : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (x : SecondExpansionData ι) : secondSupportNewLabel p B v₁ v₂ ε₁ ε₂ (expansionSupportData C D x) ≠ ⊥ := by rw [← secondSupportLabel_span, ne_eq, Ideal.span_singleton_eq_bot] exact mul_ne_zero (mul_ne_zero (secondBaseLabel_ne_zero p hp B C v₁ v₂ ε₁ ε₂) (primeSubsetGenerator_ne_zero _ _)) (Finset.prod_ne_zero_iff.mpr (fun i hi => hp i)) end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) def secondLogBinBox (U K : ℝ) : Finset SecondLogIndex := Finset.range (normLogBin U + 1) ×ˢ (Finset.range (normLogBin U + 1) ×ˢ Finset.range (normLogBin K + 1)) lemma secondLogBinBox_card (U K : ℝ) : (secondLogBinBox U K).card = (normLogBin U + 1)^2 * (normLogBin K + 1) := by simp only [secondLogBinBox, Finset.card_product, Finset.card_range] ring variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem secondSourceSupport_bounds (X M : ℝ) (x : SecondExpansionData ι) (hx : SecondSourceSupport p X M x) (hE : x.divisor ⊆ x.sourceCommon) : primeProductNorm p x.sourceCommon ≤ X*Real.exp M ∧ primeProductNorm p x.divisor ≤ X*Real.exp M ∧ primeProductNorm p x.overlap ≤ X*Real.exp M := by have hG := (le_mul_of_one_le_right (FirstPassCubeLabels.primeProductNorm_pos p hp _).le (primeProductNorm_ge_one p hp x.overlap)).trans hx.2 have hV := (le_mul_of_one_le_left (FirstPassCubeLabels.primeProductNorm_pos p hp _).le (primeProductNorm_ge_one p hp x.sourceCommon)).trans hx.2 exact ⟨hG, (primeProductNorm_mono p hp hE).trans hG, hV⟩ include hp in lemma secondLogIndex_mem_box (D : Finset ι) (X M K : ℝ) (x : SecondExpansionData ι) (hx : SecondSourceSupport p X M x) (hE : x.divisor ⊆ x.sourceCommon) (hk : x.frequency ≠ 0) (hK : ‖eisEmbedding (actualSecondRow p D x.divisor x.frequency)‖^2 ≤ K) : secondLogIndex p D x ∈ secondLogBinBox (X*Real.exp M) K := by obtain ⟨hG,hE',hV⟩ := secondSourceSupport_bounds p hp X M x hx hE simp only [secondLogBinBox, secondLogIndex, Finset.mem_product, Finset.mem_range, Nat.lt_succ_iff] exact ⟨normLogBin_mono (FirstPassCubeLabels.primeProductNorm_pos p hp _) hE', normLogBin_mono (FirstPassCubeLabels.primeProductNorm_pos p hp _) hV, normLogBin_mono (by have h := element_norm_ge_one _ (actualSecondRow_ne_zero p D x.divisor x.frequency hk); linarith) hK⟩ def secondSupportedSector (F : Finset ι) (K : Finset ι → Finset ι → Finset O) (R : Finset ι) (X M : ℝ) : Finset (SecondExpansionData ι) := (secondExpansionSector F (fun G E => (K G E).erase 0) R).filter (SecondSourceSupport p X M) def secondLogSector (D F : Finset ι) (K : Finset ι → Finset ι → Finset O) (R : Finset ι) (X M : ℝ) (j : SecondLogIndex) : Finset (SecondExpansionData ι) := (secondSupportedSector p F K R X M).filter (fun x => secondLogIndex p D x = j) omit [∀ (i : ι), (span {p i}).IsMaximal] in lemma secondSupportedSector_mem (F : Finset ι) (K : Finset ι → Finset ι → Finset O) (R : Finset ι) (X M : ℝ) (x : SecondExpansionData ι) (hx : x ∈ secondSupportedSector p F K R X M) : x.sourceCommon ⊆ F ∧ x.divisor ⊆ x.sourceCommon ∧ x.overlap ⊆ F ∧ x.frequency ≠ 0 ∧ x.frequency ∈ K x.sourceCommon x.divisor ∧ x.sourceCommon \ x.divisor = R ∧ SecondSourceSupport p X M x := by obtain ⟨hx,hs⟩ := Finset.mem_filter.mp hx obtain ⟨hx,hr⟩ := Finset.mem_filter.mp hx obtain ⟨hG,hE,hV,hk⟩ := (mem_secondExpansionPool _ _ _).mp hx obtain ⟨hk0,hk⟩ := Finset.mem_erase.mp hk exact ⟨hG,hE,hV,hk0,hk,hr,hs⟩ omit [∀ (i : ι), (span {p i}).IsMaximal] in lemma secondLogSector_subset (D F : Finset ι) (K : Finset ι → Finset ι → Finset O) (R : Finset ι) (X M : ℝ) (j : SecondLogIndex) : secondLogSector p D F K R X M j ⊆ secondExpansionSector F (fun G E => (K G E).erase 0) R := (Finset.filter_subset _ _).trans (Finset.filter_subset _ _) include hp in theorem sum_secondLogSector (D F : Finset ι) (K : Finset ι → Finset ι → Finset O) (R : Finset ι) (X M Kmax : ℝ) (hK : ∀ x ∈ secondSupportedSector p F K R X M, ‖eisEmbedding (actualSecondRow p D x.divisor x.frequency)‖^2 ≤ Kmax) (H : SecondExpansionData ι → ℂ) : (∑ j ∈ secondLogBinBox (X*Real.exp M) Kmax, ∑ x ∈ secondLogSector p D F K R X M j, H x) = ∑ x ∈ secondSupportedSector p F K R X M, H x := by simp only [secondLogSector, Finset.sum_filter] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x hx obtain ⟨hG,hE,hV,hk0,hk,hr,hs⟩ := secondSupportedSector_mem p F K R X M x hx have hj := secondLogIndex_mem_box p hp D X M Kmax x hs hE hk0 (hK x hx) rw [Finset.sum_eq_single_of_mem (secondLogIndex p D x) hj] · simp · intro j hj hne simp [Ne.symm hne] end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.LogarithmicTargets namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in lemma secondSupportedSector_remainder_bound (F R : Finset ι) (K : Finset ι → Finset ι → Finset O) (X M : ℝ) (x : SecondExpansionData ι) (hx : x ∈ secondSupportedSector p F K R X M) : primeProductNorm p R ≤ X*Real.exp M := by obtain ⟨hG,hE,hV,hk0,hk,hr,hs⟩ := secondSupportedSector_mem p F K R X M x hx have h := (secondSourceSupport_bounds p hp X M x hs hE).1 rw [← hr] exact (primeProductNorm_mono p hp Finset.sdiff_subset).trans h include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in lemma secondSupportedSector_eq_empty (F R : Finset ι) (K : Finset ι → Finset ι → Finset O) (X M : ℝ) (hR : ¬ primeProductNorm p R ≤ X*Real.exp M) : secondSupportedSector p F K R X M = ∅ := by apply Finset.eq_empty_iff_forall_notMem.mpr intro x hx exact hR (secondSupportedSector_remainder_bound p hp F R K X M x hx) end section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) include hinj in theorem truncatedSecondSource_eq_binned (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (D F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (g W : 𝓢(ℝ,ℂ)) (X Y M Kmax : ℝ) (hX : 0 < X) (hgM : ∀ u, g u ≠ 0 → |u| ≤ M) (K : Finset ι → Finset ι → Finset O) (hK : ∀ R ∈ F.powerset, ∀ x ∈ secondSupportedSector p F K R X M, ‖eisEmbedding (actualSecondRow p D x.divisor x.frequency)‖^2 ≤ Kmax) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype let H := fun S => normalizedColumn p (fun A => g (columnLog p X A)) S truncatedSecondSource p hp hg hinj F Ψ m c d H W Y K = truncatedSecondZero p hg F Ψ m c d H W Y K + ∑ z : SecondRayIndex, ∑ R ∈ boundedPrimeSupports p F (X*Real.exp M), ∑ j ∈ secondLogBinBox (X*Real.exp M) Kmax, secondExpansionSource p hp hcop hg F Ψ m c d z (secondLogSector p D F K R X M j) H H W Y := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype dsimp only rw [truncatedSecondSource_eq_nonzero_add_zero, add_comm, truncatedSecondSource_eq_fixed_sectors p hp hcop hg hinj hc hpr] congr 1 apply Finset.sum_congr rfl intro z hz simp only [boundedPrimeSupports, Finset.sum_filter] apply Finset.sum_congr rfl intro R hR have hE : ∀ x ∈ secondExpansionSector F (fun G E => (K G E).erase 0) R, x.divisor ⊆ x.sourceCommon := by intro x hx exact ((mem_secondExpansionPool _ _ _).mp (Finset.mem_filter.mp hx).1).2.1 have hs := secondExpansionSource_eq_supported p hp hcop hg hinj F Ψ m c d z g W X Y M hX hgM (secondExpansionSector F (fun G E => (K G E).erase 0) R) hE rw [hs] change secondExpansionSource p hp hcop hg F Ψ m c d z (secondSupportedSector p F K R X M) _ _ W Y = _ by_cases hNR : primeProductNorm p R ≤ X*Real.exp M · rw [if_pos hNR] simp only [secondExpansionSource] exact (sum_secondLogSector p hp D F K R X M Kmax (hK R hR) _).symm · rw [if_neg hNR, secondSupportedSector_eq_empty p hp F R K X M hNR] simp only [secondExpansionSource, Finset.sum_empty] end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) lemma supported_cutoff_denominator (E G U : ℝ) (hE : E ≤ G) (hG : 1 ≤ G) : E * (U/G)^2 ≤ U^2 := by have hG0 : 0 < G := by linarith have hEG : E ≤ G^2 := by nlinarith have he : E/G^2 ≤ 1 := (div_le_one (sq_pos_of_pos hG0)).mpr hEG calc E*(U/G)^2 = U^2*(E/G^2) := by ring _ ≤ U^2*1 := mul_le_mul_of_nonneg_left he (sq_nonneg _) _ = _ := mul_one _ variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] end section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm jLabel b0Label) open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open JointLogSeparation (frequencyTwist frequencyTwist_apply) open SecondPassIntegration (densityChildEnergy) end open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm b0Label jLabel) open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open RayFourExpansion (RayCharacter) open SecondPassIntegration (densityChildEnergy) end SecondPassArithmetic open Filter MeasureTheory open scoped BigOperators Classical Topology namespace CubicEisenstein def smoothFirstCoefficient (s : ℂ) (r : CuspCosets) (j : Fin 3) (p : SpatialCoordinates) : ℂ := smoothSummand s r p*s*(rowLogD (embeddedRow r) p j:ℂ) def smoothSecondCoefficient (s : ℂ) (r : CuspCosets) (j : Fin 3) (p : SpatialCoordinates) : ℂ := smoothSummand s r p*(s^2*(rowLogD (embeddedRow r) p j:ℂ)^2+s*(rowLogDD (embeddedRow r) p j:ℂ)) lemma smoothFirstCoefficient_eq_deriv (s : ℂ) (r : CuspCosets) (j : Fin 3) (p : SpatialCoordinates) (hv : 0

dsimp [deltaLoss,C] <;> linarith obtain ⟨M,hM,hMnonneg,hbound⟩ := coordinate_summable_majorant C s.re s.re hC hs hs let c₁ := ‖s‖*(1/deltaLoss) let c₂ := ‖s‖^2*(1/deltaLoss)^2 + ‖s‖*(7/deltaLoss^2) refine ⟨U,hU,hpU,M,fun r => M r*c₁,fun r => M r*c₂,hM,hM.mul_right _,hM.mul_right _,?_⟩ intro q hq have hpos : 0 ?_⟩ have hm : ‖smoothSummand s r q‖≤M r := by rw [smoothSummand_eq_clamped s r q deltaLoss hδ hq.1.le] exact hbound (path q,s) hq.2.le le_rfl le_rfl r have hfrac : 1 / q 2 ≤ 1/deltaLoss := one_div_le_one_div_of_le hδ hq.1.le have hfrac₂ : 7 / (q 2)^2 ≤ 7/deltaLoss^2 := by apply div_le_div_of_nonneg_left (by norm_num) (sq_pos_of_pos hδ) nlinarith [hq.1] refine ⟨hm,fun j => ?_⟩ rw [smoothFirstCoefficient_eq_deriv _ _ _ _ hpos,smoothSecondCoefficient_eq_deriv _ _ _ _ hpos] constructor · apply (norm_smooth_axis_deriv s r q hpos j).trans apply mul_le_mul hm _ (by positivity) (hMnonneg r) exact mul_le_mul_of_nonneg_left hfrac (norm_nonneg s) · apply (norm_smooth_axis_deriv2 s r q hpos j).trans apply mul_le_mul hm _ (by positivity) (hMnonneg r) dsimp [c₂] gcongr end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CuspIntegration namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology end CubicEisenstein open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum theorem sum_subtype_powerset_products (S : Finset (Ideal O)) (f : Ideal O → ℂ) : (∑ E ∈ (Finset.univ : Finset S).powerset, f (∏ P ∈ E, P.val)) = ∑ E ∈ S.powerset, f (∏ P ∈ E, P) := by classical have hS : (Finset.univ : Finset S).image Subtype.val = S := by ext P simp only [Finset.mem_image, Finset.mem_univ, true_and, Subtype.exists, exists_prop, exists_eq_right] conv_rhs => rw [← hS, Finset.powerset_image] rw [Finset.sum_image] · apply Finset.sum_congr rfl intro E hE congr 1 rw [Finset.prod_image] exact fun _ _ _ _ h => Subtype.val_injective h · exact fun _ _ _ _ h => Finset.image_injective Subtype.val_injective h theorem primePool_singleton_eq_primeSupport (G : Ideal O) : primePool {G} = primeSupport G := by simp [primePool, primeSupport] theorem primePool_subset_sum_eq_divisors (G : Ideal O) (hG : Squarefree G) (f : Ideal O → ℂ) : (∑ E ∈ (Finset.univ : Finset (primePool {G})).powerset, f (∏ P ∈ E, P.val)) = ∑ d ∈ idealDivisors G, f d := by rw [sum_subtype_powerset_products, primePool_singleton_eq_primeSupport] exact (squarefree_divisor_sum_eq_support G hG f).symm theorem middleTruncation_eq_ideal_divisors (G : Ideal O) (hG : Squarefree G) (W : ℝ → ℂ) (X Y Z lengthScale : ℝ) : middleTruncation (fun P : primePool {G} => P.val) Finset.univ W X Y Z lengthScale = (X : ℂ) * ∑ d ∈ idealDivisors G, if Y < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z then (UniqueFactorizationMonoid.moebius d : ℂ) / (Ideal.absNorm d : ℂ) * ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, paperRadialFourier W ((X / (Ideal.absNorm d : ℝ)) * ‖eisEmbedding h‖ ^ 2) else 0 := by classical let f : Ideal O → ℂ := fun d => if Y < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z then (UniqueFactorizationMonoid.moebius d : ℂ) / (Ideal.absNorm d : ℂ) * ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, paperRadialFourier W ((X / (Ideal.absNorm d : ℝ)) * ‖eisEmbedding h‖ ^ 2) else 0 change middleTruncation _ _ W X Y Z lengthScale = (X : ℂ) * ∑ d ∈ idealDivisors G, f d rw [← primePool_subset_sum_eq_divisors G hG f] unfold middleTruncation middleDivisors smallDivisors simp only [Finset.sum_filter] congr 1 apply Finset.sum_congr rfl intro E hE dsimp only [f, subsetNorm, subsetMobius] push_cast by_cases hY : Y < (Ideal.absNorm (∏ P ∈ E, P.val) : ℝ) <;> by_cases hZ : (Ideal.absNorm (∏ P ∈ E, P.val) : ℝ) ≤ Z <;> simp only [hY, hZ, and_self, false_and, and_false, ite_true, ite_false] theorem middleTruncation_eq_ideal_frequencies (G : Ideal O) (hG : Squarefree G) (W : ℝ → ℂ) (X Y Z lengthScale : ℝ) : middleTruncation (fun P : primePool {G} => P.val) Finset.univ W X Y Z lengthScale = ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, ∑ d ∈ idealDivisors G, if Y < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z then (UniqueFactorizationMonoid.moebius d : ℂ) * (((X / (Ideal.absNorm d : ℝ) : ℝ) : ℂ) * paperRadialFourier W (X * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm d : ℝ))) else 0 := by classical rw [middleTruncation_eq_ideal_divisors G hG, Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro d hd by_cases hc : Y < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z · simp only [hc, and_self, ite_true, Finset.mul_sum] apply Finset.sum_congr rfl intro h hh have harg : (X / (Ideal.absNorm d : ℝ)) * ‖eisEmbedding h‖ ^ 2 = X * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm d : ℝ) := by ring rw [harg] push_cast ring · simp only [hc, ite_false, mul_zero, Finset.sum_const_zero] theorem principalTruncation_eq_ideal_divisors (G : Ideal O) (hG : Squarefree G) (W : ℝ → ℂ) (X Z : ℝ) : principalTruncation (fun P : primePool {G} => P.val) Finset.univ W X Z = (X : ℂ) * paperRadialFourier W 0 * (∏ P : primePool {G}, (1 - (1 : ℂ) / Ideal.absNorm P.val)) - (X : ℂ) * paperRadialFourier W 0 * (∑ d ∈ idealDivisors G, if Z < (Ideal.absNorm d : ℝ) then (UniqueFactorizationMonoid.moebius d : ℂ) / (Ideal.absNorm d : ℂ) else 0) - W 0 * (∑ d ∈ idealDivisors G, if (Ideal.absNorm d : ℝ) ≤ Z then (UniqueFactorizationMonoid.moebius d : ℂ) else 0) := by classical rw [← primePool_subset_sum_eq_divisors G hG (fun d => if Z < (Ideal.absNorm d : ℝ) then (UniqueFactorizationMonoid.moebius d : ℂ) / (Ideal.absNorm d : ℂ) else 0), ← primePool_subset_sum_eq_divisors G hG (fun d => if (Ideal.absNorm d : ℝ) ≤ Z then (UniqueFactorizationMonoid.moebius d : ℂ) else 0)] unfold principalTruncation largeDivisors smallDivisors simp only [Finset.sum_filter, subsetNorm, subsetMobius, Complex.ofReal_natCast] end open ActualEisensteinCubic theorem finite_middle_triangle {m n p H D : Type*} [Fintype m] [Fintype n] [Fintype p] [Fintype H] [Fintype D] (muCoefficient : D → ℂ) (hμ : ∀ d, ‖muCoefficient d‖ ≤ 1) (A : m → n → p → H → D → ℂ) : ‖∑ i, ∑ j, ∑ k, ∑ h, ∑ d, muCoefficient d * A i j k h d‖ ≤ ∑ h, ∑ i, ∑ d, ‖∑ j, ∑ k, A i j k h d‖ := by classical have he : (∑ i, ∑ j, ∑ k, ∑ h, ∑ d, muCoefficient d * A i j k h d) = ∑ h, ∑ i, ∑ d, muCoefficient d * (∑ j, ∑ k, A i j k h d) := by simp_rw [Finset.sum_comm (s := (Finset.univ : Finset p)) (t := (Finset.univ : Finset H)), Finset.sum_comm (s := (Finset.univ : Finset n)) (t := (Finset.univ : Finset H)), Finset.sum_comm (s := (Finset.univ : Finset m)) (t := (Finset.univ : Finset H)), Finset.sum_comm (s := (Finset.univ : Finset p)) (t := (Finset.univ : Finset D)), Finset.sum_comm (s := (Finset.univ : Finset n)) (t := (Finset.univ : Finset D))] simp only [Finset.mul_sum] rw [he] apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro h hh apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro i hi apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro d hd rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (hμ d) theorem finite_nonzero_frequency_sum_le (H : Finset O) (hH : ∀ h ∈ H, h ≠ 0) (f : O → ℝ) (hf : ∀ h, 0 ≤ f h) (hs : Summable (fun h : {h : O // h ≠ 0} => f h.val)) : (∑ h ∈ H, f h) ≤ ∑' h : {h : O // h ≠ 0}, f h.val := by classical let e : H → {h : O // h ≠ 0} := fun h => ⟨h.val, hH h.val h.property⟩ have he : Function.Injective e := by intro h k hh apply Subtype.ext exact congrArg (fun x : {h : O // h ≠ 0} => x.val) hh have hsH : Summable (fun h : H => f h.val) := summable_of_hasFiniteSupport (Set.toFinite _) have hb := hsH.tsum_le_tsum_of_inj e he (fun h _ => hf h.val) (fun _ => le_rfl) hs rw [tsum_fintype, Finset.sum_coe_sort H f] at hb exact hb open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum theorem sum_two_finite_subtypes {α β A : Type*} [AddCommMonoid A] (S : Finset α) (T : Finset β) (f : α → β → A) : (∑ a : S, ∑ b : T, f a.val b.val) = ∑ a ∈ S, ∑ b ∈ T, f a b := by rw [Finset.sum_coe_sort S (fun a => ∑ b : T, f a b.val)] exact Finset.sum_congr rfl (fun a _ => Finset.sum_coe_sort T (f a)) variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def originalTruncatedMiddle (W : 𝓢(ℝ, ℂ)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (Y Z : m → ℝ) (lengthScale : ℝ) : ℂ := ∑ i, ∑ j, ∑ k, originalTerm rows left right a b 1 1 i j k * middleTruncation (fun P : primePool {left j * right k} => P.val) Finset.univ W (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ))) (Y i) (Z i) lengthScale omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalTruncatedMiddle_le_product_divisors (W : 𝓢(ℝ, ℂ)) (K : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (Y Z : m → ℝ) (lengthScale : ℝ) (hleft : ∀ j, Admissible (left j)) (hright : ∀ k, Admissible (right k)) (hK : ∀ j k d, d ∣ left j * right k → d ∈ K) : ‖originalTruncatedMiddle W rows left right a b M Y Z lengthScale‖ ≤ ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, originalProductDivisorMiddleAt W K rows left right a b M (fun d i => Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i) h := by classical let A : m → n → p → rowNormDisk ⌊lengthScale⌋₊ → K → ℂ := fun i j k h d => if Y i < (Ideal.absNorm d.val : ℝ) ∧ (Ideal.absNorm d.val : ℝ) ≤ Z i then if d.val ∣ left j * right k then originalTerm rows left right a b 1 1 i j k * originalPrincipalKernel W rows M h.val d.val i else 0 else 0 have he : originalTruncatedMiddle W rows left right a b M Y Z lengthScale = ∑ i, ∑ j, ∑ k, ∑ h : rowNormDisk ⌊lengthScale⌋₊, ∑ d : K, (UniqueFactorizationMonoid.moebius d.val : ℂ) * A i j k h d := by unfold originalTruncatedMiddle apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro k hk exact (by classical rw [sum_two_finite_subtypes (rowNormDisk ⌊lengthScale⌋₊) K (fun h d => (UniqueFactorizationMonoid.moebius d : ℂ) * (if Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i then if d ∣ left j * right k then originalTerm rows left right a b 1 1 i j k * originalPrincipalKernel W rows M h d i else 0 else 0))] by_cases hc : IsCoprime (left j) (right k) · have hsq : Squarefree (left j * right k) := squarefree_mul_iff.mpr ⟨hc.isRelPrime, (hleft j).2.1, (hright k).2.1⟩ rw [middleTruncation_eq_ideal_frequencies _ hsq, Finset.mul_sum] apply Finset.sum_congr rfl intro h hh rw [← divisorPool_filter K (left j * right k) hsq.ne_zero (hK j k), Finset.sum_filter, Finset.mul_sum] apply Finset.sum_congr rfl intro d hd by_cases hdv : d ∣ left j * right k · by_cases hp : Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i · simp only [hdv, hp, and_self, ite_true, originalPrincipalKernel] ring · simp only [hdv, hp, ite_true, ite_false, mul_zero] · simp only [hdv, ite_false, ite_self, mul_zero] · have hz : originalTerm rows left right a b 1 1 i j k = 0 := by simp only [originalTerm, hc, ite_false] simp only [hz, zero_mul, ite_self, mul_zero, Finset.sum_const_zero] ) rw [he] apply (finite_middle_triangle (fun d : K => (UniqueFactorizationMonoid.moebius d.val : ℂ)) (fun d => QuadraticInitialBound.norm_ideal_moebius_le_one d.val) A).trans_eq rw [Finset.sum_coe_sort (rowNormDisk ⌊lengthScale⌋₊) (fun h => ∑ i, ∑ d : K, ‖∑ j, ∑ k, if Y i < (Ideal.absNorm d.val : ℝ) ∧ (Ideal.absNorm d.val : ℝ) ≤ Z i then if d.val ∣ left j * right k then originalTerm rows left right a b 1 1 i j k * originalPrincipalKernel W rows M h d.val i else 0 else 0‖)] apply Finset.sum_congr rfl intro h hh unfold originalProductDivisorMiddleAt apply Finset.sum_congr rfl intro i hi rw [Finset.sum_coe_sort K (fun d => ‖∑ j, ∑ k, if Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i then if d ∣ left j * right k then originalTerm rows left right a b 1 1 i j k * originalPrincipalKernel W rows M h d i else 0 else 0‖)] apply Finset.sum_congr rfl intro d hd by_cases hp : Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i <;> simp only [hp, and_self, ite_true, ite_false, Finset.sum_const_zero, norm_zero] theorem HasSieveExponent.original_truncated_middle {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hU : 0 ≤ U) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a : n → ℂ) (b : p → ℂ) (W : 𝓢(ℝ, ℂ)) (Y Z : m → ℝ) (lengthScale : ℝ) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hZ : ∀ i, Z i ≤ U * Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ))) : ‖originalTruncatedMiddle W rows left right a b M Y Z lengthScale‖ ≤ ((columnDyadicLength N + 1 : ℕ) : ℝ) ^ 2 * ((2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W) * divisorEnergyFactor ε hε N a b * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (N + (2 * U) * Real.sqrt M * B ^ (α - 1 / 2))) := by let pairCols : n × p → Ideal O := fun x => left x.1 * right x.2 let K := columnDivisorPool pairCols have hPair : ∀ x, pairCols x ≠ 0 := fun x => mul_ne_zero (hleft x.1).1.1 (hright x.2).1.1 have hK (j : n) (k : p) (d : Ideal O) (hd : d ∣ left j * right k) : d ∈ K := mem_columnDivisorPool_of_dvd pairCols hPair (j, k) d hd let P : Ideal O → m → Prop := fun d i => Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i have hb := hexp.original_product_divisor_middle deltaLoss hδ ε hε K B N M U hB hN hM hU rows left right hr hl hri hrows a b (fun _ => a) (fun _ => b) (fun _ _ => le_rfl) (fun _ _ => le_rfl) W P hleft hright (fun d hd i hp => hp.2.trans (hZ i)) have hH (h : O) (hh : h ∈ rowNormDisk ⌊lengthScale⌋₊) : h ≠ 0 := by intro hz have hn := (mem_rowNormDisk.mp hh).1 simp [hz] at hn calc _ ≤ ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, originalProductDivisorMiddleAt W K rows left right a b M P h := originalTruncatedMiddle_le_product_divisors W K rows left right a b M Y Z lengthScale (fun j => (hleft j).1) (fun k => (hright k).1) hK _ ≤ ∑' h : {h : O // h ≠ 0}, originalProductDivisorMiddleAt W K rows left right a b M P h.val := finite_nonzero_frequency_sum_le (rowNormDisk ⌊lengthScale⌋₊) hH _ (fun h => originalProductDivisorMiddleAt_nonneg W K rows left right a b M P h) hb.1 _ ≤ _ := hb.2 end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.DualMiddleExpansion namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum theorem scaled_middleTruncation_eq_ideal_frequencies (G : Ideal O) (hG : Squarefree G) (W : ℝ → ℂ) (c X Y Z lengthScale : ℝ) : (c : ℂ) * middleTruncation (fun P : primePool {G} => P.val) Finset.univ W X Y Z lengthScale = ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, ∑ d ∈ idealDivisors G, if Y < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z then (UniqueFactorizationMonoid.moebius d : ℂ) * ((((c * X) / (Ideal.absNorm d : ℝ) : ℝ) : ℂ) * paperRadialFourier W (X * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm d : ℝ))) else 0 := by classical rw [middleTruncation_eq_ideal_frequencies G hG] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro h hh apply Finset.sum_congr rfl intro d hd by_cases hp : Y < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z · simp only [hp, and_self, ite_true] push_cast ring · simp only [hp, ite_false, mul_zero] theorem dual_normalized_middle_expansion (G : Ideal O) (hG : Squarefree G) (W : ℝ → ℂ) (M F b i j Y Z lengthScale : ℝ) (hM : 0 < M) (hF : 0 < F) (hb : 0 < b) (hi : 0 < i) (hj : 0 < j) : ((M / (Real.sqrt (i * j) * F) : ℝ) : ℂ) * middleTruncation (fun P : primePool {G} => P.val) Finset.univ W (Real.sqrt (F * i * j / (M * b))) Y Z lengthScale = ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, ∑ d ∈ idealDivisors G, if Y < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z then (UniqueFactorizationMonoid.moebius d : ℂ) * (((Real.sqrt ((M / F) / b) / (Ideal.absNorm d : ℝ) : ℝ) : ℂ) * paperRadialFourier W (Real.sqrt (F * i * j / (M * b)) * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm d : ℝ))) else 0 := by rw [scaled_middleTruncation_eq_ideal_frequencies G hG, dual_principal_prefactor_identity M F b i j hM hF hb hi hj] variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def dualTruncatedMiddle (W : 𝓢(ℝ, ℂ)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (Y Z : m → ℝ) (lengthScale : ℝ) : ℂ := ∑ i, ∑ j, ∑ k, originalTerm rows left right a b 1 1 i j k * (((M / (Real.sqrt ((Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ)) * F) : ℝ) : ℂ) * middleTruncation (fun P : primePool {left j * right k} => P.val) Finset.univ W (Real.sqrt (F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ)))) (Y i) (Z i) lengthScale) omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem dualTruncatedMiddle_le_product_divisors (W : 𝓢(ℝ, ℂ)) (K : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (Y Z : m → ℝ) (lengthScale : ℝ) (hM : 0 < M) (hF : 0 < F) (hrows : ∀ i, Admissible (rows i)) (hleft : ∀ j, Admissible (left j)) (hright : ∀ k, Admissible (right k)) (hK : ∀ j k d, d ∣ left j * right k → d ∈ K) : ‖dualTruncatedMiddle W rows left right a b M F Y Z lengthScale‖ ≤ ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, dualProductDivisorMiddleAt W K rows left right a b M F (fun d i => Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i) h := by classical let A : m → n → p → rowNormDisk ⌊lengthScale⌋₊ → K → ℂ := fun i j k h d => if Y i < (Ideal.absNorm d.val : ℝ) ∧ (Ideal.absNorm d.val : ℝ) ≤ Z i then if d.val ∣ left j * right k then originalTerm rows left right a b 1 1 i j k * dualPrincipalKernel W rows left right M F h.val d.val i j k else 0 else 0 have he : dualTruncatedMiddle W rows left right a b M F Y Z lengthScale = ∑ i, ∑ j, ∑ k, ∑ h : rowNormDisk ⌊lengthScale⌋₊, ∑ d : K, (UniqueFactorizationMonoid.moebius d.val : ℂ) * A i j k h d := by unfold dualTruncatedMiddle apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro k hk exact (by classical rw [sum_two_finite_subtypes (rowNormDisk ⌊lengthScale⌋₊) K (fun h d => (UniqueFactorizationMonoid.moebius d : ℂ) * (if Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i then if d ∣ left j * right k then originalTerm rows left right a b 1 1 i j k * dualPrincipalKernel W rows left right M F h d i j k else 0 else 0))] by_cases hc : IsCoprime (left j) (right k) · have hsq : Squarefree (left j * right k) := squarefree_mul_iff.mpr ⟨hc.isRelPrime, (hleft j).2.1, (hright k).2.1⟩ have hpos (I : Ideal O) (hI : Admissible I) : 0 < (Ideal.absNorm I : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun h => hI.1 (Ideal.absNorm_eq_zero_iff.mp h)) rw [dual_normalized_middle_expansion _ hsq _ _ _ _ _ _ _ _ _ hM hF (hpos _ (hrows i)) (hpos _ (hleft j)) (hpos _ (hright k)), Finset.mul_sum] apply Finset.sum_congr rfl intro h hh rw [← divisorPool_filter K (left j * right k) hsq.ne_zero (hK j k), Finset.sum_filter, Finset.mul_sum] apply Finset.sum_congr rfl intro d hd by_cases hdv : d ∣ left j * right k · by_cases hp : Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i · simp only [hdv, hp, and_self, ite_true, dualPrincipalKernel] ring · simp only [hdv, hp, ite_true, ite_false, mul_zero] · simp only [hdv, ite_false, ite_self, mul_zero] · have hz : originalTerm rows left right a b 1 1 i j k = 0 := by simp only [originalTerm, hc, ite_false] simp only [hz, zero_mul, ite_self, mul_zero, Finset.sum_const_zero] ) rw [he] apply (finite_middle_triangle (fun d : K => (UniqueFactorizationMonoid.moebius d.val : ℂ)) (fun d => QuadraticInitialBound.norm_ideal_moebius_le_one d.val) A).trans_eq rw [Finset.sum_coe_sort (rowNormDisk ⌊lengthScale⌋₊) (fun h => ∑ i, ∑ d : K, ‖∑ j, ∑ k, if Y i < (Ideal.absNorm d.val : ℝ) ∧ (Ideal.absNorm d.val : ℝ) ≤ Z i then if d.val ∣ left j * right k then originalTerm rows left right a b 1 1 i j k * dualPrincipalKernel W rows left right M F h d.val i j k else 0 else 0‖)] apply Finset.sum_congr rfl intro h hh unfold dualProductDivisorMiddleAt apply Finset.sum_congr rfl intro i hi rw [Finset.sum_coe_sort K (fun d => ‖∑ j, ∑ k, if Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i then if d ∣ left j * right k then originalTerm rows left right a b 1 1 i j k * dualPrincipalKernel W rows left right M F h d i j k else 0 else 0‖)] apply Finset.sum_congr rfl intro d hd by_cases hp : Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i <;> simp only [hp, and_self, ite_true, ite_false, Finset.sum_const_zero, norm_zero] theorem HasSieveExponent.dual_truncated_middle {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hU : 0 ≤ U) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a : n → ℂ) (b : p → ℂ) (W : 𝓢(ℝ, ℂ)) (Y Z : m → ℝ) (lengthScale : ℝ) (hleft : ∀ j, Admissible (left j) ∧ N / 2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N / 2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hZ : ∀ i, Z i ≤ U * (N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ))))) : ‖dualTruncatedMiddle W rows left right a b M F Y Z lengthScale‖ ≤ ((columnDyadicLength N + 1 : ℕ) : ℝ) ^ 2 * ((2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * divisorEnergyFactor ε hε N a b * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (M / F + (2 * U) * Real.sqrt (M / F) * B ^ (α - 1 / 2))) := by let pairCols : n × p → Ideal O := fun x => left x.1 * right x.2 let K := columnDivisorPool pairCols have hPair : ∀ x, pairCols x ≠ 0 := fun x => mul_ne_zero (hleft x.1).1.1 (hright x.2).1.1 have hK (j : n) (k : p) (d : Ideal O) (hd : d ∣ left j * right k) : d ∈ K := mem_columnDivisorPool_of_dvd pairCols hPair (j, k) d hd let P : Ideal O → m → Prop := fun d i => Y i < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z i have hb := hexp.dual_product_divisor_middle deltaLoss hδ ε hε K B N M F U hB hN hM hF hU rows left right hr hl hri hrows a b (fun _ => a) (fun _ => b) (fun _ _ => le_rfl) (fun _ _ => le_rfl) W P hleft hright (fun d hd i hp => hp.2.trans (hZ i)) have hH (h : O) (hh : h ∈ rowNormDisk ⌊lengthScale⌋₊) : h ≠ 0 := by intro hz have hn := (mem_rowNormDisk.mp hh).1 simp [hz] at hn calc _ ≤ ∑ h ∈ rowNormDisk ⌊lengthScale⌋₊, dualProductDivisorMiddleAt W K rows left right a b M F P h := dualTruncatedMiddle_le_product_divisors W K rows left right a b M F Y Z lengthScale hM hF (fun i => (hrows i).1) (fun j => (hleft j).1) (fun k => (hright k).1) hK _ ≤ ∑' h : {h : O // h ≠ 0}, dualProductDivisorMiddleAt W K rows left right a b M F P h.val := finite_nonzero_frequency_sum_le (rowNormDisk ⌊lengthScale⌋₊) hH _ (fun h => dualProductDivisorMiddleAt_nonneg W K rows left right a b M F P h) hb.1 _ ≤ _ := hb.2 end CanonicalQuadraticSieve open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (jLabel primeProduct bit) variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) include hcop in omit [DecidableEq ι] in theorem primeSpanProduct_squarefree (S : Finset ι) : Squarefree (∏ i ∈ S, Ideal.span {p i}) := by apply Finset.squarefree_prod_of_pairwise_isCoprime · intro i hi j hj hij exact (hcop hij).isRelPrime · intro i hi exact (Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance).squarefree omit [DecidableEq ι] in theorem row_nonzero_notMem (S : Finset ι) (c : O) (h : finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S c ≠ 0) : ∀ i ∈ S, c ∉ Ideal.span {p i} := by intro i hi hc have hzero : finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S c ^ 6 = 0 := by rw [← FirstPassCubeLabels.row_pow, finiteSquarefreeRow_sixth_power, if_pos ⟨i,hi,hc⟩] exact pow_ne_zero 6 h hzero omit [DecidableEq ι] in theorem primeSpanProduct_isCoprime_of_row_nonzero (S : Finset ι) (c : O) (h : finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S c ≠ 0) : IsCoprime (∏ i ∈ S, Ideal.span {p i}) (Ideal.span {c}) := by apply IsCoprime.prod_left intro i hi apply Ideal.isCoprime_iff_sup_eq.mpr by_contra htop have he := Ideal.IsMaximal.eq_of_le (inferInstance : (Ideal.span {p i}).IsMaximal) htop (show Ideal.span {p i} ≤ Ideal.span {p i} ⊔ Ideal.span {c} from le_sup_left) have hc : c ∈ Ideal.span {p i} := by rw [he] exact (show Ideal.span {c} ≤ Ideal.span {p i} ⊔ Ideal.span {c} from le_sup_right) (Ideal.subset_span (Set.mem_singleton c)) exact row_nonzero_notMem p hg S c h i hi hc def firstRetainedSupport (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) : Finset ι := B.filter (fun i => FirstPassCubeLabels.retained (FirstPassCubeLabels.parity (v i)) (ε₁ i) (ε₂ i)) omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem jLabel_eq_retainedProduct (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) : jLabel p B v ε₁ ε₂ = ∏ i ∈ firstRetainedSupport B v ε₁ ε₂, p i := by unfold jLabel primeProduct firstRetainedSupport rw [Finset.prod_filter] apply Finset.prod_congr rfl intro i hi cases hb : FirstPassCubeLabels.retained (FirstPassCubeLabels.parity (v i)) (ε₁ i) (ε₂ i) <;> simp [bit,hb] include hcop in theorem firstBaseLabel_squarefree (B C : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hCB : Disjoint C B) : Squarefree (Ideal.span {primeSubsetGenerator (fun i => Ideal.span {p i}) C * jLabel p B v ε₁ ε₂}) := by have hCJ : Disjoint C (firstRetainedSupport B v ε₁ ε₂) := Finset.disjoint_of_subset_right (Finset.filter_subset _ _) hCB rw [← Ideal.span_singleton_mul_span_singleton, jLabel_eq_retainedProduct, FiniteGaussPhase.span_finset_prod, primeSubsetGenerator, ConcretePrimeRowBridge.span_idealGenerator, ← Finset.prod_union hCJ] exact primeSpanProduct_squarefree p hcop _ end section open ActualEisensteinCubic open FirstPassCubeLabels (jLabel) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def secondArithmeticWeight (Ψ : O →* ℂ) (m c d : O) (z : SecondRayIndex) (x : SecondExpansionData ι) : ℂ := secondSourceCommonCoefficient p hg Ψ m c d x.sourceCommon x.divisor * secondTotalWeight p hp hcop hg Ψ Ψ m (secondExpansionQuotient p x) c d (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) x.frequency (z,x.overlap) theorem secondArithmeticWeight_coprime (Ψ : O →* ℂ) (m c d : O) (z : SecondRayIndex) (x : SecondExpansionData ι) (hE : x.divisor ⊆ x.sourceCommon) (h : secondArithmeticWeight p hp hcop hg Ψ m c d z x ≠ 0) : IsCoprime (Ideal.span {c}) (∏ i ∈ x.divisor, Ideal.span {p i}) ∧ IsCoprime (Ideal.span {c}) (∏ i ∈ x.overlap, Ideal.span {p i}) ∧ IsCoprime (∏ i ∈ x.divisor, Ideal.span {p i}) (∏ i ∈ x.overlap, Ideal.span {p i}) := by have hG : finiteSquarefreeRow (fun i => Ideal.span {p i}) hg x.sourceCommon c ≠ 0 := by intro hz apply h simp only [secondArithmeticWeight, secondSourceCommonCoefficient, secondInputCoefficient, hz, zero_pow (by decide : 4 ≠ 0), mul_zero, zero_mul, norm_zero, zero_pow (by decide : 2 ≠ 0), Complex.ofReal_zero] have hV : finiteSquarefreeRow (fun i => Ideal.span {p i}) hg x.overlap c ≠ 0 := by intro hz apply h simp only [secondArithmeticWeight, secondTotalWeight, secondCommonWeight, secondPreColumn, hz, zero_pow (by decide : 4 ≠ 0), mul_zero, zero_mul, star_zero] have hVe : finiteSquarefreeRow (fun i => Ideal.span {p i}) hg x.overlap (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor) ≠ 0 := by intro hz apply h simp only [secondArithmeticWeight, secondTotalWeight, secondCommonWeight, secondPreColumn, hz, mul_zero, zero_mul, star_zero] have hGc := primeSpanProduct_isCoprime_of_row_nonzero p hg x.sourceCommon c hG have hEc : IsCoprime (∏ i ∈ x.divisor, Ideal.span {p i}) (Ideal.span {c}) := by apply IsCoprime.prod_left intro i hi exact (IsCoprime.prod_left_iff.mp hGc) i (hE hi) have hVc := primeSpanProduct_isCoprime_of_row_nonzero p hg x.overlap c hV have hVE := primeSpanProduct_isCoprime_of_row_nonzero p hg x.overlap _ hVe rw [primeSubsetGenerator, ConcretePrimeRowBridge.span_idealGenerator] at hVE exact ⟨hEc.symm,hVc.symm,hVE.symm⟩ theorem secondArithmeticWeight_squarefree (Ψ : O →* ℂ) (m c d : O) (z : SecondRayIndex) (x : SecondExpansionData ι) (hE : x.divisor ⊆ x.sourceCommon) (hc : Squarefree (Ideal.span {c})) (h : secondArithmeticWeight p hp hcop hg Ψ m c d z x ≠ 0) : Squarefree (Ideal.span {c} * (∏ i ∈ x.divisor, Ideal.span {p i}) * (∏ i ∈ x.overlap, Ideal.span {p i})) := by obtain ⟨hcE,hcV,hEV⟩ := secondArithmeticWeight_coprime p hp hcop hg Ψ m c d z x hE h apply squarefree_mul_iff.mpr refine ⟨(hcV.mul_left hEV).isRelPrime,?_,primeSpanProduct_squarefree p hcop _⟩ exact squarefree_mul_iff.mpr ⟨hcE.isRelPrime,hc,primeSpanProduct_squarefree p hcop _⟩ theorem actualSecondLabel_squarefree_of_weight (B C : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hCB : Disjoint C B) (Ψ : O →* ℂ) (m d : O) (z : SecondRayIndex) (x : SecondExpansionData ι) (hE : x.divisor ⊆ x.sourceCommon) (h : secondArithmeticWeight p hp hcop hg Ψ m (primeSubsetGenerator (fun i => Ideal.span {p i}) C * jLabel p B (fun i => v₁ i+v₂ i) ε₁ ε₂) d z x ≠ 0) : Squarefree (actualSecondLabel p B C x.divisor x.overlap v₁ v₂ ε₁ ε₂) := by have hs := secondArithmeticWeight_squarefree p hp hcop hg Ψ m _ d z x hE (firstBaseLabel_squarefree p hcop B C (fun i => v₁ i+v₂ i) ε₁ ε₂ hCB) h rw [← Ideal.span_singleton_mul_span_singleton, primeSubsetGenerator, ConcretePrimeRowBridge.span_idealGenerator, mul_comm (∏ i ∈ C, Ideal.span {p i})] at hs exact hs end open scoped BigOperators Classical open MeasureTheory open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) open SecondPassIntegration (densityChildEnergy childGeometricMean childEnergy) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) end SecondPassArithmetic namespace FirstPassCubeLabels open scoped BigOperators open MeasureTheory lemma firstLogDensity_pair_moment (J : ℕ) (t : ℝ) : firstLogDensity (2*(J+2)) t * ((1+‖t‖)^(J+2) * (1+‖t‖)^(J+2)) = firstLogDensity 0 t := by rw [← pow_add, show J+2+(J+2)=2*(J+2) by omega, mul_comm] exact JointLogSeparation.density_weight_identity _ _ lemma firstLogDensity_le_zero (J : ℕ) (t : ℝ) : firstLogDensity J t ≤ firstLogDensity 0 t := by have h := pow_le_pow_right₀ (show 1 ≤ 1+‖t‖ by linarith [norm_nonneg t]) (show 2 ≤ J+2 by omega) apply inv_anti₀ (by positivity : 0 < (1+‖t‖)^2) h lemma integral_pair_moment_bound (J : ℕ) (f : ℝ → ℝ) (hf : Integrable (fun t => firstLogDensity (2*(J+2)) t * f t)) (a d c q : ℝ) (ha : 0 ≤ a) (hd : 0 ≤ d) (hq : 0 ≤ q) (h : ∀ t, f t ≤ a*(d + ((1+‖t‖)^(J+2)*(1+‖t‖)^(J+2))*c + q)) : (∫ t, firstLogDensity (2*(J+2)) t * f t) ≤ (∫ t, firstLogDensity 0 t) * a * (d+c+q) := by have hi := (firstLogDensity_integrable 0).mul_const (a*(d+c+q)) have hm : ∀ t, firstLogDensity (2*(J+2)) t * f t ≤ firstLogDensity 0 t*(a*(d+c+q)) := by intro t apply (mul_le_mul_of_nonneg_left (h t) (firstLogDensity_nonneg _ _)).trans have h1 := mul_le_mul_of_nonneg_right (firstLogDensity_le_zero (2*(J+2)) t) (mul_nonneg ha hd) have h2 := mul_le_mul_of_nonneg_right (firstLogDensity_le_zero (2*(J+2)) t) (mul_nonneg ha hq) have he := firstLogDensity_pair_moment J t calc _ = firstLogDensity (2*(J+2)) t*(a*d) + (firstLogDensity (2*(J+2)) t*((1+‖t‖)^(J+2)*(1+‖t‖)^(J+2)))*(a*c) + firstLogDensity (2*(J+2)) t*(a*q) := by ring _ ≤ firstLogDensity 0 t*(a*d) + firstLogDensity 0 t*(a*c) + firstLogDensity 0 t*(a*q) := by rw [he] exact add_le_add (add_le_add h1 le_rfl) h2 _ = _ := by ring have hh := integral_mono hf hi hm rw [integral_mul_const] at hh simpa only [mul_assoc] using hh end FirstPassCubeLabels open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm b0Label jLabel firstLogDensity) open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open RayFourExpansion (RayCharacter) open SecondPassIntegration (densityChildEnergy) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.MaskedPrincipalBounds namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum theorem middleTruncation_coprime_common_mask (G C : Ideal O) (hG : Squarefree G) (hC : Squarefree C) (hGC : IsCoprime G C) (W : ℝ → ℂ) (X Y Z lengthScale : ℝ) : middleTruncation (fun P : primePool {G * C} => P.val) Finset.univ W X Y Z lengthScale = ∑ q ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius q : ℂ) * middleTruncation (fun P : primePool {C} => P.val) Finset.univ W (X / (Ideal.absNorm q : ℝ)) (Y / (Ideal.absNorm q : ℝ)) (Z / (Ideal.absNorm q : ℝ)) lengthScale := by classical have hprod : Squarefree (G * C) := squarefree_mul_iff.mpr ⟨hGC.isRelPrime, hG, hC⟩ rw [middleTruncation_eq_ideal_frequencies _ hprod] simp_rw [middleTruncation_eq_ideal_frequencies C hC] simp only [Finset.mul_sum] rw [Finset.sum_comm (s := idealDivisors G) (t := rowNormDisk ⌊lengthScale⌋₊)] apply Finset.sum_congr rfl intro h hh rw [QuadraticDivisorSplit.sum_divisors_coprime_product G C hG.ne_zero hC.ne_zero hGC] apply Finset.sum_congr rfl intro q hq apply Finset.sum_congr rfl intro d hd have hqG := (mem_idealDivisors hG.ne_zero).mp hq have hdC := (mem_idealDivisors hC.ne_zero).mp hd have hq0 : q ≠ 0 := by intro he; rw [he, zero_dvd_iff] at hqG; exact hG.ne_zero hqG have hNq : 0 < (Ideal.absNorm q : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun he => hq0 (Ideal.absNorm_eq_zero_iff.mp he)) have hqd := (hGC.mono hqG hdC).isRelPrime have hlow : Y < (Ideal.absNorm q : ℝ) * (Ideal.absNorm d : ℝ) ↔ Y / (Ideal.absNorm q : ℝ) < (Ideal.absNorm d : ℝ) := by constructor · intro hy apply (div_lt_iff₀ hNq).mpr simpa only [mul_comm] using hy · intro hy simpa only [mul_comm] using (div_lt_iff₀ hNq).mp hy have hhigh : (Ideal.absNorm q : ℝ) * (Ideal.absNorm d : ℝ) ≤ Z ↔ (Ideal.absNorm d : ℝ) ≤ Z / (Ideal.absNorm q : ℝ) := by constructor · intro hz apply (le_div_iff₀ hNq).mpr simpa only [mul_comm] using hz · intro hz simpa only [mul_comm] using (le_div_iff₀ hNq).mp hz simp only [map_mul, Nat.cast_mul, hlow, hhigh, hqd.moebius_mul, Int.cast_mul] by_cases hp : Y / (Ideal.absNorm q : ℝ) < (Ideal.absNorm d : ℝ) ∧ (Ideal.absNorm d : ℝ) ≤ Z / (Ideal.absNorm q : ℝ) · simp only [hp, and_self, ite_true] have harg : X * ‖eisEmbedding h‖ ^ 2 / ((Ideal.absNorm q : ℝ) * (Ideal.absNorm d : ℝ)) = (X / (Ideal.absNorm q : ℝ)) * ‖eisEmbedding h‖ ^ 2 / (Ideal.absNorm d : ℝ) := by ring rw [harg] push_cast ring · simp only [hp, ite_false, mul_zero] theorem sqrt_norm_divisor_scale (M B q : ℝ) (hM : 0 ≤ M) (_hB : 0 ≤ B) (hq : 0 < q) : Real.sqrt (M / B) / q = Real.sqrt ((M / q ^ 2) / B) := by rw [Real.sqrt_div hM, Real.sqrt_div (by positivity : 0 ≤ M / q ^ 2), Real.sqrt_div hM, Real.sqrt_sq hq.le] ring variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def originalMaskedTruncatedMiddle (G : Ideal O) (W : 𝓢(ℝ, ℂ)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (Y Z : m → ℝ) (lengthScale : ℝ) : ℂ := ∑ i, ∑ j, ∑ k, originalTerm rows left right a b 1 1 i j k * middleTruncation (fun P : primePool {G * (left j * right k)} => P.val) Finset.univ W (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ))) (Y i) (Z i) lengthScale omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem originalMaskedTruncatedMiddle_eq_divisors (G : Ideal O) (hG : Squarefree G) (W : 𝓢(ℝ, ℂ)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (hM : 0 ≤ M) (Y Z : m → ℝ) (lengthScale : ℝ) (hleft : ∀ j, Admissible (left j)) (hright : ∀ k, Admissible (right k)) (hGl : ∀ j, IsCoprime G (left j)) (hGr : ∀ k, IsCoprime G (right k)) : originalMaskedTruncatedMiddle G W rows left right a b M Y Z lengthScale = ∑ q ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius q : ℂ) * originalTruncatedMiddle W rows left right a b (M / (Ideal.absNorm q : ℝ) ^ 2) (fun i => Y i / (Ideal.absNorm q : ℝ)) (fun i => Z i / (Ideal.absNorm q : ℝ)) lengthScale := by classical have hp (i : m) (j : n) (k : p) : originalTerm rows left right a b 1 1 i j k * middleTruncation (fun P : primePool {G * (left j * right k)} => P.val) Finset.univ W (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ))) (Y i) (Z i) lengthScale = ∑ q ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius q : ℂ) * (originalTerm rows left right a b 1 1 i j k * middleTruncation (fun P : primePool {left j * right k} => P.val) Finset.univ W (Real.sqrt ((M / (Ideal.absNorm q : ℝ) ^ 2) / (Ideal.absNorm (rows i) : ℝ))) (Y i / (Ideal.absNorm q : ℝ)) (Z i / (Ideal.absNorm q : ℝ)) lengthScale) := by by_cases hc : IsCoprime (left j) (right k) · have hsq : Squarefree (left j * right k) := squarefree_mul_iff.mpr ⟨hc.isRelPrime, (hleft j).2.1, (hright k).2.1⟩ rw [middleTruncation_coprime_common_mask G _ hG hsq ((hGl j).mul_right (hGr k)), Finset.mul_sum] apply Finset.sum_congr rfl intro q hq have hqG := (mem_idealDivisors hG.ne_zero).mp hq have hq0 : q ≠ 0 := by intro he; rw [he, zero_dvd_iff] at hqG; exact hG.ne_zero hqG have hNq : 0 < (Ideal.absNorm q : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun he => hq0 (Ideal.absNorm_eq_zero_iff.mp he)) rw [sqrt_norm_divisor_scale M _ _ hM (Nat.cast_nonneg _) hNq] ring · have hz : originalTerm rows left right a b 1 1 i j k = 0 := by simp only [originalTerm, hc, ite_false] simp only [hz, zero_mul, mul_zero, Finset.sum_const_zero] unfold originalMaskedTruncatedMiddle simp_rw [hp] simp_rw [Finset.sum_comm (s := (Finset.univ : Finset p)) (t := idealDivisors G), Finset.sum_comm (s := (Finset.univ : Finset n)) (t := idealDivisors G), Finset.sum_comm (s := (Finset.univ : Finset m)) (t := idealDivisors G)] simp only [originalTruncatedMiddle, Finset.mul_sum] theorem HasSieveExponent.original_masked_truncated_middle {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (G : Ideal O) (hG : Squarefree G) (B N M U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hU : 0 ≤ U) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a : n → ℂ) (b : p → ℂ) (W : 𝓢(ℝ, ℂ)) (Y Z : m → ℝ) (lengthScale : ℝ) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hGl : ∀ j, IsCoprime G (left j)) (hGr : ∀ k, IsCoprime G (right k)) (hZ : ∀ i, Z i ≤ U * Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ))) : ‖originalMaskedTruncatedMiddle G W rows left right a b M Y Z lengthScale‖ ≤ (idealDivisors G).card * (((columnDyadicLength N + 1 : ℕ) : ℝ) ^ 2 * ((2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W) * divisorEnergyFactor ε hε N a b * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (N + (2 * U) * Real.sqrt M * B ^ (α - 1 / 2)))) := by let V := ((columnDyadicLength N + 1 : ℕ) : ℝ) ^ 2 * ((2 * nonzeroLatticeEnvelopeConstant * originalMiddleDecayConstant W) * divisorEnergyFactor ε hε N a b * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (N + (2 * U) * Real.sqrt M * B ^ (α - 1 / 2))) have hqbound (q : Ideal O) (hq : q ∈ idealDivisors G) : ‖originalTruncatedMiddle W rows left right a b (M / (Ideal.absNorm q : ℝ) ^ 2) (fun i => Y i / (Ideal.absNorm q : ℝ)) (fun i => Z i / (Ideal.absNorm q : ℝ)) lengthScale‖ ≤ V := by have hqG := (mem_idealDivisors hG.ne_zero).mp hq have hq0 : q ≠ 0 := by intro he; rw [he, zero_dvd_iff] at hqG; exact hG.ne_zero hqG have hq1 : (1 : ℝ) ≤ Ideal.absNorm q := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun he => hq0 (Ideal.absNorm_eq_zero_iff.mp he)) have hqpos : (0 : ℝ) < Ideal.absNorm q := by linarith have hZq (i : m) : Z i / (Ideal.absNorm q : ℝ) ≤ U * Real.sqrt ((M / (Ideal.absNorm q : ℝ) ^ 2) / (Ideal.absNorm (rows i) : ℝ)) := by calc _ ≤ (U * Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ))) / (Ideal.absNorm q : ℝ) := div_le_div_of_nonneg_right (hZ i) hqpos.le _ = U * (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) / (Ideal.absNorm q : ℝ)) := by ring _ = _ := by rw [sqrt_norm_divisor_scale M _ _ hM.le (Nat.cast_nonneg _) hqpos] have hb := hexp.original_truncated_middle deltaLoss hδ ε hε B N (M / (Ideal.absNorm q : ℝ) ^ 2) U hB hN (by positivity) hU rows left right hr hl hri hrows a b W (fun i => Y i / (Ideal.absNorm q : ℝ)) (fun i => Z i / (Ideal.absNorm q : ℝ)) lengthScale hleft hright hZq apply hb.trans dsimp only [V] have h1 := nonzeroLatticeEnvelopeConstant_nonneg have h2 := originalMiddleDecayConstant_nonneg W have h3 := divisorEnergyFactor_nonneg ε hε N a b have h4 := (divisorExponentConstant_pos hexp deltaLoss hδ).le gcongr exact div_le_self hM.le (one_le_pow₀ hq1) rw [originalMaskedTruncatedMiddle_eq_divisors G hG W rows left right a b M hM.le Y Z lengthScale (fun j => (hleft j).1) (fun k => (hright k).1) hGl hGr] calc _ ≤ ∑ q ∈ idealDivisors G, ‖(UniqueFactorizationMonoid.moebius q : ℂ) * originalTruncatedMiddle W rows left right a b (M / (Ideal.absNorm q : ℝ) ^ 2) (fun i => Y i / (Ideal.absNorm q : ℝ)) (fun i => Z i / (Ideal.absNorm q : ℝ)) lengthScale‖ := norm_sum_le _ _ _ ≤ ∑ q ∈ idealDivisors G, V := by apply Finset.sum_le_sum intro q hq rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (QuadraticInitialBound.norm_ideal_moebius_le_one q)).trans (hqbound q hq) _ = _ := by simp only [Finset.sum_const, nsmul_eq_mul, V] end open ActualEisensteinCubic IdealMobiusDivisorSum IdealCoprimeSieveOperator theorem HasSieveExponent.actual_principal_difference {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) : ∃ C : ℝ, 0 < C ∧ ∀ {n : Type} [Fintype n] [DecidableEq n] (cols : n → Ideal O) (_hinj : Function.Injective cols) (M N K : ℝ), 1 ≤ M → 1 ≤ N → 1 ≤ K → (∀ j, Admissible (cols j) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) → (∀ j k, columnRay (cols j) = columnRay (cols k)) → ∀ (a : n → ℂ) (G : Ideal O), Squarefree G → (∀ P ∈ fixedBadPrimes, P ∣ G) → ∀ (ε : ℝ) (hε : 0 < ε), ‖(Real.sqrt M : ℂ) * actualPrincipalDifference cols a G K‖ ≤ ((idealDivisors G).card : ℝ)^2 * (supportConstant ε hε * N^ε) * C * (K*N)^deltaLoss * (Real.sqrt (M/K)*N + Real.sqrt M*K^(α-1/2)) * ∑ j, ‖a j‖^2 := by obtain ⟨C,hC,hbound⟩ := hexp.reverse deltaLoss hδ refine ⟨C,hC,?_⟩ intro n _ _ cols hinj M N K hM hN hK hcols hray a G hG hbad ε hε have hM0 : 0 ≤ M := by linarith have hK0 : 0 < K := by linarith have hs := actualPrincipalDifference_bound cols hinj N (by linarith) hcols hray a G hG hbad K hK0 ε hε have hsupp := (supportConstant_pos ε hε).le have hb := hbound K N hK hN rw [norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (Real.sqrt_nonneg M)] calc _ ≤ Real.sqrt M * (((idealDivisors G).card : ℝ)^2 * ((1/Real.sqrt K)*sieveNorm K N*(supportConstant ε hε*N^ε)*∑ j, ‖a j‖^2)) := mul_le_mul_of_nonneg_left hs (Real.sqrt_nonneg _) _ ≤ Real.sqrt M * (((idealDivisors G).card : ℝ)^2 * ((1/Real.sqrt K)*(C*(K*N)^deltaLoss*(N+K^α))*(supportConstant ε hε*N^ε)*∑ j, ‖a j‖^2)) := by gcongr _ = ((idealDivisors G).card : ℝ)^2*(supportConstant ε hε*N^ε)*C*(K*N)^deltaLoss* (Real.sqrt (M/K)*(N+K^α))*∑ j, ‖a j‖^2 := by rw [Real.sqrt_div hM0] ring _ = _ := by rw [mul_add, sqrt_div_mul_rpow M K α hM0 hK0] end CanonicalQuadraticSieve namespace ShortDraftDescent open MeasureTheory Filter end ShortDraftDescent open scoped BigOperators Classical namespace CanonicalQuadraticSieve section open ActualEisensteinCubic FourierBridge def halfShellFactor (N q : ℝ) : ℝ := Real.sqrt (N/2) / Real.sqrt q lemma halfShellFactor_nonneg (N q : ℝ) : 0 ≤ halfShellFactor N q := by unfold halfShellFactor positivity lemma halfShellFactor_le_one (N q : ℝ) (hq : 0 < q) (h : N/2 ≤ q) : halfShellFactor N q ≤ 1 := by unfold halfShellFactor exact (div_le_one (Real.sqrt_pos.mpr hq)).mpr (Real.sqrt_le_sqrt h) lemma halfShellFactor_pair (M F N i j : ℝ) (hN : 0 < N) (hi : 0 < i) (hj : 0 < j) (hF : 0 < F) : (2*M/(F*N))*halfShellFactor N i*halfShellFactor N j = M/(Real.sqrt (i*j)*F) := by unfold halfShellFactor rw [Real.sqrt_mul hi.le] have hs := Real.sq_sqrt (show 0 ≤ N/2 by positivity) have hsi := (Real.sqrt_pos.mpr hi).ne' have hsj := (Real.sqrt_pos.mpr hj).ne' field_simp rw [hs] ring variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def smallPrincipalCorrection (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) : ℝ := ∑ D ∈ S, ∑ E ∈ T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k * ((M/(Real.sqrt ((Ideal.absNorm (left j) : ℝ)*(Ideal.absNorm (right k) : ℝ))*F) : ℝ) : ℂ)‖ omit [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] in lemma originalTerm_real_scaling (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (u : n → ℝ) (v : p → ℝ) (D E : Ideal O) (i : m) (j : n) (k : p) : originalTerm rows left right (fun j => a j*(u j:ℂ)) (fun k => b k*(v k:ℂ)) D E i j k = originalTerm rows left right a b D E i j k * (u j:ℂ) * (v k:ℂ) := by unfold originalTerm by_cases hc : IsCoprime (left j) (right k) <;> by_cases hd : D ∣ left j <;> by_cases he : E ∣ right k <;> simp only [hc,hd,he,ite_true,ite_false,mul_zero,zero_mul,star_zero,star_mul,Complex.star_def, Complex.conj_ofReal] ; ring theorem smallPrincipalCorrection_bound (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M F : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2*D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2*D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ N/2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N/2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) : smallPrincipalCorrection S T rows left right a b M F ≤ (2*M/(F*N))*Real.sqrt (divisorBlockCost ε hε D₁ D₂ B N a b) := by have hN0 : 0 < N := by linarith let u := fun j => halfShellFactor N (Ideal.absNorm (left j) : ℝ) let v := fun k => halfShellFactor N (Ideal.absNorm (right k) : ℝ) let a' := fun j => a j*(u j:ℂ) let b' := fun k => b k*(v k:ℂ) have hu (j) : 0 ≤ u j ∧ u j ≤ 1 := ⟨halfShellFactor_nonneg _ _,halfShellFactor_le_one _ _ (by linarith [(hleft j).2.1]) (hleft j).2.1⟩ have hv (k) : 0 ≤ v k ∧ v k ≤ 1 := ⟨halfShellFactor_nonneg _ _,halfShellFactor_le_one _ _ (by linarith [(hright k).2.1]) (hright k).2.1⟩ have ha (j) : ‖a' j‖ ≤ ‖a j‖ := by simp only [a',norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (hu j).1] exact mul_le_of_le_one_right (norm_nonneg _) (hu j).2 have hb (k) : ‖b' k‖ ≤ ‖b k‖ := by simp only [b',norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (hv k).1] exact mul_le_of_le_one_right (norm_nonneg _) (hv k).2 have ht (D E : Ideal O) (i j k) : originalTerm rows left right a b D E i j k * ((M/(Real.sqrt ((Ideal.absNorm (left j) : ℝ)*(Ideal.absNorm (right k) : ℝ))*F) : ℝ) : ℂ) = ((2*M/(F*N):ℝ):ℂ)*originalTerm rows left right a' b' D E i j k := by have hid := halfShellFactor_pair M F N (Ideal.absNorm (left j) : ℝ) (Ideal.absNorm (right k) : ℝ) hN0 (by linarith [(hleft j).2.1]) (by linarith [(hright k).2.1]) hF rw [←hid, show originalTerm rows left right a' b' D E i j k = originalTerm rows left right a b D E i j k*(u j:ℂ)*(v k:ℂ) from originalTerm_real_scaling rows left right a b u v D E i j k] push_cast dsimp only [u,v] ring have hblock := canonical_original_divisor_block_phase_bound ε hε S T D₁ D₂ B N hD₁ hD₂ hN hS hT rows left right hr hl hri hrows (fun j => ⟨(hleft j).1,(hleft j).2.2⟩) (fun k => ⟨(hright k).1,(hright k).2.2⟩) a' b' (fun _ => 0) (fun _ => 0) 0 simp only [zero_add,logPhase_zero,mul_one] at hblock have hcost := divisorBlockCost_mono_coefficients ε hε D₁ D₂ B N (by linarith) (by linarith) a' a b' b ha hb have heq : smallPrincipalCorrection S T rows left right a b M F = (2*M/(F*N))*(∑ D ∈ S, ∑ E ∈ T, ∑ i, ‖∑ j, ∑ k, originalTerm rows left right a' b' D E i j k‖) := by unfold smallPrincipalCorrection simp_rw [ht,←Finset.mul_sum] simp only [norm_mul,Complex.norm_of_nonneg (show 0 ≤ 2*M/(F*N) by positivity)] simp_rw [←Finset.mul_sum] rw [heq] exact mul_le_mul_of_nonneg_left (hblock.trans (Real.sqrt_le_sqrt hcost)) (by positivity) end open ActualEisensteinCubic theorem HasSieveExponent.small_principal_correction {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M F U : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hD₁N : D₁ ≤ N) (hD₂N : D₂ ≤ N) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2*D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2*D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ N/2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N/2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (hcut : D₁*D₂ ≤ U*(N*Real.sqrt (F/(M*B)))) : smallPrincipalCorrection S T rows left right a b M F ≤ 2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (M/F+U*Real.sqrt (M/F)*B^(α-1/2)) := by have hb := smallPrincipalCorrection_bound ε hε S T D₁ D₂ B N M F hD₁ hD₂ hN hM hF hS hT rows left right hr hl hri hrows hleft hright a b have hc := divisor_cost_with_constant hexp deltaLoss hδ ε hε B N D₁ D₂ hB hN hD₁ hD₂ hD₁N hD₂N a b have he := divisorEnergyFactor_nonneg ε hε N a b have hC := (divisorExponentConstant_pos hexp deltaLoss hδ).le calc _ ≤ (2*M/(F*N))*(divisorEnergyFactor ε hε N a b* (divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss*(N+B^α*(D₁*D₂)))) := hb.trans (mul_le_mul_of_nonneg_left hc (by positivity)) _ = (2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss))* ((M/(F*N))*(N+B^α*(D₁*D₂))) := by ring _ ≤ _ := mul_le_mul_of_nonneg_left (dual_middle_scale_shape M F B N (D₁*D₂) U α hM hF (by linarith) (by linarith) hcut) (by positivity) open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealCoprimeSieveOperator theorem truncationError_symmetric_bound (m : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (_hinj : Function.Injective P) (S : Finset ι) (W : 𝓢(ℝ, ℂ)) (X₀ X T : ℝ), 0 < X₀ → X₀ / 2 ≤ X → X ≤ 2 * X₀ → 4 ≤ T → ‖truncationError P S W X (X₀ / T) (T * X₀) (T ^ 4)‖ ≤ (2 : ℝ) ^ S.card * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / T ^ m := by obtain ⟨s, C, hC, hb⟩ := truncationError_bound (m + 3) refine ⟨s, C * 2 ^ (m + 10), by positivity, ?_⟩ intro ι _ P _ hinj S W X₀ X T hX₀ hlo hhi hT obtain ⟨hX, hY, hYX, hXZ, hL⟩ := symmetric_truncation_scales X₀ X T hX₀ hlo hhi hT have hp := hb P hinj S W X (X₀ / T) (T * X₀) (T ^ 4) hX hY hYX hXZ hL have hs := symmetric_truncation_scalar_bound m X₀ X T hX₀ hlo hhi hT calc _ ≤ (2 : ℝ) ^ S.card * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) * (((X₀ / T) / X) ^ (m + 3) + 1 / (1 + (T * X₀) / X) ^ (m + 3) + (X / (X₀ / T)) / ((min 1 (X / (T * X₀))) ^ 2 * (1 + X * T ^ 4 / (T * X₀)) ^ (m + 3))) := hp _ ≤ (2 : ℝ) ^ S.card * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) * (2 ^ (m + 10) / T ^ m) := mul_le_mul_of_nonneg_left hs (by positivity) _ = _ := by ring theorem primePool_symmetric_error_bound (m : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ (ε : ℝ) (hε : 0 < ε) (G : Ideal O) (_hG : G ≠ 0) (W : 𝓢(ℝ, ℂ)) (X₀ X T : ℝ), 0 < X₀ → X₀ / 2 ≤ X → X ≤ 2 * X₀ → 4 ≤ T → ‖truncationError (fun P : primePool {G} => P.val) Finset.univ W X (X₀ / T) (T * X₀) (T ^ 4)‖ ≤ (supportConstant ε hε * (Ideal.absNorm G : ℝ) ^ ε) * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / T ^ m := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal obtain ⟨s, C, hC, hb⟩ := truncationError_symmetric_bound m refine ⟨s, C, hC, ?_⟩ intro ε hε G hG W X₀ X T hX₀ hlo hhi hT have hh := hb (fun P : primePool {G} => P.val) Subtype.val_injective Finset.univ W X₀ X T hX₀ hlo hhi hT simp only [Finset.card_univ, Fintype.card_coe, primePool_singleton_eq_primeSupport] at hh apply hh.trans exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right (support_card_bound ε hε G hG) (by positivity)) (by positivity) open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealCoprimeSieveOperator theorem originalTerm_one_norm_le {m n p : Type*} (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (i : m) (j : n) (k : p) : ‖originalTerm rows left right a b 1 1 i j k‖ ≤ ‖a j‖ * ‖b k‖ := by classical unfold originalTerm simp only [one_dvd, ite_true] split_ifs with hc · simp only [norm_mul, norm_star] calc _ ≤ (1 * ‖a j‖) * (1 * ‖b k‖) := mul_le_mul (mul_le_mul_of_nonneg_right (quadraticRow_norm_le_one _ _) (norm_nonneg _)) (mul_le_mul_of_nonneg_right (quadraticRow_norm_le_one _ _) (norm_nonneg _)) (by positivity) (by positivity) _ = _ := by ring · simp only [norm_zero] positivity theorem actual_pair_error_energy {m n : Type*} [Fintype m] [Fintype n] (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (E : ℝ) (hE : 0 ≤ E) (error : m → n → n → ℂ) (herr : ∀ i j k, ‖error i j k‖ ≤ E) : ‖∑ i, ∑ j, ∑ k, originalTerm rows cols cols a a 1 1 i j k * error i j k‖ ≤ Fintype.card m * Fintype.card n * E * ∑ j, ‖a j‖ ^ 2 := by classical have hcs := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (fun j : n => ‖a j‖) (fun _ => (1 : ℝ)) simp only [mul_one, one_pow, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] at hcs have hs : (∑ j, ∑ k, ‖a j‖ * ‖a k‖ * E) = (∑ j, ‖a j‖) ^ 2 * E := by simp only [pow_two, Finset.sum_mul, Finset.mul_sum, mul_assoc] apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro k hk ring calc _ ≤ ∑ i, ∑ j, ∑ k, ‖originalTerm rows cols cols a a 1 1 i j k * error i j k‖ := by apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro i hi apply (norm_sum_le _ _).trans exact Finset.sum_le_sum (fun j hj => norm_sum_le _ _) _ ≤ ∑ _i : m, ∑ j, ∑ k, ‖a j‖ * ‖a k‖ * E := by apply Finset.sum_le_sum intro i hi apply Finset.sum_le_sum intro j hj apply Finset.sum_le_sum intro k hk rw [norm_mul] exact mul_le_mul (originalTerm_one_norm_le rows cols cols a a i j k) (herr i j k) (norm_nonneg _) (by positivity) _ = (Fintype.card m : ℝ) * ((∑ j, ‖a j‖) ^ 2 * E) := by simp only [hs, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] _ ≤ (Fintype.card m : ℝ) * (((∑ j, ‖a j‖ ^ 2) * Fintype.card n) * E) := by gcongr _ = _ := by ring theorem finite_ideal_family_card_bound {m : Type*} [Fintype m] (I : m → Ideal O) (hI : Function.Injective I) (B : ℝ) (hB : 1 ≤ B) (hzero : ∀ i, I i ≠ 0) (hNorm : ∀ i, (Ideal.absNorm (I i) : ℝ) ≤ B) : (Fintype.card m : ℝ) ≤ 128 * B := by classical have hb := DescentFiberCost.finite_ideal_count_real (Finset.univ.image I) B hB (by intro J hJ; obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hJ; exact hzero i) (by intro J hJ; obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hJ; exact hNorm i) simpa only [Finset.card_image_of_injective _ hI, Finset.card_univ] using hb theorem actual_pair_error_ideal_bound {m n : Type*} [Fintype m] [Fintype n] (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (B N : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hrows : ∀ i, rows i ≠ 0 ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (hcols : ∀ j, cols j ≠ 0 ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) (a : n → ℂ) (E : ℝ) (hE : 0 ≤ E) (error : m → n → n → ℂ) (herr : ∀ i j k, ‖error i j k‖ ≤ E) : ‖∑ i, ∑ j, ∑ k, originalTerm rows cols cols a a 1 1 i j k * error i j k‖ ≤ 16384 * B * N * E * ∑ j, ‖a j‖ ^ 2 := by have hrc := finite_ideal_family_card_bound rows hr B hB (fun i => (hrows i).1) (fun i => (hrows i).2) have hcc := finite_ideal_family_card_bound cols hc N hN (fun j => (hcols j).1) (fun j => (hcols j).2) apply (actual_pair_error_energy rows cols a E hE error herr).trans calc _ ≤ (128 * B) * (128 * N) * E * ∑ j, ‖a j‖ ^ 2 := by gcongr _ = _ := by ring end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.LogarithmicSectors namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealCoprimeSieveOperator variable {m n : Type*} [Fintype m] [Fintype n] end open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealCoprimeSieveOperator theorem sqrt_product_column_shell (N i j : ℝ) (hN : 0 < N) (hi : N / 2 ≤ i ∧ i ≤ N) (hj : N / 2 ≤ j ∧ j ≤ N) : N / 2 ≤ Real.sqrt (i * j) ∧ Real.sqrt (i * j) ≤ N := by have hi0 : 0 < i := by linarith have hj0 : 0 < j := by linarith have hlo : (N / 2) ^ 2 ≤ i * j := by simpa only [pow_two] using mul_le_mul hi.1 hj.1 (by linarith : 0 ≤ N / 2) hi0.le have hhi : i * j ≤ N ^ 2 := by simpa only [pow_two] using mul_le_mul hi.2 hj.2 hj0.le hN.le have hs := Real.sq_sqrt (mul_pos hi0 hj0).le have hp := Real.sqrt_nonneg (i * j) constructor <;> nlinarith theorem dual_truncation_reference_bounds (M F b N i j : ℝ) (hM : 0 < M) (hF : 0 < F) (hb : 0 < b) (hN : 0 < N) (hi : N / 2 ≤ i ∧ i ≤ N) (hj : N / 2 ≤ j ∧ j ≤ N) : 0 < N * Real.sqrt (F / (M * b)) ∧ (N * Real.sqrt (F / (M * b))) / 2 ≤ Real.sqrt (F * i * j / (M * b)) ∧ Real.sqrt (F * i * j / (M * b)) ≤ 2 * (N * Real.sqrt (F / (M * b))) := by have hr : 0 < Real.sqrt (F / (M * b)) := Real.sqrt_pos.mpr (by positivity) have he : Real.sqrt (F * i * j / (M * b)) = Real.sqrt (F / (M * b)) * Real.sqrt (i * j) := by rw [← Real.sqrt_mul (show 0 ≤ F / (M * b) by positivity)] congr 1 ring obtain ⟨hlo, hhi⟩ := sqrt_product_column_shell N i j hN hi hj refine ⟨mul_pos hN hr, ?_, ?_⟩ · rw [he] nlinarith [mul_le_mul_of_nonneg_left hlo hr.le] · rw [he] nlinarith [mul_le_mul_of_nonneg_left hhi hr.le, mul_pos hN hr] theorem dual_truncation_prefactor_bound (M F N i j : ℝ) (hM : 0 < M) (hF : 0 < F) (hN : 0 < N) (hi : N / 2 ≤ i ∧ i ≤ N) (hj : N / 2 ≤ j ∧ j ≤ N) : M / (Real.sqrt (i * j) * F) ≤ 2 * M / (F * N) := by obtain ⟨hlo, _⟩ := sqrt_product_column_shell N i j hN hi hj calc _ ≤ M / ((N / 2) * F) := div_le_div_of_nonneg_left hM.le (by positivity) (mul_le_mul_of_nonneg_right hlo hF.le) _ = _ := by field_simp variable {m n : Type*} [Fintype m] [Fintype n] end CanonicalQuadraticSieve namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] end variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm jLabel b0Label) open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open JointLogSeparation (frequencyTwist frequencyTwist_apply) open SecondPassIntegration (densityChildEnergy) end open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm b0Label jLabel) open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open RayFourExpansion (RayCharacter) open SecondPassIntegration (densityChildEnergy) end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm b0Label jLabel firstLogDensity) open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open RayFourExpansion (RayCharacter) open SecondPassIntegration (densityChildEnergy) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.SquarefreeTransfer namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace SecondPassArithmetic open scoped BigOperators Classical open MeasureTheory open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) open SecondPassIntegration (densityChildEnergy childGeometricMean childEnergy) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) end SecondPassArithmetic section open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm b0Label jLabel firstLogDensity) open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) open RayFourExpansion (RayCharacter crossCoeff) open SecondPassIntegration (densityChildEnergy) end open ActualEisensteinCubic open FirstPassCubeLabels (columnLog normalizedColumn primeProductNorm b0Label jLabel firstLogDensity actualFirstKernel originalLabelColumn cubeActiveSupport dilationLabel) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter crossCoeff) structure SquarefreeBudgetData where windows : Fin 7 → ℝ → ℂ arithmetic : ℝ smooth : ℝ windowBound : ℝ tail : ℝ arithmetic_pos : 0 < arithmetic smooth_nonneg : 0 ≤ smooth windowBound_nonneg : 0 ≤ windowBound tail_pos : 0 < tail end SecondPassArithmetic namespace FirstPassCubeLabels section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) theorem actual_first_kernel_full_uniform_envelope (W : 𝓢(ℝ, ℂ)) (V₁ V₂ : ℝ → ℂ) (M₁ M₂ : ℝ) (hM₁ : 0 ≤ M₁) (hM₂ : 0 ≤ M₂) (hV₁ : ∀ x, V₁ x ≠ 0 → |x| ≤ M₁) (hV₂ : ∀ y, V₂ y ≠ 0 → |y| ≤ M₂) (A J : ℕ) : ∃ K : ℝ, 0 ≤ K ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (_hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F B : Finset ι) (_hFB : Disjoint F B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (X₁ X₂ : ℝ) (_hX₁ : 0 < X₁) (_hX₂ : 0 < X₂), ∀ lengthScale : ℝ, 0 < lengthScale → ∀ d h : O, d ≠ 0 → h ≠ 0 → ∃ b : 𝓢(ℝ, ℂ), (∀ t : ℝ, (1 + firstDualScale p (cubeActiveSupport B v ε₁ ε₂) lengthScale X₁ X₂ d h) ^ A * ‖b t‖ ≤ K * firstLogDensity J t) ∧ ∀ C₁ C₂ : Finset ι → ℂ, ‖actualFirstKernel p hp hcop hg F B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ lengthScale d h‖ ≤ (lengthScale / ‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂, p i)‖) * Real.sqrt (firstColumnEnergy p hp hcop hg F B v ε₁ ε₂ true C₁ V₁ X₁ d h b) * Real.sqrt (firstColumnEnergy p hp hcop hg F B v ε₁ ε₂ false C₂ V₂ X₂ d h b) := by obtain ⟨K, hK, hs⟩ := two_variable_radial_envelope W V₁ V₂ M₁ M₂ hM₁ hM₂ hV₁ hV₂ A J refine ⟨K, hK, ?_⟩ intro ι _ p hp _ hinj hcop hg hc hpr F B hFB v ε₁ ε₂ X₁ X₂ hX₁ hX₂ lengthScale hL d h hd hh have hR : 0 < firstDualScale p (cubeActiveSupport B v ε₁ ε₂) lengthScale X₁ X₂ d h := by unfold firstDualScale exact div_pos (mul_pos hL (pow_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hh)) 2)) (mul_pos (mul_pos (mul_pos (pow_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hd)) 2) (primeProductNorm_pos p hp _)) hX₁) hX₂) obtain ⟨b, hsep, hb⟩ := hs _ hR refine ⟨b, hb, ?_⟩ intro C₁ C₂ rw [actualFirstKernel_eq_separated p hp hinj hcop hg hc hpr F B hFB v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ hX₁ hX₂ lengthScale d h b hsep, norm_mul] have hi := cube_integral_norm_le_energy p hg F (fun t => cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ true (normalizedColumn p C₁) V₁ (columnLog p X₁) t d) (fun t => cubeLogCoefficient p hp hcop hg B v ε₁ ε₂ false (normalizedColumn p C₂) V₂ (columnLog p X₂) t d) (cubeLogCoefficient_continuous p hp hcop hg B v ε₁ ε₂ true _ _ _ d) (cubeLogCoefficient_continuous p hp hcop hg B v ε₁ ε₂ false _ _ _ d) (fun t S => norm_cubeLogCoefficient_eq_zero p hp hcop hg B v ε₁ ε₂ true _ _ _ t d S) (fun t S => norm_cubeLogCoefficient_eq_zero p hp hcop hg B v ε₁ ε₂ false _ _ _ t d S) h b (cubeBaseFactor p hp hg B v ε₁ ε₂ d h) simp only [norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hL.le, abs_of_nonneg (norm_nonneg _)] rw [mul_assoc] exact mul_le_mul_of_nonneg_left hi (div_nonneg hL.le (norm_nonneg _)) end open ActualEisensteinCubic open RayFourExpansion (RayCharacter crossCoeff) open ConcreteTraceCRT (eisEmbedding) theorem first_passage_full_uniform_transfer (W : 𝓢(ℝ, ℂ)) (V₁ V₂ : ℝ → ℂ) (M₁ M₂ : ℝ) (hM₁ : 0 ≤ M₁) (hM₂ : 0 ≤ M₂) (hV₁ : ∀ x, V₁ x ≠ 0 → |x| ≤ M₁) (hV₂ : ∀ y, V₂ y ≠ 0 → |y| ≤ M₂) (J : ℕ) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) : ∃ K : ℝ, 0 ≤ K ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (_hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F B : Finset ι) (_hFB : Disjoint F B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (_hv : ∀ j ∈ B, 0 < v j) (C₁ C₂ : Finset ι → ℂ) (X₁ X₂ : ℝ) (_hX₁ : 0 < X₁) (_hX₂ : 0 < X₂), ∀ lengthScale : ℝ, 0 < lengthScale → ∀ c d : O, d ≠ 0 → ∀ (s : Finset (Ideal O × O)) (T : Finset O) (w : Ideal O × O → ℂ) (M Y : ℝ), 0 ≤ M → 0 ≤ Y → (∀ x ∈ s, Squarefree x.1) → (∀ x ∈ s, x.2 ≠ 0) → (∀ x ∈ s, DescentWeightedCauchy.firstElementRowMap (dilationLabel p B v ε₁ ε₂) x ∈ T) → (∀ z ∈ T, z ≠ 0) → (∀ z ∈ T, (Ideal.absNorm (Ideal.span {z}) : ℝ) ≤ Y) → (∀ x ∈ s, ‖w x‖ ≤ M) → ‖∑ x ∈ s, w x * actualFirstKernel p hp hcop hg F B v ε₁ ε₂ (originalLabelColumn p hg B ε₁ ε₂ true C₁ c (ConcretePrimeRowBridge.idealGenerator x.1)) (originalLabelColumn p hg B ε₁ ε₂ false C₂ c (ConcretePrimeRowBridge.idealGenerator x.1)) W V₁ V₂ X₁ X₂ lengthScale d x.2‖ ≤ (lengthScale / ‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂, p i)‖) * (M * K * Y ^ deltaLoss) * Real.sqrt (firstOutputEnergy p hp hcop hg F B v ε₁ ε₂ true C₁ V₁ X₁ c d J T) * Real.sqrt (firstOutputEnergy p hp hcop hg F B v ε₁ ε₂ false C₂ V₂ X₂ c d J T) := by obtain ⟨H, hH, hsep⟩ := actual_first_kernel_full_uniform_envelope W V₁ V₂ M₁ M₂ hM₁ hM₂ hV₁ hV₂ 0 J obtain ⟨K, hK, hpush⟩ := first_column_energy_integral deltaLoss hδ refine ⟨H * K, mul_nonneg hH hK.le, ?_⟩ intro ι _ p hp _ hinj hcop hg hc hpr F B hFB v ε₁ ε₂ hv C₁ C₂ X₁ X₂ hX₁ hX₂ have hsep := hsep p hp hinj hcop hg hc hpr F B hFB v ε₁ ε₂ X₁ X₂ hX₁ hX₂ intro lengthScale hL c d hd s T w M Y hM hY hs hnonzero hmap hT hnorm hw let A₁ := fun x : Ideal O × O => originalLabelColumn p hg B ε₁ ε₂ true C₁ c (ConcretePrimeRowBridge.idealGenerator x.1) let A₂ := fun x : Ideal O × O => originalLabelColumn p hg B ε₁ ε₂ false C₂ c (ConcretePrimeRowBridge.idealGenerator x.1) let q := lengthScale / ‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂, p i)‖ have hq : 0 ≤ q := div_nonneg hL.le (norm_nonneg _) have hfam : ∀ x : Ideal O × O, ∃ b : 𝓢(ℝ, ℂ), x ∈ s → (∀ t : ℝ, ‖b t‖ ≤ H * firstLogDensity J t) ∧ ‖actualFirstKernel p hp hcop hg F B v ε₁ ε₂ (A₁ x) (A₂ x) W V₁ V₂ X₁ X₂ lengthScale d x.2‖ ≤ q * Real.sqrt (firstColumnEnergy p hp hcop hg F B v ε₁ ε₂ true (A₁ x) V₁ X₁ d x.2 b) * Real.sqrt (firstColumnEnergy p hp hcop hg F B v ε₁ ε₂ false (A₂ x) V₂ X₂ d x.2 b) := by intro x by_cases hx : x ∈ s · obtain ⟨b, hb, hk⟩ := hsep lengthScale hL d x.2 hd (hnonzero x hx) refine ⟨b, fun _ => ⟨?_, hk (A₁ x) (A₂ x)⟩⟩ simpa only [pow_zero, one_mul] using hb · exact ⟨0, fun hx' => (hx hx').elim⟩ choose b hb using hfam let E₁ := fun x => firstColumnEnergy p hp hcop hg F B v ε₁ ε₂ true (A₁ x) V₁ X₁ d x.2 (b x) let E₂ := fun x => firstColumnEnergy p hp hcop hg F B v ε₁ ε₂ false (A₂ x) V₂ X₂ d x.2 (b x) let O₁ := firstOutputEnergy p hp hcop hg F B v ε₁ ε₂ true C₁ V₁ X₁ c d J T let O₂ := firstOutputEnergy p hp hcop hg F B v ε₁ ε₂ false C₂ V₂ X₂ c d J T let P := M * H * K * Y ^ deltaLoss have hP : 0 ≤ P := mul_nonneg (mul_nonneg (mul_nonneg hM hH) hK.le) (Real.rpow_nonneg hY deltaLoss) have hE₁ (x) : 0 ≤ E₁ x := firstColumnEnergy_nonneg p hp hcop hg F B v ε₁ ε₂ true _ _ _ _ _ _ have hE₂ (x) : 0 ≤ E₂ x := firstColumnEnergy_nonneg p hp hcop hg F B v ε₁ ε₂ false _ _ _ _ _ _ have hdom : ∀ x ∈ s, ∀ t : ℝ, ‖b x t‖ ≤ H * firstLogDensity J t := fun x hx => (hb x hx).1 have hsum₁ : (∑ x ∈ s, ‖w x‖ * E₁ x) ≤ P * O₁ := hpush p hp hinj hcop hg hc F B v ε₁ ε₂ hv true C₁ V₁ X₁ c d s T w b J M H Y hM hH hY hs hmap hT hnorm hw hdom have hsum₂ : (∑ x ∈ s, ‖w x‖ * E₂ x) ≤ P * O₂ := hpush p hp hinj hcop hg hc F B v ε₁ ε₂ hv false C₂ V₂ X₂ c d s T w b J M H Y hM hH hY hs hmap hT hnorm hw hdom have hterm (x) : ‖w x‖ * (Real.sqrt (E₁ x) * Real.sqrt (E₂ x)) = Real.sqrt (‖w x‖ * E₁ x) * Real.sqrt (‖w x‖ * E₂ x) := by rw [Real.sqrt_mul (norm_nonneg _), Real.sqrt_mul (norm_nonneg _)] calc _ = (Real.sqrt ‖w x‖) ^ 2 * (Real.sqrt (E₁ x) * Real.sqrt (E₂ x)) := by rw [Real.sq_sqrt (norm_nonneg _)] _ = _ := by ring calc _ ≤ ∑ x ∈ s, ‖w x * actualFirstKernel p hp hcop hg F B v ε₁ ε₂ (A₁ x) (A₂ x) W V₁ V₂ X₁ X₂ lengthScale d x.2‖ := norm_sum_le _ _ _ ≤ ∑ x ∈ s, q * (Real.sqrt (‖w x‖ * E₁ x) * Real.sqrt (‖w x‖ * E₂ x)) := by apply Finset.sum_le_sum intro x hx rw [norm_mul, ← hterm] calc _ ≤ ‖w x‖ * (q * Real.sqrt (E₁ x) * Real.sqrt (E₂ x)) := mul_le_mul_of_nonneg_left (hb x hx).2 (norm_nonneg _) _ = _ := by ring _ = q * (∑ x ∈ s, Real.sqrt (‖w x‖ * E₁ x) * Real.sqrt (‖w x‖ * E₂ x)) := (Finset.mul_sum _ _ _).symm _ ≤ q * (Real.sqrt (∑ x ∈ s, ‖w x‖ * E₁ x) * Real.sqrt (∑ x ∈ s, ‖w x‖ * E₂ x)) := mul_le_mul_of_nonneg_left (Real.sum_sqrt_mul_sqrt_le s (fun x => mul_nonneg (norm_nonneg _) (hE₁ x)) (fun x => mul_nonneg (norm_nonneg _) (hE₂ x))) hq _ ≤ q * (Real.sqrt (P * O₁) * Real.sqrt (P * O₂)) := by exact mul_le_mul_of_nonneg_left (mul_le_mul (Real.sqrt_le_sqrt hsum₁) (Real.sqrt_le_sqrt hsum₂) (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)) hq _ = _ := by rw [Real.sqrt_mul hP, Real.sqrt_mul hP] calc _ = q * (Real.sqrt P)^2 * Real.sqrt O₁ * Real.sqrt O₂ := by ring _ = _ := by rw [Real.sq_sqrt hP]; dsimp only [P]; ring end FirstPassCubeLabels end open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (actualFirstKernel originalLabelColumn cubeActiveSupport dilationLabel) open ConcreteTraceCRT (eisEmbedding) theorem first_passage_full_uniform_input_family (W : 𝓢(ℝ, ℂ)) (V₁ V₂ : ℝ → ℂ) (M₁ M₂ : ℝ) (hM₁ : 0 ≤ M₁) (hM₂ : 0 ≤ M₂) (hV₁ : ∀ x, V₁ x ≠ 0 → |x| ≤ M₁) (hV₂ : ∀ y, V₂ y ≠ 0 → |y| ≤ M₂) (J : ℕ) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) : ∃ K : ℝ, 0 ≤ K ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (_hinj : Function.Injective (fun i => Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i, lambda ^ 2 ∣ p i - 1) (F B : Finset ι) (_hFB : Disjoint F B) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) (_hv : ∀ j ∈ B, 0 < v j) (Ψ₁ Ψ₂ : O →* ℂ) (m₁ m₂ : O) (H₁ H₂ : Finset ι → ℂ) (_hΨ₁ : ∀ D ∈ F.powerset, ‖Ψ₁ (∏ i ∈ D, p i)‖ ≤ 1) (_hΨ₂ : ∀ D ∈ F.powerset, ‖Ψ₂ (∏ i ∈ D, p i)‖ ≤ 1) (X₁ X₂ : ℝ) (_hX₁ : 0 < X₁) (_hX₂ : 0 < X₂), ∀ lengthScale : ℝ, 0 < lengthScale → ∀ c d : O, d ≠ 0 → ∀ (s : Finset (Ideal O × O)) (T : Finset O) (w : Ideal O × O → ℂ) (M Y : ℝ), 0 ≤ M → 0 ≤ Y → (∀ x ∈ s, Squarefree x.1) → (∀ x ∈ s, x.2 ≠ 0) → (∀ x ∈ s, DescentWeightedCauchy.firstElementRowMap (dilationLabel p B v ε₁ ε₂) x ∈ T) → (∀ z ∈ T, z ≠ 0) → (∀ z ∈ T, (Ideal.absNorm (Ideal.span {z}) : ℝ) ≤ Y) → (∀ x ∈ s, ‖w x‖ ≤ M) → ‖∑ x ∈ s, w x * actualFirstKernel p hp hcop hg F B v ε₁ ε₂ (originalLabelColumn p hg B ε₁ ε₂ true (multiplicativeCoreColumn p Ψ₁ m₁ H₁) c (ConcretePrimeRowBridge.idealGenerator x.1)) (originalLabelColumn p hg B ε₁ ε₂ false (multiplicativeCoreColumn p Ψ₂ m₂ H₂) c (ConcretePrimeRowBridge.idealGenerator x.1)) W V₁ V₂ X₁ X₂ lengthScale d x.2‖ ≤ (lengthScale / ‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂, p i)‖) * (M * K * Y ^ deltaLoss) * Real.sqrt (firstInputFamilyEnergy p hg F B v ε₁ ε₂ true Ψ₁ m₁ H₁ V₁ X₁ c d J T) * Real.sqrt (firstInputFamilyEnergy p hg F B v ε₁ ε₂ false Ψ₂ m₂ H₂ V₂ X₂ c d J T) := by obtain ⟨K, hK, hb⟩ := FirstPassCubeLabels.first_passage_full_uniform_transfer W V₁ V₂ M₁ M₂ hM₁ hM₂ hV₁ hV₂ J deltaLoss hδ refine ⟨(32 * 512) * K, mul_nonneg (by norm_num) hK, ?_⟩ intro ι _ p hp _ hinj hcop hg hc hpr F B hFB v ε₁ ε₂ hv Ψ₁ Ψ₂ m₁ m₂ H₁ H₂ hΨ₁ hΨ₂ X₁ X₂ hX₁ hX₂ have hb := hb p hp hinj hcop hg hc hpr F B hFB v ε₁ ε₂ hv (multiplicativeCoreColumn p Ψ₁ m₁ H₁) (multiplicativeCoreColumn p Ψ₂ m₂ H₂) X₁ X₂ hX₁ hX₂ intro lengthScale hL c d hd s T w M Y hM hY hs hnonzero hmap hT hnorm hw have hf := hb lengthScale hL c d hd s T w M Y hM hY hs hnonzero hmap hT hnorm hw have h₁ := firstOutputEnergy_le_input_family p hp hcop hg hc hpr F B v ε₁ ε₂ true Ψ₁ m₁ H₁ V₁ X₁ c d J T hΨ₁ have h₂ := firstOutputEnergy_le_input_family p hp hcop hg hc hpr F B v ε₁ ε₂ false Ψ₂ m₂ H₂ V₂ X₂ c d J T hΨ₂ have hq : 0 ≤ lengthScale / ‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂, p i)‖ := div_nonneg hL.le (norm_nonneg _) have hfactor : 0 ≤ M * K * Y ^ deltaLoss := mul_nonneg (mul_nonneg hM hK) (Real.rpow_nonneg hY deltaLoss) calc _ ≤ (lengthScale / ‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂, p i)‖) * (M * K * Y ^ deltaLoss) * Real.sqrt (FirstPassCubeLabels.firstOutputEnergy p hp hcop hg F B v ε₁ ε₂ true (multiplicativeCoreColumn p Ψ₁ m₁ H₁) V₁ X₁ c d J T) * Real.sqrt (FirstPassCubeLabels.firstOutputEnergy p hp hcop hg F B v ε₁ ε₂ false (multiplicativeCoreColumn p Ψ₂ m₂ H₂) V₂ X₂ c d J T) := hf _ ≤ (lengthScale / ‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂, p i)‖) * (M * K * Y ^ deltaLoss) * Real.sqrt ((32 * 512) * firstInputFamilyEnergy p hg F B v ε₁ ε₂ true Ψ₁ m₁ H₁ V₁ X₁ c d J T) * Real.sqrt ((32 * 512) * firstInputFamilyEnergy p hg F B v ε₁ ε₂ false Ψ₂ m₂ H₂ V₂ X₂ c d J T) := by gcongr _ = _ := by rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 32 * 512), Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 32 * 512)] calc _ = (lengthScale / ‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂, p i)‖) * (M * K * Y ^ deltaLoss) * (Real.sqrt (32 * 512)) ^ 2 * Real.sqrt (firstInputFamilyEnergy p hg F B v ε₁ ε₂ true Ψ₁ m₁ H₁ V₁ X₁ c d J T) * Real.sqrt (firstInputFamilyEnergy p hg F B v ε₁ ε₂ false Ψ₂ m₂ H₂ V₂ X₂ c d J T) := by ring _ = _ := by rw [Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 32 * 512)]; ring end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.SmoothCuspCutoffs namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff def cuspTransition (a b v : ℝ) : ℝ := Real.smoothTransition ((v-a)/(b-a)) lemma cuspTransition_contDiff (a b : ℝ) : ContDiff ℝ ∞ (cuspTransition a b) := by unfold cuspTransition fun_prop lemma cuspTransition_zero (a b v : ℝ) (hab : a (0:ℝ)) := by filter_upwards [Iio_mem_nhds hv] with x hx exact cuspTransition_zero a b x hab hx.le exact ⟨heq.deriv_eq.trans (deriv_const _ _),heq.deriv.deriv_eq.trans (by simp)⟩ · have heq : cuspTransition a b =ᶠ[𝓝 v] (fun _ => (1:ℝ)) := by filter_upwards [Ioi_mem_nhds hv] with x hx exact cuspTransition_one a b x hab hx.le exact ⟨heq.deriv_eq.trans (deriv_const _ _),heq.deriv.deriv_eq.trans (by simp)⟩ def positiveHeightPower (s : ℂ) (v : ℝ) : ℂ := logRatioPower s v 1 lemma positiveHeightPower_eq_cpow (s : ℂ) (v : ℝ) (hv : 0 1) (fun _ => 1) (fun _ => 0) v 0 0 (fun x => hasDerivAt_id x) (fun x => hasDerivAt_const x (1:ℝ)) (hasDerivAt_const v (1:ℝ)) (hasDerivAt_const v (0:ℝ)) hv one_ne_zero using 1 · rfl · simp only [id_eq,zero_mul,mul_one,sub_self,sub_zero,one_pow,div_one, Complex.ofReal_sub,Complex.ofReal_div,Complex.ofReal_one,Complex.ofReal_pow, Complex.ofReal_zero,positiveHeightPower] field_simp [Complex.ofReal_ne_zero.mpr hv] ; ring def cuspSeedProfile (a b : ℝ) (s : ℂ) (v : ℝ) : ℂ := (cuspTransition a b v:ℂ)*positiveHeightPower s v lemma cuspSeedProfile_zero (a b : ℝ) (s : ℂ) (v : ℝ) (hab : a ((deriv (cuspTransition a b) x:ℝ):ℂ)*positiveHeightPower s x+ (cuspTransition a b x:ℂ)*deriv (positiveHeightPower s) x) := by filter_upwards [eventually_ne_nhds hv] with x hx rw [(cuspSeedProfile_hasDerivAt a b s x hx).deriv,(positiveHeightPower_hasDerivAt s x hx).deriv] apply HasDerivAt.congr_of_eventuallyEq _ heq convert (hdχ.mul hH).add (hχ.mul hdH) using 1 <;> first | rfl | (funext y; rfl) | (rw [hH.deriv]; ring) def cuspSeedDefectProfile (a b : ℝ) (s : ℂ) (v : ℝ) : ℂ := positiveHeightPower s v*((v:ℂ)^2*((deriv (deriv (cuspTransition a b)) v:ℝ):ℂ)+ (2*s-1)*(v:ℂ)*((deriv (cuspTransition a b) v:ℝ):ℂ)) lemma cuspSeedProfile_laplace_defect (a b : ℝ) (s : ℂ) (v : ℝ) (hv : v≠0) : (v:ℂ)^2*deriv (deriv (cuspSeedProfile a b s)) v- (v:ℂ)*deriv (cuspSeedProfile a b s) v-s*(s-2)*cuspSeedProfile a b s v= cuspSeedDefectProfile a b s v := by rw [(cuspSeedProfile_hasDerivAt a b s v hv).deriv,(cuspSeedProfile_hasDerivAt_deriv a b s v hv).deriv] unfold cuspSeedDefectProfile cuspSeedProfile field_simp [Complex.ofReal_ne_zero.mpr hv] ; ring lemma cuspSeedDefectProfile_zero (a b : ℝ) (s : ℂ) (v : ℝ) (hab : a quadraticHeightDenominator (Complex.normSq (u 0)) (u 0*star (u 1)).re (-(u 0*star (u 1)).im) (Complex.normSq (u 1)) (q 0) (q 1) (q 2)) p := by unfold quadraticHeightDenominator fun_prop exact (show ContDiffAt ℝ ∞ (fun q : SpatialCoordinates => q 2) p by fun_prop).div hq (row_denominator_pos u hu p hp).ne' lemma rowSmoothPower_eq_height (s : ℂ) (u : Fin 2 → ℂ) (hu : u≠0) (p : SpatialCoordinates) (hp : 0

∑r∈S,(cosetCharacter r)⁻¹*F (rowHeight (embeddedRow r) q)) := by obtain ⟨U,hU,hpU,S,hrows⟩ := locally_finite_high_rows p hp refine ⟨S,?_⟩ filter_upwards [hU.mem_nhds hpU] with q hq apply tsum_eq_sum intro r hr rw [hF _ ((hrows q hq).2 r hr).le,mul_zero] lemma heightPoincareField_contDiffAt (F : ℝ → ℂ) (hzero : ∀v≤1,F v=0) (hF : ∀v,0 (Real.log x:ℂ)) v := Complex.ofRealCLM.contDiff.contDiffAt.comp v (Real.contDiffAt_log.mpr hv) have hs : ContDiffAt ℝ ∞ (fun x : ℝ => s*(Real.log x:ℂ)) v := contDiffAt_const.mul hlog unfold positiveHeightPower logRatioPower simpa only [Real.log_one,sub_zero] using hs.cexp lemma cuspSeedProfile_contDiffAt (a b : ℝ) (s : ℂ) (v : ℝ) (hv : 0 (x:ℂ)) v := Complex.ofRealCLM.contDiff.contDiffAt exact (positiveHeightPower_contDiffAt s v hv.ne').mul (((hid.pow 2).mul hd₂).add ((contDiffAt_const.mul hid).mul hd₁)) lemma cuspSeedDefectProfile_continuous (a b : ℝ) (s : ℂ) (ha : 0 (0:ℂ)) := by filter_upwards [Iio_mem_nhds hv] with x hx exact cuspSeedDefectProfile_zero a b s x hab (Or.inl hx) exact continuousAt_const.congr heq.symm · exact (cuspSeedDefectProfile_contDiffAt a b s v (lt_of_lt_of_le ha (le_of_not_gt hv))).continuousAt def smoothCuspSeed (a b : ℝ) (s : ℂ) : HyperbolicSpace → ℂ := cuspCutoffCorrection 1 (cuspSeedProfile a b s) def smoothCuspSeedDefect (a b : ℝ) (s : ℂ) : HyperbolicSpace → ℂ := cuspCutoffCorrection 1 (cuspSeedDefectProfile a b s) lemma smoothCuspSeed_automorphy (a b : ℝ) (s : ℂ) (M : levelThree) (w : HyperbolicSpace) : smoothCuspSeed a b s (complexMatrix M • w)=complexCharacter M*smoothCuspSeed a b s w := cuspCutoffCorrection_automorphy 1 le_rfl _ M w lemma smoothCuspSeedDefect_automorphy (a b : ℝ) (s : ℂ) (M : levelThree) (w : HyperbolicSpace) : smoothCuspSeedDefect a b s (complexMatrix M • w)=complexCharacter M*smoothCuspSeedDefect a b s w := cuspCutoffCorrection_automorphy 1 le_rfl _ M w lemma smoothCuspSeed_coordinate (a b : ℝ) (s : ℂ) (ha : 1 cuspSeedProfile_zero a b s v hab (hv.trans ha.le)) p hp).symm lemma smoothCuspSeedDefect_coordinate (a b : ℝ) (s : ℂ) (ha : 1 cuspSeedDefectProfile_zero a b s v hab (Or.inl (lt_of_le_of_lt hv ha))) p hp).symm lemma smoothCuspSeed_contDiffAt (a b : ℝ) (s : ℂ) (ha : 1 cuspSeedProfile_zero a b s v hab (hv.trans ha.le)) (cuspSeedProfile_contDiffAt a b s) p hp lemma smoothCuspSeedDefect_support (a b : ℝ) (s : ℂ) (hab : a Real.log (f t)-Real.log (g t))) ((ddf*f x-df x*df x)/(f x)^2-(ddg*g x-dg x*dg x)/(g x)^2) x := by have heq : deriv (fun t => Real.log (f t)-Real.log (g t)) =ᶠ[𝓝 x] (fun t => df t/f t-dg t/g t) := by filter_upwards [((hf x).continuousAt.eventually_ne hf0).and ((hg x).continuousAt.eventually_ne hg0)] with t ht exact (((hf t).log ht.1).sub ((hg t).log ht.2)).deriv exact ((hdf.div (hf x) hf0).sub (hdg.div (hg x) hg0)).congr_of_eventuallyEq heq lemma rowLogHeight_hasDerivAt (u : Fin 2 → ℂ) (hu : u≠0) (p : SpatialCoordinates) (hp : 0

rowLogHeight u (Function.update p j t)) (rowLogD u p j) (p j) := by let A := Complex.normSq (u 0) let B := (u 0*star (u 1)).re let C := -(u 0*star (u 1)).im let D := Complex.normSq (u 1) have hq := (row_denominator_pos u hu p hp).ne' fin_cases j · have h := ((hasDerivAt_const (p 0) (p 2)).log hp.ne').sub ((quadraticHeightDenominator_hasDerivAt_x A B C D (p 0) (p 1) (p 2)).log hq) simpa [rowLogHeight,rowLogD,spatialLogD,heightLogDx,Function.update,A,B,C,D,Pi.sub_def] using! h · have h := ((hasDerivAt_const (p 1) (p 2)).log hp.ne').sub ((quadraticHeightDenominator_hasDerivAt_y A B C D (p 0) (p 1) (p 2)).log hq) simpa [rowLogHeight,rowLogD,spatialLogD,heightLogDy,Function.update,A,B,C,D,Pi.sub_def] using! h · have h := ((hasDerivAt_id (p 2)).log hp.ne').sub ((quadraticHeightDenominator_hasDerivAt_v A B C D (p 0) (p 1) (p 2)).log hq) simpa [rowLogHeight,rowLogD,spatialLogD,heightLogDv,Function.update,A,B,C,D,Pi.sub_def] using! h lemma rowLogHeight_hasDerivAt_deriv (u : Fin 2 → ℂ) (hu : u≠0) (p : SpatialCoordinates) (hp : 0

rowLogHeight u (Function.update p j t))) (rowLogDD u p j) (p j) := by let A := Complex.normSq (u 0) let B := (u 0*star (u 1)).re let C := -(u 0*star (u 1)).im let D := Complex.normSq (u 1) have hq := (row_denominator_pos u hu p hp).ne' fin_cases j · have h := hasDerivAt_deriv_log_ratio (fun _ => p 2) (fun t => quadraticHeightDenominator A B C D t (p 1) (p 2)) (fun _ => 0) (fun t => 2*(A*t+B)) (p 0) 0 (2*A) (fun t => hasDerivAt_const t (p 2)) (fun t => quadraticHeightDenominator_hasDerivAt_x A B C D t (p 1) (p 2)) (hasDerivAt_const (p 0) 0) (by simpa only [id_eq,mul_one] using ((hasDerivAt_id (p 0)).const_mul A |>.add_const B).const_mul 2) hp.ne' hq simpa [rowLogHeight,rowLogDD,spatialLogDD,heightLogDxx,Function.update,A,B,C,D,Pi.sub_def] using! h · have h := hasDerivAt_deriv_log_ratio (fun _ => p 2) (fun t => quadraticHeightDenominator A B C D (p 0) t (p 2)) (fun _ => 0) (fun t => 2*(A*t+C)) (p 1) 0 (2*A) (fun t => hasDerivAt_const t (p 2)) (fun t => quadraticHeightDenominator_hasDerivAt_y A B C D (p 0) t (p 2)) (hasDerivAt_const (p 1) 0) (by simpa only [id_eq,mul_one] using ((hasDerivAt_id (p 1)).const_mul A |>.add_const C).const_mul 2) hp.ne' hq simpa [rowLogHeight,rowLogDD,spatialLogDD,heightLogDyy,Function.update,A,B,C,D,Pi.sub_def] using! h · have h := hasDerivAt_deriv_log_ratio id (fun t => quadraticHeightDenominator A B C D (p 0) (p 1) t) (fun _ => 1) (fun t => 2*A*t) (p 2) 0 (2*A) (fun t => hasDerivAt_id t) (fun t => quadraticHeightDenominator_hasDerivAt_v A B C D (p 0) (p 1) t) (hasDerivAt_const (p 2) 1) (by simpa only [id_eq,mul_one] using (hasDerivAt_id (p 2)).const_mul (2*A)) hp.ne' hq simpa [rowLogHeight,rowLogDD,spatialLogDD,heightLogDvv,Function.update,A,B,C,D,div_eq_mul_inv] using h lemma complex_profile_second_chain (F : ℝ → ℂ) (g : ℝ → ℝ) (x dg ddg : ℝ) (dF ddF : ℂ) (hg : HasDerivAt g dg x) (hdg : HasDerivAt (deriv g) ddg x) (hF : HasDerivAt F dF (g x)) (hdF : HasDerivAt (deriv F) ddF (g x)) (hlocal : ∀ᶠy in 𝓝 x,DifferentiableAt ℝ g y ∧ DifferentiableAt ℝ F (g y)) : HasDerivAt (deriv (fun y => F (g y))) (ddF*(dg:ℂ)^2+dF*(ddg:ℂ)) x := by have heq : deriv (fun y => F (g y)) =ᶠ[𝓝 x] (fun y => (deriv g y:ℝ) • deriv F (g y)) := by filter_upwards [hlocal] with y hy exact (hy.2.hasDerivAt.scomp y hy.1.hasDerivAt).deriv apply HasDerivAt.congr_of_eventuallyEq _ heq convert hdg.smul (hdF.scomp x hg) using 1 · rfl · simp only [Function.comp_apply,hg.deriv,hF.deriv,Complex.real_smul] ring lemma positiveProfile_differentiable (F : ℝ → ℂ) (hF : ∀v,0 F (Real.exp y)) (deriv F (Real.exp t)*(Real.exp t:ℂ)) t ∧ HasDerivAt (deriv (fun y => F (Real.exp y))) (deriv (deriv F) (Real.exp t)*(Real.exp t:ℂ)^2+ deriv F (Real.exp t)*(Real.exp t:ℂ)) t := by have hdf := positiveProfile_differentiable F hF (Real.exp t) (Real.exp_pos t) constructor · simpa only [Complex.real_smul,mul_comm,Function.comp_def] using! hdf.1.hasDerivAt.scomp t (Real.hasDerivAt_exp t) · apply complex_profile_second_chain F Real.exp t (Real.exp t) (Real.exp t) (deriv F (Real.exp t)) (deriv (deriv F) (Real.exp t)) (Real.hasDerivAt_exp t) (by simpa only [Real.deriv_exp] using Real.hasDerivAt_exp t) hdf.1.hasDerivAt hdf.2.hasDerivAt exact Filter.Eventually.of_forall (fun y => ⟨Real.differentiable_exp y,(positiveProfile_differentiable F hF _ (Real.exp_pos y)).1⟩) lemma rowProfile_axis_derivatives (F : ℝ → ℂ) (hF : ∀v,0 F (rowHeight u q)) p j) (deriv F (rowHeight u p)*(rowHeight u p:ℂ)*(rowLogD u p j:ℂ)) (p j) ∧ HasDerivAt (deriv (axisSlice (fun q => F (rowHeight u q)) p j)) (deriv (deriv F) (rowHeight u p)*(rowHeight u p:ℂ)^2*(rowLogD u p j:ℂ)^2+ deriv F (rowHeight u p)*(rowHeight u p:ℂ)* ((rowLogD u p j:ℂ)^2+(rowLogDD u p j:ℂ))) (p j) := by let g : ℝ → ℝ := fun t => rowLogHeight u (Function.update p j t) let G : ℝ → ℂ := fun t => F (Real.exp t) have hg : HasDerivAt g (rowLogD u p j) (p j) := rowLogHeight_hasDerivAt u hu p hp j have hdg : HasDerivAt (deriv g) (rowLogDD u p j) (p j) := rowLogHeight_hasDerivAt_deriv u hu p hp j have hgval : g (p j)=rowLogHeight u p := by simp [g,Function.update_eq_self] have hexp : Real.exp (g (p j))=rowHeight u p := by rw [hgval,exp_rowLogHeight u hu p hp] have hG := positiveProfile_exp_derivatives F hF (g (p j)) have hnear : ∀ᶠt in 𝓝 (p j),0<(Function.update p j t) 2 := ((continuous_apply 2).comp (continuous_axis_update p j)).continuousAt.eventually_const_lt (by simpa only [Function.comp_apply,Function.update_eq_self] using hp) have heq : axisSlice (fun q => F (rowHeight u q)) p j =ᶠ[𝓝 (p j)] (fun t => G (g t)) := by filter_upwards [hnear] with t ht change F (rowHeight u (Function.update p j t))=F (Real.exp (rowLogHeight u (Function.update p j t))) rw [exp_rowLogHeight u hu _ ht] constructor · have hh := hG.1.scomp (p j) hg apply HasDerivAt.congr_of_eventuallyEq _ heq convert hh using 1 · rfl · simp only [Complex.real_smul,hexp] ring · have hlocal : ∀ᶠy in 𝓝 (p j),DifferentiableAt ℝ g y ∧ DifferentiableAt ℝ G (g y) := by filter_upwards [hnear] with y hy constructor · have h := rowLogHeight_hasDerivAt u hu (Function.update p j y) hy j simpa only [Function.update_idem,Function.update_self] using h.differentiableAt · exact (positiveProfile_exp_derivatives F hF (g y)).1.differentiableAt have hh := complex_profile_second_chain G g (p j) (rowLogD u p j) (rowLogDD u p j) _ _ hg hdg hG.1 hG.2 hlocal apply HasDerivAt.congr_of_eventuallyEq _ heq.deriv convert hh using 1 <;> first | rfl | (rw [hexp]; ring) lemma rowLog_eikonal (u : Fin 2 → ℂ) (hu : u≠0) (p : SpatialCoordinates) (hp : 0

F (rowHeight u q)) p= (rowHeight u p:ℂ)^2*deriv (deriv F) (rowHeight u p)-(rowHeight u p:ℂ)*deriv F (rowHeight u p) := by have hp0 := rowProfile_axis_derivatives F hF u hu p hp 0 have hp1 := rowProfile_axis_derivatives F hF u hu p hp 1 have hp2 := rowProfile_axis_derivatives F hF u hu p hp 2 unfold axisLaplacian rw [Fin.sum_univ_three,hp0.2.deriv,hp1.2.deriv,hp2.2.deriv,hp2.1.deriv] have hE := congrArg (fun r : ℝ => (r:ℂ)) (rowLog_eikonal u hu p hp) have hD := congrArg (fun r : ℝ => (r:ℂ)) (rowLog_laplacian u hu p hp) push_cast at hE hD linear_combination (deriv (deriv F) (rowHeight u p)*(rowHeight u p:ℂ)^2+ deriv F (rowHeight u p)*(rowHeight u p:ℂ))*hE+ (deriv F (rowHeight u p)*(rowHeight u p:ℂ))*hD open Filter open scoped BigOperators Classical Topology ContDiff lemma axisLaplacian_congr_eventuallyEq (f g : SpatialCoordinates → ℂ) (p : SpatialCoordinates) (heq : f =ᶠ[𝓝 p] g) : axisLaplacian f p=axisLaplacian g p := by have haxis (j : Fin 3) : axisSlice f p j =ᶠ[𝓝 (p j)] axisSlice g p j := by have ht : Tendsto (fun x => Function.update p j x) (𝓝 (p j)) (𝓝 p) := by have h : Tendsto (fun x => Function.update p j x) (𝓝 (p j)) (𝓝 (Function.update p j (p j))) := (continuous_axis_update p j).continuousAt simpa only [Function.update_eq_self] using h exact heq.comp_tendsto ht unfold axisLaplacian congr 1 · congr 1 exact Finset.sum_congr rfl (fun j _ => (haxis j).deriv.deriv_eq) · rw [(haxis 2).deriv_eq] lemma axisLaplacian_const_mul (c : ℂ) (f : SpatialCoordinates → ℂ) (p : SpatialCoordinates) : axisLaplacian (fun q => c*f q) p=c*axisLaplacian f p := by unfold axisLaplacian simp only [Fin.sum_univ_three] unfold axisSlice simp only [deriv_const_mul_field',deriv_const_mul_field] ring lemma axisLaplacian_finset_sum {ι : Type*} (S : Finset ι) (f : ι → SpatialCoordinates → ℂ) (hreg : ∀i∈S,∀q,0 ∑i∈S,f i q) p=∑i∈S,axisLaplacian (f i) p := by have hpair (j : Fin 3) : deriv (axisSlice (fun q => ∑i∈S,f i q) p j) (p j)=∑i∈S,deriv (axisSlice (f i) p j) (p j) ∧ deriv (deriv (axisSlice (fun q => ∑i∈S,f i q) p j)) (p j)= ∑i∈S,deriv (deriv (axisSlice (f i) p j)) (p j) := by have hfirst (x : ℝ) (hx : 0<(Function.update p j x) 2) : HasDerivAt (axisSlice (fun q => ∑i∈S,f i q) p j) (∑i∈S,deriv (axisSlice (f i) p j) x) x := by have hi (i : ι) (hiS : i∈S) : DifferentiableAt ℝ (axisSlice (f i) p j) x := by simpa only [axisSlice_update,Function.update_self] using (hreg i hiS (Function.update p j x) hx j).1 convert HasDerivAt.sum (fun i hiS => (hi i hiS).hasDerivAt) using 1 <;> first | rfl | (ext y; simp only [axisSlice,Finset.sum_apply]) have hnear : ∀ᶠx in 𝓝 (p j),0<(Function.update p j x) 2 := ((continuous_apply 2).comp (continuous_axis_update p j)).continuousAt.eventually_const_lt (by simpa only [Function.comp_apply,Function.update_eq_self] using hp) have heq : deriv (axisSlice (fun q => ∑i∈S,f i q) p j) =ᶠ[𝓝 (p j)] (fun x => ∑i∈S,deriv (axisSlice (f i) p j) x) := by filter_upwards [hnear] with x hx exact (hfirst x hx).deriv have hsecond : HasDerivAt (deriv (axisSlice (fun q => ∑i∈S,f i q) p j)) (∑i∈S,deriv (deriv (axisSlice (f i) p j)) (p j)) (p j) := by apply (HasDerivAt.sum (fun i hiS => (hreg i hiS p hp j).2.hasDerivAt)).congr_of_eventuallyEq filter_upwards [heq] with x hx simpa only [Finset.sum_apply] using hx exact ⟨(hfirst (p j) (by simpa only [Function.comp_apply,Function.update_eq_self] using hp)).deriv,hsecond.deriv⟩ unfold axisLaplacian simp_rw [(hpair _).1,(hpair _).2] rw [Finset.sum_comm] simp only [Finset.mul_sum,Finset.sum_sub_distrib] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.SeedDefects namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CubicEisenstein open Filter open scoped BigOperators Classical Topology ContDiff lemma cuspSeed_row_defect (a b : ℝ) (s c : ℂ) (u : Fin 2 → ℂ) (hu : u≠0) (p : SpatialCoordinates) (hp : 0

c*cuspSeedProfile a b s (rowHeight u q)) p- s*(s-2)*(c*cuspSeedProfile a b s (rowHeight u p))= c*cuspSeedDefectProfile a b s (rowHeight u p) := by rw [axisLaplacian_const_mul,rowProfile_laplacian _ (cuspSeedProfile_contDiffAt a b s) u hu p hp] have h := cuspSeedProfile_laplace_defect a b s (rowHeight u p) (rowHeight_pos u hu p hp).ne' linear_combination c*h theorem heightPoincare_cuspSeed_laplace_defect (a b : ℝ) (s : ℂ) (ha : 1 (cosetCharacter r)⁻¹*cuspSeedProfile a b s (rowHeight (embeddedRow r) q) have heq : heightPoincareField (cuspSeedProfile a b s) =ᶠ[𝓝 p] (fun q => ∑r∈S,f r q) := by filter_upwards [hU.mem_nhds hpU] with q hq apply tsum_eq_sum intro r hr rw [cuspSeedProfile_zero a b s _ hab (le_trans ((hrows q hq).2 r hr).le ha.le),mul_zero] have hD : heightPoincareField (cuspSeedDefectProfile a b s) p= ∑r∈S,(cosetCharacter r)⁻¹*cuspSeedDefectProfile a b s (rowHeight (embeddedRow r) p) := by apply tsum_eq_sum intro r hr rw [cuspSeedDefectProfile_zero a b s _ hab (Or.inl (((hrows p hpU).2 r hr).trans ha)),mul_zero] have hreg : ∀r∈S,∀q,0 (cosetCharacter r)⁻¹*cuspSeedProfile a b s v) v := fun v hv => contDiffAt_const.mul (cuspSeedProfile_contDiffAt a b s v hv) have h := rowProfile_axis_derivatives _ hc (embeddedRow r) (embeddedRow_ne_zero r) q hq j exact ⟨h.1.differentiableAt,h.2.differentiableAt⟩ rw [axisLaplacian_congr_eventuallyEq _ _ p heq,axisLaplacian_finset_sum S f hreg p hp, heq.eq_of_nhds,hD,Finset.mul_sum,← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro r hr exact cuspSeed_row_defect a b s (cosetCharacter r)⁻¹ (embeddedRow r) (embeddedRow_ne_zero r) p hp def smoothCuspSeedField (a b : ℝ) (s : ℂ) (p : SpatialCoordinates) : ℂ := if hp : 0

smoothCuspSeedField_eq a b s ha hab q hq) p hp, smoothCuspSeedField_eq a b s ha hab p hp,smoothCuspSeedDefectField_eq a b s ha hab p hp] exact heightPoincare_cuspSeed_laplace_defect a b s ha hab p hp end CubicEisenstein open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson CompletedGauss open TruncatedPrincipalPoisson IdealMobiusDivisorSum def sectorBadIdeal (E : fixedBadPrimes.powerset) : Ideal O := ∏ P ∈ E.val, P theorem sector_bad_good_product (I : Ideal O) (hI : Squarefree I) (E : fixedBadPrimes.powerset) (hE : badPrimeSector I = E) : sectorBadIdeal E * goodSquarefreePart I = I := by have hs : badPrimeSupport I = E.val := congrArg Subtype.val hE simpa only [hs, sectorBadIdeal] using squarefree_bad_good_product I hI theorem sectorBadIdeal_ne_zero_of_row (I : Ideal O) (hI : Squarefree I) (E : fixedBadPrimes.powerset) (hE : badPrimeSector I = E) : sectorBadIdeal E ≠ 0 := by intro hz have hp := sector_bad_good_product I hI E hE rw [hz, zero_mul] at hp exact hI.ne_zero hp.symm variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def unrestrictedPairTerm (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (i : m) (j : n) (k : p) : ℂ := if IsCoprime (left j) (right k) then star (a j) * b k * unrestrictedPairCharacter (left j) (right k) (rows i) else 0 omit [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem unrestrictedPairTerm_sector (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (hrows : ∀ i, Squarefree (rows i)) (hleft : ∀ j, Admissible (left j)) (hright : ∀ k, Admissible (right k)) (hray : ∀ j k, columnRay (left j) = columnRay (right k)) (E : fixedBadPrimes.powerset) (hE : ∀ i, badPrimeSector (rows i) = E) (i : m) (j : n) (k : p) : unrestrictedPairTerm rows left right a b i j k = originalTerm (fun i => goodSquarefreePart (rows i)) left right (fun j => a j * quadraticRow (left j) (idealGenerator (sectorBadIdeal E))) (fun k => b k * quadraticRow (right k) (idealGenerator (sectorBadIdeal E))) 1 1 i j k := by classical by_cases hc : IsCoprime (left j) (right k) · simp only [unrestrictedPairTerm, originalTerm, hc, ite_true, one_dvd] have hp := unrestrictedPairCharacter_squarefree_bad_split (left j) (right k) (rows i) (hleft j) (hright k) (hray j k) (hrows i) have hs : badPrimeSupport (rows i) = E.val := congrArg Subtype.val (hE i) rw [hp, hs] simp only [sectorBadIdeal, unrestrictedPairCharacter, star_mul, canonical_quadraticRow_star _ (hleft j)] ring · simp only [unrestrictedPairTerm, originalTerm, hc, ite_false] def unrestrictedDualTruncatedMiddle (W : 𝓢(ℝ, ℂ)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (Y Z : m → ℝ) (lengthScale : ℝ) : ℂ := ∑ i, ∑ j, ∑ k, unrestrictedPairTerm rows left right a b i j k * (((M / (Real.sqrt ((Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ)) * F) : ℝ) : ℂ) * middleTruncation (fun P : primePool {left j * right k} => P.val) Finset.univ W (Real.sqrt (F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ)))) (Y i) (Z i) lengthScale) omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem unrestrictedDualTruncatedMiddle_sector (W : 𝓢(ℝ, ℂ)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (Y Z : m → ℝ) (lengthScale : ℝ) (hrows : ∀ i, Squarefree (rows i)) (hleft : ∀ j, Admissible (left j)) (hright : ∀ k, Admissible (right k)) (hray : ∀ j k, columnRay (left j) = columnRay (right k)) (E : fixedBadPrimes.powerset) (hE : ∀ i, badPrimeSector (rows i) = E) (hQ : sectorBadIdeal E ≠ 0) : unrestrictedDualTruncatedMiddle W rows left right a b M F Y Z lengthScale = ((1 / (Ideal.absNorm (sectorBadIdeal E) : ℝ) : ℝ) : ℂ) * dualTruncatedMiddle W (fun i => goodSquarefreePart (rows i)) left right (fun j => a j * quadraticRow (left j) (idealGenerator (sectorBadIdeal E))) (fun k => b k * quadraticRow (right k) (idealGenerator (sectorBadIdeal E))) (M * (Ideal.absNorm (sectorBadIdeal E) : ℝ)) F Y Z lengthScale := by classical have hQn : (Ideal.absNorm (sectorBadIdeal E) : ℝ) ≠ 0 := by exact_mod_cast (show Ideal.absNorm (sectorBadIdeal E) ≠ 0 from fun h => hQ (Ideal.absNorm_eq_zero_iff.mp h)) unfold unrestrictedDualTruncatedMiddle dualTruncatedMiddle simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro k hk rw [unrestrictedPairTerm_sector rows left right a b hrows hleft hright hray E hE i j k] have hn : (Ideal.absNorm (rows i) : ℝ) = (Ideal.absNorm (sectorBadIdeal E) : ℝ) * (Ideal.absNorm (goodSquarefreePart (rows i)) : ℝ) := by calc (Ideal.absNorm (rows i) : ℝ) = (Ideal.absNorm (sectorBadIdeal E * goodSquarefreePart (rows i)) : ℝ) := congrArg (fun I : Ideal O => (Ideal.absNorm I : ℝ)) (sector_bad_good_product (rows i) (hrows i) E (hE i)).symm _ = _ := by rw [map_mul, Nat.cast_mul] rw [hn] have harg : F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / (M * ((Ideal.absNorm (sectorBadIdeal E) : ℝ) * (Ideal.absNorm (goodSquarefreePart (rows i)) : ℝ))) = F * (Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ) / ((M * (Ideal.absNorm (sectorBadIdeal E) : ℝ)) * (Ideal.absNorm (goodSquarefreePart (rows i)) : ℝ)) := by ring rw [harg] have hs : (M / (Real.sqrt ((Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ)) * F) : ℝ) = (1 / (Ideal.absNorm (sectorBadIdeal E) : ℝ)) * ((M * (Ideal.absNorm (sectorBadIdeal E) : ℝ)) / (Real.sqrt ((Ideal.absNorm (left j) : ℝ) * (Ideal.absNorm (right k) : ℝ)) * F)) := by field_simp [hQn] rw [hs, Complex.ofReal_mul] ring end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson CompletedGauss lemma divisorEnergyFactor_mono_coefficients {n p : Type*} [Fintype n] [Fintype p] (ε : ℝ) (hε : 0 < ε) (N : ℝ) (a a' : n → ℂ) (b b' : p → ℂ) (ha : ∀ j, ‖a' j‖ ≤ ‖a j‖) (hb : ∀ k, ‖b' k‖ ≤ ‖b k‖) : divisorEnergyFactor ε hε N a' b' ≤ divisorEnergyFactor ε hε N a b := by have hA : (∑ j, ‖a' j‖ ^ 2) ≤ ∑ j, ‖a j‖ ^ 2 := Finset.sum_le_sum (fun j _ => pow_le_pow_left₀ (norm_nonneg _) (ha j) _) have hB : (∑ k, ‖b' k‖ ^ 2) ≤ ∑ k, ‖b k‖ ^ 2 := Finset.sum_le_sum (fun k _ => pow_le_pow_left₀ (norm_nonneg _) (hb k) _) have hs := (IdealCoprimeSieveOperator.supportConstant_pos ε hε).le have hd := (DivisorBlockCauchy.divisorConstant_pos ε hε).le unfold divisorEnergyFactor gcongr lemma dual_bad_sector_scale (M F B Q U α : ℝ) (hM : 0 < M) (hF : 0 < F) (hB : 0 ≤ B) (hQ : 1 ≤ Q) (hU : 0 ≤ U) (hα : 1 / 2 ≤ α) : (1 / Q) * (M * Q / F + (2 * U) * Real.sqrt (M * Q / F) * (B / Q) ^ (α - 1 / 2)) ≤ M / F + (2 * U) * Real.sqrt (M / F) * B ^ (α - 1 / 2) := by have hQp : 0 < Q := by linarith have hpow : (B / Q) ^ (α - 1 / 2) ≤ B ^ (α - 1 / 2) := Real.rpow_le_rpow (by positivity) (div_le_self hB hQ) (by linarith) have hsQ : Real.sqrt Q ≤ Q := Real.sqrt_le_self_iff.mpr (Or.inr hQ) have hs : (1 / Q) * Real.sqrt (M * Q / F) ≤ Real.sqrt (M / F) := by have he : M * Q / F = (M / F) * Q := by ring rw [he, Real.sqrt_mul (by positivity)] have ht : Real.sqrt Q / Q ≤ 1 := (div_le_one hQp).mpr hsQ calc _ = Real.sqrt (M / F) * (Real.sqrt Q / Q) := by ring _ ≤ Real.sqrt (M / F) * 1 := mul_le_mul_of_nonneg_left ht (Real.sqrt_nonneg _) _ = _ := mul_one _ calc _ = M / F + (2 * U) * ((1 / Q) * Real.sqrt (M * Q / F)) * (B / Q) ^ (α - 1 / 2) := by field_simp _ ≤ _ := by gcongr def dualMiddleMajorant {n p : Type} [Fintype n] [Fintype p] {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U : ℝ) (a : n → ℂ) (b : p → ℂ) (W : 𝓢(ℝ, ℂ)) : ℝ := ((columnDyadicLength N + 1 : ℕ) : ℝ) ^ 2 * ((2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * divisorEnergyFactor ε hε N a b * (divisorExponentConstant hexp deltaLoss hδ * (B * N) ^ deltaLoss) * (M / F + (2 * U) * Real.sqrt (M / F) * B ^ (α - 1 / 2))) lemma dualMiddleMajorant_nonneg {n p : Type} [Fintype n] [Fintype p] {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U : ℝ) (a : n → ℂ) (b : p → ℂ) (W : 𝓢(ℝ, ℂ)) (hB : 0 ≤ B) (hN : 0 ≤ N) (hM : 0 ≤ M) (hF : 0 ≤ F) (hU : 0 ≤ U) : 0 ≤ dualMiddleMajorant hexp deltaLoss hδ ε hε B N M F U a b W := by have hc := nonzeroLatticeEnvelopeConstant_nonneg have hW := dualMiddleDecayConstant_nonneg W have he := divisorEnergyFactor_nonneg ε hε N a b have hd := (divisorExponentConstant_pos hexp deltaLoss hδ).le unfold dualMiddleMajorant positivity variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] theorem HasSieveExponent.dual_truncated_middle_sector {α : ℝ} (hexp : HasSieveExponent α) (hα : 1 / 2 ≤ α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hU : 0 ≤ U) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Squarefree (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a : n → ℂ) (b : p → ℂ) (W : 𝓢(ℝ, ℂ)) (Y Z : m → ℝ) (lengthScale : ℝ) (hleft : ∀ j, Admissible (left j) ∧ N / 2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N / 2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hray : ∀ j k, columnRay (left j) = columnRay (right k)) (hZ : ∀ i, Z i ≤ U * (N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ))))) (E : fixedBadPrimes.powerset) (hE : ∀ i, badPrimeSector (rows i) = E) : ‖unrestrictedDualTruncatedMiddle W rows left right a b M F Y Z lengthScale‖ ≤ dualMiddleMajorant hexp deltaLoss hδ ε hε B N M F U a b W := by classical cases isEmpty_or_nonempty m with | inl hempty => let := hempty simp only [unrestrictedDualTruncatedMiddle, Finset.univ_eq_empty, Finset.sum_empty, norm_zero] exact dualMiddleMajorant_nonneg hexp deltaLoss hδ ε hε B N M F U a b W (by linarith) (by linarith) hM.le hF.le hU | inr hnonempty => let := hnonempty let i₀ : m := Classical.choice hnonempty let Q : ℝ := Ideal.absNorm (sectorBadIdeal E) let good := fun i => goodSquarefreePart (rows i) let a' := fun j => a j * quadraticRow (left j) (idealGenerator (sectorBadIdeal E)) let b' := fun k => b k * quadraticRow (right k) (idealGenerator (sectorBadIdeal E)) have hQnz := sectorBadIdeal_ne_zero_of_row (rows i₀) (hrows i₀).1 E (hE i₀) have hQ : 1 ≤ Q := by dsimp only [Q] exact_mod_cast (Nat.one_le_iff_ne_zero.mpr (fun h => hQnz (Ideal.absNorm_eq_zero_iff.mp h))) have hQp : 0 < Q := by linarith have hn (i : m) : (Ideal.absNorm (rows i) : ℝ) = Q * (Ideal.absNorm (good i) : ℝ) := by have hi := congrArg (fun I : Ideal O => (Ideal.absNorm I : ℝ)) (sector_bad_good_product (rows i) (hrows i).1 E (hE i)) simpa only [map_mul, Nat.cast_mul] using hi.symm have hgr : Function.Injective good := by intro i k h exact hr (goodSquarefreePart_injective_on_sector _ _ (hrows i).1 (hrows k).1 ((hE i).trans (hE k).symm) h) have hg (i : m) : Admissible (good i) ∧ (B / Q) / 2 ≤ (Ideal.absNorm (good i) : ℝ) ∧ (Ideal.absNorm (good i) : ℝ) ≤ B / Q := by refine ⟨goodSquarefreePart_admissible _, ?_, ?_⟩ · rw [show B / Q / 2 = (B / 2) / Q by ring] apply (div_le_iff₀ hQp).2 have hx := (hrows i).2.1 rw [hn i] at hx nlinarith · exact (le_div_iff₀ hQp).2 (by simpa only [mul_comm] using (hn i).symm.trans_le (hrows i).2.2) have hBQ : 1 ≤ B / Q := by have hh : 1 ≤ (Ideal.absNorm (good i₀) : ℝ) := by exact_mod_cast (Nat.one_le_iff_ne_zero.mpr (fun h => (hg i₀).1.1 (Ideal.absNorm_eq_zero_iff.mp h))) exact hh.trans (hg i₀).2.2 have hZa (i : m) : Z i ≤ U * (N * Real.sqrt (F / ((M * Q) * (Ideal.absNorm (good i) : ℝ)))) := by simpa only [hn i, mul_assoc] using hZ i have hbnd := hexp.dual_truncated_middle deltaLoss hδ ε hε (B / Q) N (M * Q) F U hBQ hN (by positivity) hF hU good left right hgr hl hri hg a' b' W Y Z lengthScale hleft hright hZa change ‖dualTruncatedMiddle W good left right a' b' (M * Q) F Y Z lengthScale‖ ≤ dualMiddleMajorant hexp deltaLoss hδ ε hε (B / Q) N (M * Q) F U a' b' W at hbnd have htr := unrestrictedDualTruncatedMiddle_sector W rows left right a b M F Y Z lengthScale (fun i => (hrows i).1) (fun j => (hleft j).1) (fun k => (hright k).1) hray E hE hQnz change unrestrictedDualTruncatedMiddle W rows left right a b M F Y Z lengthScale = ((1 / Q : ℝ) : ℂ) * dualTruncatedMiddle W good left right a' b' (M * Q) F Y Z lengthScale at htr rw [htr, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ 1 / Q)] apply (mul_le_mul_of_nonneg_left hbnd (by positivity)).trans have hae (j : n) : ‖a' j‖ ≤ ‖a j‖ := by dsimp only [a']; rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (quadraticRow_norm_le_one _ _) have hbe (k : p) : ‖b' k‖ ≤ ‖b k‖ := by dsimp only [b']; rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (quadraticRow_norm_le_one _ _) have he := divisorEnergyFactor_mono_coefficients ε hε N a a' b b' hae hbe have hp : ((B / Q) * N) ^ deltaLoss ≤ (B * N) ^ deltaLoss := by apply Real.rpow_le_rpow (by positivity) _ hδ.le exact mul_le_mul_of_nonneg_right (div_le_self (by linarith) hQ) (by linarith) have hs := dual_bad_sector_scale M F B Q U α hM hF (by linarith) hQ hU hα have hc := nonzeroLatticeEnvelopeConstant_nonneg have hW := dualMiddleDecayConstant_nonneg W have hea := divisorEnergyFactor_nonneg ε hε N a' b' have heb := divisorEnergyFactor_nonneg ε hε N a b have hd := (divisorExponentConstant_pos hexp deltaLoss hδ).le unfold dualMiddleMajorant calc _ = ((columnDyadicLength N + 1 : ℕ) : ℝ) ^ 2 * ((2 * nonzeroLatticeEnvelopeConstant * dualMiddleDecayConstant W) * divisorEnergyFactor ε hε N a' b' * (divisorExponentConstant hexp deltaLoss hδ * ((B / Q) * N) ^ deltaLoss) * ((1 / Q) * (M * Q / F + (2 * U) * Real.sqrt (M * Q / F) * (B / Q) ^ (α - 1 / 2)))) := by ring _ ≤ _ := by gcongr end open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson CompletedGauss variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] theorem HasSieveExponent.unrestricted_dual_truncated_middle {α : ℝ} (hexp : HasSieveExponent α) (hα : 1 / 2 ≤ α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hU : 0 ≤ U) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Squarefree (rows i) ∧ B / 2 ≤ (Ideal.absNorm (rows i) : ℝ) ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (a : n → ℂ) (b : p → ℂ) (W : 𝓢(ℝ, ℂ)) (Y Z : m → ℝ) (lengthScale : ℝ) (hleft : ∀ j, Admissible (left j) ∧ N / 2 ≤ (Ideal.absNorm (left j) : ℝ) ∧ (Ideal.absNorm (left j) : ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N / 2 ≤ (Ideal.absNorm (right k) : ℝ) ∧ (Ideal.absNorm (right k) : ℝ) ≤ N) (hray : ∀ j k, columnRay (left j) = columnRay (right k)) (hZ : ∀ i, Z i ≤ U * (N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ))))) : ‖unrestrictedDualTruncatedMiddle W rows left right a b M F Y Z lengthScale‖ ≤ 4 * dualMiddleMajorant hexp deltaLoss hδ ε hε B N M F U a b W := by classical let σ := fun i => badPrimeSector (rows i) have hs : unrestrictedDualTruncatedMiddle W rows left right a b M F Y Z lengthScale = ∑ E : fixedBadPrimes.powerset, unrestrictedDualTruncatedMiddle W (fun i : {i // σ i = E} => rows i.val) left right a b M F (fun i => Y i.val) (fun i => Z i.val) lengthScale := by unfold unrestrictedDualTruncatedMiddle exact (Fintype.sum_fiberwise σ _).symm have hb (E : fixedBadPrimes.powerset) : ‖unrestrictedDualTruncatedMiddle W (fun i : {i // σ i = E} => rows i.val) left right a b M F (fun i => Y i.val) (fun i => Z i.val) lengthScale‖ ≤ dualMiddleMajorant hexp deltaLoss hδ ε hε B N M F U a b W := by apply hexp.dual_truncated_middle_sector hα deltaLoss hδ ε hε B N M F U hB hN hM hF hU (fun i : {i // σ i = E} => rows i.val) left right (fun i k h => Subtype.ext (hr h)) hl hri (fun i => hrows i.val) a b W (fun i => Y i.val) (fun i => Z i.val) lengthScale hleft hright hray (fun i => hZ i.val) E exact fun i => i.property rw [hs] calc _ ≤ ∑ E : fixedBadPrimes.powerset, ‖unrestrictedDualTruncatedMiddle W (fun i : {i // σ i = E} => rows i.val) left right a b M F (fun i => Y i.val) (fun i => Z i.val) lengthScale‖ := norm_sum_le _ _ _ ≤ ∑ _E : fixedBadPrimes.powerset, dualMiddleMajorant hexp deltaLoss hδ ε hε B N M F U a b W := Finset.sum_le_sum (fun E _ => hb E) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, Fintype.card_coe, fixedBadPrimes_powerset_card] norm_num end CanonicalQuadraticSieve open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem secondChildColumn_fixed_mask (Ψ : O →* ℂ) (m g f y : O) (H : Finset ι → ℂ) (U : Finset ι) : secondChildColumn p hp hcop hg Ψ (m*g) f y H U = rowCoprimeMask (fun i => Ideal.span {p i}) U g * secondChildColumn p hp hcop hg Ψ m f y H U := by simp only [secondChildColumn,FirstPassCubeLabels.mask_mul _ hg U m g] ring theorem fixedChildRow_fixed_pool (hinj : Function.Injective (fun i => Ideal.span {p i})) (F A : Finset ι) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (f y : O) : fixedChildRow p hp hcop hg (F\A) Ψ m H f y = fixedChildRow p hp hcop hg F Ψ (m*∏ i ∈ A,p i) H f y := by unfold fixedChildRow rw [sum_remove_common_pool p hg hinj F A] apply Finset.sum_congr rfl intro U hU exact (secondChildColumn_fixed_mask p hp hcop hg Ψ m _ f y H U).symm end SecondPassArithmetic namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) include hinj end open ConcreteTraceCRT (eisEmbedding) open FirstPassCubeLabels (primeProductNorm) theorem restored_child_mask_norm {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (m b0 : O) (R A : Finset ι) : ‖eisEmbedding ((m*b0*primeSubsetGenerator (fun i => Ideal.span {p i}) R)*∏ i ∈ A,p i)‖^2 = ‖eisEmbedding m‖^2*‖eisEmbedding b0‖^2*primeProductNorm p R*primeProductNorm p A := by simp only [map_mul,norm_mul,mul_pow,SecondPassArithmetic.primeSubsetGenerator_norm_eq_productNorm, primeProductNorm] end SecondPassIntegration open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct primeProductNorm squarefreeLabel jLabel j2Label b0Label bit parity conductorExponent cubeActiveSupport) open ConcreteTraceCRT (eisEmbedding) lemma element_norm_le_of_dvd {a b : O} (hb : b ≠ 0) (h : a ∣ b) : ‖eisEmbedding a‖^2 ≤ ‖eisEmbedding b‖^2 := by obtain ⟨c,rfl⟩ := h have hc : c ≠ 0 := (mul_ne_zero_iff.mp hb).2 rw [map_mul, norm_mul, mul_pow] exact le_mul_of_one_le_right (sq_nonneg _) (element_norm_ge_one c hc) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] include hp in omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma primeProduct_ne_zero (B : Finset ι) (v : ι → ℕ) : primeProduct p B v ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i _hi => pow_ne_zero _ (hp i)) include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in lemma squarefreeLabel_active_bound (B : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) : ‖eisEmbedding (squarefreeLabel p B v)‖^2 ≤ primeProductNorm p (cubeActiveSupport B v ε₁ ε₂) := by let S := B.filter (fun i => parity (v i)) have he : squarefreeLabel p B v = ∏ i ∈ S, p i := by unfold squarefreeLabel primeProduct S rw [Finset.prod_filter] apply Finset.prod_congr rfl intro i hi cases hb : parity (v i) <;> simp [bit,hb] have hsub : S ⊆ cubeActiveSupport B v ε₁ ε₂ := by intro i hi obtain ⟨hi,hpi⟩ := Finset.mem_filter.mp hi apply Finset.mem_filter.mpr refine ⟨hi,?_⟩ change parity (v i) = true at hpi rw [hpi] cases h1 : ε₁ i <;> cases h2 : ε₂ i <;> decide rw [he] exact primeProductNorm_mono p hp hsub omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma jLabel_dvd_cube_product (B : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ i ∈ B, 0 < v₁ i+v₂ i) : jLabel p B (fun i => v₁ i+v₂ i) ε₁ ε₂ ∣ primeProduct p B v₁ * primeProduct p B v₂ := by rw [← primeProduct_add] apply Finset.prod_dvd_prod_of_dvd intro i hi apply pow_dvd_pow dsimp only unfold bit split <;> have h := hv i hi <;> omega omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma b0_square_dvd_cube_product (B : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ i ∈ B, 0 < v₁ i+v₂ i) : b0Label p B (fun i => v₁ i+v₂ i) ε₁ ε₂ ^ 2 ∣ primeProduct p B v₁ * primeProduct p B v₂ := by rw [FirstPassCubeLabels.cube_pair_product_decomposition p B v₁ v₂ ε₁ ε₂ hv] exact dvd_mul_of_dvd_left (dvd_mul_right _ _) _ omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma b0_jLabel_square (B : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ i ∈ B, 0 < v₁ i+v₂ i) : (b0Label p B (fun i => v₁ i+v₂ i) ε₁ ε₂ * jLabel p B (fun i => v₁ i+v₂ i) ε₁ ε₂)^2 = primeProduct p B v₁ * primeProduct p B v₂ * squarefreeLabel p B (fun i => v₁ i+v₂ i) := by rw [FirstPassCubeLabels.jLabel_eq_squarefree_mul_j2, FirstPassCubeLabels.cube_pair_product_decomposition p B v₁ v₂ ε₁ ε₂ hv] ring include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem cube_label_norm_bounds (B : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ i ∈ B, 0 < v₁ i+v₂ i) (B₀ : ℝ) (hB : 0 ≤ B₀) (hb₁ : ‖eisEmbedding (primeProduct p B v₁)‖^2 ≤ B₀) (hb₂ : ‖eisEmbedding (primeProduct p B v₂)‖^2 ≤ B₀) : let v := fun i => v₁ i+v₂ i ‖eisEmbedding (jLabel p B v ε₁ ε₂)‖^2 ≤ B₀^2 ∧ ‖eisEmbedding (b0Label p B v ε₁ ε₂)‖^2 ≤ B₀ ∧ ‖eisEmbedding (b0Label p B v ε₁ ε₂)‖^2 ≤ B₀*‖eisEmbedding (∏ i ∈ cubeActiveSupport B v ε₁ ε₂,p i)‖ / ‖eisEmbedding (jLabel p B v ε₁ ε₂)‖^2 := by dsimp only have hbb : ‖eisEmbedding (primeProduct p B v₁ * primeProduct p B v₂)‖^2 ≤ B₀^2 := by rw [map_mul,norm_mul,mul_pow] simpa only [pow_two] using mul_le_mul hb₁ hb₂ (sq_nonneg _) hB have hbb0 := mul_ne_zero (primeProduct_ne_zero p hp B v₁) (primeProduct_ne_zero p hp B v₂) have hJ := (element_norm_le_of_dvd hbb0 (jLabel_dvd_cube_product p B v₁ v₂ ε₁ ε₂ hv)).trans hbb have hb0sq := (element_norm_le_of_dvd hbb0 (b0_square_dvd_cube_product p B v₁ v₂ ε₁ ε₂ hv)).trans hbb simp only [map_pow,norm_pow] at hb0sq have hb0 : ‖eisEmbedding (b0Label p B (fun i => v₁ i+v₂ i) ε₁ ε₂)‖^2 ≤ B₀ := by nlinarith [sq_nonneg ‖eisEmbedding (b0Label p B (fun i => v₁ i+v₂ i) ε₁ ε₂)‖] refine ⟨hJ,hb0,?_⟩ have heq := congrArg (fun a : O => ‖eisEmbedding a‖^2) (b0_jLabel_square p B v₁ v₂ ε₁ ε₂ hv) simp only [map_pow,map_mul,norm_pow,norm_mul,mul_pow] at heq have hs := squarefreeLabel_active_bound p hp B (fun i => v₁ i+v₂ i) ε₁ ε₂ have hNprod : ‖eisEmbedding (primeProduct p B v₁)‖^2 * ‖eisEmbedding (primeProduct p B v₂)‖^2 ≤ B₀^2 := by simpa only [map_mul,norm_mul,mul_pow] using hbb have hmul := mul_le_mul hNprod hs (sq_nonneg _) (sq_nonneg B₀) change _ ≤ B₀^2*‖eisEmbedding (∏ i ∈ cubeActiveSupport B (fun i => v₁ i+v₂ i) ε₁ ε₂,p i)‖^2 at hmul have hjpos : 0 < ‖eisEmbedding (jLabel p B (fun i => v₁ i+v₂ i) ε₁ ε₂)‖^2 := by exact zero_lt_one.trans_le (element_norm_ge_one _ (primeProduct_ne_zero p hp B _)) apply (le_div_iff₀ hjpos).mpr apply (sq_le_sq₀ (mul_nonneg (sq_nonneg _) (sq_nonneg _)) (mul_nonneg hB (norm_nonneg _))).mp simp only [mul_pow] exact heq.trans_le hmul end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.GlobalEncoding namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic section variable {ι : Type*} [DecidableEq ι] (P : ι → Ideal O) [∀ i, (P i).IsMaximal] (hinj : Function.Injective P) include hinj theorem primeIdealProduct_emultiplicity (S : Finset ι) (v : ι → ℕ) (i : ι) : emultiplicity (P i) (∏ j ∈ S, P j ^ v j) = if i ∈ S then (v i : ℕ∞) else 0 := by have hp (j : ι) : Prime (P j) := Ideal.prime_of_isPrime (NeZero.ne (P j)) inferInstance rw [Finset.emultiplicity_prod (hp i)] have hz (j : ι) (hji : j ≠ i) : emultiplicity (P i) (P j ^ v j) = 0 := by rw [emultiplicity_pow (hp i), emultiplicity_eq_zero_of_irreducible_ne (hp i).irreducible (hp j).irreducible (fun he => hji (hinj he).symm), mul_zero] by_cases hi : i ∈ S · rw [ite_eq_left hi,Finset.sum_eq_single i] · exact emultiplicity_pow_self_of_prime (hp i) (v i) · intro j hj hji exact hz j hji · exact fun hn => (hn hi).elim · rw [ite_eq_right hi] apply Finset.sum_eq_zero intro j hj exact hz j (fun he => hi (he ▸ hj)) theorem primeIdealProduct_exponents_eq (B C : Finset ι) (v w : ι → ℕ) (hv : ∀ i, i ∉ B → v i = 0) (hw : ∀ i, i ∉ C → w i = 0) (heq : (∏ i ∈ B, P i ^ v i) = ∏ i ∈ C, P i ^ w i) : v = w := by funext i have he := congrArg (fun I => emultiplicity (P i) I) heq rw [primeIdealProduct_emultiplicity P hinj,primeIdealProduct_emultiplicity P hinj] at he have hB : (if i ∈ B then (v i : ℕ∞) else 0) = (v i : ℕ∞) := by by_cases h : i ∈ B <;> simp [h,hv i] have hC : (if i ∈ C then (w i : ℕ∞) else 0) = (w i : ℕ∞) := by by_cases h : i ∈ C <;> simp [h,hw i] rw [hB,hC] at he exact_mod_cast he end theorem primeProduct_span_exponents_eq {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) (B C : Finset ι) (v w : ι → ℕ) (hv : ∀ i, i ∉ B → v i = 0) (hw : ∀ i, i ∉ C → w i = 0) (heq : Ideal.span {FirstPassCubeLabels.primeProduct p B v} = Ideal.span {FirstPassCubeLabels.primeProduct p C w}) : v = w := by apply primeIdealProduct_exponents_eq (fun i => Ideal.span {p i}) hinj B C v w hv hw simpa only [FirstPassCubeLabels.primeProduct,FiniteGaussPhase.span_finset_prod, ←Ideal.span_singleton_pow] using heq end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum theorem divisor_dyadic_sum_le (S T : Finset (Ideal O)) (N : ℝ) (f : Ideal O → Ideal O → ℝ) (C : ℝ) (hC : 0 ≤ C) (hb : ∀ j k : Fin (columnDyadicLength N + 1), (divisorDyadicBin S N j).Nonempty → (divisorDyadicBin T N k).Nonempty → (∑ D ∈ divisorDyadicBin S N j, ∑ E ∈ divisorDyadicBin T N k, f D E) ≤ C) : (∑ D ∈ S, ∑ E ∈ T, f D E) ≤ ((columnDyadicLength N + 1 : ℕ) : ℝ)^2 * C := by rw [sum_divisorDyadicRectangles S T N f] calc _ ≤ ∑ j : Fin (columnDyadicLength N + 1), ∑ k : Fin (columnDyadicLength N + 1), C := by apply Finset.sum_le_sum intro j _ apply Finset.sum_le_sum intro k _ by_cases hS : (divisorDyadicBin S N j).Nonempty · by_cases hT : (divisorDyadicBin T N k).Nonempty · exact hb j k hS hT · simpa only [Finset.not_nonempty_iff_eq_empty.mp hT, Finset.sum_empty, Finset.sum_const_zero] using hC · simpa only [Finset.not_nonempty_iff_eq_empty.mp hS, Finset.sum_empty] using hC _ = _ := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, pow_two]; ring variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def largePrincipalWindow (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) : ℝ := by classical exact ∑ D ∈ S, ∑ E ∈ T, ∑ i, if P (D*E) i then (Real.sqrt (M / (Ideal.absNorm (rows i) : ℝ)) / ((Ideal.absNorm D : ℝ)*(Ideal.absNorm E : ℝ))) * ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k‖ else 0 omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in lemma largePrincipalWindow_le (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) : largePrincipalWindow S T rows left right a b M P ≤ principalCorrectionAt S T rows left right a b M := by classical unfold principalCorrectionAt rw [sum_two_subtype_pools S T (fun D E => ∑ i, (Real.sqrt (M/(Ideal.absNorm (rows i):ℝ))/((Ideal.absNorm D:ℝ)*(Ideal.absNorm E:ℝ)))* ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k‖)] unfold largePrincipalWindow apply Finset.sum_le_sum intro D _ apply Finset.sum_le_sum intro E _ apply Finset.sum_le_sum intro i _ split_ifs <;> first | exact le_rfl | positivity theorem HasSieveExponent.large_principal_window {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M V : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hV : 0 ≤ V) (hD₁N : D₁ ≤ N) (hD₂N : D₂ ≤ N) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D : ℝ) ∧ (Ideal.absNorm D : ℝ) ≤ 2*D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E : ℝ) ∧ (Ideal.absNorm E : ℝ) ≤ 2*D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (P : Ideal O → m → Prop) (hP : ∀ D ∈ S, ∀ E ∈ T, ∀ i, P (D*E) i → Real.sqrt (M/B)*N ≤ (V/4)*(Ideal.absNorm (D*E):ℝ)) : largePrincipalWindow S T rows left right a b M P ≤ 2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (V+Real.sqrt M*B^(α-1/2)) := by classical by_cases hc : Real.sqrt (M/B)*N ≤ V*(D₁*D₂) · exact (largePrincipalWindow_le S T rows left right a b M P).trans (HasSieveExponent.large_principal_correction ε hε S T D₁ D₂ B N M hD₁ hD₂ hB hN hM hS hT rows left right hr hl hri hrows hleft hright a b hexp deltaLoss hδ hD₁N hD₂N V hc) · have hz : largePrincipalWindow S T rows left right a b M P = 0 := by unfold largePrincipalWindow apply Finset.sum_eq_zero intro D hD apply Finset.sum_eq_zero intro E hE apply Finset.sum_eq_zero intro i _ have hn : ¬P (D*E) i := by intro hp apply hc have hlo := hP D hD E hE i hp have hhi : (Ideal.absNorm (D*E):ℝ) ≤ 4*(D₁*D₂) := by rw [map_mul, Nat.cast_mul] calc _ ≤ (2*D₁)*(2*D₂) := mul_le_mul (hS D hD).2 (hT E hE).2 (by positivity) (by linarith) _ = _ := by ring nlinarith simp only [hn, ite_false] rw [hz] have he := divisorEnergyFactor_nonneg ε hε N a b have hd := (divisorExponentConstant_pos hexp deltaLoss hδ).le positivity theorem HasSieveExponent.large_principal_pool {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (B N M V : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hV : 0 ≤ V) (hS : ∀ D ∈ S, 1 ≤ (Ideal.absNorm D:ℝ) ∧ (Ideal.absNorm D:ℝ) ≤ N) (hT : ∀ E ∈ T, 1 ≤ (Ideal.absNorm E:ℝ) ∧ (Ideal.absNorm E:ℝ) ≤ N) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (P : Ideal O → m → Prop) (hP : ∀ D ∈ S, ∀ E ∈ T, ∀ i, P (D*E) i → Real.sqrt (M/B)*N ≤ (V/4)*(Ideal.absNorm (D*E):ℝ)) : largePrincipalWindow S T rows left right a b M P ≤ ((columnDyadicLength N+1:ℕ):ℝ)^2 * (2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (V+Real.sqrt M*B^(α-1/2))) := by classical apply divisor_dyadic_sum_le S T N _ _ · have he := divisorEnergyFactor_nonneg ε hε N a b have hd := (divisorExponentConstant_pos hexp deltaLoss hδ).le positivity · intro j k hj hk exact hexp.large_principal_window deltaLoss hδ ε hε (divisorDyadicBin S N j) (divisorDyadicBin T N k) (divisorDyadicScale j.val) (divisorDyadicScale k.val) B N M V (divisorDyadicScale_ge_one _) (divisorDyadicScale_ge_one _) hB hN hM hV (divisorDyadicBin_scale_le S N hS j hj) (divisorDyadicBin_scale_le T N hT k hk) (divisorDyadicBin_bounds S N hS j) (divisorDyadicBin_bounds T N hT k) rows left right hr hl hri hrows hleft hright a b P (fun D hD E hE i hp => hP D (Finset.mem_filter.mp hD).1 E (Finset.mem_filter.mp hE).1 i hp) end open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum theorem finite_principal_triangle {m n p D : Type*} [Fintype m] [Fintype n] [Fintype p] [Fintype D] (muCoefficient : D → ℂ) (hμ : ∀ d, ‖muCoefficient d‖ ≤ 1) (A : m → n → p → D → ℂ) : ‖∑ i, ∑ j, ∑ k, ∑ d, muCoefficient d * A i j k d‖ ≤ ∑ i, ∑ d, ‖∑ j, ∑ k, A i j k d‖ := by classical have he : (∑ i, ∑ j, ∑ k, ∑ d, muCoefficient d * A i j k d) = ∑ i, ∑ d, muCoefficient d * (∑ j, ∑ k, A i j k d) := by simp_rw [Finset.sum_comm (s := (Finset.univ : Finset p)) (t := (Finset.univ : Finset D)), Finset.sum_comm (s := (Finset.univ : Finset n)) (t := (Finset.univ : Finset D))] simp only [Finset.mul_sum] rw [he] apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro i _ apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro d _ rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (hμ d) variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def principalDivisorCorrection (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) : ℂ := by classical exact ∑ i, ∑ j, ∑ k, originalTerm rows left right a b 1 1 i j k * ∑ d ∈ idealDivisors (left j*right k), if P d i then (UniqueFactorizationMonoid.moebius d : ℂ) * ((Real.sqrt (M/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0 def largePrincipalProductAt (K : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) : ℝ := by classical exact ∑ i, ∑ d ∈ K, if P d i then ‖∑ j, ∑ k, if d ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * ((Real.sqrt (M/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0‖ else 0 omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in lemma largePrincipalProductAt_le_window (K S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) (hleft : ∀ j, left j ≠ 0) (hright : ∀ k, right k ≠ 0) (hS : ∀ j D, D ∣ left j → D ∈ S) (hT : ∀ k E, E ∣ right k → E ∈ T) : largePrincipalProductAt K rows left right a b M P ≤ largePrincipalWindow S T rows left right a b M (fun d i => d ∈ K ∧ P d i) := by classical have hp (i : m) := originalColumnSum_divisor_rectangles K S T rows left right a b i hleft hright hS hT P (fun d i _ _ => ((Real.sqrt (M/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ)) apply (Finset.sum_le_sum (fun i _ => hp i)).trans_eq unfold largePrincipalWindow rw [Finset.sum_comm] apply Finset.sum_congr rfl intro D _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro E _ apply Finset.sum_congr rfl intro i _ by_cases hd : D*E ∈ K · by_cases hi : P (D*E) i · simp only [hd, hi, and_self, ite_true, map_mul, Nat.cast_mul] simp only [←Finset.sum_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (show 0 ≤ Real.sqrt (M/(Ideal.absNorm (rows i):ℝ))/ ((Ideal.absNorm D:ℝ)*(Ideal.absNorm E:ℝ)) by positivity)] ring · simp only [hd, hi, and_false, ite_true, ite_false] · simp only [hd, false_and, ite_false] omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in lemma principalDivisorCorrection_le_product (K : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (P : Ideal O → m → Prop) (hleft : ∀ j, left j ≠ 0) (hright : ∀ k, right k ≠ 0) (hK : ∀ j k d, d ∣ left j*right k → d ∈ K) : ‖principalDivisorCorrection rows left right a b M P‖ ≤ largePrincipalProductAt K rows left right a b M P := by classical let A : m → n → p → K → ℂ := fun i j k d => if P d.val i then if d.val ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * ((Real.sqrt (M/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d.val:ℝ):ℝ):ℂ) else 0 else 0 have he : principalDivisorCorrection rows left right a b M P = ∑ i, ∑ j, ∑ k, ∑ d : K, (UniqueFactorizationMonoid.moebius d.val : ℂ)*A i j k d := by unfold principalDivisorCorrection apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ rw [← divisorPool_filter K (left j*right k) (mul_ne_zero (hleft j) (hright k)) (hK j k), Finset.sum_filter, Finset.mul_sum] rw [Finset.sum_coe_sort K (fun d => (UniqueFactorizationMonoid.moebius d:ℂ)* (if P d i then if d ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * ((Real.sqrt (M/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0 else 0))] apply Finset.sum_congr rfl intro d _ by_cases hd : d ∣ left j*right k <;> by_cases hi : P d i <;> simp only [hd, hi, ite_true, ite_false, mul_zero] ; ring rw [he] apply (finite_principal_triangle (fun d : K => (UniqueFactorizationMonoid.moebius d.val:ℂ)) (fun d => QuadraticInitialBound.norm_ideal_moebius_le_one d.val) A).trans_eq unfold largePrincipalProductAt apply Finset.sum_congr rfl intro i _ rw [Finset.sum_coe_sort K (fun d => ‖∑ j, ∑ k, if P d i then if d ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * ((Real.sqrt (M/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0 else 0‖)] apply Finset.sum_congr rfl intro d _ by_cases hd : P d i <;> simp only [hd, ite_true, ite_false, Finset.sum_const_zero, norm_zero] theorem HasSieveExponent.principal_divisor_correction {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M V : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hV : 0 ≤ V) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (P : Ideal O → m → Prop) (hP : ∀ d i, P d i → Real.sqrt (M/B)*N ≤ (V/4)*(Ideal.absNorm d:ℝ)) : ‖principalDivisorCorrection rows left right a b M P‖ ≤ ((columnDyadicLength N+1:ℕ):ℝ)^2 * (2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (V+Real.sqrt M*B^(α-1/2))) := by let S := columnDivisorPool left let T := columnDivisorPool right let pairCols : n × p → Ideal O := fun x => left x.1*right x.2 let K := columnDivisorPool pairCols have hl0 : ∀ j, left j ≠ 0 := fun j => (hleft j).1.1 have hr0 : ∀ k, right k ≠ 0 := fun k => (hright k).1.1 have hp0 : ∀ x, pairCols x ≠ 0 := fun x => mul_ne_zero (hl0 x.1) (hr0 x.2) have hk : ∀ j k d, d ∣ left j*right k → d ∈ K := fun j k d hd => mem_columnDivisorPool_of_dvd pairCols hp0 (j,k) d hd calc _ ≤ largePrincipalProductAt K rows left right a b M P := principalDivisorCorrection_le_product K rows left right a b M P hl0 hr0 hk _ ≤ largePrincipalWindow S T rows left right a b M (fun d i => d ∈ K ∧ P d i) := largePrincipalProductAt_le_window K S T rows left right a b M P hl0 hr0 (mem_columnDivisorPool_of_dvd left hl0) (mem_columnDivisorPool_of_dvd right hr0) _ ≤ _ := hexp.large_principal_pool deltaLoss hδ ε hε S T B N M V hB hN hM hV (columnDivisorPool_norm_bounds left hl0 N (fun j => (hleft j).2)) (columnDivisorPool_norm_bounds right hr0 N (fun k => (hright k).2)) rows left right hr hl hri hrows hleft hright a b _ (fun D _ E _ i hp => hP (D*E) i hp.2) end CanonicalQuadraticSieve open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct aLabel b0Label jLabel cubeActiveSupport primeProductNorm) open ConcreteTraceCRT (eisEmbedding) structure CubeCoordinates (ι : Type*) where leftExponent : ι →₀ ℕ rightExponent : ι →₀ ℕ leftDivisor : Finset ι rightDivisor : Finset ι protected theorem CubeCoordinates.ext : ∀ {ι : Type*} {x y : CubeCoordinates ι}, ∀ (leftExponent : x.leftExponent = y.leftExponent) (rightExponent : x.rightExponent = y.rightExponent) (leftDivisor : x.leftDivisor = y.leftDivisor) (rightDivisor : x.rightDivisor = y.rightDivisor), x = y := fun {ι} {x} {h} => match x with | CubeCoordinates.mk leftExponent rightExponent leftDivisor rightDivisor => match h with | CubeCoordinates.mk leftExponent rightExponent leftDivisor rightDivisor => fun h0 h1 h2 h3 => by cases h0 cases h1 cases h2 cases h3 rfl namespace CubeCoordinates variable {ι : Type*} [DecidableEq ι] def support (x : CubeCoordinates ι) : Finset ι := x.leftExponent.support ∪ x.rightExponent.support def leftBit (x : CubeCoordinates ι) (i : ι) : Bool := decide (i ∈ x.leftDivisor) def rightBit (x : CubeCoordinates ι) (i : ι) : Bool := decide (i ∈ x.rightDivisor) def Admissible (x : CubeCoordinates ι) : Prop := x.leftDivisor ⊆ x.support ∧ x.rightDivisor ⊆ x.support theorem support_pos (x : CubeCoordinates ι) (i : ι) (hi : i ∈ x.support) : 0 < x.leftExponent i+x.rightExponent i := by simp only [support,Finset.mem_union,Finsupp.mem_support_iff] at hi omega theorem left_off (x : CubeCoordinates ι) (i : ι) (hi : i ∉ x.support) : x.leftExponent i=0 := by by_contra hv exact hi (Finset.mem_union_left _ (Finsupp.mem_support_iff.mpr hv)) theorem right_off (x : CubeCoordinates ι) (i : ι) (hi : i ∉ x.support) : x.rightExponent i=0 := by by_contra hv exact hi (Finset.mem_union_right _ (Finsupp.mem_support_iff.mpr hv)) theorem aLabel_left (p : ι → O) (x : CubeCoordinates ι) (hx : x.Admissible) : aLabel p x.support x.leftBit = ∏ i ∈ x.leftDivisor,p i := by simp only [aLabel,primeProduct,leftBit,FirstPassCubeLabels.bit,decide_eq_true_eq] simp_rw [apply_ite, pow_one, pow_zero] rw [← Finset.prod_filter] have he : x.support.filter (fun i => i ∈ x.leftDivisor)=x.leftDivisor := by ext i simp only [Finset.mem_filter] exact and_iff_right_of_imp (fun hi => hx.1 hi) rw [he] theorem aLabel_right (p : ι → O) (x : CubeCoordinates ι) (hx : x.Admissible) : aLabel p x.support x.rightBit = ∏ i ∈ x.rightDivisor,p i := by simp only [aLabel,primeProduct,rightBit,FirstPassCubeLabels.bit,decide_eq_true_eq] simp_rw [apply_ite, pow_one, pow_zero] rw [← Finset.prod_filter] have he : x.support.filter (fun i => i ∈ x.rightDivisor)=x.rightDivisor := by ext i simp only [Finset.mem_filter] exact and_iff_right_of_imp (fun hi => hx.2 hi) rw [he] end CubeCoordinates structure GlobalSecondData (ι : Type*) where cube : CubeCoordinates ι firstCommon : Finset ι common : Finset ι firstDivisor : Finset ι source : SecondExpansionData ι protected theorem GlobalSecondData.ext : ∀ {ι : Type*} {x y : GlobalSecondData ι}, ∀ (cube : x.cube = y.cube) (firstCommon : x.firstCommon = y.firstCommon) (common : x.common = y.common) (firstDivisor : x.firstDivisor = y.firstDivisor) (source : x.source = y.source), x = y := fun {ι} {x} {h} => match x with | GlobalSecondData.mk cube firstCommon common firstDivisor source => match h with | GlobalSecondData.mk cube firstCommon common firstDivisor source => fun h0 h1 h2 h3 h4 => by cases h0 cases h1 cases h2 cases h3 cases h4 rfl variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] def globalSecondTuple (x : GlobalSecondData ι) : SecondPassFiber.OldTuple := actualSecondTuple p x.cube.support x.common x.firstDivisor x.source.divisor x.source.overlap x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit x.source.frequency def globalSecondFixedTriple (x : GlobalSecondData ι) : Ideal O × Ideal O × Ideal O := (Ideal.span {(b0Label p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit)}, ∏ i ∈ x.firstCommon,Ideal.span {p i}, ∏ i ∈ x.source.sourceCommon\x.source.divisor,Ideal.span {p i}) def GlobalSecondAdmissible (x : GlobalSecondData ι) : Prop := x.cube.Admissible ∧ x.source.divisor ⊆ x.source.sourceCommon ∧ Disjoint x.common x.cube.support ∧ x.firstDivisor ⊆ x.common∪x.cube.support omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalSecondTuple_valid (x : GlobalSecondData ι) (hx : GlobalSecondAdmissible x) : SecondPassFiber.Valid (globalSecondTuple p x) (SecondPassFiber.newLabel (globalSecondTuple p x)) (globalSecondFixedTriple p x).1 (SecondPassFiber.newRow (globalSecondTuple p x)) := actualSecondTuple_valid p x.cube.support x.common x.firstDivisor x.source.divisor x.source.overlap hx.2.2.1 hx.2.2.2 x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit x.cube.support_pos x.source.frequency theorem globalSecondFixedTriple_nonzero (hp : ∀ i,p i ≠ 0) (x : GlobalSecondData ι) : (globalSecondFixedTriple p x).1 ≠ ⊥ ∧ (globalSecondFixedTriple p x).2.1 ≠ ⊥ ∧ (globalSecondFixedTriple p x).2.2 ≠ ⊥ := by refine ⟨sector_b0_ne_bot p hp _ _ _ _ _,?_,?_⟩ <;> exact Finset.prod_ne_zero_iff.mpr (fun i hi => NeZero.ne (Ideal.span {p i})) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalSecondFixedTriple_norm_bounds (hp : ∀ i,p i ≠ 0) (x : GlobalSecondData ι) (B H J T R : ℝ) (hB : 0 ≤ B) (hJ : 0 < J) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) (hactive : ‖eisEmbedding (∏ i ∈ cubeActiveSupport x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit,p i)‖ ≤ H) (hlabel : J ≤ ‖eisEmbedding (jLabel p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit)‖^2) (ht : primeProductNorm p x.firstCommon ≤ T) (hr : primeProductNorm p (x.source.sourceCommon\x.source.divisor) ≤ R) : (Ideal.absNorm (globalSecondFixedTriple p x).1 : ℝ) ≤ B*H/J ∧ (Ideal.absNorm (globalSecondFixedTriple p x).2.1 : ℝ) ≤ T ∧ (Ideal.absNorm (globalSecondFixedTriple p x).2.2 : ℝ) ≤ R := by obtain ⟨_,_,hb0⟩ := cube_label_norm_bounds p hp x.cube.support x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit x.cube.support_pos B hB hb₁ hb₂ refine ⟨?_,?_,?_⟩ · change (Ideal.absNorm (Ideal.span {_}) : ℝ) ≤ _ rw [← eisEmbedding_norm_sq_eq_absNorm_span] apply hb0.trans exact div_le_div₀ (mul_nonneg hB ((norm_nonneg _).trans hactive)) (mul_le_mul_of_nonneg_left hactive hB) hJ hlabel · exact (primeProductNorm_eq_ideal_norm p _).symm ▸ ht · exact (primeProductNorm_eq_ideal_norm p _).symm ▸ hr theorem globalSecondFixedTriple_count (hp : ∀ i,p i ≠ 0) (s : Finset (GlobalSecondData ι)) (B H J T R : ℝ) (hB : 0 ≤ B) (hJ : 0 < J) (hscale : 1 ≤ B*H/J) (hT : 1 ≤ T) (hR : 1 ≤ R) (hb₁ : ∀ x∈s, ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ∀ x∈s, ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) (hactive : ∀ x∈s, ‖eisEmbedding (∏ i ∈ cubeActiveSupport x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit,p i)‖ ≤ H) (hlabel : ∀ x∈s, J ≤ ‖eisEmbedding (jLabel p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit)‖^2) (ht : ∀ x∈s, primeProductNorm p x.firstCommon ≤ T) (hr : ∀ x∈s, primeProductNorm p (x.source.sourceCommon\x.source.divisor) ≤ R) : ((s.image (globalSecondFixedTriple p)).card : ℝ) ≤ 128^3*(B*H/J)*T*R := by apply DescentFiberCost.fixed_triple_count _ _ _ _ hscale hT hR · intro q hq obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hq exact globalSecondFixedTriple_nonzero p hp x · intro q hq obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hq exact globalSecondFixedTriple_norm_bounds p hp x B H J T R hB hJ (hb₁ x hx) (hb₂ x hx) (hactive x hx) (hlabel x hx) (ht x hx) (hr x hx) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem sum_globalSecondFixedTriple {M : Type*} [AddCommMonoid M] (s : Finset (GlobalSecondData ι)) (f : GlobalSecondData ι → M) : ∑ x∈s,f x = ∑ q∈s.image (globalSecondFixedTriple p), ∑ x∈s with globalSecondFixedTriple p x=q,f x := by symm exact Finset.sum_fiberwise_of_maps_to (fun x hx => Finset.mem_image.mpr ⟨x,hx,rfl⟩) f end open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct aLabel) variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i,(Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) include hinj theorem globalSecondTuple_cube_eq {x y : GlobalSecondData ι} (hx : x.cube.Admissible) (hy : y.cube.Admissible) (h : globalSecondTuple p x=globalSecondTuple p y) : x.cube=y.cube := by have h₁ := congrArg (fun z : SecondPassFiber.OldTuple => z.core 4) h have h₂ := congrArg SecondPassFiber.OldTuple.b2 h have hA₁ := congrArg (fun z : SecondPassFiber.OldTuple => z.core 5) h have hA₂ := congrArg (fun z : SecondPassFiber.OldTuple => z.core 6) h change Ideal.span {primeProduct p x.cube.support x.cube.leftExponent} = Ideal.span {primeProduct p y.cube.support y.cube.leftExponent} at h₁ change Ideal.span {primeProduct p x.cube.support x.cube.rightExponent} = Ideal.span {primeProduct p y.cube.support y.cube.rightExponent} at h₂ have hv₁ := primeProduct_span_exponents_eq p hinj x.cube.support y.cube.support x.cube.leftExponent y.cube.leftExponent x.cube.left_off y.cube.left_off h₁ have hv₂ := primeProduct_span_exponents_eq p hinj x.cube.support y.cube.support x.cube.rightExponent y.cube.rightExponent x.cube.right_off y.cube.right_off h₂ change Ideal.span {aLabel p x.cube.support x.cube.leftBit} = Ideal.span {aLabel p y.cube.support y.cube.leftBit} at hA₁ change Ideal.span {aLabel p x.cube.support x.cube.rightBit} = Ideal.span {aLabel p y.cube.support y.cube.rightBit} at hA₂ rw [CubeCoordinates.aLabel_left p x.cube hx,CubeCoordinates.aLabel_left p y.cube hy, FiniteGaussPhase.span_finset_prod,FiniteGaussPhase.span_finset_prod] at hA₁ rw [CubeCoordinates.aLabel_right p x.cube hx,CubeCoordinates.aLabel_right p y.cube hy, FiniteGaussPhase.span_finset_prod,FiniteGaussPhase.span_finset_prod] at hA₂ apply CubeCoordinates.ext · exact Finsupp.ext (congrFun hv₁) · exact Finsupp.ext (congrFun hv₂) · exact FirstCauchyArithmetic.family_product_injective _ hinj hA₁ · exact FirstCauchyArithmetic.family_product_injective _ hinj hA₂ theorem globalSecondEncoding_injective {x y : GlobalSecondData ι} (hx : GlobalSecondAdmissible x) (hy : GlobalSecondAdmissible y) (ht : globalSecondFixedTriple p x=globalSecondFixedTriple p y) (h : globalSecondTuple p x=globalSecondTuple p y) : x=y := by have hc := globalSecondTuple_cube_eq p hinj hx.1 hy.1 h have hA := congrArg (fun q : Ideal O × Ideal O × Ideal O => q.2.1) ht have hR := congrArg (fun q : Ideal O × Ideal O × Ideal O => q.2.2) ht have hC := congrArg (fun z : SecondPassFiber.OldTuple => z.core 1) h have hD := congrArg (fun z : SecondPassFiber.OldTuple => z.core 7) h have hE := congrArg (fun z : SecondPassFiber.OldTuple => z.core 2) h have hV := congrArg SecondPassFiber.OldTuple.v h have hk := congrArg SecondPassFiber.OldTuple.row h have hA' : x.firstCommon=y.firstCommon := FirstCauchyArithmetic.family_product_injective _ hinj hA have hC' : x.common=y.common := FirstCauchyArithmetic.family_product_injective _ hinj hC have hD' : x.firstDivisor=y.firstDivisor := FirstCauchyArithmetic.family_product_injective _ hinj hD have hE' : x.source.divisor=y.source.divisor := FirstCauchyArithmetic.family_product_injective _ hinj hE have hV' : x.source.overlap=y.source.overlap := FirstCauchyArithmetic.family_product_injective _ hinj hV have hR' : x.source.sourceCommon\x.source.divisor=y.source.sourceCommon\y.source.divisor := FirstCauchyArithmetic.family_product_injective _ hinj hR have hG : x.source.sourceCommon=y.source.sourceCommon := by calc _ = x.source.divisor ∪ (x.source.sourceCommon\x.source.divisor) := (Finset.union_sdiff_of_subset hx.2.1).symm _ = y.source.divisor ∪ (y.source.sourceCommon\y.source.divisor) := by rw [hR',hE'] _ = _ := Finset.union_sdiff_of_subset hy.2.1 exact GlobalSecondData.ext hc hA' hC' hD' (SecondExpansionData.ext hG hE' hV' hk) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.PrincipalNormalization namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open SecondPassFiber (newLabel newRow) open ConcretePrimeRowBridge (idealGenerator) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalSecondLabel (x : GlobalSecondData ι) : O := secondSupportLabel p x.cube.support x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit (expansionSupportData x.common x.firstDivisor x.source) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalSecondLabel_span (x : GlobalSecondData ι) : Ideal.span {globalSecondLabel p x}=newLabel (globalSecondTuple p x) := actualSecondLabel_span p x.cube.support x.common x.source.divisor x.source.overlap x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm b0Label jLabel cubeRadical) open ConcretePrimeRowBridge (idealGenerator span_idealGenerator) open SecondPassFiber (newLabel newRow) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem rowCoprimeMask_congr_span (S : Finset ι) {a b : O} (h : Ideal.span {a}=Ideal.span {b}) : rowCoprimeMask (fun i => Ideal.span {p i}) S a = rowCoprimeMask (fun i => Ideal.span {p i}) S b := by have hm (i : ι) : a ∈ Ideal.span {p i} ↔ b ∈ Ideal.span {p i} := by rw [← Ideal.span_singleton_le_iff_mem, h, Ideal.span_singleton_le_iff_mem] simp only [rowCoprimeMask,hm] theorem fixedChildRow_congr_mask_span (F : Finset ι) (Ψ : O →* ℂ) {a b : O} (h : Ideal.span {a}=Ideal.span {b}) (H : Finset ι → ℂ) (f y : O) : fixedChildRow p hp hcop hg F Ψ a H f y = fixedChildRow p hp hcop hg F Ψ b H f y := by simp only [fixedChildRow,secondChildColumn,rowCoprimeMask_congr_span p _ h] theorem secondChildColumn_zero_of_mask_label_mem (Ψ : O →* ℂ) (m f y : O) (H : Finset ι → ℂ) (S : Finset ι) (i : ι) (hi : i ∈ S) (hmf : m*f ∈ Ideal.span {p i}) : secondChildColumn p hp hcop hg Ψ m f y H S = 0 := by rcases (inferInstance : (Ideal.span {p i}).IsPrime).mem_or_mem hmf with hm|hf · have hz : rowCoprimeMask (fun i => Ideal.span {p i}) S m=0 := by simp only [rowCoprimeMask,if_pos (show ∃ i∈S,m ∈ Ideal.span {p i} from ⟨i,hi,hm⟩)] simp only [secondChildColumn,hz,mul_zero,zero_mul] · have hz : rowCoprimeMask (fun i => Ideal.span {p i}) S f=0 := by simp only [rowCoprimeMask,if_pos (show ∃ i∈S,f ∈ Ideal.span {p i} from ⟨i,hi,hf⟩)] have hr := FirstPassCubeLabels.row_zero_of_mask_zero (fun i => Ideal.span {p i}) hg S f hz simp only [secondChildColumn,hr,zero_pow (by decide : (4 : ℕ) ≠ 0),mul_zero,zero_mul] theorem fixedChildRow_restore_killed_pool (F B : Finset ι) (Ψ : O →* ℂ) (m f y : O) (H : Finset ι → ℂ) (hB : ∀ i∈B,m*f ∈ Ideal.span {p i}) : fixedChildRow p hp hcop hg (F\B) Ψ m H f y = fixedChildRow p hp hcop hg F Ψ m H f y := by unfold fixedChildRow apply Finset.sum_subset (Finset.powerset_mono.mpr Finset.sdiff_subset) intro S hS hn have hd : ¬ Disjoint B S := by intro hd apply hn apply Finset.mem_powerset.mpr intro i hi exact Finset.mem_sdiff.mpr ⟨(Finset.mem_powerset.mp hS) hi, fun hiB => Finset.disjoint_left.mp hd hiB hi⟩ obtain ⟨i,hiB,hiS⟩ := Finset.not_disjoint_iff.mp hd exact secondChildColumn_zero_of_mask_label_mem p hp hcop hg Ψ m f y H S i hiS (hB i hiB) def globalSecondMask (m : O) (x : GlobalSecondData ι) : O := (m*b0Label p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit * primeSubsetGenerator (fun i => Ideal.span {p i}) (x.source.sourceCommon\x.source.divisor)) * ∏ i∈x.firstCommon,p i def fixedTripleMask (m : O) (q : Ideal O × Ideal O × Ideal O) : O := m*idealGenerator q.1*idealGenerator q.2.1*idealGenerator q.2.2 omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalSecondMask_span (m : O) (x : GlobalSecondData ι) : Ideal.span {globalSecondMask p m x}=Ideal.span {fixedTripleMask m (globalSecondFixedTriple p x)} := by simp only [globalSecondMask,fixedTripleMask,globalSecondFixedTriple, ← Ideal.span_singleton_mul_span_singleton,span_idealGenerator, primeSubsetGenerator,FiniteGaussPhase.span_finset_prod] ring omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalSecondMask_kills_cube_common (m : O) (x : GlobalSecondData ι) : ∀ i∈x.cube.support∪x.common,globalSecondMask p m x*globalSecondLabel p x ∈ Ideal.span {p i} := by intro i hi let J := jLabel p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit let b0 := b0Label p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit rcases Finset.mem_union.mp hi with hi|hi · have hd : p i ∣ J*b0 := (Finset.dvd_prod_of_mem p hi).trans (cubeRadical_dvd_jLabel_b0 p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit x.cube.support_pos) have he : globalSecondMask p m x*globalSecondLabel p x = (J*b0)*(m*primeSubsetGenerator (fun i => Ideal.span {p i}) (x.source.sourceCommon\x.source.divisor)* (∏ i∈x.firstCommon,p i)*primeSubsetGenerator (fun i => Ideal.span {p i}) x.common* primeSubsetGenerator (fun i => Ideal.span {p i}) x.source.divisor*(∏ i∈x.source.overlap,p i)) := by simp only [globalSecondMask,globalSecondLabel,secondSupportLabel,expansionSupportData,J,b0] ring rw [he] exact Ideal.mem_span_singleton.mpr (dvd_mul_of_dvd_left hd _) · have hC : primeSubsetGenerator (fun i => Ideal.span {p i}) x.common ∈ Ideal.span {p i} := by have hs : Ideal.span {primeSubsetGenerator (fun i => Ideal.span {p i}) x.common} ≤ Ideal.span {p i} := by rw [primeSubsetGenerator,span_idealGenerator] exact Ideal.le_of_dvd (Finset.dvd_prod_of_mem (fun i => Ideal.span {p i}) hi) exact hs (Ideal.subset_span (Set.mem_singleton _)) have hlabel : globalSecondLabel p x ∈ Ideal.span {p i} := by apply Ideal.mul_mem_right apply Ideal.mul_mem_right apply Ideal.mul_mem_right exact hC exact Ideal.mul_mem_left _ _ hlabel theorem globalSecondRawRow_fixed_pool (hinj : Function.Injective (fun i => Ideal.span {p i})) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (x : GlobalSecondData ι) (y : O) : fixedChildRow p hp hcop hg ((F\(x.cube.support∪x.common))\x.firstCommon) Ψ (m*b0Label p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit * primeSubsetGenerator (fun i => Ideal.span {p i}) (x.source.sourceCommon\x.source.divisor)) H (globalSecondLabel p x) y = fixedChildRow p hp hcop hg F Ψ (fixedTripleMask m (globalSecondFixedTriple p x)) H (globalSecondLabel p x) y := by rw [fixedChildRow_fixed_pool p hp hcop hg hinj] change fixedChildRow p hp hcop hg (F\(x.cube.support∪x.common)) Ψ (globalSecondMask p m x) H (globalSecondLabel p x) y = _ rw [fixedChildRow_restore_killed_pool p hp hcop hg F (x.cube.support∪x.common) Ψ (globalSecondMask p m x) (globalSecondLabel p x) y H (globalSecondMask_kills_cube_common p m x)] exact fixedChildRow_congr_mask_span p hp hcop hg F Ψ (globalSecondMask_span p m x) H _ _ end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def signedProductDivisorSum (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (P : Ideal O → m → Prop) (H : Ideal O → m → n → p → ℂ) : ℂ := by classical exact ∑ i, ∑ j, ∑ k, originalTerm rows left right a b 1 1 i j k * ∑ d ∈ idealDivisors (left j*right k), if P d i then (UniqueFactorizationMonoid.moebius d : ℂ)*H d i j k else 0 def correctionRectangleMajorant (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (P : Ideal O → m → Prop) (H : Ideal O → m → n → p → ℂ) : ℝ := by classical exact ∑ D ∈ S, ∑ E ∈ T, ∑ i, if P (D*E) i then ‖∑ j, ∑ k, originalTerm rows left right a b D E i j k * H (D*E) i j k‖ else 0 omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem signedProductDivisorSum_le_rectangles (S T : Finset (Ideal O)) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (P : Ideal O → m → Prop) (H : Ideal O → m → n → p → ℂ) (hleft : ∀ j, left j ≠ 0) (hright : ∀ k, right k ≠ 0) (hS : ∀ j D, D ∣ left j → D ∈ S) (hT : ∀ k E, E ∣ right k → E ∈ T) : ‖signedProductDivisorSum rows left right a b P H‖ ≤ correctionRectangleMajorant S T rows left right a b P H := by classical let pairCols : n × p → Ideal O := fun x => left x.1*right x.2 let K := columnDivisorPool pairCols have hpair : ∀ x, pairCols x ≠ 0 := fun x => mul_ne_zero (hleft x.1) (hright x.2) have hK : ∀ j k d, d ∣ left j*right k → d ∈ K := fun j k d hd => mem_columnDivisorPool_of_dvd pairCols hpair (j,k) d hd let A : m → n → p → K → ℂ := fun i j k d => if P d.val i then if d.val ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * H d.val i j k else 0 else 0 have he : signedProductDivisorSum rows left right a b P H = ∑ i, ∑ j, ∑ k, ∑ d : K, (UniqueFactorizationMonoid.moebius d.val:ℂ)*A i j k d := by unfold signedProductDivisorSum apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ rw [← divisorPool_filter K (left j*right k) (mul_ne_zero (hleft j) (hright k)) (hK j k), Finset.sum_filter, Finset.mul_sum] rw [Finset.sum_coe_sort K (fun d => (UniqueFactorizationMonoid.moebius d:ℂ)* (if P d i then if d ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * H d i j k else 0 else 0))] apply Finset.sum_congr rfl intro d _ by_cases hd : d ∣ left j*right k <;> by_cases hi : P d i <;> simp only [hd, hi, ite_true, ite_false, mul_zero] ; ring rw [he] apply (finite_principal_triangle (fun d : K => (UniqueFactorizationMonoid.moebius d.val:ℂ)) (fun d => QuadraticInitialBound.norm_ideal_moebius_le_one d.val) A).trans have hp (i : m) := originalColumnSum_divisor_rectangles K S T rows left right a b i hleft hright hS hT P H have hi (i : m) : (∑ d : K, ‖∑ j, ∑ k, A i j k d‖) = ∑ d ∈ K, if P d i then ‖∑ j, ∑ k, if d ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * H d i j k else 0‖ else 0 := by rw [Finset.sum_coe_sort K (fun d => ‖∑ j, ∑ k, if P d i then if d ∣ left j*right k then originalTerm rows left right a b 1 1 i j k * H d i j k else 0 else 0‖)] apply Finset.sum_congr rfl intro d _ by_cases hd : P d i <;> simp only [hd, ite_true, ite_false, Finset.sum_const_zero, norm_zero] simp_rw [hi] apply (Finset.sum_le_sum (fun i _ => hp i)).trans unfold correctionRectangleMajorant rw [Finset.sum_comm] apply Finset.sum_le_sum intro D _ rw [Finset.sum_comm] apply Finset.sum_le_sum intro E _ apply Finset.sum_le_sum intro i _ by_cases hd : D*E ∈ K · simp only [hd, ite_true] exact le_rfl · simp only [hd, ite_false] positivity theorem HasSieveExponent.small_principal_window {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (S T : Finset (Ideal O)) (D₁ D₂ B N M F U : ℝ) (hD₁ : 1 ≤ D₁) (hD₂ : 1 ≤ D₂) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hU : 0 ≤ U) (hD₁N : D₁ ≤ N) (hD₂N : D₂ ≤ N) (hS : ∀ D ∈ S, D₁ ≤ (Ideal.absNorm D:ℝ) ∧ (Ideal.absNorm D:ℝ) ≤ 2*D₁) (hT : ∀ E ∈ T, D₂ ≤ (Ideal.absNorm E:ℝ) ∧ (Ideal.absNorm E:ℝ) ≤ 2*D₂) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ N/2 ≤ (Ideal.absNorm (left j):ℝ) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N/2 ≤ (Ideal.absNorm (right k):ℝ) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (P : Ideal O → m → Prop) (hP : ∀ D ∈ S, ∀ E ∈ T, ∀ i, P (D*E) i → (Ideal.absNorm (D*E):ℝ) ≤ U*(N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ))))) : correctionRectangleMajorant S T rows left right a b P (fun _ _ j k => ((M/(Real.sqrt ((Ideal.absNorm (left j):ℝ)*(Ideal.absNorm (right k):ℝ))*F):ℝ):ℂ)) ≤ 2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (M/F+(2*U)*Real.sqrt (M/F)*B^(α-1/2)) := by classical by_cases hc : D₁*D₂ ≤ (2*U)*(N*Real.sqrt (F/(M*B))) · apply le_trans (b := smallPrincipalCorrection S T rows left right a b M F) · unfold correctionRectangleMajorant smallPrincipalCorrection apply Finset.sum_le_sum intro D _ apply Finset.sum_le_sum intro E _ apply Finset.sum_le_sum intro i _ split_ifs <;> first | exact le_rfl | positivity · exact hexp.small_principal_correction deltaLoss hδ ε hε S T D₁ D₂ B N M F (2*U) hD₁ hD₂ hB hN hM hF hD₁N hD₂N hS hT rows left right hr hl hri (fun i => ⟨(hrows i).1,(hrows i).2.2⟩) hleft hright a b hc · have hz : correctionRectangleMajorant S T rows left right a b P (fun _ _ j k => ((M/(Real.sqrt ((Ideal.absNorm (left j):ℝ)*(Ideal.absNorm (right k):ℝ))*F):ℝ):ℂ)) = 0 := by unfold correctionRectangleMajorant apply Finset.sum_eq_zero intro D hD apply Finset.sum_eq_zero intro E hE apply Finset.sum_eq_zero intro i _ have hn : ¬P (D*E) i := by intro hp apply hc apply dual_middle_rectangle_upper M F B (Ideal.absNorm (rows i)) N D₁ D₂ (Ideal.absNorm D) (Ideal.absNorm E) U hM hF (by linarith) (hrows i).2.1 (by linarith) hU (by linarith) (by linarith) (hS D hD).1 (hT E hE).1 simpa only [map_mul,Nat.cast_mul] using hP D hD E hE i hp simp only [hn,ite_false] rw [hz] have he := divisorEnergyFactor_nonneg ε hε N a b have hd := (divisorExponentConstant_pos hexp deltaLoss hδ).le positivity theorem HasSieveExponent.small_principal_divisor_sum {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hU : 0 ≤ U) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ N/2 ≤ (Ideal.absNorm (left j):ℝ) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N/2 ≤ (Ideal.absNorm (right k):ℝ) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (P : Ideal O → m → Prop) (hP : ∀ d i, P d i → (Ideal.absNorm d:ℝ) ≤ U*(N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ))))) : ‖signedProductDivisorSum rows left right a b P (fun _ _ j k => ((M/(Real.sqrt ((Ideal.absNorm (left j):ℝ)*(Ideal.absNorm (right k):ℝ))*F):ℝ):ℂ))‖ ≤ ((columnDyadicLength N+1:ℕ):ℝ)^2 * (2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (M/F+(2*U)*Real.sqrt (M/F)*B^(α-1/2))) := by classical let S := columnDivisorPool left let T := columnDivisorPool right have hl0 : ∀ j, left j ≠ 0 := fun j => (hleft j).1.1 have hr0 : ∀ k, right k ≠ 0 := fun k => (hright k).1.1 have hS := columnDivisorPool_norm_bounds left hl0 N (fun j => (hleft j).2.2) have hT := columnDivisorPool_norm_bounds right hr0 N (fun k => (hright k).2.2) apply (signedProductDivisorSum_le_rectangles S T rows left right a b P _ hl0 hr0 (mem_columnDivisorPool_of_dvd left hl0) (mem_columnDivisorPool_of_dvd right hr0)).trans apply divisor_dyadic_sum_le S T N _ _ · have he := divisorEnergyFactor_nonneg ε hε N a b have hd := (divisorExponentConstant_pos hexp deltaLoss hδ).le positivity · intro j k hj hk exact hexp.small_principal_window deltaLoss hδ ε hε (divisorDyadicBin S N j) (divisorDyadicBin T N k) (divisorDyadicScale j.val) (divisorDyadicScale k.val) B N M F U (divisorDyadicScale_ge_one _) (divisorDyadicScale_ge_one _) hB hN hM hF hU (divisorDyadicBin_scale_le S N hS j hj) (divisorDyadicBin_scale_le T N hT k hk) (divisorDyadicBin_bounds S N hS j) (divisorDyadicBin_bounds T N hT k) rows left right hr hl hri hrows hleft hright a b P (fun D _ E _ i hp => hP (D*E) i hp) end open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum lemma source_large_cut_lower (M B b N T d : ℝ) (hM : 0 < M) (_hB : 0 < B) (hb : 0 < b) (hbB : b ≤ B) (hN : 0 ≤ N) (hT : 0 < T) (hd : T*Real.sqrt (M/b) ≤ d) : Real.sqrt (M/B)*N ≤ ((4*N/T)/4)*d := by have hs : Real.sqrt (M/B) ≤ Real.sqrt (M/b) := Real.sqrt_le_sqrt (div_le_div_of_nonneg_left hM.le hb hbB) have hsd : Real.sqrt (M/B) ≤ d/T := (le_div_iff₀ hT).mpr (by nlinarith) calc _ ≤ (d/T)*N := mul_le_mul_of_nonneg_right hsd hN _ = _ := by ring lemma dual_large_cut_lower (M F B b N T d : ℝ) (hM : 0 < M) (hF : 0 < F) (hB : 0 < B) (hb : 0 < b) (hbB : b ≤ B) (hN : 0 < N) (hT : 0 < T) (hd : T*(N*Real.sqrt (F/(M*b))) ≤ d) : Real.sqrt ((M/F)/B)*N ≤ ((4*M/(F*T))/4)*d := by have hs : Real.sqrt (F/(M*B)) ≤ Real.sqrt (F/(M*b)) := Real.sqrt_le_sqrt (div_le_div_of_nonneg_left hF.le (by positivity) (mul_le_mul_of_nonneg_left hbB hM.le)) have hnd : N*Real.sqrt (F/(M*B)) ≤ d/T := by apply (le_div_iff₀ hT).mpr calc _ = T*(N*Real.sqrt (F/(M*B))) := by ring _ ≤ T*(N*Real.sqrt (F/(M*b))) := by gcongr _ ≤ d := hd rw [dual_middle_scale_identity M F B N hM hF hB hN] calc _ ≤ ((M/(F*N))*(d/T))*N := by gcongr _ = _ := by field_simp variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] theorem HasSieveExponent.source_large_principal_sum {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M T : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hT : 0 < T) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (Z : m → ℝ) (hZ : ∀ i, T*Real.sqrt (M/(Ideal.absNorm (rows i):ℝ)) ≤ Z i) : ‖principalDivisorCorrection rows left right a b M (fun d i => Z i < (Ideal.absNorm d:ℝ))‖ ≤ ((columnDyadicLength N+1:ℕ):ℝ)^2 * (2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (4*N/T+Real.sqrt M*B^(α-1/2))) := by apply hexp.principal_divisor_correction deltaLoss hδ ε hε B N M (4*N/T) hB hN hM (by positivity) rows left right hr hl hri hrows hleft hright a b intro d i hd exact source_large_cut_lower M B (Ideal.absNorm (rows i)) N T (Ideal.absNorm d) hM (by linarith) (by linarith [(hrows i).2.1]) (hrows i).2.2 (by linarith) hT ((hZ i).trans hd.le) theorem HasSieveExponent.dual_large_principal_sum {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F T : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hT : 0 < T) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (a : n → ℂ) (b : p → ℂ) (Z : m → ℝ) (hZ : ∀ i, T*(N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ)))) ≤ Z i) : ‖principalDivisorCorrection rows left right a b (M/F) (fun d i => Z i < (Ideal.absNorm d:ℝ))‖ ≤ ((columnDyadicLength N+1:ℕ):ℝ)^2 * (2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (4*M/(F*T)+Real.sqrt (M/F)*B^(α-1/2))) := by apply hexp.principal_divisor_correction deltaLoss hδ ε hε B N (M/F) (4*M/(F*T)) hB hN (by positivity) (by positivity) rows left right hr hl hri hrows hleft hright a b intro d i hd exact dual_large_cut_lower M F B (Ideal.absNorm (rows i)) N T (Ideal.absNorm d) hM hF (by linarith) (by linarith [(hrows i).2.1]) (hrows i).2.2 (by linarith) hT ((hZ i).trans hd.le) end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.PrincipalMajorants namespace OAI noncomputable section namespace CanonicalQuadraticSieve open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators section open scoped BigOperators Classical SchwartzMap section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson CompletedGauss open IdealMobiusDivisorSum def smallPrincipalMajorant {n p : Type} [Fintype n] [Fintype p] {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U : ℝ) (a : n → ℂ) (b : p → ℂ) : ℝ := ((columnDyadicLength N+1:ℕ):ℝ)^2 * (2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (M/F+(2*U)*Real.sqrt (M/F)*B^(α-1/2))) lemma smallPrincipalMajorant_nonneg {n p : Type} [Fintype n] [Fintype p] {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U : ℝ) (a : n → ℂ) (b : p → ℂ) (hB : 0 ≤ B) (hN : 0 ≤ N) (hM : 0 ≤ M) (hF : 0 ≤ F) (hU : 0 ≤ U) : 0 ≤ smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F U a b := by have he := divisorEnergyFactor_nonneg ε hε N a b have hc := (divisorExponentConstant_pos hexp deltaLoss hδ).le unfold smallPrincipalMajorant positivity lemma smallPrincipalMajorant_mono {n p : Type} [Fintype n] [Fintype p] {α : ℝ} (hexp : HasSieveExponent α) (hα : 1/2 ≤ α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B' B N M F U : ℝ) (a a' : n → ℂ) (b b' : p → ℂ) (hB' : 0 ≤ B') (hB : B' ≤ B) (hN : 0 ≤ N) (hM : 0 ≤ M) (hF : 0 ≤ F) (hU : 0 ≤ U) (ha : ∀ j, ‖a' j‖ ≤ ‖a j‖) (hb : ∀ k, ‖b' k‖ ≤ ‖b k‖) : smallPrincipalMajorant hexp deltaLoss hδ ε hε B' N M F U a' b' ≤ smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F U a b := by have he := divisorEnergyFactor_mono_coefficients ε hε N a a' b b' ha hb have he0 := divisorEnergyFactor_nonneg ε hε N a' b' have he1 := divisorEnergyFactor_nonneg ε hε N a b have hc := (divisorExponentConstant_pos hexp deltaLoss hδ).le have ha0 : 0 ≤ α-1/2 := by linarith have hB0 : 0 ≤ B := hB'.trans hB unfold smallPrincipalMajorant gcongr variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def unrestrictedSmallPrincipalSum (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (P : Ideal O → m → Prop) : ℂ := by classical exact ∑ i, ∑ j, ∑ k, unrestrictedPairTerm rows left right a b i j k * ∑ d ∈ idealDivisors (left j*right k), if P d i then (UniqueFactorizationMonoid.moebius d:ℂ)* ((M/(Real.sqrt ((Ideal.absNorm (left j):ℝ)*(Ideal.absNorm (right k):ℝ))*F):ℝ):ℂ) else 0 omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in lemma unrestrictedSmallPrincipalSum_sector (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (P : Ideal O → m → Prop) (hrows : ∀ i, Squarefree (rows i)) (hleft : ∀ j, Admissible (left j)) (hright : ∀ k, Admissible (right k)) (hray : ∀ j k, columnRay (left j) = columnRay (right k)) (E : fixedBadPrimes.powerset) (hE : ∀ i, badPrimeSector (rows i) = E) : unrestrictedSmallPrincipalSum rows left right a b M F P = signedProductDivisorSum (fun i => goodSquarefreePart (rows i)) left right (fun j => a j*quadraticRow (left j) (idealGenerator (sectorBadIdeal E))) (fun k => b k*quadraticRow (right k) (idealGenerator (sectorBadIdeal E))) P (fun _ _ j k => ((M/(Real.sqrt ((Ideal.absNorm (left j):ℝ)*(Ideal.absNorm (right k):ℝ))*F):ℝ):ℂ)) := by unfold unrestrictedSmallPrincipalSum signedProductDivisorSum apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ rw [unrestrictedPairTerm_sector rows left right a b hrows hleft hright hray E hE i j k] theorem HasSieveExponent.small_principal_sector {α : ℝ} (hexp : HasSieveExponent α) (hα : 1/2 ≤ α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hU : 0 ≤ U) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Squarefree (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ N/2 ≤ (Ideal.absNorm (left j):ℝ) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N/2 ≤ (Ideal.absNorm (right k):ℝ) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (hray : ∀ j k, columnRay (left j) = columnRay (right k)) (a : n → ℂ) (b : p → ℂ) (P : Ideal O → m → Prop) (hP : ∀ d i, P d i → (Ideal.absNorm d:ℝ) ≤ U*(N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ))))) (E : fixedBadPrimes.powerset) (hE : ∀ i, badPrimeSector (rows i) = E) : ‖unrestrictedSmallPrincipalSum rows left right a b M F P‖ ≤ smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F U a b := by classical cases isEmpty_or_nonempty m with | inl hempty => let := hempty simp only [unrestrictedSmallPrincipalSum, Finset.univ_eq_empty, Finset.sum_empty, norm_zero] exact smallPrincipalMajorant_nonneg hexp deltaLoss hδ ε hε B N M F U a b (by linarith) (by linarith) hM.le hF.le hU | inr hnonempty => let := hnonempty let i₀ : m := Classical.choice hnonempty let Q : ℝ := Ideal.absNorm (sectorBadIdeal E) let good := fun i => goodSquarefreePart (rows i) let a' := fun j => a j*quadraticRow (left j) (idealGenerator (sectorBadIdeal E)) let b' := fun k => b k*quadraticRow (right k) (idealGenerator (sectorBadIdeal E)) have hQnz := sectorBadIdeal_ne_zero_of_row (rows i₀) (hrows i₀).1 E (hE i₀) have hQ : 1 ≤ Q := by dsimp only [Q] exact_mod_cast (Nat.one_le_iff_ne_zero.mpr (fun h => hQnz (Ideal.absNorm_eq_zero_iff.mp h))) have hQp : 0 < Q := by linarith have hn (i : m) : (Ideal.absNorm (rows i):ℝ) = Q*(Ideal.absNorm (good i):ℝ) := by have hi := congrArg (fun I : Ideal O => (Ideal.absNorm I:ℝ)) (sector_bad_good_product (rows i) (hrows i).1 E (hE i)) simpa only [map_mul,Nat.cast_mul] using hi.symm have hgr : Function.Injective good := by intro i k h exact hr (goodSquarefreePart_injective_on_sector _ _ (hrows i).1 (hrows k).1 ((hE i).trans (hE k).symm) h) have hg (i : m) : Admissible (good i) ∧ (B/Q)/2 ≤ (Ideal.absNorm (good i):ℝ) ∧ (Ideal.absNorm (good i):ℝ) ≤ B/Q := by refine ⟨goodSquarefreePart_admissible _, ?_, ?_⟩ · rw [show B/Q/2 = (B/2)/Q by ring] apply (div_le_iff₀ hQp).2 have hx := (hrows i).2.1 rw [hn i] at hx nlinarith · exact (le_div_iff₀ hQp).2 (by simpa only [mul_comm] using (hn i).symm.trans_le (hrows i).2.2) have hBQ : 1 ≤ B/Q := by have hh : 1 ≤ (Ideal.absNorm (good i₀):ℝ) := by exact_mod_cast (Nat.one_le_iff_ne_zero.mpr (fun h => (hg i₀).1.1 (Ideal.absNorm_eq_zero_iff.mp h))) exact hh.trans (hg i₀).2.2 have hPg (d : Ideal O) (i : m) (hp : P d i) : (Ideal.absNorm d:ℝ) ≤ U*(N*Real.sqrt (F/(M*(Ideal.absNorm (good i):ℝ)))) := by apply (hP d i hp).trans have hgoodpos : 0 < (Ideal.absNorm (good i):ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun h => (hg i).1.1 (Ideal.absNorm_eq_zero_iff.mp h)) have hng : (Ideal.absNorm (good i):ℝ) ≤ (Ideal.absNorm (rows i):ℝ) := Nat.cast_le.mpr (goodSquarefreePart_norm_le (rows i) (hrows i).1) gcongr rw [unrestrictedSmallPrincipalSum_sector rows left right a b M F P (fun i => (hrows i).1) (fun j => (hleft j).1) (fun k => (hright k).1) hray E hE] have hbnd := hexp.small_principal_divisor_sum deltaLoss hδ ε hε (B/Q) N M F U hBQ hN hM hF hU good left right hgr hl hri hg hleft hright a' b' P hPg change ‖signedProductDivisorSum good left right a' b' P _‖ ≤ smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F U a b apply hbnd.trans apply smallPrincipalMajorant_mono hexp hα deltaLoss hδ ε hε (B/Q) B N M F U a a' b b' (by positivity) (div_le_self (by linarith) hQ) (by linarith) hM.le hF.le hU · intro j dsimp only [a']; rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (quadraticRow_norm_le_one _ _) · intro k dsimp only [b']; rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (quadraticRow_norm_le_one _ _) theorem HasSieveExponent.unrestricted_small_principal_sum {α : ℝ} (hexp : HasSieveExponent α) (hα : 1/2 ≤ α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hU : 0 ≤ U) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Squarefree (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ N/2 ≤ (Ideal.absNorm (left j):ℝ) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ N/2 ≤ (Ideal.absNorm (right k):ℝ) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (hray : ∀ j k, columnRay (left j) = columnRay (right k)) (a : n → ℂ) (b : p → ℂ) (P : Ideal O → m → Prop) (hP : ∀ d i, P d i → (Ideal.absNorm d:ℝ) ≤ U*(N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ))))) : ‖unrestrictedSmallPrincipalSum rows left right a b M F P‖ ≤ 4*smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F U a b := by classical let σ := fun i => badPrimeSector (rows i) have hs : unrestrictedSmallPrincipalSum rows left right a b M F P = ∑ E : fixedBadPrimes.powerset, unrestrictedSmallPrincipalSum (fun i : {i // σ i = E} => rows i.val) left right a b M F (fun d i => P d i.val) := by unfold unrestrictedSmallPrincipalSum exact (Fintype.sum_fiberwise σ _).symm have hb (E : fixedBadPrimes.powerset) : ‖unrestrictedSmallPrincipalSum (fun i : {i // σ i = E} => rows i.val) left right a b M F (fun d i => P d i.val)‖ ≤ smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F U a b := hexp.small_principal_sector hα deltaLoss hδ ε hε B N M F U hB hN hM hF hU (fun i : {i // σ i = E} => rows i.val) left right (fun i k h => Subtype.ext (hr h)) hl hri (fun i => hrows i.val) hleft hright hray a b (fun d i => P d i.val) (fun d i => hP d i.val) E (fun i => i.property) rw [hs] apply (norm_sum_le _ _).trans calc _ ≤ ∑ _E : fixedBadPrimes.powerset, smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F U a b := Finset.sum_le_sum (fun E _ => hb E) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, Fintype.card_coe, fixedBadPrimes_powerset_card] norm_num end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum theorem weightedDivisorCorrection_coprime_mask (G C : Ideal O) (hG : G ≠ 0) (hC : C ≠ 0) (hGC : IsCoprime G C) (X Z : ℝ) : (∑ d ∈ idealDivisors (G*C), if Z < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)*((X/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0) = ∑ q ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius q:ℂ)* ∑ d ∈ idealDivisors C, if Z/(Ideal.absNorm q:ℝ) < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)*(((X/(Ideal.absNorm q:ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0 := by classical rw [QuadraticDivisorSplit.sum_divisors_coprime_product G C hG hC hGC] apply Finset.sum_congr rfl intro q hq rw [Finset.mul_sum] apply Finset.sum_congr rfl intro d hd have hqG := (mem_idealDivisors hG).mp hq have hdC := (mem_idealDivisors hC).mp hd have hq0 : q ≠ 0 := by intro he; rw [he,zero_dvd_iff] at hqG; exact hG hqG have hNq : 0 < (Ideal.absNorm q:ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun he => hq0 (Ideal.absNorm_eq_zero_iff.mp he)) have hlow : Z < (Ideal.absNorm q:ℝ)*(Ideal.absNorm d:ℝ) ↔ Z/(Ideal.absNorm q:ℝ) < (Ideal.absNorm d:ℝ) := by constructor · intro hz apply (div_lt_iff₀ hNq).mpr simpa only [mul_comm] using hz · intro hz simpa only [mul_comm] using (div_lt_iff₀ hNq).mp hz simp only [map_mul,Nat.cast_mul,hlow,(hGC.mono hqG hdC).isRelPrime.moebius_mul,Int.cast_mul] by_cases hp : Z/(Ideal.absNorm q:ℝ) < (Ideal.absNorm d:ℝ) · simp only [hp,ite_true] push_cast ring · simp only [hp,ite_false,mul_zero] variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def maskedPrincipalDivisorCorrection (G : Ideal O) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (Z : m → ℝ) : ℂ := by classical exact ∑ i, ∑ j, ∑ k, originalTerm rows left right a b 1 1 i j k * ∑ d ∈ idealDivisors (G*(left j*right k)), if Z i < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)* ((Real.sqrt (M/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0 omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem maskedPrincipalDivisorCorrection_eq (G : Ideal O) (hG : G ≠ 0) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M : ℝ) (hM : 0 ≤ M) (Z : m → ℝ) (hleft : ∀ j, left j ≠ 0) (hright : ∀ k, right k ≠ 0) (hGl : ∀ j, IsCoprime G (left j)) (hGr : ∀ k, IsCoprime G (right k)) : maskedPrincipalDivisorCorrection G rows left right a b M Z = ∑ q ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius q:ℂ)* principalDivisorCorrection rows left right a b (M/(Ideal.absNorm q:ℝ)^2) (fun d i => Z i/(Ideal.absNorm q:ℝ) < (Ideal.absNorm d:ℝ)) := by classical have ht (i : m) (j : n) (k : p) : (∑ d ∈ idealDivisors (G*(left j*right k)), if Z i < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)* ((Real.sqrt (M/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0) = ∑ q ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius q:ℂ)* ∑ d ∈ idealDivisors (left j*right k), if Z i/(Ideal.absNorm q:ℝ) < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)* ((Real.sqrt ((M/(Ideal.absNorm q:ℝ)^2)/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0 := by rw [weightedDivisorCorrection_coprime_mask G _ hG (mul_ne_zero (hleft j) (hright k)) ((hGl j).mul_right (hGr k))] apply Finset.sum_congr rfl intro q hq have hqG := (mem_idealDivisors hG).mp hq have hq0 : q ≠ 0 := by intro he; rw [he,zero_dvd_iff] at hqG; exact hG hqG have hNq : 0 < (Ideal.absNorm q:ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun he => hq0 (Ideal.absNorm_eq_zero_iff.mp he)) rw [sqrt_norm_divisor_scale M _ _ hM (Nat.cast_nonneg _) hNq] unfold maskedPrincipalDivisorCorrection simp_rw [ht,Finset.mul_sum] simp_rw [Finset.sum_comm (s := (Finset.univ:Finset p)) (t := idealDivisors G), Finset.sum_comm (s := (Finset.univ:Finset n)) (t := idealDivisors G), Finset.sum_comm (s := (Finset.univ:Finset m)) (t := idealDivisors G)] simp only [principalDivisorCorrection,Finset.mul_sum] apply Finset.sum_congr rfl intro q _ apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ ring_nf theorem HasSieveExponent.masked_source_large_principal_sum {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (G : Ideal O) (hG : G ≠ 0) (B N M T : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hT : 0 < T) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Admissible (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (hGl : ∀ j, IsCoprime G (left j)) (hGr : ∀ k, IsCoprime G (right k)) (a : n → ℂ) (b : p → ℂ) (Z : m → ℝ) (hZ : ∀ i, T*Real.sqrt (M/(Ideal.absNorm (rows i):ℝ)) ≤ Z i) : ‖maskedPrincipalDivisorCorrection G rows left right a b M Z‖ ≤ (idealDivisors G).card * (((columnDyadicLength N+1:ℕ):ℝ)^2 * (2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (4*N/T+Real.sqrt M*B^(α-1/2)))) := by classical let V := ((columnDyadicLength N+1:ℕ):ℝ)^2 * (2*divisorEnergyFactor ε hε N a b*(divisorExponentConstant hexp deltaLoss hδ*(B*N)^deltaLoss)* (4*N/T+Real.sqrt M*B^(α-1/2))) have hqbound (q : Ideal O) (hq : q ∈ idealDivisors G) : ‖principalDivisorCorrection rows left right a b (M/(Ideal.absNorm q:ℝ)^2) (fun d i => Z i/(Ideal.absNorm q:ℝ) < (Ideal.absNorm d:ℝ))‖ ≤ V := by have hqG := (mem_idealDivisors hG).mp hq have hq0 : q ≠ 0 := by intro he; rw [he,zero_dvd_iff] at hqG; exact hG hqG have hq1 : 1 ≤ (Ideal.absNorm q:ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun he => hq0 (Ideal.absNorm_eq_zero_iff.mp he)) have hqpos : 0 < (Ideal.absNorm q:ℝ) := by linarith have hZq (i : m) : T*Real.sqrt ((M/(Ideal.absNorm q:ℝ)^2)/(Ideal.absNorm (rows i):ℝ)) ≤ Z i/(Ideal.absNorm q:ℝ) := by rw [←sqrt_norm_divisor_scale M _ _ hM.le (Nat.cast_nonneg _) hqpos] calc _ = (T*Real.sqrt (M/(Ideal.absNorm (rows i):ℝ)))/(Ideal.absNorm q:ℝ) := by ring _ ≤ _ := div_le_div_of_nonneg_right (hZ i) hqpos.le apply (hexp.source_large_principal_sum deltaLoss hδ ε hε B N (M/(Ideal.absNorm q:ℝ)^2) T hB hN (by positivity) hT rows left right hr hl hri hrows hleft hright a b (fun i => Z i/(Ideal.absNorm q:ℝ)) hZq).trans have he := divisorEnergyFactor_nonneg ε hε N a b have hc := (divisorExponentConstant_pos hexp deltaLoss hδ).le dsimp only [V] gcongr exact div_le_self hM.le (one_le_pow₀ hq1) rw [maskedPrincipalDivisorCorrection_eq G hG rows left right a b M hM.le Z (fun j => (hleft j).1.1) (fun k => (hright k).1.1) hGl hGr] apply (norm_sum_le _ _).trans calc _ ≤ ∑ q ∈ idealDivisors G, V := by apply Finset.sum_le_sum intro q hq rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (QuadraticInitialBound.norm_ideal_moebius_le_one q)).trans (hqbound q hq) _ = _ := by simp only [Finset.sum_const,nsmul_eq_mul,V] end open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson CompletedGauss open IdealMobiusDivisorSum lemma smallPrincipalMajorant_bad_scale {n p : Type} [Fintype n] [Fintype p] {α : ℝ} (hexp : HasSieveExponent α) (hα : 1/2 ≤ α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F U Q : ℝ) (a a' : n → ℂ) (b b' : p → ℂ) (hB : 0 ≤ B) (hN : 0 ≤ N) (hM : 0 < M) (hF : 0 < F) (hU : 0 ≤ U) (hQ : 1 ≤ Q) (ha : ∀ j, ‖a' j‖ ≤ ‖a j‖) (hb : ∀ k, ‖b' k‖ ≤ ‖b k‖) : (1/Q)*smallPrincipalMajorant hexp deltaLoss hδ ε hε (B/Q) N (M*Q) F U a' b' ≤ smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F U a b := by have hQp : 0 < Q := by linarith have he := divisorEnergyFactor_mono_coefficients ε hε N a a' b b' ha hb have hp : ((B/Q)*N)^deltaLoss ≤ (B*N)^deltaLoss := by apply Real.rpow_le_rpow (by positivity) _ hδ.le exact mul_le_mul_of_nonneg_right (div_le_self hB hQ) hN have hs := dual_bad_sector_scale M F B Q U α hM hF hB hQ hU hα have he0 := divisorEnergyFactor_nonneg ε hε N a' b' have he1 := divisorEnergyFactor_nonneg ε hε N a b have hc := (divisorExponentConstant_pos hexp deltaLoss hδ).le unfold smallPrincipalMajorant calc _ = ((columnDyadicLength N+1:ℕ):ℝ)^2 * (2*divisorEnergyFactor ε hε N a' b'*(divisorExponentConstant hexp deltaLoss hδ*((B/Q)*N)^deltaLoss)* ((1/Q)*(M*Q/F+(2*U)*Real.sqrt (M*Q/F)*(B/Q)^(α-1/2)))) := by ring _ ≤ _ := by gcongr lemma sqrt_sector_scale (M F Q b : ℝ) (hM : 0 < M) (hF : 0 < F) (hQ : 0 < Q) (hb : 0 < b) : Real.sqrt ((M/F)/(Q*b)) = (1/Q)*Real.sqrt (((M*Q)/F)/b) := by apply (sq_eq_sq₀ (Real.sqrt_nonneg _) (by positivity)).mp rw [mul_pow,Real.sq_sqrt (show 0 ≤ (M/F)/(Q*b) by positivity), Real.sq_sqrt (show 0 ≤ ((M*Q)/F)/b by positivity)] field_simp variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def unrestrictedLargePrincipalSum (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (Z : m → ℝ) : ℂ := by classical exact ∑ i, ∑ j, ∑ k, unrestrictedPairTerm rows left right a b i j k * ∑ d ∈ idealDivisors (left j*right k), if Z i < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)* ((Real.sqrt ((M/F)/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0 omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in lemma unrestrictedLargePrincipalSum_sector (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (Z : m → ℝ) (hM : 0 < M) (hF : 0 < F) (hrows : ∀ i, Squarefree (rows i)) (hleft : ∀ j, Admissible (left j)) (hright : ∀ k, Admissible (right k)) (hray : ∀ j k, columnRay (left j) = columnRay (right k)) (E : fixedBadPrimes.powerset) (hE : ∀ i, badPrimeSector (rows i) = E) (hQ : sectorBadIdeal E ≠ 0) : unrestrictedLargePrincipalSum rows left right a b M F Z = ((1/(Ideal.absNorm (sectorBadIdeal E):ℝ):ℝ):ℂ)* principalDivisorCorrection (fun i => goodSquarefreePart (rows i)) left right (fun j => a j*quadraticRow (left j) (idealGenerator (sectorBadIdeal E))) (fun k => b k*quadraticRow (right k) (idealGenerator (sectorBadIdeal E))) ((M*(Ideal.absNorm (sectorBadIdeal E):ℝ))/F) (fun d i => Z i < (Ideal.absNorm d:ℝ)) := by classical have hQp : 0 < (Ideal.absNorm (sectorBadIdeal E):ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun h => hQ (Ideal.absNorm_eq_zero_iff.mp h)) unfold unrestrictedLargePrincipalSum principalDivisorCorrection simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ rw [unrestrictedPairTerm_sector rows left right a b hrows hleft hright hray E hE i j k] have hn : (Ideal.absNorm (rows i):ℝ) = (Ideal.absNorm (sectorBadIdeal E):ℝ)*(Ideal.absNorm (goodSquarefreePart (rows i)):ℝ) := by have hi := congrArg (fun I : Ideal O => (Ideal.absNorm I:ℝ)) (sector_bad_good_product (rows i) (hrows i) E (hE i)) simpa only [map_mul,Nat.cast_mul] using hi.symm have hgpos : 0 < (Ideal.absNorm (goodSquarefreePart (rows i)):ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun h => (goodSquarefreePart_admissible (rows i)).1 (Ideal.absNorm_eq_zero_iff.mp h)) rw [hn,sqrt_sector_scale M F _ _ hM hF hQp hgpos] apply Finset.sum_congr rfl intro d _ by_cases hd : Z i < (Ideal.absNorm d:ℝ) · simp only [hd,ite_true,Complex.ofReal_div,Complex.ofReal_mul] ring · simp only [hd,ite_false,mul_zero] theorem HasSieveExponent.large_principal_sector {α : ℝ} (hexp : HasSieveExponent α) (hα : 1/2 ≤ α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F T : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hT : 4 ≤ T) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Squarefree (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (hray : ∀ j k, columnRay (left j) = columnRay (right k)) (a : n → ℂ) (b : p → ℂ) (Z : m → ℝ) (hZ : ∀ i, T*(N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ)))) ≤ Z i) (E : fixedBadPrimes.powerset) (hE : ∀ i, badPrimeSector (rows i) = E) : ‖unrestrictedLargePrincipalSum rows left right a b M F Z‖ ≤ smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F (1/2) a b := by classical cases isEmpty_or_nonempty m with | inl hempty => let := hempty simp only [unrestrictedLargePrincipalSum,Finset.univ_eq_empty,Finset.sum_empty,norm_zero] exact smallPrincipalMajorant_nonneg hexp deltaLoss hδ ε hε B N M F (1/2) a b (by linarith) (by linarith) hM.le hF.le (by norm_num) | inr hnonempty => let := hnonempty let i₀ : m := Classical.choice hnonempty let Q : ℝ := Ideal.absNorm (sectorBadIdeal E) let good := fun i => goodSquarefreePart (rows i) let a' := fun j => a j*quadraticRow (left j) (idealGenerator (sectorBadIdeal E)) let b' := fun k => b k*quadraticRow (right k) (idealGenerator (sectorBadIdeal E)) have hQnz := sectorBadIdeal_ne_zero_of_row (rows i₀) (hrows i₀).1 E (hE i₀) have hQ : 1 ≤ Q := by dsimp only [Q] exact_mod_cast (Nat.one_le_iff_ne_zero.mpr (fun h => hQnz (Ideal.absNorm_eq_zero_iff.mp h))) have hQp : 0 < Q := by linarith have hn (i : m) : (Ideal.absNorm (rows i):ℝ) = Q*(Ideal.absNorm (good i):ℝ) := by have hi := congrArg (fun I : Ideal O => (Ideal.absNorm I:ℝ)) (sector_bad_good_product (rows i) (hrows i).1 E (hE i)) simpa only [map_mul,Nat.cast_mul] using hi.symm have hgr : Function.Injective good := by intro i k h exact hr (goodSquarefreePart_injective_on_sector _ _ (hrows i).1 (hrows k).1 ((hE i).trans (hE k).symm) h) have hg (i : m) : Admissible (good i) ∧ (B/Q)/2 ≤ (Ideal.absNorm (good i):ℝ) ∧ (Ideal.absNorm (good i):ℝ) ≤ B/Q := by refine ⟨goodSquarefreePart_admissible _, ?_, ?_⟩ · rw [show B/Q/2 = (B/2)/Q by ring] apply (div_le_iff₀ hQp).2 have hx := (hrows i).2.1 rw [hn i] at hx nlinarith · exact (le_div_iff₀ hQp).2 (by simpa only [mul_comm] using (hn i).symm.trans_le (hrows i).2.2) have hBQ : 1 ≤ B/Q := by have hh : 1 ≤ (Ideal.absNorm (good i₀):ℝ) := by exact_mod_cast (Nat.one_le_iff_ne_zero.mpr (fun h => (hg i₀).1.1 (Ideal.absNorm_eq_zero_iff.mp h))) exact hh.trans (hg i₀).2.2 have hZg (i : m) : T*(N*Real.sqrt (F/((M*Q)*(Ideal.absNorm (good i):ℝ)))) ≤ Z i := by simpa only [hn i,mul_assoc] using hZ i have hbnd := hexp.dual_large_principal_sum deltaLoss hδ ε hε (B/Q) N (M*Q) F T hBQ hN (by positivity) hF (by linarith) good left right hgr hl hri hg hleft hright a' b' Z hZg have hmajor : ‖principalDivisorCorrection good left right a' b' ((M*Q)/F) (fun d i => Z i < (Ideal.absNorm d:ℝ))‖ ≤ smallPrincipalMajorant hexp deltaLoss hδ ε hε (B/Q) N (M*Q) F (1/2) a' b' := by apply hbnd.trans have ht : 4/T ≤ 1 := (div_le_one (by linarith : 0 (hrows i).1) (fun j => (hleft j).1) (fun k => (hright k).1) hray E hE hQnz change unrestrictedLargePrincipalSum rows left right a b M F Z = ((1/Q:ℝ):ℂ)*principalDivisorCorrection good left right a' b' ((M*Q)/F) (fun d i => Z i < (Ideal.absNorm d:ℝ)) at htr rw [htr,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (by positivity : 0≤1/Q)] apply (mul_le_mul_of_nonneg_left hmajor (by positivity)).trans apply smallPrincipalMajorant_bad_scale hexp hα deltaLoss hδ ε hε B N M F (1/2) Q a a' b b' (by linarith) (by linarith) hM hF (by norm_num) hQ · intro j dsimp only [a']; rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (quadraticRow_norm_le_one _ _) · intro k dsimp only [b']; rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (quadraticRow_norm_le_one _ _) theorem HasSieveExponent.unrestricted_large_principal_sum {α : ℝ} (hexp : HasSieveExponent α) (hα : 1/2 ≤ α) (deltaLoss : ℝ) (hδ : 0 < deltaLoss) (ε : ℝ) (hε : 0 < ε) (B N M F T : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hM : 0 < M) (hF : 0 < F) (hT : 4 ≤ T) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (hr : Function.Injective rows) (hl : Function.Injective left) (hri : Function.Injective right) (hrows : ∀ i, Squarefree (rows i) ∧ B/2 ≤ (Ideal.absNorm (rows i):ℝ) ∧ (Ideal.absNorm (rows i):ℝ) ≤ B) (hleft : ∀ j, Admissible (left j) ∧ (Ideal.absNorm (left j):ℝ) ≤ N) (hright : ∀ k, Admissible (right k) ∧ (Ideal.absNorm (right k):ℝ) ≤ N) (hray : ∀ j k, columnRay (left j) = columnRay (right k)) (a : n → ℂ) (b : p → ℂ) (Z : m → ℝ) (hZ : ∀ i, T*(N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ)))) ≤ Z i) : ‖unrestrictedLargePrincipalSum rows left right a b M F Z‖ ≤ 4*smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F (1/2) a b := by classical let σ := fun i => badPrimeSector (rows i) have hs : unrestrictedLargePrincipalSum rows left right a b M F Z = ∑ E : fixedBadPrimes.powerset, unrestrictedLargePrincipalSum (fun i : {i // σ i = E} => rows i.val) left right a b M F (fun i => Z i.val) := by unfold unrestrictedLargePrincipalSum exact (Fintype.sum_fiberwise σ _).symm have hb (E : fixedBadPrimes.powerset) : ‖unrestrictedLargePrincipalSum (fun i : {i // σ i = E} => rows i.val) left right a b M F (fun i => Z i.val)‖ ≤ smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F (1/2) a b := hexp.large_principal_sector hα deltaLoss hδ ε hε B N M F T hB hN hM hF hT (fun i : {i // σ i = E} => rows i.val) left right (fun i k h => Subtype.ext (hr h)) hl hri (fun i => hrows i.val) hleft hright hray a b (fun i => Z i.val) (fun i => hZ i.val) E (fun i => i.property) rw [hs] apply (norm_sum_le _ _).trans calc _ ≤ ∑ _E : fixedBadPrimes.powerset, smallPrincipalMajorant hexp deltaLoss hδ ε hε B N M F (1/2) a b := Finset.sum_le_sum (fun E _ => hb E) _ = _ := by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul,Fintype.card_coe,fixedBadPrimes_powerset_card] norm_num end open scoped BigOperators Classical SchwartzMap open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealCoprimeSieveOperator lemma unrestrictedPairTerm_norm_le {m n p : Type} (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (i : m) (j : n) (k : p) : ‖unrestrictedPairTerm rows left right a b i j k‖ ≤ ‖a j‖*‖b k‖ := by classical unfold unrestrictedPairTerm split_ifs with hc · simp only [unrestrictedPairCharacter,norm_mul,norm_star] calc _ ≤ (‖a j‖*‖b k‖)*(1*1) := mul_le_mul_of_nonneg_left (mul_le_mul (quadraticRow_norm_le_one _ _) (quadraticRow_norm_le_one _ _) (norm_nonneg _) (by norm_num)) (by positivity) _ = _ := by ring · simp only [norm_zero] positivity theorem unrestricted_pair_error_energy {m n : Type} [Fintype m] [Fintype n] (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (E : ℝ) (hE : 0 ≤ E) (error : m → n → n → ℂ) (herr : ∀ i j k, ‖error i j k‖ ≤ E) : ‖∑ i, ∑ j, ∑ k, unrestrictedPairTerm rows cols cols a a i j k * error i j k‖ ≤ Fintype.card m * Fintype.card n * E * ∑ j, ‖a j‖ ^ 2 := by classical have hcs := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (fun j : n => ‖a j‖) (fun _ => (1 : ℝ)) simp only [mul_one, one_pow, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] at hcs have hs : (∑ j, ∑ k, ‖a j‖ * ‖a k‖ * E) = (∑ j, ‖a j‖) ^ 2 * E := by simp only [pow_two, Finset.sum_mul, Finset.mul_sum, mul_assoc] apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro k hk ring calc _ ≤ ∑ i, ∑ j, ∑ k, ‖unrestrictedPairTerm rows cols cols a a i j k * error i j k‖ := by apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro i hi apply (norm_sum_le _ _).trans exact Finset.sum_le_sum (fun j hj => norm_sum_le _ _) _ ≤ ∑ _i : m, ∑ j, ∑ k, ‖a j‖ * ‖a k‖ * E := by apply Finset.sum_le_sum intro i hi apply Finset.sum_le_sum intro j hj apply Finset.sum_le_sum intro k hk rw [norm_mul] exact mul_le_mul (unrestrictedPairTerm_norm_le rows cols cols a a i j k) (herr i j k) (norm_nonneg _) (by positivity) _ = (Fintype.card m : ℝ) * ((∑ j, ‖a j‖) ^ 2 * E) := by simp only [hs, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] _ ≤ (Fintype.card m : ℝ) * (((∑ j, ‖a j‖ ^ 2) * Fintype.card n) * E) := by gcongr _ = _ := by ring theorem unrestricted_pair_error_ideal_bound {m n : Type} [Fintype m] [Fintype n] (rows : m → Ideal O) (cols : n → Ideal O) (hr : Function.Injective rows) (hc : Function.Injective cols) (B N : ℝ) (hB : 1 ≤ B) (hN : 1 ≤ N) (hrows : ∀ i, rows i ≠ 0 ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) (hcols : ∀ j, cols j ≠ 0 ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) (a : n → ℂ) (E : ℝ) (hE : 0 ≤ E) (error : m → n → n → ℂ) (herr : ∀ i j k, ‖error i j k‖ ≤ E) : ‖∑ i, ∑ j, ∑ k, unrestrictedPairTerm rows cols cols a a i j k * error i j k‖ ≤ 16384 * B * N * E * ∑ j, ‖a j‖ ^ 2 := by have hrc := finite_ideal_family_card_bound rows hr B hB (fun i => (hrows i).1) (fun i => (hrows i).2) have hcc := finite_ideal_family_card_bound cols hc N hN (fun j => (hcols j).1) (fun j => (hcols j).2) apply (unrestricted_pair_error_energy rows cols a E hE error herr).trans calc _ ≤ (128 * B) * (128 * N) * E * ∑ j, ‖a j‖ ^ 2 := by gcongr _ = _ := by ring variable {m n : Type} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] def unrestrictedDualPrincipalErrorSum (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (W : 𝓢(ℝ, ℂ)) (M F N T : ℝ) : ℂ := ∑ i, ∑ j, ∑ k, unrestrictedPairTerm rows cols cols a a i j k * (((M / (Real.sqrt ((Ideal.absNorm (cols j) : ℝ) * (Ideal.absNorm (cols k) : ℝ)) * F) : ℝ) : ℂ) * truncationError (fun P : primePool {cols j * cols k} => P.val) Finset.univ W (Real.sqrt (F * (Ideal.absNorm (cols j) : ℝ) * (Ideal.absNorm (cols k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ)))) ((N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ)))) / T) (T * (N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ))))) (T ^ 4)) end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.RetainedDualBounds namespace OAI noncomputable section namespace CanonicalQuadraticSieve open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators section open scoped BigOperators Classical SchwartzMap section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum def primePoolDensity (G : Ideal O) : ℂ := ∏ P : primePool {G}, (1-(1:ℂ)/(Ideal.absNorm P.val:ℂ)) theorem principalTruncation_scaled (G : Ideal O) (hG : Squarefree G) (W : ℝ → ℂ) (c X Z : ℝ) : (c:ℂ)*principalTruncation (fun P : primePool {G} => P.val) Finset.univ W X Z = ((c*X:ℝ):ℂ)*paperRadialFourier W 0*primePoolDensity G - paperRadialFourier W 0 * (∑ d ∈ idealDivisors G, if Z < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)*(((c*X)/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0) - W 0 * (∑ d ∈ idealDivisors G, if (Ideal.absNorm d:ℝ) ≤ Z then (UniqueFactorizationMonoid.moebius d:ℂ)*(c:ℂ) else 0) := by classical have hl : (∑ d ∈ idealDivisors G, if Z < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)*(((c*X)/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0) = ((c*X:ℝ):ℂ)*(∑ d ∈ idealDivisors G, if Z < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)/(Ideal.absNorm d:ℂ) else 0) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro d _ by_cases hd : Z < (Ideal.absNorm d:ℝ) · simp only [hd,ite_true,Complex.ofReal_div,Complex.ofReal_natCast] ring · simp only [hd,ite_false,mul_zero] have hs : (∑ d ∈ idealDivisors G, if (Ideal.absNorm d:ℝ) ≤ Z then (UniqueFactorizationMonoid.moebius d:ℂ)*(c:ℂ) else 0) = (c:ℂ)*(∑ d ∈ idealDivisors G, if (Ideal.absNorm d:ℝ) ≤ Z then (UniqueFactorizationMonoid.moebius d:ℂ) else 0) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro d _ by_cases hd : (Ideal.absNorm d:ℝ) ≤ Z <;> simp only [hd,ite_true,ite_false,mul_zero] ; ring rw [principalTruncation_eq_ideal_divisors G hG,hl,hs] unfold primePoolDensity push_cast ring variable {m n p : Type} [Fintype m] [Fintype n] [Fintype p] [DecidableEq m] [DecidableEq n] [DecidableEq p] def unrestrictedPrincipalDensity (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (R : ℝ) : ℂ := ∑ i, ∑ j, ∑ k, unrestrictedPairTerm rows left right a b i j k * ((Real.sqrt (R/(Ideal.absNorm (rows i):ℝ)):ℝ):ℂ)*primePoolDensity (left j*right k) def unrestrictedDualPrincipalTruncation (W : ℝ → ℂ) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (Z : m → ℝ) : ℂ := ∑ i, ∑ j, ∑ k, unrestrictedPairTerm rows left right a b i j k * (((M/(Real.sqrt ((Ideal.absNorm (left j):ℝ)*(Ideal.absNorm (right k):ℝ))*F):ℝ):ℂ) * principalTruncation (fun P : primePool {left j*right k} => P.val) Finset.univ W (Real.sqrt (F*(Ideal.absNorm (left j):ℝ)*(Ideal.absNorm (right k):ℝ)/ (M*(Ideal.absNorm (rows i):ℝ)))) (Z i)) omit [DecidableEq m] [DecidableEq n] [DecidableEq p] in theorem unrestrictedDualPrincipalTruncation_eq (W : ℝ → ℂ) (rows : m → Ideal O) (left : n → Ideal O) (right : p → Ideal O) (a : n → ℂ) (b : p → ℂ) (M F : ℝ) (Z : m → ℝ) (hM : 0 < M) (hF : 0 < F) (hrows : ∀ i, rows i ≠ 0) (hleft : ∀ j, Admissible (left j)) (hright : ∀ k, Admissible (right k)) : unrestrictedDualPrincipalTruncation W rows left right a b M F Z = paperRadialFourier W 0*unrestrictedPrincipalDensity rows left right a b (M/F) - paperRadialFourier W 0*unrestrictedLargePrincipalSum rows left right a b M F Z - W 0*unrestrictedSmallPrincipalSum rows left right a b M F (fun d i => (Ideal.absNorm d:ℝ) ≤ Z i) := by classical have hpos (I : Ideal O) (hI : I ≠ 0) : 0 < (Ideal.absNorm I:ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun h => hI (Ideal.absNorm_eq_zero_iff.mp h)) have ht (i : m) (j : n) (k : p) : unrestrictedPairTerm rows left right a b i j k * (((M/(Real.sqrt ((Ideal.absNorm (left j):ℝ)*(Ideal.absNorm (right k):ℝ))*F):ℝ):ℂ) * principalTruncation (fun P : primePool {left j*right k} => P.val) Finset.univ W (Real.sqrt (F*(Ideal.absNorm (left j):ℝ)*(Ideal.absNorm (right k):ℝ)/ (M*(Ideal.absNorm (rows i):ℝ)))) (Z i)) = paperRadialFourier W 0 * (unrestrictedPairTerm rows left right a b i j k * ((Real.sqrt ((M/F)/(Ideal.absNorm (rows i):ℝ)):ℝ):ℂ)*primePoolDensity (left j*right k)) - paperRadialFourier W 0 * (unrestrictedPairTerm rows left right a b i j k * ∑ d ∈ idealDivisors (left j*right k), if Z i < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)* ((Real.sqrt ((M/F)/(Ideal.absNorm (rows i):ℝ))/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0) - W 0 * (unrestrictedPairTerm rows left right a b i j k * ∑ d ∈ idealDivisors (left j*right k), if (Ideal.absNorm d:ℝ) ≤ Z i then (UniqueFactorizationMonoid.moebius d:ℂ)* ((M/(Real.sqrt ((Ideal.absNorm (left j):ℝ)*(Ideal.absNorm (right k):ℝ))*F):ℝ):ℂ) else 0) := by by_cases hc : IsCoprime (left j) (right k) · have hsq : Squarefree (left j*right k) := squarefree_mul_iff.mpr ⟨hc.isRelPrime,(hleft j).2.1,(hright k).2.1⟩ rw [principalTruncation_scaled _ hsq,dual_principal_prefactor_identity M F (Ideal.absNorm (rows i)) (Ideal.absNorm (left j)) (Ideal.absNorm (right k)) hM hF (hpos _ (hrows i)) (hpos _ (hleft j).1) (hpos _ (hright k).1)] ring · have hz : unrestrictedPairTerm rows left right a b i j k = 0 := by simp only [unrestrictedPairTerm,hc,ite_false] simp only [hz,zero_mul,mul_zero,sub_zero] unfold unrestrictedDualPrincipalTruncation simp_rw [ht] simp only [unrestrictedPrincipalDensity,unrestrictedLargePrincipalSum,unrestrictedSmallPrincipalSum, Finset.sum_sub_distrib,Finset.mul_sum] end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson UnrestrictedIdealReindex GaussGeneratorTransport theorem dualPrincipalIdeal_truncated_all_conductors (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (V : 𝓢(ℝ,ℂ)) (X Y Z lengthScale : ℝ) (hX : 0 P.val) Finset.univ V X Z + middleTruncation (fun P : primePool {I*J} => P.val) Finset.univ V X Y Z lengthScale + truncationError (fun P : primePool {I*J} => P.val) Finset.univ V X Y Z lengthScale) := by let P := fun P : primePool {I*J} => P.val let f : O → ℂ := fun z => rowCoprimeMask P Finset.univ z * (if z=0 then 0 else V (‖eisEmbedding z‖^2/X)) have hV : Summable (fun z : O => ‖V (‖eisEmbedding z‖^2/X)‖) := by simpa only [scaledRadialTest_apply] using actual_eisenstein_summable_norm (scaledRadialTest V X hX) have hf : Summable f := by apply Summable.of_norm apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ hV intro z dsimp only [f] by_cases hz : z=0 · simp only [hz,ite_true,mul_zero,norm_zero] exact norm_nonneg _ · rw [if_neg hz,norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (QuadraticUnitInvariance.rowCoprimeMask_norm_le_one P Finset.univ z) have h0 : f 0=0 := by simp only [f,ite_true,mul_zero] have hu (u : Oˣ) (z : O) : f (u.val*z)=f z := by dsimp only [f] rw [QuadraticUnitInvariance.rowCoprimeMask_unit_mul,norm_eisEmbedding_unit_mul] simp only [mul_eq_zero,u.ne_zero,false_or] have he := tsum_unit_invariant_of_zero f hf h0 hu have hm (z : O) : rowCoprimeMask P Finset.univ z=idealZeroMask I z*idealZeroMask J z := by rw [singleton_rowCoprimeMask_eq_idealZeroMask,idealZeroMask_mul I J hI.1 hJ.1] have hd : (∑' A : NonzeroIdeal, f (idealGenerator A.val))=dualPrincipalIdeal I J V X := by unfold dualPrincipalIdeal apply tsum_congr intro A simp only [f,hm,if_neg (idealGenerator_ne_zero A.val A.property),idealGenerator_norm_sq] rw [hd] at he have hs : principalTruncation P Finset.univ V X Z + middleTruncation P Finset.univ V X Y Z lengthScale + truncationError P Finset.univ V X Y Z lengthScale = ∑' z : O, f z := by unfold truncationError dsimp only [f] ring change dualPrincipalIdeal I J V X=(6:ℂ)⁻¹ * (principalTruncation P Finset.univ V X Z + middleTruncation P Finset.univ V X Y Z lengthScale + truncationError P Finset.univ V X Y Z lengthScale) rw [hs,he] ring end open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealCoprimeSieveOperator theorem unrestrictedDualPrincipal_error_uniform (l : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {m n : Type} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n], ∀ (ε : ℝ) (hε : 0 < ε) (B N M F T : ℝ), 1 ≤ B → 1 ≤ N → 0 < M → 0 < F → 4 ≤ T → ∀ (rows : m → Ideal O) (cols : n → Ideal O), Function.Injective rows → Function.Injective cols → (∀ i, rows i ≠ 0 ∧ (Ideal.absNorm (rows i) : ℝ) ≤ B) → (∀ j, Admissible (cols j) ∧ N / 2 ≤ (Ideal.absNorm (cols j) : ℝ) ∧ (Ideal.absNorm (cols j) : ℝ) ≤ N) → ∀ (a : n → ℂ) (W : 𝓢(ℝ, ℂ)), ‖unrestrictedDualPrincipalErrorSum rows cols a W M F N T‖ ≤ 16384 * B * N * ((2 * M / (F * N)) * ((supportConstant ε hε * (N * N) ^ ε) * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / T ^ l)) * ∑ j, ‖a j‖ ^ 2 := by obtain ⟨s, C, hC, hb⟩ := primePool_symmetric_error_bound l refine ⟨s, C, hC, ?_⟩ intro m n _ _ _ _ ε hε B N M F T hB hN hM hF hT rows cols hr hc hrows hcols a W let E₀ := (supportConstant ε hε * (N * N) ^ ε) * (C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / T ^ l let error : m → n → n → ℂ := fun i j k => (((M / (Real.sqrt ((Ideal.absNorm (cols j) : ℝ) * (Ideal.absNorm (cols k) : ℝ)) * F) : ℝ) : ℂ) * truncationError (fun P : primePool {cols j * cols k} => P.val) Finset.univ W (Real.sqrt (F * (Ideal.absNorm (cols j) : ℝ) * (Ideal.absNorm (cols k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ)))) ((N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ)))) / T) (T * (N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ))))) (T ^ 4)) have hsc := (supportConstant_pos ε hε).le have hE₀ : 0 ≤ E₀ := by dsimp only [E₀]; positivity have herr (i : m) (j k : n) : ‖error i j k‖ ≤ (2 * M / (F * N)) * E₀ := by have hi : 0 < (Ideal.absNorm (rows i) : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun h => (hrows i).1 (Ideal.absNorm_eq_zero_iff.mp h)) obtain ⟨hX₀, hlo, hhi⟩ := dual_truncation_reference_bounds M F (Ideal.absNorm (rows i)) N (Ideal.absNorm (cols j)) (Ideal.absNorm (cols k)) hM hF hi (by linarith) (hcols j).2 (hcols k).2 have hh := hb ε hε (cols j * cols k) (mul_ne_zero (hcols j).1.1 (hcols k).1.1) W _ _ T hX₀ hlo hhi hT simp only [map_mul, Nat.cast_mul] at hh have he : ‖truncationError (fun P : primePool {cols j * cols k} => P.val) Finset.univ W (Real.sqrt (F * (Ideal.absNorm (cols j) : ℝ) * (Ideal.absNorm (cols k) : ℝ) / (M * (Ideal.absNorm (rows i) : ℝ)))) ((N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ)))) / T) (T * (N * Real.sqrt (F / (M * (Ideal.absNorm (rows i) : ℝ))))) (T ^ 4)‖ ≤ E₀ := by apply hh.trans dsimp only [E₀] gcongr · exact (hcols j).2.2 · exact (hcols k).2.2 dsimp only [error] rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (by positivity)] exact mul_le_mul (dual_truncation_prefactor_bound M F N (Ideal.absNorm (cols j)) (Ideal.absNorm (cols k)) hM hF (by linarith) (hcols j).2 (hcols k).2) he (norm_nonneg _) (by positivity) exact unrestricted_pair_error_ideal_bound rows cols hr hc B N hB hN hrows (fun j => ⟨(hcols j).1.1, (hcols j).2.2⟩) a _ (by positivity) error herr section variable {m n : Type} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] def retainedDualPrincipalSum (W : 𝓢(ℝ,ℂ)) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (M F : ℝ) : ℂ := ∑ i, ∑ j, ∑ k, unrestrictedPairTerm rows cols cols a a i j k * (((M/(Real.sqrt ((Ideal.absNorm (cols j):ℝ)*(Ideal.absNorm (cols k):ℝ))*F):ℝ):ℂ) * dualPrincipalIdeal (cols j) (cols k) W (Real.sqrt (F*(Ideal.absNorm (cols j):ℝ)*(Ideal.absNorm (cols k):ℝ)/ (M*(Ideal.absNorm (rows i):ℝ))))) omit [DecidableEq m] [DecidableEq n] in theorem retainedDualPrincipalSum_symmetric_truncation (W : 𝓢(ℝ,ℂ)) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (M F N T : ℝ) (hM : 0 T*(N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ))))) + unrestrictedDualTruncatedMiddle W rows cols cols a a M F (fun i => (N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ))))/T) (fun i => T*(N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ))))) (T^4) + unrestrictedDualPrincipalErrorSum rows cols a W M F N T := by have hpos (I : Ideal O) (hI : I ≠ 0) : 0 < (Ideal.absNorm I:ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun h => hI (Ideal.absNorm_eq_zero_iff.mp h)) unfold retainedDualPrincipalSum unrestrictedDualPrincipalTruncation unrestrictedDualTruncatedMiddle unrestrictedDualPrincipalErrorSum simp only [Finset.mul_sum,←Finset.sum_add_distrib] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ rw [dualPrincipalIdeal_truncated_all_conductors (cols j) (cols k) (hcols j) (hcols k)] · ring · have hi := hpos _ (hrows i) have hj := hpos _ (hcols j).1 have hk := hpos _ (hcols k).1 exact Real.sqrt_pos.mpr (by positivity : 0 < F*(Ideal.absNorm (cols j):ℝ)*(Ideal.absNorm (cols k):ℝ)/(M*(Ideal.absNorm (rows i):ℝ))) end lemma norm_four_correction_terms (A B C D : ℂ) : ‖-A-B+C+D‖ ≤ ‖A‖+‖B‖+‖C‖+‖D‖ := by have hab := norm_sub_le (-A) B have habc := norm_add_le (-A-B) C have habcd := norm_add_le (-A-B+C) D simp only [norm_neg] at hab linarith theorem retained_dual_principal_difference (l : ℕ) : ∃ (s : Finset (ℕ×ℕ)) (C : ℝ), 0 T*(N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ)))) let Y := fun i => (N*Real.sqrt (F/(M*(Ideal.absNorm (rows i):ℝ))))/T have hT0 : 0≤T := by linarith have hmain := unrestrictedDualPrincipalTruncation_eq W rows cols cols a a M F Z hM hF (fun i => (hrows i).1.ne_zero) (fun j => (hcols j).1) (fun k => (hcols k).1) have hsplit := retainedDualPrincipalSum_symmetric_truncation W rows cols a M F N T hM hF (fun i => (hrows i).1.ne_zero) (fun j => (hcols j).1) change (6:ℂ)*retainedDualPrincipalSum W rows cols a M F = unrestrictedDualPrincipalTruncation W rows cols cols a a M F Z + unrestrictedDualTruncatedMiddle W rows cols cols a a M F Y Z (T^4) + unrestrictedDualPrincipalErrorSum rows cols a W M F N T at hsplit have heq : (6:ℂ)*retainedDualPrincipalSum W rows cols a M F - paperRadialFourier W 0*unrestrictedPrincipalDensity rows cols cols a a (M/F) = -(paperRadialFourier W 0*unrestrictedLargePrincipalSum rows cols cols a a M F Z) - (W 0*unrestrictedSmallPrincipalSum rows cols cols a a M F (fun d i => (Ideal.absNorm d:ℝ)≤Z i)) + unrestrictedDualTruncatedMiddle W rows cols cols a a M F Y Z (T^4) + unrestrictedDualPrincipalErrorSum rows cols a W M F N T := by rw [hsplit,hmain] ring have hl := hexp.unrestricted_large_principal_sum hα deltaLoss hδ ε hε B N M F T hB hN hM hF hT rows cols cols hr hc hc hrows (fun j => ⟨(hcols j).1,(hcols j).2.2⟩) (fun k => ⟨(hcols k).1,(hcols k).2.2⟩) hray a a Z (fun _ => le_rfl) have hs := hexp.unrestricted_small_principal_sum hα deltaLoss hδ ε hε B N M F T hB hN hM hF hT0 rows cols cols hr hc hc hrows hcols hcols hray a a (fun d i => (Ideal.absNorm d:ℝ)≤Z i) (fun _ _ h => h) have hm := hexp.unrestricted_dual_truncated_middle hα deltaLoss hδ ε hε B N M F T hB hN hM hF hT0 rows cols cols hr hc hc hrows a a W Y Z (T^4) hcols hcols hray (fun _ => le_rfl) have he := herr ε hε B N M F T hB hN hM hF hT rows cols hr hc (fun i => ⟨(hrows i).1.ne_zero,(hrows i).2.2⟩) hcols a W rw [heq] apply (norm_four_correction_terms _ _ _ _).trans rw [norm_mul,norm_mul] exact add_le_add (add_le_add (add_le_add (mul_le_mul_of_nonneg_left hl (norm_nonneg _)) (mul_le_mul_of_nonneg_left hs (norm_nonneg _))) hm) he lemma sum_ideal_subtype_dyadic {A : Type*} [AddCommMonoid A] (S : Finset (Ideal O)) (K : ℝ) (f : Ideal O → A) : (∑ I : S, f I.val) = ∑ j : Fin (columnDyadicLength K+1), ∑ I : divisorDyadicBin S K j, f I.val := by classical rw [Finset.sum_coe_sort S f,sum_divisorDyadicBins S K f] exact Finset.sum_congr rfl (fun j _ => (Finset.sum_coe_sort (divisorDyadicBin S K j) f).symm) def retainedDualMajorant {n : Type} [Fintype n] (s : Finset (ℕ×ℕ)) (C : ℝ) (l : ℕ) {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 I.val) cols a M F - paperRadialFourier W 0*unrestrictedPrincipalDensity (fun I : S => I.val) cols cols a a (M/F) = ∑ j : Fin (columnDyadicLength K+1), ((6:ℂ)*retainedDualPrincipalSum W (fun I : divisorDyadicBin S K j => I.val) cols a M F - paperRadialFourier W 0*unrestrictedPrincipalDensity (fun I : divisorDyadicBin S K j => I.val) cols cols a a (M/F)) := by classical have h := sum_ideal_subtype_dyadic (A := ℂ) S K (fun I => (6:ℂ)*retainedDualPrincipalSum W (fun _ : Unit => I) cols a M F - paperRadialFourier W 0*unrestrictedPrincipalDensity (fun _ : Unit => I) cols cols a a (M/F)) simpa only [retainedDualPrincipalSum,unrestrictedPrincipalDensity,unrestrictedPairTerm, Finset.mul_sum,←Finset.sum_sub_distrib,Fintype.sum_unique] using h theorem retained_dual_principal_global (l : ℕ) : ∃ (s : Finset (ℕ×ℕ)) (C : ℝ), 0 I.val) cols a M F - paperRadialFourier W 0*unrestrictedPrincipalDensity (fun I : squarefreeIdealRange K => I.val) cols cols a a (M/F)‖ ≤ (columnDyadicLength K+1:ℕ)*retainedDualMajorant s C l hexp deltaLoss hδ ε hε (2*K) N M F T a W := by obtain ⟨s,C,hC,hbound⟩ := retained_dual_principal_difference l refine ⟨s,C,hC,?_⟩ intro n _ _ α hexp hα deltaLoss hδ ε hε K N M F T hK hN hM hF hT cols hc hcols hray a W classical let S := squarefreeIdealRange K let R := retainedDualMajorant s C l hexp deltaLoss hδ ε hε (2*K) N M F T a W have hS (I : Ideal O) (hI : I∈S) : 1≤(Ideal.absNorm I:ℝ) ∧ (Ideal.absNorm I:ℝ)≤K := by have hi := mem_squarefreeIdealRange.mp hI refine ⟨?_,hi.2⟩ exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun h => hi.1.ne_zero (Ideal.absNorm_eq_zero_iff.mp h)) have hR : 0≤R := retainedDualMajorant_nonneg s C hC.le l hexp deltaLoss hδ ε hε (2*K) N M F T a W (by linarith) (by linarith) hM.le hF.le (by linarith) have hb (j : Fin (columnDyadicLength K+1)) : ‖(6:ℂ)*retainedDualPrincipalSum W (fun I : divisorDyadicBin S K j => I.val) cols a M F - paperRadialFourier W 0*unrestrictedPrincipalDensity (fun I : divisorDyadicBin S K j => I.val) cols cols a a (M/F)‖ ≤ R := by by_cases hj : (divisorDyadicBin S K j).Nonempty · let B := 2*divisorDyadicScale j.val have hB : 1≤B := by dsimp only [B]; linarith [divisorDyadicScale_ge_one j.val] have hBK : B≤2*K := by dsimp only [B] exact mul_le_mul_of_nonneg_left (divisorDyadicBin_scale_le S K hS j hj) (by norm_num) have hrows (I : divisorDyadicBin S K j) : Squarefree I.val ∧ B/2≤(Ideal.absNorm I.val:ℝ) ∧ (Ideal.absNorm I.val:ℝ)≤B := by have hi := divisorDyadicBin_bounds S K hS j I.val I.property refine ⟨(mem_squarefreeIdealRange.mp (Finset.mem_filter.mp I.property).1).1,?_,hi.2⟩ dsimp only [B] linarith have hh := hbound hexp hα deltaLoss hδ ε hε B N M F T hB hN hM hF hT (fun I : divisorDyadicBin S K j => I.val) cols Subtype.val_injective hc hrows hcols hray a W apply hh.trans exact retainedDualMajorant_mono s C hC.le l hexp hα deltaLoss hδ ε hε B (2*K) N M F T a W (by linarith) hBK (by linarith) hM.le hF.le (by linarith) · have he := Finset.not_nonempty_iff_eq_empty.mp hj have : IsEmpty (divisorDyadicBin S K j) := by refine ⟨fun I => ?_⟩ have hi := I.property simp only [he,Finset.notMem_empty] at hi simpa only [retainedDualPrincipalSum,unrestrictedPrincipalDensity,Finset.univ_eq_empty, Finset.sum_empty,mul_zero,sub_zero,norm_zero] using hR rw [retainedDualPrincipalDifference_dyadic W (squarefreeIdealRange K) K cols a M F] apply (norm_sum_le _ _).trans calc _ ≤ ∑ _j : Fin (columnDyadicLength K+1), R := Finset.sum_le_sum (fun j _ => hb j) _ = _ := by simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,R] end open scoped BigOperators Classical open ActualEisensteinCubic QuadraticSquarefreeKernel CompletedGauss def highSquareParts (M K : ℝ) : Finset (Ideal O) := (highKernelRange M K).image squarePart theorem highSquareParts_bounds (M K : ℝ) (hK : 0 < K) (A : Ideal O) (hA : A ∈ highSquareParts M K) : Supported A ∧ 1 ≤ (Ideal.absNorm A : ℝ) ∧ (Ideal.absNorm A : ℝ) ≤ Real.sqrt (M/K) ∧ 1 ≤ M/(Ideal.absNorm A : ℝ)^2 := by obtain ⟨I,hI,rfl⟩ := Finset.mem_image.mp hA obtain ⟨hs,hN,hlarge⟩ := mem_highKernelRange.mp hI have hparts := (supported_square_parts I).mp hs have hna : 1 ≤ (Ideal.absNorm (squarePart I) : ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun h => hparts.1.1 (Ideal.absNorm_eq_zero_iff.mp h)) have hnb : 1 ≤ (Ideal.absNorm (squarefreePart I) : ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun h => hparts.2.1 (Ideal.absNorm_eq_zero_iff.mp h)) have hprod : (Ideal.absNorm (squarePart I) : ℝ)^2*(Ideal.absNorm (squarefreePart I) : ℝ) ≤ M := by have he : (Ideal.absNorm (squarePart I) : ℝ)^2*(Ideal.absNorm (squarefreePart I) : ℝ) = (Ideal.absNorm I : ℝ) := by exact_mod_cast norm_decomposition I rwa [he] have hsquare : (Ideal.absNorm (squarePart I) : ℝ)^2 ≤ M/K := by apply (le_div_iff₀ hK).mpr exact (mul_le_mul_of_nonneg_left hlarge.le (sq_nonneg _)).trans hprod have hM : 0 ≤ M/K := (sq_nonneg _).trans hsquare have hroot : (Ideal.absNorm (squarePart I) : ℝ) ≤ Real.sqrt (M/K) := by nlinarith [Real.sq_sqrt hM,Real.sqrt_nonneg (M/K)] refine ⟨hparts.1,hna,hroot,?_⟩ apply (le_div_iff₀ (by positivity : 0 < (Ideal.absNorm (squarePart I) : ℝ)^2)).mpr nlinarith theorem highSquarePart_fiber_row_bounds (M K : ℝ) (A I : Ideal O) (hI : I ∈ highKernelRange M K) (hA : squarePart I = A) : Admissible (squarefreePart I) ∧ (Ideal.absNorm (squarefreePart I) : ℝ) ≤ M/(Ideal.absNorm A : ℝ)^2 := by have hs := (mem_highKernelRange.mp hI).1 have hparts := (supported_square_parts I).mp hs have hna : 0 < (Ideal.absNorm A : ℝ) := by rw [←hA] exact_mod_cast Nat.pos_of_ne_zero (fun h => hparts.1.1 (Ideal.absNorm_eq_zero_iff.mp h)) refine ⟨hparts.2,(le_div_iff₀ (sq_pos_of_pos hna)).mpr ?_⟩ have he : (Ideal.absNorm A : ℝ)^2*(Ideal.absNorm (squarefreePart I) : ℝ) = (Ideal.absNorm I : ℝ) := by rw [←hA] exact_mod_cast norm_decomposition I simpa only [mul_comm,he] using (mem_highKernelRange.mp hI).2.1 def highSquarePartFiber (M K : ℝ) (A : Ideal O) : Finset (Ideal O) := (highKernelRange M K).filter (fun I => squarePart I = A) theorem highSquarePartFiber_energy (M N K : ℝ) (A : Ideal O) (a : idealRange N → ℂ) : (∑ I ∈ highSquarePartFiber M K A, ‖∑ J : idealRange N, quadraticRow J.val (primaryGenerator I) * a J‖^2) ≤ sieveNorm (M/(Ideal.absNorm A : ℝ)^2) N * ∑ J, ‖a J‖^2 := by let S := highSquarePartFiber M K A let b : idealRange N → ℂ := fun J => idealZeroMask J.val (primaryGenerator A) * a J let B : Matrix S (idealRange N) ℂ := fun I J => quadraticRow J.val (primaryGenerator (squarefreePart I.val)) have hinj : Function.Injective (fun I : S => squarefreePart I.val) := by intro I I' heq dsimp only at heq apply Subtype.ext have hI := (Finset.mem_filter.mp I.property).2 have hI' := (Finset.mem_filter.mp I'.property).2 calc I.val = A^2 * squarefreePart I.val := by simpa only [hI] using (squarePart_sq_mul_squarefreePart I.val).symm _ = A^2 * squarefreePart I'.val := by rw [heq] _ = I'.val := by simpa only [hI'] using squarePart_sq_mul_squarefreePart I'.val have hnorm : ‖FiniteSieveOperator.operator B‖^2 ≤ sieveNorm (M/(Ideal.absNorm A : ℝ)^2) N := by apply family_squared_norm_le (fun I : S => squarefreePart I.val) (fun J : idealRange N => J.val) hinj Subtype.val_injective · intro I exact highSquarePart_fiber_row_bounds M K A I.val (Finset.mem_filter.mp I.property).1 (Finset.mem_filter.mp I.property).2 · intro J exact mem_idealRange.mp J.property have hrow (I : S) : (∑ J : idealRange N, quadraticRow J.val (primaryGenerator I.val) * a J) = ∑ J : idealRange N, B I J * b J := by apply Finset.sum_congr rfl intro J _ have hI := (Finset.mem_filter.mp I.property).2 have he : I.val = A^2 * squarefreePart I.val := by simpa only [hI] using (squarePart_sq_mul_squarefreePart I.val).symm rw [he, canonical_quadraticRow_primary_squarefree J.val (mem_idealRange.mp J.property).1] change _ = quadraticRow J.val (primaryGenerator (squarefreePart I.val)) * (idealZeroMask J.val (primaryGenerator A) * a J) ring have hb (J : idealRange N) : ‖b J‖^2 ≤ ‖a J‖^2 := by dsimp only [b] unfold idealZeroMask split_ifs <;> simp rw [← Finset.sum_coe_sort S] simp_rw [hrow] exact (FiniteSieveOperator.energy_bound B b).trans ((mul_le_mul_of_nonneg_right hnorm (by positivity)).trans (mul_le_mul_of_nonneg_left (Finset.sum_le_sum fun J _ => hb J) (sieveNorm_nonneg _ _))) theorem highKernelNorm_le_squarePart_sum (M N K : ℝ) : highKernelNorm M N K ≤ ∑ A ∈ highSquareParts M K, sieveNorm (M/(Ideal.absNorm A : ℝ)^2) N := by apply FiniteSieveOperator.squared_norm_le_of_energy _ _ (Finset.sum_nonneg fun A _ => sieveNorm_nonneg _ _) intro a simp only [highKernelMatrix] rw [Finset.sum_coe_sort (highKernelRange M K) (fun I : Ideal O => ‖∑ J : idealRange N, quadraticRow J.val (primaryGenerator I) * a J‖^2)] have hmaps : ∀ I ∈ highKernelRange M K, squarePart I ∈ highSquareParts M K := fun I hI => Finset.mem_image_of_mem squarePart hI rw [← Finset.sum_fiberwise_of_maps_to hmaps] calc _ ≤ ∑ A ∈ highSquareParts M K, sieveNorm (M/(Ideal.absNorm A : ℝ)^2) N * ∑ J, ‖a J‖^2 := by apply Finset.sum_le_sum intro A hA exact highSquarePartFiber_energy M N K A a _ = _ := (Finset.sum_mul _ _ _).symm end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.PrincipalDensity namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace SecondPassIntegration open scoped BigOperators Classical open MeasureTheory open ActualEisensteinCubic SecondPassArithmetic theorem childDensity_elementary_normalized {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (hΨ₁ : ∀ a,‖Ψ₁ a‖ ≤ 1) (hΨ₂ : ∀ a,‖Ψ₂ a‖ ≤ 1) (m : O) (T : Finset (Ideal O × O)) (V₁ V₂ : ℝ → ℂ) (X F K A M : ℝ) (J : ℕ) (hX : 0 < X) (hF : 1 ≤ F) (hK : 1 ≤ K) (hA : 0 ≤ A) (hM : 0 ≤ M) (hV₁ : ∀ s,‖V₁ s‖ ≤ M) (hV₂ : ∀ s,‖V₂ s‖ ≤ M) (hVs₁ : ∀ s,V₁ s ≠ 0 → |s| ≤ A) (hVs₂ : ∀ s,V₂ s ≠ 0 → |s| ≤ A) (hT : ∀ z∈T,z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ F ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ K) : densityChildEnergy p hp hcop hg pool Ψ₁ Ψ₂ m T V₁ V₂ X X (2*J)/(X*F) ≤ (6*128^4*K*(max 1 (X*Real.exp A))^2*M^2/X)* (∫ t : ℝ,FirstPassCubeLabels.firstLogDensity 0 t)^3 := by let B := (6*128^4*K*(max 1 (X*Real.exp A))^2*M^2/X)*(X*F) have hB : 0 ≤ B := by dsimp [B]; positivity have hXF : 0 < X*F := mul_pos hX (lt_of_lt_of_le zero_lt_one hF) have h₁ (a : ℝ) : childEnergy p hp hcop hg pool Ψ₁ m T V₁ X true false a 0 ≤ B*(1+‖a‖)^(2*J) := by have h := childEnergy_elementary_normalized p hp hcop hg hc hinj pool Ψ₁ hΨ₁ m T V₁ X F K A M a 0 hX hF hK hA hM hV₁ hVs₁ hT true false have hh : childEnergy p hp hcop hg pool Ψ₁ m T V₁ X true false a 0 ≤ B := (div_le_iff₀ hXF).mp h exact hh.trans (le_mul_of_one_le_right hB (one_le_pow₀ (by linarith [norm_nonneg a]))) have h₂ (a : ℝ) : childEnergy p hp hcop hg pool Ψ₂ m T V₂ X false true a 0 ≤ B*(1+‖a‖)^(2*J) := by have h := childEnergy_elementary_normalized p hp hcop hg hc hinj pool Ψ₂ hΨ₂ m T V₂ X F K A M a 0 hX hF hK hA hM hV₂ hVs₂ hT false true have hh : childEnergy p hp hcop hg pool Ψ₂ m T V₂ X false true a 0 ≤ B := (div_le_iff₀ hXF).mp h exact hh.trans (le_mul_of_one_le_right hB (one_le_pow₀ (by linarith [norm_nonneg a]))) have hd := densityChildEnergy_polynomial_bound p hp hcop hg pool Ψ₁ Ψ₂ m T V₁ V₂ X X J B B hB hB h₁ h₂ rw [Real.mul_self_sqrt hB] at hd apply (div_le_iff₀ hXF).mpr convert hd using 1 <;> first | rfl | ((try dsimp [B]); ring) theorem childDensity_elementary_supported {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (hΨ₁ : ∀ a,‖Ψ₁ a‖ ≤ 1) (hΨ₂ : ∀ a,‖Ψ₂ a‖ ≤ 1) (m : O) (T : Finset (Ideal O × O)) (V₁ V₂ : ℝ → ℂ) (X F K A M : ℝ) (J : ℕ) (hX : 0 < X) (hF : 1 ≤ F) (hK : 1 ≤ K) (hA : 0 ≤ A) (hM : 0 ≤ M) (hscale : 1 ≤ X*Real.exp A) (hV₁ : ∀ s,‖V₁ s‖ ≤ M) (hV₂ : ∀ s,‖V₂ s‖ ≤ M) (hVs₁ : ∀ s,V₁ s ≠ 0 → |s| ≤ A) (hVs₂ : ∀ s,V₂ s ≠ 0 → |s| ≤ A) (hT : ∀ z∈T,z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ F ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ K) : densityChildEnergy p hp hcop hg pool Ψ₁ Ψ₂ m T V₁ V₂ X X (2*J)/(X*F) ≤ (6*128^4*(Real.exp A*M)^2*(∫ t : ℝ,FirstPassCubeLabels.firstLogDensity 0 t)^3)*K*X := by have h := childDensity_elementary_normalized p hp hcop hg hc hinj pool Ψ₁ Ψ₂ hΨ₁ hΨ₂ m T V₁ V₂ X F K A M J hX hF hK hA hM hV₁ hV₂ hVs₁ hVs₂ hT rw [max_eq_right hscale] at h convert h using 1 field_simp end SecondPassIntegration open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealMobiusDivisorSum def sourcePrincipalScale (M : ℝ) (I : Ideal O) : ℝ := Real.sqrt (M/(Ideal.absNorm I:ℝ)) variable {m n : Type} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] def maskedSourceDensity (G : Ideal O) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (M : ℝ) : ℂ := ∑ i, ∑ j, ∑ k, originalTerm rows cols cols a a 1 1 i j k * ((sourcePrincipalScale M (rows i):ℝ):ℂ)*primePoolDensity (G*(cols j*cols k)) def maskedPrincipalSourceSum (G : Ideal O) (W : 𝓢(ℝ,ℂ)) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (M : ℝ) : ℂ := ∑ i, ∑ j, ∑ k, originalTerm rows cols cols a a 1 1 i j k * ∑' z : O, rowCoprimeMask (fun P : primePool {G*(cols j*cols k)} => P.val) Finset.univ z * (if z=0 then 0 else W (‖eisEmbedding z‖^2/sourcePrincipalScale M (rows i))) def maskedSourcePrincipalTruncation (G : Ideal O) (W : 𝓢(ℝ,ℂ)) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (M : ℝ) (Z : m → ℝ) : ℂ := ∑ i, ∑ j, ∑ k, originalTerm rows cols cols a a 1 1 i j k * principalTruncation (fun P : primePool {G*(cols j*cols k)} => P.val) Finset.univ W (sourcePrincipalScale M (rows i)) (Z i) def maskedSourceErrorSum (G : Ideal O) (W : 𝓢(ℝ,ℂ)) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (M T : ℝ) : ℂ := ∑ i, ∑ j, ∑ k, originalTerm rows cols cols a a 1 1 i j k * truncationError (fun P : primePool {G*(cols j*cols k)} => P.val) Finset.univ W (sourcePrincipalScale M (rows i)) (sourcePrincipalScale M (rows i)/T) (T*sourcePrincipalScale M (rows i)) (T^4) omit [DecidableEq m] [DecidableEq n] in theorem maskedSourcePrincipalTruncation_eq (G : Ideal O) (hG : Squarefree G) (W : 𝓢(ℝ,ℂ)) (hW : W 0=0) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (M : ℝ) (Z : m → ℝ) (hcols : ∀ j, Admissible (cols j)) (hGc : ∀ j, IsCoprime G (cols j)) : maskedSourcePrincipalTruncation G W rows cols a M Z = paperRadialFourier W 0*maskedSourceDensity G rows cols a M - paperRadialFourier W 0*maskedPrincipalDivisorCorrection G rows cols cols a a M Z := by classical have ht (i : m) (j k : n) : originalTerm rows cols cols a a 1 1 i j k * principalTruncation (fun P : primePool {G*(cols j*cols k)} => P.val) Finset.univ W (sourcePrincipalScale M (rows i)) (Z i) = paperRadialFourier W 0*(originalTerm rows cols cols a a 1 1 i j k * ((sourcePrincipalScale M (rows i):ℝ):ℂ)*primePoolDensity (G*(cols j*cols k))) - paperRadialFourier W 0*(originalTerm rows cols cols a a 1 1 i j k * ∑ d ∈ idealDivisors (G*(cols j*cols k)), if Z i < (Ideal.absNorm d:ℝ) then (UniqueFactorizationMonoid.moebius d:ℂ)* ((sourcePrincipalScale M (rows i)/(Ideal.absNorm d:ℝ):ℝ):ℂ) else 0) := by by_cases hc : IsCoprime (cols j) (cols k) · have hC : Squarefree (cols j*cols k) := squarefree_mul_iff.mpr ⟨hc.isRelPrime,(hcols j).2.1,(hcols k).2.1⟩ have hprod : Squarefree (G*(cols j*cols k)) := squarefree_mul_iff.mpr ⟨((hGc j).mul_right (hGc k)).isRelPrime,hG,hC⟩ have hp := principalTruncation_scaled (G*(cols j*cols k)) hprod W 1 (sourcePrincipalScale M (rows i)) (Z i) simp only [Complex.ofReal_one,one_mul,hW,zero_mul,sub_zero] at hp rw [hp] ring · have hz : originalTerm rows cols cols a a 1 1 i j k=0 := by simp only [originalTerm,hc,ite_false] simp only [hz,zero_mul,mul_zero,sub_zero] unfold maskedSourcePrincipalTruncation simp_rw [ht] simp only [maskedSourceDensity,maskedPrincipalDivisorCorrection,sourcePrincipalScale,Finset.sum_sub_distrib,Finset.mul_sum] omit [DecidableEq m] [DecidableEq n] in theorem maskedPrincipalSourceSum_eq (G : Ideal O) (hG : Squarefree G) (W : 𝓢(ℝ,ℂ)) (hW : W 0=0) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (M T : ℝ) (hcols : ∀ j, Admissible (cols j)) (hGc : ∀ j, IsCoprime G (cols j)) : maskedPrincipalSourceSum G W rows cols a M = paperRadialFourier W 0*maskedSourceDensity G rows cols a M - paperRadialFourier W 0*maskedPrincipalDivisorCorrection G rows cols cols a a M (fun i => T*sourcePrincipalScale M (rows i)) + originalMaskedTruncatedMiddle G W rows cols cols a a M (fun i => sourcePrincipalScale M (rows i)/T) (fun i => T*sourcePrincipalScale M (rows i)) (T^4) + maskedSourceErrorSum G W rows cols a M T := by rw [←maskedSourcePrincipalTruncation_eq G hG W hW rows cols a M _ hcols hGc] unfold maskedPrincipalSourceSum maskedSourcePrincipalTruncation originalMaskedTruncatedMiddle maskedSourceErrorSum simp only [←Finset.sum_add_distrib] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ unfold truncationError sourcePrincipalScale ring end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson open TruncatedPrincipalPoisson IdealCoprimeSieveOperator theorem maskedSource_error_uniform (l : ℕ) : ∃ (s : Finset (ℕ×ℕ)) (C : ℝ), 0 truncationError (fun P : primePool {G*(cols j*cols k)} => P.val) Finset.univ W (sourcePrincipalScale M (rows i)) (sourcePrincipalScale M (rows i)/T) (T*sourcePrincipalScale M (rows i)) (T^4) have hs := (supportConstant_pos ε hε).le have hE : 0≤E := by dsimp only [E]; positivity have herr (i : m) (j k : n) : ‖error i j k‖≤E := by have hi : 0<(Ideal.absNorm (rows i):ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun h => (hrows i).1 (Ideal.absNorm_eq_zero_iff.mp h)) have hX : 0 T*sourcePrincipalScale M (rows i) let Y := fun i => sourcePrincipalScale M (rows i)/T have hT0 : 0≤T := by linarith have hsplit := maskedPrincipalSourceSum_eq G hG W hW rows cols a M T (fun j => (hcols j).1) hGc change maskedPrincipalSourceSum G W rows cols a M = paperRadialFourier W 0*maskedSourceDensity G rows cols a M - paperRadialFourier W 0*maskedPrincipalDivisorCorrection G rows cols cols a a M Z + originalMaskedTruncatedMiddle G W rows cols cols a a M Y Z (T^4) + maskedSourceErrorSum G W rows cols a M T at hsplit have heq : maskedPrincipalSourceSum G W rows cols a M - paperRadialFourier W 0*maskedSourceDensity G rows cols a M = -(paperRadialFourier W 0*maskedPrincipalDivisorCorrection G rows cols cols a a M Z) + originalMaskedTruncatedMiddle G W rows cols cols a a M Y Z (T^4) + maskedSourceErrorSum G W rows cols a M T := by rw [hsplit]; ring have hl := hexp.masked_source_large_principal_sum deltaLoss hδ ε hε G hG.ne_zero B N M T hB hN hM (by linarith) rows cols cols hr hc hc hrows hcols hcols hGc hGc a a Z (fun _ => le_rfl) have hm := hexp.original_masked_truncated_middle deltaLoss hδ ε hε G hG B N M T hB hN hM hT0 rows cols cols hr hc hc hrows a a W Y Z (T^4) hcols hcols hGc hGc (fun _ => le_rfl) have he := herr ε hε G hG.ne_zero B N M T hB hN hM hT rows cols hr hc (fun i => ⟨(hrows i).1.1,(hrows i).2.2⟩) (fun j => ⟨(hcols j).1.1,(hcols j).2⟩) a W have hn := norm_four_correction_terms (paperRadialFourier W 0*maskedPrincipalDivisorCorrection G rows cols cols a a M Z) 0 (originalMaskedTruncatedMiddle G W rows cols cols a a M Y Z (T^4)) (maskedSourceErrorSum G W rows cols a M T) simp only [sub_zero,norm_zero,add_zero] at hn rw [heq] apply hn.trans rw [norm_mul] exact add_le_add (add_le_add (mul_le_mul_of_nonneg_left hl (norm_nonneg _)) hm) he lemma sourcePrincipalMajorant_nonneg {n : Type} [Fintype n] (s : Finset (ℕ×ℕ)) (C : ℝ) (hC : 0≤C) (l : ℕ) {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 I.val) cols a M - paperRadialFourier W 0*maskedSourceDensity G (fun I : S => I.val) cols a M = ∑ j : Fin (columnDyadicLength K+1), (maskedPrincipalSourceSum G W (fun I : divisorDyadicBin S K j => I.val) cols a M - paperRadialFourier W 0*maskedSourceDensity G (fun I : divisorDyadicBin S K j => I.val) cols a M) := by classical have h := sum_ideal_subtype_dyadic (A := ℂ) S K (fun I => maskedPrincipalSourceSum G W (fun _ : Unit => I) cols a M - paperRadialFourier W 0*maskedSourceDensity G (fun _ : Unit => I) cols a M) simpa only [maskedPrincipalSourceSum,maskedSourceDensity,originalTerm, Finset.mul_sum,←Finset.sum_sub_distrib,Fintype.sum_unique] using h theorem masked_source_principal_global (l : ℕ) : ∃ (s : Finset (ℕ×ℕ)) (C : ℝ), 0 I.val) cols a M - paperRadialFourier W 0*maskedSourceDensity G (fun I : S => I.val) cols a M‖ ≤ (columnDyadicLength K+1:ℕ)*sourcePrincipalMajorant s C l hexp deltaLoss hδ ε hε G (2*K) N M T a W := by obtain ⟨s,C,hC,hbound⟩ := masked_source_principal_difference l refine ⟨s,C,hC,?_⟩ intro n _ _ α hexp hα deltaLoss hδ ε hε G hG K N M T hK hN hM hT S hS cols hc hcols hGc a W hW classical let R := sourcePrincipalMajorant s C l hexp deltaLoss hδ ε hε G (2*K) N M T a W have hSnorm (I : Ideal O) (hI : I∈S) : 1≤(Ideal.absNorm I:ℝ) ∧ (Ideal.absNorm I:ℝ)≤K := by have hi := hS I hI refine ⟨?_,hi.2⟩ exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun h => hi.1.1 (Ideal.absNorm_eq_zero_iff.mp h)) have hR : 0≤R := sourcePrincipalMajorant_nonneg s C hC.le l hexp deltaLoss hδ ε hε G (2*K) N M T a W (by linarith) (by linarith) hM.le (by linarith) have hb (j : Fin (columnDyadicLength K+1)) : ‖maskedPrincipalSourceSum G W (fun I : divisorDyadicBin S K j => I.val) cols a M - paperRadialFourier W 0*maskedSourceDensity G (fun I : divisorDyadicBin S K j => I.val) cols a M‖ ≤ R := by by_cases hj : (divisorDyadicBin S K j).Nonempty · let B := 2*divisorDyadicScale j.val have hB : 1≤B := by dsimp only [B]; linarith [divisorDyadicScale_ge_one j.val] have hBK : B≤2*K := by dsimp only [B] exact mul_le_mul_of_nonneg_left (divisorDyadicBin_scale_le S K hSnorm j hj) (by norm_num) have hrows (I : divisorDyadicBin S K j) : Admissible I.val ∧ B/2≤(Ideal.absNorm I.val:ℝ) ∧ (Ideal.absNorm I.val:ℝ)≤B := by have hi := divisorDyadicBin_bounds S K hSnorm j I.val I.property refine ⟨(hS I.val (Finset.mem_filter.mp I.property).1).1,?_,hi.2⟩ dsimp only [B] linarith have hh := hbound hexp deltaLoss hδ ε hε G hG B N M T hB hN hM hT (fun I : divisorDyadicBin S K j => I.val) cols Subtype.val_injective hc hrows hcols hGc a W hW apply hh.trans exact sourcePrincipalMajorant_mono s C hC.le l hexp hα deltaLoss hδ ε hε G B (2*K) N M T a W (by linarith) hBK (by linarith) hM.le (by linarith) · have he := Finset.not_nonempty_iff_eq_empty.mp hj have : IsEmpty (divisorDyadicBin S K j) := by refine ⟨fun I => ?_⟩ have hi := I.property simp only [he,Finset.notMem_empty] at hi simpa only [maskedPrincipalSourceSum,maskedSourceDensity,Finset.univ_eq_empty, Finset.sum_empty,mul_zero,sub_zero,norm_zero] using hR rw [maskedPrincipalSourceDifference_dyadic G W S K cols a M] apply (norm_sum_le _ _).trans calc _ ≤ ∑ _j : Fin (columnDyadicLength K+1), R := Finset.sum_le_sum (fun j _ => hb j) _ = _ := by simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,R] end section open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum theorem primePoolDensity_eq_support (G : Ideal O) : primePoolDensity G = ∏ P ∈ primeSupport G, (1-(1:ℂ)/(Ideal.absNorm P:ℂ)) := by rw [primePoolDensity,Finset.prod_coe_sort (primePool {G}) (fun P : Ideal O => (1-(1:ℂ)/(Ideal.absNorm P:ℂ)))] simp [primePool,primeSupport] theorem primePoolDensity_eq_real (G : Ideal O) : primePoolDensity G = (idealPrimeDensity {G} G : ℂ) := by simp only [primePoolDensity,idealPrimeDensity,idealSupport_singleton_univ, Complex.ofReal_prod,Complex.ofReal_sub,Complex.ofReal_one, Complex.ofReal_div,Complex.ofReal_natCast] theorem primePoolDensity_norm_le_one (G : Ideal O) (hG : G ≠ 0) : ‖primePoolDensity G‖ ≤ 1 := by rw [primePoolDensity_eq_real,Complex.norm_real,Real.norm_eq_abs] have hb := idealPrimeDensity_mem_Icc {G} (by intro I hI; simpa only [Finset.mem_singleton.mp hI,Ideal.zero_eq_bot] using hG) G rw [abs_of_nonneg hb.1] exact hb.2 theorem primePoolDensity_star (G : Ideal O) : star (primePoolDensity G) = primePoolDensity G := by rw [primePoolDensity_eq_real] simp theorem primePoolDensity_mul (G H : Ideal O) (hG : G ≠ 0) (hH : H ≠ 0) (hcop : IsCoprime G H) : primePoolDensity (G*H) = primePoolDensity G*primePoolDensity H := by simp only [primePoolDensity_eq_support,primeSupport] rw [UniqueFactorizationMonoid.normalizedFactors_mul hG hH,Multiset.toFinset_add, Finset.prod_union] apply Finset.disjoint_left.mpr intro P hPG hPH exact (Multiset.disjoint_left.mp (UniqueFactorizationMonoid.disjoint_normalizedFactors hcop.isRelPrime)) (Multiset.mem_toFinset.mp hPG) (Multiset.mem_toFinset.mp hPH) theorem idealZeroMask_generator_eq_one (I G : Ideal O) (hcop : IsCoprime I G) : idealZeroMask I (idealGenerator G) = 1 := by apply if_neg rintro ⟨P,hP,hgen⟩ have hPG : P ∣ G := by apply Ideal.dvd_iff_le.mpr rw [← span_idealGenerator G] exact Ideal.span_le.mpr (Set.singleton_subset_iff.mpr hgen) exact (UniqueFactorizationMonoid.prime_of_normalized_factor P hP).not_isUnit (hcop.isRelPrime (UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors hP) hPG) theorem normalizedPairDensity_eq_primePoolDensity (I J G : Ideal O) (hI : IsCoprime I G) (hJ : IsCoprime J G) : normalizedPairDensity I J G = primePoolDensity G := by rw [normalizedPairDensity,primePoolDensity_eq_support] apply Finset.prod_congr rfl intro P hP have hPG : P ∣ G := UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors (Multiset.mem_toFinset.mp hP) rw [idealZeroMask_generator_eq_one I P (hI.of_isCoprime_of_dvd_right hPG), idealZeroMask_generator_eq_one J P (hJ.of_isCoprime_of_dvd_right hPG),one_mul] end open ActualEisensteinCubic def densityColumn {n : Type*} (cols : n → Ideal O) (a : n → ℂ) : n → ℂ := fun j => primePoolDensity (cols j) * a j theorem densityColumn_norm_le {n : Type*} (cols : n → Ideal O) (a : n → ℂ) (hcols : ∀ j, cols j ≠ 0) (j : n) : ‖densityColumn cols a j‖ ≤ ‖a j‖ := by rw [densityColumn,norm_mul] exact (mul_le_mul_of_nonneg_right (primePoolDensity_norm_le_one _ (hcols j)) (norm_nonneg _)).trans_eq (one_mul _) theorem densityColumn_energy_le {n : Type*} [Fintype n] (cols : n → Ideal O) (a : n → ℂ) (hcols : ∀ j, cols j ≠ 0) : (∑ j, ‖densityColumn cols a j‖^2) ≤ ∑ j, ‖a j‖^2 := by apply Finset.sum_le_sum intro j _ exact pow_le_pow_left₀ (norm_nonneg _) (densityColumn_norm_le cols a hcols j) 2 theorem actualPrincipalDifference_densityColumn {n : Type*} [Fintype n] (cols : n → Ideal O) (a : n → ℂ) (G : Ideal O) (K : ℝ) (hcols : ∀ j, cols j ≠ 0) (hcop : ∀ j, IsCoprime (cols j) G) : actualPrincipalDifference cols (densityColumn cols a) G K = (∑ j, ∑ k, if IsCoprime (cols j) (cols k) then star (a j)*a k*primePoolDensity (cols j*cols k)* (normalizedPairPartial (cols j) (cols k) K * normalizedPairDivisors (cols j) (cols k) G) else 0) - primePoolDensity G * (∑ j, ∑ k, if IsCoprime (cols j) (cols k) then star (a j)*a k*primePoolDensity (cols j*cols k)* normalizedPairCoprimePartial (cols j) (cols k) G K else 0) := by unfold actualPrincipalDifference rw [Finset.mul_sum,← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro j _ rw [Finset.mul_sum,← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro k _ by_cases hjk : IsCoprime (cols j) (cols k) · simp only [hjk,ite_true,densityColumn,star_mul,primePoolDensity_star, primePoolDensity_mul _ _ (hcols j) (hcols k) hjk, normalizedPairDensity_eq_primePoolDensity _ _ _ (hcop j) (hcop k)] ring · simp only [hjk,ite_false,mul_zero,sub_self] open ActualEisensteinCubic ConcretePrimeRowBridge CompletedGauss IdealMobiusDivisorSum def densityPairSum {n : Type} [Fintype n] (cols : n → Ideal O) (a : n → ℂ) (P : Ideal O → Ideal O → ℂ) : ℂ := ∑ j, ∑ k, if IsCoprime (cols j) (cols k) then star (a j)*a k*primePoolDensity (cols j*cols k)*P (cols j) (cols k) else 0 theorem unrestrictedPrincipalDensity_eq {m n : Type} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (R : ℝ) (hR : 0 ≤ R) : unrestrictedPrincipalDensity rows cols cols a a R = (Real.sqrt R : ℂ)*densityPairSum cols a (fun I J => ∑ i, normalizedIdealPair I J (rows i)) := by unfold unrestrictedPrincipalDensity rw [Finset.sum_comm] simp only [densityPairSum,Finset.mul_sum] apply Finset.sum_congr rfl intro j _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro k _ by_cases hc : IsCoprime (cols j) (cols k) · simp only [unrestrictedPairTerm,hc,ite_true,Finset.mul_sum] apply Finset.sum_congr rfl intro i _ rw [Real.sqrt_div hR] simp only [Complex.ofReal_div,normalizedIdealPair] ring · simp only [unrestrictedPairTerm,hc,ite_false,zero_mul,mul_zero,Finset.sum_const_zero] theorem unrestrictedPrincipalDensity_squarefree {n : Type} [Fintype n] [DecidableEq n] (cols : n → Ideal O) (a : n → ℂ) (R K : ℝ) (hR : 0 ≤ R) : unrestrictedPrincipalDensity (fun I : squarefreeIdealRange K => I.val) cols cols a a R = (Real.sqrt R : ℂ)*densityPairSum cols a (fun I J => normalizedPairPartial I J K) := by simpa only [normalizedPairPartial] using unrestrictedPrincipalDensity_eq (fun I : squarefreeIdealRange K => I.val) cols a R hR theorem originalTerm_one_eq_unrestricted {m n : Type} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (hrows : ∀ i, Supported (rows i)) (hcols : ∀ j, Admissible (cols j)) (hray : ∀ j k, columnRay (cols j)=columnRay (cols k)) (i : m) (j k : n) : originalTerm rows cols cols a a 1 1 i j k = unrestrictedPairTerm rows cols cols a a i j k := by by_cases hc : IsCoprime (cols j) (cols k) · simp only [originalTerm,unrestrictedPairTerm,hc,ite_true,one_dvd,star_mul, canonical_quadraticRow_star _ (hcols j), unrestrictedPairCharacter_eq_primary _ _ (hcols j) (hcols k) (hray j k) _ (hrows i)] ring · simp only [originalTerm,unrestrictedPairTerm,hc,ite_false] theorem maskedSourceDensity_eq {m n : Type} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] (G : Ideal O) (hG : G ≠ 0) (rows : m → Ideal O) (cols : n → Ideal O) (a : n → ℂ) (M : ℝ) (hrows : ∀ i, Supported (rows i)) (hcols : ∀ j, Admissible (cols j)) (hray : ∀ j k, columnRay (cols j)=columnRay (cols k)) (hGc : ∀ j, IsCoprime G (cols j)) : maskedSourceDensity G rows cols a M = primePoolDensity G*unrestrictedPrincipalDensity rows cols cols a a M := by simp only [maskedSourceDensity,unrestrictedPrincipalDensity,Finset.mul_sum,sourcePrincipalScale] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ rw [originalTerm_one_eq_unrestricted rows cols a hrows hcols hray] by_cases hc : IsCoprime (cols j) (cols k) · rw [primePoolDensity_mul G (cols j*cols k) hG (mul_ne_zero (hcols j).1 (hcols k).1) ((hGc j).mul_right (hGc k))] ring · simp only [unrestrictedPairTerm,hc,ite_false,zero_mul,mul_zero] theorem maskedSourceDensity_coprime_squarefree {n : Type} [Fintype n] [DecidableEq n] (G : Ideal O) (hG : G ≠ 0) (K M : ℝ) (hM : 0 ≤ M) (cols : n → Ideal O) (a : n → ℂ) (hcols : ∀ j, Admissible (cols j)) (hray : ∀ j k, columnRay (cols j)=columnRay (cols k)) (hGc : ∀ j, IsCoprime G (cols j)) (hbad : ∀ P ∈ fixedBadPrimes, P ∣ G) : maskedSourceDensity G (fun I : coprimeSquarefreeRange G K => I.val) cols a M = (Real.sqrt M : ℂ)*primePoolDensity G* densityPairSum cols a (fun I J => normalizedPairCoprimePartial I J G K) := by rw [maskedSourceDensity_eq G hG _ cols a M] · rw [unrestrictedPrincipalDensity_eq _ _ _ _ hM] unfold normalizedPairCoprimePartial ring · intro I exact admissible_supported ((mem_idealRange.mp (coprimeSquarefreeRange_subset_idealRange G hbad K I.property)).1) · exact hcols · exact hray · exact hGc end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.CuspCoercivity namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum theorem unrestrictedPrincipalDensity_twisted_squarefree {n : Type} [Fintype n] [DecidableEq n] (cols : n → Ideal O) (a : n → ℂ) (q : Ideal O) (M K : ℝ) (hM : 0 ≤ M) (hcols : ∀ j, Admissible (cols j)) : unrestrictedPrincipalDensity (fun I : squarefreeIdealRange K => I.val) cols cols (fun j => a j*quadraticRow (cols j) (idealGenerator q)) (fun j => a j*quadraticRow (cols j) (idealGenerator q)) (M/(Ideal.absNorm q:ℝ)) = (Real.sqrt M : ℂ)*densityPairSum cols a (fun I J => normalizedPairPartial I J K*normalizedIdealPair I J q) := by rw [unrestrictedPrincipalDensity_squarefree _ _ _ _ (by positivity),Real.sqrt_div hM] simp only [densityPairSum,Finset.mul_sum] apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ by_cases hc : IsCoprime (cols j) (cols k) · simp only [hc,ite_true,star_mul,canonical_quadraticRow_star _ (hcols j), normalizedIdealPair,unrestrictedPairCharacter,Complex.ofReal_div] ring · simp only [hc,ite_false,mul_zero] theorem densityPairSum_weighted_sum {n : Type} [Fintype n] (cols : n → Ideal O) (a : n → ℂ) {ι : Type*} (S : Finset ι) (c : ι → ℂ) (P : Ideal O → Ideal O → ℂ) (Q : ι → Ideal O → Ideal O → ℂ) : (∑ q ∈ S, c q*densityPairSum cols a (fun I J => P I J*Q q I J)) = densityPairSum cols a (fun I J => P I J*∑ q ∈ S, c q*Q q I J) := by simp only [densityPairSum,Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro k _ by_cases hc : IsCoprime (cols j) (cols k) · simp only [hc,ite_true] apply Finset.sum_congr rfl intro q hq ring · simp only [hc,ite_false,mul_zero,Finset.sum_const_zero] theorem summed_dual_density {n : Type} [Fintype n] [DecidableEq n] (cols : n → Ideal O) (a : n → ℂ) (G : Ideal O) (M K : ℝ) (hM : 0 ≤ M) (hcols : ∀ j, Admissible (cols j)) : (∑ q ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius q:ℂ)* unrestrictedPrincipalDensity (fun I : squarefreeIdealRange K => I.val) cols cols (fun j => a j*quadraticRow (cols j) (idealGenerator q)) (fun j => a j*quadraticRow (cols j) (idealGenerator q)) (M/(Ideal.absNorm q:ℝ))) = (Real.sqrt M : ℂ)*densityPairSum cols a (fun I J => normalizedPairPartial I J K*normalizedPairDivisors I J G) := by simp_rw [unrestrictedPrincipalDensity_twisted_squarefree cols a _ M K hM hcols] calc _ = (Real.sqrt M : ℂ)*∑ q ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius q:ℂ)* densityPairSum cols a (fun I J => normalizedPairPartial I J K*normalizedIdealPair I J q) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro q hq ring _ = _ := by rw [densityPairSum_weighted_sum] rfl theorem actual_source_dual_density_cancellation {n : Type} [Fintype n] [DecidableEq n] (cols : n → Ideal O) (a : n → ℂ) (G : Ideal O) (hG : G ≠ 0) (M K : ℝ) (hM : 0 ≤ M) (hcols : ∀ j, Admissible (cols j)) (hray : ∀ j k, columnRay (cols j)=columnRay (cols k)) (hGc : ∀ j, IsCoprime G (cols j)) (hbad : ∀ P ∈ fixedBadPrimes, P ∣ G) : (∑ q ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius q:ℂ)* unrestrictedPrincipalDensity (fun I : squarefreeIdealRange K => I.val) cols cols (fun j => a j*quadraticRow (cols j) (idealGenerator q)) (fun j => a j*quadraticRow (cols j) (idealGenerator q)) (M/(Ideal.absNorm q:ℝ))) - maskedSourceDensity G (fun I : coprimeSquarefreeRange G K => I.val) cols a M = (Real.sqrt M : ℂ)*actualPrincipalDifference cols (densityColumn cols a) G K := by rw [summed_dual_density cols a G M K hM hcols, maskedSourceDensity_coprime_squarefree G hG K M hM cols a hcols hray hGc hbad, actualPrincipalDifference_densityColumn cols a G K (fun j => (hcols j).1) (fun j => (hGc j).symm)] change _ = (Real.sqrt M:ℂ)*(densityPairSum cols a (fun I J => normalizedPairPartial I J K*normalizedPairDivisors I J G) - primePoolDensity G*densityPairSum cols a (fun I J => normalizedPairCoprimePartial I J G K)) ring end CanonicalQuadraticSieve open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace ENNReal abbrev CuspChartCoordinates := (ℝ×ℝ)×ℝ def cuspBaseArea : Measure (ℝ×ℝ) := volume.restrict cuspRectangle def cuspChartVolume (a : ℝ) : Measure CuspChartCoordinates := (cuspBaseArea.prod (volume.restrict (Set.Ioi a))).withDensity (fun q => ENNReal.ofReal ((q.2^3)⁻¹)) abbrev CuspChartL2 (a : ℝ) := Lp ℂ 2 (cuspChartVolume a) example (a : ℝ) : InnerProductSpace ℂ (CuspChartL2 a) := inferInstance example (a : ℝ) : CompleteSpace (CuspChartL2 a) := inferInstance end section open Filter MeasureTheory open scoped BigOperators Classical Topology ENNReal lemma cusp_height_volume (a : ℝ) (ha : 0 (v^3)⁻¹) (Set.Ioi a) volume := by simpa only [show (-3:ℝ)=-(3:ℕ) by norm_num,Real.rpow_neg_natCast,zpow_neg, zpow_natCast] using (integrableOn_Ioi_rpow_of_lt (by norm_num : (-3:ℝ) < -1) ha) have hn : 0≤ᵐ[volume.restrict (Set.Ioi a)] (fun v : ℝ => (v^3)⁻¹) := by filter_upwards [ae_restrict_mem measurableSet_Ioi] with v hv exact inv_nonneg.mpr (pow_nonneg (ha.trans hv).le 3) rw [←ofReal_integral_eq_lintegral_ofReal hi hn] congr 1 have he := integral_Ioi_rpow_of_lt (by norm_num : (-3:ℝ) < -1) ha norm_num only at he simp only [show (-3:ℝ)=-(3:ℕ) by norm_num,Real.rpow_neg_natCast,zpow_neg, zpow_natCast] at he rw [he] norm_num [show (-3:ℝ)+1=-2 by norm_num] ring end open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace ENNReal ContDiff end CubicEisenstein open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge CompletedGauss open EisensteinSchwartzPoisson GaussGeneratorTransport UnrestrictedIdealReindex IdealMobiusDivisorSum theorem commonMaskIdeal_primeSupport (D : Ideal O) : IdealMobiusDivisorSum.primeSupport (commonMaskIdeal D) = gcdMaskPrimes D := by have hp : ∀ P ∈ (gcdMaskPrimes D).val, Prime P := by intro P hP let : P.IsMaximal := gcdMaskPrimes_maximal D ⟨P,hP⟩ exact Ideal.prime_of_isPrime (NeZero.ne P) inferInstance have hf : UniqueFactorizationMonoid.normalizedFactors (commonMaskIdeal D) = (gcdMaskPrimes D).val := by simpa [commonMaskIdeal] using UniqueFactorizationMonoid.normalizedFactors_prod_of_prime hp rw [IdealMobiusDivisorSum.primeSupport,hf,Finset.val_toFinset] theorem commonMask_subset_sum_eq_divisors (D : Ideal O) (f : Ideal O → ℂ) : (∑ E ∈ (Finset.univ : Finset (gcdMaskPrimes D)).powerset, f (∏ P ∈ E, P.val)) = ∑ q ∈ idealDivisors (commonMaskIdeal D), f q := by rw [sum_subtype_powerset_products,← commonMaskIdeal_primeSupport D] exact (squarefree_divisor_sum_eq_support _ (commonMaskIdeal_squarefree D) f).symm theorem primaryProduct_norm (I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) : ‖eisEmbedding (primaryGenerator I*primaryGenerator J)‖ = Real.sqrt ((Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)) := by have hs : ‖eisEmbedding (primaryGenerator I*primaryGenerator J)‖^2 = (Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ) := by rw [map_mul,norm_mul,mul_pow, primaryGenerator_norm_sq I (supported_primaryGenerator_ne_zero I (admissible_supported hI)), primaryGenerator_norm_sq J (supported_primaryGenerator_ne_zero J (admissible_supported hJ))] rw [← hs,Real.sqrt_sq (norm_nonneg _)] def maskedPairIdealDualKernel (G I J : Ideal O) (W : ℝ → ℂ) (M : ℝ) : ℂ := ((M:ℂ)/(Real.sqrt ((Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)):ℂ))* ∑ q ∈ idealDivisors G, ((UniqueFactorizationMonoid.moebius q:ℂ)*unrestrictedPairCharacter I J q/(Ideal.absNorm q:ℂ))* ∑' B : NonzeroIdeal, unrestrictedPairCharacter I J B.val*paperRadialFourier W ((M/((Ideal.absNorm q:ℝ)*(Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)))*(Ideal.absNorm B.val:ℝ)) theorem originalPairIdealDualKernel_eq_divisors (D I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hDI : D ∣ I) (hDJ : D ∣ J) (W : ℝ → ℂ) (M : ℝ) : originalPairIdealDualKernel D I J W M = maskedPairIdealDualKernel (commonMaskIdeal D) (idealQuotient D I) (idealQuotient D J) W M := by let Q := idealQuotient D I let T := idealQuotient D J have hQ : Admissible Q := admissible_idealQuotient hI hDI have hT : Admissible T := admissible_idealQuotient hJ hDJ have hn := primaryProduct_norm Q T hQ hT have hnonneg : 0 ≤ (Ideal.absNorm Q:ℝ)*(Ideal.absNorm T:ℝ) := by positivity unfold originalPairIdealDualKernel maskedPairIdealDualKernel change ((M:ℂ)/(‖eisEmbedding (primaryGenerator Q*primaryGenerator T)‖:ℂ))*_ = ((M:ℂ)/(Real.sqrt ((Ideal.absNorm Q:ℝ)*(Ideal.absNorm T:ℝ)):ℂ))*_ rw [hn] congr 1 rw [← commonMask_subset_sum_eq_divisors D] apply Finset.sum_congr rfl intro E hE simp only [Real.sq_sqrt hnonneg,primeSubsetGenerator,unrestrictedPairCharacter, idealGenerator_norm_sq,Complex.ofReal_natCast] congr 1 apply tsum_congr intro B congr 2 ring theorem originalPairDualKernel_eq_divisors (D I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hDI : D ∣ I) (hDJ : D ∣ J) (hIJ : I ≠ J) (hray : columnRay I=columnRay J) (W : 𝓢(ℝ,ℂ)) (M : ℝ) (hM : 0 hI.1 (Ideal.absNorm_eq_zero_iff.mp hz)) have hNJ : 0<(Ideal.absNorm J:ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun hz => hJ.1 (Ideal.absNorm_eq_zero_iff.mp hz)) have hqpos (q : Ideal O) (hq : q ∈ idealDivisors G) : 0<(Ideal.absNorm q:ℝ) := by have hqG := (mem_idealDivisors hG).mp hq have hq0 : q ≠ 0 := by intro hz; rw [hz,zero_dvd_iff] at hqG; exact hG hqG exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun hz => hq0 (Ideal.absNorm_eq_zero_iff.mp hz)) have hpoint (q : Ideal O) (hq : q ∈ idealDivisors G) : ((M:ℂ)/(Real.sqrt ((Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)):ℂ))* (((UniqueFactorizationMonoid.moebius q:ℂ)*unrestrictedPairCharacter I J q/(Ideal.absNorm q:ℂ))* ∑' B : NonzeroIdeal, unrestrictedPairCharacter I J B.val*paperRadialFourier W ((M/((Ideal.absNorm q:ℝ)*(Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)))*(Ideal.absNorm B.val:ℝ))) = (UniqueFactorizationMonoid.moebius q:ℂ)*unrestrictedPairCharacter I J q* retainedDualPair I J (quadraticTransformedSquareProfile W) M (Ideal.absNorm q:ℝ) K + ((M:ℂ)/(Real.sqrt ((Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)):ℂ))* (((UniqueFactorizationMonoid.moebius q:ℂ)*unrestrictedPairCharacter I J q/(Ideal.absNorm q:ℂ))* dualSquarefreeTail I J W (M/((Ideal.absNorm q:ℝ)*(Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ))) K) := by have hqN := hqpos q hq have ht : 0 < M/((Ideal.absNorm q:ℝ)*(Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)) := by positivity rw [dual_ideal_low_add_tail I J W _ K ht,dualSquarefreeLow_principal_finite I J hI hJ hray W _ K ht, mul_add,mul_add] congr 1 simp only [retainedDualPair,Finset.mul_sum] apply Finset.sum_congr rfl intro B _ have hB : 0<(Ideal.absNorm B.val:ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun hz => (mem_squarefreeIdealRange.mp B.property).1.ne_zero (Ideal.absNorm_eq_zero_iff.mp hz)) have harg : (1:ℝ)/((M/((Ideal.absNorm q:ℝ)*(Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)))*(Ideal.absNorm B.val:ℝ)) = (Ideal.absNorm q:ℝ)*(Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)/(M*(Ideal.absNorm B.val:ℝ)) := by field_simp rw [harg] push_cast ring unfold maskedPairIdealDualKernel maskedPairDualTail rw [Finset.mul_sum,Finset.mul_sum,← Finset.sum_add_distrib] exact Finset.sum_congr rfl hpoint end section open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum EisensteinSchwartzPoisson theorem retainedDualPrincipalSum_pair_expansion {n : Type} [Fintype n] [DecidableEq n] (W : 𝓢(ℝ,ℂ)) (cols : n → Ideal O) (a : n → ℂ) (M F K : ℝ) : retainedDualPrincipalSum W (fun I : squarefreeIdealRange K => I.val) cols a M F = ∑ j, ∑ k, if IsCoprime (cols j) (cols k) then star (a j)*a k*retainedDualPair (cols j) (cols k) W M F K else 0 := by unfold retainedDualPrincipalSum rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro k _ by_cases hc : IsCoprime (cols j) (cols k) · simp only [unrestrictedPairTerm,retainedDualPair,hc,ite_true,Finset.mul_sum] apply Finset.sum_congr rfl intro B _ ring · simp only [unrestrictedPairTerm,hc,ite_false,zero_mul,Finset.sum_const_zero] theorem retainedDualPrincipalSum_twist_expansion {n : Type} [Fintype n] [DecidableEq n] (W : 𝓢(ℝ,ℂ)) (cols : n → Ideal O) (a : n → ℂ) (M F K : ℝ) (q : Ideal O) (hcols : ∀ j, Admissible (cols j)) : retainedDualPrincipalSum W (fun I : squarefreeIdealRange K => I.val) cols (fun j => a j*quadraticRow (cols j) (idealGenerator q)) M F = ∑ j, ∑ k, if IsCoprime (cols j) (cols k) then star (a j)*a k*unrestrictedPairCharacter (cols j) (cols k) q* retainedDualPair (cols j) (cols k) W M F K else 0 := by rw [retainedDualPrincipalSum_pair_expansion] apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ by_cases hc : IsCoprime (cols j) (cols k) · simp only [hc,ite_true,star_mul,canonical_quadraticRow_star _ (hcols j),unrestrictedPairCharacter] ring · simp only [hc,ite_false] def maskedDualFamily {n : Type} [Fintype n] (G : Ideal O) (cols : n → Ideal O) (a : n → ℂ) (W : 𝓢(ℝ,ℂ)) (M : ℝ) : ℂ := ∑ j, ∑ k, if IsCoprime (cols j) (cols k) then star (a j)*a k*maskedPairIdealDualKernel G (cols j) (cols k) W M else 0 def maskedDualTailFamily {n : Type} [Fintype n] (G : Ideal O) (cols : n → Ideal O) (a : n → ℂ) (W : 𝓢(ℝ,ℂ)) (M K : ℝ) : ℂ := ∑ j, ∑ k, if IsCoprime (cols j) (cols k) then star (a j)*a k*maskedPairDualTail G (cols j) (cols k) W M K else 0 theorem maskedDualFamily_retained {n : Type} [Fintype n] [DecidableEq n] (G : Ideal O) (hG : G ≠ 0) (cols : n → Ideal O) (a : n → ℂ) (W : 𝓢(ℝ,ℂ)) (M K : ℝ) (hM : 0 I.val) cols (fun j => a j*quadraticRow (cols j) (idealGenerator q)) M (Ideal.absNorm q:ℝ)) + maskedDualTailFamily G cols a W M K := by have hp (j k : n) : (if IsCoprime (cols j) (cols k) then star (a j)*a k*maskedPairIdealDualKernel G (cols j) (cols k) W M else 0) = (∑ q ∈ idealDivisors G, (UniqueFactorizationMonoid.moebius q:ℂ)* (if IsCoprime (cols j) (cols k) then star (a j)*a k*unrestrictedPairCharacter (cols j) (cols k) q* retainedDualPair (cols j) (cols k) (quadraticTransformedSquareProfile W) M (Ideal.absNorm q:ℝ) K else 0)) + (if IsCoprime (cols j) (cols k) then star (a j)*a k*maskedPairDualTail G (cols j) (cols k) W M K else 0) := by by_cases hc : IsCoprime (cols j) (cols k) · simp only [hc,ite_true,maskedPairIdealDualKernel_retained G (cols j) (cols k) hG (hcols j) (hcols k) (hray j k) W M K hM,mul_add,Finset.mul_sum] congr 1 apply Finset.sum_congr rfl intro q hq ring · simp only [hc,ite_false,mul_zero,Finset.sum_const_zero,add_zero] simp only [maskedDualFamily,hp,Finset.sum_add_distrib,maskedDualTailFamily] congr 1 simp_rw [Finset.sum_comm (s := (Finset.univ : Finset n)) (t := idealDivisors G)] apply Finset.sum_congr rfl intro q hq rw [retainedDualPrincipalSum_twist_expansion _ cols a _ _ _ q hcols] simp only [Finset.mul_sum] end section open ActualEisensteinCubic ConcreteTraceCRT ConcretePrimeRowBridge EisensteinSchwartzPoisson CompletedGauss open IdealMobiusDivisorSum theorem normalizedFactors_commonMaskIdeal (D : Ideal O) : UniqueFactorizationMonoid.normalizedFactors (commonMaskIdeal D) = (gcdMaskPrimes D).val := by have hp (P : Ideal O) (hP : P∈(gcdMaskPrimes D).val) : Prime P := by let : P.IsMaximal := gcdMaskPrimes_maximal D ⟨P,hP⟩ exact Ideal.prime_of_isPrime (NeZero.ne P) inferInstance have h := UniqueFactorizationMonoid.normalizedFactors_prod_of_prime hp simpa only [commonMaskIdeal,Finset.prod_val,id_eq] using h theorem idealZeroMask_commonMaskIdeal (D : Ideal O) (z : O) : idealZeroMask (commonMaskIdeal D) z = rowCoprimeMask (fun P : gcdMaskPrimes D => P.val) Finset.univ z := by classical simp only [idealZeroMask,normalizedFactors_commonMaskIdeal,rowCoprimeMask, Finset.mem_univ,true_and,Subtype.exists,exists_prop,Finset.mem_val] lemma idealZeroMask_idempotent (D : Ideal O) (z : O) : idealZeroMask D z*idealZeroMask D z=idealZeroMask D z := by classical unfold idealZeroMask split_ifs <;> norm_num theorem idealZeroMask_generator_eq_indicator (D B : Ideal O) (hD : D≠0) : idealZeroMask D (idealGenerator B) = if IsCoprime B D then 1 else 0 := by classical by_cases hc : IsCoprime B D · rw [if_pos hc,idealZeroMask_generator_eq_one D B hc.symm] · rw [if_neg hc] apply if_pos by_contra hn apply hc apply IsCoprime.symm apply ideals_coprime_of_relprime apply (UniqueFactorizationMonoid.isRelPrime_iff_no_prime_factors hD).mpr intro P hPD hPB hp have hfac : P∈UniqueFactorizationMonoid.normalizedFactors D := (UniqueFactorizationMonoid.mem_normalizedFactors_iff hD).mpr ⟨hp,hPD⟩ have hgen : idealGenerator B∈P := by apply (Ideal.span_singleton_le_iff_mem P).mp rw [span_idealGenerator] exact Ideal.dvd_iff_le.mp hPB exact hn ⟨P,hfac,hgen⟩ theorem idealZeroMask_primary_eq_indicator (D B : Ideal O) (hD : D≠0) (hB : Supported B) : idealZeroMask D (primaryGenerator B) = if IsCoprime B D then 1 else 0 := by have he : Ideal.span {primaryGenerator B}=Ideal.span {idealGenerator B} := by rw [(primaryGenerator_spec B (supported_primaryGenerator_ne_zero B hB)).1,span_idealGenerator] rw [idealZeroMask_span_eq D _ _ he,idealZeroMask_generator_eq_indicator D B hD] theorem commonMask_primary_indicator (D B : Ideal O) (hB : Supported B) : idealZeroMask D (primaryGenerator B) = if IsCoprime B (commonMaskIdeal D) then 1 else 0 := by have he := idealZeroMask_commonMaskIdeal D (primaryGenerator B) rw [gcdMaskPrimes_mask,badPrime_mask_primaryGenerator,if_pos hB,one_mul] at he rw [←he,idealZeroMask_primary_eq_indicator _ B (commonMaskIdeal_squarefree D).ne_zero hB] theorem residual_joint_mask (D I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hDI : D∣I) (hDJ : D∣J) (z : O) : rowCoprimeMask (fun P : gcdMaskPrimes (I*J) => P.val) Finset.univ z = rowCoprimeMask (fun P : primePool {commonMaskIdeal D*(idealQuotient D I*idealQuotient D J)} => P.val) Finset.univ z := by have hD := admissible_of_dvd hI hDI have hIq := admissible_idealQuotient hI hDI have hJq := admissible_idealQuotient hJ hDJ have hi : idealZeroMask I z=idealZeroMask D z*idealZeroMask (idealQuotient D I) z := by calc _ = idealZeroMask (D*idealQuotient D I) z := congrArg (fun A => idealZeroMask A z) (idealQuotient_mul hDI).symm _ = _ := idealZeroMask_mul D _ hD.1 hIq.1 z have hj : idealZeroMask J z=idealZeroMask D z*idealZeroMask (idealQuotient D J) z := by calc _ = idealZeroMask (D*idealQuotient D J) z := congrArg (fun A => idealZeroMask A z) (idealQuotient_mul hDJ).symm _ = _ := idealZeroMask_mul D _ hD.1 hJq.1 z rw [gcdMaskPrimes_mask,singleton_rowCoprimeMask_eq_idealZeroMask, idealZeroMask_mul I J hI.1 hJ.1, idealZeroMask_mul (commonMaskIdeal D) _ (commonMaskIdeal_squarefree D).ne_zero (mul_ne_zero hIq.1 hJq.1), idealZeroMask_mul _ _ hIq.1 hJq.1,idealZeroMask_commonMaskIdeal,gcdMaskPrimes_mask,hi,hj] calc _ = (rowCoprimeMask badPrime Finset.univ z)*(idealZeroMask D z*idealZeroMask D z)* (idealZeroMask (idealQuotient D I) z*idealZeroMask (idealQuotient D J) z) := by ring _ = _ := by rw [idealZeroMask_idempotent] theorem lowPrincipalLattice_residual (D I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hDI : D∣I) (hDJ : D∣J) (W : 𝓢(ℝ,ℂ)) (X : ℝ) : lowPrincipalLattice I J W X = ∑' z : O, rowCoprimeMask (fun P : primePool {commonMaskIdeal D*(idealQuotient D I*idealQuotient D J)} => P.val) Finset.univ z * (if z=0 then 0 else quadraticSquareProfile W (‖eisEmbedding z‖^2/X)) := by unfold lowPrincipalLattice apply tsum_congr intro z by_cases hz : z=0 · subst z simp only [jointMask_zero,ite_true,mul_zero,zero_mul] · rw [if_neg hz,quadraticSquareProfile_apply,residual_joint_mask D I J hI hJ hDI hDJ] theorem idealRange_filter_coprime (G : Ideal O) (K : ℝ) (hbad : ∀ P∈fixedBadPrimes, P∣G) : (idealRange K).filter (fun B => IsCoprime B G)=coprimeSquarefreeRange G K := by classical ext B constructor · intro h obtain ⟨hb,hc⟩ := Finset.mem_filter.mp h have hB := mem_idealRange.mp hb exact Finset.mem_filter.mpr ⟨mem_squarefreeIdealRange.mpr ⟨hB.1.2.1,hB.2⟩,hc⟩ · intro h refine Finset.mem_filter.mpr ⟨?_,(Finset.mem_filter.mp h).2⟩ exact coprimeSquarefreeRange_subset_idealRange G hbad K h theorem sum_idealRange_coprime (G : Ideal O) (K : ℝ) (hbad : ∀ P∈fixedBadPrimes, P∣G) (f : Ideal O → ℂ) : (∑ B : idealRange K, if IsCoprime B.val G then f B.val else 0) = ∑ B : coprimeSquarefreeRange G K, f B.val := by classical rw [Finset.sum_coe_sort (idealRange K) (fun B => if IsCoprime B G then f B else 0), ←Finset.sum_filter,idealRange_filter_coprime G K hbad, Finset.sum_coe_sort (coprimeSquarefreeRange G K) f] def pairMaskedSquareSource (G I J : Ideal O) (W : 𝓢(ℝ,ℂ)) (M : ℝ) (B : Ideal O) : ℂ := (quadraticRow I (primaryGenerator B)*quadraticRow J (primaryGenerator B))* ∑' z : O, rowCoprimeMask (fun P : primePool {G*(I*J)} => P.val) Finset.univ z * (if z=0 then 0 else quadraticSquareProfile W (‖eisEmbedding z‖^2/sourcePrincipalScale M B)) theorem originalPairLow_residual_finite (D I J : Ideal O) (hI : Admissible I) (hJ : Admissible J) (hDI : D∣I) (hDJ : D∣J) (W : 𝓢(ℝ,ℂ)) (M K : ℝ) (hM : 0 fixedBadPrimes_dvd_commonMaskIdeal D P hP)] theorem originalLow_gcd_aggregate {n : Type} [Fintype n] [DecidableEq n] (D : Ideal O) (hD : D≠0) (cols : n → Ideal O) (hcols : ∀ j, Admissible (cols j)) (hdiv : ∀ j, D∣cols j) (a : n → ℂ) (W : 𝓢(ℝ,ℂ)) (M K : ℝ) (hM : 0 B.val) (fun j => idealQuotient D (cols j)) a M := by classical let S := coprimeSquarefreeRange (commonMaskIdeal D) K let q := fun j => idealQuotient D (cols j) have hq (j : n) : Admissible (q j) := admissible_idealQuotient (hcols j) (hdiv j) have ht (j k : n) : (if gcd (cols j) (cols k)=D then star (a j)*a k*(∑' lengthScale : Ideal O, originalPairLow (cols j) (cols k) W M K lengthScale) else 0) = (6:ℂ)⁻¹ * ∑ B : S, originalTerm (fun B : S => B.val) q q a a 1 1 B j k * ∑' z : O, rowCoprimeMask (fun P : primePool {commonMaskIdeal D*(q j*q k)} => P.val) Finset.univ z * (if z=0 then 0 else quadraticSquareProfile W (‖eisEmbedding z‖^2/sourcePrincipalScale M B.val)) := by have heq := gcd_eq_iff_quotient_coprime D (cols j) (cols k) hD (hdiv j) (hdiv k) by_cases hc : IsCoprime (q j) (q k) · rw [if_pos (heq.mpr hc),originalPairLow_residual_finite D _ _ (hcols j) (hcols k) (hdiv j) (hdiv k) W M K hM] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro B _ simp only [originalTerm,hc,ite_true,one_dvd,pairMaskedSquareSource,star_mul, canonical_quadraticRow_star _ (hq j)] dsimp only [q] ring · have hg : ¬gcd (cols j) (cols k)=D := fun h => hc (heq.mp h) simp only [hg,ite_false,originalTerm,hc,Finset.sum_const_zero,zero_mul,mul_zero] simp_rw [ht,Finset.mul_sum] simp_rw [Finset.sum_comm (s := (Finset.univ:Finset n)) (t := (Finset.univ:Finset S))] simp only [maskedPrincipalSourceSum,Finset.mul_sum,S,q,sourcePrincipalScale] end open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum EisensteinSchwartzPoisson theorem originalDual_gcd_aggregate {n : Type} [Fintype n] [DecidableEq n] (D : Ideal O) (hD : D≠0) (cols : n → Ideal O) (hcols : ∀ j, Admissible (cols j)) (hdiv : ∀ j, D∣cols j) (hproper : ∀ j, cols j≠D) (hray : ∀ j k, columnRay (cols j)=columnRay (cols k)) (a : n → ℂ) (W : 𝓢(ℝ,ℂ)) (M : ℝ) (hM : 0 idealQuotient D (cols j)) a W M := by unfold maskedDualFamily apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ have heq := gcd_eq_iff_quotient_coprime D (cols j) (cols k) hD (hdiv j) (hdiv k) by_cases hg : gcd (cols j) (cols k)=D · have hneq : cols j≠cols k := by intro h rw [← h] at hg exact hproper j (by simpa using hg) rw [if_pos hg,if_pos (heq.mp hg), originalPairDualKernel_eq_divisors D (cols j) (cols k) (hcols j) (hcols k) (hdiv j) (hdiv k) hneq (hray j k) W M hM] · rw [if_neg hg,if_neg (fun hc => hg (heq.mpr hc))] theorem originalHigh_gcd_principal_assembly {n : Type} [Fintype n] [DecidableEq n] (D : Ideal O) (hD : D≠0) (cols : n → Ideal O) (hcols : ∀ j, Admissible (cols j)) (hdiv : ∀ j, D∣cols j) (hproper : ∀ j, cols j≠D) (hray : ∀ j k, columnRay (cols j)=columnRay (cols k)) (a : n → ℂ) (W : 𝓢(ℝ,ℂ)) (M K : ℝ) (hM : 0 I.val) (fun j => idealQuotient D (cols j)) (fun j => a j*quadraticRow (idealQuotient D (cols j)) (idealGenerator q)) M (Ideal.absNorm q:ℝ)) + maskedDualTailFamily (commonMaskIdeal D) (fun j => idealQuotient D (cols j)) a W M K - (6:ℂ)⁻¹ * maskedPrincipalSourceSum (commonMaskIdeal D) (quadraticSquareProfile W) (fun B : coprimeSquarefreeRange (commonMaskIdeal D) K => B.val) (fun j => idealQuotient D (cols j)) a M := by have hsplit : (∑ j, ∑ k, if gcd (cols j) (cols k)=D then star (a j)*a k*(∑' lengthScale : Ideal O, originalPairHigh (cols j) (cols k) W M K lengthScale) else 0) = (∑ j, ∑ k, if gcd (cols j) (cols k)=D then star (a j)*a k*originalPairDualKernel D (cols j) (cols k) W M else 0) - (∑ j, ∑ k, if gcd (cols j) (cols k)=D then star (a j)*a k*(∑' lengthScale : Ideal O, originalPairLow (cols j) (cols k) W M K lengthScale) else 0) := by rw [← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro j _ rw [← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro k _ by_cases hg : gcd (cols j) (cols k)=D · rw [if_pos hg,if_pos hg,if_pos hg, originalPairHigh_eq_source_sub_low (cols j) (cols k) W M K hM, originalPairSource_poisson D (cols j) (cols k) (hcols j) (hcols k) hg (hray j k) W M hM] ring · simp only [hg,ite_false,sub_self] rw [hsplit,originalDual_gcd_aggregate D hD cols hcols hdiv hproper hray a W M hM, originalLow_gcd_aggregate D hD cols hcols hdiv a W M K hM, maskedDualFamily_retained _ (commonMaskIdeal_squarefree D).ne_zero _ a W M K hM (fun j => admissible_idealQuotient (hcols j) (hdiv j)) (fun j k => columnRay_idealQuotient_eq D (cols j) (cols k) (hcols j) (hcols k) (hdiv j) (hdiv k) (hray j k))] end section open scoped BigOperators Classical open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum theorem residual_commonMask_coprime (D I : Ideal O) (hI : Admissible I) (hDI : D∣I) : IsCoprime (commonMaskIdeal D) (idealQuotient D I) := by have hD := admissible_of_dvd hI hDI have hQ := admissible_idealQuotient hI hDI have hs : Squarefree (D*idealQuotient D I) := by rw [idealQuotient_mul hDI]; exact hI.2.1 have hrel := (squarefree_mul_iff.mp hs).1 have hG := (commonMaskIdeal_squarefree D).ne_zero apply ideals_coprime_of_relprime apply (UniqueFactorizationMonoid.isRelPrime_iff_no_prime_factors hG).mpr intro P hPG hPQ hp have hf : P∈UniqueFactorizationMonoid.normalizedFactors (commonMaskIdeal D) := (UniqueFactorizationMonoid.mem_normalizedFactors_iff hG).mpr ⟨hp,hPG⟩ rw [normalizedFactors_commonMaskIdeal] at hf have hmem : P∈fixedBadPrimes ∨ P∈primeSupport D := Finset.mem_union.mp hf rcases hmem with hbad | hPD · let : P.IsMaximal := (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero have hfac : P∈UniqueFactorizationMonoid.normalizedFactors (idealQuotient D I) := (UniqueFactorizationMonoid.mem_normalizedFactors_iff hQ.1).mpr ⟨hp,hPQ⟩ exact (prime_good_iff_not_bad P).mp (hQ.2.2 P hfac) hbad · have hd : P∣D := UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors (Multiset.mem_toFinset.mp hPD) exact hp.not_isUnit (hrel hd hPQ) theorem idealQuotient_norm_eq (D I : Ideal O) (hD : D≠0) (hDI : D∣I) : (Ideal.absNorm (idealQuotient D I):ℝ)=(Ideal.absNorm I:ℝ)/(Ideal.absNorm D:ℝ) := by have hn : (Ideal.absNorm D:ℝ)≠0 := by exact_mod_cast (show Ideal.absNorm D≠0 from fun h => hD (Ideal.absNorm_eq_zero_iff.mp h)) apply (eq_div_iff hn).mpr rw [mul_comm,←Nat.cast_mul,←map_mul,idealQuotient_mul hDI] theorem idealQuotient_shell (D I : Ideal O) (hD : D≠0) (hDI : D∣I) (N : ℝ) (hI : N/2≤(Ideal.absNorm I:ℝ) ∧ (Ideal.absNorm I:ℝ)≤N) : (N/(Ideal.absNorm D:ℝ))/2≤(Ideal.absNorm (idealQuotient D I):ℝ) ∧ (Ideal.absNorm (idealQuotient D I):ℝ)≤N/(Ideal.absNorm D:ℝ) := by have hn : 0<(Ideal.absNorm D:ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun h => hD (Ideal.absNorm_eq_zero_iff.mp h)) rw [idealQuotient_norm_eq D I hD hDI] constructor · calc _ = (N/2)/(Ideal.absNorm D:ℝ) := by ring _ ≤ _ := div_le_div_of_nonneg_right hI.1 hn.le · exact div_le_div_of_nonneg_right hI.2 hn.le end open scoped BigOperators Classical SchwartzMap open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum EisensteinSchwartzPoisson def gcdRaySupport {n : Type} [Fintype n] (cols : n → Ideal O) (a : n → ℂ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) : Finset n := Finset.univ.filter (fun j => D ∣ cols j ∧ columnRay (cols j)=c ∧ a j≠0) theorem mem_gcdRaySupport {n : Type} [Fintype n] (cols : n → Ideal O) (a : n → ℂ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (j : n) : j∈gcdRaySupport cols a D c ↔ D∣cols j ∧ columnRay (cols j)=c ∧ a j≠0 := by simp only [gcdRaySupport,Finset.mem_filter,Finset.mem_univ,true_and] theorem gcd_ray_pair_sum_restrict {n : Type} [Fintype n] (cols : n → Ideal O) (a : n → ℂ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (H : n → n → ℂ) : (∑ j, ∑ k, if gcd (cols j) (cols k)=D ∧ columnRay (cols j)=c ∧ columnRay (cols k)=c then star (a j)*a k*H j k else 0) = ∑ j : gcdRaySupport cols a D c, ∑ k : gcdRaySupport cols a D c, if gcd (cols j.val) (cols k.val)=D then star (a j.val)*a k.val*H j.val k.val else 0 := by classical let S := gcdRaySupport cols a D c let f := fun j k => if gcd (cols j) (cols k)=D ∧ columnRay (cols j)=c ∧ columnRay (cols k)=c then star (a j)*a k*H j k else 0 have hjzero (j : n) (hj : j∉S) (k : n) : f j k=0 := by dsimp only [f] split_ifs with h · have hz : a j=0 := by by_contra hn apply hj exact (mem_gcdRaySupport cols a D c j).mpr ⟨h.1 ▸ GCDMonoid.gcd_dvd_left (cols j) (cols k),h.2.1,hn⟩ simp only [hz,star_zero,zero_mul] · rfl have hkzero (k : n) (hk : k∉S) (j : n) : f j k=0 := by dsimp only [f] split_ifs with h · have hz : a k=0 := by by_contra hn apply hk exact (mem_gcdRaySupport cols a D c k).mpr ⟨h.1 ▸ GCDMonoid.gcd_dvd_right (cols j) (cols k),h.2.2,hn⟩ simp only [hz,mul_zero,zero_mul] · rfl have hleft : (∑ j∈S, ∑ k, f j k) = ∑ j, ∑ k, f j k := by apply Finset.sum_subset (Finset.subset_univ S) intro j _ hj exact Finset.sum_eq_zero (fun k _ => hjzero j hj k) change (∑ j, ∑ k, f j k)=_ rw [←hleft,←Finset.sum_coe_sort S (fun j => ∑ k, f j k)] apply Finset.sum_congr rfl intro j _ have hright : (∑ k∈S, f j.val k) = ∑ k, f j.val k := by apply Finset.sum_subset (Finset.subset_univ S) intro k _ hk exact hkzero k hk j.val rw [←hright,←Finset.sum_coe_sort S (fun k => f j.val k)] apply Finset.sum_congr rfl intro k _ have hj := (mem_gcdRaySupport cols a D c j.val).mp j.property have hk := (mem_gcdRaySupport cols a D c k.val).mp k.property simp only [f,hj.2.1,hk.2.1,and_true] theorem gcdRaySupport_quotient_properties (N X : ℝ) (a : idealRange N → ℂ) (ha : CoefficientOnShell N X a) (D : Ideal O) (hD : D≠0) (c : EisensteinEPrimaryPhase.Coord) : let cols := fun j : gcdRaySupport (fun I : idealRange N => I.val) a D c => idealQuotient D j.val.val Function.Injective cols ∧ (∀ j, Admissible (cols j) ∧ (X/(Ideal.absNorm D:ℝ))/2≤(Ideal.absNorm (cols j):ℝ) ∧ (Ideal.absNorm (cols j):ℝ)≤X/(Ideal.absNorm D:ℝ) ∧ IsCoprime (commonMaskIdeal D) (cols j)) ∧ (∀ j k, columnRay (cols j)=columnRay (cols k)) := by dsimp only have hp (j : gcdRaySupport (fun I : idealRange N => I.val) a D c) := (mem_gcdRaySupport (fun I : idealRange N => I.val) a D c j.val).mp j.property refine ⟨?_,?_,?_⟩ · intro j k hjk apply Subtype.ext apply Subtype.ext exact idealQuotient_injective_on D (hp j).1 (hp k).1 hjk · intro j have hadm := (mem_idealRange.mp j.val.property).1 have hshell := idealQuotient_shell D j.val.val hD (hp j).1 X ⟨(ha j.val (hp j).2.2).1.le,(ha j.val (hp j).2.2).2⟩ exact ⟨admissible_idealQuotient hadm (hp j).1,hshell.1,hshell.2, residual_commonMask_coprime D j.val.val hadm (hp j).1⟩ · intro j k exact columnRay_idealQuotient_eq D j.val.val k.val.val (mem_idealRange.mp j.val.property).1 (mem_idealRange.mp k.val.property).1 (hp j).1 (hp k).1 ((hp j).2.1.trans (hp k).2.1.symm) theorem gcdRaySupport_proper (N X : ℝ) (a : idealRange N → ℂ) (ha : CoefficientOnShell N X a) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) (hsmall : (Ideal.absNorm D:ℝ)≤X/2) (j : gcdRaySupport (fun I : idealRange N => I.val) a D c) : j.val.val≠D := by intro h have hp := (mem_gcdRaySupport (fun I : idealRange N => I.val) a D c j.val).mp j.property have hs := (ha j.val hp.2.2).1 rw [h] at hs exact (not_lt_of_ge hsmall) hs end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.HighKernelGeometry namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve open ActualEisensteinCubic theorem finite_inverse_norm_square_sum (S : Finset (Ideal O)) (H : ℝ) (hS : ∀ I ∈ S, I ≠ 0) (hH : ∀ I ∈ S, (Ideal.absNorm I : ℝ) ≤ H) : (∑ I ∈ S, 1/(Ideal.absNorm I : ℝ)^2) ≤ 1024 := by have hpos (I : Ideal O) (hI : I ∈ S) : 1 ≤ (Ideal.absNorm I : ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => hS I hI (Ideal.absNorm_eq_zero_iff.mp hz)) have hbin (j : Fin (columnDyadicLength H+1)) : (∑ I ∈ divisorDyadicBin S H j, 1/(Ideal.absNorm I : ℝ)^2) ≤ 512 * (1/(2:ℝ))^j.val := by have hp : 0 < (2:ℝ)^j.val := by positivity have hone : 1 ≤ (2:ℝ)^j.val := one_le_pow₀ (by norm_num) have hcount : ((divisorDyadicBin S H j).card : ℝ) ≤ 128 * (2:ℝ)^j.val := by apply DescentFiberCost.finite_ideal_count_real _ _ hone · intro I hI exact hS I (Finset.mem_filter.mp hI).1 · intro I hI obtain ⟨hIS,hj⟩ := Finset.mem_filter.mp hI have hb := (divisorDyadicLabel_bounds H I (hpos I hIS) (hH I hIS)).2 simpa only [hj] using hb have hterm (I : Ideal O) (hI : I ∈ divisorDyadicBin S H j) : 1/(Ideal.absNorm I : ℝ)^2 ≤ 4/((2:ℝ)^j.val)^2 := by obtain ⟨hIS,hj⟩ := Finset.mem_filter.mp hI have hb := (divisorDyadicLabel_bounds H I (hpos I hIS) (hH I hIS)).1 rw [hj] at hb have hni : 0 < (Ideal.absNorm I : ℝ) := lt_of_lt_of_le (by norm_num) (hpos I hIS) apply (div_le_div_iff₀ (sq_pos_of_pos hni) (sq_pos_of_pos hp)).mpr nlinarith calc _ ≤ ∑ _I ∈ divisorDyadicBin S H j, 4/((2:ℝ)^j.val)^2 := Finset.sum_le_sum hterm _ = ((divisorDyadicBin S H j).card : ℝ) * (4/((2:ℝ)^j.val)^2) := by simp _ ≤ (128 * (2:ℝ)^j.val) * (4/((2:ℝ)^j.val)^2) := by gcongr _ = 512 * (1/(2:ℝ))^j.val := by rw [div_pow,one_pow] field_simp ; ring rw [sum_divisorDyadicBins S H] calc _ ≤ ∑ j : Fin (columnDyadicLength H+1), 512 * (1/(2:ℝ))^j.val := Finset.sum_le_sum (fun j _ => hbin j) _ = 512 * ∑ j ∈ Finset.range (columnDyadicLength H+1), (1/(2:ℝ))^j := by rw [← Finset.mul_sum,Fin.sum_univ_eq_sum_range] _ ≤ 512 * 2 := mul_le_mul_of_nonneg_left (sum_geometric_two_le _) (by norm_num) _ = 1024 := by norm_num theorem highSquareParts_card_le (M K : ℝ) (_hM : 0 ≤ M) (hK : 0 < K) : ((highSquareParts M K).card : ℝ) ≤ 128 * Real.sqrt (M/K) := by by_cases hempty : highSquareParts M K = ∅ · simp only [hempty,Finset.card_empty,Nat.cast_zero] positivity · obtain ⟨A,hA⟩ := Finset.nonempty_iff_ne_empty.mpr hempty have hb := highSquareParts_bounds M K hK A hA apply DescentFiberCost.finite_ideal_count_real _ _ (hb.2.1.trans hb.2.2.1) · intro I hI exact (highSquareParts_bounds M K hK I hI).1.1 · intro I hI exact (highSquareParts_bounds M K hK I hI).2.2.1 theorem HasSieveExponent.high_kernel {α : ℝ} (h : HasSieveExponent α) : ∀ ε : ℝ, 0 < ε → ∃ C : ℝ, 0 < C ∧ ∀ M N K : ℝ, 1 ≤ M → 1 ≤ N → 1 ≤ K → highKernelNorm M N K ≤ C * (M*N)^ε * (M + Real.sqrt (M/K)*N^α) := by intro ε hε obtain ⟨C,hC,hbound⟩ := h ε hε refine ⟨1024*C,by positivity,?_⟩ intro M N K hM hN hK have hM0 : 0 ≤ M := by linarith have hN0 : 0 ≤ N := by linarith have hK0 : 0 < K := by linarith let S := highSquareParts M K have hrow (A : Ideal O) (hA : A ∈ S) : sieveNorm (M/(Ideal.absNorm A : ℝ)^2) N ≤ C*(M*N)^ε*(M/(Ideal.absNorm A : ℝ)^2 + N^α) := by have hb := highSquareParts_bounds M K hK0 A hA have hquot : M/(Ideal.absNorm A : ℝ)^2 ≤ M := div_le_self hM0 (by nlinarith [sq_nonneg ((Ideal.absNorm A : ℝ)-1)]) apply (hbound _ N hb.2.2.2 hN).trans gcongr have hsum : (∑ A ∈ S, 1/(Ideal.absNorm A : ℝ)^2) ≤ 1024 := by apply finite_inverse_norm_square_sum S (Real.sqrt (M/K)) · intro A hA exact (highSquareParts_bounds M K hK0 A hA).1.1 · intro A hA exact (highSquareParts_bounds M K hK0 A hA).2.2.1 have hcard : (S.card : ℝ) ≤ 128*Real.sqrt (M/K) := highSquareParts_card_le M K hM0 hK0 have hcoeff : 0 ≤ C*(M*N)^ε := by positivity have hpow : 0 ≤ N^α := Real.rpow_nonneg hN0 _ calc _ ≤ ∑ A ∈ S, sieveNorm (M/(Ideal.absNorm A : ℝ)^2) N := highKernelNorm_le_squarePart_sum M N K _ ≤ ∑ A ∈ S, C*(M*N)^ε*(M/(Ideal.absNorm A : ℝ)^2+N^α) := Finset.sum_le_sum hrow _ = C*(M*N)^ε*(M*(∑ A ∈ S, 1/(Ideal.absNorm A : ℝ)^2)+(S.card:ℝ)*N^α) := by simp only [← Finset.mul_sum,Finset.sum_add_distrib,Finset.sum_const,nsmul_eq_mul] congr 1 rw [Finset.mul_sum] congr 1 apply Finset.sum_congr rfl intro A hA ring _ ≤ C*(M*N)^ε*(M*1024+(128*Real.sqrt (M/K))*N^α) := by gcongr _ ≤ (1024*C)*(M*N)^ε*(M+Real.sqrt (M/K)*N^α) := by have hroot : 0 ≤ Real.sqrt (M/K)*N^α := mul_nonneg (Real.sqrt_nonneg _) hpow nlinarith [mul_nonneg hcoeff hroot] end CanonicalQuadraticSieve namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix def bottomRowUnitary (c d : ℂ) (r : ℝ) : Matrix (Fin 2) (Fin 2) ℂ := !![star d/(r:ℂ),-star c/(r:ℂ);c/(r:ℂ),d/(r:ℂ)] lemma bottomRowUnitary_mem (c d : ℂ) (r : ℝ) (hr : r≠0) (hrow : ‖c‖^2+‖d‖^2=r^2) : bottomRowUnitary c d r∈Matrix.unitaryGroup (Fin 2) ℂ := by have hC : c*star c+d*star d=(r:ℂ)^2 := by simpa only [Complex.ofReal_add,Complex.ofReal_pow,← Complex.mul_conj',Complex.star_def] using congrArg (fun x : ℝ => (x:ℂ)) hrow have hrC : (r:ℂ)≠0 := Complex.ofReal_ne_zero.mpr hr simp only [Complex.star_def] at hC rw [Matrix.mem_unitaryGroup_iff] ext i j fin_cases i <;> fin_cases j <;> simp [bottomRowUnitary,Matrix.mul_apply,Fin.sum_univ_two,Matrix.star_apply, Complex.conj_ofReal] <;> field_simp [hrC] <;> first | exact hC | (simpa only [mul_comm,add_comm] using hC) | ring lemma iwasawa_z_row_identities (a b c d : ℂ) (q : ℝ) (hq : q≠0) (hrow : (q:ℂ)=c*star c+d*star d) (hdet : a*d-b*c=1) : star d/(q:ℂ)+(a*star c+b*star d)/(q:ℂ)*c=a ∧ -star c/(q:ℂ)+(a*star c+b*star d)/(q:ℂ)*d=b := by have hqC : (q:ℂ)≠0 := Complex.ofReal_ne_zero.mpr hq constructor · field_simp [hqC] rw [hrow] linear_combination -(star d)*hdet · field_simp [hqC] rw [hrow] linear_combination (star c)*hdet def matrixHorizontal (g : SL(2,ℂ)) : ℂ := (g 0 0*star (g 1 0)+g 0 1*star (g 1 1))/(rowEnergy (complexBottomRow g):ℂ) lemma matrix_iwasawa_factor (g : SL(2,ℂ)) : ∃k : SL(2,ℂ), k∈compactSubgroup ∧ g=upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g)*k := by let q : ℝ := rowEnergy (complexBottomRow g) let r : ℝ := Real.sqrt q have hq : 0 fin_cases j <;> simp [B,upperSection,hroot,Complex.ofReal_inv,div_eq_mul_inv] have hfactor : (B:Matrix (Fin 2) (Fin 2) ℂ)*U=(g:Matrix (Fin 2) (Fin 2) ℂ) := by rw [hB] ext i j fin_cases i <;> fin_cases j all_goals simp only [Matrix.mul_apply,Fin.sum_univ_two] · change (r:ℂ)⁻¹*(star (g 1 1)/(r:ℂ))+(matrixHorizontal g*(r:ℂ))*(g 1 0/(r:ℂ))=g 0 0 calc _ = star (g 1 1)/(q:ℂ)+matrixHorizontal g*g 1 0 := by rw [← hqrC] field_simp [hrC] _ = _ := hz.1 · change (r:ℂ)⁻¹*(-star (g 1 0)/(r:ℂ))+(matrixHorizontal g*(r:ℂ))*(g 1 1/(r:ℂ))=g 0 1 calc _ = -star (g 1 0)/(q:ℂ)+matrixHorizontal g*g 1 1 := by rw [← hqrC] field_simp [hrC] _ = _ := hz.2 · change 0*(star (g 1 1)/(r:ℂ))+(r:ℂ)*(g 1 0/(r:ℂ))=g 1 0 field_simp [hrC] ; ring · change 0*(-star (g 1 0)/(r:ℂ))+(r:ℂ)*(g 1 1/(r:ℂ))=g 1 1 field_simp [hrC] ; ring let k : SL(2,ℂ) := B⁻¹*g have hk : (k:Matrix (Fin 2) (Fin 2) ℂ)=U := by change ((B⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ) * (g:Matrix (Fin 2) (Fin 2) ℂ)=U rw [← hfactor,← Matrix.mul_assoc] have hi : ((B⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ)*(B:Matrix (Fin 2) (Fin 2) ℂ)=1 := by simpa only [Matrix.SpecialLinearGroup.coe_mul,Matrix.SpecialLinearGroup.coe_one] using congrArg (fun M : SL(2,ℂ) => (M:Matrix (Fin 2) (Fin 2) ℂ)) (inv_mul_cancel B) rw [hi,Matrix.one_mul] refine ⟨k,?_,?_⟩ · change (k:Matrix (Fin 2) (Fin 2) ℂ)∈Matrix.unitaryGroup (Fin 2) ℂ rw [hk] exact bottomRowUnitary_mem _ _ r hr.ne' hrow · dsimp [k,B] group theorem upperPoint_surjective (w : HyperbolicSpace) : ∃z : ℂ, ∃v : ℝ, ∃hv : 0 obtain ⟨k,hk,hg⟩ := matrix_iwasawa_factor g refine ⟨matrixHorizontal g,liftedHeight g,liftedHeight_pos g,?_⟩ apply Quotient.sound apply QuotientGroup.leftRel_apply.mpr change (upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g))⁻¹*g∈compactSubgroup have hcancel : (upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g))⁻¹*g=k := by calc _ = (upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g))⁻¹* (upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g)*k) := congrArg (fun M => (upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g))⁻¹*M) hg _ = k := inv_mul_cancel_left _ _ rw [hcancel] exact hk end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT EisensteinEmbedding lemma eisEmbedding_range_closed : IsClosed (Set.range eisEmbedding) := by let : DiscreteTopology periodLattice := by unfold periodLattice; infer_instance have hc : IsClosed (periodLattice : Set ℂ) := AddSubgroup.isClosed_of_discreteTopology (U := periodLattice.toAddSubgroup) have heq : Set.range eisEmbedding=(fun z : ℂ => 3*z) ⁻¹' (periodLattice : Set ℂ) := by ext z constructor · rintro ⟨n,rfl⟩ exact three_embedding_mem n · intro hz obtain ⟨n,hn⟩ := periodPoint_bijective.2 ⟨3*z,hz⟩ refine ⟨n,?_⟩ have h := congrArg Subtype.val hn exact mul_left_cancel₀ (by norm_num : (3:ℂ)≠0) h rw [heq] exact hc.preimage (by fun_prop) lemma exists_nearest_eisenstein (z : ℂ) : ∃n : _root_.OAI.ActualEisensteinCubic.O, ∀m : _root_.OAI.ActualEisensteinCubic.O, ‖z-eisEmbedding n‖≤‖z-eisEmbedding m‖ := by obtain ⟨y,hy,heq⟩ := eisEmbedding_range_closed.exists_infDist_eq_dist (Set.range_nonempty eisEmbedding) z obtain ⟨n,rfl⟩ := hy refine ⟨n,fun m => ?_⟩ rw [← dist_eq_norm,← dist_eq_norm,← heq] exact Metric.infDist_le_dist_of_mem ⟨m,rfl⟩ lemma hexagon_norm_sq_bound (x y : ℝ) (hx : |x|≤1/2) (h₁ : x+Real.sqrt 3*y≤1) (h₂ : x-Real.sqrt 3*y≤1) (h₃ : -x+Real.sqrt 3*y≤1) (h₄ : -x-Real.sqrt 3*y≤1) : x^2+y^2≤1/3 := by have hs : (Real.sqrt 3)^2=3 := Real.sq_sqrt (by norm_num) have ha : |x|+Real.sqrt 3*|y|≤1 := by rcases le_total 0 x with hxx | hxx <;> rcases le_total 0 y with hyy | hyy · simpa only [abs_of_nonneg hxx,abs_of_nonneg hyy] using h₁ · simpa only [abs_of_nonneg hxx,abs_of_nonpos hyy,mul_neg,← sub_eq_add_neg] using h₂ · simpa only [abs_of_nonpos hxx,abs_of_nonneg hyy] using h₃ · simpa only [abs_of_nonpos hxx,abs_of_nonpos hyy,mul_neg,← sub_eq_add_neg] using h₄ have hyprod : 0≤(1-|x|-Real.sqrt 3*|y|)*(1-|x|+Real.sqrt 3*|y|) := by apply mul_nonneg · linarith · have : 0≤Real.sqrt 3*|y| := mul_nonneg (Real.sqrt_nonneg 3) (abs_nonneg y) linarith have hxprod : |x| * (2*|x|-1)≤0 := mul_nonpos_of_nonneg_of_nonpos (abs_nonneg x) (by linarith) have hxy : (Real.sqrt 3*|y|)^2=3*y^2 := by rw [mul_pow,hs,sq_abs] nlinarith [sq_abs x,sq_abs y] theorem exists_eisenstein_distance_sq_le_third (z : ℂ) : ∃n : _root_.OAI.ActualEisensteinCubic.O, Complex.normSq (z-eisEmbedding n)≤1/3 := by obtain ⟨n,hn⟩ := exists_nearest_eisenstein z let w := z-eisEmbedding n have hmin (u : _root_.OAI.ActualEisensteinCubic.O) : Complex.normSq w≤Complex.normSq (w-eisEmbedding u) := by rw [Complex.normSq_eq_norm_sq,Complex.normSq_eq_norm_sq] apply pow_le_pow_left₀ (norm_nonneg _) ?_ 2 have h := hn (n+u) simpa only [map_add,sub_add_eq_sub_sub] using h have hre : omega3.re= -(1/2:ℝ) := by norm_num [omega3] have h1 := hmin 1 have hn1 := hmin (-1) have hω := hmin (ActualEisensteinCoordinates.eval 0 1) have hnω := hmin (-(ActualEisensteinCoordinates.eval 0 1)) have hη := hmin (ActualEisensteinCoordinates.eval 1 1) have hnη := hmin (-(ActualEisensteinCoordinates.eval 1 1)) have hs : (Real.sqrt 3)^2=3 := Real.sq_sqrt (by norm_num) simp only [map_one,map_neg,eisEmbedding_eval,Int.cast_zero,Int.cast_one,zero_add,one_mul, Complex.normSq_apply,Complex.sub_re,Complex.sub_im,Complex.add_re,Complex.add_im, Complex.neg_re,Complex.neg_im,Complex.one_re,Complex.one_im,hre,omega3_im] at h1 hn1 hω hnω hη hnη refine ⟨n,?_⟩ change Complex.normSq w≤1/3 rw [Complex.normSq_apply,← sq,← sq] apply hexagon_norm_sq_bound · apply abs_le.mpr constructor <;> nlinarith · nlinarith [hη] · nlinarith [hnω] · nlinarith [hω] · nlinarith [hnη] end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT def integralBottomRow (M : SL(2,_root_.OAI.ActualEisensteinCubic.O)) : Fin 2 → _root_.OAI.ActualEisensteinCubic.O := fun j => M 1 j def integralRowEnergy (g : SL(2,ℂ)) (v : Fin 2 → _root_.OAI.ActualEisensteinCubic.O) : ℝ := rowEnergy (rowOperator g (fun j => eisEmbedding (v j))) lemma integralRowEnergy_sublevel_finite (g : SL(2,ℂ)) (C : ℝ) : Set.Finite {v : Fin 2 → _root_.OAI.ActualEisensteinCubic.O | integralRowEnergy g v≤C} := by have hb : Set.Finite (Metric.closedBall (0 : (Fin 2×Fin 2)→ℤ) (rowBound g*Real.sqrt C)) := (isCompact_closedBall _ _).finite_of_discrete apply (Set.Finite.preimage rowCoordinates_injective.injOn hb).subset intro v hv change rowCoordinates v∈Metric.closedBall 0 (rowBound g*Real.sqrt C) rw [Metric.mem_closedBall,dist_zero_right] exact (coordinates_le_transformed_energy g v).trans (mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hv) (rowBound_pos g).le) lemma integral_height_action_matrix (M : SL(2,_root_.OAI.ActualEisensteinCubic.O)) (g : SL(2,ℂ)) : hyperbolicHeight (integralComplexMatrix M • (QuotientGroup.mk g : HyperbolicSpace))= (integralRowEnergy g (integralBottomRow M))⁻¹ := by change (rowEnergy (complexBottomRow (integralComplexMatrix M*g)))⁻¹=_ rw [complexBottomRow_mul] rfl lemma integralRowEnergy_bottom_pos (g : SL(2,ℂ)) (M : SL(2,_root_.OAI.ActualEisensteinCubic.O)) : 0 < integralRowEnergy g (integralBottomRow M) := by have h := hyperbolicHeight_pos (integralComplexMatrix M • (QuotientGroup.mk g : HyperbolicSpace)) rw [integral_height_action_matrix,inv_pos] at h exact h theorem exists_maximal_integral_height (w : HyperbolicSpace) : ∃N : SL(2,_root_.OAI.ActualEisensteinCubic.O), ∀M : SL(2,_root_.OAI.ActualEisensteinCubic.O), hyperbolicHeight (integralComplexMatrix M • w)≤hyperbolicHeight (integralComplexMatrix N • w) := by induction w using Quotient.inductionOn with | _ g => let P : Set (Fin 2 → _root_.OAI.ActualEisensteinCubic.O) := Set.range integralBottomRow let C := integralRowEnergy g (integralBottomRow 1) let S : Set (Fin 2 → _root_.OAI.ActualEisensteinCubic.O) := {v | integralRowEnergy g v≤C} ∩ P have hS : Set.Finite S := (integralRowEnergy_sublevel_finite g C).inter_of_left P have hSne : S.Nonempty := by refine ⟨integralBottomRow 1,?_⟩ change C≤C ∧ integralBottomRow 1∈Set.range integralBottomRow exact ⟨le_rfl,1,rfl⟩ obtain ⟨v,hv,hmin⟩ := Set.exists_min_image S (integralRowEnergy g) hS hSne obtain ⟨N,hN⟩ := hv.2 refine ⟨N,fun M => ?_⟩ have hNM : integralRowEnergy g (integralBottomRow N)≤ integralRowEnergy g (integralBottomRow M) := by rw [hN] by_cases hM : integralRowEnergy g (integralBottomRow M)≤C · exact hmin _ ⟨hM,⟨M,rfl⟩⟩ · exact hv.1.trans (le_of_not_ge hM) rw [integral_height_action_matrix,integral_height_action_matrix] exact inv_anti₀ (integralRowEnergy_bottom_pos g N) hNM end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix open ActualEisensteinCubic ConcreteTraceCRT def integralTranslation (n : _root_.OAI.ActualEisensteinCubic.O) : SL(2,_root_.OAI.ActualEisensteinCubic.O) := ⟨!![1,n;0,1],by simp [Matrix.det_fin_two]⟩ def integralInversion : SL(2,_root_.OAI.ActualEisensteinCubic.O) := ⟨!![0,-1;1,0],by simp [Matrix.det_fin_two]⟩ lemma integralTranslation_action (n : _root_.OAI.ActualEisensteinCubic.O) (z : ℂ) (v : ℝ) (hv : 0 (QuotientGroup.mk g : HyperbolicSpace)) apply Subtype.ext change (integralComplexMatrix (integralTranslation n) : Matrix (Fin 2) (Fin 2) ℂ) * (upperSection z v hv : Matrix (Fin 2) (Fin 2) ℂ) = (upperSection (z + eisEmbedding n) v hv : Matrix (Fin 2) (Fin 2) ℂ) simp only [integralComplexMatrix, Matrix.SpecialLinearGroup.map_apply_coe] ext i j fin_cases i <;> fin_cases j <;> simp [integralTranslation,RingHom.mapMatrix_apply,Matrix.map_apply,upperSection,Matrix.mul_apply, Fin.sum_univ_two,div_eq_mul_inv] ; ring lemma integralInversion_height (z : ℂ) (v : ℝ) (hv : 0 ((x:ℂˣ):ℂ)) h simpa only [finiteCubicMultiplier_coe,OneMemClass.coe_one,Units.val_one] using hc · intro h apply Subtype.ext apply Units.ext simpa only [finiteCubicMultiplier_coe,OneMemClass.coe_one,Units.val_one] using h lemma globalKubotaKernel_mem (M : SL(2,_root_.OAI.ActualEisensteinCubic.O)) : M∈globalKubotaKernel ↔ ∃hM : M∈levelThree,complexCharacter ⟨M,hM⟩=1 := by constructor · rintro ⟨N,hN,hNM⟩ subst M exact ⟨N.property,(finiteCubicMultiplier_eq_one N).mp hN⟩ · rintro ⟨hM,hc⟩ exact ⟨⟨M,hM⟩,(finiteCubicMultiplier_eq_one ⟨M,hM⟩).mpr hc,rfl⟩ lemma finite_right_representatives {G : Type*} [Group G] (H : Subgroup G) [H.FiniteIndex] : ∃S : Finset G, ∀g : G,∃r∈S,r⁻¹*g∈H := by let : Fintype (G ⧸ H) := Fintype.ofFinite _ let S : Finset G := Finset.univ.image (fun q : G ⧸ H => Quotient.out q) refine ⟨S,fun g => ?_⟩ let q : G ⧸ H := QuotientGroup.mk g refine ⟨Quotient.out q,?_,?_⟩ · exact Finset.mem_image.mpr ⟨q,Finset.mem_univ _,rfl⟩ · exact QuotientGroup.leftRel_apply.mp (Quotient.exact' (Quotient.out_eq' q)) theorem finiteIndex_ford_cover (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) [H.FiniteIndex] : ∃S : Finset (SL(2,_root_.OAI.ActualEisensteinCubic.O)), ∀w : HyperbolicSpace, ∃h : H, ∃r∈S, ∃z : ℂ, ∃v : ℝ, ∃hv : 0 ?_⟩ obtain ⟨M,z,v,hv,hMw,hz,hfloor⟩ := bianchi_reduction_height_floor w obtain ⟨r,hr,hh⟩ := hS M refine ⟨⟨r⁻¹*M,hh⟩,r,hr,z,v,hv,?_,hz,hfloor⟩ change integralComplexMatrix (r⁻¹*M) • w=_ rw [map_mul,mul_smul,hMw] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.QuotientTopology namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups section open CubicKubota abbrev complexSLTopology : TopologicalSpace (SL(2,ℂ)) := inferInstanceAs (TopologicalSpace {A : Matrix (Fin 2) (Fin 2) ℂ // A.det=1}) lemma continuous_complexSL_coe : letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous (fun g : SL(2,ℂ) => (g : Matrix (Fin 2) (Fin 2) ℂ)) := letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology continuous_subtype_val lemma continuous_complexSL_mul : letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (g : SL(2,ℂ)), Continuous (fun h : SL(2,ℂ) => g*h) := letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (g : SL(2,ℂ)) => by apply Continuous.subtype_mk change Continuous (fun h : SL(2,ℂ) => (g : Matrix (Fin 2) (Fin 2) ℂ)*(h : Matrix (Fin 2) (Fin 2) ℂ)) exact continuous_const.mul continuous_complexSL_coe lemma continuous_coordinateSection : letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous coordinateSection := letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by apply Continuous.subtype_mk apply continuous_pi intro i apply continuous_pi intro j have hroot : Continuous (fun w : UpperCoordinates => (Real.sqrt w.1.2 : ℂ)) := Complex.continuous_ofReal.comp (Real.continuous_sqrt.comp (continuous_snd.comp continuous_subtype_val)) have hne : ∀w : UpperCoordinates,(Real.sqrt w.1.2 : ℂ)≠0 := fun w => Complex.ofReal_ne_zero.mpr (Real.sqrt_pos.mpr w.2).ne' fin_cases i <;> fin_cases j · exact hroot · exact (continuous_fst.comp continuous_subtype_val).div hroot hne · exact continuous_const · exact hroot.inv₀ hne lemma continuous_hyperbolicProjection : letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous (fun g : SL(2,ℂ) => (g : HyperbolicSpace)) := letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology continuous_quotient_mk' lemma continuous_upperCoordinates : letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous (fun w : UpperCoordinates => upperPoint w.1.1 w.1.2 w.2) := letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology continuous_hyperbolicProjection.comp continuous_coordinateSection lemma continuous_translatedUpperCoordinates : letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (g : SL(2,ℂ)), Continuous (fun w : UpperCoordinates => g • upperPoint w.1.1 w.1.2 w.2) := letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (g : SL(2,ℂ)) => by exact continuous_hyperbolicProjection.comp ((continuous_complexSL_mul g).comp continuous_coordinateSection) def integralOrbitRel (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) : Setoid HyperbolicSpace where r w w' := ∃h : H, integralComplexMatrix (h:SL(2,_root_.OAI.ActualEisensteinCubic.O)) • w = w' iseqv := ⟨by intro w; exact ⟨1,by simp⟩, by rintro w w' ⟨h,hh⟩ refine ⟨h⁻¹,?_⟩ rw [←hh] simp [←mul_smul], by rintro w w' w'' ⟨h,hh⟩ ⟨k,hk⟩ refine ⟨k*h,?_⟩ simpa only [Subgroup.coe_mul,map_mul,mul_smul,hh] using hk⟩ abbrev IntegralOrbitQuotient (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) := Quotient (integralOrbitRel H) def integralOrbitProjection (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) : HyperbolicSpace → IntegralOrbitQuotient H := Quotient.mk _ lemma continuous_integralOrbitProjection : letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))), Continuous (integralOrbitProjection H) := letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) => continuous_quotient_mk' lemma integralOrbitProjection_eq (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (h : H) (w : HyperbolicSpace) : integralOrbitProjection H (integralComplexMatrix (h:SL(2,_root_.OAI.ActualEisensteinCubic.O)) • w)= integralOrbitProjection H w := by apply Eq.symm exact Quotient.sound ⟨h,rfl⟩ end open CubicKubota def truncatedFordLift (T : ℝ) (p : truncatedFordBox T) : UpperCoordinates := ⟨p.1,lt_of_lt_of_le (Real.sqrt_pos.mpr (by norm_num : (0:ℝ)<2/3)) p.2.2.1⟩ lemma continuous_truncatedFordLift (T : ℝ) : Continuous (truncatedFordLift T) := continuous_subtype_val.subtype_mk _ def fordOrbitChart (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (r : SL(2,_root_.OAI.ActualEisensteinCubic.O)) (p : UpperCoordinates) : IntegralOrbitQuotient H := integralOrbitProjection H (integralComplexMatrix r⁻¹ • upperPoint p.1.1 p.1.2 p.2) lemma continuous_fordOrbitChart : letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (r : SL(2,_root_.OAI.ActualEisensteinCubic.O)), Continuous (fordOrbitChart H r) := letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (r : SL(2,_root_.OAI.ActualEisensteinCubic.O)) => (continuous_integralOrbitProjection H).comp (continuous_translatedUpperCoordinates (integralComplexMatrix r⁻¹)) def compactFordCore (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (S : Finset (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (T : ℝ) : Set (IntegralOrbitQuotient H) := ⋃r∈S, Set.range (fun p : truncatedFordBox T => fordOrbitChart H r (truncatedFordLift T p)) lemma compactFordCore_isCompact : letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (S : Finset (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (T : ℝ), IsCompact (compactFordCore H S T) := letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (S : Finset (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (T : ℝ) => by let : CompactSpace (truncatedFordBox T) := isCompact_iff_compactSpace.mp (truncatedFordBox_isCompact T) apply S.isCompact_biUnion intro r hr exact isCompact_range ((continuous_fordOrbitChart H r).comp (continuous_truncatedFordLift T)) def fordCuspTail (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (r : SL(2,_root_.OAI.ActualEisensteinCubic.O)) (T : ℝ) : Set (IntegralOrbitQuotient H) := fordOrbitChart H r '' {p : UpperCoordinates | Complex.normSq p.1.1≤1/3 ∧ Real.sqrt (2/3)≤p.1.2 ∧ T by obtain ⟨S,hS⟩ := finiteIndex_ford_cover H refine ⟨S,fun T => ⟨compactFordCore_isCompact H S T,?_⟩⟩ apply Set.Subset.antisymm · intro q hq induction q using Quotient.inductionOn with | _ w => obtain ⟨h,r,hr,z,v,hv,heq,hz,hfloor⟩ := hS w have hqeq : integralOrbitProjection H w=fordOrbitChart H r ⟨(z,v),hv⟩ := by rw [←integralOrbitProjection_eq H h w,heq] rfl change integralOrbitProjection H w∈_ rw [hqeq] by_cases hT : v≤T · apply Or.inl apply Set.mem_iUnion.mpr refine ⟨r,Set.mem_iUnion.mpr ⟨hr,?_⟩⟩ exact ⟨⟨(z,v),mem_truncatedFordBox z v T hz hfloor hT⟩,rfl⟩ · apply Or.inr apply Set.mem_iUnion.mpr refine ⟨r,Set.mem_iUnion.mpr ⟨hr,?_⟩⟩ exact ⟨⟨(z,v),hv⟩,⟨hz,hfloor,lt_of_not_ge hT⟩,rfl⟩ · exact Set.subset_univ _ theorem globalKubotaKernel_compact_core_cusp_cover : letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∃S : Finset (SL(2,_root_.OAI.ActualEisensteinCubic.O)), ∀T : ℝ, IsCompact (compactFordCore globalKubotaKernel S T) ∧ Set.univ=compactFordCore globalKubotaKernel S T ∪ ⋃r∈S, fordCuspTail globalKubotaKernel r T := letI complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : globalKubotaKernel.FiniteIndex := globalKubotaKernel_finiteIndex exact finiteIndex_compact_core_cusp_cover globalKubotaKernel end CubicEisenstein namespace SecondPassArithmetic section open scoped BigOperators Classical SchwartzMap FourierTransform open MeasureTheory section open ActualEisensteinCubic open SecondPassFiber (newLabel newRow) open SecondPassIntegration (tupleSourceSum densityChildEnergy) open JointLogSeparation (outerWindow) theorem instNonemptyGlobalSecondData {ι : Type*} : Nonempty (GlobalSecondData ι) := ⟨⟨⟨0,0,∅,∅⟩,∅,∅,∅,⟨∅,∅,∅,0⟩⟩⟩ variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalSecondRecover (s : Finset (GlobalSecondData ι)) : SecondPassFiber.OldTuple → GlobalSecondData ι := letI := @OAI.SecondPassArithmetic.instNonemptyGlobalSecondData Function.invFunOn (globalSecondTuple p) s theorem globalSecondRecover_apply (hinj : Function.Injective (fun i => Ideal.span {p i})) (s : Finset (GlobalSecondData ι)) (q : Ideal O × Ideal O × Ideal O) (hs : ∀ x∈s,GlobalSecondAdmissible x) (hq : ∀ x∈s,globalSecondFixedTriple p x=q) (x : GlobalSecondData ι) (hx : x∈s) : globalSecondRecover p s (globalSecondTuple p x)=x := letI := @OAI.SecondPassArithmetic.instNonemptyGlobalSecondData by have hi : Set.InjOn (globalSecondTuple p) s := by intro x hx y hy h exact globalSecondEncoding_injective p hinj (hs x hx) (hs y hy) ((hq x hx).trans (hq y hy).symm) h exact hi.leftInvOn_invFunOn hx def globalSecondSource (s : Finset (GlobalSecondData ι)) (w : GlobalSecondData ι → ℂ) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap : GlobalSecondData ι → ℝ) (X₁ X₂ R : ℝ) : ℂ := ∑ x∈s,w x * postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ m (globalSecondLabel p x) (newRow (globalSecondTuple p x)) (-newRow (globalSecondTuple p x)) A₁ A₂ W V (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂ R theorem globalSecondSource_eq_tupleSource (hinj : Function.Injective (fun i => Ideal.span {p i})) (s : Finset (GlobalSecondData ι)) (q : Ideal O × Ideal O × Ideal O) (hs : ∀ x∈s,GlobalSecondAdmissible x) (hq : ∀ x∈s,globalSecondFixedTriple p x=q) (w : GlobalSecondData ι → ℂ) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap : GlobalSecondData ι → ℝ) (X₁ X₂ R : ℝ) : globalSecondSource p hp hcop hg s w F Ψ₁ Ψ₂ m A₁ A₂ W V z ud ue uv kap X₁ X₂ R = tupleSourceSum p hp hcop hg (s.image (globalSecondTuple p)) (w ∘ globalSecondRecover p s) (globalSecondLabel p ∘ globalSecondRecover p s) F Ψ₁ Ψ₂ m A₁ A₂ W V (z ∘ globalSecondRecover p s) (ud ∘ globalSecondRecover p s) (ue ∘ globalSecondRecover p s) (uv ∘ globalSecondRecover p s) (kap ∘ globalSecondRecover p s) X₁ X₂ R := by unfold globalSecondSource tupleSourceSum rw [Finset.sum_image] · apply Finset.sum_congr rfl intro x hx simp only [Function.comp_apply,globalSecondRecover_apply p hinj s q hs hq x hx] · intro x hx y hy he exact globalSecondEncoding_injective p hinj (hs x hx) (hs y hy) ((hq x hx).trans (hq y hy).symm) he end open ActualEisensteinCubic open FirstPassCubeLabels (b0Label) open SecondPassFiber (newLabel newRow) open SecondPassIntegration (densityChildEnergy) open JointLogSeparation (outerWindow) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalSecondRawPool (F : Finset ι) (x : GlobalSecondData ι) : Finset ι := (F\(x.cube.support∪x.common))\x.firstCommon def globalSecondRawMask (m : O) (x : GlobalSecondData ι) : O := m*b0Label p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit * primeSubsetGenerator (fun i => Ideal.span {p i}) (x.source.sourceCommon\x.source.divisor) def globalSecondRawSource (s : Finset (GlobalSecondData ι)) (w : GlobalSecondData ι → ℂ) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap : GlobalSecondData ι → ℝ) (X₁ X₂ R : ℝ) : ℂ := ∑ x∈s,w x * postCommonSmoothPair p hp hcop hg (globalSecondRawPool F x) Ψ₁ Ψ₂ (globalSecondRawMask p m x) (globalSecondLabel p x) (newRow (globalSecondTuple p x)) (-newRow (globalSecondTuple p x)) A₁ A₂ W V (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂ R theorem globalSecondRawSource_eq (hinj : Function.Injective (fun i => Ideal.span {p i})) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ i,0 ≤ M i) (hV : ∀ i x,V i x ≠ 0 → |x| ≤ M i) (s : Finset (GlobalSecondData ι)) (w : GlobalSecondData ι → ℂ) (q : Ideal O × Ideal O × Ideal O) (hfixed : ∀ x∈s,globalSecondFixedTriple p x=q) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (z ud ue uv kap : GlobalSecondData ι → ℝ) (X₁ X₂ R : ℝ) (hR : 0 < R) : globalSecondRawSource p hp hcop hg s w F Ψ₁ Ψ₂ m A₁ A₂ W V z ud ue uv kap X₁ X₂ R = globalSecondSource p hp hcop hg s w F Ψ₁ Ψ₂ (fixedTripleMask m q) A₁ A₂ W V z ud ue uv kap X₁ X₂ R := by obtain ⟨C,hC,hsep⟩ := postCommonSmoothPair_uniform_fixed_tests p hp hcop hg A₁ A₂ W V M hM hV 0 0 obtain ⟨b,hb,hid⟩ := hsep R hR unfold globalSecondRawSource globalSecondSource apply Finset.sum_congr rfl intro x hx apply congrArg (fun a : ℂ => w x * a) rw [hid (globalSecondRawPool F x) Ψ₁ Ψ₂ (globalSecondRawMask p m x) (globalSecondLabel p x) (newRow (globalSecondTuple p x)) (-newRow (globalSecondTuple p x)) (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂, hid F Ψ₁ Ψ₂ (fixedTripleMask m q) (globalSecondLabel p x) (newRow (globalSecondTuple p x)) (-newRow (globalSecondTuple p x)) (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂] simp only [separatedPostCommon,globalSecondRawPool,globalSecondRawMask, globalSecondRawRow_fixed_pool p hp hcop hg hinj,hfixed x hx] end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm primeProduct jLabel b0Label cubeActiveSupport) open ConcreteTraceCRT (eisEmbedding) namespace CubeCoordinates def sideDivisor {ι : Type*} (x : CubeCoordinates ι) (side : Bool) : Finset ι := if side then x.leftDivisor else x.rightDivisor end CubeCoordinates variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] def globalCubeJNorm (x : GlobalSecondData ι) : ℝ := ‖eisEmbedding (jLabel p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit)‖^2 def globalCubeActiveRoot (x : GlobalSecondData ι) : ℝ := ‖eisEmbedding (∏ i∈cubeActiveSupport x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit,p i)‖ def globalFirstColumnScale (ell : ℝ) (x : GlobalSecondData ι) (side : Bool) : ℝ := ell/(primeProductNorm p (x.cube.sideDivisor side)*primeProductNorm p x.common) def globalFirstRowScale (K ell B F : ℝ) (x : GlobalSecondData ι) : ℝ := ell^2*B^4*F^2*primeProductNorm p x.firstDivisor/ (K*(primeProductNorm p x.common)^2*globalCubeJNorm p x) include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalCubeActiveRoot_pos (x : GlobalSecondData ι) : 0 < globalCubeActiveRoot p x := by have hh := element_norm_ge_one (∏ i∈cubeActiveSupport x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit,p i) (Finset.prod_ne_zero_iff.mpr (fun i hi => hp i)) change 0 < ‖eisEmbedding _‖ nlinarith [norm_nonneg (eisEmbedding (∏ i∈cubeActiveSupport x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit,p i))] include hp in omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalFirstColumnScale_pos (ell : ℝ) (hell : 0 < ell) (x : GlobalSecondData ι) (side : Bool) : 0 < globalFirstColumnScale p ell x side := div_pos hell (mul_pos (FirstPassCubeLabels.primeProductNorm_pos p hp _) (FirstPassCubeLabels.primeProductNorm_pos p hp _)) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalBaseLabel_norm (x : GlobalSecondData ι) : ‖eisEmbedding (secondBaseLabel p x.cube.support x.common x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit)‖^2 = primeProductNorm p x.common*globalCubeJNorm p x := by simp only [secondBaseLabel,map_mul,norm_mul,mul_pow,primeSubsetGenerator_norm_eq_productNorm,globalCubeJNorm] end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm primeProduct) open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] end end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.ScaleCaps namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct bit parity retained b0Exponent aLabel jLabel j2Label squarefreeLabel b0Label) variable {ι : Type*} [DecidableEq ι] variable (p : ι → O) [∀ i,(Ideal.span {p i}).IsMaximal] end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) abbrev GlobalLogIndex := Fin 10 → ℕ def globalLogRep (j : GlobalLogIndex) (i : Fin 10) : ℝ := normLogScale (j i) theorem globalLogRep_pos (j : GlobalLogIndex) (i : Fin 10) : 0 < globalLogRep j i := normLogScale_pos _ theorem globalLogRep_ge_one (j : GlobalLogIndex) (i : Fin 10) : 1 ≤ globalLogRep j i := normLogScale_ge_one _ section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] def globalScaleVector (side : Bool) (x : GlobalSecondData ι) : Fin 10 → ℝ := ![primeProductNorm p (x.cube.sideDivisor side),primeProductNorm p x.common, primeProductNorm p x.firstCommon,primeProductNorm p (x.source.sourceCommon\x.source.divisor), globalCubeJNorm p x,primeProductNorm p x.firstDivisor,primeProductNorm p x.source.divisor, primeProductNorm p x.source.overlap,‖eisEmbedding (SecondPassFiber.newRow (globalSecondTuple p x))‖^2, (globalCubeActiveRoot p x)^2] def globalScaleIndex (side : Bool) (x : GlobalSecondData ι) : GlobalLogIndex := fun i => normLogBin (globalScaleVector p side x i) include hp in theorem globalScaleVector_ge_one (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) : ∀ i,1 ≤ globalScaleVector p side x i := by intro i fin_cases i · exact primeProductNorm_ge_one p hp (x.cube.sideDivisor side) · exact primeProductNorm_ge_one p hp x.common · exact primeProductNorm_ge_one p hp x.firstCommon · exact primeProductNorm_ge_one p hp (x.source.sourceCommon\x.source.divisor) · change 1 ≤ globalCubeJNorm p x exact element_norm_ge_one _ (primeProduct_ne_zero p hp x.cube.support _) · exact primeProductNorm_ge_one p hp x.firstDivisor · exact primeProductNorm_ge_one p hp x.source.divisor · exact primeProductNorm_ge_one p hp x.source.overlap · change 1 ≤ ‖eisEmbedding (actualSecondRow p x.firstDivisor x.source.divisor x.source.frequency)‖^2 exact element_norm_ge_one _ (actualSecondRow_ne_zero p _ _ _ hk) · change 1 ≤ (globalCubeActiveRoot p x)^2 exact element_norm_ge_one _ (Finset.prod_ne_zero_iff.mpr (fun i hi => hp i)) include hp in theorem globalScaleIndex_bounds (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) (i : Fin 10) : globalLogRep (globalScaleIndex p side x) i ≤ globalScaleVector p side x i ∧ globalScaleVector p side x i ≤ globalLogRep (globalScaleIndex p side x) i*Real.exp 1 := normLogBin_scale_bounds _ (globalScaleVector_ge_one p hp side x hk i) include hp in theorem globalScaleIndex_error (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) (i : Fin 10) : 0 ≤ Real.log (globalScaleVector p side x i/globalLogRep (globalScaleIndex p side x) i) ∧ Real.log (globalScaleVector p side x i/globalLogRep (globalScaleIndex p side x) i) ≤ 1 := normLogBin_error _ (globalScaleVector_ge_one p hp side x hk i) def globalLogSector (s : Finset (GlobalSecondData ι)) (side : Bool) (j : GlobalLogIndex) : Finset (GlobalSecondData ι) := s.filter (fun x => globalScaleIndex p side x=j) end def globalLogBox (U : Fin 10 → ℝ) : Finset GlobalLogIndex := Fintype.piFinset (fun i => Finset.range (normLogBin (U i)+1)) theorem globalLogBox_card (U : Fin 10 → ℝ) : (globalLogBox U).card=∏ i : Fin 10,(normLogBin (U i)+1) := by simp only [globalLogBox,Fintype.card_piFinset,Finset.card_range] theorem globalScaleIndex_mem_box {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) (U : Fin 10 → ℝ) (hU : ∀ i,globalScaleVector p side x i ≤ U i) : globalScaleIndex p side x∈globalLogBox U := by apply Fintype.mem_piFinset.mpr intro i apply Finset.mem_range.mpr exact Nat.lt_succ_of_le (normLogBin_mono (zero_lt_one.trans_le (globalScaleVector_ge_one p hp side x hk i)) (hU i)) def globalPooledColumnScale (ell : ℝ) (j : GlobalLogIndex) : ℝ := ell/(globalLogRep j 0*globalLogRep j 1*globalLogRep j 2*globalLogRep j 3*globalLogRep j 6*globalLogRep j 7) def globalPooledLabelScale (j : GlobalLogIndex) : ℝ := globalLogRep j 1*globalLogRep j 4*globalLogRep j 6*globalLogRep j 7*Real.exp 4 def globalPooledRowScale (K ell B F : ℝ) (j : GlobalLogIndex) : ℝ := Real.exp 1*ell^2*B^4*F^2*globalLogRep j 5/(K*(globalLogRep j 1)^2*globalLogRep j 4) def globalPooledDelta (B F : ℝ) (j : GlobalLogIndex) : ℝ := B*F*globalLogRep j 0*globalLogRep j 2*globalLogRep j 3 def globalPooledNaturalRow (K B F : ℝ) (j : GlobalLogIndex) : ℝ := K*globalLogRep j 4/((globalPooledDelta B F j)^2*B^2) theorem globalPooledColumnScale_pos (ell : ℝ) (hell : 0 < ell) (j : GlobalLogIndex) : 0 < globalPooledColumnScale ell j := by unfold globalPooledColumnScale apply div_pos hell exact mul_pos (mul_pos (mul_pos (mul_pos (mul_pos (globalLogRep_pos j 0) (globalLogRep_pos j 1)) (globalLogRep_pos j 2)) (globalLogRep_pos j 3)) (globalLogRep_pos j 6)) (globalLogRep_pos j 7) theorem globalPooledLabelScale_ge_one (j : GlobalLogIndex) : 1 ≤ globalPooledLabelScale j := by exact one_le_mul_of_one_le_of_one_le (one_le_mul_of_one_le_of_one_le (one_le_mul_of_one_le_of_one_le (one_le_mul_of_one_le_of_one_le (globalLogRep_ge_one j 1) (globalLogRep_ge_one j 4)) (globalLogRep_ge_one j 6)) (globalLogRep_ge_one j 7)) (Real.one_le_exp (by norm_num)) theorem globalPooled_mass (ell B F : ℝ) (hB : 0 < B) (hF : 0 < F) (j : GlobalLogIndex) : globalPooledColumnScale ell j*globalPooledLabelScale j = Real.exp 4*((ell*B^3)*F)*globalLogRep j 4/(globalPooledDelta B F j*B^2) := by have h (i : Fin 10) := (globalLogRep_pos j i).ne' unfold globalPooledColumnScale globalPooledLabelScale globalPooledDelta field_simp [h] theorem globalPooled_radial_ratio (K ell B F : ℝ) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) (j : GlobalLogIndex) : globalPooledRowScale K ell B F j*globalLogRep j 8/ (globalLogRep j 5*(globalLogRep j 6)^2*(globalLogRep j 7)^2*(globalPooledColumnScale ell j)^2) = Real.exp 1*(globalLogRep j 8/globalPooledNaturalRow K B F j) := by have h (i : Fin 10) := (globalLogRep_pos j i).ne' unfold globalPooledRowScale globalPooledColumnScale globalPooledNaturalRow globalPooledDelta field_simp [h] end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum EisensteinSchwartzPoisson theorem maskedPairDualTail_bound (A : ℕ) : ∃ (s : Finset (ℕ×ℕ)) (C : ℝ), 0 hG (Ideal.absNorm_eq_zero_iff.mp hz)) have hNI : 0<(Ideal.absNorm I:ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun hz => hI (Ideal.absNorm_eq_zero_iff.mp hz)) have hNJ : 0<(Ideal.absNorm J:ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun hz => hJ (Ideal.absNorm_eq_zero_iff.mp hz)) have hN0 : 0 hq0 (Ideal.absNorm_eq_zero_iff.mp hz)) have hqN : (Ideal.absNorm q:ℝ)≤(Ideal.absNorm G:ℝ) := by exact_mod_cast Nat.le_of_dvd (by exact_mod_cast hNG) (map_dvd Ideal.absNorm hqG) have ht : 0 ‖a j‖) (fun _ => (1:ℝ)) simp only [mul_one,one_pow,Finset.sum_const,Finset.card_univ,nsmul_eq_mul,mul_one] at hcs have hs : (∑ j, ∑ k, ‖a j‖*‖a k‖*E) = (∑ j, ‖a j‖)^2*E := by simp only [pow_two,Finset.sum_mul,Finset.mul_sum,mul_assoc] apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro k _ ring calc _ ≤ ∑ j, ∑ k, ‖if IsCoprime (cols j) (cols k) then star (a j)*a k*error j k else 0‖ := by exact (norm_sum_le _ _).trans (Finset.sum_le_sum fun j _ => norm_sum_le _ _) _ ≤ ∑ j, ∑ k, ‖a j‖*‖a k‖*E := by apply Finset.sum_le_sum intro j _ apply Finset.sum_le_sum intro k _ split_ifs · simp only [norm_mul,norm_star] exact mul_le_mul_of_nonneg_left (herr j k) (by positivity) · simp only [norm_zero] positivity _ = (∑ j, ‖a j‖)^2*E := hs _ ≤ ((∑ j, ‖a j‖^2)*(Fintype.card n:ℝ))*E := mul_le_mul_of_nonneg_right hcs hE _ = _ := by ring theorem maskedDualTailFamily_bound (A : ℕ) : ∃ (s : Finset (ℕ×ℕ)) (C : ℝ), 0 (hcols j).1) (fun j => (hcols j).2.2) have herr (j k : n) : ‖maskedPairDualTail G (cols j) (cols k) W M K‖≤ (2*M/N)*(idealDivisors G).card*T := hbound G (cols j) (cols k) W M N K hG (hcols j).1 (hcols k).1 hM hN hK (hcols j).2.1 (hcols j).2.2 (hcols k).2.1 (hcols k).2.2 calc _ ≤ (Fintype.card n:ℝ)*((2*M/N)*(idealDivisors G).card*T)*∑ j, ‖a j‖^2 := coprime_pair_error_energy cols a _ (by positivity) _ herr _ ≤ (128*N)*((2*M/N)*(idealDivisors G).card*T)*∑ j, ‖a j‖^2 := by gcongr _ = _ := by dsimp only [T]; field_simp; ring end CanonicalQuadraticSieve open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] def globalActualResidualScale (ell : ℝ) (side : Bool) (x : GlobalSecondData ι) : ℝ := globalFirstColumnScale p ell x side/ (primeProductNorm p x.firstCommon*primeProductNorm p x.source.divisor* primeProductNorm p (x.source.sourceCommon\x.source.divisor)) include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalActualResidualScale_pos (ell : ℝ) (hell : 0 < ell) (side : Bool) (x : GlobalSecondData ι) : 0 < globalActualResidualScale p ell side x := by exact div_pos (globalFirstColumnScale_pos p hp ell hell x side) (mul_pos (mul_pos (FirstPassCubeLabels.primeProductNorm_pos p hp _) (FirstPassCubeLabels.primeProductNorm_pos p hp _)) (FirstPassCubeLabels.primeProductNorm_pos p hp _)) include hp in theorem globalPooled_log_coordinates (ell : ℝ) (hell : 0 < ell) (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) : let j := globalScaleIndex p side x let d := expansionSupportData x.common x.firstDivisor x.source |secondSectorZ p (globalActualResidualScale p ell side x) (globalPooledColumnScale ell j) d| ≤ 6 ∧ |secondSectorUd p (globalLogRep j 5) d| ≤ 6 ∧ |secondSectorUe p (globalLogRep j 6) d| ≤ 6 ∧ |secondSectorUv p (globalLogRep j 7) d| ≤ 6 ∧ |secondSectorKap p (globalLogRep j 8) d| ≤ 6 := by let j := globalScaleIndex p side x let I : Finset (Fin 10) := {0,1,2,3,6,7} have hpos (i : Fin 10) : 0 < globalScaleVector p side x i := zero_lt_one.trans_le (globalScaleVector_ge_one p hp side x hk i) have herr (i : Fin 10) := globalScaleIndex_error p hp side x hk i have hn (i : Fin 10) : globalScaleVector p side x i/globalLogRep j i ≠ 0 := div_ne_zero (hpos i).ne' (globalLogRep_pos j i).ne' have hprod : primeProductNorm p x.source.overlap*globalPooledColumnScale ell j/ globalActualResidualScale p ell side x = ∏ i∈I,globalScaleVector p side x i/globalLogRep j i := by have h (i : Fin 10) := (globalLogRep_pos j i).ne' have hA := (FirstPassCubeLabels.primeProductNorm_pos p hp (x.cube.sideDivisor side)).ne' have hC := (FirstPassCubeLabels.primeProductNorm_pos p hp x.common).ne' have ht := (FirstPassCubeLabels.primeProductNorm_pos p hp x.firstCommon).ne' have he := (FirstPassCubeLabels.primeProductNorm_pos p hp x.source.divisor).ne' have hr := (FirstPassCubeLabels.primeProductNorm_pos p hp (x.source.sourceCommon\x.source.divisor)).ne' simp [I,globalScaleVector,globalPooledColumnScale,globalActualResidualScale,globalFirstColumnScale,Finset.prod_insert,Finset.prod_singleton] field_simp [h] have hlog : 0 ≤ Real.log (primeProductNorm p x.source.overlap*globalPooledColumnScale ell j/ globalActualResidualScale p ell side x) ∧ Real.log (primeProductNorm p x.source.overlap*globalPooledColumnScale ell j/ globalActualResidualScale p ell side x) ≤ 6 := by rw [hprod,Real.log_prod (fun i hi => hn i)] constructor · exact Finset.sum_nonneg (fun i hi => (herr i).1) · calc _ ≤ ∑ i∈I,(1 : ℝ) := Finset.sum_le_sum (fun i hi => (herr i).2) _ = 6 := by have hcard : I.card = 6 := by decide exact_mod_cast hcard have hsmall (i : Fin 10) : |Real.log (globalScaleVector p side x i/globalLogRep j i)| ≤ 6 := by rw [abs_of_nonneg (herr i).1] exact (herr i).2.trans (by norm_num) dsimp only refine ⟨?_,?_,?_,?_,?_⟩ · change |Real.log (primeProductNorm p x.source.overlap*globalPooledColumnScale ell j/ globalActualResidualScale p ell side x)| ≤ 6 rw [abs_of_nonneg hlog.1] exact hlog.2 · change |Real.log (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) x.firstDivisor)‖^2 / globalLogRep j 5)| ≤ 6 rw [primeSubsetGenerator_norm_eq_productNorm] exact hsmall 5 · change |Real.log (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) x.source.divisor)‖^2 / globalLogRep j 6)| ≤ 6 rw [primeSubsetGenerator_norm_eq_productNorm] exact hsmall 6 · exact hsmall 7 · exact hsmall 8 include hp in theorem globalPooled_target_bounds (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) : let j := globalScaleIndex p side x (Ideal.absNorm (SecondPassFiber.newLabel (globalSecondTuple p x)) : ℝ) ≤ globalPooledLabelScale j ∧ ‖eisEmbedding (SecondPassFiber.newRow (globalSecondTuple p x))‖^2 ≤ globalLogRep j 8*Real.exp 1 := by let j := globalScaleIndex p side x have hb (i : Fin 10) := (globalScaleIndex_bounds p hp side x hk i).2 refine ⟨?_,hb 8⟩ have he : (Ideal.absNorm (SecondPassFiber.newLabel (globalSecondTuple p x)) : ℝ) = globalScaleVector p side x 1*globalScaleVector p side x 4* globalScaleVector p side x 6*globalScaleVector p side x 7 := by rw [show SecondPassFiber.newLabel (globalSecondTuple p x) = secondSupportNewLabel p x.cube.support x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit (expansionSupportData x.common x.firstDivisor x.source) from rfl, secondSupportNewLabel_norm,globalBaseLabel_norm] rfl rw [he] calc _ ≤ (globalLogRep j 1*Real.exp 1)*(globalLogRep j 4*Real.exp 1)* (globalLogRep j 6*Real.exp 1)*(globalLogRep j 7*Real.exp 1) := by have hpos (i : Fin 10) := (globalScaleVector_ge_one p hp side x hk i).trans' (by norm_num : (0:ℝ) ≤ 1) have hr1 := (globalLogRep_pos j 1).le have hr4 := (globalLogRep_pos j 4).le have hr6 := (globalLogRep_pos j 6).le have hr7 := (globalLogRep_pos j 7).le gcongr <;> first | exact hpos _ | exact hb _ _ = globalPooledLabelScale j := by unfold globalPooledLabelScale rw [show (4:ℝ)=1+1+1+1 by norm_num,Real.exp_add,Real.exp_add,Real.exp_add] ring end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm primeProduct) open ConcreteTraceCRT (eisEmbedding) private theorem five_factor_bounds (a b c d e : ℝ) (ha : 1 ≤ a) (hb : 1 ≤ b) (hc : 1 ≤ c) (hd : 1 ≤ d) (he : 1 ≤ e) : a ≤ a*b*c*d*e ∧ b ≤ a*b*c*d*e ∧ c ≤ a*b*c*d*e ∧ d ≤ a*b*c*d*e ∧ e ≤ a*b*c*d*e := by refine ⟨?_,?_,?_,?_,?_⟩ · calc a = a*1*1*1*1 := by ring _ ≤ _ := by gcongr · calc b = 1*b*1*1*1 := by ring _ ≤ _ := by gcongr · calc c = 1*1*c*1*1 := by ring _ ≤ _ := by gcongr · calc d = 1*1*1*d*1 := by ring _ ≤ _ := by gcongr · calc e = 1*1*1*1*e := by ring _ ≤ _ := by gcongr variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalSupported_small_norms (ell M : ℝ) (_hell : 0 < ell) (side : Bool) (x : GlobalSecondData ι) (hx : GlobalSecondAdmissible x) (hs : SecondSourceSupport p (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon) M x.source) : primeProductNorm p (x.cube.sideDivisor side) ≤ ell*Real.exp M ∧ primeProductNorm p x.common ≤ ell*Real.exp M ∧ primeProductNorm p x.firstCommon ≤ ell*Real.exp M ∧ primeProductNorm p (x.source.sourceCommon\x.source.divisor) ≤ ell*Real.exp M ∧ primeProductNorm p x.source.divisor ≤ ell*Real.exp M ∧ primeProductNorm p x.source.overlap ≤ ell*Real.exp M := by have ha := primeProductNorm_ge_one p hp (x.cube.sideDivisor side) have hc := primeProductNorm_ge_one p hp x.common have ht := primeProductNorm_ge_one p hp x.firstCommon have hg := primeProductNorm_ge_one p hp x.source.sourceCommon have hv := primeProductNorm_ge_one p hp x.source.overlap have hden : 0 < primeProductNorm p (x.cube.sideDivisor side)*primeProductNorm p x.common*primeProductNorm p x.firstCommon := by positivity have heq : (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon)*Real.exp M = (ell*Real.exp M)/(primeProductNorm p (x.cube.sideDivisor side)*primeProductNorm p x.common*primeProductNorm p x.firstCommon) := by unfold globalFirstColumnScale ring have hprod := (le_div_iff₀ hden).mp (hs.2.trans_eq heq) have hprod' : primeProductNorm p (x.cube.sideDivisor side)*primeProductNorm p x.common* primeProductNorm p x.firstCommon*primeProductNorm p x.source.sourceCommon*primeProductNorm p x.source.overlap ≤ ell*Real.exp M := by convert hprod using 1 <;> first | rfl | ring obtain ⟨ha',hc',ht',hg',hv'⟩ := five_factor_bounds _ _ _ _ _ ha hc ht hg hv refine ⟨ha'.trans hprod',hc'.trans hprod',ht'.trans hprod',?_,?_,hv'.trans hprod'⟩ · exact (primeProductNorm_mono p hp Finset.sdiff_subset).trans (hg'.trans hprod') · exact (primeProductNorm_mono p hp hx.2.1).trans (hg'.trans hprod') include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalCube_radical_bound (B : ℝ) (hB : 0 ≤ B) (x : GlobalSecondData ι) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) : primeProductNorm p x.cube.support ≤ B^2 := by have hd : (∏ i∈x.cube.support,p i) ∣ primeProduct p x.cube.support x.cube.leftExponent * primeProduct p x.cube.support x.cube.rightExponent := by rw [← primeProduct_add] apply Finset.prod_dvd_prod_of_dvd intro i hi simpa only [pow_one] using pow_dvd_pow (p i) (x.cube.support_pos i hi) have hb0 := mul_ne_zero (primeProduct_ne_zero p hp x.cube.support x.cube.leftExponent) (primeProduct_ne_zero p hp x.cube.support x.cube.rightExponent) have hn := element_norm_le_of_dvd hb0 hd simp only [map_mul,norm_mul,mul_pow] at hn exact hn.trans (by simpa only [pow_two] using mul_le_mul hb₁ hb₂ (sq_nonneg _) hB) include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalSupported_divisor_bound (ell B M : ℝ) (hell : 0 < ell) (hB : 0 ≤ B) (side : Bool) (x : GlobalSecondData ι) (hx : GlobalSecondAdmissible x) (hs : SecondSourceSupport p (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon) M x.source) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) : primeProductNorm p x.firstDivisor ≤ (ell*Real.exp M)*B^2 := by have hC := (globalSupported_small_norms p hp ell M hell side x hx hs).2.1 have hrad := globalCube_radical_bound p hp B hB x hb₁ hb₂ calc _ ≤ primeProductNorm p (x.common∪x.cube.support) := primeProductNorm_mono p hp hx.2.2.2 _ = primeProductNorm p x.common*primeProductNorm p x.cube.support := FirstPassCubeLabels.primeProductNorm_union p _ _ hx.2.2.1 _ ≤ _ := mul_le_mul hC hrad (FirstPassCubeLabels.primeProductNorm_pos p hp _).le (by positivity) include hp in theorem globalSupported_cutoff_row_bound (ell B Y M Z : ℝ) (hell : 0 < ell) (hB : 0 ≤ B) (hY : 0 < Y) (hZ : 0 ≤ Z) (side : Bool) (x : GlobalSecondData ι) (hx : GlobalSecondAdmissible x) (hs : SecondSourceSupport p (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon) M x.source) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) (hk : x.source.frequency ∈ firstCoreSecondCutoff p x.firstCommon (globalFirstColumnScale p ell x side) Y M Z x.source.sourceCommon x.source.divisor) : ‖eisEmbedding (SecondPassFiber.newRow (globalSecondTuple p x))‖^2 ≤ 3*(ell*Real.exp M)^2*B^2*((⌈Z*(ell*Real.exp M)^2/Y⌉₊ : ℝ)+1)^2 := by let X := globalFirstColumnScale p ell x side let U := (X/primeProductNorm p x.firstCommon)*Real.exp M let lengthScale := ell*Real.exp M have hsmall := globalSupported_small_norms p hp ell M hell side x hx hs have hD := globalSupported_divisor_bound p hp ell B M hell hB side x hx hs hb₁ hb₂ have ha := primeProductNorm_ge_one p hp (x.cube.sideDivisor side) have hc := primeProductNorm_ge_one p hp x.common have ht := primeProductNorm_ge_one p hp x.firstCommon have hX : X ≤ ell := by exact div_le_self hell.le (one_le_mul_of_one_le_of_one_le ha hc) have hU : U ≤ lengthScale := mul_le_mul_of_nonneg_right ((div_le_self (globalFirstColumnScale_pos p hp ell hell x side).le ht).trans hX) (Real.exp_pos M).le have hU0 : 0 ≤ U := by exact (mul_pos (div_pos (globalFirstColumnScale_pos p hp ell hell x side) (FirstPassCubeLabels.primeProductNorm_pos p hp _)) (Real.exp_pos M)).le have hden : primeProductNorm p x.source.divisor * (((X/primeProductNorm p x.firstCommon)/primeProductNorm p x.source.sourceCommon)*Real.exp M)^2 ≤ lengthScale^2 := by rw [show ((X/primeProductNorm p x.firstCommon)/primeProductNorm p x.source.sourceCommon)*Real.exp M = U/primeProductNorm p x.source.sourceCommon by dsimp [U];ring] exact (supported_cutoff_denominator _ _ _ (primeProductNorm_mono p hp hx.2.1) (primeProductNorm_ge_one p hp _)).trans (pow_le_pow_left₀ hU0 hU 2) have hr : Z/(Y/(primeProductNorm p x.source.divisor * (((X/primeProductNorm p x.firstCommon)/primeProductNorm p x.source.sourceCommon)*Real.exp M)^2)) ≤ Z*lengthScale^2/Y := by rw [div_div_eq_mul_div] exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hden hZ) hY.le have hceil : (⌈Z/(Y/(primeProductNorm p x.source.divisor * (((X/primeProductNorm p x.firstCommon)/primeProductNorm p x.source.sourceCommon)*Real.exp M)^2))⌉₊ : ℝ) ≤ (⌈Z*lengthScale^2/Y⌉₊ : ℝ) := by exact_mod_cast Nat.ceil_mono hr have hf := secondFrequencyCutoff_norm_sq_le _ Z x.source.frequency hk simp only [primeSubsetGenerator_norm_eq_productNorm] at hf have hf' : ‖eisEmbedding x.source.frequency‖^2 ≤ 3*((⌈Z*lengthScale^2/Y⌉₊ : ℝ)+1)^2 := by apply hf.trans gcongr change ‖eisEmbedding (actualSecondRow p x.firstDivisor x.source.divisor x.source.frequency)‖^2 ≤ _ simp only [actualSecondRow,map_mul,norm_mul,mul_pow,primeSubsetGenerator_norm_eq_productNorm] calc _ ≤ (lengthScale*B^2)*lengthScale*(3*((⌈Z*lengthScale^2/Y⌉₊ : ℝ)+1)^2) := by exact mul_le_mul (mul_le_mul hD hsmall.2.2.2.2.1 (FirstPassCubeLabels.primeProductNorm_pos p hp _).le (by positivity)) hf' (sq_nonneg _) (by dsimp [lengthScale]; positivity) _ = _ := by dsimp [lengthScale];ring_nf def globalNormCaps (ell B Y M Z : ℝ) : Fin 10 → ℝ := let lengthScale := ell*Real.exp M ![lengthScale,lengthScale,lengthScale,lengthScale,B^2,lengthScale*B^2,lengthScale,lengthScale,3*lengthScale^2*B^2*((⌈Z*lengthScale^2/Y⌉₊ : ℝ)+1)^2,B^2] include hp in theorem globalScaleVector_le_caps (ell B Y M Z : ℝ) (hell : 0 < ell) (hB : 0 ≤ B) (hY : 0 < Y) (hZ : 0 ≤ Z) (side : Bool) (x : GlobalSecondData ι) (hx : GlobalSecondAdmissible x) (hs : SecondSourceSupport p (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon) M x.source) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) (hk : x.source.frequency ∈ firstCoreSecondCutoff p x.firstCommon (globalFirstColumnScale p ell x side) Y M Z x.source.sourceCommon x.source.divisor) : ∀ i,globalScaleVector p side x i ≤ globalNormCaps ell B Y M Z i := by obtain ⟨ha,hc,ht,hr,he,hv⟩ := globalSupported_small_norms p hp ell M hell side x hx hs have hd := globalSupported_divisor_bound p hp ell B M hell hB side x hx hs hb₁ hb₂ have hrow := globalSupported_cutoff_row_bound p hp ell B Y M Z hell hB hY hZ side x hx hs hb₁ hb₂ hk have hJ := (cube_label_norm_bounds p hp x.cube.support x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit x.cube.support_pos B hB hb₁ hb₂).1 have hrad := globalCube_radical_bound p hp B hB x hb₁ hb₂ have hactive : (globalCubeActiveRoot p x)^2 ≤ B^2 := (primeProductNorm_mono p hp (Finset.filter_subset _ _)).trans hrad intro i fin_cases i · exact ha · exact hc · exact ht · exact hr · exact hJ · exact hd · exact he · exact hv · exact hrow · exact hactive end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.PoissonComparison namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CanonicalQuadraticSieve section theorem hasSieveExponent_one_of_approximation (happrox : ∀ η : ℝ, 0<η → ∃ α : ℝ, α≤1+η ∧ HasSieveExponent α) : HasSieveExponent 1 := by intro ε hε have he : 0<ε/2 := by positivity obtain ⟨α,hα,h⟩ := happrox (ε/2) he obtain ⟨C,hC,hbound⟩ := h (ε/2) he refine ⟨C,hC,?_⟩ intro M N hM hN have hM0 : 0≤M := by linarith have hN0 : 0 norm_num [bootstrapExponent]; exact hasSieveExponent_two | succ n ih => rw [bootstrapExponent_step] exact himprove _ (bootstrapExponent_gt_one n) (bootstrapExponent_le_two n) ih apply hasSieveExponent_one_of_approximation intro η hη obtain ⟨n,hnη⟩ := exists_nat_one_div_lt hη refine ⟨bootstrapExponent n,?_,hn n⟩ unfold bootstrapExponent linarith section open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum EisensteinSchwartzPoisson def divisorTwist {n : Type} (cols : n → Ideal O) (a : n → ℂ) (q : Ideal O) : n → ℂ := fun j => a j*quadraticRow (cols j) (idealGenerator q) def centeredRetainedDual {n : Type} [Fintype n] [DecidableEq n] (W : 𝓢(ℝ,ℂ)) (cols : n → Ideal O) (a : n → ℂ) (M K : ℝ) (q : Ideal O) : ℂ := (6:ℂ)*retainedDualPrincipalSum (quadraticTransformedSquareProfile W) (fun I : squarefreeIdealRange K => I.val) cols (divisorTwist cols a q) M (Ideal.absNorm q:ℝ) - paperRadialFourier (quadraticTransformedSquareProfile W) 0 * unrestrictedPrincipalDensity (fun I : squarefreeIdealRange K => I.val) cols cols (divisorTwist cols a q) (divisorTwist cols a q) (M/(Ideal.absNorm q:ℝ)) def centeredMaskedSource {n : Type} [Fintype n] [DecidableEq n] (G : Ideal O) (W : 𝓢(ℝ,ℂ)) (cols : n → Ideal O) (a : n → ℂ) (M K : ℝ) : ℂ := maskedPrincipalSourceSum G (quadraticSquareProfile W) (fun I : coprimeSquarefreeRange G K => I.val) cols a M - paperRadialFourier (quadraticSquareProfile W) 0 * maskedSourceDensity G (fun I : coprimeSquarefreeRange G K => I.val) cols a M def maskedPoissonDifference {n : Type} [Fintype n] [DecidableEq n] (G : Ideal O) (W : 𝓢(ℝ,ℂ)) (cols : n → Ideal O) (a : n → ℂ) (M K : ℝ) : ℂ := maskedDualFamily G cols a W M - (6:ℂ)⁻¹ * maskedPrincipalSourceSum G (quadraticSquareProfile W) (fun I : coprimeSquarefreeRange G K => I.val) cols a M lemma finite_centering_identity {ι : Type*} (S : Finset ι) (w R D : ι → ℂ) (c h : ℂ) : (∑ q∈S, w q*(c*R q-h*D q)) = c*(∑ q∈S,w q*R q)-h*(∑ q∈S,w q*D q) := by rw [Finset.mul_sum,Finset.mul_sum,←Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro q hq ring theorem maskedPoissonDifference_centered {n : Type} [Fintype n] [DecidableEq n] (G : Ideal O) (hG : G≠0) (W : 𝓢(ℝ,ℂ)) (cols : n → Ideal O) (a : n → ℂ) (M K : ℝ) (hM : 0 pow_le_pow_left₀ (norm_nonneg _) (ha j) 2) have hs := (supportConstant_pos ε hε).le have hc := (divisorExponentConstant_pos hexp deltaLoss hδ).le have hlat := nonzeroLatticeEnvelopeConstant_nonneg have hW := dualMiddleDecayConstant_nonneg W have hF0 : 0 hq0 (Ideal.absNorm_eq_zero_iff.mp hz)) have hh := hbound hexp hα deltaLoss hδ ε hε K N M (Ideal.absNorm q:ℝ) T hK hN hM (by linarith) hT cols hc hcols hray (divisorTwist cols a q) (quadraticTransformedSquareProfile W) apply hh.trans apply mul_le_mul_of_nonneg_left _ (by positivity) exact retainedDualMajorant_coefficient_scale_le s C hC.le l hexp deltaLoss hδ ε hε (2*K) N M (Ideal.absNorm q:ℝ) T a (divisorTwist cols a q) (quadraticTransformedSquareProfile W) (by linarith) (by linarith) hM.le hq1 (by linarith) (divisorTwist_norm_le cols a q) calc _ ≤ ∑_q∈idealDivisors G, (columnDyadicLength K+1:ℕ)* retainedDualMajorant s C l hexp deltaLoss hδ ε hε (2*K) N M 1 T a (quadraticTransformedSquareProfile W) := Finset.sum_le_sum hqbound _ = _ := by simp only [Finset.sum_const,nsmul_eq_mul]; ring end open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum EisensteinSchwartzPoisson open IdealCoprimeSieveOperator def poissonComparisonMajorant {n : Type} [Fintype n] (sD sS sT : Finset (ℕ×ℕ)) (CD CS CT CP : ℝ) (l A : ℕ) {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 (hcols j).1 have hcolsu : ∀j, Admissible (cols j) ∧ (Ideal.absNorm (cols j):ℝ)≤N := fun j => ⟨(hcols j).1,(hcols j).2.2⟩ have hd := hdual hexp hα deltaLoss hδ ε hε G hG.ne_zero K N M T hK hN hM0 hT cols hc hcols hray a W have hs := hsource hexp hα deltaLoss hδ ε hε G hG K N M T hK hN hM0 hT (coprimeSquarefreeRange G K) (fun I hI => mem_idealRange.mp (coprimeSquarefreeRange_subset_idealRange G hbad K hI)) cols hc hcolsu hGc a (quadraticSquareProfile W) (by simpa only [quadraticSquareProfile_apply,zero_pow (by decide : 2≠0)] using hW) have ht := htail G cols a W M N K hG.ne_zero hc hM0 hN (by linarith) (fun j => ⟨(hcols j).1.1,(hcols j).2⟩) have hp := hprincipal cols hc M N K hM hN hK hcolsu hray (densityColumn cols a) G hG hbad ε hε have he := densityColumn_energy_le cols a (fun j => (hcols j).1.1) have hsupp := (supportConstant_pos ε hε).le have hp' : ‖(Real.sqrt M:ℂ)*actualPrincipalDifference cols (densityColumn cols a) G K‖ ≤ ((idealDivisors G).card:ℝ)^2*(supportConstant ε hε*N^ε)*CP*(K*N)^deltaLoss* (Real.sqrt (M/K)*N+Real.sqrt M*K^(α-1/2))*∑j, ‖a j‖^2 := by apply hp.trans gcongr have hmain := maskedPoissonDifference_norm_le G hG.ne_zero W cols a M K hM0 hcols0 hray hGc hbad apply hmain.trans change _ ≤ _+_+_+_ have hs' : ‖centeredMaskedSource G W cols a M K‖ ≤ (columnDyadicLength K+1:ℕ)*sourcePrincipalMajorant sS CS l hexp deltaLoss hδ ε hε G (2*K) N M T a (quadraticSquareProfile W) := hs exact add_le_add (add_le_add (add_le_add hd (mul_le_mul_of_nonneg_left ht (by norm_num))) hs') (mul_le_mul_of_nonneg_left hp' (norm_nonneg _)) end section open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum open DivisorBlockCauchy theorem gcdRaySupport_energy_eq {n : Type} [Fintype n] (cols : n → Ideal O) (a : n → ℂ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) : (∑j : gcdRaySupport cols a D c, ‖a j.val‖^2) = ∑j, if D∣cols j ∧ columnRay (cols j)=c then ‖a j‖^2 else 0 := by classical rw [Finset.sum_coe_sort (gcdRaySupport cols a D c) (fun j => ‖a j‖^2)] simp only [gcdRaySupport,Finset.sum_filter] apply Finset.sum_congr rfl intro j _ by_cases hz : a j=0 · simp only [hz,norm_zero,ne_eq,not_true_eq_false,and_false,ite_self,zero_pow (by decide : 2≠0)] · simp only [hz,ne_eq,not_false_eq_true,and_true] theorem gcdRaySupport_energy_ray_sum {n : Type} [Fintype n] (cols : n → Ideal O) (a : n → ℂ) (D : Ideal O) : (∑c : EisensteinEPrimaryPhase.Coord, ∑j : gcdRaySupport cols a D c, ‖a j.val‖^2) = ∑j, ‖if D∣cols j then a j else 0‖^2 := by classical simp_rw [gcdRaySupport_energy_eq] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ by_cases hd : D∣cols j · simp only [hd,true_and,ite_true] rw [Finset.sum_eq_single (columnRay (cols j))] · simp only [ite_true] · intro c hc hne exact if_neg (Ne.symm hne) · simp · simp only [hd,false_and,ite_false,Finset.sum_const_zero,norm_zero,zero_pow (by decide : 2≠0)] theorem gcdRaySupport_energy_divisor_sum {n : Type} [Fintype n] (ε : ℝ) (hε : 0<ε) (S : Finset (Ideal O)) (cols : n → Ideal O) (hcols : ∀j, cols j≠0) (a : n → ℂ) (X : ℝ) (hX : ∀j, a j≠0 → (Ideal.absNorm (cols j):ℝ)≤X) : (∑c : EisensteinEPrimaryPhase.Coord, ∑D∈S, ∑j : gcdRaySupport cols a D c, ‖a j.val‖^2) ≤ (divisorConstant ε hε*X^ε)*∑j, ‖a j‖^2 := by classical rw [Finset.sum_comm] simp_rw [gcdRaySupport_energy_ray_sum] apply (divisor_mask_energy S cols hcols a).trans rw [Finset.mul_sum] apply Finset.sum_le_sum intro j _ by_cases hz : a j=0 · simp only [hz,norm_zero,zero_pow (by decide : 2≠0),mul_zero,le_refl] · apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) apply ((IdealDivisorBound.ideal_divisor_small_power ε hε).choose_spec.2 (cols j) (hcols j)).trans exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (Nat.cast_nonneg _) (hX j hz) hε.le) (divisorConstant_pos ε hε).le theorem gcdRaySupport_weighted_sum_bound {n : Type} [Fintype n] (ε : ℝ) (hε : 0<ε) (S : Finset (Ideal O)) (cols : n → Ideal O) (hcols : ∀j, cols j≠0) (a : n → ℂ) (X C : ℝ) (hC : 0≤C) (hX : ∀j, a j≠0 → (Ideal.absNorm (cols j):ℝ)≤X) (F : Ideal O → EisensteinEPrimaryPhase.Coord → ℝ) (hF : ∀D∈S, ∀c, F D c≤C*∑j : gcdRaySupport cols a D c, ‖a j.val‖^2) : (∑c : EisensteinEPrimaryPhase.Coord, ∑D∈S, F D c) ≤ C*(divisorConstant ε hε*X^ε)*∑j, ‖a j‖^2 := by calc _ ≤ ∑c : EisensteinEPrimaryPhase.Coord, ∑D∈S, C*∑j : gcdRaySupport cols a D c, ‖a j.val‖^2 := Finset.sum_le_sum (fun c _ => Finset.sum_le_sum (fun D hD => hF D hD c)) _ = C*(∑c : EisensteinEPrimaryPhase.Coord, ∑D∈S, ∑j : gcdRaySupport cols a D c, ‖a j.val‖^2) := by simp only [Finset.mul_sum] _ ≤ C*((divisorConstant ε hε*X^ε)*∑j, ‖a j‖^2) := mul_le_mul_of_nonneg_left (gcdRaySupport_energy_divisor_sum ε hε S cols hcols a X hX) hC _ = _ := by ring end open ActualEisensteinCubic IdealCoprimeSieveOperator DivisorBlockCauchy theorem divisorEnergyFactor_diagonal {n : Type*} [Fintype n] (ε : ℝ) (hε : 0<ε) (N : ℝ) (a : n → ℂ) : divisorEnergyFactor ε hε N a a = (256*(supportConstant ε hε*divisorConstant ε hε)*(N^ε)^2)*∑j, ‖a j‖^2 := by unfold divisorEnergyFactor have hs : 0≤∑j, ‖a j‖^2 := Finset.sum_nonneg fun _ _ => sq_nonneg _ rw [mul_assoc _ (Real.sqrt _) (Real.sqrt _),Real.mul_self_sqrt hs] theorem poissonComparisonMajorant_energy_factor {n : Type} [Fintype n] (sD sS sT : Finset (ℕ×ℕ)) (CD CS CT CP : ℝ) (l A : ℕ) {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 (1:ℂ)) W * ∑j, ‖a j‖^2 := by unfold poissonComparisonMajorant retainedDualMajorant sourcePrincipalMajorant smallPrincipalMajorant dualMiddleMajorant simp only [divisorEnergyFactor_diagonal,Fintype.sum_unique,norm_one,one_pow,mul_one] ring end CanonicalQuadraticSieve open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm b0Label jLabel) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalSecondOuterWeight (Ψ : O →* ℂ) (m : O) (z : SecondRayIndex) (ell Y : ℝ) (side : Bool) (x : GlobalSecondData ι) : ℂ := let X := globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon let b0 := b0Label p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit let c := secondBaseLabel p x.cube.support x.common x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit let d := primeSubsetGenerator (fun i => Ideal.span {p i}) x.firstDivisor let r := primeSubsetGenerator (fun i => Ideal.span {p i}) (x.source.sourceCommon\x.source.divisor) (primeProductNorm p x.firstCommon : ℂ)⁻¹ * (secondNormalizedExpansionWeight p hp hcop hg Ψ (m*b0) c d z X Y x.source * (secondExpansionScale p X r (expansionSupportData x.common x.firstDivisor x.source) : ℂ)⁻¹) theorem globalSecondOuterWeight_squarefree (Ψ : O →* ℂ) (m : O) (z : SecondRayIndex) (ell Y : ℝ) (side : Bool) (x : GlobalSecondData ι) (hx : GlobalSecondAdmissible x) (h : globalSecondOuterWeight p hp hcop hg Ψ m z ell Y side x ≠ 0) : Squarefree (SecondPassFiber.newLabel (globalSecondTuple p x)) := by apply actualSecondLabel_squarefree_of_weight p hp hcop hg x.cube.support x.common x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit hx.2.2.1 Ψ (m*b0Label p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit) (primeSubsetGenerator (fun i => Ideal.span {p i}) x.firstDivisor) z x.source hx.2.1 intro hw unfold secondArithmeticWeight at hw rcases mul_eq_zero.mp hw with hA|hB · apply h simp only [globalSecondOuterWeight,secondNormalizedExpansionWeight,secondBaseLabel,hA,mul_zero,zero_mul] · apply h simp only [globalSecondOuterWeight,secondNormalizedExpansionWeight,secondBaseLabel,hB,mul_zero,zero_mul] theorem globalSecondOuterWeight_norm_le (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (z : SecondRayIndex) (ell Y : ℝ) (hell : 0 < ell) (hY : 0 ≤ Y) (side : Bool) (x : GlobalSecondData ι) : ‖globalSecondOuterWeight p hp hcop hg Ψ m z ell Y side x‖ ≤ (Y*primeProductNorm p x.firstCommon*primeProductNorm p (x.source.sourceCommon\x.source.divisor)/ (globalFirstColumnScale p ell x side)^2)*‖secondRayCoefficient z‖ := by have ht := FirstPassCubeLabels.primeProductNorm_pos p hp x.firstCommon have hX := globalFirstColumnScale_pos p hp ell hell x side have hh := secondNormalizedExpansionWeight_norm_le p hp hcop hg hinj hc x.common x.firstDivisor Ψ (m*b0Label p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit) (secondBaseLabel p x.cube.support x.common x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit) (primeSubsetGenerator (fun i => Ideal.span {p i}) x.firstDivisor) (primeSubsetGenerator (fun i => Ideal.span {p i}) (x.source.sourceCommon\x.source.divisor)) z (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon) Y (div_pos hX ht) hY x.source (hΨ _) (hΨ _) rw [primeSubsetGenerator_norm_eq_productNorm] at hh unfold globalSecondOuterWeight dsimp only rw [norm_mul,norm_inv,Complex.norm_of_nonneg ht.le] apply (mul_le_mul_of_nonneg_left hh (inv_nonneg.mpr ht.le)).trans_eq field_simp def globalPooledOuterBound (z : SecondRayIndex) (ell Y : ℝ) (j : GlobalLogIndex) : ℝ := (Y*(Real.exp 1)^6*globalLogRep j 2*globalLogRep j 3*(globalLogRep j 0)^2*(globalLogRep j 1)^2/ell^2)* ‖secondRayCoefficient z‖ theorem globalSecondOuterWeight_bin_bound (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (z : SecondRayIndex) (ell Y : ℝ) (hell : 0 < ell) (hY : 0 ≤ Y) (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) : ‖globalSecondOuterWeight p hp hcop hg Ψ m z ell Y side x‖ ≤ globalPooledOuterBound z ell Y (globalScaleIndex p side x) := by apply (globalSecondOuterWeight_norm_le p hp hcop hg hinj hc Ψ hΨ m z ell Y hell hY side x).trans let j := globalScaleIndex p side x have ha := (globalScaleIndex_bounds p hp side x hk 0).2 have hc' := (globalScaleIndex_bounds p hp side x hk 1).2 have ht := (globalScaleIndex_bounds p hp side x hk 2).2 have hr := (globalScaleIndex_bounds p hp side x hk 3).2 change primeProductNorm p (x.cube.sideDivisor side) ≤ globalLogRep j 0*Real.exp 1 at ha change primeProductNorm p x.common ≤ globalLogRep j 1*Real.exp 1 at hc' change primeProductNorm p x.firstCommon ≤ globalLogRep j 2*Real.exp 1 at ht change primeProductNorm p (x.source.sourceCommon\x.source.divisor) ≤ globalLogRep j 3*Real.exp 1 at hr have hn : Y*primeProductNorm p x.firstCommon*primeProductNorm p (x.source.sourceCommon\x.source.divisor)/ (globalFirstColumnScale p ell x side)^2 = Y*primeProductNorm p x.firstCommon*primeProductNorm p (x.source.sourceCommon\x.source.divisor)* (primeProductNorm p (x.cube.sideDivisor side))^2*(primeProductNorm p x.common)^2/ell^2 := by have hA := (FirstPassCubeLabels.primeProductNorm_pos p hp (x.cube.sideDivisor side)).ne' have hC := (FirstPassCubeLabels.primeProductNorm_pos p hp x.common).ne' unfold globalFirstColumnScale field_simp rw [hn] have h0 := (FirstPassCubeLabels.primeProductNorm_pos p hp (x.cube.sideDivisor side)).le have h1 := (FirstPassCubeLabels.primeProductNorm_pos p hp x.common).le have h2 := (FirstPassCubeLabels.primeProductNorm_pos p hp x.firstCommon).le have h3 := (FirstPassCubeLabels.primeProductNorm_pos p hp (x.source.sourceCommon\x.source.divisor)).le have hr0 := (globalLogRep_pos j 0).le have hr1 := (globalLogRep_pos j 1).le have hr2 := (globalLogRep_pos j 2).le have hr3 := (globalLogRep_pos j 3).le calc _ ≤ (Y*(globalLogRep j 2*Real.exp 1)*(globalLogRep j 3*Real.exp 1)* (globalLogRep j 0*Real.exp 1)^2*(globalLogRep j 1*Real.exp 1)^2/ell^2)*‖secondRayCoefficient z‖ := by gcongr _ = _ := by unfold globalPooledOuterBound;ring end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.ArithmeticBins namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace SecondPassArithmetic section open scoped BigOperators Classical SchwartzMap open MeasureTheory open ActualEisensteinCubic open SecondPassFiber (newLabel newRow) open SecondPassIntegration (densityChildEnergy) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalArithmeticBin (s : Finset (GlobalSecondData ι)) (side : Bool) (q : Ideal O × Ideal O × Ideal O) (j : GlobalLogIndex) : Finset (GlobalSecondData ι) := s.filter (fun x => globalSecondFixedTriple p x=q ∧ globalScaleIndex p side x=j) def globalSquarefreeBin (s : Finset (GlobalSecondData ι)) (side : Bool) (q : Ideal O × Ideal O × Ideal O) (j : GlobalLogIndex) : Finset (GlobalSecondData ι) := (globalArithmeticBin p s side q j).filter (fun x => Squarefree (newLabel (globalSecondTuple p x))) def globalArithmeticTargets (s : Finset (GlobalSecondData ι)) (side : Bool) (q : Ideal O × Ideal O × Ideal O) (j : GlobalLogIndex) : Finset (Ideal O × O) := (globalSquarefreeBin p s side q j).image (fun x => (newLabel (globalSecondTuple p x),newRow (globalSecondTuple p x))) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalArithmeticTargets_squarefree (s : Finset (GlobalSecondData ι)) (side : Bool) (q : Ideal O × Ideal O × Ideal O) (j : GlobalLogIndex) : ∀ z∈globalArithmeticTargets p s side q j,Squarefree z.1 := by intro z hz obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hz exact (Finset.mem_filter.mp hx).2 include hp in theorem globalArithmeticTargets_bounds (s : Finset (GlobalSecondData ι)) (side : Bool) (q : Ideal O × Ideal O × Ideal O) (j : GlobalLogIndex) (hk : ∀ x∈s,x.source.frequency ≠ 0) : ∀ z∈globalArithmeticTargets p s side q j,z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ globalPooledLabelScale j ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ globalLogRep j 8*Real.exp 1 := by intro z hz obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hz obtain ⟨hx',hsf⟩ := Finset.mem_filter.mp hx obtain ⟨hxs,hq,hj⟩ := Finset.mem_filter.mp hx' have hb := globalPooled_target_bounds p hp side x (hk x hxs) rw [hj] at hb refine ⟨?_,hb⟩ exact secondSupportNewLabel_ne_bot p hp x.cube.support x.common x.firstDivisor x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit x.source def globalBinZ (ell : ℝ) (side : Bool) (j : GlobalLogIndex) (x : GlobalSecondData ι) : ℝ := secondSectorZ p (globalActualResidualScale p ell side x) (globalPooledColumnScale ell j) (expansionSupportData x.common x.firstDivisor x.source) def globalBinUd (j : GlobalLogIndex) (x : GlobalSecondData ι) : ℝ := secondSectorUd p (globalLogRep j 5) (expansionSupportData x.common x.firstDivisor x.source) def globalBinUe (j : GlobalLogIndex) (x : GlobalSecondData ι) : ℝ := secondSectorUe p (globalLogRep j 6) (expansionSupportData x.common x.firstDivisor x.source) def globalBinUv (j : GlobalLogIndex) (x : GlobalSecondData ι) : ℝ := secondSectorUv p (globalLogRep j 7) (expansionSupportData x.common x.firstDivisor x.source) def globalBinKap (j : GlobalLogIndex) (x : GlobalSecondData ι) : ℝ := secondSectorKap p (globalLogRep j 8) (expansionSupportData x.common x.firstDivisor x.source) def globalBinRadial (ell Y : ℝ) (j : GlobalLogIndex) : ℝ := Y*globalLogRep j 8/(globalLogRep j 5*(globalLogRep j 6)^2*(globalLogRep j 7)^2*(globalPooledColumnScale ell j)^2) theorem globalBinRadial_pos (ell Y : ℝ) (hell : 0 < ell) (hY : 0 < Y) (j : GlobalLogIndex) : 0 < globalBinRadial ell Y j := by have h5 := globalLogRep_pos j 5 have h6 := globalLogRep_pos j 6 have h7 := globalLogRep_pos j 7 have h8 := globalLogRep_pos j 8 have hX := globalPooledColumnScale_pos ell hell j unfold globalBinRadial positivity end open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct) open ConcreteTraceCRT (eisEmbedding) def fixedDepthRank (Z K : ℝ) : ℕ := ⌈1000*Real.log K/Real.log Z⌉₊ theorem fixedDepthRank_initial (Z K : ℝ) (hZ : 1 < Z) (hK : 0 < K) (hstart : K ≤ Z^3) : fixedDepthRank Z K ≤ 3000 := by have hz := Real.log_pos hZ have hl := Real.log_le_log hK hstart rw [Real.log_pow] at hl apply Nat.ceil_le.mpr change 1000*Real.log K/Real.log Z ≤ (3000:ℝ) apply (div_le_iff₀ hz).mpr norm_num at hl linarith theorem fixedDepthRank_step (Z K K' : ℝ) (hZ : 1 < Z) (hK : 0 < K) (hK' : 1 ≤ K') (hstep : K' ≤ K/Z^((1:ℝ)/1000)) : fixedDepthRank Z K'+1 ≤ fixedDepthRank Z K := by have hz0 : 0 < Z := lt_trans zero_lt_one hZ have hz := Real.log_pos hZ have hk0 : 0 < K' := lt_of_lt_of_le zero_lt_one hK' have hl := Real.log_le_log hk0 hstep rw [Real.log_div hK.ne' (Real.rpow_pos_of_pos hz0 _).ne',Real.log_rpow hz0] at hl have ha : 0 ≤ 1000*Real.log K'/Real.log Z := by exact div_nonneg (mul_nonneg (by norm_num) (Real.log_nonneg hK')) hz.le have hb : 1000*Real.log K'/Real.log Z+1 ≤ 1000*Real.log K/Real.log Z := by apply (le_div_iff₀ hz).mpr field_simp nlinarith have hn := Nat.ceil_mono hb rw [Nat.ceil_add_one ha] at hn exact hn theorem globalPooledDelta_pos (B F : ℝ) (hB : 0 < B) (hF : 0 < F) (j : GlobalLogIndex) : 0 < globalPooledDelta B F j := by unfold globalPooledDelta exact mul_pos (mul_pos (mul_pos (mul_pos hB hF) (globalLogRep_pos j 0)) (globalLogRep_pos j 2)) (globalLogRep_pos j 3) theorem globalPooledDelta_ge (B F : ℝ) (hB : 0 ≤ B) (hF : 0 ≤ F) (j : GlobalLogIndex) : B*F ≤ globalPooledDelta B F j := by have h0 := globalLogRep_ge_one j 0 have h2 := globalLogRep_ge_one j 2 have h3 := globalLogRep_ge_one j 3 unfold globalPooledDelta calc B*F = B*F*1*1*1 := by ring _ ≤ _ := by gcongr theorem globalPooledNaturalRow_pos (K B F : ℝ) (hK : 0 < K) (hB : 0 < B) (hF : 0 < F) (j : GlobalLogIndex) : 0 < globalPooledNaturalRow K B F j := by unfold globalPooledNaturalRow exact div_pos (mul_pos hK (globalLogRep_pos j 4)) (mul_pos (sq_pos_of_pos (globalPooledDelta_pos B F hB hF j)) (sq_pos_of_pos hB)) theorem globalPooledNaturalRow_bound (K B F : ℝ) (hK : 0 < K) (hB : 0 < B) (hF : 0 < F) (j : GlobalLogIndex) (hJ : globalLogRep j 4 ≤ B^2) : globalPooledNaturalRow K B F j ≤ K/(globalPooledDelta B F j)^2 := by have hD := globalPooledDelta_pos B F hB hF j unfold globalPooledNaturalRow calc K*globalLogRep j 4/((globalPooledDelta B F j)^2*B^2) ≤ K*B^2/((globalPooledDelta B F j)^2*B^2) := by gcongr _ = _ := by field_simp theorem globalPooledRow_contraction (K ell B F : ℝ) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) (j : GlobalLogIndex) (hJ : globalLogRep j 4 ≤ B^2) (hretained : globalBinRadial ell (globalPooledRowScale K ell B F j) j ≤ globalPooledDelta B F j) : globalLogRep j 8*Real.exp 1 ≤ K/globalPooledDelta B F j := by have hD := globalPooledDelta_pos B F hB hF j have hN := globalPooledNaturalRow_pos K B F hK hB hF j have hn := globalPooledNaturalRow_bound K B F hK hB hF j hJ have hr := hretained rw [globalBinRadial,globalPooled_radial_ratio K ell B F hK hell hB hF] at hr have hr' : globalLogRep j 8*Real.exp 1 ≤ globalPooledDelta B F j*globalPooledNaturalRow K B F j := by apply (div_le_iff₀ hN).mp convert hr using 1 <;> first | rfl | ring calc _ ≤ globalPooledDelta B F j*globalPooledNaturalRow K B F j := hr' _ ≤ globalPooledDelta B F j*(K/(globalPooledDelta B F j)^2) := by gcongr _ = _ := by field_simp variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] include hp in theorem globalPooled_J_bound (B : ℝ) (hB : 0 < B) (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) : globalLogRep (globalScaleIndex p side x) 4 ≤ B^2 := by have hJ := (cube_label_norm_bounds p hp x.cube.support x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit x.cube.support_pos B hB.le hb₁ hb₂).1 exact (globalScaleIndex_bounds p hp side x hk 4).1.trans hJ end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap namespace CanonicalQuadraticSieve section open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum EisensteinSchwartzPoisson def activeGcdColumns (N : ℝ) (a : idealRange N → ℂ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) : gcdRaySupport (fun I : idealRange N => I.val) a D c → Ideal O := fun j => idealQuotient D j.val.val def activeGcdCoefficient (N : ℝ) (a : idealRange N → ℂ) (D : Ideal O) (c : EisensteinEPrimaryPhase.Coord) : gcdRaySupport (fun I : idealRange N => I.val) a D c → ℂ := fun j => a j.val theorem originalHigh_gcd_eq_maskedPoissonDifference {n : Type} [Fintype n] [DecidableEq n] (D : Ideal O) (hD : D≠0) (cols : n → Ideal O) (hcols : ∀j, Admissible (cols j)) (hdiv : ∀j, D∣cols j) (hproper : ∀j, cols j≠D) (hray : ∀j k, columnRay (cols j)=columnRay (cols k)) (a : n → ℂ) (W : 𝓢(ℝ,ℂ)) (M K : ℝ) (hM : 0 idealQuotient D (cols j)) a M K := by rw [originalHigh_gcd_principal_assembly D hD cols hcols hdiv hproper hray a W M K hM, maskedPoissonDifference, maskedDualFamily_retained _ (commonMaskIdeal_squarefree D).ne_zero _ a W M K hM (fun j => admissible_idealQuotient (hcols j) (hdiv j)) (fun j k => columnRay_idealQuotient_eq D (cols j) (cols k) (hcols j) (hcols k) (hdiv j) (hdiv k) (hray j k))] theorem annularRayGcdBlock_eq_active_difference (M N X K : ℝ) (hM : 0 I.val) a D c have hdiv (j : S) : D∣j.val.val := ((mem_gcdRaySupport _ a D c j.val).mp j.property).1 have hray (j k : S) : columnRay j.val.val=columnRay k.val.val := by have hj := ((mem_gcdRaySupport _ a D c j.val).mp j.property).2.1 have hk := ((mem_gcdRaySupport _ a D c k.val).mp k.property).2.1 exact hj.trans hk.symm exact originalHigh_gcd_eq_maskedPoissonDifference D hD (fun j : S => j.val.val) (fun j => (mem_idealRange.mp j.val.property).1) hdiv (gcdRaySupport_proper N X a ha D c hsmall) hray (fun j : S => a j.val) QuadraticInitialBound.annularSieveCutoff M K hM theorem HasSieveExponent.annular_small_gcd_complete {α : ℝ} (hexp : HasSieveExponent α) (hα : 1/2≤α) (deltaLoss : ℝ) (hδ : 0 hD (Ideal.absNorm_eq_zero_iff.mp hz)) have hscale : 1≤X/(Ideal.absNorm D:ℝ) := (le_div_iff₀ hDn).mpr (by linarith) have hp := gcdRaySupport_quotient_properties N X a ha D hD c rw [annularRayGcdBlock_eq_active_difference M N X K (by linarith) a ha D hD hsmall c] apply hbound ε hε (commonMaskIdeal D) (commonMaskIdeal_squarefree D) (fun P hP => fixedBadPrimes_dvd_commonMaskIdeal D P hP) K (X/(Ideal.absNorm D:ℝ)) M T hK hscale hM hT (activeGcdColumns N a D c) hp.1 (fun j => ⟨(hp.2.1 j).1,(hp.2.1 j).2.1,(hp.2.1 j).2.2.1⟩) hp.2.2 (fun j => (hp.2.1 j).2.2.2) (activeGcdCoefficient N a D c) QuadraticInitialBound.annularSieveCutoff QuadraticInitialBound.annularSieveCutoff_zero end def selectedPoissonT (C M X η : ℝ) : ℝ := C*(M*X)^η def selectedPoissonK (C M X η : ℝ) : ℝ := selectedPoissonT C M X η*X^2/M theorem selectedPoisson_bounds (C M X η : ℝ) (hC : 4≤C) (hM : 1≤M) (hX : 1≤X) (hMX : M≤X^2) (hη : 0≤η) : 4≤ selectedPoissonT C M X η ∧ 1≤ selectedPoissonK C M X η ∧ selectedPoissonK C M X η≤C*(M*X)^(η+2) := by have hM0 : 0 (hderiv p hp).hasFDerivWithinAt) hinj (s.indicator hyperbolicDensity) rw [himage] at hc rw [hc] apply setLIntegral_congr_fun euclideanUpperHalf_measurable intro p hp by_cases hsfp : f p∈s · simp only [Set.indicator_of_mem hsfp,Set.mem_preimage,hsfp,Set.indicator_of_mem] exact (hjac p hp).symm · simp only [Set.indicator_of_notMem hsfp,mul_zero] have hpnot : p∉f ⁻¹' s := hsfp exact Set.indicator_of_notMem hpnot hyperbolicDensity def euclideanInversion : EuclideanSpatial → EuclideanSpatial := inversion 0 1 def euclideanInversionDeriv (p : EuclideanSpatial) : EuclideanSpatial →L[ℝ] EuclideanSpatial := (1/‖p‖)^2 • (((ℝ ∙ p)ᗮ).reflection : EuclideanSpatial →L[ℝ] EuclideanSpatial) lemma euclideanInversion_apply (p : EuclideanSpatial) (j : Fin 3) : euclideanInversion p j=(1/‖p‖)^2*p j := by simp [euclideanInversion,inversion,dist_zero_right] lemma euclideanInversion_measurable : Measurable euclideanInversion := by simp +unfoldPartialApp only [euclideanInversion,inversion,dist_zero_right,vsub_eq_sub,sub_zero,vadd_eq_add,add_zero] fun_prop lemma euclideanUpperHalf_ne_zero (p : EuclideanSpatial) (hp : p∈euclideanUpperHalf) : p≠0 := by intro he simp [euclideanUpperHalf,he] at hp lemma euclideanInversion_mem (p : EuclideanSpatial) (hp : p∈euclideanUpperHalf) : euclideanInversion p∈euclideanUpperHalf := by change 0 euclideanInversion_hasFDerivAt p (euclideanUpperHalf_ne_zero p hp) · exact (inversion_injective 0 (by norm_num : (1:ℝ)≠0)).injOn · exact euclideanInversion_image · exact euclideanInversion_jacobian_density end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.HyperbolicVolume namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CubicEisenstein open Filter MeasureTheory EuclideanGeometry open scoped BigOperators Classical Topology InnerProductSpace ENNReal Matrix lemma linear_preserves_hyperbolicVolume (A : EuclideanSpatial →L[ℝ] EuclideanSpatial) (k : ℝ) (hk : 0 A) A.continuous.measurable (fun p hp => A.hasFDerivAt) hinj.injOn · apply Set.Subset.antisymm · rintro q ⟨p,hp,rfl⟩ exact show 0<(A p) 2 by rw [hh]; exact mul_pos hk hp · intro q hq obtain ⟨p,hp⟩ := hsurj q refine ⟨p,?_,hp⟩ change 0

p+u) hyperbolicEuclideanVolume=hyperbolicEuclideanVolume := by apply hyperbolic_volume_map_of_jacobian (fun p => p+u) (fun _ => ContinuousLinearMap.id ℝ _) (continuous_id.add continuous_const).measurable (fun p hp => (hasFDerivAt_id p).add_const u) (add_left_injective u).injOn · apply Set.Subset.antisymm · rintro q ⟨p,hp,rfl⟩ simpa [euclideanUpperHalf,hu] using hp · intro p hp refine ⟨p-u,?_,sub_add_cancel p u⟩ simpa [euclideanUpperHalf,hu] using hp · intro p hp have hid : (ContinuousLinearMap.id ℝ EuclideanSpatial).det=1 := by change LinearMap.det (LinearMap.id : EuclideanSpatial →ₗ[ℝ] EuclideanSpatial)=1 simp simp [hyperbolicDensity,hu,hid] def euclideanMatrixOperator (M : Matrix (Fin 3) (Fin 3) ℝ) : EuclideanSpatial →L[ℝ] EuclideanSpatial := M.toEuclideanLin.toContinuousLinearMap lemma euclideanMatrixOperator_apply (M : Matrix (Fin 3) (Fin 3) ℝ) (p : EuclideanSpatial) (j : Fin 3) : euclideanMatrixOperator M p j=∑i,M j i*p i := rfl lemma euclideanMatrixOperator_det (M : Matrix (Fin 3) (Fin 3) ℝ) : (euclideanMatrixOperator M).det=M.det := by change LinearMap.det (Matrix.toEuclideanLin M)=M.det rw [Matrix.toEuclideanLin_eq_toLin_orthonormal,LinearMap.det_toLin] def euclideanWeylReflection : EuclideanSpatial →L[ℝ] EuclideanSpatial := euclideanMatrixOperator !![-1,0,0;0,1,0;0,0,1] lemma euclideanWeylReflection_apply (p : EuclideanSpatial) : euclideanWeylReflection p 0= -p 0 ∧ euclideanWeylReflection p 1=p 1 ∧ euclideanWeylReflection p 2=p 2 := by simp [euclideanWeylReflection,euclideanMatrixOperator_apply,Fin.sum_univ_three] lemma euclideanWeylReflection_preserves_hyperbolicVolume : Measure.map euclideanWeylReflection hyperbolicEuclideanVolume=hyperbolicEuclideanVolume := by apply linear_preserves_hyperbolicVolume euclideanWeylReflection 1 (by norm_num) · intro p simpa using (euclideanWeylReflection_apply p).2.2 · simp [euclideanWeylReflection,euclideanMatrixOperator_det,Matrix.det_fin_three] def euclideanComplexDilation (β : ℂ) : EuclideanSpatial →L[ℝ] EuclideanSpatial := euclideanMatrixOperator !![(β^2).re,-(β^2).im,0;(β^2).im,(β^2).re,0;0,0,Complex.normSq β] lemma euclideanComplexDilation_apply (β : ℂ) (p : EuclideanSpatial) : euclideanComplexDilation β p 0=(β^2).re*p 0-(β^2).im*p 1 ∧ euclideanComplexDilation β p 1=(β^2).im*p 0+(β^2).re*p 1 ∧ euclideanComplexDilation β p 2=Complex.normSq β*p 2 := by simp [euclideanComplexDilation,euclideanMatrixOperator_apply,Fin.sum_univ_three,sub_eq_add_neg] lemma euclideanComplexDilation_det (β : ℂ) : (euclideanComplexDilation β).det=Complex.normSq β^3 := by rw [euclideanComplexDilation,euclideanMatrixOperator_det,Matrix.det_fin_three] have h : (β^2).re^2+(β^2).im^2=(Complex.normSq β)^2 := by simpa [Complex.normSq_apply,sq] using map_pow Complex.normSq β 2 change (β^2).re*(β^2).re*Complex.normSq β-(β^2).re*0*0- (-(β^2).im)*(β^2).im*Complex.normSq β+(-(β^2).im)*0*0+ 0*(β^2).im*0-0*(β^2).re*0=Complex.normSq β^3 calc _ = ((β^2).re^2+(β^2).im^2)*Complex.normSq β := by ring _ = _ := by rw [h]; ring lemma euclideanComplexDilation_preserves_hyperbolicVolume (β : ℂ) (hβ : β≠0) : Measure.map (euclideanComplexDilation β) hyperbolicEuclideanVolume=hyperbolicEuclideanVolume := by apply linear_preserves_hyperbolicVolume (euclideanComplexDilation β) (Complex.normSq β) (Complex.normSq_pos.mpr hβ) (fun p => (euclideanComplexDilation_apply β p).2.2) rw [euclideanComplexDilation_det,abs_of_nonneg (pow_nonneg (Complex.normSq_nonneg β) 3)] end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace CubicEisenstein abbrev hyperbolicMeasurableSpace : MeasurableSpace HyperbolicSpace := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology borel HyperbolicSpace theorem hyperbolicBorelSpace : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace BorelSpace HyperbolicSpace := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ⟨rfl⟩ lemma continuous_hyperbolic_action : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (g : SL(2,ℂ)), Continuous (fun w : HyperbolicSpace => g • w) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (g : SL(2,ℂ)) => by apply (QuotientGroup.isQuotientMap_mk compactSubgroup).continuous_iff.mpr exact continuous_hyperbolicProjection.comp (continuous_complexSL_mul g) def positiveCoordinateHeight (p : EuclideanSpatial) : ℝ := if 0

(p 0:ℂ)+Complex.I*(p 1:ℂ)) fun_prop · exact Measurable.ite euclideanUpperHalf_measurable (by fun_prop) measurable_const lemma euclideanToHyperbolic_measurable : letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.hyperbolicBorelSpace Measurable euclideanToHyperbolic := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.hyperbolicBorelSpace continuous_upperCoordinates.measurable.comp euclideanToUpperCoordinates_measurable lemma euclideanToHyperbolic_positive (p : EuclideanSpatial) (hp : 0

g • w) hyperbolicVolume=hyperbolicVolume := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.hyperbolicBorelSpace fun (g : SL(2,ℂ)) (f : EuclideanSpatial → EuclideanSpatial) (hf : Measurable f) (hvol : Measure.map f hyperbolicEuclideanVolume=hyperbolicEuclideanVolume) (hcompat : ∀p,0

by unfold hyperbolicVolume rw [Measure.map_map (continuous_hyperbolic_action g).measurable euclideanToHyperbolic_measurable] calc _ = Measure.map (euclideanToHyperbolic ∘ f) hyperbolicEuclideanVolume := by apply Measure.map_congr filter_upwards [hyperbolicEuclideanVolume_ae_positive] with p hp exact (hcompat p hp).symm _ = _ := by rw [←Measure.map_map euclideanToHyperbolic_measurable hf,hvol] lemma matrix_point_coordinates (g : SL(2,ℂ)) : (g : HyperbolicSpace)=upperPoint (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g) := by obtain ⟨k,hk,hg⟩ := matrix_iwasawa_factor g apply Eq.symm apply Quotient.sound apply QuotientGroup.leftRel_apply.mpr change (upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g))⁻¹*g∈compactSubgroup have hcancel : (upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g))⁻¹*g=k := by calc _ = (upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g))⁻¹* (upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g)*k) := congrArg (fun M => (upperSection (matrixHorizontal g) (liftedHeight g) (liftedHeight_pos g))⁻¹*M) hg _ = k := inv_mul_cancel_left _ _ rwa [hcancel] open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix def matrixCross (g : SL(2,ℂ)) : ℂ := g 0 0*star (g 1 0)+g 0 1*star (g 1 1) lemma matrixHorizontal_eq_cross_height (g : SL(2,ℂ)) : matrixHorizontal g=matrixCross g*(liftedHeight g:ℂ) := by unfold matrixHorizontal matrixCross liftedHeight rw [Complex.ofReal_inv] rfl lemma matrixCross_upperSection (g : SL(2,ℂ)) (z : ℂ) (v : ℝ) (hv : 0 (QuotientGroup.mk g : HyperbolicSpace)) apply Subtype.ext change (complexTranslation b : Matrix (Fin 2) (Fin 2) ℂ) * (upperSection z v hv : Matrix (Fin 2) (Fin 2) ℂ) = (upperSection (z + b) v hv : Matrix (Fin 2) (Fin 2) ℂ) ext i j fin_cases i <;> fin_cases j <;> simp [complexTranslation,upperSection,Matrix.mul_apply, Fin.sum_univ_two,div_eq_mul_inv] ; ring lemma complexWeyl_action (z : ℂ) (v : ℝ) (hv : 0 fin_cases j <;> simp [complexTranslation,complexDiagonal,complexWeyl,Matrix.mul_apply,Fin.sum_univ_two,hc] <;> field_simp ; linear_combination -hd lemma complex_bruhat_zero (g : SL(2,ℂ)) (hc : g 1 0=0) : ∃ha : g 0 0≠0,g=complexDiagonal (g 0 0) ha*complexTranslation (g 0 1/g 0 0) := by have hd : g 0 0*g 1 1=1 := by simpa only [Matrix.det_fin_two,hc,mul_zero,sub_zero] using g.property have ha : g 0 0≠0 := by intro h; simp [h] at hd refine ⟨ha,?_⟩ apply Subtype.ext change (g : Matrix (Fin 2) (Fin 2) ℂ) = (complexDiagonal (g 0 0) ha : Matrix (Fin 2) (Fin 2) ℂ) * (complexTranslation (g 0 1 / g 0 0) : Matrix (Fin 2) (Fin 2) ℂ) ext i j fin_cases i <;> fin_cases j <;> simp [complexTranslation,complexDiagonal,Matrix.mul_apply,Fin.sum_univ_two,hc] <;> field_simp ; linear_combination hd def euclideanHorizontalTranslation (b : ℂ) : EuclideanSpatial := WithLp.toLp 2 ![b.re,b.im,0] lemma complexTranslation_preserves_hyperbolicVolume : letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (b : ℂ), Measure.map (fun w => complexTranslation b • w) hyperbolicVolume=hyperbolicVolume := letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (b : ℂ) => by apply hyperbolicVolume_map_of_coordinate_action (complexTranslation b) (fun p => p+euclideanHorizontalTranslation b) (continuous_id.add continuous_const).measurable (translation_preserves_hyperbolicVolume _ rfl) intro p hp have hq : 0<(p+euclideanHorizontalTranslation b) 2 := by simpa [euclideanHorizontalTranslation] using hp rw [euclideanToHyperbolic_positive _ hq,euclideanToHyperbolic_positive _ hp,complexTranslation_action] apply upperPoint_congr · apply Complex.ext <;> simp [euclideanHorizontalTranslation] · simp [euclideanHorizontalTranslation] lemma complexDiagonal_preserves_hyperbolicVolume : letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (b : ℂ) (hb : b≠0), Measure.map (fun w => complexDiagonal b hb • w) hyperbolicVolume=hyperbolicVolume := letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (b : ℂ) (hb : b≠0) => by apply hyperbolicVolume_map_of_coordinate_action (complexDiagonal b hb) (euclideanComplexDilation b) (euclideanComplexDilation b).continuous.measurable (euclideanComplexDilation_preserves_hyperbolicVolume b hb) intro p hp obtain ⟨h0,h1,h2⟩ := euclideanComplexDilation_apply b p have hq : 0<(euclideanComplexDilation b p) 2 := by rw [h2]; exact mul_pos (Complex.normSq_pos.mpr hb) hp rw [euclideanToHyperbolic_positive _ hq,euclideanToHyperbolic_positive _ hp,complexDiagonal_action] apply upperPoint_congr · rw [h0,h1] apply Complex.ext <;> simp [Complex.mul_re,Complex.mul_im] ; ring · exact h2 lemma euclidean_complex_norm_sq (p : EuclideanSpatial) : ‖(p 0:ℂ)+Complex.I*(p 1:ℂ)‖^2+(p 2)^2=‖p‖^2 := by rw [←Complex.normSq_eq_norm_sq,Complex.normSq_apply,EuclideanSpace.real_norm_sq_eq] simp [Fin.sum_univ_three,sq] def euclideanWeylAction (p : EuclideanSpatial) : EuclideanSpatial := euclideanWeylReflection (euclideanInversion p) lemma euclideanWeylAction_measurable : Measurable euclideanWeylAction := euclideanWeylReflection.continuous.measurable.comp euclideanInversion_measurable lemma euclideanWeylAction_preserves_hyperbolicVolume : Measure.map euclideanWeylAction hyperbolicEuclideanVolume=hyperbolicEuclideanVolume := by rw [show euclideanWeylAction=euclideanWeylReflection ∘ euclideanInversion from rfl, ←Measure.map_map euclideanWeylReflection.continuous.measurable euclideanInversion_measurable, euclideanInversion_preserves_hyperbolicVolume,euclideanWeylReflection_preserves_hyperbolicVolume] lemma euclideanWeylAction_apply (p : EuclideanSpatial) : euclideanWeylAction p 0= -((1/‖p‖)^2*p 0) ∧ euclideanWeylAction p 1=(1/‖p‖)^2*p 1 ∧ euclideanWeylAction p 2=(1/‖p‖)^2*p 2 := by simpa [euclideanWeylAction,euclideanInversion_apply] using euclideanWeylReflection_apply (euclideanInversion p) lemma complexWeyl_preserves_hyperbolicVolume : letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measure.map (fun w => complexWeyl • w) hyperbolicVolume=hyperbolicVolume := letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply hyperbolicVolume_map_of_coordinate_action complexWeyl euclideanWeylAction euclideanWeylAction_measurable euclideanWeylAction_preserves_hyperbolicVolume intro p hp have hn : ‖p‖≠0 := norm_ne_zero_iff.mpr (euclideanUpperHalf_ne_zero p hp) have hnc : (‖p‖:ℂ)≠0 := Complex.ofReal_ne_zero.mpr hn obtain ⟨h0,h1,h2⟩ := euclideanWeylAction_apply p have hq : 0 g • w) hyperbolicVolume=hyperbolicVolume) (hh : Measure.map (fun w => h • w) hyperbolicVolume=hyperbolicVolume), Measure.map (fun w => (g*h) • w) hyperbolicVolume=hyperbolicVolume := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.hyperbolicBorelSpace fun (g h : SL(2,ℂ)) (hg : Measure.map (fun w => g • w) hyperbolicVolume=hyperbolicVolume) (hh : Measure.map (fun w => h • w) hyperbolicVolume=hyperbolicVolume) => by rw [show (fun w : HyperbolicSpace => (g*h) • w)=(fun w => g • w) ∘ (fun w => h • w) by funext w; exact mul_smul g h w, ←Measure.map_map (continuous_hyperbolic_action g).measurable (continuous_hyperbolic_action h).measurable, hh,hg] theorem hyperbolicVolume_invariant : letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (g : SL(2,ℂ)), Measure.map (fun w => g • w) hyperbolicVolume=hyperbolicVolume := letI := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (g : SL(2,ℂ)) => by by_cases hc : g 1 0=0 · obtain ⟨ha,hg⟩ := complex_bruhat_zero g hc rw [hg] exact hyperbolicVolume_invariant_mul _ _ (complexDiagonal_preserves_hyperbolicVolume _ ha) (complexTranslation_preserves_hyperbolicVolume _) · rw [complex_bruhat_nonzero g hc] exact hyperbolicVolume_invariant_mul _ _ (hyperbolicVolume_invariant_mul _ _ (hyperbolicVolume_invariant_mul _ _ (complexTranslation_preserves_hyperbolicVolume _) (complexDiagonal_preserves_hyperbolicVolume _ (inv_ne_zero hc))) complexWeyl_preserves_hyperbolicVolume) (complexTranslation_preserves_hyperbolicVolume _) end CubicEisenstein open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct primeProductNorm) open ConcreteTraceCRT (eisEmbedding) def globalBinTripleRange (B : ℝ) (j : GlobalLogIndex) : ℝ := (B*Real.sqrt (globalLogRep j 9)/globalLogRep j 4)*globalLogRep j 2*globalLogRep j 3 def globalBinFirstCoefficient (K ell B F : ℝ) (j : GlobalLogIndex) : ℝ := K/(globalLogRep j 5*ell*B^2*F*Real.sqrt (globalLogRep j 9)) def globalBinChildCharge (B F : ℝ) (j : GlobalLogIndex) : ℝ := 128^3*(Real.exp 1)^14*globalPooledDelta B F j*B^2/globalLogRep j 4 theorem globalBinTripleRange_nonneg (B : ℝ) (hB : 0 ≤ B) (j : GlobalLogIndex) : 0 ≤ globalBinTripleRange B j := by unfold globalBinTripleRange have h2 := (globalLogRep_pos j 2).le have h3 := (globalLogRep_pos j 3).le have h4 := (globalLogRep_pos j 4).le positivity theorem globalBin_complete_cost (K ell B F : ℝ) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) (j : GlobalLogIndex) (ray : SecondRayIndex) : globalBinFirstCoefficient K ell B F j * globalPooledOuterBound ray ell (globalPooledRowScale K ell B F j) j * (globalPooledColumnScale ell j*globalPooledLabelScale j) * (128^3*(Real.exp 1)^3*globalBinTripleRange B j) = globalBinChildCharge B F j*‖secondRayCoefficient ray‖ := by have h (i : Fin 10) := (globalLogRep_pos j i).ne' have hs := (Real.sqrt_pos.mpr (globalLogRep_pos j 9)).ne' have he : Real.exp 4=(Real.exp 1)^4 := by simp unfold globalBinFirstCoefficient globalPooledOuterBound globalPooledRowScale globalPooledColumnScale globalPooledLabelScale globalBinTripleRange globalBinChildCharge globalPooledDelta rw [he] field_simp [h] theorem globalBin_mass_balance (ell B F : ℝ) (hB : 0 < B) (hF : 0 < F) (j : GlobalLogIndex) : globalBinChildCharge B F j*(globalPooledColumnScale ell j*globalPooledLabelScale j) = 128^3*(Real.exp 1)^18*((ell*B^3)*F) := by rw [globalPooled_mass ell B F hB hF] have hD := (globalPooledDelta_pos B F hB hF j).ne' have hJ := (globalLogRep_pos j 4).ne' have he : Real.exp 4=(Real.exp 1)^4 := by simp unfold globalBinChildCharge rw [he] field_simp variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] include hp in theorem globalBin_active_bounds (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) : Real.sqrt (globalLogRep (globalScaleIndex p side x) 9) ≤ globalCubeActiveRoot p x ∧ globalCubeActiveRoot p x ≤ Real.sqrt (globalLogRep (globalScaleIndex p side x) 9)*Real.exp 1 := by have hr := globalScaleIndex_bounds p hp side x hk 9 change globalLogRep (globalScaleIndex p side x) 9 ≤ (globalCubeActiveRoot p x)^2 ∧ (globalCubeActiveRoot p x)^2 ≤ globalLogRep (globalScaleIndex p side x) 9*Real.exp 1 at hr have hx := (globalCubeActiveRoot_pos p hp x).le constructor · exact Real.sqrt_le_iff.mpr ⟨hx,hr.1⟩ · have hs := Real.sq_sqrt (globalLogRep_pos (globalScaleIndex p side x) 9).le have he : 1 ≤ Real.exp 1 := Real.one_le_exp (by norm_num) have hrep := (globalLogRep_pos (globalScaleIndex p side x) 9).le have hm : (globalCubeActiveRoot p x)^2 ≤ (Real.sqrt (globalLogRep (globalScaleIndex p side x) 9)*Real.exp 1)^2 := by calc _ ≤ globalLogRep (globalScaleIndex p side x) 9*Real.exp 1 := hr.2 _ ≤ globalLogRep (globalScaleIndex p side x) 9*(Real.exp 1)^2 := by gcongr; nlinarith _ = _ := by rw [mul_pow,hs] exact (sq_le_sq₀ hx (mul_nonneg (Real.sqrt_nonneg _) (Real.exp_pos 1).le)).mp hm include hp in theorem globalBin_first_coefficient_bound (K ell B F : ℝ) (hK : 0 ≤ K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) : K/(primeProductNorm p x.firstDivisor*ell*B^2*F*globalCubeActiveRoot p x) ≤ globalBinFirstCoefficient K ell B F (globalScaleIndex p side x) := by have hd := (globalScaleIndex_bounds p hp side x hk 5).1 have ha := (globalBin_active_bounds p hp side x hk).1 change globalLogRep (globalScaleIndex p side x) 5 ≤ primeProductNorm p x.firstDivisor at hd have h5 := globalLogRep_pos (globalScaleIndex p side x) 5 have hs := Real.sqrt_pos.mpr (globalLogRep_pos (globalScaleIndex p side x) 9) have hd0 := (FirstPassCubeLabels.primeProductNorm_pos p hp x.firstDivisor).le unfold globalBinFirstCoefficient apply div_le_div_of_nonneg_left hK (by positivity) gcongr include hp in theorem globalBin_triple_bounds (B : ℝ) (hB : 0 < B) (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) : let j := globalScaleIndex p side x (Ideal.absNorm (globalSecondFixedTriple p x).1 : ℝ) ≤ B*(Real.sqrt (globalLogRep j 9)*Real.exp 1)/globalLogRep j 4 ∧ (Ideal.absNorm (globalSecondFixedTriple p x).2.1 : ℝ) ≤ globalLogRep j 2*Real.exp 1 ∧ (Ideal.absNorm (globalSecondFixedTriple p x).2.2 : ℝ) ≤ globalLogRep j 3*Real.exp 1 := by dsimp only exact globalSecondFixedTriple_norm_bounds p hp x B _ _ _ _ hB.le (globalLogRep_pos _ 4) hb₁ hb₂ (globalBin_active_bounds p hp side x hk).2 (globalScaleIndex_bounds p hp side x hk 4).1 (globalScaleIndex_bounds p hp side x hk 2).2 (globalScaleIndex_bounds p hp side x hk 3).2 include hp in theorem globalBin_triple_count (B : ℝ) (hB : 0 < B) (side : Bool) (s : Finset (GlobalSecondData ι)) (j : GlobalLogIndex) (hj : ∀ x∈s,globalScaleIndex p side x=j) (hk : ∀ x∈s,x.source.frequency ≠ 0) (hb₁ : ∀ x∈s,‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ∀ x∈s,‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) : ((s.image (globalSecondFixedTriple p)).card : ℝ) ≤ 128^3*(Real.exp 1)^3*globalBinTripleRange B j := by by_cases hs : s.Nonempty · obtain ⟨x,hxs⟩ := hs have hb := globalBin_triple_bounds p hp B hB side x (hk x hxs) (hb₁ x hxs) (hb₂ x hxs) dsimp only at hb rw [hj x hxs] at hb have hn : 1 ≤ (Ideal.absNorm (globalSecondFixedTriple p x).1 : ℝ) := by have hh : 1 ≤ Ideal.absNorm (globalSecondFixedTriple p x).1 := Nat.one_le_iff_ne_zero.mpr (fun h => (globalSecondFixedTriple_nonzero p hp x).1 (Ideal.absNorm_eq_zero_iff.mp h)) exact_mod_cast hh have hcount := globalSecondFixedTriple_count p hp s B (Real.sqrt (globalLogRep j 9)*Real.exp 1) (globalLogRep j 4) (globalLogRep j 2*Real.exp 1) (globalLogRep j 3*Real.exp 1) hB.le (globalLogRep_pos j 4) (hn.trans hb.1) (one_le_mul_of_one_le_of_one_le (globalLogRep_ge_one j 2) (Real.one_le_exp (by norm_num))) (one_le_mul_of_one_le_of_one_le (globalLogRep_ge_one j 3) (Real.one_le_exp (by norm_num))) hb₁ hb₂ (fun y hy => by have hh := (globalBin_active_bounds p hp side y (hk y hy)).2; rwa [hj y hy] at hh) (fun y hy => by have hh := (globalScaleIndex_bounds p hp side y (hk y hy) 4).1; rwa [hj y hy] at hh) (fun y hy => by have hh := (globalScaleIndex_bounds p hp side y (hk y hy) 2).2; rwa [hj y hy] at hh) (fun y hy => by have hh := (globalScaleIndex_bounds p hp side y (hk y hy) 3).2; rwa [hj y hy] at hh) convert hcount using 1 ; unfold globalBinTripleRange ; ring · have hz : s=∅ := Finset.not_nonempty_iff_eq_empty.mp hs rw [hz] simp only [Finset.image_empty,Finset.card_empty,Nat.cast_zero] exact mul_nonneg (by positivity) (globalBinTripleRange_nonneg B hB.le j) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.UniformTransfer namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform namespace SecondPassArithmetic open ActualEisensteinCubic open ConcretePrimeRowBridge (idealGenerator) open SecondPassFiber (OldTuple newLabel newRow Valid) noncomputable abbrev instFintypeUnitsO_4 : Fintype Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units theorem full_uniform_labeled_child_second_energy_pushforward (ε : ℝ) (hε : 0 < ε) : letI unitFintypeWitness := OAI.SecondPassArithmetic.instFintypeUnitsO_4 ∃ C : ℝ, 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}), ∀ (s : Finset OldTuple) (t : Finset (Ideal O × O)) (b0 : Ideal O) (w : OldTuple → ℂ) (B lengthScale : ℝ) (label : OldTuple → O) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (negative : Bool), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ t) → (∀ z ∈ t, z.1 ≠ ⊥) → (∀ z ∈ t, (Ideal.absNorm z.1 : ℝ) ≤ lengthScale) → (∀ x ∈ s, ‖w x‖ ≤ B) → (∀ x ∈ s, Ideal.span {label x} = newLabel x) → (∑ x ∈ s, ‖w x‖ * ‖fixedChildRow p hp hcop hg F Ψ m H (label x) (if negative then -newRow x else newRow x)‖ ^ 2) ≤ B * C * (lengthScale * Ideal.absNorm b0) ^ ε * ∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ m H negative u z‖ ^ 2 := by letI unitFintypeWitness := OAI.SecondPassArithmetic.instFintypeUnitsO_4 exact ( by obtain ⟨C, hC, hb⟩ := second_energy_selected_family (κ := Oˣ) ε hε refine ⟨C, hC, ?_⟩ intro ι _ p hp _ hcop hg s t b0 w B lengthScale label F Ψ m H negative hb0 hB hL hvalid hmap ht hnorm hw hlabel let sel : OldTuple → Oˣ := fun x => if hx : x ∈ s then Classical.choose (exists_label_unit (label x) (newLabel x) (hlabel x hx)) else 1 have hsel (x : OldTuple) (hx : x ∈ s) : label x = (sel x : O) * idealGenerator (newLabel x) := by simp only [sel, dif_pos hx] exact Classical.choose_spec (exists_label_unit (label x) (newLabel x) (hlabel x hx)) have hh := hb s t b0 w B lengthScale (idealChildRow p hp hcop hg F Ψ m H negative) sel hb0 hB hL hvalid hmap ht hnorm hw convert hh using 1 apply Finset.sum_congr rfl intro x hx rw [hsel x hx] rfl ) theorem full_uniform_fixed_second_mode_transfer (ε : ℝ) (hε : 0 < ε) : letI unitFintypeWitness := OAI.SecondPassArithmetic.instFintypeUnitsO_4 ∃ C : ℝ, 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}), ∀ (s : Finset OldTuple) (t : Finset (Ideal O × O)) (b0 : Ideal O) (w : OldTuple → ℂ) (B lengthScale : ℝ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (H₁ H₂ : Finset ι → ℂ), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ t) → (∀ z ∈ t, z.1 ≠ ⊥) → (∀ z ∈ t, (Ideal.absNorm z.1 : ℝ) ≤ lengthScale) → (∀ x ∈ s, ‖w x‖ ≤ B) → (∀ x ∈ s, Ideal.span {label x} = newLabel x) → ‖fixedSecondMode p hp hcop hg s w label F Ψ₁ Ψ₂ m H₁ H₂‖ ≤ (B * C * (lengthScale * Ideal.absNorm b0)^ε) * Real.sqrt (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₁ m H₁ false u z‖ ^ 2) * Real.sqrt (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₂ m H₂ true u z‖ ^ 2) := by letI unitFintypeWitness := OAI.SecondPassArithmetic.instFintypeUnitsO_4 exact ( by obtain ⟨C, hC, hpush⟩ := full_uniform_labeled_child_second_energy_pushforward ε hε refine ⟨C, hC, ?_⟩ intro ι _ p hp _ hcop hg have hpush := hpush p hp hcop hg intro s t b0 w B lengthScale label F Ψ₁ Ψ₂ m H₁ H₂ hb0 hB hL hv hm ht hn hw hl let P₁ := fun x => fixedChildRow p hp hcop hg F Ψ₁ m H₁ (label x) (newRow x) let P₂ := fun x => fixedChildRow p hp hcop hg F Ψ₂ m H₂ (label x) (-newRow x) have h₁ := hpush s t b0 w B lengthScale label F Ψ₁ m H₁ false hb0 hB hL hv hm ht hn hw hl have h₂ := hpush s t b0 w B lengthScale label F Ψ₂ m H₂ true hb0 hB hL hv hm ht hn hw hl simp only [Bool.false_eq_true, ite_false, ite_true] at h₁ h₂ let D : ℝ := B * C * (lengthScale * Ideal.absNorm b0)^ε have hD : 0 ≤ D := by dsimp [D]; positivity have hCau := DescentWeightedCauchy.weighted_cauchy s w P₂ P₁ have hmode : fixedSecondMode p hp hcop hg s w label F Ψ₁ Ψ₂ m H₁ H₂ = ∑ x ∈ s, w x * P₂ x * star (P₁ x) := by unfold fixedSecondMode apply Finset.sum_congr rfl intro x hx dsimp [P₁, P₂] ring rw [hmode] apply hCau.trans calc _ ≤ Real.sqrt (D * (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₂ m H₂ true u z‖ ^ 2)) * Real.sqrt (D * (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₁ m H₁ false u z‖ ^ 2)) := by gcongr _ = _ := by rw [Real.sqrt_mul hD, Real.sqrt_mul hD] calc _ = (Real.sqrt D)^2 * Real.sqrt (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₁ m H₁ false u z‖ ^ 2) * Real.sqrt (∑ u : Oˣ, ∑ z ∈ t, ‖idealChildRow p hp hcop hg F Ψ₂ m H₂ true u z‖ ^ 2) := by ring _ = _ := by rw [Real.sq_sqrt hD] ) end SecondPassArithmetic namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation open SecondPassFiber (OldTuple newLabel newRow Valid) def instFintypeUnitsO_2 : Fintype Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units theorem full_uniform_integrated_fixed_second_mode_transfer (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}), ∀ (s : Finset OldTuple) (T : Finset (Ideal O × O)) (b0 : Ideal O) (w : Frequency → OldTuple → ℂ) (B lengthScale : ℝ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ : ℝ) (b₁ b₂ b₃ : 𝓢(ℝ, ℂ)), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ T) → (∀ z ∈ T, z.1 ≠ ⊥) → (∀ z ∈ T, (Ideal.absNorm z.1 : ℝ) ≤ lengthScale) → (∀ q, ∀ x ∈ s, ‖w q x‖ ≤ B) → (∀ x ∈ s, Continuous (fun q => w q x)) → (∀ x ∈ s, Ideal.span {label x} = newLabel x) → ‖integratedSecondMode p hp hcop hg b₁ b₂ b₃ s w label F Ψ₁ Ψ₂ m V₁ V₂ X₁ X₂‖ ≤ (B * C * (lengthScale * Ideal.absNorm b0)^ε) * (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, ‖tripleCoefficient b₁ b₂ b₃ (t₁,t₂,t₃)‖ * childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ (t₁,t₂,t₃)) := by letI unitFintypeWitness := OAI.SecondPassArithmetic.instFintypeUnitsO_4 exact ( by obtain ⟨C, hC, hb⟩ := full_uniform_fixed_second_mode_transfer ε hε refine ⟨C, hC, ?_⟩ intro ι _ p hp _ hcop hg have hb := hb p hp hcop hg intro s T b0 w B lengthScale label F Ψ₁ Ψ₂ m V₁ V₂ X₁ X₂ b₁ b₂ b₃ hb0 hB hL hv hm ht hn hw hwc hl let f : Frequency → ℂ := fun q => fixedSecondMode p hp hcop hg s (w q) label F Ψ₁ Ψ₂ m (fixedSecondTest p V₁ X₁ q.1 q.2.2 true) (fixedSecondTest p V₂ X₂ q.2.1 q.2.2 false) let G := childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ have hc₁ := childEnergy_continuous p hp hcop hg F Ψ₁ m T V₁ X₁ true false (fun q : Frequency => q.1) (fun q : Frequency => q.2.2) continuous_fst continuous_snd.snd have hc₂ := childEnergy_continuous p hp hcop hg F Ψ₂ m T V₂ X₂ false true (fun q : Frequency => q.2.1) (fun q : Frequency => q.2.2) continuous_snd.fst continuous_snd.snd have hG : Continuous G := (Real.continuous_sqrt.comp hc₁).mul (Real.continuous_sqrt.comp hc₂) have hG0 : ∀ q, 0 ≤ G q := fun q => mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) let M := Real.sqrt (energyMagnitude p hp hcop hg F Ψ₁ m T V₁ X₁ true false) * Real.sqrt (energyMagnitude p hp hcop hg F Ψ₂ m T V₂ X₂ false true) have hM : ∀ q, G q ≤ M := by intro q dsimp [G, childGeometricMean, M] gcongr · exact childEnergy_le p hp hcop hg F Ψ₁ m T V₁ X₁ true false q.1 q.2.2 · exact childEnergy_le p hp hcop hg F Ψ₂ m T V₂ X₂ false true q.2.1 q.2.2 have hf : Continuous f := by unfold f fixedSecondMode apply continuous_finsetSum intro x hx have hwx := hwc x hx have hc₁ := fixedRow_continuous p hp hcop hg F Ψ₁ m (label x) (newRow x) V₁ X₁ true (fun q : Frequency => q.1) (fun q : Frequency => q.2.2) continuous_fst continuous_snd.snd have hc₂ := fixedRow_continuous p hp hcop hg F Ψ₂ m (label x) (-newRow x) V₂ X₂ false (fun q : Frequency => q.2.1) (fun q : Frequency => q.2.2) continuous_snd.fst continuous_snd.snd exact (hwx.mul hc₁.star).mul hc₂ have hpoint : ∀ q, ‖f q‖ ≤ (B * C * (lengthScale * Ideal.absNorm b0)^ε) * G q := by intro q have hh := hb s T b0 (w q) B lengthScale label F Ψ₁ Ψ₂ m (fixedSecondTest p V₁ X₁ q.1 q.2.2 true) (fixedSecondTest p V₂ X₂ q.2.1 q.2.2 false) hb0 hB hL hv hm ht hn (hw q) hl simpa only [f, G, childGeometricMean, childEnergy, mul_assoc] using hh exact triple_integral_bound b₁ b₂ b₃ f G hf hG hG0 (B * C * (lengthScale * Ideal.absNorm b0)^ε) M (by positivity) hM hpoint ) end SecondPassIntegration namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (firstLogDensity) theorem full_uniform_postCommonSmoothPair_fixed_tests (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), (∀ t₁ t₂ t₃ : ℝ, (1+R)^A * ‖(𝓕 A₁) t₁ * (𝓕 A₂) t₂ * b t₃‖ ≤ C * firstLogDensity J t₁ * firstLogDensity J t₂ * firstLogDensity J t₃) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}), ∀ (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m f y₁ y₂ : O) (z ud ue uv kap X₁ X₂ : ℝ), postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ A₁ A₂ W V z ud ue uv kap X₁ X₂ R = separatedPostCommon p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ A₁ A₂ b V z ud ue uv kap X₁ X₂ := by obtain ⟨C, hC, hsep⟩ := JointLogSeparation.seven_kernel_separation A₁ A₂ W V M hM hV A J refine ⟨C, hC, ?_⟩ intro R hR obtain ⟨b, hb, hpoint, hint⟩ := hsep R hR refine ⟨b, hpoint, ?_⟩ intro ι _ p hp _ hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ z ud ue uv kap X₁ X₂ exact postCommonSmoothPair_fixed_tests p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ A₁ A₂ W V z ud ue uv kap X₁ X₂ R b (hb z ud ue uv kap) end SecondPassArithmetic namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation open SecondPassFiber (OldTuple newLabel newRow Valid) end SecondPassIntegration namespace SecondPassArithmetic section open ActualEisensteinCubic open SecondPassFiber (newLabel newRow) open SecondPassIntegration (tupleSourceSum densityChildEnergy) open JointLogSeparation (outerWindow) end open ActualEisensteinCubic open FirstPassCubeLabels (firstLogDensity) theorem full_uniform_postCommonSmoothPair_twisted_fixed_tests (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), ∀ θ₁ θ₂ : ℝ, (∀ t₁ t₂ t₃ : ℝ, (1+R)^A * ‖(𝓕 (JointLogSeparation.frequencyTwist A₁ θ₁)) t₁ * (𝓕 (JointLogSeparation.frequencyTwist A₂ θ₂)) t₂ * b t₃‖ ≤ C * (1+‖θ₁‖)^(J+2) * (1+‖θ₂‖)^(J+2) * firstLogDensity J t₁ * firstLogDensity J t₂ * firstLogDensity J t₃) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}), ∀ (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m f y₁ y₂ : O) (z ud ue uv kap X₁ X₂ : ℝ), postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V z ud ue uv kap X₁ X₂ R = separatedPostCommon p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) b V z ud ue uv kap X₁ X₂ := by obtain ⟨C, hC, hsep⟩ := JointLogSeparation.seven_kernel_twisted_profiles A₁ A₂ W V M hM hV A J refine ⟨C, hC, ?_⟩ intro R hR obtain ⟨b, hb⟩ := hsep R hR refine ⟨b, ?_⟩ intro θ₁ θ₂ obtain ⟨hid, hpoint, hint⟩ := hb θ₁ θ₂ refine ⟨hpoint, ?_⟩ intro ι _ p hp _ hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ z ud ue uv kap X₁ X₂ exact postCommonSmoothPair_fixed_tests p hp hcop hg F Ψ₁ Ψ₂ m f y₁ y₂ (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V z ud ue uv kap X₁ X₂ R b (hid z ud ue uv kap) end SecondPassArithmetic namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic JointLogSeparation open SecondPassFiber (OldTuple newLabel newRow Valid) theorem full_uniform_tupleSource_twisted_transfer (ε : ℝ) (hε : 0 < ε) (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ j, 0 ≤ M j) (hV : ∀ j x, V j x ≠ 0 → |x| ≤ M j) (A J : ℕ) : ∃ Cₐ : ℝ, 0 < Cₐ ∧ ∃ Cₛ : ℝ, 0 ≤ Cₛ ∧ ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), ∀ θ₁ θ₂ : ℝ, (∀ t₁ t₂ t₃ : ℝ, (1 + R)^A * ‖(𝓕 (JointLogSeparation.frequencyTwist A₁ θ₁)) t₁ * (𝓕 (JointLogSeparation.frequencyTwist A₂ θ₂)) t₂ * b t₃‖ ≤ Cₛ * (1+‖θ₁‖)^(J+2) * (1+‖θ₂‖)^(J+2) * FirstPassCubeLabels.firstLogDensity J t₁ * FirstPassCubeLabels.firstLogDensity J t₂ * FirstPassCubeLabels.firstLogDensity J t₃) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}), ∀ (s : Finset OldTuple) (T : Finset (Ideal O × O)) (b0 : Ideal O) (w : OldTuple → ℂ) (B lengthScale : ℝ) (label : OldTuple → O) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (z ud ue uv kap : OldTuple → ℝ) (X₁ X₂ : ℝ), b0 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x ∈ s, Valid x (newLabel x) b0 (newRow x)) → (∀ x ∈ s, (newLabel x, newRow x) ∈ T) → (∀ z ∈ T, z.1 ≠ ⊥) → (∀ z ∈ T, (Ideal.absNorm z.1 : ℝ) ≤ lengthScale) → (∀ x ∈ s, ‖w x‖ * ‖outerWindow V (z x) (ud x) (ue x) (uv x) (kap x)‖ ≤ B) → (∀ x ∈ s, Ideal.span {label x} = newLabel x) → ‖tupleSourceSum p hp hcop hg s w label F Ψ₁ Ψ₂ m (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V z ud ue uv kap X₁ X₂ R‖ ≤ (B * Cₐ * (lengthScale * Ideal.absNorm b0)^ε) * (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, ‖tripleCoefficient (𝓕 (JointLogSeparation.frequencyTwist A₁ θ₁)) (𝓕 (JointLogSeparation.frequencyTwist A₂ θ₂)) b (t₁,t₂,t₃)‖ * childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T (V 5) (V 6) X₁ X₂ (t₁,t₂,t₃)) := by obtain ⟨Cₐ, hCₐ, htrans⟩ := full_uniform_integrated_fixed_second_mode_transfer ε hε obtain ⟨Cₛ, hCₛ, hsep⟩ := full_uniform_postCommonSmoothPair_twisted_fixed_tests A₁ A₂ W V M hM hV A J refine ⟨Cₐ, hCₐ, Cₛ, hCₛ, ?_⟩ intro R hR obtain ⟨b, hb⟩ := hsep R hR refine ⟨b, ?_⟩ intro θ₁ θ₂ obtain ⟨hpoint, hid⟩ := hb θ₁ θ₂ refine ⟨hpoint, ?_⟩ intro ι _ p hp _ hcop hg have htrans := htrans p hp hcop hg have hid := hid p hp hcop hg intro s T b0 w B lengthScale label F Ψ₁ Ψ₂ m z ud ue uv kap X₁ X₂ hb0 hB hL hv hm ht hn hw hl have hsource := tupleSource_eq_integratedSecondMode p hp hcop hg s w label F Ψ₁ Ψ₂ m (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W b V z ud ue uv kap X₁ X₂ R (fun x hx => hid F Ψ₁ Ψ₂ m (label x) (newRow x) (-newRow x) (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂) rw [hsource] apply htrans s T b0 (tupleOuterWeight V w z ud ue uv kap) B lengthScale label F Ψ₁ Ψ₂ m (V 5) (V 6) X₁ X₂ (𝓕 (JointLogSeparation.frequencyTwist A₁ θ₁)) (𝓕 (JointLogSeparation.frequencyTwist A₂ θ₂)) b hb0 hB hL hv hm ht hn · intro q x hx rw [tupleOuterWeight_norm] exact hw x hx · intro x hx exact tupleOuterWeight_continuous V w z ud ue uv kap x · exact hl end SecondPassIntegration open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform namespace SecondPassArithmetic open ActualEisensteinCubic open SecondPassFiber (newLabel newRow) open SecondPassIntegration (tupleSourceSum densityChildEnergy) open JointLogSeparation (outerWindow) theorem full_uniform_globalSecondSource_twisted_transfer (ε : ℝ) (hε : 0 < ε) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ i,0 ≤ M i) (hV : ∀ i x,V i x ≠ 0 → |x| ≤ M i) (A J : ℕ) : ∃ Cₐ : ℝ,0 < Cₐ ∧ ∃ Cₛ : ℝ,0 ≤ Cₛ ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})), ∀ (R : ℝ),0 < R → ∀ (θ₁ θ₂ : ℝ), ∀ (s : Finset (GlobalSecondData ι)) (T : Finset (Ideal O × O)) (q : Ideal O × Ideal O × Ideal O) (w : GlobalSecondData ι → ℂ) (B lengthScale : ℝ) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (z ud ue uv kap : GlobalSecondData ι → ℝ) (X₁ X₂ : ℝ), q.1 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x∈s,GlobalSecondAdmissible x) → (∀ x∈s,globalSecondFixedTriple p x=q) → (∀ x∈s,(newLabel (globalSecondTuple p x),newRow (globalSecondTuple p x))∈T) → (∀ a∈T,a.1 ≠ ⊥) → (∀ a∈T,(Ideal.absNorm a.1 : ℝ) ≤ lengthScale) → (∀ x∈s,‖w x‖*‖outerWindow V (z x) (ud x) (ue x) (uv x) (kap x)‖ ≤ B) → ‖globalSecondSource p hp hcop hg s w F Ψ₁ Ψ₂ (fixedTripleMask m q) (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V z ud ue uv kap X₁ X₂ R‖ ≤ (B*Cₐ*(lengthScale*Ideal.absNorm q.1)^ε) * (Cₛ*(1+‖θ₁‖)^(J+2)*(1+‖θ₂‖)^(J+2)/(1+R)^A) * densityChildEnergy p hp hcop hg F Ψ₁ Ψ₂ (fixedTripleMask m q) T (V 5) (V 6) X₁ X₂ J := by obtain ⟨Cₐ,hCₐ,Cₛ,hCₛ,htransfer⟩ := SecondPassIntegration.full_uniform_tupleSource_twisted_transfer ε hε A₁ A₂ W V M hM hV A J refine ⟨Cₐ,hCₐ,Cₛ,hCₛ,?_⟩ intro ι _ p hp _ hcop hg hinj R hR θ₁ θ₂ s T q w B lengthScale F Ψ₁ Ψ₂ m z ud ue uv kap X₁ X₂ hq hB hL hs hfixed hmap ht hn hw obtain ⟨b,hsep⟩ := htransfer R hR obtain ⟨hb,htrans⟩ := hsep θ₁ θ₂ have htrans := htrans p hp hcop hg let r := globalSecondRecover p s have hr (x : GlobalSecondData ι) (hx : x∈s) : r (globalSecondTuple p x)=x := globalSecondRecover_apply p hinj s q hs hfixed x hx have hvalid : ∀ y∈s.image (globalSecondTuple p), SecondPassFiber.Valid y (newLabel y) q.1 (newRow y) := by intro y hy obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hy have hv := globalSecondTuple_valid p x (hs x hx) simpa only [hfixed x hx] using hv have hmap' : ∀ y∈s.image (globalSecondTuple p),(newLabel y,newRow y)∈T := by intro y hy obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hy exact hmap x hx have hw' : ∀ y∈s.image (globalSecondTuple p), ‖(w ∘ r) y‖*‖outerWindow V ((z ∘ r) y) ((ud ∘ r) y) ((ue ∘ r) y) ((uv ∘ r) y) ((kap ∘ r) y)‖ ≤ B := by intro y hy obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hy simpa only [Function.comp_apply,hr x hx] using hw x hx have hlabel : ∀ y∈s.image (globalSecondTuple p),Ideal.span {(globalSecondLabel p ∘ r) y}=newLabel y := by intro y hy obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hy simpa only [Function.comp_apply,hr x hx] using globalSecondLabel_span p x have hh := htrans (s.image (globalSecondTuple p)) T q.1 (w ∘ r) B lengthScale (globalSecondLabel p ∘ r) F Ψ₁ Ψ₂ (fixedTripleMask m q) (z ∘ r) (ud ∘ r) (ue ∘ r) (uv ∘ r) (kap ∘ r) X₁ X₂ hq hB hL hvalid hmap' ht hn hw' hlabel rw [← globalSecondSource_eq_tupleSource p hp hcop hg hinj s q hs hfixed] at hh apply hh.trans have hd := SecondPassIntegration.child_coefficient_density_bound p hp hcop hg F Ψ₁ Ψ₂ (fixedTripleMask m q) T (V 5) (V 6) X₁ X₂ (𝓕 (JointLogSeparation.frequencyTwist A₁ θ₁)) (𝓕 (JointLogSeparation.frequencyTwist A₂ θ₂)) b J ((1+R)^A) (Cₛ*(1+‖θ₁‖)^(J+2)*(1+‖θ₂‖)^(J+2)) hb have hpow : 0 < (1+R)^A := pow_pos (by linarith) _ have hi := (le_div_iff₀' hpow).mpr hd have hnn : 0 ≤ B*Cₐ*(lengthScale*Ideal.absNorm q.1)^ε := by positivity have hbnd := mul_le_mul_of_nonneg_left hi hnn convert hbnd using 1 ; ring theorem full_uniform_globalSecondRawSource_twisted_transfer (ε : ℝ) (hε : 0 < ε) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ i,0 ≤ M i) (hV : ∀ i x,V i x ≠ 0 → |x| ≤ M i) (A J : ℕ) : ∃ Cₐ : ℝ,0 < Cₐ ∧ ∃ Cₛ : ℝ,0 ≤ Cₛ ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})), ∀ (R : ℝ),0 < R → ∀ (θ₁ θ₂ : ℝ), ∀ (s : Finset (GlobalSecondData ι)) (T : Finset (Ideal O × O)) (q : Ideal O × Ideal O × Ideal O) (w : GlobalSecondData ι → ℂ) (B lengthScale : ℝ) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (z ud ue uv kap : GlobalSecondData ι → ℝ) (X₁ X₂ : ℝ), q.1 ≠ ⊥ → 0 ≤ B → 0 ≤ lengthScale → (∀ x∈s,GlobalSecondAdmissible x) → (∀ x∈s,globalSecondFixedTriple p x=q) → (∀ x∈s,(newLabel (globalSecondTuple p x),newRow (globalSecondTuple p x))∈T) → (∀ a∈T,a.1 ≠ ⊥) → (∀ a∈T,(Ideal.absNorm a.1 : ℝ) ≤ lengthScale) → (∀ x∈s,‖w x‖*‖outerWindow V (z x) (ud x) (ue x) (uv x) (kap x)‖ ≤ B) → ‖globalSecondRawSource p hp hcop hg s w F Ψ₁ Ψ₂ m (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V z ud ue uv kap X₁ X₂ R‖ ≤ (B*Cₐ*(lengthScale*Ideal.absNorm q.1)^ε) * (Cₛ*(1+‖θ₁‖)^(J+2)*(1+‖θ₂‖)^(J+2)/(1+R)^A) * densityChildEnergy p hp hcop hg F Ψ₁ Ψ₂ (fixedTripleMask m q) T (V 5) (V 6) X₁ X₂ J := by obtain ⟨Cₐ,hCₐ,Cₛ,hCₛ,htrans⟩ := full_uniform_globalSecondSource_twisted_transfer ε hε A₁ A₂ W V M hM hV A J refine ⟨Cₐ,hCₐ,Cₛ,hCₛ,?_⟩ intro ι _ p hp _ hcop hg hinj have htrans := htrans p hp hcop hg hinj intro R hR θ₁ θ₂ s T q w B lengthScale F Ψ₁ Ψ₂ m z ud ue uv kap X₁ X₂ hq hB hL hs hfixed hmap ht hn hw rw [globalSecondRawSource_eq p hp hcop hg hinj (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V M hM hV s w q hfixed F Ψ₁ Ψ₂ m z ud ue uv kap X₁ X₂ R hR] exact htrans R hR θ₁ θ₂ s T q w B lengthScale F Ψ₁ Ψ₂ m z ud ue uv kap X₁ X₂ hq hB hL hs hfixed hmap ht hn hw end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.GlobalBinLoss namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CanonicalQuadraticSieve theorem list_prod_le_power (xs : List ℝ) (U : ℝ) (hU : 0≤U) (hxs : ∀x∈xs, 0≤x ∧ x≤U) : xs.prod≤U^xs.length := by induction xs with | nil => simp | cons x xs ih => have hx := hxs x (by simp) have ht : ∀y∈xs, 0≤y ∧ y≤U := fun y hy => hxs y (by simp [hy]) simp only [List.prod_cons,List.length_cons,pow_succ] have hp : 0≤xs.prod := List.prod_nonneg (fun y hy => (ht y hy).1) exact (mul_le_mul hx.2 (ih ht) hp hU).trans_eq (mul_comm _ _) theorem list_prod_budget (xs budget : List ℝ) (U : ℝ) (hU : 1≤U) (hbudget : ∀x∈budget, 0≤x ∧ x≤U) (hxs : ∀x∈xs, x∈budget) (hlen : xs.length≤8) : xs.prod≤U^8 := by apply (list_prod_le_power xs U (by linarith) (fun x hx => hbudget x (hxs x hx))).trans exact pow_le_pow_right₀ hU hlen theorem poisson_nine_terms_box (d lk ln f e vh vz dv uh du lat cd cs ct cp M N T a b eD eS tail U S : ℝ) (hU : 1≤U) (hS : 0≤S) (hbudget : ∀x∈([d,lk,ln,f,e,vh,vz,dv,uh,du,lat,cd,cs,ct,cp] : List ℝ), 0≤x ∧ x≤U) (hM : 0≤M) (hN : 0≤N) (hT : 1≤T) (ha : 0≤a) (hMS : M≤S) (hNS : N≤S) (hTa : T*a≤S) (hb : 0≤b ∧ b≤S) (hED : 0≤eD ∧ eD≤S) (hES : 0≤eS ∧ eS≤S) (htail : 0≤tail ∧ tail≤S) : d*lk*(8*vh*ln^2*f*e*(M+a) + 8*vz*ln^2*f*e*(M+2*T*a) + 8*ln^2*lat*dv*f*e*(M+2*T*a) + 65536*cd*eD) + 1536*d*ct*tail + lk*(2*uh*d*ln^2*f*e*(4*N/T+a) + 2*d*ln^2*lat*du*f*e*(N+2*T*a) + 32768*cs*eS) + uh*d^2*cp*b ≤ 262144*U^8*S := by let budget : List ℝ := [d,lk,ln,f,e,vh,vz,dv,uh,du,lat,cd,cs,ct,cp] have hp (xs : List ℝ) (hx : ∀x∈xs, x∈budget) (hn : xs.length≤8) : xs.prod≤U^8 := list_prod_budget xs budget U hU hbudget hx hn have hc1 : d*lk*vh*ln^2*f*e≤U^8 := by have hh := hp [d,lk,vh,ln,ln,f,e] (by intro x hx; simp only [budget,List.mem_cons,List.not_mem_nil,or_false] at hx ⊢; tauto) (by simp) simpa only [List.prod_cons,List.prod_nil,mul_one,pow_two,mul_assoc] using hh have hc2 : d*lk*vz*ln^2*f*e≤U^8 := by have hh := hp [d,lk,vz,ln,ln,f,e] (by intro x hx; simp only [budget,List.mem_cons,List.not_mem_nil,or_false] at hx ⊢; tauto) (by simp) simpa only [List.prod_cons,List.prod_nil,mul_one,pow_two,mul_assoc] using hh have hc3 : d*lk*ln^2*lat*dv*f*e≤U^8 := by have hh := hp [d,lk,ln,ln,lat,dv,f,e] (by intro x hx; simp only [budget,List.mem_cons,List.not_mem_nil,or_false] at hx ⊢; tauto) (by simp) simpa only [List.prod_cons,List.prod_nil,mul_one,pow_two,mul_assoc] using hh have hc4 : d*lk*cd≤U^8 := by have hh := hp [d,lk,cd] (by intro x hx; simp only [budget,List.mem_cons,List.not_mem_nil,or_false] at hx ⊢; tauto) (by simp) simpa only [List.prod_cons,List.prod_nil,mul_one,mul_assoc] using hh have hc5 : d*ct≤U^8 := by have hh := hp [d,ct] (by intro x hx; simp only [budget,List.mem_cons,List.not_mem_nil,or_false] at hx ⊢; tauto) (by simp) simpa only [List.prod_cons,List.prod_nil,mul_one,mul_assoc] using hh have hc6 : lk*uh*d*ln^2*f*e≤U^8 := by have hh := hp [lk,uh,d,ln,ln,f,e] (by intro x hx; simp only [budget,List.mem_cons,List.not_mem_nil,or_false] at hx ⊢; tauto) (by simp) simpa only [List.prod_cons,List.prod_nil,mul_one,pow_two,mul_assoc] using hh have hc7 : lk*d*ln^2*lat*du*f*e≤U^8 := by have hh := hp [lk,d,ln,ln,lat,du,f,e] (by intro x hx; simp only [budget,List.mem_cons,List.not_mem_nil,or_false] at hx ⊢; tauto) (by simp) simpa only [List.prod_cons,List.prod_nil,mul_one,pow_two,mul_assoc] using hh have hc8 : lk*cs≤U^8 := by have hh := hp [lk,cs] (by intro x hx; simp only [budget,List.mem_cons,List.not_mem_nil,or_false] at hx ⊢; tauto) (by simp) simpa only [List.prod_cons,List.prod_nil,mul_one,mul_assoc] using hh have hc9 : uh*d^2*cp≤U^8 := by have hh := hp [uh,d,d,cp] (by intro x hx; simp only [budget,List.mem_cons,List.not_mem_nil,or_false] at hx ⊢; tauto) (by simp) simpa only [List.prod_cons,List.prod_nil,mul_one,pow_two,mul_assoc] using hh have haS : a≤S := (by nlinarith only [ha, hT] : a≤T*a).trans hTa have hdiv : N/T≤N := div_le_self hN hT have h1 : M+a≤2*S := by linarith only [hMS, haS] have h2 : M+2*T*a≤3*S := by nlinarith only [hMS, hTa] have h3 : M+2*T*a≤3*S := h2 have h6 : 4*N/T+a≤5*S := by rw [mul_div_assoc]; linarith only [hdiv, hNS, haS] have h7 : N+2*T*a≤3*S := by nlinarith only [hNS, hTa] have hU8 : 0≤U^8 := by positivity have ht1 := mul_le_mul hc1 h1 (by positivity : 0≤M+a) hU8 have ht2 := mul_le_mul hc2 h2 (by positivity : 0≤M+2*T*a) hU8 have ht3 := mul_le_mul hc3 h3 (by positivity : 0≤M+2*T*a) hU8 have ht4 := mul_le_mul hc4 hED.2 hED.1 hU8 have ht5 := mul_le_mul hc5 htail.2 htail.1 hU8 have ht6 := mul_le_mul hc6 h6 (by positivity : 0≤4*N/T+a) hU8 have ht7 := mul_le_mul hc7 h7 (by positivity : 0≤N+2*T*a) hU8 have ht8 := mul_le_mul hc8 hES.2 hES.1 hU8 have ht9 := mul_le_mul hc9 hb.2 hb.1 hU8 nlinarith only [ht1, ht2, ht3, ht4, ht5, ht6, ht7, ht8, ht9, mul_nonneg hU8 hS] open ActualEisensteinCubic IdealCoprimeSieveOperator DivisorBlockCauchy EisensteinSchwartzPoisson def poissonUnitBudget (sD sS sT : Finset (ℕ×ℕ)) (CD CS CT CP : ℝ) {α : ℝ} (hexp : HasSieveExponent α) (deltaLoss : ℝ) (hδ : 0 (1:ℂ)) W ≤ 262144*U^8*S := by have hh := poisson_nine_terms_box ((IdealMobiusDivisorSum.idealDivisors G).card:ℝ) (columnDyadicLength K+1:ℕ) (columnDyadicLength N+1:ℕ) (256*(supportConstant ε hε*divisorConstant ε hε)*(N^ε)^2) (divisorExponentConstant hexp deltaLoss hδ*((2*K)*N)^deltaLoss) ‖paperRadialFourier (quadraticTransformedSquareProfile W) 0‖ ‖quadraticTransformedSquareProfile W 0‖ (dualMiddleDecayConstant (quadraticTransformedSquareProfile W)) ‖paperRadialFourier (quadraticSquareProfile W) 0‖ (originalMiddleDecayConstant (quadraticSquareProfile W)) nonzeroLatticeEnvelopeConstant (supportConstant ε hε*(N*N)^ε*(CD*sD.sup (schwartzSeminormFamily ℝ ℝ ℂ) (quadraticTransformedSquareProfile W))) (supportConstant ε hε*((Ideal.absNorm G:ℝ)*(N*N))^ε*(CS*sS.sup (schwartzSeminormFamily ℝ ℝ ℂ) (quadraticSquareProfile W))) (CT*sT.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) (supportConstant ε hε*N^ε*CP*(K*N)^deltaLoss) M N T (Real.sqrt M*(2*K)^(α-1/2)) (Real.sqrt (M/K)*N+Real.sqrt M*K^(α-1/2)) (K*M/T^l) (K*N/T^l) (M/((min 1 (M/((Ideal.absNorm G:ℝ)*N*N)))^2*(1+(M/((Ideal.absNorm G:ℝ)*N*N))*K)^A)) U S hU hS hbudget hM hN.le hT (by positivity) hMS hNS (by simpa only [mul_assoc] using hmid) ⟨by positivity,hpr⟩ ⟨by positivity,hED⟩ ⟨by positivity,hES⟩ ⟨by positivity,htail⟩ convert hh using 1 unfold poissonComparisonMajorant retainedDualMajorant sourcePrincipalMajorant smallPrincipalMajorant dualMiddleMajorant simp only [divisorEnergyFactor_diagonal,Fintype.sum_unique,norm_one,one_pow, mul_one,one_mul,div_one] field_simp ; ring end CanonicalQuadraticSieve open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct primeProductNorm) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] include hp in theorem globalBin_mask_bound (B F : ℝ) (hB : 0 < B) (hF : 1 ≤ F) (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) (m : O) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) : ‖eisEmbedding (fixedTripleMask m (globalSecondFixedTriple p x))‖^2 ≤ ‖eisEmbedding m‖^2*(Real.exp 1)^2*globalPooledDelta B F (globalScaleIndex p side x) := by let j := globalScaleIndex p side x have hb0 := (cube_label_norm_bounds p hp x.cube.support x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit x.cube.support_pos B hB.le hb₁ hb₂).2.1 have he : ‖eisEmbedding (fixedTripleMask m (globalSecondFixedTriple p x))‖^2 = ‖eisEmbedding (globalSecondMask p m x)‖^2 := by rw [eisEmbedding_norm_sq_eq_absNorm_span,eisEmbedding_norm_sq_eq_absNorm_span,globalSecondMask_span] rw [he] have ht := (globalScaleIndex_bounds p hp side x hk 2).2 have hr := (globalScaleIndex_bounds p hp side x hk 3).2 change primeProductNorm p x.firstCommon ≤ globalLogRep j 2*Real.exp 1 at ht change primeProductNorm p (x.source.sourceCommon\x.source.divisor) ≤ globalLogRep j 3*Real.exp 1 at hr have ht0 := (FirstPassCubeLabels.primeProductNorm_pos p hp x.firstCommon).le have hr0 := (FirstPassCubeLabels.primeProductNorm_pos p hp (x.source.sourceCommon\x.source.divisor)).le have hj2 := (globalLogRep_pos j 2).le have hj3 := (globalLogRep_pos j 3).le have ha := globalLogRep_ge_one j 0 change ‖eisEmbedding ((m*_*_)*∏ i∈x.firstCommon,p i)‖^2 ≤ _ rw [SecondPassIntegration.restored_child_mask_norm] calc _ ≤ ‖eisEmbedding m‖^2*B*(globalLogRep j 3*Real.exp 1)*(globalLogRep j 2*Real.exp 1) := by gcongr _ ≤ ‖eisEmbedding m‖^2*(B*F*globalLogRep j 0)*(globalLogRep j 3*Real.exp 1)*(globalLogRep j 2*Real.exp 1) := by gcongr calc B = B*1*1 := by ring _ ≤ _ := by gcongr _ = _ := by unfold globalPooledDelta;ring include hp in theorem globalBin_invariant (K ell B F : ℝ) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 1 ≤ F) (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) (m : O) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) : let j := globalScaleIndex p side x (globalLogRep j 8*Real.exp 1)*‖eisEmbedding (fixedTripleMask m (globalSecondFixedTriple p x))‖^2 / (globalPooledColumnScale ell j*globalPooledLabelScale j) ≤ (globalBinRadial ell (globalPooledRowScale K ell B F j) j/(Real.exp 1)^2)* (K*‖eisEmbedding m‖^2/((ell*B^3)*F)) := by dsimp only let j := globalScaleIndex p side x have hm := globalBin_mask_bound p hp B F hB hF side x hk m hb₁ hb₂ have hcol := globalPooledColumnScale_pos ell hell j have hlab : 0 < globalPooledLabelScale j := zero_lt_one.trans_le (globalPooledLabelScale_ge_one j) have hk8 := globalLogRep_pos j 8 have hF0 : 0 < F := zero_lt_one.trans_le hF calc _ ≤ (globalLogRep j 8*Real.exp 1)* (‖eisEmbedding m‖^2*(Real.exp 1)^2*globalPooledDelta B F j)/ (globalPooledColumnScale ell j*globalPooledLabelScale j) := by gcongr _ = _ := by have h (i : Fin 10) := (globalLogRep_pos j i).ne' have he : Real.exp 4=(Real.exp 1)^4 := by simp dsimp only [j] at h ⊢ unfold globalPooledColumnScale globalPooledLabelScale globalPooledDelta globalPooledRowScale globalBinRadial rw [he] unfold globalPooledColumnScale field_simp [h] include hp in theorem globalBin_invariant_small_padding (Z η K ell B F : ℝ) (hZ : 1 < Z) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 1 ≤ F) (side : Bool) (x : GlobalSecondData ι) (hk : x.source.frequency ≠ 0) (m : O) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) (hpad : globalBinRadial ell (globalPooledRowScale K ell B F (globalScaleIndex p side x)) (globalScaleIndex p side x) ≤ Z^η) : let j := globalScaleIndex p side x (globalLogRep j 8*Real.exp 1)*‖eisEmbedding (fixedTripleMask m (globalSecondFixedTriple p x))‖^2 / (globalPooledColumnScale ell j*globalPooledLabelScale j) ≤ Z^η*(K*‖eisEmbedding m‖^2/((ell*B^3)*F)) := by dsimp only apply (globalBin_invariant p hp K ell B F hK hell hB hF side x hk m hb₁ hb₂).trans have hz0 : 0 < Z := zero_lt_one.trans hZ have hpow : 0 ≤ Z^η := (Real.rpow_pos_of_pos hz0 η).le have he : 1 ≤ (Real.exp 1)^2 := one_le_pow₀ (Real.one_le_exp (by norm_num)) have hr : globalBinRadial ell (globalPooledRowScale K ell B F (globalScaleIndex p side x)) (globalScaleIndex p side x)/(Real.exp 1)^2 ≤ Z^η := (div_le_iff₀ (sq_pos_of_pos (Real.exp_pos 1))).mpr (hpad.trans (le_mul_of_one_le_right hpow he)) apply mul_le_mul_of_nonneg_right hr positivity end open MeasureTheory open scoped BigOperators Classical SchwartzMap open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct) open SecondPassIntegration (densityChildEnergy) open ConcreteTraceCRT (eisEmbedding) def globalBinTriples {ι : Type*} [DecidableEq ι] (p : ι → O) (s : Finset (GlobalSecondData ι)) (side : Bool) (j : GlobalLogIndex) : Finset (Ideal O × Ideal O × Ideal O) := (globalLogSector p s side j).image (globalSecondFixedTriple p) def globalBinLossScale (B : ℝ) (j : GlobalLogIndex) : ℝ := globalPooledLabelScale j*(B*(Real.sqrt (globalLogRep j 9)*Real.exp 1)/globalLogRep j 4) def globalDescentWeight (C ε θ₁ θ₂ K ell B F : ℝ) (A J : ℕ) (j : GlobalLogIndex) (ray : SecondRayIndex) (q : Ideal O × Ideal O × Ideal O) : ℝ := C*(1+‖θ₁‖)^(J+2)*(1+‖θ₂‖)^(J+2)*globalBinFirstCoefficient K ell B F j * globalPooledOuterBound ray ell (globalPooledRowScale K ell B F j) j * (globalPooledLabelScale j*Ideal.absNorm q.1)^ε / (1+globalBinRadial ell (globalPooledRowScale K ell B F j) j)^A * (globalPooledColumnScale ell j*globalPooledLabelScale j) theorem globalPooledRowScale_pos (K ell B F : ℝ) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) (j : GlobalLogIndex) : 0 < globalPooledRowScale K ell B F j := by have h1 := globalLogRep_pos j 1 have h4 := globalLogRep_pos j 4 have h5 := globalLogRep_pos j 5 unfold globalPooledRowScale positivity theorem globalBinFirstCoefficient_nonneg (K ell B F : ℝ) (hK : 0 ≤ K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) (j : GlobalLogIndex) : 0 ≤ globalBinFirstCoefficient K ell B F j := by have h5 := globalLogRep_pos j 5 have hs := Real.sqrt_pos.mpr (globalLogRep_pos j 9) unfold globalBinFirstCoefficient positivity theorem globalDescentWeight_nonneg (C ε θ₁ θ₂ K ell B F : ℝ) (A J : ℕ) (j : GlobalLogIndex) (ray : SecondRayIndex) (q : Ideal O × Ideal O × Ideal O) (hC : 0 ≤ C) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) : 0 ≤ globalDescentWeight C ε θ₁ θ₂ K ell B F A J j ray q := by have hfirst := globalBinFirstCoefficient_nonneg K ell B F hK.le hell hB hF j have hrow := globalPooledRowScale_pos K ell B F hK hell hB hF j have hrad := globalBinRadial_pos ell (globalPooledRowScale K ell B F j) hell hrow j have hcol := globalPooledColumnScale_pos ell hell j have hlab := (zero_lt_one.trans_le (globalPooledLabelScale_ge_one j)).le have h0 := (globalLogRep_pos j 0).le have h1 := (globalLogRep_pos j 1).le have h2 := (globalLogRep_pos j 2).le have h3 := (globalLogRep_pos j 3).le unfold globalDescentWeight globalPooledOuterBound positivity variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] include hp in theorem globalBinTriples_label_bound (B : ℝ) (hB : 0 < B) (side : Bool) (s : Finset (GlobalSecondData ι)) (j : GlobalLogIndex) (hk : ∀ x∈s,x.source.frequency ≠ 0) (hb₁ : ∀ x∈s,‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ∀ x∈s,‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) (q : Ideal O × Ideal O × Ideal O) (hq : q∈globalBinTriples p s side j) : (Ideal.absNorm q.1 : ℝ) ≤ B*(Real.sqrt (globalLogRep j 9)*Real.exp 1)/globalLogRep j 4 := by obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hq obtain ⟨hxs,hj⟩ := Finset.mem_filter.mp hx have h := (globalBin_triple_bounds p hp B hB side x (hk x hxs) (hb₁ x hxs) (hb₂ x hxs)).1 rwa [hj] at h include hp in theorem globalDescentWeight_mass (C ε θ₁ θ₂ K ell B F : ℝ) (A J : ℕ) (hC : 0 ≤ C) (hε : 0 < ε) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) (side : Bool) (s : Finset (GlobalSecondData ι)) (j : GlobalLogIndex) (hk : ∀ x∈s,x.source.frequency ≠ 0) (hb₁ : ∀ x∈s,‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ∀ x∈s,‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) : letI rayFintypeWitness := @OAI.RayFourExpansion.rayCharacterFintype (∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, globalDescentWeight C ε θ₁ θ₂ K ell B F A J j ray q * (globalPooledColumnScale ell j*globalPooledLabelScale j)) ≤ (C*(1+‖θ₁‖)^(J+2)*(1+‖θ₂‖)^(J+2)*(globalBinLossScale B j)^ε / (1+globalBinRadial ell (globalPooledRowScale K ell B F j) j)^A) * (128^3*(Real.exp 1)^18*(512*32^2))*((ell*B^3)*F) := by letI rayFintypeWitness := @OAI.RayFourExpansion.rayCharacterFintype let Mchild := globalPooledColumnScale ell j*globalPooledLabelScale j let D := C*(1+‖θ₁‖)^(J+2)*(1+‖θ₂‖)^(J+2)*(globalBinLossScale B j)^ε / (1+globalBinRadial ell (globalPooledRowScale K ell B F j) j)^A have hmass : 0 < Mchild := mul_pos (globalPooledColumnScale_pos ell hell j) (zero_lt_one.trans_le (globalPooledLabelScale_ge_one j)) have hY := globalPooledRowScale_pos K ell B F hK hell hB hF j have hR := globalBinRadial_pos ell (globalPooledRowScale K ell B F j) hell hY j have hfirst := globalBinFirstCoefficient_nonneg K ell B F hK.le hell hB hF j have hL : 0 < globalPooledLabelScale j := zero_lt_one.trans_le (globalPooledLabelScale_ge_one j) have h0 := (globalLogRep_pos j 0).le have h1 := (globalLogRep_pos j 1).le have h2 := (globalLogRep_pos j 2).le have h3 := (globalLogRep_pos j 3).le have h4 := (globalLogRep_pos j 4).le have hD : 0 ≤ D := by unfold D globalBinLossScale;positivity have hcount : ((globalBinTriples p s side j).card : ℝ) ≤ 128^3*(Real.exp 1)^3*globalBinTripleRange B j := by apply globalBin_triple_count p hp B hB side (globalLogSector p s side j) j · intro x hx;exact (Finset.mem_filter.mp hx).2 · intro x hx;exact hk x (Finset.mem_filter.mp hx).1 · intro x hx;exact hb₁ x (Finset.mem_filter.mp hx).1 · intro x hx;exact hb₂ x (Finset.mem_filter.mp hx).1 have hterm (ray : SecondRayIndex) : (∑ q∈globalBinTriples p s side j,globalDescentWeight C ε θ₁ θ₂ K ell B F A J j ray q*Mchild) ≤ D*(128^3*(Real.exp 1)^18*((ell*B^3)*F))*‖secondRayCoefficient ray‖ := by have ho : 0 ≤ globalPooledOuterBound ray ell (globalPooledRowScale K ell B F j) j := by unfold globalPooledOuterBound;positivity calc _ ≤ ∑ q∈globalBinTriples p s side j, D*globalBinFirstCoefficient K ell B F j*globalPooledOuterBound ray ell (globalPooledRowScale K ell B F j) j*Mchild^2 := by apply Finset.sum_le_sum intro q hq have hloss : (globalPooledLabelScale j*Ideal.absNorm q.1)^ε ≤ (globalBinLossScale B j)^ε := Real.rpow_le_rpow (by positivity) (mul_le_mul_of_nonneg_left (globalBinTriples_label_bound p hp B hB side s j hk hb₁ hb₂ q hq) hL.le) hε.le unfold globalDescentWeight D calc _ ≤ C*(1+‖θ₁‖)^(J+2)*(1+‖θ₂‖)^(J+2)*globalBinFirstCoefficient K ell B F j * globalPooledOuterBound ray ell (globalPooledRowScale K ell B F j) j * (globalBinLossScale B j)^ε /(1+globalBinRadial ell (globalPooledRowScale K ell B F j) j)^A *Mchild*Mchild := by gcongr _ = _ := by ring _ = ((globalBinTriples p s side j).card : ℝ)* (D*globalBinFirstCoefficient K ell B F j*globalPooledOuterBound ray ell (globalPooledRowScale K ell B F j) j*Mchild^2) := by simp _ ≤ (128^3*(Real.exp 1)^3*globalBinTripleRange B j)* (D*globalBinFirstCoefficient K ell B F j*globalPooledOuterBound ray ell (globalPooledRowScale K ell B F j) j*Mchild^2) := by gcongr _ = D*(globalBinChildCharge B F j*Mchild)*‖secondRayCoefficient ray‖ := by have hc := globalBin_complete_cost K ell B F hK hell hB hF j ray change globalBinFirstCoefficient K ell B F j * _ * Mchild * _ = _ at hc calc _ = D*(globalBinFirstCoefficient K ell B F j * globalPooledOuterBound ray ell (globalPooledRowScale K ell B F j) j *Mchild * (128^3*(Real.exp 1)^3*globalBinTripleRange B j))*Mchild := by ring _ = _ := by rw [hc];ring _ = _ := by rw [show globalBinChildCharge B F j*Mchild=128^3*(Real.exp 1)^18*((ell*B^3)*F) from globalBin_mass_balance ell B F hB hF j] calc _ ≤ ∑ ray : SecondRayIndex,D*(128^3*(Real.exp 1)^18*((ell*B^3)*F))*‖secondRayCoefficient ray‖ := Finset.sum_le_sum (fun ray _ => hterm ray) _ = D*(128^3*(Real.exp 1)^18*((ell*B^3)*F))*(∑ ray : SecondRayIndex,‖secondRayCoefficient ray‖) := by rw [Finset.mul_sum] _ ≤ D*(128^3*(Real.exp 1)^18*((ell*B^3)*F))*(512*32^2) := by apply mul_le_mul_of_nonneg_left secondRayCoefficient_mass positivity _ = _ := by dsimp only [D];ring end SecondPassArithmetic open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix namespace CubicEisenstein def matrixGram (g : SL(2,ℂ)) : Matrix (Fin 2) (Fin 2) ℂ := (g : Matrix (Fin 2) (Fin 2) ℂ)*star (g : Matrix (Fin 2) (Fin 2) ℂ) lemma matrixGram_right_unitary (g k : SL(2,ℂ)) (hk : k∈compactSubgroup) : matrixGram (g*k)=matrixGram g := by have hku : (k : Matrix (Fin 2) (Fin 2) ℂ)*star (k : Matrix (Fin 2) (Fin 2) ℂ)=1 := Matrix.mem_unitaryGroup_iff.mp hk unfold matrixGram simp only [Matrix.SpecialLinearGroup.coe_mul,star_mul] calc _ = (g : Matrix (Fin 2) (Fin 2) ℂ)* ((k : Matrix (Fin 2) (Fin 2) ℂ)*star (k : Matrix (Fin 2) (Fin 2) ℂ))* star (g : Matrix (Fin 2) (Fin 2) ℂ) := by noncomm_ring _ = _ := by rw [hku]; simp def hyperbolicGram : HyperbolicSpace → Matrix (Fin 2) (Fin 2) ℂ := Quotient.lift matrixGram (by intro g h hgh have hk : g⁻¹*h∈compactSubgroup := QuotientGroup.leftRel_apply.mp hgh have hh : h=g*(g⁻¹*h) := by group rw [hh] exact (matrixGram_right_unitary g (g⁻¹*h) hk).symm) lemma hyperbolicGram_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous hyperbolicGram := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by apply Continuous.quotient_lift exact continuous_complexSL_coe.mul continuous_complexSL_coe.star lemma hyperbolicGram_injective : Function.Injective hyperbolicGram := by intro w w' hw induction w using Quotient.inductionOn with | _ g => induction w' using Quotient.inductionOn with | _ h => change matrixGram g=matrixGram h at hw apply Quotient.sound apply QuotientGroup.leftRel_apply.mpr change (g⁻¹*h:SL(2,ℂ))∈compactSubgroup apply Matrix.mem_unitaryGroup_iff.mpr have hgi : ((g⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ)* (g:Matrix (Fin 2) (Fin 2) ℂ)=1 := congrArg (fun x : SL(2,ℂ) => (x:Matrix (Fin 2) (Fin 2) ℂ)) (inv_mul_cancel g) have hgis : star (g:Matrix (Fin 2) (Fin 2) ℂ)* star ((g⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ)=1 := by simpa only [star_mul,star_one] using congrArg star hgi simp only [Matrix.SpecialLinearGroup.coe_mul,star_mul] calc _ = ((g⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ)*matrixGram h* star ((g⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ) := by unfold matrixGram; noncomm_ring _ = ((g⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ)*matrixGram g* star ((g⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ) := by rw [hw] _ = (((g⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ)*(g:Matrix (Fin 2) (Fin 2) ℂ))* (star (g:Matrix (Fin 2) (Fin 2) ℂ)*star ((g⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ)) := by unfold matrixGram noncomm_ring _ = 1 := by rw [hgi,hgis]; simp theorem hyperbolicT2Space : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology T2Space HyperbolicSpace := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology T2Space.of_injective_continuous hyperbolicGram_injective hyperbolicGram_continuous def complexMatrixRow (g : SL(2,ℂ)) (i : Fin 2) : Fin 2 → ℂ := fun j => g i j lemma complexMatrixRow_mul (g h : SL(2,ℂ)) (i : Fin 2) : complexMatrixRow (g*h) i=rowOperator h (complexMatrixRow g i) := by funext j simp only [complexMatrixRow,rowOperator_apply,Matrix.SpecialLinearGroup.coe_mul, Matrix.mul_apply,Matrix.vecMul,dotProduct] def matrixFrobenius (g : SL(2,ℂ)) : ℝ := rowEnergy (complexMatrixRow g 0)+rowEnergy (complexMatrixRow g 1) lemma matrixFrobenius_right_unitary (g k : SL(2,ℂ)) (hk : k∈compactSubgroup) : matrixFrobenius (g*k)=matrixFrobenius g := by simp only [matrixFrobenius,complexMatrixRow_mul,rowEnergy_unitary k hk] def hyperbolicFrobenius : HyperbolicSpace → ℝ := Quotient.lift matrixFrobenius (by intro g h hgh have hk : g⁻¹*h∈compactSubgroup := QuotientGroup.leftRel_apply.mp hgh have hh : h=g*(g⁻¹*h) := by group rw [hh] exact (matrixFrobenius_right_unitary g (g⁻¹*h) hk).symm) lemma matrixFrobenius_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous matrixFrobenius := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by have he (i j : Fin 2) : Continuous (fun g : SL(2,ℂ) => g i j) := (continuous_apply j).comp ((continuous_apply i).comp continuous_complexSL_coe) unfold matrixFrobenius rowEnergy complexMatrixRow exact ((he 0 0).norm.pow 2 |>.add ((he 0 1).norm.pow 2)).add ((he 1 0).norm.pow 2 |>.add ((he 1 1).norm.pow 2)) lemma hyperbolicFrobenius_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous hyperbolicFrobenius := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology matrixFrobenius_continuous.quotient_lift _ end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.FundamentalDomain namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix section open ActualEisensteinCubic ConcreteTraceCRT CubicKubota def integralRowPair (M : SL(2,_root_.OAI.ActualEisensteinCubic.O)) : (Fin 2 → _root_.OAI.ActualEisensteinCubic.O)×(Fin 2 → _root_.OAI.ActualEisensteinCubic.O) := (fun j => M 0 j,fun j => M 1 j) lemma integralRowPair_injective : Function.Injective integralRowPair := by intro M N h apply Subtype.ext funext i j fin_cases i · exact congrFun (congrArg Prod.fst h) j · exact congrFun (congrArg Prod.snd h) j lemma matrixFrobenius_integral (M : SL(2,_root_.OAI.ActualEisensteinCubic.O)) (g : SL(2,ℂ)) : matrixFrobenius (integralComplexMatrix M*g)= integralRowEnergy g (integralRowPair M).1+integralRowEnergy g (integralRowPair M).2 := by rw [matrixFrobenius,complexMatrixRow_mul,complexMatrixRow_mul] rfl lemma integralRowEnergy_nonneg (g : SL(2,ℂ)) (v : Fin 2 → _root_.OAI.ActualEisensteinCubic.O) : 0 ≤ integralRowEnergy g v := by unfold integralRowEnergy rowEnergy positivity theorem integral_frobenius_sublevel_finite (g : SL(2,ℂ)) (C : ℝ) : Set.Finite {M : SL(2,_root_.OAI.ActualEisensteinCubic.O) | matrixFrobenius (integralComplexMatrix M*g)≤C} := by have hs := integralRowEnergy_sublevel_finite g C apply (Set.Finite.preimage integralRowPair_injective.injOn (hs.prod hs)).subset intro M hM change integralRowEnergy g (integralRowPair M).1≤C ∧ integralRowEnergy g (integralRowPair M).2≤C change matrixFrobenius (integralComplexMatrix M*g)≤C at hM rw [matrixFrobenius_integral] at hM exact ⟨by linarith [integralRowEnergy_nonneg g (integralRowPair M).2], by linarith [integralRowEnergy_nonneg g (integralRowPair M).1]⟩ theorem integral_hyperbolic_sublevel_finite (w : HyperbolicSpace) (C : ℝ) : Set.Finite {M : SL(2,_root_.OAI.ActualEisensteinCubic.O) | hyperbolicFrobenius (integralComplexMatrix M • w)≤C} := by induction w using Quotient.inductionOn with | _ g => exact integral_frobenius_sublevel_finite g C theorem subgroup_hyperbolic_sublevel_finite (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (w : HyperbolicSpace) (C : ℝ) : Set.Finite {M : H | hyperbolicFrobenius (integralComplexMatrix (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) • w)≤C} := by exact Set.Finite.preimage Subtype.val_injective.injOn (integral_hyperbolic_sublevel_finite w C) end section open ActualEisensteinCubic ConcreteTraceCRT CubicKubota lemma integralComplexMatrix_injective : Function.Injective integralComplexMatrix := by intro M N h apply Subtype.ext funext i j apply eisEmbedding_injective exact congrArg (fun A : SL(2,ℂ) => A i j) h lemma levelThree_trace_divisible_nine (M : levelThree) : (9:_root_.OAI.ActualEisensteinCubic.O)∣((M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 0 0+(M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 1 1-2) := by have ha : (3:_root_.OAI.ActualEisensteinCubic.O)∣((M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 0 0-1) := by simpa using levelThree_entry M 0 0 have hd : (3:_root_.OAI.ActualEisensteinCubic.O)∣((M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 1 1-1) := by simpa using levelThree_entry M 1 1 have hb : (3:_root_.OAI.ActualEisensteinCubic.O)∣(M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 0 1 := by simpa using levelThree_entry M 0 1 have hc : (3:_root_.OAI.ActualEisensteinCubic.O)∣(M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 1 0 := by simpa using levelThree_entry M 1 0 have hdet : (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 0 0*(M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 1 1-(M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 0 1*(M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 1 0=1 := by simpa only [Matrix.det_fin_two] using (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)).property have he : (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 0 0+(M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 1 1-2= (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 0 1*(M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 1 0- ((M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 0 0-1)*((M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 1 1-1) := by linear_combination hdet rw [he] exact dvd_sub (by simpa only [show (3:_root_.OAI.ActualEisensteinCubic.O)*3=9 by ring] using mul_dvd_mul hb hc) (by simpa only [show (3:_root_.OAI.ActualEisensteinCubic.O)*3=9 by ring] using mul_dvd_mul ha hd) lemma unitary_row_normSq (k : SL(2,ℂ)) (hk : k∈compactSubgroup) (i : Fin 2) : Complex.normSq (k i 0)+Complex.normSq (k i 1)=1 := by have hu := Matrix.mem_unitaryGroup_iff.mp hk have he := congrArg (fun A : Matrix (Fin 2) (Fin 2) ℂ => (A i i).re) hu simp only [Matrix.mul_apply,Fin.sum_univ_two,Matrix.star_apply,Matrix.one_apply_eq, Complex.add_re,Complex.mul_re,Complex.star_def,Complex.conj_re,Complex.conj_im,Complex.one_re] at he simp only [Complex.normSq_apply] nlinarith lemma unitary_trace_norm_le_two (k : SL(2,ℂ)) (hk : k∈compactSubgroup) : ‖k 0 0+k 1 1‖≤2 := by have h0 := unitary_row_normSq k hk 0 have h1 := unitary_row_normSq k hk 1 have ha : ‖k 0 0‖≤1 := by rw [Complex.normSq_eq_norm_sq] at h0 nlinarith [norm_nonneg (k 0 0),Complex.normSq_nonneg (k 0 1)] have hd : ‖k 1 1‖≤1 := by rw [Complex.normSq_eq_norm_sq,Complex.normSq_eq_norm_sq] at h1 nlinarith [norm_nonneg (k 1 1),sq_nonneg ‖k 1 0‖] exact (norm_add_le _ _).trans (by linarith) lemma unitary_trace_two_eq_one (k : SL(2,ℂ)) (hk : k∈compactSubgroup) (ht : k 0 0+k 1 1=2) : k=1 := by have h0 := unitary_row_normSq k hk 0 have h1 := unitary_row_normSq k hk 1 have htR := congrArg Complex.re ht norm_num [Complex.add_re] at htR have hs : Complex.normSq (k 0 0-1)+Complex.normSq (k 0 1)+ Complex.normSq (k 1 0)+Complex.normSq (k 1 1-1)=0 := by simp only [Complex.normSq_apply,Complex.sub_re,Complex.one_re,Complex.sub_im,Complex.one_im,sub_zero] at * nlinarith have ha : k 0 0=1 := sub_eq_zero.mp (Complex.normSq_eq_zero.mp (by nlinarith [Complex.normSq_nonneg (k 0 0-1),Complex.normSq_nonneg (k 0 1), Complex.normSq_nonneg (k 1 0),Complex.normSq_nonneg (k 1 1-1)])) have hb : k 0 1=0 := Complex.normSq_eq_zero.mp (by nlinarith [Complex.normSq_nonneg (k 0 0-1),Complex.normSq_nonneg (k 0 1), Complex.normSq_nonneg (k 1 0),Complex.normSq_nonneg (k 1 1-1)]) have hc : k 1 0=0 := Complex.normSq_eq_zero.mp (by nlinarith [Complex.normSq_nonneg (k 0 0-1),Complex.normSq_nonneg (k 0 1), Complex.normSq_nonneg (k 1 0),Complex.normSq_nonneg (k 1 1-1)]) have hd : k 1 1=1 := sub_eq_zero.mp (Complex.normSq_eq_zero.mp (by nlinarith [Complex.normSq_nonneg (k 0 0-1),Complex.normSq_nonneg (k 0 1), Complex.normSq_nonneg (k 1 0),Complex.normSq_nonneg (k 1 1-1)])) apply Subtype.ext funext i j fin_cases i <;> fin_cases j <;> simpa using (by first | exact ha | exact hb | exact hc | exact hd) lemma matrix_trace_conjugate (g h : SL(2,ℂ)) : (g⁻¹*h*g) 0 0+(g⁻¹*h*g) 1 1=h 0 0+h 1 1 := by have ht := Matrix.trace_mul_cycle (((g⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ)) (h:Matrix (Fin 2) (Fin 2) ℂ) (g:Matrix (Fin 2) (Fin 2) ℂ) have hi : (g:Matrix (Fin 2) (Fin 2) ℂ)*(((g⁻¹:SL(2,ℂ)):Matrix (Fin 2) (Fin 2) ℂ))=1 := congrArg (fun A : SL(2,ℂ) => (A:Matrix (Fin 2) (Fin 2) ℂ)) (mul_inv_cancel g) rw [hi,Matrix.one_mul] at ht simpa only [Matrix.SpecialLinearGroup.coe_mul,Matrix.trace,Matrix.diag_apply,Fin.sum_univ_two] using ht lemma levelThree_unitary_conjugate_eq_one (M : levelThree) (g : SL(2,ℂ)) (hk : g⁻¹*complexMatrix M*g∈compactSubgroup) : M=1 := by let k := g⁻¹*complexMatrix M*g have htr := matrix_trace_conjugate g (complexMatrix M) have hnorm : ‖complexMatrix M 0 0+complexMatrix M 1 1-2‖≤4 := by have hb := unitary_trace_norm_le_two k hk rw [htr] at hb have hn := norm_sub_le (complexMatrix M 0 0+complexMatrix M 1 1) (2:ℂ) norm_num at hn linarith obtain ⟨a,ha⟩ := levelThree_trace_divisible_nine M have hmap : complexMatrix M 0 0+complexMatrix M 1 1-2=(9:ℂ)*eisEmbedding a := by change eisEmbedding ((M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 0 0)+eisEmbedding ((M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) 1 1)-2=(9:ℂ)*eisEmbedding a simpa only [map_add,map_sub,map_ofNat,map_mul] using congrArg eisEmbedding ha have haz : a=0 := by by_contra hne have hn := one_le_normSq_embedding a hne rw [Complex.normSq_eq_norm_sq] at hn have hn1 : 1≤‖eisEmbedding a‖ := by nlinarith [norm_nonneg (eisEmbedding a)] rw [hmap,norm_mul] at hnorm norm_num at hnorm linarith have ht2 : k 0 0+k 1 1=2 := by rw [htr] apply sub_eq_zero.mp rw [hmap,haz,map_zero,mul_zero] have hk1 : k=1 := unitary_trace_two_eq_one k hk ht2 have hM1 : complexMatrix M=1 := by have h := congrArg (fun A : SL(2,ℂ) => g*A*g⁻¹) hk1 simpa [k,mul_assoc] using h apply Subtype.ext apply integralComplexMatrix_injective simpa only [map_one,integralComplexMatrix_levelThree] using hM1 theorem levelThree_action_free (M : levelThree) (w : HyperbolicSpace) (hw : complexMatrix M • w=w) : M=1 := by induction w using Quotient.inductionOn with | _ g => apply levelThree_unitary_conjugate_eq_one M g have hrel := QuotientGroup.leftRel_apply.mp (Quotient.exact' hw.symm) simpa only [mul_assoc,smul_eq_mul] using hrel end open ActualEisensteinCubic ConcreteTraceCRT CubicKubota def hyperbolicKeyCoordinates (w : HyperbolicSpace) : Fin 9 → ℝ := ![hyperbolicFrobenius w,(hyperbolicGram w 0 0).re,(hyperbolicGram w 0 0).im, (hyperbolicGram w 0 1).re,(hyperbolicGram w 0 1).im, (hyperbolicGram w 1 0).re,(hyperbolicGram w 1 0).im, (hyperbolicGram w 1 1).re,(hyperbolicGram w 1 1).im] def hyperbolicOrderKey (w : HyperbolicSpace) : Lex (Fin 9 → ℝ) := toLex (hyperbolicKeyCoordinates w) lemma hyperbolicOrderKey_injective : Function.Injective hyperbolicOrderKey := by intro w u h have hc : hyperbolicKeyCoordinates w=hyperbolicKeyCoordinates u := congrArg ofLex h apply hyperbolicGram_injective funext i j fin_cases i <;> fin_cases j <;> apply Complex.ext · exact congrFun hc 1 · exact congrFun hc 2 · exact congrFun hc 3 · exact congrFun hc 4 · exact congrFun hc 5 · exact congrFun hc 6 · exact congrFun hc 7 · exact congrFun hc 8 lemma hyperbolicOrderKey_lt_of_frobenius {w u : HyperbolicSpace} (h : hyperbolicFrobenius w hyperbolicKeyCoordinates w i) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (i : Fin 9) => by fin_cases i <;> simp only [hyperbolicKeyCoordinates] · exact hyperbolicFrobenius_continuous all_goals first | exact Complex.continuous_re.comp ((continuous_apply _).comp ((continuous_apply _).comp hyperbolicGram_continuous)) | exact Complex.continuous_im.comp ((continuous_apply _).comp ((continuous_apply _).comp hyperbolicGram_continuous)) lemma hyperbolicOrderKey_lt_measurable {X : Type*} [TopologicalSpace X] [MeasurableSpace X] [BorelSpace X] : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f g : X → HyperbolicSpace) (hf : Continuous f) (hg : Continuous g), MeasurableSet {x | hyperbolicOrderKey (f x) by change MeasurableSet {x | ∃i : Fin 9,(∀j : Fin 9,j < i → hyperbolicKeyCoordinates (f x) j=hyperbolicKeyCoordinates (g x) j) ∧ hyperbolicKeyCoordinates (f x) i by have he : {x | hyperbolicOrderKey (f x)≤hyperbolicOrderKey (g x)}= {x | hyperbolicOrderKey (g x) not_lt_of_ge h,fun h => le_of_not_gt h⟩ rw [he] exact (hyperbolicOrderKey_lt_measurable g f hg hf).compl theorem integralSLCountable : Countable (SL(2,_root_.OAI.ActualEisensteinCubic.O)) := by let : Countable _root_.OAI.ActualEisensteinCubic.O := latticeCoordEquiv.injective.countable let : Countable (Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O) := inferInstanceAs (Countable (Fin 2 → Fin 2 → _root_.OAI.ActualEisensteinCubic.O)) exact inferInstanceAs (Countable {A : Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O // A.det=1}) def integralSubgroupHyperbolicAction (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) : MulAction H HyperbolicSpace := MulAction.compHom HyperbolicSpace (integralComplexMatrix.comp H.subtype) lemma integralSubgroup_smul (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (M : H) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction H M • w=integralComplexMatrix (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) • w := rfl def hyperbolicFundamentalSet (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) : Set HyperbolicSpace := letI := integralSubgroupHyperbolicAction H {w | ∀M : H,hyperbolicOrderKey w≤hyperbolicOrderKey (M • w)} lemma hyperbolicFundamentalSet_measurable : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))), MeasurableSet (hyperbolicFundamentalSet H) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) => by let := integralSLCountable unfold hyperbolicFundamentalSet simp only [Set.ofPred_forall] apply MeasurableSet.iInter intro M exact hyperbolicOrderKey_le_measurable _ _ continuous_id (continuous_hyperbolic_action (integralComplexMatrix (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)))) lemma exists_key_orbit_minimum (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction H ∃M : H,∀N : H,hyperbolicOrderKey (M • w)≤hyperbolicOrderKey (N • w) := by let := integralSubgroupHyperbolicAction H let S : Set H := {M | hyperbolicFrobenius (M • w)≤hyperbolicFrobenius w} have hs : Set.Finite S := subgroup_hyperbolic_sublevel_finite H w _ have hne : S.Nonempty := ⟨1,by simp [S]⟩ obtain ⟨M,hM,hmin⟩ := Set.exists_min_image S (fun M : H => hyperbolicOrderKey (M • w)) hs hne refine ⟨M,fun N => ?_⟩ by_cases hN : N∈S · exact hmin N hN · apply le_of_lt apply hyperbolicOrderKey_lt_of_frobenius exact hM.trans_lt (lt_of_not_ge hN) lemma hyperbolicFundamentalSet_covers (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction H ∃M : H,M • w∈hyperbolicFundamentalSet H := by let := integralSubgroupHyperbolicAction H obtain ⟨M,hM⟩ := exists_key_orbit_minimum H w refine ⟨M,fun N => ?_⟩ simpa only [mul_smul] using hM (N*M) lemma hyperbolicFundamentalSet_orbit_unique (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (w : HyperbolicSpace) (hw : w∈hyperbolicFundamentalSet H) (M : H) (hMw : letI := integralSubgroupHyperbolicAction H M • w∈hyperbolicFundamentalSet H) : letI := integralSubgroupHyperbolicAction H M • w=w := by let := integralSubgroupHyperbolicAction H apply hyperbolicOrderKey_injective apply le_antisymm · simpa only [inv_smul_smul] using hMw M⁻¹ · exact hw M lemma subgroup_action_free (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (hH : H≤levelThree) (M : H) (w : HyperbolicSpace) (hM : letI := integralSubgroupHyperbolicAction H M • w=w) : M=1 := by let := integralSubgroupHyperbolicAction H have he := levelThree_action_free (⟨(M:SL(2,_root_.OAI.ActualEisensteinCubic.O)),hH M.property⟩ : levelThree) w hM apply Subtype.ext exact congrArg (fun N : levelThree => (N:SL(2,_root_.OAI.ActualEisensteinCubic.O))) he theorem hyperbolicFundamentalSet_isFundamentalDomain : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (hH : H≤levelThree), letI := integralSubgroupHyperbolicAction H IsFundamentalDomain H (hyperbolicFundamentalSet H) hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (hH : H≤levelThree) => by let := integralSubgroupHyperbolicAction H let := integralSLCountable apply IsFundamentalDomain.mk' (hyperbolicFundamentalSet_measurable H).nullMeasurableSet intro w obtain ⟨M,hM⟩ := hyperbolicFundamentalSet_covers H w refine ⟨M,hM,fun N hN => ?_⟩ have he : (N*M⁻¹) • (M • w)=M • w := hyperbolicFundamentalSet_orbit_unique H (M • w) hM (N*M⁻¹) (by simpa only [mul_smul,inv_smul_smul] using hN) have hNM : N*M⁻¹=1 := subgroup_action_free H hH _ _ he exact mul_inv_eq_one.mp hNM lemma globalKubotaKernel_le_levelThree : globalKubotaKernel≤levelThree := by intro M hM exact ((globalKubotaKernel_mem M).mp hM).choose theorem globalKubotaKernel_isFundamentalDomain : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := integralSubgroupHyperbolicAction globalKubotaKernel IsFundamentalDomain globalKubotaKernel (hyperbolicFundamentalSet globalKubotaKernel) hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace hyperbolicFundamentalSet_isFundamentalDomain _ globalKubotaKernel_le_levelThree end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicKubota theorem integralSubgroupMeasurableAction : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))), letI := integralSubgroupHyperbolicAction H MeasurableConstSMul H HyperbolicSpace := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) => by let := integralSubgroupHyperbolicAction H exact ⟨fun M => (continuous_hyperbolic_action (integralComplexMatrix (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)))).measurable⟩ theorem integralSubgroupVolumeInvariant : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))), letI := integralSubgroupHyperbolicAction H SMulInvariantMeasure H HyperbolicSpace hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) => by let := integralSubgroupHyperbolicAction H refine ⟨?_⟩ intro M s hs have hm := (continuous_hyperbolic_action (integralComplexMatrix (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)))).measurable have he := congrArg (fun ν : Measure HyperbolicSpace => ν s) (hyperbolicVolume_invariant (integralComplexMatrix (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)))) simpa only [Measure.map_apply hm hs,integralSubgroup_smul] using he lemma measurable_integralOrbitProjection : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))), Measurable (integralOrbitProjection H) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) => measurable_quotient_mk' (s := integralOrbitRel H) def integralQuotientVolume : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))), Measure (IntegralOrbitQuotient H) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) => Measure.map (integralOrbitProjection H) (hyperbolicVolume.restrict (hyperbolicFundamentalSet H)) lemma quotient_projection_measurePreserving : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))), MeasurePreserving (integralOrbitProjection H) (hyperbolicVolume.restrict (hyperbolicFundamentalSet H)) (integralQuotientVolume H) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) => ⟨measurable_integralOrbitProjection H,rfl⟩ theorem integralQuotientVolume_independent : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (hH : H≤levelThree) (D : Set HyperbolicSpace) (hD : letI := integralSubgroupHyperbolicAction H IsFundamentalDomain H D hyperbolicVolume), Measure.map (integralOrbitProjection H) (hyperbolicVolume.restrict D)=integralQuotientVolume H := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (hH : H≤levelThree) (D : Set HyperbolicSpace) (hD : letI := integralSubgroupHyperbolicAction H IsFundamentalDomain H D hyperbolicVolume) => by let := integralSubgroupHyperbolicAction H let := integralSLCountable let := integralSubgroupMeasurableAction H let := integralSubgroupVolumeInvariant H apply Measure.ext intro S hS have hp := measurable_integralOrbitProjection H unfold integralQuotientVolume rw [Measure.map_apply hp hS,Measure.map_apply hp hS,Measure.restrict_apply (hp hS), Measure.restrict_apply (hp hS)] apply hD.measure_set_eq (hyperbolicFundamentalSet_isFundamentalDomain H hH) (hp hS) intro M ext w change integralOrbitProjection H (M • w)∈S ↔ integralOrbitProjection H w∈S rw [integralSubgroup_smul,integralOrbitProjection_eq] lemma integralQuotientVolume_integral : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (f : IntegralOrbitQuotient H → ℂ) (hf : AEStronglyMeasurable f (integralQuotientVolume H)), (∫q,f q∂integralQuotientVolume H)= ∫w in hyperbolicFundamentalSet H,f (integralOrbitProjection H w)∂hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (f : IntegralOrbitQuotient H → ℂ) (hf : AEStronglyMeasurable f (integralQuotientVolume H)) => integral_map (measurable_integralOrbitProjection H).aemeasurable hf lemma hyperbolicEuclideanVolume_ne_zero : hyperbolicEuclideanVolume≠0 := by have hU : IsOpen euclideanUpperHalf := isOpen_lt continuous_const (by fun_prop) have hne : euclideanUpperHalf.Nonempty := ⟨WithLp.toLp 2 ![0,0,1],by simp [euclideanUpperHalf]⟩ have hpos : 0 h (by simp [hb,largeCubeCoefficient]) refine ⟨hB,?_⟩ rw [largeCubeCoefficient,if_neg hB] at h obtain ⟨H,hH,hterm⟩ := Finset.exists_ne_zero_of_sum_ne_zero h have hlarge : H₀ ≤ (Ideal.absNorm H : ℝ) := by by_contra hn exact hterm (if_neg hn) have hdiv := (mem_idealDivisors hB).mp hH have hpos : 0 < Ideal.absNorm B := Nat.pos_iff_ne_zero.mpr (fun hn => hB (Ideal.absNorm_eq_zero_iff.mp hn)) exact hlarge.trans (by exact_mod_cast Nat.le_of_dvd hpos (map_dvd Ideal.absNorm hdiv)) theorem large_cube_convolution (H₀ : ℝ) (c : Ideal O →* ℂ) (hc0 : c 0=0) (f : Ideal O → ℂ) (hfinite : (Function.support (fun p : Ideal O × Ideal O => (UniqueFactorizationMonoid.moebius p.1 : ℂ)*c (p.1*p.2)*f (p.1*p.2))).Finite) : (∑' H : Ideal O,∑' J : Ideal O, if H₀ ≤ (Ideal.absNorm H : ℝ) then (UniqueFactorizationMonoid.moebius H : ℂ)*c (H*J)*f (H*J) else 0) = ∑' B : Ideal O,largeCubeCoefficient H₀ B*c B*f B := by let F : Ideal O × Ideal O → ℂ := fun p => if H₀ ≤ (Ideal.absNorm p.1 : ℝ) then (UniqueFactorizationMonoid.moebius p.1 : ℂ)*c (p.1*p.2)*f (p.1*p.2) else 0 have hF : Summable F := summable_of_hasFiniteSupport (hfinite.subset (by intro p hp by_contra hn have he : (UniqueFactorizationMonoid.moebius p.1 : ℂ)*c (p.1*p.2)*f (p.1*p.2)=0 := not_ne_iff.mp hn exact hp (by dsimp [F];rw [he];simp))) have hfiber (B : Ideal O) : (∑' p : MulFiber B,F p.val)=largeCubeCoefficient H₀ B*c B*f B := by by_cases hB : B=0 · subst B have hz : ∀ p : MulFiber 0,F p.val=0 := by intro p dsimp [F] rw [p.property,hc0] simp simp [hz,largeCubeCoefficient] · let e := mulFiberDivisorEquiv B hB have hsum : (∑' p : MulFiber B, if H₀ ≤ (Ideal.absNorm p.val.1 : ℝ) then (UniqueFactorizationMonoid.moebius p.val.1 : ℂ) else 0) = largeCubeCoefficient H₀ B := by calc _ = ∑' H : {H : Ideal O // H∈idealDivisors B}, if H₀ ≤ (Ideal.absNorm H.val : ℝ) then (UniqueFactorizationMonoid.moebius H.val : ℂ) else 0 := e.tsum_eq _ _ = _ := by rw [tsum_fintype,largeCubeCoefficient,if_neg (show B≠⊥ from hB)] exact (Finset.sum_subtype (idealDivisors B) (fun H => Iff.rfl) (fun H => if H₀ ≤ (Ideal.absNorm H : ℝ) then (UniqueFactorizationMonoid.moebius H : ℂ) else 0)).symm calc _ = ∑' p : MulFiber B, (if H₀ ≤ (Ideal.absNorm p.val.1 : ℝ) then (UniqueFactorizationMonoid.moebius p.val.1 : ℂ) else 0)*(c B*f B) := by apply tsum_congr intro p dsimp [F] rw [p.property] split_ifs <;> ring _ = _ := by rw [tsum_mul_right,hsum];ring have hs := hF.hasSum.tsum_fiberwise (fun p : Ideal O × Ideal O => p.1*p.2) change HasSum (fun B : Ideal O => ∑' p : MulFiber B,F p.val) (∑' p,F p) at hs simp_rw [hfiber] at hs rw [← hF.tsum_prod] exact hs.tsum_eq.symm theorem large_cube_inner_reopen (Ψ : O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X H₀ : ℝ) (hX : 0 < X) (I : Ideal O) : (∑' H : Ideal O,∑' J : Ideal O, if H₀ ≤ (Ideal.absNorm H : ℝ) then expandedTerm Ψ W X I H J else 0) = ∑' B : Ideal O,largeCubeCoefficient H₀ B*summand Ψ W X I B := by let f : Ideal O → ℂ := fun B => columnWeight Ψ I/(Real.sqrt (Ideal.absNorm I : ℝ) : ℂ)* Vstar W ((Ideal.absNorm I : ℝ)*(Ideal.absNorm B : ℝ)^3/X) have heq (H J : Ideal O) : (UniqueFactorizationMonoid.moebius H : ℂ)*cubeWeight Ψ (H*J)*f (H*J)=expandedTerm Ψ W X I H J := by simp only [f,expandedTerm,map_mul,Nat.cast_mul,mul_pow,mul_assoc] have hf := finite_support_expandedTerm Ψ W hW X hX have hp : (Function.support (fun p : Ideal O × Ideal O => expandedTerm Ψ W X I p.1 p.2)).Finite := by change ((fun p : Ideal O × Ideal O => (I,p)) ⁻¹' Function.support (fun p : Ideal O × Ideal O × Ideal O => expandedTerm Ψ W X p.1 p.2.1 p.2.2)).Finite exact Set.Finite.preimage (fun a _ b _ hab => (Prod.mk.inj hab).2) hf have hg := large_cube_convolution H₀ (cubeWeight Ψ) (cubeWeight_zero Ψ) f (by simpa only [heq] using hp) rw [show (∑' H : Ideal O, ∑' J : Ideal O, if H₀ ≤ (Ideal.absNorm H : ℝ) then expandedTerm Ψ W X I H J else 0)= ∑' B : Ideal O,largeCubeCoefficient H₀ B*cubeWeight Ψ B*f B by simpa only [heq] using hg] apply tsum_congr intro B dsimp [f,summand] ring theorem large_cube_reopen (Ψ : O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X H₀ : ℝ) (hX : 0 < X) : (∑' H : Ideal O, if H₀ ≤ (Ideal.absNorm H : ℝ) then (UniqueFactorizationMonoid.moebius H : ℂ)*cubeWeight Ψ H* completedT Ψ W (X/(Ideal.absNorm H : ℝ)^3) else 0) = ∑' I : Ideal O,∑' B : Ideal O,largeCubeCoefficient H₀ B*summand Ψ W X I B := by let F : Ideal O × Ideal O × Ideal O → ℂ := fun p => if H₀ ≤ (Ideal.absNorm p.2.1 : ℝ) then expandedTerm Ψ W X p.1 p.2.1 p.2.2 else 0 have hF : Summable F := summable_of_hasFiniteSupport ((finite_support_expandedTerm Ψ W hW X hX).subset (by intro p hp by_contra hn have he : expandedTerm Ψ W X p.1 p.2.1 p.2.2=0 := not_ne_iff.mp hn exact hp (by simp [F,he]))) let e : (Ideal O × Ideal O × Ideal O) ≃ (Ideal O × Ideal O × Ideal O) := { toFun := fun p => (p.2.1,p.1,p.2.2) invFun := fun p => (p.2.1,p.1,p.2.2) left_inv := by rintro ⟨I,H,J⟩;rfl right_inv := by rintro ⟨I,H,J⟩;rfl } have hswap : Summable (fun p => F (e p)) := e.summable_iff.mpr hF calc _ = ∑' H : Ideal O,∑' I : Ideal O,∑' J : Ideal O, if H₀ ≤ (Ideal.absNorm H : ℝ) then expandedTerm Ψ W X I H J else 0 := by apply tsum_congr intro H by_cases h : H₀ ≤ (Ideal.absNorm H : ℝ) · simp only [if_pos h,weighted_completedT_reopen] · simp only [if_neg h,tsum_zero] _ = ∑' p : Ideal O × Ideal O × Ideal O,F (e p) := by rw [hswap.tsum_prod] apply tsum_congr intro H exact (hswap.prod_factor H).tsum_prod.symm _ = ∑' p : Ideal O × Ideal O × Ideal O,F p := e.tsum_eq F _ = ∑' I : Ideal O,∑' H : Ideal O,∑' J : Ideal O, if H₀ ≤ (Ideal.absNorm H : ℝ) then expandedTerm Ψ W X I H J else 0 := by rw [hF.tsum_prod] apply tsum_congr intro I exact (hF.prod_factor I).tsum_prod _ = _ := tsum_congr (large_cube_inner_reopen Ψ W hW X H₀ hX) theorem completed_cube_inverse_split (Ψ : O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X H₀ : ℝ) (hX : 0 < X) : (Real.sqrt X : ℂ)⁻¹*(∑' I : Ideal O,columnWeight Ψ I*W ((Ideal.absNorm I : ℝ)/X)) = (∑' H : Ideal O, if (Ideal.absNorm H : ℝ) (UniqueFactorizationMonoid.moebius H : ℂ)*cubeWeight Ψ H* completedT Ψ W (X/(Ideal.absNorm H : ℝ)^3) have hf := cube_inverse_finite_support Ψ W hW X hX have hs : Summable (fun H : Ideal O => if (Ideal.absNorm H : ℝ) if H₀ ≤ (Ideal.absNorm H : ℝ) then f H else 0) := summable_of_hasFiniteSupport (hf.subset (by intro H hH by_contra hn have he : f H=0 := not_ne_iff.mp hn exact hH (by simp only [he,ite_self]))) rw [completed_cube_inverse Ψ W hW X hX,←large_cube_reopen Ψ W hW X H₀ hX] change (∑' H,f H)=(∑' H,if (Ideal.absNorm H : ℝ) (largeCubeCoefficient_norm_le H₀ B).trans (hbound B hB)⟩ end CompletedGauss open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct primeProductNorm) open ConcreteTraceCRT (eisEmbedding) def globalRowScaleFloor (K ell B F M : ℝ) : ℝ := ell^2*B^2*F^2/(K*(ell*Real.exp M)^2) theorem globalRowScaleFloor_pos (K ell B F M : ℝ) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) : 0 < globalRowScaleFloor K ell B F M := by unfold globalRowScaleFloor positivity theorem globalNormCaps_antitone_row (ell B Y₀ Y₁ M H : ℝ) (hY₀ : 0 < Y₀) (hY : Y₀ ≤ Y₁) (hH : 0 ≤ H) : ∀ i,globalNormCaps ell B Y₁ M H i ≤ globalNormCaps ell B Y₀ M H i := by have hc : ⌈H*(ell*Real.exp M)^2/Y₁⌉₊ ≤ ⌈H*(ell*Real.exp M)^2/Y₀⌉₊ := Nat.ceil_mono (div_le_div_of_nonneg_left (by positivity) hY₀ hY) have hc' : (⌈H*(ell*Real.exp M)^2/Y₁⌉₊ : ℝ) ≤ ⌈H*(ell*Real.exp M)^2/Y₀⌉₊ := by exact_mod_cast hc intro i fin_cases i <;> simp [globalNormCaps] gcongr variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] include hp in theorem globalRowScaleFloor_le_pooled (K ell B F M : ℝ) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) (side : Bool) (x : GlobalSecondData ι) (hx : GlobalSecondAdmissible x) (hk : x.source.frequency ≠ 0) (hs : SecondSourceSupport p (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon) M x.source) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) : globalRowScaleFloor K ell B F M ≤ globalPooledRowScale K ell B F (globalScaleIndex p side x) := by let j := globalScaleIndex p side x have hC : globalLogRep j 1 ≤ ell*Real.exp M := (globalScaleIndex_bounds p hp side x hk 1).1.trans (globalSupported_small_norms p hp ell M hell side x hx hs).2.1 have hJ := globalPooled_J_bound p hp B hB side x hk hb₁ hb₂ have hcpos := globalLogRep_pos j 1 have hjpos := globalLogRep_pos j 4 have hd := globalLogRep_ge_one j 5 have he : 1 ≤ Real.exp 1 := Real.one_le_exp (by norm_num) unfold globalRowScaleFloor globalPooledRowScale calc ell^2*B^2*F^2/(K*(ell*Real.exp M)^2) = ell^2*B^4*F^2/(K*(ell*Real.exp M)^2*B^2) := by field_simp _ ≤ Real.exp 1*ell^2*B^4*F^2*globalLogRep j 5/(K*(globalLogRep j 1)^2*globalLogRep j 4) := by apply div_le_div₀ (by positivity) · calc ell^2*B^4*F^2 = 1*ell^2*B^4*F^2*1 := by ring _ ≤ _ := by gcongr · positivity · gcongr include hp in theorem globalScaleIndex_mem_uniform_box (K ell B F M H : ℝ) (hK : 0 < K) (hell : 0 < ell) (hB : 0 < B) (hF : 0 < F) (hH : 0 ≤ H) (side : Bool) (x : GlobalSecondData ι) (hx : GlobalSecondAdmissible x) (hs : SecondSourceSupport p (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon) M x.source) (hb₁ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) (hk0 : x.source.frequency ≠ 0) (hk : x.source.frequency ∈ firstCoreSecondCutoff p x.firstCommon (globalFirstColumnScale p ell x side) (globalPooledRowScale K ell B F (globalScaleIndex p side x)) M H x.source.sourceCommon x.source.divisor) : globalScaleIndex p side x ∈ globalLogBox (globalNormCaps ell B (globalRowScaleFloor K ell B F M) M H) := by have hY := globalPooledRowScale_pos K ell B F hK hell hB hF (globalScaleIndex p side x) have hfloor := globalRowScaleFloor_pos K ell B F M hK hell hB hF have hlower := globalRowScaleFloor_le_pooled p hp K ell B F M hK hell hB hF side x hx hk0 hs hb₁ hb₂ have hcaps := globalScaleVector_le_caps p hp ell B _ M H hell hB.le hY hH side x hx hs hb₁ hb₂ hk apply globalScaleIndex_mem_box p hp side x hk0 intro i exact (hcaps i).trans (globalNormCaps_antitone_row ell B _ _ M H hfloor hlower hH i) end section open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform open ActualEisensteinCubic open SecondPassFiber (newLabel newRow) open SecondPassIntegration (densityChildEnergy) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def weightedGlobalArithmeticBinSource (γ : GlobalSecondData ι → ℂ) (s : Finset (GlobalSecondData ι)) (side : Bool) (q : Ideal O × Ideal O × Ideal O) (j : GlobalLogIndex) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7 → ℝ → ℂ) (ell Y : ℝ) : ℂ := globalSecondRawSource p hp hcop hg (globalArithmeticBin p s side q j) (fun x => γ x*globalSecondOuterWeight p hp hcop hg Ψ m ray ell Y side x) F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) m A₁ A₂ W V (globalBinZ p ell side j) (globalBinUd p j) (globalBinUe p j) (globalBinUv p j) (globalBinKap p j) (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) (globalBinRadial ell Y j) theorem weightedGlobalArithmeticBinSource_squarefree (γ : GlobalSecondData ι → ℂ) (s : Finset (GlobalSecondData ι)) (side : Bool) (q : Ideal O × Ideal O × Ideal O) (j : GlobalLogIndex) (hs : ∀ x∈s,GlobalSecondAdmissible x) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7 → ℝ → ℂ) (ell Y : ℝ) : weightedGlobalArithmeticBinSource p hp hcop hg γ s side q j F Ψ m ray A₁ A₂ W V ell Y = globalSecondRawSource p hp hcop hg (globalSquarefreeBin p s side q j) (fun x => γ x*globalSecondOuterWeight p hp hcop hg Ψ m ray ell Y side x) F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) m A₁ A₂ W V (globalBinZ p ell side j) (globalBinUd p j) (globalBinUe p j) (globalBinUv p j) (globalBinKap p j) (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) (globalBinRadial ell Y j) := by unfold weightedGlobalArithmeticBinSource globalSecondRawSource globalSquarefreeBin rw [Finset.sum_filter] apply Finset.sum_congr rfl intro x hx by_cases hsf : Squarefree (newLabel (globalSecondTuple p x)) · rw [if_pos hsf] · rw [if_neg hsf] have hz : globalSecondOuterWeight p hp hcop hg Ψ m ray ell Y side x=0 := by by_contra hn exact hsf (globalSecondOuterWeight_squarefree p hp hcop hg Ψ m ray ell Y side x (hs x (Finset.mem_filter.mp hx).1) hn) simp only [hz,mul_zero,zero_mul] end theorem full_uniform_weightedGlobalArithmeticBin_transfer (ε : ℝ) (hε : 0 < ε) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ i,0 ≤ M i) (hV : ∀ i x,V i x ≠ 0 → |x| ≤ M i) (hVc : ∀ i,HasCompactSupport (V i)) (hVs : ∀ i,Continuous (V i)) (A J : ℕ) : ∃ C : ℝ,0 ≤ C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2), ∀ (θ₁ θ₂ : ℝ), ∀ (s : Finset (GlobalSecondData ι)) (side : Bool) (q : Ideal O × Ideal O × Ideal O) (j : GlobalLogIndex) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (ell Y : ℝ) (γ : GlobalSecondData ι → ℂ) (Γ : ℝ), 0 < ell → 0 < Y → q.1 ≠ ⊥ → 0 ≤ Γ → (∀ x∈s,‖γ x‖ ≤ Γ) → (∀ a,‖Ψ a‖ ≤ 1) → (∀ x∈s,GlobalSecondAdmissible x) → (∀ x∈s,x.source.frequency ≠ 0) → ‖weightedGlobalArithmeticBinSource p hp hcop hg γ s side q j F Ψ m ray (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V ell Y‖ ≤ (Γ*C)*(1+‖θ₁‖)^(J+2)*(1+‖θ₂‖)^(J+2)*globalPooledOuterBound ray ell Y j* (globalPooledLabelScale j*Ideal.absNorm q.1)^ε/(1+globalBinRadial ell Y j)^A * densityChildEnergy p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fixedTripleMask m q) (globalArithmeticTargets p s side q j) (V 5) (V 6) (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) J := by obtain ⟨Cₐ,hCₐ,Cₛ,hCₛ,htrans⟩ := full_uniform_globalSecondRawSource_twisted_transfer ε hε A₁ A₂ W V M hM hV A J obtain ⟨Cw,hCw,hwglobal⟩ := outerWindow_global_bound V hVc hVs refine ⟨Cₐ*Cₛ*Cw,by positivity,?_⟩ intro ι _ p hp _ hcop hg hinj hc have htrans := htrans p hp hcop hg hinj intro θ₁ θ₂ s side q j F Ψ m ray ell Y γ Γ hell hY hq hΓ hγ hΨ hs hk rw [weightedGlobalArithmeticBinSource_squarefree p hp hcop hg γ s side q j hs] let t := globalSquarefreeBin p s side q j let T := globalArithmeticTargets p s side q j have ht (x : GlobalSecondData ι) (hx : x∈t) : x∈s ∧ globalSecondFixedTriple p x=q ∧ globalScaleIndex p side x=j := Finset.mem_filter.mp (Finset.mem_filter.mp hx).1 have hbound := globalArithmeticTargets_bounds p hp s side q j hk have hB : 0 ≤ globalPooledOuterBound ray ell Y j := by have h0 := (globalLogRep_pos j 0).le have h1 := (globalLogRep_pos j 1).le have h2 := (globalLogRep_pos j 2).le have h3 := (globalLogRep_pos j 3).le unfold globalPooledOuterBound positivity have hw : ∀ x∈t,‖γ x*globalSecondOuterWeight p hp hcop hg Ψ m ray ell Y side x‖* ‖JointLogSeparation.outerWindow V (globalBinZ p ell side j x) (globalBinUd p j x) (globalBinUe p j x) (globalBinUv p j x) (globalBinKap p j x)‖ ≤ Γ*globalPooledOuterBound ray ell Y j*Cw := by intro x hx have hh := globalSecondOuterWeight_bin_bound p hp hcop hg hinj hc Ψ hΨ m ray ell Y hell hY.le side x (hk x (ht x hx).1) rw [(ht x hx).2.2] at hh rw [norm_mul] exact mul_le_mul (mul_le_mul (hγ x (ht x hx).1) hh (norm_nonneg _) hΓ) (hwglobal _ _ _ _ _) (norm_nonneg _) (mul_nonneg hΓ hB) have hh := htrans (globalBinRadial ell Y j) (globalBinRadial_pos ell Y hell hY j) θ₁ θ₂ t T q (fun x => γ x*globalSecondOuterWeight p hp hcop hg Ψ m ray ell Y side x) (Γ*globalPooledOuterBound ray ell Y j*Cw) (globalPooledLabelScale j) F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) m (globalBinZ p ell side j) (globalBinUd p j) (globalBinUe p j) (globalBinUv p j) (globalBinKap p j) (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) hq (mul_nonneg (mul_nonneg hΓ hB) hCw) (zero_le_one.trans (globalPooledLabelScale_ge_one j)) (fun x hx => hs x (ht x hx).1) (fun x hx => (ht x hx).2.1) (fun x hx => Finset.mem_image.mpr ⟨x,hx,rfl⟩) (fun a ha => (hbound a ha).1) (fun a ha => (hbound a ha).2.1) hw convert hh using 1 ; ring end open MeasureTheory open scoped BigOperators Classical SchwartzMap open ActualEisensteinCubic open SecondPassIntegration (densityChildEnergy) theorem weightedGlobalPositiveBin_transfer (ε : ℝ) (hε : 0 < ε) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7 → ℝ → ℂ) (M : Fin 7 → ℝ) (hM : ∀ i,0 ≤ M i) (hV : ∀ i x,V i x ≠ 0 → |x| ≤ M i) (hVc : ∀ i,HasCompactSupport (V i)) (hVs : ∀ i,Continuous (V i)) (A J : ℕ) : ∃ C : ℝ,0 ≤ C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (θ₁ θ₂ K ell B F : ℝ) (s : Finset (GlobalSecondData ι)) (side : Bool) (j : GlobalLogIndex) (pool : Finset ι) (Ψ : O →* ℂ) (m : O) (γ : GlobalSecondData ι → ℂ) (Γ : ℝ), letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype 0 < K → 0 < ell → 0 < B → 0 < F → 0 ≤ Γ → (∀ x∈s,‖γ x‖ ≤ Γ) → (∀ a,‖Ψ a‖ ≤ 1) → (∀ x∈s,GlobalSecondAdmissible x) → (∀ x∈s,x.source.frequency ≠ 0) → globalBinFirstCoefficient K ell B F j * ‖∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, weightedGlobalArithmeticBinSource p hp hcop hg γ s side q j pool Ψ m ray (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V ell (globalPooledRowScale K ell B F j)‖ ≤ ∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, globalDescentWeight (Γ*C) ε θ₁ θ₂ K ell B F A J j ray q * (densityChildEnergy p hp hcop hg pool (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fixedTripleMask m q) (globalArithmeticTargets p s side q j) (V 5) (V 6) (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) J / (globalPooledColumnScale ell j*globalPooledLabelScale j)) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype obtain ⟨C,hC,htrans⟩ := full_uniform_weightedGlobalArithmeticBin_transfer ε hε A₁ A₂ W V M hM hV hVc hVs A J refine ⟨C,hC,?_⟩ intro ι _ p hp _ hcop hg hinj hc θ₁ θ₂ K ell B F s side j pool Ψ m γ Γ hK hell hB hF hΓ hγ hΨ hs hk have hy := globalPooledRowScale_pos K ell B F hK hell hB hF j have hfirst := globalBinFirstCoefficient_nonneg K ell B F hK.le hell hB hF j have hmass : globalPooledColumnScale ell j*globalPooledLabelScale j ≠ 0 := (mul_pos (globalPooledColumnScale_pos ell hell j) (zero_lt_one.trans_le (globalPooledLabelScale_ge_one j))).ne' calc _ ≤ globalBinFirstCoefficient K ell B F j * ∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, ‖weightedGlobalArithmeticBinSource p hp hcop hg γ s side q j pool Ψ m ray (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V ell (globalPooledRowScale K ell B F j)‖ := by apply mul_le_mul_of_nonneg_left _ hfirst apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro ray hray exact norm_sum_le _ _ _ = ∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, globalBinFirstCoefficient K ell B F j * ‖weightedGlobalArithmeticBinSource p hp hcop hg γ s side q j pool Ψ m ray (JointLogSeparation.frequencyTwist A₁ θ₁) (JointLogSeparation.frequencyTwist A₂ θ₂) W V ell (globalPooledRowScale K ell B F j)‖ := by simp only [Finset.mul_sum] _ ≤ _ := by apply Finset.sum_le_sum intro ray hray apply Finset.sum_le_sum intro q hq obtain ⟨x,hx,hqx⟩ := Finset.mem_image.mp hq have hq0 : q.1 ≠ ⊥ := by rw [← hqx] exact (globalSecondFixedTriple_nonzero p hp x).1 have ht := htrans p hp hcop hg hinj hc θ₁ θ₂ s side q j pool Ψ m ray ell (globalPooledRowScale K ell B F j) γ Γ hell hy hq0 hΓ hγ hΨ hs hk have ht' := mul_le_mul_of_nonneg_left ht hfirst apply ht'.trans_eq have hc0 := (globalPooledColumnScale_pos ell hell j).ne' have hl0 := (zero_lt_one.trans_le (globalPooledLabelScale_ge_one j)).ne' unfold globalDescentWeight field_simp end SecondPassArithmetic section open scoped BigOperators Classical open MeasureTheory namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (columnLog primeProductNorm) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] include hp in omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem fixedSecondTest_subunit (V : ℝ → ℂ) (X A : ℝ) (hX : 0 < X) (hV : ∀ s,V s ≠ 0 → |s| ≤ A) (hsmall : X*Real.exp A < 1) (a b : ℝ) (negative : Bool) (S : Finset ι) : fixedSecondTest p V X a b negative S=0 := by have hz : V (columnLog p X S)=0 := by by_contra hn have hh := columnLog_norm_upper p hp X A hX S ((le_abs_self _).trans (hV _ hn)) have h1 := primeProductNorm_ge_one p hp S linarith cases negative <;> simp [fixedSecondTest,JointLogSeparation.fixedColumnTest,hz] end SecondPassArithmetic namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) theorem childEnergy_subunit (pool : Finset ι) (Ψ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V : ℝ → ℂ) (X A : ℝ) (hX : 0 < X) (hV : ∀ s,V s ≠ 0 → |s| ≤ A) (hsmall : X*Real.exp A < 1) (a b : ℝ) (negative rowNegative : Bool) : childEnergy p hp hcop hg pool Ψ m T V X negative rowNegative a b=0 := by have hrow (f y : O) : fixedChildRow p hp hcop hg pool Ψ m (fixedSecondTest p V X a b negative) f y=0 := by unfold fixedChildRow apply Finset.sum_eq_zero intro S hS simp only [secondChildColumn,fixedSecondTest_subunit p hp V X A hX hV hsmall a b negative S,mul_zero] simp [childEnergy,idealChildRow,hrow] theorem densityChildEnergy_subunit (pool : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (T : Finset (Ideal O × O)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ A : ℝ) (J : ℕ) (hX : 0 < X₁) (hV : ∀ s,V₁ s ≠ 0 → |s| ≤ A) (hsmall : X₁*Real.exp A < 1) : densityChildEnergy p hp hcop hg pool Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ J=0 := by unfold densityChildEnergy childGeometricMean simp only [childEnergy_subunit p hp hcop hg pool Ψ₁ m T V₁ X₁ A hX hV hsmall, Real.sqrt_zero,zero_mul,mul_zero,integral_zero] theorem childDensity_elementary_all_scales (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (hΨ₁ : ∀ a,‖Ψ₁ a‖ ≤ 1) (hΨ₂ : ∀ a,‖Ψ₂ a‖ ≤ 1) (m : O) (T : Finset (Ideal O × O)) (V₁ V₂ : ℝ → ℂ) (X F K A M : ℝ) (J : ℕ) (hX : 0 < X) (hF : 1 ≤ F) (hK : 1 ≤ K) (hA : 0 ≤ A) (hM : 0 ≤ M) (hV₁ : ∀ s,‖V₁ s‖ ≤ M) (hV₂ : ∀ s,‖V₂ s‖ ≤ M) (hVs₁ : ∀ s,V₁ s ≠ 0 → |s| ≤ A) (hVs₂ : ∀ s,V₂ s ≠ 0 → |s| ≤ A) (hT : ∀ z∈T,z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ F ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ K) : densityChildEnergy p hp hcop hg pool Ψ₁ Ψ₂ m T V₁ V₂ X X (2*J)/(X*F) ≤ (6*128^4*(Real.exp A*M)^2*(∫ t : ℝ,FirstPassCubeLabels.firstLogDensity 0 t)^3)*K*X := by by_cases hscale : 1 ≤ X*Real.exp A · exact childDensity_elementary_supported p hp hcop hg hc hinj pool Ψ₁ Ψ₂ hΨ₁ hΨ₂ m T V₁ V₂ X F K A M J hX hF hK hA hM hscale hV₁ hV₂ hVs₁ hVs₂ hT · rw [densityChildEnergy_subunit p hp hcop hg pool Ψ₁ Ψ₂ m T V₁ V₂ X X A (2*J) hX hVs₁ (lt_of_not_ge hscale),zero_div] have hI : 0 ≤ ∫ t : ℝ,FirstPassCubeLabels.firstLogDensity 0 t := integral_nonneg (fun t => FirstPassCubeLabels.firstLogDensity_nonneg 0 t) positivity end SecondPassIntegration end namespace SecondPassArithmetic open MeasureTheory open scoped BigOperators Classical open ActualEisensteinCubic open SecondPassIntegration (densityChildEnergy) def globalTerminalConstant (A M : ℝ) : ℝ := 6*128^4*(Real.exp A*M)^2*(∫ t : ℝ,FirstPassCubeLabels.firstLogDensity 0 t)^3 def globalRayTripleConstant : ℝ := 128^3*(Real.exp 1)^18*(512*32^2) theorem globalTerminalConstant_nonneg (A M : ℝ) : 0 ≤ globalTerminalConstant A M := by have hI : 0 ≤ ∫ t : ℝ,FirstPassCubeLabels.firstLogDensity 0 t := integral_nonneg (fun t => FirstPassCubeLabels.firstLogDensity_nonneg 0 t) unfold globalTerminalConstant positivity theorem radial_decay_step (R : ℝ) (hR : 0 ≤ R) (N : ℕ) : R/(1+R)^(N+1) ≤ 1/(1+R)^N := by have h1 : 0 < 1+R := by linarith have hr : R/(1+R) ≤ 1 := (div_le_iff₀ h1).mpr (by linarith) calc R/(1+R)^(N+1) = (R/(1+R))/(1+R)^N := by rw [pow_succ];field_simp _ ≤ _ := div_le_div_of_nonneg_right hr (pow_nonneg h1.le _) theorem globalPooledRow_radial_bound (K ell B F : ℝ) (hK : 0 < K) (hell : 0 < ell) (hB : 1 ≤ B) (hF : 1 ≤ F) (j : GlobalLogIndex) (hJ : globalLogRep j 4 ≤ B^2) : globalLogRep j 8*Real.exp 1 ≤ globalBinRadial ell (globalPooledRowScale K ell B F j) j*K := by have hB0 := zero_lt_one.trans_le hB have hF0 := zero_lt_one.trans_le hF have hD := globalPooledDelta_pos B F hB0 hF0 j have hD1 : 1 ≤ globalPooledDelta B F j := (one_le_mul_of_one_le_of_one_le hB hF).trans (globalPooledDelta_ge B F hB0.le hF0.le j) have hN := globalPooledNaturalRow_pos K B F hK hB0 hF0 j have hR := globalBinRadial_pos ell (globalPooledRowScale K ell B F j) hell (globalPooledRowScale_pos K ell B F hK hell hB0 hF0 j) j have he : globalLogRep j 8*Real.exp 1 = globalBinRadial ell (globalPooledRowScale K ell B F j) j*globalPooledNaturalRow K B F j := by rw [globalBinRadial,globalPooled_radial_ratio K ell B F hK hell hB0 hF0] field_simp calc _ = _ := he _ ≤ globalBinRadial ell (globalPooledRowScale K ell B F j) j*(K/(globalPooledDelta B F j)^2) := mul_le_mul_of_nonneg_left (globalPooledNaturalRow_bound K B F hK hB0 hF0 j hJ) hR.le _ ≤ _ := mul_le_mul_of_nonneg_left (div_le_self hK.le (one_le_pow₀ hD1)) hR.le theorem globalRadialBin_terminal_bound {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (V₁ V₂ : ℝ → ℂ) (C ε θ₁ θ₂ K ell B F A₀ M : ℝ) (N J : ℕ) (hC : 0 ≤ C) (hε : 0 < ε) (hK : 0 < K) (hell : 0 < ell) (hB : 1 ≤ B) (hF : 1 ≤ F) (hA₀ : 0 ≤ A₀) (hM : 0 ≤ M) (hV₁ : ∀ t,‖V₁ t‖ ≤ M) (hV₂ : ∀ t,‖V₂ t‖ ≤ M) (hVs₁ : ∀ t,V₁ t ≠ 0 → |t| ≤ A₀) (hVs₂ : ∀ t,V₂ t ≠ 0 → |t| ≤ A₀) (s : Finset (GlobalSecondData ι)) (side : Bool) (j : GlobalLogIndex) (hk : ∀ x∈s,x.source.frequency ≠ 0) (hb₁ : ∀ x∈s,‖ConcreteTraceCRT.eisEmbedding (FirstPassCubeLabels.primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ∀ x∈s,‖ConcreteTraceCRT.eisEmbedding (FirstPassCubeLabels.primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) (hJ : globalLogRep j 4 ≤ B^2) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype (∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, globalDescentWeight C ε θ₁ θ₂ K ell B F (N+1) (2*J) j ray q * (densityChildEnergy p hp hcop hg pool (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fixedTripleMask m q) (globalArithmeticTargets p s side q j) V₁ V₂ (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) (2*J) / (globalPooledColumnScale ell j*globalPooledLabelScale j))) ≤ (C*(1+‖θ₁‖)^(2*J+2)*(1+‖θ₂‖)^(2*J+2)*(globalBinLossScale B j)^ε * (globalTerminalConstant A₀ M*globalRayTripleConstant)*K*((ell*B^3)*F)) / (1+globalBinRadial ell (globalPooledRowScale K ell B F j) j)^N := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype let X := globalPooledColumnScale ell j let lengthScale := globalPooledLabelScale j let R := globalBinRadial ell (globalPooledRowScale K ell B F j) j let K' := globalLogRep j 8*Real.exp 1 let Ct := globalTerminalConstant A₀ M let Q := C*(1+‖θ₁‖)^(2*J+2)*(1+‖θ₂‖)^(2*J+2)*(globalBinLossScale B j)^ε * (Ct*globalRayTripleConstant)*K*((ell*B^3)*F) have hB0 := zero_lt_one.trans_le hB have hF0 := zero_lt_one.trans_le hF have hX := globalPooledColumnScale_pos ell hell j have hL := globalPooledLabelScale_ge_one j have hR : 0 < R := globalBinRadial_pos ell _ hell (globalPooledRowScale_pos K ell B F hK hell hB0 hF0 j) j have hK' : 1 ≤ K' := one_le_mul_of_one_le_of_one_le (globalLogRep_ge_one j 8) (Real.one_le_exp (by norm_num)) have hCt : 0 ≤ Ct := globalTerminalConstant_nonneg A₀ M have hrow : K' ≤ R*K := globalPooledRow_radial_bound K ell B F hK hell hB hF j hJ have hQ : 0 ≤ Q := by have hn : 0 ≤ globalBinLossScale B j := by have hh := (globalLogRep_pos j 4).le unfold globalBinLossScale;positivity unfold Q globalRayTripleConstant positivity have hterm (ray : SecondRayIndex) (q : Ideal O × Ideal O × Ideal O) : densityChildEnergy p hp hcop hg pool (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fixedTripleMask m q) (globalArithmeticTargets p s side q j) V₁ V₂ X X (2*J)/(X*lengthScale) ≤ Ct*K'*(X*lengthScale) := by have h := SecondPassIntegration.childDensity_elementary_all_scales p hp hcop hg hc hinj pool (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fun a => (secondRayMinus_norm_le Ψ ray a).trans (hΨ a)) (fun a => (secondRayPlus_norm_le Ψ ray a).trans (hΨ a)) (fixedTripleMask m q) (globalArithmeticTargets p s side q j) V₁ V₂ X lengthScale K' A₀ M J hX hL hK' hA₀ hM hV₁ hV₂ hVs₁ hVs₂ (globalArithmeticTargets_bounds p hp s side q j hk) apply h.trans apply mul_le_mul_of_nonneg_left · exact le_mul_of_one_le_right hX.le hL · exact mul_nonneg hCt (zero_le_one.trans hK') have hmass := globalDescentWeight_mass p hp C ε θ₁ θ₂ K ell B F (N+1) (2*J) hC hε hK hell hB0 hF0 side s j hk hb₁ hb₂ calc _ ≤ ∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, globalDescentWeight C ε θ₁ θ₂ K ell B F (N+1) (2*J) j ray q*(Ct*K'*(X*lengthScale)) := by apply Finset.sum_le_sum intro ray hray apply Finset.sum_le_sum intro q hq exact mul_le_mul_of_nonneg_left (hterm ray q) (globalDescentWeight_nonneg C ε θ₁ θ₂ K ell B F (N+1) (2*J) j ray q hC hK hell hB0 hF0) _ = Ct*K'*(∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, globalDescentWeight C ε θ₁ θ₂ K ell B F (N+1) (2*J) j ray q*(X*lengthScale)) := by simp only [Finset.mul_sum] congr 1 funext ray congr 1 funext q ring _ ≤ Ct*(R*K)*((C*(1+‖θ₁‖)^(2*J+2)*(1+‖θ₂‖)^(2*J+2)*(globalBinLossScale B j)^ε / (1+R)^(N+1))*globalRayTripleConstant*((ell*B^3)*F)) := by apply mul_le_mul · exact mul_le_mul_of_nonneg_left hrow hCt · exact hmass · apply Finset.sum_nonneg intro ray hray apply Finset.sum_nonneg intro q hq exact mul_nonneg (globalDescentWeight_nonneg C ε θ₁ θ₂ K ell B F (N+1) (2*J) j ray q hC hK hell hB0 hF0) (mul_nonneg hX.le (zero_le_one.trans hL)) · exact mul_nonneg hCt (mul_nonneg hR.le hK.le) _ = Q*(R/(1+R)^(N+1)) := by dsimp only [Q];ring _ ≤ Q*(1/(1+R)^N) := mul_le_mul_of_nonneg_left (radial_decay_step R hR.le N) hQ _ = _ := by dsimp only [Q,R,Ct];ring theorem globalRadialBin_terminal_bound_all_bins {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (V₁ V₂ : ℝ → ℂ) (C ε θ₁ θ₂ K ell B F A₀ M : ℝ) (N J : ℕ) (hC : 0 ≤ C) (hε : 0 < ε) (hK : 0 < K) (hell : 0 < ell) (hB : 1 ≤ B) (hF : 1 ≤ F) (hA₀ : 0 ≤ A₀) (hM : 0 ≤ M) (hV₁ : ∀ t,‖V₁ t‖ ≤ M) (hV₂ : ∀ t,‖V₂ t‖ ≤ M) (hVs₁ : ∀ t,V₁ t ≠ 0 → |t| ≤ A₀) (hVs₂ : ∀ t,V₂ t ≠ 0 → |t| ≤ A₀) (s : Finset (GlobalSecondData ι)) (side : Bool) (j : GlobalLogIndex) (hk : ∀ x∈s,x.source.frequency ≠ 0) (hb₁ : ∀ x∈s,‖ConcreteTraceCRT.eisEmbedding (FirstPassCubeLabels.primeProduct p x.cube.support x.cube.leftExponent)‖^2 ≤ B) (hb₂ : ∀ x∈s,‖ConcreteTraceCRT.eisEmbedding (FirstPassCubeLabels.primeProduct p x.cube.support x.cube.rightExponent)‖^2 ≤ B) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype (∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, globalDescentWeight C ε θ₁ θ₂ K ell B F (N+1) (2*J) j ray q * (densityChildEnergy p hp hcop hg pool (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fixedTripleMask m q) (globalArithmeticTargets p s side q j) V₁ V₂ (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) (2*J) / (globalPooledColumnScale ell j*globalPooledLabelScale j))) ≤ (C*(1+‖θ₁‖)^(2*J+2)*(1+‖θ₂‖)^(2*J+2)*(globalBinLossScale B j)^ε * (globalTerminalConstant A₀ M*globalRayTripleConstant)*K*((ell*B^3)*F)) / (1+globalBinRadial ell (globalPooledRowScale K ell B F j) j)^N := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype by_cases hs : (globalLogSector p s side j).Nonempty · obtain ⟨x,hx⟩ := hs obtain ⟨hxs,hj⟩ := Finset.mem_filter.mp hx have hJ := globalPooled_J_bound p hp B (zero_lt_one.trans_le hB) side x (hk x hxs) (hb₁ x hxs) (hb₂ x hxs) rw [hj] at hJ exact globalRadialBin_terminal_bound p hp hcop hg hc hinj pool Ψ hΨ m V₁ V₂ C ε θ₁ θ₂ K ell B F A₀ M N J hC hε hK hell hB hF hA₀ hM hV₁ hV₂ hVs₁ hVs₂ s side j hk hb₁ hb₂ hJ · have he : globalBinTriples p s side j=∅ := by simp only [globalBinTriples,Finset.not_nonempty_iff_eq_empty.mp hs,Finset.image_empty] rw [he] simp only [Finset.sum_empty,Finset.sum_const_zero] have hB0 := zero_lt_one.trans_le hB have hF0 := zero_lt_one.trans_le hF have hR := globalBinRadial_pos ell _ hell (globalPooledRowScale_pos K ell B F hK hell hB0 hF0 j) j have hct := globalTerminalConstant_nonneg A₀ M have hl := zero_lt_one.trans_le (globalPooledLabelScale_ge_one j) have h4 := globalLogRep_pos j 4 have hh : 0 ≤ globalBinLossScale B j := by unfold globalBinLossScale;positivity unfold globalRayTripleConstant positivity end SecondPassArithmetic open scoped BigOperators Classical namespace CanonicalQuadraticSieve open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum CompletedGauss open QuadraticSquarefreeKernel def liftingPrimeElement : O := ActualEisensteinCoordinates.eval 1 3 def liftingPrime : Ideal O := Ideal.span {liftingPrimeElement} theorem liftingPrimeElement_norm : ShortDraftLatticeCount.qNat liftingPrimeElement=7 := by unfold ShortDraftLatticeCount.qNat liftingPrimeElement rw [ShortDraftLatticeCount.coords_eval] norm_num [ShortDraftLatticeCount.q] all_goals rfl theorem liftingPrime_norm : Ideal.absNorm liftingPrime=7 := by rw [liftingPrime,←qNat_eq_absNorm_span,liftingPrimeElement_norm] theorem liftingPrime_prime : Prime liftingPrime := by apply Ideal.prime_of_isPrime · intro h have hh := Ideal.absNorm_eq_zero_iff.mpr h rw [liftingPrime_norm] at hh norm_num at hh · exact Ideal.isPrime_of_irreducible_absNorm (by rw [liftingPrime_norm,Nat.irreducible_iff_nat_prime] exact (by decide : Nat.Prime 7)) theorem liftingPrime_supported : Supported liftingPrime := by apply (supported_span_iff liftingPrimeElement).mpr have hlam : ShortDraftLatticeCount.qNat lambda=3 := by have he : lambda=ActualEisensteinCoordinates.eval (-1) 1 := theta_counter_lambda_eq rw [he] unfold ShortDraftLatticeCount.qNat rw [ShortDraftLatticeCount.coords_eval] norm_num [ShortDraftLatticeCount.q] all_goals rfl have htwo : ShortDraftLatticeCount.qNat (2:O)=4 := by have he : (2:O)=ActualEisensteinCoordinates.eval 2 0 := by simp [ActualEisensteinCoordinates.eval] rw [he] unfold ShortDraftLatticeCount.qNat rw [ShortDraftLatticeCount.coords_eval] norm_num [ShortDraftLatticeCount.q] all_goals rfl constructor · rintro ⟨z,hz⟩ have h := congrArg ShortDraftLatticeCount.qNat hz rw [liftingPrimeElement_norm,ShortDraftLatticeCount.qNat_mul,hlam] at h omega · rintro ⟨z,hz⟩ have h := congrArg ShortDraftLatticeCount.qNat hz rw [liftingPrimeElement_norm,ShortDraftLatticeCount.qNat_mul,htwo] at h omega theorem supported_pow {I : Ideal O} (hI : Supported I) (k : ℕ) : Supported (I ^k) := by induction k with | zero => simp only [pow_zero] refine ⟨one_ne_zero,?_⟩ intro P hP change P∈UniqueFactorizationMonoid.normalizedFactors (1:Ideal O) at hP rw [UniqueFactorizationMonoid.normalizedFactors_one] at hP exact (Multiset.notMem_zero P hP).elim | succ k hk => rw [pow_succ] exact (supported_mul_iff _ _).mpr ⟨hk,hI⟩ theorem exists_lifting_exponent (M : ℝ) (I : Ideal O) (hI : I≠0) (hIM : (Ideal.absNorm I:ℝ)≤M) : ∃k : ℕ, M<(49:ℝ)^k*(Ideal.absNorm I:ℝ) ∧ (49:ℝ)^k*(Ideal.absNorm I:ℝ)≤49*M := by have hN : 0<(Ideal.absNorm I:ℝ) := by exact_mod_cast Nat.pos_iff_ne_zero.mpr (fun hz => hI (Ideal.absNorm_eq_zero_iff.mp hz)) obtain ⟨k,hlo,hhi⟩ := exists_nat_pow_near ((le_div_iff₀ hN).mpr (by simpa using hIM)) (by norm_num : (1:ℝ)<49) refine ⟨k+1,?_,?_⟩ · exact (div_lt_iff₀ hN).mp hhi · have h := (le_div_iff₀ hN).mp hlo rw [pow_succ] nlinarith def liftingExponent (M : ℝ) (I : Ideal O) (hI : I≠0) (hIM : (Ideal.absNorm I:ℝ)≤M) : ℕ := (exists_lifting_exponent M I hI hIM).choose def liftedRow (M : ℝ) (I : Ideal O) (hI : I≠0) (hIM : (Ideal.absNorm I:ℝ)≤M) : Ideal O := (liftingPrime^liftingExponent M I hI hIM)^2*I theorem liftedRow_norm (M : ℝ) (I : Ideal O) (hI : I≠0) (hIM : (Ideal.absNorm I:ℝ)≤M) : (Ideal.absNorm (liftedRow M I hI hIM):ℝ)=(49:ℝ)^liftingExponent M I hI hIM*(Ideal.absNorm I:ℝ) := by simp only [liftedRow,map_mul,map_pow,liftingPrime_norm,Nat.cast_mul,Nat.cast_pow,Nat.cast_ofNat] rw [←pow_mul, Nat.mul_comm, pow_mul] norm_num theorem liftedRow_bounds (M : ℝ) (I : Ideal O) (hI : I≠0) (hIM : (Ideal.absNorm I:ℝ)≤M) : M<(Ideal.absNorm (liftedRow M I hI hIM):ℝ) ∧ (Ideal.absNorm (liftedRow M I hI hIM):ℝ)≤49*M := by rw [liftedRow_norm] exact (exists_lifting_exponent M I hI hIM).choose_spec theorem liftedRow_squarefreePart (M : ℝ) (I : Ideal O) (hI : Admissible I) (hIM : (Ideal.absNorm I:ℝ)≤M) : squarefreePart (liftedRow M I hI.1 hIM)=I := (squarePart_mul_squarefree (pow_ne_zero _ liftingPrime_prime.ne_zero) hI.2.1).2 theorem liftedRow_supported (M : ℝ) (I : Ideal O) (hI : Admissible I) (hIM : (Ideal.absNorm I:ℝ)≤M) : Supported (liftedRow M I hI.1 hIM) := by exact (supported_mul_iff _ _).mpr ⟨supported_pow (supported_pow liftingPrime_supported _) _,admissible_supported hI⟩ theorem liftedRow_character (M : ℝ) (I : Ideal O) (hI : Admissible I) (hIM : (Ideal.absNorm I:ℝ)≤M) (J : Ideal O) (hJ : Admissible J) (hPJ : IsCoprime liftingPrime J) : quadraticRow J (primaryGenerator (liftedRow M I hI.1 hIM)) = quadraticRow J (primaryGenerator I) := by rw [liftedRow,canonical_quadraticRow_primary_squarefree J hJ, idealZeroMask_primary_eq_indicator J _ hJ.1 (supported_pow liftingPrime_supported _), if_pos hPJ.pow_left,one_mul] end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.AnnularLifting namespace OAI noncomputable section namespace CanonicalQuadraticSieve open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators section open scoped BigOperators Classical section open ActualEisensteinCubic ConcretePrimeRowBridge CompletedGauss QuadraticSquarefreeKernel def squarefreeHighRange (M K : ℝ) : Finset (Ideal O) := (idealRange M).filter (fun I => K<(Ideal.absNorm I:ℝ)) def annularLift (M K : ℝ) (I : squarefreeHighRange M K) : Ideal O := liftedRow M I.val (mem_idealRange.mp (Finset.mem_filter.mp I.property).1).1.1 (mem_idealRange.mp (Finset.mem_filter.mp I.property).1).2 theorem annularLift_injective (M K : ℝ) : Function.Injective (annularLift M K) := by intro I J h have he := congrArg squarefreePart h apply Subtype.ext simpa only [annularLift, liftedRow_squarefreePart M I.val (mem_idealRange.mp (Finset.mem_filter.mp I.property).1).1, liftedRow_squarefreePart M J.val (mem_idealRange.mp (Finset.mem_filter.mp J.property).1).1] using he theorem annularLift_properties (M K : ℝ) (I : squarefreeHighRange M K) : Supported (annularLift M K I) ∧ K<(Ideal.absNorm (squarefreePart (annularLift M K I)):ℝ) ∧ M<(Ideal.absNorm (annularLift M K I):ℝ) ∧ (Ideal.absNorm (annularLift M K I):ℝ)≤49*M := by have hi := mem_idealRange.mp (Finset.mem_filter.mp I.property).1 have hn := liftedRow_bounds M I.val hi.1.1 hi.2 refine ⟨liftedRow_supported M I.val hi.1 hi.2,?_,hn⟩ simpa only [annularLift,liftedRow_squarefreePart M I.val hi.1] using (Finset.mem_filter.mp I.property).2 theorem annularLift_row_sum (M N K : ℝ) (I : squarefreeHighRange M K) (a : idealRange N → ℂ) (hcop : ∀J, a J≠0 → IsCoprime liftingPrime J.val) : (∑J : idealRange N, quadraticRow J.val (primaryGenerator (annularLift M K I))*a J) = ∑J : idealRange N, quadraticRow J.val (primaryGenerator I.val)*a J := by apply Finset.sum_congr rfl intro J _ by_cases hz : a J=0 · simp only [hz,mul_zero] · rw [annularLift,liftedRow_character M I.val (mem_idealRange.mp (Finset.mem_filter.mp I.property).1).1 _ J.val (mem_idealRange.mp J.property).1 (hcop J hz)] lemma exists_lifted_annular_scale (M x : ℝ) (hM : 0 ‖∑J : idealRange N, quadraticRow J.val (primaryGenerator I)*a J‖^2 have hE (I : Ideal O) : 0≤E I := sq_nonneg _ have hlift : (∑I : squarefreeHighRange M K, E I.val) = ∑I : squarefreeHighRange M K, E (annularLift M K I) := by apply Finset.sum_congr rfl intro I _ dsimp only [E] rw [annularLift_row_sum M N K I a hcop] change (∑I : squarefreeHighRange M K, E I.val)≤_ rw [hlift] have hpoint (I : squarefreeHighRange M K) : E (annularLift M K I) ≤ ∑j : Fin 7, if annularLift M K I∈highKernelRange (2*((2:ℝ)^j.val*M)) K then annularHighWeight ((2:ℝ)^j.val*M) (annularLift M K I)*E (annularLift M K I) else 0 := by have hp := annularLift_properties M K I obtain ⟨j,hjlo,hjhi⟩ := exists_lifted_annular_scale M _ hM hp.2.2.1 hp.2.2.2 have hMj : 0<(2:ℝ)^j.val*M := by positivity have hm : annularLift M K I∈highKernelRange (2*((2:ℝ)^j.val*M)) K := mem_highKernelRange.mpr ⟨hp.1,by linarith,hp.2.1⟩ have hw : annularHighWeight ((2:ℝ)^j.val*M) (annularLift M K I)=1 := by apply QuadraticInitialBound.annularSieveBump_eq_one · exact (le_div_iff₀ hMj).mpr (by linarith) · exact (div_le_one hMj).mpr hjhi have hh := Finset.single_le_sum (s := (Finset.univ : Finset (Fin 7))) (f := fun j => if annularLift M K I∈highKernelRange (2*((2:ℝ)^j.val*M)) K then annularHighWeight ((2:ℝ)^j.val*M) (annularLift M K I)*E (annularLift M K I) else 0) (fun j _ => by split_ifs; exact mul_nonneg QuadraticInitialBound.annularSieveBump.nonneg (hE _); exact le_rfl) (Finset.mem_univ j) simpa only [hm,ite_true,hw,one_mul] using hh calc _ ≤ ∑I : squarefreeHighRange M K, ∑j : Fin 7, if annularLift M K I∈highKernelRange (2*((2:ℝ)^j.val*M)) K then annularHighWeight ((2:ℝ)^j.val*M) (annularLift M K I)*E (annularLift M K I) else 0 := Finset.sum_le_sum (fun I _ => hpoint I) _ = ∑j : Fin 7, ∑I : squarefreeHighRange M K, if annularLift M K I∈highKernelRange (2*((2:ℝ)^j.val*M)) K then annularHighWeight ((2:ℝ)^j.val*M) (annularLift M K I)*E (annularLift M K I) else 0 := Finset.sum_comm _ ≤ _ := by apply Finset.sum_le_sum intro j _ rw [annularHighEnergy,Finset.sum_coe_sort (highKernelRange (2*((2:ℝ)^j.val*M)) K) (fun I => annularHighWeight ((2:ℝ)^j.val*M) I*E I)] exact sum_injective_mask_le (annularLift M K) (annularLift_injective M K) (highKernelRange (2*((2:ℝ)^j.val*M)) K) (fun I => annularHighWeight ((2:ℝ)^j.val*M) I*E I) (fun I => mul_nonneg QuadraticInitialBound.annularSieveBump.nonneg (hE I)) end section open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum open FiniteSieveRestriction def liftingDivisibleColumns (N : ℝ) : Finset (idealRange N) := Finset.univ.filter (fun J => liftingPrime∣J.val) def liftingQuotientColumn (N : ℝ) (J : liftingDivisibleColumns N) : idealRange N := ⟨idealQuotient liftingPrime J.val.val, by have hd := (Finset.mem_filter.mp J.property).2 have hj := mem_idealRange.mp J.val.property refine mem_idealRange.mpr ⟨admissible_idealQuotient hj.1 hd,?_⟩ have hn := idealQuotient_norm_le liftingPrime_prime.ne_zero hd N hj.2 rw [liftingPrime_norm] at hn have hN : 0≤N := (Nat.cast_nonneg _).trans hj.2 exact hn.trans (by norm_num; linarith)⟩ theorem liftingQuotientColumn_injective (N : ℝ) : Function.Injective (liftingQuotientColumn N) := by intro I J h apply Subtype.ext apply Subtype.ext exact idealQuotient_injective_on liftingPrime (Finset.mem_filter.mp I.property).2 (Finset.mem_filter.mp J.property).2 (congrArg Subtype.val h) def liftingFreeCoefficient (N : ℝ) (a : idealRange N → ℂ) : idealRange N → ℂ := fun J => if liftingPrime∣J.val then 0 else a J def liftingDividedCoefficient (N : ℝ) (a : idealRange N → ℂ) : idealRange N → ℂ := extendByZero Finset.univ (liftingQuotientColumn N) (fun J : liftingDivisibleColumns N => a J.val) theorem liftingFreeCoefficient_coprime (N : ℝ) (a : idealRange N → ℂ) (J : idealRange N) (hJ : liftingFreeCoefficient N a J≠0) : IsCoprime liftingPrime J.val := by apply ideals_coprime_of_relprime apply liftingPrime_prime.irreducible.isRelPrime_iff_not_dvd.mpr intro hd exact hJ (by simp only [liftingFreeCoefficient,hd,ite_true]) theorem liftingDividedCoefficient_coprime (N : ℝ) (a : idealRange N → ℂ) (J : idealRange N) (hJ : liftingDividedCoefficient N a J≠0) : IsCoprime liftingPrime J.val := by classical have hmem : J∈(Finset.univ : Finset (liftingDivisibleColumns N)).image (liftingQuotientColumn N) := by by_contra hn exact hJ (extendByZero_zero _ _ _ _ hn) obtain ⟨I,hI,rfl⟩ := Finset.mem_image.mp hmem have hdiv := (Finset.mem_filter.mp I.property).2 have hsf : Squarefree (liftingPrime*idealQuotient liftingPrime I.val.val) := by rw [idealQuotient_mul hdiv] exact (mem_idealRange.mp I.val.property).1.2.1 exact ideals_coprime_of_relprime _ _ (squarefree_mul_iff.mp hsf).1 theorem liftingDividedCoefficient_row_sum (N : ℝ) (a : idealRange N → ℂ) (z : O) : (∑J : idealRange N, quadraticRow J.val z*liftingDividedCoefficient N a J) = ∑J : liftingDivisibleColumns N, quadraticRow (idealQuotient liftingPrime J.val.val) z*a J.val := by simpa only [liftingDividedCoefficient,liftingQuotientColumn] using extendByZero_matrix Finset.univ (liftingQuotientColumn N) (fun J : liftingDivisibleColumns N => a J.val) (fun (_ : Unit) J => quadraticRow J.val z) () theorem liftingCoefficient_row_split (N : ℝ) (a : idealRange N → ℂ) (z : O) : (∑J : idealRange N, quadraticRow J.val z*a J) = (∑J : idealRange N, quadraticRow J.val z*liftingFreeCoefficient N a J) + quadraticRow liftingPrime z*(∑J : idealRange N, quadraticRow J.val z*liftingDividedCoefficient N a J) := by rw [liftingDividedCoefficient_row_sum,Finset.mul_sum, Finset.sum_coe_sort (liftingDivisibleColumns N) (fun J => quadraticRow liftingPrime z*(quadraticRow (idealQuotient liftingPrime J.val) z*a J))] simp only [liftingDivisibleColumns,Finset.sum_filter,←Finset.sum_add_distrib] apply Finset.sum_congr rfl intro J _ by_cases hd : liftingPrime∣J.val · simp only [hd,ite_true,liftingFreeCoefficient,mul_zero,zero_add] rw [quadraticRow_divisor_factor J.val liftingPrime (mem_idealRange.mp J.property).1 hd z] ring · simp only [hd,ite_false,liftingFreeCoefficient,add_zero] theorem liftingCoefficient_energy (N : ℝ) (a : idealRange N → ℂ) : (∑J : idealRange N, ‖liftingFreeCoefficient N a J‖^2) + (∑J : idealRange N, ‖liftingDividedCoefficient N a J‖^2) = ∑J, ‖a J‖^2 := by have he := extendByZero_energy Finset.univ (liftingQuotientColumn N) (fun J : liftingDivisibleColumns N => a J.val) (liftingQuotientColumn_injective N).injOn change (∑J : idealRange N, ‖liftingDividedCoefficient N a J‖^2)= ∑J : liftingDivisibleColumns N, ‖a J.val‖^2 at he rw [he,Finset.sum_coe_sort (liftingDivisibleColumns N) (fun J => ‖a J‖^2)] simp only [liftingDivisibleColumns,Finset.sum_filter,←Finset.sum_add_distrib] apply Finset.sum_congr rfl intro J _ by_cases hd : liftingPrime∣J.val <;> simp only [liftingFreeCoefficient,hd,ite_true,ite_false,norm_zero,zero_pow (by decide : 2≠0),zero_add,add_zero] theorem liftingCoefficient_row_energy (N : ℝ) (a : idealRange N → ℂ) (z : O) : ‖∑J : idealRange N, quadraticRow J.val z*a J‖^2 ≤ 2*(‖∑J : idealRange N, quadraticRow J.val z*liftingFreeCoefficient N a J‖^2 + ‖∑J : idealRange N, quadraticRow J.val z*liftingDividedCoefficient N a J‖^2) := by rw [liftingCoefficient_row_split] let u := ∑J : idealRange N, quadraticRow J.val z*liftingFreeCoefficient N a J let v := ∑J : idealRange N, quadraticRow J.val z*liftingDividedCoefficient N a J change ‖u+quadraticRow liftingPrime z*v‖^2≤2*(‖u‖^2+‖v‖^2) have hp : ‖quadraticRow liftingPrime z*v‖≤‖v‖ := by rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (quadraticRow_norm_le_one _ _) have hn : ‖u+quadraticRow liftingPrime z*v‖≤‖u‖+‖v‖ := by linarith [norm_add_le u (quadraticRow liftingPrime z*v)] have hs := pow_le_pow_left₀ (norm_nonneg _) hn 2 nlinarith [sq_nonneg (‖u‖-‖v‖)] theorem liftingFreeCoefficient_shell (N X : ℝ) (a : idealRange N → ℂ) (ha : CoefficientOnShell N X a) : CoefficientOnShell N X (liftingFreeCoefficient N a) := by intro J hJ have hj : a J≠0 := by intro hz exact hJ (by simp only [liftingFreeCoefficient,hz,ite_self]) exact ha J hj theorem liftingDividedCoefficient_shell (N X : ℝ) (a : idealRange N → ℂ) (ha : CoefficientOnShell N X a) : CoefficientOnShell N (X/7) (liftingDividedCoefficient N a) := by classical intro J hJ have hmem : J∈(Finset.univ : Finset (liftingDivisibleColumns N)).image (liftingQuotientColumn N) := by by_contra hn exact hJ (extendByZero_zero _ _ _ _ hn) obtain ⟨I,hI,rfl⟩ := Finset.mem_image.mp hmem have he : liftingDividedCoefficient N a (liftingQuotientColumn N I)=a I.val := extendByZero_apply_image _ _ _ (liftingQuotientColumn_injective N).injOn I (Finset.mem_univ I) have hn : a I.val≠0 := by rwa [he] at hJ have hs := ha I.val hn change (X/7)/2<(Ideal.absNorm (idealQuotient liftingPrime I.val.val):ℝ) ∧ (Ideal.absNorm (idealQuotient liftingPrime I.val.val):ℝ)≤X/7 rw [idealQuotient_norm_eq liftingPrime I.val.val liftingPrime_prime.ne_zero (Finset.mem_filter.mp I.property).2,liftingPrime_norm] norm_num only [Nat.cast_ofNat] constructor <;> linarith end section open ActualEisensteinCubic ConcretePrimeRowBridge CompletedGauss FiniteSieveOperator def ballQuadraticEnergy (M N : ℝ) (a : idealRange N → ℂ) : ℝ := ∑I : idealRange M, ‖∑J : idealRange N, quadraticRow J.val (primaryGenerator I.val)*a J‖^2 theorem ballQuadraticEnergy_low_high (M N K : ℝ) (a : idealRange N → ℂ) : ballQuadraticEnergy M N a ≤ sieveNorm K N*(∑J, ‖a J‖^2) + ∑I : squarefreeHighRange M K, ‖∑J : idealRange N, quadraticRow J.val (primaryGenerator I.val)*a J‖^2 := by classical let E := fun I : Ideal O => ‖∑J : idealRange N, quadraticRow J.val (primaryGenerator I)*a J‖^2 have hs : (idealRange M).filter (fun I => (Ideal.absNorm I:ℝ)≤K) ⊆ idealRange K := by intro I hI exact mem_idealRange.mpr ⟨(mem_idealRange.mp (Finset.mem_filter.mp hI).1).1,(Finset.mem_filter.mp hI).2⟩ have hlo : (∑I∈(idealRange M).filter (fun I => (Ideal.absNorm I:ℝ)≤K), E I) ≤ sieveNorm K N*(∑J, ‖a J‖^2) := by calc _ ≤ ∑I∈idealRange K,E I := Finset.sum_le_sum_of_subset_of_nonneg hs (fun I hI hnot => sq_nonneg _) _ = ballQuadraticEnergy K N a := (Finset.sum_coe_sort (idealRange K) E).symm _ ≤ _ := FiniteSieveOperator.energy_bound (matrix K N) a change (∑I : idealRange M,E I.val)≤_+(∑I : squarefreeHighRange M K,E I.val) rw [Finset.sum_coe_sort (idealRange M) E, ←Finset.sum_filter_add_sum_filter_not (idealRange M) (fun I => (Ideal.absNorm I:ℝ)≤K) E] rw [Finset.sum_coe_sort (squarefreeHighRange M K) E] simp only [not_le,squarefreeHighRange] linarith theorem ballQuadraticEnergy_lifted_annuli (M N K : ℝ) (hM : 0 liftingCoefficient_row_energy N a (primaryGenerator I.val)) _ = _ := by rw [←Finset.mul_sum,Finset.sum_add_distrib] have hfree := squarefreeHigh_energy_le_annuli M N K hM (liftingFreeCoefficient N a) (liftingFreeCoefficient_coprime N a) have hdiv := squarefreeHigh_energy_le_annuli M N K hM (liftingDividedCoefficient N a) (liftingDividedCoefficient_coprime N a) linarith end open ActualEisensteinCubic CompletedGauss theorem ballQuadraticEnergy_mono {M M' N : ℝ} (hM : M≤M') (a : idealRange N → ℂ) : ballQuadraticEnergy M N a≤ballQuadraticEnergy M' N a := by unfold ballQuadraticEnergy rw [Finset.sum_coe_sort (idealRange M) (fun I => ‖∑J : idealRange N, quadraticRow J.val (primaryGenerator I)*a J‖^2), Finset.sum_coe_sort (idealRange M') (fun I => ‖∑J : idealRange N, quadraticRow J.val (primaryGenerator I)*a J‖^2)] exact Finset.sum_le_sum_of_subset_of_nonneg (idealRange_mono hM) (fun I hI hnot => sq_nonneg _) theorem ballQuadraticEnergy_coefficientAtScale (M N X : ℝ) (a : idealRange N → ℂ) (ha : ∀J, a J≠0 → (Ideal.absNorm J.val:ℝ)≤X) : ballQuadraticEnergy M N a=ballQuadraticEnergy M X (coefficientAtScale N X a) := by unfold ballQuadraticEnergy simp_rw [coefficientAtScale_row_sum N X a ha] theorem ballQuadraticEnergy_column_shells (M N : ℝ) (lengthScale : ℕ) (hNL : N≤(2:ℝ)^lengthScale) (a : idealRange N → ℂ) : ballQuadraticEnergy M N a ≤ (lengthScale+1:ℝ)*∑j : Fin (lengthScale+1), ballQuadraticEnergy M N (dyadicColumnCoefficient N lengthScale hNL j a) := by simpa only [one_mul,ballQuadraticEnergy] using weighted_energy_column_shells N lengthScale hNL (fun I : idealRange M => fun J : idealRange N => quadraticRow J.val (primaryGenerator I.val)) (fun _ => (1:ℝ)) (fun _ => by norm_num) a theorem ballQuadraticEnergy_column_shells_at_scale (M N : ℝ) (lengthScale : ℕ) (hNL : N≤(2:ℝ)^lengthScale) (a : idealRange N → ℂ) : ballQuadraticEnergy M N a ≤ (lengthScale+1:ℝ)*∑j : Fin (lengthScale+1), ballQuadraticEnergy M ((2:ℝ)^j.val) (coefficientAtScale N ((2:ℝ)^j.val) (dyadicColumnCoefficient N lengthScale hNL j a)) := by apply (ballQuadraticEnergy_column_shells M N lengthScale hNL a).trans_eq apply congrArg (fun x : ℝ => (lengthScale + 1 : ℝ) * x) apply Finset.sum_congr rfl intro j _ exact ballQuadraticEnergy_coefficientAtScale M N _ _ (fun J hJ => (dyadicColumnCoefficient_shell N lengthScale hNL j a J hJ).2) theorem columnDyadicLength_scale_upper (N : ℝ) (hN : 1≤N) : (2:ℝ)^columnDyadicLength N≤2*N := by have hlog : 0 J.val)).filter (fun D => (Ideal.absNorm D:ℝ)≤H), ‖annularRayGcdBlock M N K D c a‖) + highKernelNorm (2*M) (N/H) K*(supportConstant ε hε*divisorConstant ε hε)*(N^ε)^2*∑J,‖a J‖^2) := by have h := highKernel_weighted_energy_ray_gcd_reduction ε hε H hH (fun I : highKernelRange (2*M) K => I.val) (fun J : idealRange N => J.val) Subtype.val_injective Subtype.val_injective (2*M) N K hN (fun I => I.property) (fun J => mem_idealRange.mp J.property) (fun I => annularHighWeight M I.val) 1 (by norm_num) (fun I => ⟨QuadraticInitialBound.annularSieveBump.nonneg,QuadraticInitialBound.annularSieveBump.le_one⟩) a simpa only [annularHighEnergy,annularRayGcdBlock,one_mul] using h theorem HasSieveExponent.annular_energy_from_scalar_cost {α : ℝ} (hexp : HasSieveExponent α) (hα : 1/2≤α) (deltaLoss : ℝ) (hδ : 0 J.val), (Ideal.absNorm D:ℝ)≤H → poissonComparisonMajorant sD sS sT CD CS CT CP l A hexp deltaLoss hδ ε hε (commonMaskIdeal D) K (N/(Ideal.absNorm D:ℝ)) M T (fun _ : Unit => (1:ℂ)) QuadraticInitialBound.annularSieveCutoff≤C) → ∀ (a : idealRange N → ℂ), CoefficientOnShell N N a → annularHighEnergy M N K a ≤ 16*((C/6)*(divisorConstant ε hε*N^ε) + (CH*((2*M)*(N/H))^deltaLoss*(2*M+Real.sqrt ((2*M)/K)*(N/H)^α))* (supportConstant ε hε*divisorConstant ε hε)*(N^ε)^2)*∑J,‖a J‖^2 := by obtain ⟨sD,sS,sT,CD,CS,CT,CP,hCD,hCS,hCT,hCP,hsmall⟩ := hexp.annular_small_gcd_complete hα deltaLoss hδ l A obtain ⟨CH,hCH,hhigh⟩ := hexp.high_kernel deltaLoss hδ refine ⟨sD,sS,sT,CD,CS,CT,CP,CH,hCD,hCS,hCT,hCP,hCH,?_⟩ intro ε hε M N K T H C hM hN hK hT hH hHN hC hcost a ha classical let S := (gcdPool (fun J : idealRange N => J.val)).filter (fun D => (Ideal.absNorm D:ℝ)≤H) have hb (D : Ideal O) (hD : D∈S) (c : EisensteinEPrimaryPhase.Coord) : ‖annularRayGcdBlock M N K D c a‖ ≤ (C/6)*∑j : gcdRaySupport (fun I : idealRange N => I.val) a D c, ‖a j.val‖^2 := by have hd := Finset.mem_filter.mp hD have hadm := gcdPool_admissible (fun J : idealRange N => J.val) (fun J => (mem_idealRange.mp J.property).1) D hd.1 have hh := hsmall ε hε M N N K T hM hK hT a ha D hadm.1 (hd.2.trans hHN) c rw [poissonComparisonMajorant_energy_factor] at hh have hbound := mul_le_mul_of_nonneg_right (hcost D hd.1 hd.2) (show 0≤∑j : gcdRaySupport (fun I : idealRange N => I.val) a D c, ‖a j.val‖^2 by positivity) change _ ≤ C*(∑j : gcdRaySupport (fun I : idealRange N => I.val) a D c, ‖a j.val‖^2) at hbound have hn : ‖(6:ℂ)*annularRayGcdBlock M N K D c a‖=6*‖annularRayGcdBlock M N K D c a‖ := by rw [norm_mul] norm_num rw [hn] at hh change _≤_*(∑j : gcdRaySupport (fun I : idealRange N => I.val) a D c, ‖a j.val‖^2) at hh nlinarith have hs := gcdRaySupport_weighted_sum_bound ε hε S (fun J : idealRange N => J.val) (fun J => (mem_idealRange.mp J.property).1.1) a N (C/6) (by positivity) (fun J hJ => (mem_idealRange.mp J.property).2) (fun D c => ‖annularRayGcdBlock M N K D c a‖) hb have hNH : 1≤N/H := (le_div_iff₀ hH).mpr (by linarith) have hh := hhigh (2*M) (N/H) K (by linarith) hNH hK have hred := annularHighEnergy_gcd_reduction M N K H hN hH ε hε a apply hred.trans have hsupp := (supportConstant_pos ε hε).le have hdiv := (divisorConstant_pos ε hε).le calc _ ≤ 16*((C/6)*(divisorConstant ε hε*N^ε)*∑J,‖a J‖^2 + (CH*((2*M)*(N/H))^deltaLoss*(2*M+Real.sqrt ((2*M)/K)*(N/H)^α))* (supportConstant ε hε*divisorConstant ε hε)*(N^ε)^2*∑J,‖a J‖^2) := by gcongr _ = _ := by ring end section def cutoffRescaleCoefficient (C η r q : ℝ) : ℝ := C*r*q^2/(r/q)^η theorem cutoffRescaleCoefficient_eq (C η r q : ℝ) (hr : 0 exact ⟨1,le_rfl,by simp⟩ | cons x xs ih => obtain ⟨H,hH,hxs⟩ := ih refine ⟨max H x, hH.trans (le_max_left _ _), ?_⟩ intro y hy simp only [List.mem_cons] at hy rcases hy with rfl | hy · exact le_max_right _ _ · exact (hxs y hy).trans (le_max_left _ _) def poissonPrimitiveConstants (sD sS sT : Finset (ℕ×ℕ)) (CD CS CT CP : ℝ) {α : ℝ} (hexp : HasSieveExponent α) (η : ℝ) (hη : 0<η) (D : ℝ) (W : 𝓢(ℝ,ℂ)) : List ℝ := [divisorConstant η hη, 2+1/(η*Real.log 2), 256, supportConstant η hη, divisorExponentConstant hexp η hη, ‖paperRadialFourier (quadraticTransformedSquareProfile W) 0‖, ‖quadraticTransformedSquareProfile W 0‖, dualMiddleDecayConstant (quadraticTransformedSquareProfile W), ‖paperRadialFourier (quadraticSquareProfile W) 0‖, originalMiddleDecayConstant (quadraticSquareProfile W), nonzeroLatticeEnvelopeConstant, CD, CS, CT, CP, sD.sup (schwartzSeminormFamily ℝ ℝ ℂ) (quadraticTransformedSquareProfile W), sS.sup (schwartzSeminormFamily ℝ ℝ ℂ) (quadraticSquareProfile W), sT.sup (schwartzSeminormFamily ℝ ℝ ℂ) W, D^η] theorem poissonPrimitiveConstants_nonneg (sD sS sT : Finset (ℕ×ℕ)) (CD CS CT CP : ℝ) (hCD : 0≤CD) (hCS : 0≤CS) (hCT : 0≤CT) (hCP : 0≤CP) {α : ℝ} (hexp : HasSieveExponent α) (η : ℝ) (hη : 0<η) (D : ℝ) (hD : 0≤D) (W : 𝓢(ℝ,ℂ)) : ∀x∈poissonPrimitiveConstants sD sS sT CD CS CT CP hexp η hη D W, 0≤x := by intro x hx simp only [poissonPrimitiveConstants,List.mem_cons,List.not_mem_nil,or_false] at hx rcases hx with rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl|rfl · exact (divisorConstant_pos η hη).le · have : 0 (1:ℂ)) W ≤ Cfinal*(M*X)^(259*η)*poissonShape M X α := by let D := 2*C1+B have hD : 1≤D := by dsimp [D]; linarith only [hC1,hB] obtain ⟨H,hH,hconst⟩ := list_exists_positive_bound (poissonPrimitiveConstants sD sS sT CD CS CT CP hexp η hη D W) let Cshape := poissonShapeConstant B C1 have hC10 : 0≤C1 := le_trans zero_le_one hC1 have hCs : 1≤Cshape := by dsimp [Cshape,poissonShapeConstant] nlinarith only [hC10,pow_nonneg hC10 3,sq_nonneg B] have hCsC : C1≤Cshape := by dsimp [Cshape,poissonShapeConstant] nlinarith only [pow_nonneg hC10 3,sq_nonneg B] have hCsB : B^2≤Cshape := by dsimp [Cshape,poissonShapeConstant] nlinarith only [hC10,pow_nonneg hC10 3] have hCsMid : 1+4*C1^3≤Cshape := by dsimp [Cshape,poissonShapeConstant] nlinarith only [hC10,sq_nonneg B] refine ⟨262144*H^64*Cshape,by positivity,?_⟩ intro C M X q G hC hBC hCC hM hX hq hqX hG hGN hK have hM0 : 0 g i j) := (continuous_apply j).comp ((continuous_apply i).comp continuous_complexSL_coe) apply Continuous.inv₀ · exact ((he 1 0).norm.pow 2).add ((he 1 1).norm.pow 2) · intro g exact (rowEnergy_pos _ (complexBottomRow_ne_zero g)).ne' lemma matrixCross_eq_gram (g : SL(2,ℂ)) : matrixCross g=matrixGram g 0 1 := by simp only [matrixCross,matrixGram,Matrix.mul_apply,Fin.sum_univ_two,Matrix.star_apply] lemma hyperbolicGram_upperPoint (z : ℂ) (v : ℝ) (hv : 0 upperPoint p.1.1 p.1.2 p.2) := by intro p apply Subtype.ext exact Prod.ext (hyperbolicHorizontal_upperPoint _ _ _) (hyperbolicHeight_upperPoint _ _ _) lemma upperCoordinates_right_inverse : Function.RightInverse hyperbolicCoordinates (fun p : UpperCoordinates => upperPoint p.1.1 p.1.2 p.2) := by intro w obtain ⟨z,v,hv,rfl⟩ := upperPoint_surjective w exact congrArg (fun p : UpperCoordinates => upperPoint p.1.1 p.1.2 p.2) (upperCoordinates_left_inverse ⟨(z,v),hv⟩) def upperCoordinatesHomeomorph : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology UpperCoordinates ≃ₜ HyperbolicSpace := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology { toFun p := upperPoint p.1.1 p.1.2 p.2 invFun := hyperbolicCoordinates left_inv := upperCoordinates_left_inverse right_inv := upperCoordinates_right_inverse continuous_toFun := continuous_upperCoordinates continuous_invFun := hyperbolicCoordinates_continuous } lemma fundamentalSet_measure_le_cover : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (H : Subgroup (SL(2,ActualEisensteinCubic.O))) (hH : H≤CubicKubota.levelThree) (B : Set HyperbolicSpace) (hB : letI := integralSubgroupHyperbolicAction H ∀w,∃M:H,M • w∈B), hyperbolicVolume (hyperbolicFundamentalSet H)≤hyperbolicVolume B := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (H : Subgroup (SL(2,ActualEisensteinCubic.O))) (hH : H≤CubicKubota.levelThree) (B : Set HyperbolicSpace) (hB : letI := integralSubgroupHyperbolicAction H ∀w,∃M:H,M • w∈B) => by let := integralSubgroupHyperbolicAction H let := integralSLCountable let := integralSubgroupMeasurableAction H let := integralSubgroupVolumeInvariant H rw [(hyperbolicFundamentalSet_isFundamentalDomain H hH).measure_eq_tsum B] apply le_trans (measure_mono ?_) (measure_iUnion_le _) intro w hw obtain ⟨M,hM⟩ := hB w apply Set.mem_iUnion.mpr refine ⟨M⁻¹,?_,hw⟩ exact ⟨M • w,hM,inv_smul_smul M w⟩ open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix Pointwise ENNReal def spatialHeightSplit : EuclideanSpatial ≃ᵐ ℝ × (Fin 2 → ℝ) := (MeasurableEquiv.toLp 2 (Fin 3 → ℝ)).symm.trans (MeasurableEquiv.piFinSuccAbove (fun _ : Fin 3 => ℝ) 2) lemma spatialHeightSplit_preserves_volume : MeasurePreserving spatialHeightSplit volume volume := (volume_preserving_piFinSuccAbove (fun _ : Fin 3 => ℝ) 2).comp (EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp (Fin 3)) def horizontalUnitBox : Set (Fin 2 → ℝ) := Set.pi Set.univ (fun _ => Set.Icc (-1) 1) lemma horizontalUnitBox_measurable : MeasurableSet horizontalUnitBox := MeasurableSet.pi (Set.to_countable _) (fun _ _ => measurableSet_Icc) lemma horizontalUnitBox_volume : volume horizontalUnitBox=4 := by rw [horizontalUnitBox,volume_pi_pi] norm_num def euclideanCuspBox (a : ℝ) : Set EuclideanSpatial := spatialHeightSplit ⁻¹' (Set.Ioi a ×ˢ horizontalUnitBox) lemma euclideanCuspBox_measurable (a : ℝ) : MeasurableSet (euclideanCuspBox a) := spatialHeightSplit.measurable (measurableSet_Ioi.prod horizontalUnitBox_measurable) lemma euclideanCuspBox_positive (a : ℝ) (ha : 0≤a) : euclideanCuspBox a ⊆ euclideanUpperHalf := by intro p hp exact ha.trans_lt hp.1 theorem euclideanCuspBox_volume (a : ℝ) (ha : 0 ENNReal.ofReal ((q.1^3)⁻¹)) (measurableSet_Ioi.prod horizontalUnitBox_measurable) (by fun_prop)] change (∫⁻q : ℝ × (Fin 2 → ℝ) in Set.Ioi a ×ˢ horizontalUnitBox, ENNReal.ofReal ((q.1^3)⁻¹) ∂((volume : Measure ℝ).prod volume))=_ rw [setLIntegral_prod _ (by fun_prop)] simp only [lintegral_const,Measure.restrict_apply MeasurableSet.univ,Set.univ_inter, horizontalUnitBox_volume] rw [lintegral_mul_const _ (by fun_prop),cusp_height_volume a ha] exact mul_comm _ _ theorem fullSLMeasurableAction : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology MeasurableConstSMul (SL(2,ℂ)) HyperbolicSpace := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ⟨fun g => (continuous_hyperbolic_action g).measurable⟩ theorem fullSLVolumeInvariant : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology SMulInvariantMeasure (SL(2,ℂ)) HyperbolicSpace hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology { measure_preimage_smul g s hs := by have he := congrArg (fun ν : Measure HyperbolicSpace => ν s) (hyperbolicVolume_invariant g) simpa only [Measure.map_apply (continuous_hyperbolic_action g).measurable hs] using he } def hyperbolicCuspBox (a : ℝ) : Set HyperbolicSpace := {w | ‖hyperbolicHorizontal w‖≤1 ∧ a (isClosed_le hyperbolicHorizontal_continuous.norm continuous_const).measurableSet.inter (isOpen_lt continuous_const hyperbolicHeight_continuous).measurableSet lemma hyperbolicCuspBox_volume_le : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a : ℝ) (ha : 0 by rw [hyperbolicVolume,Measure.map_apply euclideanToHyperbolic_measurable (hyperbolicCuspBox_measurable a),←euclideanCuspBox_volume a ha] apply measure_mono_ae filter_upwards [hyperbolicEuclideanVolume_ae_positive] with p hp hB change euclideanToHyperbolic p ∈ hyperbolicCuspBox a at hB rw [euclideanToHyperbolic_positive p hp] at hB change ‖hyperbolicHorizontal (upperPoint _ _ hp)‖≤1 ∧ a (hyperbolicCuspBox_volume_le a ha).trans_lt (ENNReal.mul_lt_top (by norm_num) ENNReal.ofReal_lt_top) theorem hyperbolicFundamentalSet_volume_lt_top : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (hH : H≤CubicKubota.levelThree) [H.FiniteIndex], hyperbolicVolume (hyperbolicFundamentalSet H)<⊤ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (hH : H≤CubicKubota.levelThree) [H.FiniteIndex] => letI := @OAI.CubicEisenstein.fullSLVolumeInvariant by let := integralSubgroupHyperbolicAction H obtain ⟨S,hS⟩ := finiteIndex_ford_cover H let a : ℝ := Real.sqrt (2/3)/2 have ha : 0 integralComplexMatrix r⁻¹ • hyperbolicCuspBox a)).trans_lt apply ENNReal.sum_lt_top.mpr intro r hr rw [measure_smul] exact hyperbolicCuspBox_volume_lt_top a ha lemma integralQuotientVolume_univ : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))), integralQuotientVolume H Set.univ=hyperbolicVolume (hyperbolicFundamentalSet H) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) => by rw [integralQuotientVolume,Measure.map_apply (measurable_integralOrbitProjection H) MeasurableSet.univ] simp theorem integralQuotientVolume_finite : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (hH : H≤CubicKubota.levelThree) [H.FiniteIndex], IsFiniteMeasure (integralQuotientVolume H) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (H : Subgroup (SL(2,_root_.OAI.ActualEisensteinCubic.O))) (hH : H≤CubicKubota.levelThree) [H.FiniteIndex] => ⟨by rw [integralQuotientVolume_univ]; exact hyperbolicFundamentalSet_volume_lt_top H hH⟩ theorem kernelQuotientVolume_finite : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace IsFiniteMeasure (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by let : globalKubotaKernel.FiniteIndex := globalKubotaKernel_finiteIndex exact integralQuotientVolume_finite globalKubotaKernel globalKubotaKernel_le_levelThree end CubicEisenstein namespace CanonicalQuadraticSieve section theorem improved_threshold_ge_column (α N M : ℝ) (hα : 1≤α) (hN : 1≤N) (hM : N^(2-1/α)≤M) : N≤M := by have hp : 1≤2-1/α := by have hh : 1/α≤1 := (div_le_one (by linarith : 0<α)).mpr hα linarith calc N = N^(1:ℝ) := (Real.rpow_one N).symm _ ≤ N^(2-1/α) := Real.rpow_le_rpow_of_exponent_le hN hp _ ≤ M := hM theorem improved_threshold_power (α N M : ℝ) (hα : 0<α) (hN : 0 linarith · let R := max M (N^β) have hNβsq : N^β≤N^2 := by simpa only [Real.rpow_two] using Real.rpow_le_rpow_of_exponent_le hN hβ2 have hR : 1≤R := hM.trans (le_max_left _ _) have hRM : M≤R := le_max_left _ _ have hRN : N^β≤R := le_max_right _ _ have hRsq : R≤N^2 := max_le (le_of_not_ge hlarge) hNβsq have hb := hbound R N hR hN hRN hRsq have hmono := sieveNorm_mono hRM (le_refl N) have hN2 : 1≤N^2 := one_le_pow₀ hN have hM3 : M≤M^3 := by simpa only [pow_one] using pow_le_pow_right₀ hM (show (1:ℕ)≤3 by decide) have hRN2 : R≤M*N^2 := by apply max_le · nlinarith · exact hNβsq.trans (by nlinarith) have hprod : R*N≤(M*N)^3 := by calc _ ≤ (M*N^2)*N := mul_le_mul_of_nonneg_right hRN2 hN0.le _ = M*N^3 := by ring _ ≤ M^3*N^3 := mul_le_mul_of_nonneg_right hM3 (by positivity) _ = _ := by ring have hRprod : (R*N)^(ε/3)≤(M*N)^ε := by calc _ ≤ ((M*N)^3)^(ε/3) := Real.rpow_le_rpow (by positivity) hprod hρ.le _ = _ := by rw [←Real.rpow_natCast (M*N) 3,←Real.rpow_mul (by positivity : 0≤M*N)] congr 1 ring have hRadd : R≤M+N^β := max_le (by linarith) (by linarith) exact hmono.trans (hb.trans (by gcongr ; linarith)) open ActualEisensteinCubic CompletedGauss theorem hasSieveExponent_of_shell_threshold (β : ℝ) (hβ1 : 1≤β) (hβ2 : β≤2) (hshell : ∀ρ : ℝ, 0<ρ → ∃C : ℝ, 0 coefficientAtScale N ((2:ℝ)^j.val) (dyadicColumnCoefficient N (columnDyadicLength N) (columnDyadicLength_cover N) j a) have hpart := ballQuadraticEnergy_column_shells_at_scale M N (columnDyadicLength N) (columnDyadicLength_cover N) a have hj (j : Fin (columnDyadicLength N+1)) : ballQuadraticEnergy M ((2:ℝ)^j.val) (a' j) ≤ (4*C*8^(ε/2)*(M*N)^(ε/2)*M)*∑J,‖a' j J‖^2 := by let X := (2:ℝ)^j.val have hx := columnDyadicScale_bounds N hN j have hβ0 : 0≤β := by linarith have hXpow : X^β≤4*M := by calc _ ≤ (2*N)^β := Real.rpow_le_rpow (by positivity) hx.2 hβ0 _ = 2^β*N^β := Real.mul_rpow (by norm_num) hN0.le _ ≤ 4*N^β := by have ht : (2:ℝ)^β≤4 := by have ht := Real.rpow_le_rpow_of_exponent_le (by norm_num : (1:ℝ)≤2) hβ2 norm_num at ht exact ht exact mul_le_mul_of_nonneg_right ht (Real.rpow_nonneg hN0.le _) _ ≤ 4*M := by linarith have hshell' : CoefficientOnShell X X (a' j) := coefficientAtScale_shell N X _ (dyadicColumnCoefficient_shell N _ _ j a) have hb := hbound (4*M) X (by linarith) hx.1 hXpow (a' j) hshell' have hp : ((4*M)*X)^(ε/2)≤8^(ε/2)*(M*N)^(ε/2) := by calc _ ≤ (8*(M*N))^(ε/2) := Real.rpow_le_rpow (by positivity) (by nlinarith [hx.2]) hρ.le _ = _ := Real.mul_rpow (by norm_num) hprod.le apply (ballQuadraticEnergy_mono (by linarith : M≤4*M) (a' j)).trans apply hb.trans calc _ ≤ C*(8^(ε/2)*(M*N)^(ε/2))*(4*M)*∑J,‖a' j J‖^2 := by gcongr _ = _ := by ring have he : (∑j : Fin (columnDyadicLength N+1), ∑J,‖a' j J‖^2)=∑J,‖a J‖^2 := dyadicColumnCoefficient_at_scale_energy N _ _ a have hlen : (columnDyadicLength N+1:ℝ)≤lengthScale*(M*N)^(ε/2) := by apply (columnDyadicLength_small_power (ε/2) hρ N hN).trans change lengthScale*N^(ε/2)≤lengthScale*(M*N)^(ε/2) gcongr nlinarith change ballQuadraticEnergy M N a≤_ apply hpart.trans calc _ ≤ (columnDyadicLength N+1:ℝ)* ∑j : Fin (columnDyadicLength N+1), (4*C*8^(ε/2)*(M*N)^(ε/2)*M)*∑J,‖a' j J‖^2 := by gcongr with j exact hj j _ = (columnDyadicLength N+1:ℝ)*(4*C*8^(ε/2)*(M*N)^(ε/2)*M)*(∑J,‖a J‖^2) := by rw [←Finset.mul_sum,he] ring _ ≤ (lengthScale*(M*N)^(ε/2))*(4*C*8^(ε/2)*(M*N)^(ε/2)*M)*(∑J,‖a J‖^2) := by gcongr _ = _ := by have hp : (M*N)^(ε/2)*(M*N)^(ε/2)=(M*N)^ε := by rw [←Real.rpow_add hprod] congr 1 ring calc _ = (4*C*8^(ε/2)*lengthScale)*((M*N)^(ε/2)*(M*N)^(ε/2))*M*(∑J,‖a J‖^2) := by ring _ = _ := by rw [hp] end open ActualEisensteinCubic IdealCoprimeSieveOperator DivisorBlockCauchy def fixedBadNorm : ℝ := Ideal.absNorm (∏P∈fixedBadPrimes,P) def fixedCutoffBase : ℝ := max 4 fixedBadNorm theorem fixedBadNorm_one_le : 1≤fixedBadNorm := by have h1 : Admissible (1 : Ideal O) := by refine ⟨one_ne_zero, isUnit_one.squarefree, ?_⟩ intro P hP simp only [UniqueFactorizationMonoid.normalizedFactors_one, Multiset.notMem_zero] at hP have he := commonMaskIdeal_eq_fixed_mul (1 : Ideal O) h1 rw [mul_one] at he have hn : (∏P∈fixedBadPrimes,P)≠0 := by rw [←he] exact (commonMaskIdeal_squarefree 1).ne_zero unfold fixedBadNorm exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun h => hn (Ideal.absNorm_eq_zero_iff.mp h)) theorem fixedCutoffBase_bounds : 4≤fixedCutoffBase ∧ fixedBadNorm≤fixedCutoffBase := ⟨le_max_left _ _,le_max_right _ _⟩ theorem HasSieveExponent.annular_selected_bound {α : ℝ} (hexp : HasSieveExponent α) (hα1 : 1≤α) (hα2 : α≤2) (η : ℝ) (hη : 0<η) (hη1 : η≤1) (l A : ℕ) (hl : 4≤η*l) (hA : 4≤η*A) (C1 : ℝ) (hC1 : 1≤C1) : ∃ C : ℝ, 0 J.val), (Ideal.absNorm D:ℝ)≤largeGcdThreshold α N → poissonComparisonMajorant sD sS sT CD CS CT CP l A hexp η hη η hη (commonMaskIdeal D) (selectedPoissonK c M N η) (N/(Ideal.absNorm D:ℝ)) M (selectedPoissonT c M N η) (fun _ : Unit => (1:ℂ)) QuadraticInitialBound.annularSieveCutoff ≤ 3*CF*(M*N)^(259*η)*M := by intro D hD hd have hadm := gcdPool_admissible (fun J : idealRange N => J.val) (fun J => (mem_idealRange.mp J.property).1) D hD have hd1 : 1≤(Ideal.absNorm D:ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => hadm.1 (Ideal.absNorm_eq_zero_iff.mp hz)) have hgn : (Ideal.absNorm (commonMaskIdeal D):ℝ)=fixedBadNorm*(Ideal.absNorm D:ℝ) := by rw [commonMaskIdeal_norm D hadm, Nat.cast_mul] rfl have hb := hscalar c M N (Ideal.absNorm D:ℝ) (commonMaskIdeal D) hc4 hcB hc1 hM hN1 hd1 (by linarith [hH.2]) (commonMaskIdeal_squarefree D).ne_zero hgn hK apply hb.trans have hs : poissonShape M N α≤3*M := improved_threshold_shape α N M hα1 hN1 hthreshold calc _ ≤ CF*(M*N)^(259*η)*(3*M) := mul_le_mul_of_nonneg_left hs (by positivity) _ = _ := by ring have he := henergy η hη M N (selectedPoissonK c M N η) (selectedPoissonT c M N η) (largeGcdThreshold α N) (3*CF*(M*N)^(259*η)*M) hM hN1 hK hT (by linarith [hH.1]) hH.2 (by positivity) hcost a ha have hhigh := chosen_large_gcd_full α η CH M N (selectedPoissonK c M N η) hα1 hα2 hη.le hCH.le hM0 hN (by linarith) hcut have hn : N^η≤(M*N)^η := Real.rpow_le_rpow hN0.le (by nlinarith) hη.le have hcombine1 : (M*N)^(259*η)*(M*N)^η=(M*N)^(260*η) := by rw [←Real.rpow_add hP0] congr 1 ring have hcombine2 : (M*N)^η*((M*N)^η)^2=(M*N)^(3*η) := by rw [pow_two,←mul_assoc,←Real.rpow_add hP0,←Real.rpow_add hP0] congr 1 ring have hpow : (M*N)^(3*η)≤(M*N)^(260*η) := Real.rpow_le_rpow_of_exponent_le hP (by linarith) have hfirst : (3*CF*(M*N)^(259*η)*M/6)*(divisorConstant η hη*N^η) ≤ (3*CF*divisorConstant η hη)*(M*N)^(260*η)*M := by calc _ ≤ (3*CF*(M*N)^(259*η)*M)*(divisorConstant η hη*(M*N)^η) := by gcongr nlinarith [show 0≤3*CF*(M*N)^(259*η)*M by positivity] _ = _ := by rw [←hcombine1]; ring have hsecond : (CH*((2*M)*(N/largeGcdThreshold α N))^η* (2*M+Real.sqrt ((2*M)/selectedPoissonK c M N η)*(N/largeGcdThreshold α N)^α))* SD*(N^η)^2 ≤ (4*CH*2^η*SD)*(M*N)^(260*η)*M := by calc _ ≤ ((4*CH*2^η)*(M*N)^η*M)*SD*((M*N)^η)^2 := by gcongr _ = (4*CH*2^η*SD)*(M*N)^(3*η)*M := by rw [←hcombine2]; ring _ ≤ _ := by gcongr apply he.trans change 16*(_+_*SD*(N^η)^2)*_≤_ calc _ ≤ 16*((3*CF*divisorConstant η hη)*(M*N)^(260*η)*M+ (4*CH*2^η*SD)*(M*N)^(260*η)*M)*∑J,‖a J‖^2 := by exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (add_le_add hfirst hsecond) (by norm_num)) (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) _ = _ := by dsimp [F]; ring end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.LogarithmicLoss namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve theorem lifting_annular_scale_bounds (j : Fin 7) : 1≤(2:ℝ)^j.val ∧ (2:ℝ)^j.val≤64 := by refine ⟨one_le_pow₀ (by norm_num),?_⟩ have hj : j.val≤6 := by omega have hh := pow_le_pow_right₀ (by norm_num : (1:ℝ)≤2) hj norm_num at hh exact hh theorem HasSieveExponent.lifted_annular_selected {α : ℝ} (hexp : HasSieveExponent α) (hα1 : 1≤α) (hα2 : α≤2) (η : ℝ) (hη : 0<η) (hη1 : η≤1) (l A : ℕ) (hl : 4≤η*l) (hA : 4≤η*A) : ∃ C : ℝ, 0 (ha J hJ).2), ←coefficientAtScale_energy N (N/q) a (fun J hJ => (ha J hJ).2)] at hh have hp : ((r*M)*(N/q))^(260*η)≤64^(260*η)*(M*N)^(260*η) := by calc _ ≤ (64*(M*N))^(260*η) := by apply Real.rpow_le_rpow (by positivity) _ (by positivity) calc (r*M)*(N/q) ≤ (64*M)*N := by gcongr; exact hr.2 _ = _ := by ring _ = _ := Real.mul_rpow (by norm_num) (by positivity) change annularHighEnergy (r*M) N _ a≤_ apply hh.trans calc _ ≤ C*(64^(260*η)*(M*N)^(260*η))*(64*M)*∑J,‖a J‖^2 := by gcongr exact hr.2 _ = _ := by ring theorem HasSieveExponent.ball_selected_high {α : ℝ} (hexp : HasSieveExponent α) (hα1 : 1≤α) (hα2 : α≤2) (η : ℝ) (hη : 0<η) (hη1 : η≤1) (l A : ℕ) (hl : 4≤η*l) (hA : 4≤η*A) : ∃ C : ℝ, 0 hf j) have hsd := Finset.sum_le_sum (fun j (_ : j∈(Finset.univ : Finset (Fin 7))) => hd j) simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,Nat.cast_ofNat] at hsf hsd have he := liftingCoefficient_energy N a have hb := ballQuadraticEnergy_lifted_annuli M N (selectedPoissonK fixedCutoffBase M N η) (by linarith) a calc _ ≤ sieveNorm (selectedPoissonK fixedCutoffBase M N η) N*(∑J,‖a J‖^2)+ 2*(7*(C*(M*N)^(260*η)*M*∑J,‖liftingFreeCoefficient N a J‖^2)+ 7*(C*(M*N)^(260*η)*M*∑J,‖liftingDividedCoefficient N a J‖^2)) := by linarith _ = _ := by calc _ = sieveNorm (selectedPoissonK fixedCutoffBase M N η) N*(∑J,‖a J‖^2)+ (14*C)*(M*N)^(260*η)*M*((∑J,‖liftingFreeCoefficient N a J‖^2)+ (∑J,‖liftingDividedCoefficient N a J‖^2)) := by ring _ = _ := by rw [he]; ring theorem HasSieveExponent.low_threshold {α : ℝ} (hexp : HasSieveExponent α) (hα : 1≤α) (hα2 : α≤2) (η : ℝ) (hη : 0<η) (hη1 : η≤1) (c : ℝ) (hc : 4≤c) : ∃ C : ℝ, 0 dsimp [globalNormCaps] all_goals constructor all_goals first | positivity | exact hL.trans hpow2 | exact hB2 | exact hLB | exact hrow theorem normLogBin_le_log_upper (x Y : ℝ) (hx : 0 h.improve hα.le hα2) theorem sieveNorm_sharp : ∀ ε : ℝ, 0<ε → ∃ C : ℝ, 0 Z^θ≤globalBinRadial ell (globalPooledRowScale K ell B F j) j), (globalBinLossScale B j)^η/ (1+globalBinRadial ell (globalPooledRowScale K ell B F j) j)^N) ≤ C*U^(ε+8*η)/Z^(θ*N) := by obtain ⟨C,hC,hall⟩ := globalLogBox_total_loss ε hε η hη refine ⟨C,hC,?_⟩ intro K ell B F M H U Z θ N hU hK hell hB hF hH hKU hellU hBU hHU heU hZ let box := globalLogBox (globalNormCaps ell B (globalRowScaleFloor K ell B F M) M H) let radial := fun j => globalBinRadial ell (globalPooledRowScale K ell B F j) j have hbase : 0 Z^θ≤radial j), (globalBinLossScale B j)^η/Z^(θ*N) := by apply Finset.sum_le_sum intro j hj exact div_le_div_of_nonneg_left (hnum j) hden (hp j (Finset.mem_filter.mp hj).2) _ = (∑j∈box.filter (fun j => Z^θ≤radial j),(globalBinLossScale B j)^η)/Z^(θ*N) := (Finset.sum_div _ _ _).symm _ ≤ (∑j∈box,(globalBinLossScale B j)^η)/Z^(θ*N) := by apply div_le_div_of_nonneg_right _ hden.le exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) (fun j _ _ => hnum j) _ ≤ C*U^(ε+8*η)/Z^(θ*N) := div_le_div_of_nonneg_right (hall K ell B F M H U hU hK hell hB hF hH hKU hellU hBU hHU heU) hden.le end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CompactProfiles namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix Pointwise ENNReal lemma cosetHeight_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (r : CuspCosets), Continuous (cosetHeight r) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (r : CuspCosets) => by induction r using Quotient.inductionOn with | _ M => have heq : cosetHeight (cosetOf M)=(fun w => hyperbolicHeight (complexMatrix M • w)) := funext (cosetHeight_cosetOf M) change Continuous (cosetHeight (cosetOf M)) rw [heq] exact hyperbolicHeight_continuous.comp (continuous_hyperbolic_action _) lemma cuspCutoffCorrection_measurable : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (Y : ℝ) (F : ℝ → ℂ) (hF : Measurable F), Measurable (cuspCutoffCorrection Y F) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (Y : ℝ) (F : ℝ → ℂ) (hF : Measurable F) => by let := integralSLCountable unfold cuspCutoffCorrection apply Measurable.tsum intro r apply Measurable.ite · exact (isOpen_lt continuous_const (cosetHeight_continuous r)).measurableSet · exact measurable_const.mul (hF.comp (cosetHeight_continuous r).measurable) · exact measurable_const lemma cuspCutoffCorrection_norm_le (F : ℝ → ℂ) (C : ℝ) (hC : 0≤C) (hF : ∀v,‖F v‖≤C) (w : HyperbolicSpace) : ‖cuspCutoffCorrection 1 F w‖≤C := by by_cases hh : ∃r : CuspCosets,1 cuspCutoffTerm 1 F r w)=(fun _ : CuspCosets => (0:ℂ)) := by funext r simp [cuspCutoffTerm,show ¬1 hh ⟨r,h⟩] rw [hz,tsum_zero] rw [hz,norm_zero] exact hC lemma smoothCuspSeedDefect_measurable : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (s : ℂ) (ha : 0 cuspCutoffCorrection_measurable 1 _ (cuspSeedDefectProfile_continuous a b s ha hab).measurable lemma smoothCuspSeedDefect_bounded (a b : ℝ) (s : ℂ) (ha : 0 ?_⟩ exact cuspCutoffCorrection_norm_le _ _ (le_max_right _ _) (fun v => (hC v).trans (le_max_left _ _)) w lemma kernelQuotientDefect_measurable : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (s : ℂ) (ha : 0 measurable_from_quotient.mpr (smoothCuspSeedDefect_measurable a b s ha hab) theorem kernelQuotientDefect_memLp : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite ∀ (a b : ℝ) (s : ℂ) (ha : 0 by obtain ⟨C,hC,hbound⟩ := smoothCuspSeedDefect_bounded a b s ha hab apply MemLp.of_bound (kernelQuotientDefect_measurable a b s ha hab).aestronglyMeasurable C apply Filter.Eventually.of_forall intro q induction q using Quotient.inductionOn with | _ w => exact hbound w def kernelL2Defect : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 (kernelQuotientDefect_memLp a b s ha hab).toLp (kernelQuotientDefect a b s) lemma kernelL2Defect_ae_eq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 MemLp.coeFn_toLp _ end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise ENNReal lemma cuspCutoffCorrection_add (F G : ℝ → ℂ) (w : HyperbolicSpace) : cuspCutoffCorrection 1 (F+G) w=cuspCutoffCorrection 1 F w+cuspCutoffCorrection 1 G w := by unfold cuspCutoffCorrection rw [←(cuspCutoffTerm_summable 1 le_rfl F w).tsum_add (cuspCutoffTerm_summable 1 le_rfl G w)] apply tsum_congr intro r simp only [cuspCutoffTerm,Pi.add_apply] split_ifs <;> simp [mul_add] lemma cuspCutoffCorrection_smul (c : ℂ) (F : ℝ → ℂ) (w : HyperbolicSpace) : cuspCutoffCorrection 1 (c • F) w=c • cuspCutoffCorrection 1 F w := by unfold cuspCutoffCorrection rw [smul_eq_mul,←tsum_mul_left] apply tsum_congr intro r simp only [cuspCutoffTerm,Pi.smul_apply,smul_eq_mul] split_ifs <;> ring def compactHeightProfile (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)) : ℝ → ℂ := (Set.Icc a b).indicator (fun v => F (Set.projIcc a b hab v)) lemma compactHeightProfile_measurable (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)) : Measurable (compactHeightProfile a b hab F) := (F.continuous.comp continuous_projIcc).measurable.indicator measurableSet_Icc lemma compactHeightProfile_norm_le (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)) (v : ℝ) : ‖compactHeightProfile a b hab F v‖≤‖F‖ := by unfold compactHeightProfile by_cases hv : v∈Set.Icc a b · rw [Set.indicator_of_mem hv] exact F.norm_coe_le_norm _ · rw [Set.indicator_of_notMem hv,norm_zero] exact norm_nonneg _ lemma compactHeightProfile_add (a b : ℝ) (hab : a≤b) (F G : C(Set.Icc a b,ℂ)) : compactHeightProfile a b hab (F+G)=compactHeightProfile a b hab F+compactHeightProfile a b hab G := by funext v simp [compactHeightProfile,Set.indicator_add] lemma compactHeightProfile_smul (a b : ℝ) (hab : a≤b) (c : ℂ) (F : C(Set.Icc a b,ℂ)) : compactHeightProfile a b hab (c • F)=c • compactHeightProfile a b hab F := by funext v by_cases hv : v∈Set.Icc a b <;> simp [compactHeightProfile,hv] def kernelCompactProfile (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)) : IntegralOrbitQuotient globalKubotaKernel → ℂ := Quotient.lift (cuspCutoffCorrection 1 (compactHeightProfile a b hab F)) (by rintro w u ⟨M,hM⟩ rw [←hM] obtain ⟨hM,hchar⟩ := (globalKubotaKernel_mem (M:SL(2,ActualEisensteinCubic.O))).mp M.property have he := cuspCutoffCorrection_automorphy 1 le_rfl (compactHeightProfile a b hab F) (⟨(M:SL(2,ActualEisensteinCubic.O)),hM⟩ : CubicKubota.levelThree) w rw [hchar,one_mul] at he exact he.symm) lemma kernelCompactProfile_measurable : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)), Measurable (kernelCompactProfile a b hab F) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)) => measurable_from_quotient.mpr (cuspCutoffCorrection_measurable 1 _ (compactHeightProfile_measurable a b hab F)) lemma kernelCompactProfile_norm_le (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)) (q : IntegralOrbitQuotient globalKubotaKernel) : ‖kernelCompactProfile a b hab F q‖≤‖F‖ := by induction q using Quotient.inductionOn with | _ w => exact cuspCutoffCorrection_norm_le _ _ (norm_nonneg F) (compactHeightProfile_norm_le a b hab F) w lemma kernelCompactProfile_memLp : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite ∀ (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)), MemLp (kernelCompactProfile a b hab F) 2 (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite fun (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)) => MemLp.of_bound (kernelCompactProfile_measurable a b hab F).aestronglyMeasurable ‖F‖ (Filter.Eventually.of_forall (kernelCompactProfile_norm_le a b hab F)) lemma kernelCompactProfile_add (a b : ℝ) (hab : a≤b) (F G : C(Set.Icc a b,ℂ)) : kernelCompactProfile a b hab (F+G)=kernelCompactProfile a b hab F+kernelCompactProfile a b hab G := by funext q induction q using Quotient.inductionOn with | _ w => change cuspCutoffCorrection 1 _ w=_ rw [compactHeightProfile_add,cuspCutoffCorrection_add] rfl lemma kernelCompactProfile_smul (a b : ℝ) (hab : a≤b) (c : ℂ) (F : C(Set.Icc a b,ℂ)) : kernelCompactProfile a b hab (c • F)=c • kernelCompactProfile a b hab F := by funext q induction q using Quotient.inductionOn with | _ w => change cuspCutoffCorrection 1 _ w=_ rw [compactHeightProfile_smul,cuspCutoffCorrection_smul] rfl def compactProfileL2Linear : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (hab : a≤b), C(Set.Icc a b,ℂ) →ₗ[ℂ] KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (a b : ℝ) (hab : a≤b) => { toFun F := (kernelCompactProfile_memLp a b hab F).toLp (kernelCompactProfile a b hab F) map_add' F G := by apply Lp.ext grw [MemLp.coeFn_toLp,Lp.coeFn_add,MemLp.coeFn_toLp,MemLp.coeFn_toLp] rw [kernelCompactProfile_add] map_smul' c F := by apply Lp.ext grw [MemLp.coeFn_toLp,Lp.coeFn_smul,MemLp.coeFn_toLp] rw [kernelCompactProfile_smul] exact Filter.Eventually.of_forall (fun _ => rfl) } lemma compactProfileL2Linear_bound : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite ∀ (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)), ‖compactProfileL2Linear a b hab F‖≤ (measureUnivNNReal (integralQuotientVolume globalKubotaKernel) : ℝ)^((2:ℝ)⁻¹)*‖F‖ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite fun (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)) => by apply Lp.norm_le_of_ae_bound (norm_nonneg F) filter_upwards [MemLp.coeFn_toLp (kernelCompactProfile_memLp a b hab F)] with q hq change ‖((kernelCompactProfile_memLp a b hab F).toLp (kernelCompactProfile a b hab F)) q‖≤‖F‖ rw [hq] exact kernelCompactProfile_norm_le a b hab F q def compactProfileL2 : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (hab : a≤b), C(Set.Icc a b,ℂ) →L[ℂ] KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (a b : ℝ) (hab : a≤b) => (compactProfileL2Linear a b hab).mkContinuous ((measureUnivNNReal (integralQuotientVolume globalKubotaKernel) : ℝ)^((2:ℝ)⁻¹)) (compactProfileL2Linear_bound a b hab) lemma compactProfileL2_ae_eq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)), compactProfileL2 a b hab F =ᵐ[integralQuotientVolume globalKubotaKernel] kernelCompactProfile a b hab F := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (a b : ℝ) (hab : a≤b) (F : C(Set.Icc a b,ℂ)) => MemLp.coeFn_toLp (kernelCompactProfile_memLp a b hab F) def compactLogProfile (a b : ℝ) (ha : 0 (Real.log (v:ℝ):ℂ),Complex.continuous_ofReal.comp (continuous_subtype_val.log (fun v => (ha.trans_le v.2.1).ne'))⟩ def compactDefectSecond (a b : ℝ) : C(Set.Icc a b,ℂ) where toFun v := (v:ℂ)^2*((deriv (deriv (cuspTransition a b)) (v:ℝ):ℝ):ℂ) continuous_toFun := by have hd := (contDiff_infty_iff_deriv.mp (cuspTransition_contDiff a b)).2 have hdd := (contDiff_infty_iff_deriv.mp hd).2 exact (Complex.continuous_ofReal.comp continuous_subtype_val).pow 2 |>.mul (Complex.continuous_ofReal.comp (hdd.continuous.comp continuous_subtype_val)) def compactDefectFirst (a b : ℝ) : C(Set.Icc a b,ℂ) where toFun v := (v:ℂ)*((deriv (cuspTransition a b) (v:ℝ):ℝ):ℂ) continuous_toFun := by have hd := (contDiff_infty_iff_deriv.mp (cuspTransition_contDiff a b)).2 exact (Complex.continuous_ofReal.comp continuous_subtype_val).mul (Complex.continuous_ofReal.comp (hd.continuous.comp continuous_subtype_val)) def compactDefectProfile (a b : ℝ) (ha : 0.sub (differentiable_const 1)).smul (differentiable_const (compactDefectFirst a b)))) lemma compactHeightProfile_actual_defect (a b : ℝ) (ha : 0 by apply Lp.ext grw [compactProfileL2_ae_eq,kernelL2Defect_ae_eq] apply Filter.Eventually.of_forall intro q induction q using Quotient.inductionOn with | _ w => change cuspCutoffCorrection 1 (compactHeightProfile a b hab.le (compactDefectProfile a b ha s)) w= cuspCutoffCorrection 1 (cuspSeedDefectProfile a b s) w rw [compactHeightProfile_actual_defect a b ha hab s] theorem kernelL2Defect_entire : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 by have heq : kernelL2Defect a b ha hab= fun s => compactProfileL2 a b hab.le (compactDefectProfile a b ha s) := funext (fun s => (compactProfileL2_actual_defect a b ha hab s).symm) rw [heq] exact (compactProfileL2 a b hab.le).differentiable.comp (compactDefectProfile_entire a b ha) end CubicEisenstein open scoped BigOperators Classical SchwartzMap ContDiff namespace SecondPassIntegration open ActualEisensteinCubic JointLogSeparation FirstPassCubeLabels SecondPassArithmetic theorem full_uniform_normalized_child_tests (g₁ g₂ W : 𝓢(ℝ, ℂ)) (A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hg₁ : ∀ s, g₁ s ≠ 0 → |s| ≤ A) (hg₂ : ∀ s, g₂ s ≠ 0 → |s| ≤ A) : ∃ (A₁ A₂ : 𝓢(ℝ, ℂ)) (windows : Fin 7 → ℝ → ℂ), (∀ j, HasCompactSupport (windows j)) ∧ (∀ j, ContDiff ℝ ∞ (windows j)) ∧ (∀ j s, windows j s ≠ 0 → |s| ≤ A+B+1) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}), ∀ (D E V₀ X X₀ K Y : ℝ), 0 < D → 0 < E → 0 < V₀ → 0 < X → 0 < X₀ → 0 < K → ∀ (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O), d ≠ 0 → e ≠ 0 → k ≠ 0 → |Real.log (primeProductNorm p V * X₀ / X)| ≤ B → |Real.log (elementNorm d / D)| ≤ B → |Real.log (elementNorm e / E)| ≤ B → |Real.log (primeProductNorm p V / V₀)| ≤ B → |Real.log (elementNorm (d*e*k) / K)| ≤ B → secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k (-k) (radialPairKernel p e k W g₁ g₂ X X Y) = (X : ℂ)⁻¹ * postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k) (d*e*(-k)) A₁ A₂ W windows (Real.log (primeProductNorm p V * X₀ / X)) (Real.log (elementNorm d / D)) (Real.log (elementNorm e / E)) (Real.log (primeProductNorm p V / V₀)) (Real.log (elementNorm (d*e*k) / K)) X₀ X₀ (Y*K/(D*E^2*V₀^2*X₀^2)) := by obtain ⟨U, hUc, hUs, hUone, hUsupp, hUzero⟩ := FourierBridge.exists_complex_smooth_cutoff A hA have hU₁ : ∀ s, g₁ s ≠ 0 → U s = 1 := fun s hs => hUone s (hg₁ s hs) have hU₂ : ∀ s, g₂ s ≠ 0 → U s = 1 := fun s hs => hUone s (hg₂ s hs) let A₁ := conjugateProfile (halfNormalizationCLM U g₁) let A₂ := halfNormalizationCLM U g₂ have hA₁ : ∀ s, A₁ s ≠ 0 → |s| ≤ A := by intro s hs apply halfNormalization_support_bound U hUc hUs g₁ A hg₁ s intro hz exact hs (by simp [A₁, conjugateProfile_apply, hz]) have hA₂ : ∀ s, A₂ s ≠ 0 → |s| ≤ A := halfNormalization_support_bound U hUc hUs g₂ A hg₂ obtain ⟨windows, hwc, hws, hwb, hwo, hwt⟩ := exists_fixed_sector_windows A B hA hB refine ⟨A₁, A₂, windows, hwc, hws, hwb, ?_⟩ intro ι _ p hp _ hcop hg D E V₀ X X₀ K Y hD hE hV₀ hX hX₀ hK F V Ψ₁ Ψ₂ m r c d e k hd he hk hz hud hue huv hkap apply secondChildKernelPair_eq_postCommon p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k hd he hk D E V₀ X X₀ K Y hD hE hV₀ hX hX₀ hK U hUc hUs g₁ g₂ W hU₁ hU₂ windows · exact hwo _ _ _ _ _ hz hud hue huv hkap · exact fun a ha => hwt A₁ _ hA₁ hz 5 a ha · exact fun a ha => hwt A₂ _ hA₂ hz 6 a ha theorem full_uniform_twisted_normalized_child_tests (g₁ g₂ W : 𝓢(ℝ, ℂ)) (A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hg₁ : ∀ s, g₁ s ≠ 0 → |s| ≤ A) (hg₂ : ∀ s, g₂ s ≠ 0 → |s| ≤ A) : ∃ (A₁ A₂ : 𝓢(ℝ, ℂ)) (windows : Fin 7 → ℝ → ℂ), (∀ j, HasCompactSupport (windows j)) ∧ (∀ j, ContDiff ℝ ∞ (windows j)) ∧ (∀ j s, windows j s ≠ 0 → |s| ≤ A+B+1) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}), ∀ (θ₁ θ₂ D E V₀ X X₀ K Y : ℝ), 0 < D → 0 < E → 0 < V₀ → 0 < X → 0 < X₀ → 0 < K → ∀ (F V : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m r c d e k : O), d ≠ 0 → e ≠ 0 → k ≠ 0 → |Real.log (primeProductNorm p V * X₀ / X)| ≤ B → |Real.log (elementNorm d / D)| ≤ B → |Real.log (elementNorm e / E)| ≤ B → |Real.log (primeProductNorm p V / V₀)| ≤ B → |Real.log (elementNorm (d*e*k) / K)| ≤ B → secondChildKernelPair p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k (-k) (radialPairKernel p e k W (frequencyTwist g₁ θ₁) (frequencyTwist g₂ θ₂) X X Y) = (X : ℂ)⁻¹ * postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ (m*r) (c*e*∏ i ∈ V, p i) (d*e*k) (d*e*(-k)) (frequencyTwist A₁ (-θ₁)) (frequencyTwist A₂ θ₂) W windows (Real.log (primeProductNorm p V * X₀ / X)) (Real.log (elementNorm d / D)) (Real.log (elementNorm e / E)) (Real.log (primeProductNorm p V / V₀)) (Real.log (elementNorm (d*e*k) / K)) X₀ X₀ (Y*K/(D*E^2*V₀^2*X₀^2)) := by obtain ⟨U, hUc, hUs, hUone, hUsupp, hUzero⟩ := FourierBridge.exists_complex_smooth_cutoff A hA have hU₁ : ∀ s, g₁ s ≠ 0 → U s = 1 := fun s hs => hUone s (hg₁ s hs) have hU₂ : ∀ s, g₂ s ≠ 0 → U s = 1 := fun s hs => hUone s (hg₂ s hs) let A₁ := conjugateProfile (halfNormalizationCLM U g₁) let A₂ := halfNormalizationCLM U g₂ have hA₁ : ∀ s, A₁ s ≠ 0 → |s| ≤ A := by intro s hs apply halfNormalization_support_bound U hUc hUs g₁ A hg₁ s intro hz exact hs (by simp [A₁, conjugateProfile_apply, hz]) have hA₂ : ∀ s, A₂ s ≠ 0 → |s| ≤ A := halfNormalization_support_bound U hUc hUs g₂ A hg₂ obtain ⟨windows, hwc, hws, hwb, hwo, hwt⟩ := exists_fixed_sector_windows A B hA hB refine ⟨A₁, A₂, windows, hwc, hws, hwb, ?_⟩ intro ι _ p hp _ hcop hg θ₁ θ₂ D E V₀ X X₀ K Y hD hE hV₀ hX hX₀ hK F V Ψ₁ Ψ₂ m r c d e k hd he hk hz hud hue huv hkap have htw₁ : ∀ s, frequencyTwist g₁ θ₁ s ≠ 0 → U s = 1 := by intro s hs apply hU₁ s intro hz exact hs (by simp [frequencyTwist_apply, hz]) have htw₂ : ∀ s, frequencyTwist g₂ θ₂ s ≠ 0 → U s = 1 := by intro s hs apply hU₂ s intro hz exact hs (by simp [frequencyTwist_apply, hz]) have hsupp₁ : ∀ s, frequencyTwist A₁ (-θ₁) s ≠ 0 → |s| ≤ A := by intro s hs apply hA₁ s intro hz exact hs (by simp [frequencyTwist_apply, hz]) have hsupp₂ : ∀ s, frequencyTwist A₂ θ₂ s ≠ 0 → |s| ≤ A := by intro s hs apply hA₂ s intro hz exact hs (by simp [frequencyTwist_apply, hz]) have hh := secondChildKernelPair_eq_postCommon p hp hcop hg F V Ψ₁ Ψ₂ m r c d e k hd he hk D E V₀ X X₀ K Y hD hE hV₀ hX hX₀ hK U hUc hUs (frequencyTwist g₁ θ₁) (frequencyTwist g₂ θ₂) W htw₁ htw₂ windows dsimp only at hh rw [normalized_conjugate_frequencyTwist U hUc hUs, halfNormalization_twist U hUc hUs] at hh exact hh (hwo _ _ _ _ _ hz hud hue huv hkap) (fun a ha => hwt (frequencyTwist A₁ (-θ₁)) _ hsupp₁ hz 5 a ha) (fun a ha => hwt (frequencyTwist A₂ θ₂) _ hsupp₂ hz 6 a ha) end SecondPassIntegration namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog b0Label) open JointLogSeparation (halfNormalizationCLM) open SecondPassFiber (newRow) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalSecondLiteralTerm (F : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (g₁ g₂ W : 𝓢(ℝ,ℂ)) (ell Y : ℝ) (side : Bool) (x : GlobalSecondData ι) : ℂ := let X := globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon let m' := m*b0Label p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit let c := secondBaseLabel p x.cube.support x.common x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit let d := primeSubsetGenerator (fun i => Ideal.span {p i}) x.firstDivisor (primeProductNorm p x.firstCommon : ℂ)⁻¹ * secondExpansionSource p hp hcop hg (globalSecondRawPool F x) Ψ m' c d ray {x.source} (fun A => normalizedColumn p (fun S => g₁ (columnLog p X S)) A) (fun A => normalizedColumn p (fun S => g₂ (columnLog p X S)) A) W Y include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] hp in theorem globalResidualScale_eq (ell : ℝ) (side : Bool) (x : GlobalSecondData ι) : secondExpansionScale p (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon) (primeSubsetGenerator (fun i => Ideal.span {p i}) (x.source.sourceCommon\x.source.divisor)) (expansionSupportData x.common x.firstDivisor x.source) = globalActualResidualScale p ell side x := by simp only [secondExpansionScale,expansionSupportData,primeSubsetGenerator_norm_eq_productNorm,globalActualResidualScale] ring end end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog b0Label) open JointLogSeparation (halfNormalizationCLM frequencyTwist frequencyTwist_apply halfNormalization_twist) open SecondPassFiber (newRow) theorem globalSecondLiteralTerm_twisted_profiles (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g₁ g₂ W : 𝓢(ℝ,ℂ)) (A : ℝ) (hA : 0 ≤ A) (hU₁ : ∀ t,g₁ t ≠ 0 → U t=1) (hU₂ : ∀ t,g₂ t ≠ 0 → U t=1) (hg₁ : ∀ t,g₁ t ≠ 0 → |t| ≤ A) (hg₂ : ∀ t,g₂ t ≠ 0 → |t| ≤ A) : ∃ (A₁ A₂ : 𝓢(ℝ,ℂ)) (windows : Fin 7 → ℝ → ℂ), (∀ i,HasCompactSupport (windows i)) ∧ (∀ i,ContDiff ℝ ∞ (windows i)) ∧ (∀ i t,windows i t ≠ 0 → |t| ≤ A+6+1) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hpr : ∀ i,lambda^2 ∣ p i-1) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (θ₁ θ₂ ell Y : ℝ) (side : Bool) (x : GlobalSecondData ι), 0 < ell → x.source.divisor ⊆ x.source.sourceCommon → x.source.frequency ≠ 0 → let j := globalScaleIndex p side x globalSecondLiteralTerm p hp hcop hg F Ψ m ray (frequencyTwist g₁ θ₁) (frequencyTwist g₂ θ₂) W ell Y side x = globalSecondOuterWeight p hp hcop hg Ψ m ray ell Y side x * postCommonSmoothPair p hp hcop hg (globalSecondRawPool F x) (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (globalSecondRawMask p m x) (globalSecondLabel p x) (newRow (globalSecondTuple p x)) (-newRow (globalSecondTuple p x)) (frequencyTwist A₁ (-θ₁)) (frequencyTwist A₂ θ₂) W windows (globalBinZ p ell side j x) (globalBinUd p j x) (globalBinUe p j x) (globalBinUv p j x) (globalBinKap p j x) (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) (globalBinRadial ell Y j) := by have h1 := SecondPassIntegration.halfNormalization_support_bound U hUc hUs g₁ A hg₁ have h2 := SecondPassIntegration.halfNormalization_support_bound U hUc hUs g₂ A hg₂ obtain ⟨A₁,A₂,windows,hwc,hws,hwb,hid⟩ := SecondPassIntegration.full_uniform_twisted_normalized_child_tests (halfNormalizationCLM U g₁) (halfNormalizationCLM U g₂) W A 6 hA (by norm_num) h1 h2 refine ⟨A₁,A₂,windows,hwc,hws,hwb,?_⟩ intro ι _ p hp _ hcop hg hinj hpr F Ψ m ray θ₁ θ₂ ell Y side x hell hE hk dsimp only let j := globalScaleIndex p side x let X := globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon let r := primeSubsetGenerator (fun i => Ideal.span {p i}) (x.source.sourceCommon\x.source.divisor) let c := secondBaseLabel p x.cube.support x.common x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit let d := primeSubsetGenerator (fun i => Ideal.span {p i}) x.firstDivisor let e := primeSubsetGenerator (fun i => Ideal.span {p i}) x.source.divisor let m' := m*b0Label p x.cube.support (fun i => x.cube.leftExponent i+x.cube.rightExponent i) x.cube.leftBit x.cube.rightBit have hX : 0 < X := div_pos (globalFirstColumnScale_pos p hp ell hell x side) (FirstPassCubeLabels.primeProductNorm_pos p hp _) have hr : Ideal.span {secondMaskQuotient p x.source.divisor x.source.sourceCommon hE}=Ideal.span {r} := by rw [secondMaskQuotient_span] exact (ConcretePrimeRowBridge.span_idealGenerator _).symm have htw₁ : ∀ t, frequencyTwist g₁ θ₁ t ≠ 0 → U t = 1 := by intro t ht apply hU₁ t intro hz exact ht (by simp [frequencyTwist_apply,hz]) have htw₂ : ∀ t, frequencyTwist g₂ θ₂ t ≠ 0 → U t = 1 := by intro t ht apply hU₂ t intro hz exact ht (by simp [frequencyTwist_apply,hz]) have hnorm := weighted_secondRayChild_normalized p hp hcop hg hinj hpr x.source.sourceCommon x.source.divisor hE (globalSecondRawPool F x) x.source.overlap Ψ Ψ m' c d x.source.frequency r ray hr X Y hX U hUc hUs (frequencyTwist g₁ θ₁) (frequencyTwist g₂ θ₂) W htw₁ htw₂ have hscale : X/(‖ConcreteTraceCRT.eisEmbedding e‖^2*‖ConcreteTraceCRT.eisEmbedding r‖^2)= globalActualResidualScale p ell side x := globalResidualScale_eq p ell side x dsimp only at hnorm rw [hscale,halfNormalization_twist U hUc hUs,halfNormalization_twist U hUc hUs] at hnorm have hcoords := globalPooled_log_coordinates p hp ell hell side x hk have hid' := hid p hp hcop hg θ₁ θ₂ (globalLogRep j 5) (globalLogRep j 6) (globalLogRep j 7) (globalActualResidualScale p ell side x) (globalPooledColumnScale ell j) (globalLogRep j 8) Y (globalLogRep_pos j 5) (globalLogRep_pos j 6) (globalLogRep_pos j 7) (globalActualResidualScale_pos p hp ell hell side x) (globalPooledColumnScale_pos ell hell j) (globalLogRep_pos j 8) (globalSecondRawPool F x) x.source.overlap (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) m' r c d e x.source.frequency (primeSubsetGenerator_ne_zero _ _) (primeSubsetGenerator_ne_zero _ _) hk hcoords.1 hcoords.2.1 hcoords.2.2.1 hcoords.2.2.2.1 hcoords.2.2.2.2 rw [hid'] at hnorm have hgoal := congrArg (fun z : ℂ => (primeProductNorm p x.firstCommon : ℂ)⁻¹ * ((Y : ℂ)*secondSourceCommonCoefficient p hg Ψ m' c d x.source.sourceCommon x.source.divisor) * z) hnorm have hrow : newRow (globalSecondTuple p x) = d*e*x.source.frequency := rfl have hlabel : globalSecondLabel p x = c*e*∏ i ∈ x.source.overlap,p i := rfl have hmask : globalSecondRawMask p m x = m'*r := rfl have hz : globalBinZ p ell side j x = Real.log (primeProductNorm p x.source.overlap*globalPooledColumnScale ell j / globalActualResidualScale p ell side x) := rfl have hud : globalBinUd p j x = Real.log (SecondPassIntegration.elementNorm d/globalLogRep j 5) := rfl have hue : globalBinUe p j x = Real.log (SecondPassIntegration.elementNorm e/globalLogRep j 6) := rfl have huv : globalBinUv p j x = Real.log (primeProductNorm p x.source.overlap/globalLogRep j 7) := rfl have hkap : globalBinKap p j x = Real.log (SecondPassIntegration.elementNorm (d*e*x.source.frequency)/globalLogRep j 8) := rfl change globalSecondLiteralTerm p hp hcop hg F Ψ m ray (frequencyTwist g₁ θ₁) (frequencyTwist g₂ θ₂) W ell Y side x = _ rw [hrow,hlabel,hmask,hz,hud,hue,huv,hkap] have hq := secondExpansionQuotient_of_subset p x.source hE simp only [globalSecondLiteralTerm,secondExpansionSource,Finset.sum_singleton,hq, globalSecondOuterWeight,secondNormalizedExpansionWeight, globalResidualScale_eq p ell side x,globalBinRadial,m',c,d,e,r,X,j,mul_neg,mul_assoc] at hgoal ⊢ exact hgoal end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.LiteralSources namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap ContDiff namespace SecondPassArithmetic open ActualEisensteinCubic open JointLogSeparation (frequencyTwist) open SecondPassIntegration (densityChildEnergy) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalSecondLiteralBinSource (γ : GlobalSecondData ι → ℂ) (s : Finset (GlobalSecondData ι)) (side : Bool) (j : GlobalLogIndex) (pool : Finset ι) (Ψ : O →* ℂ) (m : O) (g₁ g₂ W : 𝓢(ℝ,ℂ)) (ell Y : ℝ) : ℂ := letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype ∑ ray : SecondRayIndex,∑ x∈globalLogSector p s side j, γ x * globalSecondLiteralTerm p hp hcop hg pool Ψ m ray g₁ g₂ W ell Y side x omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem sum_globalArithmeticBin {M : Type*} [AddCommMonoid M] (s : Finset (GlobalSecondData ι)) (side : Bool) (j : GlobalLogIndex) (f : GlobalSecondData ι → M) : ∑ x∈globalLogSector p s side j,f x = ∑ q∈globalBinTriples p s side j,∑ x∈globalArithmeticBin p s side q j,f x := by have h := sum_globalSecondFixedTriple p (globalLogSector p s side j) f simpa only [globalBinTriples,globalLogSector,globalArithmeticBin,Finset.filter_filter,and_comm] using h end theorem globalSecondLiteralBinSource_transfer (ε : ℝ) (hε : 0 < ε) (g₁ g₂ W : 𝓢(ℝ,ℂ)) (M : ℝ) (hM : 0 ≤ M) (hg₁ : ∀ t,g₁ t ≠ 0 → |t| ≤ M) (hg₂ : ∀ t,g₂ t ≠ 0 → |t| ≤ M) (A J : ℕ) : ∃ (windows : Fin 7 → ℝ → ℂ) (C : ℝ),0 ≤ C ∧ (∀ i,HasCompactSupport (windows i)) ∧ (∀ i,ContDiff ℝ ∞ (windows i)) ∧ (∀ i t,windows i t ≠ 0 → |t| ≤ M+6+1) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i,lambda^2 ∣ p i-1) (θ₁ θ₂ K ell B F : ℝ) (s : Finset (GlobalSecondData ι)) (side : Bool) (j : GlobalLogIndex) (pool : Finset ι) (Ψ : O →* ℂ) (m : O) (γ : GlobalSecondData ι → ℂ) (Γ : ℝ), letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype 0 < K → 0 < ell → 0 < B → 0 < F → 0 ≤ Γ → (∀ x∈s,‖γ x‖ ≤ Γ) → (∀ a,‖Ψ a‖ ≤ 1) → (∀ x∈s,GlobalSecondAdmissible x) → (∀ x∈s,x.source.frequency ≠ 0) → globalBinFirstCoefficient K ell B F j * ‖globalSecondLiteralBinSource p hp hcop hg γ s side j pool Ψ m (frequencyTwist g₁ θ₁) (frequencyTwist g₂ θ₂) W ell (globalPooledRowScale K ell B F j)‖ ≤ ∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, globalDescentWeight (Γ*C) ε θ₁ θ₂ K ell B F A J j ray q * (densityChildEnergy p hp hcop hg pool (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fixedTripleMask m q) (globalArithmeticTargets p s side q j) (windows 5) (windows 6) (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) J / (globalPooledColumnScale ell j*globalPooledLabelScale j)) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype obtain ⟨U,hUc,hUs,hUone,hUsupp,hUzero⟩ := FourierBridge.exists_complex_smooth_cutoff M hM obtain ⟨A₁,A₂,windows,hwc,hws,hwb,hid⟩ := globalSecondLiteralTerm_twisted_profiles U hUc hUs g₁ g₂ W M hM (fun t ht => hUone t (hg₁ t ht)) (fun t ht => hUone t (hg₂ t ht)) hg₁ hg₂ obtain ⟨C,hC,htrans⟩ := weightedGlobalPositiveBin_transfer ε hε A₁ A₂ W windows (fun _ => M+6+1) (fun _ => by linarith) hwb hwc (fun i => (hws i).continuous) A J refine ⟨windows,C,hC,hwc,hws,hwb,?_⟩ intro ι _ p hp _ hcop hg hinj hc hpr θ₁ θ₂ K ell B F s side j pool Ψ m γ Γ hK hell hB hF hΓ hγ hΨ hs hk have heq : globalSecondLiteralBinSource p hp hcop hg γ s side j pool Ψ m (frequencyTwist g₁ θ₁) (frequencyTwist g₂ θ₂) W ell (globalPooledRowScale K ell B F j) = ∑ ray : SecondRayIndex,∑ q∈globalBinTriples p s side j, weightedGlobalArithmeticBinSource p hp hcop hg γ s side q j pool Ψ m ray (frequencyTwist A₁ (-θ₁)) (frequencyTwist A₂ θ₂) W windows ell (globalPooledRowScale K ell B F j) := by unfold globalSecondLiteralBinSource apply Finset.sum_congr rfl intro ray hray rw [sum_globalArithmeticBin p s side j] apply Finset.sum_congr rfl intro q hq unfold weightedGlobalArithmeticBinSource globalSecondRawSource apply Finset.sum_congr rfl intro x hx obtain ⟨hxs,hxq,hxj⟩ := Finset.mem_filter.mp hx have h := hid p hp hcop hg hinj hpr pool Ψ m ray θ₁ θ₂ ell (globalPooledRowScale K ell B F j) side x hell (hs x hxs).2.1 (hk x hxs) dsimp only at h rw [hxj] at h rw [h,mul_assoc] rw [heq] simpa only [globalDescentWeight,norm_neg] using htrans p hp hcop hg hinj hc (-θ₁) θ₂ K ell B F s side j pool Ψ m γ Γ hK hell hB hF hΓ hγ hΨ hs hk end SecondPassArithmetic namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix Pointwise lemma complex_norm_mul_add_sq (a b c d : ℂ) : ‖a*c+b*d‖^2≤(‖a‖^2+‖b‖^2)*(‖c‖^2+‖d‖^2) := by have ht : ‖a*c+b*d‖≤‖a‖*‖c‖+‖b‖*‖d‖ := by simpa only [norm_mul] using norm_add_le (a*c) (b*d) have hs := pow_le_pow_left₀ (norm_nonneg (a*c+b*d)) ht 2 nlinarith only [hs,sq_nonneg (‖a‖*‖d‖-‖b‖*‖c‖)] lemma matrixFrobenius_nonneg (g : SL(2,ℂ)) : 0≤ matrixFrobenius g := by unfold matrixFrobenius rowEnergy positivity lemma matrixFrobenius_mul_le (g h : SL(2,ℂ)) : matrixFrobenius (g*h)≤ matrixFrobenius g*matrixFrobenius h := by have hb (i j : Fin 2) := complex_norm_mul_add_sq (g i 0) (g i 1) (h 0 j) (h 1 j) simp only [matrixFrobenius,rowEnergy,complexMatrixRow,Matrix.SpecialLinearGroup.coe_mul, Matrix.mul_apply,Fin.sum_univ_two] nlinarith only [hb 0 0,hb 0 1,hb 1 0,hb 1 1] lemma matrixFrobenius_inv (g : SL(2,ℂ)) : matrixFrobenius g⁻¹=matrixFrobenius g := by rw [Matrix.SpecialLinearGroup.SL2_inv_expl] simp only [matrixFrobenius,rowEnergy,complexMatrixRow] change ‖g 1 1‖^2+‖-g 0 1‖^2+(‖-g 1 0‖^2+‖g 0 0‖^2)=_ simp only [norm_neg] ring lemma hyperbolicFrobenius_nonneg (w : HyperbolicSpace) : 0≤hyperbolicFrobenius w := by induction w using Quotient.inductionOn with | _ g => exact matrixFrobenius_nonneg g lemma matrixFrobenius_le_displacement (g : SL(2,ℂ)) (w : HyperbolicSpace) : matrixFrobenius g≤hyperbolicFrobenius (g • w)*hyperbolicFrobenius w := by induction w using Quotient.inductionOn with | _ h => change matrixFrobenius g≤ matrixFrobenius (g*h)*matrixFrobenius h have hb := matrixFrobenius_mul_le (g*h) h⁻¹ simpa only [mul_inv_cancel_right,matrixFrobenius_inv] using hb theorem integralSubgroupContinuousAction (H : Subgroup (SL(2,ActualEisensteinCubic.O))) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI := integralSubgroupHyperbolicAction H ContinuousConstSMul H HyperbolicSpace := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let := integralSubgroupHyperbolicAction H exact ⟨fun M => continuous_hyperbolic_action (integralComplexMatrix (M:SL(2,ActualEisensteinCubic.O)))⟩ theorem integralSubgroupProperlyDiscontinuous (H : Subgroup (SL(2,ActualEisensteinCubic.O))) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI := integralSubgroupHyperbolicAction H ProperlyDiscontinuousSMul H HyperbolicSpace := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let := integralSubgroupHyperbolicAction H refine ⟨?_⟩ intro source target hsource htarget obtain ⟨C,hC⟩ := hsource.exists_bound_of_continuousOn hyperbolicFrobenius_continuous.continuousOn obtain ⟨D,hD⟩ := htarget.exists_bound_of_continuousOn hyperbolicFrobenius_continuous.continuousOn have hfin : Set.Finite {M : H | matrixFrobenius (integralComplexMatrix (M:SL(2,ActualEisensteinCubic.O)))≤ max D 0*max C 0} := by have hf := Set.Finite.preimage (f := fun M : H => (M:SL(2,ActualEisensteinCubic.O))) Subtype.val_injective.injOn (integral_frobenius_sublevel_finite 1 (max D 0*max C 0)) simpa only [mul_one,Set.preimage_ofPred_eq] using hf apply hfin.subset rintro M ⟨u,⟨w,hw,rfl⟩,hu⟩ have hb := matrixFrobenius_le_displacement (integralComplexMatrix (M:SL(2,ActualEisensteinCubic.O))) w apply hb.trans apply mul_le_mul · exact ((le_abs_self _).trans (hD _ hu)).trans (le_max_left _ _) · exact ((le_abs_self _).trans (hC _ hw)).trans (le_max_left _ _) · exact hyperbolicFrobenius_nonneg _ · exact le_max_right _ _ end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise namespace CubicEisenstein section theorem upperCoordinatesLocallyCompact : LocallyCompactSpace UpperCoordinates := (isOpen_lt continuous_const continuous_snd : IsOpen {p : ℂ×ℝ | 0 Disjoint (M • S) (N • S)) := by let := integralSubgroupHyperbolicAction globalKubotaKernel let : IsCancelSMul globalKubotaKernel HyperbolicSpace := integralSubgroupFree globalKubotaKernel globalKubotaKernel_le_levelThree intro M N hMN apply Set.disjoint_left.mpr rintro _ ⟨w,hw,rfl⟩ ⟨u,hu,he⟩ have hwu : w=u := hS hw hu (by calc integralOrbitProjection globalKubotaKernel w= integralOrbitProjection globalKubotaKernel (M • w) := (integralOrbitProjection_eq _ M w).symm _=integralOrbitProjection globalKubotaKernel (N • u) := congrArg _ he.symm _=integralOrbitProjection globalKubotaKernel u := integralOrbitProjection_eq _ N u) subst u exact hMN (IsCancelSMul.right_cancel M N w he.symm) theorem kernelProjection_measure_image (S : letI thirdWitness2 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; Set HyperbolicSpace) (hS : letI thirdWitness2 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; MeasurableSet S) (hinj : Set.InjOn (integralOrbitProjection globalKubotaKernel) S) : letI thirdWitness2 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace integralQuotientVolume globalKubotaKernel (integralOrbitProjection globalKubotaKernel '' S)= hyperbolicVolume S := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicBorelSpace letI thirdWitness2 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace let := integralSubgroupHyperbolicAction globalKubotaKernel let := integralSLCountable let := integralSubgroupMeasurableAction globalKubotaKernel let := integralSubgroupVolumeInvariant globalKubotaKernel let : PolishSpace HyperbolicSpace := hyperbolicPolish let : T2Space (IntegralOrbitQuotient globalKubotaKernel) := integralOrbitQuotientT2 globalKubotaKernel let : BorelSpace (IntegralOrbitQuotient globalKubotaKernel) := kernelQuotientBorel have himg := hS.image_of_continuousOn_injOn (continuous_integralOrbitProjection globalKubotaKernel).continuousOn hinj rw [integralQuotientVolume,Measure.map_apply (measurable_integralOrbitProjection _) himg, Measure.restrict_apply ((measurable_integralOrbitProjection _) himg), integralOrbitProjection_preimage_image,Set.iUnion_inter] rw [measure_iUnion] · exact (globalKubotaKernel_isFundamentalDomain.measure_eq_tsum S).symm · intro M N hMN exact (kernelProjection_translates_disjoint S hinj hMN).mono Set.inter_subset_left Set.inter_subset_left · intro M exact (hS.const_smul M).inter (hyperbolicFundamentalSet_measurable _) theorem kernelProjection_measurePreserving_on (U : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; Set HyperbolicSpace) (hU : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; MeasurableSet U) (hinj : Set.InjOn (integralOrbitProjection globalKubotaKernel) U) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace MeasurePreserving (integralOrbitProjection globalKubotaKernel) (hyperbolicVolume.restrict U) ((integralQuotientVolume globalKubotaKernel).restrict (integralOrbitProjection globalKubotaKernel '' U)) := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace refine ⟨measurable_integralOrbitProjection _,?_⟩ apply Measure.ext intro B hB rw [Measure.map_apply (measurable_integralOrbitProjection _) hB, Measure.restrict_apply ((measurable_integralOrbitProjection _) hB),Measure.restrict_apply hB] have hset : B∩(integralOrbitProjection globalKubotaKernel '' U)= integralOrbitProjection globalKubotaKernel '' (integralOrbitProjection globalKubotaKernel ⁻¹' B∩U) := by ext q constructor · rintro ⟨hq,w,hw,rfl⟩ exact ⟨w,⟨hq,hw⟩,rfl⟩ · rintro ⟨w,⟨hw,hu⟩,rfl⟩ exact ⟨hw,⟨w,hu,rfl⟩⟩ rw [hset,kernelProjection_measure_image _ (((measurable_integralOrbitProjection _) hB).inter hU) (hinj.mono Set.inter_subset_right)] theorem kernelL2_continuous_compact_approx (f : KernelQuotientL2) (ε : ℝ≥0∞) (hε : ε≠0) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∃g : IntegralOrbitQuotient globalKubotaKernel → ℂ, HasCompactSupport g ∧ eLpNorm ((f : _ → ℂ)-g) 2 (integralQuotientVolume globalKubotaKernel)≤ε ∧ Continuous g ∧ MemLp g 2 (integralQuotientVolume globalKubotaKernel) := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI thirdWitness2 := @OAI.CubicEisenstein.kernelQuotientVolume_finite let : T2Space (IntegralOrbitQuotient globalKubotaKernel) := integralOrbitQuotientT2 globalKubotaKernel let : LocallyCompactSpace (IntegralOrbitQuotient globalKubotaKernel) := kernelQuotientLocallyCompact let : SecondCountableTopology (IntegralOrbitQuotient globalKubotaKernel) := kernelQuotientSecondCountable let : BorelSpace (IntegralOrbitQuotient globalKubotaKernel) := kernelQuotientBorel exact (Lp.memLp f).exists_hasCompactSupport_eLpNorm_sub_le (by norm_num) hε end CubicEisenstein open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog b0Label) structure GlobalFirstData (ι : Type*) where cube : CubeCoordinates ι firstCommon : Finset ι common : Finset ι firstDivisor : Finset ι namespace GlobalFirstData variable {ι : Type*} protected theorem ext {x y : GlobalFirstData ι} (cube : x.cube = y.cube) (firstCommon : x.firstCommon = y.firstCommon) (common : x.common = y.common) (firstDivisor : x.firstDivisor = y.firstDivisor) : x = y := by cases x cases y cases cube cases firstCommon cases common cases firstDivisor rfl def append (b : GlobalFirstData ι) (x : SecondExpansionData ι) : GlobalSecondData ι := ⟨b.cube,b.firstCommon,b.common,b.firstDivisor,x⟩ end GlobalFirstData namespace GlobalSecondData variable {ι : Type*} def first (x : GlobalSecondData ι) : GlobalFirstData ι := ⟨x.cube,x.firstCommon,x.common,x.firstDivisor⟩ theorem append_first (x : GlobalSecondData ι) : x.first.append x.source=x := by cases x; rfl end GlobalSecondData section variable {ι : Type*} [DecidableEq ι] def globalFirstRawPool (pool : Finset ι) (b : GlobalFirstData ι) : Finset ι := (pool\(b.cube.support∪b.common))\b.firstCommon def globalFirstExpansionPool (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) : Finset (GlobalSecondData ι) := s.biUnion (fun b => (secondExpansionPool (globalFirstRawPool pool b) (cutoff b)).image b.append) theorem mem_globalFirstExpansionPool (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (x : GlobalSecondData ι) : x∈globalFirstExpansionPool pool s cutoff ↔ x.first∈s ∧ x.source∈secondExpansionPool (globalFirstRawPool pool x.first) (cutoff x.first) := by simp only [globalFirstExpansionPool,Finset.mem_biUnion,Finset.mem_image] constructor · rintro ⟨b,hb,z,hz,rfl⟩ exact ⟨hb,hz⟩ · rintro ⟨hb,hx⟩ exact ⟨x.first,hb,x.source,hx,x.append_first⟩ theorem sum_globalFirstExpansionPool {M : Type*} [AddCommMonoid M] (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (f : GlobalSecondData ι → M) : ∑ x∈globalFirstExpansionPool pool s cutoff,f x = ∑ b∈s,∑ x∈secondExpansionPool (globalFirstRawPool pool b) (cutoff b),f (b.append x) := by unfold globalFirstExpansionPool rw [Finset.sum_biUnion] · apply Finset.sum_congr rfl intro b hb rw [Finset.sum_image] intro x hx y hy heq exact congrArg GlobalSecondData.source heq · intro b hb c hc hne apply Finset.disjoint_left.mpr intro x hx hy obtain ⟨u,hu,rfl⟩ := Finset.mem_image.mp hx obtain ⟨v,hv,heq⟩ := Finset.mem_image.mp hy exact hne (congrArg GlobalSecondData.first heq).symm end variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalFirstBlockColumnScale (ell : ℝ) (side : Bool) (b : GlobalFirstData ι) : ℝ := ell/(primeProductNorm p (b.cube.sideDivisor side)*primeProductNorm p b.common) def globalFirstBlockLabel (b : GlobalFirstData ι) : O := secondBaseLabel p b.cube.support b.common b.cube.leftExponent b.cube.rightExponent b.cube.leftBit b.cube.rightBit def globalFirstBlockBadLabel (b : GlobalFirstData ι) : O := b0Label p b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit def globalFirstBlockTest (g : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (b : GlobalFirstData ι) : Finset ι → ℂ := normalizedColumn p (fun A => g (columnLog p (globalFirstBlockColumnScale p ell side b/primeProductNorm p b.firstCommon) A)) def globalFirstTruncatedSource (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (Y : GlobalFirstData ι → ℝ) : ℂ := ∑ b∈s,w b*(primeProductNorm p b.firstCommon : ℂ)⁻¹* truncatedSecondSource p hp hg hinj (globalFirstRawPool pool b) Ψ (m*globalFirstBlockBadLabel p b) (globalFirstBlockLabel p b) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) (globalFirstBlockTest p g ell side b) W (Y b) (cutoff b) theorem globalFirstTruncatedSource_eq_literal (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (Y : GlobalFirstData ι → ℝ) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype globalFirstTruncatedSource p hp hg hinj pool s w cutoff Ψ m g W ell side Y = ∑ ray : SecondRayIndex,∑ x∈globalFirstExpansionPool pool s cutoff, w x.first*globalSecondLiteralTerm p hp hcop hg pool Ψ m ray g g W ell (Y x.first) side x := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype unfold globalFirstTruncatedSource simp_rw [truncatedSecondSource_eq_expansionPool p hp hcop hg hinj hc hpr] rw [Finset.sum_comm] simp_rw [sum_globalFirstExpansionPool] apply Finset.sum_congr rfl intro b hb simp_rw [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro ray hray unfold secondExpansionSource rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x hx simp only [globalSecondLiteralTerm,GlobalFirstData.append,GlobalSecondData.first, globalSecondRawPool,globalFirstRawPool,globalFirstBlockBadLabel,globalFirstBlockLabel, globalFirstBlockTest,globalFirstBlockColumnScale,globalFirstColumnScale, secondExpansionSource,Finset.sum_singleton,mul_assoc] end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog b0Label jLabel) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalFirstCoreRow (pool : Finset ι) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (χ : RayCharacter) (r : FirstCoreIndex) (t : ℝ) (b : GlobalFirstData ι) (z : O) : ℂ := firstCoreInputRow p hg (pool\(b.cube.support∪b.common)) b.firstCommon b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit side χ Ψ m (normalizedColumn p (fun A => g (columnLog p (globalFirstBlockColumnScale p ell side b) A))) V (columnLog p (globalFirstBlockColumnScale p ell side b)) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.common) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) r t z def globalFirstCoreCorrection (g V : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (t : ℝ) (b : GlobalFirstData ι) : ℝ := ‖firstCoreTest (normalizedColumn p (fun A => g (columnLog p (globalFirstBlockColumnScale p ell side b) A))) V (columnLog p (globalFirstBlockColumnScale p ell side b)) side t b.firstCommon ∅‖^2 def globalFirstSourceTail (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (Y : GlobalFirstData ι → ℝ) : ℂ := ∑ b∈s,w b*(primeProductNorm p b.firstCommon : ℂ)⁻¹* secondSourceTail p hp hg hinj (globalFirstRawPool pool b) Ψ (m*globalFirstBlockBadLabel p b) (globalFirstBlockLabel p b) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) (globalFirstBlockTest p g ell side b) W (Y b) (cutoff b) def globalFirstSourceZero (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (Y : GlobalFirstData ι → ℝ) : ℂ := ∑ b∈s,w b*(primeProductNorm p b.firstCommon : ℂ)⁻¹* truncatedSecondZero p hg (globalFirstRawPool pool b) Ψ (m*globalFirstBlockBadLabel p b) (globalFirstBlockLabel p b) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) (globalFirstBlockTest p g ell side b) W (Y b) (cutoff b) theorem globalFirstTruncatedSource_split (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (Y : GlobalFirstData ι → ℝ) : globalFirstTruncatedSource p hp hg hinj pool s w cutoff Ψ m g W ell side Y = globalFirstTruncatedSource p hp hg hinj pool s w (fun b G E => (cutoff b G E).erase 0) Ψ m g W ell side Y + globalFirstSourceZero p hg pool s w cutoff Ψ m g W ell side Y := by unfold globalFirstTruncatedSource globalFirstSourceZero rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro b hb rw [truncatedSecondSource_eq_nonzero_add_zero] exact mul_add _ _ _ theorem globalFirstCoreRows_smoothed (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (Ψ : O →* ℂ) (m : O) (g V W : 𝓢(ℝ,ℂ)) (ell : ℝ) (hell : 0 < ell) (side : Bool) (χ : RayCharacter) (r : FirstCoreIndex) (t : ℝ) (Y : GlobalFirstData ι → ℝ) (hY : ∀ b∈s,0 < Y b) : (∑ b∈s,w b*∑' z : O,W (‖eisEmbedding z‖^2/Y b)* (‖globalFirstCoreRow p hg pool Ψ m g V ell side χ r t b z‖^2 : ℝ)) = globalFirstTruncatedSource p hp hg hinj pool s w cutoff (firstCoreTwist side χ Ψ r) m (firstCoreModeProfile g V side t) W ell side Y + globalFirstSourceTail p hp hg hinj pool s w cutoff (firstCoreTwist side χ Ψ r) m (firstCoreModeProfile g V side t) W ell side Y := by unfold globalFirstTruncatedSource globalFirstSourceTail rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro b hb have hX : 0 < globalFirstBlockColumnScale p ell side b := div_pos hell (mul_pos (FirstPassCubeLabels.primeProductNorm_pos p hp _) (FirstPassCubeLabels.primeProductNorm_pos p hp _)) have he := firstCoreInputRow_smoothed_truncated p hp hg hinj hc (pool\(b.cube.support∪b.common)) b.firstCommon b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit side χ Ψ m g V W (globalFirstBlockColumnScale p ell side b) hX (Y b) (hY b hb) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.common) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) r t (cutoff b) dsimp only at he have he' := congrArg (fun z : ℂ => w b*z) he simpa only [globalFirstCoreRow,globalFirstRawPool,globalFirstBlockBadLabel,globalFirstBlockLabel, secondBaseLabel,globalFirstBlockTest,mul_add,mul_assoc,Complex.ofReal_inv] using he' theorem globalFirstCoreRows_finite_le_sources (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (hw : ∀ b∈s,0 ≤ w b) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ,ℂ)) (ell : ℝ) (hell : 0 < ell) (side : Bool) (χ : RayCharacter) (r : FirstCoreIndex) (t : ℝ) (Y : GlobalFirstData ι → ℝ) (hY : ∀ b∈s,0 < Y b) (T : GlobalFirstData ι → Finset O) (hT : ∀ b∈s,∀ z∈T b,(Ideal.absNorm (Ideal.span {z}) : ℝ) ≤ Y b) (hT0 : ∀ b∈s,∀ z∈T b,z ≠ 0) : (∑ b∈s,w b*((∑ z∈T b,‖globalFirstCoreRow p hg pool Ψ m g V ell side χ r t b z‖^2)+ globalFirstCoreCorrection p g V ell side t b)) ≤ ‖globalFirstTruncatedSource p hp hg hinj pool s (fun b => w b) (fun b G E => (cutoff b G E).erase 0) (firstCoreTwist side χ Ψ r) m (firstCoreModeProfile g V side t) rowMajorant ell side Y‖ + ‖globalFirstSourceZero p hg pool s (fun b => w b) cutoff (firstCoreTwist side χ Ψ r) m (firstCoreModeProfile g V side t) rowMajorant ell side Y‖ + ‖globalFirstSourceTail p hp hg hinj pool s (fun b => w b) cutoff (firstCoreTwist side χ Ψ r) m (firstCoreModeProfile g V side t) rowMajorant ell side Y‖ := by have henergy : (∑ b∈s,w b*((∑ z∈T b,‖globalFirstCoreRow p hg pool Ψ m g V ell side χ r t b z‖^2)+ globalFirstCoreCorrection p g V ell side t b)) ≤ (∑ b∈s,(w b : ℂ)*∑' z : O,rowMajorant (‖eisEmbedding z‖^2/Y b)* (‖globalFirstCoreRow p hg pool Ψ m g V ell side χ r t b z‖^2 : ℝ)).re := by rw [Complex.re_sum] apply Finset.sum_le_sum intro b hb have hh := firstCoreInputRow_finite_le_corrected_source p hg (pool\(b.cube.support∪b.common)) b.firstCommon b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit side χ Ψ m (normalizedColumn p (fun A => g (columnLog p (globalFirstBlockColumnScale p ell side b) A))) V (columnLog p (globalFirstBlockColumnScale p ell side b)) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.common) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) r t (T b) (Y b) (hY b hb) (hT b hb) (hT0 b hb) have hh' := mul_le_mul_of_nonneg_left (le_sub_iff_add_le.mp hh) (hw b hb) simpa only [globalFirstCoreRow,globalFirstCoreCorrection,Complex.mul_re,Complex.ofReal_re, Complex.ofReal_im,zero_mul,sub_zero] using hh' rw [globalFirstCoreRows_smoothed p hp hg hinj hc pool s (fun b => w b) cutoff Ψ m g V rowMajorant ell hell side χ r t Y hY, globalFirstTruncatedSource_split] at henergy exact henergy.trans ((Complex.re_le_norm _).trans ((norm_add_le _ _).trans (add_le_add (norm_add_le _ _) le_rfl))) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.PooledRows namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm primeProduct) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] def GlobalFirstAdmissible (b : GlobalFirstData ι) : Prop := b.cube.Admissible ∧ Disjoint b.common b.cube.support ∧ b.firstDivisor ⊆ b.common∪b.cube.support variable (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] def globalFirstIndex (side : Bool) (b : GlobalFirstData ι) : GlobalLogIndex := globalScaleIndex p side (b.append ⟨∅,∅,∅,1⟩) def globalFirstPooledRow (K ell B F : ℝ) (side : Bool) (b : GlobalFirstData ι) : ℝ := globalPooledRowScale K ell B F (globalFirstIndex p side b) def globalFirstCoefficient (K ell B F : ℝ) (side : Bool) (b : GlobalFirstData ι) : ℝ := globalBinFirstCoefficient K ell B F (globalFirstIndex p side b) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalPooledRowScale_first (K ell B F : ℝ) (side : Bool) (x : GlobalSecondData ι) : globalPooledRowScale K ell B F (globalScaleIndex p side x)= globalFirstPooledRow p K ell B F side x.first := by have hc (i : Fin 10) (hi : i=1 ∨ i=4 ∨ i=5 ∨ i=9) : globalLogRep (globalScaleIndex p side x) i=globalLogRep (globalFirstIndex p side x.first) i := by rcases hi with rfl|rfl|rfl|rfl <;> simp [globalLogRep,globalFirstIndex,globalScaleIndex,globalScaleVector,GlobalFirstData.append,GlobalSecondData.first,globalCubeJNorm,globalCubeActiveRoot] unfold globalFirstPooledRow globalPooledRowScale rw [hc 1 (by simp),hc 4 (by simp),hc 5 (by simp)] omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalBinFirstCoefficient_first (K ell B F : ℝ) (side : Bool) (x : GlobalSecondData ι) : globalBinFirstCoefficient K ell B F (globalScaleIndex p side x)= globalFirstCoefficient p K ell B F side x.first := by have hc (i : Fin 10) (hi : i=5 ∨ i=9) : globalLogRep (globalScaleIndex p side x) i=globalLogRep (globalFirstIndex p side x.first) i := by rcases hi with rfl|rfl <;> simp [globalLogRep,globalFirstIndex,globalScaleIndex,globalScaleVector,GlobalFirstData.append,GlobalSecondData.first,globalCubeJNorm,globalCubeActiveRoot] unfold globalFirstCoefficient globalBinFirstCoefficient rw [hc 5 (by simp),hc 9 (by simp)] def globalFirstConcreteCutoff (K ell B F M H : ℝ) (side : Bool) (b : GlobalFirstData ι) : Finset ι → Finset ι → Finset O := firstCoreSecondCutoff p b.firstCommon (globalFirstBlockColumnScale p ell side b) (globalFirstPooledRow p K ell B F side b) M H def globalFirstSupportedPool (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (ell M : ℝ) (side : Bool) : Finset (GlobalSecondData ι) := (globalFirstExpansionPool pool s cutoff).filter (fun x => SecondSourceSupport p (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon) M x.source) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalFirstSupportedPool_admissible (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (hs : ∀ b∈s,GlobalFirstAdmissible b) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (ell M : ℝ) (side : Bool) (x : GlobalSecondData ι) (hx : x∈globalFirstSupportedPool p pool s cutoff ell M side) : GlobalSecondAdmissible x := by have hm := (mem_globalFirstExpansionPool pool s cutoff x).mp (Finset.mem_filter.mp hx).1 have hb := hs x.first hm.1 have hE := ((mem_secondExpansionPool _ _ x.source).mp hm.2).2.1 exact ⟨hb.1,hE,hb.2.1,hb.2.2⟩ omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalFirstSupportedPool_frequency_ne_zero (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (ell M : ℝ) (side : Bool) (x : GlobalSecondData ι) (hx : x∈globalFirstSupportedPool p pool s (fun b G E => (cutoff b G E).erase 0) ell M side) : x.source.frequency ≠ 0 := by have hm := (mem_globalFirstExpansionPool pool s _ x).mp (Finset.mem_filter.mp hx).1 exact (Finset.mem_erase.mp ((mem_secondExpansionPool _ _ x.source).mp hm.2).2.2.2).1 include hp in theorem globalFirstSupportedPool_index_mem_box (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (hs : ∀ b∈s,GlobalFirstAdmissible b) (K ell B F M H : ℝ) (hK : 0 (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0) ell M side) : globalScaleIndex p side x ∈ globalLogBox (globalNormCaps ell B (globalRowScaleFloor K ell B F M) M H) := by have hm := (mem_globalFirstExpansionPool pool s _ x).mp (Finset.mem_filter.mp hx).1 have hk := (Finset.mem_erase.mp ((mem_secondExpansionPool _ _ x.source).mp hm.2).2.2.2) apply globalScaleIndex_mem_uniform_box p hp K ell B F M H hK hell hB hF hH side x (globalFirstSupportedPool_admissible p pool s hs _ ell M side x hx) (Finset.mem_filter.mp hx).2 (hb₁ x.first hm.1) (hb₂ x.first hm.1) hk.1 simpa only [globalFirstConcreteCutoff,globalPooledRowScale_first,globalFirstBlockColumnScale, globalFirstColumnScale,GlobalSecondData.first] using hk.2 end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm primeProduct) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) theorem globalSecondLiteralTerm_zero_of_not_support (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (g W : 𝓢(ℝ,ℂ)) (ell Y M : ℝ) (side : Bool) (x : GlobalSecondData ι) (hell : 0 Ideal.span {p i}) x.firstDivisor) ray g W (globalFirstColumnScale p ell x side/primeProductNorm p x.firstCommon) Y M hX hgM x.source hE hs unfold globalSecondLiteralTerm dsimp only simp only [globalFirstBlockBadLabel,globalFirstBlockLabel,GlobalSecondData.first] at hz rw [hz,mul_zero] theorem globalFirstTruncatedSource_eq_supported (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (cutoff : GlobalFirstData ι → Finset ι → Finset ι → Finset O) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (ell M : ℝ) (hell : 0 Ideal.span {p i})) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (hs : ∀ b∈s,GlobalFirstAdmissible b) (w : GlobalFirstData ι → ℂ) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (K ell B F M H : ℝ) (hK : 0 (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0 let source := globalFirstSupportedPool p pool s cutoff ell M side globalFirstTruncatedSource p hp hg hinj pool s (fun b => w b*globalFirstCoefficient p K ell B F side b) cutoff Ψ m g W ell side (globalFirstPooledRow p K ell B F side) = ∑ j∈globalLogBox (globalNormCaps ell B (globalRowScaleFloor K ell B F M) M H), (globalBinFirstCoefficient K ell B F j : ℂ)* globalSecondLiteralBinSource p hp hcop hg (fun x => w x.first) source side j pool Ψ m g g W ell (globalPooledRowScale K ell B F j) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype dsimp only rw [globalFirstTruncatedSource_eq_supported p hp hcop hg hinj hc hpr] · let cutoff := fun b G E => (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0 let source := globalFirstSupportedPool p pool s cutoff ell M side have hmap : ∀ x∈source,globalScaleIndex p side x∈globalLogBox (globalNormCaps ell B (globalRowScaleFloor K ell B F M) M H) := fun x hx => globalFirstSupportedPool_index_mem_box p hp pool s hs K ell B F M H hK hell hB hF hH side hb₁ hb₂ x hx change (∑ ray : SecondRayIndex,∑ x∈source, (w x.first*globalFirstCoefficient p K ell B F side x.first)* globalSecondLiteralTerm p hp hcop hg pool Ψ m ray g g W ell (globalFirstPooledRow p K ell B F side x.first) side x) = _ simp only [globalSecondLiteralBinSource,Finset.mul_sum] conv_rhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro ray hray have hsplit := Finset.sum_fiberwise_of_maps_to hmap (fun x => (w x.first*globalFirstCoefficient p K ell B F side x.first)* globalSecondLiteralTerm p hp hcop hg pool Ψ m ray g g W ell (globalFirstPooledRow p K ell B F side x.first) side x) rw [← hsplit] apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro x hx have hxj := (Finset.mem_filter.mp hx).2 have hy := globalPooledRowScale_first p K ell B F side x have hc' := globalBinFirstCoefficient_first p K ell B F side x rw [hxj] at hy hc' rw [← hy,← hc'] ring · exact hell · exact hgM end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct) open ConcreteTraceCRT (eisEmbedding) open SecondPassIntegration (densityChildEnergy) open JointLogSeparation (frequencyTwist) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalChildBudget (pool : Finset ι) (source : Finset (GlobalSecondData ι)) (Ψ : O →* ℂ) (m : O) (windows : Fin 7 → ℝ → ℂ) (C ε θ₁ θ₂ K ell B F M H : ℝ) (A J : ℕ) (side : Bool) : ℝ := letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype ∑ j∈globalLogBox (globalNormCaps ell B (globalRowScaleFloor K ell B F M) M H), ∑ ray : SecondRayIndex,∑ q∈globalBinTriples p source side j, globalDescentWeight C ε θ₁ θ₂ K ell B F A J j ray q * (densityChildEnergy p hp hcop hg pool (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fixedTripleMask m q) (globalArithmeticTargets p source side q j) (windows 5) (windows 6) (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) J / (globalPooledColumnScale ell j*globalPooledLabelScale j)) end theorem globalFirstTruncatedSource_actual_transfer (ε : ℝ) (hε : 0<ε) (g W : 𝓢(ℝ,ℂ)) (M : ℝ) (hM : 0≤M) (hgM : ∀ t,g t ≠ 0 → |t|≤M) (A J : ℕ) : ∃ (windows : Fin 7 → ℝ → ℂ) (C : ℝ),0≤C ∧ (∀ i,HasCompactSupport (windows i)) ∧ (∀ i,ContDiff ℝ ∞ (windows i)) ∧ (∀ i t,windows i t ≠ 0 → |t|≤M+6+1) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (Γ θ K ell B F H : ℝ) (side : Bool) (Ψ : O →* ℂ) (m : O), 0≤Γ → (∀ b∈s,‖w b‖≤Γ) → 0 (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0 let source := globalFirstSupportedPool p pool s cutoff ell M side ‖globalFirstTruncatedSource p hp hg hinj pool s (fun b => w b*globalFirstCoefficient p K ell B F side b) cutoff Ψ m (frequencyTwist g θ) W ell side (globalFirstPooledRow p K ell B F side)‖ ≤ globalChildBudget p hp hcop hg pool source Ψ m windows (Γ*C) ε θ θ K ell B F M H A J side := by obtain ⟨windows,C,hC,hwc,hws,hwb,htrans⟩ := globalSecondLiteralBinSource_transfer ε hε g g W M hM hgM hgM A J refine ⟨windows,C,hC,hwc,hws,hwb,?_⟩ intro ι _ p hp _ hcop hg hinj hc hpr pool s w Γ θ K ell B F H side Ψ m hΓ hw hK hell hB hF hH hs hΨ hb₁ hb₂ dsimp only let cutoff := fun b G E => (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0 let source := globalFirstSupportedPool p pool s cutoff ell M side have htw : ∀ t,frequencyTwist g θ t ≠ 0 → |t|≤M := by intro t ht apply hgM t intro hz exact ht (by simp [JointLogSeparation.frequencyTwist_apply,hz]) rw [globalFirstTruncatedSource_eq_bins p hp hcop hg hinj hc hpr pool s hs w Ψ m (frequencyTwist g θ) W K ell B F M H hK hell hB hF hH htw side hb₁ hb₂] apply (norm_sum_le _ _).trans unfold globalChildBudget apply Finset.sum_le_sum intro j hj rw [norm_mul,Complex.norm_real,Real.norm_of_nonneg (globalBinFirstCoefficient_nonneg K ell B F hK.le hell hB hF j)] apply htrans p hp hcop hg hinj hc hpr θ θ K ell B F source side j pool Ψ m (fun x => w x.first) Γ hK hell hB hF hΓ · intro x hx exact hw x.first ((mem_globalFirstExpansionPool pool s cutoff x).mp (Finset.mem_filter.mp hx).1).1 · exact hΨ · exact fun x hx => globalFirstSupportedPool_admissible p pool s hs cutoff ell M side x hx · exact fun x hx => globalFirstSupportedPool_frequency_ne_zero p pool s (globalFirstConcreteCutoff p K ell B F M H side) ell M side x hx end open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter) theorem globalFirstCoreRows_actual_transfer (ε : ℝ) (hε : 0<ε) (g V : 𝓢(ℝ,ℂ)) (M : ℝ) (hM : 0≤M) (hgM : ∀ t,g t ≠ 0 → |t|≤M) (side : Bool) (A J : ℕ) : ∃ (windows : Fin 7 → ℝ → ℂ) (C : ℝ),0≤C ∧ (∀ i,HasCompactSupport (windows i)) ∧ (∀ i,ContDiff ℝ ∞ (windows i)) ∧ (∀ i t,windows i t ≠ 0 → |t|≤M+6+1) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (Γ K ell B F H : ℝ) (Ψ : O →* ℂ) (m : O) (χ : RayCharacter) (r : FirstCoreIndex) (t : ℝ) (T : GlobalFirstData ι → Finset O), 0≤Γ → (∀ b∈s,0≤w b ∧ w b≤Γ) → 0 (cutoff b G E).erase 0) ell M side let weight := fun b => w b*globalFirstCoefficient p K ell B F side b let Ψmode := firstCoreTwist side χ Ψ r let profile := firstCoreModeProfile g V side t (∑ b∈s,weight b*((∑ z∈T b,‖globalFirstCoreRow p hg pool Ψ m g V ell side χ r t b z‖^2)+ globalFirstCoreCorrection p g V ell side t b)) ≤ globalChildBudget p hp hcop hg pool source Ψmode m windows (Γ*C) ε t t K ell B F M H A J side + ‖globalFirstSourceZero p hg pool s (fun b => weight b) cutoff Ψmode m profile rowMajorant ell side (globalFirstPooledRow p K ell B F side)‖ + ‖globalFirstSourceTail p hp hg hinj pool s (fun b => weight b) cutoff Ψmode m profile rowMajorant ell side (globalFirstPooledRow p K ell B F side)‖ := by have hbase : ∀ x,firstCoreBaseProfile g V side x≠0 → |x|≤M := by intro x hx apply hgM x intro hz exact hx (by rw [firstCoreBaseProfile_apply,hz,zero_mul]) obtain ⟨windows,C,hC,hwc,hws,hwb,htrans⟩ := globalFirstTruncatedSource_actual_transfer ε hε (firstCoreBaseProfile g V side) rowMajorant M hM hbase A J refine ⟨windows,C,hC,hwc,hws,hwb,?_⟩ intro ι _ p hp _ hcop hg hinj hc hpr pool s w Γ K ell B F H Ψ m χ r t T hΓ hw hK hell hB hF hH hs hΨ hb₁ hb₂ hT hT0 dsimp only let cutoff := globalFirstConcreteCutoff p K ell B F M H side let source := globalFirstSupportedPool p pool s (fun b G E => (cutoff b G E).erase 0) ell M side let weight := fun b => w b*globalFirstCoefficient p K ell B F side b let Ψmode := firstCoreTwist side χ Ψ r have hweight : ∀ b∈s,0≤weight b := by intro b hb exact mul_nonneg (hw b hb).1 (globalBinFirstCoefficient_nonneg K ell B F hK.le hell hB hF _) have hY : ∀ b∈s,0 (w b : ℂ)) Γ (firstCoreModeHeight side t) K ell B F H side Ψmode m hΓ (fun b hb => by rw [Complex.norm_real,Real.norm_of_nonneg (hw b hb).1]; exact (hw b hb).2) hK hell hB hF hH hs (fun a => (firstCoreTwist_norm_le side χ Ψ r a).trans (hΨ a)) hb₁ hb₂ have hfinite := globalFirstCoreRows_finite_le_sources p hp hg hinj hc pool s weight hweight cutoff Ψ m g V ell hell side χ r t (globalFirstPooledRow p K ell B F side) hY T hT hT0 have hheight : ‖firstCoreModeHeight side t‖=‖t‖ := by cases side <;> simp [firstCoreModeHeight] have hbudget : globalChildBudget p hp hcop hg pool source Ψmode m windows (Γ*C) ε (firstCoreModeHeight side t) (firstCoreModeHeight side t) K ell B F M H A J side = globalChildBudget p hp hcop hg pool source Ψmode m windows (Γ*C) ε t t K ell B F M H A J side := by simp only [globalChildBudget,globalDescentWeight,hheight] dsimp only at hsource change _ ≤ globalChildBudget p hp hcop hg pool source Ψmode m windows (Γ*C) ε (firstCoreModeHeight side t) (firstCoreModeHeight side t) K ell B F M H A J side at hsource rw [hbudget] at hsource apply hfinite.trans apply add_le_add · apply add_le_add · simpa only [weight,firstCoreModeProfile,Complex.ofReal_mul] using hsource · exact le_rfl · exact le_rfl end SecondPassArithmetic open scoped BigOperators Classical namespace InitialMeanSquare section open ActualEisensteinCubic ConcretePrimeRowBridge IdealMobiusDivisorSum abbrev O := ActualEisensteinCubic.O structure Datum where divisor : Ideal O shared : Ideal O frequency : O end end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.TransformedColumns namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace InitialMeanSquare open ActualEisensteinCubic SecondPassArithmetic open FirstCauchyArithmetic (supportMobius activeGaussRowFactor) open MixedCrossSeparation (columnCoefficient) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) def inputColumn (Ψ : O→*ℂ) (b d : O) (H : Finset ι→ℂ) (S : Finset ι) : ℂ := Ψ (∏i∈S,p i)*rowCoprimeMask (fun i => Ideal.span {p i}) S (b*d)*H S end InitialMeanSquare namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise ENNReal theorem fullSLContinuousAction : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ContinuousConstSMul (SL(2,ℂ)) HyperbolicSpace := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ⟨continuous_hyperbolic_action⟩ theorem hyperbolicVolume_fullSupport : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_fullSLVolumeInvariant := @OAI.CubicEisenstein.fullSLVolumeInvariant Measure.IsOpenPosMeasure hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_fullSLVolumeInvariant := @OAI.CubicEisenstein.fullSLVolumeInvariant letI := @OAI.CubicEisenstein.fullSLContinuousAction { open_pos U hU hne := by let : SecondCountableTopology HyperbolicSpace := hyperbolicSecondCountable obtain ⟨u,hu⟩ := hne have hcover : (Set.univ : Set HyperbolicSpace) ⊆ ⋃g:SL(2,ℂ),g • U := by intro w hw obtain ⟨g,hg⟩ := MulAction.exists_smul_eq (SL(2,ℂ)) u w exact Set.mem_iUnion.mpr ⟨g,u,hu,hg⟩ obtain ⟨seq,hseq⟩ := isLindelof_univ.indexed_countable_subcover (fun g : SL(2,ℂ) => g • U) (fun g => isOpenMap_smul g U hU) hcover intro hzero have hz : hyperbolicVolume (⋃n:ℕ,seq n • U)=0 := by apply measure_iUnion_null intro n rw [measure_smul,hzero] have htotal : hyperbolicVolume Set.univ=0 := measure_mono_null hseq hz exact hyperbolicVolume_ne_zero (Measure.measure_univ_eq_zero.mp htotal) } end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix Pointwise ENNReal open ConcreteTraceCRT lemma integral_upper_triangular_height (M : SL(2,_root_.OAI.ActualEisensteinCubic.O)) (hc : M 1 0=0) (z : ℂ) (v : ℝ) (hv : 0 Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) theorem globalChildBudget_height (pool : Finset ι) (source : Finset (GlobalSecondData ι)) (Ψ : O →* ℂ) (m : O) (windows : Fin 7 → ℝ → ℂ) (C ε t K ell B F M H : ℝ) (A J : ℕ) (side : Bool) : globalChildBudget p hp hcop hg pool source Ψ m windows C ε t t K ell B F M H A J side = ((1+‖t‖)^(J+2)*(1+‖t‖)^(J+2))* globalChildBudget p hp hcop hg pool source Ψ m windows C ε 0 0 K ell B F M H A J side := by simp only [globalChildBudget,Finset.mul_sum] apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro ray hray apply Finset.sum_congr rfl intro q hq simp only [globalDescentWeight,norm_zero,add_zero,one_pow,mul_one] ring def globalFirstFiniteEnergy (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (χ : RayFourExpansion.RayCharacter) (r : FirstCoreIndex) (T : GlobalFirstData ι → Finset O) (t : ℝ) : ℝ := ∑ b∈s,w b*∑ z∈T b,‖globalFirstCoreRow p hg pool Ψ m g V ell side χ r t b z‖^2 theorem globalFirstFiniteEnergy_integrable (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (χ : RayFourExpansion.RayCharacter) (r : FirstCoreIndex) (T : GlobalFirstData ι → Finset O) (J : ℕ) : Integrable (fun t => firstLogDensity J t*globalFirstFiniteEnergy p hg pool s w Ψ m g V ell side χ r T t) := by simp only [globalFirstFiniteEnergy,Finset.mul_sum] apply integrable_finsetSum intro b hb apply integrable_finsetSum intro z hz have hi := firstCoreInputRow_integrable p hg (pool\(b.cube.support∪b.common)) b.firstCommon b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit side χ Ψ m (FirstPassCubeLabels.normalizedColumn p (fun A => g (FirstPassCubeLabels.columnLog p (globalFirstBlockColumnScale p ell side b) A))) V (FirstPassCubeLabels.columnLog p (globalFirstBlockColumnScale p ell side b)) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.common) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) r z (FirstPassCubeLabels.firstLogDensity_integrable J) simpa only [globalFirstCoreRow,mul_left_comm] using hi.const_mul (w b) end SecondPassArithmetic open scoped BigOperators Classical namespace CanonicalQuadraticSieve open ActualEisensteinCubic theorem finite_inverse_norm_sum (S : Finset (Ideal O)) (H : ℝ) (hS : ∀ I∈S,I≠0) (hH : ∀I∈S,(Ideal.absNorm I:ℝ)≤H) : (∑I∈S,1/(Ideal.absNorm I:ℝ))≤256*(columnDyadicLength H+1:ℝ) := by have hpos (I : Ideal O) (hI : I∈S) : 1≤(Ideal.absNorm I:ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => hS I hI (Ideal.absNorm_eq_zero_iff.mp hz)) have hbin (j : Fin (columnDyadicLength H+1)) : (∑I∈divisorDyadicBin S H j,1/(Ideal.absNorm I:ℝ))≤256 := by have hp : 0<(2:ℝ)^j.val := by positivity have hone : 1≤(2:ℝ)^j.val := one_le_pow₀ (by norm_num) have hcount : ((divisorDyadicBin S H j).card:ℝ)≤128*(2:ℝ)^j.val := by apply DescentFiberCost.finite_ideal_count_real _ _ hone · intro I hI exact hS I (Finset.mem_filter.mp hI).1 · intro I hI obtain ⟨hIS,hj⟩ := Finset.mem_filter.mp hI have hb := (divisorDyadicLabel_bounds H I (hpos I hIS) (hH I hIS)).2 simpa only [hj] using hb have hterm (I : Ideal O) (hI : I∈divisorDyadicBin S H j) : 1/(Ideal.absNorm I:ℝ)≤2/(2:ℝ)^j.val := by obtain ⟨hIS,hj⟩ := Finset.mem_filter.mp hI have hb := (divisorDyadicLabel_bounds H I (hpos I hIS) (hH I hIS)).1 rw [hj] at hb apply (div_le_div_iff₀ (by linarith [hpos I hIS]) hp).mpr linarith calc _ ≤ ∑_I∈divisorDyadicBin S H j,2/(2:ℝ)^j.val := Finset.sum_le_sum hterm _ = ((divisorDyadicBin S H j).card:ℝ)*(2/(2:ℝ)^j.val) := by simp _ ≤ (128*(2:ℝ)^j.val)*(2/(2:ℝ)^j.val) := by gcongr _ = _ := by field_simp; ring rw [sum_divisorDyadicBins S H] calc _ ≤ ∑j : Fin (columnDyadicLength H+1),(256:ℝ) := Finset.sum_le_sum (fun j _ => hbin j) _ = _ := by simp; ring theorem ideal_reciprocal_cauchy (S : Finset (Ideal O)) (hS : ∀I∈S,I≠0) (v : Ideal O → ℂ) : ‖∑I∈S,v I‖^2≤(∑I∈S,1/(Ideal.absNorm I:ℝ))* (∑I∈S,(Ideal.absNorm I:ℝ)*‖v I‖^2) := by have hpos (I : Ideal O) (hI : I∈S) : 0<(Ideal.absNorm I:ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun hz => hS I hI (Ideal.absNorm_eq_zero_iff.mp hz)) apply (pow_le_pow_left₀ (norm_nonneg _) (norm_sum_le S v) 2).trans apply Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul S (fun I hI => by positivity) (fun I hI => by positivity) intro I hI exact le_of_eq (by field_simp [(hpos I hI).ne']) open ActualEisensteinCubic CompletedGauss QuadraticSquarefreeKernel def columnSquareFiber (S : Finset (Ideal O)) (A : Ideal O) : Finset (Ideal O) := S.filter (fun I => squarePart I=A) theorem columnSquareFiber_injective (S : Finset (Ideal O)) (A : Ideal O) : Function.Injective (fun I : columnSquareFiber S A => squarefreePart I.val) := by intro I J he change squarefreePart I.val=squarefreePart J.val at he apply Subtype.ext have hi := (Finset.mem_filter.mp I.property).2 have hj := (Finset.mem_filter.mp J.property).2 calc I.val = A^2*squarefreePart I.val := by simpa only [hi] using (squarePart_sq_mul_squarefreePart I.val).symm _ = A^2*squarefreePart J.val := by rw [he] _ = J.val := by simpa only [hj] using squarePart_sq_mul_squarefreePart J.val open ActualEisensteinCubic CompletedGauss QuadraticSquarefreeKernel end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.ProductColumns namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve open ActualEisensteinCubic CompletedGauss IdealMobiusDivisorSum def productColumnCoefficient (S T : Finset (Ideal O)) (β : Ideal O → Ideal O → ℂ) (I : Ideal O) : ℂ := ∑p∈(S×ˢT).filter (fun p => p.1*p.2=I),β p.1 p.2 theorem product_fiber_card (P : Finset (Ideal O×Ideal O)) (I : Ideal O) (hI : I≠0) : (P.filter (fun p => p.1*p.2=I)).card≤(idealDivisors I).card := by apply Finset.card_le_card_of_injOn Prod.fst · intro p hp apply (mem_idealDivisors hI).mpr rw [←(Finset.mem_filter.mp hp).2] exact dvd_mul_right _ _ · intro p hp q hq he have hp' := (Finset.mem_filter.mp hp).2 have hq' := (Finset.mem_filter.mp hq).2 have hz : p.1≠0 := by intro hz; simp only [hz,zero_mul] at hp'; exact hI hp'.symm apply Prod.ext he apply mul_left_cancel₀ hz rw [hp',he,hq'] theorem productColumnCoefficient_norm (S T : Finset (Ideal O)) (β : Ideal O → Ideal O → ℂ) (hβ : ∀n∈S,∀b∈T,‖β n b‖≤1) (I : Ideal O) (hI : I≠0) : ‖productColumnCoefficient S T β I‖≤(idealDivisors I).card := by unfold productColumnCoefficient apply (norm_sum_le _ _).trans calc _ ≤ ∑p∈(S×ˢT).filter (fun p => p.1*p.2=I),(1:ℝ) := by apply Finset.sum_le_sum intro p hp have hh := Finset.mem_product.mp (Finset.mem_filter.mp hp).1 exact hβ p.1 hh.1 p.2 hh.2 _ = ((S×ˢT).filter (fun p => p.1*p.2=I)).card := by simp _ ≤ _ := by exact_mod_cast product_fiber_card (S×ˢT) I hI theorem productColumnCoefficient_row_sum (S T : Finset (Ideal O)) (β : Ideal O → Ideal O → ℂ) (k : Ideal O) : (∑n∈S,∑b∈T,quadraticRow k (primaryGenerator (n*b))*β n b)= ∑I∈(S×ˢT).image (fun p => p.1*p.2),quadraticRow k (primaryGenerator I)*productColumnCoefficient S T β I := by rw [←Finset.sum_product (f := fun p : Ideal O×Ideal O => quadraticRow k (primaryGenerator (p.1*p.2))*β p.1 p.2)] rw [←Finset.sum_fiberwise_of_maps_to (fun p (hp : p∈S×ˢT) => Finset.mem_image_of_mem (fun p : Ideal O×Ideal O => p.1*p.2) hp)] apply Finset.sum_congr rfl intro I hI rw [productColumnCoefficient,Finset.mul_sum] apply Finset.sum_congr rfl intro p hp rw [(Finset.mem_filter.mp hp).2] end CanonicalQuadraticSieve namespace CompletedGauss section open ActualEisensteinCubic CanonicalQuadraticSieve ConcretePrimeRowBridge def shortCompletedSum (Ψ : O →* ℂ) (W : ℝ → ℂ) (X H₀ : ℝ) : ℂ := ∑' H : Ideal O, if (Ideal.absNorm H:ℝ) (Ideal.absNorm H:ℝ) hH (Ideal.absNorm_eq_zero_iff.mp hz)), Nat.cast_le.mp (hn.le.trans (Nat.le_ceil H₀))⟩,hn⟩ theorem shortCompletedSum_eq (Ψ : O →* ℂ) (W : ℝ → ℂ) (X H₀ : ℝ) : shortCompletedSum Ψ W X H₀ = ∑H∈shortCubeRange H₀, (UniqueFactorizationMonoid.moebius H:ℂ)*cubeWeight Ψ H* completedT Ψ W (X/(Ideal.absNorm H:ℝ)^3) := by unfold shortCompletedSum rw [tsum_eq_sum (s:=shortCubeRange H₀)] · exact Finset.sum_congr rfl (fun H hH => if_pos ((mem_shortCubeRange H₀ H).mp hH).2) · intro H hH by_cases hz : H=0 · simp [hz, cubeWeight_bot] · have hn : ¬(Ideal.absNorm H:ℝ) hH ((mem_shortCubeRange H₀ H).mpr ⟨hz,hn⟩) exact if_neg hn theorem cube_inverse_weight_norm (Ψ : O →* ℂ) (hΨ : ∀z,‖Ψ z‖≤1) (H : Ideal O) : ‖(UniqueFactorizationMonoid.moebius H:ℂ)*cubeWeight Ψ H‖≤1/(Ideal.absNorm H:ℝ) := by have hang : ‖FiniteGaussPhase.angularFactor (primaryGenerator H)‖≤1 := by by_cases hz : primaryGenerator H=0 · simp [hz,FiniteGaussPhase.angularFactor] · exact (FiniteGaussPhase.norm_angularFactor _ hz).le have hw : ‖cubeWeight Ψ H‖≤1/(Ideal.absNorm H:ℝ) := by change ‖star (FiniteGaussPhase.angularFactor (primaryGenerator H))^3*Ψ (primaryGenerator H)^3/(Ideal.absNorm H:ℂ)‖≤_ rw [norm_div,norm_mul,norm_pow,norm_pow,norm_star,Complex.norm_natCast] apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg _) have h1 : ‖FiniteGaussPhase.angularFactor (primaryGenerator H)‖^3≤1 := by simpa only [one_pow] using pow_le_pow_left₀ (norm_nonneg _) hang 3 have h2 : ‖Ψ (primaryGenerator H)‖^3≤1 := by simpa only [one_pow] using pow_le_pow_left₀ (norm_nonneg _) (hΨ _) 3 nlinarith [pow_nonneg (norm_nonneg (Ψ (primaryGenerator H))) 3] rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (QuadraticInitialBound.norm_ideal_moebius_le_one H)).trans hw theorem short_completed_energy {κ : Type*} [Fintype κ] (Ψ : κ → O →* ℂ) (hΨ : ∀k z,‖Ψ k z‖≤1) (W : ℝ → ℂ) (X H₀ A : ℝ) (hA : 0≤A) (hcompleted : ∀H∈shortCubeRange H₀, (∑k,‖completedT (Ψ k) W (X/(Ideal.absNorm H:ℝ)^3)‖^2)≤A) : (∑k,‖shortCompletedSum (Ψ k) W X H₀‖^2)≤ A*(256*(columnDyadicLength H₀+1:ℝ))^2 := by let S := shortCubeRange H₀ let lengthScale : ℝ := ∑H∈S,1/(Ideal.absNorm H:ℝ) have hS (H : Ideal O) (hH : H∈S) : H≠0 := ((mem_shortCubeRange H₀ H).mp hH).1 have hn (H : Ideal O) (hH : H∈S) : 0<(Ideal.absNorm H:ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun hz => hS H hH (Ideal.absNorm_eq_zero_iff.mp hz)) have hL : 0≤lengthScale := Finset.sum_nonneg (fun H hH => by positivity) have hb (k : κ) : ‖shortCompletedSum (Ψ k) W X H₀‖^2≤ lengthScale*∑H∈S,(1/(Ideal.absNorm H:ℝ))*‖completedT (Ψ k) W (X/(Ideal.absNorm H:ℝ)^3)‖^2 := by rw [shortCompletedSum_eq] apply (ideal_reciprocal_cauchy S hS _).trans apply mul_le_mul_of_nonneg_left _ hL apply Finset.sum_le_sum intro H hH rw [norm_mul] calc _ ≤ (Ideal.absNorm H:ℝ)*((1/(Ideal.absNorm H:ℝ))*‖completedT (Ψ k) W (X/(Ideal.absNorm H:ℝ)^3)‖)^2 := by gcongr exact cube_inverse_weight_norm (Ψ k) (hΨ k) H _ = _ := by field_simp [(hn H hH).ne'] have hsum : (∑k,‖shortCompletedSum (Ψ k) W X H₀‖^2)≤A*lengthScale^2 := by calc _ ≤ ∑k,lengthScale*∑H∈S,(1/(Ideal.absNorm H:ℝ))*‖completedT (Ψ k) W (X/(Ideal.absNorm H:ℝ)^3)‖^2 := Finset.sum_le_sum (fun k _ => hb k) _ = lengthScale*∑H∈S,(1/(Ideal.absNorm H:ℝ))*∑k,‖completedT (Ψ k) W (X/(Ideal.absNorm H:ℝ)^3)‖^2 := by rw [←Finset.mul_sum,Finset.sum_comm] congr 1 apply Finset.sum_congr rfl intro H hH rw [←Finset.mul_sum] _ ≤ lengthScale*∑H∈S,(1/(Ideal.absNorm H:ℝ))*A := by gcongr with H hH exact hcompleted H hH _ = A*lengthScale^2 := by rw [←Finset.sum_mul]; change lengthScale*(lengthScale*A)=A*lengthScale^2; ring have hbound : lengthScale≤256*(columnDyadicLength H₀+1:ℝ) := finite_inverse_norm_sum S H₀ hS (fun H hH => ((mem_shortCubeRange H₀ H).mp hH).2.le) exact hsum.trans (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hL hbound 2) hA) end open ActualEisensteinCubic CanonicalQuadraticSieve theorem short_cube_scale_algebra (z K R X F h : ℝ) (hz : 1≤z) (hK : 1≤K) (hR : 1≤R) (hF : 1≤F) (hFz : F≤z) (hh : 1≤h) (hhz : h≤z) (hmargin : K*R*z^25≤X*F) : 1≤X/h^3 ∧ K^2*R*F*h^3/X≤K := by have hz0 : 0 hs.1 (Ideal.absNorm_eq_zero_iff.mp hz)) have hsc := short_cube_scales Z K R X F (Ideal.absNorm H:ℝ) hZ hK hR hF hFZ hn hs.2.le hmargin apply (hcompleted H hH).trans nlinarith theorem short_completed_average {κ : Type*} [Fintype κ] (Z K R X F A : ℝ) (hZ : 1≤Z) (hK : 1≤K) (hR : 1≤R) (hF : 1≤F) (hFZ : F≤Z^(1/1000:ℝ)) (hA : 0≤A) (hmargin : K*R≤X*F*Z^(-(1/40:ℝ))) (Ψ : idealRange F → κ → O →* ℂ) (hΨ : ∀f k z,‖Ψ f k z‖≤1) (W : ℝ → ℂ) (hcompleted : ∀f : idealRange F, ∀H∈shortCubeRange (Z^(1/1000:ℝ)), (∑k,‖completedT (Ψ f k) W (X/(Ideal.absNorm H:ℝ)^3)‖^2)≤ A*(K+K^2*R*(Ideal.absNorm f.val:ℝ)*(Ideal.absNorm H:ℝ)^3/X)) : (∑f : idealRange F,∑k,‖shortCompletedSum (Ψ f k) W X (Z^(1/1000:ℝ))‖^2)/F≤ 256*A*K*(256*(columnDyadicLength (Z^(1/1000:ℝ))+1:ℝ))^2 := by have hZ0 : 0 hb f) _ = ((idealRange F).card:ℝ)*(2*A*K*B) := by simp _ ≤ _ := mul_le_mul_of_nonneg_right hc (by dsimp [B]; positivity) change _≤256*A*K*B calc _ ≤ ((128*F)*(2*A*K*B))/F := div_le_div_of_nonneg_right hsum (by linarith) _ = _ := by field_simp; ring theorem short_completed_normalized_small_power (ε : ℝ) (hε : 0<ε) : ∃ C : ℝ, 0 goodSquarefreePart (cols j.val) have hg : Function.Injective good := by intro i j hij apply Subtype.ext apply hinj exact goodSquarefreePart_injective_on_sector _ _ (hcols i.val).1 (hcols j.val).1 (i.property.trans j.property.symm) hij have hgood (j : sector E) : Admissible (good j) ∧ (Ideal.absNorm (good j):ℝ)≤X := mem_idealRange.mp (goodSquarefreePart_mem_idealRange _ (hcols j.val).1 X (hcols j.val).2) let B : Matrix (sector E) (idealRange K) ℂ := fun j k => quadraticRow k.val (primaryGenerator (good j)) have hB := family_squared_norm_le good (fun k : idealRange K => k.val) hg Subtype.val_injective X K hgood (fun k => mem_idealRange.mp k.property) change ‖FiniteSieveOperator.operator B‖^2≤ sieveNorm X K at hB have hBT : B.conjTranspose=(fun k j => quadraticRow k.val (primaryGenerator (good j))) := by ext k j exact canonical_quadraticRow_star _ (mem_idealRange.mp k.property).1 _ have he := FiniteSieveOperator.energy_bound B.conjTranspose (fun j : sector E => a j.val) rw [FiniteSieveOperator.operator_conjTranspose_norm,hBT] at he have hrow (k : idealRange K) : (∑j : sector E,quadraticRow k.val (primaryGenerator (cols j.val))*a j.val)= quadraticRow k.val (primaryGenerator (sectorBadIdeal E))* ∑j : sector E,quadraticRow k.val (primaryGenerator (good j))*a j.val := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ have hj := sector_bad_good_product (cols j.val) (hcols j.val).1 E j.property have hq : quadraticRow k.val (primaryGenerator (cols j.val))= quadraticRow k.val (primaryGenerator (sectorBadIdeal E))*quadraticRow k.val (primaryGenerator (good j)) := by conv_lhs => rw [←hj] rw [primaryGenerator_mul,canonical_quadraticRow_argument_mul _ (mem_idealRange.mp k.property).1] rw [hq] ring have hpoint (k : idealRange K) : ‖∑j : sector E,quadraticRow k.val (primaryGenerator (cols j.val))*a j.val‖^2≤ ‖∑j : sector E,quadraticRow k.val (primaryGenerator (good j))*a j.val‖^2 := by rw [hrow,norm_mul] apply pow_le_pow_left₀ (by positivity) exact mul_le_of_le_one_left (norm_nonneg _) (quadraticRow_norm_le_one _ _) exact (Finset.sum_le_sum (fun k _ => hpoint k)).trans (he.trans (mul_le_mul_of_nonneg_right hB (by positivity))) have hpoint (k : idealRange K) : ‖∑j,quadraticRow k.val (primaryGenerator (cols j))*a j‖^2≤ 4*∑E : fixedBadPrimes.powerset,‖∑j : sector E,quadraticRow k.val (primaryGenerator (cols j.val))*a j.val‖^2 := by rw [←Fintype.sum_fiberwise (fun j => badPrimeSector (cols j))] have hn := pow_le_pow_left₀ (norm_nonneg _) (norm_sum_le Finset.univ (fun E : fixedBadPrimes.powerset => ∑j : sector E,quadraticRow k.val (primaryGenerator (cols j.val))*a j.val)) 2 have hc := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (fun _ : fixedBadPrimes.powerset => (1:ℝ)) (fun E : fixedBadPrimes.powerset => ‖∑j : sector E,quadraticRow k.val (primaryGenerator (cols j.val))*a j.val‖) have hcard : Fintype.card fixedBadPrimes.powerset=4 := by rw [Fintype.card_coe,fixedBadPrimes_powerset_card] apply hn.trans simpa [hcard,fixedBadPrimes_card] using hc calc _ ≤ ∑k : idealRange K,4*∑E : fixedBadPrimes.powerset,‖∑j : sector E,quadraticRow k.val (primaryGenerator (cols j.val))*a j.val‖^2 := Finset.sum_le_sum (fun k _ => hpoint k) _ = 4*∑E : fixedBadPrimes.powerset,∑k : idealRange K,‖∑j : sector E,quadraticRow k.val (primaryGenerator (cols j.val))*a j.val‖^2 := by rw [←Finset.mul_sum,Finset.sum_comm] _ ≤ 4*∑E : fixedBadPrimes.powerset,sieveNorm X K*∑j : sector E,‖a j.val‖^2 := by gcongr with E exact hsector E _ = _ := by have he : (∑E : fixedBadPrimes.powerset,∑j : sector E,‖a j.val‖^2)=∑j,‖a j‖^2 := Fintype.sum_fiberwise (fun j => badPrimeSector (cols j)) (fun j => ‖a j‖^2) rw [←Finset.mul_sum,he] ring theorem columnSquareFiber_nonzero_bounds (S : Finset (Ideal O)) (X : ℝ) (hS : ∀I∈S,I≠0 ∧ (Ideal.absNorm I:ℝ)≤X) (A : Ideal O) (I : columnSquareFiber S A) : Squarefree (squarefreePart I.val) ∧ (Ideal.absNorm (squarefreePart I.val):ℝ)≤X/(Ideal.absNorm A:ℝ)^2 := by have hi := hS I.val (Finset.mem_filter.mp I.property).1 have hp := squarePart_ne_zero hi.1 have ha := (Finset.mem_filter.mp I.property).2 have hAz : A≠0 := by rw [←ha]; exact hp have hAn : 0<(Ideal.absNorm A:ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun hz => hAz (Ideal.absNorm_eq_zero_iff.mp hz)) refine ⟨squarefree_squarefreePart _,(le_div_iff₀ (sq_pos_of_pos hAn)).mpr ?_⟩ have hn : (Ideal.absNorm A:ℝ)^2*(Ideal.absNorm (squarefreePart I.val):ℝ)=(Ideal.absNorm I.val:ℝ) := by have hh : (Ideal.absNorm (squarePart I.val):ℝ)^2*(Ideal.absNorm (squarefreePart I.val):ℝ)=(Ideal.absNorm I.val:ℝ) := by exact_mod_cast norm_decomposition I.val simpa only [ha] using hh nlinarith theorem columnSquareFiber_nonzero_card (S : Finset (Ideal O)) (X : ℝ) (hS : ∀I∈S,I≠0 ∧ (Ideal.absNorm I:ℝ)≤X) (A : Ideal O) (hscale : 1≤X/(Ideal.absNorm A:ℝ)^2) : ((columnSquareFiber S A).card:ℝ)≤128*(X/(Ideal.absNorm A:ℝ)^2) := by let T := (columnSquareFiber S A).image squarefreePart have hcard : T.card=(columnSquareFiber S A).card := Finset.card_image_iff.mpr (by intro I hI J hJ he have hh : (⟨I,hI⟩:columnSquareFiber S A)=(⟨J,hJ⟩:columnSquareFiber S A) := columnSquareFiber_injective S A he exact congrArg Subtype.val hh) rw [←hcard] apply DescentFiberCost.finite_ideal_count_real T _ hscale · intro I hI obtain ⟨J,hJ,rfl⟩ := Finset.mem_image.mp hI exact (columnSquareFiber_nonzero_bounds S X hS A ⟨J,hJ⟩).1.ne_zero · intro I hI obtain ⟨J,hJ,rfl⟩ := Finset.mem_image.mp hI exact (columnSquareFiber_nonzero_bounds S X hS A ⟨J,hJ⟩).2 theorem columnSquareFiber_all_energy (S : Finset (Ideal O)) (X K : ℝ) (hS : ∀I∈S,I≠0 ∧ (Ideal.absNorm I:ℝ)≤X) (A : Ideal O) (a : Ideal O → ℂ) : (∑k : idealRange K, ‖∑I∈columnSquareFiber S A, quadraticRow k.val (primaryGenerator I)*a I‖^2) ≤ 4*sieveNorm (X/(Ideal.absNorm A:ℝ)^2) K * ∑I∈columnSquareFiber S A,‖a I‖^2 := by let T := columnSquareFiber S A have he := squarefree_all_column_energy (fun I : T => squarefreePart I.val) (columnSquareFiber_injective S A) (X/(Ideal.absNorm A:ℝ)^2) K (fun I => columnSquareFiber_nonzero_bounds S X hS A I) (fun I : T => a I.val) have hm (k : idealRange K) : ‖∑I : T,quadraticRow k.val (primaryGenerator I.val)*a I.val‖^2 ≤ ‖∑I : T,quadraticRow k.val (primaryGenerator (squarefreePart I.val))*a I.val‖^2 := by have hrow : (∑I : T,quadraticRow k.val (primaryGenerator I.val)*a I.val)= idealZeroMask k.val (primaryGenerator A)* ∑I : T,quadraticRow k.val (primaryGenerator (squarefreePart I.val))*a I.val := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro I _ have hi := (Finset.mem_filter.mp I.property).2 have hq : quadraticRow k.val (primaryGenerator I.val)= idealZeroMask k.val (primaryGenerator A)*quadraticRow k.val (primaryGenerator (squarefreePart I.val)) := by have hh := canonical_quadraticRow_primary_squarefree k.val (mem_idealRange.mp k.property).1 (squarePart I.val) (squarefreePart I.val) rw [squarePart_sq_mul_squarefreePart,hi] at hh exact hh rw [hq] ring rw [hrow,norm_mul,mul_pow] have hmask : ‖idealZeroMask k.val (primaryGenerator A)‖^2≤1 := by unfold idealZeroMask split_ifs <;> norm_num exact mul_le_of_le_one_left (sq_nonneg _) hmask have hr (k : idealRange K) : (∑I∈columnSquareFiber S A,quadraticRow k.val (primaryGenerator I)*a I)= ∑I : T,quadraticRow k.val (primaryGenerator I.val)*a I.val := (Finset.sum_coe_sort T _).symm simp_rw [hr] rw [←Finset.sum_coe_sort T (fun I => ‖a I‖^2)] exact (Finset.sum_le_sum (fun k _ => hm k)).trans he theorem columnSquareParts_nonzero_bounds (S : Finset (Ideal O)) (X : ℝ) (hS : ∀I∈S,I≠0 ∧ (Ideal.absNorm I:ℝ)≤X) (A : Ideal O) (hA : A∈S.image squarePart) : A≠0 ∧ 1≤(Ideal.absNorm A:ℝ) ∧ (Ideal.absNorm A:ℝ)≤X ∧ 1≤X/(Ideal.absNorm A:ℝ)^2 := by obtain ⟨I,hI,rfl⟩ := Finset.mem_image.mp hA have hi := hS I hI have hAz := squarePart_ne_zero hi.1 have hDz := (squarefree_squarefreePart I).ne_zero have ha : 1≤(Ideal.absNorm (squarePart I):ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => hAz (Ideal.absNorm_eq_zero_iff.mp hz)) have hd : 1≤(Ideal.absNorm (squarefreePart I):ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => hDz (Ideal.absNorm_eq_zero_iff.mp hz)) have hn : (Ideal.absNorm (squarePart I):ℝ)^2*(Ideal.absNorm (squarefreePart I):ℝ)=(Ideal.absNorm I:ℝ) := by exact_mod_cast norm_decomposition I refine ⟨hAz,ha,by nlinarith,?_⟩ apply (le_div_iff₀ (by positivity : 0<(Ideal.absNorm (squarePart I):ℝ)^2)).mpr nlinarith theorem bounded_nonzero_quadratic_norm : ∀ε : ℝ, 0<ε → ∃C : ℝ, 0 (hprop A hA).1 have hR : 0≤R := by dsimp [R]; positivity have hRL : R≤D*X^deltaLoss := by apply (finite_inverse_norm_sum T X hT0 (fun A hA => (hprop A hA).2.2.1)).trans have hh := columnDyadicLength_small_power deltaLoss hδ X hX dsimp [D] nlinarith let F : ℝ := 512*C*(K*X)^deltaLoss*(K+X)*X*lengthScale^2 have hF : 0≤F := by dsimp [F]; positivity have hf (A : Ideal O) (hA : A∈T) : (Ideal.absNorm A:ℝ)*(∑k : idealRange K,‖∑I∈columnSquareFiber S A, quadraticRow k.val (primaryGenerator I)*a I‖^2)≤F/(Ideal.absNorm A:ℝ) := by have hp := hprop A hA have hn : 0<(Ideal.absNorm A:ℝ) := by linarith [hp.2.1] let Y := X/(Ideal.absNorm A:ℝ)^2 have hY : 1≤Y := hp.2.2.2 have hYX : Y≤X := div_le_self hX0.le (one_le_pow₀ hp.2.1) have hb : sieveNorm Y K≤C*(K*X)^deltaLoss*(K+X) := by apply (hsharp Y K hY hK).trans have hprod : Y*K≤K*X := by nlinarith have hpw := Real.rpow_le_rpow (by positivity : 0≤Y*K) hprod hδ.le exact mul_le_mul (mul_le_mul_of_nonneg_left hpw hC.le) (by linarith) (by positivity) (by positivity) have hea : (∑I∈columnSquareFiber S A,‖a I‖^2)≤128*Y*lengthScale^2 := by calc _ ≤ ∑_I∈columnSquareFiber S A,lengthScale^2 := by apply Finset.sum_le_sum intro I hI exact pow_le_pow_left₀ (norm_nonneg _) (ha I (Finset.mem_filter.mp hI).1) 2 _ = ((columnSquareFiber S A).card:ℝ)*lengthScale^2 := by simp _ ≤ _ := mul_le_mul_of_nonneg_right (columnSquareFiber_nonzero_card S X hS A hY) (sq_nonneg _) have he := columnSquareFiber_all_energy S X K hS A a calc _ ≤ (Ideal.absNorm A:ℝ)*(4*sieveNorm Y K*(∑I∈columnSquareFiber S A,‖a I‖^2)) := mul_le_mul_of_nonneg_left he (Nat.cast_nonneg _) _ ≤ (Ideal.absNorm A:ℝ)*((4*C*(K*X)^deltaLoss*(K+X))*(128*Y*lengthScale^2)) := by have h4 := mul_le_mul_of_nonneg_left hb (by norm_num : (0:ℝ)≤4) have hh := mul_le_mul h4 hea (by positivity) (by positivity) have hw := mul_le_mul_of_nonneg_left hh (Nat.cast_nonneg (α:=ℝ) (Ideal.absNorm A)) convert hw using 1 <;> first | rfl | ring _ = F/(Ideal.absNorm A:ℝ) := by dsimp [F,Y]; field_simp [hn.ne'] ; ring have hsplit (k : idealRange K) : (∑I∈S,quadraticRow k.val (primaryGenerator I)*a I)= ∑A∈T,∑I∈columnSquareFiber S A,quadraticRow k.val (primaryGenerator I)*a I := by exact (Finset.sum_fiberwise_of_maps_to (fun I hI => Finset.mem_image_of_mem squarePart hI) _).symm have hcauchy (k : idealRange K) : ‖∑I∈S,quadraticRow k.val (primaryGenerator I)*a I‖^2≤ R*∑A∈T,(Ideal.absNorm A:ℝ)*‖∑I∈columnSquareFiber S A,quadraticRow k.val (primaryGenerator I)*a I‖^2 := by rw [hsplit] exact ideal_reciprocal_cauchy T hT0 _ have htotal : (∑k : idealRange K,‖∑I∈S,quadraticRow k.val (primaryGenerator I)*a I‖^2)≤F*R^2 := by calc _ ≤ ∑k : idealRange K,R*∑A∈T,(Ideal.absNorm A:ℝ)*‖∑I∈columnSquareFiber S A, quadraticRow k.val (primaryGenerator I)*a I‖^2 := Finset.sum_le_sum (fun k _ => hcauchy k) _ = R*∑A∈T,(Ideal.absNorm A:ℝ)*∑k : idealRange K,‖∑I∈columnSquareFiber S A, quadraticRow k.val (primaryGenerator I)*a I‖^2 := by rw [←Finset.mul_sum,Finset.sum_comm] congr 1 apply Finset.sum_congr rfl intro A hA rw [←Finset.mul_sum] _ ≤ R*∑A∈T,F/(Ideal.absNorm A:ℝ) := by gcongr with A hA; exact hf A hA _ = F*R^2 := by simp_rw [div_eq_mul_inv] rw [←Finset.mul_sum] dsimp [R] simp only [one_div] ring have hpower : (K*X)^deltaLoss*(X^deltaLoss)^2≤(K*X)^ε := by have hXP : X≤K*X := by nlinarith calc _ ≤ (K*X)^deltaLoss*((K*X)^deltaLoss)^2 := by gcongr _ = (K*X)^ε := by rw [pow_two,←mul_assoc,←Real.rpow_add hP0,←Real.rpow_add hP0] congr 1 dsimp [deltaLoss] ring apply htotal.trans calc _ ≤ F*(D*X^deltaLoss)^2 := by gcongr _ = (512*C*D^2)*((K*X)^deltaLoss*(X^deltaLoss)^2)*(K+X)*X*lengthScale^2 := by dsimp [F]; ring _ ≤ _ := by gcongr end CanonicalQuadraticSieve end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.QuadraticSieve.UniformTailBounds namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CanonicalQuadraticSieve open ActualEisensteinCubic CompletedGauss IdealMobiusDivisorSum theorem product_quadratic_norm_all : ∀ε : ℝ, 0<ε → ∃C : ℝ, 0 p.1*p.2) have hX : 1≤X := by dsimp [X]; nlinarith have hX0 : 0 Ideal.span {p i})) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2), ∀ (S T : Finset ι) (e : O), e ≠ 0 → ∀ (W : 𝓢(ℝ, ℂ)) (Y H : ℝ), 0 < Y → 0 ≤ H → let n := ∏ i : activeSupport T S, p i.val let scale := Y / (‖eisEmbedding e‖^2 * ‖eisEmbedding n‖^2) (∑' k : {k : O // H ≤ scale * ‖eisEmbedding k‖^2}, ‖secondPairRadialMode p hp hg hinj S T e k.val W Y‖) ≤ (Y / ‖eisEmbedding n‖) * ((C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) / ((min 1 scale)^2 * (1+H)^A)) := by obtain ⟨s,C,hC,hbound⟩ := EisensteinSchwartzPoisson.paperRadialFourier_lattice_tail A refine ⟨s,C,hC,?_⟩ intro ι _ p hp _ hg hinj hc S T e he W Y H hY hH dsimp only let n := ∏ i : activeSupport T S, p i.val let scale := Y / (‖eisEmbedding e‖^2 * ‖eisEmbedding n‖^2) have hn : n ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun i hi => hp i.val) have hnorm : 0 < ‖eisEmbedding n‖ := norm_pos_iff.mpr (eisEmbedding_ne_zero hn) have hscale : 0 < scale := div_pos hY (mul_pos (sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero he))) (sq_pos_of_pos hnorm)) let tailSet : Set O := {k | H ≤ scale * ‖eisEmbedding k‖^2} let c := Y / ‖eisEmbedding n‖ have hc0 : 0 ≤ c := (div_pos hY hnorm).le have hpnt (k : tailSet) : ‖secondPairRadialMode p hp hg hinj S T e k.val W Y‖ ≤ c * ‖EisensteinSchwartzPoisson.paperRadialFourier W (scale * ‖eisEmbedding k.val‖^2)‖ := by have ha : Y * ‖eisEmbedding k.val‖^2 / (‖eisEmbedding e‖^2 * ‖eisEmbedding n‖^2) = scale * ‖eisEmbedding k.val‖^2 := by dsimp [scale]; ring simp only [secondPairRadialMode, norm_mul] change ‖(Y : ℂ) / (‖eisEmbedding n‖ : ℂ)‖ * _ * _ ≤ _ rw [ha, norm_div, Complex.norm_real, Complex.norm_real, Real.norm_eq_abs, Real.norm_eq_abs, abs_of_pos hY, abs_of_pos hnorm] exact mul_le_of_le_one_right (by positivity) (activeGaussRowFactor_norm_le_one p hp hg hinj hc T S e k.val) have hmajor : Summable (fun k : tailSet => c * ‖EisensteinSchwartzPoisson.paperRadialFourier W (scale * ‖eisEmbedding k.val‖^2)‖) := ((EisensteinSchwartzPoisson.paperRadialFourier_lattice_summable_norm W scale hscale).subtype tailSet).mul_left c have hsmall : Summable (fun k : tailSet => ‖secondPairRadialMode p hp hg hinj S T e k.val W Y‖) := Summable.of_nonneg_of_le (fun _ => norm_nonneg _) hpnt hmajor calc _ ≤ ∑' k : tailSet, c * ‖EisensteinSchwartzPoisson.paperRadialFourier W (scale * ‖eisEmbedding k.val‖^2)‖ := hsmall.tsum_le_tsum hpnt hmajor _ = c * ∑' k : tailSet, ‖EisensteinSchwartzPoisson.paperRadialFourier W (scale * ‖eisEmbedding k.val‖^2)‖ := tsum_mul_left _ ≤ _ := mul_le_mul_of_nonneg_left (hbound W scale H hscale hH) hc0 theorem full_uniform_secondPairRadialMode_remainder (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2), ∀ (S T : Finset ι) (e : O), e ≠ 0 → ∀ (W : 𝓢(ℝ, ℂ)) (Y H : ℝ), 0 < Y → 0 ≤ H → ∀ K : Finset O, let n := ∏ i : activeSupport T S, p i.val let scale := Y / (‖eisEmbedding e‖^2 * ‖eisEmbedding n‖^2) (∀ k : O, k ∉ K → H ≤ scale * ‖eisEmbedding k‖^2) → ‖∑' k : {k : O // k ∉ K}, secondPairRadialMode p hp hg hinj S T e k.val W Y‖ ≤ (Y/‖eisEmbedding n‖) * ((C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W)/((min 1 scale)^2*(1+H)^A)) := by obtain ⟨s,C,hC,hb⟩ := full_uniform_secondPairRadialMode_tail A refine ⟨s,C,hC,?_⟩ intro ι _ p hp _ hg hinj hc have hb := hb p hp hg hinj hc intro S T e he W Y H hY hH K dsimp only intro hK let n := ∏ i : activeSupport T S, p i.val let scale := Y / (‖eisEmbedding e‖^2 * ‖eisEmbedding n‖^2) let small : Set O := {k | k ∉ K} let large : Set O := {k | H ≤ scale * ‖eisEmbedding k‖^2} let f : small → large := fun k => ⟨k.val,hK k.val k.property⟩ have hi : Function.Injective f := by intro a b heq exact Subtype.ext (congrArg (fun z : large => z.val) heq) have hs := secondPairRadialMode_summable_norm p hp hg hinj hc S T e he W Y hY calc _ ≤ ∑' k : small, ‖secondPairRadialMode p hp hg hinj S T e k.val W Y‖ := norm_tsum_le_tsum_norm (hs.subtype small) _ ≤ ∑' k : large, ‖secondPairRadialMode p hp hg hinj S T e k.val W Y‖ := (hs.subtype small).tsum_le_tsum_of_inj f hi (fun _ _ => norm_nonneg _) (fun _ => le_rfl) (hs.subtype large) _ ≤ _ := hb S T e he W Y H hY hH theorem full_uniform_residualSecondMode_tail_bound (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2), ∀ (F G : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m c d : O) (H₁ H₂ : Finset ι → ℂ) (e : O), e ≠ 0 → ∀ (W : 𝓢(ℝ, ℂ)) (Y H : ℝ), 0 < Y → 0 ≤ H → ∀ K : Finset O, (∀ S ∈ (F\G).powerset, ∀ T ∈ (F\G).powerset, Disjoint S T → residualPairWeight p hg Ψ₁ Ψ₂ m c d H₁ H₂ S T ≠ 0 → ∀ k : O, k ∉ K → H ≤ (Y / (‖eisEmbedding e‖^2 * ‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖^2)) * ‖eisEmbedding k‖^2) → ‖∑' k : {k : O // k ∉ K}, residualSecondMode p hp hg hinj F G Ψ₁ Ψ₂ m c d H₁ H₂ e k.val W Y‖ ≤ residualTailCost p hg F G Ψ₁ Ψ₂ m c d H₁ H₂ e Y H A (C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) := by obtain ⟨s,C,hC,hb⟩ := full_uniform_secondPairRadialMode_remainder A refine ⟨s,C,hC,?_⟩ intro ι _ p hp _ hg hinj hc have hb := hb p hp hg hinj hc intro F G Ψ₁ Ψ₂ m c d H₁ H₂ e he W Y H hY hH K hK rw [residualSecondMode_tail_eq p hp hg hinj F G Ψ₁ Ψ₂ m c d H₁ H₂ e he W Y hY K] unfold residualTailCost apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro S hS apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro T hT by_cases hd : Disjoint S T · simp only [if_pos hd, norm_mul] by_cases hw : residualPairWeight p hg Ψ₁ Ψ₂ m c d H₁ H₂ S T = 0 · simp only [hw, norm_zero, zero_mul, le_refl] · exact mul_le_mul_of_nonneg_left (hb S T e he W Y H hY hH K (hK S hS T hT hd hw)) (norm_nonneg _) · simp [hd] theorem full_uniform_secondSourceTail_bound (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2), ∀ (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (Hcol : Finset ι → ℂ) (W : 𝓢(ℝ, ℂ)) (Y H : ℝ), 0 < Y → 0 ≤ H → ∀ K : Finset ι → Finset ι → Finset O, (∀ G ∈ F.powerset, ∀ E : G.powerset, ∀ S ∈ (F\G).powerset, ∀ T ∈ (F\G).powerset, Disjoint S T → residualPairWeight p hg Ψ Ψ m c d (fun U => Hcol (G∪U)) (fun U => Hcol (G∪U)) S T ≠ 0 → ∀ k : O, k ∉ K G E.val → H ≤ (Y / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val)‖^2 * ‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖^2)) * ‖eisEmbedding k‖^2) → ‖secondSourceTail p hp hg hinj F Ψ m c d Hcol W Y K‖ ≤ ∑ G ∈ F.powerset, ∑ E : G.powerset, ‖secondSourceCommonCoefficient p hg Ψ m c d G E.val‖ * residualTailCost p hg F G Ψ Ψ m c d (fun U => Hcol (G∪U)) (fun U => Hcol (G∪U)) (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) Y H A (C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) := by obtain ⟨s,C,hC,hb⟩ := full_uniform_residualSecondMode_tail_bound A refine ⟨s,C,hC,?_⟩ intro ι _ p hp _ hg hinj hc have hb := hb p hp hg hinj hc intro F Ψ m c d Hcol W Y H hY hH K hK unfold secondSourceTail apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro G hG apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro E hE rw [norm_mul] apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) simp_rw [← residualSecondMode_eq_frequencyKernel p hp hg hinj F G E.val (Finset.mem_powerset.mp E.property) Ψ Ψ m c d (fun U => Hcol (G∪U)) (fun U => Hcol (G∪U))] exact hb F G Ψ Ψ m c d (fun U => Hcol (G∪U)) (fun U => Hcol (G∪U)) (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) (primeSubsetGenerator_ne_zero _ _) W Y H hY hH (K G E.val) (hK G hG E) theorem full_uniform_firstCoreSecondCutoff_tail_bound (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2), ∀ (F D : Finset ι) (Ψ : O →* ℂ) (m c d : O) (g V W : 𝓢(ℝ, ℂ)) (negative : Bool) (t X Y M H : ℝ), 0 < X → 0 < Y → 0 ≤ H → (∀ u, g u ≠ 0 → |u| ≤ M) → let X' := X / primeProductNorm p D let Hbase := normalizedColumn p (fun S => firstCoreBaseProfile g V negative (columnLog p X' S)) let Hmode := normalizedColumn p (fun S => firstCoreModeProfile g V negative t (columnLog p X' S)) ‖secondSourceTail p hp hg hinj (F\D) Ψ m c d Hmode W Y (firstCoreSecondCutoff p D X Y M H)‖ ≤ ∑ G ∈ (F\D).powerset, ∑ E : G.powerset, ‖secondSourceCommonCoefficient p hg Ψ m c d G E.val‖ * residualTailCost p hg (F\D) G Ψ Ψ m c d (fun S => Hbase (G∪S)) (fun S => Hbase (G∪S)) (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val) Y H A (C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) := by obtain ⟨s,C,hC,hb⟩ := full_uniform_secondSourceTail_bound A refine ⟨s,C,hC,?_⟩ intro ι _ p hp _ hg hinj hc have hb := hb p hp hg hinj hc intro F D Ψ m c d g V W negative t X Y M H hX hY hH hgM dsimp only have hcut : ∀ G ∈ (F\D).powerset, ∀ E : G.powerset, ∀ S ∈ ((F\D)\G).powerset, ∀ T ∈ ((F\D)\G).powerset, Disjoint S T → residualPairWeight p hg Ψ Ψ m c d (fun U => normalizedColumn p (fun R => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) R)) (G∪U)) (fun U => normalizedColumn p (fun R => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) R)) (G∪U)) S T ≠ 0 → ∀ k : O, k ∉ firstCoreSecondCutoff p D X Y M H G E.val → H ≤ (Y / (‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E.val)‖^2 * ‖eisEmbedding (∏ i : activeSupport T S, p i.val)‖^2)) * ‖eisEmbedding k‖^2 := by intro G hG E S hS T hT hST hw k hk have hGS : Disjoint G S := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hS) disjoint_sdiff_self_right have hGT : Disjoint G T := Finset.disjoint_of_subset_right (Finset.mem_powerset.mp hT) disjoint_sdiff_self_right obtain ⟨hs,ht⟩ := residualPairWeight_test_ne_zero p hg Ψ Ψ m c d _ _ S T hw exact firstCoreSecondCutoff_uniform p hp g V negative t M hgM D G E.val S T hGS hGT hST X Y H hX hY hs ht k hk have h := hb (F\D) Ψ m c d (normalizedColumn p (fun S => firstCoreModeProfile g V negative t (columnLog p (X / primeProductNorm p D) S))) W Y H hY hH (firstCoreSecondCutoff p D X Y M H) hcut simpa only [firstCoreModeProfile, residualTailCost_frequencyTwist] using h theorem full_uniform_firstCoreSecondCutoff_tail_polynomial (A : ℕ) : ∃ (s : Finset (ℕ × ℕ)) (C : ℝ), 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2), ∀ (F D : Finset ι) (Ψ : O →* ℂ) (m c d : O) (g V W : 𝓢(ℝ, ℂ)) (negative : Bool) (t X Y M H : ℝ), (∀ a, ‖Ψ a‖ ≤ 1) → 0 < X → 0 < Y → 0 ≤ H → (∀ u, g u ≠ 0 → |u| ≤ M) → let X' := X / primeProductNorm p D let lengthScale := 1 + X' * Real.exp M let Hmode := normalizedColumn p (fun S => firstCoreModeProfile g V negative t (columnLog p X' S)) ‖secondSourceTail p hp hg hinj (F\D) Ψ m c d Hmode W Y (firstCoreSecondCutoff p D X Y M H)‖ ≤ (128*lengthScale)^4 * ((SchwartzMap.seminorm ℝ 0 0 (firstCoreBaseProfile g V negative))^2 * (Y*(C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W)*(1+lengthScale^3/Y)^2/(1+H)^A)) := by obtain ⟨s,C,hC,hb⟩ := full_uniform_firstCoreSecondCutoff_tail_bound A refine ⟨s,C,hC,?_⟩ intro ι _ p hp _ hg hinj hc have hb := hb p hp hg hinj hc intro F D Ψ m c d g V W negative t X Y M H hΨ hX hY hH hgM dsimp only have hX' : 0 < X / primeProductNorm p D := div_pos hX (FirstPassCubeLabels.primeProductNorm_pos p hp D) have hgbase : ∀ u, firstCoreBaseProfile g V negative u ≠ 0 → |u| ≤ M := by intro u hu apply hgM u intro hz apply hu simp only [firstCoreBaseProfile_apply, hz, zero_mul] have hP : 0 ≤ C * s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W := mul_nonneg hC.le (apply_nonneg _ _) exact (hb F D Ψ m c d g V W negative t X Y M H hX hY hH hgM).trans (secondSourceTailCost_polynomial p hp hg hinj (F\D) Ψ hΨ m c d (firstCoreBaseProfile g V negative) M (X / primeProductNorm p D) Y H (1 + X / primeProductNorm p D * Real.exp M) (C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) A hX' hY hH hP (by linarith [mul_pos hX' (Real.exp_pos M)]) (by linarith) hgbase) theorem full_uniform_firstCoreSecondCutoff_tail_fixed_source (A : ℕ) (g V W : 𝓢(ℝ, ℂ)) (negative : Bool) : ∃ C : ℝ, 0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2), ∀ (F D : Finset ι) (Ψ : O →* ℂ) (m c d : O) (t X Y M H : ℝ), (∀ a, ‖Ψ a‖ ≤ 1) → 0 < X → 0 < Y → 0 ≤ H → (∀ u, g u ≠ 0 → |u| ≤ M) → let X' := X / primeProductNorm p D let lengthScale := 1 + X' * Real.exp M let Hmode := normalizedColumn p (fun S => firstCoreModeProfile g V negative t (columnLog p X' S)) ‖secondSourceTail p hp hg hinj (F\D) Ψ m c d Hmode W Y (firstCoreSecondCutoff p D X Y M H)‖ ≤ C*lengthScale^4*Y*(1+lengthScale^3/Y)^2/(1+H)^A := by obtain ⟨s,C,hC,hb⟩ := full_uniform_firstCoreSecondCutoff_tail_polynomial A let C₀ := 128^4 * (SchwartzMap.seminorm ℝ 0 0 (firstCoreBaseProfile g V negative))^2 * (C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W) have hC₀ : 0 ≤ C₀ := by dsimp [C₀]; positivity refine ⟨1+C₀, by linarith, ?_⟩ intro ι _ p hp _ hg hinj hc have hb := hb p hp hg hinj hc intro F D Ψ m c d t X Y M H hΨ hX hY hH hgM dsimp only have h := hb F D Ψ m c d g V W negative t X Y M H hΨ hX hY hH hgM apply h.trans calc _ = C₀*(1+X/primeProductNorm p D*Real.exp M)^4*Y* (1+(1+X/primeProductNorm p D*Real.exp M)^3/Y)^2/(1+H)^A := by dsimp [C₀]; ring _ ≤ _ := by gcongr; linarith end SecondPassArithmetic open scoped BigOperators Classical namespace InitialMeanSquare open IdealMobiusDivisorSum structure ElementDatum where divisor : Ideal O shared : O frequency : O def instDecidableEqElementDatum.decEq (x y : ElementDatum) : Decidable (x = y) := match x, y with | ElementDatum.mk a0 a1 a2, ElementDatum.mk b0 b1 b2 => if h : a0 = b0 then by subst h exact if h : a1 = b1 then by subst h exact if h : a2 = b2 then by subst h exact isTrue rfl else isFalse (by intro n; injection n; apply h _; assumption) else isFalse (by intro n; injection n; apply h _; assumption) else isFalse (by intro n; injection n; apply h _; assumption) def instDecidableEqElementDatum : DecidableEq (ElementDatum) := instDecidableEqElementDatum.decEq def elementRow (gen : Ideal O→O) (x : ElementDatum) : O := gen x.divisor*x.frequency def elementLabel (gen : Ideal O→O) (x : ElementDatum) : O := gen x.divisor*x.shared def elementObservation (gen : Ideal O→O) (x : ElementDatum) : O×O := (elementRow gen x,elementLabel gen x) theorem element_divisor_injective_on_fiber (gen : Ideal O→O) (y f : O) (hy : y≠0) : Set.InjOn ElementDatum.divisor {x : ElementDatum | elementObservation gen x=(y,f)} := by intro x hx z hz hd have hxrow : elementRow gen x=y := congrArg Prod.fst hx have hzrow : elementRow gen z=y := congrArg Prod.fst hz have hxlabel : elementLabel gen x=f := congrArg Prod.snd hx have hzlabel : elementLabel gen z=f := congrArg Prod.snd hz have hgen : gen x.divisor≠0 := by intro he apply hy rw [←hxrow,elementRow,he,zero_mul] have hs : x.shared=z.shared := by apply mul_left_cancel₀ hgen calc gen x.divisor*x.shared = f := hxlabel _ = gen z.divisor*z.shared := hzlabel.symm _ = gen x.divisor*z.shared := by rw [hd] have hh : x.frequency=z.frequency := by apply mul_left_cancel₀ hgen calc gen x.divisor*x.frequency = y := hxrow _ = gen z.divisor*z.frequency := hzrow.symm _ = gen x.divisor*z.frequency := by rw [hd] cases x cases z simp_all theorem element_fiber_card_le (gen : Ideal O→O) (hgen : ∀D,Ideal.span {gen D}=D) (s : Finset ElementDatum) (y f : O) (hy : y≠0) : (s.filter (fun x => elementObservation gen x=(y,f))).card≤(idealDivisors (Ideal.span {y})).card := by have hyI : (Ideal.span {y}:Ideal O)≠0 := by intro hz; exact hy (Ideal.span_singleton_eq_bot.mp hz) apply Finset.card_le_card_of_injOn ElementDatum.divisor · intro x hx change x.divisor∈idealDivisors (Ideal.span {y}) rw [mem_idealDivisors hyI] have he : elementRow gen x=y := congrArg Prod.fst (Finset.mem_filter.mp hx).2 rw [←he,elementRow,←Ideal.span_singleton_mul_span_singleton,hgen] exact dvd_mul_right _ _ · intro x hx z hz he exact element_divisor_injective_on_fiber gen y f hy (Finset.mem_filter.mp hx).2 (Finset.mem_filter.mp hz).2 he end InitialMeanSquare open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm normalizedColumn) open EisensteinSchwartzPoisson (paperRadialFourier) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalFirstDiagonalCost (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (Y : GlobalFirstData ι → ℝ) : ℝ := ∑ b∈s,‖w b‖*(primeProductNorm p b.firstCommon)⁻¹* (|Y b| *‖paperRadialFourier W 0‖* ∑ G∈(globalFirstRawPool pool b).powerset, ‖secondInputCoefficient p hg Ψ (m*globalFirstBlockBadLabel p b) (globalFirstBlockLabel p b) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) (globalFirstBlockTest p g ell side b) G‖^2) include hp in theorem globalFirstDiagonalCost_nonneg (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (Y : GlobalFirstData ι → ℝ) : 0≤globalFirstDiagonalCost p hg pool s w Ψ m g W ell side Y := by unfold globalFirstDiagonalCost apply Finset.sum_nonneg intro b hb have hn := (FirstPassCubeLabels.primeProductNorm_pos p hp b.firstCommon).le positivity omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalFirstBlockTest_mode_norm (g V : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (t : ℝ) (b : GlobalFirstData ι) (G : Finset ι) : ‖globalFirstBlockTest p (firstCoreModeProfile g V side t) ell side b G‖ = ‖globalFirstBlockTest p (firstCoreBaseProfile g V side) ell side b G‖ := by simp only [globalFirstBlockTest,normalizedColumn,norm_div,firstCoreModeProfile, JointLogSeparation.frequencyTwist_norm] include hp in theorem globalFirstSourceZero_bound (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (Ψ : O →* ℂ) (m : O) (g V W : 𝓢(ℝ,ℂ)) (K ell B F M H : ℝ) (side : Bool) (t : ℝ) : ‖globalFirstSourceZero p hg pool s w (globalFirstConcreteCutoff p K ell B F M H side) Ψ m (firstCoreModeProfile g V side t) W ell side (globalFirstPooledRow p K ell B F side)‖ ≤ globalFirstDiagonalCost p hg pool s w Ψ m (firstCoreBaseProfile g V side) W ell side (globalFirstPooledRow p K ell B F side) := by unfold globalFirstSourceZero globalFirstDiagonalCost apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro b hb rw [norm_mul,norm_mul,norm_inv,Complex.norm_real, Real.norm_of_nonneg (FirstPassCubeLabels.primeProductNorm_pos p hp _).le] apply mul_le_mul_of_nonneg_left _ (mul_nonneg (norm_nonneg _) (inv_nonneg.mpr (FirstPassCubeLabels.primeProductNorm_pos p hp _).le)) have hh := truncatedSecondZero_norm_le p hg hinj (globalFirstRawPool pool b) Ψ (m*globalFirstBlockBadLabel p b) (globalFirstBlockLabel p b) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) (globalFirstBlockTest p (firstCoreModeProfile g V side t) ell side b) W (globalFirstPooledRow p K ell B F side b) (globalFirstConcreteCutoff p K ell B F M H side b) (fun G hG E hE => firstCoreSecondCutoff_zero _ _ _ _ _ _ _ _) apply hh.trans_eq congr 1 apply Finset.sum_congr rfl intro G hG simp only [secondInputCoefficient,norm_mul,globalFirstBlockTest_mode_norm] end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] def globalFirstTailCost (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (K ell B F M H : ℝ) (N : ℕ) (side : Bool) : ℝ := ∑ b∈s, let lengthScale := 1+globalFirstBlockColumnScale p ell side b/primeProductNorm p b.firstCommon*Real.exp M let Y := globalFirstPooledRow p K ell B F side b ‖w b‖*(primeProductNorm p b.firstCommon)⁻¹*lengthScale^4*Y*(1+lengthScale^3/Y)^2/(1+H)^N include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalFirstTailCost_nonneg (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (K ell B F M H : ℝ) (N : ℕ) (side : Bool) (hK : 0 Ideal.span {p i})) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℂ) (Ψ : O →* ℂ) (m : O) (K ell B F M H t : ℝ), (∀ a,‖Ψ a‖≤1) → 0 Ideal.span {p i}) b.firstDivisor) t (globalFirstBlockColumnScale p ell side b) (globalFirstPooledRow p K ell B F side b) M H hΨ hX hY hH hgM have hh' := mul_le_mul_of_nonneg_left hh (mul_nonneg (norm_nonneg (w b)) (inv_nonneg.mpr (FirstPassCubeLabels.primeProductNorm_pos p hp b.firstCommon).le)) apply hh'.trans_eq ring end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.CubeBlocks namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace SecondPassArithmetic section open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct firstLogDensity) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter) theorem globalFirstCoreRows_integrated_transfer (ε : ℝ) (hε : 0<ε) (g V : 𝓢(ℝ,ℂ)) (M : ℝ) (hM : 0≤M) (hgM : ∀ t,g t ≠ 0 → |t|≤M) (side : Bool) (A J N : ℕ) : ∃ (windows : Fin 7 → ℝ → ℂ) (C Ct : ℝ),0≤C ∧ 0 Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (Γ K ell B F H : ℝ) (Ψ : O →* ℂ) (m : O) (χ : RayCharacter) (r : FirstCoreIndex) (T : GlobalFirstData ι → Finset O), 0≤Γ → (∀ b∈s,0≤w b ∧ w b≤Γ) → 0 (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0) ell M side let weight := fun b => w b*globalFirstCoefficient p K ell B F side b let Ψmode := firstCoreTwist side χ Ψ r (∫ t : ℝ,firstLogDensity (2*(J+2)) t* globalFirstFiniteEnergy p hg pool s weight Ψ m g V ell side χ r T t) ≤ (∫ t : ℝ,firstLogDensity 0 t)* (globalFirstDiagonalCost p hg pool s (fun b => weight b) Ψmode m (firstCoreBaseProfile g V side) rowMajorant ell side (globalFirstPooledRow p K ell B F side) + globalChildBudget p hp hcop hg pool source Ψmode m windows (Γ*C) ε 0 0 K ell B F M H A J side + Ct*globalFirstTailCost p s (fun b => weight b) K ell B F M H N side) := by obtain ⟨windows,C,hC,hwc,hws,hwb,hrows⟩ := globalFirstCoreRows_actual_transfer ε hε g V M hM hgM side A J obtain ⟨Ct,hCt,htail⟩ := globalFirstSourceTail_bound N g V rowMajorant side refine ⟨windows,C,Ct,hC,hCt,hwc,hws,hwb,?_⟩ intro ι _ p hp _ hcop hg hinj hc hpr pool s w Γ K ell B F H Ψ m χ r T hΓ hw hK hell hB hF hH hs hΨ hb₁ hb₂ hT hT0 dsimp only let source := globalFirstSupportedPool p pool s (fun b G E => (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0) ell M side let weight := fun b => w b*globalFirstCoefficient p K ell B F side b let Ψmode := firstCoreTwist side χ Ψ r let d := globalFirstDiagonalCost p hg pool s (fun b => weight b) Ψmode m (firstCoreBaseProfile g V side) rowMajorant ell side (globalFirstPooledRow p K ell B F side) let c := globalChildBudget p hp hcop hg pool source Ψmode m windows (Γ*C) ε 0 0 K ell B F M H A J side let q := Ct*globalFirstTailCost p s (fun b => weight b) K ell B F M H N side have hΨmode : ∀ a,‖Ψmode a‖≤1 := fun a => (firstCoreTwist_norm_le side χ Ψ r a).trans (hΨ a) have hweight (b : GlobalFirstData ι) (hb : b∈s) : 0≤weight b := mul_nonneg (hw b hb).1 (globalBinFirstCoefficient_nonneg K ell B F hK.le hell hB hF _) have hd : 0≤d := globalFirstDiagonalCost_nonneg p hp hg pool s _ Ψmode m _ rowMajorant ell side _ have hq : 0≤q := mul_nonneg hCt.le (globalFirstTailCost_nonneg p hp s _ K ell B F M H N side hK hell hB hF hH) have hpoint (t : ℝ) : globalFirstFiniteEnergy p hg pool s weight Ψ m g V ell side χ r T t ≤ 1*(d+((1+‖t‖)^(J+2)*(1+‖t‖)^(J+2))*c+q) := by have hrow := hrows p hp hcop hg hinj hc hpr pool s w Γ K ell B F H Ψ m χ r t T hΓ hw hK hell hB hF hH hs hΨ hb₁ hb₂ hT hT0 dsimp only at hrow have hsmall : globalFirstFiniteEnergy p hg pool s weight Ψ m g V ell side χ r T t ≤ ∑ b∈s,weight b*((∑ z∈T b,‖globalFirstCoreRow p hg pool Ψ m g V ell side χ r t b z‖^2)+ globalFirstCoreCorrection p g V ell side t b) := by apply Finset.sum_le_sum intro b hb exact mul_le_mul_of_nonneg_left (le_add_of_nonneg_right (sq_nonneg _)) (hweight b hb) have hz := globalFirstSourceZero_bound p hp hg hinj pool s (fun b => weight b) Ψmode m g V rowMajorant K ell B F M H side t have ht := htail p hp hg hinj hc pool s (fun b => weight b) Ψmode m K ell B F M H t hΨmode hK hell hB hF hH hgM have hupper := add_le_add (add_le_add (le_refl (globalChildBudget p hp hcop hg pool source Ψmode m windows (Γ*C) ε t t K ell B F M H A J side)) hz) ht have hfinal := hsmall.trans (hrow.trans hupper) rw [globalChildBudget_height] at hfinal simpa only [d,c,q,one_mul,add_comm,add_left_comm,add_assoc] using hfinal have hint := FirstPassCubeLabels.integral_pair_moment_bound J (globalFirstFiniteEnergy p hg pool s weight Ψ m g V ell side χ r T) (globalFirstFiniteEnergy_integrable p hg pool s weight Ψ m g V ell side χ r T (2*(J+2))) 1 d c q (by norm_num) hd hq hpoint simpa only [mul_one] using hint end section open scoped BigOperators Classical SchwartzMap open MeasureTheory open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog firstLogDensity) open RayFourExpansion (RayCharacter crossCoeff) structure GlobalCubeBlock (ι : Type*) where cube : CubeCoordinates ι common : Finset ι firstDivisor : Finset ι protected theorem GlobalCubeBlock.ext : ∀ {ι : Type*} {x y : GlobalCubeBlock ι}, ∀ (cube : x.cube = y.cube) (common : x.common = y.common) (firstDivisor : x.firstDivisor = y.firstDivisor), x = y := fun {ι} {x} {h} => match x with | GlobalCubeBlock.mk cube common firstDivisor => match h with | GlobalCubeBlock.mk cube common firstDivisor => fun h0 h1 h2 => by cases h0 cases h1 cases h2 rfl namespace GlobalCubeBlock variable {ι : Type*} def withCommon (b : GlobalCubeBlock ι) (A : Finset ι) : GlobalFirstData ι := ⟨b.cube,A,b.common,b.firstDivisor⟩ end GlobalCubeBlock namespace GlobalFirstData variable {ι : Type*} def block (b : GlobalFirstData ι) : GlobalCubeBlock ι := ⟨b.cube,b.common,b.firstDivisor⟩ theorem withCommon_block (b : GlobalFirstData ι) : b.block.withCommon b.firstCommon=b := by cases b; rfl end GlobalFirstData variable {ι : Type*} [DecidableEq ι] def globalCubePool (pool : Finset ι) (b : GlobalCubeBlock ι) : Finset ι := pool\(b.cube.support∪b.common) def globalFirstFamilySet (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) : Finset (GlobalFirstData ι) := blocks.biUnion (fun b => (globalCubePool pool b).powerset.image b.withCommon) theorem sum_globalFirstFamilySet {M : Type*} [AddCommMonoid M] (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (f : GlobalFirstData ι → M) : ∑ d∈globalFirstFamilySet pool blocks,f d = ∑ b∈blocks,∑ A∈(globalCubePool pool b).powerset,f (b.withCommon A) := by unfold globalFirstFamilySet rw [Finset.sum_biUnion] · apply Finset.sum_congr rfl intro b hb rw [Finset.sum_image] intro A hA B hB he exact congrArg GlobalFirstData.firstCommon he · intro b hb c hc hne apply Finset.disjoint_left.mpr intro x hx hy obtain ⟨A,hA,rfl⟩ := Finset.mem_image.mp hx obtain ⟨B,hB,he⟩ := Finset.mem_image.mp hy exact hne (congrArg GlobalFirstData.block he).symm theorem mem_globalFirstFamilySet (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (d : GlobalFirstData ι) : d∈globalFirstFamilySet pool blocks ↔ d.block∈blocks ∧ d.firstCommon⊆globalCubePool pool d.block := by simp only [globalFirstFamilySet,Finset.mem_biUnion,Finset.mem_image,Finset.mem_powerset] constructor · rintro ⟨b,hb,A,hA,rfl⟩;exact ⟨hb,hA⟩ · rintro ⟨hb,hA⟩;exact ⟨d.block,hb,d.firstCommon,hA,d.withCommon_block⟩ variable (p : ι → O) [∀ i,(Ideal.span {p i}).IsMaximal] (hg : ∀ i,lambda ∉ Ideal.span {p i}) def globalCubeColumnScale (ell : ℝ) (side : Bool) (b : GlobalCubeBlock ι) : ℝ := globalFirstBlockColumnScale p ell side (b.withCommon ∅) def globalCubeCoefficient (K ell B F : ℝ) (side : Bool) (b : GlobalCubeBlock ι) : ℝ := globalFirstCoefficient p K ell B F side (b.withCommon ∅) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalFirstCoefficient_block (K ell B F : ℝ) (side : Bool) (d : GlobalFirstData ι) : globalFirstCoefficient p K ell B F side d=globalCubeCoefficient p K ell B F side d.block := by simp [globalFirstCoefficient,globalCubeCoefficient,globalBinFirstCoefficient,globalFirstIndex, globalScaleIndex,globalScaleVector,globalLogRep,GlobalFirstData.append, GlobalCubeBlock.withCommon,GlobalFirstData.block,globalCubeActiveRoot] def globalCubeInputFamilyEnergy (pool : Finset ι) (b : GlobalCubeBlock ι) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (J : ℕ) (T : Finset O) : ℝ := firstInputFamilyEnergy p hg (globalCubePool pool b) b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit side Ψ m (fun A => g (columnLog p (globalCubeColumnScale p ell side b) A)) V (globalCubeColumnScale p ell side b) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.common) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) J T def globalFirstFamilyWeight (w : GlobalCubeBlock ι → ℝ) (Ψ : O →* ℂ) (m : O) (side : Bool) (r : FirstCoreIndex) (d : GlobalFirstData ι) : ℝ := w d.block*‖firstCoreOuter p hg d.cube.support (fun i => d.cube.leftExponent i+d.cube.rightExponent i) d.cube.leftBit d.cube.rightBit side Ψ m d.firstCommon r‖ theorem globalFirstFiniteEnergy_integral_sum (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) (χ : RayCharacter) (r : FirstCoreIndex) (T : GlobalFirstData ι → Finset O) (J : ℕ) : (∫ t,firstLogDensity J t*globalFirstFiniteEnergy p hg pool s w Ψ m g V ell side χ r T t) = ∑ d∈s,w d*∫ t,firstLogDensity J t*∑ z∈T d,‖globalFirstCoreRow p hg pool Ψ m g V ell side χ r t d z‖^2 := by have hi (d : GlobalFirstData ι) : Integrable (fun t => firstLogDensity J t* ∑ z∈T d,‖globalFirstCoreRow p hg pool Ψ m g V ell side χ r t d z‖^2) := by simpa only [globalFirstFiniteEnergy,Finset.sum_singleton,one_mul] using globalFirstFiniteEnergy_integrable p hg pool {d} (fun _ => 1) Ψ m g V ell side χ r T J have he (t : ℝ) : firstLogDensity J t*globalFirstFiniteEnergy p hg pool s w Ψ m g V ell side χ r T t = ∑ d∈s,w d*(firstLogDensity J t*∑ z∈T d,‖globalFirstCoreRow p hg pool Ψ m g V ell side χ r t d z‖^2) := by simp only [globalFirstFiniteEnergy,Finset.mul_sum,mul_left_comm] simp_rw [he] rw [integral_finsetSum _ (fun d hd => (hi d).const_mul (w d))] simp only [integral_const_mul] theorem globalCubeInputFamilyEnergy_eq_integrated_rows (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (w : GlobalCubeBlock ι → ℝ) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ,ℂ)) (K ell B F : ℝ) (side : Bool) (J : ℕ) (T : GlobalCubeBlock ι → Finset O) : letI := @OAI.RayFourExpansion.rayCharacterFintype (∑ b∈blocks,w b*globalCubeCoefficient p K ell B F side b* globalCubeInputFamilyEnergy p hg pool b Ψ m g V ell side J (T b)) = ∑ a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖*∑ r : FirstCoreIndex, ∫ t,firstLogDensity J t*globalFirstFiniteEnergy p hg pool (globalFirstFamilySet pool blocks) (fun d => globalFirstFamilyWeight p hg w Ψ m side r d*globalFirstCoefficient p K ell B F side d) Ψ m g V ell side (if side then a.1 else a.2) r (fun d => T d.block) t := by letI := @OAI.RayFourExpansion.rayCharacterFintype simp_rw [globalFirstFiniteEnergy_integral_sum, sum_globalFirstFamilySet] simp only [globalCubeInputFamilyEnergy,firstInputFamilyEnergy,Finset.mul_sum] conv_lhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro a ha conv_lhs => arg 2; ext b; rw [Finset.sum_comm] conv_lhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro r hr apply Finset.sum_congr rfl intro b hb apply Finset.sum_congr rfl intro D hD rw [globalFirstCoefficient_block] simp only [globalFirstFamilyWeight,GlobalCubeBlock.withCommon, GlobalFirstData.block,globalFirstCoreRow,globalCubePool,globalCubeColumnScale,globalFirstBlockColumnScale] ring end open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct) open ConcreteTraceCRT (eisEmbedding) open SecondPassIntegration (densityChildEnergy) theorem globalChild_large_radial_bound (deltaLoss : ℝ) (hδ : 0 Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (Ψ : O →* ℂ) (m : O) (V₁ V₂ : ℝ → ℂ) (C K ell B F M H U Z θ A₀ Vmax : ℝ) (N J : ℕ) (source : Finset (GlobalSecondData ι)) (side : Bool), letI := @OAI.RayFourExpansion.rayCharacterFintype 0≤C → 1≤U → 0 Z^θ≤globalBinRadial ell (globalPooledRowScale K ell B F j) j), ∑ ray : SecondRayIndex,∑ q∈globalBinTriples p source side j, globalDescentWeight C η 0 0 K ell B F (N+1) (2*J) j ray q * (densityChildEnergy p hp hcop hg pool (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fixedTripleMask m q) (globalArithmeticTargets p source side q j) V₁ V₂ (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) (2*J) / (globalPooledColumnScale ell j*globalPooledLabelScale j))) ≤ C*Cbox*(globalTerminalConstant A₀ Vmax*globalRayTripleConstant)*K*((ell*B^3)*F)* U^(deltaLoss+8*η)/Z^(θ*N) := by letI := @OAI.RayFourExpansion.rayCharacterFintype obtain ⟨Cbox,hCbox,hdecay⟩ := globalLogBox_radial_decay deltaLoss hδ η hη.le refine ⟨Cbox,hCbox,?_⟩ intro ι _ p hp _ hcop hg hc hinj pool Ψ m V₁ V₂ C K ell B F M H U Z θ A₀ Vmax N J source side hC hU hK hell hB hF hH hKU hellU hBU hHU heU hZ hA₀ hVmax hV₁ hV₂ hVs₁ hVs₂ hΨ hk hb₁ hb₂ let Q := C*(globalTerminalConstant A₀ Vmax*globalRayTripleConstant)*K*((ell*B^3)*F) have hQ : 0≤Q := by have hc0 := globalTerminalConstant_nonneg A₀ Vmax have hB0 := zero_lt_one.trans_le hB have hF0 := zero_lt_one.trans_le hF unfold Q globalRayTripleConstant positivity calc _ ≤ ∑ j∈(globalLogBox (globalNormCaps ell B (globalRowScaleFloor K ell B F M) M H)).filter (fun j => Z^θ≤globalBinRadial ell (globalPooledRowScale K ell B F j) j), Q*((globalBinLossScale B j)^η/(1+globalBinRadial ell (globalPooledRowScale K ell B F j) j)^N) := by apply Finset.sum_le_sum intro j hj have ht := globalRadialBin_terminal_bound_all_bins p hp hcop hg hc hinj pool Ψ hΨ m V₁ V₂ C η 0 0 K ell B F A₀ Vmax N J hC hη hK hell hB hF hA₀ hVmax hV₁ hV₂ hVs₁ hVs₂ source side j hk hb₁ hb₂ apply ht.trans_eq simp only [norm_zero,add_zero,one_pow,mul_one,Q] ring _ = Q*(∑ j∈(globalLogBox (globalNormCaps ell B (globalRowScaleFloor K ell B F M) M H)).filter (fun j => Z^θ≤globalBinRadial ell (globalPooledRowScale K ell B F j) j), (globalBinLossScale B j)^η/(1+globalBinRadial ell (globalPooledRowScale K ell B F j) j)^N) := by rw [Finset.mul_sum] _ ≤ Q*(Cbox*U^(deltaLoss+8*η)/Z^(θ*N)) := mul_le_mul_of_nonneg_left (hdecay K ell B F M H U Z θ N hU hK hell hB hF hH hKU hellU hBU hHU heU hZ) hQ _ = _ := by dsimp [Q];ring end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap namespace InitialMeanSquare open ActualEisensteinCubic SecondPassArithmetic open FirstCauchyArithmetic (supportMobius supportConjugateSum) open ConcreteTraceCRT (eisEmbedding) def conjugateMonoid (Ψ : O→*ℂ) : O→*ℂ where toFun x := star (Ψ x) map_one' := by simp map_mul' x y := by simp [map_mul] variable {ι : Type*} [DecidableEq ι] (p : ι→O) [∀i,(Ideal.span {p i}).IsMaximal] (hg : ∀i,lambda∉Ideal.span {p i}) def mobiusRow (F : Finset ι) (Ψ : O→*ℂ) (m : O) (H : Finset ι→ℂ) (z : O) : ℂ := ∑S∈F.powerset,supportMobius (fun i => Ideal.span {p i}) S* inputColumn p Ψ m 1 H S*finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S z lemma star_mobiusRow (F : Finset ι) (Ψ : O→*ℂ) (m : O) (H : Finset ι→ℂ) (z : O) : star (mobiusRow p hg F Ψ m H z)= inputConjugateRow p hg F (conjugateMonoid Ψ) m 1 1 (fun S => star (H S)) z := by unfold mobiusRow inputConjugateRow supportConjugateSum rw [star_sum] apply Finset.sum_congr rfl intro S hS have hm : star (rowCoprimeMask (fun i => Ideal.span {p i}) S m)=rowCoprimeMask (fun i => Ideal.span {p i}) S m := by unfold rowCoprimeMask split_ifs <;> simp simp only [star_mul,FirstCauchyArithmetic.star_supportMobius, inputColumn,secondInputCoefficient,conjugateMonoid,MonoidHom.coe_mk,OneHom.coe_mk, mul_one,hm] simp only [finiteSquarefreeRow,Finset.prod_const_one,one_pow,map_one,mul_one] ring lemma mobiusRow_norm (F : Finset ι) (Ψ : O→*ℂ) (m : O) (H : Finset ι→ℂ) (z : O) : ‖mobiusRow p hg F Ψ m H z‖= ‖inputConjugateRow p hg F (conjugateMonoid Ψ) m 1 1 (fun S => star (H S)) z‖ := by rw [←star_mobiusRow p hg F Ψ m H z,norm_star] variable (hp : ∀i,p i≠0) (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) include hc theorem mobiusRow_smoothed_source (F : Finset ι) (Ψ : O→*ℂ) (m : O) (H : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (Y : ℝ) (hY : 0 star (H S)) W Y (fun G E => (K G E).erase 0)+ truncatedSecondZero p hg F (conjugateMonoid Ψ) m 1 1 (fun S => star (H S)) W Y K+ secondSourceTail p hp hg hinj F (conjugateMonoid Ψ) m 1 1 (fun S => star (H S)) W Y K := by simp_rw [mobiusRow_norm p hg] rw [inputConjugateRow_eq_truncated_add_tail p hp hg hinj hc F (conjugateMonoid Ψ) m 1 1 (fun S => star (H S)) W Y hY K] rw [truncatedSecondSource_eq_nonzero_add_zero p hp hg hinj] theorem mobiusRow_finite_source (F : Finset ι) (Ψ : O→*ℂ) (m : O) (H : Finset ι→ℂ) (Y : ℝ) (hY : 0 star (H S)) rowMajorant Y (fun G E => (K G E).erase 0)‖+ (truncatedSecondZero p hg F (conjugateMonoid Ψ) m 1 1 (fun S => star (H S)) rowMajorant Y K).re+ ‖secondSourceTail p hp hg hinj F (conjugateMonoid Ψ) m 1 1 (fun S => star (H S)) rowMajorant Y K‖-‖H ∅‖^2 := by have hb := finite_nonzero_row_energy_le_majorant (inputConjugateRow p hg F (conjugateMonoid Ψ) m 1 1 (fun S => star (H S))) T Y hY hT hT0 rw [inputConjugateRow_nonzero_correction p hg F (conjugateMonoid Ψ) m 1 1 (fun S => star (H S)) Y hY] at hb have he := mobiusRow_smoothed_source p hg hp hinj hc F Ψ m H rowMajorant Y hY K simp_rw [mobiusRow_norm p hg] at he ⊢ change (∑'z:O,rowMajorant (‖eisEmbedding z‖^2/Y)* (‖inputConjugateRow p hg F (conjugateMonoid Ψ) m 1 1 (fun S => star (H S)) z‖^2:ℝ))=_ at he rw [he,Complex.sub_re,Complex.add_re,Complex.add_re,Complex.ofReal_re,norm_star] at hb exact hb.trans (by gcongr <;> exact Complex.re_le_norm _) end InitialMeanSquare open scoped BigOperators Classical namespace CompletedGauss section open ActualEisensteinCubic CanonicalQuadraticSieve QuadraticSquarefreeKernel UniqueFactorizationMonoid def PowerfulIdeal (I : Ideal O) : Prop := I≠0 ∧ ∀P∈normalizedFactors I, 2≤(normalizedFactors I).count P theorem powerful_squarefree_dvd_squarePart (I : Ideal O) (hI : PowerfulIdeal I) : squarefreePart I ∣ squarePart I := by have ha := squarePart_ne_zero hI.1 have hb := (squarefree_squarefreePart I).ne_zero apply (dvd_iff_normalizedFactors_le_normalizedFactors hb ha).mpr apply Multiset.le_iff_count.mpr intro P have he := congrArg normalizedFactors (squarePart_sq_mul_squarefreePart I) rw [normalizedFactors_mul (pow_ne_zero _ ha) hb,normalizedFactors_pow] at he have hc := congrArg (Multiset.count P) he simp only [Multiset.count_add,Multiset.count_nsmul] at hc have hsf := Multiset.nodup_iff_count_le_one.mp ((squarefree_iff_nodup_normalizedFactors hb).mp (squarefree_squarefreePart I)) P by_cases hzero : (normalizedFactors (squarefreePart I)).count P=0 · omega · have hm : P∈normalizedFactors I := Multiset.count_pos.mp (by omega) have hp := hI.2 P hm omega theorem powerful_exists_square_cube (I : Ideal O) (hI : PowerfulIdeal I) : ∃A : Ideal O, A≠0 ∧ A^2*squarefreePart I ^3=I := by obtain ⟨A,hA⟩ := powerful_squarefree_dvd_squarePart I hI have ha : A≠0 := by intro hz have h := squarePart_ne_zero hI.1 apply h rw [hA,hz,mul_zero] refine ⟨A,ha,?_⟩ calc _ = (squarefreePart I*A)^2*squarefreePart I := by ring _ = squarePart I ^2*squarefreePart I := by rw [←hA] _ = I := squarePart_sq_mul_squarefreePart I def powerfulBase (I : Ideal O) : Ideal O := if hI : PowerfulIdeal I then (powerful_exists_square_cube I hI).choose else 0 theorem powerfulBase_spec (I : Ideal O) (hI : PowerfulIdeal I) : powerfulBase I≠0 ∧ powerfulBase I ^2*squarefreePart I ^3=I := by rw [powerfulBase,dif_pos hI] exact (powerful_exists_square_cube I hI).choose_spec theorem powerfulBase_injective_on_fiber (I J : Ideal O) (hI : PowerfulIdeal I) (hJ : PowerfulIdeal J) (hb : squarefreePart I=squarefreePart J) (ha : powerfulBase I=powerfulBase J) : I=J := by rw [←(powerfulBase_spec I hI).2,←(powerfulBase_spec J hJ).2,ha,hb] end open ActualEisensteinCubic CanonicalQuadraticSieve QuadraticSquarefreeKernel end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.PowerfulParts namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical namespace CompletedGauss section open ActualEisensteinCubic CanonicalQuadraticSieve QuadraticSquarefreeKernel UniqueFactorizationMonoid def rowPowerfulPart (I : Ideal O) : Ideal O := ((normalizedFactors I).filter (fun P => 2≤(normalizedFactors I).count P)).prod def rowSimplePart (I : Ideal O) : Ideal O := ((normalizedFactors I).filter (fun P => ¬2≤(normalizedFactors I).count P)).prod theorem rowPowerfulPart_ne_zero (I : Ideal O) : rowPowerfulPart I≠0 := Multiset.prod_ne_zero (fun h => zero_notMem_normalizedFactors I (Multiset.mem_filter.mp h).1) theorem rowSimplePart_ne_zero (I : Ideal O) : rowSimplePart I≠0 := Multiset.prod_ne_zero (fun h => zero_notMem_normalizedFactors I (Multiset.mem_filter.mp h).1) theorem normalizedFactors_rowPowerfulPart (I : Ideal O) : normalizedFactors (rowPowerfulPart I)= (normalizedFactors I).filter (fun P => 2≤(normalizedFactors I).count P) := normalizedFactors_prod_of_prime (fun P hP => prime_of_normalized_factor P (Multiset.mem_filter.mp hP).1) theorem normalizedFactors_rowSimplePart (I : Ideal O) : normalizedFactors (rowSimplePart I)= (normalizedFactors I).filter (fun P => ¬2≤(normalizedFactors I).count P) := normalizedFactors_prod_of_prime (fun P hP => prime_of_normalized_factor P (Multiset.mem_filter.mp hP).1) theorem rowPowerfulPart_powerful (I : Ideal O) : PowerfulIdeal (rowPowerfulPart I) := by refine ⟨rowPowerfulPart_ne_zero I,?_⟩ intro P hP rw [normalizedFactors_rowPowerfulPart] at hP ⊢ have hp := (Multiset.mem_filter.mp hP).2 rw [Multiset.count_filter,if_pos hp] exact hp theorem rowSimplePart_squarefree (I : Ideal O) : Squarefree (rowSimplePart I) := by apply (squarefree_iff_nodup_normalizedFactors (rowSimplePart_ne_zero I)).mpr rw [normalizedFactors_rowSimplePart] apply Multiset.nodup_iff_count_le_one.mpr intro P rw [Multiset.count_filter] split_ifs <;> omega theorem row_powerful_simple_product (I : Ideal O) (hI : I≠0) : rowPowerfulPart I*rowSimplePart I=I := by rw [rowPowerfulPart,rowSimplePart,←Multiset.prod_add,Multiset.filter_add_not] exact Ideal.prod_normalizedFactors_eq_self hI end open ActualEisensteinCubic CanonicalQuadraticSieve UniqueFactorizationMonoid def squarefreeMaskPart (I R : Ideal O) : Ideal O := ((normalizedFactors I).filter (fun P => P∣R)).prod def squarefreeResidualPart (I R : Ideal O) : Ideal O := ((normalizedFactors I).filter (fun P => ¬P∣R)).prod theorem squarefreeMaskPart_ne_zero (I R : Ideal O) : squarefreeMaskPart I R≠0 := Multiset.prod_ne_zero (fun h => zero_notMem_normalizedFactors I (Multiset.mem_filter.mp h).1) theorem squarefreeResidualPart_ne_zero (I R : Ideal O) : squarefreeResidualPart I R≠0 := Multiset.prod_ne_zero (fun h => zero_notMem_normalizedFactors I (Multiset.mem_filter.mp h).1) theorem normalizedFactors_squarefreeMaskPart (I R : Ideal O) : normalizedFactors (squarefreeMaskPart I R)=(normalizedFactors I).filter (fun P => P∣R) := normalizedFactors_prod_of_prime (fun P hP => prime_of_normalized_factor P (Multiset.mem_filter.mp hP).1) theorem normalizedFactors_squarefreeResidualPart (I R : Ideal O) : normalizedFactors (squarefreeResidualPart I R)=(normalizedFactors I).filter (fun P => ¬P∣R) := normalizedFactors_prod_of_prime (fun P hP => prime_of_normalized_factor P (Multiset.mem_filter.mp hP).1) theorem squarefreeResidualPart_squarefree (I R : Ideal O) (hI : Squarefree I) : Squarefree (squarefreeResidualPart I R) := by apply (squarefree_iff_nodup_normalizedFactors (squarefreeResidualPart_ne_zero I R)).mpr rw [normalizedFactors_squarefreeResidualPart] exact ((squarefree_iff_nodup_normalizedFactors hI.ne_zero).mp hI).filter _ theorem squarefree_mask_residual_product (I R : Ideal O) (hI : I≠0) : squarefreeMaskPart I R*squarefreeResidualPart I R=I := by rw [squarefreeMaskPart,squarefreeResidualPart,←Multiset.prod_add,Multiset.filter_add_not] exact Ideal.prod_normalizedFactors_eq_self hI theorem squarefreeResidualPart_coprime (I R : Ideal O) : IsCoprime (squarefreeResidualPart I R) R := by apply ideals_coprime_of_relprime apply (isRelPrime_iff_no_prime_factors (squarefreeResidualPart_ne_zero I R)).mpr intro P hp hr hP have hm := (UniqueFactorizationMonoid.mem_normalizedFactors_iff (squarefreeResidualPart_ne_zero I R)).mpr ⟨hP,hp⟩ rw [normalizedFactors_squarefreeResidualPart] at hm exact (Multiset.mem_filter.mp hm).2 hr theorem squarefreeMaskPart_dvd (I R : Ideal O) (hI : Squarefree I) : squarefreeMaskPart I R∣R := by by_cases hR : R=0 · rw [hR]; exact dvd_zero _ apply (dvd_iff_normalizedFactors_le_normalizedFactors (squarefreeMaskPart_ne_zero I R) hR).mpr rw [normalizedFactors_squarefreeMaskPart] apply Multiset.le_iff_count.mpr intro P rw [Multiset.count_filter] split_ifs with hp · have hn := Multiset.nodup_iff_count_le_one.mp ((squarefree_iff_nodup_normalizedFactors hI.ne_zero).mp hI) P by_cases hz : (normalizedFactors I).count P=0 · omega · have hm := Multiset.count_pos.mp (Nat.pos_of_ne_zero hz) have hr := (UniqueFactorizationMonoid.mem_normalizedFactors_iff hR).mpr ⟨prime_of_normalized_factor P hm,hp⟩ have hc := Multiset.count_pos.mpr hr omega · omega def rowMaskPart (I R : Ideal O) : Ideal O := squarefreeMaskPart (rowSimplePart I) R def rowResidualPart (I R : Ideal O) : Ideal O := squarefreeResidualPart (rowSimplePart I) R theorem row_powerful_mask_residual_product (I R : Ideal O) (hI : I≠0) : rowPowerfulPart I*rowMaskPart I R*rowResidualPart I R=I := by rw [mul_assoc,rowMaskPart,rowResidualPart,squarefree_mask_residual_product _ _ (rowSimplePart_ne_zero I), row_powerful_simple_product I hI] theorem rowMaskPart_dvd (I R : Ideal O) : rowMaskPart I R∣R := squarefreeMaskPart_dvd _ _ (rowSimplePart_squarefree I) theorem rowResidualPart_squarefree (I R : Ideal O) : Squarefree (rowResidualPart I R) := squarefreeResidualPart_squarefree _ _ (rowSimplePart_squarefree I) theorem rowResidualPart_admissible (I R : Ideal O) (hbad : ∀P∈fixedBadPrimes,P∣R) : Admissible (rowResidualPart I R) := admissible_of_squarefree_coprime_bad _ R (rowResidualPart_squarefree I R) (squarefreeResidualPart_coprime (rowSimplePart I) R) hbad theorem rowResidualPart_prime_exponent (I R P : Ideal O) (hP : P∈normalizedFactors (rowResidualPart I R)) : P∈normalizedFactors I ∧ (normalizedFactors I).count P=1 ∧ ¬P∣R := by rw [rowResidualPart,normalizedFactors_squarefreeResidualPart] at hP obtain ⟨hs,hr⟩ := Multiset.mem_filter.mp hP rw [normalizedFactors_rowSimplePart] at hs obtain ⟨hi,hcount⟩ := Multiset.mem_filter.mp hs exact ⟨hi,by have hp := Multiset.count_pos.mpr hi; omega,hr⟩ theorem rowResidualPart_norm (I R : Ideal O) (hI : I≠0) : (Ideal.absNorm (rowResidualPart I R):ℝ)=(Ideal.absNorm I:ℝ)/ ((Ideal.absNorm (rowPowerfulPart I):ℝ)*(Ideal.absNorm (rowMaskPart I R):ℝ)) := by have hp : (Ideal.absNorm (rowPowerfulPart I):ℝ)≠0 := by exact_mod_cast (fun hz => rowPowerfulPart_ne_zero I (Ideal.absNorm_eq_zero_iff.mp hz)) have ht : (Ideal.absNorm (rowMaskPart I R):ℝ)≠0 := by exact_mod_cast (fun hz => squarefreeMaskPart_ne_zero (rowSimplePart I) R (Ideal.absNorm_eq_zero_iff.mp hz)) apply (eq_div_iff (mul_ne_zero hp ht)).mpr have he := congrArg (fun J : Ideal O => (Ideal.absNorm J:ℝ)) (row_powerful_mask_residual_product I R hI) simpa only [map_mul,Nat.cast_mul,mul_comm] using he end CompletedGauss namespace SecondPassArithmetic section open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct firstLogDensity) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter crossCoeff gCoeff) def firstCoreUniformWeight (r : FirstCoreIndex) : ℝ := ‖crossCoeff r.1 r.2.1‖*‖gCoeff r.2.2‖ section variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i,(Ideal.span {p i}).IsMaximal] (hg : ∀ i,lambda ∉ Ideal.span {p i}) def GlobalCubeAdmissible (b : GlobalCubeBlock ι) : Prop := b.cube.Admissible ∧ Disjoint b.common b.cube.support ∧ b.firstDivisor⊆b.common∪b.cube.support theorem globalFirstFamilyWeight_bounds (blocks : Finset (GlobalCubeBlock ι)) (w : GlobalCubeBlock ι → ℝ) (Γ : ℝ) (hw : ∀ b∈blocks,0≤w b ∧ w b≤Γ) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖≤1) (m : O) (side : Bool) (r : FirstCoreIndex) (pool : Finset ι) (d : GlobalFirstData ι) (hd : d∈globalFirstFamilySet pool blocks) : 0≤globalFirstFamilyWeight p hg w Ψ m side r d ∧ globalFirstFamilyWeight p hg w Ψ m side r d≤Γ*firstCoreUniformWeight r := by have hw' := hw d.block ((mem_globalFirstFamilySet pool blocks d).mp hd).1 constructor · exact mul_nonneg hw'.1 (norm_nonneg _) · have h1 := firstCoreOuter_norm_le p hg d.cube.support (fun i => d.cube.leftExponent i+d.cube.rightExponent i) d.cube.leftBit d.cube.rightBit side Ψ m d.firstCommon r have h2 := FirstPassCubeLabels.coreRayCoefficient_norm_le p (FirstPassCubeLabels.cubeOddSupport d.cube.support (fun i => d.cube.leftExponent i+d.cube.rightExponent i) d.cube.leftBit d.cube.rightBit) side r.1 r.2.1 r.2.2 have hnorm : ‖firstCoreOuter p hg d.cube.support (fun i => d.cube.leftExponent i+d.cube.rightExponent i) d.cube.leftBit d.cube.rightBit side Ψ m d.firstCommon r‖≤firstCoreUniformWeight r := (h1.trans (mul_le_of_le_one_right (norm_nonneg _) (hΨ _))).trans h2 exact mul_le_mul hw'.2 hnorm (norm_nonneg _) (hw'.1.trans hw'.2) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalFirstPooledRow_block (K ell B F : ℝ) (side : Bool) (d : GlobalFirstData ι) : globalFirstPooledRow p K ell B F side d= globalFirstPooledRow p K ell B F side (d.block.withCommon ∅) := by simp [globalFirstPooledRow,globalPooledRowScale,globalFirstIndex,globalLogRep,globalScaleIndex, globalScaleVector,GlobalFirstData.append,GlobalFirstData.block,GlobalCubeBlock.withCommon,globalCubeJNorm] end theorem firstCoreUniformWeight_mass : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype (∑ r : FirstCoreIndex,firstCoreUniformWeight r)≤512*32 := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype simp only [firstCoreUniformWeight,Fintype.sum_prod_type] simp_rw [← Finset.mul_sum] simp_rw [← Finset.sum_mul] exact mul_le_mul RayFourExpansion.crossCoeff_sum_norm_le RayFourExpansion.gCoeff_sum_norm_le (Finset.sum_nonneg (fun _ _ => norm_nonneg _)) (by norm_num) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) end end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm actualFirstKernel originalLabelColumn cubeActiveSupport dilationLabel columnLog) open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) include hp in omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalCubeColumnScale_pos (ell : ℝ) (hell : 0 b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit,p i)‖) ≤ globalCubeCoefficient p K ell B F true b := by have h := globalBin_first_coefficient_bound p hp K ell B F hK.le hell hB hF true ((b.withCommon ∅).append ⟨∅,∅,∅,1⟩) (by exact one_ne_zero) change K/(primeProductNorm p b.firstDivisor*ell*B^2*F* ‖eisEmbedding (∏ i∈cubeActiveSupport b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit,p i)‖) ≤ _ at h change _ ≤ globalCubeCoefficient p K ell B F true b at h convert h using 1 ; ring end end open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct dilationLabel) open ConcreteTraceCRT (eisEmbedding) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.SourceTransfer namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap ContDiff namespace InitialMeanSquare section open ActualEisensteinCubic SecondPassArithmetic open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog) open JointLogSeparation (halfNormalizationCLM) open ConcreteTraceCRT (eisEmbedding) open SecondPassIntegration (elementNorm) section variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) def residualScale (Z : ℝ) (x : SecondExpansionData ι) : ℝ := Z/(elementNorm (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor)* elementNorm (secondExpansionQuotient p x)) def sourceWeight (Ψ : O→*ℂ) (m : O) (ray : SecondRayIndex) (Z H : ℝ) (x : SecondExpansionData ι) : ℂ := secondNormalizedExpansionWeight p hp hcop hg Ψ m 1 1 ray Z H x * (residualScale p Z x : ℂ)⁻¹ theorem sourceWeight_norm_le (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (Ψ : O→*ℂ) (m : O) (ray : SecondRayIndex) (Z H : ℝ) (x : SecondExpansionData ι) (hZ : 0 Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hpr : ∀i,lambda^2∣p i-1) (F : Finset ι) (Ψ : O→*ℂ) (m : O) (ray : SecondRayIndex) (x : SecondExpansionData ι) (Z H E V₀ X₀ K : ℝ), x.divisor⊆x.sourceCommon → x.frequency≠0 → 0 Ideal.span {p i}) x.divisor let r := secondExpansionQuotient p x let X := residualScale p Z x let z := Real.log (primeProductNorm p x.overlap*X₀/X) let ue := Real.log (elementNorm e/E) let uv := Real.log (primeProductNorm p x.overlap/V₀) let kap := Real.log (elementNorm (e*x.frequency)/K) |z|≤B → |ue|≤B → |uv|≤B → |kap|≤B → secondExpansionSource p hp hcop hg F Ψ m 1 1 ray {x} (fun S => normalizedColumn p (fun T => g₁ (columnLog p Z T)) S) (fun S => normalizedColumn p (fun T => g₂ (columnLog p Z T)) S) W H = sourceWeight p hp hcop hg Ψ m ray Z H x * postCommonSmoothPair p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (e*∏i∈x.overlap,p i) (e*x.frequency) (-(e*x.frequency)) A₁ A₂ W windows z 0 ue uv kap X₀ X₀ (H*K/(E^2*V₀^2*X₀^2)) := by have h1 := SecondPassIntegration.halfNormalization_support_bound U hUc hUs g₁ A hg₁ have h2 := SecondPassIntegration.halfNormalization_support_bound U hUc hUs g₂ A hg₂ obtain ⟨A₁,A₂,windows,hwc,hws,hwb,hid⟩ := SecondPassIntegration.full_uniform_normalized_child_tests (halfNormalizationCLM U g₁) (halfNormalizationCLM U g₂) W A B hA hB h1 h2 refine ⟨A₁,A₂,windows,hwc,hws,hwb,?_⟩ intro ι _ p hp _ hcop hg hinj hpr F Ψ m ray x Z H E V₀ X₀ K hE hk hZ hEs hV hX₀ hK dsimp only intro hz hue huv hkap let e := primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor let r := secondExpansionQuotient p x have he : e≠0 := primeSubsetGenerator_ne_zero _ _ have hq : secondMaskQuotient p x.divisor x.sourceCommon hE=r := (secondExpansionQuotient_of_subset p x hE).symm have hr : r≠0 := by rw [←hq] intro hr0 have hs := secondMaskQuotient_spec p x.divisor x.sourceCommon hE rw [hr0,mul_zero] at hs exact (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i)) hs have hX : 0 Ideal.span {a}) hq) Z H hZ U hUc hUs g₁ g₂ W hU₁ hU₂ dsimp only at hnorm have hnormone : elementNorm (1:O)=1 := by simp [elementNorm] have hid' := hid p hp hcop hg 1 E V₀ (residualScale p Z x) X₀ K H (by norm_num) hEs hV hX hX₀ hK F x.overlap (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) m r 1 1 e x.frequency one_ne_zero he hk hz (by simpa only [hnormone,div_one,Real.log_one,abs_zero] using hB) hue huv (by simpa only [one_mul] using hkap) simp only [one_mul,mul_neg,hnormone,div_one,Real.log_one] at hid' have hscale : Z/(‖eisEmbedding e‖^2*‖eisEmbedding r‖^2)=residualScale p Z x := rfl rw [hscale,hid'] at hnorm rw [hq] at hnorm have hgoal := congrArg (fun t:ℂ => ((H:ℂ)*secondSourceCommonCoefficient p hg Ψ m 1 1 x.sourceCommon x.divisor)*t) hnorm simp only [secondExpansionSource,Finset.sum_singleton,sourceWeight, secondNormalizedExpansionWeight,e,r,mul_assoc] at hgoal ⊢ exact hgoal end open ActualEisensteinCubic SecondPassArithmetic IdealMobiusDivisorSum open ConcretePrimeRowBridge (idealGenerator span_idealGenerator) section variable {ι : Type*} [DecidableEq ι] (p : ι→O) [∀i,(Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) def sourceElementData (x : SecondExpansionData ι) : ElementDatum where divisor := ∏i∈x.divisor,Ideal.span {p i} shared := ∏i∈x.overlap,p i frequency := x.frequency def sourceObservation (x : SecondExpansionData ι) : O×O := (primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor*x.frequency, primeSubsetGenerator (fun i => Ideal.span {p i}) x.divisor*∏i∈x.overlap,p i) include hinj in theorem sourceElementData_injective (r : O) : Set.InjOn (sourceElementData p) {x | InSecondQuotientSector p r x} := by intro x hx y hy heq have hE := congrArg ElementDatum.divisor heq have hV := congrArg ElementDatum.shared heq have hk := congrArg ElementDatum.frequency heq have he : x.divisor=y.divisor := FirstCauchyArithmetic.family_product_injective _ hinj hE have hv : x.overlap=y.overlap := by apply FirstCauchyArithmetic.family_product_injective _ hinj have hh := congrArg (fun a:O => Ideal.span {a}) hV simpa only [sourceElementData,FiniteGaussPhase.span_finset_prod] using hh apply expansionSupportData_injOn p hinj ∅ ∅ r hx hy exact SecondSupportData.ext rfl rfl he hv hk include hinj in theorem source_fiber_card_le (r : O) (s : Finset (SecondExpansionData ι)) (hs : ∀x∈s,InSecondQuotientSector p r x) (y f : O) (hy : y≠0) : (s.filter (fun x => sourceObservation p x=(y,f))).card≤ (idealDivisors (Ideal.span {y})).card := by let : DecidableEq ElementDatum := instDecidableEqElementDatum have hmap : (s.filter (fun x => sourceObservation p x=(y,f))).card≤ ((s.image (sourceElementData p)).filter (fun x => elementObservation idealGenerator x=(y,f))).card := by apply Finset.card_le_card_of_injOn (sourceElementData p) · intro x hx refine Finset.mem_filter.mpr ⟨Finset.mem_image.mpr ⟨x,(Finset.mem_filter.mp hx).1,rfl⟩,?_⟩ exact (Finset.mem_filter.mp hx).2 · intro x hx y hy he exact sourceElementData_injective p hinj r (hs x (Finset.mem_filter.mp hx).1) (hs y (Finset.mem_filter.mp hy).1) he exact hmap.trans (element_fiber_card_le idealGenerator span_idealGenerator _ y f hy) end theorem source_weighted_energy_pushforward (ε : ℝ) (hε : 0<ε) : ∃ C : ℝ,0 Ideal.span {p i})) (r : O) (s : Finset (SecondExpansionData ι)) (t : Finset (O×O)) (w : SecondExpansionData ι→ℂ) (P : O×O→ℂ) (A K : ℝ), 0≤A → 0≤K → (∀x∈s,InSecondQuotientSector p r x) → (∀x∈s,sourceObservation p x∈t) → (∀y∈t,y.1≠0) → (∀y∈t,(Ideal.absNorm (Ideal.span {y.1}):ℝ)≤K) → (∀x∈s,‖w x‖≤A) → (∑x∈s,‖w x‖*‖P (sourceObservation p x)‖^2)≤A*C*K^ε*∑y∈t,‖P y‖^2 := by obtain ⟨C,hC,hdiv⟩ := IdealDivisorBound.ideal_divisor_small_power ε hε refine ⟨C,hC,?_⟩ intro ι _ p _ hinj r s t w P A K hA hK hs hmap ht hnorm hw apply (DescentWeightedCauchy.bounded_energy_pushforward s t (sourceObservation p) w P A hmap hw).trans rw [Finset.mul_sum] apply Finset.sum_le_sum intro y hy have hyI : (Ideal.span {y.1}:Ideal O)≠0 := by intro hz; exact ht y hy (Ideal.span_singleton_eq_bot.mp hz) have hcard : ((s.filter (fun x => sourceObservation p x=y)).card:ℝ)≤C*K^ε := by calc _ ≤ ((idealDivisors (Ideal.span {y.1})).card:ℝ) := by exact_mod_cast source_fiber_card_le p hinj r s hs y.1 y.2 (ht y hy) _ ≤ C*(Ideal.absNorm (Ideal.span {y.1}):ℝ)^ε := hdiv _ hyI _ ≤ C*K^ε := mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (Nat.cast_nonneg _) (hnorm y hy) hε.le) hC.le have hh := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hcard hA) (sq_nonneg ‖P y‖) simpa only [mul_assoc] using hh theorem source_weighted_cauchy (ε : ℝ) (hε : 0<ε) : ∃ C : ℝ,0 Ideal.span {p i})) (r : O) (s : Finset (SecondExpansionData ι)) (t : Finset (O×O)) (w : SecondExpansionData ι→ℂ) (P Q : O×O→ℂ) (A K : ℝ), 0≤A → 0≤K → (∀x∈s,InSecondQuotientSector p r x) → (∀x∈s,sourceObservation p x∈t) → (∀y∈t,y.1≠0) → (∀y∈t,(Ideal.absNorm (Ideal.span {y.1}):ℝ)≤K) → (∀x∈s,‖w x‖≤A) → ‖∑x∈s,w x*P (sourceObservation p x)*star (Q (sourceObservation p x))‖≤ A*C*K^ε*Real.sqrt (∑y∈t,‖P y‖^2)*Real.sqrt (∑y∈t,‖Q y‖^2) := by obtain ⟨C,hC,hpool⟩ := source_weighted_energy_pushforward ε hε refine ⟨C,hC,?_⟩ intro ι _ p _ hinj r s t w P Q A K hA hK hs hmap ht hnorm hw have hP := hpool p hinj r s t w P A K hA hK hs hmap ht hnorm hw have hQ := hpool p hinj r s t w Q A K hA hK hs hmap ht hnorm hw have hD : 0≤A*C*K^ε := by positivity apply (DescentWeightedCauchy.weighted_cauchy s w (fun x => P (sourceObservation p x)) (fun x => Q (sourceObservation p x))).trans calc _ ≤ Real.sqrt (A*C*K^ε*∑y∈t,‖P y‖^2)*Real.sqrt (A*C*K^ε*∑y∈t,‖Q y‖^2) := by gcongr _ = _ := by rw [Real.sqrt_mul hD,Real.sqrt_mul hD] calc _ = (Real.sqrt (A*C*K^ε))^2*Real.sqrt (∑y∈t,‖P y‖^2)*Real.sqrt (∑y∈t,‖Q y‖^2) := by ring _ = _ := by rw [Real.sq_sqrt hD] end InitialMeanSquare namespace CubicEisenstein section open Filter MeasureTheory LineDeriv open scoped BigOperators Classical Topology SchwartzMap LineDeriv abbrev EuclideanL2 := Lp ℂ 2 (volume : Measure EuclideanSpatial) abbrev EuclideanGradientL2 := PiLp 2 (fun _ : Fin 3 => EuclideanL2) example : InnerProductSpace ℂ EuclideanGradientL2 := inferInstance example : CompleteSpace EuclideanGradientL2 := inferInstance abbrev EuclideanDistributions := TemperedDistribution EuclideanSpatial ℂ def euclideanCoordinateVector (j : Fin 3) : EuclideanSpatial := WithLp.toLp 2 (Pi.single j 1) def euclideanL2Distribution : EuclideanL2 →L[ℂ] EuclideanDistributions := Lp.toTemperedDistributionCLM ℂ volume 2 lemma euclideanL2Distribution_injective : Function.Injective euclideanL2Distribution := by apply LinearMap.ker_eq_bot.mp exact Lp.ker_toTemperedDistributionCLM_eq_bot def euclideanGradientEquations : EuclideanL2 × EuclideanGradientL2 →L[ℂ] (Fin 3 → EuclideanDistributions) := ContinuousLinearMap.pi (fun j => (lineDerivOpCLM ℂ EuclideanDistributions (euclideanCoordinateVector j)).comp (euclideanL2Distribution.comp (ContinuousLinearMap.fst ℂ EuclideanL2 EuclideanGradientL2))- euclideanL2Distribution.comp ((PiLp.proj 2 (fun _ : Fin 3 => EuclideanL2) j).comp (ContinuousLinearMap.snd ℂ EuclideanL2 EuclideanGradientL2))) def euclideanWeakGradientGraph : Submodule ℂ (EuclideanL2 × EuclideanGradientL2) := euclideanGradientEquations.ker lemma mem_euclideanWeakGradientGraph (f : EuclideanL2) (g : EuclideanGradientL2) : (f,g)∈euclideanWeakGradientGraph ↔ ∀j, ∂_{euclideanCoordinateVector j} (euclideanL2Distribution f)=euclideanL2Distribution (g j) := by change (fun j => ∂_{euclideanCoordinateVector j} (euclideanL2Distribution f)- euclideanL2Distribution (g j))=0 ↔ _ simp only [funext_iff,Pi.zero_apply,sub_eq_zero] lemma euclideanWeakGradientGraph_unique (x : EuclideanL2 × EuclideanGradientL2) (hx : x∈euclideanWeakGradientGraph) (hzero : x.1=0) : x.2=0 := by have hh := (mem_euclideanWeakGradientGraph x.1 x.2).mp hx apply (WithLp.equiv 2 (Fin 3 → EuclideanL2)).injective funext j change x.2 j=(0:EuclideanL2) apply euclideanL2Distribution_injective simpa only [hzero,map_zero,lineDerivOp_zero,WithLp.ofLp_zero,Pi.zero_apply] using (hh j).symm lemma schwartz_mem_euclideanWeakGradientGraph (f : 𝓢(EuclideanSpatial,ℂ)) : (f.toLp 2 volume,WithLp.toLp 2 (fun j => (∂_{euclideanCoordinateVector j} f).toLp 2 volume))∈euclideanWeakGradientGraph := by apply (mem_euclideanWeakGradientGraph _ _).mpr intro j dsimp only [euclideanL2Distribution] simp only [Lp.toTemperedDistributionCLM_apply,Lp.toTemperedDistribution_toLp_eq] exact TemperedDistribution.lineDerivOp_toTemperedDistributionCLM_eq («μ» := volume) f _ end open Filter MeasureTheory open scoped BigOperators Classical Topology SchwartzMap LineDeriv abbrev EuclideanH1Ambient := WithLp 2 (EuclideanL2 × EuclideanGradientL2) def euclideanH1Submodule : Submodule ℂ EuclideanH1Ambient := euclideanWeakGradientGraph.comap (WithLp.linearEquiv 2 ℂ (EuclideanL2 × EuclideanGradientL2)).toLinearMap lemma euclideanH1Submodule_isClosed : IsClosed (euclideanH1Submodule : Set EuclideanH1Ambient) := by have hg : IsClosed (euclideanWeakGradientGraph : Set (EuclideanL2 × EuclideanGradientL2)) := euclideanGradientEquations.isClosed_ker exact hg.preimage (WithLp.prodContinuousLinearEquiv 2 ℂ EuclideanL2 EuclideanGradientL2).continuous abbrev EuclideanH1 := euclideanH1Submodule theorem euclideanH1Complete : CompleteSpace EuclideanH1 := euclideanH1Submodule_isClosed.completeSpace_coe example : InnerProductSpace ℂ EuclideanH1 := inferInstance def euclideanH1Embedding : EuclideanH1 →L[ℂ] EuclideanL2 := (ContinuousLinearMap.fst ℂ EuclideanL2 EuclideanGradientL2).comp ((WithLp.prodContinuousLinearEquiv 2 ℂ EuclideanL2 EuclideanGradientL2).toContinuousLinearMap.comp euclideanH1Submodule.subtypeL) def euclideanH1Gradient : EuclideanH1 →L[ℂ] EuclideanGradientL2 := (ContinuousLinearMap.snd ℂ EuclideanL2 EuclideanGradientL2).comp ((WithLp.prodContinuousLinearEquiv 2 ℂ EuclideanL2 EuclideanGradientL2).toContinuousLinearMap.comp euclideanH1Submodule.subtypeL) lemma euclideanH1Embedding_eq_zero (u : EuclideanH1) (hu : euclideanH1Embedding u=0) : u=0 := by apply Subtype.ext apply (WithLp.equiv 2 (EuclideanL2 × EuclideanGradientL2)).injective apply Prod.ext · exact hu · exact euclideanWeakGradientGraph_unique u.1.ofLp u.2 hu lemma euclideanH1Embedding_injective : Function.Injective euclideanH1Embedding := by intro u v huv apply sub_eq_zero.mp apply euclideanH1Embedding_eq_zero rw [map_sub,huv,sub_self] lemma euclideanH1_norm_sq (u : EuclideanH1) : ‖u‖^2=‖euclideanH1Embedding u‖^2+‖euclideanH1Gradient u‖^2 := WithLp.prod_norm_sq_eq_of_L2 u.1 end CubicEisenstein open scoped BigOperators Classical namespace InitialMeanSquare open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open CompletedGauss FirstCauchyArithmetic ShortDraftHeckeBridge def normCharacter {q : ℕ} (χ : DirichletCharacter ℂ q) : O→*ℂ where toFun a := χ (Ideal.absNorm (Ideal.span {a})) map_one' := by simp map_mul' a b := by rw [←Ideal.span_singleton_mul_span_singleton] simp lemma normCharacter_prod {ι : Type*} (p : ι→O) (S : Finset ι) {q : ℕ} (χ : DirichletCharacter ℂ q) : normCharacter χ (∏i∈S,p i)=χ (Ideal.absNorm (∏i∈S,Ideal.span {p i})) := by change χ (Ideal.absNorm (Ideal.span {∏i∈S,p i}))=_ rw [FiniteGaussPhase.span_finset_prod] lemma pool_support_product (F : Finset (Ideal O)) (S : Finset (primePool F)) : idealSupport F (∏i∈S,i.val)=S := by letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal have hp (i : primePool F) : Prime i.val := Ideal.prime_of_isPrime (NeZero.ne i.val) inferInstance have hn : (∏i∈S,i.val)≠(0:Ideal O) := Finset.prod_ne_zero_iff.mpr (fun i _ => (hp i).ne_zero) ext i rw [mem_idealSupport_iff,UniqueFactorizationMonoid.mem_normalizedFactors_iff hn] simp only [family_prime_dvd_product_iff _ Subtype.val_injective S i,hp,true_and] theorem sum_selected_ideals (F : Finset (Ideal O)) (hF : ∀I∈F,Squarefree I) (a : Ideal O→ℂ) : (∑I∈F,a I)=∑S∈(Finset.univ:Finset (primePool F)).powerset, if (∏i∈S,i.val)∈F then a (∏i∈S,i.val) else 0 := by letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal rw [←Finset.sum_filter] symm apply Finset.sum_bij (fun S _ => ∏i∈S,i.val) · intro S hS exact (Finset.mem_filter.mp hS).2 · intro S hS T hT he exact family_product_injective (fun i:primePool F => i.val) Subtype.val_injective he · intro I hI refine ⟨idealSupport F I,?_,idealSupport_product_eq F hI (hF I hI)⟩ apply Finset.mem_filter.mpr refine ⟨Finset.mem_powerset.mpr (Finset.subset_univ _),?_⟩ rwa [idealSupport_product_eq F hI (hF I hI)] · intro S hS rfl def selectedIdealTest (F : Finset (Ideal O)) (W : ℕ→ℂ) (S : Finset (primePool F)) : ℂ := if (∏i∈S,i.val)∈F then W (Ideal.absNorm (∏i∈S,i.val)) else 0 theorem idealRowSum_eq_mobiusRow (F : Finset (Ideal O)) (hF : ∀I∈F,Admissible I) {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℕ→ℂ) (z : O) : letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let hFpos := fun I hI => (hF I hI).1 let hFgood := fun I hI P hP => ((hF I hI).2.2 P hP).1 letI : ∀i:primePool F,(Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance idealRowSum F hFpos hFgood χ W z= mobiusRow (poolPrimary F) (poolPrimary_good F hF) Finset.univ (normCharacter χ) 1 (selectedIdealTest F W) z := by letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal dsimp only let : ∀i:primePool F,(Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance have hP : (fun i:primePool F => Ideal.span {poolPrimary F i})=(fun i:primePool F => i.val) := funext (poolPrimary_span F hF) unfold idealRowSum rw [sum_selected_ideals F (fun I hI => (hF I hI).2.1)] unfold mobiusRow apply Finset.sum_congr rfl intro S hS have ht := normCharacter_prod (poolPrimary F) S χ simp only [hP] at ht by_cases hs : (∏i∈S,i.val)∈F · rw [if_pos hs] simp only [inputColumn,selectedIdealTest,if_pos hs,mul_one,ht] have hm : rowCoprimeMask (fun i => Ideal.span {poolPrimary F i}) S 1=1 := by simp [rowCoprimeMask,Ideal.IsPrime.one_notMem] rw [hm,mul_one] simp only [supportMobius,hP,baseChangeWeight,idealSexticRow,pool_support_product] ring · rw [if_neg hs] simp only [inputColumn,selectedIdealTest,if_neg hs,mul_zero,zero_mul] end InitialMeanSquare open scoped BigOperators Classical SchwartzMap FourierTransform open MeasureTheory namespace InitialMeanSquare open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation section variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) def sourceChildEnergy (F : Finset ι) (Ψ : O→*ℂ) (m : O) (T : Finset (O×O)) (V : ℝ→ℂ) (X : ℝ) (testNegative rowNegative : Bool) (a b : ℝ) : ℝ := ∑u∈T,‖fixedChildRow p hp hcop hg F Ψ m (fixedSecondTest p V X a b testNegative) u.2 (if rowNegative then -u.1 else u.1)‖^2 def sourceEnergyMagnitude (F : Finset ι) (Ψ : O→*ℂ) (m : O) (T : Finset (O×O)) (V : ℝ→ℂ) (X : ℝ) (testNegative rowNegative : Bool) : ℝ := ∑u∈T,(rowMagnitude p hp hcop hg F Ψ m u.2 (if rowNegative then -u.1 else u.1) V X testNegative)^2 lemma sourceChildEnergy_le (F : Finset ι) (Ψ : O→*ℂ) (m : O) (T : Finset (O×O)) (V : ℝ→ℂ) (X : ℝ) (tn rn : Bool) (a b : ℝ) : sourceChildEnergy p hp hcop hg F Ψ m T V X tn rn a b≤ sourceEnergyMagnitude p hp hcop hg F Ψ m T V X tn rn := by unfold sourceChildEnergy sourceEnergyMagnitude apply Finset.sum_le_sum intro u hu exact pow_le_pow_left₀ (norm_nonneg _) (fixedRow_norm_le p hp hcop hg F Ψ m _ _ V X a b tn) 2 lemma sourceChildEnergy_continuous (F : Finset ι) (Ψ : O→*ℂ) (m : O) (T : Finset (O×O)) (V : ℝ→ℂ) (X : ℝ) (tn rn : Bool) (τ σ : Frequency→ℝ) (hτ : Continuous τ) (hσ : Continuous σ) : Continuous (fun q => sourceChildEnergy p hp hcop hg F Ψ m T V X tn rn (τ q) (σ q)) := by unfold sourceChildEnergy apply continuous_finsetSum intro u hu exact (fixedRow_continuous p hp hcop hg F Ψ m _ _ V X tn τ σ hτ hσ).norm.pow 2 def sourceGeometricMean (F : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m : O) (T : Finset (O×O)) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ : ℝ) (q : Frequency) : ℝ := Real.sqrt (sourceChildEnergy p hp hcop hg F Ψ₁ m T V₁ X₁ true false q.1 q.2.2)* Real.sqrt (sourceChildEnergy p hp hcop hg F Ψ₂ m T V₂ X₂ false true q.2.1 q.2.2) def sourceFixedMode (s : Finset (SecondExpansionData ι)) (w : Frequency→SecondExpansionData ι→ℂ) (F : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m : O) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ : ℝ) (q : Frequency) : ℂ := ∑x∈s,w q x* star (fixedChildRow p hp hcop hg F Ψ₁ m (fixedSecondTest p V₁ X₁ q.1 q.2.2 true) (sourceObservation p x).2 (sourceObservation p x).1)* fixedChildRow p hp hcop hg F Ψ₂ m (fixedSecondTest p V₂ X₂ q.2.1 q.2.2 false) (sourceObservation p x).2 (-(sourceObservation p x).1) def integratedSourceMode (b₁ b₂ b₃ : 𝓢(ℝ,ℂ)) (s : Finset (SecondExpansionData ι)) (w : Frequency→SecondExpansionData ι→ℂ) (F : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m : O) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ : ℝ) : ℂ := ∫t₁:ℝ,∫t₂:ℝ,∫t₃:ℝ,tripleCoefficient b₁ b₂ b₃ (t₁,t₂,t₃)* sourceFixedMode p hp hcop hg s w F Ψ₁ Ψ₂ m V₁ V₂ X₁ X₂ (t₁,t₂,t₃) end private theorem weighted_conjugate_pair_swap {α : Type*} (s : Finset α) (w P Q : α → ℂ) (B X Y : ℝ) (h : ‖∑ x ∈ s, w x * P x * star (Q x)‖ ≤ B * X * Y) : ‖∑ x ∈ s, w x * star (Q x) * P x‖ ≤ B * (Y * X) := by have he : (∑ x ∈ s, w x * star (Q x) * P x) = ∑ x ∈ s, w x * P x * star (Q x) := by apply Finset.sum_congr rfl intro x hx ring rw [he] exact h.trans_eq (by ring) theorem integrated_source_transfer (ε : ℝ) (hε : 0<ε) : ∃ C : ℝ,0 Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (r : O) (s : Finset (SecondExpansionData ι)) (T : Finset (O×O)) (w : Frequency→SecondExpansionData ι→ℂ) (A K : ℝ) (F : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m : O) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ : ℝ) (b₁ b₂ b₃ : 𝓢(ℝ,ℂ)), 0≤A → 0≤K → (∀x∈s,InSecondQuotientSector p r x) → (∀x∈s,sourceObservation p x∈T) → (∀y∈T,y.1≠0) → (∀y∈T,(Ideal.absNorm (Ideal.span {y.1}):ℝ)≤K) → (∀q,∀x∈s,‖w q x‖≤A) → (∀x∈s,Continuous (fun q => w q x)) → ‖integratedSourceMode p hp hcop hg b₁ b₂ b₃ s w F Ψ₁ Ψ₂ m V₁ V₂ X₁ X₂‖≤ A*C*K^ε*(∫t₁:ℝ,∫t₂:ℝ,∫t₃:ℝ,‖tripleCoefficient b₁ b₂ b₃ (t₁,t₂,t₃)‖* sourceGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ (t₁,t₂,t₃)) := by obtain ⟨C,hC,hpointwise⟩ := source_weighted_cauchy ε hε refine ⟨C,hC,?_⟩ intro ι _ p hp _ hcop hg hinj r s T w A K F Ψ₁ Ψ₂ m V₁ V₂ X₁ X₂ b₁ b₂ b₃ hA hK hs hmap hT hnorm hw hwc let f := sourceFixedMode p hp hcop hg s w F Ψ₁ Ψ₂ m V₁ V₂ X₁ X₂ let G := sourceGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ have hc₁ := sourceChildEnergy_continuous p hp hcop hg F Ψ₁ m T V₁ X₁ true false (fun q:Frequency => q.1) (fun q:Frequency => q.2.2) continuous_fst continuous_snd.snd have hc₂ := sourceChildEnergy_continuous p hp hcop hg F Ψ₂ m T V₂ X₂ false true (fun q:Frequency => q.2.1) (fun q:Frequency => q.2.2) continuous_snd.fst continuous_snd.snd have hG : Continuous G := (Real.continuous_sqrt.comp hc₁).mul (Real.continuous_sqrt.comp hc₂) have hG0 : ∀q,0≤G q := fun q => mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) let M := Real.sqrt (sourceEnergyMagnitude p hp hcop hg F Ψ₁ m T V₁ X₁ true false)* Real.sqrt (sourceEnergyMagnitude p hp hcop hg F Ψ₂ m T V₂ X₂ false true) have hM : ∀q,G q≤M := by intro q dsimp [G,sourceGeometricMean,M] gcongr · exact sourceChildEnergy_le p hp hcop hg F Ψ₁ m T V₁ X₁ true false q.1 q.2.2 · exact sourceChildEnergy_le p hp hcop hg F Ψ₂ m T V₂ X₂ false true q.2.1 q.2.2 have hf : Continuous f := by unfold f sourceFixedMode apply continuous_finsetSum intro x hx have h₁ := fixedRow_continuous p hp hcop hg F Ψ₁ m (sourceObservation p x).2 (sourceObservation p x).1 V₁ X₁ true (fun q:Frequency => q.1) (fun q:Frequency => q.2.2) continuous_fst continuous_snd.snd have h₂ := fixedRow_continuous p hp hcop hg F Ψ₂ m (sourceObservation p x).2 (-(sourceObservation p x).1) V₂ X₂ false (fun q:Frequency => q.2.1) (fun q:Frequency => q.2.2) continuous_snd.fst continuous_snd.snd exact ((hwc x hx).mul h₁.star).mul h₂ have hpoint : ∀q,‖f q‖≤(A*C*K^ε)*G q := by intro q let P : O × O → ℂ := fun u => fixedChildRow p hp hcop hg F Ψ₂ m (fixedSecondTest p V₂ X₂ q.2.1 q.2.2 false) u.2 (-u.1) let Q : O × O → ℂ := fun u => fixedChildRow p hp hcop hg F Ψ₁ m (fixedSecondTest p V₁ X₁ q.1 q.2.2 true) u.2 u.1 have hh := hpointwise p hinj r s T (w q) P Q A K hA hK hs hmap hT hnorm (hw q) have hh' := weighted_conjugate_pair_swap s (w q) (fun x => P (sourceObservation p x)) (fun x => Q (sourceObservation p x)) (A*C*K^ε) _ _ hh simpa only [f,G,sourceFixedMode,sourceGeometricMean,sourceChildEnergy,P,Q, Bool.false_eq_true,ite_false,ite_true] using hh' exact triple_integral_bound b₁ b₂ b₃ f G hf hG hG0 (A*C*K^ε) M (by positivity) hM hpoint end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.LogarithmicBins namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace InitialMeanSquare section open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform section open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FourierBridge (logPhase) def initialOuterWeight {ι : Type*} (V : Fin 7 → ℝ → ℂ) (w : SecondExpansionData ι → ℂ) (z ud ue uv kap : SecondExpansionData ι → ℝ) (q : Frequency) (x : SecondExpansionData ι) : ℂ := w x * outerWindow V (z x) (ud x) (ue x) (uv x) (kap x) * logPhase (q.1 + q.2.1) (z x) * logPhase q.2.2 (kap x - ud x - 2 * ue x - 2 * uv x) lemma initialOuterWeight_continuous {ι : Type*} (V : Fin 7 → ℝ → ℂ) (w : SecondExpansionData ι → ℂ) (z ud ue uv kap : SecondExpansionData ι → ℝ) (x : SecondExpansionData ι) : Continuous (fun q => initialOuterWeight V w z ud ue uv kap q x) := by have h₁ : Continuous (fun q : Frequency => logPhase (q.1 + q.2.1) (z x)) := (FourierBridge.logPhase_continuous_left (z x)).comp (continuous_fst.add continuous_snd.fst) have h₂ : Continuous (fun q : Frequency => logPhase q.2.2 (kap x - ud x - 2 * ue x - 2 * uv x)) := (FourierBridge.logPhase_continuous_left (kap x - ud x - 2 * ue x - 2 * uv x)).comp continuous_snd.snd unfold initialOuterWeight fun_prop lemma initialOuterWeight_norm {ι : Type*} (V : Fin 7 → ℝ → ℂ) (w : SecondExpansionData ι → ℂ) (z ud ue uv kap : SecondExpansionData ι → ℝ) (q : Frequency) (x : SecondExpansionData ι) : ‖initialOuterWeight V w z ud ue uv kap q x‖ = ‖w x‖ * ‖outerWindow V (z x) (ud x) (ue x) (uv x) (kap x)‖ := by simp only [initialOuterWeight, norm_mul, FourierBridge.logPhase_norm, mul_one] variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def initialSourceSum (s : Finset (SecondExpansionData ι)) (w : SecondExpansionData ι → ℂ) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (A₁ A₂ W : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap : SecondExpansionData ι → ℝ) (X₁ X₂ R : ℝ) : ℂ := ∑ x ∈ s, w x * postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ m (sourceObservation p x).2 (sourceObservation p x).1 (-(sourceObservation p x).1) A₁ A₂ W V (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂ R theorem initialSource_eq_integrated (s : Finset (SecondExpansionData ι)) (w : SecondExpansionData ι → ℂ) (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (A₁ A₂ W b : 𝓢(ℝ, ℂ)) (V : Fin 7 → ℝ → ℂ) (z ud ue uv kap : SecondExpansionData ι → ℝ) (X₁ X₂ R : ℝ) (hsep : ∀ x ∈ s, postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ m (sourceObservation p x).2 (sourceObservation p x).1 (-(sourceObservation p x).1) A₁ A₂ W V (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂ R = separatedPostCommon p hp hcop hg F Ψ₁ Ψ₂ m (sourceObservation p x).2 (sourceObservation p x).1 (-(sourceObservation p x).1) A₁ A₂ b V (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂) : initialSourceSum p hp hcop hg s w F Ψ₁ Ψ₂ m A₁ A₂ W V z ud ue uv kap X₁ X₂ R = integratedSourceMode p hp hcop hg (𝓕 A₁) (𝓕 A₂) b s (initialOuterWeight V w z ud ue uv kap) F Ψ₁ Ψ₂ m (V 5) (V 6) X₁ X₂ := by let Q : SecondExpansionData ι → Frequency → ℂ := fun x q => initialOuterWeight V w z ud ue uv kap q x * star (fixedChildRow p hp hcop hg F Ψ₁ m (fixedSecondTest p (V 5) X₁ q.1 q.2.2 true) (sourceObservation p x).2 (sourceObservation p x).1) * fixedChildRow p hp hcop hg F Ψ₂ m (fixedSecondTest p (V 6) X₂ q.2.1 q.2.2 false) (sourceObservation p x).2 (-(sourceObservation p x).1) let M : SecondExpansionData ι → ℝ := fun x => (‖w x‖ * ‖outerWindow V (z x) (ud x) (ue x) (uv x) (kap x)‖) * rowMagnitude p hp hcop hg F Ψ₁ m (sourceObservation p x).2 (sourceObservation p x).1 (V 5) X₁ true * rowMagnitude p hp hcop hg F Ψ₂ m (sourceObservation p x).2 (-(sourceObservation p x).1) (V 6) X₂ false have hc (x : SecondExpansionData ι) : Continuous (Q x) := by have hw := initialOuterWeight_continuous V w z ud ue uv kap x have h₁ := fixedRow_continuous p hp hcop hg F Ψ₁ m (sourceObservation p x).2 (sourceObservation p x).1 (V 5) X₁ true (fun q : Frequency => q.1) (fun q : Frequency => q.2.2) continuous_fst continuous_snd.snd have h₂ := fixedRow_continuous p hp hcop hg F Ψ₂ m (sourceObservation p x).2 (-(sourceObservation p x).1) (V 6) X₂ false (fun q : Frequency => q.2.1) (fun q : Frequency => q.2.2) continuous_snd.fst continuous_snd.snd exact (hw.mul h₁.star).mul h₂ have hbound (x : SecondExpansionData ι) (q : Frequency) : ‖Q x q‖ ≤ M x := by dsimp only [Q, M] rw [norm_mul, norm_mul, norm_star, initialOuterWeight_norm] have h₁ := fixedRow_norm_le p hp hcop hg F Ψ₁ m (sourceObservation p x).2 (sourceObservation p x).1 (V 5) X₁ q.1 q.2.2 true have h₂ := fixedRow_norm_le p hp hcop hg F Ψ₂ m (sourceObservation p x).2 (-(sourceObservation p x).1) (V 6) X₂ q.2.1 q.2.2 false have hn₁ := rowMagnitude_nonneg p hp hcop hg F Ψ₁ m (sourceObservation p x).2 (sourceObservation p x).1 (V 5) X₁ true have hn₂ := rowMagnitude_nonneg p hp hcop hg F Ψ₂ m (sourceObservation p x).2 (-(sourceObservation p x).1) (V 6) X₂ false gcongr calc _ = ∑ x ∈ s, ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, tripleCoefficient (𝓕 A₁) (𝓕 A₂) b (t₁,t₂,t₃) * Q x (t₁,t₂,t₃) := by apply Finset.sum_congr rfl intro x hx rw [hsep x hx] unfold separatedPostCommon simp_rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with t₁ apply integral_congr_ae filter_upwards [] with t₂ apply integral_congr_ae filter_upwards [] with t₃ dsimp [tripleCoefficient, Q, initialOuterWeight] ring _ = ∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, tripleCoefficient (𝓕 A₁) (𝓕 A₂) b (t₁,t₂,t₃) * (∑ x ∈ s, Q x (t₁,t₂,t₃)) := finite_triple_bounded_integral s (𝓕 A₁) (𝓕 A₂) b Q (fun x _ => hc x) M (fun x _ => hbound x) _ = _ := rfl end open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation theorem initial_source_uniform_transfer (ε : ℝ) (hε : 0<ε) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7→ℝ→ℂ) (M : Fin 7→ℝ) (hM : ∀j,0≤M j) (hV : ∀j x,V j x≠0→|x|≤M j) (N J : ℕ) : ∃ Cₐ : ℝ,0 Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (r : O) (s : Finset (SecondExpansionData ι)) (T : Finset (O×O)) (w : SecondExpansionData ι→ℂ) (A K : ℝ) (F : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m : O) (z ud ue uv kap : SecondExpansionData ι→ℝ) (X₁ X₂ : ℝ), 0≤A → 0≤K → (∀x∈s,InSecondQuotientSector p r x) → (∀x∈s,sourceObservation p x∈T) → (∀y∈T,y.1≠0) → (∀y∈T,(Ideal.absNorm (Ideal.span {y.1}):ℝ)≤K) → (∀x∈s,‖w x‖*‖outerWindow V (z x) (ud x) (ue x) (uv x) (kap x)‖≤A) → ‖initialSourceSum p hp hcop hg s w F Ψ₁ Ψ₂ m A₁ A₂ W V z ud ue uv kap X₁ X₂ R‖≤ A*Cₐ*K^ε*(∫t₁:ℝ,∫t₂:ℝ,∫t₃:ℝ,‖tripleCoefficient (𝓕 A₁) (𝓕 A₂) b (t₁,t₂,t₃)‖* sourceGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T (V 5) (V 6) X₁ X₂ (t₁,t₂,t₃)) := by obtain ⟨Cₐ,hCₐ,htrans⟩ := integrated_source_transfer ε hε obtain ⟨Cₛ,hCₛ,hsep⟩ := full_uniform_postCommonSmoothPair_fixed_tests A₁ A₂ W V M hM hV N J refine ⟨Cₐ,hCₐ,Cₛ,hCₛ,?_⟩ intro R hR obtain ⟨b,hpoint,hid⟩ := hsep R hR refine ⟨b,hpoint,?_⟩ intro ι _ p hp _ hcop hg hinj r s T w A K F Ψ₁ Ψ₂ m z ud ue uv kap X₁ X₂ hA hK hs hmap hT hnorm hw have hsource := initialSource_eq_integrated p hp hcop hg s w F Ψ₁ Ψ₂ m A₁ A₂ W b V z ud ue uv kap X₁ X₂ R (fun x hx => hid p hp hcop hg F Ψ₁ Ψ₂ m (sourceObservation p x).2 (sourceObservation p x).1 (-(sourceObservation p x).1) (z x) (ud x) (ue x) (uv x) (kap x) X₁ X₂) rw [hsource] apply htrans p hp hcop hg hinj r s T (initialOuterWeight V w z ud ue uv kap) A K F Ψ₁ Ψ₂ m (V 5) (V 6) X₁ X₂ (𝓕 A₁) (𝓕 A₂) b hA hK hs hmap hT hnorm · intro q x hx rw [initialOuterWeight_norm] exact hw x hx · intro x hx exact initialOuterWeight_continuous V w z ud ue uv kap x end section open ActualEisensteinCubic SecondPassArithmetic open FirstPassCubeLabels (primeProductNorm) open SecondPassIntegration (elementNorm) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] def initialLogIndex (x : SecondExpansionData ι) : SecondLogIndex := (normLogBin (primeProductNorm p x.divisor),normLogBin (primeProductNorm p x.overlap), normLogBin (elementNorm (sourceObservation p x).1)) def initialLogColumn (Z B : ℝ) (j : SecondLogIndex) : ℝ := Z/(secondLogE j*secondLogV j*B) def initialLogLabel (j : SecondLogIndex) : ℝ := secondLogE j*secondLogV j*Real.exp 2 omit [DecidableEq ι] in lemma sourceRow_nonzero (x : SecondExpansionData ι) (hk : x.frequency≠0) : (sourceObservation p x).1≠0 := mul_ne_zero (primeSubsetGenerator_ne_zero _ _) hk omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma sourceLabel_span (x : SecondExpansionData ι) : Ideal.span {(sourceObservation p x).2}= (∏i∈x.divisor,Ideal.span {p i})*(∏i∈x.overlap,Ideal.span {p i}) := by simp only [sourceObservation,←Ideal.span_singleton_mul_span_singleton, primeSubsetGenerator,ConcretePrimeRowBridge.span_idealGenerator,FiniteGaussPhase.span_finset_prod] omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma sourceLabel_norm (x : SecondExpansionData ι) : elementNorm (sourceObservation p x).2=primeProductNorm p x.divisor*primeProductNorm p x.overlap := by simp only [elementNorm,sourceObservation,map_mul,norm_mul,mul_pow, primeSubsetGenerator_norm_eq_productNorm,primeProductNorm] include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in lemma sourceQuotient_nonzero (x : SecondExpansionData ι) (hE : x.divisor⊆x.sourceCommon) : secondExpansionQuotient p x≠0 := by rw [secondExpansionQuotient_of_subset p x hE] intro he have hh := secondMaskQuotient_spec p x.divisor x.sourceCommon hE rw [he,mul_zero] at hh exact (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i)) hh include hp in theorem initial_log_coordinates (Z : ℝ) (hZ : 0 Ideal.span {p i}))) end theorem initial_log_box_small_power (ε : ℝ) (hε : 0<ε) : ∃ C : ℝ,0 cases e₁ <;> cases e₂ <;> decide theorem local_first_conductor_bound (parityBit e₁ e₂ : Bool) (n : ℕ) (hn : 0 cases e₁ <;> cases e₂ <;> decide omega variable {ι : Type*} [DecidableEq ι] (p : ι → O) omit [DecidableEq ι] in theorem firstActiveProduct_as_primeProduct (S : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) : (∏ i∈cubeActiveSupport S v ε₁ ε₂,p i)= primeProduct p S (fun i => if conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)=0 then 0 else 1) := by unfold cubeActiveSupport primeProduct rw [Finset.prod_filter] apply Finset.prod_congr rfl intro i hi by_cases h : conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)=0 <;> simp [h] omit [DecidableEq ι] in theorem first_conductor_product_balance (S : Finset ι) (v : ι → ℕ) (ε₁ ε₂ : ι → Bool) : (∏ i∈cubeActiveSupport S v ε₁ ε₂,p i)*dilationLabel p S v ε₁ ε₂*j2Label p S v ε₁ ε₂^2 = aLabel p S ε₁*aLabel p S ε₂*squarefreeLabel p S v := by rw [firstActiveProduct_as_primeProduct] simp only [dilationLabel,j2Label,aLabel,squarefreeLabel,primeProduct,← Finset.prod_pow, ← Finset.prod_mul_distrib,← pow_mul,← pow_add] apply Finset.prod_congr rfl intro i hi congr 1 simpa only [evenDouble,mul_comm] using local_first_conductor_balance (parity (v i)) (ε₁ i) (ε₂ i) variable [∀ i,(Ideal.span {p i}).IsMaximal] omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem first_conductor_product_dvd (S : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ i∈S,0 v₁ i+v₂ i) ε₁ ε₂,p i)* dilationLabel p S (fun i => v₁ i+v₂ i) ε₁ ε₂*jLabel p S (fun i => v₁ i+v₂ i) ε₁ ε₂ ∣ aLabel p S ε₁*aLabel p S ε₂*(primeProduct p S v₁*primeProduct p S v₂)^2 := by rw [firstActiveProduct_as_primeProduct,← primeProduct_add] simp only [dilationLabel,jLabel,aLabel,primeProduct,← Finset.prod_pow,← Finset.prod_mul_distrib,← pow_mul,← pow_add] apply Finset.prod_dvd_prod_of_dvd intro i hi apply pow_dvd_pow simpa only [mul_comm] using local_first_conductor_bound (parity (v₁ i+v₂ i)) (ε₁ i) (ε₂ i) (v₁ i+v₂ i) (hv i hi) variable (hp : ∀ i,p i≠0) include hp in omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem first_conductor_norm_bound (S : Finset ι) (v₁ v₂ : ι → ℕ) (ε₁ ε₂ : ι → Bool) (hv : ∀ i∈S,0 v₁ i+v₂ i) ε₁ ε₂,p i)‖^2* ‖eisEmbedding (dilationLabel p S (fun i => v₁ i+v₂ i) ε₁ ε₂)‖^2* ‖eisEmbedding (jLabel p S (fun i => v₁ i+v₂ i) ε₁ ε₂)‖^2 ≤ ‖eisEmbedding (aLabel p S ε₁)‖^2*‖eisEmbedding (aLabel p S ε₂)‖^2*B^4 := by have hn : aLabel p S ε₁*aLabel p S ε₂*(primeProduct p S v₁*primeProduct p S v₂)^2≠0 := by apply mul_ne_zero (mul_ne_zero (primeProduct_ne_zero p hp _ _) (primeProduct_ne_zero p hp _ _)) exact pow_ne_zero _ (mul_ne_zero (primeProduct_ne_zero p hp _ _) (primeProduct_ne_zero p hp _ _)) have h := element_norm_le_of_dvd hn (first_conductor_product_dvd p S v₁ v₂ ε₁ ε₂ hv) simp only [map_mul,map_pow,norm_mul,norm_pow,mul_pow] at h apply h.trans apply mul_le_mul_of_nonneg_left _ (mul_nonneg (sq_nonneg _) (sq_nonneg _)) have hm := mul_le_mul hb₁ hb₂ (sq_nonneg _) hB have hs := pow_le_pow_left₀ (mul_nonneg (sq_nonneg _) (sq_nonneg _)) hm 2 convert hs using 1 <;> ring end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm primeProduct aLabel dilationLabel jLabel cubeActiveSupport) open ConcreteTraceCRT (eisEmbedding) lemma first_row_numeric_bound (an en jn a1 a2 cn dn hn fn ell K B F : ℝ) (ha : 0≤an) (he : 0≤en) (hj : 0 b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit)* primeProductNorm p b.firstDivisor/ (K*‖eisEmbedding (aLabel p b.cube.support b.cube.leftBit)‖^2* ‖eisEmbedding (aLabel p b.cube.support b.cube.rightBit)‖^2*(primeProductNorm p b.common)^2)) : ‖eisEmbedding (DescentWeightedCauchy.firstElementRowMap (dilationLabel p b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit) x)‖^2 ≤ globalFirstPooledRow p K ell B F true (b.withCommon ∅) := by let active := cubeActiveSupport b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit let e := dilationLabel p b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit let j := jLabel p b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit let a1 := aLabel p b.cube.support b.cube.leftBit let a2 := aLabel p b.cube.support b.cube.rightBit have hpos (v : ι → ℕ) : 0<‖eisEmbedding (primeProduct p b.cube.support v)‖^2 := zero_lt_one.trans_le (element_norm_ge_one _ (primeProduct_ne_zero p hp _ _)) have hcon := first_conductor_norm_bound p hp b.cube.support b.cube.leftExponent b.cube.rightExponent b.cube.leftBit b.cube.rightBit b.cube.support_pos B hB.le hb₁ hb₂ have hnum := first_row_numeric_bound (primeProductNorm p active) (‖eisEmbedding e‖^2) (‖eisEmbedding j‖^2) (‖eisEmbedding a1‖^2) (‖eisEmbedding a2‖^2) (primeProductNorm p b.common) (primeProductNorm p b.firstDivisor) (‖eisEmbedding x.2‖^2) (Ideal.absNorm x.1) ell K B F (FirstPassCubeLabels.primeProductNorm_pos p hp active).le (sq_nonneg _) (hpos _) (hpos _) (hpos _) (FirstPassCubeLabels.primeProductNorm_pos p hp b.common) (FirstPassCubeLabels.primeProductNorm_pos p hp b.firstDivisor).le (sq_nonneg _) (Nat.cast_nonneg _) hell hK hB hF hcon hh hf have hgen : ‖eisEmbedding (ConcretePrimeRowBridge.idealGenerator x.1)‖^2=(Ideal.absNorm x.1 : ℝ) := by rw [eisEmbedding_norm_sq_eq_absNorm_span,ConcretePrimeRowBridge.span_idealGenerator] have hrow : ‖eisEmbedding (DescentWeightedCauchy.firstElementRowMap e x)‖^2 = ‖eisEmbedding x.2‖^2*(Ideal.absNorm x.1 : ℝ)^2*‖eisEmbedding e‖^2 := by simp only [DescentWeightedCauchy.firstElementRowMap,map_mul,map_pow,norm_mul,norm_pow,mul_pow] rw [show (‖eisEmbedding (ConcretePrimeRowBridge.idealGenerator x.1)‖^2)^2 = (Ideal.absNorm x.1 : ℝ)^2 by rw [hgen]] rw [hrow] exact hnum.trans (globalFirstRowScale_le_pooled p hp K ell B F hK hell hB hF b) end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm primeProduct aLabel dilationLabel cubeActiveSupport) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i≠0) [∀ i,(Ideal.span {p i}).IsMaximal] def globalFirstFrequencyScale (K ell : ℝ) (b : GlobalCubeBlock ι) : ℝ := ell^2*primeProductNorm p (cubeActiveSupport b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit)* primeProductNorm p b.firstDivisor/ (K*‖eisEmbedding (aLabel p b.cube.support b.cube.leftBit)‖^2* ‖eisEmbedding (aLabel p b.cube.support b.cube.rightBit)‖^2*(primeProductNorm p b.common)^2) def globalCubeFirstTargets (b : GlobalCubeBlock ι) (s : Finset (Ideal O × O)) : Finset O := s.image (DescentWeightedCauchy.firstElementRowMap (dilationLabel p b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit)) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalCubeFirstTargets_mem (b : GlobalCubeBlock ι) (s : Finset (Ideal O × O)) (x : Ideal O × O) (hx : x∈s) : DescentWeightedCauchy.firstElementRowMap (dilationLabel p b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit) x∈globalCubeFirstTargets p b s := Finset.mem_image.mpr ⟨x,hx,rfl⟩ include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalCubeFirstTargets_ne_zero (b : GlobalCubeBlock ι) (s : Finset (Ideal O × O)) (hsf : ∀ x∈s,Squarefree x.1) (hs0 : ∀ x∈s,x.2≠0) (z : O) (hz : z∈globalCubeFirstTargets p b s) : z≠0 := by obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hz apply mul_ne_zero · apply mul_ne_zero (hs0 x hx) exact pow_ne_zero _ (ConcretePrimeRowBridge.idealGenerator_ne_zero _ (by simpa using (hsf x hx).ne_zero)) · exact primeProduct_ne_zero p hp _ _ include hp in theorem globalCubeFirstTargets_norm_bound (b : GlobalCubeBlock ι) (s : Finset (Ideal O × O)) (K ell B F : ℝ) (hK : 0 simp only [exceptionalPiece,Fin.isValue,Fin.zero_eta,↓reduceIte] · simp [abs_of_nonneg hr] · by_cases hn : n∈P <;> simp [hn,abs_of_nonneg hr,hr] · by_cases hn : n∉P ∧ b∈P <;> simp [hn,abs_of_nonneg hr,hr] end CompletedGauss namespace CanonicalQuadraticSieve open ActualEisensteinCubic CompletedGauss theorem product_quadratic_norm_scaled (ε : ℝ) (hε : 0<ε) : ∃C : ℝ,0 β n b/(lengthScale:ℂ) have hγ (n : Ideal O) (hn : n∈S) (b : Ideal O) (hb : b∈T) : ‖γ n b‖≤1 := by dsimp [γ] rw [norm_div,Complex.norm_real,Real.norm_of_nonneg hL] exact (div_le_one hLp).mpr (hβ n hn b hb) have hb := hbound K U B hK hU hB S T hS hT γ hγ have he (k : idealRange K) : (∑n∈S,∑b∈T,quadraticRow k.val (primaryGenerator (n*b))*β n b)= (lengthScale:ℂ)*(∑n∈S,∑b∈T,quadraticRow k.val (primaryGenerator (n*b))*γ n b) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro n hn rw [Finset.mul_sum] apply Finset.sum_congr rfl intro b hb dsimp [γ] field_simp simp_rw [he,norm_mul,Complex.norm_real,Real.norm_of_nonneg hL,mul_pow] rw [←Finset.mul_sum] calc _ ≤ lengthScale^2*(C*(K*(U*B))^ε*(K+U*B)*(U*B)) := mul_le_mul_of_nonneg_left hb (sq_nonneg _) _ = _ := by ring end CanonicalQuadraticSieve open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix ContDiff namespace CubicEisenstein def spatialHorizontal (p : SpatialCoordinates) : ℂ := (p 0:ℂ)+(p 1:ℂ)*Complex.I def mobiusSpatialDenominator (g : SL(2,ℂ)) (p : SpatialCoordinates) : ℝ := Complex.normSq (g 1 0*spatialHorizontal p+g 1 1)+Complex.normSq (g 1 0)*(p 2)^2 def mobiusSpatialHorizontal (g : SL(2,ℂ)) (p : SpatialCoordinates) : ℂ := ((g 0 0*spatialHorizontal p+g 0 1)*star (g 1 0*spatialHorizontal p+g 1 1)+ g 0 0*star (g 1 0)*(p 2:ℂ)^2)/(mobiusSpatialDenominator g p:ℂ) def mobiusSpatial (g : SL(2,ℂ)) (p : SpatialCoordinates) : SpatialCoordinates := ![(mobiusSpatialHorizontal g p).re,(mobiusSpatialHorizontal g p).im, p 2/mobiusSpatialDenominator g p] lemma mobiusSpatialDenominator_pos (g : SL(2,ℂ)) (p : SpatialCoordinates) (hp : 0

g 1 0*spatialHorizontal p+g 1 1) := (contDiff_const.mul spatialHorizontal_contDiff).add contDiff_const have hre := Complex.reCLM.contDiff.comp hz have him := Complex.imCLM.contDiff.comp hz change ContDiff ℝ ∞ (fun p => (g 1 0*spatialHorizontal p+g 1 1).re*(g 1 0*spatialHorizontal p+g 1 1).re+ (g 1 0*spatialHorizontal p+g 1 1).im*(g 1 0*spatialHorizontal p+g 1 1).im+ Complex.normSq (g 1 0)*(p 2)^2) exact ((hre.mul hre).add (him.mul him)).add (contDiff_const.mul ((contDiff_apply ℝ ℝ 2).pow 2)) lemma mobiusSpatial_contDiffAt (g : SL(2,ℂ)) (p : SpatialCoordinates) (hp : 0

(mobiusSpatialDenominator g p:ℂ)) p := Complex.ofRealCLM.contDiff.contDiffAt.comp p hD have hnum : ContDiffAt ℝ ∞ (fun p : SpatialCoordinates => (g 0 0*spatialHorizontal p+g 0 1)*star (g 1 0*spatialHorizontal p+g 1 1)+ g 0 0*star (g 1 0)*(p 2:ℂ)^2) p := by have hz := spatialHorizontal_contDiff.contDiffAt (x := p) have hcz : ContDiffAt ℝ ∞ (fun p => g 1 0*spatialHorizontal p+g 1 1) p := (contDiffAt_const.mul hz).add contDiffAt_const have hc := Complex.conjCLE.contDiff.contDiffAt.comp p hcz have hv : ContDiffAt ℝ ∞ (fun p : SpatialCoordinates => (p 2:ℂ)) p := Complex.ofRealCLM.contDiff.contDiffAt.comp p (contDiff_apply ℝ ℝ 2).contDiffAt exact (((contDiffAt_const.mul hz).add contDiffAt_const).mul hc).add (contDiffAt_const.mul (hv.pow 2)) have hh : ContDiffAt ℝ ∞ (mobiusSpatialHorizontal g) p := by unfold mobiusSpatialHorizontal simp only [div_eq_mul_inv] exact hnum.mul (hDc.inv (Complex.ofReal_ne_zero.mpr (mobiusSpatialDenominator_pos g p hp).ne')) apply contDiffAt_pi.mpr intro j fin_cases j · exact Complex.reCLM.contDiff.contDiffAt.comp p hh · exact Complex.imCLM.contDiff.contDiffAt.comp p hh · exact (by fun_prop : ContDiffAt ℝ ∞ (fun p : SpatialCoordinates => p 2) p).div hD (mobiusSpatialDenominator_pos g p hp).ne' abbrev PositiveSpatial := {p : SpatialCoordinates // 0

fun_prop def positiveSpatialUpperHomeomorph : PositiveSpatial ≃ₜ UpperCoordinates where toFun := positiveSpatialToUpper invFun := upperToPositiveSpatial left_inv p := by apply Subtype.ext funext j fin_cases j <;> simp [upperToPositiveSpatial,positiveSpatialToUpper,spatialHorizontal] right_inv p := by apply Subtype.ext apply Prod.ext · exact Complex.re_add_im _ · rfl continuous_toFun := positiveSpatialToUpper_continuous continuous_invFun := upperToPositiveSpatial_continuous def positiveSpatialHomeomorph : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology PositiveSpatial ≃ₜ HyperbolicSpace := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology positiveSpatialUpperHomeomorph.trans upperCoordinatesHomeomorph lemma hyperbolicSpatial_isOpenEmbedding : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Topology.IsOpenEmbedding hyperbolicSpatialCoordinates := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by have ho : IsOpen {p : SpatialCoordinates | 0

by have he := hyperbolicSpatialChart.right_inv hp have hh := hyperbolicSpatialCoordinates_positive (hyperbolicSpatialChart.symm p) rwa [← hyperbolicSpatialChart_apply,he] at hh def kernelLocalLift (w : HyperbolicSpace) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology OpenPartialHomeomorph KernelQuotient HyperbolicSpace := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology kernelQuotient_localHomeomorph.localInverseAt w lemma kernelLocalLift_symm (w : HyperbolicSpace) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology (kernelLocalLift w).symm=integralOrbitProjection globalKubotaKernel := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology kernelQuotient_localHomeomorph.localInverseAt_symm w lemma kernelLocalLift_project {w : HyperbolicSpace} {q : KernelQuotient} : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hq : q∈(kernelLocalLift w).source), integralOrbitProjection globalKubotaKernel (kernelLocalLift w q)=q := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hq : q∈(kernelLocalLift w).source) => kernelQuotient_localHomeomorph.apply_localInverseAt_of_mem hq lemma kernel_lifts_eventually_eq {X : Type*} [TopologicalSpace X] {f g : X→HyperbolicSpace} {x : X} : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf : ContinuousAt f x) (hg : ContinuousAt g x) (hfg : f x=g x) (hproj : (fun y => integralOrbitProjection globalKubotaKernel (f y))=ᶠ[𝓝 x] (fun y => integralOrbitProjection globalKubotaKernel (g y))), f=ᶠ[𝓝 x]g := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hf : ContinuousAt f x) (hg : ContinuousAt g x) (hfg : f x=g x) (hproj : (fun y => integralOrbitProjection globalKubotaKernel (f y))=ᶠ[𝓝 x] (fun y => integralOrbitProjection globalKubotaKernel (g y))) => by obtain ⟨U,hU,hx,hUinj⟩ := kernelQuotient_localHomeomorph.isLocallyInjective (f x) have hfn : ∀ᶠ y in 𝓝 x,f y∈U := hf (hU.mem_nhds hx) have hgn : ∀ᶠ y in 𝓝 x,g y∈U := hg (hU.mem_nhds (hfg ▸ hx)) filter_upwards [hfn,hgn,hproj] with y hyf hyg hye exact hUinj hyf hyg hye lemma kernel_lifts_eventually_deck {X : Type*} [TopologicalSpace X] {f g : X→HyperbolicSpace} {x : X} : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf : ContinuousAt f x) (hg : ContinuousAt g x) (hproj : (fun y => integralOrbitProjection globalKubotaKernel (f y))=ᶠ[𝓝 x] (fun y => integralOrbitProjection globalKubotaKernel (g y))), ∃M : globalKubotaKernel, f=ᶠ[𝓝 x](fun y => integralComplexMatrix M • g y) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hf : ContinuousAt f x) (hg : ContinuousAt g x) (hproj : (fun y => integralOrbitProjection globalKubotaKernel (f y))=ᶠ[𝓝 x] (fun y => integralOrbitProjection globalKubotaKernel (g y))) => by let := integralSubgroupHyperbolicAction globalKubotaKernel have he := (integralOrbitProjection_eq_iff globalKubotaKernel (f x) (g x)).mp hproj.self_of_nhds obtain ⟨M,hM⟩ := MulAction.mem_orbit_iff.mp he refine ⟨M,kernel_lifts_eventually_eq hf ((continuous_hyperbolic_action (integralComplexMatrix M)).continuousAt.comp hg) hM.symm ?_⟩ filter_upwards [hproj] with y hy simpa only [integralOrbitProjection_eq] using hy lemma mobiusSpatial_coordinates_global (g : SL(2,ℂ)) (w : HyperbolicSpace) : hyperbolicSpatialCoordinates (g•w)=mobiusSpatial g (hyperbolicSpatialCoordinates w) := by have hp := hyperbolicSpatialCoordinates_positive w have hr := hyperbolicSpatialCoordinates_reconstruct w nth_rw 1 [← hr] exact mobiusSpatial_coordinates g (hyperbolicSpatialCoordinates w) hp def kernelCoordinateTransition (w : HyperbolicSpace) (p : SpatialCoordinates) : SpatialCoordinates := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology hyperbolicSpatialCoordinates (kernelLocalLift w (integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm p))) lemma kernelCoordinateTransition_eventually (w : HyperbolicSpace) (p : SpatialCoordinates) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hp : p∈hyperbolicSpatialChart.target) (hq : integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm p)∈ (kernelLocalLift w).source), ∃M : globalKubotaKernel,kernelCoordinateTransition w=ᶠ[𝓝 p] mobiusSpatial (integralComplexMatrix M) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hp : p∈hyperbolicSpatialChart.target) (hq : integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm p)∈ (kernelLocalLift w).source) => by have hc : ContinuousAt hyperbolicSpatialChart.symm p := hyperbolicSpatialChart.symm.continuousAt hp have hπ : ContinuousAt (fun y => integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm y)) p := (continuous_integralOrbitProjection globalKubotaKernel).continuousAt.comp hc have hl : ContinuousAt (fun y => kernelLocalLift w (integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm y))) p := ((kernelLocalLift w).continuousAt hq).comp (f := fun y : SpatialCoordinates => integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm y)) hπ have hqn : ∀ᶠ y in 𝓝 p,integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm y)∈(kernelLocalLift w).source := hπ ((kernelLocalLift w).open_source.mem_nhds hq) have hproj : (fun y => integralOrbitProjection globalKubotaKernel (kernelLocalLift w (integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm y))))=ᶠ[𝓝 p] (fun y => integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm y)) := by filter_upwards [hqn] with y hy exact kernelLocalLift_project hy obtain ⟨M,hM⟩ := kernel_lifts_eventually_deck hl hc hproj refine ⟨M,?_⟩ filter_upwards [hM,hyperbolicSpatialChart.open_target.mem_nhds hp] with y hy hyt change hyperbolicSpatialCoordinates _=mobiusSpatial _ y rw [hy,mobiusSpatial_coordinates_global] exact congrArg _ (hyperbolicSpatialChart.right_inv hyt) lemma kernelCoordinateTransition_contDiffAt (w : HyperbolicSpace) (p : SpatialCoordinates) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hp : p∈hyperbolicSpatialChart.target) (hq : integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm p)∈ (kernelLocalLift w).source), ContDiffAt ℝ ∞ (kernelCoordinateTransition w) p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hp : p∈hyperbolicSpatialChart.target) (hq : integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm p)∈ (kernelLocalLift w).source) => by obtain ⟨M,hM⟩ := kernelCoordinateTransition_eventually w p hp hq exact (mobiusSpatial_contDiffAt _ p (hyperbolicSpatialChart_target_positive hp)).congr_of_eventuallyEq hM def kernelQuotientChart (q : KernelQuotient) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology OpenPartialHomeomorph KernelQuotient SpatialCoordinates := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology (kernelLocalLift q.out).trans hyperbolicSpatialChart lemma kernelQuotientChart_symm (q : KernelQuotient) (p : SpatialCoordinates) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology (kernelQuotientChart q).symm p= integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm p) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by change (kernelLocalLift q.out).symm (hyperbolicSpatialChart.symm p)=_ rw [kernelLocalLift_symm] lemma kernelQuotientChart_contDiffOn (q r : KernelQuotient) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ContDiffOn ℝ ∞ ((kernelQuotientChart q).symm.trans (kernelQuotientChart r)) ((kernelQuotientChart q).symm.trans (kernelQuotientChart r)).source := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by intro p hp have hp' : p∈hyperbolicSpatialChart.target := hp.1.1 have hq' : integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm p)∈ (kernelLocalLift r.out).source := by rw [← kernelQuotientChart_symm q p] exact hp.2.1 have he : (fun p => ((kernelQuotientChart q).symm.trans (kernelQuotientChart r)) p)= kernelCoordinateTransition r.out := by funext y change hyperbolicSpatialChart (kernelLocalLift r.out ((kernelQuotientChart q).symm y))=_ rw [kernelQuotientChart_symm] rfl change ((kernelQuotientChart q).symm.trans (kernelQuotientChart r) : SpatialCoordinates→SpatialCoordinates)=_ at he rw [he] exact (kernelCoordinateTransition_contDiffAt r.out p hp' hq').contDiffWithinAt end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.SmoothTests namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix ContDiff Manifold abbrev hyperbolicSpatialChartedSpace : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ChartedSpace SpatialCoordinates HyperbolicSpace := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology hyperbolicSpatialChart.singletonChartedSpace hyperbolicSpatialChart_source theorem hyperbolicSpatialIsManifold : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace IsManifold 𝓘(ℝ,SpatialCoordinates) ∞ HyperbolicSpace := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace change IsManifold 𝓘(ℝ,SpatialCoordinates) ∞ HyperbolicSpace exact hyperbolicSpatialChart.isManifold_singleton hyperbolicSpatialChart_source lemma kernelLocalLift_source_out (q : KernelQuotient) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology q∈(kernelLocalLift q.out).source := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by have h := kernelQuotient_localHomeomorph.apply_self_mem_localInverseAt_source (x := q.out) change integralOrbitProjection globalKubotaKernel q.out∈(kernelLocalLift q.out).source at h rwa [show integralOrbitProjection globalKubotaKernel q.out=q from Quotient.out_eq q] at h abbrev kernelSpatialChartedSpace : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ChartedSpace SpatialCoordinates KernelQuotient := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology { atlas := Set.range kernelQuotientChart chartAt := kernelQuotientChart mem_chart_source q := ⟨kernelLocalLift_source_out q,Set.mem_univ _⟩ chart_mem_atlas q := ⟨q,rfl⟩ } theorem kernelSpatialIsManifold : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace IsManifold 𝓘(ℝ,SpatialCoordinates) ∞ KernelQuotient := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace change IsManifold 𝓘(ℝ,SpatialCoordinates) ∞ KernelQuotient apply isManifold_of_contDiffOn rintro e e' ⟨q,rfl⟩ ⟨r,rfl⟩ simpa only [modelWithCornersSelf_coe,modelWithCornersSelf_coe_symm,Function.id_comp, Function.comp_id,Set.preimage_id_eq,Set.range_id,Set.inter_univ,id_eq] using kernelQuotientChart_contDiffOn q r lemma hyperbolicSpatial_chartAt (w : HyperbolicSpace) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace chartAt SpatialCoordinates w=hyperbolicSpatialChart := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace change chartAt SpatialCoordinates w=hyperbolicSpatialChart exact rfl lemma kernelSpatial_chartAt (q : KernelQuotient) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace chartAt SpatialCoordinates q=kernelQuotientChart q := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace change chartAt SpatialCoordinates q=kernelQuotientChart q exact rfl lemma kernelProjection_contMDiff : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,SpatialCoordinates) ∞ (integralOrbitProjection globalKubotaKernel) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace change ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,SpatialCoordinates) ∞ (integralOrbitProjection globalKubotaKernel) intro w rw [contMDiffAt_iff] refine ⟨(continuous_integralOrbitProjection globalKubotaKernel).continuousAt,?_⟩ have hp : hyperbolicSpatialCoordinates w∈hyperbolicSpatialChart.target := hyperbolicSpatialChart.map_source (Set.mem_univ _) have hq : integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm (hyperbolicSpatialCoordinates w))∈ (kernelLocalLift (integralOrbitProjection globalKubotaKernel w).out).source := by have hleft := hyperbolicSpatialChart.left_inv (Set.mem_univ w) change hyperbolicSpatialChart.symm (hyperbolicSpatialCoordinates w)=w at hleft rw [hleft] exact kernelLocalLift_source_out _ have h : ContDiffWithinAt ℝ ∞ (kernelCoordinateTransition (integralOrbitProjection globalKubotaKernel w).out) Set.univ (hyperbolicSpatialCoordinates w) := (kernelCoordinateTransition_contDiffAt _ _ hp hq).contDiffWithinAt unfold kernelCoordinateTransition at h simpa only [extChartAt_coe,extChartAt_coe_symm,modelWithCornersSelf_coe, modelWithCornersSelf_coe_symm,Function.id_comp,Function.comp_id,Set.range_id, kernelSpatial_chartAt,hyperbolicSpatial_chartAt,kernelCoordinateTransition, kernelQuotientChart,OpenPartialHomeomorph.trans_apply,Function.comp_def, hyperbolicSpatialChart_apply,id_eq] using h end section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold ENNReal NNReal def kernelSmoothTests : Submodule ℂ (KernelQuotient→ℂ) := by letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace exact { carrier f := ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f ∧ HasCompactSupport f zero_mem' := ⟨contMDiff_const,HasCompactSupport.zero⟩ add_mem' hf hg := ⟨hf.1.add hg.1,hf.2.add hg.2⟩ smul_mem' c f hf := by have hc : ContDiff ℝ ∞ (fun z : ℂ => c*z) := contDiff_const.mul contDiff_id exact ⟨hc.contMDiff.comp hf.1,hf.2.smul_left⟩ } lemma kernelSmoothTests_memLp (f : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite MemLp f.1 2 (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : BorelSpace KernelQuotient := kernelQuotientBorel exact f.2.1.continuous.memLp_of_hasCompactSupport f.2.2 def kernelSmoothTestsToL2 : kernelSmoothTests→ₗ[ℂ]KernelQuotientL2 where toFun f := (kernelSmoothTests_memLp f).toLp f.1 map_add' _ _ := rfl map_smul' _ _ := rfl lemma kernelL2_smooth_compact_approx (f : KernelQuotientL2) (ε : ℝ) (hε : 0<ε) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite ∃g : kernelSmoothTests, eLpNorm ((f : KernelQuotient→ℂ)-g.1) 2 (integralQuotientVolume globalKubotaKernel)≤ ENNReal.ofReal ε := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : IsManifold 𝓘(ℝ,SpatialCoordinates) ∞ KernelQuotient := kernelSpatialIsManifold let : BorelSpace KernelQuotient := kernelQuotientBorel let : LocallyCompactSpace KernelQuotient := kernelQuotientLocallyCompact let : SecondCountableTopology KernelQuotient := kernelQuotientSecondCountable let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel obtain ⟨g,hgK,hfg,hgc,hgLp⟩ := kernelL2_continuous_compact_approx f (ENNReal.ofReal (ε/2)) (by positivity) let mass : ℝ≥0∞ := (integralQuotientVolume globalKubotaKernel Set.univ)^((2:ℝ≥0∞).toReal⁻¹) have hm : mass≠(∞:ℝ≥0∞) := ENNReal.rpow_ne_top_of_nonneg (by norm_num) (measure_ne_top _ _) let deltaLoss : ℝ := ε/(2*(mass.toReal+1)) have hδ : 0 deltaLoss) continuous_const (fun _ => hδ) have hkK : HasCompactSupport (k : KernelQuotient→ℂ) := HasCompactSupport.of_support_subset_isCompact hgK (hksupp.trans (subset_tsupport g)) let kt : kernelSmoothTests := ⟨k,k.contMDiff,hkK⟩ have hkgLp : eLpNorm (g-(k : KernelQuotient→ℂ)) 2 (integralQuotientVolume globalKubotaKernel)≤ ENNReal.ofReal (ε/2) := by have hb : ∀ᵐ q ∂integralQuotientVolume globalKubotaKernel,‖g q-k q‖≤deltaLoss := Filter.Eventually.of_forall fun q => by simpa only [dist_eq_norm,norm_sub_rev] using (hkg q).le have hmul : mass.toReal*deltaLoss≤ε/2 := by have he : deltaLoss*(2*(mass.toReal+1))=ε := div_mul_cancel₀ _ (by positivity) have hp := ENNReal.toReal_nonneg (a := mass) nlinarith [mul_nonneg hp hδ.le] calc _ ≤ mass*ENNReal.ofReal deltaLoss := eLpNorm_le_of_ae_bound (hgc.sub k.contMDiff.continuous).aestronglyMeasurable hb _ = ENNReal.ofReal (mass.toReal*deltaLoss) := by rw [ENNReal.ofReal_mul ENNReal.toReal_nonneg,ENNReal.ofReal_toReal hm] _ ≤ ENNReal.ofReal (ε/2) := ENNReal.ofReal_le_ofReal hmul refine ⟨kt,?_⟩ have he : (f : KernelQuotient→ℂ)-kt.1=((f : KernelQuotient→ℂ)-g)+(g-(k : KernelQuotient→ℂ)) := by funext q change f q-k q=(f q-g q)+(g q-k q) ring rw [he] calc _ ≤ eLpNorm ((f : KernelQuotient→ℂ)-g) 2 (integralQuotientVolume globalKubotaKernel)+ eLpNorm (g-(k : KernelQuotient→ℂ)) 2 (integralQuotientVolume globalKubotaKernel) := eLpNorm_add_le (by norm_num) _ ≤ ENNReal.ofReal (ε/2)+ENNReal.ofReal (ε/2) := add_le_add hfg hkgLp _ = ENNReal.ofReal ε := by rw [← ENNReal.ofReal_add (by positivity) (by positivity)]; congr 1; ring lemma kernelSmoothTestsToL2_dense : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace DenseRange kernelSmoothTestsToL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply Metric.denseRange_iff.mpr intro f ε hε obtain ⟨g,hg⟩ := kernelL2_smooth_compact_approx f (ε/2) (by positivity) refine ⟨g,?_⟩ have he : ‖f-kernelSmoothTestsToL2 g‖= (eLpNorm ((f : KernelQuotient→ℂ)-g.1) 2 (integralQuotientVolume globalKubotaKernel)).toReal := by rw [Lp.norm_def] congr 1 apply eLpNorm_congr_ae exact (Lp.coeFn_sub _ _).trans ((Filter.EventuallyEq.refl _ _).sub (kernelSmoothTests_memLp g).coeFn_toLp) rw [dist_eq_norm,he] exact lt_of_le_of_lt ((ENNReal.toReal_mono (by simp) hg).trans_eq (ENNReal.toReal_ofReal (by positivity))) (by linarith) end open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold ENNReal lemma hyperbolicSpatialChart_symm_eq {p : SpatialCoordinates} (hp : p∈hyperbolicSpatialChart.target) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology hyperbolicSpatialChart.symm p=upperPoint (spatialHorizontal p) (p 2) (hyperbolicSpatialChart_target_positive hp) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by have h := hyperbolicSpatialCoordinates_reconstruct (hyperbolicSpatialChart.symm p) have he : hyperbolicSpatialCoordinates (hyperbolicSpatialChart.symm p)=p := hyperbolicSpatialChart.right_inv hp simpa only [he,spatialHorizontal] using h.symm end CubicEisenstein open scoped BigOperators Classical SchwartzMap namespace InitialMeanSquare section open ActualEisensteinCubic SecondPassArithmetic open SecondPassIntegration (elementNorm) open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] (p : ι→O) [∀i,(Ideal.span {p i}).IsMaximal] omit [∀ (i : ι), (span {p i}).IsMaximal] in lemma quotient_span_fixed (r : O) (x : SecondExpansionData ι) (hx : InSecondQuotientSector p r x) : Ideal.span {secondExpansionQuotient p x}=Ideal.span {r} := by obtain ⟨hE,hr⟩ := hx rwa [secondExpansionQuotient_of_subset p x hE] omit [∀ (i : ι), (span {p i}).IsMaximal] in lemma quotient_norm_fixed (r : O) (x : SecondExpansionData ι) (hx : InSecondQuotientSector p r x) : elementNorm (secondExpansionQuotient p x)=elementNorm r := by simp only [elementNorm,eisEmbedding_norm_sq_eq_absNorm_span,quotient_span_fixed p r x hx] variable (hp : ∀i,p i≠0) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem postCommonSmoothPair_fixed_mask (F : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m r f y₁ y₂ : O) (x : SecondExpansionData ι) (hx : InSecondQuotientSector p r x) (A₁ A₂ W : 𝓢(ℝ,ℂ)) (V : Fin 7→ℝ→ℂ) (z ud ue uv kap X₁ X₂ R : ℝ) : postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ (m*secondExpansionQuotient p x) f y₁ y₂ A₁ A₂ W V z ud ue uv kap X₁ X₂ R= postCommonSmoothPair p hp hcop hg F Ψ₁ Ψ₂ (m*r) f y₁ y₂ A₁ A₂ W V z ud ue uv kap X₁ X₂ R := by have hm : Ideal.span {m*secondExpansionQuotient p x}=Ideal.span {m*r} := by rw [←Ideal.span_singleton_mul_span_singleton,←Ideal.span_singleton_mul_span_singleton, quotient_span_fixed p r x hx] simp only [postCommonSmoothPair,secondChildColumn,rowCoprimeMask_congr_span p _ hm] theorem sourceWeight_norm_fixed (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (Ψ : O→*ℂ) (m r : O) (ray : SecondRayIndex) (Z H : ℝ) (x : SecondExpansionData ι) (hx : InSecondQuotientSector p r x) (hZ : 0 Ideal.span {p i}) x.divisor)/E) def sourceLogV (V : ℝ) (x : SecondExpansionData ι) : ℝ := Real.log (primeProductNorm p x.overlap/V) def sourceLogK (K : ℝ) (x : SecondExpansionData ι) : ℝ := Real.log (elementNorm (sourceObservation p x).1/K) end theorem initial_sector_fixed_profiles (U : ℝ→ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g₁ g₂ W : 𝓢(ℝ,ℂ)) (A : ℝ) (hA : 0≤A) (hU₁ : ∀t,g₁ t≠0→U t=1) (hU₂ : ∀t,g₂ t≠0→U t=1) (hg₁ : ∀t,g₁ t≠0→|t|≤A) (hg₂ : ∀t,g₂ t≠0→|t|≤A) : ∃ (A₁ A₂ : 𝓢(ℝ,ℂ)) (windows : Fin 7→ℝ→ℂ), (∀i,HasCompactSupport (windows i)) ∧ (∀i,ContDiff ℝ ∞ (windows i)) ∧ (∀i t,windows i t≠0→|t|≤A+2+1) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hpr : ∀i,lambda^2∣p i-1) (F : Finset ι) (Ψ : O→*ℂ) (m r : O) (ray : SecondRayIndex) (s : Finset (SecondExpansionData ι)) (Z H E V X K : ℝ), 0 normalizedColumn p (fun T => g₁ (columnLog p Z T)) S) (fun S => normalizedColumn p (fun T => g₂ (columnLog p Z T)) S) W H = initialSourceSum p hp hcop hg s (sourceWeight p hp hcop hg Ψ m ray Z H) F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) A₁ A₂ W windows (sourceLogZ p Z X) (fun _ => 0) (sourceLogE p E) (sourceLogV p V) (sourceLogK p K) X X (H*K/(E^2*V^2*X^2)) := by obtain ⟨A₁,A₂,windows,hwc,hws,hwb,hid⟩ := initial_source_fixed_profiles U hUc hUs g₁ g₂ W A 2 hA (by norm_num) hU₁ hU₂ hg₁ hg₂ refine ⟨A₁,A₂,windows,hwc,hws,hwb,?_⟩ intro ι _ p hp _ hcop hg hinj hpr F Ψ m r ray s Z H E V X K hZ hE hV hX hK hs hk hz he hv hkap calc _ = ∑x∈s,secondExpansionSource p hp hcop hg F Ψ m 1 1 ray {x} (fun S => normalizedColumn p (fun T => g₁ (columnLog p Z T)) S) (fun S => normalizedColumn p (fun T => g₂ (columnLog p Z T)) S) W H := by simp only [secondExpansionSource,Finset.sum_singleton] _ = _ := by unfold initialSourceSum apply Finset.sum_congr rfl intro x hx obtain ⟨hsubset,_⟩ := hs x hx have hh := hid p hp hcop hg hinj hpr F Ψ m ray x Z H E V X K hsubset (hk x hx) hZ hE hV hX hK (hz x hx) (he x hx) (hv x hx) (hkap x hx) rw [hh] rw [postCommonSmoothPair_fixed_mask p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) m r _ _ _ x (hs x hx)] rfl end open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff FourierTransform open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (normalizedColumn columnLog firstLogDensity) theorem initial_sector_transfer (U : ℝ→ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g W : 𝓢(ℝ,ℂ)) (A : ℝ) (hA : 0≤A) (hU : ∀t,g t≠0→U t=1) (hgA : ∀t,g t≠0→|t|≤A) (ε : ℝ) (hε : 0<ε) (N J : ℕ) : ∃ (windows : Fin 7→ℝ→ℂ) (C Cₛ : ℝ),0≤C ∧ 0≤Cₛ ∧ (∀i,HasCompactSupport (windows i)) ∧ (∀i,ContDiff ℝ ∞ (windows i)) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (_hpr : ∀i,lambda^2∣p i-1) (F : Finset ι) (Ψ : O→*ℂ) (m r : O) (ray : SecondRayIndex) (s : Finset (SecondExpansionData ι)) (Z H E V X K : ℝ), 0 normalizedColumn p (fun T => g (columnLog p Z T)) S) (fun S => normalizedColumn p (fun T => g (columnLog p Z T)) S) W H‖≤ (C*H*elementNorm r/Z^2*‖secondRayCoefficient ray‖*(K*Real.exp 2)^ε)* (∫t₁:ℝ,∫t₂:ℝ,∫t₃:ℝ,B (t₁,t₂,t₃)* sourceGeometricMean p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) (windows 5) (windows 6) X X (t₁,t₂,t₃)) := by obtain ⟨A₁,A₂,windows,hwc,hws,hwb,hid⟩ := initial_sector_fixed_profiles U hUc hUs g g W A hA hU hU hgA hgA obtain ⟨Cw,hCw,hwbound⟩ := outerWindow_global_bound windows hwc (fun i => (hws i).continuous) have hM : 0≤A+2+1 := by linarith obtain ⟨Cₐ,hCₐ,Cₛ,hCₛ,htrans⟩ := initial_source_uniform_transfer ε hε A₁ A₂ W windows (fun _ => A+2+1) (fun _ => hM) hwb N J refine ⟨windows,Cw*Cₐ,Cₛ,mul_nonneg hCw hCₐ.le,hCₛ,hwc,hws,?_⟩ intro ι _ p hp _ hcop hg hinj hc hpr F Ψ m r ray s Z H E V X K hZ hH hE hV hX hK hΨ hs hk hz he hv hkap let R := H*K/(E^2*V^2*X^2) have hR : 0 ‖tripleCoefficient (𝓕 A₁) (𝓕 A₂) b q‖ refine ⟨B,fun q => norm_nonneg _,?_,?_⟩ · intro q simpa only [B,R,tripleCoefficient,mul_assoc] using hpoint q.1 q.2.1 q.2.2 · let T := s.image (sourceObservation p) have hT0 : ∀y∈T,y.1≠0 := by intro y hy obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hy exact sourceRow_nonzero p x (hk x hx) have hTK : ∀y∈T,(Ideal.absNorm (Ideal.span {y.1}):ℝ)≤K*Real.exp 2 := by intro y hy obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hy have hpos := elementNorm_pos _ (sourceRow_nonzero p x (hk x hx)) have hl : Real.log (elementNorm (sourceObservation p x).1/K)≤2 := (le_abs_self _).trans (hkap x hx) have hh := Real.exp_le_exp.mpr hl rw [Real.exp_log (div_pos hpos hK)] at hh have hh' := (div_le_iff₀ hK).mp hh simpa only [elementNorm,eisEmbedding_norm_sq_eq_absNorm_span,mul_comm] using hh' let D := H*elementNorm r/Z^2*‖secondRayCoefficient ray‖ have hD : 0≤D := by dsimp [D,elementNorm]; positivity have hweights : ∀x∈s,‖sourceWeight p hp hcop hg Ψ m ray Z H x‖* ‖outerWindow windows (sourceLogZ p Z X x) 0 (sourceLogE p E x) (sourceLogV p V x) (sourceLogK p K x)‖≤D*Cw := by intro x hx exact mul_le_mul (sourceWeight_norm_fixed p hp hcop hg hinj hc Ψ m r ray Z H x (hs x hx) hZ hH.le (hΨ _) (hΨ _)) (hwbound _ _ _ _ _) (norm_nonneg _) hD have hh := hbound p hp hcop hg hinj r s T (sourceWeight p hp hcop hg Ψ m ray Z H) (D*Cw) (K*Real.exp 2) F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (sourceLogZ p Z X) (fun _ => 0) (sourceLogE p E) (sourceLogV p V) (sourceLogK p K) X X (mul_nonneg hD hCw) (by positivity) hs (fun x hx => Finset.mem_image.mpr ⟨x,hx,rfl⟩) hT0 hTK hweights rw [hid p hp hcop hg hinj hpr F Ψ m r ray s Z H E V X K hZ hE hV hX hK hs hk hz he hv hkap] convert hh using 1 ; dsimp [D,B,R,T] ; ring end InitialMeanSquare open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic theorem descent_ideal_inverse_sum (S : Finset (Ideal O)) (H : ℝ) (hS : ∀ I∈S,I≠0) (hH : ∀ I∈S,(Ideal.absNorm I : ℝ)≤H) : (∑ I∈S,1/(Ideal.absNorm I : ℝ))≤128*Real.exp 1*(normLogBin H+1 : ℝ) := by have hpos (I : Ideal O) (hI : I∈S) : 1≤(Ideal.absNorm I : ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => hS I hI (Ideal.absNorm_eq_zero_iff.mp hz)) let T := Finset.range (normLogBin H+1) let bin (j : ℕ) := S.filter (fun I => normLogBin (Ideal.absNorm I)=j) have hmap : ∀ I∈S,normLogBin (Ideal.absNorm I : ℝ)∈T := by intro I hI exact Finset.mem_range.mpr (Nat.lt_succ_of_le (normLogBin_mono (by linarith [hpos I hI]) (hH I hI))) have hbin (j : ℕ) : (∑ I∈bin j,1/(Ideal.absNorm I : ℝ))≤128*Real.exp 1 := by have hp := normLogScale_pos j have hone := normLogScale_ge_one j have he := Real.one_le_exp (show (0 : ℝ)≤1 by norm_num) have hc : ((bin j).card : ℝ)≤128*(normLogScale j*Real.exp 1) := by apply DescentFiberCost.finite_ideal_count_real _ _ (by nlinarith) · intro I hI exact hS I (Finset.mem_filter.mp hI).1 · intro I hI obtain ⟨hIS,hj⟩ := Finset.mem_filter.mp hI simpa only [hj] using (normLogBin_scale_bounds (Ideal.absNorm I : ℝ) (hpos I hIS)).2 have ht (I : Ideal O) (hI : I∈bin j) : 1/(Ideal.absNorm I : ℝ)≤1/normLogScale j := by obtain ⟨hIS,hj⟩ := Finset.mem_filter.mp hI have hb := (normLogBin_scale_bounds (Ideal.absNorm I : ℝ) (hpos I hIS)).1 rw [hj] at hb exact one_div_le_one_div_of_le hp hb calc _ ≤ ∑ _I∈bin j,1/normLogScale j := Finset.sum_le_sum ht _ = ((bin j).card : ℝ)/normLogScale j := by simp [div_eq_mul_inv] _ ≤ (128*(normLogScale j*Real.exp 1))/normLogScale j := div_le_div_of_nonneg_right hc hp.le _ = _ := by field_simp rw [← Finset.sum_fiberwise_of_maps_to hmap] calc _ ≤ ∑ _j∈T,128*Real.exp 1 := Finset.sum_le_sum (fun j _ => hbin j) _ = _ := by simp [T]; ring theorem descent_normLogBin_small_power (ε : ℝ) (hε : 0<ε) (H : ℝ) (hH : 1≤H) : (normLogBin H+1 : ℝ)≤(1+1/ε)*H^ε := by have hH0 : 0 x.leftExponent i+x.rightExponent i)}, Ideal.span {(b0Label p x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit* j2Label p x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit)}) def cubeDivisorKey (x : CubeCoordinates ι) : Fin 3 → Ideal O := ![Ideal.span {primeProduct p x.support x.leftExponent}, Ideal.span {aLabel p x.support x.leftBit},Ideal.span {aLabel p x.support x.rightBit}] omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem cubeParityKey_product (x : CubeCoordinates ι) : cubeProductIdeal p x=(cubeParityKey p x).2^2*(cubeParityKey p x).1 := by have h := FirstPassCubeLabels.cube_pair_product_decomposition p x.support x.leftExponent x.rightExponent x.leftBit x.rightBit x.support_pos have h' := congrArg (fun z : O => (Ideal.span {z} : Ideal O)) h simp only [cubeProductIdeal,cubeParityKey,pow_two,←Ideal.span_singleton_mul_span_singleton] at h' ⊢ convert h' using 1 ; congr 1 ; ring omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem cubeDivisorKey_dvd (x : CubeCoordinates ι) (i : Fin 3) : cubeDivisorKey p x i ∣ cubeProductIdeal p x := by have hA1 := span_dvd_of_element_dvd (aLabel_dvd_primeProduct p x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.support_pos) have hA2 := span_dvd_of_element_dvd (aLabel_dvd_primeProduct p x.support (fun i => x.leftExponent i+x.rightExponent i) x.rightBit x.support_pos) rw [primeProduct_add,←Ideal.span_singleton_mul_span_singleton] at hA1 hA2 fin_cases i · exact dvd_mul_right _ _ · exact hA1 · exact hA2 variable (hp : ∀ i,p i≠0) include hp omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem cubeParityKey_ne_zero (x : CubeCoordinates ι) : (cubeParityKey p x).1≠0 ∧ (cubeParityKey p x).2≠0 := by constructor · exact (Ideal.span_singleton_eq_bot.not).mpr (primeProduct_ne_zero p hp _ _) · exact (Ideal.span_singleton_eq_bot.not).mpr (mul_ne_zero (primeProduct_ne_zero p hp _ _) (primeProduct_ne_zero p hp _ _)) variable (hinj : Function.Injective (fun i => Ideal.span {p i})) include hinj theorem cubeDivisorKey_injective_on_product {x y : CubeCoordinates ι} (hx : x.Admissible) (hy : y.Admissible) (hprod : cubeProductIdeal p x=cubeProductIdeal p y) (hk : cubeDivisorKey p x=cubeDivisorKey p y) : x=y := by have h1 := congrFun hk 0 have hA1 := congrFun hk 1 have hA2 := congrFun hk 2 change Ideal.span {primeProduct p x.support x.leftExponent}= Ideal.span {primeProduct p y.support y.leftExponent} at h1 have h2 : Ideal.span {primeProduct p x.support x.rightExponent}= Ideal.span {primeProduct p y.support y.rightExponent} := by apply mul_left_cancel₀ ((Ideal.span_singleton_eq_bot.not).mpr (primeProduct_ne_zero p hp x.support x.leftExponent)) simpa only [cubeProductIdeal,h1] using hprod have hv1 := primeProduct_span_exponents_eq p hinj x.support y.support x.leftExponent y.leftExponent x.left_off y.left_off h1 have hv2 := primeProduct_span_exponents_eq p hinj x.support y.support x.rightExponent y.rightExponent x.right_off y.right_off h2 change Ideal.span {aLabel p x.support x.leftBit}=Ideal.span {aLabel p y.support y.leftBit} at hA1 change Ideal.span {aLabel p x.support x.rightBit}=Ideal.span {aLabel p y.support y.rightBit} at hA2 rw [CubeCoordinates.aLabel_left p x hx,CubeCoordinates.aLabel_left p y hy, FiniteGaussPhase.span_finset_prod,FiniteGaussPhase.span_finset_prod] at hA1 rw [CubeCoordinates.aLabel_right p x hx,CubeCoordinates.aLabel_right p y hy, FiniteGaussPhase.span_finset_prod,FiniteGaussPhase.span_finset_prod] at hA2 exact CubeCoordinates.ext (Finsupp.ext (congrFun hv1)) (Finsupp.ext (congrFun hv2)) (FirstCauchyArithmetic.family_product_injective _ hinj hA1) (FirstCauchyArithmetic.family_product_injective _ hinj hA2) theorem cubeParityKey_fiber_card (s : Finset (CubeCoordinates ι)) (q : Ideal O × Ideal O) (hq1 : q.1≠0) (hq2 : q.2≠0) (hs : ∀ x∈s,x.Admissible) (hk : ∀ x∈s,cubeParityKey p x=q) : s.card≤(idealDivisors (q.2^2*q.1)).card^3 := by let D := idealDivisors (q.2^2*q.1) have hprod0 : q.2^2*q.1≠0 := mul_ne_zero (pow_ne_zero _ hq2) hq1 let encode (x : s) : Fin 3 → D := fun i => ⟨cubeDivisorKey p x.val i,by apply (mem_idealDivisors hprod0).mpr have h := cubeDivisorKey_dvd p x.val i simpa only [cubeParityKey_product,hk x.val x.property] using h⟩ have hi : Function.Injective encode := by intro x y he apply Subtype.ext apply cubeDivisorKey_injective_on_product p hp hinj (hs _ x.property) (hs _ y.property) · simp only [cubeParityKey_product,hk _ x.property,hk _ y.property] · funext i exact congrArg Subtype.val (congrFun he i) simpa only [Fintype.card_coe,Fintype.card_fun,Fintype.card_fin,D] using Fintype.card_le_of_injective encode hi end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.DivisorTargets namespace OAI noncomputable section namespace SecondPassArithmetic open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators section open scoped BigOperators Classical section open ActualEisensteinCubic lemma parity_pair_norm_bounds (s u : Ideal O) (B : ℝ) (hB : 0 hs (Ideal.absNorm_eq_zero_iff.mp hz)) have hu1 : 1≤(Ideal.absNorm u : ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => hu (Ideal.absNorm_eq_zero_iff.mp hz)) have hs0 : 0<(Ideal.absNorm s : ℝ) := by linarith have hsqrt : 0 x.1=s)).card : ℝ)≤128*B/Real.sqrt (Ideal.absNorm s) := by obtain ⟨x,hx,hxs⟩ := Finset.mem_image.mp hs have hnx := parity_pair_norm_bounds x.1 x.2 B hB (hS x hx).1 (hS x hx).2.1 (hS x hx).2.2 have hu1 : 1≤(Ideal.absNorm x.2 : ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => (hS x hx).2.1 (Ideal.absNorm_eq_zero_iff.mp hz)) have hscale : 1≤B/Real.sqrt (Ideal.absNorm s) := by simpa only [hxs] using hu1.trans hnx.2 let T := S.filter (fun x => x.1=s) have hi : Set.InjOn (fun x : Ideal O × Ideal O => x.2) (↑T : Set (Ideal O × Ideal O)) := by intro x hx y hy he exact Prod.ext ((Finset.mem_filter.mp hx).2.trans (Finset.mem_filter.mp hy).2.symm) he have hcount := DescentFiberCost.finite_ideal_count_real (T.image Prod.snd) (B/Real.sqrt (Ideal.absNorm s)) hscale (fun u hu => by obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hu exact (hS x (Finset.mem_filter.mp hx).1).2.1) (fun u hu => by obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hu have hn := parity_pair_norm_bounds x.1 x.2 B hB (hS x (Finset.mem_filter.mp hx).1).1 (hS x (Finset.mem_filter.mp hx).1).2.1 (hS x (Finset.mem_filter.mp hx).1).2.2 simpa only [(Finset.mem_filter.mp hx).2] using hn.2) rw [Finset.card_image_iff.mpr hi] at hcount simpa only [mul_div_assoc] using hcount theorem parity_ideal_pair_count (S : Finset (Ideal O × Ideal O)) (B H : ℝ) (hB : 0 x.1=s)).card : ℝ) := by calc _ = ∑_x∈S,(1 : ℝ) := by simp _ = ∑s∈A,∑_x∈S.filter (fun x => x.1=s),(1 : ℝ) := (Finset.sum_fiberwise_of_maps_to (fun x hx => Finset.mem_image_of_mem Prod.fst hx) _).symm _ = _ := by simp rw [he] have hpoint (s : Ideal O) (hs : s∈A) : 1/Real.sqrt (Ideal.absNorm s : ℝ)≤H/(Ideal.absNorm s : ℝ) := by have hs0 : 0<(Ideal.absNorm s : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun hz => (hA s hs).1 (Ideal.absNorm_eq_zero_iff.mp hz)) have hroot : 0 parity_pair_fiber_count S B hB hS s hs) _ ≤ ∑s∈A,(128*B*H)*(1/(Ideal.absNorm s : ℝ)) := by apply Finset.sum_le_sum intro s hs have h := mul_le_mul_of_nonneg_left (hpoint s hs) (by positivity : 0≤128*B) convert h using 1 <;> ring _ = (128*B*H)*∑s∈A,1/(Ideal.absNorm s : ℝ) := (Finset.mul_sum _ _ _).symm _ ≤ (128*B*H)*(128*Real.exp 1*(normLogBin (B^2)+1 : ℝ)) := mul_le_mul_of_nonneg_left (descent_ideal_inverse_sum A (B^2) (fun s hs => (hA s hs).1) (fun s hs => (hA s hs).2.1)) (by positivity) _ = _ := by ring open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm primeProduct aLabel squarefreeLabel cubeActiveSupport) open ConcreteTraceCRT (eisEmbedding) open IdealMobiusDivisorSum (idealDivisors) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i≠0) [∀ i,(Ideal.span {p i}).IsMaximal] omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem cubeParityKey_norm_product (x : CubeCoordinates ι) : (Ideal.absNorm (cubeParityKey p x).2 : ℝ)^2*Ideal.absNorm (cubeParityKey p x).1 = ‖eisEmbedding (primeProduct p x.support x.leftExponent)‖^2* ‖eisEmbedding (primeProduct p x.support x.rightExponent)‖^2 := by have h := congrArg (fun I : Ideal O => (Ideal.absNorm I : ℝ)) (cubeParityKey_product p x) simpa only [cubeProductIdeal,map_mul,map_pow,Nat.cast_mul,Nat.cast_pow, ←eisEmbedding_norm_sq_eq_absNorm_span] using h.symm include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem cubeParityKey_active_bound (x : CubeCoordinates ι) (H : ℝ) (ha : ‖eisEmbedding (∏ i∈cubeActiveSupport x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit,p i)‖≤H) : (Ideal.absNorm (cubeParityKey p x).1 : ℝ)≤H^2 := by have h := squarefreeLabel_active_bound p hp x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit change ‖eisEmbedding _‖^2≤‖eisEmbedding _‖^2 at h exact (show (Ideal.absNorm (cubeParityKey p x).1 : ℝ)≤‖eisEmbedding (∏ i∈cubeActiveSupport x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit,p i)‖^2 from by simpa only [cubeParityKey,←eisEmbedding_norm_sq_eq_absNorm_span] using h).trans (pow_le_pow_left₀ (norm_nonneg _) ha 2) end theorem cube_coordinates_parity_count (ε : ℝ) (hε : 0<ε) : ∃ C : ℝ,0 Ideal.span {p i})) (s : Finset (CubeCoordinates ι)) (B H : ℝ), 1≤B → 0≤H → (∀ x∈s,x.Admissible) → (∀ x∈s,‖eisEmbedding (primeProduct p x.support x.leftExponent)‖^2≤B) → (∀ x∈s,‖eisEmbedding (primeProduct p x.support x.rightExponent)‖^2≤B) → (∀ x∈s,‖eisEmbedding (∏ i∈cubeActiveSupport x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit,p i)‖≤H) → (s.card : ℝ)≤C*B^(1+ε)*H := by obtain ⟨D,hD,hdiv⟩ := IdealDivisorBound.ideal_divisor_small_power (ε/12) (by positivity) let C := D^3*(16384*Real.exp 1)*(1+1/(ε/4)) refine ⟨C,by dsimp [C]; positivity,?_⟩ intro ι _ p hp _ hinj s B H hB hH hs hb1 hb2 ha have hB0 : 0 cubeParityKey p x=q)).card : ℝ)≤D^3*B^(ε/2) := by have hq0 := hQ q hq have hqprod0 : q.2^2*q.1≠0 := mul_ne_zero (pow_ne_zero _ hq0.2.1) hq0.1 have hc : ((s.filter (fun x => cubeParityKey p x=q)).card : ℝ)≤ ((idealDivisors (q.2^2*q.1)).card : ℝ)^3 := by exact_mod_cast cubeParityKey_fiber_card p hp hinj (s.filter (fun x => cubeParityKey p x=q)) q hq0.1 hq0.2.1 (fun x hx => hs x (Finset.mem_filter.mp hx).1) (fun x hx => (Finset.mem_filter.mp hx).2) have hn : (Ideal.absNorm (q.2^2*q.1) : ℝ)≤B^2 := by simpa only [map_mul,map_pow,Nat.cast_mul,Nat.cast_pow] using hq0.2.2 calc _ ≤ ((idealDivisors (q.2^2*q.1)).card : ℝ)^3 := hc _ ≤ (D*(Ideal.absNorm (q.2^2*q.1) : ℝ)^(ε/12))^3 := pow_le_pow_left₀ (Nat.cast_nonneg _) (hdiv _ hqprod0) 3 _ ≤ (D*(B^2)^(ε/12))^3 := by gcongr _ = D^3*B^(ε/2) := by rw [mul_pow] congr 1 rw [←Real.rpow_natCast,←Real.rpow_mul (sq_nonneg B), ←Real.rpow_natCast,←Real.rpow_mul hB0.le] congr 1 ring have hqcard := parity_ideal_pair_count Q B H hB0 hH hQ hQactive have hlog := descent_normLogBin_small_power (ε/4) (by positivity) (B^2) (one_le_pow₀ hB) have hlog' : (normLogBin (B^2)+1 : ℝ)≤(1+1/(ε/4))*B^(ε/2) := by convert hlog using 1 rw [←Real.rpow_natCast,←Real.rpow_mul hB0.le] congr 2 ring have hsum : (s.card : ℝ)=∑q∈Q,((s.filter (fun x => cubeParityKey p x=q)).card : ℝ) := by calc _ = ∑_x∈s,(1 : ℝ) := by simp _ = ∑q∈Q,∑_x∈s.filter (fun x => cubeParityKey p x=q),(1 : ℝ) := (Finset.sum_fiberwise_of_maps_to (fun x hx => Finset.mem_image_of_mem (cubeParityKey p) hx) _).symm _ = _ := by simp rw [hsum] calc _ ≤ ∑_q∈Q,D^3*B^(ε/2) := Finset.sum_le_sum hfiber _ = (Q.card : ℝ)*(D^3*B^(ε/2)) := by simp _ ≤ (16384*Real.exp 1*B*H*(normLogBin (B^2)+1 : ℝ))*(D^3*B^(ε/2)) := by gcongr _ ≤ (16384*Real.exp 1*B*H*((1+1/(ε/4))*B^(ε/2)))*(D^3*B^(ε/2)) := by gcongr _ = C*B^(1+ε)*H := by rw [Real.rpow_add hB0,Real.rpow_one] have he : B^(ε/2)*B^(ε/2)=B^ε := by rw [←Real.rpow_add hB0]; congr 1; ring dsimp [C] calc _ = D^3*(16384*Real.exp 1)*(1+1/(ε/4))*B*(B^(ε/2)*B^(ε/2))*H := by ring _ = _ := by rw [he]; ring end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct cubeActiveSupport) open ConcreteTraceCRT (eisEmbedding) open IdealMobiusDivisorSum (idealDivisors) theorem parity_ideal_pair_inverse_sqrt_sum (S : Finset (Ideal O × Ideal O)) (B : ℝ) (hB : 0 x.1=s)).card : ℝ)/Real.sqrt (Ideal.absNorm s : ℝ) := by calc _ = ∑s∈A,∑q∈S.filter (fun x => x.1=s),1/Real.sqrt (Ideal.absNorm q.1 : ℝ) := (Finset.sum_fiberwise_of_maps_to (fun x hx => Finset.mem_image_of_mem Prod.fst hx) _).symm _ = _ := by apply Finset.sum_congr rfl intro s hs have h : (∑q∈S.filter (fun x => x.1=s),1/Real.sqrt (Ideal.absNorm q.1 : ℝ))= ∑_q∈S.filter (fun x => x.1=s),1/Real.sqrt (Ideal.absNorm s : ℝ) := Finset.sum_congr rfl (fun q hq => by rw [(Finset.mem_filter.mp hq).2]) rw [h] simp [div_eq_mul_inv] rw [he] calc _ ≤ ∑s∈A,128*B/(Ideal.absNorm s : ℝ) := by apply Finset.sum_le_sum intro s hs have hpos : 0<(Ideal.absNorm s : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun hz => (hA s hs).1 (Ideal.absNorm_eq_zero_iff.mp hz)) calc _ ≤ (128*B/Real.sqrt (Ideal.absNorm s : ℝ))/Real.sqrt (Ideal.absNorm s : ℝ) := div_le_div_of_nonneg_right (parity_pair_fiber_count S B hB hS s hs) (Real.sqrt_nonneg _) _ = _ := by rw [div_div,←pow_two,Real.sq_sqrt hpos.le] _ = (128*B)*∑s∈A,1/(Ideal.absNorm s : ℝ) := by rw [Finset.mul_sum]; apply Finset.sum_congr rfl; intro s hs; ring _ ≤ (128*B)*(128*Real.exp 1*(normLogBin (B^2)+1 : ℝ)) := mul_le_mul_of_nonneg_left (descent_ideal_inverse_sum A (B^2) (fun s hs => (hA s hs).1) (fun s hs => (hA s hs).2)) (by positivity) _ = _ := by ring theorem cube_coordinates_inverse_active_sum (ε : ℝ) (hε : 0<ε) : ∃ C : ℝ,0 Ideal.span {p i})) (s : Finset (CubeCoordinates ι)) (B : ℝ), 1≤B → (∀ x∈s,x.Admissible) → (∀ x∈s,‖eisEmbedding (primeProduct p x.support x.leftExponent)‖^2≤B) → (∀ x∈s,‖eisEmbedding (primeProduct p x.support x.rightExponent)‖^2≤B) → (∑x∈s,1/‖eisEmbedding (∏ i∈cubeActiveSupport x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit,p i)‖)≤C*B^(1+ε) := by obtain ⟨D,hD,hdiv⟩ := IdealDivisorBound.ideal_divisor_small_power (ε/12) (by positivity) let C := D^3*(16384*Real.exp 1)*(1+1/(ε/4)) refine ⟨C,by dsimp [C]; positivity,?_⟩ intro ι _ p hp _ hinj s B hB hs hb1 hb2 have hB0 : 0 cubeParityKey p x=q)).card : ℝ)≤D^3*B^(ε/2) := by have hq0 := hQ q hq have hqprod0 : q.2^2*q.1≠0 := mul_ne_zero (pow_ne_zero _ hq0.2.1) hq0.1 have hc : ((s.filter (fun x => cubeParityKey p x=q)).card : ℝ)≤ ((idealDivisors (q.2^2*q.1)).card : ℝ)^3 := by exact_mod_cast cubeParityKey_fiber_card p hp hinj (s.filter (fun x => cubeParityKey p x=q)) q hq0.1 hq0.2.1 (fun x hx => hs x (Finset.mem_filter.mp hx).1) (fun x hx => (Finset.mem_filter.mp hx).2) have hn : (Ideal.absNorm (q.2^2*q.1) : ℝ)≤B^2 := by simpa only [map_mul,map_pow,Nat.cast_mul,Nat.cast_pow] using hq0.2.2 calc _ ≤ ((idealDivisors (q.2^2*q.1)).card : ℝ)^3 := hc _ ≤ (D*(Ideal.absNorm (q.2^2*q.1) : ℝ)^(ε/12))^3 := pow_le_pow_left₀ (Nat.cast_nonneg _) (hdiv _ hqprod0) 3 _ ≤ (D*(B^2)^(ε/12))^3 := by gcongr _ = D^3*B^(ε/2) := by rw [mul_pow] congr 1 rw [←Real.rpow_natCast,←Real.rpow_mul (sq_nonneg B), ←Real.rpow_natCast,←Real.rpow_mul hB0.le] congr 1 ring have hlog := descent_normLogBin_small_power (ε/4) (by positivity) (B^2) (one_le_pow₀ hB) have hlog' : (normLogBin (B^2)+1 : ℝ)≤(1+1/(ε/4))*B^(ε/2) := by convert hlog using 1 rw [←Real.rpow_natCast,←Real.rpow_mul hB0.le] congr 2 ring have hpoint (x : CubeCoordinates ι) : 1/‖eisEmbedding (∏ i∈cubeActiveSupport x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit,p i)‖≤ 1/Real.sqrt (Ideal.absNorm (cubeParityKey p x).1 : ℝ) := by have hs0 : 0<(Ideal.absNorm (cubeParityKey p x).1 : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun hz => (cubeParityKey_ne_zero p hp x).1 (Ideal.absNorm_eq_zero_iff.mp hz)) have ha := cubeParityKey_active_bound p hp x _ le_rfl have hh : Real.sqrt (Ideal.absNorm (cubeParityKey p x).1 : ℝ)≤ ‖eisEmbedding (∏ i∈cubeActiveSupport x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit,p i)‖ := by nlinarith [Real.sq_sqrt hs0.le,norm_nonneg (eisEmbedding (∏ i∈cubeActiveSupport x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit,p i))] exact one_div_le_one_div_of_le (Real.sqrt_pos.mpr hs0) hh have he : (∑x∈s,1/Real.sqrt (Ideal.absNorm (cubeParityKey p x).1 : ℝ))= ∑q∈Q,((s.filter (fun x => cubeParityKey p x=q)).card : ℝ)*(1/Real.sqrt (Ideal.absNorm q.1 : ℝ)) := by calc _ = ∑q∈Q,∑x∈s.filter (fun x => cubeParityKey p x=q),1/Real.sqrt (Ideal.absNorm (cubeParityKey p x).1 : ℝ) := (Finset.sum_fiberwise_of_maps_to (fun x hx => Finset.mem_image_of_mem (cubeParityKey p) hx) _).symm _ = _ := by apply Finset.sum_congr rfl intro q hq have h := Finset.sum_congr rfl (fun x (hx : x∈s.filter (fun x => cubeParityKey p x=q)) => show 1/Real.sqrt (Ideal.absNorm (cubeParityKey p x).1 : ℝ)=1/Real.sqrt (Ideal.absNorm q.1 : ℝ) by rw [(Finset.mem_filter.mp hx).2]) rw [h] simp calc _ ≤ ∑x∈s,1/Real.sqrt (Ideal.absNorm (cubeParityKey p x).1 : ℝ) := Finset.sum_le_sum (fun x _ => hpoint x) _ = _ := he _ ≤ ∑q∈Q,(D^3*B^(ε/2))*(1/Real.sqrt (Ideal.absNorm q.1 : ℝ)) := by exact Finset.sum_le_sum (fun q hq => mul_le_mul_of_nonneg_right (hfiber q hq) (by positivity)) _ = (D^3*B^(ε/2))*(∑q∈Q,1/Real.sqrt (Ideal.absNorm q.1 : ℝ)) := (Finset.mul_sum _ _ _).symm _ ≤ (D^3*B^(ε/2))*(16384*Real.exp 1*B*(normLogBin (B^2)+1 : ℝ)) := mul_le_mul_of_nonneg_left (parity_ideal_pair_inverse_sqrt_sum Q B hB0 hQ) (by positivity) _ ≤ (D^3*B^(ε/2))*(16384*Real.exp 1*B*((1+1/(ε/4))*B^(ε/2))) := by gcongr _ = C*B^(1+ε) := by rw [Real.rpow_add hB0,Real.rpow_one] have he : B^(ε/2)*B^(ε/2)=B^ε := by rw [←Real.rpow_add hB0]; congr 1; ring dsimp [C] calc _ = D^3*(16384*Real.exp 1)*(1+1/(ε/4))*B*(B^(ε/2)*B^(ε/2)) := by ring _ = _ := by rw [he]; ring end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm cubeActiveSupport) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i≠0) [∀ i,(Ideal.span {p i}).IsMaximal] include hp in theorem globalFirst_diagonal_scalar (K ell B F : ℝ) (hK : 0 b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit,p i)‖) := by let x := b.append (⟨∅,∅,∅,1⟩ : SecondExpansionData ι) let j := globalScaleIndex p side x let A := globalCubeActiveRoot p x have hbds := globalScaleIndex_bounds p hp side x (by exact one_ne_zero) have hc := (hbds 1).2 have ha := (hbds 9).2 change primeProductNorm p b.common≤globalLogRep j 1*Real.exp 1 at hc change A^2≤globalLogRep j 9*Real.exp 1 at ha have hcp := FirstPassCubeLabels.primeProductNorm_pos p hp b.common have htp := FirstPassCubeLabels.primeProductNorm_pos p hp b.firstCommon have hA := globalCubeActiveRoot_pos p hp x change 0 Ideal.span {p i})) def globalFirstCountKey (b : GlobalFirstData ι) : CubeCoordinates ι × Finset ι × Finset ι := (b.cube,b.common,b.firstCommon) def globalFirstDivisorTarget (q : CubeCoordinates ι × Finset ι × Finset ι) : Ideal O := (∏i∈q.2.1,Ideal.span {p i})*(∏i∈q.1.support,Ideal.span {p i}) theorem globalFirstDivisorTarget_ne_zero (q : CubeCoordinates ι × Finset ι × Finset ι) : globalFirstDivisorTarget p q≠0 := by apply mul_ne_zero <;> exact Finset.prod_ne_zero_iff.mpr (fun i hi => NeZero.ne (Ideal.span {p i})) omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalFirst_divisor_dvd_target (b : GlobalFirstData ι) (hb : GlobalFirstAdmissible b) : (∏i∈b.firstDivisor,Ideal.span {p i})∣globalFirstDivisorTarget p (globalFirstCountKey b) := by have h := Finset.prod_dvd_prod_of_subset b.firstDivisor (b.common∪b.cube.support) (fun i => (Ideal.span {p i} : Ideal O)) hb.2.2 rw [Finset.prod_union hb.2.1] at h exact h include hinj in theorem globalFirst_divisor_fiber_card (s : Finset (GlobalFirstData ι)) (q : CubeCoordinates ι × Finset ι × Finset ι) (hs : ∀b∈s,GlobalFirstAdmissible b) (hq : ∀b∈s,globalFirstCountKey b=q) : s.card≤(idealDivisors (globalFirstDivisorTarget p q)).card := by let D := idealDivisors (globalFirstDivisorTarget p q) let encode (b : s) : D := ⟨∏i∈b.val.firstDivisor,Ideal.span {p i},by apply (mem_idealDivisors (globalFirstDivisorTarget_ne_zero p q)).mpr simpa only [hq b.val b.property] using globalFirst_divisor_dvd_target p b.val (hs b.val b.property)⟩ have hi : Function.Injective encode := by intro b c he have hd := FirstCauchyArithmetic.family_product_injective (fun i => Ideal.span {p i}) hinj (congrArg Subtype.val he) have hk := (hq b.val b.property).trans (hq c.val c.property).symm apply Subtype.ext exact GlobalFirstData.ext (congrArg Prod.fst hk) (congrArg (fun q => q.2.2) hk) (congrArg (fun q => q.2.1) hk) hd simpa only [Fintype.card_coe,D] using Fintype.card_le_of_injective encode hi include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem globalFirstDivisorTarget_norm_bound (b : GlobalFirstData ι) (B U : ℝ) (hB : 0≤B) (hU : 0≤U) (hc : primeProductNorm p b.common≤U) (hb1 : ‖eisEmbedding (primeProduct p b.cube.support b.cube.leftExponent)‖^2≤B) (hb2 : ‖eisEmbedding (primeProduct p b.cube.support b.cube.rightExponent)‖^2≤B) : (Ideal.absNorm (globalFirstDivisorTarget p (globalFirstCountKey b)) : ℝ)≤U*B^2 := by have hrad := globalCube_radical_bound p hp B hB (b.append ⟨∅,∅,∅,1⟩) hb1 hb2 change (Ideal.absNorm ((∏i∈b.common,Ideal.span {p i})*(∏i∈b.cube.support,Ideal.span {p i})) : ℝ)≤_ rw [map_mul,Nat.cast_mul,←primeProductNorm_eq_ideal_norm,←primeProductNorm_eq_ideal_norm] exact mul_le_mul hc hrad (FirstPassCubeLabels.primeProductNorm_pos p hp _).le hU include hinj in theorem primeSupport_inverse_sum (s : Finset (Finset ι)) (U : ℝ) (hs : ∀S∈s,primeProductNorm p S≤U) : (∑S∈s,1/primeProductNorm p S)≤128*Real.exp 1*(normLogBin U+1 : ℝ) := by let f := fun S : Finset ι => ∏i∈S,(Ideal.span {p i} : Ideal O) have hi : Function.Injective f := FirstCauchyArithmetic.family_product_injective _ hinj have he : (∑S∈s,1/primeProductNorm p S)=∑I∈s.image f,1/(Ideal.absNorm I : ℝ) := by rw [Finset.sum_image (fun S _ T _ h => hi h)] exact Finset.sum_congr rfl (fun S hS => by rw [primeProductNorm_eq_ideal_norm]) rw [he] apply descent_ideal_inverse_sum · intro I hI obtain ⟨S,hS,rfl⟩ := Finset.mem_image.mp hI exact Finset.prod_ne_zero_iff.mpr (fun i hi => NeZero.ne (Ideal.span {p i})) · intro I hI obtain ⟨S,hS,rfl⟩ := Finset.mem_image.mp hI simpa only [f,←primeProductNorm_eq_ideal_norm] using hs S hS end theorem globalFirstData_harmonic_sum (ε : ℝ) (hε : 0<ε) : ∃ C : ℝ,0 Ideal.span {p i})) (s : Finset (GlobalFirstData ι)) (B U : ℝ), 1≤B → 1≤U → (∀b∈s,GlobalFirstAdmissible b) → (∀b∈s,primeProductNorm p b.common≤U) → (∀b∈s,primeProductNorm p b.firstCommon≤U) → (∀b∈s,‖eisEmbedding (primeProduct p b.cube.support b.cube.leftExponent)‖^2≤B) → (∀b∈s,‖eisEmbedding (primeProduct p b.cube.support b.cube.rightExponent)‖^2≤B) → (∑b∈s,(1/primeProductNorm p b.common)*(1/primeProductNorm p b.firstCommon)* (1/‖eisEmbedding (∏i∈cubeActiveSupport b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit,p i)‖))≤ C*B^(1+ε)*(U*B^2)^ε*(128*Real.exp 1*(normLogBin U+1 : ℝ))^2 := by obtain ⟨D,hD,hdiv⟩ := IdealDivisorBound.ideal_divisor_small_power ε hε obtain ⟨E,hE,hcube⟩ := cube_coordinates_inverse_active_sum ε hε refine ⟨D*E,mul_pos hD hE,?_⟩ intro ι _ p hp _ hinj s B U hB hU hs hC ht hb1 hb2 let Q := s.image globalFirstCountKey let cubes := s.image GlobalFirstData.cube let commons := s.image GlobalFirstData.common let firsts := s.image GlobalFirstData.firstCommon let weight := fun q : CubeCoordinates ι × Finset ι × Finset ι => (1/primeProductNorm p q.2.1)*(1/primeProductNorm p q.2.2)* (1/‖eisEmbedding (∏i∈cubeActiveSupport q.1.support (fun i => q.1.leftExponent i+q.1.rightExponent i) q.1.leftBit q.1.rightBit,p i)‖) have hw (q : CubeCoordinates ι × Finset ι × Finset ι) : 0≤weight q := by have h1 := (FirstPassCubeLabels.primeProductNorm_pos p hp q.2.1).le have h2 := (FirstPassCubeLabels.primeProductNorm_pos p hp q.2.2).le dsimp [weight] positivity have hfiber (q : CubeCoordinates ι × Finset ι × Finset ι) (hq : q∈Q) : ((s.filter (fun b => globalFirstCountKey b=q)).card : ℝ)≤D*(U*B^2)^ε := by obtain ⟨b,hb,rfl⟩ := Finset.mem_image.mp hq have hc : ((s.filter (fun d => globalFirstCountKey d=globalFirstCountKey b)).card : ℝ)≤ ((idealDivisors (globalFirstDivisorTarget p (globalFirstCountKey b))).card : ℝ) := by exact_mod_cast globalFirst_divisor_fiber_card p hinj (s.filter (fun d => globalFirstCountKey d=globalFirstCountKey b)) (globalFirstCountKey b) (fun d hd => hs d (Finset.mem_filter.mp hd).1) (fun d hd => (Finset.mem_filter.mp hd).2) apply hc.trans ((hdiv _ (globalFirstDivisorTarget_ne_zero p _)).trans _) apply mul_le_mul_of_nonneg_left _ hD.le exact Real.rpow_le_rpow (Nat.cast_nonneg _) (globalFirstDivisorTarget_norm_bound p hp b B U (by linarith) (by linarith) (hC b hb) (hb1 b hb) (hb2 b hb)) hε.le have hsub : Q⊆cubes.product (commons.product firsts) := by intro q hq obtain ⟨b,hb,rfl⟩ := Finset.mem_image.mp hq exact Finset.mem_product.mpr ⟨Finset.mem_image_of_mem _ hb, Finset.mem_product.mpr ⟨Finset.mem_image_of_mem _ hb,Finset.mem_image_of_mem _ hb⟩⟩ have he : (∑b∈s,weight (globalFirstCountKey b))= ∑q∈Q,((s.filter (fun b => globalFirstCountKey b=q)).card : ℝ)*weight q := by calc _ = ∑q∈Q,∑b∈s.filter (fun b => globalFirstCountKey b=q),weight (globalFirstCountKey b) := (Finset.sum_fiberwise_of_maps_to (fun b hb => Finset.mem_image_of_mem globalFirstCountKey hb) _).symm _ = _ := by apply Finset.sum_congr rfl intro q hq have h := Finset.sum_congr rfl (fun b (hb : b∈s.filter (fun b => globalFirstCountKey b=q)) => show weight (globalFirstCountKey b)=weight q by rw [(Finset.mem_filter.mp hb).2]) rw [h] simp have hcube' := hcube p hp hinj cubes B hB (by intro x hx; obtain ⟨b,hb,rfl⟩ := Finset.mem_image.mp hx; exact (hs b hb).1) (by intro x hx; obtain ⟨b,hb,rfl⟩ := Finset.mem_image.mp hx; exact hb1 b hb) (by intro x hx; obtain ⟨b,hb,rfl⟩ := Finset.mem_image.mp hx; exact hb2 b hb) have hC' := primeSupport_inverse_sum p hinj commons U (by intro C hCmem; obtain ⟨b,hb,rfl⟩ := Finset.mem_image.mp hCmem; exact hC b hb) have ht' := primeSupport_inverse_sum p hinj firsts U (by intro T hT; obtain ⟨b,hb,rfl⟩ := Finset.mem_image.mp hT; exact ht b hb) have hC0 : 0≤∑C∈commons,1/primeProductNorm p C := Finset.sum_nonneg (fun C _ => one_div_nonneg.mpr (FirstPassCubeLabels.primeProductNorm_pos p hp C).le) have ht0 : 0≤∑T∈firsts,1/primeProductNorm p T := Finset.sum_nonneg (fun T _ => one_div_nonneg.mpr (FirstPassCubeLabels.primeProductNorm_pos p hp T).le) change (∑b∈s,weight (globalFirstCountKey b))≤_ rw [he] calc _ ≤ ∑q∈Q,(D*(U*B^2)^ε)*weight q := Finset.sum_le_sum (fun q hq => mul_le_mul_of_nonneg_right (hfiber q hq) (hw q)) _ = (D*(U*B^2)^ε)*∑q∈Q,weight q := (Finset.mul_sum _ _ _).symm _ ≤ (D*(U*B^2)^ε)*∑q∈cubes.product (commons.product firsts),weight q := mul_le_mul_of_nonneg_left (Finset.sum_le_sum_of_subset_of_nonneg hsub (fun q _ _ => hw q)) (by positivity) _ = (D*(U*B^2)^ε)* ((∑x∈cubes,1/‖eisEmbedding (∏i∈cubeActiveSupport x.support (fun i => x.leftExponent i+x.rightExponent i) x.leftBit x.rightBit,p i)‖)* (∑C∈commons,1/primeProductNorm p C)*(∑T∈firsts,1/primeProductNorm p T)) := by congr 1 simp only [Finset.product_eq_sprod,Finset.sum_product,weight] simp_rw [Finset.sum_mul,Finset.mul_sum] apply Finset.sum_congr rfl intro x hx rw [Finset.sum_comm] apply Finset.sum_congr rfl intro T hT rw [Finset.sum_mul] apply Finset.sum_congr rfl intro C hCmem ring _ ≤ (D*(U*B^2)^ε)*((E*B^(1+ε))*(128*Real.exp 1*(normLogBin U+1 : ℝ))*(128*Real.exp 1*(normLogBin U+1 : ℝ))) := by gcongr _ = _ := by ring end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.NormalizedMass namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog) open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hg : ∀i,lambda∉Ideal.span {p i}) include hp in omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in theorem columnLog_norm_lower (X M : ℝ) (hX : 0 g (columnLog p X A))) S‖^2≤G^2/primeProductNorm p S := by have hG0 : 0≤G := (norm_nonneg (g 0)).trans (hG 0) have ht := secondInputCoefficient_norm_le_test p hg Ψ hΨ m c d (normalizedColumn p (fun A => g (columnLog p X A))) S apply (pow_le_pow_left₀ (norm_nonneg _) ht 2).trans simp only [normalizedColumn,norm_div,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (norm_nonneg _),div_pow] exact div_le_div_of_nonneg_right (pow_le_pow_left₀ (norm_nonneg _) (hG _) 2) (sq_nonneg _) include hp in omit [DecidableEq ι] in theorem normalized_second_mass_zero (F : Finset ι) (Ψ : O→*ℂ) (m c d : O) (g : ℝ→ℂ) (M X : ℝ) (hX : 0 g (columnLog p X A))) S‖^2)=0 := by apply Finset.sum_eq_zero intro S hS have hz : g (columnLog p X S)=0 := by by_contra hn have hh := columnLog_norm_upper p hp X M hX S ((le_abs_self _).trans (hM _ hn)) have ho := primeProductNorm_ge_one p hp S linarith simp [secondInputCoefficient,normalizedColumn,hz] include hp in theorem normalized_second_mass_fixed_bound (hinj : Function.Injective (fun i => Ideal.span {p i})) (F : Finset ι) (Ψ : O→*ℂ) (hΨ : ∀z,‖Ψ z‖≤1) (m c d : O) (g : ℝ→ℂ) (G M X : ℝ) (hX : 0 g (columnLog p X A))) S‖^2)≤ 128*Real.exp (2*M)*G^2 := by by_cases hsmall : X*Real.exp M<1 · rw [normalized_second_mass_zero p hp hg F Ψ m c d g M X hX hM hsmall] positivity have hH : 1≤X*Real.exp M := le_of_not_gt hsmall let T := F.powerset.filter (fun S => g (columnLog p X S)≠0) have hsub : T⊆boundedPrimeSupports p F (X*Real.exp M) := by intro S hS obtain ⟨hSF,hSn⟩ := Finset.mem_filter.mp hS exact Finset.mem_filter.mpr ⟨hSF,columnLog_norm_upper p hp X M hX S ((le_abs_self _).trans (hM _ hSn))⟩ have hcard : (T.card:ℝ)≤128*(X*Real.exp M) := by apply (Nat.cast_le.mpr (Finset.card_le_card hsub)).trans exact boundedPrimeSupports_card p hinj F (X*Real.exp M) hH have he : (∑S∈F.powerset,‖secondInputCoefficient p hg Ψ m c d (normalizedColumn p (fun A => g (columnLog p X A))) S‖^2)= ∑S∈T,‖secondInputCoefficient p hg Ψ m c d (normalizedColumn p (fun A => g (columnLog p X A))) S‖^2 := by symm apply Finset.sum_subset (Finset.filter_subset _ _) intro S hS hn have hz : g (columnLog p X S)=0 := by by_contra hh exact hn (Finset.mem_filter.mpr ⟨hS,hh⟩) simp [secondInputCoefficient,normalizedColumn,hz] rw [he] calc _ ≤ ∑_S∈T,G^2/(X*Real.exp (-M)) := by apply Finset.sum_le_sum intro S hS apply (normalized_second_coefficient_sq_le p hg Ψ hΨ m c d g G X hG S).trans have hlo := columnLog_norm_lower p hp X M hX S (abs_le.mp (hM _ (Finset.mem_filter.mp hS).2)).1 exact div_le_div_of_nonneg_left (sq_nonneg _) (by positivity) hlo _ = (T.card:ℝ)*(G^2/(X*Real.exp (-M))) := by simp _ ≤ (128*(X*Real.exp M))*(G^2/(X*Real.exp (-M))) := mul_le_mul_of_nonneg_right hcard (by positivity) _ = 128*Real.exp (2*M)*G^2 := by rw [show 2*M=M+M by ring,Real.exp_add,Real.exp_neg] field_simp [hX.ne',Real.exp_ne_zero] end theorem full_uniform_normalized_second_mass (g : 𝓢(ℝ,ℂ)) (M : ℝ) (hM : ∀t,g t≠0 → |t|≤M) : ∃C : ℝ,0 Ideal.span {p i})) (F : Finset ι) (Ψ : O→*ℂ) (_hΨ : ∀z,‖Ψ z‖≤1) (m c d : O) (X : ℝ),0 g (columnLog p X A))) S‖^2)≤C := by refine ⟨128*Real.exp (2*M)*(SchwartzMap.seminorm ℝ 0 0 g)^2+1,by positivity,?_⟩ intro ι _ p hp _ hg hinj F Ψ hΨ m c d X hX exact (normalized_second_mass_fixed_bound p hp hg hinj F Ψ hΨ m c d g _ M X hX (fun t => g.norm_le_seminorm ℝ t) hM).trans (by linarith) end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hg : ∀i,lambda∉Ideal.span {p i}) def globalFirstColumnMass (pool : Finset ι) (b : GlobalFirstData ι) (Ψ : O →* ℂ) (m : O) (g : 𝓢(ℝ,ℂ)) (ell : ℝ) (side : Bool) : ℝ := ∑G∈(globalFirstRawPool pool b).powerset, ‖secondInputCoefficient p hg Ψ (m*globalFirstBlockBadLabel p b) (globalFirstBlockLabel p b) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) (globalFirstBlockTest p g ell side b) G‖^2 include hp in theorem globalFirstColumnMass_support (pool : Finset ι) (b : GlobalFirstData ι) (Ψ : O →* ℂ) (m : O) (g : 𝓢(ℝ,ℂ)) (ell M : ℝ) (hell : 0 Ideal.span {p i}) b.firstDivisor) g M (globalFirstBlockColumnScale p ell side b/primeProductNorm p b.firstCommon) hX hM (lt_of_not_ge hh) have heq : (globalFirstBlockColumnScale p ell side b/primeProductNorm p b.firstCommon)*Real.exp M= ell*Real.exp M/(a*c*t) := by change (ell/(a*c)/t)*Real.exp M=_; ring rw [heq] at hlow have hb : a*c*t≤ell*Real.exp M := by simpa only [one_mul] using (le_div_iff₀ hden).mp hlow constructor · change c≤_ calc c=1*c*1 := by ring _ ≤ a*c*t := by gcongr _ ≤ _ := hb · change t≤_ calc t=1*1*t := by ring _ ≤ a*c*t := by gcongr _ ≤ _ := hb include hp in theorem globalFirstColumnMass_zero_off_support (pool : Finset ι) (b : GlobalFirstData ι) (Ψ : O →* ℂ) (m : O) (g : 𝓢(ℝ,ℂ)) (ell M U : ℝ) (hell : 0 primeProductNorm p b.common≤U ∧ primeProductNorm p b.firstCommon≤U)) w Ψ m g W ell side Y := by unfold globalFirstDiagonalCost symm apply Finset.sum_subset (Finset.filter_subset _ _) intro b hb hn have hoff : ¬(primeProductNorm p b.common≤U ∧ primeProductNorm p b.firstCommon≤U) := by intro h; exact hn (Finset.mem_filter.mpr ⟨hb,h⟩) have hz := globalFirstColumnMass_zero_off_support p hp hg pool b Ψ m g ell M U hell hM hU side hoff change globalFirstColumnMass p hg pool b Ψ m g ell side=0 at hz change ‖w b‖*(primeProductNorm p b.firstCommon)⁻¹* (|Y b| *‖EisensteinSchwartzPoisson.paperRadialFourier W 0‖*globalFirstColumnMass p hg pool b Ψ m g ell side)=0 rw [hz,mul_zero,mul_zero] end theorem globalDiagonalPowers (ε : ℝ) (hε : 0<ε) : ∃C : ℝ,0 Ideal.span {p i})) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (Ψ : O →* ℂ) (m : O) (Γ K ell B F U : ℝ) (side : Bool), 0≤Γ → 0 ((w b*globalFirstCoefficient p K ell B F side b : ℝ) : ℂ)) Ψ m g W ell side (globalFirstPooledRow p K ell B F side)≤ C*Γ*(ell*B^3*F)*(B*U)^ε := by obtain ⟨Cg,hCg,hmass⟩ := full_uniform_normalized_second_mass g M hM obtain ⟨Cd,hCd,hcount⟩ := globalFirstData_harmonic_sum (ε/3) (by positivity) obtain ⟨Cp,hCp,hpowers⟩ := globalDiagonalPowers ε hε let P := Cd*Cg*‖paperRadialFourier W 0‖*(Real.exp 1)^3 have hP : 0≤P := by dsimp [P]; positivity refine ⟨P*Cp+1,by positivity,?_⟩ intro ι _ p hp _ hg hinj pool s w Ψ m Γ K ell B F U side hΓ hK hell hB hF hU hellU hΨ hw hs hb1 hb2 have hB0 : 0 primeProductNorm p b.common≤U ∧ primeProductNorm p b.firstCommon≤U) let θ := fun b : GlobalFirstData ι => (1/primeProductNorm p b.common)*(1/primeProductNorm p b.firstCommon)* (1/‖eisEmbedding (∏i∈cubeActiveSupport b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit,p i)‖) have ht (b : GlobalFirstData ι) (hb : b∈T) : b∈s := (Finset.mem_filter.mp hb).1 have hsum := hcount p hp hinj T B U hB hU (fun b hb => hs b (ht b hb)) (fun b hb => (Finset.mem_filter.mp hb).2.1) (fun b hb => (Finset.mem_filter.mp hb).2.2) (fun b hb => hb1 b (ht b hb)) (fun b hb => hb2 b (ht b hb)) change (∑b∈T,θ b)≤_ at hsum rw [globalFirstDiagonalCost_eq_supported p hp hg pool s _ Ψ m g W ell M U hell hM hellU side] change globalFirstDiagonalCost p hg pool T _ Ψ m g W ell side _≤_ have hterm (b : GlobalFirstData ι) (hb : b∈T) : ‖((w b*globalFirstCoefficient p K ell B F side b : ℝ) : ℂ)‖*(primeProductNorm p b.firstCommon)⁻¹* (|globalFirstPooledRow p K ell B F side b| *‖paperRadialFourier W 0‖* globalFirstColumnMass p hg pool b Ψ m g ell side)≤ (Γ*Cg*‖paperRadialFourier W 0‖*(Real.exp 1)^3*ell*B^2*F)*θ b := by have htpos := FirstPassCubeLabels.primeProductNorm_pos p hp b.firstCommon have hcpos := FirstPassCubeLabels.primeProductNorm_pos p hp b.common have hapos := FirstPassCubeLabels.primeProductNorm_pos p hp (b.cube.sideDivisor side) have hX : 0 Ideal.span {p i}) b.firstDivisor) (globalFirstBlockColumnScale p ell side b/primeProductNorm p b.firstCommon) hX change globalFirstColumnMass p hg pool b Ψ m g ell side≤Cg at hm have hm0 : 0≤globalFirstColumnMass p hg pool b Ψ m g ell side := Finset.sum_nonneg (fun _ _ => sq_nonneg _) have hc : 0≤globalFirstCoefficient p K ell B F side b := globalBinFirstCoefficient_nonneg K ell B F hK.le hell hB0 hF _ have hY : 0 ActualEisensteinCubic.quotientField (P i) let : ∀ i, Fintype (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) (∏i,bracket (actualSextic (P i) (hg i)) 1 (Ideal.Quotient.mk (P i) (z*n*b^3)))= finiteSexticRow P hg (fun _ => 3) z * finiteSexticRow P hg (fun _ => 3) (n*b) := by let : ∀ i, Field (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientField (P i) let : ∀ i, Fintype (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) dsimp only let residual_bracket_cube := fun i => OAI.CompletedGauss.residual_bracket_cube (P i) (hg i) z n b simp_rw [residual_bracket_cube,Finset.prod_mul_distrib] simp only [finiteSexticRow,MulChar.pow_apply' _ (by decide : (3:ℕ)≠0)] end section open ActualEisensteinCubic CanonicalQuadraticSieve QuadraticSquarefreeKernel theorem powerful_inverse_norm_sum (S : Finset (Ideal O)) (hS : ∀I∈S,PowerfulIdeal I) : (∑I∈S,1/(Ideal.absNorm I:ℝ))≤1048576 := by let A := S.image powerfulBase let B := S.image squarefreePart let pair : Ideal O→Ideal O×Ideal O := fun I => (powerfulBase I,squarefreePart I) have ha (I : Ideal O) (hI : I∈A) : I≠0 := by obtain ⟨J,hJ,rfl⟩ := Finset.mem_image.mp hI exact (powerfulBase_spec J (hS J hJ)).1 have hb (I : Ideal O) (hI : I∈B) : I≠0 := by obtain ⟨J,hJ,rfl⟩ := Finset.mem_image.mp hI exact (squarefree_squarefreePart J).ne_zero have hca : (∑I∈A,1/(Ideal.absNorm I:ℝ)^2)≤1024 := finite_inverse_norm_square_sum A (∑I∈A,(Ideal.absNorm I:ℝ)) ha (fun I hI => Finset.single_le_sum (fun J _ => Nat.cast_nonneg _) hI) have hcb : (∑I∈B,1/(Ideal.absNorm I:ℝ)^2)≤1024 := finite_inverse_norm_square_sum B (∑I∈B,(Ideal.absNorm I:ℝ)) hb (fun I hI => Finset.single_le_sum (fun J _ => Nat.cast_nonneg _) hI) have hinj : Set.InjOn pair S := by intro I hI J hJ he exact powerfulBase_injective_on_fiber I J (hS I hI) (hS J hJ) (congrArg Prod.snd he) (congrArg Prod.fst he) have hsub : S.image pair ⊆ A×ˢB := by intro p hp obtain ⟨I,hI,rfl⟩ := Finset.mem_image.mp hp exact Finset.mem_product.mpr ⟨Finset.mem_image_of_mem _ hI,Finset.mem_image_of_mem _ hI⟩ calc _ ≤ ∑I∈S,1/(Ideal.absNorm (powerfulBase I):ℝ)^2 * (1/(Ideal.absNorm (squarefreePart I):ℝ)^2) := by apply Finset.sum_le_sum intro I hI have hni := (powerfulBase_spec I (hS I hI)).2 have hb1 : 1≤(Ideal.absNorm (squarefreePart I):ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => (squarefree_squarefreePart I).ne_zero (Ideal.absNorm_eq_zero_iff.mp hz)) have ha0 : 0<(Ideal.absNorm (powerfulBase I):ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun hz => (powerfulBase_spec I (hS I hI)).1 (Ideal.absNorm_eq_zero_iff.mp hz)) have he : (Ideal.absNorm I:ℝ)=(Ideal.absNorm (powerfulBase I):ℝ)^2* (Ideal.absNorm (squarefreePart I):ℝ)^3 := by have h := congrArg (fun J : Ideal O => (Ideal.absNorm J:ℝ)) hni simpa only [map_mul,map_pow,Nat.cast_mul,Nat.cast_pow] using h.symm rw [he,one_div,one_div,one_div,←mul_inv] exact inv_anti₀ (by positivity) (mul_le_mul_of_nonneg_left (pow_le_pow_right₀ hb1 (by decide)) (sq_nonneg _)) _ = ∑p∈S.image pair,1/(Ideal.absNorm p.1:ℝ)^2 * (1/(Ideal.absNorm p.2:ℝ)^2) := by rw [Finset.sum_image hinj] _ ≤ ∑p∈A×ˢB,1/(Ideal.absNorm p.1:ℝ)^2 * (1/(Ideal.absNorm p.2:ℝ)^2) := Finset.sum_le_sum_of_subset_of_nonneg hsub (fun _ _ _ => by positivity) _ = (∑I∈A,1/(Ideal.absNorm I:ℝ)^2)*(∑I∈B,1/(Ideal.absNorm I:ℝ)^2) := by rw [Finset.sum_product,Finset.sum_mul] apply Finset.sum_congr rfl intro I _ rw [Finset.mul_sum] _ ≤ 1024*1024 := mul_le_mul hca hcb (by positivity) (by norm_num) _ = _ := by norm_num end open ActualEisensteinCubic UniqueFactorizationMonoid theorem prime_square_dvd_powerful (I P : Ideal O) (hI : PowerfulIdeal I) (hP : Prime P) (hd : P∣I) : P^2∣I := by have hm := (UniqueFactorizationMonoid.mem_normalizedFactors_iff hI.1).mpr ⟨hP,hd⟩ apply (dvd_iff_normalizedFactors_le_normalizedFactors (pow_ne_zero 2 hP.ne_zero) hI.1).mpr rw [normalizedFactors_pow,normalizedFactors_irreducible hP.irreducible,normalize_eq] apply Multiset.le_iff_count.mpr intro Q by_cases hQP : Q=P · subst Q simpa using hI.2 P hm · simp [hQP] theorem nonresidual_prime_square_dvd (I Q P : Ideal O) (hI : I≠0) (hP : Prime P) (hd : P∣I) (hr : ¬P∣rowResidualPart I Q) : P^2∣rowPowerfulPart I*(rowMaskPart I Q)^2 := by have hh : P∣rowPowerfulPart I*rowMaskPart I Q := by rw [←row_powerful_mask_residual_product I Q hI] at hd exact (hP.dvd_mul.mp hd).resolve_right hr rcases hP.dvd_mul.mp hh with ha|ht · exact dvd_mul_of_dvd_left (prime_square_dvd_powerful _ _ (rowPowerfulPart_powerful I) hP ha) _ · exact dvd_mul_of_dvd_right (pow_dvd_pow_of_dvd ht 2) _ def nonresidualGain (I P : Ideal O) : Ideal O := if P∣I then P^2 else P theorem nonresidual_gain_product_dvd {ι : Type*} [Fintype ι] (I Q : Ideal O) (hI : I≠0) (P : ι→Ideal O) [∀i,(P i).IsMaximal] (hcop : Pairwise (fun i j => IsCoprime (P i) (P j))) (hpool : ∀i,P i∣I*Q) (hres : ∀i,¬P i∣rowResidualPart I Q) : (∏i,nonresidualGain I (P i)) ∣ rowPowerfulPart I*(rowMaskPart I Q)^2*Q := by apply Fintype.prod_dvd_of_coprime · intro i j hij change IsCoprime (nonresidualGain I (P i)) (nonresidualGain I (P j)) unfold nonresidualGain by_cases hi : P i∣I · rw [if_pos hi] by_cases hj : P j∣I · rw [if_pos hj] exact (hcop hij).pow · rw [if_neg hj] exact (hcop hij).pow_left · rw [if_neg hi] by_cases hj : P j∣I · rw [if_pos hj] exact (hcop hij).pow_right · rw [if_neg hj] exact hcop hij · intro i have hp : Prime (P i) := Ideal.prime_of_isPrime (NeZero.ne (P i)) inferInstance by_cases hi : P i∣I · rw [nonresidualGain,if_pos hi] exact dvd_mul_of_dvd_left (nonresidual_prime_square_dvd I Q (P i) hI hp hi (hres i)) Q · rw [nonresidualGain,if_neg hi] exact dvd_mul_of_dvd_right ((hp.dvd_mul.mp (hpool i)).resolve_left hi) _ open ActualEisensteinCubic UniqueFactorizationMonoid def completedLocalExponent (I F P : Ideal O) : ℕ := ((normalizedFactors I).count P+4*(if P∣F then 1 else 0))%6 def reflectionExtractedPrime (P : Ideal O) (j : ℕ) (e v : Fin 3) : Ideal O := if (j=4 ∧ e=v) ∨ (j=0 ∧ v=0) then P else 1 def reflectionExtractedDivisor {ι : Type*} [Fintype ι] (P : ι→Ideal O) (j : ι→ℕ) (e : ι→Fin 3) (v : Fin 3) : Ideal O := ∏i,reflectionExtractedPrime (P i) (j i) (e i) v def reflectionConductorCost {ι : Type*} [Fintype ι] (P : ι→Ideal O) (j : ι→ℕ) (e : ι→Fin 3) : ℝ := (Ideal.absNorm (∏i,P i):ℝ)^2/ ((Ideal.absNorm (reflectionExtractedDivisor P j e 1):ℝ)* (Ideal.absNorm (reflectionExtractedDivisor P j e 0):ℝ)* (Ideal.absNorm (reflectionExtractedDivisor P j e 2):ℝ)^4) def reflectionLocalCost (q : ℝ) (j : ℕ) (e : Fin 3) : ℝ := if j=4 then (if e=2 then 1/q^2 else q) else if j=0 then q else q^2 theorem reflectionConductorCost_eq_prod {ι : Type*} [Fintype ι] (P : ι→Ideal O) (hP : ∀i,P i≠0) (j : ι→ℕ) (e : ι→Fin 3) : reflectionConductorCost P j e=∏i,reflectionLocalCost (Ideal.absNorm (P i):ℝ) (j i) (e i) := by have hn i : (Ideal.absNorm (P i):ℝ)≠0 := by exact_mod_cast (fun hz => hP i (Ideal.absNorm_eq_zero_iff.mp hz)) simp only [reflectionConductorCost,reflectionExtractedDivisor,map_prod,Nat.cast_prod, ←Finset.prod_pow,←Finset.prod_mul_distrib,←Finset.prod_div_distrib] apply Finset.prod_congr rfl intro i _ by_cases hj4 : j i=4 · rw [hj4] generalize he : e i=v fin_cases v <;> simp [reflectionExtractedPrime,reflectionLocalCost] <;> field_simp · by_cases hj0 : j i=0 · simp [reflectionExtractedPrime,reflectionLocalCost,hj0] field_simp · simp [reflectionExtractedPrime,reflectionLocalCost,hj4,hj0] theorem reflectionLocalCost_nonneg (q : ℝ) (hq : 0≤q) (j : ℕ) (e : Fin 3) : 0≤reflectionLocalCost q j e := by unfold reflectionLocalCost split_ifs <;> positivity theorem reflectionLocalCost_le_square (q : ℝ) (hq : 1≤q) (j : ℕ) (e : Fin 3) : reflectionLocalCost q j e≤q^2 := by have hq0 : 0.trans hq2 · nlinarith · nlinarith · rfl theorem reflectionLocalCost_le_single (q : ℝ) (hq : 1≤q) (j : ℕ) (e : Fin 3) (hj : j=0 ∨ j=4) : reflectionLocalCost q j e≤q := by have hq0 : 0 norm_num theorem reflectionLocalCost_le_gain (I F P : Ideal O) (hI : I≠0) (hP : Prime P) (e : Fin 3) : reflectionLocalCost (Ideal.absNorm P:ℝ) (completedLocalExponent I F P) e≤ (Ideal.absNorm (nonresidualGain I P):ℝ) := by have hq : 1≤(Ideal.absNorm P:ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => hP.ne_zero (Ideal.absNorm_eq_zero_iff.mp hz)) by_cases hd : P∣I · rw [nonresidualGain,if_pos hd,map_pow,Nat.cast_pow] exact reflectionLocalCost_le_square _ hq _ _ · rw [nonresidualGain,if_neg hd] exact reflectionLocalCost_le_single _ hq _ _ (completedLocalExponent_of_not_dvd I F P hI hP hd) theorem reflectionConductorCost_bound {ι : Type*} [Fintype ι] (I F Q : Ideal O) (hI : I≠0) (hQ : Q≠0) (P : ι→Ideal O) [∀i,(P i).IsMaximal] (hcop : Pairwise (fun i j => IsCoprime (P i) (P j))) (hpool : ∀i,P i∣I*Q) (hres : ∀i,¬P i∣rowResidualPart I Q) (e : ι→Fin 3) : reflectionConductorCost P (fun i => completedLocalExponent I F (P i)) e≤ (Ideal.absNorm (rowPowerfulPart I):ℝ)*(Ideal.absNorm (rowMaskPart I Q):ℝ)^2*(Ideal.absNorm Q:ℝ) := by rw [reflectionConductorCost_eq_prod P (fun i => NeZero.ne (P i))] have hfirst : (∏i,reflectionLocalCost (Ideal.absNorm (P i):ℝ) (completedLocalExponent I F (P i)) (e i))≤ (Ideal.absNorm (∏i,nonresidualGain I (P i)):ℝ) := by rw [map_prod,Nat.cast_prod] exact Finset.prod_le_prod₀ (fun i _ => reflectionLocalCost_nonneg _ (Nat.cast_nonneg _) _ _) (fun i _ => reflectionLocalCost_le_gain I F (P i) hI (Ideal.prime_of_isPrime (NeZero.ne (P i)) inferInstance) (e i)) apply hfirst.trans have hd := nonresidual_gain_product_dvd I Q hI P hcop hpool hres have hN : 0 ActualEisensteinCubic.quotientField (P i) let : ∀ i, Fintype (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) (∏i,bracket (actualSextic (P i) (hg i)) (j i) (Ideal.Quotient.mk (P i) (n*b^3)))= ∑e : ι→Fin 3,reflectedBranch P hg j e n b := by let : ∀ i, Field (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientField (P i) let : ∀ i, Fintype (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) dsimp only let bracket_eq_sum_reflectedLocalPiece := fun i => OAI.CompletedGauss.bracket_eq_sum_reflectedLocalPiece (P i) (hg i) (j i) n b simp_rw [bracket_eq_sum_reflectedLocalPiece] simpa only [Fintype.piFinset_univ,reflectedBranch] using Finset.prod_univ_sum (fun _ : ι => (Finset.univ : Finset (Fin 3))) (fun i e => reflectedLocalPiece (P i) (hg i) (j i) e n b) theorem reflectedLocalPiece_norm_le (P : Ideal O) [P.IsMaximal] (hg : lambda∉P) (j : ℕ) (e : Fin 3) (n b : O) : ‖reflectedLocalPiece P hg j e n b‖≤reflectedLocalSize P j e := by let : Field (O ⧸ P) := ActualEisensteinCubic.quotientField P let : Fintype (O ⧸ P) := ActualEisensteinCubic.quotientFintype P have hr : 0 positivity theorem sqrt_norm_reflectionExtractedDivisor {ι : Type*} [Fintype ι] (P : ι→Ideal O) [∀i,(P i).IsMaximal] (j : ι→ℕ) (e : ι→Fin 3) (v : Fin 3) : let : ∀ i, Fintype (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e v):ℝ)= ∏i,if (j i=4 ∧ e i=v) ∨ (j i=0 ∧ v=0) then rootCard (O ⧸ P i) else 1 := by let : ∀ i, Fintype (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) dsimp only rw [reflectionExtractedDivisor,map_prod,Nat.cast_prod,Real.sqrt_prod] · apply Finset.prod_congr rfl intro i _ unfold reflectionExtractedPrime split_ifs · rw [rootCard_eq_sqrt_absNorm] · simp · intro i _ exact Nat.cast_nonneg _ theorem reflectedBranch_norm_bound {ι : Type*} [Fintype ι] (P : ι→Ideal O) [∀i,(P i).IsMaximal] (hg : ∀i,lambda∉P i) (j : ι→ℕ) (e : ι→Fin 3) (n b : O) : ‖reflectedBranch P hg j e n b‖≤ Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 1):ℝ)* Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 2):ℝ)/ Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 0):ℝ) := by have hb : ‖reflectedBranch P hg j e n b‖≤∏i,reflectedLocalSize (P i) (j i) (e i) := by rw [reflectedBranch,norm_prod] exact Finset.prod_le_prod₀ (fun i _ => norm_nonneg _) (fun i _ => reflectedLocalPiece_norm_le (P i) (hg i) (j i) (e i) n b) apply hb.trans_eq rw [sqrt_norm_reflectionExtractedDivisor,sqrt_norm_reflectionExtractedDivisor, sqrt_norm_reflectionExtractedDivisor,←Finset.prod_mul_distrib,←Finset.prod_div_distrib] apply Finset.prod_congr rfl intro i _ by_cases hj4 : j i=4 · rw [hj4] generalize e i=x fin_cases x <;> simp [reflectedLocalSize] · by_cases hj0 : j i=0 · simp [reflectedLocalSize,hj0] · simp [reflectedLocalSize,hj4,hj0] theorem reflectionExtractedDivisor_ne_zero {ι : Type*} [Fintype ι] (P : ι→Ideal O) (hP : ∀i,P i≠0) (j : ι→ℕ) (e : ι→Fin 3) (v : Fin 3) : reflectionExtractedDivisor P j e v≠0 := by unfold reflectionExtractedDivisor apply Finset.prod_ne_zero_iff.mpr intro i _ unfold reflectionExtractedPrime split_ifs · exact hP i · exact one_ne_zero theorem reflectedBranch_normalized_bound {ι : Type*} [Fintype ι] (P : ι→Ideal O) [∀i,(P i).IsMaximal] (hg : ∀i,lambda∉P i) (j : ι→ℕ) (e : ι→Fin 3) (n b : O) (U B : ℝ) (hU : 0 reflectionExtractedDivisor_ne_zero P (fun i => NeZero.ne (P i)) j e v (Ideal.absNorm_eq_zero_iff.mp hz)) have hs (v : Fin 3) : 0 (0:ℂ)) := by filter_upwards [isOpen_Iio.mem_nhds ha] with y hy change y simp def euclideanAction (g : SL(2,ℂ)) (p : EuclideanSpatial) : EuclideanSpatial := hyperbolicEuclideanCoordinates (g•euclideanToHyperbolic p) lemma euclideanAction_positive (g : SL(2,ℂ)) (p : EuclideanSpatial) : 0 simp [euclideanHorizontalTranslation] lemma euclideanAction_diagonal (b : ℂ) (hb : b≠0) (p : EuclideanSpatial) (hp : 0

p 2)).continuousAt.eventually_const_lt hp] with q hq exact euclideanAction_translation b q hq · intro u rw [euclideanAction_translation b p hp] simp [euclideanHorizontalTranslation] lemma hyperbolicDifferentialIsometry_diagonal (b : ℂ) (hb : b≠0) : HyperbolicDifferentialIsometry (complexDiagonal b hb) := by intro p hp refine ⟨euclideanComplexDilation b,?_,?_⟩ · apply (euclideanComplexDilation b).hasFDerivAt.congr_of_eventuallyEq filter_upwards [(by fun_prop : Continuous (fun p : EuclideanSpatial => p 2)).continuousAt.eventually_const_lt hp] with q hq exact euclideanAction_diagonal b hb q hq · intro u rw [euclideanComplexDilation_norm,euclideanAction_diagonal b hb p hp, (euclideanComplexDilation_apply b p).2.2] ring lemma hyperbolicDifferentialIsometry_weyl : HyperbolicDifferentialIsometry complexWeyl := by intro p hp refine ⟨euclideanWeylReflection.comp (euclideanInversionDeriv p),?_,?_⟩ · have h := euclideanWeylReflection.hasFDerivAt.comp p (euclideanInversion_hasFDerivAt p (euclideanUpperHalf_ne_zero p hp)) apply h.congr_of_eventuallyEq filter_upwards [(by fun_prop : Continuous (fun p : EuclideanSpatial => p 2)).continuousAt.eventually_const_lt hp] with q hq exact euclideanAction_weyl q hq · intro u change ‖euclideanWeylReflection (euclideanInversionDeriv p u)‖*p 2=_ rw [euclideanWeylReflection_norm,euclideanInversionDeriv_norm,euclideanAction_weyl p hp, (euclideanWeylAction_apply p).2.2] ring theorem hyperbolicDifferentialIsometry (g : SL(2,ℂ)) : HyperbolicDifferentialIsometry g := by by_cases hc : g 1 0=0 · obtain ⟨ha,hg⟩ := complex_bruhat_zero g hc rw [hg] exact hyperbolicDifferentialIsometry_mul _ _ (hyperbolicDifferentialIsometry_diagonal _ ha) (hyperbolicDifferentialIsometry_translation _) · rw [complex_bruhat_nonzero g hc] exact hyperbolicDifferentialIsometry_mul _ _ (hyperbolicDifferentialIsometry_mul _ _ (hyperbolicDifferentialIsometry_mul _ _ (hyperbolicDifferentialIsometry_translation _) (hyperbolicDifferentialIsometry_diagonal _ (inv_ne_zero hc))) hyperbolicDifferentialIsometry_weyl) (hyperbolicDifferentialIsometry_translation _) end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold ENNReal MatrixGroups namespace CubicEisenstein lemma norm_comp_scaled_isometry (A : EuclideanSpatial→L[ℝ]EuclideanSpatial) (r : ℝ) (hr : 0 by change ‖r⁻¹ • A u‖=‖u‖ rw [norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hr.le),hA] field_simp } let equiv : EuclideanSpatial≃ₗᵢ[ℝ]EuclideanSpatial := LinearIsometryEquiv.ofSurjective iso ((LinearMap.injective_iff_surjective).mp iso.injective) have he : A=r • (equiv : EuclideanSpatial→L[ℝ]EuclideanSpatial) := by apply ContinuousLinearMap.ext intro u change A u=r • (r⁻¹ • A u) rw [smul_smul,mul_inv_cancel₀ hr.ne',one_smul] rw [he,ContinuousLinearMap.comp_smul,norm_smul,Real.norm_of_nonneg hr.le, ContinuousLinearMap.opNorm_comp_linearIsometryEquiv] lemma hyperbolic_cotangent_energy_comp (g : SL(2,ℂ)) (F : EuclideanSpatial→ℝ) (p : EuclideanSpatial) (hp : 0

ℝ)).symm.continuous.comp hyperbolicSpatialCoordinates_continuous lemma hyperbolicSpatialChart_toHyperbolic (p : EuclideanSpatial) (hp : 0

OAI.CubicEisenstein.hyperbolicSpatial_chartAt w have ht : p.ofLp∈hyperbolicSpatialChart.target := by rw [←hyperbolicSpatialChart_toHyperbolic p hp] exact hyperbolicSpatialChart.map_source (Set.mem_univ _) have hs : ContMDiffOn 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,SpatialCoordinates) ∞ hyperbolicSpatialChart.symm hyperbolicSpatialChart.target := by simpa only [hyperbolicSpatial_chartAt] using (contMDiffOn_chart_symm (I := 𝓘(ℝ,SpatialCoordinates)) (n := ∞) (x := euclideanToHyperbolic p)) have hd := (hs.contMDiffAt (hyperbolicSpatialChart.open_target.mem_nhds ht)).comp p (PiLp.continuousLinearEquiv 2 ℝ (fun _ : Fin 3 => ℝ)).contDiff.contDiffAt.contMDiffAt apply hd.congr_of_eventuallyEq filter_upwards [(by fun_prop : Continuous (fun p : EuclideanSpatial => p 2)).continuousAt.eventually_const_lt hp] with q hq change euclideanToHyperbolic q=hyperbolicSpatialChart.symm q.ofLp rw [←hyperbolicSpatialChart_toHyperbolic q hq,hyperbolicSpatialChart.left_inv (Set.mem_univ _)] def kernelTestField (f : kernelSmoothTests) (p : EuclideanSpatial) : ℂ := f.1 (integralOrbitProjection globalKubotaKernel (euclideanToHyperbolic p)) lemma kernelTestField_contDiffAt (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : 0

(kernelTestField f p).re) p := Complex.reCLM.contDiff.contDiffAt.comp p (kernelTestField_contDiffAt f p hp) lemma kernelTestField_im_contDiffAt (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : 0

(kernelTestField f p).im) p := Complex.imCLM.contDiff.contDiffAt.comp p (kernelTestField_contDiffAt f p hp) lemma kernelTestField_invariant (f : kernelSmoothTests) (M : globalKubotaKernel) (p : EuclideanSpatial) : kernelTestField f (euclideanAction (integralComplexMatrix M) p)=kernelTestField f p := by simp only [kernelTestField,euclideanAction,euclideanToHyperbolic_coordinates,integralOrbitProjection_eq] def kernelTestEnergyDensity (f : kernelSmoothTests) (w : HyperbolicSpace) : ℝ := euclideanScalarDirichletDensity (fun p => (kernelTestField f p).re) (hyperbolicEuclideanCoordinates w)+ euclideanScalarDirichletDensity (fun p => (kernelTestField f p).im) (hyperbolicEuclideanCoordinates w) lemma kernelTestEnergyDensity_nonneg (f : kernelSmoothTests) (w : HyperbolicSpace) : 0≤kernelTestEnergyDensity f w := by unfold kernelTestEnergyDensity euclideanScalarDirichletDensity positivity lemma kernelTestEnergyDensity_invariant (f : kernelSmoothTests) (M : globalKubotaKernel) (w : HyperbolicSpace) : kernelTestEnergyDensity f (integralComplexMatrix M•w)=kernelTestEnergyDensity f w := by have he : hyperbolicEuclideanCoordinates (integralComplexMatrix M•w)= euclideanAction (integralComplexMatrix M) (hyperbolicEuclideanCoordinates w) := by simp only [euclideanAction,euclideanToHyperbolic_coordinates] have hp : 0 p 2) (hyperbolicEuclideanCoordinates w) := by fun_prop exact (((ht.pow 2).mul (hr.norm.pow 2)).add ((ht.pow 2).mul (hi.norm.pow 2))).comp hyperbolicEuclideanCoordinates_continuous.continuousAt lemma kernelQuotientEnergyDensity_continuous (f : kernelSmoothTests) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous (kernelQuotientEnergyDensity f) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology (kernelTestEnergyDensity_continuous f).quotient_lift _ lemma kernelQuotientEnergyDensity_nonneg (f : kernelSmoothTests) (q : KernelQuotient) : 0≤kernelQuotientEnergyDensity f q := by induction q using Quotient.inductionOn with | _ w => exact kernelTestEnergyDensity_nonneg f w lemma kernelQuotientEnergyDensity_support (f : kernelSmoothTests) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Function.support (kernelQuotientEnergyDensity f)⊆tsupport f.1 := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace intro q hq by_contra hn have hz : f.1=ᶠ[𝓝 q]0 := notMem_tsupport_iff_eventuallyEq.mp hn induction q using Quotient.inductionOn with | _ w => have hp : 0 (kernelTestField f p).re)=ᶠ[𝓝 (hyperbolicEuclideanCoordinates w)]0 := by filter_upwards [hzF] with p hp simp [hp] have hzi : (fun p => (kernelTestField f p).im)=ᶠ[𝓝 (hyperbolicEuclideanCoordinates w)]0 := by filter_upwards [hzF] with p hp simp [hp] apply hq change kernelTestEnergyDensity f w=0 simp only [kernelTestEnergyDensity,euclideanScalarDirichletDensity,hzr.fderiv_eq,hzi.fderiv_eq, fderiv_zero,Pi.zero_apply,norm_zero,zero_pow (by decide : 2≠0),mul_zero,add_zero] lemma kernelQuotientEnergyDensity_hasCompactSupport (f : kernelSmoothTests) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology HasCompactSupport (kernelQuotientEnergyDensity f) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel HasCompactSupport.of_support_subset_isCompact f.2.2 (kernelQuotientEnergyDensity_support f) lemma kernelQuotientEnergyDensity_integrable (f : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite Integrable (kernelQuotientEnergyDensity f) (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite let : BorelSpace KernelQuotient := kernelQuotientBorel (kernelQuotientEnergyDensity_continuous f).integrable_of_hasCompactSupport (kernelQuotientEnergyDensity_hasCompactSupport f) def kernelDirichletEnergy (f : kernelSmoothTests) : ℝ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∫q,kernelQuotientEnergyDensity f q ∂integralQuotientVolume globalKubotaKernel lemma kernelDirichletEnergy_nonneg (f : kernelSmoothTests) : 0≤kernelDirichletEnergy f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace integral_nonneg (kernelQuotientEnergyDensity_nonneg f) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.DirichletForm namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold ENNReal MatrixGroups namespace CubicEisenstein def kernelTestPartial (f : kernelSmoothTests) (w : HyperbolicSpace) (j : Fin 3) : ℂ := fderiv ℝ (kernelTestField f) (hyperbolicEuclideanCoordinates w) (EuclideanSpace.basisFun (Fin 3) ℝ j) lemma kernelTestPartial_add (f g : kernelSmoothTests) (w : HyperbolicSpace) (j : Fin 3) : kernelTestPartial (f+g) w j=kernelTestPartial f w j+kernelTestPartial g w j := by unfold kernelTestPartial have he : kernelTestField (f+g)=kernelTestField f+kernelTestField g := rfl rw [he,fderiv_add ((kernelTestField_contDiffAt f _ (hyperbolicHeight_pos w)).differentiableAt (by simp)) ((kernelTestField_contDiffAt g _ (hyperbolicHeight_pos w)).differentiableAt (by simp))] rfl lemma kernelTestPartial_smul (c : ℂ) (f : kernelSmoothTests) (w : HyperbolicSpace) (j : Fin 3) : kernelTestPartial (c•f) w j=c*kernelTestPartial f w j := by unfold kernelTestPartial have he : kernelTestField (c•f)=c•kernelTestField f := rfl rw [he,fderiv_const_smul ((kernelTestField_contDiffAt f _ (hyperbolicHeight_pos w)).differentiableAt (by simp))] rfl lemma kernelTestEnergyDensity_eq_partials (f : kernelSmoothTests) (w : HyperbolicSpace) : kernelTestEnergyDensity f w=(hyperbolicHeight w)^2*∑j:Fin 3,‖kernelTestPartial f w j‖^2 := by have hd := ((kernelTestField_contDiffAt f (hyperbolicEuclideanCoordinates w) (hyperbolicHeight_pos w)).differentiableAt (by simp)).hasFDerivAt have hr := (Complex.reCLM.hasFDerivAt.comp (hyperbolicEuclideanCoordinates w) hd).fderiv have hi := (Complex.imCLM.hasFDerivAt.comp (hyperbolicEuclideanCoordinates w) hd).fderiv change fderiv ℝ (fun p => (kernelTestField f p).re) (hyperbolicEuclideanCoordinates w)=_ at hr change fderiv ℝ (fun p => (kernelTestField f p).im) (hyperbolicEuclideanCoordinates w)=_ at hi unfold kernelTestEnergyDensity euclideanScalarDirichletDensity rw [hr,hi,(EuclideanSpace.basisFun (Fin 3) ℝ).norm_dual, (EuclideanSpace.basisFun (Fin 3) ℝ).norm_dual,←mul_add,←Finset.sum_add_distrib] congr 1 apply Finset.sum_congr rfl intro j hj change (kernelTestPartial f w j).re^2+(kernelTestPartial f w j).im^2=‖kernelTestPartial f w j‖^2 simpa only [Complex.normSq_apply,pow_two] using Complex.normSq_eq_norm_sq (kernelTestPartial f w j) lemma kernelTestEnergyDensity_smul (c : ℂ) (f : kernelSmoothTests) (w : HyperbolicSpace) : kernelTestEnergyDensity (c•f) w=‖c‖^2*kernelTestEnergyDensity f w := by simp only [kernelTestEnergyDensity_eq_partials,kernelTestPartial_smul,norm_mul,mul_pow,←Finset.mul_sum] ring open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold ENNReal MatrixGroups InnerProductSpace def kernelGradientAt (w : HyperbolicSpace) : kernelSmoothTests→ₗ[ℂ]EuclideanSpace ℂ (Fin 3) where toFun f := WithLp.toLp 2 (fun j => (hyperbolicHeight w:ℂ)*kernelTestPartial f w j) map_add' f g := by apply (WithLp.equiv 2 (Fin 3→ℂ)).injective funext j simp [kernelTestPartial_add,mul_add] map_smul' c f := by apply (WithLp.equiv 2 (Fin 3→ℂ)).injective funext j simp [kernelTestPartial_smul,smul_eq_mul,mul_left_comm] lemma kernelGradientAt_norm_sq (w : HyperbolicSpace) (f : kernelSmoothTests) : ‖kernelGradientAt w f‖^2=kernelTestEnergyDensity f w := by rw [PiLp.norm_sq_eq_of_L2,kernelTestEnergyDensity_eq_partials] change (∑j:Fin 3,‖(hyperbolicHeight w:ℂ)*kernelTestPartial f w j‖^2)=_ simp only [norm_mul,mul_pow,Complex.norm_real,Real.norm_of_nonneg (hyperbolicHeight_pos w).le, Finset.mul_sum] def kernelDirichletPairDensity (f g : kernelSmoothTests) (q : KernelQuotient) : ℂ := ((kernelQuotientEnergyDensity (f+g) q:ℂ)-(kernelQuotientEnergyDensity (f-g) q:ℂ)+ ((kernelQuotientEnergyDensity (f-Complex.I•g) q:ℂ)- (kernelQuotientEnergyDensity (f+Complex.I•g) q:ℂ))*Complex.I)/4 lemma kernelDirichletPairDensity_coordinate (f g : kernelSmoothTests) (w : HyperbolicSpace) : kernelDirichletPairDensity f g (integralOrbitProjection globalKubotaKernel w)= inner ℂ (kernelGradientAt w f) (kernelGradientAt w g) := by rw [inner_eq_sum_norm_sq_div_four] simp only [←map_add,←map_sub,←map_smul,RCLike.ofReal_eq_complex_ofReal,←Complex.ofReal_pow,kernelGradientAt_norm_sq] rfl lemma kernelDirichletPairDensity_integrable (f g : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Integrable (kernelDirichletPairDensity f g) (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hf : ∀h : kernelSmoothTests,Integrable (fun q => (kernelQuotientEnergyDensity h q:ℂ)) (integralQuotientVolume globalKubotaKernel) := fun h => (kernelQuotientEnergyDensity_integrable h).ofReal exact ((hf (f+g)).sub (hf (f-g)) |>.add (((hf (f-Complex.I•g)).sub (hf (f+Complex.I•g))).mul_const _)).div_const _ lemma kernelDirichletPairDensity_add_right (f g h : kernelSmoothTests) (q : KernelQuotient) : kernelDirichletPairDensity f (g+h) q=kernelDirichletPairDensity f g q+kernelDirichletPairDensity f h q := by induction q using Quotient.inductionOn with | _ w => simp only [←show integralOrbitProjection globalKubotaKernel w=Quotient.mk _ w from rfl, kernelDirichletPairDensity_coordinate,map_add,inner_add_right] lemma kernelDirichletPairDensity_smul_right (c : ℂ) (f g : kernelSmoothTests) (q : KernelQuotient) : kernelDirichletPairDensity f (c•g) q=c*kernelDirichletPairDensity f g q := by induction q using Quotient.inductionOn with | _ w => simp only [←show integralOrbitProjection globalKubotaKernel w=Quotient.mk _ w from rfl, kernelDirichletPairDensity_coordinate,map_smul,inner_smul_right] lemma kernelDirichletPairDensity_conj (f g : kernelSmoothTests) (q : KernelQuotient) : star (kernelDirichletPairDensity g f q)=kernelDirichletPairDensity f g q := by induction q using Quotient.inductionOn with | _ w => change star (kernelDirichletPairDensity g f (integralOrbitProjection globalKubotaKernel w))= kernelDirichletPairDensity f g (integralOrbitProjection globalKubotaKernel w) rw [kernelDirichletPairDensity_coordinate,kernelDirichletPairDensity_coordinate] exact inner_conj_symm _ _ lemma kernelDirichletPairDensity_self (f : kernelSmoothTests) (q : KernelQuotient) : kernelDirichletPairDensity f f q=(kernelQuotientEnergyDensity f q:ℂ) := by induction q using Quotient.inductionOn with | _ w => change kernelDirichletPairDensity f f (integralOrbitProjection globalKubotaKernel w)=_ rw [kernelDirichletPairDensity_coordinate,inner_self_eq_norm_sq_to_K,RCLike.ofReal_eq_complex_ofReal,←Complex.ofReal_pow,kernelGradientAt_norm_sq] rfl def kernelDirichletForm (f g : kernelSmoothTests) : ℂ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∫q,kernelDirichletPairDensity f g q ∂integralQuotientVolume globalKubotaKernel lemma kernelDirichletForm_add_right (f g h : kernelSmoothTests) : kernelDirichletForm f (g+h)=kernelDirichletForm f g+kernelDirichletForm f h := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by unfold kernelDirichletForm simp_rw [kernelDirichletPairDensity_add_right] exact integral_add (kernelDirichletPairDensity_integrable f g) (kernelDirichletPairDensity_integrable f h) lemma kernelDirichletForm_smul_right (c : ℂ) (f g : kernelSmoothTests) : kernelDirichletForm f (c•g)=c*kernelDirichletForm f g := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by unfold kernelDirichletForm simp_rw [kernelDirichletPairDensity_smul_right] exact integral_const_mul _ _ lemma kernelDirichletForm_conj (f g : kernelSmoothTests) : star (kernelDirichletForm g f)=kernelDirichletForm f g := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by unfold kernelDirichletForm simp only [Complex.star_def] rw [←integral_conj] apply integral_congr_ae exact Filter.Eventually.of_forall (kernelDirichletPairDensity_conj f g) lemma kernelDirichletForm_self (f : kernelSmoothTests) : kernelDirichletForm f f=(kernelDirichletEnergy f:ℂ) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by unfold kernelDirichletForm kernelDirichletEnergy simp_rw [kernelDirichletPairDensity_self] exact integral_complex_ofReal end CubicEisenstein namespace CompletedGauss section open scoped BigOperators Classical SchwartzMap open MeasureTheory theorem finite_integral_energy_bound {κ : Type*} [Fintype κ] (b : ℝ→ℂ) (φ : κ→ℝ→ℂ) (E : ℝ) (hE : 0≤E) (hb : Integrable (fun t => ‖b t‖)) (hφ : ∀k,Integrable (fun t => b t*φ k t)) (hbound : ∀t,(∑k,‖φ k t‖^2)≤E) : (∑k,‖∫t : ℝ,b t*φ k t‖^2)≤E*(∫t : ℝ,‖b t‖)^2 := by let e := PiLp.continuousLinearEquiv 2 ℂ (fun _ : κ => ℂ) let F : ℝ→EuclideanSpace ℂ κ := fun t => e.symm (fun k => b t*φ k t) have hF (t : ℝ) : ‖F t‖≤‖b t‖*Real.sqrt E := by apply (sq_le_sq₀ (norm_nonneg _) (by positivity)).mp rw [EuclideanSpace.norm_sq_eq,mul_pow,Real.sq_sqrt hE] change (∑k,‖b t*φ k t‖^2)≤‖b t‖^2*E simp only [norm_mul,mul_pow,←Finset.mul_sum] exact mul_le_mul_of_nonneg_left (hbound t) (sq_nonneg _) have he : (∫t : ℝ,F t)=e.symm (fun k => ∫t : ℝ,b t*φ k t) := by rw [show F=(fun t => e.symm (fun k => b t*φ k t)) from rfl,e.symm.integral_comp_comm] congr 1 funext k exact eval_integral hφ k have hn : ‖e.symm (fun k => ∫t : ℝ,b t*φ k t)‖≤(∫t : ℝ,‖b t‖)*Real.sqrt E := by rw [←he,←integral_mul_const] exact norm_integral_le_of_norm_le (hb.mul_const _) (Filter.Eventually.of_forall hF) have hs := pow_le_pow_left₀ (norm_nonneg _) hn 2 rw [EuclideanSpace.norm_sq_eq,mul_pow,Real.sq_sqrt hE] at hs simpa [e,mul_comm] using hs open CanonicalQuadraticSieve ActualEisensteinCubic theorem integrated_product_quadratic (ε : ℝ) (hε : 0<ε) : ∃C : ℝ,0 β t n b)) → (∀t,∀n∈S,∀b∈T,‖β t n b‖≤lengthScale) → ∀rowPhase : idealRange K→ℝ→ℂ,(∀k,Continuous (rowPhase k)) → (∀k t,‖rowPhase k t‖≤1) → ∀b : 𝓢(ℝ,ℂ), (∑k : idealRange K,‖∫t : ℝ,b t*(rowPhase k t* ∑n∈S,∑v∈T,quadraticRow k.val (primaryGenerator (n*v))*β t n v)‖^2)≤ C*(K*(U*B))^ε*(K+U*B)*(U*B)*lengthScale^2*(∫t : ℝ,‖b t‖)^2 := by obtain ⟨C,hC,hbound⟩ := product_quadratic_norm_scaled ε hε refine ⟨C,hC,?_⟩ intro K U B lengthScale hK hU hB hL S T hS hT β hβc hβ rowPhase hωc hω b let E := C*(K*(U*B))^ε*(K+U*B)*(U*B)*lengthScale^2 have hE : 0≤E := by dsimp [E]; positivity let φ : idealRange K→ℝ→ℂ := fun k t => rowPhase k t* ∑n∈S,∑v∈T,quadraticRow k.val (primaryGenerator (n*v))*β t n v have hφc (k : idealRange K) : Continuous (φ k) := by apply (hωc k).mul apply continuous_finsetSum intro n hn apply continuous_finsetSum intro v hv exact continuous_const.mul (hβc n v) have hφbound (t : ℝ) : (∑k,‖φ k t‖^2)≤E := by apply le_trans _ (hbound K U B lengthScale hK hU hB hL S T hS hT (β t) (hβ t)) apply Finset.sum_le_sum intro k hk exact pow_le_pow_left₀ (norm_nonneg _) (by rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (hω k t)) 2 have hpoint (k : idealRange K) (t : ℝ) : ‖φ k t‖≤Real.sqrt E := by apply (Real.le_sqrt (norm_nonneg _) hE).mpr exact (Finset.single_le_sum (fun j _ => sq_nonneg ‖φ j t‖) (Finset.mem_univ k)).trans (hφbound t) have hφint (k : idealRange K) : Integrable (fun t : ℝ => b t*φ k t) := b.integrable.mul_bdd (hφc k).aestronglyMeasurable (Filter.Eventually.of_forall (hpoint k)) exact finite_integral_energy_bound b φ E hE b.integrable.norm hφint hφbound end section open ActualEisensteinCubic CanonicalQuadraticSieve def completedRowFiber (S : Finset (Ideal O)) (Q A T : Ideal O) : Finset (Ideal O) := S.filter (fun I => rowPowerfulPart I=A ∧ rowMaskPart I Q=T) theorem rowResidualPart_injective_on_fiber (S : Finset (Ideal O)) (Q A T : Ideal O) (hS : ∀I∈S,I≠0) : Set.InjOn (fun I => rowResidualPart I Q) (completedRowFiber S Q A T) := by intro I hI J hJ he change rowResidualPart I Q=rowResidualPart J Q at he obtain ⟨hIS,hIA,hIT⟩ := Finset.mem_filter.mp hI obtain ⟨hJS,hJA,hJT⟩ := Finset.mem_filter.mp hJ calc I = rowPowerfulPart I*rowMaskPart I Q*rowResidualPart I Q := (row_powerful_mask_residual_product I Q (hS I hIS)).symm _ = rowPowerfulPart J*rowMaskPart J Q*rowResidualPart J Q := by rw [hIA,hJA,hIT,hJT,he] _ = J := row_powerful_mask_residual_product J Q (hS J hJS) theorem completedRowFiber_residual_range (S : Finset (Ideal O)) (Q A T : Ideal O) (hbad : ∀P∈fixedBadPrimes,P∣Q) (K : ℝ) (hS : ∀I∈S,I≠0 ∧ (Ideal.absNorm I:ℝ)≤K) (I : Ideal O) (hI : I∈completedRowFiber S Q A T) : rowResidualPart I Q∈idealRange (K/((Ideal.absNorm A:ℝ)*(Ideal.absNorm T:ℝ))) := by obtain ⟨hIS,hIA,hIT⟩ := Finset.mem_filter.mp hI apply mem_idealRange.mpr refine ⟨rowResidualPart_admissible I Q hbad,?_⟩ rw [rowResidualPart_norm I Q (hS I hIS).1,hIA,hIT] exact div_le_div_of_nonneg_right (hS I hIS).2 (by positivity) theorem completedRowFiber_energy_le (S : Finset (Ideal O)) (Q A T : Ideal O) (hbad : ∀P∈fixedBadPrimes,P∣Q) (K : ℝ) (hS : ∀I∈S,I≠0 ∧ (Ideal.absNorm I:ℝ)≤K) (f : Ideal O→ℂ) : (∑I∈completedRowFiber S Q A T,‖f (rowResidualPart I Q)‖^2)≤ ∑J : idealRange (K/((Ideal.absNorm A:ℝ)*(Ideal.absNorm T:ℝ))),‖f J.val‖^2 := by let U := (completedRowFiber S Q A T).image (fun I => rowResidualPart I Q) have he : (∑I∈completedRowFiber S Q A T,‖f (rowResidualPart I Q)‖^2)=∑J∈U,‖f J‖^2 := by rw [Finset.sum_image (rowResidualPart_injective_on_fiber S Q A T (fun I hI => (hS I hI).1))] rw [he,Finset.sum_coe_sort (s := idealRange (K/((Ideal.absNorm A:ℝ)*(Ideal.absNorm T:ℝ)))) (f := fun J : Ideal O => ‖f J‖^2)] apply Finset.sum_le_sum_of_subset_of_nonneg · intro J hJ obtain ⟨I,hI,rfl⟩ := Finset.mem_image.mp hJ exact completedRowFiber_residual_range S Q A T hbad K hS I hI · intro _ _ _ exact sq_nonneg _ end open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory open ActualEisensteinCubic CanonicalQuadraticSieve end CompletedGauss open scoped BigOperators Classical SchwartzMap ContDiff namespace InitialMeanSquare open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog) def initialLogProfile (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) : 𝓢(ℝ,ℂ) := ((CubicReflectionKernel.logProfile_compact W a b ha hs).mul_left (f := fun t : ℝ => (Real.exp (t/2) : ℂ))).toSchwartzMap (by change ContDiff ℝ ∞ (fun t : ℝ => (Real.exp (t/2) : ℂ)*W (Real.exp t)) have he : ContDiff ℝ ∞ (fun t : ℝ => Real.exp (t/2)) := Real.contDiff_exp.comp (contDiff_id.div_const 2) exact (Complex.ofRealCLM.contDiff.comp he).mul (hW.comp Real.contDiff_exp)) lemma initialLogProfile_apply (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) (t : ℝ) : initialLogProfile W a b ha hs hW t = (Real.exp (t/2) : ℂ)*W (Real.exp t) := rfl theorem initialLogProfile_support (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) : ∀ t, initialLogProfile W a b ha hs hW t ≠ 0 → |t| ≤ |Real.log a|+|Real.log b|+1 := by intro t ht have hw : W (Real.exp t) ≠ 0 := by intro hz simp only [initialLogProfile_apply, hz, mul_zero] at ht exact ht rfl have hm := hs hw have hlo : Real.log a ≤ t := by simpa only [Real.log_exp] using Real.log_le_log ha hm.1 have hhi : t ≤ Real.log b := by simpa only [Real.log_exp] using Real.log_le_log (Real.exp_pos t) hm.2 rw [abs_le] constructor <;> linarith [le_abs_self (Real.log a), neg_abs_le (Real.log a), le_abs_self (Real.log b), abs_nonneg (Real.log a), abs_nonneg (Real.log b)] theorem initialLogProfile_normalized {ι : Type*} (p : ι → O) (hp : ∀ i, p i ≠ 0) (S : Finset ι) (Z : ℝ) (hZ : 0 < Z) (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) : normalizedColumn p (fun T => initialLogProfile W a b ha hs hW (columnLog p Z T)) S = (Real.sqrt Z : ℂ)⁻¹*W (primeProductNorm p S/Z) := by let n := ‖eisEmbedding (∏ i ∈ S,p i)‖ have hn : 0 < n := norm_pos_iff.mpr (eisEmbedding_ne_zero (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i))) have hpos : 0 < n^2/Z := div_pos (sq_pos_of_pos hn) hZ have hexp : Real.exp (Real.log (n^2/Z)/2)=n/Real.sqrt Z := by rw [←JointLogSeparation.sqrt_exp_half, Real.exp_log hpos, Real.sqrt_div (sq_nonneg n), Real.sqrt_sq hn.le] change ((Real.exp (Real.log (n^2/Z)/2) : ℂ)*W (Real.exp (Real.log (n^2/Z)))) / (n : ℂ) = (Real.sqrt Z : ℂ)⁻¹*W (n^2/Z) rw [hexp, Real.exp_log hpos, Complex.ofReal_div] have hn0 : (n : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hn.ne' have hsz : (Real.sqrt Z : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (Real.sqrt_pos.mpr hZ).ne' field_simp variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) omit [DecidableEq ι] in lemma mobiusRow_mul (F : Finset ι) (Ψ : O →* ℂ) (m : O) (H : Finset ι → ℂ) (c : ℂ) (z : O) : mobiusRow p hg F Ψ m (fun S => c*H S) z = c*mobiusRow p hg F Ψ m H z := by simp only [mobiusRow, Finset.mul_sum] apply Finset.sum_congr rfl intro S hS simp only [inputColumn] ring omit [DecidableEq ι] in theorem mobiusRow_initial_normalization (hp : ∀ i, p i ≠ 0) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (z : O) (Z : ℝ) (hZ : 0 < Z) (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) : mobiusRow p hg F Ψ m (normalizedColumn p (fun T => initialLogProfile W a b ha hs hW (columnLog p Z T))) z = (Real.sqrt Z : ℂ)⁻¹*mobiusRow p hg F Ψ m (fun T => W (primeProductNorm p T/Z)) z := by have hc : normalizedColumn p (fun T => initialLogProfile W a b ha hs hW (columnLog p Z T)) = fun T => (Real.sqrt Z : ℂ)⁻¹*W (primeProductNorm p T/Z) := by funext T exact initialLogProfile_normalized p hp T Z hZ W a b ha hs hW rw [hc, mobiusRow_mul] omit [DecidableEq ι] in theorem mobiusRow_initial_energy (hp : ∀ i, p i ≠ 0) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (z : O) (Z : ℝ) (hZ : 0 < Z) (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) : ‖mobiusRow p hg F Ψ m (normalizedColumn p (fun T => initialLogProfile W a b ha hs hW (columnLog p Z T))) z‖^2 = ‖mobiusRow p hg F Ψ m (fun T => W (primeProductNorm p T/Z)) z‖^2/Z := by rw [mobiusRow_initial_normalization p hg hp F Ψ m z Z hZ W a b ha hs hW, norm_mul, norm_inv, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (Real.sqrt_pos.mpr hZ), mul_pow, inv_pow, Real.sq_sqrt hZ.le] ring end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.InputEnergy namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap ContDiff namespace InitialMeanSquare open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog) theorem poolProduct_admissible (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (S : Finset (primePool F)) : Admissible (∏ i ∈ S,i.val) := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal have hp (i : primePool F) : Prime i.val := Ideal.prime_of_isPrime (NeZero.ne i.val) inferInstance have hn : (∏ i ∈ S,i.val) ≠ (0 : Ideal O) := Finset.prod_ne_zero_iff.mpr (fun i _ => (hp i).ne_zero) refine ⟨hn, ?_, ?_⟩ · apply Finset.squarefree_prod_of_pairwise_isCoprime · intro i hi j hj hij exact (Ideal.isCoprime_of_isMaximal (fun he => hij (Subtype.ext he))).isRelPrime · intro i hi exact (hp i).squarefree · intro P hP obtain ⟨hprime, hdiv⟩ := (UniqueFactorizationMonoid.mem_normalizedFactors_iff hn).mp hP obtain ⟨i, hi, hPi⟩ := (hprime.dvd_finsetProd_iff (fun i : primePool F => i.val)).mp hdiv have he : P=i.val := (prime_dvd_prime_iff_eq hprime (hp i)).mp hPi rw [he] exact ⟨poolGood F hF i, poolOdd F hF i⟩ theorem poolPrimary_norm (F : Finset (Ideal O)) (hF : ∀ I ∈ F, Admissible I) (S : Finset (primePool F)) : primeProductNorm (poolPrimary F) S = (Ideal.absNorm (∏ i ∈ S,i.val) : ℝ) := by rw [primeProductNorm, eisEmbedding_norm_sq_eq_absNorm_span, FiniteGaussPhase.span_finset_prod] congr 2 apply Finset.prod_congr rfl intro i hi exact poolPrimary_span F hF i end InitialMeanSquare open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog) open RayFourExpansion (RayCharacter) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hg : ∀i,lambda∉Ideal.span {p i}) theorem inputConjugateRow_zero_of_mass_zero (F : Finset ι) (Ψ : O →* ℂ) (m c d : O) (H : Finset ι → ℂ) (hm : (∑S∈F.powerset,‖secondInputCoefficient p hg Ψ m c d H S‖^2)=0) (z : O) : inputConjugateRow p hg F Ψ m c d H z=0 := by unfold inputConjugateRow FirstCauchyArithmetic.supportConjugateSum apply Finset.sum_eq_zero intro S hS have hle : ‖secondInputCoefficient p hg Ψ m c d H S‖^2≤0 := by rw [←hm] exact Finset.single_le_sum (f := fun A => ‖secondInputCoefficient p hg Ψ m c d H A‖^2) (fun A _ => sq_nonneg _) hS have hz : secondInputCoefficient p hg Ψ m c d H S=0 := by apply norm_eq_zero.mp nlinarith [norm_nonneg (secondInputCoefficient p hg Ψ m c d H S)] simp only [hz,mul_zero,zero_mul] include hp in theorem globalFirstCoreRow_zero_off_support (pool : Finset ι) (b : GlobalFirstData ι) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ,ℂ)) (ell M U : ℝ) (hell : 0 hM u (firstCoreModeProfile_support g V side t u hu).1) hU side hoff have hz := inputConjugateRow_zero_of_mass_zero p hg (globalFirstRawPool pool b) (firstCoreTwist side χ Ψ r) (m*globalFirstBlockBadLabel p b) (globalFirstBlockLabel p b) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) (globalFirstBlockTest p (firstCoreModeProfile g V side t) ell side b) hm (if side then -z else z) unfold globalFirstCoreRow rw [firstCoreInputRow_eq_mode_row p hp hg _ _ _ _ _ _ side χ Ψ m g V _ hX] change _*inputConjugateRow p hg (globalFirstRawPool pool b) (firstCoreTwist side χ Ψ r) (m*globalFirstBlockBadLabel p b) (globalFirstBlockLabel p b) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) (globalFirstBlockTest p (firstCoreModeProfile g V side t) ell side b) (if side then -z else z)=0 rw [hz,mul_zero] include hp in theorem globalFirstFiniteEnergy_eq_supported (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (Ψ : O →* ℂ) (m : O) (g V : 𝓢(ℝ,ℂ)) (ell M U : ℝ) (hell : 0 primeProductNorm p b.common≤U ∧ primeProductNorm p b.firstCommon≤U)) w Ψ m g V ell side χ r T t := by unfold globalFirstFiniteEnergy symm apply Finset.sum_subset (Finset.filter_subset _ _) intro b hb hn have hoff : ¬(primeProductNorm p b.common≤U ∧ primeProductNorm p b.firstCommon≤U) := by intro hh; exact hn (Finset.mem_filter.mpr ⟨hb,hh⟩) have hz (z : O) := globalFirstCoreRow_zero_off_support p hp hg pool b Ψ m g V ell M U hell hM hU side χ r t z hoff simp only [hz,norm_zero,zero_pow (by decide : 2≠0),Finset.sum_const_zero,mul_zero] end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm primeProduct) open ConcreteTraceCRT (eisEmbedding) def globalFirstTailFactor (K ell B F U H : ℝ) (N : ℕ) : ℝ := (1+U)^4*(1+(1+U)^3*(K*U^2/(ell^2*B^2*F^2)))^2/(1+H)^N variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] include hp in theorem globalFirstPooledRow_lower_from_common (b : GlobalFirstData ι) (K ell B F U : ℝ) (hK : 0 Ideal.span {p i})) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (Γ K ell B F U : ℝ) (side : Bool), 0≤Γ → 0 (1/primeProductNorm p b.common)*(1/primeProductNorm p b.firstCommon)* (1/‖eisEmbedding (∏i∈cubeActiveSupport b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit,p i)‖) have hsum := hcount p hp hinj s B U hB hU hs hC ht hb1 hb2 change (∑b∈s,θ b)≤_ at hsum have hterm (b : GlobalFirstData ι) (hb : b∈s) : w b*globalFirstCoefficient p K ell B F side b*globalFirstPooledRow p K ell B F side b* (primeProductNorm p b.firstCommon)⁻¹≤(Γ*(Real.exp 1)^3*ell*B^2*F)*θ b := by have htpos := FirstPassCubeLabels.primeProductNorm_pos p hp b.firstCommon have hc : 0≤globalFirstCoefficient p K ell B F side b := globalBinFirstCoefficient_nonneg K ell B F hK.le hell hB0 hF _ have hY : 0 Ideal.span {p i})) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (Γ K ell B F M U H : ℝ) (N : ℕ) (side : Bool), 0≤Γ → 0 ((w b*globalFirstCoefficient p K ell B F side b : ℝ) : ℂ)) K ell B F M H N side≤C*Γ*(ell*B^3*F)*(B*U)^ε*globalFirstTailFactor K ell B F U H N := by obtain ⟨C,hC,hvolume⟩ := globalFirstWeightedVolume_bound ε hε refine ⟨C,hC,?_⟩ intro ι _ p hp _ hinj s w Γ K ell B F M U H N side hΓ hK hell hB hF hU hH hellU hw hs hCnorm ht hb1 hb2 have hB0 : 0 Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (s : Finset (GlobalFirstData ι)) (w : GlobalFirstData ι → ℝ) (Γ K ell B F H U : ℝ) (Ψ : O →* ℂ) (m : O) (χ : RayCharacter) (r : FirstCoreIndex) (T : GlobalFirstData ι → Finset O), 0≤Γ → (∀ b∈s,0≤w b ∧ w b≤Γ) → 0 FirstPassCubeLabels.primeProductNorm p b.common≤U ∧ FirstPassCubeLabels.primeProductNorm p b.firstCommon≤U) let source := globalFirstSupportedPool p pool activeFamily (fun b G E => (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0) ell M side let weight := fun b => w b*globalFirstCoefficient p K ell B F side b let Ψmode := firstCoreTwist side χ Ψ r (∫ t : ℝ,firstLogDensity (2*(J+2)) t* globalFirstFiniteEnergy p hg pool s weight Ψ m g V ell side χ r T t) ≤ (∫ t : ℝ,firstLogDensity 0 t)* (Cd*Γ*(ell*B^3*F)*(B*U)^ε + globalChildBudget p hp hcop hg pool source Ψmode m windows (Γ*C) ε 0 0 K ell B F M H A J side + Ct*Γ*(ell*B^3*F)*(B*U)^ε*globalFirstTailFactor K ell B F U H N) := by have hbase : ∀t,firstCoreBaseProfile g V side t≠0 → |t|≤M := by intro t ht apply hgM t intro hz apply ht simp only [firstCoreBaseProfile_apply,hz,zero_mul] obtain ⟨windows,C,Ct0,hC,hCt0,hwc,hws,hwb,hrows⟩ := globalFirstCoreRows_integrated_transfer ε hε g V M hM hgM side A J N obtain ⟨Cd,hCd,hdiag⟩ := globalFirstDiagonalCost_parent_bound ε hε (firstCoreBaseProfile g V side) rowMajorant M hbase obtain ⟨Ct1,hCt1,htail⟩ := globalFirstTailCost_parent_bound ε hε refine ⟨windows,C,Cd,Ct0*Ct1,hC,hCd,mul_pos hCt0 hCt1,hwc,hws,hwb,?_⟩ intro ι _ p hp _ hcop hg hinj hc hpr pool s w Γ K ell B F H U Ψ m χ r T hΓ hw hK hell hB hF hH hU hellU hs hΨ hb1 hb2 hT hT0 dsimp only have hB0 : 0 FirstPassCubeLabels.primeProductNorm p b.common≤U ∧ FirstPassCubeLabels.primeProductNorm p b.firstCommon≤U) let weight := fun b => w b*globalFirstCoefficient p K ell B F side b let Ψmode := firstCoreTwist side χ Ψ r have hsub (b : GlobalFirstData ι) (hb : b∈activeFamily) : b∈s := (Finset.mem_filter.mp hb).1 have hΓw := fun b hb => hw b (hsub b hb) have hsa := fun b hb => hs b (hsub b hb) have hba1 := fun b hb => hb1 b (hsub b hb) have hba2 := fun b hb => hb2 b (hsub b hb) have hΨmode : ∀a,‖Ψmode a‖≤1 := fun a => (firstCoreTwist_norm_le side χ Ψ r a).trans (hΨ a) have hr := hrows p hp hcop hg hinj hc hpr pool activeFamily w Γ K ell B F H Ψ m χ r T hΓ hΓw hK hell hB0 hF hH hsa hΨ hba1 hba2 (fun b hb => hT b (hsub b hb)) (fun b hb => hT0 b (hsub b hb)) dsimp only at hr have hd := hdiag p hp hg hinj pool activeFamily w Ψmode m Γ K ell B F U side hΓ hK hell hB hF hU hellU hΨmode hΓw hsa hba1 hba2 have ht := htail p hp hinj activeFamily w Γ K ell B F M U H N side hΓ hK hell hB hF hU hH hellU hΓw hsa (fun b hb => (Finset.mem_filter.mp hb).2.1) (fun b hb => (Finset.mem_filter.mp hb).2.2) hba1 hba2 have heq : (∫t : ℝ,firstLogDensity (2*(J+2)) t*globalFirstFiniteEnergy p hg pool s weight Ψ m g V ell side χ r T t)= (∫t : ℝ,firstLogDensity (2*(J+2)) t*globalFirstFiniteEnergy p hg pool activeFamily weight Ψ m g V ell side χ r T t) := by apply integral_congr_ae filter_upwards with t rw [globalFirstFiniteEnergy_eq_supported p hp hg pool s weight Ψ m g V ell M U hell hgM hellU side χ r T t] rw [heq] apply hr.trans apply mul_le_mul_of_nonneg_left _ (integral_nonneg (fun t => FirstPassCubeLabels.firstLogDensity_nonneg 0 t)) have ht' := mul_le_mul_of_nonneg_left ht hCt0.le have h := add_le_add (add_le_add hd (le_refl (globalChildBudget p hp hcop hg pool (globalFirstSupportedPool p pool activeFamily (fun b G E => (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0) ell M side) Ψmode m windows (Γ*C) ε 0 0 K ell B F M H A J side))) ht' convert h using 1 ; dsimp [weight,Ψmode] ; ring end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct primeProductNorm firstLogDensity) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter crossCoeff) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) def globalFirstRayChildBudget (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (Ψ : O →* ℂ) (m : O) (windows : Fin 7 → ℝ → ℂ) (C Γ ε K ell B F M H U : ℝ) (A J : ℕ) (side : Bool) : ℝ := letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype let family := (globalFirstFamilySet pool blocks).filter (fun b => primeProductNorm p b.common≤U ∧ primeProductNorm p b.firstCommon≤U) let source := globalFirstSupportedPool p pool family (fun b G E => (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0) ell M side ∑a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖*∑r : FirstCoreIndex, (∫t : ℝ,firstLogDensity 0 t)*globalChildBudget p hp hcop hg pool source (firstCoreTwist side (if side then a.1 else a.2) Ψ r) m windows (Γ*firstCoreUniformWeight r*C) ε 0 0 K ell B F M H A J side def globalFirstQuantitativeBudget (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (Ψ : O →* ℂ) (m : O) (windows : Fin 7 → ℝ → ℂ) (C Cd Ct Γ ε K ell B F M H U : ℝ) (A J N : ℕ) (side : Bool) : ℝ := (∫t : ℝ,firstLogDensity 0 t)*(512*(512*32))*Γ*(ell*B^3*F)*(B*U)^ε* (Cd+Ct*globalFirstTailFactor K ell B F U H N) + globalFirstRayChildBudget p hp hcop hg pool blocks Ψ m windows C Γ ε K ell B F M H U A J side end private lemma two_finite_error_sum {α β : Type*} [Fintype α] [Fintype β] (a : α → ℝ) (b : β → ℝ) (E : ℝ) (c : α → β → ℝ) : (∑x,a x*∑y,(b y*E+c x y))=(∑x,a x)*(∑y,b y)*E+∑x,a x*∑y,c x y := by simp only [Finset.sum_add_distrib,Finset.sum_mul,mul_add] congr 1 apply Finset.sum_congr rfl intro x hx rw [←Finset.sum_mul] ring theorem globalCubeInputFamilyEnergy_quantitative (ε : ℝ) (hε : 0<ε) (g V : 𝓢(ℝ,ℂ)) (M : ℝ) (hM : 0≤M) (hgM : ∀t,g t≠0 → |t|≤M) (side : Bool) (A J N : ℕ) : ∃ (windows : Fin 7 → ℝ → ℂ) (C Cd Ct : ℝ),0≤C ∧ 0 Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀i,ringChar (O ⧸ Ideal.span {p i})≠2) (_hpr : ∀i,lambda^2∣p i-1) (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (w : GlobalCubeBlock ι → ℝ) (Γ K ell B F H U : ℝ) (Ψ : O →* ℂ) (m : O) (T : GlobalCubeBlock ι → Finset O), 0≤Γ → (∀b∈blocks,0≤w b ∧ w b≤Γ) → 0 primeProductNorm p b.common≤U ∧ primeProductNorm p b.firstCommon≤U) let source := globalFirstSupportedPool p pool activeFamily (fun b G E => (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0) ell M side let child := fun (a : RayCharacter×RayCharacter) (r : FirstCoreIndex) => (∫t : ℝ,firstLogDensity 0 t)*globalChildBudget p hp hcop hg pool source (firstCoreTwist side (if side then a.1 else a.2) Ψ r) m windows (Γ*firstCoreUniformWeight r*C) ε 0 0 K ell B F M H A J side let E0 := (∫t : ℝ,firstLogDensity 0 t)*Γ*(ell*B^3*F)*(B*U)^ε*(Cd+Ct*globalFirstTailFactor K ell B F U H N) have hI : 0≤∫t : ℝ,firstLogDensity 0 t := integral_nonneg (fun t => FirstPassCubeLabels.firstLogDensity_nonneg 0 t) have hf0 : 0≤globalFirstTailFactor K ell B F U H N := by unfold globalFirstTailFactor; positivity have hE0 : 0≤E0 := by dsimp [E0]; positivity have hrow' (a : RayCharacter×RayCharacter) (r : FirstCoreIndex) : (∫t : ℝ,firstLogDensity (2*(J+2)) t* globalFirstFiniteEnergy p hg pool family (fun d => globalFirstFamilyWeight p hg w Ψ m side r d*globalFirstCoefficient p K ell B F side d) Ψ m g V ell side (if side then a.1 else a.2) r (fun d => T d.block) t)≤ firstCoreUniformWeight r*E0+child a r := by have hΓr : 0≤Γ*firstCoreUniformWeight r := by unfold firstCoreUniformWeight; positivity have h := hrow p hp hcop hg hinj hc hpr pool family (globalFirstFamilyWeight p hg w Ψ m side r) (Γ*firstCoreUniformWeight r) K ell B F H U Ψ m (if side then a.1 else a.2) r (fun d => T d.block) hΓr (fun d hd => globalFirstFamilyWeight_bounds p hg blocks w Γ hw Ψ hΨ m side r pool d hd) hK hell hB hF hH hU hellU (fun d hd => hs d.block ((mem_globalFirstFamilySet pool blocks d).mp hd).1) hΨ (fun d hd => hb1 d.block ((mem_globalFirstFamilySet pool blocks d).mp hd).1) (fun d hd => hb2 d.block ((mem_globalFirstFamilySet pool blocks d).mp hd).1) (by intro d hd z hz; rw [globalFirstPooledRow_block]; exact hT d.block ((mem_globalFirstFamilySet pool blocks d).mp hd).1 z hz) (fun d hd => hT0 d.block ((mem_globalFirstFamilySet pool blocks d).mp hd).1) dsimp only at h convert h using 1 ; dsimp [E0,child,source,activeFamily] ; ring rw [globalCubeInputFamilyEnergy_eq_integrated_rows] have hm : (∑a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖)*(∑r : FirstCoreIndex,firstCoreUniformWeight r)≤512*(512*32) := by have ha : (∑a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖)≤512 := by simpa only [Fintype.sum_prod_type] using RayFourExpansion.crossCoeff_sum_norm_le exact mul_le_mul ha firstCoreUniformWeight_mass (Finset.sum_nonneg (fun r _ => by unfold firstCoreUniformWeight; positivity)) (by norm_num) calc _ ≤ ∑a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖*∑r : FirstCoreIndex,(firstCoreUniformWeight r*E0+child a r) := Finset.sum_le_sum (fun a _ => mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun r _ => hrow' a r)) (norm_nonneg _)) _ = ((∑a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖)*(∑r : FirstCoreIndex,firstCoreUniformWeight r))*E0+ ∑a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖*∑r : FirstCoreIndex,child a r := two_finite_error_sum _ _ _ _ _ ≤ (512*(512*32))*E0+∑a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖*∑r : FirstCoreIndex,child a r := add_le_add (mul_le_mul_of_nonneg_right hm hE0) le_rfl _ = _ := by unfold globalFirstQuantitativeBudget globalFirstRayChildBudget dsimp [E0,child,source,activeFamily,family] ring end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.OutsideIdeals namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap ContDiff namespace InitialMeanSquare open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog) theorem idealRowSum_filter_squarefree (F : Finset (Ideal O)) (hFp : ∀ I ∈ F, I ≠ ⊥) (hFg : ∀ I ∈ F, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P) {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℕ → ℂ) (z : O) : idealRowSum F hFp hFg χ W z = idealRowSum (F.filter Squarefree) (fun I hI => hFp I (Finset.mem_filter.mp hI).1) (fun I hI => hFg I (Finset.mem_filter.mp hI).1) χ W z := by unfold idealRowSum calc _ = ∑ I ∈ F.filter Squarefree, ShortDraftHeckeBridge.baseChangeWeight χ I * W (Ideal.absNorm I) * idealSexticRow F hFp hFg I z := by symm apply Finset.sum_subset (Finset.filter_subset _ _) intro I hIF hIn have hs : ¬ Squarefree I := fun h => hIn (Finset.mem_filter.mpr ⟨hIF,h⟩) rw [baseChangeWeight_zero_of_not_squarefree χ I hs, zero_mul, zero_mul] _ = _ := by apply Finset.sum_congr rfl intro I hI rw [idealSexticRow_ambient F (F.filter Squarefree) hFp (fun J hJ => hFp J (Finset.mem_filter.mp hJ).1) hFg (fun J hJ => hFg J (Finset.mem_filter.mp hJ).1) I (Finset.mem_filter.mp hI).1 hI z] def outsideSquarefreeIdeals (S : Finset (Ideal O)) (D : ℕ) : Finset (Ideal O) := (outsideIdealsUpTo S D).filter Squarefree theorem outsideSquarefree_admissible (S : Finset (Ideal O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) : ∀ I ∈ outsideSquarefreeIdeals S D, Admissible I := by intro I hI obtain ⟨ho,hs⟩ := Finset.mem_filter.mp hI have hn := outsideIdealsUpTo_ne_bot S D I ho refine ⟨hn,hs,?_⟩ intro P hP obtain ⟨hp,hd⟩ := (UniqueFactorizationMonoid.mem_normalizedFactors_iff hn).mp hP let : P.IsMaximal := (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero apply (prime_good_iff_not_bad P).mpr intro hPb exact (mem_outsideIdealsUpTo.mp ho).2.2 P (hbad hPb) hd theorem outside_good (S : Finset (Ideal O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) : ∀ I ∈ outsideIdealsUpTo S D, ∀ P ∈ UniqueFactorizationMonoid.normalizedFactors I, goodLambda ∉ P := by apply outsideIdealsUpTo_good S D apply badPrime_cover_of_lambdaIdeal_mem exact hbad (Finset.mem_insert_self _ _) theorem outside_pool_product_not_dvd (S : Finset (Ideal O)) (D : ℕ) (hSp : ∀ P ∈ S, Prime P) (T : Finset (primePool (outsideSquarefreeIdeals S D))) : ∀ P ∈ S, ¬ P ∣ ∏ i ∈ T,i.val := by intro P hPS hdiv obtain ⟨i,hi,hPi⟩ := ((hSp P hPS).dvd_finsetProd_iff (fun i : primePool (outsideSquarefreeIdeals S D) => i.val)).mp hdiv obtain ⟨I,hIF,hiI⟩ := mem_primePool_iff.mp i.property have ho : I ∈ outsideIdealsUpTo S D := (Finset.mem_filter.mp hIF).1 have hn := outsideIdealsUpTo_ne_bot S D I ho have hd : i.val ∣ I := (UniqueFactorizationMonoid.mem_normalizedFactors_iff hn).mp hiI |>.2 exact (mem_outsideIdealsUpTo.mp ho).2.2 P hPS (hPi.trans hd) theorem selectedIdealTest_outside (S : Finset (Ideal O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀ P ∈ S, Prime P) (W : ℝ → ℂ) (b Z : ℝ) (hZ : 0 < Z) (hs : ∀ t, W t ≠ 0 → t ≤ b) (hD : b*Z ≤ D) (T : Finset (primePool (outsideSquarefreeIdeals S D))) : selectedIdealTest (outsideSquarefreeIdeals S D) (fun n => W (n/Z)) T = W (primeProductNorm (poolPrimary (outsideSquarefreeIdeals S D)) T/Z) := by let F := outsideSquarefreeIdeals S D have hF := outsideSquarefree_admissible S D hbad rw [poolPrimary_norm F hF T] unfold selectedIdealTest by_cases hw : W ((Ideal.absNorm (∏ i ∈ T,i.val) : ℝ)/Z)=0 · split_ifs · rfl · exact hw.symm · rw [if_pos] have ha := poolProduct_admissible F hF T apply Finset.mem_filter.mpr refine ⟨mem_outsideIdealsUpTo.mpr ⟨?_,?_,outside_pool_product_not_dvd S D hSp T⟩,ha.2.1⟩ · exact Nat.one_le_iff_ne_zero.mpr (fun hz => ha.1 (Ideal.absNorm_eq_zero_iff.mp hz)) · exact_mod_cast ((div_le_iff₀ hZ).mp (hs _ hw)).trans hD theorem outside_idealRowSum_initial_energy {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀ P ∈ S, Prime P) (W : ℝ → ℂ) (a b Z : ℝ) (ha : 0 < a) (hZ : 0 < Z) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) (hD : b*Z ≤ D) (z : O) : letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F := outsideSquarefreeIdeals S D let hF := outsideSquarefree_admissible S D hbad letI : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance ‖idealRowSum (outsideIdealsUpTo S D) (outsideIdealsUpTo_ne_bot S D) (outside_good S D hbad) χ (fun n => W (n/Z)) z‖^2/Z = ‖mobiusRow (poolPrimary F) (poolPrimary_good F hF) Finset.univ (normCharacter χ) 1 (normalizedColumn (poolPrimary F) (fun T => initialLogProfile W a b ha hs hW (columnLog (poolPrimary F) Z T))) z‖^2 := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal dsimp only let F := outsideSquarefreeIdeals S D have hF := outsideSquarefree_admissible S D hbad let : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance rw [idealRowSum_filter_squarefree] change ‖idealRowSum F (fun I hI => (hF I hI).1) (fun I hI P hP => ((hF I hI).2.2 P hP).1) χ (fun n => W (n/Z)) z‖^2/Z = _ rw [idealRowSum_eq_mobiusRow F hF] have ht : selectedIdealTest F (fun n => W (n/Z)) = fun T => W (primeProductNorm (poolPrimary F) T/Z) := by funext T exact selectedIdealTest_outside S D hbad hSp W b Z hZ (fun t ht => (hs ht).2) hD T rw [ht] exact (mobiusRow_initial_energy (poolPrimary F) (poolPrimary_good F hF) (poolPrimary_ne_zero F hF) Finset.univ (normCharacter χ) 1 z Z hZ W a b ha hs hW).symm end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.PoissonSource namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap ContDiff namespace InitialMeanSquare section open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve SecondPassArithmetic open FirstPassCubeLabels (normalizedColumn columnLog) theorem outside_mean_square_source {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀ P ∈ S, Prime P) (W : ℝ → ℂ) (a b Z Y : ℝ) (ha : 0 < a) (hZ : 0 < Z) (hY : 0 < Y) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) (hD : b*Z ≤ D) (T : Finset O) (hT : ∀ z ∈ T, (Ideal.absNorm (Ideal.span {z}) : ℝ) ≤ Y) (hT0 : ∀ z ∈ T, z ≠ 0) (K : Finset (primePool (outsideSquarefreeIdeals S D)) → Finset (primePool (outsideSquarefreeIdeals S D)) → Finset O) : letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F := outsideSquarefreeIdeals S D let hF := outsideSquarefree_admissible S D hbad let p := poolPrimary F let hp := poolPrimary_ne_zero F hF let hg := poolPrimary_good F hF letI : ∀ i : primePool F, (Ideal.span {p i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance let hinj : Function.Injective (fun i : primePool F => Ideal.span {p i}) := by intro i j hij apply Subtype.ext simpa only [p, poolPrimary_span F hF] using hij let G := normalizedColumn p (fun V => initialLogProfile W a b ha hs hW (columnLog p Z V)) let Ψ := conjugateMonoid (normCharacter χ) (∑ z ∈ T, ‖idealRowSum (outsideIdealsUpTo S D) (outsideIdealsUpTo_ne_bot S D) (outside_good S D hbad) χ (fun n => W (n/Z)) z‖^2)/Z ≤ ‖truncatedSecondSource p hp hg hinj Finset.univ Ψ 1 1 1 (fun V => star (G V)) rowMajorant Y (fun C E => (K C E).erase 0)‖+ (truncatedSecondZero p hg Finset.univ Ψ 1 1 1 (fun V => star (G V)) rowMajorant Y K).re+ ‖secondSourceTail p hp hg hinj Finset.univ Ψ 1 1 1 (fun V => star (G V)) rowMajorant Y K‖-‖G ∅‖^2 := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal dsimp only let F := outsideSquarefreeIdeals S D have hF := outsideSquarefree_admissible S D hbad let p := poolPrimary F let hp := poolPrimary_ne_zero F hF let hg := poolPrimary_good F hF let : ∀ i : primePool F, (Ideal.span {p i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance have hinj : Function.Injective (fun i : primePool F => Ideal.span {p i}) := by intro i j hij apply Subtype.ext simpa only [p, poolPrimary_span F hF] using hij let G := normalizedColumn p (fun V => initialLogProfile W a b ha hs hW (columnLog p Z V)) have he := mobiusRow_finite_source p hg hp hinj (poolPrimary_odd F hF) Finset.univ (normCharacter χ) 1 G Y hY T hT hT0 K calc _ = ∑ z ∈ T, ‖mobiusRow p hg Finset.univ (normCharacter χ) 1 G z‖^2 := by rw [Finset.sum_div] apply Finset.sum_congr rfl intro z hz exact outside_idealRowSum_initial_energy χ S D hbad hSp W a b Z ha hZ hs hW hD z _ ≤ _ := he end open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog firstLogDensity) open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma initial_actual_row_norm (x : SecondExpansionData ι) : ‖eisEmbedding (actualSecondRow p ∅ x.divisor x.frequency)‖^2 = elementNorm (sourceObservation p x).1 := by simp only [actualSecondRow, sourceObservation, elementNorm, map_mul, norm_mul, mul_pow, primeSubsetGenerator_norm_eq_productNorm, primeProductNorm, Finset.prod_empty, map_one, norm_one, one_pow, one_mul] omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma initialLogIndex_eq_second (x : SecondExpansionData ι) : initialLogIndex p x = secondLogIndex p ∅ x := by simp only [initialLogIndex, secondLogIndex, initial_actual_row_norm] theorem initial_sector_coordinates (hp : ∀ i, p i ≠ 0) (F R : Finset ι) (K : Finset ι → Finset ι → Finset O) (Z M : ℝ) (hZ : 0 < Z) (j : SecondLogIndex) (x : SecondExpansionData ι) (hx : x ∈ secondLogSector p ∅ F K R Z M j) : let X := initialLogColumn Z (primeProductNorm p R) j |sourceLogZ p Z X x| ≤ 2 ∧ |sourceLogE p (secondLogE j) x| ≤ 2 ∧ |sourceLogV p (secondLogV j) x| ≤ 2 ∧ |sourceLogK p (secondLogK j) x| ≤ 2 := by obtain ⟨hx',hj⟩ := Finset.mem_filter.mp hx obtain ⟨hG,hE,hV,hk,hkf,hR,hs⟩ := secondSupportedSector_mem p F K R Z M x hx' have hsec := secondExpansionSector_valid p F (fun G E => (K G E).erase 0) R x (Finset.mem_filter.mp hx').1 have heq : initialLogIndex p x=j := (initialLogIndex_eq_second p x).trans hj have hc := initial_log_coordinates p hp Z hZ x hE hk dsimp only at hc ⊢ rw [heq,quotient_norm_fixed p _ x hsec] at hc simpa only [sourceLogZ, sourceLogE, sourceLogV, sourceLogK, elementNorm, primeSubsetGenerator_norm_eq_productNorm] using hc end end InitialMeanSquare open scoped BigOperators namespace FiniteOverlapDecomposition variable {ι : Type*} [DecidableEq ι] theorem sum_powerset_split {β : Type*} [AddCommMonoid β] (F B : Finset ι) (hB : B⊆F) (f : Finset ι→β) : (∑S∈F.powerset,f S)=∑A∈B.powerset,∑U∈(F\B).powerset,f (A∪U) := by have hsplit (S : Finset ι) : S∩B∪S\B=S := by ext i simp only [Finset.mem_union,Finset.mem_inter,Finset.mem_sdiff] tauto have he : (∑S∈F.powerset,f S)= ∑AU∈B.powerset ×ˢ (F\B).powerset,f (AU.1∪AU.2) := by apply Finset.sum_bij (fun S _ => (S∩B,S\B)) · intro S hS rw [Finset.mem_product,Finset.mem_powerset,Finset.mem_powerset] refine ⟨Finset.inter_subset_right,?_⟩ intro i hi exact Finset.mem_sdiff.mpr ⟨(Finset.mem_powerset.mp hS) (Finset.mem_sdiff.mp hi).1,(Finset.mem_sdiff.mp hi).2⟩ · intro S hS T hT he have hi := congrArg (fun AU : Finset ι×Finset ι => AU.1∪AU.2) he simpa only [hsplit] using hi · intro AU hAU rcases Finset.mem_product.mp hAU with ⟨hA,hU⟩ have hAB := Finset.mem_powerset.mp hA have hUFB := Finset.mem_powerset.mp hU refine ⟨AU.1∪AU.2,Finset.mem_powerset.mpr (Finset.union_subset (hAB.trans hB) (hUFB.trans Finset.sdiff_subset)),?_⟩ apply Prod.ext <;> ext i · have h1 : i∈AU.1 → i∈B := fun hi => hAB hi have h2 : i∈AU.2 → i∉B := fun hi => (Finset.mem_sdiff.mp (hUFB hi)).2 simp only [Finset.mem_inter,Finset.mem_union] tauto · have h1 : i∈AU.1 → i∈B := fun hi => hAB hi have h2 : i∈AU.2 → i∉B := fun hi => (Finset.mem_sdiff.mp (hUFB hi)).2 simp only [Finset.mem_sdiff,Finset.mem_union] tauto · intro S hS rw [hsplit] simpa only [Finset.sum_product] using he theorem sum_pair_split_cube {β : Type*} [AddCommMonoid β] (F B : Finset ι) (hB : B⊆F) (f : Finset ι→Finset ι→β) : (∑S∈F.powerset,∑T∈F.powerset,f S T)= ∑A₂∈B.powerset,∑A₁∈B.powerset,∑C∈(F\B).powerset, ∑N∈((F\B)\C).powerset,∑P∈((F\B)\C).powerset, if Disjoint N P then f ((A₂∪C)∪N) ((A₁∪C)∪P) else 0 := by rw [sum_powerset_split F B hB] apply Finset.sum_congr rfl intro A₂ hA₂ simp_rw [sum_powerset_split F B hB] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro A₁ hA₁ rw [sum_pair_eq_overlap] simp only [Finset.union_assoc] end FiniteOverlapDecomposition open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic open MixedCrossSeparation (columnCoefficient) open FirstPassCubeLabels variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i≠0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda∉Ideal.span {p i}) def canonicalSourceCoefficient (Ψ : O→*ℂ) (m f : O) (H : Finset ι→ℂ) (S : Finset ι) : ℂ := columnCoefficient p hp hcop hg S * Ψ (∏i∈S,p i) * rowCoprimeMask (fun i => Ideal.span {p i}) S m * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S f^4 * H S theorem canonicalSourceCoefficient_union (hpr : ∀ i,lambda^2∣p i-1) (Ψ : O→*ℂ) (m f : O) (H : Finset ι→ℂ) (D S : Finset ι) (hd : Disjoint D S) : canonicalSourceCoefficient p hp hcop hg Ψ m f H (D∪S) = canonicalSourceCoefficient p hp hcop hg Ψ m f (fun _ => 1) D * (columnCoefficient p hp hcop hg S * multiplicativeCoreColumn p Ψ m (fun U => H (D∪U)) S * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S (∏i∈D,p i)^4 * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg S f^4) := by have hA := columnCoefficient_union_row_four p hp hcop hg hpr S D hd.symm rw [Finset.union_comm S D] at hA simp only [canonicalSourceCoefficient,hA,Finset.prod_union hd,map_mul, row_union _ hg D S hd,mask_union _ hg D S hd,mul_pow,multiplicativeCoreColumn] ring theorem canonicalCube_pair_row (B C N P : Finset ι) (v₁ v₂ : ι→ℕ) (ε₁ ε₂ : ι→Bool) (hcover : ∀ i∈B,0 Ideal.span {p i}) hg (((B.filter fun i => ε₂ i)∪C)∪N) z) * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg (((B.filter fun i => ε₁ i)∪C)∪P) z * star (multiplicityRow (fun i => Ideal.span {p i}) hg B v₂ z^3) * multiplicityRow (fun i => Ideal.span {p i}) hg B v₁ z^3 = rowCoprimeMask (fun i => Ideal.span {p i}) (C∪cubePrincipalSupport B v₁ v₂ ε₁ ε₂) z * blockRow p hg ((N∪P)∪cubeActiveSupport B (fun i => v₁ i+v₂ i) ε₁ ε₂) (threeBlockExponent N P (fun i => v₁ i+v₂ i) ε₁ ε₂) z := by have hA₁C : Disjoint (B.filter fun i => ε₁ i) C := hCB.symm.mono_left (Finset.filter_subset _ _) have hA₂C : Disjoint (B.filter fun i => ε₂ i) C := hCB.symm.mono_left (Finset.filter_subset _ _) have hA₁P : Disjoint (B.filter fun i => ε₁ i) P := hPB.symm.mono_left (Finset.filter_subset _ _) have hA₂N : Disjoint (B.filter fun i => ε₂ i) N := hNB.symm.mono_left (Finset.filter_subset _ _) have hCp : Disjoint C (cubePrincipalSupport B v₁ v₂ ε₁ ε₂) := hCB.mono_right (Finset.filter_subset _ _) have hsel : cubePairRow (fun i => Ideal.span {p i}) hg B v₁ v₂ ε₁ ε₂ z = rowCoprimeMask (fun i => Ideal.span {p i}) (cubePrincipalSupport B v₁ v₂ ε₁ ε₂) z * blockRow p hg (cubeActiveSupport B (fun i => v₁ i+v₂ i) ε₁ ε₂) (fun i => (conductorExponent (parity (v₁ i+v₂ i)) (ε₁ i) (ε₂ i)).val) z := by exact cubePairRow_conductor_selection (fun i => Ideal.span {p i}) hg B v₁ v₂ ε₁ ε₂ (fun i hi => by have := hcover i hi;omega) z rw [row_union _ hg _ N (Finset.disjoint_union_left.mpr ⟨hA₂N,hNC.symm⟩), row_union _ hg _ P (Finset.disjoint_union_left.mpr ⟨hA₁P,hPC.symm⟩), row_union _ hg _ C hA₂C,row_union _ hg _ C hA₁C] simp only [star_mul] calc _ = (star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg C z)* finiteSquarefreeRow (fun i => Ideal.span {p i}) hg C z)* (star (finiteSquarefreeRow (fun i => Ideal.span {p i}) hg N z)* finiteSquarefreeRow (fun i => Ideal.span {p i}) hg P z)* cubePairRow (fun i => Ideal.span {p i}) hg B v₁ v₂ ε₁ ε₂ z := by simp only [cubePairRow];ring _ = _ := by rw [ActualEisensteinCubic.finiteSquarefreeRow_self_pair (fun i => Ideal.span {p i}) hg C z, hsel, threeBlockRow_factor p hg N P B hNP hNB hPB, mask_union _ hg C _ hCp] ring theorem canonicalSourceCoefficient_cube_split (hinj : Function.Injective (fun i => Ideal.span {p i})) (hpr : ∀ i,lambda^2∣p i-1) (Ψ : O→*ℂ) (m f : O) (H : Finset ι→ℂ) (B C S : Finset ι) (ε₁ ε₂ : ι→Bool) (negative : Bool) (hCB : Disjoint C B) (hSC : Disjoint S C) (hSB : Disjoint S B) : let A := B.filter (fun i => if negative then ε₂ i else ε₁ i) canonicalSourceCoefficient p hp hcop hg Ψ m f H ((A∪C)∪S) = canonicalSourceCoefficient p hp hcop hg Ψ m f (fun _ => 1) (A∪C) * (columnCoefficient p hp hcop hg S * originalLabelColumn p hg B ε₁ ε₂ negative (multiplicativeCoreColumn p Ψ m (fun U => H ((A∪C)∪U))) (∏i∈C,p i) f S) := by dsimp only have hAC : Disjoint (B.filter fun i => if negative then ε₂ i else ε₁ i) C := hCB.symm.mono_left (Finset.filter_subset _ _) have hAS : Disjoint (B.filter fun i => if negative then ε₂ i else ε₁ i) S := hSB.symm.mono_left (Finset.filter_subset _ _) rw [canonicalSourceCoefficient_union p hp hcop hg hpr Ψ m f H _ S (Finset.disjoint_union_left.mpr ⟨hAS,hSC.symm⟩)] have hA : (∏i∈B.filter (fun i => if negative then ε₂ i else ε₁ i),p i) = aLabel p B (if negative then ε₂ else ε₁) := by cases negative <;> simp only [Bool.false_eq_true,ite_false,ite_true,aLabel,primeProduct, Finset.prod_filter,bit] all_goals apply Finset.prod_congr rfl intro i hi split_ifs <;> simp_all rw [Finset.prod_union hAC,hA] simp only [originalLabelColumn,cubeRadical,commonProduct_mask p hg hinj S B,if_pos hSB,mul_one] ring end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap namespace FirstPassCubeLabels open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) open EisensteinSchwartzPoisson (paperRadialFourier) open MixedCrossSeparation (columnCoefficient columnPrimeCoprime) variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) def canonicalPairMode (N P B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (C₁ C₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ K : ℝ) (d h : O) : ℂ := (V₁ (columnLog p X₁ N)*V₂ (columnLog p X₂ P))* ((K:ℂ)/(‖eisEmbedding (∏i∈(N∪P)∪cubeActiveSupport B v ε₁ ε₂,p i)‖:ℂ))* paperRadialFourier W (K*‖eisEmbedding h‖^2/ (‖eisEmbedding d‖^2*primeProductNorm p ((N∪P)∪cubeActiveSupport B v ε₁ ε₂)))* threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h lemma canonicalPairMode_summable (N P B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (C₁ C₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ K : ℝ) (hK : 0 paperRadialFourier W (t*‖eisEmbedding h‖^2)*star (blockRow p hg S e h)) := by apply Summable.of_norm apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ (EisensteinSchwartzPoisson.paperRadialFourier_lattice_summable_norm W t ht) intro h rw [norm_mul,norm_star] exact mul_le_of_le_one_right (norm_nonneg _) (blockRow_norm_le_one p hg S e h) let a : ℂ := (V₁ (columnLog p X₁ N)*V₂ (columnLog p X₂ P))* ((K:ℂ)/(‖eisEmbedding (∏i∈S,p i)‖:ℂ))* (star (columnCoefficient p hp hcop hg N*C₁ N)*(columnCoefficient p hp hcop hg P*C₂ P)* FiniteGaussPhase.canonicalProductGauss (fun i:S => p i.val) (fun i=>hp i.val) (columnPrimeCoprime p hcop S) (fun i=>hg i.val) (fun i=>e i.val))*blockRow p hg S e d apply (hs.mul_left a).congr intro h dsimp only [canonicalPairMode,threeGaussRowFactor,a,t,S,e] have ht' : K/(‖eisEmbedding d‖^2*primeProductNorm p ((N∪P)∪cubeActiveSupport B v ε₁ ε₂))* ‖eisEmbedding h‖^2 = K*‖eisEmbedding h‖^2/(‖eisEmbedding d‖^2* primeProductNorm p ((N∪P)∪cubeActiveSupport B v ε₁ ε₂)) := by ring rw [ht'] ring lemma actualFirstKernel_summable (F B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (C₁ C₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ K : ℝ) (hK : 0 if Disjoint N P then canonicalPairMode p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K d h else 0) := by by_cases hNP : Disjoint N P · simp only [hNP,ite_true] exact canonicalPairMode_summable p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K hK d hd · simp only [hNP,ite_false] exact summable_zero change (∑'h:O,∑N∈F.powerset,∑P∈F.powerset,if Disjoint N P then canonicalPairMode p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K d h else 0)=_ rw [Summable.tsum_finsetSum (fun N hN => summable_sum (fun P hP => hs N P))] apply Finset.sum_congr rfl intro N hN rw [Summable.tsum_finsetSum (fun P hP => hs N P)] apply Finset.sum_congr rfl intro P hP split_ifs <;> simp def disjointCanonicalSource (F M B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (C₁ C₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ K : ℝ) : ℂ := ∑N∈F.powerset,∑P∈F.powerset,if Disjoint N P then (V₁ (columnLog p X₁ N)*V₂ (columnLog p X₂ P))* (star (columnCoefficient p hp hcop hg N*C₁ N)*(columnCoefficient p hp hcop hg P*C₂ P))* (∑'z:O,rowCoprimeMask (fun i=>Ideal.span {p i}) M z* blockRow p hg ((N∪P)∪cubeActiveSupport B v ε₁ ε₂) (threeBlockExponent N P v ε₁ ε₂) z*W (‖eisEmbedding z‖^2/K)) else 0 theorem disjointCanonicalSource_poisson (hinj : Function.Injective (fun i=>Ideal.span {p i})) (hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (F M B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (C₁ C₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ K : ℝ) (hK : 0Ideal.span {p i}) D) h := by simp_rw [tsum_actualFirstKernel p hp hcop hg F B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K hK _ (primeSubsetGenerator_ne_zero _ _)] simp only [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro N hN rw [Finset.sum_comm] apply Finset.sum_congr rfl intro P hP by_cases hNP : Disjoint N P · simp only [hNP,ite_true] exact (by have he : ∀i∈(N∪P)∪cubeActiveSupport B v ε₁ ε₂,threeBlockExponent N P v ε₁ ε₂ i≠0 := by intro i hi by_cases hn:i∈N · simp [threeBlockExponent,hn] by_cases hp':i∈P · simp [threeBlockExponent,hn,hp'] · have hiC:i∈cubeActiveSupport B v ε₁ ε₂ := by simpa [hn,hp'] using hi simp only [threeBlockExponent,if_neg hn,if_neg hp'] exact (ZMod.val_eq_zero _).not.mpr (Finset.mem_filter.mp hiC).2 have he6 : ∀i∈(N∪P)∪cubeActiveSupport B v ε₁ ε₂,threeBlockExponent N P v ε₁ ε₂ i<6 := by intro i hi unfold threeBlockExponent split_ifs <;> first | omega | exact ZMod.val_lt _ rw [masked_block_radial_poisson_product p hp hinj hcop hg hc M _ _ he he6 W K hK] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro D hD simp only [←tsum_mul_left] apply tsum_congr intro h dsimp only [canonicalPairMode,threeGaussRowFactor] rw [SecondPassArithmetic.primeSubsetGenerator_norm_eq_productNorm p D] simp only [primeProductNorm] ring ) · simp only [hNP,ite_false,mul_zero,Finset.sum_const_zero] end FirstPassCubeLabels open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels open MixedCrossSeparation (columnCoefficient) open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) def canonicalCubeSourcePair (B S T : Finset ι) (v₁ v₂ : ι→ℕ) (Ψ₁ Ψ₂ : O→*ℂ) (m₁ m₂ f : O) (H₁ H₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (K : ℝ) : ℂ := star (canonicalSourceCoefficient p hp hcop hg Ψ₁ m₁ f H₁ S)* canonicalSourceCoefficient p hp hcop hg Ψ₂ m₂ f H₂ T* ∑'z:O,(star (finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S z)* finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg T z* star (multiplicityRow (fun i=>Ideal.span {p i}) hg B v₂ z^3)* multiplicityRow (fun i=>Ideal.span {p i}) hg B v₁ z^3)*W (‖eisEmbedding z‖^2/K) def canonicalCubeOuter (b : CubeCoordinates ι) (C : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m₁ m₂ f : O) : ℂ := star (canonicalSourceCoefficient p hp hcop hg Ψ₁ m₁ f (fun _=>1) (b.rightDivisor∪C))* canonicalSourceCoefficient p hp hcop hg Ψ₂ m₂ f (fun _=>1) (b.leftDivisor∪C) def canonicalCubeResidual (b : CubeCoordinates ι) (C : Finset ι) (negative : Bool) (Ψ : O→*ℂ) (m f : O) (H : Finset ι→ℂ) : Finset ι→ℂ := originalLabelColumn p hg b.support b.leftBit b.rightBit negative (multiplicativeCoreColumn p Ψ m (fun S=>H (((if negative then b.rightDivisor else b.leftDivisor)∪C)∪S))) (∏i∈C,p i) f def canonicalCubeBeforePoisson (pool : Finset ι) (b : CubeCoordinates ι) (C : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m₁ m₂ f : O) (H₁ H₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (K : ℝ) : ℂ := canonicalCubeOuter p hp hcop hg b C Ψ₁ Ψ₂ m₁ m₂ f* disjointCanonicalSource p hp hcop hg (pool\(b.support∪C)) (C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit) b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (canonicalCubeResidual p hg b C true Ψ₁ m₁ f H₁) (canonicalCubeResidual p hg b C false Ψ₂ m₂ f H₂) W (fun _=>1) (fun _=>1) 1 1 K lemma cube_filter_left (b : CubeCoordinates ι) (hb : b.Admissible) : b.support.filter (fun i=>b.leftBit i)=b.leftDivisor := by ext i simp only [CubeCoordinates.leftBit,Finset.mem_filter,decide_eq_true_eq] exact and_iff_right_of_imp (fun hi=>hb.1 hi) lemma cube_filter_right (b : CubeCoordinates ι) (hb : b.Admissible) : b.support.filter (fun i=>b.rightBit i)=b.rightDivisor := by ext i simp only [CubeCoordinates.rightBit,Finset.mem_filter,decide_eq_true_eq] exact and_iff_right_of_imp (fun hi=>hb.2 hi) theorem canonicalCubeSourcePair_factor (hinj : Function.Injective (fun i=>Ideal.span {p i})) (hpr : ∀i,lambda^2∣p i-1) (b : CubeCoordinates ι) (hb : b.Admissible) (C N P : Finset ι) (hCB : Disjoint C b.support) (hNC : Disjoint N C) (hPC : Disjoint P C) (hNB : Disjoint N b.support) (hPB : Disjoint P b.support) (hNP : Disjoint N P) (Ψ₁ Ψ₂ : O→*ℂ) (m₁ m₂ f : O) (H₁ H₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (K : ℝ) : canonicalCubeSourcePair p hp hcop hg b.support ((b.rightDivisor∪C)∪N) ((b.leftDivisor∪C)∪P) b.leftExponent b.rightExponent Ψ₁ Ψ₂ m₁ m₂ f H₁ H₂ W K = canonicalCubeOuter p hp hcop hg b C Ψ₁ Ψ₂ m₁ m₂ f* (star (columnCoefficient p hp hcop hg N*canonicalCubeResidual p hg b C true Ψ₁ m₁ f H₁ N)* (columnCoefficient p hp hcop hg P*canonicalCubeResidual p hg b C false Ψ₂ m₂ f H₂ P))* ∑'z:O,rowCoprimeMask (fun i=>Ideal.span {p i}) (C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit) z* blockRow p hg ((N∪P)∪cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit) (threeBlockExponent N P (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit) z* W (‖eisEmbedding z‖^2/K) := by have hN := canonicalSourceCoefficient_cube_split p hp hcop hg hinj hpr Ψ₁ m₁ f H₁ b.support C N b.leftBit b.rightBit true hCB hNC hNB have hP := canonicalSourceCoefficient_cube_split p hp hcop hg hinj hpr Ψ₂ m₂ f H₂ b.support C P b.leftBit b.rightBit false hCB hPC hPB simp only [Bool.false_eq_true,ite_true,ite_false,cube_filter_left b hb,cube_filter_right b hb] at hN hP have hz (z : O) := canonicalCube_pair_row p hg b.support C N P b.leftExponent b.rightExponent b.leftBit b.rightBit b.support_pos hCB hNC hPC hNB hPB hNP z simp only [cube_filter_left b hb,cube_filter_right b hb] at hz simp only [canonicalCubeSourcePair,hN,hP,star_mul,canonicalCubeOuter,canonicalCubeResidual] simp only [Bool.false_eq_true,ite_true,ite_false] simp_rw [hz] ring def canonicalCubeCorrelation (pool B : Finset ι) (v₁ v₂ : ι→ℕ) (Ψ₁ Ψ₂ : O→*ℂ) (m₁ m₂ f : O) (H₁ H₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (K : ℝ) : ℂ := ∑S∈pool.powerset,∑T∈pool.powerset, canonicalCubeSourcePair p hp hcop hg B S T v₁ v₂ Ψ₁ Ψ₂ m₁ m₂ f H₁ H₂ W K theorem canonicalCubeCorrelation_eq_blocks (hinj : Function.Injective (fun i=>Ideal.span {p i})) (hpr : ∀i,lambda^2∣p i-1) (pool : Finset ι) (v₁ v₂ : ι→₀ℕ) (hB : v₁.support∪v₂.support⊆pool) (Ψ₁ Ψ₂ : O→*ℂ) (m₁ m₂ f : O) (H₁ H₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (K : ℝ) : canonicalCubeCorrelation p hp hcop hg pool (v₁.support∪v₂.support) v₁ v₂ Ψ₁ Ψ₂ m₁ m₂ f H₁ H₂ W K = ∑A₂∈(v₁.support∪v₂.support).powerset,∑A₁∈(v₁.support∪v₂.support).powerset, ∑C∈(pool\(v₁.support∪v₂.support)).powerset, canonicalCubeBeforePoisson p hp hcop hg pool ⟨v₁,v₂,A₁,A₂⟩ C Ψ₁ Ψ₂ m₁ m₂ f H₁ H₂ W K := by unfold canonicalCubeCorrelation rw [FiniteOverlapDecomposition.sum_pair_split_cube pool _ hB] apply Finset.sum_congr rfl intro A₂ hA₂ apply Finset.sum_congr rfl intro A₁ hA₁ apply Finset.sum_congr rfl intro C hC let b : CubeCoordinates ι:=⟨v₁,v₂,A₁,A₂⟩ have hb : b.Admissible:=⟨Finset.mem_powerset.mp hA₁,Finset.mem_powerset.mp hA₂⟩ have hCB : Disjoint C b.support := Finset.disjoint_left.mpr (fun i hiC hiB => (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hC) hiC)).2 hiB) have hpool : (pool\(v₁.support∪v₂.support))\C=pool\(b.support∪C) := by ext i simp only [CubeCoordinates.support,b,Finset.mem_sdiff,Finset.mem_union] tauto rw [hpool] change _=canonicalCubeBeforePoisson p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ f H₁ H₂ W K simp only [canonicalCubeBeforePoisson,disjointCanonicalSource,Finset.mul_sum,one_mul] apply Finset.sum_congr rfl intro N hN apply Finset.sum_congr rfl intro P hP by_cases hNP : Disjoint N P · simp only [hNP,ite_true] have hNC : Disjoint N C:=Finset.disjoint_left.mpr (fun i hiN hiC => (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hN) hiN)).2 (Finset.mem_union_right _ hiC)) have hPC : Disjoint P C:=Finset.disjoint_left.mpr (fun i hiP hiC => (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hP) hiP)).2 (Finset.mem_union_right _ hiC)) have hNB : Disjoint N b.support:=Finset.disjoint_left.mpr (fun i hiN hiB => (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hN) hiN)).2 (Finset.mem_union_left _ hiB)) have hPB : Disjoint P b.support:=Finset.disjoint_left.mpr (fun i hiP hiB => (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hP) hiP)).2 (Finset.mem_union_left _ hiB)) simpa only [mul_assoc,b,CubeCoordinates.support] using canonicalCubeSourcePair_factor p hp hcop hg hinj hpr b hb C N P hCB hNC hPC hNB hPB hNP Ψ₁ Ψ₂ m₁ m₂ f H₁ H₂ W K · simp only [hNP,ite_false,mul_zero] theorem canonicalCubeBeforePoisson_eq_all_modes (hinj : Function.Injective (fun i=>Ideal.span {p i})) (hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (pool:Finset ι) (b:CubeCoordinates ι) (C:Finset ι) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂ f:O) (H₁ H₂:Finset ι→ℂ) (W:𝓢(ℝ,ℂ)) (K:ℝ) (hK:0b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (canonicalCubeResidual p hg b C true Ψ₁ m₁ f H₁) (canonicalCubeResidual p hg b C false Ψ₂ m₂ f H₂) W (fun _=>1) (fun _=>1) 1 1 K (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) h := by unfold canonicalCubeBeforePoisson rw [disjointCanonicalSource_poisson p hp hcop hg hinj hc _ _ _ _ _ _ _ _ _ _ _ _ _ _ hK] lemma canonicalSourceCoefficient_norm_le_one (hc:∀i,ringChar (O⧸Ideal.span {p i})≠2) (Ψ:O→*ℂ) (hΨ:∀u,‖Ψ u‖≤1) (m f:O) (S:Finset ι) : ‖canonicalSourceCoefficient p hp hcop hg Ψ m f (fun _=>1) S‖≤1 := by have hm : ‖rowCoprimeMask (fun i=>Ideal.span {p i}) S m‖≤1 := by unfold rowCoprimeMask split_ifs <;> simp simp only [canonicalSourceCoefficient,norm_mul,norm_pow,mul_one, columnCoefficient_norm_one p hp hcop hg hc,one_mul] calc ‖Ψ (∏i∈S,p i)‖*‖rowCoprimeMask (fun i=>Ideal.span {p i}) S m‖* ‖finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S f‖^4 ≤ (1:ℝ)*1*1^4 := by exact mul_le_mul (mul_le_mul (hΨ _) hm (norm_nonneg _) (by norm_num)) (pow_le_pow_left₀ (norm_nonneg _) (finiteSquarefreeRow_norm_le_one _ hg _ _) 4) (pow_nonneg (norm_nonneg _) 4) (by norm_num) _ = 1 := by norm_num lemma canonicalCubeOuter_norm_le_one (hc:∀i,ringChar (O⧸Ideal.span {p i})≠2) (b:CubeCoordinates ι) (C:Finset ι) (Ψ₁ Ψ₂:O→*ℂ) (hΨ₁:∀u,‖Ψ₁ u‖≤1) (hΨ₂:∀u,‖Ψ₂ u‖≤1) (m₁ m₂ f:O) : ‖canonicalCubeOuter p hp hcop hg b C Ψ₁ Ψ₂ m₁ m₂ f‖≤1 := by simp only [canonicalCubeOuter,norm_mul,norm_star] exact (mul_le_of_le_one_left (norm_nonneg _) (canonicalSourceCoefficient_norm_le_one p hp hcop hg hc Ψ₁ hΨ₁ m₁ f _)).trans (canonicalSourceCoefficient_norm_le_one p hp hcop hg hc Ψ₂ hΨ₂ m₂ f _) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.QuantitativePassage namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators Classical SchwartzMap ContDiff namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct dilationLabel) open ConcreteTraceCRT (eisEmbedding) end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm actualFirstKernel originalLabelColumn cubeActiveSupport dilationLabel columnLog) open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) end end open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct dilationLabel) open ConcreteTraceCRT (eisEmbedding) end SecondPassArithmetic open scoped BigOperators Classical namespace CompletedGauss section open ActualEisensteinCubic IdealMobiusDivisorSum UniqueFactorizationMonoid theorem completed_branch_count_small_power (ε : ℝ) (hε : 0<ε) : ∃C : ℝ,0 ⟨P i,by change P i∈(normalizedFactors I).toFinset exact Multiset.mem_toFinset.mpr ((UniqueFactorizationMonoid.mem_normalizedFactors_iff hI).mpr ⟨Ideal.prime_of_isPrime (NeZero.ne (P i)) inferInstance,hd i⟩)⟩ have hfi : Function.Injective f := by intro i j hij exact hinj (congrArg Subtype.val hij) have hcard : Fintype.card ι≤(primeSupport I).card := by simpa only [Fintype.card_coe] using Fintype.card_le_of_injective f hfi have htwo : (2:ℝ)^Fintype.card ι≤C*(Ideal.absNorm I:ℝ)^(ε/6) := (pow_le_pow_right₀ (by norm_num : (1:ℝ)≤2) hcard).trans (hbound I hI) have hn : 0<(Ideal.absNorm I:ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun hz => hI (Ideal.absNorm_eq_zero_iff.mp hz)) calc _ = (36:ℝ)^Fintype.card ι := by rw [pow_mul]; norm_num _ ≤ (64:ℝ)^Fintype.card ι := pow_le_pow_left₀ (by norm_num) (by norm_num) _ _ = ((2:ℝ)^Fintype.card ι)^6 := by rw [←pow_mul, Nat.mul_comm, pow_mul]; norm_num _ ≤ (C*(Ideal.absNorm I:ℝ)^(ε/6))^6 := pow_le_pow_left₀ (by positivity) htwo 6 _ = C^6*(Ideal.absNorm I:ℝ)^ε := by rw [mul_pow,←Real.rpow_mul_natCast hn.le] congr 2 ring end open ActualEisensteinCubic CanonicalQuadraticSieve IdealMobiusDivisorSum theorem sum_completedRowFibers (S : Finset (Ideal O)) (Q : Ideal O) (f : Ideal O→ℝ) : (∑A∈S.image rowPowerfulPart,∑T∈S.image (fun I => rowMaskPart I Q), ∑I∈completedRowFiber S Q A T,f I)=∑I∈S,f I := by let mapPair : Ideal O→Ideal O×Ideal O := fun I => (rowPowerfulPart I,rowMaskPart I Q) have hm : ∀I∈S,mapPair I∈(S.image rowPowerfulPart)×ˢ(S.image (fun J => rowMaskPart J Q)) := by intro I hI exact Finset.mem_product.mpr ⟨Finset.mem_image_of_mem _ hI,Finset.mem_image_of_mem _ hI⟩ have hh := Finset.sum_fiberwise_of_maps_to hm f rw [Finset.sum_product] at hh simpa only [mapPair,Prod.mk.injEq,completedRowFiber] using hh theorem rowMaskPart_image_card (S : Finset (Ideal O)) (Q : Ideal O) (hQ : Q≠0) : (S.image (fun I => rowMaskPart I Q)).card≤(idealDivisors Q).card := by apply Finset.card_le_card intro T hT obtain ⟨I,hI,rfl⟩ := Finset.mem_image.mp hT exact (mem_idealDivisors hQ).mpr (rowMaskPart_dvd I Q) theorem completed_outer_row_sum_bound (S : Finset (Ideal O)) (Q : Ideal O) (hQ : Q≠0) (f : Ideal O→ℝ) (C : ℝ) (hC : 0≤C) (hblocks : ∀A∈S.image rowPowerfulPart,∀T∈S.image (fun I => rowMaskPart I Q), (∑I∈completedRowFiber S Q A T,f I)≤C/(Ideal.absNorm A:ℝ)) : (∑I∈S,f I)≤1048576*((idealDivisors Q).card:ℝ)*C := by rw [←sum_completedRowFibers S Q f] calc _ ≤ ∑A∈S.image rowPowerfulPart,∑T∈S.image (fun I => rowMaskPart I Q),C/(Ideal.absNorm A:ℝ) := by apply Finset.sum_le_sum intro A hA exact Finset.sum_le_sum (fun T hT => hblocks A hA T hT) _ = ((S.image (fun I => rowMaskPart I Q)).card:ℝ)*C* ∑A∈S.image rowPowerfulPart,1/(Ideal.absNorm A:ℝ) := by simp only [Finset.sum_const,nsmul_eq_mul] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro A hA ring _ ≤ ((S.image (fun I => rowMaskPart I Q)).card:ℝ)*C*1048576 := by apply mul_le_mul_of_nonneg_left _ (by positivity) apply powerful_inverse_norm_sum intro A hA obtain ⟨I,hI,rfl⟩ := Finset.mem_image.mp hA exact rowPowerfulPart_powerful I _ ≤ ((idealDivisors Q).card:ℝ)*C*1048576 := by exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (Nat.cast_le.mpr (rowMaskPart_image_card S Q hQ)) hC) (by norm_num) _ = _ := by ring theorem completed_outer_row_small_power (ε : ℝ) (hε : 0<ε) : ∃D : ℝ,0 rowMaskPart I Q), (∑I∈completedRowFiber S Q A T,f I)≤C/(Ideal.absNorm A:ℝ)) → (∑I∈S,f I)≤D*(Ideal.absNorm Q:ℝ)^ε*C := by obtain ⟨D,hD,hbound⟩ := IdealDivisorBound.ideal_divisor_small_power ε hε refine ⟨1048576*D,by positivity,?_⟩ intro S Q hQ f C hC hblocks apply (completed_outer_row_sum_bound S Q hQ f C hC hblocks).trans have hh := mul_le_mul_of_nonneg_right (hbound Q hQ) hC nlinarith end CompletedGauss open scoped BigOperators namespace CompletedDyadic def kernelTerm (t s A : ℝ) (n : ℕ) : ℝ := ((2:ℝ)^n)^s/(1+t*(2:ℝ)^n)^A theorem pow_rpow_comm (s : ℝ) (n : ℕ) : ((2:ℝ)^n)^s=((2:ℝ)^s)^n := by rw [←Real.rpow_natCast_mul (by norm_num),←Real.rpow_mul_natCast (by norm_num)] congr 1 ring theorem kernelTerm_nonneg (t s A : ℝ) (ht : 0 kernelTerm_le_head t s A ht hA n)).trans rw [geom_sum_eq hp.ne'] exact div_le_div_of_nonneg_right (by linarith) (sub_nonneg.mpr hp.le) have htail : (∑'n : ℕ,kernelTerm t s A (n+N))≤ t^(-A)*((2:ℝ)^(s-A))^N/(1-(2:ℝ)^(s-A)) := by have hgeo := (summable_geometric_of_lt_one hq0 hq).mul_left (t^(-A)*((2:ℝ)^(s-A))^N) have hb := Summable.tsum_le_tsum (fun n => show kernelTerm t s A (n+N)≤ (t^(-A)*((2:ℝ)^(s-A))^N)*((2:ℝ)^(s-A))^n by simpa only [pow_add,mul_assoc,mul_left_comm,mul_comm] using kernelTerm_le_tail t s A ht hA (n+N)) ((summable_nat_add_iff N).mpr hsum) hgeo rw [tsum_mul_left,tsum_geometric_of_lt_one hq0 hq] at hb simpa only [div_eq_mul_inv] using hb rw [←hsum.sum_add_tsum_nat_add N] exact add_le_add hhead htail theorem kernel_sum_bound (s A : ℝ) (hs : 0 kernelTerm_le_tail t s A ht hA n) hg change (∑'n : ℕ,kernelTerm t s A n)≤∑'n : ℕ,t^(-A)*q^n at hb rw [tsum_mul_left,tsum_geometric_of_lt_one hq0 hq] at hb calc _ ≤ t^(-A)/(1-q) := by simpa only [div_eq_mul_inv] using hb _ ≤ t^(-s)/(1-q) := div_le_div_of_nonneg_right (Real.rpow_le_rpow_of_exponent_le ht1 (by linarith)) (by linarith) _ ≤ C*t^(-s) := by have hp : 0≤r/(r-1)*t^(-s) := by positivity calc _ ≤ r/(r-1)*t^(-s)+t^(-s)/(1-q) := le_add_of_nonneg_left hp _ = C*t^(-s) := by dsimp [C]; ring · have ht_le : t≤1 := le_of_not_ge ht1 have hit : 1≤1/t := (one_le_div ht).mpr ht_le obtain ⟨N,hN,hN'⟩ := exists_nat_pow_near hit (by norm_num : (1:ℝ)<2) have hheadpow : r^(N+1)≤r*t^(-s) := by change ((2:ℝ)^s)^(N+1)≤(2:ℝ)^s*t^(-s) rw [←pow_rpow_comm] calc _ ≤ ((2:ℝ)/t)^s := by apply Real.rpow_le_rpow (by positivity) _ hs.le rw [pow_succ] calc _ ≤ (1/t)*2 := mul_le_mul_of_nonneg_right hN (by norm_num) _ = 2/t := by ring _ = _ := by rw [Real.div_rpow (by norm_num) ht.le,Real.rpow_neg ht.le]; ring have htailpow : t^(-A)*q^(N+1)≤t^(-s) := by change t^(-A)*((2:ℝ)^(s-A))^(N+1)≤t^(-s) rw [←pow_rpow_comm] calc _ ≤ t^(-A)*(1/t)^(s-A) := mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_nonpos (by positivity) hN'.le (by linarith)) (by positivity) _ = t^(-A)*t^(-(s-A)) := by rw [one_div,Real.inv_rpow ht.le,←Real.rpow_neg ht.le] _ = t^(-s) := by rw [←Real.rpow_add ht]; congr 1; ring have hb := kernel_sum_cutoff t s A ht hs hsA (N+1) change (∑'n : ℕ,kernelTerm t s A n)≤r^(N+1)/(r-1)+t^(-A)*q^(N+1)/(1-q) at hb calc _ ≤ r^(N+1)/(r-1)+t^(-A)*q^(N+1)/(1-q) := hb _ ≤ (r*t^(-s))/(r-1)+t^(-s)/(1-q) := add_le_add (div_le_div_of_nonneg_right hheadpow (by linarith)) (div_le_div_of_nonneg_right htailpow (by linarith)) _ = C*t^(-s) := by dsimp [C]; ring end CompletedDyadic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.DyadicKernel namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) private theorem finite_bounded_rows_smoothed_expand {β : Type*} (C : Finset β) (a : β→ℂ) (r : β→O→ℂ) (hr : ∀b∈C,∀z,‖r b z‖≤1) (W : 𝓢(ℝ,ℂ)) (K : ℝ) (hK : 0 (star (r b z)*r c z)*W (‖eisEmbedding z‖^2/K)) := by have hW : Summable (fun z:O=>‖W (‖eisEmbedding z‖^2/K)‖) := by simpa only [EisensteinSchwartzPoisson.scaledRadialTest_apply] using EisensteinSchwartzPoisson.actual_eisenstein_summable_norm (EisensteinSchwartzPoisson.scaledRadialTest W K hK) apply Summable.of_norm apply Summable.of_nonneg_of_le (fun z=>norm_nonneg _) _ hW intro z simp only [norm_mul,norm_star] calc _ ≤ 1*1*‖W (‖eisEmbedding z‖^2/K)‖ := by gcongr · exact hr b hb z · exact hr c hc z _ = _ := by ring have he (z:O) : W (‖eisEmbedding z‖^2/K)*(‖∑b∈C,a b*r b z‖^2:ℝ)= ∑b∈C,∑c∈C,(star (a b)*a c)*((star (r b z)*r c z)*W (‖eisEmbedding z‖^2/K)) := by rw [Complex.sq_norm (∑b∈C,a b*r b z),Complex.normSq_eq_conj_mul_self] simp only [map_sum,map_mul,starRingEnd_apply] rw [Finset.sum_mul_sum] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro b hb apply Finset.sum_congr rfl intro c hc ring simp_rw [he] rw [Summable.tsum_finsetSum (fun b hb=>summable_sum (fun c hc=>(hs b c hb hc).mul_left _))] apply Finset.sum_congr rfl intro b hb rw [Summable.tsum_finsetSum (fun c hc=>(hs b c hb hc).mul_left _)] apply Finset.sum_congr rfl intro c hc exact tsum_mul_left variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) omit [DecidableEq ι] in lemma multiplicityRow_norm_le_one (B : Finset ι) (v : ι→ℕ) (z:O) : ‖multiplicityRow (fun i=>Ideal.span {p i}) hg B v z‖≤1 := by simp only [multiplicityRow,norm_prod,norm_pow] calc _ ≤ ∏i∈B,(1:ℝ) := by apply Finset.prod_le_prod₀ (fun i hi=>by positivity) intro i hi apply pow_le_one₀ (norm_nonneg _) let : Fintype (O⧸Ideal.span {p i}) := Fintype.ofFinite _ exact FiniteRayExpansion.norm_char_le_one _ _ _ = _ := by simp omit [DecidableEq ι] in lemma multiplicityRow_support (B : Finset ι) (v : ι→₀ℕ) (hv : v.support⊆B) (z:O) : multiplicityRow (fun i=>Ideal.span {p i}) hg B v z = multiplicityRow (fun i=>Ideal.span {p i}) hg v.support v z := by unfold multiplicityRow symm apply Finset.prod_subset hv intro i hi hn have hv0 : v i=0 := by simpa only [Finsupp.mem_support_iff,not_not] using hn simp only [hv0,pow_zero] def reopenedCanonicalRow (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (β : (ι→₀ℕ)→ℂ) (Ψ : O→*ℂ) (m f : O) (H : Finset ι→ℂ) (z:O) : ℂ := ∑v∈Q,∑S∈pool.powerset, (β v*canonicalSourceCoefficient p hp hcop hg Ψ m f H S)* (multiplicityRow (fun i=>Ideal.span {p i}) hg pool v z^3* finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S z) theorem reopenedCanonicalRow_smoothed_expand (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (hQ : ∀v∈Q,v.support⊆pool) (β : (ι→₀ℕ)→ℂ) (Ψ : O→*ℂ) (m f : O) (H : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (K : ℝ) (hK : 0β b.1*canonicalSourceCoefficient p hp hcop hg Ψ m f H b.2 let r : (ι→₀ℕ)×Finset ι→O→ℂ := fun b z=> multiplicityRow (fun i=>Ideal.span {p i}) hg pool b.1 z^3* finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg b.2 z have hr (b : (ι→₀ℕ)×Finset ι) (hb:b∈Q×ˢpool.powerset) (z:O) : ‖r b z‖≤1 := by dsimp [r] rw [norm_mul,norm_pow] exact (mul_le_of_le_one_left (norm_nonneg _) (pow_le_one₀ (norm_nonneg _) (multiplicityRow_norm_le_one p hg pool b.1 z))).trans (finiteSquarefreeRow_norm_le_one _ hg _ _) have he:=finite_bounded_rows_smoothed_expand (Q×ˢpool.powerset) a r hr W K hK simp only [Finset.sum_product] at he change (∑'z:O,W (‖eisEmbedding z‖^2/K)* (‖reopenedCanonicalRow p hp hcop hg pool Q β Ψ m f H z‖^2:ℝ))=_ at he rw [he] apply Finset.sum_congr rfl intro v₂ hv₂ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro v₁ hv₁ simp only [canonicalCubeCorrelation,Finset.mul_sum] apply Finset.sum_congr rfl intro S hS apply Finset.sum_congr rfl intro T hT have hB₁ : v₁.support⊆v₁.support∪v₂.support:=Finset.subset_union_left have hB₂ : v₂.support⊆v₁.support∪v₂.support:=Finset.subset_union_right have hr₁ (z:O) : multiplicityRow (fun i=>Ideal.span {p i}) hg pool v₁ z= multiplicityRow (fun i=>Ideal.span {p i}) hg (v₁.support∪v₂.support) v₁ z := by rw [multiplicityRow_support p hg pool v₁ (hQ v₁ hv₁),multiplicityRow_support p hg _ v₁ hB₁] have hr₂ (z:O) : multiplicityRow (fun i=>Ideal.span {p i}) hg pool v₂ z= multiplicityRow (fun i=>Ideal.span {p i}) hg (v₁.support∪v₂.support) v₂ z := by rw [multiplicityRow_support p hg pool v₂ (hQ v₂ hv₂),multiplicityRow_support p hg _ v₂ hB₂] simp only [a,r,canonicalCubeSourcePair,star_mul,hr₁,hr₂] have ht : (∑'z:O,(star (finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S z)* star (multiplicityRow (fun i=>Ideal.span {p i}) hg (v₁.support∪v₂.support) v₂ z^3)* (multiplicityRow (fun i=>Ideal.span {p i}) hg (v₁.support∪v₂.support) v₁ z^3* finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg T z))*W (‖eisEmbedding z‖^2/K))= ∑'z:O,(star (finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S z)* finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg T z* star (multiplicityRow (fun i=>Ideal.span {p i}) hg (v₁.support∪v₂.support) v₂ z^3)* multiplicityRow (fun i=>Ideal.span {p i}) hg (v₁.support∪v₂.support) v₁ z^3)*W (‖eisEmbedding z‖^2/K) := by apply tsum_congr intro z ring rw [ht] ring end SecondPassArithmetic open scoped BigOperators Classical namespace CompletedGauss open ActualEisensteinCubic def completedDualScale (X r C K U B : ℝ) (D E : Ideal O) : ℝ := r^3*(Ideal.absNorm D:ℝ)*(Ideal.absNorm E:ℝ)^3*U*B^3*X/(K^2*C^2) theorem positive_log_scale_identity (k n b K U B R : ℝ) (hk : 0 ((2:ℝ)^b)^β*∑'u : ℕ,kernelTerm (t*((2:ℝ)^b)^3) s A u) ∧ (∑'b : ℕ,((2:ℝ)^b)^β*∑'u : ℕ,kernelTerm (t*((2:ℝ)^b)^3) s A u)≤C*t^(-s) := by obtain ⟨Cu,hCu,hu⟩ := kernel_sum_bound s A hs hsA let q : ℝ := (2:ℝ)^(β-3*s) have hq : q<1 := Real.rpow_lt_one_of_one_lt_of_neg (by norm_num) (by linarith) have hq0 : 0≤q := by dsimp [q]; positivity refine ⟨Cu/(1-q),by positivity,?_⟩ intro t ht have hinner (b : ℕ) := hu (t*((2:ℝ)^b)^3) (by positivity) have hf0 (b : ℕ) : 0≤((2:ℝ)^b)^β*∑'u : ℕ,kernelTerm (t*((2:ℝ)^b)^3) s A u := by apply mul_nonneg (by positivity) exact tsum_nonneg (kernelTerm_nonneg _ s A (by positivity)) have hle (b : ℕ) : ((2:ℝ)^b)^β*∑'u : ℕ,kernelTerm (t*((2:ℝ)^b)^3) s A u≤ (Cu*t^(-s))*q^b := by calc _ ≤ ((2:ℝ)^b)^β*(Cu*(t*((2:ℝ)^b)^3)^(-s)) := mul_le_mul_of_nonneg_left (hinner b).2 (by positivity) _ = Cu*(((2:ℝ)^b)^β*(t*((2:ℝ)^b)^3)^(-s)) := by ring _ = _ := by rw [weighted_scale_identity _ t β s (by positivity) ht,pow_rpow_comm]; dsimp [q]; ring have hgeo := (summable_geometric_of_lt_one hq0 hq).mul_left (Cu*t^(-s)) have hf := hgeo.of_nonneg_of_le hf0 hle refine ⟨fun b => (hinner b).1,hf,?_⟩ have hb := hf.tsum_le_tsum hle hgeo rw [tsum_mul_left,tsum_geometric_of_lt_one hq0 hq] at hb simpa only [div_eq_mul_inv,mul_assoc,mul_left_comm,mul_comm] using hb def ramifiedScale (ρ q : ℝ) (m : ℕ) : ℝ := ρ*q^m theorem ramifiedScale_pos (ρ q : ℝ) (hρ : 0<ρ) (hq : 0 ((2:ℝ)^b)^β* ∑'u : ℕ,kernelTerm (t*(ramifiedScale ρ q m)^3*((2:ℝ)^b)^3) s A u)) ∧ Summable (fun m : ℕ => (ramifiedScale ρ q m)⁻¹* ∑'b : ℕ,((2:ℝ)^b)^β* ∑'u : ℕ,kernelTerm (t*(ramifiedScale ρ q m)^3*((2:ℝ)^b)^3) s A u) ∧ (∑'m : ℕ,(ramifiedScale ρ q m)⁻¹* ∑'b : ℕ,((2:ℝ)^b)^β* ∑'u : ℕ,kernelTerm (t*(ramifiedScale ρ q m)^3*((2:ℝ)^b)^3) s A u) ≤C*t^(-s) := by obtain ⟨Cb,hCb,hb⟩ := double_kernel_sum_bound s A β hs hsA hβ let v : ℝ := q^(-1-3*s) have hv : v<1 := Real.rpow_lt_one_of_one_lt_of_neg hq (by linarith) have hq0 : 0 (hm m).1 b,fun m => (hm m).2.1,hf,?_⟩ have hfinal := hf.tsum_le_tsum hbound hg rw [tsum_mul_left,tsum_geometric_of_lt_one hv0 hv] at hfinal simpa only [div_eq_mul_inv,mul_assoc,mul_left_comm,mul_comm] using hfinal def normMajorant (deltaLoss A K t r H U B : ℝ) : ℝ := K^deltaLoss/(r*Real.sqrt H)* (Real.sqrt K*B^(deltaLoss-1/2)*U^deltaLoss+B^deltaLoss*U^(deltaLoss+1/2))/(1+t*r^3*B^3*U)^A theorem normMajorant_nonneg (deltaLoss A K t r H U B : ℝ) (hK : 0 tripleTerm t s A β ρ q (m,j)) := by apply (summable_prod_of_nonneg (fun j => hpos (m,j))).mpr constructor · intro b simpa only [tripleTerm] using (hu m b).mul_left ((ramifiedScale ρ q m)⁻¹*((2:ℝ)^b)^β) · simpa only [tripleTerm,tsum_mul_left,mul_assoc] using (hb m).mul_left (ramifiedScale ρ q m)⁻¹ have hrow (m : ℕ) : (∑'j : ℕ×ℕ,tripleTerm t s A β ρ q (m,j))= (ramifiedScale ρ q m)⁻¹*∑'b : ℕ,((2:ℝ)^b)^β* ∑'u : ℕ,kernelTerm (t*(ramifiedScale ρ q m)^3*((2:ℝ)^b)^3) s A u := by rw [(hinner m).tsum_prod] simp only [tripleTerm,tsum_mul_left,mul_assoc] have hall : Summable (tripleTerm t s A β ρ q) := by apply (summable_prod_of_nonneg hpos).mpr exact ⟨hinner,by simpa only [hrow] using hm⟩ refine ⟨hall,?_⟩ simpa only [hall.tsum_prod,hrow] using hbnd theorem normMajorant_eq_triples (deltaLoss A K t H ρ q : ℝ) (i : ℕ×ℕ×ℕ) : normMajorant deltaLoss A K t (ramifiedScale ρ q i.1) H ((2:ℝ)^i.2.2) ((2:ℝ)^i.2.1)= K^deltaLoss/Real.sqrt H*(Real.sqrt K*tripleTerm t deltaLoss A (deltaLoss-1/2) ρ q i+ tripleTerm t (deltaLoss+1/2) A deltaLoss ρ q i) := by simp only [normMajorant,tripleTerm,kernelTerm] ring theorem normMajorant_sum_bound (deltaLoss A ρ q : ℝ) (hδ : 0 normMajorant deltaLoss A K Y⁻¹ (ramifiedScale ρ q i.1) H ((2:ℝ)^i.2.2) ((2:ℝ)^i.2.1)) ∧ (∑'i : ℕ×ℕ×ℕ, normMajorant deltaLoss A K Y⁻¹ (ramifiedScale ρ q i.1) H ((2:ℝ)^i.2.2) ((2:ℝ)^i.2.1)) ≤C*(K*Y)^deltaLoss*(Real.sqrt K+Real.sqrt Y)/Real.sqrt H := by obtain ⟨C₁,hC₁,h₁⟩ := triple_product_kernel_sum_bound deltaLoss A (deltaLoss-1/2) ρ q hδ (by linarith) (by linarith) hρ hq obtain ⟨C₂,hC₂,h₂⟩ := triple_product_kernel_sum_bound (deltaLoss+1/2) A deltaLoss ρ q (by linarith) hA (by linarith) hρ hq refine ⟨C₁+C₂,by positivity,?_⟩ intro K Y H hK hY hH obtain ⟨hs₁,hb₁⟩ := h₁ Y⁻¹ (by positivity) obtain ⟨hs₂,hb₂⟩ := h₂ Y⁻¹ (by positivity) simp_rw [normMajorant_eq_triples] refine ⟨((hs₁.mul_left (Real.sqrt K)).add hs₂).mul_left (K^deltaLoss/Real.sqrt H),?_⟩ rw [tsum_mul_left,(hs₁.mul_left (Real.sqrt K)).tsum_add hs₂,tsum_mul_left] have hp₁ : (Y⁻¹)^(-deltaLoss)=Y^deltaLoss := by rw [Real.inv_rpow hY.le,Real.rpow_neg hY.le,inv_inv] have hp₂ : (Y⁻¹)^(-(deltaLoss+1/2))=Y^deltaLoss*Real.sqrt Y := by rw [Real.inv_rpow hY.le,Real.rpow_neg hY.le,inv_inv,Real.rpow_add hY,←Real.sqrt_eq_rpow] rw [hp₁] at hb₁ rw [hp₂] at hb₂ calc _ ≤ K^deltaLoss/Real.sqrt H*(Real.sqrt K*(C₁*Y^deltaLoss)+C₂*(Y^deltaLoss*Real.sqrt Y)) := by apply mul_le_mul_of_nonneg_left _ (by positivity) exact add_le_add (mul_le_mul_of_nonneg_left hb₁ (Real.sqrt_nonneg _)) hb₂ _ ≤ K^deltaLoss/Real.sqrt H*((C₁+C₂)*Y^deltaLoss*(Real.sqrt K+Real.sqrt Y)) := by apply mul_le_mul_of_nonneg_left _ (by positivity) nlinarith [mul_nonneg (le_of_lt hC₁) (show 0≤Y^deltaLoss*Real.sqrt Y by positivity), mul_nonneg (le_of_lt hC₂) (show 0≤Y^deltaLoss*Real.sqrt K by positivity)] _ = _ := by rw [Real.mul_rpow hK.le hY.le]; ring end CompletedDyadic namespace CompletedGauss theorem finite_tsum_energy_bound {κ α : Type*} [Fintype κ] (f : α→κ→ℂ) (g : α→ℝ) (hg0 : ∀i,0≤g i) (hg : Summable g) (hbound : ∀i,(∑k,‖f i k‖^2)≤(g i)^2) : (∀k,Summable (fun i => ‖f i k‖)) ∧ (∑k,‖∑'i,f i k‖^2)≤(∑'i,g i)^2 := by let e := PiLp.continuousLinearEquiv 2 ℂ (fun _ : κ => ℂ) let F : α→EuclideanSpace ℂ κ := fun i => e.symm (f i) have hF (i : α) : ‖F i‖≤g i := by apply (sq_le_sq₀ (norm_nonneg _) (hg0 i)).mp rw [EuclideanSpace.norm_sq_eq] exact hbound i have hpoint (k : κ) (i : α) : ‖f i k‖≤g i := by apply (sq_le_sq₀ (norm_nonneg _) (hg0 i)).mp exact (Finset.single_le_sum (fun j _ => sq_nonneg ‖f i j‖) (Finset.mem_univ k)).trans (hbound i) have hsum (k : κ) : Summable (fun i => ‖f i k‖) := hg.of_nonneg_of_le (fun i => norm_nonneg _) (hpoint k) have hfp : Summable f := Pi.summable.mpr (fun k => (hsum k).of_norm) have he : (∑'i,F i)=e.symm (fun k => ∑'i,f i k) := by rw [show (fun i => F i)=(fun i => e.symm (f i)) from rfl,←e.symm.map_tsum] congr 1 funext k exact Pi.tsum_apply hfp have hn : ‖e.symm (fun k => ∑'i,f i k)‖≤∑'i,g i := by rw [←he] exact tsum_of_norm_bounded hg.hasSum hF refine ⟨hsum,?_⟩ have hs := pow_le_pow_left₀ (norm_nonneg _) hn 2 rw [EuclideanSpace.norm_sq_eq] at hs exact hs open ActualEisensteinCubic CanonicalQuadraticSieve CompletedDyadic def completedSmoothDyadicBlock (V₀ V₁ V₂ W : ℝ→ℂ) (K Y ρ q : ℝ) (S T : (ℕ×ℕ×ℕ)→Finset (Ideal O)) (β : (ℕ×ℕ×ℕ)→Ideal O→Ideal O→ℂ) (i : ℕ×ℕ×ℕ) (k : idealRange K) : ℂ := ∑n∈S i,∑v∈T i,quadraticRow k.val (primaryGenerator (n*v))*β i n v* (V₀ (Real.log ((Ideal.absNorm k.val:ℝ)/K))* V₁ (Real.log ((Ideal.absNorm n:ℝ)/(2:ℝ)^i.2.2))* V₂ (Real.log ((Ideal.absNorm v:ℝ)/(2:ℝ)^i.2.1))* CubicReflectionKernel.paperKernel (Vstar W) ((Y⁻¹*(ramifiedScale ρ q i.1)^3*((2:ℝ)^i.2.1)^3*(2:ℝ)^i.2.2)* Real.exp (-2*Real.log ((Ideal.absNorm k.val:ℝ)/K)+ Real.log ((Ideal.absNorm n:ℝ)/(2:ℝ)^i.2.2)+ 3*Real.log ((Ideal.absNorm v:ℝ)/(2:ℝ)^i.2.1)))) end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.ReflectedDyadicSeries namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators namespace InitialMeanSquare open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff section open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog firstLogDensity) open ConcreteTraceCRT (eisEmbedding) lemma star_normalizedColumn {ι : Type*} (p : ι → O) (g : 𝓢(ℝ,ℂ)) (Z : ℝ) (S : Finset ι) : star (normalizedColumn p (fun T => g (columnLog p Z T)) S) = normalizedColumn p (fun T => conjugateProfile g (columnLog p Z T)) S := by simp only [normalizedColumn, conjugateProfile_apply] simp lemma conjugateProfile_support_bound (g : 𝓢(ℝ,ℂ)) (A : ℝ) (hg : ∀ t, g t ≠ 0 → |t| ≤ A) : ∀ t, conjugateProfile g t ≠ 0 → |t| ≤ A := by intro t ht apply hg t intro hz apply ht simp only [conjugateProfile_apply, hz, star_zero] variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) theorem initial_nonzero_source_eq_bins (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda^2 ∣ p i-1) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (Z H M Kmax : ℝ) (hZ : 0 < Z) (hgM : ∀ t, g t ≠ 0 → |t| ≤ M) (K : Finset ι → Finset ι → Finset O) (hK : ∀ R ∈ F.powerset, ∀ x ∈ secondSupportedSector p F K R Z M, elementNorm (sourceObservation p x).1 ≤ Kmax) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype let G := fun S => normalizedColumn p (fun T => g (columnLog p Z T)) S truncatedSecondSource p hp hg hinj F Ψ m 1 1 G W H (fun C E => (K C E).erase 0) = ∑ ray : SecondRayIndex, ∑ R ∈ boundedPrimeSupports p F (Z*Real.exp M), ∑ j ∈ secondLogBinBox (Z*Real.exp M) Kmax, secondExpansionSource p hp hcop hg F Ψ m 1 1 ray (secondLogSector p ∅ F K R Z M j) G G W H := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype dsimp only have hrow : ∀ R ∈ F.powerset, ∀ x ∈ secondSupportedSector p F K R Z M, ‖eisEmbedding (actualSecondRow p ∅ x.divisor x.frequency)‖^2 ≤ Kmax := by intro R hR x hx simpa only [initial_actual_row_norm] using hK R hR x hx have hfull := truncatedSecondSource_eq_binned p hp hcop hg hinj hc hpr ∅ F Ψ m 1 1 g W Z H M Kmax hZ hgM K hrow have hsplit := truncatedSecondSource_eq_nonzero_add_zero p hp hg hinj F Ψ m 1 1 (fun S => normalizedColumn p (fun T => g (columnLog p Z T)) S) W H K dsimp only at hfull rw [hsplit] at hfull exact add_left_cancel (by simpa only [add_comm] using hfull) theorem initial_nonzero_source_norm_le_bins (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda^2 ∣ p i-1) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (Z H M Kmax : ℝ) (hZ : 0 < Z) (hgM : ∀ t, g t ≠ 0 → |t| ≤ M) (K : Finset ι → Finset ι → Finset O) (hK : ∀ R ∈ F.powerset, ∀ x ∈ secondSupportedSector p F K R Z M, elementNorm (sourceObservation p x).1 ≤ Kmax) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype let G := fun S => normalizedColumn p (fun T => g (columnLog p Z T)) S ‖truncatedSecondSource p hp hg hinj F Ψ m 1 1 G W H (fun C E => (K C E).erase 0)‖ ≤ ∑ ray : SecondRayIndex, ∑ R ∈ boundedPrimeSupports p F (Z*Real.exp M), ∑ j ∈ secondLogBinBox (Z*Real.exp M) Kmax, ‖secondExpansionSource p hp hcop hg F Ψ m 1 1 ray (secondLogSector p ∅ F K R Z M j) G G W H‖ := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype dsimp only rw [initial_nonzero_source_eq_bins p hp hcop hg hinj hc hpr F Ψ m g W Z H M Kmax hZ hgM K hK] apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro ray hray apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro R hR exact norm_sum_le _ _ end open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog firstLogDensity) def initialBinCost {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F R : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (K : Finset ι → Finset ι → Finset O) (Z H M ε : ℝ) (j : SecondLogIndex) (windows : Fin 7 → ℝ → ℂ) (B : Frequency → ℝ) : ℝ := let s := secondLogSector p ∅ F K R Z M j let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R (H*primeProductNorm p R/Z^2*‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε)* (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, B (t₁,t₂,t₃)* sourceGeometricMean p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) (windows 5) (windows 6) X X (t₁,t₂,t₃)) end InitialMeanSquare open scoped BigOperators Classical SchwartzMap ContDiff namespace CompletedGauss section open ActualEisensteinCubic CanonicalQuadraticSieve CompletedDyadic end open ActualEisensteinCubic theorem completed_fiber_scalar_cost (deltaLoss K X a t Q c D S E : ℝ) (hδ : 0≤deltaLoss) (hK : 1≤K) (hX : 1≤X) (ha : 1≤a) (ht : 1≤t) (hQ : 1≤Q) (hc0 : 0 first | rfl | field_simp calc _ = (k*y)^(2*deltaLoss)*((k+y)/(S*E)) := by ring _ ≤ (K*Q)^(10*deltaLoss)*((K+K^2*Q/X)/a) := mul_le_mul hp hshape (by positivity) (by positivity) _ = _ := by ring theorem completed_conductor_norm_bound {ι : Type*} [Fintype ι] (I Q : Ideal O) (hI : I≠0) (hQ : Q≠0) (P : ι→Ideal O) (hcop : Pairwise (fun i j => IsCoprime (P i) (P j))) (hpool : ∀i,P i∣I*Q) : (Ideal.absNorm (∏i,P i):ℝ)≤(Ideal.absNorm I:ℝ)*(Ideal.absNorm Q:ℝ) := by have hd : (∏i,P i)∣I*Q := Fintype.prod_dvd_of_coprime hcop hpool have hn : 0 mul_ne_zero hI hQ (Ideal.absNorm_eq_zero_iff.mp hz)) have hh := Nat.le_of_dvd hn (map_dvd Ideal.absNorm hd) exact_mod_cast (by simpa only [map_mul] using hh) theorem completed_actual_fiber_cost {ι : Type*} [Fintype ι] (deltaLoss K X : ℝ) (hδ : 0≤deltaLoss) (hK : 1≤K) (hX : 1≤X) (I F Q : Ideal O) (hI : I≠0) (hQ : Q≠0) (hIK : (Ideal.absNorm I:ℝ)≤K) (P : ι→Ideal O) [∀i,(P i).IsMaximal] (hcop : Pairwise (fun i j => IsCoprime (P i) (P j))) (hpool : ∀i,P i∣I*Q) (hres : ∀i,¬P i∣rowResidualPart I Q) (e : ι→Fin 3) : let j := fun i => completedLocalExponent I F (P i) let k := K/((Ideal.absNorm (rowPowerfulPart I):ℝ)*(Ideal.absNorm (rowMaskPart I Q):ℝ)) let D := (Ideal.absNorm (reflectionExtractedDivisor P j e 1):ℝ) let S := (Ideal.absNorm (reflectionExtractedDivisor P j e 0):ℝ) let E := (Ideal.absNorm (reflectionExtractedDivisor P j e 2):ℝ) let y := k^2*(Ideal.absNorm (∏i,P i):ℝ)^2/(X*D*E^3) (k*y)^(2*deltaLoss)*(k+y)/(S*E)≤ (K*(Ideal.absNorm Q:ℝ))^(10*deltaLoss)*(K+K^2*(Ideal.absNorm Q:ℝ)/X)/ (Ideal.absNorm (rowPowerfulPart I):ℝ) := by have hn (J : Ideal O) (hJ : J≠0) : 1≤(Ideal.absNorm J:ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => hJ (Ideal.absNorm_eq_zero_iff.mp hz)) have hprod : (∏i,P i)≠0 := Finset.prod_ne_zero_iff.mpr (fun i _ => NeZero.ne (P i)) have hc := (completed_conductor_norm_bound I Q hI hQ P hcop hpool).trans (mul_le_mul_of_nonneg_right hIK (Nat.cast_nonneg _)) have hh := completed_fiber_scalar_cost deltaLoss K X (Ideal.absNorm (rowPowerfulPart I):ℝ) (Ideal.absNorm (rowMaskPart I Q):ℝ) (Ideal.absNorm Q:ℝ) (Ideal.absNorm (∏i,P i):ℝ) (Ideal.absNorm (reflectionExtractedDivisor P (fun i => completedLocalExponent I F (P i)) e 1):ℝ) (Ideal.absNorm (reflectionExtractedDivisor P (fun i => completedLocalExponent I F (P i)) e 0):ℝ) (Ideal.absNorm (reflectionExtractedDivisor P (fun i => completedLocalExponent I F (P i)) e 2):ℝ) hδ hK hX (hn _ (rowPowerfulPart_ne_zero I)) (hn _ (squarefreeMaskPart_ne_zero (rowSimplePart I) Q)) (hn _ hQ) (lt_of_lt_of_le (by norm_num) (hn _ hprod)) hc (hn _ (reflectionExtractedDivisor_ne_zero P (fun i => NeZero.ne (P i)) _ e 1)) (hn _ (reflectionExtractedDivisor_ne_zero P (fun i => NeZero.ne (P i)) _ e 0)) (hn _ (reflectionExtractedDivisor_ne_zero P (fun i => NeZero.ne (P i)) _ e 2)) (reflectionConductorCost_bound I F Q hI hQ P hcop hpool hres e) exact hh def completedShellWindow (x : ℝ) : ℂ := if -Real.log 2≤x ∧ x≤0 then 1 else 0 theorem completedShellWindow_support (x : ℝ) (h : completedShellWindow x≠0) : |x|≤Real.log 2 := by have hx : -Real.log 2≤x ∧ x≤0 := by by_contra hn exact h (by simp [completedShellWindow,hn]) apply abs_le.mpr exact ⟨hx.1,hx.2.trans (Real.log_nonneg (by norm_num))⟩ theorem completedShellWindow_norm (x : ℝ) : ‖completedShellWindow x‖≤1 := by unfold completedShellWindow split_ifs <;> simp theorem completedShellWindow_log (x U : ℝ) (hx : 0 hJ (Ideal.absNorm_eq_zero_iff.mp hz)) have hDn := hnorm D (reflectionExtractedDivisor_ne_zero P (fun i => NeZero.ne (P i)) j e 1) have hEn := hnorm E (reflectionExtractedDivisor_ne_zero P (fun i => NeZero.ne (P i)) j e 2) have hSn := hnorm S (reflectionExtractedDivisor_ne_zero P (fun i => NeZero.ne (P i)) j e 0) have hnn := hnorm n hn have hvn := hnorm v hv have hlocal := reflectedBranch_normalized_bound P hg j e (primaryGenerator (D*n)) (primaryGenerator (E*v)) (Ideal.absNorm n:ℝ) (Ideal.absNorm v:ℝ) hnn hvn change ‖reflectedBranch P hg j e (primaryGenerator (D*n)) (primaryGenerator (E*v))‖ / (Real.sqrt ((Ideal.absNorm D:ℝ)*(Ideal.absNorm n:ℝ))* ((Ideal.absNorm E:ℝ)*(Ideal.absNorm v:ℝ)))≤ 1/(Real.sqrt (Ideal.absNorm n:ℝ)*(Ideal.absNorm v:ℝ)* Real.sqrt ((Ideal.absNorm S:ℝ)*(Ideal.absNorm E:ℝ))) at hlocal have hbase : 0 reflectedDyadicCoefficient P hg j e (η v) (ramifiedScale ρ q v.1)) i k end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.BranchScaling namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap ContDiff namespace CompletedGauss open ActualEisensteinCubic CanonicalQuadraticSieve CompletedDyadic def completedResidualScale (K : ℝ) (I Q : Ideal O) : ℝ := K/((Ideal.absNorm (rowPowerfulPart I):ℝ)*(Ideal.absNorm (rowMaskPart I Q):ℝ)) def completedBranchScale {ι : Type*} [Fintype ι] (K X : ℝ) (I F Q : Ideal O) (P : ι→Ideal O) (e : ι→Fin 3) : ℝ := (completedResidualScale K I Q)^2*(Ideal.absNorm (∏i,P i):ℝ)^2/ (X*(Ideal.absNorm (reflectionExtractedDivisor P (fun i => completedLocalExponent I F (P i)) e 1):ℝ)* (Ideal.absNorm (reflectionExtractedDivisor P (fun i => completedLocalExponent I F (P i)) e 2):ℝ)^3) end CompletedGauss open scoped BigOperators Classical namespace LocalReflectionBrackets variable {F : Type*} [Field F] [Fintype F] def unitArgumentFactor (χ : MulChar F ℂ) (j : ℕ) (z : F) : ℂ := if j=4 then 1 else (χ^(j+2))⁻¹ z theorem bracket_mul_unit (χ : MulChar F ℂ) (j : ℕ) (z x : F) (hz : z≠0) : bracket χ j (z*x)=unitArgumentFactor χ j z*bracket χ j x := by by_cases hj4 : j=4 · simp [unitArgumentFactor,bracket,hj4,hz] · by_cases hj0 : j=0 · subst j simp only [unitArgumentFactor,bracket,show (0:ℕ)≠4 by decide,ite_false,ite_true, zero_add,map_mul] ring · simp only [unitArgumentFactor,bracket,if_neg hj4,if_neg hj0,map_mul] theorem unitArgumentFactor_norm (χ : MulChar F ℂ) (j : ℕ) (z : F) (hz : z≠0) : ‖unitArgumentFactor χ j z‖=1 := by by_cases hj : j=4 · simp [unitArgumentFactor,hj] · rw [unitArgumentFactor,if_neg hj] exact FiniteRayExpansion.norm_char_unit ((χ^(j+2))⁻¹) (Units.mk0 z hz) end LocalReflectionBrackets namespace CompletedGauss open ActualEisensteinCubic LocalReflectionBrackets theorem unit_ramified_quotient_ne_zero (P : Ideal O) [P.IsMaximal] (hg : lambda∉P) (u : Oˣ) (m : ℕ) : Ideal.Quotient.mk P ((u:O)*lambda^m)≠0 := by rw [map_mul,map_pow] apply mul_ne_zero · exact (u.isUnit.map (Ideal.Quotient.mk P)).ne_zero · exact pow_ne_zero _ (fun h => hg (Ideal.Quotient.eq_zero_iff_mem.mp h)) def ramifiedBranchPhase {ι : Type*} [Fintype ι] (P : ι→Ideal O) [∀i,(P i).IsMaximal] (hg : ∀i,lambda∉P i) (j : ι→ℕ) (u : Oˣ) (m : ℕ) : ℂ := let : ∀ i, Field (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientField (P i) ∏i,unitArgumentFactor (actualSextic (P i) (hg i)) (j i) (Ideal.Quotient.mk (P i) ((u:O)*lambda^m)) theorem ramifiedBranchPhase_norm {ι : Type*} [Fintype ι] (P : ι→Ideal O) [∀i,(P i).IsMaximal] (hg : ∀i,lambda∉P i) (j : ι→ℕ) (u : Oˣ) (m : ℕ) : ‖ramifiedBranchPhase P hg j u m‖=1 := by let : ∀ i, Field (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientField (P i) let : ∀ i, Fintype (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) rw [ramifiedBranchPhase,norm_prod] have hh (i : ι) := unitArgumentFactor_norm (actualSextic (P i) (hg i)) (j i) _ (unit_ramified_quotient_ne_zero (P i) (hg i) u m) simp only [hh,Finset.prod_const_one] theorem ramified_bracket_full_expansion {ι : Type*} [Fintype ι] (P : ι→Ideal O) [∀i,(P i).IsMaximal] (hg : ∀i,lambda∉P i) (j : ι→ℕ) (u : Oˣ) (m : ℕ) (n b : O) : let : ∀ i, Field (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientField (P i) let : ∀ i, Fintype (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) (∏i,bracket (actualSextic (P i) (hg i)) (j i) (Ideal.Quotient.mk (P i) ((u:O)*lambda^m*(n*b^3))))= ramifiedBranchPhase P hg j u m*∑e : ι→Fin 3,reflectedBranch P hg j e n b := by let : ∀ i, Field (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientField (P i) let : ∀ i, Fintype (O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) dsimp only have hl (i : ι) : bracket (actualSextic (P i) (hg i)) (j i) (Ideal.Quotient.mk (P i) ((u:O)*lambda^m*(n*b^3)))= unitArgumentFactor (actualSextic (P i) (hg i)) (j i) (Ideal.Quotient.mk (P i) ((u:O)*lambda^m))* bracket (actualSextic (P i) (hg i)) (j i) (Ideal.Quotient.mk (P i) (n*b^3)) := by rw [map_mul] exact bracket_mul_unit _ _ _ _ (unit_ramified_quotient_ne_zero (P i) (hg i) u m) simp_rw [hl] rw [Finset.prod_mul_distrib,prod_bracket_eq_full_branches P hg j n b] rfl end CompletedGauss namespace InitialMeanSquare open MeasureTheory open scoped BigOperators Classical section open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open ConcretePrimeRowBridge (idealGenerator) noncomputable abbrev instFintypeUnitsO : Fintype Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units def sourceLabelUnit (f : O) : Oˣ := Classical.choose (exists_label_unit f (Ideal.span {f}) rfl) lemma sourceLabelUnit_spec (f : O) : f=(sourceLabelUnit f : O)*idealGenerator (Ideal.span {f}) := Classical.choose_spec (exists_label_unit f (Ideal.span {f}) rfl) def sourceIdealPoint (z : O × O) : Ideal O × O := (Ideal.span {z.2},z.1) def sourceUnitPoint (z : O × O) : Oˣ × (Ideal O × O) := (sourceLabelUnit z.2,sourceIdealPoint z) lemma sourceUnitPoint_injective : Function.Injective sourceUnitPoint := by intro x y h have hu : sourceLabelUnit x.2=sourceLabelUnit y.2 := congrArg Prod.fst h have hi : Ideal.span {x.2}=Ideal.span {y.2} := congrArg (fun z => z.2.1) h have hr : x.1=y.1 := congrArg (fun z => z.2.2) h apply Prod.ext hr rw [sourceLabelUnit_spec x.2,sourceLabelUnit_spec y.2,hu,hi] def sourceIdealTarget (T : Finset (O × O)) : Finset (Ideal O × O) := T.image sourceIdealPoint section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem sourceChildEnergy_le_ideal (F : Finset ι) (Ψ : O →* ℂ) (m : O) (T : Finset (O × O)) (V : ℝ → ℂ) (X : ℝ) (tn rn : Bool) (a b : ℝ) : sourceChildEnergy p hp hcop hg F Ψ m T V X tn rn a b ≤ childEnergy p hp hcop hg F Ψ m (sourceIdealTarget T) V X tn rn a b := by letI := OAI.InitialMeanSquare.instFintypeUnitsO exact ( by let E : Oˣ × (Ideal O × O) → ℝ := fun z => ‖idealChildRow p hp hcop hg F Ψ m (fixedSecondTest p V X a b tn) rn z.1 z.2‖^2 have hsub : T.image sourceUnitPoint ⊆ Finset.univ ×ˢ sourceIdealTarget T := by intro z hz obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hz exact Finset.mem_product.mpr ⟨Finset.mem_univ _,Finset.mem_image.mpr ⟨x,hx,rfl⟩⟩ calc _ = ∑ z ∈ T.image sourceUnitPoint,E z := by rw [Finset.sum_image (fun x _ y _ h => sourceUnitPoint_injective h)] apply Finset.sum_congr rfl intro z hz simp only [E,sourceUnitPoint,sourceIdealPoint,idealChildRow] rw [←sourceLabelUnit_spec] _ ≤ ∑ z ∈ Finset.univ ×ˢ sourceIdealTarget T,E z := by apply Finset.sum_le_sum_of_subset_of_nonneg hsub intro z hz hn exact sq_nonneg _ _ = _ := by rw [Finset.sum_product]; rfl ) theorem sourceGeometricMean_le_ideal (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (T : Finset (O × O)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ : ℝ) (q : Frequency) : sourceGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ q ≤ childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m (sourceIdealTarget T) V₁ V₂ X₁ X₂ q := by apply mul_le_mul (Real.sqrt_le_sqrt (sourceChildEnergy_le_ideal p hp hcop hg F Ψ₁ m T V₁ X₁ true false q.1 q.2.2)) (Real.sqrt_le_sqrt (sourceChildEnergy_le_ideal p hp hcop hg F Ψ₂ m T V₂ X₂ false true q.2.1 q.2.2)) (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) end theorem sourceIdealTarget_bounds (T : Finset (O × O)) (K lengthScale : ℝ) (hT : ∀ z ∈ T, z.2 ≠ 0 ∧ elementNorm z.2 ≤ lengthScale ∧ elementNorm z.1 ≤ K) : ∀ z ∈ sourceIdealTarget T, z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ lengthScale ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ K := by intro z hz obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hz obtain ⟨hne,hn,hk⟩ := hT x hx refine ⟨Ideal.span_singleton_eq_bot.not.mpr hne,?_,hk⟩ simpa only [sourceIdealPoint,elementNorm,eisEmbedding_norm_sq_eq_absNorm_span] using hn end open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels theorem positive_nested_density_bound (f : Frequency → ℝ) (C : ℝ) (hf : ∀ q, 0 ≤ f q) (hbound : ∀ q, f q ≤ C*firstLogDensity 0 q.1*firstLogDensity 0 q.2.1*firstLogDensity 0 q.2.2) : (∫ x : ℝ, ∫ y : ℝ, ∫ z : ℝ, f (x,y,z)) ≤ C*(∫ t : ℝ,firstLogDensity 0 t)^3 := by let I := ∫ t : ℝ,firstLogDensity 0 t have hz (x y : ℝ) : (∫ z : ℝ,f (x,y,z)) ≤ C*firstLogDensity 0 x*firstLogDensity 0 y*I := by have h := integral_mono_of_nonneg (Filter.Eventually.of_forall (fun z : ℝ => hf (x,y,z))) ((firstLogDensity_integrable 0).const_mul (C*firstLogDensity 0 x*firstLogDensity 0 y)) (Filter.Eventually.of_forall (fun z : ℝ => hbound (x,y,z))) simpa only [integral_const_mul,I] using h have hy (x : ℝ) : (∫ y : ℝ, ∫ z : ℝ,f (x,y,z)) ≤ C*firstLogDensity 0 x*I*I := by have h := integral_mono_of_nonneg (Filter.Eventually.of_forall (fun y : ℝ => integral_nonneg (fun z : ℝ => hf (x,y,z)))) (((firstLogDensity_integrable 0).const_mul (C*firstLogDensity 0 x)).mul_const I) (Filter.Eventually.of_forall (hz x)) simpa only [integral_mul_const,integral_const_mul,I] using h have h := integral_mono_of_nonneg (Filter.Eventually.of_forall (fun x : ℝ => integral_nonneg (fun y : ℝ => integral_nonneg (fun z : ℝ => hf (x,y,z))))) ((((firstLogDensity_integrable 0).const_mul C).mul_const I).mul_const I) (Filter.Eventually.of_forall hy) simp only [integral_mul_const,integral_const_mul] at h convert h using 1 <;> first | rfl | ((try dsimp [I]); ring) theorem polynomial_density_cost (B G : Frequency → ℝ) (J : ℕ) (S C E : ℝ) (hS : 0 < S) (hC : 0 ≤ C) (_hE : 0 ≤ E) (hB : ∀ q, 0 ≤ B q) (hG : ∀ q, 0 ≤ G q) (hdec : ∀ q, S*B q ≤ C*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2) (henergy : ∀ q, G q ≤ E*(1+‖q.1‖)^J*(1+‖q.2.1‖)^J*(1+‖q.2.2‖)^J) : (∫ x : ℝ, ∫ y : ℝ, ∫ z : ℝ,B (x,y,z)*G (x,y,z)) ≤ (C*E/S)*(∫ t : ℝ,firstLogDensity 0 t)^3 := by apply positive_nested_density_bound _ (C*E/S) (fun q => mul_nonneg (hB q) (hG q)) intro q have hc : 0 ≤ C*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2 := by exact mul_nonneg (mul_nonneg (mul_nonneg hC (firstLogDensity_nonneg _ _)) (firstLogDensity_nonneg _ _)) (firstLogDensity_nonneg _ _) have hb := mul_le_mul (hdec q) (henergy q) (hG q) hc have heq : (C*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2)* (E*(1+‖q.1‖)^J*(1+‖q.2.1‖)^J*(1+‖q.2.2‖)^J) = C*E*firstLogDensity 0 q.1*firstLogDensity 0 q.2.1*firstLogDensity 0 q.2.2 := by rw [←density_weight_identity J q.1,←density_weight_identity J q.2.1, ←density_weight_identity J q.2.2] ring rw [heq] at hb calc _ ≤ (C*E*firstLogDensity 0 q.1*firstLogDensity 0 q.2.1*firstLogDensity 0 q.2.2)/S := by apply (le_div_iff₀ hS).mpr convert hb using 1 ; ring _ = _ := by ring end InitialMeanSquare open scoped BigOperators Classical SchwartzMap namespace FirstPassCubeLabels section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) omit [DecidableEq ι] in lemma blockRow_mul (S : Finset ι) (e : ι→ℕ) (a b:O) : blockRow p hg S e (a*b)=blockRow p hg S e a*blockRow p hg S e b := by simp only [blockRow_eq_product,map_mul,Finset.prod_mul_distrib] omit [DecidableEq ι] in lemma blockRow_unit_mul_star (S : Finset ι) (e : ι→ℕ) (u:Oˣ) : blockRow p hg S e (u:O)*star (blockRow p hg S e (u:O))=1 := by exact GaussGeneratorTransport.finiteSexticRow_unit_mul_star (fun i:S=>Ideal.span {p i.val}) (fun i=>hg i.val) (fun i=>e i.val) u omit [DecidableEq ι] in lemma originalLabelColumn_unit_c (B : Finset ι) (ε₁ ε₂ : ι→Bool) (negative : Bool) (C : Finset ι→ℂ) (u c f : O) (S : Finset ι) : originalLabelColumn p hg B ε₁ ε₂ negative C (u*c) f S = originalLabelColumn p hg B ε₁ ε₂ negative C c f S* finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S u^4 := by simp only [originalLabelColumn,finiteSquarefreeRow_mul,mul_pow] ring omit [DecidableEq ι] in lemma row_four_eq_star_square (S : Finset ι) (u:O) : finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S u^4= star (finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S (u^2)) := by have h1 : finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S 1=1 := by simp [finiteSquarefreeRow] simpa only [h1,star_one,mul_one,one_mul] using row_four_star (fun i=>Ideal.span {p i}) hg S u 1 theorem threeGaussRowFactor_common_unit (N P B : Finset ι) (hNP:Disjoint N P) (hNB:Disjoint N B) (hPB:Disjoint P B) (v:ι→ℕ) (ε₁ ε₂:ι→Bool) (C₁ C₂:Finset ι→ℂ) (u:Oˣ) (c f d h:O) : threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ (originalLabelColumn p hg B ε₁ ε₂ true C₁ ((u:O)*c) f) (originalLabelColumn p hg B ε₁ ε₂ false C₂ ((u:O)*c) f) d h = blockRow p hg (cubeActiveSupport B v ε₁ ε₂) (fun i=>(conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val) ((u:O)^2)* threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ (originalLabelColumn p hg B ε₁ ε₂ true C₁ c f) (originalLabelColumn p hg B ε₁ ε₂ false C₂ c f) d ((u:O)^2*h) := by have hU:=blockRow_unit_mul_star p hg (cubeActiveSupport B v ε₁ ε₂) (fun i=>(conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val) (u^2) simp only [Units.val_pow_eq_pow_val] at hU simp only [threeGaussRowFactor,originalLabelColumn_unit_c,row_four_eq_star_square, star_mul,star_star,blockRow_mul] rw [threeBlockRow_factor p hg N P B hNP hNB hPB v ε₁ ε₂ ((u:O)^2)] simp only [star_mul,star_star] let a : ℂ := threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ (originalLabelColumn p hg B ε₁ ε₂ true C₁ c f) (originalLabelColumn p hg B ε₁ ε₂ false C₂ c f) d h * finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg N ((u:O)^2) * star (finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg P ((u:O)^2)) convert congrArg (fun z:ℂ=>a*z) hU.symm using 1 <;> simp only [a,threeGaussRowFactor,star_mul] <;> ring theorem actualFirstKernel_common_unit (F B : Finset ι) (hFB:Disjoint F B) (v:ι→ℕ) (ε₁ ε₂:ι→Bool) (C₁ C₂:Finset ι→ℂ) (W:𝓢(ℝ,ℂ)) (V₁ V₂:ℝ→ℂ) (X₁ X₂ K:ℝ) (u:Oˣ) (c f d h:O) : actualFirstKernel p hp hcop hg F B v ε₁ ε₂ (originalLabelColumn p hg B ε₁ ε₂ true C₁ ((u:O)*c) f) (originalLabelColumn p hg B ε₁ ε₂ false C₂ ((u:O)*c) f) W V₁ V₂ X₁ X₂ K d h = blockRow p hg (cubeActiveSupport B v ε₁ ε₂) (fun i=>(conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val) ((u:O)^2)* actualFirstKernel p hp hcop hg F B v ε₁ ε₂ (originalLabelColumn p hg B ε₁ ε₂ true C₁ c f) (originalLabelColumn p hg B ε₁ ε₂ false C₂ c f) W V₁ V₂ X₁ X₂ K d ((u:O)^2*h) := by have hn : ‖eisEmbedding ((u:O)^2*h)‖=‖eisEmbedding h‖ := by rw [map_mul,norm_mul,map_pow,norm_pow,GaussGeneratorTransport.norm_eisEmbedding_unit,one_pow,one_mul] simp only [actualFirstKernel,Finset.mul_sum,hn] apply Finset.sum_congr rfl intro N hN apply Finset.sum_congr rfl intro P hP by_cases hNP:Disjoint N P · simp only [hNP,ite_true] rw [threeGaussRowFactor_common_unit p hp hcop hg N P B hNP (hFB.mono_left (Finset.mem_powerset.mp hN)) (hFB.mono_left (Finset.mem_powerset.mp hP)) v ε₁ ε₂ C₁ C₂ u c f d h] ring · simp only [hNP,ite_false,mul_zero] omit [DecidableEq ι] in theorem commonUnitPhase_norm (B:Finset ι) (v:ι→ℕ) (ε₁ ε₂:ι→Bool) (u:Oˣ) : ‖blockRow p hg (cubeActiveSupport B v ε₁ ε₂) (fun i=>(conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val) ((u:O)^2)‖=1 := by have h:=blockRow_unit_mul_star p hg (cubeActiveSupport B v ε₁ ε₂) (fun i=>(conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val) (u^2) have hn:=congrArg norm h simp only [norm_mul,norm_star,norm_one,Units.val_pow_eq_pow_val] at hn nlinarith [norm_nonneg (blockRow p hg (cubeActiveSupport B v ε₁ ε₂) (fun i=>(conductorExponent (parity (v i)) (ε₁ i) (ε₂ i)).val) ((u:O)^2))] def unitSquareRowEquiv (u:Oˣ) : O≃O where toFun h := (u:O)^2*h invFun h := ((u⁻¹:Oˣ):O)^2*h left_inv h := by dsimp only rw [←mul_assoc,←mul_pow] simp right_inv h := by dsimp only rw [←mul_assoc,←mul_pow] simp end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) variable {ι : Type*} [DecidableEq ι] (p:ι→O) (hp:∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) lemma blockRow_at_zero (S:Finset ι) (e:ι→ℕ) : blockRow p hg S e 0=if S=∅ then 1 else 0 := by by_cases hS:S=∅ · simp [hS,blockRow_eq_product] · rw [if_neg hS,blockRow_eq_product] obtain ⟨i,hi⟩:=Finset.nonempty_iff_ne_empty.mpr hS apply Finset.prod_eq_zero hi simp only [map_zero,MulChar.map_zero] lemma threeGaussRowFactor_zero_nonempty (N P B:Finset ι) (v:ι→ℕ) (ε₁ ε₂:ι→Bool) (C₁ C₂:Finset ι→ℂ) (d:O) (hne:(N∪P)∪cubeActiveSupport B v ε₁ ε₂≠∅) : threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d 0=0 := by simp only [threeGaussRowFactor,blockRow_at_zero,if_neg hne,star_zero,mul_zero] theorem actualFirstKernel_zero (F B:Finset ι) (v:ι→ℕ) (ε₁ ε₂:ι→Bool) (C₁ C₂:Finset ι→ℂ) (W:𝓢(ℝ,ℂ)) (V₁ V₂:ℝ→ℂ) (X₁ X₂ K:ℝ) (d:O) : actualFirstKernel p hp hcop hg F B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K d 0 = if cubeActiveSupport B v ε₁ ε₂=∅ then (V₁ (columnLog p X₁ ∅)*V₂ (columnLog p X₂ ∅))*(K:ℂ)*paperRadialFourier W 0* threeGaussRowFactor p hp hcop hg ∅ ∅ B v ε₁ ε₂ C₁ C₂ d 0 else 0 := by unfold actualFirstKernel by_cases hB:cubeActiveSupport B v ε₁ ε₂=∅ · rw [if_pos hB,Finset.sum_eq_single ∅] · rw [Finset.sum_eq_single ∅] · simp only [Finset.disjoint_empty_left,ite_true,Finset.empty_union,hB, Finset.prod_empty,map_one,norm_one,Complex.ofReal_one,div_one,map_zero,norm_zero, zero_pow (by decide:2≠0),mul_zero,zero_div] · intro P hP hP0 have hn:(∅∪P)∪cubeActiveSupport B v ε₁ ε₂≠∅ := by simpa only [Finset.empty_union,hB,Finset.union_empty] using hP0 simp only [threeGaussRowFactor_zero_nonempty p hp hcop hg ∅ P B v ε₁ ε₂ C₁ C₂ d hn,mul_zero,ite_self] · simp · intro N hN hN0 apply Finset.sum_eq_zero intro P hP have hn:(N∪P)∪cubeActiveSupport B v ε₁ ε₂≠∅ := by intro he exact hN0 (Finset.eq_empty_iff_forall_notMem.mpr (fun i hi=>by have : i∈(N∪P)∪cubeActiveSupport B v ε₁ ε₂:=Finset.mem_union_left _ (Finset.mem_union_left _ hi) simp only [he, Finset.notMem_empty] at this)) simp only [threeGaussRowFactor_zero_nonempty p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d hn,mul_zero,ite_self] · simp · rw [if_neg hB] apply Finset.sum_eq_zero intro N hN apply Finset.sum_eq_zero intro P hP have hn:(N∪P)∪cubeActiveSupport B v ε₁ ε₂≠∅ := by intro he exact hB (Finset.eq_empty_iff_forall_notMem.mpr (fun i hi=>by have : i∈(N∪P)∪cubeActiveSupport B v ε₁ ε₂:=Finset.mem_union_right _ hi simp only [he, Finset.notMem_empty] at this)) simp only [threeGaussRowFactor_zero_nonempty p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d hn,mul_zero,ite_self] theorem actualFirstKernel_truncate (F B:Finset ι) (v:ι→ℕ) (ε₁ ε₂:ι→Bool) (C₁ C₂:Finset ι→ℂ) (W:𝓢(ℝ,ℂ)) (V₁ V₂:ℝ→ℂ) (X₁ X₂ K:ℝ) (hK:0.symm end FirstPassCubeLabels end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.LocalCutoffs namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology SchwartzMap LineDeriv ContDiff structure PositiveChartCutoff where func : EuclideanSpatial → ℝ smooth : ContDiff ℝ ∞ func compact : HasCompactSupport func positive : tsupport func ⊆ {p | 0 < p 2} lemma kernelChartCutoff_exists (p : EuclideanSpatial) (hp : 0

(hχ hq).1⟩,hvalue,hrange,?_⟩ intro q hq r hr heq have hwEq := hUinj (hχ hq).2 (hχ hr).2 heq have hc := congrArg hyperbolicEuclideanCoordinates hwEq simpa only [hyperbolicEuclideanCoordinates_toHyperbolic _ (hχ hq).1, hyperbolicEuclideanCoordinates_toHyperbolic _ (hχ hr).1] using hc def kernelLocalizedField (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) : ℂ := χ.func p • kernelTestField f p lemma kernelLocalizedField_compact (χ : PositiveChartCutoff) (f : kernelSmoothTests) : HasCompactSupport (kernelLocalizedField χ f) := χ.compact.smul_right lemma kernelLocalizedField_tsupport (χ : PositiveChartCutoff) (f : kernelSmoothTests) : tsupport (kernelLocalizedField χ f) ⊆ tsupport χ.func := tsupport_smul_subset_left _ _ lemma kernelLocalizedField_smooth (χ : PositiveChartCutoff) (f : kernelSmoothTests) : ContDiff ℝ ∞ (kernelLocalizedField χ f) := by rw [contDiff_iff_contDiffAt] intro p by_cases hp : 0 < p 2 · exact χ.smooth.contDiffAt.smul (kernelTestField_contDiffAt f p hp) · have hn : p ∉ tsupport χ.func := fun h => hp (χ.positive h) have hz := notMem_tsupport_iff_eventuallyEq.mp hn apply (contDiffAt_const : ContDiffAt ℝ ∞ (fun _ : EuclideanSpatial => (0 : ℂ)) p).congr_of_eventuallyEq filter_upwards [hz] with q hq simp only [kernelLocalizedField,hq,Pi.zero_apply,zero_smul] def kernelLocalizedSchwartz (χ : PositiveChartCutoff) (f : kernelSmoothTests) : 𝓢(EuclideanSpatial,ℂ) := (kernelLocalizedField_compact χ f).toSchwartzMap (kernelLocalizedField_smooth χ f) lemma kernelLocalizedSchwartz_coe (χ : PositiveChartCutoff) (f : kernelSmoothTests) : (kernelLocalizedSchwartz χ f : EuclideanSpatial → ℂ)=kernelLocalizedField χ f := rfl def kernelLocalizedH1 (χ : PositiveChartCutoff) (f : kernelSmoothTests) : EuclideanH1 := by let g := kernelLocalizedSchwartz χ f let v := WithLp.toLp 2 (fun j => (∂_{euclideanCoordinateVector j} g).toLp 2 volume) refine ⟨WithLp.toLp 2 (g.toLp 2 volume,v),?_⟩ change (g.toLp 2 volume,v)∈euclideanWeakGradientGraph exact schwartz_mem_euclideanWeakGradientGraph g lemma kernelLocalizedH1_embedding (χ : PositiveChartCutoff) (f : kernelSmoothTests) : euclideanH1Embedding (kernelLocalizedH1 χ f)= (kernelLocalizedSchwartz χ f).toLp 2 volume := rfl lemma kernelLocalizedH1_gradient (χ : PositiveChartCutoff) (f : kernelSmoothTests) (j : Fin 3) : euclideanH1Gradient (kernelLocalizedH1 χ f) j= (∂_{euclideanCoordinateVector j} (kernelLocalizedSchwartz χ f)).toLp 2 volume := rfl lemma kernelLocalizedField_fderiv (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : 0 < p 2) (u : EuclideanSpatial) : fderiv ℝ (kernelLocalizedField χ f) p u= χ.func p • fderiv ℝ (kernelTestField f) p u+ (fderiv ℝ χ.func p u) • kernelTestField f p := by change fderiv ℝ (χ.func • kernelTestField f) p u=_ rw [fderiv_smul (χ.smooth.differentiable (by simp)).differentiableAt ((kernelTestField_contDiffAt f p hp).differentiableAt (by simp))] rfl lemma complex_norm_add_sq_le (z w : ℂ) : ‖z+w‖^2 ≤ 2*‖z‖^2+2*‖w‖^2 := by have hh := norm_add_le z w have hn := norm_nonneg (z+w) nlinarith [sq_nonneg (‖z‖-‖w‖)] lemma kernelLocalizedField_energy_bound (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : 0

q 2) hc simp only [hv,kernelTestPartial,hc] rw [he] have hh := mul_le_mul_of_nonneg_left hsum (sq_nonneg (p 2)) simpa only [Finset.sum_add_distrib,←Finset.mul_sum,←Finset.sum_mul, mul_add,mul_assoc,mul_left_comm,mul_comm] using hh end open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff ENNReal def kernelEuclideanProjection : EuclideanSpatial → KernelQuotient := integralOrbitProjection globalKubotaKernel ∘ euclideanToHyperbolic lemma euclideanToHyperbolic_measurePreserving_on (S : Set EuclideanSpatial) (hS : MeasurableSet S) (_hpos : S⊆euclideanUpperHalf) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology MeasurePreserving euclideanToHyperbolic (hyperbolicEuclideanVolume.restrict S) (hyperbolicVolume.restrict (hyperbolicEuclideanCoordinates ⁻¹' S)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by have hU : MeasurableSet (hyperbolicEuclideanCoordinates ⁻¹' S) := hyperbolicEuclideanCoordinates_continuous.measurable hS have hset : euclideanToHyperbolic ⁻¹' (hyperbolicEuclideanCoordinates ⁻¹' S)=ᵐ[hyperbolicEuclideanVolume]S := by filter_upwards [hyperbolicEuclideanVolume_ae_positive] with p hp change (hyperbolicEuclideanCoordinates (euclideanToHyperbolic p) ∈ S) = (p ∈ S) rw [hyperbolicEuclideanCoordinates_toHyperbolic p hp] refine ⟨euclideanToHyperbolic_measurable,?_⟩ rw [hyperbolicVolume,Measure.restrict_map euclideanToHyperbolic_measurable hU, Measure.restrict_congr_set hset] lemma euclideanToHyperbolic_image_positive (S : Set EuclideanSpatial) (hpos : S⊆euclideanUpperHalf) : euclideanToHyperbolic '' S=hyperbolicEuclideanCoordinates ⁻¹' S := by ext w constructor · rintro ⟨p,hp,rfl⟩ simpa only [Set.mem_preimage,hyperbolicEuclideanCoordinates_toHyperbolic p (hpos hp)] using hp · intro hw exact ⟨hyperbolicEuclideanCoordinates w,hw,euclideanToHyperbolic_coordinates w⟩ lemma kernelEuclideanProjection_measurePreserving_on (S : Set EuclideanSpatial) (hS : MeasurableSet S) (hpos : S⊆euclideanUpperHalf) (hinj : Set.InjOn kernelEuclideanProjection S) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology MeasurePreserving kernelEuclideanProjection (hyperbolicEuclideanVolume.restrict S) ((integralQuotientVolume globalKubotaKernel).restrict (kernelEuclideanProjection '' S)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by have hU : MeasurableSet (hyperbolicEuclideanCoordinates ⁻¹' S) := hyperbolicEuclideanCoordinates_continuous.measurable hS have hi : Set.InjOn (integralOrbitProjection globalKubotaKernel) (hyperbolicEuclideanCoordinates ⁻¹' S) := by intro u hu v hv heq have hh := hinj hu hv (by simpa only [kernelEuclideanProjection,Function.comp_apply, euclideanToHyperbolic_coordinates] using heq) have hh' := congrArg euclideanToHyperbolic hh simpa only [euclideanToHyperbolic_coordinates] using hh' have hcomp := (kernelProjection_measurePreserving_on _ hU hi).comp (euclideanToHyperbolic_measurePreserving_on S hS hpos) have himage : integralOrbitProjection globalKubotaKernel '' (hyperbolicEuclideanCoordinates ⁻¹' S)=kernelEuclideanProjection '' S := by rw [←euclideanToHyperbolic_image_positive S hpos,Set.image_image] rfl rwa [himage] at hcomp lemma kernelEuclideanProjection_integral (S : Set EuclideanSpatial) (hS : MeasurableSet S) (hpos : S⊆euclideanUpperHalf) (hinj : Set.InjOn kernelEuclideanProjection S) (g : KernelQuotient → ℝ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hg : AEStronglyMeasurable g (integralQuotientVolume globalKubotaKernel)), (∫p in S,g (kernelEuclideanProjection p)∂hyperbolicEuclideanVolume)= ∫q in kernelEuclideanProjection '' S,g q∂integralQuotientVolume globalKubotaKernel := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hg : AEStronglyMeasurable g (integralQuotientVolume globalKubotaKernel)) => by have hm := kernelEuclideanProjection_measurePreserving_on S hS hpos hinj have hh := hg.mono_measure (Measure.restrict_le_self (s := kernelEuclideanProjection '' S)) rw [←hm.map_eq] at hh ⊢ exact (integral_map hm.measurable.aemeasurable hh).symm lemma kernelEuclideanProjection_integral_le (S : Set EuclideanSpatial) (hS : MeasurableSet S) (hpos : S⊆euclideanUpperHalf) (hinj : Set.InjOn kernelEuclideanProjection S) (g : KernelQuotient → ℝ) (hg : Integrable g (integralQuotientVolume globalKubotaKernel)) (hgn : ∀q,0≤g q) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (∫p in S,g (kernelEuclideanProjection p)∂hyperbolicEuclideanVolume)≤ ∫q,g q∂integralQuotientVolume globalKubotaKernel := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [kernelEuclideanProjection_integral S hS hpos hinj g hg.aestronglyMeasurable] exact setIntegral_le_integral hg (Eventually.of_forall hgn) lemma kernelSmoothTestsToL2_norm_sq (f : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ‖kernelSmoothTestsToL2 f‖^2= ∫q,‖f.1 q‖^2∂integralQuotientVolume globalKubotaKernel := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by calc ‖kernelSmoothTestsToL2 f‖^2=inner ℝ (kernelSmoothTestsToL2 f) (kernelSmoothTestsToL2 f) := (real_inner_self_eq_norm_sq _).symm _ = ∫q,inner ℝ (kernelSmoothTestsToL2 f q) (kernelSmoothTestsToL2 f q) ∂integralQuotientVolume globalKubotaKernel := rfl _ = _ := by apply integral_congr_ae filter_upwards [(kernelSmoothTests_memLp f).coeFn_toLp] with q hq change inner ℝ (((kernelSmoothTests_memLp f).toLp f.1) q) (((kernelSmoothTests_memLp f).toLp f.1) q)=_ rw [hq,real_inner_self_eq_norm_sq] lemma kernelLocalMass_le (S : Set EuclideanSpatial) (hS : MeasurableSet S) (hpos : S⊆euclideanUpperHalf) (hinj : Set.InjOn kernelEuclideanProjection S) (f : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (∫p in S,‖kernelTestField f p‖^2∂hyperbolicEuclideanVolume)≤‖kernelSmoothTestsToL2 f‖^2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [kernelSmoothTestsToL2_norm_sq] exact kernelEuclideanProjection_integral_le S hS hpos hinj _ (kernelSmoothTests_memLp f).norm.integrable_sq (fun _ => sq_nonneg _) lemma euclideanVolume_le_heightCube_hyperbolic (S : Set EuclideanSpatial) (hS : MeasurableSet S) (hpos : S⊆euclideanUpperHalf) (b : ℝ) (hb : 0≤b) (hheight : ∀p∈S,p 2≤b) : volume.restrict S≤ENNReal.ofReal (b^3) • hyperbolicEuclideanVolume.restrict S := by have hw : hyperbolicEuclideanVolume.restrict S=(volume.restrict S).withDensity hyperbolicDensity := by rw [hyperbolicEuclideanVolume,MeasureTheory.restrict_withDensity hS, Measure.restrict_restrict hS,Set.inter_eq_left.mpr hpos] rw [hw] have hbd : (1 : EuclideanSpatial→ℝ≥0∞)≤ᵐ[volume.restrict S] ENNReal.ofReal (b^3) • hyperbolicDensity := by filter_upwards [ae_restrict_mem hS] with p hp have ht : 0

hgn (kernelEuclideanProjection p))) (hgi.smul_measure ENNReal.ofReal_ne_top) rw [integral_smul_measure,ENNReal.toReal_ofReal (pow_nonneg hb 3)] at hh exact hh.trans (mul_le_mul_of_nonneg_left (kernelEuclideanProjection_integral_le S hS hpos hinj g hg hgn) (pow_nonneg hb 3)) end CubicEisenstein open scoped BigOperators Classical SchwartzMap ContDiff namespace CompletedGauss section open ActualEisensteinCubic CanonicalQuadraticSieve CompletedDyadic theorem completed_scaled_shape (ε k y H c B : ℝ) (hε : 0≤ε) (hk : 0 IsCoprime p.val r.val) divides : ∀p : primes,p.val∣I*Q nonresidual : ∀p : primes,¬p.val∣rowResidualPart I Q label : primes→Fin 3 nColumns : (ℕ×ℕ×ℕ)→Finset (Ideal O) bColumns : (ℕ×ℕ×ℕ)→Finset (Ideal O) nBounds : ∀i,∀J∈nColumns i,J≠0 ∧ (2:ℝ)^i.2.2/2≤(Ideal.absNorm J:ℝ) ∧ (Ideal.absNorm J:ℝ)≤(2:ℝ)^i.2.2 bBounds : ∀i,∀J∈bColumns i,J≠0 ∧ (2:ℝ)^i.2.1/2≤(Ideal.absNorm J:ℝ) ∧ (Ideal.absNorm J:ℝ)≤(2:ℝ)^i.2.1 amplitude : (ℕ×ℕ×ℕ)→Ideal O→Ideal O→ℂ amplitude_bound : ∀i,∀n∈nColumns i,∀b∈bColumns i,‖amplitude i n b‖≤1 rowPhase : (ℕ×ℕ×ℕ)→idealRange (completedResidualScale K I Q)→ℂ rowPhase_bound : ∀i k,‖rowPhase i k‖≤1 namespace ReflectedBranchData def value {levelBound K : ℝ} {I F Q : Ideal O} (d : ReflectedBranchData levelBound K I F Q) (W : ℝ→ℂ) (X ρ q : ℝ) (k : idealRange (completedResidualScale K I Q)) : ℂ := by letI : ∀p : d.primes,p.val.IsMaximal := d.maximal exact ∑'i : ℕ×ℕ×ℕ,reflectedBranchBlock (fun p : d.primes => p.val) d.good (fun p => completedLocalExponent I F p.val) d.label W (completedResidualScale K I Q) (completedBranchScale K (X/d.levelScale) I F Q (fun p : d.primes => p.val) d.label) ρ q d.nColumns d.bColumns d.amplitude d.rowPhase i k end ReflectedBranchData structure ReflectedFiberData (rays : ℕ) (levelBound K : ℝ) (I F Q : Ideal O) where pool : Finset (Ideal O) maximal : ∀p : pool,p.val.IsMaximal divides : ∀p : pool,p.val∣I*Q branch : (Fin rays×(pool→Fin 6))→ReflectedBranchData levelBound K I F Q weight : (Fin rays×(pool→Fin 6))→ℂ weight_bound : ∀b,‖weight b‖≤1 namespace ReflectedFiberData def value {rays : ℕ} {levelBound K : ℝ} {I F Q : Ideal O} (d : ReflectedFiberData rays levelBound K I F Q) (W : ℝ→ℂ) (X ρ q : ℝ) (k : idealRange (completedResidualScale K I Q)) : ℂ := ∑b,d.weight b*(d.branch b).value W X ρ q k theorem finite_energy_bound {κ τ : Type*} [Fintype κ] [Fintype τ] (f : τ→κ→ℂ) (w : τ→ℂ) (hw : ∀t,‖w t‖≤1) (E : ℝ) (hf : ∀t,(∑k,‖f t k‖^2)≤E) : (∑k,‖∑t,w t*f t k‖^2)≤(Fintype.card τ:ℝ)^2*E := by have hpoint (k : κ) : ‖∑t,w t*f t k‖^2≤(Fintype.card τ:ℝ)*∑t,‖f t k‖^2 := by have h := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (fun _ : τ => (1:ℝ)) (fun t => ‖w t*f t k‖) have hn : ‖∑t,w t*f t k‖^2≤(∑t,‖w t*f t k‖)^2 := pow_le_pow_left₀ (norm_nonneg _) (norm_sum_le _ _) 2 apply hn.trans apply (show (∑t,‖w t*f t k‖)^2≤(Fintype.card τ:ℝ)*∑t,‖w t*f t k‖^2 by simpa using h).trans apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) apply Finset.sum_le_sum intro t _ apply pow_le_pow_left₀ (norm_nonneg _) rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (hw t) calc _ ≤ ∑k,(Fintype.card τ:ℝ)*∑t,‖f t k‖^2 := Finset.sum_le_sum (fun k _ => hpoint k) _ = (Fintype.card τ:ℝ)*∑t,∑k,‖f t k‖^2 := by rw [←Finset.mul_sum,Finset.sum_comm] _ ≤ (Fintype.card τ:ℝ)*∑_t : τ,E := mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun t _ => hf t)) (Nat.cast_nonneg _) _ = _ := by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul]; ring end ReflectedFiberData open ActualEisensteinCubic CanonicalQuadraticSieve theorem one_le_completedResidualScale (K : ℝ) (I Q : Ideal O) (hI : I≠0) (hIK : (Ideal.absNorm I:ℝ)≤K) : 1≤completedResidualScale K I Q := by have hn : 1≤(Ideal.absNorm (rowResidualPart I Q):ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => squarefreeResidualPart_ne_zero (rowSimplePart I) Q (Ideal.absNorm_eq_zero_iff.mp hz)) apply hn.trans rw [rowResidualPart_norm I Q hI,completedResidualScale] exact div_le_div_of_nonneg_right hIK (by positivity) namespace ReflectedFiberData def idealValue {rays : ℕ} {levelBound K : ℝ} {I F Q : Ideal O} (d : ReflectedFiberData rays levelBound K I F Q) (W : ℝ→ℂ) (X ρ q : ℝ) (J : Ideal O) : ℂ := if h : J∈idealRange (completedResidualScale K I Q) then d.value W X ρ q ⟨J,h⟩ else 0 theorem idealValue_at {rays : ℕ} {levelBound K : ℝ} {I F Q : Ideal O} (d : ReflectedFiberData rays levelBound K I F Q) (W : ℝ→ℂ) (X ρ q : ℝ) (J : idealRange (completedResidualScale K I Q)) : d.idealValue W X ρ q J.val=d.value W X ρ q J := by simp only [idealValue,dif_pos J.property] end ReflectedFiberData def HasExactCompletedModels (rays : ℕ) (rows : Finset (Ideal O)) (K X ρ q levelBound : ℝ) (F Q : Ideal O) (W : ℝ→ℂ) (Ψ : Ideal O→O→*ℂ) (lengthScale : ℂ) : Prop := ∀A∈rows.image rowPowerfulPart,∀T∈rows.image (fun I => rowMaskPart I Q), (completedRowFiber rows Q A T).Nonempty → ∃I∈completedRowFiber rows Q A T,∃d : ReflectedFiberData rays levelBound K I F Q, ∀J∈completedRowFiber rows Q A T, completedT (Ψ J) W X=lengthScale*d.idealValue W X ρ q (rowResidualPart J Q) end CompletedGauss end end OAI end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.H1 /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.H1` An upstream-friendly **definition** of a Euclidean `H¹`-type energy space built from `L²`. At the current Mathlib pin, we do not have a ready-made Sobolev-space development for domains or manifolds. For the Laplace–Beltrami compact-resolvent discharge, we mainly need: 1. a Hilbert space `H¹` equipped with a continuous embedding into `L²`; 2. a continuous “gradient” map `H¹ → L²(E)`; and later 3. a compactness theorem for the inclusion on bounded domains / compact manifolds (Rellich). This file defines `H¹` as the closed submodule of `L² × L²(E)` generated by `C¹`-functions with compact support and their gradients (expressed using the Riesz representation `toDual`). ## Main definitions - `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.C1c`: the `ℝ`-submodule of `C¹` compactly supported functions `E → ℝ`. - `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.h1`: the (closed) `H¹` submodule of `L²(E) × L²(E,E)`. - `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.h1ToL2`: the continuous embedding `H¹ → L²`. - `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.h1ToL2Grad`: the continuous gradient map `H¹ → L²(E)`. No analytic “Sobolev theorems” are proved here; those are tracked separately (Rellich / elliptic regularity beads). -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean open scoped ENNReal MeasureTheory open MeasureTheory section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceH1 : MeasurableSpace E := borel E abbrev instBorelSpaceH1 : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceH1 : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) infer_instance variable (μ : @Measure E (instMeasurableSpaceH1 (E := E))) [IsFiniteMeasureOnCompacts μ] /- The space of square-integrable real-valued functions. -/ abbrev L2ℝ : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) Type _ := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact ↥(E →₂[μ] ℝ) /- The space of square-integrable vector-valued functions. -/ abbrev L2E : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) Type _ := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact ↥(E →₂[μ] E) /- The product space containing a function and its first derivative. -/ abbrev H1Target : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) Type _ := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact L2ℝ (μ := μ) × L2E (μ := μ) /- `C¹` real-valued functions on `E` with compact support, as a submodule of `E → ℝ`. -/ def C1c : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) Submodule ℝ (E → ℝ) := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact { carrier := {f | ContDiff ℝ 1 f ∧ HasCompactSupport f} zero_mem' := by refine ⟨contDiff_const, ?_⟩ simpa using (HasCompactSupport.zero : HasCompactSupport (fun _ : E => (0 : ℝ))) add_mem' := by intro f g hf hg refine ⟨hf.1.add hg.1, hf.2.add hg.2⟩ smul_mem' := by intro c f hf refine ⟨hf.1.const_smul c, ?_⟩ -- `HasCompactSupport` is stable under pointwise scalar multiplication. exact (HasCompactSupport.smul_left (f := fun _ : E => c) hf.2) } /- The pointwise gradient (as an `E`-valued function), via Riesz representation. -/ noncomputable def grad (f : E → ℝ) : E → E := fun x => (InnerProductSpace.toDual ℝ E).symm (fderiv ℝ f x) lemma continuous_grad {f : E → ℝ} (hf : ContDiff ℝ 1 f) : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) Continuous (grad (E := E) f) := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) have hcont : Continuous (fderiv ℝ f) := hf.continuous_fderiv one_ne_zero have : Continuous fun x => (InnerProductSpace.toDual ℝ E).symm (fderiv ℝ f x) := (InnerProductSpace.toDual ℝ E).symm.continuous.comp hcont exact this lemma hasCompactSupport_grad {f : E → ℝ} (hf : HasCompactSupport f) : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) HasCompactSupport (grad (E := E) f) := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) -- Outside the support of `f`, `fderiv` is identically `0`, hence so is `grad`. have hf' : HasCompactSupport (fderiv ℝ f) := hf.fderiv ℝ -- `grad` is composition with a linear map sending `0` to `0`. exact (HasCompactSupport.comp_left (f := fderiv ℝ f) (g := (InnerProductSpace.toDual ℝ E).symm) hf' (by simp)) omit [CompleteSpace E] in lemma memLp_of_mem_C1c {f : E → ℝ} (hf : f ∈ C1c (E := E)) : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) MemLp f 2 μ := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact (hf.1.continuous.memLp_of_hasCompactSupport (μ := μ) (p := (2 : ℝ≥0∞)) hf.2) lemma memLp_grad_of_mem_C1c {f : E → ℝ} (hf : f ∈ C1c (E := E)) : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) MemLp (grad (E := E) f) 2 μ := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) have hcont : Continuous (grad (E := E) f) := continuous_grad (E := E) (f := f) hf.1 have hcs : HasCompactSupport (grad (E := E) f) := hasCompactSupport_grad (E := E) (f := f) hf.2 exact hcont.memLp_of_hasCompactSupport (μ := μ) (p := (2 : ℝ≥0∞)) hcs /- The `L²` class of a `C¹` compactly supported function. -/ noncomputable def toL2 (f : ↥(C1c (E := E))) : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) L2ℝ (μ := μ) := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact (memLp_of_mem_C1c (μ := μ) (E := E) f.2).toLp f.1 /- The `L²` class of the gradient of a `C¹` compactly supported function. -/ noncomputable def toL2Grad (f : ↥(C1c (E := E))) : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) L2E (μ := μ) := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact (memLp_grad_of_mem_C1c (μ := μ) (E := E) f.2).toLp (grad (E := E) f.1) omit [CompleteSpace E] in private lemma toL2_add (f g : ↥(C1c (E := E))) : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) toL2 (μ := μ) (E := E) (f + g) = toL2 (μ := μ) (E := E) f + toL2 (μ := μ) (E := E) g := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) apply Lp.ext have hf : (toL2 (μ := μ) (E := E) f : E → ℝ) =ᵐ[μ] f.1 := (memLp_of_mem_C1c (μ := μ) (E := E) f.2).coeFn_toLp have hg : (toL2 (μ := μ) (E := E) g : E → ℝ) =ᵐ[μ] g.1 := (memLp_of_mem_C1c (μ := μ) (E := E) g.2).coeFn_toLp have hfg : (toL2 (μ := μ) (E := E) (f + g) : E → ℝ) =ᵐ[μ] (f.1 + g.1) := (memLp_of_mem_C1c (μ := μ) (E := E) (f + g).2).coeFn_toLp -- Both sides agree a.e. with `f + g`. refine hfg.trans ?_ filter_upwards [Lp.coeFn_add (toL2 (μ := μ) (E := E) f) (toL2 (μ := μ) (E := E) g), hf, hg] with x hxadd hxf hxg -- Rewrite both sides in terms of pointwise evaluation. calc f.1 x + g.1 x = (toL2 (μ := μ) (E := E) f : E → ℝ) x + (toL2 (μ := μ) (E := E) g : E → ℝ) x := by simp [hxf, hxg] _ = ((toL2 (μ := μ) (E := E) f + toL2 (μ := μ) (E := E) g : L2ℝ (μ := μ)) : E → ℝ) x := by simpa [Pi.add_apply] using hxadd.symm omit [CompleteSpace E] in private lemma toL2_smul (c : ℝ) (f : ↥(C1c (E := E))) : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) toL2 (μ := μ) (E := E) (c • f) = c • toL2 (μ := μ) (E := E) f := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) apply Lp.ext have hf : (toL2 (μ := μ) (E := E) f : E → ℝ) =ᵐ[μ] f.1 := (memLp_of_mem_C1c (μ := μ) (E := E) f.2).coeFn_toLp have hcf : (toL2 (μ := μ) (E := E) (c • f) : E → ℝ) =ᵐ[μ] (c • f.1) := (memLp_of_mem_C1c (μ := μ) (E := E) (c • f).2).coeFn_toLp refine hcf.trans ?_ filter_upwards [Lp.coeFn_smul c (toL2 (μ := μ) (E := E) f), hf] with x hxsmul hxf simp [Pi.smul_apply, hxsmul, hxf] /- Linear map sending `C¹_c` functions to their `L²` classes. -/ noncomputable def toL2Linear : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) ↥(C1c (E := E)) →ₗ[ℝ] L2ℝ (μ := μ) := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact { toFun := toL2 (μ := μ) (E := E) map_add' := by exact toL2_add (μ := μ) (E := E) map_smul' := by exact toL2_smul (μ := μ) (E := E) } private lemma toL2Grad_add (f g : ↥(C1c (E := E))) : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) toL2Grad (μ := μ) (E := E) (f + g) = toL2Grad (μ := μ) (E := E) f + toL2Grad (μ := μ) (E := E) g := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) apply Lp.ext have hf : (toL2Grad (μ := μ) (E := E) f : E → E) =ᵐ[μ] grad (E := E) f.1 := (memLp_grad_of_mem_C1c (μ := μ) (E := E) f.2).coeFn_toLp have hg : (toL2Grad (μ := μ) (E := E) g : E → E) =ᵐ[μ] grad (E := E) g.1 := (memLp_grad_of_mem_C1c (μ := μ) (E := E) g.2).coeFn_toLp have hfg : (toL2Grad (μ := μ) (E := E) (f + g) : E → E) =ᵐ[μ] grad (E := E) (f.1 + g.1) := (memLp_grad_of_mem_C1c (μ := μ) (E := E) (f + g).2).coeFn_toLp refine hfg.trans ?_ filter_upwards [Lp.coeFn_add (toL2Grad (μ := μ) (E := E) f) (toL2Grad (μ := μ) (E := E) g), hf, hg] with x hxadd hxf hxg have hdf : DifferentiableAt ℝ f.1 x := (f.2.1.differentiable one_ne_zero).differentiableAt have hdg : DifferentiableAt ℝ g.1 x := (g.2.1.differentiable one_ne_zero).differentiableAt -- Rewrite in terms of pointwise evaluation and use linearity of `grad`. have hgrad : grad (E := E) (f.1 + g.1) x = grad (E := E) f.1 x + grad (E := E) g.1 x := by simp [grad, fderiv_add hdf hdg, map_add] calc grad (E := E) (f.1 + g.1) x = grad (E := E) f.1 x + grad (E := E) g.1 x := hgrad _ = (toL2Grad (μ := μ) (E := E) f : E → E) x + (toL2Grad (μ := μ) (E := E) g : E → E) x := by simp [hxf, hxg] _ = ((toL2Grad (μ := μ) (E := E) f + toL2Grad (μ := μ) (E := E) g : L2E (μ := μ)) : E → E) x := by simpa [Pi.add_apply] using hxadd.symm private lemma toL2Grad_smul (c : ℝ) (f : ↥(C1c (E := E))) : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) toL2Grad (μ := μ) (E := E) (c • f) = c • toL2Grad (μ := μ) (E := E) f := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) apply Lp.ext have hf : (toL2Grad (μ := μ) (E := E) f : E → E) =ᵐ[μ] grad (E := E) f.1 := (memLp_grad_of_mem_C1c (μ := μ) (E := E) f.2).coeFn_toLp have hcf : (toL2Grad (μ := μ) (E := E) (c • f) : E → E) =ᵐ[μ] grad (E := E) (c • f.1) := (memLp_grad_of_mem_C1c (μ := μ) (E := E) (c • f).2).coeFn_toLp refine hcf.trans ?_ filter_upwards [Lp.coeFn_smul c (toL2Grad (μ := μ) (E := E) f), hf] with x hxsmul hxf have hdf : DifferentiableAt ℝ f.1 x := (f.2.1.differentiable one_ne_zero).differentiableAt have hgrad : grad (E := E) (c • f.1) x = c • grad (E := E) f.1 x := by simp [grad, fderiv_const_smul hdf, map_smul] calc grad (E := E) (c • f.1) x = c • grad (E := E) f.1 x := hgrad _ = c • (toL2Grad (μ := μ) (E := E) f : E → E) x := by simp [hxf] _ = ((c • toL2Grad (μ := μ) (E := E) f : L2E (μ := μ)) : E → E) x := by -- `Lp.coeFn_smul` gives the pointwise evaluation of `c • f` in `L²`. simpa [Pi.smul_apply] using hxsmul.symm /- Linear map sending `C¹_c` functions to the `L²` class of their gradient. -/ noncomputable def toL2GradLinear : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) ↥(C1c (E := E)) →ₗ[ℝ] L2E (μ := μ) := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact { toFun := toL2Grad (μ := μ) (E := E) map_add' := by exact toL2Grad_add (μ := μ) (E := E) map_smul' := by exact toL2Grad_smul (μ := μ) (E := E) } /- The graph map `f ↦ (f, ∇f)` into `L² × L²(E)`. -/ noncomputable def graph : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) ↥(C1c (E := E)) →ₗ[ℝ] H1Target (μ := μ) := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact (toL2Linear (μ := μ) (E := E)).prod (toL2GradLinear (μ := μ) (E := E)) /- The Euclidean `H¹` space (as a closed submodule of `L² × L²(E)`). -/ noncomputable def h1 : let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) Submodule ℝ (H1Target (μ := μ)) := by let : MeasurableSpace E := instMeasurableSpaceH1 (E := E) let : BorelSpace E := instBorelSpaceH1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceH1 (E := E) exact (LinearMap.range (graph (μ := μ) (E := E))).topologicalClosure end end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.Translation /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.Translation` Translation utilities for the Euclidean Sobolev model spaces. This file is intentionally “pre-Rellich”: it provides the algebraic/measure-theoretic translation operators and their interaction with the `C¹_c` graph embedding used to define `H¹`. ## Main results - `translateC1c`: translation as a linear endomorphism of `C¹_c`. - `translateL2`: translation as a linear isometry of `L²` (under an invariant measure). - `translateL2_toL2` / `translateL2_toL2Grad`: translation commutes with `toL2` / `toL2Grad`. - `grad_translate`: the Euclidean gradient commutes with translation. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean open scoped ENNReal MeasureTheory Topology open MeasureTheory section Topology variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /- Translate a function by `a` (right translation): `x ↦ f (x + a)`. -/ def translate {F : Type*} (a : E) (f : E → F) : E → F := fun x => f (x + a) omit [CompleteSpace E] in lemma contDiff_translate {f : E → ℝ} (hf : ContDiff ℝ 1 f) (a : E) : ContDiff ℝ 1 (translate (E := E) a f) := by -- `x ↦ x + a` is `C^∞`; compose. exact hf.comp (contDiff_id.add contDiff_const) omit [InnerProductSpace ℝ E] [CompleteSpace E] in lemma hasCompactSupport_translate {F : Type*} [Zero F] {f : E → F} (hf : HasCompactSupport f) (a : E) : HasCompactSupport (translate (E := E) a f) := by exact hf.comp_homeomorph (Homeomorph.addRight a) omit [CompleteSpace E] in lemma mem_C1c_translate {f : E → ℝ} (hf : f ∈ C1c (E := E)) (a : E) : translate (E := E) a f ∈ C1c (E := E) := ⟨contDiff_translate (E := E) hf.1 a, hasCompactSupport_translate (E := E) hf.2 a⟩ end Topology section Measure variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceTranslation : MeasurableSpace E := borel E abbrev instBorelSpaceTranslation : let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceTranslation : let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E) let : BorelSpace E := instBorelSpaceTranslation (E := E) infer_instance abbrev instMeasurableAddTranslation : let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E) MeasurableAdd E := by let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E) let : BorelSpace E := instBorelSpaceTranslation (E := E) infer_instance variable (μ : @Measure E (instMeasurableSpaceTranslation (E := E))) [let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E); μ.IsAddRightInvariant] /- Translation on `L²` as a linear isometry, under an additive right-invariant measure. -/ noncomputable def translateL2 {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] (a : E) : let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E) let : BorelSpace E := instBorelSpaceTranslation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslation (E := E) let : MeasurableAdd E := instMeasurableAddTranslation (E := E) (E →₂[μ] F) →ₗᵢ[ℝ] (E →₂[μ] F) := by let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E) let : BorelSpace E := instBorelSpaceTranslation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslation (E := E) let : MeasurableAdd E := instMeasurableAddTranslation (E := E) classical simpa using (MeasureTheory.Lp.compMeasurePreservingₗᵢ (𝕜 := ℝ) (E := F) (p := (2 : ENNReal)) (μ := μ) (μb := μ) (f := fun x : E => x + a) (MeasureTheory.measurePreserving_add_right μ a)) omit [InnerProductSpace ℝ E] [CompleteSpace E] in lemma translateL2_ae_eq {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] (a : E) (g : E →₂[μ] F) : let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E) let : BorelSpace E := instBorelSpaceTranslation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslation (E := E) let : MeasurableAdd E := instMeasurableAddTranslation (E := E) (translateL2 (μ := μ) (F := F) a g : E → F) =ᵐ[μ] fun x => (g : E → F) (x + a) := by let : MeasurableSpace E := instMeasurableSpaceTranslation (E := E) let : BorelSpace E := instBorelSpaceTranslation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslation (E := E) let : MeasurableAdd E := instMeasurableAddTranslation (E := E) classical -- Reduce to `Lp.coeFn_compMeasurePreserving`. exact (MeasureTheory.Lp.coeFn_compMeasurePreserving (g := (g : MeasureTheory.Lp F (2 : ENNReal) μ)) (hf := MeasureTheory.measurePreserving_add_right μ a)) variable [IsFiniteMeasureOnCompacts μ] end Measure end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.TranslationEstimate /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.TranslationEstimate` Pointwise translation estimates for `C¹_c` functions on Euclidean spaces. This file provides the key analytic inequality used later in the Euclidean Rellich step: translation differences are controlled by the `L²`-gradient. At this stage we only prove *pointwise* inequalities along the segment `t ↦ x + t • a`. The measure-theoretic lifting to `L²` is tracked separately under `lean-103.5.2.26.5.3.2.3`. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean open scoped ENNReal MeasureTheory Topology open MeasureTheory Set section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceTranslationEstimate : MeasurableSpace E := borel E abbrev instBorelSpaceTranslationEstimate : let : MeasurableSpace E := instMeasurableSpaceTranslationEstimate (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceTranslationEstimate (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceTranslationEstimate : let : MeasurableSpace E := instMeasurableSpaceTranslationEstimate (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceTranslationEstimate (E := E) let : BorelSpace E := instBorelSpaceTranslationEstimate (E := E) infer_instance /- ## Derivative along a translated line -/ /- The affine line `t ↦ x + t • a`. -/ def line (x a : E) (t : ℝ) : E := x + t • a lemma hasDerivAt_line (x a : E) (t : ℝ) : HasDerivAt (line (x := x) (a := a)) a t := by -- `t ↦ t • a` has derivative `a`, and adding the constant `x` preserves the derivative. have hsmul : HasDerivAt (fun t : ℝ => t • a) a t := by simpa [one_smul] using (hasDerivAt_id t).smul_const a exact HasDerivAt.const_add x hsmul lemma hasDerivAt_comp_line {f : E → ℝ} (hf : ContDiff ℝ 1 f) (x a : E) (t : ℝ) : HasDerivAt (fun t => f (line (x := x) (a := a) t)) (fderiv ℝ f (line (x := x) (a := a) t) a) t := by have hf' : HasFDerivAt f (fderiv ℝ f (line (x := x) (a := a) t)) (line (x := x) (a := a) t) := (hf.differentiable one_ne_zero).differentiableAt.hasFDerivAt exact HasFDerivAt.comp_hasDerivAt_of_eq t hf' (hasDerivAt_line (x := x) (a := a) t) rfl lemma deriv_comp_line {f : E → ℝ} (hf : ContDiff ℝ 1 f) (x a : E) (t : ℝ) : deriv (fun t => f (line (x := x) (a := a) t)) t = fderiv ℝ f (line (x := x) (a := a) t) a := (hasDerivAt_comp_line (hf := hf) (x := x) (a := a) t).deriv /- ## Pointwise translation bound via the gradient -/ section variable [CompleteSpace E] lemma enorm_fderiv_apply_le_enorm_grad_mul (f : E → ℝ) (x a : E) : ‖fderiv ℝ f x a‖ₑ ≤ ‖grad (E := E) f x‖ₑ * ‖a‖ₑ := by -- Use the operator norm bound, then identify `‖fderiv‖` with `‖grad‖` via the Riesz isometry. have h₁ : ‖fderiv ℝ f x a‖ₑ ≤ ‖fderiv ℝ f x‖ₑ * ‖a‖ₑ := (ContinuousLinearMap.le_opENorm (f := fderiv ℝ f x) a) have h₂ : ‖grad (E := E) f x‖ₑ = ‖fderiv ℝ f x‖ₑ := by -- `grad f x = (toDual).symm (fderiv f x)` and `toDual.symm` is an isometry. simp only [grad] exact (LinearIsometry.enorm_map (f := (InnerProductSpace.toDual ℝ E).symm.toLinearIsometry) (fderiv ℝ f x)) -- Replace the operator norm by the gradient norm. simpa [h₂, mul_assoc, mul_left_comm, mul_comm] using h₁ lemma enorm_deriv_comp_line_le (x a : E) {f : E → ℝ} (hf : ContDiff ℝ 1 f) (t : ℝ) : ‖deriv (fun t => f (line (x := x) (a := a) t)) t‖ₑ ≤ ‖a‖ₑ * ‖grad (E := E) f (line (x := x) (a := a) t)‖ₑ := by -- Reduce to the `fderiv` bound. have := enorm_fderiv_apply_le_enorm_grad_mul (E := E) (f := f) (x := line (x := x) (a := a) t) (a := a) -- Rewrite `deriv` and commute the product. simpa [deriv_comp_line (hf := hf) (x := x) (a := a) t, mul_comm, mul_left_comm, mul_assoc] using this lemma enorm_sub_le_enorm_mul_lintegral_grad (x a : E) {f : E → ℝ} (hf : ContDiff ℝ 1 f) : ‖f (x + a) - f x‖ₑ ≤ ‖a‖ₑ * ∫⁻ t in Set.Icc (0 : ℝ) 1, ‖grad (E := E) f (x + t • a)‖ₑ := by let : MeasurableSpace E := instMeasurableSpaceTranslationEstimate (E := E) let : BorelSpace E := instBorelSpaceTranslationEstimate (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslationEstimate (E := E) -- Apply FTC along the segment `t ↦ x + t • a`, then bound the derivative pointwise. have hCont : ContDiffOn ℝ 1 (fun t : ℝ => f (x + t • a)) (Set.Icc (0 : ℝ) 1) := by -- `t ↦ x + t • a` is `C^∞`; compose with `f`. have hInner : ContDiff ℝ ⊤ (fun t : ℝ => x + t • a) := by simpa [line] using (contDiff_const.add (contDiff_id.smul (contDiff_const : ContDiff ℝ ⊤ (fun _ : ℝ => a)))) have hInner' : ContDiff ℝ 1 (fun t : ℝ => x + t • a) := hInner.of_le (by simp) exact (hf.comp hInner').contDiffOn have hFTC : ‖f (x + a) - f x‖ₑ ≤ ∫⁻ t in Set.Icc (0 : ℝ) 1, ‖deriv (fun t : ℝ => f (x + t • a)) t‖ₑ := by simpa using (enorm_sub_le_lintegral_deriv_of_contDiffOn_Icc (f := fun t : ℝ => f (x + t • a)) (a := (0 : ℝ)) (b := 1) hCont (by exact zero_le_one)) refine hFTC.trans ?_ have hDerivBound : (fun t : ℝ => ‖deriv (fun t : ℝ => f (x + t • a)) t‖ₑ) ≤ᵐ[Measure.restrict volume (Set.Icc (0 : ℝ) 1)] fun t : ℝ => ‖a‖ₑ * ‖grad (E := E) f (x + t • a)‖ₑ := by -- Pointwise bound holds everywhere. refine (ae_of_all _ fun t => ?_) -- `deriv` along `t ↦ x + t•a` is controlled by the gradient. simpa [line, mul_assoc, mul_left_comm, mul_comm] using (enorm_deriv_comp_line_le (x := x) (a := a) (f := f) hf (t := t)) -- Pull out the constant `‖a‖ₑ`. have : (∫⁻ t in Set.Icc (0 : ℝ) 1, ‖deriv (fun t : ℝ => f (x + t • a)) t‖ₑ) ≤ ∫⁻ t in Set.Icc (0 : ℝ) 1, ‖a‖ₑ * ‖grad (E := E) f (x + t • a)‖ₑ := by exact lintegral_mono_ae hDerivBound refine this.trans ?_ -- Pull out the constant factor. have hMeas : Measurable fun t : ℝ => ‖grad (E := E) f (x + t • a)‖ₑ := by -- `grad f` is continuous when `f` is `C¹`. have hgradCont : Continuous (grad (E := E) f) := continuous_grad (E := E) (f := f) (by -- `ContDiff` gives continuity of `grad`. exact hf) -- hence `t ↦ grad f (x + t•a)` is measurable; take `enorm`. exact (hgradCont.comp (by have : Continuous (fun t : ℝ => x + t • a) := by fun_prop exact this)).measurable.enorm -- Now finish: `∫⁻ t in Set.Icc, ‖a‖ * g t = ‖a‖ * ∫⁻ t in Set.Icc, g t`. exact le_of_eq <| by simpa [mul_assoc] using (MeasureTheory.lintegral_const_mul (μ := volume.restrict (Set.Icc (0 : ℝ) 1)) (r := ‖a‖ₑ) (f := fun t : ℝ => ‖grad (E := E) f (x + t • a)‖ₑ) hMeas) end end end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.TranslationEstimateL2 /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.TranslationEstimateL2` `L²` translation estimates for Euclidean `C¹_c` functions (and derived `H¹`) under invariant measures. This file lifts the pointwise fundamental-theorem-of-calculus bound from `Euclidean.TranslationEstimate` to an `L²` bound using Tonelli and the measure-preserving property of translations. ## Main results - `enorm_translateL2_sub_toL2_le`: for `f ∈ C¹_c`, `‖τ_a f - f‖₂ ≤ ‖a‖ · ‖∇f‖₂` (as an `ℝ≥0∞` inequality on `L²` norms), under a right-invariant measure. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean open scoped ENNReal MeasureTheory Topology open MeasureTheory Set noncomputable section section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceTranslationEstimateL2 : MeasurableSpace E := borel E abbrev instBorelSpaceTranslationEstimateL2 : let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceTranslationEstimateL2 : let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) let : BorelSpace E := instBorelSpaceTranslationEstimateL2 (E := E) infer_instance abbrev instMeasurableAddTranslationEstimateL2 : let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) MeasurableAdd E := by let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) let : BorelSpace E := instBorelSpaceTranslationEstimateL2 (E := E) infer_instance variable (μ : @Measure E (instMeasurableSpaceTranslationEstimateL2 (E := E))) [let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E); μ.IsAddRightInvariant] [let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E); IsFiniteMeasureOnCompacts μ] [let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E); SFinite μ] private abbrev μI : Measure ℝ := (volume.restrict (Set.Icc (0 : ℝ) 1)) private lemma holderConj_two_two : (2 : ℝ).HolderConjugate (2 : ℝ) := by refine (Real.holderConjugate_iff).2 ?_ constructor · linarith · norm_num private lemma lintegral_rpow_two_le_lintegral_rpow_two {g : ℝ → ℝ≥0∞} (hg : AEMeasurable g (μI : Measure ℝ)) : (∫⁻ t, g t ∂(μI : Measure ℝ)) ^ (2 : ℝ) ≤ ∫⁻ t, g t ^ (2 : ℝ) ∂(μI : Measure ℝ) := by -- Hölder with `g * 1` gives `∫ g ≤ (∫ g^2)^(1/2) * (∫ 1^2)^(1/2)`. have hHolder : (∫⁻ t, g t ∂(μI : Measure ℝ)) ≤ (∫⁻ t, g t ^ (2 : ℝ) ∂(μI : Measure ℝ)) ^ (1 / (2 : ℝ)) * (∫⁻ _t : ℝ, (1 : ℝ≥0∞) ^ (2 : ℝ) ∂(μI : Measure ℝ)) ^ (1 / (2 : ℝ)) := by simpa [Pi.mul_apply] using (ENNReal.lintegral_mul_le_Lp_mul_Lq (μ := (μI : Measure ℝ)) holderConj_two_two hg (aemeasurable_const : AEMeasurable (fun _t : ℝ => (1 : ℝ≥0∞)) (μI : Measure ℝ))) have h1 : (∫⁻ _t : ℝ, (1 : ℝ≥0∞) ^ (2 : ℝ) ∂(μI : Measure ℝ)) ^ (1 / (2 : ℝ)) = (1 : ℝ≥0∞) := by -- `μI` has total mass `1`, and `1^2 = 1`. simp have h : (∫⁻ t, g t ∂(μI : Measure ℝ)) ≤ (∫⁻ t, g t ^ (2 : ℝ) ∂(μI : Measure ℝ)) ^ (1 / (2 : ℝ)) := by simpa [h1, mul_one] using hHolder -- Raise to the power `2` and simplify `((A)^(1/2))^2 = A`. have h' := ENNReal.rpow_le_rpow h (show (0 : ℝ) ≤ (2 : ℝ) by norm_num) -- Rewrite the RHS using `rpow_mul`. simpa [ENNReal.rpow_mul] using (h'.trans_eq (by have : (1 / (2 : ℝ)) * (2 : ℝ) = (1 : ℝ) := by norm_num simpa [this] using (ENNReal.rpow_mul (∫⁻ t, g t ^ (2 : ℝ) ∂(μI : Measure ℝ)) (1 / (2 : ℝ)) (2 : ℝ)).symm)) omit [IsFiniteMeasureOnCompacts μ] in /- `L²` translation estimate for `C¹_c` functions under a right-invariant measure. -/ private lemma lintegral_enorm_sub_sq_le (a : E) (f : ↥(C1c (E := E))) : let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) let : BorelSpace E := instBorelSpaceTranslationEstimateL2 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslationEstimateL2 (E := E) let : MeasurableAdd E := instMeasurableAddTranslationEstimateL2 (E := E) (∫⁻ x, ‖f.1 (x + a) - f.1 x‖ₑ ^ (2 : ℝ) ∂μ) ≤ ‖a‖ₑ ^ (2 : ℝ) * (∫⁻ x, ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ) ∂μ) := by let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) let : BorelSpace E := instBorelSpaceTranslationEstimateL2 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslationEstimateL2 (E := E) let : MeasurableAdd E := instMeasurableAddTranslationEstimateL2 (E := E) -- Pointwise: Cauchy–Schwarz in `t`, then Tonelli in `(x,t)`. have hpt : ∀ x : E, ‖f.1 (x + a) - f.1 x‖ₑ ^ (2 : ℝ) ≤ ‖a‖ₑ ^ (2 : ℝ) * ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂(μI : Measure ℝ) := by intro x have h0 := enorm_sub_le_enorm_mul_lintegral_grad (E := E) (x := x) (a := a) (f := f.1) (hf := f.2.1) -- Square both sides and apply Cauchy–Schwarz in `t`. have h1 : ‖f.1 (x + a) - f.1 x‖ₑ ^ (2 : ℝ) ≤ (‖a‖ₑ * ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ∂(μI : Measure ℝ)) ^ (2 : ℝ) := by exact ENNReal.rpow_le_rpow h0 (by norm_num) have hcs : (∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ∂(μI : Measure ℝ)) ^ (2 : ℝ) ≤ ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂(μI : Measure ℝ) := by refine lintegral_rpow_two_le_lintegral_rpow_two (g := fun t : ℝ => ‖grad (E := E) f.1 (x + t • a)‖ₑ) ?_ -- measurability from continuity of `grad`. have hgrad : Continuous (grad (E := E) f.1) := continuous_grad (E := E) (f := f.1) f.2.1 have hline : Continuous fun t : ℝ => x + t • a := by fun_prop exact (hgrad.comp hline).measurable.enorm.aemeasurable -- Combine and rewrite. calc ‖f.1 (x + a) - f.1 x‖ₑ ^ (2 : ℝ) ≤ (‖a‖ₑ * ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ∂(μI : Measure ℝ)) ^ (2 : ℝ) := h1 _ = ‖a‖ₑ ^ (2 : ℝ) * (∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ∂(μI : Measure ℝ)) ^ (2 : ℝ) := by simpa using (ENNReal.mul_rpow_of_nonneg ‖a‖ₑ (∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ∂(μI : Measure ℝ)) (show (0 : ℝ) ≤ (2 : ℝ) by norm_num)) _ ≤ ‖a‖ₑ ^ (2 : ℝ) * ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂(μI : Measure ℝ) := by gcongr _ = ‖a‖ₑ ^ (2 : ℝ) * ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂(μI : Measure ℝ) := rfl -- Integrate over `x` and apply Tonelli to swap integrals. let F : E × ℝ → ℝ≥0∞ := fun z => ‖grad (E := E) f.1 (z.1 + z.2 • a)‖ₑ ^ (2 : ℝ) have hmeas : AEMeasurable F (μ.prod (μI : Measure ℝ)) := by have hgrad : Continuous (grad (E := E) f.1) := continuous_grad (E := E) (f := f.1) f.2.1 have hcont : Continuous fun z : E × ℝ => z.1 + z.2 • a := by fun_prop have hbase : Measurable fun z : E × ℝ => ‖grad (E := E) f.1 (z.1 + z.2 • a)‖ₑ := by exact (hgrad.comp hcont).measurable.enorm have hpow : Measurable fun r : ℝ≥0∞ => r ^ (2 : ℝ) := (ENNReal.continuous_rpow_const (y := (2 : ℝ))).measurable exact (hpow.comp hbase).aemeasurable have hTonelli : (∫⁻ x, ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂(μI : Measure ℝ) ∂μ) = ∫⁻ t, ∫⁻ x, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂μ ∂(μI : Measure ℝ) := by -- Tonelli in both orders, via the product measure. have hprod : (∫⁻ z, F z ∂μ.prod (μI : Measure ℝ)) = ∫⁻ x, ∫⁻ t, F (x, t) ∂(μI : Measure ℝ) ∂μ := MeasureTheory.lintegral_prod (μ := μ) (ν := (μI : Measure ℝ)) F hmeas have hprod_symm : (∫⁻ z, F z ∂μ.prod (μI : Measure ℝ)) = ∫⁻ t, ∫⁻ x, F (x, t) ∂μ ∂(μI : Measure ℝ) := MeasureTheory.lintegral_prod_symm (μ := μ) (ν := (μI : Measure ℝ)) F hmeas calc (∫⁻ x, ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂(μI : Measure ℝ) ∂μ) = ∫⁻ z, F z ∂μ.prod (μI : Measure ℝ) := by simpa [F] using hprod.symm _ = ∫⁻ t, ∫⁻ x, F (x, t) ∂μ ∂(μI : Measure ℝ) := hprod_symm _ = ∫⁻ t, ∫⁻ x, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂μ ∂(μI : Measure ℝ) := by simp [F] -- Now use measure-preserving translation in `x` and evaluate the `t`-integral. have hShift : (∫⁻ t, ∫⁻ x, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂μ ∂(μI : Measure ℝ)) = ∫⁻ t, (∫⁻ x, ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ) ∂μ) ∂(μI : Measure ℝ) := by refine MeasureTheory.lintegral_congr fun t => ?_ -- Change of variables `x ↦ x + t•a`. have hmeas' : Measurable fun x : E => ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ) := by have hgrad : Continuous (grad (E := E) f.1) := continuous_grad (E := E) (f := f.1) f.2.1 have hbase : Measurable fun x : E => ‖grad (E := E) f.1 x‖ₑ := hgrad.measurable.enorm have hpow : Measurable fun r : ℝ≥0∞ => r ^ (2 : ℝ) := (ENNReal.continuous_rpow_const (y := (2 : ℝ))).measurable exact hpow.comp hbase simpa [Function.comp, add_assoc] using (MeasureTheory.measurePreserving_add_right μ (t • a)).lintegral_comp (μ := μ) (ν := μ) (f := fun x : E => ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ)) hmeas' have hEval : (∫⁻ t, (∫⁻ x, ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ) ∂μ) ∂(μI : Measure ℝ)) = (∫⁻ x, ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ) ∂μ) := by -- `μI` has total mass `1`. simp [μI, Measure.restrict_apply, Real.volume_Icc] -- Put everything together. have hInt : (∫⁻ x, ‖f.1 (x + a) - f.1 x‖ₑ ^ (2 : ℝ) ∂μ) ≤ ‖a‖ₑ ^ (2 : ℝ) * (∫⁻ x, ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ) ∂μ) := by calc (∫⁻ x, ‖f.1 (x + a) - f.1 x‖ₑ ^ (2 : ℝ) ∂μ) ≤ ∫⁻ x, ‖a‖ₑ ^ (2 : ℝ) * ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂(μI : Measure ℝ) ∂μ := by refine MeasureTheory.lintegral_mono ?_ intro x exact hpt x _ = ‖a‖ₑ ^ (2 : ℝ) * (∫⁻ x, ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂(μI : Measure ℝ) ∂μ) := by -- Pull out the constant using `lintegral_const_mul''`. have hInner : AEMeasurable (fun x : E => ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂(μI : Measure ℝ)) μ := by -- Measurability of the inner integral follows -- from `hmeas` via -- `AEMeasurable.lintegral_prod_right'`. simpa [F] using (hmeas.lintegral_prod_right' (μ := μ) (ν := (μI : Measure ℝ))) simpa [mul_assoc] using (MeasureTheory.lintegral_const_mul'' (μ := μ) (r := ‖a‖ₑ ^ (2 : ℝ)) (f := fun x : E => ∫⁻ t, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂(μI : Measure ℝ)) hInner) _ = ‖a‖ₑ ^ (2 : ℝ) * (∫⁻ t, ∫⁻ x, ‖grad (E := E) f.1 (x + t • a)‖ₑ ^ (2 : ℝ) ∂μ ∂(μI : Measure ℝ)) := by exact congrArg (fun z => ‖a‖ₑ ^ (2 : ℝ) * z) hTonelli _ = ‖a‖ₑ ^ (2 : ℝ) * (∫⁻ t, (∫⁻ x, ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ) ∂μ) ∂(μI : Measure ℝ)) := by exact congrArg (fun z => ‖a‖ₑ ^ (2 : ℝ) * z) hShift _ = ‖a‖ₑ ^ (2 : ℝ) * (∫⁻ x, ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ) ∂μ) := by exact congrArg (fun z => ‖a‖ₑ ^ (2 : ℝ) * z) hEval exact hInt lemma enorm_translateL2_sub_toL2_le (a : E) (f : ↥(C1c (E := E))) : let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) let : BorelSpace E := instBorelSpaceTranslationEstimateL2 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslationEstimateL2 (E := E) let : MeasurableAdd E := instMeasurableAddTranslationEstimateL2 (E := E) ‖translateL2 (μ := μ) (F := ℝ) a (toL2 (μ := μ) (E := E) f) - toL2 (μ := μ) (E := E) f‖ₑ ≤ ‖a‖ₑ * ‖toL2Grad (μ := μ) (E := E) f‖ₑ := by let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) let : BorelSpace E := instBorelSpaceTranslationEstimateL2 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslationEstimateL2 (E := E) let : MeasurableAdd E := instMeasurableAddTranslationEstimateL2 (E := E) classical -- Reduce to an `eLpNorm` inequality on representatives. have hL2 : (‖translateL2 (μ := μ) (F := ℝ) a (toL2 (μ := μ) (E := E) f) - toL2 (μ := μ) (E := E) f‖ₑ : ℝ≥0∞) = MeasureTheory.eLpNorm (fun x : E => (f.1 (x + a) - f.1 x)) (2 : ℝ≥0∞) μ := by -- Both terms agree a.e. with the underlying pointwise translation. have h₁ : (translateL2 (μ := μ) (F := ℝ) a (toL2 (μ := μ) (E := E) f) : E → ℝ) =ᵐ[μ] fun x => f.1 (x + a) := by have hf : (toL2 (μ := μ) (E := E) f : E → ℝ) =ᵐ[μ] f.1 := (memLp_of_mem_C1c (μ := μ) (E := E) f.2).coeFn_toLp have hf' : (fun x => (toL2 (μ := μ) (E := E) f : E → ℝ) (x + a)) =ᵐ[μ] fun x => f.1 (x + a) := by exact (Measure.QuasiMeasurePreserving.ae_eq_comp (MeasureTheory.measurePreserving_add_right μ a).quasiMeasurePreserving hf) exact (translateL2_ae_eq (μ := μ) (F := ℝ) a (toL2 (μ := μ) (E := E) f)).trans hf' have h₂ : (toL2 (μ := μ) (E := E) f : E → ℝ) =ᵐ[μ] fun x => f.1 x := (memLp_of_mem_C1c (μ := μ) (E := E) f.2).coeFn_toLp have hsub : ((translateL2 (μ := μ) (F := ℝ) a (toL2 (μ := μ) (E := E) f) - toL2 (μ := μ) (E := E) f : E →₂[μ] ℝ) : E → ℝ) =ᵐ[μ] fun x => f.1 (x + a) - f.1 x := by filter_upwards [Lp.coeFn_sub (translateL2 (μ := μ) (F := ℝ) a (toL2 (μ := μ) (E := E) f)) (toL2 (μ := μ) (E := E) f), h₁, h₂] with x hxsub hx1 hx2 simpa [hx1, hx2, Pi.sub_apply] using hxsub -- Convert the `Lp` norm to `eLpNorm` and rewrite using a.e. equality. let d : E →₂[μ] ℝ := translateL2 (μ := μ) (F := ℝ) a (toL2 (μ := μ) (E := E) f) - toL2 (μ := μ) (E := E) f have hd0 : (‖d‖ₑ : ℝ≥0∞) = MeasureTheory.eLpNorm (fun x : E => (d : E → ℝ) x) (2 : ℝ≥0∞) μ := by simp [MeasureTheory.Lp.enorm_def] have hd1 : MeasureTheory.eLpNorm (fun x : E => (d : E → ℝ) x) (2 : ℝ≥0∞) μ = MeasureTheory.eLpNorm (fun x : E => f.1 (x + a) - f.1 x) (2 : ℝ≥0∞) μ := MeasureTheory.eLpNorm_congr_ae (μ := μ) (p := (2 : ℝ≥0∞)) (by simpa [d] using hsub) simpa [d] using hd0.trans hd1 have hGrad : (‖toL2Grad (μ := μ) (E := E) f‖ₑ : ℝ≥0∞) = MeasureTheory.eLpNorm (fun x : E => grad (E := E) f.1 x) (2 : ℝ≥0∞) μ := by have h₁ : (toL2Grad (μ := μ) (E := E) f : E → E) =ᵐ[μ] fun x => grad (E := E) f.1 x := (memLp_grad_of_mem_C1c (μ := μ) (E := E) f.2).coeFn_toLp have h0 : (‖toL2Grad (μ := μ) (E := E) f‖ₑ : ℝ≥0∞) = MeasureTheory.eLpNorm (fun x : E => (toL2Grad (μ := μ) (E := E) f : E → E) x) (2 : ℝ≥0∞) μ := by simp [MeasureTheory.Lp.enorm_def] have h1 : MeasureTheory.eLpNorm (fun x : E => (toL2Grad (μ := μ) (E := E) f : E → E) x) (2 : ℝ≥0∞) μ = MeasureTheory.eLpNorm (fun x : E => grad (E := E) f.1 x) (2 : ℝ≥0∞) μ := MeasureTheory.eLpNorm_congr_ae (μ := μ) (p := (2 : ℝ≥0∞)) h₁ exact h0.trans h1 -- Prove the `eLpNorm` inequality by squaring, using Tonelli and measure-preserving translation. have hCore : MeasureTheory.eLpNorm (fun x : E => f.1 (x + a) - f.1 x) (2 : ℝ≥0∞) μ ≤ ‖a‖ₑ * MeasureTheory.eLpNorm (fun x : E => grad (E := E) f.1 x) (2 : ℝ≥0∞) μ := by -- Expand the definition of `eLpNorm` at exponent `2`. have h2_ne0 : (2 : ℝ≥0∞) ≠ 0 := by simp have h2_netop : (2 : ℝ≥0∞) ≠ (⊤ : ℝ≥0∞) := by simp rw [MeasureTheory.eLpNorm_eq_lintegral_rpow_enorm_toReal (f := fun x : E => f.1 (x + a) - f.1 x) h2_ne0 h2_netop ((memLp_of_mem_C1c (μ := μ) (mem_C1c_translate f.2 a)).aestronglyMeasurable.sub (memLp_of_mem_C1c (μ := μ) f.2).aestronglyMeasurable), MeasureTheory.eLpNorm_eq_lintegral_rpow_enorm_toReal h2_ne0 h2_netop (memLp_grad_of_mem_C1c (μ := μ) f.2).aestronglyMeasurable, ENNReal.toReal_ofNat] -- It suffices to compare the squared integrals. have hsq := lintegral_enorm_sub_sq_le (μ := μ) a f -- Take the `1/2` power on both sides and simplify. have hsq' : (∫⁻ x, ‖f.1 (x + a) - f.1 x‖ₑ ^ (2 : ℝ) ∂μ) ^ (1 / (2 : ℝ)) ≤ (‖a‖ₑ ^ (2 : ℝ) * ∫⁻ x, ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ) ∂μ) ^ (1 / (2 : ℝ)) := by exact ENNReal.rpow_le_rpow hsq (by norm_num) -- Rewrite the RHS as `‖a‖ * (...)^(1/2)`. have hsq'' : (∫⁻ x, ‖f.1 (x + a) - f.1 x‖ₑ ^ (2 : ℝ) ∂μ) ^ (1 / (2 : ℝ)) ≤ (‖a‖ₑ ^ (2 : ℝ)) ^ (1 / (2 : ℝ)) * (∫⁻ x, ‖grad (E := E) f.1 x‖ₑ ^ (2 : ℝ) ∂μ) ^ (1 / (2 : ℝ)) := by simpa [ENNReal.mul_rpow_of_nonneg, show (0 : ℝ) ≤ (1 / (2 : ℝ)) by nlinarith, mul_assoc, mul_left_comm, mul_comm] using hsq' have hroot : (‖a‖ₑ ^ (2 : ℕ)) ^ ((2 : ℝ)⁻¹) = ‖a‖ₑ := by -- `(x^2)^(1/2) = x` in `ℝ≥0∞`, accounting for simp-normalization of `2` and `1/2`. have hnat : (‖a‖ₑ ^ (2 : ℕ)) = ‖a‖ₑ ^ (2 : ℝ) := by simp calc (‖a‖ₑ ^ (2 : ℕ)) ^ ((2 : ℝ)⁻¹) = (‖a‖ₑ ^ (2 : ℝ)) ^ ((2 : ℝ)⁻¹) := congrArg (fun r : ℝ≥0∞ => r ^ ((2 : ℝ)⁻¹)) hnat _ = ‖a‖ₑ := by have := (ENNReal.rpow_mul ‖a‖ₑ (2 : ℝ) ((2 : ℝ)⁻¹)).symm have hmul : (2 : ℝ) * ((2 : ℝ)⁻¹) = (1 : ℝ) := by norm_num simpa [hmul, ENNReal.rpow_one] using this simpa [hroot, mul_assoc, mul_left_comm, mul_comm] using hsq'' -- Finish: translate back to the original `L²` norms. -- (The final `simp` is safe since we have explicit `eLpNorm` equalities above.) simpa [hL2, hGrad] using hCore /- Real-norm form of `enorm_translateL2_sub_toL2_le`. -/ lemma norm_translateL2_sub_toL2_le (a : E) (f : ↥(C1c (E := E))) : let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) let : BorelSpace E := instBorelSpaceTranslationEstimateL2 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslationEstimateL2 (E := E) let : MeasurableAdd E := instMeasurableAddTranslationEstimateL2 (E := E) ‖translateL2 (μ := μ) (F := ℝ) a (toL2 (μ := μ) (E := E) f) - toL2 (μ := μ) (E := E) f‖ ≤ ‖a‖ * ‖toL2Grad (μ := μ) (E := E) f‖ := by let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateL2 (E := E) let : BorelSpace E := instBorelSpaceTranslationEstimateL2 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceTranslationEstimateL2 (E := E) let : MeasurableAdd E := instMeasurableAddTranslationEstimateL2 (E := E) have h := enorm_translateL2_sub_toL2_le (μ := μ) (E := E) a f have hA_ne_top : (‖translateL2 (μ := μ) (F := ℝ) a (toL2 (μ := μ) (E := E) f) - toL2 (μ := μ) (E := E) f‖ₑ : ℝ≥0∞) ≠ (⊤ : ℝ≥0∞) := by simp [enorm] have hGrad_ne_top : (‖toL2Grad (μ := μ) (E := E) f‖ₑ : ℝ≥0∞) ≠ (⊤ : ℝ≥0∞) := by simp [enorm] have hB_ne_top : (‖a‖ₑ * ‖toL2Grad (μ := μ) (E := E) f‖ₑ : ℝ≥0∞) ≠ (⊤ : ℝ≥0∞) := by refine ENNReal.mul_ne_top ?_ hGrad_ne_top simp [enorm] have h' : (‖translateL2 (μ := μ) (F := ℝ) a (toL2 (μ := μ) (E := E) f) - toL2 (μ := μ) (E := E) f‖ₑ).toReal ≤ (‖a‖ₑ * ‖toL2Grad (μ := μ) (E := E) f‖ₑ).toReal := by exact (ENNReal.toReal_le_toReal hA_ne_top hB_ne_top).2 h simpa only [ENNReal.toReal_mul, toReal_enorm] using h' end end end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.TranslationEstimateH1 /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.TranslationEstimateH1` Extend Euclidean `L²` translation estimates from `C¹_c` to the closure-based Euclidean `H¹` space. ## Main results - `norm_translateL2_sub_h1ToL2_le`: for `u ∈ H¹`, `‖τ_a u - u‖₂ ≤ ‖a‖ · ‖∇u‖₂`, where `∇u` is the `L²(E)` component in our `H¹ ⊆ L² × L²(E)` model. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean open scoped ENNReal MeasureTheory Topology open MeasureTheory Set noncomputable section section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceTranslationEstimateH1 : MeasurableSpace E := borel E variable (μ : @Measure E (instMeasurableSpaceTranslationEstimateH1 (E := E))) [let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateH1 (E := E); μ.IsAddRightInvariant] [let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateH1 (E := E); IsFiniteMeasureOnCompacts μ] [let : MeasurableSpace E := instMeasurableSpaceTranslationEstimateH1 (E := E); SFinite μ] end end end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.MeasureTheory.Function.LpSpace.Restrict /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `RellichKondrachov.MeasureTheory.Function.LpSpace.Restrict` `«L»^p` extension-by-zero maps for restricted measures. Mathlib provides the equivalence `MemLp (s.indicator f) p μ ↔ MemLp f p (μ.restrict s)` (`MeasureTheory.memLp_indicator_iff_restrict`). This file packages the corresponding map on `Lp` spaces: `Lp E p (μ.restrict s) →ₗᵢ[ℝ] Lp E p μ`, given by extension-by-zero (via `Set.indicator`). ## Main definitions - `MeasureTheory.Lp.extendByZeroₗ` - `MeasureTheory.Lp.extendByZeroₗᵢ` -/ namespace MeasureTheory open scoped ENNReal namespace Lp noncomputable section variable {α : Type*} [MeasurableSpace α] {μ : Measure α} variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] variable {p : ℝ≥0∞} [Fact (1 ≤ p)] variable {s : Set α} (hs : MeasurableSet s) /- Extend an Lp function from a restricted measure by zero outside the set. -/ noncomputable def extendByZeroFun (f : Lp E p (μ.restrict s)) : Lp E p μ := let hf : MemLp (fun x : α => f x) p (μ.restrict s) := Lp.memLp f let hfi : MemLp (s.indicator fun x : α => f x) p μ := (memLp_indicator_iff_restrict (μ := μ) (p := p) (s := s) (f := fun x : α => f x) hs).2 hf hfi.toLp (s.indicator fun x : α => f x) omit [NormedSpace ℝ E] [Fact (1 ≤ p)] in private lemma extendByZeroFun_coe (f : Lp E p (μ.restrict s)) : extendByZeroFun (μ := μ) (p := p) (s := s) hs f =ᵐ[μ] s.indicator fun x : α => f x := by dsimp [extendByZeroFun] exact MemLp.coeFn_toLp _ /- Extension-by-zero as a linear map `Lp E p (μ.restrict s) →ₗ[ℝ] Lp E p μ`. -/ noncomputable def extendByZeroₗ : Lp E p (μ.restrict s) →ₗ[ℝ] Lp E p μ where toFun := extendByZeroFun (μ := μ) (p := p) (s := s) hs map_add' f g := by classical -- Prove equality by comparing pointwise representatives. refine Lp.ext ?_ have h_add_restrict : (fun x : α => (f + g) x) =ᵐ[μ.restrict s] fun x : α => f x + g x := by exact (Lp.coeFn_add (μ := μ.restrict s) f g) have h_add_on : ∀ᵐ x : α ∂μ, x ∈ s → (f + g) x = f x + g x := (ae_restrict_iff' (μ := μ) (s := s) hs).1 h_add_restrict filter_upwards [ extendByZeroFun_coe (μ := μ) (p := p) (s := s) hs (f + g) , extendByZeroFun_coe (μ := μ) (p := p) (s := s) hs f , extendByZeroFun_coe (μ := μ) (p := p) (s := s) hs g , coeFn_add (extendByZeroFun (μ := μ) (p := p) (s := s) hs f) (extendByZeroFun (μ := μ) (p := p) (s := s) hs g) , h_add_on ] with x hfg hf hg hadd hsum by_cases hx : x ∈ s · have hsum' := hsum hx have hadd' : extendByZeroFun (μ := μ) (p := p) (s := s) hs f x + extendByZeroFun (μ := μ) (p := p) (s := s) hs g x = (extendByZeroFun (μ := μ) (p := p) (s := s) hs f + extendByZeroFun (μ := μ) (p := p) (s := s) hs g) x := by simpa [Pi.add_apply] using hadd.symm calc extendByZeroFun (μ := μ) (p := p) (s := s) hs (f + g) x = s.indicator (fun x : α => (f + g) x) x := hfg _ = (f + g) x := by simp [Set.indicator_of_mem, hx] _ = f x + g x := hsum' _ = s.indicator (fun x : α => f x) x + s.indicator (fun x : α => g x) x := by simp [Set.indicator_of_mem, hx] _ = extendByZeroFun (μ := μ) (p := p) (s := s) hs f x + extendByZeroFun (μ := μ) (p := p) (s := s) hs g x := by simp [hf, hg] _ = (extendByZeroFun (μ := μ) (p := p) (s := s) hs f + extendByZeroFun (μ := μ) (p := p) (s := s) hs g) x := hadd' · have hadd' : extendByZeroFun (μ := μ) (p := p) (s := s) hs f x + extendByZeroFun (μ := μ) (p := p) (s := s) hs g x = (extendByZeroFun (μ := μ) (p := p) (s := s) hs f + extendByZeroFun (μ := μ) (p := p) (s := s) hs g) x := by simpa [Pi.add_apply] using hadd.symm calc extendByZeroFun (μ := μ) (p := p) (s := s) hs (f + g) x = s.indicator (fun x : α => (f + g) x) x := hfg _ = 0 := by simp [Set.indicator_of_notMem, hx] _ = extendByZeroFun (μ := μ) (p := p) (s := s) hs f x + extendByZeroFun (μ := μ) (p := p) (s := s) hs g x := by -- both summands are zero off `s` simp [Set.indicator_of_notMem, hx, hf, hg] _ = (extendByZeroFun (μ := μ) (p := p) (s := s) hs f + extendByZeroFun (μ := μ) (p := p) (s := s) hs g) x := hadd' map_smul' c f := by classical refine Lp.ext ?_ have h_smul_restrict : (fun x : α => (c • f) x) =ᵐ[μ.restrict s] fun x : α => c • f x := by exact (Lp.coeFn_smul (μ := μ.restrict s) c f) have h_smul_on : ∀ᵐ x : α ∂μ, x ∈ s → (c • f) x = c • f x := (ae_restrict_iff' (μ := μ) (s := s) hs).1 h_smul_restrict filter_upwards [ extendByZeroFun_coe (μ := μ) (p := p) (s := s) hs (c • f) , extendByZeroFun_coe (μ := μ) (p := p) (s := s) hs f , coeFn_smul c (extendByZeroFun (μ := μ) (p := p) (s := s) hs f) , h_smul_on ] with x hcf hf hsmul hsum by_cases hx : x ∈ s · have hsum' := hsum hx have hsmul' : c • extendByZeroFun (μ := μ) (p := p) (s := s) hs f x = (c • extendByZeroFun (μ := μ) (p := p) (s := s) hs f) x := by simpa [Pi.smul_apply] using hsmul.symm calc extendByZeroFun (μ := μ) (p := p) (s := s) hs (c • f) x = s.indicator (fun x : α => (c • f) x) x := hcf _ = (c • f) x := by simp [Set.indicator_of_mem, hx] _ = c • f x := hsum' _ = c • s.indicator (fun x : α => f x) x := by simp [Set.indicator_of_mem, hx] _ = c • extendByZeroFun (μ := μ) (p := p) (s := s) hs f x := by simp [hf] _ = (c • extendByZeroFun (μ := μ) (p := p) (s := s) hs f) x := hsmul' · have hsmul' : c • extendByZeroFun (μ := μ) (p := p) (s := s) hs f x = (c • extendByZeroFun (μ := μ) (p := p) (s := s) hs f) x := by simpa [Pi.smul_apply] using hsmul.symm calc extendByZeroFun (μ := μ) (p := p) (s := s) hs (c • f) x = s.indicator (fun x : α => (c • f) x) x := hcf _ = 0 := by simp [Set.indicator_of_notMem, hx] _ = (c • extendByZeroFun (μ := μ) (p := p) (s := s) hs f) x := by have hf0 : extendByZeroFun (μ := μ) (p := p) (s := s) hs f x = 0 := by simpa [Set.indicator_of_notMem, hx] using hf have hcx : (c • extendByZeroFun (μ := μ) (p := p) (s := s) hs f) x = 0 := by calc (c • extendByZeroFun (μ := μ) (p := p) (s := s) hs f) x = c • extendByZeroFun (μ := μ) (p := p) (s := s) hs f x := by simpa [Pi.smul_apply] using hsmul _ = 0 := by simp [hf0] simpa using hcx.symm /- Extension-by-zero as a linear isometry. -/ noncomputable def extendByZeroₗᵢ : Lp E p (μ.restrict s) →ₗᵢ[ℝ] Lp E p μ where toLinearMap := extendByZeroₗ (μ := μ) (p := p) (s := s) hs norm_map' f := by classical -- Unfold into `MemLp.toLp` and reduce to `eLpNorm_indicator_eq_eLpNorm_restrict`. have hfi : MemLp (s.indicator fun x : α => f x) p μ := (memLp_indicator_iff_restrict (μ := μ) (p := p) (s := s) (f := fun x : α => f x) hs).2 (Lp.memLp f) -- Norm in the codomain is the `eLpNorm` of the indicator. have hnorm_out : ‖extendByZeroₗ (μ := μ) (p := p) (s := s) hs f‖ = ENNReal.toReal (eLpNorm (s.indicator fun x : α => f x) p μ) := by dsimp [extendByZeroₗ, extendByZeroFun] simp [norm_toLp (f := s.indicator (fun x : α => f x)) hfi] -- Rewrite the `eLpNorm` of the indicator as a restricted `eLpNorm`. have hnorm_restrict : eLpNorm (s.indicator fun x : α => f x) p μ = eLpNorm (fun x : α => f x) p (μ.restrict s) := by simpa using (eLpNorm_indicator_eq_eLpNorm_restrict (μ := μ) (p := p) (s := s) (f := fun x : α => f x) hs) -- Combine with the definition of the `Lp` norm on the restricted space. simp [hnorm_out, hnorm_restrict, norm_def] lemma extendByZeroₗᵢ_ae_eq (f : Lp E p (μ.restrict s)) : ((extendByZeroₗᵢ (μ := μ) (p := p) (s := s) hs) f : α → E) =ᵐ[μ] s.indicator fun x : α => f x := by -- Unfold to the underlying `extendByZeroFun` and use the defining AE equality. simpa [extendByZeroₗᵢ, extendByZeroₗ] using (extendByZeroFun_coe (μ := μ) (p := p) (s := s) hs f) end end Lp end MeasureTheory end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.Smoothing /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `L²` compactness criterion: smoothing setup (Euclidean) This file provides the basic “extend by zero + smooth by convolution” infrastructure used in the Fréchet–Kolmogorov / Riesz–Kolmogorov approach to Euclidean Rellich–Kondrachov. ## Main results - `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.extendByZeroL2`: extend `u : L²(volume.restrict K)` by zero to an element of `L²(volume)`. - `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.smoothL2`: a smoothing operator obtained by convolution with a compactly supported continuous kernel `ψ`. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean namespace L2Compactness open scoped ENNReal MeasureTheory Topology Convolution Pointwise open MeasureTheory Set noncomputable section section variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] omit [InnerProductSpace ℝ E] [CompleteSpace E] in private lemma tsupport_indicator_subset_closure (s : Set E) (f : E → ℝ) : tsupport (s.indicator f) ⊆ closure s := by -- `Function.support (s.indicator f) ⊆ s`, hence the topological support is contained in -- `closure s`. simpa [tsupport] using closure_mono (Set.support_indicator_subset (s := s) (f := f)) omit [InnerProductSpace ℝ E] [CompleteSpace E] in private lemma hasCompactSupport_indicator_of_isCompact (s : Set E) (hs : IsCompact s) (f : E → ℝ) : HasCompactSupport (s.indicator f) := by have hs_closed : IsClosed s := hs.isClosed -- `tsupport (s.indicator f)` is closed and contained in the compact set `s`. refine hs.of_isClosed_subset (isClosed_tsupport _) ?_ have : tsupport (s.indicator f) ⊆ closure s := tsupport_indicator_subset_closure (E := E) s f simpa [hs_closed.closure_eq] using this end section Volume variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] -- `volume` is the canonical Haar measure on finite-dimensional real vector spaces. /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceSmoothing1 : MeasurableSpace E := borel E abbrev instBorelSpaceSmoothing1 : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceSmoothing1 : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) infer_instance abbrev instMeasurableAddSmoothing1 : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) MeasurableAdd E := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) infer_instance variable {K : Set E} /- Extend an `L²` function on `K` by zero to a pointwise function on the ambient space. -/ def extendByZeroFun (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) E → ℝ := let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) K.indicator fun x : E => u x lemma hasCompactSupport_extendByZeroFun (hK : IsCompact K) (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) HasCompactSupport (extendByZeroFun (K := K) u) := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) classical -- The indicator is pointwise supported in `K`. simpa [extendByZeroFun] using (hasCompactSupport_indicator_of_isCompact (E := E) (s := K) hK (f := fun x => u x)) /- `extendByZeroFun` packaged as an element of `L²(volume)`. -/ noncomputable def extendByZeroL2 (hKm : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasurableSet K) (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) (E →₂[(volume : Measure E)] ℝ) := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) classical have hu : MeasureTheory.MemLp (fun x : E => u x) (2 : ℝ≥0∞) (volume.restrict K) := MeasureTheory.Lp.memLp u have hm : MeasureTheory.MemLp (extendByZeroFun (K := K) u) (2 : ℝ≥0∞) (volume : Measure E) := by simpa [extendByZeroFun] using (MeasureTheory.memLp_indicator_iff_restrict (μ := (volume : Measure E)) (p := (2 : ℝ≥0∞)) (s := K) (f := fun x : E => u x) hKm).2 hu exact hm.toLp (extendByZeroFun (K := K) u) lemma extendByZeroL2_ae_eq (hKm : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasurableSet K) (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) (extendByZeroL2 (E := E) (K := K) hKm u : E → ℝ) =ᵐ[(volume : Measure E)] extendByZeroFun (E := E) (K := K) u := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) classical simp [extendByZeroL2, MeasureTheory.MemLp.coeFn_toLp] lemma extendByZeroL2_eq_extendByZeroₗᵢ (hKm : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasurableSet K) (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) extendByZeroL2 (E := E) (K := K) hKm u = (MeasureTheory.Lp.extendByZeroₗᵢ (μ := (volume : Measure E)) (E := ℝ) (p := (2 : ℝ≥0∞)) (s := K) hKm) u := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) classical let : Fact (1 ≤ (2 : ℝ≥0∞)) := ⟨by norm_num⟩ refine MeasureTheory.Lp.ext ?_ have h1 : (extendByZeroL2 (E := E) (K := K) hKm u : E → ℝ) =ᵐ[(volume : Measure E)] extendByZeroFun (E := E) (K := K) u := extendByZeroL2_ae_eq (E := E) (K := K) hKm u have h2 : ((MeasureTheory.Lp.extendByZeroₗᵢ (μ := (volume : Measure E)) (E := ℝ) (p := (2 : ℝ≥0∞)) (s := K) hKm) u : E → ℝ) =ᵐ[(volume : Measure E)] extendByZeroFun (E := E) (K := K) u := by exact (MeasureTheory.Lp.extendByZeroₗᵢ_ae_eq (μ := (volume : Measure E)) (E := ℝ) (p := (2 : ℝ≥0∞)) (s := K) hKm u) exact h1.trans h2.symm lemma norm_extendByZeroL2 (hKm : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasurableSet K) (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) ‖extendByZeroL2 (E := E) (K := K) hKm u‖ = ‖u‖ := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) classical let : Fact (1 ≤ (2 : ℝ≥0∞)) := ⟨by norm_num⟩ calc ‖extendByZeroL2 (E := E) (K := K) hKm u‖ = ‖(MeasureTheory.Lp.extendByZeroₗᵢ (μ := (volume : Measure E)) (E := ℝ) (p := (2 : ℝ≥0∞)) (s := K) hKm) u‖ := by simp [extendByZeroL2_eq_extendByZeroₗᵢ (E := E) (K := K) hKm u] _ = ‖u‖ := (MeasureTheory.Lp.extendByZeroₗᵢ (μ := (volume : Measure E)) (E := ℝ) (p := (2 : ℝ≥0∞)) (s := K) hKm).norm_map u variable (ψ : E → ℝ) /- Smoothing by convolution with a fixed kernel `ψ`, applied to the zero-extension from `K`. -/ def smoothFun (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) E → ℝ := let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) (extendByZeroFun (K := K) u) ⋆[ContinuousLinearMap.lsmul ℝ ℝ, (volume : Measure E)] ψ lemma continuous_smoothFun (hKm : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) Continuous (smoothFun (K := K) ψ u) := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) -- `extendByZeroFun u` is `L²`, hence locally integrable; convolution with a compactly supported -- continuous kernel is continuous. have hf_memLp : MeasureTheory.MemLp (extendByZeroFun (K := K) u) (2 : ℝ≥0∞) (volume : Measure E) := by have hu : MeasureTheory.MemLp (fun x : E => u x) (2 : ℝ≥0∞) (volume.restrict K) := MeasureTheory.Lp.memLp u simpa [extendByZeroFun] using (MeasureTheory.memLp_indicator_iff_restrict (μ := (volume : Measure E)) (p := (2 : ℝ≥0∞)) (s := K) (f := fun x : E => u x) hKm).2 hu have hf_loc : MeasureTheory.LocallyIntegrable (extendByZeroFun (K := K) u) (volume : Measure E) := by have h12 : (1 : ℝ≥0∞) ≤ (2 : ℝ≥0∞) := by norm_num exact hf_memLp.locallyIntegrable h12 simpa [smoothFun] using (hψcs.continuous_convolution_right («L» := ContinuousLinearMap.lsmul ℝ ℝ) (μ := (volume : Measure E)) hf_loc hψc) lemma hasCompactSupport_smoothFun (hK : IsCompact K) (hψcs : HasCompactSupport ψ) (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) HasCompactSupport (smoothFun (K := K) ψ u) := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) have hf : HasCompactSupport (extendByZeroFun (K := K) u) := hasCompactSupport_extendByZeroFun (K := K) hK u simpa [smoothFun] using (hf.convolution («L» := ContinuousLinearMap.lsmul ℝ ℝ) (μ := (volume : Measure E)) hψcs) lemma support_smoothFun_subset_add_tsupport (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) Function.support (smoothFun (E := E) (K := K) ψ u) ⊆ K + tsupport ψ := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) classical have hsupp : Function.support (smoothFun (E := E) (K := K) ψ u) ⊆ Function.support (extendByZeroFun (E := E) (K := K) u) + Function.support ψ := by simpa [smoothFun] using (support_convolution_subset («L» := ContinuousLinearMap.lsmul ℝ ℝ) (μ := (volume : Measure E)) (f := extendByZeroFun (E := E) (K := K) u) (g := ψ)) have h1 : Function.support (extendByZeroFun (E := E) (K := K) u) ⊆ K := by simp [extendByZeroFun] have h2 : Function.support ψ ⊆ tsupport ψ := by simpa [tsupport] using (subset_closure : Function.support ψ ⊆ closure (Function.support ψ)) exact hsupp.trans (add_subset_add h1 h2) /- `smoothFun` packaged as an element of `L²(volume)`. -/ noncomputable def smoothL2 (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) (E →₂[(volume : Measure E)] ℝ) := let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) let hs : HasCompactSupport (smoothFun (K := K) ψ u) := hasCompactSupport_smoothFun (K := K) ψ hK hψcs u let hm : MeasureTheory.MemLp (smoothFun (K := K) ψ u) (2 : ℝ≥0∞) (volume : Measure E) := by have hc : Continuous (smoothFun (K := K) ψ u) := continuous_smoothFun (K := K) ψ hKm hψc hψcs u exact hc.memLp_of_hasCompactSupport (μ := (volume : Measure E)) hs hm.toLp (smoothFun (K := K) ψ u) lemma smoothL2_ae_eq (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (u : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E); let : BorelSpace E := instBorelSpaceSmoothing1 (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E); let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u : E → ℝ) =ᵐ[(volume : Measure E)] smoothFun (E := E) (K := K) ψ u := by let : MeasurableSpace E := instMeasurableSpaceSmoothing1 (E := E) let : BorelSpace E := instBorelSpaceSmoothing1 (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceSmoothing1 (E := E) let : MeasurableAdd E := instMeasurableAddSmoothing1 (E := E) classical simp [smoothL2, MeasureTheory.MemLp.coeFn_toLp] end Volume end end L2Compactness end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.Approximation /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `L²` compactness criterion: approximation-by-translation bounds (Euclidean) This file will prove the key inequality used in the Fréchet–Kolmogorov approach: smoothing by a probability kernel controls the `L²` error by the translation modulus. ## Main results (planned) The principal statement will control `‖smoothL2 ψ u - extendByZeroL2 u‖₂` by an average (or sup) of `‖translateL2 t (extendByZeroL2 u) - extendByZeroL2 u‖₂` over `t` in the support of `ψ`. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean namespace L2Compactness open scoped ENNReal MeasureTheory Topology Convolution open MeasureTheory Set noncomputable section section Volume variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceApproximation : MeasurableSpace E := borel E abbrev instBorelSpaceApproximation : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceApproximation : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) infer_instance abbrev instMeasurableAddApproximation : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) MeasurableAdd E := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) infer_instance abbrev instMeasurableNegApproximation : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) MeasurableNeg E := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) infer_instance variable {K : Set E} (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); MeasurableSet K) variable (ψ : E → ℝ) /- The measure with density `ψ` with respect to Lebesgue measure. This will be a probability measure once `ψ ≥ 0` and `∫ ψ = 1`. -/ noncomputable def kernelMeasure : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) Measure E := let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) (volume : Measure E).withDensity fun x => ENNReal.ofReal (ψ x) lemma kernelMeasure_univ (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (hψ0 : ∀ x, 0 ≤ ψ x) (hψint : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); ∫ x, ψ x ∂(volume : Measure E) = 1) : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) kernelMeasure (E := E) ψ Set.univ = 1 := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) have hψi : MeasureTheory.Integrable ψ (volume : Measure E) := Continuous.integrable_of_hasCompactSupport (μ := (volume : Measure E)) hψc hψcs have hψae : (MeasureTheory.ae (volume : Measure E)).EventuallyLE 0 ψ := Filter.Eventually.of_forall hψ0 have hlin : (∫⁻ x, ENNReal.ofReal (ψ x) ∂(volume : Measure E)) = ENNReal.ofReal (∫ x, ψ x ∂(volume : Measure E)) := by symm exact MeasureTheory.ofReal_integral_eq_lintegral_ofReal hψi hψae -- `withDensity` on `univ` is the `lintegral` of the density. have hwd : kernelMeasure (E := E) ψ Set.univ = ∫⁻ x, ENNReal.ofReal (ψ x) ∂(volume : Measure E) := by simp [kernelMeasure, MeasureTheory.withDensity_apply, MeasurableSet.univ] -- Conclude using `∫ ψ = 1`. simpa [hψint] using (hwd.trans hlin) /- The kernel measure `kernelMeasure ψ` is a probability measure when `ψ` is a continuous, compactly supported, nonnegative density integrating to `1`. -/ lemma isProbabilityMeasure_kernelMeasure (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (hψ0 : ∀ x, 0 ≤ ψ x) (hψint : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); ∫ x, ψ x ∂(volume : Measure E) = 1) : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) MeasureTheory.IsProbabilityMeasure (kernelMeasure (E := E) ψ) := let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) ⟨kernelMeasure_univ (E := E) (ψ := ψ) hψc hψcs hψ0 hψint⟩ lemma integral_kernelMeasure_eq_integral_smul (hψc : Continuous ψ) (hψ0 : ∀ x, 0 ≤ ψ x) (g : E → ℝ) : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) (∫ x, g x ∂kernelMeasure (E := E) ψ) = ∫ x, (ψ x) • (g x) ∂(volume : Measure E) := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) have hmeas : Measurable fun x => ENNReal.ofReal (ψ x) := (hψc.measurable.ennreal_ofReal : Measurable fun x => ENNReal.ofReal (ψ x)) have htop : (MeasureTheory.ae (volume : Measure E)).Eventually (fun x => ENNReal.ofReal (ψ x) < (⊤ : ℝ≥0∞)) := Filter.Eventually.of_forall (fun _ => by simp) have hwd := (integral_withDensity_eq_integral_toReal_smul (μ := (volume : Measure E)) (f := fun x => ENNReal.ofReal (ψ x)) hmeas htop g) have hwd' : (∫ x, g x ∂kernelMeasure (E := E) ψ) = ∫ x, (ENNReal.ofReal (ψ x)).toReal • (g x) ∂(volume : Measure E) := by simpa [kernelMeasure] using hwd -- Simplify `toReal (ofReal _)` using `ψ ≥ 0`. refine hwd'.trans ?_ refine integral_congr_ae ?_ refine ae_of_all _ (fun x => ?_) have hx : (ENNReal.ofReal (ψ x)).toReal = ψ x := ENNReal.toReal_ofReal (hψ0 x) -- After rewriting `toReal (ofReal _)`, both sides are definitional. simp [hx] lemma integral_kernelMeasure_eq_integral_mul (hψc : Continuous ψ) (hψ0 : ∀ x, 0 ≤ ψ x) (g : E → ℝ) : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) (∫ x, g x ∂kernelMeasure (E := E) ψ) = ∫ x, (ψ x) * (g x) ∂(volume : Measure E) := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) simpa [smul_eq_mul] using integral_kernelMeasure_eq_integral_smul (E := E) (ψ := ψ) hψc hψ0 g lemma smoothFun_eq_integral_kernelMeasure (hψc : Continuous ψ) (hψ0 : ∀ x, 0 ≤ ψ x) (u : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) (x : E) : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) smoothFun (E := E) (K := K) ψ u x = ∫ t, extendByZeroFun (E := E) (K := K) u (x - t) ∂kernelMeasure (E := E) ψ := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) have hconv : smoothFun (E := E) (K := K) ψ u x = ∫ t, (extendByZeroFun (E := E) (K := K) u) (x - t) • (ψ t) ∂(volume : Measure E) := by simp [smoothFun, convolution_lsmul_swap] have hconv' : smoothFun (E := E) (K := K) ψ u x = ∫ t, (ψ t) * extendByZeroFun (E := E) (K := K) u (x - t) ∂(volume : Measure E) := by refine hconv.trans ?_ refine integral_congr_ae ?_ refine ae_of_all _ (fun t => ?_) -- In `ℝ`, scalar multiplication is multiplication, so we can commute the factors. change extendByZeroFun (E := E) (K := K) u (x - t) • ψ t = ψ t * extendByZeroFun (E := E) (K := K) u (x - t) rw [smul_eq_mul] simp [mul_comm] -- Rewrite the convolution integral as an integral against the density measure. have hwd : (∫ t, extendByZeroFun (E := E) (K := K) u (x - t) ∂kernelMeasure (E := E) ψ) = ∫ t, (ψ t) * extendByZeroFun (E := E) (K := K) u (x - t) ∂(volume : Measure E) := by exact integral_kernelMeasure_eq_integral_mul (E := E) (ψ := ψ) hψc hψ0 (g := fun t => extendByZeroFun (E := E) (K := K) u (x - t)) exact hconv'.trans hwd.symm lemma sq_integral_le_integral_sq_of_isProbabilityMeasure {α : Type*} [MeasurableSpace α] (μ : Measure α) [MeasureTheory.IsProbabilityMeasure μ] (f : α → ℝ) (hf : MeasureTheory.MemLp f 2 μ) : (∫ x, f x ∂μ) ^ 2 ≤ ∫ x, (f x) ^ 2 ∂μ := by have hvar := ProbabilityTheory.variance_nonneg (X := f) μ have hvar' : 0 ≤ (∫ x, (f x) ^ 2 ∂μ) - (∫ x, f x ∂μ) ^ 2 := by simpa [ProbabilityTheory.variance_eq_sub (μ := μ) hf] using hvar linarith private lemma norm_sq_eq_integral_sq (v : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); (E →₂[(volume : Measure E)] ℝ)) : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) ‖v‖ ^ 2 = ∫ x, (v x) ^ 2 ∂(volume : Measure E) := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) have hn : ‖v‖ ^ 2 = RCLike.re (inner ℝ v v) := norm_sq_eq_re_inner (𝕜 := ℝ) v -- Unfold the `L²` inner product as an integral; for `ℝ`, `re` is the identity. rw [hn] -- `L²` inner product is an integral of pointwise inner products. rw [MeasureTheory.L2.inner_def (𝕜 := ℝ) (μ := (volume : Measure E)) v v] -- For `ℝ`, `RCLike.re` is the identity and `inner` simplifies to a square. simp [pow_two] lemma norm_sq_translateL2_sub_extendByZeroL2_eq_integral_sq (t : E) (u : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) ‖(translateL2 (μ := (volume : Measure E)) (-t)) (extendByZeroL2 (E := E) (K := K) hKm u) - extendByZeroL2 (E := E) (K := K) hKm u‖ ^ 2 = ∫ x, (extendByZeroFun (E := E) (K := K) u (x - t) - extendByZeroFun (E := E) (K := K) u x) ^ 2 ∂(volume : Measure E) := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) classical let F : (E →₂[(volume : Measure E)] ℝ) := extendByZeroL2 (E := E) (K := K) hKm u let f : E → ℝ := extendByZeroFun (E := E) (K := K) u have hF_ae : (F : E → ℝ) =ᵐ[(volume : Measure E)] f := extendByZeroL2_ae_eq (E := E) (K := K) (hKm := hKm) u -- Translate AE equality along `x ↦ x - t`. have hF_shift : (fun x : E => (F : E → ℝ) (x - t)) =ᵐ[(volume : Measure E)] fun x => f (x - t) := by have hmp : MeasureTheory.MeasurePreserving (fun x : E => x - t) (volume : Measure E) (volume : Measure E) := MeasureTheory.measurePreserving_sub_right (μ := (volume : Measure E)) t exact (hmp.quasiMeasurePreserving.ae_eq_comp hF_ae) -- TranslateL2 gives `F(x - t)` a.e. have htrans : ((translateL2 (μ := (volume : Measure E)) (-t)) F : E → ℝ) =ᵐ[(volume : Measure E)] fun x => (F : E → ℝ) (x - t) := by simpa [sub_eq_add_neg] using (translateL2_ae_eq (μ := (volume : Measure E)) (-t) F) have htrans' : ((translateL2 (μ := (volume : Measure E)) (-t)) F : E → ℝ) =ᵐ[(volume : Measure E)] fun x => f (x - t) := by exact htrans.trans hF_shift have hdiff : (fun x => ((translateL2 (μ := (volume : Measure E)) (-t)) F - F) x) =ᵐ[(volume : Measure E)] fun x => f (x - t) - f x := by filter_upwards [MeasureTheory.Lp.coeFn_sub ((translateL2 (μ := (volume : Measure E)) (-t)) F) F, htrans', hF_ae] with x hxsub hx1 hx2 -- `Lp.coeFn_sub` gives the pointwise relation between coercions of `Lp` subtraction. have hxsub' : ((translateL2 (μ := (volume : Measure E)) (-t)) F - F) x = ((translateL2 (μ := (volume : Measure E)) (-t)) F) x - F x := by simpa using hxsub -- Rewrite to the desired expression using the two pointwise identities. rw [hxsub', hx1, hx2] have hcalc : ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ^ 2 = ∫ x, (f (x - t) - f x) ^ 2 ∂(volume : Measure E) := by have h1 := norm_sq_eq_integral_sq (E := E) (v := ((translateL2 (μ := (volume : Measure E)) (-t)) F - F)) have h2 : ∫ x, (((translateL2 (μ := (volume : Measure E)) (-t)) F - F) x) ^ 2 ∂(volume : Measure E) = ∫ x, (f (x - t) - f x) ^ 2 ∂(volume : Measure E) := by refine MeasureTheory.integral_congr_ae ?_ exact hdiff.pow_const 2 exact h1.trans h2 simpa [F, f] using hcalc private lemma kernelMeasure_le_smul_volume (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (hψ0 : ∀ x, 0 ≤ ψ x) : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) ∃ c : ℝ≥0∞, c ≠ ⊤ ∧ kernelMeasure (E := E) ψ ≤ c • (volume : Measure E) := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) classical obtain ⟨C, hC⟩ := hψcs.exists_bound_of_continuous hψc refine ⟨ENNReal.ofReal C, by simp, ?_⟩ refine (Measure.le_iff).2 ?_ intro s hs have hC0 : 0 ≤ C := le_trans (norm_nonneg (ψ 0)) (hC 0) have hψle : ∀ x, ENNReal.ofReal (ψ x) ≤ ENNReal.ofReal C := by intro x have hx : ψ x ≤ C := by have hx' : ‖ψ x‖ ≤ C := hC x -- `ψ ≥ 0`, so `‖ψ x‖ = ψ x`. simpa [Real.norm_eq_abs, abs_of_nonneg (hψ0 x)] using hx' exact ENNReal.ofReal_le_ofReal hx -- Unfold `withDensity` and bound the density by the constant `ENNReal.ofReal C`. simp only [kernelMeasure, MeasureTheory.withDensity_apply, hs] have hle : (∫⁻ x in s, ENNReal.ofReal (ψ x) ∂(volume : Measure E)) ≤ ∫⁻ x in s, ENNReal.ofReal C ∂(volume : Measure E) := by refine MeasureTheory.lintegral_mono ?_ intro x exact hψle x refine hle.trans ?_ simp lemma smoothFun_sub_extendByZeroFun_sq_le_integral_sq (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (hψ0 : ∀ x, 0 ≤ ψ x) (hψint : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); ∫ x, ψ x ∂(volume : Measure E) = 1) (hKm : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); MeasurableSet K) (u : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) (x : E) : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) (smoothFun (E := E) (K := K) ψ u x - extendByZeroFun (E := E) (K := K) u x) ^ 2 ≤ ∫ t, (extendByZeroFun (E := E) (K := K) u (x - t) - extendByZeroFun (E := E) (K := K) u x) ^ 2 ∂kernelMeasure (E := E) ψ := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) classical let μ : Measure E := kernelMeasure (E := E) ψ have : MeasureTheory.IsProbabilityMeasure μ := isProbabilityMeasure_kernelMeasure (E := E) (ψ := ψ) hψc hψcs hψ0 hψint have : MeasureTheory.IsFiniteMeasure μ := by infer_instance rcases kernelMeasure_le_smul_volume (E := E) (ψ := ψ) hψc hψcs hψ0 with ⟨c, hc_top, hμle⟩ let f : E → ℝ := extendByZeroFun (E := E) (K := K) u have hf_vol : MeasureTheory.MemLp f (2 : ℝ≥0∞) (volume : Measure E) := by -- Use the `L²` packaging of `extendByZeroFun` and the AE bridge. let F : (E →₂[(volume : Measure E)] ℝ) := extendByZeroL2 (E := E) (K := K) hKm u have hF : MeasureTheory.MemLp (fun x : E => (F : E → ℝ) x) (2 : ℝ≥0∞) (volume : Measure E) := MeasureTheory.Lp.memLp F have hF_ae : (fun x : E => (F : E → ℝ) x) =ᵐ[(volume : Measure E)] f := extendByZeroL2_ae_eq (E := E) (K := K) (hKm := hKm) u exact (MeasureTheory.memLp_congr_ae hF_ae).1 hF have hmp : MeasureTheory.MeasurePreserving (fun t : E => x - t) (volume : Measure E) (volume : Measure E) := by -- `t ↦ x - t = (-t) + x` is measure-preserving for Lebesgue (Haar) measure. have hneg : MeasureTheory.MeasurePreserving (Neg.neg : E → E) (volume : Measure E) (volume : Measure E) := (volume : Measure E).measurePreserving_neg have hadd : MeasureTheory.MeasurePreserving (fun y : E => y + x) (volume : Measure E) (volume : Measure E) := MeasureTheory.measurePreserving_add_right (μ := (volume : Measure E)) x have hcomp : ((fun y : E => y + x) ∘ fun t : E => -t) = fun t : E => x - t := by funext t simp [sub_eq_add_neg, add_comm] have := hadd.comp hneg rwa [hcomp] at this have hf_shift_vol : MeasureTheory.MemLp (fun t : E => f (x - t)) (2 : ℝ≥0∞) (volume : Measure E) := hf_vol.comp_measurePreserving hmp have hf_shift : MeasureTheory.MemLp (fun t : E => f (x - t)) (2 : ℝ≥0∞) μ := by exact MeasureTheory.MemLp.of_measure_le_smul (μ := (volume : Measure E)) (μ' := μ) (c := c) hc_top hμle hf_shift_vol have hf_const : MeasureTheory.MemLp (fun _ : E => f x) (2 : ℝ≥0∞) μ := MeasureTheory.memLp_const (μ := μ) (c := f x) have hg : MeasureTheory.MemLp (fun t : E => f (x - t) - f x) (2 : ℝ≥0∞) μ := hf_shift.sub hf_const have hsmooth : smoothFun (E := E) (K := K) ψ u x = ∫ t, f (x - t) ∂μ := by simpa [μ, f] using smoothFun_eq_integral_kernelMeasure (E := E) (K := K) (ψ := ψ) hψc hψ0 u x have hdiff : smoothFun (E := E) (K := K) ψ u x - f x = ∫ t, (f (x - t) - f x) ∂μ := by have hconst : (∫ _t : E, f x ∂μ) = f x := by simp [MeasureTheory.integral_const] have hint : MeasureTheory.Integrable (fun t : E => f (x - t)) μ := hf_shift.integrable (by norm_num) have : (∫ t, f (x - t) ∂μ) - (∫ _t : E, f x ∂μ) = ∫ t, (f (x - t) - f x) ∂μ := by simpa using (MeasureTheory.integral_sub hint (MeasureTheory.integrable_const (f x))).symm simpa [hsmooth, hconst] using this -- Apply Jensen/variance inequality to `t ↦ f(x - t) - f(x)`. have hJ := sq_integral_le_integral_sq_of_isProbabilityMeasure (μ := μ) (f := fun t : E => f (x - t) - f x) hg simpa [hdiff, μ, f] using hJ lemma norm_sq_smoothL2_sub_extendByZeroL2_le_integral_norm_sq_translateL2_sub_extendByZeroL2 (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (hψ0 : ∀ x, 0 ≤ ψ x) (hψint : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); ∫ x, ψ x ∂(volume : Measure E) = 1) (u : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E); let : BorelSpace E := instBorelSpaceApproximation (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E); let : MeasurableAdd E := instMeasurableAddApproximation (E := E); let : MeasurableNeg E := instMeasurableNegApproximation (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) ‖smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u - extendByZeroL2 (E := E) (K := K) hKm u‖ ^ 2 ≤ ∫ t, ‖(translateL2 (μ := (volume : Measure E)) (-t)) (extendByZeroL2 (E := E) (K := K) hKm u) - extendByZeroL2 (E := E) (K := K) hKm u‖ ^ 2 ∂kernelMeasure (E := E) ψ := by let : MeasurableSpace E := instMeasurableSpaceApproximation (E := E) let : BorelSpace E := instBorelSpaceApproximation (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceApproximation (E := E) let : MeasurableAdd E := instMeasurableAddApproximation (E := E) let : MeasurableNeg E := instMeasurableNegApproximation (E := E) classical let μ : Measure E := kernelMeasure (E := E) ψ let : IsProbabilityMeasure μ := isProbabilityMeasure_kernelMeasure (E := E) (ψ := ψ) hψc hψcs hψ0 hψint let F := extendByZeroL2 (E := E) (K := K) hKm u let f := extendByZeroFun (E := E) (K := K) u let S := smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u have hS := smoothL2_ae_eq (E := E) (K := K) (ψ := ψ) (hK := hK) (hKm := hKm) hψc hψcs u have hF := extendByZeroL2_ae_eq (E := E) (K := K) (hKm := hKm) u have hSF : (fun x => (S - F) x) =ᵐ[(volume : Measure E)] (fun x => smoothFun (E := E) (K := K) ψ u x - f x) := (Lp.coeFn_sub S F).trans (hS.sub hF) have hLHS : Integrable (fun x : E => (smoothFun (E := E) (K := K) ψ u x - f x) ^ 2) (volume : Measure E) := (Lp.memLp (S - F)).integrable_sq.congr (hSF.pow_const 2) have hf : MemLp f (2 : ℝ≥0∞) (volume : Measure E) := (memLp_congr_ae hF).1 (Lp.memLp F) have hp := hf.comp_fst μ have hint : Integrable (fun z : E × E => (f (z.1 - z.2) - f z.1) ^ 2) ((volume : Measure E).prod μ) := by simpa only [Pi.sub_apply, Function.comp_apply] using ((hp.comp_measurePreserving (measurePreserving_sub_prod (μ := (volume : Measure E)) (ν := μ))).sub hp).integrable_sq change ‖S - F‖ ^ 2 ≤ ∫ t, ‖translateL2 (μ := (volume : Measure E)) (-t) F - F‖ ^ 2 ∂μ calc _ = ∫ x, (smoothFun (E := E) (K := K) ψ u x - f x) ^ 2 ∂(volume : Measure E) := (norm_sq_eq_integral_sq (E := E) (v := S - F)).trans (integral_congr_ae (hSF.pow_const 2)) _ ≤ ∫ x, ∫ t, (f (x - t) - f x) ^ 2 ∂μ ∂(volume : Measure E) := by apply integral_mono_ae hLHS hint.integral_prod_left exact Filter.Eventually.of_forall fun x => by simpa only [f, μ] using smoothFun_sub_extendByZeroFun_sq_le_integral_sq (E := E) (K := K) (ψ := ψ) hψc hψcs hψ0 hψint hKm u x _ = ∫ t, ∫ x, (f (x - t) - f x) ^ 2 ∂(volume : Measure E) ∂μ := integral_integral_swap hint _ = _ := integral_congr_ae (Filter.Eventually.of_forall fun t => by simpa only [F, f] using (norm_sq_translateL2_sub_extendByZeroL2_eq_integral_sq (E := E) (K := K) (hKm := hKm) t u).symm) end Volume end end L2Compactness end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.Compactness /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `L²` compactness criterion: compact smoothing operator (Euclidean) This file proves the compactness of the fixed-kernel smoothing operator used in the Fréchet–Kolmogorov / Riesz–Kolmogorov approach to Euclidean Rellich–Kondrachov. ## Main results - `Kψ`: the compact set `K + tsupport ψ` controlling supports of smoothed functions. - `smoothBCF`: `smoothFun` packaged as a `BoundedContinuousFunction` on `Kψ`. - `uniformContinuous_ψ`: `UniformContinuous ψ` from `Continuous ψ` + `HasCompactSupport ψ`. The Arzelà–Ascoli compactness statement for `smoothBCF` lives in `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.ArzelaAscoli`. This is tracked under Beads `lean-103.5.2.26.5.3.2.2.1`. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean namespace L2Compactness open scoped ENNReal MeasureTheory Topology Convolution Pointwise open MeasureTheory Set noncomputable section section Volume variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceEL2CompactnessCompactness : MeasurableSpace E := borel E abbrev instBorelSpaceEL2CompactnessCompactness : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessCompactness (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessCompactness (E := E) exact ⟨rfl⟩ variable {K : Set E} variable {ψ : E → ℝ} /- The natural compact codomain for smoothing on `K` by a compactly supported kernel `ψ`. -/ def Kψ : Set E := K + tsupport ψ omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] in lemma isCompact_Kψ (hK : IsCompact K) (hψcs : HasCompactSupport ψ) : IsCompact (Kψ (K := K) (ψ := ψ)) := IsCompact.add hK hψcs.isCompact /- Restrict the smoothed function to its compact domain as a continuous map. -/ def smoothOn (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessCompactness (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (u : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessCompactness (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessCompactness (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : C(↥(Kψ (K := K) (ψ := ψ)), ℝ) where toFun x := smoothFun (E := E) (K := K) ψ u x continuous_toFun := by have : Continuous (smoothFun (E := E) (K := K) ψ u) := continuous_smoothFun (E := E) (K := K) (ψ := ψ) (hKm := hKm) hψc hψcs u exact this.comp continuous_subtype_val /- `smoothFun` packaged as a `BoundedContinuousFunction` on the compact set `K + tsupport ψ`. -/ def smoothBCF (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessCompactness (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (u : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessCompactness (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessCompactness (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) : BoundedContinuousFunction (↥(Kψ (K := K) (ψ := ψ))) ℝ := letI : CompactSpace ↥(Kψ (K := K) (ψ := ψ)) := isCompact_iff_compactSpace.1 (isCompact_Kψ (K := K) (ψ := ψ) hK hψcs) BoundedContinuousFunction.mkOfCompact (smoothOn (E := E) (K := K) (ψ := ψ) hKm hψc hψcs u) lemma smoothBCF_apply (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessCompactness (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (u : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessCompactness (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessCompactness (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) (x : ↥(Kψ (K := K) (ψ := ψ))) : smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u x = smoothFun (E := E) (K := K) ψ u x := by rfl omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] in lemma uniformContinuous_ψ (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) : UniformContinuous ψ := by classical -- `HasCompactSupport` implies `ψ = 0` outside a compact set, hence `ψ → 0` along `cocompact`. refine Continuous.uniformContinuous_of_tendsto_cocompact (f := ψ) (x := (0 : ℝ)) hψc ?_ -- Show `ψ → 0` along `cocompact` using the `ε`-ball characterization. refine (Metric.tendsto_nhds.2 ?_) intro ε hε refine Filter.mem_cocompact'.mpr ⟨tsupport ψ, hψcs, ?_⟩ intro x hx -- If `ψ x` is `ε`-far from `0`, then `ψ x ≠ 0`, hence `x` belongs to the support and therefore -- to the topological support. have hx' : ¬ dist (ψ x) 0 < ε := by simpa [Set.mem_compl_iff, Set.mem_ofPred_eq] using hx have hxε : ε ≤ dist (ψ x) 0 := le_of_not_gt (by simpa [gt_iff_lt] using hx') have hx0 : ψ x ≠ 0 := by intro hψ0 have : dist (ψ x) 0 = 0 := by simp [hψ0] have : ε ≤ 0 := by simpa [this] using hxε exact not_lt_of_ge this hε have hx_supp : x ∈ Function.support ψ := by simpa [Function.support] using hx0 have hx_tsupp : x ∈ tsupport ψ := by have : x ∈ closure (Function.support ψ) := subset_closure hx_supp simpa [tsupport] using this exact hx_tsupp /- The remainder of the compactness proof (Arzelà–Ascoli on the family `smoothBCF '' closedBall`) is tracked as part of `lean-103.5.2.26.5.3.2.2.1`. We intentionally keep the helper lemmas above in this file so the final proof can stay short and only reference re-usable bounds. -/ end Volume end end L2Compactness end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.ArzelaAscoli /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `L²` compactness criterion: Arzelà–Ascoli for the smoothing operator (Euclidean) This file proves the Arzelà–Ascoli step for the compact smoothing operator used in the Fréchet–Kolmogorov / Riesz–Kolmogorov approach to Euclidean Rellich–Kondrachov. ## Main result - `smoothBCF_image_closedBall_isCompact`: For a compact set `K` and a continuous compactly supported kernel `ψ`, the family `{ smoothFun ψ u | ‖u‖ ≤ R }` restricted to the compact set `K + tsupport ψ` has compact closure in `BoundedContinuousFunction`. Tracking: Beads `lean-103.5.2.26.5.3.2.2.1.1`. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean namespace L2Compactness open scoped ENNReal MeasureTheory Topology Convolution Pointwise open MeasureTheory Set noncomputable section section Volume variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceEL2CompactnessArzelaAscoli : MeasurableSpace E := borel E abbrev instBorelSpaceEL2CompactnessArzelaAscoli : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceEL2CompactnessArzelaAscoli : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) infer_instance abbrev instMeasurableAddEL2CompactnessArzelaAscoli : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) MeasurableAdd E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) infer_instance abbrev instMeasurableNegEL2CompactnessArzelaAscoli : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) MeasurableNeg E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) infer_instance variable {K : Set E} {ψ : E → ℝ} private lemma smoothFun_eq_integral_restrict (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E); MeasurableSet K) (u : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) (x : E) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessArzelaAscoli (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessArzelaAscoli (E := E) smoothFun (E := E) (K := K) ψ u x = ∫ t, u t * ψ (x - t) ∂(volume.restrict K) := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessArzelaAscoli (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessArzelaAscoli (E := E) change smoothFun (E := E) (K := K) ψ u x = ∫ t, u t * ψ (x - t) ∂(volume.restrict K) classical -- Unfold convolution, then restrict the integral using the indicator defining `extendByZeroFun`. have : smoothFun (E := E) (K := K) ψ u x = ∫ t, (extendByZeroFun (E := E) (K := K) u t) • ψ (x - t) ∂(volume : Measure E) := by simp [smoothFun, MeasureTheory.convolution_lsmul] have h_ind : (fun t : E => extendByZeroFun (E := E) (K := K) u t * ψ (x - t)) = K.indicator (fun t : E => u t * ψ (x - t)) := by funext t by_cases ht : t ∈ K <;> simp [extendByZeroFun, ht] -- Restrict to `K` using the indicator. simp [this, h_ind, MeasureTheory.integral_indicator hKm] omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] in private lemma isCompact_diffSet (hK : IsCompact K) (hψcs : HasCompactSupport ψ) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessArzelaAscoli (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessArzelaAscoli (E := E) IsCompact ((fun p : E × E => p.1 - p.2) '' ((Kψ (K := K) (ψ := ψ)) ×ˢ K)) := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessArzelaAscoli (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessArzelaAscoli (E := E) change IsCompact ((fun p : E × E => p.1 - p.2) '' ((Kψ (K := K) (ψ := ψ)) ×ˢ K)) have hKψ : IsCompact (Kψ (K := K) (ψ := ψ)) := isCompact_Kψ (K := K) (ψ := ψ) hK hψcs have hprod : IsCompact ((Kψ (K := K) (ψ := ψ)) ×ˢ K) := hKψ.prod hK refine hprod.image ?_ exact (continuous_fst.sub continuous_snd) omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] in private lemma exists_norm_ψ_bound_on_diffSet (hK : IsCompact K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessArzelaAscoli (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessArzelaAscoli (E := E) ∃ C : ℝ, 0 ≤ C ∧ ∀ x : ↥(Kψ (K := K) (ψ := ψ)), ∀ t : E, t ∈ K → ‖ψ ((x : E) - t)‖ ≤ C := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessArzelaAscoli (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessArzelaAscoli (E := E) change ∃ C : ℝ, 0 ≤ C ∧ ∀ x : ↥(Kψ (K := K) (ψ := ψ)), ∀ t : E, t ∈ K → ‖ψ ((x : E) - t)‖ ≤ C classical let diffSet : Set E := (fun p : E × E => p.1 - p.2) '' ((Kψ (K := K) (ψ := ψ)) ×ˢ K) have hdiff : IsCompact diffSet := isCompact_diffSet (E := E) (K := K) (ψ := ψ) hK hψcs by_cases hne : diffSet.Nonempty · -- Use the extreme value theorem on the continuous function `z ↦ ‖ψ z‖`. have hcont : Continuous (fun z : E => ‖ψ z‖) := hψc.norm rcases hdiff.exists_isMaxOn hne (hcont.continuousOn) with ⟨z0, hz0, hzmax⟩ refine ⟨‖ψ z0‖, norm_nonneg _, ?_⟩ intro x t ht have hx : (x : E) ∈ Kψ (K := K) (ψ := ψ) := x.2 have hx_t : (x : E) - t ∈ diffSet := by refine ⟨((x : E), t), ?_, rfl⟩ exact ⟨hx, ht⟩ exact (isMaxOn_iff.1 hzmax) _ hx_t · -- `diffSet = ∅`: take the trivial bound. refine ⟨0, le_rfl, ?_⟩ intro x t ht exfalso have hx : (x : E) ∈ Kψ (K := K) (ψ := ψ) := x.2 have : (x : E) - t ∈ diffSet := by refine ⟨((x : E), t), ?_, rfl⟩ exact ⟨hx, ht⟩ exact hne ⟨(x : E) - t, this⟩ /- Arzelà--Ascoli: smoothing maps `L²(K)` bounded sets into a precompact set in `BCF(K + tsupport ψ)`. -/ private lemma uniformEquicontinuous_smoothBCF_closedBall (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) {R : ℝ} (hRpos : 0 < R) (Cψ : ℝ) (hCψ_nonneg : 0 ≤ Cψ) (hψ_bound : ∀ x : ↥(Kψ (K := K) (ψ := ψ)), ∀ t : E, t ∈ K → ‖ψ ((x : E) - t)‖ ≤ Cψ) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessArzelaAscoli (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessArzelaAscoli (E := E) let A : Set (BoundedContinuousFunction (↥(Kψ (K := K) (ψ := ψ))) ℝ) := smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs '' Metric.closedBall (0 : _) R UniformEquicontinuous ((↑) : A → ↥(Kψ (K := K) (ψ := ψ)) → ℝ) := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessArzelaAscoli (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessArzelaAscoli (E := E) change let A := smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs '' Metric.closedBall (0 : _) R UniformEquicontinuous ((↑) : A → ↥(Kψ (K := K) (ψ := ψ)) → ℝ) intro A classical have : Fact ((volume : Measure E) K < (⊤ : ℝ≥0∞)) := ⟨hK.measure_lt_top (μ := (volume : Measure E))⟩ let μ : Measure E := volume.restrict K have : IsFiniteMeasure μ := by infer_instance let mK : ℝ := (measureUnivNNReal μ) ^ ((2 : ℝ≥0∞).toReal⁻¹) have hmK : 0 ≤ mK := Real.rpow_nonneg (by simp) _ have hker (z : ↥(Kψ (K := K) (ψ := ψ))) : MemLp (fun t : E => ψ ((z : E) - t)) (2 : ℝ≥0∞) μ := by refine MemLp.of_bound (hψc.aestronglyMeasurable.comp_measurable (measurable_const.sub measurable_id)) Cψ ?_ filter_upwards [ae_restrict_mem (μ := (volume : Measure E)) hKm] with t ht exact hψ_bound z t ht let k (z : ↥(Kψ (K := K) (ψ := ψ))) : Lp ℝ (2 : ℝ≥0∞) μ := (hker z).toLp (fun t : E => ψ ((z : E) - t)) have hk (z) : (k z : E → ℝ) =ᵐ[μ] (fun t : E => ψ ((z : E) - t)) := (hker z).coeFn_toLp rw [Metric.uniformEquicontinuous_iff] intro ε hε have hden : 0 < R * mK + 1 := by positivity let e : ℝ := ε / (2 * (R * mK + 1)) have he : 0 < e := div_pos hε (mul_pos (by norm_num) hden) obtain ⟨δ, hδpos, hδ⟩ := (Metric.uniformContinuous_iff.1 (uniformContinuous_ψ (E := E) (ψ := ψ) hψc hψcs)) e he refine ⟨δ, hδpos, ?_⟩ intro x y hxy f obtain ⟨u, hu, hueq⟩ := f.property have hueq' : (f : BoundedContinuousFunction (↥(Kψ (K := K) (ψ := ψ))) ℝ) = smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u := hueq.symm have hunorm : ‖u‖ ≤ R := by simpa [Metric.mem_closedBall, dist_eq_norm] using hu have hvalue (z) : smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u z = inner ℝ u (k z) := by rw [smoothBCF_apply, L2.inner_def, smoothFun_eq_integral_restrict (E := E) (K := K) (ψ := ψ) (hKm := hKm)] apply integral_congr_ae filter_upwards [hk z] with t ht simp [ht, mul_comm] have hae : ∀ᵐ t ∂μ, ‖(k x - k y) t‖ ≤ e := by filter_upwards [Lp.coeFn_sub (k x) (k y), hk x, hk y] with t ht hx hy simp only [Pi.sub_apply] at ht rw [ht, hx, hy] have hxy' : dist ((x : E) - t) ((y : E) - t) < δ := by rw [dist_sub_right] exact hxy simpa only [dist_eq_norm] using (hδ hxy').le have hkdiff : ‖k x - k y‖ ≤ mK * e := by simpa only [mK] using (Lp.norm_le_of_ae_bound (f := k x - k y) he.le hae) have hdist : dist (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u x) (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u y) ≤ ‖u‖ * ‖k x - k y‖ := by rw [dist_eq_norm, hvalue x, hvalue y, ← inner_sub_right] exact norm_inner_le_norm _ _ have hhalf : (R * mK + 1) * e = ε / 2 := by dsimp only [e] field_simp have hle := hdist.trans (mul_le_mul hunorm hkdiff (norm_nonneg _) hRpos.le) have hlast : dist (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u x) (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u y) < ε := by have he0 := he.le nlinarith simpa only [hueq'] using hlast theorem smoothBCF_image_closedBall_isCompact (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) {R : ℝ} (hR : 0 ≤ R) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessArzelaAscoli (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessArzelaAscoli (E := E) IsCompact (closure (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs '' Metric.closedBall (0 : _) R)) := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessArzelaAscoli (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessArzelaAscoli (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessArzelaAscoli (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessArzelaAscoli (E := E) change IsCompact (closure (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs '' Metric.closedBall (0 : _) R)) classical -- Radius `0`: the image is a singleton, hence compact. by_cases hR0 : R = 0 · subst hR0 have hball : Metric.closedBall (0 : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) 0 = {0} := by ext u simp -- Reduce to a singleton. simp [hball] · have hRpos : 0 < R := lt_of_le_of_ne hR (Ne.symm hR0) -- Compactness of the codomain. let : CompactSpace ↥(Kψ (K := K) (ψ := ψ)) := isCompact_iff_compactSpace.1 (isCompact_Kψ (K := K) (ψ := ψ) hK hψcs) let A : Set (BoundedContinuousFunction (↥(Kψ (K := K) (ψ := ψ))) ℝ) := smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs '' Metric.closedBall (0 : _) R -- `volume.restrict K` is finite since `K` is compact. have hμK : (volume : Measure E) K < (⊤ : ℝ≥0∞) := hK.measure_lt_top (μ := (volume : Measure E)) let : Fact ((volume : Measure E) K < (⊤ : ℝ≥0∞)) := ⟨hμK⟩ have : IsFiniteMeasure (volume.restrict K) := by infer_instance let μ : Measure E := (volume : Measure E).restrict K let mK : ℝ := (MeasureTheory.measureUnivNNReal (volume.restrict K)) ^ ((2 : ℝ≥0∞).toReal⁻¹) have hmK : 0 ≤ mK := by have : 0 ≤ (MeasureTheory.measureUnivNNReal (volume.restrict K)) := by simp exact Real.rpow_nonneg this _ -- Uniform bound on `ψ` over the relevant compact difference set. obtain ⟨Cψ, hCψ_nonneg, hψ_bound⟩ := exists_norm_ψ_bound_on_diffSet (E := E) (K := K) (ψ := ψ) hK hψc hψcs -- A compact ball controlling all values. let s : Set ℝ := Metric.closedBall (0 : ℝ) (R * (mK * Cψ)) have hs : IsCompact s := by simpa [s] using isCompact_closedBall (0 : ℝ) (R * (mK * Cψ)) -- Pointwise compact range: each function in `A` takes values in `s`. have in_s : ∀ (f : BoundedContinuousFunction (↥(Kψ (K := K) (ψ := ψ))) ℝ) (x : ↥(Kψ (K := K) (ψ := ψ))), f ∈ A → f x ∈ s := by intro f x hfA rcases hfA with ⟨u, hu_ball, rfl⟩ have hu_norm : ‖u‖ ≤ R := by simpa [Metric.mem_closedBall, dist_eq_norm] using hu_ball -- Build the `L²(K)` kernel element. have hker : MemLp (fun t : E => ψ ((x : E) - t)) (2 : ℝ≥0∞) (volume.restrict K) := by refine MemLp.of_bound (μ := (volume.restrict K)) (hf := (hψc.aestronglyMeasurable.comp_measurable (measurable_const.sub measurable_id))) Cψ ?_ filter_upwards [MeasureTheory.ae_restrict_mem (μ := (volume : Measure E)) hKm] with t ht exact hψ_bound x t ht let kx : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) μ := hker.toLp (fun t : E => ψ ((x : E) - t)) have hkx_norm : ‖kx‖ ≤ mK * Cψ := by have h_ae : ∀ᵐ t ∂(volume.restrict K), ‖(fun t : E => ψ ((x : E) - t)) t‖ ≤ Cψ := by filter_upwards [MeasureTheory.ae_restrict_mem (μ := (volume : Measure E)) hKm] with t ht exact hψ_bound x t ht have := (MeasureTheory.Lp.norm_le_of_ae_bound (μ := (volume.restrict K)) (p := (2 : ℝ≥0∞)) (f := kx) (hC := hCψ_nonneg) (by -- transport the bound through the `toLp` representative filter_upwards [h_ae, MeasureTheory.MemLp.coeFn_toLp (μ := (volume.restrict K)) (p := (2 : ℝ≥0∞)) (f := fun t : E => ψ ((x : E) - t)) hker] with t ht hrep simpa [kx, hrep] using ht)) simpa [mK] using this -- Express the smoothing value as an `L²` inner product, then apply Cauchy–Schwarz. have hsmooth : smoothFun (E := E) (K := K) ψ u (x : E) = ∫ t, u t * kx t ∂(volume.restrict K) := by have h_ae : (fun t : E => u t * kx t) =ᵐ[volume.restrict K] fun t : E => u t * ψ ((x : E) - t) := by filter_upwards [MeasureTheory.MemLp.coeFn_toLp (μ := (volume.restrict K)) (p := (2 : ℝ≥0∞)) (f := fun t : E => ψ ((x : E) - t)) hker] with t ht simp [kx, ht] -- rewrite `smoothFun` as an integral on `volume.restrict K` rw [smoothFun_eq_integral_restrict (E := E) (K := K) (ψ := ψ) (hKm := hKm) u (x : E)] exact (MeasureTheory.integral_congr_ae h_ae.symm) have hsmooth' : smoothFun (E := E) (K := K) ψ u (x : E) = ∫ t, kx t * u t ∂(volume.restrict K) := by simp [hsmooth, mul_comm] have hinner : smoothFun (E := E) (K := K) ψ u (x : E) = inner ℝ (u : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) μ) kx := by erw [MeasureTheory.L2.inner_def]; exact hsmooth' have habs : |smoothFun (E := E) (K := K) ψ u (x : E)| ≤ ‖u‖ * ‖kx‖ := by simpa [hinner] using (abs_real_inner_le_norm (u : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) μ) kx) have habs' : |smoothFun (E := E) (K := K) ψ u (x : E)| ≤ R * (mK * Cψ) := by calc |smoothFun (E := E) (K := K) ψ u (x : E)| ≤ ‖u‖ * ‖kx‖ := habs _ ≤ R * (mK * Cψ) := by exact mul_le_mul hu_norm hkx_norm (norm_nonneg _) hR have : dist (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u x) 0 ≤ R * (mK * Cψ) := by simpa [smoothBCF_apply (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u x, dist_eq_norm, Real.norm_eq_abs] using habs' simpa [s, Metric.mem_closedBall, dist_eq_norm] using this -- Equicontinuity for `A`. have H' : UniformEquicontinuous ((↑) : A → ↥(Kψ (K := K) (ψ := ψ)) → ℝ) := uniformEquicontinuous_smoothBCF_closedBall (K := K) (ψ := ψ) hK hKm hψc hψcs (R := R) hRpos Cψ hCψ_nonneg hψ_bound have H : Equicontinuous ((↑) : A → ↥(Kψ (K := K) (ψ := ψ)) → ℝ) := H'.equicontinuous -- Apply Arzelà–Ascoli. simpa [A, s] using (BoundedContinuousFunction.arzela_ascoli (α := ↥(Kψ (K := K) (ψ := ψ))) (β := ℝ) (s := s) hs A (fun f x hf => in_s f x hf) H) end Volume end end L2Compactness end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.Transfer /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `L²` compactness criterion: transfer from `BCF` compactness to `L²` (Euclidean) This file transfers the Arzelà–Ascoli compactness of the `BoundedContinuousFunction` packaging of `smoothFun` on the compact set `K + tsupport ψ` to a compactness statement in `L²(volume)`. ## Main results - `smoothL2_image_closedBall_isCompact`: For a compact set `K` and a continuous compactly supported kernel `ψ`, the family `{ smoothL2 ψ u | ‖u‖ ≤ R }` has compact closure in `L²(volume)`. Tracking: Beads `lean-103.5.2.26.5.3.2.2.1.2`. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean namespace L2Compactness open scoped ENNReal MeasureTheory Topology Convolution Pointwise open MeasureTheory Set noncomputable section section Volume variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceEL2CompactnessTransfer : MeasurableSpace E := borel E abbrev instBorelSpaceEL2CompactnessTransfer : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceEL2CompactnessTransfer : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTransfer (E := E) infer_instance abbrev instMeasurableAddEL2CompactnessTransfer : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) MeasurableAdd E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTransfer (E := E) infer_instance abbrev instMeasurableNegEL2CompactnessTransfer : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) MeasurableNeg E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTransfer (E := E) infer_instance variable {K : Set E} {ψ : E → ℝ} private lemma dist_smoothL2_le_mul_dist_smoothBCF (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTransfer (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTransfer (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessTransfer (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessTransfer (E := E) ∀ u v : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K), dist (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs v) ≤ (MeasureTheory.measureUnivNNReal ((volume : Measure E).restrict (Kψ (K := K) (ψ := ψ)))) ^ ((2 : ℝ≥0∞).toReal⁻¹) * dist (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u) (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs v) := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTransfer (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTransfer (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessTransfer (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessTransfer (E := E) change ∀ u v : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K), dist (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs v) ≤ (MeasureTheory.measureUnivNNReal ((volume : Measure E).restrict (Kψ (K := K) (ψ := ψ)))) ^ ((2 : ℝ≥0∞).toReal⁻¹) * dist (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u) (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs v) classical let : Fact (1 ≤ (2 : ℝ≥0∞)) := ⟨by norm_num⟩ let s : Set E := Kψ (K := K) (ψ := ψ) have hs_compact : IsCompact s := isCompact_Kψ (K := K) (ψ := ψ) hK hψcs have hs : MeasurableSet s := hs_compact.measurableSet have hs_lt_top : (volume : Measure E) s < (⊤ : ℝ≥0∞) := hs_compact.measure_lt_top (μ := (volume : Measure E)) let μs : Measure E := (volume : Measure E).restrict s have : Fact ((volume : Measure E) s < (⊤ : ℝ≥0∞)) := ⟨hs_lt_top⟩ have : IsFiniteMeasure μs := by infer_instance let mS : ℝ := (MeasureTheory.measureUnivNNReal μs) ^ ((2 : ℝ≥0∞).toReal⁻¹) intro u v set Su := smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u set Sv := smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs v set Bu := smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u set Bv := smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs v have hBuBv : 0 ≤ ‖Bu - Bv‖ := norm_nonneg _ -- Work on `F := Su - Sv` and restrict to the finite-measure set `s`. let F : (E →₂[(volume : Measure E)] ℝ) := Su - Sv let g : E → ℝ := fun x => (F : E → ℝ) x have hg : MeasureTheory.MemLp g (2 : ℝ≥0∞) (volume : Measure E) := MeasureTheory.Lp.memLp F have hg_restrict : MeasureTheory.MemLp g (2 : ℝ≥0∞) μs := hg.restrict s let Fs : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) μs := hg_restrict.toLp g -- Show `Fs` is pointwise bounded by `‖Bu - Bv‖` on `μs`. have hF_ae : (g =ᵐ[μs] fun x : E => smoothFun (E := E) (K := K) ψ u x - smoothFun (E := E) (K := K) ψ v x) := by have hsub : (F : E → ℝ) =ᵐ[(volume : Measure E)] (Su : E → ℝ) - (Sv : E → ℝ) := by simpa [F, g, Su, Sv] using (MeasureTheory.Lp.coeFn_sub (μ := (volume : Measure E)) Su Sv) have hu : (Su : E → ℝ) =ᵐ[(volume : Measure E)] smoothFun (E := E) (K := K) ψ u := smoothL2_ae_eq (E := E) (K := K) (ψ := ψ) (hK := hK) (hKm := hKm) hψc hψcs u have hv : (Sv : E → ℝ) =ᵐ[(volume : Measure E)] smoothFun (E := E) (K := K) ψ v := smoothL2_ae_eq (E := E) (K := K) (ψ := ψ) (hK := hK) (hKm := hKm) hψc hψcs v have hF : (F : E → ℝ) =ᵐ[(volume : Measure E)] fun x : E => smoothFun (E := E) (K := K) ψ u x - smoothFun (E := E) (K := K) ψ v x := by have h := hsub.trans (hu.sub hv) filter_upwards [h] with x hx simpa [Pi.sub_apply] using hx exact MeasureTheory.ae_restrict_of_ae (μ := (volume : Measure E)) (s := s) hF have hFs_ae : ((Fs : E → ℝ) =ᵐ[μs] g) := by simpa [Fs, g] using (MeasureTheory.MemLp.coeFn_toLp (μ := μs) (p := (2 : ℝ≥0∞)) (f := g) hg_restrict) have hbound : ∀ᵐ x ∂μs, ‖Fs x‖ ≤ ‖Bu - Bv‖ := by have hpoint : ∀ x : E, x ∈ s → ‖smoothFun (E := E) (K := K) ψ u x - smoothFun (E := E) (K := K) ψ v x‖ ≤ ‖Bu - Bv‖ := by intro x hx let x' : ↥(Kψ (K := K) (ψ := ψ)) := ⟨x, hx⟩ have hBu : Bu x' = smoothFun (E := E) (K := K) ψ u x := by simp [smoothBCF_apply, Bu, x'] have hBv : Bv x' = smoothFun (E := E) (K := K) ψ v x := by simp [smoothBCF_apply, Bv, x'] have : ‖(Bu - Bv) x'‖ ≤ ‖Bu - Bv‖ := (Bu - Bv).norm_coe_le_norm x' simpa [hBu, hBv] using this filter_upwards [MeasureTheory.ae_restrict_mem (μ := (volume : Measure E)) hs, hFs_ae, hF_ae] with x hx hFs hF have := hpoint x hx -- rewrite through the AE equalities simpa [hFs, hF] using this have hnorm_Fs : ‖Fs‖ ≤ mS * ‖Bu - Bv‖ := by have := (MeasureTheory.Lp.norm_le_of_ae_bound (μ := μs) (p := (2 : ℝ≥0∞)) (f := Fs) (hC := hBuBv) hbound) simpa [mS] using this -- Relate the `L²` norm on `volume` to the restricted norm on `μs` using extension-by-zero. have hsupport : ∀ x : E, x ∉ s → smoothFun (E := E) (K := K) ψ u x - smoothFun (E := E) (K := K) ψ v x = 0 := by intro x hx have hu_supp : Function.support (smoothFun (E := E) (K := K) ψ u) ⊆ s := by exact (support_smoothFun_subset_add_tsupport (E := E) (K := K) (ψ := ψ) u) have hv_supp : Function.support (smoothFun (E := E) (K := K) ψ v) ⊆ s := by exact (support_smoothFun_subset_add_tsupport (E := E) (K := K) (ψ := ψ) v) have hu0 : smoothFun (E := E) (K := K) ψ u x = 0 := by have : x ∉ Function.support (smoothFun (E := E) (K := K) ψ u) := fun hx' => hx (hu_supp hx') simpa [Function.support] using this have hv0 : smoothFun (E := E) (K := K) ψ v x = 0 := by have : x ∉ Function.support (smoothFun (E := E) (K := K) ψ v) := fun hx' => hx (hv_supp hx') simpa [Function.support] using this simp [hu0, hv0] have hF0 : ∀ᵐ x ∂(volume : Measure E), x ∉ s → g x = 0 := by have hF_ae_full : (g =ᵐ[(volume : Measure E)] fun x : E => smoothFun (E := E) (K := K) ψ u x - smoothFun (E := E) (K := K) ψ v x) := by have hsub : (F : E → ℝ) =ᵐ[(volume : Measure E)] (Su : E → ℝ) - (Sv : E → ℝ) := by simpa [F, g, Su, Sv] using (MeasureTheory.Lp.coeFn_sub (μ := (volume : Measure E)) Su Sv) have hu : (Su : E → ℝ) =ᵐ[(volume : Measure E)] smoothFun (E := E) (K := K) ψ u := smoothL2_ae_eq (E := E) (K := K) (ψ := ψ) (hK := hK) (hKm := hKm) hψc hψcs u have hv : (Sv : E → ℝ) =ᵐ[(volume : Measure E)] smoothFun (E := E) (K := K) ψ v := smoothL2_ae_eq (E := E) (K := K) (ψ := ψ) (hK := hK) (hKm := hKm) hψc hψcs v have hF : (F : E → ℝ) =ᵐ[(volume : Measure E)] fun x : E => smoothFun (E := E) (K := K) ψ u x - smoothFun (E := E) (K := K) ψ v x := by have h := hsub.trans (hu.sub hv) filter_upwards [h] with x hx simpa [Pi.sub_apply] using hx simpa [g] using hF filter_upwards [hF_ae_full] with x hx intro hxnot have : smoothFun (E := E) (K := K) ψ u x - smoothFun (E := E) (K := K) ψ v x = 0 := hsupport x hxnot simpa [hx] using this have hF_ind : (s.indicator g =ᵐ[(volume : Measure E)] g) := by filter_upwards [hF0] with x hx by_cases hxmem : x ∈ s · simp [g, hxmem] · have : g x = 0 := hx hxmem simp [g, hxmem, this] -- Conclude `‖F‖ = ‖Fs‖` using `extendByZeroₗᵢ` and the indicator identity. let Fext : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume : Measure E) := (MeasureTheory.Lp.extendByZeroₗᵢ (μ := (volume : Measure E)) (E := ℝ) (p := (2 : ℝ≥0∞)) (s := s) hs) Fs have hFext_ae : ((Fext : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume : Measure E)) : E → ℝ) =ᵐ[(volume : Measure E)] s.indicator fun x : E => (Fs : E → ℝ) x := by simpa [Fext] using (MeasureTheory.Lp.extendByZeroₗᵢ_ae_eq (μ := (volume : Measure E)) (p := (2 : ℝ≥0∞)) (s := s) hs Fs) have hFs_on : ∀ᵐ x ∂(volume : Measure E), x ∈ s → (Fs : E → ℝ) x = g x := by -- rewrite the AE equality `Fs = g` on the restricted measure as an implication on `volume` have := (MeasureTheory.ae_restrict_iff' (μ := (volume : Measure E)) (s := s) hs).1 hFs_ae simpa [g] using this have hindicator : (s.indicator (fun x : E => (Fs : E → ℝ) x) =ᵐ[(volume : Measure E)] s.indicator g) := by filter_upwards [hFs_on] with x hx by_cases hxmem : x ∈ s · simp [hxmem, hx hxmem] · simp [hxmem] have hFext_ae' : (Fext : E → ℝ) =ᵐ[(volume : Measure E)] g := by exact hFext_ae.trans (hindicator.trans hF_ind) have hFext_eq : Fext = F := by refine MeasureTheory.Lp.ext ?_ simpa [g, F] using hFext_ae' have hnorm_F : ‖F‖ ≤ mS * ‖Bu - Bv‖ := by -- use `‖F‖ = ‖Fs‖` via the isometry. have hnorm_ext : ‖Fext‖ = ‖Fs‖ := by simp [Fext] -- `Fext = F` and `Fs` is bounded. have : ‖Fext‖ ≤ mS * ‖Bu - Bv‖ := by simpa [hnorm_ext] using hnorm_Fs simpa [hFext_eq] using this -- Convert to the `dist` statement. simpa [Su, Sv, Bu, Bv, F, dist_eq_norm, mS, mul_assoc] using hnorm_F theorem smoothL2_image_closedBall_isCompact (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) {R : ℝ} (hR : 0 ≤ R) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTransfer (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTransfer (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessTransfer (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessTransfer (E := E) IsCompact (closure (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs '' Metric.closedBall (0 : _) R)) := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTransfer (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTransfer (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTransfer (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessTransfer (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessTransfer (E := E) change IsCompact (closure (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs '' Metric.closedBall (0 : _) R)) classical let : Fact (1 ≤ (2 : ℝ≥0∞)) := ⟨by norm_num⟩ let s : Set E := Kψ (K := K) (ψ := ψ) have hs_compact : IsCompact s := isCompact_Kψ (K := K) (ψ := ψ) hK hψcs have hs : MeasurableSet s := hs_compact.measurableSet have hs_lt_top : (volume : Measure E) s < (⊤ : ℝ≥0∞) := hs_compact.measure_lt_top (μ := (volume : Measure E)) let μs : Measure E := (volume : Measure E).restrict s have : Fact ((volume : Measure E) s < (⊤ : ℝ≥0∞)) := ⟨hs_lt_top⟩ have : IsFiniteMeasure μs := by infer_instance let mS : ℝ := (MeasureTheory.measureUnivNNReal μs) ^ ((2 : ℝ≥0∞).toReal⁻¹) have hmS : 0 ≤ mS := by have : 0 ≤ (MeasureTheory.measureUnivNNReal μs) := by simp exact Real.rpow_nonneg this _ let U : Set (MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) := Metric.closedBall (0 : _) R let A : Set (BoundedContinuousFunction (↥(Kψ (K := K) (ψ := ψ))) ℝ) := smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs '' U let B : Set (E →₂[(volume : Measure E)] ℝ) := smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs '' U have hA_compact : IsCompact (closure A) := smoothBCF_image_closedBall_isCompact (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs (R := R) hR have hdist_smoothL2_le := dist_smoothL2_le_mul_dist_smoothBCF (K := K) (ψ := ψ) hK hKm hψc hψcs have hTB_B : TotallyBounded B := by -- Use a finite `BCF` ε-net for `A` with centers in the image, then transfer to `L²`. rw [Metric.totallyBounded_iff] intro ε hε by_cases hmS0 : mS = 0 · let c : (E →₂[(volume : Measure E)] ℝ) := smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs (0 : _) refine ⟨{c}, by simp [c], ?_⟩ intro w hw rcases hw with ⟨u, huU, rfl⟩ have hle := hdist_smoothL2_le u (0 : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) have hdist0 : dist (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) c = 0 := by have hmS0' : (MeasureTheory.measureUnivNNReal ((volume : Measure E).restrict s) : ℝ) ^ ((2 : ℝ≥0∞).toReal⁻¹) = 0 := hmS0 have : dist (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) c ≤ 0 := by have hle' := hle simp only [s] at hmS0' rw [hmS0', zero_mul] at hle' simpa [c] using hle' exact le_antisymm this dist_nonneg refine mem_iUnion.2 ?_ refine ⟨c, mem_iUnion.2 ?_⟩ refine ⟨by simp, ?_⟩ -- membership in the open ball follows from `dist = 0` and `ε > 0` simpa [Metric.mem_ball, hdist0] using hε · have hmSpos : 0 < mS := lt_of_le_of_ne hmS (Ne.symm hmS0) let deltaLoss : ℝ := ε / mS have hδpos : 0 < deltaLoss := div_pos hε hmSpos obtain ⟨t, htAsub, htFin, htCover⟩ := exists_finite_cover_balls_of_isCompact_closure (s := A) (ε := deltaLoss) hA_compact hδpos let tFin : Finset (BoundedContinuousFunction (↥(Kψ (K := K) (ψ := ψ))) ℝ) := htFin.toFinset have htFin_mem : ∀ {f : BoundedContinuousFunction (↥(Kψ (K := K) (ψ := ψ))) ℝ}, f ∈ tFin ↔ f ∈ t := by intro f simp [tFin, htFin.mem_toFinset (a := f)] let ι : Type _ := { f // f ∈ tFin } have hrep : ∀ f : ι, ∃ u : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K), u ∈ U ∧ smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u = f.1 := by intro f have hf_t : f.1 ∈ t := (htFin_mem (f := f.1)).1 f.2 have hfA : f.1 ∈ A := htAsub hf_t rcases hfA with ⟨u, huU, huEq⟩ exact ⟨u, huU, huEq⟩ choose uOf huOfU huOfEq using hrep let tL2 : Set (E →₂[(volume : Measure E)] ℝ) := Set.range fun f : ι => smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs (uOf f) have htL2_fin : tL2.Finite := Set.finite_range _ refine ⟨tL2, htL2_fin, ?_⟩ intro w hw rcases hw with ⟨u, huU, rfl⟩ have hBu : (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u) ∈ A := by exact ⟨u, huU, rfl⟩ have : smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u ∈ ⋃ x ∈ t, Metric.ball x deltaLoss := htCover hBu rcases mem_iUnion.1 this with ⟨f, hf⟩ rcases mem_iUnion.1 hf with ⟨hf_t, hf_ball⟩ have hf_tFin : f ∈ tFin := (htFin_mem (f := f)).2 hf_t let f' : ι := ⟨f, hf_tFin⟩ have hf_ball' : dist (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u) f < deltaLoss := hf_ball have hdist : dist (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs (uOf f')) < ε := by have hle := hdist_smoothL2_le u (uOf f') have hf_eq : smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs (uOf f') = f := by simpa [f'] using huOfEq f' have hdist' : dist (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u) (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs (uOf f')) < deltaLoss := by simpa [hf_eq] using hf_ball' have : mS * dist (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u) (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs (uOf f')) < ε := by have : mS * dist (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs u) (smoothBCF (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs (uOf f')) < mS * deltaLoss := by exact mul_lt_mul_of_pos_left hdist' hmSpos have hmul : mS * deltaLoss = ε := by have hmS_ne : mS ≠ 0 := ne_of_gt hmSpos calc mS * deltaLoss = mS * (ε / mS) := by simp [deltaLoss] _ = mS * ε / mS := (mul_div_assoc mS ε mS).symm _ = ε := by simpa using (mul_div_cancel_left₀ ε hmS_ne) simpa [hmul] using this exact lt_of_le_of_lt hle this refine mem_iUnion.2 ?_ refine ⟨smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs (uOf f'), ?_⟩ refine mem_iUnion.2 ?_ refine ⟨?_, hdist⟩ -- show the chosen center lies in `tL2` exact ⟨f', rfl⟩ -- Compactness follows from total boundedness + completeness of `L²`. have hTB_closure : TotallyBounded (closure B) := hTB_B.closure have hcomplete : IsComplete (closure B) := isClosed_closure.isComplete have hcompact_closure : IsCompact (closure B) := isCompact_iff_totallyBounded_isComplete.2 ⟨hTB_closure, hcomplete⟩ simpa [B, U] using hcompact_closure end Volume end end L2Compactness end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.FrechetKolmogorov /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `L²` compactness criterion: Fréchet–Kolmogorov (Euclidean, compact support case) This file packages the final “precompactness via smoothing” step behind the Euclidean `L²` compactness criterion used by the Rellich–Kondrachov stack: - the **smoothing operator** `smoothL2 ψ` has compact image on `Metric.closedBall 0 R`; - the **approximation inequality** bounds `‖smoothL2 ψ u - extendByZeroL2 u‖` by a translation error. We state the criterion at the level needed by the project: families of `L²` functions with common compact support (modeled as `Lp ℝ 2 (volume.restrict K)` and embedded into `L²(volume)` via `extendByZeroL2`). ## Main results - `norm_smoothL2_sub_extendByZeroL2_le_of_integral_translateL2_sub_extendByZeroL2_le`: if the translation error averaged against `kernelMeasure ψ` is ≤ `η²`, then smoothing approximates `extendByZeroL2` within `η`. - `totallyBounded_extendByZeroL2_image_of_forall_exists_translationIntegral_small`: if a bounded family admits, at every scale `ε`, a kernel `ψ` for which the above translation error is uniformly small, then the embedded family is totally bounded in `L²(volume)`. - `isCompact_closure_extendByZeroL2_image_of_forall_exists_translationIntegral_small`: the corresponding compact-closure statement. Tracking: Beads `lean-103.5.2.26.5.3.2.2.3`. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean namespace L2Compactness open scoped ENNReal MeasureTheory Topology Convolution Pointwise open MeasureTheory Set noncomputable section section Volume variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceEL2CompactnessFrechetKolmogorov : MeasurableSpace E := borel E abbrev instBorelSpaceEL2CompactnessFrechetKolmogorov : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E) infer_instance abbrev instMeasurableAddEL2CompactnessFrechetKolmogorov : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) MeasurableAdd E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E) infer_instance abbrev instMeasurableNegEL2CompactnessFrechetKolmogorov : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) MeasurableNeg E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E) infer_instance variable {K : Set E} {ψ : E → ℝ} lemma norm_smoothL2_sub_extendByZeroL2_le_of_integral_translateL2_sub_extendByZeroL2_le (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); MeasurableSet K) (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (hψ0 : ∀ x, 0 ≤ ψ x) (hψint : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); ∫ x, ψ x ∂(volume : Measure E) = 1) {η : ℝ} (hη : 0 ≤ η) (u : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) (htrans : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); ∫ t, ‖(translateL2 (μ := (volume : Measure E)) (-t)) (extendByZeroL2 (E := E) (K := K) hKm u) - extendByZeroL2 (E := E) (K := K) hKm u‖ ^ 2 ∂kernelMeasure (E := E) ψ ≤ η ^ 2) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E) ‖smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u - extendByZeroL2 (E := E) (K := K) hKm u‖ ≤ η := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E) change ‖smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u - extendByZeroL2 (E := E) (K := K) hKm u‖ ≤ η have hsq : ‖smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u - extendByZeroL2 (E := E) (K := K) hKm u‖ ^ 2 ≤ η ^ 2 := by refine (le_trans ?_ htrans) simpa using norm_sq_smoothL2_sub_extendByZeroL2_le_integral_norm_sq_translateL2_sub_extendByZeroL2 (E := E) (K := K) (ψ := ψ) (hK := hK) (hKm := hKm) hψc hψcs hψ0 hψint u exact (sq_le_sq₀ (norm_nonneg _) hη).1 hsq theorem totallyBounded_extendByZeroL2_image_of_forall_exists_translationIntegral_small (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); MeasurableSet K) {R : ℝ} (hR : 0 ≤ R) {A : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); Set (MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K))} (hA : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); A ⊆ Metric.closedBall (0 : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) R) (hApprox : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); ∀ ε : ℝ, 0 < ε → ∃ ψ : E → ℝ, Continuous ψ ∧ HasCompactSupport ψ ∧ (∀ x, 0 ≤ ψ x) ∧ (∫ x, ψ x ∂(volume : Measure E) = 1) ∧ ∀ u ∈ A, ∫ t, ‖(translateL2 (μ := (volume : Measure E)) (-t)) (extendByZeroL2 (E := E) (K := K) hKm u) - extendByZeroL2 (E := E) (K := K) hKm u‖ ^ 2 ∂kernelMeasure (E := E) ψ ≤ (ε / 2) ^ 2) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E) TotallyBounded (extendByZeroL2 (E := E) (K := K) hKm '' A) := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E) change TotallyBounded (extendByZeroL2 (E := E) (K := K) hKm '' A) classical -- Use the finite `ε`-net characterization of total boundedness. refine (Metric.totallyBounded_iff).2 ?_ intro ε hε have hε2 : 0 < ε / 2 := by linarith rcases hApprox ε hε with ⟨ψ, hψc, hψcs, hψ0, hψint, htrans⟩ let B : Set (E →₂[(volume : Measure E)] ℝ) := smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs '' Metric.closedBall (0 : _) R have hB_compact : IsCompact (closure B) := smoothL2_image_closedBall_isCompact (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs (R := R) hR have hB_tot : TotallyBounded B := (totallyBounded_closure).1 hB_compact.totallyBounded rcases Metric.finite_approx_of_totallyBounded hB_tot (ε / 2) hε2 with ⟨t, htB, htfin, hBcover⟩ refine ⟨t, htfin, ?_⟩ intro x hx rcases hx with ⟨u, huA, rfl⟩ have huR : u ∈ Metric.closedBall (0 : _) R := hA huA have hSu_mem : smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u ∈ B := ⟨u, huR, rfl⟩ have hSu_cover : smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u ∈ ⋃ y, ⋃ (_ : y ∈ t), Metric.ball y (ε / 2) := hBcover hSu_mem rcases Set.mem_iUnion.1 hSu_cover with ⟨y, hy⟩ rcases Set.mem_iUnion.1 hy with ⟨hyT, hyBall⟩ have hyDist : dist (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) y < ε / 2 := by simpa [Metric.ball, Set.mem_ofPred_eq] using hyBall have hdist_smooth_ext : dist (extendByZeroL2 (E := E) (K := K) hKm u) (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) ≤ ε / 2 := by have hη : 0 ≤ ε / 2 := le_of_lt hε2 have hnorm : ‖smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u - extendByZeroL2 (E := E) (K := K) hKm u‖ ≤ ε / 2 := norm_smoothL2_sub_extendByZeroL2_le_of_integral_translateL2_sub_extendByZeroL2_le (E := E) (K := K) (ψ := ψ) hK hKm hψc hψcs hψ0 hψint (η := ε / 2) hη u (htrans u huA) -- Switch to `dist` with the argument order used by `dist_triangle`. have hdist : dist (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) (extendByZeroL2 (E := E) (K := K) hKm u) ≤ ε / 2 := by simpa [dist_eq_norm] using hnorm simpa [dist_comm] using hdist have hxDist : dist (extendByZeroL2 (E := E) (K := K) hKm u) y < ε := by have htri := dist_triangle (extendByZeroL2 (E := E) (K := K) hKm u) (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) y have hlt : dist (extendByZeroL2 (E := E) (K := K) hKm u) (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) + dist (smoothL2 (E := E) (K := K) ψ hK hKm hψc hψcs u) y < ε / 2 + ε / 2 := add_lt_add_of_le_of_lt hdist_smooth_ext hyDist have htmp : dist (extendByZeroL2 (E := E) (K := K) hKm u) y < ε / 2 + ε / 2 := lt_of_le_of_lt htri hlt simpa [add_halves ε] using htmp have hxBall : extendByZeroL2 (E := E) (K := K) hKm u ∈ Metric.ball y ε := by simpa [Metric.ball, Set.mem_ofPred_eq] using hxDist exact Set.mem_iUnion.2 ⟨y, Set.mem_iUnion.2 ⟨hyT, hxBall⟩⟩ theorem isCompact_closure_extendByZeroL2_image_of_forall_exists_translationIntegral_small (hK : IsCompact K) (hKm : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); MeasurableSet K) {R : ℝ} (hR : 0 ≤ R) {A : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); Set (MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K))} (hA : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); A ⊆ Metric.closedBall (0 : MeasureTheory.Lp ℝ (2 : ℝ≥0∞) (volume.restrict K)) R) (hApprox : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E); ∀ ε : ℝ, 0 < ε → ∃ ψ : E → ℝ, Continuous ψ ∧ HasCompactSupport ψ ∧ (∀ x, 0 ≤ ψ x) ∧ (∫ x, ψ x ∂(volume : Measure E) = 1) ∧ ∀ u ∈ A, ∫ t, ‖(translateL2 (μ := (volume : Measure E)) (-t)) (extendByZeroL2 (E := E) (K := K) hKm u) - extendByZeroL2 (E := E) (K := K) hKm u‖ ^ 2 ∂kernelMeasure (E := E) ψ ≤ (ε / 2) ^ 2) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E) IsCompact (closure (extendByZeroL2 (E := E) (K := K) hKm '' A)) := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessFrechetKolmogorov (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessFrechetKolmogorov (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessFrechetKolmogorov (E := E) change IsCompact (closure (extendByZeroL2 (E := E) (K := K) hKm '' A)) have ht : TotallyBounded (extendByZeroL2 (E := E) (K := K) hKm '' A) := totallyBounded_extendByZeroL2_image_of_forall_exists_translationIntegral_small (E := E) (K := K) hK hKm hR hA hApprox exact (ht.closure).isCompact_of_isClosed isClosed_closure end Volume end end L2Compactness end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.Kernels /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `L²` compactness criterion: existence of small-support probability kernels (Euclidean) This file provides a “kernel factory” for the Euclidean Fréchet–Kolmogorov / Riesz–Kolmogorov criterion: for any radius `deltaLoss > 0`, produce a continuous compactly supported function `ψ : E → ℝ` such that: - `ψ ≥ 0`, - `tsupport ψ ⊆ Metric.ball 0 deltaLoss`, - `∫ ψ = 1` (so `kernelMeasure ψ` is a probability measure). The construction uses mathlib’s `exists_smooth_tsupport_subset` bump-function lemma and normalizes by its (positive) integral. Tracking: Beads `lean-103.5.2.26.5.3.2.2.5`. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean namespace L2Compactness open scoped ENNReal MeasureTheory Topology open MeasureTheory Set noncomputable section section Volume variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceEL2CompactnessKernels : MeasurableSpace E := borel E abbrev instBorelSpaceEL2CompactnessKernels : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessKernels (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessKernels (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceEL2CompactnessKernels : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessKernels (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessKernels (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessKernels (E := E) infer_instance /- For any `deltaLoss > 0`, there exists a continuous compactly supported kernel `ψ` supported in `Metric.ball 0 deltaLoss`, with `ψ ≥ 0` and `∫ ψ = 1` (w.r.t. Lebesgue measure). -/ theorem exists_kernel_tsupport_subset_ball_integral_eq_one {deltaLoss : ℝ} (hδ : 0 < deltaLoss) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessKernels (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessKernels (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessKernels (E := E) ∃ ψ : E → ℝ, Continuous ψ ∧ HasCompactSupport ψ ∧ (∀ x, 0 ≤ ψ x) ∧ (∫ x, ψ x ∂(volume : Measure E) = 1) ∧ tsupport ψ ⊆ Metric.ball (0 : E) deltaLoss := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessKernels (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessKernels (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessKernels (E := E) classical -- Start from a smooth bump supported in `ball 0 deltaLoss` with value `1` at `0`. have hs : (Metric.ball (0 : E) deltaLoss) ∈ 𝓝 (0 : E) := Metric.ball_mem_nhds _ hδ rcases exists_contDiff_tsupport_subset (n := ⊤) (E := E) (s := Metric.ball (0 : E) deltaLoss) (x := (0 : E)) hs with ⟨f, hf_tsupp, hf_cs, hf_smooth, hf_range, hf0⟩ have hf_cont : Continuous f := hf_smooth.continuous have hf_nonneg : ∀ x, 0 ≤ f x := by intro x have hx : f x ∈ Set.Icc (0 : ℝ) 1 := hf_range ⟨x, rfl⟩ exact hx.1 have hf0_ne : f (0 : E) ≠ 0 := by -- `f 0 = 1`. simp [hf0] -- The integral is strictly positive (Lebesgue is an open-positive measure). have hIpos : 0 < ∫ x, f x ∂(volume : Measure E) := by simpa using (Continuous.integral_pos_of_hasCompactSupport_nonneg_nonzero (μ := (volume : Measure E)) hf_cont hf_cs hf_nonneg hf0_ne) set I : ℝ := ∫ x, f x ∂(volume : Measure E) have hI0 : I ≠ 0 := ne_of_gt hIpos have hIpos' : 0 < I := by simpa [I] using hIpos -- Normalize: `ψ = I⁻¹ • f`. let ψ : E → ℝ := fun x => I⁻¹ * f x have hψc : Continuous ψ := by exact (continuous_const.mul hf_cont) have hψcs : HasCompactSupport ψ := by exact (HasCompactSupport.smul_left (f := fun _x : E => I⁻¹) (f' := f) hf_cs) have hψ0 : ∀ x, 0 ≤ ψ x := by intro x have hInv : 0 ≤ I⁻¹ := by have : 0 ≤ I := le_of_lt hIpos' simpa using inv_nonneg.2 this simpa [ψ] using mul_nonneg hInv (hf_nonneg x) have hψint : ∫ x, ψ x ∂(volume : Measure E) = 1 := by have : (∫ x, ψ x ∂(volume : Measure E)) = I⁻¹ * I := by -- Pull out the constant scalar. simpa [ψ, I] using (MeasureTheory.integral_const_mul (μ := (volume : Measure E)) (r := I⁻¹) (f := f)) simp [this, hI0] have hψ_tsupp : tsupport ψ ⊆ Metric.ball (0 : E) deltaLoss := by -- Scaling does not enlarge topological support; use the bump support inclusion. have hsub : tsupport ψ ⊆ tsupport f := by simpa [ψ, smul_eq_mul] using (tsupport_smul_subset_right (f := fun _x : E => I⁻¹) (g := f)) exact hsub.trans hf_tsupp exact ⟨ψ, hψc, hψcs, hψ0, hψint, hψ_tsupp⟩ end Volume end end L2Compactness end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.L2Compactness.TranslationIntegral /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `L²` compactness criterion: bounding the translation-integral by a translation modulus This file provides a small but crucial bridge lemma used to connect a uniform translation modulus on `L²(volume)` with the `kernelMeasure` translation-integral bound appearing in the approximation-identity estimate. The core observation is that if `ψ` is supported in a neighborhood where the translation modulus is ≤ `η`, then the averaged squared translation error against the probability measure `kernelMeasure ψ` is ≤ `η²`. Tracking: Beads `lean-103.5.2.26.5.3.2.2.4`. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean namespace L2Compactness open scoped ENNReal MeasureTheory Topology open MeasureTheory Set noncomputable section section Volume variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] /- Borel σ-algebra on the model space `E`. -/ abbrev instMeasurableSpaceEL2CompactnessTranslationIntegral : MeasurableSpace E := borel E abbrev instBorelSpaceEL2CompactnessTranslationIntegral : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) BorelSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) exact ⟨rfl⟩ abbrev instOpensMeasurableSpaceEL2CompactnessTranslationIntegral : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) OpensMeasurableSpace E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTranslationIntegral (E := E) infer_instance abbrev instMeasurableAddEL2CompactnessTranslationIntegral : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) MeasurableAdd E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTranslationIntegral (E := E) infer_instance abbrev instMeasurableNegEL2CompactnessTranslationIntegral : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) MeasurableNeg E := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTranslationIntegral (E := E) infer_instance variable {ψ : E → ℝ} private lemma kernelMeasure_compl_ball_eq_zero_of_tsupport_subset {deltaLoss : ℝ} (hψsupp : tsupport ψ ⊆ Metric.ball (0 : E) deltaLoss) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTranslationIntegral (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessTranslationIntegral (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessTranslationIntegral (E := E) kernelMeasure (E := E) ψ ((Metric.ball (0 : E) deltaLoss)ᶜ) = 0 := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTranslationIntegral (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessTranslationIntegral (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessTranslationIntegral (E := E) change kernelMeasure (E := E) ψ ((Metric.ball (0 : E) deltaLoss)ᶜ) = 0 classical have hψzero : ∀ x : E, x ∈ (Metric.ball (0 : E) deltaLoss)ᶜ → ψ x = 0 := by intro x hx have hx' : x ∉ tsupport ψ := by intro hx_ts exact hx (hψsupp hx_ts) exact image_eq_zero_of_notMem_tsupport (f := ψ) hx' have hmeas : MeasurableSet ((Metric.ball (0 : E) deltaLoss)ᶜ) := (measurableSet_ball : MeasurableSet (Metric.ball (0 : E) deltaLoss)).compl have hEq : Set.EqOn (fun x : E => ENNReal.ofReal (ψ x)) 0 ((Metric.ball (0 : E) deltaLoss)ᶜ) := by intro x hx simp [hψzero x hx] -- Expand `kernelMeasure` and note the density is identically `0` on the set. simp [kernelMeasure, MeasureTheory.withDensity_apply, hmeas, MeasureTheory.setLIntegral_eq_zero (μ := (volume : Measure E)) (s := (Metric.ball (0 : E) deltaLoss)ᶜ) hmeas hEq] theorem integral_norm_sq_translateL2_sub_le_sq_of_tsupport_subset_ball (hψc : Continuous ψ) (hψcs : HasCompactSupport ψ) (hψ0 : ∀ x, 0 ≤ ψ x) (hψint : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessTranslationIntegral (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTranslationIntegral (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessTranslationIntegral (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessTranslationIntegral (E := E); ∫ x, ψ x ∂(volume : Measure E) = 1) {deltaLoss η : ℝ} (hη : 0 ≤ η) (hψsupp : tsupport ψ ⊆ Metric.ball (0 : E) deltaLoss) (F : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessTranslationIntegral (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTranslationIntegral (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessTranslationIntegral (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessTranslationIntegral (E := E); (E →₂[(volume : Measure E)] ℝ)) (hmod : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E); let : BorelSpace E := instBorelSpaceEL2CompactnessTranslationIntegral (E := E); let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTranslationIntegral (E := E); let : MeasurableAdd E := instMeasurableAddEL2CompactnessTranslationIntegral (E := E); let : MeasurableNeg E := instMeasurableNegEL2CompactnessTranslationIntegral (E := E); ∀ t : E, t ∈ Metric.ball (0 : E) deltaLoss → ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ≤ η) : let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTranslationIntegral (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessTranslationIntegral (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessTranslationIntegral (E := E) ∫ t, ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ^ 2 ∂kernelMeasure (E := E) ψ ≤ η ^ 2 := by let : MeasurableSpace E := instMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : BorelSpace E := instBorelSpaceEL2CompactnessTranslationIntegral (E := E) let : OpensMeasurableSpace E := instOpensMeasurableSpaceEL2CompactnessTranslationIntegral (E := E) let : MeasurableAdd E := instMeasurableAddEL2CompactnessTranslationIntegral (E := E) let : MeasurableNeg E := instMeasurableNegEL2CompactnessTranslationIntegral (E := E) change ∫ t, ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ^ 2 ∂kernelMeasure (E := E) ψ ≤ η ^ 2 classical let μ : Measure E := kernelMeasure (E := E) ψ have : MeasureTheory.IsProbabilityMeasure μ := ⟨kernelMeasure_univ (E := E) (ψ := ψ) hψc hψcs hψ0 hψint⟩ have hμzero : μ ((Metric.ball (0 : E) deltaLoss)ᶜ) = 0 := by simpa [μ] using kernelMeasure_compl_ball_eq_zero_of_tsupport_subset (E := E) (ψ := ψ) hψsupp have hAE_ball : (Metric.ball (0 : E) deltaLoss) ∈ MeasureTheory.ae μ := (MeasureTheory.mem_ae_iff.2 hμzero) -- On `Metric.ball 0 deltaLoss`, the squared translation error is bounded by `η²`. have hAE_bound : ∀ᵐ t : E ∂μ, ‖‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ^ 2‖ ≤ η ^ 2 := by filter_upwards [hAE_ball] with t ht have hle : ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ≤ η := hmod t ht have hsq : ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ^ 2 ≤ η ^ 2 := (sq_le_sq₀ (norm_nonneg _) hη).2 hle have hnonneg : 0 ≤ ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ^ 2 := sq_nonneg _ have hηnonneg : 0 ≤ η ^ 2 := sq_nonneg _ simpa [Real.norm_eq_abs, abs_of_nonneg hnonneg, abs_of_nonneg hηnonneg] using hsq have hnorm_int : ‖∫ t, ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ^ 2 ∂μ‖ ≤ η ^ 2 * μ.real Set.univ := by simpa using (MeasureTheory.norm_integral_le_of_norm_le_const (μ := μ) (f := fun t : E => ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ^ 2) (C := η ^ 2) hAE_bound) have hμreal : μ.real Set.univ = 1 := by -- `μ` is a probability measure. simp [MeasureTheory.measureReal_def] have hnonneg_int : 0 ≤ ∫ t, ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ^ 2 ∂μ := by refine MeasureTheory.integral_nonneg ?_ intro t exact sq_nonneg _ -- Use `|∫ f| = ∫ f` for a nonnegative integrand. have habs : |∫ t, ‖(translateL2 (μ := (volume : Measure E)) (-t)) F - F‖ ^ 2 ∂μ| ≤ η ^ 2 := by have := hnorm_int -- Replace `‖·‖` by `abs` in `ℝ` and simplify `μ.real univ = 1`. simpa [Real.norm_eq_abs, hμreal, mul_one] using this simpa [abs_of_nonneg hnonneg_int, μ] using habs end Volume end end L2Compactness end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.Rellich /- Copyright (c) 2026 Adam Benenson. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ /- # `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.Rellich` Euclidean Rellich–Kondrachov compactness for fixed compact support (Lebesgue `volume`). This file discharges the “Euclidean heart” needed by the manifold Rellich glue: for a fixed compact set `K ⊆ E`, the inclusion `H¹ → L²` is compact when restricted to the closed subspace of `H¹` whose `L²` component is supported in `K` (a.e.). The proof uses: 1. the Euclidean `H¹` translation estimate `‖τ_a u - u‖₂ ≤ ‖a‖ · ‖∇u‖₂` (`TranslationEstimateH1`); 2. the Fréchet–Kolmogorov / smoothing-based `L²` compactness criterion (`L2CompactnessCriterion`). ## Main definitions / results - `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.h1On`: the closed subspace of `H¹(volume)` whose `L²` component is supported in `K` (a.e.). - `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.h1OnToL2`: the restricted inclusion map `h1On K →L[ℝ] L²(volume)`. - `RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean.isCompactOperator_h1OnToL2`: compactness of the inclusion. Tracking: Beads `lean-103.5.2.26.5.3.2.1`. -/ namespace RellichKondrachov namespace Analysis namespace FunctionalSpaces namespace Sobolev namespace Euclidean open scoped ENNReal MeasureTheory Topology open MeasureTheory Set noncomputable section section Volume variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [CompleteSpace E] /- ### Supported `H¹` subspace -/ /- ### Euclidean Rellich on fixed compact support -/ /- ### Codomain restriction and a compact map into `L²(volume.restrict K)` The definition of `h1On` forces the image of `h1OnToL2` to lie in the (closed) range of the extension-by-zero map from `volume.restrict K`. We record a codomain-restricted version and a convenient compact map to the restricted `L²` space. -/ end Volume end end Euclidean end Sobolev end FunctionalSpaces end Analysis end RellichKondrachov end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.RadialWindows def _root_.Bounty.NextSourceAux.atLeastTwo_seed : {_n : ℕ // (1 + 1 : ℕ).AtLeastTwo} := ⟨0, inferInstance⟩ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in lemma columnLog_three_split (A C S:Finset ι) (hAC:Disjoint A C) (hAS:Disjoint A S) (hCS:Disjoint C S) (ell:ℝ) (hell:0g (columnLog p ell U)) S = originalLabelColumn p hg b.support b.leftBit b.rightBit negative (multiplicativeCoreColumn p Ψ m (fun U=>g (columnLog p (ell/(primeProductNorm p (b.sideDivisor (!negative))*primeProductNorm p C)) U))) (∏i∈C,p i) f S := by have hA : b.sideDivisor (!negative)⊆b.support := by cases negative · exact hb.1 · exact hb.2 have hlog:=columnLog_three_split p hp (b.sideDivisor (!negative)) C S (hCB.symm.mono_left hA) (hSB.symm.mono_left hA) hSC.symm ell hell unfold canonicalCubeResidual originalLabelColumn multiplicativeCoreColumn have hside : (if negative then b.rightDivisor else b.leftDivisor)=b.sideDivisor (!negative) := by cases negative <;> rfl rw [hside] dsimp only rw [hlog] lemma actualFirstKernel_insert_windows (F B:Finset ι) (v:ι→ℕ) (ε₁ ε₂:ι→Bool) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂ c f:O) (g₁ g₂ W V₁ V₂:𝓢(ℝ,ℂ)) (X₁ X₂ K:ℝ) (d h:O) (hV₁:∀t,g₁ t≠0→V₁ t=1) (hV₂:∀t,g₂ t≠0→V₂ t=1) : actualFirstKernel p hp hcop hg F B v ε₁ ε₂ (originalLabelColumn p hg B ε₁ ε₂ true (multiplicativeCoreColumn p Ψ₁ m₁ (fun S=>g₁ (columnLog p X₁ S))) c f) (originalLabelColumn p hg B ε₁ ε₂ false (multiplicativeCoreColumn p Ψ₂ m₂ (fun S=>g₂ (columnLog p X₂ S))) c f) W (fun _=>1) (fun _=>1) X₁ X₂ K d h = actualFirstKernel p hp hcop hg F B v ε₁ ε₂ (originalLabelColumn p hg B ε₁ ε₂ true (multiplicativeCoreColumn p Ψ₁ m₁ (fun S=>g₁ (columnLog p X₁ S))) c f) (originalLabelColumn p hg B ε₁ ε₂ false (multiplicativeCoreColumn p Ψ₂ m₂ (fun S=>g₂ (columnLog p X₂ S))) c f) W V₁ V₂ X₁ X₂ K d h := by unfold actualFirstKernel apply Finset.sum_congr rfl intro N hN apply Finset.sum_congr rfl intro P hP by_cases hNP:Disjoint N P · simp only [hNP,ite_true,one_mul] by_cases h₁:g₁ (columnLog p X₁ N)=0 · simp only [threeGaussRowFactor,originalLabelColumn,multiplicativeCoreColumn,h₁,mul_zero,zero_mul,star_zero] by_cases h₂:g₂ (columnLog p X₂ P)=0 · simp only [threeGaussRowFactor,originalLabelColumn,multiplicativeCoreColumn,h₂,mul_zero,zero_mul] rw [hV₁ _ h₁,hV₂ _ h₂,one_mul,one_mul] · simp only [hNP,ite_false] end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap namespace FirstPassCubeLabels open ActualEisensteinCubic lemma conductor_zero_swap (parityBit a b:Bool) : conductorExponent parityBit a b=0 ↔ conductorExponent parityBit b a=0 := by cases parityBit <;> cases a <;> cases b <;> decide lemma conductor_parity_swap (parityBit a b:Bool) : (conductorExponent parityBit a b).val%2=(conductorExponent parityBit b a).val%2 := by cases parityBit <;> cases a <;> cases b <;> decide lemma dilationExponent_swap (parityBit a b:Bool) : dilationExponent parityBit a b=dilationExponent parityBit b a := by cases parityBit <;> cases a <;> cases b <;> rfl lemma retained_swap (parityBit a b:Bool) : retained parityBit a b=retained parityBit b a := by cases parityBit <;> cases a <;> cases b <;> rfl lemma b0Exponent_swap (m:ℕ) (a b:Bool) : b0Exponent m a b=b0Exponent m b a := by cases a <;> cases b <;> simp [b0Exponent,evenDouble] variable {ι:Type*} (p:ι→O) (B:Finset ι) (v:ι→ℕ) (ε₁ ε₂:ι→Bool) lemma cubeActiveSupport_swap : cubeActiveSupport B v ε₁ ε₂=cubeActiveSupport B v ε₂ ε₁ := by ext i simp only [cubeActiveSupport,Finset.mem_filter] constructor · rintro ⟨hi,he⟩ exact ⟨hi,fun hx=>he ((conductor_zero_swap (parity (v i)) (ε₁ i) (ε₂ i)).mpr hx)⟩ · rintro ⟨hi,he⟩ exact ⟨hi,fun hx=>he ((conductor_zero_swap (parity (v i)) (ε₁ i) (ε₂ i)).mp hx)⟩ lemma cubeOddSupport_swap : cubeOddSupport B v ε₁ ε₂=cubeOddSupport B v ε₂ ε₁ := by ext i simp only [cubeOddSupport,Finset.mem_filter,conductor_parity_swap (parity (v i)) (ε₁ i) (ε₂ i)] lemma dilationLabel_swap : dilationLabel p B v ε₁ ε₂=dilationLabel p B v ε₂ ε₁ := by unfold dilationLabel primeProduct apply Finset.prod_congr rfl intro i hi dsimp only rw [dilationExponent_swap (parity (v i)) (ε₁ i) (ε₂ i)] lemma jLabel_swap : jLabel p B v ε₁ ε₂=jLabel p B v ε₂ ε₁ := by unfold jLabel primeProduct apply Finset.prod_congr rfl intro i hi dsimp only rw [retained_swap (parity (v i)) (ε₁ i) (ε₂ i)] lemma b0Label_swap : b0Label p B v ε₁ ε₂=b0Label p B v ε₂ ε₁ := by unfold b0Label primeProduct apply Finset.prod_congr rfl intro i hi dsimp only rw [b0Exponent_swap (v i) (ε₁ i) (ε₂ i)] end FirstPassCubeLabels namespace SecondPassArithmetic section open ActualEisensteinCubic FirstPassCubeLabels theorem firstInputFamilyEnergy_swap {ι:Type*} [DecidableEq ι] (p:ι→O) [∀i,(Ideal.span {p i}).IsMaximal] (hg:∀i,lambda∉Ideal.span {p i}) (F B:Finset ι) (v:ι→ℕ) (ε₁ ε₂:ι→Bool) (negative:Bool) (Ψ:O→*ℂ) (m:O) (H:Finset ι→ℂ) (V:ℝ→ℂ) (X:ℝ) (c d:O) (J:ℕ) (T:Finset O) : firstInputFamilyEnergy p hg F B v ε₁ ε₂ negative Ψ m H V X c d J T = firstInputFamilyEnergy p hg F B v ε₂ ε₁ negative Ψ m H V X c d J T := by simp only [firstInputFamilyEnergy,firstCoreOuter,firstCoreInputRow, cubeOddSupport_swap B v ε₁ ε₂,b0Label_swap p B v ε₁ ε₂,jLabel_swap p B v ε₁ ε₂] namespace CubeCoordinates variable {ι:Type*} def swap (b:CubeCoordinates ι) : CubeCoordinates ι := ⟨b.rightExponent,b.leftExponent,b.rightDivisor,b.leftDivisor⟩ lemma swap_swap (b:CubeCoordinates ι) : b.swap.swap=b := by cases b;rfl end CubeCoordinates end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm actualFirstKernel originalLabelColumn cubeActiveSupport dilationLabel columnLog) open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) def orientedCubeFirstBlock (pool : Finset ι) (b : GlobalCubeBlock ι) (s : Finset (Ideal O × O)) (a : Ideal O × O → ℂ) (Ψ₁ Ψ₂ : O →* ℂ) (m₁ m₂ : O) (g₁ g₂ W V₁ V₂ : 𝓢(ℝ,ℂ)) (K ell : ℝ) : ℂ := let c := primeSubsetGenerator (fun i => Ideal.span {p i}) b.common let d := primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor let X₁ := globalCubeColumnScale p ell true b let X₂ := globalCubeColumnScale p ell false b (primeProductNorm p b.firstDivisor : ℂ)⁻¹ * ∑ x∈s,a x*actualFirstKernel p hp hcop hg (globalCubePool pool b) b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.rightBit b.cube.leftBit (originalLabelColumn p hg b.cube.support b.cube.rightBit b.cube.leftBit true (multiplicativeCoreColumn p Ψ₁ m₁ (fun S => g₁ (columnLog p X₁ S))) c (ConcretePrimeRowBridge.idealGenerator x.1)) (originalLabelColumn p hg b.cube.support b.cube.rightBit b.cube.leftBit false (multiplicativeCoreColumn p Ψ₂ m₂ (fun S => g₂ (columnLog p X₂ S))) c (ConcretePrimeRowBridge.idealGenerator x.1)) W V₁ V₂ X₁ X₂ K d x.2 end end open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct dilationLabel) open ConcreteTraceCRT (eisEmbedding) end SecondPassArithmetic namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ENNReal open RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean abbrev instMeasurableSpaceEuclideanSpatial : MeasurableSpace EuclideanSpatial := borel EuclideanSpatial theorem instBorelSpaceEuclideanSpatial : letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial BorelSpace EuclideanSpatial := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial ⟨rfl⟩ lemma euclideanC1c_supported_range : letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial ∀ (K : Set EuclideanSpatial) (hK : MeasurableSet K) (f : C1c (E := EuclideanSpatial)) (hf : Function.support f.1⊆K), toL2 («μ» := volume) f∈LinearMap.range (Lp.extendByZeroₗᵢ («μ» := (volume : Measure EuclideanSpatial)) (p := (2:ℝ≥0∞)) hK).toLinearMap := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial fun (K : Set EuclideanSpatial) (hK : MeasurableSet K) (f : C1c (E := EuclideanSpatial)) (hf : Function.support f.1⊆K) => by have hmem := memLp_of_mem_C1c («μ» := (volume : Measure EuclideanSpatial)) f.2 have hres : MemLp f.1 2 (volume.restrict K) := hmem.mono_measure Measure.restrict_le_self refine ⟨hres.toLp f.1,?_⟩ apply Lp.ext have hext := Lp.extendByZeroₗᵢ_ae_eq («μ» := (volume : Measure EuclideanSpatial)) hK (hres.toLp f.1) have hr : ∀ᵐx ∂(volume : Measure EuclideanSpatial),x∈K→hres.toLp f.1 x=f.1 x := (ae_restrict_iff' hK).mp hres.coeFn_toLp have hg : (toL2 («μ» := volume) f : EuclideanSpatial→ℝ)=ᵐ[volume]f.1 := hmem.coeFn_toLp filter_upwards [hext,hr,hg] with x hx hrx hgx simp only [LinearIsometry.coe_toLinearMap] rw [hx,hgx] by_cases hxm : x∈K · simpa only [Set.indicator_of_mem hxm] using hrx hxm · rw [Set.indicator_of_notMem hxm] symm by_contra hne exact hxm (hf hne) theorem euclidean_C1c_family_precompact : letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial ∀ (K : Set EuclideanSpatial) (hK : IsCompact K) (family : Set (C1c (E := EuclideanSpatial))) (R : ℝ) (hsupp : ∀f∈family, Function.support f.1 ⊆ K) (hmass : ∀f∈family, ‖toL2 («μ» := volume) f‖ ≤ R) (hgrad : ∀f∈family, ‖toL2Grad («μ» := volume) f‖ ≤ R), IsCompact (closure (toL2 («μ» := (volume : Measure EuclideanSpatial)) '' family)) := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial fun (K : Set EuclideanSpatial) (hK : IsCompact K) (family : Set (C1c (E := EuclideanSpatial))) (R : ℝ) (hsupp : ∀f∈family, Function.support f.1 ⊆ K) (hmass : ∀f∈family, ‖toL2 («μ» := volume) f‖ ≤ R) (hgrad : ∀f∈family, ‖toL2Grad («μ» := volume) f‖ ≤ R) => by let A : Set (Lp ℝ 2 ((volume : Measure EuclideanSpatial).restrict K)) := {u | L2Compactness.extendByZeroL2 hK.measurableSet u ∈ toL2 («μ» := volume) '' family} let R₀ : ℝ := max R 0 have hR₀ : 0 ≤ R₀ := le_max_right _ _ have hA : A ⊆ Metric.closedBall 0 R₀ := by intro u hu obtain ⟨f,hf,he⟩ := hu have hm := (hmass f hf).trans (le_max_left R 0) rw [he,L2Compactness.norm_extendByZeroL2] at hm simpa only [Metric.mem_closedBall,dist_zero_right] using hm have happrox : ∀ ε : ℝ, 0 < ε → ∃ ψ : EuclideanSpatial → ℝ, Continuous ψ ∧ HasCompactSupport ψ ∧ (∀ x, 0 ≤ ψ x) ∧ (∫ x, ψ x ∂(volume : Measure EuclideanSpatial)) = 1 ∧ ∀ u ∈ A, (∫ t, ‖translateL2 («μ» := volume) (-t) (L2Compactness.extendByZeroL2 hK.measurableSet u) - L2Compactness.extendByZeroL2 hK.measurableSet u‖^2 ∂L2Compactness.kernelMeasure ψ) ≤ (ε/2)^2 := by intro ε hε let radiusLocal : ℝ := (ε/2)/(R₀+1) have hradiusLocal : 0 < radiusLocal := by dsimp [radiusLocal]; positivity obtain ⟨ψ,hψc,hψs,hψ0,hψint,hψsupp⟩ := L2Compactness.exists_kernel_tsupport_subset_ball_integral_eq_one (E := EuclideanSpatial) (deltaLoss := radiusLocal) hradiusLocal refine ⟨ψ,hψc,hψs,hψ0,hψint,?_⟩ intro u hu apply L2Compactness.integral_norm_sq_translateL2_sub_le_sq_of_tsupport_subset_ball hψc hψs hψ0 hψint (show 0 ≤ ε/2 by positivity) hψsupp dsimp only intro t ht obtain ⟨f,hf,he⟩ := hu rw [← he] have htradiusLocal : ‖t‖ ≤ radiusLocal := le_of_lt (by simpa only [Metric.mem_ball,dist_zero_right] using ht) have hgR : ‖toL2Grad («μ» := volume) f‖ ≤ R₀ := (hgrad f hf).trans (le_max_left R 0) have hradiusLocalR : radiusLocal*R₀ ≤ ε/2 := by have hd : radiusLocal*(R₀+1) = ε/2 := div_mul_cancel₀ _ (by positivity : R₀+1 ≠ 0) nlinarith calc _ ≤ ‖-t‖ * ‖toL2Grad («μ» := volume) f‖ := norm_translateL2_sub_toL2_le (E := EuclideanSpatial) («μ» := (volume : Measure EuclideanSpatial)) (-t) f _ ≤ radiusLocal*R₀ := by rw [norm_neg]; exact mul_le_mul htradiusLocal hgR (norm_nonneg _) hradiusLocal.le _ ≤ ε/2 := hradiusLocalR have hc := L2Compactness.isCompact_closure_extendByZeroL2_image_of_forall_exists_translationIntegral_small hK hK.measurableSet hR₀ hA happrox have himage : L2Compactness.extendByZeroL2 hK.measurableSet '' A = toL2 («μ» := (volume : Measure EuclideanSpatial)) '' family := by apply Set.Subset.antisymm · rintro _ ⟨u,hu,rfl⟩ exact hu · rintro _ ⟨f,hf,rfl⟩ obtain ⟨u,hu⟩ := euclideanC1c_supported_range K hK.measurableSet f (hsupp f hf) have he : L2Compactness.extendByZeroL2 hK.measurableSet u = toL2 («μ» := volume) f := by rw [L2Compactness.extendByZeroL2_eq_extendByZeroₗᵢ] exact hu refine ⟨u,?_,he⟩ change L2Compactness.extendByZeroL2 hK.measurableSet u ∈ toL2 («μ» := volume) '' family rw [he] exact ⟨f,hf,rfl⟩ rw [himage] at hc exact hc end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold ENNReal InnerProductSpace namespace CubicEisenstein abbrev KernelFundamentalVolume : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measure HyperbolicSpace := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace hyperbolicVolume.restrict (hyperbolicFundamentalSet globalKubotaKernel) abbrev KernelGradientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Lp (EuclideanSpace ℂ (Fin 3)) 2 KernelFundamentalVolume lemma kernelTestPartial_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : kernelSmoothTests) (j : Fin 3), Continuous (fun w => kernelTestPartial f w j) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (f : kernelSmoothTests) (j : Fin 3) => by rw [continuous_iff_continuousAt] intro w exact (((kernelTestField_contDiffAt f _ (hyperbolicHeight_pos w)).continuousAt_fderiv (by simp)).clm_apply continuousAt_const).comp hyperbolicEuclideanCoordinates_continuous.continuousAt lemma kernelGradientAt_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : kernelSmoothTests), Continuous (fun w => kernelGradientAt w f) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (f : kernelSmoothTests) => by apply (PiLp.continuousLinearEquiv 2 ℂ (fun _ : Fin 3 => ℂ)).symm.continuous.comp apply continuous_pi intro j exact (Complex.continuous_ofReal.comp hyperbolicHeight_continuous).mul (kernelTestPartial_continuous f j) lemma kernelGradientAt_memLp : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : kernelSmoothTests), MemLp (fun w => kernelGradientAt w f) 2 KernelFundamentalVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (f : kernelSmoothTests) => by apply (memLp_two_iff_integrable_sq_norm (kernelGradientAt_continuous f).aestronglyMeasurable).mpr have hh := (quotient_projection_measurePreserving globalKubotaKernel).integrable_comp_of_integrable (kernelQuotientEnergyDensity_integrable f) have he : (fun w => kernelQuotientEnergyDensity f (integralOrbitProjection globalKubotaKernel w))= kernelTestEnergyDensity f := rfl dsimp only [Function.comp_def] at hh rw [he] at hh simpa only [kernelGradientAt_norm_sq] using hh def kernelGradientToL2 : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (f : kernelSmoothTests), KernelGradientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (f : kernelSmoothTests) => (kernelGradientAt_memLp f).toLp (fun w => kernelGradientAt w f) lemma kernelGradientToL2_coe : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (f : kernelSmoothTests), (kernelGradientToL2 f : HyperbolicSpace → EuclideanSpace ℂ (Fin 3))=ᵐ[KernelFundamentalVolume] fun w => kernelGradientAt w f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (f : kernelSmoothTests) => (kernelGradientAt_memLp f).coeFn_toLp lemma kernelGradientToL2_inner : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (f g : kernelSmoothTests), inner ℂ (kernelGradientToL2 f) (kernelGradientToL2 g)=kernelDirichletForm f g := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (f g : kernelSmoothTests) => by rw [L2.inner_def,kernelDirichletForm,integralQuotientVolume_integral _ _ (kernelDirichletPairDensity_integrable f g).aestronglyMeasurable] apply integral_congr_ae filter_upwards [kernelGradientToL2_coe f,kernelGradientToL2_coe g] with w hf hg rw [hf,hg,kernelDirichletPairDensity_coordinate] lemma kernelGradientToL2_norm_sq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (f : kernelSmoothTests), ‖kernelGradientToL2 f‖^2=kernelDirichletEnergy f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (f : kernelSmoothTests) => by have hh := kernelGradientToL2_inner f f rw [inner_self_eq_norm_sq_to_K,kernelDirichletForm_self] at hh rw [RCLike.ofReal_eq_complex_ofReal,←Complex.ofReal_pow] at hh exact Complex.ofReal_injective hh def kernelGradientLinear : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSmoothTests →ₗ[ℂ] KernelGradientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace { toFun := kernelGradientToL2 map_add' f g := by apply Lp.ext filter_upwards [kernelGradientToL2_coe (f+g),kernelGradientToL2_coe f, kernelGradientToL2_coe g,Lp.coeFn_add (kernelGradientToL2 f) (kernelGradientToL2 g)] with w hfg hf hg hadd simp only [hfg,hadd,Pi.add_apply,hf,hg,map_add] map_smul' c f := by apply Lp.ext filter_upwards [kernelGradientToL2_coe (c•f),kernelGradientToL2_coe f, Lp.coeFn_smul c (kernelGradientToL2 f)] with w hcf hf hsmul simp only [RingHom.id_apply,hcf,hsmul,Pi.smul_apply,hf,map_smul] } def kernelInitialGradientGraph : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Submodule ℂ (KernelQuotientL2 × KernelGradientL2) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace LinearMap.range (kernelSmoothTestsToL2.prod kernelGradientLinear) def kernelInitialGradient : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2 →ₗ.[ℂ] KernelGradientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelInitialGradientGraph.toLinearPMap end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.HarmonicAggregation namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace InitialMeanSquare open ActualEisensteinCubic SecondPassArithmetic open FirstPassCubeLabels (primeProductNorm) def initialRayMass : ℝ := letI rayFintypeWitness := @OAI.RayFourExpansion.rayCharacterFintype ∑ ray : SecondRayIndex,‖secondRayCoefficient ray‖ lemma initialRayMass_nonneg : 0 ≤ initialRayMass := Finset.sum_nonneg (fun _ _ => norm_nonneg _) variable {ι : Type*} [DecidableEq ι] (p : ι → O) [∀ i, (Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i => Ideal.span {p i})) include hinj in theorem initial_complementary_harmonic (F : Finset ι) (U : ℝ) : (∑ R ∈ boundedPrimeSupports p F U,1/primeProductNorm p R) ≤ 128*Real.exp 1*(normLogBin U+1 : ℝ) := by let f : Finset ι → Ideal O := fun R => ∏ i ∈ R,Ideal.span {p i} have hf : Function.Injective f := FirstCauchyArithmetic.family_product_injective _ hinj let T := (boundedPrimeSupports p F U).image f have hT : ∀ I ∈ T,I ≠ (0 : Ideal O) := by intro I hI obtain ⟨R,hR,rfl⟩ := Finset.mem_image.mp hI exact Finset.prod_ne_zero_iff.mpr (fun i _ => NeZero.ne (Ideal.span {p i})) have hU : ∀ I ∈ T,(Ideal.absNorm I : ℝ) ≤ U := by intro I hI obtain ⟨R,hR,rfl⟩ := Finset.mem_image.mp hI rw [←primeProductNorm_eq_ideal_norm p R] exact (Finset.mem_filter.mp hR).2 have hb := descent_ideal_inverse_sum T U hT hU rw [Finset.sum_image (fun R _ S _ h => hf h)] at hb simpa only [f,←primeProductNorm_eq_ideal_norm p] using hb include hinj in theorem initial_harmonic_aggregation (F : Finset ι) (U K D : ℝ) (hD : 0 ≤ D) (a : SecondRayIndex → Finset ι → SecondLogIndex → ℝ) (ha : ∀ ray, ∀ R ∈ boundedPrimeSupports p F U, ∀ j ∈ secondLogBinBox U K, a ray R j ≤ D/primeProductNorm p R*‖secondRayCoefficient ray‖) : letI rayFintypeWitness := @OAI.RayFourExpansion.rayCharacterFintype (∑ ray : SecondRayIndex, ∑ R ∈ boundedPrimeSupports p F U, ∑ j ∈ secondLogBinBox U K,a ray R j) ≤ D*initialRayMass*((secondLogBinBox U K).card : ℝ)* (128*Real.exp 1*(normLogBin U+1 : ℝ)) := by letI rayFintypeWitness := @OAI.RayFourExpansion.rayCharacterFintype let B := secondLogBinBox U K let C := 128*Real.exp 1*(normLogBin U+1 : ℝ) have hinner (ray : SecondRayIndex) : (∑ R ∈ boundedPrimeSupports p F U,∑ j ∈ B,a ray R j) ≤ (D*‖secondRayCoefficient ray‖*(B.card : ℝ))*C := by calc _ ≤ ∑ R ∈ boundedPrimeSupports p F U,∑ _j ∈ B, D/primeProductNorm p R*‖secondRayCoefficient ray‖ := by apply Finset.sum_le_sum intro R hR exact Finset.sum_le_sum (fun j hj => ha ray R hR j hj) _ = (D*‖secondRayCoefficient ray‖*(B.card : ℝ))* ∑ R ∈ boundedPrimeSupports p F U,1/primeProductNorm p R := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro R hR simp only [Finset.sum_const,nsmul_eq_mul] ring _ ≤ _ := mul_le_mul_of_nonneg_left (initial_complementary_harmonic p hinj F U) (by positivity) calc _ ≤ ∑ ray : SecondRayIndex,(D*‖secondRayCoefficient ray‖*(B.card : ℝ))*C := Finset.sum_le_sum (fun ray _ => hinner ray) _ = _ := by unfold initialRayMass simp only [Finset.sum_mul,Finset.mul_sum] apply Finset.sum_congr rfl intro ray hray ring end InitialMeanSquare open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic FirstPassCubeLabels open ConcretePrimeRowBridge (idealGenerator) variable {ι:Type*} [DecidableEq ι] (p:ι→O) (hp:∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) def sourceGlobalBlock (b:CubeCoordinates ι) (C D:Finset ι) : GlobalCubeBlock ι := ⟨b.swap,C,D⟩ lemma cube_swap_support (b:CubeCoordinates ι) : b.swap.support=b.support := by simp only [CubeCoordinates.swap,CubeCoordinates.support,Finset.union_comm] omit [DecidableEq ι] in lemma cube_swap_sum (b:CubeCoordinates ι) : (fun i=>b.swap.leftExponent i+b.swap.rightExponent i)= (fun i=>b.leftExponent i+b.rightExponent i) := by funext i exact Nat.add_comm _ _ lemma orientedCubeFirstBlock_single_source (pool:Finset ι) (b:CubeCoordinates ι) (C D:Finset ι) (I:Ideal O) (h:O) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W V₁ V₂:𝓢(ℝ,ℂ)) (K ell:ℝ) : orientedCubeFirstBlock p hp hcop hg pool (sourceGlobalBlock b C D) {(I,h)} (fun _=>1) Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W V₁ V₂ K ell = (primeProductNorm p D:ℂ)⁻¹ * actualFirstKernel p hp hcop hg (pool\(b.support∪C)) b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (originalLabelColumn p hg b.support b.leftBit b.rightBit true (multiplicativeCoreColumn p Ψ₁ m₁ (fun S=>g₁ (columnLog p (ell/(primeProductNorm p b.rightDivisor*primeProductNorm p C)) S))) (primeSubsetGenerator (fun i=>Ideal.span {p i}) C) (idealGenerator I)) (originalLabelColumn p hg b.support b.leftBit b.rightBit false (multiplicativeCoreColumn p Ψ₂ m₂ (fun S=>g₂ (columnLog p (ell/(primeProductNorm p b.leftDivisor*primeProductNorm p C)) S))) (primeSubsetGenerator (fun i=>Ideal.span {p i}) C) (idealGenerator I)) W V₁ V₂ (ell/(primeProductNorm p b.rightDivisor*primeProductNorm p C)) (ell/(primeProductNorm p b.leftDivisor*primeProductNorm p C)) K (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) h := by have hl : b.swap.leftBit=b.rightBit := rfl have hr : b.swap.rightBit=b.leftBit := rfl have hst : b.swap.sideDivisor true=b.rightDivisor := rfl have hsf : b.swap.sideDivisor false=b.leftDivisor := rfl simp only [orientedCubeFirstBlock,sourceGlobalBlock,globalCubePool,globalCubeColumnScale, globalFirstBlockColumnScale,GlobalCubeBlock.withCommon,cube_swap_support,cube_swap_sum, hl,hr,hst,hsf,Finset.sum_singleton,one_mul] lemma canonical_log_kernel (pool:Finset ι) (b:CubeCoordinates ι) (hb:b.Admissible) (C:Finset ι) (hCB:Disjoint C b.support) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂ f d h:O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (K ell:ℝ) (hell:0b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (canonicalCubeResidual p hg b C true Ψ₁ m₁ f (fun U=>g₁ (columnLog p ell U))) (canonicalCubeResidual p hg b C false Ψ₂ m₂ f (fun U=>g₂ (columnLog p ell U))) W (fun _=>1) (fun _=>1) 1 1 K d h = actualFirstKernel p hp hcop hg (pool\(b.support∪C)) b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (originalLabelColumn p hg b.support b.leftBit b.rightBit true (multiplicativeCoreColumn p Ψ₁ m₁ (fun S=>g₁ (columnLog p (ell/(primeProductNorm p b.rightDivisor*primeProductNorm p C)) S))) (∏i∈C,p i) f) (originalLabelColumn p hg b.support b.leftBit b.rightBit false (multiplicativeCoreColumn p Ψ₂ m₂ (fun S=>g₂ (columnLog p (ell/(primeProductNorm p b.leftDivisor*primeProductNorm p C)) S))) (∏i∈C,p i) f) W (fun _=>1) (fun _=>1) (ell/(primeProductNorm p b.rightDivisor*primeProductNorm p C)) (ell/(primeProductNorm p b.leftDivisor*primeProductNorm p C)) K d h := by unfold actualFirstKernel apply Finset.sum_congr rfl intro N hN apply Finset.sum_congr rfl intro P hP have hdis (S:Finset ι) (hS:S∈(pool\(b.support∪C)).powerset) : Disjoint S C ∧ Disjoint S b.support := by constructor <;> apply Finset.disjoint_left.mpr · intro i hi hx exact (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hS) hi)).2 (Finset.mem_union_right _ hx) · intro i hi hx exact (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hS) hi)).2 (Finset.mem_union_left _ hx) have h₁:=canonicalCubeResidual_log p hp hg b hb C N hCB (hdis N hN).1 (hdis N hN).2 true Ψ₁ m₁ f g₁ ell hell have h₂:=canonicalCubeResidual_log p hp hg b hb C P hCB (hdis P hP).1 (hdis P hP).2 false Ψ₂ m₂ f g₂ ell hell simp only [CubeCoordinates.sideDivisor,Bool.not_true,Bool.not_false,Bool.false_eq_true,ite_false,ite_true] at h₁ h₂ simp only [threeGaussRowFactor,h₁,h₂] def commonProductUnit (C:Finset ι) : Oˣ := Classical.choose (exists_label_unit (∏i∈C,p i) (∏i∈C,Ideal.span {p i}) (FiniteGaussPhase.span_finset_prod C p)) omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma commonProductUnit_spec (C:Finset ι) : (∏i∈C,p i)=(commonProductUnit p C:O)*primeSubsetGenerator (fun i=>Ideal.span {p i}) C := Classical.choose_spec (exists_label_unit (∏i∈C,p i) (∏i∈C,Ideal.span {p i}) (FiniteGaussPhase.span_finset_prod C p)) def commonCubePhase (b:CubeCoordinates ι) (C:Finset ι) : ℂ := blockRow p hg (cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit) (fun i=>(conductorExponent (parity (b.leftExponent i+b.rightExponent i)) (b.leftBit i) (b.rightBit i)).val) ((commonProductUnit p C:O)^2) lemma commonCubePhase_norm (b:CubeCoordinates ι) (C:Finset ι) : ‖commonCubePhase p hg b C‖=1 := commonUnitPhase_norm p hg b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (commonProductUnit p C) theorem canonicalSource_mode_attachment (pool:Finset ι) (b:CubeCoordinates ι) (hb:b.Admissible) (C D:Finset ι) (hCB:Disjoint C b.support) (I:Ideal O) (h:O) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W V₁ V₂:𝓢(ℝ,ℂ)) (K ell:ℝ) (hell:0b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (canonicalCubeResidual p hg b C true Ψ₁ m₁ (idealGenerator I) (fun U=>g₁ (columnLog p ell U))) (canonicalCubeResidual p hg b C false Ψ₂ m₂ (idealGenerator I) (fun U=>g₂ (columnLog p ell U))) W (fun _=>1) (fun _=>1) 1 1 K (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) h = (UniqueFactorizationMonoid.moebius (∏i∈D,Ideal.span {p i}):ℂ)*commonCubePhase p hg b C* orientedCubeFirstBlock p hp hcop hg pool (sourceGlobalBlock b C D) {(I,(commonProductUnit p C:O)^2*h)} (fun _=>1) Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W V₁ V₂ K ell := by have hFB:Disjoint (pool\(b.support∪C)) b.support := Finset.disjoint_left.mpr (fun i hi hiB=>(Finset.mem_sdiff.mp hi).2 (Finset.mem_union_left _ hiB)) rw [canonical_log_kernel p hp hcop hg pool b hb C hCB Ψ₁ Ψ₂ m₁ m₂ (idealGenerator I) _ h g₁ g₂ W K ell hell] rw [actualFirstKernel_insert_windows p hp hcop hg _ _ _ _ _ Ψ₁ Ψ₂ m₁ m₂ _ _ g₁ g₂ W V₁ V₂ _ _ K _ h hV₁ hV₂] rw [commonProductUnit_spec p C] rw [actualFirstKernel_common_unit p hp hcop hg _ _ hFB _ _ _ _ _ W V₁ V₂ _ _ K (commonProductUnit p C) _ (idealGenerator I) _ h] rw [orientedCubeFirstBlock_single_source] unfold commonCubePhase ring end section open ActualEisensteinCubic FirstPassCubeLabels open ConcretePrimeRowBridge (idealGenerator) open ConcreteTraceCRT (eisEmbedding) variable {ι:Type*} [DecidableEq ι] (p:ι→O) (hp:∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) lemma orientedCubeFirstBlock_eq_sum_single (pool:Finset ι) (b:GlobalCubeBlock ι) (s:Finset (Ideal O×O)) (a:Ideal O×O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W V₁ V₂:𝓢(ℝ,ℂ)) (K ell:ℝ) : orientedCubeFirstBlock p hp hcop hg pool b s a Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W V₁ V₂ K ell= ∑x∈s,a x*orientedCubeFirstBlock p hp hcop hg pool b {x} (fun _=>1) Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W V₁ V₂ K ell := by unfold orientedCubeFirstBlock simp only [Finset.sum_singleton,one_mul] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x hx ring def rawCanonicalBlock (pool:Finset ι) (b:GlobalCubeBlock ι) (s:Finset (Ideal O×O)) (a:Ideal O×O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (K ell:ℝ) : ℂ := let q:=b.cube.swap ∑x∈s,a x*((UniqueFactorizationMonoid.moebius (∏i∈b.firstDivisor,Ideal.span {p i}):ℂ)/ (primeProductNorm p b.firstDivisor:ℂ))* actualFirstKernel p hp hcop hg (pool\(q.support∪b.common)) q.support (fun i=>q.leftExponent i+q.rightExponent i) q.leftBit q.rightBit (canonicalCubeResidual p hg q b.common true Ψ₁ m₁ (idealGenerator x.1) (fun U=>g₁ (columnLog p ell U))) (canonicalCubeResidual p hg q b.common false Ψ₂ m₂ (idealGenerator x.1) (fun U=>g₂ (columnLog p ell U))) W (fun _=>1) (fun _=>1) 1 1 K (primeSubsetGenerator (fun i=>Ideal.span {p i}) b.firstDivisor) x.2 def sourceFrequencyEquiv (C:Finset ι) : (Ideal O×O)≃(Ideal O×O) := Equiv.prodCongr (Equiv.refl _) (unitSquareRowEquiv (commonProductUnit p C)) def sourceRotatedCoefficient (b:GlobalCubeBlock ι) (a:Ideal O×O→ℂ) (x:Ideal O×O) : ℂ := (UniqueFactorizationMonoid.moebius (∏i∈b.firstDivisor,Ideal.span {p i}):ℂ)* commonCubePhase p hg b.cube.swap b.common*a ((sourceFrequencyEquiv p b.common).symm x) omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma sourceFrequencyEquiv_label (C:Finset ι) (x:Ideal O×O) : (sourceFrequencyEquiv p C x).1=x.1 := rfl omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma sourceFrequencyEquiv_row_norm (C:Finset ι) (x:Ideal O×O) : ‖eisEmbedding (sourceFrequencyEquiv p C x).2‖=‖eisEmbedding x.2‖ := by have hr : (sourceFrequencyEquiv p C x).2=(commonProductUnit p C:O)^2*x.2 := rfl rw [hr,map_mul,norm_mul,map_pow,norm_pow,GaussGeneratorTransport.norm_eisEmbedding_unit,one_pow,one_mul] omit [DecidableEq ι] [∀ (i : ι), (span {p i}).IsMaximal] in lemma sourceFrequencyEquiv_row_ne_zero (C:Finset ι) (x:Ideal O×O) (hx:x.2≠0) : (sourceFrequencyEquiv p C x).2≠0 := by change (commonProductUnit p C:O)^2*x.2≠0 exact mul_ne_zero (pow_ne_zero _ (Units.ne_zero _)) hx lemma sourceRotatedCoefficient_norm (hinj:Function.Injective (fun i=>Ideal.span {p i})) (b:GlobalCubeBlock ι) (a:Ideal O×O→ℂ) (x:Ideal O×O) : ‖sourceRotatedCoefficient p hg b a x‖=‖a ((sourceFrequencyEquiv p b.common).symm x)‖ := by have hprime (i:ι):Prime (Ideal.span {p i}):= Ideal.prime_of_isPrime (NeZero.ne _) inferInstance have hμ : ‖(UniqueFactorizationMonoid.moebius (∏i∈b.firstDivisor,Ideal.span {p i}):ℂ)‖=1 := by have hh:=congrArg norm (FirstCauchyArithmetic.supportMobius_sq _ hprime hinj b.firstDivisor) simp only [norm_mul,norm_one] at hh change ‖FirstCauchyArithmetic.supportMobius (fun i=>Ideal.span {p i}) b.firstDivisor‖=1 nlinarith [norm_nonneg (FirstCauchyArithmetic.supportMobius (fun i=>Ideal.span {p i}) b.firstDivisor)] simp only [sourceRotatedCoefficient,norm_mul,hμ,commonCubePhase_norm,one_mul] theorem rawCanonicalBlock_eq_oriented (pool:Finset ι) (b:GlobalCubeBlock ι) (hb:GlobalCubeAdmissible b) (s:Finset (Ideal O×O)) (a:Ideal O×O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W V₁ V₂:𝓢(ℝ,ℂ)) (K ell:ℝ) (hell:0b.cube.swap.leftExponent i+b.cube.swap.rightExponent i) b.cube.swap.leftBit b.cube.swap.rightBit (canonicalCubeResidual p hg b.cube.swap b.common true Ψ₁ m₁ (idealGenerator x.1) (fun U=>g₁ (columnLog p ell U))) (canonicalCubeResidual p hg b.cube.swap b.common false Ψ₂ m₂ (idealGenerator x.1) (fun U=>g₂ (columnLog p ell U))) W (fun _=>1) (fun _=>1) 1 1 K (primeSubsetGenerator (fun i=>Ideal.span {p i}) b.firstDivisor) x.2) := by ring _ = _ := by rw [hmode];ring · exact fun x hx y hy hxy=>(sourceFrequencyEquiv p b.common).injective hxy end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct dilationLabel) open ConcreteTraceCRT (eisEmbedding) end open ActualEisensteinCubic open FirstPassCubeLabels (primeProductNorm actualFirstKernel originalLabelColumn cubeActiveSupport dilationLabel columnLog) open ConcreteTraceCRT (eisEmbedding) theorem padded_orientedCubeFirstBlock_input_transfer (W V₁ V₂ : 𝓢(ℝ,ℂ)) (M₁ M₂ : ℝ) (hM₁ : 0≤M₁) (hM₂ : 0≤M₂) (hV₁ : ∀ t,V₁ t≠0 → |t|≤M₁) (hV₂ : ∀ t,V₂ t≠0 → |t|≤M₂) (J : ℕ) (deltaLoss : ℝ) (hδ : 0 Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (s : GlobalCubeBlock ι → Finset (Ideal O × O)) (a : GlobalCubeBlock ι → Ideal O × O → ℂ) (w : GlobalCubeBlock ι → ℝ) (T : GlobalCubeBlock ι → Finset O) (Ψ₁ Ψ₂ : O →* ℂ) (m₁ m₂ : O) (g₁ g₂ : 𝓢(ℝ,ℂ)) (Ksrc K ell B F Ymax : ℝ), 0 b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit) x∈T b) → (∀ b∈blocks,∀ z∈T b,z≠0) → (∀ b∈blocks,∀ z∈T b,(Ideal.absNorm (Ideal.span {z}) : ℝ)≤ globalFirstPooledRow p K ell B F true (b.withCommon ∅)) → ‖(ell*B^2*F : ℂ)⁻¹*∑ b∈blocks,orientedCubeFirstBlock p hp hcop hg pool b (s b) (a b) Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W V₁ V₂ Ksrc ell‖ ≤ (Ksrc/K)*C*Ymax^deltaLoss* Real.sqrt (∑ b∈blocks,w b*globalCubeCoefficient p K ell B F true b* globalCubeInputFamilyEnergy p hg pool b Ψ₁ m₁ g₁ V₁ ell true J (T b)) * Real.sqrt (∑ b∈blocks,w b*globalCubeCoefficient p K ell B F false b* globalCubeInputFamilyEnergy p hg pool b Ψ₂ m₂ g₂ V₂ ell false J (T b)) := by obtain ⟨C,hC,hfirst⟩ := first_passage_full_uniform_input_family W V₁ V₂ M₁ M₂ hM₁ hM₂ hV₁ hV₂ J deltaLoss hδ refine ⟨C,hC,?_⟩ intro ι _ p hp _ hinj hcop hg hc hpr pool blocks s a w T Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ Ksrc K ell B F Ymax hKsrc hK hell hB hF hΨ₁ hΨ₂ hw ha hYmax hsf hs0 hmap hT0 hT by_cases hempty : blocks=∅ · subst blocks simp only [Finset.sum_empty,mul_zero,norm_zero,Real.sqrt_zero,le_refl] have hne : blocks.Nonempty := Finset.nonempty_iff_ne_empty.mpr hempty let E₁ := fun b => globalCubeInputFamilyEnergy p hg pool b Ψ₁ m₁ g₁ V₁ ell true J (T b) let E₂ := fun b => globalCubeInputFamilyEnergy p hg pool b Ψ₂ m₂ g₂ V₂ ell false J (T b) let v := fun b => w b*globalCubeCoefficient p K ell B F true b have hv (b) (hb : b∈blocks) : 0≤v b := mul_nonneg (hw b hb) (globalBinFirstCoefficient_nonneg K ell B F hK.le hell hB hF _) have hE₁ (b) : 0≤E₁ b := firstInputFamilyEnergy_nonneg p hg _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ have hE₂ (b) : 0≤E₂ b := firstInputFamilyEnergy_nonneg p hg _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ have hden : 0b.cube.leftExponent i+b.cube.rightExponent i) b.cube.rightBit b.cube.leftBit have hh := hfirst p hp hinj hcop hg hc hpr (globalCubePool pool b) b.cube.support hFB (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.rightBit b.cube.leftBit b.cube.support_pos Ψ₁ Ψ₂ m₁ m₂ (fun A => g₁ (columnLog p (globalCubeColumnScale p ell true b) A)) (fun A => g₂ (columnLog p (globalCubeColumnScale p ell false b) A)) (fun A hA => hΨ₁ _) (fun A hA => hΨ₂ _) _ _ hX₁ hX₂ Ksrc hKsrc (primeSubsetGenerator (fun i => Ideal.span {p i}) b.common) (primeSubsetGenerator (fun i => Ideal.span {p i}) b.firstDivisor) (primeSubsetGenerator_ne_zero _ _) (s b) (T b) (a b) (w b) (globalFirstPooledRow p K ell B F true (b.withCommon ∅)) (hw b hb) hY.le (hsf b hb) (hs0 b hb) (by simpa only [hswapD] using hmap b hb) (hT0 b hb) (hT b hb) (ha b hb) rw [firstInputFamilyEnergy_swap p hg (globalCubePool pool b) b.cube.support (fun i=>b.cube.leftExponent i+b.cube.rightExponent i) b.cube.rightBit b.cube.leftBit true, firstInputFamilyEnergy_swap p hg (globalCubePool pool b) b.cube.support (fun i=>b.cube.leftExponent i+b.cube.rightExponent i) b.cube.rightBit b.cube.leftBit false, FirstPassCubeLabels.cubeActiveSupport_swap b.cube.support (fun i=>b.cube.leftExponent i+b.cube.rightExponent i) b.cube.rightBit b.cube.leftBit] at hh have hscl := globalCube_first_scalar_bound p hp K ell B F hK hell hB hF b have hscl' : (ell*B^2*F)⁻¹*((Ksrc/primeProductNorm p b.firstDivisor)/ ‖eisEmbedding (∏ i∈cubeActiveSupport b.cube.support (fun i=>b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit,p i)‖) ≤ (Ksrc/K)*globalCubeCoefficient p K ell B F true b := by have hKratio : Ksrc=(Ksrc/K)*K := by field_simp calc _ = (Ksrc/K)*((ell*B^2*F)⁻¹*((K/primeProductNorm p b.firstDivisor)/ ‖eisEmbedding (∏ i∈cubeActiveSupport b.cube.support (fun i=>b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit,p i)‖)) := by conv_lhs => rw [hKratio] ring _ ≤ _ := mul_le_mul_of_nonneg_left hscl (div_nonneg hKsrc.le hK.le) have hpow := Real.rpow_le_rpow hY.le (hYmax b hb) hδ.le have hmul := mul_le_mul_of_nonneg_left hh (show 0≤(ell*B^2*F)⁻¹*(primeProductNorm p b.firstDivisor)⁻¹ by positivity) simp only [orientedCubeFirstBlock,norm_mul,norm_inv,Complex.norm_real, Real.norm_of_nonneg hD.le,←mul_assoc] apply hmul.trans calc _ = ((ell*B^2*F)⁻¹*((Ksrc/primeProductNorm p b.firstDivisor)/ ‖eisEmbedding (∏ i∈cubeActiveSupport b.cube.support (fun i => b.cube.leftExponent i+b.cube.rightExponent i) b.cube.leftBit b.cube.rightBit,p i)‖))* (w b*C*(globalFirstPooledRow p K ell B F true (b.withCommon ∅))^deltaLoss)* (Real.sqrt (E₁ b)*Real.sqrt (E₂ b)) := by dsimp [E₁,E₂,globalCubeInputFamilyEnergy];ring _ ≤ ((Ksrc/K)*globalCubeCoefficient p K ell B F true b)*(w b*C*Ymax^deltaLoss)* (Real.sqrt (E₁ b)*Real.sqrt (E₂ b)) := by apply mul_le_mul_of_nonneg_right _ (mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)) apply mul_le_mul hscl' (mul_le_mul_of_nonneg_left hpow (mul_nonneg (hw b hb) hC)) (mul_nonneg (mul_nonneg (hw b hb) hC) (Real.rpow_nonneg hY.le _)) (mul_nonneg (div_nonneg hKsrc.le hK.le) (globalBinFirstCoefficient_nonneg K ell B F hK.le hell hB hF _)) _ = _ := by dsimp [v];ring rw [norm_mul, norm_inv] have hn : ‖(ell*B^2*F : ℂ)‖=ell*B^2*F := by norm_cast exact abs_of_pos hden rw [hn] calc _ ≤ (ell*B^2*F)⁻¹*∑ b∈blocks,‖orientedCubeFirstBlock p hp hcop hg pool b (s b) (a b) Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W V₁ V₂ Ksrc ell‖ := mul_le_mul_of_nonneg_left (norm_sum_le _ _) (inv_nonneg.mpr hden.le) _ ≤ ∑ b∈blocks,((Ksrc/K)*C*Ymax^deltaLoss)*v b*(Real.sqrt (E₁ b)*Real.sqrt (E₂ b)) := by rw [Finset.mul_sum] exact Finset.sum_le_sum hpoint _ = ((Ksrc/K)*C*Ymax^deltaLoss)*∑ b∈blocks,Real.sqrt (v b*E₁ b)*Real.sqrt (v b*E₂ b) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro b hb rw [Real.sqrt_mul (hv b hb),Real.sqrt_mul (hv b hb)] have hs := Real.sq_sqrt (hv b hb) calc _ = ((Ksrc/K)*C*Ymax^deltaLoss)*(Real.sqrt (v b))^2*(Real.sqrt (E₁ b)*Real.sqrt (E₂ b)) := by rw [hs] _ = _ := by ring _ ≤ ((Ksrc/K)*C*Ymax^deltaLoss)*(Real.sqrt (∑ b∈blocks,v b*E₁ b)*Real.sqrt (∑ b∈blocks,v b*E₂ b)) := mul_le_mul_of_nonneg_left (by have hcauchy := Real.sum_sqrt_mul_sqrt_le blocks.attach (fun b => mul_nonneg (hv b.val b.property) (hE₁ b.val)) (fun b => mul_nonneg (hv b.val b.property) (hE₂ b.val)) simpa only [Finset.sum_attach (f := fun b => Real.sqrt (v b*E₁ b)*Real.sqrt (v b*E₂ b)), Finset.sum_attach (f := fun b => v b*E₁ b),Finset.sum_attach (f := fun b => v b*E₂ b)] using hcauchy) hpref _ = _ := by simp only [v,E₁,E₂,globalCubeCoefficient_side,mul_assoc] end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.PaddedPassage namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical SchwartzMap ContDiff namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct dilationLabel) open ConcreteTraceCRT (eisEmbedding) theorem padded_orientedTwoPassage_quantitative (W g₁ g₂ V₁ V₂ : 𝓢(ℝ,ℂ)) (M₁ M₂ N₁ N₂ : ℝ) (hM₁ : 0≤M₁) (hM₂ : 0≤M₂) (hN₁ : 0≤N₁) (hN₂ : 0≤N₂) (hg₁ : ∀ t,g₁ t≠0 → |t|≤M₁) (hg₂ : ∀ t,g₂ t≠0 → |t|≤M₂) (hV₁ : ∀ t,V₁ t≠0 → |t|≤N₁) (hV₂ : ∀ t,V₂ t≠0 → |t|≤N₂) (ε deltaLoss : ℝ) (hε : 0<ε) (hδ : 0 Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (s : GlobalCubeBlock ι → Finset (Ideal O × O)) (a : GlobalCubeBlock ι → Ideal O × O → ℂ) (w : GlobalCubeBlock ι → ℝ) (Ψ₁ Ψ₂ : O →* ℂ) (m₁ m₂ : O) (Γ Ksrc K ell B F H U : ℝ), 0≤Γ → 0 globalCubeFirstTargets p b (s b) have hT0 (b : GlobalCubeBlock ι) (hb : b∈blocks) (z : O) (hz : z∈T b) : z≠0 := globalCubeFirstTargets_ne_zero p hp b (s b) (hsf b hb) (hs0 b hb) z hz have hT (b : GlobalCubeBlock ι) (hb : b∈blocks) (z : O) (hz : z∈T b) : (Ideal.absNorm (Ideal.span {z}) : ℝ)≤globalFirstPooledRow p K ell B F true (b.withCommon ∅) := globalCubeFirstTargets_norm_bound p hp b (s b) K ell B F hK hell hB0 hF (hb₁ b hb) (hb₂ b hb) (hf b hb) (hh b hb) z hz have hTc (b : GlobalCubeBlock ι) (hb : b∈blocks) (z : O) (hz : z∈T b) : (Ideal.absNorm (Ideal.span {z}) : ℝ)≤globalFirstPooledRow p K ell B F false (b.withCommon ∅) := by rw [globalFirstPooledRow_side] exact hT b hb z hz have hblock := hfirst p hp hinj hcop hg hc hpr pool blocks s a w T Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ Ksrc K ell B F (globalFirstRowCap K ell B F) hKsrc hK hell hB0 hF hΨ₁ hΨ₂ (fun b hb => (hw b hb).1) ha (fun b hb => globalFirstPooledRow_le_cap p hp K ell B F hK hell hB0 hF b (hadm b hb) (hb₁ b hb) (hb₂ b hb)) hsf hs0 (fun b _ x hx => globalCubeFirstTargets_mem p b (s b) x hx) hT0 hT have hl := hleft p hp hcop hg hinj hc hpr pool blocks w Γ K ell B F H U Ψ₁ m₁ T hΓ hw hK hell hB hF hH hU hellU1 hadm hΨ₁ hb₁ hb₂ hT hT0 have hr := hright p hp hcop hg hinj hc hpr pool blocks w Γ K ell B F H U Ψ₂ m₂ T hΓ hw hK hell hB hF hH hU hellU2 hadm hΨ₂ hb₁ hb₂ hTc hT0 have hprefix : 0≤(Ksrc/K)*Cfirst*(globalFirstRowCap K ell B F)^deltaLoss := mul_nonneg (mul_nonneg (div_nonneg hKsrc.le hK.le) hCfirst) (Real.rpow_nonneg (globalFirstRowCap_pos K ell B F hK hell hB0 hF).le _) exact hblock.trans (mul_le_mul (mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hl) hprefix) (Real.sqrt_le_sqrt hr) (Real.sqrt_nonneg _) (mul_nonneg hprefix (Real.sqrt_nonneg _))) theorem padded_rawCanonicalTwoPassage_quantitative (W g₁ g₂ V₁ V₂ : 𝓢(ℝ,ℂ)) (M₁ M₂ N₁ N₂ : ℝ) (hM₁ : 0≤M₁) (hM₂ : 0≤M₂) (hN₁ : 0≤N₁) (hN₂ : 0≤N₂) (hg₁ : ∀ t,g₁ t≠0 → |t|≤M₁) (hg₂ : ∀ t,g₂ t≠0 → |t|≤M₂) (hV₁ : ∀ t,V₁ t≠0 → |t|≤N₁) (hV₂ : ∀ t,V₂ t≠0 → |t|≤N₂) (hWin₁ : ∀ t,g₁ t≠0 → V₁ t=1) (hWin₂ : ∀ t,g₂ t≠0 → V₂ t=1) (ε deltaLoss : ℝ) (hε : 0<ε) (hδ : 0 Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (s : GlobalCubeBlock ι → Finset (Ideal O × O)) (a : GlobalCubeBlock ι → Ideal O × O → ℂ) (w : GlobalCubeBlock ι → ℝ) (Ψ₁ Ψ₂ : O →* ℂ) (m₁ m₂ : O) (Γ Ksrc K ell B F H U : ℝ), 0≤Γ → 0(s b).image (sourceFrequencyEquiv p b.common) let a' := fun b:GlobalCubeBlock ι=>sourceRotatedCoefficient p hg b (a b) have heq : (∑b∈blocks,rawCanonicalBlock p hp hcop hg pool b (s b) (a b) Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W Ksrc ell)= ∑b∈blocks,orientedCubeFirstBlock p hp hcop hg pool b (s' b) (a' b) Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W V₁ V₂ Ksrc ell := by apply Finset.sum_congr rfl intro b hb exact rawCanonicalBlock_eq_oriented p hp hcop hg pool b (hadm b hb) (s b) (a b) Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W V₁ V₂ Ksrc ell hell hWin₁ hWin₂ rw [heq] apply htransfer p hp hinj hcop hg hc hpr pool blocks s' a' w Ψ₁ Ψ₂ m₁ m₂ Γ Ksrc K ell B F H U hΓ hKsrc hK hell hB hF hH hU hellU1 hellU2 hΨ₁ hΨ₂ hw · intro b hb x hx obtain ⟨y,hy,rfl⟩:=Finset.mem_image.mp hx dsimp only [a'] rw [sourceRotatedCoefficient_norm p hg hinj,Equiv.symm_apply_apply] exact ha b hb y hy · exact hadm · exact hb₁ · exact hb₂ · intro b hb x hx obtain ⟨y,hy,rfl⟩:=Finset.mem_image.mp hx rw [sourceFrequencyEquiv_label] exact hsf b hb y hy · intro b hb x hx obtain ⟨y,hy,rfl⟩:=Finset.mem_image.mp hx exact sourceFrequencyEquiv_row_ne_zero p b.common y (hs0 b hb y hy) · intro b hb x hx obtain ⟨y,hy,rfl⟩:=Finset.mem_image.mp hx rw [sourceFrequencyEquiv_label] exact hf b hb y hy · intro b hb x hx obtain ⟨y,hy,rfl⟩:=Finset.mem_image.mp hx rw [sourceFrequencyEquiv_row_norm] exact hh b hb y hy end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) def firstFrequencyDisk (R:ℝ) : Finset O := (ShortDraftLatticeCount.rowNormBall ⌈R⌉₊).filter (fun h=>‖eisEmbedding h‖^2≤R) lemma mem_firstFrequencyDisk (R:ℝ) (h:O) : h∈firstFrequencyDisk R ↔ ‖eisEmbedding h‖^2≤R := by constructor · exact fun hh=>(Finset.mem_filter.mp hh).2 · intro hh apply Finset.mem_filter.mpr refine ⟨?_,hh⟩ apply ShortDraftLatticeCount.mem_rowNormBall_of_absNorm_le rw [eisEmbedding_norm_sq_eq_absNorm_span] at hh exact_mod_cast hh.trans (Nat.le_ceil R) lemma firstFrequencyDisk_zero (R:ℝ) (hR:0≤R) : (0:O)∈firstFrequencyDisk R := by rw [mem_firstFrequencyDisk] simpa using hR lemma outside_firstFrequencyDisk (R:ℝ) (h:O) (hh:h∉firstFrequencyDisk R) : R<‖eisEmbedding h‖^2 := lt_of_not_ge (fun hb=>hh ((mem_firstFrequencyDisk R h).mpr hb)) end SecondPassArithmetic namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff SchwartzMap LineDeriv lemma euclideanCoordinateVector_eq_basis (j : Fin 3) : euclideanCoordinateVector j=EuclideanSpace.basisFun (Fin 3) ℝ j := by rw [EuclideanSpace.basisFun_apply] rfl lemma schwartz_toL2_norm_sq (g : 𝓢(EuclideanSpatial,ℂ)) : ‖g.toLp 2 volume‖^2=∫p,‖g p‖^2 := by calc ‖g.toLp 2 volume‖^2=inner ℝ (g.toLp 2 volume) (g.toLp 2 volume) := (real_inner_self_eq_norm_sq _).symm _ = ∫p,inner ℝ (g.toLp 2 volume p) (g.toLp 2 volume p) := rfl _ = _ := by apply integral_congr_ae filter_upwards [g.coeFn_toLp 2 volume] with p hp rw [hp,real_inner_self_eq_norm_sq] def kernelLocalizedDensity (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) : ℝ := ‖kernelLocalizedField χ f p‖^2+∑j : Fin 3,‖fderiv ℝ (kernelLocalizedField χ f) p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2 lemma kernelLocalizedDensity_eq_schwartz (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) : kernelLocalizedDensity χ f p=‖kernelLocalizedSchwartz χ f p‖^2+ ∑j : Fin 3,‖(∂_{euclideanCoordinateVector j} (kernelLocalizedSchwartz χ f)) p‖^2 := by simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv,euclideanCoordinateVector_eq_basis, kernelLocalizedSchwartz_coe] rfl lemma kernelLocalizedDensity_integrable (χ : PositiveChartCutoff) (f : kernelSmoothTests) : Integrable (kernelLocalizedDensity χ f) volume := by change Integrable (fun p => kernelLocalizedDensity χ f p) volume simp_rw [kernelLocalizedDensity_eq_schwartz] exact ((kernelLocalizedSchwartz χ f).memLp 2 volume).norm.integrable_sq.add (integrable_finsetSum _ (fun j _ => ((∂_{euclideanCoordinateVector j} (kernelLocalizedSchwartz χ f)).memLp 2 volume).norm.integrable_sq)) lemma kernelLocalizedH1_norm_sq (χ : PositiveChartCutoff) (f : kernelSmoothTests) : ‖kernelLocalizedH1 χ f‖^2=∫p,kernelLocalizedDensity χ f p := by rw [euclideanH1_norm_sq,kernelLocalizedH1_embedding,PiLp.norm_sq_eq_of_L2] simp_rw [kernelLocalizedH1_gradient,schwartz_toL2_norm_sq,kernelLocalizedDensity_eq_schwartz] rw [integral_add (((kernelLocalizedSchwartz χ f).memLp 2 volume).norm.integrable_sq) (integrable_finsetSum _ (fun j _ => ((∂_{euclideanCoordinateVector j} (kernelLocalizedSchwartz χ f)).memLp 2 volume).norm.integrable_sq)), integral_finsetSum _ (fun j _ => ((∂_{euclideanCoordinateVector j} (kernelLocalizedSchwartz χ f)).memLp 2 volume).norm.integrable_sq)] lemma kernelLocalizedDensity_zero (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : p∉tsupport χ.func) : kernelLocalizedDensity χ f p=0 := by have hz : kernelLocalizedField χ f=ᶠ[𝓝 p]0 := by filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hp] with q hq simp only [kernelLocalizedField,hq,Pi.zero_apply,zero_smul] simp only [kernelLocalizedDensity,hz.self_of_nhds,hz.fderiv_eq,fderiv_zero, Pi.zero_apply,_root_.zero_apply,norm_zero,zero_pow (by decide : 2≠0),Finset.sum_const_zero,add_zero] lemma kernelLocalizedDensity_le (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : 0

g (kernelEuclideanProjection p)) S volume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (S : Set EuclideanSpatial) (hS : MeasurableSet S) (hpos : S⊆euclideanUpperHalf) (hinj : Set.InjOn kernelEuclideanProjection S) (b : ℝ) (hb : 0≤b) (hheight : ∀p∈S,p 2≤b) (g : KernelQuotient→ℝ) (hg : Integrable g (integralQuotientVolume globalKubotaKernel)) => by have hm := kernelEuclideanProjection_measurePreserving_on S hS hpos hinj have hh := (hm.integrable_comp_of_integrable hg.integrableOn).smul_measure (c := ENNReal.ofReal (b^3)) ENNReal.ofReal_ne_top exact hh.mono_measure (euclideanVolume_le_heightCube_hyperbolic S hS hpos b hb hheight) theorem kernelLocalizedH1_norm_sq_le : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (M D A b : ℝ) (hM0 : 0≤M) (hD0 : 0≤D) (hA0 : 0≤A) (hb : 0≤b) (hheight : ∀p∈tsupport χ.func,p 2≤b) (hM : ∀p∈tsupport χ.func,(χ.func p)^2≤M) (hD : ∀p∈tsupport χ.func, (∑j : Fin 3,‖fderiv ℝ χ.func p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2)≤D) (hA : ∀p∈tsupport χ.func,(χ.func p)^2≤A*(p 2)^2) (f : kernelSmoothTests), ‖kernelLocalizedH1 χ f‖^2≤b^3*((M+2*D)*‖kernelSmoothTestsToL2 f‖^2+ 2*A*kernelDirichletEnergy f) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (M D A b : ℝ) (hM0 : 0≤M) (hD0 : 0≤D) (hA0 : 0≤A) (hb : 0≤b) (hheight : ∀p∈tsupport χ.func,p 2≤b) (hM : ∀p∈tsupport χ.func,(χ.func p)^2≤M) (hD : ∀p∈tsupport χ.func, (∑j : Fin 3,‖fderiv ℝ χ.func p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2)≤D) (hA : ∀p∈tsupport χ.func,(χ.func p)^2≤A*(p 2)^2) (f : kernelSmoothTests) => by let G : KernelQuotient→ℝ := fun q => (M+2*D)*‖f.1 q‖^2+2*A*kernelQuotientEnergyDensity f q have hG : Integrable G (integralQuotientVolume globalKubotaKernel) := (((kernelSmoothTests_memLp f).norm.integrable_sq).const_mul _).add ((kernelQuotientEnergyDensity_integrable f).const_mul _) have hGn : ∀q,0≤G q := by intro q dsimp only [G] positivity [kernelQuotientEnergyDensity_nonneg f q] have hS := χ.compact.measurableSet have hGI := kernelEuclideanProjection_volume_integrable (tsupport χ.func) hS χ.positive hinj b hb hheight G hG rw [kernelLocalizedH1_norm_sq] calc (∫p,kernelLocalizedDensity χ f p) = ∫p in tsupport χ.func,kernelLocalizedDensity χ f p := (setIntegral_eq_integral_of_forall_compl_eq_zero (kernelLocalizedDensity_zero χ f)).symm _ ≤ ∫p in tsupport χ.func,G (kernelEuclideanProjection p) := by apply setIntegral_mono_on (kernelLocalizedDensity_integrable χ f).integrableOn hGI hS intro p hp exact kernelLocalizedDensity_le χ f p (χ.positive hp) M D A (hM p hp) (hD p hp) (hA p hp) _ ≤ b^3*∫q,G q∂integralQuotientVolume globalKubotaKernel := kernelEuclideanProjection_volume_integral_le (tsupport χ.func) hS χ.positive hinj b hb hheight G hG hGn _ = _ := by dsimp only [G] rw [integral_add (((kernelSmoothTests_memLp f).norm.integrable_sq).const_mul _) ((kernelQuotientEnergyDensity_integrable f).const_mul _),integral_const_mul,integral_const_mul, ←kernelSmoothTestsToL2_norm_sq] rfl theorem kernelLocalizedH1_bounded : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)), ∃C : ℝ,0≤C ∧ ∀f : kernelSmoothTests, ‖kernelLocalizedH1 χ f‖^2≤C*(‖kernelSmoothTestsToL2 f‖^2+kernelDirichletEnergy f) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) => by have hgrad : Continuous (fun p : EuclideanSpatial => ∑j : Fin 3,‖fderiv ℝ χ.func p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2) := by apply continuous_finsetSum intro j hj exact (((χ.smooth.continuous_fderiv (by simp)).clm_apply continuous_const).norm.pow 2) have hratio : ContinuousOn (fun p : EuclideanSpatial => (χ.func p)^2/(p 2)^2) (tsupport χ.func) := (χ.smooth.continuous.pow 2).continuousOn.div (by fun_prop) (fun p hp => pow_ne_zero _ (ne_of_gt (χ.positive hp))) obtain ⟨m,hm⟩ := χ.compact.bddAbove_image (χ.smooth.continuous.pow 2).continuousOn obtain ⟨d,hd⟩ := χ.compact.bddAbove_image hgrad.continuousOn obtain ⟨a,ha⟩ := χ.compact.bddAbove_image hratio obtain ⟨b,hb⟩ := χ.compact.bddAbove_image (f := fun p : EuclideanSpatial => p 2) (by fun_prop) let M := max 0 m let D := max 0 d let A := max 0 a let B := max 0 b have hM0 : 0≤M := le_max_left _ _ have hD0 : 0≤D := le_max_left _ _ have hA0 : 0≤A := le_max_left _ _ have hB0 : 0≤B := le_max_left _ _ have hheight : ∀p∈tsupport χ.func,p 2≤B := fun p hp => (hb ⟨p,hp,rfl⟩).trans (le_max_right _ _) have hM : ∀p∈tsupport χ.func,(χ.func p)^2≤M := fun p hp => (hm ⟨p,hp,rfl⟩).trans (le_max_right _ _) have hD : ∀p∈tsupport χ.func, (∑j : Fin 3,‖fderiv ℝ χ.func p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2)≤D := fun p hp => (hd ⟨p,hp,rfl⟩).trans (le_max_right _ _) have hA : ∀p∈tsupport χ.func,(χ.func p)^2≤A*(p 2)^2 := fun p hp => (div_le_iff₀ (sq_pos_of_pos (χ.positive hp))).mp ((ha ⟨p,hp,rfl⟩).trans (le_max_right _ _)) refine ⟨B^3*(M+2*D+2*A),by positivity,fun f => ?_⟩ refine (kernelLocalizedH1_norm_sq_le χ hinj M D A B hM0 hD0 hA0 hB0 hheight hM hD hA f).trans ?_ rw [mul_assoc (B^3) (M+2*D+2*A)] apply mul_le_mul_of_nonneg_left _ (pow_nonneg hB0 3) have hm0 := sq_nonneg ‖kernelSmoothTestsToL2 f‖ have he0 := kernelDirichletEnergy_nonneg f nlinarith [mul_nonneg (by positivity : 0≤M+2*D) he0,mul_nonneg hA0 hm0] def kernelLocalizedSchwartzLinear (χ : PositiveChartCutoff) : kernelSmoothTests →ₗ[ℂ] 𝓢(EuclideanSpatial,ℂ) where toFun := kernelLocalizedSchwartz χ map_add' f g := by ext p change χ.func p • (kernelTestField f p+kernelTestField g p)=_ exact smul_add _ _ _ map_smul' c f := by ext p change χ.func p • (c • kernelTestField f p)=c • (χ.func p • kernelTestField f p) exact smul_comm _ _ _ def kernelLocalizedH1Linear (χ : PositiveChartCutoff) : kernelSmoothTests →ₗ[ℂ] EuclideanH1 where toFun := kernelLocalizedH1 χ map_add' f g := by apply euclideanH1Embedding_injective simp only [map_add,kernelLocalizedH1_embedding] rw [show kernelLocalizedSchwartz χ (f+g)=kernelLocalizedSchwartz χ f+kernelLocalizedSchwartz χ g from (kernelLocalizedSchwartzLinear χ).map_add f g] rfl map_smul' c f := by apply euclideanH1Embedding_injective simp only [map_smul,kernelLocalizedH1_embedding,RingHom.id_apply] rw [show kernelLocalizedSchwartz χ (c•f)=c•kernelLocalizedSchwartz χ f from (kernelLocalizedSchwartzLinear χ).map_smul c f] rfl end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff namespace CubicEisenstein abbrev KernelEnergyAmbient := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace WithLp 2 (KernelQuotientL2 × KernelGradientL2) def kernelEnergyCore : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSmoothTests →ₗ[ℂ] KernelEnergyAmbient := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (WithLp.linearEquiv 2 ℂ (KernelQuotientL2 × KernelGradientL2)).symm.toLinearMap.comp (kernelSmoothTestsToL2.prod kernelGradientLinear) def kernelEnergyGraphSubmodule : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Submodule ℂ KernelEnergyAmbient := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (LinearMap.range kernelEnergyCore).topologicalClosure abbrev KernelEnergyGraph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelEnergyGraphSubmodule theorem kernelEnergyGraph_complete : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace CompleteSpace KernelEnergyGraph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (LinearMap.range kernelEnergyCore).isClosed_topologicalClosure.completeSpace_coe example : InnerProductSpace ℂ KernelEnergyGraph := inferInstance def kernelEnergyGraphCore : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSmoothTests →ₗ[ℂ] KernelEnergyGraph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelEnergyCore.codRestrict kernelEnergyGraphSubmodule (fun f => (LinearMap.range kernelEnergyCore).le_topologicalClosure ⟨f,rfl⟩) lemma kernelEnergyGraphCore_dense : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace DenseRange kernelEnergyGraphCore := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [DenseRange,Subtype.dense_iff,←Set.range_comp] change closure (Set.range kernelEnergyCore)⊆closure (Set.range kernelEnergyCore) rfl def kernelEnergyMass : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelEnergyGraph →L[ℂ] KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (ContinuousLinearMap.fst ℂ KernelQuotientL2 KernelGradientL2).comp ((WithLp.prodContinuousLinearEquiv 2 ℂ KernelQuotientL2 KernelGradientL2).toContinuousLinearMap.comp kernelEnergyGraphSubmodule.subtypeL) def kernelEnergyGradient : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelEnergyGraph →L[ℂ] KernelGradientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (ContinuousLinearMap.snd ℂ KernelQuotientL2 KernelGradientL2).comp ((WithLp.prodContinuousLinearEquiv 2 ℂ KernelQuotientL2 KernelGradientL2).toContinuousLinearMap.comp kernelEnergyGraphSubmodule.subtypeL) lemma kernelEnergyMass_core : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (f : kernelSmoothTests), kernelEnergyMass (kernelEnergyGraphCore f)=kernelSmoothTestsToL2 f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (f : kernelSmoothTests) => rfl lemma kernelEnergyGradient_core : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (f : kernelSmoothTests), kernelEnergyGradient (kernelEnergyGraphCore f)=kernelGradientToL2 f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (f : kernelSmoothTests) => rfl lemma kernelEnergyGraph_norm_sq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (u : KernelEnergyGraph), ‖u‖^2=‖kernelEnergyMass u‖^2+‖kernelEnergyGradient u‖^2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (u : KernelEnergyGraph) => WithLp.prod_norm_sq_eq_of_L2 u.1 lemma kernelEnergyGraphCore_norm_sq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (f : kernelSmoothTests), ‖kernelEnergyGraphCore f‖^2=‖kernelSmoothTestsToL2 f‖^2+kernelDirichletEnergy f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (f : kernelSmoothTests) => by rw [kernelEnergyGraph_norm_sq,kernelEnergyMass_core,kernelEnergyGradient_core, kernelGradientToL2_norm_sq] lemma kernelEnergyMass_dense : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace DenseRange kernelEnergyMass := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply kernelSmoothTestsToL2_dense.mono rintro _ ⟨f,rfl⟩ exact ⟨kernelEnergyGraphCore f,rfl⟩ lemma kernelLocalizedH1_graph_bound : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)), ∃C : ℝ,∀f : kernelSmoothTests, ‖kernelLocalizedH1Linear χ f‖≤C*‖kernelEnergyGraphCore f‖ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) => by obtain ⟨C,hC,hbound⟩ := kernelLocalizedH1_bounded χ hinj refine ⟨Real.sqrt C,fun f => ?_⟩ have hh := hbound f rw [←kernelEnergyGraphCore_norm_sq] at hh apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg C) (norm_nonneg _))).mp change ‖kernelLocalizedH1 χ f‖^2≤(Real.sqrt C*‖kernelEnergyGraphCore f‖)^2 rw [mul_pow,Real.sq_sqrt hC] exact hh def kernelEnergyLocalize : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_euclideanH1Complete := @OAI.CubicEisenstein.euclideanH1Complete ∀ (χ : PositiveChartCutoff), KernelEnergyGraph →L[ℂ] EuclideanH1 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_euclideanH1Complete := @OAI.CubicEisenstein.euclideanH1Complete fun (χ : PositiveChartCutoff) => (kernelLocalizedH1Linear χ).extendOfNorm kernelEnergyGraphCore lemma kernelEnergyLocalize_core : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_euclideanH1Complete := @OAI.CubicEisenstein.euclideanH1Complete ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f : kernelSmoothTests), kernelEnergyLocalize χ (kernelEnergyGraphCore f)=kernelLocalizedH1 χ f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_euclideanH1Complete := @OAI.CubicEisenstein.euclideanH1Complete fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f : kernelSmoothTests) => LinearMap.extendOfNorm_eq kernelEnergyGraphCore_dense (kernelLocalizedH1_graph_bound χ hinj) f end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff SchwartzMap LineDeriv namespace CubicEisenstein def kernelLocalizedL2Linear (χ : PositiveChartCutoff) : kernelSmoothTests →ₗ[ℂ] EuclideanL2 := euclideanH1Embedding.toLinearMap.comp (kernelLocalizedH1Linear χ) lemma kernelLocalizedL2Linear_apply (χ : PositiveChartCutoff) (f : kernelSmoothTests) : kernelLocalizedL2Linear χ f=(kernelLocalizedSchwartz χ f).toLp 2 volume := rfl lemma kernelLocalizedL2_bounded : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)), ∃C : ℝ,0≤C ∧ ∀f : kernelSmoothTests, ‖kernelLocalizedL2Linear χ f‖^2≤C*‖kernelSmoothTestsToL2 f‖^2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) => by obtain ⟨m,hm⟩ := χ.compact.bddAbove_image (χ.smooth.continuous.pow 2).continuousOn obtain ⟨b,hb⟩ := χ.compact.bddAbove_image (f := fun p : EuclideanSpatial => p 2) (by fun_prop) let M := max 0 m let B := max 0 b have hM0 : 0≤M := le_max_left _ _ have hB0 : 0≤B := le_max_left _ _ have hheight : ∀p∈tsupport χ.func,p 2≤B := fun p hp => (hb ⟨p,hp,rfl⟩).trans (le_max_right _ _) have hM : ∀p∈tsupport χ.func,(χ.func p)^2≤M := fun p hp => (hm ⟨p,hp,rfl⟩).trans (le_max_right _ _) refine ⟨B^3*M,by positivity,fun f => ?_⟩ let G : KernelQuotient→ℝ := fun q => M*‖f.1 q‖^2 have hG : Integrable G (integralQuotientVolume globalKubotaKernel) := ((kernelSmoothTests_memLp f).norm.integrable_sq).const_mul M have hGn : ∀q,0≤G q := fun q => mul_nonneg hM0 (sq_nonneg _) have hS := χ.compact.measurableSet have hGI := kernelEuclideanProjection_volume_integrable (tsupport χ.func) hS χ.positive hinj B hB0 hheight G hG have hfi := ((kernelLocalizedSchwartz χ f).memLp 2 volume).norm.integrable_sq rw [kernelLocalizedL2Linear_apply,schwartz_toL2_norm_sq] calc (∫p,‖kernelLocalizedSchwartz χ f p‖^2) = ∫p in tsupport χ.func,‖kernelLocalizedSchwartz χ f p‖^2 := by apply (setIntegral_eq_integral_of_forall_compl_eq_zero _).symm intro p hp have hz := (notMem_tsupport_iff_eventuallyEq.mp hp).self_of_nhds change ‖χ.func p • kernelTestField f p‖^2=0 simp only [hz,Pi.zero_apply,zero_smul,norm_zero,zero_pow (by decide : 2≠0)] _ ≤ ∫p in tsupport χ.func,G (kernelEuclideanProjection p) := by apply setIntegral_mono_on hfi.integrableOn hGI hS intro p hp change ‖χ.func p • kernelTestField f p‖^2≤M*‖kernelTestField f p‖^2 simp only [norm_smul,mul_pow,Real.norm_eq_abs,sq_abs] exact mul_le_mul_of_nonneg_right (hM p hp) (sq_nonneg _) _ ≤ B^3*∫q,G q∂integralQuotientVolume globalKubotaKernel := kernelEuclideanProjection_volume_integral_le (tsupport χ.func) hS χ.positive hinj B hB0 hheight G hG hGn _ = _ := by dsimp only [G] rw [integral_const_mul,←kernelSmoothTestsToL2_norm_sq,mul_assoc] lemma kernelLocalizedL2_bound : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)), ∃C : ℝ,∀f : kernelSmoothTests, ‖kernelLocalizedL2Linear χ f‖≤C*‖kernelSmoothTestsToL2 f‖ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) => by obtain ⟨C,hC,hbound⟩ := kernelLocalizedL2_bounded χ hinj refine ⟨Real.sqrt C,fun f => ?_⟩ apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg C) (norm_nonneg _))).mp rw [mul_pow,Real.sq_sqrt hC] exact hbound f def kernelL2Localize : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff), KernelQuotientL2 →L[ℂ] EuclideanL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) => (kernelLocalizedL2Linear χ).extendOfNorm kernelSmoothTestsToL2 lemma kernelL2Localize_core : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f : kernelSmoothTests), kernelL2Localize χ (kernelSmoothTestsToL2 f)=(kernelLocalizedSchwartz χ f).toLp 2 volume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f : kernelSmoothTests) => LinearMap.extendOfNorm_eq kernelSmoothTestsToL2_dense (kernelLocalizedL2_bound χ hinj) f lemma kernelEnergyLocalize_mass : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (u : KernelEnergyGraph), euclideanH1Embedding (kernelEnergyLocalize χ u)=kernelL2Localize χ (kernelEnergyMass u) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (u : KernelEnergyGraph) => by have heq : (fun v => euclideanH1Embedding (kernelEnergyLocalize χ v))= fun v => kernelL2Localize χ (kernelEnergyMass v) := kernelEnergyGraphCore_dense.equalizer (by fun_prop) (by fun_prop) (by funext f simp only [Function.comp_apply,kernelEnergyLocalize_core χ hinj, kernelLocalizedH1_embedding,kernelEnergyMass_core,kernelL2Localize_core χ hinj]) exact congrFun heq u lemma kernelEnergyLocalize_eq_zero_of_mass_zero : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (u : KernelEnergyGraph) (hu : kernelEnergyMass u=0), kernelEnergyLocalize χ u=0 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (u : KernelEnergyGraph) (hu : kernelEnergyMass u=0) => by apply euclideanH1Embedding_eq_zero rw [kernelEnergyLocalize_mass χ hinj u,hu,map_zero] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.VariationalLaplacian namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff def kernelLiftedCutoff (χ : PositiveChartCutoff) (w : HyperbolicSpace) : ℝ := χ.func (hyperbolicEuclideanCoordinates w) lemma kernelLiftedCutoff_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (χ : PositiveChartCutoff), Continuous (kernelLiftedCutoff χ) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (χ : PositiveChartCutoff) => χ.smooth.continuous.comp hyperbolicEuclideanCoordinates_continuous lemma kernelLiftedCutoff_compact : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_hyperbolicT2Space := @OAI.CubicEisenstein.hyperbolicT2Space ∀ (χ : PositiveChartCutoff), HasCompactSupport (kernelLiftedCutoff χ) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_hyperbolicT2Space := @OAI.CubicEisenstein.hyperbolicT2Space fun (χ : PositiveChartCutoff) => by let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace apply HasCompactSupport.of_support_subset_isCompact (χ.compact.image_of_continuousOn (fun p hp => (euclideanToHyperbolic_contMDiffAt p (χ.positive hp)).continuousAt.continuousWithinAt)) intro w hw refine ⟨hyperbolicEuclideanCoordinates w,?_,euclideanToHyperbolic_coordinates w⟩ exact subset_tsupport χ.func hw lemma kernelLiftedCutoff_bounded (χ : PositiveChartCutoff) : ∃C : ℝ,∀w,‖kernelLiftedCutoff χ w‖≤C := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by obtain ⟨w,hw⟩ := (kernelLiftedCutoff_continuous χ).norm.exists_forall_ge_of_hasCompactSupport (kernelLiftedCutoff_compact χ).norm exact ⟨_,hw⟩ lemma kernelCutoffGradient_memLp : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (χ : PositiveChartCutoff) (g : KernelGradientL2), MemLp (fun w => kernelLiftedCutoff χ w • g w) 2 KernelFundamentalVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (χ : PositiveChartCutoff) (g : KernelGradientL2) => by obtain ⟨C,hC⟩ := kernelLiftedCutoff_bounded χ have hm : AEStronglyMeasurable (fun w => kernelLiftedCutoff χ w • g w) KernelFundamentalVolume := (kernelLiftedCutoff_continuous χ).aestronglyMeasurable.smul (Lp.aestronglyMeasurable g) refine (Lp.memLp g).of_le_mul (c := C) hm (Eventually.of_forall (fun w => ?_)) change ‖kernelLiftedCutoff χ w • g w‖≤C*‖g w‖ rw [norm_smul] exact mul_le_mul_of_nonneg_right (hC w) (norm_nonneg (g w)) def kernelCutoffGradient : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (g : KernelGradientL2), KernelGradientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (g : KernelGradientL2) => (kernelCutoffGradient_memLp χ g).toLp (fun w => kernelLiftedCutoff χ w • g w) lemma kernelCutoffGradient_coe : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (g : KernelGradientL2), (kernelCutoffGradient χ g : HyperbolicSpace→EuclideanSpace ℂ (Fin 3))=ᵐ[KernelFundamentalVolume] fun w => kernelLiftedCutoff χ w • g w := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (g : KernelGradientL2) => (kernelCutoffGradient_memLp χ g).coeFn_toLp def kernelCutoffGradientLinear : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff), KernelGradientL2 →ₗ[ℂ] KernelGradientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) => { toFun := kernelCutoffGradient χ map_add' g h := by apply Lp.ext filter_upwards [kernelCutoffGradient_coe χ (g+h),kernelCutoffGradient_coe χ g, kernelCutoffGradient_coe χ h,Lp.coeFn_add g h, Lp.coeFn_add (kernelCutoffGradient χ g) (kernelCutoffGradient χ h)] with w hgh hg hh ha ha' simp only [hgh,ha',ha,Pi.add_apply,hg,hh,smul_add] map_smul' c g := by apply Lp.ext filter_upwards [kernelCutoffGradient_coe χ (c•g),kernelCutoffGradient_coe χ g, Lp.coeFn_smul c g,Lp.coeFn_smul c (kernelCutoffGradient χ g)] with w hcg hg ha ha' simp only [RingHom.id_apply,hcg,ha',ha,Pi.smul_apply,hg] exact smul_comm _ _ _ } lemma kernelCutoffGradient_bound : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff), ∃C : ℝ,∀g : KernelGradientL2,‖kernelCutoffGradientLinear χ g‖≤C*‖g‖ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) => by obtain ⟨C,hC⟩ := kernelLiftedCutoff_bounded χ refine ⟨C,fun g => ?_⟩ apply Lp.norm_le_mul_norm_of_ae_le_mul filter_upwards [kernelCutoffGradient_coe χ g] with w hw change ‖kernelCutoffGradient χ g w‖≤_ rw [hw,norm_smul] exact mul_le_mul_of_nonneg_right (hC w) (norm_nonneg _) def kernelCutoffGradientCLM : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff), KernelGradientL2 →L[ℂ] KernelGradientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) => (kernelCutoffGradientLinear χ).mkContinuousOfExistsBound (kernelCutoffGradient_bound χ) lemma kernelCutoffGradient_norm_sq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (g : KernelGradientL2), ‖kernelCutoffGradientCLM χ g‖^2= ∫w,(kernelLiftedCutoff χ w)^2*‖g w‖^2∂KernelFundamentalVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (g : KernelGradientL2) => by calc ‖kernelCutoffGradientCLM χ g‖^2=inner ℝ (kernelCutoffGradientCLM χ g) (kernelCutoffGradientCLM χ g) := (real_inner_self_eq_norm_sq _).symm _ = ∫w,inner ℝ (kernelCutoffGradient χ g w) (kernelCutoffGradient χ g w)∂KernelFundamentalVolume := rfl _ = _ := by apply integral_congr_ae filter_upwards [kernelCutoffGradient_coe χ g] with w hw rw [hw,real_inner_self_eq_norm_sq,norm_smul,mul_pow,Real.norm_eq_abs,sq_abs] lemma kernelCutoffGradient_core_norm_sq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (f : kernelSmoothTests), ‖kernelCutoffGradientCLM χ (kernelGradientToL2 f)‖^2= ∫w,(kernelLiftedCutoff χ w)^2*kernelTestEnergyDensity f w∂KernelFundamentalVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (f : kernelSmoothTests) => by rw [kernelCutoffGradient_norm_sq] apply integral_congr_ae filter_upwards [kernelGradientToL2_coe f] with w hw rw [hw,kernelGradientAt_norm_sq] lemma kernelLocalizedField_reverse_energy (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : 0

q 2) hc rw [kernelTestEnergyDensity_eq_partials,hv] simp only [kernelTestPartial,hc] have hh := mul_le_mul_of_nonneg_left hsum (sq_nonneg (p 2)) unfold kernelLocalizedDensity nlinarith [mul_nonneg (sq_nonneg (p 2)) (sq_nonneg ‖kernelLocalizedField χ f p‖)] section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff ENNReal lemma kernelLocalizedDensity_nonneg (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) : 0≤kernelLocalizedDensity χ f p := by unfold kernelLocalizedDensity positivity lemma hyperbolicVolume_le_densityBound (S : Set EuclideanSpatial) (hS : MeasurableSet S) (hpos : S⊆euclideanUpperHalf) (H : ℝ) (hH : ∀p∈S,((p 2)^3)⁻¹≤H) : hyperbolicEuclideanVolume.restrict S≤ENNReal.ofReal H • volume.restrict S := by rw [hyperbolicEuclideanVolume,MeasureTheory.restrict_withDensity hS, Measure.restrict_restrict hS,Set.inter_eq_left.mpr hpos] have hh : hyperbolicDensity≤ᵐ[volume.restrict S] (fun _ => ENNReal.ofReal H) := by filter_upwards [ae_restrict_mem hS] with p hp exact ENNReal.ofReal_le_ofReal (hH p hp) simpa only [MeasureTheory.withDensity_const] using MeasureTheory.withDensity_mono hh theorem hyperbolicVolume_finiteOnCompacts : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_hyperbolicT2Space := @OAI.CubicEisenstein.hyperbolicT2Space IsFiniteMeasureOnCompacts hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_hyperbolicT2Space := @OAI.CubicEisenstein.hyperbolicT2Space { lt_top_of_isCompact K hK := by let S := hyperbolicEuclideanCoordinates '' K have hSK : IsCompact S := hK.image hyperbolicEuclideanCoordinates_continuous have hS : MeasurableSet S := hSK.measurableSet have hpos : S⊆euclideanUpperHalf := by rintro p ⟨w,hw,rfl⟩ exact hyperbolicHeight_pos w have hrho : ContinuousOn (fun p : EuclideanSpatial => ((p 2)^3)⁻¹) S := (by fun_prop : Continuous (fun p : EuclideanSpatial => (p 2)^3)).continuousOn.inv₀ (fun p hp => pow_ne_zero _ (ne_of_gt (hpos hp))) obtain ⟨H,hH⟩ := hSK.bddAbove_image hrho have hb := hyperbolicVolume_le_densityBound S hS hpos H (fun p hp => hH ⟨p,hp,rfl⟩) have hm : hyperbolicEuclideanVolume S< (∞ : ℝ≥0∞) := by have hbu := Measure.le_iff.mp hb Set.univ MeasurableSet.univ simp only [Measure.restrict_apply MeasurableSet.univ,Set.univ_inter,Measure.smul_apply, smul_eq_mul] at hbu exact hbu.trans_lt (ENNReal.mul_lt_top ENNReal.ofReal_lt_top hSK.measure_lt_top) have heq : euclideanToHyperbolic ⁻¹' K=ᵐ[hyperbolicEuclideanVolume]S := by filter_upwards [hyperbolicEuclideanVolume_ae_positive] with p hp apply propext constructor · intro h exact ⟨euclideanToHyperbolic p,h,hyperbolicEuclideanCoordinates_toHyperbolic p hp⟩ · rintro ⟨w,hw,rfl⟩ change euclideanToHyperbolic (hyperbolicEuclideanCoordinates w) ∈ K simpa only [euclideanToHyperbolic_coordinates] using hw rw [hyperbolicVolume,Measure.map_apply euclideanToHyperbolic_measurable hK.measurableSet, measure_congr heq] exact hm } private lemma integrable_sq_mul_of_compact : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (a b : HyperbolicSpace → ℝ) (ha : Continuous a) (hb : Continuous b) (hc : HasCompactSupport a), Integrable (fun w => (a w)^2*b w) hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (a b : HyperbolicSpace → ℝ) (ha : Continuous a) (hb : Continuous b) (hc : HasCompactSupport a) => letI := @OAI.CubicEisenstein.hyperbolicVolume_finiteOnCompacts by have hs : HasCompactSupport (fun w => (a w)^2) := hc.comp_left (g := fun x : ℝ => x^2) (by simp) exact ((ha.pow 2).mul hb).integrable_of_hasCompactSupport hs.mul_right lemma kernelLiftedCutoffEnergy_integrable : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (f : kernelSmoothTests), Integrable (fun w => (kernelLiftedCutoff χ w)^2*kernelTestEnergyDensity f w) hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (f : kernelSmoothTests) => integrable_sq_mul_of_compact (kernelLiftedCutoff χ) (kernelTestEnergyDensity f) (kernelLiftedCutoff_continuous χ) (kernelTestEnergyDensity_continuous f) (kernelLiftedCutoff_compact χ) lemma kernelLiftedCutoffEnergy_integral : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (f : kernelSmoothTests), (∫w,(kernelLiftedCutoff χ w)^2*kernelTestEnergyDensity f w∂hyperbolicVolume)= ∫p,(χ.func p)^2*kernelTestEnergyDensity f (euclideanToHyperbolic p)∂hyperbolicEuclideanVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (f : kernelSmoothTests) => by rw [hyperbolicVolume,integral_map euclideanToHyperbolic_measurable.aemeasurable (kernelLiftedCutoffEnergy_integrable χ f).aestronglyMeasurable] apply integral_congr_ae filter_upwards [hyperbolicEuclideanVolume_ae_positive] with p hp simp only [kernelLiftedCutoff,hyperbolicEuclideanCoordinates_toHyperbolic p hp] lemma kernelCutoffGradient_core_estimate : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (B D H : ℝ) (_hB : 0≤B) (hD : 0≤D) (hH : 0≤H) (hheight : ∀p∈tsupport χ.func,p 2≤B) (hderiv : ∀p∈tsupport χ.func, (∑j : Fin 3,‖fderiv ℝ χ.func p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2)≤D) (hdensity : ∀p∈tsupport χ.func,((p 2)^3)⁻¹≤H) (f : kernelSmoothTests), ‖kernelCutoffGradientCLM χ (kernelGradientToL2 f)‖^2≤ 2*B^2*(H*‖kernelLocalizedH1 χ f‖^2+D*‖kernelSmoothTestsToL2 f‖^2) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (B D H : ℝ) (_hB : 0≤B) (hD : 0≤D) (hH : 0≤H) (hheight : ∀p∈tsupport χ.func,p 2≤B) (hderiv : ∀p∈tsupport χ.func, (∑j : Fin 3,‖fderiv ℝ χ.func p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2)≤D) (hdensity : ∀p∈tsupport χ.func,((p 2)^3)⁻¹≤H) (f : kernelSmoothTests) => by let S := tsupport χ.func have hS : MeasurableSet S := χ.compact.measurableSet have hpos : S⊆euclideanUpperHalf := χ.positive have hmeasure := hyperbolicVolume_le_densityBound S hS hpos H hdensity have hloc : IntegrableOn (kernelLocalizedDensity χ f) S hyperbolicEuclideanVolume := (((kernelLocalizedDensity_integrable χ f).integrableOn).smul_measure (c := ENNReal.ofReal H) ENNReal.ofReal_ne_top).mono_measure hmeasure have hmass : IntegrableOn (fun p => ‖kernelTestField f p‖^2) S hyperbolicEuclideanVolume := by exact (kernelEuclideanProjection_measurePreserving_on S hS hpos hinj).integrable_comp_of_integrable ((kernelSmoothTests_memLp f).norm.integrable_sq.integrableOn) have hweight : IntegrableOn (fun p => (χ.func p)^2*kernelTestEnergyDensity f (euclideanToHyperbolic p)) S hyperbolicEuclideanVolume := by have hh := (kernelLiftedCutoffEnergy_integrable χ f).comp_measurable euclideanToHyperbolic_measurable have heq : (fun p => (kernelLiftedCutoff χ (euclideanToHyperbolic p))^2* kernelTestEnergyDensity f (euclideanToHyperbolic p))=ᵐ[hyperbolicEuclideanVolume] fun p => (χ.func p)^2*kernelTestEnergyDensity f (euclideanToHyperbolic p) := by filter_upwards [hyperbolicEuclideanVolume_ae_positive] with p hp simp only [kernelLiftedCutoff,hyperbolicEuclideanCoordinates_toHyperbolic p hp] exact (hh.congr heq).integrableOn have hlocBound : (∫p in S,kernelLocalizedDensity χ f p∂hyperbolicEuclideanVolume)≤ H*‖kernelLocalizedH1 χ f‖^2 := by have hh := integral_mono_measure hmeasure (Eventually.of_forall (kernelLocalizedDensity_nonneg χ f)) (((kernelLocalizedDensity_integrable χ f).integrableOn).smul_measure (c := ENNReal.ofReal H) ENNReal.ofReal_ne_top) rw [integral_smul_measure,ENNReal.toReal_ofReal hH] at hh rw [kernelLocalizedH1_norm_sq] exact hh.trans (mul_le_mul_of_nonneg_left (setIntegral_le_integral (kernelLocalizedDensity_integrable χ f) (Eventually.of_forall (kernelLocalizedDensity_nonneg χ f))) hH) rw [kernelCutoffGradient_core_norm_sq] calc _ ≤ ∫w,(kernelLiftedCutoff χ w)^2*kernelTestEnergyDensity f w∂hyperbolicVolume := setIntegral_le_integral (kernelLiftedCutoffEnergy_integrable χ f) (Eventually.of_forall (fun w => mul_nonneg (sq_nonneg _) (kernelTestEnergyDensity_nonneg f w))) _ = ∫p in S,(χ.func p)^2*kernelTestEnergyDensity f (euclideanToHyperbolic p)∂hyperbolicEuclideanVolume := by rw [kernelLiftedCutoffEnergy_integral] apply (setIntegral_eq_integral_of_forall_compl_eq_zero _).symm intro p hp have hz := (notMem_tsupport_iff_eventuallyEq.mp hp).self_of_nhds simp only [hz,Pi.zero_apply,zero_pow (by decide : 2≠0),zero_mul] _ ≤ ∫p in S,(2*B^2*kernelLocalizedDensity χ f p+2*B^2*D*‖kernelTestField f p‖^2) ∂hyperbolicEuclideanVolume := by apply setIntegral_mono_on hweight ((hloc.const_mul _).add (hmass.const_mul _)) hS intro p hp refine (kernelLocalizedField_reverse_energy χ f p (hpos hp)).trans ?_ simp only [Pi.add_apply] gcongr · exact kernelLocalizedDensity_nonneg _ _ _ · exact (hpos hp).le · exact hheight p hp · exact (hpos hp).le · exact hheight p hp · exact hderiv p hp _ = 2*B^2*((∫p in S,kernelLocalizedDensity χ f p∂hyperbolicEuclideanVolume)+ D*(∫p in S,‖kernelTestField f p‖^2∂hyperbolicEuclideanVolume)) := by rw [integral_add (hloc.const_mul _) (hmass.const_mul _),integral_const_mul,integral_const_mul] ring _ ≤ _ := by gcongr exact kernelLocalMass_le S hS hpos hinj f lemma kernelCutoffGradient_core_bounded : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)), ∃C : ℝ,0≤C ∧ ∀f : kernelSmoothTests, ‖kernelCutoffGradientCLM χ (kernelGradientToL2 f)‖^2≤ C*(‖kernelLocalizedH1 χ f‖^2+‖kernelSmoothTestsToL2 f‖^2) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) => by have hgrad : Continuous (fun p : EuclideanSpatial => ∑j : Fin 3,‖fderiv ℝ χ.func p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2) := by apply continuous_finsetSum intro j hj exact (((χ.smooth.continuous_fderiv (by simp)).clm_apply continuous_const).norm.pow 2) have hrho : ContinuousOn (fun p : EuclideanSpatial => ((p 2)^3)⁻¹) (tsupport χ.func) := (by fun_prop : Continuous (fun p : EuclideanSpatial => (p 2)^3)).continuousOn.inv₀ (fun p hp => pow_ne_zero _ (ne_of_gt (χ.positive hp))) obtain ⟨d,hd⟩ := χ.compact.bddAbove_image hgrad.continuousOn obtain ⟨r,hr⟩ := χ.compact.bddAbove_image hrho obtain ⟨b,hb⟩ := χ.compact.bddAbove_image (f := fun p : EuclideanSpatial => p 2) (by fun_prop) let D := max 0 d let H := max 0 r let B := max 0 b have hD : 0≤D := le_max_left _ _ have hH : 0≤H := le_max_left _ _ have hB : 0≤B := le_max_left _ _ have hheight : ∀p∈tsupport χ.func,p 2≤B := fun p hp => (hb ⟨p,hp,rfl⟩).trans (le_max_right _ _) have hderiv : ∀p∈tsupport χ.func, (∑j : Fin 3,‖fderiv ℝ χ.func p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2)≤D := fun p hp => (hd ⟨p,hp,rfl⟩).trans (le_max_right _ _) have hdensity : ∀p∈tsupport χ.func,((p 2)^3)⁻¹≤H := fun p hp => (hr ⟨p,hp,rfl⟩).trans (le_max_right _ _) refine ⟨2*B^2*(H+D),by positivity,fun f => ?_⟩ refine (kernelCutoffGradient_core_estimate χ hinj B D H hB hD hH hheight hderiv hdensity f).trans ?_ rw [mul_assoc (2*B^2)] apply mul_le_mul_of_nonneg_left _ (by positivity) nlinarith [mul_nonneg hH (sq_nonneg ‖kernelSmoothTestsToL2 f‖), mul_nonneg hD (sq_nonneg ‖kernelLocalizedH1 χ f‖)] lemma kernelEnergyCutoffGradient_eq_zero : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (u : KernelEnergyGraph) (hu : kernelEnergyMass u=0), kernelCutoffGradientCLM χ (kernelEnergyGradient u)=0 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (u : KernelEnergyGraph) (hu : kernelEnergyMass u=0) => by obtain ⟨C,hC,hbound⟩ := kernelCutoffGradient_core_bounded χ hinj have hh : ‖kernelCutoffGradientCLM χ (kernelEnergyGradient u)‖^2≤ C*(‖kernelEnergyLocalize χ u‖^2+‖kernelEnergyMass u‖^2) := kernelEnergyGraphCore_dense.induction_on u (isClosed_le (by fun_prop) (by fun_prop)) (fun f => by simpa only [kernelEnergyGradient_core,kernelEnergyMass_core, kernelEnergyLocalize_core χ hinj] using hbound f) rw [kernelEnergyLocalize_eq_zero_of_mass_zero χ hinj u hu,hu] at hh have hz : ‖kernelCutoffGradientCLM χ (kernelEnergyGradient u)‖=0 := by simpa using hh exact norm_eq_zero.mp hz lemma kernelCutoffGradient_faithful : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (g : KernelGradientL2) (hg : ∀χ : PositiveChartCutoff, Set.InjOn kernelEuclideanProjection (tsupport χ.func) → kernelCutoffGradientCLM χ g=0), g=0 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (g : KernelGradientL2) (hg : ∀χ : PositiveChartCutoff, Set.InjOn kernelEuclideanProjection (tsupport χ.func) → kernelCutoffGradientCLM χ g=0) => by let : SecondCountableTopology HyperbolicSpace := hyperbolicSecondCountable let Cutoff := {χ : PositiveChartCutoff // Set.InjOn kernelEuclideanProjection (tsupport χ.func)} let U : Cutoff→Set HyperbolicSpace := fun χ => {w | kernelLiftedCutoff χ.1 w≠0} have hU : ∀χ,IsOpen (U χ) := fun χ => isOpen_ne.preimage (kernelLiftedCutoff_continuous χ.1) have hcover : (Set.univ : Set HyperbolicSpace)⊆⋃χ,U χ := by intro w hw obtain ⟨χ,hχ,hrange,hinj⟩ := kernelChartCutoff_exists (hyperbolicEuclideanCoordinates w) (hyperbolicHeight_pos w) refine Set.mem_iUnion.mpr ⟨⟨χ,hinj⟩,?_⟩ change χ.func (hyperbolicEuclideanCoordinates w)≠0 rw [hχ] norm_num obtain ⟨r,hr,hcov⟩ := isLindelof_univ.elim_countable_subcover U hU hcover let : Countable r := hr.to_subtype have heach (χ : Cutoff) : ∀ᵐw∂KernelFundamentalVolume,kernelLiftedCutoff χ.1 w • g w=0 := by have hzero := hg χ.1 χ.2 change kernelCutoffGradient χ.1 g=0 at hzero filter_upwards [kernelCutoffGradient_coe χ.1 g, (Lp.coeFn_zero (E := EuclideanSpace ℂ (Fin 3)) (p := (2:ℝ≥0∞)) («μ» := KernelFundamentalVolume))] with w hw hz rw [hzero] at hw exact hw.symm.trans hz have hall : ∀ᵐw∂KernelFundamentalVolume,∀χ : r,kernelLiftedCutoff χ.1.1 w • g w=0 := ae_all_iff.mpr (fun χ => heach χ.1) apply Lp.ext filter_upwards [hall, (Lp.coeFn_zero (E := EuclideanSpace ℂ (Fin 3)) (p := (2:ℝ≥0∞)) («μ» := KernelFundamentalVolume))] with w hw hz obtain ⟨χ,hχ⟩ := Set.mem_iUnion.mp (hcov (Set.mem_univ w)) obtain ⟨hχr,hχw⟩ := Set.mem_iUnion.mp hχ have hsm := hw ⟨χ,hχr⟩ have hne : kernelLiftedCutoff χ.1 w≠0 := hχw exact ((smul_eq_zero.mp hsm).resolve_left hne).trans hz.symm theorem kernelEnergyMass_eq_zero : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (u : KernelEnergyGraph) (hu : kernelEnergyMass u=0), u=0 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (u : KernelEnergyGraph) (hu : kernelEnergyMass u=0) => by have hgrad : kernelEnergyGradient u=0 := kernelCutoffGradient_faithful _ (fun χ hinj => kernelEnergyCutoffGradient_eq_zero χ hinj u hu) apply norm_eq_zero.mp have hn := kernelEnergyGraph_norm_sq u simp only [hu,hgrad,norm_zero,zero_pow (by decide : 2≠0),add_zero] at hn nlinarith [norm_nonneg u] theorem kernelEnergyMass_injective : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Function.Injective kernelEnergyMass := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by intro u v huv apply sub_eq_zero.mp apply kernelEnergyMass_eq_zero rw [map_sub,huv,sub_self] def kernelWeakGradient : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2 →ₗ.[ℂ] KernelGradientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelInitialGradient.closure end section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff InnerProductSpace lemma kernelEnergyGraph_inner : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (u v : KernelEnergyGraph), inner ℂ u v=inner ℂ (kernelEnergyMass u) (kernelEnergyMass v)+ inner ℂ (kernelEnergyGradient u) (kernelEnergyGradient v) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (u v : KernelEnergyGraph) => rfl def kernelVariationalSolution : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2 →L[ℂ] KernelEnergyGraph := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelEnergyMass.adjoint lemma kernelVariationalSolution_equation : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (F : KernelQuotientL2) (v : KernelEnergyGraph), inner ℂ (kernelEnergyMass (kernelVariationalSolution F)) (kernelEnergyMass v)+ inner ℂ (kernelEnergyGradient (kernelVariationalSolution F)) (kernelEnergyGradient v)= inner ℂ F (kernelEnergyMass v) := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (F : KernelQuotientL2) (v : KernelEnergyGraph) => by rw [←kernelEnergyGraph_inner] exact kernelEnergyMass.adjoint_inner_left v F lemma kernelVariationalSolution_unique : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (F : KernelQuotientL2) (u : KernelEnergyGraph) (hu : ∀v : KernelEnergyGraph, inner ℂ (kernelEnergyMass u) (kernelEnergyMass v)+ inner ℂ (kernelEnergyGradient u) (kernelEnergyGradient v)=inner ℂ F (kernelEnergyMass v)), u=kernelVariationalSolution F := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (F : KernelQuotientL2) (u : KernelEnergyGraph) (hu : ∀v : KernelEnergyGraph, inner ℂ (kernelEnergyMass u) (kernelEnergyMass v)+ inner ℂ (kernelEnergyGradient u) (kernelEnergyGradient v)=inner ℂ F (kernelEnergyMass v)) => by apply ext_inner_right ℂ intro v rw [kernelEnergyGraph_inner,kernelEnergyGraph_inner] exact (hu v).trans (kernelVariationalSolution_equation F v).symm def kernelVariationalResolvent : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2 →L[ℂ] KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelEnergyMass.comp kernelVariationalSolution lemma kernelVariationalResolvent_injective : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Function.Injective kernelVariationalResolvent := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply (LinearMap.ker_eq_bot).mp apply LinearMap.ker_eq_bot'.mpr intro F hF change kernelEnergyMass (kernelVariationalSolution F)=0 at hF have hu : kernelVariationalSolution F=0 := kernelEnergyMass_injective (by rw [map_zero] exact hF) have he : (fun g : KernelQuotientL2 => inner ℂ F g)=(fun _ => (0 : ℂ)) := kernelEnergyMass_dense.equalizer (by fun_prop) continuous_const (by funext v change inner ℂ F (kernelEnergyMass v)=0 rw [←kernelEnergyMass.adjoint_inner_left] change inner ℂ (kernelVariationalSolution F) v=0 rw [hu,inner_zero_left]) exact inner_self_eq_zero.mp (congrFun he F) end open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace def kernelLaplacianEquation : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (KernelQuotientL2 × KernelQuotientL2) →L[ℂ] KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelVariationalResolvent.comp ((ContinuousLinearMap.fst ℂ KernelQuotientL2 KernelQuotientL2)+ (ContinuousLinearMap.snd ℂ KernelQuotientL2 KernelQuotientL2))- (ContinuousLinearMap.fst ℂ KernelQuotientL2 KernelQuotientL2) def kernelLaplacianGraph : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Submodule ℂ (KernelQuotientL2 × KernelQuotientL2) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelLaplacianEquation.ker lemma mem_kernelLaplacianGraph : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (u f : KernelQuotientL2), (u,f)∈kernelLaplacianGraph ↔ kernelVariationalResolvent (u+f)=u := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (u f : KernelQuotientL2) => by change kernelVariationalResolvent (u+f)-u=0 ↔ _ exact sub_eq_zero lemma kernelLaplacianGraph_unique : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (x : KernelQuotientL2 × KernelQuotientL2) (hx : x∈kernelLaplacianGraph) (hz : x.1=0), x.2=0 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (x : KernelQuotientL2 × KernelQuotientL2) (hx : x∈kernelLaplacianGraph) (hz : x.1=0) => by have hh := (mem_kernelLaplacianGraph x.1 x.2).mp hx rw [hz,zero_add] at hh apply kernelVariationalResolvent_injective rw [map_zero] exact hh def kernelEnergyLaplacian : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2 →ₗ.[ℂ] KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelLaplacianGraph.toLinearPMap lemma kernelEnergyLaplacian_graph : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelEnergyLaplacian.graph=kernelLaplacianGraph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Submodule.toLinearPMap_graph_eq _ kernelLaplacianGraph_unique lemma kernelEnergyLaplacian_resolvent_relation : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (u : kernelEnergyLaplacian.domain), kernelVariationalResolvent (kernelEnergyLaplacian u+u)=u := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (u : kernelEnergyLaplacian.domain) => by have hh := kernelEnergyLaplacian.mem_graph u rw [kernelEnergyLaplacian_graph,mem_kernelLaplacianGraph] at hh simpa only [add_comm] using hh end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.CompletedDyadicRows namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CompletedGauss section open ActualEisensteinCubic theorem two_pow_clog_le_double (n : ℕ) (hn : 1≤n) : 2^Nat.clog 2 n≤2*n := by by_cases h : n=1 · simp [h] have hn1 : 1 Nat.clog 2 (Ideal.absNorm I)=j) def completedRowDyadicLength (K : ℝ) : ℕ := Nat.clog 2 ⌊K⌋₊ theorem completedRowDyad_bounds (rows : Finset (Ideal O)) (j : ℕ) (hrows : ∀I∈rows,I≠0) (I : Ideal O) (hI : I∈completedRowDyad rows j) : I≠0 ∧ (2:ℝ)^j/2≤(Ideal.absNorm I:ℝ) ∧ (Ideal.absNorm I:ℝ)≤(2:ℝ)^j := by obtain ⟨hIr,hj⟩ := Finset.mem_filter.mp hI have hn : 1≤Ideal.absNorm I := Nat.one_le_iff_ne_zero.mpr (fun hz => hrows I hIr (Ideal.absNorm_eq_zero_iff.mp hz)) have hu := Nat.le_pow_clog (by norm_num : 1<2) (Ideal.absNorm I) have hl := two_pow_clog_le_double (Ideal.absNorm I) hn rw [hj] at hu hl refine ⟨hrows I hIr,?_,?_⟩ · have hh : (2:ℝ)^j≤2*(Ideal.absNorm I:ℝ) := by exact_mod_cast hl linarith · exact_mod_cast hu theorem completedRowDyad_sum {M : Type*} [AddCommMonoid M] (rows : Finset (Ideal O)) (K : ℝ) (hK : 0≤K) (hrows : ∀I∈rows,(Ideal.absNorm I:ℝ)≤K) (f : Ideal O→M) : (∑j∈Finset.range (completedRowDyadicLength K+1),∑I∈completedRowDyad rows j,f I)=∑I∈rows,f I := by have hm : ∀I∈rows,Nat.clog 2 (Ideal.absNorm I)∈Finset.range (completedRowDyadicLength K+1) := by intro I hI apply Finset.mem_range.mpr exact Nat.lt_succ_of_le (Nat.clog_mono_right 2 ((Nat.le_floor_iff hK).mpr (hrows I hI))) simpa only [completedRowDyad] using Finset.sum_fiberwise_of_maps_to hm f theorem completedRowDyadic_top (K : ℝ) (hK : 1≤K) : (2:ℝ)^(completedRowDyadicLength K)≤2*K := by have hh := two_pow_clog_le_double ⌊K⌋₊ ((Nat.one_le_floor_iff K).mpr hK) have hr : (2:ℝ)^(completedRowDyadicLength K)≤2*(⌊K⌋₊:ℝ) := by exact_mod_cast hh exact hr.trans (mul_le_mul_of_nonneg_left (Nat.floor_le (by linarith : 0≤K)) (by norm_num)) theorem completedRowDyadic_scale (K : ℝ) (hK : 1≤K) (j : ℕ) (hj : j∈Finset.range (completedRowDyadicLength K+1)) : (2:ℝ)^j≤2*K := (pow_le_pow_right₀ (by norm_num : (1:ℝ)≤2) (Nat.le_of_lt_succ (Finset.mem_range.mp hj))).trans (completedRowDyadic_top K hK) theorem completedRowDyadic_mass (K : ℝ) (hK : 1≤K) : (∑j∈Finset.range (completedRowDyadicLength K+1),(2:ℝ)^j)≤4*K ∧ (∑j∈Finset.range (completedRowDyadicLength K+1),((2:ℝ)^j)^2)≤16*K^2 := by have ht := completedRowDyadic_top K hK constructor · rw [geom_sum_eq (by norm_num : (2:ℝ)≠1),pow_succ] norm_num linarith · have he (j : ℕ) : ((2:ℝ)^j)^2=(4:ℝ)^j := by rw [←pow_mul,Nat.mul_comm j 2,pow_mul]; norm_num simp_rw [he] rw [geom_sum_eq (by norm_num : (4:ℝ)≠1),pow_succ,←he] norm_num have hp := pow_le_pow_left₀ (by positivity : 0≤(2:ℝ)^(completedRowDyadicLength K)) ht 2 nlinarith theorem completedRowDyadic_shape (s K X Q : ℝ) (hs : 0≤ s) (hK : 1≤K) (hX : 0 mul_le_mul_of_nonneg_right (hb j hj) (by positivity)) _ = (2*(K*Q))^s*((∑j∈Finset.range (completedRowDyadicLength K+1),(2:ℝ)^j)+ (∑j∈Finset.range (completedRowDyadicLength K+1),((2:ℝ)^j)^2)*Q/X) := by rw [←Finset.mul_sum,Finset.sum_add_distrib,←Finset.sum_div,←Finset.sum_mul] _ ≤ (2*(K*Q))^s*(4*K+16*K^2*Q/X) := by apply mul_le_mul_of_nonneg_left _ (by positivity) exact add_le_add (completedRowDyadic_mass K hK).1 (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right (completedRowDyadic_mass K hK).2 hQ.le) hX.le) _ ≤ (2*(K*Q))^s*(16*(K+K^2*Q/X)) := by apply mul_le_mul_of_nonneg_left _ (by positivity) calc _ = 4*K+16*(K^2*Q/X) := by ring _ ≤ 16*(K+K^2*Q/X) := by linarith _ = _ := by rw [Real.mul_rpow (by norm_num) (by positivity)]; ring open ActualEisensteinCubic CanonicalQuadraticSieve def HasExactCompletedDyadicModels (rays : ℕ) (rows : Finset (Ideal O)) (K X ρ q levelBound : ℝ) (F Q : Ideal O) (W : ℝ→ℂ) (Ψ : Ideal O→O→*ℂ) (lengthScale : ℂ) : Prop := ∀j∈Finset.range (completedRowDyadicLength K+1), HasExactCompletedModels rays (completedRowDyad rows j) ((2:ℝ)^j) X ρ q levelBound F Q W Ψ lengthScale end section open CompletedDyadic def completedRamifiedInitial : ℝ := (3:ℝ)^(-(4/3:ℝ)) def completedRamifiedStep : ℝ := (3:ℝ)^(1/3:ℝ) theorem completedRamifiedStep_gt_one : 1 Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) def initialSquarefreeSector (s : Finset (SecondExpansionData ι)) : Finset (SecondExpansionData ι) := s.filter (fun x => Squarefree (Ideal.span {(sourceObservation p x).2})) theorem initial_weight_squarefree (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (x : SecondExpansionData ι) (hE : x.divisor ⊆ x.sourceCommon) (hw : secondArithmeticWeight p hp hcop hg Ψ m 1 1 ray x ≠ 0) : Squarefree (Ideal.span {(sourceObservation p x).2}) := by have hs := secondArithmeticWeight_squarefree p hp hcop hg Ψ m 1 1 ray x hE (by simp : Squarefree (Ideal.span {(1 : O)})) hw rw [sourceLabel_span] simpa using hs theorem initial_source_eq_squarefree (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (F : Finset ι) (s : Finset (SecondExpansionData ι)) (hE : ∀ x ∈ s, x.divisor ⊆ x.sourceCommon) (H₁ H₂ : Finset ι → ℂ) (W : 𝓢(ℝ,ℂ)) (Y : ℝ) : secondExpansionSource p hp hcop hg F Ψ m 1 1 ray s H₁ H₂ W Y = secondExpansionSource p hp hcop hg F Ψ m 1 1 ray (initialSquarefreeSector p s) H₁ H₂ W Y := by unfold secondExpansionSource initialSquarefreeSector rw [Finset.sum_filter] apply Finset.sum_congr rfl intro x hx by_cases hs : Squarefree (Ideal.span {(sourceObservation p x).2}) · rw [if_pos hs] · rw [if_neg hs] have hw : secondArithmeticWeight p hp hcop hg Ψ m 1 1 ray x=0 := by by_contra hn exact hs (initial_weight_squarefree p hp hcop hg Ψ m ray x (hE x hx) hn) unfold secondArithmeticWeight at hw rcases mul_eq_zero.mp hw with h1 | h2 · rw [h1] ring · rw [h2] ring include hp hg in omit [DecidableEq ι] in theorem initial_squarefree_label_admissible (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (x : SecondExpansionData ι) (hs : Squarefree (Ideal.span {(sourceObservation p x).2})) : Admissible (Ideal.span {(sourceObservation p x).2}) := by have hn : (sourceObservation p x).2 ≠ 0 := mul_ne_zero (primeSubsetGenerator_ne_zero _ _) (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i)) have hnI : Ideal.span {(sourceObservation p x).2} ≠ (0 : Ideal O) := Ideal.span_singleton_eq_bot.not.mpr hn refine ⟨hnI,hs,?_⟩ intro P hP obtain ⟨hprime,hdiv⟩ := (UniqueFactorizationMonoid.mem_normalizedFactors_iff hnI).mp hP rw [sourceLabel_span] at hdiv have hfactor (S : Finset ι) (hd : P ∣ ∏ i ∈ S,Ideal.span {p i}) : lambda ∉ P ∧ ringChar (O ⧸ P) ≠ 2 := by obtain ⟨i,hi,hPi⟩ := (hprime.dvd_finsetProd_iff (fun i => Ideal.span {p i})).mp hd have hpi : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance have he := (prime_dvd_prime_iff_eq hprime hpi).mp hPi rw [he] exact ⟨hg i,hc i⟩ rcases hprime.dvd_or_dvd hdiv with h1 | h2 · exact hfactor _ h1 · exact hfactor _ h2 end open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog firstLogDensity) theorem initial_subbin_transfer (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g W : 𝓢(ℝ,ℂ)) (A : ℝ) (hA : 0 ≤ A) (hU : ∀ t, g t ≠ 0 → U t=1) (hgA : ∀ t, g t ≠ 0 → |t| ≤ A) (ε : ℝ) (hε : 0 < ε) (N J : ℕ) : ∃ (windows : Fin 7 → ℝ → ℂ) (C Cₛ : ℝ), 0 ≤ C ∧ 0 ≤ Cₛ ∧ (∀ i, HasCompactSupport (windows i)) ∧ (∀ i, ContDiff ℝ ∞ (windows i)) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i, lambda^2 ∣ p i-1) (F R : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (K : Finset ι → Finset ι → Finset O) (Z H M : ℝ) (j : SecondLogIndex) (s : Finset (SecondExpansionData ι)), 0 < Z → 0 < H → (∀ a, ‖Ψ a‖ ≤ 1) → s ⊆ secondLogSector p ∅ F K R Z M j → let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R ∃ B : Frequency → ℝ, (∀ q, 0 ≤ B q) ∧ (∀ q, (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N*B q ≤ Cₛ*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2) ∧ ‖secondExpansionSource p hp hcop hg F Ψ m 1 1 ray s (fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V) (fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V) W H‖ ≤ (C*H*primeProductNorm p R/Z^2*‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε)* (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, B (t₁,t₂,t₃)* sourceGeometricMean p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) (windows 5) (windows 6) X X (t₁,t₂,t₃)) := by obtain ⟨windows,C,Cₛ,hC,hCₛ,hwc,hws,ht⟩ := initial_sector_transfer U hUc hUs g W A hA hU hgA ε hε N J refine ⟨windows,C,Cₛ,hC,hCₛ,hwc,hws,?_⟩ intro ι _ p hp _ hcop hg hinj hc hpr F R Ψ m ray K Z H M j s hZ hH hΨ hsub dsimp only let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R let X := initialLogColumn Z (primeProductNorm p R) j have hR : 0 < primeProductNorm p R := FirstPassCubeLabels.primeProductNorm_pos p hp R have hX : 0 < X := div_pos hZ (mul_pos (mul_pos (normLogScale_pos _) (normLogScale_pos _)) hR) have hs : ∀ x ∈ s, InSecondQuotientSector p r x := by intro x hx exact secondExpansionSector_valid p F (fun G E => (K G E).erase 0) R x (secondLogSector_subset p ∅ F K R Z M j (hsub hx)) have hk : ∀ x ∈ s, x.frequency ≠ 0 := by intro x hx exact (secondSupportedSector_mem p F K R Z M x (Finset.mem_filter.mp (hsub hx)).1).2.2.2.1 have hcoords := initial_sector_coordinates p hp F R K Z M hZ j obtain ⟨B,hB,hdec,hbound⟩ := ht p hp hcop hg hinj hc hpr F Ψ m r ray s Z H (secondLogE j) (secondLogV j) X (secondLogK j) hZ hH (normLogScale_pos _) (normLogScale_pos _) hX (normLogScale_pos _) hΨ hs hk (fun x hx => (hcoords x (hsub hx)).1) (fun x hx => (hcoords x (hsub hx)).2.1) (fun x hx => (hcoords x (hsub hx)).2.2.1) (fun x hx => (hcoords x (hsub hx)).2.2.2) refine ⟨B,hB,?_,?_⟩ · simpa only [X, initial_log_radial Z H (primeProductNorm p R) hZ.ne' hR.ne'] using hdec · simpa only [r, elementNorm, primeSubsetGenerator_norm_eq_productNorm] using hbound end InitialMeanSquare open MeasureTheory open scoped BigOperators Classical namespace InitialMeanSquare open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.DiagonalDensity namespace OAI noncomputable section namespace InitialMeanSquare open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped BigOperators Classical SchwartzMap ContDiff section open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration open FirstPassCubeLabels (normalizedColumn columnLog) open EisensteinSchwartzPoisson (paperRadialFourier) theorem initial_diagonal_fixed_profile (g W : 𝓢(ℝ,ℂ)) (M : ℝ) (hgM : ∀t,g t≠0 → |t|≤M) : ∃C : ℝ,0 Ideal.span {p i})) (F : Finset ι) (Ψ : O→*ℂ) (_hΨ : ∀z,‖Ψ z‖≤1) (m c d : O) (Z Y : ℝ),0 star (normalizedColumn p (fun T => g (columnLog p Z T)) S)) W Y K‖≤C*Y := by obtain ⟨C₀,hC₀,h₀⟩ := full_uniform_normalized_second_mass (conjugateProfile g) M (conjugateProfile_support_bound g M hgM) refine ⟨‖paperRadialFourier W 0‖*C₀+1,by positivity,?_⟩ intro ι _ p hp _ hg hinj F Ψ hΨ m c d Z Y hZ hY K hK simp_rw [star_normalizedColumn] apply (truncatedSecondZero_norm_le p hg hinj F Ψ m c d _ W Y K hK).trans rw [abs_of_pos hY] have hh := h₀ p hp hg hinj F Ψ hΨ m c d Z hZ calc _ ≤ Y*‖paperRadialFourier W 0‖*C₀ := mul_le_mul_of_nonneg_left hh (by positivity) _ ≤ (‖paperRadialFourier W 0‖*C₀+1)*Y := by nlinarith theorem initial_normalized_diagonal (W : ℝ→ℂ) (a b : ℝ) (ha : 0 Ideal.span {p i})) (F : Finset ι) (Ψ : O→*ℂ) (_hΨ : ∀z,‖Ψ z‖≤1) (Z Y : ℝ),0 star (normalizedColumn p (fun T => initialLogProfile W a b ha hs hW (columnLog p Z T)) S)) rowMajorant Y K‖≤C*Y := by obtain ⟨C,hC,h⟩ := initial_diagonal_fixed_profile (initialLogProfile W a b ha hs hW) rowMajorant (|Real.log a|+|Real.log b|+1) (initialLogProfile_support W a b ha hs hW) refine ⟨C,hC,?_⟩ intro ι _ p hp _ hg hinj F Ψ hΨ Z Y hZ hY K hK exact h p hp hg hinj F Ψ hΨ 1 1 1 Z Y hZ hY K hK end section open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration open FirstPassCubeLabels (normalizedColumn columnLog primeProductNorm) open ConcreteTraceCRT (eisEmbedding) def initialFrequencyCutoff (Z Y M T : ℝ) : Finset O := secondFrequencyCutoff (Y/(1+Z*Real.exp M)^3) T theorem initialFrequencyCutoff_zero (Z Y M T : ℝ) : (0:O)∈initialFrequencyCutoff Z Y M T := secondFrequencyCutoff_zero _ _ theorem initialFrequencyCutoff_valid {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hg : ∀i,lambda∉Ideal.span {p i}) (Ψ : O→*ℂ) (m c d : O) (g : 𝓢(ℝ,ℂ)) (M Z Y T : ℝ) (hZ : 0 normalizedColumn p (fun V => g (columnLog p Z V)) (G∪U)) (fun U => normalizedColumn p (fun V => g (columnLog p Z V)) (G∪U)) S R≠0) (k : O) (hk : k∉initialFrequencyCutoff Z Y M T) : T≤(Y/(‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖^2* ‖eisEmbedding (∏i : activeSupport R S,p i.val)‖^2))*‖eisEmbedding k‖^2 := by let lengthScale : ℝ := 1+Z*Real.exp M have hL : 0 Ideal.span {p i}) E)‖^2* ‖eisEmbedding (∏i : activeSupport R S,p i.val)‖^2≤lengthScale^3 := by rw [primeSubsetGenerator_norm_eq_productNorm,hn] have hSRn := mul_le_mul (hS.trans hZL) (hR.trans hZL) (FirstPassCubeLabels.primeProductNorm_pos p hp R).le hL.le have hESR := mul_le_mul (hE.trans hZL) hSRn (mul_nonneg (FirstPassCubeLabels.primeProductNorm_pos p hp S).le (FirstPassCubeLabels.primeProductNorm_pos p hp R).le) hL.le nlinarith have hden0 : 0<‖eisEmbedding (primeSubsetGenerator (fun i => Ideal.span {p i}) E)‖^2* ‖eisEmbedding (∏i : activeSupport R S,p i.val)‖^2 := by rw [primeSubsetGenerator_norm_eq_productNorm,hn] exact mul_pos (FirstPassCubeLabels.primeProductNorm_pos p hp E) (mul_pos (FirstPassCubeLabels.primeProductNorm_pos p hp S) (FirstPassCubeLabels.primeProductNorm_pos p hp R)) have hout := (outside_secondFrequencyCutoff (Y/lengthScale^3) T (by positivity) k hk).le exact hout.trans (mul_le_mul_of_nonneg_right (div_le_div_of_nonneg_left hY.le hden0 hden) (sq_nonneg _)) theorem initial_tail_polynomial (g W : 𝓢(ℝ,ℂ)) (M : ℝ) (hgM : ∀t,g t≠0 → |t|≤M) (A : ℕ) : ∃C : ℝ,0 Ideal.span {p i})) (_hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (F : Finset ι) (Ψ : O→*ℂ) (_hΨ : ∀z,‖Ψ z‖≤1) (m c d : O) (Z Y T : ℝ),0 g (columnLog p Z V))) W Y (fun _ _ => initialFrequencyCutoff Z Y M T)‖≤ C*(1+Z*Real.exp M)^4*Y*(1+(1+Z*Real.exp M)^3/Y)^2/(1+T)^A := by obtain ⟨s,C,hC,h⟩ := full_uniform_secondSourceTail_bound A let P : ℝ := C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W let C₀ : ℝ := 128^4*(SchwartzMap.seminorm ℝ 0 0 g)^2*P have hP : 0≤P := by dsimp [P]; positivity have hC₀ : 0≤C₀ := by dsimp [C₀]; positivity refine ⟨C₀+1,by positivity,?_⟩ intro ι _ p hp _ hg hinj hc F Ψ hΨ m c d Z Y T hZ hY hT have hb := h p hp hg hinj hc F Ψ m c d (normalizedColumn p (fun V => g (columnLog p Z V))) W Y T hY hT (fun _ _ => initialFrequencyCutoff Z Y M T) (fun G hG E S hS R hR hSR hw k hk => initialFrequencyCutoff_valid p hp hg Ψ m c d g M Z Y T hZ hY hgM G E.val S R (Finset.mem_powerset.mp E.property) hSR hw k hk) have hpoly := secondSourceTailCost_polynomial p hp hg hinj F Ψ hΨ m c d g M Z Y T (1+Z*Real.exp M) P A hZ hY hT hP (by linarith [mul_pos hZ (Real.exp_pos M)]) (by linarith) hgM apply (hb.trans hpoly).trans calc _ = C₀*(1+Z*Real.exp M)^4*Y*(1+(1+Z*Real.exp M)^3/Y)^2/(1+T)^A := by dsimp [C₀]; ring _ ≤ _ := by gcongr; linarith def initialTailHeight (Z Y M : ℝ) : ℝ := (1+Z*Real.exp M)^2*(1+(1+Z*Real.exp M)^3/Y) theorem initialTailHeight_pos (Z Y M : ℝ) (hZ : 0 Ideal.span {p i})) (_hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (F : Finset ι) (Ψ : O→*ℂ) (_hΨ : ∀z,‖Ψ z‖≤1) (m c d : O) (Z Y : ℝ),0 star (normalizedColumn p (fun V => g (columnLog p Z V)) S)) W Y (fun _ _ => initialFrequencyCutoff Z Y M (initialTailHeight Z Y M))‖≤C*Y := by obtain ⟨C,hC,h⟩ := initial_tail_polynomial (conjugateProfile g) W M (conjugateProfile_support_bound g M hgM) 2 refine ⟨C,hC,?_⟩ intro ι _ p hp _ hg hinj hc F Ψ hΨ m c d Z Y hZ hY simp_rw [star_normalizedColumn] apply (h p hp hg hinj hc F Ψ hΨ m c d Z Y (initialTailHeight Z Y M) hZ hY (initialTailHeight_pos Z Y M hZ hY).le).trans have hth := initialTailHeight_pos Z Y M hZ hY apply (div_le_iff₀ (by positivity : 0<(1+initialTailHeight Z Y M)^2)).mpr have hh : (1+Z*Real.exp M)^4*(1+(1+Z*Real.exp M)^3/Y)^2≤(1+initialTailHeight Z Y M)^2 := by have hp := initialTailHeight_pos Z Y M hZ hY calc _ = (initialTailHeight Z Y M)^2 := by unfold initialTailHeight; ring _ ≤ _ := by nlinarith have hb := mul_le_mul_of_nonneg_left hh (show 0≤C*Y by positivity) nlinarith end section open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration open FirstPassCubeLabels (normalizedColumn columnLog) open ConcreteTraceCRT (eisEmbedding) def initialErrorWindow (a b : ℝ) : ℝ := |Real.log a|+|Real.log b|+1 def initialErrorCutoff (a b Z Y : ℝ) : Finset O := initialFrequencyCutoff Z Y (initialErrorWindow a b) (initialTailHeight Z Y (initialErrorWindow a b)) theorem initialErrorCutoff_zero (a b Z Y : ℝ) : (0:O)∈initialErrorCutoff a b Z Y := initialFrequencyCutoff_zero _ _ _ _ def initialErrorFrequencyBound (a b Z Y : ℝ) : ℝ := 3*(initialTailHeight Z Y (initialErrorWindow a b)* (1+Z*Real.exp (initialErrorWindow a b))^3/Y+2)^2 theorem initialErrorCutoff_norm_bound (a b Z Y : ℝ) (hZ : 0 first | rfl | (dsimp [initialErrorFrequencyBound,v,M]; congr 2; field_simp) theorem initial_normalized_errors (W : ℝ→ℂ) (a b : ℝ) (ha : 0 Ideal.span {p i})) (_hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (F : Finset ι) (Ψ : O→*ℂ) (_hΨ : ∀z,‖Ψ z‖≤1) (Z Y : ℝ),0 initialLogProfile W a b ha hs hW (columnLog p Z T)) let K := fun (_ _ : Finset ι) => initialErrorCutoff a b Z Y ‖truncatedSecondZero p hg F Ψ 1 1 1 (fun T => star (G T)) rowMajorant Y K‖+ ‖secondSourceTail p hp hg hinj F Ψ 1 1 1 (fun T => star (G T)) rowMajorant Y K‖≤C*Y := by obtain ⟨Cd,hCd,hd⟩ := initial_normalized_diagonal W a b ha hs hW obtain ⟨Ct,hCt,ht⟩ := initial_tail_fixed_profile (initialLogProfile W a b ha hs hW) rowMajorant (initialErrorWindow a b) (initialLogProfile_support W a b ha hs hW) refine ⟨Cd+Ct,by positivity,?_⟩ intro ι _ p hp _ hg hinj hc F Ψ hΨ Z Y hZ hY dsimp only have h₁ := hd p hp hg hinj F Ψ hΨ Z Y hZ hY (fun (_ _ : Finset ι) => initialErrorCutoff a b Z Y) (fun G hG E hE => initialErrorCutoff_zero a b Z Y) have h₂ := ht p hp hg hinj hc F Ψ hΨ 1 1 1 Z Y hZ hY change ‖secondSourceTail p hp hg hinj F Ψ 1 1 1 (fun T => star (normalizedColumn p (fun V => initialLogProfile W a b ha hs hW (columnLog p Z V)) T)) rowMajorant Y (fun (_ _ : Finset ι) => initialErrorCutoff a b Z Y)‖≤Ct*Y at h₂ linarith end open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve SecondPassArithmetic open FirstPassCubeLabels (normalizedColumn columnLog) theorem outside_mean_square_source_with_errors (W : ℝ→ℂ) (a b : ℝ) (ha : 0 by rw [poolPrimary_span F hF i]; exact @inferInstance _ (OAI.CanonicalQuadraticSieve.canonicalPoolMaximal F i) let hinj : Function.Injective (fun i : primePool F => Ideal.span {p i}) := by intro i j hij apply Subtype.ext simpa only [p,poolPrimary_span F hF] using hij let G := normalizedColumn p (fun V => initialLogProfile W a b ha hs hW (columnLog p Z V)) let Ψ := conjugateMonoid (normCharacter χ) (∑z∈T,‖idealRowSum (outsideIdealsUpTo S D) (outsideIdealsUpTo_ne_bot S D) (outside_good S D hbad) χ (fun n => W (n/Z)) z‖^2)/Z≤ ‖truncatedSecondSource p hp hg hinj Finset.univ Ψ 1 1 1 (fun V => star (G V)) rowMajorant Y (fun _ _ => (initialErrorCutoff a b Z Y).erase 0)‖+ C*Y-‖G ∅‖^2 := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal obtain ⟨C,hC,h⟩ := initial_normalized_errors W a b ha hs hW refine ⟨C,hC,?_⟩ intro q χ S D hbad hSp Z Y hZ hY hD T hT hT0 dsimp only let F := outsideSquarefreeIdeals S D have hF := outsideSquarefree_admissible S D hbad let p := poolPrimary F let hp := poolPrimary_ne_zero F hF let hg := poolPrimary_good F hF let : ∀i : primePool F,(Ideal.span {p i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance have hinj : Function.Injective (fun i : primePool F => Ideal.span {p i}) := by intro i j hij apply Subtype.ext simpa only [p,poolPrimary_span F hF] using hij let G := normalizedColumn p (fun V => initialLogProfile W a b ha hs hW (columnLog p Z V)) let Ψ := conjugateMonoid (normCharacter χ) let K : Finset (primePool F)→Finset (primePool F)→Finset O := fun _ _ => initialErrorCutoff a b Z Y have he := h p hp hg hinj (poolPrimary_odd F hF) Finset.univ Ψ (conjugateMonoid_norm_le_one (normCharacter χ) (normCharacter_norm_le_one χ)) Z Y hZ hY have hm := outside_mean_square_source χ S D hbad hSp W a b Z Y ha hZ hY hs hW hD T hT hT0 K have hz := Complex.re_le_norm (truncatedSecondZero p hg Finset.univ Ψ 1 1 1 (fun V => star (G V)) rowMajorant Y K) change ‖truncatedSecondZero p hg Finset.univ Ψ 1 1 1 (fun V => star (G V)) rowMajorant Y K‖+ ‖secondSourceTail p hp hg hinj Finset.univ Ψ 1 1 1 (fun V => star (G V)) rowMajorant Y K‖≤C*Y at he apply hm.trans linarith end section open scoped BigOperators Classical SchwartzMap open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration open FirstPassCubeLabels (normalizedColumn columnLog) theorem initial_nonzero_source_norm_le_squarefree_bins {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hpr : ∀ i, lambda^2 ∣ p i-1) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (g W : 𝓢(ℝ,ℂ)) (Z H M Kmax : ℝ) (hZ : 0 < Z) (hgM : ∀ t, g t ≠ 0 → |t| ≤ M) (K : Finset ι → Finset ι → Finset O) (hK : ∀ R ∈ F.powerset, ∀ x ∈ secondSupportedSector p F K R Z M, elementNorm (sourceObservation p x).1 ≤ Kmax) : letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype let G := fun S => normalizedColumn p (fun T => g (columnLog p Z T)) S ‖truncatedSecondSource p hp hg hinj F Ψ m 1 1 G W H (fun C E => (K C E).erase 0)‖ ≤ ∑ ray : SecondRayIndex, ∑ R ∈ boundedPrimeSupports p F (Z*Real.exp M), ∑ j ∈ secondLogBinBox (Z*Real.exp M) Kmax, ‖secondExpansionSource p hp hcop hg F Ψ m 1 1 ray (initialSquarefreeSector p (secondLogSector p ∅ F K R Z M j)) G G W H‖ := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype dsimp only apply (initial_nonzero_source_norm_le_bins p hp hcop hg hinj hc hpr F Ψ m g W Z H M Kmax hZ hgM K hK).trans_eq apply Finset.sum_congr rfl intro ray hray apply Finset.sum_congr rfl intro R hR apply Finset.sum_congr rfl intro j hj apply congrArg norm apply initial_source_eq_squarefree p hp hcop hg Ψ m ray F _ _ _ _ W H intro x hx exact (secondSupportedSector_mem p F K R Z M x (Finset.mem_filter.mp hx).1).2.1 end section open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog firstLogDensity) def initialSquarefreeBinCost {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F R : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (K : Finset ι → Finset ι → Finset O) (Z H M ε : ℝ) (j : SecondLogIndex) (windows : Fin 7 → ℝ → ℂ) (B : Frequency → ℝ) : ℝ := let s := initialSquarefreeSector p (secondLogSector p ∅ F K R Z M j) let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R (H*primeProductNorm p R/Z^2*‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε)* (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, B (t₁,t₂,t₃)* sourceGeometricMean p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) (windows 5) (windows 6) X X (t₁,t₂,t₃)) end open MeasureTheory open scoped BigOperators Classical open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels open MeasureTheory open scoped BigOperators Classical open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels theorem positive_nested_density_transfer (f G : Frequency → ℝ) (J : ℕ) (hG : Continuous G) (M : ℝ) (hGM : ∀ q, ‖G q‖ ≤ M) (C : ℝ) (hf : ∀ q, 0 ≤ f q) (hbound : ∀ q, f q ≤ C*tripleLogDensity J q*G q) : (∫ x : ℝ, ∫ y : ℝ, ∫ z : ℝ,f (x,y,z)) ≤ C*(∫ x : ℝ, ∫ y : ℝ, ∫ z : ℝ,tripleLogDensity J (x,y,z)*G (x,y,z)) := by let u : Frequency → ℝ := fun q => C*(tripleLogDensity J q*G q) have hu : Integrable u := (tripleLogDensity_bounded_integrable J G hG M hGM).const_mul C have hux (x : ℝ) : Integrable (fun yz : ℝ × ℝ => u (x,yz)) := (tripleLogDensity_slice_integrable J G hG M hGM x).const_mul C have huxy (x y : ℝ) : Integrable (fun z : ℝ => u (x,y,z)) := by have hd : Integrable (fun z : ℝ => C*firstLogDensity J x*firstLogDensity J y*firstLogDensity J z) := (firstLogDensity_integrable J).const_mul _ have hgxy : Continuous (fun z : ℝ => G (x,y,z)) := hG.comp (continuous_const.prodMk (continuous_const.prodMk continuous_id)) have hi := hd.mul_bdd hgxy.aestronglyMeasurable (Filter.Eventually.of_forall (fun z : ℝ => hGM (x,y,z))) convert hi using 1 funext z dsimp [u,tripleLogDensity] ring have hz (x y : ℝ) : (∫ z : ℝ,f (x,y,z)) ≤ ∫ z : ℝ,u (x,y,z) := by apply integral_mono_of_nonneg (Filter.Eventually.of_forall (fun z : ℝ => hf (x,y,z))) (huxy x y) exact Filter.Eventually.of_forall (fun z : ℝ => by simpa only [u,mul_assoc] using hbound (x,y,z)) have hy (x : ℝ) : (∫ y : ℝ,∫ z : ℝ,f (x,y,z)) ≤ ∫ y : ℝ,∫ z : ℝ,u (x,y,z) := by exact integral_mono_of_nonneg (Filter.Eventually.of_forall (fun y : ℝ => integral_nonneg (fun z : ℝ => hf (x,y,z)))) (hux x).integral_prod_left (Filter.Eventually.of_forall (hz x)) have hui : Integrable (fun x : ℝ => ∫ y : ℝ, ∫ z : ℝ,u (x,y,z)) := by apply hu.integral_prod_left.congr filter_upwards [] with x exact integral_prod _ (hux x) have hx := integral_mono_of_nonneg (Filter.Eventually.of_forall (fun x : ℝ => integral_nonneg (fun y : ℝ => integral_nonneg (fun z : ℝ => hf (x,y,z))))) hui (Filter.Eventually.of_forall hy) simpa only [u,integral_const_mul] using hx variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem initial_source_density_transfer (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (m : O) (T : Finset (O × O)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ : ℝ) (B : Frequency → ℝ) (J : ℕ) (S C : ℝ) (hS : 0 < S) (hC : 0 ≤ C) (hB : ∀ q,0 ≤ B q) (hdec : ∀ q,S*B q ≤ C*tripleLogDensity J q) : (∫ x : ℝ, ∫ y : ℝ, ∫ z : ℝ,B (x,y,z)* sourceGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ (x,y,z)) ≤ (C/S)*densityChildEnergy p hp hcop hg F Ψ₁ Ψ₂ m (sourceIdealTarget T) V₁ V₂ X₁ X₂ J := by let G := childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m (sourceIdealTarget T) V₁ V₂ X₁ X₂ have hc₁ := childEnergy_continuous p hp hcop hg F Ψ₁ m (sourceIdealTarget T) V₁ X₁ true false (fun q : Frequency => q.1) (fun q : Frequency => q.2.2) continuous_fst continuous_snd.snd have hc₂ := childEnergy_continuous p hp hcop hg F Ψ₂ m (sourceIdealTarget T) V₂ X₂ false true (fun q : Frequency => q.2.1) (fun q : Frequency => q.2.2) continuous_snd.fst continuous_snd.snd have hG : Continuous G := (Real.continuous_sqrt.comp hc₁).mul (Real.continuous_sqrt.comp hc₂) have hG0 : ∀ q,0 ≤ G q := fun q => mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) let M := Real.sqrt (energyMagnitude p hp hcop hg F Ψ₁ m (sourceIdealTarget T) V₁ X₁ true false)* Real.sqrt (energyMagnitude p hp hcop hg F Ψ₂ m (sourceIdealTarget T) V₂ X₂ false true) have hGM : ∀ q,‖G q‖ ≤ M := by intro q rw [Real.norm_of_nonneg (hG0 q)] exact mul_le_mul (Real.sqrt_le_sqrt (childEnergy_le p hp hcop hg F Ψ₁ m (sourceIdealTarget T) V₁ X₁ true false q.1 q.2.2)) (Real.sqrt_le_sqrt (childEnergy_le p hp hcop hg F Ψ₂ m (sourceIdealTarget T) V₂ X₂ false true q.2.1 q.2.2)) (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) change _ ≤ (C/S)*(∫ x : ℝ,∫ y : ℝ,∫ z : ℝ,tripleLogDensity J (x,y,z)*G (x,y,z)) apply positive_nested_density_transfer (fun q => B q*sourceGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ q) G J hG M hGM (C/S) · intro q exact mul_nonneg (hB q) (mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)) · intro q have hb : B q ≤ (C/S)*tripleLogDensity J q := by have hd : B q ≤ (C*tripleLogDensity J q)/S := (le_div_iff₀ hS).mpr (by simpa only [mul_comm] using hdec q) convert hd using 1 ; ring exact mul_le_mul hb (sourceGeometricMean_le_ideal p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X₁ X₂ q) (mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)) (mul_nonneg (div_nonneg hC hS.le) (tripleLogDensity_nonneg _ _)) end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.HighRadialBounds namespace OAI noncomputable section namespace InitialMeanSquare open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped BigOperators Classical open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration open CanonicalQuadraticSieve (Admissible) theorem initial_squarefree_target_geometry {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hg : ∀ i, lambda ∉ Ideal.span {p i}) (hc : ∀ i, ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (F R : Finset ι) (K : Finset ι → Finset ι → Finset O) (Z M : ℝ) (j : SecondLogIndex) : let s := initialSquarefreeSector p (secondLogSector p ∅ F K R Z M j) ∀ z ∈ sourceIdealTarget (s.image (sourceObservation p)), Admissible z.1 ∧ (Ideal.absNorm z.1 : ℝ) ≤ initialLogLabel j ∧ z.2 ≠ 0 ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ secondLogK j*Real.exp 1 := by dsimp only intro z hz obtain ⟨y,hy,rfl⟩ := Finset.mem_image.mp hz obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hy obtain ⟨hxs,hsq⟩ := Finset.mem_filter.mp hx obtain ⟨hxp,hj⟩ := Finset.mem_filter.mp hxs have hk := (secondSupportedSector_mem p F K R Z M x hxp).2.2.2.1 have hgeom := initial_log_target_bounds p hp x hk rw [initialLogIndex_eq_second,hj] at hgeom refine ⟨initial_squarefree_label_admissible p hp hg hc x hsq,?_,sourceRow_nonzero p x hk,hgeom.2⟩ simpa only [sourceIdealPoint,elementNorm,eisEmbedding_norm_sq_eq_absNorm_span] using hgeom.1 end section open MeasureTheory open scoped BigOperators Classical open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels theorem initialSquarefreeBinCost_of_density_bound {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F R : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (K : Finset ι → Finset ι → Finset O) (Z H M ε Cₛ Cchild : ℝ) (hZ : 0 < Z) (hH : 0 < H) (hCₛ : 0 ≤ Cₛ) (j : SecondLogIndex) (windows : Fin 7 → ℝ → ℂ) (B : Frequency → ℝ) (J N : ℕ) (hB : ∀ q, 0 ≤ B q) (hdec : ∀ q, (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N*B q ≤ Cₛ*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2) (hdensity : let s := initialSquarefreeSector p (secondLogSector p ∅ F K R Z M j) let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R densityChildEnergy p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (sourceIdealTarget (s.image (sourceObservation p))) (windows 5) (windows 6) X X J ≤ Cchild*(X*initialLogLabel j)^2) : initialSquarefreeBinCost p hp hcop hg F R Ψ m ray K Z H M ε j windows B ≤ ((H/primeProductNorm p R)*Real.exp 4*Cchild*Cₛ)* ‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε / (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N := by let s := initialSquarefreeSector p (secondLogSector p ∅ F K R Z M j) let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R let E := densityChildEnergy p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (sourceIdealTarget (s.image (sourceObservation p))) (windows 5) (windows 6) X X J let S := (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N have hR : 0 < primeProductNorm p R := primeProductNorm_pos p hp R have hk : 0 < secondLogK j := normLogScale_pos _ have hS : 0 < S := by dsimp [S]; positivity have hd := initial_source_density_transfer p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) (windows 5) (windows 6) X X B J S Cₛ hS hCₛ hB (fun q => by simpa only [S,tripleLogDensity,mul_assoc] using hdec q) have hpref : 0 ≤ H*primeProductNorm p R/Z^2*‖secondRayCoefficient ray‖* (secondLogK j*Real.exp 2)^ε := by positivity calc _ ≤ (H*primeProductNorm p R/Z^2*‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε)* ((Cₛ/S)*E) := mul_le_mul_of_nonneg_left hd hpref _ ≤ (H*primeProductNorm p R/Z^2*‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε)* ((Cₛ/S)*(Cchild*(X*initialLogLabel j)^2)) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hdensity (div_nonneg hCₛ hS.le)) hpref _ = _ := by dsimp only [X,S] rw [initial_log_mass Z (primeProductNorm p R) hR.ne', mul_pow (Z/primeProductNorm p R) (Real.exp 2) 2] have he : (Real.exp 2)^2=Real.exp 4 := by rw [pow_two,←Real.exp_add]; norm_num rw [he] have hz := hZ.ne' have hr := hR.ne' field_simp end section open scoped BigOperators Classical section open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels lemma initial_bin_row_scale_le (U K : ℝ) (hK : 1 ≤ K) (j : SecondLogIndex) (hj : j ∈ secondLogBinBox U K) : secondLogK j ≤ K := by have hj' : j.1 < normLogBin U+1 ∧ j.2.1 < normLogBin U+1 ∧ j.2.2 < normLogBin K+1 := by simpa only [secondLogBinBox,Finset.mem_product,Finset.mem_range] using hj have hscale : secondLogK j ≤ normLogScale (normLogBin K) := by unfold secondLogK normLogScale apply Real.exp_le_exp.mpr exact_mod_cast Nat.le_of_lt_succ hj'.2.2 exact hscale.trans (normLogBin_scale_bounds K hK).1 theorem initial_bin_cost_uniform {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (F R : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (K : Finset ι → Finset ι → Finset O) (Z H M Kmax ε Cₛ Cchild : ℝ) (hZ : 0 < Z) (hH : 0 < H) (hKmax : 1 ≤ Kmax) (hε : 0 ≤ ε) (hCₛ : 0 ≤ Cₛ) (hCc : 0 ≤ Cchild) (j : SecondLogIndex) (hj : j ∈ secondLogBinBox (Z*Real.exp M) Kmax) (windows : Fin 7 → ℝ → ℂ) (B : Frequency → ℝ) (J N : ℕ) (hB : ∀ q, 0 ≤ B q) (hdec : ∀ q, (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N*B q ≤ Cₛ*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2) (hdensity : let s := initialSquarefreeSector p (secondLogSector p ∅ F K R Z M j) let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R densityChildEnergy p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (sourceIdealTarget (s.image (sourceObservation p))) (windows 5) (windows 6) X X J ≤ Cchild*(X*initialLogLabel j)^2) : initialSquarefreeBinCost p hp hcop hg F R Ψ m ray K Z H M ε j windows B ≤ (H*Real.exp 4*Cchild*Cₛ*(Kmax*Real.exp 2)^ε)/primeProductNorm p R* ‖secondRayCoefficient ray‖ := by have hb := initialSquarefreeBinCost_of_density_bound p hp hcop hg F R Ψ m ray K Z H M ε Cₛ Cchild hZ hH hCₛ j windows B J N hB hdec hdensity have hR := primeProductNorm_pos p hp R have hk : 0 < secondLogK j := normLogScale_pos _ have hden : 1 ≤ (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N := by apply one_le_pow₀ have hnon : 0 ≤ H*secondLogK j*(primeProductNorm p R)^2/Z^2 := by positivity linarith have hnum : 0 ≤ ((H/primeProductNorm p R)*Real.exp 4*Cchild*Cₛ)* ‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε := by positivity have hrow : (secondLogK j*Real.exp 2)^ε ≤ (Kmax*Real.exp 2)^ε := Real.rpow_le_rpow (mul_pos hk (Real.exp_pos 2)).le (mul_le_mul_of_nonneg_right (initial_bin_row_scale_le (Z*Real.exp M) Kmax hKmax j hj) (Real.exp_pos 2).le) hε calc _ ≤ ((H/primeProductNorm p R)*Real.exp 4*Cchild*Cₛ)* ‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε := hb.trans (div_le_self hnum hden) _ ≤ ((H/primeProductNorm p R)*Real.exp 4*Cchild*Cₛ)* ‖secondRayCoefficient ray‖*(Kmax*Real.exp 2)^ε := mul_le_mul_of_nonneg_left hrow (by positivity) _ = _ := by ring end open ActualEisensteinCubic ConcretePrimeRowBridge theorem outside_prime_divisor_mem_pool (S : Finset (Ideal O)) (D : ℕ) {I Q : Ideal O} (hI : I ∈ outsideIdealsUpTo S D) (hQ : Prime Q) (hd : Q ∣ I) : Q ∈ primePool (outsideSquarefreeIdeals S D) := by have hQpos : 1 ≤ Ideal.absNorm Q := Nat.one_le_iff_ne_zero.mpr (fun hz => hQ.ne_zero (Ideal.absNorm_eq_zero_iff.mp hz)) have hQI : Ideal.absNorm Q ≤ Ideal.absNorm I := Nat.le_of_dvd (mem_outsideIdealsUpTo.mp hI).1 (map_dvd Ideal.absNorm hd) have hQo : Q ∈ outsideIdealsUpTo S D := mem_outsideIdealsUpTo.mpr ⟨hQpos, hQI.trans (mem_outsideIdealsUpTo.mp hI).2.1, fun P hP hPQ => (mem_outsideIdealsUpTo.mp hI).2.2 P hP (hPQ.trans hd)⟩ apply mem_primePool_iff.mpr refine ⟨Q, Finset.mem_filter.mpr ⟨hQo,hQ.squarefree⟩,?_⟩ exact (UniqueFactorizationMonoid.mem_normalizedFactors_iff hQ.ne_zero).mpr ⟨hQ,dvd_rfl⟩ theorem outside_factors_mem_pool (S : Finset (Ideal O)) (D : ℕ) {I : Ideal O} (hI : I ∈ outsideIdealsUpTo S D) : ∀ Q ∈ UniqueFactorizationMonoid.normalizedFactors I, Q ∈ primePool (outsideSquarefreeIdeals S D) := by intro Q hQ obtain ⟨hprime,hdiv⟩ := (UniqueFactorizationMonoid.mem_normalizedFactors_iff (outsideIdealsUpTo_ne_bot S D I hI)).mp hQ exact outside_prime_divisor_mem_pool S D hI hprime hdiv end section open MeasureTheory open scoped BigOperators Classical section open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm firstLogDensity) def initialElementaryConstant (A V : ℝ) : ℝ := 6*128^4*(Real.exp A*V)^2 lemma initialElementaryConstant_nonneg (A V : ℝ) : 0 ≤ initialElementaryConstant A V := by unfold initialElementaryConstant positivity variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) include hc hinj in theorem initial_child_energy_elementary (F : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (T : Finset (Ideal O × O)) (V : ℝ → ℂ) (X lengthScale K A Vmax a b : ℝ) (hX : 0 < X) (hL : 1 ≤ lengthScale) (hK : 1 ≤ K) (hA : 0 ≤ A) (hVmax : 0 ≤ Vmax) (hV : ∀ t,‖V t‖ ≤ Vmax) (hs : ∀ t,V t ≠ 0 → |t| ≤ A) (hT : ∀ z ∈ T,z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ lengthScale ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ K) (tn rn : Bool) : childEnergy p hp hcop hg F Ψ m T V X tn rn a b ≤ initialElementaryConstant A Vmax*K*X^2*lengthScale := by by_cases hscale : 1 ≤ X*Real.exp A · have hb := childEnergy_elementary_normalized p hp hcop hg hc hinj F Ψ hΨ m T V X lengthScale K A Vmax a b hX hL hK hA hVmax hV hs hT tn rn have hXL : 0 < X*lengthScale := mul_pos hX (zero_lt_one.trans_le hL) have hb' := (div_le_iff₀ hXL).mp hb rw [max_eq_right hscale] at hb' convert hb' using 1 <;> first | rfl | (unfold initialElementaryConstant; field_simp) · rw [childEnergy_subunit p hp hcop hg F Ψ m T V X A hX hs (lt_of_not_ge hscale) a b tn rn] exact mul_nonneg (mul_nonneg (mul_nonneg (initialElementaryConstant_nonneg A Vmax) (zero_le_one.trans hK)) (sq_nonneg X)) (zero_le_one.trans hL) include hc hinj in theorem initial_child_geometric_elementary (F : Finset ι) (Ψ₁ Ψ₂ : O →* ℂ) (hΨ₁ : ∀ a,‖Ψ₁ a‖ ≤ 1) (hΨ₂ : ∀ a,‖Ψ₂ a‖ ≤ 1) (m : O) (T : Finset (Ideal O × O)) (V₁ V₂ : ℝ → ℂ) (X lengthScale K A Vmax : ℝ) (hX : 0 < X) (hL : 1 ≤ lengthScale) (hK : 1 ≤ K) (hA : 0 ≤ A) (hVmax : 0 ≤ Vmax) (hV₁ : ∀ t,‖V₁ t‖ ≤ Vmax) (hV₂ : ∀ t,‖V₂ t‖ ≤ Vmax) (hs₁ : ∀ t,V₁ t ≠ 0 → |t| ≤ A) (hs₂ : ∀ t,V₂ t ≠ 0 → |t| ≤ A) (hT : ∀ z ∈ T,z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ lengthScale ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ K) (q : Frequency) : childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X X q ≤ initialElementaryConstant A Vmax*K*(X*lengthScale)^2 := by let E := initialElementaryConstant A Vmax*K*X^2*lengthScale have hE : 0 ≤ E := by dsimp only [E] exact mul_nonneg (mul_nonneg (mul_nonneg (initialElementaryConstant_nonneg A Vmax) (zero_le_one.trans hK)) (sq_nonneg X)) (zero_le_one.trans hL) have he₁ := initial_child_energy_elementary p hp hcop hg hc hinj F Ψ₁ hΨ₁ m T V₁ X lengthScale K A Vmax q.1 q.2.2 hX hL hK hA hVmax hV₁ hs₁ hT true false have he₂ := initial_child_energy_elementary p hp hcop hg hc hinj F Ψ₂ hΨ₂ m T V₂ X lengthScale K A Vmax q.2.1 q.2.2 hX hL hK hA hVmax hV₂ hs₂ hT false true have hb : childGeometricMean p hp hcop hg F Ψ₁ Ψ₂ m T V₁ V₂ X X q ≤ E := by calc _ ≤ Real.sqrt E*Real.sqrt E := mul_le_mul (Real.sqrt_le_sqrt he₁) (Real.sqrt_le_sqrt he₂) (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) _ = E := Real.mul_self_sqrt hE apply hb.trans calc E ≤ E*lengthScale := le_mul_of_one_le_right hE hL _ = _ := by dsimp only [E]; ring include hp in theorem initial_subbin_target_bounds (F R : Finset ι) (K : Finset ι → Finset ι → Finset O) (Z M : ℝ) (j : SecondLogIndex) (s : Finset (SecondExpansionData ι)) (hs : s ⊆ secondLogSector p ∅ F K R Z M j) : ∀ z ∈ sourceIdealTarget (s.image (sourceObservation p)),z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ initialLogLabel j ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ secondLogK j*Real.exp 2 := by apply sourceIdealTarget_bounds intro z hz obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hz have hx' := hs hx obtain ⟨hxsec,hj⟩ := Finset.mem_filter.mp hx' have hk := (secondSupportedSector_mem p F K R Z M x hxsec).2.2.2.1 have hji : initialLogIndex p x=j := (initialLogIndex_eq_second p x).trans hj have ht := initial_log_target_bounds p hp x hk rw [hji] at ht refine ⟨?_,ht.1,?_⟩ · exact mul_ne_zero (primeSubsetGenerator_ne_zero _ _) (Finset.prod_ne_zero_iff.mpr (fun i _ => hp i)) · exact ht.2.trans (mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (by norm_num)) (normLogScale_pos _).le) include hc hinj in theorem initial_subbin_geometric_elementary (F R : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (ray : SecondRayIndex) (K : Finset ι → Finset ι → Finset O) (Z M A Vmax : ℝ) (hZ : 0 < Z) (hA : 0 ≤ A) (hVmax : 0 ≤ Vmax) (j : SecondLogIndex) (s : Finset (SecondExpansionData ι)) (hs : s ⊆ secondLogSector p ∅ F K R Z M j) (V₁ V₂ : ℝ → ℂ) (hV₁ : ∀ t,‖V₁ t‖ ≤ Vmax) (hV₂ : ∀ t,‖V₂ t‖ ≤ Vmax) (hs₁ : ∀ t,V₁ t ≠ 0 → |t| ≤ A) (hs₂ : ∀ t,V₂ t ≠ 0 → |t| ≤ A) (q : Frequency) : let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R childGeometricMean p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (sourceIdealTarget (s.image (sourceObservation p))) V₁ V₂ X X q ≤ (initialElementaryConstant A Vmax*(secondLogK j*Real.exp 2))*(X*initialLogLabel j)^2 := by dsimp only have hR := FirstPassCubeLabels.primeProductNorm_pos p hp R have hX : 0 < initialLogColumn Z (primeProductNorm p R) j := div_pos hZ (mul_pos (mul_pos (normLogScale_pos _) (normLogScale_pos _)) hR) have hL : 1 ≤ initialLogLabel j := one_le_mul_of_one_le_of_one_le (one_le_mul_of_one_le_of_one_le (normLogScale_ge_one _) (normLogScale_ge_one _)) (Real.one_le_exp (by norm_num)) have hrow : 1 ≤ secondLogK j*Real.exp 2 := one_le_mul_of_one_le_of_one_le (normLogScale_ge_one _) (Real.one_le_exp (by norm_num)) exact initial_child_geometric_elementary p hp hcop hg hc hinj F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fun a => (secondRayMinus_norm_le Ψ ray a).trans (hΨ a)) (fun a => (secondRayPlus_norm_le Ψ ray a).trans (hΨ a)) _ _ V₁ V₂ _ _ _ A Vmax hX hL hrow hA hVmax hV₁ hV₂ hs₁ hs₂ (initial_subbin_target_bounds p hp F R K Z M j s hs) q end open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm firstLogDensity) def initialRestrictedBinCost {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (F R : Finset ι) (Ψ : O →* ℂ) (m : O) (ray : SecondRayIndex) (s : Finset (SecondExpansionData ι)) (Z H ε : ℝ) (j : SecondLogIndex) (V₁ V₂ : ℝ → ℂ) (B : Frequency → ℝ) : ℝ := let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R (H*primeProductNorm p R/Z^2*‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε)* (∫ t₁ : ℝ,∫ t₂ : ℝ,∫ t₃ : ℝ,B (t₁,t₂,t₃)* sourceGeometricMean p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) V₁ V₂ X X (t₁,t₂,t₃)) variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) include hc hinj in theorem initial_subbin_density_elementary (F R : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (ray : SecondRayIndex) (K : Finset ι → Finset ι → Finset O) (Z H M A Vmax Cs : ℝ) (hZ : 0 < Z) (hH : 0 < H) (hA : 0 ≤ A) (hVmax : 0 ≤ Vmax) (hCs : 0 ≤ Cs) (j : SecondLogIndex) (s : Finset (SecondExpansionData ι)) (hs : s ⊆ secondLogSector p ∅ F K R Z M j) (V₁ V₂ : ℝ → ℂ) (hV₁ : ∀ t,‖V₁ t‖ ≤ Vmax) (hV₂ : ∀ t,‖V₂ t‖ ≤ Vmax) (hs₁ : ∀ t,V₁ t ≠ 0 → |t| ≤ A) (hs₂ : ∀ t,V₂ t ≠ 0 → |t| ≤ A) (B : Frequency → ℝ) (J N : ℕ) (hB : ∀ q,0 ≤ B q) (hdec : ∀ q,(1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N*B q ≤ Cs*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2) : let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R (∫ t₁ : ℝ,∫ t₂ : ℝ,∫ t₃ : ℝ,B (t₁,t₂,t₃)* sourceGeometricMean p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) V₁ V₂ X X (t₁,t₂,t₃)) ≤ (Cs*(initialElementaryConstant A Vmax*(secondLogK j*Real.exp 2)*(X*initialLogLabel j)^2)/ (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N)*(∫ t : ℝ,firstLogDensity 0 t)^3 := by dsimp only let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R let G := sourceGeometricMean p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) V₁ V₂ X X let E := initialElementaryConstant A Vmax*(secondLogK j*Real.exp 2)*(X*initialLogLabel j)^2 have hk : 0 < secondLogK j := normLogScale_pos _ have hE : 0 ≤ E := mul_nonneg (mul_nonneg (initialElementaryConstant_nonneg A Vmax) (mul_nonneg hk.le (Real.exp_pos _).le)) (sq_nonneg _) have hG : ∀ q,0 ≤ G q := fun q => mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) have hbound (q : Frequency) : G q ≤ E := (sourceGeometricMean_le_ideal p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) V₁ V₂ X X q).trans (initial_subbin_geometric_elementary p hp hcop hg hc hinj F R Ψ hΨ m ray K Z M A Vmax hZ hA hVmax j s hs V₁ V₂ hV₁ hV₂ hs₁ hs₂ q) have hweighted (q : Frequency) : G q ≤ E*(1+‖q.1‖)^J*(1+‖q.2.1‖)^J*(1+‖q.2.2‖)^J := by have h₁ := one_le_pow₀ (show 1 ≤ 1+‖q.1‖ by linarith [norm_nonneg q.1]) (n := J) have h₂ := one_le_pow₀ (show 1 ≤ 1+‖q.2.1‖ by linarith [norm_nonneg q.2.1]) (n := J) have h₃ := one_le_pow₀ (show 1 ≤ 1+‖q.2.2‖ by linarith [norm_nonneg q.2.2]) (n := J) exact (hbound q).trans ((le_mul_of_one_le_right hE h₁).trans ((le_mul_of_one_le_right (mul_nonneg hE (zero_le_one.trans h₁)) h₂).trans (le_mul_of_one_le_right (mul_nonneg (mul_nonneg hE (zero_le_one.trans h₁)) (zero_le_one.trans h₂)) h₃))) exact polynomial_density_cost B G J _ Cs E (by positivity) hCs hE hB hG hdec hweighted include hc hinj in theorem initial_subbin_cost_elementary (F R : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (ray : SecondRayIndex) (K : Finset ι → Finset ι → Finset O) (Z H M ε A Vmax Cs : ℝ) (hZ : 0 < Z) (hH : 0 < H) (hA : 0 ≤ A) (hVmax : 0 ≤ Vmax) (hCs : 0 ≤ Cs) (j : SecondLogIndex) (s : Finset (SecondExpansionData ι)) (hs : s ⊆ secondLogSector p ∅ F K R Z M j) (V₁ V₂ : ℝ → ℂ) (hV₁ : ∀ t,‖V₁ t‖ ≤ Vmax) (hV₂ : ∀ t,‖V₂ t‖ ≤ Vmax) (hs₁ : ∀ t,V₁ t ≠ 0 → |t| ≤ A) (hs₂ : ∀ t,V₂ t ≠ 0 → |t| ≤ A) (B : Frequency → ℝ) (J N : ℕ) (hB : ∀ q,0 ≤ B q) (hdec : ∀ q,(1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N*B q ≤ Cs*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2) : initialRestrictedBinCost p hp hcop hg F R Ψ m ray s Z H ε j V₁ V₂ B ≤ ((H/primeProductNorm p R)*Real.exp 4* (initialElementaryConstant A Vmax*(secondLogK j*Real.exp 2))*Cs* (∫ t : ℝ,firstLogDensity 0 t)^3)*‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε / (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N := by have hb := initial_subbin_density_elementary p hp hcop hg hc hinj F R Ψ hΨ m ray K Z H M A Vmax Cs hZ hH hA hVmax hCs j s hs V₁ V₂ hV₁ hV₂ hs₁ hs₂ B J N hB hdec have hk : 0 < secondLogK j := normLogScale_pos _ have hR := FirstPassCubeLabels.primeProductNorm_pos p hp R have hpref : 0 ≤ H*primeProductNorm p R/Z^2*‖secondRayCoefficient ray‖* (secondLogK j*Real.exp 2)^ε := by positivity have h := mul_le_mul_of_nonneg_left hb hpref apply h.trans_eq rw [initial_log_mass Z (primeProductNorm p R) hR.ne',mul_pow] have he : (Real.exp 2)^2=Real.exp 4 := by rw [pow_two,←Real.exp_add]; norm_num rw [he] have hz := hZ.ne' have hr := hR.ne' field_simp end open MeasureTheory open scoped BigOperators Classical open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm firstLogDensity) def initialRadial (Z H R : ℝ) (j : SecondLogIndex) : ℝ := H*secondLogK j*R^2/Z^2 theorem initial_radial_absorbs_rows (Z H R k : ℝ) (N : ℕ) (hZ : 0 < Z) (hH : 1 ≤ H) (hR : 1 ≤ R) (hk : 0 ≤ k) : H*k^2/(1+H*k*R^2/Z^2)^(N+2) ≤ Z^4/(1+H*k*R^2/Z^2)^N := by let r := H*k*R^2/Z^2 have hH0 : 0 ≤ H := zero_le_one.trans hH have hr : 0 ≤ r := by dsimp [r]; positivity have h1 : 0 < 1+r := by linarith have hHR : 1 ≤ H*R^4 := one_le_mul_of_one_le_of_one_le hH (one_le_pow₀ hR) have he : Z^4*r^2=(H*k^2)*(H*R^4) := by dsimp [r] field_simp have hnum : H*k^2 ≤ Z^4*r^2 := by rw [he] exact le_mul_of_one_le_right (mul_nonneg hH0 (sq_nonneg k)) hHR change H*k^2/(1+r)^(N+2) ≤ Z^4/(1+r)^N calc _ ≤ Z^4*r^2/(1+r)^(N+2) := div_le_div_of_nonneg_right hnum (pow_nonneg h1.le _) _ ≤ Z^4*(1+r)^2/(1+r)^(N+2) := by apply div_le_div_of_nonneg_right _ (pow_nonneg h1.le _) exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hr (by linarith) 2) (by positivity) _ = _ := by rw [pow_add]; field_simp def initialHighRadialConstant (A Vmax Cs : ℝ) : ℝ := Real.exp 8*initialElementaryConstant A Vmax*Cs*(∫ t : ℝ,firstLogDensity 0 t)^3 lemma initialHighRadialConstant_nonneg (A Vmax Cs : ℝ) (hCs : 0 ≤ Cs) : 0 ≤ initialHighRadialConstant A Vmax Cs := by have hi : 0 ≤ ∫ t : ℝ,firstLogDensity 0 t := integral_nonneg (fun t => FirstPassCubeLabels.firstLogDensity_nonneg 0 t) have hc := initialElementaryConstant_nonneg A Vmax unfold initialHighRadialConstant positivity variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) include hc hinj in theorem initial_subbin_cost_radial_decay (F R : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (ray : SecondRayIndex) (K : Finset ι → Finset ι → Finset O) (Z H M ε A Vmax Cs : ℝ) (hZ : 0 < Z) (hH : 1 ≤ H) (hε : ε ≤ 1) (hA : 0 ≤ A) (hVmax : 0 ≤ Vmax) (hCs : 0 ≤ Cs) (j : SecondLogIndex) (s : Finset (SecondExpansionData ι)) (hs : s ⊆ secondLogSector p ∅ F K R Z M j) (V₁ V₂ : ℝ → ℂ) (hV₁ : ∀ t,‖V₁ t‖ ≤ Vmax) (hV₂ : ∀ t,‖V₂ t‖ ≤ Vmax) (hs₁ : ∀ t,V₁ t ≠ 0 → |t| ≤ A) (hs₂ : ∀ t,V₂ t ≠ 0 → |t| ≤ A) (B : Frequency → ℝ) (J N : ℕ) (hB : ∀ q,0 ≤ B q) (hdec : ∀ q,(1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^(N+2)*B q ≤ Cs*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2) : initialRestrictedBinCost p hp hcop hg F R Ψ m ray s Z H ε j V₁ V₂ B ≤ initialHighRadialConstant A Vmax Cs*Z^4/primeProductNorm p R* ‖secondRayCoefficient ray‖/(1+initialRadial Z H (primeProductNorm p R) j)^N := by have hH0 := zero_lt_one.trans_le hH have hb := initial_subbin_cost_elementary p hp hcop hg hc hinj F R Ψ hΨ m ray K Z H M ε A Vmax Cs hZ hH0 hA hVmax hCs j s hs V₁ V₂ hV₁ hV₂ hs₁ hs₂ B J (N+2) hB hdec have hR1 := primeProductNorm_ge_one p hp R have hR0 := zero_lt_one.trans_le hR1 have hk : 0 < secondLogK j := normLogScale_pos _ have hrow : 1 ≤ secondLogK j*Real.exp 2 := one_le_mul_of_one_le_of_one_le (normLogScale_ge_one _) (Real.one_le_exp (by norm_num)) have hrowpow : (secondLogK j*Real.exp 2)^ε ≤ secondLogK j*Real.exp 2 := by simpa only [Real.rpow_one] using Real.rpow_le_rpow_of_exponent_le hrow hε have hcc := initialElementaryConstant_nonneg A Vmax have hi : 0 ≤ ∫ t : ℝ,firstLogDensity 0 t := integral_nonneg (fun t => FirstPassCubeLabels.firstLogDensity_nonneg 0 t) have hfixed := initialHighRadialConstant_nonneg A Vmax Cs hCs have hpref : 0 ≤ ((H/primeProductNorm p R)*Real.exp 4* (initialElementaryConstant A Vmax*(secondLogK j*Real.exp 2))*Cs* (∫ t : ℝ,firstLogDensity 0 t)^3)*‖secondRayCoefficient ray‖ := by positivity have hden : 0 ≤ (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^(N+2) := by positivity apply hb.trans calc _ ≤ ((H/primeProductNorm p R)*Real.exp 4* (initialElementaryConstant A Vmax*(secondLogK j*Real.exp 2))*Cs* (∫ t : ℝ,firstLogDensity 0 t)^3)*‖secondRayCoefficient ray‖* (secondLogK j*Real.exp 2)/(1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^(N+2) := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hrowpow hpref) hden _ = (initialHighRadialConstant A Vmax Cs/primeProductNorm p R*‖secondRayCoefficient ray‖)* (H*(secondLogK j)^2/(1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^(N+2)) := by unfold initialHighRadialConstant have he : Real.exp 4*(Real.exp 2)^2=Real.exp 8 := by rw [pow_two,←Real.exp_add,←Real.exp_add]; norm_num rw [←he] ring _ ≤ (initialHighRadialConstant A Vmax Cs/primeProductNorm p R*‖secondRayCoefficient ray‖)* (Z^4/(1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N) := mul_le_mul_of_nonneg_left (initial_radial_absorbs_rows Z H (primeProductNorm p R) (secondLogK j) N hZ hH hR1 hk.le) (by positivity) _ = _ := by unfold initialRadial; ring end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.SourceRemainders namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace InitialMeanSquare section open MeasureTheory open scoped BigOperators Classical open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm firstLogDensity) def initialHighRadialCost {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (s : SecondRayIndex → Finset ι → SecondLogIndex → Finset (SecondExpansionData ι)) (B : SecondRayIndex → Finset ι → SecondLogIndex → Frequency → ℝ) (Z H U Kmax ε θ : ℝ) (V₁ V₂ : ℝ → ℂ) : ℝ := letI rayFintypeWitness := @OAI.RayFourExpansion.rayCharacterFintype ∑ ray : SecondRayIndex,∑ R ∈ boundedPrimeSupports p F U,∑ j ∈ secondLogBinBox U Kmax, if Z^θ < initialRadial Z H (primeProductNorm p R) j then initialRestrictedBinCost p hp hcop hg F R Ψ m ray (s ray R j) Z H ε j V₁ V₂ (B ray R j) else 0 section variable {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) include hc hinj in theorem initial_high_radial_sum (F : Finset ι) (Ψ : O →* ℂ) (hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (K : Finset ι → Finset ι → Finset O) (Z H U Kmax M ε θ A Vmax Cs : ℝ) (hZ : 0 < Z) (hH : 1 ≤ H) (hε : ε ≤ 1) (hA : 0 ≤ A) (hVmax : 0 ≤ Vmax) (hCs : 0 ≤ Cs) (s : SecondRayIndex → Finset ι → SecondLogIndex → Finset (SecondExpansionData ι)) (hs : ∀ ray,∀ R ∈ boundedPrimeSupports p F U,∀ j ∈ secondLogBinBox U Kmax, s ray R j ⊆ secondLogSector p ∅ F K R Z M j) (V₁ V₂ : ℝ → ℂ) (hV₁ : ∀ t,‖V₁ t‖ ≤ Vmax) (hV₂ : ∀ t,‖V₂ t‖ ≤ Vmax) (hs₁ : ∀ t,V₁ t ≠ 0 → |t| ≤ A) (hs₂ : ∀ t,V₂ t ≠ 0 → |t| ≤ A) (B : SecondRayIndex → Finset ι → SecondLogIndex → Frequency → ℝ) (J N : ℕ) (hB : ∀ ray,∀ R ∈ boundedPrimeSupports p F U,∀ j ∈ secondLogBinBox U Kmax,∀ q,0 ≤ B ray R j q) (hdec : ∀ ray,∀ R ∈ boundedPrimeSupports p F U,∀ j ∈ secondLogBinBox U Kmax,∀ q, (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^(N+2)*B ray R j q ≤ Cs*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2) : initialHighRadialCost p hp hcop hg F Ψ m s B Z H U Kmax ε θ V₁ V₂ ≤ (initialHighRadialConstant A Vmax Cs*Z^4/(Z^θ)^N)*initialRayMass* ((secondLogBinBox U Kmax).card : ℝ)*(128*Real.exp 1*(normLogBin U+1 : ℝ)) := by have hconstant := initialHighRadialConstant_nonneg A Vmax Cs hCs have hzpow : 0 < Z^θ := Real.rpow_pos_of_pos hZ _ unfold initialHighRadialCost apply initial_harmonic_aggregation p hinj F U Kmax _ (by positivity) intro ray R hR j hj split_ifs with hh · have hc' := initial_subbin_cost_radial_decay p hp hcop hg hc hinj F R Ψ hΨ m ray K Z H M ε A Vmax Cs hZ hH hε hA hVmax hCs j (s ray R j) (hs ray R hR j hj) V₁ V₂ hV₁ hV₂ hs₁ hs₂ (B ray R j) J N (hB ray R hR j hj) (hdec ray R hR j hj) have hRp := FirstPassCubeLabels.primeProductNorm_pos p hp R have hd : (Z^θ)^N ≤ (1+initialRadial Z H (primeProductNorm p R) j)^N := pow_le_pow_left₀ hzpow.le (by linarith) N have hnum : 0 ≤ initialHighRadialConstant A Vmax Cs*Z^4/primeProductNorm p R* ‖secondRayCoefficient ray‖ := by positivity apply hc'.trans calc _ ≤ (initialHighRadialConstant A Vmax Cs*Z^4/primeProductNorm p R* ‖secondRayCoefficient ray‖)/(Z^θ)^N := div_le_div_of_nonneg_left hnum (pow_pos hzpow _) hd _ = _ := by ring · have hRp := FirstPassCubeLabels.primeProductNorm_pos p hp R positivity end theorem initial_log_harmonic_polynomial : ∃ C : ℝ,0 < C ∧ ∀ (Y U Kmax : ℝ),1 ≤ Y → 0 < U → 0 < Kmax → U ≤ Y → Kmax ≤ Y → ((secondLogBinBox U Kmax).card : ℝ)*(128*Real.exp 1*(normLogBin U+1 : ℝ)) ≤ C*Y^2 := by obtain ⟨C,hC,hbound⟩ := initial_log_box_small_power 1 (by norm_num) refine ⟨C*(256*Real.exp 1),by positivity,?_⟩ intro Y U Kmax hY hU hK hUY hKY have hc := hbound Y U Kmax hY hU hK hUY hKY rw [Real.rpow_one] at hc have hu := normLogBin_le_log_upper U Y hU hUY hY have hl := Real.log_le_sub_one_of_pos (zero_lt_one.trans_le hY) have hlog : (normLogBin U : ℝ)+1 ≤ 2*Y := by linarith have hh : 128*Real.exp 1*(normLogBin U+1 : ℝ) ≤ (256*Real.exp 1)*Y := by have he := Real.exp_pos (1:ℝ) nlinarith have hnon : 0 ≤ 128*Real.exp 1*(normLogBin U+1 : ℝ) := by positivity calc _ ≤ (C*Y)*((256*Real.exp 1)*Y) := mul_le_mul hc hh hnon (by positivity) _ = _ := by ring theorem initial_high_radial_order (θ τ : ℝ) (hθ : 0 < θ) : ∃ N : ℕ,38+τ ≤ θ*(N : ℝ) := by obtain ⟨N,hN⟩ := exists_nat_gt ((38+τ)/θ) refine ⟨N,?_⟩ have hh := (div_lt_iff₀ hθ).mp hN linarith theorem initial_high_radial_negligible (θ τ A Vmax Cs Ccap : ℝ) (N : ℕ) (hN : 38+τ ≤ θ*(N : ℝ)) (hA : 0 ≤ A) (hVmax : 0 ≤ Vmax) (hCs : 0 ≤ Cs) (hcap : 1 ≤ Ccap) : ∃ C : ℝ,0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (F : Finset ι) (Ψ : O →* ℂ) (_hΨ : ∀ a,‖Ψ a‖ ≤ 1) (m : O) (K : Finset ι → Finset ι → Finset O) (Z H U Kmax M ε : ℝ), 1 ≤ Z → 1 ≤ H → 0 < U → 0 < Kmax → ε ≤ 1 → U ≤ Ccap*Z^17 → Kmax ≤ Ccap*Z^17 → ∀ (s : SecondRayIndex → Finset ι → SecondLogIndex → Finset (SecondExpansionData ι)), (∀ ray,∀ R ∈ boundedPrimeSupports p F U,∀ j ∈ secondLogBinBox U Kmax, s ray R j ⊆ secondLogSector p ∅ F K R Z M j) → ∀ (V₁ V₂ : ℝ → ℂ), (∀ t,‖V₁ t‖ ≤ Vmax) → (∀ t,‖V₂ t‖ ≤ Vmax) → (∀ t,V₁ t ≠ 0 → |t| ≤ A) → (∀ t,V₂ t ≠ 0 → |t| ≤ A) → ∀ (B : SecondRayIndex → Finset ι → SecondLogIndex → Frequency → ℝ) (J : ℕ), (∀ ray,∀ R ∈ boundedPrimeSupports p F U,∀ j ∈ secondLogBinBox U Kmax,∀ q,0 ≤ B ray R j q) → (∀ ray,∀ R ∈ boundedPrimeSupports p F U,∀ j ∈ secondLogBinBox U Kmax,∀ q, (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^(N+2)*B ray R j q ≤ Cs*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2) → initialHighRadialCost p hp hcop hg F Ψ m s B Z H U Kmax ε θ V₁ V₂ ≤ C*Z^(-τ) := by obtain ⟨Clog,hClog,hlog⟩ := initial_log_harmonic_polynomial let Cbase := initialHighRadialConstant A Vmax Cs*initialRayMass*Clog*Ccap^2 have hfixed := initialHighRadialConstant_nonneg A Vmax Cs hCs have hray := initialRayMass_nonneg have hbase : 0 ≤ Cbase := by dsimp [Cbase] exact mul_nonneg (mul_nonneg (mul_nonneg hfixed initialRayMass_nonneg) hClog.le) (sq_nonneg _) refine ⟨Cbase+1,by linarith,?_⟩ intro ι _ p hp _ hcop hg hc hinj F Ψ hΨ m K Z H U Kmax M ε hZ hH hU hK hε hUcap hKcap s hs V₁ V₂ hV₁ hV₂ hs₁ hs₂ B J hB hdec have hZ0 := zero_lt_one.trans_le hZ have hy : 1 ≤ Ccap*Z^17 := one_le_mul_of_one_le_of_one_le hcap (one_le_pow₀ hZ) have hlogs := hlog (Ccap*Z^17) U Kmax hy hU hK hUcap hKcap have hb := initial_high_radial_sum p hp hcop hg hc hinj F Ψ hΨ m K Z H U Kmax M ε θ A Vmax Cs hZ0 hH hε hA hVmax hCs s hs V₁ V₂ hV₁ hV₂ hs₁ hs₂ B J N hB hdec have hscalar : Z^(38 : ℕ)/(Z^θ)^N ≤ Z^(-τ) := by have he : Z^(38 : ℕ)/(Z^θ)^N=Z^((38 : ℝ)-θ*(N : ℝ)) := by rw [Real.rpow_sub hZ0,Real.rpow_mul_natCast hZ0.le] norm_cast rw [he] exact Real.rpow_le_rpow_of_exponent_le hZ (by linarith) calc _ ≤ (initialHighRadialConstant A Vmax Cs*Z^4/(Z^θ)^N)*initialRayMass* ((secondLogBinBox U Kmax).card : ℝ)*(128*Real.exp 1*(normLogBin U+1 : ℝ)) := hb _ = ((initialHighRadialConstant A Vmax Cs*Z^4/(Z^θ)^N)*initialRayMass)* (((secondLogBinBox U Kmax).card : ℝ)*(128*Real.exp 1*(normLogBin U+1 : ℝ))) := by ring _ ≤ ((initialHighRadialConstant A Vmax Cs*Z^4/(Z^θ)^N)*initialRayMass)* (Clog*(Ccap*Z^17)^2) := mul_le_mul_of_nonneg_left hlogs (by positivity) _ = Cbase*(Z^(38 : ℕ)/(Z^θ)^N) := by dsimp [Cbase]; ring _ ≤ Cbase*Z^(-τ) := mul_le_mul_of_nonneg_left hscalar hbase _ ≤ (Cbase+1)*Z^(-τ) := mul_le_mul_of_nonneg_right (by linarith) (Real.rpow_nonneg hZ0.le _) end section open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration open FirstPassCubeLabels (primeProductNorm) open ConcreteTraceCRT (eisEmbedding) theorem initialErrorFrequencyBound_le (a b Z H : ℝ) (hZ : 1 ≤ Z) (hH : 1 ≤ H) : initialErrorFrequencyBound a b Z H ≤ 48*(1+Real.exp (initialErrorWindow a b))^16*Z^16 := by let Q := 1+Z*Real.exp (initialErrorWindow a b) have hZ0 := zero_lt_one.trans_le hZ have hH0 := zero_lt_one.trans_le hH have hQ : 1 ≤ Q := by dsimp [Q] have hh : 0 ≤ Z*Real.exp (initialErrorWindow a b) := by positivity linarith have hQ0 : 0 ≤ Q := zero_le_one.trans hQ have h3 : Q^3/H ≤ Q^3 := div_le_self (pow_nonneg hQ0 _) hH have hinner : 1+Q^3/H ≤ 2*Q^3 := by linarith [one_le_pow₀ hQ (n := 3)] have hT : initialTailHeight Z H (initialErrorWindow a b) ≤ 2*Q^5 := by change Q^2*(1+Q^3/H) ≤ 2*Q^5 calc _ ≤ Q^2*(2*Q^3) := mul_le_mul_of_nonneg_left hinner (sq_nonneg Q) _ = _ := by ring have hT0 : 0 ≤ initialTailHeight Z H (initialErrorWindow a b) := (initialTailHeight_pos Z H _ hZ0 hH0).le have hv : initialTailHeight Z H (initialErrorWindow a b)*Q^3/H ≤ 2*Q^8 := by calc _ ≤ initialTailHeight Z H (initialErrorWindow a b)*Q^3 := div_le_self (mul_nonneg hT0 (pow_nonneg hQ0 _)) hH _ ≤ (2*Q^5)*Q^3 := mul_le_mul_of_nonneg_right hT (pow_nonneg hQ0 _) _ = _ := by ring have hv2 : initialTailHeight Z H (initialErrorWindow a b)*Q^3/H+2 ≤ 4*Q^8 := by linarith [one_le_pow₀ hQ (n := 8)] have hb : initialErrorFrequencyBound a b Z H ≤ 48*Q^16 := by unfold initialErrorFrequencyBound change 3*(initialTailHeight Z H (initialErrorWindow a b)*Q^3/H+2)^2 ≤ _ calc _ ≤ 3*(4*Q^8)^2 := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (by positivity) hv2 2) (by norm_num) _ = _ := by ring have hQZ : Q ≤ (1+Real.exp (initialErrorWindow a b))*Z := by dsimp [Q] nlinarith calc _ ≤ 48*Q^16 := hb _ ≤ 48*((1+Real.exp (initialErrorWindow a b))*Z)^16 := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hQ0 hQZ 16) (by norm_num) _ = _ := by rw [mul_pow]; ring def initialErrorRowBound (a b Z H : ℝ) : ℝ := Z*Real.exp (initialErrorWindow a b)*initialErrorFrequencyBound a b Z H lemma initialErrorRowBound_pos (a b Z H : ℝ) (hZ : 0 < Z) (hH : 0 < H) : 0 < initialErrorRowBound a b Z H := by have ht := initialTailHeight_pos Z H (initialErrorWindow a b) hZ hH unfold initialErrorRowBound initialErrorFrequencyBound positivity theorem initialErrorRowBound_valid {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (F R : Finset ι) (a b Z H : ℝ) (hZ : 0 < Z) (hH : 0 < H) (x : SecondExpansionData ι) (hx : x ∈ secondSupportedSector p F (fun _ _ => initialErrorCutoff a b Z H) R Z (initialErrorWindow a b)) : elementNorm (sourceObservation p x).1 ≤ initialErrorRowBound a b Z H := by obtain ⟨hG,hE,hV,hk,hkf,hR,hs⟩ := secondSupportedSector_mem p F (fun _ _ => initialErrorCutoff a b Z H) R Z (initialErrorWindow a b) x hx have he := (secondSourceSupport_bounds p hp Z (initialErrorWindow a b) x hs hE).2.1 have hf := initialErrorCutoff_norm_bound a b Z H hZ hH x.frequency hkf have hh := mul_le_mul he hf (sq_nonneg ‖eisEmbedding x.frequency‖) (by positivity) simpa only [initialErrorRowBound,sourceObservation,elementNorm,map_mul,norm_mul,mul_pow, primeSubsetGenerator_norm_eq_productNorm] using hh def initialPolynomialCap (a b : ℝ) : ℝ := 1+Real.exp (initialErrorWindow a b)+ 48*Real.exp (initialErrorWindow a b)*(1+Real.exp (initialErrorWindow a b))^16 lemma initialPolynomialCap_ge_one (a b : ℝ) : 1 ≤ initialPolynomialCap a b := by unfold initialPolynomialCap have he := Real.exp_pos (initialErrorWindow a b) have hh : 0 ≤ 48*Real.exp (initialErrorWindow a b)*(1+Real.exp (initialErrorWindow a b))^16 := by positivity linarith theorem initial_actual_bin_polynomial_caps (a b Z H : ℝ) (hZ : 1 ≤ Z) (hH : 1 ≤ H) : Z*Real.exp (initialErrorWindow a b) ≤ initialPolynomialCap a b*Z^17 ∧ initialErrorRowBound a b Z H ≤ initialPolynomialCap a b*Z^17 := by have he := Real.exp_pos (initialErrorWindow a b) have hZ0 : 0 ≤ Z := zero_le_one.trans hZ have hz17 : Z ≤ Z^17 := by simpa only [pow_one] using pow_le_pow_right₀ hZ (by decide : 1 ≤ 17) have hC1 : Real.exp (initialErrorWindow a b) ≤ initialPolynomialCap a b := by unfold initialPolynomialCap have hh : 0 ≤ 48*Real.exp (initialErrorWindow a b)*(1+Real.exp (initialErrorWindow a b))^16 := by positivity linarith have hC2 : 48*Real.exp (initialErrorWindow a b)*(1+Real.exp (initialErrorWindow a b))^16 ≤ initialPolynomialCap a b := by unfold initialPolynomialCap have hh : 0 ≤ 48*Real.exp (initialErrorWindow a b)*(1+Real.exp (initialErrorWindow a b))^16 := by positivity linarith constructor · calc _ ≤ Real.exp (initialErrorWindow a b)*Z^17 := by rw [mul_comm Z]; exact mul_le_mul_of_nonneg_left hz17 he.le _ ≤ _ := mul_le_mul_of_nonneg_right hC1 (pow_nonneg hZ0 _) · have hb := mul_le_mul_of_nonneg_left (initialErrorFrequencyBound_le a b Z H hZ hH) (mul_nonneg hZ0 he.le) change initialErrorRowBound a b Z H ≤ _ at hb calc _ ≤ (Z*Real.exp (initialErrorWindow a b))*(48*(1+Real.exp (initialErrorWindow a b))^16*Z^16) := hb _ = (48*Real.exp (initialErrorWindow a b)*(1+Real.exp (initialErrorWindow a b))^16)*Z^17 := by ring _ ≤ _ := mul_le_mul_of_nonneg_right hC2 (pow_nonneg hZ0 _) end open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm firstLogDensity normalizedColumn columnLog) theorem initial_two_windows_bounded (V₁ V₂ : ℝ → ℂ) (hc₁ : HasCompactSupport V₁) (hc₂ : HasCompactSupport V₂) (hs₁ : Continuous V₁) (hs₂ : Continuous V₂) : ∃ A Vmax : ℝ,0 ≤ A ∧ 0 ≤ Vmax ∧ (∀ t,‖V₁ t‖ ≤ Vmax) ∧ (∀ t,‖V₂ t‖ ≤ Vmax) ∧ (∀ t,V₁ t ≠ 0 → |t| ≤ A) ∧ (∀ t,V₂ t ≠ 0 → |t| ≤ A) := by obtain ⟨A₁,hA₁,hbound₁⟩ := hc₁.exists_pos_le_norm obtain ⟨A₂,hA₂,hbound₂⟩ := hc₂.exists_pos_le_norm obtain ⟨B₁,hB₁⟩ := hc₁.exists_bound_of_continuous hs₁ obtain ⟨B₂,hB₂⟩ := hc₂.exists_bound_of_continuous hs₂ refine ⟨max A₁ A₂,max 0 (max B₁ B₂),?_,le_max_left _ _,?_,?_,?_,?_⟩ · exact hA₁.le.trans (le_max_left _ _) · intro t exact (hB₁ t).trans ((le_max_left _ _).trans (le_max_right _ _)) · intro t exact (hB₂ t).trans ((le_max_right _ _).trans (le_max_right _ _)) · intro t ht have hh : ‖t‖ < A₁ := lt_of_not_ge (fun h => ht (hbound₁ t h)) simpa only [Real.norm_eq_abs] using hh.le.trans (le_max_left A₁ A₂) · intro t ht have hh : ‖t‖ < A₂ := lt_of_not_ge (fun h => ht (hbound₂ t h)) simpa only [Real.norm_eq_abs] using hh.le.trans (le_max_right A₁ A₂) theorem initial_high_radial_source (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g W : 𝓢(ℝ,ℂ)) (a b θ τ ε : ℝ) (hU : ∀ t,g t ≠ 0 → U t=1) (hgs : ∀ t,g t ≠ 0 → |t| ≤ initialErrorWindow a b) (hθ : 0 < θ) (hε : 0 < ε) (hε1 : ε ≤ 1) : ∃ C : ℝ,0 < C ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i,ringChar (O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i,lambda^2 ∣ p i-1) (F : Finset ι) (Ψ : O →* ℂ) (m : O) (Z H : ℝ), 1 ≤ Z → 1 ≤ H → (∀ x,‖Ψ x‖ ≤ 1) → ∀ (s : SecondRayIndex → Finset ι → SecondLogIndex → Finset (SecondExpansionData ι)), (∀ ray R j,s ray R j ⊆ secondLogSector p ∅ F (fun _ _ => initialErrorCutoff a b Z H) R Z (initialErrorWindow a b) j) → let G := fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V letI rayFintypeWitness := @OAI.RayFourExpansion.rayCharacterFintype (∑ ray : SecondRayIndex,∑ R ∈ boundedPrimeSupports p F (Z*Real.exp (initialErrorWindow a b)), ∑ j ∈ secondLogBinBox (Z*Real.exp (initialErrorWindow a b)) (initialErrorRowBound a b Z H), if Z^θ < initialRadial Z H (primeProductNorm p R) j then ‖secondExpansionSource p hp hcop hg F Ψ m 1 1 ray (s ray R j) G G W H‖ else 0) ≤ C*Z^(-τ) := by letI rayFintypeWitness := @OAI.RayFourExpansion.rayCharacterFintype obtain ⟨N,hN⟩ := initial_high_radial_order θ τ hθ have hM : 0 ≤ initialErrorWindow a b := by unfold initialErrorWindow; positivity obtain ⟨windows,Ct,Cs,hCt,hCs,hwc,hws,ht⟩ := initial_subbin_transfer U hUc hUs g W (initialErrorWindow a b) hM hU hgs ε hε (N+2) 0 obtain ⟨A,Vmax,hA,hVmax,hV₁,hV₂,hs₁,hs₂⟩ := initial_two_windows_bounded (windows 5) (windows 6) (hwc 5) (hwc 6) (hws 5).continuous (hws 6).continuous obtain ⟨Ch,hCh,hh⟩ := initial_high_radial_negligible θ τ A Vmax Cs (initialPolynomialCap a b) N hN hA hVmax hCs (initialPolynomialCap_ge_one a b) refine ⟨Ct*Ch+1,by positivity,?_⟩ intro ι _ p hp _ hcop hg hinj hc hpr F Ψ m Z H hZ hH hΨ s hs dsimp only have hZ0 := zero_lt_one.trans_le hZ have hH0 := zero_lt_one.trans_le hH let K := fun (_ _ : Finset ι) => initialErrorCutoff a b Z H let G := fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V let B : SecondRayIndex → Finset ι → SecondLogIndex → Frequency → ℝ := fun ray R j => Classical.choose (ht p hp hcop hg hinj hc hpr F R Ψ m ray K Z H (initialErrorWindow a b) j (s ray R j) hZ0 hH0 hΨ (hs ray R j)) have hB (ray : SecondRayIndex) (R : Finset ι) (j : SecondLogIndex) := Classical.choose_spec (ht p hp hcop hg hinj hc hpr F R Ψ m ray K Z H (initialErrorWindow a b) j (s ray R j) hZ0 hH0 hΨ (hs ray R j)) have hcost := hh p hp hcop hg hc hinj F Ψ hΨ m K Z H (Z*Real.exp (initialErrorWindow a b)) (initialErrorRowBound a b Z H) (initialErrorWindow a b) ε hZ hH (by positivity) (initialErrorRowBound_pos a b Z H hZ0 hH0) hε1 (initial_actual_bin_polynomial_caps a b Z H hZ hH).1 (initial_actual_bin_polynomial_caps a b Z H hZ hH).2 s (fun ray R _ j _ => hs ray R j) (windows 5) (windows 6) hV₁ hV₂ hs₁ hs₂ B 0 (fun ray R _ j _ => (hB ray R j).1) (fun ray R _ j _ => (hB ray R j).2.1) have hsum : (∑ ray : SecondRayIndex,∑ R ∈ boundedPrimeSupports p F (Z*Real.exp (initialErrorWindow a b)), ∑ j ∈ secondLogBinBox (Z*Real.exp (initialErrorWindow a b)) (initialErrorRowBound a b Z H), if Z^θ < initialRadial Z H (primeProductNorm p R) j then ‖secondExpansionSource p hp hcop hg F Ψ m 1 1 ray (s ray R j) G G W H‖ else 0) ≤ Ct*initialHighRadialCost p hp hcop hg F Ψ m s B Z H (Z*Real.exp (initialErrorWindow a b)) (initialErrorRowBound a b Z H) ε θ (windows 5) (windows 6) := by unfold initialHighRadialCost simp only [Finset.mul_sum] apply Finset.sum_le_sum intro ray hray apply Finset.sum_le_sum intro R hR apply Finset.sum_le_sum intro j hj split_ifs with hjrad · convert (hB ray R j).2.2 using 1 <;> first | rfl | ((try dsimp only [initialRestrictedBinCost,G,B]); ring) · simp calc _ ≤ Ct*initialHighRadialCost p hp hcop hg F Ψ m s B Z H (Z*Real.exp (initialErrorWindow a b)) (initialErrorRowBound a b Z H) ε θ (windows 5) (windows 6) := hsum _ ≤ Ct*(Ch*Z^(-τ)) := mul_le_mul_of_nonneg_left hcost hCt _ ≤ (Ct*Ch+1)*Z^(-τ) := by have hz := Real.rpow_nonneg hZ0.le (-τ) nlinarith end InitialMeanSquare open scoped BigOperators Classical SchwartzMap namespace FirstPassCubeLabels section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) open EisensteinSchwartzPoisson (paperRadialFourier) open MixedCrossSeparation (columnCoefficient columnPrimeCoprime) section variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) lemma threeBlockExponent_ne_zero_on (N P B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) : ∀i∈(N∪P)∪cubeActiveSupport B v ε₁ ε₂,threeBlockExponent N P v ε₁ ε₂ i≠0 := by intro i hi by_cases hn:i∈N · simp [threeBlockExponent,hn] by_cases hp':i∈P · simp [threeBlockExponent,hn,hp'] · have hiC:i∈cubeActiveSupport B v ε₁ ε₂ := by simpa [hn,hp'] using hi simp only [threeBlockExponent,if_neg hn,if_neg hp'] exact (ZMod.val_eq_zero _).not.mpr (Finset.mem_filter.mp hiC).2 lemma threeBlockExponent_lt_six_on (N P B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) : ∀i∈(N∪P)∪cubeActiveSupport B v ε₁ ε₂,threeBlockExponent N P v ε₁ ε₂ i<6 := by intro i hi unfold threeBlockExponent split_ifs <;> first | omega | exact ZMod.val_lt _ lemma threeGaussRowFactor_norm_le (hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (N P B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (C₁ C₂ : Finset ι→ℂ) (d h : O) : ‖threeGaussRowFactor p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ d h‖≤‖C₁ N‖*‖C₂ P‖ := by let S := (N∪P)∪cubeActiveSupport B v ε₁ ε₂ let e := threeBlockExponent N P v ε₁ ε₂ have hG := FiniteGaussPhase.norm_canonicalProductGauss (fun i:S=>p i.val) (fun i=>hp i.val) (columnPrimeCoprime p hcop S) (fun i=>hg i.val) (fun i=>hc i.val) (fun i=>e i.val) (fun i=>threeBlockExponent_ne_zero_on N P B v ε₁ ε₂ i.val i.property) (fun i=>threeBlockExponent_lt_six_on N P B v ε₁ ε₂ i.val i.property) change ‖star (columnCoefficient p hp hcop hg N*C₁ N)* (columnCoefficient p hp hcop hg P*C₂ P)* FiniteGaussPhase.canonicalProductGauss (fun i:S=>p i.val) (fun i=>hp i.val) (columnPrimeCoprime p hcop S) (fun i=>hg i.val) (fun i=>e i.val)* (blockRow p hg S e d*star (blockRow p hg S e h))‖≤_ simp only [norm_mul,norm_star,SecondPassArithmetic.columnCoefficient_norm_one p hp hcop hg hc, hG,one_mul,mul_one] apply mul_le_of_le_one_right (mul_nonneg (norm_nonneg _) (norm_nonneg _)) exact (mul_le_of_le_one_left (norm_nonneg _) (blockRow_norm_le_one p hg S e d)).trans (blockRow_norm_le_one p hg S e h) lemma canonicalPairMode_norm_le (hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (N P B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (C₁ C₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ K : ℝ) (hK : 0hp i))) have ha : K*‖eisEmbedding h‖^2/(‖eisEmbedding d‖^2* primeProductNorm p ((N∪P)∪cubeActiveSupport B v ε₁ ε₂)) = (K/(‖eisEmbedding d‖^2*primeProductNorm p ((N∪P)∪cubeActiveSupport B v ε₁ ε₂)))* ‖eisEmbedding h‖^2 := by ring simp only [canonicalPairMode,norm_mul,norm_div,Complex.norm_real,Real.norm_eq_abs, abs_of_pos hK,abs_of_pos hn,ha] calc _ ≤ (‖V₁ (columnLog p X₁ N)‖*‖V₂ (columnLog p X₂ P)‖* (K/‖eisEmbedding (∏i∈(N∪P)∪cubeActiveSupport B v ε₁ ε₂,p i)‖))* ‖paperRadialFourier W ((K/(‖eisEmbedding d‖^2* primeProductNorm p ((N∪P)∪cubeActiveSupport B v ε₁ ε₂)))*‖eisEmbedding h‖^2)‖* (‖C₁ N‖*‖C₂ P‖) := mul_le_mul_of_nonneg_left (threeGaussRowFactor_norm_le p hp hcop hg hc N P B v ε₁ ε₂ C₁ C₂ d h) (by positivity) _ = _ := by ring end theorem full_uniform_canonicalPairMode_remainder (A : ℕ) : ∃ (s : Finset (ℕ×ℕ)) (C : ℝ),0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (N P B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (C₁ C₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ K H : ℝ),0⟨h.val,hT h.val h.property⟩ have hfi : Function.Injective f := by intro a b hab exact Subtype.ext (congrArg (fun x:large=>x.val) hab) have hrad := EisensteinSchwartzPoisson.paperRadialFourier_lattice_summable_norm W scale hscale have hmajor := (hrad.subtype small).mul_left c have hpnt (h:small) : ‖canonicalPairMode p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K d h.val‖≤ c*‖paperRadialFourier W (scale*‖eisEmbedding h.val‖^2)‖ := canonicalPairMode_norm_le p hp hcop hg hc N P B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K hK d h.val have hsmall := Summable.of_nonneg_of_le (fun _=>norm_nonneg _) hpnt hmajor calc _ ≤ ∑'h:small,‖canonicalPairMode p hp hcop hg N P B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K d h.val‖ := norm_tsum_le_tsum_norm hsmall _ ≤ ∑'h:small,c*‖paperRadialFourier W (scale*‖eisEmbedding h.val‖^2)‖ := hsmall.tsum_le_tsum hpnt hmajor _ = c*∑'h:small,‖paperRadialFourier W (scale*‖eisEmbedding h.val‖^2)‖ := tsum_mul_left _ ≤ c*∑'h:large,‖paperRadialFourier W (scale*‖eisEmbedding h.val‖^2)‖ := mul_le_mul_of_nonneg_left ((hrad.subtype small).tsum_le_tsum_of_inj f hfi (fun _ _=>norm_nonneg _) (fun _=>le_rfl) (hrad.subtype large)) hc0 _ ≤ _ := mul_le_mul_of_nonneg_left (hb W scale H hscale hH) hc0 end open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisEmbedding_ne_zero) open SecondPassArithmetic (firstFrequencyDisk outside_firstFrequencyDisk columnLog_norm_upper) def canonicalFirstFrequencyRadius {ι : Type*} [DecidableEq ι] (p : ι→O) (B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (d : O) (X₁ X₂ K P : ℝ) : ℝ := P*(‖eisEmbedding d‖^2*primeProductNorm p (cubeActiveSupport B v ε₁ ε₂)*X₁*X₂)/K theorem full_uniform_canonicalPairMode_disk_remainder (A : ℕ) : ∃ (s : Finset (ℕ×ℕ)) (C : ℝ),0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (N Q B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool), Disjoint N Q → Disjoint N B → Disjoint Q B → ∀ (C₁ C₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ K P M₁ M₂ : ℝ),0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) lemma threeGaussRowFactor_empty (B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (C₁ C₂ : Finset ι→ℂ) (d h : O) (hB : cubeActiveSupport B v ε₁ ε₂=∅) : threeGaussRowFactor p hp hcop hg ∅ ∅ B v ε₁ ε₂ C₁ C₂ d h= star (C₁ ∅)*C₂ ∅ := by let : IsEmpty {i:ι // i∈(((∅:Finset ι)∪∅)∪cubeActiveSupport B v ε₁ ε₂)} := ⟨fun x=>by simpa [hB] using x.property⟩ simp [MixedCrossSeparation.columnCoefficient,FiniteGaussPhase.canonicalProductCoefficient, threeGaussRowFactor,canonicalProductGauss_cross_factors,FiniteGaussPhase.angularFactor, blockRow,finiteSexticRow] end FirstPassCubeLabels namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) lemma canonicalCubeResidual_empty (b : CubeCoordinates ι) (C : Finset ι) (negative : Bool) (Ψ : O→*ℂ) (m f : O) (H : Finset ι→ℂ) : canonicalCubeResidual p hg b C negative Ψ m f H ∅= H ((if negative then b.rightDivisor else b.leftDivisor)∪C) := by simp [canonicalCubeResidual,originalLabelColumn,multiplicativeCoreColumn, finiteSquarefreeRow,rowCoprimeMask] def canonicalCubeDualZero (pool : Finset ι) (b : CubeCoordinates ι) (C : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m₁ m₂ f : O) (H₁ H₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (K : ℝ) : ℂ := canonicalCubeOuter p hp hcop hg b C Ψ₁ Ψ₂ m₁ m₂ f* ∑D∈(C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit).powerset, (UniqueFactorizationMonoid.moebius (∏i∈D,Ideal.span {p i}):ℂ)/(primeProductNorm p D:ℂ)* actualFirstKernel p hp hcop hg (pool\(b.support∪C)) b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (canonicalCubeResidual p hg b C true Ψ₁ m₁ f H₁) (canonicalCubeResidual p hg b C false Ψ₂ m₂ f H₂) W (fun _=>1) (fun _=>1) 1 1 K (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) 0 theorem canonicalCubeDualZero_eq_density (hinj : Function.Injective (fun i=>Ideal.span {p i})) (pool : Finset ι) (b : CubeCoordinates ι) (C : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m₁ m₂ f : O) (H₁ H₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (K : ℝ) : canonicalCubeDualZero p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ f H₁ H₂ W K= if cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit=∅ then canonicalCubeOuter p hp hcop hg b C Ψ₁ Ψ₂ m₁ m₂ f* (star (H₁ (b.rightDivisor∪C))*H₂ (b.leftDivisor∪C))* (K:ℂ)*paperRadialFourier W 0* ∏i∈C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit, (1-(1:ℂ)/Ideal.absNorm (Ideal.span {p i})) else 0 := by unfold canonicalCubeDualZero simp_rw [actualFirstKernel_zero] split_ifs with hB · simp only [threeGaussRowFactor_empty p hp hcop hg _ _ _ _ _ _ _ _ hB, canonicalCubeResidual_empty,Bool.false_eq_true,ite_true,ite_false,one_mul] rw [←Finset.sum_mul] have hprime (i : ι) : Prime (Ideal.span {p i}) := Ideal.prime_of_isPrime (NeZero.ne (Ideal.span {p i})) inferInstance have hd (D : Finset ι) : (primeProductNorm p D:ℂ)= (Ideal.absNorm (∏i∈D,Ideal.span {p i}):ℂ) := by rw [primeProductNorm_eq_ideal_norm,Complex.ofReal_natCast] simp_rw [hd] rw [primeSubset_moebius_norm_sum _ hprime hinj] ring · simp only [mul_zero,Finset.sum_const_zero] theorem canonicalCubeDualZero_norm_le (hinj : Function.Injective (fun i=>Ideal.span {p i})) (hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (pool : Finset ι) (b : CubeCoordinates ι) (C : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (hΨ₁ : ∀u,‖Ψ₁ u‖≤1) (hΨ₂ : ∀u,‖Ψ₂ u‖≤1) (m₁ m₂ f : O) (H₁ H₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (K : ℝ) : ‖canonicalCubeDualZero p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ f H₁ H₂ W K‖≤ if cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit=∅ then ‖H₁ (b.rightDivisor∪C)‖*‖H₂ (b.leftDivisor∪C)‖*|K| *‖paperRadialFourier W 0‖ else 0 := by rw [canonicalCubeDualZero_eq_density p hp hcop hg hinj] split_ifs with hB · let M := C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit have hprod : (∏i∈M,(1-(1:ℂ)/Ideal.absNorm (Ideal.span {p i})))= ((∏i∈M,(1-(1:ℝ)/Ideal.absNorm (Ideal.span {p i}))):ℝ) := by simp only [Complex.ofReal_prod,Complex.ofReal_sub,Complex.ofReal_one, Complex.ofReal_div,Complex.ofReal_natCast] rw [show (C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit)=M from rfl,hprod] simp only [norm_mul,norm_star,Complex.norm_real,Real.norm_eq_abs, abs_of_nonneg (primeDensity_nonneg_le_one (fun i=>Ideal.span {p i}) M).1] calc _ ≤ 1*(‖H₁ (b.rightDivisor∪C)‖*‖H₂ (b.leftDivisor∪C)‖)*|K| *‖paperRadialFourier W 0‖* ∏i∈M,(1-(1:ℝ)/Ideal.absNorm (Ideal.span {p i})) := by exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (canonicalCubeOuter_norm_le_one p hp hcop hg hc b C Ψ₁ Ψ₂ hΨ₁ hΨ₂ m₁ m₂ f) (mul_nonneg (norm_nonneg _) (norm_nonneg _))) (abs_nonneg _)) (norm_nonneg _)) (primeDensity_nonneg_le_one (fun i=>Ideal.span {p i}) M).1 _ ≤ _ := by simpa only [one_mul] using mul_le_of_le_one_right (show 0≤(1*(‖H₁ (b.rightDivisor∪C)‖*‖H₂ (b.leftDivisor∪C)‖)*|K| *‖paperRadialFourier W 0‖) by positivity) (primeDensity_nonneg_le_one (fun i=>Ideal.span {p i}) M).2 · simp end open ActualEisensteinCubic open FirstPassCubeLabels theorem boundedPrimeSupports_card_positive {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hinj : Function.Injective (fun i=>Ideal.span {p i})) (F : Finset ι) (X : ℝ) (hX : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem actualFirstKernel_complement_eq_pairs (F B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool) (C₁ C₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (V₁ V₂ : ℝ→ℂ) (X₁ X₂ K : ℝ) (hK : 0if Disjoint N Q then canonicalPairMode p hp hcop hg N Q B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K d h.val else 0) := by by_cases hNQ : Disjoint N Q · simp only [hNQ,ite_true] exact (canonicalPairMode_summable p hp hcop hg N Q B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K hK d hd).subtype _ · simp only [hNQ,ite_false] exact summable_zero change (∑'h:{h:O // h∉T},∑N∈F.powerset,∑Q∈F.powerset,if Disjoint N Q then canonicalPairMode p hp hcop hg N Q B v ε₁ ε₂ C₁ C₂ W V₁ V₂ X₁ X₂ K d h.val else 0)=_ rw [Summable.tsum_finsetSum (fun N hN=>summable_sum (fun Q hQ=>hs N Q))] apply Finset.sum_congr rfl intro N hN rw [Summable.tsum_finsetSum (fun Q hQ=>hs N Q)] apply Finset.sum_congr rfl intro Q hQ split_ifs <;> simp end theorem full_uniform_actualFirstKernel_disk_remainder (A : ℕ) : ∃ (s : Finset (ℕ×ℕ)) (C : ℝ),0Ideal.span {p i})) (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) (F B : Finset ι) (v : ι→ℕ) (ε₁ ε₂ : ι→Bool),Disjoint F B → ∀ (C₁ C₂ : Finset ι→ℂ) (W : 𝓢(ℝ,ℂ)) (G₁ G₂ X₁ X₂ K P M₁ M₂ : ℝ), 0≤G₁ → 0≤G₂ → 01) (fun _=>1) X₁ X₂ K d h.val‖≤ (128*U₁)*(128*U₂)*(G₁*G₂*K)* ((C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W)/ ((min 1 slow)^2*(1+P/Real.exp (M₁+M₂))^A)) := by obtain ⟨s,C,hC,hb⟩:=full_uniform_canonicalPairMode_disk_remainder A refine ⟨s,C,hC,?_⟩ intro ι _ p hp _ hinj hcop hg hc F B v ε₁ ε₂ hFB C₁ C₂ W G₁ G₂ X₁ X₂ K P M₁ M₂ hG₁ hG₂ hX₁ hX₂ hK hP hC₁ hC₂ hS₁ hS₂ d hd dsimp only let U₁:=X₁*Real.exp M₁ let U₂:=X₂*Real.exp M₂ let S:=cubeActiveSupport B v ε₁ ε₂ let T:=firstFrequencyDisk (canonicalFirstFrequencyRadius p B v ε₁ ε₂ d X₁ X₂ K P) let slow:=K/(‖eisEmbedding d‖^2*primeProductNorm p S*U₁*U₂) let tail:ℝ:=(C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W)/ ((min 1 slow)^2*(1+P/Real.exp (M₁+M₂))^A) let Q:ℝ:=G₁*G₂*K*tail have hU₁:01) (fun _=>1) X₁ X₂ K d h.val else 0 have hnzero (N R:Finset ι) (hn:C₁ N=0):rem N R=0:=by simp [rem,canonicalPairMode,threeGaussRowFactor,hn] have hrzero (N R:Finset ι) (hr:C₂ R=0):rem N R=0:=by simp [rem,canonicalPairMode,threeGaussRowFactor,hr] have heq : (∑'h:{h:O // h∉T},actualFirstKernel p hp hcop hg F B v ε₁ ε₂ C₁ C₂ W (fun _=>1) (fun _=>1) X₁ X₂ K d h.val)= ∑N∈boundedPrimeSupports p F U₁,∑R∈boundedPrimeSupports p F U₂,rem N R := by rw [actualFirstKernel_complement_eq_pairs p hp hcop hg F B v ε₁ ε₂ C₁ C₂ W (fun _=>1) (fun _=>1) X₁ X₂ K hK d hd T] change (∑N∈F.powerset,∑R∈F.powerset,rem N R)=_ calc _ = ∑N∈boundedPrimeSupports p F U₁,∑R∈F.powerset,rem N R := by symm apply Finset.sum_subset (Finset.filter_subset _ _) intro N hN hn have hz:C₁ N=0:=by by_contra h exact hn (Finset.mem_filter.mpr ⟨hN,columnLog_norm_upper p hp X₁ M₁ hX₁ N (hS₁ N hN h)⟩) simp only [hnzero N _ hz,Finset.sum_const_zero] _ = _ := by apply Finset.sum_congr rfl intro N hN symm apply Finset.sum_subset (Finset.filter_subset _ _) intro R hR hr have hz:C₂ R=0:=by by_contra h exact hr (Finset.mem_filter.mpr ⟨hR,columnLog_norm_upper p hp X₂ M₂ hX₂ R (hS₂ R hR h)⟩) exact hrzero N R hz have hrem (N:Finset ι) (hN:N∈boundedPrimeSupports p F U₁) (R:Finset ι) (hR:R∈boundedPrimeSupports p F U₂):‖rem N R‖≤Q:=by have hNF: N∈F.powerset:=(Finset.mem_filter.mp hN).1 have hRF: R∈F.powerset:=(Finset.mem_filter.mp hR).1 by_cases hn:C₁ N=0 · rw [hnzero N R hn,norm_zero]; exact hQ by_cases hr:C₂ R=0 · rw [hrzero N R hr,norm_zero]; exact hQ by_cases hNR:Disjoint N R · have hNB:=hFB.mono_left (Finset.mem_powerset.mp hNF) have hRB:=hFB.mono_left (Finset.mem_powerset.mp hRF) have hNS:Disjoint N S:=hNB.mono_right (Finset.filter_subset _ _) have hRS:Disjoint R S:=hRB.mono_right (Finset.filter_subset _ _) have hnorm:primeProductNorm p ((N∪R)∪S)=primeProductNorm p N*primeProductNorm p R*primeProductNorm p S:=by rw [primeProductNorm_union p _ _ (Finset.disjoint_union_left.mpr ⟨hNS,hRS⟩),primeProductNorm_union p _ _ hNR] have hprod:=mul_le_mul (Finset.mem_filter.mp hN).2 (Finset.mem_filter.mp hR).2 (primeProductNorm_pos p hp R).le hU₁.le have hscale:slow≤K/(‖eisEmbedding d‖^2*primeProductNorm p ((N∪R)∪S)):=by apply div_le_div_of_nonneg_left hK.le (mul_pos hNd (primeProductNorm_pos p hp _)) rw [hnorm] calc _ ≤ ‖eisEmbedding d‖^2*(U₁*U₂*primeProductNorm p S):=mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hprod (primeProductNorm_pos p hp S).le) hNd.le _ = _ := by ring have hnroot:1≤‖eisEmbedding (∏i∈(N∪R)∪S,p i)‖:=by have hx:=primeProductNorm_ge_one p hp ((N∪R)∪S) change 1≤‖eisEmbedding (∏i∈(N∪R)∪S,p i)‖^2 at hx nlinarith [norm_nonneg (eisEmbedding (∏i∈(N∪R)∪S,p i))] have hpre:(K/‖eisEmbedding (∏i∈(N∪R)∪S,p i)‖)*(‖C₁ N‖*‖C₂ R‖)≤G₁*G₂*K:=by calc _ ≤ K*(G₁*G₂):=mul_le_mul (div_le_self hK.le hnroot) (mul_le_mul (hC₁ N hNF) (hC₂ R hRF) (norm_nonneg _) hG₁) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) hK.le _ = _ := by ring have hfrac:(C*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W)/ ((min 1 (K/(‖eisEmbedding d‖^2*primeProductNorm p ((N∪R)∪S))))^2*(1+P/Real.exp (M₁+M₂))^A)≤tail:=by apply div_le_div_of_nonneg_left (by positivity) (mul_pos (sq_pos_of_pos (lt_min (by norm_num) hslow)) (pow_pos (by linarith) _)) exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (le_min zero_le_one hslow.le) (min_le_min_left 1 hscale) 2) (pow_nonneg (by linarith) _) have hpair:=hb p hp hcop hg hc N R B v ε₁ ε₂ hNR hNB hRB C₁ C₂ W (fun _=>1) (fun _=>1) X₁ X₂ K P M₁ M₂ hX₁ hX₂ hK hP (hS₁ N hNF hn) (hS₂ R hRF hr) d hd simp only [norm_one,one_mul] at hpair dsimp only [rem] rw [if_pos hNR] exact hpair.trans (mul_le_mul hpre hfrac (by positivity) (mul_nonneg (mul_nonneg hG₁ hG₂) hK.le)) · simp only [rem,if_neg hNR,norm_zero];exact hQ rw [heq] calc _ ≤ ∑N∈boundedPrimeSupports p F U₁,∑R∈boundedPrimeSupports p F U₂,‖rem N R‖ := (norm_sum_le _ _).trans (Finset.sum_le_sum (fun N hN=>norm_sum_le _ _)) _ ≤ ∑N∈boundedPrimeSupports p F U₁,∑R∈boundedPrimeSupports p F U₂,Q:= Finset.sum_le_sum (fun N hN=>Finset.sum_le_sum (fun R hR=>hrem N hN R hR)) _ = ((boundedPrimeSupports p F U₁).card:ℝ)*((boundedPrimeSupports p F U₂).card:ℝ)*Q:=by simp;ring _ ≤ (128*U₁)*(128*U₂)*Q:=mul_le_mul_of_nonneg_right (mul_le_mul (boundedPrimeSupports_card_positive p hp hinj F U₁ hU₁) (boundedPrimeSupports_card_positive p hp hinj F U₂ hU₂) (Nat.cast_nonneg _) (by positivity)) hQ _ = _ := by dsimp [Q,tail,slow,U₁,U₂,S];ring end FirstPassCubeLabels namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) open EisensteinSchwartzPoisson (paperRadialFourier) section variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (hinj : Function.Injective (fun i=>Ideal.span {p i})) (hc : ∀i,ringChar (O⧸Ideal.span {p i})≠2) include hinj theorem canonicalCubeDualZero_support (pool : Finset ι) (b : CubeCoordinates ι) (C : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (m₁ m₂ f : O) (g₁ g₂ W : 𝓢(ℝ,ℂ)) (ell K M : ℝ) (hell : 0g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W K=0 := by have hz : g₁ (columnLog p ell (b.rightDivisor∪C))=0 := by by_contra h exact hC ((primeProductNorm_mono p hp (Finset.subset_union_right)).trans (columnLog_norm_upper p hp ell M hell _ (hgM _ h))) rw [canonicalCubeDualZero_eq_density p hp hcop hg hinj] split_ifs <;> simp [hz] include hc theorem canonicalCubeDualZero_fixed_bound (pool : Finset ι) (b : CubeCoordinates ι) (C : Finset ι) (Ψ₁ Ψ₂ : O→*ℂ) (hΨ₁ : ∀u,‖Ψ₁ u‖≤1) (hΨ₂ : ∀u,‖Ψ₂ u‖≤1) (m₁ m₂ f : O) (g₁ g₂ W : 𝓢(ℝ,ℂ)) (G₁ G₂ ell K : ℝ) (hG₁ : 0≤G₁) (_hG₂ : 0≤G₂) (hg₁ : ∀t,‖g₁ t‖≤G₁) (hg₂ : ∀t,‖g₂ t‖≤G₂) : ‖canonicalCubeDualZero p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ f (fun S=>g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W K‖≤ if cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit=∅ then G₁*G₂*|K| *‖paperRadialFourier W 0‖ else 0 := by apply (canonicalCubeDualZero_norm_le p hp hcop hg hinj hc pool b C Ψ₁ Ψ₂ hΨ₁ hΨ₂ m₁ m₂ f _ _ W K).trans split_ifs · exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul (hg₁ _) (hg₂ _) (norm_nonneg _) hG₁) (abs_nonneg _)) (norm_nonneg _) · exact le_rfl theorem canonicalCubeZero_common_sum_bound (pool : Finset ι) (b : CubeCoordinates ι) (labels : Finset (Ideal O)) (a : Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂ : O→*ℂ) (hΨ₁ : ∀u,‖Ψ₁ u‖≤1) (hΨ₂ : ∀u,‖Ψ₂ u‖≤1) (m₁ m₂ : O) (g₁ g₂ W : 𝓢(ℝ,ℂ)) (Γ G₁ G₂ ell K M : ℝ) (hΓ : 0≤Γ) (hG₁ : 0≤G₁) (hG₂ : 0≤G₂) (hell : 0g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W K‖≤ if cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit=∅ then (128*(ell*Real.exp M))*(labels.card:ℝ)*(Γ*(G₁*G₂*|K| *‖paperRadialFourier W 0‖)) else 0 := by let z (C:Finset ι) (I:Ideal O):ℂ:=canonicalCubeDualZero p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W K let Q:ℝ:=Γ*(G₁*G₂*|K| *‖paperRadialFourier W 0‖) have hQ:0≤Q:=by dsimp [Q];positivity have hL:0hnot (Finset.mem_filter.mpr ⟨hC,h⟩) apply Finset.sum_eq_zero intro I hI rw [show z C I=0 from canonicalCubeDualZero_support p hp hcop hg hinj pool b C Ψ₁ Ψ₂ m₁ m₂ _ g₁ g₂ W ell K M hell hgM hbnd,mul_zero] change ‖∑C∈(pool\b.support).powerset,∑I∈labels,a C I*z C I‖≤_ rw [heq] by_cases hb : cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit=∅ · rw [if_pos hb] have hpnt (C:Finset ι) (hC:C∈boundedPrimeSupports p (pool\b.support) (ell*Real.exp M)) (I:Ideal O) (hI:I∈labels):‖a C I*z C I‖≤Q:=by rw [norm_mul] have hz:=canonicalCubeDualZero_fixed_bound p hp hcop hg hinj hc pool b C Ψ₁ Ψ₂ hΨ₁ hΨ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator I) g₁ g₂ W G₁ G₂ ell K hG₁ hG₂ hg₁ hg₂ rw [if_pos hb] at hz exact mul_le_mul (ha C (Finset.mem_filter.mp hC).1 I hI) hz (norm_nonneg _) hΓ calc _ ≤ ∑C∈boundedPrimeSupports p (pool\b.support) (ell*Real.exp M),∑I∈labels,‖a C I*z C I‖:= (norm_sum_le _ _).trans (Finset.sum_le_sum (fun C hC=>norm_sum_le _ _)) _ ≤ ∑C∈boundedPrimeSupports p (pool\b.support) (ell*Real.exp M),∑I∈labels,Q:= Finset.sum_le_sum (fun C hC=>Finset.sum_le_sum (fun I hI=>hpnt C hC I hI)) _ = ((boundedPrimeSupports p (pool\b.support) (ell*Real.exp M)).card:ℝ)*(labels.card:ℝ)*Q:=by simp;ring _ ≤ _ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (boundedPrimeSupports_card_positive p hp hinj _ _ hL) (Nat.cast_nonneg _)) hQ · rw [if_neg hb] have hz (C:Finset ι) (I:Ideal O):z C I=0:=by dsimp [z] rw [canonicalCubeDualZero_eq_density p hp hcop hg hinj,if_neg hb] simp only [hz,mul_zero,Finset.sum_const_zero,norm_zero,le_refl] end theorem full_uniform_canonicalFirstZero_bound (ε : ℝ) (hε : 0<ε) : ∃C:ℝ,0Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (_hinj:Function.Injective (fun i=>Ideal.span {p i})) (_hc:∀i,ringChar (O⧸Ideal.span {p i})≠2) (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (labels:Finset (Ideal O)) (a:CubeCoordinates ι→Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (Γ G₁ G₂ ell K M B F:ℝ), 0≤Γ → 0≤G₁ → 0≤G₂ → 0g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W K‖≤ C*B^(1+ε)*(ell*Real.exp M)*F*(Γ*(G₁*G₂*|K| *‖paperRadialFourier W 0‖)) := by obtain ⟨C,hC,hcount⟩:=cube_coordinates_parity_count ε hε refine ⟨C*128*128,by positivity,?_⟩ intro ι _ p hp _ hcop hg hinj hc pool bs labels a Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W Γ G₁ G₂ ell K M B F hΓ hG₁ hG₂ hell hB hF hΨ₁ hΨ₂ hadm hb1 hb2 hI0 hIF ha hg₁ hg₂ hgM let Q:=Γ*(G₁*G₂*|K| *‖paperRadialFourier W 0‖) let good:=fun b:CubeCoordinates ι=>cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit=∅ have hQ:0≤Q:=by dsimp [Q];positivity have hlabel:(labels.card:ℝ)≤128*F:=DescentFiberCost.finite_ideal_count_real labels F hF hI0 hIF have hbcount:((bs.filter good).card:ℝ)≤C*B^(1+ε):=by have h:=hcount p hp hinj (bs.filter good) B 1 hB (by norm_num) (fun b hb=>hadm b (Finset.mem_filter.mp hb).1) (fun b hb=>hb1 b (Finset.mem_filter.mp hb).1) (fun b hb=>hb2 b (Finset.mem_filter.mp hb).1) (fun b hb=>by have he : cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit=∅ := (Finset.mem_filter.mp hb).2 rw [he] simp) simpa only [mul_one] using h calc _ ≤ ∑b∈bs,‖∑D∈(pool\b.support).powerset,∑I∈labels,a b D I* canonicalCubeDualZero p hp hcop hg pool b D Ψ₁ Ψ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W K‖:=norm_sum_le _ _ _ ≤ ∑b∈bs,if good b then (128*(ell*Real.exp M))*(labels.card:ℝ)*Q else 0:=by apply Finset.sum_le_sum intro b hb exact canonicalCubeZero_common_sum_bound p hp hcop hg hinj hc pool b labels (a b) Ψ₁ Ψ₂ hΨ₁ hΨ₂ m₁ m₂ g₁ g₂ W Γ G₁ G₂ ell K M hΓ hG₁ hG₂ hell (ha b hb) hg₁ hg₂ hgM _ = ((bs.filter good).card:ℝ)*((128*(ell*Real.exp M))*(labels.card:ℝ)*Q):=by rw [←Finset.sum_filter];simp _ ≤ (C*B^(1+ε))*((128*(ell*Real.exp M))*(128*F)*Q):=by apply mul_le_mul hbcount _ (by positivity) (by positivity) exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hlabel (by positivity)) hQ _ = _ := by dsimp [Q];ring end open ActualEisensteinCubic open FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] (p : ι→O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) omit [DecidableEq ι] in lemma originalLabelColumn_core_norm_le (B : Finset ι) (ε₁ ε₂ : ι→Bool) (negative : Bool) (Ψ : O→*ℂ) (hΨ : ∀u,‖Ψ u‖≤1) (m c f : O) (H : Finset ι→ℂ) (S : Finset ι) : ‖originalLabelColumn p hg B ε₁ ε₂ negative (multiplicativeCoreColumn p Ψ m H) c f S‖≤‖H S‖ := by have hm (z:O):‖rowCoprimeMask (fun i=>Ideal.span {p i}) S z‖≤1:=by unfold rowCoprimeMask;split_ifs <;> simp have hrow (z:O):‖finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S z‖^4≤1:=by simpa using pow_le_pow_left₀ (norm_nonneg _) (finiteSquarefreeRow_norm_le_one (fun i=>Ideal.span {p i}) hg S z) 4 simp only [originalLabelColumn,multiplicativeCoreColumn,norm_mul,norm_pow] calc _ ≤ 1*‖H S‖*1*1*1 := by exact mul_le_mul (mul_le_mul (mul_le_mul (mul_le_mul_of_nonneg_right ((mul_le_mul (hΨ _) (hm m) (norm_nonneg _) zero_le_one).trans_eq (one_mul 1)) (norm_nonneg _)) (hm _) (norm_nonneg _) (by positivity)) (hrow _) (pow_nonneg (norm_nonneg _) _) (by positivity)) (hrow _) (pow_nonneg (norm_nonneg _) _) (by positivity) _ = _ := by ring omit [DecidableEq ι] in lemma originalLabelColumn_core_test_ne_zero (B : Finset ι) (ε₁ ε₂ : ι→Bool) (negative : Bool) (Ψ : O→*ℂ) (m c f : O) (H : Finset ι→ℂ) (S : Finset ι) (h : originalLabelColumn p hg B ε₁ ε₂ negative (multiplicativeCoreColumn p Ψ m H) c f S≠0) : H S≠0 := by intro hz apply h simp only [originalLabelColumn,multiplicativeCoreColumn,hz,mul_zero,zero_mul] include hp in omit [∀ (i : ι), (span {p i}).IsMaximal] in theorem canonicalFirstFrequencyRadius_eq_global (b : CubeCoordinates ι) (hb : b.Admissible) (C D : Finset ι) (Ksrc K ell : ℝ) (hKsrc : 0b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) (ell/(primeProductNorm p b.rightDivisor*primeProductNorm p C)) (ell/(primeProductNorm p b.leftDivisor*primeProductNorm p C)) Ksrc (Ksrc/K)= globalFirstFrequencyScale p K ell (sourceGlobalBlock b C D) := by have hl:b.swap.leftBit=b.rightBit:=rfl have hr:b.swap.rightBit=b.leftBit:=rfl simp only [canonicalFirstFrequencyRadius,globalFirstFrequencyScale,sourceGlobalBlock, cube_swap_support,cube_swap_sum,hl,hr, cubeActiveSupport_swap,primeSubsetGenerator_norm_eq_productNorm, CubeCoordinates.aLabel_left p b hb,CubeCoordinates.aLabel_right p b hb] change (Ksrc/K)*(primeProductNorm p D*primeProductNorm p (cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit)* (ell/(primeProductNorm p b.rightDivisor*primeProductNorm p C))* (ell/(primeProductNorm p b.leftDivisor*primeProductNorm p C)))/Ksrc = _ have hC:primeProductNorm p C≠0:=(primeProductNorm_pos p hp C).ne' have hL:primeProductNorm p b.leftDivisor≠0:=(primeProductNorm_pos p hp _).ne' have hR:primeProductNorm p b.rightDivisor≠0:=(primeProductNorm_pos p hp _).ne' simp only [primeProductNorm] simp only [primeProductNorm] at hC hL hR field_simp end theorem full_uniform_canonicalSource_kernel_tail (A : ℕ) : ∃(s:Finset (ℕ×ℕ)) (Ctail:ℝ),0Ideal.span {p i})) (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (_hc:∀i,ringChar (O⧸Ideal.span {p i})≠2) (pool:Finset ι) (b:CubeCoordinates ι),b.Admissible → ∀ C D:Finset ι,Disjoint C b.support → ∀(Ψ₁ Ψ₂:O→*ℂ),(∀u,‖Ψ₁ u‖≤1) → (∀u,‖Ψ₂ u‖≤1) → ∀(m₁ m₂ f:O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (G₁ G₂ M₁ M₂ Ksrc K ell:ℝ), 0≤G₁ → 0≤G₂ → 0b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit)*U₁*U₂) let T:=firstFrequencyDisk (globalFirstFrequencyScale p K ell (sourceGlobalBlock b C D)) ‖∑'h:{h:O // h∉T},actualFirstKernel p hp hcop hg (pool\(b.support∪C)) b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (canonicalCubeResidual p hg b C true Ψ₁ m₁ f (fun S=>g₁ (columnLog p ell S))) (canonicalCubeResidual p hg b C false Ψ₂ m₂ f (fun S=>g₂ (columnLog p ell S))) W (fun _=>1) (fun _=>1) 1 1 Ksrc (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) h.val‖≤ (128*U₁)*(128*U₂)*(G₁*G₂*Ksrc)* ((Ctail*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) W)/ ((min 1 slow)^2*(1+(Ksrc/K)/Real.exp (M₁+M₂))^A)) := by obtain ⟨s,Ctail,hCtail,hbound⟩:=full_uniform_actualFirstKernel_disk_remainder A refine ⟨s,Ctail,hCtail,?_⟩ intro ι _ p hp _ hinj hcop hg hc pool b hb C D hCB Ψ₁ Ψ₂ hΨ₁ hΨ₂ m₁ m₂ f g₁ g₂ W G₁ G₂ M₁ M₂ Ksrc K ell hG₁ hG₂ hKsrc hK hell hg₁ hg₂ hM₁ hM₂ dsimp only let X₁:=ell/(primeProductNorm p b.rightDivisor*primeProductNorm p C) let X₂:=ell/(primeProductNorm p b.leftDivisor*primeProductNorm p C) have hX₁:0 (Finset.mem_sdiff.mp hi).2 (Finset.mem_union_left _ hb)) let C₁:=originalLabelColumn p hg b.support b.leftBit b.rightBit true (multiplicativeCoreColumn p Ψ₁ m₁ (fun S=>g₁ (columnLog p X₁ S))) (∏i∈C,p i) f let C₂:=originalLabelColumn p hg b.support b.leftBit b.rightBit false (multiplicativeCoreColumn p Ψ₂ m₂ (fun S=>g₂ (columnLog p X₂ S))) (∏i∈C,p i) f have hcoef₁ (N:Finset ι) (hN:N∈(pool\(b.support∪C)).powerset):‖C₁ N‖≤G₁:= (originalLabelColumn_core_norm_le p hg b.support b.leftBit b.rightBit true Ψ₁ hΨ₁ m₁ _ f _ N).trans (hg₁ _) have hcoef₂ (N:Finset ι) (hN:N∈(pool\(b.support∪C)).powerset):‖C₂ N‖≤G₂:= (originalLabelColumn_core_norm_le p hg b.support b.leftBit b.rightBit false Ψ₂ hΨ₂ m₂ _ f _ N).trans (hg₂ _) have hs₁ (N:Finset ι) (hN:N∈(pool\(b.support∪C)).powerset) (hn:C₁ N≠0):columnLog p X₁ N≤M₁:= hM₁ _ (originalLabelColumn_core_test_ne_zero p hg b.support b.leftBit b.rightBit true Ψ₁ m₁ _ f _ N hn) have hs₂ (N:Finset ι) (hN:N∈(pool\(b.support∪C)).powerset) (hn:C₂ N≠0):columnLog p X₂ N≤M₂:= hM₂ _ (originalLabelColumn_core_test_ne_zero p hg b.support b.leftBit b.rightBit false Ψ₂ m₂ _ f _ N hn) have h:=hbound p hp hinj hcop hg hc (pool\(b.support∪C)) b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit hFB C₁ C₂ W G₁ G₂ X₁ X₂ Ksrc (Ksrc/K) M₁ M₂ hG₁ hG₂ hX₁ hX₂ hKsrc (div_pos hKsrc hK).le hcoef₁ hcoef₂ hs₁ hs₂ (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) (primeSubsetGenerator_ne_zero _ _) rw [canonicalFirstFrequencyRadius_eq_global p hp b hb C D Ksrc K ell hKsrc hK] at h simp only [primeSubsetGenerator_norm_eq_productNorm] at h have heq := fun h:O=>canonical_log_kernel p hp hcop hg pool b hb C hCB Ψ₁ Ψ₂ m₁ m₂ f (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) h g₁ g₂ W Ksrc ell hell simp_rw [heq] exact h end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.CanonicalDensity namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace InitialMeanSquare open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve theorem outsideIdealsUpTo_mono (S : Finset (Ideal O)) {D E : ℕ} (hDE : D ≤ E) : outsideIdealsUpTo S D ⊆ outsideIdealsUpTo S E := by intro I hI obtain ⟨hpos,hn,hS⟩ := mem_outsideIdealsUpTo.mp hI exact mem_outsideIdealsUpTo.mpr ⟨hpos,hn.trans hDE,hS⟩ theorem outside_row_cutoff_stable (S : Finset (Ideal O)) (hbad : fixedBadPrimes ⊆ S) {D E : ℕ} (hDE : D ≤ E) {q : ℕ} (χ : DirichletCharacter ℂ q) (W : ℝ → ℂ) (b Z : ℝ) (hZ : 0 < Z) (hW : ∀ t, W t ≠ 0 → t ≤ b) (hD : b*Z ≤ D) (z : O) : idealRowSum (outsideIdealsUpTo S D) (outsideIdealsUpTo_ne_bot S D) (outside_good S D hbad) χ (fun n => W (n/Z)) z = idealRowSum (outsideIdealsUpTo S E) (outsideIdealsUpTo_ne_bot S E) (outside_good S E hbad) χ (fun n => W (n/Z)) z := by have hsub := outsideIdealsUpTo_mono S hDE unfold idealRowSum calc _ = ∑ I ∈ outsideIdealsUpTo S D, ShortDraftHeckeBridge.baseChangeWeight χ I * W ((Ideal.absNorm I : ℝ)/Z) * idealSexticRow (outsideIdealsUpTo S E) (outsideIdealsUpTo_ne_bot S E) (outside_good S E hbad) I z := by apply Finset.sum_congr rfl intro I hI rw [idealSexticRow_ambient (outsideIdealsUpTo S D) (outsideIdealsUpTo S E) (outsideIdealsUpTo_ne_bot S D) (outsideIdealsUpTo_ne_bot S E) (outside_good S D hbad) (outside_good S E hbad) I hI (hsub hI) z] _ = _ := by apply Finset.sum_subset hsub intro I hIE hID have hw : W ((Ideal.absNorm I : ℝ)/Z) = 0 := by by_contra hn have hbound : (Ideal.absNorm I : ℝ) ≤ D := ((div_le_iff₀ hZ).mp (hW _ hn)).trans hD have hnat : Ideal.absNorm I ≤ D := by exact_mod_cast hbound obtain ⟨hpos,_,hS⟩ := mem_outsideIdealsUpTo.mp hIE exact hID (mem_outsideIdealsUpTo.mpr ⟨hpos,hnat,hS⟩) rw [hw,mul_zero,zero_mul] end InitialMeanSquare open scoped BigOperators Classical SchwartzMap namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels variable {ι:Type*} [DecidableEq ι] (p:ι→O) (hp:∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) def canonicalCubeDualFinite (pool:Finset ι) (b:CubeCoordinates ι) (C:Finset ι) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂ f:O) (H₁ H₂:Finset ι→ℂ) (W:𝓢(ℝ,ℂ)) (K:ℝ) (T:Finset ι→Finset O):ℂ:= canonicalCubeOuter p hp hcop hg b C Ψ₁ Ψ₂ m₁ m₂ f* ∑D∈(C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit).powerset, (UniqueFactorizationMonoid.moebius (∏i∈D,Ideal.span {p i}):ℂ)/(primeProductNorm p D:ℂ)* ∑h∈(T D).erase 0,actualFirstKernel p hp hcop hg (pool\(b.support∪C)) b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (canonicalCubeResidual p hg b C true Ψ₁ m₁ f H₁) (canonicalCubeResidual p hg b C false Ψ₂ m₂ f H₂) W (fun _=>1) (fun _=>1) 1 1 K (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) h def canonicalCubeDualTail (pool:Finset ι) (b:CubeCoordinates ι) (C:Finset ι) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂ f:O) (H₁ H₂:Finset ι→ℂ) (W:𝓢(ℝ,ℂ)) (K:ℝ) (T:Finset ι→Finset O):ℂ:= canonicalCubeOuter p hp hcop hg b C Ψ₁ Ψ₂ m₁ m₂ f* ∑D∈(C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit).powerset, (UniqueFactorizationMonoid.moebius (∏i∈D,Ideal.span {p i}):ℂ)/(primeProductNorm p D:ℂ)* ∑'h:{h:O // h∉T D},actualFirstKernel p hp hcop hg (pool\(b.support∪C)) b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (canonicalCubeResidual p hg b C true Ψ₁ m₁ f H₁) (canonicalCubeResidual p hg b C false Ψ₂ m₂ f H₂) W (fun _=>1) (fun _=>1) 1 1 K (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) h.val theorem canonicalCubeBeforePoisson_split (hinj:Function.Injective (fun i=>Ideal.span {p i})) (hc:∀i,ringChar (O⧸Ideal.span {p i})≠2) (pool:Finset ι) (b:CubeCoordinates ι) (C:Finset ι) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂ f:O) (H₁ H₂:Finset ι→ℂ) (W:𝓢(ℝ,ℂ)) (K:ℝ) (hK:0g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W K T)= ∑D∈(C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit).powerset, rawCanonicalBlock p hp hcop hg pool (sourceGlobalBlock b C D) (labels.product ((T D).erase 0)) (fun x=>a x.1*canonicalCubeOuter p hp hcop hg b C Ψ₁ Ψ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator x.1)) Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W K ell := by simp only [canonicalCubeDualFinite,rawCanonicalBlock,sourceGlobalBlock, CubeCoordinates.swap_swap,Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro D hD rw [Finset.product_eq_sprod,Finset.sum_product] apply Finset.sum_congr rfl intro I hI apply Finset.sum_congr rfl intro h hh ring end section open ActualEisensteinCubic open FirstPassCubeLabels variable {ι:Type*} [DecidableEq ι] def canonicalSourceBlocks (pool:Finset ι) (bs:Finset (CubeCoordinates ι)):Finset (GlobalCubeBlock ι):= bs.biUnion (fun b=>(pool\b.support).powerset.biUnion (fun C=> (C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit).powerset.image (sourceGlobalBlock b C))) theorem canonicalSourceBlocks_mem (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (q:GlobalCubeBlock ι): q∈canonicalSourceBlocks pool bs ↔ ∃b∈bs,∃C∈(pool\b.support).powerset, ∃D∈(C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit).powerset, sourceGlobalBlock b C D=q := by simp only [canonicalSourceBlocks,Finset.mem_biUnion,Finset.mem_image] theorem sum_canonicalSourceBlocks {M:Type*} [AddCommMonoid M] (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (f:GlobalCubeBlock ι→M): (∑q∈canonicalSourceBlocks pool bs,f q)= ∑b∈bs,∑C∈(pool\b.support).powerset, ∑D∈(C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit).powerset, f (sourceGlobalBlock b C D) := by unfold canonicalSourceBlocks rw [Finset.sum_biUnion] · apply Finset.sum_congr rfl intro b hb rw [Finset.sum_biUnion] · apply Finset.sum_congr rfl intro C hC rw [Finset.sum_image] intro D hD E hE he exact congrArg GlobalCubeBlock.firstDivisor he · intro C hC D hD hne apply Finset.disjoint_left.mpr intro q hq hq' obtain ⟨E,hE,he⟩:=Finset.mem_image.mp hq obtain ⟨F,hF,hf⟩:=Finset.mem_image.mp hq' exact hne (congrArg GlobalCubeBlock.common (he.trans hf.symm)) · intro b hb c hc hne apply Finset.disjoint_left.mpr intro q hq hq' obtain ⟨C,hC,E,hE,he⟩:=by simpa only [Finset.mem_biUnion,Finset.mem_image] using hq obtain ⟨D,hD,F,hF,hf⟩:=by simpa only [Finset.mem_biUnion,Finset.mem_image] using hq' have hswap:=congrArg (fun q:GlobalCubeBlock ι=>q.cube.swap) (he.trans hf.symm) exact hne (by simpa only [sourceGlobalBlock,CubeCoordinates.swap_swap] using hswap) theorem canonicalSourceBlocks_admissible (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (hadm:∀b∈bs,b.Admissible) (q:GlobalCubeBlock ι) (hq:q∈canonicalSourceBlocks pool bs): GlobalCubeAdmissible q := by obtain ⟨b,hb,C,hC,D,hD,rfl⟩:=(canonicalSourceBlocks_mem pool bs q).mp hq have ha:=hadm b hb constructor · constructor · change b.rightDivisor⊆b.swap.support rw [cube_swap_support] exact ha.2 · change b.leftDivisor⊆b.swap.support rw [cube_swap_support] exact ha.1 constructor · change Disjoint C b.swap.support rw [cube_swap_support] exact Finset.disjoint_left.mpr (fun i hi hbi=> (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp hC) hi)).2 hbi) · change D⊆C∪b.swap.support rw [cube_swap_support] exact (Finset.mem_powerset.mp hD).trans (Finset.union_subset_union_right (Finset.filter_subset _ _)) theorem canonicalSourceBlocks_cube_norms (p:ι→O) (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (B:ℝ) (hleft:∀b∈bs,‖ConcreteTraceCRT.eisEmbedding (primeProduct p b.support b.leftExponent)‖^2≤B) (hright:∀b∈bs,‖ConcreteTraceCRT.eisEmbedding (primeProduct p b.support b.rightExponent)‖^2≤B) (q:GlobalCubeBlock ι) (hq:q∈canonicalSourceBlocks pool bs): ‖ConcreteTraceCRT.eisEmbedding (primeProduct p q.cube.support q.cube.leftExponent)‖^2≤B ∧ ‖ConcreteTraceCRT.eisEmbedding (primeProduct p q.cube.support q.cube.rightExponent)‖^2≤B := by obtain ⟨b,hb,C,hC,D,hD,rfl⟩:=(canonicalSourceBlocks_mem pool bs q).mp hq change ‖ConcreteTraceCRT.eisEmbedding (primeProduct p b.swap.support b.rightExponent)‖^2≤B ∧ ‖ConcreteTraceCRT.eisEmbedding (primeProduct p b.swap.support b.leftExponent)‖^2≤B rw [cube_swap_support] exact ⟨hright b hb,hleft b hb⟩ end section open ActualEisensteinCubic open FirstPassCubeLabels variable {ι:Type*} [DecidableEq ι] (p:ι→O) (hp:∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) def canonicalSourceCutoff (K ell:ℝ) (b:CubeCoordinates ι) (C D:Finset ι):Finset O:= firstFrequencyDisk (globalFirstFrequencyScale p K ell (sourceGlobalBlock b C D)) omit [∀ (i : ι), (span {p i}).IsMaximal] in lemma canonicalSourceCutoff_zero (K ell:ℝ) (hK:0≤K) (b:CubeCoordinates ι) (C D:Finset ι): (0:O)∈canonicalSourceCutoff p K ell b C D := by apply firstFrequencyDisk_zero unfold globalFirstFrequencyScale simp only [primeProductNorm] positivity def canonicalSourceTotal (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (labels:Finset (Ideal O)) (a:CubeCoordinates ι→Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (Ksrc ell:ℝ):ℂ:= ∑b∈bs,∑C∈(pool\b.support).powerset,∑I∈labels,a b C I* canonicalCubeBeforePoisson p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W Ksrc def canonicalSourceZero (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (labels:Finset (Ideal O)) (a:CubeCoordinates ι→Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (Ksrc ell:ℝ):ℂ:= ∑b∈bs,∑C∈(pool\b.support).powerset,∑I∈labels,a b C I* canonicalCubeDualZero p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W Ksrc def canonicalSourceFinite (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (labels:Finset (Ideal O)) (a:CubeCoordinates ι→Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (Ksrc K ell:ℝ):ℂ:= ∑b∈bs,∑C∈(pool\b.support).powerset,∑I∈labels,a b C I* canonicalCubeDualFinite p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W Ksrc (canonicalSourceCutoff p K ell b C) def canonicalSourceTail (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (labels:Finset (Ideal O)) (a:CubeCoordinates ι→Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (Ksrc K ell:ℝ):ℂ:= ∑b∈bs,∑C∈(pool\b.support).powerset,∑I∈labels,a b C I* canonicalCubeDualTail p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W Ksrc (canonicalSourceCutoff p K ell b C) def canonicalBlockFrequencies (K ell:ℝ) (labels:Finset (Ideal O)) (q:GlobalCubeBlock ι):Finset (Ideal O×O):= labels.product ((firstFrequencyDisk (globalFirstFrequencyScale p K ell q)).erase 0) def canonicalBlockCoefficient (a:CubeCoordinates ι→Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (q:GlobalCubeBlock ι) (x:Ideal O×O):ℂ:= a q.cube.swap q.common x.1*canonicalCubeOuter p hp hcop hg q.cube.swap q.common Ψ₁ Ψ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator x.1) theorem canonicalSourceFinite_eq_raw (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (labels:Finset (Ideal O)) (a:CubeCoordinates ι→Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (Ksrc K ell:ℝ): canonicalSourceFinite p hp hcop hg pool bs labels a Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W Ksrc K ell= ∑q∈canonicalSourceBlocks pool bs,rawCanonicalBlock p hp hcop hg pool q (canonicalBlockFrequencies p K ell labels q) (canonicalBlockCoefficient p hp hcop hg a Ψ₁ Ψ₂ m₁ m₂ q) Ψ₁ Ψ₂ m₁ m₂ g₁ g₂ W Ksrc ell := by rw [sum_canonicalSourceBlocks] unfold canonicalSourceFinite apply Finset.sum_congr rfl intro b hb apply Finset.sum_congr rfl intro C hC rw [canonicalCubeDualFinite_eq_raw_blocks] apply Finset.sum_congr rfl intro D hD simp only [canonicalBlockFrequencies,canonicalSourceCutoff, sourceGlobalBlock] rfl theorem canonicalSourceTotal_split (hinj:Function.Injective (fun i=>Ideal.span {p i})) (hc:∀i,ringChar (O⧸Ideal.span {p i})≠2) (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (labels:Finset (Ideal O)) (a:CubeCoordinates ι→Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (Ksrc K ell:ℝ) (hKsrc:0g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W Ksrc hKsrc (canonicalSourceCutoff p K ell b C) (fun D hD=>canonicalSourceCutoff_zero p K ell hK b C D) simp_rw [hsplit] simp only [mul_add,Finset.sum_add_distrib] theorem canonicalBlockCoefficient_bound (hc:∀i,ringChar (O⧸Ideal.span {p i})≠2) (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (labels:Finset (Ideal O)) (a:CubeCoordinates ι→Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (Γ K ell:ℝ) (hΓ:0≤Γ) (hΨ₁:∀u,‖Ψ₁ u‖≤1) (hΨ₂:∀u,‖Ψ₂ u‖≤1) (ha:∀b∈bs,∀C∈(pool\b.support).powerset,∀I∈labels,‖a b C I‖≤Γ) (q:GlobalCubeBlock ι) (hq:q∈canonicalSourceBlocks pool bs) (x:Ideal O×O) (hx:x∈canonicalBlockFrequencies p K ell labels q): ‖canonicalBlockCoefficient p hp hcop hg a Ψ₁ Ψ₂ m₁ m₂ q x‖≤Γ := by have hI:x.1∈labels:=(Finset.mem_product.mp hx).1 obtain ⟨b,hb,C,hC,D,hD,rfl⟩:=(canonicalSourceBlocks_mem pool bs q).mp hq simp only [canonicalBlockCoefficient,sourceGlobalBlock,CubeCoordinates.swap_swap,norm_mul] exact (mul_le_mul (ha b hb C hC x.1 hI) (canonicalCubeOuter_norm_le_one p hp hcop hg hc b C Ψ₁ Ψ₂ hΨ₁ hΨ₂ m₁ m₂ _) (norm_nonneg _) hΓ).trans_eq (mul_one Γ) end open ActualEisensteinCubic open FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) theorem canonicalSource_twoPassage_quantitative (W g₁ g₂ V₁ V₂ : 𝓢(ℝ,ℂ)) (M₁ M₂ N₁ N₂ : ℝ) (hM₁ : 0≤M₁) (hM₂ : 0≤M₂) (hN₁ : 0≤N₁) (hN₂ : 0≤N₂) (hg₁ : ∀t,g₁ t≠0→|t|≤M₁) (hg₂ : ∀t,g₂ t≠0→|t|≤M₂) (hV₁ : ∀t,V₁ t≠0→|t|≤N₁) (hV₂ : ∀t,V₂ t≠0→|t|≤N₂) (hWin₁ : ∀t,g₁ t≠0→V₁ t=1) (hWin₂ : ∀t,g₂ t≠0→V₂ t=1) (ε deltaLoss : ℝ) (hε : 0<ε) (hδ : 0Ideal.span {p i})) (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (_hc:∀i,ringChar (O⧸Ideal.span {p i})≠2) (_hpr:∀i,lambda^2∣p i-1) (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (labels:Finset (Ideal O)) (a:CubeCoordinates ι→Finset ι→Ideal O→ℂ) (Ψ₁ Ψ₂:O→*ℂ) (m₁ m₂:O) (Γ Ksrc K ell B F H U:ℝ), 0≤Γ → 0Γ) Ψ₁ Ψ₂ m₁ m₂ Γ Ksrc K ell B F H U hΓ hKsrc hK hell hB hF hH hU hMU₁ hMU₂ hΨ₁ hΨ₂ · exact fun q hq=>⟨hΓ,le_rfl⟩ · exact fun q hq x hx=>canonicalBlockCoefficient_bound p hp hcop hg hc pool bs labels a Ψ₁ Ψ₂ m₁ m₂ Γ K ell hΓ hΨ₁ hΨ₂ ha q hq x hx · exact canonicalSourceBlocks_admissible pool bs hadm · exact fun q hq=>(canonicalSourceBlocks_cube_norms p pool bs B hleft hright q hq).1 · exact fun q hq=>(canonicalSourceBlocks_cube_norms p pool bs B hleft hright q hq).2 · intro q hq x hx exact hsf x.1 (Finset.mem_product.mp hx).1 · intro q hq x hx exact (Finset.mem_erase.mp (Finset.mem_product.mp hx).2).1 · intro q hq x hx exact hf x.1 (Finset.mem_product.mp hx).1 · intro q hq x hx exact (mem_firstFrequencyDisk _ _).mp (Finset.mem_erase.mp (Finset.mem_product.mp hx).2).2 end SecondPassArithmetic open MeasureTheory open scoped BigOperators Classical namespace InitialMeanSquare open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (firstLogDensity) theorem initial_subunit_row_le_label (Z X lengthScale K R κ : ℝ) (hZ : 1 ≤ Z) (hX : X ≤ 1) (hL : 0 ≤ lengthScale) (hK : 0 ≤ K) (hR : 1 ≤ R) (hκ : 0 ≤ κ) (hinv : K*R ≤ X*lengthScale*Z^(-κ)) : K ≤ lengthScale := by have hpow : Z^(-κ) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hZ (by linarith) have hpow0 : 0 ≤ Z^(-κ) := Real.rpow_nonneg (zero_le_one.trans hZ) _ calc K ≤ K*R := le_mul_of_one_le_right hK hR _ ≤ X*lengthScale*Z^(-κ) := hinv _ ≤ 1*lengthScale*Z^(-κ) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hX hL) hpow0 _ ≤ lengthScale := by simpa only [one_mul,mul_one] using mul_le_mul_of_nonneg_left hpow hL theorem initial_subunit_density_bound {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hc : ∀ i,ringChar (ActualEisensteinCubic.O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (Ψ₁ Ψ₂ : ActualEisensteinCubic.O →* ℂ) (hΨ₁ : ∀ a,‖Ψ₁ a‖ ≤ 1) (hΨ₂ : ∀ a,‖Ψ₂ a‖ ≤ 1) (m : ActualEisensteinCubic.O) (T : Finset (Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O)) (V₁ V₂ : ℝ → ℂ) (X lengthScale K A Vmax : ℝ) (J : ℕ) (hX : 0 < X) (hL : 1 ≤ lengthScale) (hK : 1 ≤ K) (hKL : K ≤ lengthScale) (hA : 0 ≤ A) (hVmax : 0 ≤ Vmax) (hV₁ : ∀ t,‖V₁ t‖ ≤ Vmax) (hV₂ : ∀ t,‖V₂ t‖ ≤ Vmax) (hs₁ : ∀ t,V₁ t ≠ 0 → |t| ≤ A) (hs₂ : ∀ t,V₂ t ≠ 0 → |t| ≤ A) (hT : ∀ z ∈ T,z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ lengthScale ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ K) : densityChildEnergy p hp hcop hg pool Ψ₁ Ψ₂ m T V₁ V₂ X X (2*J) ≤ (initialElementaryConstant A Vmax*(∫ t : ℝ,firstLogDensity 0 t)^3)*(X*lengthScale)^2 := by let C := initialElementaryConstant A Vmax*(∫ t : ℝ,firstLogDensity 0 t)^3 have hI : 0 ≤ ∫ t : ℝ,firstLogDensity 0 t := integral_nonneg (fun t => FirstPassCubeLabels.firstLogDensity_nonneg 0 t) have hC : 0 ≤ C := mul_nonneg (initialElementaryConstant_nonneg A Vmax) (pow_nonneg hI _) have hd := childDensity_elementary_all_scales p hp hcop hg hc hinj pool Ψ₁ Ψ₂ hΨ₁ hΨ₂ m T V₁ V₂ X lengthScale K A Vmax J hX hL hK hA hVmax hV₁ hV₂ hs₁ hs₂ hT change _/(X*lengthScale) ≤ C*K*X at hd have hraw := (div_le_iff₀ (mul_pos hX (zero_lt_one.trans_le hL))).mp hd calc _ ≤ (C*K*X)*(X*lengthScale) := hraw _ ≤ (C*lengthScale*X)*(X*lengthScale) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hKL hC) hX.le) (mul_nonneg hX.le (zero_le_one.trans hL)) _ = _ := by dsimp only [C]; ring lemma initialErrorFrequencyBound_ge_one (a b Z H : ℝ) (hZ : 0 < Z) (hH : 0 < H) : 1 ≤ initialErrorFrequencyBound a b Z H := by have ht := initialTailHeight_pos Z H (initialErrorWindow a b) hZ hH have hv : 0 ≤ initialTailHeight Z H (initialErrorWindow a b)* (1+Z*Real.exp (initialErrorWindow a b))^3/H := by positivity unfold initialErrorFrequencyBound nlinarith [sq_nonneg (initialTailHeight Z H (initialErrorWindow a b)* (1+Z*Real.exp (initialErrorWindow a b))^3/H)] lemma initialErrorRowBound_ge_one (a b Z H : ℝ) (hZ : 1 ≤ Z) (hH : 1 ≤ H) : 1 ≤ initialErrorRowBound a b Z H := by have hM : 0 ≤ initialErrorWindow a b := by unfold initialErrorWindow; positivity exact one_le_mul_of_one_le_of_one_le (one_le_mul_of_one_le_of_one_le hZ (Real.one_le_exp hM)) (initialErrorFrequencyBound_ge_one a b Z H (zero_lt_one.trans_le hZ) (zero_lt_one.trans_le hH)) end InitialMeanSquare open MeasureTheory open scoped BigOperators Classical ContDiff namespace InitialMeanSquare open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm) abbrev OutsidePrimeIndex (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) := primePool (outsideSquarefreeIdeals S D) def outsidePrime (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) : OutsidePrimeIndex S D → ActualEisensteinCubic.O := poolPrimary (outsideSquarefreeIdeals S D) lemma outsidePrime_ne_zero (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (D : ℕ) : ∀ i,outsidePrime S D i ≠ 0 := poolPrimary_ne_zero _ (outsideSquarefree_admissible S D hbad) lemma outsidePrime_maximal (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (D : ℕ) : ∀ i,(Ideal.span {outsidePrime S D i}).IsMaximal := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal intro i rw [show Ideal.span {outsidePrime S D i}=i.val from poolPrimary_span _ (outsideSquarefree_admissible S D hbad) i] infer_instance lemma outsidePrime_coprime (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (D : ℕ) : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {outsidePrime S D i})) := poolPrimary_coprime _ (outsideSquarefree_admissible S D hbad) lemma outsidePrime_good (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (D : ℕ) : ∀ i,lambda ∉ Ideal.span {outsidePrime S D i} := poolPrimary_good _ (outsideSquarefree_admissible S D hbad) lemma outsidePrime_odd (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (D : ℕ) : ∀ i,ringChar (ActualEisensteinCubic.O ⧸ Ideal.span {outsidePrime S D i}) ≠ 2 := poolPrimary_odd _ (outsideSquarefree_admissible S D hbad) lemma outsidePrime_injective (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (D : ℕ) : Function.Injective (fun i => Ideal.span {outsidePrime S D i}) := by intro i j hij apply Subtype.ext simpa only [outsidePrime,poolPrimary_span _ (outsideSquarefree_admissible S D hbad)] using hij lemma outsidePrime_primary (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (D : ℕ) : ∀ i,lambda^2 ∣ outsidePrime S D i-1 := by intro i exact (CompletedGauss.primaryPrime_spec i.val (outsidePrime_ne_zero S hbad D i)).2.2.2 def initialExcludedNorm (S : Finset (Ideal ActualEisensteinCubic.O)) : ℝ := max 1 (∏ P ∈ S,(Ideal.absNorm P : ℝ)) lemma initialExcludedNorm_ge_one (S : Finset (Ideal ActualEisensteinCubic.O)) : 1 ≤ initialExcludedNorm S := le_max_left _ _ def outsideCanonicalDensity {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (D : ℕ) (ray : SecondRayIndex) (R : Finset (OutsidePrimeIndex S D)) (T : Finset (Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O)) (V₁ V₂ : ℝ → ℂ) (X : ℝ) (J : ℕ) : ℝ := letI := outsidePrime_maximal S hbad D densityChildEnergy (outsidePrime S D) (outsidePrime_ne_zero S hbad D) (outsidePrime_coprime S hbad D) (outsidePrime_good S hbad D) Finset.univ (secondRayMinus (conjugateMonoid (normCharacter χ)) ray) (secondRayPlus (conjugateMonoid (normCharacter χ)) ray) (primeSubsetGenerator (fun i => Ideal.span {outsidePrime S D i}) R) T V₁ V₂ X X (2*J) end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.RetainedDensity namespace OAI noncomputable section namespace InitialMeanSquare open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped BigOperators Classical open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration open FirstPassCubeLabels (primeProductNorm) lemma initialLogLabel_ge_one (j : SecondLogIndex) : 1 ≤ initialLogLabel j := one_le_mul_of_one_le_of_one_le (one_le_mul_of_one_le_of_one_le (normLogScale_ge_one _) (normLogScale_ge_one _)) (Real.one_le_exp (by norm_num)) lemma initialLogColumn_pos (Z B : ℝ) (j : SecondLogIndex) (hZ : 0 < Z) (hB : 0 < B) : 0 < initialLogColumn Z B j := div_pos hZ (mul_pos (mul_pos (normLogScale_pos _) (normLogScale_pos _)) hB) lemma initialLogColumn_le (Z B : ℝ) (j : SecondLogIndex) (hZ : 0 ≤ Z) (hB : 1 ≤ B) : initialLogColumn Z B j ≤ Z := div_le_self hZ (one_le_mul_of_one_le_of_one_le (one_le_mul_of_one_le_of_one_le (normLogScale_ge_one _) (normLogScale_ge_one _)) hB) lemma initialLogLabel_cap (U Kmax : ℝ) (hU : 1 ≤ U) (j : SecondLogIndex) (hj : j ∈ secondLogBinBox U Kmax) : initialLogLabel j ≤ U^2*Real.exp 2 := by have hj' : j.1 < normLogBin U+1 ∧ j.2.1 < normLogBin U+1 ∧ j.2.2 < normLogBin Kmax+1 := by simpa only [secondLogBinBox,Finset.mem_product,Finset.mem_range] using hj have he : secondLogE j ≤ U := by apply le_trans _ (normLogBin_scale_bounds U hU).1 unfold secondLogE normLogScale apply Real.exp_le_exp.mpr exact_mod_cast Nat.le_of_lt_succ hj'.1 have hv : secondLogV j ≤ U := by apply le_trans _ (normLogBin_scale_bounds U hU).1 unfold secondLogV normLogScale apply Real.exp_le_exp.mpr exact_mod_cast Nat.le_of_lt_succ hj'.2.1 unfold initialLogLabel simpa only [pow_two] using mul_le_mul_of_nonneg_right (mul_le_mul he hv (normLogScale_pos _).le (zero_le_one.trans hU)) (Real.exp_pos 2).le theorem initial_radial_invariant (Z B c σ θ deltaLoss κ : ℝ) (j : SecondLogIndex) (hZ : 1 ≤ Z) (hB : 0 < B) (hc : 0 ≤ c) (hcZ : c ≤ Z^deltaLoss) (hmargin : deltaLoss+θ ≤ σ-κ) (hrad : initialRadial Z (Z^(1+σ)) B j ≤ Z^θ) : (secondLogK j*Real.exp 2)*(c*B) ≤ initialLogColumn Z B j*initialLogLabel j*Z^(-κ) := by have hZ0 := zero_lt_one.trans_le hZ have hH : 0 < Z^(1+σ) := Real.rpow_pos_of_pos hZ0 _ have hm : 0 < initialLogColumn Z B j*initialLogLabel j := by rw [initial_log_mass Z B hB.ne' j] positivity have he : Z/Z^(1+σ)=Z^(-σ) := by rw [show -σ=(1 : ℝ)-(1+σ) by ring,Real.rpow_sub hZ0,Real.rpow_one] have hid : (secondLogK j*Real.exp 2)*(c*B)/(initialLogColumn Z B j*initialLogLabel j)= c*(Z/(Z^(1+σ)))*(Z^(1+σ)*secondLogK j*B^2/Z^2) := by rw [initial_log_mass Z B hB.ne' j] have hE := (Real.exp_pos (2 : ℝ)).ne' have hz := hZ0.ne' have hh := hH.ne' field_simp rw [mul_comm (initialLogColumn Z B j*initialLogLabel j)] apply (div_le_iff₀ hm).mp rw [hid,he] calc c*Z^(-σ)*(Z^(1+σ)*secondLogK j*B^2/Z^2) ≤ c*Z^(-σ)*Z^θ := mul_le_mul_of_nonneg_left hrad (mul_nonneg hc (Real.rpow_nonneg hZ0.le _)) _ ≤ Z^deltaLoss*Z^(-σ)*Z^θ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hcZ (Real.rpow_nonneg hZ0.le _)) (Real.rpow_nonneg hZ0.le _) _ = Z^(deltaLoss-σ+θ) := by rw [←Real.rpow_add hZ0,←Real.rpow_add hZ0]; congr 1 _ ≤ Z^(-κ) := Real.rpow_le_rpow_of_exponent_le hZ (by linarith) theorem initial_large_threshold (a b c deltaLoss : ℝ) (hc : 1 ≤ c) (hδ : 0 < deltaLoss) : ∃ Z0 : ℝ,1 ≤ Z0 ∧ ∀ Z : ℝ,Z0 ≤ Z → Real.exp 2 ≤ Z ∧ c*Real.exp (initialErrorWindow a b) ≤ Z ∧ initialPolynomialCap a b*Real.exp 2 ≤ Z ∧ (Real.exp (initialErrorWindow a b))^2*Real.exp 2 ≤ Z ∧ c ≤ Z^deltaLoss := by let M := initialErrorWindow a b let Q := initialPolynomialCap a b let Z0 := 1+Real.exp 2+c*Real.exp M+Q*Real.exp 2+(Real.exp M)^2*Real.exp 2+c^(1/deltaLoss) have hc0 := (zero_lt_one.trans_le hc).le have hQ := initialPolynomialCap_ge_one a b have hQ0 : 0 ≤ Q := zero_le_one.trans hQ have he2 := Real.exp_pos (2 : ℝ) have heM := Real.exp_pos M have hr : 0 ≤ c^(1/deltaLoss) := Real.rpow_nonneg hc0 _ have hp : 0 ≤ (Real.exp M)^2*Real.exp 2 := by positivity have hcp : 0 ≤ c*Real.exp M := by positivity have hqp : 0 ≤ Q*Real.exp 2 := by positivity have hZ0 : 1 ≤ Z0 := by dsimp [Z0]; linarith refine ⟨Z0,hZ0,?_⟩ intro Z hZ have hzroot : c^(1/deltaLoss) ≤ Z := by dsimp [Z0] at hZ; linarith have hroot : (c^(1/deltaLoss))^deltaLoss=c := by rw [←Real.rpow_mul hc0] have hd : (1/deltaLoss)*deltaLoss=1 := by field_simp rw [hd,Real.rpow_one] refine ⟨?_,?_,?_,?_,?_⟩ · dsimp [Z0] at hZ; linarith · change c*Real.exp M ≤ Z; dsimp [Z0] at hZ; linarith · change Q*Real.exp 2 ≤ Z; dsimp [Z0] at hZ; linarith · change (Real.exp M)^2*Real.exp 2 ≤ Z; dsimp [Z0] at hZ; linarith · rw [←hroot] exact Real.rpow_le_rpow hr hzroot hδ.le theorem initial_large_bin_geometry {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (F R : Finset ι) (a b Z σ θ deltaLoss c : ℝ) (j : SecondLogIndex) (hZ : 1 ≤ Z) (hc : 1 ≤ c) (hR : R ∈ boundedPrimeSupports p F (Z*Real.exp (initialErrorWindow a b))) (hj : j ∈ secondLogBinBox (Z*Real.exp (initialErrorWindow a b)) (initialErrorRowBound a b Z (Z^(1+σ)))) (hσ : 0 ≤ σ) (hmargin : deltaLoss+θ ≤ σ-(1 : ℝ)/20) (hlarge : Real.exp 2 ≤ Z ∧ c*Real.exp (initialErrorWindow a b) ≤ Z ∧ initialPolynomialCap a b*Real.exp 2 ≤ Z ∧ (Real.exp (initialErrorWindow a b))^2*Real.exp 2 ≤ Z ∧ c ≤ Z^deltaLoss) (hrad : initialRadial Z (Z^(1+σ)) (primeProductNorm p R) j ≤ Z^θ) : let X := initialLogColumn Z (primeProductNorm p R) j let lengthScale := initialLogLabel j let K := secondLogK j*Real.exp 2 X ≤ Z^20 ∧ lengthScale ≤ Z^20 ∧ K ≤ Z^20 ∧ c*primeProductNorm p R ≤ Z^20 ∧ X*lengthScale ≤ Z^2 ∧ K*(c*primeProductNorm p R) ≤ X*lengthScale*Z^(-(1 : ℝ)/20) := by dsimp only have hZ0 := zero_lt_one.trans_le hZ have hB := primeProductNorm_ge_one p hp R have hBp := zero_lt_one.trans_le hB have hU : 1 ≤ Z*Real.exp (initialErrorWindow a b) := one_le_mul_of_one_le_of_one_le hZ (Real.one_le_exp (by unfold initialErrorWindow; positivity)) have hH : 1 ≤ Z^(1+σ) := Real.one_le_rpow hZ (by linarith) have hKmax := initialErrorRowBound_ge_one a b Z (Z^(1+σ)) hZ hH have hBcap := (Finset.mem_filter.mp hR).2 have hKcap := (initial_actual_bin_polynomial_caps a b Z (Z^(1+σ)) hZ hH).2 have hKbin := initial_bin_row_scale_le (Z*Real.exp (initialErrorWindow a b)) (initialErrorRowBound a b Z (Z^(1+σ))) hKmax j hj have hL := initialLogLabel_cap _ _ hU j hj have hp20 (n : ℕ) (hn : n ≤ 20) : Z^n ≤ Z^20 := pow_le_pow_right₀ hZ hn have hinv := initial_radial_invariant Z (primeProductNorm p R) c σ θ deltaLoss ((1 : ℝ)/20) j hZ hBp (zero_le_one.trans hc) hlarge.2.2.2.2 hmargin hrad rw [show -((1 : ℝ)/20)=(-1 : ℝ)/20 by ring] at hinv refine ⟨?_,?_,?_,?_,?_,hinv⟩ · exact (initialLogColumn_le Z _ j hZ0.le hB).trans (by simpa using hp20 1 (by decide)) · apply hL.trans calc _ = ((Real.exp (initialErrorWindow a b))^2*Real.exp 2)*Z^2 := by ring _ ≤ Z*Z^2 := mul_le_mul_of_nonneg_right hlarge.2.2.2.1 (sq_nonneg Z) _ ≤ Z^20 := by simpa [pow_succ,mul_comm] using hp20 3 (by decide) · calc _ ≤ (initialPolynomialCap a b*Z^17)*Real.exp 2 := mul_le_mul_of_nonneg_right (hKbin.trans hKcap) (Real.exp_pos _).le _ = (initialPolynomialCap a b*Real.exp 2)*Z^17 := by ring _ ≤ Z*Z^17 := mul_le_mul_of_nonneg_right hlarge.2.2.1 (pow_nonneg hZ0.le _) _ ≤ Z^20 := by simpa [pow_succ,mul_comm] using hp20 18 (by decide) · calc _ ≤ c*(Z*Real.exp (initialErrorWindow a b)) := mul_le_mul_of_nonneg_left hBcap (zero_le_one.trans hc) _ = (c*Real.exp (initialErrorWindow a b))*Z := by ring _ ≤ Z*Z := mul_le_mul_of_nonneg_right hlarge.2.1 hZ0.le _ ≤ Z^20 := by simpa [pow_two] using hp20 2 (by decide) · rw [initial_log_mass Z (primeProductNorm p R) hBp.ne' j] calc _ ≤ Z*Real.exp 2 := mul_le_mul_of_nonneg_right (div_le_self hZ0.le hB) (Real.exp_pos _).le _ ≤ Z^2 := by simpa [pow_two] using mul_le_mul_of_nonneg_left hlarge.1 hZ0.le end section open MeasureTheory open scoped BigOperators Classical open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (firstLogDensity) theorem initial_density_elementary_squared_mass {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hc : ∀ i,ringChar (ActualEisensteinCubic.O ⧸ Ideal.span {p i}) ≠ 2) (hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (Ψ₁ Ψ₂ : ActualEisensteinCubic.O →* ℂ) (hΨ₁ : ∀ a,‖Ψ₁ a‖ ≤ 1) (hΨ₂ : ∀ a,‖Ψ₂ a‖ ≤ 1) (m : ActualEisensteinCubic.O) (T : Finset (Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O)) (V₁ V₂ : ℝ → ℂ) (X lengthScale K A Vmax : ℝ) (J : ℕ) (hX : 0 < X) (hL : 1 ≤ lengthScale) (hK : 1 ≤ K) (hA : 0 ≤ A) (hVmax : 0 ≤ Vmax) (hV₁ : ∀ t,‖V₁ t‖ ≤ Vmax) (hV₂ : ∀ t,‖V₂ t‖ ≤ Vmax) (hs₁ : ∀ t,V₁ t ≠ 0 → |t| ≤ A) (hs₂ : ∀ t,V₂ t ≠ 0 → |t| ≤ A) (hT : ∀ z ∈ T,z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ lengthScale ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ K) : densityChildEnergy p hp hcop hg pool Ψ₁ Ψ₂ m T V₁ V₂ X X (2*J) ≤ (initialElementaryConstant A Vmax*(∫ t : ℝ,firstLogDensity 0 t)^3)*K*(X*lengthScale)^2 := by let C := initialElementaryConstant A Vmax*(∫ t : ℝ,firstLogDensity 0 t)^3 have hI : 0 ≤ ∫ t : ℝ,firstLogDensity 0 t := integral_nonneg (fun t => FirstPassCubeLabels.firstLogDensity_nonneg 0 t) have hC : 0 ≤ C := mul_nonneg (initialElementaryConstant_nonneg A Vmax) (pow_nonneg hI _) have hd := childDensity_elementary_all_scales p hp hcop hg hc hinj pool Ψ₁ Ψ₂ hΨ₁ hΨ₂ m T V₁ V₂ X lengthScale K A Vmax J hX hL hK hA hVmax hV₁ hV₂ hs₁ hs₂ hT change _/(X*lengthScale) ≤ C*K*X at hd have hraw := (div_le_iff₀ (mul_pos hX (zero_lt_one.trans_le hL))).mp hd have hbase : 0 ≤ (C*K*X)*(X*lengthScale) := by positivity calc _ ≤ (C*K*X)*(X*lengthScale) := hraw _ ≤ ((C*K*X)*(X*lengthScale))*lengthScale := le_mul_of_one_le_right hbase hL _ = _ := by dsimp only [C]; ring end section open MeasureTheory open scoped BigOperators Classical ContDiff open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm firstLogDensity) end section open scoped BigOperators Classical open SecondPassArithmetic theorem initial_log_harmonic_small_power (η : ℝ) (hη : 0 < η) : ∃ C : ℝ,0 < C ∧ ∀ (Y U Kmax : ℝ),1 ≤ Y → 0 < U → 0 < Kmax → U ≤ Y → Kmax ≤ Y → ((secondLogBinBox U Kmax).card : ℝ)*(128*Real.exp 1*(normLogBin U+1 : ℝ)) ≤ C*Y^η := by obtain ⟨C,hC,hbound⟩ := globalLogFactor_small_power η hη refine ⟨128*Real.exp 1*C,by positivity,?_⟩ intro Y U Kmax hY hU hK hUY hKY let B := 1+Real.log 27+22*Real.log Y have hlog := Real.log_nonneg hY have h27 : 0 ≤ Real.log 27 := Real.log_nonneg (by norm_num) have hB : 1 ≤ B := by dsimp [B]; linarith have hu := normLogBin_le_log_upper U Y hU hUY hY have hk := normLogBin_le_log_upper Kmax Y hK hKY hY have huB : (normLogBin U : ℝ)+1 ≤ B := by dsimp [B]; linarith have hkB : (normLogBin Kmax : ℝ)+1 ≤ B := by dsimp [B]; linarith have hcard : ((secondLogBinBox U Kmax).card : ℝ) ≤ B^3 := by rw [secondLogBinBox_card,Nat.cast_mul,Nat.cast_pow,Nat.cast_add,Nat.cast_add,Nat.cast_one] calc _ ≤ B^2*B := mul_le_mul (pow_le_pow_left₀ (by positivity) huB 2) hkB (by positivity) (sq_nonneg B) _ = _ := by ring have hh : 128*Real.exp 1*(normLogBin U+1 : ℝ) ≤ 128*Real.exp 1*B := mul_le_mul_of_nonneg_left huB (by positivity) calc _ ≤ B^3*(128*Real.exp 1*B) := mul_le_mul hcard hh (by positivity) (pow_nonneg (zero_le_one.trans hB) _) _ = 128*Real.exp 1*B^4 := by ring _ ≤ 128*Real.exp 1*B^10 := mul_le_mul_of_nonneg_left (pow_le_pow_right₀ hB (by decide)) (by positivity) _ ≤ 128*Real.exp 1*(C*Y^η) := mul_le_mul_of_nonneg_left (hbound Y hY) (by positivity) _ = _ := by ring theorem initial_row_log_budget (η Ccap : ℝ) (hη : 0 < η) (hcap : 1 ≤ Ccap) : ∃ C : ℝ,0 < C ∧ ∀ (Z U Kmax : ℝ),1 ≤ Z → 0 < U → 0 < Kmax → U ≤ Ccap*Z^17 → Kmax ≤ Ccap*Z^17 → (Kmax*Real.exp 2)^η*((secondLogBinBox U Kmax).card : ℝ)* (128*Real.exp 1*(normLogBin U+1 : ℝ)) ≤ C*Z^(34*η) := by obtain ⟨C,hC,hlog⟩ := initial_log_harmonic_small_power η hη refine ⟨C*(Real.exp 2)^η*Ccap^(2*η),by positivity,?_⟩ intro Z U Kmax hZ hU hK hUY hKY have hZ0 := zero_lt_one.trans_le hZ have hcap0 := zero_lt_one.trans_le hcap let Y := Ccap*Z^17 have hY : 1 ≤ Y := one_le_mul_of_one_le_of_one_le hcap (one_le_pow₀ hZ) have hlogs := hlog Y U Kmax hY hU hK hUY hKY have hrow : (Kmax*Real.exp 2)^η ≤ (Y*Real.exp 2)^η := Real.rpow_le_rpow (mul_pos hK (Real.exp_pos _)).le (mul_le_mul_of_nonneg_right hKY (Real.exp_pos _).le) hη.le calc _ = (Kmax*Real.exp 2)^η*(((secondLogBinBox U Kmax).card : ℝ)* (128*Real.exp 1*(normLogBin U+1 : ℝ))) := by ring _ ≤ (Y*Real.exp 2)^η*(C*Y^η) := mul_le_mul hrow hlogs (by positivity) (by positivity) _ = C*(Real.exp 2)^η*Y^(2*η) := by rw [Real.mul_rpow (zero_le_one.trans hY) (Real.exp_pos _).le] rw [show 2*η=η+η by ring,Real.rpow_add (zero_lt_one.trans_le hY)] ring _ = (C*(Real.exp 2)^η*Ccap^(2*η))*Z^(34*η) := by dsimp [Y] rw [Real.mul_rpow hcap0.le (pow_nonneg hZ0.le _),←Real.rpow_natCast_mul hZ0.le] norm_num ring_nf end section open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm firstLogDensity normalizedColumn columnLog) end open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog) end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.CanonicalTailBounds namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff namespace InitialMeanSquare open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve SecondPassArithmetic SecondPassIntegration open FirstPassCubeLabels (normalizedColumn columnLog) end InitialMeanSquare open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) lemma firstTail_inverse_scale_bound (K D U:ℝ) (hK:0Ideal.span {p i})) (b:CubeCoordinates ι) (C:Finset ι) (B lengthScale:ℝ) (hB:0 simp rw [norm_div,Complex.norm_real,Real.norm_eq_abs,abs_of_pos (primeProductNorm_pos p hp D)] exact (div_le_div_of_nonneg_right hmu (primeProductNorm_pos p hp D).le).trans ((div_le_one (primeProductNorm_pos p hp D)).mpr (primeProductNorm_ge_one p hp D)) end section open ActualEisensteinCubic open FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) section variable {ι:Type*} [DecidableEq ι] (p:ι→ActualEisensteinCubic.O) (hp:∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) theorem canonicalCubeDualTail_support (pool:Finset ι) (b:CubeCoordinates ι) (C:Finset ι) (Ψ₁ Ψ₂:ActualEisensteinCubic.O→*ℂ) (m₁ m₂ f:ActualEisensteinCubic.O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (ell K M:ℝ) (hell:0g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W K T=0 := by have hz (S:Finset ι):g₁ (columnLog p ell ((b.rightDivisor∪C)∪S))=0:=by by_contra h exact hC ((primeProductNorm_mono p hp (Finset.Subset.trans Finset.subset_union_right Finset.subset_union_left)).trans (columnLog_norm_upper p hp ell M hell _ (hgM _ h))) have hcoef (S:Finset ι):canonicalCubeResidual p hg b C true Ψ₁ m₁ f (fun R=>g₁ (columnLog p ell R)) S=0:=by simp only [canonicalCubeResidual,originalLabelColumn,multiplicativeCoreColumn,ite_true,hz,mul_zero,zero_mul] simp only [canonicalCubeDualTail,actualFirstKernel,threeGaussRowFactor,hcoef,mul_zero, star_zero,zero_mul,ite_self,Finset.sum_const_zero,tsum_zero] end theorem full_uniform_canonicalSourceTail_bound (ε:ℝ) (hε:0<ε) (A:ℕ): ∃(s:Finset (ℕ×ℕ)) (C:ℝ),0Ideal.span {p i})) (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (_hc:∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (pool:Finset ι) (bs:Finset (CubeCoordinates ι)) (labels:Finset (Ideal ActualEisensteinCubic.O)) (a:CubeCoordinates ι→Finset ι→Ideal ActualEisensteinCubic.O→ℂ) (Ψ₁ Ψ₂:ActualEisensteinCubic.O→*ℂ) (m₁ m₂:ActualEisensteinCubic.O) (g₁ g₂ W:𝓢(ℝ,ℂ)) (Γ G₁ G₂ M₁ M₂ Ksrc K ell B F lengthScale:ℝ), 0≤Γ → 0≤G₁ → 0≤G₂ → 0b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit)≤B^2:= (primeProductNorm_mono p hp (Finset.filter_subset _ _)).trans (cubeCoordinates_radical_bound p hp b B hB0.le (hb₁ b hb) (hb₂ b hb)) change ‖eisEmbedding (∏i∈cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit,p i)‖^2≤B^2 at hn nlinarith [norm_nonneg (eisEmbedding (∏i∈cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit,p i))] let z (b:CubeCoordinates ι) (C:Finset ι) (I:Ideal ActualEisensteinCubic.O):ℂ:= canonicalCubeDualTail p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₁ (columnLog p ell S)) (fun S=>g₂ (columnLog p ell S)) W Ksrc (canonicalSourceCutoff p K ell b C) have hblock (b:CubeCoordinates ι) (hb:b∈bs) (C:Finset ι) (hC:C∈boundedPrimeSupports p (pool\b.support) lengthScale) (I:Ideal ActualEisensteinCubic.O): ‖z b C I‖≤(128*(lengthScale*B^2))*Q:=by have hCb:primeProductNorm p C≤lengthScale:=(Finset.mem_filter.mp hC).2 have hCB:Disjoint C b.support:=Finset.disjoint_left.mpr (fun i hi hiB=> (Finset.mem_sdiff.mp ((Finset.mem_powerset.mp (Finset.mem_filter.mp hC).1) hi)).2 hiB) let X₁:=ell/(primeProductNorm p b.rightDivisor*primeProductNorm p C) let X₂:=ell/(primeProductNorm p b.leftDivisor*primeProductNorm p C) let U₁:=X₁*Real.exp M₁ let U₂:=X₂*Real.exp M₂ let E:=primeProductNorm p (cubeActiveSupport b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit) have hU₁:0b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (canonicalCubeResidual p hg b C true Ψ₁ m₁ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₁ (columnLog p ell S))) (canonicalCubeResidual p hg b C false Ψ₂ m₂ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₂ (columnLog p ell S))) W (fun _=>1) (fun _=>1) 1 1 Ksrc (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) h.val‖≤Q:=by have hDb:=cubeSourceDivisor_norm_bound p hp b C D B lengthScale hB0.le hL0.le hCB (hb₁ b hb) (hb₂ b hb) hCb (Finset.mem_powerset.mp hD) exact (hkernel p hp hinj hcop hg hc pool b (hadm b hb) C D hCB Ψ₁ Ψ₂ hΨ₁ hΨ₂ m₁ m₂ (ConcretePrimeRowBridge.idealGenerator I) g₁ g₂ W G₁ G₂ M₁ M₂ Ksrc K ell hG₁ hG₂ hKsrc hK hell hg₁ hg₂ hM₁ hM₂).trans (firstTail_scalar_bound Ksrc (primeProductNorm p D) E U₁ U₂ lengthScale B G₁ G₂ P H A hKsrc (primeProductNorm_pos p hp _) hE hU₁ hU₂ hL0.le hG₁ hG₂ hP hH hDb hEb hU₁b hU₂b) dsimp only [z,canonicalCubeDualTail] rw [norm_mul] calc _ ≤ ‖∑D∈(C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit).powerset, (UniqueFactorizationMonoid.moebius (∏i∈D,Ideal.span {p i}):ℂ)/(primeProductNorm p D:ℂ)* ∑'h:{h:ActualEisensteinCubic.O // h∉canonicalSourceCutoff p K ell b C D},actualFirstKernel p hp hcop hg (pool\(b.support∪C)) b.support (fun i=>b.leftExponent i+b.rightExponent i) b.leftBit b.rightBit (canonicalCubeResidual p hg b C true Ψ₁ m₁ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₁ (columnLog p ell S))) (canonicalCubeResidual p hg b C false Ψ₂ m₂ (ConcretePrimeRowBridge.idealGenerator I) (fun S=>g₂ (columnLog p ell S))) W (fun _=>1) (fun _=>1) 1 1 Ksrc (primeSubsetGenerator (fun i=>Ideal.span {p i}) D) h.val‖:= mul_le_of_le_one_left (norm_nonneg _) (canonicalCubeOuter_norm_le_one p hp hcop hg hc b C Ψ₁ Ψ₂ hΨ₁ hΨ₂ m₁ m₂ _) _ ≤ ∑D∈(C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit).powerset,Q:=by apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro D hD rw [norm_mul] exact (mul_le_mul (sourceMobiusDivisor_norm_le_one p hp D) (hlocal D hD) (norm_nonneg _) zero_le_one).trans_eq (one_mul Q) _ = ((C∪cubePrincipalSupport b.support b.leftExponent b.rightExponent b.leftBit b.rightBit).powerset.card:ℝ)*Q:=by simp _ ≤ _:=mul_le_mul_of_nonneg_right (cubeSourceDivisors_card p hp hinj b C B lengthScale hB0 hL0 hCB (hb₁ b hb) (hb₂ b hb) hCb) hQ have hcommon (b:CubeCoordinates ι) (hb:b∈bs): ‖∑C∈(pool\b.support).powerset,∑I∈labels,a b C I*z b C I‖≤ (128*lengthScale)*(128*F)*Γ*((128*(lengthScale*B^2))*Q):=by have heq:(∑C∈(pool\b.support).powerset,∑I∈labels,a b C I*z b C I)= ∑C∈boundedPrimeSupports p (pool\b.support) lengthScale,∑I∈labels,a b C I*z b C I:=by symm apply Finset.sum_subset (Finset.filter_subset _ _) intro C hC hnot have hn:¬primeProductNorm p C≤ell*Real.exp M₁:=fun h=>hnot (Finset.mem_filter.mpr ⟨hC,h.trans hL₁⟩) apply Finset.sum_eq_zero intro I hI rw [show z b C I=0 from canonicalCubeDualTail_support p hp hcop hg pool b C Ψ₁ Ψ₂ m₁ m₂ _ g₁ g₂ W ell Ksrc M₁ hell hM₁ hn _,mul_zero] rw [heq] calc _ ≤ ∑C∈boundedPrimeSupports p (pool\b.support) lengthScale,∑I∈labels,‖a b C I*z b C I‖:= (norm_sum_le _ _).trans (Finset.sum_le_sum (fun C hC=>norm_sum_le _ _)) _ ≤ ∑C∈boundedPrimeSupports p (pool\b.support) lengthScale,∑I∈labels,Γ*((128*(lengthScale*B^2))*Q):=by apply Finset.sum_le_sum intro C hC apply Finset.sum_le_sum intro I hI rw [norm_mul] exact mul_le_mul (ha b hb C (Finset.mem_filter.mp hC).1 I hI) (hblock b hb C hC I) (norm_nonneg _) hΓ _ = ((boundedPrimeSupports p (pool\b.support) lengthScale).card:ℝ)*(labels.card:ℝ)*Γ*((128*(lengthScale*B^2))*Q):=by simp;ring _ ≤ _:=by apply mul_le_mul_of_nonneg_right _ (by positivity) apply mul_le_mul_of_nonneg_right _ hΓ exact mul_le_mul (boundedPrimeSupports_card_positive p hp hinj _ lengthScale hL0) hlabel (Nat.cast_nonneg _) (by positivity) change ‖∑b∈bs,∑C∈(pool\b.support).powerset,∑I∈labels,a b C I*z b C I‖≤_ calc _ ≤ ∑b∈bs,‖∑C∈(pool\b.support).powerset,∑I∈labels,a b C I*z b C I‖:=norm_sum_le _ _ _ ≤ ∑b∈bs,(128*lengthScale)*(128*F)*Γ*((128*(lengthScale*B^2))*Q):=Finset.sum_le_sum hcommon _ = (bs.card:ℝ)*((128*lengthScale)*(128*F)*Γ*((128*(lengthScale*B^2))*Q)):=by simp _ ≤ (Cb*B^(1+ε)*B)*((128*lengthScale)*(128*F)*Γ*((128*(lengthScale*B^2))*Q)):= mul_le_mul_of_nonneg_right hbcount (by positivity) _ = _:=by dsimp [Q,P,H] rw [Real.rpow_add hB0,Real.rpow_add hB0] norm_num ring end section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct) open SecondPassIntegration (densityChildEnergy) open ConcreteTraceCRT (eisEmbedding) section variable {ι:Type*} [DecidableEq ι] (p:ι→ActualEisensteinCubic.O) (hp:∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) theorem globalBin_canonical_child_bound (pool:Finset ι) (source:Finset (GlobalSecondData ι)) (side:Bool) (j:GlobalLogIndex) (Ψ:ActualEisensteinCubic.O→*ℂ) (m:ActualEisensteinCubic.O) (V₁ V₂:ℝ→ℂ) (C E ε K ell B F:ℝ) (A J:ℕ) (hC:0≤C) (hE:0≤E) (hε:0<ε) (hK:0Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (pool:Finset ι) (source:Finset (GlobalSecondData ι)) (side:Bool) (Ψ:ActualEisensteinCubic.O→*ℂ) (m:ActualEisensteinCubic.O) (V₁ V₂:ℝ→ℂ) (C E K ell B F M H U:ℝ) (A J:ℕ) (keep:GlobalLogIndex→Prop) [DecidablePred keep], letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype 0≤C → 0≤E → 1≤U → 0mul_nonneg hQ (hloss j)) _ = Q*∑j∈S,(globalBinLossScale B j)^ε:=by rw [Finset.mul_sum] _ ≤ Q*(Cbox*U^(deltaLoss+8*ε)):=mul_le_mul_of_nonneg_left (hbox K ell B F M H U hU hK hell hB hF hH hKU hellU hBU hHU heU) hQ _ = _:=by dsimp [Q];ring end open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct) open ConcreteTraceCRT (eisEmbedding) theorem globalPooled_mass_le_parent (_K ell B F:ℝ) (hell:0Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (_hc:∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hinj:Function.Injective (fun i=>Ideal.span {p i})) (pool:Finset ι) (source:Finset (GlobalSecondData ι)) (side:Bool) (Ψ:ActualEisensteinCubic.O→*ℂ) (m:ActualEisensteinCubic.O) (windows:Fin 7→ℝ→ℂ) (C E K ell B F M H U Z θ A₀ Vmax:ℝ) (N J:ℕ), 0≤C → 0≤E → 1≤U → 0globalBinRadial ell (globalPooledRowScale K ell B F j) jglobalBinRadial ell (globalPooledRowScale K ell B F j) j∑ray:SecondRayIndex,∑q∈globalBinTriples p source side j, globalDescentWeight C ε 0 0 K ell B F (N+1) (2*J) j ray q* (densityChildEnergy p hp hcop hg pool (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (fixedTripleMask m q) (globalArithmeticTargets p source side q j) (windows 5) (windows 6) (globalPooledColumnScale ell j) (globalPooledColumnScale ell j) (2*J)/ (globalPooledColumnScale ell j*globalPooledLabelScale j)) have hsplit:(∑j∈S,f j)= (∑j∈S.filter (fun j=>globalBinRadial ell (globalPooledRowScale K ell B F j) jZ^θ≤globalBinRadial ell (globalPooledRowScale K ell B F j) j),f j):=by simpa only [not_lt] using (Finset.sum_filter_add_sum_filter_not S (fun j=>globalBinRadial ell (globalPooledRowScale K ell B F j) j ⟨v₁,v₂,A.2,A.1⟩) lemma mem_reopenedCubeFiber (v₁ v₂ : ι →₀ ℕ) (b : CubeCoordinates ι) : b ∈ reopenedCubeFiber v₁ v₂ ↔ b.leftExponent=v₁ ∧ b.rightExponent=v₂ ∧ b.Admissible := by constructor · intro hb obtain ⟨A,hA,rfl⟩ := Finset.mem_image.mp hb obtain ⟨h₂,h₁⟩ := Finset.mem_product.mp hA exact ⟨rfl,rfl,Finset.mem_powerset.mp h₁,Finset.mem_powerset.mp h₂⟩ · rintro ⟨hl,hr,hb⟩ apply Finset.mem_image.mpr refine ⟨(b.rightDivisor,b.leftDivisor),?_,?_⟩ · apply Finset.mem_product.mpr have hs : b.support=v₁.support∪v₂.support := by rw [CubeCoordinates.support,hl,hr] exact ⟨Finset.mem_powerset.mpr (hs ▸ hb.2),Finset.mem_powerset.mpr (hs ▸ hb.1)⟩ · exact CubeCoordinates.ext hl.symm hr.symm rfl rfl def reopenedCubeFamily (Q : Finset (ι →₀ ℕ)) : Finset (CubeCoordinates ι) := (Q.product Q).biUnion (fun v => reopenedCubeFiber v.2 v.1) lemma mem_reopenedCubeFamily (Q : Finset (ι →₀ ℕ)) (b : CubeCoordinates ι) : b ∈ reopenedCubeFamily Q ↔ b.leftExponent ∈ Q ∧ b.rightExponent ∈ Q ∧ b.Admissible := by constructor · intro hb obtain ⟨v,hv,hb⟩ := Finset.mem_biUnion.mp hb obtain ⟨hl,hr,ha⟩ := (mem_reopenedCubeFiber v.2 v.1 b).mp hb exact ⟨hl ▸ (Finset.mem_product.mp hv).2,hr ▸ (Finset.mem_product.mp hv).1,ha⟩ · rintro ⟨hl,hr,ha⟩ exact Finset.mem_biUnion.mpr ⟨(b.rightExponent,b.leftExponent),Finset.mem_product.mpr ⟨hr,hl⟩, (mem_reopenedCubeFiber _ _ b).mpr ⟨rfl,rfl,ha⟩⟩ lemma reopenedCubeFamily_admissible (Q : Finset (ι →₀ ℕ)) : ∀ b ∈ reopenedCubeFamily Q,b.Admissible := fun b hb => ((mem_reopenedCubeFamily Q b).mp hb).2.2 theorem sum_reopenedCubeFamily {M : Type*} [AddCommMonoid M] (Q : Finset (ι →₀ ℕ)) (f : CubeCoordinates ι → M) : (∑ b ∈ reopenedCubeFamily Q,f b) = ∑ v₂ ∈ Q,∑ v₁ ∈ Q,∑ A₂ ∈ (v₁.support∪v₂.support).powerset, ∑ A₁ ∈ (v₁.support∪v₂.support).powerset,f ⟨v₁,v₂,A₁,A₂⟩ := by unfold reopenedCubeFamily rw [Finset.sum_biUnion] · change (∑ x ∈ Q ×ˢ Q,∑ i ∈ reopenedCubeFiber x.2 x.1,f i)=_ rw [Finset.sum_product] apply Finset.sum_congr rfl intro v₂ hv₂ apply Finset.sum_congr rfl intro v₁ hv₁ unfold reopenedCubeFiber rw [Finset.sum_image] · change (∑ x ∈ (v₁.support∪v₂.support).powerset ×ˢ (v₁.support∪v₂.support).powerset, f ⟨v₁,v₂,x.2,x.1⟩)=_ rw [Finset.sum_product] · intro A hA B hB he exact Prod.ext (congrArg CubeCoordinates.rightDivisor he) (congrArg CubeCoordinates.leftDivisor he) · intro v hv w hw hne apply Finset.disjoint_left.mpr intro b hb hc obtain ⟨hbl,hbr,ha⟩ := (mem_reopenedCubeFiber v.2 v.1 b).mp hb obtain ⟨hcl,hcr,hc⟩ := (mem_reopenedCubeFiber w.2 w.1 b).mp hc exact hne (Prod.ext (hbr.symm.trans hcr) (hbl.symm.trans hcl)) omit [DecidableEq ι] in lemma primeProduct_finsupp_support (p : ι → ActualEisensteinCubic.O) (B : Finset ι) (v : ι →₀ ℕ) (hv : v.support ⊆ B) : primeProduct p B v=primeProduct p v.support v := by unfold primeProduct symm apply Finset.prod_subset hv intro i hi hn have hv0 : v i=0 := by simpa only [Finsupp.mem_support_iff,not_not] using hn simp only [hv0,pow_zero] lemma reopenedCubeFamily_cube_norms (p : ι → ActualEisensteinCubic.O) (Q : Finset (ι →₀ ℕ)) (B : ℝ) (hQ : ∀ v ∈ Q,‖eisEmbedding (primeProduct p v.support v)‖^2 ≤ B) : ∀ b ∈ reopenedCubeFamily Q, ‖eisEmbedding (primeProduct p b.support b.leftExponent)‖^2 ≤ B ∧ ‖eisEmbedding (primeProduct p b.support b.rightExponent)‖^2 ≤ B := by intro b hb obtain ⟨hl,hr,ha⟩ := (mem_reopenedCubeFamily Q b).mp hb rw [primeProduct_finsupp_support p b.support b.leftExponent Finset.subset_union_left, primeProduct_finsupp_support p b.support b.rightExponent Finset.subset_union_right] exact ⟨hQ _ hl,hQ _ hr⟩ def reopenedPairCoefficient (β : Ideal ActualEisensteinCubic.O → (ι →₀ ℕ) → ℂ) (b : CubeCoordinates ι) (_C : Finset ι) (I : Ideal ActualEisensteinCubic.O) : ℂ := star (β I b.rightExponent)*β I b.leftExponent lemma reopenedPairCoefficient_bound (Q : Finset (ι →₀ ℕ)) (labels : Finset (Ideal ActualEisensteinCubic.O)) (β : Ideal ActualEisensteinCubic.O → (ι →₀ ℕ) → ℂ) (Γ : ℝ) (hΓ : 0 ≤ Γ) (hβ : ∀ I ∈ labels,∀ v ∈ Q,‖β I v‖ ≤ Γ) : ∀ b ∈ reopenedCubeFamily Q,∀ C,∀ I ∈ labels, ‖reopenedPairCoefficient β b C I‖ ≤ Γ^2 := by intro b hb C I hI obtain ⟨hl,hr,ha⟩ := (mem_reopenedCubeFamily Q b).mp hb simp only [reopenedPairCoefficient,norm_mul,norm_star] simpa only [pow_two] using mul_le_mul (hβ I hI _ hr) (hβ I hI _ hl) (norm_nonneg _) hΓ end section open ActualEisensteinCubic FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) open ConcretePrimeRowBridge (idealGenerator) theorem reopenedCanonicalRow_smoothed_eq_source {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀ i,p i ≠ 0) [∀ i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i,lambda ∉ Ideal.span {p i}) (hinj : Function.Injective (fun i => Ideal.span {p i})) (hpr : ∀ i,lambda^2 ∣ p i-1) (pool : Finset ι) (Q : Finset (ι →₀ ℕ)) (hQ : ∀ v ∈ Q,v.support ⊆ pool) (labels : Finset (Ideal ActualEisensteinCubic.O)) (β : Ideal ActualEisensteinCubic.O → (ι →₀ ℕ) → ℂ) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (g W : 𝓢(ℝ,ℂ)) (K ell : ℝ) (hK : 0 < K) : (∑ I ∈ labels,∑' z : ActualEisensteinCubic.O,W (‖eisEmbedding z‖^2/K)* (‖reopenedCanonicalRow p hp hcop hg pool Q (β I) Ψ m (idealGenerator I) (fun S => g (columnLog p ell S)) z‖^2 : ℝ)) = canonicalSourceTotal p hp hcop hg pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) Ψ Ψ m m g g W K ell := by rw [canonicalSourceTotal,sum_reopenedCubeFamily] simp only [reopenedPairCoefficient,CubeCoordinates.support] calc _ = ∑ I ∈ labels,∑ v₂ ∈ Q,∑ v₁ ∈ Q,(star (β I v₂)*β I v₁)* canonicalCubeCorrelation p hp hcop hg pool (v₁.support∪v₂.support) v₁ v₂ Ψ Ψ m m (idealGenerator I) (fun S => g (columnLog p ell S)) (fun S => g (columnLog p ell S)) W K := by apply Finset.sum_congr rfl intro I hI exact reopenedCanonicalRow_smoothed_expand p hp hcop hg pool Q hQ (β I) Ψ m (idealGenerator I) (fun S => g (columnLog p ell S)) W K hK _ = ∑ v₂ ∈ Q,∑ v₁ ∈ Q,∑ I ∈ labels,(star (β I v₂)*β I v₁)* canonicalCubeCorrelation p hp hcop hg pool (v₁.support∪v₂.support) v₁ v₂ Ψ Ψ m m (idealGenerator I) (fun S => g (columnLog p ell S)) (fun S => g (columnLog p ell S)) W K := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro v₂ hv₂ rw [Finset.sum_comm] _ = _ := by apply Finset.sum_congr rfl intro v₂ hv₂ apply Finset.sum_congr rfl intro v₁ hv₁ have hs : v₁.support∪v₂.support ⊆ pool := Finset.union_subset (hQ v₁ hv₁) (hQ v₂ hv₂) simp_rw [canonicalCubeCorrelation_eq_blocks p hp hcop hg hinj hpr pool v₁ v₂ hs, Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro A₂ hA₂ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro A₁ hA₁ rw [Finset.sum_comm] end section open ActualEisensteinCubic FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) section variable {ι : Type*} [DecidableEq ι] end end open ActualEisensteinCubic FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) open ConcretePrimeRowBridge (idealGenerator) end SecondPassArithmetic namespace CubicEisenstein open MeasureTheory open scoped SchwartzMap lemma euclideanIntegral_borel_transport (m : MeasurableSpace EuclideanSpatial) (hm : @BorelSpace EuclideanSpatial inferInstance m) (g : EuclideanSpatial→ℝ) : (letI : MeasurableSpace EuclideanSpatial := m letI : BorelSpace EuclideanSpatial := hm ∫p,g p) = (letI : MeasurableSpace EuclideanSpatial := borel EuclideanSpatial letI : BorelSpace EuclideanSpatial := ⟨rfl⟩ ∫p,g p) := by have he := hm.measurable_eq subst m rfl lemma euclideanIntegrable_borel_transport (m : MeasurableSpace EuclideanSpatial) (hm : @BorelSpace EuclideanSpatial inferInstance m) (g : EuclideanSpatial→ℝ) : (letI : MeasurableSpace EuclideanSpatial := m letI : BorelSpace EuclideanSpatial := hm Integrable g volume) ↔ (letI : MeasurableSpace EuclideanSpatial := borel EuclideanSpatial letI : BorelSpace EuclideanSpatial := ⟨rfl⟩ Integrable g volume) := by have he := hm.measurable_eq subst m rfl lemma euclideanNativeIntegral_eq_borel (g : EuclideanSpatial→ℝ) : (∫p,g p)= (letI : MeasurableSpace EuclideanSpatial := borel EuclideanSpatial letI : BorelSpace EuclideanSpatial := ⟨rfl⟩ ∫p,g p) := euclideanIntegral_borel_transport inferInstance inferInstance g lemma euclideanNativeIntegrable_iff_borel (g : EuclideanSpatial→ℝ) : Integrable g volume ↔ (letI : MeasurableSpace EuclideanSpatial := borel EuclideanSpatial letI : BorelSpace EuclideanSpatial := ⟨rfl⟩ Integrable g volume) := euclideanIntegrable_borel_transport inferInstance inferInstance g def euclideanLp_borel_transport (m : MeasurableSpace EuclideanSpatial) (hm : @BorelSpace EuclideanSpatial inferInstance m) : (letI : MeasurableSpace EuclideanSpatial := m letI : BorelSpace EuclideanSpatial := hm Lp ℂ 2 (volume : Measure EuclideanSpatial)) ≃ₗᵢ[ℂ] (letI : MeasurableSpace EuclideanSpatial := borel EuclideanSpatial letI : BorelSpace EuclideanSpatial := ⟨rfl⟩ Lp ℂ 2 (volume : Measure EuclideanSpatial)) := by have he := hm.measurable_eq subst m exact LinearIsometryEquiv.refl ℂ _ def euclideanNativeLpBorelEquiv : EuclideanL2 ≃ₗᵢ[ℂ] (letI : MeasurableSpace EuclideanSpatial := borel EuclideanSpatial letI : BorelSpace EuclideanSpatial := ⟨rfl⟩ Lp ℂ 2 (volume : Measure EuclideanSpatial)) := euclideanLp_borel_transport inferInstance inferInstance lemma euclideanLp_borel_transport_schwartz (m : MeasurableSpace EuclideanSpatial) (hm : @BorelSpace EuclideanSpatial inferInstance m) (f : 𝓢(EuclideanSpatial,ℂ)) : euclideanLp_borel_transport m hm (letI : MeasurableSpace EuclideanSpatial := m letI : BorelSpace EuclideanSpatial := hm f.toLp 2 volume)= (letI : MeasurableSpace EuclideanSpatial := borel EuclideanSpatial letI : BorelSpace EuclideanSpatial := ⟨rfl⟩ f.toLp 2 volume) := by have he := hm.measurable_eq subst m rfl lemma euclideanNativeLpBorelEquiv_schwartz (f : 𝓢(EuclideanSpatial,ℂ)) : euclideanNativeLpBorelEquiv (f.toLp 2 volume)= (letI : MeasurableSpace EuclideanSpatial := borel EuclideanSpatial letI : BorelSpace EuclideanSpatial := ⟨rfl⟩ f.toLp 2 volume) := euclideanLp_borel_transport_schwartz inferInstance inferInstance f end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff SchwartzMap namespace CubicEisenstein open RellichKondrachov.Analysis.FunctionalSpaces.Sobolev.Euclidean abbrev instMeasurableSpaceEuclideanSpatial_1 : MeasurableSpace EuclideanSpatial := borel EuclideanSpatial theorem instBorelSpaceEuclideanSpatial_1 : letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 BorelSpace EuclideanSpatial := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 ⟨rfl⟩ def kernelLocalizedRealTest (χ : PositiveChartCutoff) (f : kernelSmoothTests) (projection : ℂ →L[ℝ] ℝ) : C1c (E := EuclideanSpatial) := ⟨fun p => projection (kernelLocalizedField χ f p), (projection.contDiff.comp (kernelLocalizedField_smooth χ f)).of_le (by simp), (kernelLocalizedField_compact χ f).comp_left (map_zero projection)⟩ lemma sourceC1c_toL2_norm_sq : letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 ∀ (g : C1c (E := EuclideanSpatial)), ‖toL2 («μ» := volume) g‖^2=∫p,‖g.1 p‖^2 := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 fun (g : C1c (E := EuclideanSpatial)) => by calc ‖toL2 («μ» := volume) g‖^2=inner ℝ (toL2 («μ» := volume) g) (toL2 («μ» := volume) g) := (real_inner_self_eq_norm_sq _).symm _ = ∫p,inner ℝ (toL2 («μ» := volume) g p) (toL2 («μ» := volume) g p) := rfl _ = _ := by apply integral_congr_ae filter_upwards [(memLp_of_mem_C1c («μ» := volume) g.2).coeFn_toLp] with p hp change inner ℝ (((memLp_of_mem_C1c («μ» := volume) g.2).toLp g.1) p) (((memLp_of_mem_C1c («μ» := volume) g.2).toLp g.1) p)=_ rw [hp,real_inner_self_eq_norm_sq] lemma sourceC1c_toL2Grad_norm_sq : letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 ∀ (g : C1c (E := EuclideanSpatial)), ‖toL2Grad («μ» := volume) g‖^2=∫p,‖grad g.1 p‖^2 := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 fun (g : C1c (E := EuclideanSpatial)) => by calc ‖toL2Grad («μ» := volume) g‖^2=inner ℝ (toL2Grad («μ» := volume) g) (toL2Grad («μ» := volume) g) := (real_inner_self_eq_norm_sq _).symm _ = ∫p,inner ℝ (toL2Grad («μ» := volume) g p) (toL2Grad («μ» := volume) g p) := rfl _ = _ := by apply integral_congr_ae filter_upwards [(memLp_grad_of_mem_C1c («μ» := volume) g.2).coeFn_toLp] with p hp change inner ℝ (((memLp_grad_of_mem_C1c («μ» := volume) g.2).toLp (grad g.1)) p) (((memLp_grad_of_mem_C1c («μ» := volume) g.2).toLp (grad g.1)) p)=_ rw [hp,real_inner_self_eq_norm_sq] lemma kernelLocalizedRealTest_grad_le (χ : PositiveChartCutoff) (f : kernelSmoothTests) (projection : ℂ →L[ℝ] ℝ) (hprojection : ∀z,‖projection z‖≤‖z‖) (p : EuclideanSpatial) : ‖grad (kernelLocalizedRealTest χ f projection).1 p‖^2≤ ∑j : Fin 3,‖fderiv ℝ (kernelLocalizedField χ f) p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2 := by have hdiff : DifferentiableAt ℝ (kernelLocalizedField χ f) p := ((kernelLocalizedField_smooth χ f).differentiable (by simp)).differentiableAt have hd := (projection.hasFDerivAt.comp p hdiff.hasFDerivAt).fderiv change fderiv ℝ (kernelLocalizedRealTest χ f projection).1 p=_ at hd unfold grad rw [LinearIsometryEquiv.norm_map,hd,(EuclideanSpace.basisFun (Fin 3) ℝ).norm_dual] apply Finset.sum_le_sum intro j hj have hh := hprojection (fderiv ℝ (kernelLocalizedField χ f) p (EuclideanSpace.basisFun (Fin 3) ℝ j)) change (projection (fderiv ℝ (kernelLocalizedField χ f) p (EuclideanSpace.basisFun (Fin 3) ℝ j)))^2≤_ simp only [Real.norm_eq_abs] at hh simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) hh 2 lemma kernelLocalizedRealTest_energy_le : letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 ∀ (χ : PositiveChartCutoff) (f : kernelSmoothTests) (projection : ℂ →L[ℝ] ℝ) (hprojection : ∀z,‖projection z‖≤‖z‖), ‖toL2 («μ» := volume) (kernelLocalizedRealTest χ f projection)‖^2+ ‖toL2Grad («μ» := volume) (kernelLocalizedRealTest χ f projection)‖^2≤ ‖kernelLocalizedH1 χ f‖^2 := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 fun (χ : PositiveChartCutoff) (f : kernelSmoothTests) (projection : ℂ →L[ℝ] ℝ) (hprojection : ∀z,‖projection z‖≤‖z‖) => by let g := kernelLocalizedRealTest χ f projection rw [sourceC1c_toL2_norm_sq,sourceC1c_toL2Grad_norm_sq,kernelLocalizedH1_norm_sq, ←integral_add (memLp_of_mem_C1c («μ» := volume) g.2).norm.integrable_sq (memLp_grad_of_mem_C1c («μ» := volume) g.2).norm.integrable_sq] rw [euclideanNativeIntegral_eq_borel] have hden := (euclideanNativeIntegrable_iff_borel (kernelLocalizedDensity χ f)).mp (kernelLocalizedDensity_integrable χ f) apply integral_mono ((memLp_of_mem_C1c («μ» := volume) g.2).norm.integrable_sq.add (memLp_grad_of_mem_C1c («μ» := volume) g.2).norm.integrable_sq) hden intro p have hm := hprojection (kernelLocalizedField χ f p) have hg := kernelLocalizedRealTest_grad_le χ f projection hprojection p change ‖projection (kernelLocalizedField χ f p)‖^2+_≤_ unfold kernelLocalizedDensity nlinarith [norm_nonneg (projection (kernelLocalizedField χ f p)),norm_nonneg (kernelLocalizedField χ f p)] lemma kernelLocalizedRealTest_support (χ : PositiveChartCutoff) (f : kernelSmoothTests) (projection : ℂ →L[ℝ] ℝ) : Function.support (kernelLocalizedRealTest χ f projection).1⊆tsupport χ.func := by intro p hp apply kernelLocalizedField_tsupport χ f apply subset_tsupport intro hz apply hp change projection (kernelLocalizedField χ f p)=0 rw [hz,map_zero] theorem kernelLocalizedReal_family_precompact : letI rootPolicy_instMeasurableSpaceEuclideanSpatial := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial letI rootPolicy_instBorelSpaceEuclideanSpatial := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (projection : ℂ →L[ℝ] ℝ) (hprojection : ∀z,‖projection z‖≤‖z‖) (family : Set kernelSmoothTests) (B : ℝ) (hB : 0≤B) (hfamily : ∀f∈family,‖kernelSmoothTestsToL2 f‖^2+kernelDirichletEnergy f≤B), IsCompact (closure ((fun f => toL2 («μ» := volume) (kernelLocalizedRealTest χ f projection)) '' family)) := letI rootPolicy_instMeasurableSpaceEuclideanSpatial := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial letI rootPolicy_instBorelSpaceEuclideanSpatial := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (projection : ℂ →L[ℝ] ℝ) (hprojection : ∀z,‖projection z‖≤‖z‖) (family : Set kernelSmoothTests) (B : ℝ) (hB : 0≤B) (hfamily : ∀f∈family,‖kernelSmoothTestsToL2 f‖^2+kernelDirichletEnergy f≤B) => by obtain ⟨C,hC,hbound⟩ := kernelLocalizedH1_bounded χ hinj have hCB : 0≤C*B := mul_nonneg hC hB have henergy : ∀f∈family, ‖toL2 («μ» := volume) (kernelLocalizedRealTest χ f projection)‖^2+ ‖toL2Grad («μ» := volume) (kernelLocalizedRealTest χ f projection)‖^2≤C*B := by intro f hf exact (kernelLocalizedRealTest_energy_le χ f projection hprojection).trans ((hbound f).trans (mul_le_mul_of_nonneg_left (hfamily f hf) hC)) have hh := euclidean_C1c_family_precompact (tsupport χ.func) χ.compact ((fun f => kernelLocalizedRealTest χ f projection) '' family) (Real.sqrt (C*B)) (by rintro _ ⟨f,hf,rfl⟩ exact kernelLocalizedRealTest_support χ f projection) (by rintro _ ⟨f,hf,rfl⟩ have he := henergy f hf have hs := Real.sq_sqrt hCB have hn := Real.sqrt_nonneg (C*B) nlinarith [sq_nonneg ‖toL2Grad («μ» := volume) (kernelLocalizedRealTest χ f projection)‖, norm_nonneg (toL2 («μ» := volume) (kernelLocalizedRealTest χ f projection))]) (by rintro _ ⟨f,hf,rfl⟩ have he := henergy f hf have hs := Real.sq_sqrt hCB have hn := Real.sqrt_nonneg (C*B) nlinarith [sq_nonneg ‖toL2 («μ» := volume) (kernelLocalizedRealTest χ f projection)‖, norm_nonneg (toL2Grad («μ» := volume) (kernelLocalizedRealTest χ f projection))]) simpa only [Set.image_image,Function.comp_def] using hh abbrev RellichRealL2 := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 Lp ℝ 2 (volume : Measure EuclideanSpatial) abbrev RellichComplexL2 := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 Lp ℂ 2 (volume : Measure EuclideanSpatial) def kernelComplexL2Assemble : letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 (RellichRealL2 × RellichRealL2) →L[ℝ] RellichComplexL2 := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 (Complex.ofRealCLM.compLpL 2 (volume : Measure EuclideanSpatial)).comp (ContinuousLinearMap.fst ℝ RellichRealL2 RellichRealL2)+ (Complex.I • Complex.ofRealCLM.compLpL 2 (volume : Measure EuclideanSpatial)).comp (ContinuousLinearMap.snd ℝ RellichRealL2 RellichRealL2) lemma kernelComplexL2Assemble_localized : letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 ∀ (χ : PositiveChartCutoff) (f : kernelSmoothTests), kernelComplexL2Assemble (toL2 («μ» := volume) (kernelLocalizedRealTest χ f Complex.reCLM), toL2 («μ» := volume) (kernelLocalizedRealTest χ f Complex.imCLM))= (kernelLocalizedSchwartz χ f).toLp 2 volume := letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 fun (χ : PositiveChartCutoff) (f : kernelSmoothTests) => by let r := toL2 («μ» := volume) (kernelLocalizedRealTest χ f Complex.reCLM) let i := toL2 («μ» := volume) (kernelLocalizedRealTest χ f Complex.imCLM) let R := Complex.ofRealCLM.compLpL 2 (volume : Measure EuclideanSpatial) r let I := Complex.ofRealCLM.compLpL 2 (volume : Measure EuclideanSpatial) i have hr : (r : EuclideanSpatial→ℝ)=ᵐ[volume]fun p => (kernelLocalizedField χ f p).re := (memLp_of_mem_C1c («μ» := volume) (kernelLocalizedRealTest χ f Complex.reCLM).2).coeFn_toLp have hi : (i : EuclideanSpatial→ℝ)=ᵐ[volume]fun p => (kernelLocalizedField χ f p).im := (memLp_of_mem_C1c («μ» := volume) (kernelLocalizedRealTest χ f Complex.imCLM).2).coeFn_toLp change R+Complex.I•I=(kernelLocalizedSchwartz χ f).toLp 2 volume apply Lp.ext filter_upwards [hr,hi,Complex.ofRealCLM.coeFn_compLpL r,Complex.ofRealCLM.coeFn_compLpL i, Lp.coeFn_add R (Complex.I•I),Lp.coeFn_smul Complex.I I, (kernelLocalizedSchwartz χ f).coeFn_toLp 2 volume] with p hrp hip hR hI ha hs hf rw [ha,Pi.add_apply,hs,Pi.smul_apply,hR,hI,hrp,hip,hf] change ((kernelLocalizedField χ f p).re:ℂ)+Complex.I*((kernelLocalizedField χ f p).im:ℂ)=kernelLocalizedField χ f p simpa only [mul_comm] using Complex.re_add_im (kernelLocalizedField χ f p) theorem kernelLocalizedComplex_family_precompact : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (family : Set kernelSmoothTests) (B : ℝ) (hB : 0≤B) (hfamily : ∀f∈family,‖kernelSmoothTestsToL2 f‖^2+kernelDirichletEnergy f≤B), IsCompact (closure ((fun f => (kernelLocalizedSchwartz χ f).toLp 2 volume) '' family)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (family : Set kernelSmoothTests) (B : ℝ) (hB : 0≤B) (hfamily : ∀f∈family,‖kernelSmoothTestsToL2 f‖^2+kernelDirichletEnergy f≤B) => by have hr := kernelLocalizedReal_family_precompact χ hinj Complex.reCLM (fun z => by change ‖z.re‖≤‖z‖; simpa only [Real.norm_eq_abs] using Complex.abs_re_le_norm z) family B hB hfamily have hi := kernelLocalizedReal_family_precompact χ hinj Complex.imCLM (fun z => by change ‖z.im‖≤‖z‖; simpa only [Real.norm_eq_abs] using Complex.abs_im_le_norm z) family B hB hfamily have hc := (hr.prod hi).image kernelComplexL2Assemble.continuous apply hc.closure_of_subset rintro _ ⟨f,hf,rfl⟩ refine ⟨(toL2 («μ» := volume) (kernelLocalizedRealTest χ f Complex.reCLM), toL2 («μ» := volume) (kernelLocalizedRealTest χ f Complex.imCLM)),?_,?_⟩ · exact ⟨subset_closure ⟨f,hf,rfl⟩,subset_closure ⟨f,hf,rfl⟩⟩ · exact kernelComplexL2Assemble_localized χ f theorem kernelLocalizedNative_family_precompact : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (family : Set kernelSmoothTests) (B : ℝ) (hB : 0≤B) (hfamily : ∀f∈family,‖kernelSmoothTestsToL2 f‖^2+kernelDirichletEnergy f≤B), IsCompact (closure ((fun f => kernelL2Localize χ (kernelSmoothTestsToL2 f)) '' family)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (family : Set kernelSmoothTests) (B : ℝ) (hB : 0≤B) (hfamily : ∀f∈family,‖kernelSmoothTestsToL2 f‖^2+kernelDirichletEnergy f≤B) => letI := @OAI.CubicEisenstein.instMeasurableSpaceEuclideanSpatial_1 letI := @OAI.CubicEisenstein.instBorelSpaceEuclideanSpatial_1 by have hc := kernelLocalizedComplex_family_precompact χ hinj family B hB hfamily apply (hc.image euclideanNativeLpBorelEquiv.symm.continuous).closure_of_subset rintro _ ⟨f,hf,rfl⟩ refine ⟨(kernelLocalizedSchwartz χ f).toLp 2 volume,subset_closure ⟨f,hf,rfl⟩,?_⟩ apply euclideanNativeLpBorelEquiv.injective simp only [LinearIsometryEquiv.apply_symm_apply] rw [kernelL2Localize_core χ hinj] exact (euclideanNativeLpBorelEquiv_schwartz _).symm def kernelEnergyLocalizeL2 : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff), KernelEnergyGraph →L[ℂ] EuclideanL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) => (kernelL2Localize χ).comp kernelEnergyMass theorem kernelEnergyLocalizeL2_isCompact : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)), IsCompactOperator (kernelEnergyLocalizeL2 χ) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) => by let family : Set kernelSmoothTests := {f | ‖kernelEnergyGraphCore f‖≤2} let C := closure ((fun f => kernelL2Localize χ (kernelSmoothTestsToL2 f)) '' family) have hc : IsCompact C := kernelLocalizedNative_family_precompact χ hinj family 4 (by norm_num) (by intro f hf rw [←kernelEnergyGraphCore_norm_sq] change ‖kernelEnergyGraphCore f‖≤2 at hf nlinarith [norm_nonneg (kernelEnergyGraphCore f)]) let T := kernelEnergyLocalizeL2 χ have hclosed : IsClosed (T ⁻¹' C) := hc.isClosed.preimage T.continuous have hsub : closure (kernelEnergyGraphCore '' (kernelEnergyGraphCore ⁻¹' Metric.ball (0 : KernelEnergyGraph) 2))⊆T ⁻¹' C := by apply hclosed.closure_subset_iff.mpr rintro _ ⟨f,hf,rfl⟩ change kernelL2Localize χ (kernelEnergyMass (kernelEnergyGraphCore f))∈C rw [kernelEnergyMass_core] apply subset_closure refine ⟨f,?_,rfl⟩ change ‖kernelEnergyGraphCore f‖≤2 exact le_of_lt (by simpa only [Set.mem_preimage,Metric.mem_ball,dist_zero_right] using hf) have hball : Metric.ball (0 : KernelEnergyGraph) 2⊆T ⁻¹' C := by intro u hu exact hsub (kernelEnergyGraphCore_dense.subset_closure_image_preimage_of_isOpen Metric.isOpen_ball hu) refine ⟨C,hc,?_⟩ exact Filter.mem_of_superset (Metric.ball_mem_nhds (0 : KernelEnergyGraph) (by norm_num : (0 : ℝ)<2)) hball end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CompactEnergyFamilies namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open Filter MeasureTheory open scoped BigOperators Classical Topology namespace CubicEisenstein section lemma compact_of_norm_le_compact {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [NormedAddCommGroup F] [NormedSpace ℂ F] [CompleteSpace F] [NormedAddCommGroup G] [NormedSpace ℂ G] (f : E→L[ℂ]F) (g : E→L[ℂ]G) (hg : IsCompactOperator g) (hbound : ∃C : ℝ,∀x,‖f x‖≤C*‖g x‖) : IsCompactOperator f := by let S := (LinearMap.range g.toLinearMap).topologicalClosure have hS : IsClosed (S : Set G) := (LinearMap.range g.toLinearMap).isClosed_topologicalClosure have hmem : ∀x,g x∈S := fun x => (LinearMap.range g.toLinearMap).le_topologicalClosure ⟨x,rfl⟩ let e : E→L[ℂ]S := g.codRestrict S hmem have he : DenseRange e := by rw [DenseRange,Subtype.dense_iff,←Set.range_comp] change closure (Set.range g)⊆closure (Set.range g) exact Set.Subset.rfl have hec : IsCompactOperator e := hg.codRestrict hmem hS let q : S→L[ℂ]F := f.toLinearMap.extendOfNorm e.toLinearMap have hfq : f=q.comp e := by ext x exact (LinearMap.extendOfNorm_eq he hbound x).symm rw [hfq] exact hec.clm_comp q lemma compact_finite_pi {E G ι : Type*} [Fintype ι] [NormedAddCommGroup E] [NormedSpace ℂ E] [NormedAddCommGroup G] [NormedSpace ℂ G] (T : ι→E→L[ℂ]G) (hT : ∀i,IsCompactOperator (T i)) : IsCompactOperator (ContinuousLinearMap.pi T) := by let K : ι→Set G := fun i => closure ((T i) '' Metric.ball (0 : E) 1) have hK : ∀i,IsCompact (K i) := fun i => (hT i).isCompact_closure_image_ball 1 refine ⟨Set.pi Set.univ K,isCompact_univ_pi hK,?_⟩ apply Filter.mem_of_superset (Metric.ball_mem_nhds (0 : E) (by norm_num : (0 : ℝ)<1)) intro x hx exact fun i hi => subset_closure ⟨x,hx,rfl⟩ open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff SchwartzMap def kernelChartCore (χ : PositiveChartCutoff) : Set EuclideanSpatial := {p | (1/2 : ℝ)<χ.func p} def kernelChartCoreImage (χ : PositiveChartCutoff) : Set KernelQuotient := kernelEuclideanProjection '' kernelChartCore χ lemma kernelChartCore_open (χ : PositiveChartCutoff) : IsOpen (kernelChartCore χ) := isOpen_lt continuous_const χ.smooth.continuous lemma kernelChartCore_subset (χ : PositiveChartCutoff) : kernelChartCore χ⊆tsupport χ.func := by intro p hp apply subset_tsupport change χ.func p≠0 have hh : (1/2 : ℝ)<χ.func p := hp linarith lemma kernelChartCoreImage_open : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (χ : PositiveChartCutoff), IsOpen (kernelChartCoreImage χ) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (χ : PositiveChartCutoff) => by have hp : kernelChartCore χ⊆euclideanUpperHalf := (kernelChartCore_subset χ).trans χ.positive have he : kernelChartCoreImage χ=integralOrbitProjection globalKubotaKernel '' (hyperbolicEuclideanCoordinates ⁻¹' kernelChartCore χ) := by rw [←euclideanToHyperbolic_image_positive _ hp,Set.image_image] rfl rw [he] exact (integralOrbitProjection_openQuotient globalKubotaKernel globalKubotaKernel_le_levelThree).isOpenMap _ ((kernelChartCore_open χ).preimage hyperbolicEuclideanCoordinates_continuous) abbrev KernelGoodCutoff := {χ : PositiveChartCutoff // Set.InjOn kernelEuclideanProjection (tsupport χ.func)} lemma kernelChartCoreImage_cover : (Set.univ : Set KernelQuotient)⊆ ⋃χ : KernelGoodCutoff,kernelChartCoreImage χ.1 := by intro q hq obtain ⟨w,rfl⟩ := Quotient.mk_surjective q obtain ⟨χ,hχ,hrange,hinj⟩ := kernelChartCutoff_exists (hyperbolicEuclideanCoordinates w) (hyperbolicHeight_pos w) refine Set.mem_iUnion.mpr ⟨⟨χ,hinj⟩,hyperbolicEuclideanCoordinates w,?_,?_⟩ · change (1/2 : ℝ)<χ.func (hyperbolicEuclideanCoordinates w) rw [hχ] norm_num · simp only [kernelEuclideanProjection,Function.comp_apply,euclideanToHyperbolic_coordinates] rfl lemma kernelCompact_finite_chart_cover : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (K : Set KernelQuotient) (hK : IsCompact K), ∃t : Finset KernelGoodCutoff,K⊆⋃χ∈t,kernelChartCoreImage χ.1 := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (K : Set KernelQuotient) (hK : IsCompact K) => by exact hK.elim_finite_subcover (fun χ : KernelGoodCutoff => kernelChartCoreImage χ.1) (fun χ => kernelChartCoreImage_open χ.1) (Set.subset_univ K |>.trans kernelChartCoreImage_cover) lemma kernelChartCore_mass_estimate : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (H : ℝ) (hH : 0≤H) (hdensity : ∀p∈tsupport χ.func,((p 2)^3)⁻¹≤H) (f : kernelSmoothTests), (∫q in kernelChartCoreImage χ,‖f.1 q‖^2∂integralQuotientVolume globalKubotaKernel)≤ 4*H*‖kernelL2Localize χ (kernelSmoothTestsToL2 f)‖^2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (H : ℝ) (hH : 0≤H) (hdensity : ∀p∈tsupport χ.func,((p 2)^3)⁻¹≤H) (f : kernelSmoothTests) => by let S := kernelChartCore χ have hS : MeasurableSet S := (kernelChartCore_open χ).measurableSet have hpos : S⊆euclideanUpperHalf := (kernelChartCore_subset χ).trans χ.positive have hi : Set.InjOn kernelEuclideanProjection S := hinj.mono (kernelChartCore_subset χ) have hm := hyperbolicVolume_le_densityBound S hS hpos H (fun p hp => hdensity p (kernelChartCore_subset χ hp)) have hloc : Integrable (fun p => ‖kernelLocalizedField χ f p‖^2) volume := by exact ((kernelLocalizedSchwartz χ f).memLp 2 volume).norm.integrable_sq have hlocHyp : IntegrableOn (fun p => ‖kernelLocalizedField χ f p‖^2) S hyperbolicEuclideanVolume := (hloc.integrableOn.smul_measure (c := ENNReal.ofReal H) ENNReal.ofReal_ne_top).mono_measure hm have hmass : IntegrableOn (fun p => ‖kernelTestField f p‖^2) S hyperbolicEuclideanVolume := (kernelEuclideanProjection_measurePreserving_on S hS hpos hi).integrable_comp_of_integrable (kernelSmoothTests_memLp f).norm.integrable_sq.integrableOn rw [kernelL2Localize_core χ hinj,schwartz_toL2_norm_sq] have hEq := kernelEuclideanProjection_integral S hS hpos hi (fun q => ‖f.1 q‖^2) (kernelSmoothTests_memLp f).norm.integrable_sq.aestronglyMeasurable change (∫p in S,‖kernelTestField f p‖^2∂hyperbolicEuclideanVolume)=_ at hEq change (∫q in kernelEuclideanProjection '' S,‖f.1 q‖^2∂integralQuotientVolume globalKubotaKernel)≤ 4*H*(∫p,‖kernelLocalizedField χ f p‖^2) rw [←hEq] calc _ ≤ ∫p in S,4*‖kernelLocalizedField χ f p‖^2∂hyperbolicEuclideanVolume := by apply setIntegral_mono_on hmass (hlocHyp.const_mul 4) hS intro p hp have hc : (1/2 : ℝ)<χ.func p := hp rw [kernelLocalizedField,norm_smul,Real.norm_eq_abs,mul_pow,sq_abs] have hn := sq_nonneg ‖kernelTestField f p‖ have hx : 1≤4*(χ.func p)^2 := by nlinarith nlinarith [mul_le_mul_of_nonneg_right hx hn] _ = 4*(∫p in S,‖kernelLocalizedField χ f p‖^2∂hyperbolicEuclideanVolume) := integral_const_mul _ _ _ ≤ 4*(H*(∫p in S,‖kernelLocalizedField χ f p‖^2)) := by apply mul_le_mul_of_nonneg_left _ (by norm_num) have hh := integral_mono_measure hm (Eventually.of_forall (fun p => sq_nonneg ‖kernelLocalizedField χ f p‖)) (hloc.integrableOn.smul_measure (c := ENNReal.ofReal H) ENNReal.ofReal_ne_top) simpa only [integral_smul_measure,ENNReal.toReal_ofReal hH,smul_eq_mul] using hh _ ≤ _ := by rw [←mul_assoc] apply mul_le_mul_of_nonneg_left _ (by positivity) exact setIntegral_le_integral hloc (Eventually.of_forall (fun p => sq_nonneg ‖kernelLocalizedField χ f p‖)) lemma kernelChartCore_mass_bound : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (χ : KernelGoodCutoff), ∃C : ℝ,0≤C ∧ ∀f : kernelSmoothTests, (∫q in kernelChartCoreImage χ.1,‖f.1 q‖^2∂integralQuotientVolume globalKubotaKernel)≤ C*‖kernelL2Localize χ.1 (kernelSmoothTestsToL2 f)‖^2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (χ : KernelGoodCutoff) => by have hrho : ContinuousOn (fun p : EuclideanSpatial => ((p 2)^3)⁻¹) (tsupport χ.1.func) := (by fun_prop : Continuous (fun p : EuclideanSpatial => (p 2)^3)).continuousOn.inv₀ (fun p hp => pow_ne_zero _ (ne_of_gt (χ.1.positive hp))) obtain ⟨r,hr⟩ := χ.1.compact.bddAbove_image hrho refine ⟨4*max 0 r,by positivity,fun f => ?_⟩ exact kernelChartCore_mass_estimate χ.1 χ.2 (max 0 r) (le_max_left _ _) (fun p hp => (hr ⟨p,hp,rfl⟩).trans (le_max_right _ _)) f end open Filter MeasureTheory open scoped BigOperators Classical Topology def kernelMassRestriction : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (K : Set KernelQuotient) (hK : MeasurableSet K) (f : KernelQuotientL2), KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (K : Set KernelQuotient) (hK : MeasurableSet K) (f : KernelQuotientL2) => ((Lp.memLp f).indicator hK).toLp (K.indicator f) lemma kernelMassRestriction_coe : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (K : Set KernelQuotient) (hK : MeasurableSet K) (f : KernelQuotientL2), (kernelMassRestriction K hK f : KernelQuotient→ℂ)=ᵐ[integralQuotientVolume globalKubotaKernel] K.indicator f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (K : Set KernelQuotient) (hK : MeasurableSet K) (f : KernelQuotientL2) => ((Lp.memLp f).indicator hK).coeFn_toLp def kernelMassRestrictionLinear : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (K : Set KernelQuotient) (hK : MeasurableSet K), KernelQuotientL2→ₗ[ℂ]KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (K : Set KernelQuotient) (hK : MeasurableSet K) => { toFun := kernelMassRestriction K hK map_add' f g := by apply Lp.ext filter_upwards [kernelMassRestriction_coe K hK (f+g),kernelMassRestriction_coe K hK f, kernelMassRestriction_coe K hK g,Lp.coeFn_add f g, Lp.coeFn_add (kernelMassRestriction K hK f) (kernelMassRestriction K hK g)] with q hfg hf hg ha hb rw [hfg,hb,Pi.add_apply,hf,hg] by_cases hq : q∈K · simp only [Set.indicator_of_mem hq,ha,Pi.add_apply] · simp only [Set.indicator_of_notMem hq,add_zero] map_smul' c f := by change kernelMassRestriction K hK (c•f)=c•kernelMassRestriction K hK f apply Lp.ext filter_upwards [kernelMassRestriction_coe K hK (c•f),kernelMassRestriction_coe K hK f, Lp.coeFn_smul c f,Lp.coeFn_smul c (kernelMassRestriction K hK f)] with q hcf hf ha hb rw [hcf,hb,Pi.smul_apply,hf] by_cases hq : q∈K · simp only [Set.indicator_of_mem hq,ha,Pi.smul_apply] · simp only [Set.indicator_of_notMem hq,smul_zero] } lemma kernelMassRestriction_norm_le : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (K : Set KernelQuotient) (hK : MeasurableSet K) (f : KernelQuotientL2), ‖kernelMassRestriction K hK f‖≤‖f‖ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (K : Set KernelQuotient) (hK : MeasurableSet K) (f : KernelQuotientL2) => by apply Lp.norm_le_norm_of_ae_le filter_upwards [kernelMassRestriction_coe K hK f] with q hq rw [hq] by_cases hm : q∈K · simp only [Set.indicator_of_mem hm,le_refl] · simp only [Set.indicator_of_notMem hm,norm_zero,norm_nonneg] def kernelMassRestrictionCLM : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (K : Set KernelQuotient) (hK : MeasurableSet K), KernelQuotientL2→L[ℂ]KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (K : Set KernelQuotient) (hK : MeasurableSet K) => (kernelMassRestrictionLinear K hK).mkContinuous 1 (by intro f change ‖kernelMassRestriction K hK f‖≤1*‖f‖ simpa only [one_mul] using kernelMassRestriction_norm_le K hK f) lemma kernelMassRestriction_norm_sq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (K : Set KernelQuotient) (hK : MeasurableSet K) (f : KernelQuotientL2), ‖kernelMassRestrictionCLM K hK f‖^2= ∫q in K,‖f q‖^2∂integralQuotientVolume globalKubotaKernel := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (K : Set KernelQuotient) (hK : MeasurableSet K) (f : KernelQuotientL2) => by rw [←integral_indicator hK] calc _ = inner ℝ (kernelMassRestriction K hK f) (kernelMassRestriction K hK f) := (real_inner_self_eq_norm_sq _).symm _ = ∫q,inner ℝ (kernelMassRestriction K hK f q) (kernelMassRestriction K hK f q) ∂integralQuotientVolume globalKubotaKernel := rfl _ = _ := by apply integral_congr_ae filter_upwards [kernelMassRestriction_coe K hK f] with q hq rw [hq,real_inner_self_eq_norm_sq] by_cases hqK : q∈K · simp only [Set.indicator_of_mem hqK] · simp only [Set.indicator_of_notMem hqK,norm_zero,zero_pow (by decide : 2≠0)] lemma kernelMassRestriction_smooth_norm_sq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (K : Set KernelQuotient) (hK : MeasurableSet K) (f : kernelSmoothTests), ‖kernelMassRestrictionCLM K hK (kernelSmoothTestsToL2 f)‖^2= ∫q in K,‖f.1 q‖^2∂integralQuotientVolume globalKubotaKernel := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (K : Set KernelQuotient) (hK : MeasurableSet K) (f : kernelSmoothTests) => by rw [kernelMassRestriction_norm_sq] apply integral_congr_ae filter_upwards [ae_restrict_of_ae (kernelSmoothTests_memLp f).coeFn_toLp] with q hq change ‖((kernelSmoothTests_memLp f).toLp f.1) q‖^2=‖f.1 q‖^2 rw [hq] def kernelEnergyMassRestriction : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (K : Set KernelQuotient) (hK : MeasurableSet K), KernelEnergyGraph→L[ℂ]KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (K : Set KernelQuotient) (hK : MeasurableSet K) => (kernelMassRestrictionCLM K hK).comp kernelEnergyMass lemma integral_le_finite_cover {X ι : Type*} [MeasurableSpace X] [Fintype ι] (ν : Measure X) (K : Set X) (hK : MeasurableSet K) (U : ι→Set X) (hU : ∀i,MeasurableSet (U i)) (hcover : K⊆⋃i,U i) (g : X→ℝ) (hg : Integrable g ν) (hn : ∀x,0≤g x) : (∫x in K,g x∂ν)≤∑i,∫x in U i,g x∂ν := by have hi : ∀i,Integrable ((U i).indicator g) ν := fun i => hg.indicator (hU i) calc _ = ∫x,K.indicator g x∂ν := (integral_indicator hK).symm _ ≤ ∫x,∑i,(U i).indicator g x∂ν := by apply integral_mono (hg.indicator hK) (integrable_finsetSum _ (fun i himem => hi i)) intro x have hnon : ∀i,0≤(U i).indicator g x := fun i => Set.indicator_nonneg (fun y hy => hn y) x by_cases hx : x∈K · rw [Set.indicator_of_mem hx] obtain ⟨i,hi⟩ := Set.mem_iUnion.mp (hcover hx) calc g x=(U i).indicator g x := (Set.indicator_of_mem hi g).symm _ ≤ ∑j,(U j).indicator g x := Finset.single_le_sum (fun j hj => hnon j) (Finset.mem_univ i) · rw [Set.indicator_of_notMem hx] exact Finset.sum_nonneg (fun i hi => hnon i) _ = _ := by rw [integral_finsetSum _ (fun i himem => hi i)] apply Finset.sum_congr rfl intro i hi exact integral_indicator (hU i) def kernelEnergyChartFamily : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (t : Finset KernelGoodCutoff), KernelEnergyGraph→L[ℂ](t→EuclideanL2) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (t : Finset KernelGoodCutoff) => ContinuousLinearMap.pi (fun χ : t => kernelEnergyLocalizeL2 χ.1.1) lemma kernelEnergyChartFamily_isCompact : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (t : Finset KernelGoodCutoff), IsCompactOperator (kernelEnergyChartFamily t) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (t : Finset KernelGoodCutoff) => compact_finite_pi _ (fun χ => kernelEnergyLocalizeL2_isCompact χ.1.1 χ.1.2) lemma finite_sum_weighted_norm_sq_le {G ι : Type*} [Fintype ι] [NormedAddCommGroup G] (C : ι→ℝ) (hC : ∀i,0≤C i) (x : ι→G) : (∑i,C i*‖x i‖^2)≤(∑i,C i)*‖x‖^2 := by rw [Finset.sum_mul] apply Finset.sum_le_sum intro i hi exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) (norm_le_pi_norm x i) 2) (hC i) lemma kernelEnergyChartFamily_core_apply : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (t : Finset KernelGoodCutoff) (f : kernelSmoothTests) (χ : t), kernelEnergyChartFamily t (kernelEnergyGraphCore f) χ= kernelL2Localize χ.1.1 (kernelSmoothTestsToL2 f) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (t : Finset KernelGoodCutoff) (f : kernelSmoothTests) (χ : t) => by change kernelL2Localize χ.1.1 (kernelEnergyMass (kernelEnergyGraphCore f))=_ rw [kernelEnergyMass_core] lemma kernelCompact_mass_bound : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (K : Set KernelQuotient) (hK : IsCompact K), ∃t : Finset KernelGoodCutoff,∃C : ℝ,0≤C ∧ ∀f : kernelSmoothTests, (∫q in K,‖f.1 q‖^2∂integralQuotientVolume globalKubotaKernel)≤ C*‖kernelEnergyChartFamily t (kernelEnergyGraphCore f)‖^2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (K : Set KernelQuotient) (hK : IsCompact K) => by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel obtain ⟨t,ht⟩ := kernelCompact_finite_chart_cover K hK have hcov : K⊆⋃χ : t,kernelChartCoreImage χ.1.1 := by intro q hq obtain ⟨χ,hχ,hqχ⟩ := Set.mem_iUnion₂.mp (ht hq) exact Set.mem_iUnion.mpr ⟨⟨χ,hχ⟩,hqχ⟩ choose C hC hbound using fun χ : t => kernelChartCore_mass_bound χ.1 refine ⟨t,∑χ,C χ,Finset.sum_nonneg (fun χ hχ => hC χ),fun f => ?_⟩ calc _ ≤ ∑χ : t,∫q in kernelChartCoreImage χ.1.1,‖f.1 q‖^2∂integralQuotientVolume globalKubotaKernel := integral_le_finite_cover _ K hK.measurableSet _ (fun χ : t => (kernelChartCoreImage_open χ.1.1).measurableSet) hcov _ (kernelSmoothTests_memLp f).norm.integrable_sq (fun _ => sq_nonneg _) _ ≤ ∑χ : t,C χ*‖kernelL2Localize χ.1.1 (kernelSmoothTestsToL2 f)‖^2 := Finset.sum_le_sum (fun χ hχ => hbound χ f) _ = ∑χ : t,C χ*‖kernelEnergyChartFamily t (kernelEnergyGraphCore f) χ‖^2 := by simp only [kernelEnergyChartFamily_core_apply] _ ≤ _ := finite_sum_weighted_norm_sq_le C hC _ theorem kernelEnergyMassRestriction_isCompact : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (K : Set KernelQuotient) (hK : IsCompact K), let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel IsCompactOperator (kernelEnergyMassRestriction K hK.measurableSet) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (K : Set KernelQuotient) (hK : IsCompact K) => by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel dsimp only obtain ⟨t,C,hC,hbound⟩ := kernelCompact_mass_bound K hK have hsq : ∀u : KernelEnergyGraph, ‖kernelEnergyMassRestriction K hK.measurableSet u‖^2≤ C*‖kernelEnergyChartFamily t u‖^2 := by intro u exact kernelEnergyGraphCore_dense.induction_on u (isClosed_le (by fun_prop : Continuous (fun v => ‖kernelEnergyMassRestriction K hK.measurableSet v‖^2)) (by fun_prop : Continuous (fun v => C*‖kernelEnergyChartFamily t v‖^2))) (fun f => by change ‖kernelMassRestrictionCLM K hK.measurableSet (kernelEnergyMass (kernelEnergyGraphCore f))‖^2≤_ rw [kernelEnergyMass_core,kernelMassRestriction_smooth_norm_sq] exact hbound f) apply compact_of_norm_le_compact _ (kernelEnergyChartFamily t) (kernelEnergyChartFamily_isCompact t) refine ⟨Real.sqrt C,fun u => ?_⟩ have hs := hsq u have hc := Real.sq_sqrt hC have hn := mul_nonneg (Real.sqrt_nonneg C) (norm_nonneg (kernelEnergyChartFamily t u)) have he : (Real.sqrt C*‖kernelEnergyChartFamily t u‖)^2=C*‖kernelEnergyChartFamily t u‖^2 := by rw [mul_pow,Real.sq_sqrt hC] nlinarith [norm_nonneg (kernelEnergyMassRestriction K hK.measurableSet u)] end CubicEisenstein open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic open CompletedGauss (actualSextic) def primeValueHom (w : Ideal ActualEisensteinCubic.O → ℂ) : Ideal ActualEisensteinCubic.O →*₀ ℂ where toFun I := if I=0 then 0 else ((UniqueFactorizationMonoid.normalizedFactors I).map w).prod map_zero' := by simp map_one' := by rw [if_neg one_ne_zero,UniqueFactorizationMonoid.normalizedFactors_one] rfl map_mul' I J := by by_cases hI : I=0 · simp [hI] by_cases hJ : J=0 · simp [hJ] simp only [if_neg hI,if_neg hJ,if_neg (mul_ne_zero hI hJ), UniqueFactorizationMonoid.normalizedFactors_mul hI hJ,Multiset.map_add,Multiset.prod_add] theorem primeValueHom_prime (w : Ideal ActualEisensteinCubic.O → ℂ) (P : Ideal ActualEisensteinCubic.O) (hP : Prime P) : primeValueHom w P = w P := by change (if P=0 then 0 else _) = w P rw [if_neg hP.ne_zero, UniqueFactorizationMonoid.normalizedFactors_irreducible hP.irreducible] simp only [normalize_eq,Multiset.map_singleton,Multiset.prod_singleton] theorem primeValueHom_norm_le_one (w : Ideal ActualEisensteinCubic.O → ℂ) (hw : ∀ P,‖w P‖≤1) (I : Ideal ActualEisensteinCubic.O) : ‖primeValueHom w I‖≤1 := by by_cases hI : I=0 · rw [hI,map_zero,norm_zero] exact zero_le_one change ‖if I=0 then 0 else _‖≤1 rw [if_neg hI] have hprod (s : Multiset (Ideal ActualEisensteinCubic.O)) : ‖(s.map w).prod‖≤1 := by induction s using Multiset.induction_on with | empty => simp | @cons P s ih => simp only [Multiset.map_cons,Multiset.prod_cons,norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (hw P)).trans ih exact hprod _ def principalIdealHom : ActualEisensteinCubic.O →*₀ Ideal ActualEisensteinCubic.O where toFun n := Ideal.span {n} map_zero' := by simp map_one' := by simp map_mul' a b := (Ideal.span_singleton_mul_span_singleton a b).symm def localRowValue (x : ActualEisensteinCubic.O) (P : Ideal ActualEisensteinCubic.O) : ℂ := if h : P.IsMaximal ∧ lambda∉P then letI : P.IsMaximal := h.1 actualSextic P h.2 (Ideal.Quotient.mk P x) else 0 theorem localRowValue_good (x : ActualEisensteinCubic.O) (P : Ideal ActualEisensteinCubic.O) [P.IsMaximal] (hg : lambda∉P) : localRowValue x P = actualSextic P hg (Ideal.Quotient.mk P x) := by simp only [localRowValue,dif_pos (show P.IsMaximal ∧ lambda∉P from ⟨inferInstance,hg⟩)] theorem localRowValue_norm (x : ActualEisensteinCubic.O) (P : Ideal ActualEisensteinCubic.O) : ‖localRowValue x P‖≤1 := by unfold localRowValue split_ifs with h · let : P.IsMaximal := h.1 let : Fintype (ActualEisensteinCubic.O⧸P) := Fintype.ofFinite _ exact FiniteRayExpansion.norm_char_le_one _ _ · simp def idealRowHom (x : ActualEisensteinCubic.O) : Ideal ActualEisensteinCubic.O →*₀ ℂ := primeValueHom (localRowValue x) def rowTwist (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) : ActualEisensteinCubic.O →* ℂ := Ψ * (idealRowHom (m^6*f^4*z)).toMonoidHom.comp principalIdealHom.toMonoidHom theorem idealRowHom_prime (x : ActualEisensteinCubic.O) (P : Ideal ActualEisensteinCubic.O) [P.IsMaximal] (hg : lambda∉P) : idealRowHom x P = actualSextic P hg (Ideal.Quotient.mk P x) := by rw [idealRowHom,primeValueHom_prime _ P (Ideal.prime_of_isPrime (NeZero.ne P) inferInstance),localRowValue_good] theorem idealRowHom_norm (x : ActualEisensteinCubic.O) (I : Ideal ActualEisensteinCubic.O) : ‖idealRowHom x I‖≤1 := primeValueHom_norm_le_one _ (localRowValue_norm x) I theorem rowTwist_norm (Ψ : ActualEisensteinCubic.O →* ℂ) (hΨ : ∀n,‖Ψ n‖≤1) (m f z n : ActualEisensteinCubic.O) : ‖rowTwist Ψ m f z n‖≤1 := by change ‖Ψ n * idealRowHom (m^6*f^4*z) (Ideal.span {n})‖≤1 rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (hΨ n)).trans (idealRowHom_norm _ _) theorem idealRowHom_product {ι : Type*} (p : ι → ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (hg : ∀i,lambda∉Ideal.span {p i}) (S : Finset ι) (x : ActualEisensteinCubic.O) : idealRowHom x (Ideal.span {∏i∈S,p i}) = finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S x := by rw [FiniteGaussPhase.span_finset_prod,map_prod] simp only [finiteSquarefreeRow] apply Finset.prod_congr rfl intro i hi exact idealRowHom_prime x _ (hg i) theorem rowTwist_product {ι : Type*} (p : ι → ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (hg : ∀i,lambda∉Ideal.span {p i}) (S : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) : rowTwist Ψ m f z (∏i∈S,p i) = Ψ (∏i∈S,p i)*rowCoprimeMask (fun i=>Ideal.span {p i}) S m* finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S f^4* finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S z := by change Ψ _ * idealRowHom _ (Ideal.span {∏i∈S,p i}) = _ rw [idealRowHom_product p hg S,finiteSquarefreeRow_mul,finiteSquarefreeRow_mul, FirstPassCubeLabels.row_pow,FirstPassCubeLabels.row_pow,FirstPassCubeLabels.row_sixth] ring end open ActualEisensteinCubic open CompletedGauss hiding O open SecondPassArithmetic hiding O section variable {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem squarefreeGaussCoefficient_finset (hpr : ∀i,lambda^2∣p i-1) (S : Finset ι) : squarefreeGaussCoefficient (Ideal.span {∏i∈S,p i}) = MixedCrossSeparation.columnCoefficient p hp hcop hg S := by have h := squarefreeGaussCoefficient_eq_canonicalProductCoefficient (fun i:S=>p i.val) (fun i=>hp i.val) (MixedCrossSeparation.columnPrimeCoprime p hcop S) (fun i=>hg i.val) (fun i=>hpr i.val) simpa only [Finset.prod_coe_sort,MixedCrossSeparation.columnCoefficient] using h theorem columnWeight_finset (hpr : ∀i,lambda^2∣p i-1) (S : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (H : Finset ι → ℂ) : columnWeight (rowTwist Ψ m f z) (Ideal.span {∏i∈S,p i}) * H S = canonicalSourceCoefficient p hp hcop hg Ψ m f H S * finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S z := by have hn : (∏i∈S,p i)≠0 := Finset.prod_ne_zero_iff.mpr (fun i _=>hp i) have hprimary : lambda^2∣(∏i∈S,p i)-1 := by have h := product_primary (fun i:S=>p i.val) (fun i=>hpr i.val) simpa only [Finset.prod_coe_sort] using h rw [columnWeight,squarefreeGaussCoefficient_finset p hp hcop hg hpr S, primaryGenerator_span _ hn hprimary,rowTwist_product p hg S] simp only [canonicalSourceCoefficient] ring end theorem selected_column_sum (F : Finset (Ideal ActualEisensteinCubic.O)) (hF : ∀I∈F,CanonicalQuadraticSieve.Admissible I) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℕ → ℂ) : letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let p := CanonicalQuadraticSieve.poolPrimary F let hp := CanonicalQuadraticSieve.poolPrimary_ne_zero F hF letI : ∀i:ConcretePrimeRowBridge.primePool F,(Ideal.span {p i}).IsMaximal := fun i=>by rw [CanonicalQuadraticSieve.poolPrimary_span F hF i]; infer_instance let hcop := CanonicalQuadraticSieve.poolPrimary_coprime F hF let hg := CanonicalQuadraticSieve.poolPrimary_good F hF (∑I∈F,columnWeight (rowTwist Ψ m f z) I * W (Ideal.absNorm I)) = ∑S∈(Finset.univ:Finset (ConcretePrimeRowBridge.primePool F)).powerset, canonicalSourceCoefficient p hp hcop hg Ψ m f (InitialMeanSquare.selectedIdealTest F W) S * finiteSquarefreeRow (fun i=>Ideal.span {p i}) hg S z := by letI poolMaximalWitness := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal dsimp only let : ∀i:ConcretePrimeRowBridge.primePool F, (Ideal.span {CanonicalQuadraticSieve.poolPrimary F i}).IsMaximal := fun i=>by rw [CanonicalQuadraticSieve.poolPrimary_span F hF i]; infer_instance rw [InitialMeanSquare.sum_selected_ideals F (fun I hI=>(hF I hI).2.1)] apply Finset.sum_congr rfl intro S hS have hspan : (Ideal.span {∏i∈S,CanonicalQuadraticSieve.poolPrimary F i}) = ∏i∈S,i.val := by rw [FiniteGaussPhase.span_finset_prod] exact Finset.prod_congr rfl (fun i _=>CanonicalQuadraticSieve.poolPrimary_span F hF i) have hpr (i:ConcretePrimeRowBridge.primePool F) : lambda^2∣CanonicalQuadraticSieve.poolPrimary F i-1 := (primaryPrime_spec i.val (CanonicalQuadraticSieve.poolPrimary_ne_zero F hF i)).2.2.2 have h := columnWeight_finset (CanonicalQuadraticSieve.poolPrimary F) (CanonicalQuadraticSieve.poolPrimary_ne_zero F hF) (CanonicalQuadraticSieve.poolPrimary_coprime F hF) (CanonicalQuadraticSieve.poolPrimary_good F hF) hpr S Ψ m f z (InitialMeanSquare.selectedIdealTest F W) rw [hspan] at h rw [←h] unfold InitialMeanSquare.selectedIdealTest split_ifs <;> simp end CanonicalRowCompletion end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.SupportBounds namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight theorem localRowValue_zero_of_mem (x : ActualEisensteinCubic.O) (P : Ideal ActualEisensteinCubic.O) (hx : x∈P) : localRowValue x P = 0 := by unfold localRowValue split_ifs with h · let : P.IsMaximal := h.1 rw [Ideal.Quotient.eq_zero_iff_mem.mpr hx] exact MulChar.map_nonunit _ (not_isUnit_zero) · rfl theorem idealRowHom_zero_of_dvd (x : ActualEisensteinCubic.O) {P I : Ideal ActualEisensteinCubic.O} (hP : Prime P) (hPI : P∣I) (hx : x∈P) : idealRowHom x I = 0 := by obtain ⟨J,rfl⟩ := hPI rw [map_mul] have hz : idealRowHom x P = 0 := by rw [idealRowHom,primeValueHom_prime _ P hP,localRowValue_zero_of_mem x P hx] rw [hz,zero_mul] theorem columnWeight_zero_of_mask (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) {P I : Ideal ActualEisensteinCubic.O} (hP : Prime P) (hPI : P∣I) (hm : m∈P) : columnWeight (rowTwist Ψ m f z) I = 0 := by unfold columnWeight have hx : m^6*f^4*z∈P := by have hm6 : m^6∈P := by rw [show m^6=m^5*m by ring] exact P.mul_mem_left (m^5) hm exact P.mul_mem_right z (P.mul_mem_right (f^4) hm6) by_cases hg : primaryGenerator I=0 · rw [hg] change squarefreeGaussCoefficient I * (Ψ 0 * idealRowHom _ (Ideal.span {0})) = 0 rw [Ideal.span_singleton_zero] change squarefreeGaussCoefficient I * (Ψ 0 * idealRowHom _ (0:Ideal ActualEisensteinCubic.O)) = 0 rw [map_zero (idealRowHom _),mul_zero,mul_zero] · change squarefreeGaussCoefficient I * (Ψ (primaryGenerator I) * idealRowHom _ (Ideal.span {primaryGenerator I})) = 0 rw [(primaryGenerator_spec I hg).1,idealRowHom_zero_of_dvd _ hP hPI hx,mul_zero,mul_zero] theorem columnWeight_zero_of_not_squarefree (Ψ : ActualEisensteinCubic.O →* ℂ) {I : Ideal ActualEisensteinCubic.O} (hI : ¬Squarefree I) : columnWeight Ψ I = 0 := by simp [columnWeight,squarefreeGaussCoefficient,hI] theorem weighted_column_support (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hSp : ∀P∈S,Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (hm : ∀P∈S,m∈P) (W : ℝ → ℂ) (b X : ℝ) (hX : 0hn (by rw [h,zero_mul]) have hwindow : W ((Ideal.absNorm I:ℝ)/X) ≠ 0 := fun h=>hn (by rw [h,mul_zero]) have hI : I≠0 := fun h=>hc (by rw [h,columnWeight_zero]) have hsf : Squarefree I := by by_contra h exact hc (columnWeight_zero_of_not_squarefree _ h) apply Finset.mem_filter.mpr refine ⟨mem_outsideIdealsUpTo.mpr ⟨?_,?_,?_⟩,hsf⟩ · exact Nat.one_le_iff_ne_zero.mpr (fun h=>hI (Ideal.absNorm_eq_zero_iff.mp h)) · exact_mod_cast ((div_le_iff₀ hX).mp (hW _ hwindow)).trans hD · intro P hP hPI exact hc (columnWeight_zero_of_mask Ψ m f z (hSp P hP) hPI (hm P hP)) theorem weighted_column_tsum_eq (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hSp : ∀P∈S,Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (hm : ∀P∈S,m∈P) (W : ℝ → ℂ) (b X : ℝ) (hX : 0 simp | @cons P s ih => simp only [Multiset.map_cons,Multiset.prod_cons] rw [localRowValue_mul,ih] ring exact hprod _ theorem rowTwist_row_factor (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z n : ActualEisensteinCubic.O) : rowTwist Ψ m f z n = rowTwist Ψ m f 1 n * idealRowHom z (Ideal.span {n}) := by change Ψ n * idealRowHom (m^6*f^4*z) (Ideal.span {n}) = (Ψ n * idealRowHom (m^6*f^4*1) (Ideal.span {n})) * idealRowHom z (Ideal.span {n}) rw [mul_one,idealRowHom_argument_mul] ring theorem cubeWeight_row_factor (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (B : Ideal ActualEisensteinCubic.O) : cubeWeight (rowTwist Ψ m f z) B = cubeWeight (rowTwist Ψ m f 1) B * idealRowHom z B^3 := by by_cases hB : primaryGenerator B=0 · have hzero (x:ActualEisensteinCubic.O) : rowTwist Ψ m f x (primaryGenerator B) = 0 := by rw [hB] change Ψ 0 * idealRowHom _ (Ideal.span {(0:ActualEisensteinCubic.O)}) = 0 rw [Ideal.span_singleton_zero] change Ψ 0 * idealRowHom _ (0:Ideal ActualEisensteinCubic.O) = 0 rw [map_zero (idealRowHom _),mul_zero] change _ * rowTwist Ψ m f z (primaryGenerator B)^3 / _ = (_ * rowTwist Ψ m f 1 (primaryGenerator B)^3 / _) * _ rw [hzero z,hzero 1] simp · change _ * rowTwist Ψ m f z (primaryGenerator B)^3 / _ = (_ * rowTwist Ψ m f 1 (primaryGenerator B)^3 / _) * _ rw [rowTwist_row_factor,(primaryGenerator_spec B hB).1,mul_pow] ring theorem idealRowHom_prime_powers {ι : Type*} (P : ι → Ideal ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hg : ∀i,lambda∉P i) (pool : Finset ι) (v : ι → ℕ) (z : ActualEisensteinCubic.O) : idealRowHom z (∏i∈pool,(P i)^v i) = multiplicityRow P hg pool v z := by rw [map_prod] simp only [map_pow,multiplicityRow] apply Finset.prod_congr rfl intro i hi rw [idealRowHom_prime z (P i) (hg i)] end section open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O def excludedGenerator (S : Finset (Ideal ActualEisensteinCubic.O)) : ActualEisensteinCubic.O := idealGenerator (∏P∈S,P) theorem excludedGenerator_mem (S : Finset (Ideal ActualEisensteinCubic.O)) {P : Ideal ActualEisensteinCubic.O} (hP : P∈S) : excludedGenerator S∈P := by have hdiv : P∣∏Q∈S,Q := Finset.dvd_prod_of_mem (fun Q:Ideal ActualEisensteinCubic.O=>Q) hP have hm : idealGenerator (∏Q∈S,Q)∈Ideal.span {idealGenerator (∏Q∈S,Q)} := Ideal.subset_span (by simp) rw [span_idealGenerator] at hm exact (Ideal.dvd_iff_le.mp hdiv) hm theorem excludedGenerator_not_mem_pool (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hSp : ∀P∈S,Prime P) (i : primePool (InitialMeanSquare.outsideSquarefreeIdeals S D)) : excludedGenerator S∉i.val := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal intro hm have hprime : Prime i.val := Ideal.prime_of_isPrime (NeZero.ne i.val) inferInstance have hspan : Ideal.span {excludedGenerator S} ≤ i.val := Ideal.span_le.mpr (Set.singleton_subset_iff.mpr hm) change Ideal.span {idealGenerator (∏Q∈S,Q)} ≤ i.val at hspan rw [span_idealGenerator] at hspan have hdiv : i.val∣∏Q∈S,Q := Ideal.dvd_iff_le.mpr hspan obtain ⟨P,hPS,hPi⟩ := (hprime.dvd_finsetProd_iff (fun Q:Ideal ActualEisensteinCubic.O=>Q)).mp hdiv have heq : i.val=P := (prime_dvd_prime_iff_eq hprime (hSp P hPS)).mp hPi obtain ⟨I,hI,hfactor⟩ := mem_primePool_iff.mp i.property have ho : I∈outsideIdealsUpTo S D := (Finset.mem_filter.mp hI).1 have hd : i.val∣I := UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors hfactor exact (mem_outsideIdealsUpTo.mp ho).2.2 P hPS (heq ▸ hd) theorem outside_pool_fixed_mask (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes⊆S) (hSp : ∀P∈S,Prime P) (T : Finset (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D))) : rowCoprimeMask (fun i=>Ideal.span {poolPrimary (InitialMeanSquare.outsideSquarefreeIdeals S D) i}) T (excludedGenerator S) = 1 := by unfold rowCoprimeMask rw [if_neg] rintro ⟨i,hi,hmem⟩ change excludedGenerator S ∈ Ideal.span {poolPrimary (InitialMeanSquare.outsideSquarefreeIdeals S D) i} at hmem rw [poolPrimary_span _ (InitialMeanSquare.outsideSquarefree_admissible S D hbad)] at hmem exact excludedGenerator_not_mem_pool S D hSp i hmem theorem canonicalSourceCoefficient_fixed_mask {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (Ψ : ActualEisensteinCubic.O →* ℂ) (m c f : ActualEisensteinCubic.O) (H : Finset ι → ℂ) (T : Finset ι) (hc : rowCoprimeMask (fun i=>Ideal.span {p i}) T c=1) : canonicalSourceCoefficient p hp hcop hg Ψ (m*c) f H T = canonicalSourceCoefficient p hp hcop hg Ψ m f H T := by simp only [canonicalSourceCoefficient,FirstPassCubeLabels.mask_mul _ hg,hc,mul_one] end section open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open FirstPassCubeLabels hiding O def outsideCanonicalRow (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (X : ℝ) : ℂ := letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F := InitialMeanSquare.outsideSquarefreeIdeals S D let hF := InitialMeanSquare.outsideSquarefree_admissible S D hbad letI : ∀i:primePool F,(Ideal.span {poolPrimary F i}).IsMaximal := fun i=>by rw [poolPrimary_span F hF i]; infer_instance fixedChildRow (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Ψ m (fun T=>W (primeProductNorm (poolPrimary F) T/X)) f z theorem outsideCanonicalRow_eq_global (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀P∈S,Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (b X : ℝ) (hX : 0by rw [poolPrimary_span F hF i]; infer_instance symm rw [weighted_column_tsum_eq S D hSp Ψ (m*excludedGenerator S) f z (fun P hP=>P.mul_mem_left m (excludedGenerator_mem S hP)) W b X hX hW hD] have he := selected_column_sum F hF Ψ (m*excludedGenerator S) f z (fun n=>W (n/X)) dsimp only at he rw [he] unfold outsideCanonicalRow fixedChildRow dsimp only apply Finset.sum_congr rfl intro T hT rw [canonicalSourceCoefficient_fixed_mask _ _ _ _ Ψ m (excludedGenerator S) f _ T (outside_pool_fixed_mask S D hbad hSp T)] have ht := InitialMeanSquare.selectedIdealTest_outside S D hbad hSp W b X hX hW hD T simp only [canonicalSourceCoefficient,secondChildColumn] rw [ht] ring theorem outsideCanonicalRow_cube_split (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀P∈S,Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (hWc : HasCompactSupport W) (b X H₀ : ℝ) (hX : 0(UniqueFactorizationMonoid.normalizedFactors B).count i.val) theorem cubeIndex_apply (F : Finset (Ideal ActualEisensteinCubic.O)) (B : Ideal ActualEisensteinCubic.O) (i : primePool F) : cubeIndex F B i = (UniqueFactorizationMonoid.normalizedFactors B).count i.val := by simp [cubeIndex] def cubeIdeal (F : Finset (Ideal ActualEisensteinCubic.O)) (v : primePool F →₀ ℕ) : Ideal ActualEisensteinCubic.O := ∏i:primePool F,i.val^v i theorem cubeIdeal_cubeIndex (F : Finset (Ideal ActualEisensteinCubic.O)) (B : Ideal ActualEisensteinCubic.O) (hB : B≠0) (hcover : ∀P∈UniqueFactorizationMonoid.normalizedFactors B,P∈primePool F) : cubeIdeal F (cubeIndex F B) = B := by have hsub : (UniqueFactorizationMonoid.normalizedFactors B).toFinset ⊆ primePool F := by intro P hP exact hcover P (Multiset.mem_toFinset.mp hP) calc _ = ∏P∈primePool F,P^(UniqueFactorizationMonoid.normalizedFactors B).count P := by simp only [cubeIdeal,cubeIndex_apply] exact Finset.prod_coe_sort (s := primePool F) (f := fun P:Ideal ActualEisensteinCubic.O=>P^(UniqueFactorizationMonoid.normalizedFactors B).count P) _ = (UniqueFactorizationMonoid.normalizedFactors B).prod := (Finset.prod_multiset_count_of_subset _ _ hsub).symm _ = B := Ideal.prod_normalizedFactors_eq_self hB theorem cubeIndex_inj (F : Finset (Ideal ActualEisensteinCubic.O)) (B C : Ideal ActualEisensteinCubic.O) (hB : B≠0) (hC : C≠0) (hb : ∀P∈UniqueFactorizationMonoid.normalizedFactors B,P∈primePool F) (hc : ∀P∈UniqueFactorizationMonoid.normalizedFactors C,P∈primePool F) (heq : cubeIndex F B = cubeIndex F C) : B=C := by have he := congrArg (cubeIdeal F) heq rwa [cubeIdeal_cubeIndex F B hB hb,cubeIdeal_cubeIndex F C hC hc] at he theorem outside_cubeIdeal_cubeIndex (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) {B : Ideal ActualEisensteinCubic.O} (hB : B∈outsideIdealsUpTo S D) : cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) (cubeIndex (InitialMeanSquare.outsideSquarefreeIdeals S D) B) = B := by exact cubeIdeal_cubeIndex _ B (outsideIdealsUpTo_ne_bot S D B hB) (InitialMeanSquare.outside_factors_mem_pool S D hB) theorem sum_outside_cubeIndex (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (a : Ideal ActualEisensteinCubic.O → ℂ) : (∑B∈outsideIdealsUpTo S D,a B) = ∑v∈(outsideIdealsUpTo S D).image (cubeIndex (InitialMeanSquare.outsideSquarefreeIdeals S D)), a (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) := by rw [Finset.sum_image] · apply Finset.sum_congr rfl intro B hB rw [outside_cubeIdeal_cubeIndex S D hB] · intro B hB C hC he exact cubeIndex_inj _ B C (outsideIdealsUpTo_ne_bot S D B hB) (outsideIdealsUpTo_ne_bot S D C hC) (InitialMeanSquare.outside_factors_mem_pool S D hB) (InitialMeanSquare.outside_factors_mem_pool S D hC) he theorem cubeIdeal_ne_zero (F : Finset (Ideal ActualEisensteinCubic.O)) (v : primePool F →₀ ℕ) : cubeIdeal F v ≠ 0 := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal unfold cubeIdeal exact Finset.prod_ne_zero_iff.mpr (fun i _=>pow_ne_zero _ (NeZero.ne i.val)) end CanonicalRowCompletion namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic end SecondPassIntegration open scoped BigOperators Classical open MeasureTheory namespace SecondPassArithmetic open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct primeProductNorm firstLogDensity) open SecondPassIntegration (densityChildEnergy) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter crossCoeff) section variable {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] def globalQuantitativeSource (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (K ell B F M H U : ℝ) (side : Bool) : Finset (GlobalSecondData ι) := globalFirstSupportedPool p pool ((globalFirstFamilySet pool blocks).filter (fun b => primeProductNorm p b.common ≤ U ∧ primeProductNorm p b.firstCommon ≤ U)) (fun b G E => (globalFirstConcreteCutoff p K ell B F M H side b G E).erase 0) ell M side theorem globalQuantitativeSource_block_mem (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (K ell B F M H U : ℝ) (side : Bool) (x : GlobalSecondData ι) (hx : x∈globalQuantitativeSource p pool blocks K ell B F M H U side) : x.first.block∈blocks := by have hx' := (mem_globalFirstExpansionPool pool _ _ x).mp (Finset.mem_filter.mp hx).1 exact ((mem_globalFirstFamilySet pool blocks x.first).mp (Finset.mem_filter.mp hx'.1).1).1 theorem globalQuantitativeSource_frequency_ne_zero (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (K ell B F M H U : ℝ) (side : Bool) (x : GlobalSecondData ι) (hx : x∈globalQuantitativeSource p pool blocks K ell B F M H U side) : x.source.frequency ≠ 0 := globalFirstSupportedPool_frequency_ne_zero p pool _ _ ell M side x hx end theorem globalFirstRayChildBudget_canonical_bound (deltaLoss : ℝ) (hδ : 0 Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (side : Bool) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (windows : Fin 7 → ℝ → ℂ) (C Γ E K ell B F M H U Z θ A₀ Vmax : ℝ) (N J : ℕ), 0≤C → 0≤Γ → 0≤E → 1≤U → 0 globalBinRadial ell (globalPooledRowScale K ell B F j) j FirstPassCubeLabels.firstLogDensity_nonneg 0 t) have hQ : 0≤Q := by have ht := globalTerminalConstant_nonneg A₀ Vmax have hB0 := zero_lt_one.trans_le hB have hF0 := zero_lt_one.trans_le hF dsimp [Q] unfold globalRayTripleConstant positivity have hrow (a : RayCharacter×RayCharacter) (r : FirstCoreIndex) : (∫t : ℝ,firstLogDensity 0 t)*globalChildBudget p hp hcop hg pool source (firstCoreTwist side (if side then a.1 else a.2) Ψ r) m windows (Γ*firstCoreUniformWeight r*C) ε 0 0 K ell B F M H (N+1) (2*J) side ≤ firstCoreUniformWeight r*Q := by have hcoeff : 0≤Γ*firstCoreUniformWeight r*C := by unfold firstCoreUniformWeight positivity have hk : ∀x∈source,x.source.frequency≠0 := fun x hx => globalQuantitativeSource_frequency_ne_zero p pool blocks K ell B F M H U side x hx have hb₁' : ∀x∈source,‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2≤B := fun x hx => hb₁ x.first.block (globalQuantitativeSource_block_mem p pool blocks K ell B F M H U side x hx) have hb₂' : ∀x∈source,‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2≤B := fun x hx => hb₂ x.first.block (globalQuantitativeSource_block_mem p pool blocks K ell B F M H U side x hx) have hr := hbound p hp hcop hg hc hinj pool source side (firstCoreTwist side (if side then a.1 else a.2) Ψ r) m windows (Γ*firstCoreUniformWeight r*C) E K ell B F M H U Z θ A₀ Vmax N J hcoeff hE hU hK hell hB hF hH hKU hellU hBU hHU heU hZ hA hV hV₁ hV₂ hVs₁ hVs₂ (fun u => (firstCoreTwist_norm_le side (if side then a.1 else a.2) Ψ r u).trans (hΨ u)) hk hb₁' hb₂' (he a r) exact (mul_le_mul_of_nonneg_left hr hI).trans_eq (by dsimp [Q]; ring) have hmass : (∑a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖)≤512 := by simpa only [Fintype.sum_prod_type] using RayFourExpansion.crossCoeff_sum_norm_le calc _ ≤ ∑a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖* ∑r : FirstCoreIndex,firstCoreUniformWeight r*Q := Finset.sum_le_sum (fun a _ => mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun r _ => hrow a r)) (norm_nonneg _)) _ = (∑a : RayCharacter×RayCharacter,‖crossCoeff a.1 a.2‖)* (∑r : FirstCoreIndex,firstCoreUniformWeight r)*Q := by simp only [←Finset.sum_mul,mul_assoc] _ ≤ (512*(512*32))*Q := mul_le_mul_of_nonneg_right (mul_le_mul hmass firstCoreUniformWeight_mass (Finset.sum_nonneg (fun r _ => by unfold firstCoreUniformWeight; positivity)) (by norm_num)) hQ _ = _ := by dsimp [Q]; ring theorem globalFirstQuantitativeBudget_canonical_bound (deltaLoss : ℝ) (hδ : 0 Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (side : Bool) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (windows : Fin 7 → ℝ → ℂ) (C Cd Ct Γ E K ell B F M H U Z θ A₀ Vmax : ℝ) (N J Ntail : ℕ), 0≤C → 0≤Γ → 0≤E → 1≤U → 0 globalBinRadial ell (globalPooledRowScale K ell B F j) jhp i))] rw [columnLog,Real.log_div (FirstPassCubeLabels.primeProductNorm_pos p hp S).ne' hX.ne'] rw [sub_eq_add_neg,FourierBridge.logPhase_add] exact mul_comm _ _ variable [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem canonicalSourceCoefficient_frequencyTwist (Ψ : ActualEisensteinCubic.O →* ℂ) (m f : ActualEisensteinCubic.O) (g : 𝓢(ℝ,ℂ)) (X t : ℝ) (hX : 0frequencyTwist g t (columnLog p X U)) S= logPhase t (-Real.log X)*canonicalSourceCoefficient p hp hcop hg (normHeightTwist Ψ t) m f (fun U=>g (columnLog p X U)) S := by simp only [canonicalSourceCoefficient,JointLogSeparation.frequencyTwist_apply, logPhase_columnLog p hp X t hX S,normHeightTwist,MonoidHom.mul_apply] ring end SecondPassArithmetic section open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic open FourierBridge (logPhase) open FirstPassCubeLabels (columnLog) def secondSignedHeight (negative : Bool) (a b : ℝ) : ℝ := if negative then b-a else a-b variable {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀i,p i≠0) include hp in omit [DecidableEq ι] in theorem fixedSecondTest_normPhase (V : ℝ → ℂ) (X a b : ℝ) (hX : 0 simp only [secondSignedHeight,fixedSecondTest,JointLogSeparation.fixedColumnTest, Bool.false_eq_true,ite_false,ite_true,sub_self,hz,mul_one,star_mul, SecondPassIntegration.logPhase_conjugate,neg_sub] <;> rw [logPhase_columnLog p hp X _ hX S] ; ring variable [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem fixedChildRow_secondTest_normPhase (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f y : ActualEisensteinCubic.O) (V : ℝ → ℂ) (X a b : ℝ) (hX : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem childEnergy_normHeight (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (T : Finset (Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O)) (V : ℝ → ℂ) (X a b : ℝ) (hX : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem densityChildEnergy_normHeight_polynomial (pool : Finset ι) (Ψ₁ Ψ₂ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (T : Finset (Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O)) (V₁ V₂ : ℝ → ℂ) (X₁ X₂ t₁ t₂ B₁ B₂ : ℝ) (J : ℕ) (hX₁ : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem reopenedCanonicalRow_frequencyTwist (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (β : (ι→₀ℕ)→ℂ) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (g : 𝓢(ℝ,ℂ)) (X t : ℝ) (hX : 0frequencyTwist g t (columnLog p X S)) z= logPhase t (-Real.log X)*reopenedCanonicalRow p hp hcop hg pool Q β (normHeightTwist Ψ t) m f (fun S=>g (columnLog p X S)) z := by unfold reopenedCanonicalRow simp_rw [canonicalSourceCoefficient_frequencyTwist p hp hcop hg Ψ m f g X t hX, Finset.mul_sum] apply Finset.sum_congr rfl intro v hv apply Finset.sum_congr rfl intro S hS ring theorem reopenedCanonicalRow_frequencyTwist_norm (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (β : (ι→₀ℕ)→ℂ) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (g : 𝓢(ℝ,ℂ)) (X t : ℝ) (hX : 0frequencyTwist g t (columnLog p X S)) z‖= ‖reopenedCanonicalRow p hp hcop hg pool Q β (normHeightTwist Ψ t) m f (fun S=>g (columnLog p X S)) z‖ := by rw [reopenedCanonicalRow_frequencyTwist p hp hcop hg pool Q β Ψ m f z g X t hX, norm_mul,FourierBridge.logPhase_norm,one_mul] theorem reopenedSource_frequencyTwist (hinj : Function.Injective (fun i=>Ideal.span {p i})) (hpr : ∀i,lambda^2∣p i-1) (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (hQ : ∀v∈Q,v.support⊆pool) (labels : Finset (Ideal ActualEisensteinCubic.O)) (β : Ideal ActualEisensteinCubic.O→(ι→₀ℕ)→ℂ) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (g W : 𝓢(ℝ,ℂ)) (K X t : ℝ) (hK : 0Ideal.span {p i})) (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (_hc:∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hpr:∀i,lambda^2∣p i-1) (pool:Finset ι) (Q:Finset (ι→₀ℕ)) (labels:Finset (Ideal ActualEisensteinCubic.O)) (β:Ideal ActualEisensteinCubic.O→(ι→₀ℕ)→ℂ) (Ψ:ActualEisensteinCubic.O→*ℂ) (m:ActualEisensteinCubic.O) (Γ t Ksrc K ell B F H U:ℝ), 0≤Γ → 0frequencyTwist g t (columnLog p ell S)) z‖^2:ℝ))- canonicalSourceZero p hp hcop hg pool bs labels a Ψt Ψt m m g g W Ksrc ell- canonicalSourceTail p hp hcop hg pool bs labels a Ψt Ψt m m g g W Ksrc K ell)‖≤ (Ksrc/K)*Cfirst*(globalFirstRowCap K ell B F)^deltaLoss* Real.sqrt (globalFirstQuantitativeBudget p hp hcop hg pool (canonicalSourceBlocks pool bs) Ψt m windows₁ C₁ Cd₁ Ct₁ (Γ^2) ε K ell B F M H U A J N true)* Real.sqrt (globalFirstQuantitativeBudget p hp hcop hg pool (canonicalSourceBlocks pool bs) Ψt m windows₂ C₂ Cd₂ Ct₂ (Γ^2) ε K ell B F M H U A J N false) := by obtain ⟨windows₁,windows₂,Cfirst,C₁,Cd₁,Ct₁,C₂,Cd₂,Ct₂,hCf,hC₁,hCd₁,hCt₁,hC₂,hCd₂,hCt₂, hw₁,hs₁,hb₁,hw₂,hs₂,hb₂,htransfer⟩:= canonicalSource_twoPassage_quantitative W g g V V M M Nv Nv hM hM hNv hNv hgM hgM hV hV hWin hWin ε deltaLoss hε hδ A J N refine ⟨windows₁,windows₂,Cfirst,C₁,Cd₁,Ct₁,C₂,Cd₂,Ct₂,hCf,hC₁,hCd₁,hCt₁,hC₂,hCd₂,hCt₂, hw₁,hs₁,hb₁,hw₂,hs₂,hb₂,?_⟩ intro ι _ p hp _ hinj hcop hg hc hpr pool Q labels β Ψ m Γ t Ksrc K ell B F H U hΓ hKsrc hK hell hB hF hH hU hMU hΨ hβ hQ hQB hsf hf dsimp only rw [reopenedCanonicalRow_smoothed_eq_source p hp hcop hg hinj hpr pool Q hQ labels β Ψ m (frequencyTwist g t) W Ksrc ell hKsrc, reopenedSource_frequencyTwist p hp hcop hg hinj hpr pool Q hQ labels β Ψ m g W Ksrc ell t hKsrc hell] have hΨt : ∀u,‖normHeightTwist Ψ t u‖≤1 := fun u=>(normHeightTwist_norm_le Ψ t u).trans (hΨ u) exact htransfer p hp hinj hcop hg hc hpr pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) (normHeightTwist Ψ t) (normHeightTwist Ψ t) m m (Γ^2) Ksrc K ell B F H U (sq_nonneg Γ) hKsrc hK hell hB hF hH hU hMU hMU hΨt hΨt (fun b hb C hC I hI=>reopenedPairCoefficient_bound Q labels β Γ hΓ hβ b hb C I hI) (reopenedCubeFamily_admissible Q) (fun b hb=>(reopenedCubeFamily_cube_norms p Q B hQB b hb).1) (fun b hb=>(reopenedCubeFamily_cube_norms p Q B hQB b hb).2) hsf hf end SecondPassArithmetic open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform ContDiff namespace CanonicalCubeSeparation open FourierBridge JointLogSeparation FirstPassCubeLabels def columnWindowRadius (a b : ℝ) : ℝ := |Real.log a| + |Real.log b| + 3 def sourceLogProfile (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) : 𝓢(ℝ,ℂ) := by have hc : HasCompactSupport (fun u : ℝ => W (Real.exp u)) := by apply HasCompactSupport.of_support_subset_isCompact (K := Set.Icc (Real.log a) (Real.log b)) isCompact_Icc intro u hu have hm := hs hu constructor · simpa only [Real.log_exp] using Real.log_le_log ha hm.1 · simpa only [Real.log_exp] using Real.log_le_log (Real.exp_pos u) hm.2 exact hc.toSchwartzMap (hW.comp Real.contDiff_exp) def reopeningCoefficient (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) : 𝓢(ℝ,ℂ) := 𝓕 (sourceLogProfile W a b ha hs hW) def cubeFrequencyFactor (t ξ : ℝ) : ℂ := (Real.exp (t/2) : ℂ) * logPhase ξ (3*t) lemma cubeFrequencyFactor_norm (t ξ : ℝ) : ‖cubeFrequencyFactor t ξ‖ = Real.exp (t/2) := by simp only [cubeFrequencyFactor, norm_mul, logPhase_norm, mul_one, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] lemma cubeFrequencyFactor_bound (t ξ : ℝ) (ht : t ≤ 1) : ‖cubeFrequencyFactor t ξ‖ ≤ Real.exp (1/2) := by rw [cubeFrequencyFactor_norm] exact Real.exp_le_exp.mpr (by linarith) lemma active_column_window (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (t u : ℝ) (ht : t ∈ Set.Icc (0:ℝ) 1) (hWu : W (Real.exp (u+3*t)) ≠ 0) : |u| ≤ columnWindowRadius a b := by have hab := hs hWu have hlo : Real.log a ≤ u+3*t := by simpa only [Real.log_exp] using Real.log_le_log ha hab.1 have hhi : u+3*t ≤ Real.log b := by simpa only [Real.log_exp] using Real.log_le_log (Real.exp_pos _) hab.2 unfold columnWindowRadius rw [abs_le] constructor <;> linarith [neg_abs_le (Real.log a), le_abs_self (Real.log b), abs_nonneg (Real.log a), abs_nonneg (Real.log b), ht.1, ht.2] lemma reopening_integrable (b V : 𝓢(ℝ,ℂ)) (t u : ℝ) : Integrable (fun ξ : ℝ => b ξ * cubeFrequencyFactor t ξ * frequencyTwist V ξ u) := by have hi : Integrable (fun ξ : ℝ => b ξ * ((Real.exp (t/2) : ℂ) * logPhase ξ (3*t) * (logPhase ξ u * V u))) := by apply b.integrable.mul_bdd (c := Real.exp (t/2) * ‖V u‖) · exact (((logPhase_continuous_left (3*t)).const_mul _).mul ((logPhase_continuous_left u).mul_const _)).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun ξ => by simp only [norm_mul, logPhase_norm, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _), one_mul, mul_one, le_refl]) convert hi using 1 funext ξ rw [frequencyTwist_apply] unfold cubeFrequencyFactor ring theorem reopening_separation_with_window (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) (V : 𝓢(ℝ,ℂ)) (hV : ∀ u, |u| ≤ columnWindowRadius a b → V u = 1) (t u : ℝ) (ht : t ∈ Set.Icc (0:ℝ) 1) : (Real.exp (t/2) : ℂ) * W (Real.exp (u+3*t)) = ∫ ξ : ℝ, reopeningCoefficient W a b ha hs hW ξ * cubeFrequencyFactor t ξ * frequencyTwist V ξ u := by have hwindow : V u * W (Real.exp (u+3*t)) = W (Real.exp (u+3*t)) := by by_cases hz : W (Real.exp (u+3*t)) = 0 · simp [hz] · rw [hV u (active_column_window W a b ha hs t u ht hz), one_mul] have hinv := schwartz_phase_inversion (sourceLogProfile W a b ha hs hW) (u+3*t) change W (Real.exp (u+3*t)) = ∫ ξ : ℝ, logPhase ξ (u+3*t) * reopeningCoefficient W a b ha hs hW ξ at hinv calc _ = ((Real.exp (t/2) : ℂ) * V u) * W (Real.exp (u+3*t)) := by rw [mul_assoc, hwindow] _ = ∫ ξ : ℝ, ((Real.exp (t/2) : ℂ) * V u) * (logPhase ξ (u+3*t) * reopeningCoefficient W a b ha hs hW ξ) := by rw [hinv, integral_const_mul] _ = _ := by apply integral_congr_ae filter_upwards [] with ξ rw [logPhase_add, frequencyTwist_apply] unfold cubeFrequencyFactor ring end CanonicalCubeSeparation end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.LogSeparation namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CanonicalCubeSeparation open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform ContDiff open FourierBridge JointLogSeparation lemma cube_log_bin (B n : ℝ) (hB : 0 < B) (hn : B ≤ n) (hn' : n ≤ Real.exp 1 * B) : Real.log (n/B) ∈ Set.Icc (0:ℝ) 1 := by have hn0 : 0 < n := lt_of_lt_of_le hB hn constructor · exact Real.log_nonneg ((le_div_iff₀ hB).mpr (by simpa using hn)) · have hh : n/B ≤ Real.exp 1 := (div_le_iff₀ hB).mpr hn' have := Real.log_le_log (div_pos hn0 hB) hh simpa only [Real.log_exp] using this lemma cube_log_argument (B ell n q : ℝ) (hB : 0 < B) (hell : 0 < ell) (hn : 0 < n) (hq : 0 < q) : Real.exp (Real.log (q/ell) + 3*Real.log (n/B)) = q*n^3/(B^3*ell) := by rw [Real.exp_add, Real.exp_log (div_pos hq hell)] have he : Real.exp (3*Real.log (n/B)) = (n/B)^3 := by rw [show (3:ℝ)*Real.log (n/B) = Real.log (n/B)+Real.log (n/B)+Real.log (n/B) by ring] rw [Real.exp_add, Real.exp_add, Real.exp_log (div_pos hn hB)] ring rw [he] field_simp lemma cube_half_normalization (B ell n : ℝ) (hB : 0 < B) (hell : 0 < ell) (hn : 0 < n) : (Real.sqrt (B^3*ell))⁻¹ * Real.sqrt n = (B*Real.sqrt ell)⁻¹ * Real.exp (Real.log (n/B)/2) := by have hb0 := (Real.sqrt_pos.mpr hB).ne' have he0 := (Real.sqrt_pos.mpr hell).ne' have hs : Real.sqrt (B^3*ell) = B*Real.sqrt B*Real.sqrt ell := by rw [show B^3*ell=B^2*(B*ell) by ring, Real.sqrt_mul (sq_nonneg B), Real.sqrt_sq hB.le, Real.sqrt_mul hB.le] ring have hnexp : Real.exp (Real.log (n/B)/2) = Real.sqrt n/Real.sqrt B := by rw [← sqrt_exp_half, Real.exp_log (div_pos hn hB), Real.sqrt_div hn.le] rw [hs, hnexp] field_simp lemma cube_half_normalization_complex (B ell n : ℝ) (hB : 0 < B) (hell : 0 < ell) (hn : 0 < n) : (Real.sqrt (B^3*ell) : ℂ)⁻¹ * (Real.sqrt n : ℂ) = ((B*Real.sqrt ell : ℝ) : ℂ)⁻¹ * (Real.exp (Real.log (n/B)/2) : ℂ) := by exact_mod_cast cube_half_normalization B ell n hB hell hn lemma completed_cube_half_weight (X n : ℝ) (hX : 0 < X) (hn : 0 < n) : n⁻¹ * (Real.sqrt (X/n^3))⁻¹ = (Real.sqrt X)⁻¹ * Real.sqrt n := by have hs : Real.sqrt (n^3) = n*Real.sqrt n := by rw [show n^3=n^2*n by ring, Real.sqrt_mul (sq_nonneg n), Real.sqrt_sq hn.le] rw [Real.sqrt_div hX.le, hs, inv_div] field_simp lemma completed_cube_half_weight_complex (X n : ℝ) (hX : 0 < X) (hn : 0 < n) : (n : ℂ)⁻¹ * (Real.sqrt (X/n^3) : ℂ)⁻¹ = (Real.sqrt X : ℂ)⁻¹ * (Real.sqrt n : ℂ) := by exact_mod_cast completed_cube_half_weight X n hX hn theorem completed_cube_norm_separation (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) (V : 𝓢(ℝ,ℂ)) (hV : ∀ u, |u| ≤ columnWindowRadius a b → V u = 1) (B ell X n q : ℝ) (hB : 0 < B) (hell : 0 < ell) (hX : X = B^3*ell) (hn : B ≤ n) (hn' : n ≤ Real.exp 1*B) (hq : 0 < q) : (n : ℂ)⁻¹ * (Real.sqrt (X/n^3) : ℂ)⁻¹ * W (q/(X/n^3)) = ((B*Real.sqrt ell : ℝ) : ℂ)⁻¹ * ∫ ξ : ℝ, reopeningCoefficient W a b ha hs hW ξ * cubeFrequencyFactor (Real.log (n/B)) ξ * frequencyTwist V ξ (Real.log (q/ell)) := by have hXp : 0 < X := hX ▸ mul_pos (pow_pos hB _) hell rw [completed_cube_half_weight_complex X n hXp (lt_of_lt_of_le hB hn), div_div_eq_mul_div] exact (by have hn0 : 0 < n := lt_of_lt_of_le hB hn have hsep := reopening_separation_with_window W a b ha hs hW V hV (Real.log (n/B)) (Real.log (q/ell)) (cube_log_bin B n hB hn hn') rw [cube_log_argument B ell n q hB hell hn0 hq] at hsep rw [hX, cube_half_normalization_complex B ell n hB hell hn0, mul_assoc, hsep] ) def separatedCubeCoefficient {κ : Type*} (β : κ → ℂ) (n : κ → ℝ) (B ξ : ℝ) (v : κ) : ℂ := β v * cubeFrequencyFactor (Real.log (n v/B)) ξ lemma separatedCubeCoefficient_bound {κ : Type*} (β : κ → ℂ) (n : κ → ℝ) (B ξ Γ : ℝ) (hB : 0 < B) (hΓ : 0 ≤ Γ) (v : κ) (hn : B ≤ n v) (hn' : n v ≤ Real.exp 1*B) (hβ : ‖β v‖ ≤ Γ) : ‖separatedCubeCoefficient β n B ξ v‖ ≤ Γ*Real.exp (1/2) := by unfold separatedCubeCoefficient rw [norm_mul] exact mul_le_mul hβ (cubeFrequencyFactor_bound _ ξ (cube_log_bin B _ hB hn hn').2) (norm_nonneg _) hΓ theorem reopening_finite_sum_integrable {κ τ : Type*} (Q : Finset κ) (S : Finset τ) (β : κ → ℂ) (A : κ → τ → ℂ) (n : κ → ℝ) (q : τ → ℝ) (B ell : ℝ) (b V : 𝓢(ℝ,ℂ)) : Integrable (fun ξ : ℝ => b ξ * ∑v∈Q,∑j∈S, separatedCubeCoefficient β n B ξ v * A v j * frequencyTwist V ξ (Real.log (q j/ell))) := by have hi : Integrable (fun ξ : ℝ => ∑v∈Q,∑j∈S, (β v*A v j)*(b ξ*cubeFrequencyFactor (Real.log (n v/B)) ξ* frequencyTwist V ξ (Real.log (q j/ell)))) := by apply integrable_finsetSum intro v hv apply integrable_finsetSum intro j hj exact (reopening_integrable b V _ _).const_mul _ convert hi using 1 funext ξ simp only [Finset.mul_sum, separatedCubeCoefficient] apply Finset.sum_congr rfl intro v hv apply Finset.sum_congr rfl intro j hj ring theorem reopening_finite_sum {κ τ : Type*} (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) (V : 𝓢(ℝ,ℂ)) (hV : ∀ u, |u| ≤ columnWindowRadius a b → V u = 1) (Q : Finset κ) (S : Finset τ) (β : κ → ℂ) (A : κ → τ → ℂ) (n : κ → ℝ) (q : τ → ℝ) (B ell X : ℝ) (hB : 0 < B) (hell : 0 < ell) (hX : X = B^3*ell) (hn : ∀v∈Q,B ≤ n v) (hn' : ∀v∈Q,n v ≤ Real.exp 1*B) (hq : ∀j∈S,0 < q j) : (∑v∈Q,∑j∈S, (β v*A v j)* ((n v : ℂ)⁻¹ * (Real.sqrt (X/(n v)^3) : ℂ)⁻¹ * W (q j/(X/(n v)^3)))) = ((B*Real.sqrt ell : ℝ) : ℂ)⁻¹ * ∫ ξ : ℝ, reopeningCoefficient W a b ha hs hW ξ * ∑v∈Q,∑j∈S, separatedCubeCoefficient β n B ξ v * A v j * frequencyTwist V ξ (Real.log (q j/ell)) := by let G : ℝ → κ → τ → ℂ := fun ξ v j => (β v*A v j)* (reopeningCoefficient W a b ha hs hW ξ * cubeFrequencyFactor (Real.log (n v/B)) ξ * frequencyTwist V ξ (Real.log (q j/ell))) have hi (v : κ) (j : τ) : Integrable (fun ξ => G ξ v j) := (reopening_integrable _ V _ _).const_mul _ have hterm (v : κ) (hv : v∈Q) (j : τ) (hj : j∈S) : (β v*A v j)*((n v : ℂ)⁻¹ * (Real.sqrt (X/(n v)^3) : ℂ)⁻¹ * W (q j/(X/(n v)^3))) = ((B*Real.sqrt ell : ℝ) : ℂ)⁻¹ * ∫ ξ : ℝ,G ξ v j := by rw [completed_cube_norm_separation W a b ha hs hW V hV B ell X (n v) (q j) hB hell hX (hn v hv) (hn' v hv) (hq j hj)] rw [show (∫ ξ : ℝ,G ξ v j) = (β v*A v j)*∫ ξ : ℝ, reopeningCoefficient W a b ha hs hW ξ * cubeFrequencyFactor (Real.log (n v/B)) ξ * frequencyTwist V ξ (Real.log (q j/ell)) from integral_const_mul _ _] ring calc _ = ((B*Real.sqrt ell : ℝ) : ℂ)⁻¹ * ∑v∈Q,∑j∈S,∫ ξ : ℝ,G ξ v j := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro v hv rw [Finset.mul_sum] exact Finset.sum_congr rfl (fun j hj => hterm v hv j hj) _ = ((B*Real.sqrt ell : ℝ) : ℂ)⁻¹ * ∫ ξ : ℝ,∑v∈Q,∑j∈S,G ξ v j := by congr 1 rw [integral_finsetSum _ (fun v hv => integrable_finsetSum _ (fun j hj => hi v j))] apply Finset.sum_congr rfl intro v hv exact (integral_finsetSum _ (fun j hj => hi v j)).symm _ = _ := by congr 1 apply integral_congr_ae filter_upwards [] with ξ simp only [Finset.mul_sum, separatedCubeCoefficient] apply Finset.sum_congr rfl intro v hv apply Finset.sum_congr rfl intro j hj dsimp [G] ring end CanonicalCubeSeparation open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight theorem rowTwist_primary_zero_of_mask (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) {P B : Ideal ActualEisensteinCubic.O} (hP : Prime P) (hPB : P∣B) (hm : m∈P) : rowTwist Ψ m f z (primaryGenerator B) = 0 := by have hx : m^6*f^4*z∈P := by have hm6 : m^6∈P := by rw [show m^6=m^5*m by ring] exact P.mul_mem_left (m^5) hm exact P.mul_mem_right z (P.mul_mem_right (f^4) hm6) by_cases hg : primaryGenerator B=0 · rw [hg] change Ψ 0 * idealRowHom _ (Ideal.span {(0:ActualEisensteinCubic.O)}) = 0 rw [Ideal.span_singleton_zero] change Ψ 0 * idealRowHom _ (0:Ideal ActualEisensteinCubic.O) = 0 rw [map_zero (idealRowHom _),mul_zero] · change Ψ (primaryGenerator B) * idealRowHom _ (Ideal.span {primaryGenerator B}) = 0 rw [(primaryGenerator_spec B hg).1,idealRowHom_zero_of_dvd _ hP hPB hx,mul_zero] theorem cubeWeight_zero_of_prime_mask (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) {P B : Ideal ActualEisensteinCubic.O} (hP : Prime P) (hPB : P∣B) (hm : m∈P) : cubeWeight (rowTwist Ψ m f z) B = 0 := cubeWeight_zero_of_mask _ B (rowTwist_primary_zero_of_mask Ψ m f z hP hPB hm) theorem summand_cube_support (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hSp : ∀P∈S,Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (hm : ∀P∈S,m∈P) (W : ℝ → ℂ) (b X : ℝ) (hX : 0hn (by rw [h,summand_zero_left]) have hB : B≠0 := fun h=>hn (by rw [h,summand_zero_right]) have hw : W ((Ideal.absNorm I:ℝ)*(Ideal.absNorm B:ℝ)^3/X)≠0 := fun h=>hn (summand_zero_window _ W X I B h) have hsize := (div_le_iff₀ hX).mp (hW _ hw) have hb := (triple_scale_bounds (Ideal.absNorm I:ℝ) (Ideal.absNorm B:ℝ) 1 (norm_at_least_one I hI) (norm_at_least_one B hB) (by norm_num)).2.1 simp only [one_pow,mul_one] at hb apply mem_outsideIdealsUpTo.mpr refine ⟨?_,?_,?_⟩ · exact Nat.one_le_iff_ne_zero.mpr (fun h=>hB (Ideal.absNorm_eq_zero_iff.mp h)) · exact_mod_cast (hb.trans hsize).trans hD · intro P hP hPB have hz := cubeWeight_zero_of_prime_mask Ψ m f z (hSp P hP) hPB (hm P hP) exact hn (by simp only [summand,hz,mul_zero,zero_mul]) theorem large_cube_sum_comm (Ψ : ActualEisensteinCubic.O →* ℂ) (W : ℝ → ℂ) (hW : HasCompactSupport W) (X H₀ : ℝ) (hX : 0largeCubeCoefficient H₀ p.2*summand Ψ W X p.1 p.2 have hf : (Function.support a).Finite := (completedT_finite_support Ψ W hW X hX).subset (by intro p hp exact fun h=>hp (by simp only [a,h,mul_zero])) have hs : Summable a := summable_of_hasFiniteSupport hf let e := Equiv.prodComm (Ideal ActualEisensteinCubic.O) (Ideal ActualEisensteinCubic.O) have ht : Summable (fun p=>a (e p)) := e.summable_iff.mpr hs calc _ = ∑'p:Ideal ActualEisensteinCubic.O×Ideal ActualEisensteinCubic.O,a p := hs.tsum_prod.symm _ = ∑'p:Ideal ActualEisensteinCubic.O×Ideal ActualEisensteinCubic.O,a (e p) := (e.tsum_eq a).symm _ = _ := ht.tsum_prod theorem large_cube_sum_finite (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hSp : ∀P∈S,Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (hm : ∀P∈S,m∈P) (W : ℝ → ℂ) (hWc : HasCompactSupport W) (b X H₀ : ℝ) (hX : 0P.mul_mem_left m (excludedGenerator_mem S hP)) W hWc b X H₀ hX hW hD] congr 1 apply Finset.sum_congr rfl intro B hB have hB0 : B≠0 := outsideIdealsUpTo_ne_bot S D B hB have hN := norm_at_least_one B hB0 have hY : 0 < X/(Ideal.absNorm B:ℝ)^3 := by positivity have hYX : X/(Ideal.absNorm B:ℝ)^3 ≤ X := div_le_self hX.le (one_le_pow₀ hN) have hDY : b*(X/(Ideal.absNorm B:ℝ)^3) ≤ D := (mul_le_mul_of_nonneg_left hYX hb).trans hD rw [inner_completed_sum _ W X hX B hB0] rw [←outsideCanonicalRow_eq_global S D hbad hSp Ψ m f z W b (X/(Ideal.absNorm B:ℝ)^3) hY hW hDY] rw [cubeWeight_row_factor] ring theorem outsideCanonicalRow_reopened_exponents (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀P∈S,Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (hWc : HasCompactSupport W) (b X H₀ : ℝ) (hb : 0 ≤ b) (hX : 0 simpa only [Bool.false_eq_true,ite_false,ite_true,neg_inj] using hz theorem childLabelRotation_norm (u : ActualEisensteinCubic.Oˣ) (negative : Bool) (z : Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O) : ‖eisEmbedding (childLabelRotation u negative z).2‖^2=‖eisEmbedding z.2‖^2 := by cases negative <;> simp only [childLabelRotation,Bool.false_eq_true,ite_false,ite_true, map_mul,norm_mul,map_pow,norm_pow,GaussGeneratorTransport.norm_eisEmbedding_unit, one_pow,one_mul,map_neg,norm_neg] theorem childLabelRotation_ne_zero (u : ActualEisensteinCubic.Oˣ) (negative : Bool) (z : Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O) (hz : z.2≠0) : (childLabelRotation u negative z).2≠0 := by apply mul_ne_zero (pow_ne_zero 4 u.ne_zero) cases negative <;> simpa using hz section variable {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem fixedChildRow_label_mul (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (H : Finset ι → ℂ) (u f z : ActualEisensteinCubic.O) : fixedChildRow p hp hcop hg pool Ψ m H (u*f) z= fixedChildRow p hp hcop hg pool Ψ m H f (u^4*z) := by unfold fixedChildRow apply Finset.sum_congr rfl intro S hS simp only [secondChildColumn,finiteSquarefreeRow_mul,row_pow,mul_pow] ring theorem idealChildRow_eq_rotated (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (H : Finset ι → ℂ) (negative : Bool) (u : ActualEisensteinCubic.Oˣ) (z : Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O) : idealChildRow p hp hcop hg pool Ψ m H negative u z= fixedChildRow p hp hcop hg pool Ψ m H (ConcretePrimeRowBridge.idealGenerator (childLabelRotation u negative z).1) (childLabelRotation u negative z).2 := by exact fixedChildRow_label_mul p hp hcop hg pool Ψ m H (u : ActualEisensteinCubic.O) _ _ def canonicalSmoothedEnergy (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (H : Finset ι → ℂ) (K : ℝ) : ℝ := (∑I∈labels,nonzeroRowMajorantSum (fixedChildRow p hp hcop hg pool Ψ m H (ConcretePrimeRowBridge.idealGenerator I)) K).re theorem idealChildRow_energy_le_canonical (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (H : Finset ι → ℂ) (negative : Bool) (u : ActualEisensteinCubic.Oˣ) (T : Finset (Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O)) (labels : Finset (Ideal ActualEisensteinCubic.O)) (K : ℝ) (hK : 0 ‖fixedChildRow p hp hcop hg pool Ψ m H (ConcretePrimeRowBridge.idealGenerator z.1) z.2‖^2 let R := (firstFrequencyDisk K).erase 0 have hsub : T.image (childLabelRotation u negative)⊆labels.product R := by intro w hw obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hw apply Finset.mem_product.mpr refine ⟨hlabels z hz,Finset.mem_erase.mpr ⟨childLabelRotation_ne_zero u negative z (hzero z hz),?_⟩⟩ apply (mem_firstFrequencyDisk K _).mpr rw [childLabelRotation_norm] exact hrows z hz calc _ = ∑w∈T.image (childLabelRotation u negative),f w := by rw [Finset.sum_image] · apply Finset.sum_congr rfl intro z hz rw [idealChildRow_eq_rotated] · exact fun _ _ _ _ he=>childLabelRotation_injective u negative he _ ≤ ∑w∈labels.product R,f w := Finset.sum_le_sum_of_subset_of_nonneg hsub (fun _ _ _=>sq_nonneg _) _ = ∑I∈labels,∑z∈R,f (I,z) := by rw [Finset.product_eq_sprod,Finset.sum_product] _ ≤ ∑I∈labels,(nonzeroRowMajorantSum (fixedChildRow p hp hcop hg pool Ψ m H (ConcretePrimeRowBridge.idealGenerator I)) K).re := by apply Finset.sum_le_sum intro I hI apply finite_nonzero_row_energy_le_majorant _ R K hK · intro z hz rw [←eisEmbedding_norm_sq_eq_absNorm_span] exact (mem_firstFrequencyDisk K z).mp (Finset.mem_erase.mp hz).2 · exact fun z hz=>(Finset.mem_erase.mp hz).1 _ = _ := by unfold canonicalSmoothedEnergy; rw [Complex.re_sum] def canonicalLogEnergy (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (V : ℝ → ℂ) (X K : ℝ) : ℝ := canonicalSmoothedEnergy p hp hcop hg pool Ψ m labels (fun S=>V (columnLog p X S)) K end def orientedLogProfile (negative : Bool) (V : ℝ → ℂ) : ℝ → ℂ := if negative then fun s=>star (V s) else V theorem fixedSecondTest_zero_profile {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (V : ℝ → ℂ) (X : ℝ) (negative : Bool) : fixedSecondTest p V X 0 0 negative=(fun S=>orientedLogProfile negative V (columnLog p X S)) := by funext S cases negative <;> simp [fixedSecondTest,orientedLogProfile,JointLogSeparation.fixedColumnTest,FourierBridge.logPhase] end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.PolynomialHeight namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CanonicalRowCompletion open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalCubeSeparation theorem outside_separated_cube_coefficient_bound (ε : ℝ) (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (Ψ : ActualEisensteinCubic.O →* ℂ), (∀ z, ‖Ψ z‖ ≤ 1) → ∀ (m f : ActualEisensteinCubic.O) (H₀ B ξ : ℝ) (v : primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ), 0 < B → B ≤ (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) → (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) ≤ Real.exp 1*B → ‖separatedCubeCoefficient (fun u => reopenedCubeCoefficient H₀ (rowTwist Ψ (m*excludedGenerator S) f 1) (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) u)) (fun u => (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) u) : ℝ)) B ξ v‖ ≤ C*(Real.exp 1*B)^ε := by obtain ⟨C,hC,hbound⟩ := reopenedCubeCoefficient_small_power ε hε refine ⟨C*Real.exp (1/2),mul_pos hC (Real.exp_pos _),?_⟩ intro S D Ψ hΨ m f H₀ B ξ v hB hn hn' let F := InitialMeanSquare.outsideSquarefreeIdeals S D have ht : ∀ z, ‖rowTwist Ψ (m*excludedGenerator S) f 1 z‖ ≤ 1 := rowTwist_norm Ψ hΨ (m*excludedGenerator S) f 1 have hβ : ‖reopenedCubeCoefficient H₀ (rowTwist Ψ (m*excludedGenerator S) f 1) (cubeIdeal F v)‖ ≤ C*(Real.exp 1*B)^ε := by apply (hbound H₀ _ ht _ (cubeIdeal_ne_zero F v)).trans exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (Nat.cast_nonneg _) hn' hε.le) hC.le have hh := separatedCubeCoefficient_bound (fun u => reopenedCubeCoefficient H₀ (rowTwist Ψ (m*excludedGenerator S) f 1) (cubeIdeal F u)) (fun u => (Ideal.absNorm (cubeIdeal F u) : ℝ)) B ξ (C*(Real.exp 1*B)^ε) hB (by positivity) v hn hn' hβ convert hh using 1 ; ring end CanonicalRowCompletion namespace CompletedHeight open MeasureTheory Filter Set open scoped BigOperators Classical SchwartzMap FourierTransform ContDiff Topology open FourierBridge JointLogSeparation def positiveCutoff (a b : ℝ) (ha : 0 < a) : ContDiffBump ((a+max a b)/2) where rIn := (max a b-a)/2+a/4 rOut := (max a b-a)/2+a/2 rIn_pos := by linarith [le_max_left a b] rIn_lt_rOut := by linarith lemma positiveCutoff_one (a b : ℝ) (ha : 0 < a) (x : ℝ) (hx : x∈Icc a b) : positiveCutoff a b ha x=1 := by apply (positiveCutoff a b ha).one_of_mem_closedBall change dist x ((a+max a b)/2) ≤ (max a b-a)/2+a/4 rw [Real.dist_eq,abs_le] constructor <;> linarith [hx.1,hx.2,le_max_right a b] lemma positiveCutoff_zero (a b : ℝ) (ha : 0 < a) (x : ℝ) (hx : x < a/2) : positiveCutoff a b ha x=0 := by by_contra hn have hm : x∈Function.support (positiveCutoff a b ha) := hn rw [(positiveCutoff a b ha).support_eq] at hm change dist x ((a+max a b)/2) < (max a b-a)/2+a/2 at hm rw [Real.dist_eq,abs_lt] at hm linarith [hm.1] def logCorrection (a b : ℝ) (ha : 0 < a) (x : ℝ) : ℝ := positiveCutoff a b ha x*(Real.log x-x) def patchedLog (a b : ℝ) (ha : 0 < a) (x : ℝ) : ℝ := x+logCorrection a b ha x lemma logCorrection_compact (a b : ℝ) (ha : 0 < a) : HasCompactSupport (logCorrection a b ha) := (positiveCutoff a b ha).hasCompactSupport.mul_right lemma logCorrection_smooth (a b : ℝ) (ha : 0 < a) : ContDiff ℝ ∞ (logCorrection a b ha) := by rw [contDiff_iff_contDiffAt] intro x by_cases hx : x=0 · subst x have he : logCorrection a b ha =ᶠ[𝓝 (0:ℝ)] (fun _=>0) := by filter_upwards [isOpen_Iio.mem_nhds (by linarith : (0:ℝ) (2:ℝ)^z.2*(1+2*Real.pi)^z.2*derivativeSeminormSum g z.1 z.2 let C := 1+∑z∈S,c z have hc : ∀z,0≤c z := fun z => by dsimp [c]; exact mul_nonneg (by positivity) (derivativeSeminormSum_nonneg _ _ _) have hC : 0 hc z); linarith refine ⟨n,C,hC,?_⟩ intro t apply Seminorm.finset_sup_apply_le (by positivity) intro z hz have hzC : c z≤C := by have hh := Finset.single_le_sum (fun z (_ : z∈S) => hc z) hz dsimp [C] linarith have hzn : z.2≤n := Finset.le_sup hz have hh := frequencyTwist_seminorm_polynomial g t z.1 z.2 exact hh.trans (mul_le_mul hzC (pow_le_pow_right₀ (by linarith [norm_nonneg t]) hzn) (by positivity) hC.le) theorem normTwistedSource_schwartz (W : 𝓢(ℝ,ℂ)) (a b : ℝ) (ha : 0 < a) (hs : Function.support (W : ℝ→ℂ) ⊆ Icc a b) : ∃ G : ℝ→𝓢(ℝ,ℂ), (∀t x,G t x=normTwistedSource W t x) ∧ (∀S : Finset (ℕ×ℕ), ∃n : ℕ, ∃C : ℝ, 0 sourceTwistCLM W a b ha (frequencyTwist V t) refine ⟨G,?_,?_⟩ · intro t x rw [show G t x=sourceTwistCLM W a b ha (frequencyTwist V t) x from rfl, sourceTwistCLM_apply,frequencyTwist_apply] by_cases hx : W x=0 · simp only [normTwistedSource,hx,zero_mul,mul_zero] · have hxi := hs hx rw [patchedLog_eq_log a b ha x hxi] have hlog : |Real.log x|≤M := by have hlo := Real.log_le_log ha hxi.1 have hhi := Real.log_le_log (lt_of_lt_of_le ha hxi.1) hxi.2 rw [abs_le] constructor <;> dsimp [M] <;> linarith [neg_abs_le (Real.log a),le_abs_self (Real.log b), abs_nonneg (Real.log a),abs_nonneg (Real.log b)] have hv : V (Real.log x)=1 := hvone _ hlog simp only [hv,mul_one,normTwistedSource] ring · intro S obtain ⟨s,C,hC,hcontrol⟩ := EisensteinSchwartzPoisson.schwartzCLM_finite_seminorm_control (sourceTwistCLM W a b ha) S obtain ⟨n,D,hD,hbound⟩ := frequencyTwist_finite_bound V s refine ⟨n,C*D,mul_pos hC hD,?_⟩ intro t exact (hcontrol _).trans ((mul_le_mul_of_nonneg_left (hbound t) hC.le).trans_eq (by ring)) end CompletedHeight namespace LocalLogFourier open MeasureTheory open scoped BigOperators Classical FourierTransform SchwartzMap ContDiff theorem coupled_positive_log_separation_linear_constant {ι : Type*} [Fintype ι] (W : ι → ℝ → ℂ) (a M : ι → ℝ) (hM : ∀ j, 0 ≤ M j) (hWwindow : ∀ j z, W j z ≠ 0 → |z| ≤ M j) (A J : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ (F : ℝ → ℂ), ContDiffOn ℝ ∞ F (Set.Ioi 0) → ∀ CF : ℝ, 0 ≤ CF → (∀ i ≤ J + (volume : Measure ℝ).integrablePower, ∀ x : ℝ, 0 < x → (1 + x)^A * ‖eulerDeriv F i x‖ ≤ CF) → ∀ R : ℝ, 0 < R → ∃ b : 𝓢(ℝ, ℂ), (∀ y : ι → ℝ, (∏ j : ι, W j (y j)) * F (R * Real.exp (∑ j : ι, a j * y j)) = ∫ t : ℝ, (∏ j : ι, W j (y j) * FourierBridge.logPhase t (a j * y j)) * b t) ∧ Integrable (fun t : ℝ => (1 + ‖t‖) ^ J * ‖b t‖) volume ∧ (1 + R) ^ A * (∫ t : ℝ, (1 + ‖t‖) ^ J * ‖b t‖) ≤ C * CF ∧ (∀ t : ℝ, (1 + R) ^ A * (1 + ‖t‖) ^ J * ‖b t‖ ≤ C * CF) := by classical let T : ℝ := ∑ j : ι, |a j| * M j have hT : 0 ≤ T := by dsimp [T] apply Finset.sum_nonneg intro j hj exact mul_nonneg (abs_nonneg _) (hM j) let K : ℕ := J + (volume : Measure ℝ).integrablePower let Lwin : ℝ := T + 1 let m : ℝ := Real.exp (-Lwin) have hL : 0 ≤ Lwin := by dsimp [Lwin]; linarith have hm : 0 < m := Real.exp_pos _ have hm1 : m ≤ 1 := by dsimp [m] simpa using (Real.exp_le_exp.mpr (show -Lwin ≤ 0 by linarith)) obtain ⟨V, CW, hVc, hVs, hVone, hCW, hVderiv, hwindow⟩ := FourierBridge.exists_complex_smooth_cutoff_with_derivative_bounds T K hT let P₀ : ℝ := momentConstant K Lwin CW 1 let B₀ : ℝ := (2 : ℝ)^J * (FourierBridge.coefficientMomentBound 0 P₀ + FourierBridge.coefficientMomentBound J P₀) let D₀ : ℝ := FourierBridge.fourierPointBound J P₀ let C₀ : ℝ := (B₀+D₀)/m^A have hP₀ : 0 ≤ P₀ := momentConstant_nonneg K Lwin CW 1 hL hCW zero_le_one have hB₀ : 0 ≤ B₀ := by dsimp [B₀] exact mul_nonneg (by positivity) (add_nonneg (FourierBridge.coefficientMomentBound_nonneg 0 P₀ hP₀) (FourierBridge.coefficientMomentBound_nonneg J P₀ hP₀)) have hD₀ : 0 ≤ D₀ := FourierBridge.fourierPointBound_nonneg J P₀ hP₀ refine ⟨C₀,by dsimp [C₀]; positivity,?_⟩ intro F hFpos CF hCF hEuler let P : ℝ := momentConstant K Lwin CW CF let B : ℝ := (2 : ℝ)^J * (FourierBridge.coefficientMomentBound 0 P + FourierBridge.coefficientMomentBound J P) let Bpoint : ℝ := FourierBridge.fourierPointBound J P have hP : 0 ≤ P := momentConstant_nonneg K Lwin CW CF hL hCW hCF have hPeq : P=P₀*CF := by dsimp [P,P₀] unfold momentConstant derivativeConstant simp only [Finset.sum_mul,Finset.mul_sum,mul_one] apply Finset.sum_congr rfl intro n hn apply Finset.sum_congr rfl intro i hi ring have hBeq : B=B₀*CF := by dsimp [B,B₀] rw [hPeq] unfold FourierBridge.coefficientMomentBound ring have hBpeq : Bpoint=D₀*CF := by dsimp [Bpoint,D₀] rw [hPeq] unfold FourierBridge.fourierPointBound FourierBridge.fourierSeminormBound ring intro R hR let b : 𝓢(ℝ, ℂ) := 𝓕 (positiveLogProfile V F R hVc hVs hFpos hR) refine ⟨b, ?_, ?_, ?_, ?_⟩ · intro y have hactive : (∏ j : ι, W j (y j)) ≠ 0 → V (∑ j : ι, a j * y j) = 1 := FourierBridge.coupled_cutoff_active W V a y M hWwindow (by simpa [T] using hVone) simpa [b] using coupled_positive_log_separation W F V R a y hVc hVs hFpos hR hactive · exact AnalyticBridge.schwartz_fourier_one_plus_integrable (positiveLogProfile V F R hVc hVs hFpos hR) J · have hwindow' : ∀ s, (∃ i ≤ K, ‖iteratedFDeriv ℝ i V s‖ ≠ 0) → m ≤ Real.exp s ∧ |s| ≤ Lwin := by intro s hs exact ⟨(hwindow s hs).1, (hwindow s hs).2.2⟩ have hbound := positive_log_fourier_bound V F R m Lwin CW CF A J hVc hVs hFpos hR hm hm1 hL hCW hCF (by simpa [K] using hVderiv) (by simpa only [K] using hwindow') (by simpa [K] using hEuler) have hb : (1 + R) ^ A * (∫ t : ℝ, (1 + ‖t‖) ^ J * ‖b t‖) ≤ B / m ^ A := by simpa [B, P, b, K, Lwin, m] using hbound apply hb.trans rw [hBeq] dsimp [C₀] have hh := mul_le_mul_of_nonneg_right (le_add_of_nonneg_right hD₀ : B₀≤B₀+D₀) hCF exact (div_le_div_of_nonneg_right hh (by positivity)).trans_eq (by ring) · intro t let g := positiveLogProfile V F R hVc hVs hFpos hR have hwindow' : ∀ s, (∃ i ≤ K, ‖iteratedFDeriv ℝ i V s‖ ≠ 0) → m ≤ Real.exp s ∧ |s| ≤ Lwin := by intro s hs exact ⟨(hwindow s hs).1, (hwindow s hs).2.2⟩ have hsource (n : ℕ) (hn : n ≤ J) : (m ^ A * (1 + R) ^ A) * ((SchwartzMap.seminorm ℝ 0 n) g + (SchwartzMap.seminorm ℝ (volume : Measure ℝ).integrablePower n) g) ≤ P := by apply positive_log_source_pair V F R m Lwin CW CF P A K n hVc hVs hFpos hR hm hm1 hL hCW hCF · dsimp [K]; omega · exact hVderiv · exact hwindow' · exact hEuler · intro i hi exact momentConstant_dominates K i Lwin CW CF hL hCW hCF hi have hpoint := FourierBridge.uniform_fourier_pointwise g J (m ^ A * (1 + R) ^ A) P (by positivity) hP hsource t have hb : (1 + R) ^ A * (1 + ‖t‖) ^ J * ‖b t‖ ≤ Bpoint / m ^ A := by apply (le_div_iff₀ (pow_pos hm A)).mpr simpa only [g, b, Bpoint, mul_assoc, mul_left_comm, mul_comm] using hpoint apply hb.trans rw [hBpeq] dsimp [C₀] have hh := mul_le_mul_of_nonneg_right (le_add_of_nonneg_left hB₀ : D₀≤B₀+D₀) hCF exact (div_le_div_of_nonneg_right hh (by positivity)).trans_eq (by ring) end LocalLogFourier namespace CompletedHeight open MeasureTheory open scoped BigOperators Classical SchwartzMap FourierTransform ContDiff open CompletedGauss def HasPolynomialKernel (P : ℝ→ℝ→ℂ) : Prop := (∀t,ContDiffOn ℝ ∞ (CubicReflectionKernel.paperKernel (Vstar (P t))) (Set.Ioi 0)) ∧ ∀ A K : ℕ,∃n : ℕ,∃C : ℝ,0positiveRadialProfile_support V A hV x hx) theorem positiveRadialProfile_smooth (V : ℝ → ℂ) (hVs : ContDiff ℝ ∞ V) (A : ℝ) (hV : ∀s,V s≠0→|s|≤A) : ContDiff ℝ ∞ (positiveRadialProfile V) := by apply contDiff_iff_contDiffAt.mpr intro x by_cases hpos : 0V (Real.log y)) := by filter_upwards [Ioi_mem_nhds hpos] with y hy change 00) := by filter_upwards [Iio_mem_nhds hx] with y hy by_contra hn have hb := (positiveRadialProfile_support V A hV y hn).1 exact (not_le_of_gt hy) hb exact (contDiffAt_const (c:=(0:ℂ))).congr_of_eventuallyEq he def radialFromLog (V : ℝ → ℂ) (hVs : ContDiff ℝ ∞ V) (A : ℝ) (hV : ∀s,V s≠0→|s|≤A) : 𝓢(ℝ,ℂ) := (positiveRadialProfile_compact V A hV).toSchwartzMap (positiveRadialProfile_smooth V hVs A hV) theorem radialFromLog_apply_pos (V : ℝ → ℂ) (hVs : ContDiff ℝ ∞ V) (A : ℝ) (hV : ∀s,V s≠0→|s|≤A) (x : ℝ) (hx : 0 let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace ⟨fun q => ρ i q • f.1 q,(ρ i).contMDiff.smul f.2.1, HasCompactSupport.smul_left (f := fun q => ρ i q) (f' := f.1) f.2.2⟩ lemma kernelTestPartitionTerm_tsupport {ι : Type*} {S : Set KernelQuotient} : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (ρ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; SmoothPartitionOfUnity ι 𝓘(ℝ,SpatialCoordinates) KernelQuotient S) (f : kernelSmoothTests) (i : ι), tsupport (kernelTestPartitionTerm ρ f i).1⊆tsupport (ρ i) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (ρ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; SmoothPartitionOfUnity ι 𝓘(ℝ,SpatialCoordinates) KernelQuotient S) (f : kernelSmoothTests) (i : ι) => let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace tsupport_smul_subset_left _ _ lemma kernelTestPartition_sum {ι : Type*} [Fintype ι] (f : kernelSmoothTests) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (ρ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; SmoothPartitionOfUnity ι 𝓘(ℝ,SpatialCoordinates) KernelQuotient (tsupport f.1)), ∑i,kernelTestPartitionTerm ρ f i=f := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (ρ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; SmoothPartitionOfUnity ι 𝓘(ℝ,SpatialCoordinates) KernelQuotient (tsupport f.1)) => by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace apply Subtype.ext funext q simp only [Submodule.coe_sum,Finset.sum_apply,kernelTestPartitionTerm] rw [←Finset.sum_smul] by_cases hq : q∈tsupport f.1 · have hs := ρ.sum_eq_one hq rw [finsum_eq_sum_of_fintype] at hs rw [hs,one_smul] · have hz : f.1 q=0 := image_eq_zero_of_notMem_tsupport hq rw [hz,smul_zero] end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff SchwartzMap LineDeriv namespace CubicEisenstein def kernelFullCutoffFun (χ : PositiveChartCutoff) (p : EuclideanSpatial) : ℝ := Real.smoothTransition (4*χ.func p-1) lemma kernelFullCutoffFun_smooth (χ : PositiveChartCutoff) : ContDiff ℝ ∞ (kernelFullCutoffFun χ) := Real.smoothTransition.contDiff.comp ((contDiff_const.mul χ.smooth).sub contDiff_const) lemma kernelFullCutoffFun_tsupport (χ : PositiveChartCutoff) : tsupport (kernelFullCutoffFun χ)⊆tsupport χ.func := by apply closure_mono intro p hp change kernelFullCutoffFun χ p≠0 at hp change χ.func p≠0 intro hz apply hp simp only [kernelFullCutoffFun,hz,mul_zero,zero_sub] exact Real.smoothTransition.zero_of_nonpos (by norm_num) lemma kernelFullCutoffFun_compact (χ : PositiveChartCutoff) : HasCompactSupport (kernelFullCutoffFun χ) := χ.compact.of_isClosed_subset (isClosed_tsupport _) (kernelFullCutoffFun_tsupport χ) def kernelFullCutoff (χ : PositiveChartCutoff) : PositiveChartCutoff where func := kernelFullCutoffFun χ smooth := kernelFullCutoffFun_smooth χ compact := kernelFullCutoffFun_compact χ positive := (kernelFullCutoffFun_tsupport χ).trans χ.positive lemma kernelFullCutoff_one (χ : PositiveChartCutoff) (p : EuclideanSpatial) (hp : p∈kernelChartCore χ) : (kernelFullCutoff χ).func p=1 := by apply Real.smoothTransition.one_of_one_le change (1/2 : ℝ)<χ.func p at hp linarith lemma kernelFullCutoff_eventually_one (χ : PositiveChartCutoff) (p : EuclideanSpatial) (hp : p∈kernelChartCore χ) : (kernelFullCutoff χ).func =ᶠ[𝓝 p] fun _ => 1 := by filter_upwards [(kernelChartCore_open χ).mem_nhds hp] with q hq exact kernelFullCutoff_one χ q hq def kernelCoreLift (χ : PositiveChartCutoff) (f : kernelSmoothTests) : 𝓢(EuclideanSpatial,ℂ) := kernelLocalizedSchwartz (kernelFullCutoff χ) f lemma kernelCoreLift_eventually_eq (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : p∈kernelChartCore χ) : (kernelCoreLift χ f : EuclideanSpatial→ℂ)=ᶠ[𝓝 p] kernelTestField f := by filter_upwards [kernelFullCutoff_eventually_one χ p hp] with q hq change (kernelFullCutoff χ).func q • kernelTestField f q=kernelTestField f q rw [hq,one_smul] lemma kernelCoreLift_tsupport_outer (χ : PositiveChartCutoff) (f : kernelSmoothTests) : tsupport (kernelCoreLift χ f)⊆tsupport χ.func := (kernelLocalizedField_tsupport (kernelFullCutoff χ) f).trans (kernelFullCutoffFun_tsupport χ) lemma kernelCoreLift_tsupport (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f : kernelSmoothTests) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf : tsupport f.1⊆kernelChartCoreImage χ), tsupport (kernelCoreLift χ f)⊆kernelChartCore χ := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hf : tsupport f.1⊆kernelChartCoreImage χ) => by let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace intro p hp have houter := kernelCoreLift_tsupport_outer χ f hp by_contra hn have hfp : kernelEuclideanProjection p∉tsupport f.1 := by intro hfp obtain ⟨q,hq,heq⟩ := hf hfp have hqp := hinj (kernelChartCore_subset χ hq) houter heq exact hn (hqp ▸ hq) have hc : ContinuousAt kernelEuclideanProjection p := (continuous_integralOrbitProjection globalKubotaKernel).continuousAt.comp (euclideanToHyperbolic_contMDiffAt p (χ.positive houter)).continuousAt have hz := (notMem_tsupport_iff_eventuallyEq.mp hfp).comp_tendsto hc have hzero : (kernelCoreLift χ f : EuclideanSpatial→ℂ)=ᶠ[𝓝 p] 0 := by filter_upwards [hz] with q hq change (kernelFullCutoff χ).func q • f.1 (kernelEuclideanProjection q)=0 change f.1 (kernelEuclideanProjection q)=0 at hq rw [hq,smul_zero] exact (notMem_tsupport_iff_eventuallyEq.mpr hzero) hp lemma kernelCoreLift_eq_on_outer (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f : kernelSmoothTests) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf : tsupport f.1⊆kernelChartCoreImage χ), Set.EqOn (kernelCoreLift χ f) (kernelTestField f) (tsupport χ.func) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hf : tsupport f.1⊆kernelChartCoreImage χ) => by intro p hp by_cases hc : p∈kernelChartCore χ · exact (kernelCoreLift_eventually_eq χ f p hc).self_of_nhds · have hz : kernelTestField f p=0 := by change f.1 (kernelEuclideanProjection p)=0 apply image_eq_zero_of_notMem_tsupport intro hfp obtain ⟨q,hq,heq⟩ := hf hfp have hqp := hinj (kernelChartCore_subset χ hq) hp heq exact hc (hqp ▸ hq) change (kernelFullCutoff χ).func p • kernelTestField f p=kernelTestField f p rw [hz,smul_zero] def euclideanHeightCLM : EuclideanSpatial→L[ℝ]ℂ := Complex.ofRealCLM.comp (PiLp.proj 2 (fun _ : Fin 3 => ℝ) 2) lemma euclideanHeightCLM_apply (p : EuclideanSpatial) : euclideanHeightCLM p=(p 2:ℂ) := rfl lemma upperHeightDivide_smooth (f : 𝓢(EuclideanSpatial,ℂ)) (hpos : tsupport f⊆euclideanUpperHalf) : ContDiff ℝ ∞ (fun p : EuclideanSpatial => f p/(p 2:ℂ)) := by rw [contDiff_iff_contDiffAt] intro p by_cases hp : p 2=0 · have hn : p∉tsupport f := by intro hf have hh := hpos hf change 0

(0 : ℂ)) p).congr_of_eventuallyEq filter_upwards [hz] with q hq simp only [hq,Pi.zero_apply,zero_div] · simpa only [div_eq_mul_inv,Pi.inv_apply,euclideanHeightCLM_apply] using (f.smooth ⊤).contDiffAt.mul (euclideanHeightCLM.contDiff.contDiffAt.fun_inv (Complex.ofReal_ne_zero.mpr hp)) lemma upperHeightDivide_compact (f : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) : HasCompactSupport (fun p : EuclideanSpatial => f p/(p 2:ℂ)) := by rw [hasCompactSupport_iff_eventuallyEq] at hcompact ⊢ exact hcompact.mono (fun p hp => by simp only [hp,Pi.zero_apply,zero_div]) def upperHeightDivide (f : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) (hpos : tsupport f⊆euclideanUpperHalf) : 𝓢(EuclideanSpatial,ℂ) := (upperHeightDivide_compact f hcompact).toSchwartzMap (upperHeightDivide_smooth f hpos) lemma upperHeightDivide_apply (f : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) (hpos : tsupport f⊆euclideanUpperHalf) (p : EuclideanSpatial) : upperHeightDivide f hcompact hpos p=f p/(p 2:ℂ) := rfl lemma upperHeightDivide_tsupport (f : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) (hpos : tsupport f⊆euclideanUpperHalf) : tsupport (upperHeightDivide f hcompact hpos)⊆tsupport f := by apply closure_mono intro p hp change f p/(p 2:ℂ)≠0 at hp change f p≠0 exact fun hz => hp (by rw [hz,zero_div]) lemma upperHeightDivide_lineDeriv (f : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) (hpos : tsupport f⊆euclideanUpperHalf) (p u : EuclideanSpatial) (hp : p 2≠0) : (∂_{u} (upperHeightDivide f hcompact hpos)) p= ((∂_{u} f) p*(p 2:ℂ)-f p*(u 2:ℂ))/(p 2:ℂ)^2 := by have hf := (f.hasFDerivAt p).hasLineDerivAt u have hv := (euclideanHeightCLM.hasFDerivAt (x := p)).hasLineDerivAt u change HasDerivAt (fun t : ℝ => f (p+t•u)) ((∂_{u} f) p) 0 at hf change HasDerivAt (fun t : ℝ => ((p+t•u) 2:ℂ)) (u 2:ℂ) 0 at hv have hd := hf.div hv (by simpa using Complex.ofReal_ne_zero.mpr hp) have hline : HasLineDerivAt ℝ (upperHeightDivide f hcompact hpos) (((∂_{u} f) p*(p 2:ℂ)-f p*(u 2:ℂ))/(p 2:ℂ)^2) p u := by simpa only [HasLineDerivAt,upperHeightDivide_apply,Pi.div_apply,zero_smul,add_zero] using! hd exact ((upperHeightDivide f hcompact hpos).hasFDerivAt p).hasLineDerivAt u |>.unique hline lemma upperSchwartz_derivative_compact (f : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) (u : EuclideanSpatial) : HasCompactSupport (∂_{u} f : 𝓢(EuclideanSpatial,ℂ)) := hcompact.fderiv_apply ℝ u def upperWeightedPartial (f : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) (hpos : tsupport f⊆euclideanUpperHalf) (j : Fin 3) : 𝓢(EuclideanSpatial,ℂ) := upperHeightDivide (∂_{euclideanCoordinateVector j} f) (upperSchwartz_derivative_compact f hcompact _) ((SchwartzMap.tsupport_lineDerivOp_subset _ f).trans hpos) def upperWeightedDivergence (f : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) (hpos : tsupport f⊆euclideanUpperHalf) : 𝓢(EuclideanSpatial,ℂ) := -∑j : Fin 3,∂_{euclideanCoordinateVector j} (upperWeightedPartial f hcompact hpos j) def complexHermitianBilin : ℂ→L[ℝ]ℂ→L[ℝ]ℂ := (ContinuousLinearMap.mul ℝ ℂ).comp Complex.conjCLE.toContinuousLinearMap lemma schwartz_hermitian_integrable (f g : 𝓢(EuclideanSpatial,ℂ)) : Integrable (fun p => star (f p)*g p) volume := (SchwartzMap.bilinLeftCLM complexHermitianBilin g.hasTemperateGrowth f).integrable lemma schwartz_hermitian_lineGreen (f g : 𝓢(EuclideanSpatial,ℂ)) (u : EuclideanSpatial) : (∫p,star (f p)*(∂_{u} g) p)=-∫p,star ((∂_{u} f) p)*g p := SchwartzMap.integral_bilinear_lineDerivOp_right_eq_neg_left f g complexHermitianBilin u lemma upperWeighted_green (f g : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) (hpos : tsupport f⊆euclideanUpperHalf) : (∫p,∑j : Fin 3,star (upperWeightedPartial f hcompact hpos j p)* (∂_{euclideanCoordinateVector j} g) p)= ∫p,star (upperWeightedDivergence f hcompact hpos p)*g p := by calc _ = ∑j : Fin 3,∫p,star (upperWeightedPartial f hcompact hpos j p)* (∂_{euclideanCoordinateVector j} g) p := integral_finsetSum _ (fun j hj => schwartz_hermitian_integrable _ _) _ = -∑j : Fin 3,∫p,star ((∂_{euclideanCoordinateVector j} (upperWeightedPartial f hcompact hpos j)) p)*g p := by simp only [schwartz_hermitian_lineGreen,Finset.sum_neg_distrib] _ = _ := by rw [←integral_finsetSum _ (fun j hj => schwartz_hermitian_integrable _ _),←integral_neg] apply integral_congr_ae exact Eventually.of_forall (fun p => by simp only [upperWeightedDivergence,_root_.neg_apply,_root_.sum_apply,star_neg,star_sum, Finset.sum_mul,neg_mul]) def upperPositiveLaplacian (f : 𝓢(EuclideanSpatial,ℂ)) (p : EuclideanSpatial) : ℂ := -(p 2:ℂ)^2*(∑j : Fin 3,(∂_{euclideanCoordinateVector j} (∂_{euclideanCoordinateVector j} f)) p)+ (p 2:ℂ)*(∂_{euclideanCoordinateVector 2} f) p lemma upperWeightedDivergence_apply_ne_zero (f : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) (hpos : tsupport f⊆euclideanUpperHalf) (p : EuclideanSpatial) (hp : p 2≠0) : upperWeightedDivergence f hcompact hpos p=upperPositiveLaplacian f p/(p 2:ℂ)^3 := by have hd (j : Fin 3) : (∂_{euclideanCoordinateVector j} (upperWeightedPartial f hcompact hpos j)) p= ((∂_{euclideanCoordinateVector j} (∂_{euclideanCoordinateVector j} f)) p*(p 2:ℂ)- (∂_{euclideanCoordinateVector j} f) p*(euclideanCoordinateVector j 2:ℂ))/(p 2:ℂ)^2 := upperHeightDivide_lineDeriv _ _ _ p _ hp simp only [upperWeightedDivergence,Fin.sum_univ_three,_root_.neg_apply,_root_.add_apply] rw [hd 0,hd 1,hd 2] simp only [upperPositiveLaplacian,Fin.sum_univ_three] simp [euclideanCoordinateVector] field_simp [Complex.ofReal_ne_zero.mpr hp] ring lemma upperWeightedDivergence_apply (f : 𝓢(EuclideanSpatial,ℂ)) (hcompact : HasCompactSupport f) (hpos : tsupport f⊆euclideanUpperHalf) (p : EuclideanSpatial) : upperWeightedDivergence f hcompact hpos p=upperPositiveLaplacian f p/(p 2:ℂ)^3 := by by_cases hp : p 2=0 · have hz : ∀j : Fin 3,(∂_{euclideanCoordinateVector j} (upperWeightedPartial f hcompact hpos j)) p=0 := by intro j have hn : p∉tsupport (upperWeightedPartial f hcompact hpos j) := by intro hm have ht := hpos ((SchwartzMap.tsupport_lineDerivOp_subset _ f) (upperHeightDivide_tsupport _ _ _ hm)) change 0

by have hm := kernelEuclideanProjection_measurePreserving_on S hS hpos hinj have hh := hg.mono_measure (Measure.restrict_le_self (s := kernelEuclideanProjection '' S)) rw [←hm.map_eq] at hh ⊢ exact (integral_map hm.measurable.aemeasurable hh).symm lemma hyperbolicEuclidean_setIntegral_complex (S : Set EuclideanSpatial) (hS : MeasurableSet S) (hpos : S⊆euclideanUpperHalf) (g : EuclideanSpatial→ℂ) : (∫p in S,g p∂hyperbolicEuclideanVolume)=∫p in S,g p/(p 2:ℂ)^3 := by rw [hyperbolicEuclideanVolume,MeasureTheory.restrict_withDensity hS, Measure.restrict_restrict hS,Set.inter_eq_left.mpr hpos, integral_withDensity_eq_integral_toReal_smul hyperbolicDensity_measurable (Eventually.of_forall (fun p => ENNReal.ofReal_lt_top))] apply integral_congr_ae filter_upwards [ae_restrict_mem hS] with p hp have hpositive : 0

by have hz : kernelQuotientEnergyDensity g q=0 := by by_contra hn exact hq (kernelQuotientEnergyDensity_support g hn) induction q using Quotient.inductionOn with | _ w => change kernelDirichletPairDensity f g (integralOrbitProjection globalKubotaKernel w)=0 rw [kernelDirichletPairDensity_coordinate] have hg : kernelGradientAt w g=0 := by apply norm_eq_zero.mp have h := kernelGradientAt_norm_sq w g change kernelTestEnergyDensity g w=0 at hz rw [hz] at h nlinarith [norm_nonneg (kernelGradientAt w g)] rw [hg,inner_zero_right] lemma kernelDirichletPairDensity_euclidean (f g : kernelSmoothTests) (p : EuclideanSpatial) (hp : 0

q 2) hc change kernelDirichletPairDensity f g (integralOrbitProjection globalKubotaKernel (euclideanToHyperbolic p))=_ rw [kernelDirichletPairDensity_coordinate,PiLp.inner_apply] change (∑j : Fin 3,inner ℂ ((hyperbolicHeight (euclideanToHyperbolic p):ℂ)*kernelTestPartial f (euclideanToHyperbolic p) j) ((hyperbolicHeight (euclideanToHyperbolic p):ℂ)*kernelTestPartial g (euclideanToHyperbolic p) j))=_ rw [hv,Finset.mul_sum] apply Finset.sum_congr rfl intro j hj simp only [kernelTestPartial,hc,←euclideanCoordinateVector_eq_basis,RCLike.inner_apply, map_mul,Complex.conj_ofReal,Complex.star_def] ring lemma kernelCoreLift_fderiv_eq_on_outer (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f : kernelSmoothTests) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf : tsupport f.1⊆kernelChartCoreImage χ) (p : EuclideanSpatial) (hp : p∈tsupport χ.func), fderiv ℝ (kernelCoreLift χ f) p=fderiv ℝ (kernelTestField f) p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hf : tsupport f.1⊆kernelChartCoreImage χ) (p : EuclideanSpatial) (hp : p∈tsupport χ.func) => by let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace by_cases hc : p∈kernelChartCore χ · exact (kernelCoreLift_eventually_eq χ f p hc).fderiv_eq · have hl : p∉tsupport (kernelCoreLift χ f) := fun h => hc (kernelCoreLift_tsupport χ hinj f hf h) have hfp : kernelEuclideanProjection p∉tsupport f.1 := by intro hfp obtain ⟨q,hq,heq⟩ := hf hfp exact hc ((hinj (kernelChartCore_subset χ hq) hp heq) ▸ hq) have hcont : ContinuousAt kernelEuclideanProjection p := (continuous_integralOrbitProjection globalKubotaKernel).continuousAt.comp (euclideanToHyperbolic_contMDiffAt p (χ.positive hp)).continuousAt have hz : kernelTestField f=ᶠ[𝓝 p]0 := (notMem_tsupport_iff_eventuallyEq.mp hfp).comp_tendsto hcont rw [fderiv_of_notMem_tsupport ℝ hl,hz.fderiv_eq,fderiv_zero] rfl lemma kernelCoreLift_pair_on_outer (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f g : kernelSmoothTests) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hg : tsupport g.1⊆kernelChartCoreImage χ) (p : EuclideanSpatial) (hp : p∈tsupport χ.func), kernelDirichletPairDensity f g (kernelEuclideanProjection p)= (p 2:ℂ)^2*∑j : Fin 3,star ((∂_{euclideanCoordinateVector j} (kernelCoreLift χ f)) p)* (∂_{euclideanCoordinateVector j} (kernelCoreLift χ g)) p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hg : tsupport g.1⊆kernelChartCoreImage χ) (p : EuclideanSpatial) (hp : p∈tsupport χ.func) => by rw [kernelDirichletPairDensity_euclidean f g p (χ.positive hp)] simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv] rw [←kernelCoreLift_fderiv_eq_on_outer χ hinj g hg p hp] by_cases hc : p∈kernelChartCore χ · rw [(kernelCoreLift_eventually_eq χ f p hc).fderiv_eq] · have hn : p∉tsupport (kernelCoreLift χ g) := fun h => hc (kernelCoreLift_tsupport χ hinj g hg h) rw [fderiv_of_notMem_tsupport ℝ hn] simp only [_root_.zero_apply,mul_zero,Finset.sum_const_zero] theorem kernelDirichletForm_eq_chart_pairing (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f g : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hg : tsupport g.1⊆kernelChartCoreImage χ), kernelDirichletForm f g= ∫p,∑j : Fin 3,star ((∂_{euclideanCoordinateVector j} (kernelCoreLift χ f)) p)* (∂_{euclideanCoordinateVector j} (kernelCoreLift χ g)) p/(p 2:ℂ) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hg : tsupport g.1⊆kernelChartCoreImage χ) => by let S := tsupport χ.func have hS : MeasurableSet S := χ.compact.measurableSet have himg : kernelChartCoreImage χ⊆kernelEuclideanProjection '' S := Set.image_mono (kernelChartCore_subset χ) calc _ = ∫q in kernelEuclideanProjection '' S,kernelDirichletPairDensity f g q ∂integralQuotientVolume globalKubotaKernel := by symm apply setIntegral_eq_integral_of_forall_compl_eq_zero intro q hq exact kernelDirichletPairDensity_zero_of_notMem f g q (fun h => hq (himg (hg h))) _ = ∫p in S,kernelDirichletPairDensity f g (kernelEuclideanProjection p) ∂hyperbolicEuclideanVolume := (kernelEuclideanProjection_integral_complex S hS χ.positive hinj _ (kernelDirichletPairDensity_integrable f g).aestronglyMeasurable).symm _ = ∫p in S,kernelDirichletPairDensity f g (kernelEuclideanProjection p)/(p 2:ℂ)^3 := hyperbolicEuclidean_setIntegral_complex S hS χ.positive _ _ = ∫p in S,∑j : Fin 3,star ((∂_{euclideanCoordinateVector j} (kernelCoreLift χ f)) p)* (∂_{euclideanCoordinateVector j} (kernelCoreLift χ g)) p/(p 2:ℂ) := by apply setIntegral_congr_fun hS intro p hp dsimp only rw [kernelCoreLift_pair_on_outer χ hinj f g hg p hp,←Finset.sum_div] have hv : (p 2:ℂ)≠0 := Complex.ofReal_ne_zero.mpr (χ.positive hp).ne' field_simp [hv] _ = _ := by apply setIntegral_eq_integral_of_forall_compl_eq_zero intro p hp have hn : p∉tsupport (kernelCoreLift χ g) := fun h => hp (kernelCoreLift_tsupport_outer χ g h) simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv,fderiv_of_notMem_tsupport ℝ hn, _root_.zero_apply,mul_zero,zero_div,Finset.sum_const_zero] theorem kernelDirichletForm_eq_chart_laplacian (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f g : kernelSmoothTests) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hg : tsupport g.1⊆kernelChartCoreImage χ), kernelDirichletForm f g= ∫p,star (upperPositiveLaplacian (kernelCoreLift χ f) p)*kernelCoreLift χ g p/(p 2:ℂ)^3 := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hg : tsupport g.1⊆kernelChartCoreImage χ) => by rw [kernelDirichletForm_eq_chart_pairing χ hinj f g hg] exact upperHyperbolic_green _ _ (kernelLocalizedField_compact (kernelFullCutoff χ) f) ((kernelCoreLift_tsupport_outer χ f).trans χ.positive) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.CanonicalLogEnergy namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic ConcreteTraceCRT variable {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem childEnergy_le_canonicalSmoothed (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (T : Finset (Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O)) (labels : Finset (Ideal ActualEisensteinCubic.O)) (V : ℝ → ℂ) (X K a b : ℝ) (hK : 0 Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem fixedChildRow_coefficient_expansion (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (H : Finset ι → ℂ) : fixedChildRow p hp hcop hg pool Ψ m H f z = ∑ T ∈ pool.powerset, canonicalSourceCoefficient p hp hcop hg Ψ m f (fun _ => 1) T * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg T z * H T := by unfold fixedChildRow apply Finset.sum_congr rfl intro T hT simp only [secondChildColumn, canonicalSourceCoefficient] ring theorem reopenedCanonicalRow_integrand (pool : Finset ι) (Q : Finset (ι →₀ ℕ)) (β : (ι →₀ ℕ) → ℂ) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (H : Finset ι → ℂ) : reopenedCanonicalRow p hp hcop hg pool Q β Ψ m f H z = ∑ v ∈ Q, ∑ T ∈ pool.powerset, β v * (multiplicityRow (fun i => Ideal.span {p i}) hg pool v z ^ 3 * canonicalSourceCoefficient p hp hcop hg Ψ m f (fun _ => 1) T * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg T z) * H T := by unfold reopenedCanonicalRow apply Finset.sum_congr rfl intro v hv apply Finset.sum_congr rfl intro T hT simp only [canonicalSourceCoefficient] ring theorem canonical_bin_separation (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) (V : 𝓢(ℝ,ℂ)) (hV : ∀ u, |u| ≤ columnWindowRadius a b → V u = 1) (pool : Finset ι) (Q : Finset (ι →₀ ℕ)) (β : (ι →₀ ℕ) → ℂ) (n : (ι →₀ ℕ) → ℝ) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (B ell X : ℝ) (hB : 0 < B) (hell : 0 < ell) (hX : X = B^3*ell) (hn : ∀ v ∈ Q, B ≤ n v) (hn' : ∀ v ∈ Q, n v ≤ Real.exp 1*B) : (∑ v ∈ Q, (β v * (n v : ℂ)⁻¹ * (Real.sqrt (X/(n v)^3) : ℂ)⁻¹) * multiplicityRow (fun i => Ideal.span {p i}) hg pool v z ^ 3 * fixedChildRow p hp hcop hg pool Ψ m (fun T => W (primeProductNorm p T/(X/(n v)^3))) f z) = ((B*Real.sqrt ell : ℝ) : ℂ)⁻¹ * ∫ ξ : ℝ, reopeningCoefficient W a b ha hs hW ξ * reopenedCanonicalRow p hp hcop hg pool Q (separatedCubeCoefficient β n B ξ) Ψ m f (fun T => frequencyTwist V ξ (columnLog p ell T)) z := by let A : (ι →₀ ℕ) → Finset ι → ℂ := fun v T => multiplicityRow (fun i => Ideal.span {p i}) hg pool v z ^ 3 * canonicalSourceCoefficient p hp hcop hg Ψ m f (fun _ => 1) T * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg T z have hsep := reopening_finite_sum W a b ha hs hW V hV Q pool.powerset β A n (primeProductNorm p) B ell X hB hell hX hn hn' (fun T _ => primeProductNorm_pos p hp T) calc _ = ∑ v ∈ Q, ∑ T ∈ pool.powerset, (β v * A v T) * ((n v : ℂ)⁻¹ * (Real.sqrt (X/(n v)^3) : ℂ)⁻¹ * W (primeProductNorm p T/(X/(n v)^3))) := by apply Finset.sum_congr rfl intro v hv rw [fixedChildRow_coefficient_expansion p hp hcop hg, Finset.mul_sum] apply Finset.sum_congr rfl intro T hT dsimp only [A] ring _ = _ := by rw [hsep] congr 1 apply integral_congr_ae filter_upwards [] with ξ rw [reopenedCanonicalRow_integrand p hp hcop hg] rfl end open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open FirstPassCubeLabels hiding O open CanonicalCubeSeparation JointLogSeparation theorem cube_coefficient_restore (H₀ : ℝ) (Ψ : ActualEisensteinCubic.O →* ℂ) (I : Ideal ActualEisensteinCubic.O) (hI : I ≠ 0) : reopenedCubeCoefficient H₀ Ψ I * (Ideal.absNorm I : ℂ)⁻¹ = largeCubeCoefficient H₀ I * cubeWeight Ψ I := by have hN : (Ideal.absNorm I : ℂ) ≠ 0 := by exact_mod_cast (ne_of_gt (lt_of_lt_of_le zero_lt_one (norm_at_least_one I hI))) unfold reopenedCubeCoefficient cubePhase field_simp theorem cubeIdeal_row (F : Finset (Ideal ActualEisensteinCubic.O)) (hF : ∀ I ∈ F, Admissible I) (v : primePool F →₀ ℕ) (z : ActualEisensteinCubic.O) : letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal letI : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance idealRowHom z (cubeIdeal F v) = multiplicityRow (fun i => Ideal.span {poolPrimary F i}) (poolPrimary_good F hF) Finset.univ v z := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance have hprod : cubeIdeal F v = ∏ i : primePool F, (Ideal.span {poolPrimary F i}) ^ v i := by unfold cubeIdeal exact Finset.prod_congr rfl (fun i _ => by rw [poolPrimary_span F hF i]) rw [hprod, idealRowHom_prime_powers] def outsideCanonicalBin (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (Q : Finset (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ)) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (X H₀ : ℝ) : ℂ := let F := InitialMeanSquare.outsideSquarefreeIdeals S D ∑ v ∈ Q, (largeCubeCoefficient H₀ (cubeIdeal F v) * cubeWeight (rowTwist Ψ (m*excludedGenerator S) f 1) (cubeIdeal F v) * (Real.sqrt (X/(Ideal.absNorm (cubeIdeal F v) : ℝ)^3) : ℂ)⁻¹) * idealRowHom z (cubeIdeal F v)^3 * outsideCanonicalRow S D hbad Ψ m f z W (X/(Ideal.absNorm (cubeIdeal F v) : ℝ)^3) theorem outsideCanonicalBin_separated (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (Q : Finset (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ)) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) (V : 𝓢(ℝ,ℂ)) (hV : ∀ u, |u| ≤ columnWindowRadius a b → V u = 1) (B ell X H₀ : ℝ) (hB : 0 < B) (hell : 0 < ell) (hX : X = B^3*ell) (hn : ∀ v ∈ Q, B ≤ (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ)) (hn' : ∀ v ∈ Q, (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) ≤ Real.exp 1*B) : letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F := InitialMeanSquare.outsideSquarefreeIdeals S D let hF := InitialMeanSquare.outsideSquarefree_admissible S D hbad letI : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance let β := fun v => reopenedCubeCoefficient H₀ (rowTwist Ψ (m*excludedGenerator S) f 1) (cubeIdeal F v) let n := fun v => (Ideal.absNorm (cubeIdeal F v) : ℝ) outsideCanonicalBin S D hbad Q Ψ m f z W X H₀ = ((B*Real.sqrt ell : ℝ) : ℂ)⁻¹ * ∫ ξ : ℝ, reopeningCoefficient W a b ha hs hW ξ * reopenedCanonicalRow (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Q (separatedCubeCoefficient β n B ξ) Ψ m f (fun T => frequencyTwist V ξ (columnLog (poolPrimary F) ell T)) z := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal dsimp only let F := InitialMeanSquare.outsideSquarefreeIdeals S D have hF := InitialMeanSquare.outsideSquarefree_admissible S D hbad let : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance let β := fun v => reopenedCubeCoefficient H₀ (rowTwist Ψ (m*excludedGenerator S) f 1) (cubeIdeal F v) let n := fun v => (Ideal.absNorm (cubeIdeal F v) : ℝ) rw [← canonical_bin_separation (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) W a b ha hs hW V hV Finset.univ Q β n Ψ m f z B ell X hB hell hX hn hn'] unfold outsideCanonicalBin dsimp only apply Finset.sum_congr rfl intro v hv rw [cubeIdeal_row F hF v z] have hc := cube_coefficient_restore H₀ (rowTwist Ψ (m*excludedGenerator S) f 1) (cubeIdeal F v) (cubeIdeal_ne_zero F v) change _ = (β v * (n v : ℂ)⁻¹ * _) * _ * _ have hc' : β v * (n v : ℂ)⁻¹ = largeCubeCoefficient H₀ (cubeIdeal F v) * cubeWeight (rowTwist Ψ (m*excludedGenerator S) f 1) (cubeIdeal F v) := by simpa only [β,n,Complex.ofReal_natCast] using hc rw [hc'] rfl end section open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open FirstPassCubeLabels hiding O theorem fixedChildRow_zero_of_subunit {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (b X : ℝ) (hX : 0 < X) (hW : ∀ t, W t ≠ 0 → t ≤ b) (hsub : b*X < 1) : fixedChildRow p hp hcop hg pool Ψ m (fun T => W (primeProductNorm p T/X)) f z = 0 := by unfold fixedChildRow apply Finset.sum_eq_zero intro T hT have hw : W (primeProductNorm p T/X) = 0 := by by_contra hne have hh := (div_le_iff₀ hX).mp (hW _ hne) have hone := primeProductNorm_ge_one p hp T linarith simp only [secondChildColumn,hw,mul_zero] theorem outsideCanonicalRow_zero_of_subunit (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (b X : ℝ) (hX : 0 < X) (hW : ∀ t, W t ≠ 0 → t ≤ b) (hsub : b*X < 1) : outsideCanonicalRow S D hbad Ψ m f z W X = 0 := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F := InitialMeanSquare.outsideSquarefreeIdeals S D have hF := InitialMeanSquare.outsideSquarefree_admissible S D hbad let : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance unfold outsideCanonicalRow dsimp only exact fixedChildRow_zero_of_subunit _ _ _ _ _ Ψ m f z W b X hX hW hsub def activeCubeExponents (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (b X : ℝ) : Finset (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ) := let F := InitialMeanSquare.outsideSquarefreeIdeals S D ((outsideIdealsUpTo S D).image (cubeIndex F)).filter (fun v => (Ideal.absNorm (cubeIdeal F v) : ℝ)^3 ≤ b*X) theorem outsideCanonicalBin_eq_active (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (b X H₀ : ℝ) (hX : 0 < X) (hW : ∀ t, W t ≠ 0 → t ≤ b) : outsideCanonicalBin S D hbad ((outsideIdealsUpTo S D).image (cubeIndex (InitialMeanSquare.outsideSquarefreeIdeals S D))) Ψ m f z W X H₀ = outsideCanonicalBin S D hbad (activeCubeExponents S D b X) Ψ m f z W X H₀ := by unfold outsideCanonicalBin activeCubeExponents dsimp only symm apply Finset.sum_subset (Finset.filter_subset _ _) intro v hv hn have hlarge : b*X < (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ)^3 := by exact lt_of_not_ge (fun hh => hn (Finset.mem_filter.mpr ⟨hv,hh⟩)) have hN : 0 < (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) := lt_of_lt_of_le zero_lt_one (norm_at_least_one _ (cubeIdeal_ne_zero _ v)) have hsub : b*(X/(Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ)^3) < 1 := by rw [← mul_div_assoc] exact (div_lt_one (pow_pos hN _)).mpr hlarge rw [outsideCanonicalRow_zero_of_subunit S D hbad Ψ m f z W b _ (div_pos hX (pow_pos hN _)) hW hsub,mul_zero] theorem outsideCanonicalRow_reopened_active (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀ P ∈ S, Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (hWc : HasCompactSupport W) (b X H₀ : ℝ) (hb : 0 ≤ b) (hX : 0 < X) (hW : ∀ t, W t ≠ 0 → t ≤ b) (hD : b*X ≤ D) : (Real.sqrt X : ℂ)⁻¹ * outsideCanonicalRow S D hbad Ψ m f z W X = shortCompletedSum (rowTwist Ψ (m*excludedGenerator S) f z) W X H₀ + outsideCanonicalBin S D hbad (activeCubeExponents S D b X) Ψ m f z W X H₀ := by have hh := outsideCanonicalRow_reopened_exponents S D hbad hSp Ψ m f z W hWc b X H₀ hb hX hW hD change _ = _ + outsideCanonicalBin S D hbad ((outsideIdealsUpTo S D).image (cubeIndex (InitialMeanSquare.outsideSquarefreeIdeals S D))) Ψ m f z W X H₀ at hh rwa [outsideCanonicalBin_eq_active S D hbad Ψ m f z W b X H₀ hX hW] at hh theorem activeCubeExponents_norm_bound (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (b X : ℝ) (v : primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ) (hv : v ∈ activeCubeExponents S D b X) : (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) ≤ max 1 (b*X) := by have hcube := (Finset.mem_filter.mp hv).2 have hN := norm_at_least_one _ (cubeIdeal_ne_zero (InitialMeanSquare.outsideSquarefreeIdeals S D) v) let n := (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) have hone : 1 ≤ n := hN have hnn : n ≤ n^3 := by nlinarith [mul_nonneg (sub_nonneg.mpr hone) (show 0 ≤ n^2+n by positivity)] exact (hnn.trans hcube).trans (le_max_right _ _) end open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O def cubeLogIndex (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (v : primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ) : ℕ := normLogBin (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) def cubeLogRange (b X : ℝ) : Finset ℕ := Finset.range (normLogBin (max 1 (b*X)) + 1) def activeCubeLogBin (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (b X : ℝ) (j : ℕ) : Finset (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ) := (activeCubeExponents S D b X).filter (fun v => cubeLogIndex S D v = j) theorem activeCubeLogIndex_mem (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (b X : ℝ) (v : primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ) (hv : v ∈ activeCubeExponents S D b X) : cubeLogIndex S D v ∈ cubeLogRange b X := by apply Finset.mem_range.mpr apply Nat.lt_succ_of_le exact normLogBin_mono (lt_of_lt_of_le zero_lt_one (norm_at_least_one _ (cubeIdeal_ne_zero _ v))) (activeCubeExponents_norm_bound S D b X v hv) theorem activeCubeLogBin_norms (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (b X : ℝ) (j : ℕ) (v : primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ) (hv : v ∈ activeCubeLogBin S D b X j) : normLogScale j ≤ (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) ∧ (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) ≤ Real.exp 1*normLogScale j := by have hj := (Finset.mem_filter.mp hv).2 rw [← hj] have hh := normLogBin_scale_bounds (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) (norm_at_least_one _ (cubeIdeal_ne_zero _ v)) exact ⟨hh.1,by simpa only [mul_comm,cubeLogIndex] using hh.2⟩ theorem cubeLogRange_card (b X : ℝ) : (cubeLogRange b X).card = normLogBin (max 1 (b*X)) + 1 := by exact Finset.card_range _ theorem sum_activeCubeLogBins {M : Type*} [AddCommMonoid M] (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (b X : ℝ) (a : (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ) → M) : (∑ v ∈ activeCubeExponents S D b X, a v) = ∑ j ∈ cubeLogRange b X, ∑ v ∈ activeCubeLogBin S D b X j, a v := by symm exact Finset.sum_fiberwise_of_maps_to (fun v hv => activeCubeLogIndex_mem S D b X v hv) a theorem outsideCanonicalBin_log_bins (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (b X H₀ : ℝ) : outsideCanonicalBin S D hbad (activeCubeExponents S D b X) Ψ m f z W X H₀ = ∑ j ∈ cubeLogRange b X, outsideCanonicalBin S D hbad (activeCubeLogBin S D b X j) Ψ m f z W X H₀ := by unfold outsideCanonicalBin dsimp only exact sum_activeCubeLogBins S D b X _ theorem outsideCanonicalRow_reopened_binned (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀ P ∈ S, Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (hWc : HasCompactSupport W) (b X H₀ : ℝ) (hb : 0 ≤ b) (hX : 0 < X) (hW : ∀ t, W t ≠ 0 → t ≤ b) (hD : b*X ≤ D) : (Real.sqrt X : ℂ)⁻¹ * outsideCanonicalRow S D hbad Ψ m f z W X = shortCompletedSum (rowTwist Ψ (m*excludedGenerator S) f z) W X H₀ + ∑ j ∈ cubeLogRange b X, outsideCanonicalBin S D hbad (activeCubeLogBin S D b X j) Ψ m f z W X H₀ := by rw [outsideCanonicalRow_reopened_active S D hbad hSp Ψ m f z W hWc b X H₀ hb hX hW hD, outsideCanonicalBin_log_bins] end CanonicalRowCompletion open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open FirstPassCubeLabels theorem nonzeroRowMajorantSum_exact_disk (P : ActualEisensteinCubic.O → ℂ) (K : ℝ) (hK : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem canonicalSmoothedEnergy_uniform_row_bound (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (H : Finset ι → ℂ) (F K D : ℝ) (hF : 1≤F) (hK : 1≤K) (_hD : 0≤D) (hI0 : ∀I∈labels,I≠⊥) (hIF : ∀I∈labels,(Ideal.absNorm I:ℝ)≤F) (hrow : ∀I∈labels,∀z,‖fixedChildRow p hp hcop hg pool Ψ m H (ConcretePrimeRowBridge.idealGenerator I) z‖≤D) : canonicalSmoothedEnergy p hp hcop hg pool Ψ m labels H K≤ 2*128^2*SchwartzMap.seminorm ℝ 0 0 rowMajorant*F*K*D^2 := by have hK0 : 0(mem_firstFrequencyDisk (2*K) z).mp (Finset.mem_erase.mp hz).2 have hI : (labels.card:ℝ)≤128*F := DescentFiberCost.finite_ideal_count_real labels F hF hI0 hIF have hm : 0≤SchwartzMap.seminorm ℝ 0 0 rowMajorant := by positivity unfold canonicalSmoothedEnergy simp_rw [nonzeroRowMajorantSum_exact_disk _ K hK0] rw [Complex.re_sum] calc _ ≤ ∑I∈labels,∑z∈R,SchwartzMap.seminorm ℝ 0 0 rowMajorant*D^2 := by apply Finset.sum_le_sum intro I hIL rw [Complex.re_sum] apply Finset.sum_le_sum intro z hz simp only [Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,mul_zero,sub_zero] exact mul_le_mul ((Complex.re_le_norm _).trans (rowMajorant.norm_le_seminorm ℝ _)) (pow_le_pow_left₀ (norm_nonneg _) (hrow I hIL z) 2) (sq_nonneg _) hm _ = (labels.card:ℝ)*R.card*(SchwartzMap.seminorm ℝ 0 0 rowMajorant*D^2) := by simp; ring _ ≤ (128*F)*(128*(2*K))*(SchwartzMap.seminorm ℝ 0 0 rowMajorant*D^2) := mul_le_mul_of_nonneg_right (mul_le_mul hI hR (Nat.cast_nonneg _) (by linarith)) (by positivity) _ = _ := by ring theorem canonicalLogEnergy_subunit (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (V : ℝ → ℂ) (X K A : ℝ) (hX : 0V (columnLog p X S)) f y=0 := by unfold fixedChildRow apply Finset.sum_eq_zero intro S hS simp only [secondChildColumn,hcol,mul_zero] simp only [canonicalLogEnergy,canonicalSmoothedEnergy,nonzeroRowMajorantSum,hrow,norm_zero, zero_pow (by decide : (2:ℕ)≠0),Complex.ofReal_zero,mul_zero,ite_self,tsum_zero, Finset.sum_const_zero,Complex.zero_re] theorem canonicalLogEnergy_terminal (hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (hinj : Function.Injective (fun i=>Ideal.span {p i})) (pool : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (hΨ : ∀z,‖Ψ z‖≤1) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (V : ℝ → ℂ) (X F K A M : ℝ) (hX : 0columnLog_norm_upper p hp X A hX S ((le_abs_self _).trans (hVs _ hn)) have hrow (I : Ideal ActualEisensteinCubic.O) (hI : I∈labels) (z : ActualEisensteinCubic.O) : ‖fixedChildRow p hp hcop hg pool Ψ m (fun S=>V (columnLog p X S)) (ConcretePrimeRowBridge.idealGenerator I) z‖≤128*(X*Real.exp A)*M := fixedChildRow_elementary p hp hcop hg hc hinj pool Ψ hΨ m _ z _ (X*Real.exp A) M hscale hM (fun S=>hV _) hcol have hb := canonicalSmoothedEnergy_uniform_row_bound p hp hcop hg pool Ψ m labels (fun S=>V (columnLog p X S)) F K (128*(X*Real.exp A)*M) hF hK (by positivity) hI0 hIF hrow change canonicalLogEnergy p hp hcop hg pool Ψ m labels V X K≤_ at hb calc _ ≤ 2*128^2*SchwartzMap.seminorm ℝ 0 0 rowMajorant*F*K*(128*(X*Real.exp A)*M)^2 := hb _ = canonicalTerminalConstant A M*X^2*F*K := by unfold canonicalTerminalConstant; ring _ ≤ canonicalTerminalConstant A M*X^2*F*F := mul_le_mul_of_nonneg_left hKF (by have := canonicalTerminalConstant_nonneg A M; positivity) _ = _ := by ring · rw [canonicalLogEnergy_subunit p hp hcop hg pool Ψ m labels V X K A hX hVs (lt_of_not_ge hscale)] exact mul_nonneg (canonicalTerminalConstant_nonneg A M) (sq_nonneg _) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CoordinateLaplacian namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff SchwartzMap LineDeriv def kernelCoordinateLaplacian (f : kernelSmoothTests) (p : EuclideanSpatial) : ℂ := -(p 2:ℂ)^2*(∑j : Fin 3, fderiv ℝ (fun q => fderiv ℝ (kernelTestField f) q (euclideanCoordinateVector j)) p (euclideanCoordinateVector j))+ (p 2:ℂ)*fderiv ℝ (kernelTestField f) p (euclideanCoordinateVector 2) lemma kernelCoreLift_laplacian (χ : PositiveChartCutoff) (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : p∈kernelChartCore χ) : upperPositiveLaplacian (kernelCoreLift χ f) p=kernelCoordinateLaplacian f p := by have he := kernelCoreLift_eventually_eq χ f p hp have hd (j : Fin 3) : (fun q => fderiv ℝ (kernelCoreLift χ f) q (euclideanCoordinateVector j))=ᶠ[𝓝 p] (fun q => fderiv ℝ (kernelTestField f) q (euclideanCoordinateVector j)) := (he.fderiv (𝕜 := ℝ)).mono (fun q hq => congrArg (fun d => d (euclideanCoordinateVector j)) hq) have hdd (j : Fin 3) : (∂_{euclideanCoordinateVector j} (∂_{euclideanCoordinateVector j} (kernelCoreLift χ f))) p= fderiv ℝ (fun q => fderiv ℝ (kernelTestField f) q (euclideanCoordinateVector j)) p (euclideanCoordinateVector j) := by change fderiv ℝ (fun q => fderiv ℝ (kernelCoreLift χ f) q (euclideanCoordinateVector j)) p (euclideanCoordinateVector j)=_ rw [(hd j).fderiv_eq] simp only [upperPositiveLaplacian,kernelCoordinateLaplacian,hdd, SchwartzMap.lineDerivOp_apply_eq_fderiv,he.fderiv_eq] lemma kernelDirichletForm_sum_right {ι : Type*} (f : kernelSmoothTests) (t : Finset ι) (g : ι→kernelSmoothTests) : kernelDirichletForm f (∑i∈t,g i)=∑i∈t,kernelDirichletForm f (g i) := by induction t using Finset.induction_on with | empty => have hz := kernelDirichletForm_smul_right 0 f (0 : kernelSmoothTests) simpa only [Finset.sum_empty,zero_smul,zero_mul] using hz | @insert i t hi ih => simp only [Finset.sum_insert hi,kernelDirichletForm_add_right,ih] end open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff lemma kernelL2_inner_toLp_smooth (A : KernelQuotient→ℂ) (hA : MemLp A 2 (integralQuotientVolume globalKubotaKernel)) (g : kernelSmoothTests) : inner ℂ (hA.toLp A) (kernelSmoothTestsToL2 g)= ∫q,star (A q)*g.1 q∂integralQuotientVolume globalKubotaKernel := by calc _ = ∫q,inner ℂ ((hA.toLp A) q) (kernelSmoothTestsToL2 g q) ∂integralQuotientVolume globalKubotaKernel := rfl _ = _ := by apply integral_congr_ae filter_upwards [hA.coeFn_toLp,(kernelSmoothTests_memLp g).coeFn_toLp] with q hq hg change inner ℂ ((hA.toLp A) q) (((kernelSmoothTests_memLp g).toLp g.1) q)=_ rw [hq,hg,RCLike.inner_apply] simp only [RCLike.star_def,mul_comm] end CubicEisenstein section open scoped BigOperators Classical open MeasureTheory namespace SecondPassIntegration open ActualEisensteinCubic SecondPassArithmetic ConcreteTraceCRT variable {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem densityChildEnergy_from_canonical_state (pool : Finset ι) (Ψ₁ Ψ₂ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (T : Finset (Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O)) (labels : Finset (Ideal ActualEisensteinCubic.O)) (V₁ V₂ : ℝ → ℂ) (X F K E t₁ t₂ : ℝ) (J : ℕ) (hX : 0hbad i) have hJ : IsCoprime (Ideal.span {jLabel p B (fun i=>v₁ i+v₂ i) ε₁ ε₂}) bad := by simp only [jLabel,primeProduct,FiniteGaussPhase.span_finset_prod,←Ideal.span_singleton_pow] exact IsCoprime.prod_left (fun i _=>(hbad i).pow_left) exact ((hJ.mul_left (hprod C)).mul_left (hprod E)).mul_left (hprod V) theorem globalNewLabel_coprime (bad : Ideal ActualEisensteinCubic.O) (hbad : ∀i,IsCoprime (Ideal.span {p i}) bad) (x : GlobalSecondData ι) : IsCoprime (SecondPassFiber.newLabel (globalSecondTuple p x)) bad := by exact actualSecondLabel_coprime p bad hbad x.cube.support x.common x.source.divisor x.source.overlap x.cube.leftExponent x.cube.rightExponent x.cube.leftBit x.cube.rightBit theorem globalCanonicalLabels_coprime (bad : Ideal ActualEisensteinCubic.O) (hbad : ∀i,IsCoprime (Ideal.span {p i}) bad) (source : Finset (GlobalSecondData ι)) (side : Bool) (q : Ideal ActualEisensteinCubic.O × Ideal ActualEisensteinCubic.O × Ideal ActualEisensteinCubic.O) (j : GlobalLogIndex) : ∀I∈globalCanonicalLabels p source side q j,IsCoprime I bad := by intro I hI obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hI obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hz exact globalNewLabel_coprime p bad hbad x end SecondPassArithmetic namespace CanonicalRowCompletion open MeasureTheory open scoped BigOperators Classical open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O theorem finite_integral_energy_polynomial {κ : Type*} [Fintype κ] (b : ℝ → ℂ) (φ : κ → ℝ → ℂ) (d : ℕ) (E : ℝ) (hE : 0 ≤ E) (hb : Integrable (fun t => ‖b t‖*(1+|t|)^d)) (hφ : ∀ k, Integrable (fun t => b t*φ k t)) (hbound : ∀ t, (∑ k, ‖φ k t‖^2) ≤ E*(1+|t|)^(2*d)) : (∑ k, ‖∫ t : ℝ, b t*φ k t‖^2) ≤ E*(∫ t : ℝ, ‖b t‖*(1+|t|)^d)^2 := by let e := PiLp.continuousLinearEquiv 2 ℂ (fun _ : κ => ℂ) let F : ℝ → EuclideanSpace ℂ κ := fun t => e.symm (fun k => b t*φ k t) have hF (t : ℝ) : ‖F t‖ ≤ (‖b t‖*(1+|t|)^d)*Real.sqrt E := by apply (sq_le_sq₀ (norm_nonneg _) (by positivity)).mp rw [EuclideanSpace.norm_sq_eq] change (∑ k, ‖b t*φ k t‖^2) ≤ _ simp only [norm_mul,mul_pow,← Finset.mul_sum,Real.sq_sqrt hE] have hp : (1+|t|)^(2*d) = ((1+|t|)^d)^2 := by rw [← pow_mul,Nat.mul_comm d 2] calc _ ≤ ‖b t‖^2 * (E*(1+|t|)^(2*d)) := mul_le_mul_of_nonneg_left (hbound t) (sq_nonneg _) _ = _ := by rw [hp]; ring have he : (∫ t : ℝ, F t) = e.symm (fun k => ∫ t : ℝ, b t*φ k t) := by rw [show F = (fun t => e.symm (fun k => b t*φ k t)) from rfl, e.symm.integral_comp_comm] congr 1 funext k exact eval_integral hφ k have hn : ‖e.symm (fun k => ∫ t : ℝ, b t*φ k t)‖ ≤ (∫ t : ℝ, ‖b t‖*(1+|t|)^d)*Real.sqrt E := by rw [← he,← integral_mul_const] exact norm_integral_le_of_norm_le (hb.mul_const _) (Filter.Eventually.of_forall hF) have hh := pow_le_pow_left₀ (norm_nonneg _) hn 2 rw [EuclideanSpace.norm_sq_eq,mul_pow,Real.sq_sqrt hE] at hh change (∑ k, ‖∫ t : ℝ, b t*φ k t‖^2) ≤ (∫ t : ℝ, ‖b t‖*(1+|t|)^d)^2 * E at hh simpa only [mul_comm] using hh theorem norm_add_sum_sq_le {κ : Type*} (s : Finset κ) (a : ℂ) (b : κ → ℂ) : ‖a + ∑ k ∈ s, b k‖^2 ≤ 2*(‖a‖^2 + s.card*∑ k ∈ s, ‖b k‖^2) := by have hs : ‖∑ k ∈ s, b k‖^2 ≤ (s.card : ℝ)*∑ k ∈ s, ‖b k‖^2 := by calc _ ≤ (∑ k ∈ s, ‖b k‖)^2 := pow_le_pow_left₀ (norm_nonneg _) (norm_sum_le _ _) 2 _ ≤ _ := by simpa only [one_mul,one_pow,Finset.sum_const,nsmul_eq_mul,mul_one] using Finset.sum_mul_sq_le_sq_mul_sq s (fun _ => (1:ℝ)) (fun k => ‖b k‖) have ha := pow_le_pow_left₀ (norm_nonneg _) (norm_add_le a (∑ k ∈ s, b k)) 2 nlinarith [sq_nonneg (‖a‖ - ‖∑ k ∈ s, b k‖)] theorem outsideCanonicalRow_binned_energy (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀ P ∈ S, Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ → ℂ) (hWc : HasCompactSupport W) (b X H₀ : ℝ) (hb : 0 ≤ b) (hX : 0 < X) (hW : ∀ t, W t ≠ 0 → t ≤ b) (hD : b*X ≤ D) : ‖outsideCanonicalRow S D hbad Ψ m f z W X‖^2 ≤ 2*X*(‖shortCompletedSum (rowTwist Ψ (m*excludedGenerator S) f z) W X H₀‖^2 + (cubeLogRange b X).card * ∑ j ∈ cubeLogRange b X, ‖outsideCanonicalBin S D hbad (activeCubeLogBin S D b X j) Ψ m f z W X H₀‖^2) := by have hs := norm_add_sum_sq_le (cubeLogRange b X) (shortCompletedSum (rowTwist Ψ (m*excludedGenerator S) f z) W X H₀) (fun j => outsideCanonicalBin S D hbad (activeCubeLogBin S D b X j) Ψ m f z W X H₀) rw [← outsideCanonicalRow_reopened_binned S D hbad hSp Ψ m f z W hWc b X H₀ hb hX hW hD] at hs have hn : ‖outsideCanonicalRow S D hbad Ψ m f z W X‖^2 = X*‖(Real.sqrt X : ℂ)⁻¹ * outsideCanonicalRow S D hbad Ψ m f z W X‖^2 := by rw [norm_mul,norm_inv,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (Real.sqrt_nonneg X), mul_pow,inv_pow,Real.sq_sqrt hX.le] field_simp rw [hn] convert mul_le_mul_of_nonneg_left hs hX.le using 1 <;> first | rfl | ring end CanonicalRowCompletion open scoped BigOperators Classical namespace CanonicalCoefficientClass section open ActualEisensteinCubic open SecondPassArithmetic (rayMonoid conjugateRayMonoid rayMonoid_apply conjugateRayMonoid_apply FirstCoreIndex firstCoreTwist sideRayMonoid SecondRayIndex secondRayMinus secondRayPlus) open RayFourExpansion (RayCharacter) def IsBaseRayTwist (base Ψ : ActualEisensteinCubic.O→*ℂ) : Prop := Ψ=base ∨ ∃χ : RayCharacter, Ψ=rayMonoid χ*base lemma rayMonoid_mul (χ η : RayCharacter) : rayMonoid (χ*η)=rayMonoid χ*rayMonoid η := by ext x simp only [rayMonoid_apply,RayFourExpansion.rayCharacter,MulChar.mul_apply,MonoidHom.mul_apply] lemma conjugateRayMonoid_eq (χ : RayCharacter) : conjugateRayMonoid χ=rayMonoid (star χ) := by ext x simp only [conjugateRayMonoid_apply,rayMonoid_apply,RayFourExpansion.rayCharacter,MulChar.star_apply] lemma IsBaseRayTwist.mul_ray {base Ψ : ActualEisensteinCubic.O→*ℂ} (hΨ : IsBaseRayTwist base Ψ) (χ : RayCharacter) : IsBaseRayTwist base (rayMonoid χ*Ψ) := by rcases hΨ with h|⟨η,h⟩ · exact Or.inr ⟨χ,by rw [h]⟩ · exact Or.inr ⟨χ*η,by rw [h,rayMonoid_mul,mul_assoc]⟩ lemma firstCoreTwist_single_ray (side : Bool) (χ : RayCharacter) (Ψ : ActualEisensteinCubic.O→*ℂ) (r : FirstCoreIndex) : firstCoreTwist side χ Ψ r = rayMonoid ((if side then star χ else χ)*FirstPassCubeLabels.coreRayCharacter side r.1 r.2.2)*Ψ := by rw [rayMonoid_mul] have hcore : FirstPassCubeLabels.coreRayTwist side r.1 r.2.2 = rayMonoid (FirstPassCubeLabels.coreRayCharacter side r.1 r.2.2) := rfl unfold firstCoreTwist sideRayMonoid rw [hcore] cases side <;> simp only [Bool.false_eq_true,ite_false,ite_true,conjugateRayMonoid_eq] <;> ac_rfl lemma IsBaseRayTwist.firstCore {base Ψ : ActualEisensteinCubic.O→*ℂ} (hΨ : IsBaseRayTwist base Ψ) (side : Bool) (χ : RayCharacter) (r : FirstCoreIndex) : IsBaseRayTwist base (firstCoreTwist side χ Ψ r) := by rw [firstCoreTwist_single_ray] exact hΨ.mul_ray _ lemma secondRayMinus_single_ray (Ψ : ActualEisensteinCubic.O→*ℂ) (r : SecondRayIndex) : secondRayMinus Ψ r=rayMonoid (star r.2.2*star r.1.2)*Ψ := by rw [rayMonoid_mul] simp only [secondRayMinus,conjugateRayMonoid_eq,mul_assoc] lemma secondRayPlus_single_ray (Ψ : ActualEisensteinCubic.O→*ℂ) (r : SecondRayIndex) : secondRayPlus Ψ r=rayMonoid (r.2.1*star r.1.1)*Ψ := by rw [rayMonoid_mul] simp only [secondRayPlus,conjugateRayMonoid_eq,mul_assoc] lemma IsBaseRayTwist.secondMinus {base Ψ : ActualEisensteinCubic.O→*ℂ} (hΨ : IsBaseRayTwist base Ψ) (r : SecondRayIndex) : IsBaseRayTwist base (secondRayMinus Ψ r) := by rw [secondRayMinus_single_ray] exact hΨ.mul_ray _ lemma IsBaseRayTwist.secondPlus {base Ψ : ActualEisensteinCubic.O→*ℂ} (hΨ : IsBaseRayTwist base Ψ) (r : SecondRayIndex) : IsBaseRayTwist base (secondRayPlus Ψ r) := by rw [secondRayPlus_single_ray] exact hΨ.mul_ray _ lemma IsBaseRayTwist.norm_le {base Ψ : ActualEisensteinCubic.O→*ℂ} (hΨ : IsBaseRayTwist base Ψ) (hbase : ∀x,‖base x‖≤1) (x : ActualEisensteinCubic.O) : ‖Ψ x‖≤1 := by letI importedWitness0 := @OAI.RayFourExpansion.rayRingFintype rcases hΨ with rfl|⟨χ,rfl⟩ · exact hbase x · rw [MonoidHom.mul_apply,norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (FiniteRayExpansion.norm_char_le_one χ _)).trans (hbase x) def FactorsModulo (Q : Ideal ActualEisensteinCubic.O) (Ψ : ActualEisensteinCubic.O→*ℂ) : Prop := ∀x y : ActualEisensteinCubic.O,x-y∈Q → Ψ x=Ψ y lemma IsBaseRayTwist.factorsModulo {base Ψ : ActualEisensteinCubic.O→*ℂ} (hΨ : IsBaseRayTwist base Ψ) (Q : Ideal ActualEisensteinCubic.O) (hbase : FactorsModulo Q base) : FactorsModulo (Q*Ideal.span {(4:ActualEisensteinCubic.O)}) Ψ := by intro x y hxy have hb := hbase x y (Ideal.mul_le_left hxy) rcases hΨ with rfl|⟨χ,rfl⟩ · exact hb · simp only [MonoidHom.mul_apply] rw [hb] congr 1 exact RayFourExpansion.rayCharacter_eq_of_mod_four χ x y (Ideal.mem_span_singleton.mp (Ideal.mul_le_right hxy)) def initialBase {q : ℕ} (χ : DirichletCharacter ℂ q) : ActualEisensteinCubic.O→*ℂ := InitialMeanSquare.conjugateMonoid (InitialMeanSquare.normCharacter χ) lemma initialBase_norm {q : ℕ} (χ : DirichletCharacter ℂ q) (x : ActualEisensteinCubic.O) : ‖initialBase χ x‖≤1 := by change ‖star (InitialMeanSquare.normCharacter χ x)‖≤1 rw [norm_star] exact InitialMeanSquare.normCharacter_norm_le_one χ x end open ActualEisensteinCubic open ActualEisensteinCoordinates (eval coords eval_coords) open ShortDraftLatticeCount (qNat qO_nonneg coords_eval) lemma norm_eval_mod (m : ℕ) (a b : ℤ) : (Ideal.absNorm (Ideal.span {eval a b}) : ZMod m)= (a : ZMod m)^2-(a : ZMod m)*(b : ZMod m)+(b : ZMod m)^2 := by have hi : (Ideal.absNorm (Ideal.span {eval a b}) : ℤ)=a^2-a*b+b^2 := by rw [←qNat_eq_absNorm_span] change ((ShortDraftLatticeCount.q (coords (eval a b))).toNat : ℤ)=_ rw [Int.toNat_of_nonneg (qO_nonneg _),coords_eval] rfl have hz := congrArg (fun k : ℤ => (k : ZMod m)) hi push_cast at hz exact hz theorem normCharacter_factorsModulo {m : ℕ} (χ : DirichletCharacter ℂ m) : FactorsModulo (Ideal.span {(m : ActualEisensteinCubic.O)}) (InitialMeanSquare.normCharacter χ) := by intro x y hxy obtain ⟨z,hz⟩ := Ideal.mem_span_singleton.mp hxy let c := (coords y).1 let d := (coords y).2 let e := (coords z).1 let f := (coords z).2 have hy : y=eval c d := (eval_coords y).symm have hx : x=eval (c+(m : ℤ)*e) (d+(m : ℤ)*f) := by calc x=y+(m : ActualEisensteinCubic.O)*z := by linear_combination hz _=eval (c+(m : ℤ)*e) (d+(m : ℤ)*f) := by rw [hy,←eval_coords z] dsimp [eval,c,d,e,f] push_cast ring change χ (Ideal.absNorm (Ideal.span {x}))=χ (Ideal.absNorm (Ideal.span {y})) congr 1 rw [hx,hy,norm_eval_mod,norm_eval_mod] simp theorem initialBase_factorsModulo {m : ℕ} (χ : DirichletCharacter ℂ m) : FactorsModulo (Ideal.span {(m : ActualEisensteinCubic.O)}) (initialBase χ) := by intro x y hxy change star (InitialMeanSquare.normCharacter χ x)=star (InitialMeanSquare.normCharacter χ y) rw [normCharacter_factorsModulo χ x y hxy] def fixedBaseConductor (m : ℕ) : Ideal ActualEisensteinCubic.O := Ideal.span {(m : ActualEisensteinCubic.O)}*Ideal.span {(4 : ActualEisensteinCubic.O)} theorem initialOrbit_factorsModulo {m : ℕ} (χ : DirichletCharacter ℂ m) (Ψ : ActualEisensteinCubic.O→*ℂ) (hΨ : IsBaseRayTwist (initialBase χ) Ψ) : FactorsModulo (fixedBaseConductor m) Ψ := hΨ.factorsModulo _ (initialBase_factorsModulo χ) lemma fixedBaseConductor_principal (m : ℕ) : fixedBaseConductor m=Ideal.span {((4*m : ℕ) : ActualEisensteinCubic.O)} := by rw [fixedBaseConductor,Ideal.span_singleton_mul_span_singleton] congr 1 push_cast ring_nf lemma fixedBaseConductor_ne_zero (m : ℕ) (hm : m≠0) : fixedBaseConductor m≠0 := by rw [fixedBaseConductor_principal] change Ideal.span {((4*m : ℕ) : ActualEisensteinCubic.O)}≠⊥ rw [ne_eq,Ideal.span_singleton_eq_bot] exact_mod_cast Nat.mul_ne_zero (by decide : (4:ℕ)≠0) hm end CanonicalCoefficientClass end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.DensityBudgets namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace SecondPassArithmetic section open scoped BigOperators Classical open MeasureTheory open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct firstLogDensity) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter) open SecondPassIntegration (densityChildEnergy_from_canonical_state) def canonicalDensityConstant (E : ℝ) (J : ℕ) (t : ℝ) : ℝ := 6*E*(1+‖t‖)^(2*J)*(∫s : ℝ,firstLogDensity 0 s)^3 theorem canonicalDensityConstant_nonneg (E : ℝ) (hE : 0≤E) (J : ℕ) (t : ℝ) : 0≤canonicalDensityConstant E J t := by have hi : 0≤∫s : ℝ,firstLogDensity 0 s := integral_nonneg (fun s=>FirstPassCubeLabels.firstLogDensity_nonneg 0 s) unfold canonicalDensityConstant positivity theorem globalFirstQuantitativeBudget_state_bound (deltaLoss : ℝ) (hδ : 0 Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (side : Bool) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (windows : Fin 7 → ℝ → ℂ) (C Cd Ct Γ E oldHeight K ell B F M H U Z θ A₀ Vmax : ℝ) (N J Ntail : ℕ), 0≤C → 0≤Γ → 0≤E → 1≤U → 0 globalBinRadial ell (globalPooledRowScale K ell B F j) j(normHeightTwist_norm_le Ψ oldHeight u).trans (hΨ u)) hb₁ hb₂ dsimp only intro a r j hj ray q hq rw [firstCoreTwist_normHeight,secondRayMinus_normHeight,secondRayPlus_normHeight] let source := globalQuantitativeSource p pool blocks K ell B F M H U side have hk : ∀x∈source,x.source.frequency≠0 := fun x hx=>globalQuantitativeSource_frequency_ne_zero p pool blocks K ell B F M H U side x hx have hkc : 0Finset.mem_image.mpr ⟨z,hz,rfl⟩) (fun z hz=>(globalArithmeticTargets_bounds p hp source side q j hk z hz).2.2) (globalArithmeticTargets_nonzero p source side q j hk) (fun t=>(hs t).1) (fun t=>(hs t).2) exact hd.trans_eq (by unfold canonicalDensityConstant; rw [two_mul,pow_add]; ring) end open ActualEisensteinCubic ConcreteTraceCRT def canonicalRankMass (Z : ℝ) (r : ℕ) : ℝ := Real.exp (3*((3000-r:ℕ):ℝ))*Z^2 theorem canonicalRankMass_initial (Z : ℝ) (r : ℕ) : Z^2≤canonicalRankMass Z r := by have he : 1≤Real.exp (3*((3000-r:ℕ):ℝ)) := Real.one_le_exp (by positivity) simpa only [one_mul,canonicalRankMass] using mul_le_mul_of_nonneg_right he (sq_nonneg Z) theorem canonicalRankMass_step (Z : ℝ) (r s : ℕ) (hr : r≤3000) (hs : s+1≤r) : Real.exp 3*canonicalRankMass Z r≤canonicalRankMass Z s := by have hn : 3000-r+1≤3000-s := by omega have hn' : ((3000-r:ℕ):ℝ)+1≤((3000-s:ℕ):ℝ) := by exact_mod_cast hn unfold canonicalRankMass rw [←mul_assoc,←Real.exp_add] exact mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr (by linarith)) (sq_nonneg Z) theorem canonicalRankMass_child (Z X F X' F' : ℝ) (r s : ℕ) (hr : r≤3000) (hs : s+1≤r) (hparent : X*F≤canonicalRankMass Z r) (hchild : X'*F'≤Real.exp 3*(X*F)) : X'*F'≤canonicalRankMass Z s := hchild.trans ((mul_le_mul_of_nonneg_left hparent (Real.exp_pos _).le).trans (canonicalRankMass_step Z r s hr hs)) theorem canonicalRankMass_global (Z : ℝ) (hZ : Real.exp 9000≤Z) (r : ℕ) : canonicalRankMass Z r≤Z^3 := by have hn : ((3000-r:ℕ):ℝ)≤3000 := by exact_mod_cast (Nat.sub_le 3000 r) have he : Real.exp (3*((3000-r:ℕ):ℝ))≤Z := (Real.exp_le_exp.mpr (by linarith)).trans hZ calc canonicalRankMass Z r ≤ Z*Z^2 := mul_le_mul_of_nonneg_right he (sq_nonneg Z) _ = Z^3 := by ring theorem lowerCubeBin_transfer_mass (X B F : ℝ) (hB : B≠0) : (X/B^3)*(Real.exp 1*B)^3*F=Real.exp 3*(X*F) := by have he : (Real.exp 1)^3=Real.exp 3 := by rw [show (3:ℝ)=1+1+1 by norm_num,Real.exp_add,Real.exp_add] ring rw [mul_pow,←he] field_simp theorem canonical_live_scale_bounds (Z X F : ℝ) (r : ℕ) (hZ : Real.exp 9000≤Z) (hX : 1≤X) (hF : 1≤F) (hmass : X*F≤canonicalRankMass Z r) : X≤Z^3 ∧ F≤Z^3 := by have hm := hmass.trans (canonicalRankMass_global Z hZ r) constructor <;> nlinarith end SecondPassArithmetic open MeasureTheory open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open ConcreteTraceCRT (eisEmbedding) def rowFamilyEnergy (labels : Finset (Ideal ActualEisensteinCubic.O)) (P : Ideal ActualEisensteinCubic.O → ActualEisensteinCubic.O → ℂ) (K : ℝ) : ℝ := (∑ I ∈ labels, nonzeroRowMajorantSum (P I) K).re theorem rowFamilyEnergy_eq_sum (labels : Finset (Ideal ActualEisensteinCubic.O)) (P : Ideal ActualEisensteinCubic.O → ActualEisensteinCubic.O → ℂ) (K : ℝ) (hK : 0 < K) : rowFamilyEnergy labels P K = ∑ I ∈ labels, ∑ z ∈ (firstFrequencyDisk (2*K)).erase 0, (rowMajorant (‖eisEmbedding z‖^2/K)).re * ‖P I z‖^2 := by unfold rowFamilyEnergy simp only [nonzeroRowMajorantSum_exact_disk _ K hK, Complex.re_sum, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] theorem rowFamilyEnergy_integral_polynomial (labels : Finset (Ideal ActualEisensteinCubic.O)) (K : ℝ) (hK : 0 < K) (b : ℝ → ℂ) (φ : Ideal ActualEisensteinCubic.O → ActualEisensteinCubic.O → ℝ → ℂ) (d : ℕ) (E : ℝ) (hE : 0 ≤ E) (hb : Integrable (fun t => ‖b t‖*(1+|t|)^d)) (hφ : ∀ I z, Integrable (fun t => b t*φ I z t)) (hbound : ∀ t, rowFamilyEnergy labels (fun I z => φ I z t) K ≤ E*(1+|t|)^(2*d)) : rowFamilyEnergy labels (fun I z => ∫ t : ℝ, b t*φ I z t) K ≤ E*(∫ t : ℝ, ‖b t‖*(1+|t|)^d)^2 := by let R := (firstFrequencyDisk (2*K)).erase 0 let w : ActualEisensteinCubic.O → ℝ := fun z => Real.sqrt ((rowMajorant (‖eisEmbedding z‖^2/K)).re) have hw (z : ActualEisensteinCubic.O) : 0 ≤ w z := Real.sqrt_nonneg _ have hw2 (z : ActualEisensteinCubic.O) : (w z)^2 = (rowMajorant (‖eisEmbedding z‖^2/K)).re := Real.sq_sqrt (rowMajorant_nonneg _) have hsum (P : Ideal ActualEisensteinCubic.O → ActualEisensteinCubic.O → ℂ) : (∑ x : labels × R, ‖(w x.2.val : ℂ)*P x.1.val x.2.val‖^2) = rowFamilyEnergy labels P K := by rw [rowFamilyEnergy_eq_sum labels P K hK] simp only [Fintype.sum_prod_type] rw [Finset.sum_coe_sort (s := labels) (f := fun I : Ideal ActualEisensteinCubic.O => ∑ z : R, ‖(w z.val : ℂ)*P I z.val‖^2)] apply Finset.sum_congr rfl intro I hI rw [Finset.sum_coe_sort (s := R) (f := fun z : ActualEisensteinCubic.O => ‖(w z : ℂ)*P I z‖^2)] apply Finset.sum_congr rfl intro z hz rw [norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (hw z),mul_pow,hw2] let ψ : labels × R → ℝ → ℂ := fun x t => (w x.2.val : ℂ)*φ x.1.val x.2.val t have hψ (x : labels × R) : Integrable (fun t => b t*ψ x t) := by apply ((hφ x.1.val x.2.val).const_mul (w x.2.val : ℂ)).congr filter_upwards [] with t dsimp only [ψ] ring have hψbound (t : ℝ) : (∑ x : labels × R, ‖ψ x t‖^2) ≤ E*(1+|t|)^(2*d) := by change (∑ x : labels × R, ‖(w x.2.val : ℂ)*φ x.1.val x.2.val t‖^2) ≤ _ rw [hsum (fun I z => φ I z t)] exact hbound t have hi (x : labels × R) : (∫ t : ℝ, b t*ψ x t) = (w x.2.val : ℂ)*(∫ t : ℝ, b t*φ x.1.val x.2.val t) := by rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with t dsimp only [ψ] ring have hm := finite_integral_energy_polynomial b ψ d E hE hb hψ hψbound simp_rw [hi] at hm rwa [hsum (fun I z => ∫ t : ℝ, b t*φ I z t)] at hm theorem rowFamilyEnergy_const_mul (labels : Finset (Ideal ActualEisensteinCubic.O)) (P : Ideal ActualEisensteinCubic.O → ActualEisensteinCubic.O → ℂ) (K : ℝ) (hK : 0 < K) (c : ℂ) : rowFamilyEnergy labels (fun I z => c*P I z) K = ‖c‖^2*rowFamilyEnergy labels P K := by simp only [rowFamilyEnergy_eq_sum _ _ K hK, norm_mul, mul_pow, Finset.mul_sum] apply Finset.sum_congr rfl intro I hI apply Finset.sum_congr rfl intro z hz ring end section open MeasureTheory open scoped BigOperators Classical SchwartzMap open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open SecondPassArithmetic hiding O open FirstPassCubeLabels hiding O open CanonicalCubeSeparation JointLogSeparation variable {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) theorem separated_canonical_integrable (pool : Finset ι) (Q : Finset (ι →₀ ℕ)) (β : (ι →₀ ℕ) → ℂ) (n : (ι →₀ ℕ) → ℝ) (Ψ : ActualEisensteinCubic.O →* ℂ) (m f z : ActualEisensteinCubic.O) (b V : 𝓢(ℝ,ℂ)) (B ell : ℝ) : Integrable (fun ξ : ℝ => b ξ * reopenedCanonicalRow p hp hcop hg pool Q (separatedCubeCoefficient β n B ξ) Ψ m f (fun T => frequencyTwist V ξ (columnLog p ell T)) z) := by let A : (ι →₀ ℕ) → Finset ι → ℂ := fun v T => multiplicityRow (fun i => Ideal.span {p i}) hg pool v z ^ 3 * canonicalSourceCoefficient p hp hcop hg Ψ m f (fun _ => 1) T * finiteSquarefreeRow (fun i => Ideal.span {p i}) hg T z have hi := reopening_finite_sum_integrable Q pool.powerset β A n (primeProductNorm p) B ell b V convert hi using 1 funext ξ rw [reopenedCanonicalRow_integrand p hp hcop hg] rfl theorem separated_canonical_family_energy (pool : Finset ι) (Q : Finset (ι →₀ ℕ)) (labels : Finset (Ideal ActualEisensteinCubic.O)) (β : Ideal ActualEisensteinCubic.O → (ι →₀ ℕ) → ℂ) (n : (ι →₀ ℕ) → ℝ) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (b V : 𝓢(ℝ,ℂ)) (B ell K E : ℝ) (d : ℕ) (hB : 0 < B) (hell : 0 < ell) (hK : 0 < K) (hE : 0 ≤ E) (hbound : ∀ ξ : ℝ, rowFamilyEnergy labels (fun I z => reopenedCanonicalRow p hp hcop hg pool Q (separatedCubeCoefficient (β I) n B ξ) Ψ m (idealGenerator I) (fun T => frequencyTwist V ξ (columnLog p ell T)) z) K ≤ E*(1+|ξ|)^(2*d)) : rowFamilyEnergy labels (fun I z => ((B*Real.sqrt ell : ℝ) : ℂ)⁻¹ * ∫ ξ : ℝ, b ξ * reopenedCanonicalRow p hp hcop hg pool Q (separatedCubeCoefficient (β I) n B ξ) Ψ m (idealGenerator I) (fun T => frequencyTwist V ξ (columnLog p ell T)) z) K ≤ (B^2*ell)⁻¹ * E*(∫ ξ : ℝ, ‖b ξ‖*(1+|ξ|)^d)^2 := by have hb : Integrable (fun ξ : ℝ => ‖b ξ‖*(1+|ξ|)^d) := by simpa only [Real.norm_eq_abs,mul_comm] using weighted_schwartz_integrable b d have hφ (I : Ideal ActualEisensteinCubic.O) (z : ActualEisensteinCubic.O) : Integrable (fun ξ : ℝ => b ξ * reopenedCanonicalRow p hp hcop hg pool Q (separatedCubeCoefficient (β I) n B ξ) Ψ m (idealGenerator I) (fun T => frequencyTwist V ξ (columnLog p ell T)) z) := separated_canonical_integrable p hp hcop hg pool Q (β I) n Ψ m (idealGenerator I) z b V B ell have hm := rowFamilyEnergy_integral_polynomial labels K hK b (fun I z ξ => reopenedCanonicalRow p hp hcop hg pool Q (separatedCubeCoefficient (β I) n B ξ) Ψ m (idealGenerator I) (fun T => frequencyTwist V ξ (columnLog p ell T)) z) d E hE hb hφ hbound have hn : ‖((B*Real.sqrt ell : ℝ) : ℂ)⁻¹‖^2 = (B^2*ell)⁻¹ := by rw [norm_inv,Complex.norm_real,Real.norm_eq_abs, abs_of_pos (mul_pos hB (Real.sqrt_pos.mpr hell)),inv_pow,mul_pow,Real.sq_sqrt hell.le] rw [rowFamilyEnergy_const_mul labels _ K hK, hn] convert mul_le_mul_of_nonneg_left hm (by positivity : 0 ≤ (B^2*ell)⁻¹) using 1 <;> first | rfl | ring end section open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open ConcreteTraceCRT (eisEmbedding) theorem rowFamilyEnergy_bound_sum {κ : Type*} (labels : Finset (Ideal ActualEisensteinCubic.O)) (bins : Finset κ) (K : ℝ) (hK : 0 < K) (P A : Ideal ActualEisensteinCubic.O → ActualEisensteinCubic.O → ℂ) (B : κ → Ideal ActualEisensteinCubic.O → ActualEisensteinCubic.O → ℂ) (c N : ℝ) (hbound : ∀ I ∈ labels, ∀ z ∈ (firstFrequencyDisk (2*K)).erase 0, ‖P I z‖^2 ≤ c*(‖A I z‖^2 + N*∑ j ∈ bins, ‖B j I z‖^2)) : rowFamilyEnergy labels P K ≤ c*(rowFamilyEnergy labels A K + N*∑ j ∈ bins, rowFamilyEnergy labels (B j) K) := by let R := (firstFrequencyDisk (2*K)).erase 0 let w : ActualEisensteinCubic.O → ℝ := fun z => (rowMajorant (‖eisEmbedding z‖^2/K)).re have hswap : (∑ I ∈ labels, ∑ z ∈ R, w z*∑ j ∈ bins, ‖B j I z‖^2) = ∑ j ∈ bins, rowFamilyEnergy labels (B j) K := by simp_rw [Finset.mul_sum] calc _ = ∑ I ∈ labels, ∑ j ∈ bins, ∑ z ∈ R, w z*‖B j I z‖^2 := Finset.sum_congr rfl (fun I hI => Finset.sum_comm) _ = ∑ j ∈ bins, ∑ I ∈ labels, ∑ z ∈ R, w z*‖B j I z‖^2 := Finset.sum_comm _ = _ := Finset.sum_congr rfl (fun j hj => (rowFamilyEnergy_eq_sum labels (B j) K hK).symm) rw [rowFamilyEnergy_eq_sum labels P K hK] calc _ ≤ ∑ I ∈ labels, ∑ z ∈ R, (c*(w z*‖A I z‖^2) + c*N*(∑ j ∈ bins, w z*‖B j I z‖^2)) := by apply Finset.sum_le_sum intro I hI apply Finset.sum_le_sum intro z hz calc _ ≤ w z*(c*(‖A I z‖^2 + N*∑ j ∈ bins, ‖B j I z‖^2)) := mul_le_mul_of_nonneg_left (hbound I hI z hz) (rowMajorant_nonneg _) _ = _ := by rw [← Finset.mul_sum]; ring _ = c*(rowFamilyEnergy labels A K + N*∑ j ∈ bins, rowFamilyEnergy labels (B j) K) := by simp only [Finset.sum_add_distrib, ← Finset.mul_sum] rw [hswap, ← rowFamilyEnergy_eq_sum labels A K hK] ring theorem outsideCanonicalRow_family_binned_energy (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀ P ∈ S, Prime P) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (W : ℝ → ℂ) (hWc : HasCompactSupport W) (b X H₀ K : ℝ) (hb : 0 ≤ b) (hX : 0 < X) (hK : 0 < K) (hW : ∀ t, W t ≠ 0 → t ≤ b) (hD : b*X ≤ D) : rowFamilyEnergy labels (fun I z => outsideCanonicalRow S D hbad Ψ m (idealGenerator I) z W X) K ≤ 2*X*(rowFamilyEnergy labels (fun I z => shortCompletedSum (rowTwist Ψ (m*excludedGenerator S) (idealGenerator I) z) W X H₀) K + (cubeLogRange b X).card * ∑ j ∈ cubeLogRange b X, rowFamilyEnergy labels (fun I z => outsideCanonicalBin S D hbad (activeCubeLogBin S D b X j) Ψ m (idealGenerator I) z W X H₀) K) := by apply rowFamilyEnergy_bound_sum labels (cubeLogRange b X) K hK intro I hI z hz exact outsideCanonicalRow_binned_energy S D hbad hSp Ψ m (idealGenerator I) z W hWc b X H₀ hb hX hW hD end open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open FirstPassCubeLabels hiding O open CanonicalCubeSeparation JointLogSeparation theorem outsideCanonicalBin_energy (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (Q : Finset (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D) →₀ ℕ)) (labels : Finset (Ideal ActualEisensteinCubic.O)) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) (V : 𝓢(ℝ,ℂ)) (hV : ∀ u, |u| ≤ columnWindowRadius a b → V u = 1) (B ell X H₀ K E : ℝ) (d : ℕ) (hB : 0 < B) (hell : 0 < ell) (hX : X = B^3*ell) (hK : 0 < K) (hE : 0 ≤ E) (hn : ∀ v ∈ Q, B ≤ (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ)) (hn' : ∀ v ∈ Q, (Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v) : ℝ) ≤ Real.exp 1*B) : letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F := InitialMeanSquare.outsideSquarefreeIdeals S D let hF := InitialMeanSquare.outsideSquarefree_admissible S D hbad letI : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance let β := fun I v => reopenedCubeCoefficient H₀ (rowTwist Ψ (m*excludedGenerator S) (idealGenerator I) 1) (cubeIdeal F v) let n := fun v => (Ideal.absNorm (cubeIdeal F v) : ℝ) (∀ ξ : ℝ, rowFamilyEnergy labels (fun I z => reopenedCanonicalRow (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Q (separatedCubeCoefficient (β I) n B ξ) Ψ m (idealGenerator I) (fun T => frequencyTwist V ξ (columnLog (poolPrimary F) ell T)) z) K ≤ E*(1+|ξ|)^(2*d)) → rowFamilyEnergy labels (fun I z => outsideCanonicalBin S D hbad Q Ψ m (idealGenerator I) z W X H₀) K ≤ (B^2*ell)⁻¹ * E * (∫ ξ : ℝ, ‖reopeningCoefficient W a b ha hs hW ξ‖*(1+|ξ|)^d)^2 := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal dsimp only let F := InitialMeanSquare.outsideSquarefreeIdeals S D have hF := InitialMeanSquare.outsideSquarefree_admissible S D hbad let : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance let β := fun I v => reopenedCubeCoefficient H₀ (rowTwist Ψ (m*excludedGenerator S) (idealGenerator I) 1) (cubeIdeal F v) let n := fun v => (Ideal.absNorm (cubeIdeal F v) : ℝ) intro hbound have hrows : (fun I z => outsideCanonicalBin S D hbad Q Ψ m (idealGenerator I) z W X H₀) = (fun I z => ((B*Real.sqrt ell : ℝ) : ℂ)⁻¹ * ∫ ξ : ℝ, reopeningCoefficient W a b ha hs hW ξ * reopenedCanonicalRow (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Q (separatedCubeCoefficient (β I) n B ξ) Ψ m (idealGenerator I) (fun T => frequencyTwist V ξ (columnLog (poolPrimary F) ell T)) z) := by funext I z exact outsideCanonicalBin_separated S D hbad Q Ψ m (idealGenerator I) z W a b ha hs hW V hV B ell X H₀ hB hell hX hn hn' rw [hrows] exact separated_canonical_family_energy (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Q labels β n Ψ m (reopeningCoefficient W a b ha hs hW) V B ell K E d hB hell hK hE hbound end CanonicalRowCompletion open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) open FirstPassCubeLabels (primeProduct) theorem canonicalProgress_large (Z : ℝ) (hZ : Real.exp 9000≤Z) : Real.exp 4≤Z^((1:ℝ)/1000) := by have hh := Real.rpow_le_rpow (Real.exp_pos 9000).le hZ (by norm_num : (0:ℝ)≤1/1000) rw [Real.rpow_def_of_pos (Real.exp_pos 9000), Real.log_exp] at hh norm_num at hh exact (Real.exp_le_exp.mpr (by norm_num : (4:ℝ)≤9)).trans hh theorem paddedCanonicalRatio (K M R Z η : ℝ) (hM : 0.trans_eq (by ring) end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.RankMargins namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace SecondPassArithmetic def canonicalPadding (ε C : ℝ) : ℝ := min ((1:ℝ)/120040) (ε/6002)/(1+C) theorem canonicalPadding_budget (ε C : ℝ) (hε : 0<ε) (hC : 0≤C) : 0 nlinarith theorem canonicalRankMargin_le (σ η : ℝ) (hη : 0≤η) (r : ℕ) : canonicalRankMargin σ η r≤σ := by unfold canonicalRankMargin have hn : (0:ℝ)≤((3000-r:ℕ):ℝ) := Nat.cast_nonneg _ nlinarith theorem canonicalRankMargin_reserved (η : ℝ) (hη : 0≤η) (hbudget : 3000*η≤(1:ℝ)/40) (r : ℕ) : (1:ℝ)/40≤canonicalRankMargin ((1:ℝ)/20) η r ∧ canonicalRankMargin ((1:ℝ)/20) η r≤(1:ℝ)/20 := by constructor · exact (by linarith : (1:ℝ)/40≤(1:ℝ)/20-3000*η).trans (canonicalRankMargin_lower _ η hη r) · exact canonicalRankMargin_le _ η hη r theorem canonicalRankMargin_final_bound (Z η R M : ℝ) (r : ℕ) (hZ : 1≤Z) (hη : 0≤η) (hM : 0≤M) (hbudget : 3000*η≤(1:ℝ)/40) (hbound : R≤M*Z^(-canonicalRankMargin ((1:ℝ)/20) η r)) : R≤M*Z^(-((1:ℝ)/40)) := by apply hbound.trans apply mul_le_mul_of_nonneg_left _ hM exact Real.rpow_le_rpow_of_exponent_le hZ (neg_le_neg (canonicalRankMargin_reserved η hη hbudget r).1) end SecondPassArithmetic open scoped BigOperators Classical SchwartzMap ContDiff namespace CanonicalRowCompletion open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open FirstPassCubeLabels hiding O theorem canonicalLogEnergy_eq_completed_rows (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes ⊆ S) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (V : ℝ → ℂ) (hVs : ContDiff ℝ ∞ V) (A : ℝ) (hV : ∀ s, V s ≠ 0 → |s| ≤ A) (X K : ℝ) (hX : 0 < X) : letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal let F := InitialMeanSquare.outsideSquarefreeIdeals S D let hF := InitialMeanSquare.outsideSquarefree_admissible S D hbad letI : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance canonicalLogEnergy (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Ψ m labels V X K = rowFamilyEnergy labels (fun I z => outsideCanonicalRow S D hbad Ψ m (idealGenerator I) z (radialFromLog V hVs A hV) X) K := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal dsimp only let F := InitialMeanSquare.outsideSquarefreeIdeals S D have hF := InitialMeanSquare.outsideSquarefree_admissible S D hbad let : ∀ i : primePool F, (Ideal.span {poolPrimary F i}).IsMaximal := fun i => by rw [poolPrimary_span F hF i]; infer_instance change rowFamilyEnergy labels (fun I z => fixedChildRow (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Ψ m (fun T => V (columnLog (poolPrimary F) X T)) (idealGenerator I) z) K = _ congr 1 funext I z unfold outsideCanonicalRow dsimp only apply congrArg (fun H => fixedChildRow (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Ψ m H (idealGenerator I) z) funext T exact (radialFromLog_column (poolPrimary F) (poolPrimary_ne_zero F hF) V hVs A hV X hX T).symm end CanonicalRowCompletion namespace CompletedHeight section open MeasureTheory Filter Set open scoped BigOperators Classical SchwartzMap FourierTransform ContDiff Topology open FourierBridge JointLogSeparation def fixedLogReturnCLM (a b : ℝ) (ha : 0 < a) : 𝓢(ℝ,ℂ) →L[ℝ] 𝓢(ℝ,ℂ) := (SchwartzMap.smulLeftCLM ℂ (positiveCutoff a b ha)).comp (SchwartzMap.compCLM ℝ (patchedLog_temperate (a/2) (max a b+a/2) (by linarith)) (patchedLog_proper (a/2) (max a b+a/2) (by linarith))) lemma fixedLogReturnCLM_apply (a b : ℝ) (ha : 0 < a) (g : 𝓢(ℝ,ℂ)) (x : ℝ) : fixedLogReturnCLM a b ha g x = positiveCutoff a b ha x • g (patchedLog (a/2) (max a b+a/2) (by linarith) x) := by rw [fixedLogReturnCLM,ContinuousLinearMap.comp_apply, SchwartzMap.smulLeftCLM_apply_apply ((positiveCutoff a b ha).hasCompactSupport.hasTemperateGrowth (positiveCutoff a b ha).contDiff)] rfl lemma positiveCutoff_support_bounds (a b : ℝ) (ha : 0 < a) (x : ℝ) (hx : positiveCutoff a b ha x ≠ 0) : x ∈ Icc (a/2) (max a b+a/2) := by have hm : x ∈ Function.support (positiveCutoff a b ha) := hx rw [(positiveCutoff a b ha).support_eq] at hm change dist x ((a+max a b)/2) < (max a b-a)/2+a/2 at hm rw [Real.dist_eq,abs_lt] at hm constructor <;> linarith [hm.1,hm.2] theorem frequencyTwist_finite_uniform_degree (S : Finset (ℕ×ℕ)) : ∃n : ℕ, ∀g : 𝓢(ℝ,ℂ), ∃C : ℝ, 0 < C ∧ ∀t : ℝ, S.sup (schwartzSeminormFamily ℝ ℝ ℂ) (frequencyTwist g t) ≤ C*(1+‖t‖)^n := by let n := S.sup Prod.snd refine ⟨n,?_⟩ intro g let c : ℕ×ℕ → ℝ := fun z => (2:ℝ)^z.2*(1+2*Real.pi)^z.2*derivativeSeminormSum g z.1 z.2 let C := 1+∑z∈S,c z have hc : ∀z,0≤c z := fun z => by dsimp [c]; exact mul_nonneg (by positivity) (derivativeSeminormSum_nonneg _ _ _) have hC : 0 hc z); linarith refine ⟨C,hC,?_⟩ intro t apply Seminorm.finset_sup_apply_le (by positivity) intro z hz have hzC : c z≤C := by have hh := Finset.single_le_sum (fun z (_ : z∈S) => hc z) hz dsimp [C] linarith have hzn : z.2≤n := Finset.le_sup hz exact (frequencyTwist_seminorm_polynomial g t z.1 z.2).trans (mul_le_mul hzC (pow_le_pow_right₀ (by linarith [norm_nonneg t]) hzn) (by positivity) hC.le) def uniformTwistedSchwartz (W : ℝ→ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Icc a b) (hW : ContDiff ℝ ∞ W) (t : ℝ) : 𝓢(ℝ,ℂ) := fixedLogReturnCLM a b ha (frequencyTwist (CubicReflectionKernel.logSchwartz W a b ha hs hW) t) lemma uniformTwistedSchwartz_apply (W : ℝ→ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Icc a b) (hW : ContDiff ℝ ∞ W) (t x : ℝ) : uniformTwistedSchwartz W a b ha hs hW t x = normTwistedSource W t x := by rw [uniformTwistedSchwartz,fixedLogReturnCLM_apply,frequencyTwist_apply, CubicReflectionKernel.logSchwartz_apply] by_cases hc : positiveCutoff a b ha x=0 · have hx : W x=0 := by by_contra hx have := positiveCutoff_one a b ha x (hs hx) exact zero_ne_one (hc.symm.trans this) simp only [hc,zero_smul,normTwistedSource,hx,mul_zero] · have hb := positiveCutoff_support_bounds a b ha x hc have hx : 0 < x := by linarith [hb.1] rw [patchedLog_eq_log _ _ _ x hb,Real.exp_log hx] by_cases hw : W x=0 · simp only [hw,mul_zero,smul_zero,normTwistedSource] · rw [positiveCutoff_one a b ha x (hs hw),one_smul] rfl theorem normTwistedSource_uniform_degree (a b : ℝ) (ha : 0 < a) (S : Finset (ℕ×ℕ)) : ∃n : ℕ,∀W : ℝ→ℂ,∀hs : Function.support W ⊆ Icc a b,∀hW : ContDiff ℝ ∞ W, ∃C : ℝ,0 normTwistedSource W.val) := by constructor · intro W t exact (normTwistedSource_polynomial_kernel W.val a b ha W.property.1 W.property.2).1 t · intro A K obtain ⟨s,D,hD,hkernel⟩ := CubicReflectionKernel.paperKernel_euler_source_uniform_weighted_bound a b ha A K obtain ⟨n,hn⟩ := normTwistedSource_uniform_degree a b ha s refine ⟨n,?_⟩ intro W let S := vstarSchwartz W.val a b ha W.property.1 W.property.2 have hS : Function.support (S : ℝ→ℂ)⊆Set.Icc a b := Vstar_support W.val a b W.property.1 let G := uniformTwistedSchwartz S a b ha hS (S.smooth ⊤) obtain ⟨C,hC,hsource⟩ := hn S hS (S.smooth ⊤) have hlink (t : ℝ) : (G t : ℝ→ℂ)=Vstar (normTwistedSource W.val t) := by funext x rw [show G t x=uniformTwistedSchwartz S a b ha hS (S.smooth ⊤) t x from rfl, uniformTwistedSchwartz_apply] change FourierBridge.logPhase t (Real.log x)*((Real.sqrt x:ℂ)*W.val x)= (Real.sqrt x:ℂ)*(FourierBridge.logPhase t (Real.log x)*W.val x) ring have hGs (t : ℝ) : Function.support (G t : ℝ→ℂ)⊆Set.Icc a b := by intro x hx change G t x≠0 at hx rw [show G t x=uniformTwistedSchwartz S a b ha hS (S.smooth ⊤) t x from rfl, uniformTwistedSchwartz_apply] at hx exact hS (normTwistedSource_support S t hx) refine ⟨D*C,mul_pos hD hC,?_⟩ intro t i hi x hx rw [←hlink t] exact (hkernel (G t) (hGs t) i hi x hx).trans ((mul_le_mul_of_nonneg_left (hsource t) hD.le).trans_eq (by ring)) theorem uniform_polynomial_kernel_log_separation {κ ι : Type*} [Fintype ι] (P : κ→ℝ→ℝ→ℂ) (hP : HasUniformPolynomialKernel P) (V : ι→ℝ→ℂ) (slope M : ι→ℝ) (hM : ∀i,0≤M i) (hV : ∀i y,V i y≠0 → |y|≤M i) (A J : ℕ) : ∃n : ℕ,∀w : κ,∃C : ℝ,0≤C ∧ ∀θ R : ℝ,0 (1+‖t‖)^J*‖B t‖) ∧ (1+R)^A*(∫t : ℝ,(1+‖t‖)^J*‖B t‖)≤C*(1+‖θ‖)^n ∧ (∀t : ℝ,(1+R)^A*(1+‖t‖)^J*‖B t‖≤C*(1+‖θ‖)^n) := by obtain ⟨n,hn⟩ := hP.2 A (J+(volume : Measure ℝ).integrablePower) obtain ⟨C,hC,hsep⟩ := LocalLogFourier.coupled_positive_log_separation_linear_constant V slope M hM hV A J refine ⟨n,?_⟩ intro w obtain ⟨D,hD,hkernel⟩ := hn w refine ⟨C*D,mul_nonneg hC hD.le,?_⟩ intro θ R hR obtain ⟨B,hB,hi,hb,hp⟩ := hsep (CubicReflectionKernel.paperKernel (Vstar (P w θ))) (hP.1 w θ) (D*(1+‖θ‖)^n) (by positivity) (hkernel θ) R hR refine ⟨B,hB,hi,?_,?_⟩ · exact hb.trans_eq (by ring) · intro t exact (hp t).trans_eq (by ring) theorem uniform_polynomial_kernel_three_window {κ : Type*} (P : κ→ℝ→ℝ→ℂ) (hP : HasUniformPolynomialKernel P) (V₀ V₁ V₂ : ℝ→ℂ) (M₀ M₁ M₂ : ℝ) (hM₀ : 0≤M₀) (hM₁ : 0≤M₁) (hM₂ : 0≤M₂) (hV₀ : ∀y,V₀ y≠0 → |y|≤M₀) (hV₁ : ∀y,V₁ y≠0 → |y|≤M₁) (hV₂ : ∀y,V₂ y≠0 → |y|≤M₂) (A : ℕ) : ∃n : ℕ,∀w : κ,∃C : ℝ,0≤C ∧ ∀θ R : ℝ,0 assumption have hv : ∀i y,V i y≠0 → |y|≤M i := by intro i; fin_cases i <;> assumption obtain ⟨n,hn⟩ := uniform_polynomial_kernel_log_separation P hP V slope M hm hv A 0 refine ⟨n,?_⟩ intro w obtain ⟨C,hC,h⟩ := hn w refine ⟨C,hC,?_⟩ intro θ R hR obtain ⟨B,hB,hi,hbound,hpoint⟩ := h θ R hR refine ⟨B,?_,by simpa only [pow_zero,one_mul] using hbound⟩ intro r u v simpa [V,slope,Fin.prod_univ_succ,Fin.sum_univ_succ,mul_assoc,add_assoc] using hB ![r,u,v] end CompletedHeight open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff namespace CompletedHeight open CompletedGauss hiding O open ActualEisensteinCubic open CanonicalQuadraticSieve hiding O theorem uniform_polynomial_smooth_quadratic {κ : Type*} (V₀ V₁ V₂ : ℝ→ℂ) (M₀ M₁ M₂ : ℝ) (hM₀ : 0≤M₀) (hM₁ : 0≤M₁) (hM₂ : 0≤M₂) (hV₀ : ∀y,V₀ y≠0 → |y|≤M₀) (hV₁ : ∀y,V₁ y≠0 → |y|≤M₁) (hV₂ : ∀y,V₂ y≠0 → |y|≤M₂) (hV₀n : ∀y,‖V₀ y‖≤1) (hV₁n : ∀y,‖V₁ y‖≤1) (hV₂n : ∀y,‖V₂ y‖≤1) (P : κ→ℝ→ℝ→ℂ) (hP : HasUniformPolynomialKernel P) (A : ℕ) (ε : ℝ) (hε : 0<ε) : ∃heightDegree : ℕ,∀w : κ,∃C : ℝ,0 V₀ (yr k)*FourierBridge.logPhase t (-2*yr k) let βt : ℝ→Ideal ActualEisensteinCubic.O→Ideal ActualEisensteinCubic.O→ℂ := fun t n v => β n v*(V₁ (yn n)*FourierBridge.logPhase t (yn n))*(V₂ (yb v)*FourierBridge.logPhase t (3*yb v)) have hphase (t x : ℝ) : ‖FourierBridge.logPhase t x‖=1 := FourierBridge.logPhase_norm t x have hrowPhase (k : idealRange K) (t : ℝ) : ‖rowPhase k t‖≤1 := by simp only [rowPhase,norm_mul,hphase,mul_one] exact hV₀n _ have hβt (t : ℝ) (n : Ideal ActualEisensteinCubic.O) (hn : n∈S) (v : Ideal ActualEisensteinCubic.O) (hv : v∈T) : ‖βt t n v‖≤lengthScale := by simp only [βt,norm_mul,hphase,mul_one] exact (mul_le_of_le_one_right (by positivity) (hV₂n _)).trans ((mul_le_of_le_one_right (norm_nonneg _) (hV₁n _)).trans (hβ n hn v hv)) have hrowPhasec (k : idealRange K) : Continuous (rowPhase k) := continuous_const.mul (FourierBridge.logPhase_continuous_left _) have hβtc (n v : Ideal ActualEisensteinCubic.O) : Continuous (fun t => βt t n v) := (continuous_const.mul (continuous_const.mul (FourierBridge.logPhase_continuous_left _))).mul (continuous_const.mul (FourierBridge.logPhase_continuous_left _)) have hi := hq K U B lengthScale hK hU hB hL S T hS hT βt hβtc hβt rowPhase hrowPhasec hrowPhase g have he (k : idealRange K) : (∑n∈S,∑v∈T,quadraticRow k.val (primaryGenerator (n*v))*β n v* (V₀ (yr k)*V₁ (yn n)*V₂ (yb v)*CubicReflectionKernel.paperKernel (Vstar (P w θ)) (R*Real.exp (-2*yr k+yn n+3*yb v)))) = ∫t : ℝ,g t*(rowPhase k t*∑n∈S,∑v∈T,quadraticRow k.val (primaryGenerator (n*v))*βt t n v) := by have hint (n v : Ideal ActualEisensteinCubic.O) : Integrable (fun t : ℝ => g t*(rowPhase k t*(quadraticRow k.val (primaryGenerator (n*v))*βt t n v))) := by apply g.integrable.mul_bdd (c := ‖quadraticRow k.val (primaryGenerator (n*v))*β n v‖) · exact ((hrowPhasec k).mul (continuous_const.mul (hβtc n v))).aestronglyMeasurable · filter_upwards [] with t simp only [rowPhase,βt,norm_mul,hphase,mul_one] have hv01 : ‖V₀ (yr k)‖*‖V₁ (yn n)‖≤1 := by simpa only [one_mul] using mul_le_mul (hV₀n (yr k)) (hV₁n (yn n)) (norm_nonneg _) zero_le_one have hv012 : (‖V₀ (yr k)‖*‖V₁ (yn n)‖)*‖V₂ (yb v)‖≤1 := by simpa only [one_mul] using mul_le_mul hv01 (hV₂n (yb v)) (norm_nonneg _) zero_le_one calc _ = (‖quadraticRow k.val (primaryGenerator (n*v))‖*‖β n v‖)* ((‖V₀ (yr k)‖*‖V₁ (yn n)‖)*‖V₂ (yb v)‖) := by ring _ ≤ (‖quadraticRow k.val (primaryGenerator (n*v))‖*‖β n v‖)*1 := mul_le_mul_of_nonneg_left hv012 (by positivity) _ = _ := by ring simp only [Finset.mul_sum] rw [integral_finsetSum _ (fun n hn => integrable_finsetSum _ (fun v hv => hint n v))] apply Finset.sum_congr rfl intro n hn rw [integral_finsetSum _ (fun v hv => hint n v)] apply Finset.sum_congr rfl intro v hv rw [hsep (yr k) (yn n) (yb v),←integral_const_mul] apply integral_congr_ae filter_upwards [] with t dsimp [rowPhase,βt] ring simp_rw [he] apply hi.trans have hpow : 0<(1+R)^A := by positivity have hmass : (∫t : ℝ,‖g t‖)≤Ck/(1+R)^A := (le_div_iff₀ hpow).mpr (by simpa only [mul_comm] using hg) have hmass2 := pow_le_pow_left₀ (integral_nonneg (fun t => norm_nonneg _)) hmass 2 have hbase : 0≤Cq*(K*(U*B))^ε*(K+U*B)*(U*B)*lengthScale^2 := by positivity calc _ ≤ (Cq*(K*(U*B))^ε*(K+U*B)*(U*B)*lengthScale^2)*(Ck/(1+R)^A)^2 := mul_le_mul_of_nonneg_left hmass2 hbase _ ≤ (Cq*(K*(U*B))^ε*(K+U*B)*(U*B)*lengthScale^2)*((Ck^2+1)/(1+R)^(2*A)) := by apply mul_le_mul_of_nonneg_left _ hbase rw [div_pow,←pow_mul] have hp : A*2=2*A := Nat.mul_comm _ _ rw [hp] exact div_le_div_of_nonneg_right (by nlinarith : Ck^2≤Ck^2+1) (by positivity) _ = (Cq*(Ck^2+1))*((K*(U*B))^ε*(K+U*B)*(U*B)*lengthScale^2)/(1+R)^(2*A) := by ring _ ≤ _ := by have hb := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hCoeff (by positivity : 0≤(K*(U*B))^ε*(K+U*B)*(U*B)*lengthScale^2)) (by positivity : 0≤(1+R)^(2*A)) convert hb using 1 <;> first | rfl | ring end CompletedHeight open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff namespace CompletedHeight open CompletedGauss hiding O open ActualEisensteinCubic CompletedDyadic open CanonicalQuadraticSieve hiding O theorem uniform_polynomial_smooth_series_rowPhase {κ : Type*} (V₀ V₁ V₂ : ℝ→ℂ) (M₀ M₁ M₂ : ℝ) (hM₀ : 0≤M₀) (hM₁ : 0≤M₁) (hM₂ : 0≤M₂) (hV₀ : ∀y,V₀ y≠0 → |y|≤M₀) (hV₁ : ∀y,V₁ y≠0 → |y|≤M₁) (hV₂ : ∀y,V₂ y≠0 → |y|≤M₂) (hV₀n : ∀y,‖V₀ y‖≤1) (hV₁n : ∀y,‖V₁ y‖≤1) (hV₂n : ∀y,‖V₂ y‖≤1) (P : κ→ℝ→ℝ→ℂ) (hP : HasUniformPolynomialKernel P) (deltaLoss ρ q : ℝ) (hδ : 0 ‖σ i k*completedSmoothDyadicBlock V₀ V₁ V₂ (P w θ) K Y ρ q S T β i k‖)) ∧ (∑k : idealRange K,‖∑'i : ℕ×ℕ×ℕ, σ i k*completedSmoothDyadicBlock V₀ V₁ V₂ (P w θ) K Y ρ q S T β i k‖^2) ≤(C*(1+‖θ‖)^heightDegree)*(K*Y)^(2*deltaLoss)*(K+Y)/H := by obtain ⟨A,hA⟩ := exists_nat_gt (deltaLoss+1/2) obtain ⟨heightDegree,hheight⟩ := uniform_polynomial_smooth_quadratic V₀ V₁ V₂ M₀ M₁ M₂ hM₀ hM₁ hM₂ hV₀ hV₁ hV₂ hV₀n hV₁n hV₂n P hP A (2*deltaLoss) (by positivity) obtain ⟨Cs,hCs,hsum⟩ := normMajorant_sum_bound deltaLoss A ρ q hδ hA hρ hq refine ⟨heightDegree,?_⟩ intro w obtain ⟨Cbase,hCbase,hquadbase⟩ := hheight w refine ⟨2*Cbase*Cs^2,by positivity,?_⟩ intro θ K Y H hK hY hH S T hS hT β hβ σ hσ let Cq := Cbase*(1+‖θ‖)^heightDegree have hCq : 0 Real.sqrt Cq * normMajorant deltaLoss A K Y⁻¹ (ramifiedScale ρ q i.1) H ((2:ℝ)^i.2.2) ((2:ℝ)^i.2.1) have hg0 (i : ℕ×ℕ×ℕ) : 0≤g i := by dsimp [g] exact mul_nonneg (Real.sqrt_nonneg _) (normMajorant_nonneg _ _ _ _ _ _ _ _ hKp (by positivity) (ramifiedScale_pos ρ q hρ hqp _) hH (by positivity) (by positivity)) have henergy (i : ℕ×ℕ×ℕ) : (∑k : idealRange K,‖σ i k*completedSmoothDyadicBlock V₀ V₁ V₂ (P w θ) K Y ρ q S T β i k‖^2) ≤(g i)^2 := by let U : ℝ := (2:ℝ)^i.2.2 let B : ℝ := (2:ℝ)^i.2.1 let r : ℝ := ramifiedScale ρ q i.1 let R : ℝ := Y⁻¹*r^3*B^3*U have hU : 1≤U := one_le_pow₀ (by norm_num) have hB : 1≤B := one_le_pow₀ (by norm_num) have hUp : 0 Real.log ((Ideal.absNorm k.val:ℝ)/K)) (fun n => Real.log ((Ideal.absNorm n:ℝ)/U)) (fun v => Real.log ((Ideal.absNorm v:ℝ)/B)) change (∑k,‖completedSmoothDyadicBlock V₀ V₁ V₂ (P w θ) K Y ρ q S T β i k‖^2)≤_ at h have hphase : (∑k : idealRange K,‖σ i k*completedSmoothDyadicBlock V₀ V₁ V₂ (P w θ) K Y ρ q S T β i k‖^2)≤ ∑k : idealRange K,‖completedSmoothDyadicBlock V₀ V₁ V₂ (P w θ) K Y ρ q S T β i k‖^2 := by apply Finset.sum_le_sum intro k _ apply pow_le_pow_left₀ (norm_nonneg _) rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (hσ i k) apply (hphase.trans h).trans have he : Cq*(K*(U*B))^(2*deltaLoss)*(K+U*B)*(U*B)* (1/(Real.sqrt U*B*r*Real.sqrt H))^2/(1+R)^(2*A)= Cq*((K*(U*B))^(2*deltaLoss)*(K+U*B)/(B*r^2*H)/(1+R)^(2*(A:ℝ))) := by rw [show 2*(A:ℝ)=((2*A:ℕ):ℝ) by norm_num,Real.rpow_natCast] simp only [one_div,inv_pow,mul_pow,Real.sq_sqrt hUp.le,Real.sq_sqrt hH.le] field_simp rw [he] have hm := smooth_energy_le_normMajorant_sq deltaLoss A K Y⁻¹ r H U B hKp (by positivity) hr hH hUp hBp calc _ ≤ Cq*(normMajorant deltaLoss A K Y⁻¹ r H U B)^2 := mul_le_mul_of_nonneg_left hm hCq.le _ = (g i)^2 := by dsimp [g,U,B,r]; rw [mul_pow,Real.sq_sqrt hCq.le] obtain ⟨hs,hb⟩ := hsum K Y H hKp hY hH have hm := finite_tsum_energy_bound (fun i k => σ i k*completedSmoothDyadicBlock V₀ V₁ V₂ (P w θ) K Y ρ q S T β i k) g hg0 (hs.mul_left (Real.sqrt Cq)) henergy refine ⟨hm.1,hm.2.trans ?_⟩ have hb' : (∑'i,g i)≤Real.sqrt Cq*(Cs*(K*Y)^deltaLoss*(Real.sqrt K+Real.sqrt Y)/Real.sqrt H) := by rw [show g=(fun i => Real.sqrt Cq*normMajorant deltaLoss A K Y⁻¹ (ramifiedScale ρ q i.1) H ((2:ℝ)^i.2.2) ((2:ℝ)^i.2.1)) from rfl,tsum_mul_left] exact mul_le_mul_of_nonneg_left hb (Real.sqrt_nonneg _) have hsq := pow_le_pow_left₀ (tsum_nonneg hg0) hb' 2 apply hsq.trans have hroot : (Real.sqrt K+Real.sqrt Y)^2≤2*(K+Y) := by nlinarith [Real.sq_sqrt hKp.le,Real.sq_sqrt hY.le, sq_nonneg (Real.sqrt K-Real.sqrt Y)] simp only [mul_pow,div_pow,Real.sq_sqrt hCq.le,Real.sq_sqrt hH.le] have hp : ((K*Y)^deltaLoss)^2=(K*Y)^(2*deltaLoss) := by rw [←Real.rpow_mul_natCast (mul_pos hKp hY).le] congr 1 ring rw [hp] calc _ ≤ Cq*(Cs^2*(K*Y)^(2*deltaLoss)*(2*(K+Y))/H) := by apply mul_le_mul_of_nonneg_left _ hCq.le exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hroot (by positivity)) hH.le _ = _ := by dsimp [Cq]; ring end CompletedHeight end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.UniformPolynomialHeight namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CompletedHeight section open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff open CompletedGauss hiding O open ActualEisensteinCubic CompletedDyadic open CanonicalQuadraticSieve hiding O theorem uniform_polynomial_reflected_branch_series {κ : Type*} (Wfamily : κ→ℝ→ℝ→ℂ) (hWfamily : HasUniformPolynomialKernel Wfamily) (deltaLoss ρ q : ℝ) (hδ : 0 ‖reflectedBranchBlock P hg j e (Wfamily w θ) K Y ρ q S T η σ i k‖)) ∧ (∑k : idealRange K,‖∑'i : ℕ×ℕ×ℕ,reflectedBranchBlock P hg j e (Wfamily w θ) K Y ρ q S T η σ i k‖^2) ≤(C*(1+‖θ‖)^heightDegree)*(K*Y)^(2*deltaLoss)*(K+Y)/ ((Ideal.absNorm (reflectionExtractedDivisor P j e 0):ℝ)* (Ideal.absNorm (reflectionExtractedDivisor P j e 2):ℝ)) := by have hl : 0≤Real.log 2 := Real.log_nonneg (by norm_num) obtain ⟨heightDegree,hheight⟩ := uniform_polynomial_smooth_series_rowPhase completedShellWindow completedShellWindow completedShellWindow (Real.log 2) (Real.log 2) (Real.log 2) hl hl hl completedShellWindow_support completedShellWindow_support completedShellWindow_support completedShellWindow_norm completedShellWindow_norm completedShellWindow_norm Wfamily hWfamily deltaLoss ρ q hδ hρ hq refine ⟨heightDegree,?_⟩ intro w obtain ⟨C,hC,h⟩ := hheight w refine ⟨C,hC,?_⟩ intro θ K Y hK hY ι _ P _ hg j e S T hS hT η hη σ hσ have hn (v : Fin 3) : 0<(Ideal.absNorm (reflectionExtractedDivisor P j e v):ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun hz => reflectionExtractedDivisor_ne_zero P (fun i => NeZero.ne (P i)) j e v (Ideal.absNorm_eq_zero_iff.mp hz)) exact h θ K Y _ hK hY (mul_pos (hn 0) (hn 2)) S T (fun i I hI => ⟨(hS i I hI).1,(hS i I hI).2.2⟩) (fun i I hI => ⟨(hT i I hI).1,(hT i I hI).2.2⟩) (fun v => reflectedDyadicCoefficient P hg j e (η v) (ramifiedScale ρ q v.1)) (fun i n hn v hv => reflectedDyadicCoefficient_norm P hg j e (η i) (ramifiedScale ρ q i.1) _ _ (ramifiedScale_pos ρ q hρ (by linarith) _) (by positivity) (by positivity) n v (hS i n hn).1 (hT i v hv).1 (hη i n hn v hv) (hS i n hn).2.1 (hT i v hv).2.1) σ hσ theorem uniform_polynomial_reflected_fiber_fixed_scale {κ : Type*} (Wfamily : κ→ℝ→ℝ→ℂ) (hWfamily : HasUniformPolynomialKernel Wfamily) (deltaLoss ρ q B : ℝ) (hδ : 0 IsCoprime (P i) (P j)) → (∀i,P i∣I*Q) → (∀i,¬P i∣rowResidualPart I Q) → ∀e : ι→Fin 3,∀S T : (ℕ×ℕ×ℕ)→Finset (Ideal ActualEisensteinCubic.O), (∀i,∀J∈S i,J≠0 ∧ (2:ℝ)^i.2.2/2≤(Ideal.absNorm J:ℝ) ∧ (Ideal.absNorm J:ℝ)≤(2:ℝ)^i.2.2) → (∀i,∀J∈T i,J≠0 ∧ (2:ℝ)^i.2.1/2≤(Ideal.absNorm J:ℝ) ∧ (Ideal.absNorm J:ℝ)≤(2:ℝ)^i.2.1) → ∀η : (ℕ×ℕ×ℕ)→Ideal ActualEisensteinCubic.O→Ideal ActualEisensteinCubic.O→ℂ, (∀i,∀n∈S i,∀v∈T i,‖η i n v‖≤1) → ∀σ : (ℕ×ℕ×ℕ)→idealRange (completedResidualScale K I Q)→ℂ,(∀i k,‖σ i k‖≤1) → (∑k : idealRange (completedResidualScale K I Q),‖∑'i : ℕ×ℕ×ℕ, reflectedBranchBlock P hg (fun i => completedLocalExponent I F (P i)) e (Wfamily w θ) (completedResidualScale K I Q) (completedBranchScale K (X/c) I F Q P e) ρ q S T η σ i k‖^2) ≤(C*(1+‖θ‖)^heightDegree)*(K*(Ideal.absNorm Q:ℝ))^(10*deltaLoss)*(K+K^2*(Ideal.absNorm Q:ℝ)/X)/ (Ideal.absNorm (rowPowerfulPart I):ℝ) := by obtain ⟨heightDegree,hheight⟩ := uniform_polynomial_reflected_branch_series Wfamily hWfamily deltaLoss ρ q hδ hρ hq refine ⟨heightDegree,?_⟩ intro w obtain ⟨Cbase,hCbase,hbase⟩ := hheight w refine ⟨Cbase*B^(2*deltaLoss+1),by positivity,?_⟩ intro θ K X c hK hX hc hcB I F Q hI hQ hIK hk ι _ P _ hg hcop hpool hres e S T hS hT η hη σ hσ let C := Cbase*(1+‖θ‖)^heightDegree have hC : 0 hJ (Ideal.absNorm_eq_zero_iff.mp hz)) have hj (v : Fin 3) := hn _ (reflectionExtractedDivisor_ne_zero P (fun i => NeZero.ne (P i)) (fun i => completedLocalExponent I F (P i)) e v) have hp := hn (∏i,P i) (Finset.prod_ne_zero_iff.mpr (fun i _ => NeZero.ne (P i))) have hk0 : 0 completedLocalExponent I F (P i)) e S T hS hT η hη σ hσ).2 have hs := completed_scaled_shape (2*deltaLoss) (completedResidualScale K I Q) (completedBranchScale K X I F Q P e) _ c B (by positivity) hk0 hy (mul_pos (hj 0) (hj 2)) hc hcB hB have hcst := completed_actual_fiber_cost deltaLoss K X hδ.le hK hX I F Q hI hQ hIK P hcop hpool hres e have hh := hs.trans (mul_le_mul_of_nonneg_left hcst (by positivity : 0≤B^(2*deltaLoss+1))) apply hb.trans have hfinal := mul_le_mul_of_nonneg_left hh hC.le convert hfinal using 1 <;> (try dsimp [completedResidualScale,completedBranchScale,C]) <;> ring theorem uniform_polynomial_branch_energy {κ : Type*} (Wfamily : κ→ℝ→ℝ→ℂ) (hWfamily : HasUniformPolynomialKernel Wfamily) (deltaLoss ρ q levelBound : ℝ) (hδ : 0 p.val) Subtype.val_injective d.divides have hnorm : (Ideal.absNorm (I*Q):ℝ)≤K*(Ideal.absNorm Q:ℝ) := by simp only [map_mul,Nat.cast_mul] exact mul_le_mul_of_nonneg_right hIK (Nat.cast_nonneg _) have hcount' : (6:ℝ)^(2*d.pool.card)≤Cp*(K*(Ideal.absNorm Q:ℝ))^ε := by have hc : (6:ℝ)^(2*d.pool.card)≤Cp*(Ideal.absNorm (I*Q):ℝ)^ε := by simpa only [Fintype.card_coe] using hcount exact hc.trans (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (Nat.cast_nonneg _) hnorm hε.le) hCp.le) have he := ReflectedFiberData.finite_energy_bound (fun b => (d.branch b).value (Wfamily w θ) X ρ q) d.weight d.weight_bound _ (fun b => hb K X hK hX I F Q hI hQ hIK hk (d.branch b)) change (∑k,‖d.value (Wfamily w θ) X ρ q k‖^2)≤_ at he apply he.trans have hc : (Fintype.card (Fin rays×(d.pool→Fin 6)):ℝ)^2=(rays:ℝ)^2*(6:ℝ)^(2*d.pool.card) := by simp only [Fintype.card_prod,Fintype.card_fun,Fintype.card_fin,Fintype.card_coe,Nat.cast_mul,Nat.cast_pow] rw [mul_pow,←pow_mul,Nat.mul_comm d.pool.card 2] norm_num rw [hc] have hnQ : 0<(Ideal.absNorm Q:ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun hz => hQ (Ideal.absNorm_eq_zero_iff.mp hz)) have hKQ : 0 rowMaskPart I Q), (∑I∈completedRowFiber rows Q A T,‖completedT (Ψ I) (Wfamily w θ) X‖^2)≤B/(Ideal.absNorm A:ℝ) := by intro A hA T hT by_cases hempty : (completedRowFiber rows Q A T).Nonempty · obtain ⟨I,hIf,d,hd⟩ := hexact A hA T hT hempty obtain ⟨hIr,hIA,hIT⟩ := Finset.mem_filter.mp hIf have hI := (hrows I hIr).1 have hIK := (hrows I hIr).2 have hk := one_le_completedResidualScale K I Q hI hIK have hdenergy := hm rays K X hK hX I F Q hI hQ hIK hk d have hembed := completedRowFiber_energy_le rows Q A T hbad K hrows (d.idealValue (Wfamily w θ) X ρ q) have hscale : K/((Ideal.absNorm A:ℝ)*(Ideal.absNorm T:ℝ))=completedResidualScale K I Q := by simp only [completedResidualScale,hIA,hIT] rw [hscale] at hembed simp_rw [ReflectedFiberData.idealValue_at] at hembed have hsource : (∑J∈completedRowFiber rows Q A T,‖completedT (Ψ J) (Wfamily w θ) X‖^2)= ‖lengthScale‖^2*∑J∈completedRowFiber rows Q A T,‖d.idealValue (Wfamily w θ) X ρ q (rowResidualPart J Q)‖^2 := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro J hJ rw [hd J hJ,norm_mul,mul_pow] rw [hsource] apply (mul_le_mul_of_nonneg_left (hembed.trans hdenergy) (sq_nonneg _)).trans apply le_of_eq dsimp [B,Cm] rw [hIA] ring · rw [Finset.not_nonempty_iff_eq_empty.mp hempty,Finset.sum_empty] exact div_nonneg hB (Nat.cast_nonneg _) have hh := ho rows Q hQ (fun I => ‖completedT (Ψ I) (Wfamily w θ) X‖^2) B hB hblocks apply hh.trans_eq dsimp [B,Cm] ring theorem uniform_polynomial_mean_square_of_exact_reflection {κ : Type*} (Wfamily : κ→ℝ→ℝ→ℂ) (hWfamily : HasUniformPolynomialKernel Wfamily) (ε ρ q levelBound : ℝ) (hε : 0<ε) (hρ : 0<ρ) (hq : 1 hQ (Ideal.absNorm_eq_zero_iff.mp hz)) let A : ℝ := C*(rays:ℝ)^2*‖lengthScale‖^2*(Ideal.absNorm Q:ℝ)^deltaLoss have hA : 0≤A := by dsimp [A]; positivity rw [←completedRowDyad_sum rows K (by linarith : 0≤K) (fun I hI => (hrows I hI).2) (fun I => ‖completedT (Ψ I) (Wfamily w θ) X‖^2)] have hper (j : ℕ) (hj : j∈Finset.range (completedRowDyadicLength K+1)) : (∑I∈completedRowDyad rows j,‖completedT (Ψ I) (Wfamily w θ) X‖^2)≤ A*(((2:ℝ)^j*(Ideal.absNorm Q:ℝ))^s* ((2:ℝ)^j+((2:ℝ)^j)^2*(Ideal.absNorm Q:ℝ)/X)) := by have hb := h rays ((2:ℝ)^j) X (one_le_pow₀ (by norm_num)) hX (completedRowDyad rows j) F Q hQ hbad (fun I hI => ⟨(completedRowDyad_bounds rows j (fun I hI => (hrows I hI).1) I hI).1, (completedRowDyad_bounds rows j (fun I hI => (hrows I hI).1) I hI).2.2⟩) Ψ lengthScale (hmodels j hj) convert hb using 1 dsimp [A,s,C] ring calc _ ≤ ∑j∈Finset.range (completedRowDyadicLength K+1), A*(((2:ℝ)^j*(Ideal.absNorm Q:ℝ))^s* ((2:ℝ)^j+((2:ℝ)^j)^2*(Ideal.absNorm Q:ℝ)/X)) := Finset.sum_le_sum hper _ = A*∑j∈Finset.range (completedRowDyadicLength K+1), ((2:ℝ)^j*(Ideal.absNorm Q:ℝ))^s* ((2:ℝ)^j+((2:ℝ)^j)^2*(Ideal.absNorm Q:ℝ)/X) := (Finset.mul_sum _ _ _).symm _ ≤ A*((16*(2:ℝ)^s)*(K*(Ideal.absNorm Q:ℝ))^s*(K+K^2*(Ideal.absNorm Q:ℝ)/X)) := mul_le_mul_of_nonneg_left (completedRowDyadic_shape s K X (Ideal.absNorm Q:ℝ) hs hK (by linarith) hnQ) hA _ ≤ (C*(16*(2:ℝ)^s))*(rays:ℝ)^2*‖lengthScale‖^2*(K*(Ideal.absNorm Q:ℝ))^ε* (K+K^2*(Ideal.absNorm Q:ℝ)/X) := by have hnq : (Ideal.absNorm Q:ℝ)^deltaLoss≤(K*(Ideal.absNorm Q:ℝ))^deltaLoss := by apply Real.rpow_le_rpow hnQ.le _ hδ.le exact le_mul_of_one_le_left hnQ.le hK have hpower : (Ideal.absNorm Q:ℝ)^deltaLoss*(K*(Ideal.absNorm Q:ℝ))^s≤ (K*(Ideal.absNorm Q:ℝ))^ε := by apply (mul_le_mul_of_nonneg_right hnq (by positivity)).trans_eq rw [←Real.rpow_add (mul_pos (by linarith) hnQ)] congr 1 dsimp [s,deltaLoss] ring calc _ = ((C*(16*(2:ℝ)^s))*(rays:ℝ)^2*‖lengthScale‖^2*(K+K^2*(Ideal.absNorm Q:ℝ)/X))* ((Ideal.absNorm Q:ℝ)^deltaLoss*(K*(Ideal.absNorm Q:ℝ))^s) := by dsimp [A]; ring _ ≤ ((C*(16*(2:ℝ)^s))*(rays:ℝ)^2*‖lengthScale‖^2*(K+K^2*(Ideal.absNorm Q:ℝ)/X))* (K*(Ideal.absNorm Q:ℝ))^ε := mul_le_mul_of_nonneg_left hpower (by positivity) _ = _ := by ring _ = _ := by dsimp [C]; ring theorem uniform_polynomial_short_completed_average {κ : Type*} (Wfamily : κ→ℝ→ℝ→ℂ) (hWfamily : HasUniformPolynomialKernel Wfamily) (ε ρ q levelBound : ℝ) (hε : 0<ε) (hρ : 0<ρ) (hq : 1 hG (Ideal.absNorm_eq_zero_iff.mp hz)) let A : ℝ := Cr*(rays:ℝ)^2*‖lengthScale‖^2*(K*(Ideal.absNorm G:ℝ)*F)^ε have hA : 0≤A := by dsimp [A]; positivity have hcompleted (f : idealRange F) (H : Ideal ActualEisensteinCubic.O) (hH : H∈shortCubeRange (Z^(1/1000:ℝ))) : (∑I : rows,‖completedT (Ψ f I.val) (Wfamily w θ) (X/(Ideal.absNorm H:ℝ)^3)‖^2)≤ A*(K+K^2*(Ideal.absNorm G:ℝ)*(Ideal.absNorm f.val:ℝ)*(Ideal.absNorm H:ℝ)^3/X) := by have hf0 := (mem_idealRange.mp f.property).1.1 have hfN := (mem_idealRange.mp f.property).2 have hHN := (mem_shortCubeRange _ H).mp hH have hH1 : 1≤(Ideal.absNorm H:ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz => hHN.1 (Ideal.absNorm_eq_zero_iff.mp hz)) have hH0 : (Ideal.absNorm H:ℝ)≠0 := by linarith have hscale := short_cube_scales Z K (Ideal.absNorm G:ℝ) X F (Ideal.absNorm H:ℝ) hZ hK hG1 hF hFZ hH1 hHN.2.le hmargin have hb := hr rays K (X/(Ideal.absNorm H:ℝ)^3) hK hscale.1 rows f.val (G*f.val) (mul_ne_zero hG hf0) (fun P hP => dvd_trans (hbad P hP) (dvd_mul_right G f.val)) hrows (Ψ f) lengthScale (hmodels f H hH) rw [Finset.sum_coe_sort (s := rows) (f := fun I : Ideal ActualEisensteinCubic.O => ‖completedT (Ψ f I) (Wfamily w θ) (X/(Ideal.absNorm H:ℝ)^3)‖^2)] apply hb.trans simp only [map_mul,Nat.cast_mul] have hpow : (K*((Ideal.absNorm G:ℝ)*(Ideal.absNorm f.val:ℝ)))^ε≤ (K*(Ideal.absNorm G:ℝ)*F)^ε := by apply Real.rpow_le_rpow (by positivity) _ hε.le have hh := mul_le_mul_of_nonneg_left hfN (show 0≤K*(Ideal.absNorm G:ℝ) by positivity) nlinarith have hshape : K+K^2*((Ideal.absNorm G:ℝ)*(Ideal.absNorm f.val:ℝ))/(X/(Ideal.absNorm H:ℝ)^3)= K+K^2*(Ideal.absNorm G:ℝ)*(Ideal.absNorm f.val:ℝ)*(Ideal.absNorm H:ℝ)^3/X := by field_simp rw [hshape] change Cr*(rays:ℝ)^2*‖lengthScale‖^2*(K*((Ideal.absNorm G:ℝ)*(Ideal.absNorm f.val:ℝ)))^ε*_≤A*_ have hX0 : 0 Ψ f I.val) (fun f I z => hΨ f I.val z) (Wfamily w θ) hcompleted have hsum (f : idealRange F) : (∑I : rows,‖shortCompletedSum (Ψ f I.val) (Wfamily w θ) X (Z^(1/1000:ℝ))‖^2)= ∑I∈rows,‖shortCompletedSum (Ψ f I) (Wfamily w θ) X (Z^(1/1000:ℝ))‖^2 := Finset.sum_coe_sort (s := rows) (f := fun I : Ideal ActualEisensteinCubic.O => ‖shortCompletedSum (Ψ f I) (Wfamily w θ) X (Z^(1/1000:ℝ))‖^2) simp_rw [hsum] at hb apply hb.trans_eq dsimp [A,Cr] ring end open CompletedGauss hiding O open ActualEisensteinCubic open CanonicalQuadraticSieve hiding O theorem short_completed_average_uniform_height (a b : ℝ) (ha : 0 normTwistedSource W.val) (normTwistedSource_uniform_polynomial_kernel a b ha) ε ρ q levelBound hε hρ hq hlevel refine ⟨n,?_⟩ intro W hsupp hW exact hn ⟨W,hsupp,hW⟩ theorem short_completed_average_uniform_twist (a b : ℝ) (ha : 0Ideal.span {z}), v (u.val*idealGenerator I) := by letI explicitWitness27 := OAI.CompletedUnitRows.instFintypeUnitsO exact ( by let f : ActualEisensteinCubic.Oˣ×Ideal ActualEisensteinCubic.O→ℝ := fun p=>v (p.1.val*idealGenerator p.2) have hinj : Set.InjOn unitIdealPoint T := by intro z hz w hw he exact unitIdealPoint_inj z w (hT z hz) (hT w hw) he have he : (∑z∈T,v z)=∑p∈T.image unitIdealPoint,f p := by rw [Finset.sum_image hinj] apply Finset.sum_congr rfl intro z hz dsimp [f,unitIdealPoint] rw [rowUnit_spec z (hT z hz)] have hsub : T.image unitIdealPoint ⊆ (Finset.univ : Finset ActualEisensteinCubic.Oˣ) ×ˢ T.image (fun z=>Ideal.span {z}) := by intro p hp obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hp exact Finset.mem_product.mpr ⟨Finset.mem_univ _,Finset.mem_image.mpr ⟨z,hz,rfl⟩⟩ rw [he] calc _ ≤ ∑p∈(Finset.univ : Finset ActualEisensteinCubic.Oˣ) ×ˢ T.image (fun z=>Ideal.span {z}),f p := Finset.sum_le_sum_of_subset_of_nonneg hsub (fun p _ _=>hv _) _ = _ := by rw [Finset.sum_product] ) lemma image_span_nonzero_norm (T : Finset ActualEisensteinCubic.O) (K : ℝ) (hT : ∀z∈T,z≠0 ∧ (Ideal.absNorm (Ideal.span {z}):ℝ)≤K) : ∀I∈T.image (fun z=>Ideal.span {z}),I≠0 ∧ (Ideal.absNorm I:ℝ)≤K := by intro I hI obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hI exact ⟨Ideal.span_singleton_eq_bot.not.mpr (hT z hz).1,(hT z hz).2⟩ lemma unit_card : letI explicitWitness27 := OAI.CompletedUnitRows.instFintypeUnitsO Fintype.card ActualEisensteinCubic.Oˣ=6 := by letI explicitWitness27 := OAI.CompletedUnitRows.instFintypeUnitsO exact ( by simpa only [Nat.card_eq_fintype_card] using PrimaryIdealUnitReindex.card_units_eq_six ) end CompletedUnitRows end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.UnitRows namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff namespace CompletedUnitRows open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O open CompletedGauss hiding O open CanonicalQuadraticSieve hiding O open CanonicalRowCompletion noncomputable abbrev instFintypeUnitsO_1 : Fintype ActualEisensteinCubic.Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units def unitRowFamily (Ψ : ActualEisensteinCubic.O→*ℂ) (mask : ActualEisensteinCubic.O) (u : ActualEisensteinCubic.Oˣ) {F : ℝ} (f : idealRange F) (I : Ideal ActualEisensteinCubic.O) : ActualEisensteinCubic.O→*ℂ := rowTwist Ψ mask (idealGenerator f.val) (u.val*idealGenerator I) lemma unitRowFamily_norm (Ψ : ActualEisensteinCubic.O→*ℂ) (hΨ : ∀x,‖Ψ x‖≤1) (mask : ActualEisensteinCubic.O) (u : ActualEisensteinCubic.Oˣ) {F : ℝ} (f : idealRange F) (I : Ideal ActualEisensteinCubic.O) (x : ActualEisensteinCubic.O) : ‖unitRowFamily Ψ mask u f I x‖≤1 := rowTwist_norm Ψ hΨ _ _ _ _ lemma rowTwist_normHeight (Ψ : ActualEisensteinCubic.O→*ℂ) (mask f z : ActualEisensteinCubic.O) (θ : ℝ) : rowTwist (SecondPassArithmetic.normHeightTwist Ψ θ) mask f z = SecondPassArithmetic.normHeightTwist (rowTwist Ψ mask f z) θ := by unfold rowTwist exact (SecondPassArithmetic.normHeightTwist_mul Ψ _ θ).symm theorem short_completed_elements_uniform_twist (a b : ℝ) (ha : 0Ideal.span {z})) K (X/(Ideal.absNorm H:ℝ)^3) ρ q levelBound f.val (G*f.val) (CompletedHeight.normTwistedSource W θ) (unitRowFamily Ψ mask u f) lengthScale) → (∑f : idealRange F,∑z∈T, ‖shortCompletedSum (rowTwist (SecondPassArithmetic.normHeightTwist Ψ θ) mask (idealGenerator f.val) z) W X (Z^(1/1000:ℝ))‖^2)/F≤ (C*(1+‖θ‖)^heightDegree)*(rays:ℝ)^2*‖lengthScale‖^2*(K*(Ideal.absNorm G:ℝ)*F)^ε*K*Z^ε := by letI explicitWitness27 := OAI.CompletedUnitRows.instFintypeUnitsO_1 exact ( by obtain ⟨n,hn⟩ := CompletedHeight.short_completed_average_uniform_twist a b ha ε ρ q levelBound hε hρ hq hlevel refine ⟨n,?_⟩ intro W hsupp hW obtain ⟨C,hC,hbound⟩ := hn W hsupp hW refine ⟨6*C,by positivity,?_⟩ intro θ rays Z K X F hZ hK hF hFZ G hG hbad hmargin T hT Ψ hΨ mask lengthScale hmodels let rows := T.image (fun z=>Ideal.span {z}) let R : ℝ := (C*(1+‖θ‖)^n)*(rays:ℝ)^2*‖lengthScale‖^2*(K*(Ideal.absNorm G:ℝ)*F)^ε*K*Z^ε have hrows := image_span_nonzero_norm T K hT have hu (u : ActualEisensteinCubic.Oˣ) : (∑f : idealRange F,∑I∈rows, ‖shortCompletedSum (rowTwist (SecondPassArithmetic.normHeightTwist Ψ θ) mask (idealGenerator f.val) (u.val*idealGenerator I)) W X (Z^(1/1000:ℝ))‖^2)/F≤R := by simp_rw [rowTwist_normHeight] exact hbound θ rays Z K X F hZ hK hF hFZ G hG hbad hmargin rows hrows (unitRowFamily Ψ mask u) (unitRowFamily_norm Ψ hΨ mask u) lengthScale (hmodels u) have hsum : (∑f : idealRange F,∑z∈T, ‖shortCompletedSum (rowTwist (SecondPassArithmetic.normHeightTwist Ψ θ) mask (idealGenerator f.val) z) W X (Z^(1/1000:ℝ))‖^2)≤ ∑u : ActualEisensteinCubic.Oˣ,∑f : idealRange F,∑I∈rows, ‖shortCompletedSum (rowTwist (SecondPassArithmetic.normHeightTwist Ψ θ) mask (idealGenerator f.val) (u.val*idealGenerator I)) W X (Z^(1/1000:ℝ))‖^2 := by conv_rhs => rw [Finset.sum_comm] apply Finset.sum_le_sum intro f _ exact sum_nonzero_element_le_units T (fun z hz=>(hT z hz).1) _ (fun z=>sq_nonneg _) calc _ ≤ (∑u : ActualEisensteinCubic.Oˣ,∑f : idealRange F,∑I∈rows, ‖shortCompletedSum (rowTwist (SecondPassArithmetic.normHeightTwist Ψ θ) mask (idealGenerator f.val) (u.val*idealGenerator I)) W X (Z^(1/1000:ℝ))‖^2)/F := div_le_div_of_nonneg_right hsum (by linarith) _ = ∑u : ActualEisensteinCubic.Oˣ,(∑f : idealRange F,∑I∈rows, ‖shortCompletedSum (rowTwist (SecondPassArithmetic.normHeightTwist Ψ θ) mask (idealGenerator f.val) (u.val*idealGenerator I)) W X (Z^(1/1000:ℝ))‖^2)/F := Finset.sum_div _ _ _ _ ≤ ∑u : ActualEisensteinCubic.Oˣ,R := Finset.sum_le_sum (fun u _=>hu u) _ = _ := by simp only [Finset.sum_const,Finset.card_univ,unit_card,nsmul_eq_mul]; dsimp [R]; ring ) end CompletedUnitRows open scoped BigOperators Classical namespace SecondPassArithmetic section open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct) open ConcreteTraceCRT (eisEmbedding) open CanonicalCoefficientClass (IsBaseRayTwist) open RayFourExpansion (RayCharacter) structure CanonicalStateCondition (base : ActualEisensteinCubic.O→*ℂ) (bad : Ideal ActualEisensteinCubic.O) (Z η : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F K : ℝ) : Prop where coefficient : IsBaseRayTwist base Ψ mask_ne_zero : m≠0 column_pos : 0sq_nonneg _) dsimp only [total] rw [Complex.re_sum] linarith have hc : ‖total-zero-tail‖≤ scale*B := by calc _ = scale*‖(scale:ℂ)⁻¹*(total-zero-tail)‖ := by rw [norm_mul,norm_inv,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hscale] field_simp _ ≤ _ := mul_le_mul_of_nonneg_left hcenter hscale.le apply hnonzero.trans calc total.re ≤ ‖total‖ := Complex.re_le_norm _ _ = ‖(total-zero-tail)+zero+tail‖ := by congr 1; ring _ ≤ ‖total-zero-tail‖+‖zero‖+‖tail‖ := norm_add₃_le _ ≤ _ := by linarith theorem reopenedCanonicalRow_nonzero_twoPassage (g V : 𝓢(ℝ,ℂ)) (M Nv : ℝ) (hM : 0≤M) (hNv : 0≤Nv) (hgM : ∀t,g t≠0→|t|≤M) (hV : ∀t,V t≠0→|t|≤Nv) (hWin : ∀t,g t≠0→V t=1) (ε deltaLoss : ℝ) (hε : 0<ε) (hδ : 0Ideal.span {p i})) (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (_hc:∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hpr:∀i,lambda^2∣p i-1) (pool:Finset ι) (Q:Finset (ι→₀ℕ)) (labels:Finset (Ideal ActualEisensteinCubic.O)) (β:Ideal ActualEisensteinCubic.O→(ι→₀ℕ)→ℂ) (Ψ:ActualEisensteinCubic.O→*ℂ) (m:ActualEisensteinCubic.O) (Γ t Ksrc Kcut ell B F H U:ℝ), 0≤Γ → 0frequencyTwist g t (columnLog p ell S))) Ksrc).re≤ ‖canonicalSourceZero p hp hcop hg pool bs labels a Ψt Ψt m m g g rowMajorant Ksrc ell‖+ ‖canonicalSourceTail p hp hcop hg pool bs labels a Ψt Ψt m m g g rowMajorant Ksrc Kcut ell‖+ (ell*B^2*F)*(Ksrc/Kcut)*Cfirst*(globalFirstRowCap Kcut ell B F)^deltaLoss* Real.sqrt (globalFirstQuantitativeBudget p hp hcop hg pool (canonicalSourceBlocks pool bs) Ψt m windows₁ C₁ Cd₁ Ct₁ (Γ^2) ε Kcut ell B F M H U A J N true)* Real.sqrt (globalFirstQuantitativeBudget p hp hcop hg pool (canonicalSourceBlocks pool bs) Ψt m windows₂ C₂ Cd₂ Ct₂ (Γ^2) ε Kcut ell B F M H U A J N false) := by obtain ⟨windows₁,windows₂,Cfirst,C₁,Cd₁,Ct₁,C₂,Cd₂,Ct₂,hCf,hC₁,hCd₁,hCt₁,hC₂,hCd₂,hCt₂, hw₁,hs₁,hb₁,hw₂,hs₂,hb₂,htransfer⟩ := reopenedCanonicalRow_twoPassage_uniform_height rowMajorant g V M Nv hM hNv hgM hV hWin ε deltaLoss hε hδ A J N refine ⟨windows₁,windows₂,Cfirst,C₁,Cd₁,Ct₁,C₂,Cd₂,Ct₂,hCf,hC₁,hCd₁,hCt₁,hC₂,hCd₂,hCt₂, hw₁,hs₁,hb₁,hw₂,hs₂,hb₂,?_⟩ intro ι _ p hp _ hinj hcop hg hc hpr pool Q labels β Ψ m Γ t Ksrc Kcut ell B F H U hΓ hKsrc hKcut hell hB hF hH hU hMU hΨ hβ hQ hQB hsf hf dsimp only have ht := htransfer p hp hinj hcop hg hc hpr pool Q labels β Ψ m Γ t Ksrc Kcut ell B F H U hΓ hKsrc hKcut hell hB hF hH hU hMU hΨ hβ hQ hQB hsf hf have hscale : 0reopenedCanonicalRow p hp hcop hg pool Q (β I) Ψ m (ConcretePrimeRowBridge.idealGenerator I) (fun S=>frequencyTwist g t (columnLog p ell S))) Ksrc (ell*B^2*F) ((Ksrc/Kcut)*Cfirst*(globalFirstRowCap Kcut ell B F)^deltaLoss* Real.sqrt (globalFirstQuantitativeBudget p hp hcop hg pool (canonicalSourceBlocks pool (reopenedCubeFamily Q)) (normHeightTwist Ψ t) m windows₁ C₁ Cd₁ Ct₁ (Γ^2) ε Kcut ell B F M H U A J N true)* Real.sqrt (globalFirstQuantitativeBudget p hp hcop hg pool (canonicalSourceBlocks pool (reopenedCubeFamily Q)) (normHeightTwist Ψ t) m windows₂ C₂ Cd₂ Ct₂ (Γ^2) ε Kcut ell B F M H U A J N false)) (canonicalSourceZero p hp hcop hg pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) (normHeightTwist Ψ t) (normHeightTwist Ψ t) m m g g rowMajorant Ksrc ell) (canonicalSourceTail p hp hcop hg pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) (normHeightTwist Ψ t) (normHeightTwist Ψ t) m m g g rowMajorant Ksrc Kcut ell) hKsrc hscale (by simpa only [Complex.ofReal_mul,Complex.ofReal_pow] using ht) exact hb.trans_eq (by ring) end SecondPassArithmetic open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff namespace CubicEisenstein def euclideanAxisPath (p : EuclideanSpatial) (j : Fin 3) (t : ℝ) : EuclideanSpatial := WithLp.toLp 2 (Function.update p.ofLp j t) lemma euclideanAxisPath_affine (p : EuclideanSpatial) (j : Fin 3) (t : ℝ) : euclideanAxisPath p j t=p+(t-p j)•euclideanCoordinateVector j := by apply (WithLp.equiv 2 (Fin 3→ℝ)).injective funext k by_cases hk : k=j · subst k simp [euclideanAxisPath,euclideanCoordinateVector] · simp [euclideanAxisPath,euclideanCoordinateVector,Function.update,hk] lemma euclideanAxisPath_self (p : EuclideanSpatial) (j : Fin 3) : euclideanAxisPath p j (p j)=p := by rw [euclideanAxisPath_affine,sub_self,zero_smul,add_zero] lemma euclideanAxisPath_hasDerivAt (p : EuclideanSpatial) (j : Fin 3) (t : ℝ) : HasDerivAt (euclideanAxisPath p j) (euclideanCoordinateVector j) t := by have he : euclideanAxisPath p j=(fun t => p+(t-p j)•euclideanCoordinateVector j) := funext (euclideanAxisPath_affine p j) rw [he] simpa only [sub_zero,one_smul,zero_add,Pi.add_apply,id_eq] using! (hasDerivAt_const t p).add (((hasDerivAt_id t).sub_const (p j)).smul_const (euclideanCoordinateVector j)) lemma euclideanAxisSlice_deriv (f : EuclideanSpatial→ℂ) (p : EuclideanSpatial) (j : Fin 3) (t : ℝ) (hf : DifferentiableAt ℝ f (euclideanAxisPath p j t)) : deriv (axisSlice (fun q => f (WithLp.toLp 2 q)) p.ofLp j) t= fderiv ℝ f (euclideanAxisPath p j t) (euclideanCoordinateVector j) := (hf.hasFDerivAt.comp_hasDerivAt t (euclideanAxisPath_hasDerivAt p j t)).deriv lemma euclideanAxisSlice_derivatives (f : EuclideanSpatial→ℂ) (hf : ∀p,0

f (WithLp.toLp 2 q)) p.ofLp j) (p j)= fderiv ℝ f p (euclideanCoordinateVector j) ∧ deriv (deriv (axisSlice (fun q => f (WithLp.toLp 2 q)) p.ofLp j)) (p j)= fderiv ℝ (fun q => fderiv ℝ f q (euclideanCoordinateVector j)) p (euclideanCoordinateVector j) := by constructor · simpa only [euclideanAxisPath_self] using euclideanAxisSlice_deriv f p j (p j) (by simpa only [euclideanAxisPath_self] using (hf p hp).differentiableAt (by simp)) · have hc : ContinuousAt (fun t => euclideanAxisPath p j t 2) (p j) := (by fun_prop : Continuous (fun q : EuclideanSpatial => q 2)).continuousAt.comp (euclideanAxisPath_hasDerivAt p j (p j)).continuousAt have hpos : 0 f (WithLp.toLp 2 q)) p.ofLp j)=ᶠ[𝓝 (p j)] (fun t => fderiv ℝ f (euclideanAxisPath p j t) (euclideanCoordinateVector j)) := by filter_upwards [hc.eventually_const_lt hpos] with t ht exact euclideanAxisSlice_deriv f p j t ((hf _ ht).differentiableAt (by simp)) rw [he.deriv_eq] have hd : DifferentiableAt ℝ (fun q => fderiv ℝ f q (euclideanCoordinateVector j)) p := (((hf p hp).fderiv_right (m := ∞) (by simp)).clm_apply contDiffAt_const).differentiableAt (by simp) have hd' : DifferentiableAt ℝ (fun q => fderiv ℝ f q (euclideanCoordinateVector j)) (euclideanAxisPath p j (p j)) := by rwa [euclideanAxisPath_self] have hh := hd'.hasFDerivAt.comp_hasDerivAt (p j) (euclideanAxisPath_hasDerivAt p j (p j)) simpa only [euclideanAxisPath_self,Function.comp_def] using! hh.deriv def positiveEuclideanLaplacian (f : EuclideanSpatial→ℂ) (p : EuclideanSpatial) : ℂ := -(p 2:ℂ)^2*(∑j : Fin 3,fderiv ℝ (fun q => fderiv ℝ f q (euclideanCoordinateVector j)) p (euclideanCoordinateVector j))+(p 2:ℂ)*fderiv ℝ f p (euclideanCoordinateVector 2) lemma positiveEuclideanLaplacian_eq_axis (f : EuclideanSpatial→ℂ) (hf : ∀p,0

f (WithLp.toLp 2 q)) p.ofLp := by unfold positiveEuclideanLaplacian axisLaplacian simp only [(euclideanAxisSlice_derivatives f hf p hp _).1,(euclideanAxisSlice_derivatives f hf p hp _).2] ring lemma positiveEuclideanLaplacian_congr (f g : EuclideanSpatial→ℂ) (p : EuclideanSpatial) (he : f=ᶠ[𝓝 p]g) : positiveEuclideanLaplacian f p=positiveEuclideanLaplacian g p := by have hd (j : Fin 3) : (fun q => fderiv ℝ f q (euclideanCoordinateVector j))=ᶠ[𝓝 p] (fun q => fderiv ℝ g q (euclideanCoordinateVector j)) := (he.fderiv (𝕜 := ℝ)).mono (fun q hq => congrArg (fun d => d (euclideanCoordinateVector j)) hq) simp only [positiveEuclideanLaplacian,he.fderiv_eq,(hd _).fderiv_eq] end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff SchwartzMap LineDeriv Manifold namespace CubicEisenstein lemma kernelTestPartitionTerm_tsupport_right {ι : Type*} {S : Set KernelQuotient} (ρ : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; SmoothPartitionOfUnity ι 𝓘(ℝ,SpatialCoordinates) KernelQuotient S) (f : kernelSmoothTests) (i : ι) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology tsupport (kernelTestPartitionTerm ρ f i).1⊆tsupport f.1 := letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace tsupport_smul_subset_right _ _ lemma kernelSmoothTest_finite_chart_partition_subsupport (f : kernelSmoothTests) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology ∃t : Finset KernelGoodCutoff,∃g : t→kernelSmoothTests, (∑i,g i)=f ∧ ∀i,tsupport (g i).1⊆kernelChartCoreImage i.1.1 ∧ tsupport (g i).1⊆tsupport f.1 := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : IsManifold 𝓘(ℝ,SpatialCoordinates) ∞ KernelQuotient := kernelSpatialIsManifold let : LocallyCompactSpace KernelQuotient := kernelQuotientLocallyCompact let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel let : SecondCountableTopology KernelQuotient := kernelQuotientSecondCountable obtain ⟨t,ht⟩ := kernelCompact_finite_chart_cover (tsupport f.1) f.2.2 have hc : tsupport f.1⊆⋃χ : t,kernelChartCoreImage χ.1.1 := by intro q hq obtain ⟨χ,hχ,hqχ⟩ := Set.mem_iUnion₂.mp (ht hq) exact Set.mem_iUnion.mpr ⟨⟨χ,hχ⟩,hqχ⟩ obtain ⟨ρ,hρ⟩ := SmoothPartitionOfUnity.exists_isSubordinate 𝓘(ℝ,SpatialCoordinates) (isClosed_tsupport f.1) (fun χ : t => kernelChartCoreImage χ.1.1) (fun χ => kernelChartCoreImage_open χ.1.1) hc refine ⟨t,kernelTestPartitionTerm ρ f,kernelTestPartition_sum f ρ,fun i => ?_⟩ exact ⟨(kernelTestPartitionTerm_tsupport ρ f i).trans (hρ i), kernelTestPartitionTerm_tsupport_right ρ f i⟩ lemma kernelDirichletForm_supported_equation_chart (χ : PositiveChartCutoff) (hinj : Set.InjOn kernelEuclideanProjection (tsupport χ.func)) (f g : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; kernelSmoothTests) (hg : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; tsupport g.1⊆kernelChartCoreImage χ) (A : KernelQuotient→ℂ) (hA : MemLp A 2 (integralQuotientVolume globalKubotaKernel)) (heq : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; ∀p,0

star (A q)*g.1 q) (integralQuotientVolume globalKubotaKernel) := hA.star.integrable_mul (kernelSmoothTests_memLp g) have himg : kernelChartCoreImage χ⊆kernelEuclideanProjection '' S := Set.image_mono (kernelChartCore_subset χ) rw [kernelDirichletForm_eq_chart_laplacian χ hinj f g hg] calc _ = ∫p in S,star (upperPositiveLaplacian (kernelCoreLift χ f) p)*kernelCoreLift χ g p/(p 2:ℂ)^3 := by symm apply setIntegral_eq_integral_of_forall_compl_eq_zero intro p hp have hz : kernelCoreLift χ g p=0 := image_eq_zero_of_notMem_tsupport (fun h => hp (kernelCoreLift_tsupport_outer χ g h)) rw [hz,mul_zero,zero_div] _ = ∫p in S,star (A (kernelEuclideanProjection p))*g.1 (kernelEuclideanProjection p)/(p 2:ℂ)^3 := by apply setIntegral_congr_fun hS intro p hp dsimp only rw [kernelCoreLift_eq_on_outer χ hinj g hg hp] by_cases hc : p∈kernelChartCore χ · by_cases hgp : kernelEuclideanProjection p∈tsupport g.1 · rw [kernelCoreLift_laplacian χ f p hc,heq p (χ.positive hp) hgp] rfl · have hz : g.1 (kernelEuclideanProjection p)=0 := image_eq_zero_of_notMem_tsupport hgp change star _*g.1 (kernelEuclideanProjection p)/_=star _*g.1 (kernelEuclideanProjection p)/_ rw [hz,mul_zero,zero_div,mul_zero,zero_div] · have hz : kernelCoreLift χ g p=0 := image_eq_zero_of_notMem_tsupport (fun h => hc (kernelCoreLift_tsupport χ hinj g hg h)) rw [kernelCoreLift_eq_on_outer χ hinj g hg hp] at hz change g.1 (kernelEuclideanProjection p)=0 at hz change star _*g.1 (kernelEuclideanProjection p)/_=star _*g.1 (kernelEuclideanProjection p)/_ rw [hz,mul_zero,zero_div,mul_zero,zero_div] _ = ∫p in S,star (A (kernelEuclideanProjection p))*g.1 (kernelEuclideanProjection p) ∂hyperbolicEuclideanVolume := (hyperbolicEuclidean_setIntegral_complex S hS χ.positive _).symm _ = ∫q in kernelEuclideanProjection '' S,star (A q)*g.1 q∂integralQuotientVolume globalKubotaKernel := kernelEuclideanProjection_integral_complex S hS χ.positive hinj _ hi.aestronglyMeasurable _ = _ := by apply setIntegral_eq_integral_of_forall_compl_eq_zero intro q hq have hz : g.1 q=0 := image_eq_zero_of_notMem_tsupport (fun h => hq (himg (hg h))) rw [hz,mul_zero] theorem kernelDirichletForm_supported_equation (f g : kernelSmoothTests) (A : KernelQuotient→ℂ) (hA : MemLp A 2 (integralQuotientVolume globalKubotaKernel)) (heq : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; ∀p,0

heq p hp ((hGsupp i).2 hgp)) _ = ∫q,∑i : t,star (A q)*(G i).1 q∂integralQuotientVolume globalKubotaKernel := by symm exact integral_finsetSum _ (fun i hi => hA.star.integrable_mul (kernelSmoothTests_memLp (G i))) _ = _ := by apply integral_congr_ae exact Eventually.of_forall (fun q => by have hq := congrArg (fun k : kernelSmoothTests => k.1 q) hG simp only [Submodule.coe_sum,Finset.sum_apply] at hq dsimp only rw [←Finset.mul_sum,hq]) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CuspHeight namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold lemma kernelCompact_smooth_cutoff (K : Set KernelQuotient) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hK : IsCompact K), let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace ∃χ : KernelQuotient→ℝ,ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ χ ∧ HasCompactSupport χ ∧ (∀q∈K,χ=ᶠ[𝓝 q](fun _ => 1)) ∧ ∀q,χ q∈Set.Icc 0 1 := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hK : IsCompact K) => by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : IsManifold 𝓘(ℝ,SpatialCoordinates) ∞ KernelQuotient := kernelSpatialIsManifold let : LocallyCompactSpace KernelQuotient := kernelQuotientLocallyCompact let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel let : SecondCountableTopology KernelQuotient := kernelQuotientSecondCountable dsimp only obtain ⟨J,hJ,hKJ⟩ := exists_compact_superset hK obtain ⟨χ,hχone,hχzero,hχrange⟩ := exists_contMDiffMap_one_nhds_of_subset_interior 𝓘(ℝ,SpatialCoordinates) hK.isClosed hKJ (n := (⊤ : ℕ∞)) refine ⟨χ,χ.contMDiff,?_,?_,hχrange⟩ · apply HasCompactSupport.of_support_subset_isCompact hJ intro q hq by_contra hn exact hq (hχzero q hn) · intro q hq exact hχone.filter_mono (nhds_le_nhdsSet hq) end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups lemma integral_upper_triangular_height_all (M : SL(2,ActualEisensteinCubic.O)) (hc : M 1 0=0) (w : HyperbolicSpace) : hyperbolicHeight (integralComplexMatrix M • w)=hyperbolicHeight w := by obtain ⟨z,v,hv,rfl⟩ := upperPoint_surjective w rw [integral_upper_triangular_height M hc,hyperbolicHeight_upperPoint] def fullMatrixHeight (M : SL(2,ActualEisensteinCubic.O)) (w : HyperbolicSpace) : ℝ := hyperbolicHeight (integralComplexMatrix M • w) def fullCuspHeightRelation : Setoid (SL(2,ActualEisensteinCubic.O)) := Setoid.ker fullMatrixHeight abbrev FullCuspClasses := Quotient fullCuspHeightRelation def fullCuspOf (M : SL(2,ActualEisensteinCubic.O)) : FullCuspClasses := Quotient.mk _ M def fullCuspHeight : FullCuspClasses→HyperbolicSpace→ℝ := Quotient.lift fullMatrixHeight (fun _ _ h => h) lemma fullCuspHeight_of (M : SL(2,ActualEisensteinCubic.O)) (w : HyperbolicSpace) : fullCuspHeight (fullCuspOf M) w=fullMatrixHeight M w := rfl lemma fullCuspHeight_continuous (x : FullCuspClasses) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous (fullCuspHeight x) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by induction x using Quotient.inductionOn with | _ M => exact hyperbolicHeight_continuous.comp (continuous_hyperbolic_action (integralComplexMatrix M)) lemma fullMatrixHeight_eq_of_lower_zero (M N : SL(2,ActualEisensteinCubic.O)) (h : (M*N⁻¹) 1 0=0) : fullMatrixHeight M=fullMatrixHeight N := by funext w have hh := integral_upper_triangular_height_all (M*N⁻¹) h (integralComplexMatrix N • w) simpa only [fullMatrixHeight,map_mul,map_inv,mul_smul,inv_smul_smul] using hh lemma fullCuspOf_eq_iff (M N : SL(2,ActualEisensteinCubic.O)) : fullCuspOf M=fullCuspOf N ↔ (M*N⁻¹) 1 0=0 := by constructor · intro h by_contra hc have he : fullMatrixHeight M=fullMatrixHeight N := Quotient.exact h let w := upperPoint 0 2 (by norm_num : (0:ℝ)<2) have hh := congrFun he (integralComplexMatrix N⁻¹ • w) have hp := integral_hyperbolicHeight_mul_le_one (M*N⁻¹) hc w have hN : hyperbolicHeight w=2 := hyperbolicHeight_upperPoint _ _ _ change hyperbolicHeight (integralComplexMatrix M • (integralComplexMatrix N⁻¹ • w))= hyperbolicHeight (integralComplexMatrix N • (integralComplexMatrix N⁻¹ • w)) at hh simp only [map_inv,smul_inv_smul] at hh simp only [map_mul,map_inv,mul_smul] at hp rw [hh,hN] at hp norm_num at hp · intro h exact Quotient.sound (fullMatrixHeight_eq_of_lower_zero M N h) def fullCuspTranslate (M : SL(2,ActualEisensteinCubic.O)) : FullCuspClasses→FullCuspClasses := Quotient.map (fun N => N*M) (by intro N P h change fullMatrixHeight (N*M)=fullMatrixHeight (P*M) funext w have hh := congrFun h (integralComplexMatrix M • w) simpa only [fullMatrixHeight,map_mul,mul_smul] using hh) lemma fullCuspTranslate_mul (M N : SL(2,ActualEisensteinCubic.O)) (x : FullCuspClasses) : fullCuspTranslate N (fullCuspTranslate M x)=fullCuspTranslate (M*N) x := by induction x using Quotient.inductionOn with | _ P => change fullCuspOf ((P*M)*N)=fullCuspOf (P*(M*N)); rw [mul_assoc] lemma fullCuspTranslate_one (x : FullCuspClasses) : fullCuspTranslate 1 x=x := by induction x using Quotient.inductionOn with | _ P => change fullCuspOf (P*1)=fullCuspOf P; rw [mul_one] def fullCuspRightEquiv (M : SL(2,ActualEisensteinCubic.O)) : FullCuspClasses≃FullCuspClasses where toFun := fullCuspTranslate M invFun := fullCuspTranslate M⁻¹ left_inv x := by rw [fullCuspTranslate_mul,mul_inv_cancel,fullCuspTranslate_one] right_inv x := by rw [fullCuspTranslate_mul,inv_mul_cancel,fullCuspTranslate_one] lemma fullCuspHeight_translate (M : SL(2,ActualEisensteinCubic.O)) (x : FullCuspClasses) (w : HyperbolicSpace) : fullCuspHeight (fullCuspRightEquiv M x) w=fullCuspHeight x (integralComplexMatrix M • w) := by induction x using Quotient.inductionOn with | _ N => change fullMatrixHeight (N*M) w=fullMatrixHeight N (integralComplexMatrix M • w) simp only [fullMatrixHeight,map_mul,mul_smul] lemma fullCuspHeight_high_unique (w : HyperbolicSpace) (x y : FullCuspClasses) (hx : 1 induction y using Quotient.inductionOn with | _ N => apply (fullCuspOf_eq_iff M N).mpr by_contra hc have hp := integral_hyperbolicHeight_mul_le_one (M*N⁻¹) hc (integralComplexMatrix N • w) simp only [map_mul,map_inv,mul_smul,inv_smul_smul] at hp change 1 F (fullCuspHeight x w)) := by have hs : Set.Subsingleton {x : FullCuspClasses | 1 fullCuspHeight_high_unique w x y hx hy apply hs.finite.subset intro x hx by_contra hn exact hx (hF _ (le_of_not_gt hn)) def fullCuspProfileSum (F : ℝ→ℝ) (w : HyperbolicSpace) : ℝ := ∑'x : FullCuspClasses,F (fullCuspHeight x w) lemma fullCuspProfileSum_summable (F : ℝ→ℝ) (hF : ∀v≤1,F v=0) (w : HyperbolicSpace) : Summable (fun x : FullCuspClasses => F (fullCuspHeight x w)) := summable_of_hasFiniteSupport (fullCusp_profile_finite F hF w) lemma fullCuspProfileSum_invariant (F : ℝ→ℝ) (M : SL(2,ActualEisensteinCubic.O)) (w : HyperbolicSpace) : fullCuspProfileSum F (integralComplexMatrix M • w)=fullCuspProfileSum F w := by unfold fullCuspProfileSum simp only [←fullCuspHeight_translate M] exact (fullCuspRightEquiv M).tsum_eq (fun x : FullCuspClasses => F (fullCuspHeight x w)) lemma fullCuspProfileSum_eq_single (F : ℝ→ℝ) (hF : ∀v≤1,F v=0) (w : HyperbolicSpace) (x : FullCuspClasses) (hx : 1 cuspBarrierProfile_nonneg a b ha hab _)) lemma cuspBarrier_invariant (a b : ℝ) (M : SL(2,ActualEisensteinCubic.O)) (w : HyperbolicSpace) : cuspBarrier a b (integralComplexMatrix M • w)=cuspBarrier a b w := by rw [cuspBarrier,cuspBarrier,fullCuspProfileSum_invariant] theorem cuspBarrier_high (a b : ℝ) (ha : 1≤a) (hab : a cuspBarrierProfile_zero a b hab y (hy.trans ha)) _ (fullCuspOf 1) (by rw [hx]; linarith),hx,cuspBarrierProfile,cuspTransition_one a b v hab hbv.le,one_mul] ring def kernelQuotientBarrier (a b : ℝ) : KernelQuotient→ℝ := Quotient.lift (cuspBarrier a b) (by rintro w u ⟨M,hM⟩ rw [←hM] exact (cuspBarrier_invariant a b (M:SL(2,ActualEisensteinCubic.O)) w).symm) lemma kernelQuotientBarrier_one_le (a b : ℝ) (ha : 1≤a) (hab : a exact cuspBarrier_one_le a b ha hab w lemma kernelQuotientBarrier_fordCusp (a b : ℝ) (ha : 1≤a) (hab : a fullCuspOf ((N:SL(2,ActualEisensteinCubic.O))*r⁻¹)) (by intro N P h apply Quotient.sound funext w have he : cosetOf N=cosetOf P := Quotient.sound h have hh := congrArg (fun x => cosetHeight x (integralComplexMatrix r⁻¹ • w)) he simpa only [cosetHeight_cosetOf,fullMatrixHeight,map_mul,mul_smul,integralComplexMatrix_levelThree] using hh) lemma fullCuspFromPrincipal_height (r : SL(2,ActualEisensteinCubic.O)) (x : CuspCosets) (w : HyperbolicSpace) : fullCuspHeight (fullCuspFromPrincipal r x) w=cosetHeight x (integralComplexMatrix r⁻¹ • w) := by induction x using Quotient.inductionOn with | _ N => change fullMatrixHeight ((N:SL(2,ActualEisensteinCubic.O))*r⁻¹) w=cosetHeight (cosetOf N) _ simp only [fullMatrixHeight,cosetHeight_cosetOf,map_mul,mul_smul,integralComplexMatrix_levelThree] lemma fullCusp_finite_principal_cover : ∃S : Finset (SL(2,ActualEisensteinCubic.O)),∀x : FullCuspClasses, ∃r∈S,∃y : CuspCosets,fullCuspFromPrincipal r y=x := by let : CubicKubota.levelThree.FiniteIndex := levelThree_finiteIndex obtain ⟨S,hS⟩ := finite_right_representatives CubicKubota.levelThree refine ⟨S,fun x => ?_⟩ induction x using Quotient.inductionOn with | _ M => obtain ⟨r,hr,hM⟩ := hS M⁻¹ have hm : M*r∈CubicKubota.levelThree := by simpa only [mul_inv_rev,inv_inv] using CubicKubota.levelThree.inv_mem hM refine ⟨r,hr,cosetOf ⟨M*r,hm⟩,?_⟩ change fullCuspOf ((M*r)*r⁻¹)=fullCuspOf M rw [mul_inv_cancel_right] lemma full_high_locally_finite (w : HyperbolicSpace) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∃U : Set HyperbolicSpace,IsOpen U ∧ w∈U ∧ ∃T : Finset FullCuspClasses, ∀z∈U,∀x∉T,fullCuspHeight x z<1 := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by obtain ⟨S,hS⟩ := fullCusp_finite_principal_cover choose U hU hw T hT using fun r : S => principal_high_locally_finite (integralComplexMatrix r.1⁻¹ • w) let V : Set HyperbolicSpace := ⋂r : S,(fun z => integralComplexMatrix r.1⁻¹ • z) ⁻¹' U r let B : Finset FullCuspClasses := Finset.univ.biUnion (fun r : S => (T r).image (fullCuspFromPrincipal r.1)) refine ⟨V,isOpen_iInter_of_finite (fun r => (hU r).preimage (continuous_hyperbolic_action _)),?_,B,?_⟩ · exact Set.mem_iInter.mpr hw · intro z hz x hx obtain ⟨r,hr,y,hxy⟩ := hS x let i : S := ⟨r,hr⟩ have hy : y∉T i := by intro hy apply hx exact Finset.mem_biUnion.mpr ⟨i,Finset.mem_univ _,Finset.mem_image.mpr ⟨y,hy,hxy⟩⟩ rw [←hxy,fullCuspFromPrincipal_height] exact hT i _ (Set.mem_iInter.mp hz i) y hy lemma fullCuspProfileSum_locally_finite (F : ℝ→ℝ) (hF : ∀v≤1,F v=0) (w : HyperbolicSpace) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∃T : Finset FullCuspClasses,fullCuspProfileSum F =ᶠ[𝓝 w] (fun z => ∑x∈T,F (fullCuspHeight x z)) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by obtain ⟨U,hU,hw,T,hT⟩ := full_high_locally_finite w refine ⟨T,?_⟩ filter_upwards [hU.mem_nhds hw] with z hz apply tsum_eq_sum intro x hx exact hF _ (hT z hz x hx).le lemma fullCuspProfileSum_continuous (F : ℝ→ℝ) (hF : ∀v≤1,F v=0) (hFc : Continuous F) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous (fullCuspProfileSum F) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by rw [continuous_iff_continuousAt] intro w obtain ⟨T,hT⟩ := fullCuspProfileSum_locally_finite F hF w apply ContinuousAt.congr _ hT.symm exact (continuous_finsetSum T (fun x hx => hFc.comp (fullCuspHeight_continuous x))).continuousAt lemma cuspBarrier_continuous (a b : ℝ) (ha : 1≤a) (hab : a cuspBarrierProfile_zero a b hab v (hv.trans ha)) (cuspBarrierProfile_smooth a b).continuous) end section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold MatrixGroups lemma fullCuspHeight_chart_contDiffAt (x : FullCuspClasses) (p : SpatialCoordinates) (hp : p∈hyperbolicSpatialChart.target) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ContDiffAt ℝ ∞ (fun q => fullCuspHeight x (hyperbolicSpatialChart.symm q)) p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by induction x using Quotient.inductionOn with | _ M => have hh : ContDiffAt ℝ ∞ (fun q => mobiusSpatial (integralComplexMatrix M) q 2) p := (contDiff_apply ℝ ℝ 2).contDiffAt.comp p (mobiusSpatial_contDiffAt _ p (hyperbolicSpatialChart_target_positive hp)) apply hh.congr_of_eventuallyEq filter_upwards [hyperbolicSpatialChart.open_target.mem_nhds hp] with q hq rw [hyperbolicSpatialChart_symm_eq hq] exact congrArg (fun r : SpatialCoordinates => r 2) (mobiusSpatial_coordinates (integralComplexMatrix M) q (hyperbolicSpatialChart_target_positive hq)) lemma fullCuspProfileSum_chart_contDiffAt (F : ℝ→ℝ) (hF : ∀v≤1,F v=0) (hFc : ContDiff ℝ ∞ F) (p : SpatialCoordinates) (hp : p∈hyperbolicSpatialChart.target) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ContDiffAt ℝ ∞ (fun q => fullCuspProfileSum F (hyperbolicSpatialChart.symm q)) p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by obtain ⟨T,hT⟩ := fullCuspProfileSum_locally_finite F hF (hyperbolicSpatialChart.symm p) have hc := hyperbolicSpatialChart.continuousAt_symm hp have he := hT.comp_tendsto hc apply ContDiffAt.congr_of_eventuallyEq _ he exact ContDiffAt.sum (fun x hx => hFc.contDiffAt.comp p (fullCuspHeight_chart_contDiffAt x p hp)) lemma cuspBarrier_chart_contDiffAt (a b : ℝ) (ha : 1≤a) (hab : a cuspBarrier a b (hyperbolicSpatialChart.symm q)) p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology contDiffAt_const.add (fullCuspProfileSum_chart_contDiffAt _ (fun v hv => cuspBarrierProfile_zero a b hab v (hv.trans ha)) (cuspBarrierProfile_smooth a b) p hp) lemma kernelQuotientBarrier_continuous (a b : ℝ) (ha : 1≤a) (hab : a OAI.CubicEisenstein.kernelSpatial_chartAt q intro q rw [contMDiffAt_iff] refine ⟨(kernelQuotientBarrier_continuous a b ha hab).continuousAt,?_⟩ have hq : q∈(kernelQuotientChart q).source := mem_chart_source SpatialCoordinates q have hp : kernelQuotientChart q q∈hyperbolicSpatialChart.target := ((kernelQuotientChart q).map_source hq).1 have hh := cuspBarrier_chart_contDiffAt a b ha hab _ hp have he : (fun p => kernelQuotientBarrier a b ((kernelQuotientChart q).symm p))= (fun p => cuspBarrier a b (hyperbolicSpatialChart.symm p)) := by funext p rw [kernelQuotientChart_symm] rfl have hh' := (he.symm ▸ hh).contDiffWithinAt (s := Set.univ) simpa only [extChartAt_coe,extChartAt_coe_symm,modelWithCornersSelf_coe, modelWithCornersSelf_coe_symm,Function.id_comp,Function.comp_id,Set.range_id, chartAt_self_eq,kernelSpatial_chartAt,OpenPartialHomeomorph.refl_apply,Function.comp_def,id_eq] using hh' lemma cuspBarrier_euclidean_contDiffAt (a b : ℝ) (ha : 1≤a) (hab : a cuspBarrier a b (euclideanToHyperbolic q)) p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace (((kernelQuotientBarrier_contMDiff a b ha hab).comp kernelProjection_contMDiff) (euclideanToHyperbolic p) |>.comp p (euclideanToHyperbolic_contMDiffAt p hp)).contDiffAt end open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff MatrixGroups def positiveHeightLaplacian (F : ℝ→ℝ) (v : ℝ) : ℝ := v*deriv F v-v^2*deriv (deriv F) v def cuspBarrierDefectProfile (a b v : ℝ) : ℝ := positiveHeightLaplacian (cuspBarrierProfile a b) v-cuspBarrierProfile a b v lemma positiveHeightLaplacian_smooth (F : ℝ→ℝ) (hF : ContDiff ℝ ∞ F) : ContDiff ℝ ∞ (positiveHeightLaplacian F) := by have hD : ContDiff ℝ ∞ (deriv F) := (contDiff_infty_iff_deriv.mp hF).2 exact (contDiff_id.mul hD).sub ((contDiff_id.pow 2).mul ((contDiff_infty_iff_deriv.mp hD).2)) lemma cuspBarrierDefectProfile_smooth (a b : ℝ) : ContDiff ℝ ∞ (cuspBarrierDefectProfile a b) := (positiveHeightLaplacian_smooth _ (cuspBarrierProfile_smooth a b)).sub (cuspBarrierProfile_smooth a b) lemma cuspBarrierDefectProfile_zero (a b v : ℝ) (hab : a (0:ℝ)) := by filter_upwards [Iio_mem_nhds hv] with x hx exact cuspBarrierProfile_zero a b hab x hx.le have hd := he.deriv_eq have hdd : deriv (deriv (cuspBarrierProfile a b)) v=0 := by simpa only [show deriv (fun _ : ℝ => (0:ℝ))=(fun _ => 0) from funext (fun x => deriv_const x 0),deriv_const] using he.deriv.deriv_eq simp only [deriv_const] at hd simp only [cuspBarrierDefectProfile,positiveHeightLaplacian,he.eq_of_nhds,hd,hdd,mul_zero,sub_zero] lemma cuspBarrierDefectProfile_one (a b v : ℝ) (hab : a x-1) := by filter_upwards [Ioi_mem_nhds hv] with x hx rw [cuspBarrierProfile,cuspTransition_one a b x hab hx.le,one_mul] have hd := he.deriv_eq have hlin : deriv (fun x : ℝ => x-1)=(fun _ => 1) := by ext x; simp have hdd : deriv (deriv (cuspBarrierProfile a b)) v=0 := by simpa only [hlin,deriv_const] using he.deriv.deriv_eq simp only [deriv_sub_const,deriv_id''] at hd simp only [cuspBarrierDefectProfile,positiveHeightLaplacian,he.eq_of_nhds,hd,hdd] ring def cuspBarrierDefect (a b : ℝ) (w : HyperbolicSpace) : ℝ := -1+fullCuspProfileSum (cuspBarrierDefectProfile a b) w lemma cuspBarrierDefect_invariant (a b : ℝ) (M : SL(2,ActualEisensteinCubic.O)) (w : HyperbolicSpace) : cuspBarrierDefect a b (integralComplexMatrix M • w)=cuspBarrierDefect a b w := by rw [cuspBarrierDefect,cuspBarrierDefect,fullCuspProfileSum_invariant] lemma cuspBarrierDefect_high (a b : ℝ) (ha : 1 cuspBarrierDefectProfile_zero a b y hab (hy.trans_lt ha)) _ (fullCuspOf 1) (by rw [hx]; linarith),hx,cuspBarrierDefectProfile_one a b v hab hbv] ring def kernelQuotientBarrierDefect (a b : ℝ) : KernelQuotient→ℝ := Quotient.lift (cuspBarrierDefect a b) (by rintro w u ⟨M,hM⟩ rw [←hM] exact (cuspBarrierDefect_invariant a b (M:SL(2,ActualEisensteinCubic.O)) w).symm) lemma kernelQuotientBarrierDefect_hasCompactSupport (a b : ℝ) (ha : 1 cuspBarrierDefectProfile_zero a b v hab (hv.trans_lt ha)) (cuspBarrierDefectProfile_smooth a b).continuous) open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff MatrixGroups def fullCuspRow (x : FullCuspClasses) : Fin 2→ℂ := complexBottomRow (integralComplexMatrix x.out) lemma fullCuspRow_ne_zero (x : FullCuspClasses) : fullCuspRow x≠0 := complexBottomRow_ne_zero _ lemma fullCuspRow_height (x : FullCuspClasses) (p : SpatialCoordinates) (hp : 0

rw [←hx] rw [fullCuspHeight_of,fullMatrixHeight,hyperbolicHeight_action_upperPoint] rw [rowHeight_eq_transformedHeight] simp only [transformedHeight,heightDenominator,fullCuspRow,complexBottomRow,spatialHorizontal] def fullCuspProfileField (F : ℝ→ℝ) (p : SpatialCoordinates) : ℝ := ∑'x : FullCuspClasses,F (rowHeight (fullCuspRow x) p) lemma fullCuspProfileField_eq (F : ℝ→ℝ) (p : SpatialCoordinates) (hp : 0

simp rw [←he] exact hyperbolicSpatialChart.map_source (Set.mem_univ _) have he : hyperbolicSpatialChart.symm p=w := by rw [hyperbolicSpatialChart_symm_eq ht] have hnear := (hyperbolicSpatialChart.continuousAt_symm ht) (by simpa only [he] using hU.mem_nhds hw) refine ⟨T,?_⟩ filter_upwards [hnear,hyperbolicSpatialChart.open_target.mem_nhds ht] with q hq hqt have hpos := hyperbolicSpatialChart_target_positive hqt intro x hx rw [fullCuspRow_height x q hpos,←hyperbolicSpatialChart_symm_eq hqt] exact hT _ hq x hx lemma cast_profile_deriv (F : ℝ→ℝ) (hF : Differentiable ℝ F) (v : ℝ) : deriv (fun y => (F y:ℂ)) v=((deriv F v:ℝ):ℂ) := (hF v).hasDerivAt.ofReal_comp.deriv lemma cast_profile_deriv2 (F : ℝ→ℝ) (hF : ContDiff ℝ ∞ F) (v : ℝ) : deriv (deriv (fun y => (F y:ℂ))) v=((deriv (deriv F) v:ℝ):ℂ) := by have he : deriv (fun y => (F y:ℂ))=(fun y => ((deriv F y:ℝ):ℂ)) := funext (cast_profile_deriv F (hF.differentiable (by simp))) rw [he] exact cast_profile_deriv (deriv F) (((contDiff_infty_iff_deriv.mp hF).2).differentiable (by simp)) v lemma fullCuspProfile_row_laplacian (F : ℝ→ℝ) (hF : ContDiff ℝ ∞ F) (x : FullCuspClasses) (p : SpatialCoordinates) (hp : 0

(F (rowHeight (fullCuspRow x) q):ℂ)) p= (positiveHeightLaplacian F (rowHeight (fullCuspRow x) p):ℂ) := by rw [rowProfile_laplacian (fun y => (F y:ℂ)) (fun v hv => Complex.ofRealCLM.contDiff.contDiffAt.comp v hF.contDiffAt) _ (fullCuspRow_ne_zero x) p hp,cast_profile_deriv F (hF.differentiable (by simp)),cast_profile_deriv2 F hF] simp only [positiveHeightLaplacian,Complex.ofReal_sub,Complex.ofReal_mul,Complex.ofReal_pow] ring lemma fullCuspProfileField_laplacian (F : ℝ→ℝ) (hF : ContDiff ℝ ∞ F) (hzero : ∀v≤1,F v=0) (hLzero : ∀v≤1,positiveHeightLaplacian F v=0) (p : SpatialCoordinates) (hp : 0

(fullCuspProfileField F q:ℂ)) p= (fullCuspProfileField (positiveHeightLaplacian F) p:ℂ) := by obtain ⟨T,hT⟩ := fullCuspRows_locally_finite p hp have he : (fun q => (fullCuspProfileField F q:ℂ)) =ᶠ[𝓝 p] (fun q => ∑x∈T,(F (rowHeight (fullCuspRow x) q):ℂ)) := by filter_upwards [hT] with q hq have hh : fullCuspProfileField F q=∑x∈T,F (rowHeight (fullCuspRow x) q) := tsum_eq_sum (fun x hx => hzero _ (hq x hx).le) rw [hh] push_cast rfl have hval : fullCuspProfileField (positiveHeightLaplacian F) p= ∑x∈T,positiveHeightLaplacian F (rowHeight (fullCuspRow x) p) := tsum_eq_sum (fun x hx => hLzero _ (hT.self_of_nhds x hx).le) have hreg : ∀x∈T,∀q,0 (F (rowHeight (fullCuspRow x) z):ℂ)) q j) (q j) ∧ DifferentiableAt ℝ (deriv (axisSlice (fun z => (F (rowHeight (fullCuspRow x) z):ℂ)) q j)) (q j) := by intro x hx q hq j have hd := rowProfile_axis_derivatives (fun v => (F v:ℂ)) (fun v hv => Complex.ofRealCLM.contDiff.contDiffAt.comp v hF.contDiffAt) (fullCuspRow x) (fullCuspRow_ne_zero x) q hq j exact ⟨hd.1.differentiableAt,hd.2.differentiableAt⟩ rw [axisLaplacian_congr_eventuallyEq _ _ p he,axisLaplacian_finset_sum T _ hreg p hp,hval] rw [←Finset.sum_neg_distrib] push_cast exact Finset.sum_congr rfl (fun x hx => fullCuspProfile_row_laplacian F hF x p hp) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.BarrierPotential namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff MatrixGroups lemma axisLaplacian_const_add (c : ℂ) (f : SpatialCoordinates→ℂ) (p : SpatialCoordinates) : axisLaplacian (fun q => c+f q) p=axisLaplacian f p := by unfold axisLaplacian axisSlice simp only [deriv_const_add,deriv_const_add'] lemma fullCuspProfileField_summable (F : ℝ→ℝ) (hF : ∀v≤1,F v=0) (p : SpatialCoordinates) (hp : 0

F (rowHeight (fullCuspRow x) p)) := by simpa only [fullCuspRow_height _ p hp] using fullCuspProfileSum_summable F hF (upperPoint (spatialHorizontal p) (p 2) hp) lemma fullCuspProfileField_add (F G : ℝ→ℝ) (hF : ∀v≤1,F v=0) (hG : ∀v≤1,G v=0) (p : SpatialCoordinates) (hp : 0

F v+G v) p=fullCuspProfileField F p+fullCuspProfileField G p := (fullCuspProfileField_summable F hF p hp).tsum_add (fullCuspProfileField_summable G hG p hp) lemma cuspBarrierProfile_laplacian_zero (a b v : ℝ) (ha : 1 (cuspBarrierField a b q:ℂ)) p-(cuspBarrierField a b p:ℂ)= (cuspBarrierDefectField a b p:ℂ) := by have hF : ∀v≤1,cuspBarrierProfile a b v=0 := fun v hv => cuspBarrierProfile_zero a b hab v (hv.trans ha.le) have hD : ∀v≤1,cuspBarrierDefectProfile a b v=0 := fun v hv => cuspBarrierDefectProfile_zero a b v hab (hv.trans_lt ha) have hid : positiveHeightLaplacian (cuspBarrierProfile a b)= fun v => cuspBarrierDefectProfile a b v+cuspBarrierProfile a b v := by funext v rw [cuspBarrierDefectProfile,sub_add_cancel] have hh := fullCuspProfileField_laplacian _ (cuspBarrierProfile_smooth a b) hF (fun v hv => cuspBarrierProfile_laplacian_zero a b v ha hab hv) p hp simp only [cuspBarrierField,Complex.ofReal_add,Complex.ofReal_one,axisLaplacian_const_add] rw [hh,hid,fullCuspProfileField_add _ _ hD hF p hp] simp only [cuspBarrierDefectField,Complex.ofReal_add,Complex.ofReal_neg,Complex.ofReal_one] ring def kernelBarrierPotential (a b : ℝ) (q : KernelQuotient) : ℝ := 1+kernelQuotientBarrierDefect a b q/kernelQuotientBarrier a b q lemma kernelBarrierPotential_lower (a b : ℝ) (ha : 1 (1:ℝ))) q≤kernelBarrierPotential a b q := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let D := kernelQuotientBarrierDefect a b let K := tsupport D have hK : IsCompact K := kernelQuotientBarrierDefect_hasCompactSupport a b ha hab obtain ⟨C,hC⟩ := (kernelQuotientBarrierDefect_hasCompactSupport a b ha hab).exists_bound_of_continuous (kernelQuotientBarrierDefect_continuous a b ha hab) refine ⟨K,hK,max C 0,le_max_right _ _,fun q => ?_⟩ have hphi := kernelQuotientBarrier_one_le a b ha.le hab q have hpos : 0 (kernelQuotientBarrier a b (kernelEuclideanProjection q):ℂ)) p= ((kernelQuotientBarrier a b (kernelEuclideanProjection p)+ kernelQuotientBarrierDefect a b (kernelEuclideanProjection p):ℝ):ℂ) := by have hf : ∀q,0 (kernelQuotientBarrier a b (kernelEuclideanProjection q):ℂ)) q := fun q hq => Complex.ofRealCLM.contDiff.contDiffAt.comp q (cuspBarrier_euclidean_contDiffAt a b ha.le hab q hq) rw [positiveEuclideanLaplacian_eq_axis _ hf p hp] have he : ∀q : SpatialCoordinates,0.trans (add_comm _ _) end section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold lemma kernelBarrierPotential_continuous (a b : ℝ) (ha : 1 by have hq := kernelQuotientBarrier_one_le a b ha.le hab q linarith) lemma kernelBarrierPotential_equation (a b : ℝ) (ha : 1 (kernelQuotientBarrier a b (kernelEuclideanProjection q):ℂ)) p= ((kernelBarrierPotential a b (kernelEuclideanProjection p)* kernelQuotientBarrier a b (kernelEuclideanProjection p):ℝ):ℂ) := by rw [kernelQuotientBarrier_laplace_defect a b ha hab p hp] apply congrArg Complex.ofReal have hn : kernelQuotientBarrier a b (kernelEuclideanProjection p)≠0 := by have hq := kernelQuotientBarrier_one_le a b ha.le hab (kernelEuclideanProjection p) linarith rw [kernelBarrierPotential,add_mul,one_mul,div_mul_cancel₀ _ hn] lemma kernelSmoothTest_weighted_mass_integrable (V : KernelQuotient→ℝ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite ∀ (hV : Continuous V) (f : kernelSmoothTests), Integrable (fun q => V q*‖f.1 q‖^2) (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite fun (hV : Continuous V) (f : kernelSmoothTests) => by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel apply (hV.mul (f.2.1.continuous.norm.pow 2)).integrable_of_hasCompactSupport apply HasCompactSupport.of_support_subset_isCompact f.2.2 intro q hq by_contra hn have hz : f.1 q=0 := image_eq_zero_of_notMem_tsupport hn apply hq change V q*‖f.1 q‖^2=0 rw [hz,norm_zero,zero_pow (by decide : 2≠0),mul_zero] end open scoped ComplexConjugate theorem ground_state_square_completion (a b : ℝ) (ha : a ≠ 0) (z d : ℂ) : ‖d‖^2 - b*((2*(conj z*d).re*a - ‖z‖^2*b)/a^2) = ‖d - (b/a : ℝ)*z‖^2 := by simp only [Complex.sq_norm, Complex.normSq_apply, Complex.sub_re, Complex.sub_im, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.conj_re, Complex.conj_im] field_simp ; ring theorem ground_state_directional_inequality (a b : ℝ) (ha : a ≠ 0) (z d : ℂ) : b*((2*(conj z*d).re*a - ‖z‖^2*b)/a^2) ≤ ‖d‖^2 := by have hh := ground_state_square_completion a b ha z d nlinarith [sq_nonneg ‖d - (b/a : ℝ)*z‖] end CubicEisenstein namespace SecondPassArithmetic section open scoped BigOperators Classical open MeasureTheory open ActualEisensteinCubic open FirstPassCubeLabels (primeProduct firstLogDensity) open ConcreteTraceCRT (eisEmbedding) open RayFourExpansion (RayCharacter) theorem globalFirstQuantitativeBudget_below_rank (deltaLoss : ℝ) (hδ : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hinj : Function.Injective (fun i=>Ideal.span {p i})) (base : ActualEisensteinCubic.O→*ℂ) (bad : Ideal ActualEisensteinCubic.O) (Z η : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F Ksrc : ℝ) (_hstate : CanonicalStateCondition base bad Z η Ψ m labels X F Ksrc) (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (side : Bool) (windows : Fin 7→ℝ→ℂ) (C Cd Ct Γ E oldHeight B M H U A₀ Vmax : ℝ) (N J Ntail : ℕ), (∀u,‖base u‖≤1) → (∀i,IsCoprime (Ideal.span {p i}) bad) → 1hstate.coefficient.norm_le hbase u) hb₁ hb₂ dsimp only intro a r j hj ray q hq s let source := globalQuantitativeSource p pool blocks (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F M H U side have hk : ∀x∈source,x.source.frequency≠0 := globalQuantitativeSource_frequency_ne_zero p pool blocks (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F M H U side have hb₁' : ∀x∈source,‖eisEmbedding (primeProduct p x.cube.support x.cube.leftExponent)‖^2≤Real.exp 1*B := fun x hx=>hb₁ x.first.block (globalQuantitativeSource_block_mem p pool blocks (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F M H U side x hx) have hb₂' : ∀x∈source,‖eisEmbedding (primeProduct p x.cube.support x.cube.rightExponent)‖^2≤Real.exp 1*B := fun x hx=>hb₂ x.first.block (globalQuantitativeSource_block_mem p pool blocks (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F M H U side x hx) have hs := canonicalStateCondition_cutoff_retained p hp base bad Z η Ψ m labels X F Ksrc hstate hpbad source side q j hq (if side then a.1 else a.2) r ray B hZ hZbig hη hηsmall hB0 hprogress hk hb₁' hb₂' (Finset.mem_filter.mp hj).2.le have hr : fixedDepthRank Z (globalLogRep j 8*Real.exp 1)Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hinj : Function.Injective (fun i=>Ideal.span {p i})) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (labels : Finset (Ideal ActualEisensteinCubic.O)) (β : Ideal ActualEisensteinCubic.O→(ι→₀ℕ)→ℂ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (Γ t Ksrc Kcut ell B F lengthScale : ℝ), 0≤Γ → 0SchwartzMap.norm_le_seminorm ℝ g x have hgupper : ∀x,g x≠0→x≤M := fun x hx=>(le_abs_self x).trans (hgM x hx) refine ⟨Cz*Real.exp M*G^2*‖paperRadialFourier rowMajorant 0‖, Ct*G^2*s.sup (schwartzSeminormFamily ℝ ℝ ℂ) rowMajorant,by positivity,by positivity,?_⟩ intro ι _ p hp _ hcop hg hinj hc pool Q labels β Ψ m Γ t Ksrc Kcut ell B F lengthScale hΓ hKsrc hKcut hell hB hF hL hML hΨ hβ hQB hI0 hIF dsimp only have hΨt : ∀u,‖normHeightTwist Ψ t u‖≤1 := fun u=>(normHeightTwist_norm_le Ψ t u).trans (hΨ u) have hb₁ := fun b hb=>(reopenedCubeFamily_cube_norms p Q B hQB b hb).1 have hb₂ := fun b hb=>(reopenedCubeFamily_cube_norms p Q B hQB b hb).2 have ha : ∀b∈reopenedCubeFamily Q,∀D∈(pool\b.support).powerset,∀I∈labels, ‖reopenedPairCoefficient β b D I‖≤Γ^2 := fun b hb D hD I hI=>reopenedPairCoefficient_bound Q labels β Γ hΓ hβ b hb D I hI constructor · have hz := hzero p hp hcop hg hinj hc pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) (normHeightTwist Ψ t) (normHeightTwist Ψ t) m m g g rowMajorant (Γ^2) G G ell Ksrc M B F (sq_nonneg Γ) hG hG hell hB hF hΨt hΨt (reopenedCubeFamily_admissible Q) hb₁ hb₂ hI0 hIF ha hgG hgG hgupper change ‖canonicalSourceZero p hp hcop hg pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) (normHeightTwist Ψ t) (normHeightTwist Ψ t) m m g g rowMajorant Ksrc ell‖≤_ at hz rw [abs_of_pos hKsrc] at hz exact hz.trans_eq (by ring) · have ht := htail p hp hinj hcop hg hc pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) (normHeightTwist Ψ t) (normHeightTwist Ψ t) m m g g rowMajorant (Γ^2) G G M M Ksrc Kcut ell B F lengthScale (sq_nonneg Γ) hG hG hKsrc hKcut hell hB hF hL hML hML hΨt hΨt (reopenedCubeFamily_admissible Q) hb₁ hb₂ hI0 hIF ha hgG hgG hgupper hgupper exact ht.trans_eq (by rw [show M+M=2*M by ring]; ring) end section open ActualEisensteinCubic open FirstPassCubeLabels (columnLog) open JointLogSeparation (frequencyTwist) variable {ι : Type*} [DecidableEq ι] (p : ι→ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem reopenedCanonicalRow_two_heights (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (β : (ι→₀ℕ)→ℂ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m f z : ActualEisensteinCubic.O) (g : 𝓢(ℝ,ℂ)) (X oldHeight newHeight : ℝ) (hX : 0frequencyTwist g newHeight (columnLog p X S)) z‖= ‖reopenedCanonicalRow p hp hcop hg pool Q β Ψ m f (fun S=>frequencyTwist g (oldHeight+newHeight) (columnLog p X S)) z‖ := by rw [reopenedCanonicalRow_frequencyTwist_norm p hp hcop hg pool Q β (normHeightTwist Ψ oldHeight) m f z g X newHeight hX, normHeightTwist_twice, reopenedCanonicalRow_frequencyTwist_norm p hp hcop hg pool Q β Ψ m f z g X (oldHeight+newHeight) hX] theorem reopenedCanonicalEnergy_two_heights (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (labels : Finset (Ideal ActualEisensteinCubic.O)) (β : Ideal ActualEisensteinCubic.O→(ι→₀ℕ)→ℂ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (g : 𝓢(ℝ,ℂ)) (X Ksrc oldHeight newHeight : ℝ) (hX : 0frequencyTwist g newHeight (columnLog p X S))) Ksrc).re= (∑I∈labels,nonzeroRowMajorantSum (reopenedCanonicalRow p hp hcop hg pool Q (β I) Ψ m (ConcretePrimeRowBridge.idealGenerator I) (fun S=>frequencyTwist g (oldHeight+newHeight) (columnLog p X S))) Ksrc).re := by apply congrArg Complex.re apply Finset.sum_congr rfl intro I hI unfold nonzeroRowMajorantSum apply tsum_congr intro z rw [reopenedCanonicalRow_two_heights p hp hcop hg pool Q (β I) Ψ m _ z g X oldHeight newHeight hX] end section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) theorem CanonicalStateCondition.row_bound {base : ActualEisensteinCubic.O→*ℂ} {bad : Ideal ActualEisensteinCubic.O} {Z η : ℝ} {Ψ : ActualEisensteinCubic.O→*ℂ} {m : ActualEisensteinCubic.O} {labels : Finset (Ideal ActualEisensteinCubic.O)} {X F K : ℝ} (h : CanonicalStateCondition base bad Z η Ψ m labels X F K) (hZ : 1≤Z) (hη : 0≤η) (hbudget : 3000*η≤(1:ℝ)/40) : K≤(X*F)*Z^(-((1:ℝ)/40)) := by have hn := element_norm_ge_one m h.mask_ne_zero calc K = K*1 := (mul_one _).symm _ ≤ K*‖eisEmbedding m‖^2 := mul_le_mul_of_nonneg_left hn (zero_le_one.trans h.row_ge_one) _ ≤ _ := h.invariant_reserved hZ hη hbudget theorem canonicalFirstZero_normalization (C Γ X F K B Z ε : ℝ) (hC : 0≤C) (hX : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) theorem CanonicalStateCondition.terminal_energy (hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (hinj : Function.Injective (fun i=>Ideal.span {p i})) (pool : Finset ι) (base : ActualEisensteinCubic.O→*ℂ) (bad : Ideal ActualEisensteinCubic.O) (Z η : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F K : ℝ) (hstate : CanonicalStateCondition base bad Z η Ψ m labels X F K) (hbase : ∀u,‖base u‖≤1) (hZ : 1(normHeightTwist_norm_le Ψ t u).trans (hstate.coefficient.norm_le hbase u)) m labels V X F K A M hstate.column_pos hstate.label_ge_one hstate.row_ge_one hKF hM hV hVs · exact fun I hI=>(hstate.label_bounds I hI).1 · exact fun I hI=>(hstate.label_bounds I hI).2.2.2 end SecondPassArithmetic end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.CubicSieve.ReopeningBounds namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace SecondPassArithmetic open ActualEisensteinCubic variable {ι : Type*} [DecidableEq ι] (p : ι→ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) end SecondPassArithmetic namespace CanonicalRowCompletion open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open CanonicalCubeSeparation def progressingCubes (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (H₀ : ℝ) (Q : Finset (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D)→₀ℕ)) := Q.filter (fun v=>H₀≤(Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v):ℝ)) theorem outsideCanonicalBin_filter (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes⊆S) (Q : Finset (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D)→₀ℕ)) (Ψ : ActualEisensteinCubic.O→*ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ→ℂ) (X H₀ : ℝ) : outsideCanonicalBin S D hbad Q Ψ m f z W X H₀= outsideCanonicalBin S D hbad (progressingCubes S D H₀ Q) Ψ m f z W X H₀ := by unfold outsideCanonicalBin progressingCubes dsimp only symm apply Finset.sum_subset (Finset.filter_subset _ _) intro v hv hvnot have hn : ¬H₀≤(Ideal.absNorm (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v):ℝ) := fun h=>hvnot (Finset.mem_filter.mpr ⟨hv,h⟩) have hz : largeCubeCoefficient H₀ (cubeIdeal (InitialMeanSquare.outsideSquarefreeIdeals S D) v)=0 := by by_contra hh exact hn (largeCubeCoefficient_support H₀ _ hh).2 simp only [hz,zero_mul] theorem progressingCubes_progress (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (Q : Finset (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D)→₀ℕ)) (Z F B : ℝ) (hF : 1≤F) (hB : 1≤B) (hQ : (progressingCubes S D (if F(activeCubeLogBin_norms S D b X j v hv).2) theorem outsideCanonicalBin_zero_of_empty_filter (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes⊆S) (Q : Finset (primePool (InitialMeanSquare.outsideSquarefreeIdeals S D)→₀ℕ)) (Ψ : ActualEisensteinCubic.O→*ℂ) (m f z : ActualEisensteinCubic.O) (W : ℝ→ℂ) (X H₀ : ℝ) (hQ : progressingCubes S D H₀ Q=∅) : outsideCanonicalBin S D hbad Q Ψ m f z W X H₀=0 := by rw [outsideCanonicalBin_filter S D hbad Q Ψ m f z W X H₀,hQ] simp only [outsideCanonicalBin,Finset.sum_empty] end CanonicalRowCompletion namespace SecondPassArithmetic section open MeasureTheory open FirstPassCubeLabels (firstLogDensity) def canonicalBudgetCoefficient (C Cd Ct Tmax Clo Chi A M : ℝ) : ℝ := (∫t : ℝ,firstLogDensity 0 t)*(512*(512*32))* (Cd+Ct*Tmax+C*globalRayTripleConstant* (6*(∫t : ℝ,firstLogDensity 0 t)^3*Clo+globalTerminalConstant A M*Chi)) theorem canonicalBudgetCoefficient_nonneg (C Cd Ct Tmax Clo Chi A M : ℝ) (hC : 0≤C) (hCd : 0≤Cd) (hCt : 0≤Ct) (hTmax : 0≤Tmax) (hClo : 0≤Clo) (hChi : 0≤Chi) : 0≤canonicalBudgetCoefficient C Cd Ct Tmax Clo Chi A M := by have hi : 0≤∫t : ℝ,firstLogDensity 0 t := integral_nonneg (fun t=>FirstPassCubeLabels.firstLogDensity_nonneg 0 t) have ht := globalTerminalConstant_nonneg A M unfold canonicalBudgetCoefficient globalRayTripleConstant positivity theorem canonicalBudgetScalar_bound (C Cd Ct Tmax Clo Chi A M Γ P E t B U deltaLoss ε tailFactor terminalFactor : ℝ) (J : ℕ) (hC : 0≤C) (hCd : 0≤Cd) (hCt : 0≤Ct) (hTmax : 0≤Tmax) (_hClo : 0≤Clo) (hChi : 0≤Chi) (hΓ : 0≤Γ) (hP : 0≤P) (hE : 1≤E) (hB : 0≤B) (hBU : B≤U) (hU : 1≤U) (hδ : 0≤deltaLoss) (hε : 0≤ε) (htail : tailFactor≤Tmax) (hterminal : terminalFactor≤1) : (∫s : ℝ,firstLogDensity 0 s)*(512*(512*32))*Γ*P* ((B*U)^ε*(Cd+Ct*tailFactor)+C*globalRayTripleConstant*U^(deltaLoss+8*ε)* (canonicalDensityConstant E J t*Clo+globalTerminalConstant A M*Chi*terminalFactor))≤ canonicalBudgetCoefficient C Cd Ct Tmax Clo Chi A M* Γ*P*U^(deltaLoss+8*ε)*E*(1+‖t‖)^(2*J) := by have hi : 0≤∫s : ℝ,firstLogDensity 0 s := integral_nonneg (fun s=>FirstPassCubeLabels.firstLogDensity_nonneg 0 s) have ht := globalTerminalConstant_nonneg A M have hRT : 0≤globalRayTripleConstant := by unfold globalRayTripleConstant;positivity have hU0 : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hinj : Function.Injective (fun i=>Ideal.span {p i})) (base : ActualEisensteinCubic.O→*ℂ) (bad : Ideal ActualEisensteinCubic.O) (Z η : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F Ksrc : ℝ) (_hstate : CanonicalStateCondition base bad Z η Ψ m labels X F Ksrc) (pool : Finset ι) (blocks : Finset (GlobalCubeBlock ι)) (side : Bool) (windows : Fin 7→ℝ→ℂ) (C Cd Ct Tmax Γ E oldHeight B M H U A₀ Vmax : ℝ) (N J Ntail : ℕ), (∀u,‖base u‖≤1) → (∀i,IsCoprime (Ideal.span {p i}) bad) → 1 first | rfl | ring end def reopeningScaleConstant (A M : ℝ) : ℝ := 1+Real.exp (A+1)+Real.exp M def reopeningAuxiliaryScale (A M κ Z : ℝ) : ℝ := reopeningScaleConstant A M*Z^(κ+3) lemma reopeningScaleConstant_one (A M : ℝ) : 1≤reopeningScaleConstant A M := by unfold reopeningScaleConstant linarith [Real.exp_pos (A+1),Real.exp_pos M] lemma reopeningScaleConstant_exp (A M : ℝ) : Real.exp A≤reopeningScaleConstant A M := by have h : Real.exp A≤Real.exp (A+1) := Real.exp_le_exp.mpr (by linarith) unfold reopeningScaleConstant linarith [Real.exp_pos M] theorem globalFirstRowCap_reopening (Z η X F Ksrc B : ℝ) (hZ : 0 ring theorem reopening_terminal_order (η R : ℝ) (hη : 0<η) : ∃N : ℕ,0z^2) hxy) rcases (sq_eq_sq_iff_eq_or_eq_neg).mp hs with h|h · exact h · have hy0 : Ideal.Quotient.mk P y≠0 := by intro hz have he := congrArg (Ideal.Quotient.mk P) hy simp only [map_pow,map_one,hz,zero_pow (by decide : (6:ℕ)≠0)] at he exact zero_ne_one he have he : -(Ideal.Quotient.mk P y)=Ideal.Quotient.mk P y := by simpa only [h,map_neg] using hxy have htwo : (2 : ActualEisensteinCubic.O⧸P)*Ideal.Quotient.mk P y=0 := by linear_combination -he exact False.elim ((Ring.two_ne_zero hc) ((mul_eq_zero.mp htwo).resolve_right hy0)) lemma unit_pow_six (u : ActualEisensteinCubic.Oˣ) : (u.val : ActualEisensteinCubic.O)^6=1 := by have h := pow_card_eq_one' (x:=u) rw [PrimaryIdealUnitReindex.card_units_eq_six] at h exact congrArg Units.val h theorem actualSextic_unit_euler (P : Ideal ActualEisensteinCubic.O) [P.IsMaximal] (hg : lambda∉P) (hc : ringChar (ActualEisensteinCubic.O⧸P)≠2) (u : ActualEisensteinCubic.Oˣ) : actualSextic P hg (Ideal.Quotient.mk P u.val) = eisEmbedding (u.val^((Nat.card (ActualEisensteinCubic.O⧸P)-1)/6)) := by let : Field (ActualEisensteinCubic.O⧸P) := Ideal.Quotient.field P have hdata : ∃χ : MulChar (ActualEisensteinCubic.O⧸P) ActualEisensteinCubic.O, actualSextic P hg=χ.ringHomComp eisEmbedding ∧ χ^6=1 ∧ ∀v : (ActualEisensteinCubic.O⧸P)ˣ,Ideal.Quotient.mk P (χ v)=v.val^((Nat.card (ActualEisensteinCubic.O⧸P)-1)/6) := by refine ⟨_,rfl,(sexticChar_powers P hg).2.2,?_⟩ exact sexticChar_reduce_unit P hg hc obtain ⟨χ,hχ,hχ6,hreduce⟩ := hdata let v : (ActualEisensteinCubic.O⧸P)ˣ := Units.map (Ideal.Quotient.mk P).toMonoidHom u have hx : χ v.val ^ 6=1 := by rw [←MulChar.pow_apply' _ (by decide : (6:ℕ)≠0),hχ6] exact MulChar.one_apply v.isUnit have hy : (u.val^((Nat.card (ActualEisensteinCubic.O⧸P)-1)/6))^6=1 := by rw [←pow_mul,Nat.mul_comm, pow_mul,unit_pow_six,one_pow] have he : χ v.val=u.val^((Nat.card (ActualEisensteinCubic.O⧸P)-1)/6) := sixth_roots_reduce_injective P hg hc hx hy (by simpa [v] using hreduce v) rw [hχ] change eisEmbedding (χ v.val)=_ exact congrArg eisEmbedding he end CanonicalUnitEuler namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff lemma kernel_mass_le_weighted_mass_add_core (K : Set KernelQuotient) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hK : MeasurableSet K) (C : ℝ) (V : KernelQuotient→ℝ) (hV : Continuous V) (hlow : ∀q,1-C*(K.indicator (fun _ => (1:ℝ))) q≤V q) (f : kernelSmoothTests), ‖kernelSmoothTestsToL2 f‖^2≤ (∫q,V q*‖f.1 q‖^2∂integralQuotientVolume globalKubotaKernel)+ C*‖kernelMassRestrictionCLM K hK (kernelSmoothTestsToL2 f)‖^2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hK : MeasurableSet K) (C : ℝ) (V : KernelQuotient→ℝ) (hV : Continuous V) (hlow : ∀q,1-C*(K.indicator (fun _ => (1:ℝ))) q≤V q) (f : kernelSmoothTests) => by have hi : Integrable (fun q => ‖f.1 q‖^2) (integralQuotientVolume globalKubotaKernel) := (kernelSmoothTests_memLp f).norm.integrable_sq have hki := hi.indicator hK have hw := kernelSmoothTest_weighted_mass_integrable V hV f have hpoint : ∀q,‖f.1 q‖^2-C*(K.indicator (fun q => ‖f.1 q‖^2)) q≤V q*‖f.1 q‖^2 := by intro q have hh := mul_le_mul_of_nonneg_right (hlow q) (sq_nonneg ‖f.1 q‖) by_cases hq : q∈K · simp only [Set.indicator_of_mem hq] at hh ⊢ nlinarith · simp only [Set.indicator_of_notMem hq,mul_zero,sub_zero,one_mul] at hh ⊢ exact hh have hh := integral_mono (hi.sub (hki.const_mul C)) hw hpoint simp only [Pi.sub_apply] at hh rw [integral_sub hi (hki.const_mul C),integral_const_mul,integral_indicator hK, ←kernelSmoothTestsToL2_norm_sq,←kernelMassRestriction_smooth_norm_sq K hK] at hh linarith lemma kernel_compact_coercivity_extend (K : Set KernelQuotient) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hK : MeasurableSet K) (C : ℝ) (hcore : ∀f : kernelSmoothTests,‖kernelSmoothTestsToL2 f‖^2≤kernelDirichletEnergy f+ C*‖kernelMassRestrictionCLM K hK (kernelSmoothTestsToL2 f)‖^2) (u : KernelEnergyGraph), ‖kernelEnergyMass u‖^2≤‖kernelEnergyGradient u‖^2+C*‖kernelEnergyMassRestriction K hK u‖^2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hK : MeasurableSet K) (C : ℝ) (hcore : ∀f : kernelSmoothTests,‖kernelSmoothTestsToL2 f‖^2≤kernelDirichletEnergy f+ C*‖kernelMassRestrictionCLM K hK (kernelSmoothTestsToL2 f)‖^2) (u : KernelEnergyGraph) => by exact kernelEnergyGraphCore_dense.induction_on u (isClosed_le (by fun_prop) (by fun_prop)) (fun f => by change ‖kernelSmoothTestsToL2 f‖^2≤‖kernelGradientToL2 f‖^2+ C*‖kernelMassRestrictionCLM K hK (kernelSmoothTestsToL2 f)‖^2 rw [kernelGradientToL2_norm_sq] exact hcore f) lemma kernel_barrier_coercivity_of_ground_state (hground : ∀f : kernelSmoothTests, (∫q,kernelBarrierPotential 2 3 q*‖f.1 q‖^2∂integralQuotientVolume globalKubotaKernel)≤ kernelDirichletEnergy f) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel ∃K : Set KernelQuotient,∃hK : IsCompact K,∃C : ℝ,0≤C ∧ IsCompactOperator (kernelEnergyMassRestriction K hK.measurableSet) ∧ ∀u : KernelEnergyGraph,‖kernelEnergyMass u‖^2≤‖kernelEnergyGradient u‖^2+ C*‖kernelEnergyMassRestriction K hK.measurableSet u‖^2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel dsimp only obtain ⟨K,hK,C,hC,hlow⟩ := kernelBarrierPotential_lower 2 3 (by norm_num) (by norm_num) refine ⟨K,hK,C,hC,kernelEnergyMassRestriction_isCompact K hK,?_⟩ apply kernel_compact_coercivity_extend intro f exact (kernel_mass_le_weighted_mass_add_core K hK.measurableSet C (kernelBarrierPotential 2 3) (kernelBarrierPotential_continuous 2 3 (by norm_num) (by norm_num)) hlow f).trans (add_le_add (hground f) le_rfl) end open scoped Topology ComplexConjugate variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] theorem ground_state_test_fderiv (f : E → ℂ) (u : E → ℝ) (x v : E) (hf : DifferentiableAt ℝ f x) (hu : DifferentiableAt ℝ u x) (hux : u x ≠ 0) : fderiv ℝ (fun y => ‖f y‖^2/u y) x v = (2*(conj (f x)*fderiv ℝ f x v).re*u x - ‖f x‖^2*fderiv ℝ u x v)/(u x)^2 := by have hc : HasDerivAt (fun t : ℝ => x+t•v) v 0 := by simpa only [zero_add,one_smul,Pi.add_apply,id_eq] using! (hasDerivAt_const (0:ℝ) x).add ((hasDerivAt_id (0:ℝ)).smul_const v) have hx : (fun t : ℝ => x+t•v) 0 = x := by simp have hfc : HasDerivAt (fun t : ℝ => f (x+t•v)) (fderiv ℝ f x v) 0 := by have hh : HasFDerivAt f (fderiv ℝ f x) (x+(0:ℝ)•v) := by simpa using hf.hasFDerivAt simpa only [Function.comp_def] using! hh.comp_hasDerivAt 0 hc have huc : HasDerivAt (fun t : ℝ => u (x+t•v)) (fderiv ℝ u x v) 0 := by have hh : HasFDerivAt u (fderiv ℝ u x) (x+(0:ℝ)•v) := by simpa using hu.hasFDerivAt simpa only [Function.comp_def] using! hh.comp_hasDerivAt 0 hc have hzero : (fun t : ℝ => u (x+t•v)) 0 ≠ 0 := by simpa using hux have hq := hfc.norm_sq.div huc hzero have hdiff : DifferentiableAt ℝ (fun y => ‖f y‖^2/u y) x := by simpa only [div_eq_mul_inv,Pi.mul_apply,Pi.inv_apply] using! (hf.norm_sq (𝕜 := ℂ)).mul (hu.inv hux) have hqc : HasDerivAt (fun t : ℝ => ‖f (x+t•v)‖^2/u (x+t•v)) (fderiv ℝ (fun y => ‖f y‖^2/u y) x v) 0 := by have hh : HasFDerivAt (fun y => ‖f y‖^2/u y) (fderiv ℝ (fun y => ‖f y‖^2/u y) x) (x+(0:ℝ)•v) := by simpa using hdiff.hasFDerivAt simpa only [Function.comp_def] using! hh.comp_hasDerivAt 0 hc have he := hqc.unique hq simpa only [zero_smul,add_zero,real_inner_eq_re_inner ℂ,RCLike.inner_apply',RCLike.re_to_complex] using he theorem ground_state_fderiv_inequality (f : E → ℂ) (u : E → ℝ) (x v : E) (hf : DifferentiableAt ℝ f x) (hu : DifferentiableAt ℝ u x) (hux : u x ≠ 0) : fderiv ℝ u x v * fderiv ℝ (fun y => ‖f y‖^2/u y) x v ≤ ‖fderiv ℝ f x v‖^2 := by rw [ground_state_test_fderiv f u x v hf hu hux] exact ground_state_directional_inequality (u x) (fderiv ℝ u x v) hux (f x) (fderiv ℝ f x v) end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold namespace CubicEisenstein section def kernelGroundStateTest (φ : KernelQuotient → ℝ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (f : kernelSmoothTests), kernelSmoothTests := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (f : kernelSmoothTests) => by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel have hn : ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ (fun q => ‖f.1 q‖^2) := (contDiff_norm_sq ℂ).contMDiff.comp f.2.1 have hg := hn.div₀ hφ (fun q => (hpos q).ne') refine ⟨fun q => ((‖f.1 q‖^2/φ q : ℝ) : ℂ), Complex.ofRealCLM.contDiff.contMDiff.comp hg, ?_⟩ apply HasCompactSupport.of_support_subset_isCompact f.2.2 intro q hq by_contra hh have hz : f.1 q = 0 := image_eq_zero_of_notMem_tsupport hh exact hq (by simp [hz]) theorem kernelGroundStateTest_apply (φ : KernelQuotient → ℝ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (f : kernelSmoothTests) (q : KernelQuotient), (kernelGroundStateTest φ hφ hpos f).1 q = ((‖f.1 q‖^2/φ q : ℝ) : ℂ) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (f : kernelSmoothTests) (q : KernelQuotient) => rfl theorem kernelGroundStateTest_tsupport (φ : KernelQuotient → ℝ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (f : kernelSmoothTests), tsupport (kernelGroundStateTest φ hφ hpos f).1 ⊆ tsupport f.1 := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (f : kernelSmoothTests) => by apply closure_minimal _ (isClosed_tsupport f.1) intro q hq by_contra hh have hz : f.1 q = 0 := image_eq_zero_of_notMem_tsupport hh exact hq (by simp [kernelGroundStateTest_apply, hz]) def kernelTruncatedWeight (χ φ : KernelQuotient → ℝ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hχ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ χ) (hχK : HasCompactSupport χ) (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ), kernelSmoothTests := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hχ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ χ) (hχK : HasCompactSupport χ) (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) => by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel refine ⟨fun q => ((χ q*φ q : ℝ) : ℂ), Complex.ofRealCLM.contDiff.contMDiff.comp (hχ.mul hφ), ?_⟩ apply HasCompactSupport.of_support_subset_isCompact hχK intro q hq by_contra hh have hz : χ q = 0 := image_eq_zero_of_notMem_tsupport hh exact hq (by simp [hz]) theorem kernelRealLift_contDiffAt (φ : KernelQuotient → ℝ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (p : EuclideanSpatial) (hp : 0 < p 2), ContDiffAt ℝ ∞ (fun p => φ (kernelEuclideanProjection p)) p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (p : EuclideanSpatial) (hp : 0 < p 2) => let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace (((hφ.comp kernelProjection_contMDiff) (euclideanToHyperbolic p)).comp p (euclideanToHyperbolic_contMDiffAt p hp)).contDiffAt theorem kernelEuclideanProjection_continuousAt (p : EuclideanSpatial) (hp : 0 < p 2) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ContinuousAt kernelEuclideanProjection p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace (continuous_integralOrbitProjection globalKubotaKernel).continuousAt.comp (euclideanToHyperbolic_contMDiffAt p hp).continuousAt theorem kernelTruncatedWeight_field_eq (χ φ : KernelQuotient → ℝ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hχ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ χ) (hχK : HasCompactSupport χ) (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (p : EuclideanSpatial) (hp : 0 < p 2) (hχone : χ =ᶠ[𝓝 (kernelEuclideanProjection p)] (fun _ => 1)), kernelTestField (kernelTruncatedWeight χ φ hχ hχK hφ) =ᶠ[𝓝 p] (fun q => (φ (kernelEuclideanProjection q) : ℂ)) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hχ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ χ) (hχK : HasCompactSupport χ) (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (p : EuclideanSpatial) (hp : 0 < p 2) (hχone : χ =ᶠ[𝓝 (kernelEuclideanProjection p)] (fun _ => 1)) => by have he := hχone.comp_tendsto (kernelEuclideanProjection_continuousAt p hp) filter_upwards [he] with q hq change χ (kernelEuclideanProjection q) = 1 at hq change ((χ (kernelEuclideanProjection q)*φ (kernelEuclideanProjection q) : ℝ) : ℂ) = _ rw [hq,one_mul] theorem kernelTruncatedPotential_memLp (χ φ V : KernelQuotient → ℝ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite ∀ (hχ : Continuous χ) (hχK : HasCompactSupport χ) (hφ : Continuous φ) (hV : Continuous V), MemLp (fun q => ((χ q*V q*φ q : ℝ) : ℂ)) 2 (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite fun (hχ : Continuous χ) (hχK : HasCompactSupport χ) (hφ : Continuous φ) (hV : Continuous V) => by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel have hc : Continuous (fun q => ((χ q*V q*φ q : ℝ) : ℂ)) := Complex.continuous_ofReal.comp ((hχ.mul hV).mul hφ) apply hc.memLp_of_hasCompactSupport apply HasCompactSupport.of_support_subset_isCompact hχK intro q hq by_contra hh have hz : χ q = 0 := image_eq_zero_of_notMem_tsupport hh exact hq (by simp [hz]) open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold ComplexConjugate theorem ground_state_ofReal_fderiv {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (u : E → ℝ) (x v : E) (hu : DifferentiableAt ℝ u x) : fderiv ℝ (fun y => (u y : ℂ)) x v = (fderiv ℝ u x v : ℂ) := by change fderiv ℝ (Complex.ofRealCLM ∘ u) x v = _ rw [(Complex.ofRealCLM.hasFDerivAt.comp x hu.hasFDerivAt).fderiv] rfl theorem ground_state_self_product (z : ℂ) : (star z*z).re = ‖z‖^2 := by simp only [Complex.sq_norm,Complex.normSq_apply,Complex.star_def,Complex.mul_re, Complex.conj_re,Complex.conj_im] ring theorem kernelEnergyDensity_euclidean (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : 0 < p 2) : kernelQuotientEnergyDensity f (kernelEuclideanProjection p) = (p 2)^2 * ∑ j : Fin 3, ‖fderiv ℝ (kernelTestField f) p (euclideanCoordinateVector j)‖^2 := by have hh := congrArg Complex.re (kernelDirichletPairDensity_euclidean f f p hp) rw [kernelDirichletPairDensity_self] at hh rw [← Complex.ofReal_pow,Complex.mul_re] at hh simpa only [Complex.ofReal_re,Complex.ofReal_im, zero_mul,sub_zero,Complex.re_sum,ground_state_self_product] using hh theorem kernelGroundState_pair_le_at (χ φ : KernelQuotient → ℝ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hχ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ χ) (hχK : HasCompactSupport χ) (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : 0 < p 2) (hχone : χ =ᶠ[𝓝 (kernelEuclideanProjection p)] (fun _ => 1)), (kernelDirichletPairDensity (kernelTruncatedWeight χ φ hχ hχK hφ) (kernelGroundStateTest φ hφ hpos f) (kernelEuclideanProjection p)).re ≤ kernelQuotientEnergyDensity f (kernelEuclideanProjection p) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hχ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ χ) (hχK : HasCompactSupport χ) (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (f : kernelSmoothTests) (p : EuclideanSpatial) (hp : 0 < p 2) (hχone : χ =ᶠ[𝓝 (kernelEuclideanProjection p)] (fun _ => 1)) => by let u : EuclideanSpatial → ℝ := fun q => φ (kernelEuclideanProjection q) let F : EuclideanSpatial → ℂ := kernelTestField f have hu : DifferentiableAt ℝ u p := (kernelRealLift_contDiffAt φ hφ p hp).differentiableAt (by simp) have hF : DifferentiableAt ℝ F p := (kernelTestField_contDiffAt f p hp).differentiableAt (by simp) have hu0 : u p ≠ 0 := (hpos _).ne' have hG : DifferentiableAt ℝ (fun q => ‖F q‖^2/u q) p := by simpa only [div_eq_mul_inv,Pi.mul_apply,Pi.inv_apply] using! (hF.norm_sq (𝕜 := ℂ)).mul (hu.inv hu0) have hh (j : Fin 3) : fderiv ℝ (kernelTestField (kernelTruncatedWeight χ φ hχ hχK hφ)) p (euclideanCoordinateVector j) = (fderiv ℝ u p (euclideanCoordinateVector j) : ℂ) := by rw [(kernelTruncatedWeight_field_eq χ φ hχ hχK hφ p hp hχone).fderiv_eq] exact ground_state_ofReal_fderiv u p _ hu have hg (j : Fin 3) : fderiv ℝ (kernelTestField (kernelGroundStateTest φ hφ hpos f)) p (euclideanCoordinateVector j) = (fderiv ℝ (fun q => ‖F q‖^2/u q) p (euclideanCoordinateVector j) : ℂ) := by change fderiv ℝ (fun q => ((‖F q‖^2/u q : ℝ) : ℂ)) p (euclideanCoordinateVector j) = _ exact ground_state_ofReal_fderiv _ p _ hG rw [kernelDirichletPairDensity_euclidean _ _ p hp,kernelEnergyDensity_euclidean f p hp] simp only [hh,hg,Complex.star_def,Complex.conj_ofReal,← Complex.ofReal_mul, ← Complex.ofReal_pow,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im, zero_mul,sub_zero,Complex.re_sum] apply mul_le_mul_of_nonneg_left _ (sq_nonneg _) apply Finset.sum_le_sum intro j hj exact ground_state_fderiv_inequality F u p (euclideanCoordinateVector j) hF hu hu0 theorem kernelGroundState_pair_le (χ φ : KernelQuotient → ℝ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hχ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ χ) (hχK : HasCompactSupport χ) (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (f : kernelSmoothTests) (hχone : ∀ q ∈ tsupport f.1, χ =ᶠ[𝓝 q] (fun _ => 1)) (q : KernelQuotient), (kernelDirichletPairDensity (kernelTruncatedWeight χ φ hχ hχK hφ) (kernelGroundStateTest φ hφ hpos f) q).re ≤ kernelQuotientEnergyDensity f q := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hχ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ χ) (hχK : HasCompactSupport χ) (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (f : kernelSmoothTests) (hχone : ∀ q ∈ tsupport f.1, χ =ᶠ[𝓝 q] (fun _ => 1)) (q : KernelQuotient) => by by_cases hq : q ∈ tsupport f.1 · induction q using Quotient.inductionOn with | _ w => have he : kernelEuclideanProjection (hyperbolicEuclideanCoordinates w) = integralOrbitProjection globalKubotaKernel w := by simp only [kernelEuclideanProjection,Function.comp_apply,euclideanToHyperbolic_coordinates] have hh := kernelGroundState_pair_le_at χ φ hχ hχK hφ hpos f (hyperbolicEuclideanCoordinates w) (hyperbolicHeight_pos w) (by rw [he]; exact hχone _ hq) rwa [he] at hh · rw [kernelDirichletPairDensity_zero_of_notMem _ _ q (fun h => hq (kernelGroundStateTest_tsupport φ hφ hpos f h)),Complex.zero_re] exact kernelQuotientEnergyDensity_nonneg f q theorem kernel_ground_state_inequality (φ V : KernelQuotient → ℝ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (hV : Continuous V) (hPDE : ∀ p : EuclideanSpatial, 0 < p 2 → positiveEuclideanLaplacian (fun q => (φ (kernelEuclideanProjection q) : ℂ)) p = ((V (kernelEuclideanProjection p)*φ (kernelEuclideanProjection p) : ℝ) : ℂ)) (f : kernelSmoothTests), (∫ q, V q*‖f.1 q‖^2 ∂integralQuotientVolume globalKubotaKernel) ≤ kernelDirichletEnergy f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hφ : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℝ) ∞ φ) (hpos : ∀ q, 0 < φ q) (hV : Continuous V) (hPDE : ∀ p : EuclideanSpatial, 0 < p 2 → positiveEuclideanLaplacian (fun q => (φ (kernelEuclideanProjection q) : ℂ)) p = ((V (kernelEuclideanProjection p)*φ (kernelEuclideanProjection p) : ℝ) : ℂ)) (f : kernelSmoothTests) => by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace obtain ⟨χ,hχ,hχK,hχone,hχrange⟩ := kernelCompact_smooth_cutoff (tsupport f.1) f.2.2 let h := kernelTruncatedWeight χ φ hχ hχK hφ let g := kernelGroundStateTest φ hφ hpos f let A : KernelQuotient → ℂ := fun q => ((χ q*V q*φ q : ℝ) : ℂ) have hA : MemLp A 2 (integralQuotientVolume globalKubotaKernel) := kernelTruncatedPotential_memLp χ φ V hχ.continuous hχK hφ.continuous hV have hcoord : ∀ p : EuclideanSpatial, 0 < p 2 → kernelEuclideanProjection p ∈ tsupport g.1 → kernelCoordinateLaplacian h p = A (kernelEuclideanProjection p) := by intro p hp hpg have hfmem : kernelEuclideanProjection p ∈ tsupport f.1 := kernelGroundStateTest_tsupport φ hφ hpos f hpg have hlocal := hχone (kernelEuclideanProjection p) hfmem change positiveEuclideanLaplacian (kernelTestField h) p = _ rw [positiveEuclideanLaplacian_congr _ _ p (kernelTruncatedWeight_field_eq χ φ hχ hχK hφ p hp hlocal),hPDE p hp] dsimp only [A] rw [hlocal.eq_of_nhds,one_mul] have hprod (q : KernelQuotient) : star (A q)*g.1 q = ((V q*‖f.1 q‖^2 : ℝ) : ℂ) := by change star ((χ q*V q*φ q : ℝ) : ℂ) * ((‖f.1 q‖^2/φ q : ℝ) : ℂ) = _ by_cases hfzero : f.1 q = 0 · simp [hfzero] · have hq : q ∈ tsupport f.1 := subset_tsupport f.1 hfzero have hχq : χ q = 1 := (hχone q hq).eq_of_nhds have hφq : φ q ≠ 0 := (hpos q).ne' simp only [Complex.star_def,Complex.conj_ofReal,← Complex.ofReal_mul,hχq,one_mul] congr 1 field_simp have hgreen : kernelDirichletForm h g = ((∫ q, V q*‖f.1 q‖^2 ∂integralQuotientVolume globalKubotaKernel : ℝ) : ℂ) := by rw [kernelDirichletForm_supported_equation h g A hA hcoord] simp_rw [hprod] exact integral_complex_ofReal have hbound : (∫ q, (kernelDirichletPairDensity h g q).re ∂integralQuotientVolume globalKubotaKernel) ≤ kernelDirichletEnergy f := by exact integral_mono (kernelDirichletPairDensity_integrable h g).re (kernelQuotientEnergyDensity_integrable f) (fun q => kernelGroundState_pair_le χ φ hχ hχK hφ hpos f hχone q) have hreal : (∫ q, (kernelDirichletPairDensity h g q).re ∂integralQuotientVolume globalKubotaKernel) = (kernelDirichletForm h g).re := by simpa only [kernelDirichletForm,RCLike.re_to_complex] using integral_re (kernelDirichletPairDensity_integrable h g) rw [hreal,hgreen,Complex.ofReal_re] at hbound exact hbound end open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold theorem kernel_actual_barrier_ground_state (f : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (∫q,kernelBarrierPotential 2 3 q*‖f.1 q‖^2∂integralQuotientVolume globalKubotaKernel)≤ kernelDirichletEnergy f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernel_ground_state_inequality (kernelQuotientBarrier 2 3) (kernelBarrierPotential 2 3) (kernelQuotientBarrier_contMDiff 2 3 (by norm_num) (by norm_num)) (fun q => lt_of_lt_of_le zero_lt_one (kernelQuotientBarrier_one_le 2 3 (by norm_num) (by norm_num) q)) (kernelBarrierPotential_continuous 2 3 (by norm_num) (by norm_num)) (kernelBarrierPotential_equation 2 3 (by norm_num) (by norm_num)) f theorem kernel_global_exterior_coercivity : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel ∃K : Set KernelQuotient,∃hK : IsCompact K,∃C : ℝ,0≤C ∧ IsCompactOperator (kernelEnergyMassRestriction K hK.measurableSet) ∧ ∀u : KernelEnergyGraph,‖kernelEnergyMass u‖^2≤‖kernelEnergyGradient u‖^2+ C*‖kernelEnergyMassRestriction K hK.measurableSet u‖^2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel kernel_barrier_coercivity_of_ground_state kernel_actual_barrier_ground_state end CubicEisenstein namespace SecondPassArithmetic theorem lowerCubeBin_mass_product (X F B : ℝ) (hB : B≠0) : B*((X/B^3)*(Real.exp 1*B)^2*F)*((X/B^3)*(Real.exp 1*B)^3*F)= Real.exp 5*(X*F)^2 := by have he : (Real.exp 1)^5=Real.exp 5 := by rw [show (5:ℝ)=1+1+1+1+1 by norm_num] simp only [Real.exp_add] ring simp only [mul_pow] rw [←he] field_simp theorem canonicalBudget_sqrt_product (b₁ b₂ D₁ D₂ Q : ℝ) (hD₁ : 0≤D₁) (hD₂ : 0≤D₂) (hQ : 0≤Q) (h₁ : b₁≤D₁*Q) (h₂ : b₂≤D₂*Q) : Real.sqrt b₁*Real.sqrt b₂≤Real.sqrt D₁*Real.sqrt D₂*Q := by calc _ ≤ Real.sqrt (D₁*Q)*Real.sqrt (D₂*Q) := mul_le_mul (Real.sqrt_le_sqrt h₁) (Real.sqrt_le_sqrt h₂) (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) _ = _ := by rw [Real.sqrt_mul hD₁,Real.sqrt_mul hD₂] calc _ = Real.sqrt D₁*Real.sqrt D₂*(Real.sqrt Q*Real.sqrt Q) := by ring _ = _ := by rw [Real.mul_self_sqrt hQ] theorem canonicalPairBudget_normalized (X F B Ksrc Kcut Cf cap U power E t D₁ D₂ b₁ b₂ : ℝ) (J : ℕ) (hX : 0(hb₅ t).trans (by linarith),fun t=>(hb₆ t).trans (by linarith)⟩ theorem reopenedCanonicalRow_state_step (g V : 𝓢(ℝ,ℂ)) (M Nv : ℝ) (hM : 0≤M) (hNv : 0≤Nv) (hgM : ∀t,g t≠0→|t|≤M) (hV : ∀t,V t≠0→|t|≤Nv) (hWin : ∀t,g t≠0→V t=1) (ε deltaLoss : ℝ) (hε : 0<ε) (hδ : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hinj : Function.Injective (fun i=>Ideal.span {p i})) (_hpr : ∀i,lambda^2∣p i-1) (base : ActualEisensteinCubic.O→*ℂ) (bad : Ideal ActualEisensteinCubic.O) (Z η : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F Ksrc : ℝ) (_hstate : CanonicalStateCondition base bad Z η Ψ m labels X F Ksrc) (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (β : Ideal ActualEisensteinCubic.O→(ι→₀ℕ)→ℂ) (Γ t B H U Tmax E : ℝ), (∀u,‖base u‖≤1) → (∀i,IsCoprime (Ideal.span {p i}) bad) → 1frequencyTwist g t (columnLog p (X/B^3) S))) Ksrc).re≤ B*(‖canonicalSourceZero p hp hcop hg pool bs labels a Ψt Ψt m m g g rowMajorant Ksrc (X/B^3)‖+ ‖canonicalSourceTail p hp hcop hg pool bs labels a Ψt Ψt m m g g rowMajorant Ksrc (Ksrc/Z^η) (X/B^3)‖)+ (Real.exp 5*Cfirst*Real.sqrt D₁*Real.sqrt D₂)*Γ^2*(X*F)^2* (Ksrc/(Ksrc/Z^η))*(globalFirstRowCap (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F)^deltaLoss* U^(deltaLoss+8*ε)*E*(1+‖t‖)^(2*J) := by obtain ⟨w₁,w₂,Cf,C₁,Cd₁,Ct₁,C₂,Cd₂,Ct₂,hCf,hC₁,hCd₁,hCt₁,hC₂,hCd₂,hCt₂, hwc₁,hws₁,hwb₁,hwc₂,hws₂,hwb₂,htransfer⟩ := reopenedCanonicalRow_nonzero_twoPassage g V M Nv hM hNv hgM hV hWin ε deltaLoss hε hδ (N+1) (2*J) Ntail obtain ⟨Clo,Chi,hClo,hChi,hbudget⟩ := globalFirstQuantitativeBudget_bounded deltaLoss hδ ε hε obtain ⟨Vmax₁,hVmax₁,hw₁₅,hw₁₆⟩ := two_windows_bound w₁ hwc₁ (fun i=>(hws₁ i).continuous) obtain ⟨Vmax₂,hVmax₂,hw₂₅,hw₂₆⟩ := two_windows_bound w₂ hwc₂ (fun i=>(hws₂ i).continuous) have hwb₁' : ∀i t,w₁ i t≠0→|t|≤M+7 := by convert hwb₁ using 1 ; ring_nf have hwb₂' : ∀i t,w₂ i t≠0→|t|≤M+7 := by convert hwb₂ using 1 ; ring_nf refine ⟨w₁,w₂,Cf,C₁,Cd₁,Ct₁,C₂,Cd₂,Ct₂,Clo,Chi,Vmax₁,Vmax₂, hCf,hC₁,hCd₁,hCt₁,hC₂,hCd₂,hCt₂,hClo,hChi,hVmax₁,hVmax₂, hwc₁,hws₁,hwb₁',hwc₂,hws₂,hwb₂',?_⟩ intro ι _ p hp _ hcop hg hc hinj hpr base bad Z η Ψ m labels X F Ksrc hstate pool Q β Γ t B H U Tmax E hbase hpbad hZ hZbig hη hηsmall hΓ hE hU hB hH hTmax hKU hellU hBU hHU heU hMU hprogress hβ hQ hQB htail hterminal ih dsimp only have hX:=hstate.column_pos have hF0 : 0hstate.coefficient.norm_le hbase u have he := htransfer p hp hinj hcop hg hc hpr pool Q labels β Ψ m Γ t Ksrc (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F H U hΓ hK0 hKcut hell hBsup hF0 hH hU hMU hΨ hβ hQ hQB (fun I hI=>(hstate.label_bounds I hI).2.1) (fun I hI=>(hstate.label_bounds I hI).2.2.2) let blocks:=canonicalSourceBlocks pool (reopenedCubeFamily Q) have hb₁ : ∀b∈blocks,‖eisEmbedding (primeProduct p b.cube.support b.cube.leftExponent)‖^2≤Real.exp 1*B:= fun b hb=>(canonicalSourceBlocks_cube_norms p pool (reopenedCubeFamily Q) (Real.exp 1*B) (fun c hc=>(reopenedCubeFamily_cube_norms p Q _ hQB c hc).1) (fun c hc=>(reopenedCubeFamily_cube_norms p Q _ hQB c hc).2) b hb).1 have hb₂ : ∀b∈blocks,‖eisEmbedding (primeProduct p b.cube.support b.cube.rightExponent)‖^2≤Real.exp 1*B:= fun b hb=>(canonicalSourceBlocks_cube_norms p pool (reopenedCubeFamily Q) (Real.exp 1*B) (fun c hc=>(reopenedCubeFamily_cube_norms p Q _ hQB c hc).1) (fun c hc=>(reopenedCubeFamily_cube_norms p Q _ hQB c hc).2) b hb).2 have hbL:=hbudget p hp hcop hg hc hinj base bad Z η Ψ m labels X F Ksrc hstate pool blocks true w₁ C₁ Cd₁ Ct₁ Tmax (Γ^2) E t B M H U (M+7) Vmax₁ N J Ntail hbase hpbad hZ hZbig hη hηsmall hC₁ hCd₁.le hCt₁.le hTmax (sq_nonneg Γ) hE hU hB hH hKU hellU hBU hHU heU hprogress (by linarith) hVmax₁ hw₁₅ hw₁₆ (hwb₁' 5) (hwb₁' 6) hb₁ hb₂ htail hterminal (ih true) have hbR:=hbudget p hp hcop hg hc hinj base bad Z η Ψ m labels X F Ksrc hstate pool blocks false w₂ C₂ Cd₂ Ct₂ Tmax (Γ^2) E t B M H U (M+7) Vmax₂ N J Ntail hbase hpbad hZ hZbig hη hηsmall hC₂ hCd₂.le hCt₂.le hTmax (sq_nonneg Γ) hE hU hB hH hKU hellU hBU hHU heU hprogress (by linarith) hVmax₂ hw₂₅ hw₂₆ (hwb₂' 5) (hwb₂' 6) hb₁ hb₂ htail hterminal (ih false) let D₁:=canonicalBudgetCoefficient C₁ Cd₁ Ct₁ Tmax Clo Chi (M+7) Vmax₁ let D₂:=canonicalBudgetCoefficient C₂ Cd₂ Ct₂ Tmax Clo Chi (M+7) Vmax₂ have hD₁ : 0≤D₁:=canonicalBudgetCoefficient_nonneg _ _ _ _ _ _ _ _ hC₁ hCd₁.le hCt₁.le hTmax hClo.le hChi.le have hD₂ : 0≤D₂:=canonicalBudgetCoefficient_nonneg _ _ _ _ _ _ _ _ hC₂ hCd₂.le hCt₂.le hTmax hClo.le hChi.le have hpairs:=canonicalPairBudget_normalized X F B Ksrc (Ksrc/Z^η) Cf ((globalFirstRowCap (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F)^deltaLoss) U (deltaLoss+8*ε) E t (D₁*Γ^2) (D₂*Γ^2) _ _ J hX hF0.le hB0 hK0.le hKcut hCf (Real.rpow_nonneg (globalFirstRowCap_pos _ _ _ _ hKcut hell (zero_lt_one.trans_le hBsup) hF0).le _) (zero_le_one.trans hU) (zero_le_one.trans hE) (mul_nonneg hD₁ (sq_nonneg Γ)) (mul_nonneg hD₂ (sq_nonneg Γ)) (by simpa only [mul_assoc] using hbL) (by simpa only [mul_assoc] using hbR) have hsqrt : Real.sqrt (D₁*Γ^2)*Real.sqrt (D₂*Γ^2)=Real.sqrt D₁*Real.sqrt D₂*Γ^2 := by rw [Real.sqrt_mul hD₁,Real.sqrt_mul hD₂,Real.sqrt_sq_eq_abs] calc _ = Real.sqrt D₁*Real.sqrt D₂*(|Γ|^2) := by ring _ = _ := by rw [sq_abs] have hscaled:=mul_le_mul_of_nonneg_left he hB0.le calc _ ≤ B*(‖canonicalSourceZero p hp hcop hg pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) (normHeightTwist Ψ t) (normHeightTwist Ψ t) m m g g rowMajorant Ksrc (X/B^3)‖+ ‖canonicalSourceTail p hp hcop hg pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) (normHeightTwist Ψ t) (normHeightTwist Ψ t) m m g g rowMajorant Ksrc (Ksrc/Z^η) (X/B^3)‖)+ B*((X/B^3)*(Real.exp 1*B)^2*F*(Ksrc/(Ksrc/Z^η))*Cf* (globalFirstRowCap (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F)^deltaLoss* Real.sqrt (globalFirstQuantitativeBudget p hp hcop hg pool blocks (normHeightTwist Ψ t) m w₁ C₁ Cd₁ Ct₁ (Γ^2) ε (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F M H U (N+1) (2*J) Ntail true)* Real.sqrt (globalFirstQuantitativeBudget p hp hcop hg pool blocks (normHeightTwist Ψ t) m w₂ C₂ Cd₂ Ct₂ (Γ^2) ε (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F M H U (N+1) (2*J) Ntail false)) := hscaled.trans_eq (by ring) _ ≤ _ := by apply (add_le_add le_rfl hpairs).trans_eq calc _ = _ := by rw [show Real.exp 5*Cf*Real.sqrt (D₁*Γ^2)*Real.sqrt (D₂*Γ^2)= Real.exp 5*Cf*(Real.sqrt (D₁*Γ^2)*Real.sqrt (D₂*Γ^2)) by ring,hsqrt];ring theorem reopenedCanonicalRow_polynomial_step (g V : 𝓢(ℝ,ℂ)) (A M Nv : ℝ) (hM : 0≤M) (hNv : 0≤Nv) (hgM : ∀t,g t≠0→|t|≤M) (hV : ∀t,V t≠0→|t|≤Nv) (hWin : ∀t,g t≠0→V t=1) (ε deltaLoss η : ℝ) (hε : 0<ε) (hδ : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hinj : Function.Injective (fun i=>Ideal.span {p i})) (_hpr : ∀i,lambda^2∣p i-1) (base : ActualEisensteinCubic.O→*ℂ) (bad : Ideal ActualEisensteinCubic.O) (Z : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F Ksrc : ℝ) (_hstate : CanonicalStateCondition base bad Z η Ψ m labels X F Ksrc) (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (β : Ideal ActualEisensteinCubic.O→(ι→₀ℕ)→ℂ) (Γ t B E : ℝ), (∀u,‖base u‖≤1) → (∀i,IsCoprime (Ideal.span {p i}) bad) → 1frequencyTwist g t (columnLog p (X/B^3) S))) Ksrc).re≤ B*(‖canonicalSourceZero p hp hcop hg pool bs labels a Ψt Ψt m m g g rowMajorant Ksrc (X/B^3)‖+ ‖canonicalSourceTail p hp hcop hg pool bs labels a Ψt Ψt m m g g rowMajorant Ksrc (Ksrc/Z^η) (X/B^3)‖)+ C*Γ^2*(X*F)^2*Z^(η+17*deltaLoss+32*ε)*E*(1+‖t‖)^(2*J) := by obtain ⟨N,hN,hterminal⟩ := reopening_terminal_order η 0 hη obtain ⟨w₁,w₂,Cf,C₁,Cd₁,Ct₁,C₂,Cd₂,Ct₂,Clo,Chi,Vmax₁,Vmax₂, hCf,hC₁,hCd₁,hCt₁,hC₂,hCd₂,hCt₂,hClo,hChi,hV₁,hV₂, hwc₁,hws₁,hwb₁,hwc₂,hws₂,hwb₂,hstep⟩ := reopenedCanonicalRow_state_step g V M Nv hM hNv hgM hV hWin ε deltaLoss hε hδ N J 80 let Cs:=reopeningScaleConstant A M let Tmax:=4096*Cs^20 have hCs : 1≤Cs:=reopeningScaleConstant_one A M have hTmax : 0≤Tmax:=by dsimp [Tmax]; positivity let D₁:=canonicalBudgetCoefficient C₁ Cd₁ Ct₁ Tmax Clo Chi (M+7) Vmax₁ let D₂:=canonicalBudgetCoefficient C₂ Cd₂ Ct₂ Tmax Clo Chi (M+7) Vmax₂ let Cbase:=Real.exp 5*Cf*Real.sqrt D₁*Real.sqrt D₂ let Cpow:=((Real.exp 1)^8)^deltaLoss*Cs^(deltaLoss+8*ε) have hCbase : 0≤Cbase:=by dsimp [Cbase]; positivity have hCpow : 0≤Cpow:=by dsimp [Cpow]; positivity refine ⟨w₁,w₂,Cbase*Cpow,mul_nonneg hCbase hCpow,hwc₁,hws₁,hwb₁,hwc₂,hws₂,hwb₂,?_⟩ intro ι _ p hp _ hcop hg hc hinj hpr base bad Z Ψ m labels X F Ksrc hstate pool Q β Γ t B E hbase hpbad hZ hZbig hX hXZ hFZ hΓ hE hB hactive hprogress hβ hQ hQB ih have hs:=reopeningAuxiliaryScale_bounds A M 1 Z η X F Ksrc B (by norm_num) hZ.le hη.le hX hXZ hstate.label_ge_one hFZ hstate.row_ge_one hstate.row_le_global hB hactive norm_num [reopeningAuxiliaryScale,Real.rpow_natCast] at hs obtain ⟨hU,hKU,hellU,hBU,hFU,hHU,heU,hMU,hiU⟩:=hs have htail : globalFirstTailFactor (Ksrc/Z^η) (X/B^3) (Real.exp 1*B) F (Cs*Z^4) Z 80≤Tmax := by have hh:=globalFirstTailFactor_reopening_nat_decay A M Z η X F Ksrc B 0 hZ.le hη.le hX hXZ hstate.label_ge_one hFZ hstate.row_ge_one hstate.row_le_global hB hactive simpa only [Nat.cast_zero,neg_zero,Real.rpow_zero,mul_one,zero_add] using hh have ht : (Ksrc/Z^η)/Z^(η*(N:ℝ))≤1 := by simpa only [neg_zero,Real.rpow_zero] using hterminal Z Ksrc hZ.le (zero_le_one.trans hstate.row_ge_one) hstate.row_le_global have hb:=hstep p hp hcop hg hc hinj hpr base bad Z η Ψ m labels X F Ksrc hstate pool Q β Γ t B Z (Cs*Z^(4:ℕ)) Tmax E hbase hpbad hZ hZbig hη.le hηsmall hΓ hE hU hB (zero_le_one.trans hZ.le) hTmax hKU hellU hBU hHU heU hMU hprogress hβ hQ hQB htail ht ih dsimp only at hb ⊢ have hm:=reopening_recursive_with_ratio A M Z η X F Ksrc B deltaLoss ε hZ.le hη.le (by linarith) hX hXZ hstate.label_ge_one hFZ hstate.row_ge_one hB hδ.le hε.le have hx := mul_le_mul_of_nonneg_left hm (show 0≤Cbase*Γ^2*(X*F)^2*E*(1+‖t‖)^(2*J) by positivity) apply hb.trans apply add_le_add le_rfl convert hx using 1 <;> dsimp [Cbase,Cpow,D₁,D₂,Cs] <;> ring end open ActualEisensteinCubic FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) theorem reopenedCanonicalFirstErrors_power (g : 𝓢(ℝ,ℂ)) (A M : ℝ) (hgM : ∀t,g t≠0→|t|≤M) (ε η : ℝ) (hε : 0<ε) (hη : 0<η) (hbudget : 3000*η≤(1:ℝ)/40) : ∃C : ℝ,0≤C ∧ ∀{ι : Type*} [DecidableEq ι] (p : ι→ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hinj : Function.Injective (fun i=>Ideal.span {p i})) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (base : ActualEisensteinCubic.O→*ℂ) (bad : Ideal ActualEisensteinCubic.O) (Z : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F Ksrc : ℝ) (_hstate : CanonicalStateCondition base bad Z η Ψ m labels X F Ksrc) (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (β : Ideal ActualEisensteinCubic.O→(ι→₀ℕ)→ℂ) (Γ t B : ℝ), (∀u,‖base u‖≤1) → 1≤Z → 1≤X → X≤Z^3 → F≤Z^3 → 0≤Γ → 1≤B → B^3≤Real.exp A*X → (∀I∈labels,∀v∈Q,‖β I v‖≤Γ) → (∀v∈Q,‖eisEmbedding (primeProduct p v.support v)‖^2≤Real.exp 1*B) → let Ψt:=normHeightTwist Ψ t let bs:=reopenedCubeFamily Q let a:=reopenedPairCoefficient β B*(‖canonicalSourceZero p hp hcop hg pool bs labels a Ψt Ψt m m g g rowMajorant Ksrc (X/B^3)‖+ ‖canonicalSourceTail p hp hcop hg pool bs labels a Ψt Ψt m m g g rowMajorant Ksrc (Ksrc/Z^η) (X/B^3)‖)≤ C*Γ^2*(X*F)^2*Z^(3*ε-(1:ℝ)/40) := by obtain ⟨N,hN,horder⟩:=canonicalFirstTail_reopening_order η ε ((1:ℝ)/40) hη hε.le obtain ⟨Cz,Ct,hCz,hCt,herrors⟩:=reopenedCanonicalFirstErrors g M hgM ε hε N let Cs:=reopeningScaleConstant A M have hCs : 1≤Cs:=reopeningScaleConstant_one A M let Cz':=Cz*(Real.exp 1)^(1+ε)*Cs^ε let Ct':=4*Ct*(Real.exp (2*M))^N*Cs^(25+ε) have hCz' : 0≤Cz':=by dsimp [Cz']; positivity have hCt' : 0≤Ct':=by dsimp [Ct']; positivity refine ⟨Cz'+Ct',add_nonneg hCz' hCt',?_⟩ intro ι _ p hp _ hcop hg hinj hc base bad Z Ψ m labels X F Ksrc hstate pool Q β Γ t B hbase hZ hX hXZ hFZ hΓ hB hactive hβ hQB have hZ0 : 0hstate.coefficient.norm_le hbase u) hβ hQB (fun I hI=>(hstate.label_bounds I hI).1) (fun I hI=>(hstate.label_bounds I hI).2.2.2) dsimp only at herr ⊢ have hzero:=canonicalFirstZero_normalization Cz Γ X F Ksrc B Z ε hCz hX0 hF0.le hK0.le hB (hstate.row_bound hZ hη.le hbudget) have hBpow : B^ε≤Cs^ε*Z^(3*ε) := by have hh : B≤Cs*Z^3 := (le_mul_of_one_le_left hB0.le (Real.one_le_exp (by norm_num))).trans (reopening_cube_bound A M Z X B hZ hX hXZ hB hactive) apply (Real.rpow_le_rpow hB0.le hh hε.le).trans_eq rw [Real.mul_rpow (by linarith) (by positivity),←Real.rpow_natCast_mul hZ0.le] norm_num have hz : B*‖canonicalSourceZero p hp hcop hg pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) (normHeightTwist Ψ t) (normHeightTwist Ψ t) m m g g rowMajorant Ksrc (X/B^3)‖≤ Cz'*Γ^2*(X*F)^2*Z^(3*ε-(1:ℝ)/40) := by apply ((mul_le_mul_of_nonneg_left herr.1 hB0.le).trans hzero).trans calc _ ≤ (Cz*(Real.exp 1)^(1+ε))*(Cs^ε*Z^(3*ε))*Γ^2*(X*F)^2*Z^(-((1:ℝ)/40)) := by gcongr _ = _ := by rw [show 3*ε-(1:ℝ)/40=3*ε+(-((1:ℝ)/40)) by ring,Real.rpow_add hZ0]; dsimp [Cz']; ring have ht0:=horder Cs Ct Γ B (Real.exp 1*B) U F Ksrc Z M hCs hCt hB0.le (by positivity) (by positivity) hF0.le hstate.row_ge_one hZ hB0U hBU le_rfl hFU hKsrcU have ht : B*‖canonicalSourceTail p hp hcop hg pool (reopenedCubeFamily Q) labels (reopenedPairCoefficient β) (normHeightTwist Ψ t) (normHeightTwist Ψ t) m m g g rowMajorant Ksrc (Ksrc/Z^η) (X/B^3)‖≤ Ct'*Γ^2*(X*F)^2*Z^(3*ε-(1:ℝ)/40) := by have hpow : Z^(-((1:ℝ)/40))≤Z^(3*ε-(1:ℝ)/40):= Real.rpow_le_rpow_of_exponent_le hZ (by linarith) have hXF : 1≤(X*F)^2:=one_le_pow₀ (one_le_mul_of_one_le_of_one_le hX hstate.label_ge_one) apply ((mul_le_mul_of_nonneg_left herr.2 hB0.le).trans ht0).trans calc _ = Ct'*Γ^2*Z^(-((1:ℝ)/40)):=by dsimp [Ct']; ring _ ≤ Ct'*Γ^2*((X*F)^2*Z^(3*ε-(1:ℝ)/40)):=by apply mul_le_mul_of_nonneg_left _ (mul_nonneg hCt' (sq_nonneg Γ)) exact hpow.trans (le_mul_of_one_le_left (by positivity) hXF) _ = _:=by ring rw [mul_add] exact (add_le_add hz ht).trans_eq (by ring) open ActualEisensteinCubic FirstPassCubeLabels open ConcreteTraceCRT (eisEmbedding) open JointLogSeparation (frequencyTwist) theorem reopenedCanonicalRow_closed_step (g V : 𝓢(ℝ,ℂ)) (A M Nv : ℝ) (hM : 0≤M) (hNv : 0≤Nv) (hgM : ∀t,g t≠0→|t|≤M) (hV : ∀t,V t≠0→|t|≤Nv) (hWin : ∀t,g t≠0→V t=1) (ε deltaLoss η : ℝ) (hε : 0<ε) (hδ : 0Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hinj : Function.Injective (fun i=>Ideal.span {p i})) (_hpr : ∀i,lambda^2∣p i-1) (base : ActualEisensteinCubic.O→*ℂ) (bad : Ideal ActualEisensteinCubic.O) (Z : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F Ksrc : ℝ) (_hstate : CanonicalStateCondition base bad Z η Ψ m labels X F Ksrc) (pool : Finset ι) (Q : Finset (ι→₀ℕ)) (β : Ideal ActualEisensteinCubic.O→(ι→₀ℕ)→ℂ) (Γ t B E : ℝ), (∀u,‖base u‖≤1) → (∀i,IsCoprime (Ideal.span {p i}) bad) → 1frequencyTwist g t (columnLog p (X/B^3) S))) Ksrc).re≤ C*Γ^2*(X*F)^2*Z^(η+17*deltaLoss+32*ε)*E*(1+‖t‖)^(2*J) := by obtain ⟨w₁,w₂,Cp,hCp,hwc₁,hws₁,hwb₁,hwc₂,hws₂,hwb₂,hstep⟩ := reopenedCanonicalRow_polynomial_step g V A M Nv hM hNv hgM hV hWin ε deltaLoss η hε hδ hη hηsmall J obtain ⟨Ce,hCe,herrors⟩:=reopenedCanonicalFirstErrors_power g A M hgM ε η hε hη hbudget refine ⟨w₁,w₂,Ce+Cp,add_nonneg hCe hCp,hwc₁,hws₁,hwb₁,hwc₂,hws₂,hwb₂,?_⟩ intro ι _ p hp _ hcop hg hc hinj hpr base bad Z Ψ m labels X F Ksrc hstate pool Q β Γ t B E hbase hpbad hZ hZbig hX hXZ hFZ hΓ hE hB hactive hprogress hβ hQ hQB ih have hpstep:=hstep p hp hcop hg hc hinj hpr base bad Z Ψ m labels X F Ksrc hstate pool Q β Γ t B E hbase hpbad hZ hZbig hX hXZ hFZ hΓ hE hB hactive hprogress hβ hQ hQB ih have herr:=herrors p hp hcop hg hinj hc base bad Z Ψ m labels X F Ksrc hstate pool Q β Γ t B hbase hZ.le hX hXZ hFZ hΓ hB hactive hβ hQB dsimp only at hpstep herr have hpow : Z^(3*ε-(1:ℝ)/40)≤Z^(η+17*deltaLoss+32*ε):= Real.rpow_le_rpow_of_exponent_le hZ.le (by linarith) have hEH : 1≤E*(1+‖t‖)^(2*J):= one_le_mul_of_one_le_of_one_le hE (one_le_pow₀ (by linarith [norm_nonneg t])) have he : Ce*Γ^2*(X*F)^2*Z^(3*ε-(1:ℝ)/40)≤ Ce*Γ^2*(X*F)^2*Z^(η+17*deltaLoss+32*ε)*E*(1+‖t‖)^(2*J) := by calc _ ≤ Ce*Γ^2*(X*F)^2*Z^(η+17*deltaLoss+32*ε):= mul_le_mul_of_nonneg_left hpow (by positivity) _ ≤ (Ce*Γ^2*(X*F)^2*Z^(η+17*deltaLoss+32*ε))*(E*(1+‖t‖)^(2*J)):= le_mul_of_one_le_right (by positivity) hEH _ = _:=by ring apply hpstep.trans exact (add_le_add (herr.trans he) le_rfl).trans_eq (by ring) end SecondPassArithmetic open scoped BigOperators Classical namespace CompletedGauss open ActualEisensteinCubic UniqueFactorizationMonoid theorem nonresidual_count_eq_on_fiber (I J Q P : Ideal ActualEisensteinCubic.O) (hI : I≠0) (hP : Prime P) (hA : rowPowerfulPart I=rowPowerfulPart J) (hT : rowMaskPart I Q=rowMaskPart J Q) (hpool : P∣I*Q) (hr : ¬P∣rowResidualPart I Q) : (normalizedFactors I).count P=(normalizedFactors J).count P := by have ha := congrArg (fun A : Ideal ActualEisensteinCubic.O=>(normalizedFactors A).count P) hA simp only [normalizedFactors_rowPowerfulPart,Multiset.count_filter] at ha have ht := congrArg (fun A : Ideal ActualEisensteinCubic.O=>(normalizedFactors A).count P) hT simp only [rowMaskPart,normalizedFactors_squarefreeMaskPart, normalizedFactors_rowSimplePart,Multiset.count_filter] at ht have hr0 : (normalizedFactors (rowResidualPart I Q)).count P=0 := by apply Multiset.count_eq_zero.mpr intro hm exact hr ((UniqueFactorizationMonoid.mem_normalizedFactors_iff (squarefreeResidualPart_ne_zero (rowSimplePart I) Q)).mp hm).2 simp only [rowResidualPart,normalizedFactors_squarefreeResidualPart, normalizedFactors_rowSimplePart,Multiset.count_filter] at hr0 by_cases hpq : P∣Q · simp only [hpq,ite_true] at ht by_cases hi : 2≤(normalizedFactors I).count P <;> by_cases hj : 2≤(normalizedFactors J).count P <;> simp only [hi,hj,ite_true,ite_false,not_true_eq_false,not_false_eq_true] at ha ht <;> omega · have hpi : P∣I := (hP.dvd_mul.mp hpool).resolve_right hpq have hci : 0<(normalizedFactors I).count P := Multiset.count_pos.mpr ((UniqueFactorizationMonoid.mem_normalizedFactors_iff hI).mpr ⟨hP,hpi⟩) simp only [hpq,not_false_eq_true,ite_true] at hr0 by_cases hi : 2≤(normalizedFactors I).count P <;> by_cases hj : 2≤(normalizedFactors J).count P <;> simp only [hi,hj,ite_true,ite_false,not_true_eq_false,not_false_eq_true] at ha hr0 <;> omega theorem nonresidual_prime_transport (I J F Q P : Ideal ActualEisensteinCubic.O) (hI : I≠0) (hJ : J≠0) (hP : Prime P) (hA : rowPowerfulPart I=rowPowerfulPart J) (hT : rowMaskPart I Q=rowMaskPart J Q) (hpool : P∣I*Q) (hr : ¬P∣rowResidualPart I Q) : P∣J*Q ∧ ¬P∣rowResidualPart J Q ∧ completedLocalExponent I F P=completedLocalExponent J F P := by have hc := nonresidual_count_eq_on_fiber I J Q P hI hP hA hT hpool hr have hpoolJ : P∣J*Q := by rcases hP.dvd_mul.mp hpool with hi|hq · have hm := (UniqueFactorizationMonoid.mem_normalizedFactors_iff hI).mpr ⟨hP,hi⟩ have hcj : 0<(normalizedFactors J).count P := hc ▸ Multiset.count_pos.mpr hm exact dvd_mul_of_dvd_left ((UniqueFactorizationMonoid.mem_normalizedFactors_iff hJ).mp (Multiset.count_pos.mp hcj)).2 Q · exact dvd_mul_of_dvd_right hq J have hrc : (normalizedFactors (rowResidualPart I Q)).count P= (normalizedFactors (rowResidualPart J Q)).count P := by simp only [rowResidualPart,normalizedFactors_squarefreeResidualPart, normalizedFactors_rowSimplePart,Multiset.count_filter,hc] refine ⟨hpoolJ,?_,?_⟩ · intro hd have hm := (UniqueFactorizationMonoid.mem_normalizedFactors_iff (squarefreeResidualPart_ne_zero (rowSimplePart J) Q)).mpr ⟨hP,hd⟩ have hp : 0<(normalizedFactors (rowResidualPart I Q)).count P := hrc.symm ▸ Multiset.count_pos.mpr hm exact hr ((UniqueFactorizationMonoid.mem_normalizedFactors_iff (squarefreeResidualPart_ne_zero (rowSimplePart I) Q)).mp (Multiset.count_pos.mp hp)).2 · simp only [completedLocalExponent,hc] lemma completedResidualScale_eq_on_fiber (K : ℝ) (I J Q : Ideal ActualEisensteinCubic.O) (hA : rowPowerfulPart I=rowPowerfulPart J) (hT : rowMaskPart I Q=rowMaskPart J Q) : completedResidualScale K I Q=completedResidualScale K J Q := by simp only [completedResidualScale,hA,hT] end CompletedGauss open Filter MeasureTheory open scoped BigOperators Classical Topology namespace CubicEisenstein variable {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] [NormedAddCommGroup F] [NormedSpace ℂ F] [NormedAddCommGroup G] [NormedSpace ℂ G] omit [CompleteSpace E] in lemma compact_estimate_prod_antilipschitz (T : E→L[ℂ]F) (K : E→L[ℂ]G) (A B : ℝ) (hest : ∀u,‖u‖^2≤A*‖T u‖^2+B*‖K u‖^2) : ∃D : NNReal,AntilipschitzWith D (T.prod K) := by let R := max A 0+max B 0 have hR : 0≤R := add_nonneg (le_max_right _ _) (le_max_right _ _) refine ⟨⟨Real.sqrt R,Real.sqrt_nonneg _⟩,(T.prod K).antilipschitz_of_bound (fun u => ?_)⟩ have hT : ‖T u‖^2≤‖(T.prod K) u‖^2 := (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr (norm_fst_le (T u,K u)) have hK : ‖K u‖^2≤‖(T.prod K) u‖^2 := (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr (norm_snd_le (T u,K u)) have hh : ‖u‖^2≤R*‖(T.prod K) u‖^2 := calc _ ≤A*‖T u‖^2+B*‖K u‖^2 := hest u _ ≤ max A 0*‖T u‖^2+max B 0*‖K u‖^2 := add_le_add (mul_le_mul_of_nonneg_right (le_max_left _ _) (sq_nonneg _)) (mul_le_mul_of_nonneg_right (le_max_left _ _) (sq_nonneg _)) _ ≤ max A 0*‖(T.prod K) u‖^2+max B 0*‖(T.prod K) u‖^2 := add_le_add (mul_le_mul_of_nonneg_left hT (le_max_right _ _)) (mul_le_mul_of_nonneg_left hK (le_max_right _ _)) _ = _ := by dsimp only [R]; ring change ‖u‖≤Real.sqrt R*‖(T.prod K) u‖ apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg _))).mp simpa only [mul_pow,Real.sq_sqrt hR] using hh lemma finiteDimensional_ker_of_compact_estimate (T : E→L[ℂ]F) (K : E→L[ℂ]G) (hK : IsCompactOperator K) (A B : ℝ) (hest : ∀u,‖u‖^2≤A*‖T u‖^2+B*‖K u‖^2) : FiniteDimensional ℂ T.ker := by let : CompleteSpace T.ker := T.isClosed_ker.completeSpace_coe have hc : IsCompactOperator (K.comp T.ker.subtypeL) := hK.comp_clm T.ker.subtypeL have hid : IsCompactOperator (ContinuousLinearMap.id ℂ T.ker) := by apply compact_of_norm_le_compact _ _ hc refine ⟨Real.sqrt (max B 0),fun u => ?_⟩ have ht : T (u:E)=0 := u.2 have hh := hest (u:E) rw [ht,norm_zero,zero_pow (by decide : 2≠0),mul_zero,zero_add] at hh have hh' : ‖u‖^2≤ max B 0*‖K (u:E)‖^2 := hh.trans (mul_le_mul_of_nonneg_right (le_max_left _ _) (sq_nonneg _)) change ‖u‖≤Real.sqrt (max B 0)*‖K (u:E)‖ apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg _))).mp simpa only [mul_pow,Real.sq_sqrt (le_max_right B 0)] using hh' exact FiniteDimensional.of_isCompactOperator_id hid lemma antilipschitz_of_injective_compact_estimate (T : E→L[ℂ]F) (K : E→L[ℂ]G) (hK : IsCompactOperator K) (A B : ℝ) (hest : ∀u,‖u‖^2≤A*‖T u‖^2+B*‖K u‖^2) (hT : Function.Injective T) : ∃D : NNReal,AntilipschitzWith D T := by by_contra hanti have hex (ε : ℝ) (hε : 0<ε) : ∃u : E,‖u‖=1 ∧ ‖T u‖<ε := by by_contra! hn apply hanti refine ⟨⟨ε⁻¹,inv_nonneg.mpr hε.le⟩,antilipschitz_of_bound_of_norm_one T (fun u hu => ?_)⟩ change 1≤ε⁻¹*‖T u‖ have hh := mul_le_mul_of_nonneg_left (hn u hu) (inv_nonneg.mpr hε.le) simpa only [inv_mul_cancel₀ hε.ne'] using hh obtain ⟨eps,hepsAnti,hepsPos,heps⟩ := exists_seq_strictAnti_tendsto (0:ℝ) choose u hunorm huT using fun n : ℕ => hex (eps n) (hepsPos n) have huTlim : Tendsto (fun n => T (u n)) atTop (𝓝 0) := squeeze_zero_norm (fun n => (huT n).le) heps obtain ⟨S,hS,hsub⟩ := hK.image_closedBall_subset_compact 1 obtain ⟨k,hk,seq,hseq,hklim⟩ := hS.tendsto_subseq (fun n => hsub ⟨u n,by simp only [Metric.mem_closedBall,dist_zero_right,hunorm,le_refl],rfl⟩) let P := T.prod K obtain ⟨D,hD⟩ := compact_estimate_prod_antilipschitz T K A B hest have hlim : Tendsto (fun n => P (u (seq n))) atTop (𝓝 (0,k)) := (huTlim.comp hseq.tendsto_atTop).prodMk_nhds hklim have hmem : (0,k)∈Set.range P := (hD.isClosed_range P.uniformContinuous).mem_of_tendsto hlim (Eventually.of_forall (fun n => ⟨u (seq n),rfl⟩)) obtain ⟨v,hv⟩ := hmem have hvlim : Tendsto (fun n => u (seq n)) atTop (𝓝 v) := by apply (hD.isInducing P.continuous).tendsto_nhds_iff.mpr change Tendsto (fun n => P (u (seq n))) atTop (𝓝 (P v)) rw [hv] exact hlim have hvzero : v=0 := hT (by have hh := congrArg Prod.fst hv change T v=0 at hh simpa only [map_zero] using hh) have hnorm : ‖v‖=1 := tendsto_nhds_unique hvlim.norm (by simpa only [hunorm] using tendsto_const_nhds) rw [hvzero,norm_zero] at hnorm norm_num at hnorm end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.FredholmAlternative namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace section variable {E F G : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] [NormedAddCommGroup F] [NormedSpace ℂ F] [NormedAddCommGroup G] [NormedSpace ℂ G] omit [CompleteSpace E] in lemma ker_orthogonal_restriction_injective (T : E→L[ℂ]F) : Function.Injective (T.domRestrict T.kerᗮ) := by apply LinearMap.ker_eq_bot.mp apply LinearMap.ker_eq_bot'.mpr intro u hu apply Subtype.ext apply (inner_self_eq_zero (𝕜 := ℂ)).mp exact T.ker.inner_right_of_mem_orthogonal hu u.2 lemma ker_orthogonal_restriction_range (T : E→L[ℂ]F) : Set.range (T.domRestrict T.kerᗮ)=Set.range T := by let : CompleteSpace T.ker := T.isClosed_ker.completeSpace_coe apply Set.Subset.antisymm · rintro _ ⟨u,rfl⟩ exact ⟨u.1,rfl⟩ · rintro _ ⟨u,rfl⟩ refine ⟨⟨u-T.ker.starProjection u,T.ker.sub_starProjection_mem_orthogonal u⟩,?_⟩ change T (u-T.ker.starProjection u)=T u rw [map_sub] have hz : T (T.ker.starProjection u)=0 := T.ker.starProjection_apply_mem u rw [hz,sub_zero] lemma ker_orthogonal_restriction_antilipschitz (T : E→L[ℂ]F) (K : E→L[ℂ]G) (hK : IsCompactOperator K) (A B : ℝ) (hest : ∀u,‖u‖^2≤A*‖T u‖^2+B*‖K u‖^2) : ∃D : NNReal,AntilipschitzWith D (T.domRestrict T.kerᗮ) := by let : CompleteSpace T.kerᗮ := T.ker.isClosed_orthogonal.completeSpace_coe apply antilipschitz_of_injective_compact_estimate (T.domRestrict T.kerᗮ) (K.domRestrict T.kerᗮ) (hK.comp_clm T.kerᗮ.subtypeL) A B (fun u => hest u) (ker_orthogonal_restriction_injective T) lemma closed_range_of_compact_estimate (T : E→L[ℂ]F) (K : E→L[ℂ]G) (hK : IsCompactOperator K) (A B : ℝ) (hest : ∀u,‖u‖^2≤A*‖T u‖^2+B*‖K u‖^2) : IsClosed (Set.range T) := by let : CompleteSpace T.kerᗮ := T.ker.isClosed_orthogonal.completeSpace_coe obtain ⟨D,hD⟩ := ker_orthogonal_restriction_antilipschitz T K hK A B hest rw [←ker_orthogonal_restriction_range T] exact hD.isClosed_range (T.domRestrict T.kerᗮ).uniformContinuous lemma selfAdjoint_range_eq_ker_orthogonal (T : E→L[ℂ]E) (hT : IsSelfAdjoint T) (hrange : IsClosed (Set.range T)) : T.range=T.kerᗮ := by have hh := T.orthogonal_ker rw [hT.adjoint_eq] at hh rw [hrange.submodule_topologicalClosure_eq] at hh exact hh.symm end section variable {E G : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] [NormedAddCommGroup G] [NormedSpace ℂ G] lemma selfAdjoint_fredholm_of_compact_estimate (T : E→L[ℂ]E) (hT : IsSelfAdjoint T) (K : E→L[ℂ]G) (hK : IsCompactOperator K) (A B : ℝ) (hest : ∀u,‖u‖^2≤A*‖T u‖^2+B*‖K u‖^2) : T.IsFredholm := by let : CompleteSpace T.ker := T.isClosed_ker.completeSpace_coe let : FiniteDimensional ℂ T.ker := finiteDimensional_ker_of_compact_estimate T K hK A B hest let : T.kerᗮ.CoFG := (T.kerᗮ.quotientEquivOfIsCompl T.ker T.ker.isCompl_orthogonal.symm).symm.finiteDimensional have hrange := closed_range_of_compact_estimate T K hK A B hest have heq := selfAdjoint_range_eq_ker_orthogonal T hT hrange let : T.range.CoFG := heq.symm ▸ (inferInstance : T.kerᗮ.CoFG) obtain ⟨D,hD⟩ := ker_orthogonal_restriction_antilipschitz T K hK A B hest let : CompleteSpace T.kerᗮ := T.ker.isClosed_orthogonal.completeSpace_coe have hemb := hD.isClosedEmbedding (T.domRestrict T.kerᗮ).uniformContinuous exact { isStrictMap := ((T.isStrictMap_isClosed_range_iff_restrict T.kerᗮ T.ker.isClosed_orthogonal).mpr ⟨hemb.isStrictMap, hemb.isClosed_range⟩).1 isClosed_range := hrange finite_ker := inferInstance finite_coker := inferInstance closedComplemented_ker := T.ker.isTopCompl_orthogonal.closedComplemented } end def kernelSpectralFormOperator (z : ℂ) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelEnergyGraph→L[ℂ]KernelEnergyGraph := letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI thirdWitness1 := @OAI.CubicEisenstein.kernelEnergyGraph_complete ContinuousLinearMap.id ℂ KernelEnergyGraph- (z+1)•(kernelEnergyMass.adjoint.comp kernelEnergyMass) lemma kernelSpectralFormOperator_inner (z : ℂ) (u : KernelEnergyGraph) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace inner ℂ u (kernelSpectralFormOperator z u)= ((‖kernelEnergyGradient u‖^2:ℝ):ℂ)-z*((‖kernelEnergyMass u‖^2:ℝ):ℂ) := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI thirdWitness1 := @OAI.CubicEisenstein.kernelEnergyGraph_complete change inner ℂ u (u-(z+1)•kernelEnergyMass.adjoint (kernelEnergyMass u))=_ rw [inner_sub_right,inner_smul_right u (kernelEnergyMass.adjoint (kernelEnergyMass u)) (z + 1),kernelEnergyMass.adjoint_inner_right, inner_self_eq_norm_sq_to_K,inner_self_eq_norm_sq_to_K] simp only [RCLike.ofReal_eq_complex_ofReal,←Complex.ofReal_pow,kernelEnergyGraph_norm_sq,Complex.ofReal_add] ring lemma kernelSpectralFormOperator_selfAdjoint (spectralParam : ℝ) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI thirdWitness1 := @OAI.CubicEisenstein.kernelEnergyGraph_complete IsSelfAdjoint (kernelSpectralFormOperator (spectralParam:ℂ)) := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI thirdWitness1 := @OAI.CubicEisenstein.kernelEnergyGraph_complete apply ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric.mpr apply (LinearMap.isSymmetric_iff_inner_map_self_real _).mpr intro u have hh := kernelSpectralFormOperator_inner (spectralParam:ℂ) u have hr : inner ℂ (kernelSpectralFormOperator (spectralParam:ℂ) u) u= (((‖kernelEnergyGradient u‖^2-spectralParam*‖kernelEnergyMass u‖^2):ℝ):ℂ) := by rw [←inner_conj_symm (𝕜 := ℂ) (kernelSpectralFormOperator (spectralParam : ℂ) u) u,kernelSpectralFormOperator_inner] simp only [map_sub,map_mul,Complex.conj_ofReal,Complex.ofReal_sub,Complex.ofReal_mul] change (starRingEnd ℂ) (inner ℂ (kernelSpectralFormOperator (spectralParam:ℂ) u) u)= inner ℂ (kernelSpectralFormOperator (spectralParam:ℂ) u) u rw [hr,Complex.conj_ofReal] lemma scalar_compact_energy_estimate (m g n t k spectralParam C : ℝ) (_hn : 0≤n) (_ht : 0≤t) (hspectralParam : 0≤ spectralParam) (hspectralParamone : spectralParam<1) (hC : 0≤C) (hspace : n^2=m^2+g^2) (hcore : m^2≤g^2+C*k^2) (hform : g^2-spectralParam*m^2≤n*t) : n^2≤(4/(1-spectralParam)^2)*t^2+(4*C/(1-spectralParam))*k^2 := by have hd : 0<1-spectralParam := sub_pos.mpr hspectralParamone have hlow : (1-spectralParam)/2*n^2≤n*t+C*k^2 := by nlinarith [mul_nonneg (show 0≤1+spectralParam by linarith) (sub_nonneg.mpr hcore), mul_nonneg hd.le (mul_nonneg hC (sq_nonneg k))] have hlow' := mul_le_mul_of_nonneg_left hlow (show 0≤4*(1-spectralParam) by positivity) have hsq : (1-spectralParam)^2*n^2≤4*t^2+4*(1-spectralParam)*C*k^2 := by nlinarith [sq_nonneg ((1-spectralParam)*n-2*t)] have he : (4/(1-spectralParam)^2)*t^2+(4*C/(1-spectralParam))*k^2= (4*t^2+4*(1-spectralParam)*C*k^2)/(1-spectralParam)^2 := by field_simp [hd.ne'] rw [he] exact (le_div_iff₀ (sq_pos_of_pos hd)).mpr (by nlinarith [hsq]) lemma kernelSpectralFormOperator_compact_estimate (K : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; Set KernelQuotient) (hK : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; MeasurableSet K) (C : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; ℝ) (hC : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; 0≤C) (hcore : ∀u : KernelEnergyGraph,‖kernelEnergyMass u‖^2≤‖kernelEnergyGradient u‖^2+ C*‖kernelEnergyMassRestriction K hK u‖^2) (spectralParam : ℝ) (hspectralParam : 0≤ spectralParam) (hspectralParamone : spectralParam<1) (u : KernelEnergyGraph) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ‖u‖^2≤(4/(1-spectralParam)^2)*‖kernelSpectralFormOperator (spectralParam:ℂ) u‖^2+ (4*C/(1-spectralParam))*‖kernelEnergyMassRestriction K hK u‖^2 := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace apply scalar_compact_energy_estimate ‖kernelEnergyMass u‖ ‖kernelEnergyGradient u‖ ‖u‖ ‖kernelSpectralFormOperator (spectralParam:ℂ) u‖ ‖kernelEnergyMassRestriction K hK u‖ spectralParam C (norm_nonneg _) (norm_nonneg _) hspectralParam hspectralParamone hC (kernelEnergyGraph_norm_sq u) (hcore u) have hh := re_inner_le_norm (𝕜 := ℂ) u (kernelSpectralFormOperator (spectralParam:ℂ) u) rw [kernelSpectralFormOperator_inner] at hh simpa only [RCLike.re_to_complex,Complex.sub_re,Complex.mul_re,Complex.ofReal_re, Complex.ofReal_im,mul_zero,sub_zero] using hh lemma kernelSpectralFormOperator_solution_graph (z : ℂ) (F : KernelQuotientL2) (v : KernelEnergyGraph) (hv : kernelSpectralFormOperator z v=kernelVariationalSolution F) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelEnergyMass v,F+z•kernelEnergyMass v)∈kernelEnergyLaplacian.graph := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI thirdWitness1 := @OAI.CubicEisenstein.kernelEnergyGraph_complete rw [kernelEnergyLaplacian_graph,mem_kernelLaplacianGraph] have hh : v-(z+1)•kernelEnergyMass.adjoint (kernelEnergyMass v)=kernelEnergyMass.adjoint F := hv have hv' : kernelEnergyMass.adjoint (F+(z+1)•kernelEnergyMass v)=v := by rw [map_add,map_smul] exact (sub_eq_iff_eq_add.mp hh).symm have he : kernelEnergyMass v+(F+z•kernelEnergyMass v)=F+(z+1)•kernelEnergyMass v := by rw [add_smul,one_smul] abel rw [he] change kernelEnergyMass (kernelEnergyMass.adjoint (F+(z+1)•kernelEnergyMass v))=kernelEnergyMass v rw [hv'] lemma kernelSpectralFormOperator_of_domain (z : ℂ) (u : kernelEnergyLaplacian.domain) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSpectralFormOperator z (kernelVariationalSolution (kernelEnergyLaplacian u+u))= kernelVariationalSolution (kernelEnergyLaplacian u-z•(u:KernelQuotientL2)) := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace have hu : kernelEnergyMass (kernelVariationalSolution (kernelEnergyLaplacian u+u))=u := kernelEnergyLaplacian_resolvent_relation u change kernelVariationalSolution (kernelEnergyLaplacian u+u)- (z+1)•kernelVariationalSolution (kernelEnergyMass (kernelVariationalSolution (kernelEnergyLaplacian u+u)))=_ rw [hu,←map_smul,←map_sub] congr 1 rw [add_smul,one_smul] abel theorem kernelSpectralFormOperator_isFredholm (spectralParam : ℝ) (hzero : 0≤ spectralParam) (hone : spectralParam<1) : letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelSpectralFormOperator (spectralParam:ℂ)).IsFredholm := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI thirdWitness2 := @OAI.CubicEisenstein.kernelEnergyGraph_complete let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel obtain ⟨K,hK,C,hC,hcompact,hcoercive⟩ := kernel_global_exterior_coercivity exact selfAdjoint_fredholm_of_compact_estimate _ (kernelSpectralFormOperator_selfAdjoint spectralParam) (kernelEnergyMassRestriction K hK.measurableSet) hcompact (4/(1-spectralParam)^2) (4*C/(1-spectralParam)) (kernelSpectralFormOperator_compact_estimate K hK.measurableSet C hC hcoercive spectralParam hzero hone) theorem kernel_theta_spectral_fredholm : (kernelSpectralFormOperator (8/9:ℂ)).IsFredholm := by convert kernelSpectralFormOperator_isFredholm (8/9) (by norm_num) (by norm_num) using 1 norm_num end CubicEisenstein namespace CanonicalRowCompletion open SecondPassArithmetic theorem cubeLogRange_sq_small_power (b ε : ℝ) (_hb : 0≤b) (hε : 0<ε) : ∃C : ℝ,0by rw [poolPrimary_span F hF i];infer_instance let Q':=progressingCubes S D H₀ Q let β:=fun I v=>reopenedCubeCoefficient H₀ (rowTwist (normHeightTwist Ψ oldHeight) (m*excludedGenerator S) (idealGenerator I) 1) (cubeIdeal F v) let n:=fun v=>(Ideal.absNorm (cubeIdeal F v):ℝ) (∀ξ : ℝ,B*rowFamilyEnergy labels (fun I z=> reopenedCanonicalRow (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Q' (separatedCubeCoefficient (β I) n B ξ) Ψ m (idealGenerator I) (fun T=>frequencyTwist V (oldHeight+ξ) (columnLog (poolPrimary F) ell T)) z) K≤ E*(1+|oldHeight+ξ|)^(2*J)) → X*rowFamilyEnergy labels (fun I z=> outsideCanonicalBin S D hbad Q (normHeightTwist Ψ oldHeight) m (idealGenerator I) z W X H₀) K≤ E*(1+|oldHeight|)^(2*J)* (∫ξ : ℝ,‖reopeningCoefficient W a b ha hs hW ξ‖*(1+|ξ|)^J)^2 := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal dsimp only let F:=InitialMeanSquare.outsideSquarefreeIdeals S D have hF:=InitialMeanSquare.outsideSquarefree_admissible S D hbad let : ∀i : primePool F,(Ideal.span {poolPrimary F i}).IsMaximal := fun i=>by rw [poolPrimary_span F hF i];infer_instance let Q':=progressingCubes S D H₀ Q let β:=fun I v=>reopenedCubeCoefficient H₀ (rowTwist (normHeightTwist Ψ oldHeight) (m*excludedGenerator S) (idealGenerator I) 1) (cubeIdeal F v) let n:=fun v=>(Ideal.absNorm (cubeIdeal F v):ℝ) intro hsource have hX0 : 0outsideCanonicalBin S D hbad Q (normHeightTwist Ψ oldHeight) m (idealGenerator I) z W X H₀)= (fun I z=>outsideCanonicalBin S D hbad Q' (normHeightTwist Ψ oldHeight) m (idealGenerator I) z W X H₀) := by funext I z exact outsideCanonicalBin_filter S D hbad Q _ m _ z W X H₀ rw [heq] have he := outsideCanonicalBin_energy S D hbad Q' labels (normHeightTwist Ψ oldHeight) m W a b ha hs hW V hV B ell X H₀ K ((E/B)*(1+|oldHeight|)^(2*J)) J hB hell hX hK (by positivity) (fun v hv=>hn v (hQsub hv)) (fun v hv=>hn' v (hQsub hv)) have hpnt : ∀ξ : ℝ,rowFamilyEnergy labels (fun I z=> reopenedCanonicalRow (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Q' (separatedCubeCoefficient (β I) n B ξ) (normHeightTwist Ψ oldHeight) m (idealGenerator I) (fun T=>frequencyTwist V ξ (columnLog (poolPrimary F) ell T)) z) K≤ ((E/B)*(1+|oldHeight|)^(2*J))*(1+|ξ|)^(2*J) := by intro ξ change (∑I∈labels,nonzeroRowMajorantSum _ K).re≤_ rw [reopenedCanonicalEnergy_two_heights (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Q' labels (fun I=>separatedCubeCoefficient (β I) n B ξ) Ψ m V ell K oldHeight ξ hell] change rowFamilyEnergy labels _ K≤_ have ht := (le_div_iff₀ hB).mpr (by simpa only [mul_comm] using hsource ξ) calc _ ≤ E*(1+|oldHeight+ξ|)^(2*J)/B := by simpa only [Nat.mul_comm J 2] using ht _ ≤ E*((1+|oldHeight|)^(2*J)*(1+|ξ|)^(2*J))/B := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left (height_sum_bound oldHeight ξ J) hE) hB.le _ = _ := by ring have hf:=he hpnt have hh:=mul_le_mul_of_nonneg_left hf hX0.le apply hh.trans_eq rw [hX] field_simp end CanonicalRowCompletion open scoped BigOperators Classical SchwartzMap ContDiff namespace CompletedGauss open ActualEisensteinCubic theorem shortCompletedSum_nonpos (Ψ : ActualEisensteinCubic.O→*ℂ) (W : ℝ→ℂ) (X H₀ : ℝ) (hH : H₀≤0) : shortCompletedSum Ψ W X H₀=0 := by unfold shortCompletedSum calc _ = ∑'I : Ideal ActualEisensteinCubic.O,(0:ℂ) := tsum_congr (fun I=>if_neg (not_lt_of_ge (hH.trans (Nat.cast_nonneg (Ideal.absNorm I))))) _ = 0 := tsum_zero end CompletedGauss namespace CanonicalRowCompletion open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open ConcreteTraceCRT (eisEmbedding) theorem canonicalLabels_subset_idealRange (base : ActualEisensteinCubic.O→*ℂ) (bad : Ideal ActualEisensteinCubic.O) (Z η : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F K : ℝ) (hstate : CanonicalStateCondition base bad Z η Ψ m labels X F K) (hbad : ∀P∈fixedBadPrimes,P∣bad) : labels⊆idealRange F := by intro I hI have hb:=hstate.label_bounds I hI exact mem_idealRange.mpr ⟨admissible_of_squarefree_coprime_bad I bad hb.2.1 hb.2.2.1 hbad,hb.2.2.2⟩ theorem rowFamilyEnergy_le_rectangle (labels : Finset (Ideal ActualEisensteinCubic.O)) (F K : ℝ) (hK : 0Finset.sum_nonneg (fun z hz=>sq_nonneg _)) _ = _ := by congr 1 exact (Finset.sum_coe_sort (s:=idealRange F) (f:=fun I=>∑z∈(firstFrequencyDisk (2*K)).erase 0,‖P I z‖^2)).symm theorem canonicalShortEnergy_uniform_twist (a b : ℝ) (ha : 0Ideal.span {z})) (2*K) (X/(Ideal.absNorm H:ℝ)^3) ρ q levelBound f.val (G*f.val) (CompletedHeight.normTwistedSource W θ) (CompletedUnitRows.unitRowFamily Ψ mask u f) lengthScale) → rowFamilyEnergy labels (fun I z=>shortCompletedSum (rowTwist (normHeightTwist Ψ θ) mask (idealGenerator I) z) W X (Z^((1:ℝ)/1000))) K≤ (C*(1+‖θ‖)^d)*(rays:ℝ)^2*‖lengthScale‖^2*((2*K)*(Ideal.absNorm G:ℝ)*F)^ε*(K*F)*Z^ε := by obtain ⟨d,hbound⟩:=CompletedUnitRows.short_completed_elements_uniform_twist a b ha ε ρ q levelBound hε hρ hq hlevel refine ⟨d,?_⟩ intro W hs hW obtain ⟨C,hC,h⟩:=hbound W hs hW refine ⟨2*SchwartzMap.seminorm ℝ 0 0 rowMajorant*C,by positivity,?_⟩ intro θ rays Z K X F hZ hK hF hFZ G hG hbad hmargin labels hlabels Ψ hΨ mask lengthScale hmodels have hK0 : 0shortCompletedSum (rowTwist (normHeightTwist Ψ θ) mask (idealGenerator I) z) W X (Z^((1:ℝ)/1000))) exact hrect.trans ((mul_le_mul_of_nonneg_left hsum (apply_nonneg _ _)).trans_eq (by ring)) end CanonicalRowCompletion open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff namespace CanonicalRowCompletion open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open CanonicalCubeSeparation JointLogSeparation open FirstPassCubeLabels (columnLog) theorem progressingCanonicalFamily_energy (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes⊆S) (hSp : ∀P∈S,Prime P) (labels : Finset (Ideal ActualEisensteinCubic.O)) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (W : ℝ→ℂ) (a b : ℝ) (ha : 0by rw [poolPrimary_span F hF i];infer_instance let β:=fun I v=>reopenedCubeCoefficient H₀ (rowTwist (normHeightTwist Ψ oldHeight) (m*excludedGenerator S) (idealGenerator I) 1) (cubeIdeal F v) let n:=fun v=>(Ideal.absNorm (cubeIdeal F v):ℝ) (∀j∈cubeLogRange b X, let B:=normLogScale j let Q':=progressingCubes S D H₀ (activeCubeLogBin S D b X j) Q'.Nonempty → ∀ξ : ℝ,B*rowFamilyEnergy labels (fun I z=> reopenedCanonicalRow (poolPrimary F) (poolPrimary_ne_zero F hF) (poolPrimary_coprime F hF) (poolPrimary_good F hF) Finset.univ Q' (separatedCubeCoefficient (β I) n B ξ) Ψ m (idealGenerator I) (fun T=>frequencyTwist V (oldHeight+ξ) (columnLog (poolPrimary F) (X/B^3) T)) z) K≤ E*(1+|oldHeight+ξ|)^(2*J)) → rowFamilyEnergy labels (fun I z=>outsideCanonicalRow S D hbad (normHeightTwist Ψ oldHeight) m (idealGenerator I) z W X) K≤ 2*X*rowFamilyEnergy labels (fun I z=> shortCompletedSum (rowTwist (normHeightTwist Ψ oldHeight) (m*excludedGenerator S) (idealGenerator I) z) W X H₀) K+ 2*((cubeLogRange b X).card:ℝ)^2*E*(1+|oldHeight|)^(2*J)* (∫ξ : ℝ,‖reopeningCoefficient W a b ha hs hW ξ‖*(1+|ξ|)^J)^2 := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal dsimp only let F:=InitialMeanSquare.outsideSquarefreeIdeals S D have hF:=InitialMeanSquare.outsideSquarefree_admissible S D hbad let : ∀i : primePool F,(Ideal.span {poolPrimary F i}).IsMaximal := fun i=>by rw [poolPrimary_span F hF i];infer_instance intro hsource let T:=E*(1+|oldHeight|)^(2*J)*(∫ξ : ℝ,‖reopeningCoefficient W a b ha hs hW ξ‖*(1+|ξ|)^J)^2 have hT : 0≤T := by dsimp only [T];positivity let binEnergy:=fun j=>rowFamilyEnergy labels (fun I z=> outsideCanonicalBin S D hbad (activeCubeLogBin S D b X j) (normHeightTwist Ψ oldHeight) m (idealGenerator I) z W X H₀) K have hbin (j : ℕ) (hj : j∈cubeLogRange b X) : X*binEnergy j≤T := by by_cases hnon : (progressingCubes S D H₀ (activeCubeLogBin S D b X j)).Nonempty · apply progressingCanonicalBin_energy S D hbad (activeCubeLogBin S D b X j) labels Ψ m W a b ha hs hW V hV (normLogScale j) (X/(normLogScale j)^3) X H₀ K E oldHeight J (normLogScale_pos j) (div_pos hX (pow_pos (normLogScale_pos j) _)) (by field_simp [(normLogScale_pos j).ne']) hK hE (fun v hv=>(activeCubeLogBin_norms S D b X j v hv).1) (fun v hv=>(activeCubeLogBin_norms S D b X j v hv).2) exact hsource j hj hnon · have hempty:=Finset.not_nonempty_iff_eq_empty.mp hnon have heq : (fun I z=>outsideCanonicalBin S D hbad (activeCubeLogBin S D b X j) (normHeightTwist Ψ oldHeight) m (idealGenerator I) z W X H₀)=(fun _ _=>0) := by funext I z exact outsideCanonicalBin_zero_of_empty_filter S D hbad _ _ m _ z W X H₀ hempty dsimp only [binEnergy] rw [heq] simpa only [rowFamilyEnergy,nonzeroRowMajorantSum,norm_zero,zero_pow (by decide : (2:ℕ)≠0), Complex.ofReal_zero,mul_zero,ite_self,tsum_zero,Finset.sum_const_zero,Complex.zero_re] using hT have hsum : X*∑j∈cubeLogRange b X,binEnergy j≤((cubeLogRange b X).card:ℝ)*T := by simpa only [Finset.mul_sum,Finset.sum_const,nsmul_eq_mul] using Finset.sum_le_sum hbin have hwhole:=outsideCanonicalRow_family_binned_energy S D hbad hSp (normHeightTwist Ψ oldHeight) m labels W hWc b X H₀ K hb hX hK (fun x hx=>(hs hx).2) hD calc _ ≤ 2*X*(rowFamilyEnergy labels (fun I z=> shortCompletedSum (rowTwist (normHeightTwist Ψ oldHeight) (m*excludedGenerator S) (idealGenerator I) z) W X H₀) K+ (cubeLogRange b X).card*∑j∈cubeLogRange b X,binEnergy j) := hwhole _ = 2*X*rowFamilyEnergy labels (fun I z=> shortCompletedSum (rowTwist (normHeightTwist Ψ oldHeight) (m*excludedGenerator S) (idealGenerator I) z) W X H₀) K+ (2*((cubeLogRange b X).card:ℝ))*(X*∑j∈cubeLogRange b X,binEnergy j) := by ring _ ≤ 2*X*rowFamilyEnergy labels (fun I z=> shortCompletedSum (rowTwist (normHeightTwist Ψ oldHeight) (m*excludedGenerator S) (idealGenerator I) z) W X H₀) K+ (2*((cubeLogRange b X).card:ℝ))*(((cubeLogRange b X).card:ℝ)*T) := by gcongr _ = _ := by dsimp only [T];ring end CanonicalRowCompletion end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.UnitNormalization /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CanonicalUnitEuler open ActualEisensteinCubic open CanonicalRowCompletion open ConcreteTraceCRT (eisEmbedding) open UniqueFactorizationMonoid lemma good_prime_norm_mod_six (P : Ideal ActualEisensteinCubic.O) [P.IsMaximal] (hg : lambda∉P) (hc : ringChar (ActualEisensteinCubic.O⧸P)≠2) : Ideal.absNorm P%6=1 := by let : Field (ActualEisensteinCubic.O⧸P):=Ideal.Quotient.field P let : Fintype (ActualEisensteinCubic.O⧸P):=Fintype.ofFinite _ obtain ⟨χ,hχ⟩ : ∃χ : MulChar (ActualEisensteinCubic.O⧸P) ActualEisensteinCubic.O,orderOf χ=6 := ⟨_,sexticChar_order P hg hc⟩ have hdiv:=χ.orderOf_dvd_card_sub_one rw [hχ] at hdiv have hcard : 1 simp | @cons P s ih => have hp:=hs P (Multiset.mem_cons_self _ _) let : P.IsMaximal:=hp.1 have htail : ∀Q∈s,Q.IsMaximal ∧ lambda∉Q ∧ ringChar (ActualEisensteinCubic.O⧸Q)≠2:= fun Q hQ=>hs Q (Multiset.mem_cons_of_mem hQ) obtain ⟨hv,hn⟩:=ih htail have hP:=good_prime_norm_mod_six P hp.2.1 hp.2.2 simp only [Multiset.map_cons,Multiset.prod_cons] refine ⟨?_,by rw [Nat.mul_mod,hP,hn]⟩ rw [localRowValue_good _ P hp.2.1,actualSextic_unit_euler P hp.2.1 hp.2.2,hv] have hcard : Nat.card (ActualEisensteinCubic.O⧸P)=Ideal.absNorm P := by rw [Ideal.absNorm_apply,Submodule.cardQuot_apply] rw [hcard,unit_sixth_exponent_mul u _ _ hP hn,map_mul] theorem idealRowHom_unit_norm (u : ActualEisensteinCubic.Oˣ) (I : Ideal ActualEisensteinCubic.O) (hI : I≠0) (hgood : ∀P∈normalizedFactors I,P.IsMaximal ∧ lambda∉P ∧ ringChar (ActualEisensteinCubic.O⧸P)≠2) : idealRowHom u.val I=eisEmbedding (u.val^((Ideal.absNorm I-1)/6)) := by have hn (s : Multiset (Ideal ActualEisensteinCubic.O)) : (s.map Ideal.absNorm).prod=Ideal.absNorm s.prod := by induction s using Multiset.induction_on with | empty => simp | @cons P s ih => simp only [Multiset.map_cons,Multiset.prod_cons,map_mul,ih] have hh:=(multiset_unit_norm u (normalizedFactors I) hgood).1 rw [hn,Ideal.prod_normalizedFactors_eq_self hI] at hh change (if I=0 then 0 else _) = _ rwa [if_neg hI] lemma ideal_norm_mod_six_of_good (I : Ideal ActualEisensteinCubic.O) (hI : I≠0) (hgood : ∀P∈normalizedFactors I,P.IsMaximal ∧ lambda∉P ∧ ringChar (ActualEisensteinCubic.O⧸P)≠2) : Ideal.absNorm I%6=1 := by have hn (s : Multiset (Ideal ActualEisensteinCubic.O)) : (s.map Ideal.absNorm).prod=Ideal.absNorm s.prod := by induction s using Multiset.induction_on with | empty => simp | @cons P s ih => simp only [Multiset.map_cons,Multiset.prod_cons,map_mul,ih] have hh:=(multiset_unit_norm (1:ActualEisensteinCubic.Oˣ) (normalizedFactors I) hgood).2 rwa [hn,Ideal.prod_normalizedFactors_eq_self hI] at hh theorem idealRowHom_unit_eq_of_norm_mod_thirty_six (u : ActualEisensteinCubic.Oˣ) (I J : Ideal ActualEisensteinCubic.O) (hI : I≠0) (hJ : J≠0) (hgI : ∀P∈normalizedFactors I,P.IsMaximal ∧ lambda∉P ∧ ringChar (ActualEisensteinCubic.O⧸P)≠2) (hgJ : ∀P∈normalizedFactors J,P.IsMaximal ∧ lambda∉P ∧ ringChar (ActualEisensteinCubic.O⧸P)≠2) (hmod : Ideal.absNorm I%36=Ideal.absNorm J%36) : idealRowHom u.val I=idealRowHom u.val J := by rw [idealRowHom_unit_norm u I hI hgI,idealRowHom_unit_norm u J hJ hgJ] have hmi:=ideal_norm_mod_six_of_good I hI hgI have hmj:=ideal_norm_mod_six_of_good J hJ hgJ have hm : (Ideal.absNorm I-1)/6 ≡ (Ideal.absNorm J-1)/6 [MOD 6] := by dsimp [Nat.ModEq] omega exact congrArg eisEmbedding (pow_eq_pow_of_modEq hm (unit_pow_six u)) end CanonicalUnitEuler namespace CompletedGauss open ActualEisensteinCubic CompletedDyadic end CompletedGauss open scoped BigOperators Classical SchwartzMap ContDiff namespace CanonicalRowCompletion open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open ConcreteTraceCRT (eisEmbedding) theorem shortEnergy_scalar_normalization (C H R Z K X F G ε : ℝ) (hC : 0≤C) (hH : 0≤H) (hR : 0≤R) (hZ : 1≤Z) (hK : 0≤K) (hX : 0Ideal.span {z})) (2*K) (X/(Ideal.absNorm H:ℝ)^3) ρ q levelBound f.val (G*f.val) (CompletedHeight.normTwistedSource W θ) (CompletedUnitRows.unitRowFamily Ψ mask u f) lengthScale) → 2*X*rowFamilyEnergy labels (fun I z=>shortCompletedSum (rowTwist (normHeightTwist Ψ θ) mask (idealGenerator I) z) W X (Z^((1:ℝ)/1000))) K≤ (C*(1+‖θ‖)^d)*(rays:ℝ)^2*‖lengthScale‖^2*(X*F)^2*Z^(7*ε-(1:ℝ)/40) := by obtain ⟨d,hbound⟩:=canonicalShortEnergy_uniform_twist a b ha ε ρ q levelBound hε hρ hq hlevel refine ⟨d,?_⟩ intro W hs hW obtain ⟨C,hC,hb⟩:=hbound W hs hW refine ⟨C,hC,?_⟩ intro θ rays Z K X F hZ hK hF hFZ hX hmass G hG hbad hmargin labels hlabels Ψ hΨ mask lengthScale hmodels have he:=hb θ rays Z K X F hZ hK hF hFZ G hG hbad hmargin labels hlabels Ψ hΨ mask lengthScale hmodels have hFZ' : F≤Z^3 := by apply hFZ.trans rw [←Real.rpow_natCast] exact Real.rpow_le_rpow_of_exponent_le hZ (by norm_num) have hGN : 1≤(Ideal.absNorm G:ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun hz=>hG (Ideal.absNorm_eq_zero_iff.mp hz)) have hscalar:=shortEnergy_scalar_normalization C ((1+‖θ‖)^d) ((rays:ℝ)^2*‖lengthScale‖^2) Z K X F (Ideal.absNorm G:ℝ) ε hC (by positivity) (by positivity) hZ (zero_le_one.trans hK) hX (zero_le_one.trans hF) hGN hε.le hFZ' hmass hmargin apply (mul_le_mul_of_nonneg_left he (by positivity : 0≤2*X)).trans convert hscalar using 1 <;> first | rfl | ring end CanonicalRowCompletion open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff MatrixGroups namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT namespace RootNotationUnitNormalization01 abbrev O := ActualEisensteinCubic.O end RootNotationUnitNormalization01 open RootNotationUnitNormalization01 (O) lemma rowCoordinates_zero : rowCoordinates (0 : Fin 2 → ActualEisensteinCubic.O)=0 := by apply norm_le_zero_iff.mp have h := coordinates_norm_bound (0 : Fin 2 → ActualEisensteinCubic.O) have he : (fun i : Fin 2 => eisEmbedding ((0 : Fin 2 → ActualEisensteinCubic.O) i))=0 := by funext i exact map_zero _ rw [he,norm_zero,mul_zero] at h exact h lemma rowCoordinates_norm_pos {u : Fin 2 → ActualEisensteinCubic.O} (hu : u≠0) : 0<‖rowCoordinates u‖ := by apply norm_pos_iff.mpr intro h exact hu (rowCoordinates_injective (h.trans rowCoordinates_zero.symm)) lemma rowCoordinates_le_horizontal (u : Fin 2 → ActualEisensteinCubic.O) (z : ℂ) (hz : ‖z‖≤1) : ‖rowCoordinates u‖≤2*(‖eisEmbedding (u 0)*z+eisEmbedding (u 1)‖+ ‖eisEmbedding (u 0)‖) := by apply (coordinates_norm_bound u).trans apply mul_le_mul_of_nonneg_left _ (by norm_num) apply (pi_norm_le_iff_of_nonneg (by positivity)).mpr intro i fin_cases i · simp only [Fin.zero_eta] linarith [norm_nonneg (eisEmbedding (u 0)*z+eisEmbedding (u 1))] · have h : ‖eisEmbedding (u 1)‖≤ ‖eisEmbedding (u 0)*z+eisEmbedding (u 1)‖+‖eisEmbedding (u 0)*z‖ := by simpa only [add_sub_cancel_left] using norm_sub_le (eisEmbedding (u 0)*z+eisEmbedding (u 1)) (eisEmbedding (u 0)*z) rw [norm_mul] at h have hm := mul_le_mul_of_nonneg_left hz (norm_nonneg (eisEmbedding (u 0))) rw [mul_one] at hm exact h.trans (add_le_add_right hm _) lemma height_times_coordinate_bound (A c v N : ℝ) (_hA : 0≤A) (hc : 1≤c) (hv : 1/2≤v) (hN : N≤2*(A+c)) : N*v≤5*(A^2+c^2*v^2) := by have hv0 : 0≤v := by linarith have hcv : v≤c*v := by nlinarith have hcv0 : 1/2≤c*v := by linarith have hv2 : v^2≤(c*v)^2 := by nlinarith have hcross : 2*v*A≤A^2+c^2*v^2 := by nlinarith [sq_nonneg (A-v)] have hlin : 2*c*v≤4*(c*v)^2 := by nlinarith have hNv := mul_le_mul_of_nonneg_right hN hv0 nlinarith [sq_nonneg A] lemma rowHeight_times_coordinates (u : Fin 2 → ActualEisensteinCubic.O) (hu : u 0≠0) (z : ℂ) (hz : ‖z‖≤1) (v : ℝ) (hv : 1/2≤v) : (v/(‖eisEmbedding (u 0)*z+eisEmbedding (u 1)‖^2+ ‖eisEmbedding (u 0)‖^2*v^2))*‖rowCoordinates u‖≤5 := by have hc : 1≤‖eisEmbedding (u 0)‖ := by have hh := one_le_normSq_embedding (u 0) hu rw [Complex.normSq_eq_norm_sq] at hh nlinarith [norm_nonneg (eisEmbedding (u 0))] have hden : 0<‖eisEmbedding (u 0)*z+eisEmbedding (u 1)‖^2+ ‖eisEmbedding (u 0)‖^2*v^2 := by positivity rw [div_mul_eq_mul_div] apply (div_le_iff₀ hden).mpr simpa only [mul_comm v] using height_times_coordinate_bound _ _ _ _ (norm_nonneg _) hc hv (rowCoordinates_le_horizontal u z hz) lemma positive_rpow_of_product_bound (h N C σ : ℝ) (hh : 0≤h) (hN : 0 eisEmbedding (u i)‖≤1 := by apply (pi_norm_le_iff_of_nonneg zero_le_one).mpr intro i fin_cases i · change ‖eisEmbedding (u 0)‖≤1 simp only [hc,map_zero,norm_zero,zero_le_one] · exact hdnorm.le nlinarith apply (cuspRemainderProfile_norm_le_bound a b s _ hab hb hh hs).trans exact positive_rpow_of_product_bound b _ _ _ hb hN hC hs (by nlinarith [mul_le_mul_of_nonneg_left hn hb,le_max_right (5 : ℝ) (2*b)]) · apply (cuspRemainderProfile_norm_le a b s _ hh).trans apply positive_rpow_of_product_bound _ _ _ _ hh.le hN hC hs exact (rowHeight_times_coordinates u hc z hz v hv).trans (le_max_left _ _) def translatedCuspRow (M : SL(2,ActualEisensteinCubic.O)) (r : CuspCosets) : Fin 2 → ActualEisensteinCubic.O := Matrix.vecMul (cosetRow r) (M : Matrix (Fin 2) (Fin 2) ActualEisensteinCubic.O) lemma translatedCuspRow_injective (M : SL(2,ActualEisensteinCubic.O)) : Function.Injective (translatedCuspRow M) := by intro r t h apply cosetRow_injective have hh := congrArg (fun u : Fin 2 → ActualEisensteinCubic.O => Matrix.vecMul u ((M⁻¹ : SL(2,ActualEisensteinCubic.O)) : Matrix (Fin 2) (Fin 2) ActualEisensteinCubic.O)) h simpa only [translatedCuspRow,Matrix.vecMul_vecMul,←Matrix.SpecialLinearGroup.coe_mul, mul_inv_cancel,Matrix.SpecialLinearGroup.coe_one,Matrix.vecMul_one] using hh lemma integral_bottom_coprime (M : SL(2,ActualEisensteinCubic.O)) : IsCoprime (M 1 0) (M 1 1) := by have hd : M 0 0*M 1 1-M 0 1*M 1 0=1 := by simpa only [Matrix.det_fin_two] using M.property refine ⟨-M 0 1,M 0 0,?_⟩ linear_combination hd lemma translatedCuspRow_coprime (M : SL(2,ActualEisensteinCubic.O)) (r : CuspCosets) : IsCoprime (translatedCuspRow M r 0) (translatedCuspRow M r 1) := by induction r using Quotient.inductionOn with | _ N => change IsCoprime (translatedCuspRow M (cosetOf N) 0) (translatedCuspRow M (cosetOf N) 1) simpa only [translatedCuspRow,cosetRow_cosetOf,row,Matrix.SpecialLinearGroup.coe_mul, Matrix.mul_apply,Matrix.vecMul,dotProduct] using integral_bottom_coprime ((N : SL(2,ActualEisensteinCubic.O))*M) lemma cosetHeight_integral_chart (M : SL(2,ActualEisensteinCubic.O)) (r : CuspCosets) (z : ℂ) (v : ℝ) (hv : 0 change cosetHeight (cosetOf N) (integralComplexMatrix M • upperPoint z v hv)= transformedHeight z v (eisEmbedding ∘ translatedCuspRow M (cosetOf N)) rw [cosetHeight_cosetOf,←integralComplexMatrix_levelThree, ←mul_smul,←map_mul,hyperbolicHeight_action_upperPoint] simp only [integralComplexMatrix_apply,transformedHeight,heightDenominator, Function.comp_apply,translatedCuspRow,cosetRow_cosetOf,row, Matrix.SpecialLinearGroup.coe_mul,Matrix.mul_apply,Matrix.vecMul,dotProduct] lemma translated_remainder_majorant (a b : ℝ) (s : ℂ) (hab : a (cosetCharacter r)⁻¹* cuspSeedProfile a b s (cosetHeight r w)) := (cuspCutoffTerm_summable 1 le_rfl _ w).congr (fun r => cuspCutoffTerm_eq_seedProfile a b ha hab s r w) theorem eisenstein_sub_seed_eq_series (a b : ℝ) (ha : 1≤a) (hab : a cuspCutoffTerm_eq_seedProfile a b ha hab s r w) rw [hyperbolicEisenstein_eq_height_series,heq,←hE.tsum_sub hS] apply tsum_congr intro r rw [cuspRemainderProfile,positiveHeightPower_eq_cpow s _ (cosetHeight_pos r w)] ring def eisensteinRemainderBound (b : ℝ) (s : ℂ) : ℝ := (max 5 (2*b))^s.re * ∑'n : (Fin 2×Fin 2)→ℤ,‖n‖^(-s.re) lemma eisensteinRemainderBound_nonneg (b : ℝ) (s : ℂ) : 0≤eisensteinRemainderBound b s := mul_nonneg (Real.rpow_nonneg ((by norm_num : (0:ℝ)≤5).trans (le_max_left _ _)) _) (tsum_nonneg (fun n => Real.rpow_nonneg (norm_nonneg n) _)) theorem eisenstein_sub_seed_chart_bound (a b : ℝ) (ha : 1≤a) (hab : a (max 5 (2*b))^s.re*‖n‖^(-s.re) let f : CuspCosets→(Fin 2×Fin 2)→ℤ := fun r => rowCoordinates (translatedCuspRow M r) let R : CuspCosets→ℂ := fun r => (cosetCharacter r)⁻¹*cuspRemainderProfile a b s (cosetHeight r (integralComplexMatrix M • upperPoint z v hv0)) have hg : Summable G := (summable_integer_four_rpow s.re hs).mul_left _ have hi : Function.Injective f := rowCoordinates_injective.comp (translatedCuspRow_injective M) have hb : ∀r,‖R r‖≤G (f r) := translated_remainder_majorant a b s hab (by linarith) (by linarith) M z hz v hv hv0 have hr : Summable (fun r => ‖R r‖) := (hg.comp_injective hi).of_nonneg_of_le (fun _ => norm_nonneg _) hb rw [eisenstein_sub_seed_eq_series a b ha hab s (by linarith)] change ‖∑'r,R r‖≤eisensteinRemainderBound b s apply (norm_tsum_le_tsum_norm hr).trans have hsum : (∑'r,‖R r‖)≤∑'n,G n := Summable.tsum_le_tsum_of_inj f hi (fun _ _ => by dsimp [G]; positivity) hb hr hg simpa only [G,tsum_mul_left,eisensteinRemainderBound] using hsum theorem eisenstein_sub_seed_bounded (a b : ℝ) (ha : 1≤a) (hab : a hyperbolicEisenstein s w-smoothCuspSeed a b s w) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let := integralSLCountable simp_rw [eisenstein_sub_seed_eq_series a b ha hab s hs] apply Measurable.tsum intro r exact measurable_const.mul ((cuspRemainderProfile_measurable a b s).comp (cosetHeight_continuous r).measurable) theorem kernel_eisenstein_sub_seed_memLp (a b : ℝ) (ha : 1≤a) (hab : a kernelQuotientEisenstein s (by linarith) q- kernelQuotientSeed a b s q) 2 (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite by have hmeas : Measurable (fun q => kernelQuotientEisenstein s (by linarith) q- kernelQuotientSeed a b s q) := measurable_from_quotient.mpr (eisenstein_sub_seed_measurable a b ha hab s (by linarith)) apply MemLp.of_bound hmeas.aestronglyMeasurable (eisensteinRemainderBound b s) apply Filter.Eventually.of_forall intro q induction q using Quotient.inductionOn with | _ w => exact eisenstein_sub_seed_bounded a b ha hab s hs w end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.CubicReopening namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open FirstPassCubeLabels hiding O theorem outside_pool_coprime_excluded (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes⊆S) (hSp : ∀P∈S,Prime P) (i : primePool (InitialMeanSquare.outsideSquarefreeIdeals S D)) : IsCoprime (Ideal.span {poolPrimary (InitialMeanSquare.outsideSquarefreeIdeals S D) i}) (∏P∈S,P) := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal rw [poolPrimary_span _ (InitialMeanSquare.outsideSquarefree_admissible S D hbad)] apply Ideal.isCoprime_iff_codisjoint.mpr apply (Ideal.isMaximal_def.mp (inferInstance : i.val.IsMaximal)).not_le_iff_codisjoint.mp intro hle apply excludedGenerator_not_mem_pool S D hSp i apply hle have hm : excludedGenerator S ∈ Ideal.span {excludedGenerator S} := Ideal.subset_span (by simp) simpa only [excludedGenerator,span_idealGenerator] using hm theorem cubeIdeal_eq_primeProduct_span (F : Finset (Ideal ActualEisensteinCubic.O)) (hF : ∀I∈F,Admissible I) (v : primePool F→₀ℕ) : Ideal.span {primeProduct (poolPrimary F) v.support v}=cubeIdeal F v := by rw [primeProduct,FiniteGaussPhase.span_finset_prod] simp only [←Ideal.span_singleton_pow,poolPrimary_span F hF] unfold cubeIdeal apply Finset.prod_subset (Finset.subset_univ v.support) intro i hi hni rw [Finsupp.notMem_support_iff.mp hni,pow_zero] theorem cubeIdeal_primeProduct_norm (F : Finset (Ideal ActualEisensteinCubic.O)) (hF : ∀I∈F,Admissible I) (v : primePool F→₀ℕ) : ‖ConcreteTraceCRT.eisEmbedding (primeProduct (poolPrimary F) v.support v)‖^2= (Ideal.absNorm (cubeIdeal F v):ℝ) := by rw [eisEmbedding_norm_sq_eq_absNorm_span,cubeIdeal_eq_primeProduct_span F hF] theorem progressingActiveBin_cube_bound (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (b X H₀ : ℝ) (j : ℕ) (hQ : (progressingCubes S D H₀ (activeCubeLogBin S D b X j)).Nonempty) : (normLogScale j)^3≤b*X := by obtain ⟨v,hv⟩:=hQ have hbin := (Finset.mem_filter.mp hv).1 have hactive := (Finset.mem_filter.mp hbin).1 have hnorm := (activeCubeLogBin_norms S D b X j v hbin).1 exact (pow_le_pow_left₀ (normLogScale_pos j).le hnorm 3).trans (Finset.mem_filter.mp hactive).2 end open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open CanonicalCubeSeparation JointLogSeparation open FirstPassCubeLabels (columnLog) theorem progressingCanonicalBin_closed_step (g V : 𝓢(ℝ,ℂ)) (A M Nv : ℝ) (hM : 0≤M) (hNv : 0≤Nv) (hgM : ∀t,g t≠0→|t|≤M) (hV : ∀t,V t≠0→|t|≤Nv) (hWin : ∀t,g t≠0→V t=1) (ε deltaLoss η : ℝ) (hε : 0<ε) (hδ : 0by rw [poolPrimary_span P hP i];infer_instance (∀side : Bool, let windows:=if side then windows₁ else windows₂ ∀(Ψ' : ActualEisensteinCubic.O→*ℂ) (m' : ActualEisensteinCubic.O) (labels' : Finset (Ideal ActualEisensteinCubic.O)) (X' F' K' : ℝ), CanonicalStateCondition base (∏Q∈S,Q) Z η Ψ' m' labels' X' F' K' → fixedDepthRank Z K' reopenedCanonicalRow (poolPrimary P) (poolPrimary_ne_zero P hP) (poolPrimary_coprime P hP) (poolPrimary_good P hP) Finset.univ Q' (separatedCubeCoefficient (fun v=>reopenedCubeCoefficient H₀ (rowTwist (normHeightTwist Ψ oldHeight) (m*excludedGenerator S) (idealGenerator I) 1) (cubeIdeal P v)) (fun v=>(Ideal.absNorm (cubeIdeal P v):ℝ)) B ξ) Ψ m (idealGenerator I) (fun T=>frequencyTwist g (oldHeight+ξ) (columnLog (poolPrimary P) (X/B^3) T)) z) K≤ C*(X*F)^2*Z^(η+17*deltaLoss+38*ε)*E*(1+|oldHeight+ξ|)^(2*J) := by letI importedWitness0 := @OAI.CanonicalQuadraticSieve.canonicalPoolMaximal obtain ⟨w₁,w₂,C₀,hC₀,hwc₁,hws₁,hwb₁,hwc₂,hws₂,hwb₂,hstep⟩ := reopenedCanonicalRow_closed_step g V A M Nv hM hNv hgM hV hWin ε deltaLoss η hε hδ hη hηsmall hbudget J obtain ⟨Cβ,hCβ,hβbound⟩:=outside_separated_cube_coefficient_bound ε hε let Cg:=Cβ*(Real.exp (A+1))^ε refine ⟨w₁,w₂,C₀*Cg^2,by positivity,hwc₁,hws₁,hwb₁,hwc₂,hws₂,hwb₂,?_⟩ intro S D hbad hSp base Z Ψ m labels X F K E oldHeight hstate hbase hZ hZbig hX hXZ hFZ hE dsimp only let P:=InitialMeanSquare.outsideSquarefreeIdeals S D have hP:=InitialMeanSquare.outsideSquarefree_admissible S D hbad let : ∀i : primePool P,(Ideal.span {poolPrimary P i}).IsMaximal := fun i=>by rw [poolPrimary_span P hP i];infer_instance intro ih j hj hQ ξ let B:=normLogScale j let H₀:=if FseparatedCubeCoefficient (fun u=>reopenedCubeCoefficient H₀ (rowTwist (normHeightTwist Ψ oldHeight) (m*excludedGenerator S) (idealGenerator I) 1) (cubeIdeal P u)) (fun u=>(Ideal.absNorm (cubeIdeal P u):ℝ)) B ξ v have hB : 1≤B:=normLogScale_ge_one j have hBp : 0(normHeightTwist_norm_le Ψ oldHeight u).trans (hstate.coefficient.norm_le hbase u) have hcoeff : ∀I∈labels,∀v∈Q',‖β I v‖≤Cg*Z^(3*ε) := by intro I hI v hv have hvbin: v∈activeCubeLogBin S D (Real.exp A) X j:=(Finset.mem_filter.mp hv).1 obtain ⟨hlo,hhi⟩:=activeCubeLogBin_norms S D (Real.exp A) X j v hvbin exact (hβbound S D _ hΨ m (idealGenerator I) H₀ B ξ v hBp hlo hhi).trans ((mul_le_mul_of_nonneg_left hbgrowth hCβ.le).trans_eq (by dsimp only [Cg];ring)) have hinj : Function.Injective (fun i:primePool P=>Ideal.span {poolPrimary P i}) := by intro i k he exact Subtype.ext (by simpa only [poolPrimary_span P hP] using he) have hpr (i : primePool P) : lambda^2∣poolPrimary P i-1 := (primaryPrime_spec i.val (poolPrimary_ne_zero P hP i)).2.2.2 have hn : ∀v∈Q',‖ConcreteTraceCRT.eisEmbedding (FirstPassCubeLabels.primeProduct (poolPrimary P) v.support v)‖^2≤Real.exp 1*B := by intro v hv rw [cubeIdeal_primeProduct_norm P hP] exact (activeCubeLogBin_norms S D (Real.exp A) X j v (Finset.mem_filter.mp hv).1).2 have hp := hstep (poolPrimary P) (poolPrimary_ne_zero P hP) (poolPrimary_coprime P hP) (poolPrimary_good P hP) (poolPrimary_odd P hP) hinj hpr base (∏Q∈S,Q) Z Ψ m labels X F K hstate Finset.univ Q' β (Cg*Z^(3*ε)) (oldHeight+ξ) B E hbase (outside_pool_coprime_excluded S D hbad hSp) hZ hZbig hX hXZ hFZ (by dsimp only [Cg];positivity) hE hB hactive (progressingActiveBin_progress S D (Real.exp A) X Z F j hstate.label_ge_one hQ) hcoeff (fun v hv=>Finset.subset_univ _) hn ih have hpower : (Z^(3*ε))^2*Z^(η+17*deltaLoss+32*ε)=Z^(η+17*deltaLoss+38*ε) := by rw [←Real.rpow_mul_natCast (by linarith : 0≤Z),←Real.rpow_add (by linarith : 0 by_cases hy:Supported (Ideal.span {y}) <;> simp [hx,hy] private lemma supported_good (I : Ideal ActualEisensteinCubic.O) (hI : Supported I) : ∀P∈normalizedFactors I,P.IsMaximal ∧ lambda∉P ∧ ringChar (ActualEisensteinCubic.O⧸P)≠2 := by intro P hP have hp:=prime_of_normalized_factor P hP exact ⟨(Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero,hI.2 P hP⟩ lemma unitSupplement_norm (u : ActualEisensteinCubic.Oˣ) (n : ActualEisensteinCubic.O) : ‖unitSupplement u n‖≤1 := by change ‖if _ then _ else _‖≤_ split_ifs · exact idealRowHom_norm _ _ · simp private lemma norm_eval_residue (m : ℕ) (a b : ℤ) : (Ideal.absNorm (Ideal.span {eval a b}) : ZMod m)= (a : ZMod m)^2-(a : ZMod m)*(b : ZMod m)+(b : ZMod m)^2 := by have hi : (Ideal.absNorm (Ideal.span {eval a b}) : ℤ)=a^2-a*b+b^2 := by rw [←qNat_eq_absNorm_span] change ((ShortDraftLatticeCount.q (coords (eval a b))).toNat : ℤ)=_ rw [Int.toNat_of_nonneg (qO_nonneg _),coords_eval] rfl have hz := congrArg (fun k : ℤ => (k : ZMod m)) hi push_cast at hz exact hz lemma norm_residue_congruent (m : ℕ) (x y : ActualEisensteinCubic.O) (hxy : x-y∈(Ideal.span {(m:ActualEisensteinCubic.O)} : Ideal ActualEisensteinCubic.O)) : Ideal.absNorm (Ideal.span {x})%m=Ideal.absNorm (Ideal.span {y})%m := by obtain ⟨z,hz⟩ := Ideal.mem_span_singleton.mp hxy let c:=(coords y).1 let d:=(coords y).2 let e:=(coords z).1 let f:=(coords z).2 have hy : y=eval c d:=(eval_coords y).symm have hx : x=eval (c+(m:ℤ)*e) (d+(m:ℤ)*f) := by calc x=y+(m:ActualEisensteinCubic.O)*z:=by linear_combination hz _=eval (c+(m:ℤ)*e) (d+(m:ℤ)*f):=by rw [hy,←eval_coords z] dsimp [eval,c,d,e,f] push_cast ring apply (ZMod.natCast_eq_natCast_iff' _ _ m).mp rw [hx,hy,norm_eval_residue,norm_eval_residue] simp lemma supported_span_congruent_mod_thirty_six (x y : ActualEisensteinCubic.O) (hxy : x-y∈(Ideal.span {(36:ActualEisensteinCubic.O)} : Ideal ActualEisensteinCubic.O)) : Supported (Ideal.span {x})↔Supported (Ideal.span {y}) := by have h36:(36:ActualEisensteinCubic.O)∣x-y:=Ideal.mem_span_singleton.mp hxy have hlam : lambda∣(36:ActualEisensteinCubic.O):= ((dvd_pow_self lambda (by decide : (2:ℕ)≠0)).trans lambda_sq_dvd_three).trans ⟨12,by norm_num⟩ have htwo : (2:ActualEisensteinCubic.O)∣(36:ActualEisensteinCubic.O):=⟨18,by norm_num⟩ have he (a : ActualEisensteinCubic.O) (ha : a∣x-y) : a∣x↔a∣y := by constructor · intro hx convert dvd_sub hx ha using 1 ; ring · intro hy convert dvd_add ha hy using 1 ; ring rw [supported_span_iff,supported_span_iff,he lambda (hlam.trans h36),he 2 (htwo.trans h36)] theorem unitSupplement_periodic (u : ActualEisensteinCubic.Oˣ) (x y : ActualEisensteinCubic.O) (hxy : x-y∈(Ideal.span {(36:ActualEisensteinCubic.O)} : Ideal ActualEisensteinCubic.O)) : unitSupplement u x=unitSupplement u y := by have hs:=supported_span_congruent_mod_thirty_six x y hxy change (if _ then _ else _)=(if _ then _ else _) by_cases hx:Supported (Ideal.span {x}) · have hy:=hs.mp hx rw [if_pos hx,if_pos hy] exact idealRowHom_unit_eq_of_norm_mod_thirty_six u _ _ hx.1 hy.1 (supported_good _ hx) (supported_good _ hy) (norm_residue_congruent 36 x y hxy) · rw [if_neg hx,if_neg (fun hy=>hx (hs.mpr hy))] private lemma rowTwist_zero_of_common_prime (Ψ : ActualEisensteinCubic.O→*ℂ) (m f z n : ActualEisensteinCubic.O) (P : Ideal ActualEisensteinCubic.O) (hp : Prime P) (hm : m∈P) (hn : n∈P) : rowTwist Ψ m f z n=0 := by have hPI:P∣Ideal.span {n}:=Ideal.dvd_iff_le.mpr (Ideal.span_le.mpr (Set.singleton_subset_iff.mpr hn)) have hm6:m^6∈P:=by rw [show m^6=m^5*m by ring] exact P.mul_mem_left _ hm have hx:m^6*f^4*z∈P:=P.mul_mem_right _ (P.mul_mem_right _ hm6) change Ψ n*idealRowHom _ (Ideal.span {n})=0 rw [idealRowHom_zero_of_dvd _ hp hPI hx,mul_zero] theorem rowTwist_unitSupplement (Ψ : ActualEisensteinCubic.O→*ℂ) (m f z : ActualEisensteinCubic.O) (u : ActualEisensteinCubic.Oˣ) (hmLam : lambda∣m) (hm2 : (2:ActualEisensteinCubic.O)∣m) : rowTwist Ψ m f (u.val*z)=unitSupplement u*rowTwist Ψ m f z := by ext n by_cases hn:Supported (Ideal.span {n}) · change Ψ n*idealRowHom (m^6*f^4*(u.val*z)) (Ideal.span {n})= (if Supported (Ideal.span {n}) then _ else 0)*(Ψ n*idealRowHom _ (Ideal.span {n})) rw [if_pos hn,show m^6*f^4*(u.val*z)=u.val*(m^6*f^4*z) by ring,idealRowHom_argument_mul] ring · have hz:rowTwist Ψ m f (u.val*z) n=0 := by have hbad : lambda∣n ∨ (2:ActualEisensteinCubic.O)∣n := by simpa only [supported_span_iff,not_and_or,not_not] using hn rcases hbad with hLam|h2 · exact rowTwist_zero_of_common_prime Ψ m f _ n (Ideal.span {lambda}) (Ideal.prime_of_isPrime (by rw [ne_eq,Ideal.span_singleton_eq_bot] exact PrimaryIdealUnitReindex.lambda_prime_actual.ne_zero) lambdaIdeal_maximal.isPrime) (Ideal.mem_span_singleton.mpr hmLam) (Ideal.mem_span_singleton.mpr hLam) · exact rowTwist_zero_of_common_prime Ψ m f _ n (Ideal.span {(2:ActualEisensteinCubic.O)}) (Ideal.prime_of_isPrime (by rw [ne_eq,Ideal.span_singleton_eq_bot] norm_num) twoIdeal_maximal.isPrime) (Ideal.mem_span_singleton.mpr hm2) (Ideal.mem_span_singleton.mpr h2) change rowTwist Ψ m f (u.val*z) n=(if Supported (Ideal.span {n}) then _ else 0)*_ rw [hz,if_neg hn,zero_mul] end CanonicalUnitEuler namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold MatrixGroups lemma kernelBarrier_sublevel_isCompact (T : ℝ) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology IsCompact {q : KernelQuotient | kernelQuotientBarrier 2 3 q≤T} := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology obtain ⟨S,hS⟩ := globalKubotaKernel_compact_core_cusp_cover obtain ⟨hcompact,hcover⟩ := hS (max 3 T) apply hcompact.of_isClosed_subset (isClosed_le (kernelQuotientBarrier_continuous 2 3 (by norm_num) (by norm_num)) continuous_const) intro q hq have hmem : q∈compactFordCore globalKubotaKernel S (max 3 T) ∪ ⋃r∈S,fordCuspTail globalKubotaKernel r (max 3 T) := by rw [←hcover]; trivial rcases hmem with hcore | htail · exact hcore · exfalso obtain ⟨r,hr⟩ := Set.mem_iUnion.mp htail obtain ⟨hrS,htail⟩ := Set.mem_iUnion.mp hr obtain ⟨p,hp,rfl⟩ := htail have hh : 3 linarith lemma kernelExhaustionProfile_one (n : ℕ) (v : ℝ) (hv : v≤(n:ℝ)+1) : kernelExhaustionProfile n v=1 := by rw [kernelExhaustionProfile,cuspTransition_zero 1 2 _ (by norm_num) ((div_le_one (by positivity)).mpr hv),sub_zero] lemma kernelExhaustionProfile_zero (n : ℕ) (v : ℝ) (hv : 2*((n:ℝ)+1)≤v) : kernelExhaustionProfile n v=0 := by rw [kernelExhaustionProfile,cuspTransition_one 1 2 _ (by norm_num) ((le_div_iff₀ (by positivity)).mpr hv),sub_self] lemma kernelExhaustionCutoff_hasCompactSupport (n : ℕ) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology HasCompactSupport (kernelExhaustionCutoff n) := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel apply HasCompactSupport.of_support_subset_isCompact (kernelBarrier_sublevel_isCompact (2*((n:ℝ)+1))) intro q hq change kernelQuotientBarrier 2 3 q≤2*((n:ℝ)+1) by_contra h exact hq (kernelExhaustionProfile_zero n _ (le_of_not_ge h)) lemma kernelExhaustionCutoff_bounds (n : ℕ) (q : KernelQuotient) : 0≤kernelExhaustionCutoff n q ∧ kernelExhaustionCutoff n q≤1 := kernelExhaustionProfile_bounds n _ lemma kernelExhaustionCutoff_eventually_one (q : KernelQuotient) : ∀ᶠn : ℕ in atTop,kernelExhaustionCutoff n q=1 := by obtain ⟨N,hN⟩ := exists_nat_gt (kernelQuotientBarrier 2 3 q) filter_upwards [eventually_ge_atTop N] with n hn apply kernelExhaustionProfile_one have hh : (N:ℝ)≤n := by exact_mod_cast hn linarith lemma kernelExhaustionCutoff_eventually_one_near (q : KernelQuotient) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology ∀ᶠn : ℕ in atTop,kernelExhaustionCutoff n =ᶠ[𝓝 q] (fun _ => 1) := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology obtain ⟨N,hN⟩ := exists_nat_gt (kernelQuotientBarrier 2 3 q) filter_upwards [eventually_ge_atTop N] with n hn have hh : kernelQuotientBarrier 2 3 q<(n:ℝ)+1 := by have hcast : (N:ℝ)≤n := by exact_mod_cast hn linarith filter_upwards [(kernelQuotientBarrier_continuous 2 3 (by norm_num) (by norm_num)).continuousAt.eventually_lt_const hh] with p hp exact kernelExhaustionProfile_one n _ hp.le end open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff MatrixGroups lemma cuspTransition_euler_bounded (a b : ℝ) (hab : a v*deriv (cuspTransition a b) v) := by apply HasCompactSupport.of_support_subset_isCompact isCompact_Icc intro v hv by_contra hnot have hout : v v*deriv (cuspTransition a b) v) := continuous_id.mul ((contDiff_infty_iff_deriv.mp (cuspTransition_contDiff a b)).2.continuous) obtain ⟨C,hC⟩ := hc.exists_bound_of_continuous hcont exact ⟨max C 0,le_max_right _ _,fun v => (hC v).trans (le_max_left _ _)⟩ lemma cuspRemainderProfile_contDiffAt (a b : ℝ) (s : ℂ) (v : ℝ) (hv : 0 0) := by filter_upwards [Ioi_mem_nhds hv,Ioi_mem_nhds hbv] with y hy hyb exact cuspRemainderProfile_zero a b s y hab hy hyb.le exact he.deriv_eq.trans (deriv_const v 0) lemma rowLogD_hyperbolic_bound (u : Fin 2→ℂ) (hu : u≠0) (p : SpatialCoordinates) (hp : 0

cuspRemainderProfile a b s (rowHeight u q)) p j) (p j)‖≤ (‖s‖+C)*(rowHeight u p)^s.re := by have hd := (rowProfile_axis_derivatives (cuspRemainderProfile a b s) (cuspRemainderProfile_contDiffAt a b s) u hu p hp j).1 rw [hd.deriv] have he : (p 2:ℂ)*(deriv (cuspRemainderProfile a b s) (rowHeight u p)* (rowHeight u p:ℂ)*(rowLogD u p j:ℂ))= (((p 2*rowLogD u p j):ℝ):ℂ)* ((rowHeight u p:ℂ)*deriv (cuspRemainderProfile a b s) (rowHeight u p)) := by push_cast ring rw [he,norm_mul,Complex.norm_real,Real.norm_eq_abs] apply (mul_le_of_le_one_left (norm_nonneg _) (rowLogD_hyperbolic_bound u hu p hp j)).trans exact cuspRemainderProfile_euler_bound a b s C hC _ (rowHeight_pos u hu p hp) end CubicEisenstein open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff namespace CanonicalRowCompletion open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open CanonicalCubeSeparation JointLogSeparation theorem progressingCanonicalFamily_closed_step (g V : 𝓢(ℝ,ℂ)) (A M Nv : ℝ) (hM : 0≤M) (hNv : 0≤Nv) (hgM : ∀t,g t≠0→|t|≤M) (hV : ∀t,V t≠0→|t|≤Nv) (hWin : ∀t,g t≠0→V t=1) (hgOne : ∀u,|u|≤columnWindowRadius (Real.exp (-A)) (Real.exp A)→ g u=1) (ε deltaLoss η : ℝ) (hε : 0<ε) (hδ : 0by rw [poolPrimary_span P hP i];infer_instance (∀side : Bool, let windows:=if side then windows₁ else windows₂ ∀(Ψ' : ActualEisensteinCubic.O→*ℂ) (m' : ActualEisensteinCubic.O) (labels' : Finset (Ideal ActualEisensteinCubic.O)) (X' F' K' : ℝ), CanonicalStateCondition base (∏Q∈S,Q) Z η Ψ' m' labels' X' F' K' → fixedDepthRank Z K'outsideCanonicalRow S D hbad (normHeightTwist Ψ oldHeight) m (idealGenerator I) z W X) K≤ 2*X*rowFamilyEnergy labels (fun I z=> shortCompletedSum (rowTwist (normHeightTwist Ψ oldHeight) (m*excludedGenerator S) (idealGenerator I) z) W X (if Fby rw [poolPrimary_span P hP i];infer_instance intro ih have hsource:=hstep S D hbad hSp base Z Ψ m labels X F K E oldHeight hstate hbase hZ hZbig hX hXZ hFZ hE ih have hwhole:=progressingCanonicalFamily_energy S D hbad hSp labels Ψ m W (Real.exp (-A)) (Real.exp A) (Real.exp_pos _) (Real.exp_pos _).le hs hW hWc g hgOne X (if Fby rw [poolPrimary_span P hP i];infer_instance canonicalLogEnergy (poolPrimary P) (poolPrimary_ne_zero P hP) (poolPrimary_coprime P hP) (poolPrimary_good P hP) Finset.univ Ψ m labels V X K theorem outsideLogEnergy_eq_completed (S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes⊆S) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (V : ℝ→ℂ) (hVs : ContDiff ℝ ∞ V) (A : ℝ) (hV : ∀s,V s≠0→|s|≤A) (X K : ℝ) (hX : 0outsideCanonicalRow S D hbad Ψ m (idealGenerator I) z (radialFromLog V hVs A hV) X) K := by exact canonicalLogEnergy_eq_completed_rows S D hbad Ψ m labels V hVs A hV X K hX def HasCanonicalThetaModels (S : Finset (Ideal ActualEisensteinCubic.O)) (base : ActualEisensteinCubic.O→*ℂ) (ρ q levelBound : ℝ) : Prop := ∀(A : ℝ),0≤A → ∀(W : ℝ→ℂ), Function.support W⊆Set.Icc (Real.exp (-A)) (Real.exp A) → ContDiff ℝ ∞ W → ∀κ : ℝ,0<κ → ∃C : ℝ,0≤C ∧ ∀(Z K X F θ : ℝ),1≤Z → 1≤K → 0Ideal.span {z})) (2*K) (X/(Ideal.absNorm H:ℝ)^3) ρ q levelBound f.val (G*f.val) (CompletedHeight.normTwistedSource W θ) (CompletedUnitRows.unitRowFamily Ψ (m*excludedGenerator S) u f) lengthScale theorem outsideLogEnergy_terminal_constant (V : ℝ→ℂ) (hVs : ContDiff ℝ ∞ V) (A : ℝ) (hV : ∀s,V s≠0→|s|≤A) : ∃C : ℝ,0≤C ∧ ∀(S : Finset (Ideal ActualEisensteinCubic.O)) (D : ℕ) (hbad : fixedBadPrimes⊆S) (base : ActualEisensteinCubic.O→*ℂ) (Z η : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F K t : ℝ), CanonicalStateCondition base (∏P∈S,P) Z η Ψ m labels X F K → (∀u,‖base u‖≤1) → 1abs_le.mp (hV s hs)) let v : 𝓢(ℝ,ℂ):=hVc.toSchwartzMap hVs let M:=SchwartzMap.seminorm ℝ 0 0 v refine ⟨canonicalTerminalConstant A M,canonicalTerminalConstant_nonneg A M,?_⟩ intro S D hbad base Z η Ψ m labels X F K t hstate hbase hZ hη hbudget hstop let P:=InitialMeanSquare.outsideSquarefreeIdeals S D have hP:=InitialMeanSquare.outsideSquarefree_admissible S D hbad let : ∀i : primePool P,(Ideal.span {poolPrimary P i}).IsMaximal := fun i=>by rw [poolPrimary_span P hP i];infer_instance have hinj : Function.Injective (fun i:primePool P=>Ideal.span {poolPrimary P i}) := by intro i j he exact Subtype.ext (by simpa only [poolPrimary_span P hP] using he) exact CanonicalStateCondition.terminal_energy (poolPrimary P) (poolPrimary_ne_zero P hP) (poolPrimary_coprime P hP) (poolPrimary_good P hP) (poolPrimary_odd P hP) hinj Finset.univ base (∏Q∈S,Q) Z η Ψ m labels X F K hstate hbase hZ hη hbudget V A M t (apply_nonneg _ _) (fun s=>SchwartzMap.norm_le_seminorm ℝ v s) hV hstop end CanonicalRowCompletion open scoped BigOperators Classical namespace CompletedGauss section open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding) lemma embedding_lambda_ne_zero : eisEmbedding lambda≠0 := by intro hz apply PrimaryIdealUnitReindex.lambda_prime_actual.ne_zero apply ConcreteTraceCRT.eisEmbedding_injective simpa only [map_zero] using hz end section open ActualEisensteinCubic CompletedDyadic LocalReflectionBrackets open ConcreteTraceCRT (eisEmbedding) end open ActualEisensteinCubic LocalReflectionBrackets open ConcreteTraceCRT (eisEmbedding) def paperLambda : ActualEisensteinCubic.O := 1+2*omega def paperLambdaUnit : ActualEisensteinCubic.Oˣ where val := -omega inv := -omega^2 val_inv := by calc (-omega)*(-omega^2)=omega^3:=by ring _=1:=omega_primitive.pow_eq_one inv_val := by calc (-omega^2)*(-omega)=omega^3:=by ring _=1:=omega_primitive.pow_eq_one lemma paperLambda_eq : paperLambda=paperLambdaUnit.val*lambda := by change 1+2*omega=(-omega)*lambda change (1+2*omega:ActualEisensteinCubic.O)=(-omega)*(omega-1) have hw:=omega_primitive.geom_sum_eq_zero (by decide : 1<(3:ℕ)) norm_num [Finset.sum_range_succ] at hw linear_combination hw end CompletedGauss open scoped BigOperators Classical SchwartzMap ContDiff namespace CanonicalCubeSeparation lemma columnWindowRadius_exp (A : ℝ) (hA : 0≤A) : columnWindowRadius (Real.exp (-A)) (Real.exp A)=2*A+3 := by rw [columnWindowRadius,Real.log_exp,Real.log_exp,abs_neg,abs_of_nonneg hA] ring theorem fixed_reopening_profiles (A : ℝ) (hA : 0≤A) : ∃g V : 𝓢(ℝ,ℂ), HasCompactSupport (g:ℝ→ℂ) ∧ HasCompactSupport (V:ℝ→ℂ) ∧ (∀u,|u|≤columnWindowRadius (Real.exp (-A)) (Real.exp A)→ g u=1) ∧ (∀u,g u≠0→|u|≤2*A+4) ∧ (∀u,g u≠0→V u=1) ∧ (∀u,V u≠0→|u|≤2*A+5) := by obtain ⟨g,hgc,hgs,hgone,hgsupp,hgzero⟩:=FourierBridge.exists_complex_smooth_cutoff (2*A+3) (by linarith) obtain ⟨v,hvc,hvs,hvone,hvsupp,hvzero⟩:=FourierBridge.exists_complex_smooth_cutoff (2*A+4) (by linarith) let gs : 𝓢(ℝ,ℂ):=hgc.toSchwartzMap hgs let vs : 𝓢(ℝ,ℂ):=hvc.toSchwartzMap hvs have hgbound : ∀u,g u≠0→|u|≤2*A+4 := by intro u hu have hh:=abs_le.mpr (hgsupp (subset_tsupport g hu)) linarith refine ⟨gs,vs,hgc,hvc,?_,hgbound,?_,?_⟩ · intro u hu exact hgone u (by simpa only [columnWindowRadius_exp A hA] using hu) · intro u hu exact hvone u (hgbound u hu) · intro u hu have hh:=abs_le.mpr (hvsupp (subset_tsupport v hu)) linarith end CanonicalCubeSeparation namespace CanonicalRowCompletion open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open ConcreteTraceCRT (eisEmbedding) theorem canonicalShortState_geometry (S : Finset (Ideal ActualEisensteinCubic.O)) (hSp : ∀P∈S,Prime P) (hbad : fixedBadPrimes⊆S) (base : ActualEisensteinCubic.O→*ℂ) (Z η : ℝ) (Ψ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (labels : Finset (Ideal ActualEisensteinCubic.O)) (X F K : ℝ) (hstate : CanonicalStateCondition base (∏P∈S,P) Z η Ψ m labels X F K) (hZ : 1≤Z) (hZbig : Real.exp 9000≤Z) (hη : 0≤η) (hbudget : 3000*η≤(1:ℝ)/80) (hfixed : 2*‖eisEmbedding (excludedGenerator S)‖^2≤Z^((1:ℝ)/80)) : let G:=Ideal.span {m*excludedGenerator S} G≠0 ∧ (∀P∈fixedBadPrimes,P∣G) ∧ labels⊆idealRange F ∧ X*F≤Z^3 ∧ (2*K)*(Ideal.absNorm G:ℝ)≤X*F*Z^(-((1:ℝ)/40)) := by have hprod : (∏P∈S,P)≠0:=Finset.prod_ne_zero_iff.mpr (fun P hP=>(hSp P hP).ne_zero) have he : excludedGenerator S≠0:=idealGenerator_ne_zero _ hprod have hG : (Ideal.span {m*excludedGenerator S}:Ideal ActualEisensteinCubic.O)≠0:= Ideal.span_singleton_eq_bot.not.mpr (mul_ne_zero hstate.mask_ne_zero he) have hpG : ∀P∈fixedBadPrimes,P∣Ideal.span {m*excludedGenerator S} := by intro P hP apply Ideal.dvd_iff_le.mpr apply Ideal.span_le.mpr exact Set.singleton_subset_iff.mpr (P.mul_mem_left m (excludedGenerator_mem S (hbad hP))) have hlabels : labels⊆idealRange F:=canonicalLabels_subset_idealRange base (∏P∈S,P) Z η Ψ m labels X F K hstate (fun P hP=>Finset.dvd_prod_of_mem (fun Q:Ideal ActualEisensteinCubic.O=>Q) (hbad hP)) have hmass : X*F≤Z^3:=hstate.mass_le.trans (canonicalRankMass_global Z hZbig _) refine ⟨hG,hpG,hlabels,hmass,?_⟩ have hZ0 : 0Ideal.span {z})) (2*K) (X/(Ideal.absNorm H:ℝ)^3) ρ q levelBound f.val ((Ideal.span {m*excludedGenerator S})*f.val) (CompletedHeight.normTwistedSource W θ) (CompletedUnitRows.unitRowFamily Ψ (m*excludedGenerator S) u f) lengthScale) → 2*X*rowFamilyEnergy labels (fun I z=>shortCompletedSum (rowTwist (normHeightTwist Ψ θ) (m*excludedGenerator S) (idealGenerator I) z) W X (if Fhstate.coefficient.norm_le hbase x) (m*excludedGenerator S) lengthScale (hmodels hF) · rw [if_neg hF,rowFamilyEnergy_eq_sum labels _ K (zero_lt_one.trans_le hstate.row_ge_one)] have hz (I : Ideal ActualEisensteinCubic.O) (z : ActualEisensteinCubic.O) : shortCompletedSum (rowTwist (normHeightTwist Ψ θ) (m*excludedGenerator S) (idealGenerator I) z) W X 0=0:= shortCompletedSum_nonpos _ _ _ _ le_rfl simp only [hz,norm_zero,zero_pow (by decide : (2:ℕ)≠0),mul_zero,Finset.sum_const_zero] positivity end CanonicalRowCompletion namespace CanonicalCubeSeparation def radiusIter (A : ℝ) : ℕ→ℝ | 0=>A | n+1=>radiusIter (2*A+11) n theorem radiusIter_succ (A : ℝ) (n : ℕ) : radiusIter A (n+1)=radiusIter (2*A+11) n:=rfl theorem radiusIter_mono_base (n : ℕ) : Monotone (fun A:ℝ=>radiusIter A n) := by induction n with | zero=>intro A B h;exact h | succ n ih=>intro A B h;exact ih (by linarith : 2*A+11≤2*B+11) theorem radiusIter_nonneg (A : ℝ) (hA : 0≤A) (n : ℕ) : 0≤radiusIter A n := by induction n generalizing A with | zero=>exact hA | succ n ih=>exact ih (2*A+11) (by linarith) theorem radiusIter_mono_depth (A : ℝ) (hA : 0≤A) : Monotone (radiusIter A) := by apply monotone_nat_of_le_succ intro n exact radiusIter_mono_base n (by linarith : A≤2*A+11) theorem le_radiusIter (A : ℝ) (hA : 0≤A) (n : ℕ) : A≤radiusIter A n := radiusIter_mono_depth A hA (Nat.zero_le n) theorem common_pool_parent (A Z X D : ℝ) (r : ℕ) (hA : 0≤A) (_hZ : 0≤Z) (hX : 0≤X) (hXZ : X≤Z^3) (hD : Real.exp (radiusIter A r)*Z^3≤D) : Real.exp A*X≤D := by exact (mul_le_mul (Real.exp_le_exp.mpr (le_radiusIter A hA r)) hXZ hX (Real.exp_pos _).le).trans hD end CanonicalCubeSeparation open scoped BigOperators Classical namespace QuadraticAllOddCRT open ActualEisensteinCubic open ConcreteTraceCRT (eisEmbedding eisTraceModChar finite_quotient_span) open FiniteGaussPhase hiding O def character (P : Ideal ActualEisensteinCubic.O) [P.IsMaximal] : MulChar (ActualEisensteinCubic.O⧸P) ℂ := by letI : Field (ActualEisensteinCubic.O⧸P):=Ideal.Quotient.field P letI : Fintype (ActualEisensteinCubic.O⧸P):=Fintype.ofFinite _ exact (quadraticChar (ActualEisensteinCubic.O⧸P)).ringHomComp (Int.castRingHom ℂ) theorem normalized_prime_eq_square_sum (p : ActualEisensteinCubic.O) (hp : p≠0) [(Ideal.span {p}).IsMaximal] (hc : ringChar (ActualEisensteinCubic.O⧸Ideal.span {p})≠2) : ConcreteBreveE.normalizedTraceGauss p hp (character (Ideal.span {p}))= quadraticGammaO p hp := by let : Field (ActualEisensteinCubic.O⧸Ideal.span {p}):=Ideal.Quotient.field _ let : Fintype (ActualEisensteinCubic.O⧸Ideal.span {p}):=Fintype.ofFinite _ let ψ:=eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates p hp have hψ:ψ≠1:=by have hprim:=GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive p hp simpa only [AddChar.mulShift_one] using hprim (a:=1) one_ne_zero change gaussSum (character (Ideal.span {p})) ψ/(‖eisEmbedding p‖:ℂ)= (∑x:ActualEisensteinCubic.O⧸Ideal.span {p},ψ (x^2))/(‖eisEmbedding p‖:ℂ) congr 1 exact ShortDraftQuadraticGauss.quadratic_gauss_as_square_phase ψ hc hψ theorem normalized_product_eq_square_sum {ι : Type*} [Fintype ι] (p : ι→ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) : normalizedProductTraceGauss p hp hcop (fun i=>character (Ideal.span {p i}))= quadraticGammaO (∏i,p i) (Finset.prod_ne_zero_iff.mpr (fun i _=>hp i)) := by let c:=∏i,p i have hc0:c≠0:=Finset.prod_ne_zero_iff.mpr (fun i _=>hp i) let : Finite (ActualEisensteinCubic.O⧸Ideal.span {c}):=finite_quotient_span hc0 let : Fintype (ActualEisensteinCubic.O⧸Ideal.span {c}):=Fintype.ofFinite _ let (i:ι) : Fintype (ActualEisensteinCubic.O⧸Ideal.span {p i}):=Fintype.ofFinite _ let (i:ι) : Field (ActualEisensteinCubic.O⧸Ideal.span {p i}):=Ideal.Quotient.field _ let e:=productElementCRT p hcop let ψ:=eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc0 change (∑x:ActualEisensteinCubic.O⧸Ideal.span {c},(∏i,character (Ideal.span {p i}) (e x i))*ψ x)/(‖eisEmbedding c‖:ℂ)= (∑x:ActualEisensteinCubic.O⧸Ideal.span {c},ψ (x^2))/(‖eisEmbedding c‖:ℂ) congr 1 exact IdealGaussCRT.quadratic_gauss_finite_crt_eq_square_sum (fun i=>ActualEisensteinCubic.O⧸Ideal.span {p i}) e ψ (GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive c hc0) hc theorem quadraticGamma_product {ι : Type*} [Fintype ι] (p : ι→ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) : quadraticGammaO (∏i,p i) (Finset.prod_ne_zero_iff.mpr (fun i _=>hp i))= ∏i,character (Ideal.span {p i}) (Ideal.Quotient.mk (Ideal.span {p i}) (cofactor p i))* quadraticGammaO (p i) (hp i) := by rw [←normalized_product_eq_square_sum p hp hcop hc,normalizedProductTraceGauss_crt] apply Finset.prod_congr rfl intro i hi rw [normalized_prime_eq_square_sum _ _ (hc i)] end QuadraticAllOddCRT end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.DensityTransfer namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff namespace CanonicalRowCompletion section open ActualEisensteinCubic open CompletedGauss hiding O open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open ConcreteTraceCRT (eisEmbedding) theorem canonicalShortState_from_certificate (S : Finset (Ideal ActualEisensteinCubic.O)) (hSp : ∀P∈S,Prime P) (hbad : fixedBadPrimes⊆S) (base : ActualEisensteinCubic.O→*ℂ) (hbase : ∀u,‖base u‖≤1) (ρ q levelBound : ℝ) (hρ : 0<ρ) (hq : 1shortCompletedSum (rowTwist (normHeightTwist Ψ θ) (m*excludedGenerator S) (idealGenerator I) z) W X (if Fhformula) calc _ ≤ (Cs*(1+‖θ‖)^d)*(rays:ℝ)^2*‖lengthScale‖^2*(X*F)^2*Z^(7*ε-(1:ℝ)/40):=hb _ = Cs*(1+|θ|)^d*((rays:ℝ)^2*‖lengthScale‖^2)*(X*F)^2*Z^(7*ε-(1:ℝ)/40):=by rw [Real.norm_eq_abs] ring _ ≤ Cs*(1+|θ|)^d*(Cm*Z^κ)*(X*F)^2*Z^(7*ε-(1:ℝ)/40):=by gcongr _ = _ := by rw [show κ+7*ε-(1:ℝ)/40=κ+(7*ε-(1:ℝ)/40) by ring, Real.rpow_add (zero_lt_one.trans_le hZ)] ring · have hb:=hsbound θ 0 S hSp hbad base Z η Ψ m labels X F K hstate hbase hZ hZbig hη hbudget hfixed 0 (fun hf=>False.elim (hF hf)) have hz : 2*X*rowFamilyEnergy labels (fun I z=>shortCompletedSum (rowTwist (normHeightTwist Ψ θ) (m*excludedGenerator S) (idealGenerator I) z) W X (if F orientedLogProfile neg ((if side then w₁ else w₂) (if neg then 5 else 6)) have hcs : ∀side neg,ContDiff ℝ ∞ (child side neg) := by intro side neg cases side <;> cases neg · exact hws₂ 6 · exact Complex.conjCLE.contDiff.comp (hws₂ 5) · exact hws₁ 6 · exact Complex.conjCLE.contDiff.comp (hws₁ 5) have hcb : ∀side neg s,child side neg s≠0→|s|≤2*A+11 := by intro side neg s hn have hnorm (w : Fin 7→ℝ→ℂ) (hw : ∀i t,w i t≠0→|t|≤(2*A+4)+7) (i : Fin 7) (hi : w i s≠0) : |s|≤2*A+11 := by have hh:=hw i s hi linarith cases side <;> cases neg · exact hnorm w₂ hwb₂ 6 hn · apply hnorm w₂ hwb₂ 5 intro hz exact hn (by simp [child,orientedLogProfile,hz]) · exact hnorm w₁ hwb₁ 6 hn · apply hnorm w₁ hwb₁ 5 intro hz exact hn (by simp [child,orientedLogProfile,hz]) refine ⟨child,hcs,hcb,?_⟩ intro V hVs hV let W : ℝ→ℂ:=radialFromLog V hVs A hV have hW : ContDiff ℝ ∞ W:=(radialFromLog V hVs A hV).smooth ⊤ have hs : Function.support W⊆Set.Icc (Real.exp (-A)) (Real.exp A):= fun s hs=>radialFromLog_support V hVs A hV s hs obtain ⟨Cs,hCs,hsmall⟩:=hshort W hs hW obtain ⟨Cl,hCl,hlong⟩:=hlarge W hs hW (radialFromLog_hasCompactSupport V hVs A hV) refine ⟨Cs+Cl,add_nonneg hCs hCl,?_⟩ intro D Z Ψ m labels X F K E t hstate hZ hZbig hfixed hX hD hE ih obtain ⟨hXZ,hFZ⟩:=canonical_live_scale_bounds Z X F (fixedDepthRank Z K) hZbig hX hstate.label_ge_one hstate.mass_le have hsbound:=hsmall t Z η Ψ m labels X F K hstate hZ.le hZbig hη.le hbudget hfixed have hb:=hlong S D hbad hSp base Z Ψ m labels X F K E t hstate hbase hZ hZbig hX hXZ hFZ hE hD dsimp only at hb have hlbound:=hb (by intro side Ψ' m' labels' X' F' K' hs' hr s exact ⟨ih side true Ψ' m' labels' X' F' K' hs' hr s, ih side false Ψ' m' labels' X' F' K' hs' hr s⟩) have he : η+17*η+39*η=57*η:=by ring rw [he] at hlbound have hp : Z^(η+7*η-(1:ℝ)/40)≤Z^(57*η):= Real.rpow_le_rpow_of_exponent_le hZ.le (by linarith) have ht : (1+|t|)^d≤(1+|t|)^(2*J):= pow_le_pow_right₀ (by linarith [abs_nonneg t]) hJ have hs' : 2*X*rowFamilyEnergy labels (fun I z=>shortCompletedSum (rowTwist (normHeightTwist Ψ t) (m*excludedGenerator S) (idealGenerator I) z) W X (if F intro A hA refine ⟨0,?_⟩ intro V hVs hV obtain ⟨C,hC,hterm⟩:=outsideLogEnergy_terminal_constant V hVs A hV refine ⟨max 1 C,le_max_left _ _,?_⟩ intro D Z Ψ m labels X F K t hstate hZ hZbig hfixed hr hD have hb:=hterm S D hbad base Z η Ψ m labels X F K t hstate hbase hZ hη.le hbudget' (Or.inl (Nat.eq_zero_of_le_zero hr)) simpa only [Nat.cast_zero,mul_zero,Real.rpow_zero,mul_one,pow_zero] using hb.trans (mul_le_mul_of_nonneg_right (le_max_right 1 C) (sq_nonneg (X*F))) | succ r ih => intro A hA obtain ⟨dc,hchild⟩:=ih (2*A+11) (by linarith) obtain ⟨ds,hstep⟩:=canonicalLog_actual_step S hSp hbad base hbase ρ q levelBound hρ hq hlevel hmodels A hA η hη hηsmall hbudget let J : ℕ:=dc+ds have hdchild : dc≤2*J:=by dsimp [J];omega have hdstep : ds≤2*J:=by dsimp [J];omega obtain ⟨child,hcs,hcb,hparent⟩:=hstep J hdstep choose childC hchildC using (fun side neg=>hchild (child side neg) (hcs side neg) (hcb side neg)) have hcnonneg (side neg : Bool) : 0≤childC side neg:=zero_le_one.trans (hchildC side neg).1 let E0 : ℝ:=1+∑side : Bool,∑neg : Bool,childC side neg have hE0 : 1≤E0:=by have hs : 0≤∑side : Bool,∑neg : Bool,childC side neg:= Finset.sum_nonneg (fun side _=>Finset.sum_nonneg (fun neg _=>hcnonneg side neg)) exact le_add_of_nonneg_right hs have hcE (side neg : Bool) : childC side neg≤E0:=by have h1 : childC side neg≤∑j : Bool,childC side j:= Finset.single_le_sum (fun j _=>hcnonneg side j) (Finset.mem_univ neg) have h2 : (∑j : Bool,childC side j)≤∑i : Bool,∑j : Bool,childC i j:= Finset.single_le_sum (fun i _=>Finset.sum_nonneg (fun j _=>hcnonneg i j)) (Finset.mem_univ side) exact h1.trans (h2.trans (le_add_of_nonneg_left zero_le_one)) refine ⟨2*J,?_⟩ intro V hVs hV obtain ⟨Ct,hCt,hterm⟩:=outsideLogEnergy_terminal_constant V hVs A hV obtain ⟨Cp,hCp,hp⟩:=hparent V hVs hV let C : ℝ:=1+Ct+Cp*E0 have hC : 1≤C:=by dsimp [C];nlinarith [mul_nonneg hCp (zero_le_one.trans hE0)] have htC : Ct≤C:=by dsimp [C];nlinarith [mul_nonneg hCp (zero_le_one.trans hE0)] have hpC : Cp*E0≤C:=by dsimp [C];linarith refine ⟨C,hC,?_⟩ intro D Z Ψ m labels X F K t hstate hZ hZbig hfixed hr hD have hZ0 : 0hstop (Or.inr hh))).le have hXZ : X≤Z^3:=(canonical_live_scale_bounds Z X F (fixedDepthRank Z K) hZbig hX hstate.label_ge_one hstate.mass_le).1 have hDparent : Real.exp A*X≤D:= common_pool_parent A Z X D (r+1) hA hZ0.le hstate.column_pos.le hXZ hD let E : ℝ:=E0*Z^(57*η*(r:ℝ)) have hEr : 1≤Z^(57*η*(r:ℝ)):=Real.one_le_rpow hZ.le (by positivity) have hE : 1≤E:=by change 1≤E0*Z^(57*η*(r:ℝ)) simpa only [one_mul] using mul_le_mul hE0 hEr zero_le_one (zero_le_one.trans hE0) have hb:=hp D Z Ψ m labels X F K E t hstate hZ hZbig hfixed hX hDparent hE have hbound : outsideLogEnergy S D hbad (normHeightTwist Ψ t) m labels V X K≤ Cp*E*(X*F)^2*Z^(57*η)*(1+|t|)^(2*J):=hb (by intro side neg Ψ' m' labels' X' F' K' hs hr' s have hrchild : fixedDepthRank Z K'≤r:=by omega have hDchild : Real.exp (radiusIter (2*A+11) r)*Z^3≤D:=by simpa only [radiusIter_succ] using hD have hh:=(hchildC side neg).2 D Z Ψ' m' labels' X' F' K' s hs hZ hZbig hfixed hrchild hDchild apply hh.trans rw [Real.norm_eq_abs] change childC side neg*Z^(57*η*(r:ℝ))*(X'*F')^2*(1+|s|)^dc≤_ have hcscale : childC side neg*Z^(57*η*(r:ℝ))*(X'*F')^2≤ (E0*Z^(57*η*(r:ℝ)))*(X'*F')^2:= mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (hcE side neg) (Real.rpow_nonneg hZ0.le _)) (sq_nonneg _) have hheight' : (1+|s|)^dc≤(1+|s|)^(2*J):= pow_le_pow_right₀ (by linarith [abs_nonneg s]) hdchild exact mul_le_mul hcscale hheight' (by positivity) (by positivity)) apply hbound.trans have hexp : Z^(57*η*(r:ℝ))*Z^(57*η)=Z^(57*η*((r+1:ℕ):ℝ)):=by rw [←Real.rpow_add hZ0] congr 1 push_cast ring calc Cp*E*(X*F)^2*Z^(57*η)*(1+|t|)^(2*J)= (Cp*E0)*(Z^(57*η*(r:ℝ))*Z^(57*η))*(X*F)^2*(1+|t|)^(2*J):=by dsimp [E];ring _ = (Cp*E0)*Z^(57*η*((r+1:ℕ):ℝ))*(X*F)^2*(1+|t|)^(2*J):=by rw [hexp] _ ≤ _:=by gcongr def canonicalDescentPadding (ε : ℝ) : ℝ:=canonicalPadding ε 57/2 theorem canonicalDescentPadding_budget (ε : ℝ) (hε : 0<ε) : 0Ideal.span {outsidePrime S D i}) R) (T.image Prod.fst) X lengthScale K := by let p:=outsidePrime S D have hp:=outsidePrime_ne_zero S hbad D let:=outsidePrime_maximal S hbad D have hN : 1≤primeProductNorm p R:=primeProductNorm_ge_one p hp R have hN0 : 0≤primeProductNorm p R:=zero_le_one.trans hN have hmod : 1 ≤ initialExcludedNorm S*primeProductNorm p R:= one_le_mul_of_one_le_of_one_le (initialExcludedNorm_ge_one S) hN have hdecay : Z^(-(1:ℝ)/20)≤1:=by simpa only [Real.rpow_zero] using Real.rpow_le_rpow_of_exponent_le hZ (by norm_num : -(1:ℝ)/20≤0) have hKmass : K≤X*lengthScale := by calc K ≤ K*(initialExcludedNorm S*primeProductNorm p R):= le_mul_of_one_le_right (zero_le_one.trans hK) hmod _ ≤ X*lengthScale*Z^(-(1:ℝ)/20):=hinv _ ≤ X*lengthScale:=mul_le_of_le_one_right (by positivity) hdecay have hKg : K≤Z^3 := (hKmass.trans hmass).trans (pow_le_pow_right₀ hZ (by decide : (2:ℕ)≤3)) refine ⟨hΨ,primeSubsetGenerator_ne_zero _ _,by linarith,hL,hK,hKg, hmass.trans (canonicalRankMass_initial Z _),?_,?_⟩ · rw [primeSubsetGenerator_norm_eq_productNorm] calc K*primeProductNorm p R ≤ K*(initialExcludedNorm S*primeProductNorm p R) := by apply mul_le_mul_of_nonneg_left _ (zero_le_one.trans hK) exact le_mul_of_one_le_left hN0 (initialExcludedNorm_ge_one S) _ ≤ X*lengthScale*Z^(-(1:ℝ)/20):=hinv _ ≤ X*lengthScale*Z^(-canonicalRankMargin ((1:ℝ)/20) η (fixedDepthRank Z K)) := by apply mul_le_mul_of_nonneg_left _ (by positivity) apply Real.rpow_le_rpow_of_exponent_le hZ unfold canonicalRankMargin have hn : 0≤η*((3000-fixedDepthRank Z K:ℕ):ℝ):=mul_nonneg hη (Nat.cast_nonneg _) linarith · intro I hI obtain ⟨z,hz,rfl⟩:=Finset.mem_image.mp hI exact ⟨(hlabels z hz).1.1,(hlabels z hz).1.2.1,houtside z hz,(hlabels z hz).2⟩ theorem canonicalInitialThreshold (S : Finset (Ideal ActualEisensteinCubic.O)) : ∃Z₀ : ℝ,1≤Z₀ ∧ ∀Z : ℝ,Z₀≤Z → 1Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (pool : Finset ι) (Ψ₁ Ψ₂ : ActualEisensteinCubic.O→*ℂ) (m : ActualEisensteinCubic.O) (T : Finset (Ideal ActualEisensteinCubic.O×ActualEisensteinCubic.O)) (labels : Finset (Ideal ActualEisensteinCubic.O)) (V₁ V₂ : ℝ→ℂ) (X F K E : ℝ) (J : ℕ) (hX : 0if i then a else b have hp : ∀i,p i≠0:=by intro i cases i · exact hb · exact ha let (i : Bool) : (Ideal.span {p i}).IsMaximal := by cases i <;> dsimp [p] <;> infer_instance have hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i})) := by intro i j hij cases i <;> cases j <;> simp_all [p,Function.onFun,isCoprime_comm] have hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2 := by intro i cases i · exact hcb · exact hca have h:=quadraticGamma_product p hp hcop hc simp only [quadraticGammaO_eq_rayValue] at h have ht : cofactor p true=b:=by apply mul_left_cancel₀ ha simpa [p] using prime_mul_cofactor p true have hf : cofactor p false=a:=by apply mul_left_cancel₀ hb simpa [p,mul_comm] using prime_mul_cofactor p false simp only [Fintype.prod_bool,ht,hf] at h simpa [p,mul_comm,mul_left_comm,mul_assoc] using h theorem quadraticRayValue_ne_zero_of_odd (r : EisensteinEPrimaryPhase.Coord) (hr : EisensteinEPrimaryPhase.odd r) : quadraticRayValue r≠0 := by rcases r with ⟨a,b⟩ fin_cases a <;> fin_cases b <;> norm_num [EisensteinEPrimaryPhase.odd,quadraticRayValue,breveGaussianFourTerms_formula, zpow_neg,Complex.I_sq,Complex.I_pow_three,Complex.inv_I,ZMod.val] at * <;> intro h <;> solve | (have hh:=congrArg Complex.re h; norm_num at hh) | (have hh:=congrArg Complex.im h; norm_num at hh) end QuadraticAllOddCRT end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.MeromorphicResolvent namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped Topology lemma kernelSpectralFormOperator_analyticAt : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ), AnalyticAt ℂ kernelSpectralFormOperator z := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) => by let S : KernelEnergyGraph→L[ℂ]KernelEnergyGraph := kernelEnergyMass.adjoint.comp kernelEnergyMass have hc : AnalyticAt ℂ (fun w : ℂ => w • S) (z+1) := by simpa only [ContinuousLinearMap.smulRight_apply,ContinuousLinearMap.id_apply] using! (ContinuousLinearMap.analyticAt (𝕜 := ℂ) (E := ℂ) (F := KernelEnergyGraph→L[ℂ]KernelEnergyGraph) (ContinuousLinearMap.smulRight (ContinuousLinearMap.id ℂ ℂ) S) (z+1)) have hz : AnalyticAt ℂ (fun w : ℂ => w+1) z := analyticAt_id.add analyticAt_const exact analyticAt_const.sub (hc.comp_of_eq hz rfl) section open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace def kernelMassGram : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelEnergyGraph→L[ℂ]KernelEnergyGraph := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelEnergyMass.adjoint.comp kernelEnergyMass private lemma selfAdjoint_adjoint_comp {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] (A : E →L[ℂ] F) : IsSelfAdjoint (A.adjoint.comp A) := by rw [ContinuousLinearMap.isSelfAdjoint_iff'] rw [ContinuousLinearMap.adjoint_comp,ContinuousLinearMap.adjoint_adjoint] lemma kernelMassGram_selfAdjoint : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace IsSelfAdjoint kernelMassGram := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace selfAdjoint_adjoint_comp kernelEnergyMass def kernelThetaNull : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Submodule ℂ KernelEnergyGraph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelSpectralFormOperator (8/9:ℂ)).ker def kernelThetaRegular : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Submodule ℂ KernelEnergyGraph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelThetaNullᗮ theorem kernelThetaNull_complete : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace CompleteSpace kernelThetaNull := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelSpectralFormOperator (8/9:ℂ)).isClosed_ker.completeSpace_coe theorem kernelThetaRegular_complete : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace CompleteSpace kernelThetaRegular := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelThetaNull.isClosed_orthogonal.completeSpace_coe lemma kernelThetaNull_gram_eq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (u : KernelEnergyGraph) (hu : u∈kernelThetaNull), kernelMassGram u=(9/17:ℂ)•u := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (u : KernelEnergyGraph) (hu : u∈kernelThetaNull) => by have hh : u-(8/9+1:ℂ)•kernelMassGram u=0 := hu have he : u=(17/9:ℂ)•kernelMassGram u := by simpa only [show (8/9+1:ℂ)=17/9 by norm_num] using sub_eq_zero.mp hh calc _ = (9/17:ℂ)•((17/9:ℂ)•kernelMassGram u) := by rw [smul_smul]; norm_num _ = _ := by rw [←he] lemma kernelThetaNull_spectral_eq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (u : KernelEnergyGraph) (hu : u∈kernelThetaNull), kernelSpectralFormOperator z u=((8/9-z)*(9/17):ℂ)•u := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (u : KernelEnergyGraph) (hu : u∈kernelThetaNull) => by change u-(z+1)•kernelMassGram u=_ rw [kernelThetaNull_gram_eq u hu,smul_smul] calc u-((z+1)*(9/17):ℂ)•u=(1-(z+1)*(9/17):ℂ)•u := by rw [sub_smul,one_smul] _ = _ := by congr 1; ring lemma kernelMassGram_preserves_regular : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (u : KernelEnergyGraph) (hu : u∈kernelThetaRegular), kernelMassGram u∈kernelThetaRegular := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (u : KernelEnergyGraph) (hu : u∈kernelThetaRegular) => by apply (kernelThetaNull.mem_orthogonal _).mpr intro v hv have he : inner ℂ v (kernelMassGram u)=inner ℂ (kernelMassGram v) u := by simpa only [ContinuousLinearMap.coe_coe] using (kernelMassGram_selfAdjoint.isSymmetric v u).symm rw [he,kernelThetaNull_gram_eq v hv,inner_smul_left (𝕜 := ℂ) v u (9/17:ℂ)] rw [kernelThetaNull.inner_right_of_mem_orthogonal hv hu,mul_zero] def kernelRegularGram : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelThetaRegular→L[ℂ]kernelThetaRegular := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelMassGram.restrict kernelMassGram_preserves_regular def kernelRegularPencil : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ), kernelThetaRegular→L[ℂ]kernelThetaRegular := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) => ContinuousLinearMap.id ℂ kernelThetaRegular-(z+1)•kernelRegularGram lemma kernelRegularPencil_apply : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (u : kernelThetaRegular), (kernelRegularPencil z u:KernelEnergyGraph)=kernelSpectralFormOperator z u := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (u : kernelThetaRegular) => rfl lemma kernelRegularPencil_center_isUnit : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace IsUnit (kernelRegularPencil (8/9:ℂ)) := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.kernelThetaNull_complete letI := @OAI.CubicEisenstein.kernelThetaRegular_complete by apply (ContinuousLinearMap.isUnit_iff_bijective (𝕜 := ℂ) (E := kernelThetaRegular)).mpr constructor · intro u v huv apply ker_orthogonal_restriction_injective (kernelSpectralFormOperator (8/9:ℂ)) exact congrArg (fun w : kernelThetaRegular => (w:KernelEnergyGraph)) huv · intro v have he : (kernelSpectralFormOperator (8/9:ℂ)).range=kernelThetaRegular := by exact selfAdjoint_range_eq_ker_orthogonal _ (by convert kernelSpectralFormOperator_selfAdjoint (8/9) using 1 ; norm_num) kernel_theta_spectral_fredholm.isClosed_range have hv : (v:KernelEnergyGraph)∈(kernelSpectralFormOperator (8/9:ℂ)).range := by rw [he] exact v.2 obtain ⟨u,hu⟩ := hv change kernelSpectralFormOperator (8/9:ℂ) u=(v:KernelEnergyGraph) at hu let w : kernelThetaRegular := ⟨u-kernelThetaNull.starProjection u,kernelThetaNull.sub_starProjection_mem_orthogonal u⟩ refine ⟨w,Subtype.ext ?_⟩ rw [kernelRegularPencil_apply] change kernelSpectralFormOperator (8/9:ℂ) (u-kernelThetaNull.starProjection u)=v rw [map_sub,hu] have hz : kernelSpectralFormOperator (8/9:ℂ) (kernelThetaNull.starProjection u)=0 := kernelThetaNull.starProjection_apply_mem u rw [hz,sub_zero] private abbrev endomorphismNormedSpace (E : Type*) [NormedAddCommGroup E] [NormedSpace ℂ E] : NormedSpace ℂ (E →L[ℂ] E) := inferInstance abbrev instNormedSpaceComplexContinuousLinearMapIdSubtypeKernelEnergyAmbientMemSubmoduleKernelEnergyGraphKernelThetaRegular : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace NormedSpace ℂ (kernelThetaRegular →L[ℂ] kernelThetaRegular) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace endomorphismNormedSpace kernelThetaRegular lemma kernelRegularPencil_analyticAt : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.instNormedSpaceComplexContinuousLinearMapIdSubtypeKernelEnergyAmbientMemSubmoduleKernelEnergyGraphKernelThetaRegular ∀ (z : ℂ), AnalyticAt ℂ kernelRegularPencil z := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.instNormedSpaceComplexContinuousLinearMapIdSubtypeKernelEnergyAmbientMemSubmoduleKernelEnergyGraphKernelThetaRegular fun (z : ℂ) => by have hc : AnalyticAt ℂ (fun w : ℂ => w • kernelRegularGram) (z+1) := by simpa only [ContinuousLinearMap.smulRight_apply,ContinuousLinearMap.id_apply] using! (ContinuousLinearMap.analyticAt (𝕜 := ℂ) (E := ℂ) (F := kernelThetaRegular→L[ℂ]kernelThetaRegular) (ContinuousLinearMap.smulRight (ContinuousLinearMap.id ℂ ℂ) kernelRegularGram) (z+1)) have hz : AnalyticAt ℂ (fun w : ℂ => w+1) z := analyticAt_id.add analyticAt_const exact analyticAt_const.sub (hc.comp_of_eq hz rfl) lemma kernelRegularPencil_eventually_isUnit : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ᶠ z : ℂ in 𝓝 (8/9:ℂ), IsUnit (kernelRegularPencil z) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.kernelThetaRegular_complete letI := @OAI.CubicEisenstein.instNormedSpaceComplexContinuousLinearMapIdSubtypeKernelEnergyAmbientMemSubmoduleKernelEnergyGraphKernelThetaRegular (kernelRegularPencil_analyticAt (8/9)).continuousAt.eventually ((Units.isOpen (R := kernelThetaRegular→L[ℂ]kernelThetaRegular)).mem_nhds (show kernelRegularPencil (8/9)∈{x : kernelThetaRegular→L[ℂ]kernelThetaRegular | IsUnit x} from kernelRegularPencil_center_isUnit)) lemma kernelRegularInverse_analyticAt : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.kernelThetaRegular_complete letI := @OAI.CubicEisenstein.instNormedSpaceComplexContinuousLinearMapIdSubtypeKernelEnergyAmbientMemSubmoduleKernelEnergyGraphKernelThetaRegular AnalyticAt ℂ (fun z : ℂ => Ring.inverse (kernelRegularPencil z)) (8/9:ℂ) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.kernelThetaRegular_complete letI := @OAI.CubicEisenstein.instNormedSpaceComplexContinuousLinearMapIdSubtypeKernelEnergyAmbientMemSubmoduleKernelEnergyGraphKernelThetaRegular by have hi := (analyticOnNhd_inverse (𝕜 := ℂ) (A := kernelThetaRegular→L[ℂ]kernelThetaRegular)) (kernelRegularPencil (8/9)) kernelRegularPencil_center_isUnit exact hi.comp_of_eq (kernelRegularPencil_analyticAt (8/9)) rfl private def continuousLinearSandwich {H G : Type*} [NormedAddCommGroup H] [NormedSpace ℂ H] [NormedAddCommGroup G] [NormedSpace ℂ G] (A : H →L[ℂ] G) (B : G →L[ℂ] H) : (H →L[ℂ] H) →L[ℂ] (G →L[ℂ] G) := (ContinuousLinearMap.compL ℂ G H G A).comp ((ContinuousLinearMap.compL ℂ G H H).flip B) def kernelRegularLiftCLM : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelThetaRegular→L[ℂ]kernelThetaRegular)→L[ℂ](KernelEnergyGraph→L[ℂ]KernelEnergyGraph) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.kernelThetaRegular_complete continuousLinearSandwich (H := kernelThetaRegular) (G := KernelEnergyGraph) kernelThetaRegular.subtypeL kernelThetaRegular.orthogonalProjectionOnto def kernelRegularInverseLift : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ), KernelEnergyGraph→L[ℂ]KernelEnergyGraph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) => kernelRegularLiftCLM (Ring.inverse (kernelRegularPencil z)) lemma kernelRegularInverseLift_apply : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.kernelThetaRegular_complete ∀ (z : ℂ) (u : KernelEnergyGraph), kernelRegularInverseLift z u = (Ring.inverse (kernelRegularPencil z) (kernelThetaRegular.orthogonalProjectionOnto u) : KernelEnergyGraph) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.kernelThetaRegular_complete fun (z : ℂ) (u : KernelEnergyGraph) => rfl lemma kernelRegularInverseLift_analyticAt : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace AnalyticAt ℂ kernelRegularInverseLift (8/9:ℂ) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.instNormedSpaceComplexContinuousLinearMapIdSubtypeKernelEnergyAmbientMemSubmoduleKernelEnergyGraphKernelThetaRegular by exact (ContinuousLinearMap.analyticAt (𝕜 := ℂ) (E := kernelThetaRegular→L[ℂ]kernelThetaRegular) (F := KernelEnergyGraph→L[ℂ]KernelEnergyGraph) kernelRegularLiftCLM (Ring.inverse (kernelRegularPencil (8/9)))).comp_of_eq kernelRegularInverse_analyticAt rfl def kernelLocalEnergyResolvent : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ), KernelEnergyGraph→L[ℂ]KernelEnergyGraph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) => letI := @OAI.CubicEisenstein.kernelThetaNull_complete ((17/9)/(8/9-z):ℂ) • kernelThetaNull.starProjection + kernelRegularInverseLift z lemma kernelSpectralFormOperator_regularInverseLift : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.kernelThetaRegular_complete ∀ (z : ℂ) (hz : IsUnit (kernelRegularPencil z)) (u : KernelEnergyGraph), kernelSpectralFormOperator z (kernelRegularInverseLift z u)= kernelThetaRegular.starProjection u := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.kernelThetaRegular_complete fun (z : ℂ) (hz : IsUnit (kernelRegularPencil z)) (u : KernelEnergyGraph) => by rw [kernelRegularInverseLift_apply,←kernelRegularPencil_apply] have he := congrArg (fun A : kernelThetaRegular→L[ℂ]kernelThetaRegular => A (kernelThetaRegular.orthogonalProjectionOnto u)) (Ring.mul_inverse_cancel (kernelRegularPencil z) hz) exact congrArg (fun v : kernelThetaRegular => (v:KernelEnergyGraph)) he lemma kernelLocalEnergyResolvent_right_inverse : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (hne : z≠8/9) (hz : IsUnit (kernelRegularPencil z)) (u : KernelEnergyGraph), kernelSpectralFormOperator z (kernelLocalEnergyResolvent z u)=u := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (hne : z≠8/9) (hz : IsUnit (kernelRegularPencil z)) (u : KernelEnergyGraph) => letI := @OAI.CubicEisenstein.kernelThetaNull_complete letI := @OAI.CubicEisenstein.kernelThetaRegular_complete by change kernelSpectralFormOperator z (((17/9)/(8/9-z):ℂ) • kernelThetaNull.starProjection u + kernelRegularInverseLift z u)=u rw [map_add,map_smul,kernelThetaNull_spectral_eq z _ (kernelThetaNull.starProjection_apply_mem u),smul_smul] have hc : ((17/9)/(8/9-z):ℂ)*((8/9-z)*(9/17))=1 := by calc _ = (((17/9)/(8/9-z):ℂ)*(8/9-z))*(9/17) := by ring _ = (17/9:ℂ)*(9/17) := by rw [div_mul_cancel₀ _ (sub_ne_zero.mpr hne.symm)] _ = 1 := by norm_num rw [hc,one_smul,kernelSpectralFormOperator_regularInverseLift z hz] exact kernelThetaNull.starProjection_add_starProjection_orthogonal u lemma selfAdjoint_one_sub_smul_normal {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] (S : H→L[ℂ]H) (hS : IsSelfAdjoint S) (z : ℂ) : IsStarNormal (1-z•S) := by let : IsStarNormal S := hS.isStarNormal infer_instance lemma kernelSpectralFormOperator_normal : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ), IsStarNormal (kernelSpectralFormOperator z) := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) => by exact selfAdjoint_one_sub_smul_normal kernelMassGram kernelMassGram_selfAdjoint (z+1) lemma kernelSpectralFormOperator_isUnit_near : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (hne : z≠8/9) (hz : IsUnit (kernelRegularPencil z)), IsUnit (kernelSpectralFormOperator z) := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (hne : z≠8/9) (hz : IsUnit (kernelRegularPencil z)) => by have hsur : Function.Surjective (kernelSpectralFormOperator z) := fun u => ⟨kernelLocalEnergyResolvent z u,kernelLocalEnergyResolvent_right_inverse z hne hz u⟩ apply (ContinuousLinearMap.isUnit_iff_bijective (𝕜 := ℂ) (E := KernelEnergyGraph)).mpr refine ⟨?_,hsur⟩ change Function.Injective (kernelSpectralFormOperator z).toLinearMap apply LinearMap.ker_eq_bot.mp rw [←ContinuousLinearMap.IsStarNormal.orthogonal_range (kernelSpectralFormOperator_normal z)] have hr : (kernelSpectralFormOperator z).range=⊤ := LinearMap.range_eq_top.mpr hsur rw [hr,Submodule.top_orthogonal_eq_bot] lemma kernelLocalEnergyResolvent_eq_inverse : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (hne : z≠8/9) (hz : IsUnit (kernelRegularPencil z)), kernelLocalEnergyResolvent z = Ring.inverse (kernelSpectralFormOperator z) := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (hne : z≠8/9) (hz : IsUnit (kernelRegularPencil z)) => by apply ContinuousLinearMap.ext intro u apply ((ContinuousLinearMap.isUnit_iff_bijective (𝕜 := ℂ) (E := KernelEnergyGraph)).mp (kernelSpectralFormOperator_isUnit_near z hne hz)).1 rw [kernelLocalEnergyResolvent_right_inverse z hne hz] have hi := congrArg (fun A : KernelEnergyGraph→L[ℂ]KernelEnergyGraph => A u) (Ring.mul_inverse_cancel (kernelSpectralFormOperator z) (kernelSpectralFormOperator_isUnit_near z hne hz)) exact hi.symm end open scoped Topology lemma selfAdjoint_pencil_isUnit_nonreal {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] (S : H→L[ℂ]H) (hS : IsSelfAdjoint S) (z : ℂ) (hz : z.im≠0) : IsUnit (1-z•S) := by have hne : z≠0 := fun h => hz (by rw [h]; rfl) have hi : z⁻¹.im≠0 := by rw [Complex.inv_im] exact div_ne_zero (neg_ne_zero.mpr hz) (mt Complex.normSq_eq_zero.mp hne) have hout : z⁻¹∉spectrum ℂ S := fun h => hi (hS.im_eq_zero_of_mem_spectrum h) have hu := (spectrum.notMem_iff (R := ℂ) (A := H→L[ℂ]H)).mp hout have hv := hu.smul (Units.mk0 z hne) simpa only [Units.smul_def,Units.val_mk0,Algebra.algebraMap_eq_smul_one, smul_sub,smul_smul,mul_inv_cancel₀ hne,one_smul] using hv lemma kernelSpectralFormOperator_isUnit_nonreal : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (hz : z.im≠0), IsUnit (kernelSpectralFormOperator z) := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (hz : z.im≠0) => by exact selfAdjoint_pencil_isUnit_nonreal kernelMassGram kernelMassGram_selfAdjoint (z+1) (by simpa using hz) lemma kernelSpectralFormInverse_analyticAt_of_isUnit : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (hz : IsUnit (kernelSpectralFormOperator z)), AnalyticAt ℂ (fun w => Ring.inverse (kernelSpectralFormOperator w)) z := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (hz : IsUnit (kernelSpectralFormOperator z)) => by have hi := (analyticOnNhd_inverse (𝕜 := ℂ) (A := KernelEnergyGraph→L[ℂ]KernelEnergyGraph)) (kernelSpectralFormOperator z) hz exact hi.comp_of_eq (kernelSpectralFormOperator_analyticAt z) rfl lemma kernelSpectralFormInverse_analyticAt_nonreal : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (hz : z.im≠0), AnalyticAt ℂ (fun w => Ring.inverse (kernelSpectralFormOperator w)) z := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (hz : z.im≠0) => kernelSpectralFormInverse_analyticAt_of_isUnit z (kernelSpectralFormOperator_isUnit_nonreal z hz) open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace def kernelL2SandwichCLM : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (KernelEnergyGraph→L[ℂ]KernelEnergyGraph)→L[ℂ] (KernelQuotientL2→L[ℂ]KernelQuotientL2) := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace continuousLinearSandwich kernelEnergyMass kernelEnergyMass.adjoint def kernelSpectralResolvent : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ), KernelQuotientL2→L[ℂ]KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) => kernelL2SandwichCLM (Ring.inverse (kernelSpectralFormOperator z)) lemma kernelSpectralResolvent_apply : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (F : KernelQuotientL2), kernelSpectralResolvent z F= kernelEnergyMass (Ring.inverse (kernelSpectralFormOperator z) (kernelVariationalSolution F)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (F : KernelQuotientL2) => rfl lemma kernelSpectralResolvent_analyticAt_nonreal : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (hz : z.im≠0), AnalyticAt ℂ kernelSpectralResolvent z := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (hz : z.im≠0) => by exact (ContinuousLinearMap.analyticAt (𝕜 := ℂ) (E := KernelEnergyGraph→L[ℂ]KernelEnergyGraph) (F := KernelQuotientL2→L[ℂ]KernelQuotientL2) kernelL2SandwichCLM (Ring.inverse (kernelSpectralFormOperator z))).comp_of_eq (kernelSpectralFormInverse_analyticAt_nonreal z hz) rfl lemma kernelSpectralResolvent_left_inverse : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (hz : IsUnit (kernelSpectralFormOperator z)) (u : kernelEnergyLaplacian.domain), kernelSpectralResolvent z (kernelEnergyLaplacian u-z•(u:KernelQuotientL2))=u := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (hz : IsUnit (kernelSpectralFormOperator z)) (u : kernelEnergyLaplacian.domain) => by rw [kernelSpectralResolvent_apply,←kernelSpectralFormOperator_of_domain z u] have hi := congrArg (fun A : KernelEnergyGraph→L[ℂ]KernelEnergyGraph => A (kernelVariationalSolution (kernelEnergyLaplacian u+u))) (Ring.inverse_mul_cancel (kernelSpectralFormOperator z) hz) change Ring.inverse (kernelSpectralFormOperator z) (kernelSpectralFormOperator z (kernelVariationalSolution (kernelEnergyLaplacian u+u)))= kernelVariationalSolution (kernelEnergyLaplacian u+u) at hi rw [hi] exact kernelEnergyLaplacian_resolvent_relation u lemma kernelSpectralResolvent_unique : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (hz : IsUnit (kernelSpectralFormOperator z)) (u F : KernelQuotientL2) (hu : (u,F+z•u)∈kernelEnergyLaplacian.graph), kernelSpectralResolvent z F=u := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (hz : IsUnit (kernelSpectralFormOperator z)) (u F : KernelQuotientL2) (hu : (u,F+z•u)∈kernelEnergyLaplacian.graph) => by let v : kernelEnergyLaplacian.domain := ⟨u,LinearPMap.mem_domain_of_mem_graph hu⟩ have hv : kernelEnergyLaplacian v=F+z•u := kernelEnergyLaplacian.mem_graph_snd_inj (kernelEnergyLaplacian.mem_graph v) hu rfl have hh := kernelSpectralResolvent_left_inverse z hz v rw [hv] at hh simpa only [v,add_sub_cancel_right] using hh def kernelEisensteinSpectralParameter (s : ℂ) : ℂ := s*(2-s) def kernelEisensteinResolvent : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (s : ℂ), KernelQuotientL2→L[ℂ]KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (s : ℂ) => kernelSpectralResolvent (kernelEisensteinSpectralParameter s) lemma kernelEisensteinSpectralParameter_center : kernelEisensteinSpectralParameter (4/3)=8/9 := by norm_num [kernelEisensteinSpectralParameter] lemma kernelEisensteinSpectralParameter_nonreal (s : ℂ) (hs : s.re≠1) (hi : s.im≠0) : (kernelEisensteinSpectralParameter s).im≠0 := by have he : (kernelEisensteinSpectralParameter s).im=2*(1-s.re)*s.im := by simp only [kernelEisensteinSpectralParameter,Complex.mul_im,Complex.sub_re,Complex.sub_im] norm_num ring rw [he] exact mul_ne_zero (mul_ne_zero (by norm_num) (sub_ne_zero.mpr hs.symm)) hi lemma kernelEisensteinResolvent_analyticAt_nonreal : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (s : ℂ) (hs : s.re≠1) (hi : s.im≠0), AnalyticAt ℂ kernelEisensteinResolvent s := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (s : ℂ) (hs : s.re≠1) (hi : s.im≠0) => by exact (kernelSpectralResolvent_analyticAt_nonreal _ (kernelEisensteinSpectralParameter_nonreal s hs hi)).comp_of_eq (by unfold kernelEisensteinSpectralParameter; fun_prop) rfl lemma kernelEisensteinPencil_eventually_isUnit : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ᶠ s : ℂ in 𝓝[≠] (4/3:ℂ), IsUnit (kernelSpectralFormOperator (kernelEisensteinSpectralParameter s)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hc : ContinuousAt kernelEisensteinSpectralParameter (4/3:ℂ) := by unfold kernelEisensteinSpectralParameter fun_prop have hp : ∀ᶠ s : ℂ in 𝓝 (4/3:ℂ), IsUnit (kernelRegularPencil (kernelEisensteinSpectralParameter s)) := by have hh : ∀ᶠ z : ℂ in 𝓝 (kernelEisensteinSpectralParameter (4/3)), IsUnit (kernelRegularPencil z) := by rw [kernelEisensteinSpectralParameter_center] exact kernelRegularPencil_eventually_isUnit exact hc.eventually hh filter_upwards [hp.filter_mono nhdsWithin_le_nhds, eventually_ne_nhdsWithin (show (4/3:ℂ)≠2/3 by norm_num),self_mem_nhdsWithin] with s hs htwo hfour apply kernelSpectralFormOperator_isUnit_near _ _ hs intro he have hzero : (s-4/3)*(s-2/3)=0 := by have hid : (s-4/3)*(s-2/3)=(8/9:ℂ)-kernelEisensteinSpectralParameter s := by unfold kernelEisensteinSpectralParameter ring rw [hid,he,sub_self] rcases mul_eq_zero.mp hzero with h | h · exact hfour (sub_eq_zero.mp h) · exact htwo (sub_eq_zero.mp h) def kernelEisensteinL2Correction : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 kernelEisensteinResolvent s (kernelL2Defect a b ha hab s) lemma kernelEisensteinL2Correction_analyticAt_nonreal : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 by exact ((ContinuousLinearMap.apply ℂ KernelQuotientL2).analyticAt_bilinear (kernelL2Defect a b ha hab s,kernelEisensteinResolvent s)).comp₂ ((kernelL2Defect_entire a b ha hab).analyticAt s) (kernelEisensteinResolvent_analyticAt_nonreal s hs hi) lemma kernelEisensteinL2Correction_unique : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 kernelSpectralResolvent_unique _ hs _ _ hu open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace def kernelThetaMassProjection : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2→L[ℂ]KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := @OAI.CubicEisenstein.kernelThetaNull_complete kernelL2SandwichCLM kernelThetaNull.starProjection def kernelRegularL2Resolvent : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ), KernelQuotientL2→L[ℂ]KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) => kernelL2SandwichCLM (kernelRegularInverseLift z) lemma kernelRegularL2Resolvent_analyticAt : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace AnalyticAt ℂ kernelRegularL2Resolvent (8/9:ℂ) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by exact (ContinuousLinearMap.analyticAt (𝕜 := ℂ) (E := KernelEnergyGraph→L[ℂ]KernelEnergyGraph) (F := KernelQuotientL2→L[ℂ]KernelQuotientL2) kernelL2SandwichCLM (kernelRegularInverseLift (8/9))).comp_of_eq kernelRegularInverseLift_analyticAt rfl lemma kernelSpectralResolvent_decomposition : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (z : ℂ) (hne : z≠8/9) (hz : IsUnit (kernelRegularPencil z)) (F : KernelQuotientL2), kernelSpectralResolvent z F=((17/9)/(8/9-z):ℂ)•kernelThetaMassProjection F+ kernelRegularL2Resolvent z F := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (z : ℂ) (hne : z≠8/9) (hz : IsUnit (kernelRegularPencil z)) (F : KernelQuotientL2) => by unfold kernelSpectralResolvent rw [←kernelLocalEnergyResolvent_eq_inverse z hne hz] simp only [kernelLocalEnergyResolvent,map_add,map_smul,_root_.add_apply, _root_.smul_apply,kernelThetaMassProjection,kernelRegularL2Resolvent] def kernelEisensteinCorrectionNumerator : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 ((17/9)/(s-2/3):ℂ)•kernelThetaMassProjection (kernelL2Defect a b ha hab s)+ (s-4/3)•kernelRegularL2Resolvent (kernelEisensteinSpectralParameter s) (kernelL2Defect a b ha hab s) def kernelEisensteinResidueVector : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 (17/6:ℂ)•kernelThetaMassProjection (kernelL2Defect a b ha hab (4/3)) lemma kernelEisensteinCorrectionNumerator_center : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 by simp only [kernelEisensteinCorrectionNumerator,kernelEisensteinResidueVector,sub_self,zero_smul,add_zero] congr 1 norm_num lemma kernelEisensteinCorrectionNumerator_analyticAt : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 by have hf := (kernelL2Defect_entire a b ha hab).analyticAt (4/3:ℂ) have hp := (ContinuousLinearMap.analyticAt (𝕜 := ℂ) (E := KernelQuotientL2) (F := KernelQuotientL2) kernelThetaMassProjection (kernelL2Defect a b ha hab (4/3))).comp_of_eq hf rfl have hr : AnalyticAt ℂ (fun s => kernelRegularL2Resolvent (kernelEisensteinSpectralParameter s)) (4/3:ℂ) := by have hreg : AnalyticAt ℂ kernelRegularL2Resolvent (kernelEisensteinSpectralParameter (4/3)) := by rw [kernelEisensteinSpectralParameter_center] exact kernelRegularL2Resolvent_analyticAt exact hreg.comp_of_eq (by unfold kernelEisensteinSpectralParameter; fun_prop) rfl have happ := ((ContinuousLinearMap.apply ℂ KernelQuotientL2).analyticAt_bilinear (kernelL2Defect a b ha hab (4/3),kernelRegularL2Resolvent (kernelEisensteinSpectralParameter (4/3)))).comp₂ hf hr have hscalar : AnalyticAt ℂ (fun s : ℂ => (17/9)/(s-2/3)) (4/3:ℂ) := by apply AnalyticAt.div analyticAt_const (analyticAt_id.sub analyticAt_const) norm_num exact (hscalar.smul hp).add ((analyticAt_id.sub analyticAt_const).smul happ) lemma kernelEisensteinCorrectionNumerator_eventually : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 by have hc : ContinuousAt kernelEisensteinSpectralParameter (4/3:ℂ) := by unfold kernelEisensteinSpectralParameter fun_prop have hp : ∀ᶠ s : ℂ in 𝓝 (4/3:ℂ), IsUnit (kernelRegularPencil (kernelEisensteinSpectralParameter s)) := by have hh : ∀ᶠ z : ℂ in 𝓝 (kernelEisensteinSpectralParameter (4/3)), IsUnit (kernelRegularPencil z) := by rw [kernelEisensteinSpectralParameter_center] exact kernelRegularPencil_eventually_isUnit exact hc.eventually hh filter_upwards [hp.filter_mono nhdsWithin_le_nhds, eventually_ne_nhdsWithin (show (4/3:ℂ)≠2/3 by norm_num),self_mem_nhdsWithin] with s hs htwo hfour have hfactor : (8/9:ℂ)-kernelEisensteinSpectralParameter s=(s-4/3)*(s-2/3) := by unfold kernelEisensteinSpectralParameter ring have hne : kernelEisensteinSpectralParameter s≠8/9 := by intro he have hh := mul_ne_zero (sub_ne_zero.mpr hfour) (sub_ne_zero.mpr htwo) rw [←hfactor,he,sub_self] at hh exact hh rfl change (s-4/3)•kernelSpectralResolvent (kernelEisensteinSpectralParameter s) (kernelL2Defect a b ha hab s)=_ rw [kernelSpectralResolvent_decomposition _ hne hs,smul_add,smul_smul] have hscalar : (s-4/3)*((17/9)/(8/9-kernelEisensteinSpectralParameter s))=(17/9)/(s-2/3) := by rw [hfactor] have hcancel (x y c : ℂ) (hx : x≠0) : x*(c/(x*y))=c/y := by rw [div_eq_mul_inv,mul_inv_rev] calc _ = (x*x⁻¹)*(c*y⁻¹) := by ring _ = c/y := by rw [mul_inv_cancel₀ hx,one_mul,div_eq_mul_inv] exact hcancel _ _ _ (sub_ne_zero.mpr hfour) rw [hscalar] rfl lemma kernelEisensteinResidueVector_limit : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 (s-4/3)•kernelEisensteinL2Correction a b ha hab s) (𝓝[≠] (4/3:ℂ)) (𝓝 (kernelEisensteinResidueVector a b ha hab)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (a b : ℝ) (ha : 0 by apply (tendsto_congr' (kernelEisensteinCorrectionNumerator_eventually a b ha hab)).mpr rw [←kernelEisensteinCorrectionNumerator_center a b ha hab] exact (kernelEisensteinCorrectionNumerator_analyticAt a b ha hab).continuousAt.tendsto.mono_left nhdsWithin_le_nhds lemma kernelEisensteinResidueVector_graph : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 0 letI := @OAI.CubicEisenstein.kernelThetaNull_complete by let v : KernelEnergyGraph := (17/6:ℂ)•kernelThetaNull.starProjection (kernelVariationalSolution (kernelL2Defect a b ha hab (4/3))) have hv : kernelSpectralFormOperator (8/9) v=kernelVariationalSolution 0 := by change kernelSpectralFormOperator (8/9) ((17/6:ℂ)•kernelThetaNull.starProjection _)=_ rw [map_smul] have hz : kernelSpectralFormOperator (8/9) (kernelThetaNull.starProjection (kernelVariationalSolution (kernelL2Defect a b ha hab (4/3))))=0 := kernelThetaNull.starProjection_apply_mem _ rw [hz,smul_zero,map_zero] have hh := kernelSpectralFormOperator_solution_graph (8/9) 0 v hv simpa only [v,map_smul,zero_add,kernelEisensteinResidueVector,kernelThetaMassProjection, kernelL2SandwichCLM,ContinuousLinearMap.comp_apply,ContinuousLinearMap.compL_apply, ContinuousLinearMap.flip_apply,kernelVariationalSolution] using! hh end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.SeedHeight namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace MatrixGroups lemma fullCuspHeight_le_barrier (x : FullCuspClasses) (w : HyperbolicSpace) : fullCuspHeight x w≤ max 3 (cuspBarrier 2 3 w) := by by_cases hx : fullCuspHeight x w≤3 · exact hx.trans (le_max_left _ _) · have he : cuspBarrier 2 3 w=fullCuspHeight x w := by rw [cuspBarrier,fullCuspProfileSum_eq_single _ (fun v hv => cuspBarrierProfile_zero 2 3 (by norm_num) v (by linarith)) w x (by linarith), cuspBarrierProfile,cuspTransition_one 2 3 _ (by norm_num) (by linarith),one_mul] ring exact he ▸ le_max_right _ _ lemma cosetHeight_le_barrier (r : CuspCosets) (w : HyperbolicSpace) : cosetHeight r w≤ max 3 (cuspBarrier 2 3 w) := by induction r using Quotient.inductionOn with | _ M => change cosetHeight (cosetOf M) w≤ max 3 (cuspBarrier 2 3 w) rw [cosetHeight_cosetOf] exact fullCuspHeight_le_barrier (fullCuspOf M.1) w lemma kernel_compact_seed_height_bound : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (a : ℝ) (S : Set KernelQuotient) (hS : IsCompact S), ∃B : ℝ,a≤B ∧ 3≤B ∧ ∀q∈S,kernelQuotientBarrier 2 3 q≤B := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (a : ℝ) (S : Set KernelQuotient) (hS : IsCompact S) => by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace obtain ⟨B,hB⟩ := (hS.image (kernelQuotientBarrier_contMDiff 2 3 (by norm_num) (by norm_num)).continuous).bddAbove refine ⟨max a (max 3 B),le_max_left _ _,(le_max_left 3 B).trans (le_max_right _ _),?_⟩ intro q hq exact (hB (Set.mem_image_of_mem _ hq)).trans ((le_max_right 3 B).trans (le_max_right _ _)) def kernelSeedHeightBound : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (a : ℝ) (S : Set KernelQuotient) (hS : IsCompact S), ℝ := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (a : ℝ) (S : Set KernelQuotient) (hS : IsCompact S) => Classical.choose (kernel_compact_seed_height_bound a S hS) lemma kernelSeedHeightBound_spec : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (a : ℝ) (S : Set KernelQuotient) (hS : IsCompact S), a≤kernelSeedHeightBound a S hS ∧ 3≤kernelSeedHeightBound a S hS ∧ ∀q∈S,kernelQuotientBarrier 2 3 q≤kernelSeedHeightBound a S hS := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (a : ℝ) (S : Set KernelQuotient) (hS : IsCompact S) => Classical.choose_spec (kernel_compact_seed_height_bound a S hS) def compactSeedTransition (a b B : ℝ) : C(Set.Icc a B,ℂ) := ⟨fun v => (cuspTransition a b (v:ℝ):ℂ),Complex.continuous_ofReal.comp ((cuspTransition_contDiff a b).continuous.comp continuous_subtype_val)⟩ def compactSeedProfile (a b B : ℝ) (ha : 0 change cuspCutoffCorrection 1 (compactHeightProfile a B hB (compactSeedProfile a b B ha s)) w= cuspCutoffCorrection 1 (cuspSeedProfile a b s) w unfold cuspCutoffCorrection apply tsum_congr intro r unfold cuspCutoffTerm rw [compactHeightProfile_seed a b B ha hab hB s _ ((cosetHeight_le_barrier r w).trans (max_le hthree hq))] def kernelLocalSeedL2 : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (S : Set KernelQuotient) (hS : IsCompact S) (a b : ℝ) (ha : 0 let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel kernelMassRestrictionCLM S hS.measurableSet (compactProfileL2 a (kernelSeedHeightBound a S hS) (kernelSeedHeightBound_spec a S hS).1 (compactSeedProfile a b (kernelSeedHeightBound a S hS) ha s)) lemma kernelLocalSeedL2_entire : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (S : Set KernelQuotient) (hS : IsCompact S) (a b : ℝ) (ha : 0 by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel exact (kernelMassRestrictionCLM S hS.measurableSet).differentiable.comp ((compactProfileL2 a (kernelSeedHeightBound a S hS) (kernelSeedHeightBound_spec a S hS).1).differentiable.comp (compactSeedProfile_entire a b (kernelSeedHeightBound a S hS) ha)) lemma kernelLocalSeedL2_ae_eq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (S : Set KernelQuotient) (hS : IsCompact S) (a b : ℝ) (ha : 0 by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel let B := kernelSeedHeightBound a S hS have hB := kernelSeedHeightBound_spec a S hS filter_upwards [kernelMassRestriction_coe S hS.measurableSet (compactProfileL2 a B hB.1 (compactSeedProfile a b B ha s)), compactProfileL2_ae_eq a B hB.1 (compactSeedProfile a b B ha s)] with q hr hp change kernelMassRestriction S hS.measurableSet (compactProfileL2 a B hB.1 (compactSeedProfile a b B ha s)) q=S.indicator (kernelQuotientSeed a b s) q rw [hr] by_cases hq : q∈S · rw [Set.indicator_of_mem hq,Set.indicator_of_mem hq,hp] exact kernelCompactProfile_seed a b B ha hab hB.1 hB.2.1 s q (hB.2.2 q hq) · rw [Set.indicator_of_notMem hq,Set.indicator_of_notMem hq] end section open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace def kernelCorrectedSeed (a b : ℝ) (ha : 0 kernelQuotientSeed a b s q+kernelEisensteinL2Correction a b ha hab s q def kernelLocalCorrectedSeed : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (S : Set KernelQuotient) (hS : IsCompact S) (a b : ℝ) (ha : 0 let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel kernelLocalSeedL2 S hS a b ha s + kernelMassRestrictionCLM S hS.measurableSet (kernelEisensteinL2Correction a b ha hab s) lemma kernelLocalCorrectedSeed_analyticAt_nonreal : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (S : Set KernelQuotient) (hS : IsCompact S) (a b : ℝ) (ha : 0 by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel exact ((kernelLocalSeedL2_entire S hS a b ha).analyticAt s).add ((ContinuousLinearMap.analyticAt (𝕜 := ℂ) (E := KernelQuotientL2) (F := KernelQuotientL2) (kernelMassRestrictionCLM S hS.measurableSet) (kernelEisensteinL2Correction a b ha hab s)).comp_of_eq (kernelEisensteinL2Correction_analyticAt_nonreal a b ha hab s hs hi) rfl) lemma kernelLocalCorrectedSeed_ae_eq : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (S : Set KernelQuotient) (hS : IsCompact S) (a b : ℝ) (ha : 0 by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel filter_upwards [Lp.coeFn_add (kernelLocalSeedL2 S hS a b ha s) (kernelMassRestrictionCLM S hS.measurableSet (kernelEisensteinL2Correction a b ha hab s)), kernelLocalSeedL2_ae_eq S hS a b ha hab s, kernelMassRestriction_coe S hS.measurableSet (kernelEisensteinL2Correction a b ha hab s)] with q hsum hseed hcor change (kernelLocalSeedL2 S hS a b ha s+ kernelMassRestrictionCLM S hS.measurableSet (kernelEisensteinL2Correction a b ha hab s)) q=_ rw [hsum] change kernelLocalSeedL2 S hS a b ha s q+ kernelMassRestriction S hS.measurableSet (kernelEisensteinL2Correction a b ha hab s) q=_ rw [hseed,hcor] by_cases hq : q∈S · simp only [Set.indicator_of_mem hq,kernelCorrectedSeed] · simp only [Set.indicator_of_notMem hq,add_zero] lemma kernelLocalCorrectedSeed_residue_limit : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (S : Set KernelQuotient) (hS : IsCompact S) (a b : ℝ) (ha : 0 (s-4/3)•kernelLocalCorrectedSeed S hS a b ha hab s) (𝓝[≠] (4/3:ℂ)) (𝓝 (kernelMassRestrictionCLM S hS.measurableSet (kernelEisensteinResidueVector a b ha hab))) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (S : Set KernelQuotient) (hS : IsCompact S) (a b : ℝ) (ha : 0 by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel dsimp only have hseed : Tendsto (fun s : ℂ => (s-4/3)•kernelLocalSeedL2 S hS a b ha s) (𝓝[≠] (4/3:ℂ)) (𝓝 0) := by have hh : ContinuousAt (fun s : ℂ => (s-4/3)•kernelLocalSeedL2 S hS a b ha s) (4/3:ℂ) := (continuousAt_id.sub continuousAt_const).smul ((kernelLocalSeedL2_entire S hS a b ha).continuous.continuousAt) simpa only [sub_self,zero_smul] using hh.tendsto.mono_left (show 𝓝[≠] (4/3:ℂ)≤𝓝 (4/3:ℂ) from nhdsWithin_le_nhds) have hcor := (kernelMassRestrictionCLM S hS.measurableSet).continuous.continuousAt.tendsto.comp (kernelEisensteinResidueVector_limit a b ha hab) have hh := hseed.add hcor simpa only [kernelLocalCorrectedSeed,smul_add,map_smul,Function.comp_def,zero_add] using hh end section open Filter open scoped BigOperators Classical Topology ContDiff section PartialDerivatives variable {A E G : Type*} [NormedAddCommGroup A] [NormedSpace ℝ A] [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup G] [NormedSpace ℝ G] lemma partial_iteratedFDeriv_contDiffAt (F : A→E→G) (a : A) (x : E) (hF : ContDiffAt ℝ ∞ (Function.uncurry F) (a,x)) (k : ℕ) : ContDiffAt ℝ ∞ (fun p : A×E => iteratedFDeriv ℝ k (F p.1) p.2) (a,x) := by induction k with | zero => exact hF.continuousLinearMap_comp ((continuousMultilinearCurryFin0 ℝ E G).symm : G→L[ℝ] E [×0]→L[ℝ]G) | succ k ih => have hpair : ContDiffAt ℝ ∞ (fun p : (A×E)×E => (p.1.1,p.2)) ((a,x),x) := (contDiffAt_fst.fst).prodMk contDiffAt_snd have hp := ih.comp ((a,x),x) hpair have hd : ContDiffAt ℝ ∞ (fun p : A×E => fderiv ℝ (fun y => iteratedFDeriv ℝ k (F p.1) y) p.2) (a,x) := hp.fderiv contDiffAt_snd (by simp) exact hd.continuousLinearMap_comp ((continuousMultilinearCurryLeftEquiv ℝ (fun _ : Fin (k+1) => E) G).symm : (E→L[ℝ] E [×k]→L[ℝ]G)→L[ℝ] E [×(k+1)]→L[ℝ]G) lemma compact_family_derivative_bound (F : A→E→G) (K : Set A) (P : Set E) (hK : IsCompact K) (hP : IsCompact P) (hF : ∀a∈K,∀x,ContDiffAt ℝ ∞ (Function.uncurry F) (a,x)) (hsupp : ∀a∈K,tsupport (F a)⊆P) (k : ℕ) : ∃C : ℝ,0≤C ∧ ∀a∈K,∀x,‖iteratedFDeriv ℝ k (F a) x‖≤C := by have hc : ContinuousOn (fun p : A×E => iteratedFDeriv ℝ k (F p.1) p.2) (K×ˢP) := by intro p hp exact (partial_iteratedFDeriv_contDiffAt F p.1 p.2 (hF p.1 hp.1 p.2) k).continuousAt.continuousWithinAt obtain ⟨C,hC⟩ := (hK.prod hP).bddAbove_image hc.norm refine ⟨max C 0,le_max_right _ _,?_⟩ intro a ha x by_cases hx : x∈P · exact (hC ⟨(a,x),⟨ha,hx⟩,rfl⟩).trans (le_max_left _ _) · have hz : iteratedFDeriv ℝ k (F a) x=0 := by by_contra hn exact hx (hsupp a ha (support_iteratedFDeriv_subset k hn)) rw [hz,norm_zero] exact le_max_right _ _ end PartialDerivatives section variable {A E ι : Type*} [NormedAddCommGroup A] [NormedSpace ℝ A] [NormedAddCommGroup E] [NormedSpace ℝ E] theorem compact_smooth_family_tsum (F : A→E→ℂ) (K : Set A) (P : Set E) (hK : IsCompact K) (hP : IsCompact P) (hF : ∀a∈K,∀x,ContDiffAt ℝ ∞ (Function.uncurry F) (a,x)) (hsupp : ∀a∈K,tsupport (F a)⊆P) (a : ι→A) (ha : ∀i,a i∈K) (b : ι→ℂ) (hb : Summable (fun i => ‖b i‖)) : ContDiff ℝ ∞ (fun x => ∑'i,b i*F (a i) x) := by choose C hC hbound using compact_family_derivative_bound F K P hK hP hF hsupp have hf (i : ι) : ContDiff ℝ ∞ (F (a i)) := by apply contDiff_iff_contDiffAt.mpr intro x exact (hF (a i) (ha i) x).comp x (contDiffAt_const.prodMk contDiffAt_id) have hprod (i : ι) : ContDiff ℝ ∞ (fun x => b i*F (a i) x) := contDiff_const.mul (hf i) apply contDiff_tsum (v := fun k i => ‖b i‖*C k) hprod · intro k hk exact hb.mul_right (C k) · intro k i x hk have he : iteratedFDeriv ℝ k (fun x => b i*F (a i) x) x= b i • iteratedFDeriv ℝ k (F (a i)) x := by simpa only [smul_eq_mul] using (iteratedFDeriv_const_smul_apply' (a := b i) (i := k) (x := x) ((hf i).contDiffAt.of_le (by exact_mod_cast (le_top : (k : ℕ∞) ≤ ⊤)))) rw [he,norm_smul] exact mul_le_mul_of_nonneg_left (hbound k (a i) (ha i) x) (norm_nonneg _) end lemma rowEnergy_real_smul (r : ℝ) (u : Fin 2→ℂ) : rowEnergy (r • u)=r^2*rowEnergy u := by simp only [rowEnergy,Pi.smul_apply,norm_smul,Real.norm_eq_abs,mul_pow,sq_abs] ring def normalizedComplexRow (u : Fin 2→ℂ) : Fin 2→ℂ := (Real.sqrt (rowEnergy u))⁻¹ • u lemma normalizedComplexRow_energy (u : Fin 2→ℂ) (hu : u≠0) : rowEnergy (normalizedComplexRow u)=1 := by rw [normalizedComplexRow,rowEnergy_real_smul,inv_pow, Real.sq_sqrt (rowEnergy_nonneg u),inv_mul_cancel₀ (rowEnergy_pos u hu).ne'] lemma rowEnergy_continuous : Continuous rowEnergy := by unfold rowEnergy fun_prop lemma rowEnergy_unit_isCompact : IsCompact {u : Fin 2→ℂ | rowEnergy u=1} := by apply (isCompact_closedBall (0 : Fin 2→ℂ) 1).of_isClosed_subset (isClosed_eq rowEnergy_continuous continuous_const) intro u hu change rowEnergy u=1 at hu rw [Metric.mem_closedBall,dist_zero_right] simpa only [hu,Real.sqrt_one] using norm_le_sqrt_rowEnergy u lemma rowEnergy_unit_ne_zero (u : Fin 2→ℂ) (hu : rowEnergy u=1) : u≠0 := by intro h simp [h,rowEnergy] at hu def regularSpatialHeight (deltaLoss : ℝ) (p : SpatialCoordinates) : ℝ := deltaLoss*ConcreteCompactWeight.positiveExtension (p 2/deltaLoss) lemma regularSpatialHeight_pos (deltaLoss : ℝ) (hδ : 0 heightDenominator (spatialHorizontal p.2) (regularSpatialHeight deltaLoss p.2) p.1) := by have hc (j : Fin 2) : ContDiff ℝ ∞ (fun p : (Fin 2→ℂ)×SpatialCoordinates => p.1 j) := (contDiff_apply ℝ ℂ j).comp contDiff_fst have hz := spatialHorizontal_contDiff.comp (contDiff_snd (E := Fin 2→ℂ)) have hv := (regularSpatialHeight_contDiff deltaLoss).comp (contDiff_snd (E := Fin 2→ℂ)) have hw := ((hc 0).mul hz).add (hc 1) simp only [heightDenominator,←Complex.normSq_eq_norm_sq,Complex.normSq_apply] exact (((Complex.reCLM.contDiff.comp hw).mul (Complex.reCLM.contDiff.comp hw)).add ((Complex.imCLM.contDiff.comp hw).mul (Complex.imCLM.contDiff.comp hw))).add ((((Complex.reCLM.contDiff.comp (hc 0)).mul (Complex.reCLM.contDiff.comp (hc 0))).add ((Complex.imCLM.contDiff.comp (hc 0)).mul (Complex.imCLM.contDiff.comp (hc 0)))).mul (hv.pow 2)) lemma regularRowKernel_contDiffAt (s : ℂ) (deltaLoss : ℝ) (hδ : 0 regularSpatialHeight deltaLoss q.2) := (regularSpatialHeight_contDiff deltaLoss).comp contDiff_snd have hD := (regularRowDenominator_contDiff deltaLoss).contDiffAt (x := (u,p)) have hv0 := regularSpatialHeight_pos deltaLoss hδ p have hD0 := heightDenominator_pos (spatialHorizontal p) (regularSpatialHeight deltaLoss p) hv0 u hu have hl := (hv.contDiffAt.log hv0.ne').sub (hD.log hD0.ne') exact (contDiffAt_const.mul (Complex.ofRealCLM.contDiff.contDiffAt.comp (u,p) hl)).cexp lemma heightDenominator_real_smul (z : ℂ) (v r : ℝ) (u : Fin 2→ℂ) : heightDenominator z v (r•u)=r^2*heightDenominator z v u := by unfold heightDenominator have he : (r•u) 0*z+(r•u) 1=r•(u 0*z+u 1) := by simp only [Pi.smul_apply,smul_add,smul_mul_assoc] rw [he] simp only [Pi.smul_apply,norm_smul,Real.norm_eq_abs,mul_pow,sq_abs] ring lemma heightDenominator_normalized (z : ℂ) (v : ℝ) (u : Fin 2→ℂ) : heightDenominator z v (normalizedComplexRow u)=heightDenominator z v u/rowEnergy u := by rw [normalizedComplexRow,heightDenominator_real_smul,inv_pow,Real.sq_sqrt (rowEnergy_nonneg u)] ring lemma normalized_row_summand (s : ℂ) (deltaLoss : ℝ) (hδ : 0 ∑'r : CuspCosets, summand 1 s r*(ψ p*regularRowKernel s deltaLoss (normalizedComplexRow (embeddedRow r)) p)) := by apply compact_smooth_family_tsum (fun u p => ψ p*regularRowKernel s deltaLoss u p) {u : Fin 2→ℂ | rowEnergy u=1} (tsupport ψ) rowEnergy_unit_isCompact hcψ · intro u hu p have hψp : ContDiffAt ℝ ∞ (fun q : (Fin 2→ℂ)×SpatialCoordinates => ψ q.2) (u,p) := hψ.contDiffAt.comp (u,p) contDiffAt_snd exact hψp.mul (regularRowKernel_contDiffAt s deltaLoss hδ u (rowEnergy_unit_ne_zero u hu) p) · intro u hu exact tsupport_mul_subset_left · intro r exact normalizedComplexRow_energy _ (embeddedRow_ne_zero r) · exact summable_norm_summand 1 s hs theorem smoothEisenstein_contDiffAt (s : ℂ) (hs : 2 (χ q:ℂ) have hψ : ContDiff ℝ ∞ ψ := Complex.ofRealCLM.contDiff.comp χ.contDiff have hcψ : HasCompactSupport ψ := by have he : Function.support ψ=Function.support (fun q => χ q) := by ext q simp [Function.mem_support,ψ] change IsCompact (closure (Function.support ψ)) rw [he] exact χ.hasCompactSupport have hsum := regular_eisenstein_compact_smooth s hs deltaLoss hδ ψ hψ hcψ apply hsum.contDiffAt.congr_of_eventuallyEq have hn : ∀ᶠq in 𝓝 p, deltaLoss by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace dsimp only let kernelSpatial_chartAt := fun q => OAI.CubicEisenstein.kernelSpatial_chartAt q intro q have hq : q∈(kernelQuotientChart q).source := mem_chart_source SpatialCoordinates q have hp : kernelQuotientChart q q∈hyperbolicSpatialChart.target := ((kernelQuotientChart q).map_source hq).1 have hc : ContinuousAt (kernelQuotientChart q) q := (kernelQuotientChart q).continuousOn.continuousAt ((kernelQuotientChart q).open_source.mem_nhds hq) have heq : f=ᶠ[𝓝 q] (fun t => F (kernelQuotientChart q t)) := by filter_upwards [(kernelQuotientChart q).open_source.mem_nhds hq] with t ht rw [←hcoord q _ ((kernelQuotientChart q).map_source ht).1, (kernelQuotientChart q).left_inv ht] rw [contMDiffAt_iff] refine ⟨((hF _ (hyperbolicSpatialChart_target_positive hp)).continuousAt.comp hc).congr heq.symm,?_⟩ have he : (fun p => f ((kernelQuotientChart q).symm p))=ᶠ[𝓝 (kernelQuotientChart q q)] F := by filter_upwards [hyperbolicSpatialChart.open_target.mem_nhds hp] with p hp exact hcoord q p hp have hh := (hF _ (hyperbolicSpatialChart_target_positive hp)).congr_of_eventuallyEq he have hh' := hh.contDiffWithinAt (s := Set.univ) simpa only [extChartAt_coe,extChartAt_coe_symm,modelWithCornersSelf_coe, modelWithCornersSelf_coe_symm,Function.id_comp,Function.comp_id,Set.range_id, chartAt_self_eq,kernelSpatial_chartAt,OpenPartialHomeomorph.refl_apply,Function.comp_def,id_eq] using hh' lemma kernelQuotientEisenstein_coordinate : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (s : ℂ) (hs : 2 by rw [kernelQuotientChart_symm,hyperbolicSpatialChart_symm_eq hp, kernelQuotientEisenstein_mk,hyperbolicEisenstein_upperPoint, smoothEisenstein_eq_actual s p (hyperbolicSpatialChart_target_positive hp)] rfl lemma kernelQuotientEisenstein_contMDiff : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (s : ℂ) (hs : 2 let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace kernel_contMDiff_of_spatial _ _ (smoothEisenstein_contDiffAt s hs) (kernelQuotientEisenstein_coordinate s hs) lemma kernelQuotientSeed_coordinate : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (a b : ℝ) (s : ℂ) (q : KernelQuotient) (p : SpatialCoordinates) (hp : p∈hyperbolicSpatialChart.target), kernelQuotientSeed a b s ((kernelQuotientChart q).symm p)=smoothCuspSeedField a b s p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (a b : ℝ) (s : ℂ) (q : KernelQuotient) (p : SpatialCoordinates) (hp : p∈hyperbolicSpatialChart.target) => by rw [kernelQuotientChart_symm,hyperbolicSpatialChart_symm_eq hp] change smoothCuspSeed a b s _=smoothCuspSeedField a b s p rw [smoothCuspSeedField,dif_pos (hyperbolicSpatialChart_target_positive hp)] rfl lemma kernelQuotientSeed_contMDiff : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (a b : ℝ) (s : ℂ) (ha : 1 let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace kernel_contMDiff_of_spatial _ _ (actual_smoothCuspSeed_contDiffAt a b s ha hab) (kernelQuotientSeed_coordinate a b s) end CubicEisenstein open scoped BigOperators Classical ContDiff namespace InitialMeanSquare open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm) def HasInitialCanonicalDensityAtRadius {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) : Prop := ∀ deltaLoss : ℝ,0 < deltaLoss → ∀ P : ℕ,∀ A : ℝ,0≤A → ∃ J : ℕ, ∀ V₁ V₂ : ℝ → ℂ,HasCompactSupport V₁ → HasCompactSupport V₂ → ContDiff ℝ ∞ V₁ → ContDiff ℝ ∞ V₂ → (∀s,V₁ s≠0→|s|≤A) → (∀s,V₂ s≠0→|s|≤A) → ∃ (C Cpool : ℝ) (E : ℕ),0 < C ∧ 1 ≤ Cpool ∧ P ≤ E ∧ ∀ (D : ℕ) (Z X lengthScale K : ℝ) (R : Finset (OutsidePrimeIndex S D)) (ray : SecondRayIndex) (T : Finset (Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O)), 1 ≤ Z → Cpool*Z^E ≤ D → 1 ≤ X → 1 ≤ lengthScale → 1 ≤ K → X ≤ Z^P → lengthScale ≤ Z^P → K ≤ Z^P → initialExcludedNorm S*primeProductNorm (outsidePrime S D) R ≤ Z^P → X*lengthScale ≤ Z^2 → K*(initialExcludedNorm S*primeProductNorm (outsidePrime S D) R) ≤ X*lengthScale*Z^(-(1 : ℝ)/20) → (∀ z ∈ T,Admissible z.1 ∧ (Ideal.absNorm z.1 : ℝ) ≤ lengthScale ∧ z.2 ≠ 0 ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ K) → (∀z∈T,IsCoprime z.1 (∏P∈S,P)) → outsideCanonicalDensity χ S hbad D ray R T V₁ V₂ X J ≤ C*Z^deltaLoss*(X*lengthScale)^2 end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.InitialDensity namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff namespace CanonicalRowCompletion open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O columnWeight open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open SecondPassIntegration hiding O open InitialMeanSquare hiding O open CanonicalCubeSeparation open CanonicalCoefficientClass (IsBaseRayTwist) open FirstPassCubeLabels (primeProductNorm firstLogDensity) open ConcreteTraceCRT (eisEmbedding) theorem hasInitialCanonicalDensityAtRadius_of_theta {q₀ : ℕ} (χ : DirichletCharacter ℂ q₀) (S : Finset (Ideal ActualEisensteinCubic.O)) (hSp : ∀P∈S,Prime P) (hbad : fixedBadPrimes⊆S) (ρ q levelBound : ℝ) (hρ : 0<ρ) (hq : 1FirstPassCubeLabels.firstLogDensity_nonneg 0 t) let Ccan:=6*(C₁+C₂)*I₀^3 let Cele:=initialElementaryConstant A' Vmax*I₀^3 let C:=Ccan+Cele*Z₀^3+1 have hCcan : 0≤Ccan:=by dsimp only [Ccan];positivity have hCele : 0≤Cele:=mul_nonneg (initialElementaryConstant_nonneg A' Vmax) (pow_nonneg hI₀ _) have hC : 0Ideal.span {p i}) R let labels:=T.image Prod.fst have hmember : IsBaseRayTwist base base:=Or.inl rfl have hη : 0≤canonicalDescentPadding deltaLoss:=(canonicalDescentPadding_budget deltaLoss hδ).1.le have hstate₁ := initialCanonicalState S D hbad base Ψ₁ (hmember.secondMinus ray) Z (canonicalDescentPadding deltaLoss) X lengthScale K hZ hη hX hL hK R T hmass hinv (fun z hz=>⟨(hT z hz).1,(hT z hz).2.1⟩) hout have hstate₂ := initialCanonicalState S D hbad base Ψ₂ (hmember.secondPlus ray) Z (canonicalDescentPadding deltaLoss) X lengthScale K hZ hη hX hL hK R T hmass hinv (fun z hz=>⟨(hT z hz).1,(hT z hz).2.1⟩) hout have hZδ : 1≤Z^deltaLoss:=Real.one_le_rpow hZ hδ.le have hD : Real.exp (radiusIter A 3000)*Z^3≤D := (mul_le_mul_of_nonneg_left (pow_le_pow_right₀ hZ (le_max_right P 3)) (Real.exp_pos _).le).trans hpool have hlabels : ∀z∈T,z.1∈labels:=fun z hz=>Finset.mem_image.mpr ⟨z,hz,rfl⟩ have hrows : ∀z∈T,‖eisEmbedding z.2‖^2≤K:=fun z hz=>(hT z hz).2.2.2 have hzero : ∀z∈T,z.2≠0:=fun z hz=>(hT z hz).2.2.1 by_cases hlarge : Z₀≤Z · obtain ⟨hZgt,hZbig,hfixed⟩:=hthreshold Z hlarge have hleft (t : ℝ) : canonicalLogEnergy p hp hcop hg Finset.univ (normHeightTwist Ψ₁ t) m labels (orientedLogProfile true V₁) X K≤ ((C₁+C₂)*Z^deltaLoss)*(X*lengthScale)^2*(1+‖t‖)^(2*d) := by have hh:=he₁ D Z Ψ₁ m labels X lengthScale K t hstate₁ hZgt hZbig hfixed hD change canonicalLogEnergy p hp hcop hg Finset.univ (normHeightTwist Ψ₁ t) m labels (orientedLogProfile true V₁) X K≤_ at hh apply hh.trans rw [Real.norm_eq_abs] gcongr · linarith · linarith [abs_nonneg t] · omega have hright (t : ℝ) : canonicalLogEnergy p hp hcop hg Finset.univ (normHeightTwist Ψ₂ t) m labels (orientedLogProfile false V₂) X K≤ ((C₁+C₂)*Z^deltaLoss)*(X*lengthScale)^2*(1+‖t‖)^(2*d) := by have hh:=he₂ D Z Ψ₂ m labels X lengthScale K t hstate₂ hZgt hZbig hfixed hD change canonicalLogEnergy p hp hcop hg Finset.univ (normHeightTwist Ψ₂ t) m labels (orientedLogProfile false V₂) X K≤_ at hh apply hh.trans rw [Real.norm_eq_abs] gcongr · linarith · linarith [abs_nonneg t] · omega have hd:=densityChildEnergy_from_canonical_heights p hp hcop hg Finset.univ Ψ₁ Ψ₂ m T labels V₁ V₂ X lengthScale K ((C₁+C₂)*Z^deltaLoss) d (by linarith) (by linarith) (by positivity) hlabels hrows hzero hleft hright change outsideCanonicalDensity χ S hbad D ray R T V₁ V₂ X d≤_ at hd have hcan : outsideCanonicalDensity χ S hbad D ray R T V₁ V₂ X d≤Ccan*Z^deltaLoss*(X*lengthScale)^2 := by convert hd using 1 ; dsimp only [Ccan,I₀] ; ring exact hcan.trans (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hcanC (Real.rpow_nonneg (by linarith) _)) (sq_nonneg _)) · have hKcap : K≤Z₀^3:=hstate₁.row_le_global.trans (pow_le_pow_left₀ (by linarith) (le_of_not_ge hlarge) 3) have hΨ₁ : ∀u,‖Ψ₁ u‖≤1:=fun u=>(secondRayMinus_norm_le base ray u).trans (hbase u) have hΨ₂ : ∀u,‖Ψ₂ u‖≤1:=fun u=>(secondRayPlus_norm_le base ray u).trans (hbase u) have hd:=initial_density_elementary_squared_mass p hp hcop hg (outsidePrime_odd S hbad D) (outsidePrime_injective S hbad D) Finset.univ Ψ₁ Ψ₂ hΨ₁ hΨ₂ m T V₁ V₂ X lengthScale K A' Vmax d (by linarith) hL hK hA' hVmax hbV₁ hbV₂ hsV₁ hsV₂ (fun z hz=>⟨(hT z hz).1.1,(hT z hz).2.1,(hT z hz).2.2.2⟩) change outsideCanonicalDensity χ S hbad D ray R T V₁ V₂ X d≤Cele*K*(X*lengthScale)^2 at hd apply hd.trans apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) exact (mul_le_mul_of_nonneg_left hKcap hCele).trans (heleC.trans (le_mul_of_one_le_right hC.le hZδ)) end CanonicalRowCompletion namespace InitialMeanSquare section open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff FourierTransform open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (normalizedColumn columnLog firstLogDensity) theorem initial_sector_transfer_radius (U : ℝ→ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g W : 𝓢(ℝ,ℂ)) (A : ℝ) (hA : 0≤A) (hU : ∀t,g t≠0→U t=1) (hgA : ∀t,g t≠0→|t|≤A) (ε : ℝ) (hε : 0<ε) (N J : ℕ) : ∃ (windows : Fin 7→ℝ→ℂ) (C Cₛ : ℝ),0≤C ∧ 0≤Cₛ ∧ (∀i,HasCompactSupport (windows i)) ∧ (∀i,ContDiff ℝ ∞ (windows i)) ∧ (∀i t,windows i t≠0→|t|≤A+2+1) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι→ActualEisensteinCubic.O) (hp : ∀i,p i≠0) [∀i,(Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀i,ringChar (ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (_hpr : ∀i,lambda^2∣p i-1) (F : Finset ι) (Ψ : ActualEisensteinCubic.O→*ℂ) (m r : ActualEisensteinCubic.O) (ray : SecondRayIndex) (s : Finset (SecondExpansionData ι)) (Z H E V X K : ℝ), 0 normalizedColumn p (fun T => g (columnLog p Z T)) S) (fun S => normalizedColumn p (fun T => g (columnLog p Z T)) S) W H‖≤ (C*H*elementNorm r/Z^2*‖secondRayCoefficient ray‖*(K*Real.exp 2)^ε)* (∫t₁:ℝ,∫t₂:ℝ,∫t₃:ℝ,B (t₁,t₂,t₃)* sourceGeometricMean p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) (windows 5) (windows 6) X X (t₁,t₂,t₃)) := by obtain ⟨A₁,A₂,windows,hwc,hws,hwb,hid⟩ := initial_sector_fixed_profiles U hUc hUs g g W A hA hU hU hgA hgA obtain ⟨Cw,hCw,hwbound⟩ := outerWindow_global_bound windows hwc (fun i => (hws i).continuous) have hM : 0≤A+2+1 := by linarith obtain ⟨Cₐ,hCₐ,Cₛ,hCₛ,htrans⟩ := initial_source_uniform_transfer ε hε A₁ A₂ W windows (fun _ => A+2+1) (fun _ => hM) hwb N J refine ⟨windows,Cw*Cₐ,Cₛ,mul_nonneg hCw hCₐ.le,hCₛ,hwc,hws,hwb,?_⟩ intro ι _ p hp _ hcop hg hinj hc hpr F Ψ m r ray s Z H E V X K hZ hH hE hV hX hK hΨ hs hk hz he hv hkap let R := H*K/(E^2*V^2*X^2) have hR : 0 ‖tripleCoefficient (𝓕 A₁) (𝓕 A₂) b q‖ refine ⟨B,fun q => norm_nonneg _,?_,?_⟩ · intro q simpa only [B,R,tripleCoefficient,mul_assoc] using hpoint q.1 q.2.1 q.2.2 · let T := s.image (sourceObservation p) have hT0 : ∀y∈T,y.1≠0 := by intro y hy obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hy exact sourceRow_nonzero p x (hk x hx) have hTK : ∀y∈T,(Ideal.absNorm (Ideal.span {y.1}):ℝ)≤K*Real.exp 2 := by intro y hy obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hy have hpos := elementNorm_pos _ (sourceRow_nonzero p x (hk x hx)) have hl : Real.log (elementNorm (sourceObservation p x).1/K)≤2 := (le_abs_self _).trans (hkap x hx) have hh := Real.exp_le_exp.mpr hl rw [Real.exp_log (div_pos hpos hK)] at hh have hh' := (div_le_iff₀ hK).mp hh simpa only [elementNorm,eisEmbedding_norm_sq_eq_absNorm_span,mul_comm] using hh' let D := H*elementNorm r/Z^2*‖secondRayCoefficient ray‖ have hD : 0≤D := by dsimp [D,elementNorm]; positivity have hweights : ∀x∈s,‖sourceWeight p hp hcop hg Ψ m ray Z H x‖* ‖outerWindow windows (sourceLogZ p Z X x) 0 (sourceLogE p E x) (sourceLogV p V x) (sourceLogK p K x)‖≤D*Cw := by intro x hx exact mul_le_mul (sourceWeight_norm_fixed p hp hcop hg hinj hc Ψ m r ray Z H x (hs x hx) hZ hH.le (hΨ _) (hΨ _)) (hwbound _ _ _ _ _) (norm_nonneg _) hD have hh := hbound p hp hcop hg hinj r s T (sourceWeight p hp hcop hg Ψ m ray Z H) (D*Cw) (K*Real.exp 2) F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (sourceLogZ p Z X) (fun _ => 0) (sourceLogE p E) (sourceLogV p V) (sourceLogK p K) X X (mul_nonneg hD hCw) (by positivity) hs (fun x hx => Finset.mem_image.mpr ⟨x,hx,rfl⟩) hT0 hTK hweights rw [hid p hp hcop hg hinj hpr F Ψ m r ray s Z H E V X K hZ hE hV hX hK hs hk hz he hv hkap] convert hh using 1 ; dsimp [D,B,R,T] ; ring end section open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff open ActualEisensteinCubic SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog firstLogDensity) theorem initial_subbin_transfer_radius (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g W : 𝓢(ℝ,ℂ)) (A : ℝ) (hA : 0 ≤ A) (hU : ∀ t, g t ≠ 0 → U t=1) (hgA : ∀ t, g t ≠ 0 → |t| ≤ A) (ε : ℝ) (hε : 0 < ε) (N J : ℕ) : ∃ (windows : Fin 7 → ℝ → ℂ) (C Cₛ : ℝ), 0 ≤ C ∧ 0 ≤ Cₛ ∧ (∀ i, HasCompactSupport (windows i)) ∧ (∀ i, ContDiff ℝ ∞ (windows i)) ∧ (∀i t,windows i t≠0→|t|≤A+2+1) ∧ ∀ {ι : Type*} [DecidableEq ι] (p : ι → ActualEisensteinCubic.O) (hp : ∀ i, p i ≠ 0) [∀ i, (Ideal.span {p i}).IsMaximal] (hcop : Pairwise (Function.onFun IsCoprime (fun i => Ideal.span {p i}))) (hg : ∀ i, lambda ∉ Ideal.span {p i}) (_hinj : Function.Injective (fun i => Ideal.span {p i})) (_hc : ∀ i, ringChar (ActualEisensteinCubic.O ⧸ Ideal.span {p i}) ≠ 2) (_hpr : ∀ i, lambda^2 ∣ p i-1) (F R : Finset ι) (Ψ : ActualEisensteinCubic.O →* ℂ) (m : ActualEisensteinCubic.O) (ray : SecondRayIndex) (K : Finset ι → Finset ι → Finset ActualEisensteinCubic.O) (Z H M : ℝ) (j : SecondLogIndex) (s : Finset (SecondExpansionData ι)), 0 < Z → 0 < H → (∀ a, ‖Ψ a‖ ≤ 1) → s ⊆ secondLogSector p ∅ F K R Z M j → let X := initialLogColumn Z (primeProductNorm p R) j let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R ∃ B : Frequency → ℝ, (∀ q, 0 ≤ B q) ∧ (∀ q, (1+H*secondLogK j*(primeProductNorm p R)^2/Z^2)^N*B q ≤ Cₛ*firstLogDensity J q.1*firstLogDensity J q.2.1*firstLogDensity J q.2.2) ∧ ‖secondExpansionSource p hp hcop hg F Ψ m 1 1 ray s (fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V) (fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V) W H‖ ≤ (C*H*primeProductNorm p R/Z^2*‖secondRayCoefficient ray‖*(secondLogK j*Real.exp 2)^ε)* (∫ t₁ : ℝ, ∫ t₂ : ℝ, ∫ t₃ : ℝ, B (t₁,t₂,t₃)* sourceGeometricMean p hp hcop hg F (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (m*r) (s.image (sourceObservation p)) (windows 5) (windows 6) X X (t₁,t₂,t₃)) := by obtain ⟨windows,C,Cₛ,hC,hCₛ,hwc,hws,hwb,ht⟩ := initial_sector_transfer_radius U hUc hUs g W A hA hU hgA ε hε N J refine ⟨windows,C,Cₛ,hC,hCₛ,hwc,hws,hwb,?_⟩ intro ι _ p hp _ hcop hg hinj hc hpr F R Ψ m ray K Z H M j s hZ hH hΨ hsub dsimp only let r := primeSubsetGenerator (fun i => Ideal.span {p i}) R let X := initialLogColumn Z (primeProductNorm p R) j have hR : 0 < primeProductNorm p R := FirstPassCubeLabels.primeProductNorm_pos p hp R have hX : 0 < X := div_pos hZ (mul_pos (mul_pos (normLogScale_pos _) (normLogScale_pos _)) hR) have hs : ∀ x ∈ s, InSecondQuotientSector p r x := by intro x hx exact secondExpansionSector_valid p F (fun G E => (K G E).erase 0) R x (secondLogSector_subset p ∅ F K R Z M j (hsub hx)) have hk : ∀ x ∈ s, x.frequency ≠ 0 := by intro x hx exact (secondSupportedSector_mem p F K R Z M x (Finset.mem_filter.mp (hsub hx)).1).2.2.2.1 have hcoords := initial_sector_coordinates p hp F R K Z M hZ j obtain ⟨B,hB,hdec,hbound⟩ := ht p hp hcop hg hinj hc hpr F Ψ m r ray s Z H (secondLogE j) (secondLogV j) X (secondLogK j) hZ hH (normLogScale_pos _) (normLogScale_pos _) hX (normLogScale_pos _) hΨ hs hk (fun x hx => (hcoords x (hsub hx)).1) (fun x hx => (hcoords x (hsub hx)).2.1) (fun x hx => (hcoords x (hsub hx)).2.2.1) (fun x hx => (hcoords x (hsub hx)).2.2.2) refine ⟨B,hB,?_,?_⟩ · simpa only [X, initial_log_radial Z H (primeProductNorm p R) hZ.ne' hR.ne'] using hdec · simpa only [r, elementNorm, primeSubsetGenerator_norm_eq_productNorm] using hbound end section open ActualEisensteinCubic open SecondPassArithmetic theorem initial_source_target_coprime {ι : Type*} [DecidableEq ι] (p : ι→ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (bad : Ideal ActualEisensteinCubic.O) (hbad : ∀i,IsCoprime (Ideal.span {p i}) bad) (s : Finset (SecondExpansionData ι)) : ∀z∈sourceIdealTarget (s.image (sourceObservation p)),IsCoprime z.1 bad := by intro z hz obtain ⟨y,hy,rfl⟩:=Finset.mem_image.mp hz obtain ⟨x,hx,rfl⟩:=Finset.mem_image.mp hy change IsCoprime (Ideal.span {(sourceObservation p x).2}) bad rw [sourceLabel_span] exact (IsCoprime.prod_left (fun i _=>hbad i)).mul_left (IsCoprime.prod_left (fun i _=>hbad i)) end open MeasureTheory open scoped BigOperators Classical ContDiff open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm firstLogDensity) theorem HasInitialCanonicalDensityAtRadius.retained_density {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (hcan : HasInitialCanonicalDensityAtRadius χ S hbad) (a b σ θ ν η : ℝ) (hσ : 0 ≤ σ) (hν : 0 < ν) (hη : 0 < η) (hmargin : ν+θ ≤ σ-(1 : ℝ)/20) (A : ℝ) (hA : 0≤A) : ∃ J : ℕ,∀ V₁ V₂ : ℝ → ℂ,HasCompactSupport V₁ → HasCompactSupport V₂ → ContDiff ℝ ∞ V₁ → ContDiff ℝ ∞ V₂ → (∀s,V₁ s≠0→|s|≤A) → (∀s,V₂ s≠0→|s|≤A) → ∃ (C Cpool : ℝ) (E : ℕ),0 < C ∧ 1 ≤ Cpool ∧ 20 ≤ E ∧ ∀ (D : ℕ) (Z : ℝ) (R : Finset (OutsidePrimeIndex S D)) (ray : SecondRayIndex) (j : SecondLogIndex) (T : Finset (Ideal ActualEisensteinCubic.O × ActualEisensteinCubic.O)), 1 ≤ Z → Cpool*Z^E ≤ D → R ∈ boundedPrimeSupports (outsidePrime S D) Finset.univ (Z*Real.exp (initialErrorWindow a b)) → j ∈ secondLogBinBox (Z*Real.exp (initialErrorWindow a b)) (initialErrorRowBound a b Z (Z^(1+σ))) → initialRadial Z (Z^(1+σ)) (primeProductNorm (outsidePrime S D) R) j ≤ Z^θ → (∀ z ∈ T,Admissible z.1 ∧ (Ideal.absNorm z.1 : ℝ) ≤ initialLogLabel j ∧ z.2 ≠ 0 ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ secondLogK j*Real.exp 2) → (∀z∈T,IsCoprime z.1 (∏P∈S,P)) → outsideCanonicalDensity χ S hbad D ray R T V₁ V₂ (initialLogColumn Z (primeProductNorm (outsidePrime S D) R) j) J ≤ C*Z^η*(initialLogColumn Z (primeProductNorm (outsidePrime S D) R) j*initialLogLabel j)^2 := by obtain ⟨J,hJ⟩ := hcan η hη 20 A hA refine ⟨J,?_⟩ intro V₁ V₂ hVc₁ hVc₂ hVs₁ hVs₂ hVrad₁ hVrad₂ obtain ⟨Cc,Cpool,E,hCc,hCpool,hPE,hcanonical⟩ := hJ V₁ V₂ hVc₁ hVc₂ hVs₁ hVs₂ hVrad₁ hVrad₂ obtain ⟨A,Vmax,hA,hVmax,hV₁,hV₂,hs₁,hs₂⟩ := initial_two_windows_bounded V₁ V₂ hVc₁ hVc₂ hVs₁.continuous hVs₂.continuous obtain ⟨Z0,hZ0,hthreshold⟩ := initial_large_threshold a b (initialExcludedNorm S) ν (initialExcludedNorm_ge_one S) hν let Ce := initialElementaryConstant A Vmax*(∫ t : ℝ,firstLogDensity 0 t)^3 let K0 := initialPolynomialCap a b*Z0^17*Real.exp 2 let C := Cc+Ce*(K0+1)+1 have hI : 0 ≤ ∫ t : ℝ,firstLogDensity 0 t := integral_nonneg (fun t => FirstPassCubeLabels.firstLogDensity_nonneg 0 t) have hCe : 0 ≤ Ce := mul_nonneg (initialElementaryConstant_nonneg A Vmax) (pow_nonneg hI _) have hcap := initialPolynomialCap_ge_one a b have hK0 : 0 ≤ K0 := by dsimp [K0]; positivity have hC : 0 < C := by dsimp [C]; positivity have hCcC : Cc ≤ C := by dsimp [C]; nlinarith have hCeC : Ce ≤ C := by dsimp [C]; nlinarith have hCeKC : Ce*K0 ≤ C := by dsimp [C]; nlinarith refine ⟨C,Cpool,E,hC,hCpool,hPE,?_⟩ intro D Z R ray j T hZ hpool hR hj hrad hT hTc let p := outsidePrime S D let hp := outsidePrime_ne_zero S hbad D let hcop := outsidePrime_coprime S hbad D let hg := outsidePrime_good S hbad D let := outsidePrime_maximal S hbad D let Ψ := conjugateMonoid (normCharacter χ) let X := initialLogColumn Z (primeProductNorm p R) j let lengthScale := initialLogLabel j let Kr := secondLogK j*Real.exp 2 have hZp := zero_lt_one.trans_le hZ have hH : 1 ≤ Z^(1+σ) := Real.one_le_rpow hZ (by linarith) have hB := primeProductNorm_ge_one p hp R have hBpos := zero_lt_one.trans_le hB have hX : 0 < X := initialLogColumn_pos Z _ j hZp hBpos have hL : 1 ≤ lengthScale := initialLogLabel_ge_one j have hKr : 1 ≤ Kr := one_le_mul_of_one_le_of_one_le (normLogScale_ge_one _) (Real.one_le_exp (by norm_num)) have hZη : 1 ≤ Z^η := Real.one_le_rpow hZ hη.le have hΨ : ∀ z,‖Ψ z‖ ≤ 1 := conjugateMonoid_norm_le_one (normCharacter χ) (normCharacter_norm_le_one χ) have hΨ₁ : ∀ z,‖secondRayMinus Ψ ray z‖ ≤ 1 := fun z => (secondRayMinus_norm_le Ψ ray z).trans (hΨ z) have hΨ₂ : ∀ z,‖secondRayPlus Ψ ray z‖ ≤ 1 := fun z => (secondRayPlus_norm_le Ψ ray z).trans (hΨ z) have hTb : ∀ z ∈ T,z.1 ≠ ⊥ ∧ (Ideal.absNorm z.1 : ℝ) ≤ lengthScale ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ Kr := by intro z hz exact ⟨(hT z hz).1.1,(hT z hz).2.1,(hT z hz).2.2.2⟩ have promote (d : ℝ) (hd : d ≤ C) (he : outsideCanonicalDensity χ S hbad D ray R T V₁ V₂ X J ≤ d*(X*lengthScale)^2) : outsideCanonicalDensity χ S hbad D ray R T V₁ V₂ X J ≤ C*Z^η*(X*lengthScale)^2 := he.trans (mul_le_mul_of_nonneg_right (hd.trans (le_mul_of_one_le_right hC.le hZη)) (sq_nonneg _)) by_cases hzlarge : Z0 ≤ Z · have hgeom := initial_large_bin_geometry p hp Finset.univ R a b Z σ θ ν (initialExcludedNorm S) j hZ (initialExcludedNorm_ge_one S) hR hj hσ hmargin (hthreshold Z hzlarge) hrad dsimp only at hgeom by_cases hxlarge : 1 ≤ X · exact (hcanonical D Z X lengthScale Kr R ray T hZ hpool hxlarge hL hKr hgeom.1 hgeom.2.1 hgeom.2.2.1 hgeom.2.2.2.1 hgeom.2.2.2.2.1 hgeom.2.2.2.2.2 hT hTc).trans (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hCcC (Real.rpow_nonneg hZp.le _)) (sq_nonneg _)) · have hKL : Kr ≤ lengthScale := initial_subunit_row_le_label Z X lengthScale Kr (initialExcludedNorm S*primeProductNorm p R) ((1 : ℝ)/20) hZ (le_of_not_ge hxlarge) (zero_le_one.trans hL) (zero_le_one.trans hKr) (one_le_mul_of_one_le_of_one_le (initialExcludedNorm_ge_one S) hB) (by norm_num) (by simpa only [Kr,X,lengthScale,neg_div] using hgeom.2.2.2.2.2) apply promote Ce hCeC exact initial_subunit_density_bound p hp hcop hg (outsidePrime_odd S hbad D) (outsidePrime_injective S hbad D) Finset.univ (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) hΨ₁ hΨ₂ _ T V₁ V₂ X lengthScale Kr A Vmax J hX hL hKr hKL hA hVmax hV₁ hV₂ hs₁ hs₂ hTb · have hKmax := initialErrorRowBound_ge_one a b Z (Z^(1+σ)) hZ hH have hkr : Kr ≤ K0 := by have hbin := initial_bin_row_scale_le (Z*Real.exp (initialErrorWindow a b)) (initialErrorRowBound a b Z (Z^(1+σ))) hKmax j hj have hcapZ := (initial_actual_bin_polynomial_caps a b Z (Z^(1+σ)) hZ hH).2 have hpow : Z^17 ≤ Z0^17 := pow_le_pow_left₀ hZp.le (le_of_not_ge hzlarge) 17 calc Kr ≤ (initialPolynomialCap a b*Z^17)*Real.exp 2 := mul_le_mul_of_nonneg_right (hbin.trans hcapZ) (Real.exp_pos _).le _ ≤ K0 := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hpow (zero_le_one.trans hcap)) (Real.exp_pos _).le apply promote (Ce*Kr) ((mul_le_mul_of_nonneg_left hkr hCe).trans hCeKC) exact initial_density_elementary_squared_mass p hp hcop hg (outsidePrime_odd S hbad D) (outsidePrime_injective S hbad D) Finset.univ (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) hΨ₁ hΨ₂ _ T V₁ V₂ X lengthScale Kr A Vmax J hX hL hKr hA hVmax hV₁ hV₂ hs₁ hs₂ hTb end InitialMeanSquare open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff namespace InitialMeanSquare open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm firstLogDensity normalizedColumn columnLog) theorem HasInitialCanonicalDensityAtRadius.retained_source {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀P∈S,Prime P) (hcan : HasInitialCanonicalDensityAtRadius χ S hbad) (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g W : 𝓢(ℝ,ℂ)) (a b σ θ ν η : ℝ) (hU : ∀ t,g t ≠ 0 → U t=1) (hgs : ∀ t,g t ≠ 0 → |t| ≤ initialErrorWindow a b) (hσ : 0 ≤ σ) (hν : 0 < ν) (hη : 0 < η) (hmargin : ν+θ ≤ σ-(1 : ℝ)/20) : ∃ (C Cpool : ℝ) (E : ℕ),0 < C ∧ 1 ≤ Cpool ∧ 20 ≤ E ∧ ∀ (D : ℕ) (Z : ℝ),1 ≤ Z → Cpool*Z^E ≤ D → let p := outsidePrime S D let hp := outsidePrime_ne_zero S hbad D let hcop := outsidePrime_coprime S hbad D let hg := outsidePrime_good S hbad D letI := outsidePrime_maximal S hbad D let Ψ := conjugateMonoid (normCharacter χ) let H := Z^(1+σ) let G := fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V let K := fun (_ _ : Finset (OutsidePrimeIndex S D)) => initialErrorCutoff a b Z H letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype (∑ ray : SecondRayIndex,∑ R ∈ boundedPrimeSupports p Finset.univ (Z*Real.exp (initialErrorWindow a b)), ∑ j ∈ secondLogBinBox (Z*Real.exp (initialErrorWindow a b)) (initialErrorRowBound a b Z H), if initialRadial Z H (primeProductNorm p R) j ≤ Z^θ then ‖secondExpansionSource p hp hcop hg Finset.univ Ψ 1 1 1 ray (initialSquarefreeSector p (secondLogSector p ∅ Finset.univ K R Z (initialErrorWindow a b) j)) G G W H‖ else 0) ≤ C*H*Z^(35*η) := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype obtain ⟨J,hJ⟩ := HasInitialCanonicalDensityAtRadius.retained_density χ S hbad hcan a b σ θ ν η hσ hν hη hmargin (initialErrorWindow a b+2+1) (by unfold initialErrorWindow; positivity) have hM : 0 ≤ initialErrorWindow a b := by unfold initialErrorWindow; positivity obtain ⟨windows,Ct,Cs,hCt,hCs,hwc,hws,hwb,ht⟩ := initial_subbin_transfer_radius U hUc hUs g W (initialErrorWindow a b) hM hU hgs η hη 0 (2*J) obtain ⟨Ce,Cpool,E,hCe,hCpool,hPE,henergy⟩ := hJ (windows 5) (windows 6) (hwc 5) (hwc 6) (hws 5) (hws 6) (hwb 5) (hwb 6) obtain ⟨Cl,hCl,hlog⟩ := initial_row_log_budget η (initialPolynomialCap a b) hη (initialPolynomialCap_ge_one a b) let C0 := Ct*Real.exp 4*Ce*Cs*initialRayMass*Cl have hray := initialRayMass_nonneg have hC0 : 0 ≤ C0 := by dsimp [C0]; positivity refine ⟨C0+1,Cpool,E,by linarith,hCpool,hPE,?_⟩ intro D Z hZ hpool dsimp only let p := outsidePrime S D let hp := outsidePrime_ne_zero S hbad D let hcop := outsidePrime_coprime S hbad D let hg := outsidePrime_good S hbad D let := outsidePrime_maximal S hbad D let Ψ := conjugateMonoid (normCharacter χ) let H := Z^(1+σ) let M := initialErrorWindow a b let K := fun (_ _ : Finset (OutsidePrimeIndex S D)) => initialErrorCutoff a b Z H let Kmax := initialErrorRowBound a b Z H let G := fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V let s := fun (R : Finset (OutsidePrimeIndex S D)) (j : SecondLogIndex) => initialSquarefreeSector p (secondLogSector p ∅ Finset.univ K R Z M j) have hZp := zero_lt_one.trans_le hZ have hH : 1 ≤ H := Real.one_le_rpow hZ (by linarith) have hHp := zero_lt_one.trans_le hH have hΨ : ∀ z,‖Ψ z‖ ≤ 1 := conjugateMonoid_norm_le_one (normCharacter χ) (normCharacter_norm_le_one χ) have hKmax : 1 ≤ Kmax := initialErrorRowBound_ge_one a b Z H hZ hH let B : SecondRayIndex → Finset (OutsidePrimeIndex S D) → SecondLogIndex → Frequency → ℝ := fun ray R j => Classical.choose (ht p hp hcop hg (outsidePrime_injective S hbad D) (outsidePrime_odd S hbad D) (outsidePrime_primary S hbad D) Finset.univ R Ψ 1 ray K Z H M j (s R j) hZp hHp hΨ (Finset.filter_subset _ _)) have hB (ray : SecondRayIndex) (R : Finset (OutsidePrimeIndex S D)) (j : SecondLogIndex) := Classical.choose_spec (ht p hp hcop hg (outsidePrime_injective S hbad D) (outsidePrime_odd S hbad D) (outsidePrime_primary S hbad D) Finset.univ R Ψ 1 ray K Z H M j (s R j) hZp hHp hΨ (Finset.filter_subset _ _)) let d := H*Real.exp 4*(Ce*Z^η)*Cs*(Kmax*Real.exp 2)^η have hd : 0 ≤ d := by dsimp [d]; positivity have hterm (ray : SecondRayIndex) (R : Finset (OutsidePrimeIndex S D)) (hR : R ∈ boundedPrimeSupports p Finset.univ (Z*Real.exp M)) (j : SecondLogIndex) (hj : j ∈ secondLogBinBox (Z*Real.exp M) Kmax) (hlow : initialRadial Z H (primeProductNorm p R) j ≤ Z^θ) : initialSquarefreeBinCost p hp hcop hg Finset.univ R Ψ 1 ray K Z H M η j windows (B ray R j) ≤ d/primeProductNorm p R*‖secondRayCoefficient ray‖ := by have hT := initial_squarefree_target_geometry p hp hg (outsidePrime_odd S hbad D) Finset.univ R K Z M j have hTe : ∀ z ∈ sourceIdealTarget ((s R j).image (sourceObservation p)), Admissible z.1 ∧ (Ideal.absNorm z.1 : ℝ) ≤ initialLogLabel j ∧ z.2 ≠ 0 ∧ ‖ConcreteTraceCRT.eisEmbedding z.2‖^2 ≤ secondLogK j*Real.exp 2 := by intro z hz exact ⟨(hT z hz).1,(hT z hz).2.1,(hT z hz).2.2.1,(hT z hz).2.2.2.trans (mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (by norm_num)) (normLogScale_pos _).le)⟩ have hTc := initial_source_target_coprime p (∏P∈S,P) (CanonicalRowCompletion.outside_pool_coprime_excluded S D hbad hSp) (s R j) have he := henergy D Z R ray j _ hZ hpool hR hj hlow hTe hTc have he' : densityChildEnergy p hp hcop hg Finset.univ (secondRayMinus Ψ ray) (secondRayPlus Ψ ray) (1*primeSubsetGenerator (fun i => Ideal.span {p i}) R) (sourceIdealTarget ((s R j).image (sourceObservation p))) (windows 5) (windows 6) (initialLogColumn Z (primeProductNorm p R) j) (initialLogColumn Z (primeProductNorm p R) j) (2*J) ≤ (Ce*Z^η)*(initialLogColumn Z (primeProductNorm p R) j*initialLogLabel j)^2 := by simpa only [outsideCanonicalDensity,one_mul] using he exact initial_bin_cost_uniform p hp hcop hg Finset.univ R Ψ 1 ray K Z H M Kmax η Cs (Ce*Z^η) hZp hHp hKmax hη.le hCs (by positivity) j hj windows (B ray R j) (2*J) 0 (hB ray R j).1 (hB ray R j).2.1 he' have hsum : (∑ ray : SecondRayIndex,∑ R ∈ boundedPrimeSupports p Finset.univ (Z*Real.exp M), ∑ j ∈ secondLogBinBox (Z*Real.exp M) Kmax, if initialRadial Z H (primeProductNorm p R) j ≤ Z^θ then ‖secondExpansionSource p hp hcop hg Finset.univ Ψ 1 1 1 ray (s R j) G G W H‖ else 0) ≤ Ct*(d*initialRayMass*((secondLogBinBox (Z*Real.exp M) Kmax).card : ℝ)* (128*Real.exp 1*(normLogBin (Z*Real.exp M)+1 : ℝ))) := by apply le_trans _ (mul_le_mul_of_nonneg_left (initial_harmonic_aggregation p (outsidePrime_injective S hbad D) Finset.univ (Z*Real.exp M) Kmax d hd (fun ray R j => if initialRadial Z H (primeProductNorm p R) j ≤ Z^θ then initialSquarefreeBinCost p hp hcop hg Finset.univ R Ψ 1 ray K Z H M η j windows (B ray R j) else 0) (by intro ray R hR j hj split_ifs with hlow · exact hterm ray R hR j hj hlow · have hRp := FirstPassCubeLabels.primeProductNorm_pos p hp R positivity)) hCt) simp only [Finset.mul_sum] apply Finset.sum_le_sum intro ray hray apply Finset.sum_le_sum intro R hR apply Finset.sum_le_sum intro j hj split_ifs with hlow · convert (hB ray R j).2.2 using 1 <;> first | rfl | ((try dsimp only [initialSquarefreeBinCost,s,G,B]); ring) · simp have hlogBound := hlog Z (Z*Real.exp M) Kmax hZ (by positivity) (zero_lt_one.trans_le hKmax) (initial_actual_bin_polynomial_caps a b Z H hZ hH).1 (initial_actual_bin_polynomial_caps a b Z H hZ hH).2 calc _ ≤ Ct*(d*initialRayMass*((secondLogBinBox (Z*Real.exp M) Kmax).card : ℝ)* (128*Real.exp 1*(normLogBin (Z*Real.exp M)+1 : ℝ))) := hsum _ = (Ct*Real.exp 4*Ce*Cs*initialRayMass)*H*Z^η* ((Kmax*Real.exp 2)^η*((secondLogBinBox (Z*Real.exp M) Kmax).card : ℝ)* (128*Real.exp 1*(normLogBin (Z*Real.exp M)+1 : ℝ))) := by dsimp [d]; ring _ ≤ (Ct*Real.exp 4*Ce*Cs*initialRayMass)*H*Z^η*(Cl*Z^(34*η)) := mul_le_mul_of_nonneg_left hlogBound (by positivity) _ = C0*H*Z^(35*η) := by rw [show 35*η=η+34*η by ring,Real.rpow_add hZp] dsimp [C0] ring _ ≤ (C0+1)*H*Z^(35*η) := by gcongr linarith end InitialMeanSquare end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.MeanSquare.ThetaDensity namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace InitialMeanSquare section open MeasureTheory open scoped BigOperators Classical SchwartzMap ContDiff open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve open SecondPassArithmetic SecondPassIntegration JointLogSeparation open FirstPassCubeLabels (primeProductNorm normalizedColumn columnLog) theorem HasInitialCanonicalDensityAtRadius.nonzero_source_bound {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀P∈S,Prime P) (hcan : HasInitialCanonicalDensityAtRadius χ S hbad) (U : ℝ → ℂ) (hUc : HasCompactSupport U) (hUs : ContDiff ℝ ∞ U) (g W : 𝓢(ℝ,ℂ)) (a b σ ε : ℝ) (hU : ∀ t,g t ≠ 0 → U t=1) (hgs : ∀ t,g t ≠ 0 → |t| ≤ initialErrorWindow a b) (hσ : (1 : ℝ)/20 < σ) (hε : 0 < ε) : ∃ (C Cpool : ℝ) (E : ℕ),0 < C ∧ 1 ≤ Cpool ∧ 20 ≤ E ∧ ∀ (D : ℕ) (Z : ℝ),1 ≤ Z → Cpool*Z^E ≤ D → let p := outsidePrime S D let hp := outsidePrime_ne_zero S hbad D let hg := outsidePrime_good S hbad D let hinj := outsidePrime_injective S hbad D letI := outsidePrime_maximal S hbad D let Ψ := conjugateMonoid (normCharacter χ) let H := Z^(1+σ) ‖truncatedSecondSource p hp hg hinj Finset.univ Ψ 1 1 1 (fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V) W H (fun _ _ => (initialErrorCutoff a b Z H).erase 0)‖ ≤ C*H*Z^ε := by letI importedWitness0 := @OAI.RayFourExpansion.rayCharacterFintype let η := min 1 (ε/100) let ν := (σ-(1 : ℝ)/20)/3 have hη : 0 < η := lt_min zero_lt_one (by positivity) have hη1 : η ≤ 1 := min_le_left _ _ have hηε : 35*η ≤ ε := by have hh : η ≤ ε/100 := min_le_right _ _ linarith have hν : 0 < ν := by dsimp [ν]; linarith have hσ0 : 0 ≤ σ := by linarith have hmargin : ν+ν ≤ σ-(1 : ℝ)/20 := by dsimp [ν]; linarith obtain ⟨Cl,Cpool,E,hCl,hCpool,hPE,hlow⟩ := HasInitialCanonicalDensityAtRadius.retained_source χ S hbad hSp hcan U hUc hUs g W a b σ ν ν η hU hgs hσ0 hν hη hmargin obtain ⟨Ch,hCh,hhigh⟩ := initial_high_radial_source U hUc hUs g W a b ν 1 η hU hgs hν hη hη1 refine ⟨Cl+Ch,Cpool,E,by positivity,hCpool,hPE,?_⟩ intro D Z hZ hpool dsimp only let p := outsidePrime S D let hp := outsidePrime_ne_zero S hbad D let hcop := outsidePrime_coprime S hbad D let hg := outsidePrime_good S hbad D let hinj := outsidePrime_injective S hbad D let := outsidePrime_maximal S hbad D let Ψ := conjugateMonoid (normCharacter χ) let H := Z^(1+σ) let M := initialErrorWindow a b let K := fun (_ _ : Finset (OutsidePrimeIndex S D)) => initialErrorCutoff a b Z H let Kmax := initialErrorRowBound a b Z H let G := fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V let s := fun (R : Finset (OutsidePrimeIndex S D)) (j : SecondLogIndex) => initialSquarefreeSector p (secondLogSector p ∅ Finset.univ K R Z M j) let f := fun (ray : SecondRayIndex) (R : Finset (OutsidePrimeIndex S D)) (j : SecondLogIndex) => ‖secondExpansionSource p hp hcop hg Finset.univ Ψ 1 1 1 ray (s R j) G G W H‖ let Lsum := ∑ ray : SecondRayIndex,∑ R ∈ boundedPrimeSupports p Finset.univ (Z*Real.exp M), ∑ j ∈ secondLogBinBox (Z*Real.exp M) Kmax, if initialRadial Z H (primeProductNorm p R) j ≤ Z^ν then f ray R j else 0 let Hsum := ∑ ray : SecondRayIndex,∑ R ∈ boundedPrimeSupports p Finset.univ (Z*Real.exp M), ∑ j ∈ secondLogBinBox (Z*Real.exp M) Kmax, if Z^ν < initialRadial Z H (primeProductNorm p R) j then f ray R j else 0 have hZp := zero_lt_one.trans_le hZ have hH : 1 ≤ H := Real.one_le_rpow hZ (by linarith) have hHp := zero_lt_one.trans_le hH have hΨ : ∀ z,‖Ψ z‖ ≤ 1 := conjugateMonoid_norm_le_one (normCharacter χ) (normCharacter_norm_le_one χ) have hL : Lsum ≤ Cl*H*Z^(35*η) := hlow D Z hZ hpool have hHi : Hsum ≤ Ch*Z^(-(1 : ℝ)) := hhigh p hp hcop hg hinj (outsidePrime_odd S hbad D) (outsidePrime_primary S hbad D) Finset.univ Ψ 1 Z H hZ hH hΨ (fun _ R j => s R j) (fun _ _ _ => Finset.filter_subset _ _) have hrow : ∀ R ∈ (Finset.univ : Finset (OutsidePrimeIndex S D)).powerset, ∀ x ∈ secondSupportedSector p Finset.univ K R Z M,elementNorm (sourceObservation p x).1 ≤ Kmax := by intro R hR x hx exact initialErrorRowBound_valid p hp Finset.univ R a b Z H hZp hHp x hx have htotal := initial_nonzero_source_norm_le_squarefree_bins p hp hcop hg hinj (outsidePrime_odd S hbad D) (outsidePrime_primary S hbad D) Finset.univ Ψ 1 g W Z H M Kmax hZp hgs K hrow have hpart : (∑ ray : SecondRayIndex,∑ R ∈ boundedPrimeSupports p Finset.univ (Z*Real.exp M), ∑ j ∈ secondLogBinBox (Z*Real.exp M) Kmax,f ray R j)=Lsum+Hsum := by dsimp only [Lsum,Hsum] simp only [←Finset.sum_add_distrib] apply Finset.sum_congr rfl intro ray hray apply Finset.sum_congr rfl intro R hR apply Finset.sum_congr rfl intro j hj by_cases hh : initialRadial Z H (primeProductNorm p R) j ≤ Z^ν · rw [if_pos hh,if_neg (not_lt.mpr hh),add_zero] · rw [if_neg hh,if_pos (lt_of_not_ge hh),zero_add] have hpower : Z^(35*η) ≤ Z^ε := Real.rpow_le_rpow_of_exponent_le hZ hηε have hsmall : Z^(-(1 : ℝ)) ≤ H*Z^ε := by have h1 : Z^(-(1 : ℝ)) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hZ (by norm_num) exact h1.trans (one_le_mul_of_one_le_of_one_le hH (Real.one_le_rpow hZ hε.le)) calc _ ≤ ∑ ray : SecondRayIndex,∑ R ∈ boundedPrimeSupports p Finset.univ (Z*Real.exp M), ∑ j ∈ secondLogBinBox (Z*Real.exp M) Kmax,f ray R j := htotal _ = Lsum+Hsum := hpart _ ≤ Cl*H*Z^(35*η)+Ch*Z^(-(1 : ℝ)) := add_le_add hL hHi _ ≤ Cl*H*Z^ε+Ch*(H*Z^ε) := add_le_add (mul_le_mul_of_nonneg_left hpower (mul_nonneg hCl.le hHp.le)) (mul_le_mul_of_nonneg_left hsmall hCh.le) _ = (Cl+Ch)*H*Z^ε := by ring end section open ActualEisensteinCubic ConcretePrimeRowBridge CanonicalQuadraticSieve SecondPassArithmetic SecondPassIntegration open FirstPassCubeLabels (normalizedColumn columnLog) theorem outside_mean_square_of_canonical_density_at_radius {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes ⊆ S) (hSp : ∀ P ∈ S,Prime P) (hcan : HasInitialCanonicalDensityAtRadius χ S hbad) (W : ℝ → ℂ) (a b : ℝ) (ha : 0 < a) (hs : Function.support W ⊆ Set.Icc a b) (hW : ContDiff ℝ ∞ W) (σ ε : ℝ) (hσ : (1 : ℝ)/20 < σ) (hε : 0 < ε) : ∃ C : ℝ,0 < C ∧ ∀ (D : ℕ) (Z : ℝ),1 ≤ Z → b*Z ≤ D → ∀ T : Finset ActualEisensteinCubic.O, (∀ z ∈ T,(Ideal.absNorm (Ideal.span {z}) : ℝ) ≤ Z^(1+σ)) → (∀ z ∈ T,z ≠ 0) → (∑ z ∈ T,‖idealRowSum (outsideIdealsUpTo S D) (outsideIdealsUpTo_ne_bot S D) (outside_good S D hbad) χ (fun n => W (n/Z)) z‖^2) ≤ C*Z*(Z^(1+σ))*Z^ε := by let g0 := initialLogProfile W a b ha hs hW let g := conjugateProfile g0 let M := initialErrorWindow a b have hM : 0 ≤ M := by dsimp [M,initialErrorWindow]; positivity have hg0 : ∀ t,g0 t ≠ 0 → |t| ≤ M := initialLogProfile_support W a b ha hs hW have hg : ∀ t,g t ≠ 0 → |t| ≤ M := conjugateProfile_support_bound g0 M hg0 obtain ⟨U,hUc,hUs,hUeq,hUsupp,hUzero⟩ := FourierBridge.exists_complex_smooth_cutoff M hM have hU : ∀ t,g t ≠ 0 → U t=1 := fun t ht => hUeq t (hg t ht) obtain ⟨Cs,Cpool,E,hCs,hCpool,hE,hsource⟩ := HasInitialCanonicalDensityAtRadius.nonzero_source_bound χ S hbad hSp hcan U hUc hUs g rowMajorant a b σ ε hU hg hσ hε obtain ⟨Ce,hCe,herrors⟩ := outside_mean_square_source_with_errors W a b ha hs hW refine ⟨Cs+Ce,by positivity,?_⟩ intro D Z hZ hD T hT hT0 let Db : ℕ := max D ⌈Cpool*Z^E⌉₊ have hDDb : D ≤ Db := le_max_left _ _ have hpool : Cpool*Z^E ≤ (Db : ℝ) := (Nat.le_ceil _).trans (by exact_mod_cast le_max_right D ⌈Cpool*Z^E⌉₊) have hDb : b*Z ≤ (Db : ℝ) := hD.trans (by exact_mod_cast hDDb) let p := outsidePrime S Db let hp := outsidePrime_ne_zero S hbad Db let hg := outsidePrime_good S hbad Db let hinj := outsidePrime_injective S hbad Db let := outsidePrime_maximal S hbad Db let Ψ := conjugateMonoid (normCharacter χ) let H := Z^(1+σ) let G := fun V => normalizedColumn p (fun T => g0 (columnLog p Z T)) V let MS := ∑ z ∈ T,‖idealRowSum (outsideIdealsUpTo S Db) (outsideIdealsUpTo_ne_bot S Db) (outside_good S Db hbad) χ (fun n => W (n/Z)) z‖^2 have hZp := zero_lt_one.trans_le hZ have hH : 1 ≤ H := Real.one_le_rpow hZ (by linarith) have hHp := zero_lt_one.trans_le hH have hεZ : 1 ≤ Z^ε := Real.one_le_rpow hZ hε.le have he := herrors χ S Db hbad hSp Z H hZp hHp hDb T hT hT0 have hsrc := hsource Db Z hZ hpool have hstar : (fun V => star (G V)) = (fun V => normalizedColumn p (fun T => g (columnLog p Z T)) V) := by funext V exact star_normalizedColumn p g0 Z V have hsrc' : ‖truncatedSecondSource p hp hg hinj Finset.univ Ψ 1 1 1 (fun V => star (G V)) rowMajorant H (fun _ _ => (initialErrorCutoff a b Z H).erase 0)‖ ≤ Cs*H*Z^ε := by rw [hstar] exact hsrc change MS/Z ≤ ‖truncatedSecondSource p hp hg hinj Finset.univ Ψ 1 1 1 (fun V => star (G V)) rowMajorant H (fun _ _ => (initialErrorCutoff a b Z H).erase 0)‖+Ce*H-‖G ∅‖^2 at he have herr : Ce*H ≤ Ce*H*Z^ε := le_mul_of_one_le_right (mul_nonneg hCe.le hHp.le) hεZ have hnorm : MS/Z ≤ (Cs+Ce)*H*Z^ε := by nlinarith [sq_nonneg ‖G ∅‖] have hfinal := (div_le_iff₀ hZp).mp hnorm have hMS : (∑ z ∈ T,‖idealRowSum (outsideIdealsUpTo S D) (outsideIdealsUpTo_ne_bot S D) (outside_good S D hbad) χ (fun n => W (n/Z)) z‖^2)=MS := by apply Finset.sum_congr rfl intro z hz rw [outside_row_cutoff_stable S hbad hDDb χ W b Z hZp (fun t ht => (hs ht).2) hD z] rw [hMS] convert hfinal using 1 <;> first | rfl | ((try dsimp only [H]); ring) end open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open CanonicalRowCompletion theorem outside_mean_square_of_theta_models {q₀ : ℕ} (χ : DirichletCharacter ℂ q₀) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes⊆S) (hSp : ∀P∈S,Prime P) (ρ q levelBound : ℝ) (hρ : 0<ρ) (hq : 1W (n/Z)) z‖^2)≤C*Z*(Z^(1+σ))*Z^ε := outside_mean_square_of_canonical_density_at_radius χ S hbad hSp (hasInitialCanonicalDensityAtRadius_of_theta χ S hSp hbad ρ q levelBound hρ hq hlevel hmodels) W a b ha hs hW σ ε hσ hε end InitialMeanSquare namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff MatrixGroups lemma cuspBarrierField_local_model (p : SpatialCoordinates) (hp : 0

1)) ∨ ∃x : FullCuspClasses,1 1+cuspBarrierProfile 2 3 (rowHeight (fullCuspRow x) q)) := by by_cases hx : ∃x : FullCuspClasses,1 cuspBarrierProfile_zero 2 3 (by norm_num) v (by linarith)) _ x (by rwa [←fullCuspRow_height x q hpos]),←fullCuspRow_height x q hpos] · left obtain ⟨T,hT⟩ := fullCuspRows_locally_finite p hp have hsmall : ∀ᶠq in 𝓝 p,∀x∈T,rowHeight (fullCuspRow x) q<2 := by rw [eventually_all_finset] intro x hxT apply (rowHeight_contDiffAt _ (fullCuspRow_ne_zero x) p hp).continuousAt.eventually_lt_const have hn : rowHeight (fullCuspRow x) p≤1 := not_lt.mp (fun h => hx ⟨x,h⟩) linarith filter_upwards [hT,hsmall] with q hq hqT change 1+fullCuspProfileField (cuspBarrierProfile 2 3) q=1 have hz : ∀x : FullCuspClasses,cuspBarrierProfile 2 3 (rowHeight (fullCuspRow x) q)=0 := by intro x apply cuspBarrierProfile_zero 2 3 (by norm_num) by_cases hmem : x∈T · exact (hqT x hmem).le · exact (hq x hmem).le.trans (by norm_num) simp only [fullCuspProfileField,hz,tsum_zero,add_zero] lemma cuspBarrierProfile_log_derivative_bound : ∃D : ℝ,0≤D ∧ ∀v : ℝ,1 ?_⟩ by_cases hhigh : 3 x-1) := by filter_upwards [Ioi_mem_nhds hhigh] with x hx rw [cuspBarrierProfile,cuspTransition_one 2 3 x (by norm_num) hx.le,one_mul] have hder : deriv (cuspBarrierProfile 2 3) v=1 := by rw [he.deriv_eq]; simp rw [hder,mul_one,abs_of_pos (by linarith),he.self_of_nhds] have h := mul_le_mul_of_nonneg_right (le_max_left 1 (3*max C 0)) (show 0≤v by linarith) dsimp only [D] nlinarith · have hCv : |deriv (cuspBarrierProfile 2 3) v|≤ max C 0 := (hC (Set.mem_image_of_mem _ (show v∈Set.Icc (1:ℝ) 3 from ⟨hv.le,not_lt.mp hhigh⟩))).trans (le_max_left _ _) have h1 : |v*deriv (cuspBarrierProfile 2 3) v|≤3*max C 0 := by rw [abs_mul,abs_of_pos (by linarith)] exact mul_le_mul (not_lt.mp hhigh) hCv (abs_nonneg _) (by positivity) have hphi := cuspBarrierProfile_nonneg 2 3 (by norm_num) (by norm_num) v exact (h1.trans (le_max_right _ _)).trans (by nlinarith) lemma cuspBarrierField_scaled_deriv_bound : ∃D : ℝ,0≤D ∧ ∀p : SpatialCoordinates,0

(cuspBarrierField 2 3 q:ℂ)) p j) (p j)‖≤ D*cuspBarrierField 2 3 p := by obtain ⟨D,hD,hbound⟩ := cuspBarrierProfile_log_derivative_bound refine ⟨D,hD,fun p hp j => ?_⟩ have ht : Tendsto (fun t => Function.update p j t) (𝓝 (p j)) (𝓝 p) := by simpa only [Function.update_eq_self] using ((continuous_axis_update p j).continuousAt (x := p j)).tendsto rcases cuspBarrierField_local_model p hp with hz | ⟨x,hx,he⟩ · have hzCast : (fun q => (cuspBarrierField 2 3 q:ℂ)) =ᶠ[𝓝 p] (fun _ => (1:ℂ)) := hz.mono (fun q hq => congrArg (fun v : ℝ => (v:ℂ)) hq) have hzC := hzCast.comp_tendsto ht change axisSlice (fun q => (cuspBarrierField 2 3 q:ℂ)) p j =ᶠ[𝓝 (p j)] (fun _ => (1:ℂ)) at hzC rw [hzC.deriv_eq,deriv_const,mul_zero,norm_zero,hz.self_of_nhds,mul_one] exact hD · have heCast : (fun q => (cuspBarrierField 2 3 q:ℂ)) =ᶠ[𝓝 p] (fun q => ((1+cuspBarrierProfile 2 3 (rowHeight (fullCuspRow x) q):ℝ):ℂ)) := he.mono (fun q hq => congrArg (fun v : ℝ => (v:ℂ)) hq) have heC := heCast.comp_tendsto ht change axisSlice (fun q => (cuspBarrierField 2 3 q:ℂ)) p j =ᶠ[𝓝 (p j)] (fun t => ((1+cuspBarrierProfile 2 3 (rowHeight (fullCuspRow x) (Function.update p j t)):ℝ):ℂ)) at heC rw [heC.deriv_eq] simp only [Complex.ofReal_add,Complex.ofReal_one] rw [deriv_const_add] have hpF := (rowProfile_axis_derivatives (fun v => (cuspBarrierProfile 2 3 v:ℂ)) (fun v hv => Complex.ofRealCLM.contDiff.contDiffAt.comp v (cuspBarrierProfile_smooth 2 3).contDiffAt) (fullCuspRow x) (fullCuspRow_ne_zero x) p hp j).1 change ‖(p 2:ℂ)*deriv (axisSlice (fun q => (cuspBarrierProfile 2 3 (rowHeight (fullCuspRow x) q):ℂ)) p j) (p j)‖≤_ rw [hpF.deriv,cast_profile_deriv _ ((cuspBarrierProfile_smooth 2 3).differentiable (by simp))] have hid : (p 2:ℂ)*(((deriv (cuspBarrierProfile 2 3) (rowHeight (fullCuspRow x) p):ℝ):ℂ)* (rowHeight (fullCuspRow x) p:ℂ)*(rowLogD (fullCuspRow x) p j:ℂ))= ((p 2*rowLogD (fullCuspRow x) p j:ℝ):ℂ)* ((rowHeight (fullCuspRow x) p*deriv (cuspBarrierProfile 2 3) (rowHeight (fullCuspRow x) p):ℝ):ℂ) := by push_cast ring rw [hid,norm_mul,Complex.norm_real,Complex.norm_real,Real.norm_eq_abs,Real.norm_eq_abs] apply (mul_le_of_le_one_left (abs_nonneg _) (rowLogD_hyperbolic_bound _ (fullCuspRow_ne_zero x) p hp j)).trans rw [he.self_of_nhds] exact hbound _ hx lemma kernelBarrier_scaled_fderiv_bound : ∃D : ℝ,0≤D ∧ ∀p : EuclideanSpatial,0

(kernelQuotientBarrier 2 3 (kernelEuclideanProjection q):ℂ)) p (euclideanCoordinateVector j)‖≤D*kernelQuotientBarrier 2 3 (kernelEuclideanProjection p) := by obtain ⟨D,hD,hbound⟩ := cuspBarrierField_scaled_deriv_bound refine ⟨D,hD,fun p hp j => ?_⟩ let f : EuclideanSpatial→ℂ := fun q => (kernelQuotientBarrier 2 3 (kernelEuclideanProjection q):ℂ) have hf : ∀q,0 Complex.ofRealCLM.contDiff.contDiffAt.comp q (cuspBarrier_euclidean_contDiffAt 2 3 (by norm_num) (by norm_num) q hq) have he : ∀q : SpatialCoordinates,0 kernelQuotientBarrier 2 3 (kernelEuclideanProjection q)) p (euclideanCoordinateVector j)|≤D*kernelQuotientBarrier 2 3 (kernelEuclideanProjection p) := by obtain ⟨D,hD,hbound⟩ := kernelBarrier_scaled_fderiv_bound refine ⟨D,hD,fun p hp j => ?_⟩ have hphi := (cuspBarrier_euclidean_contDiffAt 2 3 (by norm_num) (by norm_num) p hp).differentiableAt (by simp) have he := (Complex.ofRealCLM.hasFDerivAt.comp p hphi.hasFDerivAt).fderiv have hh := hbound p hp j change ‖(p 2:ℂ)*fderiv ℝ (Complex.ofRealCLM ∘ (fun q => cuspBarrier 2 3 (euclideanToHyperbolic q))) p (euclideanCoordinateVector j)‖≤_ at hh rw [he] at hh simpa only [ContinuousLinearMap.comp_apply,Complex.ofRealCLM_apply,←Complex.ofReal_mul, Complex.norm_real,Real.norm_eq_abs] using! hh lemma kernelExhaustionProfile_euler_bounded : ∃C : ℝ,0≤C ∧ ∀n : ℕ,∀v : ℝ,|v*deriv (kernelExhaustionProfile n) v|≤C := by obtain ⟨C,hC,hbound⟩ := cuspTransition_euler_bounded 1 2 (by norm_num) refine ⟨C,hC,fun n v => ?_⟩ let c : ℝ := (n:ℝ)+1 have hc : c≠0 := by dsimp [c]; positivity have hd := (hasDerivAt_const v (1:ℝ)).sub (((cuspTransition_contDiff 1 2).differentiable (by simp) (v/c)).hasDerivAt.comp v ((hasDerivAt_id v).div_const c)) change HasDerivAt (kernelExhaustionProfile n) (0-deriv (cuspTransition 1 2) (v/c)*(1/c)) v at hd rw [hd.deriv] have he : v*(0-deriv (cuspTransition 1 2) (v/c)*(1/c))= -(v/c*deriv (cuspTransition 1 2) (v/c)) := by ring rw [he,abs_neg] exact hbound (v/c) lemma kernelExhaustionCutoff_scaled_fderiv_bound : ∃C : ℝ,0≤C ∧ ∀n : ℕ,∀p : EuclideanSpatial,0

(kernelExhaustionCutoff n (kernelEuclideanProjection q):ℂ)) p (euclideanCoordinateVector j)‖≤C := by obtain ⟨D,hD,hgrad⟩ := kernelBarrier_scaled_real_fderiv_bound obtain ⟨B,hB,hprofile⟩ := kernelExhaustionProfile_euler_bounded refine ⟨D*B,mul_nonneg hD hB,fun n p hp j => ?_⟩ let phi : EuclideanSpatial→ℝ := fun q => kernelQuotientBarrier 2 3 (kernelEuclideanProjection q) have hphi : DifferentiableAt ℝ phi p := (cuspBarrier_euclidean_contDiffAt 2 3 (by norm_num) (by norm_num) p hp).differentiableAt (by simp) have hP := ((kernelExhaustionProfile_smooth n).differentiable (by simp) (phi p)).hasDerivAt have hd := (hP.ofReal_comp.hasFDerivAt.comp p hphi.hasFDerivAt).fderiv change ‖(p 2:ℂ)*fderiv ℝ ((fun v => (kernelExhaustionProfile n v:ℂ)) ∘ phi) p (euclideanCoordinateVector j)‖≤D*B rw [hd] change ‖(p 2:ℂ)*((fderiv ℝ phi p (euclideanCoordinateVector j):ℝ) • ((deriv (kernelExhaustionProfile n) (phi p):ℝ):ℂ))‖≤D*B rw [Complex.real_smul,←Complex.ofReal_mul,←Complex.ofReal_mul,Complex.norm_real,Real.norm_eq_abs] calc |p 2*(fderiv ℝ phi p (euclideanCoordinateVector j)*deriv (kernelExhaustionProfile n) (phi p))| = |p 2*fderiv ℝ phi p (euclideanCoordinateVector j)| *|deriv (kernelExhaustionProfile n) (phi p)| := by rw [←abs_mul]; congr 1; ring _ ≤ (D*phi p)*|deriv (kernelExhaustionProfile n) (phi p)| := mul_le_mul_of_nonneg_right (hgrad p hp j) (abs_nonneg _) _ = D*|phi p*deriv (kernelExhaustionProfile n) (phi p)| := by rw [abs_mul,abs_of_nonneg (le_trans zero_le_one (kernelQuotientBarrier_one_le 2 3 (by norm_num) (by norm_num) _))] ring _ ≤ D*B := mul_le_mul_of_nonneg_left (hprofile n (phi p)) hD end CubicEisenstein open scoped BigOperators Classical SchwartzMap namespace SixthPowerAverage open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O open EisensteinSchwartzPoisson hiding O open IdealMobiusDivisorSum hiding O open ConcreteTraceCRT ShortDraftHeckeBridge open QuadraticInitialBound hiding O def totientDensity (I : Ideal ActualEisensteinCubic.O) : ℂ := ∏ P ∈ primeSupport I, (1-(1:ℂ)/(Ideal.absNorm P:ℂ)) theorem idealSupport_card (F : Finset (Ideal ActualEisensteinCubic.O)) {I : Ideal ActualEisensteinCubic.O} (hI : I∈F) : (idealSupport F I).card=(primeSupport I).card := by rw [primeSupport,←idealSupport_image_eq_factors F hI] exact (Finset.card_image_iff.mpr (fun _ _ _ _ h => Subtype.val_injective h)).symm theorem idealSupport_density (F : Finset (Ideal ActualEisensteinCubic.O)) {I : Ideal ActualEisensteinCubic.O} (hI : I∈F) : (∏ i ∈ idealSupport F I, (1-(1:ℂ)/(Ideal.absNorm i.val:ℂ)))=totientDensity I := by rw [totientDensity, primeSupport, ←idealSupport_image_eq_factors F hI, Finset.prod_image] exact fun _ _ _ _ h => Subtype.val_injective h theorem idealSexticRow_sixth_mask (F : Finset (Ideal ActualEisensteinCubic.O)) (hF : ∀I∈F,I≠⊥) (hg : ∀I∈F,∀P∈UniqueFactorizationMonoid.normalizedFactors I,goodLambda∉P) (I : Ideal ActualEisensteinCubic.O) (b : ActualEisensteinCubic.O) : idealSexticRow F hF hg I (b^6)= rowCoprimeMask (fun i : primePool F => i.val) (idealSupport F I) b := by let : ∀i : primePool F,(i.val).IsMaximal := primePool_maximal F hF exact finiteSquarefreeRow_sixth_power _ _ _ _ theorem idealSexticRow_sixth_radial_summable (F : Finset (Ideal ActualEisensteinCubic.O)) (hF : ∀I∈F,I≠⊥) (hg : ∀I∈F,∀P∈UniqueFactorizationMonoid.normalizedFactors I,goodLambda∉P) (I : Ideal ActualEisensteinCubic.O) (V : 𝓢(ℝ,ℂ)) (Y : ℝ) (hY : 0 idealSexticRow F hF hg I (b^6)*V (‖eisEmbedding b‖^2/Y)) := by have hs : Summable (fun b : ActualEisensteinCubic.O => V (‖eisEmbedding b‖^2/Y)) := by simpa only [scaledRadialTest_apply] using (actual_eisenstein_summable_norm (scaledRadialTest V Y hY)).of_norm simp_rw [idealSexticRow_sixth_mask] apply (hs.indicator {b : ActualEisensteinCubic.O | ¬∃i∈idealSupport F I,b∈i.val}).congr intro b by_cases hb : ∃i∈idealSupport F I,b∈i.val · rw [Set.indicator_of_notMem (show b∉{b : ActualEisensteinCubic.O | ¬∃i∈idealSupport F I,b∈i.val} from fun hn=>hn hb)] simp only [rowCoprimeMask,if_pos hb,zero_mul] · rw [Set.indicator_of_mem hb] simp only [rowCoprimeMask,if_neg hb,one_mul] theorem idealSexticRow_sixth_average (F : Finset (Ideal ActualEisensteinCubic.O)) (hF : ∀I∈F,I≠⊥) (hg : ∀I∈F,∀P∈UniqueFactorizationMonoid.normalizedFactors I,goodLambda∉P) {I : Ideal ActualEisensteinCubic.O} (hI : I∈F) (V : 𝓢(ℝ,ℂ)) (Y : ℝ) (hY : 0 i.val) (idealSupport F I) V Y := by let : ∀i : primePool F,(i.val).IsMaximal := primePool_maximal F hF simp_rw [idealSexticRow_sixth_mask] rw [masked_principal_radial_poisson_zero_split _ Subtype.val_injective _ V Y hY, idealSupport_density F hI] theorem idealRowSum_sixth_average {q : ℕ} (F : Finset (Ideal ActualEisensteinCubic.O)) (hF : ∀I∈F,I≠⊥) (hg : ∀I∈F,∀P∈UniqueFactorizationMonoid.normalizedFactors I,goodLambda∉P) (χ : DirichletCharacter ℂ q) (W : ℕ→ℂ) (V : 𝓢(ℝ,ℂ)) (Y : ℝ) (hY : 0 i.val) (idealSupport F I) V Y := by have he (b : ActualEisensteinCubic.O) : V (‖eisEmbedding b‖^2/Y)*idealRowSum F hF hg χ W (b^6)= ∑I∈F,(baseChangeWeight χ I*W (Ideal.absNorm I))* (idealSexticRow F hF hg I (b^6)*V (‖eisEmbedding b‖^2/Y)) := by rw [idealRowSum,Finset.mul_sum] apply Finset.sum_congr rfl intro I hI ring simp_rw [he] rw [Summable.tsum_finsetSum (fun I _ => (idealSexticRow_sixth_radial_summable F hF hg I V Y hY).mul_left _)] simp_rw [tsum_mul_left] rw [show (∑I∈F,baseChangeWeight χ I*W (Ideal.absNorm I)* ∑'b : ActualEisensteinCubic.O,idealSexticRow F hF hg I (b^6)*V (‖eisEmbedding b‖^2/Y))= ∑I∈F,baseChangeWeight χ I*W (Ideal.absNorm I)* ((Y:ℂ)*paperRadialFourier V 0*totientDensity I+ maskedPrincipalRemainder (fun i : primePool F => i.val) (idealSupport F I) V Y) by apply Finset.sum_congr rfl intro I hI rw [idealSexticRow_sixth_average F hF hg hI V Y hY]] simp_rw [mul_add] rw [Finset.sum_add_distrib,Finset.mul_sum] congr 1 apply Finset.sum_congr rfl intro I hI ring theorem sixth_average_remainder_bound {q : ℕ} (F : Finset (Ideal ActualEisensteinCubic.O)) (hF : ∀I∈F,I≠⊥) (χ : DirichletCharacter ℂ q) (W : ℕ→ℂ) (V : 𝓢(ℝ,ℂ)) (Y : ℝ) (hY : 0 i.val) (idealSupport F I) V Y‖≤ ∑I∈F,‖W (Ideal.absNorm I)‖*(2:ℝ)^(primeSupport I).card*pvControl V := by let : ∀i : primePool F,(i.val).IsMaximal := primePool_maximal F hF apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro I hI have hr := maskedPrincipalRemainder_uniform (fun i : primePool F=>i.val) (idealSupport F I) V Y hY rw [idealSupport_card F hI] at hr rw [norm_mul,norm_mul] calc _≤(1*‖W (Ideal.absNorm I)‖)*((2:ℝ)^(primeSupport I).card*pvControl V) := mul_le_mul (mul_le_mul_of_nonneg_right (baseChangeWeight_norm_le_one χ I) (norm_nonneg _)) hr (norm_nonneg _) (by positivity) _=_ := by ring theorem sixth_power_fiber_card (s : Finset ActualEisensteinCubic.O) (z : ActualEisensteinCubic.O) : (s.filter (fun b=>b^6=z)).card≤6 := by calc _≤(Polynomial.nthRoots 6 z).toFinset.card := by apply Finset.card_le_card intro b hb exact Multiset.mem_toFinset.mpr ((Polynomial.mem_nthRoots (by norm_num : 0<6)).mpr (Finset.mem_filter.mp hb).2) _≤(Polynomial.nthRoots 6 z).card := Multiset.toFinset_card_le _ _≤6 := Polynomial.card_nthRoots 6 z theorem sixth_power_average_cauchy (s : Finset ActualEisensteinCubic.O) (V A : ActualEisensteinCubic.O→ℂ) (hV : ∀b∈s,‖V b‖≤1) : ‖∑b∈s,V b*A (b^6)‖^2≤ 6*s.card*∑z∈s.image (fun b=>b^6),‖A z‖^2 := by have hc := DescentWeightedCauchy.weighted_cauchy_sq s V (fun b=>A (b^6)) (fun _=>1) simp only [star_one,mul_one,norm_one,one_pow,mul_one] at hc have hp := DescentWeightedCauchy.weighted_energy_pushforward s (s.image (fun b=>b^6)) (fun b=>b^6) V A (fun _=>6) (fun b hb=>Finset.mem_image.mpr ⟨b,hb,rfl⟩) (by intro z hz calc _≤∑b∈s with b^6=z,(1:ℝ) := Finset.sum_le_sum (fun b hb=>hV b (Finset.mem_filter.mp hb).1) _=(s.filter (fun b=>b^6=z)).card := by simp _≤6 := by exact_mod_cast sixth_power_fiber_card s z) have hv : (∑b∈s,‖V b‖)≤ s.card := by simpa using Finset.sum_le_sum (fun b hb=>hV b hb) apply hc.trans calc _≤(∑z∈s.image (fun b=>b^6),6*‖A z‖^2)*(s.card:ℝ) := mul_le_mul hp hv (Finset.sum_nonneg (fun _ _=>norm_nonneg _)) (Finset.sum_nonneg (fun _ _=>by positivity)) _=_ := by rw [←Finset.mul_sum]; ring end SixthPowerAverage end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.SixthPowerAverage namespace OAI noncomputable section namespace SixthPowerAverage open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Metric open EisensteinSchwartzPoisson theorem exists_averaging_test : ∃V : 𝓢(ℝ,ℂ), (∀x,‖V x‖≤1) ∧ (Function.support (V:ℝ→ℂ)⊆Set.Icc ((1:ℝ)/2) 1) ∧ V 0=0 ∧ paperRadialFourier V 0≠0 := by let f : ContDiffBump ((3:ℝ)/4) := ⟨1/8,1/4,by norm_num,by norm_num⟩ let g : ℝ→ℂ := fun x=>(f x:ℂ) have hgs : ContDiff ℝ ∞ g := Complex.ofRealCLM.contDiff.comp f.contDiff have hsupport : Function.support g⊆Set.Icc ((1:ℝ)/2) 1 := by intro x hx have hf : f x≠0 := by simpa only [g,Function.mem_support,ne_eq,Complex.ofReal_eq_zero] using hx have hh : |x-(3:ℝ)/4|<1/4 := by have hi : x∈Function.support (f:ℝ→ℝ) := hf rw [f.support_eq] at hi simpa only [Metric.mem_ball,Real.dist_eq,f] using hi exact ⟨by linarith [(abs_lt.mp hh).1],by linarith [(abs_lt.mp hh).2]⟩ have hgc : HasCompactSupport g := HasCompactSupport.of_support_subset_isCompact isCompact_Icc hsupport let V : 𝓢(ℝ,ℂ) := hgc.toSchwartzMap hgs have hz : V 0=0 := by by_contra h have hh := (hsupport h).1 norm_num at hh refine ⟨V,?_,hsupport,hz,?_⟩ · intro x change ‖(f x:ℂ)‖≤1 rw [Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg f.nonneg] exact f.le_one · rw [paperRadialFourier_zero_eq_halfline] have he : (∫x : ℝ in Set.Ioi 0,(V x))=∫x : ℝ,(f x:ℂ) := by apply setIntegral_eq_integral_of_forall_compl_eq_zero intro x hx by_contra hn have hp := (hsupport hn).1 simp only [Set.mem_Ioi,not_lt] at hx linarith rw [he,integral_complex_ofReal] apply mul_ne_zero · apply div_ne_zero · exact mul_ne_zero (by norm_num) (by exact_mod_cast Real.pi_ne_zero) · exact_mod_cast (Real.sqrt_ne_zero'.mpr (by norm_num : (0:ℝ)<3)) · have hfint : Integrable (f:ℝ→ℝ) := f.continuous.integrable_of_hasCompactSupport f.hasCompactSupport have hfpos : 0 < ∫x : ℝ,f x := by apply (integral_pos_iff_support_of_nonneg f.nonneg' hfint).mpr rw [f.support_eq] exact measure_ball_pos volume _ f.rOut_pos exact_mod_cast hfpos.ne' end section open scoped BigOperators Classical open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O open ShortDraftHeckeBridge lemma prime_coprime_span_iff (P : Ideal ActualEisensteinCubic.O) [P.IsMaximal] (b : ActualEisensteinCubic.O) : IsCoprime P (Ideal.span {b}) ↔ b∉P := by rw [Ideal.isCoprime_iff_codisjoint, ←(Ideal.isMaximal_def.mp (inferInstance : P.IsMaximal)).not_le_iff_codisjoint, Ideal.span_singleton_le_iff_mem] end section open scoped BigOperators Classical SchwartzMap ContDiff section open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O open EisensteinSchwartzPoisson hiding O open IdealMobiusDivisorSum hiding O open ConcreteTraceCRT ShortDraftHeckeBridge open QuadraticInitialBound hiding O def averagingRows (Y : ℝ) : Finset ActualEisensteinCubic.O := rowNormDisk ⌊Y⌋₊ theorem mem_averagingRows {Y : ℝ} {b : ActualEisensteinCubic.O} (hY : 0≤Y) : b∈averagingRows Y ↔ b≠0 ∧ ‖eisEmbedding b‖^2≤Y := by rw [averagingRows,mem_rowNormDisk] have hz : 0(mem_averagingRows (by linarith)).mp hb |>.2) theorem averagingRows_power_norm (Y : ℝ) (hY : 1≤Y) {z : ActualEisensteinCubic.O} (hz : z∈(averagingRows Y).image (fun b=>b^6)) : z≠0 ∧ (Ideal.absNorm (Ideal.span {z}):ℝ)≤Y^6 := by obtain ⟨b,hb,rfl⟩:=Finset.mem_image.mp hz have hh:=(mem_averagingRows (by linarith : (0:ℝ)≤Y)).mp hb refine ⟨pow_ne_zero _ hh.1,?_⟩ rw [←eisEmbedding_norm_sq_eq_absNorm_span,map_pow,norm_pow, ←pow_mul,show (6:ℕ)*2=2*6 by omega,pow_mul] exact pow_le_pow_left₀ (sq_nonneg _) hh.2 _ theorem average_tsum_eq_finite (V : 𝓢(ℝ,ℂ)) (hV : Function.support (V:ℝ→ℂ)⊆Set.Icc ((1:ℝ)/2) 1) (hV0 : V 0=0) (Y : ℝ) (hY : 0b^6),‖A z‖^2 := by rw [average_tsum_eq_finite V hs hV0 Y (by linarith) A] apply (sixth_power_average_cauchy _ _ _ (fun b hb=>hV _)).trans have hc:=averagingRows_card Y hY nlinarith [Finset.sum_nonneg (s:=(averagingRows Y).image (fun b=>b^6)) (fun z _=>sq_nonneg ‖A z‖)] theorem average_remainder_small_power (ε : ℝ) (hε : 0<ε) : ∃C : ℝ,0i.val) (idealSupport F I) V Y‖≤ C*G*pvControl V*lengthScale^(1+ε) := by obtain ⟨C,hC,hp⟩:=SquarefreeDivisorBound.prime_support_subsets_bound ε hε refine ⟨128*C,by positivity,?_⟩ intro q F hF χ W V Y lengthScale G hY hL hG hW hnorm apply (sixth_average_remainder_bound F hF χ W V Y hY).trans let T:=F.filter (fun I=>W (Ideal.absNorm I)≠0) have he : (∑I∈F,‖W (Ideal.absNorm I)‖*(2:ℝ)^(primeSupport I).card*pvControl V)= ∑I∈T,‖W (Ideal.absNorm I)‖*(2:ℝ)^(primeSupport I).card*pvControl V := by symm apply Finset.sum_subset (Finset.filter_subset _ _) intro I hI hn have hz : W (Ideal.absNorm I)=0 := by by_contra hh exact hn (Finset.mem_filter.mpr ⟨hI,hh⟩) simp only [hz,norm_zero,zero_mul] have hc : (T.card:ℝ)≤128*lengthScale := DescentFiberCost.finite_ideal_count_real T lengthScale hL (fun I hI=>hF I (Finset.mem_filter.mp hI).1) (fun I hI=>hnorm I (Finset.mem_filter.mp hI).1 (Finset.mem_filter.mp hI).2) rw [he] calc _≤∑I∈T,G*(C*lengthScale^ε)*pvControl V := by apply Finset.sum_le_sum intro I hI have hh:=Finset.mem_filter.mp hI have hb:=(hp I (hF I hh.1)).trans (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (Nat.cast_nonneg _) (hnorm I hh.1 hh.2) hε.le) hC.le) exact mul_le_mul_of_nonneg_right (mul_le_mul (hW _) hb (by positivity) hG) (pvControl_nonneg V) _=(T.card:ℝ)*(G*(C*lengthScale^ε)*pvControl V) := by simp _≤128*lengthScale*(G*(C*lengthScale^ε)*pvControl V) := mul_le_mul_of_nonneg_right hc (mul_nonneg (by positivity) (pvControl_nonneg V)) _=(128*C)*G*pvControl V*lengthScale^(1+ε) := by rw [Real.rpow_add (by linarith : (0:ℝ)i.val) (idealSupport F I) V Y‖ := by have he:=idealRowSum_sixth_average F hF hg χ W V Y hY have hh:=norm_sub_le (∑'b : ActualEisensteinCubic.O,V (‖eisEmbedding b‖^2/Y)*idealRowSum F hF hg χ W (b^6)) (∑I∈F,baseChangeWeight χ I*W (Ideal.absNorm I)* maskedPrincipalRemainder (fun i : primePool F=>i.val) (idealSupport F I) V Y) rw [he,add_sub_cancel_right,norm_mul,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hY] at hh rwa [←he] at hh end open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O open EisensteinSchwartzPoisson hiding O open ConcreteTraceCRT ShortDraftHeckeBridge open QuadraticInitialBound hiding O open InitialMeanSquare open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open CanonicalRowCompletion theorem outside_totient_moebius_bound {q₀ : ℕ} (χ : DirichletCharacter ℂ q₀) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes⊆S) (hSp : ∀P∈S,Prime P) (ρ q levelBound : ℝ) (hρ : 0<ρ) (hq : 1W (n/Z)) have hYpow : Y^6=Z^((11:ℝ)/10) := by dsimp only [Y] rw [←Real.rpow_mul_natCast hZp.le] norm_num have hms : (∑z∈(averagingRows Y).image (fun b=>b^6),‖A z‖^2)≤ Cm*Z*Z^((11:ℝ)/10)*Z^(2*ε) := by apply hm D Z hZ hD · intro z hz have hn:=(averagingRows_power_norm Y hY hz).2 simpa only [hYpow,show (1:ℝ)+1/10=11/10 by norm_num] using hn · intro z hz exact (averagingRows_power_norm Y hY hz).1 have havg2:= (average_tsum_cauchy V hV hVs hV0 Y hY A).trans (mul_le_mul_of_nonneg_left hms (by positivity : 0≤768*Y)) have heq : 768*Y*(Cm*Z*Z^((11:ℝ)/10)*Z^(2*ε))= (Avg*Z^((137:ℝ)/120+ε))^2 := by dsimp only [Y,Avg] rw [mul_pow,Real.sq_sqrt (by positivity : (0:ℝ)≤768*Cm),←Real.rpow_mul_natCast hZp.le] calc _ = (768*Cm)*(Z^((11:ℝ)/60)*Z^(1:ℝ)*Z^((11:ℝ)/10)*Z^(2*ε)) := by rw [Real.rpow_one];ring _ = (768*Cm)*Z^((11:ℝ)/60+1+11/10+2*ε) := by rw [←Real.rpow_add hZp,←Real.rpow_add hZp,←Real.rpow_add hZp] _ = _ := by congr 2 ; ring rw [heq] at havg2 have havg : ‖∑'z : ActualEisensteinCubic.O,V (‖eisEmbedding z‖^2/Y)*A (z^6)‖≤ Avg*Z^((137:ℝ)/120+ε) := (sq_le_sq₀ (norm_nonneg _) (by positivity)).mp havg2 have herr : ‖∑I∈F,baseChangeWeight χ I*W ((Ideal.absNorm I:ℝ)/Z)* maskedPrincipalRemainder (fun i : primePool F=>i.val) (idealSupport F I) V Y‖≤Err*Z^(1+ε) := by have hbZ : 1≤B*Z:=by nlinarith [mul_nonneg (sub_nonneg.mpr hB) (sub_nonneg.mpr hZ)] have hh:=he F (outsideIdealsUpTo_ne_bot S D) χ (fun n=>W (n/Z)) V Y (B*Z) G hYp hbZ hG (fun n=>Ws.norm_le_seminorm ℝ (n/Z)) (by intro I hI hn have hh:=(hs hn).2 exact ((div_le_iff₀ hZp).mp hh).trans (mul_le_mul_of_nonneg_right (le_max_right 1 b) hZp.le)) calc _≤Ce*G*pvControl V*(B*Z)^(1+ε):=hh _=Err*Z^(1+ε):=by rw [Real.mul_rpow (by linarith : 0≤B) hZp.le];dsimp only [Err];ring have hexponent : Z^(1+ε)≤Z^((137:ℝ)/120+ε) := Real.rpow_le_rpow_of_exponent_le hZ (by linarith) have hmain:=totient_sum_normalized_bound F (outsideIdealsUpTo_ne_bot S D) (outside_good S D hbad) χ (fun n=>W (n/Z)) V Y hYp have hbound : Y*‖paperRadialFourier V 0‖* ‖∑I∈F,baseChangeWeight χ I*W ((Ideal.absNorm I:ℝ)/Z)*totientDensity I‖≤ (Avg+Err)*Z^((137:ℝ)/120+ε) := by apply hmain.trans have := add_le_add havg (herr.trans (mul_le_mul_of_nonneg_left hexponent hErr)) simpa only [add_mul] using this have hzexp : Z^((137:ℝ)/120+ε)=Y*Z^((23:ℝ)/24+ε) := by dsimp only [Y] rw [←Real.rpow_add hZp] congr 1 ring apply (mul_le_mul_iff_right₀ (mul_pos hYp hhat)).mp apply hbound.trans_eq rw [hzexp] dsimp only [C] field_simp [hhat.ne'] end section open scoped BigOperators Classical SchwartzMap ContDiff Topology open Filter Asymptotics MeasureTheory open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O open ShortDraftHeckeBridge open IdealMobiusDivisorSum hiding O open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open CanonicalRowCompletion open InitialMeanSquare def weightedMoebius {q : ℕ} (χ : DirichletCharacter ℂ q) (I : Ideal ActualEisensteinCubic.O) : ℂ := baseChangeWeight χ I*totientDensity I def outsideWeight {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) : Ideal ActualEisensteinCubic.O→ℂ := FiniteSFactor.outsideWeight S (weightedMoebius χ) def weightedCoeff {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) : ℕ→ℂ := FiniteSFactor.outsideCoeff S (weightedMoebius χ) theorem totientDensity_norm_le_one (I : Ideal ActualEisensteinCubic.O) : ‖totientDensity I‖≤1 := by rw [totientDensity,norm_prod] apply Finset.prod_le_one₀ · intro P hP exact norm_nonneg _ · intro P hP have hN : (2:ℝ)≤Ideal.absNorm P:=by exact_mod_cast IdealDivisorBound.support_norm_two_le hP have hNp : (0:ℝ)outsideWeight_norm_le_one χ S I) _=(FiniteSFactor.fiber n).card:=by simp _≤128*n:=hc theorem weightedCoeff_LSeriesSummable {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (hs : 2weightedCoeff χ S n*W ((n:ℝ)/Z)) (∑I∈outsideIdealsUpTo S D,baseChangeWeight χ I*W ((Ideal.absNorm I:ℝ)/Z)*totientDensity I) := by have ht (n : ℕ) (hn : n∉Finset.Icc 1 D) : weightedCoeff χ S n*W ((n:ℝ)/Z)=0 := by by_cases hn0 : n=0 · subst n simp [weightedCoeff_zero] · have hnD : DweightedCoeff χ S n*W ((n:ℝ)/Z)) (∑n∈Finset.Icc 1 D,weightedCoeff χ S n*W ((n:ℝ)/Z)) := hasSum_sum_of_ne_finset_zero ht have he:=outsideIdealSum_eq_outsideCoeff_sum S D (weightedMoebius χ) (fun n=>W ((n:ℝ)/Z)) change _=(∑n∈Finset.Icc 1 D,weightedCoeff χ S n*W ((n:ℝ)/Z)) at he rw [←he] at hh convert hh using 1 apply Finset.sum_congr rfl intro I hI dsimp only [weightedMoebius] ring end open scoped BigOperators Classical SchwartzMap ContDiff Topology open Filter Asymptotics MeasureTheory open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O open ShortDraftHeckeBridge open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open CanonicalRowCompletion open InitialMeanSquare CompactMellinBridge def weightedCompactSum {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (W : ℝ→ℂ) (t : ℝ) : ℂ := ∑'n : ℕ,weightedCoeff χ S n*W ((n:ℝ)*t) theorem weightedCompactSum_hasSum {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (W : ℝ→ℂ) (hW : ∀x,2≤x→W x=0) (t : ℝ) (ht : 0weightedCoeff χ S n*W ((n:ℝ)*t)) (weightedCompactSum χ S W t) := by obtain ⟨N,hN⟩:=exists_nat_gt (2/t) have hz (n : ℕ) (hn : n∉Finset.range N) : weightedCoeff χ S n*W ((n:ℝ)*t)=0 := by have hNn : N≤n:=by simpa only [Finset.mem_range,not_lt] using hn have htwo : 2≤(n:ℝ)*t := by have hh:=(div_lt_iff₀ ht).mp hN exact hh.le.trans (mul_le_mul_of_nonneg_right (Nat.cast_le.mpr hNn) ht.le) rw [hW _ htwo,mul_zero] exact (summable_of_ne_finset_zero hz).hasSum theorem weightedCompactSum_inv_eq {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (W : ℝ→ℂ) (Z b : ℝ) (hZ : 0weightedCompactSum χ S W Z⁻¹)=O[atTop] (fun Z : ℝ=>Z^((23:ℝ)/24+ε)) := by obtain ⟨C,hC,hbound⟩:=outside_totient_moebius_bound χ S hbad hSp ρ q levelBound hρ hq hlevel hmodels W a b ha hs hW ε hε apply Asymptotics.IsBigO.of_bound C filter_upwards [eventually_ge_atTop (1:ℝ)] with Z hZ have hZp : 0(hs hx).2) _ hD, Real.norm_of_nonneg (Real.rpow_nonneg hZp.le _)] exact hbound _ Z hZ hD theorem weightedCompactMellin_analytic_of_theta {q₀ : ℕ} (χ : DirichletCharacter ℂ q₀) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes⊆S) (hSp : ∀P∈S,Prime P) (ρ q levelBound : ℝ) (hρ : 0<ρ) (hq : 1mellin (fun Z : ℝ=>weightedCompactSum χ S W Z⁻¹) (-s)) {s : ℂ | (23:ℝ)/24+εhs x (Or.inr hx)) have hlocal:=weighted_sum_inv_locallyIntegrableOn_pos (weightedCoeff χ S) W (weightedCompactSum χ S W) hW (fun x hx=>hs x (Or.inr hx)) hf have hzero:=weighted_sum_zero_near_small_D (weightedCoeff χ S) (weightedCoeff_zero χ S) W (weightedCompactSum χ S W) (fun x hx=>hs x (Or.inr hx)) hf have hsup : Function.support W⊆Set.Icc (1:ℝ) 2 := by intro x hx have h1 : 1weightedCompactSum χ S W Z⁻¹) (-s)= mellin W s*LSeries (weightedCoeff χ S) s := by have hls:=weightedCoeff_LSeriesSummable χ S s hRe exact mellin_weighted_sum (weightedCoeff χ S) W (weightedCompactSum χ S W) s (weightedCoeff_zero χ S) (weightedCompactSum_hasSum χ S W (fun x hx=>hs x (Or.inr hx))) (weighted_term_integrable _ (weightedCoeff_zero χ S) W s (compact_weight_mellin_convergent W hW hs s)) (weighted_terms_fubini _ (weightedCoeff_zero χ S) W s hls) hls theorem weightedCompactMellin_analytic {q₀ : ℕ} (χ : DirichletCharacter ℂ q₀) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes⊆S) (hSp : ∀P∈S,Prime P) (ρ q levelBound : ℝ) (hρ : 0<ρ) (hq : 1mellin (fun Z : ℝ=>weightedCompactSum χ S W Z⁻¹) (-s)) {s : ℂ | (23:ℝ)/24 ⟨P.val, support_prime P.property⟩) theorem mem_primeSet (I : Ideal ActualEisensteinCubic.O) (P : PrimeIdeal) : P ∈ primeSet I ↔ P.val ∈ primeSupport I := by simp only [primeSet, Finset.mem_image, Finset.mem_attach, true_and] constructor · rintro ⟨Q,hQ⟩ have hv := congrArg Subtype.val hQ simpa only [←hv] using Q.property · intro h exact ⟨⟨P.val,h⟩,rfl⟩ theorem primeProduct_ne_zero (s : Finset PrimeIdeal) : primeProduct s ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun P _ => P.property.ne_zero) theorem factors_primeProduct (s : Finset PrimeIdeal) : normalizedFactors (primeProduct s) = s.val.map Subtype.val := by have h := normalizedFactors_prod_of_prime (m := s.val.map (fun P : PrimeIdeal => P.val)) (by intro P hP obtain ⟨Q,hQ,rfl⟩ := Multiset.mem_map.mp hP exact Q.property) simpa only [primeProduct, Finset.prod_eq_multiset_prod] using h theorem primeSet_primeProduct (s : Finset PrimeIdeal) : primeSet (primeProduct s) = s := by ext P rw [mem_primeSet] simp only [primeSupport, factors_primeProduct, Multiset.mem_toFinset, Multiset.mem_map, Finset.mem_val] constructor · rintro ⟨Q,hQ,he⟩ have : Q=P := Subtype.ext he simpa [this] using hQ · intro h exact ⟨P,h,rfl⟩ theorem primeProduct_injective : Function.Injective primeProduct := by intro s t h simpa only [primeSet_primeProduct] using congrArg primeSet h theorem primeProduct_squarefree (s : Finset PrimeIdeal) : Squarefree (primeProduct s) := by rw [squarefree_iff_nodup_normalizedFactors (primeProduct_ne_zero s),factors_primeProduct] exact s.nodup.map Subtype.val_injective theorem primeProduct_primeSet (I : Ideal ActualEisensteinCubic.O) (hI : Squarefree I) : primeProduct (primeSet I) = I := by unfold primeProduct primeSet rw [Finset.prod_image] · change (∏ P ∈ (primeSupport I).attach, (fun Q : Ideal ActualEisensteinCubic.O => Q) P.val) = I exact (Finset.prod_attach (primeSupport I) (fun Q : Ideal ActualEisensteinCubic.O => Q)).trans (squarefree_support_product_self hI) · intro P hP Q hQ he exact Subtype.ext (congrArg (fun R : PrimeIdeal => R.val) he) def mobiusPrimeCoeff (w : Ideal ActualEisensteinCubic.O → ℂ) (I : Ideal ActualEisensteinCubic.O) : ℂ := (moebius I : ℂ) * primeValueHom w I theorem mobiusPrimeCoeff_nonsquarefree (w : Ideal ActualEisensteinCubic.O → ℂ) (I : Ideal ActualEisensteinCubic.O) (hI : ¬Squarefree I) : mobiusPrimeCoeff w I=0 := by simp [mobiusPrimeCoeff,moebius_of_not_squarefree hI] theorem mobiusPrimeCoeff_primeProduct (w : Ideal ActualEisensteinCubic.O → ℂ) (s : Finset PrimeIdeal) : mobiusPrimeCoeff w (primeProduct s) = ∏ P ∈ s, -w P.val := by have hm : (moebius (primeProduct s) : ℂ)=(-1:ℂ)^s.card := by rw [(primeProduct_squarefree s).moebius_eq,factors_eq_normalizedFactors, factors_primeProduct] simp rw [mobiusPrimeCoeff,hm] simp only [primeProduct,map_prod,primeValueHom_prime _ _ (Subtype.property _)] rw [Finset.prod_neg] theorem mobiusPrimeCoeff_tsum (w : Ideal ActualEisensteinCubic.O → ℂ) : (∑' I : Ideal ActualEisensteinCubic.O, mobiusPrimeCoeff w I) = ∑' s : Finset PrimeIdeal, ∏ P ∈ s, -w P.val := by apply tsum_eq_tsum_of_ne_zero_bij (fun s => primeProduct s.val) · exact primeProduct_injective.comp Subtype.val_injective · intro I hI have hs : Squarefree I := by by_contra hs exact hI (mobiusPrimeCoeff_nonsquarefree w I hs) have hp : (∏ P ∈ primeSet I, -w P.val) ≠ 0 := by rw [←mobiusPrimeCoeff_primeProduct,primeProduct_primeSet I hs] exact hI exact ⟨⟨primeSet I,hp⟩,primeProduct_primeSet I hs⟩ · intro s exact mobiusPrimeCoeff_primeProduct w s.val theorem mobiusPrimeCoeff_euler (w : Ideal ActualEisensteinCubic.O → ℂ) (hw : Summable (fun P : PrimeIdeal => ‖w P.val‖)) : (∑' I : Ideal ActualEisensteinCubic.O, mobiusPrimeCoeff w I) = ∏' P : PrimeIdeal, (1-w P.val) := by rw [mobiusPrimeCoeff_tsum] have hs : Summable (fun P : PrimeIdeal => ‖-w P.val‖) := by simpa using hw simpa only [sub_eq_add_neg] using (tprod_one_add (summable_finsetProd_of_summable_norm hs)).symm end section open ActualEisensteinCubic open Filter lemma prime_norm_two_le (P : PrimeIdeal) : 2 ≤ Ideal.absNorm P.val := by have h0 : Ideal.absNorm P.val ≠ 0 := fun h => P.property.ne_zero (Ideal.absNorm_eq_zero_iff.mp h) have h1 : Ideal.absNorm P.val ≠ 1 := by intro h apply P.property.not_isUnit rw [Ideal.absNorm_eq_one_iff.mp h] simpa only [Ideal.one_eq_top] using (show IsUnit (1 : Ideal ActualEisensteinCubic.O) from isUnit_one) omega lemma prime_norm_pos (P : PrimeIdeal) : (0 : ℝ) < Ideal.absNorm P.val := by have h := prime_norm_two_le P exact_mod_cast (by omega : 0 < Ideal.absNorm P.val) def primeNormPower (P : PrimeIdeal) (s : ℂ) : ℂ := (Ideal.absNorm P.val : ℂ)^(-s) def primeCharacterTerm {q : ℕ} (χ : DirichletCharacter ℂ q) (P : PrimeIdeal) (s : ℂ) : ℂ := χ (Ideal.absNorm P.val) * primeNormPower P s def primeDensity (P : PrimeIdeal) : ℂ := 1-(1:ℂ)/(Ideal.absNorm P.val:ℂ) lemma norm_primeNormPower (P : PrimeIdeal) (s : ℂ) : ‖primeNormPower P s‖=(Ideal.absNorm P.val : ℝ)^(-s.re) := by exact Complex.norm_cpow_eq_rpow_re_of_pos (prime_norm_pos P) (-s) lemma primeDensity_norm_le_one (P : PrimeIdeal) : ‖primeDensity P‖≤1 := by have hn := prime_norm_pos P have hn1 : (1:ℝ)≤Ideal.absNorm P.val := by exact_mod_cast (by have:=prime_norm_two_le P;omega) have he : primeDensity P = ((1-(1:ℝ)/(Ideal.absNorm P.val:ℝ):ℝ):ℂ) := by simp [primeDensity] rw [he,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg] · have : (0:ℝ)≤1/(Ideal.absNorm P.val:ℝ) := by positivity linarith · exact sub_nonneg.mpr ((div_le_one hn).mpr hn1) lemma primeCharacterTerm_norm_le {q : ℕ} (χ : DirichletCharacter ℂ q) (P : PrimeIdeal) (s : ℂ) (σ : ℝ) (hs : σ≤ s.re) : ‖primeCharacterTerm χ P s‖≤(Ideal.absNorm P.val:ℝ)^(-σ) := by rw [primeCharacterTerm,norm_mul,norm_primeNormPower] have hn1 : (1:ℝ)≤Ideal.absNorm P.val := by exact_mod_cast (by have:=prime_norm_two_le P;omega) calc _ ≤ 1*(Ideal.absNorm P.val:ℝ)^(-s.re) := mul_le_mul_of_nonneg_right (χ.norm_le_one _) (by positivity) _ ≤ _ := by rw [one_mul]; exact Real.rpow_le_rpow_of_exponent_le hn1 (neg_le_neg hs) lemma primeCharacterTerm_norm_lt_one {q : ℕ} (χ : DirichletCharacter ℂ q) (P : PrimeIdeal) (s : ℂ) (hs : 0.trans hh by_cases hP : P.val∈S · simp only [correctionTerm,if_pos hP,norm_zero] positivity · rw [correctionTerm,if_neg hP,norm_div,norm_mul,norm_neg,norm_div,norm_one,Complex.norm_natCast] calc _ ≤ ((1:ℝ)/(Ideal.absNorm P.val:ℝ)*(Ideal.absNorm P.val:ℝ)^(-σ))/(1-(2:ℝ)^(-σ)) := div_le_div₀ (by positivity) (mul_le_mul_of_nonneg_left hx (by positivity)) hr0 hd _ = _ := by rw [show -(1+σ)=(-1)+(-σ) by ring,Real.rpow_add hn,Real.rpow_neg_one] ring lemma prime_norm_series_summable (σ : ℝ) (hσ : 0<σ) : Summable (fun P : PrimeIdeal => (Ideal.absNorm P.val:ℝ)^(-(1+σ))) := by have ht := (CubicEisenstein.fullIdealWeight_summable_norm (1+(σ:ℂ)) (by simp;linarith)).comp_injective (i := fun P : PrimeIdeal => P.val) Subtype.val_injective apply ht.congr intro P simp only [Function.comp_def,CubicEisenstein.fullIdealWeight,if_neg P.property.ne_zero] simpa only [Complex.neg_re, Complex.add_re, Complex.one_re, Complex.ofReal_re, Complex.ofReal_natCast] using (Complex.norm_cpow_eq_rpow_re_of_pos (prime_norm_pos P) (-(1+(σ:ℂ)))) lemma correctionTerm_summable {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (hs : 0 ‖correctionTerm χ S P s‖) := by apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) (fun P => correctionTerm_uniform_bound χ S s.re hs P s le_rfl) exact (prime_norm_series_summable s.re hs).mul_left _ lemma primeCharacterTerm_differentiable {q : ℕ} (χ : DirichletCharacter ℂ q) (P : PrimeIdeal) : Differentiable ℂ (primeCharacterTerm χ P) := by have hn : (Ideal.absNorm P.val:ℂ)≠0 := by exact_mod_cast (ne_of_gt (prime_norm_pos P)) exact ((differentiable_id.neg).const_cpow (Or.inl hn)).const_mul _ lemma correctionTerm_differentiableOn {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (P : PrimeIdeal) (σ : ℝ) (hσ : 0≤σ) : DifferentiableOn ℂ (correctionTerm χ S P) {s:ℂ | σ rfl lemma eulerCorrection_locally_uniform {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (σ : ℝ) (hσ : 0<σ) : HasProdLocallyUniformlyOn (fun P s => 1+correctionTerm χ S P s) (eulerCorrection χ S) {s:ℂ | σ correctionTerm_uniform_bound χ S σ hσ P s hs.le)) (fun P => (correctionTerm_differentiableOn χ S P σ hσ.le).continuousOn) theorem eulerCorrection_differentiableOn_halfplane {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (σ : ℝ) (hσ : 0<σ) : DifferentiableOn ℂ (eulerCorrection χ S) {s:ℂ | σ ∏ P ∈ t, (1+correctionTerm χ S P z)) _ apply DifferentiableOn.fun_finsetProd intro P hP exact (differentiableOn_const (𝕜 := ℂ) (c := (1:ℂ))).add (correctionTerm_differentiableOn χ S P σ hσ.le) · exact isOpen_lt continuous_const Complex.continuous_re theorem eulerCorrection_differentiableOn {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) : DifferentiableOn ℂ (eulerCorrection χ S) {s:ℂ | 0 R.val) he) lemma primeValueHom_squarefree (w : Ideal ActualEisensteinCubic.O→ℂ) (I : Ideal ActualEisensteinCubic.O) (hI : Squarefree I) : primeValueHom w I=∏P∈primeSet I,w P.val := by calc _ = primeValueHom w (primeProduct (primeSet I)) := congrArg (primeValueHom w) (primeProduct_primeSet I hI).symm _ = _ := by simp only [primeProduct,map_prod,primeValueHom_prime _ _ (Subtype.property _)] lemma outside_primeProduct_iff (S : Finset (Ideal ActualEisensteinCubic.O)) (hS : ∀P∈S,Prime P) (t : Finset PrimeIdeal) : (∀P∈S,¬P∣primeProduct t) ↔ ∀Q∈t,Q.val∉S := by constructor · intro h Q hQ hQS apply h Q.val hQS exact Finset.dvd_prod_of_mem (fun P : PrimeIdeal => P.val) hQ · intro h P hP hd obtain ⟨Q,hQ,hPQ⟩ := ((hS P hP).dvd_finsetProd_iff (fun Q : PrimeIdeal => Q.val)).mp hd have he : P=Q.val := associated_iff_eq.mp (((hS P hP).dvd_prime_iff_associated Q.property).mp hPQ) exact h Q hQ (he ▸ hP) def outsideMask (S : Finset (Ideal ActualEisensteinCubic.O)) (I : Ideal ActualEisensteinCubic.O) : ℂ := if ∀P∈S,¬P∣I then 1 else 0 lemma prod_cut_primes (S : Finset (Ideal ActualEisensteinCubic.O)) (hS : ∀P∈S,Prime P) (t : Finset PrimeIdeal) (f : Ideal ActualEisensteinCubic.O→ℂ) : (∏Q∈t,if Q.val∈S then 0 else f Q.val)=outsideMask S (primeProduct t)*(∏Q∈t,f Q.val) := by by_cases ho : ∀P∈S,¬P∣primeProduct t · rw [outsideMask,if_pos ho,one_mul] apply Finset.prod_congr rfl intro Q hQ exact if_neg ((outside_primeProduct_iff S hS t).mp ho Q hQ) · rw [outsideMask,if_neg ho,zero_mul] have hh : ¬∀Q∈t,Q.val∉S := fun h => ho ((outside_primeProduct_iff S hS t).mpr h) push Not at hh obtain ⟨Q,hQ,hQS⟩ := hh exact Finset.prod_eq_zero hQ (if_pos hQS) lemma nat_cpow_prod {ι : Type*} (t : Finset ι) (N : ι→ℕ) (s : ℂ) : ((∏i∈t,N i : ℕ):ℂ)^s=∏i∈t,(N i:ℂ)^s := by classical induction t using Finset.induction_on with | empty => simp | @insert i t hi ih => rw [Finset.prod_insert hi,Finset.prod_insert hi,Nat.cast_mul,Complex.natCast_mul_natCast_cpow,ih] lemma primeNormTerm_prod {q : ℕ} (χ : DirichletCharacter ℂ q) (t : Finset PrimeIdeal) (s : ℂ) : (∏P∈t,χ (Ideal.absNorm P.val)*(Ideal.absNorm P.val:ℂ)^(-s))= χ (Ideal.absNorm (primeProduct t))*(Ideal.absNorm (primeProduct t):ℂ)^(-s) := by rw [Finset.prod_mul_distrib] simp only [primeProduct,map_prod,Nat.cast_prod] congr 1 simpa only [Nat.cast_prod] using (nat_cpow_prod t (fun P=>Ideal.absNorm P.val) (-s)).symm def ordinaryPrimeValue {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (I : Ideal ActualEisensteinCubic.O) : ℂ := if I∈S then 0 else χ (Ideal.absNorm I)*(Ideal.absNorm I:ℂ)^(-s) def dampedPrimeValue {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (I : Ideal ActualEisensteinCubic.O) : ℂ := if I∈S then 0 else (1-(1:ℂ)/(Ideal.absNorm I:ℂ))*(χ (Ideal.absNorm I)*(Ideal.absNorm I:ℂ)^(-s)) def ordinarySeriesTerm {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (I : Ideal ActualEisensteinCubic.O) : ℂ := outsideMask S I * baseChangeWeight χ I * CubicEisenstein.fullIdealWeight s I def dampedSeriesTerm {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (I : Ideal ActualEisensteinCubic.O) : ℂ := ordinarySeriesTerm χ S s I * SixthPowerAverage.totientDensity I lemma ordinarySeriesTerm_eq {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (hS : ∀P∈S,Prime P) (s : ℂ) (I : Ideal ActualEisensteinCubic.O) : ordinarySeriesTerm χ S s I = mobiusPrimeCoeff (ordinaryPrimeValue χ S s) I := by by_cases hI : Squarefree I · rw [mobiusPrimeCoeff,primeValueHom_squarefree _ I hI] simp only [ordinaryPrimeValue] rw [prod_cut_primes S hS (primeSet I) (fun P => χ (Ideal.absNorm P)*(Ideal.absNorm P:ℂ)^(-s)), primeNormTerm_prod,primeProduct_primeSet I hI] simp only [ordinarySeriesTerm,baseChangeWeight,CubicEisenstein.fullIdealWeight,if_neg hI.ne_zero] ring · simp [ordinarySeriesTerm,baseChangeWeight,mobiusPrimeCoeff_nonsquarefree _ I hI, moebius_of_not_squarefree hI] lemma dampedSeriesTerm_eq {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (hS : ∀P∈S,Prime P) (s : ℂ) (I : Ideal ActualEisensteinCubic.O) : dampedSeriesTerm χ S s I = mobiusPrimeCoeff (dampedPrimeValue χ S s) I := by by_cases hI : Squarefree I · rw [mobiusPrimeCoeff,primeValueHom_squarefree _ I hI] simp only [dampedPrimeValue] rw [prod_cut_primes S hS (primeSet I) (fun P => (1-(1:ℂ)/(Ideal.absNorm P:ℂ))*(χ (Ideal.absNorm P)*(Ideal.absNorm P:ℂ)^(-s))), Finset.prod_mul_distrib,primeNormTerm_prod, prod_primeSet I (fun P => (1-(1:ℂ)/(Ideal.absNorm P:ℂ))), primeProduct_primeSet I hI] simp only [dampedSeriesTerm,ordinarySeriesTerm,baseChangeWeight,SixthPowerAverage.totientDensity, CubicEisenstein.fullIdealWeight,if_neg hI.ne_zero] ring · simp [dampedSeriesTerm,ordinarySeriesTerm,baseChangeWeight,mobiusPrimeCoeff_nonsquarefree _ I hI, moebius_of_not_squarefree hI] end open ActualEisensteinCubic lemma ordinaryPrimeValue_norm_le {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (P : PrimeIdeal) (s : ℂ) : ‖ordinaryPrimeValue χ S s P.val‖≤(Ideal.absNorm P.val:ℝ)^(-s.re) := by by_cases hP : P.val∈S · simp only [ordinaryPrimeValue,if_pos hP,norm_zero] positivity · simpa only [ordinaryPrimeValue,if_neg hP,primeCharacterTerm,primeNormPower] using primeCharacterTerm_norm_le χ P s s.re le_rfl lemma dampedPrimeValue_norm_le {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (P : PrimeIdeal) (s : ℂ) : ‖dampedPrimeValue χ S s P.val‖≤(Ideal.absNorm P.val:ℝ)^(-s.re) := by by_cases hP : P.val∈S · simp only [dampedPrimeValue,if_pos hP,norm_zero] positivity · change ‖if P.val∈S then 0 else primeDensity P*primeCharacterTerm χ P s‖≤_ rw [if_neg hP,norm_mul] exact (mul_le_mul_of_nonneg_right (primeDensity_norm_le_one P) (norm_nonneg _)).trans (by simpa using primeCharacterTerm_norm_le χ P s s.re le_rfl) lemma prime_reciprocal_series_summable (s : ℂ) (hs : 1 (Ideal.absNorm P.val:ℝ)^(-s.re)) := by have hh := prime_norm_series_summable (s.re-1) (by linarith) simpa only [show 1+(s.re-1)=s.re by ring] using hh lemma ordinaryPrimeValue_summable {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (hs : 1 ‖ordinaryPrimeValue χ S s P.val‖) := Summable.of_nonneg_of_le (fun _ => norm_nonneg _) (fun P => ordinaryPrimeValue_norm_le χ S P s) (prime_reciprocal_series_summable s hs) lemma dampedPrimeValue_summable {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (hs : 1 ‖dampedPrimeValue χ S s P.val‖) := Summable.of_nonneg_of_le (fun _ => norm_nonneg _) (fun P => dampedPrimeValue_norm_le χ S P s) (prime_reciprocal_series_summable s hs) lemma ordinarySeries_euler {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (hS : ∀P∈S,Prime P) (s : ℂ) (hs : 1 1-dampedPrimeValue χ S s P.val) := by simpa only [sub_eq_add_neg] using multipliable_one_add_of_summable (show Summable (fun P : PrimeIdeal => ‖-dampedPrimeValue χ S s P.val‖) by simpa only [norm_neg] using dampedPrimeValue_summable χ S s hs) have hc := multipliable_one_add_of_summable (correctionTerm_summable χ S s (by linarith)) change _ = (∏' P : PrimeIdeal, (1-dampedPrimeValue χ S s P.val))*(∏' P : PrimeIdeal, (1+correctionTerm χ S P s)) rw [←hd.tprod_mul hc] apply tprod_congr intro P exact (local_correction_identity χ S P s (by linarith)).symm open scoped BigOperators Classical open ActualEisensteinCubic open ShortDraftHeckeBridge hiding O lemma normFiber_tsum (a : Ideal ActualEisensteinCubic.O→ℂ) (n : ℕ) : (∑'I : {I : Ideal ActualEisensteinCubic.O // Ideal.absNorm I=n},a I.val)=normFiberCoeff a n := by let : Fintype {I : Ideal ActualEisensteinCubic.O // Ideal.absNorm I=n} := (Ideal.finite_setOfPred_absNorm_eq (S := ActualEisensteinCubic.O) n).fintype rw [tsum_fintype] symm change (∑I∈FiniteSFactor.fiber n,a I)=_ apply Finset.sum_bij (fun I hI => (⟨I,FiniteSFactor.mem_fiber.mp hI⟩ : {I : Ideal ActualEisensteinCubic.O // Ideal.absNorm I=n})) · intro I hI exact Finset.mem_univ _ · intro I hI J hJ he exact congrArg Subtype.val he · intro I hI exact ⟨I.val,FiniteSFactor.mem_fiber.mpr I.property,rfl⟩ · intro I hI rfl lemma idealDirichlet_fiber (a : Ideal ActualEisensteinCubic.O→ℂ) (s : ℂ) (n : ℕ) : (∑'I : {I : Ideal ActualEisensteinCubic.O // Ideal.absNorm I=n},a I.val*CubicEisenstein.fullIdealWeight s I.val)= LSeries.term (normFiberCoeff a) s n := by by_cases hn : n=0 · subst n have hz (I : {I : Ideal ActualEisensteinCubic.O // Ideal.absNorm I=0}) : CubicEisenstein.fullIdealWeight s I.val=0 := by have hI : I.val=0 := Ideal.absNorm_eq_zero_iff.mp I.property simp [CubicEisenstein.fullIdealWeight,hI] simp only [hz,mul_zero,tsum_zero,LSeries.term_zero] · have ht (I : {I : Ideal ActualEisensteinCubic.O // Ideal.absNorm I=n}) : CubicEisenstein.fullIdealWeight s I.val=(n:ℂ)^(-s) := by have hI : I.val≠0 := fun h => hn (by rw [←I.property,h,map_zero]) rw [CubicEisenstein.fullIdealWeight,if_neg hI,I.property] simp_rw [ht] rw [tsum_mul_right,normFiber_tsum,LSeries.term_of_ne_zero hn,Complex.cpow_neg,div_eq_mul_inv] lemma idealDirichlet_summable (a : Ideal ActualEisensteinCubic.O→ℂ) (ha : ∀I,‖a I‖≤1) (s : ℂ) (hs : 1 a I*CubicEisenstein.fullIdealWeight s I) := by apply Summable.of_norm apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) (fun I => ?_) (CubicEisenstein.fullIdealWeight_summable_norm s hs) rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (ha I) theorem idealDirichlet_eq_LSeries (a : Ideal ActualEisensteinCubic.O→ℂ) (ha : ∀I,‖a I‖≤1) (s : ℂ) (hs : 1 ∑'I : {I : Ideal ActualEisensteinCubic.O // Ideal.absNorm I=n}, a I.val*CubicEisenstein.fullIdealWeight s I.val) _ at hh simp_rw [idealDirichlet_fiber] at hh exact hh.tsum_eq.symm lemma ordinarySeriesTerm_outside {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (I : Ideal ActualEisensteinCubic.O) : ordinarySeriesTerm χ S s I= FiniteSFactor.outsideWeight S (baseChangeWeight χ) I*CubicEisenstein.fullIdealWeight s I := by unfold ordinarySeriesTerm outsideMask FiniteSFactor.outsideWeight split_ifs <;> simp lemma dampedSeriesTerm_outside {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (I : Ideal ActualEisensteinCubic.O) : dampedSeriesTerm χ S s I= SixthPowerAverage.outsideWeight χ S I*CubicEisenstein.fullIdealWeight s I := by unfold dampedSeriesTerm ordinarySeriesTerm outsideMask SixthPowerAverage.outsideWeight FiniteSFactor.outsideWeight SixthPowerAverage.weightedMoebius split_ifs <;> ring lemma ordinarySeries_eq_LSeries {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset (Ideal ActualEisensteinCubic.O)) (s : ℂ) (hs : 1weightedCompactSum χ S W Z⁻¹) (-s))= mellin W s := by rw [weightedCompactMellin_eq_series χ S W hW hs s hRe] have hc:=SmoothMobiusCorrection.full_LSeries_correction χ S hS s hRe have hp:=normFiber_LSeries_eq_pair_inverse χ (baseChangeChar χ) (baseChangeWeight χ) (normFiberCoeff_baseChange_eq_pairInverseCoeff χ) s have he:=pair_inverse_euler_identity χ (baseChangeChar χ) s (by linarith : 1(finiteEulerFactor χ S s*SmoothMobiusCorrection.eulerCorrection χ S s)* mellin (fun Z : ℝ=>weightedCompactSum χ S W Z⁻¹) (-s)) (mellin W) ((hE.mul hH).mul hM) hWanalytic (corrected_weighted_mellin_identity χ S hSp W hW hWs) z hz hzneq (ConcreteCompactWeight.weight_mellin_ne_zero z)).1 theorem dirichlet_nonvanishing_of_theta_models {q₀ : ℕ} [NeZero q₀] (χ : DirichletCharacter ℂ q₀) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes⊆S) (hSp : ∀P∈S,Prime P) (ρ q levelBound : ℝ) (hρ : 0<ρ) (hq : 1p have hpp : ∀i,pp i≠0:=fun _=>hp have hcp : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {pp i})):=by intro i j hij exact False.elim (hij (Subsingleton.elim _ _)) have hh:=FiniteGaussPhase.norm_canonicalProductGauss pp hpp hcp (fun _=>hg) (fun _=>hc) (fun _=>3) (by intro i;decide) (by intro i;decide) rw [QuadraticGaussRay.canonicalProductGauss_three_eq_rayValue pp hpp hcp (fun _=>hg) (fun _=>hc)] at hh simpa [pp] using hh exact QuadraticUnitInvariance.odd_of_quadraticRayValue_norm_eq_one _ hn unfold lambdaQuadraticRay rw [←residue_mul] apply (eq_div_iff (mul_ne_zero lambda_quadratic_ray_ne_zero (quadraticRayValue_ne_zero_of_odd _ hodd))).mpr simpa only [mul_assoc] using h.symm end open ActualEisensteinCubic open QuadraticGaussRay hiding O open ActualEisensteinCoordinates hiding O omega def lambdaQuadraticTable (r : EisensteinEPrimaryPhase.Coord) : ℤ := @ite ℤ (¬EisensteinEPrimaryPhase.odd r) (@instDecidableNot (EisensteinEPrimaryPhase.odd r) (EisensteinEPrimaryPhase.instDecidablePredCoordOdd r)) 0 (if r∈({(0,1),(1,0),(1,2),(1,3),(2,3),(3,3)} : Finset EisensteinEPrimaryPhase.Coord) then 1 else -1) lemma lambdaQuadraticTable_mul (r s : EisensteinEPrimaryPhase.Coord) : lambdaQuadraticTable (EisensteinEPrimaryPhase.mul r s)= lambdaQuadraticTable r*lambdaQuadraticTable s := by have h : ∀r s : EisensteinEPrimaryPhase.Coord, lambdaQuadraticTable (EisensteinEPrimaryPhase.mul r s)= lambdaQuadraticTable r*lambdaQuadraticTable s := by decide exact h r s lemma lambdaQuadraticTable_eq_ray (r : EisensteinEPrimaryPhase.Coord) (hr : EisensteinEPrimaryPhase.odd r) : (lambdaQuadraticTable r:ℂ)=lambdaQuadraticRay r := by have hcmp (a b : ZMod 4) : (a=b) ↔ (a.val=b.val) := (ZMod.val_injective 4).eq_iff.symm have hn3 : (-3 : ZMod 4) = 1 := by decide rcases r with ⟨a,b⟩ have hcases : ∀ x : ZMod 4, x = 0 ∨ x = 1 ∨ x = 2 ∨ x = 3 := by decide rcases hcases a with rfl | rfl | rfl | rfl <;> rcases hcases b with rfl | rfl | rfl | rfl <;> norm_num [EisensteinEPrimaryPhase.odd,ZMod.val_zero,ZMod.val_one_eq_one_mod,ZMod.val_ofNat] at hr <;> norm_num [lambdaQuadraticTable,lambdaQuadraticRay,lambda_residue,EisensteinEPrimaryPhase.mul, EisensteinEPrimaryPhase.odd,quadraticRayValue,breveGaussianFourTerms_formula, Prod.mk.injEq,hcmp,hn3,ZMod.val_zero,ZMod.val_one_eq_one_mod,ZMod.val_ofNat, ZMod.val_neg_one,ZMod.val_mul,ZMod.val_add,ZMod.val_sub, Complex.I_sq,Complex.I_pow_three,Complex.inv_I,zpow_neg] <;> ring_nf <;> norm_num [Complex.I_sq,Complex.I_pow_three] all_goals field_simp [Complex.I_ne_zero] change (-2 : ℂ) = Complex.I * (Complex.I ^ (1 : ℤ) + Complex.I ^ (2 - 1 : ℤ)) norm_num [Complex.I_sq] ring_nf norm_num [Complex.I_sq] def lambdaQuadraticCharacter : ActualEisensteinCubic.O→*ℂ where toFun n:=(lambdaQuadraticTable (residue n):ℂ) map_one' := by have h : residue (1:ActualEisensteinCubic.O)=((1:ZMod 4),0):=by have h1 : (1:ActualEisensteinCubic.O)=eval 1 0:=by simp [eval] rw [h1,residue_eval] norm_num rw [h] exact_mod_cast (show lambdaQuadraticTable ((1:ZMod 4),0)=1 from by decide) map_mul' x y := by rw [residue_mul,lambdaQuadraticTable_mul] push_cast rfl lemma lambdaQuadraticCharacter_periodic (x y : ActualEisensteinCubic.O) (h : (4:ActualEisensteinCubic.O)∣x-y) : lambdaQuadraticCharacter x=lambdaQuadraticCharacter y := by change (lambdaQuadraticTable (residue x):ℂ)=(lambdaQuadraticTable (residue y):ℂ) rw [QuadraticGaussRay.residue_eq_of_four_dvd_sub x y h] end QuadraticAllOddCRT open scoped BigOperators Classical namespace CanonicalRowCompletion open ActualEisensteinCubic open CompletedGauss hiding O open CubicJacobiGlobal hiding O open QuadraticAllOddCRT open CanonicalQuadraticSieve hiding O open ConcreteTraceCRT (eisEmbedding) open UniqueFactorizationMonoid lemma localRowValue_square (x : ActualEisensteinCubic.O) (P : Ideal ActualEisensteinCubic.O) : localRowValue x P^2=eisEmbedding (primeValue P x) := by unfold localRowValue primeValue split_ifs with h · let : P.IsMaximal:=h.1 change (actualSextic P h.2 (Ideal.Quotient.mk P x))^2=_ rw [←MulChar.pow_apply' _ (by decide : (2:ℕ)≠0),canonicalSextic_pow_two] rfl · simp theorem idealRowHom_square (x : ActualEisensteinCubic.O) (I : Ideal ActualEisensteinCubic.O) : idealRowHom x I ^2=eisEmbedding (idealSymbol I x) := by have hm (s : Multiset (Ideal ActualEisensteinCubic.O)) : (s.map (localRowValue x)).prod^2=eisEmbedding ((s.map (fun P=>primeValue P x)).prod) := by induction s using Multiset.induction_on with | empty=>simp | @cons P s ih=> simp only [Multiset.map_cons,Multiset.prod_cons,mul_pow,map_mul,localRowValue_square,ih] by_cases hI : I=0 · subst I simp only [map_zero,idealSymbol_zero,zero_pow (by decide : (2:ℕ)≠0)] · change (if I=0 then 0 else _)^2=eisEmbedding (if I=0 then 0 else _) simp only [if_neg hI] exact hm _ lemma actualSextic_cube_quadratic (P : Ideal ActualEisensteinCubic.O) [P.IsMaximal] (hg : lambda∉P) : actualSextic P hg^3=character P := by let : Field (ActualEisensteinCubic.O⧸P):=Ideal.Quotient.field P let : Fintype (ActualEisensteinCubic.O⧸P):=Fintype.ofFinite _ obtain ⟨χ,hχ,hχ3⟩ : ∃χ : MulChar (ActualEisensteinCubic.O⧸P) ActualEisensteinCubic.O, actualSextic P hg=χ.ringHomComp eisEmbedding ∧ χ^3=(quadraticChar (ActualEisensteinCubic.O⧸P)).ringHomComp (Int.castRingHom ActualEisensteinCubic.O) := ⟨_,rfl,(sexticChar_powers P hg).2.1⟩ rw [hχ,MulChar.ringHomComp_pow,hχ3] ext x change eisEmbedding ((quadraticChar (ActualEisensteinCubic.O⧸P) x:ℤ):ActualEisensteinCubic.O)=((quadraticChar (ActualEisensteinCubic.O⧸P) x:ℤ):ℂ) simp lemma idealRowHom_lambda_prime_cube (p : ActualEisensteinCubic.O) (hp : Prime p) (hprimary : lambda^2∣p-1) (hs : Supported (Ideal.span {p})) : idealRowHom lambda (Ideal.span {p})^3=lambdaQuadraticCharacter p := by letI principalIdealWitness := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let : (Ideal.span {p}).IsMaximal:=PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible have hmem : Ideal.span {p}∈normalizedFactors (Ideal.span {p}) := (Ideal.mem_normalizedFactors_iff hs.1).mpr ⟨inferInstance,le_rfl⟩ obtain ⟨hg,hc⟩:=hs.2 _ hmem rw [idealRowHom_prime lambda _ hg] change (actualSextic _ hg (Ideal.Quotient.mk _ lambda))^3=_ rw [←MulChar.pow_apply' _ (by decide : (3:ℕ)≠0),actualSextic_cube_quadratic] have he:=character_lambda_eq_ray p hp.ne_zero hg hc hprimary have ho:=ActualEisensteinCoordinates.odd_residue_iff_not_two_dvd p have hs' := (supported_span_iff p).mp hs change character _ (Ideal.Quotient.mk _ lambda)=_ rw [he] exact (lambdaQuadraticTable_eq_ray _ (ho.mpr hs'.2)).symm theorem idealRowHom_lambda_cube (y : ActualEisensteinCubic.O) (hy : lambda^2∣y-1) (hs : Supported (Ideal.span {y})) : idealRowHom lambda (Ideal.span {y})^3=lambdaQuadraticCharacter y := by have hy0 : y≠0:=by intro he apply hs.1 simp [he] obtain ⟨s,hprod,hfactors⟩:=exists_primary_prime_factorization y hy0 hy rw [←hprod] at hs ⊢ clear hprod hy hy0 y induction s using Multiset.induction_on with | empty=> simp only [Multiset.prod_zero,Ideal.span_singleton_one,←Ideal.one_eq_top,map_one,one_pow] | @cons p s ih=> have hp:=hfactors p (Multiset.mem_cons_self _ _) have htail : ∀q∈s,Prime q ∧ lambda^2∣q-1:= fun q hq=>hfactors q (Multiset.mem_cons_of_mem hq) have hsplit : Supported (Ideal.span {p}) ∧ Supported (Ideal.span {s.prod}) := by simpa only [Multiset.prod_cons,←Ideal.span_singleton_mul_span_singleton,supported_mul_iff] using hs rw [Multiset.prod_cons,←Ideal.span_singleton_mul_span_singleton,map_mul,mul_pow, idealRowHom_lambda_prime_cube p hp.1 hp.2 hsplit.1,ih hsplit.2 htail,map_mul] theorem idealRowHom_lambda_formula (y : ActualEisensteinCubic.O) (hy : lambda^2∣y-1) (hs : Supported (Ideal.span {y})) : idealRowHom lambda (Ideal.span {y})= eisEmbedding (CubicRamified.linearRay 1 0 y)^2*lambdaQuadraticCharacter y := by have htwo:=idealRowHom_square lambda (Ideal.span {y}) change idealRowHom lambda (Ideal.span {y})^2=eisEmbedding (symbol lambda y) at htwo rw [CubicRamified.symbol_lambda_eq_linearRay y hy] at htwo have hthree:=idealRowHom_lambda_cube y hy hs have hq : lambdaQuadraticCharacter y^2=1 := by change (lambdaQuadraticTable (ActualEisensteinCoordinates.residue y):ℂ)^2=1 have ho := ActualEisensteinCoordinates.odd_residue_iff_not_two_dvd y |>.mpr ((supported_span_iff y).mp hs).2 unfold lambdaQuadraticTable rw [if_neg (not_not.mpr ho)] split_ifs <;> norm_num have hsix : idealRowHom lambda (Ideal.span {y})^6=1 := by calc _ = (idealRowHom lambda (Ideal.span {y})^3)^2:=by ring _ = 1:=by rw [hthree,hq] calc _ = (idealRowHom lambda (Ideal.span {y})^2)^2*(idealRowHom lambda (Ideal.span {y})^3):=by calc _ = idealRowHom lambda (Ideal.span {y})*idealRowHom lambda (Ideal.span {y})^6:=by rw [hsix,mul_one] _ = _:=by ring _ = _:=by rw [htwo,hthree] theorem idealRowHom_lambda_mod_thirty_six (x y : ActualEisensteinCubic.O) (hx : lambda^2∣x-1) (hy : lambda^2∣y-1) (hsx : Supported (Ideal.span {x})) (hsy : Supported (Ideal.span {y})) (hxy : (36:ActualEisensteinCubic.O)∣x-y) : idealRowHom lambda (Ideal.span {x})=idealRowHom lambda (Ideal.span {y}) := by rw [idealRowHom_lambda_formula x hx hsx,idealRowHom_lambda_formula y hy hsy, CubicRamified.linearRay_congr_mod_nine 1 0 x y hx hy ((show (9:ActualEisensteinCubic.O)∣36 from ⟨4,by norm_num⟩).trans hxy), lambdaQuadraticCharacter_periodic x y ((show (4:ActualEisensteinCubic.O)∣36 from ⟨9,by norm_num⟩).trans hxy)] end CanonicalRowCompletion namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT lemma cuspRemainder_absolute_chart (a b : ℝ) (ha : 1≤a) (hab : a ‖cuspRemainderProfile a b s (cosetHeight r (integralComplexMatrix M • upperPoint z v hv0))‖) ∧ (∑'r : CuspCosets,‖cuspRemainderProfile a b s (cosetHeight r (integralComplexMatrix M • upperPoint z v hv0))‖)≤eisensteinRemainderBound b s := by let G : ((Fin 2×Fin 2)→ℤ)→ℝ := fun n => (max 5 (2*b))^s.re*‖n‖^(-s.re) let f : CuspCosets→(Fin 2×Fin 2)→ℤ := fun r => rowCoordinates (translatedCuspRow M r) let R : CuspCosets→ℝ := fun r => ‖cuspRemainderProfile a b s (cosetHeight r (integralComplexMatrix M • upperPoint z v hv0))‖ have hg : Summable G := (summable_integer_four_rpow s.re hs).mul_left _ have hi : Function.Injective f := rowCoordinates_injective.comp (translatedCuspRow_injective M) have hb : ∀r,R r≤G (f r) := by intro r simpa only [norm_mul,norm_inv,norm_cosetCharacter,inv_one,one_mul] using translated_remainder_majorant a b s hab (by linarith) (by linarith) M z hz v hv hv0 r have hr : Summable R := (hg.comp_injective hi).of_nonneg_of_le (fun _ => norm_nonneg _) hb refine ⟨hr,?_⟩ have hsum : (∑'r,R r)≤∑'n,G n := Summable.tsum_le_tsum_of_inj f hi (fun _ _ => by dsimp [G]; positivity) hb hr hg simpa only [G,tsum_mul_left,eisensteinRemainderBound] using hsum theorem cuspRemainder_absolute_bound (a b : ℝ) (ha : 1≤a) (hab : a ‖cuspRemainderProfile a b s (cosetHeight r w)‖) ∧ (∑'r : CuspCosets,‖cuspRemainderProfile a b s (cosetHeight r w)‖)≤eisensteinRemainderBound b s := by obtain ⟨M,z,v,hv,hMw,hz,hfloor⟩ := bianchi_reduction_height_floor w have hz1 : ‖z‖≤1 := by rw [Complex.normSq_eq_norm_sq] at hz nlinarith [norm_nonneg z] have hv1 : 1/2≤v := by have hh := Real.sq_sqrt (by norm_num : (0:ℝ)≤2/3) have hh0 := Real.sqrt_nonneg (2/3 : ℝ) nlinarith have hw : w=integralComplexMatrix M⁻¹ • upperPoint z v hv := by rw [←hMw,map_inv,inv_smul_smul] rw [hw] exact cuspRemainder_absolute_chart a b ha hab s hs M⁻¹ z hz1 v hv1 hv lemma cuspRemainder_aux_norm (b : ℝ) (s : ℂ) (v : ℝ) (hv : 0 cuspRemainderProfile a b s (rowHeight u q)) p j) (p j)‖≤ (‖s‖+C)*‖cuspRemainderProfile (b+1) (b+2) s (rowHeight u p)‖ := by have hh := rowHeight_pos u hu p hp by_cases hb : rowHeight u p≤b · rw [cuspRemainder_aux_norm b s _ hh hb] exact cuspRemainder_row_scaled_deriv_bound a b s C hC u hu p hp j · have hd := (rowProfile_axis_derivatives (cuspRemainderProfile a b s) (cuspRemainderProfile_contDiffAt a b s) u hu p hp j).1 rw [hd.deriv,cuspRemainderProfile_deriv_zero a b s _ hab hh (lt_of_not_ge hb)] simp only [zero_mul,mul_zero,norm_zero] exact mul_nonneg (add_nonneg (norm_nonneg s) hC0) (norm_nonneg _) end open Filter open scoped BigOperators Classical Topology ContDiff def weightedHeightProfile (F : ℝ→ℂ) (r : CuspCosets) (p : SpatialCoordinates) : ℂ := (cosetCharacter r)⁻¹*F (rowHeight (embeddedRow r) p) lemma weightedHeightProfile_axis_differentiable (F : ℝ→ℂ) (hF : ∀v,0 deriv (axisSlice (weightedHeightProfile F r) p j) (p j)) ∧ HasDerivAt (axisSlice (heightPoincareField F) p j) (∑'r,deriv (axisSlice (weightedHeightProfile F r) p j) (p j)) (p j) := by obtain ⟨U,hU,hpU,S,hrows⟩ := locally_finite_high_rows p hp have ht : Tendsto (fun t => Function.update p j t) (𝓝 (p j)) (𝓝 p) := by simpa only [ContinuousAt,Function.update_eq_self] using ((continuous_axis_update p j).continuousAt (x := p j)) have hn : ∀ᶠt in 𝓝 (p j),Function.update p j t∈U := ht (hU.mem_nhds hpU) have hz (r : CuspCosets) (hr : r∉S) : deriv (axisSlice (weightedHeightProfile F r) p j) (p j)=0 := by have he : axisSlice (weightedHeightProfile F r) p j=ᶠ[𝓝 (p j)] (fun _ => 0) := by filter_upwards [hn] with t ht change (cosetCharacter r)⁻¹*F (rowHeight (embeddedRow r) (Function.update p j t))=0 rw [hzero _ ((hrows _ ht).2 r hr).le,mul_zero] exact he.deriv_eq.trans (deriv_const _ _) refine ⟨summable_of_ne_finset_zero hz,?_⟩ rw [tsum_eq_sum hz] have hd := HasDerivAt.sum (u := S) (fun r hr => (weightedHeightProfile_axis_differentiable F hF r p hp j).hasDerivAt) apply hd.congr_of_eventuallyEq filter_upwards [hn] with t ht simp only [Finset.sum_apply] change (∑'r,weightedHeightProfile F r (Function.update p j t))= ∑r∈S,weightedHeightProfile F r (Function.update p j t) apply tsum_eq_sum intro r hr change (cosetCharacter r)⁻¹*F (rowHeight (embeddedRow r) (Function.update p j t))=0 rw [hzero _ ((hrows _ ht).2 r hr).le,mul_zero] lemma weightedRemainder_axis_deriv (a b : ℝ) (s : ℂ) (r : CuspCosets) (p : SpatialCoordinates) (hp : 0

axisSlice (smoothSummand s r) p j t- axisSlice (weightedHeightProfile (cuspSeedProfile a b s) r) p j t) := by filter_upwards [hn] with t ht simp only [axisSlice,weightedHeightProfile,cuspRemainderProfile,smoothSummand] rw [rowSmoothPower_eq_height s _ (embeddedRow_ne_zero r) _ ht, positiveHeightPower_eq_cpow s _ (rowHeight_pos _ (embeddedRow_ne_zero r) _ ht)] ring rw [he.deriv_eq] exact deriv_sub (smooth_axis_differentiable s r p hp j) (weightedHeightProfile_axis_differentiable _ (cuspSeedProfile_contDiffAt a b s) r p hp j) def eisensteinRemainderField (a b : ℝ) (s : ℂ) (p : SpatialCoordinates) : ℂ := smoothEisenstein s p-smoothCuspSeedField a b s p theorem eisensteinRemainder_axis_termwise (a b : ℝ) (ha : 1 deriv (axisSlice (weightedHeightProfile (cuspRemainderProfile a b s) r) p j) (p j)) ∧ HasDerivAt (axisSlice (eisensteinRemainderField a b s) p j) (∑'r,deriv (axisSlice (weightedHeightProfile (cuspRemainderProfile a b s) r) p j) (p j)) (p j) := by have hE := eisenstein_axis_termwise s hs p hp j have hS := heightPoincare_axis_termwise (cuspSeedProfile a b s) (fun v hv => cuspSeedProfile_zero a b s v hab (hv.trans ha.le)) (cuspSeedProfile_contDiffAt a b s) p hp j have hcoeff : (∑'r,deriv (axisSlice (weightedHeightProfile (cuspRemainderProfile a b s) r) p j) (p j))= (∑'r,deriv (axisSlice (smoothSummand s r) p j) (p j))- ∑'r,deriv (axisSlice (weightedHeightProfile (cuspSeedProfile a b s) r) p j) (p j) := by simp_rw [weightedRemainder_axis_deriv a b s _ p hp j] exact hE.1.tsum_sub hS.1 refine ⟨(hE.1.sub hS.1).congr (fun r => (weightedRemainder_axis_deriv a b s r p hp j).symm),?_⟩ rw [hcoeff] apply (hE.2.2.1.sub hS.2).congr_of_eventuallyEq have hn : ∀ᶠt in 𝓝 (p j),0<(Function.update p j t) 2 := by apply ((continuous_apply 2).comp (continuous_axis_update p j)).continuousAt.eventually_const_lt simpa only [Function.comp_apply,Function.update_eq_self] using hp filter_upwards [hn] with t ht change smoothEisenstein s _-smoothCuspSeedField a b s _= smoothEisenstein s _-heightPoincareField (cuspSeedProfile a b s) _ rw [smoothCuspSeedField_eq a b s ha hab _ ht] end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold namespace CubicEisenstein lemma weightedRemainder_scaled_deriv_bound (a b : ℝ) (hab : a cuspRemainderProfile a b s (rowHeight (embeddedRow r) q) have hd := (rowProfile_axis_derivatives (cuspRemainderProfile a b s) (cuspRemainderProfile_contDiffAt a b s) (embeddedRow r) (embeddedRow_ne_zero r) p hp j).1 have hw := hd.const_mul (cosetCharacter r)⁻¹ have he : deriv (axisSlice (weightedHeightProfile (cuspRemainderProfile a b s) r) p j) (p j)= (cosetCharacter r)⁻¹*deriv (axisSlice g p j) (p j) := by change deriv (fun t => (cosetCharacter r)⁻¹*axisSlice g p j t) (p j)=_ rw [hw.deriv,hd.deriv] rw [he] calc ‖(p 2:ℂ)*((cosetCharacter r)⁻¹*deriv (axisSlice g p j) (p j))‖ = ‖(cosetCharacter r)⁻¹*((p 2:ℂ)*deriv (axisSlice g p j) (p j))‖ := by congr 1; ring _ = ‖(p 2:ℂ)*deriv (axisSlice g p j) (p j)‖ := by rw [norm_mul,norm_inv,norm_cosetCharacter,inv_one,one_mul] _ ≤ _ := cuspRemainder_row_scaled_deriv_aux_bound a b hab s C hC0 hC _ (embeddedRow_ne_zero r) p hp j theorem eisensteinRemainder_scaled_axis_bound (a b : ℝ) (ha : 1 ‖cuspRemainderProfile (b+1) (b+2) s (rowHeight (embeddedRow r) p)‖) ∧ (∑'r : CuspCosets,‖cuspRemainderProfile (b+1) (b+2) s (rowHeight (embeddedRow r) p)‖)≤ eisensteinRemainderBound (b+2) s := by simpa only [cosetHeight_upperPoint_rowHeight] using cuspRemainder_absolute_bound (b+1) (b+2) (by linarith) (by linarith) s hs (upperPoint ((p 0:ℂ)+(p 1:ℂ)*Complex.I) (p 2) hp) have hB := hA.1.mul_left (‖s‖+C) have hb (r : CuspCosets) := weightedRemainder_scaled_deriv_bound a b hab s C hC0 hC r p hp j have hnorm := hB.of_nonneg_of_le (fun r => norm_nonneg ((p 2:ℂ)*deriv (axisSlice (weightedHeightProfile (cuspRemainderProfile a b s) r) p j) (p j))) hb have ht := eisensteinRemainder_axis_termwise a b ha hab s (by linarith) p hp j rw [ht.2.deriv,←tsum_mul_left] apply (norm_tsum_le_tsum_norm hnorm).trans apply (Summable.tsum_le_tsum hb hnorm hB).trans rw [tsum_mul_left] exact mul_le_mul_of_nonneg_left hA.2 (add_nonneg (norm_nonneg s) hC0) def kernelEisensteinRemainder (a b : ℝ) (s : ℂ) (hs : 2 kernelQuotientEisenstein s hs q-kernelQuotientSeed a b s q lemma kernelEisensteinRemainder_smooth (a b : ℝ) (ha : 1 kernelEisensteinRemainder a b s hs (kernelEuclideanProjection q)) p := letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace ((((kernelEisensteinRemainder_smooth a b ha hab s hs).comp kernelProjection_contMDiff) (euclideanToHyperbolic p)).comp p (euclideanToHyperbolic_contMDiffAt p hp)).contDiffAt lemma kernelEisensteinRemainder_euclidean_eq (a b : ℝ) (s : ℂ) (hs : 2 kernelEisensteinRemainder a b s (by linarith) (kernelEuclideanProjection q)) p (euclideanCoordinateVector j)‖≤B := by obtain ⟨B,hB,hbound⟩ := eisensteinRemainder_scaled_axis_bound a b ha hab s hs refine ⟨B,hB,?_⟩ intro p hp j let f : EuclideanSpatial→ℂ:=fun q => kernelEisensteinRemainder a b s (by linarith) (kernelEuclideanProjection q) have hf : ∀q,0 (hf n).toLp (f n)) atTop (𝓝 (hg.toLp g)) := by have hsq : Tendsto (fun n => ∫a,‖f n a-g a‖^2∂«μ») atTop (𝓝 0) := by have h := tendsto_integral_of_dominated_convergence («μ» := «μ») (F := fun n a => ‖f n a-g a‖^2) (f := fun _ => (0:ℝ)) (fun _ => (B+C)^2) (fun n => ((hf n).aestronglyMeasurable.sub hg.aestronglyMeasurable).norm.pow 2) (integrable_const _) ?_ ?_ · simpa only [integral_zero] using h · intro n exact Eventually.of_forall (fun a => by rw [Real.norm_of_nonneg (sq_nonneg _)] apply (sq_le_sq₀ (norm_nonneg _) (add_nonneg hB hC)).mpr exact (norm_sub_le _ _).trans (add_le_add (hfB n a) (hgC a))) · exact Eventually.of_forall (fun a => by apply tendsto_const_nhds.congr' filter_upwards [hlim a] with n hn simp only [hn,sub_self,norm_zero,zero_pow (by decide : 2≠0)]) have hn : Tendsto (fun n => ‖(hf n).toLp (f n)-hg.toLp g‖^2) atTop (𝓝 0) := by simpa only [l2_toLp_sub_norm_sq] using hsq apply tendsto_iff_norm_sub_tendsto_zero.mpr have hsqrt := Real.continuous_sqrt.continuousAt.tendsto.comp hn simpa only [Function.comp_def,Real.sqrt_sq_eq_abs,abs_norm,Real.sqrt_zero] using hsqrt end BoundedConvergence theorem kernelFundamentalVolume_finite : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace IsFiniteMeasure KernelFundamentalVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by refine ⟨?_⟩ change (hyperbolicVolume.restrict (hyperbolicFundamentalSet globalKubotaKernel)) Set.univ<⊤ rw [Measure.restrict_apply MeasurableSet.univ,Set.univ_inter] let : globalKubotaKernel.FiniteIndex := globalKubotaKernel_finiteIndex exact hyperbolicFundamentalSet_volume_lt_top globalKubotaKernel globalKubotaKernel_le_levelThree def kernelFunctionField (f : KernelQuotient→ℂ) (p : EuclideanSpatial) : ℂ := f (kernelEuclideanProjection p) lemma kernelFunctionField_smooth : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (p : EuclideanSpatial) (hp : 0

let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace (((hf.comp kernelProjection_contMDiff) (euclideanToHyperbolic p)).comp p (euclideanToHyperbolic_contMDiffAt p hp)).contDiffAt def kernelFunctionGradient (f : KernelQuotient→ℂ) (w : HyperbolicSpace) : EuclideanSpace ℂ (Fin 3) := WithLp.toLp 2 (fun j => (hyperbolicHeight w:ℂ)* fderiv ℝ (kernelFunctionField f) (hyperbolicEuclideanCoordinates w) (euclideanCoordinateVector j)) lemma kernelFunctionGradient_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f), Continuous (kernelFunctionGradient f) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) => by apply (PiLp.continuousLinearEquiv 2 ℂ (fun _ : Fin 3 => ℂ)).symm.continuous.comp apply continuous_pi intro j apply (Complex.continuous_ofReal.comp hyperbolicHeight_continuous).mul rw [continuous_iff_continuousAt] intro w exact (((kernelFunctionField_smooth f hf _ (hyperbolicHeight_pos w)).continuousAt_fderiv (by simp)).clm_apply continuousAt_const).comp hyperbolicEuclideanCoordinates_continuous.continuousAt lemma norm_three_vector_bound (v : EuclideanSpace ℂ (Fin 3)) (B : ℝ) (hB : 0≤B) (hv : ∀j,‖v j‖≤B) : ‖v‖≤3*B := by have hsq : ‖v‖^2≤3*B^2 := by rw [PiLp.norm_sq_eq_of_L2] calc _ ≤ ∑j : Fin 3,B^2 := Finset.sum_le_sum (fun j hj => (sq_le_sq₀ (norm_nonneg _) hB).mpr (hv j)) _ = _ := by simp nlinarith [norm_nonneg v,sq_nonneg B] lemma kernelFunctionGradient_bound (f : KernelQuotient→ℂ) (B : ℝ) (hB : 0≤B) (hgrad : ∀p : EuclideanSpatial,0

letI := @OAI.CubicEisenstein.kernelFundamentalVolume_finite MemLp.of_bound (kernelFunctionGradient_continuous f hf).aestronglyMeasurable (3*B) (Eventually.of_forall (kernelFunctionGradient_bound f B hB hgrad)) def kernelFunctionCutoff : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (n : ℕ) (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f), kernelSmoothTests := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (n : ℕ) (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) => by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel refine ⟨fun q => (kernelExhaustionCutoff n q:ℂ)*f q,?_,?_⟩ · have hm : ContDiff ℝ ∞ (fun z : ℂ × ℂ => z.1*z.2) := contDiff_fst.mul contDiff_snd exact hm.contMDiff.comp ((Complex.ofRealCLM.contDiff.contMDiff.comp (kernelExhaustionCutoff_smooth n)).prodMk_space hf) · apply HasCompactSupport.of_support_subset_isCompact (kernelExhaustionCutoff_hasCompactSupport n) intro q hq by_contra hn have hz : kernelExhaustionCutoff n q=0 := image_eq_zero_of_notMem_tsupport hn exact hq (by simp [hz]) lemma kernelFunctionCutoff_apply : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (n : ℕ) (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (q : KernelQuotient), (kernelFunctionCutoff n f hf).1 q=(kernelExhaustionCutoff n q:ℂ)*f q := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (n : ℕ) (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (q : KernelQuotient) => rfl lemma kernelFunctionCutoff_field : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (n : ℕ) (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f), kernelTestField (kernelFunctionCutoff n f hf)= fun p => (kernelExhaustionCutoff n (kernelEuclideanProjection p):ℂ)*kernelFunctionField f p := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (n : ℕ) (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) => rfl lemma kernelFunctionCutoff_field_eventually : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (p : EuclideanSpatial) (hp : 0

by let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace have hc : ContinuousAt kernelEuclideanProjection p := (continuous_integralOrbitProjection globalKubotaKernel).continuousAt.comp (euclideanToHyperbolic_contMDiffAt p hp).continuousAt filter_upwards [kernelExhaustionCutoff_eventually_one_near (kernelEuclideanProjection p)] with n hn filter_upwards [hn.comp_tendsto hc] with q hq change kernelExhaustionCutoff n (kernelEuclideanProjection q)=1 at hq change (kernelExhaustionCutoff n (kernelEuclideanProjection q):ℂ)*kernelFunctionField f q=kernelFunctionField f q rw [hq] simp lemma kernelFunctionCutoff_gradient_eventually : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (w : HyperbolicSpace), ∀ᶠn : ℕ in atTop,kernelGradientAt w (kernelFunctionCutoff n f hf)=kernelFunctionGradient f w := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (w : HyperbolicSpace) => by filter_upwards [kernelFunctionCutoff_field_eventually f hf (hyperbolicEuclideanCoordinates w) (hyperbolicHeight_pos w)] with n hn apply (WithLp.equiv 2 (Fin 3→ℂ)).injective funext j change (hyperbolicHeight w:ℂ)*fderiv ℝ (kernelTestField (kernelFunctionCutoff n f hf)) _ _= (hyperbolicHeight w:ℂ)*fderiv ℝ (kernelFunctionField f) _ _ rw [hn.fderiv_eq,euclideanCoordinateVector_eq_basis] lemma kernelFunctionCutoff_mass_bound : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (B : ℝ) (_hB : 0≤B) (hbound : ∀q,‖f q‖≤B) (n : ℕ) (q : KernelQuotient), ‖(kernelFunctionCutoff n f hf).1 q‖≤B := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (B : ℝ) (_hB : 0≤B) (hbound : ∀q,‖f q‖≤B) (n : ℕ) (q : KernelQuotient) => by rw [kernelFunctionCutoff_apply,norm_mul,Complex.norm_of_nonneg (kernelExhaustionCutoff_bounds n q).1] exact (mul_le_mul (kernelExhaustionCutoff_bounds n q).2 (hbound q) (norm_nonneg _) zero_le_one).trans_eq (one_mul B) lemma kernelFunctionCutoff_scaled_deriv_bound : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (B G D : ℝ) (hB : 0≤B) (hfB : ∀q,‖f q‖≤B) (hgrad : ∀p : EuclideanSpatial,0

(kernelExhaustionCutoff n (kernelEuclideanProjection q):ℂ)) p (euclideanCoordinateVector j)‖≤D) (n : ℕ) (p : EuclideanSpatial) (hp : 0

(kernelExhaustionCutoff n (kernelEuclideanProjection q):ℂ)) p (euclideanCoordinateVector j)‖≤D) (n : ℕ) (p : EuclideanSpatial) (hp : 0

by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let c : EuclideanSpatial→ℂ:=fun q => (kernelExhaustionCutoff n (kernelEuclideanProjection q):ℂ) have hc : DifferentiableAt ℝ c p := (kernelFunctionField_smooth (fun q => (kernelExhaustionCutoff n q:ℂ)) (Complex.ofRealCLM.contDiff.contMDiff.comp (kernelExhaustionCutoff_smooth n)) p hp).differentiableAt (by simp) have hd := (kernelFunctionField_smooth f hf p hp).differentiableAt (by simp) rw [kernelFunctionCutoff_field,fderiv_fun_mul hc hd] simp only [_root_.add_apply,_root_.smul_apply,smul_eq_mul] have he : (p 2:ℂ)*(c p*fderiv ℝ (kernelFunctionField f) p (euclideanCoordinateVector j)+ kernelFunctionField f p*fderiv ℝ c p (euclideanCoordinateVector j))= c p*((p 2:ℂ)*fderiv ℝ (kernelFunctionField f) p (euclideanCoordinateVector j))+ kernelFunctionField f p*((p 2:ℂ)*fderiv ℝ c p (euclideanCoordinateVector j)) := by ring change ‖(p 2:ℂ)*(c p*fderiv ℝ (kernelFunctionField f) p (euclideanCoordinateVector j)+ kernelFunctionField f p*fderiv ℝ c p (euclideanCoordinateVector j))‖≤_ rw [he] apply (norm_add_le _ _).trans rw [norm_mul,norm_mul] have hc1 : ‖c p‖≤1 := by rw [Complex.norm_of_nonneg (kernelExhaustionCutoff_bounds n _).1] exact (kernelExhaustionCutoff_bounds n _).2 have hleft : ‖c p‖*‖(p 2:ℂ)*fderiv ℝ (kernelFunctionField f) p (euclideanCoordinateVector j)‖≤G := (mul_le_mul hc1 (hgrad p hp j) (norm_nonneg _) zero_le_one).trans_eq (one_mul G) have hright : ‖kernelFunctionField f p‖*‖(p 2:ℂ)*fderiv ℝ c p (euclideanCoordinateVector j)‖≤B*D := mul_le_mul (hfB (kernelEuclideanProjection p)) (hcut n p hp j) (norm_nonneg _) hB simpa only [norm_mul] using add_le_add hleft hright lemma kernelFunctionCutoff_gradient_bound : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (B G : ℝ) (hB : 0≤B) (hG : 0≤G) (hfB : ∀q,‖f q‖≤B) (hgrad : ∀p : EuclideanSpatial,0

by obtain ⟨D,hD,hcut⟩ := kernelExhaustionCutoff_scaled_fderiv_bound refine ⟨3*(G+B*D),by positivity,?_⟩ intro n w apply norm_three_vector_bound _ (G+B*D) (by positivity) intro j change ‖(hyperbolicHeight w:ℂ)*fderiv ℝ (kernelTestField (kernelFunctionCutoff n f hf)) (hyperbolicEuclideanCoordinates w) (EuclideanSpace.basisFun (Fin 3) ℝ j)‖≤_ rw [←euclideanCoordinateVector_eq_basis] exact kernelFunctionCutoff_scaled_deriv_bound f hf B G D hB hfB hgrad hcut n (hyperbolicEuclideanCoordinates w) (hyperbolicHeight_pos w) j theorem kernelFunctionCutoff_mass_tendsto : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (hfL : MemLp f 2 (integralQuotientVolume globalKubotaKernel)) (B : ℝ) (hB : 0≤B) (hbound : ∀q,‖f q‖≤B), Tendsto (fun n => kernelSmoothTestsToL2 (kernelFunctionCutoff n f hf)) atTop (𝓝 (hfL.toLp f)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_kernelQuotientVolume_finite := @OAI.CubicEisenstein.kernelQuotientVolume_finite fun (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (hfL : MemLp f 2 (integralQuotientVolume globalKubotaKernel)) (B : ℝ) (hB : 0≤B) (hbound : ∀q,‖f q‖≤B) => by apply l2_tendsto_of_bounded_eventuallyEq (integralQuotientVolume globalKubotaKernel) (fun n => (kernelFunctionCutoff n f hf).1) f (fun n => kernelSmoothTests_memLp (kernelFunctionCutoff n f hf)) hfL B B hB hB (kernelFunctionCutoff_mass_bound f hf B hB hbound) hbound intro q filter_upwards [kernelExhaustionCutoff_eventually_one q] with n hn rw [kernelFunctionCutoff_apply,hn] simp theorem kernelFunctionCutoff_gradient_tendsto : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (hgL : MemLp (kernelFunctionGradient f) 2 KernelFundamentalVolume) (B G : ℝ) (hB : 0≤B) (hG : 0≤G) (hfB : ∀q,‖f q‖≤B) (hgrad : ∀p : EuclideanSpatial,0

kernelGradientToL2 (kernelFunctionCutoff n f hf)) atTop (𝓝 (hgL.toLp (kernelFunctionGradient f))) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (hgL : MemLp (kernelFunctionGradient f) 2 KernelFundamentalVolume) (B G : ℝ) (hB : 0≤B) (hG : 0≤G) (hfB : ∀q,‖f q‖≤B) (hgrad : ∀p : EuclideanSpatial,0

letI := @OAI.CubicEisenstein.kernelFundamentalVolume_finite by obtain ⟨D,hD,hbound⟩ := kernelFunctionCutoff_gradient_bound f hf B G hB hG hfB hgrad apply l2_tendsto_of_bounded_eventuallyEq KernelFundamentalVolume (fun n w => kernelGradientAt w (kernelFunctionCutoff n f hf)) (kernelFunctionGradient f) (fun n => kernelGradientAt_memLp (kernelFunctionCutoff n f hf)) hgL D (3*G) hD (by positivity) hbound (kernelFunctionGradient_bound f G hG hgrad) exact kernelFunctionCutoff_gradient_eventually f hf theorem kernel_bounded_smooth_energy_exists : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (hfL : MemLp f 2 (integralQuotientVolume globalKubotaKernel)) (hgL : MemLp (kernelFunctionGradient f) 2 KernelFundamentalVolume) (B G : ℝ) (hB : 0≤B) (hG : 0≤G) (hfB : ∀q,‖f q‖≤B) (hgrad : ∀p : EuclideanSpatial,0

by let x : KernelEnergyAmbient:=WithLp.toLp 2 (hfL.toLp f,hgL.toLp (kernelFunctionGradient f)) have hm := kernelFunctionCutoff_mass_tendsto f hf hfL B hB hfB have hg := kernelFunctionCutoff_gradient_tendsto f hf hgL B G hB hG hfB hgrad have hp := hm.prodMk_nhds hg have ht : Tendsto (fun n => kernelEnergyCore (kernelFunctionCutoff n f hf)) atTop (𝓝 x) := by have h := (WithLp.prodContinuousLinearEquiv 2 ℂ KernelQuotientL2 KernelGradientL2).symm.continuous.continuousAt.tendsto.comp hp exact h have hx : x∈kernelEnergyGraphSubmodule := by change x∈closure (Set.range kernelEnergyCore) exact mem_closure_of_tendsto ht (Eventually.of_forall (fun n => ⟨kernelFunctionCutoff n f hf,rfl⟩)) exact ⟨⟨x,hx⟩,rfl,rfl⟩ def kernelEisensteinRemainderL2 : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 1 (kernel_eisenstein_sub_seed_memLp a b ha.le hab s hs).toLp (kernelEisensteinRemainder a b s (by linarith)) lemma kernelEisensteinRemainderL2_ae : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 1 (kernel_eisenstein_sub_seed_memLp a b ha.le hab s hs).coeFn_toLp section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold Matrix lemma axis_update_contDiff (p : SpatialCoordinates) (j : Fin 3) : ContDiff ℝ ∞ (fun t => Function.update p j t) := by apply contDiff_pi.mpr intro k by_cases h : k=j · subst k simpa only [Function.update_self,id_eq] using! (contDiff_id : ContDiff ℝ ∞ (fun t : ℝ => t)) · simpa only [Function.update_of_ne h] using (contDiff_const : ContDiff ℝ ∞ (fun _ : ℝ => p k)) lemma smooth_positive_axis_regular (f : SpatialCoordinates→ℂ) (hf : ∀p,0

f q-g q) p=axisLaplacian f p-axisLaplacian g p := by let F : Fin 2→SpatialCoordinates→ℂ:=![f,fun q => (-1:ℂ)*g q] have hF : ∀i : Fin 2,∀q,0 smooth_positive_axis_regular (F i) (hF i) q hq j) p hp have he : (fun q => ∑i : Fin 2,F i q)=(fun q => f q-g q) := by funext q simp [F,Fin.sum_univ_two,sub_eq_add_neg] rw [he] at hh simp only [Fin.sum_univ_two,F,Matrix.cons_val_zero,Matrix.cons_val_one] at hh rw [axisLaplacian_const_mul] at hh simpa only [neg_one_mul,sub_eq_add_neg] using hh lemma eisensteinRemainder_coordinate_equation (a b : ℝ) (ha : 1 by let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace obtain ⟨C,hC⟩ := hK.bddAbove_image (kernelQuotientBarrier_continuous 2 3 (by norm_num) (by norm_num)).continuousOn obtain ⟨N,hN⟩ := exists_nat_gt C refine ⟨N,?_⟩ intro n hn p hp hpK have hheight : kernelQuotientBarrier 2 3 (kernelEuclideanProjection p)<(n:ℝ)+1 := by have hh := hC ⟨kernelEuclideanProjection p,hpK,rfl⟩ have hcast : (N:ℝ)≤n := by exact_mod_cast hn linarith have hnear := (kernelQuotientBarrier_continuous 2 3 (by norm_num) (by norm_num)).continuousAt.eventually_lt_const hheight have hc : ContinuousAt kernelEuclideanProjection p := (continuous_integralOrbitProjection globalKubotaKernel).continuousAt.comp (euclideanToHyperbolic_contMDiffAt p hp).continuousAt filter_upwards [hc hnear] with q hq change (kernelExhaustionProfile n (kernelQuotientBarrier 2 3 (kernelEuclideanProjection q)):ℂ)* kernelFunctionField f q=kernelFunctionField f q rw [kernelExhaustionProfile_one n _ hq.le] simp lemma kernelBoundedFunction_form_equation : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (hgL : MemLp (kernelFunctionGradient f) 2 KernelFundamentalVolume) (B G : ℝ) (hB : 0≤B) (hG : 0≤G) (hfB : ∀q,‖f q‖≤B) (hgrad : ∀p : EuclideanSpatial,0

by obtain ⟨N,hN⟩ := kernelFunctionCutoff_uniform_near f hf (tsupport g.1) g.2.2 have hconstant : ∀ᶠn : ℕ in atTop, inner ℂ (kernelGradientToL2 (kernelFunctionCutoff n f hf)) (kernelGradientToL2 g)= inner ℂ (hA.toLp A) (kernelSmoothTestsToL2 g) := by filter_upwards [eventually_ge_atTop N] with n hn rw [kernelGradientToL2_inner,kernelL2_inner_toLp_smooth] apply kernelDirichletForm_supported_equation (kernelFunctionCutoff n f hf) g A hA intro p hp hpg change positiveEuclideanLaplacian (kernelTestField (kernelFunctionCutoff n f hf)) p=A (kernelEuclideanProjection p) rw [positiveEuclideanLaplacian_congr _ _ p (hN n hn p hp hpg)] exact hEq p hp have hlim : Tendsto (fun n => inner ℂ (kernelGradientToL2 (kernelFunctionCutoff n f hf)) (kernelGradientToL2 g)) atTop (𝓝 (inner ℂ (hgL.toLp (kernelFunctionGradient f)) (kernelGradientToL2 g))) := (kernelFunctionCutoff_gradient_tendsto f hf hgL B G hB hG hfB hgrad).inner (tendsto_const_nhds (x := kernelGradientToL2 g)) exact tendsto_nhds_unique hlim (tendsto_const_nhds.congr' (hconstant.mono (fun n hn => hn.symm))) theorem kernel_bounded_smooth_operator_graph : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (f : KernelQuotient→ℂ) (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) (hfL : MemLp f 2 (integralQuotientVolume globalKubotaKernel)) (B G : ℝ) (hB : 0≤B) (hG : 0≤G) (hfB : ∀q,‖f q‖≤B) (hgrad : ∀p : EuclideanSpatial,0

by have hgL := kernelFunctionGradient_memLp f hf G hG hgrad obtain ⟨u,hum,hug⟩ := kernel_bounded_smooth_energy_exists f hf hfL hgL B G hB hG hfB hgrad have hform (v : KernelEnergyGraph) : inner ℂ (kernelEnergyGradient u) (kernelEnergyGradient v)=inner ℂ (hA.toLp A) (kernelEnergyMass v) := by exact kernelEnergyGraphCore_dense.induction_on v (isClosed_eq (by fun_prop : Continuous (fun v : KernelEnergyGraph => inner ℂ (kernelEnergyGradient u) (kernelEnergyGradient v))) (by fun_prop : Continuous (fun v : KernelEnergyGraph => inner ℂ (hA.toLp A) (kernelEnergyMass v)))) (fun g => by rw [hug,kernelEnergyGradient_core,kernelEnergyMass_core] exact kernelBoundedFunction_form_equation f hf hgL B G hB hG hfB hgrad A hA hEq g) have hu : u=kernelVariationalSolution (hfL.toLp f+hA.toLp A) := by apply kernelVariationalSolution_unique intro v rw [hum,hform v,inner_add_left] have hm := congrArg kernelEnergyMass hu rw [hum] at hm rw [kernelEnergyLaplacian_graph,mem_kernelLaplacianGraph] exact hm.symm open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff Manifold theorem kernelEisensteinRemainderL2_graph : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (a b : ℝ) (ha : 1 by let f := kernelEisensteinRemainder a b s (by linarith) have hf := kernelEisensteinRemainder_smooth a b ha hab s (by linarith) have hfL : MemLp f 2 (integralQuotientVolume globalKubotaKernel) := kernel_eisenstein_sub_seed_memLp a b ha.le hab s hs have hfB : ∀q,‖f q‖≤eisensteinRemainderBound b s := by intro q induction q using Quotient.inductionOn with | _ w => exact eisenstein_sub_seed_bounded a b ha.le hab s hs w obtain ⟨G,hG,hgrad⟩ := kernelEisensteinRemainder_scaled_fderiv_bound a b ha hab s hs let A : KernelQuotient→ℂ := fun q => kernelQuotientDefect a b s q+ kernelEisensteinSpectralParameter s*f q have hD := kernelQuotientDefect_memLp a b s (by linarith) hab have hA : MemLp A 2 (integralQuotientVolume globalKubotaKernel) := hD.add (hfL.const_smul (kernelEisensteinSpectralParameter s)) have hEq : ∀p : EuclideanSpatial,0

hD.toLp (kernelQuotientDefect a b s)+x) (hfL.toLp_const_smul (kernelEisensteinSpectralParameter s))) rw [hAL] at hgraph exact hgraph theorem kernelEisensteinL2Correction_eq_remainder : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 1 by exact kernelEisensteinL2Correction_unique a b (by linarith) hab s (kernelSpectralFormOperator_isUnit_nonreal _ (kernelEisensteinSpectralParameter_nonreal s (by linarith) (by linarith))) _ (kernelEisensteinRemainderL2_graph a b ha hab s hs) theorem kernelEisensteinL2Correction_initial_overlap : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (a b : ℝ) (ha : 1 kernelQuotientEisenstein s (by linarith) q-kernelQuotientSeed a b s q := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (a b : ℝ) (ha : 1 by rw [kernelEisensteinL2Correction_eq_remainder a b ha hab s hs hi] exact kernelEisensteinRemainderL2_ae a b ha hab s hs end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CuspResidues namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace MatrixGroups Matrix lemma levelThree_integral_eq_translation (M : CubicKubota.levelThree) (hc : (M : SL(2,ActualEisensteinCubic.O)) 1 0=0) : integralComplexMatrix M.1=complexTranslation (ConcreteTraceCRT.eisEmbedding ((M : SL(2,ActualEisensteinCubic.O)) 0 1)) := by have hr := row_eq_one_of_lower_left_zero M hc have hd : (M : SL(2,ActualEisensteinCubic.O)) 1 1=1 := by simpa [row,Matrix.one_apply] using congrFun hr 1 have ha : (M : SL(2,ActualEisensteinCubic.O)) 0 0=1 := by have hh : (M : SL(2,ActualEisensteinCubic.O)) 0 0 * (M : SL(2,ActualEisensteinCubic.O)) 1 1- (M : SL(2,ActualEisensteinCubic.O)) 0 1 * (M : SL(2,ActualEisensteinCubic.O)) 1 0=1 := by simpa only [Matrix.det_fin_two] using (M : SL(2,ActualEisensteinCubic.O)).property simpa only [hc,hd,mul_zero,mul_one,sub_zero] using hh ext i j fin_cases i <;> fin_cases j <;> simp [integralComplexMatrix_apply,complexTranslation,ha,hc,hd] lemma periodDomain_unique_translate (z w t : ℂ) (hz : z∈periodDomain) (hw : w∈periodDomain) (ht : t∈periodLattice) (he : z=w+t) : z=w := by have hf := ZSpan.fract_add_ZSpan periodBasis w ht rw [←he,(ZSpan.fract_eq_self (b := periodBasis)).mpr hz, (ZSpan.fract_eq_self (b := periodBasis)).mpr hw] at hf exact hf def cuspPeriodRegion : Set HyperbolicSpace := {w | hyperbolicHorizontal w∈periodDomain ∧ 1 (s-4/3)*kernelCuspAverageFamily a b ha hab s) (𝓝[≠] (4/3:ℂ)) (𝓝 (kernelCuspStripAverage (kernelEisensteinResidueVector a b ha hab))) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by have hh := kernelCuspStripAverage.continuous.continuousAt.tendsto.comp (kernelLocalCorrectedSeed_residue_limit kernelCuspAverageCompact kernelCuspAverageCompact_isCompact a b ha hab) simpa only [Function.comp_def,map_smul,smul_eq_mul,kernelCuspStripAverage_restrict,kernelCuspAverageFamily] using hh lemma kernelCuspAverageFamily_actual_integral (a b : ℝ) (ha : 0 g (cuspCoordinateLift q)/(q.1:ℂ)^3) (Set.Icc (5:ℝ) 6 ×ˢ periodDomain) volume), (∫w in cuspPeriodStrip 5 6,g w∂hyperbolicVolume)= ∫v in Set.Icc (5:ℝ) 6,(∫z in periodDomain,g (cuspCoordinateLift (v,z)))/(v:ℂ)^3 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hg : AEStronglyMeasurable g hyperbolicVolume) (hint : IntegrableOn (fun q : ℝ × ℂ => g (cuspCoordinateLift q)/(q.1:ℂ)^3) (Set.Icc (5:ℝ) 6 ×ˢ periodDomain) volume) => by have hm := euclideanToHyperbolic_measurePreserving_on cuspEuclideanStrip cuspEuclideanStrip_measurable cuspEuclideanStrip_positive rw [cuspEuclideanStrip_preimage] at hm have hh := hg.mono_measure (Measure.restrict_le_self (s := cuspPeriodStrip 5 6)) have he : (∫w in cuspPeriodStrip 5 6,g w∂hyperbolicVolume)= ∫p in cuspEuclideanStrip,g (euclideanToHyperbolic p)∂hyperbolicEuclideanVolume := by rw [←hm.map_eq] at hh ⊢ exact integral_map hm.measurable.aemeasurable hh rw [he,hyperbolicEuclidean_setIntegral_complex cuspEuclideanStrip cuspEuclideanStrip_measurable cuspEuclideanStrip_positive] have hsplit := spatialComplexSplit.measurableEmbedding.setIntegral_map (fun q : ℝ × ℂ => g (cuspCoordinateLift q)/(q.1:ℂ)^3) (Set.Icc (5:ℝ) 6 ×ˢ periodDomain) («μ» := (volume : Measure EuclideanSpatial)) rw [spatialComplexSplit_preserves_volume.map_eq] at hsplit have heq : (∫p in cuspEuclideanStrip,g (euclideanToHyperbolic p)/(p 2:ℂ)^3)= ∫q in Set.Icc (5:ℝ) 6 ×ˢ periodDomain,g (cuspCoordinateLift q)/(q.1:ℂ)^3 := by rw [hsplit] simp only [cuspEuclideanStrip,cuspCoordinateLift,spatialComplexSplit.symm_apply_apply, spatialComplexSplit_fst] rw [heq] change (∫q in Set.Icc (5:ℝ) 6 ×ˢ periodDomain, g (cuspCoordinateLift q)/(q.1:ℂ)^3 ∂((volume : Measure ℝ).prod volume))=_ rw [setIntegral_prod _ hint] congr 1 ext v exact integral_div ((v:ℂ)^3) (fun z => g (cuspCoordinateLift (v,z))) lemma hyperbolicEisenstein_continuous (s : ℂ) (hs : 2 upperEisenstein p.1.1 p.1.2 p.2 s) := by apply continuous_iff_continuousAt.mpr intro p have hin : ContinuousAt (fun q : UpperCoordinates => (q,s)) p := continuousAt_id.prodMk continuousAt_const exact ContinuousAt.comp (f := fun q : UpperCoordinates => (q,s)) (upperEisenstein_joint_continuousAt (p,s) hs) hin convert hcoord.comp hyperbolicCoordinates_continuous using 1 ext w obtain ⟨z,v,hv,rfl⟩ := upperPoint_surjective w simp only [Function.comp_def,hyperbolicEisenstein_upperPoint,hyperbolicCoordinates, hyperbolicHorizontal_upperPoint,hyperbolicHeight_upperPoint] lemma spatialComplexSplit_symm_eq (q : ℝ × ℂ) : spatialComplexSplit.symm q=WithLp.toLp 2 ![q.2.re,q.2.im,q.1] := by apply spatialComplexSplit.injective rw [spatialComplexSplit.apply_symm_apply] apply Prod.ext · rfl · exact (Complex.re_add_im q.2).symm lemma spatialComplexSplit_symm_continuous : Continuous spatialComplexSplit.symm := by change Continuous (fun q : ℝ × ℂ => spatialComplexSplit.symm q) simp_rw [spatialComplexSplit_symm_eq] fun_prop lemma cuspCoordinateLift_continuousAt (q : ℝ × ℂ) (hq : 0 g (cuspCoordinateLift q)/(q.1:ℂ)^3) (Set.Icc (5:ℝ) 6 ×ˢ periodDomain) volume := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hg : Continuous g) => by let radiusBound : ℝ := ∑i,‖periodBasis i‖ have hc : ContinuousOn (fun q : ℝ × ℂ => g (cuspCoordinateLift q)/(q.1:ℂ)^3) (Set.Icc (5:ℝ) 6 ×ˢ Metric.closedBall (0:ℂ) radiusBound) := by intro q hq have hpos : 0 (v:ℂ)^s) (Set.Icc (5:ℝ) 6) volume := by apply ContinuousOn.integrableOn_Icc intro v hv exact (Complex.continuousAt_ofReal_cpow_const v s (Or.inr (by linarith [hv.1]))).continuousWithinAt lemma cuspMainHeightFactor_integral (s : ℂ) (hs : s≠2) : (∫v in Set.Icc (5:ℝ) 6,(v:ℂ)^(s-3))=cuspMainHeightFactor s := by rw [integral_Icc_eq_integral_Ioc,←intervalIntegral.integral_of_le (by norm_num : (5:ℝ)≤6)] have hr : s-3≠(-1:ℂ) := by intro h; apply hs; linear_combination h rw [integral_cpow (Or.inr ⟨hr,by norm_num⟩)] change ((6:ℂ)^(s-3+1)-(5:ℂ)^(s-3+1))/(s-3+1)=_ have he : s-3+1=s-2 := by ring rw [he] rfl lemma cuspScatterHeightFactor_integral (s : ℂ) (hs : s≠0) : (∫v in Set.Icc (5:ℝ) 6,(v:ℂ)^(-s-1))=cuspScatterHeightFactor s := by rw [integral_Icc_eq_integral_Ioc,←intervalIntegral.integral_of_le (by norm_num : (5:ℝ)≤6)] have hr : -s-1≠(-1:ℂ) := by intro h; apply hs; linear_combination -h rw [integral_cpow (Or.inr ⟨hr,by norm_num⟩)] change ((6:ℂ)^(-s-1+1)-(5:ℂ)^(-s-1+1))/(-s-1+1)=_ have he : -s-1+1=-s := by ring rw [he,cuspScatterHeightFactor] ring lemma cuspMainHeightFactor_differentiableAt (s : ℂ) (hs : s≠2) : DifferentiableAt ℂ cuspMainHeightFactor s := by have hd : DifferentiableAt ℂ (fun z : ℂ => z-2) s := differentiableAt_id.sub_const 2 exact ((hd.const_cpow (Or.inl (by norm_num))).sub (hd.const_cpow (Or.inl (by norm_num)))).div hd (sub_ne_zero.mpr hs) lemma cuspScatterHeightFactor_differentiableAt (s : ℂ) (hs : s≠0) : DifferentiableAt ℂ cuspScatterHeightFactor s := by have hd : DifferentiableAt ℂ (fun z : ℂ => -z) s := differentiableAt_id.neg exact ((hd.const_cpow (Or.inl (by norm_num))).sub (hd.const_cpow (Or.inl (by norm_num)))).div differentiableAt_id hs def cuspConstantAverage (s : ℂ) : ℂ := ((9*Real.sqrt 3/2:ℝ):ℂ)*(cuspMainHeightFactor s+ ((Real.pi:ℂ)/(s-1))*scatteringCoefficient s 0*cuspScatterHeightFactor s) lemma hyperbolicEisenstein_cusp_average_eq (s : ℂ) (hs : 2 scatteringCoefficient z 0) s := (arithmeticDirichletSeries_zero_differentiableAt s hs).div_const _ exact ((cuspMainHeightFactor_differentiableAt s hs2).add ((((differentiableAt_const (Real.pi:ℂ)).div (differentiableAt_id.sub_const 1) (sub_ne_zero.mpr hs1)).mul hsc).mul (cuspScatterHeightFactor_differentiableAt s hs0))).const_mul _ lemma cuspScatterHeightFactor_center_re_pos : 0<(cuspScatterHeightFactor (4/3:ℂ)).re := by have h5 := Complex.ofReal_cpow (by norm_num : (0:ℝ)≤5) (-(4/3:ℝ)) have h6 := Complex.ofReal_cpow (by norm_num : (0:ℝ)≤6) (-(4/3:ℝ)) norm_num only [Complex.ofReal_neg,Complex.ofReal_div,Complex.ofReal_ofNat] at h5 h6 have he : cuspScatterHeightFactor (4/3:ℂ)= (((5:ℝ)^(-(4/3:ℝ))-(6:ℝ)^(-(4/3:ℝ)))/(4/3:ℝ):ℝ) := by rw [cuspScatterHeightFactor,←h5,←h6] push_cast rfl rw [he,Complex.ofReal_re] apply div_pos · exact sub_pos.mpr (Real.rpow_lt_rpow_of_neg (by norm_num) (by norm_num) (by norm_num)) · norm_num def cuspConstantAverageResidue : ℂ := ((9*Real.sqrt 3/2:ℝ):ℂ)*(3*(Real.pi:ℂ))*constantArithmeticResidue* cuspScatterHeightFactor (4/3:ℂ) lemma cuspConstantAverageResidue_ne_zero : cuspConstantAverageResidue≠0 := by apply mul_ne_zero · exact mul_ne_zero (mul_ne_zero cusp_volume_ne_zero (mul_ne_zero (by norm_num) (Complex.ofReal_ne_zero.mpr Real.pi_ne_zero))) constantArithmeticResidue_ne_zero · intro he have hh := cuspScatterHeightFactor_center_re_pos rw [he,Complex.zero_re] at hh exact lt_irrefl 0 hh lemma cuspConstantAverage_oneSidedResidue : Tendsto (fun x : ℝ => ((x:ℂ)-(4/3:ℂ))*cuspConstantAverage (x:ℂ)) (𝓝[>] (4/3:ℝ)) (𝓝 cuspConstantAverageResidue) := by have harg : Tendsto (fun x : ℝ => (x:ℂ)) (𝓝[>] (4/3:ℝ)) (𝓝 (4/3:ℂ)) := by convert Complex.continuous_ofReal.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1 ; norm_num have hlinear := harg.sub_const (4/3:ℂ) norm_num only [sub_self] at hlinear have hm := (cuspMainHeightFactor_differentiableAt (4/3:ℂ) (by norm_num)).continuousAt.tendsto.comp harg have hh := (cuspScatterHeightFactor_differentiableAt (4/3:ℂ) (by norm_num)).continuousAt.tendsto.comp harg have hpi : Tendsto (fun x : ℝ => (Real.pi:ℂ)/((x:ℂ)-1)) (𝓝[>] (4/3:ℝ)) (𝓝 (3*(Real.pi:ℂ))) := by have hc : Tendsto (fun _ : ℝ => (Real.pi : ℂ)) (𝓝[>] (4/3 : ℝ)) (𝓝 (Real.pi : ℂ)) := tendsto_const_nhds have hd := hc.div (harg.sub_const 1) (by norm_num : (4/3:ℂ)-1≠0) convert hd using 1 <;> first | rfl | (congr 1; ring) have hall := ((hlinear.mul hm).add ((hpi.mul scatteringCoefficient_zero_oneSidedResidue).mul hh)).const_mul ((9*Real.sqrt 3/2:ℝ):ℂ) convert hall using 1 · ext x dsimp only [cuspConstantAverage,Function.comp_def] ring · simp only [zero_mul,zero_add,cuspConstantAverageResidue] ring_nf open Filter MeasureTheory open scoped BigOperators Classical Topology lemma kernelSpectralResolvent_analyticAt_of_isUnit (z : ℂ) (hz : IsUnit (kernelSpectralFormOperator z)) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace AnalyticAt ℂ kernelSpectralResolvent z := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by exact (ContinuousLinearMap.analyticAt (𝕜 := ℂ) (E := KernelEnergyGraph→L[ℂ]KernelEnergyGraph) (F := KernelQuotientL2→L[ℂ]KernelQuotientL2) kernelL2SandwichCLM (Ring.inverse (kernelSpectralFormOperator z))).comp_of_eq (kernelSpectralFormInverse_analyticAt_of_isUnit z hz) rfl lemma kernelEisensteinResolvent_analyticAt_of_isUnit (s : ℂ) (hs : IsUnit (kernelSpectralFormOperator (kernelEisensteinSpectralParameter s))) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace AnalyticAt ℂ kernelEisensteinResolvent s := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by exact (kernelSpectralResolvent_analyticAt_of_isUnit _ hs).comp_of_eq (by unfold kernelEisensteinSpectralParameter; fun_prop) rfl lemma kernelCuspAverageFamily_analyticAt_of_isUnit (a b : ℝ) (ha : 0 (x:ℂ)+(t:ℂ)*Complex.I) (𝓝[>] (0:ℝ)) (𝓝 (x:ℂ)) := by have hcont : Continuous (fun t : ℝ => (x:ℂ)+(t:ℂ)*Complex.I) := (Complex.continuous_ofReal.mul_const Complex.I).const_add (x:ℂ) have hh := (hcont.tendsto 0).mono_left (show 𝓝[>] (0:ℝ)≤𝓝 0 from nhdsWithin_le_nhds) simpa only [Complex.ofReal_zero,zero_mul,add_zero] using hh have hleft := (kernelCuspAverageFamily_analyticAt_of_isUnit a b ha hab (x:ℂ) hunit).continuousAt.tendsto.comp hpath have hx2' : (x:ℂ)≠2 := by exact_mod_cast hx2 have hright := (cuspConstantAverage_differentiableAt (x:ℂ) hx hx2').continuousAt.tendsto.comp hpath have hevent : (fun t : ℝ => kernelCuspAverageFamily a b ha hab ((x:ℂ)+(t:ℂ)*Complex.I)) =ᶠ[𝓝[>] (0:ℝ)] (fun t : ℝ => cuspConstantAverage ((x:ℂ)+(t:ℂ)*Complex.I)) := by filter_upwards [self_mem_nhdsWithin] with t ht change 0 (x:ℂ)) (𝓝[>] (4/3:ℝ)) (𝓝[≠] (4/3:ℂ)) := by apply tendsto_nhdsWithin_iff.mpr constructor · convert Complex.continuous_ofReal.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1 ; norm_num · filter_upwards [self_mem_nhdsWithin] with x hx change (4/3:ℝ)] (4/3:ℝ),x<2 := by have hh : ∀ᶠx : ℝ in 𝓝 (4/3:ℝ),x<2 := Iio_mem_nhds (by norm_num) exact hh.filter_mono nhdsWithin_le_nhds have hevent : (fun x : ℝ => ((x:ℂ)-4/3)*kernelCuspAverageFamily a b ha hab (x:ℂ)) =ᶠ[𝓝[>] (4/3:ℝ)] (fun x : ℝ => ((x:ℂ)-4/3)*cuspConstantAverage (x:ℂ)) := by filter_upwards [self_mem_nhdsWithin,hunit,hlt] with x hx hux hxx rw [kernelCuspAverageFamily_eq_real_of_upper a b ha hab hupper x hx hxx.ne hux] exact tendsto_nhds_unique_of_eventuallyEq hleft cuspConstantAverage_oneSidedResidue hevent lemma kernelEisensteinResidueVector_ne_zero_of_overlap (a b : ℝ) (ha : 0 complexMatrix M • w) (level_action_respects_kernel M) lemma kernelLevelAction_mk (M : levelThree) (w : HyperbolicSpace) : kernelLevelAction M (integralOrbitProjection globalKubotaKernel w)= integralOrbitProjection globalKubotaKernel (complexMatrix M • w) := rfl lemma kernelLevelAction_continuous (M : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; levelThree) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology Continuous (kernelLevelAction M) := letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology (continuous_hyperbolic_action (complexMatrix M)).quotient_map' (level_action_respects_kernel M) lemma kernelLevelAction_eisenstein (M : levelThree) (s : ℂ) (hs : 2 exact hyperbolicEisenstein_automorphy M s hs w lemma kernelLevelAction_seed (M : levelThree) (a b : ℝ) (s : ℂ) (q : KernelQuotient) : kernelQuotientSeed a b s (kernelLevelAction M q)=complexCharacter M*kernelQuotientSeed a b s q := by induction q using Quotient.inductionOn with | _ w => exact smoothCuspSeed_automorphy a b s M w lemma kernelLevelAction_fundamentalDomain (M : levelThree) : letI thirdWitness2 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := integralSubgroupHyperbolicAction globalKubotaKernel IsFundamentalDomain globalKubotaKernel ((fun w : HyperbolicSpace => complexMatrix M • w) '' hyperbolicFundamentalSet globalKubotaKernel) hyperbolicVolume := by letI thirdWitness0 := @OAI.CubicEisenstein.fullSLMeasurableAction letI thirdWitness1 := @OAI.CubicEisenstein.fullSLVolumeInvariant letI thirdWitness2 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace let := integralSubgroupHyperbolicAction globalKubotaKernel apply (hyperbolicFundamentalSet_isFundamentalDomain globalKubotaKernel globalKubotaKernel_le_levelThree).image_of_equiv (MulAction.toPerm (complexMatrix M)) (show Measure.QuasiMeasurePreserving (MulAction.toPerm (complexMatrix M)).symm hyperbolicVolume hyperbolicVolume from by exact (measurePreserving_smul (complexMatrix M)⁻¹ hyperbolicVolume).quasiMeasurePreserving) (kernelConjugate M⁻¹).toEquiv intro N w change complexMatrix M • (integralComplexMatrix ((M⁻¹:levelThree)*(N:SL(2,ActualEisensteinCubic.O))*(M⁻¹:levelThree)⁻¹) • w)= integralComplexMatrix (N:SL(2,ActualEisensteinCubic.O)) • (complexMatrix M • w) simp only [Subgroup.coe_inv,map_mul,map_inv] change complexMatrix M • (((complexMatrix M)⁻¹*integralComplexMatrix (N:SL(2,ActualEisensteinCubic.O))* ((complexMatrix M)⁻¹)⁻¹) • w)=_ simp only [inv_inv,mul_smul,smul_inv_smul] lemma kernelLevelAction_measurePreserving (M : levelThree) : letI thirdWitness4 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace MeasurePreserving (kernelLevelAction M) (integralQuotientVolume globalKubotaKernel) (integralQuotientVolume globalKubotaKernel) := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.fullSLMeasurableAction letI thirdWitness2 := @OAI.CubicEisenstein.fullSLVolumeInvariant letI thirdWitness3 := @OAI.CubicEisenstein.hyperbolicBorelSpace letI thirdWitness4 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace let : BorelSpace KernelQuotient := kernelQuotientBorel refine ⟨(kernelLevelAction_continuous M).measurable,?_⟩ let act : HyperbolicSpace→HyperbolicSpace := fun w => complexMatrix M • w have hmap := (measurePreserving_smul (complexMatrix M) hyperbolicVolume).restrict_image_emb (measurableEmbedding_const_smul (complexMatrix M)) (hyperbolicFundamentalSet globalKubotaKernel) have heq : kernelLevelAction M ∘ integralOrbitProjection globalKubotaKernel= integralOrbitProjection globalKubotaKernel ∘ act := by ext w; rfl change Measure.map (kernelLevelAction M) (Measure.map (integralOrbitProjection globalKubotaKernel) (hyperbolicVolume.restrict (hyperbolicFundamentalSet globalKubotaKernel)))=_ rw [Measure.map_map (kernelLevelAction_continuous M).measurable (measurable_integralOrbitProjection _),heq, ←Measure.map_map (measurable_integralOrbitProjection _) (continuous_hyperbolic_action _).measurable] change Measure.map (integralOrbitProjection globalKubotaKernel) (Measure.map act (hyperbolicVolume.restrict (hyperbolicFundamentalSet globalKubotaKernel)))=_ rw [hmap.map_eq] exact integralQuotientVolume_independent globalKubotaKernel globalKubotaKernel_le_levelThree _ (kernelLevelAction_fundamentalDomain M) end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open CubicKubota def kernelLevelPullback (M : levelThree) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2 →ₗᵢ[ℂ] KernelQuotientL2 := letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Lp.compMeasurePreservingₗᵢ ℂ (kernelLevelAction M) (kernelLevelAction_measurePreserving M) lemma kernelLevelPullback_ae_eq (M : levelThree) (F : KernelQuotientL2) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelLevelPullback M F=ᵐ[integralQuotientVolume globalKubotaKernel] fun q => F (kernelLevelAction M q) := letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Lp.coeFn_compMeasurePreserving F (kernelLevelAction_measurePreserving M) lemma kernelLevelPullback_of_remainder_ae (M : levelThree) (a b : ℝ) (s : ℂ) (hs : 2 kernelQuotientEisenstein s hs q-kernelQuotientSeed a b s q) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelLevelPullback M F=complexCharacter M • F := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace have hcomp := (kernelLevelAction_measurePreserving M).quasiMeasurePreserving.ae_eq_comp hF apply Lp.ext filter_upwards [kernelLevelPullback_ae_eq M F,hcomp,hF,Lp.coeFn_smul (complexCharacter M) F] with q hp hc hf hsmul change _=complexCharacter M*F q at hsmul rw [hp,hsmul,hf] dsimp only [Function.comp_def] at hc rw [hc,kernelLevelAction_eisenstein,kernelLevelAction_seed,mul_sub] lemma kernelCorrection_character_of_initial_overlap (M : levelThree) (a b : ℝ) (ha : 0 kernelQuotientEisenstein s (by linarith) q-kernelQuotientSeed a b s q) : ∀s∈cuspUpperParameterRegion, kernelLevelPullback M (kernelEisensteinL2Correction a b ha hab s)= complexCharacter M • kernelEisensteinL2Correction a b ha hab s := by have hc : AnalyticOnNhd ℂ (kernelEisensteinL2Correction a b ha hab) cuspUpperParameterRegion := by intro s hs exact kernelEisensteinL2Correction_analyticAt_nonreal a b ha hab s (by linarith [hs.1]) hs.2.ne' have hl : AnalyticOnNhd ℂ (fun s => kernelLevelPullback M (kernelEisensteinL2Correction a b ha hab s)) cuspUpperParameterRegion := by intro s hs exact (ContinuousLinearMap.analyticAt (𝕜 := ℂ) (E := KernelQuotientL2) (F := KernelQuotientL2) (kernelLevelPullback M).toContinuousLinearMap _).comp_of_eq (hc s hs) rfl have hr : AnalyticOnNhd ℂ (fun s => complexCharacter M • kernelEisensteinL2Correction a b ha hab s) cuspUpperParameterRegion := by intro s hs exact (hc s hs).const_smul (c := complexCharacter M) have hV : IsOpen {s : ℂ | 4 kernelLevelPullback M (kernelEisensteinL2Correction a b ha hab s)) =ᶠ[𝓝 (5+Complex.I:ℂ)] (fun s => complexCharacter M • kernelEisensteinL2Correction a b ha hab s) := by filter_upwards [hV.mem_nhds (by norm_num)] with s hs exact kernelLevelPullback_of_remainder_ae M a b s (by linarith [hs.1]) _ (hoverlap s hs.1 hs.2) exact hl.eqOn_of_preconnected_of_eventuallyEq hr cuspUpperParameterRegion_convex.isPreconnected (by norm_num [cuspUpperParameterRegion]) hevent lemma thetaApproach_tendsto_complex_punctured : Tendsto (fun t : ℝ => (4/3:ℂ)+(t:ℂ)+(t:ℂ)*Complex.I) (𝓝[>] (0:ℝ)) (𝓝[≠] (4/3:ℂ)) := by apply tendsto_nhdsWithin_iff.mpr constructor · have hh : Continuous (fun t : ℝ => (4/3:ℂ)+(t:ℂ)+(t:ℂ)*Complex.I) := by fun_prop have ht := (hh.tendsto 0).mono_left (show 𝓝[>] (0:ℝ)≤𝓝 0 from nhdsWithin_le_nhds) simpa only [Complex.ofReal_zero,zero_mul,add_zero] using ht · filter_upwards [self_mem_nhdsWithin] with t ht change 0 kernelQuotientEisenstein s (by linarith) q-kernelQuotientSeed a b s q) : kernelLevelPullback M (kernelEisensteinResidueVector a b ha hab)= complexCharacter M • kernelEisensteinResidueVector a b ha hab := by have hlim := (kernelEisensteinResidueVector_limit a b ha hab).comp thetaApproach_tendsto_complex_punctured have hl := (kernelLevelPullback M).continuous.continuousAt.tendsto.comp hlim have hr := hlim.const_smul (complexCharacter M) have hevent : (fun t : ℝ => kernelLevelPullback M (((4/3:ℂ)+(t:ℂ)+(t:ℂ)*Complex.I-4/3) • kernelEisensteinL2Correction a b ha hab ((4/3:ℂ)+(t:ℂ)+(t:ℂ)*Complex.I))) =ᶠ[𝓝[>] (0:ℝ)] (fun t : ℝ => complexCharacter M • (((4/3:ℂ)+(t:ℂ)+(t:ℂ)*Complex.I-4/3) • kernelEisensteinL2Correction a b ha hab ((4/3:ℂ)+(t:ℂ)+(t:ℂ)*Complex.I))) := by filter_upwards [self_mem_nhdsWithin] with t ht change 0 kernelQuotientEisenstein s hs q-kernelQuotientSeed a b s q) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelCuspAverageFamily a b ha hab s= ∫w in cuspPeriodStrip 5 6,hyperbolicEisenstein s w∂hyperbolicVolume := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace have hcorrected : kernelCorrectedSeed a b ha hab s=ᵐ[integralQuotientVolume globalKubotaKernel] kernelQuotientEisenstein s hs := by filter_upwards [hoverlap] with q hq change kernelQuotientSeed a b s q+kernelEisensteinL2Correction a b ha hab s q=_ rw [hq] ring have hm := kernelProjection_cuspPeriodStrip_measurePreserving 5 6 (by norm_num) have hrestr := ae_restrict_of_ae hcorrected (s := kernelCuspStripSet) have hp := hm.quasiMeasurePreserving.ae_eq_comp hrestr rw [kernelCuspAverageFamily_actual_integral] apply integral_congr_ae filter_upwards [hp] with w hw exact hw.trans (kernelQuotientEisenstein_mk s hs w) lemma kernelEisensteinResidueVector_nonzero_character_of_initial_overlap (a b : ℝ) (ha : 0 kernelQuotientEisenstein s (by linarith) q-kernelQuotientSeed a b s q) : kernelEisensteinResidueVector a b ha hab≠0 ∧ ∀M : levelThree,kernelLevelPullback M (kernelEisensteinResidueVector a b ha hab)= complexCharacter M • kernelEisensteinResidueVector a b ha hab := by constructor · apply kernelEisensteinResidueVector_ne_zero_of_overlap a b ha hab intro s hs hi exact kernelCuspAverageFamily_eq_of_initial_overlap a b ha hab s (by linarith) (hoverlap s hs hi) · intro M exact kernelEisensteinResidueVector_character_of_initial_overlap M a b ha hab hoverlap end CubicEisenstein open scoped BigOperators namespace QuadraticAllOddCRT open ActualEisensteinCubic open QuadraticGaussRay hiding O open ActualEisensteinCoordinates hiding O omega open EisensteinEPrimaryPhase (Coord odd) def quadraticRayExponent (r : Coord) : ZMod 4 := if r∈({(0,1),(0,3),(1,0),(1,1),(3,0),(3,3)} : Finset Coord) then 0 else if r∈({(1,2),(1,3),(2,3)} : Finset Coord) then 1 else 3 def fourthRoot (a : ZMod 4) : ℂ := Complex.I^(a.val:ℤ) lemma fourthRoot_add (a b : ZMod 4) : fourthRoot (a+b)=fourthRoot a*fourthRoot b := by unfold fourthRoot rw [←zpow_add₀ Complex.I_ne_zero] apply I_zpow_eq_of_mod_four push_cast simp lemma quadraticRayValue_eq_fourthRoot (r : Coord) (hr : odd r) : quadraticRayValue r=fourthRoot (quadraticRayExponent r) := by have hcmp (a b : ZMod 4) : (a=b) ↔ (a.val=b.val) := (ZMod.val_injective 4).eq_iff.symm have hcases : ∀ x : ZMod 4, x = 0 ∨ x = 1 ∨ x = 2 ∨ x = 3 := by decide rcases r with ⟨a,b⟩ rcases hcases a with rfl | rfl | rfl | rfl <;> rcases hcases b with rfl | rfl | rfl | rfl <;> norm_num [EisensteinEPrimaryPhase.odd,ZMod.val_zero,ZMod.val_one_eq_one_mod,ZMod.val_ofNat] at hr <;> norm_num [quadraticRayExponent,fourthRoot,EisensteinEPrimaryPhase.odd, quadraticRayValue,breveGaussianFourTerms_formula,Prod.mk.injEq,hcmp, ZMod.val_zero,ZMod.val_one_eq_one_mod,ZMod.val_ofNat, Complex.I_sq,Complex.I_pow_three,Complex.inv_I,zpow_neg] <;> ring_nf def quadraticRaySign (r s : Coord) : ℤ := @ite ℤ (odd r ∧ odd s) (@instDecidableAnd (odd r) (odd s) (EisensteinEPrimaryPhase.instDecidablePredCoordOdd r) (EisensteinEPrimaryPhase.instDecidablePredCoordOdd s)) (if quadraticRayExponent (EisensteinEPrimaryPhase.mul r s)= quadraticRayExponent r+quadraticRayExponent s then 1 else -1) 0 lemma quadraticRaySign_mul_left (r s t : Coord) : quadraticRaySign (EisensteinEPrimaryPhase.mul r s) t= quadraticRaySign r t*quadraticRaySign s t := by have h : ∀r s t : Coord, quadraticRaySign (EisensteinEPrimaryPhase.mul r s) t= quadraticRaySign r t*quadraticRaySign s t := by decide exact h r s t lemma quadraticRaySign_mul_right (r s t : Coord) : quadraticRaySign r (EisensteinEPrimaryPhase.mul s t)= quadraticRaySign r s*quadraticRaySign r t := by have h : ∀r s t : Coord, quadraticRaySign r (EisensteinEPrimaryPhase.mul s t)= quadraticRaySign r s*quadraticRaySign r t := by decide exact h r s t lemma quadraticRaySign_symm (r s : Coord) : quadraticRaySign r s=quadraticRaySign s r := by have h : ∀r s : Coord,quadraticRaySign r s=quadraticRaySign s r := by decide exact h r s lemma quadraticRaySign_exponent (r s : Coord) (hr : odd r) (hs : odd s) : quadraticRayExponent (EisensteinEPrimaryPhase.mul r s)= (if quadraticRaySign r s=1 then 0 else 2)+quadraticRayExponent r+quadraticRayExponent s := by have h : ∀r s : Coord,odd r → odd s → quadraticRayExponent (EisensteinEPrimaryPhase.mul r s)= (if quadraticRaySign r s=1 then 0 else 2)+quadraticRayExponent r+quadraticRayExponent s := by unfold EisensteinEPrimaryPhase.odd decide exact h r s hr hs lemma quadraticRaySign_root (r s : Coord) (hr : odd r) (hs : odd s) : fourthRoot (if quadraticRaySign r s=1 then 0 else 2)=(quadraticRaySign r s:ℂ) := by by_cases he : quadraticRayExponent (EisensteinEPrimaryPhase.mul r s)= quadraticRayExponent r+quadraticRayExponent s · norm_num [quadraticRaySign,hr,hs,he,fourthRoot,ZMod.val_zero,ZMod.val_ofNat,Complex.I_sq] · norm_num [quadraticRaySign,hr,hs,he,fourthRoot,ZMod.val_zero,ZMod.val_ofNat,Complex.I_sq] lemma odd_mul (r s : Coord) (hr : odd r) (hs : odd s) : odd (EisensteinEPrimaryPhase.mul r s) := by have h : ∀r s : Coord,odd r → odd s → odd (EisensteinEPrimaryPhase.mul r s) := by unfold EisensteinEPrimaryPhase.odd decide exact h r s hr hs theorem quadraticRayValue_mul (r s : Coord) (hr : odd r) (hs : odd s) : quadraticRayValue (EisensteinEPrimaryPhase.mul r s)= (quadraticRaySign r s:ℂ)*quadraticRayValue r*quadraticRayValue s := by rw [quadraticRayValue_eq_fourthRoot _ (odd_mul r s hr hs),quadraticRaySign_exponent r s hr hs, fourthRoot_add,fourthRoot_add,quadraticRaySign_root r s hr hs, quadraticRayValue_eq_fourthRoot r hr,quadraticRayValue_eq_fourthRoot s hs] end QuadraticAllOddCRT open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic open CompletedGauss hiding O open CanonicalQuadraticSieve hiding O open CubicJacobiGlobal hiding O open QuadraticGaussRay hiding O open QuadraticAllOddCRT open ActualEisensteinCoordinates hiding O omega open UniqueFactorizationMonoid lemma supported_factors_good (I : Ideal ActualEisensteinCubic.O) (hI : Supported I) : ∀P∈normalizedFactors I,P.IsMaximal ∧ lambda∉P ∧ ringChar (ActualEisensteinCubic.O⧸P)≠2 := by intro P hP have hp := prime_of_normalized_factor P hP exact ⟨(Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero,hI.2 P hP⟩ lemma idealRowHom_one_supported (I : Ideal ActualEisensteinCubic.O) (hI : Supported I) : idealRowHom 1 I=1 := by have h := CanonicalUnitEuler.idealRowHom_unit_norm (1:ActualEisensteinCubic.Oˣ) I hI.1 (supported_factors_good I hI) simpa using h lemma supported_prime_data (p : ActualEisensteinCubic.O) (hp : Prime p) (hs : Supported (Ideal.span {p})) : lambda∉(Ideal.span {p}:Ideal ActualEisensteinCubic.O) ∧ ringChar (ActualEisensteinCubic.O⧸Ideal.span {p})≠2 := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let : (Ideal.span {p}).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible exact hs.2 _ ((Ideal.mem_normalizedFactors_iff hs.1).mpr ⟨inferInstance,le_rfl⟩) lemma supported_residue_odd (p : ActualEisensteinCubic.O) (hs : Supported (Ideal.span {p})) : EisensteinEPrimaryPhase.odd (residue p) := (ActualEisensteinCoordinates.odd_residue_iff_not_two_dvd p).mpr ((supported_span_iff p).mp hs).2 theorem idealRowHom_prime_reciprocity (p q : ActualEisensteinCubic.O) (hp : Prime p) (hq : Prime q) (hprimaryP : lambda^2∣p-1) (hprimaryQ : lambda^2∣q-1) (hsP : Supported (Ideal.span {p})) (hsQ : Supported (Ideal.span {q})) : idealRowHom q (Ideal.span {p})= (quadraticRaySign (residue p) (residue q):ℂ)*idealRowHom p (Ideal.span {q}) := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let : (Ideal.span {p}).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible let : (Ideal.span {q}).IsMaximal := PrincipalIdealRing.isMaximal_of_irreducible hq.irreducible obtain ⟨hgP,hcP⟩ := supported_prime_data p hp hsP obtain ⟨hgQ,hcQ⟩ := supported_prime_data q hq hsQ by_cases he : (Ideal.span {p}:Ideal ActualEisensteinCubic.O)=Ideal.span {q} · have hqp : q∈(Ideal.span {p}:Ideal ActualEisensteinCubic.O) := by rw [he];exact Ideal.subset_span (by simp) have hpq : p∈(Ideal.span {q}:Ideal ActualEisensteinCubic.O) := by rw [←he];exact Ideal.subset_span (by simp) rw [idealRowHom_prime q _ hgP,idealRowHom_prime p _ hgQ, Ideal.Quotient.eq_zero_iff_mem.mpr hqp,Ideal.Quotient.eq_zero_iff_mem.mpr hpq] simp only [MulChar.map_zero,mul_zero] · have hcop : IsCoprime (Ideal.span {p}:Ideal ActualEisensteinCubic.O) (Ideal.span {q}) := Ideal.isCoprime_of_isMaximal he have hqp : q∉(Ideal.span {p}:Ideal ActualEisensteinCubic.O) := by intro h apply he exact ((inferInstance : (Ideal.span {q}:Ideal ActualEisensteinCubic.O).IsMaximal).eq_of_le (Ideal.IsMaximal.ne_top inferInstance) (Ideal.span_le.mpr (Set.singleton_subset_iff.mpr h))).symm have h2 : idealRowHom q (Ideal.span {p})^2=idealRowHom p (Ideal.span {q})^2 := by rw [idealRowHom_square,idealRowHom_square] exact congrArg ConcreteTraceCRT.eisEmbedding (symbol_reciprocity q p hq.ne_zero hp.ne_zero hprimaryQ hprimaryP) have h6 : idealRowHom q (Ideal.span {p})^6=1 := by rw [idealRowHom_prime q _ hgP] have h := canonicalSextic_sixth_power_mask (Ideal.span {p}) hgP q change actualSextic _ hgP (Ideal.Quotient.mk _ (q^6))=_ at h simpa only [map_pow,if_neg hqp] using h have hcross := quadratic_ray_cross p q hp.ne_zero hq.ne_zero hcop hcP hcQ rw [residue_mul,quadraticRayValue_mul _ _ (supported_residue_odd p hsP) (supported_residue_odd q hsQ)] at hcross have h3 (x y : ActualEisensteinCubic.O) (hg : lambda∉(Ideal.span {x}:Ideal ActualEisensteinCubic.O)) [(Ideal.span {x}).IsMaximal] : idealRowHom y (Ideal.span {x})^3= character (Ideal.span {x}) (Ideal.Quotient.mk (Ideal.span {x}) y) := by rw [idealRowHom_prime y _ hg,←MulChar.pow_apply' _ (by decide : (3:ℕ)≠0),actualSextic_cube_quadratic] have hc : idealRowHom q (Ideal.span {p})^3*idealRowHom p (Ideal.span {q})^3= (quadraticRaySign (residue p) (residue q):ℂ) := by rw [h3 p q hgP,h3 q p hgQ] apply mul_right_cancel₀ (quadraticRayValue_ne_zero_of_odd _ (supported_residue_odd p hsP)) apply mul_right_cancel₀ (quadraticRayValue_ne_zero_of_odd _ (supported_residue_odd q hsQ)) simpa only [mul_assoc,mul_left_comm,mul_comm] using hcross.symm calc _ = idealRowHom q (Ideal.span {p})*idealRowHom q (Ideal.span {p})^6 := by rw [h6,mul_one] _ = idealRowHom q (Ideal.span {p})^3*(idealRowHom q (Ideal.span {p})^2)^2 := by ring _ = idealRowHom q (Ideal.span {p})^3*(idealRowHom p (Ideal.span {q})^2)^2 := by rw [h2] _ = (idealRowHom q (Ideal.span {p})^3*idealRowHom p (Ideal.span {q})^3)*idealRowHom p (Ideal.span {q}) := by ring _ = _ := by rw [hc] end open ActualEisensteinCubic open CompletedGauss hiding O open CanonicalQuadraticSieve hiding O open CubicJacobiGlobal hiding O open QuadraticAllOddCRT open ActualEisensteinCoordinates hiding O omega def sexticReciprocityPhase (a b : ActualEisensteinCubic.O) : ℂ := (quadraticRaySign (residue a) (residue b):ℂ) lemma sexticReciprocityPhase_mul_left (a b c : ActualEisensteinCubic.O) : sexticReciprocityPhase (a*b) c=sexticReciprocityPhase a c*sexticReciprocityPhase b c := by simp only [sexticReciprocityPhase,residue_mul,quadraticRaySign_mul_left,Int.cast_mul] lemma sexticReciprocityPhase_mul_right (a b c : ActualEisensteinCubic.O) : sexticReciprocityPhase a (b*c)=sexticReciprocityPhase a b*sexticReciprocityPhase a c := by simp only [sexticReciprocityPhase,residue_mul,quadraticRaySign_mul_right,Int.cast_mul] lemma sexticReciprocityPhase_one_right (a : ActualEisensteinCubic.O) (ha : Supported (Ideal.span {a})) : sexticReciprocityPhase a 1=1 := by have h1 : residue (1:ActualEisensteinCubic.O)=((1:ZMod 4),0) := by have h : (1:ActualEisensteinCubic.O)=eval 1 0 := by simp [eval] rw [h,residue_eval] norm_num have ht : ∀r : EisensteinEPrimaryPhase.Coord,EisensteinEPrimaryPhase.odd r → quadraticRaySign r ((1:ZMod 4),0)=1 := by unfold EisensteinEPrimaryPhase.odd decide simp only [sexticReciprocityPhase,h1,ht _ (supported_residue_odd a ha),Int.cast_one] lemma sexticReciprocityPhase_one_left (a : ActualEisensteinCubic.O) (ha : Supported (Ideal.span {a})) : sexticReciprocityPhase 1 a=1 := by have he : sexticReciprocityPhase 1 a=sexticReciprocityPhase a 1 := by simp only [sexticReciprocityPhase,quadraticRaySign_symm] rw [he,sexticReciprocityPhase_one_right a ha] lemma idealRowHom_prime_primary_reciprocity (p b : ActualEisensteinCubic.O) (hp : Prime p) (hprimaryP : lambda^2∣p-1) (hprimaryB : lambda^2∣b-1) (hsP : Supported (Ideal.span {p})) (hsB : Supported (Ideal.span {b})) : idealRowHom b (Ideal.span {p})=sexticReciprocityPhase p b*idealRowHom p (Ideal.span {b}) := by have hb0 : b≠0 := by intro h apply hsB.1 simp [h] obtain ⟨s,hprod,hfactors⟩ := exists_primary_prime_factorization b hb0 hprimaryB rw [←hprod] at hsB ⊢ clear hprod hb0 hprimaryB b induction s using Multiset.induction_on with | empty => simp only [Multiset.prod_zero,Ideal.span_singleton_one,←Ideal.one_eq_top,map_one, idealRowHom_one_supported _ hsP,sexticReciprocityPhase_one_right p hsP,mul_one] | @cons q s ih => have hq := hfactors q (Multiset.mem_cons_self _ _) have htail : ∀r∈s,Prime r ∧ lambda^2∣r-1 := fun r hr => hfactors r (Multiset.mem_cons_of_mem hr) have hsplit : Supported (Ideal.span {q}) ∧ Supported (Ideal.span {s.prod}) := by simpa only [Multiset.prod_cons,←Ideal.span_singleton_mul_span_singleton,supported_mul_iff] using hsB rw [Multiset.prod_cons,idealRowHom_argument_mul,←Ideal.span_singleton_mul_span_singleton, map_mul,sexticReciprocityPhase_mul_right, idealRowHom_prime_reciprocity p q hp hq.1 hprimaryP hq.2 hsP hsplit.1, ih hsplit.2 htail] simp only [sexticReciprocityPhase] ring theorem idealRowHom_primary_reciprocity (a b : ActualEisensteinCubic.O) (hprimaryA : lambda^2∣a-1) (hprimaryB : lambda^2∣b-1) (hsA : Supported (Ideal.span {a})) (hsB : Supported (Ideal.span {b})) : idealRowHom b (Ideal.span {a})=sexticReciprocityPhase a b*idealRowHom a (Ideal.span {b}) := by have ha0 : a≠0 := by intro h apply hsA.1 simp [h] obtain ⟨s,hprod,hfactors⟩ := exists_primary_prime_factorization a ha0 hprimaryA rw [←hprod] at hsA ⊢ clear hprod ha0 hprimaryA a induction s using Multiset.induction_on with | empty => simp only [Multiset.prod_zero,Ideal.span_singleton_one,←Ideal.one_eq_top,map_one, idealRowHom_one_supported _ hsB,sexticReciprocityPhase_one_left b hsB,one_mul] | @cons p s ih => have hp := hfactors p (Multiset.mem_cons_self _ _) have htail : ∀r∈s,Prime r ∧ lambda^2∣r-1 := fun r hr => hfactors r (Multiset.mem_cons_of_mem hr) have hsplit : Supported (Ideal.span {p}) ∧ Supported (Ideal.span {s.prod}) := by simpa only [Multiset.prod_cons,←Ideal.span_singleton_mul_span_singleton,supported_mul_iff] using hsA rw [Multiset.prod_cons,←Ideal.span_singleton_mul_span_singleton,map_mul, idealRowHom_argument_mul,sexticReciprocityPhase_mul_left, idealRowHom_prime_primary_reciprocity p b hp.1 hp.2 hprimaryB hsplit.1 hsB, ih hsplit.2 htail] ring end CanonicalRowCompletion end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ScatteringCoefficients namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups def cubicEisensteinResidue : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelEisensteinResidueVector 2 3 (by norm_num) (by norm_num) lemma cubicEisensteinResidue_nonzero_character : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace cubicEisensteinResidue≠0 ∧ ∀M : CubicKubota.levelThree,kernelLevelPullback M cubicEisensteinResidue= CubicKubota.complexCharacter M • cubicEisensteinResidue := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply kernelEisensteinResidueVector_nonzero_character_of_initial_overlap 2 3 (by norm_num) (by norm_num) intro s hs hi exact kernelEisensteinL2Correction_initial_overlap 2 3 (by norm_num) (by norm_num) s hs hi lemma cubicEisensteinResidue_character : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (M : CubicKubota.levelThree), kernelLevelPullback M cubicEisensteinResidue= CubicKubota.complexCharacter M • cubicEisensteinResidue := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (M : CubicKubota.levelThree) => cubicEisensteinResidue_nonzero_character.2 M lemma cubicEisensteinResidue_eigenvector : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (cubicEisensteinResidue,(8/9:ℂ) • cubicEisensteinResidue)∈kernelEnergyLaplacian.graph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelEisensteinResidueVector_graph 2 3 (by norm_num) (by norm_num) lemma cubicEisensteinResidue_cusp_average : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelCuspStripAverage cubicEisensteinResidue=cuspConstantAverageResidue := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply kernelEisensteinResidueVector_average_of_overlap 2 3 (by norm_num) (by norm_num) intro s hs hi apply kernelCuspAverageFamily_eq_of_initial_overlap 2 3 (by norm_num) (by norm_num) s (by linarith) exact kernelEisensteinL2Correction_initial_overlap 2 3 (by norm_num) (by norm_num) s hs hi lemma cubicEisensteinResidue_local_limit : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (S : Set KernelQuotient) (hS : IsCompact S), let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel Tendsto (fun s : ℂ => (s-4/3) • kernelLocalCorrectedSeed S hS 2 3 (by norm_num) (by norm_num) s) (𝓝[≠] (4/3:ℂ)) (𝓝 (kernelMassRestrictionCLM S hS.measurableSet cubicEisensteinResidue)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (S : Set KernelQuotient) (hS : IsCompact S) => let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel kernelLocalCorrectedSeed_residue_limit S hS 2 3 (by norm_num) (by norm_num) lemma cubicEisensteinLocalFamily_initial_ae : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (S : Set KernelQuotient) (hS : IsCompact S) (s : ℂ) (hs : 4 by have hlocal := kernelLocalCorrectedSeed_ae_eq S hS 2 3 (by norm_num) (by norm_num) s have hoverlap := kernelEisensteinL2Correction_initial_overlap 2 3 (by norm_num) (by norm_num) s hs hi filter_upwards [hlocal,hoverlap] with q hq hc rw [hq] by_cases hmem : q∈S · rw [Set.indicator_of_mem hmem,Set.indicator_of_mem hmem] change kernelQuotientSeed 2 3 s q+kernelEisensteinL2Correction 2 3 (by norm_num) (by norm_num) s q=_ rw [hc] ring · rw [Set.indicator_of_notMem hmem,Set.indicator_of_notMem hmem] end section open Filter MeasureTheory open scoped BigOperators Classical Topology def whittakerHeight (v : ℝ) : ℝ := max 5 v def whittakerBase (p : ℝ × ℂ) : ℝ := whittakerHeight p.1*(1+‖p.2‖^2) def whittakerIntegrand (freq s : ℂ) (p : ℝ × ℂ) : ℂ := (whittakerHeight p.1:ℂ)⁻¹*(whittakerBase p:ℂ)^(-s)* ShortDraftTrace.breveE (-(freq*whittakerHeight p.1)*p.2) def whittakerIntegrandDeriv (freq s : ℂ) (p : ℝ × ℂ) : ℂ := -(Real.log (whittakerBase p):ℂ)*whittakerIntegrand freq s p def whittakerProductVolume : Measure (ℝ × ℂ) := (volume.restrict (Set.Icc (5:ℝ) 6)).prod volume lemma whittakerHeight_ge_one (v : ℝ) : 1≤whittakerHeight v := by exact (by norm_num : (1:ℝ)≤5).trans (le_max_left _ _) lemma whittakerBase_ge (p : ℝ × ℂ) : 1+‖p.2‖^2≤whittakerBase p := by exact le_mul_of_one_le_left (by positivity) (whittakerHeight_ge_one p.1) lemma whittakerBase_ge_one (p : ℝ × ℂ) : 1≤whittakerBase p := (by nlinarith [sq_nonneg ‖p.2‖] : 1≤1+‖p.2‖^2).trans (whittakerBase_ge p) lemma whittakerBase_pos (p : ℝ × ℂ) : 0 whittakerHeight p.1) := by unfold whittakerHeight fun_prop have hb : Continuous whittakerBase := by unfold whittakerBase; fun_prop have hp : Continuous (fun p : ℝ × ℂ => (whittakerBase p:ℂ)^(-s)) := (Complex.continuous_ofReal.comp hb).cpow continuous_const (fun p => Complex.ofReal_mem_slitPlane.mpr (whittakerBase_pos p)) have hi : Continuous (fun p : ℝ × ℂ => (whittakerHeight p.1:ℂ)⁻¹) := (Complex.continuous_ofReal.comp hv).inv₀ (fun p => by change (whittakerHeight p.1:ℂ)≠0 exact_mod_cast (zero_lt_one.trans_le (whittakerHeight_ge_one p.1)).ne') have hc : Continuous (fun p : ℝ × ℂ => ShortDraftTrace.breveE (-(freq*whittakerHeight p.1)*p.2)) := by change Continuous (fun p : ℝ × ℂ => Complex.exp (2*Real.pi*Complex.I* ((-(freq*whittakerHeight p.1)*p.2)+starRingEnd ℂ (-(freq*whittakerHeight p.1)*p.2)))) fun_prop exact (hi.mul hp).mul hc lemma whittakerIntegrandDeriv_continuous (freq s : ℂ) : Continuous (whittakerIntegrandDeriv freq s) := by have hb : Continuous whittakerBase := by unfold whittakerBase whittakerHeight; fun_prop have hl : Continuous (fun p => Real.log (whittakerBase p)) := hb.log (fun p => (whittakerBase_pos p).ne') exact (Complex.continuous_ofReal.comp hl).neg.mul (whittakerIntegrand_continuous freq s) lemma whittakerIntegrand_hasDerivAt (freq s : ℂ) (p : ℝ × ℂ) : HasDerivAt (fun w => whittakerIntegrand freq w p) (whittakerIntegrandDeriv freq s p) s := by have hn : (whittakerBase p:ℂ)≠0 := by exact_mod_cast (whittakerBase_pos p).ne' have hh := (((hasDerivAt_id s).neg.const_cpow (Or.inl hn)).const_mul ((whittakerHeight p.1:ℂ)⁻¹)).mul_const (ShortDraftTrace.breveE (-(freq*whittakerHeight p.1)*p.2)) convert hh using 1 <;> first | rfl | ( rw [←Complex.ofReal_log (whittakerBase_pos p).le] unfold whittakerIntegrandDeriv whittakerIntegrand simp only [Pi.neg_apply,id_eq] ring) lemma whittakerIntegrand_norm (freq s : ℂ) (p : ℝ × ℂ) : ‖whittakerIntegrand freq s p‖=(whittakerHeight p.1)⁻¹*(whittakerBase p)^(-s.re) := by unfold whittakerIntegrand rw [norm_mul,norm_mul,breveE_norm,mul_one,norm_inv, Complex.norm_of_nonneg (zero_lt_one.trans_le (whittakerHeight_ge_one p.1)).le, Complex.norm_cpow_eq_rpow_re_of_pos (whittakerBase_pos p)] rfl lemma whittakerIntegrand_norm_bound (freq s : ℂ) (p : ℝ × ℂ) (b : ℝ) (hb : 0≤b) (hs : b≤ s.re) : ‖whittakerIntegrand freq s p‖≤(1+‖p.2‖^2)^(-b) := by rw [whittakerIntegrand_norm] calc _ ≤ (whittakerBase p)^(-s.re) := by exact mul_le_of_le_one_left (Real.rpow_nonneg (whittakerBase_pos p).le _) (inv_le_one_of_one_le₀ (whittakerHeight_ge_one p.1)) _ ≤ (whittakerBase p)^(-b) := Real.rpow_le_rpow_of_exponent_le (whittakerBase_ge_one p) (by linarith) _ ≤ (1+‖p.2‖^2)^(-b) := Real.rpow_le_rpow_of_nonpos (by positivity) (whittakerBase_ge p) (by linarith) lemma whittakerIntegrandDeriv_norm_bound (freq s : ℂ) (p : ℝ × ℂ) (b ε : ℝ) (hb : 0≤b) (hε : 0<ε) (hs : b+ε≤ s.re) : ‖whittakerIntegrandDeriv freq s p‖≤ε⁻¹*(1+‖p.2‖^2)^(-b) := by have hlog := Real.log_nonneg (whittakerBase_ge_one p) unfold whittakerIntegrandDeriv rw [norm_mul,norm_neg,Complex.norm_of_nonneg hlog,whittakerIntegrand_norm] calc _ ≤ Real.log (whittakerBase p)*(whittakerBase p)^(-s.re) := by exact mul_le_mul_of_nonneg_left (mul_le_of_le_one_left (Real.rpow_nonneg (whittakerBase_pos p).le _) (inv_le_one_of_one_le₀ (whittakerHeight_ge_one p.1))) hlog _ ≤ ((whittakerBase p)^ε/ε)*(whittakerBase p)^(-s.re) := by exact mul_le_mul_of_nonneg_right (Real.log_le_rpow_div (whittakerBase_pos p).le hε) (Real.rpow_nonneg (whittakerBase_pos p).le _) _ = ε⁻¹*(whittakerBase p)^(ε-s.re) := by rw [Real.rpow_sub (whittakerBase_pos p),Real.rpow_neg (whittakerBase_pos p).le] ring _ ≤ ε⁻¹*(whittakerBase p)^(-b) := by exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le (whittakerBase_ge_one p) (by linarith)) (by positivity) _ ≤ ε⁻¹*(1+‖p.2‖^2)^(-b) := by exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_nonpos (by positivity) (whittakerBase_ge p) (by linarith)) (by positivity) lemma whittaker_bound_integrable (b : ℝ) (hb : 1 (1+‖p.2‖^2)^(-b)) whittakerProductVolume := by have hk : Integrable (fun z : ℂ => (1+‖z‖^2)^(-b)) := by convert (hyperbolicKernel_integrable (b:ℂ) hb).norm using 1 funext z simp only [hyperbolicKernel,Complex.norm_cpow_eq_rpow_re_of_pos (by positivity : 0<1+‖z‖^2),Complex.neg_re,Complex.ofReal_re] have hv : Integrable (fun _ : ℝ => (1:ℝ)) (volume.restrict (Set.Icc (5:ℝ) 6)) := integrable_const _ unfold whittakerProductVolume simpa only [one_mul] using hv.mul_prod hk lemma whittakerIntegrand_integrable (freq s : ℂ) (hs : 1 whittakerIntegrand_norm_bound freq s p s.re (by linarith) le_rfl)) lemma whittakerProduct_differentiableAt (freq s : ℂ) (hs : 1 ∫p,whittakerIntegrand freq w p∂whittakerProductVolume) s := by let b : ℝ := (s.re+1)/2 let ε : ℝ := (s.re-1)/4 have hb : 1 ε⁻¹*(1+‖p.2‖^2)^(-b)) hU (Eventually.of_forall (fun w => (whittakerIntegrand_continuous freq w).aestronglyMeasurable)) (whittakerIntegrand_integrable freq s hs) (whittakerIntegrandDeriv_continuous freq s).aestronglyMeasurable (Eventually.of_forall (fun p w hw => whittakerIntegrandDeriv_norm_bound freq w p b ε (by linarith) hε hw.le)) ((whittaker_bound_integrable b hb).const_mul ε⁻¹) (Eventually.of_forall (fun p w _ => whittakerIntegrand_hasDerivAt freq w p)) exact h.2.differentiableAt lemma whittakerIntegrand_eq (freq s : ℂ) (v : ℝ) (hv : 5≤v) (z : ℂ) : whittakerIntegrand freq s (v,z)= (v:ℂ)^(-s-1)*(hyperbolicKernel s z*ShortDraftTrace.breveE (-(freq*v)*z)) := by have hvp : 0 whittakerIntegrand_eq freq s v hv.1 z) _ = _ := integral_const_mul _ _ theorem cuspWhittakerAverage_differentiableAt (freq s : ℂ) (hs : 1 ∫v in Set.Icc (5:ℝ) 6,(v:ℂ)^(-w-1)*sourceFourierKernel w (freq*v)) s := by have he : (fun w => ∫v in Set.Icc (5:ℝ) 6,(v:ℂ)^(-w-1)*sourceFourierKernel w (freq*v)) =ᶠ[𝓝 s](fun w => ∫p,whittakerIntegrand freq w p∂whittakerProductVolume) := by filter_upwards [(isOpen_lt continuous_const Complex.continuous_re).mem_nhds hs] with w hw exact (whittakerProduct_eq_average freq w hw).symm exact (whittakerProduct_differentiableAt freq s hs).congr_of_eventuallyEq he end section open scoped BigOperators Classical open ActualEisensteinCubic ConcreteTraceCRT lemma arithmeticDirichletTerm_differentiable (h : ActualEisensteinCubic.O) (c : LevelLower) : Differentiable ℂ (fun s : ℂ => arithmeticDirichletTerm s h c) := by by_cases hc : c.1=0 · simp only [arithmeticDirichletTerm,if_pos hc] exact differentiable_const _ · have hq : ((‖eisEmbedding c.1‖^2:ℝ):ℂ)≠0 := Complex.ofReal_ne_zero.mpr (pow_ne_zero 2 (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hc))) simp only [arithmeticDirichletTerm,if_neg hc] exact (differentiable_id.neg.const_cpow (Or.inl hq)).mul_const _ lemma arithmeticDirichletTerm_norm_mono (h : ActualEisensteinCubic.O) (a : ℝ) (s : ℂ) (ha : a≤ s.re) (c : LevelLower) : ‖arithmeticDirichletTerm s h c‖≤‖arithmeticDirichletTerm (a:ℂ) h c‖ := by by_cases hc : c.1=0 · simp only [arithmeticDirichletTerm,if_pos hc,norm_zero,le_refl] · have hpos : 0<‖eisEmbedding c.1‖^2 := sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hc)) have hq : 1≤‖eisEmbedding c.1‖^2 := by rw [eisEmbedding_norm_sq_eq_absNorm_span] exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (Ideal.span_singleton_eq_bot.not.mpr hc)) simp only [arithmeticDirichletTerm,if_neg hc,norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hpos,Complex.neg_re,Complex.ofReal_re] exact mul_le_mul_of_nonneg_right (Real.rpow_le_rpow_of_exponent_le hq (neg_le_neg ha)) (norm_nonneg _) theorem arithmeticDirichletSeries_differentiableAt (h : ActualEisensteinCubic.O) (s : ℂ) (hs : 2 arithmeticDirichletSeries z h) s := by let a : ℝ := (2+s.re)/2 have ha : 2 arithmeticDirichletSeries z h) {z : ℂ | a (arithmeticDirichletTerm_differentiable h c).differentiableOn) hopen intro c z hz exact arithmeticDirichletTerm_norm_mono h a z hz.le c exact (hd s has).differentiableAt (hopen.mem_nhds has) theorem scatteringCoefficient_differentiableAt (h : ActualEisensteinCubic.O) (s : ℂ) (hs : 2 scatteringCoefficient z h) s := (arithmeticDirichletSeries_differentiableAt h s hs).div_const _ theorem scatteringCoefficient_analyticOnNhd (h : ActualEisensteinCubic.O) : AnalyticOnNhd ℂ (fun z => scatteringCoefficient z h) {z : ℂ | 2 F (integralOrbitProjection globalKubotaKernel w) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (F : KernelQuotientL2) => by have hm := kernelProjection_cuspPeriodStrip_measurePreserving 5 6 (by norm_num) have hr := LpToLpRestrictCLM_coeFn ℂ kernelCuspStripSet F have hc := hm.quasiMeasurePreserving.ae_eq_comp hr have hp := Lp.coeFn_compMeasurePreserving (LpToLpRestrictCLM KernelQuotient ℂ ℂ (integralQuotientVolume globalKubotaKernel) 2 kernelCuspStripSet F) hm filter_upwards [hp,hc] with w hw hc exact hw.trans hc def cuspFourierPhase (h : ActualEisensteinCubic.O) (w : HyperbolicSpace) : ℂ := ShortDraftTrace.breveE (-cuspFrequency h*hyperbolicHorizontal w) lemma cuspFourierPhase_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (h : ActualEisensteinCubic.O), Continuous (cuspFourierPhase h) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (h : ActualEisensteinCubic.O) => by have hc : Continuous (fun z : ℂ => ShortDraftTrace.breveE (-cuspFrequency h*z)) := by change Continuous (fun z : ℂ => Complex.exp (2*Real.pi*Complex.I* ((-cuspFrequency h*z)+starRingEnd ℂ (-cuspFrequency h*z)))) fun_prop exact hc.comp hyperbolicHorizontal_continuous lemma cuspFourierPhase_norm (h : ActualEisensteinCubic.O) (w : HyperbolicSpace) : ‖cuspFourierPhase h w‖=1 := breveE_norm _ lemma cuspFourierTest_memLp : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (h : ActualEisensteinCubic.O), MemLp (fun w => star (cuspFourierPhase h w)) 2 (hyperbolicVolume.restrict (cuspPeriodStrip 5 6)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (h : ActualEisensteinCubic.O) => letI := @OAI.CubicEisenstein.cuspStripFiniteVolume by apply MemLp.of_bound (cuspFourierPhase_continuous h).star.aestronglyMeasurable 1 exact Eventually.of_forall (fun w => by rw [norm_star,cuspFourierPhase_norm]) def cuspFourierTestL2 : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (h : ActualEisensteinCubic.O), CuspStripL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (h : ActualEisensteinCubic.O) => (cuspFourierTest_memLp h).toLp (fun w => star (cuspFourierPhase h w)) def kernelCuspFourier : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (h : ActualEisensteinCubic.O), KernelQuotientL2→L[ℂ]ℂ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (h : ActualEisensteinCubic.O) => (innerSL ℂ (cuspFourierTestL2 h)).comp kernelCuspPullback lemma kernelCuspFourier_integral : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (h : ActualEisensteinCubic.O) (F : KernelQuotientL2), kernelCuspFourier h F=∫w in cuspPeriodStrip 5 6, F (integralOrbitProjection globalKubotaKernel w)*cuspFourierPhase h w∂hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (h : ActualEisensteinCubic.O) (F : KernelQuotientL2) => by change inner ℂ (cuspFourierTestL2 h) (kernelCuspPullback F)=_ rw [L2.inner_def] apply integral_congr_ae filter_upwards [MemLp.coeFn_toLp (cuspFourierTest_memLp h),kernelCuspPullback_ae_eq F] with w hw hp rw [RCLike.inner_apply,cuspFourierTestL2,hw,hp] simp only [starRingEnd_apply,star_star] lemma kernelCuspFourier_restrict : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (h : ActualEisensteinCubic.O) (F : KernelQuotientL2), let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel kernelCuspFourier h (kernelMassRestrictionCLM kernelCuspAverageCompact kernelCuspAverageCompact_isCompact.measurableSet F)=kernelCuspFourier h F := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (h : ActualEisensteinCubic.O) (F : KernelQuotientL2) => by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel dsimp only rw [kernelCuspFourier_integral,kernelCuspFourier_integral] have hm := kernelProjection_cuspPeriodStrip_measurePreserving 5 6 (by norm_num) have he := hm.quasiMeasurePreserving.ae_eq_comp (ae_restrict_of_ae (kernelMassRestriction_coe kernelCuspAverageCompact kernelCuspAverageCompact_isCompact.measurableSet F) (s := kernelCuspStripSet)) apply integral_congr_ae filter_upwards [he,ae_restrict_mem (cuspPeriodStrip_measurable 5 6)] with w hw hwm exact congrArg (fun z : ℂ => z*cuspFourierPhase h w) (hw.trans (Set.indicator_of_mem (kernelCuspStripSet_subset_compact ⟨w,hwm,rfl⟩) _)) def kernelCuspFourierFamily (h : ActualEisensteinCubic.O) (a b : ℝ) (ha : 0 (s-4/3)*kernelCuspFourierFamily h a b ha hab s) (𝓝[≠] (4/3:ℂ)) (𝓝 (kernelCuspFourier h (kernelEisensteinResidueVector a b ha hab))) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (h : ActualEisensteinCubic.O) (a b : ℝ) (ha : 0 by let kernelCuspFourier_restrict := fun F => OAI.CubicEisenstein.kernelCuspFourier_restrict h F have hh := (kernelCuspFourier h).continuous.continuousAt.tendsto.comp (kernelLocalCorrectedSeed_residue_limit kernelCuspAverageCompact kernelCuspAverageCompact_isCompact a b ha hab) simpa only [Function.comp_def,map_smul,smul_eq_mul,kernelCuspFourier_restrict,kernelCuspFourierFamily] using hh lemma kernelCuspFourierFamily_actual_integral : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (h : ActualEisensteinCubic.O) (a b : ℝ) (ha : 0 by rw [kernelCuspFourierFamily,kernelCuspFourier_integral] have hm := kernelProjection_cuspPeriodStrip_measurePreserving 5 6 (by norm_num) have he := hm.quasiMeasurePreserving.ae_eq_comp (ae_restrict_of_ae (kernelLocalCorrectedSeed_ae_eq kernelCuspAverageCompact kernelCuspAverageCompact_isCompact a b ha hab s) (s := kernelCuspStripSet)) apply integral_congr_ae filter_upwards [he,ae_restrict_mem (cuspPeriodStrip_measurable 5 6)] with w hw hwm exact congrArg (fun z : ℂ => z*cuspFourierPhase h w) (hw.trans (Set.indicator_of_mem (kernelCuspStripSet_subset_compact ⟨w,hwm,rfl⟩) _)) lemma kernelCuspFourierFamily_of_initial_overlap : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (h : ActualEisensteinCubic.O) (a b : ℝ) (ha : 0 kernelQuotientEisenstein s hs q-kernelQuotientSeed a b s q), kernelCuspFourierFamily h a b ha hab s=∫w in cuspPeriodStrip 5 6, hyperbolicEisenstein s w*cuspFourierPhase h w∂hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (h : ActualEisensteinCubic.O) (a b : ℝ) (ha : 0 kernelQuotientEisenstein s hs q-kernelQuotientSeed a b s q) => by have hcorrected : kernelCorrectedSeed a b ha hab s=ᵐ[integralQuotientVolume globalKubotaKernel] kernelQuotientEisenstein s hs := by filter_upwards [hoverlap] with q hq change kernelQuotientSeed a b s q+kernelEisensteinL2Correction a b ha hab s q=_ rw [hq] ring have hm := kernelProjection_cuspPeriodStrip_measurePreserving 5 6 (by norm_num) have hp := hm.quasiMeasurePreserving.ae_eq_comp (ae_restrict_of_ae hcorrected (s := kernelCuspStripSet)) rw [kernelCuspFourierFamily_actual_integral] apply integral_congr_ae filter_upwards [hp] with w hw exact congrArg (fun z : ℂ => z*cuspFourierPhase h w) (hw.trans (kernelQuotientEisenstein_mk s hs w)) end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups lemma hyperbolicEisenstein_cusp_fourier_average : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (s : ℂ) (hs : 2 by let g : HyperbolicSpace→ℂ := fun w => hyperbolicEisenstein s w*cuspFourierPhase h w have hg : Continuous g := (hyperbolicEisenstein_continuous s hs).mul (cuspFourierPhase_continuous h) rw [cuspPeriodStrip_integral_coordinates g hg.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable g hg)] apply setIntegral_congr_fun measurableSet_Icc intro v hv have hpos : 0 by rw [hyperbolicEisenstein_cusp_fourier_average s hs h] simp only [if_neg hh,zero_add] have heq : (∫v in Set.Icc (5:ℝ) 6, ((v:ℂ)^(2-s)*sourceFourierKernel s (cuspFrequency h*v)*scatteringCoefficient s h)* ((9*Real.sqrt 3/2:ℝ):ℂ)/(v:ℂ)^3)= ∫v in Set.Icc (5:ℝ) 6, (((9*Real.sqrt 3/2:ℝ):ℂ)*scatteringCoefficient s h)* ((v:ℂ)^(-s-1)*sourceFourierKernel s (cuspFrequency h*v)) := by apply setIntegral_congr_fun measurableSet_Icc intro v hv have hv0 : (v:ℂ)≠0 := Complex.ofReal_ne_zero.mpr (by linarith [hv.1]) have hp : (v:ℂ)^(-s-1)=(v:ℂ)^(2-s)/(v:ℂ)^3 := by rw [show -s-1=(2-s)-3 by ring,Complex.cpow_sub _ _ hv0] congr 1 exact Complex.cpow_natCast _ 3 dsimp only rw [hp] ring rw [heq,integral_const_mul] rfl lemma kernelCuspFourierFamily_nonzero_of_initial_overlap : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (h : ActualEisensteinCubic.O) (hh : h≠0) (a b : ℝ) (ha : 0 kernelQuotientEisenstein s hs q-kernelQuotientSeed a b s q), kernelCuspFourierFamily h a b ha hab s= ((9*Real.sqrt 3/2:ℝ):ℂ)*scatteringCoefficient s h*cuspWhittakerHeightFactor s h := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (h : ActualEisensteinCubic.O) (hh : h≠0) (a b : ℝ) (ha : 0 kernelQuotientEisenstein s hs q-kernelQuotientSeed a b s q) => by rw [kernelCuspFourierFamily_of_initial_overlap h a b ha hab s hs hoverlap, hyperbolicEisenstein_cusp_fourier_nonzero s hs h hh] end open Filter MeasureTheory open scoped BigOperators Classical Topology lemma sourceFourierKernel_continuous_freq (s : ℂ) (hs : 1 ∫z : ℂ,hyperbolicKernel s z*ShortDraftTrace.breveE (-freq*z)) apply continuous_of_dominated (bound := fun z => ‖hyperbolicKernel s z‖) · exact fun freq => (sourceFourierKernel_integrable s freq hs).aestronglyMeasurable · exact fun freq => Eventually.of_forall (fun z => by rw [norm_mul,breveE_norm,mul_one]) · exact (hyperbolicKernel_integrable s hs).norm · filter_upwards with z change Continuous (fun freq : ℂ => hyperbolicKernel s z* Complex.exp (2*Real.pi*Complex.I*((-freq*z)+starRingEnd ℂ (-freq*z)))) fun_prop lemma schlafliIntegrand_real (nu x t : ℝ) (ht : 0 (t:ℂ)^((nu:ℂ)-1)*Complex.exp (-(t:ℂ)-(x:ℂ)^2/(4*t)) have hi : IntegrableOn f (Set.Ioi (0:ℝ)) volume := schlafliIntegral_integrable (nu:ℂ) x hnu have hp (t : ℝ) (ht : 0 RCLike.re (f t))=ᵐ[volume.restrict (Set.Ioi (0:ℝ))] Set.univ := by filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht apply propext change RCLike.re (f t) ≠ 0 ↔ True exact iff_true_intro (hp t ht).ne' rw [measure_congr heq,Measure.restrict_apply_univ] simp · filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht exact (hp t ht).le lemma sourceFourierKernel_real_re_pos (sigma : ℝ) (hsigma : 1 (v:ℂ)^(-s-1)*sourceFourierKernel s (cuspFrequency h*v)) (Set.Icc (5:ℝ) 6) volume := by apply ContinuousOn.integrableOn_Icc intro v hv have hpos : 0 (v:ℂ)^(-(sigma:ℂ)-1)*sourceFourierKernel (sigma:ℂ) (cuspFrequency h*v) have hi : IntegrableOn f (Set.Icc (5:ℝ) 6) volume := cuspWhittakerHeightFactor_integrable (sigma:ℂ) hsigma h have hp (v : ℝ) (hv : v∈Set.Icc (5:ℝ) 6) : 0<(f v).re := by have hpos : 0 RCLike.re (f v))=ᵐ[volume.restrict (Set.Icc (5:ℝ) 6)] Set.univ := by filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv apply propext change RCLike.re (f v) ≠ 0 ↔ True exact iff_true_intro (hp v hv).ne' rw [measure_congr heq,Measure.restrict_apply_univ] norm_num · filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv exact (hp v hv).le lemma cuspWhittakerHeightFactor_center_ne_zero (h : ActualEisensteinCubic.O) : cuspWhittakerHeightFactor (4/3:ℂ) h≠0 := by intro he have hh := cuspWhittakerHeightFactor_real_re_pos (4/3:ℝ) (by norm_num) h norm_num only [Complex.ofReal_div,Complex.ofReal_ofNat] at hh rw [he,Complex.zero_re] at hh exact lt_irrefl 0 hh end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.WhittakerContinuation /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationWhittakerContinuation01 abbrev O := ActualEisensteinCubic.O end RootNotationWhittakerContinuation01 open RootNotationWhittakerContinuation01 (O) lemma cuspWhittakerHeightFactor_analyticAt (h : ActualEisensteinCubic.O) (s : ℂ) (hs : 1 cuspWhittakerHeightFactor w h) s := by apply Complex.analyticAt_iff_eventually_differentiableAt.mpr have hopen : IsOpen {w : ℂ | 1 kernelCuspFourier h cubicEisensteinResidue / (((9*Real.sqrt 3/2:ℝ):ℂ)*cuspWhittakerHeightFactor (4/3:ℂ) h) lemma kernelCuspFourierFamily_eq_upper (h : ActualEisensteinCubic.O) (hh : h≠0) : Set.EqOn (kernelCuspFourierFamily h 2 3 (by norm_num) (by norm_num)) (fun s => ((9*Real.sqrt 3/2:ℝ):ℂ)*scatteringCoefficient s h*cuspWhittakerHeightFactor s h) {s : ℂ | 2 ((9*Real.sqrt 3/2:ℝ):ℂ)*scatteringCoefficient s h*cuspWhittakerHeightFactor s h) domain := by intro s hs exact (analyticAt_const.mul (scatteringCoefficient_analyticOnNhd h s hs.1)).mul (cuspWhittakerHeightFactor_analyticAt h s (by linarith [hs.1])) have hstart : (5+Complex.I:ℂ)∈domain := by norm_num [domain] have hopen : IsOpen {s : ℂ | 4 ((9*Real.sqrt 3/2:ℝ):ℂ)*scatteringCoefficient s h*cuspWhittakerHeightFactor s h) := by filter_upwards [hopen.mem_nhds (by norm_num)] with s hs exact kernelCuspFourierFamily_nonzero_of_initial_overlap h hh 2 3 (by norm_num) (by norm_num) s (by linarith [hs.1]) (kernelEisensteinL2Correction_initial_overlap 2 3 (by norm_num) (by norm_num) s hs.1 hs.2) exact hleft.eqOn_of_preconnected_of_eventuallyEq hright hconvex.isPreconnected hstart hevent end open Filter MeasureTheory open scoped BigOperators Classical Topology section open Filter MeasureTheory open scoped BigOperators Classical Topology ENNReal theorem kernelCompact_projection_measure_bound : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (K : Set HyperbolicSpace) (hK : IsCompact K), ∃N : ℕ,Measure.map (integralOrbitProjection globalKubotaKernel) (hyperbolicVolume.restrict K)≤ (N:ℝ≥0∞) • integralQuotientVolume globalKubotaKernel := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (K : Set HyperbolicSpace) (hK : IsCompact K) => by choose e he heq using kernelQuotient_localHomeomorph have hcover : K⊆⋃w : HyperbolicSpace,(e w).source := by intro w _ exact Set.mem_iUnion.mpr ⟨w,he w⟩ obtain ⟨t,ht⟩ := hK.elim_finite_subcover (fun w => (e w).source) (fun w => (e w).open_source) hcover have hinj (w : HyperbolicSpace) : Set.InjOn (integralOrbitProjection globalKubotaKernel) (e w).source := by rw [heq w] exact (e w).injOn refine ⟨t.card,Measure.le_iff.mpr ?_⟩ intro B hB rw [Measure.map_apply (measurable_integralOrbitProjection _) hB, Measure.restrict_apply ((measurable_integralOrbitProjection _) hB),Measure.smul_apply] change hyperbolicVolume ((integralOrbitProjection globalKubotaKernel) ⁻¹' B ∩ K)≤ (t.card:ℝ≥0∞)*integralQuotientVolume globalKubotaKernel B calc _ ≤ hyperbolicVolume (⋃w∈t,(integralOrbitProjection globalKubotaKernel) ⁻¹' B ∩ (e w).source) := by apply measure_mono rintro w ⟨hw,hK⟩ obtain ⟨v,hv,hwv⟩ := Set.mem_iUnion₂.mp (ht hK) exact Set.mem_iUnion₂.mpr ⟨v,hv,hw,hwv⟩ _ ≤ ∑w∈t,hyperbolicVolume ((integralOrbitProjection globalKubotaKernel) ⁻¹' B ∩ (e w).source) := measure_biUnion_finset_le _ _ _ ≤ ∑_w∈t,integralQuotientVolume globalKubotaKernel B := by apply Finset.sum_le_sum intro w hw have hm := kernelProjection_measurePreserving_on (e w).source (e w).open_source.measurableSet (hinj w) rw [←Measure.restrict_apply ((measurable_integralOrbitProjection _) hB), ←Measure.map_apply (measurable_integralOrbitProjection _) hB,hm.map_eq] exact Measure.restrict_le_self B _ = _ := by simp [nsmul_eq_mul] section DominatedComplexL2 variable {α : Type*} [MeasurableSpace α] {«μ» ν : Measure α} {c : ℝ≥0∞} def dominatedComplexL2 (hc : c≠⊤) (h : ν≤c•«μ») : Lp ℂ 2 «μ»→L[ℂ]Lp ℂ 2 ν where toFun := Lp.LpToLpOfMeasureLeSMul hc h map_add' := map_add (Lp.LpToLpOfMeasureLeSMul hc h) map_smul' z f := by apply Lp.ext filter_upwards [Lp.coeFn_LpToLpOfMeasureLeSMul hc h (z•f), Lp.coeFn_LpToLpOfMeasureLeSMul hc h f, Lp.coeFn_smul z (Lp.LpToLpOfMeasureLeSMul hc h f), (Measure.absolutelyContinuous_of_le_smul h).ae_eq (Lp.coeFn_smul z f)] with x h1 h2 h3 h4 simp only [RingHom.id_apply,Pi.smul_apply] at * rw [h1,h3,h2,h4] cont := (Lp.LpToLpOfMeasureLeSMul hc h).continuous lemma dominatedComplexL2_ae (hc : c≠⊤) (h : ν≤c•«μ») (f : Lp ℂ 2 «μ») : dominatedComplexL2 hc h f=ᵐ[ν]f := Lp.coeFn_LpToLpOfMeasureLeSMul hc h f lemma dominatedComplexL2_norm_le (hc : c≠⊤) (h : ν≤c•«μ») (f : Lp ℂ 2 «μ») : ‖dominatedComplexL2 hc h f‖≤c.toReal^((1:ℝ)/2)*‖f‖ := by have hb := (Lp.LpToLpOfMeasureLeSMul hc h : Lp ℂ 2 «μ»→L[ℝ]Lp ℂ 2 ν).le_opNorm f have hn := Lp.norm_LpToLpOfMeasureLeSMul_le (E := ℂ) (p := 2) hc h apply hb.trans apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) simpa only [ENNReal.toReal_div,ENNReal.toReal_one,ENNReal.toReal_ofNat] using hn end DominatedComplexL2 def kernelCompactMultiplicity : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (K : Set HyperbolicSpace) (hK : IsCompact K), ℕ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (K : Set HyperbolicSpace) (hK : IsCompact K) => (kernelCompact_projection_measure_bound K hK).choose lemma kernelCompactMultiplicity_spec : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (K : Set HyperbolicSpace) (hK : IsCompact K), Measure.map (integralOrbitProjection globalKubotaKernel) (hyperbolicVolume.restrict K)≤ (kernelCompactMultiplicity K hK:ℝ≥0∞) • integralQuotientVolume globalKubotaKernel := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (K : Set HyperbolicSpace) (hK : IsCompact K) => (kernelCompact_projection_measure_bound K hK).choose_spec def kernelCompactPullbackCLM : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (K : Set HyperbolicSpace) (hK : IsCompact K), KernelQuotientL2→L[ℂ]Lp ℂ 2 (hyperbolicVolume.restrict K) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (K : Set HyperbolicSpace) (hK : IsCompact K) => (Lp.compMeasurePreservingₗᵢ ℂ (integralOrbitProjection globalKubotaKernel) ⟨measurable_integralOrbitProjection _,rfl⟩).toContinuousLinearMap.comp (dominatedComplexL2 (by simp : (kernelCompactMultiplicity K hK:ℝ≥0∞)≠⊤) (kernelCompactMultiplicity_spec K hK)) theorem kernelCompactPullbackCLM_ae : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (K : Set HyperbolicSpace) (hK : IsCompact K) (F : KernelQuotientL2), kernelCompactPullbackCLM K hK F=ᵐ[hyperbolicVolume.restrict K] fun w => F (integralOrbitProjection globalKubotaKernel w) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (K : Set HyperbolicSpace) (hK : IsCompact K) (F : KernelQuotientL2) => by have hm : MeasurePreserving (integralOrbitProjection globalKubotaKernel) (hyperbolicVolume.restrict K) (Measure.map (integralOrbitProjection globalKubotaKernel) (hyperbolicVolume.restrict K)) := ⟨measurable_integralOrbitProjection _,rfl⟩ have he := dominatedComplexL2_ae (by simp : (kernelCompactMultiplicity K hK:ℝ≥0∞)≠⊤) (kernelCompactMultiplicity_spec K hK) F exact (Lp.coeFn_compMeasurePreserving _ hm).trans (hm.quasiMeasurePreserving.ae_eq_comp he) lemma whittaker_bound_integrable_finite («μ» : Measure ℝ) [IsFiniteMeasure «μ»] (b : ℝ) (hb : 1 (1+‖p.2‖^2)^(-b)) («μ».prod volume) := by have hk : Integrable (fun z : ℂ => (1+‖z‖^2)^(-b)) := by convert (hyperbolicKernel_integrable (b:ℂ) hb).norm using 1 funext z simp only [hyperbolicKernel,Complex.norm_cpow_eq_rpow_re_of_pos (by positivity : 0<1+‖z‖^2),Complex.neg_re,Complex.ofReal_re] have hv : Integrable (fun _ : ℝ => (1:ℝ)) «μ» := integrable_const _ simpa only [one_mul] using hv.mul_prod hk lemma scaledWhittakerIntegrand_integrable («μ» : Measure ℝ) [IsFiniteMeasure «μ»] (ρ : BoundedContinuousFunction ℝ ℂ) (c : ℝ) (freq s : ℂ) (hs : 1 ρ p.1*whittakerIntegrand freq s (c*p.1,p.2)) («μ».prod volume) := by apply ((whittaker_bound_integrable_finite «μ» s.re hs).const_mul ‖ρ‖).mono' · exact ((ρ.continuous.comp continuous_fst).mul ((whittakerIntegrand_continuous freq s).comp (by fun_prop))).aestronglyMeasurable · exact Eventually.of_forall (fun p => by rw [norm_mul] exact mul_le_mul (ρ.norm_coe_le_norm p.1) (whittakerIntegrand_norm_bound freq s (c*p.1,p.2) s.re (by linarith) le_rfl) (norm_nonneg _) (norm_nonneg _)) lemma scaledWhittakerProduct_differentiableAt («μ» : Measure ℝ) [IsFiniteMeasure «μ»] (ρ : BoundedContinuousFunction ℝ ℂ) (c : ℝ) (freq s : ℂ) (hs : 1 ∫p : ℝ × ℂ,ρ p.1*whittakerIntegrand freq w (c*p.1,p.2)∂«μ».prod volume) s := by let b : ℝ := (s.re+1)/2 let ε : ℝ := (s.re-1)/4 have hb : 1 ρ p.1*whittakerIntegrand freq w (c*p.1,p.2)) (F' := fun w (p : ℝ × ℂ) => ρ p.1*whittakerIntegrandDeriv freq w (c*p.1,p.2)) (bound := fun p => ‖ρ‖*(ε⁻¹*(1+‖p.2‖^2)^(-b))) hU (Eventually.of_forall (fun w => ((ρ.continuous.comp continuous_fst).mul ((whittakerIntegrand_continuous freq w).comp (by fun_prop))).aestronglyMeasurable)) (scaledWhittakerIntegrand_integrable «μ» ρ c freq s hs) ((ρ.continuous.comp continuous_fst).mul ((whittakerIntegrandDeriv_continuous freq s).comp (by fun_prop))).aestronglyMeasurable (Eventually.of_forall (fun p w hw => by rw [norm_mul] exact mul_le_mul (ρ.norm_coe_le_norm p.1) (whittakerIntegrandDeriv_norm_bound freq w (c*p.1,p.2) b ε (by linarith) hε hw.le) (norm_nonneg _) (norm_nonneg _))) (((whittaker_bound_integrable_finite «μ» b hb).const_mul ε⁻¹).const_mul ‖ρ‖) (Eventually.of_forall (fun p w _ => (whittakerIntegrand_hasDerivAt freq w (c*p.1,p.2)).const_mul (ρ p.1))) exact h.2.differentiableAt lemma whittakerIntegrand_scale (c v : ℝ) (hc : 0 by dsimp only calc _ = ρ v*(((5/a:ℝ):ℂ)^(s+1)*whittakerIntegrand (freq/(5/a:ℝ)) s ((5/a)*v,z)) := by ring _ = _ := by rw [whittakerIntegrand_scale (5/a) v (by positivity) hvp hcv freq s z]; ring) _ = _ := integral_const_mul _ _ theorem cuspWeightedWhittakerInterval_differentiableAt (ρ : BoundedContinuousFunction ℝ ℂ) (a b : ℝ) (ha : 0 ∫v in Set.Icc a b,ρ v*(v:ℂ)^(-w-1)*sourceFourierKernel w (freq*v)) s := by have hc : ((5/a:ℝ):ℂ)≠0 := by exact_mod_cast (show (5/a:ℝ)≠0 by positivity) have hd := ((differentiableAt_id.add_const (1:ℂ)).const_cpow (Or.inl hc)).mul (scaledWhittakerProduct_differentiableAt (volume.restrict (Set.Icc a b)) ρ (5/a) (freq/(5/a:ℝ)) s hs) apply hd.congr_of_eventuallyEq filter_upwards [(isOpen_lt continuous_const Complex.continuous_re).mem_nhds hs] with w hw exact (scaledWhittakerProduct_eq_average ρ a b ha freq w hw).symm end open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace ComplexConjugate MatrixGroups ENNReal open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationWhittakerContinuation02 abbrev O := ActualEisensteinCubic.O end RootNotationWhittakerContinuation02 open RootNotationWhittakerContinuation02 (O) def cuspWeightedFourierPhase (ρ : BoundedContinuousFunction ℝ ℂ) (h : ActualEisensteinCubic.O) (w : HyperbolicSpace) : ℂ := ρ (hyperbolicHeight w)*cuspFourierPhase h w lemma cuspWeightedFourierPhase_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (ρ : BoundedContinuousFunction ℝ ℂ) (h : ActualEisensteinCubic.O), Continuous (cuspWeightedFourierPhase ρ h) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (ρ : BoundedContinuousFunction ℝ ℂ) (h : ActualEisensteinCubic.O) => (ρ.continuous.comp hyperbolicHeight_continuous).mul (cuspFourierPhase_continuous h) lemma cuspWeightedFourierPhase_bound (ρ : BoundedContinuousFunction ℝ ℂ) (h : ActualEisensteinCubic.O) (w : HyperbolicSpace) : ‖cuspWeightedFourierPhase ρ h w‖≤‖ρ‖ := by rw [cuspWeightedFourierPhase,norm_mul,cuspFourierPhase_norm,mul_one] exact ρ.norm_coe_le_norm _ end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.GaussFactorization /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationGaussFactorization01 abbrev O := ActualEisensteinCubic.O end RootNotationGaussFactorization01 open RootNotationGaussFactorization01 (O) def cubicBesselNormalizer (h : ActualEisensteinCubic.O) : ℂ := (2*Real.pi:ℂ)/Complex.Gamma (4/3)*(2*Real.pi*‖cuspFrequency h‖:ℂ)^(1/3:ℂ) def cubicResidualFourierCoefficient (h : ActualEisensteinCubic.O) : ℂ := cubicBesselNormalizer h*nonzeroScatteringResidue h lemma sourceFourierKernel_cubic_height (h : ActualEisensteinCubic.O) (hh : h≠0) (v : ℝ) (hv : 0 (4/3:ℂ)+(t:ℂ)*Complex.I) (𝓝[>] (0:ℝ)) (𝓝[≠] (4/3:ℂ)) := by apply tendsto_nhdsWithin_iff.mpr constructor · have hc : ContinuousAt (fun t : ℝ => (4/3:ℂ)+(t:ℂ)*Complex.I) 0 := by fun_prop simpa only [Complex.ofReal_zero,zero_mul,add_zero] using hc.tendsto.mono_left nhdsWithin_le_nhds · filter_upwards [self_mem_nhdsWithin] with t ht change 0 z.1.1) he have h2:=congrArg (fun z : AdmissibleResidue a × CubicUnitResidue b => z.2.1) he change Ideal.Quotient.mk (Ideal.span {3*a}) (denominatorRep (a*b) r.1)= Ideal.Quotient.mk (Ideal.span {3*a}) (denominatorRep (a*b) t.1) at h1 change Ideal.Quotient.mk (Ideal.span {b}) (denominatorRep (a*b) r.1)= Ideal.Quotient.mk (Ideal.span {b}) (denominatorRep (a*b) t.1) at h2 have hdiv : 3*(a*b) ∣ denominatorRep (a*b) r.1-denominatorRep (a*b) t.1 := by simpa only [mul_assoc] using hab.mul_dvd (Ideal.mem_span_singleton.mp ((Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp h1)) (Ideal.mem_span_singleton.mp ((Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp h2)) apply Subtype.ext rw [←denominatorRep_spec (a*b) r.1,←denominatorRep_spec (a*b) t.1] exact (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr (Ideal.mem_span_singleton.mpr hdiv) lemma denominatorCRTMap_surjective (a b : Eis) (hab : IsCoprime (3*a) b) : Function.Surjective (denominatorCRTMap a b) := by rintro ⟨r,t⟩ obtain ⟨u,v,huv⟩ := hab let delta:=denominatorRep a r.1 let xi:=GaussianShiftedPartition.representative b t.1 let d:=v*b*delta+u*(3*a)*xi have hda : 3*a ∣ d-delta := by refine ⟨u*(xi-delta),?_⟩ dsimp [d] linear_combination delta*huv have hdb : b ∣ d-xi := by refine ⟨v*(delta-xi),?_⟩ dsimp [d] linear_combination xi*huv have hxi : IsCoprime b xi := by apply (isUnit_quotient_span_iff b xi).mp simpa only [xi,GaussianShiftedPartition.representative_spec] using t.2 have had : denominatorCondition a d := (denominatorCondition_congr a d delta hda).mpr r.2 have hbd : IsCoprime b d := (isCoprime_right_congr_of_dvd b d xi hdb).mpr hxi have hd : denominatorCondition (a*b) d := ⟨had.1.mul_left hbd,had.2⟩ let q : AdmissibleResidue (a*b):=⟨Ideal.Quotient.mk (Ideal.span {3*(a*b)}) d, (denominatorCondition_congr (a*b) _ d (denominatorRep_mk_congr (a*b) d)).mpr hd⟩ refine ⟨q,Prod.ext (Subtype.ext ?_) (Subtype.ext ?_)⟩ · change Ideal.Quotient.mk (Ideal.span {3*a}) (denominatorRep (a*b) q.1)=r.1 rw [←denominatorRep_spec a r.1] apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr apply Ideal.mem_span_singleton.mpr have hh : 3*a ∣ denominatorRep (a*b) q.1-d := by exact (show 3*a ∣ 3*(a*b) from ⟨b,by ring⟩).trans (denominatorRep_mk_congr (a*b) d) simpa only [sub_add_sub_cancel] using dvd_add hh hda · change Ideal.Quotient.mk (Ideal.span {b}) (denominatorRep (a*b) q.1)=t.1 rw [←GaussianShiftedPartition.representative_spec b t.1] apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr apply Ideal.mem_span_singleton.mpr have hh : b ∣ denominatorRep (a*b) q.1-d := by exact (show b ∣ 3*(a*b) from ⟨3*a,by ring⟩).trans (denominatorRep_mk_congr (a*b) d) simpa only [sub_add_sub_cancel] using dvd_add hh hdb def denominatorCRTEquiv (a b : Eis) (hab : IsCoprime (3*a) b) : AdmissibleResidue (a*b) ≃ AdmissibleResidue a × CubicUnitResidue b := Equiv.ofBijective (denominatorCRTMap a b) ⟨denominatorCRTMap_injective a b hab,denominatorCRTMap_surjective a b hab⟩ def residueAdditive (h c d : Eis) : ℂ := ShortDraftTrace.breveE (cuspFrequency h*eisEmbedding d/eisEmbedding c) lemma residueAdditive_congr (h c d e : Eis) (hc : c≠0) (hde : 3*c ∣ d-e) : residueAdditive h c d=residueAdditive h c e := by obtain ⟨n,hn⟩:=hde have hd:d=e+3*c*n:=by linear_combination hn have he:eisEmbedding c≠0:=eisEmbedding_ne_zero hc unfold residueAdditive rw [hd] have hh : cuspFrequency h*eisEmbedding (e+3*c*n)/eisEmbedding c= cuspFrequency h*eisEmbedding e/eisEmbedding c+cuspFrequency h*(3*eisEmbedding n) := by simp only [map_add,map_mul,map_ofNat] field_simp rw [hh,AddChar.map_add_eq_mul,cuspFrequency_period,mul_one] def cubicUnitGaussSum (h b : Eis) : ℂ := ∑' r : CubicUnitResidue b, eisEmbedding (symbol (GaussianShiftedPartition.representative b r.1) b)* residueAdditive (3*h) b (GaussianShiftedPartition.representative b r.1) lemma residueAdditive_three_congr (h b d e : Eis) (hb : b≠0) (hde : b ∣ d-e) : residueAdditive (3*h) b d=residueAdditive (3*h) b e := by obtain ⟨n,hn⟩:=hde have hd:d=e+b*n:=by linear_combination hn have he:eisEmbedding b≠0:=eisEmbedding_ne_zero hb unfold residueAdditive rw [hd] have hh : cuspFrequency (3*h)*eisEmbedding (e+b*n)/eisEmbedding b= cuspFrequency (3*h)*eisEmbedding e/eisEmbedding b+cuspFrequency h*(3*eisEmbedding n) := by simp only [cuspFrequency,map_add,map_mul,map_ofNat] field_simp rw [hh,AddChar.map_add_eq_mul,cuspFrequency_period,mul_one] lemma residueAdditive_crt (h a b alpha beta d : Eis) (ha : a≠0) (hb : b≠0) (hbez : alpha*b+beta*(3*a)=1) : residueAdditive h (a*b) d= residueAdditive (h*alpha) a d*residueAdditive (3*(h*beta)) b d := by unfold residueAdditive rw [←AddChar.map_add_eq_mul] congr 1 have hae:=eisEmbedding_ne_zero ha have hbe:=eisEmbedding_ne_zero hb have hbeq:=congrArg eisEmbedding hbez simp only [map_add,map_mul,map_one,map_ofNat] at hbeq simp only [cuspFrequency,map_mul,map_ofNat] field_simp [hae,hbe,eisLam_ne_zero] linear_combination -(eisEmbedding h*eisEmbedding d)*hbeq theorem arithmeticResidueSum_crt (h a b alpha beta : Eis) (ha : a≠0) (hb : b≠0) (halevel : (3:Eis)∣a) (hbprimary : lambda^2∣b-1) (hbez : alpha*b+beta*(3*a)=1) : arithmeticResidueSum h (a*b)= arithmeticResidueSum (h*alpha) a*cubicUnitGaussSum (h*beta) b := by have hab : IsCoprime (3*a) b:=⟨beta,alpha,by linear_combination hbez⟩ let f : AdmissibleResidue a→ℂ:=fun r=> eisEmbedding (symbol a (denominatorRep a r.1))*residueAdditive (h*alpha) a (denominatorRep a r.1) let g : CubicUnitResidue b→ℂ:=fun r=> eisEmbedding (symbol (GaussianShiftedPartition.representative b r.1) b)* residueAdditive (3*(h*beta)) b (GaussianShiftedPartition.representative b r.1) have heq: arithmeticResidueSum h (a*b)=∑' r : AdmissibleResidue (a*b), f (denominatorCRTEquiv a b hab r).1*g (denominatorCRTEquiv a b hab r).2 := by unfold arithmeticResidueSum apply tsum_congr intro r exact (by let d:=denominatorRep (a*b) r.1 let delta:=denominatorRep a (denominatorCRTMap a b r).1.1 let xi:=GaussianShiftedPartition.representative b (denominatorCRTMap a b r).2.1 have hdprimary : lambda^2∣d-1:=lambda_sq_dvd_three.trans r.2.2 have hdelta : 3*a∣delta-d:=denominatorRep_mk_congr a d have hxi : b∣xi-d:=by apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp exact GaussianShiftedPartition.representative_spec b _ have hchar : symbol (a*b) d=symbol a delta*symbol xi b := by rw [symbol_mul_numerator a b d hdprimary, symbol_reciprocity b d hb (primary_ne_zero d hdprimary) hbprimary hdprimary, ←symbol_congr hxi] rw [←row_symbol_congr_modulus a delta d halevel r.2.2 hdelta] change eisEmbedding (symbol (a*b) d)*residueAdditive h (a*b) d= (eisEmbedding (symbol a delta)*residueAdditive (h*alpha) a delta)* (eisEmbedding (symbol xi b)*residueAdditive (3*(h*beta)) b xi) rw [hchar,map_mul,residueAdditive_crt h a b alpha beta d ha hb hbez, residueAdditive_congr (h*alpha) a delta d ha hdelta, residueAdditive_three_congr (h*beta) b xi d hb hxi] ring ) rw [heq,(denominatorCRTEquiv a b hab).tsum_eq (fun r=>f r.1*g r.2)] let : Finite (AdmissibleResidue a):=finite_admissibleResidue a ha let : Finite (Eis ⧸ Ideal.span {b}):=finite_quotient_span hb let : Fintype (AdmissibleResidue a):=Fintype.ofFinite _ let : Fintype (CubicUnitResidue b):=Fintype.ofFinite _ change (∑' r : AdmissibleResidue a × CubicUnitResidue b,f r.1*g r.2)= (∑' r : AdmissibleResidue a,f r)*(∑' t : CubicUnitResidue b,g t) simp only [tsum_fintype,Fintype.sum_prod_type,Finset.mul_sum,Finset.sum_mul] exact Finset.sum_comm end open scoped BigOperators Classical open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationGaussFactorization05 abbrev Eis := ActualEisensteinCubic.O end RootNotationGaussFactorization05 open RootNotationGaussFactorization05 (Eis) lemma residueAdditive_mul (h c t d : Eis) : residueAdditive h c (t*d)=residueAdditive (h*t) c d := by unfold residueAdditive cuspFrequency simp only [map_mul] congr 1 ring lemma residueAdditive_swap (h c d : Eis) : residueAdditive h c d=residueAdditive d c h := by unfold residueAdditive cuspFrequency congr 1 ring lemma arithmeticResidueSum_frequency_congr (h k c : Eis) (hc : c≠0) (hh : 3*c∣h-k) : arithmeticResidueSum h c=arithmeticResidueSum k c := by unfold arithmeticResidueSum apply tsum_congr intro r congr 1 change residueAdditive h c (denominatorRep c r.1)=residueAdditive k c (denominatorRep c r.1) rw [residueAdditive_swap h,residueAdditive_swap k] exact residueAdditive_congr _ c h k hc hh theorem arithmeticResidueSum_frequency_twist (h c t : Eis) (hc : c≠0) (hlevel : (3:Eis)∣c) (ht : denominatorCondition c t) : eisEmbedding (symbol c t)*arithmeticResidueSum (h*t) c=arithmeticResidueSum h c := by have heq:=(residueMultiplicationEquiv c hc t ht).tsum_eq (fun r : AdmissibleResidue c=>eisEmbedding (symbol c (denominatorRep c r.1))* residueAdditive h c (denominatorRep c r.1)) calc _ = ∑' r : AdmissibleResidue c,eisEmbedding (symbol c t)* (eisEmbedding (symbol c (denominatorRep c r.1))*residueAdditive (h*t) c (denominatorRep c r.1)) := by rw [tsum_mul_left] rfl _ = ∑' r : AdmissibleResidue c, eisEmbedding (symbol c (denominatorRep c (residueMultiplicationEquiv c hc t ht r).1))* residueAdditive h c (denominatorRep c (residueMultiplicationEquiv c hc t ht r).1) := by apply tsum_congr intro r change _=eisEmbedding (symbol c (denominatorRep c (residueMultiplication c t ht r).1))* residueAdditive h c (denominatorRep c (residueMultiplication c t ht r).1) rw [residueMultiplication_phase c hlevel t ht r,map_mul] dsimp only [residueMultiplication] rw [residueAdditive_congr h c _ (t*denominatorRep c r.1) hc (denominatorRep_product_congr c t r.1),residueAdditive_mul] ring _ = _ := heq lemma cubicUnitGaussSum_frequency_congr (h k b : Eis) (hb : b≠0) (hh : b∣h-k) : cubicUnitGaussSum h b=cubicUnitGaussSum k b := by unfold cubicUnitGaussSum apply tsum_congr intro r congr 1 have he (u : Eis) : residueAdditive (3*u) b (GaussianShiftedPartition.representative b r.1)= residueAdditive (3*GaussianShiftedPartition.representative b r.1) b u := by unfold residueAdditive cuspFrequency simp only [map_mul,map_ofNat] congr 1 ring rw [he h,he k] exact residueAdditive_three_congr _ b h k hb hh def cubicUnitResidueMul (b t : Eis) (ht : IsCoprime b t) (r : CubicUnitResidue b) : CubicUnitResidue b := ⟨Ideal.Quotient.mk (Ideal.span {b}) t*r.1, ((isUnit_quotient_span_iff b t).mpr ht).mul r.2⟩ lemma cubicUnitResidueMul_injective (b t : Eis) (ht : IsCoprime b t) : Function.Injective (cubicUnitResidueMul b t ht) := by intro r q heq apply Subtype.ext exact ((isUnit_quotient_span_iff b t).mpr ht).mul_left_cancel (congrArg Subtype.val heq) def cubicUnitResidueMulEquiv (b t : Eis) (hb : b≠0) (ht : IsCoprime b t) : CubicUnitResidue b ≃ CubicUnitResidue b := by letI : Finite (Eis ⧸ Ideal.span {b}):=finite_quotient_span hb exact Equiv.ofBijective (cubicUnitResidueMul b t ht) ⟨cubicUnitResidueMul_injective b t ht, Finite.surjective_of_injective (cubicUnitResidueMul_injective b t ht)⟩ lemma cubicUnitResidueMul_rep_congr (b t : Eis) (ht : IsCoprime b t) (r : CubicUnitResidue b) : b∣GaussianShiftedPartition.representative b (cubicUnitResidueMul b t ht r).1- t*GaussianShiftedPartition.representative b r.1 := by apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp rw [GaussianShiftedPartition.representative_spec,map_mul, GaussianShiftedPartition.representative_spec] rfl theorem cubicUnitGaussSum_frequency_twist (h b t : Eis) (hb : b≠0) (hbprimary : lambda^2∣b-1) (ht : IsCoprime b t) : eisEmbedding (symbol t b)*cubicUnitGaussSum (h*t) b=cubicUnitGaussSum h b := by have heq:=(cubicUnitResidueMulEquiv b t hb ht).tsum_eq (fun r : CubicUnitResidue b=>eisEmbedding (symbol (GaussianShiftedPartition.representative b r.1) b)* residueAdditive (3*h) b (GaussianShiftedPartition.representative b r.1)) calc _ = ∑' r : CubicUnitResidue b,eisEmbedding (symbol t b)* (eisEmbedding (symbol (GaussianShiftedPartition.representative b r.1) b)* residueAdditive (3*(h*t)) b (GaussianShiftedPartition.representative b r.1)) := by rw [tsum_mul_left] rfl _ = ∑' r : CubicUnitResidue b, eisEmbedding (symbol (GaussianShiftedPartition.representative b (cubicUnitResidueMulEquiv b t hb ht r).1) b)* residueAdditive (3*h) b (GaussianShiftedPartition.representative b (cubicUnitResidueMulEquiv b t hb ht r).1) := by apply tsum_congr intro r change _=eisEmbedding (symbol (GaussianShiftedPartition.representative b (cubicUnitResidueMul b t ht r).1) b)* residueAdditive (3*h) b (GaussianShiftedPartition.representative b (cubicUnitResidueMul b t ht r).1) rw [symbol_congr (cubicUnitResidueMul_rep_congr b t ht r), symbol_mul_numerator t _ b hbprimary,map_mul] rw [residueAdditive_three_congr h b _ (t*GaussianShiftedPartition.representative b r.1) hb (cubicUnitResidueMul_rep_congr b t ht r),residueAdditive_mul] rw [show (3*h)*t=3*(h*t) by ring] ring _ = _ := heq theorem arithmeticResidueSum_coprime_product (h a b : Eis) (ha : a≠0) (hb : b≠0) (halevel : (3:Eis)∣a) (hbprimary : lambda^2∣b-1) (hab : IsCoprime (3*a) b) : arithmeticResidueSum h (a*b)= eisEmbedding (symbol a b)*eisEmbedding (symbol (3*a) b)* arithmeticResidueSum h a*cubicUnitGaussSum h b := by obtain ⟨beta,alpha,hbez⟩:=hab have hbez' : alpha*b+beta*(3*a)=1:=by linear_combination hbez have hab' : IsCoprime (3*a) b:=⟨beta,alpha,hbez⟩ have hb3 : (3:Eis)∣b-1:=three_dvd_lambda_sq.trans hbprimary have hbt : denominatorCondition a b:=⟨hab'.of_mul_left_right,hb3⟩ have hA := arithmeticResidueSum_frequency_twist (h*alpha) a b ha halevel hbt have hAf : 3*a∣(h*alpha)*b-h:=⟨-h*beta,by linear_combination h*hbez'⟩ rw [arithmeticResidueSum_frequency_congr _ h a ha hAf] at hA have hB := cubicUnitGaussSum_frequency_twist (h*beta) b (3*a) hb hbprimary hab'.symm have hBf : b∣(h*beta)*(3*a)-h:=⟨-h*alpha,by linear_combination h*hbez'⟩ rw [cubicUnitGaussSum_frequency_congr _ h b hb hBf] at hB rw [arithmeticResidueSum_crt h a b alpha beta ha hb halevel hbprimary hbez',←hA,←hB] ring end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.RamifiedGaussSeries /- Named aliases replace local notation; all original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped BigOperators Classical section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationRamifiedGaussSeries01 abbrev Eis := ActualEisensteinCubic.O end RootNotationRamifiedGaussSeries01 open RootNotationRamifiedGaussSeries01 (Eis) lemma ramifiedElement_ne_zero (u : Eisˣ) (n : ℕ) : u.val*lambda^n≠0 := by have hl : lambda≠0:=by intro hh apply CompletedGauss.embedding_lambda_ne_zero rw [hh,map_zero] exact mul_ne_zero u.ne_zero (pow_ne_zero _ hl) lemma ramifiedElement_level (u : Eisˣ) (n : ℕ) (hn : 2≤n) : (3:Eis)∣u.val*lambda^n := dvd_mul_of_dvd_right (three_dvd_lambda_sq.trans (pow_dvd_pow lambda hn)) _ lemma ramified_denominator_condition (u : Eisˣ) (n : ℕ) (d : Eis) (hd : (3:Eis)∣d-1) : denominatorCondition (u.val*lambda^n) d := by have hu : IsCoprime u.val d:=⟨u.inv,0,by simp⟩ have hl3 : lambda∣(3:Eis):=(dvd_pow_self lambda (by decide : (2:ℕ)≠0)).trans lambda_sq_dvd_three have hld : IsCoprime lambda d:=coprime_of_dvd_sub_one lambda d (hl3.trans hd) exact ⟨hu.mul_left hld.pow_left,hd⟩ lemma ramified_symbol_congr_mod_nine (u : Eisˣ) (n : ℕ) (d e : Eis) (hd : (3:Eis)∣d-1) (he : (3:Eis)∣e-1) (hde : (9:Eis)∣d-e) : symbol (u.val*lambda^n) d=symbol (u.val*lambda^n) e := by have hdp:=lambda_sq_dvd_three.trans hd have hep:=lambda_sq_dvd_three.trans he rw [symbol_mul_numerator _ _ d hdp,symbol_mul_numerator _ _ e hep, symbol_pow_numerator _ d hdp,symbol_pow_numerator _ e hep, symbol_unit_congr_mod_nine u.val d e u.isUnit hdp hep hde, CubicRamified.symbol_lambda_congr_mod_nine d e hdp hep hde] lemma primary_add_nine (d w : Eis) (hd : (3:Eis)∣d-1) : (3:Eis)∣d+9*w-1 := by convert dvd_add hd (show (3:Eis)∣9*w from ⟨3*w,by ring⟩) using 1 ; ring def ramifiedResidueAdd (u : Eisˣ) (n : ℕ) (w : Eis) (r : AdmissibleResidue (u.val*lambda^n)) : AdmissibleResidue (u.val*lambda^n) := let c:=u.val*lambda^n let d:=denominatorRep c r.1+9*w ⟨Ideal.Quotient.mk (Ideal.span {3*c}) d, (denominatorCondition_congr c _ d (denominatorRep_mk_congr c d)).mpr (ramified_denominator_condition u n d (primary_add_nine _ _ r.2.2))⟩ lemma ramifiedResidueAdd_injective (u : Eisˣ) (n : ℕ) (w : Eis) : Function.Injective (ramifiedResidueAdd u n w) := by intro r q heq have hh:=congrArg Subtype.val heq change Ideal.Quotient.mk (Ideal.span {3*(u.val*lambda^n)}) (denominatorRep _ r.1+9*w)= Ideal.Quotient.mk (Ideal.span {3*(u.val*lambda^n)}) (denominatorRep _ q.1+9*w) at hh simp only [map_add,denominatorRep_spec] at hh exact Subtype.ext (add_right_cancel hh) def ramifiedResidueAddEquiv (u : Eisˣ) (n : ℕ) (w : Eis) : AdmissibleResidue (u.val*lambda^n) ≃ AdmissibleResidue (u.val*lambda^n) := by letI : Finite (AdmissibleResidue (u.val*lambda^n)):= finite_admissibleResidue _ (ramifiedElement_ne_zero u n) exact Equiv.ofBijective (ramifiedResidueAdd u n w) ⟨ramifiedResidueAdd_injective u n w, Finite.surjective_of_injective (ramifiedResidueAdd_injective u n w)⟩ lemma residueAdditive_add (h c d e : Eis) : residueAdditive h c (d+e)=residueAdditive h c d*residueAdditive h c e := by unfold residueAdditive rw [map_add,mul_add,add_div,AddChar.map_add_eq_mul] theorem ramified_arithmetic_additive_eigen (h : Eis) (u : Eisˣ) (n : ℕ) (hn : 2≤n) (w : Eis) : residueAdditive h (u.val*lambda^n) (9*w)*arithmeticResidueSum h (u.val*lambda^n)= arithmeticResidueSum h (u.val*lambda^n) := by let c:=u.val*lambda^n have hc:c≠0:=ramifiedElement_ne_zero u n have hlevel:(3:Eis)∣c:=ramifiedElement_level u n hn have heq:=(ramifiedResidueAddEquiv u n w).tsum_eq (fun r : AdmissibleResidue c=>eisEmbedding (symbol c (denominatorRep c r.1))* residueAdditive h c (denominatorRep c r.1)) calc _ = ∑' r : AdmissibleResidue c,residueAdditive h c (9*w)* (eisEmbedding (symbol c (denominatorRep c r.1))*residueAdditive h c (denominatorRep c r.1)) := by rw [tsum_mul_left] rfl _ = ∑' r : AdmissibleResidue c, eisEmbedding (symbol c (denominatorRep c (ramifiedResidueAddEquiv u n w r).1))* residueAdditive h c (denominatorRep c (ramifiedResidueAddEquiv u n w r).1) := by apply tsum_congr intro r let d:=denominatorRep c r.1 have hrep : 3*c∣denominatorRep c (ramifiedResidueAdd u n w r).1-(d+9*w):= denominatorRep_mk_congr c (d+9*w) have hdp:(3:Eis)∣d+9*w-1:=primary_add_nine d w r.2.2 have hchar : symbol c (denominatorRep c (ramifiedResidueAdd u n w r).1)=symbol c d := by rw [row_symbol_congr_modulus c _ (d+9*w) hlevel hdp hrep] exact ramified_symbol_congr_mod_nine u n (d+9*w) d hdp r.2.2 ⟨w,by ring⟩ change _=eisEmbedding (symbol c (denominatorRep c (ramifiedResidueAdd u n w r).1))* residueAdditive h c (denominatorRep c (ramifiedResidueAdd u n w r).1) rw [hchar,residueAdditive_congr h c _ (d+9*w) hc hrep,residueAdditive_add] dsimp only [d] ring _ = _ := heq theorem ramified_arithmetic_support (h : Eis) (u : Eisˣ) (n : ℕ) (hn : 2≤n) (hA : arithmeticResidueSum h (u.val*lambda^n)≠0) : u.val*lambda^n∣3*h := by let c:=u.val*lambda^n have hc:c≠0:=ramifiedElement_ne_zero u n have hp : ∀w:Eis,residueAdditive h c (9*w)=1:=by intro w apply mul_right_cancel₀ hA rw [ramified_arithmetic_additive_eigen h u n hn w,one_mul] let psi:=eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc have hprimitive:psi.IsPrimitive:=GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive c hc by_contra hdiv have hne:Ideal.Quotient.mk (Ideal.span {c}) (3*h)≠0:=by intro hh exact hdiv (Ideal.mem_span_singleton.mp (Ideal.Quotient.eq_zero_iff_mem.mp hh)) apply hprimitive hne ext x obtain ⟨w,rfl⟩:=Ideal.Quotient.mk_surjective x simp only [AddChar.mulShift_apply,←map_mul,psi,eisTraceModChar, IdealGaussCRT.traceModChar_mk,AddChar.one_apply] convert hp w using 1 unfold residueAdditive cuspFrequency simp only [map_mul,map_ofNat] congr 1 field_simp ; ring end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationRamifiedGaussSeries02 abbrev Eis := ActualEisensteinCubic.O end RootNotationRamifiedGaussSeries02 open RootNotationRamifiedGaussSeries02 (Eis) lemma ramified_primary_coprime (u : Eisˣ) (n : ℕ) (b : Eis) (hb : lambda^2∣b-1) : IsCoprime (3*(u.val*lambda^n)) b := by have h3:IsCoprime (3:Eis) b:=(primary_coprime_three b hb).symm have hl:IsCoprime lambda b:=coprime_of_dvd_sub_one lambda b ((dvd_pow_self lambda (by decide : (2:ℕ)≠0)).trans hb) have hu:IsCoprime u.val b:=⟨u.inv,0,by simp⟩ exact h3.mul_left (hu.mul_left hl.pow_left) theorem arithmeticResidueSum_ramified_split (h : Eis) (u : Eisˣ) (n : ℕ) (hn : 2≤n) (b : Eis) (hb : lambda^2∣b-1) : arithmeticResidueSum h ((u.val*lambda^n)*b)= eisEmbedding (symbol (u.val*lambda^n) b)* eisEmbedding (symbol (3*(u.val*lambda^n)) b)* arithmeticResidueSum h (u.val*lambda^n)*cubicUnitGaussSum h b := arithmeticResidueSum_coprime_product h _ b (ramifiedElement_ne_zero u n) (primary_ne_zero b hb) (ramifiedElement_level u n hn) hb (ramified_primary_coprime u n b hb) lemma ramifiedElement_absNorm (u : Eisˣ) (n : ℕ) : Ideal.absNorm (Ideal.span {u.val*lambda^n})=3^n := by have hu:Ideal.span {u.val}=(1:Ideal Eis):=by rw [Ideal.one_eq_top] exact Ideal.span_singleton_eq_top.mpr u.isUnit rw [←Ideal.span_singleton_mul_span_singleton,map_mul,hu,map_one,one_mul, ←Ideal.span_singleton_pow,map_pow,absNorm_span_lambda] lemma three_absNorm : Ideal.absNorm (Ideal.span {(3:Eis)})=9 := by rw [←qNat_eq_absNorm_span] have he:(3:Eis)=ActualEisensteinCoordinates.eval 3 0:=by simp [ActualEisensteinCoordinates.eval] rw [he,ShortDraftLatticeCount.qNat,ShortDraftLatticeCount.coords_eval] norm_num [ShortDraftLatticeCount.q] all_goals rfl theorem ramified_arithmetic_norm_bound (h : Eis) (hh : h≠0) (u : Eisˣ) (n : ℕ) (hn : 2≤n) (hA : arithmeticResidueSum h (u.val*lambda^n)≠0) : 3^n≤9*Ideal.absNorm (Ideal.span {h}) := by have hI:(Ideal.span {h}:Ideal Eis)≠0:=Ideal.span_singleton_eq_bot.not.mpr hh have hN:0hI (Ideal.absNorm_eq_zero_iff.mp hz)) apply Nat.le_of_dvd (by positivity) obtain ⟨v,hv⟩:=ramified_arithmetic_support h u n hn hA refine ⟨Ideal.absNorm (Ideal.span {v}),?_⟩ calc 9*Ideal.absNorm (Ideal.span {h})=Ideal.absNorm (Ideal.span {(3:Eis)*h}):=by rw [←Ideal.span_singleton_mul_span_singleton,map_mul,three_absNorm] _=Ideal.absNorm (Ideal.span {(u.val*lambda^n)*v}):=by rw [hv] _=3^n*Ideal.absNorm (Ideal.span {v}):=by rw [←Ideal.span_singleton_mul_span_singleton,map_mul,ramifiedElement_absNorm] def ramifiedFrequencyBound (h : Eis) : ℕ:=Nat.log 3 (9*Ideal.absNorm (Ideal.span {h})) theorem arithmeticResidueSum_ramified_index_bound (h : Eis) (hh : h≠0) (u : Eisˣ) (n : ℕ) (hn : 2≤n) (b : Eis) (hb : lambda^2∣b-1) (hA : arithmeticResidueSum h ((u.val*lambda^n)*b)≠0) : n≤ramifiedFrequencyBound h := by have ha:arithmeticResidueSum h (u.val*lambda^n)≠0:=by intro hz apply hA rw [arithmeticResidueSum_ramified_split h u n hn b hb,hz,mul_zero,zero_mul] exact Nat.le_log_of_pow_le (by decide) (ramified_arithmetic_norm_bound h hh u n hn ha) theorem arithmeticDirichletTerm_ramified_vanish (s : ℂ) (h : Eis) (hh : h≠0) (u : Eisˣ) (n : ℕ) (hn : 2≤n) (b : Eis) (hb : lambda^2∣b-1) (hout : ramifiedFrequencyBound hc.1.1) h have hs:=congrArg (fun x:Eis=>Ideal.span {x}) hc rw [ramifiedLower_span,ramifiedLower_span] at hs have hh:lambdaFactorMap (n+2,I)=lambdaFactorMap (m+2,J):=Subtype.ext hs have he:=lambdaFactorMap_bijective.1 hh have hnm:n=m:=by have ht:=congrArg Prod.fst he; omega have hIJ:I=J:=congrArg Prod.snd he subst m subst J have huv:u=v:=by apply Units.ext apply mul_right_cancel₀ (mul_ne_zero (pow_ne_zero _ PrimaryIdealUnitReindex.lambda_prime_actual.ne_zero) I.2) simpa only [ramifiedLower,mul_assoc] using hc subst v rfl lemma ramifiedLowerMap_surjective : Function.Surjective ramifiedLowerMap := by intro c let C:NonzeroIdeal:=⟨Ideal.span {c.1.1},Ideal.span_singleton_eq_bot.not.mpr c.2⟩ obtain ⟨⟨k,I⟩,hCI⟩:=lambdaFactorMap_bijective.2 C have hfact:ramifiedIdeal^k*I.1=Ideal.span {c.1.1}:=congrArg Subtype.val hCI have hp2:ramifiedIdeal^2∣ramifiedIdeal^k*I.1:=by rw [hfact] change (Ideal.span {lambda}:Ideal Eis)^2∣ _ rw [Ideal.span_singleton_pow,Ideal.dvd_iff_le,Ideal.span_singleton_le_span_singleton] exact lambda_sq_dvd_three.trans c.1.2 have hk:2≤k:=by by_contra hh have hcases:k=0∨k=1:=by omega have hnot:=((goodIdeal_iff_not_ramified I.1).mp I.2) rcases hcases with rfl|rfl · simp only [pow_zero,one_mul] at hp2 exact hnot ((dvd_pow_self ramifiedIdeal (by decide : (2:ℕ)≠0)).trans hp2) · rw [pow_one,pow_two] at hp2 exact hnot ((mul_dvd_mul_iff_left ramifiedIdeal_prime.ne_zero).mp hp2) obtain ⟨n,hn⟩:=Nat.exists_eq_add_of_le hk have hk':k=n+2:=by omega subst k have hspan : Ideal.span {lambda^(n+2)*primaryGenerator I.1}=Ideal.span {c.1.1}:= (lambdaFactor_generator_span (n+2) I).trans (by simpa only [Nat.add_comm] using hfact) obtain ⟨u,hu⟩:=Ideal.span_singleton_eq_span_singleton.mp hspan refine ⟨(u,n,I),Subtype.ext (Subtype.ext ?_)⟩ change ramifiedLower u n I=c.1.1 simpa only [ramifiedLower,mul_assoc,mul_comm,mul_left_comm] using hu def ramifiedLowerEquiv : Eisˣ × ℕ × GoodIdeal ≃ NonzeroLevelLower:= Equiv.ofBijective ramifiedLowerMap ⟨ramifiedLowerMap_injective,ramifiedLowerMap_surjective⟩ lemma arithmeticDirichlet_support_nonzero (s : ℂ) (h : Eis) : Function.support (arithmeticDirichletTerm s h)⊆{c : LevelLower | c.1≠0} := by intro c hc change arithmeticDirichletTerm s h c≠0 at hc intro hz exact hc (by simp only [arithmeticDirichletTerm,hz,ite_true]) theorem arithmeticDirichletSeries_ramified_reindex (s : ℂ) (hs : 2arithmeticDirichletTerm s h c.1):=hsum.subtype _ have hp:=ramifiedLowerEquiv.summable_iff.mpr hsub change Summable (fun p:Eisˣ×ℕ×GoodIdeal=>arithmeticDirichletTerm s h (ramifiedLowerMap p).1) at hp calc _=∑'c:NonzeroLevelLower,arithmeticDirichletTerm s h c.1:= (tsum_subtype_eq_of_support_subset (arithmeticDirichlet_support_nonzero s h)).symm _=∑'p:Eisˣ×ℕ×GoodIdeal,arithmeticDirichletTerm s h (ramifiedLowerMap p).1:= (ramifiedLowerEquiv.tsum_eq _).symm _=_:=by rw [hp.tsum_prod] apply tsum_congr intro u exact (hp.prod_factor u).tsum_prod theorem arithmeticDirichletSeries_finite_ramified (s : ℂ) (hs : 2 hn (Nat.dvd_of_mod_eq_zero h) omega rcases hm with hm|hm · refine ⟨(n/3:ℕ),?_⟩ have he : n=1+3*(n/3) := by omega rw [rationalPrimary,if_pos hm,primaryCoord_eq] conv_lhs => rw [he] simp only [Int.cast_natCast, Nat.cast_add,Nat.cast_mul,Nat.cast_ofNat,] ring · refine ⟨-((n/3:ℕ):ℤ)-1,?_⟩ have he : n=2+3*(n/3) := by omega rw [rationalPrimary,if_neg (by omega),primaryCoord_eq] conv_lhs => rw [he] simp only [Int.cast_sub,Int.cast_neg,Int.cast_natCast, Nat.cast_add,Nat.cast_mul,Nat.cast_ofNat,] ring lemma rationalPrimary_primary (n : ℕ) (hn : ¬3∣n) : lambda^2∣rationalPrimary n-1 := by obtain ⟨A,hA⟩ := rationalPrimary_coord n hn rw [hA] exact primaryCoord_primary A 0 lemma rationalPrimary_denominator (x : ActualEisensteinCubic.O) (n : ℕ) : symbol x (rationalPrimary n)=symbol x (n:ActualEisensteinCubic.O) := by unfold rationalPrimary split_ifs · rfl · simp only [symbol,Ideal.span_singleton_neg] lemma rationalPrimary_numerator (m n : ℕ) (hn : ¬3∣n) : symbol (rationalPrimary m) (rationalPrimary n)=symbol (m:ActualEisensteinCubic.O) (rationalPrimary n) := by change symbol (if m%3=1 then (m:ActualEisensteinCubic.O) else -(m:ActualEisensteinCubic.O)) (rationalPrimary n)=_ split_ifs · rfl · exact symbol_neg_numerator _ _ (rationalPrimary_primary n hn) lemma rational_symbol_mul (a b n : ℕ) (hn : ¬3∣n) : symbol ((a*b:ℕ):ActualEisensteinCubic.O) (n:ActualEisensteinCubic.O)=symbol (a:ActualEisensteinCubic.O) (n:ActualEisensteinCubic.O)*symbol (b:ActualEisensteinCubic.O) (n:ActualEisensteinCubic.O) := by rw [←rationalPrimary_denominator _ n,←rationalPrimary_denominator (a:ActualEisensteinCubic.O) n, ←rationalPrimary_denominator (b:ActualEisensteinCubic.O) n,Nat.cast_mul] exact symbol_mul_numerator _ _ _ (rationalPrimary_primary n hn) lemma rational_symbol_three (n : ℕ) (hn : ¬3∣n) : symbol (3:ActualEisensteinCubic.O) (n:ActualEisensteinCubic.O)=1 := by letI := @OAI.ConcretePrimeRowBridge.instIsCyclotomicExtensionSingletonNatSetOfNatRatK rw [←rationalPrimary_denominator _ n] obtain ⟨A,hA⟩ := rationalPrimary_coord n hn rw [hA] have hprimary := primaryCoord_primary A 0 have hthree : (3:ActualEisensteinCubic.O)=-((1+2*omega)^2) := by have hw : omega^2=-omega-1 := by change (IsCyclotomicExtension.zeta_spec 3 ℚ K).toInteger^2= -(IsCyclotomicExtension.zeta_spec 3 ℚ K).toInteger-1 exact IsCyclotomicExtension.Rat.Three.eta_sq (IsCyclotomicExtension.zeta_spec 3 ℚ K) linear_combination 4*hw have htrace := symbol_traceLambda_eq_linearRay (primaryCoord A 0) hprimary change symbol (1+2*omega) (primaryCoord A 0)=_ at htrace rw [hthree,symbol_neg_numerator _ _ hprimary,symbol_pow_numerator _ _ hprimary, htrace,linearRay_primaryCoord] simp [cubicExp_zero] lemma rational_symbol_reciprocity (m n : ℕ) (hm : ¬3∣m) (hn : ¬3∣n) : symbol (m:ActualEisensteinCubic.O) (n:ActualEisensteinCubic.O)=symbol (n:ActualEisensteinCubic.O) (m:ActualEisensteinCubic.O) := by calc _ = symbol (rationalPrimary m) (rationalPrimary n) := by rw [rationalPrimary_numerator m n hn,rationalPrimary_denominator] _ = symbol (rationalPrimary n) (rationalPrimary m) := symbol_reciprocity _ _ (primary_ne_zero _ (rationalPrimary_primary m hm)) (primary_ne_zero _ (rationalPrimary_primary n hn)) (rationalPrimary_primary m hm) (rationalPrimary_primary n hn) _ = _ := by rw [rationalPrimary_numerator n m hm,rationalPrimary_denominator] lemma rational_symbol_mod (m n : ℕ) : symbol (m:ActualEisensteinCubic.O) (n:ActualEisensteinCubic.O)=symbol ((m%n:ℕ):ActualEisensteinCubic.O) (n:ActualEisensteinCubic.O) := by apply symbol_congr refine ⟨(m/n:ℕ),?_⟩ have he : m=m%n+n*(m/n) := (Nat.mod_add_div m n).symm have hh : (m:ActualEisensteinCubic.O)=(m%n:ℕ)+ (n:ActualEisensteinCubic.O)*(m/n:ℕ) := by exact_mod_cast he linear_combination hh theorem rational_symbol_eq_one (n : ℕ) (hn : ¬3∣n) (m : ℕ) (hmn : Nat.Coprime m n) : symbol (m:ActualEisensteinCubic.O) (n:ActualEisensteinCubic.O)=1 := by induction n using Nat.strong_induction_on generalizing m with | h n ih => by_cases hn1 : n=1 · subst n simpa only [Nat.cast_one] using symbol_one (m:ActualEisensteinCubic.O) have hn0 : 0 hn (by rw [h];exact dvd_zero 3)) have hsmall : ∀r : ℕ,r intro hrn hcop by_cases hr0 : r=0 · subst r have : n=1 := by simpa using hcop exact False.elim (hn1 this) by_cases hr3 : 3∣r · have hquot : r/3 (z:ActualEisensteinCubic.O)) hb have hL2 : lambda∣lambda^2 := dvd_pow_self _ (by decide : (2:ℕ)≠0) have hLa := (hL2.trans lambda_sq_dvd_three).trans hO have hLa1 := hL2.trans ha have h1 : lambda∣(1:ActualEisensteinCubic.O) := by convert dvd_sub hLa hLa1 using 1 ; ring exact PrimaryIdealUnitReindex.lambda_prime_actual.not_isUnit (isUnit_of_dvd_one h1) theorem integer_symbol_eq_one (c a : ℤ) (ha : lambda^2∣(a:ActualEisensteinCubic.O)-1) (hcop : Nat.Coprime c.natAbs a.natAbs) : symbol (c:ActualEisensteinCubic.O) (a:ActualEisensteinCubic.O)=1 := by have hnum : symbol (c:ActualEisensteinCubic.O) (a:ActualEisensteinCubic.O)=symbol (c.natAbs:ActualEisensteinCubic.O) (a:ActualEisensteinCubic.O) := by rcases Int.natAbs_eq c with h|h · have he : (c:ActualEisensteinCubic.O)=(c.natAbs:ActualEisensteinCubic.O) := by simpa only [Int.cast_natCast] using congrArg (fun z : ℤ => (z:ActualEisensteinCubic.O)) h exact congrArg (fun z : ActualEisensteinCubic.O => symbol z (a:ActualEisensteinCubic.O)) he · have he : (c:ActualEisensteinCubic.O)=-(c.natAbs:ActualEisensteinCubic.O) := by simpa only [Int.cast_neg,Int.cast_natCast] using congrArg (fun z : ℤ => (z:ActualEisensteinCubic.O)) h exact (congrArg (fun z : ActualEisensteinCubic.O => symbol z (a:ActualEisensteinCubic.O)) he).trans (symbol_neg_numerator _ _ ha) rw [hnum] have hden : symbol (c.natAbs:ActualEisensteinCubic.O) (a:ActualEisensteinCubic.O)=symbol (c.natAbs:ActualEisensteinCubic.O) (a.natAbs:ActualEisensteinCubic.O) := by rcases Int.natAbs_eq a with h|h · have he : (a:ActualEisensteinCubic.O)=(a.natAbs:ActualEisensteinCubic.O) := by simpa only [Int.cast_natCast] using congrArg (fun z : ℤ => (z:ActualEisensteinCubic.O)) h exact congrArg (symbol (c.natAbs:ActualEisensteinCubic.O)) he · have he : (a:ActualEisensteinCubic.O)=-(a.natAbs:ActualEisensteinCubic.O) := by simpa only [Int.cast_neg,Int.cast_natCast] using congrArg (fun z : ℤ => (z:ActualEisensteinCubic.O)) h rw [he] simp only [symbol,Ideal.span_singleton_neg] rw [hden] exact rational_symbol_eq_one a.natAbs (primary_int_natAbs_not_three a ha) c.natAbs hcop end CubicJacobiGlobal namespace CubicKubota section open ActualEisensteinCubic open CubicJacobiGlobal hiding O theorem value_rational_intersection (g : SL(2,ℤ)) (hg : rationalEmbedding g∈levelThree) : value ⟨rationalEmbedding g,hg⟩=1 := by have hdet : g 0 0*g 1 1-g 0 1*g 1 0=1 := by simpa only [Matrix.det_fin_two] using g.property have hcop : IsCoprime (g 1 0) (g 0 0) := by refine ⟨-(g 0 1),g 1 1,?_⟩ linear_combination hdet have hp := levelThree_primary ⟨rationalEmbedding g,hg⟩ change lambda^2∣((g 0 0:ℤ):ActualEisensteinCubic.O)-1 at hp change symbol ((g 1 0:ℤ):ActualEisensteinCubic.O) ((g 0 0:ℤ):ActualEisensteinCubic.O)=1 exact integer_symbol_eq_one (g 1 0) (g 0 0) hp (Int.isCoprime_iff_nat_coprime.mp hcop) theorem complexCharacter_rational_intersection (g : SL(2,ℤ)) (hg : rationalEmbedding g∈levelThree) : complexCharacter ⟨rationalEmbedding g,hg⟩=1 := by change ConcreteTraceCRT.eisEmbedding (value ⟨rationalEmbedding g,hg⟩)=1 rw [value_rational_intersection g hg,map_one] end open ActualEisensteinCubic def levelTwo : Subgroup (SL(2,ActualEisensteinCubic.O)) where carrier g := ∃n : levelThree,∃r : SL(2,ℤ),(n:SL(2,ActualEisensteinCubic.O))*rationalEmbedding r=g one_mem' := ⟨1,1,by simp⟩ mul_mem' := by rintro g h ⟨n,r,rfl⟩ ⟨m,s,rfl⟩ refine ⟨n*levelThreeConjugate (rationalEmbedding r) m,r*s,?_⟩ simp [levelThreeConjugate,map_mul,mul_assoc] inv_mem' := by rintro g ⟨n,r,rfl⟩ refine ⟨levelThreeConjugate (rationalEmbedding r⁻¹) n⁻¹,r⁻¹,?_⟩ simp [levelThreeConjugate,map_inv,mul_assoc] lemma levelThree_le_levelTwo : levelThree≤levelTwo := by intro g hg exact ⟨⟨g,hg⟩,1,by simp⟩ lemma rational_mem_levelTwo (r : SL(2,ℤ)) : rationalEmbedding r∈levelTwo := ⟨1,r,by simp⟩ lemma complexCharacter_product_well_defined (n m : levelThree) (r s : SL(2,ℤ)) (h : (n:SL(2,ActualEisensteinCubic.O))*rationalEmbedding r=(m:SL(2,ActualEisensteinCubic.O))*rationalEmbedding s) : complexCharacter n=complexCharacter m := by have he : ((m⁻¹*n:levelThree):SL(2,ActualEisensteinCubic.O))=rationalEmbedding (s*r⁻¹) := by have hh := congrArg (fun g : SL(2,ActualEisensteinCubic.O)=>(m:SL(2,ActualEisensteinCubic.O))⁻¹*g*(rationalEmbedding r)⁻¹) h simpa [map_mul,map_inv,mul_assoc] using hh have hm : rationalEmbedding (s*r⁻¹)∈levelThree := he ▸ (m⁻¹*n).property have hv : complexCharacter (m⁻¹*n)=1 := by have he' : (m⁻¹*n:levelThree)=⟨rationalEmbedding (s*r⁻¹),hm⟩ := Subtype.ext he rw [he'] exact complexCharacter_rational_intersection (s*r⁻¹) hm calc complexCharacter n=complexCharacter (m*(m⁻¹*n)) := by rw [mul_inv_cancel_left] _ = complexCharacter m*complexCharacter (m⁻¹*n) := map_mul _ _ _ _ = complexCharacter m := by rw [hv,mul_one] def levelTwoLeft (g : levelTwo) : levelThree := g.property.choose def levelTwoRight (g : levelTwo) : SL(2,ℤ) := g.property.choose_spec.choose lemma levelTwo_product (g : levelTwo) : (levelTwoLeft g:SL(2,ActualEisensteinCubic.O))*rationalEmbedding (levelTwoRight g)=(g:SL(2,ActualEisensteinCubic.O)) := g.property.choose_spec.choose_spec def levelTwoValue (g : levelTwo) : ℂ := complexCharacter (levelTwoLeft g) lemma levelTwoValue_of_product (g : levelTwo) (n : levelThree) (r : SL(2,ℤ)) (h : (n:SL(2,ActualEisensteinCubic.O))*rationalEmbedding r=(g:SL(2,ActualEisensteinCubic.O))) : levelTwoValue g=complexCharacter n := complexCharacter_product_well_defined (levelTwoLeft g) n (levelTwoRight g) r ((levelTwo_product g).trans h.symm) def levelTwoComplexCharacter : levelTwo→*ℂ where toFun := levelTwoValue map_one' := by rw [levelTwoValue_of_product 1 1 1 (by simp),map_one] map_mul' g h := by have hp : ((levelTwoLeft g*levelThreeConjugate (rationalEmbedding (levelTwoRight g)) (levelTwoLeft h):levelThree):SL(2,ActualEisensteinCubic.O))* rationalEmbedding (levelTwoRight g*levelTwoRight h)=((g*h:levelTwo):SL(2,ActualEisensteinCubic.O)) := by simp only [Subgroup.coe_mul,levelThreeConjugate,map_mul] simp only [mul_assoc,inv_mul_cancel_left] rw [←levelTwo_product g,←levelTwo_product h] group rw [levelTwoValue_of_product (g*h) _ _ hp,map_mul,complexCharacter_conjugate_rational] rfl lemma levelTwoComplexCharacter_restrict (n : levelThree) : levelTwoComplexCharacter ⟨(n:SL(2,ActualEisensteinCubic.O)),levelThree_le_levelTwo n.property⟩=complexCharacter n := by exact levelTwoValue_of_product _ n 1 (by simp) lemma levelTwoComplexCharacter_rational (r : SL(2,ℤ)) : levelTwoComplexCharacter ⟨rationalEmbedding r,rational_mem_levelTwo r⟩=1 := by exact (levelTwoValue_of_product _ 1 r (by simp)).trans (map_one _) lemma levelTwoComplexCharacter_cube (g : levelTwo) : levelTwoComplexCharacter g^3=1 := complexCharacter_cube (levelTwoLeft g) lemma norm_levelTwoComplexCharacter (g : levelTwo) : ‖levelTwoComplexCharacter g‖=1 := norm_complexCharacter (levelTwoLeft g) end CubicKubota end namespace CubicKubota open scoped Classical MatrixGroups open ActualEisensteinCubic open CubicEisenstein theorem globalKubotaKernel_conjugate (g : levelTwo) (k : SL(2,ActualEisensteinCubic.O)) (hk : k∈globalKubotaKernel) : (g:SL(2,ActualEisensteinCubic.O))*k*(g:SL(2,ActualEisensteinCubic.O))⁻¹∈globalKubotaKernel := by obtain ⟨hk3,hkv⟩ := (globalKubotaKernel_mem k).mp hk let n : levelThree := ⟨k,hk3⟩ let n2 : levelTwo := ⟨k,levelThree_le_levelTwo hk3⟩ let cn := levelThreeConjugate (g:SL(2,ActualEisensteinCubic.O)) n refine (globalKubotaKernel_mem _).mpr ⟨cn.property,?_⟩ change complexCharacter cn=1 rw [←levelTwoComplexCharacter_restrict cn] have he : (⟨(cn:SL(2,ActualEisensteinCubic.O)),levelThree_le_levelTwo cn.property⟩:levelTwo)=g*n2*g⁻¹ := Subtype.ext rfl rw [he,map_mul,map_mul] have hn : levelTwoComplexCharacter n2=1 := (levelTwoComplexCharacter_restrict n).trans hkv rw [hn,mul_one,←map_mul,mul_inv_cancel,map_one] end CubicKubota open Filter MeasureTheory open scoped BigOperators Classical Topology ENNReal open Finset AddChar MulChar EisensteinEmbedding namespace CubicEisenstein def cuspHeightCompact (a b : ℝ) : Set HyperbolicSpace := cuspCoordinateLift '' (Set.Icc a b ×ˢ Metric.closedBall (0:ℂ) (∑i,‖periodBasis i‖)) lemma cuspHeightCompact_isCompact (a b : ℝ) (ha : 0 F (integralOrbitProjection globalKubotaKernel w) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hfirst := dominatedComplexL2_ae (by simp : (1:ℝ≥0∞)≠⊤) (cuspStrip_restrict_le_compact a b ha) (kernelCompactPullbackCLM (cuspHeightCompact a b) (cuspHeightCompact_isCompact a b ha) F) have hsecond := (Measure.absolutelyContinuous_of_le_smul (cuspStrip_restrict_le_compact a b ha)).ae_eq (kernelCompactPullbackCLM_ae (cuspHeightCompact a b) (cuspHeightCompact_isCompact a b ha) F) exact hfirst.trans hsecond lemma kernelCuspHeight_quasiMeasurePreserving (a b : ℝ) (ha : 0 g (cuspCoordinateLift q)/(q.1:ℂ)^3) (Set.Icc a b ×ˢ periodDomain) volume), (∫w in cuspPeriodStrip a b,g w∂hyperbolicVolume)= ∫v in Set.Icc a b,(∫z in periodDomain,g (cuspCoordinateLift (v,z)))/(v:ℂ)^3 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hg : AEStronglyMeasurable g hyperbolicVolume) (hint : IntegrableOn (fun q : ℝ × ℂ => g (cuspCoordinateLift q)/(q.1:ℂ)^3) (Set.Icc a b ×ˢ periodDomain) volume) => by have hm := euclideanToHyperbolic_measurePreserving_on (positiveEuclideanStrip a b) (positiveEuclideanStrip_measurable a b) (positiveEuclideanStrip_positive a b ha) rw [positiveEuclideanStrip_preimage] at hm have hh := hg.mono_measure (Measure.restrict_le_self (s := cuspPeriodStrip a b)) have he : (∫w in cuspPeriodStrip a b,g w∂hyperbolicVolume)= ∫p in positiveEuclideanStrip a b,g (euclideanToHyperbolic p)∂hyperbolicEuclideanVolume := by rw [←hm.map_eq] at hh ⊢ exact integral_map hm.measurable.aemeasurable hh rw [he,hyperbolicEuclidean_setIntegral_complex (positiveEuclideanStrip a b) (positiveEuclideanStrip_measurable a b) (positiveEuclideanStrip_positive a b ha)] have hsplit := spatialComplexSplit.measurableEmbedding.setIntegral_map (fun q : ℝ × ℂ => g (cuspCoordinateLift q)/(q.1:ℂ)^3) (Set.Icc a b ×ˢ periodDomain) («μ» := (volume : Measure EuclideanSpatial)) rw [spatialComplexSplit_preserves_volume.map_eq] at hsplit have heq : (∫p in positiveEuclideanStrip a b,g (euclideanToHyperbolic p)/(p 2:ℂ)^3)= ∫q in Set.Icc a b ×ˢ periodDomain,g (cuspCoordinateLift q)/(q.1:ℂ)^3 := by rw [hsplit] simp only [positiveEuclideanStrip,cuspCoordinateLift,spatialComplexSplit.symm_apply_apply, spatialComplexSplit_fst] rw [heq] change (∫q in Set.Icc a b ×ˢ periodDomain, g (cuspCoordinateLift q)/(q.1:ℂ)^3 ∂((volume : Measure ℝ).prod volume))=_ rw [setIntegral_prod _ hint] congr 1 ext v exact integral_div ((v:ℂ)^3) (fun z => g (cuspCoordinateLift (v,z))) lemma cuspCoordinateLift_weighted_integrable_of_pos (a b : ℝ) (ha : 0 g (cuspCoordinateLift q)/(q.1:ℂ)^3) (Set.Icc a b ×ˢ periodDomain) volume := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hg : Continuous g) => by let radiusBound : ℝ := ∑i,‖periodBasis i‖ have hc : ContinuousOn (fun q : ℝ × ℂ => g (cuspCoordinateLift q)/(q.1:ℂ)^3) (Set.Icc a b ×ˢ Metric.closedBall (0:ℂ) radiusBound) := by intro q hq have hpos : 0 rw [hn'] rw [pow_add] norm_num omega theorem ramified_arithmetic_nine_sum (h k:ActualEisensteinCubic.O) (u:ActualEisensteinCubic.Oˣ) (n:ℕ) (hn:2≤n) (hk:3*h=(u.val*lambda^n)*k) : arithmeticResidueSum h (u.val*lambda^n)= ((3^(n-2):ℕ):ℂ)*ramifiedNineSum k u n := by let a:=u.val*lambda^n let f:=ramifiedReduction u n hn let F:ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)}→ℂ:=fun x=> eisEmbedding (symbol a (1+3*GaussianShiftedPartition.representative 3 x))* residueAdditive k 3 (1+3*GaussianShiftedPartition.representative 3 x) have hpoint (x:ActualEisensteinCubic.O⧸Ideal.span {a}): eisEmbedding (symbol a (1+3*GaussianShiftedPartition.representative a x))* residueAdditive h a (1+3*GaussianShiftedPartition.representative a x)=F (f x):=by let d:=1+3*GaussianShiftedPartition.representative a x let e:=1+3*GaussianShiftedPartition.representative 3 (f x) have hd:(3:ActualEisensteinCubic.O)∣d-1:=⟨_,by dsimp [d];ring⟩ have he:(3:ActualEisensteinCubic.O)∣e-1:=⟨_,by dsimp [e];ring⟩ have h9:(9:ActualEisensteinCubic.O)∣d-e:=by obtain ⟨w,hw⟩:=ramifiedReduction_rep u n hn x exact ⟨w,by dsimp [d,e,f,a] at *;linear_combination 3*hw⟩ change eisEmbedding (symbol a d)*residueAdditive h a d=F (f x) rw [ramified_symbol_congr_mod_nine u n d e hd he h9, residueAdditive_ramified_scale h k a d (ramifiedElement_ne_zero u n) hk, residueAdditive_congr k 3 d e (by norm_num) (by convert h9 using 1 ;norm_num)] let:Finite (ActualEisensteinCubic.O⧸Ideal.span {a}):=finite_quotient_span (ramifiedElement_ne_zero u n) let:Finite (ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)}):=finite_quotient_span (by norm_num) rw [ramified_arithmetic_affine h u n hn] calc _=∑'x:ActualEisensteinCubic.O⧸Ideal.span {a},F (f x):=tsum_congr hpoint _=(Nat.card f.toAddMonoidHom.ker:ℂ)*∑'x,F x:= finite_tsum_comp_addHom f.toAddMonoidHom (ramifiedReduction_surjective u n hn) F _=_:=by rw [ramifiedReduction_kernel_card u n hn];rfl end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss def ramifiedLinearChar (u:ActualEisensteinCubic.Oˣ) (n:ℕ):AddChar ActualEisensteinCubic.O ℂ where toFun x:=eisEmbedding (symbol (u.val*lambda^n) (1+3*x)) map_zero_eq_one':=by simp [symbol_one] map_add_eq_mul':=by intro x y have hp (z:ActualEisensteinCubic.O):(3:ActualEisensteinCubic.O)∣1+3*z-1:=⟨z,by ring⟩ have hprod:(3:ActualEisensteinCubic.O)∣(1+3*x)*(1+3*y)-1:=⟨x+y+3*x*y,by ring⟩ rw [ramified_symbol_congr_mod_nine u n (1+3*(x+y)) ((1+3*x)*(1+3*y)) (hp _) hprod ⟨-x*y,by ring⟩, symbol_mul_denominator,map_mul] lemma ramifiedLinearChar_period (u:ActualEisensteinCubic.Oˣ) (n:ℕ) (x:ActualEisensteinCubic.O) (hx:x∈Ideal.span {(3:ActualEisensteinCubic.O)}) : ramifiedLinearChar u n x=1 := by obtain ⟨w,rfl⟩:=Ideal.mem_span_singleton.mp hx change eisEmbedding (symbol (u.val*lambda^n) (1+3*(3*w)))=1 rw [ramified_symbol_congr_mod_nine u n _ 1 ⟨3*w,by ring⟩ (by simp) ⟨w,by ring⟩] simp [symbol_one] def ramifiedQuotientChar (u:ActualEisensteinCubic.Oˣ) (n:ℕ):AddChar (ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)}) ℂ:= IdealGaussCRT.quotientAddChar _ (ramifiedLinearChar u n) (ramifiedLinearChar_period u n) lemma ramifiedQuotientChar_rep (u:ActualEisensteinCubic.Oˣ) (n:ℕ) (x:ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)}) : ramifiedQuotientChar u n x= eisEmbedding (symbol (u.val*lambda^n) (1+3*GaussianShiftedPartition.representative 3 x)) := by conv_lhs => rw [←GaussianShiftedPartition.representative_spec 3 x] rfl def ramifiedFrequencyChar (k:ActualEisensteinCubic.O) (u:ActualEisensteinCubic.Oˣ) (n:ℕ): AddChar (ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)}) ℂ:= ramifiedQuotientChar u n * (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates 3 (by norm_num)).mulShift (Ideal.Quotient.mk _ k) lemma ramifiedFrequencyChar_rep (k:ActualEisensteinCubic.O) (u:ActualEisensteinCubic.Oˣ) (n:ℕ) (x:ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)}) : ramifiedFrequencyChar k u n x= eisEmbedding (symbol (u.val*lambda^n) (1+3*GaussianShiftedPartition.representative 3 x))* residueAdditive k 3 (3*GaussianShiftedPartition.representative 3 x) := by rw [ramifiedFrequencyChar,AddChar.mul_apply,ramifiedQuotientChar_rep] congr 1 conv_lhs => rw [←GaussianShiftedPartition.representative_spec 3 x] simp only [AddChar.mulShift_apply,←map_mul,eisTraceModChar,IdealGaussCRT.traceModChar_mk] unfold residueAdditive cuspFrequency simp only [map_mul,map_ofNat] congr 1 field_simp theorem ramifiedNineSum_eq_character_test (k:ActualEisensteinCubic.O) (u:ActualEisensteinCubic.Oˣ) (n:ℕ) : ramifiedNineSum k u n= if ramifiedFrequencyChar k u n=1 then 9*residueAdditive k 3 1 else 0 := by let:Finite (ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)}):=finite_quotient_span (by norm_num) let:Fintype (ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)}):=Fintype.ofFinite _ have hcard:(Fintype.card (ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)}):ℂ)=9:=by have hh:=three_absNorm change Nat.card (ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)})=9 at hh exact_mod_cast (show Fintype.card (ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)})=9 by simpa only [Nat.card_eq_fintype_card] using hh) have he:ramifiedNineSum k u n=residueAdditive k 3 1* ∑'x:ActualEisensteinCubic.O⧸Ideal.span {(3:ActualEisensteinCubic.O)},ramifiedFrequencyChar k u n x:=by rw [ramifiedNineSum,←tsum_mul_left] apply tsum_congr intro x rw [ramifiedFrequencyChar_rep,residueAdditive_add] ring rw [he,tsum_fintype] split_ifs with hchar · rw [AddChar.sum_eq_card_of_eq_one hchar,hcard] ring · rw [AddChar.sum_eq_zero_of_ne_one hchar,mul_zero] theorem ramified_arithmetic_character_test (h k:ActualEisensteinCubic.O) (u:ActualEisensteinCubic.Oˣ) (n:ℕ) (hn:2≤n) (hk:3*h=(u.val*lambda^n)*k) : arithmeticResidueSum h (u.val*lambda^n)= if ramifiedFrequencyChar k u n=1 then ((3^n:ℕ):ℂ)*residueAdditive k 3 1 else 0 := by rw [ramified_arithmetic_nine_sum h k u n hn hk,ramifiedNineSum_eq_character_test] have hp:(3:ℕ)^n=3^(n-2)*9:=by have hn':n=(n-2)+2:=by omega conv_lhs => rw [hn'] rw [pow_add] norm_num split_ifs · rw [hp,Nat.cast_mul] norm_num ring · ring end CubicEisenstein namespace CubicKubota open scoped Classical MatrixGroups section open ActualEisensteinCubic open CubicEisenstein def levelThreeInTwo : Subgroup levelTwo := levelThree.comap levelTwo.subtype abbrev levelThreeInTwo_normal : levelThreeInTwo.Normal := by constructor intro n hn g exact (levelThreeConjugate (g:SL(2,ActualEisensteinCubic.O)) ⟨(n:SL(2,ActualEisensteinCubic.O)),hn⟩).property abbrev levelThreeInTwo_finiteIndex : levelThreeInTwo.FiniteIndex := by let : levelThree.FiniteIndex := levelThree_finiteIndex change (levelThree.comap levelTwo.subtype).FiniteIndex exact Subgroup.instFiniteIndex_subgroupOf levelThree levelTwo def rationalLift : SL(2,ℤ)→*levelTwo where toFun r := ⟨rationalEmbedding r,rational_mem_levelTwo r⟩ map_one' := Subtype.ext (map_one _) map_mul' _ _ := Subtype.ext (map_mul _ _ _) def rationalQuotient : let : levelThreeInTwo.Normal := levelThreeInTwo_normal; SL(2,ℤ)→*(levelTwo ⧸ levelThreeInTwo) := let : levelThreeInTwo.Normal := levelThreeInTwo_normal; (QuotientGroup.mk' levelThreeInTwo).comp rationalLift theorem rationalQuotient_surjective : Function.Surjective rationalQuotient := let : levelThreeInTwo.Normal := levelThreeInTwo_normal; by intro q obtain ⟨g,rfl⟩ := QuotientGroup.mk'_surjective levelThreeInTwo q obtain ⟨n,r,hr⟩ := g.property refine ⟨r,?_⟩ let n2 : levelTwo := ⟨(n:SL(2,ActualEisensteinCubic.O)),levelThree_le_levelTwo n.property⟩ have he : g=n2*rationalLift r := Subtype.ext hr.symm have hn : QuotientGroup.mk' levelThreeInTwo n2=1 := (QuotientGroup.eq_one_iff n2).mpr n.property change QuotientGroup.mk' levelThreeInTwo (rationalLift r)=_ rw [he,map_mul,hn,one_mul] def rationalCongruenceThree : Subgroup (SL(2,ℤ)) := let : levelThreeInTwo.Normal := levelThreeInTwo_normal; rationalQuotient.ker theorem mem_rationalCongruenceThree (r : SL(2,ℤ)) : r∈rationalCongruenceThree ↔ rationalEmbedding r∈levelThree := let : levelThreeInTwo.Normal := levelThreeInTwo_normal; by change QuotientGroup.mk' levelThreeInTwo (rationalLift r)=1 ↔ _ exact QuotientGroup.eq_one_iff _ end open ActualEisensteinCubic lemma three_dvd_intCast_iff (a : ℤ) : (3:ActualEisensteinCubic.O)∣(a:ActualEisensteinCubic.O) ↔ (3:ℤ)∣a := by constructor · rintro ⟨x,hx⟩ obtain ⟨u,v,huv⟩ := ActualEisensteinCoordinates.exists_coordinates x have he : ActualEisensteinCoordinates.eval a 0= ActualEisensteinCoordinates.eval (3*u) (3*v) := by dsimp [ActualEisensteinCoordinates.eval] rw [hx,huv] push_cast ring exact ⟨u,(ActualEisensteinCoordinates.unique_coordinates he).1⟩ · rintro ⟨b,hb⟩ refine ⟨(b:ActualEisensteinCubic.O),?_⟩ simpa only [Int.cast_mul,Int.cast_ofNat] using congrArg (fun z : ℤ => (z:ActualEisensteinCubic.O)) hb lemma mem_levelThree_iff_entries (g : SL(2,ActualEisensteinCubic.O)) : g∈levelThree ↔ ∀i j,(3:ActualEisensteinCubic.O)∣g i j-(if i=j then 1 else 0) := by constructor · intro hg i j exact levelThree_entry ⟨g,hg⟩ i j · intro h change Matrix.SpecialLinearGroup.map (n:=Fin 2) (Ideal.Quotient.mk (Ideal.span {(3:ActualEisensteinCubic.O)})) g=1 apply Matrix.SpecialLinearGroup.ext intro i j change Ideal.Quotient.mk (Ideal.span {(3:ActualEisensteinCubic.O)}) (g i j)= (1:Matrix (Fin 2) (Fin 2) (ActualEisensteinCubic.O ⧸ Ideal.span {(3:ActualEisensteinCubic.O)})) i j rw [Matrix.one_apply] have he := (Ideal.Quotient.mk_eq_mk_iff_sub_mem (g i j) (if i=j then 1 else 0)).mpr (Ideal.mem_span_singleton.mpr (h i j)) simpa only [apply_ite,map_one,map_zero] using he def rationalReductionThree : SL(2,ℤ)→*SL(2,ZMod 3) := Matrix.SpecialLinearGroup.map (Int.castRingHom (ZMod 3)) lemma rationalReductionThree_eq_one_iff (g : SL(2,ℤ)) : rationalReductionThree g=1 ↔ g∈rationalCongruenceThree := by rw [mem_rationalCongruenceThree,mem_levelThree_iff_entries] constructor · intro hg i j have he := congrArg (fun h : SL(2,ZMod 3) => h i j) hg change (g i j:ZMod 3)=(1:Matrix (Fin 2) (Fin 2) (ZMod 3)) i j at he rw [Matrix.one_apply] at he have hd : (3:ℤ)∣g i j-(if i=j then 1 else 0) := by apply (ZMod.intCast_zmod_eq_zero_iff_dvd _ 3).mp simpa only [Int.cast_sub,Int.cast_ite,Int.cast_one,Int.cast_zero] using sub_eq_zero.mpr he have hO := (three_dvd_intCast_iff (g i j-(if i=j then 1 else 0))).mpr hd simpa only [rationalEmbedding,Matrix.SpecialLinearGroup.map_apply_coe, RingHom.mapMatrix_apply,Matrix.map_apply,Int.coe_castRingHom, Int.cast_sub,Int.cast_ite,Int.cast_one,Int.cast_zero] using hO · intro hg apply Matrix.SpecialLinearGroup.ext intro i j change (g i j:ZMod 3)=(1:Matrix (Fin 2) (Fin 2) (ZMod 3)) i j rw [Matrix.one_apply] apply sub_eq_zero.mp have hd : (3:ℤ)∣g i j-(if i=j then 1 else 0) := by apply (three_dvd_intCast_iff _).mp simpa only [rationalEmbedding,Matrix.SpecialLinearGroup.map_apply_coe, RingHom.mapMatrix_apply,Matrix.map_apply,Int.coe_castRingHom, Int.cast_sub,Int.cast_ite,Int.cast_one,Int.cast_zero] using hg i j have hz := (ZMod.intCast_zmod_eq_zero_iff_dvd _ 3).mpr hd simpa only [Int.cast_sub,Int.cast_ite,Int.cast_one,Int.cast_zero] using hz abbrev RationalBruhatIndex := Fin 2 × (Fin 3 ⊕ (Fin 3 × Fin 3)) def rationalBruhatRep (i : RationalBruhatIndex) : SL(2,ℤ) := ModularGroup.S^(2*i.1.val) * match i.2 with | Sum.inl a => ModularGroup.T^a.val | Sum.inr ab => ModularGroup.T^ab.1.val*ModularGroup.S*ModularGroup.T^ab.2.val lemma rationalBruhat_complete : ∀g : SL(2,ZMod 3), ∃i : RationalBruhatIndex,rationalReductionThree (rationalBruhatRep i)=g := by decide +kernel lemma rationalReductionThree_surjective : Function.Surjective rationalReductionThree := by intro g obtain ⟨i,hi⟩ := rationalBruhat_complete g exact ⟨rationalBruhatRep i,hi⟩ lemma rationalBruhat_injective : Function.Injective (fun i : RationalBruhatIndex => rationalReductionThree (rationalBruhatRep i)) := by decide +kernel end CubicKubota open scoped BigOperators Classical MatrixGroups namespace CubicKubota open ActualEisensteinCubic open CubicEisenstein lemma rationalQuotient_eq_iff_reduction (r s : SL(2,ℤ)) : rationalQuotient r=rationalQuotient s ↔ rationalReductionThree r=rationalReductionThree s := let : levelThreeInTwo.Normal := levelThreeInTwo_normal; by have hleft : rationalQuotient r=rationalQuotient s ↔ r*s⁻¹∈rationalCongruenceThree := by change _ ↔ rationalQuotient (r*s⁻¹)=1 rw [map_mul,map_inv,mul_inv_eq_one] rw [hleft,←rationalReductionThree_eq_one_iff,map_mul,map_inv,mul_inv_eq_one] lemma levelTwoComplexCharacter_rationalLift (r : SL(2,ℤ)) : levelTwoComplexCharacter (rationalLift r)=1 := levelTwoComplexCharacter_rational r def rationalCosetEquiv : RationalBruhatIndex ≃ (levelTwo ⧸ levelThreeInTwo) := Equiv.ofBijective (fun i => rationalQuotient (rationalBruhatRep i)) ⟨by intro i j h exact rationalBruhat_injective ((rationalQuotient_eq_iff_reduction _ _).mp h),by intro q obtain ⟨r,hr⟩ := rationalQuotient_surjective q obtain ⟨i,hi⟩ := rationalBruhat_complete (rationalReductionThree r) exact ⟨i,((rationalQuotient_eq_iff_reduction _ _).mpr hi).trans hr⟩⟩ abbrev sourceQuotientFintype : Fintype (levelTwo ⧸ levelThreeInTwo) := let : levelThreeInTwo.FiniteIndex := levelThreeInTwo_finiteIndex; Fintype.ofFinite _ def sourceRationalSection (q : levelTwo ⧸ levelThreeInTwo) : SL(2,ℤ) := rationalBruhatRep (rationalCosetEquiv.symm q) lemma sourceRationalSection_spec (q : levelTwo ⧸ levelThreeInTwo) : rationalQuotient (sourceRationalSection q)=q := rationalCosetEquiv.apply_symm_apply q def sourceProjection (f : HyperbolicSpace→ℂ) (w : HyperbolicSpace) : ℂ := let : Fintype (levelTwo ⧸ levelThreeInTwo) := sourceQuotientFintype; (24:ℂ)⁻¹ * ∑q : levelTwo ⧸ levelThreeInTwo, f (integralComplexMatrix (rationalEmbedding (sourceRationalSection q)) • w) lemma sourceProjection_eq_twentyFour (f : HyperbolicSpace→ℂ) (w : HyperbolicSpace) : sourceProjection f w=(24:ℂ)⁻¹ * ∑i : RationalBruhatIndex, f (integralComplexMatrix (rationalEmbedding (rationalBruhatRep i)) • w) := let : Fintype (levelTwo ⧸ levelThreeInTwo) := sourceQuotientFintype; by unfold sourceProjection dsimp only congr 1 rw [←rationalCosetEquiv.sum_comp] simp only [sourceRationalSection,Equiv.symm_apply_apply] lemma sourceSection_translate (f : HyperbolicSpace→ℂ) (hf : ∀n : levelThree,∀w,f (complexMatrix n • w)=complexCharacter n*f w) (q : levelTwo ⧸ levelThreeInTwo) (g : levelTwo) (w : HyperbolicSpace) : let : levelThreeInTwo.Normal := levelThreeInTwo_normal; f (integralComplexMatrix (rationalEmbedding (sourceRationalSection q)) • (integralComplexMatrix (g:SL(2,ActualEisensteinCubic.O)) • w)) = levelTwoComplexCharacter g * f (integralComplexMatrix (rationalEmbedding (sourceRationalSection (q*QuotientGroup.mk' levelThreeInTwo g))) • w) := let : levelThreeInTwo.Normal := levelThreeInTwo_normal; by let r := sourceRationalSection q let s := sourceRationalSection (q*QuotientGroup.mk' levelThreeInTwo g) let n2 : levelTwo := rationalLift r*g*(rationalLift s)⁻¹ have hn2 : n2∈levelThreeInTwo := by apply (QuotientGroup.eq_one_iff (N:=levelThreeInTwo) n2).mp change QuotientGroup.mk' levelThreeInTwo (rationalLift r*g*(rationalLift s)⁻¹)=1 rw [map_mul,map_mul,map_inv] change rationalQuotient r * QuotientGroup.mk' levelThreeInTwo g * (rationalQuotient s)⁻¹=1 rw [sourceRationalSection_spec,sourceRationalSection_spec,mul_inv_cancel] let n : levelThree := ⟨(n2:SL(2,ActualEisensteinCubic.O)),hn2⟩ have hc : complexCharacter n=levelTwoComplexCharacter g := by rw [←levelTwoComplexCharacter_restrict n] change levelTwoComplexCharacter (rationalLift r*g*(rationalLift s)⁻¹)=_ rw [map_mul,map_mul,←map_inv rationalLift] change levelTwoComplexCharacter (rationalLift r)*levelTwoComplexCharacter g* levelTwoComplexCharacter (rationalLift s⁻¹)=_ rw [levelTwoComplexCharacter_rationalLift,levelTwoComplexCharacter_rationalLift,one_mul,mul_one] have he : rationalEmbedding r*(g:SL(2,ActualEisensteinCubic.O))=(n:SL(2,ActualEisensteinCubic.O))*rationalEmbedding s := by change _=(rationalEmbedding r*(g:SL(2,ActualEisensteinCubic.O))*(rationalEmbedding s)⁻¹)*rationalEmbedding s group change f (integralComplexMatrix (rationalEmbedding r) • (integralComplexMatrix (g:SL(2,ActualEisensteinCubic.O)) • w))= levelTwoComplexCharacter g*f (integralComplexMatrix (rationalEmbedding s) • w) rw [←mul_smul,←map_mul,he,map_mul,integralComplexMatrix_levelThree,mul_smul,hf,hc] theorem sourceProjection_automorphy (f : HyperbolicSpace→ℂ) (hf : ∀n : levelThree,∀w,f (complexMatrix n • w)=complexCharacter n*f w) (g : levelTwo) (w : HyperbolicSpace) : sourceProjection f (integralComplexMatrix (g:SL(2,ActualEisensteinCubic.O)) • w)= levelTwoComplexCharacter g * sourceProjection f w := let : levelThreeInTwo.Normal := levelThreeInTwo_normal; let : Fintype (levelTwo ⧸ levelThreeInTwo) := sourceQuotientFintype; by unfold sourceProjection simp_rw [sourceSection_translate f hf] rw [←Finset.mul_sum] rw [Function.Bijective.sum_comp (Group.mulRight_bijective (QuotientGroup.mk' levelThreeInTwo g)) (fun q => f (integralComplexMatrix (rationalEmbedding (sourceRationalSection q)) • w))] ring def sourceEisenstein (s : ℂ) : HyperbolicSpace→ℂ := sourceProjection (hyperbolicEisenstein s) end CubicKubota end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ResidualFourierBounds /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace ComplexConjugate MatrixGroups ENNReal open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationResidualFourierBounds01 abbrev O := ActualEisensteinCubic.O end RootNotationResidualFourierBounds01 open RootNotationResidualFourierBounds01 (O) lemma cuspHeightFourierTest_memLp (a b : ℝ) (ha : 0 star (cuspWeightedFourierPhase ρ h w)) 2 (hyperbolicVolume.restrict (cuspPeriodStrip a b)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let := cuspPeriodStripFiniteVolume a b ha apply MemLp.of_bound (cuspWeightedFourierPhase_continuous ρ h).star.aestronglyMeasurable ‖ρ‖ exact Eventually.of_forall (fun w => by rw [norm_star]; exact cuspWeightedFourierPhase_bound ρ h w) def cuspHeightFourierTestL2 (a b : ℝ) (ha : 0 star (cuspWeightedFourierPhase ρ h w)) def kernelCuspHeightFourier (a b : ℝ) (ha : 0 z*cuspWeightedFourierPhase ρ h w) (hw.trans (Set.indicator_of_mem (cuspPeriodStrip_image_subset a b ha ⟨w,hwm,rfl⟩) _)) def kernelCuspHeightFourierFamily (a b : ℝ) (ha : 0 (s-4/3)*kernelCuspHeightFourierFamily a b ha ρ h s) (𝓝[≠] (4/3:ℂ)) (𝓝 (kernelCuspHeightFourier a b ha ρ h cubicEisensteinResidue)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let kernelCuspHeightFourier_restrict := fun F => OAI.CubicEisenstein.kernelCuspHeightFourier_restrict a b ha ρ h F have hh := (kernelCuspHeightFourier a b ha ρ h).continuous.continuousAt.tendsto.comp (cubicEisensteinResidue_local_limit (cuspHeightQuotientCompact a b) (cuspHeightQuotientCompact_isCompact a b ha)) simpa only [Function.comp_def,map_smul,smul_eq_mul,kernelCuspHeightFourier_restrict, kernelCuspHeightFourierFamily] using hh lemma kernelCuspHeightFourierFamily_initial (a b : ℝ) (ha : 0 hyperbolicEisenstein s w*cuspWeightedFourierPhase ρ h w have hg : Continuous g := (hyperbolicEisenstein_continuous s hs).mul (cuspWeightedFourierPhase_continuous ρ h) rw [cuspPeriodStrip_integral_coordinates_of_pos a b ha g hg.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable_of_pos a b ha g hg)] have hexp : ∀v∈Set.Icc a b, ((∫z in periodDomain,g (cuspCoordinateLift (v,z)))/(v:ℂ)^3)= (((9*Real.sqrt 3/2:ℝ):ℂ)*scatteringCoefficient s h)* (ρ v*((v:ℂ)^(-s-1)*sourceFourierKernel s (cuspFrequency h*v))) := by intro v hv have hpos : 0 by ring) rw [hrearr,eisensteinFourierCoefficient] congr 1 exact (div_mul_cancel₀ _ cusp_volume_ne_zero).symm rw [hinner,eisensteinFourierCoefficient_formula v hpos s hs h,if_neg hh,zero_add] have hv0 : (v:ℂ)≠0 := Complex.ofReal_ne_zero.mpr hpos.ne' have hp : (v:ℂ)^(-s-1)=(v:ℂ)^(2-s)/(v:ℂ)^3 := by rw [show -s-1=(2-s)-3 by ring,Complex.cpow_sub _ _ hv0] congr 1 exact Complex.cpow_natCast _ 3 rw [hp] ring calc _ = ∫v in Set.Icc a b,(((9*Real.sqrt 3/2:ℝ):ℂ)*scatteringCoefficient s h)* (ρ v*((v:ℂ)^(-s-1)*sourceFourierKernel s (cuspFrequency h*v))) := setIntegral_congr_fun measurableSet_Icc hexp _ = _ := integral_const_mul _ _ lemma kernelCuspHeightFourierFamily_initial_factor (a b : ℝ) (ha : 0 cuspIntervalWhittakerHeightFactor a b ρ w h) s := by apply Complex.analyticAt_iff_eventually_differentiableAt.mpr have hopen : IsOpen {w : ℂ | 1 cuspIntervalWhittakerHeightFactor a b ρ s h)= (fun s => ∫v in Set.Icc a b,ρ v*(v:ℂ)^(-s-1)*sourceFourierKernel s (cuspFrequency h*v)) := by funext s apply integral_congr_ae exact Eventually.of_forall (fun v => (mul_assoc _ _ _).symm) rw [heq] exact cuspWeightedWhittakerInterval_differentiableAt ρ a b ha (cuspFrequency h) w hw end section open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationResidualFourierBounds02 abbrev O := ActualEisensteinCubic.O end RootNotationResidualFourierBounds02 open RootNotationResidualFourierBounds02 (O) lemma kernelCuspHeightFourierFamily_cross_identity (a b : ℝ) (ha : 0 kernelCuspHeightFourierFamily a b ha ρ h s*cuspWhittakerHeightFactor s h) (fun s => kernelCuspFourierFamily h 2 3 (by norm_num) (by norm_num) s* cuspIntervalWhittakerHeightFactor a b ρ s h) {s : ℂ | 1 kernelCuspHeightFourierFamily a b ha ρ h s*cuspWhittakerHeightFactor s h) domain := by intro s hs exact (kernelCuspHeightFourierFamily_analyticAt_nonreal a b ha ρ h s hs.1.ne' hs.2.ne').mul (cuspWhittakerHeightFactor_analyticAt h s hs.1) have hright : AnalyticOnNhd ℂ (fun s => kernelCuspFourierFamily h 2 3 (by norm_num) (by norm_num) s* cuspIntervalWhittakerHeightFactor a b ρ s h) domain := by intro s hs exact (kernelCuspFourierFamily_analyticAt_nonreal h 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne').mul (cuspIntervalWhittakerHeightFactor_analyticAt a b ha ρ h s hs.1) have hstart : (5+Complex.I:ℂ)∈domain := by norm_num [domain] have hopen : IsOpen {s : ℂ | 4 kernelCuspHeightFourierFamily a b ha ρ h s*cuspWhittakerHeightFactor s h) =ᶠ[𝓝 (5+Complex.I:ℂ)] (fun s => kernelCuspFourierFamily h 2 3 (by norm_num) (by norm_num) s* cuspIntervalWhittakerHeightFactor a b ρ s h) := by filter_upwards [hopen.mem_nhds (by norm_num)] with s hs rw [kernelCuspHeightFourierFamily_initial_factor a b ha ρ h hh s hs.1 hs.2, kernelCuspFourierFamily_eq_upper h hh ⟨by linarith [hs.1],hs.2⟩] ring exact hleft.eqOn_of_preconnected_of_eventuallyEq hright hconvex.isPreconnected hstart hevent lemma kernelCuspHeightFourier_residue_factor (a b : ℝ) (ha : 0 cuspWhittakerHeightFactor s h) (𝓝[≠] (4/3:ℂ)) (𝓝 (cuspWhittakerHeightFactor (4/3:ℂ) h)) := (cuspWhittakerHeightFactor_analyticAt h (4/3) (by norm_num)).continuousAt.tendsto.mono_left nhdsWithin_le_nhds have hweight : Tendsto (fun s : ℂ => cuspIntervalWhittakerHeightFactor a b ρ s h) (𝓝[≠] (4/3:ℂ)) (𝓝 (cuspIntervalWhittakerHeightFactor a b ρ (4/3:ℂ) h)) := (cuspIntervalWhittakerHeightFactor_analyticAt a b ha ρ h (4/3) (by norm_num)).continuousAt.tendsto.mono_left nhdsWithin_le_nhds have hleft := ((kernelCuspHeightFourierFamily_residue_limit a b ha ρ h).mul hbase).comp upperVertical_tendsto_cubic_punctured have hright := ((kernelCuspFourierFamily_residue_limit h 2 3 (by norm_num) (by norm_num)).mul hweight).comp upperVertical_tendsto_cubic_punctured have hevent : (fun t : ℝ => (((4/3:ℂ)+(t:ℂ)*Complex.I-4/3)*kernelCuspHeightFourierFamily a b ha ρ h ((4/3:ℂ)+(t:ℂ)*Complex.I))* cuspWhittakerHeightFactor ((4/3:ℂ)+(t:ℂ)*Complex.I) h) =ᶠ[𝓝[>] (0:ℝ)] (fun t : ℝ => (((4/3:ℂ)+(t:ℂ)*Complex.I-4/3)*kernelCuspFourierFamily h 2 3 (by norm_num) (by norm_num) ((4/3:ℂ)+(t:ℂ)*Complex.I))*cuspIntervalWhittakerHeightFactor a b ρ ((4/3:ℂ)+(t:ℂ)*Complex.I) h) := by filter_upwards [self_mem_nhdsWithin] with t ht change 0 t^(-(2:ℝ)/3)*Real.exp (-t/2)) (Set.Ioi 0) := by have h := integrableOn_rpow_mul_exp_neg_mul_rpow (s := -(2:ℝ)/3) (p := (1:ℝ)) (b := (1/2:ℝ)) (by norm_num) (by norm_num) (by norm_num) simpa only [Real.rpow_one,show ∀t : ℝ,-(1/2)*t=-t/2 by intro t;ring] using h have hb := setIntegral_mono_on (cubicBesselDensity_integrable x) (hi.const_mul (Real.exp (-x/2))) measurableSet_Ioi (fun t ht => cubicBesselDensity_upper x t ht) rw [integral_const_mul] at hb have he : (∫t in Set.Ioi (0:ℝ),t^(-(2:ℝ)/3)*Real.exp (-t/2))= (2:ℝ)^(1/3:ℝ)*Real.Gamma (1/3) := by have hh := Real.integral_rpow_mul_exp_neg_mul_Ioi (a := (1/3:ℝ)) (r := (1/2:ℝ)) (by norm_num) (by norm_num) convert hh using 1 <;> norm_num ; congr 2 ; funext t ; ring_nf rw [he] at hb exact hb lemma cubicBesselDensity_lower (x t : ℝ) (hx : 0 hx.trans_le ht.1 have hi := cubicBesselDensity_integrable x have hr := hi.mono_set hsub have hconstant : IntegrableOn (fun _ : ℝ => (2*x)^(-(2:ℝ)/3)*Real.exp (-9*x/4)) (Set.Icc x (2*x)) := integrableOn_const (hs := isCompact_Icc.measure_ne_top) have hmono := setIntegral_mono_on hconstant hr measurableSet_Icc (fun t ht => cubicBesselDensity_lower x t hx ht) have hextend : (∫t in Set.Icc x (2*x),cubicBesselDensity x t)≤ ∫t in Set.Ioi (0:ℝ),cubicBesselDensity x t := by apply setIntegral_mono_set hi · filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht exact cubicBesselDensity_nonneg x t ht.le · exact Eventually.of_forall hsub rw [setIntegral_const,Real.volume_real_Icc_of_le (by linarith),smul_eq_mul, show 2*x-x=x by ring] at hmono exact hmono.trans hextend def cubicBesselLowerConstant : ℝ := (1/2:ℝ)*(1/2:ℝ)^(-(1:ℝ)/3)*(2:ℝ)^(-(2:ℝ)/3) lemma cubicBesselLowerConstant_pos : 0 Real.exp (-ε*‖ConcreteTraceCRT.eisEmbedding h‖)) := by have hs := (summable_embedding_rpow (-3) (by norm_num)).mul_left (6/ε^3) have hz : Summable (fun h : ActualEisensteinCubic.O => if h=0 then (1:ℝ) else 0) := (hasSum_ite_eq 0 (1:ℝ)).summable apply Summable.of_nonneg_of_le (fun h => (Real.exp_pos _).le) _ (hz.add hs) intro h by_cases hh : h=0 · subst h norm_num [Pi.add_apply] · have hp : 0<‖ConcreteTraceCRT.eisEmbedding h‖ := norm_pos_iff.mpr (ConcreteTraceCRT.eisEmbedding_ne_zero hh) simpa only [Pi.add_apply,if_neg hh,zero_add] using exp_neg_mul_le_inverse_cube ε _ hε hp lemma summable_exp_neg_cuspFrequency_norm (ε : ℝ) (hε : 0<ε) : Summable (fun h : ActualEisensteinCubic.O => Real.exp (-ε*‖cuspFrequency h‖)) := by have hd : 0<‖(3:ℂ)*ConcreteTraceCRT.eisLam‖ := by apply norm_pos_iff.mpr exact mul_ne_zero (by norm_num) ConcreteTraceCRT.eisLam_ne_zero have hs := summable_exp_neg_embedding_norm (ε/‖(3:ℂ)*ConcreteTraceCRT.eisLam‖) (div_pos hε hd) apply hs.congr intro h congr 1 rw [cuspFrequency,norm_div] ring end open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationResidualFourierBounds05 abbrev O := ActualEisensteinCubic.O end RootNotationResidualFourierBounds05 open RootNotationResidualFourierBounds05 (O) lemma cubicBesselNormalizer_ne_zero (h : ActualEisensteinCubic.O) (hh : h≠0) : cubicBesselNormalizer h≠0 := by unfold cubicBesselNormalizer apply mul_ne_zero · exact div_ne_zero (mul_ne_zero (by norm_num) (Complex.ofReal_ne_zero.mpr Real.pi_ne_zero)) (Complex.Gamma_ne_zero_of_re_pos (by norm_num)) · apply Complex.cpow_ne_zero_iff.mpr left exact mul_ne_zero (mul_ne_zero (by norm_num) (Complex.ofReal_ne_zero.mpr Real.pi_ne_zero)) (Complex.ofReal_ne_zero.mpr (norm_ne_zero_iff.mpr (cuspFrequency_ne_zero h hh))) lemma cubicBesselHeight_integrable (a b : ℝ) (ha : 0 schlafliBesselK (1/3) (4*Real.pi*‖cuspFrequency h‖*v)/(v:ℂ)^2) (Set.Icc a b) volume := by have hsource : IntegrableOn (fun v : ℝ => (v:ℂ)^(-(4/3:ℂ)-1)* sourceFourierKernel (4/3) (cuspFrequency h*v)) (Set.Icc a b) volume := by apply ContinuousOn.integrableOn_Icc intro v hv have hpos := ha.trans_le hv.1 exact ((Complex.continuousAt_ofReal_cpow_const v (-(4/3:ℂ)-1) (Or.inr hpos.ne')).mul ((sourceFourierKernel_continuous_freq (4/3) (by norm_num)).continuousAt.comp ((Complex.continuous_ofReal.const_mul (cuspFrequency h)).continuousAt))).continuousWithinAt apply (hsource.div_const (cubicBesselNormalizer h)).congr filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv apply (div_eq_iff (cubicBesselNormalizer_ne_zero h hh)).mpr simpa only [mul_comm] using sourceFourierKernel_cubic_height h hh v (ha.trans_le hv.1) lemma cubicBesselHeight_average_lower (a b : ℝ) (ha : 0.mpr hv.2 change lower≤Complex.re (_/(v:ℂ)^2) rw [←Complex.ofReal_pow,Complex.div_ofReal_re] calc lower = (cubicBesselLowerConstant*Real.exp (-9*Real.pi*b*‖cuspFrequency h‖))/b^2 := by dsimp [lower]; ring _ ≤ (cubicBesselLowerConstant*Real.exp (-9*Real.pi*b*‖cuspFrequency h‖))/v^2 := div_le_div_of_nonneg_left (mul_nonneg cubicBesselLowerConstant_pos.le (Real.exp_pos _).le) (sq_pos_of_pos hvp) hden _ ≤ _ := div_le_div_of_nonneg_right hnum (sq_nonneg v) have hmono : (∫ v in Set.Icc a b, lower) ≤ ∫ v in Set.Icc a b, RCLike.re (schlafliBesselK (1/3) (4*Real.pi*‖cuspFrequency h‖*v)/(v:ℂ)^2) := by apply integral_mono_ae (integrableOn_const (C := lower) (s := Set.Icc a b) («μ» := volume) (hs := isCompact_Icc.measure_ne_top)) hi.re filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv exact hpoint v hv rw [setIntegral_const,Real.volume_real_Icc_of_le hab.le,smul_eq_mul] at hmono have hreal : (∫v in Set.Icc a b,RCLike.re (schlafliBesselK (1/3) (4*Real.pi*‖cuspFrequency h‖*v)/(v:ℂ)^2))= Complex.re (∫v in Set.Icc a b,schlafliBesselK (1/3) (4*Real.pi*‖cuspFrequency h‖*v)/(v:ℂ)^2) := integral_re hi rw [hreal] at hmono have hfinal := hmono.trans (Complex.re_le_norm _) convert hfinal using 1 <;> first | rfl | ((try dsimp [lower]); ring) lemma cubicResidualFourierCoefficient_subexponential (ε : ℝ) (hε : 0<ε) : ∃C : ℝ,0≤C ∧ ∀h : ActualEisensteinCubic.O,h≠0 → ‖cubicResidualFourierCoefficient h‖≤C*Real.exp (ε*‖cuspFrequency h‖) := by let b : ℝ := ε/(9*Real.pi) let a : ℝ := b/2 have hb : 0 (q.1:ℂ)^(2/3:ℂ)) p := (Complex.continuousAt_ofReal_cpow_const p.1 (2/3:ℂ) (Or.inr hp.ne')).comp continuousAt_fst have hsource : ContinuousAt (fun q : ℝ × ℂ => sourceFourierKernel (4/3) (cuspFrequency h*q.1)) p := (sourceFourierKernel_continuous_freq (4/3) (by norm_num)).continuousAt.comp (by fun_prop) have hphase : Continuous (fun q : ℝ × ℂ => ShortDraftTrace.breveE (cuspFrequency h*q.2)) := by change Continuous (fun q : ℝ × ℂ => Complex.exp (2*Real.pi*Complex.I* ((cuspFrequency h*q.2)+starRingEnd ℂ (cuspFrequency h*q.2)))) fun_prop exact (((continuousAt_const.mul hpow).mul hsource).mul hphase.continuousAt).continuousWithinAt lemma cubicResidualNonzeroTerm_slab_bound (a b : ℝ) (ha : 0 C*Real.exp (-(Real.pi*a)*‖cuspFrequency h‖)) · intro h exact (cubicResidualNonzeroTerm_continuousOn h).mono (fun p hp => ha.trans_le hp.1) · exact (summable_exp_neg_cuspFrequency_norm (Real.pi*a) (mul_pos Real.pi_pos ha)).mul_left C · exact hbound lemma cubicResidualNonzeroSeries_continuousOn : ContinuousOn cubicResidualNonzeroSeries {p : ℝ × ℂ | 0 (hyperbolicHeight u,hyperbolicHorizontal u)) (hyperbolicHeight_continuous.prodMk hyperbolicHorizontal_continuous).continuousAt lemma cubicResidualNonzeroSeries_period (v : ℝ) (z : ℂ) (n : ActualEisensteinCubic.O) : cubicResidualNonzeroSeries (v,z+3*ConcreteTraceCRT.eisEmbedding n)=cubicResidualNonzeroSeries (v,z) := by apply tsum_congr intro h by_cases hh : h=0 · simp only [cubicResidualNonzeroTerm,if_pos hh] simp only [cubicResidualNonzeroTerm,if_neg hh] rw [mul_add,AddChar.map_add_eq_mul,cuspFrequency_period,mul_one] end section open Filter MeasureTheory open scoped BigOperators Classical Topology ENNReal open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationResidualFourierSeries02 abbrev O := ActualEisensteinCubic.O end RootNotationResidualFourierSeries02 open RootNotationResidualFourierSeries02 (O) def cubicResidualModeAmplitude (v : ℝ) (h : ActualEisensteinCubic.O) : ℂ := if h=0 then 0 else cubicResidualFourierCoefficient h*(v:ℂ)* schlafliBesselK (1/3) (4*Real.pi*‖cuspFrequency h‖*v) lemma cubicResidualNonzeroTerm_eq_amplitude (v : ℝ) (hv : 0 cubicResidualModeAmplitude v h*ShortDraftTrace.breveE (cuspFrequency h*z)* ShortDraftTrace.breveE (-cuspFrequency k*z) have hc (h : ActualEisensteinCubic.O) : Continuous (f h) := by change Continuous (fun z : ℂ => cubicResidualModeAmplitude v h* Complex.exp (2*Real.pi*Complex.I*((cuspFrequency h*z)+starRingEnd ℂ (cuspFrequency h*z)))* Complex.exp (2*Real.pi*Complex.I*((-cuspFrequency k*z)+starRingEnd ℂ (-cuspFrequency k*z)))) fun_prop obtain ⟨C,hC,hbound⟩ := cubicResidualNonzeroTerm_slab_bound v v hv le_rfl have hfbound (h : ActualEisensteinCubic.O) (z : ℂ) : ‖f h z‖≤C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖) := by change ‖(cubicResidualModeAmplitude v h*ShortDraftTrace.breveE (cuspFrequency h*z))* ShortDraftTrace.breveE (-cuspFrequency k*z)‖≤_ rw [←cubicResidualNonzeroTerm_eq_amplitude v hv h z,norm_mul,breveE_norm,mul_one] exact hbound h (v,z) ⟨le_rfl,le_rfl⟩ have hi (h : ActualEisensteinCubic.O) : IntegrableOn (f h) periodDomain volume := (integrable_const (C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖))).mono' (hc h).aestronglyMeasurable (Eventually.of_forall (hfbound h)) have hnorm (h : ActualEisensteinCubic.O) : (∫z in periodDomain,‖f h z‖)≤ volume.real periodDomain*(C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖)) := by have hh := integral_mono_ae (hi h).norm (integrable_const (C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖))) (Eventually.of_forall (hfbound h)) simpa only [setIntegral_const,smul_eq_mul] using hh have hs : Summable (fun h : ActualEisensteinCubic.O => ∫z in periodDomain,‖f h z‖) := by apply Summable.of_nonneg_of_le (fun h => integral_nonneg (fun z => norm_nonneg _)) hnorm exact ((summable_exp_neg_cuspFrequency_norm (Real.pi*v) (mul_pos Real.pi_pos hv)).mul_left C).mul_left (volume.real periodDomain) have hterm (h : ActualEisensteinCubic.O) : (∫z in periodDomain,f h z)= if h=k then ((9*Real.sqrt 3/2:ℝ):ℂ)*cubicResidualModeAmplitude v h else 0 := by change (∫z in periodDomain,cubicResidualModeAmplitude v h*ShortDraftTrace.breveE (cuspFrequency h*z)* ShortDraftTrace.breveE (-cuspFrequency k*z))=_ simp_rw [mul_assoc] rw [integral_const_mul,integral_cusp_character_product] split_ifs <;> ring calc _ = ∫z in periodDomain,∑'h : ActualEisensteinCubic.O,f h z := by apply integral_congr_ae exact Eventually.of_forall (fun z => by change (∑'h : ActualEisensteinCubic.O,cubicResidualNonzeroTerm h (v,z))*ShortDraftTrace.breveE (-cuspFrequency k*z)=_ rw [←tsum_mul_right] apply tsum_congr intro h rw [cubicResidualNonzeroTerm_eq_amplitude v hv h z]) _ = ∑'h : ActualEisensteinCubic.O,∫z in periodDomain,f h z := (integral_tsum_of_summable_integral_norm hi hs).symm _ = ∑'h : ActualEisensteinCubic.O,if h=k then ((9*Real.sqrt 3/2:ℝ):ℂ)*cubicResidualModeAmplitude v h else 0 := tsum_congr hterm _ = _ := by simp end section open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationResidualFourierSeries03 abbrev O := ActualEisensteinCubic.O end RootNotationResidualFourierSeries03 open RootNotationResidualFourierSeries03 (O) end section open Filter MeasureTheory open scoped Classical Topology lemma ae_eq_of_boundedContinuous_height_tests («μ» : Measure ℝ) (f g : ℝ→ℂ) (hf : Integrable f «μ») (hg : Integrable g «μ») (heq : ∀ρ : BoundedContinuousFunction ℝ ℂ, (∫x,ρ x*f x∂«μ»)=(∫x,ρ x*g x∂«μ»)) : f=ᵐ[«μ»]g := by apply ae_eq_of_integral_contDiff_smul_eq hf.locallyIntegrable hg.locallyIntegrable intro test htest hsupp obtain ⟨C,hC⟩ := hsupp.exists_bound_of_continuous htest.continuous let ρ : BoundedContinuousFunction ℝ ℂ := BoundedContinuousFunction.ofNormedAddCommGroup (fun x => (test x:ℂ)) (Complex.continuous_ofReal.comp htest.continuous) C (fun x => by simpa only [Complex.norm_real,Real.norm_eq_abs] using hC x) have hh := heq ρ change (∫x,(test x:ℂ)*f x∂«μ»)=(∫x,(test x:ℂ)*g x∂«μ») at hh simpa only [Complex.real_smul] using hh lemma interval_ae_eq_of_boundedContinuous_height_tests (a b : ℝ) (f g : ℝ→ℂ) (hf : IntegrableOn f (Set.Icc a b)) (hg : IntegrableOn g (Set.Icc a b)) (heq : ∀ρ : BoundedContinuousFunction ℝ ℂ, (∫x in Set.Icc a b,ρ x*f x)=(∫x in Set.Icc a b,ρ x*g x)) : f=ᵐ[volume.restrict (Set.Icc a b)]g := ae_eq_of_boundedContinuous_height_tests (volume.restrict (Set.Icc a b)) f g hf hg heq end open Filter MeasureTheory open scoped BigOperators Classical Topology def compactHeightMellin (a b : ℝ) (ρ : BoundedContinuousFunction ℝ ℂ) (s : ℂ) : ℂ := ∫v in Set.Icc a b,ρ v*(v:ℂ)^s lemma compactHeightMellin_integrable (a b : ℝ) (ha : 0 ρ v*(v:ℂ)^s) (Set.Icc a b) := by apply ContinuousOn.integrableOn_Icc apply ρ.continuous.continuousOn.mul intro v hv exact (Complex.continuousAt_ofReal_cpow_const v s (Or.inr (ha.trans_le hv.1).ne')).continuousWithinAt theorem compactHeightMellin_differentiable (a b : ℝ) (ha : 0 (Real.log (max a v):ℂ) have hl : Continuous heightLog := Complex.continuous_ofReal.comp ((continuous_const.max continuous_id).log (fun v => (ha.trans_le (le_max_left a v)).ne')) let F : ℂ→ℝ→ℂ := fun s v => ρ v*Complex.exp (heightLog v*s) let F' : ℂ→ℝ→ℂ := fun s v => ρ v*(Complex.exp (heightLog v*s)*heightLog v) have hF : ∀s,Continuous (F s) := fun s => ρ.continuous.mul ((hl.mul_const s).cexp) have hF' : Continuous (fun p : ℂ×ℝ => F' p.1 p.2) := by exact (ρ.continuous.comp continuous_snd).mul ((((hl.comp continuous_snd).mul continuous_fst).cexp).mul (hl.comp continuous_snd)) have hder : ∀s v,HasDerivAt (fun w => F w v) (F' s v) s := by intro s v simpa only [F,F',id_eq,mul_one] using (((hasDerivAt_id s).const_mul (heightLog v)).cexp).const_mul (ρ v) have heq : compactHeightMellin a b ρ=(fun s => ∫v in Set.Icc a b,F s v) := by funext s apply setIntegral_congr_fun measurableSet_Icc intro v hv dsimp only [compactHeightMellin,F,heightLog] rw [max_eq_right hv.1,Complex.ofReal_log (ha.trans_le hv.1).le, Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr (ha.trans_le hv.1).ne')] rw [heq] intro s obtain ⟨C,hC⟩ := ((isCompact_closedBall s (1:ℝ)).prod (isCompact_Icc : IsCompact (Set.Icc a b))).exists_bound_of_continuousOn hF'.continuousOn have hd := hasDerivAt_integral_of_dominated_loc_of_deriv_le («μ»:=volume.restrict (Set.Icc a b)) (F:=F) (F':=F') (bound:=fun _ => C) (Metric.ball_mem_nhds s (by norm_num : (0:ℝ)<1)) (Eventually.of_forall (fun w => (hF w).aestronglyMeasurable)) ((hF s).continuousOn.integrableOn_Icc) ((hF'.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable) (by filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv w hw exact hC (w,v) ⟨Metric.ball_subset_closedBall hw,hv⟩) (integrable_const C) (Eventually.of_forall (fun v w _ => hder w v)) exact hd.2.differentiableAt lemma compactHeightMellin_analyticAt (a b : ℝ) (ha : 0 hyperbolicEisenstein s w*cuspWeightedFourierPhase ρ 0 w have hg : Continuous g := (hyperbolicEisenstein_continuous s hs).mul (cuspWeightedFourierPhase_continuous ρ 0) rw [cuspPeriodStrip_integral_coordinates_of_pos a b ha g hg.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable_of_pos a b ha g hg)] have hexp : ∀v∈Set.Icc a b, ((∫z in periodDomain,g (cuspCoordinateLift (v,z)))/(v:ℂ)^3)= ((9*Real.sqrt 3/2:ℝ):ℂ)* (ρ v*(v:ℂ)^(s-3)+(((Real.pi:ℂ)/(s-1))*scatteringCoefficient s 0)* (ρ v*(v:ℂ)^(-s-1))) := by intro v hv have hpos : 0 by ring) rw [hrearr,eisensteinFourierCoefficient] congr 1 exact (div_mul_cancel₀ _ cusp_volume_ne_zero).symm rw [hinner,eisensteinConstantCoefficient_formula v hpos s hs] have hv0 : (v:ℂ)≠0 := Complex.ofReal_ne_zero.mpr hpos.ne' have hp : (v:ℂ)^(-s-1)=(v:ℂ)^(2-s)/(v:ℂ)^3 := by rw [show -s-1=(2-s)-3 by ring,Complex.cpow_sub _ _ hv0] congr 1 exact Complex.cpow_natCast _ 3 have hm : (v:ℂ)^(s-3)=(v:ℂ)^s/(v:ℂ)^3 := by rw [Complex.cpow_sub _ _ hv0] congr 1 exact Complex.cpow_natCast _ 3 rw [hp,hm] ring rw [setIntegral_congr_fun measurableSet_Icc hexp,integral_const_mul, integral_add (compactHeightMellin_integrable a b ha ρ _) ((compactHeightMellin_integrable a b ha ρ _).const_mul _),integral_const_mul] rfl lemma kernelCuspHeightFourierFamily_zero_initial (a b : ℝ) (ha : 0 weightedOutgoingConstant a b ha ρ s*cuspScatterHeightFactor s) (fun s => baseOutgoingConstant s*compactHeightMellin a b ρ (-s-1)) {s : ℂ | 1 weightedOutgoingConstant a b ha ρ s*cuspScatterHeightFactor s) domain := by intro s hs exact (weightedOutgoingConstant_analyticAt a b ha ρ s hs.1 hs.2).mul (cuspScatterHeightFactor_analyticAt s hs.1) have hright : AnalyticOnNhd ℂ (fun s => baseOutgoingConstant s*compactHeightMellin a b ρ (-s-1)) domain := by intro s hs exact (baseOutgoingConstant_analyticAt s hs.1 hs.2).mul ((compactHeightMellin_analyticAt a b ha ρ _).comp_of_eq (analyticAt_id.neg.sub analyticAt_const) rfl) have hstart : (5+Complex.I:ℂ)∈domain := by norm_num [domain] have hopen : IsOpen {s : ℂ | 4 weightedOutgoingConstant a b ha ρ s*cuspScatterHeightFactor s) =ᶠ[𝓝 (5+Complex.I:ℂ)] (fun s => baseOutgoingConstant s*compactHeightMellin a b ρ (-s-1)) := by filter_upwards [hopen.mem_nhds (by norm_num)] with s hs have hb : kernelCuspAverageFamily 2 3 (by norm_num) (by norm_num) s=cuspConstantAverage s := by apply (kernelCuspAverageFamily_eq_of_initial_overlap 2 3 (by norm_num) (by norm_num) s (by linarith [hs.1]) (kernelEisensteinL2Correction_initial_overlap 2 3 (by norm_num) (by norm_num) s hs.1 hs.2)).trans exact hyperbolicEisenstein_cusp_average_eq s (by linarith [hs.1]) rw [weightedOutgoingConstant,baseOutgoingConstant, kernelCuspHeightFourierFamily_zero_initial a b ha ρ s hs.1 hs.2,hb, cuspHeightConstantAverage,cuspConstantAverage] ring exact hleft.eqOn_of_preconnected_of_eventuallyEq hright hconvex.isPreconnected hstart hevent end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ScatteringResidues /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology section lemma scalar_residue_sub_continuous (f g : ℂ→ℂ) (z r : ℂ) (hf : Tendsto (fun s => (s-z)*f s) (𝓝[≠] z) (𝓝 r)) (hg : ContinuousAt g z) : Tendsto (fun s => (s-z)*(f s-g s)) (𝓝[≠] z) (𝓝 r) := by have hlin : Tendsto (fun s : ℂ => s-z) (𝓝[≠] z) (𝓝 (0:ℂ)) := by simpa only [id_eq,sub_self] using (tendsto_id.sub_const z).mono_left (show 𝓝[≠] z≤𝓝 z from nhdsWithin_le_nhds) have hz : Tendsto (fun s => (s-z)*g s) (𝓝[≠] z) (𝓝 (0:ℂ)) := by simpa only [zero_mul] using hlin.mul (hg.tendsto.mono_left nhdsWithin_le_nhds) simpa only [mul_sub,sub_zero] using hf.sub hz lemma weightedOutgoingConstant_residue_limit (a b : ℝ) (ha : 0 (s-4/3)*weightedOutgoingConstant a b ha ρ s) (𝓝[≠] (4/3:ℂ)) (𝓝 (kernelCuspHeightFourier a b ha ρ 0 cubicEisensteinResidue)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply scalar_residue_sub_continuous _ _ _ _ (kernelCuspHeightFourierFamily_residue_limit a b ha ρ 0) exact continuousAt_const.mul ((compactHeightMellin_differentiable a b ha ρ).continuous.continuousAt.comp (continuousAt_id.sub_const 3)) lemma baseOutgoingConstant_residue_limit : Tendsto (fun s : ℂ => (s-4/3)*baseOutgoingConstant s) (𝓝[≠] (4/3:ℂ)) (𝓝 cuspConstantAverageResidue) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hf := kernelCuspAverageFamily_residue_limit 2 3 (by norm_num) (by norm_num) change Tendsto _ _ (𝓝 (kernelCuspStripAverage cubicEisensteinResidue)) at hf rw [cubicEisensteinResidue_cusp_average] at hf apply scalar_residue_sub_continuous _ _ _ _ hf exact continuousAt_const.mul (cuspMainHeightFactor_differentiableAt (4/3:ℂ) (by norm_num)).continuousAt theorem kernelCuspHeightFourier_zero_residue (a b : ℝ) (ha : 0 compactHeightMellin a b ρ (-s-1)) (𝓝[≠] (4/3:ℂ)) (𝓝 (compactHeightMellin a b ρ (-(4/3:ℂ)-1))) := ((compactHeightMellin_differentiable a b ha ρ).continuous.continuousAt.comp (continuousAt_id.neg.sub_const 1)).tendsto.mono_left nhdsWithin_le_nhds have hleft := ((weightedOutgoingConstant_residue_limit a b ha ρ).mul hbase).comp upperVertical_tendsto_cubic_punctured have hright := (baseOutgoingConstant_residue_limit.mul hweight).comp upperVertical_tendsto_cubic_punctured have hevent : (fun t : ℝ => (((4/3:ℂ)+(t:ℂ)*Complex.I-4/3)*weightedOutgoingConstant a b ha ρ ((4/3:ℂ)+(t:ℂ)*Complex.I))* cuspScatterHeightFactor ((4/3:ℂ)+(t:ℂ)*Complex.I)) =ᶠ[𝓝[>] (0:ℝ)] (fun t : ℝ => (((4/3:ℂ)+(t:ℂ)*Complex.I-4/3)*baseOutgoingConstant ((4/3:ℂ)+(t:ℂ)*Complex.I))* compactHeightMellin a b ρ (-((4/3:ℂ)+(t:ℂ)*Complex.I)-1)) := by filter_upwards [self_mem_nhdsWithin] with t ht change 0 (hyperbolicHeight w:ℂ)^(2/3:ℂ)) := by apply continuous_iff_continuousAt.mpr intro w exact (Complex.continuousAt_ofReal_cpow_const (hyperbolicHeight w) (2/3:ℂ) (Or.inr (hyperbolicHeight_pos w).ne')).comp (f := hyperbolicHeight) hyperbolicHeight_continuous.continuousAt exact (continuous_const.mul hp).add cubicResidualNonzeroFunction_continuous lemma cubicResidualNonzeroSeries_height_continuous (v : ℝ) (hv : 0 cubicResidualNonzeroSeries (v,z)) := by apply continuous_iff_continuousAt.mpr intro z have hopen : IsOpen {p : ℝ × ℂ | 0 (v,z)) (by fun_prop) lemma periodDomain_integrable_of_continuous (f : ℂ→ℂ) (hf : Continuous f) : IntegrableOn f periodDomain volume := by apply (hf.continuousOn.integrableOn_compact (isCompact_closedBall (0:ℂ) (∑i,‖periodBasis i‖))).mono_set intro z hz simpa only [Metric.mem_closedBall,dist_zero_right] using norm_mem_periodDomain z hz lemma cubicResidualFunction_fourier (v : ℝ) (hv : 0 ShortDraftTrace.breveE (-cuspFrequency k*z)) := by change Continuous (fun z : ℂ => Complex.exp (2*Real.pi*Complex.I* ((-cuspFrequency k*z)+starRingEnd ℂ (-cuspFrequency k*z)))) fun_prop have hc0 := periodDomain_integrable_of_continuous (fun z => ((3*Real.pi:ℂ)*constantArithmeticResidue*(v:ℂ)^(2/3:ℂ))* ShortDraftTrace.breveE (-cuspFrequency k*z)) (continuous_const.mul hphase) have hcn := periodDomain_integrable_of_continuous (fun z => cubicResidualNonzeroSeries (v,z)*ShortDraftTrace.breveE (-cuspFrequency k*z)) ((cubicResidualNonzeroSeries_height_continuous v hv).mul hphase) simp_rw [cubicResidualFunction,cubicResidualNonzeroFunction, hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint,add_mul] rw [integral_add hc0 hcn,integral_const_mul,integral_cusp_character,cubicResidualNonzeroSeries_fourier v hv k] by_cases hk : k=0 · simp only [ite_eq_left hk,cubicResidualModeAmplitude,mul_zero] ring · simp only [ite_eq_right hk,mul_zero,zero_add] lemma cubicResidualFunction_period (v : ℝ) (hv : 0 F (integralOrbitProjection globalKubotaKernel w)) 2 (hyperbolicVolume.restrict (cuspPeriodStrip a b)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace MemLp.ae_eq (kernelCuspHeightPullback_ae a b ha F) (MeasureTheory.Lp.memLp (kernelCuspHeightPullback a b ha F)) lemma kernelCuspCoordinates_memLp (a b : ℝ) (ha : 0 F (integralOrbitProjection globalKubotaKernel (cuspCoordinateLift q))) 2 ((volume.restrict (Set.Icc a b)).prod (volume.restrict periodDomain)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hm := euclideanToHyperbolic_measurePreserving_on (positiveEuclideanStrip a b) (positiveEuclideanStrip_measurable a b) (positiveEuclideanStrip_positive a b ha) rw [positiveEuclideanStrip_preimage] at hm have hF := (kernelCuspHeightPullback_memLp a b ha F).comp_measurePreserving hm have hvol := euclideanVolume_le_heightCube_hyperbolic (positiveEuclideanStrip a b) (positiveEuclideanStrip_measurable a b) (positiveEuclideanStrip_positive a b ha) (max 1 b) (by positivity) (fun p hp => hp.1.2.trans (le_max_right 1 b)) have hFE := (hF.smul_measure (c := ENNReal.ofReal ((max 1 b)^3)) ENNReal.ofReal_ne_top).mono_measure hvol have hsplit := spatialComplexSplit_preserves_volume.restrict_preimage (s := Set.Icc a b ×ˢ periodDomain) (measurableSet_Icc.prod periodDomain_measurable) have hback := hsplit.symm have hpull := hFE.comp_measurePreserving hback simpa only [Measure.prod_restrict, Measure.volume_eq_prod, Function.comp_def, positiveEuclideanStrip, cuspCoordinateLift] using hpull section ProductSections variable {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] {«μ» : Measure α} {ν : Measure β} [SFinite «μ»] [SFinite ν] lemma complex_memLp_two_sections {f : α × β → ℂ} (hf : MemLp f 2 («μ».prod ν)) : ∀ᵐx ∂«μ», MemLp (fun y => f (x,y)) 2 ν := by filter_upwards [hf.aestronglyMeasurable.prodMk_left, hf.norm.integrable_sq.prod_right_ae] with x hx hi exact (memLp_two_iff_integrable_sq_norm hx).mpr hi end ProductSections lemma kernelCuspSections_memLp (a b : ℝ) (ha : 0 F (integralOrbitProjection globalKubotaKernel (cuspCoordinateLift (v,z)))) 2 (volume.restrict periodDomain) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace complex_memLp_two_sections (kernelCuspCoordinates_memLp a b ha F) lemma cuspCoordinateLift_measurable : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measurable cuspCoordinateLift := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace euclideanToHyperbolic_measurable.comp spatialComplexSplit.symm.measurable lemma kernelCuspFourierCoordinate_integrable (a b : ℝ) (ha : 0 (F (integralOrbitProjection globalKubotaKernel (cuspCoordinateLift q))* cuspWeightedFourierPhase ρ h (cuspCoordinateLift q))/(q.1:ℂ)^3) (Set.Icc a b ×ˢ periodDomain) volume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let := periodDomain_finiteMeasure have hF := (kernelCuspCoordinates_memLp a b ha F).integrable (by norm_num : (1:ℝ≥0∞)≤2) have hm : Measurable (fun q : ℝ × ℂ => cuspWeightedFourierPhase ρ h (cuspCoordinateLift q)/(q.1:ℂ)^3) := ((cuspWeightedFourierPhase_continuous ρ h).measurable.comp cuspCoordinateLift_measurable).div (by fun_prop) have hb : ∀ᵐq ∂((volume.restrict (Set.Icc a b)).prod (volume.restrict periodDomain)), ‖cuspWeightedFourierPhase ρ h (cuspCoordinateLift q)/(q.1:ℂ)^3‖≤‖ρ‖/a^3 := by rw [Measure.prod_restrict, ←Measure.volume_eq_prod] filter_upwards [ae_restrict_mem (measurableSet_Icc.prod periodDomain_measurable)] with q hq have hpos : 0 F (integralOrbitProjection globalKubotaKernel w)*cuspWeightedFourierPhase ρ h w) := ((MeasureTheory.Lp.stronglyMeasurable F).comp_measurable (measurable_integralOrbitProjection _)).mul (cuspWeightedFourierPhase_continuous ρ h).stronglyMeasurable rw [cuspPeriodStrip_integral_coordinates_of_pos a b ha _ hg.aestronglyMeasurable (kernelCuspFourierCoordinate_integrable a b ha ρ h F)] apply setIntegral_congr_fun measurableSet_Icc intro v hv have hpos : 0 by dsimp only rw [cuspWeightedFourierPhase,cuspFourierPhase,cuspCoordinateLift_positive v z hpos, hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint] ring) lemma kernelCuspSliceCoefficient_integrable (a b : ℝ) (ha : 0 c/(v:ℂ)^3) apply integral_congr_ae exact Eventually.of_forall (fun z => by dsimp only [kernelCuspSliceCoefficient] rw [cuspWeightedFourierPhase,cuspFourierPhase,cuspCoordinateLift_positive v z hpos, hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint] simp) end section open scoped BigOperators Classical open EisensteinEmbedding (omega3) open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss CubicRamified namespace RootNotationScatteringResidues03 abbrev Eis := ActualEisensteinCubic.O end RootNotationScatteringResidues03 open RootNotationScatteringResidues03 (Eis) lemma third_character_eq_one_iff_basis (ψ:AddChar (Eis⧸Ideal.span {(3:Eis)}) ℂ) : ψ=1 ↔ ψ (Ideal.Quotient.mk _ (1:Eis))=1 ∧ ψ (Ideal.Quotient.mk _ omega)=1 := by constructor · rintro rfl simp · rintro ⟨h1,hw⟩ ext x obtain ⟨z,rfl⟩:=Ideal.Quotient.mk_surjective x rw [←ActualEisensteinCoordinates.eval_coords z] change ψ (Ideal.Quotient.mk _ (((ActualEisensteinCoordinates.coords z).1:Eis)+ ((ActualEisensteinCoordinates.coords z).2:Eis)*omega))=1 rw [map_add,AddChar.map_add_eq_mul] have hA:Ideal.Quotient.mk (Ideal.span {(3:Eis)}) ((ActualEisensteinCoordinates.coords z).1:Eis)= (ActualEisensteinCoordinates.coords z).1 • Ideal.Quotient.mk _ (1:Eis):=by rw [←map_zsmul] simp have hB:Ideal.Quotient.mk (Ideal.span {(3:Eis)}) (((ActualEisensteinCoordinates.coords z).2:Eis)*omega)= (ActualEisensteinCoordinates.coords z).2 • Ideal.Quotient.mk _ omega:=by rw [←map_zsmul] simp only [zsmul_eq_mul] rw [hA,hB,AddChar.map_zsmul_eq_zpow,AddChar.map_zsmul_eq_zpow,h1,hw] simp lemma omega3_pow_exp_eq_one_iff (t:ℕ) (b:ℤ) : omega3^t*Complex.exp (2*Real.pi*Complex.I*(b:ℂ)/3)=1 ↔ (3:ℤ)∣(t:ℤ)+b := by have hω:omega3=Complex.exp (2*Real.pi*Complex.I/3):=by rw [←TraceLambdaPhase.exp_minus_four_pi_div_three] apply Complex.exp_eq_exp_iff_exists_int.mpr refine ⟨-1,?_⟩ push_cast ring rw [hω,←Complex.exp_nat_mul,←Complex.exp_add] have he:(t:ℂ)*(2*Real.pi*Complex.I/3)+2*Real.pi*Complex.I*(b:ℂ)/3= 2*Real.pi*Complex.I*(((t:ℤ)+b:ℤ):ℂ)/3:=by push_cast;ring rw [he] constructor · intro hh have hh':Complex.exp (2*Real.pi*Complex.I*((((t:ℤ)+b:ℤ):ℂ)/3))=1:=by convert hh using 1 ;ring_nf obtain ⟨v,hv⟩:=GeneralPrimitiveTrace.complex_exp_trace_integer hh' have hc:(((t:ℤ)+b:ℤ):ℂ)=3*(v:ℂ):=by linear_combination 3*hv have hi:(t:ℤ)+b=3*v:=by exact_mod_cast hc exact ⟨v,hi⟩ · rintro ⟨v,hv⟩ rw [hv] apply Complex.exp_eq_one_iff.mpr refine ⟨v,?_⟩ push_cast ring lemma eisEmbedding_omega_actual : eisEmbedding omega=omega3 := by have hω:omega=ActualEisensteinCoordinates.eval 0 1:=by simp only [ActualEisensteinCoordinates.eval,Int.cast_zero,Int.cast_one,zero_add,one_mul] rfl rw [hω,eisEmbedding_eval] norm_num lemma trace_third_coordinate (k:Eis) : eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates 3 (by norm_num) (Ideal.Quotient.mk _ k)= Complex.exp (2*Real.pi*Complex.I*((ActualEisensteinCoordinates.coords k).2:ℂ)/3) := by rw [eisTraceModChar,IdealGaussCRT.traceModChar_mk] have hh:=breveE_real_trace_of_O 3 k norm_num at hh convert hh using 1 ;simp only [map_ofNat] ;congr 1 ;ring end open scoped BigOperators Classical open EisensteinEmbedding (omega3) open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss CubicRamified namespace RootNotationScatteringResidues04 abbrev Eis := ActualEisensteinCubic.O end RootNotationScatteringResidues04 open RootNotationScatteringResidues04 (Eis) lemma ramified_symbol_primaryCoord (u:Eisˣ) (n j:ℕ) (hu:(u:Eis)=omega^j ∨ (u:Eis)=-(omega^j)) (A B:ℤ) : symbol (u.val*lambda^n) (primaryCoord A B)= (cubicExp (2*A-B))^j*(cubicExp A)^n := by have hp:=primaryCoord_primary A B rw [symbol_mul_numerator _ _ _ hp,symbol_pow_numerator _ _ hp, symbol_lambda_eq_linearRay _ hp,linearRay_primaryCoord] norm_num only [one_mul,zero_mul,add_zero] congr 1 rcases hu with hu|hu · rw [hu,symbol_pow_numerator _ _ hp,symbol_omega_eq_linearRay _ hp, linearRay_primaryCoord] ring_nf · rw [hu,symbol_neg_numerator _ _ hp,symbol_pow_numerator _ _ hp, symbol_omega_eq_linearRay _ hp,linearRay_primaryCoord] ring_nf lemma ramified_symbol_at_one (u:Eisˣ) (n j:ℕ) (hu:(u:Eis)=omega^j ∨ (u:Eis)=-(omega^j)) : symbol (u.val*lambda^n) (1+3*(1:Eis))=omega^(2*j+n) := by have he:(1+3*(1:Eis))=primaryCoord 1 0:=by rw [primaryCoord_eq];norm_num rw [he,ramified_symbol_primaryCoord u n j hu] norm_num [cubicExp] rw [←pow_mul,←pow_add] lemma ramified_symbol_at_omega (u:Eisˣ) (n j:ℕ) (hu:(u:Eis)=omega^j ∨ (u:Eis)=-(omega^j)) : symbol (u.val*lambda^n) (1+3*omega)=omega^(2*j) := by have he:(1+3*omega)=primaryCoord 0 1:=by rw [primaryCoord_eq];norm_num rw [he,ramified_symbol_primaryCoord u n j hu] norm_num [cubicExp] rw [←pow_mul] lemma ramifiedFrequencyChar_mk (k:Eis) (u:Eisˣ) (n:ℕ) (x:Eis) : ramifiedFrequencyChar k u n (Ideal.Quotient.mk _ x)= eisEmbedding (symbol (u.val*lambda^n) (1+3*x))* eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates 3 (by norm_num) (Ideal.Quotient.mk _ (k*x)) := by rw [ramifiedFrequencyChar,AddChar.mul_apply,ramifiedQuotientChar, IdealGaussCRT.quotientAddChar_mk,AddChar.mulShift_apply,←map_mul] rfl lemma coords_mul_omega_second (k:Eis) : (ActualEisensteinCoordinates.coords (k*omega)).2= (ActualEisensteinCoordinates.coords k).1-(ActualEisensteinCoordinates.coords k).2 := by conv_lhs => rw [←ActualEisensteinCoordinates.eval_coords k] have hw:omega=ActualEisensteinCoordinates.eval 0 1:=by simp only [ActualEisensteinCoordinates.eval,Int.cast_zero,Int.cast_one,zero_add,one_mul] rfl rw [hw,ActualEisensteinCoordinates.eval_mul,ShortDraftLatticeCount.coords_eval] ring def ramifiedCongruence (k:Eis) (j n:ℕ):Prop:= (3:ℤ)∣(2*(j:ℤ)+(n:ℤ)+(ActualEisensteinCoordinates.coords k).2) ∧ (3:ℤ)∣(2*(j:ℤ)+(ActualEisensteinCoordinates.coords k).1- (ActualEisensteinCoordinates.coords k).2) lemma ramifiedFrequencyChar_eq_one_iff (k:Eis) (u:Eisˣ) (n j:ℕ) (hu:(u:Eis)=omega^j ∨ (u:Eis)=-(omega^j)) : ramifiedFrequencyChar k u n=1 ↔ ramifiedCongruence k j n := by rw [third_character_eq_one_iff_basis,ramifiedFrequencyChar_mk, ramifiedFrequencyChar_mk,ramified_symbol_at_one u n j hu, ramified_symbol_at_omega u n j hu,map_pow,map_pow,eisEmbedding_omega_actual, mul_one,trace_third_coordinate,trace_third_coordinate,coords_mul_omega_second, omega3_pow_exp_eq_one_iff,omega3_pow_exp_eq_one_iff] unfold ramifiedCongruence push_cast simp only [add_sub_assoc] theorem ramified_arithmetic_explicit_table (h k:Eis) (u:Eisˣ) (n j:ℕ) (hn:2≤n) (hu:(u:Eis)=omega^j ∨ (u:Eis)=-(omega^j)) (hk:3*h=(u.val*lambda^n)*k) : arithmeticResidueSum h (u.val*lambda^n)= if ramifiedCongruence k j n then ((3^n:ℕ):ℂ)*residueAdditive k 3 1 else 0 := by rw [ramified_arithmetic_character_test h k u n hn hk] simp only [ramifiedFrequencyChar_eq_one_iff k u n j hu] def ramifiedUnitIndex (u:Eisˣ):Fin 3:=Classical.choose (unit_eq_sign_omega u) lemma ramifiedUnitIndex_spec (u:Eisˣ) : (u:Eis)=omega^(ramifiedUnitIndex u).val ∨ (u:Eis)=-(omega^(ramifiedUnitIndex u).val):= Classical.choose_spec (unit_eq_sign_omega u) def explicitRamifiedCoefficient (h:Eis) (u:Eisˣ) (n:ℕ):ℂ:= if hd:u.val*lambda^n∣3*h then let k:=Classical.choose hd if ramifiedCongruence k (ramifiedUnitIndex u).val n then ((3^n:ℕ):ℂ)*residueAdditive k 3 1 else 0 else 0 theorem arithmeticResidueSum_eq_explicitRamifiedCoefficient (h:Eis) (u:Eisˣ) (n:ℕ) (hn:2≤n) : arithmeticResidueSum h (u.val*lambda^n)=explicitRamifiedCoefficient h u n := by unfold explicitRamifiedCoefficient split_ifs with hd · exact ramified_arithmetic_explicit_table h (Classical.choose hd) u n (ramifiedUnitIndex u).val hn (ramifiedUnitIndex_spec u) (Classical.choose_spec hd) · by_contra hne exact hd (ramified_arithmetic_support h u n hn hne) theorem scatteringCoefficient_explicit_ramified (s:ℂ) (hs:2 sourceComplexMatrix M • w) (source_action_respects_kernel M) lemma kernelSourceAction_mk (M : levelTwo) (w : HyperbolicSpace) : kernelSourceAction M (integralOrbitProjection globalKubotaKernel w)= integralOrbitProjection globalKubotaKernel (sourceComplexMatrix M • w) := rfl lemma kernelSourceAction_one (q : SourceKernelQuotient) : kernelSourceAction 1 q=q := by induction q using Quotient.inductionOn with | _ w => change integralOrbitProjection globalKubotaKernel (sourceComplexMatrix 1 • w)=integralOrbitProjection globalKubotaKernel w rw [map_one,one_smul] lemma kernelSourceAction_mul (M N : levelTwo) (q : SourceKernelQuotient) : kernelSourceAction (M*N) q=kernelSourceAction M (kernelSourceAction N q) := by induction q using Quotient.inductionOn with | _ w => change integralOrbitProjection globalKubotaKernel (sourceComplexMatrix (M*N) • w)= integralOrbitProjection globalKubotaKernel (sourceComplexMatrix M • (sourceComplexMatrix N • w)) rw [map_mul,mul_smul] lemma kernelSourceAction_continuous (M : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; levelTwo) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology Continuous (kernelSourceAction M) := letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology (continuous_hyperbolic_action (sourceComplexMatrix M)).quotient_map' (source_action_respects_kernel M) def kernelSourceHomeomorph (M : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; levelTwo) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology SourceKernelQuotient ≃ₜ SourceKernelQuotient := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology exact { toFun := kernelSourceAction M invFun := kernelSourceAction M⁻¹ left_inv q := by rw [←kernelSourceAction_mul,inv_mul_cancel,kernelSourceAction_one] right_inv q := by rw [←kernelSourceAction_mul,mul_inv_cancel,kernelSourceAction_one] continuous_toFun := kernelSourceAction_continuous M continuous_invFun := kernelSourceAction_continuous M⁻¹ } lemma kernelSourceAction_fundamentalDomain (M : levelTwo) : letI thirdWitness2 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := integralSubgroupHyperbolicAction globalKubotaKernel IsFundamentalDomain globalKubotaKernel ((fun w : HyperbolicSpace => sourceComplexMatrix M • w) '' hyperbolicFundamentalSet globalKubotaKernel) hyperbolicVolume := by letI thirdWitness0 := @OAI.CubicEisenstein.fullSLMeasurableAction letI thirdWitness1 := @OAI.CubicEisenstein.fullSLVolumeInvariant letI thirdWitness2 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace let := integralSubgroupHyperbolicAction globalKubotaKernel apply (hyperbolicFundamentalSet_isFundamentalDomain globalKubotaKernel globalKubotaKernel_le_levelThree).image_of_equiv (MulAction.toPerm (sourceComplexMatrix M)) (show Measure.QuasiMeasurePreserving (MulAction.toPerm (sourceComplexMatrix M)).symm hyperbolicVolume hyperbolicVolume from by exact (measurePreserving_smul (sourceComplexMatrix M)⁻¹ hyperbolicVolume).quasiMeasurePreserving) (kernelSourceConjugate M⁻¹).toEquiv intro N w change sourceComplexMatrix M • (integralComplexMatrix ((M⁻¹:levelTwo)*(N:SL(2,ActualEisensteinCubic.O))*(M⁻¹:levelTwo)⁻¹) • w)= integralComplexMatrix (N:SL(2,ActualEisensteinCubic.O)) • (sourceComplexMatrix M • w) simp only [Subgroup.coe_inv,map_mul,map_inv] change sourceComplexMatrix M • (((sourceComplexMatrix M)⁻¹*integralComplexMatrix (N:SL(2,ActualEisensteinCubic.O))* ((sourceComplexMatrix M)⁻¹)⁻¹) • w)=_ simp only [inv_inv,mul_smul,smul_inv_smul] lemma kernelSourceAction_measurePreserving (M : levelTwo) : letI thirdWitness4 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace MeasurePreserving (kernelSourceAction M) (integralQuotientVolume globalKubotaKernel) (integralQuotientVolume globalKubotaKernel) := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.fullSLMeasurableAction letI thirdWitness2 := @OAI.CubicEisenstein.fullSLVolumeInvariant letI thirdWitness3 := @OAI.CubicEisenstein.hyperbolicBorelSpace letI thirdWitness4 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace let : BorelSpace SourceKernelQuotient := kernelQuotientBorel refine ⟨(kernelSourceAction_continuous M).measurable,?_⟩ let act : HyperbolicSpace→HyperbolicSpace := fun w => sourceComplexMatrix M • w have hmap := (measurePreserving_smul (sourceComplexMatrix M) hyperbolicVolume).restrict_image_emb (measurableEmbedding_const_smul (sourceComplexMatrix M)) (hyperbolicFundamentalSet globalKubotaKernel) have heq : kernelSourceAction M ∘ integralOrbitProjection globalKubotaKernel= integralOrbitProjection globalKubotaKernel ∘ act := by ext w; rfl change Measure.map (kernelSourceAction M) (Measure.map (integralOrbitProjection globalKubotaKernel) (hyperbolicVolume.restrict (hyperbolicFundamentalSet globalKubotaKernel)))=_ rw [Measure.map_map (kernelSourceAction_continuous M).measurable (measurable_integralOrbitProjection _),heq, ←Measure.map_map (measurable_integralOrbitProjection _) (continuous_hyperbolic_action _).measurable] change Measure.map (integralOrbitProjection globalKubotaKernel) (Measure.map act (hyperbolicVolume.restrict (hyperbolicFundamentalSet globalKubotaKernel)))=_ rw [hmap.map_eq] exact integralQuotientVolume_independent globalKubotaKernel globalKubotaKernel_le_levelThree _ (kernelSourceAction_fundamentalDomain M) end CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace CubicEisenstein open CubicKubota def kernelSourcePullback (M : levelTwo) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2 →ₗᵢ[ℂ] KernelQuotientL2 := letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Lp.compMeasurePreservingₗᵢ ℂ (kernelSourceAction M) (kernelSourceAction_measurePreserving M) lemma kernelSourcePullback_ae_eq (M : levelTwo) (F : KernelQuotientL2) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSourcePullback M F=ᵐ[integralQuotientVolume globalKubotaKernel] fun q => F (kernelSourceAction M q) := letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Lp.coeFn_compMeasurePreserving F (kernelSourceAction_measurePreserving M) lemma kernelSourcePullback_one (F : KernelQuotientL2) : kernelSourcePullback 1 F=F := by apply Lp.ext filter_upwards [kernelSourcePullback_ae_eq 1 F] with q hq simpa only [kernelSourceAction_one] using hq lemma kernelSourcePullback_comp (M N : levelTwo) (F : KernelQuotientL2) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSourcePullback M (kernelSourcePullback N F)=kernelSourcePullback (N*M) F := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace have hcomp := (kernelSourceAction_measurePreserving M).quasiMeasurePreserving.ae_eq_comp (kernelSourcePullback_ae_eq N F) apply Lp.ext filter_upwards [kernelSourcePullback_ae_eq M (kernelSourcePullback N F),hcomp, kernelSourcePullback_ae_eq (N*M) F] with q hp hn hnm rw [hp,hnm] exact hn.trans (congrArg F (kernelSourceAction_mul N M q).symm) lemma kernelSourcePullback_surjective (M : levelTwo) : Function.Surjective (kernelSourcePullback M) := by intro F refine ⟨kernelSourcePullback M⁻¹ F,?_⟩ rw [kernelSourcePullback_comp,inv_mul_cancel,kernelSourcePullback_one] def kernelSourceUnitary (M : levelTwo) : KernelQuotientL2 ≃ₗᵢ[ℂ] KernelQuotientL2 := LinearIsometryEquiv.ofSurjective (kernelSourcePullback M) (kernelSourcePullback_surjective M) def kernelSourceProjection : KernelQuotientL2 →L[ℂ] KernelQuotientL2 := let : Fintype (levelTwo ⧸ levelThreeInTwo) := sourceQuotientFintype; (24:ℂ)⁻¹ • ∑q : levelTwo ⧸ levelThreeInTwo, (kernelSourcePullback (rationalLift (sourceRationalSection q))).toContinuousLinearMap lemma kernelSourceProjection_apply (F : KernelQuotientL2) : let : Fintype (levelTwo ⧸ levelThreeInTwo) := sourceQuotientFintype; kernelSourceProjection F=(24:ℂ)⁻¹ • ∑q : levelTwo ⧸ levelThreeInTwo, kernelSourcePullback (rationalLift (sourceRationalSection q)) F := let : Fintype (levelTwo ⧸ levelThreeInTwo) := sourceQuotientFintype; by simp only [kernelSourceProjection,_root_.smul_apply,_root_.sum_apply, LinearIsometry.coe_toContinuousLinearMap] lemma kernelSourceProjection_eq_twentyFour (F : KernelQuotientL2) : kernelSourceProjection F=(24:ℂ)⁻¹ • ∑i : RationalBruhatIndex, kernelSourcePullback (rationalLift (rationalBruhatRep i)) F := let : Fintype (levelTwo ⧸ levelThreeInTwo) := sourceQuotientFintype; by rw [kernelSourceProjection_apply] congr 1 rw [←rationalCosetEquiv.sum_comp] simp only [sourceRationalSection,Equiv.symm_apply_apply] end CubicEisenstein namespace CubicKubota open ActualEisensteinCubic def sourceLevelInclusion : levelThree→*levelTwo where toFun n := ⟨(n:SL(2,ActualEisensteinCubic.O)),levelThree_le_levelTwo n.property⟩ map_one' := rfl map_mul' _ _ := rfl lemma sourceLevelInclusion_character (n : levelThree) : levelTwoComplexCharacter (sourceLevelInclusion n)=complexCharacter n := levelTwoComplexCharacter_restrict n end CubicKubota namespace CubicEisenstein open CubicKubota lemma kernelSourceProjection_ae_eq (F : KernelQuotientL2) : let : Fintype (levelTwo ⧸ levelThreeInTwo) := sourceQuotientFintype; kernelSourceProjection F=ᵐ[integralQuotientVolume globalKubotaKernel] fun x => (24:ℂ)⁻¹ * ∑q : levelTwo ⧸ levelThreeInTwo, F (kernelSourceAction (rationalLift (sourceRationalSection q)) x) := let : Fintype (levelTwo ⧸ levelThreeInTwo) := sourceQuotientFintype; by rw [kernelSourceProjection_apply] have hsum := (Lp.coeFn_finsetSum Finset.univ (fun q : levelTwo ⧸ levelThreeInTwo => kernelSourcePullback (rationalLift (sourceRationalSection q)) F)).trans (eventuallyEq_sum (fun q _ => kernelSourcePullback_ae_eq (rationalLift (sourceRationalSection q)) F)) filter_upwards [(Lp.coeFn_smul (24:ℂ)⁻¹ _).trans (hsum.const_smul (24:ℂ)⁻¹)] with x hx simpa only [Pi.smul_apply,Finset.sum_apply,smul_eq_mul] using hx end CubicEisenstein end open scoped Classical namespace CubicEisenstein open CubicKubota end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology ENNReal open Finset AddChar MulChar EisensteinEmbedding namespace CubicEisenstein open EisensteinSchwartzPoisson ActualEisensteinCubic ConcreteTraceCRT Module def periodVector : (Fin 2 → ℝ) ≃L[ℝ] ℂ := periodBasis.equivFunL.symm lemma periodVector_apply (x : Fin 2 → ℝ) : periodVector x = 3 * ((x 0 : ℂ) + (x 1 : ℂ) * omega3) := by change periodBasis.equivFun.symm x = _ rw [Basis.equivFun_symm_apply, Fin.sum_univ_two, periodBasis_zero, periodBasis_one] simp only [Complex.real_smul] ring def periodTorus (z : ℂ) : UnitAddTorus (Fin 2) := fun i => (periodBasis.equivFunL z i : UnitAddCircle) lemma periodTorus_periodVector (x : Fin 2 → ℝ) : periodTorus (periodVector x) = fun i => (x i : UnitAddCircle) := by change (fun i => ((periodBasis.equivFunL (periodBasis.equivFunL.symm x)) i : UnitAddCircle)) = _ rw [periodBasis.equivFunL.apply_symm_apply] def periodFrequencyEquiv : (Fin 2 → ℤ) ≃ ActualEisensteinCubic.O := (finTwoArrowEquiv ℤ).trans dualFrequencyEquiv lemma periodFrequencyEquiv_apply (n : Fin 2 → ℤ) : periodFrequencyEquiv n = dualFrequencyEquiv (n 0, n 1) := rfl lemma periodVector_character (n : Fin 2 → ℤ) (x : Fin 2 → ℝ) : ShortDraftTrace.breveE (cuspFrequency (periodFrequencyEquiv n) * periodVector x) = Complex.exp (2 * Real.pi * Complex.I * ((n 0 : ℂ) * (x 0 : ℂ) + (n 1 : ℂ) * (x 1 : ℂ))) := by have hlam : eisLam ≠ 0 := by exact eisLam_ne_zero have harg : cuspFrequency (periodFrequencyEquiv n) * periodVector x = (eisEmbedding (dualFrequencyEquiv (n 0,n 1)) * ((x 0 : ℂ) + (x 1 : ℂ) * omega3)) / eisLam := by rw [cuspFrequency, periodVector_apply, periodFrequencyEquiv_apply] field_simp rw [harg, ←paperE, paperE_eq_exp, dualFrequencyEquiv_coordinates] have hs : Real.sqrt 3 ≠ 0 := ne_of_gt (Real.sqrt_pos.mpr (by norm_num)) have hw : omega3.re = -(1/2:ℝ) := by norm_num [omega3] congr 1 simp only [complexPoint, Complex.mul_im, Complex.add_re, Complex.add_im, Complex.ofReal_re, Complex.ofReal_im, Complex.mul_re, hw, omega3_im] push_cast field_simp ring lemma periodTorus_mFourier (n : Fin 2 → ℤ) (z : ℂ) : UnitAddTorus.mFourier n (periodTorus z) = ShortDraftTrace.breveE (cuspFrequency (periodFrequencyEquiv n) * z) := by obtain ⟨x, rfl⟩ := periodVector.surjective z rw [periodTorus_periodVector, periodVector_character] simp only [UnitAddTorus.mFourier, ContinuousMap.coe_mk, Fin.prod_univ_two, fourier_coe_apply, Complex.ofReal_one, div_one] rw [←Complex.exp_add] congr 1 ring lemma periodFrequencyEquiv_neg (n : Fin 2 → ℤ) : periodFrequencyEquiv (-n) = -periodFrequencyEquiv n := by apply eisEmbedding_injective change eisEmbedding (ActualEisensteinCoordinates.eval (-n 0 + -n 1) (-n 0)) = eisEmbedding (-ActualEisensteinCoordinates.eval (n 0 + n 1) (n 0)) rw [map_neg, eisEmbedding_eval, eisEmbedding_eval] push_cast ring lemma cuspFrequency_neg (h : ActualEisensteinCubic.O) : cuspFrequency (-h) = -cuspFrequency h := by simp only [cuspFrequency, map_neg, neg_div] lemma periodVector_eq_lattice (x : Fin 2 → ℝ) : periodVector x = eisensteinLatticeMap 3 (by norm_num) (Complex.measurableEquivPi.symm x) := by rw [periodVector_apply] simp [eisensteinLatticeMap, Complex.measurableEquivPi_symm_apply, mul_comm] simp [scaledBasisEquiv_apply, mul_add] lemma periodVector_map_volume : Measure.map periodVector volume = ENNReal.ofReal (2/(9*Real.sqrt 3)) • volume := by have heq : (periodVector : (Fin 2 → ℝ) → ℂ) = eisensteinLatticeMap 3 (by norm_num) ∘ Complex.measurableEquivPi.symm := funext periodVector_eq_lattice rw [heq, ←Measure.map_map (eisensteinLatticeMap 3 (by norm_num)).continuous.measurable Complex.measurableEquivPi.symm.measurable, Complex.volume_preserving_equiv_pi.symm.map_eq] have hmap := Measure.map_linearMap_addHaar_eq_smul_addHaar volume (eisensteinLatticeMap 3 (by norm_num)).toLinearEquiv.isUnit_det'.ne_zero change Measure.map (eisensteinLatticeMap 3 (by norm_num)) volume = ENNReal.ofReal (inverseJacobian (eisensteinLatticeMap 3 (by norm_num))) • volume at hmap rw [hmap, eisenstein_inverseJacobian] norm_num [mul_comm] def periodCube : Set (Fin 2 → ℝ) := {x | ∀i, x i ∈ Set.Ico 0 1} lemma periodVector_preimage_domain : periodVector ⁻¹' periodDomain = periodCube := by ext x change (∀i, periodBasis.repr (periodBasis.equivFun.symm x) i ∈ Set.Ico 0 1) ↔ _ simp only [←Basis.equivFun_apply, periodBasis.equivFun.apply_symm_apply] rfl lemma periodDomain_integral_coordinates (f : ℂ → ℂ) : (2/(9*Real.sqrt 3):ℝ) • (∫z in periodDomain, f z) = ∫x in periodCube, f (periodVector x) := by have h := periodVector.toHomeomorph.toMeasurableEquiv.measurableEmbedding.setIntegral_map f periodDomain («μ» := (volume : Measure (Fin 2 → ℝ))) change (∫z in periodDomain, f z ∂Measure.map periodVector volume) = ∫x in periodVector ⁻¹' periodDomain, f (periodVector x) at h rw [periodVector_map_volume, Measure.restrict_smul, integral_smul_measure, ENNReal.toReal_ofReal (by positivity), periodVector_preimage_domain] at h exact h noncomputable abbrev instMeasureSpaceUnitAddCircle_oAI : MeasureSpace UnitAddCircle := ⟨AddCircle.haarAddCircle⟩ lemma periodCube_ae_Ioc : periodCube =ᵐ[volume] {x : Fin 2 → ℝ | ∀i, x i ∈ Set.Ioc 0 1} := by rw [volume_pi] have h := Measure.ae_eq_set_pi («μ» := fun _ : Fin 2 => (volume : Measure ℝ)) (I := Set.univ) (s := fun _ => Set.Ico (0:ℝ) 1) (t := fun _ => Set.Ioc (0:ℝ) 1) (fun _ _ => Ico_ae_eq_Ioc) simpa only [Set.pi, Set.mem_univ, forall_true_left, periodCube] using h lemma periodTorus_integral (f : UnitAddTorus (Fin 2) → ℂ) : letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI (∫t, f t) = (2/(9*Real.sqrt 3):ℝ) • (∫z in periodDomain, f (periodTorus z)) := letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI by rw [periodDomain_integral_coordinates, UnitAddTorus.integral_preimage f (fun _ => 0)] simp only [zero_add, periodTorus_periodVector] exact setIntegral_congr_set periodCube_ae_Ioc.symm lemma periodTorus_fourierCoeff (f : UnitAddTorus (Fin 2) → ℂ) (n : Fin 2 → ℤ) : UnitAddTorus.mFourierCoeff f n = (2/(9*Real.sqrt 3):ℝ) • (∫z in periodDomain, f (periodTorus z) * ShortDraftTrace.breveE (-cuspFrequency (periodFrequencyEquiv n)*z)) := letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI by rw [UnitAddTorus.mFourierCoeff, periodTorus_integral] congr 1 apply integral_congr_ae exact Eventually.of_forall (fun z => by dsimp only rw [periodTorus_mFourier, periodFrequencyEquiv_neg, cuspFrequency_neg] exact mul_comm _ _) lemma periodTorus_L2_ext (F G : letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI; Lp ℂ 2 (volume : Measure (UnitAddTorus (Fin 2)))) (h : ∀h : ActualEisensteinCubic.O, (∫z in periodDomain, F (periodTorus z)*ShortDraftTrace.breveE (-cuspFrequency h*z)) = ∫z in periodDomain, G (periodTorus z)*ShortDraftTrace.breveE (-cuspFrequency h*z)) : letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI F=G := letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI by apply UnitAddTorus.mFourierBasis.repr.injective ext n rw [UnitAddTorus.mFourierBasis_repr, UnitAddTorus.mFourierBasis_repr, periodTorus_fourierCoeff, periodTorus_fourierCoeff, h] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.OppositeCusp namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss open PrimaryIdealUnitReindex (GoodIdeal) abbrev PrimaryLower:={c:_root_.OAI.ActualEisensteinCubic.O//(3:_root_.OAI.ActualEisensteinCubic.O)∣c-1} abbrev OppositeData:=Σc:PrimaryLower,{x:_root_.OAI.ActualEisensteinCubic.O//IsCoprime c.val x} lemma primaryLower_primary (c:PrimaryLower):lambda^2∣c.val-1:=lambda_sq_dvd_three.trans c.2 lemma primaryLower_ne_zero (c:PrimaryLower):c.val≠0:=primary_ne_zero c.val (primaryLower_primary c) def oppositeDataToPrimitive (p:OppositeData):PrimitiveRow:= ⟨![-3*p.2.val,p.1.val],by change IsCoprime (-3*p.2.val) p.1.val ∧ (3:_root_.OAI.ActualEisensteinCubic.O)∣-3*p.2.val ∧ (3:_root_.OAI.ActualEisensteinCubic.O)∣p.1.val-1 refine ⟨?_,⟨-p.2.val,by ring⟩,p.1.2⟩ simpa only [neg_mul] using ((primary_coprime_three p.1.val (primaryLower_primary p.1)).mul_right p.2.2).symm.neg_left⟩ lemma oppositeDataToPrimitive_bijective:Function.Bijective oppositeDataToPrimitive:=by constructor · rintro ⟨c,x,hx⟩ ⟨d,y,hy⟩ h have hrow:=congrArg Subtype.val h have hcd:c=d:=by apply Subtype.ext exact congrFun hrow 1 subst d have hxy:x=y:=by have he:-(3:_root_.OAI.ActualEisensteinCubic.O)*x=-(3:_root_.OAI.ActualEisensteinCubic.O)*y:=congrFun hrow 0 exact mul_left_cancel₀ (by norm_num : -(3:_root_.OAI.ActualEisensteinCubic.O)≠0) he subst y rfl · intro r obtain ⟨t,ht⟩:=r.2.2.1 let c:PrimaryLower:=⟨r.1 1,r.2.2.2⟩ have hx:IsCoprime c.val (-t):=by have hh:IsCoprime c.val (3*t):=by simpa only [c,ht] using r.2.1.symm exact (hh.of_isCoprime_of_dvd_right (dvd_mul_left t 3)).neg_right refine ⟨⟨c,-t,hx⟩,Subtype.ext ?_⟩ funext i fin_cases i · change -3*(-t)=r.1 0 rw [ht] ring · rfl def oppositeDataEquiv:OppositeData≃PrimitiveRow:= Equiv.ofBijective oppositeDataToPrimitive oppositeDataToPrimitive_bijective def oppositeMatrix:SL(2,ℂ):=⟨!![0,-1;1,0],by simp [Matrix.det_fin_two]⟩ lemma rowOperator_opposite (v:Fin 2→ℂ):rowOperator oppositeMatrix v=![v 1,-v 0]:=by rw [rowOperator_apply] funext i fin_cases i <;> simp [oppositeMatrix,Matrix.vecMul,dotProduct,Fin.sum_univ_two] def oppositeEisenstein (z:ℂ) (v:ℝ) (hv:0 simp [oppositeDataEquiv, Equiv.ofBijective_apply, oppositeDataToPrimitive, r, map_mul] have hr0:r≠0:=by intro hh have he:=congrFun hh 0 exact eisEmbedding_ne_zero (primaryLower_ne_zero p.1) he have hp:0rowOperator (a*upperSection z v hv)⁻¹):=by have he (z:ℂ):rowOperator (a*upperSection z v hv)⁻¹= (rowOperator a⁻¹).comp (rowOperator (upperSection z v hv)⁻¹):=by ext u simp only [mul_inv_rev,ContinuousLinearMap.comp_apply,rowOperator_mul] simp_rw [he] exact continuous_const.clm_comp (continuous_inverse_upper_operator v hv) lemma exists_fixed_left_rowBound (a:SL(2,ℂ)) (v:ℝ) (hv:0rowBound (a*upperSection z v hv)):= continuous_const.mul (continuous_const.add (continuous_inverse_fixed_left_operator a v hv).norm) let R:ℝ:=∑i:Fin 2,‖periodBasis i‖ obtain ⟨C,hC⟩:=(isCompact_closedBall (0:ℂ) R).bddAbove_image hc.continuousOn refine ⟨max 1 C,lt_of_lt_of_le (by norm_num) (le_max_left _ _),?_⟩ intro z hz apply (hC ?_).trans (le_max_right _ _) exact ⟨z,by simpa only [Metric.mem_closedBall,dist_zero_right] using norm_mem_periodDomain z hz,rfl⟩ lemma continuous_fixed_left_summand (a:SL(2,ℂ)) (v:ℝ) (hv:0summand (a*upperSection z v hv) s x):=by simp_rw [summand,←rowOperator_mul,rowEnergy_upperSection] apply continuous_const.mul apply Continuous.cpow · apply Complex.continuous_ofReal.comp unfold heightDenominator fun_prop · exact continuous_const · intro z apply Complex.ofReal_mem_slitPlane.mpr exact div_pos (heightDenominator_pos z v hv _ (rowOperator_ne_zero a _ (embeddedRow_ne_zero x))) hv lemma fixed_left_summable_majorant (a:SL(2,ℂ)) (v:ℝ) (hv:0C^(2*s.re)*‖rowCoordinates (cosetRow x)‖^(-(2*s.re)),?_,?_,?_⟩ · have hsumm:=summable_integer_four_rpow (2*s.re) (by linarith) have hinj:Function.Injective (fun x:CuspCosets=>rowCoordinates (cosetRow x)):= rowCoordinates_injective.comp cosetRow_injective exact (hsumm.comp_injective hinj).mul_left _ · intro x positivity · intro z hz x apply (norm_summand_bound (a*upperSection z v hv) s (by linarith) x).trans exact mul_le_mul_of_nonneg_right (Real.rpow_le_rpow (rowBound_pos _).le (hbound z hz) (by linarith)) (by positivity) theorem hasSum_integral_fixed_left_Eisenstein (a:SL(2,ℂ)) (v:ℝ) (hv:0∫z in periodDomain, summand (a*upperSection z v hv) s x*ShortDraftTrace.breveE (-freq*z)) (∫z in periodDomain,eisenstein (a*upperSection z v hv) s*ShortDraftTrace.breveE (-freq*z)):=by let:Countable CuspCosets:=(rowCoordinates_injective.comp cosetRow_injective).countable let:=periodDomain_finiteMeasure obtain ⟨M,hM,hMnonneg,hbound⟩:=fixed_left_summable_majorant a v hv s hs have hchar:Continuous (fun z:ℂ=>ShortDraftTrace.breveE (-freq*z)):=by change Continuous (fun z:ℂ=>Complex.exp (2*Real.pi*Complex.I*((-freq*z)+starRingEnd ℂ (-freq*z)))) fun_prop exact hasSum_integral_of_dominated_convergence («μ»:=volume.restrict periodDomain) (fun (x:CuspCosets) (_:ℂ)=>M x) (fun x=>((continuous_fixed_left_summand a v hv s x).mul hchar).aestronglyMeasurable.restrict) (fun x=>(ae_restrict_mem periodDomain_measurable).mono fun z hz=>by simpa only [Pi.mul_apply,norm_mul,breveE_norm,mul_one] using hbound z hz x) (Eventually.of_forall fun _=>hM) (integrable_const (∑'x,M x)) (Eventually.of_forall fun z=>(summable_summand (a*upperSection z v hv) s hs).hasSum.mul_right (ShortDraftTrace.breveE (-freq*z))) end section open MeasureTheory Set Filter open scoped BigOperators Classical ENNReal open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss def oppositeIntegral (v:ℝ) (s freq:ℂ) (c x:_root_.OAI.ActualEisensteinCubic.O):ℂ:= ∫z in periodDomain,oppositeTerm z v s c x*ShortDraftTrace.breveE (-freq*z) theorem hasSum_oppositeIntegrals (v:ℝ) (hv:0oppositeIntegral v s freq p.1.val p.2.val) (∫z in periodDomain,oppositeEisenstein z v hv s*ShortDraftTrace.breveE (-freq*z)):=by have hh:=(oppositeDataEquiv.trans primitiveRowEquiv.symm).hasSum_iff.mpr (hasSum_integral_fixed_left_Eisenstein oppositeMatrix v hv s freq hs) apply hh.congr_fun intro p apply integral_congr_ae exact Eventually.of_forall fun z=>by dsimp only [Equiv.trans_apply] rw [opposite_summand] lemma oppositeTerm_integrable (v:ℝ) (hv:0oppositeTerm z v s c x):=by simp_rw [oppositeTerm_eq_shifted _ v hv s c x hc] exact (shiftedHeightKernel_integrable v hv s _ hs).const_mul _ lemma oppositeIntegral_sum_translate (v:ℝ) (hv:0oppositeTerm z v s c x) (oppositeTerm_integrable v hv s hs c x hc) (cuspFrequency h) rw [integral_eq_period_integrals _ hint] apply tsum_congr intro n apply integral_congr_ae exact Eventually.of_forall fun z=>by dsimp only [oppositeIntegral] rw [oppositeTerm_shift,cuspFrequency_negative_period] lemma oppositeTerm_fourier_integral (v:ℝ) (hv:0oppositeIntegral v s (cuspFrequency h) c.val x.val):= (hasSum_oppositeIntegrals v hv s (cuspFrequency h) hs).summable.sigma_factor c have hsum:=(cubicResidueElementEquiv c.val (primaryLower_ne_zero c)).summable_iff.mpr hf change Summable (fun q:CubicUnitResidue c.val×_root_.OAI.ActualEisensteinCubic.O=> oppositeIntegral v s (cuspFrequency h) c.val (GaussianShiftedPartition.representative c.val q.1.val+c.val*q.2)) at hsum rw [←(cubicResidueElementEquiv c.val (primaryLower_ne_zero c)).tsum_eq] change (∑'q:CubicUnitResidue c.val×_root_.OAI.ActualEisensteinCubic.O, oppositeIntegral v s (cuspFrequency h) c.val (GaussianShiftedPartition.representative c.val q.1.val+c.val*q.2))=_ rw [hsum.tsum_prod] change (∑'r:CubicUnitResidue c.val,∑'n:_root_.OAI.ActualEisensteinCubic.O, oppositeIntegral v s (cuspFrequency h) c.val (GaussianShiftedPartition.representative c.val r.val+c.val*n))=_ simp_rw [oppositeIntegral_sum_translate v hv s (by linarith) h c.val _ (primaryLower_ne_zero c), oppositeTerm_fourier_integral v hv s (cuspFrequency h) c.val _ (primaryLower_ne_zero c)] exact tsum_mul_left lemma unramifiedCubicGaussSeries_twentySeven (s:ℂ) (h:_root_.OAI.ActualEisensteinCubic.O): unramifiedCubicGaussSeries s (27*h)=unramifiedCubicGaussSeries s h:=by apply tsum_congr intro I congr 1 have hp:lambda^2∣primaryGenerator I.val-1:=(primaryGenerator_spec I.val I.2).2 simpa only [show (3:_root_.OAI.ActualEisensteinCubic.O)^3=27 by norm_num,mul_comm h 27] using cubicUnitGaussSum_cube_shift h (primaryGenerator I.val) 3 I.2 hp (primary_coprime_three _ hp) theorem oppositeEisenstein_fourier (v:ℝ) (hv:0 measurableSet_Ioc) lemma periodIocCube_ae : periodCube=ᵐ[volume]periodIocCube := by simpa only [periodIocCube,zero_add] using periodCube_ae_Ioc def periodSection (t : UnitAddTorus (Fin 2)) : ℂ := periodVector ((UnitAddTorus.measurableEquivPiIoc (fun _ : Fin 2 => (0:ℝ)) t).val) lemma periodSection_measurableEmbedding : MeasurableEmbedding periodSection := periodVector.toHomeomorph.toMeasurableEquiv.measurableEmbedding.comp ((MeasurableEmbedding.subtype_coe periodIocCube_measurable).comp (UnitAddTorus.measurableEquivPiIoc (fun _ : Fin 2 => (0:ℝ))).measurableEmbedding) lemma periodTorus_measurable : Measurable periodTorus := by apply measurable_pi_iff.mpr intro i exact AddCircle.measurable_mk'.comp ((measurable_pi_apply i).comp periodBasis.equivFunL.continuous.measurable) lemma periodTorus_section (t : UnitAddTorus (Fin 2)) : periodTorus (periodSection t)=t := by rw [periodSection,periodTorus_periodVector] exact (UnitAddTorus.measurableEquivPiIoc (fun _ : Fin 2 => (0:ℝ))).symm_apply_apply t lemma periodVector_Ioc_measurePreserving : MeasurePreserving periodVector (volume.restrict periodIocCube) (periodCovolumeDensity • volume.restrict periodDomain) := by refine ⟨periodVector.continuous.measurable,?_⟩ rw [←Measure.restrict_congr_set periodIocCube_ae,←periodVector_preimage_domain, ←Measure.restrict_map periodVector.continuous.measurable periodDomain_measurable, periodVector_map_volume,Measure.restrict_smul] rfl lemma periodSection_measurePreserving : letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 MeasurePreserving periodSection volume (periodCovolumeDensity • volume.restrict periodDomain) := letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 periodVector_Ioc_measurePreserving.comp ((measurePreserving_subtype_coe periodIocCube_measurable).comp (UnitAddTorus.measurePreserving_equivPiIoc (fun _ : Fin 2 => (0:ℝ)))) lemma periodTorus_measurePreserving : letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 MeasurePreserving periodTorus (periodCovolumeDensity • volume.restrict periodDomain) volume := letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 by refine ⟨periodTorus_measurable,?_⟩ rw [←periodSection_measurePreserving.map_eq, Measure.map_map periodTorus_measurable periodSection_measurableEmbedding.measurable] have he : periodTorus ∘ periodSection=id := funext periodTorus_section rw [he,Measure.map_id] lemma periodSection_torus_ae : (fun z => periodSection (periodTorus z))=ᵐ[volume.restrict periodDomain] (fun z : ℂ => z) := letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 by apply (Measure.ae_ennreal_smul_measure_iff periodCovolumeDensity_ne_zero).mp rw [←periodSection_measurePreserving.map_eq] apply periodSection_measurableEmbedding.ae_map_iff.mpr exact Eventually.of_forall (fun t => by dsimp only; rw [periodTorus_section]) lemma periodSection_memLp (f : ℂ→ℂ) (hf : MemLp f 2 (volume.restrict periodDomain)) : letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 MemLp (f ∘ periodSection) 2 volume := letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 (hf.smul_measure (by simp [periodCovolumeDensity])).comp_measurePreserving periodSection_measurePreserving def periodTorusL2Lift (f : ℂ→ℂ) (hf : MemLp f 2 (volume.restrict periodDomain)) : letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 PeriodTorusL2 := letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 (periodSection_memLp f hf).toLp (f ∘ periodSection) lemma periodTorusL2Lift_ae (f : ℂ→ℂ) (hf : MemLp f 2 (volume.restrict periodDomain)) : letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 periodTorusL2Lift f hf=ᵐ[volume]f ∘ periodSection := letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 MemLp.coeFn_toLp (periodSection_memLp f hf) lemma periodTorusL2Lift_pullback (f : ℂ→ℂ) (hf : MemLp f 2 (volume.restrict periodDomain)) : letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 (fun z => periodTorusL2Lift f hf (periodTorus z))=ᵐ[volume.restrict periodDomain]f := letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 by have he := periodTorus_measurePreserving.quasiMeasurePreserving.ae_eq_comp (periodTorusL2Lift_ae f hf) have he' := (Measure.ae_ennreal_smul_measure_iff periodCovolumeDensity_ne_zero).mp he filter_upwards [he',periodSection_torus_ae] with z hz hsec change periodTorusL2Lift f hf (periodTorus z)=f (periodSection (periodTorus z)) at hz rw [hsec] at hz exact hz lemma periodTorusL2Lift_frequency_integral (f : ℂ→ℂ) (hf : MemLp f 2 (volume.restrict periodDomain)) (h : ActualEisensteinCubic.O) : letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 (∫z in periodDomain,periodTorusL2Lift f hf (periodTorus z)* ShortDraftTrace.breveE (-cuspFrequency h*z))= ∫z in periodDomain,f z*ShortDraftTrace.breveE (-cuspFrequency h*z) := letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 by apply integral_congr_ae filter_upwards [periodTorusL2Lift_pullback f hf] with z hz rw [hz] theorem periodDomain_L2_ext (f g : ℂ→ℂ) (hf : MemLp f 2 (volume.restrict periodDomain)) (hg : MemLp g 2 (volume.restrict periodDomain)) (h : ∀h : ActualEisensteinCubic.O, (∫z in periodDomain,f z*ShortDraftTrace.breveE (-cuspFrequency h*z))= ∫z in periodDomain,g z*ShortDraftTrace.breveE (-cuspFrequency h*z)) : f=ᵐ[volume.restrict periodDomain]g := letI explicitWitness11 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_1 by have he : periodTorusL2Lift f hf=periodTorusL2Lift g hg := by apply periodTorus_L2_ext intro hfreq rw [periodTorusL2Lift_frequency_integral,periodTorusL2Lift_frequency_integral,h] filter_upwards [periodTorusL2Lift_pullback f hf,periodTorusL2Lift_pullback g hg] with z hz hz' rw [←hz,←hz',he] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ResidualFourierExpansion /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding section namespace RootNotationResidualFourierExpansion01 abbrev O := ActualEisensteinCubic.O end RootNotationResidualFourierExpansion01 open RootNotationResidualFourierExpansion01 (O) lemma cubicResidualFullMode_density_integrable (a b : ℝ) (ha : 0 cubicResidualFullModeAmplitude v h/(v:ℂ)^3) (Set.Icc a b) volume := by by_cases hh : h=0 · subst h have hi : IntegrableOn (fun v : ℝ => (3*(Real.pi:ℂ))*constantArithmeticResidue*(v:ℂ)^(-(7/3:ℂ))) (Set.Icc a b) volume := by apply ContinuousOn.integrableOn_Icc intro v hv exact (continuousAt_const.mul (Complex.continuousAt_ofReal_cpow_const v (-(7/3:ℂ)) (Or.inr (ha.trans_le hv.1).ne'))).continuousWithinAt apply hi.congr filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv exact (cubicResidualFullModeAmplitude_zero_density v (ha.trans_le hv.1)).symm · apply ((cubicBesselHeight_integrable a b ha h hh).const_mul (cubicResidualFourierCoefficient h)).congr filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv exact (cubicResidualFullModeAmplitude_nonzero_density v (ha.trans_le hv.1) h hh).symm lemma cubicEisensteinResidue_slice_coefficient_ae (a b : ℝ) (ha : 0 ((9*Real.sqrt 3/2:ℝ):ℂ)*(cubicResidualFullModeAmplitude v h/(v:ℂ)^3)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply interval_ae_eq_of_boundedContinuous_height_tests a b _ _ (kernelCuspSliceCoefficient_integrable a b ha h cubicEisensteinResidue) ((cubicResidualFullMode_density_integrable a b ha h).const_mul _) intro ρ rw [←kernelCuspHeightFourier_eq_slice_integral a b ha ρ h cubicEisensteinResidue, kernelCuspHeightFourier_residue_full a b ha ρ h,←integral_const_mul] apply integral_congr_ae exact Eventually.of_forall (fun v => by ring) lemma cubicEisensteinResidue_all_slice_coefficients_ae (a b : ℝ) (ha : 0 cubicEisensteinResidue_slice_coefficient_ae a b ha h) lemma cubicEisensteinResidue_all_fourier_integrals_ae (a b : ℝ) (ha : 0 cubicResidualFunction (upperPoint z v hv)) := by have hc := cubicResidualNonzeroSeries_height_continuous v hv simp only [cubicResidualFunction,cubicResidualNonzeroFunction, hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint] fun_prop lemma cubicResidualFunction_height_memLp (v : ℝ) (hv : 0 cubicResidualFunction (cuspCoordinateLift (v,z))) 2 (volume.restrict periodDomain) := by simp_rw [cuspCoordinateLift_positive v _ hv] have hc := cubicResidualFunction_height_continuous v hv apply (memLp_two_iff_integrable_sq_norm hc.aestronglyMeasurable).mpr have hn : Continuous (fun z : ℂ => ‖cubicResidualFunction (upperPoint z v hv)‖^2) := by fun_prop apply (hn.continuousOn.integrableOn_compact (isCompact_closedBall (0:ℂ) (∑i,‖periodBasis i‖))).mono_set intro z hz simpa only [Metric.mem_closedBall,dist_zero_right] using norm_mem_periodDomain z hz theorem cubicEisensteinResidue_cell_slices_ae (a b : ℝ) (ha : 0 cubicEisensteinResidue (integralOrbitProjection globalKubotaKernel (cuspCoordinateLift (v,z)))) =ᵐ[volume.restrict periodDomain] (fun z => cubicResidualFunction (cuspCoordinateLift (v,z))) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by filter_upwards [cubicEisensteinResidue_all_fourier_integrals_ae a b ha, kernelCuspSections_memLp a b ha cubicEisensteinResidue, ae_restrict_mem measurableSet_Icc] with v hfour hL hv have hpos : 0 by have hm := spatialComplexSplit_preserves_volume.restrict_preimage (s := Set.Ioi (0:ℝ) ×ˢ (Set.univ : Set ℂ)) (measurableSet_Ioi.prod MeasurableSet.univ) have htarget : (volume : Measure (ℝ × ℂ)).restrict (Set.Ioi 0 ×ˢ (Set.univ : Set ℂ)) = (volume.restrict (Set.Ioi (0:ℝ))).prod (volume : Measure ℂ) := by rw [Measure.volume_eq_prod,←Measure.prod_restrict,Measure.restrict_univ] have hsource : spatialComplexSplit ⁻¹' (Set.Ioi (0:ℝ) ×ˢ (Set.univ : Set ℂ)) = euclideanUpperHalf := by ext p simp only [Set.mem_preimage,Set.mem_prod,Set.mem_univ,and_true,Set.mem_Ioi, spatialComplexSplit_fst,euclideanUpperHalf,Set.mem_ofPred_eq] rw [htarget,hsource] at hm have heuc := hm.quasiMeasurePreserving.ae he have heuc' : ∀ᵐp ∂volume.restrict euclideanUpperHalf, f (euclideanToHyperbolic p)=g (euclideanToHyperbolic p) := by simpa only [cuspCoordinateLift,spatialComplexSplit.symm_apply_apply] using heuc have hweighted : ∀ᵐp ∂hyperbolicEuclideanVolume, f (euclideanToHyperbolic p)=g (euclideanToHyperbolic p) := heuc'.filter_mono (withDensity_absolutelyContinuous (volume.restrict euclideanUpperHalf) hyperbolicDensity).ae_le change ∀ᵐw ∂Measure.map euclideanToHyperbolic hyperbolicEuclideanVolume,f w=g w exact (ae_map_iff euclideanToHyperbolic_measurable.aemeasurable (measurableSet_eq_fun hf hg)).mpr hweighted lemma hyperbolic_eq_ae_of_period_cells (f g : HyperbolicSpace→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hf : Measurable f) (hg : Measurable g) (hfp : ∀(v : ℝ)(hv : 0 f (cuspCoordinateLift (v,z)))=ᵐ[volume.restrict periodDomain] (fun z => g (cuspCoordinateLift (v,z)))), f=ᵐ[hyperbolicVolume]g := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hf : Measurable f) (hg : Measurable g) (hfp : ∀(v : ℝ)(hv : 0 f (cuspCoordinateLift (v,z)))=ᵐ[volume.restrict periodDomain] (fun z => g (cuspCoordinateLift (v,z)))) => by have hplanes (a b : ℝ) (ha : 0 cubicEisensteinResidue (integralOrbitProjection globalKubotaKernel w)) =ᵐ[hyperbolicVolume] cubicResidualFunction := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by apply hyperbolic_eq_ae_of_period_cells _ _ ((MeasureTheory.Lp.stronglyMeasurable cubicEisensteinResidue).measurable.comp (measurable_integralOrbitProjection _)) cubicResidualFunction_continuous.measurable · intro v hv z n exact congrArg cubicEisensteinResidue (kernelProjection_upper_period v hv z n) · exact cubicResidualFunction_period · exact cubicEisensteinResidue_cell_slices_ae end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise open Finset AddChar MulChar EisensteinEmbedding lemma kernelProjection_quasiMeasurePreserving : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measure.QuasiMeasurePreserving (integralOrbitProjection globalKubotaKernel) hyperbolicVolume (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by let := integralSubgroupHyperbolicAction globalKubotaKernel let := integralSLCountable let := integralSubgroupMeasurableAction globalKubotaKernel let := integralSubgroupVolumeInvariant globalKubotaKernel let proj := integralOrbitProjection globalKubotaKernel have hp : Measurable proj := measurable_integralOrbitProjection _ refine ⟨hp,Measure.AbsolutelyContinuous.mk fun S hS hzero => ?_⟩ rw [Measure.map_apply hp hS] have hd : hyperbolicVolume ((proj ⁻¹' S)∩hyperbolicFundamentalSet globalKubotaKernel)=0 := by simpa only [integralQuotientVolume,proj, Measure.map_apply (measurable_integralOrbitProjection _) hS, Measure.restrict_apply ((measurable_integralOrbitProjection _) hS)] using hzero have hinv : ∀M : globalKubotaKernel,M • (proj ⁻¹' S)=proj ⁻¹' S := by intro M ext w constructor · rintro ⟨u,hu,rfl⟩ change proj (M • u)∈S change proj u∈S at hu rwa [show proj (M • u)=proj u from integralOrbitProjection_eq _ M u] · intro hw refine ⟨M⁻¹ • w,?_,smul_inv_smul M w⟩ change proj (M⁻¹ • w)∈S rwa [show proj (M⁻¹ • w)=proj w from integralOrbitProjection_eq _ M⁻¹ w] exact globalKubotaKernel_isFundamentalDomain.measure_zero_of_invariant (proj ⁻¹' S) hinv hd lemma kernelLevel_character_ae_on_hyperbolic (F : KernelQuotientL2) (M : CubicKubota.levelThree) (hchar : kernelLevelPullback M F=CubicKubota.complexCharacter M • F) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (fun w : HyperbolicSpace => F (integralOrbitProjection globalKubotaKernel (complexMatrix M • w))) =ᵐ[hyperbolicVolume] (fun w => CubicKubota.complexCharacter M* F (integralOrbitProjection globalKubotaKernel w)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have he : (fun q => F (kernelLevelAction M q)) =ᵐ[integralQuotientVolume globalKubotaKernel] (fun q => CubicKubota.complexCharacter M*F q) := by filter_upwards [kernelLevelPullback_ae_eq M F, Lp.coeFn_smul (CubicKubota.complexCharacter M) F] with q hq hs rw [hchar] at hq exact hq.symm.trans hs have hl := kernelProjection_quasiMeasurePreserving.ae_eq_comp he simpa only [Function.comp_def,kernelLevelAction_mk] using hl lemma kernelLevel_character_continuous_representative (F : KernelQuotientL2) (f : HyperbolicSpace→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_hyperbolicVolume_fullSupport := @OAI.CubicEisenstein.hyperbolicVolume_fullSupport letI rootPolicy_fullSLMeasurableAction := @OAI.CubicEisenstein.fullSLMeasurableAction letI rootPolicy_fullSLVolumeInvariant := @OAI.CubicEisenstein.fullSLVolumeInvariant ∀ (hf : Continuous f) (hrep : (fun w => F (integralOrbitProjection globalKubotaKernel w)) =ᵐ[hyperbolicVolume] f) (M : CubicKubota.levelThree) (hchar : kernelLevelPullback M F=CubicKubota.complexCharacter M • F) (w : HyperbolicSpace), f (complexMatrix M • w)=CubicKubota.complexCharacter M*f w := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_hyperbolicVolume_fullSupport := @OAI.CubicEisenstein.hyperbolicVolume_fullSupport letI rootPolicy_fullSLMeasurableAction := @OAI.CubicEisenstein.fullSLMeasurableAction letI rootPolicy_fullSLVolumeInvariant := @OAI.CubicEisenstein.fullSLVolumeInvariant fun (hf : Continuous f) (hrep : (fun w => F (integralOrbitProjection globalKubotaKernel w)) =ᵐ[hyperbolicVolume] f) (M : CubicKubota.levelThree) (hchar : kernelLevelPullback M F=CubicKubota.complexCharacter M • F) (w : HyperbolicSpace) => by have hcomp := (measurePreserving_smul (complexMatrix M) hyperbolicVolume).quasiMeasurePreserving.ae_eq_comp hrep have he : (fun p : HyperbolicSpace => f (complexMatrix M • p)) =ᵐ[hyperbolicVolume] (fun p => CubicKubota.complexCharacter M*f p) := by filter_upwards [hcomp,kernelLevel_character_ae_on_hyperbolic F M hchar,hrep] with p hp hc hr exact hp.symm.trans (hc.trans (congrArg (fun z => CubicKubota.complexCharacter M*z) hr)) have hfun := Measure.eq_of_ae_eq he (hf.comp (continuous_hyperbolic_action (complexMatrix M))) (continuous_const.mul hf) exact congrFun hfun w end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open Finset AddChar MulChar EisensteinEmbedding theorem cubicResidualFunction_automorphy (M : CubicKubota.levelThree) (w : HyperbolicSpace) : cubicResidualFunction (complexMatrix M • w)= CubicKubota.complexCharacter M*cubicResidualFunction w := kernelLevel_character_continuous_representative cubicEisensteinResidue cubicResidualFunction cubicResidualFunction_continuous cubicEisensteinResidue_continuous_representative M (cubicEisensteinResidue_character M) w open CubicKubota lemma sourceProjection_continuous (f : HyperbolicSpace→ℂ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf : Continuous f), Continuous (sourceProjection f) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hf : Continuous f) => by unfold sourceProjection apply continuous_const.mul apply continuous_finsetSum intro q hq exact hf.comp (continuous_hyperbolic_action _) lemma sourceProjection_congr_ae (f g : HyperbolicSpace→ℂ) (h : f=ᵐ[hyperbolicVolume]g) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_fullSLMeasurableAction := @OAI.CubicEisenstein.fullSLMeasurableAction letI rootPolicy_fullSLVolumeInvariant := @OAI.CubicEisenstein.fullSLVolumeInvariant sourceProjection f=ᵐ[hyperbolicVolume]sourceProjection g := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_fullSLMeasurableAction := @OAI.CubicEisenstein.fullSLMeasurableAction letI rootPolicy_fullSLVolumeInvariant := @OAI.CubicEisenstein.fullSLVolumeInvariant by let : Fintype (levelTwo ⧸ levelThreeInTwo) := sourceQuotientFintype have htrans (q : levelTwo ⧸ levelThreeInTwo) : (fun w => f (integralComplexMatrix (rationalEmbedding (sourceRationalSection q)) • w)) =ᵐ[hyperbolicVolume] (fun w => g (integralComplexMatrix (rationalEmbedding (sourceRationalSection q)) • w)) := (measurePreserving_smul _ hyperbolicVolume).quasiMeasurePreserving.ae_eq_comp h filter_upwards [ae_all_iff.mpr htrans] with w hw unfold sourceProjection dsimp only congr 1 exact Finset.sum_congr rfl (fun q _ => hw q) lemma kernelSourceProjection_hyperbolic_representative (F : KernelQuotientL2) (f : HyperbolicSpace→ℂ) (hrep : (fun w => F (integralOrbitProjection globalKubotaKernel w)) =ᵐ[hyperbolicVolume] f) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (fun w => kernelSourceProjection F (integralOrbitProjection globalKubotaKernel w)) =ᵐ[hyperbolicVolume] sourceProjection f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have he := kernelProjection_quasiMeasurePreserving.ae_eq_comp (kernelSourceProjection_ae_eq F) change (fun w => kernelSourceProjection F (integralOrbitProjection globalKubotaKernel w)) =ᵐ[hyperbolicVolume] sourceProjection (fun w => F (integralOrbitProjection globalKubotaKernel w)) at he exact he.trans (sourceProjection_congr_ae _ _ hrep) def cubicSourceResidualFunction : HyperbolicSpace→ℂ := sourceProjection cubicResidualFunction lemma cubicSourceResidualFunction_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous cubicSourceResidualFunction := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology sourceProjection_continuous cubicResidualFunction cubicResidualFunction_continuous theorem cubicSourceResidualFunction_automorphy (M : levelTwo) (w : HyperbolicSpace) : cubicSourceResidualFunction (integralComplexMatrix (M:SL(2,ActualEisensteinCubic.O)) • w)= levelTwoComplexCharacter M*cubicSourceResidualFunction w := sourceProjection_automorphy cubicResidualFunction cubicResidualFunction_automorphy M w lemma cubicSourceResidualFunction_rational_invariant (M : SL(2,ℤ)) (w : HyperbolicSpace) : cubicSourceResidualFunction (integralComplexMatrix (rationalEmbedding M) • w)= cubicSourceResidualFunction w := by have he := cubicSourceResidualFunction_automorphy (rationalLift M) w rw [levelTwoComplexCharacter_rationalLift,one_mul] at he exact he theorem cubicSourceResidualFunction_represents_projection : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (fun w => kernelSourceProjection cubicEisensteinResidue (integralOrbitProjection globalKubotaKernel w)) =ᵐ[hyperbolicVolume] cubicSourceResidualFunction := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSourceProjection_hyperbolic_representative cubicEisensteinResidue cubicResidualFunction cubicEisensteinResidue_continuous_representative end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open CubicKubota ActualEisensteinCubic ConcreteTraceCRT namespace RootNotationResidualFourierExpansion03 abbrev O := ActualEisensteinCubic.O end RootNotationResidualFourierExpansion03 open RootNotationResidualFourierExpansion03 (O) def rationalUnipotent (t : ℤ) : SL(2,ℤ) := ⟨!![1,t;0,1],by simp [Matrix.det_fin_two]⟩ lemma rationalUnipotent_add (a b : ℤ) : rationalUnipotent (a+b)=rationalUnipotent a*rationalUnipotent b := by apply Subtype.ext change (!![1,a+b;0,1] : Matrix (Fin 2) (Fin 2) ℤ) = (!![1,a;0,1] : Matrix (Fin 2) (Fin 2) ℤ) * !![1,b;0,1] ext i j fin_cases i <;> fin_cases j <;> simp [Matrix.mul_apply,Fin.sum_univ_two,add_comm] lemma rationalUnipotent_zero : rationalUnipotent 0=1 := by apply Matrix.SpecialLinearGroup.ext intro i j fin_cases i <;> fin_cases j <;> simp [rationalUnipotent] lemma rationalUnipotent_one : rationalUnipotent 1=ModularGroup.T := rfl lemma row_unipotent_conjugate (t : ℤ) (M : levelThree) : row (levelThreeConjugate (rationalEmbedding (rationalUnipotent (-t))) M)= Matrix.vecMul (row M) (rationalEmbedding (rationalUnipotent t):SL(2,ActualEisensteinCubic.O)) := by have hmap (u : ℤ) : (rationalEmbedding (rationalUnipotent u) : Matrix (Fin 2) (Fin 2) O) = !![1,(u : O);0,1] := by apply Matrix.ext intro i j change (Int.castRingHom O) ((!![1,u;0,1] : Matrix (Fin 2) (Fin 2) ℤ) i j) = _ fin_cases i <;> fin_cases j <;> simp change ((rationalEmbedding (rationalUnipotent (-t)) * (M : SL(2,O)) * (rationalEmbedding (rationalUnipotent (-t)))⁻¹ : SL(2,O)) : Matrix (Fin 2) (Fin 2) O) 1 = Matrix.vecMul ((M : SL(2,O)) 1) (rationalEmbedding (rationalUnipotent t) : Matrix (Fin 2) (Fin 2) O) simp only [Matrix.SpecialLinearGroup.coe_mul, Matrix.SpecialLinearGroup.coe_inv, hmap, Matrix.adjugate_fin_two] funext j fin_cases j <;> simp [Matrix.mul_apply,Matrix.vecMul,dotProduct,Fin.sum_univ_two] def cuspUnipotentTranslate (t : ℤ) : CuspCosets→CuspCosets := Quotient.map (fun M => levelThreeConjugate (rationalEmbedding (rationalUnipotent (-t))) M) (by intro M N h change row (levelThreeConjugate _ M)=row (levelThreeConjugate _ N) rw [row_unipotent_conjugate,row_unipotent_conjugate,show row M=row N from h]) lemma cuspUnipotentTranslate_inverse (t : ℤ) (x : CuspCosets) : cuspUnipotentTranslate (-t) (cuspUnipotentTranslate t x)=x := by induction x using Quotient.inductionOn with | _ M => change cosetOf (levelThreeConjugate (rationalEmbedding (rationalUnipotent (- -t))) (levelThreeConjugate (rationalEmbedding (rationalUnipotent (-t))) M))=cosetOf M rw [←levelThreeConjugate_mul,←map_mul,←rationalUnipotent_add] simp only [neg_neg,add_neg_cancel,rationalUnipotent_zero,map_one,levelThreeConjugate_one] def cuspUnipotentEquiv (t : ℤ) : CuspCosets≃CuspCosets where toFun := cuspUnipotentTranslate t invFun := cuspUnipotentTranslate (-t) left_inv := cuspUnipotentTranslate_inverse t right_inv x := by simpa only [neg_neg] using cuspUnipotentTranslate_inverse (-t) x lemma cosetRow_cuspUnipotentEquiv (t : ℤ) (x : CuspCosets) : cosetRow (cuspUnipotentEquiv t x)= Matrix.vecMul (cosetRow x) (rationalEmbedding (rationalUnipotent t):SL(2,ActualEisensteinCubic.O)) := by induction x using Quotient.inductionOn with | _ M => exact row_unipotent_conjugate t M lemma cosetCharacter_cuspUnipotentEquiv (t : ℤ) (x : CuspCosets) : cosetCharacter (cuspUnipotentEquiv t x)=cosetCharacter x := by induction x using Quotient.inductionOn with | _ M => exact complexCharacter_conjugate_rational (rationalUnipotent (-t)) M lemma embeddedRow_cuspUnipotentEquiv (t : ℤ) (x : CuspCosets) : embeddedRow (cuspUnipotentEquiv t x)= Matrix.vecMul (embeddedRow x) (integralComplexMatrix (rationalEmbedding (rationalUnipotent t)):SL(2,ℂ)) := by funext j simp only [embeddedRow,Function.comp_def,cosetRow_cuspUnipotentEquiv, Matrix.vecMul,dotProduct,map_sum,map_mul,integralComplexMatrix_apply] lemma summand_unipotent (t : ℤ) (g : SL(2,ℂ)) (s : ℂ) (x : CuspCosets) : summand (integralComplexMatrix (rationalEmbedding (rationalUnipotent t))*g) s x= summand g s (cuspUnipotentEquiv t x) := by rw [summand,summand,cosetCharacter_cuspUnipotentEquiv, embeddedRow_cuspUnipotentEquiv,←rowOperator_apply,rowOperator_mul] theorem eisenstein_unipotent (t : ℤ) (g : SL(2,ℂ)) (s : ℂ) : eisenstein (integralComplexMatrix (rationalEmbedding (rationalUnipotent t))*g) s=eisenstein g s := by unfold eisenstein simp_rw [summand_unipotent] exact (cuspUnipotentEquiv t).tsum_eq _ theorem hyperbolicEisenstein_unipotent (t : ℤ) (s : ℂ) (w : HyperbolicSpace) : hyperbolicEisenstein s (integralComplexMatrix (rationalEmbedding (rationalUnipotent t)) • w)= hyperbolicEisenstein s w := by induction w using Quotient.inductionOn with | _ g => exact eisenstein_unipotent t g s end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ArbitraryCuspPullback /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic CubicKubota ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationArbitraryCuspPullback01 abbrev Eis := ActualEisensteinCubic.O end RootNotationArbitraryCuspPullback01 open RootNotationArbitraryCuspPullback01 (Eis) lemma ramified_omega_relation : omega^2+omega+1=(0:Eis) := by apply eisEmbedding_injective simp only [map_add,map_pow,map_one,map_zero,eisEmbedding_omega_actual] exact EisensteinEmbedding.omega3_sq def lowerCuspMatrix (t : Eis) : SL(2,Eis) := ⟨!![1,0;t,1],by simp [Matrix.det_fin_two]⟩ def ramifiedParabolic (t x : Eis) : levelThree := by let M : SL(2,Eis) := ⟨!![1-3*t*x,3*x;-3*t^2*x,1+3*t*x],by rw [Matrix.det_fin_two] change (1-3*t*x)*(1+3*t*x)-(3*x)*(-3*t^2*x)=1 ring⟩ refine ⟨M,levelThree_of_entries M ?_⟩ intro i j fin_cases i <;> fin_cases j · exact ⟨-t*x,by change 1-3*t*x-1=3*(-t*x);ring⟩ · exact ⟨x,by change 3*x-0=3*x;ring⟩ · exact ⟨-t^2*x,by change -3*t^2*x-0=3*(-t^2*x);ring⟩ · exact ⟨t*x,by change 1+3*t*x-1=3*(t*x);ring⟩ lemma ramifiedParabolic_mul_lower (t x : Eis) : (ramifiedParabolic t x : SL(2,Eis))*lowerCuspMatrix t= lowerCuspMatrix t*(upperTranslation x : SL(2,Eis)) := by apply Subtype.ext change (ramifiedParabolic t x : Matrix (Fin 2) (Fin 2) Eis) * (lowerCuspMatrix t : Matrix (Fin 2) (Fin 2) Eis) = (lowerCuspMatrix t : Matrix (Fin 2) (Fin 2) Eis) * (upperTranslation x : Matrix (Fin 2) (Fin 2) Eis) funext i j fin_cases i <;> fin_cases j <;> simp [ramifiedParabolic,lowerCuspMatrix,upperTranslation,Matrix.mul_apply,Fin.sum_univ_two] <;> ring lemma ramifiedParabolic_character (t x : Eis) : complexCharacter (ramifiedParabolic t x)= eisEmbedding (symbol (-t) (1-3*t*x)) := by simp only [complexCharacter,MonoidHom.comp_apply,character,ramifiedParabolic] apply congrArg eisEmbedding apply symbol_congr refine ⟨t,?_⟩ change (-3*t^2*x)-(-t)=(1-3*t*x)*t ring lemma ramifiedParabolic_omega_value (A B : ℤ) : complexCharacter (ramifiedParabolic omega (ActualEisensteinCoordinates.eval A B))= eisEmbedding (cubicExp (A+B)) := by rw [ramifiedParabolic_character] have hd : 1-3*omega*ActualEisensteinCoordinates.eval A B=primaryCoord B (B-A) := by rw [primaryCoord_eq] change 1-3*omega*((A:Eis)+(B:Eis)*omega)=_ push_cast linear_combination -3*(B:Eis)*ramified_omega_relation rw [hd,symbol_neg_numerator _ _ (primaryCoord_primary _ _), symbol_omega_eq_linearRay _ (primaryCoord_primary _ _),linearRay_primaryCoord] congr 2 ring lemma ramifiedParabolic_omega_sq_value (A B : ℤ) : complexCharacter (ramifiedParabolic (omega^2) (ActualEisensteinCoordinates.eval A B))= eisEmbedding (cubicExp (-(A+B))) := by rw [ramifiedParabolic_character] have hd : 1-3*omega^2*ActualEisensteinCoordinates.eval A B=primaryCoord (A-B) A := by rw [primaryCoord_eq] change 1-3*omega^2*((A:Eis)+(B:Eis)*omega)=_ push_cast linear_combination -3*((A:Eis)+(B:Eis)*omega-(B:Eis))*ramified_omega_relation rw [hd,symbol_neg_numerator _ _ (primaryCoord_primary _ _), symbol_pow_numerator _ _ (primaryCoord_primary _ _) 2, symbol_omega_eq_linearRay _ (primaryCoord_primary _ _),linearRay_primaryCoord] have he : cubicExp (2*((A-B)*2+(-1)*A))=cubicExp (-(A+B)) := by apply cubicExp_eq_of_dvd_sub exact ⟨A-B,by ring⟩ have hs : cubicExp ((A-B)*2+(-1)*A)^2=cubicExp (2*((A-B)*2+(-1)*A)) := by rw [pow_two,←cubicExp_add] congr 1 ring convert congrArg eisEmbedding (hs.trans he) using 1 ; congr 2 ; ring_nf def ramifiedSourceFunction (t : Eis) (w : HyperbolicSpace) : ℂ := cubicSourceResidualFunction (integralComplexMatrix (lowerCuspMatrix t) • w) lemma ramifiedSourceFunction_continuous (t : Eis) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_fullSLContinuousAction := @OAI.CubicEisenstein.fullSLContinuousAction Continuous (ramifiedSourceFunction t) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_fullSLContinuousAction := @OAI.CubicEisenstein.fullSLContinuousAction cubicSourceResidualFunction_continuous.comp (continuous_const_smul _) lemma ramifiedSourceFunction_translate (t x : Eis) (w : HyperbolicSpace) : ramifiedSourceFunction t (complexMatrix (upperTranslation x) • w)= eisEmbedding (symbol (-t) (1-3*t*x))*ramifiedSourceFunction t w := by have he := cubicSourceResidualFunction_automorphy (sourceLevelInclusion (ramifiedParabolic t x)) (integralComplexMatrix (lowerCuspMatrix t) • w) rw [sourceLevelInclusion_character,ramifiedParabolic_character] at he change cubicSourceResidualFunction (integralComplexMatrix (ramifiedParabolic t x : SL(2,Eis)) • (integralComplexMatrix (lowerCuspMatrix t) • w))=_ at he rw [←mul_smul,←map_mul,ramifiedParabolic_mul_lower,map_mul,mul_smul] at he exact he lemma ramifiedSourceFunction_omega_translate (A B : ℤ) (w : HyperbolicSpace) : ramifiedSourceFunction omega (complexMatrix (upperTranslation (ActualEisensteinCoordinates.eval A B)) • w)= eisEmbedding (cubicExp (A+B))*ramifiedSourceFunction omega w := by rw [ramifiedSourceFunction_translate] rw [←ramifiedParabolic_character,ramifiedParabolic_omega_value] lemma ramifiedSourceFunction_omega_sq_translate (A B : ℤ) (w : HyperbolicSpace) : ramifiedSourceFunction (omega^2) (complexMatrix (upperTranslation (ActualEisensteinCoordinates.eval A B)) • w)= eisEmbedding (cubicExp (-(A+B)))*ramifiedSourceFunction (omega^2) w := by rw [ramifiedSourceFunction_translate] rw [←ramifiedParabolic_character,ramifiedParabolic_omega_sq_value] end section open MeasureTheory Filter open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic ConcreteTraceCRT CubicRamified open EisensteinEmbedding (omega3) namespace RootNotationArbitraryCuspPullback02 abbrev Eis := ActualEisensteinCubic.O end RootNotationArbitraryCuspPullback02 open RootNotationArbitraryCuspPullback02 (Eis) lemma embedding_cubicExp (n : ℤ) : eisEmbedding (cubicExp n)=Complex.exp (2*Real.pi*Complex.I*(n:ℂ)/3) := by have hw : omega3=Complex.exp (2*Real.pi*Complex.I/3) := by rw [←TraceLambdaPhase.exp_minus_four_pi_div_three] apply Complex.exp_eq_exp_iff_exists_int.mpr exact ⟨-1,by push_cast;ring⟩ rw [cubicExp,map_pow,eisEmbedding_omega_actual,hw,←Complex.exp_nat_mul] apply Complex.exp_eq_exp_iff_exists_int.mpr refine ⟨-(n/3),?_⟩ have hn : (n%3).toNat=(n%3) := Int.toNat_of_nonneg (Int.emod_nonneg _ (by norm_num)) have hnc : ((n%3).toNat:ℂ)=((n%3:ℤ):ℂ) := by exact_mod_cast hn have he : ((n%3:ℤ):ℂ)=(n:ℂ)-3*((n/3:ℤ):ℂ) := by have he0 : n%3=n-3*(n/3) := by omega exact_mod_cast he0 rw [hnc,he] push_cast ring def ramifiedShift10 : ℂ := eisEmbedding (omega-1)/(9*eisLam) def ramifiedShift19 : ℂ := eisEmbedding (-2-omega)/(9*eisLam) lemma ramifiedShift10_period (A B : ℤ) : ShortDraftTrace.breveE (ramifiedShift10*(3*eisEmbedding (ActualEisensteinCoordinates.eval A B)))= eisEmbedding (cubicExp (A+B)) := by have he : ramifiedShift10*(3*eisEmbedding (ActualEisensteinCoordinates.eval A B))= eisEmbedding ((omega-1)*ActualEisensteinCoordinates.eval A B)/eisLam/3 := by rw [ramifiedShift10,map_mul] ring have ht := breveE_real_trace_of_O (3:ℝ) ((omega-1)*ActualEisensteinCoordinates.eval A B) norm_num only [Complex.ofReal_ofNat] at ht rw [he,ht] have hcoords : (ActualEisensteinCoordinates.coords ((omega-1)*ActualEisensteinCoordinates.eval A B)).2=A-2*B := by have hw : omega-1=ActualEisensteinCoordinates.eval (-1) 1 := by simp only [ActualEisensteinCoordinates.eval,Int.cast_neg,Int.cast_one,one_mul] change omega-1=-1+omega ring rw [hw,ActualEisensteinCoordinates.eval_mul,ShortDraftLatticeCount.coords_eval] ring rw [hcoords,←embedding_cubicExp] exact congrArg eisEmbedding (cubicExp_eq_of_dvd_sub ⟨-B,by ring⟩) lemma ramifiedShift19_period (A B : ℤ) : ShortDraftTrace.breveE (ramifiedShift19*(3*eisEmbedding (ActualEisensteinCoordinates.eval A B)))= eisEmbedding (cubicExp (-(A+B))) := by have he : ramifiedShift19*(3*eisEmbedding (ActualEisensteinCoordinates.eval A B))= eisEmbedding ((-2-omega)*ActualEisensteinCoordinates.eval A B)/eisLam/3 := by rw [ramifiedShift19,map_mul] ring have ht := breveE_real_trace_of_O (3:ℝ) ((-2-omega)*ActualEisensteinCoordinates.eval A B) norm_num only [Complex.ofReal_ofNat] at ht rw [he,ht] have hcoords : (ActualEisensteinCoordinates.coords ((-2-omega)*ActualEisensteinCoordinates.eval A B)).2=-(A+B) := by have hw : -2-omega=ActualEisensteinCoordinates.eval (-2) (-1) := by simp only [ActualEisensteinCoordinates.eval,Int.cast_neg,Int.cast_one,Int.cast_ofNat,neg_mul,one_mul] change -2-omega=-2+-omega ring rw [hw,ActualEisensteinCoordinates.eval_mul,ShortDraftLatticeCount.coords_eval] ring rw [hcoords,embedding_cubicExp] lemma ramifiedSourceFunction_upper_shift10 (x : Eis) (z : ℂ) (v : ℝ) (hv : 0(g:HyperbolicSpace)) (upperTranslation_section (ActualEisensteinCoordinates.eval A B) z v hv).symm rw [he,ramifiedSourceFunction_omega_translate] lemma ramifiedSourceFunction_upper_shift19 (x : Eis) (z : ℂ) (v : ℝ) (hv : 0(g:HyperbolicSpace)) (upperTranslation_section (ActualEisensteinCoordinates.eval A B) z v hv).symm rw [he,ramifiedSourceFunction_omega_sq_translate] end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups ENNReal def arbitraryCuspCompact (M : SL(2,ℂ)) (a b : ℝ) : Set HyperbolicSpace := (M • ·) '' cuspHeightCompact a b lemma arbitraryCuspCompact_isCompact (M : SL(2,ℂ)) (a b : ℝ) (ha : 0 F (integralOrbitProjection globalKubotaKernel (M • w)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have h1 := dominatedComplexL2_ae (by simp : (1:ℝ≥0∞)≠⊤) (arbitraryCusp_image_restrict_le M a b ha) (kernelCompactPullbackCLM (arbitraryCuspCompact M a b) (arbitraryCuspCompact_isCompact M a b ha) F) have h2 := (Measure.absolutelyContinuous_of_le_smul (arbitraryCusp_image_restrict_le M a b ha)).ae_eq (kernelCompactPullbackCLM_ae (arbitraryCuspCompact M a b) (arbitraryCuspCompact_isCompact M a b ha) F) exact (Lp.coeFn_compMeasurePreserving _ (arbitraryCusp_smul_measurePreserving M a b)).trans ((arbitraryCusp_smul_measurePreserving M a b).quasiMeasurePreserving.ae_eq_comp (h1.trans h2)) lemma arbitraryCusp_quasiMeasurePreserving (M : SL(2,ℂ)) (a b : ℝ) (ha : 0 integralOrbitProjection globalKubotaKernel (M • w)) (hyperbolicVolume.restrict (cuspPeriodStrip a b)) (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hcompact : Measure.QuasiMeasurePreserving (integralOrbitProjection globalKubotaKernel) (hyperbolicVolume.restrict (arbitraryCuspCompact M a b)) (integralQuotientVolume globalKubotaKernel) := ⟨measurable_integralOrbitProjection _,Measure.absolutelyContinuous_of_le_smul (kernelCompactMultiplicity_spec _ (arbitraryCuspCompact_isCompact M a b ha))⟩ have himage : Measure.QuasiMeasurePreserving (integralOrbitProjection globalKubotaKernel) (hyperbolicVolume.restrict ((M • ·) '' cuspPeriodStrip a b)) (integralQuotientVolume globalKubotaKernel) := ⟨hcompact.measurable,((Measure.absolutelyContinuous_of_le_smul (arbitraryCusp_image_restrict_le M a b ha)).map (measurable_integralOrbitProjection _)).trans hcompact.absolutelyContinuous⟩ exact himage.comp (arbitraryCusp_smul_measurePreserving M a b).quasiMeasurePreserving def arbitraryCuspQuotientCompact (M : SL(2,ℂ)) (a b : ℝ) : Set KernelQuotient := integralOrbitProjection globalKubotaKernel '' arbitraryCuspCompact M a b lemma arbitraryCuspQuotientCompact_isCompact (M : SL(2,ℂ)) (a b : ℝ) (ha : 0 Complex.exp (2*Real.pi*Complex.I*((-freq*hyperbolicHorizontal w)+ starRingEnd ℂ (-freq*hyperbolicHorizontal w)))) have hh := hyperbolicHorizontal_continuous fun_prop lemma arbitraryCuspWeightedPhase_bound (ρ : BoundedContinuousFunction ℝ ℂ) (freq : ℂ) (w : HyperbolicSpace) : ‖arbitraryCuspWeightedPhase ρ freq w‖≤‖ρ‖ := by rw [arbitraryCuspWeightedPhase,norm_mul,breveE_norm,mul_one] exact ρ.norm_coe_le_norm _ lemma arbitraryCuspFourierTest_memLp (a b : ℝ) (ha : 0 star (arbitraryCuspWeightedPhase ρ freq w)) 2 (hyperbolicVolume.restrict (cuspPeriodStrip a b)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let := cuspPeriodStripFiniteVolume a b ha apply MemLp.of_bound (arbitraryCuspWeightedPhase_continuous ρ freq).star.aestronglyMeasurable ‖ρ‖ exact Eventually.of_forall (fun w => by rw [norm_star];exact arbitraryCuspWeightedPhase_bound ρ freq w) def arbitraryCuspFourierTestL2 (a b : ℝ) (ha : 0 star (arbitraryCuspWeightedPhase ρ freq w)) def arbitraryCuspHeightFourier (M : SL(2,ℂ)) (a b : ℝ) (ha : 0 z*arbitraryCuspWeightedPhase ρ freq w) (hw.trans (Set.indicator_of_mem (arbitraryCusp_mem_compact M a b ha w hwm) _)) def arbitraryCuspHeightFamily (M : SL(2,ℂ)) (a b : ℝ) (ha : 0 (s-4/3)*arbitraryCuspHeightFamily M a b ha ρ freq s) (𝓝[≠] (4/3:ℂ)) (𝓝 (arbitraryCuspHeightFourier M a b ha ρ freq cubicEisensteinResidue)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let arbitraryCuspHeightFourier_restrict := fun F => OAI.CubicEisenstein.arbitraryCuspHeightFourier_restrict M a b ha ρ freq F have hh := (arbitraryCuspHeightFourier M a b ha ρ freq).continuous.continuousAt.tendsto.comp (cubicEisensteinResidue_local_limit _ (arbitraryCuspQuotientCompact_isCompact M a b ha)) simpa only [Function.comp_def,map_smul,smul_eq_mul,arbitraryCuspHeightFourier_restrict, arbitraryCuspHeightFamily] using hh lemma arbitraryCuspHeightFamily_initial (M : SL(2,ℂ)) (a b : ℝ) (ha : 0 by have h1 := kernelLocalCorrectedSeed_ae_eq S hS a b (by linarith) hab s have h2 := kernelLocalCorrectedSeed_ae_eq S hS c d (by linarith) hcd s have h3 := kernelEisensteinL2Correction_initial_overlap a b ha hab s hs hi have h4 := kernelEisensteinL2Correction_initial_overlap c d hc hcd s hs hi apply Lp.ext filter_upwards [h1,h2,h3,h4] with q hq1 hq2 hq3 hq4 rw [hq1,hq2] by_cases hq : q∈S · simp only [Set.indicator_of_mem hq,kernelCorrectedSeed,hq3,hq4] ring · simp only [Set.indicator_of_notMem hq] lemma kernelLocalCorrectedSeed_cutoff_eq (S : Set KernelQuotient) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hS : IsCompact S) (a b c d : ℝ) (ha : 1 by have h1 : AnalyticOnNhd ℂ (kernelLocalCorrectedSeed S hS a b (by linarith) hab) cuspUpperParameterRegion := by intro s hs exact kernelLocalCorrectedSeed_analyticAt_nonreal S hS a b (by linarith) hab s (by linarith [hs.1]) hs.2.ne' have h2 : AnalyticOnNhd ℂ (kernelLocalCorrectedSeed S hS c d (by linarith) hcd) cuspUpperParameterRegion := by intro s hs exact kernelLocalCorrectedSeed_analyticAt_nonreal S hS c d (by linarith) hcd s (by linarith [hs.1]) hs.2.ne' have hV : IsOpen {s : ℂ | 4 by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel dsimp only have h1 := (kernelLocalCorrectedSeed_residue_limit S hS a b (by linarith) hab).comp thetaApproach_tendsto_complex_punctured have h2 := (kernelLocalCorrectedSeed_residue_limit S hS c d (by linarith) hcd).comp thetaApproach_tendsto_complex_punctured have he : (fun t : ℝ => ((4/3:ℂ)+(t:ℂ)+(t:ℂ)*Complex.I-4/3) • kernelLocalCorrectedSeed S hS a b (by linarith) hab ((4/3:ℂ)+(t:ℂ)+(t:ℂ)*Complex.I)) =ᶠ[𝓝[>] (0:ℝ)] (fun t : ℝ => ((4/3:ℂ)+(t:ℂ)+(t:ℂ)*Complex.I-4/3) • kernelLocalCorrectedSeed S hS c d (by linarith) hcd ((4/3:ℂ)+(t:ℂ)+(t:ℂ)*Complex.I)) := by filter_upwards [self_mem_nhdsWithin] with t ht change 0 simp [] <;> linarith)] exact tendsto_nhds_unique h1 (h2.congr' he.symm) lemma kernelL2_eq_of_compact_restrictions (F G : KernelQuotientL2) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (h : let _ : BorelSpace KernelQuotient := kernelQuotientBorel; let _ : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel; ∀S : Set KernelQuotient, ∀hS : IsCompact S, kernelMassRestrictionCLM S hS.measurableSet F= kernelMassRestrictionCLM S hS.measurableSet G), F=G := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (h : let _ : BorelSpace KernelQuotient := kernelQuotientBorel; let _ : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel; ∀S : Set KernelQuotient, ∀hS : IsCompact S, kernelMassRestrictionCLM S hS.measurableSet F= kernelMassRestrictionCLM S hS.measurableSet G) => by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel let S : ℕ→Set KernelQuotient := fun n => {q | kernelQuotientBarrier 2 3 q≤n} have hS (n : ℕ) : IsCompact (S n) := kernelBarrier_sublevel_isCompact n have he (n : ℕ) : ∀ᵐq∂integralQuotientVolume globalKubotaKernel, q∈S n → F q=G q := by have hi := h (S n) (hS n) have hf := kernelMassRestriction_coe (S n) (hS n).measurableSet F have hg := kernelMassRestriction_coe (S n) (hS n).measurableSet G filter_upwards [hf,hg] with q hf hg hq rw [Set.indicator_of_mem hq] at hf hg change kernelMassRestrictionCLM (S n) (hS n).measurableSet F q=F q at hf change kernelMassRestrictionCLM (S n) (hS n).measurableSet G q=G q at hg rw [hi] at hf exact hf.symm.trans hg apply Lp.ext filter_upwards [ae_all_iff.mpr he] with q hq obtain ⟨n,hn⟩ := exists_nat_ge (kernelQuotientBarrier 2 3 q) exact hq n hn theorem kernelEisensteinResidueVector_cutoff_independent (a b c d : ℝ) (ha : 1 simpa using rationalUnipotent_zero | succ n ih => rw [Nat.cast_add,Nat.cast_one,rationalUnipotent_add,ih,rationalUnipotent_one,pow_succ] lemma rationalComplex_S_sq_row (v : Fin 2→ℂ) : rowOperator (rationalComplex (ModularGroup.S^2)) v = -v := by have hS : ((ModularGroup.S ^ 2 : SL(2,ℤ)) : Matrix (Fin 2) (Fin 2) ℤ) = !![-1,0;0,-1] := by decide have hC : (rationalComplex (ModularGroup.S ^ 2) : Matrix (Fin 2) (Fin 2) ℂ) = !![-1,0;0,-1] := by apply Matrix.ext intro i j change eisEmbedding ((Int.castRingHom O) ((ModularGroup.S ^ 2 : SL(2,ℤ)) i j)) = _ rw [congrFun (congrFun hS i) j] fin_cases i <;> fin_cases j <;> simp rw [rowOperator_apply,hC] funext j fin_cases j <;> simp [Matrix.vecMul,dotProduct,Fin.sum_univ_two] lemma hyperbolicEisenstein_S_sq (s : ℂ) (w : HyperbolicSpace) : hyperbolicEisenstein s (rationalComplex (ModularGroup.S^2) • w)=hyperbolicEisenstein s w := by induction w using Quotient.inductionOn with | _ g => change eisenstein (rationalComplex (ModularGroup.S^2)*g) s=eisenstein g s apply tsum_congr intro x unfold summand rw [←rowOperator_mul,rationalComplex_S_sq_row,map_neg] simp [rowEnergy] lemma hyperbolicEisenstein_T_pow (s : ℂ) (n : ℕ) (w : HyperbolicSpace) : hyperbolicEisenstein s (rationalComplex (ModularGroup.T^n) • w)=hyperbolicEisenstein s w := by simpa only [rationalUnipotent_nat,rationalComplex,MonoidHom.comp_apply] using hyperbolicEisenstein_unipotent (n:ℤ) s w lemma hyperbolicEisenstein_S_even (s : ℂ) (e : Fin 2) (w : HyperbolicSpace) : hyperbolicEisenstein s (rationalComplex (ModularGroup.S^(2*e.val)) • w)=hyperbolicEisenstein s w := by fin_cases e · simp · exact hyperbolicEisenstein_S_sq s w lemma hyperbolicEisenstein_bruhat (s : ℂ) (e : Fin 2) (a : Fin 3⊕(Fin 3×Fin 3)) (w : HyperbolicSpace) : hyperbolicEisenstein s (rationalComplex (rationalBruhatRep (e,a)) • w)= match a with | Sum.inl _ => hyperbolicEisenstein s w | Sum.inr ab => hyperbolicEisenstein s (rationalComplex ModularGroup.S • (rationalComplex (ModularGroup.T^ab.2.val) • w)) := by simp only [rationalBruhatRep,map_mul,mul_smul,hyperbolicEisenstein_S_even] cases a with | inl a => exact hyperbolicEisenstein_T_pow s a.val w | inr ab => simp only [map_mul,mul_smul,hyperbolicEisenstein_T_pow] theorem sourceEisenstein_four_cusps (s : ℂ) (w : HyperbolicSpace) : sourceEisenstein s w = (4:ℂ)⁻¹ * (hyperbolicEisenstein s w + ∑ b : Fin 3, hyperbolicEisenstein s (rationalComplex ModularGroup.S • (rationalComplex (ModularGroup.T^b.val) • w))) := by rw [sourceEisenstein,sourceProjection_eq_twentyFour] change (24:ℂ)⁻¹ * (∑ i : RationalBruhatIndex, hyperbolicEisenstein s (rationalComplex (rationalBruhatRep i) • w)) = _ rw [Fintype.sum_prod_type] simp_rw [hyperbolicEisenstein_bruhat] simp only [Fintype.sum_sum_type,Fintype.sum_prod_type,Finset.sum_const,Finset.card_univ, Fintype.card_fin,nsmul_eq_mul] ring end section open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace MatrixGroups open CubicKubota namespace RootNotationRationalTranslations02 abbrev Eis := ActualEisensteinCubic.O end RootNotationRationalTranslations02 open RootNotationRationalTranslations02 (Eis) def translatedCuspCompact (M:levelTwo):Set KernelQuotient:= kernelSourceAction M '' kernelCuspAverageCompact lemma translatedCuspCompact_isCompact (M:levelTwo) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology IsCompact (translatedCuspCompact M) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology kernelCuspAverageCompact_isCompact.image (kernelSourceAction_continuous M) def translatedCuspFourier (h:Eis) (M:levelTwo) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2→L[ℂ]ℂ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelCuspFourier h).comp (kernelSourcePullback M).toContinuousLinearMap lemma translatedCuspFourier_integral (h:Eis) (M:levelTwo) (F:KernelQuotientL2) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace translatedCuspFourier h M F=∫w in cuspPeriodStrip 5 6, F (kernelSourceAction M (integralOrbitProjection globalKubotaKernel w))* cuspFourierPhase h w∂hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [translatedCuspFourier,ContinuousLinearMap.comp_apply,kernelCuspFourier_integral] have hm:=kernelProjection_cuspPeriodStrip_measurePreserving 5 6 (by norm_num) have he:=hm.quasiMeasurePreserving.ae_eq_comp (ae_restrict_of_ae (kernelSourcePullback_ae_eq M F) (s:=kernelCuspStripSet)) apply integral_congr_ae filter_upwards [he] with w hw exact congrArg (fun z:ℂ=>z*cuspFourierPhase h w) hw lemma translatedCuspFourier_restrict (h:Eis) (M:levelTwo) (F:KernelQuotientL2) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel translatedCuspFourier h M (kernelMassRestrictionCLM (translatedCuspCompact M) (translatedCuspCompact_isCompact M).measurableSet F)=translatedCuspFourier h M F := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : BorelSpace KernelQuotient := kernelQuotientBorel let : T2Space KernelQuotient := integralOrbitQuotientT2 globalKubotaKernel dsimp only rw [translatedCuspFourier_integral,translatedCuspFourier_integral] have hsource:=(kernelSourceAction_measurePreserving M).quasiMeasurePreserving.ae_eq_comp (kernelMassRestriction_coe (translatedCuspCompact M) (translatedCuspCompact_isCompact M).measurableSet F) have hm:=kernelProjection_cuspPeriodStrip_measurePreserving 5 6 (by norm_num) have he:=hm.quasiMeasurePreserving.ae_eq_comp (ae_restrict_of_ae hsource (s:=kernelCuspStripSet)) apply integral_congr_ae filter_upwards [he,ae_restrict_mem (cuspPeriodStrip_measurable 5 6)] with w hw hwm have hmem:kernelSourceAction M (integralOrbitProjection globalKubotaKernel w)∈translatedCuspCompact M:= ⟨_,kernelCuspStripSet_subset_compact ⟨w,hwm,rfl⟩,rfl⟩ exact congrArg (fun z:ℂ=>z*cuspFourierPhase h w) (hw.trans (Set.indicator_of_mem hmem _)) def translatedCuspFamily (h:Eis) (M:levelTwo) (a b:ℝ) (ha:0(s-4/3)*translatedCuspFamily h M a b ha hab s) (𝓝[≠] (4/3:ℂ)) (𝓝 (translatedCuspFourier h M (kernelEisensteinResidueVector a b ha hab))) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let translatedCuspFourier_restrict := fun F => OAI.CubicEisenstein.translatedCuspFourier_restrict h M F have hh:=(translatedCuspFourier h M).continuous.continuousAt.tendsto.comp (kernelLocalCorrectedSeed_residue_limit _ (translatedCuspCompact_isCompact M) a b ha hab) simpa only [Function.comp_def,map_smul,smul_eq_mul,translatedCuspFourier_restrict, translatedCuspFamily] using hh lemma translatedCuspFamily_actual_integral (h:Eis) (M:levelTwo) (a b:ℝ) (ha:0z*cuspFourierPhase h w) (hw.trans (Set.indicator_of_mem hmem _)) theorem translatedCuspFamily_initial (h:Eis) (M:levelTwo) (a b:ℝ) (ha:0z*cuspFourierPhase h w) (hw.trans (by dsimp only [Function.comp_def];rw [kernelSourceAction_mk,kernelQuotientEisenstein_mk])) end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Matrix open CubicKubota ConcreteTraceCRT namespace RootNotationRationalTranslations03 abbrev Eis := ActualEisensteinCubic.O end RootNotationRationalTranslations03 open RootNotationRationalTranslations03 (Eis) def oppositeSource:levelTwo:=rationalLift ModularGroup.S lemma oppositeSource_matrix:sourceComplexMatrix oppositeSource=oppositeMatrix:=by apply Subtype.ext ext i j fin_cases i <;> fin_cases j <;> simp [oppositeSource,sourceComplexMatrix,rationalLift,rationalEmbedding, integralComplexMatrix,Matrix.SpecialLinearGroup.map_apply_coe,ModularGroup.coe_S,oppositeMatrix] lemma hyperbolicEisenstein_opposite_upper (s:ℂ) (z:ℂ) (v:ℝ) (hv:0 hyperbolicEisenstein s (sourceComplexMatrix oppositeSource • w)*cuspFourierPhase h w have hg:Continuous g:=((hyperbolicEisenstein_continuous s hs).comp (continuous_hyperbolic_action _)).mul (cuspFourierPhase_continuous h) rw [cuspPeriodStrip_integral_coordinates g hg.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable g hg)] have heq:(∫v in Set.Icc (5:ℝ) 6, (∫z in periodDomain,g (cuspCoordinateLift (v,z)))/(v:ℂ)^3)= ∫v in Set.Icc (5:ℝ) 6,unramifiedCubicGaussSeries s (9*h)* ((v:ℂ)^(-s-1)*sourceFourierKernel s (cuspFrequency h*v)):=by apply setIntegral_congr_fun measurableSet_Icc intro v hv have hv0:0z.1.1) he have h2:=congrArg (fun z : CubicUnitResidue a × CubicUnitResidue b=>z.2.1) he change Ideal.Quotient.mk (Ideal.span {a}) (GaussianShiftedPartition.representative (a*b) r.1)= Ideal.Quotient.mk (Ideal.span {a}) (GaussianShiftedPartition.representative (a*b) t.1) at h1 change Ideal.Quotient.mk (Ideal.span {b}) (GaussianShiftedPartition.representative (a*b) r.1)= Ideal.Quotient.mk (Ideal.span {b}) (GaussianShiftedPartition.representative (a*b) t.1) at h2 have hdiv : a*b ∣ GaussianShiftedPartition.representative (a*b) r.1- GaussianShiftedPartition.representative (a*b) t.1 := hab.mul_dvd (Ideal.mem_span_singleton.mp ((Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp h1)) (Ideal.mem_span_singleton.mp ((Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp h2)) apply Subtype.ext rw [←GaussianShiftedPartition.representative_spec (a*b) r.1, ←GaussianShiftedPartition.representative_spec (a*b) t.1] exact (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr (Ideal.mem_span_singleton.mpr hdiv) lemma cubicUnitCRTMap_surjective (a b : Eis) (hab : IsCoprime a b) : Function.Surjective (cubicUnitCRTMap a b) := by rintro ⟨r,t⟩ obtain ⟨u,v,huv⟩:=hab let delta:=GaussianShiftedPartition.representative a r.1 let xi:=GaussianShiftedPartition.representative b t.1 let d:=v*b*delta+u*a*xi have hda:a∣d-delta:=⟨u*(xi-delta),by dsimp [d];linear_combination delta*huv⟩ have hdb:b∣d-xi:=⟨v*(delta-xi),by dsimp [d];linear_combination xi*huv⟩ have had:IsCoprime a delta:=by apply (isUnit_quotient_span_iff a delta).mp simpa only [delta,GaussianShiftedPartition.representative_spec] using r.2 have hbd:IsCoprime b xi:=by apply (isUnit_quotient_span_iff b xi).mp simpa only [xi,GaussianShiftedPartition.representative_spec] using t.2 have hd:IsCoprime (a*b) d:= ((isCoprime_right_congr_of_dvd a d delta hda).mpr had).mul_left ((isCoprime_right_congr_of_dvd b d xi hdb).mpr hbd) let q:CubicUnitResidue (a*b):=⟨Ideal.Quotient.mk (Ideal.span {a*b}) d, (isUnit_quotient_span_iff (a*b) d).mpr hd⟩ refine ⟨q,Prod.ext (Subtype.ext ?_) (Subtype.ext ?_)⟩ · change Ideal.Quotient.mk (Ideal.span {a}) (GaussianShiftedPartition.representative (a*b) q.1)=r.1 rw [←GaussianShiftedPartition.representative_spec a r.1] apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr apply Ideal.mem_span_singleton.mpr have hh:a∣GaussianShiftedPartition.representative (a*b) q.1-d:= (dvd_mul_right a b).trans (gaussRep_mk_congr (a*b) d) simpa only [sub_add_sub_cancel] using dvd_add hh hda · change Ideal.Quotient.mk (Ideal.span {b}) (GaussianShiftedPartition.representative (a*b) q.1)=t.1 rw [←GaussianShiftedPartition.representative_spec b t.1] apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr apply Ideal.mem_span_singleton.mpr have hh:b∣GaussianShiftedPartition.representative (a*b) q.1-d:= (dvd_mul_left b a).trans (gaussRep_mk_congr (a*b) d) simpa only [sub_add_sub_cancel] using dvd_add hh hdb def cubicUnitCRTEquiv (a b:Eis) (hab:IsCoprime a b): CubicUnitResidue (a*b)≃CubicUnitResidue a×CubicUnitResidue b:= Equiv.ofBijective (cubicUnitCRTMap a b) ⟨cubicUnitCRTMap_injective a b hab,cubicUnitCRTMap_surjective a b hab⟩ lemma residueAdditive_unit_crt (h a b alpha beta d:Eis) (ha:a≠0) (hb:b≠0) (hbez:alpha*b+beta*a=1): residueAdditive (3*h) (a*b) d= residueAdditive (3*(h*alpha)) a d*residueAdditive (3*(h*beta)) b d:=by unfold residueAdditive rw [←AddChar.map_add_eq_mul] congr 1 have hae:=eisEmbedding_ne_zero ha have hbe:=eisEmbedding_ne_zero hb have hbeq:=congrArg eisEmbedding hbez simp only [map_add,map_mul,map_one] at hbeq simp only [cuspFrequency,map_mul,map_ofNat] field_simp [hae,hbe,eisLam_ne_zero] linear_combination -(eisEmbedding h*eisEmbedding d)*hbeq theorem cubicUnitGaussSum_crt (h a b alpha beta:Eis) (ha:a≠0) (hb:b≠0) (hbez:alpha*b+beta*a=1): cubicUnitGaussSum h (a*b)= cubicUnitGaussSum (h*alpha) a*cubicUnitGaussSum (h*beta) b:=by have hab:IsCoprime a b:=⟨beta,alpha,by linear_combination hbez⟩ let f:CubicUnitResidue a→ℂ:=fun r=>eisEmbedding (symbol (GaussianShiftedPartition.representative a r.1) a)* residueAdditive (3*(h*alpha)) a (GaussianShiftedPartition.representative a r.1) let g:CubicUnitResidue b→ℂ:=fun r=>eisEmbedding (symbol (GaussianShiftedPartition.representative b r.1) b)* residueAdditive (3*(h*beta)) b (GaussianShiftedPartition.representative b r.1) have he:cubicUnitGaussSum h (a*b)=∑'r:CubicUnitResidue (a*b), f (cubicUnitCRTEquiv a b hab r).1*g (cubicUnitCRTEquiv a b hab r).2:=by unfold cubicUnitGaussSum apply tsum_congr intro r exact (by let d:=GaussianShiftedPartition.representative (a*b) r.1 let delta:=GaussianShiftedPartition.representative a (cubicUnitCRTMap a b r).1.1 let xi:=GaussianShiftedPartition.representative b (cubicUnitCRTMap a b r).2.1 have hdelta:a∣delta-d:=gaussRep_mk_congr a d have hxi:b∣xi-d:=gaussRep_mk_congr b d change eisEmbedding (symbol d (a*b))*residueAdditive (3*h) (a*b) d= (eisEmbedding (symbol delta a)*residueAdditive (3*(h*alpha)) a delta)* (eisEmbedding (symbol xi b)*residueAdditive (3*(h*beta)) b xi) rw [symbol_mul_denominator,map_mul,symbol_congr hdelta,symbol_congr hxi, residueAdditive_unit_crt h a b alpha beta d ha hb hbez, residueAdditive_three_congr (h*alpha) a delta d ha hdelta, residueAdditive_three_congr (h*beta) b xi d hb hxi] ring ) rw [he,(cubicUnitCRTEquiv a b hab).tsum_eq (fun r=>f r.1*g r.2)] let:Finite (Eis⧸Ideal.span {a}):=finite_quotient_span ha let:Finite (Eis⧸Ideal.span {b}):=finite_quotient_span hb let:Fintype (CubicUnitResidue a):=Fintype.ofFinite _ let:Fintype (CubicUnitResidue b):=Fintype.ofFinite _ change (∑'r:CubicUnitResidue a×CubicUnitResidue b,f r.1*g r.2)= (∑'r:CubicUnitResidue a,f r)*(∑'r:CubicUnitResidue b,g r) simp only [tsum_fintype,Fintype.sum_prod_type,Finset.mul_sum,Finset.sum_mul] exact Finset.sum_comm theorem cubicUnitGaussSum_coprime_product (h a b:Eis) (ha:a≠0) (hb:b≠0) (hap:lambda^2∣a-1) (hbp:lambda^2∣b-1) (hab:IsCoprime a b): cubicUnitGaussSum h (a*b)=cubicUnitGaussSum h a*cubicUnitGaussSum (h*a) b:=by obtain ⟨beta,alpha,hbez⟩:=hab have hbez':alpha*b+beta*a=1:=by linear_combination hbez have hab':IsCoprime a b:=⟨beta,alpha,hbez⟩ have hA:=cubicUnitGaussSum_frequency_twist (h*alpha) a b ha hap hab' rw [cubicUnitGaussSum_frequency_congr _ h a ha (show a∣(h*alpha)*b-h from ⟨-h*beta,by linear_combination h*hbez'⟩)] at hA have hB:=cubicUnitGaussSum_frequency_twist (h*beta) b a hb hbp hab'.symm rw [cubicUnitGaussSum_frequency_congr _ h b hb (show b∣(h*beta)*a-h from ⟨-h*alpha,by linear_combination h*hbez'⟩)] at hB rw [cubicUnitGaussSum_crt h a b alpha beta ha hb hbez',←hA,←hB, symbol_reciprocity b a hb ha hbp hap] have hshift:=cubicUnitGaussSum_frequency_twist h b a hb hbp hab'.symm have hc:(eisEmbedding (symbol a b))^3=1:=by rw [←map_pow,symbol_cube_of_isCoprime a b hbp hab',map_one] rw [←hshift] calc _=(eisEmbedding (symbol a b))^3*cubicUnitGaussSum h a*cubicUnitGaussSum (h*a) b:=by ring _=_:=by rw [hc,one_mul] end open Filter MeasureTheory open scoped BigOperators Classical Topology open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss open PrimaryIdealUnitReindex (GoodIdeal) namespace RootNotationRationalTranslations05 abbrev Eis := ActualEisensteinCubic.O end RootNotationRationalTranslations05 open RootNotationRationalTranslations05 (Eis) lemma ramifiedCongruence_zero (j : Fin 3) (n : ℕ) : ramifiedCongruence (0:Eis) j.val n ↔ j=0 ∧ 3∣n := by have hz : ActualEisensteinCoordinates.coords (0:Eis)=(0,0) := by have hh:=ShortDraftLatticeCount.coords_eval 0 0 simpa [ActualEisensteinCoordinates.eval] using hh simp only [ramifiedCongruence,hz,add_zero,sub_zero] rw [←Int.natCast_dvd_natCast] constructor · rintro ⟨h1,h2⟩ have hj : j.val=0 := by omega exact ⟨Fin.ext hj,by simpa only [hj,Nat.cast_zero,Nat.cast_ofNat,mul_zero,zero_add] using h1⟩ · rintro ⟨rfl,hn⟩ simpa using And.intro hn (dvd_zero (3:ℤ)) lemma arithmeticResidueSum_zero_ramified (u : Eisˣ) (n : ℕ) : arithmeticResidueSum 0 (u.val*lambda^(n+2))= if u=1 ∨ u= -1 then if 3∣n+2 then ((3^(n+2):ℕ):ℂ) else 0 else 0 := by have hp : residueAdditive (0:Eis) 3 1=1 := by simp [residueAdditive,cuspFrequency] by_cases hu : u=1 ∨ u= -1 · have hs : (u:Eis)=omega^0 ∨ (u:Eis)=-(omega^0) := by rcases hu with rfl|rfl <;> simp rw [ramified_arithmetic_explicit_table 0 0 u (n+2) 0 (by omega) hs (by simp), show ramifiedCongruence (0:Eis) 0 (n+2) ↔ 3∣n+2 by simpa using ramifiedCongruence_zero (0:Fin 3) (n+2),hp,mul_one,if_pos hu] simp only [Nat.cast_pow,Nat.cast_ofNat] · obtain ⟨j,hj⟩:=unit_eq_sign_omega u have hj0 : j≠0 := by intro he subst j apply hu rcases hj with hj|hj · left; apply Units.ext; simpa using hj · right; apply Units.ext; simpa using hj rw [ramified_arithmetic_explicit_table 0 0 u (n+2) j.val (by omega) hj (by simp), ramifiedCongruence_zero,if_neg (by simp [hj0]),if_neg hu] lemma arithmeticDirichletSeries_zero_separate (s : ℂ) (hs : 2⟨3*k+1,by use k+1;omega⟩) ⟨by intro a b h have hh:=congrArg Subtype.val h dsimp at hh omega,by rintro ⟨n,k,hk⟩ refine ⟨k-1,Subtype.ext ?_⟩ dsimp omega⟩ lemma zero_ramified_geometric (s : ℂ) (hs : 1((3^(n+2):ℕ):ℂ)^(-s)* (if 3∣n+2 then ((3^(n+2):ℕ):ℂ) else 0) have hsup:Function.support F⊆{n:ℕ|3∣n+2} := by intro n hn by_contra h change ¬3∣n+2 at h exact hn (by simp [F,h]) change (∑'n,F n)=_ rw [←tsum_subtype_eq_of_support_subset hsup] change (∑'n : {n:ℕ // 3∣n+2},F n.val)=_ rw [←ramifiedCubeExponent.tsum_eq] have he (k:ℕ) : F (ramifiedCubeExponent k).val=ramifiedRatio s^(k+1) := by change ((3^(3*k+1+2):ℕ):ℂ)^(-s)*(if 3∣3*k+1+2 then ((3^(3*k+1+2):ℕ):ℂ) else 0)=_ rw [if_pos (by use k+1;omega),show 3*k+1+2=3*(k+1) by omega] simpa using cube_norm_weight_algebra s k 1 (by decide) simp_rw [he] exact ramified_geometric_sum s hs lemma zero_ramified_factor (s : ℂ) (hs : 1by have hn : ¬(u=1 ∨ u= -1):=by simpa using hu simp [arithmeticResidueSum_zero_ramified,hn])] simp only [Finset.sum_insert,Finset.mem_singleton,hne,not_false_eq_true,Finset.sum_singleton] simp only [arithmeticResidueSum_zero_ramified,true_or,or_true,ite_true] rw [zero_ramified_geometric s hs] ring theorem arithmeticDirichletSeries_zero_unramified (s : ℂ) (hs : 22*translatedCuspFamily 0 oppositeSource 2 3 (by norm_num) (by norm_num) s) (fun s=>((3:ℂ)^(3*s-3)-1)*baseOutgoingConstant s) {s : ℂ | 12*translatedCuspFamily 0 oppositeSource 2 3 (by norm_num) (by norm_num) s) domain := by intro s hs exact analyticAt_const.mul (translatedCuspFamily_analyticAt_nonreal 0 oppositeSource 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne') have hright : AnalyticOnNhd ℂ (fun s=>((3:ℂ)^(3*s-3)-1)*baseOutgoingConstant s) domain := by intro s hs have hp : AnalyticAt ℂ (fun z:ℂ=>(3:ℂ)^(3*z-3)-1) s := by apply Complex.analyticAt_iff_eventually_differentiableAt.mpr exact Eventually.of_forall fun z=> ((((differentiableAt_const (3:ℂ)).mul differentiableAt_id).sub_const 3).const_cpow (Or.inl (by norm_num))).sub_const 1 exact hp.mul (baseOutgoingConstant_analyticAt s hs.1 hs.2) have hstart : (5+Complex.I:ℂ)∈domain := by norm_num [domain] have hopen : IsOpen {s:ℂ | 42*translatedCuspFamily 0 oppositeSource 2 3 (by norm_num) (by norm_num) s) =ᶠ[𝓝 (5+Complex.I:ℂ)] (fun s=>((3:ℂ)^(3*s-3)-1)*baseOutgoingConstant s) := by filter_upwards [hopen.mem_nhds (by norm_num)] with s hs exact opposite_zero_initial_cross s hs.1 hs.2 exact hleft.eqOn_of_preconnected_of_eventuallyEq hright hconvex.isPreconnected hstart hevent theorem translatedCuspFourier_opposite_zero_residue : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace translatedCuspFourier 0 oppositeSource cubicEisensteinResidue=cuspConstantAverageResidue := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hd : Tendsto (fun s:ℂ=>(3:ℂ)^(3*s-3)-1) (𝓝[≠] (4/3:ℂ)) (𝓝 (2:ℂ)) := by have hc : Continuous (fun s:ℂ=>(3:ℂ)^(3*s-3)-1) := (((continuous_const.mul continuous_id).sub continuous_const).const_cpow (Or.inl (by norm_num))).sub continuous_const convert hc.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1 ; norm_num have hl := ((translatedCuspFamily_residue_limit 0 oppositeSource 2 3 (by norm_num) (by norm_num)).const_mul 2).comp upperVertical_tendsto_cubic_punctured have hr := (hd.mul baseOutgoingConstant_residue_limit).comp upperVertical_tendsto_cubic_punctured have hevent : (fun t:ℝ=>2*((((4/3:ℂ)+(t:ℂ)*Complex.I)-4/3)* translatedCuspFamily 0 oppositeSource 2 3 (by norm_num) (by norm_num) ((4/3:ℂ)+(t:ℂ)*Complex.I))) =ᶠ[𝓝[>] (0:ℝ)] (fun t:ℝ=>((3:ℂ)^(3*((4/3:ℂ)+(t:ℂ)*Complex.I)-3)-1)* ((((4/3:ℂ)+(t:ℂ)*Complex.I)-4/3)*baseOutgoingConstant ((4/3:ℂ)+(t:ℂ)*Complex.I))) := by filter_upwards [self_mem_nhdsWithin] with t ht change 0(g:HyperbolicSpace)) (upperTranslation_section a z v hv).symm rw [he,hyperbolicEisenstein_rational_automorphy r _ s hs,complexCharacter_upperTranslation,one_mul] lemma rationalComplex_unipotent_coe (t : ℤ) : (rationalComplex (rationalUnipotent t) : Matrix (Fin 2) (Fin 2) ℂ) = !![1,(t : ℂ);0,1] := by apply Matrix.ext intro i j change eisEmbedding ((Int.castRingHom Eis) ((!![1,t;0,1] : Matrix (Fin 2) (Fin 2) ℤ) i j)) = _ fin_cases i <;> fin_cases j <;> simp lemma rationalUnipotent_section (t:ℤ) (z:ℂ) (v:ℝ) (hv:0 fin_cases j <;> simp [Matrix.mul_apply,Fin.sum_univ_two] all_goals ring lemma rationalComplex_T_pow_upper (n:ℕ) (z:ℂ) (v:ℝ) (hv:0(g:HyperbolicSpace)) (rationalUnipotent_section (n:ℤ) z v hv) simpa only [rationalUnipotent_nat,Int.cast_natCast] using he theorem rational_cusp_average_right_T (r:SL(2,ℤ)) (n:ℕ) (s:ℂ) (hs:2hyperbolicEisenstein s (rationalComplex (r*ModularGroup.T^n) • w) let g : HyperbolicSpace→ℂ := fun w=>hyperbolicEisenstein s (rationalComplex r • w) have hf : Continuous f := (hyperbolicEisenstein_continuous s hs).comp (continuous_hyperbolic_action _) have hg : Continuous g := (hyperbolicEisenstein_continuous s hs).comp (continuous_hyperbolic_action _) change (∫w in cuspPeriodStrip 5 6,f w∂hyperbolicVolume)=∫w in cuspPeriodStrip 5 6,g w∂hyperbolicVolume rw [cuspPeriodStrip_integral_coordinates f hf.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable f hf), cuspPeriodStrip_integral_coordinates g hg.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable g hg)] apply setIntegral_congr_fun measurableSet_Icc intro v hv have hv0 : 0q/(v:ℂ)^3) simp_rw [f,g,cuspCoordinateLift_positive v _ hv0,map_mul,mul_smul,rationalComplex_T_pow_upper] have hh:=period_integral_translation (fun z=>hyperbolicEisenstein s (rationalComplex r • upperPoint z v hv0)) (fun a z=>hyperbolicEisenstein_rational_periodic r a s hs z v hv0) (n:ℂ) simpa only [add_comm] using hh lemma cuspFourierPhase_zero (w:HyperbolicSpace) : cuspFourierPhase (0:Eis) w=1 := by simp [cuspFourierPhase,cuspFrequency] lemma kernelCuspFourier_zero (F:KernelQuotientL2) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelCuspFourier (0:Eis) F=kernelCuspStripAverage F := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [kernelCuspFourier_integral,kernelCuspStripAverage_hyperbolic] simp only [cuspFourierPhase_zero,mul_one] theorem translatedCuspFourier_residue_eq_of_initial (M N:levelTwo) (he : ∀s:ℂ,4 translatedCuspFamily_analyticAt_nonreal 0 M 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne' have hg : AnalyticOnNhd ℂ g domain := fun s hs=> translatedCuspFamily_analyticAt_nonreal 0 N 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne' have hstart : (5+Complex.I:ℂ)∈domain := by norm_num [domain] have hopen : IsOpen {s:ℂ | 4((4/3:ℂ)+(t:ℂ)*Complex.I-4/3)*z) hv end open CubicKubota lemma sourceComplexMatrix_rationalLift (r:SL(2,ℤ)) : sourceComplexMatrix (rationalLift r)=rationalComplex r := rfl lemma translatedCuspFourier_one_residue : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace translatedCuspFourier 0 1 cubicEisensteinResidue=cuspConstantAverageResidue := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [translatedCuspFourier,ContinuousLinearMap.comp_apply, LinearIsometry.coe_toContinuousLinearMap,kernelSourcePullback_one, kernelCuspFourier_zero,cubicEisensteinResidue_cusp_average] lemma translatedCuspFourier_bruhat_residue (i:RationalBruhatIndex) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace translatedCuspFourier 0 (rationalLift (rationalBruhatRep i)) cubicEisensteinResidue= cuspConstantAverageResidue := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rcases i with ⟨e,a|⟨a,b⟩⟩ · calc _=translatedCuspFourier 0 1 cubicEisensteinResidue := by apply translatedCuspFourier_residue_eq_of_initial intro s hs hi simp_rw [sourceComplexMatrix_rationalLift,hyperbolicEisenstein_bruhat] simp only [map_one,one_smul] _=cuspConstantAverageResidue := translatedCuspFourier_one_residue · calc _=translatedCuspFourier 0 oppositeSource cubicEisensteinResidue := by apply translatedCuspFourier_residue_eq_of_initial intro s hs hi simp_rw [sourceComplexMatrix_rationalLift,hyperbolicEisenstein_bruhat] change (∫w in cuspPeriodStrip 5 6, hyperbolicEisenstein s (rationalComplex ModularGroup.S • (rationalComplex (ModularGroup.T^b.val) • w))∂hyperbolicVolume)= ∫w in cuspPeriodStrip 5 6,hyperbolicEisenstein s (rationalComplex ModularGroup.S • w)∂hyperbolicVolume simpa only [map_mul,mul_smul] using rational_cusp_average_right_T ModularGroup.S b.val s (by linarith) _=cuspConstantAverageResidue := translatedCuspFourier_opposite_zero_residue theorem kernelSourceProjection_residue_cusp_average : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelCuspStripAverage (kernelSourceProjection cubicEisensteinResidue)= cuspConstantAverageResidue := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [←kernelCuspFourier_zero,kernelSourceProjection_eq_twentyFour,map_smul,map_sum] have he (i:RationalBruhatIndex) : kernelCuspFourier 0 (kernelSourcePullback (rationalLift (rationalBruhatRep i)) cubicEisensteinResidue)= cuspConstantAverageResidue := translatedCuspFourier_bruhat_residue i simp only [he,Finset.sum_const,Finset.card_univ,Fintype.card_prod,Fintype.card_sum, Fintype.card_fin,smul_eq_mul,nsmul_eq_mul] norm_num ring theorem cubicSourceResidualFunction_cusp_average : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (∫w in cuspPeriodStrip 5 6,cubicSourceResidualFunction w∂hyperbolicVolume)= cuspConstantAverageResidue := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [←kernelSourceProjection_residue_cusp_average,kernelCuspStripAverage_hyperbolic] apply integral_congr_ae filter_upwards [ae_restrict_of_ae cubicSourceResidualFunction_represents_projection] with w hw exact hw.symm theorem cubicSourceResidualFunction_ne_zero : cubicSourceResidualFunction≠0 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by intro hz have he:=cubicSourceResidualFunction_cusp_average rw [hz] at he simp only [Pi.zero_apply,integral_zero] at he exact cuspConstantAverageResidue_ne_zero he.symm end section open Filter MeasureTheory open scoped BigOperators Classical Topology section lemma complex_gaussian_power_integrable (s : ℂ) (r : ℝ) (hs : 0 (x:ℂ)^(s-1)*Complex.exp (-(r:ℂ)*(x:ℂ)^2)) (Set.Ioi 0) volume := by have hs2 : 0<(s/(2:ℂ)).re := by simpa using half_pos hs have hbase : MellinConvergent (fun t : ℝ => Complex.exp (-(t:ℂ))) (s/2) := by simpa only [MellinConvergent,smul_eq_mul,Complex.ofReal_exp,Complex.ofReal_neg,mul_comm] using Complex.GammaIntegral_convergent hs2 have hlinear := (MellinConvergent.comp_mul_left (f := fun t : ℝ => Complex.exp (-(t:ℂ))) (s := s/2) hr).mpr hbase have hgaussian := (MellinConvergent.comp_rpow (f := fun t : ℝ => Complex.exp (-((r*t:ℝ):ℂ))) (s := s) (a := 2) (by norm_num)).mpr hlinear simpa only [MellinConvergent,smul_eq_mul,Real.rpow_two, Complex.ofReal_mul,Complex.ofReal_pow,neg_mul] using hgaussian lemma complex_gaussian_power_integral (s : ℂ) (r : ℝ) (hs : 0 Complex.exp (-((r*t:ℝ):ℂ))) s 2 simp only [mellin,smul_eq_mul,Real.rpow_two,Complex.ofReal_mul, Complex.ofReal_pow,Complex.real_smul] at he norm_num only [Complex.ofReal_ofNat] at he rw [Complex.integral_cpow_mul_exp_neg_mul_Ioi hs2 hr] at he simpa [neg_mul] using he end open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding def cubicMellinMixture (s : ℂ) (t x : ℝ) : ℂ := (t:ℂ)^(-(2:ℂ)/3)*Complex.exp (-(t:ℂ))* ((x:ℂ)^((s-1/3)-1)*Complex.exp (-((1/(4*t):ℝ):ℂ)*(x:ℂ)^2)) lemma cubicMellinMixture_slice_integrable (s : ℂ) (hs : 1/3 cubicMellinMixture s p.1 p.2) ((volume.restrict (Set.Ioi 0)).prod (volume.restrict (Set.Ioi 0))) := by have hm : AEStronglyMeasurable (fun p : ℝ × ℝ => cubicMellinMixture s p.1 p.2) ((volume.restrict (Set.Ioi 0)).prod (volume.restrict (Set.Ioi 0))) := by unfold cubicMellinMixture fun_prop apply (integrable_prod_iff hm).mpr constructor · filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht exact cubicMellinMixture_slice_integrable s hs t ht · have hg := (Real.GammaIntegral_convergent (show 0<(s.re+1/3)/2 by linarith)).const_mul ((1/2:ℝ)*(4:ℝ)^((s.re-1/3)/2)*Real.Gamma ((s.re-1/3)/2)) apply hg.congr filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht rw [cubicMellinMixture_integral_norm s hs t ht] ring lemma cubicMellinMixture_integral_t (s : ℂ) (x : ℝ) : (∫t : ℝ in Set.Ioi 0,cubicMellinMixture s t x) = (x:ℂ)^((s-1/3)-1)*schlafliIntegral (1/3) x := by rw [schlafliIntegral,←integral_const_mul] apply setIntegral_congr_fun measurableSet_Ioi intro t ht dsimp only have ht0 : (t:ℂ)≠0 := Complex.ofReal_ne_zero.mpr (ne_of_gt ht) have he : Complex.exp (-(t:ℂ))*Complex.exp (-((1/(4*t):ℝ):ℂ)*(x:ℂ)^2)= Complex.exp (-(t:ℂ)-(x:ℂ)^2/(4*t)) := by rw [←Complex.exp_add] congr 1 push_cast field_simp ring rw [show (1/3:ℂ)-1=-(2:ℂ)/3 by ring] unfold cubicMellinMixture linear_combination (t:ℂ)^(-(2:ℂ)/3)*(x:ℂ)^((s-1/3)-1)*he end open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding lemma schlafliBesselK_cubic_mellin_mixture (s : ℂ) (x : ℝ) (hx : 0 (x:ℂ)^(s-1)*schlafliBesselK (1/3) x) (Set.Ioi 0) volume := by apply ((cubicMellinMixture_integrable s hs).integral_prod_right.const_mul ((1/2:ℂ)*(2:ℂ)^(1/3:ℂ))).congr filter_upwards [ae_restrict_mem measurableSet_Ioi] with x hx exact (schlafliBesselK_cubic_mellin_mixture s x hx).symm lemma cubicMellinMixture_double_integral (s : ℂ) (hs : 1/3 (v:ℂ)^(s-1)*schlafliBesselK (1/3) (c*v)) (Set.Ioi 0) volume := by have hb : MellinConvergent (fun v => schlafliBesselK (1/3) v) s := by simpa only [MellinConvergent,smul_eq_mul] using schlafliBesselK_cubic_mellin_integrable s hs have hh := (MellinConvergent.comp_mul_left (f := fun v => schlafliBesselK (1/3) v) (s := s) hc).mpr hb simpa only [MellinConvergent,smul_eq_mul] using hh lemma schlafliBesselK_cubic_scaled_mellin (s : ℂ) (c : ℝ) (hs : 1/3 schlafliBesselK (1/3) v) s hc simp only [mellin,smul_eq_mul] at hh rw [schlafliBesselK_cubic_mellin s hs] at hh exact hh lemma source_cubic_bessel_mellin_integrable (s freq : ℂ) (hs : -(1/3) (v:ℂ)^(2*s)* schlafliBesselK (1/3) (4*Real.pi*‖freq‖*v)) (Set.Ioi 0) volume := by have hc : 0<4*Real.pi*‖freq‖ := by positivity have ht : 1/3<(2*s+1).re := by norm_num; linarith simpa only [show (2*s+1:ℂ)-1=2*s by ring] using schlafliBesselK_cubic_scaled_mellin_integrable (2*s+1) (4*Real.pi*‖freq‖) ht hc theorem source_cubic_bessel_mellin (s freq : ℂ) (hs : -(1/3) fin_cases j <;> simp only [Matrix.map_apply,] <;> assumption theorem exists_fixed_matrix_completion (M c a0 r0 d0 b0 : R) (hc : c≠0) (hdet0 : a0*d0-b0*(c*r0)=1) : ∀a r : R, M*c∣a-a0 → M∣r-r0 → IsCoprime r (M*c) → IsCoprime a r → ∃b d : R, a*d-b*(c*r)=1 ∧ M*c∣d-d0 ∧ (!![a,b;c*r,d] : Matrix (Fin 2) (Fin 2) R).map (Ideal.Quotient.mk (Ideal.span {M})) = (!![a0,b0;c*r0,d0] : Matrix (Fin 2) (Fin 2) R).map (Ideal.Quotient.mk (Ideal.span {M})) := by intro a r ha hrr hr har have hbase : c ∣ a0*d0-1 := by refine ⟨b0*r0,?_⟩ linear_combination hdet0 have hfixed : c ∣ a*d0-1 := by have hdiff := dvd_mul_of_dvd_left ((dvd_mul_left c M).trans ha) d0 convert dvd_add hdiff hbase using 1 ; ring obtain ⟨b,d,hdet,hd⟩ := exists_fixed_completion M c r a d0 hfixed hr har exact ⟨b,d,hdet,hd,fixed_completion_matrix_congr M c r r0 a a0 b b0 d d0 hc hr.of_mul_right_left.symm hdet hdet0 ha hd hrr⟩ end ShortDraftCRT open scoped BigOperators Classical namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationBesselMellinTransform01 abbrev Eis := ActualEisensteinCubic.O end RootNotationBesselMellinTransform01 open RootNotationBesselMellinTransform01 (Eis) def conductorReduction (a b:Eis): (Eis⧸Ideal.span {a*b})→+*(Eis⧸Ideal.span {a}):= Ideal.Quotient.factor (Ideal.span_singleton_le_span_singleton.mpr (dvd_mul_right a b)) lemma conductorReduction_surjective (a b:Eis):Function.Surjective (conductorReduction a b):= Ideal.Quotient.factor_surjective _ def quotientTrace (c:Eis) (hc:c≠0):AddChar (Eis⧸Ideal.span {c}) ℂ:= eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates c hc lemma quotientTrace_mk (c:Eis) (hc:c≠0) (x:Eis): quotientTrace c hc (Ideal.Quotient.mk _ x)=residueAdditive (3*x) c 1:=by simp only [quotientTrace,eisTraceModChar,IdealGaussCRT.traceModChar_mk] unfold residueAdditive cuspFrequency simp only [map_mul,map_one,map_ofNat] congr 1 ring def conductorFourier (a b:Eis) (ha:a≠0) (hb:b≠0) (F:(Eis⧸Ideal.span {a})→ℂ) (h:Eis):ℂ:= ∑'x:Eis⧸Ideal.span {a*b},F (conductorReduction a b x)* quotientTrace (a*b) (mul_ne_zero ha hb) (Ideal.Quotient.mk _ h*x) lemma conductorFourier_shift (a b:Eis) (ha:a≠0) (hb:b≠0) (F:(Eis⧸Ideal.span {a})→ℂ) (h t:Eis): conductorFourier a b ha hb F h= quotientTrace (a*b) (mul_ne_zero ha hb) (Ideal.Quotient.mk _ (h*a*t))* conductorFourier a b ha hb F h:=by let q:Eis⧸Ideal.span {a*b}:=Ideal.Quotient.mk _ (a*t) have hq:conductorReduction a b q=0:=by change Ideal.Quotient.mk (Ideal.span {a}) (a*t)=0 exact Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr ⟨t,rfl⟩) unfold conductorFourier conv_lhs => rw [←(Equiv.addRight q).tsum_eq] rw [←tsum_mul_left] apply tsum_congr intro x change F (conductorReduction a b (x+q))* quotientTrace (a*b) (mul_ne_zero ha hb) (Ideal.Quotient.mk _ h*(x+q))=_ simp only [map_add,hq,add_zero,mul_add,AddChar.map_add_eq_mul] have he:Ideal.Quotient.mk (Ideal.span {a*b}) h*q=Ideal.Quotient.mk _ (h*a*t):=by dsimp [q] rw [←map_mul] congr 1 ring rw [he] ring theorem conductorFourier_support (a b:Eis) (ha:a≠0) (hb:b≠0) (F:(Eis⧸Ideal.span {a})→ℂ) (h:Eis) (hF:conductorFourier a b ha hb F h≠0):b∣h:=by have hphase (t:Eis): quotientTrace (a*b) (mul_ne_zero ha hb) (Ideal.Quotient.mk _ (h*a*t))=1:=by apply mul_right_cancel₀ hF rw [one_mul,←conductorFourier_shift] have hz:Ideal.Quotient.mk (Ideal.span {a*b}) (h*a)=0:=by by_contra hn apply GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive (a*b) (mul_ne_zero ha hb) hn ext x obtain ⟨t,rfl⟩:=Ideal.Quotient.mk_surjective x simpa only [AddChar.mulShift_apply,←map_mul,AddChar.one_apply,quotientTrace] using hphase t have hd:a*b∣h*a:=Ideal.mem_span_singleton.mp (Ideal.Quotient.eq_zero_iff_mem.mp hz) have hd':a*b∣a*h:=by simpa only [mul_comm h a] using hd exact (mul_dvd_mul_iff_left ha).mp hd' lemma conductorReduction_kernel_card (a b:Eis) (ha:a≠0) (_hb:b≠0): Nat.card (conductorReduction a b).toAddMonoidHom.ker=Ideal.absNorm (Ideal.span {b}):=by have hc:=card_ring_eq_card_mul_kernel (conductorReduction a b) (conductorReduction_surjective a b) change Ideal.absNorm (Ideal.span {a*b})= Ideal.absNorm (Ideal.span {a})*Nat.card (conductorReduction a b).toAddMonoidHom.ker at hc conv_lhs at hc => rw [←Ideal.span_singleton_mul_span_singleton,map_mul] have hpos:0F y*quotientTrace a ha (Ideal.Quotient.mk _ k*y)) rw [conductorReduction_kernel_card a b ha hb] at he exact he end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationBesselMellinTransform02 abbrev Eis := ActualEisensteinCubic.O end RootNotationBesselMellinTransform02 open RootNotationBesselMellinTransform02 (Eis) lemma cubicSymbol_pow_denominator (x p:Eis) (n:ℕ): symbol x (p^n)=(symbol x p)^n:=by induction n with | zero=>simp [symbol_one] | succ n ih=>rw [pow_succ,symbol_mul_denominator,ih,pow_succ] def primeCubicMulChar (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1): MulChar (Eis⧸Ideal.span {p}) ℂ:= letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO by letI:(Ideal.span {p}:Ideal Eis).IsMaximal:= PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible have hg:lambda∉(Ideal.span {p}:Ideal Eis):= primary_maximal_divisor_good p hprimary _ (Ideal.subset_span (by simp)) refine {toFun:=fun x=>eisEmbedding (symbol (GaussianShiftedPartition.representative p x) p) map_one':=?_,map_mul':=?_,map_nonunit':=?_} · have hd:p∣GaussianShiftedPartition.representative p 1-1:=by simpa only [map_one] using gaussRep_mk_congr p 1 rw [symbol_congr hd,symbol_one_numerator p hprimary,map_one] · intro x y have hd:p∣GaussianShiftedPartition.representative p (x*y)- GaussianShiftedPartition.representative p x*GaussianShiftedPartition.representative p y:=by apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp simp only [map_mul,GaussianShiftedPartition.representative_spec] rw [symbol_congr hd,symbol_mul_numerator _ _ p hprimary,map_mul] · intro x hx rw [symbol_prime p hp hprimary,primeValue_eq _ hg, GaussianShiftedPartition.representative_spec,MulChar.map_nonunit _ hx,map_zero] lemma primeCubicMulChar_mk (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (x:Eis): primeCubicMulChar p hp hprimary (Ideal.Quotient.mk _ x)=eisEmbedding (symbol x p):=by change eisEmbedding (symbol (GaussianShiftedPartition.representative p (Ideal.Quotient.mk _ x)) p)=_ rw [symbol_congr (gaussRep_mk_congr p x)] lemma quotientTrace_mk_product (c:Eis) (hc:c≠0) (h d:Eis): quotientTrace c hc (Ideal.Quotient.mk _ h*Ideal.Quotient.mk _ d)= residueAdditive (3*h) c d:=by rw [←map_mul,quotientTrace_mk] unfold residueAdditive cuspFrequency simp only [map_mul,map_one,map_ofNat] congr 1 ring lemma conductorReduction_prime_power_unit (p:Eis) (n:ℕ) (x:Eis⧸Ideal.span {p*p^n}): IsUnit (conductorReduction p (p^n) x)↔IsUnit x:=by obtain ⟨d,rfl⟩:=Ideal.Quotient.mk_surjective x change IsUnit (Ideal.Quotient.mk (Ideal.span {p}) d)↔ IsUnit (Ideal.Quotient.mk (Ideal.span {p*p^n}) d) rw [isUnit_quotient_span_iff,isUnit_quotient_span_iff,←pow_succ', IsCoprime.pow_left_iff (Nat.succ_pos n)] theorem cubicUnitGaussSum_prime_power_fourier (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (n:ℕ) (h:Eis): cubicUnitGaussSum h (p^(n+1))= conductorFourier p (p^n) hp.ne_zero (pow_ne_zero _ hp.ne_zero) (fun x=>(primeCubicMulChar p hp hprimary^(n+1)) x) h:=by let χ:=primeCubicMulChar p hp hprimary let f:(Eis⧸Ideal.span {p*p^n})→ℂ:=fun x=> (χ^(n+1)) (conductorReduction p (p^n) x)* quotientTrace (p*p^n) (mul_ne_zero hp.ne_zero (pow_ne_zero _ hp.ne_zero)) (Ideal.Quotient.mk _ h*x) have hsup:Function.support f⊆{x|IsUnit x}:=by intro x hx by_contra hn have hn':¬IsUnit (conductorReduction p (p^n) x):= fun hh=>hn ((conductorReduction_prime_power_unit p n x).mp hh) exact hx (by dsimp [f];rw [MulChar.map_nonunit _ hn',zero_mul]) rw [pow_succ'] change cubicUnitGaussSum h (p*p^n)=∑'x,f x rw [←tsum_subtype_eq_of_support_subset hsup] unfold cubicUnitGaussSum apply tsum_congr intro x let d:=GaussianShiftedPartition.representative (p*p^n) x.val have hd:Ideal.Quotient.mk (Ideal.span {p*p^n}) d=x.val:= GaussianShiftedPartition.representative_spec _ _ change eisEmbedding (symbol d (p*p^n))*residueAdditive (3*h) (p*p^n) d=f x.val rw [←hd] dsimp [f] change _=(χ^(n+1)) (Ideal.Quotient.mk _ d)*_ rw [MulChar.pow_apply' _ (Nat.succ_ne_zero n),primeCubicMulChar_mk, quotientTrace_mk_product,←pow_succ',cubicSymbol_pow_denominator,map_pow] theorem cubicUnitGaussSum_prime_power_support (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (n:ℕ) (h:Eis) (hne:cubicUnitGaussSum h (p^(n+1))≠0):p^n∣h:=by rw [cubicUnitGaussSum_prime_power_fourier p hp hprimary n h] at hne exact conductorFourier_support p (p^n) hp.ne_zero (pow_ne_zero _ hp.ne_zero) _ h hne def primeCubicGauss (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (e:ℕ) (h:Eis):ℂ:= ∑'x:Eis⧸Ideal.span {p},(primeCubicMulChar p hp hprimary^e) x* quotientTrace p hp.ne_zero (Ideal.Quotient.mk _ h*x) theorem cubicUnitGaussSum_prime_power_lift (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (n:ℕ) (h:Eis): cubicUnitGaussSum (p^n*h) (p^(n+1))= (Ideal.absNorm (Ideal.span {p}):ℂ)^n*primeCubicGauss p hp hprimary (n+1) h:=by rw [cubicUnitGaussSum_prime_power_fourier p hp hprimary n, conductorFourier_lift p (p^n) hp.ne_zero (pow_ne_zero _ hp.ne_zero)] have hn:Ideal.absNorm (Ideal.span {p^n})=Ideal.absNorm (Ideal.span {p})^n:=by rw [←Ideal.span_singleton_pow,map_pow] rw [hn,Nat.cast_pow] rfl end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationBesselMellinTransform03 abbrev Eis := ActualEisensteinCubic.O end RootNotationBesselMellinTransform03 open RootNotationBesselMellinTransform03 (Eis) lemma primeCubicMulChar_cube (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1): primeCubicMulChar p hp hprimary^3=1:=by apply DFunLike.ext intro x by_cases hx:IsUnit x · obtain ⟨d,rfl⟩:=Ideal.Quotient.mk_surjective x rw [MulChar.pow_apply' _ (by decide),primeCubicMulChar_mk,←map_pow, symbol_cube_of_isCoprime d p hprimary ((isUnit_quotient_span_iff p d).mp hx).symm,map_one] exact (MulChar.one_apply_coe hx.unit).symm · rw [MulChar.map_nonunit _ hx,MulChar.map_nonunit _ hx] lemma primeCubicMulChar_ne_one (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1): primeCubicMulChar p hp hprimary≠1:= letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO by let:(Ideal.span {p}:Ideal Eis).IsMaximal:= PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible have hg:lambda∉(Ideal.span {p}:Ideal Eis):= primary_maximal_divisor_good p hprimary _ (Ideal.subset_span (by simp)) intro hchar apply cubicChar_ne_one (Ideal.span {p}) hg apply DFunLike.ext intro x by_cases hx:IsUnit x · obtain ⟨d,rfl⟩:=Ideal.Quotient.mk_surjective x have he:=congrArg (fun χ:MulChar (Eis⧸Ideal.span {p}) ℂ=>χ (Ideal.Quotient.mk _ d)) hchar rw [primeCubicMulChar_mk,symbol_prime p hp hprimary,primeValue_eq _ hg] at he have hoc:(1:MulChar (Eis⧸Ideal.span {p}) ℂ) (Ideal.Quotient.mk _ d)=1:= MulChar.one_apply_coe hx.unit have hoo:(1:MulChar (Eis⧸Ideal.span {p}) Eis) (Ideal.Quotient.mk _ d)=1:= MulChar.one_apply_coe hx.unit rw [hoo] apply eisEmbedding_injective simpa only [hoc,map_one] using he · rw [MulChar.map_nonunit _ hx,MulChar.map_nonunit _ hx] lemma primeCubicMulChar_order (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1): orderOf (primeCubicMulChar p hp hprimary)=3:=by have hd:=orderOf_dvd_of_pow_eq_one (primeCubicMulChar_cube p hp hprimary) rcases (Nat.dvd_prime Nat.prime_three).mp hd with h1|h3 · exact False.elim (primeCubicMulChar_ne_one p hp hprimary (orderOf_eq_one_iff.mp h1)) · exact h3 lemma primeCubicMulChar_pow_eq_one (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (e:ℕ): primeCubicMulChar p hp hprimary^e=1↔3∣e:=by rw [←orderOf_dvd_iff_pow_eq_one,primeCubicMulChar_order] lemma primeCubicGauss_mod_three (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (e:ℕ) (h:Eis): primeCubicGauss p hp hprimary e h=primeCubicGauss p hp hprimary (e%3) h:=by unfold primeCubicGauss have he:=pow_mod_orderOf (primeCubicMulChar p hp hprimary) e rw [primeCubicMulChar_order] at he rw [he] lemma primeCubicGauss_eq_gaussSum (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (e:ℕ) (h:Eis) [Fintype (Eis⧸Ideal.span {p})]: primeCubicGauss p hp hprimary e h= gaussSum (primeCubicMulChar p hp hprimary^e) ((quotientTrace p hp.ne_zero).mulShift (Ideal.Quotient.mk _ h)):=by simp only [primeCubicGauss,tsum_fintype,gaussSum,AddChar.mulShift_apply] theorem primeCubicGauss_of_dvd (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (e:ℕ) (h:Eis) (hph:p∣h): primeCubicGauss p hp hprimary e h= if 3∣e then (Ideal.absNorm (Ideal.span {p}):ℂ)-1 else 0:= letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO by let:(Ideal.span {p}:Ideal Eis).IsMaximal:= PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible let:Field (Eis⧸Ideal.span {p}):=Ideal.Quotient.field _ let:Fintype (Eis⧸Ideal.span {p}):=Fintype.ofFinite _ have hh:Ideal.Quotient.mk (Ideal.span {p}) h=0:= Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr hph) rw [primeCubicGauss_eq_gaussSum,hh,AddChar.mulShift_zero] split_ifs with he · rw [(primeCubicMulChar_pow_eq_one p hp hprimary e).mpr he,gaussSum_one_one, Nat.card_units,Nat.cast_sub (Nat.succ_le_of_lt Nat.card_pos),Nat.cast_one] rfl · exact gaussSum_one_right (fun hχ=>he ((primeCubicMulChar_pow_eq_one p hp hprimary e).mp hχ)) theorem primeCubicGauss_trivial_nonzero (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (e:ℕ) (he:3∣e) (h:Eis) (hph:¬p∣h): primeCubicGauss p hp hprimary e h=-1:= letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO by let:(Ideal.span {p}:Ideal Eis).IsMaximal:= PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible let:Field (Eis⧸Ideal.span {p}):=Ideal.Quotient.field _ let:Fintype (Eis⧸Ideal.span {p}):=Fintype.ofFinite _ have hh:Ideal.Quotient.mk (Ideal.span {p}) h≠0:=by intro hh exact hph (Ideal.mem_span_singleton.mp (Ideal.Quotient.eq_zero_iff_mem.mp hh)) rw [primeCubicGauss_eq_gaussSum,(primeCubicMulChar_pow_eq_one p hp hprimary e).mpr he] exact gaussSum_one_left (GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive p hp.ne_zero hh) theorem primeCubicGauss_one_mul_two (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:Eis) (hph:¬p∣h): primeCubicGauss p hp hprimary 1 h*primeCubicGauss p hp hprimary 2 h= (Ideal.absNorm (Ideal.span {p}):ℂ):= letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO by let:(Ideal.span {p}:Ideal Eis).IsMaximal:= PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible let:Field (Eis⧸Ideal.span {p}):=Ideal.Quotient.field _ let:Fintype (Eis⧸Ideal.span {p}):=Fintype.ofFinite _ have hh:Ideal.Quotient.mk (Ideal.span {p}) h≠0:=by intro hh exact hph (Ideal.mem_span_singleton.mp (Ideal.Quotient.eq_zero_iff_mem.mp hh)) have hψ:((quotientTrace p hp.ne_zero).mulShift (Ideal.Quotient.mk _ h)).IsPrimitive:= AddChar.IsPrimitive.of_ne_one (GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive p hp.ne_zero hh) have he:=gaussSum_mul_gaussSum_pow_orderOf_sub_one (primeCubicMulChar_ne_one p hp hprimary) hψ rw [primeCubicMulChar_order] at he have hm:=MulChar.val_neg_one_eq_one_of_odd_order (by decide:Odd 3) (primeCubicMulChar_cube p hp hprimary) rw [hm,one_mul] at he change _=(Nat.card (Eis⧸Ideal.span {p}):ℂ) simpa only [primeCubicGauss_eq_gaussSum,pow_one,Nat.reduceSub, Nat.card_eq_fintype_card] using he lemma primeCubicGauss_one_eq (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:Eis): primeCubicGauss p hp hprimary 1 h=cubicUnitGaussSum h p:=by have he:=cubicUnitGaussSum_prime_power_lift p hp hprimary 0 h simpa only [pow_zero,one_mul,pow_one,Nat.zero_add] using he.symm end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.TranslatedFourierResidues /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups section open CubicKubota ActualEisensteinCubic ConcreteTraceCRT namespace RootNotationTranslatedFourierResidues01 abbrev Eis := ActualEisensteinCubic.O end RootNotationTranslatedFourierResidues01 open RootNotationTranslatedFourierResidues01 (Eis) lemma period_integral_fourier_translation (f:ℂ→ℂ) (hp:∀(n:Eis)(z:ℂ),f (z+3*eisEmbedding n)=f z) (h:Eis) (b:ℂ) : (∫z in periodDomain,f (z+b)*ShortDraftTrace.breveE (-cuspFrequency h*z))= ShortDraftTrace.breveE (cuspFrequency h*b)* ∫z in periodDomain,f z*ShortDraftTrace.breveE (-cuspFrequency h*z) := by let g : ℂ→ℂ := fun z=>f z*ShortDraftTrace.breveE (-cuspFrequency h*z) have hg : ∀(n:Eis)(z:ℂ),g (z+3*eisEmbedding n)=g z := by intro n z dsimp only [g] rw [hp,cuspFrequency_negative_period] have he (z:ℂ) : f (z+b)*ShortDraftTrace.breveE (-cuspFrequency h*z)= ShortDraftTrace.breveE (cuspFrequency h*b)*g (b+z) := by dsimp only [g] rw [mul_left_comm,←AddChar.map_add_eq_mul] congr 1 · rw [add_comm] · congr 1 ring simp_rw [he] rw [integral_const_mul,period_integral_translation g hg b] theorem rational_cusp_fourier_right_T (r:SL(2,ℤ)) (n:ℕ) (h:Eis) (s:ℂ) (hs:2hyperbolicEisenstein s (rationalComplex (r*ModularGroup.T^n) • w)*cuspFourierPhase h w let g : HyperbolicSpace→ℂ := fun w=>hyperbolicEisenstein s (rationalComplex r • w)*cuspFourierPhase h w have hf : Continuous f := ((hyperbolicEisenstein_continuous s hs).comp (continuous_hyperbolic_action _)).mul (cuspFourierPhase_continuous h) have hg : Continuous g := ((hyperbolicEisenstein_continuous s hs).comp (continuous_hyperbolic_action _)).mul (cuspFourierPhase_continuous h) change (∫w in cuspPeriodStrip 5 6,f w∂hyperbolicVolume)= ShortDraftTrace.breveE (cuspFrequency h*(n:ℂ))*∫w in cuspPeriodStrip 5 6,g w∂hyperbolicVolume rw [cuspPeriodStrip_integral_coordinates f hf.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable f hf), cuspPeriodStrip_integral_coordinates g hg.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable g hg), ←integral_const_mul] apply setIntegral_congr_fun measurableSet_Icc intro v hv have hv0 : 0hyperbolicEisenstein s (rationalComplex r • upperPoint z v hv0)) (fun a z=>hyperbolicEisenstein_rational_periodic r a s hs z v hv0) h (n:ℂ)] ring lemma translatedCuspFourier_residue_scaled_of_initial (h:Eis) (M N:levelTwo) (c:ℂ) (he : ∀s:ℂ,4c*translatedCuspFamily h N 2 3 (by norm_num) (by norm_num) s let domain : Set ℂ := {s | 1 translatedCuspFamily_analyticAt_nonreal h M 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne' have hg : AnalyticOnNhd ℂ g domain := fun s hs=>analyticAt_const.mul (translatedCuspFamily_analyticAt_nonreal h N 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne') have hstart : (5+Complex.I:ℂ)∈domain := by norm_num [domain] have hopen : IsOpen {s:ℂ | 4translatedCuspFamily h oppositeSource 2 3 (by norm_num) (by norm_num) s* cuspWhittakerHeightFactor s (3*(9*h))) (fun s=>translatedCuspFamily (3*(9*h)) oppositeSource 2 3 (by norm_num) (by norm_num) s* cuspWhittakerHeightFactor s h) {s:ℂ|1translatedCuspFamily h oppositeSource 2 3 (by norm_num) (by norm_num) s*cuspWhittakerHeightFactor s (3*(9*h))) domain := by intro s hs exact (translatedCuspFamily_analyticAt_nonreal h oppositeSource 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne').mul (cuspWhittakerHeightFactor_analyticAt (3*(9*h)) s hs.1) have hg : AnalyticOnNhd ℂ (fun s=>translatedCuspFamily (3*(9*h)) oppositeSource 2 3 (by norm_num) (by norm_num) s*cuspWhittakerHeightFactor s h) domain := by intro s hs exact (translatedCuspFamily_analyticAt_nonreal (3*(9*h)) oppositeSource 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne').mul (cuspWhittakerHeightFactor_analyticAt h s hs.1) have hstart : (5+Complex.I:ℂ)∈domain := by norm_num [domain] have hopen : IsOpen {s:ℂ | 4translatedCuspFamily h oppositeSource 2 3 (by norm_num) (by norm_num) s* cuspWhittakerHeightFactor s (3*(9*h)))=ᶠ[𝓝 (5+Complex.I:ℂ)] (fun s=>translatedCuspFamily (3*(9*h)) oppositeSource 2 3 (by norm_num) (by norm_num) s* cuspWhittakerHeightFactor s h) := by filter_upwards [hopen.mem_nhds (by norm_num)] with s hs rw [translatedCuspFamily_initial h oppositeSource 2 3 (by norm_num) (by norm_num) (by norm_num) s hs.1 hs.2,opposite_cusp_fourier_average s (by linarith [hs.1]), translatedCuspFamily_opposite_initial (9*h) s hs.1 hs.2] ring exact hf.eqOn_of_preconnected_of_eventuallyEq hg hconvex.isPreconnected hstart hev theorem translatedCuspFourier_unramified_residue (h:Eis) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace translatedCuspFourier h oppositeSource cubicEisensteinResidue= unramifiedGaussResidue (9*h)*cuspWhittakerHeightFactor (4/3:ℂ) h := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hh (k:Eis) : Tendsto (fun s:ℂ=>cuspWhittakerHeightFactor s k) (𝓝[≠] (4/3:ℂ)) (𝓝 (cuspWhittakerHeightFactor (4/3:ℂ) k)) := (cuspWhittakerHeightFactor_analyticAt k (4/3) (by norm_num)).continuousAt.tendsto.mono_left nhdsWithin_le_nhds have hl := ((translatedCuspFamily_residue_limit h oppositeSource 2 3 (by norm_num) (by norm_num)).mul (hh (3*(9*h)))).comp upperVertical_tendsto_cubic_punctured have hr := ((translatedCuspFamily_residue_limit (3*(9*h)) oppositeSource 2 3 (by norm_num) (by norm_num)).mul (hh h)).comp upperVertical_tendsto_cubic_punctured have hev : (fun t:ℝ=>((((4/3:ℂ)+(t:ℂ)*Complex.I)-4/3)* translatedCuspFamily h oppositeSource 2 3 (by norm_num) (by norm_num) ((4/3:ℂ)+(t:ℂ)*Complex.I))* cuspWhittakerHeightFactor ((4/3:ℂ)+(t:ℂ)*Complex.I) (3*(9*h))) =ᶠ[𝓝[>] (0:ℝ)] (fun t:ℝ=>((((4/3:ℂ)+(t:ℂ)*Complex.I)-4/3)* translatedCuspFamily (3*(9*h)) oppositeSource 2 3 (by norm_num) (by norm_num) ((4/3:ℂ)+(t:ℂ)*Complex.I))* cuspWhittakerHeightFactor ((4/3:ℂ)+(t:ℂ)*Complex.I) h) := by filter_upwards [self_mem_nhdsWithin] with t ht change 0 ShortDraftTrace.breveE (freq*(z+(x:ℂ)*direction))) (horizontalPhaseMultiplier freq direction* ShortDraftTrace.breveE (freq*(z+(t:ℂ)*direction))) t := by have hz : HasDerivAt (fun x : ℝ => freq*(z+(x:ℂ)*direction)) (freq*direction) t := by convert (((Complex.ofRealCLM.hasDerivAt (x:=t)).mul_const direction).const_add z).const_mul freq using 1 <;> first | rfl | simp have he := ((hz.add hz.star).const_mul (2*Real.pi*Complex.I)).cexp change HasDerivAt (fun x : ℝ => Complex.exp ((2*Real.pi*Complex.I)* (freq*(z+(x:ℂ)*direction)+star (freq*(z+(x:ℂ)*direction))))) ((2*Real.pi*Complex.I)*(freq*direction+star (freq*direction))* Complex.exp ((2*Real.pi*Complex.I)* (freq*(z+(t:ℂ)*direction)+star (freq*(z+(t:ℂ)*direction))))) t simpa only [Pi.add_apply,mul_comm] using he lemma horizontalPhaseMultiplier_norm (freq direction : ℂ) : ‖horizontalPhaseMultiplier freq direction‖≤4*Real.pi*‖freq‖*‖direction‖ := by have hc : ‖(2*Real.pi*Complex.I:ℂ)‖=2*Real.pi := by norm_num [norm_mul,abs_of_pos Real.pi_pos] unfold horizontalPhaseMultiplier rw [norm_mul,hc] calc _ ≤ (2*Real.pi)*(‖freq*direction‖+‖star (freq*direction)‖) := mul_le_mul_of_nonneg_left (norm_add_le _ _) (by positivity) _ = _ := by rw [norm_star,norm_mul];ring lemma norm_mul_exp_neg_bound (a r : ℝ) (ha : 0 ‖cuspFrequency h‖*Real.exp (-a*‖cuspFrequency h‖)) := by apply Summable.of_nonneg_of_le (fun h => mul_nonneg (norm_nonneg _) (Real.exp_pos _).le) (fun h => norm_mul_exp_neg_bound a _ ha) exact (summable_exp_neg_cuspFrequency_norm (a/2) (half_pos ha)).mul_left (2/a) namespace RootNotationTranslatedFourierResidues04 abbrev O := ActualEisensteinCubic.O end RootNotationTranslatedFourierResidues04 open RootNotationTranslatedFourierResidues04 (O) end open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationTranslatedFourierResidues05 abbrev O := ActualEisensteinCubic.O end RootNotationTranslatedFourierResidues05 open RootNotationTranslatedFourierResidues05 (O) def horizontalWirtingerBar (f : ℂ→ℂ) (z : ℂ) : ℂ := (1/2:ℂ)*(deriv (fun t : ℝ => f (z+(t:ℂ))) 0+ Complex.I*deriv (fun t : ℝ => f (z+(t:ℂ)*Complex.I)) 0) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ResidualCuspDecay /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationResidualCuspDecay01 abbrev O := ActualEisensteinCubic.O end RootNotationResidualCuspDecay01 open RootNotationResidualCuspDecay01 (O) def residualCuspDecayRate : ℝ := Real.pi*‖(3:ℂ)*ConcreteTraceCRT.eisLam‖⁻¹/4 lemma residualCuspDecayRate_pos : 0IsUnit r) _=Ideal.absNorm (Ideal.span {c}):=by simp only [Ideal.absNorm_apply,Submodule.cardQuot_apply,Nat.card_eq_fintype_card] theorem unramifiedCubicGaussSeries_summable_norm (s:ℂ) (hs:2‖(Ideal.absNorm I.val:ℂ)^(-s)* cubicUnitGaussSum h (primaryGenerator I.val)‖):=by have hs':1<(s-1).re:=by simp only [Complex.sub_re,Complex.one_re];linarith apply ((unramifiedNormWeight_summable_norm (s-1) hs').subtype (fun I:Ideal Eis=>primaryGenerator I≠0)).of_nonneg_of_le (fun _=>norm_nonneg _) intro I dsimp only [Function.comp_def] simp only [unramifiedNormWeight_shift,norm_mul,Complex.norm_natCast, unramifiedNormWeight_of_good s I.val I.2] have hg:=cubicUnitGaussSum_norm_le h (primaryGenerator I.val) I.2 (primaryGenerator_spec I.val I.2).2 rw [(primaryGenerator_spec I.val I.2).1] at hg nlinarith [norm_nonneg ((Ideal.absNorm I.val:ℂ)^(-s))] abbrev PrimeDeletedIdeal (p:Eis):={I:GoodIdeal//¬(Ideal.span {p}:Ideal Eis)∣I.val} def unramifiedPrimeDeletedSeries (p:Eis) (s:ℂ) (h:Eis):ℂ:= ∑'I:PrimeDeletedIdeal p,(Ideal.absNorm I.val.val:ℂ)^(-s)* cubicUnitGaussSum h (primaryGenerator I.val.val) lemma primaryGenerator_pow (I:Ideal Eis) (n:ℕ): primaryGenerator (I ^n)=primaryGenerator I ^n:= map_pow primaryGeneratorHom I n lemma gaussPrimeIdeal_prime (p:Eis) (hp:Prime p):Prime (Ideal.span {p}:Ideal Eis):= Ideal.prime_of_isPrime (Ideal.span_singleton_eq_bot.not.mpr hp.ne_zero) ((Ideal.span_singleton_prime hp.ne_zero).mpr hp) def gaussPrimeFactorMap (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (q:ℕ×PrimeDeletedIdeal p):GoodIdeal:= ⟨(Ideal.span {p})^q.1*q.2.val.val,by rw [primaryGenerator_mul,primaryGenerator_pow,primaryGenerator_span p hp.ne_zero hprimary] exact mul_ne_zero (pow_ne_zero _ hp.ne_zero) q.2.val.2⟩ lemma gaussPrimeFactorMap_bijective (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1): Function.Bijective (gaussPrimeFactorMap p hp hprimary):=by let P:Ideal Eis:=Ideal.span {p} have hP:Prime P:=gaussPrimeIdeal_prime p hp constructor · rintro ⟨n,I⟩ ⟨m,J⟩ heq have hh:P^n*I.val.val=P^m*J.val.val:=congrArg Subtype.val heq have hn:n=m:=by have hm:=congrArg (multiplicity P) hh rw [prime_power_remainder_multiplicity hP I.2, prime_power_remainder_multiplicity hP J.2] at hm exact hm subst m have hIJ:I=J:=Subtype.ext (Subtype.ext (mul_left_cancel₀ (pow_ne_zero n hP.ne_zero) hh)) subst J rfl · intro I obtain ⟨J,hJ,hnot⟩:=(FiniteMultiplicity.of_prime_left hP (primaryGenerator_ne_zero_ideal I.val I.2)).exists_eq_pow_mul_and_not_dvd have hgood:primaryGenerator J≠0:=by intro hzero apply I.2 rw [hJ,primaryGenerator_mul,hzero,mul_zero] refine ⟨(multiplicity P I.val,⟨⟨J,hgood⟩,hnot⟩),?_⟩ exact Subtype.ext hJ.symm def gaussPrimeFactorEquiv (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1): ℕ×PrimeDeletedIdeal p≃GoodIdeal:= Equiv.ofBijective (gaussPrimeFactorMap p hp hprimary) (gaussPrimeFactorMap_bijective p hp hprimary) lemma primeDeleted_generator_coprime (p:Eis) (hp:Prime p) (I:PrimeDeletedIdeal p): IsCoprime p (primaryGenerator I.val.val):= letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO by apply hp.coprime_iff_not_dvd.mpr intro hd apply I.2 rw [Ideal.dvd_iff_le,←(primaryGenerator_spec I.val.val I.val.2).1, Ideal.span_singleton_le_span_singleton] exact hd lemma primary_pow_congruence (p:Eis) (hprimary:lambda^2∣p-1) (n:ℕ): lambda^2∣p^n-1:=by simpa only [one_pow] using hprimary.trans (sub_dvd_pow_sub_pow p 1 n) lemma gaussPrimeFactor_term (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (s:ℂ) (h:Eis) (n:ℕ) (I:PrimeDeletedIdeal p): (Ideal.absNorm (gaussPrimeFactorMap p hp hprimary (n,I)).val:ℂ)^(-s)* cubicUnitGaussSum h (primaryGenerator (gaussPrimeFactorMap p hp hprimary (n,I)).val)= ((Ideal.absNorm (Ideal.span {p}):ℂ)^(-s))^n*cubicUnitGaussSum h (p^n)* ((Ideal.absNorm I.val.val:ℂ)^(-s)*cubicUnitGaussSum (h*p^n) (primaryGenerator I.val.val)):=by change (Ideal.absNorm ((Ideal.span {p})^n*I.val.val):ℂ)^(-s)* cubicUnitGaussSum h (primaryGenerator ((Ideal.span {p})^n*I.val.val))=_ rw [primaryGenerator_mul,primaryGenerator_pow,primaryGenerator_span p hp.ne_zero hprimary, cubicUnitGaussSum_coprime_product h (p^n) (primaryGenerator I.val.val) (pow_ne_zero _ hp.ne_zero) I.val.2 (primary_pow_congruence p hprimary n) (primaryGenerator_spec I.val.val I.val.2).2 (primeDeleted_generator_coprime p hp I).pow_left, map_mul,map_pow,Nat.cast_mul,Complex.natCast_mul_natCast_cpow] have he:((Ideal.absNorm (Ideal.span {p})^n:ℕ):ℂ)^(-s)= ((Ideal.absNorm (Ideal.span {p}):ℂ)^(-s))^n:=by rw [Nat.cast_pow,←Complex.natCast_cpow_natCast_mul,Complex.cpow_nat_mul] rw [he] ring theorem unramifiedCubicGaussSeries_prime_reindex (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (s:ℂ) (hs:2(Ideal.absNorm I.val:ℂ)^(-s)* cubicUnitGaussSum h (primaryGenerator I.val)):= (unramifiedCubicGaussSeries_summable_norm s hs h).of_norm have hpull:=(gaussPrimeFactorEquiv p hp hprimary).summable_iff.mpr hsum change Summable (fun q:ℕ×PrimeDeletedIdeal p=> (Ideal.absNorm (gaussPrimeFactorMap p hp hprimary q).val:ℂ)^(-s)* cubicUnitGaussSum h (primaryGenerator (gaussPrimeFactorMap p hp hprimary q).val)) at hpull rw [unramifiedCubicGaussSeries,←(gaussPrimeFactorEquiv p hp hprimary).tsum_eq] change (∑'q:ℕ×PrimeDeletedIdeal p, (Ideal.absNorm (gaussPrimeFactorMap p hp hprimary q).val:ℂ)^(-s)* cubicUnitGaussSum h (primaryGenerator (gaussPrimeFactorMap p hp hprimary q).val))=_ rw [hpull.tsum_prod] apply tsum_congr intro n change (∑'I:PrimeDeletedIdeal p,(Ideal.absNorm (gaussPrimeFactorMap p hp hprimary (n,I)).val:ℂ)^(-s)* cubicUnitGaussSum h (primaryGenerator (gaussPrimeFactorMap p hp hprimary (n,I)).val))=_ simp_rw [gaussPrimeFactor_term p hp hprimary s h n] exact tsum_mul_left lemma unramifiedPrimeDeletedSeries_cube_shift (p:Eis) (hp:Prime p) (s:ℂ) (h:Eis): unramifiedPrimeDeletedSeries p s (h*p^3)=unramifiedPrimeDeletedSeries p s h:=by apply tsum_congr intro I congr 1 exact cubicUnitGaussSum_cube_shift h _ p I.val.2 (primaryGenerator_spec I.val.val I.val.2).2 (primeDeleted_generator_coprime p hp I).symm end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.PrimePowerGaussSums namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss lemma cubicUnitGaussSum_one (h:ActualEisensteinCubic.O):cubicUnitGaussSum h 1=1:=by let:Subsingleton (ActualEisensteinCubic.O⧸Ideal.span {(1:ActualEisensteinCubic.O)}):= Ideal.Quotient.subsingleton_iff.mpr (by simp) let r:CubicUnitResidue (1:ActualEisensteinCubic.O):=⟨1,isUnit_one⟩ rw [cubicUnitGaussSum,tsum_eq_single r (fun b hb=>False.elim (hb (Subsingleton.elim b r)))] rw [symbol_one,map_one,one_mul, residueAdditive_three_congr h 1 _ 0 one_ne_zero (one_dvd _)] simp only [residueAdditive,map_zero,mul_zero,zero_div,AddChar.map_zero_eq_one] lemma cubicUnitGaussSum_frequency_dvd (h c:ActualEisensteinCubic.O) (hc:c≠0) (hch:c∣h): cubicUnitGaussSum h c=cubicUnitGaussSum 0 c:= cubicUnitGaussSum_frequency_congr h 0 c hc (by simpa only [sub_zero] using hch) lemma cubicUnitGaussSum_prime_power_zero (p:ActualEisensteinCubic.O) (hp:Prime p) (hprimary:lambda^2∣p-1) (n:ℕ): cubicUnitGaussSum 0 (p^(n+1))= if 3∣n+1 then (Ideal.absNorm (Ideal.span {p}):ℂ)^n* ((Ideal.absNorm (Ideal.span {p}):ℂ)-1) else 0:=by have he:=cubicUnitGaussSum_prime_power_lift p hp hprimary n 0 simp only [mul_zero] at he rw [he,primeCubicGauss_of_dvd p hp hprimary (n+1) 0 (dvd_zero _)] split_ifs <;>ring lemma cubicUnitGaussSum_prime_power_too_large (p:ActualEisensteinCubic.O) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:ActualEisensteinCubic.O) (hph:¬p∣h) (a k:ℕ) (hk:a+1omega | succ n=> have hd:=cubicUnitGaussSum_prime_power_support p hp hprimary n (h*p^a) hG have hd':p^(a+1)∣p^a*h:=by rw [mul_comm] exact (pow_dvd_pow p (by omega:a+1≤n)).trans hd rw [pow_succ] at hd' exact hph ((mul_dvd_mul_iff_left (pow_ne_zero _ hp.ne_zero)).mp hd') lemma unramifiedPrimeDeletedSeries_pow_mod (p:ActualEisensteinCubic.O) (hp:Prime p) (s:ℂ) (h:ActualEisensteinCubic.O) (n:ℕ): unramifiedPrimeDeletedSeries p s (h*p^n)= unramifiedPrimeDeletedSeries p s (h*p^(n%3)):=by apply tsum_congr intro I congr 1 have he:p^n=p^(n%3)*(p^(n/3))^3:=by rw [←pow_mul,←pow_add] congr 1 omega rw [he,←mul_assoc] exact cubicUnitGaussSum_cube_shift _ _ _ I.val.2 (primaryGenerator_spec I.val.val I.val.2).2 (primeDeleted_generator_coprime p hp I).symm.pow_right theorem unramifiedCubicGaussSeries_prime_finite (p:ActualEisensteinCubic.O) (hp:Prime p) (hprimary:lambda^2∣p-1) (s:ℂ) (hs:2 (q.1:ℂ)^(2/3:ℂ)) p := (Complex.continuousAt_ofReal_cpow_const p.1 (2/3:ℂ) (Or.inr hp.ne')).comp continuousAt_fst have hsource : ContinuousAt (fun q : ℝ × ℂ => sourceFourierKernel (4/3) (cuspFrequency h*q.1)) p := (sourceFourierKernel_continuous_freq (4/3) (by norm_num)).continuousAt.comp (by fun_prop) have hphase : Continuous (fun q : ℝ × ℂ => ShortDraftTrace.breveE (cuspFrequency h*q.2)) := by change Continuous (fun q : ℝ × ℂ => Complex.exp (2*Real.pi*Complex.I* ((cuspFrequency h*q.2)+starRingEnd ℂ (cuspFrequency h*q.2)))) fun_prop exact (((continuousAt_const.mul hpow).mul hsource).mul hphase.continuousAt).continuousWithinAt lemma slab_bound (a b : ℝ) (ha : 0 coeff.term h p) := by obtain ⟨C,hC,hbound⟩ := coeff.slab_bound p.1 p.1 hp le_rfl apply Summable.of_norm exact Summable.of_nonneg_of_le (fun h => norm_nonneg _) (fun h => hbound h p ⟨le_rfl,le_rfl⟩) ((summable_exp_neg_cuspFrequency_norm (Real.pi*p.1) (mul_pos Real.pi_pos hp)).mul_left C) def series (p : ℝ × ℂ) : ℂ := ∑'h : ActualEisensteinCubic.O,coeff.term h p lemma series_continuousOn_slab (a b : ℝ) (ha : 0 C*Real.exp (-(Real.pi*a)*‖cuspFrequency h‖)) · intro h exact (coeff.term_continuousOn h).mono (fun p hp => ha.trans_le hp.1) · exact (summable_exp_neg_cuspFrequency_norm (Real.pi*a) (mul_pos Real.pi_pos ha)).mul_left C · exact hbound lemma series_continuousOn : ContinuousOn coeff.series {p : ℝ × ℂ | 0 coeff.term_eq_amplitude v hv h z) lemma series_period (v : ℝ) (z : ℂ) (n : ActualEisensteinCubic.O) : coeff.series (v,z+3*ConcreteTraceCRT.eisEmbedding n)=coeff.series (v,z) := by apply tsum_congr intro h by_cases hh : h=0 · simp only [term,if_pos hh] simp only [term,if_neg hh] rw [mul_add,AddChar.map_add_eq_mul,cuspFrequency_period,mul_one] def function (w : HyperbolicSpace) : ℂ := coeff.series (hyperbolicHeight w,hyperbolicHorizontal w) lemma function_continuous : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous coeff.function := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by apply continuous_iff_continuousAt.mpr intro w have hopen : IsOpen {p : ℝ × ℂ | 0 (hyperbolicHeight u,hyperbolicHorizontal u)) (hyperbolicHeight_continuous.prodMk hyperbolicHorizontal_continuous).continuousAt end SubexponentialBesselCoefficients end open Filter MeasureTheory open scoped BigOperators Classical Topology ENNReal open Finset AddChar MulChar EisensteinEmbedding namespace SubexponentialBesselCoefficients variable (coeff : SubexponentialBesselCoefficients) lemma series_fourier (v : ℝ) (hv : 0 coeff.amplitude v h*ShortDraftTrace.breveE (cuspFrequency h*z)* ShortDraftTrace.breveE (-cuspFrequency k*z) have hc (h : ActualEisensteinCubic.O) : Continuous (f h) := by change Continuous (fun z : ℂ => coeff.amplitude v h* Complex.exp (2*Real.pi*Complex.I*((cuspFrequency h*z)+starRingEnd ℂ (cuspFrequency h*z)))* Complex.exp (2*Real.pi*Complex.I*((-cuspFrequency k*z)+starRingEnd ℂ (-cuspFrequency k*z)))) fun_prop obtain ⟨C,hC,hbound⟩ := coeff.slab_bound v v hv le_rfl have hfbound (h : ActualEisensteinCubic.O) (z : ℂ) : ‖f h z‖≤C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖) := by change ‖(coeff.amplitude v h*ShortDraftTrace.breveE (cuspFrequency h*z))* ShortDraftTrace.breveE (-cuspFrequency k*z)‖≤_ rw [←coeff.term_eq_amplitude v hv h z,norm_mul,breveE_norm,mul_one] exact hbound h (v,z) ⟨le_rfl,le_rfl⟩ have hi (h : ActualEisensteinCubic.O) : IntegrableOn (f h) periodDomain volume := (integrable_const (C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖))).mono' (hc h).aestronglyMeasurable (Eventually.of_forall (hfbound h)) have hnorm (h : ActualEisensteinCubic.O) : (∫z in periodDomain,‖f h z‖)≤ volume.real periodDomain*(C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖)) := by have hh := integral_mono_ae (hi h).norm (integrable_const (C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖))) (Eventually.of_forall (hfbound h)) simpa only [setIntegral_const,smul_eq_mul] using hh have hs : Summable (fun h : ActualEisensteinCubic.O => ∫z in periodDomain,‖f h z‖) := by apply Summable.of_nonneg_of_le (fun h => integral_nonneg (fun z => norm_nonneg _)) hnorm exact ((summable_exp_neg_cuspFrequency_norm (Real.pi*v) (mul_pos Real.pi_pos hv)).mul_left C).mul_left (volume.real periodDomain) have hterm (h : ActualEisensteinCubic.O) : (∫z in periodDomain,f h z)= if h=k then ((9*Real.sqrt 3/2:ℝ):ℂ)*coeff.amplitude v h else 0 := by change (∫z in periodDomain,coeff.amplitude v h*ShortDraftTrace.breveE (cuspFrequency h*z)* ShortDraftTrace.breveE (-cuspFrequency k*z))=_ simp_rw [mul_assoc] rw [integral_const_mul,integral_cusp_character_product] split_ifs <;> ring calc _ = ∫z in periodDomain,∑'h : ActualEisensteinCubic.O,f h z := by apply integral_congr_ae exact Eventually.of_forall (fun z => by change (∑'h : ActualEisensteinCubic.O,coeff.term h (v,z))*ShortDraftTrace.breveE (-cuspFrequency k*z)=_ rw [←tsum_mul_right] apply tsum_congr intro h rw [coeff.term_eq_amplitude v hv h z]) _ = ∑'h : ActualEisensteinCubic.O,∫z in periodDomain,f h z := (integral_tsum_of_summable_integral_norm hi hs).symm _ = ∑'h : ActualEisensteinCubic.O,if h=k then ((9*Real.sqrt 3/2:ℝ):ℂ)*coeff.amplitude v h else 0 := tsum_congr hterm _ = _ := by simp lemma series_height_continuous (v : ℝ) (hv : 0 coeff.series (v,z)) := by apply continuous_iff_continuousAt.mpr intro z have hopen : IsOpen {p : ℝ × ℂ | 0 (v,z)) (by fun_prop) def fullFunction (constantTerm : ℂ) (w : HyperbolicSpace) : ℂ := constantTerm*(hyperbolicHeight w:ℂ)^(2/3:ℂ)+coeff.function w lemma fullFunction_continuous (constantTerm : ℂ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous (coeff.fullFunction constantTerm) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by have hp : Continuous (fun w : HyperbolicSpace => (hyperbolicHeight w:ℂ)^(2/3:ℂ)) := by apply continuous_iff_continuousAt.mpr intro w exact (Complex.continuousAt_ofReal_cpow_const (hyperbolicHeight w) (2/3:ℂ) (Or.inr (hyperbolicHeight_pos w).ne')).comp (f := hyperbolicHeight) hyperbolicHeight_continuous.continuousAt exact (continuous_const.mul hp).add coeff.function_continuous lemma fullFunction_fourier (constantTerm : ℂ) (v : ℝ) (hv : 0 ShortDraftTrace.breveE (-cuspFrequency k*z)) := by change Continuous (fun z : ℂ => Complex.exp (2*Real.pi*Complex.I* ((-cuspFrequency k*z)+starRingEnd ℂ (-cuspFrequency k*z)))) fun_prop have hc0 := periodDomain_integrable_of_continuous (fun z => (constantTerm*(v:ℂ)^(2/3:ℂ))*ShortDraftTrace.breveE (-cuspFrequency k*z)) (continuous_const.mul hphase) have hcn := periodDomain_integrable_of_continuous (fun z => coeff.series (v,z)*ShortDraftTrace.breveE (-cuspFrequency k*z)) ((coeff.series_height_continuous v hv).mul hphase) simp_rw [fullFunction,function,hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint,add_mul] rw [integral_add hc0 hcn,integral_const_mul,integral_cusp_character,coeff.series_fourier v hv k] by_cases hk : k=0 · simp only [if_pos hk,amplitude,mul_zero] ring · simp only [if_neg hk,mul_zero,zero_add] lemma fullFunction_period (constantTerm : ℂ) (v : ℝ) (hv : 0 coeff.fullFunction constantTerm (upperPoint z v hv)) := by have hc := coeff.series_height_continuous v hv simp only [fullFunction,function,hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint] fun_prop lemma fullFunction_height_memLp (constantTerm : ℂ) (v : ℝ) (hv : 0 coeff.fullFunction constantTerm (cuspCoordinateLift (v,z))) 2 (volume.restrict periodDomain) := by simp_rw [cuspCoordinateLift_positive v _ hv] have hc := coeff.fullFunction_height_continuous constantTerm v hv apply (memLp_two_iff_integrable_sq_norm hc.aestronglyMeasurable).mpr have hn : Continuous (fun z : ℂ => ‖coeff.fullFunction constantTerm (upperPoint z v hv)‖^2) := by fun_prop apply (hn.continuousOn.integrableOn_compact (isCompact_closedBall (0:ℂ) (∑i,‖periodBasis i‖))).mono_set intro z hz simpa only [Metric.mem_closedBall,dist_zero_right] using norm_mem_periodDomain z hz end SubexponentialBesselCoefficients end CubicEisenstein open scoped BigOperators Classical namespace ShortDraftCRT variable {R : Type*} [CommRing R] end ShortDraftCRT open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace CubicEisenstein open CubicKubota def translatedHeightCompact (M:levelTwo) (a b:ℝ) : Set KernelQuotient := kernelSourceAction M '' cuspHeightQuotientCompact a b lemma translatedHeightCompact_isCompact (M:levelTwo) (a b:ℝ) (ha:0z*cuspWeightedFourierPhase ρ h w) hw lemma translatedHeightFourier_restrict (a b:ℝ) (ha:0z*cuspWeightedFourierPhase ρ h w) (hw.trans (Set.indicator_of_mem hm _)) def translatedHeightFamily (a b:ℝ) (ha:0(s-4/3)*translatedHeightFamily a b ha ρ h M s) (𝓝[≠] (4/3:ℂ)) (𝓝 (translatedHeightFourier a b ha ρ h M cubicEisensteinResidue)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let translatedHeightFourier_restrict := fun F => OAI.CubicEisenstein.translatedHeightFourier_restrict a b ha ρ h M F have hh:=(translatedHeightFourier a b ha ρ h M).continuous.continuousAt.tendsto.comp (cubicEisensteinResidue_local_limit _ (translatedHeightCompact_isCompact M a b ha)) simpa only [Function.comp_def,map_smul,smul_eq_mul,translatedHeightFourier_restrict, translatedHeightFamily] using hh lemma translatedHeightFamily_initial (a b:ℝ) (ha:0hyperbolicEisenstein s (sourceComplexMatrix oppositeSource • w)* cuspWeightedFourierPhase ρ h w have hg:Continuous g := ((hyperbolicEisenstein_continuous s hs).comp (continuous_hyperbolic_action _)).mul (cuspWeightedFourierPhase_continuous ρ h) rw [cuspPeriodStrip_integral_coordinates_of_pos a b ha g hg.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable_of_pos a b ha g hg)] rw [cuspIntervalWhittakerHeightFactor,←integral_const_mul] apply setIntegral_congr_fun measurableSet_Icc intro v hv have hv0:0translatedHeightFamily a b ha ρ h oppositeSource s*cuspWhittakerHeightFactor s h) (fun s=>translatedCuspFamily h oppositeSource 2 3 (by norm_num) (by norm_num) s* cuspIntervalWhittakerHeightFactor a b ρ s h) {s:ℂ|1translatedHeightFamily a b ha ρ h oppositeSource s* cuspWhittakerHeightFactor s h) domain := fun s hs=> (translatedHeightFamily_analyticAt a b ha ρ h oppositeSource s hs.1.ne' hs.2.ne').mul (cuspWhittakerHeightFactor_analyticAt h s hs.1) have hg : AnalyticOnNhd ℂ (fun s=>translatedCuspFamily h oppositeSource 2 3 (by norm_num) (by norm_num) s* cuspIntervalWhittakerHeightFactor a b ρ s h) domain := fun s hs=> (translatedCuspFamily_analyticAt_nonreal h oppositeSource 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne').mul (cuspIntervalWhittakerHeightFactor_analyticAt a b ha ρ h s hs.1) have hstart : (5+Complex.I:ℂ)∈domain := by norm_num [domain] have hopen : IsOpen {s:ℂ | 4translatedHeightFamily a b ha ρ h oppositeSource s*cuspWhittakerHeightFactor s h) =ᶠ[𝓝 (5+Complex.I:ℂ)] (fun s=>translatedCuspFamily h oppositeSource 2 3 (by norm_num) (by norm_num) s* cuspIntervalWhittakerHeightFactor a b ρ s h) := by filter_upwards [hopen.mem_nhds (by norm_num)] with s hs rw [translatedHeightFamily_initial a b ha ρ h oppositeSource s hs.1 hs.2, opposite_height_fourier_average a b ha ρ h s (by linarith [hs.1]), translatedCuspFamily_initial h oppositeSource 2 3 (by norm_num) (by norm_num) (by norm_num) s hs.1 hs.2, opposite_cusp_fourier_average s (by linarith [hs.1])] ring exact hf.eqOn_of_preconnected_of_eventuallyEq hg hconvex.isPreconnected hstart hev theorem translatedHeightFourier_opposite_residue (a b:ℝ) (ha:0((((4/3:ℂ)+(t:ℂ)*Complex.I)-4/3)* translatedHeightFamily a b ha ρ h oppositeSource ((4/3:ℂ)+(t:ℂ)*Complex.I))* cuspWhittakerHeightFactor ((4/3:ℂ)+(t:ℂ)*Complex.I) h) =ᶠ[𝓝[>] (0:ℝ)] (fun t:ℝ=>((((4/3:ℂ)+(t:ℂ)*Complex.I)-4/3)* translatedCuspFamily h oppositeSource 2 3 (by norm_num) (by norm_num) ((4/3:ℂ)+(t:ℂ)*Complex.I))* cuspIntervalWhittakerHeightFactor a b ρ ((4/3:ℂ)+(t:ℂ)*Complex.I) h) := by filter_upwards [self_mem_nhdsWithin] with t ht change 0hyperbolicEisenstein s (rationalComplex (r*ModularGroup.T^n) • w)*cuspWeightedFourierPhase ρ h w let g : HyperbolicSpace→ℂ := fun w=>hyperbolicEisenstein s (rationalComplex r • w)*cuspWeightedFourierPhase ρ h w have hf : Continuous f := ((hyperbolicEisenstein_continuous s hs).comp (continuous_hyperbolic_action _)).mul (cuspWeightedFourierPhase_continuous ρ h) have hg : Continuous g := ((hyperbolicEisenstein_continuous s hs).comp (continuous_hyperbolic_action _)).mul (cuspWeightedFourierPhase_continuous ρ h) change (∫w in cuspPeriodStrip a b,f w∂hyperbolicVolume)= ShortDraftTrace.breveE (cuspFrequency h*(n:ℂ))*∫w in cuspPeriodStrip a b,g w∂hyperbolicVolume rw [cuspPeriodStrip_integral_coordinates_of_pos a b ha f hf.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable_of_pos a b ha f hf), cuspPeriodStrip_integral_coordinates_of_pos a b ha g hg.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable_of_pos a b ha g hg),←integral_const_mul] apply setIntegral_congr_fun measurableSet_Icc intro v hv have hv0:0hyperbolicEisenstein s (rationalComplex r • upperPoint z v hv0)*ρ v) (fun m z=>congrArg (fun q:ℂ=>q*ρ v) (hyperbolicEisenstein_rational_periodic r m s hs z v hv0)) h (n:ℂ) dsimp only rw [hslice] ring lemma translatedHeightFourier_residue_scaled_of_initial (a b:ℝ) (ha:0c*translatedHeightFamily a b ha ρ h N s let domain : Set ℂ := {s | 1 translatedHeightFamily_analyticAt a b ha ρ h M s hs.1.ne' hs.2.ne' have hg : AnalyticOnNhd ℂ g domain := fun s hs=>analyticAt_const.mul (translatedHeightFamily_analyticAt a b ha ρ h N s hs.1.ne' hs.2.ne') have hstart : (5+Complex.I:ℂ)∈domain := by norm_num [domain] have hopen : IsOpen {s:ℂ | 4kernelCuspHeightFourier a b ha ρ h cubicEisensteinResidue | Sum.inr ab=>ShortDraftTrace.breveE (cuspFrequency h*(ab.2.val:ℂ))* translatedHeightFourier a b ha ρ h oppositeSource cubicEisensteinResidue := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by cases sector with | inl index => rw [←one_mul (kernelCuspHeightFourier a b ha ρ h cubicEisensteinResidue),←translatedHeightFourier_one a b ha ρ h] apply translatedHeightFourier_residue_scaled_of_initial intro s hs hi simp_rw [sourceComplexMatrix_rationalLift,hyperbolicEisenstein_bruhat] simp only [map_one,one_smul,one_mul] | inr ab => apply translatedHeightFourier_residue_scaled_of_initial intro s hs hi simp_rw [sourceComplexMatrix_rationalLift,hyperbolicEisenstein_bruhat] change (∫w in cuspPeriodStrip a b, hyperbolicEisenstein s (rationalComplex ModularGroup.S • (rationalComplex (ModularGroup.T^ab.2.val) • w))*cuspWeightedFourierPhase ρ h w∂hyperbolicVolume)= ShortDraftTrace.breveE (cuspFrequency h*(ab.2.val:ℂ))* ∫w in cuspPeriodStrip a b,hyperbolicEisenstein s (rationalComplex ModularGroup.S • w)* cuspWeightedFourierPhase ρ h w∂hyperbolicVolume simpa only [map_mul,mul_smul] using rational_height_fourier_right_T a b ha ρ ModularGroup.S ab.2.val h s (by linarith) theorem kernelSourceProjection_height_fourier (a b:ℝ) (ha:0sourceBesselFunction (cuspCoordinateLift (v,z))) 2 (volume.restrict periodDomain) := sourceBesselCoefficients.fullFunction_height_memLp _ v hv end open Filter MeasureTheory open scoped BigOperators Classical Topology namespace RootNotationSourceBesselExpansion05 abbrev O := ActualEisensteinCubic.O end RootNotationSourceBesselExpansion05 open RootNotationSourceBesselExpansion05 (O) lemma sourceResidualFullMode_density_integrable (a b : ℝ) (ha : 0 sourceResidualFullModeAmplitude v h/(v:ℂ)^3) (Set.Icc a b) volume := by by_cases hh : h=0 · subst h have hi : IntegrableOn (fun v : ℝ => (3*(Real.pi:ℂ))*constantArithmeticResidue*(v:ℂ)^(-(7/3:ℂ))) (Set.Icc a b) volume := by apply ContinuousOn.integrableOn_Icc intro v hv exact (continuousAt_const.mul (Complex.continuousAt_ofReal_cpow_const v (-(7/3:ℂ)) (Or.inr (ha.trans_le hv.1).ne'))).continuousWithinAt apply hi.congr filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv exact (sourceResidualFullModeAmplitude_zero_density v (ha.trans_le hv.1)).symm · apply ((cubicBesselHeight_integrable a b ha h hh).const_mul (sourceResidualFourierCoefficient h)).congr filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv exact (sourceResidualFullModeAmplitude_nonzero_density v (ha.trans_le hv.1) h hh).symm lemma projectedResidue_slice_coefficient_ae (a b : ℝ) (ha : 0 ((9*Real.sqrt 3/2:ℝ):ℂ)*(sourceResidualFullModeAmplitude v h/(v:ℂ)^3)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply interval_ae_eq_of_boundedContinuous_height_tests a b _ _ (kernelCuspSliceCoefficient_integrable a b ha h (kernelSourceProjection cubicEisensteinResidue)) ((sourceResidualFullMode_density_integrable a b ha h).const_mul _) intro ρ rw [←kernelCuspHeightFourier_eq_slice_integral a b ha ρ h (kernelSourceProjection cubicEisensteinResidue), kernelSourceProjection_height_full a b ha ρ h,←integral_const_mul] apply integral_congr_ae exact Eventually.of_forall (fun v => by ring) lemma projectedResidue_all_slice_coefficients_ae (a b : ℝ) (ha : 0 projectedResidue_slice_coefficient_ae a b ha h) lemma projectedResidue_all_fourier_integrals_ae (a b : ℝ) (ha : 0kernelSourceProjection cubicEisensteinResidue (integralOrbitProjection globalKubotaKernel (cuspCoordinateLift (v,z)))) =ᵐ[volume.restrict periodDomain] (fun z=>sourceBesselFunction (cuspCoordinateLift (v,z))) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by filter_upwards [projectedResidue_all_fourier_integrals_ae a b ha, kernelCuspSections_memLp a b ha (kernelSourceProjection cubicEisensteinResidue), ae_restrict_mem measurableSet_Icc] with v hfour hL hv have hpos:0kernelSourceProjection cubicEisensteinResidue (integralOrbitProjection globalKubotaKernel w)) =ᵐ[hyperbolicVolume] sourceBesselFunction := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by apply hyperbolic_eq_ae_of_period_cells _ _ ((MeasureTheory.Lp.stronglyMeasurable (kernelSourceProjection cubicEisensteinResidue)).measurable.comp (measurable_integralOrbitProjection _)) sourceBesselFunction_continuous.measurable · intro v hv z n exact congrArg (kernelSourceProjection cubicEisensteinResidue) (kernelProjection_upper_period v hv z n) · exact sourceBesselFunction_period · exact projectedResidue_cell_slices_ae theorem cubicSourceResidualFunction_eq_bessel : cubicSourceResidualFunction=sourceBesselFunction := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_hyperbolicVolume_fullSupport := @OAI.CubicEisenstein.hyperbolicVolume_fullSupport by have he : cubicSourceResidualFunction=ᵐ[hyperbolicVolume]sourceBesselFunction := by filter_upwards [cubicSourceResidualFunction_represents_projection,sourceBesselFunction_represents_projection] with w hw hs exact hw.symm.trans hs exact Measure.eq_of_ae_eq he cubicSourceResidualFunction_continuous sourceBesselFunction_continuous theorem cubicSourceResidualFunction_bessel (v:ℝ) (hv:0 cubicBesselDensity y t) (cubicBesselDensityDeriv x t) x := by have he := ((((hasDerivAt_id x).pow 2).div_const (4*t)).const_sub (-t)).exp.const_mul (t^(-(2:ℝ)/3)) simp only [Pi.pow_apply,id_eq,Nat.cast_ofNat,mul_one] at he convert he using 1 <;> first | rfl | ( unfold cubicBesselDensityDeriv cubicBesselDensity ring) lemma cubic_exp_damping (y : ℝ) : y*Real.exp (-y)≤1 := by have hy : y≤Real.exp y := by linarith [Real.add_one_le_exp y] calc _ ≤ Real.exp y*Real.exp (-y) := mul_le_mul_of_nonneg_right hy (Real.exp_pos _).le _ = 1 := by rw [←Real.exp_add,add_neg_cancel,Real.exp_zero] lemma cubicBesselDensityDeriv_bound (delta x t : ℝ) (hdelta : 0 t^(-(2:ℝ)/3)*Real.exp (-t/2)) (Set.Ioi 0) volume := by have hh := integrableOn_rpow_mul_exp_neg_mul_rpow (s:=-(2:ℝ)/3) (p:=1) (b:=1/2) (by norm_num) (by norm_num) (by norm_num) apply hh.congr filter_upwards with t rw [Real.rpow_one] congr 1 congr 1 ring lemma cubicBesselDensityDeriv_integrable (x : ℝ) (hx : 0 ∫t in Set.Ioi (0:ℝ),cubicBesselDensity y t) (∫t in Set.Ioi (0:ℝ),cubicBesselDensityDeriv x t) x := by let delta := x/2 have hdelta : 0 (4/delta)*(t^(-(2:ℝ)/3)*Real.exp (-t/2))) hU (Eventually.of_forall (fun y => by unfold cubicBesselDensity;fun_prop)) (cubicBesselDensity_integrable x) (by unfold cubicBesselDensityDeriv cubicBesselDensity;fun_prop) hbound (cubicBesselDerivativeMajorant_integrable.const_mul (4/delta)) (Eventually.of_forall (fun t y _ => cubicBesselDensity_hasDerivAt y t)) exact h.2 def cubicBesselRealDeriv (x : ℝ) : ℝ := (-(1:ℝ)/12)*(x/2)^(-(4:ℝ)/3)*(∫t in Set.Ioi (0:ℝ),cubicBesselDensity x t)+ (1/2:ℝ)*(x/2)^(-(1:ℝ)/3)*(∫t in Set.Ioi (0:ℝ),cubicBesselDensityDeriv x t) def schlafliBesselK_cubic_derivative (x : ℝ) : ℂ := (cubicBesselRealDeriv x:ℂ) lemma schlafliBesselK_cubic_hasDerivAt (x : ℝ) (hx : 0 schlafliBesselK (1/3) y) (schlafliBesselK_cubic_derivative x) x := by have hp : HasDerivAt (fun y : ℝ => (1/2:ℝ)*(y/2)^(-(1:ℝ)/3)) ((-(1:ℝ)/12)*(x/2)^(-(4:ℝ)/3)) x := by have hh := (((hasDerivAt_id x).div_const 2).rpow_const (p:=-(1:ℝ)/3) (Or.inl (by positivity : x/2≠0))).const_mul (1/2:ℝ) convert hh using 1 <;> first | rfl | (norm_num; ring) have hr := hp.mul (cubicBesselIntegral_hasDerivAt x hx) have hreal : HasDerivAt (fun y : ℝ => (1/2:ℝ)*(y/2)^(-(1:ℝ)/3)* (∫t in Set.Ioi (0:ℝ),cubicBesselDensity y t)) (cubicBesselRealDeriv x) x := by exact hr apply hreal.ofReal_comp.congr_of_eventuallyEq filter_upwards [Ioi_mem_nhds hx] with y hy exact schlafliBesselK_cubic_real y hy lemma cubicBesselDerivativeMajorant_integral : (∫t in Set.Ioi (0:ℝ),t^(-(2:ℝ)/3)*Real.exp (-t/2))= (2:ℝ)^(1/3:ℝ)*Real.Gamma (1/3) := by have hh := Real.integral_rpow_mul_exp_neg_mul_Ioi (a := (1/3:ℝ)) (r := (1/2:ℝ)) (by norm_num) (by norm_num) convert hh using 1 <;> norm_num ; congr 2 ; funext t ; ring_nf lemma cubicBesselIntegral_norm_bound (x : ℝ) : ‖∫t in Set.Ioi (0:ℝ),cubicBesselDensity x t‖≤ Real.exp (-x/2)*((2:ℝ)^(1/3:ℝ)*Real.Gamma (1/3)) := by have hpos : 0≤∫t in Set.Ioi (0:ℝ),cubicBesselDensity x t := by apply integral_nonneg_of_ae filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht exact cubicBesselDensity_nonneg x t ht.le rw [Real.norm_of_nonneg hpos] exact cubicBesselIntegral_upper x lemma cubicBesselIntegralDeriv_norm_bound (delta x : ℝ) (hdelta : 0 rw [Nat.zero_add,cubicUnitGaussSum_frequency_dvd _ _ (pow_ne_zero _ hp.ne_zero) (dvd_mul_left (p^3) h)] have he:=cubicUnitGaussSum_prime_power_zero p hp hprimary 2 norm_num at he ⊢ rw [he,cubicUnitGaussSum_one] ring | succ n=> simpa only [show n+1+3=n+4 by omega,Nat.succ_ne_zero,ite_false,sub_zero] using cubicUnitGaussSum_prime_cube_shift_pos p hp hprimary n h private def primeExpansionTerm (p:Eis) (s:ℂ) (h:Eis) (k:ℕ):ℂ:= ((Ideal.absNorm (Ideal.span {p}):ℂ)^(-s))^k*cubicUnitGaussSum h (p^k)* unramifiedPrimeDeletedSeries p s (h*p^k) private lemma primeExpansionTerm_cube_shift (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (s:ℂ) (h:Eis) (k:ℕ): primeExpansionTerm p s (h*p^3) (k+3)= (Ideal.absNorm (Ideal.span {p}):ℂ)^3*((Ideal.absNorm (Ideal.span {p}):ℂ)^(-s))^3* primeExpansionTerm p s h k- if k=0 then (Ideal.absNorm (Ideal.span {p}):ℂ)^2* ((Ideal.absNorm (Ideal.span {p}):ℂ)^(-s))^3*unramifiedPrimeDeletedSeries p s h else 0:=by have hv:unramifiedPrimeDeletedSeries p s (h*p^3*p^(k+3))= unramifiedPrimeDeletedSeries p s (h*p^k):=by have he:h*p^3*p^(k+3)=(h*p^k*p^3)*p^3:=by rw [pow_add];ring rw [he,unramifiedPrimeDeletedSeries_cube_shift p hp, unramifiedPrimeDeletedSeries_cube_shift p hp] unfold primeExpansionTerm rw [cubicUnitGaussSum_prime_cube_shift p hp hprimary k h,hv,pow_add] split_ifs with hk · subst k simp only [pow_zero,mul_one,cubicUnitGaussSum_one] ring · ring theorem unramifiedCubicGaussSeries_cube_step (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (s:ℂ) (hs:2cuspWhittakerHeightFactor s (3*h) let D:Set ℂ:={s|1T h0 s*H h1 s*H h2 s let g:ℂ→ℂ:=fun s=>A s*T h1 s*H h0 s*H h2 s+B s*T h2 s*H h0 s*H h1 s have hT (h:Eis):AnalyticOnNhd ℂ (T h) D:=fun s hs=> translatedCuspFamily_analyticAt_nonreal (3*h) oppositeSource 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne' have hH (h:Eis):AnalyticOnNhd ℂ (H h) D:=fun s hs=> cuspWhittakerHeightFactor_analyticAt (3*h) s hs.1 have hf:AnalyticOnNhd ℂ f D:=fun s hs=>((hT h0 s hs).mul (hH h1 s hs)).mul (hH h2 s hs) have hg:AnalyticOnNhd ℂ g D:=fun s hs=> (((hA s hs).mul (hT h1 s hs)).mul (hH h0 s hs)).mul (hH h2 s hs) |>.add ((((hB s hs).mul (hT h2 s hs)).mul (hH h0 s hs)).mul (hH h1 s hs)) have hconvex:Convex ℝ D:= ((convex_Ioi (1:ℝ)).linear_preimage Complex.reCLM.toLinearMap).inter ((convex_Ioi (0:ℝ)).linear_preimage Complex.imCLM.toLinearMap) have hstart:(5+Complex.I:ℂ)∈D:=by norm_num [D] have hopen:IsOpen {s:ℂ|4(s-4/3)*T h s) (𝓝[≠] (4/3:ℂ)) (𝓝 (R h)):= translatedCuspFamily_residue_limit (3*h) oppositeSource 2 3 (by norm_num) (by norm_num) have hl:=(((hlimT h0).mul (hlimH h1)).mul (hlimH h2)).comp upperVertical_tendsto_cubic_punctured have hr:=((((hAc.tendsto.mono_left nhdsWithin_le_nhds).mul (hlimT h1)).mul (hlimH h0)).mul (hlimH h2) |>.add ((((hBc.tendsto.mono_left nhdsWithin_le_nhds).mul (hlimT h2)).mul (hlimH h0)).mul (hlimH h1))).comp upperVertical_tendsto_cubic_punctured have hcross:R h0*H h1 (4/3)*H h2 (4/3)= A (4/3)*R h1*H h0 (4/3)*H h2 (4/3)+B (4/3)*R h2*H h0 (4/3)*H h1 (4/3):=by apply tendsto_nhds_unique_of_eventuallyEq hl hr filter_upwards [self_mem_nhdsWithin] with t ht change 0(Ideal.absNorm (Ideal.span {p}):ℂ)^(-z)) s:=by apply Complex.analyticAt_iff_eventually_differentiableAt.mpr exact Eventually.of_forall fun z=>(differentiableAt_id.neg).const_cpow (Or.inl (Nat.cast_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (Ideal.span_singleton_eq_bot.not.mpr hp.ne_zero)))) lemma gaussPrimeWeight_center (p:Eis) (hp:Prime p): (Ideal.absNorm (Ideal.span {p}):ℂ)^3* ((Ideal.absNorm (Ideal.span {p}):ℂ)^(-(4/3:ℂ)))^3= (Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹:=by have hQ:(Ideal.absNorm (Ideal.span {p}):ℂ)≠0:=Nat.cast_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (Ideal.span_singleton_eq_bot.not.mpr hp.ne_zero)) rw [←Complex.cpow_nat_mul,←Complex.cpow_natCast _ 3,←Complex.cpow_add _ _ hQ] convert Complex.cpow_neg_one (Ideal.absNorm (Ideal.span {p}):ℂ) using 1 ;congr 1 ;norm_num theorem unramifiedGaussResidue_prime_recurrence (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:Eis) (hph:¬p∣h): unramifiedGaussResidue (h*p^3)= (1+(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹)*unramifiedGaussResidue h- (Ideal.absNorm (Ideal.span {p}):ℂ)^(-(4/3:ℂ))*primeCubicGauss p hp hprimary 1 h* unramifiedGaussResidue (h*p):=by let A:ℂ→ℂ:=fun s=>1+(Ideal.absNorm (Ideal.span {p}):ℂ)^3* ((Ideal.absNorm (Ideal.span {p}):ℂ)^(-s))^3 let B:ℂ→ℂ:=fun s=>-((Ideal.absNorm (Ideal.span {p}):ℂ)^(-s)*primeCubicGauss p hp hprimary 1 h) have hA (s:ℂ):AnalyticAt ℂ A s:=analyticAt_const.add (analyticAt_const.mul ((gaussPrimeWeight_analytic p hp s).pow 3)) have hB (s:ℂ):AnalyticAt ℂ B s:=((gaussPrimeWeight_analytic p hp s).mul analyticAt_const).neg have he:=unramifiedGaussResidue_of_initial_relation (h*p^3) h (h*p) A B (fun s _=>hA s) (fun s _=>hB s) (hA _).continuousAt (hB _).continuousAt (fun s hs _=>by have hh:=unramifiedCubicGaussSeries_prime_recurrence p hp hprimary s (by linarith) h hph simpa only [A,B,neg_mul,sub_eq_add_neg] using hh) dsimp only [A,B] at he rw [gaussPrimeWeight_center p hp] at he simpa only [neg_mul,sub_eq_add_neg] using he end section open scoped BigOperators Classical Topology open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationBesselDerivatives03 abbrev Eis := ActualEisensteinCubic.O end RootNotationBesselDerivatives03 open RootNotationBesselDerivatives03 (Eis) end open Filter MeasureTheory open scoped BigOperators Classical Topology ComplexConjugate def inverseCuspPath (c d : ℂ) (v : ℝ) (direction : ℂ) (t : ℝ) : ℂ×ℝ := (-d/c-(t:ℂ)*star direction/(c^2*((v^2+t^2*‖direction‖^2:ℝ):ℂ)), v/(‖c‖^2*(v^2+t^2*‖direction‖^2))) lemma inverseCuspPath_zero (c d : ℂ) (v : ℝ) (direction : ℂ) (hc : c≠0) (hv : 0v^2+t^2*‖direction‖^2) 0 0 := by convert (((hasDerivAt_id (0:ℝ)).pow 2).mul_const (‖direction‖^2)).const_add (v^2) using 1 <;> first | rfl | norm_num have hnum : HasDerivAt (fun t : ℝ=>(t:ℂ)*star direction) (star direction) 0 := by simpa using ((hasDerivAt_id (0:ℝ)).ofReal_comp.mul_const (star direction)) have hdenC := hden.ofReal_comp.const_mul (c^2) have hdenR := hden.const_mul (‖c‖^2) have hcz : c^2*((v^2+(0:ℝ)^2*‖direction‖^2:ℝ):ℂ)≠0 := by simpa using mul_ne_zero (pow_ne_zero 2 hc) (pow_ne_zero 2 hvc) have hrz : ‖c‖^2*(v^2+(0:ℝ)^2*‖direction‖^2)≠0 := by positivity have hz : HasDerivAt (fun t : ℝ=>-d/c-(t:ℂ)*star direction/(c^2*((v^2+t^2*‖direction‖^2:ℝ):ℂ))) (-(star direction)/(c^2*(v:ℂ)^2)) 0 := by convert (hnum.div hdenC hcz).const_sub (-d/c) using 1 <;> first | rfl | ( simp only [zero_pow (by decide : 2≠0),zero_mul,add_zero,Complex.ofReal_pow, Complex.ofReal_zero,mul_zero,sub_zero] field_simp) have hvd : HasDerivAt (fun t : ℝ=>v/(‖c‖^2*(v^2+t^2*‖direction‖^2))) 0 0 := by convert (hasDerivAt_const (0:ℝ) v).div hdenR hrz using 1 <;> first | rfl | simp exact hz.prodMk hvd theorem inverseCuspPath_comp_hasDerivAt (c d : ℂ) (v : ℝ) (direction : ℂ) (hc : c≠0) (hv : 0F (inverseCuspPath c d v direction t)) (A (-(star direction)/(c^2*(v:ℂ)^2),0)) 0 := by have hf : HasFDerivAt F A (inverseCuspPath c d v direction 0) := by rwa [inverseCuspPath_zero c d v direction hc hv] exact hf.comp_hasDerivAt 0 (inverseCuspPath_hasDerivAt c d v direction hc hv) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.InverseCuspCoordinates /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology ComplexConjugate MatrixGroups Matrix def inverseCuspCoordinates (c d : ℂ) (v : ℝ) (z : ℂ) : ℂ×ℝ := (-d/c-star z/(c^2*((v^2+‖z‖^2:ℝ):ℂ)),v/(‖c‖^2*(v^2+‖z‖^2))) lemma inverseCuspCoordinates_height_pos (c d : ℂ) (v : ℝ) (z : ℂ) (hc : c≠0) (hv : 0 lhs; rw [←k.re_add_im] ring_nf simp only [Complex.I_sq] ring theorem inverse_cusp_wirtingerBar (c d : ℂ) (v : ℝ) (hc : c≠0) (hv : 0F (inverseCuspCoordinates c d v z)) 0= (-1/(c^2*(v:ℂ)^2))*((1/2:ℂ)*(A (1,0)-Complex.I*A (Complex.I,0))) := by have h1 := (inverseCuspPath_comp_hasDerivAt c d v 1 hc hv F A hF).deriv have hI := (inverseCuspPath_comp_hasDerivAt c d v Complex.I hc hv F A hF).deriv have he1 : (fun t : ℝ=>F (inverseCuspCoordinates c d v (t:ℂ)))= (fun t : ℝ=>F (inverseCuspPath c d v 1 t)) := by funext t rw [←inverseCuspCoordinates_line] simp only [mul_one] have heI : (fun t : ℝ=>F (inverseCuspCoordinates c d v ((t:ℂ)*Complex.I)))= (fun t : ℝ=>F (inverseCuspPath c d v Complex.I t)) := by funext t rw [inverseCuspCoordinates_line] rw [horizontalWirtingerBar] simp only [zero_add] rw [he1,heI,h1,hI] simp only [star_one,Complex.star_def,Complex.conj_I,neg_neg] convert real_linear_wirtinger_swap A (-1/(c^2*(v:ℂ)^2)) using 1 ; congr 2 ; ring_nf def horizontalWirtingerZ (f : ℂ→ℂ) (z : ℂ) : ℂ := (1/2:ℂ)*(deriv (fun t : ℝ=>f (z+(t:ℂ))) 0- Complex.I*deriv (fun t : ℝ=>f (z+(t:ℂ)*Complex.I)) 0) lemma horizontalWirtingerZ_eq_fderiv (F : ℂ×ℝ→ℂ) (A : (ℂ×ℝ)→L[ℝ]ℂ) (z : ℂ) (v : ℝ) (hF : HasFDerivAt F A (z,v)) : horizontalWirtingerZ (fun w=>F (w,v)) z= (1/2:ℂ)*(A (1,0)-Complex.I*A (Complex.I,0)) := by have hline (direction : ℂ) : HasDerivAt (fun t : ℝ=>F (z+(t:ℂ)*direction,v)) (A (direction,0)) 0 := by have hz : HasDerivAt (fun t : ℝ=>z+(t:ℂ)*direction) direction 0 := by simpa using (((hasDerivAt_id (0:ℝ)).ofReal_comp.mul_const direction).const_add z) have hp := hz.prodMk (hasDerivAt_const (0:ℝ) v) have hf : HasFDerivAt F A (z+(0:ℂ)*direction,v) := by simpa using hF exact hf.comp_hasDerivAt 0 hp have h1 := (hline 1).deriv have hI := (hline Complex.I).deriv simp only [mul_one] at h1 rw [horizontalWirtingerZ,h1,hI] end section open Filter MeasureTheory open scoped BigOperators Classical Topology section theorem cusp_mellin_reflection (g : ℝ→ℂ) (A s : ℂ) (Q : ℝ) (hQ : 0A*((v:ℂ)^(-2:ℂ)*g ((Q*v)⁻¹))) (2*s)= A*(Q:ℂ)^(2-2*s)*mellin g (2-2*s) := by have he : (fun v : ℝ=>A*((v:ℂ)^(-2:ℂ)*g ((Q*v)⁻¹)))= (fun v : ℝ=>A • ((v:ℂ)^(-2:ℂ) • g ((Q*v)⁻¹))) := by funext v; simp only [smul_eq_mul] rw [he,mellin_const_smul,mellin_cpow_smul] have hm := mellin_comp_mul_left (fun v : ℝ=>g v⁻¹) (2*s+(-2:ℂ)) hQ rw [mellin_comp_inv] at hm rw [hm] simp only [smul_eq_mul] rw [show -(2*s+(-2:ℂ))=2-2*s by ring] ring theorem cusp_mellin_reflection_of_identity (f g : ℝ→ℂ) (A s : ℂ) (Q : ℝ) (hQ : 0 ShortDraftTrace.breveE (freq*w)) (ShortDraftTrace.breveE (freq*z) • horizontalPhaseCLM freq) z := by have hh := (horizontalPhaseCLM freq).hasFDerivAt.cexp (x:=z) convert! hh using 1 namespace SubexponentialBesselCoefficients variable (coeff : SubexponentialBesselCoefficients) def amplitudeDeriv (v : ℝ) (h : ActualEisensteinCubic.O) : ℂ := if h=0 then 0 else coeff.value h* (schlafliBesselK (1/3) (4*Real.pi*‖cuspFrequency h‖*v)+ (v:ℂ)*(4*Real.pi*‖cuspFrequency h‖:ℝ)* schlafliBesselK_cubic_derivative (4*Real.pi*‖cuspFrequency h‖*v)) lemma amplitude_hasDerivAt (v : ℝ) (hv : 0 coeff.amplitude y h) (coeff.amplitudeDeriv v h) v := by by_cases hh : h=0 · simp only [amplitude,amplitudeDeriv,if_pos hh] exact hasDerivAt_const v 0 have hr : 0<‖cuspFrequency h‖ := norm_pos_iff.mpr (cuspFrequency_ne_zero h hh) have hslope : HasDerivAt (fun y : ℝ => 4*Real.pi*‖cuspFrequency h‖*y) (4*Real.pi*‖cuspFrequency h‖) v := by simpa only [id_eq,mul_one] using (hasDerivAt_id v).const_mul (4*Real.pi*‖cuspFrequency h‖) have hk := (schlafliBesselK_cubic_hasDerivAt (4*Real.pi*‖cuspFrequency h‖*v) (by positivity)).scomp v hslope have hvd := (Complex.ofRealCLM.hasDerivAt (x:=v)).mul hk have hfull := hvd.const_mul (coeff.value h) simp only [amplitude,amplitudeDeriv,if_neg hh] convert! hfull using 1 <;> simp [Function.comp_def,Pi.mul_apply,Complex.ofRealCLM_apply,Complex.real_smul,mul_assoc] def termFDeriv (h : ActualEisensteinCubic.O) (p : ℝ × ℂ) : (ℝ × ℂ) →L[ℝ] ℂ := if h=0 then 0 else (ContinuousLinearMap.fst ℝ ℝ ℂ).smulRight (coeff.amplitudeDeriv p.1 h*ShortDraftTrace.breveE (cuspFrequency h*p.2))+ coeff.term h p • (horizontalPhaseCLM (cuspFrequency h)).comp (ContinuousLinearMap.snd ℝ ℝ ℂ) lemma term_hasFDerivAt (h : ActualEisensteinCubic.O) (p : ℝ × ℂ) (hp : 0 (0:ℂ)) := by funext q simp only [term,if_pos hh] rw [hzero,termFDeriv,if_pos hh] exact hasFDerivAt_const (𝕜:=ℝ) (0:ℂ) p have hvd := (coeff.amplitude_hasDerivAt p.1 hp h).hasFDerivAt.comp p (hasFDerivAt_fst (𝕜:=ℝ) (p:=p)) have hzd := (brevePhase_hasFDerivAt (cuspFrequency h) p.2).comp p (hasFDerivAt_snd (𝕜:=ℝ) (p:=p)) have hprod : HasFDerivAt (fun q : ℝ × ℂ => coeff.amplitude q.1 h* ShortDraftTrace.breveE (cuspFrequency h*q.2)) (coeff.termFDeriv h p) p := by convert! hvd.mul hzd using 1 apply ContinuousLinearMap.ext intro direction simp only [termFDeriv,if_neg hh] change (direction.1:ℂ)*(coeff.amplitudeDeriv p.1 h* ShortDraftTrace.breveE (cuspFrequency h*p.2))+ coeff.term h p*horizontalPhaseCLM (cuspFrequency h) direction.2 = coeff.amplitude p.1 h*(ShortDraftTrace.breveE (cuspFrequency h*p.2)* horizontalPhaseCLM (cuspFrequency h) direction.2)+ ShortDraftTrace.breveE (cuspFrequency h*p.2)* ((direction.1:ℂ)*coeff.amplitudeDeriv p.1 h) rw [coeff.term_eq_amplitude p.1 hp h p.2] ring apply hprod.congr_of_eventuallyEq filter_upwards [continuousAt_fst.tendsto.eventually (Ioi_mem_nhds hp)] with q hq exact coeff.term_eq_amplitude q.1 hq h q.2 end SubexponentialBesselCoefficients end section open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding section namespace RootNotationInverseCuspCoordinates02 abbrev O := ActualEisensteinCubic.O end RootNotationInverseCuspCoordinates02 open RootNotationInverseCuspCoordinates02 (O) namespace SubexponentialBesselCoefficients variable (coeff : SubexponentialBesselCoefficients) lemma weighted_bessel_bounds (a : ℝ) (ha : 0 (1+‖cuspFrequency h‖)*Real.exp (-a*‖cuspFrequency h‖)) := by simpa only [add_mul,one_mul] using (summable_exp_neg_cuspFrequency_norm a ha).add (summable_norm_mul_exp_neg_cuspFrequency a ha) namespace SubexponentialBesselCoefficients variable (coeff : SubexponentialBesselCoefficients) lemma series_hasFDerivAt (p : ℝ × ℂ) (hp : 0 coeff.term_hasFDerivAt h q (ha.trans hq.1.1)) (fun h q hq => hbound h q ⟨hq.1.1.le,hq.1.2.le⟩) hpSlab (coeff.summable p hp) hpSlab lemma series_differentiableAt (p : ℝ × ℂ) (hp : 0 coeff.fullFunction scalarTerm (cuspCoordinateLift q)) p := by have hc := ((hasDerivAt_ofReal_cpow_const hp.ne' (r:=(2/3:ℂ)) (by norm_num)).const_mul scalarTerm).differentiableAt.comp p (differentiableAt_fst (𝕜:=ℝ) (p:=p)) have ht : DifferentiableAt ℝ (fun q : ℝ × ℂ => scalarTerm*(q.1:ℂ)^(2/3:ℂ)+coeff.series q) p := by convert! hc.add (coeff.series_differentiableAt p hp) using 1 apply ht.congr_of_eventuallyEq filter_upwards [continuousAt_fst.tendsto.eventually (Ioi_mem_nhds hp)] with q hq exact coeff.fullFunction_cusp_eq scalarTerm q hq end SubexponentialBesselCoefficients end open Filter MeasureTheory Asymptotics open scoped BigOperators Classical Topology def truncatedCuspProfile (c : ℝ) (f : ℝ→ℂ) (x : ℝ) : ℂ := if c] 0] 0 := by have he : ∀ᶠx : ℝ in 𝓝[>] 0,xf (max (c/2) x)) := hf.comp_continuous (continuous_const.max continuous_id) (fun x=>lt_of_lt_of_le (by linarith : 0f (max (c/2) x)) := by funext x by_cases hx : cReal.exp (-decay*x))) : (∀s : ℂ,MellinConvergent (truncatedCuspProfile c f) s) ∧ Differentiable ℂ (mellin (truncatedCuspProfile c f)) := by have hlocal := (truncatedCuspProfile_locallyIntegrable c hc f hf).locallyIntegrableOn (Set.Ioi 0) have htop : truncatedCuspProfile c f =O[atTop] (fun x : ℝ=>Real.exp (-decay*x)) := hbound.congr' (truncatedCuspProfile_eventually_top c f).symm Filter.EventuallyEq.rfl have hzero (b : ℝ) : truncatedCuspProfile c f =O[𝓝[>] 0] (fun x : ℝ=>x^(-b)) := (Asymptotics.isBigO_zero (fun x : ℝ=>x^(-b)) (𝓝[>] 0)).congr' (truncatedCuspProfile_eventually_zero c hc f).symm Filter.EventuallyEq.rfl constructor · intro s exact mellinConvergent_of_isBigO_rpow_exp hdecay hlocal htop (hzero (s.re-1)) (by linarith) · intro s exact mellin_differentiableAt_of_isBigO_rpow_exp hdecay hlocal htop (hzero (s.re-1)) (by linarith) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ReflectedCuspMellin /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory Asymptotics open scoped BigOperators Classical Topology def reflectedCuspProfile (A : ℂ) (Q : ℝ) (g : ℝ→ℂ) (v : ℝ) : ℂ := A*((v:ℂ)^(-2:ℂ)*g ((Q*v)⁻¹)) lemma reflectedCuspProfile_mellin (g : ℝ→ℂ) (A s : ℂ) (Q : ℝ) (hQ : 0g t⁻¹) (s-2) := by have hh := (MellinConvergent.comp_rpow (f := g) (s := s-2) (a := -1) (by norm_num : (-1:ℝ)≠0)).mpr (show MellinConvergent g ((s-2)/(-1:ℝ)) by simpa only [show ((s-2)/(-1:ℝ):ℂ)=2-s by push_cast;ring] using hg) simpa only [Real.rpow_neg_one] using hh have hscale := (MellinConvergent.comp_mul_left (f := fun t : ℝ=>g t⁻¹) (s := s-2) hQ).mpr hinv have hpow := (MellinConvergent.cpow_smul (f := fun t : ℝ=>g (Q*t)⁻¹) (s := s) (a := -2)).mpr (by simpa only [sub_eq_add_neg] using hscale) simpa only [reflectedCuspProfile,smul_eq_mul] using hpow.const_smul A lemma cusp_truncation_reflection_ae (f g : ℝ→ℂ) (A : ℂ) (Q : ℝ) (hQ : 0truncatedCuspProfile 1 f v+ reflectedCuspProfile A Q (truncatedCuspProfile (1/Q) g) v) := by have hne : ∀ᵐv : ℝ ∂volume.restrict (Set.Ioi 0),v≠1 := ae_restrict_of_ae (Measure.ae_ne volume 1) filter_upwards [ae_restrict_mem measurableSet_Ioi,hne] with v hv hv1 have hrel : 1/Q<(Q*v)⁻¹ ↔ v<1 := by rw [inv_eq_one_div,div_lt_div_iff₀ hQ (mul_pos hQ hv)] constructor <;> intro hh <;> nlinarith by_cases hhi : 1not_lt_of_ge hhi.le (hrel.mp hh) simp only [truncatedCuspProfile,if_pos hhi,reflectedCuspProfile,if_neg hlo, mul_zero,add_zero] · have hlo : 1/Q<(Q*v)⁻¹ := hrel.mpr (lt_of_le_of_ne (le_of_not_gt hhi) hv1) simp only [truncatedCuspProfile,if_neg hhi,reflectedCuspProfile,if_pos hlo,zero_add] exact hfg v hv theorem cusp_mellin_entire (f g : ℝ→ℂ) (A : ℂ) (Q decayF decayG : ℝ) (hQ : 0Real.exp (-decayF*v))) (hgbound : g =O[atTop] (fun v : ℝ=>Real.exp (-decayG*v))) (hfg : ∀v : ℝ,0(v:ℂ)^(s-1) • z) hv.symm · have he : mellin f s=mellin (fun v=>truncatedCuspProfile 1 f v+ reflectedCuspProfile A Q (truncatedCuspProfile (1/Q) g) v) s := by unfold mellin apply integral_congr_ae filter_upwards [hae] with v hv rw [hv] rw [he,hsum.2,reflectedCuspProfile_mellin _ _ _ _ hQ] refine ⟨fun s=>(hresult s).1,?_⟩ have he : mellin f=(fun s : ℂ=>mellin (truncatedCuspProfile 1 f) s+ A*(Q:ℂ)^(2-s)*mellin (truncatedCuspProfile (1/Q) g) (2-s)) := funext (fun s=>(hresult s).2) rw [he] let : NeZero (Q:ℂ) := ⟨Complex.ofReal_ne_zero.mpr hQ.ne'⟩ have hp := (differentiable_const_cpow_of_neZero (Q:ℂ)).comp ((differentiable_const (2:ℂ)).sub differentiable_id) exact hfd.add (((differentiable_const A).mul hp).mul (hgd.comp ((differentiable_const (2:ℂ)).sub differentiable_id))) end section open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding section namespace RootNotationReflectedCuspMellin01 abbrev O := ActualEisensteinCubic.O end RootNotationReflectedCuspMellin01 open RootNotationReflectedCuspMellin01 (O) namespace SubexponentialBesselCoefficients variable (coeff : SubexponentialBesselCoefficients) def directionalTerm (h : ActualEisensteinCubic.O) (v : ℝ) (z direction : ℂ) : ℂ := horizontalPhaseMultiplier (cuspFrequency h) direction*coeff.term h (v,z) lemma term_horizontal_hasDerivAt (h : ActualEisensteinCubic.O) (v : ℝ) (hv : 0 coeff.term h (v,z+(x:ℂ)*direction)) (coeff.directionalTerm h v (z+(t:ℂ)*direction) direction) t := by have hh := (brevePhase_hasDerivAt (cuspFrequency h) z direction t).const_mul (coeff.amplitude v h) have hf : (fun x : ℝ => coeff.term h (v,z+(x:ℂ)*direction))= (fun x : ℝ => coeff.amplitude v h* ShortDraftTrace.breveE (cuspFrequency h*(z+(x:ℂ)*direction))) := by funext x exact coeff.term_eq_amplitude v hv h _ rw [hf] convert hh using 1 <;> first | rfl | ( rw [directionalTerm,coeff.term_eq_amplitude v hv h] ring) lemma directionalTerm_slab_bound (a b : ℝ) (ha : 0 coeff.directionalTerm h v z direction) := by obtain ⟨C,hC,hbound⟩ := coeff.directionalTerm_slab_bound v v hv le_rfl direction apply Summable.of_norm apply Summable.of_nonneg_of_le (fun h => norm_nonneg _) (fun h => hbound h v z ⟨le_rfl,le_rfl⟩) exact (summable_norm_mul_exp_neg_cuspFrequency (Real.pi*v) (mul_pos Real.pi_pos hv)).mul_left C lemma series_horizontal_hasDerivAt (v : ℝ) (hv : 0 coeff.series (v,z+(x:ℂ)*direction)) (∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h v (z+(t:ℂ)*direction) direction) t := by obtain ⟨C,hC,hbound⟩ := coeff.directionalTerm_slab_bound v v hv le_rfl direction have hs := (summable_norm_mul_exp_neg_cuspFrequency (Real.pi*v) (mul_pos Real.pi_pos hv)).mul_left C have hz : Summable (fun h : ActualEisensteinCubic.O => coeff.term h (v,z+(0:ℂ)*direction)) := by simpa only [zero_mul,add_zero] using coeff.summable (v,z) hv exact hasDerivAt_tsum hs (fun h x => coeff.term_horizontal_hasDerivAt h v hv z direction x) (fun h x => hbound h v (z+(x:ℂ)*direction) ⟨le_rfl,le_rfl⟩) hz t lemma fullFunction_horizontal_hasDerivAt (scalarTerm : ℂ) (v : ℝ) (hv : 0 coeff.fullFunction scalarTerm (upperPoint (z+(x:ℂ)*direction) v hv)) (∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h v (z+(t:ℂ)*direction) direction) t := by have hh := (coeff.series_horizontal_hasDerivAt v hv z direction t).const_add (scalarTerm*(v:ℂ)^(2/3:ℂ)) simpa only [fullFunction,function, hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint] using hh end SubexponentialBesselCoefficients end namespace RootNotationReflectedCuspMellin02 abbrev O := ActualEisensteinCubic.O end RootNotationReflectedCuspMellin02 open RootNotationReflectedCuspMellin02 (O) namespace SubexponentialBesselCoefficients variable (coeff : SubexponentialBesselCoefficients) lemma term_cusp_bound (a : ℝ) (ha : 0 mul_nonneg (norm_nonneg _) (Real.exp_pos _).le) have hs := summable_norm_mul_exp_neg_cuspFrequency (Real.pi*a/2) (by positivity) refine ⟨D*S*(2/(2*residualCuspDecayRate)),by positivity,?_⟩ intro v z hav have hsum := tsum_of_norm_bounded (hs.hasSum.mul_left (D*v*Real.exp (-(2*residualCuspDecayRate)*v))) (fun h => hbound h v z hav) calc _ ≤ (D*v*Real.exp (-(2*residualCuspDecayRate)*v))*S := hsum _ = (D*S)*(v*Real.exp (-(2*residualCuspDecayRate)*v)) := by ring _ ≤ (D*S)*((2/(2*residualCuspDecayRate))* Real.exp (-((2*residualCuspDecayRate)/2)*v)) := mul_le_mul_of_nonneg_left (norm_mul_exp_neg_bound (2*residualCuspDecayRate) v (mul_pos (by norm_num) residualCuspDecayRate_pos)) (mul_nonneg hD hS) _ = _ := by rw [show -((2*residualCuspDecayRate)/2)*v=-residualCuspDecayRate*v by ring] ring theorem fullFunction_wirtingerBar_cusp_decay (scalarTerm : ℂ) (a : ℝ) (ha : 0 coeff.fullFunction scalarTerm (upperPoint w v hv)) z‖≤ C*Real.exp (-residualCuspDecayRate*v) := by obtain ⟨C1,hC1,hbound1⟩ := coeff.directionalSeries_cusp_decay a ha 1 obtain ⟨CI,hCI,hboundI⟩ := coeff.directionalSeries_cusp_decay a ha Complex.I refine ⟨(C1+CI)/2,by positivity,?_⟩ intro v hv z hav have h1 := (coeff.fullFunction_horizontal_hasDerivAt scalarTerm v hv z 1 0).deriv have hI := (coeff.fullFunction_horizontal_hasDerivAt scalarTerm v hv z Complex.I 0).deriv simp only [mul_one,Complex.ofReal_zero,zero_mul,add_zero] at h1 hI rw [horizontalWirtingerBar,h1,hI,norm_mul] have hhalf : ‖(1/2:ℂ)‖=(1/2:ℝ) := by norm_num rw [hhalf] calc _ ≤ (1/2:ℝ)*(‖∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h v z 1‖+ ‖Complex.I*(∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h v z Complex.I)‖) := mul_le_mul_of_nonneg_left (norm_add_le _ _) (by norm_num) _ = (1/2:ℝ)*(‖∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h v z 1‖+ ‖∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h v z Complex.I‖) := by rw [norm_mul,Complex.norm_I,one_mul] _ ≤ (1/2:ℝ)*(C1*Real.exp (-residualCuspDecayRate*v)+CI*Real.exp (-residualCuspDecayRate*v)) := by apply mul_le_mul_of_nonneg_left _ (by norm_num) exact add_le_add (hbound1 v z hav) (hboundI v z hav) _ = _ := by ring end SubexponentialBesselCoefficients end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open Finset AddChar MulChar EisensteinEmbedding section namespace RootNotationReflectedCuspMellin03 abbrev O := ActualEisensteinCubic.O end RootNotationReflectedCuspMellin03 open RootNotationReflectedCuspMellin03 (O) lemma spatialComplexSplit_differentiable : Differentiable ℝ spatialComplexSplit := by change Differentiable ℝ (fun p : EuclideanSpatial => (p 2,(p 0:ℂ)+(p 1:ℂ)*Complex.I)) fun_prop lemma spatialComplexSplit_symm_differentiable : Differentiable ℝ spatialComplexSplit.symm := by change Differentiable ℝ (fun q : ℝ × ℂ => spatialComplexSplit.symm q) simp_rw [spatialComplexSplit_symm_eq] have hlin := (WithLp.linearEquiv 2 ℝ (Fin 3→ℝ)).symm.toContinuousLinearMap.differentiable have hcoords : Differentiable ℝ (fun q : ℝ × ℂ => ![q.2.re,q.2.im,q.1]) := by apply differentiable_pi.mpr intro j fin_cases j · change Differentiable ℝ (fun q : ℝ × ℂ => q.2.re) fun_prop · change Differentiable ℝ (fun q : ℝ × ℂ => q.2.im) fun_prop · change Differentiable ℝ (fun q : ℝ × ℂ => q.1) fun_prop exact hlin.comp hcoords namespace SubexponentialBesselCoefficients variable (coeff : SubexponentialBesselCoefficients) lemma fullFunction_euclidean_differentiableAt (scalarTerm : ℂ) (p : EuclideanSpatial) (hp : 0

coeff.fullFunction scalarTerm (euclideanToHyperbolic q)) p := by have hh := (coeff.fullFunction_cusp_differentiableAt scalarTerm (spatialComplexSplit p) hp).comp p spatialComplexSplit_differentiable.differentiableAt simpa only [Function.comp_def,cuspCoordinateLift,spatialComplexSplit.symm_apply_apply] using hh lemma fullFunction_translate_cusp_differentiableAt (scalarTerm : ℂ) (g : SL(2,ℂ)) (p : ℝ × ℂ) (hp : 0 coeff.fullFunction scalarTerm (g • cuspCoordinateLift q)) p := by have hx : 0<(spatialComplexSplit.symm p) 2 := by rw [spatialComplexSplit_symm_eq] exact hp obtain ⟨A,hA,hAn⟩ := hyperbolicDifferentialIsometry g (spatialComplexSplit.symm p) hx have hh := ((coeff.fullFunction_euclidean_differentiableAt scalarTerm (euclideanAction g (spatialComplexSplit.symm p)) (euclideanAction_positive _ _)).comp _ hA.differentiableAt).comp p spatialComplexSplit_symm_differentiable.differentiableAt simpa only [Function.comp_def,euclideanAction,euclideanToHyperbolic_coordinates,cuspCoordinateLift] using hh lemma fullFunction_translate_split_differentiableAt (scalarTerm : ℂ) (g : SL(2,ℂ)) (p : ℂ × ℝ) (hp : 0 coeff.fullFunction scalarTerm (g • cuspCoordinateLift (q.2,q.1))) p := by have hswap : DifferentiableAt ℝ (fun q : ℂ × ℝ => (q.2,q.1)) p := differentiableAt_snd.prodMk differentiableAt_fst exact (coeff.fullFunction_translate_cusp_differentiableAt scalarTerm g (p.2,p.1) hp).comp p hswap end SubexponentialBesselCoefficients lemma cubicSourceResidualFunction_translate_split_differentiableAt (g : SL(2,ℂ)) (p : ℂ × ℝ) (hp : 0 cubicSourceResidualFunction (g • cuspCoordinateLift (q.2,q.1))) p := by rw [cubicSourceResidualFunction_eq_bessel] exact sourceBesselCoefficients.fullFunction_translate_split_differentiableAt ((3*(Real.pi:ℂ))*constantArithmeticResidue) g p hp lemma cubicSourceResidualFunction_wirtingerBar_cusp_decay (a : ℝ) (ha : 0 cubicSourceResidualFunction (upperPoint w v hv)) z‖≤ C*Real.exp (-residualCuspDecayRate*v) := by rw [cubicSourceResidualFunction_eq_bessel] exact sourceBesselCoefficients.fullFunction_wirtingerBar_cusp_decay _ a ha end namespace RootNotationReflectedCuspMellin04 abbrev O := ActualEisensteinCubic.O end RootNotationReflectedCuspMellin04 open RootNotationReflectedCuspMellin04 (O) lemma horizontalPhaseMultiplier_wirtingerZ (freq : ℂ) : (1/2:ℂ)*(horizontalPhaseMultiplier freq 1- Complex.I*horizontalPhaseMultiplier freq Complex.I)=2*Real.pi*Complex.I*freq := by simp only [horizontalPhaseMultiplier,mul_one,star_mul,Complex.star_def, Complex.conj_I] ring_nf norm_num [Complex.I_sq,Complex.I_pow_three] ring lemma horizontalWirtingerBar_star (f : ℂ→ℂ) (z : ℂ) : horizontalWirtingerBar (fun w => star (f w)) z=star (horizontalWirtingerZ f z) := by unfold horizontalWirtingerBar horizontalWirtingerZ rw [deriv.star,deriv.star] simp [] namespace SubexponentialBesselCoefficients variable (coeff : SubexponentialBesselCoefficients) lemma fullFunction_wirtingerZ (scalarTerm : ℂ) (v : ℝ) (hv : 0 coeff.fullFunction scalarTerm (upperPoint w v hv)) z= ∑'h : ActualEisensteinCubic.O,(2*Real.pi*Complex.I*cuspFrequency h)*coeff.term h (v,z) := by have h1 := (coeff.fullFunction_horizontal_hasDerivAt scalarTerm v hv z 1 0).deriv have hI := (coeff.fullFunction_horizontal_hasDerivAt scalarTerm v hv z Complex.I 0).deriv simp only [mul_one,Complex.ofReal_zero,zero_mul,add_zero] at h1 hI rw [horizontalWirtingerZ,h1,hI] have hs1 := coeff.directionalTerm_summable v hv z 1 have hsI := (coeff.directionalTerm_summable v hv z Complex.I).mul_left Complex.I rw [←tsum_mul_left,←hs1.tsum_sub hsI,←tsum_mul_left] apply tsum_congr intro h unfold directionalTerm linear_combination coeff.term h (v,z)*horizontalPhaseMultiplier_wirtingerZ (cuspFrequency h) lemma fullFunction_wirtingerZ_cusp_decay (scalarTerm : ℂ) (a : ℝ) (ha : 0 coeff.fullFunction scalarTerm (upperPoint w v hv)) z‖≤ C*Real.exp (-residualCuspDecayRate*v) := by obtain ⟨C1,hC1,hbound1⟩ := coeff.directionalSeries_cusp_decay a ha 1 obtain ⟨CI,hCI,hboundI⟩ := coeff.directionalSeries_cusp_decay a ha Complex.I refine ⟨(C1+CI)/2,by positivity,?_⟩ intro v hv z hav have h1 := (coeff.fullFunction_horizontal_hasDerivAt scalarTerm v hv z 1 0).deriv have hI := (coeff.fullFunction_horizontal_hasDerivAt scalarTerm v hv z Complex.I 0).deriv simp only [mul_one,Complex.ofReal_zero,zero_mul,add_zero] at h1 hI rw [horizontalWirtingerZ,h1,hI,norm_mul] have hhalf : ‖(1/2:ℂ)‖=(1/2:ℝ) := by norm_num rw [hhalf] calc _ ≤ (1/2:ℝ)*(‖∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h v z 1‖+ ‖Complex.I*(∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h v z Complex.I)‖) := mul_le_mul_of_nonneg_left (norm_sub_le _ _) (by norm_num) _ = (1/2:ℝ)*(‖∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h v z 1‖+ ‖∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h v z Complex.I‖) := by rw [norm_mul,Complex.norm_I,one_mul] _ ≤ (1/2:ℝ)*(C1*Real.exp (-residualCuspDecayRate*v)+CI*Real.exp (-residualCuspDecayRate*v)) := by apply mul_le_mul_of_nonneg_left _ (by norm_num) exact add_le_add (hbound1 v z hav) (hboundI v z hav) _ = _ := by ring end SubexponentialBesselCoefficients lemma cubicSourceResidualFunction_wirtingerZ_cusp_decay (a : ℝ) (ha : 0 cubicSourceResidualFunction (upperPoint w v hv)) z‖≤ C*Real.exp (-residualCuspDecayRate*v) := by rw [cubicSourceResidualFunction_eq_bessel] exact sourceBesselCoefficients.fullFunction_wirtingerZ_cusp_decay _ a ha def cubicSourceConjugateFunction (w : HyperbolicSpace) : ℂ := star (cubicSourceResidualFunction w) lemma cubicSourceConjugateFunction_translate_split_differentiableAt (g : SL(2,ℂ)) (p : ℂ × ℝ) (hp : 0 cubicSourceConjugateFunction (g • cuspCoordinateLift (q.2,q.1))) p := (cubicSourceResidualFunction_translate_split_differentiableAt g p hp).star end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open Finset AddChar MulChar EisensteinEmbedding lemma horizontalWirtingerBar_translate (f : ℂ→ℂ) (a : ℂ) : horizontalWirtingerBar (fun z=>f (z+a)) 0=horizontalWirtingerBar f a := by unfold horizontalWirtingerBar simp only [zero_add] have h1 : (fun t : ℝ=>f ((t:ℂ)+a))=(fun t : ℝ=>f (a+(t:ℂ))) := by funext t rw [add_comm] have hI : (fun t : ℝ=>f ((t:ℂ)*Complex.I+a))=(fun t : ℝ=>f (a+(t:ℂ)*Complex.I)) := by funext t rw [add_comm] rw [h1,hI] lemma cuspDerivative_of_transform (f : HyperbolicSpace→ℂ) (g H : SL(2,ℂ)) (κ : ℂ) (htransform : ∀w,f (g•w)=κ*f (H•w)) (hc : g 1 0≠0) (v : ℝ) (hv : 0f (H•cuspCoordinateLift (q.2,q.1))) (-g 1 1/g 1 0,1/(‖g 1 0‖^2*v))) : horizontalWirtingerBar (fun z=>f (upperPoint z v hv)) (g 0 0/g 1 0)= (κ*(-1/((g 1 0)^2*(v:ℂ)^2)))* horizontalWirtingerZ (fun z=>f (H•upperPoint z (1/(‖g 1 0‖^2*v)) (by positivity))) (-g 1 1/g 1 0) := by let FH : ℂ × ℝ→ℂ := fun q=>f (H•cuspCoordinateLift (q.2,q.1)) let base : ℂ × ℝ := (-g 1 1/g 1 0,1/(‖g 1 0‖^2*v)) let D := fderiv ℝ FH base have hF : HasFDerivAt FH D base := hD.hasFDerivAt have hscaled : HasFDerivAt (fun q=>κ*FH q) (κ • D) base := hF.const_mul κ have he := inverse_cusp_wirtingerBar (g 1 0) (g 1 1) v hc hv (fun q=>κ*FH q) (κ • D) hscaled have hline : (fun z=>κ*FH (inverseCuspCoordinates (g 1 0) (g 1 1) v z))= (fun z=>f (upperPoint (z+g 0 0/g 1 0) v hv)) := by funext z have ht := htransform (g⁻¹•upperPoint (z+g 0 0/g 1 0) v hv) rw [smul_inv_smul,inverse_cusp_action g hc v hv z] at ht change κ*f (H•cuspCoordinateLift ((inverseCuspCoordinates (g 1 0) (g 1 1) v z).2, (inverseCuspCoordinates (g 1 0) (g 1 1) v z).1))=_ rw [cuspCoordinateLift_positive _ _ (inverseCuspCoordinates_height_pos _ _ _ _ hc hv)] exact ht.symm rw [hline] at he have hshift := horizontalWirtingerBar_translate (fun z=>f (upperPoint z v hv)) (g 0 0/g 1 0) rw [hshift] at he have hz := horizontalWirtingerZ_eq_fderiv FH D (-g 1 1/g 1 0) (1/(‖g 1 0‖^2*v)) hF have hFH : (fun z=>FH (z,1/(‖g 1 0‖^2*v)))= (fun z=>f (H•upperPoint z (1/(‖g 1 0‖^2*v)) (by positivity))) := by funext z exact congrArg (fun w=>f (H•w)) (cuspCoordinateLift_positive _ _ (by positivity)) rw [hFH] at hz rw [hz] rw [he] simp only [_root_.smul_apply,smul_eq_mul] ring end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Reciprocity.CubeCorrespondence /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicKubota open scoped Classical MatrixGroups section open ActualEisensteinCubic CubicJacobiGlobal CubicRamified namespace RootNotationCubeCorrespondence01 abbrev Eis := ActualEisensteinCubic.O end RootNotationCubeCorrespondence01 open RootNotationCubeCorrespondence01 (Eis) def cubeDiagonal (p : Eis) : Matrix (Fin 2) (Fin 2) Eis := !![p^3,0;0,1] def cubeCorrespondence (p : Eis) : Subgroup (levelThree × levelThree) where carrier := {MN | cubeDiagonal p * (MN.1 : SL(2,Eis)).val = (MN.2 : SL(2,Eis)).val * cubeDiagonal p} one_mem' := by simp mul_mem' := by rintro ⟨M,N⟩ ⟨M',N'⟩ h h' change cubeDiagonal p * ((M : SL(2,Eis)).val * (M' : SL(2,Eis)).val) = ((N : SL(2,Eis)).val * (N' : SL(2,Eis)).val) * cubeDiagonal p calc _ = (cubeDiagonal p * (M : SL(2,Eis)).val) * (M' : SL(2,Eis)).val := (Matrix.mul_assoc _ _ _).symm _ = ((N : SL(2,Eis)).val * cubeDiagonal p) * (M' : SL(2,Eis)).val := by rw [h] _ = (N : SL(2,Eis)).val * (cubeDiagonal p * (M' : SL(2,Eis)).val) := Matrix.mul_assoc _ _ _ _ = (N : SL(2,Eis)).val * ((N' : SL(2,Eis)).val * cubeDiagonal p) := by rw [h'] _ = _ := (Matrix.mul_assoc _ _ _).symm inv_mem' := by rintro ⟨M,N⟩ h change cubeDiagonal p * ((M : SL(2,Eis))⁻¹).val = ((N : SL(2,Eis))⁻¹).val * cubeDiagonal p calc _ = (((N : SL(2,Eis))⁻¹).val * ((N : SL(2,Eis)).val * cubeDiagonal p)) * ((M : SL(2,Eis))⁻¹).val := by simp only [← Matrix.mul_assoc, ← Matrix.SpecialLinearGroup.coe_mul, inv_mul_cancel, Matrix.SpecialLinearGroup.coe_one, Matrix.one_mul] _ = (((N : SL(2,Eis))⁻¹).val * (cubeDiagonal p * (M : SL(2,Eis)).val)) * ((M : SL(2,Eis))⁻¹).val := by rw [h] _ = _ := by simp only [Matrix.mul_assoc, ← Matrix.SpecialLinearGroup.coe_mul, mul_inv_cancel, Matrix.SpecialLinearGroup.coe_one, Matrix.mul_one] def cubeCorrespondenceLeft (p : Eis) : cubeCorrespondence p →* levelThree := (MonoidHom.fst levelThree levelThree).comp (cubeCorrespondence p).subtype def cubeCorrespondenceRight (p : Eis) : cubeCorrespondence p →* levelThree := (MonoidHom.snd levelThree levelThree).comp (cubeCorrespondence p).subtype lemma cubeCorrespondence_entries (p : Eis) (MN : cubeCorrespondence p) : p^3 * ((MN.1.1 : levelThree) : SL(2,Eis)) 0 0 = (((MN.1.2 : levelThree) : SL(2,Eis)) 0 0) * p^3 ∧ p^3 * ((MN.1.1 : levelThree) : SL(2,Eis)) 0 1 = (((MN.1.2 : levelThree) : SL(2,Eis)) 0 1) ∧ (((MN.1.1 : levelThree) : SL(2,Eis)) 1 0) = (((MN.1.2 : levelThree) : SL(2,Eis)) 1 0) * p^3 ∧ (((MN.1.1 : levelThree) : SL(2,Eis)) 1 1) = (((MN.1.2 : levelThree) : SL(2,Eis)) 1 1) := by have h := MN.property have h00 := congrArg (fun A : Matrix (Fin 2) (Fin 2) Eis => A 0 0) h have h01 := congrArg (fun A : Matrix (Fin 2) (Fin 2) Eis => A 0 1) h have h10 := congrArg (fun A : Matrix (Fin 2) (Fin 2) Eis => A 1 0) h have h11 := congrArg (fun A : Matrix (Fin 2) (Fin 2) Eis => A 1 1) h norm_num [cubeDiagonal, Matrix.mul_apply, Fin.sum_univ_two] at h00 h01 h10 h11 exact ⟨h00,h01,h10,h11⟩ lemma cubeCorrespondenceLeft_injective (p : Eis) (hp : p ≠ 0) : Function.Injective (cubeCorrespondenceLeft p) := by intro x y h have hx := cubeCorrespondence_entries p x have hy := cubeCorrespondence_entries p y have hM : x.1.1=y.1.1 := h apply Subtype.ext apply Prod.ext hM apply Subtype.ext apply Matrix.SpecialLinearGroup.ext intro i j fin_cases i <;> fin_cases j · exact mul_right_cancel₀ (pow_ne_zero 3 hp) (hx.1.symm.trans (by rw [hM]; exact hy.1)) · exact hx.2.1.symm.trans (by rw [hM]; exact hy.2.1) · exact mul_right_cancel₀ (pow_ne_zero 3 hp) (hx.2.2.1.symm.trans (by rw [hM]; exact hy.2.2.1)) · exact hx.2.2.2.symm.trans (by rw [hM]; exact hy.2.2.2) lemma cubeCorrespondenceRight_injective (p : Eis) (hp : p ≠ 0) : Function.Injective (cubeCorrespondenceRight p) := by intro x y h have hx := cubeCorrespondence_entries p x have hy := cubeCorrespondence_entries p y have hN : x.1.2=y.1.2 := h apply Subtype.ext refine Prod.ext ?_ hN apply Subtype.ext apply Matrix.SpecialLinearGroup.ext intro i j fin_cases i <;> fin_cases j · exact mul_left_cancel₀ (pow_ne_zero 3 hp) (hx.1.trans (by rw [hN]; exact hy.1.symm)) · exact mul_left_cancel₀ (pow_ne_zero 3 hp) (hx.2.1.trans (by rw [hN]; exact hy.2.1.symm)) · exact hx.2.2.1.trans (by rw [hN]; exact hy.2.2.1.symm) · exact hx.2.2.2.trans (by rw [hN]; exact hy.2.2.2.symm) lemma cubeCorrespondence_value (p : Eis) (hp : p ≠ 0) (MN : cubeCorrespondence p) : value (cubeCorrespondenceLeft p MN) = value (cubeCorrespondenceRight p MN) := by have he := cubeCorrespondence_entries p MN let M : levelThree := MN.1.1 let N : levelThree := MN.1.2 have ha : (M : SL(2,Eis)) 0 0 = (N : SL(2,Eis)) 0 0 := mul_left_cancel₀ (pow_ne_zero 3 hp) (he.1.trans (mul_comm _ _)) have hc : (M : SL(2,Eis)) 1 0 = p^3 * (N : SL(2,Eis)) 1 0 := he.2.2.1.trans (mul_comm _ _) have hd : (M : SL(2,Eis)) 0 0 * (M : SL(2,Eis)) 1 1 - (M : SL(2,Eis)) 0 1 * (M : SL(2,Eis)) 1 0 = 1 := by simpa only [Matrix.det_fin_two] using (M : SL(2,Eis)).property have hcop : IsCoprime p ((N : SL(2,Eis)) 0 0) := by refine ⟨-(M : SL(2,Eis)) 0 1 * p^2 * (N : SL(2,Eis)) 1 0, (M : SL(2,Eis)) 1 1,?_⟩ rw [ha,hc] at hd linear_combination hd change symbol ((M : SL(2,Eis)) 1 0) ((M : SL(2,Eis)) 0 0) = symbol ((N : SL(2,Eis)) 1 0) ((N : SL(2,Eis)) 0 0) rw [ha,hc,symbol_mul_numerator _ _ _ (levelThree_primary N), symbol_pow_numerator _ _ (levelThree_primary N), symbol_cube_of_isCoprime _ _ (levelThree_primary N) hcop,one_mul] lemma cubeCorrespondence_character (p : Eis) (hp : p ≠ 0) (MN : cubeCorrespondence p) : complexCharacter (cubeCorrespondenceLeft p MN) = complexCharacter (cubeCorrespondenceRight p MN) := by exact congrArg ConcreteTraceCRT.eisEmbedding (cubeCorrespondence_value p hp MN) end section open ActualEisensteinCubic ConcreteTraceCRT namespace RootNotationCubeCorrespondence02 abbrev Eis := ActualEisensteinCubic.O end RootNotationCubeCorrespondence02 open RootNotationCubeCorrespondence02 (Eis) def cubePrincipalLevel (p : Eis) : Subgroup levelThree := ((Matrix.SpecialLinearGroup.map (n:=Fin 2) (Ideal.Quotient.mk (Ideal.span {(3:Eis)*p^3}))).comp levelThree.subtype).ker lemma cubePrincipalLevel_entry (p : Eis) (M : cubePrincipalLevel p) (i j : Fin 2) : (3:Eis)*p^3 ∣ ((M.1 : levelThree) : SL(2,Eis)) i j-(if i=j then 1 else 0) := by have hm : Matrix.SpecialLinearGroup.map (n:=Fin 2) (Ideal.Quotient.mk (Ideal.span {(3:Eis)*p^3})) ((M.1 : levelThree) : SL(2,Eis)) = 1 := M.property have h := congrArg (fun N : SL(2,Eis ⧸ Ideal.span {(3:Eis)*p^3}) => N i j) hm change Ideal.Quotient.mk (Ideal.span {(3:Eis)*p^3}) (((M.1 : levelThree) : SL(2,Eis)) i j) = (1 : Matrix (Fin 2) (Fin 2) (Eis ⧸ Ideal.span {(3:Eis)*p^3})) i j at h apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp simpa only [Matrix.one_apply, apply_ite, map_one, map_zero] using h lemma cubePrincipalLevel_finiteIndex (p : Eis) (hp : p ≠ 0) : (cubePrincipalLevel p).FiniteIndex := by let : Finite (Eis ⧸ Ideal.span {(3:Eis)*p^3}) := finite_quotient_span (mul_ne_zero (by norm_num) (pow_ne_zero 3 hp)) unfold cubePrincipalLevel infer_instance lemma cubePrincipalLevel_left_mate (p : Eis) (M : cubePrincipalLevel p) : ∃ N : levelThree, ((M.1 : levelThree),N) ∈ cubeCorrespondence p := by obtain ⟨c,hc⟩ : (3:Eis)*p^3 ∣ ((M.1 : levelThree) : SL(2,Eis)) 1 0 := by simpa using cubePrincipalLevel_entry p M 1 0 let A : SL(2,Eis) := M.1 let N : SL(2,Eis) := ⟨!![A 0 0,p^3*A 0 1;3*c,A 1 1],by have hd := A.property rw [Matrix.det_fin_two] at hd rw [Matrix.det_fin_two_of] change A 1 0=(3:Eis)*p^3*c at hc rw [hc] at hd linear_combination hd⟩ have hN : N∈levelThree := by apply (mem_levelThree_iff_entries N).mpr intro i j fin_cases i <;> fin_cases j · exact levelThree_entry M.1 0 0 · change (3:Eis)∣p^3*A 0 1-0 simpa using dvd_mul_of_dvd_right (levelThree_upper M.1) (p^3) · change (3:Eis)∣3*c-0 simp · exact levelThree_entry M.1 1 1 refine ⟨⟨N,hN⟩,?_⟩ change cubeDiagonal p*A.val=N.val*cubeDiagonal p apply Matrix.ext intro i j fin_cases i <;> fin_cases j <;> norm_num [cubeDiagonal,N,Matrix.mul_apply,Fin.sum_univ_two] · ring · change A 1 0=(3:Eis)*p^3*c at hc change A 1 0=3*c*p^3 rw [hc] ring lemma cubePrincipalLevel_right_mate (p : Eis) (N : cubePrincipalLevel p) : ∃ M : levelThree, (M,(N.1 : levelThree)) ∈ cubeCorrespondence p := by obtain ⟨b,hb⟩ : (3:Eis)*p^3 ∣ ((N.1 : levelThree) : SL(2,Eis)) 0 1 := by simpa using cubePrincipalLevel_entry p N 0 1 let A : SL(2,Eis) := N.1 let M : SL(2,Eis) := ⟨!![A 0 0,3*b;p^3*A 1 0,A 1 1],by have hd := A.property rw [Matrix.det_fin_two] at hd rw [Matrix.det_fin_two_of] change A 0 1=(3:Eis)*p^3*b at hb rw [hb] at hd linear_combination hd⟩ have hM : M∈levelThree := by apply (mem_levelThree_iff_entries M).mpr intro i j fin_cases i <;> fin_cases j · exact levelThree_entry N.1 0 0 · change (3:Eis)∣3*b-0 simp · change (3:Eis)∣p^3*A 1 0-0 simpa using dvd_mul_of_dvd_right (levelThree_lower N.1) (p^3) · exact levelThree_entry N.1 1 1 refine ⟨⟨M,hM⟩,?_⟩ change cubeDiagonal p*M.val=A.val*cubeDiagonal p apply Matrix.ext intro i j fin_cases i <;> fin_cases j <;> norm_num [cubeDiagonal,M,Matrix.mul_apply,Fin.sum_univ_two] · ring · change A 0 1=(3:Eis)*p^3*b at hb change p^3*(3*b)=A 0 1 rw [hb] ring · ring lemma cubePrincipalLevel_le_left_range (p : Eis) : cubePrincipalLevel p ≤ (cubeCorrespondenceLeft p).range := by intro M hM obtain ⟨N,hN⟩ := cubePrincipalLevel_left_mate p ⟨M,hM⟩ exact ⟨⟨(M,N),hN⟩,rfl⟩ lemma cubePrincipalLevel_le_right_range (p : Eis) : cubePrincipalLevel p ≤ (cubeCorrespondenceRight p).range := by intro N hN obtain ⟨M,hM⟩ := cubePrincipalLevel_right_mate p ⟨N,hN⟩ exact ⟨⟨(M,N),hM⟩,rfl⟩ lemma cubeCorrespondence_finite_covers (p : Eis) (hp : p ≠ 0) : Function.Injective (cubeCorrespondenceLeft p) ∧ Function.Injective (cubeCorrespondenceRight p) ∧ (cubeCorrespondenceLeft p).range.FiniteIndex ∧ (cubeCorrespondenceRight p).range.FiniteIndex := by let : (cubePrincipalLevel p).FiniteIndex := cubePrincipalLevel_finiteIndex p hp exact ⟨cubeCorrespondenceLeft_injective p hp,cubeCorrespondenceRight_injective p hp, Subgroup.finiteIndex_of_le (cubePrincipalLevel_le_left_range p), Subgroup.finiteIndex_of_le (cubePrincipalLevel_le_right_range p)⟩ end section open ActualEisensteinCubic ConcreteTraceCRT CubicEisenstein namespace RootNotationCubeCorrespondence03 abbrev Eis := ActualEisensteinCubic.O end RootNotationCubeCorrespondence03 open RootNotationCubeCorrespondence03 (Eis) def cubeKernelCorrespondence (p : Eis) : Subgroup (cubeCorrespondence p) := (finiteCubicMultiplier.comp (cubeCorrespondenceLeft p)).ker def cubeKernelLeft (p : Eis) : cubeKernelCorrespondence p →* finiteCubicMultiplier.ker where toFun x := ⟨cubeCorrespondenceLeft p x.1,x.property⟩ map_one' := by apply Subtype.ext; exact map_one (cubeCorrespondenceLeft p) map_mul' x y := by apply Subtype.ext; exact map_mul (cubeCorrespondenceLeft p) x.1 y.1 lemma cubeKernel_right_mem (p : Eis) (hp : p ≠ 0) (x : cubeKernelCorrespondence p) : cubeCorrespondenceRight p x.1 ∈ finiteCubicMultiplier.ker := by apply (finiteCubicMultiplier_eq_one _).mpr rw [←cubeCorrespondence_character p hp x.1] exact (finiteCubicMultiplier_eq_one _).mp x.property def cubeKernelRight (p : Eis) (hp : p ≠ 0) : cubeKernelCorrespondence p →* finiteCubicMultiplier.ker where toFun x := ⟨cubeCorrespondenceRight p x.1,cubeKernel_right_mem p hp x⟩ map_one' := by apply Subtype.ext; exact map_one (cubeCorrespondenceRight p) map_mul' x y := by apply Subtype.ext; exact map_mul (cubeCorrespondenceRight p) x.1 y.1 lemma cubeKernelLeft_range (p : Eis) : (cubeKernelLeft p).range = (cubeCorrespondenceLeft p).range.comap finiteCubicMultiplier.ker.subtype := by ext y constructor · rintro ⟨x,rfl⟩ exact ⟨x.1,rfl⟩ · rintro ⟨x,hx⟩ have hmem : x∈cubeKernelCorrespondence p := by change finiteCubicMultiplier (cubeCorrespondenceLeft p x)=1 rw [hx] exact y.property exact ⟨⟨x,hmem⟩,Subtype.ext hx⟩ lemma cubeKernelRight_range (p : Eis) (hp : p ≠ 0) : (cubeKernelRight p hp).range = (cubeCorrespondenceRight p).range.comap finiteCubicMultiplier.ker.subtype := by ext y constructor · rintro ⟨x,rfl⟩ exact ⟨x.1,rfl⟩ · rintro ⟨x,hx⟩ have hmem : x∈cubeKernelCorrespondence p := by apply (finiteCubicMultiplier_eq_one _).mpr rw [cubeCorrespondence_character p hp x,hx] exact (finiteCubicMultiplier_eq_one _).mp y.property exact ⟨⟨x,hmem⟩,Subtype.ext hx⟩ lemma cubeKernel_finite_covers (p : Eis) (hp : p ≠ 0) : Function.Injective (cubeKernelLeft p) ∧ Function.Injective (cubeKernelRight p hp) ∧ (cubeKernelLeft p).range.FiniteIndex ∧ (cubeKernelRight p hp).range.FiniteIndex := by have hcov := cubeCorrespondence_finite_covers p hp let := hcov.2.2.1 let := hcov.2.2.2 refine ⟨?_,?_,?_,?_⟩ · intro x y h apply Subtype.ext apply hcov.1 exact congrArg Subtype.val h · intro x y h apply Subtype.ext apply hcov.2.1 exact congrArg Subtype.val h · rw [cubeKernelLeft_range] exact Subgroup.instFiniteIndex_subgroupOf (cubeCorrespondenceLeft p).range finiteCubicMultiplier.ker · rw [cubeKernelRight_range] exact Subgroup.instFiniteIndex_subgroupOf (cubeCorrespondenceRight p).range finiteCubicMultiplier.ker def cubeKernelLeftGlobal (p : Eis) : cubeKernelCorrespondence p →* SL(2,Eis) := levelThree.subtype.comp (finiteCubicMultiplier.ker.subtype.comp (cubeKernelLeft p)) def cubeKernelRightGlobal (p : Eis) (hp : p ≠ 0) : cubeKernelCorrespondence p →* SL(2,Eis) := levelThree.subtype.comp (finiteCubicMultiplier.ker.subtype.comp (cubeKernelRight p hp)) lemma cubeKernelLeftGlobal_le (p : Eis) : (cubeKernelLeftGlobal p).range ≤ globalKubotaKernel := by rintro M ⟨x,rfl⟩ exact ⟨(cubeKernelLeft p x).1,(cubeKernelLeft p x).property,rfl⟩ private lemma finiteIndex_subtype_image {G : Type*} [Group G] (H : Subgroup G) [H.FiniteIndex] (J : Subgroup H) [J.FiniteIndex] : (J.map H.subtype).FiniteIndex := by constructor rw [Subgroup.index_map_subtype] exact mul_ne_zero (Subgroup.FiniteIndex.index_ne_zero (H:=J)) (Subgroup.FiniteIndex.index_ne_zero (H:=H)) lemma cubeKernelGlobal_finite_covers (p : Eis) (hp : p ≠ 0) : (cubeKernelLeftGlobal p).range.FiniteIndex ∧ (cubeKernelRightGlobal p hp).range.FiniteIndex := by have hcov := cubeKernel_finite_covers p hp let := hcov.2.2.1 let := hcov.2.2.2 let : levelThree.FiniteIndex := levelThree_finiteIndex have hL : ((cubeKernelLeft p).range.map finiteCubicMultiplier.ker.subtype).FiniteIndex := finiteIndex_subtype_image _ _ have hR : ((cubeKernelRight p hp).range.map finiteCubicMultiplier.ker.subtype).FiniteIndex := finiteIndex_subtype_image _ _ constructor · rw [cubeKernelLeftGlobal,MonoidHom.range_comp,MonoidHom.range_comp] exact finiteIndex_subtype_image _ _ · rw [cubeKernelRightGlobal,MonoidHom.range_comp,MonoidHom.range_comp] exact finiteIndex_subtype_image _ _ end open ActualEisensteinCubic ConcreteTraceCRT CubicEisenstein namespace RootNotationCubeCorrespondence04 abbrev Eis := ActualEisensteinCubic.O end RootNotationCubeCorrespondence04 open RootNotationCubeCorrespondence04 (Eis) end CubicKubota open Filter MeasureTheory Asymptotics open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding namespace CubicEisenstein namespace RootNotationCubeCorrespondence05 abbrev O := ActualEisensteinCubic.O end RootNotationCubeCorrespondence05 open RootNotationCubeCorrespondence05 (O) def cuspBarProfile (f : HyperbolicSpace→ℂ) (z : ℂ) (v : ℝ) : ℂ := horizontalWirtingerBar (fun w=>f (cuspCoordinateLift (v,w))) z def cuspZProfile (f : HyperbolicSpace→ℂ) (z : ℂ) (v : ℝ) : ℂ := horizontalWirtingerZ (fun w=>f (cuspCoordinateLift (v,w))) z lemma cuspBarProfile_positive (f : HyperbolicSpace→ℂ) (z : ℂ) (v : ℝ) (hv : 0f (upperPoint w v hv)) z := by simp only [cuspBarProfile,cuspCoordinateLift_positive v _ hv] lemma cuspZProfile_positive (f : HyperbolicSpace→ℂ) (z : ℂ) (v : ℝ) (hv : 0f (upperPoint w v hv)) z := by simp only [cuspZProfile,cuspCoordinateLift_positive v _ hv] lemma horizontalWirtingerZ_star (f : ℂ→ℂ) (z : ℂ) : horizontalWirtingerZ (fun w=>star (f w)) z=star (horizontalWirtingerBar f z) := by unfold horizontalWirtingerBar horizontalWirtingerZ rw [deriv.star,deriv.star] simp [sub_eq_add_neg] namespace SubexponentialBesselCoefficients variable (coeff : SubexponentialBesselCoefficients) def directionalSeries (direction : ℂ) (p : ℝ × ℂ) : ℂ := ∑'h : ActualEisensteinCubic.O,coeff.directionalTerm h p.1 p.2 direction lemma directionalSeries_continuousOn_slab (direction : ℂ) (a b : ℝ) (ha : 0C*(‖cuspFrequency h‖*Real.exp (-(Real.pi*a)*‖cuspFrequency h‖))) · intro h have ht : ContinuousOn (coeff.term h) {p : ℝ × ℂ|p.1∈Set.Icc a b} := (coeff.term_continuousOn h).mono (fun p hp=>ha.trans_le hp.1) exact ht.const_mul (horizontalPhaseMultiplier (cuspFrequency h) direction) · exact (summable_norm_mul_exp_neg_cuspFrequency (Real.pi*a) (mul_pos Real.pi_pos ha)).mul_left C · intro h p hp exact hbound h p.1 p.2 hp lemma directionalSeries_continuousOn (direction : ℂ) : ContinuousOn (coeff.directionalSeries direction) {p : ℝ × ℂ|0coeff.directionalSeries direction (v,z)) (Set.Ioi 0) := (coeff.directionalSeries_continuousOn direction).comp (continuousOn_id.prodMk continuousOn_const) (fun v hv=>hv) apply (continuousOn_const.mul ((hd 1).sub (continuousOn_const.mul (hd Complex.I)))).congr intro v hv exact coeff.cuspZProfile_full_eq scalarTerm z v hv end SubexponentialBesselCoefficients lemma cuspZProfile_source_continuousOn (z : ℂ) : ContinuousOn (cuspZProfile cubicSourceResidualFunction z) (Set.Ioi 0) := by rw [cubicSourceResidualFunction_eq_bessel] exact sourceBesselCoefficients.cuspZProfile_continuousOn _ z lemma cuspBarProfile_conjugate_eq (z : ℂ) : cuspBarProfile cubicSourceConjugateFunction z=fun v=>star (cuspZProfile cubicSourceResidualFunction z v) := by funext v exact horizontalWirtingerBar_star _ z lemma cuspZProfile_conjugate_eq (z : ℂ) : cuspZProfile cubicSourceConjugateFunction z=fun v=>star (cuspBarProfile cubicSourceResidualFunction z v) := by funext v exact horizontalWirtingerZ_star _ z lemma cuspBarProfile_conjugate_continuousOn (z : ℂ) : ContinuousOn (cuspBarProfile cubicSourceConjugateFunction z) (Set.Ioi 0) := by rw [cuspBarProfile_conjugate_eq] exact (cuspZProfile_source_continuousOn z).star lemma cuspBarProfile_source_isBigO (z : ℂ) : cuspBarProfile cubicSourceResidualFunction z =O[atTop] (fun v : ℝ=>Real.exp (-residualCuspDecayRate*v)) := by obtain ⟨C,hC,hbound⟩ := cubicSourceResidualFunction_wirtingerBar_cusp_decay 1 (by norm_num) apply Asymptotics.IsBigO.of_bound C filter_upwards [eventually_ge_atTop (1:ℝ)] with v hv have hvp : 0Real.exp (-residualCuspDecayRate*v)) := by obtain ⟨C,hC,hbound⟩ := cubicSourceResidualFunction_wirtingerZ_cusp_decay 1 (by norm_num) apply Asymptotics.IsBigO.of_bound C filter_upwards [eventually_ge_atTop (1:ℝ)] with v hv have hvp : 0Real.exp (-residualCuspDecayRate*v)) := by obtain ⟨C,hC⟩ := Asymptotics.isBigO_iff.mp (cuspZProfile_source_isBigO z) apply Asymptotics.IsBigO.of_bound C filter_upwards [hC] with v hv simpa only [cuspBarProfile_conjugate_eq,norm_star] using hv lemma cuspZProfile_conjugate_isBigO (z : ℂ) : cuspZProfile cubicSourceConjugateFunction z =O[atTop] (fun v : ℝ=>Real.exp (-residualCuspDecayRate*v)) := by obtain ⟨C,hC⟩ := Asymptotics.isBigO_iff.mp (cuspBarProfile_source_isBigO z) apply Asymptotics.IsBigO.of_bound C filter_upwards [hC] with v hv simpa only [cuspZProfile_conjugate_eq,norm_star] using hv end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ConjugateCuspProfiles /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory Asymptotics open scoped BigOperators Classical Topology MatrixGroups open Finset AddChar MulChar EisensteinEmbedding end section open Filter MeasureTheory open scoped BigOperators Classical Topology open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationConjugateCuspProfiles01 abbrev O := ActualEisensteinCubic.O end RootNotationConjugateCuspProfiles01 open RootNotationConjugateCuspProfiles01 (O) lemma cubicBesselIntegralDeriv_continuousAt (x : ℝ) (hx : 0∫t in Set.Ioi (0:ℝ),cubicBesselDensityDeriv y t) x := by let delta := x/2 have hdelta : 0(4/delta)*(t^(-(2:ℝ)/3)*Real.exp (-t/2))) · exact Eventually.of_forall (fun y=>by unfold cubicBesselDensityDeriv cubicBesselDensity;fun_prop) · filter_upwards [Ioi_mem_nhds (show deltaby unfold cubicBesselDensityDeriv cubicBesselDensity;fun_prop) lemma schlafliBesselK_cubic_derivative_continuousAt (x : ℝ) (hx : 0(y/2)^(-(4:ℝ)/3)) x := (continuousAt_id.div_const 2).rpow_const (Or.inl (by positivity)) have hp1 : ContinuousAt (fun y : ℝ=>(y/2)^(-(1:ℝ)/3)) x := (continuousAt_id.div_const 2).rpow_const (Or.inl (by positivity)) have hI := (cubicBesselIntegral_hasDerivAt x hx).continuousAt have hD := cubicBesselIntegralDeriv_continuousAt x hx apply Complex.continuous_ofReal.continuousAt.comp exact ((continuousAt_const.mul hp4).mul hI).add ((continuousAt_const.mul hp1).mul hD) namespace SubexponentialBesselCoefficients variable (coeff : SubexponentialBesselCoefficients) lemma amplitudeDeriv_continuousAt (v : ℝ) (hv : 0coeff.amplitudeDeriv y h) v := by by_cases hh : h=0 · simpa only [amplitudeDeriv,ite_eq_left hh] using (continuousAt_const (y:=(0:ℂ)) (x:=v)) have hr : 0<‖cuspFrequency h‖ := norm_pos_iff.mpr (cuspFrequency_ne_zero h hh) have hK : ContinuousAt (fun y : ℝ=>schlafliBesselK (1/3) (4*Real.pi*‖cuspFrequency h‖*y)) v := (schlafliBesselK_cubic_hasDerivAt _ (by positivity)).continuousAt.comp (by fun_prop) have hD : ContinuousAt (fun y : ℝ=>schlafliBesselK_cubic_derivative (4*Real.pi*‖cuspFrequency h‖*y)) v := (schlafliBesselK_cubic_derivative_continuousAt _ (by positivity)).comp (by fun_prop) simp only [amplitudeDeriv,ite_eq_right hh] exact continuousAt_const.mul (hK.add ((Complex.continuous_ofReal.continuousAt.mul continuousAt_const).mul hD)) lemma termFDeriv_continuousAt (h : ActualEisensteinCubic.O) (p : ℝ × ℂ) (hp : 0(0:(ℝ × ℂ)→L[ℝ]ℂ) := by funext q simp only [termFDeriv,ite_eq_left hh] rw [he] exact continuousAt_const have hA := (coeff.amplitudeDeriv_continuousAt p.1 hp h).comp continuousAt_fst have hphase : ContinuousAt (fun q : ℝ × ℂ=>ShortDraftTrace.breveE (cuspFrequency h*q.2)) p := by change ContinuousAt (fun q : ℝ × ℂ=>Complex.exp (2*Real.pi*Complex.I* ((cuspFrequency h*q.2)+starRingEnd ℂ (cuspFrequency h*q.2)))) p fun_prop have hfirst := (ContinuousLinearMap.smulRightL ℝ (ℝ × ℂ) ℂ (ContinuousLinearMap.fst ℝ ℝ ℂ)).continuous.continuousAt.comp (hA.mul hphase) have hterm := (coeff.term_continuousOn h).continuousAt ((isOpen_lt continuous_const continuous_fst).mem_nhds hp) have hsecond := hterm.smul (continuousAt_const (y:=(horizontalPhaseCLM (cuspFrequency h)).comp (ContinuousLinearMap.snd ℝ ℝ ℂ))) have he : coeff.termFDeriv h=(fun q : ℝ × ℂ=> (ContinuousLinearMap.fst ℝ ℝ ℂ).smulRight (coeff.amplitudeDeriv q.1 h*ShortDraftTrace.breveE (cuspFrequency h*q.2))+ coeff.term h q • (horizontalPhaseCLM (cuspFrequency h)).comp (ContinuousLinearMap.snd ℝ ℝ ℂ)) := by funext q simp only [termFDeriv,ite_eq_right hh] rw [he] exact hfirst.add hsecond lemma seriesFDeriv_continuousOn_slab (a b : ℝ) (ha : 0∑'h : ActualEisensteinCubic.O,coeff.termFDeriv h p) {p : ℝ × ℂ|p.1∈Set.Icc a b} := by obtain ⟨C,hC,hbound⟩ := coeff.termFDeriv_slab_bound a b ha hab apply continuousOn_tsum (u:=fun h : ActualEisensteinCubic.O=>C*((1+‖cuspFrequency h‖)*Real.exp (-(Real.pi*a)*‖cuspFrequency h‖))) · intro h p hp exact (coeff.termFDeriv_continuousAt h p (ha.trans_le hp.1)).continuousWithinAt · exact (summable_one_add_norm_exp_neg_cuspFrequency (Real.pi*a) (mul_pos Real.pi_pos ha)).mul_left C · exact hbound lemma series_contDiffAt_one (p : ℝ × ℂ) (hp : 0∑'h : ActualEisensteinCubic.O,coeff.termFDeriv h q), {q : ℝ × ℂ|q.1∈Set.Icc (p.1/2) (2*p.1)},?_,?_,?_⟩ · exact continuousAt_fst.tendsto.eventually (Icc_mem_nhds (by linarith) (by linarith)) · exact coeff.seriesFDeriv_continuousOn_slab _ _ (by linarith) (by linarith) · intro q hq exact coeff.series_hasFDerivAt q (by change p.1/2≤q.1 ∧ q.1≤2*p.1 at hq;linarith [hq.1]) end SubexponentialBesselCoefficients end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open Finset AddChar MulChar EisensteinEmbedding def cuspSpatialInput (q : ℝ × ℂ) : SpatialCoordinates := ![q.2.re,q.2.im,q.1] def cuspSpatialOutput (p : SpatialCoordinates) : ℝ × ℂ := (p 2,spatialHorizontal p) lemma cuspSpatialInput_contDiff : ContDiff ℝ 1 cuspSpatialInput := by apply contDiff_pi.mpr intro j fin_cases j · change ContDiff ℝ 1 (fun q : ℝ × ℂ=>q.2.re) exact Complex.reCLM.contDiff.comp contDiff_snd · change ContDiff ℝ 1 (fun q : ℝ × ℂ=>q.2.im) exact Complex.imCLM.contDiff.comp contDiff_snd · change ContDiff ℝ 1 (fun q : ℝ × ℂ=>q.1) fun_prop lemma cuspSpatialOutput_contDiff : ContDiff ℝ 1 cuspSpatialOutput := (contDiff_apply ℝ ℝ 2).prodMk (spatialHorizontal_contDiff.of_le (by simp)) lemma cuspSpatialAction_lift (g : SL(2,ℂ)) (q : ℝ × ℂ) (hq : 0coeff.fullFunction scalarTerm (cuspCoordinateLift q)) p := by have hreal : ContDiffAt ℝ 1 (fun q : ℝ × ℂ=>q.1^(2/3:ℝ)) p := contDiff_fst.contDiffAt.rpow_const_of_ne hp.ne' have hcast := Complex.ofRealCLM.contDiff.contDiffAt.comp p hreal have hpow : ContDiffAt ℝ 1 (fun q : ℝ × ℂ=>(q.1:ℂ)^(2/3:ℂ)) p := by apply hcast.congr_of_eventuallyEq filter_upwards [continuousAt_fst.tendsto.eventually (Ioi_mem_nhds hp)] with q hq have he := Complex.ofReal_cpow (le_of_lt hq) (2/3:ℝ) norm_num only [Complex.ofReal_div,Complex.ofReal_ofNat] at he exact he.symm have hfull : ContDiffAt ℝ 1 (fun q : ℝ × ℂ=>scalarTerm*(q.1:ℂ)^(2/3:ℂ)+coeff.series q) p := (contDiffAt_const.mul hpow).add (coeff.series_contDiffAt_one p hp) apply hfull.congr_of_eventuallyEq filter_upwards [continuousAt_fst.tendsto.eventually (Ioi_mem_nhds hp)] with q hq exact coeff.fullFunction_cusp_eq scalarTerm q hq lemma fullFunction_translate_cusp_contDiffAt_one (scalarTerm : ℂ) (g : SL(2,ℂ)) (p : ℝ × ℂ) (hp : 0coeff.fullFunction scalarTerm (g•cuspCoordinateLift q)) p := by have hmid : ContDiffAt ℝ 1 (fun q=>mobiusSpatial g (cuspSpatialInput q)) p := ((mobiusSpatial_contDiffAt g (cuspSpatialInput p) hp).of_le (by simp)).comp p cuspSpatialInput_contDiff.contDiffAt have hact := cuspSpatialOutput_contDiff.contDiffAt.comp p hmid have hpos : 0<(cuspSpatialOutput (mobiusSpatial g (cuspSpatialInput p))).1 := mobiusSpatial_positive g _ hp have hfull := (coeff.fullFunction_cusp_contDiffAt_one scalarTerm _ hpos).comp p hact apply hfull.congr_of_eventuallyEq filter_upwards [continuousAt_fst.tendsto.eventually (Ioi_mem_nhds hp)] with q hq exact congrArg (coeff.fullFunction scalarTerm) (cuspSpatialAction_lift g q hq).symm lemma fullFunction_translate_split_contDiffAt_one (scalarTerm : ℂ) (g : SL(2,ℂ)) (p : ℂ × ℝ) (hp : 0coeff.fullFunction scalarTerm (g•cuspCoordinateLift (q.2,q.1))) p := by have hswap : ContDiffAt ℝ 1 (fun q : ℂ × ℝ=>(q.2,q.1)) p := by fun_prop exact (coeff.fullFunction_translate_cusp_contDiffAt_one scalarTerm g (p.2,p.1) hp).comp p hswap end SubexponentialBesselCoefficients lemma cubicSourceResidualFunction_translate_split_contDiffAt_one (g : SL(2,ℂ)) (p : ℂ × ℝ) (hp : 0cubicSourceResidualFunction (g•cuspCoordinateLift (q.2,q.1))) p := by rw [cubicSourceResidualFunction_eq_bessel] exact sourceBesselCoefficients.fullFunction_translate_split_contDiffAt_one _ g p hp lemma cubicSourceConjugateFunction_translate_split_contDiffAt_one (g : SL(2,ℂ)) (p : ℂ × ℝ) (hp : 0cubicSourceConjugateFunction (g•cuspCoordinateLift (q.2,q.1))) p := by exact Complex.conjCLE.contDiff.contDiffAt.comp p (cubicSourceResidualFunction_translate_split_contDiffAt_one g p hp) lemma cuspZProfile_continuousOn_of_contDiff (f : HyperbolicSpace→ℂ) (hreg : ∀p : ℂ × ℝ,0f (cuspCoordinateLift (q.2,q.1))) p) (z : ℂ) : ContinuousOn (cuspZProfile f z) (Set.Ioi 0) := by let F : ℂ × ℝ→ℂ := fun q=>f (cuspCoordinateLift (q.2,q.1)) intro v hv have hd : ContinuousAt (fderiv ℝ F) (z,v) := (hreg (z,v) hv).continuousAt_fderiv (by norm_num) have hc : ContinuousAt (fun y : ℝ=>(z,y)) v := continuousAt_const.prodMk continuousAt_id have h1 := (hd.comp hc).clm_apply (continuousAt_const (y:=((1,0):ℂ × ℝ))) have hI := (hd.comp hc).clm_apply (continuousAt_const (y:=((Complex.I,0):ℂ × ℝ))) have hformula : ContinuousAt (fun y : ℝ=>(1/2:ℂ)* ((fderiv ℝ F (z,y)) (1,0)-Complex.I*(fderiv ℝ F (z,y)) (Complex.I,0))) v := continuousAt_const.mul (h1.sub (continuousAt_const.mul hI)) apply ContinuousAt.continuousWithinAt apply hformula.congr_of_eventuallyEq filter_upwards [Ioi_mem_nhds (show 0cubicSourceConjugateFunction (H•w)) z) (Set.Ioi 0) := cuspZProfile_continuousOn_of_contDiff _ (cubicSourceConjugateFunction_translate_split_contDiffAt_one H) z end section open Filter MeasureTheory open scoped BigOperators Classical open ActualEisensteinCubic ConcreteTraceCRT CubicRamified namespace RootNotationConjugateCuspProfiles02 abbrev Eis := ActualEisensteinCubic.O end RootNotationConjugateCuspProfiles02 open RootNotationConjugateCuspProfiles02 (Eis) lemma ninth_trace_character_period (c x : Eis) : ShortDraftTrace.breveE ((eisEmbedding c/(9*eisLam))*(9*eisEmbedding x))=1 := by have he : (eisEmbedding c/(9*eisLam))*(9*eisEmbedding x)=eisEmbedding (c*x)/eisLam := by rw [map_mul] ring rw [he,breveE_embedding_div_traceLambda] lemma ramifiedSource_scaled_periodic10 (v : ℝ) (hv : 0 omega_primitive.ne_one (by decide) (eisEmbedding_injective (by simpa using h)) · intro z have he : 3*(1+z)=3*z+3*eisEmbedding (ActualEisensteinCoordinates.eval 1 0) := by norm_num [ActualEisensteinCoordinates.eval] ring rw [he,ramifiedSourceFunction_upper_shift10,ramifiedShift10_period] norm_num [cubicExp] theorem ramifiedSource_zero_mode19 (v : ℝ) (hv : 0 simp [lowerCuspMatrix,mul_comm] lemma unitLower_row_phase (u : Eisˣ) (p : UnitLowerData) : (cosetCharacter (primitiveRowEquiv.symm (unitLowerEquiv u p)))⁻¹= eisEmbedding (symbol (u:Eis) p.2.val.val)* eisEmbedding (symbol p.2.val.val p.1.val) := by rw [inverse_cosetCharacter_eq_row_symbol,primitiveRowEquiv_symm_row] change eisEmbedding (symbol ((u:Eis)*(p.1.val-p.2.val.val)) p.2.val.val)=_ have hh : symbol ((u:Eis)*(p.1.val-p.2.val.val)) p.2.val.val= symbol ((u:Eis)*p.1.val) p.2.val.val := by exact symbol_congr ⟨-(u:Eis),by ring⟩ rw [hh,symbol_mul_numerator _ _ _ (primaryLower_primary p.2.val), symbol_reciprocity p.1.val p.2.val.val (primaryLower_ne_zero p.1) (primaryLower_ne_zero p.2.val) (primaryLower_primary p.1) (primaryLower_primary p.2.val),map_mul] def unitLowerTerm (u : Eisˣ) (z : ℂ) (v : ℝ) (s : ℂ) (a d : Eis) : ℂ := (eisEmbedding (symbol (u:Eis) d)*eisEmbedding (symbol d a))* ((v/(‖eisEmbedding ((u:Eis)*a)*z+eisEmbedding d‖^2+ ‖eisEmbedding ((u:Eis)*a)‖^2*v^2):ℝ):ℂ)^s lemma unitLower_summand (u : Eisˣ) (z : ℂ) (v : ℝ) (hv : 0 simp [unitLowerEquiv, Equiv.ofBijective_apply, unitLowerToPrimitive, r, map_mul, map_sub, mul_sub] have hr0 : r≠0 := by intro hh have he := congrFun hh 1 exact eisEmbedding_ne_zero (primaryLower_ne_zero p.2.val) he have hp := heightDenominator_pos z v hv r hr0 rw [summand,←rowOperator_mul,hr,rowEnergy_upperSection,unitLower_row_phase] change _=(eisEmbedding (symbol (u:Eis) p.2.val.val)*eisEmbedding (symbol p.2.val.val p.1.val))* ((v/heightDenominator z v r:ℝ):ℂ)^s have hi : ((v/heightDenominator z v r:ℝ):ℂ)= (((heightDenominator z v r/v:ℝ):ℂ))⁻¹ := by simp only [Complex.ofReal_div,inv_div] rw [hi,Complex.inv_cpow_ofReal_nonneg (div_nonneg hp.le hv.le),Complex.cpow_neg] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CuspDilation /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationCuspDilation01 abbrev Eis := ActualEisensteinCubic.O end RootNotationCuspDilation01 open RootNotationCuspDilation01 (Eis) def ramifiedTraceLambda : Eis := 1+2*omega lemma ramifiedEmbedding_traceLambda : eisEmbedding ramifiedTraceLambda=eisLam := by change eisEmbedding (1+2*omega)=1+2*EisensteinEmbedding.omega3 rw [map_add,map_one,map_mul,map_ofNat,eisEmbedding_omega_actual] lemma primary_add_three (a r : Eis) (ha : lambda^2∣a-1) : lambda^2∣a+3*r-1 := by have h3 : (3:Eis)∣a-1 := three_dvd_lambda_sq.trans ha exact lambda_sq_dvd_three.trans (by convert dvd_add h3 (dvd_mul_right (3:Eis) r) using 1 ;ring) end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationCuspDilation02 abbrev Eis := ActualEisensteinCubic.O end RootNotationCuspDilation02 open RootNotationCuspDilation02 (Eis) def ninthCuspFrequency (h : Eis) : ℂ := cuspFrequency h/3 end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified CompletedGauss namespace RootNotationCuspDilation03 abbrev Eis := ActualEisensteinCubic.O end RootNotationCuspDilation03 open RootNotationCuspDilation03 (Eis) end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology namespace CubicEisenstein lemma cuspTransition_dilate (A : ℝ) (hA : A≠0) : cuspTransition A (2*A)=fun v => cuspTransition 1 2 (v/A) := by funext v unfold cuspTransition congr 1 field_simp lemma cuspTransition_dilate_deriv (A v : ℝ) (hA : A≠0) : deriv (cuspTransition A (2*A)) v=deriv (cuspTransition 1 2) (v/A)/A := by rw [cuspTransition_dilate A hA] have hd := (((cuspTransition_contDiff 1 2).differentiable (by simp) (v/A)).hasDerivAt).comp v ((hasDerivAt_id v).div_const A) simpa [Function.comp_def,id_eq,div_eq_mul_inv] using hd.deriv lemma cuspTransition_dilate_second (A v : ℝ) (hA : A≠0) : deriv (deriv (cuspTransition A (2*A))) v= deriv (deriv (cuspTransition 1 2)) (v/A)/A^2 := by have he : deriv (cuspTransition A (2*A))= fun x => deriv (cuspTransition 1 2) (x/A)/A := by funext x exact cuspTransition_dilate_deriv A x hA rw [he] have hc := (contDiff_infty_iff_deriv.mp (cuspTransition_contDiff 1 2)).2 have hd := (((hc.differentiable (by simp) (v/A)).hasDerivAt).comp v ((hasDerivAt_id v).div_const A)).div_const A simp only [Function.comp_def,id_eq] at hd convert hd.deriv using 1; field_simp def cuspBaseDefectFactor (s : ℂ) (x : ℝ) : ℂ := (x:ℂ)^2*(deriv (deriv (cuspTransition 1 2)) x:ℝ)+ (2*s-1)*(x:ℂ)*(deriv (cuspTransition 1 2) x:ℝ) lemma cuspBaseDefectFactor_continuous (s : ℂ) : Continuous (cuspBaseDefectFactor s) := by have h1 := (contDiff_infty_iff_deriv.mp (cuspTransition_contDiff 1 2)).2 have h2 := (contDiff_infty_iff_deriv.mp h1).2 unfold cuspBaseDefectFactor exact ((Complex.continuous_ofReal.pow 2).mul (Complex.continuous_ofReal.comp h2.continuous)).add ((continuous_const.mul Complex.continuous_ofReal).mul (Complex.continuous_ofReal.comp h1.continuous)) lemma cuspBaseDefectFactor_compact (s : ℂ) : HasCompactSupport (cuspBaseDefectFactor s) := by apply HasCompactSupport.of_support_subset_isCompact (isCompact_Icc : IsCompact (Set.Icc (1:ℝ) 2)) intro x hx by_contra hn have hout : x<1 ∨ 2 ?_⟩ have hApos : 0.mpr hv.2) hC _ = (4*C)*A^2 := by ring · have hout : v cuspCutoffCorrection_norm_le _ _ (by positivity) (hbound A hA) w⟩ open Filter MeasureTheory open scoped BigOperators Classical Topology InnerProductSpace lemma movingDefect_product_bound (f : KernelQuotient→ℂ) (K C : ℝ) (hK : 0≤K) (hC : 0≤C) (hdec : ∀w : HyperbolicSpace, ∀r : CuspCosets,1 change ‖f (integralOrbitProjection globalKubotaKernel w)‖* ‖smoothCuspSeedDefect A (2*A) (4/3) w‖≤_ have hApos : 0 intro hr change 1 fin_cases j · exact hx · have hv := dvd_mul_of_dvd_left hr (-v) convert hv using 1 ; dsimp [N,t] ; linear_combination (A 0 1)*huv · exact hy · have hu := dvd_mul_of_dvd_left hr u convert hu using 1 ; dsimp [N,t] ; linear_combination (A 1 1)*huv have hq : Matrix.SpecialLinearGroup.map (n:=Fin 2) (Ideal.Quotient.mk (Ideal.span {(3:Eis)})) N = Matrix.SpecialLinearGroup.map (n:=Fin 2) (Ideal.Quotient.mk (Ideal.span {(3:Eis)})) A := by apply Matrix.SpecialLinearGroup.ext intro i j exact (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr (Ideal.mem_span_singleton.mpr (hmod i j)) refine ⟨N,rfl,rfl,?_⟩ change Matrix.SpecialLinearGroup.map (n:=Fin 2) (Ideal.Quotient.mk (Ideal.span {(3:Eis)})) (N*A⁻¹)=1 rw [map_mul,map_inv,hq,mul_inv_cancel] lemma cusp_completion_upper_factor (A N : SL(2,Eis)) (q g x y : Eis) (hx : A 0 0+3*q*A 1 0=g*N 0 0) (hy : x*A 1 0=g*N 1 0) (hg : g≠0) (hdet : x=g*y) : N.val⁻¹ * (!![1,3*q;0,x] * A.val) = !![g,(N.val⁻¹ * (!![1,3*q;0,x] * A.val)) 0 1;0,y] := by have hNdet : N 0 0*N 1 1-N 0 1*N 1 0=1 := by simpa only [Matrix.det_fin_two] using N.property have hAdet : A 0 0*A 1 1-A 0 1*A 1 0=1 := by simpa only [Matrix.det_fin_two] using A.property have hinv : N.val⁻¹ = !![N 1 1,-N 0 1;-N 1 0,N 0 0] := by rw [Matrix.inv_def,Matrix.SpecialLinearGroup.det_coe,Ring.inverse_one,one_smul,Matrix.adjugate_fin_two] apply Matrix.ext intro i j fin_cases i <;> fin_cases j · norm_num [hinv,Matrix.mul_apply,Matrix.vecMul,dotProduct,Fin.sum_univ_two] rw [hx,hy] linear_combination g*hNdet · rfl · norm_num [hinv,Matrix.mul_apply,Matrix.vecMul,dotProduct,Fin.sum_univ_two] rw [hx,hy] ring · norm_num [hinv,Matrix.mul_apply,Matrix.vecMul,dotProduct,Fin.sum_univ_two] apply mul_left_cancel₀ hg linear_combination x*hAdet-x*(A 1 1)*hx+(A 0 1+3*q*A 1 1)*hy+hdet end open ActualEisensteinCubic ConcreteTraceCRT CubicEisenstein CubicRamified namespace RootNotationCuspDilation05 abbrev Eis := ActualEisensteinCubic.O end RootNotationCuspDilation05 open RootNotationCuspDilation05 (Eis) private lemma bounded_power_factor (p a : Eis) (n : ℕ) : ∃ j≤n,∃b,a=p^j*b ∧ (j=n ∨ ¬p∣b) := by induction n generalizing a with | zero => exact ⟨0,le_rfl,a,by simp,Or.inl rfl⟩ | succ n ih => by_cases h:p∣a · obtain ⟨a',rfl⟩:=h obtain ⟨j,hj,b,hab,hb⟩:=ih a' refine ⟨j+1,Nat.succ_le_succ hj,b,?_,?_⟩ · rw [hab,pow_succ] ring · exact hb.elim (fun h=>Or.inl (congrArg (fun k=>k+1) h)) Or.inr · exact ⟨0,Nat.zero_le _,a,by simp,Or.inr h⟩ lemma cube_average_cusp_reduction (A : SL(2,Eis)) (p q : Eis) (hp : Prime p) (hprimary : lambda^2∣p-1) : ∃ j≤3,∃N : SL(2,Eis), A 0 0+3*q*A 1 0=p^j*N 0 0 ∧ p^3*A 1 0=p^j*N 1 0 ∧ N*A⁻¹∈levelThree ∧ (j=3 ∨ ¬p∣N 0 0) ∧ N.val⁻¹*(!![1,3*q;0,p^3]*A.val)= !![p^j,(N.val⁻¹*(!![1,3*q;0,p^3]*A.val)) 0 1;0,p^(3-j)] := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let a:=A 0 0+3*q*A 1 0 have haC:IsCoprime a (A 1 0) := by have hd : A 0 0*A 1 1-A 0 1*A 1 0=1 := by simpa only [Matrix.det_fin_two] using A.property refine ⟨A 1 1,-(A 0 1+3*q*A 1 1),?_⟩ dsimp [a] linear_combination hd obtain ⟨j,hj,b,hab,hb⟩:=bounded_power_factor p a 3 have hbC:IsCoprime b (A 1 0) := by rw [hab] at haC exact haC.of_mul_left_right have hbY:IsCoprime b (p^(3-j)*A 1 0) := by rcases hb with h | h · simpa [h] using hbC · exact ((hp.coprime_iff_not_dvd.mpr h).symm.pow_right).mul_right hbC have hpow (k:ℕ):(3:Eis)∣p^k-1 := by have hd:(3:Eis)∣p-1:=CubicJacobiGlobal.three_dvd_primary_sub_one p hprimary simpa using hd.trans (sub_dvd_pow_sub_pow p 1 k) have hbA:(3:Eis)∣b-A 0 0 := by have h1:(3:Eis)∣a-A 0 0:=by refine ⟨q*A 1 0,?_⟩ dsimp [a] ring have h2:(3:Eis)∣a-b:=by rw [hab] convert dvd_mul_of_dvd_left (hpow j) b using 1 ; ring convert dvd_sub h1 h2 using 1 ; ring have hyC:(3:Eis)∣p^(3-j)*A 1 0-A 1 0 := by convert dvd_mul_of_dvd_left (hpow (3-j)) (A 1 0) using 1 ; ring obtain ⟨N,hN0,hN1,hNA⟩:=exists_congruent_cusp_completion A b (p^(3-j)*A 1 0) hbY hbA hyC have hA:a=p^j*N 0 0:=by rw [hN0];exact hab have hC:p^3*A 1 0=p^j*N 1 0:=by rw [hN1,←mul_assoc,←pow_add,Nat.add_sub_of_le hj] refine ⟨j,hj,N,hA,hC,hNA,?_,?_⟩ · simpa [hN0] using hb · exact cusp_completion_upper_factor A N q (p^j) (p^3) (p^(3-j)) hA hC (pow_ne_zero j hp.ne_zero) (by rw [←pow_add,Nat.add_sub_of_le hj]) end CubicKubota end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Cusp.ResiduesModThree namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped Classical MatrixGroups namespace EisensteinCuspModThree section open ActualEisensteinCoordinates (eval coords eval_coords unique_coordinates eval_mul) abbrev Pair := ZMod 3 × ZMod 3 def add (x y : Pair) : Pair := (x.1+y.1,x.2+y.2) def neg (x : Pair) : Pair := ((ZMod.commRing 3).neg x.1,(ZMod.commRing 3).neg x.2) def sub (x y : Pair) : Pair := add x (neg y) def mul (x y : Pair) : Pair := (x.1*y.1-x.2*y.2,x.1*y.2+x.2*y.1-x.2*y.2) def scalar (a : ZMod 3) (x : Pair) : Pair := (a*x.1,a*x.2) def residue (x : ActualEisensteinCubic.O) : Pair := ((coords x).1,(coords x).2) lemma residue_eval (a b : ℤ) : residue (eval a b)=((a:ZMod 3),(b:ZMod 3)) := by have h := unique_coordinates (eval_coords (eval a b)) exact Prod.ext (congrArg (fun n : ℤ => (n:ZMod 3)) h.1) (congrArg (fun n : ℤ => (n:ZMod 3)) h.2) lemma residue_intCast (a : ℤ) : residue (a:ActualEisensteinCubic.O)=((a:ZMod 3),0) := by simpa [eval] using residue_eval a 0 lemma residue_zero : residue (0:ActualEisensteinCubic.O)=(0,0) := by simpa using residue_intCast 0 lemma residue_one : residue (1:ActualEisensteinCubic.O)=(1,0) := by simpa using residue_intCast 1 lemma residue_add (x y : ActualEisensteinCubic.O) : residue (x+y)=add (residue x) (residue y) := by have he : x+y=eval ((coords x).1+(coords y).1) ((coords x).2+(coords y).2) := by nth_rw 1 [←eval_coords x,←eval_coords y] simp only [eval,Int.cast_add] ring rw [he,residue_eval] simp [residue,add] lemma residue_neg (x : ActualEisensteinCubic.O) : residue (-x)=neg (residue x) := by have he : -x=eval (-(coords x).1) (-(coords x).2) := by nth_rw 1 [←eval_coords x] simp only [eval,Int.cast_neg] ring rw [he,residue_eval] simp [residue,neg] lemma residue_sub (x y : ActualEisensteinCubic.O) : residue (x-y)=sub (residue x) (residue y) := by rw [sub_eq_add_neg,residue_add,residue_neg] rfl lemma residue_mul (x y : ActualEisensteinCubic.O) : residue (x*y)=mul (residue x) (residue y) := by calc residue (x*y)=residue (eval (coords x).1 (coords x).2*eval (coords y).1 (coords y).2) := by rw [eval_coords,eval_coords] _ = _ := by rw [eval_mul,residue_eval]; simp [residue,mul] lemma residue_eq_implies_three_dvd {x y : ActualEisensteinCubic.O} (h : residue x=residue y) : (3:ActualEisensteinCubic.O)∣x-y := by have h1 : (3:ℤ)∣(coords x).1-(coords y).1 := (ZMod.intCast_eq_intCast_iff_dvd_sub (coords y).1 (coords x).1 3).mp (congrArg Prod.fst h).symm have h2 : (3:ℤ)∣(coords x).2-(coords y).2 := (ZMod.intCast_eq_intCast_iff_dvd_sub (coords y).2 (coords x).2 3).mp (congrArg Prod.snd h).symm obtain ⟨a,ha⟩ := h1 obtain ⟨b,hb⟩ := h2 refine ⟨eval a b,?_⟩ nth_rw 1 [←eval_coords x,←eval_coords y] have he1 : (coords x).1=(coords y).1+3*a := by omega have he2 : (coords x).2=(coords y).2+3*b := by omega simp only [eval,he1,he2] push_cast ring lemma residue_mul_intCast (a : ℤ) (x : ActualEisensteinCubic.O) : residue ((a:ActualEisensteinCubic.O)*x)=scalar (a:ZMod 3) (residue x) := by rw [residue_mul,residue_intCast] simp [mul,scalar] def primitive (a c : Pair) : Prop := ¬(a.1+a.2=0 ∧ c.1+c.2=0) lemma primitive_of_determinant : ∀a b c d : Pair,sub (mul a d) (mul b c)=(1,0) → primitive a c := by unfold primitive decide +kernel lemma first_column_primitive (M : SL(2,ActualEisensteinCubic.O)) : primitive (residue (M 0 0)) (residue (M 1 0)) := by have hd : M 0 0*M 1 1-M 0 1*M 1 0=1 := by simpa only [Matrix.det_fin_two] using M.property have hh := congrArg residue hd rw [residue_sub,residue_mul,residue_mul,residue_one] at hh exact primitive_of_determinant _ _ _ _ hh def omegaPower (k : Fin 3) : Pair := if k=0 then (1,0) else if k=1 then (0,1) else ((ZMod.commRing 3).neg 1,(ZMod.commRing 3).neg 1) def unitPair (u : Fin 2 × Fin 3) : Pair := scalar (((ZMod.commRing 3).neg 1)^u.1.val) (omegaPower u.2) def cuspPair (j : Fin 3) : Pair := if j=0 then (0,0) else if j=1 then (0,1) else ((ZMod.commRing 3).neg 1,(ZMod.commRing 3).neg 1) def columnTop (g : SL(2,ZMod 3)) (j : Fin 3) (u : Fin 2 × Fin 3) : Pair := mul (add (g 0 0,0) (scalar (g 0 1) (cuspPair j))) (unitPair u) def columnBottom (g : SL(2,ZMod 3)) (j : Fin 3) (u : Fin 2 × Fin 3) : Pair := mul (add (g 1 0,0) (scalar (g 1 1) (cuspPair j))) (unitPair u) theorem primitive_column_three_cusps : ∀a c : Pair, primitive a c → ∃g : SL(2,ZMod 3), ∃j : Fin 3, ∃u : Fin 2 × Fin 3, columnTop g j u=a ∧ columnBottom g j u=c := by unfold primitive decide +kernel end open scoped Classical MatrixGroups Matrix open CubicKubota CubicEisenstein def unitRepresentative (u : Fin 2 × Fin 3) : ActualEisensteinCubic.Oˣ := (-1:ActualEisensteinCubic.Oˣ)^u.1.val*CubicRamified.omega_isUnit.unit^u.2.val lemma unitRepresentative_value (u : Fin 2 × Fin 3) : (unitRepresentative u:ActualEisensteinCubic.O)=(-1:ActualEisensteinCubic.O)^u.1.val*(_root_.OAI.ActualEisensteinCubic.omega)^u.2.val := by simp [unitRepresentative] lemma residue_omega : residue (_root_.OAI.ActualEisensteinCubic.omega)=(0,1) := by have he : ActualEisensteinCoordinates.eval 0 1=(_root_.OAI.ActualEisensteinCubic.omega) := by simp only [ActualEisensteinCoordinates.eval,Int.cast_zero,Int.cast_one,zero_add,one_mul] rfl rw [←he] exact residue_eval 0 1 lemma residue_omega_sq : residue ((_root_.OAI.ActualEisensteinCubic.omega)^2)=((ZMod.commRing 3).neg 1,(ZMod.commRing 3).neg 1) := by rw [pow_two,residue_mul,residue_omega] norm_num [mul] lemma unitRepresentative_residue (u : Fin 2 × Fin 3) : residue (unitRepresentative u:ActualEisensteinCubic.O)=unitPair u := by rw [unitRepresentative_value] rcases u with ⟨i,j⟩ fin_cases i <;> fin_cases j <;> norm_num [unitPair,omegaPower,scalar,residue_one,residue_neg,residue_omega,residue_omega_sq,neg] def cuspParameter (j : Fin 3) : ActualEisensteinCubic.O := if j=0 then 0 else if j=1 then (_root_.OAI.ActualEisensteinCubic.omega) else (_root_.OAI.ActualEisensteinCubic.omega)^2 def cuspRepresentative (j : Fin 3) : SL(2,ActualEisensteinCubic.O) := lowerCuspMatrix (cuspParameter j) lemma cuspParameter_residue (j : Fin 3) : residue (cuspParameter j)=cuspPair j := by fin_cases j <;> simp [cuspParameter,cuspPair,residue_zero,residue_omega,residue_omega_sq] def unitDiagonal (u : ActualEisensteinCubic.Oˣ) : SL(2,ActualEisensteinCubic.O) := ⟨!![(u:ActualEisensteinCubic.O),0;0,(↑u⁻¹:ActualEisensteinCubic.O)],by simp [Matrix.det_fin_two]⟩ def columnRepresentative (r : SL(2,ℤ)) (j : Fin 3) (u : Fin 2 × Fin 3) : SL(2,ActualEisensteinCubic.O) := rationalEmbedding r*cuspRepresentative j*unitDiagonal (unitRepresentative u) lemma columnRepresentative_entry (r : SL(2,ℤ)) (j : Fin 3) (u : Fin 2 × Fin 3) (i : Fin 2) : columnRepresentative r j u i 0= ((r i 0:ActualEisensteinCubic.O)+(r i 1:ActualEisensteinCubic.O)*cuspParameter j)*(unitRepresentative u:ActualEisensteinCubic.O) := by change (((r : Matrix (Fin 2) (Fin 2) ℤ).map (Int.castRingHom (_root_.OAI.ActualEisensteinCubic.O)) * !![1, 0; cuspParameter j, 1]) * !![(unitRepresentative u : (_root_.OAI.ActualEisensteinCubic.O)), 0; 0, (↑(unitRepresentative u)⁻¹ : (_root_.OAI.ActualEisensteinCubic.O))]) i 0 = _ simp [Matrix.mul_apply, Fin.sum_univ_two] lemma columnRepresentative_top_residue (r : SL(2,ℤ)) (j : Fin 3) (u : Fin 2 × Fin 3) : residue (columnRepresentative r j u 0 0)=columnTop (rationalReductionThree r) j u := by rw [columnRepresentative_entry,residue_mul,residue_add,residue_intCast, residue_mul_intCast,cuspParameter_residue,unitRepresentative_residue] rfl lemma columnRepresentative_bottom_residue (r : SL(2,ℤ)) (j : Fin 3) (u : Fin 2 × Fin 3) : residue (columnRepresentative r j u 1 0)=columnBottom (rationalReductionThree r) j u := by rw [columnRepresentative_entry,residue_mul,residue_add,residue_intCast, residue_mul_intCast,cuspParameter_residue,unitRepresentative_residue] rfl lemma same_column_quotient_lower_zero (M N : SL(2,ActualEisensteinCubic.O)) (h0 : N 0 0=M 0 0) (h1 : N 1 0=M 1 0) : (N⁻¹*M) 1 0=0 := by simp only [Matrix.SpecialLinearGroup.coe_mul,Matrix.SpecialLinearGroup.coe_inv, Matrix.adjugate_fin_two,Matrix.mul_apply,Fin.sum_univ_two,Matrix.of_apply, Matrix.cons_val_zero,Matrix.cons_val_one,] rw [h0,h1] ring theorem three_cusp_decomposition (M : SL(2,ActualEisensteinCubic.O)) : ∃G : levelTwo, ∃j : Fin 3, ∃T : SL(2,ActualEisensteinCubic.O), T 1 0=0 ∧ IsUnit (T 0 0) ∧ IsUnit (T 1 1) ∧ M=(G:SL(2,ActualEisensteinCubic.O))*cuspRepresentative j*T := by obtain ⟨g,j,u,ht,hb⟩ := primitive_column_three_cusps _ _ (first_column_primitive M) obtain ⟨r,hr⟩ := rationalReductionThree_surjective g let B := columnRepresentative r j u have hB0 : residue (B 0 0)=residue (M 0 0) := by dsimp only [B] rw [columnRepresentative_top_residue,hr] exact ht have hB1 : residue (B 1 0)=residue (M 1 0) := by dsimp only [B] rw [columnRepresentative_bottom_residue,hr] exact hb have hxy : IsCoprime (M 0 0) (M 1 0) := by refine ⟨M 1 1,-M 0 1,?_⟩ have hd := M.property rw [Matrix.det_fin_two] at hd linear_combination hd obtain ⟨N,hN0,hN1,hNB⟩ := exists_congruent_cusp_completion B (M 0 0) (M 1 0) hxy (residue_eq_implies_three_dvd hB0.symm) (residue_eq_implies_three_dvd hB1.symm) let G : levelTwo := ⟨(N*B⁻¹)*rationalEmbedding r,⟨⟨N*B⁻¹,hNB⟩,r,rfl⟩⟩ let T : SL(2,ActualEisensteinCubic.O) := unitDiagonal (unitRepresentative u)*(N⁻¹*M) have hT : T 1 0=0 := by have hz := same_column_quotient_lower_zero M N hN0 hN1 change (∑k : Fin 2,(unitDiagonal (unitRepresentative u)) 1 k*(N⁻¹*M) k 0)=0 rw [Fin.sum_univ_two] change 0*(N⁻¹*M) 0 0+(↑(unitRepresentative u)⁻¹:ActualEisensteinCubic.O)*(N⁻¹*M) 1 0=0 rw [hz] ring have hdet : T 0 0*T 1 1=1 := by have hd := T.property simpa only [Matrix.det_fin_two,hT,mul_zero,sub_zero] using hd refine ⟨G,j,T,hT,?_,?_,?_⟩ · exact IsUnit.of_mul_eq_one _ hdet · exact IsUnit.of_mul_eq_one _ (show T 1 1*T 0 0=1 by simpa only [mul_comm] using hdet) · dsimp [G,T,B,columnRepresentative] group end EisensteinCuspModThree namespace CubicEisenstein open MeasureTheory Filter open scoped BigOperators Classical MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified abbrev PrimaryCoprimeDenominator (a : PrimaryLower) := {d:PrimaryLower//IsCoprime a.val d.val} def primaryDenominatorFromCoprime (a : PrimaryLower) (x : CoprimeElement a.val) : PrimaryCoprimeDenominator a := by refine ⟨⟨a.val+3*x.val,?_⟩,?_⟩ · convert dvd_add a.2 (dvd_mul_right (3:(_root_.OAI.ActualEisensteinCubic.O)) x.val) using 1 ;ring · apply (isCoprime_right_congr_of_dvd a.val (a.val+3*x.val) (3*x.val) ⟨1,by ring⟩).mpr exact (primary_coprime_three a.val (primaryLower_primary a)).mul_right x.2 lemma primaryDenominatorFromCoprime_bijective (a : PrimaryLower) : Function.Bijective (primaryDenominatorFromCoprime a) := by constructor · intro x y h apply Subtype.ext have he := congrArg (fun d : PrimaryCoprimeDenominator a => d.val.val) h change a.val+3*x.val=a.val+3*y.val at he exact mul_left_cancel₀ (by norm_num : (3:(_root_.OAI.ActualEisensteinCubic.O))≠0) (add_left_cancel he) · intro d have hdiv : (3:(_root_.OAI.ActualEisensteinCubic.O))∣d.val.val-a.val := by simpa only [sub_sub_sub_cancel_right] using dvd_sub d.val.2 a.2 obtain ⟨x,hx⟩ := hdiv have hd : d.val.val=a.val+3*x := by linear_combination hx have hcop : IsCoprime a.val x := by have hc : IsCoprime a.val (3*x) := (isCoprime_right_congr_of_dvd a.val d.val.val (3*x) ⟨1,by rw [hd];ring⟩).mp d.2 exact hc.of_isCoprime_of_dvd_right (dvd_mul_left x 3) refine ⟨⟨x,hcop⟩,Subtype.ext (Subtype.ext ?_)⟩ exact hd.symm def primaryDenominatorEquiv (a : PrimaryLower) : CoprimeElement a.val≃PrimaryCoprimeDenominator a := Equiv.ofBijective _ (primaryDenominatorFromCoprime_bijective a) end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified end open Filter MeasureTheory open scoped BigOperators Classical MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified end CubicEisenstein open scoped Classical MatrixGroups namespace CubicKubota open ActualEisensteinCubic ConcreteTraceCRT CubicEisenstein CubicJacobiGlobal CubicRamified lemma levelTwo_entry_integer (g : levelTwo) (i j : Fin 2) : (3:(_root_.OAI.ActualEisensteinCubic.O))∣((g:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) i j-((levelTwoRight g) i j:ℤ)) := by have he : Matrix.SpecialLinearGroup.map (n:=Fin 2) (Ideal.Quotient.mk (Ideal.span {(3:(_root_.OAI.ActualEisensteinCubic.O))})) (g:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) = Matrix.SpecialLinearGroup.map (n:=Fin 2) (Ideal.Quotient.mk (Ideal.span {(3:(_root_.OAI.ActualEisensteinCubic.O))})) (rationalEmbedding (levelTwoRight g)) := by rw [←levelTwo_product g,map_mul] have hn : Matrix.SpecialLinearGroup.map (n:=Fin 2) (Ideal.Quotient.mk (Ideal.span {(3:(_root_.OAI.ActualEisensteinCubic.O))})) (levelTwoLeft g:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))=1 := (levelTwoLeft g).property rw [hn,one_mul] have h := congrArg (fun A : SL(2,(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {(3:(_root_.OAI.ActualEisensteinCubic.O))})=>A i j) he exact Ideal.mem_span_singleton.mp ((Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp h) def integerUpper (b : ℤ) : SL(2,ℤ) := ⟨!![1,b;0,1],by simp [Matrix.det_fin_two_of]⟩ def integerLower (c : ℤ) : SL(2,ℤ) := ⟨!![1,0;c,1],by simp [Matrix.det_fin_two_of]⟩ lemma levelTwoComplexCharacter_primary (g : levelTwo) (ha : lambda^2∣((g:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0)-1) : levelTwoComplexCharacter g = eisEmbedding (symbol ((g:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) ((g:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0)) := by let A : SL(2,(_root_.OAI.ActualEisensteinCubic.O)) := g let b : ℤ := levelTwoRight g 0 1 let c : ℤ := levelTwoRight g 1 0 have hA : (3:(_root_.OAI.ActualEisensteinCubic.O))∣A 0 0-1 := three_dvd_primary_sub_one _ ha have hB : (3:(_root_.OAI.ActualEisensteinCubic.O))∣A 0 1-(b:(_root_.OAI.ActualEisensteinCubic.O)) := levelTwo_entry_integer g 0 1 have hC : (3:(_root_.OAI.ActualEisensteinCubic.O))∣A 1 0-(c:(_root_.OAI.ActualEisensteinCubic.O)) := levelTwo_entry_integer g 1 0 have hdet : A 0 0*A 1 1-A 0 1*A 1 0=1 := by simpa only [Matrix.det_fin_two] using A.property have hD : (3:(_root_.OAI.ActualEisensteinCubic.O))∣A 1 1-(1+(b:(_root_.OAI.ActualEisensteinCubic.O))*(c:(_root_.OAI.ActualEisensteinCubic.O))) := by have hh := dvd_add (dvd_add (dvd_neg.mpr (dvd_mul_of_dvd_left hA (A 1 1))) (dvd_mul_of_dvd_left hB (A 1 0))) (dvd_mul_of_dvd_right hC (b:(_root_.OAI.ActualEisensteinCubic.O))) convert hh using 1 ; linear_combination hdet let N : SL(2,(_root_.OAI.ActualEisensteinCubic.O)) := ⟨!![A 0 0,A 0 1-(b:(_root_.OAI.ActualEisensteinCubic.O))*A 0 0; A 1 0-(c:(_root_.OAI.ActualEisensteinCubic.O))*A 0 0,A 1 1-(c:(_root_.OAI.ActualEisensteinCubic.O))*A 0 1-(b:(_root_.OAI.ActualEisensteinCubic.O))*(A 1 0-(c:(_root_.OAI.ActualEisensteinCubic.O))*A 0 0)],by rw [Matrix.det_fin_two_of] linear_combination hdet⟩ have hN : N∈levelThree := by apply (mem_levelThree_iff_entries N).mpr intro i j fin_cases i <;> fin_cases j · exact hA · have hh:=dvd_sub hB (dvd_mul_of_dvd_right hA (b:(_root_.OAI.ActualEisensteinCubic.O))) convert hh using 1 ; dsimp [N] ; ring · have hh:=dvd_sub hC (dvd_mul_of_dvd_right hA (c:(_root_.OAI.ActualEisensteinCubic.O))) convert hh using 1 ; dsimp [N] ; ring · have hh:=dvd_add (dvd_sub (dvd_sub hD (dvd_mul_of_dvd_right hB (c:(_root_.OAI.ActualEisensteinCubic.O)))) (dvd_mul_of_dvd_right hC (b:(_root_.OAI.ActualEisensteinCubic.O)))) (dvd_mul_of_dvd_right hA ((b:(_root_.OAI.ActualEisensteinCubic.O))*(c:(_root_.OAI.ActualEisensteinCubic.O)))) convert hh using 1 ; dsimp [N] ; ring let lengthScale : levelTwo := ⟨rationalEmbedding (integerLower c),rational_mem_levelTwo _⟩ let U : levelTwo := ⟨rationalEmbedding (integerUpper b),rational_mem_levelTwo _⟩ let n : levelThree := ⟨N,hN⟩ let n2 : levelTwo := ⟨N,levelThree_le_levelTwo hN⟩ have he : g=lengthScale*n2*U := by apply Subtype.ext apply Matrix.SpecialLinearGroup.ext intro i j change A i j = (((!![(1 : ℤ), 0; c, 1]).map (Int.castRingHom (_root_.OAI.ActualEisensteinCubic.O)) * (N : Matrix (Fin 2) (Fin 2) (_root_.OAI.ActualEisensteinCubic.O))) * (!![(1 : ℤ), b; 0, 1]).map (Int.castRingHom (_root_.OAI.ActualEisensteinCubic.O))) i j fin_cases i <;> fin_cases j <;> norm_num [N, Matrix.mul_apply, Fin.sum_univ_two] <;> ring conv_lhs => rw [he,map_mul,map_mul] have hL : levelTwoComplexCharacter lengthScale=1 := levelTwoComplexCharacter_rational _ have hU : levelTwoComplexCharacter U=1 := levelTwoComplexCharacter_rational _ rw [hL,hU,one_mul,mul_one] change levelTwoComplexCharacter ⟨(n:SL(2,(_root_.OAI.ActualEisensteinCubic.O))),levelThree_le_levelTwo n.property⟩=_ rw [levelTwoComplexCharacter_restrict] change eisEmbedding (symbol (A 1 0-(c:(_root_.OAI.ActualEisensteinCubic.O))*A 0 0) (A 0 0))=_ congr 1 exact symbol_congr (x:=A 1 0-(c:(_root_.OAI.ActualEisensteinCubic.O))*A 0 0) (y:=A 1 0) (d:=A 0 0) ⟨-(c:(_root_.OAI.ActualEisensteinCubic.O)),by ring⟩ end CubicKubota end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Reciprocity.PrimaryCongruences /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped Classical MatrixGroups namespace CubicJacobiGlobal open ActualEisensteinCubic CubicRamified namespace RootNotationPrimaryCongruences01 abbrev Eis := ActualEisensteinCubic.O end RootNotationPrimaryCongruences01 open RootNotationPrimaryCongruences01 (Eis) lemma integer_congruence_primary_cases (c : Eis) (r : ℤ) (h : (3:Eis)∣c-(r:Eis)) : (3:Eis)∣c ∨ lambda^2∣c-1 ∨ lambda^2∣(-c)-1 := by have hr : (3:ℤ)∣r ∨ (3:ℤ)∣r-1 ∨ (3:ℤ)∣r+1 := by omega rcases hr with hr|hr|hr · left obtain ⟨t,ht⟩:=hr have hn:(3:Eis)∣(r:Eis):=⟨(t:Eis),by exact_mod_cast ht⟩ simpa using dvd_add h hn · right;left obtain ⟨t,ht⟩:=hr have hn:(3:Eis)∣(r:Eis)-1:=⟨(t:Eis),by exact_mod_cast ht⟩ exact lambda_sq_dvd_three.trans (by simpa using dvd_add h hn) · right;right obtain ⟨t,ht⟩:=hr have hn:(3:Eis)∣(r:Eis)+1:=⟨(t:Eis),by exact_mod_cast ht⟩ apply lambda_sq_dvd_three.trans convert dvd_neg.mpr (dvd_add h hn) using 1 ; ring lemma symbol_three_shift_primary (c a t:Eis) (hc:lambda^2∣c-1) (ha:lambda^2∣a-1) : symbol c (a+3*t*c)=symbol c a := by have hs:=primary_add_multiple_three a c t ha calc _=symbol (a+3*t*c) c:=symbol_reciprocity _ _ (primary_ne_zero _ hc) (primary_ne_zero _ hs) hc hs _=symbol a c:=symbol_congr ⟨3*t,by ring⟩ _=symbol c a:=(symbol_reciprocity _ _ (primary_ne_zero _ hc) (primary_ne_zero _ ha) hc ha).symm lemma symbol_three_shift_integer (c a t:Eis) (r:ℤ) (ha:lambda^2∣a-1) (hc:(3:Eis)∣c-(r:Eis)) : symbol c (a+3*t*c)=symbol c a := by rcases integer_congruence_primary_cases c r hc with h|h|h · exact symbol_three_shift c a t ha h · exact symbol_three_shift_primary c a t h ha · have hh:=symbol_three_shift_primary (-c) a (-t) h ha have he:a+3*(-t)*(-c)=a+3*t*c:=by ring rw [he,symbol_neg_numerator _ _ (primary_add_multiple_three a c t ha), symbol_neg_numerator _ _ ha] at hh exact hh end CubicJacobiGlobal namespace CubicKubota open ActualEisensteinCubic ConcreteTraceCRT CubicEisenstein CubicJacobiGlobal CubicRamified namespace RootNotationPrimaryCongruences02 abbrev Eis := ActualEisensteinCubic.O end RootNotationPrimaryCongruences02 open RootNotationPrimaryCongruences02 (Eis) lemma levelTwo_cube_phase_balance (A N:levelTwo) (p q:Eis) (j:ℕ) (hp:lambda^2∣p-1) (hA:lambda^2∣((A:SL(2,Eis)) 0 0)-1) (hN:lambda^2∣((N:SL(2,Eis)) 0 0)-1) (hx:(A:SL(2,Eis)) 0 0+3*q*(A:SL(2,Eis)) 1 0=p^j*(N:SL(2,Eis)) 0 0) (hc:(N:SL(2,Eis)) 1 0=p^(3-j)*(A:SL(2,Eis)) 1 0) : levelTwoComplexCharacter N * eisEmbedding (symbol ((A:SL(2,Eis)) 1 0) p)^j = levelTwoComplexCharacter A * eisEmbedding (symbol ((N:SL(2,Eis)) 0 0) p)^(3-j) := by have hs : symbol ((A:SL(2,Eis)) 1 0) ((A:SL(2,Eis)) 0 0) = symbol ((A:SL(2,Eis)) 1 0) p ^ j * symbol ((A:SL(2,Eis)) 1 0) ((N:SL(2,Eis)) 0 0) := by rw [←symbol_three_shift_integer _ _ q (levelTwoRight A 1 0) hA (levelTwo_entry_integer A 1 0), hx,symbol_mul_denominator,cubicSymbol_pow_denominator] rw [levelTwoComplexCharacter_primary N hN,levelTwoComplexCharacter_primary A hA,hc, symbol_mul_numerator _ _ _ hN,symbol_pow_numerator _ _ hN, symbol_reciprocity p ((N:SL(2,Eis)) 0 0) (primary_ne_zero _ hp) (primary_ne_zero _ hN) hp hN, hs,map_mul,map_pow,map_mul,map_pow] ring lemma levelTwo_comparison_character (A N:levelTwo) (hNA:(N:SL(2,Eis))*(A:SL(2,Eis))⁻¹∈levelThree) : complexCharacter ⟨(N:SL(2,Eis))*(A:SL(2,Eis))⁻¹,hNA⟩ * levelTwoComplexCharacter A = levelTwoComplexCharacter N := by rw [←levelTwoComplexCharacter_restrict ⟨(N:SL(2,Eis))*(A:SL(2,Eis))⁻¹,hNA⟩] change levelTwoComplexCharacter (N*A⁻¹)*levelTwoComplexCharacter A=levelTwoComplexCharacter N rw [map_mul,map_inv,mul_assoc] have hA:levelTwoComplexCharacter A≠0:=by intro he have hh:=levelTwoComplexCharacter_cube A rw [he] at hh norm_num at hh rw [inv_mul_cancel₀ hA,mul_one] lemma levelTwo_cube_comparison_phase (A N:levelTwo) (p q:Eis) (j:ℕ) (hj:j≤3) (hp:lambda^2∣p-1) (hA:lambda^2∣((A:SL(2,Eis)) 0 0)-1) (hN:lambda^2∣((N:SL(2,Eis)) 0 0)-1) (hx:(A:SL(2,Eis)) 0 0+3*q*(A:SL(2,Eis)) 1 0=p^j*(N:SL(2,Eis)) 0 0) (hc:(N:SL(2,Eis)) 1 0=p^(3-j)*(A:SL(2,Eis)) 1 0) (hC:IsCoprime ((A:SL(2,Eis)) 1 0) p) (hNA:(N:SL(2,Eis))*(A:SL(2,Eis))⁻¹∈levelThree) : complexCharacter ⟨(N:SL(2,Eis))*(A:SL(2,Eis))⁻¹,hNA⟩ = eisEmbedding (symbol (((N:SL(2,Eis)) 0 0)*((A:SL(2,Eis)) 1 0)) p)^(3-j) := by let a:=eisEmbedding (symbol ((A:SL(2,Eis)) 1 0) p) let b:=eisEmbedding (symbol ((N:SL(2,Eis)) 0 0) p) have ha3:a^3=1:=by dsimp [a] rw [←map_pow,symbol_cube_of_isCoprime _ _ hp hC,map_one] have hpow:a^j*a^(3-j)=1:=by rw [←pow_add,Nat.add_sub_of_le hj,ha3] have hbal:=levelTwo_cube_phase_balance A N p q j hp hA hN hx hc change levelTwoComplexCharacter N*a^j=levelTwoComplexCharacter A*b^(3-j) at hbal have he:levelTwoComplexCharacter N=levelTwoComplexCharacter A*(b*a)^(3-j):=by calc _=levelTwoComplexCharacter N*(a^j*a^(3-j)):=by rw [hpow,mul_one] _=(levelTwoComplexCharacter N*a^j)*a^(3-j):=(mul_assoc _ _ _).symm _=(levelTwoComplexCharacter A*b^(3-j))*a^(3-j):=by rw [hbal] _=_:=by rw [mul_pow];ring have hcomp:=levelTwo_comparison_character A N hNA have hbase:levelTwoComplexCharacter A≠0:=by intro he have hh:=levelTwoComplexCharacter_cube A rw [he] at hh norm_num at hh rw [symbol_mul_numerator _ _ _ hp,map_mul] change complexCharacter ⟨(N:SL(2,Eis))*(A:SL(2,Eis))⁻¹,hNA⟩=(b*a)^(3-j) apply mul_right_cancel₀ hbase rw [hcomp,he] ring end CubicKubota end open scoped BigOperators Classical namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationPrimaryCongruences03 abbrev Eis := ActualEisensteinCubic.O end RootNotationPrimaryCongruences03 open RootNotationPrimaryCongruences03 (Eis) lemma ramified_cubicExp_nat_mul (n : ℕ) (t : ℤ) : cubicExp ((n:ℤ)*t)=cubicExp t^n := by induction n with | zero => simp [cubicExp_zero] | succ n ih => rw [Nat.cast_add,Nat.cast_one,add_mul,one_mul,cubicExp_add,ih,pow_succ] lemma ramified_trace_symbol (a : Eis) (ha : lambda^2∣a-1) : symbol ramifiedTraceLambda a=linearRay 0 (-1) a := by have h := symbol_traceLambda_eq_linearRay a ha change symbol ramifiedTraceLambda a=linearRay 0 (-1) a at h exact h lemma ramifiedSymbol_primaryCoord (j n : ℕ) (A B : ℤ) : symbol (omega^j*ramifiedTraceLambda^n) (primaryCoord A B)= cubicExp ((j:ℤ)*(2*A-B)-(n:ℤ)*B) := by rw [symbol_mul_numerator _ _ _ (primaryCoord_primary _ _), symbol_pow_numerator _ _ (primaryCoord_primary _ _) j, symbol_pow_numerator _ _ (primaryCoord_primary _ _) n, symbol_omega_eq_linearRay _ (primaryCoord_primary _ _), ramified_trace_symbol _ (primaryCoord_primary _ _),linearRay_primaryCoord,linearRay_primaryCoord, ←ramified_cubicExp_nat_mul,←ramified_cubicExp_nat_mul,←cubicExp_add] congr 1 ring def ramifiedAffineParameter (j n : ℕ) : Eis := (j:Eis)*ramifiedTraceLambda-(n:Eis) lemma ramifiedAffineParameter_coords (j n : ℕ) (C D : ℤ) : (ActualEisensteinCoordinates.coords (ramifiedAffineParameter j n*ActualEisensteinCoordinates.eval C D)).2= (j:ℤ)*(2*C-D)-(n:ℤ)*D := by have hk : ramifiedAffineParameter j n=ActualEisensteinCoordinates.eval ((j:ℤ)-(n:ℤ)) (2*(j:ℤ)) := by change (j:Eis)*(1+2*omega)-(n:Eis)=(((j:ℤ)-(n:ℤ):ℤ):Eis)+((2*(j:ℤ):ℤ):Eis)*omega push_cast ring rw [hk,ActualEisensteinCoordinates.eval_mul,ShortDraftLatticeCount.coords_eval] ring theorem ramified_symbol_primary_shift (j n : ℕ) (a x : Eis) (ha : lambda^2∣a-1) : eisEmbedding (symbol (omega^j*ramifiedTraceLambda^n) (a+3*x))= eisEmbedding (symbol (omega^j*ramifiedTraceLambda^n) a)* ShortDraftTrace.breveE (eisEmbedding (ramifiedAffineParameter j n*x)/eisLam/3) := by obtain ⟨A,B,rfl⟩ := exists_primaryCoord a ha let C := (ActualEisensteinCoordinates.coords x).1 let D := (ActualEisensteinCoordinates.coords x).2 have hx : x=ActualEisensteinCoordinates.eval C D := (ActualEisensteinCoordinates.eval_coords x).symm have hsum : primaryCoord A B+3*x=primaryCoord (A+C) (B+D) := by rw [hx,primaryCoord_eq,primaryCoord_eq] change 1+3*(A:Eis)+3*(B:Eis)*omega+3*((C:Eis)+(D:Eis)*omega)=_ push_cast ring rw [hsum,ramifiedSymbol_primaryCoord,ramifiedSymbol_primaryCoord] have ht := breveE_real_trace_of_O (3:ℝ) (ramifiedAffineParameter j n*x) norm_num only [Complex.ofReal_ofNat] at ht rw [ht,hx,ramifiedAffineParameter_coords,←embedding_cubicExp,←map_mul,←cubicExp_add] apply congrArg eisEmbedding apply congrArg cubicExp ring lemma ramified_symbol_primary_shift_signed (j n : ℕ) (r a x : Eis) (hr : r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (ha : lambda^2∣a-1) : eisEmbedding (symbol r (a+3*x))=eisEmbedding (symbol r a)* ShortDraftTrace.breveE (eisEmbedding (ramifiedAffineParameter j n*x)/eisLam/3) := by rcases hr with rfl|rfl · exact ramified_symbol_primary_shift j n a x ha · rw [symbol_neg_numerator _ _ (primary_add_three a x ha),symbol_neg_numerator _ _ ha] exact ramified_symbol_primary_shift j n a x ha end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationPrimaryCongruences04 abbrev Eis := ActualEisensteinCubic.O end RootNotationPrimaryCongruences04 open RootNotationPrimaryCongruences04 (Eis) lemma ramifiedTraceLambda_square : ramifiedTraceLambda^2=(-3:Eis) := by unfold ramifiedTraceLambda linear_combination 4*ramified_omega_relation lemma ramified_character_coprime (j n : ℕ) (r a : Eis) (hr : r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (ha : lambda^2∣a-1) : IsCoprime r a := by have hc3 := (primary_coprime_three a ha).symm have ht : ramifiedTraceLambda∣(3:Eis) := by refine ⟨-ramifiedTraceLambda,?_⟩ linear_combination ramifiedTraceLambda_square have hcT := hc3.of_isCoprime_of_dvd_left ht have hcW : IsCoprime omega a := by refine ⟨omega^2,0,?_⟩ rw [zero_mul,add_zero,←pow_succ,omega_primitive.pow_eq_one] have hc : IsCoprime (omega^j*ramifiedTraceLambda^n) a := hcW.pow_left.mul_left hcT.pow_left rcases hr with rfl|rfl · exact hc · exact hc.neg_left lemma affineCusp_phase_identity (h h1 q a k c x : Eis) (ha : a≠0) (hq : q≠0) (hh : h=q*h1) (hk : 3*k=h1+c*a) : ShortDraftTrace.breveE (eisEmbedding (c*x)/eisLam/3)* ShortDraftTrace.breveE (ninthCuspFrequency h*eisEmbedding (a+3*x)/eisEmbedding (q*a))= ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding q)*residueAdditive (3*k) a x := by have hk' : eisEmbedding k=(eisEmbedding h1+eisEmbedding c*eisEmbedding a)/3 := by apply (eq_div_iff (by norm_num : (3:ℂ)≠0)).mpr have he := congrArg eisEmbedding hk simp only [map_mul,map_add,map_ofNat] at he linear_combination he rw [←AddChar.map_add_eq_mul] unfold residueAdditive rw [←AddChar.map_add_eq_mul] apply congrArg ShortDraftTrace.breveE rw [hh] simp only [ninthCuspFrequency,cuspFrequency,map_add,map_mul,map_ofNat] rw [hk'] field_simp [eisEmbedding_ne_zero ha,eisEmbedding_ne_zero hq,eisLam_ne_zero] ;ring def ramifiedAffineGauss (h q r a : Eis) : ℂ := ∑'x:CubicUnitResidue a, (eisEmbedding (symbol r (a+3*GaussianShiftedPartition.representative a x.val))* eisEmbedding (symbol (a+3*GaussianShiftedPartition.representative a x.val) a))* ShortDraftTrace.breveE (ninthCuspFrequency h* eisEmbedding (a+3*GaussianShiftedPartition.representative a x.val)/eisEmbedding (q*a)) lemma ramifiedAffineGauss_factor (h h1 q r a k : Eis) (j n : ℕ) (ha : a≠0) (hprimary : lambda^2∣a-1) (hq : q≠0) (hr : r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (hh : h=q*h1) (hk : 3*k=h1+ramifiedAffineParameter j n*a) : ramifiedAffineGauss h q r a= ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding q)* (eisEmbedding (symbol r a)*eisEmbedding (symbol 3 a))*cubicUnitGaussSum k a := by rw [ramifiedAffineGauss,cubicUnitGaussSum,←tsum_mul_left] apply tsum_congr intro x let t := GaussianShiftedPartition.representative a x.val have hs : symbol (a+3*t) a=symbol (3*t) a := symbol_congr ⟨1,by ring⟩ change (eisEmbedding (symbol r (a+3*t))*eisEmbedding (symbol (a+3*t) a))* ShortDraftTrace.breveE (ninthCuspFrequency h*eisEmbedding (a+3*t)/eisEmbedding (q*a))=_ rw [ramified_symbol_primary_shift_signed j n r a t hr hprimary,hs, symbol_mul_numerator _ _ _ hprimary] rw [map_mul eisEmbedding (symbol 3 a) (symbol t a)] have hp := affineCusp_phase_identity h h1 q a k (ramifiedAffineParameter j n) t ha hq hh hk calc _ = (eisEmbedding (symbol r a)*eisEmbedding (symbol 3 a)*eisEmbedding (symbol t a))* (ShortDraftTrace.breveE (eisEmbedding (ramifiedAffineParameter j n*t)/eisLam/3)* ShortDraftTrace.breveE (ninthCuspFrequency h*eisEmbedding (a+3*t)/eisEmbedding (q*a))) := by ring _ = _ := by rw [hp];ring theorem ramifiedAffineGauss_eq_unramified (h h1 q r a k : Eis) (j n : ℕ) (ha : a≠0) (hprimary : lambda^2∣a-1) (hq : q≠0) (hr : r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (hh : h=q*h1) (hk : 3*k=h1+ramifiedAffineParameter j n*a) : ramifiedAffineGauss h q r a= ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding q)* cubicUnitGaussSum (3*r^2*h1) a := by rw [ramifiedAffineGauss_factor h h1 q r a k j n ha hprimary hq hr hh hk] have hcop := ramified_character_coprime j n r a hr hprimary have hcop3 : IsCoprime (3*r^2) a := (primary_coprime_three a hprimary).symm.mul_left hcop.pow_left have hp := cubicUnitGaussSum_phase_shift k (r^2) a ha hprimary hcop3 have hc := symbol_cube_of_isCoprime r a hprimary hcop have hchars : eisEmbedding (symbol (r^2) a)*eisEmbedding (symbol (3*r^2) a)= eisEmbedding (symbol r a)*eisEmbedding (symbol 3 a) := by rw [←map_mul,←symbol_mul_numerator _ _ a hprimary, show r^2*(3*r^2)=3*r^4 by ring,symbol_mul_numerator _ _ a hprimary, symbol_pow_numerator _ _ hprimary 4,pow_succ,hc,one_mul,map_mul] ring rw [hchars] at hp have hcong : a∣k*(9*r^2)-3*r^2*h1 := by refine ⟨3*r^2*ramifiedAffineParameter j n,?_⟩ linear_combination 3*r^2*hk have hg := cubicUnitGaussSum_frequency_congr (k*(9*r^2)) (3*r^2*h1) a ha hcong calc _ = ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding q)* (eisEmbedding (symbol r a)*eisEmbedding (symbol 3 a)*cubicUnitGaussSum k a) := by ring _ = _ := by rw [hp,hg] end section open Filter MeasureTheory open scoped BigOperators Classical Topology Pointwise open ConcreteTraceCRT namespace RootNotationPrimaryCongruences05 abbrev O := ActualEisensteinCubic.O end RootNotationPrimaryCongruences05 open RootNotationPrimaryCongruences05 (O) def eisensteinUnitRotation (u : ActualEisensteinCubic.Oˣ) : ℂ≃ₗᵢ[ℝ]ℂ where toFun z := eisEmbedding (u:ActualEisensteinCubic.O)*z invFun z := eisEmbedding (↑u⁻¹:ActualEisensteinCubic.O)*z left_inv z := by dsimp only rw [←mul_assoc,←map_mul] simp right_inv z := by dsimp only rw [←mul_assoc,←map_mul] simp map_add' z w := mul_add _ _ _ map_smul' t z := by simp only [RingHom.id_apply,Complex.real_smul] ring norm_map' z := by change ‖eisEmbedding (u:ActualEisensteinCubic.O)*z‖=‖z‖ rw [norm_mul,GaussGeneratorTransport.norm_eisEmbedding_unit,one_mul] def eisensteinUnitEquiv (u : ActualEisensteinCubic.Oˣ) : ActualEisensteinCubic.O≃ActualEisensteinCubic.O where toFun x := (u:ActualEisensteinCubic.O)*x invFun x := (↑u⁻¹:ActualEisensteinCubic.O)*x left_inv x := by dsimp only; rw [←mul_assoc];simp right_inv x := by dsimp only; rw [←mul_assoc];simp def periodUnitEquiv (u : ActualEisensteinCubic.Oˣ) : periodLattice≃periodLattice := (periodEquiv.symm.trans (eisensteinUnitEquiv u)).trans periodEquiv lemma periodUnitEquiv_val (u : ActualEisensteinCubic.Oˣ) (x : periodLattice) : (periodUnitEquiv u x:ℂ)=eisEmbedding (u:ActualEisensteinCubic.O)*(x:ℂ) := by obtain ⟨n,rfl⟩ := periodEquiv.surjective x dsimp only [periodUnitEquiv,Equiv.trans_apply] rw [Equiv.symm_apply_apply] change (periodEquiv ((u:ActualEisensteinCubic.O)*n):ℂ)=eisEmbedding (u:ActualEisensteinCubic.O)*(periodEquiv n:ℂ) change 3*eisEmbedding ((u:ActualEisensteinCubic.O)*n)=eisEmbedding (u:ActualEisensteinCubic.O)*(3*eisEmbedding n) rw [map_mul] ring lemma periodDomain_unit_rotation (u : ActualEisensteinCubic.Oˣ) : IsAddFundamentalDomain periodLattice (eisensteinUnitRotation u '' periodDomain) volume := by apply periodDomain_fundamental.image_of_equiv (eisensteinUnitRotation u).toEquiv (eisensteinUnitRotation u).symm.measurePreserving.quasiMeasurePreserving (periodUnitEquiv u⁻¹) intro n z change eisEmbedding (u:ActualEisensteinCubic.O)*((periodUnitEquiv u⁻¹ n:ℂ)+z)= (n:ℂ)+eisEmbedding (u:ActualEisensteinCubic.O)*z rw [periodUnitEquiv_val,mul_add,←mul_assoc,←map_mul] simp theorem period_integral_unit_rotation (f : ℂ→ℂ) (hp : ∀n : ActualEisensteinCubic.O,∀z : ℂ,f (z+3*eisEmbedding n)=f z) (u : ActualEisensteinCubic.Oˣ) : (∫z in periodDomain,f (eisEmbedding (u:ActualEisensteinCubic.O)*z))=∫z in periodDomain,f z := by let : Countable periodLattice := instCountableSubtypeComplexMemSubmoduleIntPeriodLattice let : VAddInvariantMeasure periodLattice ℂ volume := instVAddInvariantMeasureSubtypeComplexMemSubmoduleIntPeriodLatticeVolume have hperiod (n : periodLattice) (z : ℂ) : f (n+ᵥz)=f z := by obtain ⟨m,rfl⟩ := periodEquiv.surjective n change f (3*eisEmbedding m+z)=f z simpa only [add_comm] using hp m z have heq := periodDomain_fundamental.setIntegral_eq (periodDomain_unit_rotation u) hperiod have hchange := (eisensteinUnitRotation u).measurePreserving.setIntegral_image_emb (eisensteinUnitRotation u).toHomeomorph.measurableEmbedding f periodDomain exact hchange.symm.trans heq.symm theorem period_integral_unit_affine (f : ℂ→ℂ) (hp : ∀n : ActualEisensteinCubic.O,∀z : ℂ,f (z+3*eisEmbedding n)=f z) (u : ActualEisensteinCubic.Oˣ) (b : ℂ) : (∫z in periodDomain,f (eisEmbedding (u:ActualEisensteinCubic.O)*z+b))=∫z in periodDomain,f z := by have hg : ∀n : ActualEisensteinCubic.O,∀z : ℂ,(fun w=>f (w+b)) (z+3*eisEmbedding n)=(fun w=>f (w+b)) z := by intro n z dsimp rw [show z+3*eisEmbedding n+b=(z+b)+3*eisEmbedding n by ring,hp] rw [period_integral_unit_rotation (fun w=>f (w+b)) hg u] simpa only [add_comm] using period_integral_translation f hp b end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ConcreteTraceCRT namespace RootNotationPrimaryCongruences06 abbrev O := ActualEisensteinCubic.O end RootNotationPrimaryCongruences06 open RootNotationPrimaryCongruences06 (O) lemma integral_upper_triangular_action (T : SL(2,ActualEisensteinCubic.O)) (hc : T 1 0=0) (z : ℂ) (v : ℝ) (hv : 0F (upperPoint (3*z) v hv) have he (z : ℂ) : F (integralComplexMatrix T • upperPoint (3*z) v hv)= f (eisEmbedding (↑(u^2):ActualEisensteinCubic.O)*z+eisEmbedding (T 0 0*T 0 1)/3) := by rw [integral_upper_triangular_action T hc] dsimp only [f] congr 2 simp only [Units.val_pow_eq_pow_val,map_pow] ring simp_rw [he] exact period_integral_unit_affine f hp (u^2) _ end open Filter MeasureTheory open scoped BigOperators Classical Topology ENNReal namespace RootNotationPrimaryCongruences07 abbrev O := ActualEisensteinCubic.O end RootNotationPrimaryCongruences07 open RootNotationPrimaryCongruences07 (O) namespace SubexponentialBesselCoefficients lemma series_scaled_three_average_zero (coeff : SubexponentialBesselCoefficients) (v : ℝ) (hv : 0 coeff.term h (v,3*z) have hc (h : ActualEisensteinCubic.O) : Continuous (f h) := by change Continuous (fun z : ℂ => coeff.term h (v,3*z)) simp_rw [coeff.term_eq_amplitude v hv h] change Continuous (fun z : ℂ => coeff.amplitude v h* Complex.exp (2*Real.pi*Complex.I*((cuspFrequency h*(3*z))+ starRingEnd ℂ (cuspFrequency h*(3*z))))) fun_prop obtain ⟨C,hC,hbound⟩ := coeff.slab_bound v v hv le_rfl have hfbound (h : ActualEisensteinCubic.O) (z : ℂ) : ‖f h z‖≤C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖) := hbound h (v,3*z) ⟨le_rfl,le_rfl⟩ have hi (h : ActualEisensteinCubic.O) : IntegrableOn (f h) periodDomain volume := (integrable_const (C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖))).mono' (hc h).aestronglyMeasurable (Eventually.of_forall (hfbound h)) have hnorm (h : ActualEisensteinCubic.O) : (∫z in periodDomain,‖f h z‖)≤ volume.real periodDomain*(C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖)) := by have hh := integral_mono_ae (hi h).norm (integrable_const (C*Real.exp (-(Real.pi*v)*‖cuspFrequency h‖))) (Eventually.of_forall (hfbound h)) simpa only [setIntegral_const,smul_eq_mul] using hh have hs : Summable (fun h : ActualEisensteinCubic.O => ∫z in periodDomain,‖f h z‖) := by apply Summable.of_nonneg_of_le (fun h => integral_nonneg (fun z => norm_nonneg _)) hnorm exact ((summable_exp_neg_cuspFrequency_norm (Real.pi*v) (mul_pos Real.pi_pos hv)).mul_left C).mul_left (volume.real periodDomain) have hterm (h : ActualEisensteinCubic.O) : (∫z in periodDomain,f h z)=0 := by have he (z : ℂ) : cuspFrequency h*(3*z)= -cuspFrequency (-(3*h))*z := by simp only [cuspFrequency,map_neg,map_mul,map_ofNat] ring change (∫z in periodDomain,coeff.term h (v,3*z))=0 simp_rw [coeff.term_eq_amplitude v hv h,he] rw [integral_const_mul,integral_cusp_character] by_cases hh : h=0 · simp [hh,amplitude] · have hk : -(3*h)≠(0:ActualEisensteinCubic.O) := neg_ne_zero.mpr (mul_ne_zero (by norm_num) hh) simp [hk] change (∫z in periodDomain,∑'h : ActualEisensteinCubic.O,f h z)=0 rw [←integral_tsum_of_summable_integral_norm hi hs] simp_rw [hterm] exact tsum_zero lemma fullFunction_scaled_three_average (coeff : SubexponentialBesselCoefficients) (c : ℂ) (v : ℝ) (hv : 0coeff.series (v,3*z)) := (coeff.series_height_continuous v hv).comp (continuous_const.mul continuous_id) simp only [fullFunction,function,hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint] rw [integral_add (integrable_const _) (periodDomain_integrable_of_continuous _ hc), series_scaled_three_average_zero coeff v hv,add_zero,setIntegral_const] rw [Measure.real,periodDomain_volume,ENNReal.toReal_ofReal (by positivity)] simp only [Complex.real_smul] ring end SubexponentialBesselCoefficients theorem cubicSource_scaled_three_average (v : ℝ) (hv : 0 fin_cases j <;> simp [lowerCuspMatrix] lemma cubicSource_scaled_periodic (v : ℝ) (hv : 0cubicSourceResidualFunction (integralComplexMatrix (cuspRepresentative j) • w)) v hv (sourceCuspRepresentative_periodic j v hv) T hT rw [hi,sourceCuspRepresentative_average] ring def sourceCuspConstant (M : SL(2,ActualEisensteinCubic.O)) : ℂ := ∫z in periodDomain,cubicSourceResidualFunction (integralComplexMatrix M • upperPoint (3*z) 1 (by norm_num)) theorem sourceCusp_average_all (M : SL(2,ActualEisensteinCubic.O)) (v : ℝ) (hv : 0 simp [hj,hG,sourcePrincipalCuspConstant_ne_zero] lemma sourceCuspConstant_left (G : levelTwo) (M : SL(2,ActualEisensteinCubic.O)) : sourceCuspConstant ((G:SL(2,ActualEisensteinCubic.O))*M)=levelTwoComplexCharacter G*sourceCuspConstant M := by unfold sourceCuspConstant simp_rw [map_mul,mul_smul,cubicSourceResidualFunction_automorphy] exact integral_const_mul _ _ lemma sourceCuspConstant_upper_right (M T : SL(2,ActualEisensteinCubic.O)) (hT : T 1 0=0) : sourceCuspConstant (M*T)=sourceCuspConstant M := by obtain ⟨G,j,S,hS,_,_,hM⟩ := three_cusp_decomposition M have hST : (S*T) 1 0=0 := by change (∑k : Fin 2,S 1 k*T k 0)=0 rw [Fin.sum_univ_two,hS,hT] ring have he : M*T=(G:SL(2,ActualEisensteinCubic.O))*cuspRepresentative j*(S*T) := by rw [hM]; group rw [sourceCuspConstant_decomposition (M*T) G j (S*T) hST he, sourceCuspConstant_decomposition M G j S hS hM] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CubeResidueStrata namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology namespace SubexponentialBesselCoefficients theorem series_cusp_decay (coeff : SubexponentialBesselCoefficients) (a : ℝ) (ha : 0 (Real.exp_pos _).le) have hs := summable_exp_neg_cuspFrequency_norm (Real.pi*a/2) (by positivity) refine ⟨D*S*(2/(2*residualCuspDecayRate)),by have := residualCuspDecayRate_pos;positivity,?_⟩ intro v z hav have hv : 0 ?_⟩ simpa only [fullFunction,zero_mul,zero_add,function,hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint] using hbound v z hav end SubexponentialBesselCoefficients end open scoped BigOperators Classical MatrixGroups Matrix section open ActualEisensteinCubic CubicKubota ConcreteTraceCRT CompletedGauss open PrimaryIdealUnitReindex (GoodIdeal GoodElement) lemma halfPrimary_lambda_dvd_three : (_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O) ∣ (3:(_root_.OAI.ActualEisensteinCubic.O)) := by exact (dvd_pow_self (_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O) (by decide : (2:ℕ)≠0)).trans lambda_sq_dvd_three lemma halfPrimary_lambda_not_dvd_one : ¬(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O) ∣ (1:(_root_.OAI.ActualEisensteinCubic.O)) := by intro h exact PrimaryIdealUnitReindex.lambda_prime_actual.not_isUnit (isUnit_of_dvd_one h) lemma halfPrimary_omega_pow (j:ℕ) : (_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O) ∣ omega^j-1 := by simpa only [one_pow] using sub_dvd_pow_sub_pow omega (1:(_root_.OAI.ActualEisensteinCubic.O)) j lemma halfPrimary_not_negative (j:ℕ) : ¬(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O) ∣ -(omega^j)-1 := by intro h have h2 : (_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O) ∣ (2:(_root_.OAI.ActualEisensteinCubic.O)) := by have hh:=dvd_add h (halfPrimary_omega_pow j) convert dvd_neg.mpr hh using 1 ;ring apply halfPrimary_lambda_not_dvd_one convert dvd_sub halfPrimary_lambda_dvd_three h2 using 1 ;ring abbrev HalfPrimary := {b:(_root_.OAI.ActualEisensteinCubic.O) // (_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O) ∣ b-1} lemma halfPrimary_not_dvd (b:HalfPrimary) : ¬(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O)∣b.val := by intro h apply halfPrimary_lambda_not_dvd_one convert dvd_sub h b.2 using 1 ;ring def halfPrimaryFromAssociate (p:Fin 3×PrimaryLower) : HalfPrimary := ⟨omega^p.1.val*p.2.val,by have ha:(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O)∣p.2.val-1:=halfPrimary_lambda_dvd_three.trans p.2.2 convert dvd_add ((halfPrimary_omega_pow p.1.val).mul_right p.2.val) ha using 1 ;ring⟩ lemma halfPrimaryFromAssociate_injective : Function.Injective halfPrimaryFromAssociate := by intro p q hpq have he:omega^p.1.val*p.2.val=omega^q.1.val*q.2.val:=congrArg Subtype.val hpq have hunit (j:Fin 3):IsUnit (omega^j.val):=(omega_primitive.isUnit (by decide)).pow _ have hs:(Ideal.span {p.2.val}:Ideal (_root_.OAI.ActualEisensteinCubic.O))=Ideal.span {q.2.val}:=by simpa only [Ideal.span_singleton_mul_left_unit (hunit p.1), Ideal.span_singleton_mul_left_unit (hunit q.1)] using congrArg (fun z:(_root_.OAI.ActualEisensteinCubic.O)=>(Ideal.span {z}:Ideal (_root_.OAI.ActualEisensteinCubic.O))) he have hab:p.2=q.2:=by apply Subtype.ext have hg:=congrArg primaryGenerator hs simpa only [primaryGenerator_span p.2.val (primaryLower_ne_zero p.2) (primaryLower_primary p.2), primaryGenerator_span q.2.val (primaryLower_ne_zero q.2) (primaryLower_primary q.2)] using hg have hj:p.1=q.1:=by apply Fin.ext apply omega_primitive.pow_inj p.1.isLt q.1.isLt rw [hab] at he exact mul_right_cancel₀ (primaryLower_ne_zero q.2) he exact Prod.ext hj hab lemma halfPrimaryFromAssociate_surjective : Function.Surjective halfPrimaryFromAssociate := by intro b let z:GoodElement:=⟨b.val,PrimaryIdealUnitReindex.primaryGenerator_span_ne_zero_iff b.val |>.mpr (halfPrimary_not_dvd b)⟩ let p:=PrimaryIdealUnitReindex.unitIdealEquiv.symm z have he:(p.1:(_root_.OAI.ActualEisensteinCubic.O))*primaryGenerator p.2.val=b.val:= congrArg Subtype.val (PrimaryIdealUnitReindex.unitIdealEquiv.apply_symm_apply z) let a:PrimaryLower:=primaryLowerIdealEquiv.symm p.2 have ha:a.val=primaryGenerator p.2.val:=rfl have hea:(p.1:(_root_.OAI.ActualEisensteinCubic.O))*a.val=b.val:=by simpa only [ha] using he have hu:(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O)∣(p.1:(_root_.OAI.ActualEisensteinCubic.O))-1:=by have hpa:(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O)∣a.val-1:=halfPrimary_lambda_dvd_three.trans a.2 have hh:=dvd_sub b.2 (hpa.mul_left (p.1:(_root_.OAI.ActualEisensteinCubic.O))) rw [←hea] at hh convert hh using 1 ;ring obtain ⟨j,hj|hj⟩:=unit_eq_sign_omega p.1 · exact ⟨(j,a),Subtype.ext (by simpa only [halfPrimaryFromAssociate,hj] using hea)⟩ · exact (halfPrimary_not_negative j.val (by simpa only [hj] using hu)).elim def halfPrimaryAssociateEquiv : Fin 3×PrimaryLower ≃ HalfPrimary := Equiv.ofBijective halfPrimaryFromAssociate ⟨halfPrimaryFromAssociate_injective,halfPrimaryFromAssociate_surjective⟩ end open ActualEisensteinCubic CubicKubota ConcreteTraceCRT def unitCuspUpper (b : (_root_.OAI.ActualEisensteinCubic.O)) : SL(2,(_root_.OAI.ActualEisensteinCubic.O)) := ⟨!![1,b;0,1],by simp [Matrix.det_fin_two]⟩ def unitCuspDiagonal (u : (_root_.OAI.ActualEisensteinCubic.O)ˣ) : SL(2,(_root_.OAI.ActualEisensteinCubic.O)) := ⟨!![(u:(_root_.OAI.ActualEisensteinCubic.O)),0;0,(↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O))],by simp [Matrix.det_fin_two]⟩ theorem rational_cusp_lower_factor (u : (_root_.OAI.ActualEisensteinCubic.O)ˣ) (n : ℤ) : rationalEmbedding ModularGroup.S*unitCuspUpper (n:(_root_.OAI.ActualEisensteinCubic.O))*lowerCuspMatrix (u:(_root_.OAI.ActualEisensteinCubic.O))= unitCuspDiagonal (-u)*lowerCuspMatrix (-(u:(_root_.OAI.ActualEisensteinCubic.O))*(1+(n:(_root_.OAI.ActualEisensteinCubic.O))*(u:(_root_.OAI.ActualEisensteinCubic.O))))* unitCuspUpper (↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O)) := by apply Subtype.ext change ((!![(0 : ℤ), -1; 1, 0]).map (Int.castRingHom (_root_.OAI.ActualEisensteinCubic.O)) * !![1, (n : (_root_.OAI.ActualEisensteinCubic.O)); 0, 1] * !![1, 0; (u : (_root_.OAI.ActualEisensteinCubic.O)), 1]) = (!![(↑(-u) : (_root_.OAI.ActualEisensteinCubic.O)), 0; 0, (↑(-u)⁻¹ : (_root_.OAI.ActualEisensteinCubic.O))] * !![1, 0; -(u : (_root_.OAI.ActualEisensteinCubic.O)) * (1 + (n : (_root_.OAI.ActualEisensteinCubic.O)) * (u : (_root_.OAI.ActualEisensteinCubic.O))), 1] * !![1, (↑u⁻¹ : (_root_.OAI.ActualEisensteinCubic.O)); 0, 1]) funext i j fin_cases i <;> fin_cases j <;> simp [Matrix.mul_apply, Fin.sum_univ_two, neg_mul, Units.val_neg, mul_add, add_mul, mul_assoc, add_comm] lemma unitCuspUpper_section (b : (_root_.OAI.ActualEisensteinCubic.O)) (z : ℂ) (v : ℝ) (hv : 0 fin_cases j <;> simp [Matrix.mul_apply, Fin.sum_univ_two] ring end CubicEisenstein open scoped Classical MatrixGroups namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota abbrev CubeResidueStrata (p:(_root_.OAI.ActualEisensteinCubic.O)) := Σj:Fin 4,CubicUnitResidue (p^(3-j.val)) def cubeResidueStratumMap (p:(_root_.OAI.ActualEisensteinCubic.O)) (x:CubeResidueStrata p) : (_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3} := Ideal.Quotient.mk _ (p^x.1.val * GaussianShiftedPartition.representative (p^(3-x.1.val)) x.2.1) private lemma unit_rep_coprime (c:(_root_.OAI.ActualEisensteinCubic.O)) (x:CubicUnitResidue c) : IsCoprime c (GaussianShiftedPartition.representative c x.1) := by apply (isUnit_quotient_span_iff c _).mp simpa only [GaussianShiftedPartition.representative_spec] using x.2 private lemma cube_strata_exponents (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (j k:Fin 4) (b d:(_root_.OAI.ActualEisensteinCubic.O)) (hb:IsCoprime (p^(3-j.val)) b) (he:p^3∣p^j.val*b-p^k.val*d) : ¬j.valB i j) he exact Ideal.mem_span_singleton.mp ((Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp he') lemma comparison_primary (A N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) (hNA:N*A⁻¹∈levelThree) (hA:lambda^2∣A 0 0-1) : lambda^2∣N 0 0-1 := by have hh:=lambda_sq_dvd_three.trans (comparison_mod_three A N hNA 0 0) simpa only [sub_add_sub_cancel] using dvd_add hh hA lemma comparison_levelTwo (A:levelTwo) (N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) (hNA:N*(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))⁻¹∈levelThree) : N∈levelTwo := by have hh:=Subgroup.mul_mem levelTwo (levelThree_le_levelTwo hNA) A.property simpa only [inv_mul_cancel_right] using hh lemma levelTwo_cube_zero_phase (A N:levelTwo) (p q:(_root_.OAI.ActualEisensteinCubic.O)) (hp:lambda^2∣p-1) (hA:lambda^2∣((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0)-1) (hN:lambda^2∣((N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0)-1) (hx:(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0+3*q*(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0=(N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0) (hc:(N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0=p^3*(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) (hNA:(N:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))*(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))⁻¹∈levelThree) : complexCharacter ⟨(N:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))*(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))⁻¹,hNA⟩=1 := by have hcop:IsCoprime ((N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0) p:=by refine ⟨(N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 1,-(N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 1*p^2*(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0,?_⟩ have hd:(N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0*(N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 1- (N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 1*(N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0=1:=by simpa only [Matrix.det_fin_two] using (N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))).property rw [hc] at hd linear_combination hd have hcube:eisEmbedding (symbol ((N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0) p)^3=1:=by rw [←map_pow,symbol_cube_of_isCoprime _ _ hp hcop,map_one] have hb:=levelTwo_cube_phase_balance A N p q 0 hp hA hN (by simpa using hx) (by simpa using hc) simp only [pow_zero,mul_one,Nat.sub_zero,hcube] at hb have hcomp:=levelTwo_comparison_character A N hNA have hbase:levelTwoComplexCharacter A≠0:=by intro he have hh:=levelTwoComplexCharacter_cube A rw [he] at hh norm_num at hh apply mul_right_cancel₀ hbase rw [one_mul,hcomp,hb] lemma cube_exponent_zero_of_lower_divisible (A N:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) (p q:(_root_.OAI.ActualEisensteinCubic.O)) (j:ℕ) (hp:Prime p) (hC:p∣A 1 0) (hx:A 0 0+3*q*A 1 0=p^j*N 0 0) : j=0 := by by_contra hj have hpx:p∣A 0 0+3*q*A 1 0:=by rw [hx] exact dvd_mul_of_dvd_left (dvd_pow_self p hj) (N 0 0) have hpa:p∣A 0 0:=by simpa only [add_sub_cancel_right] using dvd_sub hpx (dvd_mul_of_dvd_right hC (3*q)) have hone:p∣(1:(_root_.OAI.ActualEisensteinCubic.O)):=by have hh:=dvd_sub (dvd_mul_of_dvd_left hpa (A 1 1)) (dvd_mul_of_dvd_right hC (A 0 1)) have hd:A 0 0*A 1 1-A 0 1*A 1 0=1:=by simpa only [Matrix.det_fin_two] using A.property rwa [hd] at hh exact hp.not_isUnit (isUnit_of_dvd_one hone) end CubicKubota namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota lemma cube_affine_coefficient_unit (p C:(_root_.OAI.ActualEisensteinCubic.O)) (hprimary:lambda^2∣p-1) (hC:IsCoprime C p) : IsUnit (Ideal.Quotient.mk (Ideal.span {p^3}) (3*C)) := by obtain ⟨t,ht⟩:=(three_dvd_primary_sub_one p hprimary) have hp3:IsCoprime p (3:(_root_.OAI.ActualEisensteinCubic.O)):=by refine ⟨1,-t,?_⟩ linear_combination ht apply (isUnit_quotient_span_iff _ _).mpr exact hp3.pow_left.mul_right hC.symm.pow_left def cubeCuspAffineEquiv (p A C:(_root_.OAI.ActualEisensteinCubic.O)) (hprimary:lambda^2∣p-1) (hC:IsCoprime C p) : ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3})≃((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3}) := by let a:=Ideal.Quotient.mk (Ideal.span {p^3}) A let u:Units ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3}):=(cube_affine_coefficient_unit p C hprimary hC).unit exact { toFun:=fun r=>a+(u:_) * r invFun:=fun r=>(↑u⁻¹:_)*(r-a) left_inv:=by intro r simp only [add_sub_cancel_left,←mul_assoc,Units.inv_mul,one_mul] right_inv:=by intro r simp only [←mul_assoc,Units.mul_inv,one_mul,add_sub_cancel] } lemma cubeCuspAffineEquiv_apply (p A C:(_root_.OAI.ActualEisensteinCubic.O)) (hprimary:lambda^2∣p-1) (hC:IsCoprime C p) (r:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3}) : cubeCuspAffineEquiv p A C hprimary hC r= Ideal.Quotient.mk (Ideal.span {p^3}) A+ Ideal.Quotient.mk (Ideal.span {p^3}) (3*C)*r := by simp only [cubeCuspAffineEquiv,IsUnit.unit_spec] rfl lemma cubeCuspAffineEquiv_mk (p A C q:(_root_.OAI.ActualEisensteinCubic.O)) (hprimary:lambda^2∣p-1) (hC:IsCoprime C p) : cubeCuspAffineEquiv p A C hprimary hC (Ideal.Quotient.mk _ q)= Ideal.Quotient.mk (Ideal.span {p^3}) (A+3*q*C) := by rw [cubeCuspAffineEquiv_apply] simp only [map_add,map_mul] ring end CubicEisenstein open scoped Classical MatrixGroups BigOperators namespace CubicKubota open ActualEisensteinCubic ConcreteTraceCRT CubicEisenstein CubicJacobiGlobal structure CubeCuspData (A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) (p q:(_root_.OAI.ActualEisensteinCubic.O)) where exponent : Fin 4 matrix : SL(2,(_root_.OAI.ActualEisensteinCubic.O)) first : A 0 0+3*q*A 1 0=p^exponent.val*matrix 0 0 second : p^3*A 1 0=p^exponent.val*matrix 1 0 congruent : matrix*A⁻¹∈levelThree def actualCubeCuspData (A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) (p q:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) : CubeCuspData A p q := by let h:=cube_average_cusp_reduction A p q hp hprimary let j:=Classical.choose h have hj:j≤3:=(Classical.choose_spec h).1 let N:=Classical.choose (Classical.choose_spec h).2 have hN:=(Classical.choose_spec (Classical.choose_spec h).2) exact ⟨⟨j,by omega⟩,N,hN.1,hN.2.1,hN.2.2.1⟩ namespace CubeCuspData variable {A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))} {p q:(_root_.OAI.ActualEisensteinCubic.O)} lemma lower_eq (d:CubeCuspData A p q) (hp:p≠0) : d.matrix 1 0=p^(3-d.exponent.val)*A 1 0 := by apply mul_left_cancel₀ (pow_ne_zero d.exponent.val hp) rw [←d.second,←mul_assoc,←pow_add,Nat.add_sub_of_le (by omega:d.exponent.val≤3)] lemma unit_top (d:CubeCuspData A p q) (hp:p≠0) : IsUnit (Ideal.Quotient.mk (Ideal.span {p^(3-d.exponent.val)}) (d.matrix 0 0)) := by apply (isUnit_quotient_span_iff _ _).mpr refine ⟨-d.matrix 0 1*A 1 0,d.matrix 1 1,?_⟩ have hd:d.matrix 0 0*d.matrix 1 1-d.matrix 0 1*d.matrix 1 0=1:=by simpa only [Matrix.det_fin_two] using d.matrix.property rw [d.lower_eq hp] at hd linear_combination hd def stratum (d:CubeCuspData A p q) (hp:p≠0) : CubeResidueStrata p := ⟨d.exponent,⟨Ideal.Quotient.mk _ (d.matrix 0 0),d.unit_top hp⟩⟩ lemma stratum_map (d:CubeCuspData A p q) (hp:p≠0) : cubeResidueStratumMap p (d.stratum hp)= Ideal.Quotient.mk (Ideal.span {p^3}) (A 0 0+3*q*A 1 0) := by apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mpr apply Ideal.mem_span_singleton.mpr change p^3∣p^d.exponent.val*GaussianShiftedPartition.representative (p^(3-d.exponent.val)) (Ideal.Quotient.mk _ (d.matrix 0 0))-(A 0 0+3*q*A 1 0) rw [d.first,←mul_sub] have hpow:p^3=p^d.exponent.val*p^(3-d.exponent.val):=by rw [←pow_add,Nat.add_sub_of_le (by omega:d.exponent.val≤3)] rw [hpow] exact mul_dvd_mul_left _ (gaussRep_mk_congr _ _) lemma comparison_phase (A2:levelTwo) (d:CubeCuspData (A2:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) p q) (hp:Prime p) (hprimary:lambda^2∣p-1) (hA:lambda^2∣((A2:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0)-1) (hC:IsCoprime ((A2:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) p) : complexCharacter ⟨d.matrix*(A2:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))⁻¹,d.congruent⟩ = cubeStratumSymbol p ((A2:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) d.exponent (d.stratum hp.ne_zero).2 := by let N2:levelTwo:=⟨d.matrix,comparison_levelTwo A2 d.matrix d.congruent⟩ have hN:lambda^2∣d.matrix 0 0-1:=comparison_primary _ _ d.congruent hA have he:=levelTwo_cube_comparison_phase A2 N2 p q d.exponent.val (by omega:d.exponent.val≤3) hprimary hA hN d.first (d.lower_eq hp.ne_zero) hC d.congruent rw [he] unfold cubeStratumSymbol rw [←map_pow,←cubicSymbol_pow_denominator] apply congrArg eisEmbedding apply symbol_congr have hd:=gaussRep_mk_congr (p^(3-d.exponent.val)) (d.matrix 0 0) change p^(3-d.exponent.val)∣d.matrix 0 0*((A2:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0)- GaussianShiftedPartition.representative (p^(3-d.exponent.val)) (Ideal.Quotient.mk _ (d.matrix 0 0))*((A2:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) convert dvd_mul_of_dvd_left (dvd_neg.mpr hd) ((A2:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) using 1 ; ring end CubeCuspData end CubicKubota end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Reciprocity.RamifiedCuspPhases namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicKubota open scoped Classical MatrixGroups BigOperators open ActualEisensteinCubic ConcreteTraceCRT CubicEisenstein CubicJacobiGlobal def actualCubeCuspPhaseSum (A:levelTwo) (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (w:Fin 4→ℂ) : ℂ := ∑' r:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3}, let d:=actualCubeCuspData (A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) p (GaussianShiftedPartition.representative (p^3) r) hp hprimary w d.exponent * complexCharacter ⟨d.matrix*(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))⁻¹,d.congruent⟩ theorem actualCubeCuspPhaseSum_coprime (A:levelTwo) (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (hA:lambda^2∣((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0)-1) (hC:IsCoprime ((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) p) (w:Fin 4→ℂ) : actualCubeCuspPhaseSum A p hp hprimary w = w 0*(Ideal.absNorm (Ideal.span {p}):ℂ)^2*((Ideal.absNorm (Ideal.span {p}):ℂ)-1)+w 3 := by let e:=cubeResidueStrataEquiv p hp hprimary let a:=cubeCuspAffineEquiv p ((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0) ((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) hprimary hC let d (r:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3}):=actualCubeCuspData (A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) p (GaussianShiftedPartition.representative (p^3) r) hp hprimary let phi (s:CubeResidueStrata p):=w s.1*cubeStratumSymbol p ((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) s.1 s.2 have hpoint (r:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3}): w (d r).exponent*complexCharacter ⟨(d r).matrix*(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))⁻¹,(d r).congruent⟩= phi (e.symm (a r)) := by rw [(d r).comparison_phase A hp hprimary hA hC] change phi ((d r).stratum hp.ne_zero)=phi (e.symm (a r)) apply congrArg phi apply e.injective rw [e.apply_symm_apply] change cubeResidueStratumMap p ((d r).stratum hp.ne_zero)=a r rw [(d r).stratum_map hp.ne_zero] rw [←cubeCuspAffineEquiv_mk p ((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0) ((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) (GaussianShiftedPartition.representative (p^3) r) hprimary hC, GaussianShiftedPartition.representative_spec] let (j:Fin 4):Finite ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^(3-j.val)}) := finite_quotient_span (pow_ne_zero _ hp.ne_zero) let (j:Fin 4):Finite (CubicUnitResidue (p^(3-j.val))) := inferInstance have hphi:Summable phi:=Summable.of_finite calc actualCubeCuspPhaseSum A p hp hprimary w = ∑' r,phi (e.symm (a r)) := by unfold actualCubeCuspPhaseSum exact tsum_congr hpoint _ = ∑' r,phi (e.symm r) := a.tsum_eq (fun r => phi (e.symm r)) _ = ∑' s,phi s := e.symm.tsum_eq phi _ = ∑j:Fin 4,w j*∑' b:CubicUnitResidue (p^(3-j.val)),cubeStratumSymbol p ((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) j b := by rw [hphi.tsum_sigma,tsum_fintype] apply Finset.sum_congr rfl intro j hj exact tsum_mul_left (f := fun b:CubicUnitResidue (p^(3-j.val)) => cubeStratumSymbol p ((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) j b) (a := w j) _ = _ := cubeStrata_weighted_sum p ((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0) hp hprimary hC w theorem actualCubeCuspPhaseSum_dvd (A:levelTwo) (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (hA:lambda^2∣((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 0 0)-1) (hC:p∣((A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) 1 0)) (w:Fin 4→ℂ) : actualCubeCuspPhaseSum A p hp hprimary w = w 0*(Ideal.absNorm (Ideal.span {p}):ℂ)^3 := by let d (r:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3}):=actualCubeCuspData (A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) p (GaussianShiftedPartition.representative (p^3) r) hp hprimary have hpoint (r:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3}): w (d r).exponent*complexCharacter ⟨(d r).matrix*(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))⁻¹,(d r).congruent⟩=w 0 := by have hj:((d r).exponent:ℕ)=0:=cube_exponent_zero_of_lower_divisible (A:SL(2,(_root_.OAI.ActualEisensteinCubic.O))) (d r).matrix p _ _ hp hC (d r).first have hj':(d r).exponent=0:=Fin.ext hj let N:levelTwo:=⟨(d r).matrix,comparison_levelTwo A (d r).matrix (d r).congruent⟩ have hphase:=levelTwo_cube_zero_phase A N p (GaussianShiftedPartition.representative (p^3) r) hprimary hA (comparison_primary _ _ (d r).congruent hA) (by simpa only [hj,pow_zero,one_mul] using (d r).first) (by simpa only [hj,Nat.sub_zero] using (d r).lower_eq hp.ne_zero) (d r).congruent change w (d r).exponent*complexCharacter ⟨(N:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))*(A:SL(2,(_root_.OAI.ActualEisensteinCubic.O)))⁻¹,(d r).congruent⟩=w 0 rw [hphase,hj',mul_one] calc actualCubeCuspPhaseSum A p hp hprimary w = ∑' r:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3},w 0 := by unfold actualCubeCuspPhaseSum exact tsum_congr hpoint _ = (Nat.card ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p^3}):ℂ)*w 0 := by rw [tsum_const,nsmul_eq_mul] _ = _ := by change (Ideal.absNorm (Ideal.span {p^3}):ℂ)*w 0 = _ rw [←Ideal.span_singleton_pow,map_pow,Nat.cast_pow] ring end CubicKubota namespace CubicEisenstein section open scoped BigOperators Classical MatrixGroups Matrix section open ActualEisensteinCubic CubicKubota ConcreteTraceCRT CubicJacobiGlobal lemma onceCusp_trace_lambda : ramifiedTraceLambda*(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O)=3*omega^2 := by unfold ramifiedTraceLambda linear_combination -ramified_omega_relation lemma onceCusp_lambda_dvd_trace : (_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O)∣ramifiedTraceLambda := by refine ⟨-omega,?_⟩ unfold ramifiedTraceLambda linear_combination ramified_omega_relation def onceCuspScale (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : (_root_.OAI.ActualEisensteinCubic.O) := (u:(_root_.OAI.ActualEisensteinCubic.O))*ramifiedTraceLambda def onceCuspComplement (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : (_root_.OAI.ActualEisensteinCubic.O) := -(↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O))*ramifiedTraceLambda lemma onceCusp_scale_complement (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : onceCuspScale u*onceCuspComplement u=3 := by calc _ = -((u:(_root_.OAI.ActualEisensteinCubic.O))*(↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O)))*ramifiedTraceLambda^2 := by unfold onceCuspScale onceCuspComplement; ring _ = 3 := by simp [ramifiedTraceLambda_square] lemma onceCusp_scale_ne_zero (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : onceCuspScale u≠0 := by intro h have hh:=onceCusp_scale_complement u rw [h,zero_mul] at hh exact (by norm_num : (0:(_root_.OAI.ActualEisensteinCubic.O))≠3) hh lemma onceCusp_scale_lambda (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : (3:(_root_.OAI.ActualEisensteinCubic.O))∣onceCuspScale u*(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O) := by refine ⟨(u:(_root_.OAI.ActualEisensteinCubic.O))*omega^2,?_⟩ simp only [onceCuspScale,mul_assoc,onceCusp_trace_lambda] ring lemma onceCusp_complement_lambda (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : (_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O)∣onceCuspComplement u := onceCusp_lambda_dvd_trace.mul_left _ lemma onceCusp_scale_coprime (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (d:PrimaryLower) : IsCoprime (onceCuspScale u) d.val := by apply (isCoprime_mul_unit_left_left u.isUnit _ _).mpr apply (primary_coprime_three d.val (primaryLower_primary d)).symm.of_isCoprime_of_dvd_left exact ⟨-ramifiedTraceLambda,by linear_combination ramifiedTraceLambda_square⟩ abbrev OnceRamifiedData := Fin 3×UnitLowerData def onceRamifiedToPrimitive (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (p:OnceRamifiedData) : PrimitiveRow := by let b:=omega^p.1.val*p.2.1.val let d:=p.2.2.val.val refine ⟨![onceCuspScale u*(b-d),d],?_,?_,p.2.2.val.2⟩ · change IsCoprime (onceCuspScale u*(b-d)) d apply (onceCusp_scale_coprime u p.2.2.val).mul_left apply IsCoprime.symm apply (isCoprime_right_congr_of_dvd d (b-d) b ⟨-1,by ring⟩).mpr exact ((isCoprime_mul_unit_left_left ((omega_primitive.isUnit (by decide)).pow _) _ _).mpr p.2.2.2).symm · change (3:(_root_.OAI.ActualEisensteinCubic.O))∣onceCuspScale u*(b-d) have hb:(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O)∣b-1:=(halfPrimaryFromAssociate (p.1,p.2.1)).2 have hd:(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O)∣d-1:=halfPrimary_lambda_dvd_three.trans p.2.2.val.2 have hbd:(_root_.OAI.ActualEisensteinCubic.omega - 1 : _root_.OAI.ActualEisensteinCubic.O)∣b-d:=by simpa only [sub_sub_sub_cancel_right] using dvd_sub hb hd obtain ⟨k,hk⟩:=hbd rw [hk,←mul_assoc] exact (onceCusp_scale_lambda u).mul_right k lemma onceRamifiedToPrimitive_bijective (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : Function.Bijective (onceRamifiedToPrimitive u) := by constructor · rintro ⟨j,a,d,had⟩ ⟨k,b,e,hbe⟩ h have hrow:=congrArg Subtype.val h have hde:d=e:=Subtype.ext (congrFun hrow 1) subst e have he:=congrFun hrow 0 change onceCuspScale u*(omega^j.val*a.val-d.val)= onceCuspScale u*(omega^k.val*b.val-d.val) at he have hsub:=mul_left_cancel₀ (onceCusp_scale_ne_zero u) he have hassoc:halfPrimaryFromAssociate (j,a)=halfPrimaryFromAssociate (k,b):=by apply Subtype.ext change omega^j.val*a.val=omega^k.val*b.val linear_combination hsub have hp:=halfPrimaryFromAssociate_injective hassoc have hj:j=k:=congrArg Prod.fst hp have hab:a=b:=congrArg Prod.snd hp subst k subst b rfl · intro r obtain ⟨k,hk⟩:=r.2.2.1 let d:PrimaryLower:=⟨r.val 1,r.2.2.2⟩ let b:HalfPrimary:=⟨onceCuspComplement u*k+d.val,by have hh:=dvd_add ((onceCusp_complement_lambda u).mul_right k) (halfPrimary_lambda_dvd_three.trans d.2) convert hh using 1 ;ring⟩ let p:=halfPrimaryAssociateEquiv.symm b have hp:omega^p.1.val*p.2.val=b.val:= congrArg Subtype.val (halfPrimaryAssociateEquiv.apply_symm_apply b) have hr:onceCuspScale u*(b.val-d.val)=r.val 0:=by change onceCuspScale u*(onceCuspComplement u*k+d.val-d.val)=_ rw [add_sub_cancel_right,←mul_assoc,onceCusp_scale_complement,hk] have hcop:IsCoprime p.2.val d.val:=by have h0:IsCoprime (b.val-d.val) d.val:= (hr ▸ r.2.1).of_isCoprime_of_dvd_left (dvd_mul_left _ _) have hb:IsCoprime b.val d.val:=by apply IsCoprime.symm exact (isCoprime_right_congr_of_dvd d.val (b.val-d.val) b.val ⟨-1,by ring⟩).mp h0.symm rw [←hp] at hb exact hb.of_isCoprime_of_dvd_left (dvd_mul_left _ _) refine ⟨(p.1,⟨p.2,d,hcop⟩),Subtype.ext ?_⟩ funext i fin_cases i · change onceCuspScale u*(omega^p.1.val*p.2.val-d.val)=r.val 0 rw [hp,hr] · rfl def onceRamifiedEquiv (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : OnceRamifiedData≃PrimitiveRow := Equiv.ofBijective _ (onceRamifiedToPrimitive_bijective u) lemma onceRamified_row_phase (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (p:OnceRamifiedData) : (cosetCharacter (primitiveRowEquiv.symm (onceRamifiedEquiv u p)))⁻¹= eisEmbedding (symbol (onceCuspScale u*omega^p.1.val) p.2.2.val.val)* eisEmbedding (symbol p.2.2.val.val p.2.1.val) := by rw [inverse_cosetCharacter_eq_row_symbol,primitiveRowEquiv_symm_row] change eisEmbedding (symbol (onceCuspScale u*(omega^p.1.val*p.2.1.val-p.2.2.val.val)) p.2.2.val.val)=_ have hh : symbol (onceCuspScale u*(omega^p.1.val*p.2.1.val-p.2.2.val.val)) p.2.2.val.val= symbol ((onceCuspScale u*omega^p.1.val)*p.2.1.val) p.2.2.val.val := symbol_congr ⟨-onceCuspScale u,by ring⟩ rw [hh,symbol_mul_numerator _ _ _ (primaryLower_primary p.2.2.val), symbol_reciprocity p.2.1.val p.2.2.val.val (primaryLower_ne_zero p.2.1) (primaryLower_ne_zero p.2.2.val) (primaryLower_primary p.2.1) (primaryLower_primary p.2.2.val),map_mul] end open ActualEisensteinCubic CubicKubota ConcreteTraceCRT CubicJacobiGlobal def diagonalPrimitiveMap (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (v:PrimitiveRow) : PrimitiveRow := ⟨![(u:(_root_.OAI.ActualEisensteinCubic.O))^2*v.val 0,v.val 1],by refine ⟨?_,?_,v.2.2.2⟩ · exact (isCoprime_mul_unit_left_left (u.isUnit.pow 2) _ _).mpr v.2.1 · exact v.2.2.1.mul_left _⟩ def diagonalPrimitiveEquiv (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : PrimitiveRow≃PrimitiveRow where toFun:=diagonalPrimitiveMap u invFun:=diagonalPrimitiveMap u⁻¹ left_inv v:=by apply Subtype.ext funext i fin_cases i · change (↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O))^2*((u:(_root_.OAI.ActualEisensteinCubic.O))^2*v.val 0)=v.val 0 rw [←mul_assoc,←mul_pow] simp · rfl right_inv v:=by apply Subtype.ext funext i fin_cases i · change (u:(_root_.OAI.ActualEisensteinCubic.O))^2*((↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O))^2*v.val 0)=v.val 0 rw [←mul_assoc,←mul_pow] simp · rfl lemma rowOperator_unitCuspDiagonal (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (v:PrimitiveRow) : rowOperator (integralComplexMatrix (unitCuspDiagonal u)) (embeddedRow (primitiveRowEquiv.symm v))= eisEmbedding (↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O)) • embeddedRow (primitiveRowEquiv.symm (diagonalPrimitiveEquiv u v)) := by simp only [embeddedRow, Function.comp_def, primitiveRowEquiv_symm_row] rw [rowOperator_apply] funext i simp only [Matrix.vecMul, dotProduct, Fin.sum_univ_two, integralComplexMatrix_apply, Pi.smul_apply, smul_eq_mul] fin_cases i · change eisEmbedding (v.val 0) * eisEmbedding (u : (_root_.OAI.ActualEisensteinCubic.O)) + eisEmbedding (v.val 1) * eisEmbedding (0 : (_root_.OAI.ActualEisensteinCubic.O)) = eisEmbedding (↑u⁻¹ : (_root_.OAI.ActualEisensteinCubic.O)) * eisEmbedding ((u : (_root_.OAI.ActualEisensteinCubic.O)) ^ 2 * v.val 0) simp only [map_zero, mul_zero, add_zero, map_mul, pow_two] have hu : eisEmbedding (↑u⁻¹ : (_root_.OAI.ActualEisensteinCubic.O)) * eisEmbedding (u : (_root_.OAI.ActualEisensteinCubic.O)) = 1 := by rw [← map_mul] simp calc _ = (eisEmbedding (↑u⁻¹ : (_root_.OAI.ActualEisensteinCubic.O)) * eisEmbedding (u : (_root_.OAI.ActualEisensteinCubic.O))) * (eisEmbedding (v.val 0) * eisEmbedding (u : (_root_.OAI.ActualEisensteinCubic.O))) := by rw [hu, one_mul] _ = _ := by ring · change eisEmbedding (v.val 0) * eisEmbedding (0 : (_root_.OAI.ActualEisensteinCubic.O)) + eisEmbedding (v.val 1) * eisEmbedding (↑u⁻¹ : (_root_.OAI.ActualEisensteinCubic.O)) = eisEmbedding (↑u⁻¹ : (_root_.OAI.ActualEisensteinCubic.O)) * eisEmbedding (v.val 1) simp [mul_comm] lemma rowEnergy_unit_smul (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (v:Fin 2→ℂ) : rowEnergy (eisEmbedding (u:(_root_.OAI.ActualEisensteinCubic.O)) • v)=rowEnergy v := by simp only [rowEnergy,Pi.smul_apply,smul_eq_mul,norm_mul, GaussGeneratorTransport.norm_eisEmbedding_unit,one_mul] lemma diagonal_ray_summand (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (g:SL(2,ℂ)) (s:ℂ) (v:PrimitiveRow) : summand (integralComplexMatrix (unitCuspDiagonal u)*g) s (primitiveRowEquiv.symm v)= eisEmbedding (symbol ((↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O))^2) (v.val 1))* summand g s (primitiveRowEquiv.symm (diagonalPrimitiveEquiv u v)) := by have hphase : (cosetCharacter (primitiveRowEquiv.symm v))⁻¹= eisEmbedding (symbol ((↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O))^2) (v.val 1))* (cosetCharacter (primitiveRowEquiv.symm (diagonalPrimitiveEquiv u v)))⁻¹ := by simp only [inverse_cosetCharacter_eq_row_symbol,primitiveRowEquiv_symm_row] change eisEmbedding (symbol (v.val 0) (v.val 1))= eisEmbedding (symbol ((↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O))^2) (v.val 1))* eisEmbedding (symbol ((u:(_root_.OAI.ActualEisensteinCubic.O))^2*v.val 0) (v.val 1)) rw [←map_mul,←symbol_mul_numerator _ _ _ (lambda_sq_dvd_three.trans v.2.2.2)] congr 2 rw [←mul_assoc,←mul_pow] simp rw [summand,←rowOperator_mul,rowOperator_unitCuspDiagonal,map_smul,rowEnergy_unit_smul,hphase, summand] ring end section open MeasureTheory open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic CubicKubota ConcreteTraceCRT CubicJacobiGlobal def affineLowerTerm (q r:(_root_.OAI.ActualEisensteinCubic.O)) (z:ℂ) (v:ℝ) (s:ℂ) (a d:(_root_.OAI.ActualEisensteinCubic.O)) : ℂ := (eisEmbedding (symbol r d)*eisEmbedding (symbol d a))* ((v/(‖eisEmbedding (q*a)*z+eisEmbedding d‖^2+ ‖eisEmbedding (q*a)‖^2*v^2):ℝ):ℂ)^s lemma affineLowerTerm_mul_ray (q r t:(_root_.OAI.ActualEisensteinCubic.O)) (z:ℂ) (v:ℝ) (s:ℂ) (a d:PrimaryLower) : eisEmbedding (symbol t d.val)*affineLowerTerm q r z v s a.val d.val= affineLowerTerm q (t*r) z v s a.val d.val := by rw [affineLowerTerm,affineLowerTerm,symbol_mul_numerator _ _ _ (primaryLower_primary d), map_mul eisEmbedding (symbol t d.val) (symbol r d.val)] ring lemma onceRamified_summand (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (z:ℂ) (v:ℝ) (hv:0 simp [onceRamifiedEquiv, Equiv.ofBijective_apply, onceRamifiedToPrimitive, r, map_mul, map_sub, mul_sub, mul_assoc] have hr0:r≠0:=by intro hh have he:=congrFun hh 1 exact eisEmbedding_ne_zero (primaryLower_ne_zero p.2.2.val) he have hp:=heightDenominator_pos z v hv r hr0 rw [summand,←rowOperator_mul,hr,rowEnergy_upperSection,onceRamified_row_phase] change _= (eisEmbedding (symbol (onceCuspScale u*omega^p.1.val) p.2.2.val.val)* eisEmbedding (symbol p.2.2.val.val p.2.1.val))*((v/heightDenominator z v r:ℝ):ℂ)^s have hi:((v/heightDenominator z v r:ℝ):ℂ)=(((heightDenominator z v r/v:ℝ):ℂ))⁻¹:=by simp only [Complex.ofReal_div,inv_div] rw [hi,Complex.inv_cpow_ofReal_nonneg (div_nonneg hp.le hv.le),Complex.cpow_neg] def diagonalOnceCuspIndex (u t:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : OnceRamifiedData≃CuspCosets := (onceRamifiedEquiv t).trans ((diagonalPrimitiveEquiv u).symm.trans primitiveRowEquiv.symm) def diagonalUnitCuspIndex (u t:(_root_.OAI.ActualEisensteinCubic.O)ˣ) : UnitLowerData≃CuspCosets := (unitLowerEquiv t).trans ((diagonalPrimitiveEquiv u).symm.trans primitiveRowEquiv.symm) lemma diagonal_once_summand (u t:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (z:ℂ) (v:ℝ) (hv:0∫z in periodDomain, affineLowerTerm (onceCuspScale t*omega^p.1.val) ((↑u⁻¹:(_root_.OAI.ActualEisensteinCubic.O))^2*(onceCuspScale t*omega^p.1.val)) z v s p.2.1.val p.2.2.val.val* ShortDraftTrace.breveE (-freq*z)) (∫z in periodDomain,eisenstein (integralComplexMatrix (unitCuspDiagonal u)* integralComplexMatrix (lowerCuspMatrix (onceCuspScale t))*upperSection z v hv) s* ShortDraftTrace.breveE (-freq*z)) := by have hh:=(diagonalOnceCuspIndex u t).hasSum_iff.mpr (hasSum_integral_fixed_left_Eisenstein (integralComplexMatrix (unitCuspDiagonal u)*integralComplexMatrix (lowerCuspMatrix (onceCuspScale t))) v hv s freq hs) apply hh.congr_fun intro p apply integral_congr_ae exact Filter.Eventually.of_forall (fun z=>by dsimp only; rw [mul_assoc,diagonal_once_summand]) end open Filter MeasureTheory open scoped BigOperators Classical Topology open ConcreteTraceCRT EisensteinEmbedding noncomputable abbrev instMeasureSpaceUnitAddCircle_oAI_2 : MeasureSpace UnitAddCircle := ⟨AddCircle.haarAddCircle⟩ theorem instIsAddHaarMeasureUnitAddCircleVolume_oAI_2 : letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_2 Measure.IsAddHaarMeasure (volume : Measure UnitAddCircle) := letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_2 inferInstanceAs (Measure.IsAddHaarMeasure AddCircle.haarAddCircle) def eisensteinCoordinateMul (b : ActualEisensteinCubic.O) (x : Fin 2→ℝ) : Fin 2→ℝ := ![(ActualEisensteinCoordinates.coords b).1 • x 0-(ActualEisensteinCoordinates.coords b).2 • x 1, (ActualEisensteinCoordinates.coords b).2 • x 0+ ((ActualEisensteinCoordinates.coords b).1-(ActualEisensteinCoordinates.coords b).2) • x 1] def eisensteinTorusMul (b : ActualEisensteinCubic.O) : UnitAddTorus (Fin 2)→+UnitAddTorus (Fin 2) where toFun t := ![(ActualEisensteinCoordinates.coords b).1 • t 0-(ActualEisensteinCoordinates.coords b).2 • t 1, (ActualEisensteinCoordinates.coords b).2 • t 0+ ((ActualEisensteinCoordinates.coords b).1-(ActualEisensteinCoordinates.coords b).2) • t 1] map_zero' := by ext i;fin_cases i <;> simp map_add' t s := by ext i;fin_cases i <;> simp [smul_add] <;> abel lemma eisensteinTorusMul_continuous (b : ActualEisensteinCubic.O) : Continuous (eisensteinTorusMul b) := by apply continuous_pi intro i fin_cases i · change Continuous (fun t : UnitAddTorus (Fin 2) => (ActualEisensteinCoordinates.coords b).1 • t 0-(ActualEisensteinCoordinates.coords b).2 • t 1) fun_prop · change Continuous (fun t : UnitAddTorus (Fin 2) => (ActualEisensteinCoordinates.coords b).2 • t 0+((ActualEisensteinCoordinates.coords b).1-(ActualEisensteinCoordinates.coords b).2) • t 1) fun_prop lemma periodVector_coordinateMul (b : ActualEisensteinCubic.O) (x : Fin 2→ℝ) : periodVector (eisensteinCoordinateMul b x)=eisEmbedding b*periodVector x := by have hb : eisEmbedding b=((ActualEisensteinCoordinates.coords b).1:ℂ)+ ((ActualEisensteinCoordinates.coords b).2:ℂ)*omega3 := by simpa only [ActualEisensteinCubic.eisEmbedding_eval] using (congrArg eisEmbedding (ActualEisensteinCoordinates.eval_coords b)).symm rw [periodVector_apply,periodVector_apply,hb] simp only [eisensteinCoordinateMul,Matrix.cons_val_zero,Matrix.cons_val_one, zsmul_eq_mul] push_cast linear_combination -(3*((ActualEisensteinCoordinates.coords b).2:ℂ)*(x 1:ℂ))*EisensteinEmbedding.omega3_sq lemma eisensteinTorusMul_periodTorus (b : ActualEisensteinCubic.O) (z : ℂ) : eisensteinTorusMul b (periodTorus z)=periodTorus (eisEmbedding b*z) := by obtain ⟨x,rfl⟩ := periodVector.surjective z rw [←periodVector_coordinateMul,periodTorus_periodVector,periodTorus_periodVector] ext i fin_cases i <;> rfl lemma eisensteinTorusMul_surjective (b : ActualEisensteinCubic.O) (hb : b≠0) : Function.Surjective (eisensteinTorusMul b) := by intro t refine ⟨periodTorus ((eisEmbedding b)⁻¹*periodSection t),?_⟩ rw [eisensteinTorusMul_periodTorus,←mul_assoc,mul_inv_cancel₀ (eisEmbedding_ne_zero hb),one_mul, periodTorus_section] theorem eisensteinTorusMul_measurePreserving (b : ActualEisensteinCubic.O) (hb : b≠0) : letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_2 MeasurePreserving (eisensteinTorusMul b) volume volume := letI explicitWitness35 := @OAI.CubicEisenstein.instIsAddHaarMeasureUnitAddCircleVolume_oAI_2 letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_2 AddMonoidHom.measurePreserving (eisensteinTorusMul_continuous b) (eisensteinTorusMul_surjective b hb) rfl lemma periodTorus_eq_implies_lattice_difference (z w : ℂ) (h : periodTorus z=periodTorus w) : ∃n : ActualEisensteinCubic.O,z=w+3*eisEmbedding n := by obtain ⟨x,rfl⟩ := periodVector.surjective z obtain ⟨y,rfl⟩ := periodVector.surjective w rw [periodTorus_periodVector,periodTorus_periodVector] at h have hz (i : Fin 2) : ((x i-y i:ℝ):UnitAddCircle)=0 := by rw [AddCircle.coe_sub,congrFun h i,sub_self] obtain ⟨n0,hn0⟩ := (AddCircle.coe_eq_zero_iff (1:ℝ)).mp (hz 0) obtain ⟨n1,hn1⟩ := (AddCircle.coe_eq_zero_iff (1:ℝ)).mp (hz 1) simp only [zsmul_eq_mul,mul_one] at hn0 hn1 have hx0 : x 0=y 0+n0 := by linarith have hx1 : x 1=y 1+n1 := by linarith refine ⟨ActualEisensteinCoordinates.eval n0 n1,?_⟩ rw [periodVector_apply,periodVector_apply,ActualEisensteinCubic.eisEmbedding_eval,hx0,hx1] push_cast ring lemma periodic_function_periodSection (f : ℂ→ℂ) (hp : ∀n : ActualEisensteinCubic.O,∀z : ℂ,f (z+3*eisEmbedding n)=f z) (z : ℂ) : f (periodSection (periodTorus z))=f z := by obtain ⟨n,hn⟩ := periodTorus_eq_implies_lattice_difference (periodSection (periodTorus z)) z (periodTorus_section (periodTorus z)) rw [hn,hp] theorem period_integral_eisenstein_mul (f : ℂ→ℂ) (hf : Measurable f) (hp : ∀n : ActualEisensteinCubic.O,∀z : ℂ,f (z+3*eisEmbedding n)=f z) (b : ActualEisensteinCubic.O) (hb : b≠0) : (∫z in periodDomain,f (eisEmbedding b*z))=∫z in periodDomain,f z := letI explicitWitness16 := @OAI.CubicEisenstein.instMeasureSpaceUnitAddCircle_oAI_2 by let F : UnitAddTorus (Fin 2)→ℂ := fun t=>f (periodSection t) have hF : Measurable F := hf.comp periodSection_measurableEmbedding.measurable have hm := eisensteinTorusMul_measurePreserving b hb have hi : (∫t,F (eisensteinTorusMul b t))=∫t,F t := by have hh := integral_map («μ» := (volume : Measure (UnitAddTorus (Fin 2)))) hm.measurable.aemeasurable hF.stronglyMeasurable.aestronglyMeasurable rw [hm.map_eq] at hh exact hh.symm rw [periodTorus_integral,periodTorus_integral] at hi simp only [eisensteinTorusMul_periodTorus,F,periodic_function_periodSection f hp] at hi simp only [Complex.real_smul] at hi exact mul_left_cancel₀ (Complex.ofReal_ne_zero.mpr (show (2/(9*Real.sqrt 3):ℝ)≠0 by positivity)) hi end CubicEisenstein open MeasureTheory Filter open scoped BigOperators Classical ENNReal namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT theorem finite_index_period_unfold_of_summable (q:(_root_.OAI.ActualEisensteinCubic.O)) (hq:q≠0) (f:ℂ→ℂ) (hf:Integrable f) (hsum:Summable (fun n:(_root_.OAI.ActualEisensteinCubic.O)=>∫z in periodDomain,f (z+3*eisEmbedding n/eisEmbedding q))) : (∑'n:(_root_.OAI.ActualEisensteinCubic.O),∫z in periodDomain,f (z+3*eisEmbedding n/eisEmbedding q))= (Ideal.absNorm (Ideal.span {q}):ℂ)*(∫z:ℂ,f z) := by let : Finite ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q}):=finite_quotient_span hq let : Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q}):=Fintype.ofFinite _ let I:(_root_.OAI.ActualEisensteinCubic.O)→ℂ:=fun n=>∫z in periodDomain,f (z+3*eisEmbedding n/eisEmbedding q) have hinner (r:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q}) : (∑'n:((Ideal.Quotient.mk (Ideal.span {q})) ⁻¹' {r}),I n.val)=∫z:ℂ,f z := by rw [GaussianFiberEquiv.fiber_tsum q hq r (GaussianShiftedPartition.representative q r) (GaussianShiftedPartition.representative_spec q r)] let b:=3*eisEmbedding (GaussianShiftedPartition.representative q r)/eisEmbedding q have he (n:(_root_.OAI.ActualEisensteinCubic.O)) (z:ℂ) : z+3*eisEmbedding (GaussianShiftedPartition.representative q r+q*n)/eisEmbedding q= (z+3*eisEmbedding n)+b := by dsimp [b] simp only [map_add,map_mul] field_simp [eisEmbedding_ne_zero hq] ;ring change (∑'n:(_root_.OAI.ActualEisensteinCubic.O),∫z in periodDomain,f (z+3*eisEmbedding (GaussianShiftedPartition.representative q r+q*n)/eisEmbedding q))=_ simp_rw [he] rw [←integral_eq_period_integrals (fun z=>f (z+b)) (hf.comp_add_right b)] exact integral_add_right_eq_self f b have hsplit:=(hsum.hasSum.tsum_fiberwise (Ideal.Quotient.mk (Ideal.span {q}))).tsum_eq.symm change (∑'n:(_root_.OAI.ActualEisensteinCubic.O),I n)=_ at hsplit ⊢ rw [hsplit] change (∑'r:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q},∑'n:((Ideal.Quotient.mk (Ideal.span {q})) ⁻¹' {r}),I n.val)=_ simp only [hinner,tsum_fintype,Finset.sum_const,Finset.card_univ,nsmul_eq_mul] congr 1 change (Fintype.card ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q}):ℂ)=(Nat.card ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q}):ℂ) rw [Nat.card_eq_fintype_card] lemma finite_index_period_lintegral (q:(_root_.OAI.ActualEisensteinCubic.O)) (hq:q≠0) (f:ℂ→ℝ≥0∞) : (∑'n:(_root_.OAI.ActualEisensteinCubic.O),∫⁻z in periodDomain,f (z+3*eisEmbedding n/eisEmbedding q))= (Ideal.absNorm (Ideal.span {q}):ℝ≥0∞)*(∫⁻z:ℂ,f z) := by let : Finite ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q}):=finite_quotient_span hq let : Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q}):=Fintype.ofFinite _ let I:(_root_.OAI.ActualEisensteinCubic.O)→ℝ≥0∞:=fun n=>∫⁻z in periodDomain,f (z+3*eisEmbedding n/eisEmbedding q) have hinner (r:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q}) : (∑'n:((Ideal.Quotient.mk (Ideal.span {q})) ⁻¹' {r}),I n.val)=∫⁻z:ℂ,f z := by rw [←(GaussianFiberEquiv.fiberEquiv q hq r (GaussianShiftedPartition.representative q r) (GaussianShiftedPartition.representative_spec q r)).tsum_eq] change (∑'n:(_root_.OAI.ActualEisensteinCubic.O),∫⁻z in periodDomain,f (z+3*eisEmbedding (GaussianShiftedPartition.representative q r+q*n)/eisEmbedding q))=_ let b:=3*eisEmbedding (GaussianShiftedPartition.representative q r)/eisEmbedding q have he (n:(_root_.OAI.ActualEisensteinCubic.O)) (z:ℂ) : z+3*eisEmbedding (GaussianShiftedPartition.representative q r+q*n)/eisEmbedding q= (z+3*eisEmbedding n)+b := by dsimp [b] simp only [map_add,map_mul] field_simp [eisEmbedding_ne_zero hq] ;ring simp_rw [he] rw [←lintegral_eq_period_lintegrals (fun z=>f (z+b))] exact lintegral_add_right_eq_self f b change (∑'n:(_root_.OAI.ActualEisensteinCubic.O),I n)=_ rw [←ENNReal.tsum_fiberwise I (Ideal.Quotient.mk (Ideal.span {q}))] simp only [hinner,tsum_fintype,Finset.sum_const,Finset.card_univ,nsmul_eq_mul] congr 1 change (Fintype.card ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q}):ℝ≥0∞)=(Nat.card ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {q}):ℝ≥0∞) rw [Nat.card_eq_fintype_card] lemma finite_index_period_integrals_summable (q:(_root_.OAI.ActualEisensteinCubic.O)) (hq:q≠0) (f:ℂ→ℂ) (hf:Integrable f) : Summable (fun n:(_root_.OAI.ActualEisensteinCubic.O)=>∫z in periodDomain,f (z+3*eisEmbedding n/eisEmbedding q)) := by apply Summable.of_enorm apply ne_of_lt apply lt_of_le_of_lt (ENNReal.tsum_le_tsum (fun n=>enorm_integral_le_lintegral_enorm _)) rw [finite_index_period_lintegral q hq (fun z=>‖f z‖ₑ)] exact ENNReal.mul_lt_top (by simp) hf.hasFiniteIntegral theorem finite_index_period_unfold (q:(_root_.OAI.ActualEisensteinCubic.O)) (hq:q≠0) (f:ℂ→ℂ) (hf:Integrable f) : (∑'n:(_root_.OAI.ActualEisensteinCubic.O),∫z in periodDomain,f (z+3*eisEmbedding n/eisEmbedding q))= (Ideal.absNorm (Ideal.span {q}):ℂ)*(∫z:ℂ,f z) := finite_index_period_unfold_of_summable q hq f hf (finite_index_period_integrals_summable q hq f hf) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.AffineCuspFourier /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationAffineCuspFourier01 abbrev Eis := ActualEisensteinCubic.O end RootNotationAffineCuspFourier01 open RootNotationAffineCuspFourier01 (Eis) lemma affineLowerTerm_eq_shifted (q r:Eis) (z:ℂ) (v:ℝ) (hv:0affineLowerTerm q r z v s a d) := by simp_rw [affineLowerTerm_eq_shifted q r _ v hv s a d ha hq] exact (shiftedHeightKernel_integrable v hv s _ hs).const_mul _ lemma affineLowerTerm_fourier_integral (q r:Eis) (v:ℝ) (hv:0affineLowerTerm q r z v s a (a+3*x)) (affineLowerTerm_integrable q r v hv s hs a (a+3*x) ha hq) (ninthCuspFrequency h) rw [←finite_index_period_unfold q hq _ hint] apply tsum_congr intro m apply integral_congr_ae exact Filter.Eventually.of_forall (fun z=>affineLowerTerm_weighted_translate h h1 q r a k x m j n ha hprimary hq hr hh hk z v s) end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationAffineCuspFourier02 abbrev Eis := ActualEisensteinCubic.O end RootNotationAffineCuspFourier02 open RootNotationAffineCuspFourier02 (Eis) lemma affineDenominator_integral_formula (h h1 q r k:Eis) (j n:ℕ) (a:PrimaryLower) (hq:q≠0) (hr:r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (hh:h=q*h1) (hk:3*k=h1+ramifiedAffineParameter j n*a.val) (v:ℝ) (hv:0∫z in periodDomain, affineLowerTerm q r z v s a.val d.val.val*ShortDraftTrace.breveE (-ninthCuspFrequency h*z))) : (∑'d:PrimaryCoprimeDenominator a,∫z in periodDomain, affineLowerTerm q r z v s a.val d.val.val*ShortDraftTrace.breveE (-ninthCuspFrequency h*z))= (Ideal.absNorm (Ideal.span {q}):ℂ)* ((v:ℂ)^(2-s)*sourceFourierKernel s (ninthCuspFrequency h*v))* ((‖eisEmbedding (q*a.val)‖^2:ℝ):ℂ)^(-s)*ramifiedAffineGauss h q r a.val := by let e:=(cubicResidueElementEquiv a.val (primaryLower_ne_zero a)).trans (primaryDenominatorEquiv a) have hpair:=e.summable_iff.mpr hsum change Summable (fun p:CubicUnitResidue a.val×Eis=>∫z in periodDomain, affineLowerTerm q r z v s a.val (a.val+3*(GaussianShiftedPartition.representative a.val p.1.val+a.val*p.2))* ShortDraftTrace.breveE (-ninthCuspFrequency h*z)) at hpair rw [←e.tsum_eq] change (∑'p:CubicUnitResidue a.val×Eis,∫z in periodDomain, affineLowerTerm q r z v s a.val (a.val+3*(GaussianShiftedPartition.representative a.val p.1.val+a.val*p.2))* ShortDraftTrace.breveE (-ninthCuspFrequency h*z))=_ rw [hpair.tsum_prod] have hinner (x:CubicUnitResidue a.val) : (∑'m:Eis,∫z in periodDomain, affineLowerTerm q r z v s a.val (a.val+3*(GaussianShiftedPartition.representative a.val x.val+a.val*m))* ShortDraftTrace.breveE (-ninthCuspFrequency h*z))= (Ideal.absNorm (Ideal.span {q}):ℂ)* (((v:ℂ)^(2-s)*sourceFourierKernel s (ninthCuspFrequency h*v))* ((‖eisEmbedding (q*a.val)‖^2:ℝ):ℂ)^(-s)* ((eisEmbedding (symbol r (a.val+3*GaussianShiftedPartition.representative a.val x.val))* eisEmbedding (symbol (a.val+3*GaussianShiftedPartition.representative a.val x.val) a.val))* ShortDraftTrace.breveE (ninthCuspFrequency h* eisEmbedding (a.val+3*GaussianShiftedPartition.representative a.val x.val)/eisEmbedding (q*a.val)))) := by rw [affineLowerIntegral_sum_translate h h1 q r a.val k _ j n (primaryLower_ne_zero a) (primaryLower_primary a) hq hr hh hk v hv s hs, affineLowerTerm_fourier_integral q r v hv s _ a.val _ (primaryLower_ne_zero a) hq] simp_rw [hinner] unfold ramifiedAffineGauss simp_rw [mul_assoc] rw [tsum_mul_left,tsum_mul_left,tsum_mul_left,tsum_mul_left] lemma affineCuspFrequency_lift (h1:Eis) (j n:ℕ) (a:PrimaryLower) (hfreq:(3:Eis)∣h1+ramifiedAffineParameter j n) : ∃k:Eis,3*k=h1+ramifiedAffineParameter j n*a.val := by have hh:=dvd_add hfreq (a.2.mul_left (ramifiedAffineParameter j n)) have hd:(3:Eis)∣h1+ramifiedAffineParameter j n*a.val:=by convert hh using 1 ;ring obtain ⟨k,hk⟩:=hd exact ⟨k,hk.symm⟩ lemma affineCusp_norm_factor (q:Eis) (s:ℂ) (a:PrimaryLower) : ((‖eisEmbedding (q*a.val)‖^2:ℝ):ℂ)^(-s)= ((‖eisEmbedding q‖^2:ℝ):ℂ)^(-s)*((‖eisEmbedding a.val‖^2:ℝ):ℂ)^(-s) := by rw [map_mul,norm_mul,mul_pow,Complex.ofReal_mul, Complex.mul_cpow_ofReal_nonneg (sq_nonneg _) (sq_nonneg _)] theorem affineCusp_branch_fourier (h h1 q r:Eis) (j n:ℕ) (hq:q≠0) (hr:r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (hh:h=q*h1) (hfreq:(3:Eis)∣h1+ramifiedAffineParameter j n) (v:ℝ) (hv:0∫z in periodDomain, affineLowerTerm q r z v s p.1.val p.2.val.val*ShortDraftTrace.breveE (-ninthCuspFrequency h*z))) : (∑'p:UnitLowerData,∫z in periodDomain, affineLowerTerm q r z v s p.1.val p.2.val.val*ShortDraftTrace.breveE (-ninthCuspFrequency h*z))= (Ideal.absNorm (Ideal.span {q}):ℂ)*((‖eisEmbedding q‖^2:ℝ):ℂ)^(-s)* ((v:ℂ)^(2-s)*sourceFourierKernel s (ninthCuspFrequency h*v))* ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding q)* unramifiedCubicGaussSeries s (3*r^2*h1) := by rw [hsum.tsum_sigma] have ha (a:PrimaryLower): (∑'d:PrimaryCoprimeDenominator a,∫z in periodDomain, affineLowerTerm q r z v s a.val d.val.val*ShortDraftTrace.breveE (-ninthCuspFrequency h*z))= ((Ideal.absNorm (Ideal.span {q}):ℂ)*((‖eisEmbedding q‖^2:ℝ):ℂ)^(-s)* ((v:ℂ)^(2-s)*sourceFourierKernel s (ninthCuspFrequency h*v))* ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding q))* (((‖eisEmbedding a.val‖^2:ℝ):ℂ)^(-s)*cubicUnitGaussSum (3*r^2*h1) a.val) := by obtain ⟨k,hk⟩:=affineCuspFrequency_lift h1 j n a hfreq rw [affineDenominator_integral_formula h h1 q r k j n a hq hr hh hk v hv s hs (hsum.sigma_factor a),ramifiedAffineGauss_eq_unramified h h1 q r a.val k j n (primaryLower_ne_zero a) (primaryLower_primary a) hq hr hh hk, affineCusp_norm_factor] ring simp_rw [ha] rw [tsum_mul_left] congr 1 rw [←primaryLowerIdealEquiv.symm.tsum_eq,unramifiedCubicGaussSeries] apply tsum_congr intro I change ((‖eisEmbedding (CompletedGauss.primaryGenerator I.val)‖^2:ℝ):ℂ)^(-s)* cubicUnitGaussSum (3*r^2*h1) (CompletedGauss.primaryGenerator I.val)=_ rw [eisEmbedding_norm_sq_eq_absNorm_span,(CompletedGauss.primaryGenerator_spec I.val I.2).1, Complex.ofReal_natCast] end section open MeasureTheory Filter open scoped BigOperators Classical MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationAffineCuspFourier03 abbrev Eis := ActualEisensteinCubic.O end RootNotationAffineCuspFourier03 open RootNotationAffineCuspFourier03 (Eis) lemma hasSum_diagonal_unit_integrals (u t:Eisˣ) (v:ℝ) (hv:0∫z in periodDomain, affineLowerTerm (t:Eis) ((↑u⁻¹:Eis)^2*(t:Eis)) z v s p.1.val p.2.val.val* ShortDraftTrace.breveE (-freq*z)) (∫z in periodDomain,eisenstein (integralComplexMatrix (unitCuspDiagonal u)* integralComplexMatrix (lowerCuspMatrix (t:Eis))*upperSection z v hv) s* ShortDraftTrace.breveE (-freq*z)) := by have hh:=(diagonalUnitCuspIndex u t).hasSum_iff.mpr (hasSum_integral_fixed_left_Eisenstein (integralComplexMatrix (unitCuspDiagonal u)*integralComplexMatrix (lowerCuspMatrix (t:Eis))) v hv s freq hs) apply hh.congr_fun intro p apply integral_congr_ae exact Filter.Eventually.of_forall (fun z=>by dsimp only; rw [diagonal_unit_summand]) theorem diagonal_unit_eisenstein_fourier (u t:Eisˣ) (j:ℕ) (h h1:Eis) (hr:(↑u⁻¹:Eis)^2*(t:Eis)=omega^j ∨ (↑u⁻¹:Eis)^2*(t:Eis)=-(omega^j)) (hh:h=(t:Eis)*h1) (hfreq:(3:Eis)∣h1+ramifiedAffineParameter j 0) (v:ℝ) (hv:0∫z in periodDomain,f (z+3*eisEmbedding n/eisEmbedding q) have hs:Summable (fun n:Eis=>ψ (Ideal.Quotient.mk (Ideal.span {q}) n)*I n):=by apply (((finite_index_period_integrals_summable q hq f hf).norm).mul_left ‖ψ‖).of_norm_bounded intro n rw [norm_mul] exact mul_le_mul_of_nonneg_right (norm_le_pi_norm ψ _) (norm_nonneg _) have hinner (r:Eis⧸Ideal.span {q}): (∑'n:((Ideal.Quotient.mk (Ideal.span {q})) ⁻¹' {r}), ψ (Ideal.Quotient.mk (Ideal.span {q}) n.val)*I n.val)=ψ r*(∫z:ℂ,f z) := by have heval (n:((Ideal.Quotient.mk (Ideal.span {q})) ⁻¹' {r})): Ideal.Quotient.mk (Ideal.span {q}) n.val=r:=n.2 simp_rw [heval] rw [tsum_mul_left,GaussianFiberEquiv.fiber_tsum q hq r (GaussianShiftedPartition.representative q r) (GaussianShiftedPartition.representative_spec q r)] congr 1 let b:=3*eisEmbedding (GaussianShiftedPartition.representative q r)/eisEmbedding q have he (n:Eis) (z:ℂ): z+3*eisEmbedding (GaussianShiftedPartition.representative q r+q*n)/eisEmbedding q= (z+3*eisEmbedding n)+b:=by dsimp [b] simp only [map_add,map_mul] field_simp [eisEmbedding_ne_zero hq] ;ring change (∑'n:Eis,∫z in periodDomain,f (z+3*eisEmbedding (GaussianShiftedPartition.representative q r+q*n)/eisEmbedding q))=_ simp_rw [he] rw [←integral_eq_period_integrals (fun z=>f (z+b)) (hf.comp_add_right b)] exact integral_add_right_eq_self f b rw [←(hs.hasSum.tsum_fiberwise (Ideal.Quotient.mk (Ideal.span {q})) ).tsum_eq] change (∑'r:Eis⧸Ideal.span {q},∑'n:((Ideal.Quotient.mk (Ideal.span {q})) ⁻¹' {r}), ψ (Ideal.Quotient.mk (Ideal.span {q}) n.val)*I n.val)=_ simp_rw [hinner] exact tsum_mul_right theorem character_weighted_period_unfold (q:Eis) (hq:q≠0) (ψ:AddChar (Eis⧸Ideal.span {q}) ℂ) (f:ℂ→ℂ) (hf:Integrable f) : (∑'n:Eis,ψ (Ideal.Quotient.mk (Ideal.span {q}) n)* ∫z in periodDomain,f (z+3*eisEmbedding n/eisEmbedding q))= if ψ=1 then (Ideal.absNorm (Ideal.span {q}):ℂ)*(∫z:ℂ,f z) else 0 := by let : Finite (Eis⧸Ideal.span {q}):=finite_quotient_span hq let : Fintype (Eis⧸Ideal.span {q}):=Fintype.ofFinite _ rw [quotient_weighted_period_unfold q hq ψ f hf,tsum_fintype] split_ifs with hψ · rw [AddChar.sum_eq_card_of_eq_one hψ] congr 1 change (Fintype.card (Eis⧸Ideal.span {q}):ℂ)=(Nat.card (Eis⧸Ideal.span {q}):ℂ) rw [Nat.card_eq_fintype_card] · rw [AddChar.sum_eq_zero_of_ne_one hψ,zero_mul] end section open Filter MeasureTheory open scoped BigOperators Classical open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationAffineCuspFourier05 abbrev Eis := ActualEisensteinCubic.O end RootNotationAffineCuspFourier05 open RootNotationAffineCuspFourier05 (Eis) def affinePeriodChar (q:Eis) (hq:q≠0) (ell:Eis) : AddChar (Eis⧸Ideal.span {q}) ℂ := (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates q hq).mulShift (Ideal.Quotient.mk (Ideal.span {q}) ell) lemma affinePeriodChar_mk (q:Eis) (hq:q≠0) (ell x:Eis) : affinePeriodChar q hq ell (Ideal.Quotient.mk (Ideal.span {q}) x)= ShortDraftTrace.breveE (eisEmbedding (ell*x)/(eisEmbedding q*eisLam)) := by simp only [affinePeriodChar,AddChar.mulShift_apply,←map_mul,eisTraceModChar, IdealGaussCRT.traceModChar_mk] lemma affinePeriodChar_eq_one (q:Eis) (hq:q≠0) (ell:Eis) : affinePeriodChar q hq ell=1 ↔ q∣ell := by constructor · intro h by_contra hd have hz:Ideal.Quotient.mk (Ideal.span {q}) ell≠0:=by intro he exact hd (Ideal.mem_span_singleton.mp (Ideal.Quotient.eq_zero_iff_mem.mp he)) exact GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive q hq hz h · intro hd have hz:Ideal.Quotient.mk (Ideal.span {q}) ell=0:= Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr hd) simp [affinePeriodChar,hz] lemma affineCusp_general_weighted_translate (h q r a ell x m:Eis) (j n:ℕ) (hprimary:lambda^2∣a-1) (hq:q≠0) (hr:r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (hell:3*ell=h+ramifiedAffineParameter j n*q*a) (z:ℂ) (v:ℝ) (s:ℂ) : affineLowerTerm q r z v s a (a+3*(x+a*m))*ShortDraftTrace.breveE (-ninthCuspFrequency h*z)= affinePeriodChar q hq ell (Ideal.Quotient.mk (Ideal.span {q}) m)* (affineLowerTerm q r (z+3*eisEmbedding m/eisEmbedding q) v s a (a+3*x)* ShortDraftTrace.breveE (-ninthCuspFrequency h*(z+3*eisEmbedding m/eisEmbedding q))) := by let A:=eisEmbedding (ramifiedAffineParameter j n*(a*m))/eisLam/3 let delta:=3*eisEmbedding m/eisEmbedding q have hchar:eisEmbedding (symbol r (a+3*(x+a*m)))= eisEmbedding (symbol r (a+3*x))*ShortDraftTrace.breveE A:=by have hd:lambda^2∣a+3*x-1:=primary_add_three a x hprimary have h:=ramified_symbol_primary_shift_signed j n r (a+3*x) (a*m) hr hd convert h using 1 ; congr 2 ;ring have hden:symbol (a+3*(x+a*m)) a=symbol (a+3*x) a:= symbol_congr ⟨3*m,by ring⟩ have hrow:eisEmbedding (q*a)*z+eisEmbedding (a+3*(x+a*m))= eisEmbedding (q*a)*(z+delta)+eisEmbedding (a+3*x):=by dsimp [delta] simp only [map_add,map_mul,map_ofNat] field_simp [eisEmbedding_ne_zero hq] ;ring have hell':eisEmbedding ell=(eisEmbedding h+eisEmbedding (ramifiedAffineParameter j n)*eisEmbedding q*eisEmbedding a)/3:=by apply (eq_div_iff (by norm_num : (3:ℂ)≠0)).mpr have he:=congrArg eisEmbedding hell simp only [map_mul,map_add,map_ofNat] at he linear_combination he have harg:A+ninthCuspFrequency h*delta=eisEmbedding (ell*m)/(eisEmbedding q*eisLam):=by dsimp [A,delta,ninthCuspFrequency,cuspFrequency] simp only [map_mul] rw [hell'] field_simp [eisEmbedding_ne_zero hq,eisLam_ne_zero] ;ring have hphase:ShortDraftTrace.breveE A*ShortDraftTrace.breveE (-ninthCuspFrequency h*z)= affinePeriodChar q hq ell (Ideal.Quotient.mk (Ideal.span {q}) m)* ShortDraftTrace.breveE (-ninthCuspFrequency h*(z+delta)):=by rw [affinePeriodChar_mk,←harg,←AddChar.map_add_eq_mul,←AddChar.map_add_eq_mul] congr 1 ring unfold affineLowerTerm rw [hchar,hden,hrow] change _=affinePeriodChar q hq ell (Ideal.Quotient.mk (Ideal.span {q}) m)* ((eisEmbedding (symbol r (a+3*x))*eisEmbedding (symbol (a+3*x) a))* ((v/(‖eisEmbedding (q*a)*(z+delta)+eisEmbedding (a+3*x)‖^2+ ‖eisEmbedding (q*a)‖^2*v^2):ℝ):ℂ)^s* ShortDraftTrace.breveE (-ninthCuspFrequency h*(z+delta))) calc _ = ((eisEmbedding (symbol r (a+3*x))*eisEmbedding (symbol (a+3*x) a))* ((v/(‖eisEmbedding (q*a)*(z+delta)+eisEmbedding (a+3*x)‖^2+ ‖eisEmbedding (q*a)‖^2*v^2):ℝ):ℂ)^s)* (ShortDraftTrace.breveE A*ShortDraftTrace.breveE (-ninthCuspFrequency h*z)) := by ring _ = _ := by rw [hphase];ring lemma affineCusp_masked_inner (h q r a ell x:Eis) (j n:ℕ) (ha:a≠0) (hprimary:lambda^2∣a-1) (hq:q≠0) (hr:r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (hell:3*ell=h+ramifiedAffineParameter j n*q*a) (v:ℝ) (hv:0affineLowerTerm q r z v s a (a+3*x)) (affineLowerTerm_integrable q r v hv s hs a (a+3*x) ha hq) (ninthCuspFrequency h) simp_rw [affineCusp_general_weighted_translate h q r a ell x _ j n hprimary hq hr hell, integral_const_mul] rw [character_weighted_period_unfold q hq (affinePeriodChar q hq ell) _ hint] simp only [affinePeriodChar_eq_one] end open Filter MeasureTheory open scoped BigOperators Classical MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationAffineCuspFourier06 abbrev Eis := ActualEisensteinCubic.O end RootNotationAffineCuspFourier06 open RootNotationAffineCuspFourier06 (Eis) lemma affineDenominator_zero (h h1 q r:Eis) (j n:ℕ) (a:PrimaryLower) (hq:q≠0) (hr:r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (hh:h=q*h1) (hbase:(3:Eis)∣h+ramifiedAffineParameter j n*q) (hfreq:¬(3:Eis)∣h1+ramifiedAffineParameter j n) (v:ℝ) (hv:0∫z in periodDomain, affineLowerTerm q r z v s a.val d.val.val*ShortDraftTrace.breveE (-ninthCuspFrequency h*z))) : (∑'d:PrimaryCoprimeDenominator a,∫z in periodDomain, affineLowerTerm q r z v s a.val d.val.val*ShortDraftTrace.breveE (-ninthCuspFrequency h*z))=0 := by have hdiv:(3:Eis)∣h+ramifiedAffineParameter j n*q*a.val:=by have ht:=dvd_add hbase (a.2.mul_left (ramifiedAffineParameter j n*q)) convert ht using 1 ;ring obtain ⟨ell,hell⟩:=hdiv have hell':3*ell=h+ramifiedAffineParameter j n*q*a.val:=hell.symm have hne:¬q∣ell:=by rintro ⟨b,hb⟩ have he:q*(3*b)=q*(h1+ramifiedAffineParameter j n*a.val):=by rw [hb,hh] at hell' linear_combination hell' have hc:=mul_left_cancel₀ hq he have ht:(3:Eis)∣h1+ramifiedAffineParameter j n*a.val:=⟨b,hc.symm⟩ apply hfreq have hh:=dvd_sub ht (a.2.mul_left (ramifiedAffineParameter j n)) convert hh using 1 ;ring let e:=(cubicResidueElementEquiv a.val (primaryLower_ne_zero a)).trans (primaryDenominatorEquiv a) have hpair:=e.summable_iff.mpr hsum change Summable (fun p:CubicUnitResidue a.val×Eis=>∫z in periodDomain, affineLowerTerm q r z v s a.val (a.val+3*(GaussianShiftedPartition.representative a.val p.1.val+a.val*p.2))* ShortDraftTrace.breveE (-ninthCuspFrequency h*z)) at hpair rw [←e.tsum_eq] change (∑'p:CubicUnitResidue a.val×Eis,∫z in periodDomain, affineLowerTerm q r z v s a.val (a.val+3*(GaussianShiftedPartition.representative a.val p.1.val+a.val*p.2))* ShortDraftTrace.breveE (-ninthCuspFrequency h*z))=_ rw [hpair.tsum_prod] have hinner (x:CubicUnitResidue a.val): (∑'m:Eis,∫z in periodDomain, affineLowerTerm q r z v s a.val (a.val+3*(GaussianShiftedPartition.representative a.val x.val+a.val*m))* ShortDraftTrace.breveE (-ninthCuspFrequency h*z))=0:=by rw [affineCusp_masked_inner h q r a.val ell _ j n (primaryLower_ne_zero a) (primaryLower_primary a) hq hr hell' v hv s hs,if_neg hne] simp only [hinner,tsum_zero] theorem affineCusp_branch_fourier_masked (h h1 q r:Eis) (j n:ℕ) (hq:q≠0) (hr:r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (hh:h=q*h1) (hbase:(3:Eis)∣h+ramifiedAffineParameter j n*q) (v:ℝ) (hv:0∫z in periodDomain, affineLowerTerm q r z v s p.1.val p.2.val.val*ShortDraftTrace.breveE (-ninthCuspFrequency h*z))) : (∑'p:UnitLowerData,∫z in periodDomain, affineLowerTerm q r z v s p.1.val p.2.val.val*ShortDraftTrace.breveE (-ninthCuspFrequency h*z))= if (3:Eis)∣h1+ramifiedAffineParameter j n then (Ideal.absNorm (Ideal.span {q}):ℂ)*((‖eisEmbedding q‖^2:ℝ):ℂ)^(-s)* ((v:ℂ)^(2-s)*sourceFourierKernel s (ninthCuspFrequency h*v))* ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding q)* unramifiedCubicGaussSeries s (3*r^2*h1) else 0 := by split_ifs with hfreq · exact affineCusp_branch_fourier h h1 q r j n hq hr hh hfreq v hv s hs hsum · rw [hsum.tsum_sigma] simp only [affineDenominator_zero h h1 q r j n _ hq hr hh hbase hfreq v hv s hs (hsum.sigma_factor _),tsum_zero] theorem diagonal_once_eisenstein_fourier (u t:Eisˣ) (j:Fin 3→ℕ) (h:Eis) (h1:Fin 3→Eis) (hr:∀l,(↑u⁻¹:Eis)^2*(onceCuspScale t*omega^l.val)=omega^(j l)*ramifiedTraceLambda ∨ (↑u⁻¹:Eis)^2*(onceCuspScale t*omega^l.val)=-(omega^(j l)*ramifiedTraceLambda)) (hh:∀l,h=(onceCuspScale t*omega^l.val)*h1 l) (hbase:∀l,(3:Eis)∣h+ramifiedAffineParameter (j l) 1*(onceCuspScale t*omega^l.val)) (v:ℝ) (hv:0(onceCuspRayIndex u t l).val) h (onceCuspFrequencyQuotient t h hfreq) (onceCuspRayIndex_spec u t) (onceCuspFrequencyQuotient_spec t h hfreq) (fun l=>onceCusp_period_congruence t l h _ hfreq) v hv s hs, onceCuspGaussSeries,Finset.mul_sum] apply Finset.sum_congr rfl intro l hl split_ifs <;>ring end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Manifold ContDiff open Finset AddChar MulChar EisensteinEmbedding lemma hyperbolicAction_contMDiff (g : SL(2,ℂ)) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,SpatialCoordinates) ∞ (fun w : HyperbolicSpace=>g•w) := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace dsimp only let hyperbolicSpatial_chartAt := fun w => OAI.CubicEisenstein.hyperbolicSpatial_chartAt w intro w rw [contMDiffAt_iff] refine ⟨(continuous_hyperbolic_action g).continuousAt,?_⟩ have hp : hyperbolicSpatialCoordinates w∈hyperbolicSpatialChart.target := hyperbolicSpatialChart.map_source (Set.mem_univ _) have he : (fun p : SpatialCoordinates=>hyperbolicSpatialCoordinates (g•hyperbolicSpatialChart.symm p))=ᶠ[𝓝 (hyperbolicSpatialCoordinates w)]mobiusSpatial g := by filter_upwards [hyperbolicSpatialChart.open_target.mem_nhds hp] with p hpt rw [mobiusSpatial_coordinates_global] exact congrArg (mobiusSpatial g) (hyperbolicSpatialChart.right_inv hpt) have hd := ((mobiusSpatial_contDiffAt g _ (hyperbolicSpatialCoordinates_positive w)).congr_of_eventuallyEq he).contDiffWithinAt (s:=Set.univ) simpa only [extChartAt_coe,extChartAt_coe_symm,modelWithCornersSelf_coe, modelWithCornersSelf_coe_symm,Function.id_comp,Function.comp_id,Set.preimage_id_eq,Set.range_id, hyperbolicSpatial_chartAt,hyperbolicSpatialChart_apply,Function.comp_def,id_eq] using hd lemma kernel_contMDiff_of_lift (f : KernelQuotient→ℂ) (hf : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; let _ : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ (fun w : HyperbolicSpace=>f (integralOrbitProjection globalKubotaKernel w))) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : IsManifold 𝓘(ℝ,SpatialCoordinates) ∞ HyperbolicSpace := hyperbolicSpatialIsManifold dsimp only let hyperbolicSpatial_chartAt := fun w => OAI.CubicEisenstein.hyperbolicSpatial_chartAt w let kernelSpatial_chartAt := fun q => OAI.CubicEisenstein.kernelSpatial_chartAt q intro q have hq : q∈(kernelQuotientChart q).source := mem_chart_source SpatialCoordinates q have hp : kernelQuotientChart q q∈hyperbolicSpatialChart.target := ((kernelQuotientChart q).map_source hq).1 have hs : ContMDiffOn 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,SpatialCoordinates) ∞ hyperbolicSpatialChart.symm hyperbolicSpatialChart.target := by simpa only [hyperbolicSpatial_chartAt] using (contMDiffOn_chart_symm (I:=𝓘(ℝ,SpatialCoordinates)) (n:=∞) (x:=q.out)) have hd := (hf (hyperbolicSpatialChart.symm (kernelQuotientChart q q))).comp _ (hs.contMDiffAt (hyperbolicSpatialChart.open_target.mem_nhds hp)) have he : (fun p=>f ((kernelQuotientChart q).symm p))= (fun p=>f (integralOrbitProjection globalKubotaKernel (hyperbolicSpatialChart.symm p))) := by funext p rw [kernelQuotientChart_symm] have hdc : ContDiffAt ℝ ∞ (fun p=>f ((kernelQuotientChart q).symm p)) (kernelQuotientChart q q) := by rw [he] exact hd.contDiffAt have hc : ContinuousAt f q := by have hc := hdc.continuousAt.comp ((kernelQuotientChart q).continuousOn.continuousAt ((kernelQuotientChart q).open_source.mem_nhds hq)) apply hc.congr filter_upwards [(kernelQuotientChart q).open_source.mem_nhds hq] with r hr exact congrArg f ((kernelQuotientChart q).left_inv hr) rw [contMDiffAt_iff] refine ⟨hc,?_⟩ have hh := hdc.contDiffWithinAt (s:=Set.univ) simpa only [extChartAt_coe,extChartAt_coe_symm,modelWithCornersSelf_coe, modelWithCornersSelf_coe_symm,Function.id_comp,Function.comp_id,Set.range_id, kernelSpatial_chartAt,chartAt_self_eq,OpenPartialHomeomorph.refl_apply,Function.comp_def,id_eq] using hh lemma kernelSource_comp_contMDiff (M : CubicKubota.levelTwo) (f : KernelQuotient→ℂ) (hf : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ (fun q=>f (kernelSourceAction M q)) := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace dsimp only apply kernel_contMDiff_of_lift exact (hf.comp kernelProjection_contMDiff).comp (hyperbolicAction_contMDiff (sourceComplexMatrix M)) def kernelSourceTest (M : CubicKubota.levelTwo) (f : kernelSmoothTests) : kernelSmoothTests := letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology ⟨fun q=>f.1 (kernelSourceAction M q),kernelSource_comp_contMDiff M f.1 f.2.1, f.2.2.comp_homeomorph (kernelSourceHomeomorph M)⟩ def kernelSourceTestLinear (M : CubicKubota.levelTwo) : kernelSmoothTests→ₗ[ℂ]kernelSmoothTests where toFun := kernelSourceTest M map_add' _ _ := rfl map_smul' _ _ := rfl lemma kernelSourceTest_field (M : CubicKubota.levelTwo) (f : kernelSmoothTests) : kernelTestField (kernelSourceTest M f)=kernelTestField f ∘ euclideanAction (sourceComplexMatrix M) := by funext p change f.1 (integralOrbitProjection globalKubotaKernel (sourceComplexMatrix M•euclideanToHyperbolic p))= f.1 (integralOrbitProjection globalKubotaKernel (euclideanToHyperbolic (euclideanAction (sourceComplexMatrix M) p))) rw [euclideanAction,euclideanToHyperbolic_coordinates] lemma kernelSourceTest_energyDensity (M : CubicKubota.levelTwo) (f : kernelSmoothTests) (w : HyperbolicSpace) : kernelTestEnergyDensity (kernelSourceTest M f) w= kernelTestEnergyDensity f (sourceComplexMatrix M•w) := by have hp := hyperbolicHeight_pos w have he : hyperbolicEuclideanCoordinates (sourceComplexMatrix M•w)= euclideanAction (sourceComplexMatrix M) (hyperbolicEuclideanCoordinates w) := by rw [euclideanAction,euclideanToHyperbolic_coordinates] have hR := hyperbolic_cotangent_energy_comp (sourceComplexMatrix M) (fun p : EuclideanSpatial=>(kernelTestField f p).re) (hyperbolicEuclideanCoordinates w) hp ((kernelTestField_re_contDiffAt f _ (euclideanAction_positive _ _)).differentiableAt (by simp)) have hI := hyperbolic_cotangent_energy_comp (sourceComplexMatrix M) (fun p : EuclideanSpatial=>(kernelTestField f p).im) (hyperbolicEuclideanCoordinates w) hp ((kernelTestField_im_contDiffAt f _ (euclideanAction_positive _ _)).differentiableAt (by simp)) unfold kernelTestEnergyDensity euclideanScalarDirichletDensity rw [kernelSourceTest_field,he] exact congrArg₂ (fun a b : ℝ=>a+b) hR hI lemma kernelSourceTest_quotientDensity (M : CubicKubota.levelTwo) (f : kernelSmoothTests) (q : KernelQuotient) : kernelQuotientEnergyDensity (kernelSourceTest M f) q= kernelQuotientEnergyDensity f (kernelSourceAction M q) := by induction q using Quotient.inductionOn with | _ w => exact kernelSourceTest_energyDensity M f w lemma kernelSourceTest_energy (M : CubicKubota.levelTwo) (f : kernelSmoothTests) : kernelDirichletEnergy (kernelSourceTest M f)=kernelDirichletEnergy f := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace let : BorelSpace SourceKernelQuotient := kernelQuotientBorel unfold kernelDirichletEnergy simp_rw [kernelSourceTest_quotientDensity] exact (kernelSourceAction_measurePreserving M).integral_comp (kernelSourceHomeomorph M).measurableEmbedding _ lemma kernelSourceTest_mass (M : CubicKubota.levelTwo) (f : kernelSmoothTests) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSmoothTestsToL2 (kernelSourceTest M f)=kernelSourcePullback M (kernelSmoothTestsToL2 f) := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace apply Lp.ext have hbase := (kernelSourceAction_measurePreserving M).quasiMeasurePreserving.ae_eq_comp (kernelSmoothTests_memLp f).coeFn_toLp filter_upwards [(kernelSmoothTests_memLp (kernelSourceTest M f)).coeFn_toLp, kernelSourcePullback_ae_eq M (kernelSmoothTestsToL2 f),hbase] with q hnew hpull hbase exact hnew.trans (hpull.trans hbase).symm lemma kernelSourceTest_graph_norm (M : CubicKubota.levelTwo) (f : kernelSmoothTests) : ‖kernelEnergyGraphCore (kernelSourceTest M f)‖=‖kernelEnergyGraphCore f‖ := by apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp rw [kernelEnergyGraphCore_norm_sq,kernelEnergyGraphCore_norm_sq, kernelSourceTest_energy,kernelSourceTest_mass,LinearIsometry.norm_map] def kernelSourceEnergyPullback (M : CubicKubota.levelTwo) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelEnergyGraph→ₗᵢ[ℂ]KernelEnergyGraph := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI thirdWitness1 := @OAI.CubicEisenstein.kernelEnergyGraph_complete exact { toLinearMap := (kernelEnergyGraphCore.comp (kernelSourceTestLinear M)).extendOfNorm kernelEnergyGraphCore norm_map' := by refine kernelEnergyGraphCore_dense.induction ?_ (isClosed_eq (by fun_prop) continuous_norm) rintro x ⟨y, rfl⟩ change ‖(kernelEnergyGraphCore.comp (kernelSourceTestLinear M)).extendOfNorm kernelEnergyGraphCore (kernelEnergyGraphCore y)‖=‖kernelEnergyGraphCore y‖ rw [LinearMap.extendOfNorm_eq kernelEnergyGraphCore_dense (by use 1 intro f change ‖kernelEnergyGraphCore (kernelSourceTest M f)‖ ≤ 1*‖kernelEnergyGraphCore f‖ rw [kernelSourceTest_graph_norm, one_mul])] exact kernelSourceTest_graph_norm M y } lemma kernelSourceEnergyPullback_core (M : CubicKubota.levelTwo) (f : kernelSmoothTests) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSourceEnergyPullback M (kernelEnergyGraphCore f)=kernelEnergyGraphCore (kernelSourceTest M f) := letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI thirdWitness1 := @OAI.CubicEisenstein.kernelEnergyGraph_complete LinearMap.extendOfNorm_eq kernelEnergyGraphCore_dense ⟨1, fun y=>by change ‖kernelEnergyGraphCore (kernelSourceTest M y)‖ ≤ 1*‖kernelEnergyGraphCore y‖ rw [kernelSourceTest_graph_norm, one_mul]⟩ f lemma kernelSourceEnergyPullback_mass (M : CubicKubota.levelTwo) (u : KernelEnergyGraph) : kernelEnergyMass (kernelSourceEnergyPullback M u)=kernelSourcePullback M (kernelEnergyMass u) := by apply congrFun (kernelEnergyGraphCore_dense.equalizer (kernelEnergyMass.continuous.comp (kernelSourceEnergyPullback M).continuous) ((kernelSourcePullback M).continuous.comp kernelEnergyMass.continuous) ?_) u funext f change kernelEnergyMass (kernelSourceEnergyPullback M (kernelEnergyGraphCore f))= kernelSourcePullback M (kernelEnergyMass (kernelEnergyGraphCore f)) rw [kernelSourceEnergyPullback_core,kernelEnergyMass_core,kernelEnergyMass_core,kernelSourceTest_mass] end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups InnerProductSpace open Finset AddChar MulChar EisensteinEmbedding lemma kernelSourceEnergyPullback_inverse (M : CubicKubota.levelTwo) (u : KernelEnergyGraph) : kernelSourceEnergyPullback M (kernelSourceEnergyPullback M⁻¹ u)=u := by apply kernelEnergyMass_injective rw [kernelSourceEnergyPullback_mass,kernelSourceEnergyPullback_mass, kernelSourcePullback_comp,inv_mul_cancel,kernelSourcePullback_one] lemma kernelSourceEnergyPullback_surjective (M : CubicKubota.levelTwo) : Function.Surjective (kernelSourceEnergyPullback M) := fun u=>⟨kernelSourceEnergyPullback M⁻¹ u,kernelSourceEnergyPullback_inverse M u⟩ theorem kernelSource_variationalSolution (M : CubicKubota.levelTwo) (F : KernelQuotientL2) : kernelSourceEnergyPullback M (kernelVariationalSolution F)= kernelVariationalSolution (kernelSourcePullback M F) := by apply kernelVariationalSolution_unique intro v obtain ⟨w,rfl⟩ := kernelSourceEnergyPullback_surjective M v rw [←kernelEnergyGraph_inner,LinearIsometry.inner_map_map, kernelSourceEnergyPullback_mass,LinearIsometry.inner_map_map,kernelEnergyGraph_inner] exact kernelVariationalSolution_equation F w theorem kernelSource_variationalResolvent (M : CubicKubota.levelTwo) (F : KernelQuotientL2) : kernelVariationalResolvent (kernelSourcePullback M F)= kernelSourcePullback M (kernelVariationalResolvent F) := by change kernelEnergyMass (kernelVariationalSolution (kernelSourcePullback M F))= kernelSourcePullback M (kernelEnergyMass (kernelVariationalSolution F)) rw [←kernelSource_variationalSolution,kernelSourceEnergyPullback_mass] theorem kernelSource_operatorGraph (M : CubicKubota.levelTwo) (F G : KernelQuotientL2) (hFG : (F,G)∈kernelEnergyLaplacian.graph) : (kernelSourcePullback M F,kernelSourcePullback M G)∈kernelEnergyLaplacian.graph := by rw [kernelEnergyLaplacian_graph,mem_kernelLaplacianGraph] at hFG ⊢ rw [←map_add,kernelSource_variationalResolvent,hFG] theorem kernelSource_eigenvector (M : CubicKubota.levelTwo) (F : KernelQuotientL2) (eigenvalue : ℂ) (hF : (F,eigenvalue • F)∈kernelEnergyLaplacian.graph) : (kernelSourcePullback M F,eigenvalue • kernelSourcePullback M F)∈kernelEnergyLaplacian.graph := by simpa only [map_smul] using kernelSource_operatorGraph M F (eigenvalue • F) hF end CubicEisenstein section open scoped Classical MatrixGroups BigOperators namespace CubicKubota open ActualEisensteinCubic ConcreteTraceCRT CubicEisenstein CubicJacobiGlobal namespace RootNotationIntegralCover02 abbrev Eis := ActualEisensteinCubic.O end RootNotationIntegralCover02 open RootNotationIntegralCover02 (Eis) def cubeCuspHeightWeight (p:Eis) (j:Fin 4) : ℂ := (((Ideal.absNorm (Ideal.span {p}):ℝ)^((2*(j.val:ℝ)-3)/3)):ℝ) lemma cubeCuspHeightWeight_zero (p:Eis) : cubeCuspHeightWeight p 0=(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹ := by unfold cubeCuspHeightWeight generalize Ideal.absNorm (Ideal.span {p}) = n norm_num [Real.rpow_neg_one] lemma cubeCuspHeightWeight_three (p:Eis) : cubeCuspHeightWeight p 3=(Ideal.absNorm (Ideal.span {p}):ℂ) := by unfold cubeCuspHeightWeight generalize Ideal.absNorm (Ideal.span {p}) = n norm_num theorem actualCubeCuspPhaseSum_height (A:levelTwo) (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (hA:lambda^2∣((A:SL(2,Eis)) 0 0)-1) : actualCubeCuspPhaseSum A p hp hprimary (cubeCuspHeightWeight p)= (Ideal.absNorm (Ideal.span {p}):ℂ)^2 := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO have hqN:Ideal.absNorm (Ideal.span {p})≠0:= (Ideal.absNorm_ne_zero_iff _).mpr (finite_quotient_span hp.ne_zero) have hq:(Ideal.absNorm (Ideal.span {p}):ℂ)≠0:=by exact_mod_cast hqN by_cases hc:p∣((A:SL(2,Eis)) 1 0) · rw [actualCubeCuspPhaseSum_dvd A p hp hprimary hA hc, cubeCuspHeightWeight_zero] field_simp · have hcop:IsCoprime ((A:SL(2,Eis)) 1 0) p:=(hp.coprime_iff_not_dvd.mpr hc).symm rw [actualCubeCuspPhaseSum_coprime A p hp hprimary hA hcop, cubeCuspHeightWeight_zero,cubeCuspHeightWeight_three] field_simp ; ring theorem actualCubeCuspPhaseSum_normalized (A:levelTwo) (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) (hA:lambda^2∣((A:SL(2,Eis)) 0 0)-1) : (Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹^3 * actualCubeCuspPhaseSum A p hp hprimary (cubeCuspHeightWeight p)= (Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹ := by have hqN:Ideal.absNorm (Ideal.span {p})≠0:= (Ideal.absNorm_ne_zero_iff _).mpr (finite_quotient_span hp.ne_zero) have hq:(Ideal.absNorm (Ideal.span {p}):ℂ)≠0:=by exact_mod_cast hqN rw [actualCubeCuspPhaseSum_height A p hp hprimary hA] field_simp end CubicKubota namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota namespace RootNotationIntegralCover03 abbrev Eis := ActualEisensteinCubic.O end RootNotationIntegralCover03 open RootNotationIntegralCover03 (Eis) def cubeDilationRoot (p:Eis) : ℂ := Classical.choose (IsAlgClosed.exists_pow_nat_eq (eisEmbedding p^3) (by decide : 0<2)) lemma cubeDilationRoot_sq (p:Eis) : cubeDilationRoot p^2=eisEmbedding p^3 := Classical.choose_spec (IsAlgClosed.exists_pow_nat_eq (eisEmbedding p^3) (by decide : 0<2)) lemma cubeDilationRoot_ne_zero (p:Eis) (hp:p≠0) : cubeDilationRoot p≠0 := by intro h have hs:=cubeDilationRoot_sq p rw [h,zero_pow (by decide)] at hs exact pow_ne_zero 3 (eisEmbedding_ne_zero hp) hs.symm def cubeAverageMatrix (p:Eis) (hp:p≠0) (q:Eis) : SL(2,ℂ) := complexDiagonal (cubeDilationRoot p)⁻¹ (inv_ne_zero (cubeDilationRoot_ne_zero p hp)) * complexTranslation (3*eisEmbedding q) lemma cubeAverageMatrix_entries (p:Eis) (hp:p≠0) (q:Eis) : (cubeAverageMatrix p hp q : Matrix (Fin 2) (Fin 2) ℂ)= !![(cubeDilationRoot p)⁻¹,(cubeDilationRoot p)⁻¹*(3*eisEmbedding q);0,cubeDilationRoot p] := by unfold cubeAverageMatrix rw [Matrix.SpecialLinearGroup.coe_mul] apply Matrix.ext intro i j fin_cases i <;> fin_cases j <;> simp [complexDiagonal, complexTranslation, Matrix.mul_apply, Fin.sum_univ_two] lemma cubeAverageMatrix_add_multiple (p:Eis) (hp:p≠0) (q n:Eis) : cubeAverageMatrix p hp (q+p^3*n)= complexTranslation (3*eisEmbedding n)*cubeAverageMatrix p hp q := by apply Subtype.ext simp only [Matrix.SpecialLinearGroup.coe_mul, cubeAverageMatrix_entries] apply Matrix.ext intro i j have hz := cubeDilationRoot_ne_zero p hp have he := cubeDilationRoot_sq p fin_cases i <;> fin_cases j <;> simp [Matrix.mul_apply, Fin.sum_univ_two, complexTranslation, map_add, map_mul, map_pow] rw [← he] field_simp lemma cubeAverageMatrix_translate_one (p:Eis) (hp:p≠0) (q t:Eis) (ht:3*t=1-p^3) : cubeAverageMatrix p hp q*complexTranslation 1= complexTranslation 1*cubeAverageMatrix p hp (q+t) := by have ht':3*eisEmbedding t=1-eisEmbedding p^3:=by simpa only [map_mul,map_sub,map_one,map_ofNat,map_pow] using congrArg eisEmbedding ht have hz:=cubeDilationRoot_ne_zero p hp have he:=cubeDilationRoot_sq p apply Subtype.ext simp only [Matrix.SpecialLinearGroup.coe_mul, cubeAverageMatrix_entries] apply Matrix.ext intro i j fin_cases i <;> fin_cases j <;> simp [Matrix.mul_apply, Fin.sum_univ_two, complexTranslation, map_add] field_simp linear_combination -ht'-he def cubeAverage (p:Eis) (hp:p≠0) (F:HyperbolicSpace→ℂ) (w:HyperbolicSpace) : ℂ := (Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹^3 * ∑' r:Eis⧸Ideal.span {p^3}, F (cubeAverageMatrix p hp (GaussianShiftedPartition.representative (p^3) r) • w) lemma cubeAverage_summand_congr (p:Eis) (hp:p≠0) (F:HyperbolicSpace→ℂ) (hF:∀n:Eis,∀w:HyperbolicSpace,F (complexTranslation (3*eisEmbedding n) • w)=F w) (a b:Eis) (hab:p^3∣a-b) (w:HyperbolicSpace) : F (cubeAverageMatrix p hp a • w)=F (cubeAverageMatrix p hp b • w) := by obtain ⟨n,hn⟩:=hab have ha:a=b+p^3*n:=by linear_combination hn rw [ha,cubeAverageMatrix_add_multiple,mul_smul,hF] end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota namespace RootNotationIntegralCover04 abbrev Eis := ActualEisensteinCubic.O end RootNotationIntegralCover04 open RootNotationIntegralCover04 (Eis) lemma cubeAverageMatrix_action (p:Eis) (hp:p≠0) (q:Eis) (z:ℂ) (v:ℝ) (hv:0r+Ideal.Quotient.mk _ t invFun:=fun r=>r-Ideal.Quotient.mk _ t left_inv:=fun r=>add_sub_cancel_right r _ right_inv:=fun r=>sub_add_cancel r _ } let f (r:Eis⧸Ideal.span {p^3}):= F (cubeAverageMatrix p hp (GaussianShiftedPartition.representative (p^3) r) • w) have hpoint (r:Eis⧸Ideal.span {p^3}): F (cubeAverageMatrix p hp (GaussianShiftedPartition.representative (p^3) r) • (complexTranslation 1 • w))=f (a r) := by rw [←mul_smul,cubeAverageMatrix_translate_one p hp _ t ht.symm,mul_smul,hF1] apply cubeAverage_summand_congr p hp F hF apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp rw [map_add,GaussianShiftedPartition.representative_spec, GaussianShiftedPartition.representative_spec] rfl unfold cubeAverage congr 1 calc _ = ∑' r,f (a r):=tsum_congr hpoint _ = ∑' r,f r:=a.tsum_eq f end CubicEisenstein end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise open Finset AddChar MulChar EisensteinEmbedding namespace CubicEisenstein namespace RootNotationIntegralCover05 abbrev O := ActualEisensteinCubic.O end RootNotationIntegralCover05 open RootNotationIntegralCover05 (O) def integralCoverMap {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) : IntegralOrbitQuotient H→IntegralOrbitQuotient K := Quotient.map' id (by rintro w u ⟨M,hM⟩ exact ⟨Subgroup.inclusion hHK M,hM⟩) lemma integralCoverMap_projection {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (w : HyperbolicSpace) : integralCoverMap hHK (integralOrbitProjection H w)=integralOrbitProjection K w := rfl lemma integralCoverMap_measurable {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measurable (integralCoverMap hHK) := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace apply measurable_from_quotient.mpr exact measurable_integralOrbitProjection K lemma integralCoverMap_continuous {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology Continuous (integralCoverMap hHK) := letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology continuous_id.quotient_map' _ abbrev IntegralCoverCosets (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) := K ⧸ H.subgroupOf K def integralCoverRep (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) : K := q.out def integralCoverSheet (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) : Set HyperbolicSpace := letI := integralSubgroupHyperbolicAction K (fun w=>integralCoverRep H K q • w) ⁻¹' hyperbolicFundamentalSet K def integralCoverDomain (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) : Set HyperbolicSpace := ⋃q : IntegralCoverCosets H K,integralCoverSheet H K q lemma integralCoverSheet_measurable (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace MeasurableSet (integralCoverSheet H K q) := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace let := integralSubgroupHyperbolicAction K let := integralSubgroupMeasurableAction K exact (measurable_const_smul (integralCoverRep H K q)) (hyperbolicFundamentalSet_measurable K) lemma integralCoverDomain_measurable (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) [H.IsFiniteRelIndex K] : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace MeasurableSet (integralCoverDomain H K) := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ exact MeasurableSet.iUnion (integralCoverSheet_measurable H K) lemma fundamental_reduction_unique (K : Subgroup (SL(2,ActualEisensteinCubic.O))) (hK : K≤CubicKubota.levelThree) (r s : K) (w : HyperbolicSpace) (hr : letI := integralSubgroupHyperbolicAction K r•w∈hyperbolicFundamentalSet K) (hs : letI := integralSubgroupHyperbolicAction K s•w∈hyperbolicFundamentalSet K) : r=s := by let := integralSubgroupHyperbolicAction K have he : s•w=r•w := by have hh := hyperbolicFundamentalSet_orbit_unique K (r•w) hr (s*r⁻¹) (by simpa only [mul_smul,inv_smul_smul] using hs) simpa only [mul_smul,inv_smul_smul] using hh have hfix : (r⁻¹*s)•w=w := by rw [mul_smul,he,inv_smul_smul] exact inv_mul_eq_one.mp (subgroup_action_free K hK _ w hfix) lemma integralCoverSheet_pairwiseDisjoint (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (hK : K≤CubicKubota.levelThree) : Pairwise (fun q r=>Disjoint (integralCoverSheet H K q) (integralCoverSheet H K r)) := by intro q r hqr apply Set.disjoint_left.mpr intro w hwq hwr have he := fundamental_reduction_unique K hK (integralCoverRep H K q) (integralCoverRep H K r) w hwq hwr apply hqr exact Quotient.out_injective he lemma integralCoverRep_mul_projection {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (q : IntegralCoverCosets H K) (h : H) : ((integralCoverRep H K q*Subgroup.inclusion hHK h : K) : IntegralCoverCosets H K)=q := by rw [QuotientGroup.mk_mul_of_mem _ (show Subgroup.inclusion hHK h∈H.subgroupOf K from h.property)] exact QuotientGroup.out_eq' q lemma integralCover_inclusion_smul {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (h : H) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction H letI := integralSubgroupHyperbolicAction K (Subgroup.inclusion hHK h)•w=h•w := rfl private lemma mul_smul_mem_set_iff {G X : Type*} [Monoid G] [MulAction G X] (a b : G) (w v : X) (hv : v = b • w) (S : Set X) : a • v ∈ S ↔ (a * b) • w ∈ S := by rw [hv, mul_smul] private lemma mem_integralCoverSheet (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction K w ∈ integralCoverSheet H K q ↔ integralCoverRep H K q • w ∈ hyperbolicFundamentalSet K := Iff.rfl lemma integralCoverSheet_membership {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (q : IntegralCoverCosets H K) (h : H) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction H letI := integralSubgroupHyperbolicAction K h•w∈integralCoverSheet H K q ↔ (integralCoverRep H K q*Subgroup.inclusion hHK h)•w∈hyperbolicFundamentalSet K := by let := integralSubgroupHyperbolicAction H let := integralSubgroupHyperbolicAction K exact (mem_integralCoverSheet H K q (h • w)).trans (mul_smul_mem_set_iff (integralCoverRep H K q) (Subgroup.inclusion hHK h) w (h • w) (integralCover_inclusion_smul hHK h w).symm (hyperbolicFundamentalSet K)) lemma integralCoverDomain_covers {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction H ∃h : H,h•w∈integralCoverDomain H K := by let := integralSubgroupHyperbolicAction H let := integralSubgroupHyperbolicAction K obtain ⟨k,hk⟩ := hyperbolicFundamentalSet_covers K w let q : IntegralCoverCosets H K := k let r := integralCoverRep H K q have hr : r⁻¹*k∈H.subgroupOf K := QuotientGroup.eq.mp (QuotientGroup.out_eq' q) let h : H := ⟨((r⁻¹*k:K):SL(2,ActualEisensteinCubic.O)),hr⟩ have hin : Subgroup.inclusion hHK h=r⁻¹*k := rfl refine ⟨h,Set.mem_iUnion.mpr ⟨q,?_⟩⟩ apply (integralCoverSheet_membership hHK q h w).mpr change (r*Subgroup.inclusion hHK h)•w∈hyperbolicFundamentalSet K rw [hin,mul_inv_cancel_left] exact hk lemma integralCoverDomain_unique {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) (w : HyperbolicSpace) (h1 h2 : H) (hh1 : letI := integralSubgroupHyperbolicAction H h1•w∈integralCoverDomain H K) (hh2 : letI := integralSubgroupHyperbolicAction H h2•w∈integralCoverDomain H K) : h1=h2 := by let := integralSubgroupHyperbolicAction H let := integralSubgroupHyperbolicAction K obtain ⟨q1,hq1⟩ := Set.mem_iUnion.mp hh1 obtain ⟨q2,hq2⟩ := Set.mem_iUnion.mp hh2 have he : integralCoverRep H K q1*Subgroup.inclusion hHK h1= integralCoverRep H K q2*Subgroup.inclusion hHK h2 := by apply fundamental_reduction_unique K hK _ _ w · exact (integralCoverSheet_membership hHK q1 h1 w).mp hq1 · exact (integralCoverSheet_membership hHK q2 h2 w).mp hq2 have hqeq : q1=q2 := by have hproj := congrArg (fun k : K=>(k : IntegralCoverCosets H K)) he rw [integralCoverRep_mul_projection hHK q1 h1, integralCoverRep_mul_projection hHK q2 h2] at hproj exact hproj subst q2 exact (Subgroup.inclusion_injective hHK) (mul_left_cancel he) theorem integralCoverDomain_isFundamentalDomain {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI := integralSubgroupHyperbolicAction H IsFundamentalDomain H (integralCoverDomain H K) hyperbolicVolume := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace let := integralSubgroupHyperbolicAction H let := integralSLCountable apply IsFundamentalDomain.mk' (integralCoverDomain_measurable H K).nullMeasurableSet intro w obtain ⟨h,hh⟩ := integralCoverDomain_covers hHK w exact ⟨h,hh,fun g hg=>integralCoverDomain_unique hHK hK w g h hg hh⟩ end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CoverTrace /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise ENNReal InnerProductSpace open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationCoverTrace01 abbrev O := ActualEisensteinCubic.O end RootNotationCoverTrace01 open RootNotationCoverTrace01 (O) lemma integralCoverSheet_measure (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) (S : Set (IntegralOrbitQuotient K)) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hS : MeasurableSet S), hyperbolicVolume ((integralOrbitProjection K) ⁻¹' S ∩ integralCoverSheet H K q)= integralQuotientVolume K S := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hS : MeasurableSet S) => by let := integralSubgroupHyperbolicAction K let := integralSubgroupVolumeInvariant K have he : (integralOrbitProjection K) ⁻¹' S ∩ integralCoverSheet H K q= (fun w=>integralCoverRep H K q • w) ⁻¹' ((integralOrbitProjection K) ⁻¹' S ∩ hyperbolicFundamentalSet K) := by ext w change (integralOrbitProjection K w∈S ∧ integralCoverRep H K q•w∈hyperbolicFundamentalSet K) ↔ (integralOrbitProjection K (integralCoverRep H K q•w)∈S ∧ integralCoverRep H K q•w∈hyperbolicFundamentalSet K) rw [integralSubgroup_smul,integralOrbitProjection_eq] rw [he,measure_preimage_smul] rw [integralQuotientVolume,Measure.map_apply (measurable_integralOrbitProjection K) hS, Measure.restrict_apply ((measurable_integralOrbitProjection K) hS)] theorem integralCoverMap_measure {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measure.map (integralCoverMap hHK) (integralQuotientVolume H)= (H.relIndex K:ℝ≥0∞) • integralQuotientVolume K := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ have hH : H≤CubicKubota.levelThree := hHK.trans hK rw [←integralQuotientVolume_independent H hH (integralCoverDomain H K) (integralCoverDomain_isFundamentalDomain hHK hK)] rw [Measure.map_map (integralCoverMap_measurable hHK) (measurable_integralOrbitProjection H)] change Measure.map (integralOrbitProjection K) (hyperbolicVolume.restrict (integralCoverDomain H K))=_ apply Measure.ext intro S hS rw [Measure.map_apply (measurable_integralOrbitProjection K) hS, Measure.restrict_apply ((measurable_integralOrbitProjection K) hS),Measure.smul_apply,smul_eq_mul] rw [integralCoverDomain,Set.inter_iUnion] rw [measure_iUnion] · simp_rw [integralCoverSheet_measure H K _ S hS] rw [tsum_fintype] simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul] congr 1 rw [Subgroup.relIndex,Subgroup.index,Nat.card_eq_fintype_card] · intro q r hqr exact (integralCoverSheet_pairwiseDisjoint H K hK hqr).mono Set.inter_subset_right Set.inter_subset_right · intro q exact ((measurable_integralOrbitProjection K) hS).inter (integralCoverSheet_measurable H K q) lemma integralCoverMap_measurePreserving {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace MeasurePreserving (integralCoverMap hHK) (integralQuotientVolume H) ((H.relIndex K:ℝ≥0∞) • integralQuotientVolume K) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ⟨integralCoverMap_measurable hHK,integralCoverMap_measure hHK hK⟩ end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise ENNReal InnerProductSpace InnerProduct open Finset AddChar MulChar EisensteinEmbedding section namespace RootNotationCoverTrace02 abbrev O := ActualEisensteinCubic.O end RootNotationCoverTrace02 open RootNotationCoverTrace02 (O) abbrev IntegralQuotientL2 (H : Subgroup (SL(2,ActualEisensteinCubic.O))) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Lp ℂ 2 (integralQuotientVolume H) def integralCoverPullback {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace IntegralQuotientL2 K→L[ℂ]IntegralQuotientL2 H := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (Lp.compMeasurePreservingₗᵢ ℂ (integralCoverMap hHK) (integralCoverMap_measurePreserving hHK hK)).toContinuousLinearMap.comp (dominatedComplexL2 (by simp : (H.relIndex K:ℝ≥0∞)≠⊤) le_rfl) theorem integralCoverPullback_ae {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] (F : IntegralQuotientL2 K) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace integralCoverPullback hHK hK F=ᵐ[integralQuotientVolume H] fun q=>F (integralCoverMap hHK q) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hm := integralCoverMap_measurePreserving hHK hK have he := dominatedComplexL2_ae (by simp : (H.relIndex K:ℝ≥0∞)≠⊤) (le_rfl : (H.relIndex K:ℝ≥0∞) • integralQuotientVolume K≤ (H.relIndex K:ℝ≥0∞) • integralQuotientVolume K) F exact (Lp.coeFn_compMeasurePreserving _ hm).trans (hm.quasiMeasurePreserving.ae_eq_comp he) theorem integralCoverPullback_norm_le {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] (F : IntegralQuotientL2 K) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ‖integralCoverPullback hHK hK F‖≤(H.relIndex K:ℝ)^((1:ℝ)/2)*‖F‖ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by change ‖Lp.compMeasurePreserving (integralCoverMap hHK) (integralCoverMap_measurePreserving hHK hK) (dominatedComplexL2 (by simp : (H.relIndex K:ℝ≥0∞)≠⊤) le_rfl F)‖≤_ rw [Lp.norm_compMeasurePreserving] simpa only [ENNReal.toReal_natCast] using dominatedComplexL2_norm_le (by simp : (H.relIndex K:ℝ≥0∞)≠⊤) (le_rfl : (H.relIndex K:ℝ≥0∞) • integralQuotientVolume K≤ (H.relIndex K:ℝ≥0∞) • integralQuotientVolume K) F def integralCoverTrace {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace IntegralQuotientL2 H→L[ℂ]IntegralQuotientL2 K := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ContinuousLinearMap.adjoint (integralCoverPullback hHK hK) theorem integralCoverTrace_pairing {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] (F : IntegralQuotientL2 K) (G : IntegralQuotientL2 H) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ⟪F,integralCoverTrace hHK hK G⟫_ℂ=⟪integralCoverPullback hHK hK F,G⟫_ℂ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ContinuousLinearMap.adjoint_inner_right _ _ _ theorem integralCoverPullback_opNorm_le {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ‖integralCoverPullback hHK hK‖≤(H.relIndex K:ℝ)^((1:ℝ)/2) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply ContinuousLinearMap.opNorm_le_bound _ (Real.rpow_nonneg (Nat.cast_nonneg _) _) exact integralCoverPullback_norm_le hHK hK theorem integralCoverTrace_opNorm_le {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ‖integralCoverTrace hHK hK‖≤(H.relIndex K:ℝ)^((1:ℝ)/2) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [integralCoverTrace,ContinuousLinearMap.adjoint.norm_map] exact integralCoverPullback_opNorm_le hHK hK end namespace RootNotationCoverTrace03 abbrev O := ActualEisensteinCubic.O end RootNotationCoverTrace03 open RootNotationCoverTrace03 (O) def integralCoverFiberPoint (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) (w : HyperbolicSpace) : IntegralOrbitQuotient H := letI := integralSubgroupHyperbolicAction K Quotient.liftOn' q (fun r : K=>integralOrbitProjection H (r⁻¹•w)) (by intro a b hab have hh : b⁻¹*a∈H.subgroupOf K := by have h : a⁻¹*b∈H.subgroupOf K := QuotientGroup.leftRel_apply.mp hab simpa only [mul_inv_rev,inv_inv] using (H.subgroupOf K).inv_mem h apply Quotient.sound refine ⟨⟨((b⁻¹*a:K):SL(2,ActualEisensteinCubic.O)),hh⟩,?_⟩ change (b⁻¹*a)•(a⁻¹•w)=b⁻¹•w simp only [mul_smul,smul_inv_smul]) lemma integralCoverFiberPoint_mk (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (r : K) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction K integralCoverFiberPoint H K r w=integralOrbitProjection H (r⁻¹•w) := rfl lemma integralCoverFiberPoint_rep (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction K integralCoverFiberPoint H K q w= integralOrbitProjection H ((integralCoverRep H K q)⁻¹•w) := by conv_lhs => rw [←QuotientGroup.out_eq' q] rfl lemma integralCoverFiberPoint_smul (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) (k : K) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction K integralCoverFiberPoint H K (k•q) (k•w)=integralCoverFiberPoint H K q w := by let := integralSubgroupHyperbolicAction K induction q using Quotient.inductionOn with | _ r => change integralOrbitProjection H ((k*r)⁻¹•(k•w))=integralOrbitProjection H (r⁻¹•w) rw [mul_inv_rev,mul_smul,inv_smul_smul] lemma integralCoverFiberPoint_measurable (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measurable (integralCoverFiberPoint H K q) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by let := integralSubgroupHyperbolicAction K let := integralSubgroupMeasurableAction K have he : integralCoverFiberPoint H K q=fun w=> integralOrbitProjection H ((integralCoverRep H K q)⁻¹•w) := funext (integralCoverFiberPoint_rep H K q) rw [he] exact (measurable_integralOrbitProjection H).comp (measurable_const_smul _) def integralCoverTraceLift (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) (w : HyperbolicSpace) : ℂ := letI : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ ∑q : IntegralCoverCosets H K,f (integralCoverFiberPoint H K q w) lemma integralCoverTraceLift_smul (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) (k : K) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction K integralCoverTraceLift H K f (k•w)=integralCoverTraceLift H K f w := by let := integralSubgroupHyperbolicAction K let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ unfold integralCoverTraceLift rw [←(MulAction.bijective k).sum_comp (fun q=>f (integralCoverFiberPoint H K q (k•w)))] simp only [integralCoverFiberPoint_smul] def integralCoverTraceFunction (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) : IntegralOrbitQuotient K→ℂ := Quotient.lift (integralCoverTraceLift H K f) (by rintro w u ⟨k,rfl⟩ exact (integralCoverTraceLift_smul H K f k w).symm) lemma integralCoverTraceFunction_measurable (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hf : Measurable f), Measurable (integralCoverTraceFunction H K f) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hf : Measurable f) => by let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ apply measurable_from_quotient.mpr change Measurable (integralCoverTraceLift H K f) unfold integralCoverTraceLift exact Finset.measurable_sum Finset.univ (fun q _=>hf.comp (integralCoverFiberPoint_measurable H K q)) end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise ENNReal open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationCoverTrace04 abbrev O := ActualEisensteinCubic.O end RootNotationCoverTrace04 open RootNotationCoverTrace04 (O) def IntegralCoverIntertwines {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) : Prop := ∀h : H,g*integralComplexMatrix (h:SL(2,ActualEisensteinCubic.O))= integralComplexMatrix (e h:SL(2,ActualEisensteinCubic.O))*g lemma integralCoverIntertwines_action {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (h : H) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction H letI := integralSubgroupHyperbolicAction J g•(h•w)=(e h)•(g•w) := by let := integralSubgroupHyperbolicAction H let := integralSubgroupHyperbolicAction J rw [integralSubgroup_smul,integralSubgroup_smul,←mul_smul,he, mul_smul] lemma integralCoverIntertwines_inverse {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) : IntegralCoverIntertwines e.symm g⁻¹ := by intro j have hh := he (e.symm j) rw [e.apply_symm_apply] at hh have hh' := congrArg (fun A : SL(2,ℂ)=>g⁻¹*A*g⁻¹) hh simpa only [mul_assoc,inv_mul_cancel_left,mul_inv_cancel_right,mul_inv_cancel,mul_one] using hh'.symm def integralConjugateMap {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) : IntegralOrbitQuotient H→IntegralOrbitQuotient J := Quotient.map' (fun w=>g•w) (by rintro w u ⟨h,rfl⟩ exact ⟨e h,(integralCoverIntertwines_action e g he h w).symm⟩) lemma integralConjugateMap_projection {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (w : HyperbolicSpace) : integralConjugateMap e g he (integralOrbitProjection H w)= integralOrbitProjection J (g•w) := rfl lemma integralConjugateMap_measurable {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_fullSLMeasurableAction := @OAI.CubicEisenstein.fullSLMeasurableAction Measurable (integralConjugateMap e g he) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_fullSLMeasurableAction := @OAI.CubicEisenstein.fullSLMeasurableAction by apply measurable_from_quotient.mpr exact (measurable_integralOrbitProjection J).comp (measurable_const_smul g) lemma integralConjugateMap_continuous {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Continuous (integralConjugateMap e g he) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology (continuous_hyperbolic_action g).quotient_map' _ lemma integralConjugateMap_inverse {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (q : IntegralOrbitQuotient H) : integralConjugateMap e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) (integralConjugateMap e g he q)=q := by induction q using Quotient.inductionOn with | _ w => change integralOrbitProjection H (g⁻¹•(g•w))=integralOrbitProjection H w rw [inv_smul_smul] def integralConjugateHomeomorph {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology IntegralOrbitQuotient H≃ₜIntegralOrbitQuotient J := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology { toFun := integralConjugateMap e g he invFun := integralConjugateMap e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) left_inv := integralConjugateMap_inverse e g he right_inv q := by induction q using Quotient.inductionOn with | _ w => change integralOrbitProjection J (g•(g⁻¹•w))=integralOrbitProjection J w rw [smul_inv_smul] continuous_toFun := integralConjugateMap_continuous e g he continuous_invFun := integralConjugateMap_continuous e.symm g⁻¹ _ } lemma integralConjugate_fundamentalDomain {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (hH : H≤CubicKubota.levelThree) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_fullSLMeasurableAction := @OAI.CubicEisenstein.fullSLMeasurableAction letI rootPolicy_fullSLVolumeInvariant := @OAI.CubicEisenstein.fullSLVolumeInvariant letI := integralSubgroupHyperbolicAction J IsFundamentalDomain J ((fun w : HyperbolicSpace=>g•w) '' hyperbolicFundamentalSet H) hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_fullSLMeasurableAction := @OAI.CubicEisenstein.fullSLMeasurableAction letI rootPolicy_fullSLVolumeInvariant := @OAI.CubicEisenstein.fullSLVolumeInvariant by let := integralSubgroupHyperbolicAction H let := integralSubgroupHyperbolicAction J apply (hyperbolicFundamentalSet_isFundamentalDomain H hH).image_of_equiv (MulAction.toPerm g) (show Measure.QuasiMeasurePreserving (MulAction.toPerm g).symm hyperbolicVolume hyperbolicVolume from (measurePreserving_smul g⁻¹ hyperbolicVolume).quasiMeasurePreserving) e.symm.toEquiv intro j w change g•(e.symm j•w)=j•(g•w) simpa only [e.apply_symm_apply] using integralCoverIntertwines_action e g he (e.symm j) w theorem integralConjugateMap_measurePreserving {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (hH : H≤CubicKubota.levelThree) (hJ : J≤CubicKubota.levelThree) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_fullSLMeasurableAction := @OAI.CubicEisenstein.fullSLMeasurableAction letI rootPolicy_fullSLVolumeInvariant := @OAI.CubicEisenstein.fullSLVolumeInvariant MeasurePreserving (integralConjugateMap e g he) (integralQuotientVolume H) (integralQuotientVolume J) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_fullSLMeasurableAction := @OAI.CubicEisenstein.fullSLMeasurableAction letI rootPolicy_fullSLVolumeInvariant := @OAI.CubicEisenstein.fullSLVolumeInvariant by refine ⟨integralConjugateMap_measurable e g he,?_⟩ have hmap := (measurePreserving_smul g hyperbolicVolume).restrict_image_emb (measurableEmbedding_const_smul g) (hyperbolicFundamentalSet H) change Measure.map (integralConjugateMap e g he) (Measure.map (integralOrbitProjection H) (hyperbolicVolume.restrict (hyperbolicFundamentalSet H)))=_ rw [Measure.map_map (integralConjugateMap_measurable e g he) (measurable_integralOrbitProjection H)] change Measure.map ((integralOrbitProjection J) ∘ (fun w : HyperbolicSpace=>g•w)) (hyperbolicVolume.restrict (hyperbolicFundamentalSet H))=_ rw [←Measure.map_map (measurable_integralOrbitProjection J) (measurable_const_smul g),hmap.map_eq] exact integralQuotientVolume_independent J hJ _ (integralConjugate_fundamentalDomain e g he hH) def integralConjugatePullback {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (hH : H≤CubicKubota.levelThree) (hJ : J≤CubicKubota.levelThree) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Lp ℂ 2 (integralQuotientVolume J)→ₗᵢ[ℂ]Lp ℂ 2 (integralQuotientVolume H) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Lp.compMeasurePreservingₗᵢ ℂ (integralConjugateMap e g he) (integralConjugateMap_measurePreserving e g he hH hJ) theorem integralConjugatePullback_ae {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (hH : H≤CubicKubota.levelThree) (hJ : J≤CubicKubota.levelThree) (F : Lp ℂ 2 (integralQuotientVolume J)) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace integralConjugatePullback e g he hH hJ F=ᵐ[integralQuotientVolume H] fun q=>F (integralConjugateMap e g he q) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Lp.coeFn_compMeasurePreserving F (integralConjugateMap_measurePreserving e g he hH hJ) end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ConcreteTraceCRT CubicKubota EisensteinCuspModThree namespace RootNotationCoverTrace05 abbrev O := ActualEisensteinCubic.O end RootNotationCoverTrace05 open RootNotationCoverTrace05 (O) lemma scaled_cusp_periodic_upper (F : HyperbolicSpace→ℂ) (v : ℝ) (hv : 0levelTwoComplexCharacter G*w) (scaled_cusp_periodic_upper (fun w=>cubicSourceResidualFunction (integralComplexMatrix (cuspRepresentative j) • w)) v hv (sourceCuspRepresentative_periodic j v hv) T hT n z) _ = _ := (he _).symm lemma sourceCusp_scaled_continuous (M : SL(2,ActualEisensteinCubic.O)) (v : ℝ) (hv : 0cubicSourceResidualFunction (integralComplexMatrix M • upperPoint (3*z) v hv)) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let c : ℂ→UpperCoordinates := fun z=>⟨(3*z,v),hv⟩ have hc : Continuous c := by apply Continuous.subtype_mk exact (continuous_const.mul continuous_id).prodMk continuous_const have ht := (continuous_translatedUpperCoordinates (integralComplexMatrix M)).comp hc have hh : Continuous (fun z : ℂ=>integralComplexMatrix M • upperPoint (3*z) v hv) := by simpa only [Function.comp_def,c] using ht exact cubicSourceResidualFunction_continuous.comp hh end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ConcreteTraceCRT namespace RootNotationCoverTrace06 abbrev O := ActualEisensteinCubic.O end RootNotationCoverTrace06 open RootNotationCoverTrace06 (O) theorem period_integral_eisenstein_affine (f : ℂ→ℂ) (hf : Measurable f) (hp : ∀n : ActualEisensteinCubic.O,∀z : ℂ,f (z+3*eisEmbedding n)=f z) (b : ActualEisensteinCubic.O) (hb : b≠0) (c : ℂ) : (∫z in periodDomain,f (eisEmbedding b*z+c))=∫z in periodDomain,f z := by have hg : Measurable (fun z : ℂ=>f (z+c)) := hf.comp (continuous_id.add continuous_const).measurable have hgp : ∀n : ActualEisensteinCubic.O,∀z : ℂ,f (z+3*eisEmbedding n+c)=f (z+c) := by intro n z rw [show z+3*eisEmbedding n+c=(z+c)+3*eisEmbedding n by ring,hp] rw [period_integral_eisenstein_mul (fun z=>f (z+c)) hg hgp b hb] simpa only [add_comm] using period_integral_translation f hp c lemma complex_upper_triangular_bottom_ne_zero (T : SL(2,ℂ)) (hT : T 1 0=0) : T 1 1≠0 := by have hdet : T 0 0*T 1 1=1 := by simpa only [Matrix.det_fin_two,hT,mul_zero,sub_zero] using T.property intro hz rw [hz,mul_zero] at hdet exact zero_ne_one hdet lemma complex_upper_triangular_action (T : SL(2,ℂ)) (hT : T 1 0=0) (z : ℂ) (v : ℝ) (hv : 0cubicSourceResidualFunction (integralComplexMatrix M • upperPoint (3*z) v hv)) (sourceCusp_scaled_continuous M v hv).measurable (sourceCusp_scaled_periodic M v hv) b hb c).trans (sourceCusp_average_all M v hv) theorem sourceCusp_average_complex_upper (M : SL(2,ActualEisensteinCubic.O)) (T : SL(2,ℂ)) (hT : T 1 0=0) (b d : ActualEisensteinCubic.O) (hd : d≠0) (hscale : (T 0 0/T 1 1)*eisEmbedding b=eisEmbedding d) (v : ℝ) (hv : 0 norm_num [Real.rpow_neg_natCast,Real.rpow_neg_one] all_goals field_simp lemma cubeCuspTriangular_norm_sq {A:SL(2,Eis)} {p q:Eis} (d:CubeCuspData A p q) (hp:p≠0) : ‖cubeCuspTriangular d hp 1 1‖^2 = ‖eisEmbedding p‖^(3-2*(d.exponent.val:ℝ)) := by obtain ⟨_,_,h11⟩:=cubeCuspTriangular_entries d hp rw [h11,norm_mul,norm_inv,norm_pow,mul_pow,inv_pow] have hn:‖cubeDilationRoot p‖^2=‖eisEmbedding p‖^3:=by rw [←norm_pow,cubeDilationRoot_sq,norm_pow] rw [hn] exact cube_scale_norm_real _ (norm_pos_iff.mpr (eisEmbedding_ne_zero hp)) d.exponent lemma cubeCuspTriangular_height {A:SL(2,Eis)} {p q:Eis} (d:CubeCuspData A p q) (hp:p≠0) (v:ℝ) (hv:0 fin_cases j <;> simp [complexDiagonal] obtain ⟨z,v,hv,rfl⟩:=upperPoint_surjective w rw [he,complexDiagonal_action] apply upperPoint_congr <;> norm_num lemma rationalComplex_T_eq : rationalComplex ModularGroup.T=complexTranslation 1 := by rw [← rationalUnipotent_one] apply Subtype.ext rw [rationalComplex_unipotent_coe] norm_num [complexTranslation] theorem exists_primary_cusp_shift (A:levelTwo) : ∃B:levelTwo, lambda^2∣((B:SL(2,Eis)) 0 0)-1 ∧ ∃t:Fin 2,∀w:HyperbolicSpace, integralComplexMatrix (B:SL(2,Eis)) • w= complexTranslation (t.val:ℂ) • (integralComplexMatrix (A:SL(2,Eis)) • w) := by obtain ⟨t,ht⟩:=levelTwo_primary_shift_cases A let T:levelTwo:=⟨rationalEmbedding (ModularGroup.T^t.val),rational_mem_levelTwo _⟩ let S:levelTwo:=⟨rationalEmbedding (ModularGroup.S^2),rational_mem_levelTwo _⟩ have hT:((T*A:levelTwo):SL(2,Eis)) 0 0= (A:SL(2,Eis)) 0 0+(t.val:Eis)*(A:SL(2,Eis)) 1 0:=by have hmatrix : ((ModularGroup.T ^ t.val : SL(2, ℤ)) : Matrix (Fin 2) (Fin 2) ℤ) = !![1, (t.val : ℤ); 0, 1] := by fin_cases t <;> decide change ((((ModularGroup.T ^ t.val : SL(2, ℤ)) : Matrix (Fin 2) (Fin 2) ℤ).map (Int.castRingHom Eis)) * ((A : SL(2, Eis)) : Matrix (Fin 2) (Fin 2) Eis)) 0 0 = _ rw [hmatrix] simp [Matrix.mul_apply, Fin.sum_univ_two] have hST:((S*(T*A):levelTwo):SL(2,Eis)) 0 0= -((A:SL(2,Eis)) 0 0+(t.val:Eis)*(A:SL(2,Eis)) 1 0):=by have hneg (M:SL(2,Eis)) : (rationalEmbedding (ModularGroup.S^2)*M) 0 0= -M 0 0:=by have hmatrix : ((ModularGroup.S ^ 2 : SL(2, ℤ)) : Matrix (Fin 2) (Fin 2) ℤ) = !![-1, 0; 0, -1] := by decide change ((((ModularGroup.S ^ 2 : SL(2, ℤ)) : Matrix (Fin 2) (Fin 2) ℤ).map (Int.castRingHom Eis)) * (M : Matrix (Fin 2) (Fin 2) Eis)) 0 0 = _ rw [hmatrix] simp [Matrix.mul_apply, Fin.sum_univ_two] exact (hneg ((T*A:levelTwo):SL(2,Eis))).trans (congrArg (fun x:Eis=> -x) hT) have hzero:complexTranslation 0=1:=by apply Matrix.SpecialLinearGroup.ext intro i j fin_cases i <;> fin_cases j <;> simp [complexTranslation] have hact (w:HyperbolicSpace):integralComplexMatrix ((T*A:levelTwo):SL(2,Eis)) • w= complexTranslation (t.val:ℂ) • (integralComplexMatrix (A:SL(2,Eis)) • w):=by change integralComplexMatrix (rationalEmbedding (ModularGroup.T^t.val)*(A:SL(2,Eis))) • w=_ rw [map_mul,mul_smul] change rationalComplex (ModularGroup.T^t.val) • (integralComplexMatrix (A:SL(2,Eis)) • w)=_ fin_cases t · simp only [pow_zero,map_one,one_smul,Nat.cast_zero,hzero] · simp only [pow_one,rationalComplex_T_eq,Nat.cast_one] rcases ht with ht|ht · exact ⟨T*A,by rwa [hT],t,hact⟩ · refine ⟨S*(T*A),by rwa [hST],t,?_⟩ intro w change integralComplexMatrix (rationalEmbedding (ModularGroup.S^2)*((T*A:levelTwo):SL(2,Eis))) • w=_ rw [map_mul,mul_smul] change rationalComplex (ModularGroup.S^2) • (integralComplexMatrix ((T*A:levelTwo):SL(2,Eis)) • w)=_ rw [rationalComplex_S_sq_action,hact] end CubicEisenstein namespace CubicKubota open ActualEisensteinCubic ConcreteTraceCRT CubicEisenstein CubicJacobiGlobal namespace RootNotationCubeCuspAverage06 abbrev Eis := ActualEisensteinCubic.O end RootNotationCubeCuspAverage06 open RootNotationCubeCuspAverage06 (Eis) lemma matrix_mul_upper_first_column (A T:SL(2,Eis)) (hT:T 1 0=0) (i:Fin 2) : (A*T) i 0=A i 0*T 0 0 := by simp only [Matrix.SpecialLinearGroup.coe_mul,Matrix.mul_apply,Fin.sum_univ_two,hT,mul_zero,add_zero] namespace CubeCuspData variable {A:SL(2,Eis)} {p q:Eis} def right_upper (d:CubeCuspData A p q) (T:SL(2,Eis)) (hT:T 1 0=0) : CubeCuspData (A*T) p q where exponent:=d.exponent matrix:=d.matrix*T first:=by simp only [matrix_mul_upper_first_column _ T hT] linear_combination d.first*(T 0 0) second:=by simp only [matrix_mul_upper_first_column _ T hT] linear_combination d.second*(T 0 0) congruent:=by have he:(d.matrix*T)*(A*T)⁻¹=d.matrix*A⁻¹:=by group rw [he] exact d.congruent lemma right_upper_exponent (d:CubeCuspData A p q) (T:SL(2,Eis)) (hT:T 1 0=0) : (d.right_upper T hT).exponent=d.exponent := rfl lemma right_upper_character (d:CubeCuspData A p q) (T:SL(2,Eis)) (hT:T 1 0=0) : complexCharacter ⟨(d.right_upper T hT).matrix*(A*T)⁻¹,(d.right_upper T hT).congruent⟩= complexCharacter ⟨d.matrix*A⁻¹,d.congruent⟩ := by apply congrArg complexCharacter apply Subtype.ext change (d.matrix*T)*(A*T)⁻¹=d.matrix*A⁻¹ group end CubeCuspData end CubicKubota end namespace CubicEisenstein section open MeasureTheory open scoped Classical MatrixGroups BigOperators open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota namespace RootNotationCubeCuspAverage07 abbrev Eis := ActualEisensteinCubic.O end RootNotationCubeCuspAverage07 open RootNotationCubeCuspAverage07 (Eis) lemma cubeAverage_continuous (p:Eis) (hp:p≠0) (F:HyperbolicSpace→ℂ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_fullSLContinuousAction := @OAI.CubicEisenstein.fullSLContinuousAction ∀ (hF:Continuous F), Continuous (cubeAverage p hp F) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology letI rootPolicy_fullSLContinuousAction := @OAI.CubicEisenstein.fullSLContinuousAction fun (hF:Continuous F) => by let:Finite (Eis⧸Ideal.span {p^3}):=finite_quotient_span (pow_ne_zero 3 hp) let:Fintype (Eis⧸Ideal.span {p^3}):=Fintype.ofFinite _ unfold cubeAverage simp only [tsum_fintype] apply continuous_const.mul apply continuous_finsetSum intro r hr exact hF.comp (continuous_const_smul _) lemma cubeAverage_cusp_integral (p:Eis) (hp:p≠0) (F:HyperbolicSpace→ℂ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hF:Continuous F) (M:SL(2,Eis)) (b:Eis) (v:ℝ) (hv:0 by let:Finite (Eis⧸Ideal.span {p^3}):=finite_quotient_span (pow_ne_zero 3 hp) let:Fintype (Eis⧸Ideal.span {p^3}):=Fintype.ofFinite _ let c:ℂ→UpperCoordinates:=fun z=>⟨(3*(eisEmbedding b*z),v),hv⟩ have hc:Continuous c:=by apply Continuous.subtype_mk exact (continuous_const.mul (continuous_const.mul continuous_id)).prodMk continuous_const have hi (r:Eis⧸Ideal.span {p^3}):IntegrableOn (fun z=> F (cubeAverageMatrix p hp (GaussianShiftedPartition.representative (p^3) r) • (integralComplexMatrix M • upperPoint (3*(eisEmbedding b*z)) v hv))) periodDomain:=by apply periodDomain_integrable_of_continuous have hh:=(continuous_translatedUpperCoordinates (cubeAverageMatrix p hp (GaussianShiftedPartition.representative (p^3) r)*integralComplexMatrix M)).comp hc simpa only [Function.comp_def,c,mul_smul] using hF.comp hh unfold cubeAverage simp only [tsum_fintype] rw [integral_const_mul] congr 1 exact integral_finsetSum _ (fun r _=>hi r) end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups InnerProductSpace theorem kernelSourceProjection_variationalResolvent (F : KernelQuotientL2) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelVariationalResolvent (kernelSourceProjection F)= kernelSourceProjection (kernelVariationalResolvent F) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [kernelSourceProjection_apply,kernelSourceProjection_apply,map_smul,map_sum] congr 1 apply Finset.sum_congr rfl intro q _ exact kernelSource_variationalResolvent _ F theorem kernelSourceProjection_operatorGraph (F G : KernelQuotientL2) (hFG : (F,G)∈kernelEnergyLaplacian.graph) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelSourceProjection F,kernelSourceProjection G)∈kernelEnergyLaplacian.graph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [kernelEnergyLaplacian_graph,mem_kernelLaplacianGraph] at hFG ⊢ rw [←map_add,kernelSourceProjection_variationalResolvent,hFG] theorem kernelSourceProjection_eigenvector (F : KernelQuotientL2) (eigenvalue : ℂ) (hF : (F,eigenvalue • F)∈kernelEnergyLaplacian.graph) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelSourceProjection F,eigenvalue • kernelSourceProjection F)∈kernelEnergyLaplacian.graph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by simpa only [map_smul] using kernelSourceProjection_operatorGraph F (eigenvalue • F) hF theorem kernelSourceProjection_cubicEisensteinResidue_eigenvector : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelSourceProjection cubicEisensteinResidue, (8/9:ℂ) • kernelSourceProjection cubicEisensteinResidue)∈kernelEnergyLaplacian.graph := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSourceProjection_eigenvector _ _ cubicEisensteinResidue_eigenvector end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace CubicEisenstein open ConcreteTraceCRT CubicKubota EisensteinCuspModThree namespace RootNotationCubeCuspAverage08 abbrev O := ActualEisensteinCubic.O end RootNotationCubeCuspAverage08 open RootNotationCubeCuspAverage08 (O) def sourceCuspLeadingCoefficient (M : SL(2,ActualEisensteinCubic.O)) : ℂ := sourceCuspConstant M / ((9*Real.sqrt 3/2:ℝ):ℂ) def sourceCuspRemainder (M : SL(2,ActualEisensteinCubic.O)) (z : ℂ) (v : ℝ) (hv : 0integralCoverRep H K q•w) (hyperbolicVolume.restrict (integralCoverSheet H K q)) (hyperbolicVolume.restrict (hyperbolicFundamentalSet K)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by let := integralSubgroupHyperbolicAction K let := integralSubgroupMeasurableAction K let := integralSubgroupVolumeInvariant K exact (measurePreserving_smul (integralCoverRep H K q) hyperbolicVolume).restrict_preimage (hyperbolicFundamentalSet_measurable K) lemma integralCoverFiberPoint_rep_smul (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction K integralCoverFiberPoint H K q (integralCoverRep H K q•w)=integralOrbitProjection H w := by let := integralSubgroupHyperbolicAction K rw [integralCoverFiberPoint_rep,inv_smul_smul] lemma integralCoverFiber_integrable {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hmeas : Measurable f) (hf : Integrable f (integralQuotientVolume H)) (q : IntegralCoverCosets H K), IntegrableOn (fun w=>f (integralCoverFiberPoint H K q w)) (hyperbolicFundamentalSet K) hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hmeas : Measurable f) (hf : Integrable f (integralQuotientVolume H)) (q : IntegralCoverCosets H K) => by have hD := (integralCoverDomain_projection_measurePreserving hHK hK).integrable_comp_of_integrable hf have hS : IntegrableOn (fun w=>f (integralOrbitProjection H w)) (integralCoverSheet H K q) hyperbolicVolume := IntegrableOn.mono_set hD (Set.subset_iUnion (integralCoverSheet H K) q) apply ((integralCoverSheet_measurePreserving H K q).integrable_comp (hmeas.comp (integralCoverFiberPoint_measurable H K q)).aestronglyMeasurable).mp simpa only [IntegrableOn,Function.comp_def,integralCoverFiberPoint_rep_smul] using hS theorem integralCoverTraceFunction_integrable {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hmeas : Measurable f) (hf : Integrable f (integralQuotientVolume H)), Integrable (integralCoverTraceFunction H K f) (integralQuotientVolume K) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hmeas : Measurable f) (hf : Integrable f (integralQuotientVolume H)) => by let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ apply ((quotient_projection_measurePreserving K).integrable_comp (integralCoverTraceFunction_measurable H K f hmeas).aestronglyMeasurable).mp change Integrable (fun w=>∑q : IntegralCoverCosets H K,f (integralCoverFiberPoint H K q w)) _ exact integrable_finsetSum Finset.univ (fun q _=>integralCoverFiber_integrable hHK hK f hmeas hf q) lemma integralCoverFiber_integral (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) (q : IntegralCoverCosets H K) (f : IntegralOrbitQuotient H→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (∫w in hyperbolicFundamentalSet K,f (integralCoverFiberPoint H K q w)∂hyperbolicVolume)= ∫w in integralCoverSheet H K q,f (integralOrbitProjection H w)∂hyperbolicVolume := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by let := integralSubgroupHyperbolicAction K let := integralSubgroupMeasurableAction K let := integralSubgroupVolumeInvariant K have hh := (measurePreserving_smul (integralCoverRep H K q) hyperbolicVolume).setIntegral_preimage_emb (measurableEmbedding_const_smul (integralCoverRep H K q)) (fun w=>f (integralCoverFiberPoint H K q w)) (hyperbolicFundamentalSet K) simpa only [integralCoverSheet,integralCoverFiberPoint_rep_smul] using hh.symm theorem integralCoverTraceFunction_integral {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hmeas : Measurable f) (hf : Integrable f (integralQuotientVolume H)), (∫q,integralCoverTraceFunction H K f q∂integralQuotientVolume K)= ∫q,f q∂integralQuotientVolume H := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hmeas : Measurable f) (hf : Integrable f (integralQuotientVolume H)) => by let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ have hD := (integralCoverDomain_projection_measurePreserving hHK hK).integrable_comp_of_integrable hf have hS (q : IntegralCoverCosets H K) : IntegrableOn (fun w=>f (integralOrbitProjection H w)) (integralCoverSheet H K q) hyperbolicVolume := IntegrableOn.mono_set hD (Set.subset_iUnion (integralCoverSheet H K) q) rw [integralQuotientVolume_integral K _ (integralCoverTraceFunction_measurable H K f hmeas).aestronglyMeasurable] change (∫w in hyperbolicFundamentalSet K, ∑q : IntegralCoverCosets H K,f (integralCoverFiberPoint H K q w)∂hyperbolicVolume)=_ rw [integral_finsetSum Finset.univ (fun q _=>integralCoverFiber_integrable hHK hK f hmeas hf q)] simp_rw [integralCoverFiber_integral H K] rw [←integral_iUnion_fintype (integralCoverSheet_measurable H K) (integralCoverSheet_pairwiseDisjoint H K hK) hS] change (∫w in integralCoverDomain H K,f (integralOrbitProjection H w)∂hyperbolicVolume)=_ rw [←(integralCoverDomain_projection_measurePreserving hHK hK).map_eq] exact (integral_map (measurable_integralOrbitProjection H).aemeasurable hmeas.aestronglyMeasurable).symm end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.InverseCorrespondence /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise ENNReal InnerProductSpace open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationInverseCorrespondence01 abbrev O := ActualEisensteinCubic.O end RootNotationInverseCorrespondence01 open RootNotationInverseCorrespondence01 (O) lemma integralCoverFiber_memLp {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hmeas : Measurable f) (hf : MemLp f 2 (integralQuotientVolume H)) (q : IntegralCoverCosets H K), MemLp (fun w=>f (integralCoverFiberPoint H K q w)) 2 (hyperbolicVolume.restrict (hyperbolicFundamentalSet K)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hmeas : Measurable f) (hf : MemLp f 2 (integralQuotientVolume H)) (q : IntegralCoverCosets H K) => by have hD := hf.comp_measurePreserving (integralCoverDomain_projection_measurePreserving hHK hK) have hS := MemLp.mono_measure (Measure.restrict_mono_set hyperbolicVolume (Set.subset_iUnion (integralCoverSheet H K) q)) hD have hm := integralCoverSheet_measurePreserving H K q have hi := memLp_map_measure_iff (p:=2) (hmeas.comp (integralCoverFiberPoint_measurable H K q)).aestronglyMeasurable hm.aemeasurable rw [hm.map_eq] at hi apply hi.mpr simpa only [Function.comp_def,integralCoverFiberPoint_rep_smul] using hS theorem integralCoverTraceFunction_memLp {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hmeas : Measurable f) (hf : MemLp f 2 (integralQuotientVolume H)), MemLp (integralCoverTraceFunction H K f) 2 (integralQuotientVolume K) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hmeas : Measurable f) (hf : MemLp f 2 (integralQuotientVolume H)) => by let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ have hm := quotient_projection_measurePreserving K have hi := memLp_map_measure_iff (p:=2) (integralCoverTraceFunction_measurable H K f hmeas).aestronglyMeasurable hm.aemeasurable rw [hm.map_eq] at hi apply hi.mpr change MemLp (fun w=>∑q : IntegralCoverCosets H K,f (integralCoverFiberPoint H K q w)) 2 _ exact memLp_finsetSum Finset.univ (fun q _=>integralCoverFiber_memLp hHK hK f hmeas hf q) lemma integralCoverMap_fiberPoint {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (q : IntegralCoverCosets H K) (w : HyperbolicSpace) : integralCoverMap hHK (integralCoverFiberPoint H K q w)=integralOrbitProjection K w := by rw [integralCoverFiberPoint_rep,integralCoverMap_projection,integralSubgroup_smul, integralOrbitProjection_eq] lemma integralCoverTraceFunction_pairing {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) [H.IsFiniteRelIndex K] (F : IntegralOrbitQuotient K→ℂ) (f : IntegralOrbitQuotient H→ℂ) (q : IntegralOrbitQuotient K) : integralCoverTraceFunction H K (fun r=>inner ℂ (F (integralCoverMap hHK r)) (f r)) q= inner ℂ (F q) (integralCoverTraceFunction H K f q) := by let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ induction q using Quotient.inductionOn with | _ w => change (∑r : IntegralCoverCosets H K,inner ℂ (F (integralCoverMap hHK (integralCoverFiberPoint H K r w))) (f (integralCoverFiberPoint H K r w)))= inner ℂ (F (integralOrbitProjection K w)) (∑r : IntegralCoverCosets H K,f (integralCoverFiberPoint H K r w)) simp only [integralCoverMap_fiberPoint,inner_sum] theorem integralCoverTrace_toLp_ae {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hmeas : Measurable f) (hf : MemLp f 2 (integralQuotientVolume H)), integralCoverTrace hHK hK (hf.toLp f)=ᵐ[integralQuotientVolume K] integralCoverTraceFunction H K f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hmeas : Measurable f) (hf : MemLp f 2 (integralQuotientVolume H)) => by let htr := integralCoverTraceFunction_memLp hHK hK f hmeas hf let Tf : IntegralQuotientL2 K := htr.toLp (integralCoverTraceFunction H K f) have he : Tf=integralCoverTrace hHK hK (hf.toLp f) := by apply ext_inner_left ℂ intro F let pair : IntegralOrbitQuotient H→ℂ := fun r=>inner ℂ (F (integralCoverMap hHK r)) (f r) have hpm : Measurable pair := by have hFm : Measurable (fun r=>F (integralCoverMap hHK r)) := (Lp.stronglyMeasurable F).measurable.comp (integralCoverMap_measurable hHK) have hstar : Measurable (fun r=>star (F (integralCoverMap hHK r))) := continuous_star.measurable.comp hFm have hm := hmeas.mul hstar change Measurable (fun r=>f r*star (F (integralCoverMap hHK r))) at hm simpa only [pair,RCLike.inner_apply,starRingEnd_apply] using hm have hae : (fun r=>inner ℂ (integralCoverPullback hHK hK F r) (hf.toLp f r)) =ᵐ[integralQuotientVolume H]pair := by filter_upwards [integralCoverPullback_ae hHK hK F,hf.coeFn_toLp] with r hr hfR dsimp [pair] rw [hr,hfR] have hpi : Integrable pair (integralQuotientVolume H) := (L2.integrable_inner (integralCoverPullback hHK hK F) (hf.toLp f)).congr hae calc inner ℂ F Tf = ∫q,inner ℂ (F q) (integralCoverTraceFunction H K f q)∂integralQuotientVolume K := by rw [L2.inner_def] apply integral_congr_ae filter_upwards [htr.coeFn_toLp] with q hq change inner ℂ (F q) (htr.toLp (integralCoverTraceFunction H K f) q)=_ rw [hq] _ = ∫q,integralCoverTraceFunction H K pair q∂integralQuotientVolume K := by apply integral_congr_ae exact Eventually.of_forall (fun q=>(integralCoverTraceFunction_pairing hHK F f q).symm) _ = ∫r,pair r∂integralQuotientVolume H := integralCoverTraceFunction_integral hHK hK pair hpm hpi _ = inner ℂ (integralCoverPullback hHK hK F) (hf.toLp f) := (integral_congr_ae hae).symm _ = inner ℂ F (integralCoverTrace hHK hK (hf.toLp f)) := (integralCoverTrace_pairing hHK hK F (hf.toLp f)).symm rw [←he] exact htr.coeFn_toLp theorem integralCoverTrace_representative {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] (G : IntegralQuotientL2 H) (f : IntegralOrbitQuotient H→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hmeas : Measurable f) (hrep : G=ᵐ[integralQuotientVolume H]f), integralCoverTrace hHK hK G=ᵐ[integralQuotientVolume K]integralCoverTraceFunction H K f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hmeas : Measurable f) (hrep : G=ᵐ[integralQuotientVolume H]f) => by have hf : MemLp f 2 (integralQuotientVolume H) := (memLp_congr_ae hrep).mp (Lp.memLp G) have he : G=hf.toLp f := Lp.ext (hrep.trans hf.coeFn_toLp.symm) rw [he] exact integralCoverTrace_toLp_ae hHK hK f hmeas hf end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationInverseCorrespondence02 abbrev O := ActualEisensteinCubic.O end RootNotationInverseCorrespondence02 open RootNotationInverseCorrespondence02 (O) end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationInverseCorrespondence03 abbrev Eis := ActualEisensteinCubic.O end RootNotationInverseCorrespondence03 open RootNotationInverseCorrespondence03 (Eis) def primaryDenominatorShift (a:PrimaryLower) (m:Eis) : PrimaryCoprimeDenominator a≃PrimaryCoprimeDenominator a where toFun d:=⟨⟨d.val.val+3*a.val*m,by convert dvd_add d.val.2 (show (3:Eis)∣3*a.val*m from ⟨a.val*m,by ring⟩) using 1 ;ring⟩,by exact (isCoprime_right_congr_of_dvd a.val (d.val.val+3*a.val*m) d.val.val ⟨3*m,by ring⟩).mpr d.2⟩ invFun d:=⟨⟨d.val.val-3*a.val*m,by convert dvd_sub d.val.2 (show (3:Eis)∣3*a.val*m from ⟨a.val*m,by ring⟩) using 1 ;ring⟩,by exact (isCoprime_right_congr_of_dvd a.val (d.val.val-3*a.val*m) d.val.val ⟨-(3*m),by ring⟩).mpr d.2⟩ left_inv d:=by apply Subtype.ext;apply Subtype.ext;dsimp;ring right_inv d:=by apply Subtype.ext;apply Subtype.ext;dsimp;ring def unitLowerDataShift (m:Eis) : UnitLowerData≃UnitLowerData := Equiv.sigmaCongrRight (fun a=>primaryDenominatorShift a m) lemma affineCusp_term_weighted_period (h q r:Eis) (j n:ℕ) (a d:PrimaryLower) (m:Eis) (hq:q≠0) (hr:r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (hbase:(3:Eis)∣h+ramifiedAffineParameter j n*q) (z:ℂ) (v:ℝ) (s:ℂ) : affineLowerTerm q r z v s a.val (d.val+3*a.val*(q*m))*ShortDraftTrace.breveE (-ninthCuspFrequency h*z)= affineLowerTerm q r (z+3*eisEmbedding m) v s a.val d.val* ShortDraftTrace.breveE (-ninthCuspFrequency h*(z+3*eisEmbedding m)) := by have hd:(3:Eis)∣d.val-a.val:=by simpa only [sub_sub_sub_cancel_right] using dvd_sub d.2 a.2 obtain ⟨x,hx⟩:=hd have hdx:d.val=a.val+3*x:=by linear_combination hx have hb:(3:Eis)∣h+ramifiedAffineParameter j n*q*a.val:=by convert dvd_add hbase (a.2.mul_left (ramifiedAffineParameter j n*q)) using 1 ;ring obtain ⟨ell,hell⟩:=hb have he:=affineCusp_general_weighted_translate h q r a.val ell x (q*m) j n (primaryLower_primary a) hq hr hell.symm z v s have hqm:Ideal.Quotient.mk (Ideal.span {q}) (q*m)=0:= Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr (dvd_mul_right q m)) rw [hqm,AddChar.map_zero_eq_one,one_mul] at he have hshift:3*eisEmbedding (q*m)/eisEmbedding q=3*eisEmbedding m:=by rw [map_mul] field_simp [eisEmbedding_ne_zero hq] rw [hshift] at he rw [hdx,show a.val+3*x+3*a.val*(q*m)=a.val+3*(x+a.val*(q*m)) by ring] exact he def affineCuspBlock (q r:Eis) (z:ℂ) (v:ℝ) (s:ℂ) : ℂ := ∑'p:UnitLowerData,affineLowerTerm q r z v s p.1.val p.2.val.val lemma affineCuspBlock_weighted_periodic (h q r:Eis) (j n:ℕ) (hq:q≠0) (hr:r=omega^j*ramifiedTraceLambda^n ∨ r=-(omega^j*ramifiedTraceLambda^n)) (hbase:(3:Eis)∣h+ramifiedAffineParameter j n*q) (v:ℝ) (s:ℂ) (m:Eis) (z:ℂ) : affineCuspBlock q r (z+3*eisEmbedding m) v s* ShortDraftTrace.breveE (-ninthCuspFrequency h*(z+3*eisEmbedding m))= affineCuspBlock q r z v s*ShortDraftTrace.breveE (-ninthCuspFrequency h*z) := by rw [affineCuspBlock,affineCuspBlock,←tsum_mul_right,←tsum_mul_right] calc _ = ∑'p:UnitLowerData,affineLowerTerm q r z v s ((unitLowerDataShift (q*m) p).1.val) ((unitLowerDataShift (q*m) p).2.val.val)* ShortDraftTrace.breveE (-ninthCuspFrequency h*z) := by apply tsum_congr intro p exact (affineCusp_term_weighted_period h q r j n p.1 p.2.val m hq hr hbase z v s).symm _ = _ := (unitLowerDataShift (q*m)).tsum_eq (fun p:UnitLowerData=>affineLowerTerm q r z v s p.1.val p.2.val.val*ShortDraftTrace.breveE (-ninthCuspFrequency h*z)) lemma period_integral_twisted_translation (f:ℂ→ℂ) (freq:ℂ) (hp:∀(n:Eis)(z:ℂ),f (z+3*eisEmbedding n)*ShortDraftTrace.breveE (-freq*(z+3*eisEmbedding n))= f z*ShortDraftTrace.breveE (-freq*z)) (b:ℂ) : (∫z in periodDomain,f (z+b)*ShortDraftTrace.breveE (-freq*z))= ShortDraftTrace.breveE (freq*b)*∫z in periodDomain,f z*ShortDraftTrace.breveE (-freq*z) := by let g:ℂ→ℂ:=fun z=>f z*ShortDraftTrace.breveE (-freq*z) have he (z:ℂ):f (z+b)*ShortDraftTrace.breveE (-freq*z)=ShortDraftTrace.breveE (freq*b)*g (b+z):=by dsimp only [g] rw [mul_left_comm,←AddChar.map_add_eq_mul] congr 1 · rw [add_comm] · congr 1;ring simp_rw [he] rw [integral_const_mul,period_integral_translation g hp b] end section open Filter MeasureTheory open scoped BigOperators Classical MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicRamified namespace RootNotationInverseCorrespondence04 abbrev Eis := ActualEisensteinCubic.O end RootNotationInverseCorrespondence04 open RootNotationInverseCorrespondence04 (Eis) lemma diagonal_unit_weighted_periodic (u t:Eisˣ) (j:ℕ) (h:Eis) (hr:(↑u⁻¹:Eis)^2*(t:Eis)=omega^j ∨ (↑u⁻¹:Eis)^2*(t:Eis)=-(omega^j)) (hbase:(3:Eis)∣h+ramifiedAffineParameter j 0*(t:Eis)) (v:ℝ) (hv:0affineLowerTerm (onceCuspScale t*omega^p.1.val) ((↑u⁻¹:Eis)^2*(onceCuspScale t*omega^p.1.val)) z v s p.2.1.val p.2.2.val.val):= hsum.congr (fun p=>diagonal_once_summand u t z v hv s p) rw [mul_assoc,diagonal_once_eisenstein_rows,ht.tsum_prod,tsum_fintype] rfl lemma diagonal_once_weighted_periodic (u t:Eisˣ) (h:Eis) (hfreq:(3:Eis)∣h-onceCuspScale t) (v:ℝ) (hv:0eisenstein (integralComplexMatrix (unitCuspDiagonal u)*integralComplexMatrix (lowerCuspMatrix (t:Eis))*upperSection z v hv) s) (ninthCuspFrequency h) (diagonal_unit_weighted_periodic u t j h hr hbase v hv s) b lemma diagonal_once_fourier_shift (u t:Eisˣ) (h:Eis) (hfreq:(3:Eis)∣h-onceCuspScale t) (v:ℝ) (hv:0eisenstein (integralComplexMatrix (unitCuspDiagonal u)*integralComplexMatrix (lowerCuspMatrix (onceCuspScale t))*upperSection z v hv) s) (ninthCuspFrequency h) (diagonal_once_weighted_periodic u t h hfreq v hv s hs) b end section open ActualEisensteinCubic ConcreteTraceCRT namespace RootNotationInverseCorrespondence05 abbrev Eis := ActualEisensteinCubic.O end RootNotationInverseCorrespondence05 open RootNotationInverseCorrespondence05 (Eis) def ramifiedCuspRoot (b:Bool) : Eisˣ := if b then ramifiedOmegaUnit^2 else ramifiedOmegaUnit def ramifiedCuspScaleUnit (b:Bool) : Eisˣ := if b then ramifiedOmegaUnit^2 else -ramifiedOmegaUnit def ramifiedCuspDirectIndex (b:Bool) : ℕ := if b then 2 else 1 def ramifiedCuspOppositeIndex (b:Bool) : ℕ := if b then 1 else 2 lemma ramified_omega_four : omega^4=omega := by rw [show (4:ℕ)=3+1 from rfl,pow_add,omega_primitive.pow_eq_one,pow_one,one_mul] lemma ramifiedCuspRoot_val (b:Bool) : (ramifiedCuspRoot b:Eis)=omega^(ramifiedCuspDirectIndex b) := by cases b <;>simp [ramifiedCuspRoot,ramifiedCuspDirectIndex,ramifiedOmegaUnit_val] lemma ramifiedCuspRoot_cube (b:Bool) : (ramifiedCuspRoot b:Eis)^3=1 := by rw [ramifiedCuspRoot_val,←pow_mul,Nat.mul_comm,pow_mul,omega_primitive.pow_eq_one,one_pow] lemma ramifiedCuspRoot_primitive (b:Bool) : (ramifiedCuspRoot b:Eis)^2+(ramifiedCuspRoot b:Eis)+1=0 := by cases b · simpa [ramifiedCuspRoot,ramifiedOmegaUnit_val] using ramified_omega_relation · simp only [ramifiedCuspRoot,ite_true,Units.val_pow_eq_pow_val,ramifiedOmegaUnit_val,←pow_mul] rw [show 2*2=4 from rfl,ramified_omega_four] linear_combination ramified_omega_relation lemma ramifiedCuspScaleUnit_spec (b:Bool) : -(ramifiedCuspRoot b:Eis)*(1+2*(ramifiedCuspRoot b:Eis))=onceCuspScale (ramifiedCuspScaleUnit b) := by cases b · simp [ramifiedCuspRoot,ramifiedCuspScaleUnit,onceCuspScale,ramifiedTraceLambda,ramifiedOmegaUnit_val] · simp only [ramifiedCuspRoot,ramifiedCuspScaleUnit,ite_true,onceCuspScale,Units.val_pow_eq_pow_val,ramifiedOmegaUnit_val, ramifiedTraceLambda] linear_combination -(2*omega^2)*ramified_omega_relation lemma ramifiedCusp_neg_inv_square (b:Bool) : (↑(-(ramifiedCuspRoot b))⁻¹:Eis)^2=(ramifiedCuspRoot b:Eis) := by have hi:(↑(-(ramifiedCuspRoot b))⁻¹:Eis)=-(ramifiedCuspRoot b:Eis)^2:=by apply (-(ramifiedCuspRoot b)).inv_eq_of_mul_eq_one_right change -(ramifiedCuspRoot b:Eis)*(-(ramifiedCuspRoot b:Eis)^2)=1 convert ramifiedCuspRoot_cube b using 1 ;ring rw [hi] linear_combination (ramifiedCuspRoot b:Eis)*ramifiedCuspRoot_cube b lemma ramifiedCusp_opposite_character (b:Bool) : (↑(-(ramifiedCuspRoot b))⁻¹:Eis)^2*(-(ramifiedCuspRoot b:Eis))= -(omega^(ramifiedCuspOppositeIndex b)) := by rw [ramifiedCusp_neg_inv_square,ramifiedCuspRoot_val] cases b · simp [ramifiedCuspDirectIndex,ramifiedCuspOppositeIndex,pow_two] · simp only [ramifiedCuspDirectIndex,ramifiedCuspOppositeIndex,ite_true,pow_one] rw [mul_neg,←pow_add,show 2+2=4 from rfl,ramified_omega_four] lemma ramifiedCusp_direct_period_constant (b:Bool) : (3:Eis)∣onceCuspScale (ramifiedCuspScaleUnit b)+ ramifiedAffineParameter (ramifiedCuspDirectIndex b) 0*(ramifiedCuspRoot b:Eis) := by cases b · refine ⟨0,?_⟩ simp [ramifiedCuspRoot,ramifiedCuspScaleUnit,onceCuspScale,ramifiedCuspDirectIndex, ramifiedAffineParameter,ramifiedOmegaUnit_val] ring · refine ⟨ramifiedTraceLambda*omega^2,?_⟩ simp [ramifiedCuspRoot,ramifiedCuspScaleUnit,onceCuspScale,ramifiedCuspDirectIndex, ramifiedAffineParameter,ramifiedOmegaUnit_val] ring lemma ramifiedCusp_opposite_period_constant (b:Bool) : (3:Eis)∣onceCuspScale (ramifiedCuspScaleUnit b)+ ramifiedAffineParameter (ramifiedCuspOppositeIndex b) 0*(-(ramifiedCuspRoot b:Eis)) := by cases b · refine ⟨-(omega*ramifiedTraceLambda),?_⟩ simp [ramifiedCuspRoot,ramifiedCuspScaleUnit,onceCuspScale,ramifiedCuspOppositeIndex, ramifiedAffineParameter,ramifiedOmegaUnit_val] ring · refine ⟨0,?_⟩ simp [ramifiedCuspRoot,ramifiedCuspScaleUnit,onceCuspScale,ramifiedCuspOppositeIndex, ramifiedAffineParameter,ramifiedOmegaUnit_val] ring lemma ramifiedCusp_unit_period_constant (b:Bool) : (3:Eis)∣onceCuspScale (ramifiedCuspScaleUnit b)+ ramifiedAffineParameter (ramifiedCuspDirectIndex b) 0 := by cases b · refine ⟨-omega^2,?_⟩ simp [ramifiedCuspScaleUnit,ramifiedCuspDirectIndex,onceCuspScale,Units.val_neg, ramifiedOmegaUnit_val,ramifiedAffineParameter,Nat.cast_one,one_mul,sub_zero, ramifiedTraceLambda] linear_combination ramified_omega_relation · refine ⟨-omega^2,?_⟩ simp only [ramifiedCuspScaleUnit,ramifiedCuspDirectIndex,ite_true,onceCuspScale,Units.val_pow_eq_pow_val, ramifiedOmegaUnit_val,ramifiedAffineParameter,Nat.cast_ofNat,Nat.cast_zero,sub_zero, ramifiedTraceLambda] linear_combination (2*omega+2)*ramified_omega_relation end open Filter MeasureTheory open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic ConcreteTraceCRT namespace RootNotationInverseCorrespondence06 abbrev Eis := ActualEisensteinCubic.O end RootNotationInverseCorrespondence06 open RootNotationInverseCorrespondence06 (Eis) def unitCuspGaussSeries (u t:Eisˣ) (h:Eis) (s:ℂ) : ℂ := ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding (t:Eis))* unramifiedCubicGaussSeries s (3*((↑u⁻¹:Eis)^2*(t:Eis))^2*((↑t⁻¹:Eis)*h)) lemma unitCusp_eisenstein_fourier_base (u t:Eisˣ) (j:ℕ) (h:Eis) (hr:(↑u⁻¹:Eis)^2*(t:Eis)=omega^j ∨ (↑u⁻¹:Eis)^2*(t:Eis)=-(omega^j)) (hbase:(3:Eis)∣h+ramifiedAffineParameter j 0*(t:Eis)) (v:ℝ) (hv:0fin_cases j <;>simp [unitCuspDiagonal] lemma ramifiedCusp_direct_base (b:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit b)) : (3:Eis)∣h+ramifiedAffineParameter (ramifiedCuspDirectIndex b) 0*(ramifiedCuspRoot b:Eis) := by convert dvd_add hf (ramifiedCusp_direct_period_constant b) using 1 ;ring lemma ramifiedCusp_opposite_base (b:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit b)) : (3:Eis)∣h+ramifiedAffineParameter (ramifiedCuspOppositeIndex b) 0*(-(ramifiedCuspRoot b:Eis)) := by convert dvd_add hf (ramifiedCusp_opposite_period_constant b) using 1 ;ring lemma ramifiedCusp_unit_base (b:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit b)) : (3:Eis)∣h+ramifiedAffineParameter (ramifiedCuspDirectIndex b) 0 := by convert dvd_add hf (ramifiedCusp_unit_period_constant b) using 1 ;ring end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open Finset AddChar MulChar EisensteinEmbedding namespace CubicKubota open CubicEisenstein namespace RootNotationInverseCorrespondence07 abbrev O := ActualEisensteinCubic.O end RootNotationInverseCorrespondence07 open RootNotationInverseCorrespondence07 (O) lemma cubeKernelLeftGlobal_injective (p : ActualEisensteinCubic.O) (hp : p≠0) : Function.Injective (cubeKernelLeftGlobal p) := by intro x y hxy apply (cubeKernel_finite_covers p hp).1 apply Subtype.ext apply Subtype.ext exact hxy lemma cubeKernelRightGlobal_injective (p : ActualEisensteinCubic.O) (hp : p≠0) : Function.Injective (cubeKernelRightGlobal p hp) := by intro x y hxy apply (cubeKernel_finite_covers p hp).2.1 apply Subtype.ext apply Subtype.ext exact hxy def cubeKernelRangeEquiv (p : ActualEisensteinCubic.O) (hp : p≠0) : (cubeKernelLeftGlobal p).range≃*(cubeKernelRightGlobal p hp).range := (MonoidHom.ofInjective (cubeKernelLeftGlobal_injective p hp)).symm.trans (MonoidHom.ofInjective (cubeKernelRightGlobal_injective p hp)) end CubicKubota end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CorrespondenceTests /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped Classical MatrixGroups BigOperators open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota namespace RootNotationCorrespondenceTests01 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondenceTests01 open RootNotationCorrespondenceTests01 (Eis) lemma cubeAverageMatrix_translate_lattice (p:Eis) (hp:p≠0) (q n:Eis) : cubeAverageMatrix p hp q*complexTranslation (3*eisEmbedding n)=cubeAverageMatrix p hp (q+n) := by apply Subtype.ext rw [Matrix.SpecialLinearGroup.coe_mul, cubeAverageMatrix_entries, cubeAverageMatrix_entries] ext i j fin_cases i <;> fin_cases j <;> simp [Matrix.mul_apply, Fin.sum_univ_two, complexTranslation, map_add] ring lemma cubeAverage_period_three (p:Eis) (hp:p≠0) (F:HyperbolicSpace→ℂ) (hF:∀n:Eis,∀w:HyperbolicSpace,F (complexTranslation (3*eisEmbedding n) • w)=F w) (n:Eis) (w:HyperbolicSpace) : cubeAverage p hp F (complexTranslation (3*eisEmbedding n) • w)=cubeAverage p hp F w := by let a:(Eis⧸Ideal.span {p^3})≃(Eis⧸Ideal.span {p^3}):= { toFun:=fun r=>r+Ideal.Quotient.mk _ n invFun:=fun r=>r-Ideal.Quotient.mk _ n left_inv:=fun r=>add_sub_cancel_right r _ right_inv:=fun r=>sub_add_cancel r _ } let f (r:Eis⧸Ideal.span {p^3}):= F (cubeAverageMatrix p hp (GaussianShiftedPartition.representative (p^3) r) • w) have hpoint (r:Eis⧸Ideal.span {p^3}): F (cubeAverageMatrix p hp (GaussianShiftedPartition.representative (p^3) r) • (complexTranslation (3*eisEmbedding n) • w))=f (a r) := by rw [←mul_smul,cubeAverageMatrix_translate_lattice] apply cubeAverage_summand_congr p hp F hF apply Ideal.mem_span_singleton.mp apply (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).mp rw [map_add,GaussianShiftedPartition.representative_spec, GaussianShiftedPartition.representative_spec] rfl unfold cubeAverage congr 1 calc _ = ∑' r,f (a r):=tsum_congr hpoint _ = ∑' r,f r:=a.tsum_eq f end section open MeasureTheory open scoped Classical MatrixGroups BigOperators section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota EisensteinCuspModThree namespace RootNotationCorrespondenceTests02 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondenceTests02 open RootNotationCorrespondenceTests02 (Eis) lemma cubicSource_period_three (n:Eis) (w:HyperbolicSpace) : cubicSourceResidualFunction (complexTranslation (3*eisEmbedding n) • w)= cubicSourceResidualFunction w := by obtain ⟨z,v,hv,rfl⟩:=upperPoint_surjective w rw [complexTranslation_action] simp only [cubicSourceResidualFunction_eq_bessel] exact sourceBesselFunction_period v hv z n lemma cubicSource_period_one (w:HyperbolicSpace) : cubicSourceResidualFunction (complexTranslation 1 • w)=cubicSourceResidualFunction w := by have h:=cubicSourceResidualFunction_rational_invariant ModularGroup.T w change cubicSourceResidualFunction (rationalComplex ModularGroup.T • w)=_ at h rwa [rationalComplex_T_eq] at h lemma cubicSource_period_finTwo (t:Fin 2) (w:HyperbolicSpace) : cubicSourceResidualFunction (complexTranslation (t.val:ℂ) • w)=cubicSourceResidualFunction w := by fin_cases t · have hz:complexTranslation 0=1:=by apply Matrix.SpecialLinearGroup.ext intro i j fin_cases i <;> fin_cases j <;> simp [complexTranslation] simp only [Nat.cast_zero,hz,one_smul] · simpa using cubicSource_period_one w lemma cubicSource_cube_period_finTwo (p:Eis) (hp:p≠0) (hprimary:lambda^2∣p-1) (t:Fin 2) (w:HyperbolicSpace) : cubeAverage p hp cubicSourceResidualFunction (complexTranslation (t.val:ℂ) • w)= cubeAverage p hp cubicSourceResidualFunction w := by fin_cases t · have hz:complexTranslation 0=1:=by apply Matrix.SpecialLinearGroup.ext intro i j fin_cases i <;> fin_cases j <;> simp [complexTranslation] simp only [Nat.cast_zero,hz,one_smul] · simpa using cubeAverage_period_one p hp hprimary cubicSourceResidualFunction cubicSource_period_three cubicSource_period_one w theorem cubeSource_summand_average {M:SL(2,Eis)} {p q:Eis} (d:CubeCuspData M p q) (hp:p≠0) (v:ℝ) (hv:0 integralOrbitProjection H ((integralCoverRep H K q)⁻¹•w) := funext (integralCoverFiberPoint_rep H K q) rw [he] exact (continuous_integralOrbitProjection H).comp (continuous_hyperbolic_action (integralComplexMatrix ((integralCoverRep H K q)⁻¹:SL(2,ActualEisensteinCubic.O)))) lemma integralCoverMap_fiber {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (w : HyperbolicSpace) : (integralCoverMap hHK) ⁻¹' {integralOrbitProjection K w}= Set.range (fun q : IntegralCoverCosets H K=>integralCoverFiberPoint H K q w) := by let := integralSubgroupHyperbolicAction K ext u constructor · intro hu induction u using Quotient.inductionOn with | _ z => have he : integralOrbitProjection K z=integralOrbitProjection K w := hu obtain ⟨k,hk⟩ := Quotient.exact he refine ⟨(k : IntegralCoverCosets H K),?_⟩ change integralCoverFiberPoint H K (k : IntegralCoverCosets H K) w=integralOrbitProjection H z rw [integralCoverFiberPoint_mk] congr 1 rw [←hk] exact inv_smul_smul k z · rintro ⟨q,rfl⟩ exact integralCoverMap_fiberPoint hHK q w lemma integralCoverMap_preimage_image {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (S : Set (IntegralOrbitQuotient H)) : (integralOrbitProjection K) ⁻¹' (integralCoverMap hHK '' S)= ⋃q : IntegralCoverCosets H K,(integralCoverFiberPoint H K q) ⁻¹' S := by ext w constructor · rintro ⟨u,hu,huw⟩ have hh : u∈(integralCoverMap hHK) ⁻¹' {integralOrbitProjection K w} := huw rw [integralCoverMap_fiber hHK w] at hh obtain ⟨q,rfl⟩ := hh exact Set.mem_iUnion.mpr ⟨q,hu⟩ · intro hw obtain ⟨q,hq⟩ := Set.mem_iUnion.mp hw exact ⟨integralCoverFiberPoint H K q w,hq,integralCoverMap_fiberPoint hHK q w⟩ theorem integralCoverMap_isClosedMap {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) [H.IsFiniteRelIndex K] : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology IsClosedMap (integralCoverMap hHK) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ intro S hS have hq : Topology.IsQuotientMap (integralOrbitProjection K) := isQuotientMap_quotient_mk' apply hq.isCoinducing.isClosed_preimage.mp rw [integralCoverMap_preimage_image] exact isClosed_iUnion_of_finite (fun q=>hS.preimage (integralCoverFiberPoint_continuous H K q)) theorem integralCoverMap_isProperMap {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) [H.IsFiniteRelIndex K] : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology IsProperMap (integralCoverMap hHK) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ apply isProperMap_iff_isClosedMap_and_compact_fibers.mpr refine ⟨integralCoverMap_continuous hHK,integralCoverMap_isClosedMap hHK,?_⟩ intro q induction q using Quotient.inductionOn with | _ w => change IsCompact ((integralCoverMap hHK) ⁻¹' {integralOrbitProjection K w}) rw [integralCoverMap_fiber hHK w] exact (Set.finite_range _).isCompact theorem integralCoverMap_compact_preimage {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) [H.IsFiniteRelIndex K] (S : Set (IntegralOrbitQuotient K)) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hS : IsCompact S), IsCompact ((integralCoverMap hHK) ⁻¹' S) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hS : IsCompact S) => (integralCoverMap_isProperMap hHK).isCompact_preimage hS end section open MeasureTheory open scoped Classical MatrixGroups BigOperators section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota EisensteinCuspModThree namespace RootNotationCorrespondenceTests05 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondenceTests05 open RootNotationCorrespondenceTests05 (Eis) lemma cubeCuspTriangular_norm_sq_pos {M:SL(2,Eis)} {p q:Eis} (d:CubeCuspData M p q) (hp:p≠0) : 0<‖cubeCuspTriangular d hp 1 1‖^2 := by rw [cubeCuspTriangular_norm_sq] exact Real.rpow_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hp)) _ def cubeReducedRemainder {M:SL(2,Eis)} {p q:Eis} (d:CubeCuspData M p q) (hp:p≠0) (z:ℂ) (v:ℝ) (hv:0cubeReducedRemainder (d r) hp.ne_zero z v hv):=Summable.of_finite have hs2:Summable (fun r:Eis⧸Ideal.span {p^3}=>(v:ℂ)^(2/3:ℂ)* (sourceCuspLeadingCoefficient (d r).matrix*cubeCuspHeightWeight p (d r).exponent)):=Summable.of_finite rw [tsum_congr hpoint,hs1.tsum_add hs2,tsum_mul_left] calc _=(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹^3 * (∑' r:Eis⧸Ideal.span {p^3},cubeReducedRemainder (d r) hp.ne_zero z v hv)+ (v:ℂ)^(2/3:ℂ)*((Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹^3 * (∑' r:Eis⧸Ideal.span {p^3},sourceCuspLeadingCoefficient (d r).matrix*cubeCuspHeightWeight p (d r).exponent)):=by ring _=_:=by rw [cubeSource_leading_sum M p hp hprimary];ring rw [hu] unfold sourceCuspRemainder ring end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota EisensteinCuspModThree namespace RootNotationCorrespondenceTests06 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondenceTests06 open RootNotationCorrespondenceTests06 (Eis) lemma cubePrime_norm_ge_one (p:Eis) (hp:p≠0) : 1≤‖eisEmbedding p‖ := by have hn:1≤‖eisEmbedding p‖^2:=by rw [eisEmbedding_norm_sq_eq_absNorm_span] have hq:Ideal.absNorm (Ideal.span {p})≠0:= (Ideal.absNorm_ne_zero_iff _).mpr (finite_quotient_span hp) exact_mod_cast Nat.one_le_iff_ne_zero.mpr hq nlinarith [norm_nonneg (eisEmbedding p)] lemma cubeReducedRemainder_bound {M:SL(2,Eis)} {p q:Eis} (d:CubeCuspData M p q) (hp:p≠0) (K:ℝ) (hK:0≤K) (hrep:∀j:Fin 3,∀z:ℂ,∀v:ℝ,∀hv:0cubeReducedRemainder (d r) hp.ne_zero z v hv) (K*‖eisEmbedding p‖^9/v^3) (by positivity) (fun r=>cubeReducedRemainder_bound (d r) hp.ne_zero K hK hrep z v hv hv1) have hrest:‖(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹*sourceCuspRemainder M z v hv‖≤ (Ideal.absNorm (Ideal.span {p}):ℝ)⁻¹*(K/v^3):=by rw [norm_mul,norm_inv,Complex.norm_natCast] exact mul_le_mul_of_nonneg_left hbase (inv_nonneg.mpr (Nat.cast_nonneg _)) rw [cubeSource_difference_eq_remainders M p hp hprimary z v hv] refine (norm_sub_le _ _).trans ?_ calc _≤K*‖eisEmbedding p‖^9/v^3+(Ideal.absNorm (Ideal.span {p}):ℝ)⁻¹*(K/v^3):= add_le_add hsum hrest _=_:=by ring end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise Manifold ContDiff ENNReal open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationCorrespondenceTests07 abbrev O := ActualEisensteinCubic.O end RootNotationCorrespondenceTests07 open RootNotationCorrespondenceTests07 (O) lemma integralCoverMap_hasCompactSupport {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient K→ℂ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf : HasCompactSupport f), HasCompactSupport (fun q=>f (integralCoverMap hHK q)) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hf : HasCompactSupport f) => by let : T2Space (IntegralOrbitQuotient H) := integralOrbitQuotientT2 H apply HasCompactSupport.of_support_subset_isCompact (integralCoverMap_compact_preimage hHK (tsupport f) hf.isCompact) intro q hq exact subset_tsupport f hq lemma integralCoverTraceFunction_hasCompactSupport {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf : HasCompactSupport f), HasCompactSupport (integralCoverTraceFunction H K f) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hf : HasCompactSupport f) => by let : T2Space (IntegralOrbitQuotient K) := integralOrbitQuotientT2 K let : Fintype (IntegralCoverCosets H K) := Fintype.ofFinite _ apply HasCompactSupport.of_support_subset_isCompact (hf.isCompact.image (integralCoverMap_continuous hHK)) intro q hq induction q using Quotient.inductionOn with | _ w => change (∑r : IntegralCoverCosets H K,f (integralCoverFiberPoint H K r w))≠0 at hq obtain ⟨r,_,hr⟩ := Finset.exists_ne_zero_of_sum_ne_zero hq exact ⟨integralCoverFiberPoint H K r w,subset_tsupport f hr, integralCoverMap_fiberPoint hHK r w⟩ variable {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hJK : J≤globalKubotaKernel) [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) def kernelCorrespondenceFunction (f : KernelQuotient→ℂ) : KernelQuotient→ℂ := integralCoverTraceFunction H globalKubotaKernel (fun q=>f (integralCoverMap hJK (integralConjugateMap e g he q))) omit [J.IsFiniteRelIndex globalKubotaKernel] in lemma kernelCorrespondenceFunction_lift (f : KernelQuotient→ℂ) (w : HyperbolicSpace) : kernelCorrespondenceFunction hJK e g he f (integralOrbitProjection globalKubotaKernel w)= letI : Fintype (IntegralCoverCosets H globalKubotaKernel) := Fintype.ofFinite _ ∑q : IntegralCoverCosets H globalKubotaKernel, f (integralOrbitProjection globalKubotaKernel ((g*integralComplexMatrix (((integralCoverRep H globalKubotaKernel q)⁻¹: globalKubotaKernel):SL(2,ActualEisensteinCubic.O)))•w)) := by let : Fintype (IntegralCoverCosets H globalKubotaKernel) := Fintype.ofFinite _ change (∑q : IntegralCoverCosets H globalKubotaKernel, f (integralCoverMap hJK (integralConjugateMap e g he (integralCoverFiberPoint H globalKubotaKernel q w))))=_ apply Finset.sum_congr rfl intro q _ rw [integralCoverFiberPoint_rep,integralSubgroup_smul, integralConjugateMap_projection,integralCoverMap_projection,mul_smul] include hHK in lemma kernelCorrespondenceFunction_hasCompactSupport (f : KernelQuotient→ℂ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf : HasCompactSupport f), HasCompactSupport (kernelCorrespondenceFunction hJK e g he f) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hf : HasCompactSupport f) => by apply integralCoverTraceFunction_hasCompactSupport hHK exact (integralCoverMap_hasCompactSupport hJK f hf).comp_homeomorph (integralConjugateHomeomorph e g he) omit [J.IsFiniteRelIndex globalKubotaKernel] in lemma kernelCorrespondenceFunction_contMDiff (f : KernelQuotient→ℂ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f), let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ (kernelCorrespondenceFunction hJK e g he f) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology fun (hf : let _ : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace; ContMDiff 𝓘(ℝ,SpatialCoordinates) 𝓘(ℝ,ℂ) ∞ f) => by let : ChartedSpace SpatialCoordinates HyperbolicSpace := hyperbolicSpatialChartedSpace let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace dsimp only let : Fintype (IntegralCoverCosets H globalKubotaKernel) := Fintype.ofFinite _ apply kernel_contMDiff_of_lift simp_rw [kernelCorrespondenceFunction_lift] apply ContMDiff.sum intro q _ exact (hf.comp kernelProjection_contMDiff).comp (hyperbolicAction_contMDiff (g*integralComplexMatrix (((integralCoverRep H globalKubotaKernel q)⁻¹:globalKubotaKernel):SL(2,ActualEisensteinCubic.O)))) def kernelCorrespondenceTest (f : kernelSmoothTests) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology kernelSmoothTests := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ⟨kernelCorrespondenceFunction hJK e g he f.1, kernelCorrespondenceFunction_contMDiff hJK e g he f.1 f.2.1, kernelCorrespondenceFunction_hasCompactSupport hHK hJK e g he f.1 f.2.2⟩ end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CorrespondencePullback /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise Manifold ContDiff ENNReal InnerProductSpace open Finset AddChar MulChar EisensteinEmbedding section namespace RootNotationCorrespondencePullback01 abbrev O := ActualEisensteinCubic.O end RootNotationCorrespondencePullback01 open RootNotationCorrespondencePullback01 (O) lemma integralCoverMap_quasiMeasurePreserving {H K : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤K) (hK : K≤CubicKubota.levelThree) [H.IsFiniteRelIndex K] : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measure.QuasiMeasurePreserving (integralCoverMap hHK) (integralQuotientVolume H) (integralQuotientVolume K) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by refine ⟨integralCoverMap_measurable hHK,?_⟩ rw [integralCoverMap_measure hHK hK] exact Measure.smul_absolutelyContinuous variable {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hJK : J≤globalKubotaKernel) [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) def kernelCorrespondenceL2 : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2→L[ℂ]KernelQuotientL2 := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (integralCoverTrace hHK globalKubotaKernel_le_levelThree).comp ((integralConjugatePullback e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree)).toContinuousLinearMap.comp (integralCoverPullback hJK globalKubotaKernel_le_levelThree)) lemma kernelCorrespondenceL2_representative (F : KernelQuotientL2) (f : KernelQuotient→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hf : Measurable f) (hrep : F=ᵐ[integralQuotientVolume globalKubotaKernel]f), kernelCorrespondenceL2 hHK hJK e g he F=ᵐ[integralQuotientVolume globalKubotaKernel] kernelCorrespondenceFunction hJK e g he f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hf : Measurable f) (hrep : F=ᵐ[integralQuotientVolume globalKubotaKernel]f) => by have hcover := (integralCoverPullback_ae hJK globalKubotaKernel_le_levelThree F).trans ((integralCoverMap_quasiMeasurePreserving hJK globalKubotaKernel_le_levelThree).ae_eq_comp hrep) have hconj := (integralConjugatePullback_ae e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree) _).trans ((integralConjugateMap_measurePreserving e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree)).quasiMeasurePreserving.ae_eq_comp hcover) exact integralCoverTrace_representative hHK globalKubotaKernel_le_levelThree _ _ ((hf.comp (integralCoverMap_measurable hJK)).comp (integralConjugateMap_measurable e g he)) hconj lemma kernelCorrespondenceTest_mass (f : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology kernelSmoothTestsToL2 (kernelCorrespondenceTest hHK hJK e g he f)= kernelCorrespondenceL2 hHK hJK e g he (kernelSmoothTestsToL2 f) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : ChartedSpace SpatialCoordinates KernelQuotient := kernelSpatialChartedSpace let : BorelSpace KernelQuotient := kernelQuotientBorel apply Lp.ext exact (kernelSmoothTests_memLp (kernelCorrespondenceTest hHK hJK e g he f)).coeFn_toLp.trans (kernelCorrespondenceL2_representative hHK hJK e g he _ f.1 f.2.1.continuous.measurable (kernelSmoothTests_memLp f).coeFn_toLp).symm include hHK in lemma kernelCorrespondenceFunction_integrable (f : KernelQuotient→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hf : Measurable f) (hi : Integrable f (integralQuotientVolume globalKubotaKernel)), Integrable (kernelCorrespondenceFunction hJK e g he f) (integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hf : Measurable f) (hi : Integrable f (integralQuotientVolume globalKubotaKernel)) => by have hcover := (integralCoverMap_measurePreserving hJK globalKubotaKernel_le_levelThree).integrable_comp_of_integrable (hi.smul_measure (c:=(J.relIndex globalKubotaKernel:ℝ≥0∞)) (by simp)) have hconj := (integralConjugateMap_measurePreserving e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree)).integrable_comp_of_integrable hcover exact integralCoverTraceFunction_integrable hHK globalKubotaKernel_le_levelThree _ ((hf.comp (integralCoverMap_measurable hJK)).comp (integralConjugateMap_measurable e g he)) hconj include hHK in lemma kernelCorrespondenceFunction_integral (f : KernelQuotient→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀ (hf : Measurable f) (hi : Integrable f (integralQuotientVolume globalKubotaKernel)), (∫q,kernelCorrespondenceFunction hJK e g he f q∂integralQuotientVolume globalKubotaKernel)= (J.relIndex globalKubotaKernel:ℂ)*(∫q,f q∂integralQuotientVolume globalKubotaKernel) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace fun (hf : Measurable f) (hi : Integrable f (integralQuotientVolume globalKubotaKernel)) => by have hcover := (integralCoverMap_measurePreserving hJK globalKubotaKernel_le_levelThree).integrable_comp_of_integrable (hi.smul_measure (c:=(J.relIndex globalKubotaKernel:ℝ≥0∞)) (by simp)) have hconj := (integralConjugateMap_measurePreserving e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree)).integrable_comp_of_integrable hcover have hm := integralConjugateMap_measurePreserving e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree) change Integrable (fun q=>f (integralCoverMap hJK (integralConjugateMap e g he q))) _ at hconj calc _ = ∫q,f (integralCoverMap hJK (integralConjugateMap e g he q))∂integralQuotientVolume H := integralCoverTraceFunction_integral hHK globalKubotaKernel_le_levelThree _ ((hf.comp (integralCoverMap_measurable hJK)).comp (integralConjugateMap_measurable e g he)) hconj _ = ∫q,f (integralCoverMap hJK q)∂integralQuotientVolume J := by have hh := integral_map («μ»:=integralQuotientVolume H) hm.measurable.aemeasurable (hf.comp (integralCoverMap_measurable hJK)).aestronglyMeasurable rw [hm.map_eq] at hh exact hh.symm _ = ∫q,f q∂Measure.map (integralCoverMap hJK) (integralQuotientVolume J) := (integral_map (integralCoverMap_measurable hJK).aemeasurable hf.aestronglyMeasurable).symm _ = _ := by rw [integralCoverMap_measure hJK globalKubotaKernel_le_levelThree, integral_smul_measure] simp only [ENNReal.toReal_natCast,Complex.real_smul,Complex.ofReal_natCast] end def coverEnergyDensity (F : EuclideanSpatial→ℂ) (p : EuclideanSpatial) : ℝ := euclideanScalarDirichletDensity (fun x=>(F x).re) p+ euclideanScalarDirichletDensity (fun x=>(F x).im) p def coverGradientAt (F : EuclideanSpatial→ℂ) (p : EuclideanSpatial) : EuclideanSpace ℂ (Fin 3) := WithLp.toLp 2 (fun j=>(p 2:ℂ)*fderiv ℝ F p (EuclideanSpace.basisFun (Fin 3) ℝ j)) lemma coverGradientAt_norm_sq (F : EuclideanSpatial→ℂ) (p : EuclideanSpatial) (hF : DifferentiableAt ℝ F p) : ‖coverGradientAt F p‖^2=coverEnergyDensity F p := by have hr := (Complex.reCLM.hasFDerivAt.comp p hF.hasFDerivAt).fderiv have hi := (Complex.imCLM.hasFDerivAt.comp p hF.hasFDerivAt).fderiv change fderiv ℝ (fun x=>(F x).re) p=_ at hr change fderiv ℝ (fun x=>(F x).im) p=_ at hi unfold coverEnergyDensity euclideanScalarDirichletDensity rw [hr,hi,(EuclideanSpace.basisFun (Fin 3) ℝ).norm_dual, (EuclideanSpace.basisFun (Fin 3) ℝ).norm_dual,←mul_add,←Finset.sum_add_distrib] rw [PiLp.norm_sq_eq_of_L2] change (∑j:Fin 3,‖(p 2:ℂ)*fderiv ℝ F p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2)=_ simp only [norm_mul,mul_pow,Complex.norm_real,Real.norm_eq_abs,sq_abs,Finset.mul_sum] apply Finset.sum_congr rfl intro j _ congr 1 change ‖fderiv ℝ F p (EuclideanSpace.basisFun (Fin 3) ℝ j)‖^2= (fderiv ℝ F p (EuclideanSpace.basisFun (Fin 3) ℝ j)).re^2+ (fderiv ℝ F p (EuclideanSpace.basisFun (Fin 3) ℝ j)).im^2 simpa only [Complex.normSq_apply,pow_two] using (Complex.normSq_eq_norm_sq (fderiv ℝ F p (EuclideanSpace.basisFun (Fin 3) ℝ j))).symm lemma coverEnergyDensity_comp (g : SL(2,ℂ)) (F : EuclideanSpatial→ℂ) (p : EuclideanSpatial) (hp : 0

(F p).re) p hp (Complex.reCLM.differentiableAt.comp _ hF) have hi := hyperbolic_cotangent_energy_comp g (fun p=>(F p).im) p hp (Complex.imCLM.differentiableAt.comp _ hF) exact congrArg₂ (fun x y : ℝ=>x+y) hr hi lemma coverGradientAt_sum {ι : Type*} (s : Finset ι) (F : ι→EuclideanSpatial→ℂ) (p : EuclideanSpatial) (hF : ∀i∈s,DifferentiableAt ℝ (F i) p) : coverGradientAt (fun x=>∑i∈s,F i x) p=∑i∈s,coverGradientAt (F i) p := by apply (WithLp.equiv 2 (Fin 3→ℂ)).injective funext j simp only [coverGradientAt,fderiv_fun_sum hF,_root_.sum_apply, WithLp.equiv_apply,Finset.mul_sum,WithLp.ofLp_sum,Finset.sum_apply] lemma norm_sum_sq_le_card {ι E : Type*} [NormedAddCommGroup E] (s : Finset ι) (f : ι→E) : ‖∑i∈s,f i‖^2≤(s.card:ℝ)*∑i∈s,‖f i‖^2 := by calc _ ≤ (∑i∈s,‖f i‖)^2 := (sq_le_sq₀ (norm_nonneg _) (Finset.sum_nonneg (fun _ _=>norm_nonneg _))).mpr (norm_sum_le _ _) _ ≤ _ := by simpa only [one_mul,one_pow,Finset.sum_const,nsmul_eq_mul,mul_one] using (Finset.sum_mul_sq_le_sq_mul_sq s (fun _=> (1:ℝ)) (fun i=>‖f i‖)) lemma coverEnergyDensity_sum_le {ι : Type*} (s : Finset ι) (F : ι→EuclideanSpatial→ℂ) (p : EuclideanSpatial) (hF : ∀i∈s,DifferentiableAt ℝ (F i) p) : coverEnergyDensity (fun x=>∑i∈s,F i x) p≤(s.card:ℝ)*∑i∈s,coverEnergyDensity (F i) p := by rw [←coverGradientAt_norm_sq _ _ (DifferentiableAt.fun_sum hF),coverGradientAt_sum s F p hF] have hh := norm_sum_sq_le_card s (fun i=>coverGradientAt (F i) p) calc _ ≤ _ := hh _ = _ := by congr 1 apply Finset.sum_congr rfl intro i hi exact coverGradientAt_norm_sq (F i) p (hF i hi) lemma kernelTestEnergyDensity_eq_cover (f : kernelSmoothTests) (w : HyperbolicSpace) : kernelTestEnergyDensity f w=coverEnergyDensity (kernelTestField f) (hyperbolicEuclideanCoordinates w) := rfl end section open Filter MeasureTheory open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic CubicKubota ConcreteTraceCRT namespace RootNotationCorrespondencePullback02 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondencePullback02 open RootNotationCorrespondencePullback02 (Eis) lemma rational_unipotent_upper (n:ℕ) : rationalEmbedding (ModularGroup.T^n)=unitCuspUpper (n:Eis) := by rw [←rationalUnipotent_nat] apply Subtype.ext change ( !![(1 : ℤ), (n : ℤ); 0, 1]).map (Int.castRingHom Eis) = !![1, (n : Eis); 0, 1] apply Matrix.ext intro i j fin_cases i <;> fin_cases j <;> simp lemma rational_cusp_lower_section (u:Eisˣ) (n:ℕ) (z:ℂ) (v:ℝ) (hv:0(4:ℂ)⁻¹*(eisenstein (integralComplexMatrix (lowerCuspMatrix (u:Eis))*upperSection z v hv) s+c)) apply Finset.sum_congr rfl intro n hn rw [←mul_assoc,rational_cusp_lower_section] theorem sourceEisenstein_primitive_lower_four (u t:Eisˣ) (hu:(u:Eis)^2+(u:Eis)+1=0) (ht:-(u:Eis)*(1+2*(u:Eis))=onceCuspScale t) (z:ℂ) (v:ℝ) (hv:0eisenstein (g*upperSection (z+b) v hv) s) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by have hc:Continuous (fun z:ℂ=>(⟨(z+b,v),hv⟩:UpperCoordinates)):=by fun_prop have he : Continuous (fun z:ℂ=>hyperbolicEisenstein s (g • upperPoint (z+b) v hv)) := by simpa only [Function.comp_def] using ((hyperbolicEisenstein_continuous s hs).comp (continuous_translatedUpperCoordinates g)).comp hc simpa only [hyperbolicEisenstein_fixed_upper] using he lemma integrable_fixed_left_Eisenstein_fourier (g:SL(2,ℂ)) (v:ℝ) (hv:0eisenstein (g*upperSection (z+b) v hv) s*ShortDraftTrace.breveE (-freq*z)) periodDomain := by apply periodDomain_integrable_of_continuous apply (continuous_fixed_left_Eisenstein g v hv s hs b).mul change Continuous (fun z:ℂ=>Complex.exp (2*Real.pi*Complex.I*((-freq*z)+starRingEnd ℂ (-freq*z)))) fun_prop end section open Filter MeasureTheory open scoped BigOperators Classical MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicKubota namespace RootNotationCorrespondencePullback03 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondencePullback03 open RootNotationCorrespondencePullback03 (Eis) def ramifiedCuspGaussSeries (b:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit b)) (s:ℂ) : ℂ := (4:ℂ)⁻¹*(unitCuspGaussSeries 1 (ramifiedCuspRoot b) h s+ ShortDraftTrace.breveE (ninthCuspFrequency h*eisEmbedding (↑(ramifiedCuspRoot b)⁻¹:Eis))* (unitCuspGaussSeries (-(ramifiedCuspRoot b)) (-(ramifiedCuspRoot b)) h s+ unitCuspGaussSeries (-(ramifiedCuspRoot b)) 1 h s+ onceCuspGaussSeries (-(ramifiedCuspRoot b)) (ramifiedCuspScaleUnit b) h hf s)) theorem ramifiedSourceEisenstein_fourier (b:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit b)) (v:ℝ) (hv:0eisenstein (integralComplexMatrix (lowerCuspMatrix (t:Eis))*upperSection z v hv) s* ShortDraftTrace.breveE (-ninthCuspFrequency h*z) let f1:ℂ→ℂ:=fun z=>eisenstein (integralComplexMatrix (unitCuspDiagonal (-t))* integralComplexMatrix (lowerCuspMatrix (-(t:Eis)))*upperSection (z+shift) v hv) s* ShortDraftTrace.breveE (-ninthCuspFrequency h*z) let f2:ℂ→ℂ:=fun z=>eisenstein (integralComplexMatrix (unitCuspDiagonal (-t))* integralComplexMatrix (lowerCuspMatrix 1)*upperSection (z+shift) v hv) s* ShortDraftTrace.breveE (-ninthCuspFrequency h*z) let f3:ℂ→ℂ:=fun z=>eisenstein (integralComplexMatrix (unitCuspDiagonal (-t))* integralComplexMatrix (lowerCuspMatrix (onceCuspScale (ramifiedCuspScaleUnit b)))*upperSection (z+shift) v hv) s* ShortDraftTrace.breveE (-ninthCuspFrequency h*z) have hi0:IntegrableOn f0 periodDomain:=by simpa only [f0,add_zero] using integrable_fixed_left_Eisenstein_fourier (integralComplexMatrix (lowerCuspMatrix (t:Eis))) v hv s hs 0 (ninthCuspFrequency h) have hi1:IntegrableOn f1 periodDomain:=integrable_fixed_left_Eisenstein_fourier _ v hv s hs shift _ have hi2:IntegrableOn f2 periodDomain:=integrable_fixed_left_Eisenstein_fourier _ v hv s hs shift _ have hi3:IntegrableOn f3 periodDomain:=integrable_fixed_left_Eisenstein_fourier _ v hv s hs shift _ have heq:(∫z in periodDomain,sourceEisenstein s (integralComplexMatrix (lowerCuspMatrix (t:Eis)) • upperPoint z v hv)*ShortDraftTrace.breveE (-ninthCuspFrequency h*z))= (4:ℂ)⁻¹*((∫z in periodDomain,f0 z)+(∫z in periodDomain,f1 z)+ (∫z in periodDomain,f2 z)+(∫z in periodDomain,f3 z)):=by calc _ = ∫z in periodDomain,(4:ℂ)⁻¹*(f0 z+f1 z+f2 z+f3 z) := by apply integral_congr_ae exact Filter.Eventually.of_forall (fun z=>by dsimp only rw [sourceEisenstein_primitive_lower_four t (ramifiedCuspScaleUnit b) (ramifiedCuspRoot_primitive b) (ramifiedCuspScaleUnit_spec b)] dsimp only [f0,f1,f2,f3,shift] ring) _ = _ := by rw [integral_const_mul] rw [integral_add (f:=fun z=>f0 z+f1 z+f2 z) (g:=f3) ((hi0.add hi1).add hi2) hi3, integral_add (f:=fun z=>f0 z+f1 z) (g:=f2) (hi0.add hi1) hi2, integral_add (f:=f0) (g:=f1) hi0 hi1] have hr0:(↑(1:Eisˣ)⁻¹:Eis)^2*(t:Eis)=omega^(ramifiedCuspDirectIndex b):=by simpa [t] using ramifiedCuspRoot_val b have hr1:(↑(-t)⁻¹:Eis)^2*((-t:Eisˣ):Eis)=-(omega^(ramifiedCuspOppositeIndex b)):= ramifiedCusp_opposite_character b have hr2:(↑(-t)⁻¹:Eis)^2*((1:Eisˣ):Eis)=omega^(ramifiedCuspDirectIndex b):=by rw [Units.val_one,mul_one,ramifiedCusp_neg_inv_square,ramifiedCuspRoot_val] have hb2:(3:Eis)∣h+ramifiedAffineParameter (ramifiedCuspDirectIndex b) 0*((1:Eisˣ):Eis):=by simpa using ramifiedCusp_unit_base b h hf have h0:(∫z in periodDomain,f0 z)=arch*unitCuspGaussSeries 1 t h s:=by simpa only [unitCuspDiagonal_one,map_one,one_mul,f0,arch] using unitCusp_eisenstein_fourier_base 1 t (ramifiedCuspDirectIndex b) h (Or.inl hr0) (ramifiedCusp_direct_base b h hf) v hv s hs have h1:(∫z in periodDomain,f1 z)=ShortDraftTrace.breveE (ninthCuspFrequency h*shift)* (arch*unitCuspGaussSeries (-t) (-t) h s):=by have he:=diagonal_unit_fourier_shift (-t) (-t) (ramifiedCuspOppositeIndex b) h (Or.inr hr1) (ramifiedCusp_opposite_base b h hf) v hv s shift rw [unitCusp_eisenstein_fourier_base (-t) (-t) (ramifiedCuspOppositeIndex b) h (Or.inr hr1) (ramifiedCusp_opposite_base b h hf) v hv s hs] at he simpa only [f1,Units.val_neg,arch] using he have h2:(∫z in periodDomain,f2 z)=ShortDraftTrace.breveE (ninthCuspFrequency h*shift)* (arch*unitCuspGaussSeries (-t) 1 h s):=by have he:=diagonal_unit_fourier_shift (-t) 1 (ramifiedCuspDirectIndex b) h (Or.inl hr2) hb2 v hv s shift rw [unitCusp_eisenstein_fourier_base (-t) 1 (ramifiedCuspDirectIndex b) h (Or.inl hr2) hb2 v hv s hs] at he simpa only [f2,Units.val_one,arch] using he have h3:(∫z in periodDomain,f3 z)=ShortDraftTrace.breveE (ninthCuspFrequency h*shift)* (arch*onceCuspGaussSeries (-t) (ramifiedCuspScaleUnit b) h hf s):=by dsimp only [f3] rw [diagonal_once_fourier_shift (-t) (ramifiedCuspScaleUnit b) h hf v hv s shift hs, onceCusp_eisenstein_fourier (-t) (ramifiedCuspScaleUnit b) h hf v hv s hs] rw [heq,h0,h1,h2,h3] dsimp only [ramifiedCuspGaussSeries,arch,shift,t] ring end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace RootNotationCorrespondencePullback04 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondencePullback04 open RootNotationCorrespondencePullback04 (Eis) theorem finite_unramified_residue {ι:Type*} [Fintype ι] [DecidableEq ι] (index:ι→Eis) (coefficient:ι→ℂ→ℂ) (hc:∀i s,1(s-4/3)*f s) (𝓝[≠] (4/3:ℂ)) (𝓝 R)) (hinit:∀s:ℂ,4cuspWhittakerHeightFactor s (3*index i) let G:ι→ℂ→ℂ:=fun i s=>translatedCuspFamily (3*index i) oppositeSource 2 3 (by norm_num) (by norm_num) s let D:ℂ→ℂ:=fun s=>∏i,H i s let E:ι→ℂ→ℂ:=fun i s=>∏j∈Finset.univ.erase i,H j s have hH:∀i s,1 cuspWhittakerHeightFactor_analyticAt (3*index i) s hs have hD:∀s,1 Finset.analyticAt_fun_prod _ (fun i hi=>hH i s hs) have hE:∀i s,1 Finset.analyticAt_fun_prod _ (fun j hj=>hH j s hs) have hprod (i:ι) (s:ℂ):H i s*E i s=D s:=by exact Finset.mul_prod_erase Finset.univ (fun j=>H j s) (Finset.mem_univ i) let domain:Set ℂ:={s|1f s*D s) domain:=fun s hs=>(hf s hs.1 hs.2).mul (hD s hs.1) have hb:AnalyticOnNhd ℂ (fun s=>∑i,coefficient i s*G i s*E i s) domain:=by intro s hs apply Finset.analyticAt_fun_sum intro i hi exact ((hc i s hs.1).mul (translatedCuspFamily_analyticAt_nonreal (3*index i) oppositeSource 2 3 (by norm_num) (by norm_num) s hs.1.ne' hs.2.ne')).mul (hE i s hs.1) have hopen:IsOpen {s:ℂ|4f s*D s)=ᶠ[𝓝 (5+Complex.I:ℂ)] (fun s=>∑i,coefficient i s*G i s*E i s):=by filter_upwards [hopen.mem_nhds (by norm_num)] with s hs rw [hinit s hs.1 hs.2,Finset.sum_mul] apply Finset.sum_congr rfl intro i hi dsimp only [G] rw [translatedCuspFamily_opposite_initial (index i) s hs.1 hs.2] change coefficient i s*unramifiedCubicGaussSeries s (index i)*D s= coefficient i s*(unramifiedCubicGaussSeries s (index i)*H i s)*E i s rw [←hprod i s] ring have heq:=ha.eqOn_of_preconnected_of_eventuallyEq hb hconvex.isPreconnected (show (5+Complex.I:ℂ)∈domain by norm_num [domain]) hev have hDc:Tendsto D (𝓝[≠] (4/3:ℂ)) (𝓝 (D (4/3))):= (hD (4/3) (by norm_num)).continuousAt.tendsto.mono_left nhdsWithin_le_nhds have hl:=(hlim.mul hDc).comp upperVertical_tendsto_cubic_punctured have hg:∀i,Tendsto (fun s:ℂ=>coefficient i s*((s-4/3)*G i s)*E i s) (𝓝[≠] (4/3:ℂ)) (𝓝 (coefficient i (4/3)*translatedCuspFourier (3*index i) oppositeSource cubicEisensteinResidue*E i (4/3))):=by intro i exact (((hc i (4/3) (by norm_num)).continuousAt.tendsto.mono_left nhdsWithin_le_nhds).mul (translatedCuspFamily_residue_limit (3*index i) oppositeSource 2 3 (by norm_num) (by norm_num))).mul ((hE i (4/3) (by norm_num)).continuousAt.tendsto.mono_left nhdsWithin_le_nhds) have hr:=(tendsto_finsetSum Finset.univ (fun i hi=>hg i)).comp upperVertical_tendsto_cubic_punctured have hel:(fun t:ℝ=>((((4/3:ℂ)+(t:ℂ)*Complex.I)-4/3)*f ((4/3:ℂ)+(t:ℂ)*Complex.I))* D ((4/3:ℂ)+(t:ℂ)*Complex.I))=ᶠ[𝓝[>] (0:ℝ)] (fun t:ℝ=>∑i,coefficient i ((4/3:ℂ)+(t:ℂ)*Complex.I)* ((((4/3:ℂ)+(t:ℂ)*Complex.I)-4/3)*G i ((4/3:ℂ)+(t:ℂ)*Complex.I))* E i ((4/3:ℂ)+(t:ℂ)*Complex.I)):=by filter_upwards [self_mem_nhdsWithin] with t ht have ht0:0 cuspWhittakerHeightFactor_center_ne_zero (3*index i)) apply mul_right_cancel₀ hDn rw [Finset.sum_mul] refine hres.trans ?_ apply Finset.sum_congr rfl intro i hi change coefficient i (4/3)*translatedCuspFourier (3*index i) oppositeSource cubicEisensteinResidue*E i (4/3)=coefficient i (4/3)* (translatedCuspFourier (3*index i) oppositeSource cubicEisensteinResidue/H i (4/3))*D (4/3) rw [←hprod i (4/3)] field_simp [show H i (4/3)≠0 from cuspWhittakerHeightFactor_center_ne_zero (3*index i)] end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open CubicKubota lemma cuspStrip_integrable_continuous (a b:ℝ) (ha:0 (hf.continuousOn.integrableOn_compact (cuspHeightCompact_isCompact a b ha)).mono_set (cuspPeriodStrip_subset_heightCompact a b ha) def sourceArbitraryHeightFamily (M:SL(2,ℂ)) (a b:ℝ) (ha:0(s-4/3)*sourceArbitraryHeightFamily M a b ha ρ freq s) (𝓝[≠] (4/3:ℂ)) (𝓝 (sourceArbitraryHeightFourier M a b ha ρ freq cubicEisensteinResidue)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have he:=(tendsto_finsetSum Finset.univ (fun i hi=> arbitraryCuspHeightFamily_residue_limit (rationalComplex (rationalBruhatRep i)*M) a b ha ρ freq)).const_mul ((24:ℂ)⁻¹) convert he using 1 · funext s rw [sourceArbitraryHeightFamily,←Finset.mul_sum] ring · simp only [sourceArbitraryHeightFourier,_root_.smul_apply, _root_.sum_apply,smul_eq_mul] lemma sourceProjection_integral (f:HyperbolicSpace→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf:Continuous f) (M:SL(2,ℂ)) (a b:ℝ) (ha:0 by have hi (i:RationalBruhatIndex) : IntegrableOn (fun w=>f ((rationalComplex (rationalBruhatRep i)*M)•w)*arbitraryCuspWeightedPhase ρ freq w) (cuspPeriodStrip a b) hyperbolicVolume := cuspStrip_integrable_continuous a b ha _ ((hf.comp (continuous_hyperbolic_action _)).mul (arbitraryCuspWeightedPhase_continuous ρ freq)) calc _ = ∫w in cuspPeriodStrip a b,(24:ℂ)⁻¹*∑i:RationalBruhatIndex, f ((rationalComplex (rationalBruhatRep i)*M)•w)*arbitraryCuspWeightedPhase ρ freq w∂hyperbolicVolume := by apply integral_congr_ae exact Eventually.of_forall (fun w=>by dsimp only rw [sourceProjection_eq_twentyFour] simp only [rationalComplex,MonoidHom.comp_apply,mul_smul] rw [←Finset.sum_mul] ring) _ = _ := by rw [integral_const_mul,integral_finsetSum _ (fun i hi'=>hi i)] lemma sourceArbitraryHeightFamily_initial (M:SL(2,ℂ)) (a b:ℝ) (ha:0c*arbitraryCuspWeightedPhase ρ freq w) hw lemma sourceArbitraryHeightFourier_residue_integral (M:SL(2,ℂ)) (a b:ℝ) (ha:0sourceEisenstein s (M•w)* arbitraryCuspWeightedPhase ρ (ninthCuspFrequency h) w have hg:Continuous g:=((sourceProjection_continuous _ (hyperbolicEisenstein_continuous s hs)).comp (continuous_hyperbolic_action M)).mul (arbitraryCuspWeightedPhase_continuous ρ _) rw [cuspPeriodStrip_integral_coordinates_of_pos a b ha g hg.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable_of_pos a b ha g hg)] rw [arbitraryIntervalWhittaker,←integral_const_mul] apply setIntegral_congr_fun measurableSet_Icc intro v hv have hv0:0unitCuspUnramifiedIndex 1 (ramifiedCuspRoot side) h | .inr (.inl _)=>unitCuspUnramifiedIndex (-(ramifiedCuspRoot side)) (-(ramifiedCuspRoot side)) h | .inr (.inr (.inl _))=>unitCuspUnramifiedIndex (-(ramifiedCuspRoot side)) 1 h | .inr (.inr (.inr l))=>3*((↑(-(ramifiedCuspRoot side))⁻¹:Eis)^2* (onceCuspScale (ramifiedCuspScaleUnit side)*omega^l.val))^2* onceCuspFrequencyQuotient (ramifiedCuspScaleUnit side) h hf l def ramifiedSixWeight (side:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit side)) (i:RamifiedSixBranch) (s:ℂ) :ℂ:= let t:=ramifiedCuspRoot side let phase:=ShortDraftTrace.breveE (ninthCuspFrequency h*eisEmbedding (↑t⁻¹:Eis)) match i with | .inl _=>(4:ℂ)⁻¹*ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding (t:Eis)) | .inr (.inl _)=>(4:ℂ)⁻¹*phase*ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding ((-t:Eisˣ):Eis)) | .inr (.inr (.inl _))=>(4:ℂ)⁻¹*phase*ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding ((1:Eisˣ):Eis)) | .inr (.inr (.inr l))=>(4:ℂ)⁻¹*phase* (if (3:Eis)∣onceCuspFrequencyQuotient (ramifiedCuspScaleUnit side) h hf l+ ramifiedAffineParameter (onceCuspRayIndex (-t) (ramifiedCuspScaleUnit side) l).val 1 then (3:ℂ)*(3:ℂ)^(-s)*ShortDraftTrace.breveE (ninthCuspFrequency h/eisEmbedding (onceCuspScale (ramifiedCuspScaleUnit side)*omega^l.val)) else 0) lemma ramifiedSixWeight_analytic (side:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit side)) (i:RamifiedSixBranch) (s:ℂ) : AnalyticAt ℂ (ramifiedSixWeight side h hf i) s := by rcases i with i|i · exact analyticAt_const rcases i with i|i · exact analyticAt_const rcases i with i|i · exact analyticAt_const unfold ramifiedSixWeight dsimp only split_ifs · apply analyticAt_const.mul apply AnalyticAt.mul _ analyticAt_const apply analyticAt_const.mul apply Complex.analyticAt_iff_eventually_differentiableAt.mpr exact Eventually.of_forall (fun z=>(differentiableAt_id.neg).const_cpow (Or.inl (by norm_num))) · exact analyticAt_const lemma ramifiedCuspGaussSeries_eq_six (side:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit side)) (s:ℂ) : ramifiedCuspGaussSeries side h hf s= ∑i:RamifiedSixBranch,ramifiedSixWeight side h hf i s* unramifiedCubicGaussSeries s (ramifiedSixIndex side h hf i) := by simp only [Fintype.sum_sum_type,Fintype.sum_unique,ramifiedSixWeight,ramifiedSixIndex, ramifiedCuspGaussSeries,unitCuspGaussSeries,unitCuspUnramifiedIndex,onceCuspGaussSeries] simp only [Fin.sum_univ_three] split_ifs <;> ring def ramifiedArithmeticResidue (side:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit side)) :ℂ:= ∑i:RamifiedSixBranch,ramifiedSixWeight side h hf i (4/3)* unramifiedGaussResidue (ramifiedSixIndex side h hf i) end open CubicKubota namespace RootNotationRamifiedSixBranches03 abbrev Eis := ActualEisensteinCubic.O end RootNotationRamifiedSixBranches03 open RootNotationRamifiedSixBranches03 (Eis) theorem ramifiedSource_height_residue (side:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit side)) (a b:ℝ) (ha:0 ramifiedSixWeight side h hf i s*arbitraryIntervalWhittaker a b ρ (ninthCuspFrequency h) s have hc:∀i s,1 (ramifiedSixWeight_analytic side h hf i s).mul (arbitraryIntervalWhittaker_analyticAt a b ha ρ (ninthCuspFrequency h) s hs) have he:=finite_unramified_residue (ramifiedSixIndex side h hf) coeff hc (sourceArbitraryHeightFamily M a b ha ρ (ninthCuspFrequency h)) (sourceArbitraryHeightFourier M a b ha ρ (ninthCuspFrequency h) cubicEisensteinResidue) (sourceArbitraryHeightFamily_analyticAt M a b ha ρ (ninthCuspFrequency h)) (sourceArbitraryHeightFamily_residue_limit M a b ha ρ (ninthCuspFrequency h)) (by intro s hs hi rw [sourceArbitraryHeightFamily_initial M a b ha ρ (ninthCuspFrequency h) s hs hi, ramifiedSource_height_fourier_average side h hf a b ha ρ s (by linarith), ramifiedCuspGaussSeries_eq_six,Finset.sum_mul] apply Finset.sum_congr rfl intro i hi' dsimp only [coeff] ring) refine he.trans ?_ rw [ramifiedArithmeticResidue,Finset.sum_mul] apply Finset.sum_congr rfl intro i hi dsimp only [coeff] ring theorem ramifiedSource_height_residue_integral (side:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit side)) (a b:ℝ) (ha:0(kernelQuotientEnergyDensity f q:ℂ)) (integralOrbitProjection globalKubotaKernel w)).re := by let : Fintype (IntegralCoverCosets H globalKubotaKernel) := Fintype.ofFinite _ let p := hyperbolicEuclideanCoordinates w let A := kernelCorrespondenceMatrix (H:=H) g have hFd (q : IntegralCoverCosets H globalKubotaKernel) : DifferentiableAt ℝ (kernelTestField f) (euclideanAction (A q) p) := (kernelTestField_contDiffAt f _ (euclideanAction_positive _ _)).differentiableAt (by simp) have hcomp (q : IntegralCoverCosets H globalKubotaKernel) : DifferentiableAt ℝ (kernelTestField f ∘ euclideanAction (A q)) p := by obtain ⟨der,hder,_⟩ := hyperbolicDifferentialIsometry (A q) p (hyperbolicHeight_pos w) exact (hFd q).comp p hder.differentiableAt have hh := coverEnergyDensity_sum_le Finset.univ (fun q : IntegralCoverCosets H globalKubotaKernel=>kernelTestField f ∘ euclideanAction (A q)) p (fun q _=>hcomp q) have hfield : kernelTestField (kernelCorrespondenceTest hHK hJK e g he f)= fun p=>∑q : IntegralCoverCosets H globalKubotaKernel,kernelTestField f (euclideanAction (A q) p) := funext (kernelCorrespondenceTest_field hHK hJK e g he f) rw [kernelTestEnergyDensity_eq_cover,hfield] change coverEnergyDensity (fun p=>∑q : IntegralCoverCosets H globalKubotaKernel, kernelTestField f (euclideanAction (A q) p)) p≤_ calc _ ≤ (Fintype.card (IntegralCoverCosets H globalKubotaKernel):ℝ)* ∑q : IntegralCoverCosets H globalKubotaKernel, coverEnergyDensity (kernelTestField f ∘ euclideanAction (A q)) p := by simpa only [Finset.card_univ,Function.comp_def] using hh _ = _ := by have hcard : Fintype.card (IntegralCoverCosets H globalKubotaKernel)= H.relIndex globalKubotaKernel := by rw [Subgroup.relIndex,Subgroup.index,Nat.card_eq_fintype_card] rw [hcard,kernelCorrespondenceFunction_lift] simp only [Complex.re_sum,Complex.ofReal_re] congr 1 apply Finset.sum_congr rfl intro q _ rw [coverEnergyDensity_comp (A q) _ p (hyperbolicHeight_pos w) (hFd q)] change coverEnergyDensity (kernelTestField f) (euclideanAction (A q) p)= kernelTestEnergyDensity f (A q•w) rw [kernelTestEnergyDensity_eq_cover] congr 1 dsimp [p,euclideanAction] rw [euclideanToHyperbolic_coordinates] lemma kernelCorrespondenceTest_energy_le (f : kernelSmoothTests) : kernelDirichletEnergy (kernelCorrespondenceTest hHK hJK e g he f)≤ (H.relIndex globalKubotaKernel:ℝ)*(J.relIndex globalKubotaKernel:ℝ)*kernelDirichletEnergy f := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let : BorelSpace KernelQuotient := kernelQuotientBorel let density : KernelQuotient→ℂ := fun q=>(kernelQuotientEnergyDensity f q:ℂ) have hdm : Measurable density := Complex.continuous_ofReal.measurable.comp (kernelQuotientEnergyDensity_continuous f).measurable have hdi : Integrable density (integralQuotientVolume globalKubotaKernel) := (kernelQuotientEnergyDensity_integrable f).ofReal have hTi := kernelCorrespondenceFunction_integrable hHK hJK e g he density hdm hdi have hint := kernelCorrespondenceFunction_integral hHK hJK e g he density hdm hdi have hre : (∫q,(kernelCorrespondenceFunction hJK e g he density q).re ∂integralQuotientVolume globalKubotaKernel)= (J.relIndex globalKubotaKernel:ℝ)*kernelDirichletEnergy f := by have htr := integral_re hTi have hdf := integral_re hdi simp only [RCLike.re_to_complex] at htr hdf rw [htr,hint] simp only [Complex.mul_re,Complex.natCast_re,Complex.natCast_im,zero_mul,sub_zero] rw [←hdf] rfl unfold kernelDirichletEnergy calc _ ≤ ∫q,(H.relIndex globalKubotaKernel:ℝ)* (kernelCorrespondenceFunction hJK e g he density q).re ∂integralQuotientVolume globalKubotaKernel := by apply integral_mono (kernelQuotientEnergyDensity_integrable _) (hTi.re.const_mul _) intro q induction q using Quotient.inductionOn with | _ w => exact kernelCorrespondenceTest_energyDensity_le hHK hJK e g he f w _ = _ := by rw [integral_const_mul,hre] exact (mul_assoc _ _ _).symm end namespace RootNotationRamifiedSixBranches05 abbrev O := ActualEisensteinCubic.O end RootNotationRamifiedSixBranches05 open RootNotationRamifiedSixBranches05 (O) variable {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hJK : J≤globalKubotaKernel) [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) def kernelCorrespondenceTestLinear : kernelSmoothTests→ₗ[ℂ]kernelSmoothTests where toFun := kernelCorrespondenceTest hHK hJK e g he map_add' f h := by apply Subtype.ext funext q induction q using Quotient.inductionOn with | _ w => let : Fintype (IntegralCoverCosets H globalKubotaKernel) := Fintype.ofFinite _ change kernelCorrespondenceFunction hJK e g he (f+h).1 (integralOrbitProjection globalKubotaKernel w)= kernelCorrespondenceFunction hJK e g he f.1 (integralOrbitProjection globalKubotaKernel w)+ kernelCorrespondenceFunction hJK e g he h.1 (integralOrbitProjection globalKubotaKernel w) simp only [kernelCorrespondenceFunction_lift,Submodule.coe_add,Pi.add_apply,Finset.sum_add_distrib] map_smul' c f := by apply Subtype.ext funext q induction q using Quotient.inductionOn with | _ w => let : Fintype (IntegralCoverCosets H globalKubotaKernel) := Fintype.ofFinite _ change kernelCorrespondenceFunction hJK e g he (c•f).1 (integralOrbitProjection globalKubotaKernel w)= c • kernelCorrespondenceFunction hJK e g he f.1 (integralOrbitProjection globalKubotaKernel w) simp only [kernelCorrespondenceFunction_lift,Submodule.coe_smul,Pi.smul_apply,Finset.smul_sum] lemma kernelCorrespondenceL2_norm_le (F : KernelQuotientL2) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ‖kernelCorrespondenceL2 hHK hJK e g he F‖≤ Real.sqrt ((H.relIndex globalKubotaKernel:ℝ)*(J.relIndex globalKubotaKernel:ℝ))*‖F‖ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by let C := integralConjugatePullback e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree) let P := integralCoverPullback hJK globalKubotaKernel_le_levelThree let Tr := integralCoverTrace hHK globalKubotaKernel_le_levelThree have hTr := integralCoverTrace_opNorm_le hHK globalKubotaKernel_le_levelThree have hP := integralCoverPullback_norm_le hJK globalKubotaKernel_le_levelThree F rw [←Real.sqrt_eq_rpow] at hTr hP change ‖Tr (C (P F))‖≤_ calc _ ≤ ‖Tr‖*‖C (P F)‖ := Tr.le_opNorm _ _ ≤ Real.sqrt (H.relIndex globalKubotaKernel:ℝ)*‖C (P F)‖ := mul_le_mul_of_nonneg_right hTr (norm_nonneg _) _ = Real.sqrt (H.relIndex globalKubotaKernel:ℝ)*‖P F‖ := by rw [C.norm_map] _ ≤ Real.sqrt (H.relIndex globalKubotaKernel:ℝ)* (Real.sqrt (J.relIndex globalKubotaKernel:ℝ)*‖F‖) := mul_le_mul_of_nonneg_left hP (Real.sqrt_nonneg _) _ = _ := by rw [Real.sqrt_mul (Nat.cast_nonneg _)]; ring lemma kernelCorrespondenceTest_graph_norm (f : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ‖kernelEnergyGraphCore (kernelCorrespondenceTest hHK hJK e g he f)‖≤ Real.sqrt ((H.relIndex globalKubotaKernel:ℝ)*(J.relIndex globalKubotaKernel:ℝ))* ‖kernelEnergyGraphCore f‖ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hm := kernelCorrespondenceL2_norm_le hHK hJK e g he (kernelSmoothTestsToL2 f) have hs := (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg _))).mpr hm rw [←kernelCorrespondenceTest_mass hHK hJK e g he,mul_pow, Real.sq_sqrt (mul_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _))] at hs apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg _))).mp rw [kernelEnergyGraphCore_norm_sq,mul_pow, Real.sq_sqrt (mul_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _)),kernelEnergyGraphCore_norm_sq] have he := kernelCorrespondenceTest_energy_le hHK hJK e g he f nlinarith def kernelCorrespondenceEnergy : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelEnergyGraph→L[ℂ]KernelEnergyGraph := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelEnergyGraphCore.comp (kernelCorrespondenceTestLinear hHK hJK e g he)).extendOfNorm kernelEnergyGraphCore lemma kernelCorrespondenceEnergy_core (f : kernelSmoothTests) : letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelCorrespondenceEnergy hHK hJK e g he (kernelEnergyGraphCore f)= kernelEnergyGraphCore (kernelCorrespondenceTest hHK hJK e g he f) := letI rootPolicy_kernelEnergyGraph_complete := @OAI.CubicEisenstein.kernelEnergyGraph_complete letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace LinearMap.extendOfNorm_eq kernelEnergyGraphCore_dense ⟨_,kernelCorrespondenceTest_graph_norm hHK hJK e g he⟩ f lemma kernelCorrespondenceEnergy_mass (u : KernelEnergyGraph) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelEnergyMass (kernelCorrespondenceEnergy hHK hJK e g he u)= kernelCorrespondenceL2 hHK hJK e g he (kernelEnergyMass u) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply congrFun (kernelEnergyGraphCore_dense.equalizer (kernelEnergyMass.continuous.comp (kernelCorrespondenceEnergy hHK hJK e g he).continuous) ((kernelCorrespondenceL2 hHK hJK e g he).continuous.comp kernelEnergyMass.continuous) ?_) u funext f change kernelEnergyMass (kernelCorrespondenceEnergy hHK hJK e g he (kernelEnergyGraphCore f))= kernelCorrespondenceL2 hHK hJK e g he (kernelEnergyMass (kernelEnergyGraphCore f)) rw [kernelCorrespondenceEnergy_core,kernelEnergyMass_core,kernelEnergyMass_core, kernelCorrespondenceTest_mass] end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT namespace RootNotationRamifiedSixBranches06 abbrev Eis := ActualEisensteinCubic.O end RootNotationRamifiedSixBranches06 open RootNotationRamifiedSixBranches06 (Eis) def ramifiedCuspShiftNumerator (b : Bool) : Eis := if b then -2-omega else omega-1 lemma ramifiedCuspShift_congr (b : Bool) : (3:Eis)∣ramifiedCuspShiftNumerator b-onceCuspScale (ramifiedCuspScaleUnit b) := by refine ⟨-1,?_⟩ cases b · simp [ramifiedCuspShiftNumerator,ramifiedCuspScaleUnit,onceCuspScale, Units.val_neg,ramifiedOmegaUnit_val,ramifiedTraceLambda] linear_combination 2*ramified_omega_relation · simp only [ramifiedCuspShiftNumerator,ramifiedCuspScaleUnit,ite_true,onceCuspScale, Units.val_pow_eq_pow_val,ramifiedOmegaUnit_val,ramifiedTraceLambda] linear_combination -(2*omega-1)*ramified_omega_relation lemma ramifiedCuspShift_support (b : Bool) (h : Eis) : (3:Eis)∣ramifiedCuspShiftNumerator b-h ↔ (3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit b) := by constructor · intro hh convert dvd_sub (ramifiedCuspShift_congr b) hh using 1 ; ring · intro hh convert dvd_sub (ramifiedCuspShift_congr b) hh using 1 ; ring lemma ramifiedSource_affine_shift (b : Bool) (x : Eis) (z : ℂ) (v : ℝ) (hv : 0ramifiedSourceFunction (ramifiedCuspRoot b:Eis) (upperPoint z v hv)) := letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by let c : ℂ→UpperCoordinates := fun z=>⟨(z,v),hv⟩ have hc : Continuous c := by apply Continuous.subtype_mk exact continuous_id.prodMk continuous_const have ht := continuous_upperCoordinates.comp hc have ht' : Continuous (fun z : ℂ=>upperPoint z v hv) := by simpa only [Function.comp_def,c] using ht exact (ramifiedSourceFunction_continuous _).comp ht' theorem ramifiedSource_scaled_fourier_active (b : Bool) (h : Eis) (hh : (3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit b)) (v : ℝ) (hv : 0ShortDraftTrace.breveE (-ninthCuspFrequency h*z)) := by change Continuous (fun z : ℂ=>Complex.exp (2*Real.pi*Complex.I* ((-ninthCuspFrequency h*z)+starRingEnd ℂ (-ninthCuspFrequency h*z)))) fun_prop have hi := period_integral_eisenstein_mul (fun z=>ramifiedSourceFunction (ramifiedCuspRoot b:Eis) (upperPoint z v hv)* ShortDraftTrace.breveE (-ninthCuspFrequency h*z)) ((ramifiedSource_height_continuous b v hv).mul hphase).measurable (ramifiedSource_active_weighted_periodic b h hh v hv) (3:Eis) (by norm_num) simpa only [map_ofNat,he] using hi end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CorrespondenceAdjoint /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups InnerProductSpace namespace RootNotationCorrespondenceAdjoint01 abbrev O := ActualEisensteinCubic.O end RootNotationCorrespondenceAdjoint01 open RootNotationCorrespondenceAdjoint01 (O) lemma integralConjugatePullback_inverse_left {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (hH : H≤CubicKubota.levelThree) (hJ : J≤CubicKubota.levelThree) (F : IntegralQuotientL2 H) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace integralConjugatePullback e g he hH hJ (integralConjugatePullback e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) hJ hH F)=F := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply Lp.ext have hi := integralConjugatePullback_ae e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) hJ hH F have hc := (integralConjugateMap_measurePreserving e g he hH hJ).quasiMeasurePreserving.ae_eq_comp hi filter_upwards [integralConjugatePullback_ae e g he hH hJ (integralConjugatePullback e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) hJ hH F),hc] with q hq hqi dsimp only [Function.comp_def] at hqi rw [hq,hqi,integralConjugateMap_inverse] lemma integralConjugatePullback_pairing {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (hH : H≤CubicKubota.levelThree) (hJ : J≤CubicKubota.levelThree) (F : IntegralQuotientL2 H) (G : IntegralQuotientL2 J) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ⟪F,integralConjugatePullback e g he hH hJ G⟫_ℂ= ⟪integralConjugatePullback e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) hJ hH F,G⟫_ℂ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by calc _ = ⟪integralConjugatePullback e g he hH hJ (integralConjugatePullback e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) hJ hH F), integralConjugatePullback e g he hH hJ G⟫_ℂ := by rw [integralConjugatePullback_inverse_left] _ = _ := LinearIsometry.inner_map_map _ _ _ theorem kernelCorrespondenceL2_pairing {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hJK : J≤globalKubotaKernel) [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (F G : KernelQuotientL2) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ⟪F,kernelCorrespondenceL2 hHK hJK e g he G⟫_ℂ= ⟪kernelCorrespondenceL2 hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) F,G⟫_ℂ := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by change ⟪F,integralCoverTrace hHK globalKubotaKernel_le_levelThree (integralConjugatePullback e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree) (integralCoverPullback hJK globalKubotaKernel_le_levelThree G))⟫_ℂ=_ rw [integralCoverTrace_pairing,integralConjugatePullback_pairing] exact (ContinuousLinearMap.adjoint_inner_left (integralCoverPullback hJK globalKubotaKernel_le_levelThree) G _).symm end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups section lemma continuous_period_integral {X:Type*} [TopologicalSpace X] [FirstCountableTopology X] [LocallyCompactSpace X] (f:X→ℂ→ℂ) (hf:Continuous f.uncurry) : Continuous (fun x=>∫z in periodDomain,f x z) := by rw [continuous_iff_continuousAt] intro x0 obtain ⟨U,hUc,hUn⟩:=exists_compact_mem_nhds x0 let radius:ℝ:=∑i,‖periodBasis i‖ obtain ⟨C,hC⟩:=(hUc.prod (isCompact_closedBall (0:ℂ) radius)).bddAbove_image hf.norm.continuousOn apply continuousAt_of_dominated · filter_upwards with x using (show Continuous (f x) from hf.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable · filter_upwards [hUn] with x hx filter_upwards [ae_restrict_mem periodDomain_measurable] with z hz apply hC exact ⟨(x,z),⟨hx,by simpa only [Metric.mem_closedBall,dist_zero_right,radius] using norm_mem_periodDomain z hz⟩,rfl⟩ · let:=periodDomain_finiteMeasure exact integrable_const C · filter_upwards with z using (show Continuous (fun x=>f x z) from hf.comp (continuous_id.prodMk continuous_const)).continuousAt def continuousCuspSlice (f:HyperbolicSpace→ℂ) (freq:ℂ) (v:ℝ) :ℂ:= (∫z in periodDomain,f (cuspCoordinateLift (v,z))*ShortDraftTrace.breveE (-freq*z))/(v:ℂ)^3 lemma continuousCuspSlice_integrable (f:HyperbolicSpace→ℂ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf:Continuous f) (freq:ℂ) (a b:ℝ) (ha:0 by let g:HyperbolicSpace→ℂ:=fun w=>f w*arbitraryCuspWeightedPhase 1 freq w have hg:Continuous g:=hf.mul (arbitraryCuspWeightedPhase_continuous 1 freq) have hi:=cuspCoordinateLift_weighted_integrable_of_pos a b ha g hg rw [IntegrableOn,Measure.volume_eq_prod,←Measure.prod_restrict] at hi apply hi.integral_prod_left.congr filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv have hp:0c/(v:ℂ)^3) apply integral_congr_ae exact Eventually.of_forall (fun z=>by dsimp only [g] rw [arbitraryCuspWeightedPhase,cuspCoordinateLift_positive v z hp, hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint] simp) lemma continuousCuspSlice_continuousOn (f:HyperbolicSpace→ℂ) : letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf:Continuous f) (freq:ℂ) (a b:ℝ) (ha:0 by let coord:(ℝ × ℂ)→UpperCoordinates:=fun q=>⟨(q.2,max a q.1),ha.trans_le (le_max_left _ _)⟩ have hc:Continuous coord:=by apply Continuous.subtype_mk exact continuous_snd.prodMk (continuous_const.max continuous_fst) have hup:Continuous (fun q:(ℝ × ℂ)=>f (upperPoint q.2 (max a q.1) (ha.trans_le (le_max_left _ _)))):= hf.comp (continuous_upperCoordinates.comp hc) have he:Continuous (fun q:(ℝ × ℂ)=>ShortDraftTrace.breveE (-freq*q.2)):=by change Continuous (fun q:(ℝ × ℂ)=>Complex.exp (2*Real.pi*Complex.I*((-freq*q.2)+starRingEnd ℂ (-freq*q.2)))) fun_prop have hi:=continuous_period_integral (fun v z=>f (upperPoint z (max a v) (ha.trans_le (le_max_left _ _)))* ShortDraftTrace.breveE (-freq*z)) (hup.mul he) have hnum:ContinuousOn (fun v:ℝ=>∫z in periodDomain,f (cuspCoordinateLift (v,z))* ShortDraftTrace.breveE (-freq*z)) (Set.Icc a b):=by apply hi.continuousOn.congr intro v hv have hp:0pow_ne_zero 3 (Complex.ofReal_ne_zero.mpr (ha.trans_le hv.1).ne')) lemma continuousCuspSlice_test (f:HyperbolicSpace→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf:Continuous f) (freq:ℂ) (a b:ℝ) (ha:0 by have hg:Continuous (fun w=>f w*arbitraryCuspWeightedPhase ρ freq w):= hf.mul (arbitraryCuspWeightedPhase_continuous ρ freq) rw [cuspPeriodStrip_integral_coordinates_of_pos a b ha _ hg.aestronglyMeasurable (cuspCoordinateLift_weighted_integrable_of_pos a b ha _ hg)] apply setIntegral_congr_fun measurableSet_Icc intro v hv have hp:0by dsimp only rw [arbitraryCuspWeightedPhase,cuspCoordinateLift_positive v z hp, hyperbolicHeight_upperPoint,hyperbolicHorizontal_upperPoint] ring) theorem continuousCuspSlice_eq_of_tests (f:HyperbolicSpace→ℂ) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology ∀ (hf:Continuous f) (freq:ℂ) (g:ℝ→ℂ) (hg:∀a b:ℝ,0 by have ha:0linarith) namespace RootNotationCorrespondenceAdjoint02 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondenceAdjoint02 open RootNotationCorrespondenceAdjoint02 (Eis) theorem ramifiedSource_fourier_all_heights (side:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit side)) (v:ℝ) (hv:0R*(v:ℂ)^(-(4/3:ℂ)-1)* sourceFourierKernel (4/3) (ninthCuspFrequency h*v) have hg:∀a b:ℝ,0by dsimp only [g,R];ring) have he:=continuousCuspSlice_eq_of_tests (ramifiedSourceFunction (ramifiedCuspRoot side:Eis)) (ramifiedSourceFunction_continuous _) (ninthCuspFrequency h) g hg ht v hv have hvn:(v:ℂ)≠0:=Complex.ofReal_ne_zero.mpr hv.ne' have hp:(v:ℂ)^(-(4/3:ℂ)-1)=(v:ℂ)^(2/3:ℂ)/(v:ℂ)^3:=by rw [show -(4/3:ℂ)-1=(2/3:ℂ)-3 by ring,Complex.cpow_sub _ _ hvn] congr 1 exact Complex.cpow_natCast _ 3 dsimp only [continuousCuspSlice,g,R] at he simp only [cuspCoordinateLift_positive v _ hv,hp] at he apply (div_left_inj' (pow_ne_zero 3 hvn)).mp convert he using 1 ;ring end section namespace RootNotationCorrespondenceAdjoint03 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondenceAdjoint03 open RootNotationCorrespondenceAdjoint03 (Eis) lemma continuous_period_fourier_bound (f:ℂ→ℂ) (hf:Continuous f) : ∃C:ℝ,0≤C∧∀freq:ℂ,‖∫z in periodDomain,f z*ShortDraftTrace.breveE (-freq*z)‖≤C := by let radius:ℝ:=∑i,‖periodBasis i‖ obtain ⟨B,hB⟩:=(isCompact_closedBall (0:ℂ) radius).bddAbove_image hf.norm.continuousOn refine ⟨max 0 B*(volume.restrict periodDomain).real Set.univ,mul_nonneg (le_max_left _ _) (measureReal_nonneg),?_⟩ intro freq let:=periodDomain_finiteMeasure apply norm_integral_le_of_norm_le_const filter_upwards [ae_restrict_mem periodDomain_measurable] with z hz rw [norm_mul,breveE_norm,mul_one] apply le_trans _ (le_max_right _ _) apply hB exact ⟨z,by simpa only [Metric.mem_closedBall,dist_zero_right,radius] using norm_mem_periodDomain z hz,rfl⟩ theorem continuous_fourier_bessel_subexponential (f:ℝ→ℂ→ℂ) (c:Eis→ℂ) (hf:∀v:ℝ,0c.fullFunction 0 (upperPoint z v hv)):=by apply periodDomain_L2_ext _ _ (periodDomain_memLp_of_continuous f hf) (periodDomain_memLp_of_continuous _ hc) intro h rw [hfour,c.fullFunction_fourier] by_cases hh:h=0 · simp [hh,SubexponentialBesselCoefficients.amplitude] · simp [hh] have hall:=ae_eq_of_periodDomain_eq f _ hp (fun n z=>c.fullFunction_period 0 v hv z n) he exact congrFun (Measure.eq_of_ae_eq hall hf hc) end section open ConcreteTraceCRT namespace RootNotationCorrespondenceAdjoint04 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondenceAdjoint04 open RootNotationCorrespondenceAdjoint04 (Eis) lemma ninthCuspFrequency_three (h:Eis) : 3*ninthCuspFrequency h=cuspFrequency h := by unfold ninthCuspFrequency cuspFrequency ring lemma sourceFourierKernel_cubic_amplitude (h:Eis) (hh:h≠0) (v:ℝ) (hv:0ramifiedSourceFunction (ramifiedCuspRoot side:Eis) (upperPoint (3*z) (3*v) hp)):=by funext z exact congrArg (ramifiedSourceFunction (ramifiedCuspRoot side:Eis)) (cuspCoordinateLift_positive (3*v) (3*z) hp) rw [he] exact (ramifiedSource_height_continuous side (3*v) hp).comp (continuous_const.mul continuous_id) lemma ramifiedScaledRow_periodic (side:Bool) (v:ℝ) (hv:0∑i∈s,G i x) p=∑i∈s,coverDirichletPair F (G i) p := by simp only [coverDirichletPair,coverGradientAt_sum s G p hG,inner_sum] lemma coverDirichletPair_norm_le (F G : EuclideanSpatial→ℂ) (p : EuclideanSpatial) (hF : DifferentiableAt ℝ F p) (hG : DifferentiableAt ℝ G p) : ‖coverDirichletPair F G p‖≤(coverEnergyDensity F p+coverEnergyDensity G p)/2 := by have hh := norm_inner_le_norm (𝕜:=ℂ) (coverGradientAt F p) (coverGradientAt G p) have hs := sq_nonneg (‖coverGradientAt F p‖-‖coverGradientAt G p‖) rw [←coverGradientAt_norm_sq F p hF,←coverGradientAt_norm_sq G p hG] exact le_trans hh (by nlinarith) lemma kernelDirichletPairDensity_eq_cover (f h : kernelSmoothTests) (w : HyperbolicSpace) : kernelDirichletPairDensity f h (integralOrbitProjection globalKubotaKernel w)= coverDirichletPair (kernelTestField f) (kernelTestField h) (hyperbolicEuclideanCoordinates w) := by rw [kernelDirichletPairDensity_coordinate] rfl end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.CorrespondenceEnergy /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise Manifold ContDiff ENNReal InnerProductSpace open Finset AddChar MulChar EisensteinEmbedding section namespace RootNotationCorrespondenceEnergy01 abbrev O := ActualEisensteinCubic.O end RootNotationCorrespondenceEnergy01 open RootNotationCorrespondenceEnergy01 (O) lemma kernelTestField_comp_contDiffAt (f : kernelSmoothTests) (g : SL(2,ℂ)) (p : EuclideanSpatial) (hp : 0

coverGradientAt F (hyperbolicEuclideanCoordinates w)) := letI rootPolicy_complexSLTopology := OAI.CubicEisenstein.complexSLTopology by apply (PiLp.continuousLinearEquiv 2 ℂ (fun _ : Fin 3=>ℂ)).symm.continuous.comp apply continuous_pi intro j apply (Complex.continuous_ofReal.comp hyperbolicHeight_continuous).mul rw [continuous_iff_continuousAt] intro w exact (((hF _ (hyperbolicHeight_pos w)).continuousAt_fderiv (by simp)).clm_apply continuousAt_const).comp hyperbolicEuclideanCoordinates_continuous.continuousAt def kernelCorrespondencePairLift (g : SL(2,ℂ)) (f h : kernelSmoothTests) (w : HyperbolicSpace) : ℂ := coverDirichletPair (kernelTestField f) (kernelTestField h ∘ euclideanAction g) (hyperbolicEuclideanCoordinates w) lemma kernelCorrespondencePairLift_continuous (g : SL(2,ℂ)) (f h : kernelSmoothTests) : letI rootPolicy_complexSLTopology := OAI.CubicEisenstein.complexSLTopology Continuous (kernelCorrespondencePairLift g f h) := letI rootPolicy_complexSLTopology := OAI.CubicEisenstein.complexSLTopology (coverGradientAt_lift_continuous _ (kernelTestField_contDiffAt f)).inner (coverGradientAt_lift_continuous _ (kernelTestField_comp_contDiffAt h g)) variable {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hJK : J≤globalKubotaKernel) [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) include hHK hJK he in omit [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] in lemma kernelCorrespondencePairLift_invariant (f h : kernelSmoothTests) (k : H) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction H kernelCorrespondencePairLift g f h (k•w)=kernelCorrespondencePairLift g f h w := by let := integralSubgroupHyperbolicAction H let A := integralComplexMatrix (k:SL(2,ActualEisensteinCubic.O)) let B := integralComplexMatrix (e k:SL(2,ActualEisensteinCubic.O)) have hfi : kernelTestField f ∘ euclideanAction A=kernelTestField f := funext (kernelTestField_invariant f ⟨(k:SL(2,ActualEisensteinCubic.O)),hHK k.property⟩) have hhi : (kernelTestField h ∘ euclideanAction g) ∘ euclideanAction A= kernelTestField h ∘ euclideanAction g := by rw [Function.comp_assoc,←euclideanAction_mul,he k,euclideanAction_mul,←Function.comp_assoc] have hh : kernelTestField h ∘ euclideanAction B=kernelTestField h := funext (kernelTestField_invariant h ⟨(e k:SL(2,ActualEisensteinCubic.O)),hJK (e k).property⟩) rw [hh] have hp := hyperbolicHeight_pos w have hh := coverDirichletPair_comp A (kernelTestField f) (kernelTestField h ∘ euclideanAction g) (hyperbolicEuclideanCoordinates w) hp ((kernelTestField_contDiffAt f _ (euclideanAction_positive A _)).differentiableAt (by simp)) ((kernelTestField_comp_contDiffAt h g _ (euclideanAction_positive A _)).differentiableAt (by simp)) rw [hfi,hhi] at hh change _=coverDirichletPair (kernelTestField f) (kernelTestField h ∘ euclideanAction g) (hyperbolicEuclideanCoordinates w) rw [integralSubgroup_smul] simpa only [kernelCorrespondencePairLift,A,euclideanAction,euclideanToHyperbolic_coordinates] using hh.symm def kernelCorrespondencePair (f h : kernelSmoothTests) : IntegralOrbitQuotient H→ℂ := Quotient.lift (kernelCorrespondencePairLift g f h) (by rintro w v ⟨k,rfl⟩ exact (kernelCorrespondencePairLift_invariant hHK hJK e g he f h k w).symm) omit [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] in lemma kernelCorrespondencePair_projection (f h : kernelSmoothTests) (w : HyperbolicSpace) : kernelCorrespondencePair hHK hJK e g he f h (integralOrbitProjection H w)= kernelCorrespondencePairLift g f h w := rfl omit [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] in lemma kernelCorrespondencePair_measurable (f h : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := OAI.CubicEisenstein.complexSLTopology Measurable (kernelCorrespondencePair hHK hJK e g he f h) := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := OAI.CubicEisenstein.complexSLTopology measurable_from_quotient.mpr (kernelCorrespondencePairLift_continuous g f h).measurable omit [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] in lemma kernelCorrespondencePair_norm_le (f h : kernelSmoothTests) (q : IntegralOrbitQuotient H) : ‖kernelCorrespondencePair hHK hJK e g he f h q‖≤ (kernelQuotientEnergyDensity f (integralCoverMap hHK q)+ kernelQuotientEnergyDensity h (integralCoverMap hJK (integralConjugateMap e g he q)))/2 := by induction q using Quotient.inductionOn with | _ w => have hf := (kernelTestField_contDiffAt f (hyperbolicEuclideanCoordinates w) (hyperbolicHeight_pos w)).differentiableAt (by simp) have hh := (kernelTestField_comp_contDiffAt h g (hyperbolicEuclideanCoordinates w) (hyperbolicHeight_pos w)).differentiableAt (by simp) have hb := coverDirichletPair_norm_le (kernelTestField f) (kernelTestField h ∘ euclideanAction g) (hyperbolicEuclideanCoordinates w) hf hh rw [coverEnergyDensity_comp g _ _ (hyperbolicHeight_pos w) ((kernelTestField_contDiffAt h _ (euclideanAction_positive g _)).differentiableAt (by simp))] at hb change ‖kernelCorrespondencePairLift g f h w‖≤ (kernelTestEnergyDensity f w+kernelTestEnergyDensity h (g•w))/2 simpa only [kernelCorrespondencePairLift,kernelTestEnergyDensity_eq_cover,euclideanAction, euclideanToHyperbolic_coordinates] using hb lemma kernelCorrespondencePair_integrable (f h : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace Integrable (kernelCorrespondencePair hHK hJK e g he f h) (integralQuotientVolume H) := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hf := (integralCoverMap_measurePreserving hHK globalKubotaKernel_le_levelThree).integrable_comp_of_integrable ((kernelQuotientEnergyDensity_integrable f).smul_measure (c:=(H.relIndex globalKubotaKernel:ℝ≥0∞)) (by simp)) have hh := (integralCoverMap_measurePreserving hJK globalKubotaKernel_le_levelThree).integrable_comp_of_integrable ((kernelQuotientEnergyDensity_integrable h).smul_measure (c:=(J.relIndex globalKubotaKernel:ℝ≥0∞)) (by simp)) have hhh := (integralConjugateMap_measurePreserving e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree)).integrable_comp_of_integrable hh apply ((hf.add hhh).div_const 2).mono' (kernelCorrespondencePair_measurable hHK hJK e g he f h).aestronglyMeasurable exact Filter.Eventually.of_forall (kernelCorrespondencePair_norm_le hHK hJK e g he f h) end namespace RootNotationCorrespondenceEnergy02 abbrev O := ActualEisensteinCubic.O end RootNotationCorrespondenceEnergy02 open RootNotationCorrespondenceEnergy02 (O) lemma kernelCorrespondencePairLift_kernel (g : SL(2,ℂ)) (f h : kernelSmoothTests) (r : globalKubotaKernel) (w : HyperbolicSpace) : letI := integralSubgroupHyperbolicAction globalKubotaKernel kernelCorrespondencePairLift g f h (r•w)= coverDirichletPair (kernelTestField f) (kernelTestField h ∘ euclideanAction (g*integralComplexMatrix (r:SL(2,ActualEisensteinCubic.O)))) (hyperbolicEuclideanCoordinates w) := by let := integralSubgroupHyperbolicAction globalKubotaKernel have hf := (kernelTestField_contDiffAt f _ (euclideanAction_positive (integralComplexMatrix r) (hyperbolicEuclideanCoordinates w))).differentiableAt (by simp) have hh := (kernelTestField_comp_contDiffAt h g _ (euclideanAction_positive (integralComplexMatrix r) (hyperbolicEuclideanCoordinates w))).differentiableAt (by simp) have hp := coverDirichletPair_comp (integralComplexMatrix r) (kernelTestField f) (kernelTestField h ∘ euclideanAction g) (hyperbolicEuclideanCoordinates w) (hyperbolicHeight_pos w) hf hh have hfi : kernelTestField f ∘ euclideanAction (integralComplexMatrix r)=kernelTestField f := funext (kernelTestField_invariant f r) rw [hfi,Function.comp_assoc,←euclideanAction_mul] at hp simpa only [kernelCorrespondencePairLift,integralSubgroup_smul,euclideanAction, euclideanToHyperbolic_coordinates] using hp.symm lemma kernelTestField_comp_inverse (f : kernelSmoothTests) (g : SL(2,ℂ)) : (kernelTestField f ∘ euclideanAction g⁻¹) ∘ euclideanAction g=kernelTestField f := by funext p simp only [Function.comp_def,kernelTestField,euclideanAction,euclideanToHyperbolic_coordinates, inv_smul_smul] variable {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hJK : J≤globalKubotaKernel) [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) lemma kernelCorrespondencePair_trace (f h : kernelSmoothTests) (q : KernelQuotient) : kernelDirichletPairDensity f (kernelCorrespondenceTest hHK hJK e g he h) q= integralCoverTraceFunction H globalKubotaKernel (kernelCorrespondencePair hHK hJK e g he f h) q := by let : Fintype (IntegralCoverCosets H globalKubotaKernel) := Fintype.ofFinite _ induction q using Quotient.inductionOn with | _ w => change kernelDirichletPairDensity f (kernelCorrespondenceTest hHK hJK e g he h) (integralOrbitProjection globalKubotaKernel w)=_ rw [kernelDirichletPairDensity_eq_cover] have hfield := funext (kernelCorrespondenceTest_field hHK hJK e g he h) rw [hfield] have hd (r : IntegralCoverCosets H globalKubotaKernel) : DifferentiableAt ℝ (kernelTestField h ∘ euclideanAction (kernelCorrespondenceMatrix g r)) (hyperbolicEuclideanCoordinates w) := (kernelTestField_comp_contDiffAt h _ _ (hyperbolicHeight_pos w)).differentiableAt (by simp) have hsum := coverDirichletPair_sum_right Finset.univ (kernelTestField f) (fun r=>kernelTestField h ∘ euclideanAction (kernelCorrespondenceMatrix g r)) (hyperbolicEuclideanCoordinates w) (fun r _=>hd r) simp only [Function.comp_apply] at hsum rw [hsum] change (∑r : IntegralCoverCosets H globalKubotaKernel,_)= ∑r : IntegralCoverCosets H globalKubotaKernel, kernelCorrespondencePair hHK hJK e g he f h (integralCoverFiberPoint H globalKubotaKernel r w) apply Finset.sum_congr rfl intro r _ rw [integralCoverFiberPoint_rep,kernelCorrespondencePair_projection, kernelCorrespondencePairLift_kernel] rfl lemma kernelCorrespondenceForm_integral (f h : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelDirichletForm f (kernelCorrespondenceTest hHK hJK e g he h)= ∫q,kernelCorrespondencePair hHK hJK e g he f h q∂integralQuotientVolume H := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by unfold kernelDirichletForm simp_rw [kernelCorrespondencePair_trace] exact integralCoverTraceFunction_integral hHK globalKubotaKernel_le_levelThree _ (kernelCorrespondencePair_measurable hHK hJK e g he f h) (kernelCorrespondencePair_integrable hHK hJK e g he f h) omit [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] in lemma kernelCorrespondencePair_conjugate (f h : kernelSmoothTests) (q : IntegralOrbitQuotient H) : kernelCorrespondencePair hHK hJK e g he f h q= star (kernelCorrespondencePair hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) h f (integralConjugateMap e g he q)) := by induction q using Quotient.inductionOn with | _ w => change kernelCorrespondencePairLift g f h w= star (kernelCorrespondencePairLift g⁻¹ h f (g•w)) have hf := (kernelTestField_contDiffAt h _ (euclideanAction_positive g (hyperbolicEuclideanCoordinates w))).differentiableAt (by simp) have hh := (kernelTestField_comp_contDiffAt f g⁻¹ _ (euclideanAction_positive g (hyperbolicEuclideanCoordinates w))).differentiableAt (by simp) have hc := coverDirichletPair_comp g (kernelTestField h) (kernelTestField f ∘ euclideanAction g⁻¹) (hyperbolicEuclideanCoordinates w) (hyperbolicHeight_pos w) hf hh rw [kernelTestField_comp_inverse] at hc have hs := congrArg star hc have hswap : star (inner ℂ (coverGradientAt (kernelTestField h ∘ euclideanAction g) (hyperbolicEuclideanCoordinates w)) (coverGradientAt (kernelTestField f) (hyperbolicEuclideanCoordinates w)))= inner ℂ (coverGradientAt (kernelTestField f) (hyperbolicEuclideanCoordinates w)) (coverGradientAt (kernelTestField h ∘ euclideanAction g) (hyperbolicEuclideanCoordinates w)) := inner_conj_symm _ _ rw [coverDirichletPair,hswap] at hs simpa only [kernelCorrespondencePairLift,coverDirichletPair,euclideanAction, euclideanToHyperbolic_coordinates] using hs theorem kernelCorrespondenceForm_adjoint (f h : kernelSmoothTests) : kernelDirichletForm f (kernelCorrespondenceTest hHK hJK e g he h)= kernelDirichletForm (kernelCorrespondenceTest hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) f) h := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by let opposite := kernelCorrespondencePair hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) h f have hom := kernelCorrespondencePair_measurable hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) h f have hm := integralConjugateMap_measurePreserving e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree) rw [kernelCorrespondenceForm_integral] calc _ = ∫q,star (opposite (integralConjugateMap e g he q))∂integralQuotientVolume H := by apply integral_congr_ae exact Filter.Eventually.of_forall (kernelCorrespondencePair_conjugate hHK hJK e g he f h) _ = ∫q,star (opposite q)∂integralQuotientVolume J := by have hh := integral_map («μ»:=integralQuotientVolume H) hm.measurable.aemeasurable (continuous_star.measurable.comp hom).aestronglyMeasurable rw [hm.map_eq] at hh exact hh.symm _ = star (∫q,opposite q∂integralQuotientVolume J) := by simp only [Complex.star_def] exact integral_conj _ = _ := by rw [←kernelCorrespondenceForm_integral hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he),kernelDirichletForm_conj] end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups InnerProductSpace open Finset AddChar MulChar EisensteinEmbedding namespace RootNotationCorrespondenceEnergy03 abbrev O := ActualEisensteinCubic.O end RootNotationCorrespondenceEnergy03 open RootNotationCorrespondenceEnergy03 (O) variable {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hJK : J≤globalKubotaKernel) [H.IsFiniteRelIndex globalKubotaKernel] [J.IsFiniteRelIndex globalKubotaKernel] (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) lemma kernelCorrespondenceEnergy_pairing_core (f h : kernelSmoothTests) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace inner ℂ (kernelEnergyGraphCore f) (kernelCorrespondenceEnergy hHK hJK e g he (kernelEnergyGraphCore h))= inner ℂ (kernelCorrespondenceEnergy hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) (kernelEnergyGraphCore f)) (kernelEnergyGraphCore h) := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [kernelCorrespondenceEnergy_core,kernelCorrespondenceEnergy_core, kernelEnergyGraph_inner,kernelEnergyGraph_inner] simp only [kernelEnergyMass_core,kernelEnergyGradient_core,kernelGradientToL2_inner] rw [kernelCorrespondenceTest_mass,kernelCorrespondenceTest_mass, kernelCorrespondenceL2_pairing,kernelCorrespondenceForm_adjoint] theorem kernelCorrespondenceEnergy_pairing (u v : KernelEnergyGraph) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace inner ℂ u (kernelCorrespondenceEnergy hHK hJK e g he v)= inner ℂ (kernelCorrespondenceEnergy hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) u) v := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply congrFun (kernelEnergyGraphCore_dense.equalizer (continuous_id.inner continuous_const) ((kernelCorrespondenceEnergy hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he)).continuous.inner continuous_const) ?_) u funext f apply congrFun (kernelEnergyGraphCore_dense.equalizer (continuous_const.inner (kernelCorrespondenceEnergy hHK hJK e g he).continuous) (continuous_const.inner continuous_id) ?_) v funext h exact kernelCorrespondenceEnergy_pairing_core hHK hJK e g he f h lemma kernelCorrespondenceEnergy_pairing_left (u v : KernelEnergyGraph) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace inner ℂ (kernelCorrespondenceEnergy hHK hJK e g he u) v= inner ℂ u (kernelCorrespondenceEnergy hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) v) := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hh := congrArg star (kernelCorrespondenceEnergy_pairing hHK hJK e g he v u) simpa only [←starRingEnd_apply,_root_.inner_conj_symm (𝕜 := ℂ) (kernelCorrespondenceEnergy hHK hJK e g he u) v,_root_.inner_conj_symm (𝕜 := ℂ) u (kernelCorrespondenceEnergy hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) v)] using hh lemma kernelCorrespondenceL2_pairing_left (F G : KernelQuotientL2) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace inner ℂ (kernelCorrespondenceL2 hHK hJK e g he F) G= inner ℂ F (kernelCorrespondenceL2 hJK hHK e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) G) := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hh := congrArg star (kernelCorrespondenceL2_pairing hHK hJK e g he G F) simpa only [←starRingEnd_apply,inner_conj_symm] using hh theorem kernelCorrespondence_variationalSolution (F : KernelQuotientL2) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelCorrespondenceEnergy hHK hJK e g he (kernelVariationalSolution F)= kernelVariationalSolution (kernelCorrespondenceL2 hHK hJK e g he F) := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply kernelVariationalSolution_unique intro v rw [←kernelEnergyGraph_inner,kernelCorrespondenceEnergy_pairing_left, kernelEnergyGraph_inner,kernelVariationalSolution_equation, kernelCorrespondenceEnergy_mass] exact (kernelCorrespondenceL2_pairing_left hHK hJK e g he F (kernelEnergyMass v)).symm theorem kernelCorrespondence_variationalResolvent (F : KernelQuotientL2) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelVariationalResolvent (kernelCorrespondenceL2 hHK hJK e g he F)= kernelCorrespondenceL2 hHK hJK e g he (kernelVariationalResolvent F) := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by change kernelEnergyMass (kernelVariationalSolution (kernelCorrespondenceL2 hHK hJK e g he F))=_ rw [←kernelCorrespondence_variationalSolution,kernelCorrespondenceEnergy_mass] rfl theorem kernelCorrespondence_operatorGraph (F G : KernelQuotientL2) (hFG : (F,G)∈kernelEnergyLaplacian.graph) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelCorrespondenceL2 hHK hJK e g he F, kernelCorrespondenceL2 hHK hJK e g he G)∈kernelEnergyLaplacian.graph := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by rw [kernelEnergyLaplacian_graph,mem_kernelLaplacianGraph] at hFG ⊢ rw [←map_add,kernelCorrespondence_variationalResolvent,hFG] theorem kernelCorrespondence_eigenvector (F : KernelQuotientL2) (eigenvalue : ℂ) (hF : (F,eigenvalue • F)∈kernelEnergyLaplacian.graph) : letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace (kernelCorrespondenceL2 hHK hJK e g he F, eigenvalue • kernelCorrespondenceL2 hHK hJK e g he F)∈kernelEnergyLaplacian.graph := letI rootPolicy_hyperbolicMeasurableSpace := OAI.CubicEisenstein.hyperbolicMeasurableSpace by simpa only [map_smul] using kernelCorrespondence_operatorGraph hHK hJK e g he F (eigenvalue • F) hF end section open MeasureTheory open scoped Classical MatrixGroups BigOperators section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota namespace RootNotationCorrespondenceEnergy04 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondenceEnergy04 open RootNotationCorrespondenceEnergy04 (Eis) lemma cuspFrequency_mul_right (h c:Eis) : cuspFrequency (h*c)=cuspFrequency h*eisEmbedding c := by unfold cuspFrequency rw [map_mul] ring lemma cusp_character_continuous (h:Eis) : Continuous (fun z:ℂ=>ShortDraftTrace.breveE (-cuspFrequency h*z)) := by change Continuous (fun z:ℂ=>Complex.exp (2*Real.pi*Complex.I* ((-cuspFrequency h*z)+starRingEnd ℂ (-cuspFrequency h*z)))) fun_prop lemma cusp_character_fractional_period (c:Eis) (hc:c≠0) (h q:Eis) (z:ℂ) : ShortDraftTrace.breveE (-cuspFrequency (h*c)*(z+3*eisEmbedding q/eisEmbedding c))= ShortDraftTrace.breveE (-cuspFrequency (h*c)*z) := by rw [mul_add,AddChar.map_add_eq_mul] have he:-cuspFrequency (h*c)*(3*eisEmbedding q/eisEmbedding c)= -cuspFrequency h*(3*eisEmbedding q):=by rw [cuspFrequency_mul_right] field_simp [eisEmbedding_ne_zero hc] rw [he] have hz:ShortDraftTrace.breveE (-cuspFrequency h*(3*eisEmbedding q))=1:=by simpa only [zero_add,mul_zero,AddChar.map_zero_eq_one] using cuspFrequency_negative_period h q 0 rw [hz,mul_one] lemma period_fourier_fractional_translation (f:ℂ→ℂ) (hf:∀n:Eis,∀z:ℂ,f (z+3*eisEmbedding n)=f z) (c:Eis) (hc:c≠0) (h q:Eis) : (∫z in periodDomain,f (z+3*eisEmbedding q/eisEmbedding c)* ShortDraftTrace.breveE (-cuspFrequency (h*c)*z))= ∫z in periodDomain,f z*ShortDraftTrace.breveE (-cuspFrequency (h*c)*z) := by let g:ℂ→ℂ:=fun z=>f z*ShortDraftTrace.breveE (-cuspFrequency (h*c)*z) have hg (n:Eis) (z:ℂ):g (z+3*eisEmbedding n)=g z:=by dsimp [g] rw [hf,cuspFrequency_negative_period] have hi:=period_integral_translation g hg (3*eisEmbedding q/eisEmbedding c) have hp (z:ℂ):g (3*eisEmbedding q/eisEmbedding c+z)= f (z+3*eisEmbedding q/eisEmbedding c)*ShortDraftTrace.breveE (-cuspFrequency (h*c)*z):=by dsimp [g] rw [add_comm (3*eisEmbedding q/eisEmbedding c) z,cusp_character_fractional_period c hc] simpa only [hp,g] using hi end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota namespace RootNotationCorrespondenceEnergy05 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondenceEnergy05 open RootNotationCorrespondenceEnergy05 (Eis) lemma cube_upperPoint_continuous (v:ℝ) (hv:0upperPoint z v hv) := letI rootPolicy_complexSLTopology := OAI.CubicEisenstein.complexSLTopology by let c:ℂ→UpperCoordinates:=fun z=>⟨(z,v),hv⟩ have hc:Continuous c:=by apply Continuous.subtype_mk exact continuous_id.prodMk continuous_const simpa only [Function.comp_def,c] using continuous_upperCoordinates.comp hc theorem cubeAverage_fourier (p:Eis) (hp:p≠0) (F:HyperbolicSpace→ℂ) : letI rootPolicy_complexSLTopology := OAI.CubicEisenstein.complexSLTopology ∀ (hF:Continuous F) (hperiod:∀n:Eis,∀w:HyperbolicSpace,F (complexTranslation (3*eisEmbedding n) • w)=F w) (h:Eis) (v:ℝ) (hv:0 by let V:=v/‖eisEmbedding p‖^3 have hV:0F (upperPoint z V hV) let H:ℂ→ℂ:=fun z=>cubeAverage p hp F (upperPoint z v hv)*ShortDraftTrace.breveE (-cuspFrequency h*z) have hf:Continuous f:=hF.comp (cube_upperPoint_continuous V hV) have hfperiod (n:Eis) (z:ℂ):f (z+3*eisEmbedding n)=f z:=by dsimp [f] rw [←complexTranslation_action] exact hperiod n _ have hH:Continuous H:= ((cubeAverage_continuous p hp F hF).comp (cube_upperPoint_continuous v hv)).mul (cusp_character_continuous h) have hHperiod (n:Eis) (z:ℂ):H (z+3*eisEmbedding n)=H z:=by dsimp [H] rw [←complexTranslation_action,cubeAverage_period_three p hp F hperiod,cuspFrequency_negative_period] let term (r:Eis⧸Ideal.span {p^3}) (z:ℂ):= f (z+3*eisEmbedding (GaussianShiftedPartition.representative (p^3) r)/eisEmbedding (p^3))* ShortDraftTrace.breveE (-cuspFrequency (h*p^3)*z) have hpoint (z:ℂ):H (eisEmbedding (p^3)*z)= (Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹^3*(∑' r:Eis⧸Ideal.span {p^3},term r z):=by have hphase:ShortDraftTrace.breveE (-cuspFrequency h*(eisEmbedding (p^3)*z))= ShortDraftTrace.breveE (-cuspFrequency (h*p^3)*z):=by rw [cuspFrequency_mul_right] congr 1 ring dsimp only [H,cubeAverage] rw [hphase] rw [mul_assoc,←tsum_mul_right] congr 1 apply tsum_congr intro r dsimp only [term,f] rw [cubeAverageMatrix_action] congr 2 apply upperPoint_congr · rw [map_pow] field_simp [eisEmbedding_ne_zero hp] · rfl let:Finite (Eis⧸Ideal.span {p^3}):=finite_quotient_span (pow_ne_zero 3 hp) let:Fintype (Eis⧸Ideal.span {p^3}):=Fintype.ofFinite _ have hi (r:Eis⧸Ideal.span {p^3}):IntegrableOn (term r) periodDomain:=by apply periodDomain_integrable_of_continuous exact (hf.comp (continuous_id.add continuous_const)).mul (cusp_character_continuous (h*p^3)) have hint:(∫z in periodDomain,∑' r:Eis⧸Ideal.span {p^3},term r z)= ∑' r:Eis⧸Ideal.span {p^3},∫z in periodDomain,term r z:=by simp only [tsum_fintype] exact integral_finsetSum _ (fun r _=>hi r) have hterm (r:Eis⧸Ideal.span {p^3}): (∫z in periodDomain,term r z)=∫z in periodDomain,f z*ShortDraftTrace.breveE (-cuspFrequency (h*p^3)*z):= period_fourier_fractional_translation f hfperiod (p^3) (pow_ne_zero 3 hp) h _ have hcard:(Nat.card (Eis⧸Ideal.span {p^3}):ℂ)=(Ideal.absNorm (Ideal.span {p}):ℂ)^3:=by change (Ideal.absNorm (Ideal.span {p^3}):ℂ)=_ rw [←Ideal.span_singleton_pow,map_pow,Nat.cast_pow] have hqN:Ideal.absNorm (Ideal.span {p})≠0:= (Ideal.absNorm_ne_zero_iff _).mpr (finite_quotient_span hp) have hq:(Ideal.absNorm (Ideal.span {p}):ℂ)≠0:=by exact_mod_cast hqN change (∫z in periodDomain,H z)=∫z in periodDomain,f z*ShortDraftTrace.breveE (-cuspFrequency (h*p^3)*z) calc _=∫z in periodDomain,H (eisEmbedding (p^3)*z):= (period_integral_eisenstein_mul H hH.measurable hHperiod (p^3) (pow_ne_zero 3 hp)).symm _=(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹^3* (∑' r:Eis⧸Ideal.span {p^3},∫z in periodDomain,term r z):=by simp_rw [hpoint] rw [integral_const_mul,hint] _=(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹^3* (∑' (_:Eis⧸Ideal.span {p^3}),∫z in periodDomain,f z*ShortDraftTrace.breveE (-cuspFrequency (h*p^3)*z)):=by congr 1 exact tsum_congr hterm _=_:=by rw [tsum_const,nsmul_eq_mul,hcard];field_simp end open MeasureTheory open scoped Classical MatrixGroups BigOperators open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota namespace RootNotationCorrespondenceEnergy06 abbrev Eis := ActualEisensteinCubic.O end RootNotationCorrespondenceEnergy06 open RootNotationCorrespondenceEnergy06 (Eis) theorem cubeSource_fourier (p:Eis) (hp:p≠0) (h:Eis) (v:ℝ) (hv:0 by apply Subgroup.finiteIndex_iff.mpr rw [Subgroup.index_comap_of_surjective _ (a i).surjective] exact Subgroup.FiniteIndex.index_ne_zero) unfold common infer_instance def toSource (K R : Subgroup G) (a : ι → G ≃* G) (i : ι) : common K R a →* R where toFun h := ⟨a i (h : G), common_le_preimage K R a i h.property⟩ map_one' := Subtype.ext (map_one (a i)) map_mul' x y := Subtype.ext (map_mul (a i) (x : G) (y : G)) lemma toSource_injective (K R : Subgroup G) (a : ι → G ≃* G) (i : ι) : Function.Injective (toSource K R a i) := by intro x y hxy apply Subtype.ext exact (a i).injective (congrArg (fun r : R => (r : G)) hxy) lemma toSource_range (K R : Subgroup G) (a : ι → G ≃* G) (i : ι) : (toSource K R a i).range = (common K R a).comap ((a i).symm.toMonoidHom.comp R.subtype) := by ext r constructor · rintro ⟨h,rfl⟩ change (a i).symm (a i (h : G)) ∈ common K R a simpa only [MulEquiv.symm_apply_apply] using h.property · intro hr refine ⟨⟨(a i).symm (r : G),hr⟩,?_⟩ apply Subtype.ext exact (a i).apply_symm_apply (r : G) abbrev toSource_range_finiteIndex [Finite ι] (K R : Subgroup G) (a : ι → G ≃* G) [K.FiniteIndex] [R.FiniteIndex] (i : ι) : (toSource K R a i).range.FiniteIndex := by let : (common K R a).FiniteIndex := common_finiteIndex K R a rw [toSource_range] apply Subgroup.finiteIndex_iff.mpr rw [Subgroup.index_comap] change ((common K R a).subgroupOf ((a i).symm.toMonoidHom.comp R.subtype).range).index ≠ 0 exact Subgroup.FiniteIndex.index_ne_zero def hom (K R lengthScale : Subgroup G) (a : ι → G ≃* G) (e : R ≃* lengthScale) (i : ι) : common K R a →* G := lengthScale.subtype.comp (e.toMonoidHom.comp (toSource K R a i)) lemma hom_injective (K R lengthScale : Subgroup G) (a : ι → G ≃* G) (e : R ≃* lengthScale) (i : ι) : Function.Injective (hom K R lengthScale a e i) := lengthScale.subtype_injective.comp (e.injective.comp (toSource_injective K R a i)) def target (K R lengthScale : Subgroup G) (a : ι → G ≃* G) (e : R ≃* lengthScale) (i : ι) : Subgroup G := (hom K R lengthScale a e i).range lemma target_le (K R lengthScale : Subgroup G) (a : ι → G ≃* G) (e : R ≃* lengthScale) (i : ι) : target K R lengthScale a e i ≤ lengthScale := by rintro x ⟨h,rfl⟩ exact (e (toSource K R a i h)).property lemma target_le_common_ambient (K R lengthScale : Subgroup G) (a : ι → G ≃* G) (e : R ≃* lengthScale) (hLK : lengthScale ≤ K) (i : ι) : target K R lengthScale a e i ≤ K := (target_le K R lengthScale a e i).trans hLK lemma target_eq_map (K R lengthScale : Subgroup G) (a : ι → G ≃* G) (e : R ≃* lengthScale) (i : ι) : target K R lengthScale a e i = ((toSource K R a i).range.map e.toMonoidHom).map lengthScale.subtype := by rw [target,hom,MonoidHom.range_comp,MonoidHom.range_comp] abbrev target_finiteIndex [Finite ι] (K R lengthScale : Subgroup G) (a : ι → G ≃* G) (e : R ≃* lengthScale) [K.FiniteIndex] [R.FiniteIndex] [lengthScale.FiniteIndex] (i : ι) : (target K R lengthScale a e i).FiniteIndex := by let : (toSource K R a i).range.FiniteIndex := toSource_range_finiteIndex K R a i let : ((toSource K R a i).range.map e.toMonoidHom).FiniteIndex := by apply Subgroup.finiteIndex_iff.mpr rw [Subgroup.index_map_of_bijective e.bijective] exact Subgroup.FiniteIndex.index_ne_zero constructor rw [target_eq_map,Subgroup.index_map_subtype] exact mul_ne_zero Subgroup.FiniteIndex.index_ne_zero Subgroup.FiniteIndex.index_ne_zero def equiv (K R lengthScale : Subgroup G) (a : ι → G ≃* G) (e : R ≃* lengthScale) (i : ι) : common K R a ≃* target K R lengthScale a e i := MonoidHom.ofInjective (hom_injective K R lengthScale a e i) end FiniteAutomorphismCover namespace CubicKubota open scoped BigOperators Classical MatrixGroups open CubicEisenstein ConcreteTraceCRT lemma literalCube_zero_pair (p : ActualEisensteinCubic.O) (hp : p≠0) (x : cubeKernelCorrespondence p) : cubeAverageMatrix p hp 0*integralComplexMatrix (cubeKernelRightGlobal p hp x)= integralComplexMatrix (cubeKernelLeftGlobal p x)*cubeAverageMatrix p hp 0 := by let M := cubeKernelLeftGlobal p x let N := cubeKernelRightGlobal p hp x let z := cubeDilationRoot p have hz : z^2=eisEmbedding p^3 := cubeDilationRoot_sq p have hz0 : z≠0 := cubeDilationRoot_ne_zero p hp have he := cubeCorrespondence_entries p x.1 change p^3*M 0 0=N 0 0*p^3 ∧ p^3*M 0 1=N 0 1 ∧ M 1 0=N 1 0*p^3 ∧ M 1 1=N 1 1 at he have h00 : eisEmbedding (M 0 0)=eisEmbedding (N 0 0) := congrArg eisEmbedding (mul_left_cancel₀ (pow_ne_zero 3 hp) (he.1.trans (mul_comm _ _))) have h01 := congrArg eisEmbedding he.2.1 have h10 := congrArg eisEmbedding he.2.2.1 have h11 := congrArg eisEmbedding he.2.2.2 simp only [map_mul,map_pow] at h01 h10 apply Matrix.SpecialLinearGroup.ext intro i j fin_cases i <;> fin_cases j <;> simp only [Matrix.SpecialLinearGroup.coe_mul,Matrix.mul_apply,Fin.sum_univ_two, cubeAverageMatrix_entries,integralComplexMatrix_apply] · change z⁻¹*eisEmbedding (N 0 0)+(z⁻¹*(3*eisEmbedding 0))*eisEmbedding (N 1 0)= eisEmbedding (M 0 0)*z⁻¹+eisEmbedding (M 0 1)*0 rw [h00,map_zero] ring · change z⁻¹*eisEmbedding (N 0 1)+(z⁻¹*(3*eisEmbedding 0))*eisEmbedding (N 1 1)= eisEmbedding (M 0 0)*(z⁻¹*(3*eisEmbedding 0))+eisEmbedding (M 0 1)*z rw [←h01,←hz,map_zero] field_simp [hz0] ; ring · change 0*eisEmbedding (N 0 0)+z*eisEmbedding (N 1 0)= eisEmbedding (M 1 0)*z⁻¹+eisEmbedding (M 1 1)*0 rw [h10,←hz] field_simp [hz0] ; ring · change 0*eisEmbedding (N 0 1)+z*eisEmbedding (N 1 1)= eisEmbedding (M 1 0)*(z⁻¹*(3*eisEmbedding 0))+eisEmbedding (M 1 1)*z rw [h11,map_zero] ring theorem literalCube_zero_intertwines (p : ActualEisensteinCubic.O) (hp : p≠0) : IntegralCoverIntertwines (cubeKernelRangeEquiv p hp).symm (cubeAverageMatrix p hp 0) := by intro r let x := (MonoidHom.ofInjective (cubeKernelRightGlobal_injective p hp)).symm r have hr : cubeKernelRightGlobal p hp x=(r:SL(2,ActualEisensteinCubic.O)) := MonoidHom.apply_ofInjective_symm (cubeKernelRightGlobal_injective p hp) r change cubeAverageMatrix p hp 0*integralComplexMatrix (r:SL(2,ActualEisensteinCubic.O))= integralComplexMatrix (cubeKernelLeftGlobal p x)*cubeAverageMatrix p hp 0 rw [←hr] exact literalCube_zero_pair p hp x lemma cubeTranslation_complex (q : ActualEisensteinCubic.O) : integralComplexMatrix (upperTranslation q:SL(2,ActualEisensteinCubic.O))=complexTranslation (3*eisEmbedding q) := by apply Matrix.SpecialLinearGroup.ext intro i j rw [integralComplexMatrix_apply] fin_cases i <;> fin_cases j <;> simp [upperTranslation, complexTranslation, map_ofNat] lemma cubeAverageMatrix_factor_zero (p : ActualEisensteinCubic.O) (hp : p≠0) (q : ActualEisensteinCubic.O) : cubeAverageMatrix p hp q=cubeAverageMatrix p hp 0* integralComplexMatrix (upperTranslation q:SL(2,ActualEisensteinCubic.O)) := by rw [cubeTranslation_complex] have h0 : complexTranslation 0=1 := by apply Matrix.SpecialLinearGroup.ext intro i j fin_cases i <;> fin_cases j <;> simp [complexTranslation] simp only [cubeAverageMatrix,map_zero,mul_zero,h0,mul_one] theorem literalCube_summand_intertwines (p : ActualEisensteinCubic.O) (hp : p≠0) (q : ActualEisensteinCubic.O) (A : SL(2,ActualEisensteinCubic.O)) (r : (cubeKernelRightGlobal p hp).range) (hA : (upperTranslation q:SL(2,ActualEisensteinCubic.O))*A=(r:SL(2,ActualEisensteinCubic.O))*(upperTranslation q:SL(2,ActualEisensteinCubic.O))) : cubeAverageMatrix p hp q*integralComplexMatrix A= integralComplexMatrix ((cubeKernelRangeEquiv p hp).symm r:SL(2,ActualEisensteinCubic.O))*cubeAverageMatrix p hp q := by have hAc := congrArg integralComplexMatrix hA simp only [map_mul] at hAc rw [cubeAverageMatrix_factor_zero,mul_assoc,hAc,←mul_assoc, literalCube_zero_intertwines p hp r,mul_assoc] end CubicKubota namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups InnerProductSpace open Finset AddChar MulChar EisensteinEmbedding lemma integralCoverIntertwines_trans {H J K : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (f : J≃*K) (g h : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (hf : IntegralCoverIntertwines f h) : IntegralCoverIntertwines (e.trans f) (h*g) := by intro x change (h*g)*integralComplexMatrix (x:SL(2,ActualEisensteinCubic.O))= integralComplexMatrix (f (e x):SL(2,ActualEisensteinCubic.O))*(h*g) rw [mul_assoc,he x,←mul_assoc,hf (e x),mul_assoc] lemma integralConjugateMap_trans {H J K : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (f : J≃*K) (g h : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (hf : IntegralCoverIntertwines f h) (q : IntegralOrbitQuotient H) : integralConjugateMap f h hf (integralConjugateMap e g he q)= integralConjugateMap (e.trans f) (h*g) (integralCoverIntertwines_trans e f g h he hf) q := by induction q using Quotient.inductionOn with | _ w => change integralOrbitProjection K (h•(g•w))=integralOrbitProjection K ((h*g)•w) rw [mul_smul] lemma integralConjugatePullback_trans {H J K : Subgroup (SL(2,ActualEisensteinCubic.O))} (e : H≃*J) (f : J≃*K) (g h : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (hf : IntegralCoverIntertwines f h) (hH : H≤CubicKubota.levelThree) (hJ : J≤CubicKubota.levelThree) (hK : K≤CubicKubota.levelThree) (F : IntegralQuotientL2 K) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace integralConjugatePullback e g he hH hJ (integralConjugatePullback f h hf hJ hK F)= integralConjugatePullback (e.trans f) (h*g) (integralCoverIntertwines_trans e f g h he hf) hH hK F := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply Lp.ext have hinner := (integralConjugateMap_measurePreserving e g he hH hJ).quasiMeasurePreserving.ae_eq_comp (integralConjugatePullback_ae f h hf hJ hK F) filter_upwards [integralConjugatePullback_ae e g he hH hJ (integralConjugatePullback f h hf hJ hK F), hinner,integralConjugatePullback_ae (e.trans f) (h*g) (integralCoverIntertwines_trans e f g h he hf) hH hK F] with q ho hi ht dsimp only [Function.comp_def] at hi rw [ho,hi,ht,integralConjugateMap_trans] def kernelCoverLeg {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hJK : J≤globalKubotaKernel) [J.IsFiniteRelIndex globalKubotaKernel] (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2→L[ℂ]IntegralQuotientL2 H := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (integralConjugatePullback e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree)).toContinuousLinearMap.comp (integralCoverPullback hJK globalKubotaKernel_le_levelThree) lemma kernelCoverLeg_representative {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hJK : J≤globalKubotaKernel) [J.IsFiniteRelIndex globalKubotaKernel] (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (F : KernelQuotientL2) (f : KernelQuotient→ℂ) (hrep : F=ᵐ[integralQuotientVolume globalKubotaKernel]f) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelCoverLeg hHK hJK e g he F=ᵐ[integralQuotientVolume H] fun q=>f (integralCoverMap hJK (integralConjugateMap e g he q)) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by have hc := (integralCoverPullback_ae hJK globalKubotaKernel_le_levelThree F).trans ((integralCoverMap_quasiMeasurePreserving hJK globalKubotaKernel_le_levelThree).ae_eq_comp hrep) exact (integralConjugatePullback_ae e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree) _).trans ((integralConjugateMap_measurePreserving e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree)).quasiMeasurePreserving.ae_eq_comp hc) lemma kernelCoverLeg_adjoint_apply {H J : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hJK : J≤globalKubotaKernel) [J.IsFiniteRelIndex globalKubotaKernel] (e : H≃*J) (g : SL(2,ℂ)) (he : IntegralCoverIntertwines e g) (F : IntegralQuotientL2 H) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ContinuousLinearMap.adjoint (kernelCoverLeg hHK hJK e g he) F= integralCoverTrace hJK globalKubotaKernel_le_levelThree (integralConjugatePullback e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) (hJK.trans globalKubotaKernel_le_levelThree) (hHK.trans globalKubotaKernel_le_levelThree) F) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply ext_inner_right ℂ intro G rw [ContinuousLinearMap.adjoint_inner_left] change inner ℂ F (integralConjugatePullback e g he (hHK.trans globalKubotaKernel_le_levelThree) (hJK.trans globalKubotaKernel_le_levelThree) (integralCoverPullback hJK globalKubotaKernel_le_levelThree G))=_ rw [integralConjugatePullback_pairing] exact (ContinuousLinearMap.adjoint_inner_left (integralCoverPullback hJK globalKubotaKernel_le_levelThree) G _).symm theorem kernelCoverLeg_adjoint_comp {H Ji Jj : Subgroup (SL(2,ActualEisensteinCubic.O))} (hHK : H≤globalKubotaKernel) (hiK : Ji≤globalKubotaKernel) (hjK : Jj≤globalKubotaKernel) [Ji.IsFiniteRelIndex globalKubotaKernel] [Jj.IsFiniteRelIndex globalKubotaKernel] (ei : H≃*Ji) (ej : H≃*Jj) (gi gj : SL(2,ℂ)) (hei : IntegralCoverIntertwines ei gi) (hej : IntegralCoverIntertwines ej gj) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace (ContinuousLinearMap.adjoint (kernelCoverLeg hHK hjK ej gj hej)).comp (kernelCoverLeg hHK hiK ei gi hei)= kernelCorrespondenceL2 hjK hiK (ej.symm.trans ei) (gi*gj⁻¹) (integralCoverIntertwines_trans ej.symm ei gj⁻¹ gi (integralCoverIntertwines_inverse ej gj hej) hei) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by apply ContinuousLinearMap.ext intro F change ContinuousLinearMap.adjoint (kernelCoverLeg hHK hjK ej gj hej) (kernelCoverLeg hHK hiK ei gi hei F)=_ rw [kernelCoverLeg_adjoint_apply] change integralCoverTrace hjK globalKubotaKernel_le_levelThree (integralConjugatePullback ej.symm gj⁻¹ (integralCoverIntertwines_inverse ej gj hej) (hjK.trans globalKubotaKernel_le_levelThree) (hHK.trans globalKubotaKernel_le_levelThree) (integralConjugatePullback ei gi hei (hHK.trans globalKubotaKernel_le_levelThree) (hiK.trans globalKubotaKernel_le_levelThree) (integralCoverPullback hiK globalKubotaKernel_le_levelThree F)))=_ rw [integralConjugatePullback_trans] rfl end CubicEisenstein open scoped Classical MatrixGroups BigOperators namespace CubicKubota open CubicEisenstein ConcreteTraceCRT abbrev CubeResidues (p : ActualEisensteinCubic.O) := ActualEisensteinCubic.O ⧸ Ideal.span {p^3} def cubeCommonAutomorphism (p : ActualEisensteinCubic.O) (r : CubeResidues p) : SL(2,ActualEisensteinCubic.O) ≃* SL(2,ActualEisensteinCubic.O) := MulAut.conj (upperTranslation (GaussianShiftedPartition.representative (p^3) r):SL(2,ActualEisensteinCubic.O)) def cubeCommonCover (p : ActualEisensteinCubic.O) (hp : p≠0) : Subgroup (SL(2,ActualEisensteinCubic.O)) := FiniteAutomorphismCover.common globalKubotaKernel (cubeKernelRightGlobal p hp).range (cubeCommonAutomorphism p) lemma cubeCommonCover_le (p : ActualEisensteinCubic.O) (hp : p≠0) : cubeCommonCover p hp≤globalKubotaKernel := FiniteAutomorphismCover.common_le _ _ _ lemma cubeCommonCover_finiteIndex (p : ActualEisensteinCubic.O) (hp : p≠0) : (cubeCommonCover p hp).FiniteIndex := by let : globalKubotaKernel.FiniteIndex := globalKubotaKernel_finiteIndex let : Finite (CubeResidues p) := finite_quotient_span (pow_ne_zero 3 hp) let := (cubeKernelGlobal_finite_covers p hp).2 exact FiniteAutomorphismCover.common_finiteIndex _ _ _ def cubeCommonTarget (p : ActualEisensteinCubic.O) (hp : p≠0) (r : CubeResidues p) : Subgroup (SL(2,ActualEisensteinCubic.O)) := FiniteAutomorphismCover.target globalKubotaKernel (cubeKernelRightGlobal p hp).range (cubeKernelLeftGlobal p).range (cubeCommonAutomorphism p) (cubeKernelRangeEquiv p hp).symm r lemma cubeCommonTarget_le (p : ActualEisensteinCubic.O) (hp : p≠0) (r : CubeResidues p) : cubeCommonTarget p hp r≤globalKubotaKernel := FiniteAutomorphismCover.target_le_common_ambient _ _ _ _ _ (cubeKernelLeftGlobal_le p) r lemma cubeCommonTarget_finiteIndex (p : ActualEisensteinCubic.O) (hp : p≠0) (r : CubeResidues p) : (cubeCommonTarget p hp r).FiniteIndex := by let : globalKubotaKernel.FiniteIndex := globalKubotaKernel_finiteIndex let : Finite (CubeResidues p) := finite_quotient_span (pow_ne_zero 3 hp) let := (cubeKernelGlobal_finite_covers p hp).1 let := (cubeKernelGlobal_finite_covers p hp).2 exact FiniteAutomorphismCover.target_finiteIndex _ _ _ _ _ r def cubeCommonEquiv (p : ActualEisensteinCubic.O) (hp : p≠0) (r : CubeResidues p) : cubeCommonCover p hp≃*cubeCommonTarget p hp r := FiniteAutomorphismCover.equiv globalKubotaKernel (cubeKernelRightGlobal p hp).range (cubeKernelLeftGlobal p).range (cubeCommonAutomorphism p) (cubeKernelRangeEquiv p hp).symm r lemma cubeCommon_intertwines (p : ActualEisensteinCubic.O) (hp : p≠0) (r : CubeResidues p) : IntegralCoverIntertwines (cubeCommonEquiv p hp r) (cubeAverageMatrix p hp (GaussianShiftedPartition.representative (p^3) r)) := by intro h let q := GaussianShiftedPartition.representative (p^3) r let rh := FiniteAutomorphismCover.toSource globalKubotaKernel (cubeKernelRightGlobal p hp).range (cubeCommonAutomorphism p) r h have hA : (upperTranslation q:SL(2,ActualEisensteinCubic.O))*(h:SL(2,ActualEisensteinCubic.O))= (rh:SL(2,ActualEisensteinCubic.O))*(upperTranslation q:SL(2,ActualEisensteinCubic.O)) := by change (upperTranslation q:SL(2,ActualEisensteinCubic.O))*(h:SL(2,ActualEisensteinCubic.O))= ((upperTranslation q:SL(2,ActualEisensteinCubic.O))*(h:SL(2,ActualEisensteinCubic.O))*(upperTranslation q:SL(2,ActualEisensteinCubic.O))⁻¹)* (upperTranslation q:SL(2,ActualEisensteinCubic.O)) simp only [mul_assoc,inv_mul_cancel,mul_one] exact literalCube_summand_intertwines p hp q (h:SL(2,ActualEisensteinCubic.O)) rh hA end CubicKubota end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ResidualOrthogonality /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped Classical MatrixGroups BigOperators namespace CubicEisenstein open CubicKubota namespace RootNotationResidualOrthogonality01 abbrev O := ActualEisensteinCubic.O end RootNotationResidualOrthogonality01 open RootNotationResidualOrthogonality01 (O) lemma cubicSourceResidualFunction_kernel_invariant (M : globalKubotaKernel) (w : HyperbolicSpace) : cubicSourceResidualFunction (integralComplexMatrix (M:SL(2,ActualEisensteinCubic.O)) • w)= cubicSourceResidualFunction w := by obtain ⟨hM,hchar⟩ := (globalKubotaKernel_mem (M:SL(2,ActualEisensteinCubic.O))).mp M.property have h := cubicSourceResidualFunction_automorphy ⟨(M:SL(2,ActualEisensteinCubic.O)),levelThree_le_levelTwo hM⟩ w rw [levelTwoComplexCharacter_restrict ⟨(M:SL(2,ActualEisensteinCubic.O)),hM⟩,hchar,one_mul] at h exact h def cubicSourceQuotientFunction : KernelQuotient→ℂ := Quotient.lift cubicSourceResidualFunction (by rintro w u ⟨h,rfl⟩ exact (cubicSourceResidualFunction_kernel_invariant h w).symm) lemma cubicSourceQuotientFunction_measurable : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology Measurable cubicSourceQuotientFunction := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI rootPolicy_hyperbolicBorelSpace := @OAI.CubicEisenstein.hyperbolicBorelSpace letI rootPolicy_complexSLTopology := @OAI.CubicEisenstein.complexSLTopology by apply measurable_from_quotient.mpr exact cubicSourceResidualFunction_continuous.measurable lemma cubicSourceQuotientFunction_represents : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace kernelSourceProjection cubicEisensteinResidue=ᵐ[integralQuotientVolume globalKubotaKernel] cubicSourceQuotientFunction := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by unfold integralQuotientVolume apply (ae_map_iff (measurable_integralOrbitProjection _).aemeasurable (measurableSet_eq_fun (Lp.stronglyMeasurable _).measurable cubicSourceQuotientFunction_measurable)).mpr exact ae_restrict_of_ae cubicSourceResidualFunction_represents_projection end CubicEisenstein namespace CubicKubota open CubicEisenstein ConcreteTraceCRT namespace RootNotationResidualOrthogonality02 abbrev O := ActualEisensteinCubic.O end RootNotationResidualOrthogonality02 open RootNotationResidualOrthogonality02 (O) abbrev CubeLegIndex (p : ActualEisensteinCubic.O) := Option (CubeResidues p) def cubeLegTarget (p : ActualEisensteinCubic.O) (hp : p≠0) : CubeLegIndex p→Subgroup (SL(2,ActualEisensteinCubic.O)) | none => cubeCommonCover p hp | some r => cubeCommonTarget p hp r lemma cubeLegTarget_le (p : ActualEisensteinCubic.O) (hp : p≠0) (i : CubeLegIndex p) : cubeLegTarget p hp i≤globalKubotaKernel := by cases i with | none => exact cubeCommonCover_le p hp | some r => exact cubeCommonTarget_le p hp r lemma cubeLegTarget_finiteIndex (p : ActualEisensteinCubic.O) (hp : p≠0) (i : CubeLegIndex p) : (cubeLegTarget p hp i).FiniteIndex := by cases i with | none => exact cubeCommonCover_finiteIndex p hp | some r => exact cubeCommonTarget_finiteIndex p hp r def cubeLegEquiv (p : ActualEisensteinCubic.O) (hp : p≠0) : (i : CubeLegIndex p)→ cubeCommonCover p hp≃*cubeLegTarget p hp i | none => MulEquiv.refl _ | some r => cubeCommonEquiv p hp r def cubeLegMatrix (p : ActualEisensteinCubic.O) (hp : p≠0) : CubeLegIndex p→SL(2,ℂ) | none => 1 | some r => cubeAverageMatrix p hp (GaussianShiftedPartition.representative (p^3) r) lemma cubeLeg_intertwines (p : ActualEisensteinCubic.O) (hp : p≠0) (i : CubeLegIndex p) : IntegralCoverIntertwines (cubeLegEquiv p hp i) (cubeLegMatrix p hp i) := by cases i with | none => intro h change 1*integralComplexMatrix (h:SL(2,ActualEisensteinCubic.O))=integralComplexMatrix (h:SL(2,ActualEisensteinCubic.O))*1 simp only [one_mul,mul_one] | some r => exact cubeCommon_intertwines p hp r def cubeLeg (p : ActualEisensteinCubic.O) (hp : p≠0) (i : CubeLegIndex p) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace KernelQuotientL2→L[ℂ]IntegralQuotientL2 (cubeCommonCover p hp) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by letI := cubeLegTarget_finiteIndex p hp i letI : (cubeLegTarget p hp i).IsFiniteRelIndex globalKubotaKernel := Subgroup.isFiniteRelIndex_of_finiteIndex exact kernelCoverLeg (cubeCommonCover_le p hp) (cubeLegTarget_le p hp i) (cubeLegEquiv p hp i) (cubeLegMatrix p hp i) (cubeLeg_intertwines p hp i) def cubeLegCoefficient (p : ActualEisensteinCubic.O) : CubeLegIndex p→ℂ | none => -(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹ | some _ => (Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹^3 def cubeLegQuotientFunction (p : ActualEisensteinCubic.O) (hp : p≠0) (i : CubeLegIndex p) : IntegralOrbitQuotient (cubeCommonCover p hp)→ℂ := fun q=>cubicSourceQuotientFunction (integralCoverMap (cubeLegTarget_le p hp i) (integralConjugateMap (cubeLegEquiv p hp i) (cubeLegMatrix p hp i) (cubeLeg_intertwines p hp i) q)) lemma cubeLegQuotientFunction_projection (p : ActualEisensteinCubic.O) (hp : p≠0) (i : CubeLegIndex p) (w : HyperbolicSpace) : cubeLegQuotientFunction p hp i (integralOrbitProjection (cubeCommonCover p hp) w)= cubicSourceResidualFunction (cubeLegMatrix p hp i • w) := rfl lemma cubeLegQuotientFunction_measurable (p : ActualEisensteinCubic.O) (hp : p≠0) (i : CubeLegIndex p) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measurable (cubeLegQuotientFunction p hp i) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace cubicSourceQuotientFunction_measurable.comp ((integralCoverMap_measurable (cubeLegTarget_le p hp i)).comp (integralConjugateMap_measurable _ _ _)) lemma cubeLeg_representative (p : ActualEisensteinCubic.O) (hp : p≠0) (i : CubeLegIndex p) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace cubeLeg p hp i (kernelSourceProjection cubicEisensteinResidue) =ᵐ[integralQuotientVolume (cubeCommonCover p hp)]cubeLegQuotientFunction p hp i := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by let := cubeLegTarget_finiteIndex p hp i let : (cubeLegTarget p hp i).IsFiniteRelIndex globalKubotaKernel := Subgroup.isFiniteRelIndex_of_finiteIndex exact kernelCoverLeg_representative (cubeCommonCover_le p hp) (cubeLegTarget_le p hp i) (cubeLegEquiv p hp i) (cubeLegMatrix p hp i) (cubeLeg_intertwines p hp i) _ _ cubicSourceQuotientFunction_represents def cubeDifferenceL2 (p : ActualEisensteinCubic.O) (hp : p≠0) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace IntegralQuotientL2 (cubeCommonCover p hp) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∑' i:CubeLegIndex p,cubeLegCoefficient p i • cubeLeg p hp i (kernelSourceProjection cubicEisensteinResidue) def cubeDifferenceQuotientFunction (p : ActualEisensteinCubic.O) (hp : p≠0) : IntegralOrbitQuotient (cubeCommonCover p hp)→ℂ := fun q=>∑' i:CubeLegIndex p,cubeLegCoefficient p i*cubeLegQuotientFunction p hp i q lemma cubeDifferenceQuotientFunction_projection (p : ActualEisensteinCubic.O) (hp : p≠0) (w : HyperbolicSpace) : cubeDifferenceQuotientFunction p hp (integralOrbitProjection (cubeCommonCover p hp) w)= cubeSourceDifference p hp w := by let : Finite (CubeResidues p) := finite_quotient_span (pow_ne_zero 3 hp) let : Fintype (CubeResidues p) := Fintype.ofFinite _ simp only [cubeDifferenceQuotientFunction,tsum_fintype,Fintype.sum_option, cubeLegCoefficient,cubeLegQuotientFunction_projection,cubeLegMatrix,one_smul, cubeSourceDifference,cubeAverage,Finset.mul_sum] ring lemma cubeDifferenceQuotientFunction_measurable (p : ActualEisensteinCubic.O) (hp : p≠0) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measurable (cubeDifferenceQuotientFunction p hp) := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by let : Finite (CubeResidues p) := finite_quotient_span (pow_ne_zero 3 hp) let : Fintype (CubeResidues p) := Fintype.ofFinite _ unfold cubeDifferenceQuotientFunction simp only [tsum_fintype] exact Finset.measurable_sum _ (fun i _=>measurable_const.mul (cubeLegQuotientFunction_measurable p hp i)) lemma cubeDifferenceL2_representative (p : ActualEisensteinCubic.O) (hp : p≠0) : letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace cubeDifferenceL2 p hp=ᵐ[integralQuotientVolume (cubeCommonCover p hp)] cubeDifferenceQuotientFunction p hp := letI rootPolicy_hyperbolicMeasurableSpace := @OAI.CubicEisenstein.hyperbolicMeasurableSpace by let : Finite (CubeResidues p) := finite_quotient_span (pow_ne_zero 3 hp) let : Fintype (CubeResidues p) := Fintype.ofFinite _ unfold cubeDifferenceL2 cubeDifferenceQuotientFunction simp only [tsum_fintype] apply (Lp.coeFn_finsetSum _ _).trans have hh (i : CubeLegIndex p) : ((cubeLegCoefficient p i • cubeLeg p hp i (kernelSourceProjection cubicEisensteinResidue) : IntegralQuotientL2 (cubeCommonCover p hp)) : IntegralOrbitQuotient (cubeCommonCover p hp)→ℂ) =ᵐ[integralQuotientVolume (cubeCommonCover p hp)] (fun q=>cubeLegCoefficient p i*cubeLegQuotientFunction p hp i q) := by filter_upwards [Lp.coeFn_smul (cubeLegCoefficient p i) (cubeLeg p hp i (kernelSourceProjection cubicEisensteinResidue)), cubeLeg_representative p hp i] with q hq hr simpa only [Pi.smul_apply,smul_eq_mul,hr] using hq filter_upwards [eventuallyEq_sum (fun i (_ : i∈Finset.univ)=>hh i)] with q hq simpa only [Finset.sum_apply] using hq end CubicKubota end namespace CubicEisenstein open MeasureTheory open scoped Classical MatrixGroups BigOperators section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota EisensteinCuspModThree namespace RootNotationResidualOrthogonality03 abbrev Eis := ActualEisensteinCubic.O end RootNotationResidualOrthogonality03 open RootNotationResidualOrthogonality03 (Eis) lemma sourceCuspLeadingCoefficient_ramified (j:Fin 3) (hj:j≠0) : sourceCuspLeadingCoefficient (cuspRepresentative j)=0 := by unfold sourceCuspLeadingCoefficient sourceCuspConstant rw [sourceCuspRepresentative_average] simp only [if_neg hj,zero_mul,zero_div] theorem sourceCuspRemainder_representatives_decay (a:ℝ) (ha:0cubeReducedRemainder (d r) hp.ne_zero z v hv) (K*‖eisEmbedding p‖^9/v^3) (by positivity) (fun r=>cubeReducedRemainder_bound_from_height (d r) hp.ne_zero a K ha hK hrep z v hv hav) have hrest:‖(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹*sourceCuspRemainder M z v hv‖≤ (Ideal.absNorm (Ideal.span {p}):ℝ)⁻¹*(K/v^3):=by rw [norm_mul,norm_inv,Complex.norm_natCast] exact mul_le_mul_of_nonneg_left hbase (inv_nonneg.mpr (Nat.cast_nonneg _)) unfold cubeSourceDifference rw [cubeSource_difference_eq_remainders M p hp hprimary z v hv] refine (norm_sub_le _ _).trans ?_ calc _≤K*‖eisEmbedding p‖^9/v^3+(Ideal.absNorm (Ideal.span {p}):ℝ)⁻¹*(K/v^3):= add_le_add hsum hrest _=_:=by ring end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota EisensteinCuspModThree namespace RootNotationResidualOrthogonality05 abbrev Eis := ActualEisensteinCubic.O end RootNotationResidualOrthogonality05 open RootNotationResidualOrthogonality05 (Eis) def cubeInverseLeftMatrix (q:Eis) : SL(2,Eis) := ⟨!![3*q,1;-1,0],by simp⟩ lemma cubeAverageMatrix_inverse_factor (p:Eis) (hp:p≠0) (q:Eis) : (cubeAverageMatrix p hp q)⁻¹= integralComplexMatrix (cubeInverseLeftMatrix q)*cubeAverageMatrix p hp 0* integralComplexMatrix (rationalEmbedding ModularGroup.S) := by apply Subtype.ext simp only [Matrix.SpecialLinearGroup.coe_inv, Matrix.SpecialLinearGroup.coe_mul, cubeAverageMatrix_entries] apply Matrix.ext intro i j simp only [Matrix.adjugate_fin_two, Matrix.mul_apply, Fin.sum_univ_two, integralComplexMatrix_apply, rationalEmbedding, Matrix.SpecialLinearGroup.map_apply_coe] fin_cases i <;> fin_cases j <;> simp [cubeInverseLeftMatrix, ModularGroup.S, map_ofNat] ring lemma cubeAverageMatrix_inverse_cusp_factor (M:SL(2,Eis)) (p q:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) : let d:=actualCubeCuspData (rationalEmbedding ModularGroup.S*M) p 0 hp hprimary (cubeAverageMatrix p hp.ne_zero q)⁻¹*integralComplexMatrix M= integralComplexMatrix (cubeInverseLeftMatrix q*d.matrix)*cubeCuspTriangular d hp.ne_zero := by dsimp only let d:=actualCubeCuspData (rationalEmbedding ModularGroup.S*M) p 0 hp hprimary calc _=integralComplexMatrix (cubeInverseLeftMatrix q)* (cubeAverageMatrix p hp.ne_zero 0*integralComplexMatrix (rationalEmbedding ModularGroup.S*M)):=by rw [cubeAverageMatrix_inverse_factor,map_mul] group _=integralComplexMatrix (cubeInverseLeftMatrix q)* (integralComplexMatrix d.matrix*cubeCuspTriangular d hp.ne_zero):=by rw [cubeCuspTriangular_factor d hp.ne_zero] _=integralComplexMatrix (cubeInverseLeftMatrix q*d.matrix)*cubeCuspTriangular d hp.ne_zero:=by rw [map_mul,mul_assoc] end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CubicKubota EisensteinCuspModThree namespace RootNotationResidualOrthogonality06 abbrev Eis := ActualEisensteinCubic.O end RootNotationResidualOrthogonality06 open RootNotationResidualOrthogonality06 (Eis) theorem cubeSourceDifference_inverse_cubic_decay (p:Eis) (hp:Prime p) (hprimary:lambda^2∣p-1) : ∃C:ℝ,0≤C∧∀q:Eis,∀M:SL(2,Eis),∀z:ℂ,∀v:ℝ,∀hv:0f (kernelSourceAction M⁻¹ q) := (kernelSourcePullback_ae_eq M⁻¹ F).trans ((kernelSourceAction_measurePreserving M⁻¹).quasiMeasurePreserving.ae_eq_comp hrep) apply cubicEisensteinResidue_orthogonal_of_cusp_chart_decay _ (kernelSource_eigenvector M⁻¹ F (8/9:ℂ) hF) _ hrepM C hC intro N z v hv hlarge exact kernelSourcePullback_integral_cusp_decay M⁻¹ f C hdec (N:SL(2,ActualEisensteinCubic.O)) z v hv hlarge theorem cubicSourceResidue_orthogonal_of_integral_cusp_decay (F : KernelQuotientL2) (hF : (F,(8/9:ℂ)•F)∈kernelEnergyLaplacian.graph) (f : KernelQuotient→ℂ) (hrep : F=ᵐ[integralQuotientVolume globalKubotaKernel]f) (C : ℝ) (hC : 0≤C) (hdec : ∀N : SL(2,ActualEisensteinCubic.O),∀z : ℂ,∀v : ℝ,∀hv : 0kernelEnergyLaplacian.graph.smul_mem (c i) (hi i)) have hEq : (∑i,c i • (traced i,eigenvalue • traced i))= (∑i,c i • traced i,eigenvalue • ∑i,c i • traced i) := by apply Prod.ext <;> simp [Prod.fst_sum,Prod.snd_sum,Finset.smul_sum,smul_smul,mul_comm] rw [hEq] at hsum simpa only [map_sum,map_smul] using hsum end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.PrimeRecurrence namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups InnerProductSpace open Finset AddChar MulChar EisensteinEmbedding section theorem integralCoverTraceFunction_integral_cusp_decay (H K : Subgroup (SL(2,ActualEisensteinCubic.O))) [H.IsFiniteRelIndex K] (f : IntegralOrbitQuotient H→ℂ) (C : ℝ) (hdec : ∀M : SL(2,ActualEisensteinCubic.O),∀z : ℂ,∀v : ℝ,∀hv : 0f (integralConjugateMap e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) q)) theorem kernelCoverLegAdjointFunction_represents (D : IntegralQuotientL2 H) (f : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; IntegralOrbitQuotient H→ℂ) (hf : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; Measurable f) (hrep : D=ᵐ[integralQuotientVolume H]f) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ContinuousLinearMap.adjoint (kernelCoverLeg hHK hJK e g he) D =ᵐ[integralQuotientVolume globalKubotaKernel]kernelCoverLegAdjointFunction e g he f := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace rw [kernelCoverLeg_adjoint_apply] have hconj := (integralConjugatePullback_ae e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) (hJK.trans globalKubotaKernel_le_levelThree) (hHK.trans globalKubotaKernel_le_levelThree) D).trans ((integralConjugateMap_measurePreserving e.symm g⁻¹ (integralCoverIntertwines_inverse e g he) (hJK.trans globalKubotaKernel_le_levelThree) (hHK.trans globalKubotaKernel_le_levelThree)).quasiMeasurePreserving.ae_eq_comp hrep) exact integralCoverTrace_representative hJK globalKubotaKernel_le_levelThree _ _ (hf.comp (integralConjugateMap_measurable _ _ _)) hconj theorem kernelCoverLegAdjointFunction_cusp_decay (f : IntegralOrbitQuotient H→ℂ) (C : ℝ) (hdec : ∀M : SL(2,ActualEisensteinCubic.O),∀z : ℂ,∀v : ℝ,∀hv : 0kernelCoverLegAdjointFunction (e i) (g i) (he i) f) (C:=fun i=>(J i).relIndex globalKubotaKernel*C i) · intro i rw [hD] exact kernelCoverLeg_adjoint_sum_eigenvector J hHK hJK e g he (kernelSourceProjection cubicEisensteinResidue) (8/9:ℂ) kernelSourceProjection_cubicEisensteinResidue_eigenvector c i · intro i exact kernelCoverLegAdjointFunction_represents hHK (hJK i) (e i) (g i) (he i) D f hf hrep · intro i exact mul_nonneg (Nat.cast_nonneg _) (hC i) · intro i M z v hv hlarge exact kernelCoverLegAdjointFunction_cusp_decay (e i) (g i) (he i) f (C i) (hdec i) M z v hv hlarge end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups Pointwise lemma integralProjection_quasiMeasurePreserving (H:Subgroup (SL(2,(_root_.OAI.ActualEisensteinCubic.O)))) (hH:H≤CubicKubota.levelThree) : letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace Measure.QuasiMeasurePreserving (integralOrbitProjection H) hyperbolicVolume (integralQuotientVolume H) := by letI thirdWitness0 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace let := integralSubgroupHyperbolicAction H let := integralSLCountable let := integralSubgroupMeasurableAction H let := integralSubgroupVolumeInvariant H let proj:=integralOrbitProjection H have hp:Measurable proj:=measurable_integralOrbitProjection H refine ⟨hp,Measure.AbsolutelyContinuous.mk fun S hS hzero=>?_⟩ rw [Measure.map_apply hp hS] have hd:hyperbolicVolume ((proj ⁻¹' S)∩hyperbolicFundamentalSet H)=0:=by simpa only [integralQuotientVolume,proj, Measure.map_apply (measurable_integralOrbitProjection _) hS, Measure.restrict_apply ((measurable_integralOrbitProjection _) hS)] using hzero have hinv:∀M:H,M • (proj ⁻¹' S)=proj ⁻¹' S:=by intro M ext w constructor · rintro ⟨u,hu,rfl⟩ change proj (M • u)∈S change proj u∈S at hu rwa [show proj (M • u)=proj u from integralOrbitProjection_eq H M u] · intro hw refine ⟨M⁻¹ • w,?_,smul_inv_smul M w⟩ change proj (M⁻¹ • w)∈S rwa [show proj (M⁻¹ • w)=proj w from integralOrbitProjection_eq H M⁻¹ w] exact (hyperbolicFundamentalSet_isFundamentalDomain H hH).measure_zero_of_invariant (proj ⁻¹' S) hinv hd theorem integralQuotient_continuous_lifts_eq (H:Subgroup (SL(2,(_root_.OAI.ActualEisensteinCubic.O)))) (hH:H≤CubicKubota.levelThree) (F G:IntegralOrbitQuotient H→ℂ) (f g: letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; HyperbolicSpace→ℂ) (hf: letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; Continuous f) (hg: letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; Continuous g) (hF:∀w,F (integralOrbitProjection H w)=f w) (hG:∀w,G (integralOrbitProjection H w)=g w) (he:F=ᵐ[integralQuotientVolume H]G) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace f=g := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace letI thirdWitness2 := @OAI.CubicEisenstein.hyperbolicVolume_fullSupport have hl: f=ᵐ[hyperbolicVolume]g:=by have hh:=(integralProjection_quasiMeasurePreserving H hH).ae_eq_comp he simpa only [Function.comp_def,hF,hG] using hh exact Measure.eq_of_ae_eq hl hf hg theorem integralQuotient_zero_continuous_lift (H:Subgroup (SL(2,(_root_.OAI.ActualEisensteinCubic.O)))) (hH:H≤CubicKubota.levelThree) (F:IntegralOrbitQuotient H→ℂ) (f: letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; HyperbolicSpace→ℂ) (hf: letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology; letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace; Continuous f) (hF:∀w,F (integralOrbitProjection H w)=f w) (hzero:F=ᵐ[integralQuotientVolume H]0) : letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace ∀w,f w=0 := by letI thirdWitness0 := @OAI.CubicEisenstein.complexSLTopology letI thirdWitness1 := @OAI.CubicEisenstein.hyperbolicMeasurableSpace have he:f=0:=integralQuotient_continuous_lifts_eq H hH F 0 f 0 hf continuous_const hF (fun _=>rfl) hzero intro w exact congrFun he w end section open Filter MeasureTheory open scoped Classical MatrixGroups BigOperators open CubicKubota ConcreteTraceCRT theorem cubeDifferenceL2_eq_zero (p : ActualEisensteinCubic.O) (hp : Prime p) (hprimary : ActualEisensteinCubic.lambda^2∣p-1) : cubeDifferenceL2 p hp.ne_zero=0 := by let : Finite (CubeResidues p) := finite_quotient_span (pow_ne_zero 3 hp.ne_zero) let : Fintype (CubeResidues p) := Fintype.ofFinite _ let : ∀i : CubeLegIndex p,(cubeLegTarget p hp.ne_zero i).FiniteIndex := cubeLegTarget_finiteIndex p hp.ne_zero let : ∀i : CubeLegIndex p,(cubeLegTarget p hp.ne_zero i).IsFiniteRelIndex globalKubotaKernel := fun i=>Subgroup.isFiniteRelIndex_of_finiteIndex obtain ⟨C0,hC0,h0⟩ := cubeSourceDifference_cubic_decay p hp hprimary obtain ⟨C1,hC1,h1⟩ := cubeSourceDifference_inverse_cubic_decay p hp hprimary let C : CubeLegIndex p→ℝ := fun i=>i.elim C0 (fun _=>C1) apply commonCover_source_sum_eq_zero_of_inverse_cusp_decay (cubeLegTarget p hp.ne_zero) (cubeCommonCover_le p hp.ne_zero) (cubeLegTarget_le p hp.ne_zero) (cubeLegEquiv p hp.ne_zero) (cubeLegMatrix p hp.ne_zero) (cubeLeg_intertwines p hp.ne_zero) (cubeLegCoefficient p) (cubeDifferenceL2 p hp.ne_zero) ?_ (cubeDifferenceQuotientFunction p hp.ne_zero) (cubeDifferenceQuotientFunction_measurable p hp.ne_zero) (cubeDifferenceL2_representative p hp.ne_zero) C ?_ ?_ · simp only [cubeDifferenceL2,tsum_fintype,cubeLeg] · intro i cases i with | none => exact hC0 | some r => exact hC1 · intro i M z v hv hlarge rw [cubeDifferenceQuotientFunction_projection] cases i with | none => simpa only [cubeLegMatrix,inv_one,one_smul,C,Option.elim] using h0 M z v hv hlarge.le | some r => exact h1 (GaussianShiftedPartition.representative (p^3) r) M z v hv hlarge.le theorem cubeSourceDifference_eq_zero (p : ActualEisensteinCubic.O) (hp : Prime p) (hprimary : ActualEisensteinCubic.lambda^2∣p-1) (w : HyperbolicSpace) : cubeSourceDifference p hp.ne_zero w=0 := by have hz : cubeDifferenceQuotientFunction p hp.ne_zero =ᵐ[integralQuotientVolume (cubeCommonCover p hp.ne_zero)]0 := by apply (cubeDifferenceL2_representative p hp.ne_zero).symm.trans rw [cubeDifferenceL2_eq_zero p hp hprimary] exact Lp.coeFn_zero ℂ 2 _ exact integralQuotient_zero_continuous_lift (cubeCommonCover p hp.ne_zero) ((cubeCommonCover_le p hp.ne_zero).trans globalKubotaKernel_le_levelThree) (cubeDifferenceQuotientFunction p hp.ne_zero) (cubeSourceDifference p hp.ne_zero) (cubeSourceDifference_continuous p hp.ne_zero) (cubeDifferenceQuotientFunction_projection p hp.ne_zero) hz w theorem cubicSource_cubeAverage (p : ActualEisensteinCubic.O) (hp : Prime p) (hprimary : ActualEisensteinCubic.lambda^2∣p-1) (w : HyperbolicSpace) : cubeAverage p hp.ne_zero cubicSourceResidualFunction w= (Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹*cubicSourceResidualFunction w := sub_eq_zero.mp (cubeSourceDifference_eq_zero p hp hprimary w) theorem sourceArithmeticResidue_prime_cube (p : ActualEisensteinCubic.O) (hp : Prime p) (hprimary : ActualEisensteinCubic.lambda^2∣p-1) (h : ActualEisensteinCubic.O) (hh : h≠0) : sourceArithmeticResidue (h*p^3)=sourceArithmeticResidue h := sourceArithmeticResidue_cube_of_eigenrelation p hp.ne_zero (cubicSource_cubeAverage p hp hprimary) h hh end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups section open ActualEisensteinCubic ConcreteTraceCRT CubicKubota end section open ActualEisensteinCubic noncomputable abbrev instFintypeUnitsO : Fintype (_root_.OAI.ActualEisensteinCubic.O)ˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units abbrev PrincipalRamifiedIndex (h:(_root_.OAI.ActualEisensteinCubic.O)) := (_root_.OAI.ActualEisensteinCubic.O)ˣ × Fin (ramifiedFrequencyBound h+1) def principalRamifiedIndex (h:(_root_.OAI.ActualEisensteinCubic.O)) (i:PrincipalRamifiedIndex h) : (_root_.OAI.ActualEisensteinCubic.O) := h*(9*(i.1.val*lambda^(i.2.val+2))) def principalRamifiedWeight (h:(_root_.OAI.ActualEisensteinCubic.O)) (i:PrincipalRamifiedIndex h) (s:ℂ) : ℂ := ((3^(i.2.val+2):ℕ):ℂ)^(-s)*explicitRamifiedCoefficient h i.1 (i.2.val+2) lemma principalRamifiedWeight_analytic (h:(_root_.OAI.ActualEisensteinCubic.O)) (i:PrincipalRamifiedIndex h) (s:ℂ) : AnalyticAt ℂ (principalRamifiedWeight h i) s := by apply AnalyticAt.mul _ analyticAt_const apply Complex.analyticAt_iff_eventually_differentiableAt.mpr exact Eventually.of_forall fun z=>(differentiableAt_id.neg).const_cpow (Or.inl (by exact_mod_cast (pow_ne_zero (i.2.val+2) (by norm_num : (3:ℕ)≠0)))) lemma scatteringCoefficient_eq_principalRamified (s:ℂ) (hs:2(principalRamifiedWeight_analytic h i s).mul (cuspWhittakerHeightFactor_analyticAt h s hs)) (kernelCuspFourierFamily h 2 3 (by norm_num) (by norm_num)) (kernelCuspFourier h cubicEisensteinResidue) (fun s hs hi=>kernelCuspFourierFamily_analyticAt_nonreal h 2 3 (by norm_num) (by norm_num) s hs.ne' hi.ne') (kernelCuspFourierFamily_residue_limit h 2 3 (by norm_num) (by norm_num)) (fun s hs hi=>by rw [kernelCuspFourierFamily_eq_upper h hh ⟨by linarith,hi⟩] dsimp only rw [scatteringCoefficient_eq_principalRamified s (by linarith) h hh] simp only [coeff] rw [mul_div_cancel₀ _ cusp_volume_ne_zero,Finset.sum_mul] apply Finset.sum_congr rfl intro i hi' ring) rw [kernelCuspFourier_principal_residue] at he have hH:=cuspWhittakerHeightFactor_center_ne_zero h apply (eq_div_iff cusp_volume_ne_zero).mpr apply mul_right_cancel₀ hH calc principalArithmeticResidue h*((9*Real.sqrt 3/2:ℝ):ℂ)*cuspWhittakerHeightFactor (4/3) h = kernelCuspFourier h cubicEisensteinResidue := by rw [kernelCuspFourier_principal_residue] ring _ = _ := by rw [kernelCuspFourier_principal_residue,he] simp only [coeff] rw [Finset.sum_mul] apply Finset.sum_congr rfl intro i hi ring ) theorem sourceArithmeticResidue_eq_ramified_table (h:(_root_.OAI.ActualEisensteinCubic.O)) (hh:h≠0) : letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO sourceArithmeticResidue h= if ShortDraftTrace.breveE (cuspFrequency h)=1 then ((∑i:PrincipalRamifiedIndex h,principalRamifiedWeight h i (4/3)* unramifiedGaussResidue (principalRamifiedIndex h i))+ 3*unramifiedGaussResidue (9*h))/(4*((9*Real.sqrt 3/2:ℝ):ℂ)) else 0 := by letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO exact ( by rw [sourceArithmeticResidue,principalArithmeticResidue_eq_ramified_table h hh] split_ifs · ring · rfl ) end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma arithmeticResidueSum_frequency_cube (h c p:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) (hlevel:(3:(_root_.OAI.ActualEisensteinCubic.O))∣c) (hprimary:lambda^2∣p-1) (hcp:IsCoprime c p) : arithmeticResidueSum (h*p^3) c=arithmeticResidueSum h c := by have ht:denominatorCondition c p:=⟨hcp,three_dvd_lambda_sq.trans hprimary⟩ have hb:(eisEmbedding (symbol c p))^3=1:=by rw [←map_pow,symbol_cube_of_isCoprime c p hprimary hcp,map_one] have h1:=arithmeticResidueSum_frequency_twist h c p hc hlevel ht have h2:=arithmeticResidueSum_frequency_twist (h*p) c p hc hlevel ht have h3:=arithmeticResidueSum_frequency_twist (h*p*p) c p hc hlevel ht rw [show h*p^3=h*p*p*p by ring] calc _=eisEmbedding (symbol c p)^3*arithmeticResidueSum (h*p*p*p) c:=by rw [hb,one_mul] _=eisEmbedding (symbol c p)^2*arithmeticResidueSum (h*p*p) c:=by rw [pow_succ,mul_assoc,h3] _=eisEmbedding (symbol c p)*arithmeticResidueSum (h*p) c:=by rw [pow_two,mul_assoc,h2] _=arithmeticResidueSum h c:=h1 lemma ramified_prime_Gauss_cancel (h c p:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) (hlevel:(3:(_root_.OAI.ActualEisensteinCubic.O))∣c) (hp:Prime p) (hprimary:lambda^2∣p-1) (hcp:IsCoprime c p) : arithmeticResidueSum h c*primeCubicGauss p hp hprimary 1 (h*(9*c))= arithmeticResidueSum (h*p) c*primeCubicGauss p hp hprimary 1 (9*h) := by have ht:denominatorCondition c p:=⟨hcp,three_dvd_lambda_sq.trans hprimary⟩ have hA:=arithmeticResidueSum_frequency_twist h c p hc hlevel ht have hG:=cubicUnitGaussSum_frequency_twist (9*h) p c hp.ne_zero hprimary hcp.symm rw [←primeCubicGauss_one_eq p hp hprimary,←primeCubicGauss_one_eq p hp hprimary] at hG rw [show (9*h)*c=h*(9*c) by ring] at hG have hb:eisEmbedding (symbol c p)≠0:=by have hcube:(eisEmbedding (symbol c p))^3=1:=by rw [←map_pow,symbol_cube_of_isCoprime c p hprimary hcp,map_one] intro hz simp only [hz,zero_pow (by decide : (3:ℕ)≠0)] at hcube exact zero_ne_one hcube apply mul_left_cancel₀ hb calc _=arithmeticResidueSum h c*(eisEmbedding (symbol c p)* primeCubicGauss p hp hprimary 1 (h*(9*c))):=by ring _=arithmeticResidueSum h c*primeCubicGauss p hp hprimary 1 (9*h):=by rw [hG] _=(eisEmbedding (symbol c p)*arithmeticResidueSum (h*p) c)* primeCubicGauss p hp hprimary 1 (9*h):=by rw [hA] _=_:=by ring lemma ramified_prime_frequency_not_dvd (h p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (hph:¬p∣h) (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (n:ℕ) : ¬p∣h*(9*(u.val*lambda^n)) := by intro hd rcases hp.dvd_mul.mp hd with hh|hc · exact hph hh have hcp: IsCoprime (9*(u.val*lambda^n)) p := by have h3: IsCoprime (3:(_root_.OAI.ActualEisensteinCubic.O)) p:=(primary_coprime_three p hprimary).symm have hram: IsCoprime (u.val*lambda^n) p:= (ramified_primary_coprime u n p hprimary).of_mul_left_right convert h3.pow_left (m:=2) |>.mul_left hram using 1 ; norm_num exact hp.not_isUnit (hcp.symm.isUnit_of_dvd hc) lemma sourceRayPhase_mul_primary (h p:(_root_.OAI.ActualEisensteinCubic.O)) (hprimary:lambda^2∣p-1) : ShortDraftTrace.breveE (cuspFrequency (h*p))= ShortDraftTrace.breveE (cuspFrequency h) := by obtain ⟨d,hd⟩:=three_dvd_lambda_sq.trans hprimary have hp:p=1+3*d:=by linear_combination hd have he:cuspFrequency (h*p)=cuspFrequency h+cuspFrequency h*(3*eisEmbedding d):=by rw [hp,cuspFrequency,cuspFrequency,map_mul,map_add,map_mul,map_one,map_ofNat] ring rw [he,AddChar.map_add_eq_mul,cuspFrequency_period,mul_one] end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal noncomputable abbrev instFintypeUnitsO_2 : Fintype (_root_.OAI.ActualEisensteinCubic.O)ˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units def principalResidueTerm (h:(_root_.OAI.ActualEisensteinCubic.O)) (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (n:ℕ) : ℂ := ((3^(n+2):ℕ):ℂ)^(-(4/3:ℂ))*arithmeticResidueSum h (u.val*lambda^(n+2))* unramifiedGaussResidue (h*(9*(u.val*lambda^(n+2)))) lemma principalResidueTerm_vanish (h:(_root_.OAI.ActualEisensteinCubic.O)) (hh:h≠0) (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (n:ℕ) (hn:ramifiedFrequencyBound hhph (he▸dvd_zero p) let N:=max (ramifiedFrequencyBound (h*p^3)+1) (max (ramifiedFrequencyBound h+1) (ramifiedFrequencyBound (h*p)+1)) rw [principalArithmeticResidue_eq_sum (h*p^3) (mul_ne_zero hh (pow_ne_zero _ hp.ne_zero)) N (le_max_left _ _), principalArithmeticResidue_eq_sum h hh N (le_trans (le_max_left _ _) (le_max_right _ _)), principalArithmeticResidue_eq_sum (h*p) (mul_ne_zero hh hp.ne_zero) N (le_trans (le_max_right _ _) (le_max_right _ _))] simp_rw [principalResidueTerm_prime_recurrence p hp hprimary h hph, Finset.sum_sub_distrib,←Finset.mul_sum] ring ) theorem sourceArithmeticResidue_prime_recurrence (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:¬p∣h) : sourceArithmeticResidue (h*p^3)= (1+(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹)*sourceArithmeticResidue h- (Ideal.absNorm (Ideal.span {p}):ℂ)^(-(4/3:ℂ))*primeCubicGauss p hp hprimary 1 (9*h)* sourceArithmeticResidue (h*p) := by have hm:ShortDraftTrace.breveE (cuspFrequency (h*p^3))= ShortDraftTrace.breveE (cuspFrequency h):=by rw [show h*p^3=((h*p)*p)*p by ring] rw [sourceRayPhase_mul_primary _ p hprimary,sourceRayPhase_mul_primary _ p hprimary, sourceRayPhase_mul_primary _ p hprimary] have hp9:¬p∣9*h:=by have hh:=ramified_prime_frequency_not_dvd h p hp hprimary hph (1:(_root_.OAI.ActualEisensteinCubic.O)ˣ) 0 simpa only [Units.val_one,pow_zero,one_mul,mul_one,mul_comm 9 h] using hh simp only [sourceArithmeticResidue,hm,sourceRayPhase_mul_primary h p hprimary] split_ifs with hh · rw [principalArithmeticResidue_prime_recurrence p hp hprimary h hph, show 9*(h*p^3)=(9*h)*p^3 by ring, unramifiedGaussResidue_prime_recurrence p hp hprimary (9*h) hp9, show 9*(h*p)=(9*h)*p by ring] ring · ring end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.PrimeGaussFactors namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma unramifiedCubicGaussSeries_prime_two_power (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (s:ℂ) (hs:21+(Ideal.absNorm (Ideal.span {p}):ℂ)^3* ((Ideal.absNorm (Ideal.span {p}):ℂ)^(-s))^3 have hA (s:ℂ):AnalyticAt ℂ A s:=analyticAt_const.add (analyticAt_const.mul ((gaussPrimeWeight_analytic p hp s).pow 3)) have he:=unramifiedGaussResidue_of_initial_relation (h*p^5) (h*p^2) 0 A (fun _=>0) (fun s _=>hA s) (fun _ _=>analyticAt_const) (hA _).continuousAt continuousAt_const (fun s hs _=>by simpa only [A,zero_mul,add_zero] using unramifiedCubicGaussSeries_square_cube p hp hprimary s (by linarith) h hph) dsimp only [A] at he rw [gaussPrimeWeight_center p hp] at he simpa only [zero_mul,add_zero] using he lemma principalResidueTerm_square_cube (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:¬p∣h) (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (n:ℕ) : principalResidueTerm (h*p^5) u n= (1+(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹)*principalResidueTerm (h*p^2) u n := by let c:=u.val*lambda^(n+2) have hA:=arithmeticResidueSum_frequency_cube (h*p^2) c p (ramifiedElement_ne_zero u (n+2)) (ramifiedElement_level u (n+2) (by omega)) hprimary (ramified_primary_coprime u (n+2) p hprimary).of_mul_left_right have hfreq:¬p∣h*(9*c):=ramified_prime_frequency_not_dvd h p hp hprimary hph u (n+2) rw [show (h*p^2)*p^3=h*p^5 by ring] at hA change _*arithmeticResidueSum (h*p^5) c*unramifiedGaussResidue ((h*p^5)*(9*c))=_ rw [hA,show (h*p^5)*(9*c)=(h*(9*c))*p^5 by ring, unramifiedGaussResidue_square_cube p hp hprimary (h*(9*c)) hfreq] change _=(1+(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹)* (((3^(n+2):ℕ):ℂ)^(-(4/3:ℂ))*arithmeticResidueSum (h*p^2) c* unramifiedGaussResidue ((h*p^2)*(9*c))) rw [show (h*p^2)*(9*c)=(h*(9*c))*p^2 by ring] ring lemma principalArithmeticResidue_square_cube (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:¬p∣h) : principalArithmeticResidue (h*p^5)= (1+(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹)*principalArithmeticResidue (h*p^2) := by have hh:h≠0:=fun he=>hph (he▸dvd_zero p) let N:=max (ramifiedFrequencyBound (h*p^5)+1) (ramifiedFrequencyBound (h*p^2)+1) rw [principalArithmeticResidue_eq_sum (h*p^5) (mul_ne_zero hh (pow_ne_zero _ hp.ne_zero)) N (le_max_left _ _), principalArithmeticResidue_eq_sum (h*p^2) (mul_ne_zero hh (pow_ne_zero _ hp.ne_zero)) N (le_max_right _ _)] simp_rw [principalResidueTerm_square_cube p hp hprimary h hph,←Finset.mul_sum] ring theorem sourceArithmeticResidue_square_cube (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:¬p∣h) : sourceArithmeticResidue (h*p^5)= (1+(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹)*sourceArithmeticResidue (h*p^2) := by have hm:ShortDraftTrace.breveE (cuspFrequency (h*p^5))= ShortDraftTrace.breveE (cuspFrequency (h*p^2)):=by rw [show h*p^5=(((h*p^2)*p)*p)*p by ring] rw [sourceRayPhase_mul_primary _ p hprimary,sourceRayPhase_mul_primary _ p hprimary, sourceRayPhase_mul_primary _ p hprimary] have hp9:¬p∣9*h:=by have hh:=ramified_prime_frequency_not_dvd h p hp hprimary hph (1:(_root_.OAI.ActualEisensteinCubic.O)ˣ) 0 simpa only [Units.val_one,pow_zero,one_mul,mul_one,mul_comm 9 h] using hh simp only [sourceArithmeticResidue,hm] split_ifs · rw [principalArithmeticResidue_square_cube p hp hprimary h hph, show 9*(h*p^5)=(9*h)*p^5 by ring, unramifiedGaussResidue_square_cube p hp hprimary (9*h) hp9, show 9*(h*p^2)=(9*h)*p^2 by ring] ring · ring end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma sourceArithmeticResidue_prime_pow_mod (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hh:h≠0) (n:ℕ) : sourceArithmeticResidue (h*p^n)=sourceArithmeticResidue (h*p^(n%3)) := by induction n using Nat.strong_induction_on with | h n ih=> by_cases hn:n<3 · rw [Nat.mod_eq_of_lt hn] · have hn3:3≤n:=by omega have he:h*p^n=(h*p^(n-3))*p^3:=by rw [mul_assoc,←pow_add,Nat.sub_add_cancel hn3] rw [he,sourceArithmeticResidue_prime_cube p hp hprimary _ (mul_ne_zero hh (pow_ne_zero _ hp.ne_zero)), ih (n-3) (by omega)] have hm:(n-3)%3=n%3:=by omega rw [hm] theorem sourceArithmeticResidue_prime_square (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:¬p∣h) : sourceArithmeticResidue (h*p^2)=0 := by have hh:h≠0:=fun he=>hph (he▸dvd_zero p) have he:=sourceArithmeticResidue_square_cube p hp hprimary h hph rw [show h*p^5=(h*p^2)*p^3 by ring, sourceArithmeticResidue_prime_cube p hp hprimary _ (mul_ne_zero hh (pow_ne_zero _ hp.ne_zero))] at he have hq:(Ideal.absNorm (Ideal.span {p}):ℂ)≠0:=Nat.cast_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (Ideal.span_singleton_eq_bot.not.mpr hp.ne_zero)) have hz:(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹*sourceArithmeticResidue (h*p^2)=0:=by linear_combination -he exact (mul_eq_zero.mp hz).resolve_left (inv_ne_zero hq) theorem sourceArithmeticResidue_prime_factor (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:¬p∣h) : sourceArithmeticResidue (h*p)= (Ideal.absNorm (Ideal.span {p}):ℂ)^(-(2/3:ℂ))* primeCubicGauss p hp hprimary 2 (9*h)*sourceArithmeticResidue h := by have hh:h≠0:=fun he=>hph (he▸dvd_zero p) have hrec:=sourceArithmeticResidue_prime_recurrence p hp hprimary h hph rw [sourceArithmeticResidue_prime_cube p hp hprimary h hh] at hrec have hrel:(Ideal.absNorm (Ideal.span {p}):ℂ)^(-(4/3:ℂ))* primeCubicGauss p hp hprimary 1 (9*h)*sourceArithmeticResidue (h*p)= (Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹*sourceArithmeticResidue h:=by linear_combination hrec have hp9:¬p∣9*h:=by have ht:=ramified_prime_frequency_not_dvd h p hp hprimary hph (1:(_root_.OAI.ActualEisensteinCubic.O)ˣ) 0 simpa only [Units.val_one,pow_zero,one_mul,mul_one,mul_comm 9 h] using ht have hG:=primeCubicGauss_one_mul_two p hp hprimary (9*h) hp9 let q:ℂ:=(Ideal.absNorm (Ideal.span {p}):ℂ) have hq:q≠0:=Nat.cast_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (Ideal.span_singleton_eq_bot.not.mpr hp.ne_zero)) have hpower:q^(-(2/3:ℂ))*q^(-(4/3:ℂ))*q^2=1:=by rw [←Complex.cpow_add _ _ hq,←Complex.cpow_natCast q 2, ←Complex.cpow_add _ _ hq] norm_num calc sourceArithmeticResidue (h*p)= (q^(-(2/3:ℂ))*q^(-(4/3:ℂ))*q^2)*sourceArithmeticResidue (h*p):=by rw [hpower,one_mul] _=q^(-(2/3:ℂ))*q*primeCubicGauss p hp hprimary 2 (9*h)* (q^(-(4/3:ℂ))*primeCubicGauss p hp hprimary 1 (9*h)*sourceArithmeticResidue (h*p)):=by calc _=q^(-(2/3:ℂ))*q^(-(4/3:ℂ))*q* (primeCubicGauss p hp hprimary 1 (9*h)*primeCubicGauss p hp hprimary 2 (9*h))* sourceArithmeticResidue (h*p):=by rw [hG];ring _=_:=by ring _=q^(-(2/3:ℂ))*q*primeCubicGauss p hp hprimary 2 (9*h)*(q⁻¹*sourceArithmeticResidue h):=by rw [hrel] _=_:=by change q^(-(2/3:ℂ))*q*primeCubicGauss p hp hprimary 2 (9*h)*(q⁻¹*sourceArithmeticResidue h)= q^(-(2/3:ℂ))*primeCubicGauss p hp hprimary 2 (9*h)*sourceArithmeticResidue h field_simp [hq] theorem sourceArithmeticResidue_prime_power_table (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:¬p∣h) (n:ℕ) : sourceArithmeticResidue (h*p^n)= if n%3=0 then sourceArithmeticResidue h else if n%3=1 then (Ideal.absNorm (Ideal.span {p}):ℂ)^(-(2/3:ℂ))* primeCubicGauss p hp hprimary 2 (9*h)*sourceArithmeticResidue h else 0 := by have hh:h≠0:=fun he=>hph (he▸dvd_zero p) rw [sourceArithmeticResidue_prime_pow_mod p hp hprimary h hh n] split_ifs with h0 h1 · simp only [h0,pow_zero,mul_one] · simp only [h1,pow_one] exact sourceArithmeticResidue_prime_factor p hp hprimary h hph · have hn:n%3=2:=by omega rw [hn,sourceArithmeticResidue_prime_square p hp hprimary h hph] end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma primeCubicMulChar_inverse (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) : (primeCubicMulChar p hp hprimary)⁻¹=primeCubicMulChar p hp hprimary^2 := by apply inv_eq_of_mul_eq_one_right simpa only [←pow_succ'] using primeCubicMulChar_cube p hp hprimary lemma primeCubicGauss_two_eq_star (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) : primeCubicGauss p hp hprimary 2 h=star (primeCubicGauss p hp hprimary 1 h) := by letI := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let:(Ideal.span {p}:Ideal (_root_.OAI.ActualEisensteinCubic.O)).IsMaximal:=PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible let:Field ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p}):=Ideal.Quotient.field _ let:Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p}):=Fintype.ofFinite _ rw [primeCubicGauss_eq_gaussSum,primeCubicGauss_eq_gaussSum,pow_one,star_gaussSum_eq, primeCubicMulChar_inverse] have he:=mul_gaussSum_inv_eq_gaussSum (primeCubicMulChar p hp hprimary^2) ((quotientTrace p hp.ne_zero).mulShift (Ideal.Quotient.mk _ h)) have hm:(primeCubicMulChar p hp hprimary^2) (-1 : (_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p})=1:=by rw [MulChar.pow_apply' _ (by decide : (2:ℕ)≠0),←map_pow] norm_num rw [hm,one_mul] at he exact he.symm lemma primeCubicGauss_two_twist (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:¬p∣h) : primeCubicGauss p hp hprimary 2 h=eisEmbedding (symbol h p)*primeCubicGauss p hp hprimary 2 1 := by letI := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO have hcop:IsCoprime p h:=hp.coprime_iff_not_dvd.mpr hph have he:=cubicUnitGaussSum_frequency_twist (1:(_root_.OAI.ActualEisensteinCubic.O)) p h hp.ne_zero hprimary hcop simp only [one_mul,←primeCubicGauss_one_eq p hp hprimary] at he have hs:(eisEmbedding (symbol h p))^3=1:=by rw [←map_pow,symbol_cube_of_isCoprime h p hprimary hcop.symm,map_one] have hstar:star (eisEmbedding (symbol h p))*eisEmbedding (symbol h p)=1:=by have hn:‖eisEmbedding (symbol h p)‖=1:=by have hn:=congrArg norm hs simp only [norm_pow,norm_one] at hn exact (pow_left_inj₀ (norm_nonneg _) zero_le_one (by decide : (3:ℕ)≠0)).mp (by simpa using hn) rw [mul_comm] simpa only [Complex.star_def,Complex.normSq_eq_norm_sq,hn,one_pow,Complex.ofReal_one] using Complex.mul_conj (eisEmbedding (symbol h p)) have hconj:=congrArg star he simp only [star_mul,←primeCubicGauss_two_eq_star] at hconj calc _=(star (eisEmbedding (symbol h p))*eisEmbedding (symbol h p))*primeCubicGauss p hp hprimary 2 h:=by rw [hstar,one_mul] _=eisEmbedding (symbol h p)*(star (eisEmbedding (symbol h p))*primeCubicGauss p hp hprimary 2 h):=by ring _=_:=by rw [mul_comm (star (eisEmbedding (symbol h p))),hconj] lemma cubicBesselNormalizer_mul (h p:(_root_.OAI.ActualEisensteinCubic.O)) : cubicBesselNormalizer (h*p)=(‖eisEmbedding p‖:ℂ)^(1/3:ℂ)*cubicBesselNormalizer h := by have hfreq:‖cuspFrequency (h*p)‖=‖cuspFrequency h‖*‖eisEmbedding p‖:=by rw [cuspFrequency_mul_right,norm_mul] have he:(2*Real.pi*‖cuspFrequency (h*p)‖:ℂ)= (‖eisEmbedding p‖:ℂ)*((2*Real.pi*‖cuspFrequency h‖:ℝ):ℂ):=by rw [hfreq];push_cast;ring unfold cubicBesselNormalizer rw [he,Complex.mul_cpow_ofReal_nonneg (norm_nonneg _) (by positivity)] push_cast ring lemma prime_normalizer_powers (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:p≠0) : (‖eisEmbedding p‖:ℂ)^(1/3:ℂ)*(Ideal.absNorm (Ideal.span {p}):ℂ)^(-(2/3:ℂ))= (‖eisEmbedding p‖:ℂ)⁻¹ := by have hr:(‖eisEmbedding p‖:ℂ)≠0:=Complex.ofReal_ne_zero.mpr (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hp)) rw [←Complex.ofReal_natCast,←eisEmbedding_norm_sq_eq_absNorm_span,pow_two, Complex.ofReal_mul,Complex.mul_cpow_ofReal_nonneg (norm_nonneg _) (norm_nonneg _), ←mul_assoc,←Complex.cpow_add _ _ hr,←Complex.cpow_add _ _ hr] convert Complex.cpow_neg_one (‖eisEmbedding p‖:ℂ) using 1 ; congr 1 ; norm_num theorem sourceResidualFourierCoefficient_prime_factor (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:¬p∣h) : sourceResidualFourierCoefficient (h*p)= (primeCubicGauss p hp hprimary 2 (9*h)/(‖eisEmbedding p‖:ℂ))*sourceResidualFourierCoefficient h := by rw [sourceResidualFourierCoefficient,cubicBesselNormalizer_mul, sourceArithmeticResidue_prime_factor p hp hprimary h hph,sourceResidualFourierCoefficient] calc _=((‖eisEmbedding p‖:ℂ)^(1/3:ℂ)*(Ideal.absNorm (Ideal.span {p}):ℂ)^(-(2/3:ℂ)))* primeCubicGauss p hp hprimary 2 (9*h)*(cubicBesselNormalizer h*sourceArithmeticResidue h):=by ring _=_:=by rw [prime_normalizer_powers p hp.ne_zero];ring end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal def normalizedCubicUnitGauss (n:(_root_.OAI.ActualEisensteinCubic.O)) : ℂ := cubicUnitGaussSum 1 n/(‖eisEmbedding n‖:ℂ) lemma normalizedCubicUnitGauss_one : normalizedCubicUnitGauss 1=1 := by simp [normalizedCubicUnitGauss,cubicUnitGaussSum_one] lemma cubicSymbol_star_mul (a b:(_root_.OAI.ActualEisensteinCubic.O)) (hb:lambda^2∣b-1) (hab:IsCoprime a b) : star (eisEmbedding (symbol a b))*eisEmbedding (symbol a b)=1 := by have hc:(eisEmbedding (symbol a b))^3=1:=by rw [←map_pow,symbol_cube_of_isCoprime a b hb hab,map_one] have hn:‖eisEmbedding (symbol a b)‖=1:=by apply (pow_left_inj₀ (norm_nonneg _) zero_le_one (by decide : (3:ℕ)≠0)).mp simpa only [norm_pow,norm_one,one_pow] using congrArg norm hc rw [mul_comm] simpa only [Complex.star_def,Complex.normSq_eq_norm_sq,hn,one_pow,Complex.ofReal_one] using Complex.mul_conj (eisEmbedding (symbol a b)) lemma normalizedCubicUnitGauss_coprime_product (a b:(_root_.OAI.ActualEisensteinCubic.O)) (ha:a≠0) (hb:b≠0) (hap:lambda^2∣a-1) (hbp:lambda^2∣b-1) (hab:IsCoprime a b) : star (normalizedCubicUnitGauss (a*b))= eisEmbedding (symbol a b)*star (normalizedCubicUnitGauss a)*star (normalizedCubicUnitGauss b) := by have hG:=cubicUnitGaussSum_coprime_product 1 a b ha hb hap hbp hab simp only [one_mul] at hG have ht:=cubicUnitGaussSum_frequency_twist 1 b a hb hbp hab.symm simp only [one_mul] at ht have hN:eisEmbedding (symbol a b)*normalizedCubicUnitGauss (a*b)= normalizedCubicUnitGauss a*normalizedCubicUnitGauss b:=by unfold normalizedCubicUnitGauss rw [hG,map_mul,norm_mul,Complex.ofReal_mul] calc _=cubicUnitGaussSum 1 a*(eisEmbedding (symbol a b)*cubicUnitGaussSum a b)/ ((‖eisEmbedding a‖:ℂ)*(‖eisEmbedding b‖:ℂ)):=by ring _=_:=by rw [ht];ring have hs:=congrArg star hN simp only [star_mul] at hs have hc:=cubicSymbol_star_mul a b hbp hab calc _=(star (eisEmbedding (symbol a b))*eisEmbedding (symbol a b))* star (normalizedCubicUnitGauss (a*b)):=by rw [hc,one_mul] _=eisEmbedding (symbol a b)*(star (normalizedCubicUnitGauss (a*b))* star (eisEmbedding (symbol a b))):=by ring _=_:=by rw [hs];ring lemma sourceResidualFourierCoefficient_prime_normalized (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:¬p∣h) : sourceResidualFourierCoefficient (h*p)= eisEmbedding (symbol (9*h) p)*star (normalizedCubicUnitGauss p)*sourceResidualFourierCoefficient h := by have hp9:¬p∣9*h:=by have ht:=ramified_prime_frequency_not_dvd h p hp hprimary hph (1:(_root_.OAI.ActualEisensteinCubic.O)ˣ) 0 simpa only [Units.val_one,pow_zero,one_mul,mul_one,mul_comm 9 h] using ht rw [sourceResidualFourierCoefficient_prime_factor p hp hprimary h hph, primeCubicGauss_two_twist p hp hprimary (9*h) hp9,primeCubicGauss_two_eq_star, normalizedCubicUnitGauss,←primeCubicGauss_one_eq p hp hprimary, star_div₀,Complex.star_def,Complex.conj_ofReal] ring lemma primary_finset_product {ι:Type*} (s:Finset ι) (p:ι→(_root_.OAI.ActualEisensteinCubic.O)) (hp:∀i∈s,lambda^2∣p i-1) : lambda^2∣(∏i∈s,p i)-1 := by classical induction s using Finset.induction_on with | empty=>simp | @insert i s hi ih=> rw [Finset.prod_insert hi] exact primary_mul _ _ (hp i (Finset.mem_insert_self _ _)) (ih (fun j hj=>hp j (Finset.mem_insert_of_mem hj))) theorem sourceResidualFourierCoefficient_prime_product {ι:Type*} (s:Finset ι) (p:ι→(_root_.OAI.ActualEisensteinCubic.O)) (hp:∀i∈s,Prime (p i)) (hprimary:∀i∈s,lambda^2∣p i-1) (hpair:∀i∈s,∀j∈s,i≠j→IsCoprime (p i) (p j)) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hph:∀i∈s,¬p i∣h) : sourceResidualFourierCoefficient (h*(∏i∈s,p i))= eisEmbedding (symbol (9*h) (∏i∈s,p i))* star (normalizedCubicUnitGauss (∏i∈s,p i))*sourceResidualFourierCoefficient h := by classical induction s using Finset.induction_on with | empty=>simp [normalizedCubicUnitGauss_one, symbol_one] | @insert i s hi ih=> have hpi:=hp i (Finset.mem_insert_self _ _) have hpri:=hprimary i (Finset.mem_insert_self _ _) have hps:∀j∈s,Prime (p j):=fun j hj=>hp j (Finset.mem_insert_of_mem hj) have hprs:∀j∈s,lambda^2∣p j-1:=fun j hj=>hprimary j (Finset.mem_insert_of_mem hj) have hcpi:IsCoprime (p i) (∏j∈s,p j):=IsCoprime.prod_right (fun j hj=> hpair i (Finset.mem_insert_self _ _) j (Finset.mem_insert_of_mem hj) (by intro he;subst j;exact hi hj)) have hbs:(∏j∈s,p j)≠0:=Finset.prod_ne_zero_iff.mpr (fun j hj=>(hps j hj).ne_zero) have hpb:¬p i∣h*(∏j∈s,p j):=by intro hd rcases hpi.dvd_mul.mp hd with hd|hd · exact hph i (Finset.mem_insert_self _ _) hd · exact hpi.not_isUnit (hcpi.isUnit_of_dvd hd) have hih:=ih hps hprs (fun j hj k hk hjk=>hpair j (Finset.mem_insert_of_mem hj) k (Finset.mem_insert_of_mem hk) hjk) (fun j hj=>hph j (Finset.mem_insert_of_mem hj)) rw [Finset.prod_insert hi,show h*(p i*(∏j∈s,p j))=(h*(∏j∈s,p j))*p i by ring, sourceResidualFourierCoefficient_prime_normalized (p i) hpi hpri _ hpb,hih] rw [mul_comm (p i) (∏j∈s,p j), normalizedCubicUnitGauss_coprime_product _ _ hbs hpi.ne_zero (primary_finset_product s p hprs) hpri hcpi.symm, symbol_mul_denominator,map_mul] rw [show (9:(_root_.OAI.ActualEisensteinCubic.O))*(h*(∏j∈s,p j))=(9*h)*(∏j∈s,p j) by ring, symbol_mul_numerator _ _ (p i) hpri,map_mul] ring lemma symbol_nine_eq_paperLambda (n:(_root_.OAI.ActualEisensteinCubic.O)) (hn:lambda^2∣n-1) : symbol 9 n=symbol ramifiedTraceLambda n := by have he:(9:(_root_.OAI.ActualEisensteinCubic.O))=ramifiedTraceLambda^4:=by rw [show (4:ℕ)=2*2 from rfl,pow_mul,ramifiedTraceLambda_square] norm_num have hcop:IsCoprime ramifiedTraceLambda n:= ramified_character_coprime 0 1 _ n (Or.inl (by simp)) hn rw [he,symbol_pow_numerator _ _ hn,show (4:ℕ)=3+1 from rfl,pow_add, symbol_cube_of_isCoprime _ _ hn hcop,pow_one,one_mul] theorem sourceResidualFourierCoefficient_primary_product {ι:Type*} (s:Finset ι) (p:ι→(_root_.OAI.ActualEisensteinCubic.O)) (hp:∀i∈s,Prime (p i)) (hprimary:∀i∈s,lambda^2∣p i-1) (hpair:∀i∈s,∀j∈s,i≠j→IsCoprime (p i) (p j)) : star (sourceResidualFourierCoefficient (∏i∈s,p i))= star (sourceResidualFourierCoefficient 1)* star (eisEmbedding (symbol ramifiedTraceLambda (∏i∈s,p i)))* normalizedCubicUnitGauss (∏i∈s,p i) := by have he:=sourceResidualFourierCoefficient_prime_product s p hp hprimary hpair 1 (fun i hi=>fun hd=>(hp i hi).not_isUnit (isUnit_of_dvd_one hd)) simp only [one_mul,mul_one] at he rw [symbol_nine_eq_paperLambda _ (primary_finset_product s p hprimary)] at he rw [he,star_mul,star_mul,star_star] ring end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal theorem sourceArithmeticResidue_primary_cube (b:(_root_.OAI.ActualEisensteinCubic.O)) (hb:b≠0) (hbprimary:lambda^2∣b-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hh:h≠0) : sourceArithmeticResidue (h*b^3)=sourceArithmeticResidue h := by obtain ⟨s,hs,hpr⟩:=exists_primary_prime_factorization b hb hbprimary rw [←hs] clear hs hb hbprimary b induction s using Multiset.induction_on generalizing h with | empty=>simp | @cons p s ih=> have hp:=hpr p (Multiset.mem_cons_self _ _) have hs:∀q∈s,Prime q∧lambda^2∣q-1:=fun q hq=>hpr q (Multiset.mem_cons_of_mem hq) have hs0:s.prod≠0:=by intro hz exact (hs 0 (Multiset.prod_eq_zero_iff.mp hz)).1.ne_zero rfl rw [Multiset.prod_cons,show h*(p*s.prod)^3=(h*s.prod^3)*p^3 by ring, sourceArithmeticResidue_prime_cube p hp.1 hp.2 _ (mul_ne_zero hh (pow_ne_zero _ hs0))] exact ih h hh hs theorem sourceResidualFourierCoefficient_primary_cube (b:(_root_.OAI.ActualEisensteinCubic.O)) (hb:b≠0) (hbprimary:lambda^2∣b-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hh:h≠0) : sourceResidualFourierCoefficient (h*b^3)= (‖eisEmbedding b‖:ℂ)*sourceResidualFourierCoefficient h := by rw [sourceResidualFourierCoefficient,cubicBesselNormalizer_mul_cube h b hb, sourceArithmeticResidue_primary_cube b hb hbprimary h hh,sourceResidualFourierCoefficient] ring end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss lemma cubicSymbol_prime_zero (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (x:(_root_.OAI.ActualEisensteinCubic.O)) (hpx:p∣x) : symbol x p=0 := by letI := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let:(Ideal.span {p}:Ideal (_root_.OAI.ActualEisensteinCubic.O)).IsMaximal:=PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible have hg:lambda∉(Ideal.span {p}:Ideal (_root_.OAI.ActualEisensteinCubic.O)):= primary_maximal_divisor_good p hprimary _ (Ideal.subset_span (by simp)) rw [symbol_prime p hp hprimary,primeValue_eq _ hg, Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr hpx),MulChar.map_zero] lemma cubicSymbol_zero_of_not_coprime (n:(_root_.OAI.ActualEisensteinCubic.O)) (hn:n≠0) (hprimary:lambda^2∣n-1) (x:(_root_.OAI.ActualEisensteinCubic.O)) (hnot:¬IsCoprime n x) : symbol x n=0 := by letI := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO obtain ⟨s,hs,hp⟩:=exists_primary_prime_factorization n hn hprimary rw [←hs] at hnot ⊢ clear hs hn hprimary n induction s using Multiset.induction_on with | empty=>exact False.elim (hnot (by simpa using (isCoprime_one_left : IsCoprime (1:(_root_.OAI.ActualEisensteinCubic.O)) x))) | @cons p s ih=> have hprime:=hp p (Multiset.mem_cons_self _ _) have hrest:∀q∈s,Prime q∧lambda^2∣q-1:=fun q hq=>hp q (Multiset.mem_cons_of_mem hq) rw [Multiset.prod_cons,symbol_mul_denominator] by_cases hc:IsCoprime p x · have hnc:¬IsCoprime s.prod x:=fun h=>hnot (by simpa using hc.mul_left h) rw [ih hnc hrest,mul_zero] · rw [cubicSymbol_prime_zero p hprime.1 hprime.2 x (hprime.1.irreducible.dvd_iff_not_isCoprime.mpr hc),zero_mul] lemma cubicRow_eq_idealSymbol (I:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:primaryGenerator I≠0) (hsq:Squarefree I) (a:(_root_.OAI.ActualEisensteinCubic.O)) : cubicRow I hI (Ideal.Quotient.mk I a)=eisEmbedding (idealSymbol I a) := by rw [cubicRow_mk] simp_rw [canonicalSextic_pow_two,MulChar.ringHomComp_apply,←primeValue_eq] change (∏P:primeSupport I,eisEmbedding (primeValue P.val a))=eisEmbedding (idealSymbol I a) rw [←Finset.prod_subtype (primeSupport I) (fun _=>Iff.rfl) (fun P=>eisEmbedding (primeValue P a)),←map_prod] have hI0:=primaryGenerator_ne_zero_ideal I hI have hnodup: (UniqueFactorizationMonoid.normalizedFactors I).Nodup:= (UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors hI0).mp hsq congr 1 rw [idealSymbol,if_neg hI0] change (((primeSupport I).val.map (fun P=>primeValue P a)).prod)=_ have hv:(primeSupport I).val=UniqueFactorizationMonoid.normalizedFactors I:=by simpa only [primeSupport, Multiset.toFinset_val] using hnodup.dedup rw [hv] lemma cubicUnitGaussSum_full (n:(_root_.OAI.ActualEisensteinCubic.O)) (hn:n≠0) (hprimary:lambda^2∣n-1) (h:(_root_.OAI.ActualEisensteinCubic.O)) : cubicUnitGaussSum h n= ∑'x:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {n},eisEmbedding (symbol (GaussianShiftedPartition.representative n x) n)* quotientTrace n hn (Ideal.Quotient.mk _ h*x) := by let f:((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {n})→ℂ:=fun x=> eisEmbedding (symbol (GaussianShiftedPartition.representative n x) n)* quotientTrace n hn (Ideal.Quotient.mk _ h*x) have hsup:Function.support f⊆{x|IsUnit x}:=by intro x hx by_contra hnot change ¬IsUnit x at hnot have hcop:¬IsCoprime n (GaussianShiftedPartition.representative n x):=by intro hc apply hnot have hh:=(isUnit_quotient_span_iff n (GaussianShiftedPartition.representative n x)).mpr hc simpa only [GaussianShiftedPartition.representative_spec] using hh exact hx (by simp only [f,cubicSymbol_zero_of_not_coprime n hn hprimary _ hcop,map_zero,zero_mul]) change cubicUnitGaussSum h n=∑'x,f x rw [←tsum_subtype_eq_of_support_subset hsup] unfold cubicUnitGaussSum apply tsum_congr intro x dsimp only [f] rw [←GaussianShiftedPartition.representative_spec n x.val,quotientTrace_mk_product] simp only [GaussianShiftedPartition.representative_spec] theorem normalizedCubicUnitGauss_eq_gaussTwo (I:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:primaryGenerator I≠0) (hsq:Squarefree I) : normalizedCubicUnitGauss (primaryGenerator I)=gaussTwo I hI := by let n:=primaryGenerator I let:Finite ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {n}):=finite_quotient_span hI let:Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {n}):=Fintype.ofFinite _ let e:=Ideal.quotEquivOfEq (primaryGenerator_spec I hI).1 rw [normalizedCubicUnitGauss,cubicUnitGaussSum_full _ hI (primaryGenerator_spec I hI).2 1, tsum_fintype] change (∑x:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {n},eisEmbedding (symbol (GaussianShiftedPartition.representative n x) n)* quotientTrace n hI (Ideal.Quotient.mk _ 1*x))/(‖eisEmbedding n‖:ℂ)= (∑x:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {n},cubicRow I hI (e x)*quotientTrace n hI x)/(‖eisEmbedding n‖:ℂ) congr 1 apply Finset.sum_congr rfl intro x hx obtain ⟨a,rfl⟩:=Ideal.Quotient.mk_surjective x rw [Ideal.quotEquivOfEq_mk,cubicRow_eq_idealSymbol I hI hsq] have hc:n∣GaussianShiftedPartition.representative n (Ideal.Quotient.mk (Ideal.span {n}) a)-a:= gaussRep_mk_congr n a have hs:symbol a n=idealSymbol I a:=by unfold symbol rw [(primaryGenerator_spec I hI).1] rw [symbol_congr hc,hs,map_one,one_mul] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.SquarefreeCoefficients namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss lemma primaryGenerator_squarefree_support (I:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:primaryGenerator I≠0) (hsq:Squarefree I) : primaryGenerator I=∏P∈primeSupport I,primaryPrime P := by have hI0:=primaryGenerator_ne_zero_ideal I hI have hn: (UniqueFactorizationMonoid.normalizedFactors I).Nodup:= (UniqueFactorizationMonoid.squarefree_iff_nodup_normalizedFactors hI0).mp hsq have hv:(primeSupport I).val=UniqueFactorizationMonoid.normalizedFactors I:=by simpa only [primeSupport, Multiset.toFinset_val] using hn.dedup unfold primaryGenerator rw [if_neg hI0] change _=((primeSupport I).val.map primaryPrime).prod rw [hv] lemma primaryPrime_isPrime_of_mem (I P:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:primaryGenerator I≠0) (hP:P∈primeSupport I) : Prime (primaryPrime P) := by have hp0:=primaryPrime_factor_ne_zero I P hI (Multiset.mem_toFinset.mp hP) have hs:=primaryPrime_spec P hp0 let:P.IsMaximal:=hs.1 apply (Ideal.span_singleton_prime hp0).mp rw [hs.2.2.1] infer_instance lemma primaryPrime_support_coprime (I:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:primaryGenerator I≠0) (P:Ideal _root_.OAI.ActualEisensteinCubic.O) (hP:P∈primeSupport I) (Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (hQ:Q∈primeSupport I) (hne:P≠Q) : IsCoprime (primaryPrime P) (primaryPrime Q) := by have hp:=primaryPrime_spec P (primaryPrime_factor_ne_zero I P hI (Multiset.mem_toFinset.mp hP)) have hq:=primaryPrime_spec Q (primaryPrime_factor_ne_zero I Q hI (Multiset.mem_toFinset.mp hQ)) let:P.IsMaximal:=hp.1 let:Q.IsMaximal:=hq.1 apply (Ideal.isCoprime_span_singleton_iff _ _).mp rw [hp.2.2.1,hq.2.2.1] exact Ideal.isCoprime_of_isMaximal hne def infinityCoefficientScalar : ℂ := star (sourceResidualFourierCoefficient 1) theorem infinityCoefficient_squarefree (I:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:primaryGenerator I≠0) (hsq:Squarefree I) : star (sourceResidualFourierCoefficient (primaryGenerator I))= infinityCoefficientScalar* star (eisEmbedding (symbol ramifiedTraceLambda (primaryGenerator I)))*gaussTwo I hI := by have hpr:∀P∈primeSupport I,lambda^2∣primaryPrime P-1:=by intro P hP exact (primaryPrime_spec P (primaryPrime_factor_ne_zero I P hI (Multiset.mem_toFinset.mp hP))).2.2.2 have he:=sourceResidualFourierCoefficient_primary_product (primeSupport I) primaryPrime (fun P hP=>primaryPrime_isPrime_of_mem I P hI hP) hpr (primaryPrime_support_coprime I hI) rw [←primaryGenerator_squarefree_support I hI hsq,normalizedCubicUnitGauss_eq_gaussTwo I hI hsq] at he exact he theorem infinityCoefficient_squarefree_cube (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:primaryGenerator I≠0) (hJ:primaryGenerator J≠0) (hsq:Squarefree I) : star (sourceResidualFourierCoefficient (primaryGenerator I*(primaryGenerator J)^3))= infinityCoefficientScalar*(‖eisEmbedding (primaryGenerator J)‖:ℂ)* star (eisEmbedding (symbol ramifiedTraceLambda (primaryGenerator I)))*gaussTwo I hI := by rw [sourceResidualFourierCoefficient_primary_cube _ hJ (primaryGenerator_spec J hJ).2 _ hI, star_mul,infinityCoefficient_squarefree I hI hsq] simp only [Complex.star_def,Complex.conj_ofReal] ring end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss UniqueFactorizationMonoid theorem sourceArithmeticResidue_valuation_ne_two (I P:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:primaryGenerator I≠0) (hP:P∈normalizedFactors I) (hS:sourceArithmeticResidue (primaryGenerator I)≠0) : (normalizedFactors I).count P%3≠2 := by have hI0:=primaryGenerator_ne_zero_ideal I hI have hprime:=prime_of_normalized_factor P hP let p:=primaryPrime P have hp0:p≠0:=primaryPrime_factor_ne_zero I P hI hP have hps:=primaryPrime_spec P hp0 have hp:Prime p:=primaryPrime_isPrime_of_mem I P hI (Multiset.mem_toFinset.mpr hP) obtain ⟨J,hJ,hnot⟩:=(FiniteMultiplicity.of_prime_left hprime hI0).exists_eq_pow_mul_and_not_dvd have hgen:primaryGenerator I=p^(multiplicity P I)*primaryGenerator J:=by calc _=primaryGenerator (P^(multiplicity P I)*J):=congrArg primaryGenerator hJ _=p^(multiplicity P I)*primaryGenerator J:=by rw [primaryGenerator_mul,primaryGenerator_pow] have he:primaryGenerator P=p:=by rw [←hps.2.2.1,primaryGenerator_span p hp0 hps.2.2.2] rw [he] have hgJ:primaryGenerator J≠0:=by intro hz exact hI (by rw [hgen,hz,mul_zero]) have hpd:¬p∣primaryGenerator J:=by intro hd apply hnot rw [Ideal.dvd_iff_le,←hps.2.2.1,←(primaryGenerator_spec J hgJ).1, Ideal.span_singleton_le_span_singleton] exact hd have hcount:=multiplicity_eq_count_normalizedFactors hprime.irreducible hI0 rw [normalize_normalized_factor P hP] at hcount intro hc have hm:(multiplicity P I)%3=2:=by rwa [hcount] apply hS rw [hgen,mul_comm,sourceArithmeticResidue_prime_power_table p hp hps.2.2.2 _ hpd, hm] norm_num def thetaSquarefreePart (I:Ideal _root_.OAI.ActualEisensteinCubic.O) : Ideal _root_.OAI.ActualEisensteinCubic.O := ∏P∈(primeSupport I).filter (fun P=>(normalizedFactors I).count P%3=1),P def thetaCubePart (I:Ideal _root_.OAI.ActualEisensteinCubic.O) : Ideal _root_.OAI.ActualEisensteinCubic.O := ∏P∈primeSupport I,P^((normalizedFactors I).count P/3) lemma thetaSquarefreePart_squarefree (I:Ideal _root_.OAI.ActualEisensteinCubic.O) : Squarefree (thetaSquarefreePart I) := by apply IdealMobiusDivisorSum.squarefree_support_product exact Finset.filter_subset _ _ lemma thetaParts_mul_cube (I:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I≠0) (he:∀P∈normalizedFactors I,(normalizedFactors I).count P%3≠2) : thetaSquarefreePart I*thetaCubePart I ^3=I := by rw [thetaSquarefreePart,Finset.prod_filter,thetaCubePart,←Finset.prod_pow,←Finset.prod_mul_distrib] calc _=∏P∈primeSupport I,P^((normalizedFactors I).count P):=by apply Finset.prod_congr rfl intro P hP have hp:=he P (Multiset.mem_toFinset.mp hP) have hm:(normalizedFactors I).count P%3=0 ∨ (normalizedFactors I).count P%3=1:=by omega rcases hm with hm|hm · rw [if_neg (by omega),one_mul,←pow_mul] congr 1 omega · rw [if_pos hm,←pow_mul,←pow_succ'] congr 1 omega _=(normalizedFactors I).prod:=(Finset.prod_multiset_count (normalizedFactors I)).symm _=I:=Ideal.prod_normalizedFactors_eq_self hI theorem sourceArithmeticResidue_squarefree_cube_support (I:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:primaryGenerator I≠0) (hS:sourceArithmeticResidue (primaryGenerator I)≠0) : Squarefree (thetaSquarefreePart I) ∧ primaryGenerator (thetaSquarefreePart I)≠0 ∧ primaryGenerator (thetaCubePart I)≠0 ∧ thetaSquarefreePart I*thetaCubePart I ^3=I := by have he:=thetaParts_mul_cube I (primaryGenerator_ne_zero_ideal I hI) (fun P hP=>sourceArithmeticResidue_valuation_ne_two I P hI hP hS) have hgen:primaryGenerator I= primaryGenerator (thetaSquarefreePart I)*(primaryGenerator (thetaCubePart I))^3:=by calc _=primaryGenerator (thetaSquarefreePart I*thetaCubePart I ^3):=congrArg primaryGenerator he.symm _=_:=by rw [primaryGenerator_mul,primaryGenerator_pow] have hA:primaryGenerator (thetaSquarefreePart I)≠0:=by intro hz exact hI (by rw [hgen,hz,zero_mul]) have hB:primaryGenerator (thetaCubePart I)≠0:=by intro hz exact hI (by rw [hgen,hz,zero_pow (by decide : (3:ℕ)≠0),mul_zero]) exact ⟨thetaSquarefreePart_squarefree I,hA,hB,he⟩ theorem sourceFourier_squarefree_cube_support (I:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:primaryGenerator I≠0) (hS:sourceResidualFourierCoefficient (primaryGenerator I)≠0) : ∃A B:Ideal _root_.OAI.ActualEisensteinCubic.O,Squarefree A ∧ primaryGenerator A≠0 ∧ primaryGenerator B≠0 ∧ A*B^3=I := by have hs:sourceArithmeticResidue (primaryGenerator I)≠0:=by intro hz exact hS (by rw [sourceResidualFourierCoefficient,hz,mul_zero]) exact ⟨thetaSquarefreePart I,thetaCubePart I, sourceArithmeticResidue_squarefree_cube_support I hI hs⟩ theorem sourceFourier_primary_zero_of_base_zero (hC:infinityCoefficientScalar=0) (n:_root_.OAI.ActualEisensteinCubic.O) (hprimary:lambda^2∣n-1) : sourceResidualFourierCoefficient n=0 := by have hn:n≠0:=primary_ne_zero n hprimary let I:Ideal _root_.OAI.ActualEisensteinCubic.O:=Ideal.span {n} have hgen:primaryGenerator I=n:=primaryGenerator_span n hn hprimary have hI:primaryGenerator I≠0:=by rwa [hgen] by_contra hT have hTI:sourceResidualFourierCoefficient (primaryGenerator I)≠0:=by rwa [hgen] obtain ⟨A,B,hA,hAg,hBg,hAB⟩:=sourceFourier_squarefree_cube_support I hI hTI have harg:primaryGenerator A*(primaryGenerator B)^3=n:=by have he:=congrArg primaryGenerator hAB simpa only [primaryGenerator_mul,primaryGenerator_pow,hgen] using he have he:=infinityCoefficient_squarefree_cube A B hAg hBg hA rw [harg,hC,zero_mul,zero_mul,zero_mul] at he exact hT (star_eq_zero.mp he) end section open Filter open scoped BigOperators Classical Topology open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma unramifiedGaussResidue_eq_of_initial_eq (h k:_root_.OAI.ActualEisensteinCubic.O) (he:∀s:ℂ,41) (fun _=>0) (fun _ _=>analyticAt_const) (fun _ _=>analyticAt_const) continuousAt_const continuousAt_const (fun s hs hi=>by simpa using he s hs hi) simpa only [one_mul,zero_mul,add_zero] using hh theorem unramifiedGaussResidue_neg (h:_root_.OAI.ActualEisensteinCubic.O) : unramifiedGaussResidue (-h)=unramifiedGaussResidue h := unramifiedGaussResidue_eq_of_initial_eq _ _ (fun s _ _=>unramifiedCubicGaussSeries_neg s h) theorem unramifiedGaussResidue_lambda_pow (h:_root_.OAI.ActualEisensteinCubic.O) (n:ℕ) : unramifiedGaussResidue (h*lambda^n)= unramifiedGaussResidue (h*lambda^(n%3)) := unramifiedGaussResidue_eq_of_initial_eq _ _ (fun s _ _=>unramifiedCubicGaussSeries_lambda_pow s h n) theorem unramifiedGaussResidue_nine_family (h:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (n:ℕ) : ∃j k:Fin 3,unramifiedGaussResidue (h*(9*((u:_root_.OAI.ActualEisensteinCubic.O)*lambda^n)))= unramifiedGaussResidue (h*omega^j.val*lambda^k.val) := by obtain ⟨j,k,hjk⟩:=unramifiedCubicGaussSeries_nine_family h u n exact ⟨j,k,unramifiedGaussResidue_eq_of_initial_eq _ _ (fun s _ _=>hjk s)⟩ end section open Filter MeasureTheory open scoped BigOperators Classical Topology section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal noncomputable abbrev instFintypeUnitsO_4 : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units def ramifiedResidueFamilyMass (h:_root_.OAI.ActualEisensteinCubic.O) : ℝ := ∑a:Fin 3×Fin 3,‖unramifiedGaussResidue (h*omega^a.1.val*lambda^a.2.val)‖ lemma ramifiedResidueFamilyMass_nonneg (h:_root_.OAI.ActualEisensteinCubic.O) : 0≤ramifiedResidueFamilyMass h := Finset.sum_nonneg (fun _ _=>norm_nonneg _) lemma unramifiedGaussResidue_family_norm_le (h:_root_.OAI.ActualEisensteinCubic.O) (j k:Fin 3) : ‖unramifiedGaussResidue (h*omega^j.val*lambda^k.val)‖≤ramifiedResidueFamilyMass h := by unfold ramifiedResidueFamilyMass exact Finset.single_le_sum (a:=(j,k)) (s:=Finset.univ) (f:=fun a:Fin 3×Fin 3=>‖unramifiedGaussResidue (h*omega^a.1.val*lambda^a.2.val)‖) (fun _ _=>norm_nonneg _) (Finset.mem_univ (j,k)) lemma unramifiedGaussResidue_nine_norm_le (h:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (n:ℕ) : ‖unramifiedGaussResidue (h*(9*((u:_root_.OAI.ActualEisensteinCubic.O)*lambda^n)))‖≤ramifiedResidueFamilyMass h := by obtain ⟨j,k,hjk⟩:=unramifiedGaussResidue_nine_family h u n rw [hjk] exact unramifiedGaussResidue_family_norm_le h j k theorem unramifiedGaussResidue_unit_lambda_family (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (n:ℕ) : ∃j k:Fin 3,unramifiedGaussResidue ((u:_root_.OAI.ActualEisensteinCubic.O)*lambda^n)= unramifiedGaussResidue (omega^j.val*lambda^k.val) := by obtain ⟨j,hj⟩:=unit_eq_sign_omega u refine ⟨j,⟨n%3,Nat.mod_lt _ (by decide)⟩,?_⟩ rcases hj with hj|hj · rw [hj,unramifiedGaussResidue_lambda_pow] · rw [hj,neg_mul,unramifiedGaussResidue_neg,unramifiedGaussResidue_lambda_pow] lemma unramifiedGaussResidue_unit_lambda_norm_le (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (n:ℕ) : ‖unramifiedGaussResidue ((u:_root_.OAI.ActualEisensteinCubic.O)*lambda^n)‖≤ramifiedResidueFamilyMass 1 := by obtain ⟨j,k,hjk⟩:=unramifiedGaussResidue_unit_lambda_family u n rw [hjk] simpa only [one_mul] using unramifiedGaussResidue_family_norm_le 1 j k lemma ramifiedResidueFamilyMass_unit_lambda_le (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (n:ℕ) : ramifiedResidueFamilyMass ((u:_root_.OAI.ActualEisensteinCubic.O)*lambda^n)≤9*ramifiedResidueFamilyMass 1 := by calc _≤∑a:Fin 3×Fin 3,ramifiedResidueFamilyMass 1:=by apply Finset.sum_le_sum intro a ha let v:_root_.OAI.ActualEisensteinCubic.Oˣ:=u*ramifiedOmegaUnit^a.1.val have he:((u:_root_.OAI.ActualEisensteinCubic.O)*lambda^n)*omega^a.1.val*lambda^a.2.val= (v:_root_.OAI.ActualEisensteinCubic.O)*lambda^(n+a.2.val):=by simp only [v,Units.val_mul,Units.val_pow_eq_pow_val,ramifiedOmegaUnit_val,pow_add] ring rw [he] exact unramifiedGaussResidue_unit_lambda_norm_le v _ _=_:=by simp theorem sourceArithmeticResidue_family_bound (h:_root_.OAI.ActualEisensteinCubic.O) (hh:h≠0) : letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_4 ‖sourceArithmeticResidue h‖≤ ((∑i:PrincipalRamifiedIndex h,‖principalRamifiedWeight h i (4/3)‖)+3)* ramifiedResidueFamilyMass h/(4*(9*Real.sqrt 3/2)) := by letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_4 exact ( by have hM:=ramifiedResidueFamilyMass_nonneg h have hden:0<4*(9*Real.sqrt 3/2):=by positivity rw [sourceArithmeticResidue_eq_ramified_table h hh] split_ifs with hphase · rw [norm_div,norm_mul,Complex.norm_ofNat,Complex.norm_real,Real.norm_eq_abs, abs_of_pos (show 0<(9*Real.sqrt 3/2:ℝ) by positivity)] apply div_le_div_of_nonneg_right _ hden.le calc _≤‖∑i:PrincipalRamifiedIndex h,principalRamifiedWeight h i (4/3)* unramifiedGaussResidue (principalRamifiedIndex h i)‖+ ‖(3:ℂ)*unramifiedGaussResidue (9*h)‖:=norm_add_le _ _ _≤(∑i:PrincipalRamifiedIndex h,‖principalRamifiedWeight h i (4/3)‖)* ramifiedResidueFamilyMass h+3*ramifiedResidueFamilyMass h:=by apply add_le_add · calc _≤∑i:PrincipalRamifiedIndex h,‖principalRamifiedWeight h i (4/3)* unramifiedGaussResidue (principalRamifiedIndex h i)‖:=norm_sum_le _ _ _≤∑i:PrincipalRamifiedIndex h,‖principalRamifiedWeight h i (4/3)‖* ramifiedResidueFamilyMass h:=by apply Finset.sum_le_sum intro i hi rw [norm_mul] exact mul_le_mul_of_nonneg_left (unramifiedGaussResidue_nine_norm_le h i.1 (i.2.val+2)) (norm_nonneg _) _=_:=by rw [Finset.sum_mul] · rw [norm_mul,Complex.norm_ofNat] have hb:=unramifiedGaussResidue_nine_norm_le h (1:_root_.OAI.ActualEisensteinCubic.Oˣ) 0 simp only [Units.val_one,pow_zero,mul_one] at hb simpa only [mul_comm 9 h] using mul_le_mul_of_nonneg_left hb (by norm_num : (0:ℝ)≤3) _=_:=by ring · rw [norm_zero] positivity ) end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal noncomputable abbrev instFintypeUnitsO_5 : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units def ramifiedDecayRatio : ℝ := (3:ℝ)^(-(1/3:ℝ)) lemma ramifiedDecayRatio_pos : 0 simp [residueAdditive,breveE_norm] · simp lemma ramifiedWeight_norm_scalar (n:ℕ) : ‖((3^n:ℕ):ℂ)^(-(4/3:ℂ))‖*(3^n:ℕ)=ramifiedDecayRatio^n := by have ha:0<(3:ℝ)^n:=pow_pos (by norm_num) _ have hn:‖((3:ℂ)^n)^(-(4/3:ℂ))‖=((3:ℝ)^n)^(-(4/3:ℝ)):=by have he:=Complex.norm_cpow_eq_rpow_re_of_pos ha (-(4/3:ℂ)) have hre:(-(4/3:ℂ)).re=-(4/3:ℝ):=by norm_num rw [hre] at he simpa only [Complex.ofReal_pow,Complex.ofReal_ofNat] using he simp only [Nat.cast_pow,Nat.cast_ofNat] rw [hn] calc ((3:ℝ)^n)^(-(4/3:ℝ))*(3:ℝ)^n= ((3:ℝ)^n)^(-(4/3:ℝ))*((3:ℝ)^n)^(1:ℝ):=by rw [Real.rpow_one] _=((3:ℝ)^n)^(-(1/3:ℝ)):=by rw [←Real.rpow_add ha] congr 1 norm_num _=(3:ℝ)^((n:ℝ)*(-(1/3:ℝ))):=(Real.rpow_natCast_mul (by norm_num) n _).symm _=(3:ℝ)^((-(1/3:ℝ))*(n:ℝ)):=by rw [mul_comm] _=ramifiedDecayRatio^n:=by rw [Real.rpow_mul (by norm_num),Real.rpow_natCast] rfl lemma principalRamifiedWeight_norm_le (h:_root_.OAI.ActualEisensteinCubic.O) (i:PrincipalRamifiedIndex h) : ‖principalRamifiedWeight h i (4/3)‖≤ramifiedDecayRatio^(i.2.val+2) := by unfold principalRamifiedWeight rw [norm_mul] calc _≤‖((3^(i.2.val+2):ℕ):ℂ)^(-(4/3:ℂ))‖*(3^(i.2.val+2):ℕ):= mul_le_mul_of_nonneg_left (explicitRamifiedCoefficient_norm_le h i.1 _) (norm_nonneg _) _=_:=ramifiedWeight_norm_scalar _ theorem principalRamifiedWeight_sum_norm_le (h:_root_.OAI.ActualEisensteinCubic.O) : letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_5 (∑i:PrincipalRamifiedIndex h,‖principalRamifiedWeight h i (4/3)‖)≤ 6*ramifiedDecayRatio^2/(1-ramifiedDecayRatio) := by letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_5 exact ( by have ht0:=ramifiedDecayRatio_pos.le have ht1:=ramifiedDecayRatio_lt_one have hfin:(∑n:Fin (ramifiedFrequencyBound h+1),ramifiedDecayRatio^(n.val+2))≤ ramifiedDecayRatio^2/(1-ramifiedDecayRatio):=by rw [Fin.sum_univ_eq_sum_range (fun n:ℕ=>ramifiedDecayRatio^(n+2))] simp_rw [pow_add,mul_comm _ (ramifiedDecayRatio^2)] rw [←Finset.mul_sum] have hs: (∑n∈Finset.range (ramifiedFrequencyBound h+1),ramifiedDecayRatio^n)≤ (1-ramifiedDecayRatio)⁻¹:=by rw [←tsum_geometric_of_lt_one ht0 ht1] exact (summable_geometric_of_lt_one ht0 ht1).sum_le_tsum _ (fun n _=>pow_nonneg ht0 n) simpa only [div_eq_mul_inv] using mul_le_mul_of_nonneg_left hs (sq_nonneg ramifiedDecayRatio) calc _≤∑i:PrincipalRamifiedIndex h,ramifiedDecayRatio^(i.2.val+2):= Finset.sum_le_sum (fun i _=>principalRamifiedWeight_norm_le h i) _=(6:ℝ)*(∑n:Fin (ramifiedFrequencyBound h+1),ramifiedDecayRatio^(n.val+2)):=by rw [Fintype.sum_prod_type] simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul] have hc:Fintype.card _root_.OAI.ActualEisensteinCubic.Oˣ=6:=by simpa only [Nat.card_eq_fintype_card] using PrimaryIdealUnitReindex.card_units_eq_six rw [hc] norm_num _≤6*(ramifiedDecayRatio^2/(1-ramifiedDecayRatio)):=mul_le_mul_of_nonneg_left hfin (by norm_num) _=_:=by ring ) end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal noncomputable abbrev instFintypeUnitsO_6 : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units def ramifiedSourceFamilyConstant : ℝ := (6*ramifiedDecayRatio^2/(1-ramifiedDecayRatio)+3)/(4*(9*Real.sqrt 3/2)) lemma ramifiedSourceFamilyConstant_nonneg : 0≤ramifiedSourceFamilyConstant := by have ht:0<1-ramifiedDecayRatio:=sub_pos.mpr ramifiedDecayRatio_lt_one unfold ramifiedSourceFamilyConstant positivity theorem sourceArithmeticResidue_nine_family_bound (h:_root_.OAI.ActualEisensteinCubic.O) (hh:h≠0) : ‖sourceArithmeticResidue h‖≤ramifiedSourceFamilyConstant*ramifiedResidueFamilyMass h := by letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_4 letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_5 letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_6 exact ( by have hm:=ramifiedResidueFamilyMass_nonneg h refine (sourceArithmeticResidue_family_bound h hh).trans ?_ have hw:(∑i:PrincipalRamifiedIndex h,‖principalRamifiedWeight h i (4/3)‖)+3≤ 6*ramifiedDecayRatio^2/(1-ramifiedDecayRatio)+3:=by linarith [principalRamifiedWeight_sum_norm_le h] calc _≤(6*ramifiedDecayRatio^2/(1-ramifiedDecayRatio)+3)* ramifiedResidueFamilyMass h/(4*(9*Real.sqrt 3/2)):= div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hw hm) (by positivity) _=ramifiedSourceFamilyConstant*ramifiedResidueFamilyMass h:=by unfold ramifiedSourceFamilyConstant ring ) theorem sourceArithmeticResidue_unit_lambda_bound (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (n:ℕ) : ‖sourceArithmeticResidue ((u:_root_.OAI.ActualEisensteinCubic.O)*lambda^n)‖≤ 9*ramifiedSourceFamilyConstant*ramifiedResidueFamilyMass 1 := by refine (sourceArithmeticResidue_nine_family_bound _ (ramifiedElement_ne_zero u n)).trans ?_ have he:=mul_le_mul_of_nonneg_left (ramifiedResidueFamilyMass_unit_lambda_le u n) ramifiedSourceFamilyConstant_nonneg convert he using 1 ; ring end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicKubota CubicJacobiGlobal def extraPeriodWitness : levelThree := by let M:SL(2,_root_.OAI.ActualEisensteinCubic.O):=⟨!![1+3*omega,3*omega^2;-3,1-3*omega],by rw [Matrix.det_fin_two_of] ring⟩ refine ⟨M,levelThree_of_entries M ?_⟩ intro i j fin_cases i <;> fin_cases j · exact ⟨omega,by change 1+3*omega-1=3*omega;ring⟩ · exact ⟨omega^2,by change 3*omega^2-0=3*omega^2;ring⟩ · exact ⟨-1,by change -3-(0:_root_.OAI.ActualEisensteinCubic.O)=3*(-1);ring⟩ · exact ⟨-omega,by change 1-3*omega-1=3*(-omega);ring⟩ def rationalLowerMinusThree : SL(2,ℤ):=⟨!![1,0;-3,1],by simp [Matrix.det_fin_two]⟩ lemma extraPeriodWitness_factor : integralComplexMatrix (extraPeriodWitness:SL(2,_root_.OAI.ActualEisensteinCubic.O))= complexTranslation (-eisEmbedding omega)* integralComplexMatrix (rationalEmbedding rationalLowerMinusThree)* complexTranslation (eisEmbedding omega) := by apply Subtype.ext simp only [Matrix.SpecialLinearGroup.coe_mul] apply Matrix.ext intro i j simp only [Matrix.mul_apply, Fin.sum_univ_two, integralComplexMatrix_apply, rationalEmbedding, Matrix.SpecialLinearGroup.map_apply_coe] fin_cases i <;> fin_cases j <;> simp [extraPeriodWitness, rationalLowerMinusThree, complexTranslation, map_ofNat] <;> ring lemma extraPeriodWitness_character : complexCharacter extraPeriodWitness=eisEmbedding omega := by change eisEmbedding (symbol (-3) (1+3*omega))=eisEmbedding omega apply congrArg eisEmbedding have hp:lambda^2∣(1+3*omega)-1:=lambda_sq_dvd_three.trans ⟨omega,by ring⟩ rw [symbol_neg_numerator _ _ hp] have he:=ramified_symbol_at_omega (-(ramifiedOmegaUnit^2)) 2 2 (Or.inr (by simp only [Units.val_neg,Units.val_pow_eq_pow_val,ramifiedOmegaUnit_val])) have hl:lambda^2=-3*omega:=by change (omega-1)^2=-3*omega linear_combination ramified_omega_relation have hnum:((-(ramifiedOmegaUnit^2):_root_.OAI.ActualEisensteinCubic.Oˣ):_root_.OAI.ActualEisensteinCubic.O)*lambda^2=3:=by simp only [Units.val_neg,Units.val_pow_eq_pow_val,ramifiedOmegaUnit_val] rw [hl] calc _=3*omega^3:=by ring _=3:=by rw [omega_primitive.pow_eq_one];ring rw [hnum] at he have hw:omega^(2*2)=omega:=by norm_num only [Nat.reduceMul] calc omega^4=omega^3*omega:=by ring _=omega:=by rw [omega_primitive.pow_eq_one,one_mul] exact he.trans hw lemma extraPeriodWitness_character_ne_one : complexCharacter extraPeriodWitness≠1 := by rw [extraPeriodWitness_character] intro he exact omega_primitive.ne_one (by decide) (eisEmbedding_injective (by simpa only [map_one] using he)) theorem cubicSource_not_eisenstein_periodic : ¬(∀a:_root_.OAI.ActualEisensteinCubic.O,∀w:HyperbolicSpace, cubicSourceResidualFunction (complexTranslation (eisEmbedding a) • w)= cubicSourceResidualFunction w) := by intro hperiod apply cubicSourceResidualFunction_ne_zero funext w have hneg (u:HyperbolicSpace): cubicSourceResidualFunction (complexTranslation (-eisEmbedding omega) • u)= cubicSourceResidualFunction u:=by simpa only [map_neg] using hperiod (-omega) u have hinv:cubicSourceResidualFunction (integralComplexMatrix (extraPeriodWitness:SL(2,_root_.OAI.ActualEisensteinCubic.O)) • w)=cubicSourceResidualFunction w:=by rw [extraPeriodWitness_factor,mul_smul,mul_smul,hneg, cubicSourceResidualFunction_rational_invariant,hperiod] have hchar:=cubicSourceResidualFunction_automorphy (sourceLevelInclusion extraPeriodWitness) w change cubicSourceResidualFunction (integralComplexMatrix (extraPeriodWitness:SL(2,_root_.OAI.ActualEisensteinCubic.O)) • w)= levelTwoComplexCharacter ⟨(extraPeriodWitness:SL(2,_root_.OAI.ActualEisensteinCubic.O)),levelThree_le_levelTwo extraPeriodWitness.property⟩* cubicSourceResidualFunction w at hchar rw [levelTwoComplexCharacter_restrict] at hchar change cubicSourceResidualFunction (integralComplexMatrix (extraPeriodWitness:SL(2,_root_.OAI.ActualEisensteinCubic.O)) • w)= complexCharacter extraPeriodWitness*cubicSourceResidualFunction w at hchar rw [hinv] at hchar have hz:(complexCharacter extraPeriodWitness-1)*cubicSourceResidualFunction w=0:=by linear_combination -hchar exact (mul_eq_zero.mp hz).resolve_left (sub_ne_zero.mpr extraPeriodWitness_character_ne_one) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.SourceMellinInversion /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicKubota namespace RootNotationSourceMellinInversion01 abbrev Eis := ActualEisensteinCubic.O end RootNotationSourceMellinInversion01 open RootNotationSourceMellinInversion01 (Eis) lemma source_period_of_three_supported (hs:∀h:Eis,¬(3:Eis)∣h→sourceResidualFourierCoefficient h=0) (a:Eis) (z:ℂ) (v:ℝ) (hv:0(3*(Real.pi:ℂ))*constantArithmeticResidue*(v:ℂ)^(2/3:ℂ)+t) apply tsum_congr intro h by_cases hd:(3:Eis)∣h · obtain ⟨b,rfl⟩:=hd have hp:ShortDraftTrace.breveE (cuspFrequency (3*b)*eisEmbedding a)=1:=by have he:cuspFrequency (3*b)*eisEmbedding a=cuspFrequency b*(3*eisEmbedding a):=by unfold cuspFrequency rw [map_mul,map_ofNat] ring rw [he,cuspFrequency_period] rw [mul_add,AddChar.map_add_eq_mul,hp,mul_one] · rw [hs h hd] by_cases hh:h=0 <;> simp [hh] theorem exists_source_coefficient_not_three : ∃h:Eis,¬(3:Eis)∣h ∧ sourceResidualFourierCoefficient h≠0 := by by_contra hn have hs:∀h:Eis,¬(3:Eis)∣h→sourceResidualFourierCoefficient h=0:=by intro h hh by_contra hne exact hn ⟨h,hh,hne⟩ apply cubicSource_not_eisenstein_periodic intro a w obtain ⟨z,v,hv,rfl⟩:=upperPoint_surjective w rw [complexTranslation_action] exact source_period_of_three_supported hs a z v hv end CubicEisenstein namespace CompletedGauss section open Filter MeasureTheory open scoped Classical BigOperators Topology FourierTransform SchwartzMap ContDiff lemma compactMellin_vertical_integrable (V : ℝ→ℂ) (a b : ℝ) (ha : 0(𝓕 f) (t/(2*Real.pi))) := by simpa only [div_eq_mul_inv] using (𝓕 f).integrable.comp_mul_right' (inv_ne_zero (mul_ne_zero (by norm_num) Real.pi_ne_zero)) change Integrable (fun t : ℝ=>mellin V ((σ:ℂ)+t*Complex.I)) have hfcoe : (f:ℝ→ℂ)=CubicReflectionKernel.mellinLogFamily V σ := rfl simpa only [CubicReflectionKernel.mellin_eq_logFamily_fourier, SchwartzMap.fourier_coe,hfcoe] using hf theorem compactMellin_inversion (V : ℝ→ℂ) (a b : ℝ) (ha : 0(r:ℂ)^((σ:ℂ)+t*Complex.I)) := by let : NeZero (r:ℂ) := ⟨Complex.ofReal_ne_zero.mpr hr.ne'⟩ exact (_root_.continuous_const_cpow (r:ℂ)).comp (by fun_prop) lemma positive_cpow_negative_vertical_continuous (r σ : ℝ) (hr : 0(r:ℂ)^(-((σ:ℂ)+t*Complex.I))) := by let : NeZero (r:ℂ) := ⟨Complex.ofReal_ne_zero.mpr hr.ne'⟩ exact (_root_.continuous_const_cpow (r:ℂ)).comp (by fun_prop) lemma vertical_power_mul_integrable (M : ℝ→ℂ) (hM : Integrable M) (r σ : ℝ) (hr : 0(r:ℂ)^((σ:ℂ)+t*Complex.I)*M t) := by apply (hM.norm.const_mul (r^σ)).mono' ((positive_cpow_vertical_continuous r σ hr).aestronglyMeasurable.mul hM.aestronglyMeasurable) exact Filter.Eventually.of_forall (fun t=>by simp only [Pi.mul_apply,norm_mul,positive_cpow_vertical_norm r σ t hr,le_refl]) lemma weighted_vertical_power_integrable (M : ℝ→ℂ) (hM : Integrable M) (r σ : ℝ) (hr : 0c*(r:ℂ)^(-((σ:ℂ)+t*Complex.I))*M t) := by apply (hM.norm.const_mul (‖c‖*r^(-σ))).mono' ((continuous_const.mul (positive_cpow_negative_vertical_continuous r σ hr)).aestronglyMeasurable.mul hM.aestronglyMeasurable) exact Filter.Eventually.of_forall (fun t=>by simp only [Pi.mul_apply,norm_mul,positive_cpow_negative_vertical_norm r σ t hr,le_refl]) lemma weighted_vertical_power_integral_norm (M : ℝ→ℂ) (r σ : ℝ) (hr : 0‖c i‖*(r i)^(-σ))) (M : ℝ→ℂ) (hM : Integrable M) : (∑' i,∫t : ℝ,c i*(r i:ℂ)^(-((σ:ℂ)+t*Complex.I))*M t)= ∫t : ℝ,(∑' i,c i*(r i:ℂ)^(-((σ:ℂ)+t*Complex.I)))*M t := by have hi (i : α) := weighted_vertical_power_integrable M hM (r i) σ (hr i) (c i) have hs : Summable (fun i=>∫t : ℝ,‖c i*(r i:ℂ)^(-((σ:ℂ)+t*Complex.I))*M t‖) := by simp only [weighted_vertical_power_integral_norm M _ σ (hr _) _] exact hc.mul_right _ rw [integral_tsum_of_summable_integral_norm hi hs] apply integral_congr_ae exact Filter.Eventually.of_forall (fun t=>tsum_mul_right) lemma positive_quotient_cpow_neg (r X : ℝ) (hr : 0‖c i‖*(r i)^(-σ))) (V : ℝ→ℂ) (a b : ℝ) (ha : 0(X:ℂ)^((σ:ℂ)+t*Complex.I)*mellin V ((σ:ℂ)+t*Complex.I) have hM : Integrable M := vertical_power_mul_integrable _ (compactMellin_vertical_integrable V a b ha hsupp hV σ) X σ hX have hi (i : α) : c i*V (r i/X)=(1/(2*Real.pi):ℂ)* ∫t : ℝ,c i*(r i:ℂ)^(-((σ:ℂ)+t*Complex.I))*M t := by rw [compactMellin_inversion V a b ha hsupp hV σ _ (div_pos (hr i) hX)] rw [←mul_assoc,mul_comm (c i),mul_assoc,←integral_const_mul] congr 1 apply integral_congr_ae exact Filter.Eventually.of_forall (fun t=>by dsimp only rw [positive_quotient_cpow_neg _ _ (hr i) hX] dsimp only [M] ring) simp_rw [hi] rw [tsum_mul_left,weighted_vertical_sum_integral r hr c σ hc M hM] congr 1 apply integral_congr_ae exact Filter.Eventually.of_forall (fun t=>by dsimp only [M];ring) end CompletedGauss open Filter MeasureTheory open scoped Classical BigOperators Topology namespace CompletedGauss section open ActualEisensteinCubic ConcreteTraceCRT namespace RootNotationSourceMellinInversion02 abbrev O := ActualEisensteinCubic.O end RootNotationSourceMellinInversion02 open RootNotationSourceMellinInversion02 (O) lemma angularFactor_norm_le_one (a : ActualEisensteinCubic.O) : ‖FiniteGaussPhase.angularFactor a‖≤1 := by by_cases ha : a=0 · subst a; simp [FiniteGaussPhase.angularFactor] · exact (FiniteGaussPhase.norm_angularFactor a ha).le lemma cubicRow_norm_le_one (I : Ideal ActualEisensteinCubic.O) (hI : primaryGenerator I≠0) (x : ActualEisensteinCubic.O⧸I) : ‖cubicRow I hI x‖≤1 := by unfold cubicRow rw [norm_prod] apply Finset.prod_le_one₀ · intro i hi; exact norm_nonneg _ · intro i hi letI : i.val.IsMaximal := primeIndexMaximal I i let : Fintype (ActualEisensteinCubic.O ⧸ i.val) := ActualEisensteinCubic.quotientFintype i.val exact FiniteRayExpansion.norm_char_le_one _ _ lemma gaussTwo_norm_le_sqrt (I : Ideal ActualEisensteinCubic.O) (hI : primaryGenerator I≠0) : ‖gaussTwo I hI‖≤Real.sqrt (Ideal.absNorm I:ℝ) := by let n := primaryGenerator I let : Finite (ActualEisensteinCubic.O⧸Ideal.span {n}) := finite_quotient_span hI let : Fintype (ActualEisensteinCubic.O⧸Ideal.span {n}) := Fintype.ofFinite _ let e := Ideal.quotEquivOfEq (primaryGenerator_spec I hI).1 let ψ := eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates n hI have hN : 0<(Ideal.absNorm I:ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun h=>primaryGenerator_ne_zero_ideal I hI (Ideal.absNorm_eq_zero_iff.mp h)) have hn : ‖eisEmbedding n‖=Real.sqrt (Ideal.absNorm I:ℝ) := primaryGenerator_norm I hI have hsum : ‖∑x : ActualEisensteinCubic.O⧸Ideal.span {n},cubicRow I hI (e x)*ψ x‖≤(Ideal.absNorm I:ℝ) := by calc _≤∑x : ActualEisensteinCubic.O⧸Ideal.span {n},‖cubicRow I hI (e x)*ψ x‖ := norm_sum_le _ _ _≤∑_x : ActualEisensteinCubic.O⧸Ideal.span {n},(1:ℝ) := by apply Finset.sum_le_sum intro x hx rw [norm_mul,AddChar.norm_apply,mul_one] exact cubicRow_norm_le_one I hI (e x) _=(Ideal.absNorm I:ℝ) := by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul,mul_one] congr 1 rw [←Nat.card_eq_fintype_card,←Submodule.cardQuot_apply,←Ideal.absNorm_apply, (primaryGenerator_spec I hI).1] change ‖(∑x : ActualEisensteinCubic.O⧸Ideal.span {n},cubicRow I hI (e x)*ψ x)/(‖eisEmbedding n‖:ℂ)‖≤_ rw [norm_div,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (norm_nonneg _),hn] apply (div_le_iff₀ (Real.sqrt_pos.mpr hN)).mpr simpa only [Real.mul_self_sqrt hN.le] using hsum lemma columnWeight_div_sqrt_norm_le_one (Ψ : ActualEisensteinCubic.O→*ℂ) (hΨ : ∀a,‖Ψ a‖≤1) (I : Ideal ActualEisensteinCubic.O) : ‖columnWeight Ψ I/(Real.sqrt (Ideal.absNorm I:ℝ):ℂ)‖≤1 := by by_cases hI : Squarefree I ∧ primaryGenerator I≠0 · have hN : 0<(Ideal.absNorm I:ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun h=>primaryGenerator_ne_zero_ideal I hI.2 (Ideal.absNorm_eq_zero_iff.mp h)) rw [columnWeight_eq Ψ I hI.1 hI.2,norm_div,norm_mul,norm_mul,norm_star, FiniteGaussPhase.norm_angularFactor _ hI.2,one_mul, Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (Real.sqrt_nonneg _)] apply (div_le_one (Real.sqrt_pos.mpr hN)).mpr exact (mul_le_of_le_one_right (norm_nonneg _) (hΨ _)).trans (gaussTwo_norm_le_sqrt I hI.2) · simp only [columnWeight,squarefreeGaussCoefficient,dif_neg hI,zero_mul,zero_div,norm_zero,zero_le_one] lemma cubeWeight_norm_le_one (Ψ : ActualEisensteinCubic.O→*ℂ) (hΨ : ∀a,‖Ψ a‖≤1) (I : Ideal ActualEisensteinCubic.O) : ‖cubeWeight Ψ I‖≤1 := by by_cases hI : I=0 · subst I; simp [cubeWeight_bot] have hN : (1:ℝ)≤(Ideal.absNorm I:ℝ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (fun h=>hI (Ideal.absNorm_eq_zero_iff.mp h)) have hn : 0<(Ideal.absNorm I:ℝ) := lt_of_lt_of_le zero_lt_one hN change ‖star (FiniteGaussPhase.angularFactor (primaryGenerator I))^3* Ψ (primaryGenerator I)^3/(Ideal.absNorm I:ℂ)‖≤1 rw [norm_div,norm_mul,norm_pow,norm_star,norm_pow,Complex.norm_natCast] apply (div_le_one hn).mpr apply le_trans _ hN calc _≤(1:ℝ)*1 := mul_le_mul (pow_le_one₀ (norm_nonneg _) (angularFactor_norm_le_one _)) (pow_le_one₀ (norm_nonneg _) (hΨ _)) (pow_nonneg (norm_nonneg _) _) zero_le_one _=1 := one_mul _ end open Filter MeasureTheory open scoped Classical BigOperators Topology ContDiff section open ActualEisensteinCubic CubicEisenstein namespace RootNotationSourceMellinInversion03 abbrev O := ActualEisensteinCubic.O end RootNotationSourceMellinInversion03 open RootNotationSourceMellinInversion03 (O) abbrev CompletedMellinIndex := NonzeroIdeal×NonzeroIdeal def completedMellinLength (p : CompletedMellinIndex) : ℝ := (Ideal.absNorm p.1.1:ℝ)*(Ideal.absNorm p.2.1:ℝ)^3 def completedMellinCoefficient (Ψ : ActualEisensteinCubic.O→*ℂ) (p : CompletedMellinIndex) : ℂ := columnWeight Ψ p.1.1/(Real.sqrt (Ideal.absNorm p.1.1:ℝ):ℂ)*cubeWeight Ψ p.2.1 lemma nonzeroIdeal_norm_pos (I : NonzeroIdeal) : 0<(Ideal.absNorm I.1:ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (fun h=>I.2 (Ideal.absNorm_eq_zero_iff.mp h)) lemma completedMellinLength_pos (p : CompletedMellinIndex) : 0(Ideal.absNorm I.1:ℝ)^(-σ)) := by have h := (fullIdealWeight_summable_norm (σ:ℂ) (by simpa using hσ)).subtype (fun I=>I≠0) apply h.congr intro I change ‖fullIdealWeight (σ:ℂ) I.1‖=(Ideal.absNorm I.1:ℝ)^(-σ) rw [fullIdealWeight,if_neg I.2] simpa only [Complex.neg_re,Complex.ofReal_re,Complex.ofReal_natCast] using (Complex.norm_cpow_eq_rpow_re_of_pos (nonzeroIdeal_norm_pos I) (-(σ:ℂ))) lemma completedMellinLength_rpow (p : CompletedMellinIndex) (σ : ℝ) : (completedMellinLength p)^(-σ)= (Ideal.absNorm p.1.1:ℝ)^(-σ)*(Ideal.absNorm p.2.1:ℝ)^(-(3*σ)) := by rw [completedMellinLength,Real.mul_rpow (nonzeroIdeal_norm_pos p.1).le (pow_nonneg (nonzeroIdeal_norm_pos p.2).le _),←Real.rpow_natCast_mul (nonzeroIdeal_norm_pos p.2).le] congr 1 congr 1 ring theorem completedMellinCoefficient_summable (Ψ : ActualEisensteinCubic.O→*ℂ) (hΨ : ∀a,‖Ψ a‖≤1) (σ : ℝ) (hσ : 1<σ) : Summable (fun p=>‖completedMellinCoefficient Ψ p‖*(completedMellinLength p)^(-σ)) := by have hI := nonzeroIdeal_norm_rpow_summable σ hσ have hJ := nonzeroIdeal_norm_rpow_summable (3*σ) (by linarith) have hp := hI.mul_of_nonneg hJ (fun I=>Real.rpow_nonneg (nonzeroIdeal_norm_pos I).le _) (fun J=>Real.rpow_nonneg (nonzeroIdeal_norm_pos J).le _) apply hp.of_nonneg_of_le · intro p; exact mul_nonneg (norm_nonneg _) (Real.rpow_nonneg (completedMellinLength_pos p).le _) · intro p rw [←completedMellinLength_rpow] exact mul_le_of_le_one_left (Real.rpow_nonneg (completedMellinLength_pos p).le _) (completedMellinCoefficient_norm_le_one Ψ hΨ p) def completedDirichletSeries (Ψ : ActualEisensteinCubic.O→*ℂ) (s : ℂ) : ℂ := ∑'p : CompletedMellinIndex,completedMellinCoefficient Ψ p* (completedMellinLength p:ℂ)^(1/2-s) theorem completedT_eq_mellin_index (Ψ : ActualEisensteinCubic.O→*ℂ) (W : ℝ→ℂ) (hW : HasCompactSupport W) (X : ℝ) (hX : 0(p.1.1,p.2.1)) := by intro p q h apply Prod.ext <;> apply Subtype.ext · exact congrArg Prod.fst h · exact congrArg Prod.snd h have hsub := hfull.comp_injective hinj calc completedT Ψ W X=∑'I : NonzeroIdeal,∑'J : Ideal ActualEisensteinCubic.O,summand Ψ W X I.1 J := by symm unfold completedT apply tsum_subtype_eq_of_support_subset (s:={I:Ideal ActualEisensteinCubic.O|I≠0}) (f:=fun I:Ideal ActualEisensteinCubic.O=>∑'J:Ideal ActualEisensteinCubic.O,summand Ψ W X I J) intro I hI hz subst I exact hI (by simp only [summand_zero_left,tsum_zero]) _=∑'I : NonzeroIdeal,∑'J : NonzeroIdeal,summand Ψ W X I.1 J.1 := by apply tsum_congr intro I symm apply tsum_subtype_eq_of_support_subset (s:={J:Ideal ActualEisensteinCubic.O|J≠0}) (f:=fun J:Ideal ActualEisensteinCubic.O=>summand Ψ W X I.1 J) intro J hJ hz subst J exact hJ (summand_zero_right Ψ W X I.1) _=∑'p : CompletedMellinIndex,summand Ψ W X p.1.1 p.2.1 := hsub.tsum_prod.symm _=_ := rfl theorem completedT_initial_mellin (Ψ : ActualEisensteinCubic.O→*ℂ) (hΨ : ∀a,‖Ψ a‖≤1) (W : ℝ→ℂ) (a b : ℝ) (ha : 0‖c i‖*(r i)^(-σ))) : Continuous (fun t : ℝ=>∑'i,c i*(r i:ℂ)^(-((σ:ℂ)+t*Complex.I))) := by apply continuous_tsum (fun i=>continuous_const.mul (positive_cpow_negative_vertical_continuous (r i) σ (hr i))) hc intro i t change ‖c i*(r i:ℂ)^(-((σ:ℂ)+t*Complex.I))‖≤‖c i‖*(r i)^(-σ) rw [norm_mul,positive_cpow_negative_vertical_norm _ _ _ (hr i)] lemma weighted_vertical_series_norm {α : Type*} (r : α→ℝ) (hr : ∀i,0‖c i‖*(r i)^(-σ))) (t : ℝ) : ‖∑'i,c i*(r i:ℂ)^(-((σ:ℂ)+t*Complex.I))‖≤∑'i,‖c i‖*(r i)^(-σ) := by have he (i : α) : ‖c i*(r i:ℂ)^(-((σ:ℂ)+t*Complex.I))‖=‖c i‖*(r i)^(-σ) := by rw [norm_mul,positive_cpow_negative_vertical_norm _ _ _ (hr i)] simpa only [he] using norm_tsum_le_tsum_norm (hc.congr (fun i=>(he i).symm)) lemma completedDirichletSeries_initial (Ψ : ActualEisensteinCubic.O→*ℂ) (t : ℝ) : completedDirichletSeries Ψ ((2:ℂ)+t*Complex.I)= ∑'p : CompletedMellinIndex,completedMellinCoefficient Ψ p* (completedMellinLength p:ℂ)^(-((3/2:ℂ)+t*Complex.I)) := by unfold completedDirichletSeries apply tsum_congr intro p congr 2 ring theorem completedT_initial_mellin_integrable (Ψ : ActualEisensteinCubic.O→*ℂ) (hΨ : ∀a,‖Ψ a‖≤1) (W : ℝ→ℂ) (a b : ℝ) (ha : 0mellin (Vstar W) ((3/2:ℂ)+t*Complex.I)* (X:ℂ)^((3/2:ℂ)+t*Complex.I)*completedDirichletSeries Ψ ((2:ℂ)+t*Complex.I)) := by have hsum := completedMellinCoefficient_summable Ψ hΨ (3/2) (by norm_num) have hc := weighted_vertical_series_continuous completedMellinLength completedMellinLength_pos (completedMellinCoefficient Ψ) (3/2) hsum have hb := weighted_vertical_series_norm completedMellinLength completedMellinLength_pos (completedMellinCoefficient Ψ) (3/2) hsum have hmi : Integrable (fun t : ℝ=>mellin (Vstar W) ((3/2:ℂ)+t*Complex.I)) := by simpa only [Complex.VerticalIntegrable,Complex.ofReal_div,Complex.ofReal_ofNat] using (compactMellin_vertical_integrable (Vstar W) a b ha (Vstar_support W a b hsupp) (Vstar_contDiff W a b ha hsupp hW) (3/2)) have hbase := vertical_power_mul_integrable _ hmi X (3/2) hX have hi := hbase.mul_bdd hc.aestronglyMeasurable (Filter.Eventually.of_forall hb) simpa only [Complex.ofReal_div,Complex.ofReal_ofNat,completedDirichletSeries_initial, mul_comm (mellin (Vstar W) _)] using hi end CompletedGauss open scoped BigOperators Classical open Finset AddChar MulChar EisensteinEmbedding namespace CompletedGauss namespace RootNotationSourceMellinInversion06 abbrev Eis := ActualEisensteinCubic.O end RootNotationSourceMellinInversion06 open RootNotationSourceMellinInversion06 (Eis) def dualIdealDyad (j : ℕ) : Finset (Ideal Eis) := (ConcretePrimeRowBridge.idealsUpTo (2^j)).filter (fun I => Nat.clog 2 (Ideal.absNorm I)=j) lemma mem_dualIdealDyad (I : Ideal Eis) (j : ℕ) : I∈dualIdealDyad j ↔ I≠0 ∧ Nat.clog 2 (Ideal.absNorm I)=j := by simp only [dualIdealDyad,Finset.mem_filter,ConcretePrimeRowBridge.mem_idealsUpTo] constructor · rintro ⟨⟨hI,_⟩,hj⟩ exact ⟨fun h => by simp [h] at hI, hj⟩ · rintro ⟨hI,hj⟩ refine ⟨⟨Nat.one_le_iff_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr hI),?_⟩,hj⟩ simpa only [hj] using Nat.le_pow_clog (by norm_num : 1<2) (Ideal.absNorm I) lemma dualIdealDyad_bounds (j : ℕ) (I : Ideal Eis) (hI : I∈dualIdealDyad j) : I≠0 ∧ (2:ℝ)^j/2≤(Ideal.absNorm I:ℝ) ∧ (Ideal.absNorm I:ℝ)≤(2:ℝ)^j := by obtain ⟨hn,hj⟩:= (mem_dualIdealDyad I j).mp hI have hu:=Nat.le_pow_clog (by norm_num : 1<2) (Ideal.absNorm I) have hl:=two_pow_clog_le_double (Ideal.absNorm I) (Nat.one_le_iff_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr hn)) rw [hj] at hu hl refine ⟨hn,?_,by exact_mod_cast hu⟩ have he : (2:ℝ)^j≤2*(Ideal.absNorm I:ℝ):=by exact_mod_cast hl linarith abbrev NonzeroDualIdeal := {I : Ideal Eis // I≠0} def dualDyadicIndexEquiv : (ℕ×NonzeroDualIdeal×NonzeroDualIdeal) ≃ (Σ i : ℕ×ℕ×ℕ, (dualIdealDyad i.2.2)×(dualIdealDyad i.2.1)) where toFun x := ⟨(x.1,Nat.clog 2 (Ideal.absNorm x.2.2.val),Nat.clog 2 (Ideal.absNorm x.2.1.val)), ⟨⟨x.2.1.val,(mem_dualIdealDyad _ _).mpr ⟨x.2.1.property,rfl⟩⟩, ⟨x.2.2.val,(mem_dualIdealDyad _ _).mpr ⟨x.2.2.property,rfl⟩⟩⟩⟩ invFun x := ⟨x.1.1,⟨x.2.1.val,((mem_dualIdealDyad _ _).mp x.2.1.property).1⟩, ⟨x.2.2.val,((mem_dualIdealDyad _ _).mp x.2.2.property).1⟩⟩ left_inv x := by cases x; rfl right_inv x := by rcases x with ⟨⟨m,j,k⟩,⟨⟨I,hI⟩,⟨J,hJ⟩⟩⟩ have hi:=((mem_dualIdealDyad I k).mp hI).2 have hj:=((mem_dualIdealDyad J j).mp hJ).2 dsimp only subst k subst j rfl theorem tsum_dualIdealDyads (f : ℕ×NonzeroDualIdeal×NonzeroDualIdeal → ℂ) (hf : Summable f) : (∑'x, f x) = ∑'i : ℕ×ℕ×ℕ, ∑n : dualIdealDyad i.2.2, ∑b : dualIdealDyad i.2.1, f (i.1,⟨n.val,((mem_dualIdealDyad _ _).mp n.property).1⟩, ⟨b.val,((mem_dualIdealDyad _ _).mp b.property).1⟩) := by let g := f ∘ dualDyadicIndexEquiv.symm have hg : Summable g := dualDyadicIndexEquiv.symm.summable_iff.mpr hf calc _ = ∑'x,g x := (dualDyadicIndexEquiv.symm.tsum_eq f).symm _ = ∑'i,∑'x,g ⟨i,x⟩ := Summable.tsum_sigma' (fun _=>hasSum_fintype _ |>.summable) hg _ = _ := by apply tsum_congr intro i rw [tsum_fintype,Fintype.sum_prod_type] rfl end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Mellin.VerticalContourShift namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace VerticalContourShift open Filter MeasureTheory open scoped Classical Topology lemma gaussian_regulator_norm (ε σ t : ℝ) : ‖Complex.exp ((ε:ℂ)*((σ:ℂ)+t*Complex.I)^2)‖=Real.exp (ε*(σ^2-t^2)) := by rw [Complex.norm_exp] congr 1 simp only [pow_two,Complex.mul_re,Complex.mul_im,Complex.add_re,Complex.add_im, Complex.ofReal_re,Complex.ofReal_im,Complex.I_re,Complex.I_im] ring lemma gaussian_regulator_norm_le (ε σ t : ℝ) (hε0 : 0≤ε) (hε1 : ε≤1) : ‖Complex.exp ((ε:ℂ)*((σ:ℂ)+t*Complex.I)^2)‖≤Real.exp (σ^2) := by rw [gaussian_regulator_norm] apply Real.exp_le_exp.mpr nlinarith [sq_nonneg σ,sq_nonneg t,mul_nonneg hε0 (sq_nonneg t), mul_nonneg (sub_nonneg.mpr hε1) (sq_nonneg σ)] def gaussianRegulatorSequence (n : ℕ) : ℝ := 1/((n:ℝ)+1) lemma gaussianRegulatorSequence_pos (n : ℕ) : 0∫t : ℝ, Complex.exp ((gaussianRegulatorSequence n:ℂ)*((σ:ℂ)+t*Complex.I)^2)*g t) atTop (𝓝 (∫t : ℝ,g t)) := by apply tendsto_integral_of_dominated_convergence (fun t : ℝ=>Real.exp (σ^2)*‖g t‖) · intro n have hc : Continuous (fun t : ℝ=> Complex.exp ((gaussianRegulatorSequence n:ℂ)*((σ:ℂ)+t*Complex.I)^2)) := by fun_prop exact hc.aestronglyMeasurable.mul hg.aestronglyMeasurable · exact hg.norm.const_mul _ · intro n exact Filter.Eventually.of_forall (fun t=>by rw [norm_mul] exact mul_le_mul_of_nonneg_right (gaussian_regulator_norm_le _ σ t (gaussianRegulatorSequence_pos n).le (gaussianRegulatorSequence_le_one n)) (norm_nonneg _)) · filter_upwards with t have hε : Tendsto (fun n : ℕ=>(gaussianRegulatorSequence n:ℂ)) atTop (𝓝 0) := by simpa only [Function.comp_def,Complex.ofReal_zero] using Complex.continuous_ofReal.continuousAt.tendsto.comp gaussianRegulatorSequence_tendsto have he := (Complex.continuous_exp.tendsto 0).comp (by simpa only [zero_mul] using hε.mul_const (((σ:ℂ)+t*Complex.I)^2)) simpa only [Function.comp_def,Complex.exp_zero,one_mul] using he.mul_const (g t) lemma rpow_between_endpoints (y a b σ : ℝ) (hy : 0‖(y:ℂ)^((a:ℂ)-1)*f y‖+‖(y:ℂ)^((b:ℂ)-1)*f y‖ have hB : IntegrableOn B (Set.Ioi 0) := by exact ha.norm.add hb.norm refine ⟨∫y in Set.Ioi 0,B y,integral_nonneg (fun y=>add_nonneg (norm_nonneg _) (norm_nonneg _)),?_⟩ intro s hsa hsb unfold mellin apply norm_integral_le_of_norm_le hB filter_upwards [ae_restrict_mem measurableSet_Ioi] with y hy change 0f ((a:ℂ)+t*Complex.I))) (hb : Integrable (fun t : ℝ=>f ((b:ℂ)+t*Complex.I))) (hbound : ∀σ∈Set.Icc a b,∀t : ℝ,‖f ((σ:ℂ)+t*Complex.I)‖≤B*Real.exp (A*|t|)) : (∫t : ℝ,f ((a:ℂ)+t*Complex.I))=∫t : ℝ,f ((b:ℂ)+t*Complex.I) := by let F : ℕ→ℂ→ℂ := fun n z=>Complex.exp ((gaussianRegulatorSequence n:ℂ)*z^2)*f z have hreg (n : ℕ) : Continuous (fun z : ℂ=>Complex.exp ((gaussianRegulatorSequence n:ℂ)*z^2)) := by fun_prop have hint (n : ℕ) (σ : ℝ) (hσ : Integrable (fun t : ℝ=>f ((σ:ℂ)+t*Complex.I))) : Integrable (fun t : ℝ=>F n ((σ:ℂ)+t*Complex.I)) := by apply hσ.bdd_mul (c:=Real.exp (σ^2)) · exact ((hreg n).comp (by fun_prop)).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun t=>gaussian_regulator_norm_le _ σ t (gaussianRegulatorSequence_pos n).le (gaussianRegulatorSequence_le_one n)) have heq (n : ℕ) : (∫t : ℝ,F n ((a:ℂ)+t*Complex.I))=∫t : ℝ,F n ((b:ℂ)+t*Complex.I) := by obtain ⟨K,hK,hdec⟩ := GaussianMoment.gaussian_regulator_strip_decay a b A B (gaussianRegulatorSequence n) hab hA hB (gaussianRegulatorSequence_pos n) f hbound apply integral_eq_of_strip_decay (F n) a b K hab · intro z hza hzb have hg : Differentiable ℂ (fun w : ℂ=>Complex.exp ((gaussianRegulatorSequence n:ℂ)*w^2)) := by fun_prop exact hg.differentiableAt.mul (hdiff z hza hzb) · exact hint n a ha · exact hint n b hb · exact hdec have hleft := gaussian_regulator_integral_tendsto (fun t : ℝ=>f ((a:ℂ)+t*Complex.I)) ha a have hright := gaussian_regulator_integral_tendsto (fun t : ℝ=>f ((b:ℂ)+t*Complex.I)) hb b change Tendsto (fun n=>∫t : ℝ,F n ((a:ℂ)+t*Complex.I)) atTop (𝓝 (∫t : ℝ,f ((a:ℂ)+t*Complex.I))) at hleft change Tendsto (fun n=>∫t : ℝ,F n ((b:ℂ)+t*Complex.I)) atTop (𝓝 (∫t : ℝ,f ((b:ℂ)+t*Complex.I))) at hright simp only [heq] at hleft exact tendsto_nhds_unique hleft hright end VerticalContourShift namespace CubicGammaExponential open scoped BigOperators Classical open MeasureTheory open Finset AddChar MulChar EisensteinEmbedding lemma norm_Gamma_le_real (z : ℂ) (hz : 0ha.trans_le hx.1) obtain ⟨C,hC⟩:=(isCompact_Icc : IsCompact (Set.Icc a b)).bddAbove_image hc refine ⟨|C|+1,by positivity,?_⟩ intro x hx exact (hC (Set.mem_image_of_mem _ hx)).trans (by linarith [le_abs_self C]) lemma inverse_Gamma_compact_strip_bound (a b : ℝ) : ∃C : ℝ,0 ‖(Complex.Gamma ((p.1:ℂ)+p.2*Complex.I))⁻¹‖) := (Complex.differentiable_one_div_Gamma.continuous.comp (by fun_prop)).norm obtain ⟨C,hC⟩:=((isCompact_Icc : IsCompact (Set.Icc a b)).prod (isCompact_Icc : IsCompact (Set.Icc (-1:ℝ) 1))).bddAbove_image hc.continuousOn refine ⟨|C|+1,by positivity,?_⟩ intro σ hσ t ht exact (hC ⟨(σ,t),⟨hσ,ht⟩,rfl⟩).trans (by linarith [le_abs_self C]) theorem inverse_Gamma_strip_exp_bound (a b : ℝ) : ∃C : ℝ,0 linarith [hs.1,hs.2]) have hb2:=h2 (s+2/3) (by norm_num;constructor <;> linarith [hs.1,hs.2]) norm_num at hb1 hb2 rw [mul_inv_rev,norm_mul,norm_inv,norm_inv] calc _ ≤ (C2*Real.exp (Real.pi*|s.im|))*(C1*Real.exp (Real.pi*|s.im|)) := mul_le_mul hb2 hb1 (by positivity) (by positivity) _ = C1*C2*Real.exp (2*Real.pi*|s.im|) := by rw [show 2*Real.pi*|s.im|=Real.pi*|s.im|+Real.pi*|s.im| by ring,Real.exp_add] ring end CubicGammaExponential open Filter MeasureTheory open scoped Classical BigOperators Topology namespace CubicEisenstein lemma cubic_bessel_mellin_norm_scale (s : ℂ) (r : ℝ) (hr : 0‖(v:ℂ)^(2*s)*schlafliBesselK (1/3) (4*Real.pi*v)‖ have hp (v : ℝ) (hv : 0‖a i‖*‖freq i‖^(-(2*s.re+1)))) : (∫v : ℝ in Set.Ioi 0,∑'i,a i*((v:ℂ)^(2*s)* schlafliBesselK (1/3) (4*Real.pi*‖freq i‖*v)))= ∑'i,a i*(((2:ℂ)^(2*s-1)*Complex.Gamma (s+1/3)*Complex.Gamma (s+2/3))/ ((4*Real.pi*‖freq i‖:ℝ):ℂ)^(2*s+1)) := by have hi (i : α) := (source_cubic_bessel_mellin_integrable s (freq i) hs (hf i)).const_mul (a i) have hsum : Summable (fun i=>∫v : ℝ in Set.Ioi 0, ‖a i*((v:ℂ)^(2*s)*schlafliBesselK (1/3) (4*Real.pi*‖freq i‖*v))‖) := by simp only [weighted_cubic_bessel_integral_norm s _ _ (hf _)] exact ha.mul_right _ rw [←integral_tsum_of_summable_integral_norm hi hsum] apply tsum_congr intro i rw [integral_const_mul,source_cubic_bessel_mellin s (freq i) hs (hf i)] end CubicEisenstein open Filter MeasureTheory open scoped Classical BigOperators Topology namespace CubicEisenstein lemma positive_sqrt_cpow_twice (r : ℝ) (hr : 0‖a i‖*(r i)^(1/2-s.re))) : mellin (radialBesselProfile r a q) (2*s)= (((2:ℂ)^(2*s-1)*Complex.Gamma (s+1/3)*Complex.Gamma (s+2/3))/ ((4*Real.pi*q:ℝ):ℂ)^(2*s+1))*(∑'i,a i*(r i:ℂ)^(1/2-s)) := by let f : α→ℂ := fun i=>((q*Real.sqrt (r i):ℝ):ℂ) have hf (i : α) : f i≠0 := Complex.ofReal_ne_zero.mpr (mul_pos hq (Real.sqrt_pos.mpr (hr i))).ne' have has : Summable (fun i=>‖a i*(r i:ℂ)‖*‖f i‖^(-(2*s.re+1))) := by simp only [f,radial_bessel_coefficient_norm _ q s.re (hr _) hq] exact ha.mul_left _ have hid := cubic_bessel_series_mellin f (fun i=>a i*(r i:ℂ)) hf s hs has calc _=(∫v : ℝ in Set.Ioi 0,∑'i,(a i*(r i:ℂ))*((v:ℂ)^(2*s)* schlafliBesselK (1/3) (4*Real.pi*‖f i‖*v))) := by unfold mellin apply setIntegral_congr_fun measurableSet_Ioi intro v hv dsimp only [radialBesselProfile] simp only [smul_eq_mul] rw [←tsum_mul_left] apply tsum_congr intro i have hp : (v:ℂ)^(2*s-1)*(v:ℂ)=(v:ℂ)^(2*s) := by calc _=(v:ℂ)^(2*s-1)*(v:ℂ)^1 := by rw [Complex.cpow_one] _=(v:ℂ)^((2*s-1)+1) := (Complex.cpow_add _ _ (Complex.ofReal_ne_zero.mpr hv.ne')).symm _=_ := by rw [sub_add_cancel] have hn : ‖f i‖=q*Real.sqrt (r i) := Complex.norm_of_nonneg (mul_pos hq (Real.sqrt_pos.mpr (hr i))).le rw [hn] have hk : 4*Real.pi*q*Real.sqrt (r i)*v=4*Real.pi*(q*Real.sqrt (r i))*v := by ring rw [hk] change (v:ℂ)^(2*s-1)*_=_ linear_combination (a i*(r i:ℂ))*schlafliBesselK (1/3) (4*Real.pi*(q*Real.sqrt (r i))*v)*hp _=_ := by rw [hid,←tsum_mul_left] apply tsum_congr intro i have hn : ‖f i‖=q*Real.sqrt (r i) := Complex.norm_of_nonneg (mul_pos hq (Real.sqrt_pos.mpr (hr i))).le rw [hn,show 4*Real.pi*(q*Real.sqrt (r i))=(4*Real.pi*q)*Real.sqrt (r i) by ring] exact radial_bessel_coefficient_identity (r i) (4*Real.pi*q) (hr i) (by positivity) (a i) _ s end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.BesselReflection /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CompletedGauss open Filter MeasureTheory open scoped Classical BigOperators Topology section open CubicEisenstein def completedBesselProfile (Ψ : ActualEisensteinCubic.O→*ℂ) (q : ℝ) : ℝ→ℂ := radialBesselProfile completedMellinLength (completedMellinCoefficient Ψ) q def besselMellinFactor (q : ℝ) (s : ℂ) : ℂ := ((2:ℂ)^(2*s-1)*Complex.Gamma (s+1/3)*Complex.Gamma (s+2/3))/ ((4*Real.pi*q:ℝ):ℂ)^(2*s+1) def inverseBesselMellinFactor (q : ℝ) (s : ℂ) : ℂ := ((4*Real.pi*q:ℝ):ℂ)^(2*s+1)*(2:ℂ)^(1-2*s)* (Complex.Gamma (s+1/3)*Complex.Gamma (s+2/3))⁻¹ theorem completedBesselProfile_mellin (Ψ : ActualEisensteinCubic.O→*ℂ) (hΨ : ∀a,‖Ψ a‖≤1) (q : ℝ) (hq : 0((4*Real.pi*q:ℝ):ℂ)^(2*s+1)) := (show Differentiable ℂ (fun s : ℂ=>2*s+1) from by fun_prop).const_cpow (Or.inl hq0) have h2 : Differentiable ℂ (fun s : ℂ=>(2:ℂ)^(1-2*s)) := (show Differentiable ℂ (fun s : ℂ=>1-2*s) from by fun_prop).const_cpow (Or.inl (by norm_num : (2:ℂ)≠0)) have h3 : Differentiable ℂ (fun s : ℂ=>(Complex.Gamma (s+1/3))⁻¹) := Complex.differentiable_one_div_Gamma.comp (by fun_prop) have h4 : Differentiable ℂ (fun s : ℂ=>(Complex.Gamma (s+2/3))⁻¹) := Complex.differentiable_one_div_Gamma.comp (by fun_prop) convert (h1.mul h2).mul (h4.mul h3) using 1 <;> first | rfl | (ext s; simp only [inverseBesselMellinFactor,Pi.mul_apply,mul_inv_rev]) theorem inverseBesselMellinFactor_strip_bound (q : ℝ) (hq : 0 ramifiedSourceFunction (ramifiedCuspRoot side:Eis) (upperPoint (z+(x:ℂ)*direction) v hv)) (∑'h:Eis,(ramifiedBesselCoefficients side).directionalTerm h (v/3) (z/3+(t:ℂ)*(direction/3)) (direction/3)) t := by have he : (fun x:ℝ => ramifiedSourceFunction (ramifiedCuspRoot side:Eis) (upperPoint (z+(x:ℂ)*direction) v hv)) = (fun x:ℝ => (ramifiedBesselCoefficients side).series (v/3,z/3+(x:ℂ)*(direction/3))) := by funext x rw [ramifiedSource_eq_series] congr 2 ring rw [he] exact (ramifiedBesselCoefficients side).series_horizontal_hasDerivAt (v/3) (by positivity) (z/3) (direction/3) t lemma ramifiedSource_wirtingerBar_cusp_decay (side:Bool) (a:ℝ) (ha:0 ramifiedSourceFunction (ramifiedCuspRoot side:Eis) (upperPoint w v hv)) z‖ ≤ C*Real.exp (-(residualCuspDecayRate/3)*v) := by obtain ⟨C1,hC1,h1b⟩ := (ramifiedBesselCoefficients side).directionalSeries_cusp_decay (a/3) (by positivity) (1/3) obtain ⟨CI,hCI,hIb⟩ := (ramifiedBesselCoefficients side).directionalSeries_cusp_decay (a/3) (by positivity) (Complex.I/3) refine ⟨(C1+CI)/2,by positivity,?_⟩ intro v hv z hav have h1 := (ramifiedSource_horizontal_hasDerivAt side v hv z 1 0).deriv have hI := (ramifiedSource_horizontal_hasDerivAt side v hv z Complex.I 0).deriv simp only [mul_one,Complex.ofReal_zero,zero_mul,add_zero] at h1 hI have he : -residualCuspDecayRate*(v/3)=-(residualCuspDecayRate/3)*v := by ring have hb1 := h1b (v/3) (z/3) (by linarith) have hbI := hIb (v/3) (z/3) (by linarith) rw [he] at hb1 hbI rw [horizontalWirtingerBar,h1,hI,norm_mul] have hhalf : ‖(1/2:ℂ)‖=(1/2:ℝ) := by norm_num rw [hhalf] calc _ ≤ (1/2:ℝ)*(‖∑'h:Eis,(ramifiedBesselCoefficients side).directionalTerm h (v/3) (z/3) (1/3)‖+ ‖Complex.I*(∑'h:Eis,(ramifiedBesselCoefficients side).directionalTerm h (v/3) (z/3) (Complex.I/3))‖) := mul_le_mul_of_nonneg_left (norm_add_le _ _) (by norm_num) _ = (1/2:ℝ)*(‖∑'h:Eis,(ramifiedBesselCoefficients side).directionalTerm h (v/3) (z/3) (1/3)‖+ ‖∑'h:Eis,(ramifiedBesselCoefficients side).directionalTerm h (v/3) (z/3) (Complex.I/3)‖) := by rw [norm_mul,Complex.norm_I,one_mul] _ ≤ (1/2:ℝ)*(C1*Real.exp (-(residualCuspDecayRate/3)*v)+ CI*Real.exp (-(residualCuspDecayRate/3)*v)) := mul_le_mul_of_nonneg_left (add_le_add hb1 hbI) (by norm_num) _ = _ := by ring lemma ramifiedConjugate_zProfile_isBigO (side:Bool) (z:ℂ) : cuspZProfile (fun w => cubicSourceConjugateFunction (integralComplexMatrix (lowerCuspMatrix (ramifiedCuspRoot side:Eis)) • w)) z =O[atTop] (fun v:ℝ => Real.exp (-(residualCuspDecayRate/3)*v)) := by obtain ⟨C,hC,hb⟩ := ramifiedSource_wirtingerBar_cusp_decay side 1 (by norm_num) apply Asymptotics.IsBigO.of_bound C filter_upwards [eventually_ge_atTop (1:ℝ)] with v hv have hvp:0 star (ramifiedSourceFunction (ramifiedCuspRoot side:Eis) (upperPoint w v hvp))) z‖ ≤ _ rw [horizontalWirtingerZ_star,norm_star] exact hb v hvp z hv end namespace RootNotationBesselReflection02 abbrev Eis := ActualEisensteinCubic.O end RootNotationBesselReflection02 open RootNotationBesselReflection02 (Eis) lemma reflectedCuspProfile_eq_inv_square (A:ℂ) (Q:ℝ) (g:ℝ→ℂ) (v:ℝ) : reflectedCuspProfile A Q g v=A/(v:ℂ)^2*g ((Q*v)⁻¹) := by unfold reflectedCuspProfile rw [Complex.cpow_neg,Complex.cpow_ofNat] ring lemma reflectedCuspProfile_reverse (A:ℂ) (hA:A≠0) (Q:ℝ) (hQ:0Real.exp (-decayF*v))) (hgbound:g =O[atTop] (fun v:ℝ=>Real.exp (-decayG*v))) (hfg:∀v:ℝ,0(hc P).1)) _=I':=Ideal.prod_normalizedFactors_eq_self hI'.ne_zero · calc J=(normalizedFactors J).prod:=(Ideal.prod_normalizedFactors_eq_self hJ).symm _=(normalizedFactors J').prod:=congrArg Multiset.prod (Multiset.ext.mpr (fun P=>(hc P).2)) _=J':=Ideal.prod_normalizedFactors_eq_self hJ' theorem primary_squarefree_cube_eq_iff {I J I' J':Ideal Eis} (hI:Squarefree I) (hI':Squarefree I') (hgI:primaryGenerator I≠0) (hgJ:primaryGenerator J≠0) (hgI':primaryGenerator I'≠0) (hgJ':primaryGenerator J'≠0) : primaryGenerator I*(primaryGenerator J)^3= primaryGenerator I'*(primaryGenerator J')^3 ↔ I=I' ∧ J=J' := by constructor · intro h have hleft:primaryGenerator (I*J^3)≠0:=by rw [primaryGenerator_mul,CubicEisenstein.primaryGenerator_pow] exact mul_ne_zero hgI (pow_ne_zero _ hgJ) have hright:primaryGenerator (I'*J'^3)≠0:=by rw [primaryGenerator_mul,CubicEisenstein.primaryGenerator_pow] exact mul_ne_zero hgI' (pow_ne_zero _ hgJ') have he:I*J^3=I'*J'^3:=by calc I*J^3=Ideal.span {primaryGenerator (I*J^3)}:=(primaryGenerator_spec _ hleft).1.symm _=Ideal.span {primaryGenerator (I'*J'^3)}:=by apply congrArg (fun z:Eis => (Ideal.span {z}:Ideal Eis)) simpa only [primaryGenerator_mul,CubicEisenstein.primaryGenerator_pow] using h _=I'*J'^3:=(primaryGenerator_spec _ hright).1 exact squarefree_cube_decomposition_unique (primaryGenerator_ne_zero_ideal J hgJ) (primaryGenerator_ne_zero_ideal J' hgJ') hI hI' he · rintro ⟨rfl,rfl⟩ rfl theorem primary_squarefree_cube_injective : Function.Injective (fun x: {I:Ideal Eis // Squarefree I ∧ primaryGenerator I≠0} × {J:Ideal Eis // primaryGenerator J≠0} => primaryGenerator x.1.val*(primaryGenerator x.2.val)^3) := by intro x y he have h:= (primary_squarefree_cube_eq_iff x.1.property.1 y.1.property.1 x.1.property.2 x.2.property y.1.property.2 y.2.property).mp he exact Prod.ext (Subtype.ext h.1) (Subtype.ext h.2) end open Filter MeasureTheory open scoped Classical BigOperators Topology ContDiff def besselSmoothingIntegrand (F : ℝ→ℂ) (q : ℝ) (V : ℝ→ℂ) (X : ℝ) (s : ℂ) : ℂ := mellin V (s-1/2)*(X:ℂ)^(s-1/2)*continuedBesselDirichlet F q s lemma besselSmoothingIntegrand_differentiable (F : ℝ→ℂ) (q : ℝ) (hq : 0s-1/2) from by fun_prop) have hp : Differentiable ℂ (fun s : ℂ=>(X:ℂ)^(s-1/2)) := (show Differentiable ℂ (fun s : ℂ=>s-1/2) from by fun_prop).const_cpow (Or.inl (Complex.ofReal_ne_zero.mpr hX.ne')) exact (hm.mul hp).mul (continuedBesselDirichlet_differentiable F q hq hF) lemma besselSmoothingIntegrand_strip_bound (F : ℝ→ℂ) (q : ℝ) (hq : 0besselSmoothingIntegrand F q V X ((lo:ℂ)+t*Complex.I))) (hh : Integrable (fun t : ℝ=>besselSmoothingIntegrand F q V X ((hi:ℂ)+t*Complex.I))) : (∫t : ℝ,besselSmoothingIntegrand F q V X ((lo:ℂ)+t*Complex.I))= ∫t : ℝ,besselSmoothingIntegrand F q V X ((hi:ℂ)+t*Complex.I) := by obtain ⟨C,hC,hb⟩ := besselSmoothingIntegrand_strip_bound F q hq lo hi hF V a b ha hVs hV X hX apply VerticalContourShift.integral_eq_of_exponential_strip_growth (besselSmoothingIntegrand F q V X) lo hi (2*Real.pi) C hlh (by positivity) hC · intro z hz1 hz2 exact (besselSmoothingIntegrand_differentiable F q hq hFe V a b ha hVs hV X hX) z · exact hl · exact hh · intro σ hσ t simpa only [Complex.add_re,Complex.ofReal_re,Complex.mul_re,Complex.ofReal_im, Complex.I_re,Complex.I_im,zero_mul,mul_zero,sub_zero,add_zero, Complex.add_im,Complex.mul_im,mul_one,zero_add] using hb ((σ:ℂ)+t*Complex.I) (by simpa using hσ) theorem completedT_mellin_shift (Ψ : ActualEisensteinCubic.O→*ℂ) (hΨ : ∀a,‖Ψ a‖≤1) (q : ℝ) (hq : 0 besselSmoothingIntegrand (completedBesselProfile Ψ q) q (Vstar W) X ((lo:ℂ)+t*Complex.I))) : completedT Ψ W X=(1/(2*Real.pi):ℂ)*∫t : ℝ, besselSmoothingIntegrand (completedBesselProfile Ψ q) q (Vstar W) X ((lo:ℂ)+t*Complex.I) := by have hid (t : ℝ) : besselSmoothingIntegrand (completedBesselProfile Ψ q) q (Vstar W) X ((2:ℂ)+t*Complex.I)= mellin (Vstar W) ((3/2:ℂ)+t*Complex.I)*(X:ℂ)^((3/2:ℂ)+t*Complex.I)* completedDirichletSeries Ψ ((2:ℂ)+t*Complex.I) := by rw [besselSmoothingIntegrand,continuedBesselDirichlet_eq_initial Ψ hΨ q hq _ (by norm_num)] rw [show (2:ℂ)+t*Complex.I-1/2=3/2+t*Complex.I by ring] have hr : Integrable (fun t : ℝ=> besselSmoothingIntegrand (completedBesselProfile Ψ q) q (Vstar W) X ((2:ℂ)+t*Complex.I)) := by simp only [hid] exact completedT_initial_mellin_integrable Ψ hΨ W a b ha hWs hW X hX have he := besselSmoothingIntegrand_contour_eq (completedBesselProfile Ψ q) q hq hF hFe (Vstar W) a b ha (Vstar_support W a b hWs) (Vstar_contDiff W a b ha hWs hW) X hX lo 2 hl hleft hr rw [he] simpa only [Complex.ofReal_ofNat,hid] using completedT_initial_mellin Ψ hΨ W a b ha hWs hW X hX end CompletedGauss open Filter MeasureTheory open scoped Classical BigOperators Topology namespace CompletedGauss open CubicEisenstein def besselReflectionFactor (q d : ℝ) (s : ℂ) : ℂ := ((4*Real.pi*q:ℝ):ℂ)^(2*s+1)*(2:ℂ)^(2-4*s)/ ((4*Real.pi*d:ℝ):ℂ)^(3-2*s) lemma besselMellinFactor_reflection (q d : ℝ) (s : ℂ) : inverseBesselMellinFactor q s*besselMellinFactor d (1-s)= besselReflectionFactor q d s*CubicReflectionKernel.gammaMultiplier (1/2-s) := by have hp : (2:ℂ)^(1-2*s)*(2:ℂ)^(1-2*s)=(2:ℂ)^(2-4*s) := by rw [←Complex.cpow_add _ _ (by norm_num : (2:ℂ)≠0)] congr 1 ring unfold inverseBesselMellinFactor besselMellinFactor besselReflectionFactor CubicReflectionKernel.gammaMultiplier rw [show (2:ℂ)*(1-s)-1=1-2*s by ring, show (2:ℂ)*(1-s)+1=3-2*s by ring, show (1:ℂ)-s+1/3=4/3-s by ring, show (1:ℂ)-s+2/3=5/3-s by ring, show (7/6:ℂ)+(1/2-s)=5/3-s by ring, show (5/6:ℂ)+(1/2-s)=4/3-s by ring, show (7/6:ℂ)-(1/2-s)=s+2/3 by ring, show (5/6:ℂ)-(1/2-s)=s+1/3 by ring] have he := congrArg (fun z : ℂ=> (((4*Real.pi*q:ℝ):ℂ)^(2*s+1)* (Complex.Gamma (s+1/3))⁻¹*(Complex.Gamma (s+2/3))⁻¹* Complex.Gamma (4/3-s)*Complex.Gamma (5/3-s)* (((4*Real.pi*d:ℝ):ℂ)^(3-2*s))⁻¹)*z) hp simp only [div_eq_mul_inv,mul_inv_rev] at he ⊢ linear_combination he lemma besselReflectionFactor_norm (q d : ℝ) (hq : 0‖a i‖*(r i)^(s.re-1/2))) : continuedBesselDirichlet F q s= (A*(Q:ℂ)^(2-2*s)*besselReflectionFactor q d s)* CubicReflectionKernel.gammaMultiplier (1/2-s)* (∑'i,a i*(r i:ℂ)^(s-1/2)) := by have hs' : -(1/3)<(1-s).re := by simp;linarith have ha' : Summable (fun i=>‖a i‖*(r i)^(1/2-(1-s).re)) := by convert ha using 1 funext i congr 2 simp ring have hm := radialBesselProfile_mellin r hr a d hd (1-s) hs' ha' have hc := cusp_mellin_reflection_of_identity F (radialBesselProfile r a d) A s Q hQ hreflect have hm' : mellin (radialBesselProfile r a d) (2-2*s)= besselMellinFactor d (1-s)*(∑'i,a i*(r i:ℂ)^(s-1/2)) := by calc _=mellin (radialBesselProfile r a d) (2*(1-s)) := by congr 1;ring _=_ := by simpa only [besselMellinFactor,show (1/2:ℂ)-(1-s)=s-1/2 by ring] using hm rw [hm'] at hc rw [continuedBesselDirichlet,hc] calc _=A*(Q:ℂ)^(2-2*s)*(inverseBesselMellinFactor q s*besselMellinFactor d (1-s))* (∑'i,a i*(r i:ℂ)^(s-1/2)) := by ring _=_ := by rw [besselMellinFactor_reflection];ring end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.MellinSupport namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CompletedGauss lemma cubeWeight_zero_of_primaryGenerator_zero (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (I:Ideal _root_.OAI.ActualEisensteinCubic.O) (h:primaryGenerator I=0) : cubeWeight Ψ I=0 := by simp [cubeWeight,h,FiniteGaussPhase.angularFactor] lemma completedMellinCoefficient_support (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (p:CompletedMellinIndex) (hp:completedMellinCoefficient Ψ p≠0) : Squarefree p.1.val ∧ primaryGenerator p.1.val≠0 ∧ primaryGenerator p.2.val≠0 := by have hleft:Squarefree p.1.val ∧ primaryGenerator p.1.val≠0 := by by_contra hh apply hp simp only [completedMellinCoefficient,columnWeight,squarefreeGaussCoefficient, dif_neg hh,zero_mul,zero_div] refine ⟨hleft.1,hleft.2,?_⟩ intro hright apply hp rw [completedMellinCoefficient,cubeWeight_zero_of_primaryGenerator_zero Ψ _ hright,mul_zero] def primaryCubePairToMellinIndex (p:({I:Ideal _root_.OAI.ActualEisensteinCubic.O // Squarefree I ∧ primaryGenerator I≠0} × {J:Ideal _root_.OAI.ActualEisensteinCubic.O // primaryGenerator J≠0})) : CompletedMellinIndex := (⟨p.1.val,p.1.property.1.ne_zero⟩, ⟨p.2.val,primaryGenerator_ne_zero_ideal p.2.val p.2.property⟩) lemma primaryCubePairToMellinIndex_injective : Function.Injective primaryCubePairToMellinIndex := by intro p q hpq exact Prod.ext (Subtype.ext (congrArg (fun x:CompletedMellinIndex=>x.1.val) hpq)) (Subtype.ext (congrArg (fun x:CompletedMellinIndex=>x.2.val) hpq)) theorem completedMellinCoefficient_tsum_primary_pairs (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (w:CompletedMellinIndex→ℂ) : (∑'p:CompletedMellinIndex,completedMellinCoefficient Ψ p*w p)= ∑'p:({I:Ideal _root_.OAI.ActualEisensteinCubic.O // Squarefree I ∧ primaryGenerator I≠0} × {J:Ideal _root_.OAI.ActualEisensteinCubic.O // primaryGenerator J≠0}), completedMellinCoefficient Ψ (primaryCubePairToMellinIndex p)* w (primaryCubePairToMellinIndex p) := by apply tsum_eq_tsum_of_ne_zero_bij (fun p=>primaryCubePairToMellinIndex p.val) · exact primaryCubePairToMellinIndex_injective.comp Subtype.val_injective · intro p hp change completedMellinCoefficient Ψ p*w p≠0 at hp have hc:completedMellinCoefficient Ψ p≠0 := by intro hz exact hp (by rw [hz,zero_mul]) obtain ⟨hs,hI,hJ⟩:=completedMellinCoefficient_support Ψ p hc let q:({I:Ideal _root_.OAI.ActualEisensteinCubic.O // Squarefree I ∧ primaryGenerator I≠0} × {J:Ideal _root_.OAI.ActualEisensteinCubic.O // primaryGenerator J≠0}):=(⟨p.1.val,hs,hI⟩,⟨p.2.val,hJ⟩) have hq:primaryCubePairToMellinIndex q=p := by exact Prod.ext (Subtype.ext rfl) (Subtype.ext rfl) refine ⟨⟨q,?_⟩,hq⟩ change completedMellinCoefficient Ψ (primaryCubePairToMellinIndex q)* w (primaryCubePairToMellinIndex q)≠0 simpa only [hq] using hp · intro p rfl theorem completedBesselProfile_primary_pairs (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (q v:ℝ) : completedBesselProfile Ψ q v= ∑'p:({I:Ideal _root_.OAI.ActualEisensteinCubic.O // Squarefree I ∧ primaryGenerator I≠0} × {J:Ideal _root_.OAI.ActualEisensteinCubic.O // primaryGenerator J≠0}), (completedMellinCoefficient Ψ (primaryCubePairToMellinIndex p)* (completedMellinLength (primaryCubePairToMellinIndex p):ℂ))*(v:ℂ)* CubicEisenstein.schlafliBesselK (1/3) (4*Real.pi*q*Real.sqrt (completedMellinLength (primaryCubePairToMellinIndex p))*v) := by unfold completedBesselProfile CubicEisenstein.radialBesselProfile simpa only [mul_assoc] using completedMellinCoefficient_tsum_primary_pairs Ψ (fun p=>(completedMellinLength p:ℂ)*(v:ℂ)*CubicEisenstein.schlafliBesselK (1/3) (4*Real.pi*q*Real.sqrt (completedMellinLength p)*v)) end CompletedGauss namespace CubicEisenstein open Filter MeasureTheory Asymptotics open scoped BigOperators Classical Topology MatrixGroups section open CubicKubota EisensteinCuspModThree lemma cubicSourceConjugateFunction_levelTwo (G:levelTwo) (w:HyperbolicSpace) : cubicSourceConjugateFunction (integralComplexMatrix (G:SL(2,_root_.OAI.ActualEisensteinCubic.O)) • w)= star (levelTwoComplexCharacter G)*cubicSourceConjugateFunction w := by simp only [cubicSourceConjugateFunction,cubicSourceResidualFunction_automorphy,star_mul] ring theorem cubicSourceConjugateFunction_cuspDerivative_levelTwo (G:levelTwo) (g H:SL(2,ℂ)) (hfactor:g=integralComplexMatrix (G:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) (hc:g 1 0≠0) (v:ℝ) (hv:0cubicSourceConjugateFunction (upperPoint z v hv)) (g 0 0/g 1 0)= (star (levelTwoComplexCharacter G)*(-1/((g 1 0)^2*(v:ℂ)^2)))* horizontalWirtingerZ (fun z=>cubicSourceConjugateFunction (H • upperPoint z (1/(‖g 1 0‖^2*v)) (by positivity))) (-g 1 1/g 1 0) := by refine cuspDerivative_of_transform cubicSourceConjugateFunction g H (star (levelTwoComplexCharacter G)) ?_ hc v hv ?_ · intro w rw [hfactor,mul_smul,cubicSourceConjugateFunction_levelTwo] · exact cubicSourceConjugateFunction_translate_split_differentiableAt H _ (by positivity) lemma cuspBarProfile_conjugate_reflection_levelTwo (G:levelTwo) (g H:SL(2,ℂ)) (hfactor:g=integralComplexMatrix (G:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) (hc:g 1 0≠0) (v:ℝ) (hv:0cubicSourceConjugateFunction (H • w)) (-g 1 1/g 1 0)) v := by have hdual:0<(‖g 1 0‖^2*v)⁻¹ := by positivity rw [cuspBarProfile_positive _ _ _ hv,reflectedCuspProfile,cuspZProfile_positive _ _ _ hdual] have he:=cubicSourceConjugateFunction_cuspDerivative_levelTwo G g H hfactor hc v hv have hp:(v:ℂ)^(-2:ℂ)=((v:ℂ)^2)⁻¹ := by rw [Complex.cpow_neg,Complex.cpow_ofNat] rw [hp] simp only [one_div] at he rw [he] ring lemma conjugateSource_cuspRepresentative_zProfile_decay (j:Fin 3) (z:ℂ) : ∃deltaLoss:ℝ,0cubicSourceConjugateFunction (integralComplexMatrix (cuspRepresentative j) • w)) z =O[atTop] (fun v:ℝ=>Real.exp (-deltaLoss*v)) := by fin_cases j · refine ⟨residualCuspDecayRate,residualCuspDecayRate_pos,?_⟩ simpa [cuspRepresentative,cuspParameter,lowerCuspMatrix_zero] using cuspZProfile_conjugate_isBigO z · refine ⟨residualCuspDecayRate/3,div_pos residualCuspDecayRate_pos (by norm_num),?_⟩ simpa [cuspRepresentative,cuspParameter,ramifiedCuspRoot,ramifiedOmegaUnit_val] using ramifiedConjugate_zProfile_isBigO false z · refine ⟨residualCuspDecayRate/3,div_pos residualCuspDecayRate_pos (by norm_num),?_⟩ simpa [cuspRepresentative,cuspParameter,ramifiedCuspRoot,ramifiedOmegaUnit_val] using ramifiedConjugate_zProfile_isBigO true z theorem conjugateSource_levelTwo_three_cusp_mellin_entire (G:levelTwo) (j:Fin 3) (g:SL(2,ℂ)) (hfactor:g=integralComplexMatrix (G:SL(2,_root_.OAI.ActualEisensteinCubic.O))*integralComplexMatrix (cuspRepresentative j)) (hc:g 1 0≠0) : ((∀s:ℂ,MellinConvergent (cuspBarProfile cubicSourceConjugateFunction (g 0 0/g 1 0)) s) ∧ Differentiable ℂ (mellin (cuspBarProfile cubicSourceConjugateFunction (g 0 0/g 1 0)))) ∧ ((∀s:ℂ,MellinConvergent (cuspZProfile (fun w=>cubicSourceConjugateFunction (integralComplexMatrix (cuspRepresentative j) • w)) (-g 1 1/g 1 0)) s) ∧ Differentiable ℂ (mellin (cuspZProfile (fun w=>cubicSourceConjugateFunction (integralComplexMatrix (cuspRepresentative j) • w)) (-g 1 1/g 1 0)))) := by have hchar:levelTwoComplexCharacter G≠0 := by intro hz have hn:=norm_levelTwoComplexCharacter G rw [hz,norm_zero] at hn exact zero_ne_one hn have hscalar:-star (levelTwoComplexCharacter G)/(g 1 0)^2≠0 := div_ne_zero (neg_ne_zero.mpr (star_ne_zero.mpr hchar)) (pow_ne_zero 2 hc) obtain ⟨deltaLoss,hδ,hb⟩:=conjugateSource_cuspRepresentative_zProfile_decay j (-g 1 1/g 1 0) exact cusp_mellin_entire_both (cuspBarProfile cubicSourceConjugateFunction (g 0 0/g 1 0)) (cuspZProfile (fun w=>cubicSourceConjugateFunction (integralComplexMatrix (cuspRepresentative j) • w)) (-g 1 1/g 1 0)) (-star (levelTwoComplexCharacter G)/(g 1 0)^2) hscalar (‖g 1 0‖^2) residualCuspDecayRate deltaLoss (sq_pos_of_pos (norm_pos_iff.mpr hc)) residualCuspDecayRate_pos hδ (cuspBarProfile_conjugate_continuousOn _) (cuspZProfile_conjugate_translate_continuousOn _ _) (cuspBarProfile_conjugate_isBigO _) hb (fun v hv=>cuspBarProfile_conjugate_reflection_levelTwo G g _ hfactor hc v hv) end open CubicKubota EisensteinCuspModThree ConcreteTraceCRT lemma upper_triangular_right_cusp_ratio (g T:SL(2,ℂ)) (hT:T 1 0=0) (hc:(g*T) 1 0≠0) : g 1 0≠0 ∧ (g*T) 0 0/(g*T) 1 0=g 0 0/g 1 0 := by have hcol (i:Fin 2) : (g*T) i 0=g i 0*T 0 0 := by change (∑k:Fin 2,g i k*T k 0)=_ rw [Fin.sum_univ_two,hT,mul_zero,add_zero] have hn:g 1 0*T 0 0≠0:=by rwa [hcol] at hc have hg: g 1 0≠0:=(mul_ne_zero_iff.mp hn).1 have ht:T 0 0≠0:=(mul_ne_zero_iff.mp hn).2 refine ⟨hg,?_⟩ rw [hcol,hcol] field_simp theorem conjugateSource_integral_cusp_mellin_entire (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) (hc:M 1 0≠0) : (∀s:ℂ,MellinConvergent (cuspBarProfile cubicSourceConjugateFunction (eisEmbedding (M 0 0)/eisEmbedding (M 1 0))) s) ∧ Differentiable ℂ (mellin (cuspBarProfile cubicSourceConjugateFunction (eisEmbedding (M 0 0)/eisEmbedding (M 1 0)))) := by obtain ⟨G,j,T,hT,_,_,hM⟩:=three_cusp_decomposition M let g:SL(2,ℂ):=integralComplexMatrix (G:SL(2,_root_.OAI.ActualEisensteinCubic.O))*integralComplexMatrix (cuspRepresentative j) have he:integralComplexMatrix M=g*integralComplexMatrix T:=by rw [hM,map_mul,map_mul] have ht:integralComplexMatrix T 1 0=0:=by rw [integralComplexMatrix_apply,hT,map_zero] have hmc:(g*integralComplexMatrix T) 1 0≠0:=by rw [←he,integralComplexMatrix_apply] exact eisEmbedding_ne_zero hc obtain ⟨hg,hratio⟩:=upper_triangular_right_cusp_ratio g (integralComplexMatrix T) ht hmc have hresult:=(conjugateSource_levelTwo_three_cusp_mellin_entire G j g rfl hg).1 rw [←hratio,←he] at hresult simpa only [integralComplexMatrix_apply] using hresult lemma exists_integral_matrix_cusp_ratio (a c:_root_.OAI.ActualEisensteinCubic.O) (hc:c≠0) : ∃M:SL(2,_root_.OAI.ActualEisensteinCubic.O),M 1 0≠0 ∧ eisEmbedding (M 0 0)/eisEmbedding (M 1 0)=eisEmbedding a/eisEmbedding c := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let d:_root_.OAI.ActualEisensteinCubic.O:=IsBezout.gcd a c obtain ⟨a',ha⟩:=IsBezout.gcd_dvd_left a c obtain ⟨c',hc'⟩:=IsBezout.gcd_dvd_right a c change a=d*a' at ha change c=d*c' at hc' have hd:d≠0:=by intro hz exact hc (by rw [hc',hz,zero_mul]) have hcp:c'≠0:=by intro hz exact hc (by rw [hc',hz,mul_zero]) obtain ⟨u,v,huv⟩:=IsBezout.gcd_eq_sum a c change u*a+v*c=d at huv have hred:u*a'+v*c'=1:=by apply mul_left_cancel₀ hd calc d*(u*a'+v*c')=u*a+v*c:=by rw [ha,hc'];ring _=d:=huv _=d*1:=(mul_one d).symm let M:SL(2,_root_.OAI.ActualEisensteinCubic.O):=⟨!![a',-v;c',u],by rw [Matrix.det_fin_two_of] linear_combination hred⟩ refine ⟨M,hcp,?_⟩ change eisEmbedding a'/eisEmbedding c'=eisEmbedding a/eisEmbedding c rw [ha,hc',map_mul,map_mul] have hde:eisEmbedding d≠0:=eisEmbedding_ne_zero hd have hce:eisEmbedding c'≠0:=eisEmbedding_ne_zero hcp field_simp theorem conjugateSource_rational_cusp_mellin_entire (a c:_root_.OAI.ActualEisensteinCubic.O) (hc:c≠0) : (∀s:ℂ,MellinConvergent (cuspBarProfile cubicSourceConjugateFunction (eisEmbedding a/eisEmbedding c)) s) ∧ Differentiable ℂ (mellin (cuspBarProfile cubicSourceConjugateFunction (eisEmbedding a/eisEmbedding c))) := by obtain ⟨M,hM,hratio⟩:=exists_integral_matrix_cusp_ratio a c hc simpa only [hratio] using conjugateSource_integral_cusp_mellin_entire M hM theorem conjugateSource_finite_twist_cusp_mellin_entire (h c:_root_.OAI.ActualEisensteinCubic.O) (hc:c≠0) : (∀s:ℂ,MellinConvergent (cuspBarProfile cubicSourceConjugateFunction (-3*eisEmbedding h/eisEmbedding c)) s) ∧ Differentiable ℂ (mellin (cuspBarProfile cubicSourceConjugateFunction (-3*eisEmbedding h/eisEmbedding c))) := by simpa only [map_mul,map_neg,map_ofNat] using conjugateSource_rational_cusp_mellin_entire (-3*h) c hc end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal def signedOmegaUnitsFintype : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units def signedOmegaUnit (s:Bool) (j:Fin 3) :_root_.OAI.ActualEisensteinCubic.Oˣ := if s then -(ramifiedOmegaUnit^j.val) else ramifiedOmegaUnit^j.val lemma signedOmegaUnit_val (s:Bool) (j:Fin 3) : (signedOmegaUnit s j:_root_.OAI.ActualEisensteinCubic.O)=if s then -(omega^j.val) else omega^j.val := by cases s <;> simp [signedOmegaUnit,ramifiedOmegaUnit_val] lemma signedOmegaUnit_surjective : Function.Surjective (fun p:Bool×Fin 3=>signedOmegaUnit p.1 p.2) := by intro u obtain ⟨j,hj|hj⟩:=unit_eq_sign_omega u · refine ⟨(false,j),Units.ext ?_⟩ simpa only [signedOmegaUnit_val,Bool.false_eq_true,ite_false] using hj.symm · refine ⟨(true,j),Units.ext ?_⟩ simpa only [signedOmegaUnit_val,ite_true] using hj.symm def signedOmegaEquiv : (Bool×Fin 3)≃_root_.OAI.ActualEisensteinCubic.Oˣ := letI : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := signedOmegaUnitsFintype Equiv.ofBijective (fun p=>signedOmegaUnit p.1 p.2) ((Fintype.bijective_iff_surjective_and_card _).mpr ⟨signedOmegaUnit_surjective,by have hc:Fintype.card _root_.OAI.ActualEisensteinCubic.Oˣ=6:=by simpa only [Nat.card_eq_fintype_card] using PrimaryIdealUnitReindex.card_units_eq_six simp [hc]⟩) lemma cubicSymbol_norm_one (c n:_root_.OAI.ActualEisensteinCubic.O) (hn:lambda^2∣n-1) (hc:IsCoprime c n) : ‖eisEmbedding (symbol c n)‖=1 := by have hcube:(eisEmbedding (symbol c n))^3=1:=by rw [←map_pow,symbol_cube_of_isCoprime c n hn hc,map_one] apply (pow_left_inj₀ (norm_nonneg _) zero_le_one (by decide : (3:ℕ)≠0)).mp simpa only [norm_pow,norm_one,one_pow] using congrArg norm hcube lemma arithmeticResidueSum_norm_mul_primary (h n:_root_.OAI.ActualEisensteinCubic.O) (hn:lambda^2∣n-1) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (r:ℕ) (hr:2≤r) : ‖arithmeticResidueSum (h*n) (u.val*lambda^r)‖= ‖arithmeticResidueSum h (u.val*lambda^r)‖ := by have hc: IsCoprime (u.val*lambda^r) n := (ramified_primary_coprime u r n hn).of_mul_left_right have he:=congrArg norm (arithmeticResidueSum_frequency_twist h (u.val*lambda^r) n (ramifiedElement_ne_zero u r) (ramifiedElement_level u r hr) ⟨hc,three_dvd_lambda_sq.trans hn⟩) simpa only [norm_mul,cubicSymbol_norm_one _ n hn hc,one_mul] using he def lowRamifiedFrequency (a r:Fin 3) : _root_.OAI.ActualEisensteinCubic.O := omega^a.val*lambda^(r.val+2) lemma lowRamifiedFrequency_ne_zero (a r:Fin 3) : lowRamifiedFrequency a r≠0 := by simpa only [lowRamifiedFrequency,←ramifiedOmegaUnit_val,←Units.val_pow_eq_pow_val] using ramifiedElement_ne_zero (ramifiedOmegaUnit^a.val) (r.val+2) lemma lowRamifiedFrequency_absNorm (a r:Fin 3) : Ideal.absNorm (Ideal.span {lowRamifiedFrequency a r})=3^(r.val+2) := by simpa only [lowRamifiedFrequency,←ramifiedOmegaUnit_val,←Units.val_pow_eq_pow_val] using ramifiedElement_absNorm (ramifiedOmegaUnit^a.val) (r.val+2) lemma lowRamifiedFrequency_arithmetic_vanish (a r:Fin 3) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (k:ℕ) (hk:5≤k) : arithmeticResidueSum (lowRamifiedFrequency a r) (u.val*lambda^(k+2))=0 := by by_contra hA have hb:=ramified_arithmetic_norm_bound _ (lowRamifiedFrequency_ne_zero a r) u (k+2) (by omega) hA rw [lowRamifiedFrequency_absNorm] at hb have hlo:(3:ℕ)^7≤3^(k+2):=Nat.pow_le_pow_right (by decide) (by omega) have hhi:(3:ℕ)^(r.val+2)≤3^4:=Nat.pow_le_pow_right (by decide) (by omega) norm_num at hlo hhi omega lemma lowRamifiedFrequency_primary_vanish (a r:Fin 3) (n:_root_.OAI.ActualEisensteinCubic.O) (hn:lambda^2∣n-1) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (k:ℕ) (hk:5≤k) : arithmeticResidueSum (lowRamifiedFrequency a r*n) (u.val*lambda^(k+2))=0 := by apply norm_eq_zero.mp rw [arithmeticResidueSum_norm_mul_primary _ n hn u (k+2) (by omega), lowRamifiedFrequency_arithmetic_vanish a r u k hk,norm_zero] end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal def ramifiedCoordMul (x y:ℤ×ℤ) :ℤ×ℤ := (x.1*y.1-x.2*y.2,x.1*y.2+x.2*y.1-x.2*y.2) def ramifiedCoordPow (x:ℤ×ℤ) :ℕ→ℤ×ℤ | 0=>(1,0) | n+1=>ramifiedCoordMul (ramifiedCoordPow x n) x def lowRamifiedQuotientCoord (a r:Fin 3) (s:Bool) (j:Fin 3) (n:Fin 5) :ℤ×ℤ := let z:=ramifiedCoordMul (ramifiedCoordPow (0,1) (a.val+5-j.val)) (ramifiedCoordPow (-1,1) (r.val+2-n.val)) if s then z else (-z.1,-z.2) def lowRamifiedSupport (a r:Fin 3) (p:Bool×Fin 3×Fin 5) :Prop := p.2.2.val≤r.val+2 ∧ let z:=lowRamifiedQuotientCoord a r p.1 p.2.1 p.2.2 (3:ℤ)∣2*(p.2.1.val:ℤ)+(p.2.2.val+2:ℕ)+z.2 ∧ (3:ℤ)∣2*(p.2.1.val:ℤ)+z.1-z.2 def lowRamifiedSupport_decidable (a r:Fin 3) (p:Bool×Fin 3×Fin 5) : Decidable (lowRamifiedSupport a r p) := inferInstanceAs (Decidable (p.2.2.val≤r.val+2 ∧ (3:ℤ)∣2*(p.2.1.val:ℤ)+(p.2.2.val+2:ℕ)+(lowRamifiedQuotientCoord a r p.1 p.2.1 p.2.2).2 ∧ (3:ℤ)∣2*(p.2.1.val:ℤ)+(lowRamifiedQuotientCoord a r p.1 p.2.1 p.2.2).1- (lowRamifiedQuotientCoord a r p.1 p.2.1 p.2.2).2)) def lowRamifiedSupportSet (a r:Fin 3) :Finset (Bool×Fin 3×Fin 5) := letI : DecidablePred (lowRamifiedSupport a r) := lowRamifiedSupport_decidable a r Finset.univ.filter (lowRamifiedSupport a r) lemma lowRamifiedSupport_card (a r:Fin 3) : (lowRamifiedSupportSet a r).card≤5 := by decide +revert lemma lowRamifiedSupport_exponent (a r:Fin 3) (p:Bool×Fin 3×Fin 5) (hp:lowRamifiedSupport a r p) : 1≤p.2.2.val := by revert a r p hp let : ∀ a r, DecidablePred (lowRamifiedSupport a r) := lowRamifiedSupport_decidable decide lemma ramifiedCoordMul_eval (x y:ℤ×ℤ) : ActualEisensteinCoordinates.eval (ramifiedCoordMul x y).1 (ramifiedCoordMul x y).2= ActualEisensteinCoordinates.eval x.1 x.2*ActualEisensteinCoordinates.eval y.1 y.2 := (ActualEisensteinCoordinates.eval_mul _ _ _ _).symm lemma ramifiedCoordPow_eval (x:ℤ×ℤ) (n:ℕ) : ActualEisensteinCoordinates.eval (ramifiedCoordPow x n).1 (ramifiedCoordPow x n).2= (ActualEisensteinCoordinates.eval x.1 x.2)^n := by induction n with | zero => simp [ramifiedCoordPow,ActualEisensteinCoordinates.eval] | succ n ih => rw [ramifiedCoordPow,ramifiedCoordMul_eval,ih,pow_succ] lemma lowRamifiedQuotientCoord_eval (a r:Fin 3) (s:Bool) (j:Fin 3) (n:Fin 5) : ActualEisensteinCoordinates.eval (lowRamifiedQuotientCoord a r s j n).1 (lowRamifiedQuotientCoord a r s j n).2= if s then omega^(a.val+5-j.val)*lambda^(r.val+2-n.val) else -(omega^(a.val+5-j.val)*lambda^(r.val+2-n.val)) := by have ho:ActualEisensteinCoordinates.eval 0 1=omega:=by simp [ActualEisensteinCoordinates.eval]; rfl have hl:ActualEisensteinCoordinates.eval (-1) 1=lambda:=by change ActualEisensteinCoordinates.eval (-1) 1=omega-1 have he:ActualEisensteinCoordinates.eval (-1) 1=(-1:_root_.OAI.ActualEisensteinCubic.O)+ActualEisensteinCoordinates.eval 0 1:=by simp [ActualEisensteinCoordinates.eval] rw [he,ho] ring have he:∀x:ℤ×ℤ,ActualEisensteinCoordinates.eval (-x.1) (-x.2)= -ActualEisensteinCoordinates.eval x.1 x.2:=by intro x simp only [ActualEisensteinCoordinates.eval,Int.cast_neg] ring cases s <;> simp only [lowRamifiedQuotientCoord,Bool.false_eq_true,ite_false,ite_true, he,ramifiedCoordMul_eval,ramifiedCoordPow_eval,ho,hl] lemma lowRamifiedQuotientCoord_relation (a r:Fin 3) (s:Bool) (j:Fin 3) (n:Fin 5) (hn:n.val≤r.val+2) : 3*lowRamifiedFrequency a r= ((signedOmegaUnit s j:_root_.OAI.ActualEisensteinCubic.O)*lambda^(n.val+2))* ActualEisensteinCoordinates.eval (lowRamifiedQuotientCoord a r s j n).1 (lowRamifiedQuotientCoord a r s j n).2 := by have hw:omega^2=-omega-1:=by linear_combination ramified_omega_relation have hl:lambda^2=-3*omega:=by change (omega-1)^2=-3*omega linear_combination hw have h3:(3:_root_.OAI.ActualEisensteinCubic.O)=-omega^2*lambda^2:=by rw [hl] calc (3:_root_.OAI.ActualEisensteinCubic.O)=3*omega^3:=by rw [omega_primitive.pow_eq_one]; ring _=_:=by ring have ho:omega^j.val*omega^(a.val+5-j.val)=omega^(a.val+2):=by rw [←pow_add,show j.val+(a.val+5-j.val)=a.val+5 by omega] rw [show a.val+5=(a.val+2)+3 by omega,pow_add,omega_primitive.pow_eq_one,mul_one] have hp:lambda^(n.val+2)*lambda^(r.val+2-n.val)=lambda^(r.val+4):=by rw [←pow_add] congr 1 omega have he:3*lowRamifiedFrequency a r= -(omega^j.val*omega^(a.val+5-j.val))*(lambda^(n.val+2)*lambda^(r.val+2-n.val)):=by rw [ho,hp,lowRamifiedFrequency] conv_lhs => rw [h3] rw [show r.val+4=2+(r.val+2) by omega,pow_add,pow_add] ring rw [lowRamifiedQuotientCoord_eval,signedOmegaUnit_val] cases s <;> simp only [Bool.false_eq_true,ite_false,ite_true] <;> linear_combination he lemma lowRamifiedSupport_of_ne_zero (a r:Fin 3) (s:Bool) (j:Fin 3) (n:Fin 5) (hA:arithmeticResidueSum (lowRamifiedFrequency a r) ((signedOmegaUnit s j:_root_.OAI.ActualEisensteinCubic.O)*lambda^(n.val+2))≠0) : lowRamifiedSupport a r (s,j,n) := by have hn:n.val≤r.val+2:=by have hb:=ramified_arithmetic_norm_bound _ (lowRamifiedFrequency_ne_zero a r) (signedOmegaUnit s j) (n.val+2) (by omega) hA rw [lowRamifiedFrequency_absNorm] at hb have he:9*3^(r.val+2)=(3:ℕ)^(r.val+4):=by rw [show r.val+4=(r.val+2)+2 by omega,pow_add] ring rw [he] at hb have hh: n.val+2≤r.val+4 := (Nat.pow_le_pow_iff_right (by decide : 1<(3:ℕ))).mp hb omega let z:=lowRamifiedQuotientCoord a r s j n have hu:(signedOmegaUnit s j:_root_.OAI.ActualEisensteinCubic.O)=omega^j.val ∨ (signedOmegaUnit s j:_root_.OAI.ActualEisensteinCubic.O)=-(omega^j.val):=by cases s <;> simp [signedOmegaUnit_val] have he:=ramified_arithmetic_explicit_table (lowRamifiedFrequency a r) (ActualEisensteinCoordinates.eval z.1 z.2) (signedOmegaUnit s j) (n.val+2) j.val (by omega) hu (lowRamifiedQuotientCoord_relation a r s j n hn) have hz:ramifiedCongruence (ActualEisensteinCoordinates.eval z.1 z.2) j.val (n.val+2):=by by_contra hc rw [if_neg hc] at he exact hA he exact ⟨hn,by simpa only [ramifiedCongruence,ShortDraftLatticeCount.coords_eval] using hz⟩ end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal def ramifiedRawWeightUnitsFintype : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units def ramifiedRawWeight (h:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (k:ℕ) :ℂ := ((3^(k+2):ℕ):ℂ)^(-(4/3:ℂ))*arithmeticResidueSum h (u.val*lambda^(k+2)) lemma ramifiedRawWeight_norm_le (h:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (k:ℕ) : ‖ramifiedRawWeight h u k‖≤ramifiedDecayRatio^(k+2) := by rw [ramifiedRawWeight,norm_mul, arithmeticResidueSum_eq_explicitRamifiedCoefficient h u (k+2) (by omega)] exact (mul_le_mul_of_nonneg_left (explicitRamifiedCoefficient_norm_le h u (k+2)) (norm_nonneg _)).trans_eq (ramifiedWeight_norm_scalar _) lemma ramifiedRawWeight_norm_mul_primary (h n:_root_.OAI.ActualEisensteinCubic.O) (hn:lambda^2∣n-1) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (k:ℕ) : ‖ramifiedRawWeight (h*n) u k‖=‖ramifiedRawWeight h u k‖ := by simp only [ramifiedRawWeight,norm_mul, arithmeticResidueSum_norm_mul_primary h n hn u (k+2) (by omega)] lemma ramifiedDecayRatio_cube : ramifiedDecayRatio^3=(1/3:ℝ) := by rw [ramifiedDecayRatio,←Real.rpow_natCast,←Real.rpow_mul (by norm_num : (0:ℝ)≤3)] norm_num lemma lowRamifiedRawWeight_bound (a r:Fin 3) (s:Bool) (j:Fin 3) (k:Fin 5) : letI : DecidablePred (lowRamifiedSupport a r) := lowRamifiedSupport_decidable a r ‖ramifiedRawWeight (lowRamifiedFrequency a r) (signedOmegaUnit s j) k.val‖≤ if lowRamifiedSupport a r (s,j,k) then (1/3:ℝ) else 0 := by let : DecidablePred (lowRamifiedSupport a r) := lowRamifiedSupport_decidable a r split_ifs with hs · have hh:1≤k.val:=lowRamifiedSupport_exponent a r (s,j,k) hs have hb:ramifiedDecayRatio^(k.val+2)≤ramifiedDecayRatio^3:= pow_le_pow_of_le_one ramifiedDecayRatio_pos.le ramifiedDecayRatio_lt_one.le (by omega) exact (ramifiedRawWeight_norm_le (lowRamifiedFrequency a r) (signedOmegaUnit s j) k.val).trans (hb.trans_eq ramifiedDecayRatio_cube) · have hz:arithmeticResidueSum (lowRamifiedFrequency a r) ((signedOmegaUnit s j:_root_.OAI.ActualEisensteinCubic.O)*lambda^(k.val+2))=0:=by by_contra hne exact hs (lowRamifiedSupport_of_ne_zero a r s j k hne) simp only [ramifiedRawWeight,hz,mul_zero,norm_zero,le_refl] theorem lowRamifiedRawWeight_sum (a r:Fin 3) (n:_root_.OAI.ActualEisensteinCubic.O) (hn:lambda^2∣n-1) : letI : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := ramifiedRawWeightUnitsFintype (∑u:_root_.OAI.ActualEisensteinCubic.Oˣ,∑k:Fin 5,‖ramifiedRawWeight (lowRamifiedFrequency a r*n) u k.val‖)≤5/3 := by let : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := ramifiedRawWeightUnitsFintype let : DecidablePred (lowRamifiedSupport a r) := lowRamifiedSupport_decidable a r simp_rw [ramifiedRawWeight_norm_mul_primary _ n hn] have hu:(∑u:_root_.OAI.ActualEisensteinCubic.Oˣ,∑k:Fin 5,‖ramifiedRawWeight (lowRamifiedFrequency a r) u k.val‖)= ∑p:Bool×Fin 3,∑k:Fin 5,‖ramifiedRawWeight (lowRamifiedFrequency a r) (signedOmegaUnit p.1 p.2) k.val‖ := by symm exact Fintype.sum_equiv signedOmegaEquiv _ _ (fun _=>rfl) rw [hu] calc _≤∑p:Bool×Fin 3,∑k:Fin 5, if lowRamifiedSupport a r (p.1,p.2,k) then (1/3:ℝ) else 0:=by apply Finset.sum_le_sum intro p hp exact Finset.sum_le_sum (fun k hk=>lowRamifiedRawWeight_bound a r p.1 p.2 k) _=∑p:Bool×Fin 3×Fin 5,if lowRamifiedSupport a r p then (1/3:ℝ) else 0:=by simp only [Fintype.sum_prod_type] _=(lowRamifiedSupportSet a r).card*(1/3:ℝ):=by rw [←Finset.sum_filter] simp only [Finset.sum_const,nsmul_eq_mul,lowRamifiedSupportSet] _≤5/3:=by have hc:(lowRamifiedSupportSet a r).card≤5:=lowRamifiedSupport_card a r exact_mod_cast (show ((lowRamifiedSupportSet a r).card:ℝ)*(1/3:ℝ)≤5/3 by have hcr:((lowRamifiedSupportSet a r).card:ℝ)≤5:=by exact_mod_cast hc linarith) end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.DualKernelSummability namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CompletedGauss open scoped BigOperators Classical ContDiff open Finset AddChar MulChar EisensteinEmbedding section lemma nonzeroDualIdeal_norm_pos (I : NonzeroDualIdeal) : 0<(Ideal.absNorm I.val:ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (Ideal.absNorm_eq_zero_iff.not.mpr I.property) lemma nonzeroDualIdeal_inv_pow_summable (n : ℕ) (hn : 1 ((Ideal.absNorm I.val:ℝ)^n)⁻¹) := by have hs := (CubicEisenstein.fullIdealWeight_summable_norm (n:ℂ) (by exact_mod_cast hn)).subtype (fun I : Ideal _root_.OAI.ActualEisensteinCubic.O => I≠0) apply hs.congr intro I simp only [Function.comp_apply,CubicEisenstein.fullIdealWeight,if_neg I.property, Complex.cpow_neg,Complex.cpow_natCast,norm_inv,norm_pow,Complex.norm_natCast] def rawDualKernelTerm (V : ℝ→ℂ) (scale ρ q : ℝ) (β : ℕ→Ideal _root_.OAI.ActualEisensteinCubic.O→Ideal _root_.OAI.ActualEisensteinCubic.O→ℂ) (x : ℕ×NonzeroDualIdeal×NonzeroDualIdeal) : ℂ := β x.1 x.2.1.val x.2.2.val * CubicReflectionKernel.paperKernel V (scale*(ρ*q^x.1)^3*(Ideal.absNorm x.2.1.val:ℝ)*(Ideal.absNorm x.2.2.val:ℝ)^3) lemma rawDualKernel_inverse_square (scale ρ q : ℝ) (x : ℕ×NonzeroDualIdeal×NonzeroDualIdeal) : ((scale*(ρ*q^x.1)^3*(Ideal.absNorm x.2.1.val:ℝ)* (Ideal.absNorm x.2.2.val:ℝ)^3)^2)⁻¹ = (scale^2*ρ^6)⁻¹*((q^6)⁻¹)^x.1 * (((Ideal.absNorm x.2.1.val:ℝ)^2)⁻¹*((Ideal.absNorm x.2.2.val:ℝ)^6)⁻¹) := by simp only [mul_pow,mul_inv_rev,←pow_mul,←inv_pow] ring theorem rawDualKernelTerm_summable_norm (V : ℝ→ℂ) (a b : ℝ) (ha : 0 ‖rawDualKernelTerm V scale ρ q β x‖) := by obtain ⟨C,hC,hdec⟩:=CubicReflectionKernel.paperKernel_euler_power_decay V a b ha hsupp hV 2 0 have hq6 : 1 ((q^6)⁻¹)^m) := summable_geometric_of_lt_one (by positivity) ((inv_lt_one₀ (by positivity)).mpr hq6) have hi := nonzeroDualIdeal_inv_pow_summable 2 (by norm_num) have hj := nonzeroDualIdeal_inv_pow_summable 6 (by norm_num) have hij := hi.mul_of_nonneg hj (fun I=>by positivity) (fun J=>by positivity) have hs := hg.mul_of_nonneg hij (fun m=>by positivity) (fun IJ=>by positivity) have hmajor := hs.mul_left (B*C*(scale^2*ρ^6)⁻¹) apply hmajor.of_nonneg_of_le (fun _=>norm_nonneg _) intro x have hn:=nonzeroDualIdeal_norm_pos x.2.1 have hb:=nonzeroDualIdeal_norm_pos x.2.2 have hx : 0NeZero.ne (P i)) j e v) have hroot : 1≤Real.sqrt ((Ideal.absNorm (reflectionExtractedDivisor P j e 0):ℝ)* (Ideal.absNorm (reflectionExtractedDivisor P j e 2):ℝ)) := by apply (Real.le_sqrt (by norm_num) (by positivity)).mpr nlinarith [hdiv 0,hdiv 2] have hrho : ρ≤ramifiedScale ρ q m := by exact le_mul_of_one_le_right hρ.le (one_le_pow₀ hq) have hden := hrho.trans (le_mul_of_one_le_right hr.le hroot) simp only [Real.sqrt_one,one_mul] at hc have hcoeff:=hc.trans (div_le_div_of_nonneg_left (by norm_num) hρ hden) rw [canonicalRawBranchCoefficient,norm_mul,norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) ((mul_le_of_le_one_left (norm_nonneg _) (hσ m)).trans (quadraticRow_norm_le_one _ _))).trans hcoeff theorem reflectedBranchBlock_canonical {ι : Type*} [Fintype ι] (P : ι→Ideal _root_.OAI.ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hg : ∀i,lambda∉P i) (j : ι→ℕ) (e : ι→Fin 3) (W : ℝ→ℂ) (K Y ρ q : ℝ) (η : ℕ→Ideal _root_.OAI.ActualEisensteinCubic.O→Ideal _root_.OAI.ActualEisensteinCubic.O→ℂ) (σ : ℕ→idealRange K→ℂ) (i : ℕ×ℕ×ℕ) (k : idealRange K) (hK : 0dualIdealDyad l.2.2) (fun l=>dualIdealDyad l.2.1) (fun l=>η l.1) (fun l=>σ l.1) i k = ∑n : dualIdealDyad i.2.2, ∑b : dualIdealDyad i.2.1, rawDualKernelTerm (Vstar W) (Y⁻¹*(K/(Ideal.absNorm k.val:ℝ))^2) ρ q (canonicalRawBranchCoefficient P hg j e ρ q η (fun m=>σ m k) k.val) (i.1,⟨n.val,((mem_dualIdealDyad _ _).mp n.property).1⟩, ⟨b.val,((mem_dualIdealDyad _ _).mp b.property).1⟩) := by have hkm:=mem_idealRange.mp k.property have hwk:=completedShellWindow_log (Ideal.absNorm k.val:ℝ) K (nonzeroDualIdeal_norm_pos ⟨k.val,hkm.1.1⟩) hK hk hkm.2 simp only [reflectedBranchBlock,completedSmoothDyadicBlock,Finset.mul_sum] rw [←Finset.sum_coe_sort (dualIdealDyad i.2.2)] apply Finset.sum_congr rfl intro n _ rw [←Finset.sum_coe_sort (dualIdealDyad i.2.1)] apply Finset.sum_congr rfl intro b _ have hn:=dualIdealDyad_bounds _ n.val n.property have hb:=dualIdealDyad_bounds _ b.val b.property have hwn:=completedShellWindow_log (Ideal.absNorm n.val:ℝ) ((2:ℝ)^i.2.2) (nonzeroDualIdeal_norm_pos ⟨n.val,hn.1⟩) (by positivity) hn.2.1 hn.2.2 have hwb:=completedShellWindow_log (Ideal.absNorm b.val:ℝ) ((2:ℝ)^i.2.1) (nonzeroDualIdeal_norm_pos ⟨b.val,hb.1⟩) (by positivity) hb.2.1 hb.2.2 rw [hwk,hwn,hwb,canonical_dual_kernel_argument K Y ρ q i k.val n.val b.val hK hkm.1.1 hn.1 hb.1] simp only [rawDualKernelTerm,canonicalRawBranchCoefficient] ring theorem canonicalRawBranch_summable_norm {ι : Type*} [Fintype ι] (P : ι→Ideal _root_.OAI.ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hg : ∀i,lambda∉P i) (j : ι→ℕ) (e : ι→Fin 3) (W : ℝ→ℂ) (a b : ℝ) (ha : 0 ‖rawDualKernelTerm (Vstar W) (Y⁻¹*(K/(Ideal.absNorm k:ℝ))^2) ρ q (canonicalRawBranchCoefficient P hg j e ρ q η σ k) x‖) := by have hkn:=nonzeroDualIdeal_norm_pos ⟨k,hk⟩ exact rawDualKernelTerm_summable_norm (Vstar W) a b ha (Vstar_support W a b hsupp) (Vstar_contDiff W a b ha hsupp hW) _ ρ q (1/ρ) (by positivity) hρ hq (by positivity) _ (fun m n b=>canonicalRawBranchCoefficient_norm P hg j e ρ q hρ hq.le η σ hη hσ k m n b) theorem canonical_reflected_series {ι : Type*} [Fintype ι] (P : ι→Ideal _root_.OAI.ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hg : ∀i,lambda∉P i) (j : ι→ℕ) (e : ι→Fin 3) (W : ℝ→ℂ) (a b : ℝ) (ha : 0dualIdealDyad l.2.2) (fun l=>dualIdealDyad l.2.1) (fun l=>η l.1) (fun l=>σ l.1) i k) = ∑'x : ℕ×NonzeroDualIdeal×NonzeroDualIdeal, rawDualKernelTerm (Vstar W) (Y⁻¹*(K/(Ideal.absNorm k.val:ℝ))^2) ρ q (canonicalRawBranchCoefficient P hg j e ρ q η (fun m=>σ m k) k.val) x := by have hs:=canonicalRawBranch_summable_norm P hg j e W a b ha hsupp hW K Y ρ q hK hY hρ hq η (fun m=>σ m k) hη (fun m=>hσ m k) k.val (mem_idealRange.mp k.property).1.1 rw [tsum_dualIdealDyads _ hs.of_norm] apply tsum_congr intro i exact reflectedBranchBlock_canonical P hg j e W K Y ρ q η σ i k hK hk end open ActualEisensteinCubic CanonicalQuadraticSieve CompletedDyadic namespace ReflectedBranchData def withCanonicalCuspArray {levelBound K : ℝ} {I F Q : Ideal _root_.OAI.ActualEisensteinCubic.O} (d : ReflectedBranchData levelBound K I F Q) (η : ℕ→Ideal _root_.OAI.ActualEisensteinCubic.O→Ideal _root_.OAI.ActualEisensteinCubic.O→ℂ) (hη : ∀m,∀n b : NonzeroDualIdeal,‖η m n.val b.val‖≤1) (σ : ℕ→idealRange (completedResidualScale K I Q)→ℂ) (hσ : ∀m k,‖σ m k‖≤1) : ReflectedBranchData levelBound K I F Q := { d with nColumns := fun i=>dualIdealDyad i.2.2 bColumns := fun i=>dualIdealDyad i.2.1 nBounds := fun i n hn=>dualIdealDyad_bounds i.2.2 n hn bBounds := fun i b hb=>dualIdealDyad_bounds i.2.1 b hb amplitude := fun i=>η i.1 amplitude_bound := fun i n hn b hb=>hη i.1 ⟨n,((mem_dualIdealDyad _ _).mp hn).1⟩ ⟨b,((mem_dualIdealDyad _ _).mp hb).1⟩ rowPhase := fun i=>σ i.1 rowPhase_bound := fun i k=>hσ i.1 k } def rawValue {levelBound K : ℝ} {I F Q : Ideal _root_.OAI.ActualEisensteinCubic.O} (d : ReflectedBranchData levelBound K I F Q) (η : ℕ→Ideal _root_.OAI.ActualEisensteinCubic.O→Ideal _root_.OAI.ActualEisensteinCubic.O→ℂ) (σ : ℕ→idealRange (completedResidualScale K I Q)→ℂ) (W : ℝ→ℂ) (X ρ q : ℝ) (k : idealRange (completedResidualScale K I Q)) : ℂ := by letI : ∀p : d.primes,p.val.IsMaximal:=d.maximal exact ∑'x : ℕ×NonzeroDualIdeal×NonzeroDualIdeal, rawDualKernelTerm (Vstar W) ((completedBranchScale K (X/d.levelScale) I F Q (fun p : d.primes=>p.val) d.label)⁻¹* (completedResidualScale K I Q/(Ideal.absNorm k.val:ℝ))^2) ρ q (canonicalRawBranchCoefficient (fun p : d.primes=>p.val) d.good (fun p=>completedLocalExponent I F p.val) d.label ρ q η (fun m=>σ m k) k.val) x theorem withCanonicalCuspArray_value {levelBound K : ℝ} {I F Q : Ideal _root_.OAI.ActualEisensteinCubic.O} (d : ReflectedBranchData levelBound K I F Q) (η : ℕ→Ideal _root_.OAI.ActualEisensteinCubic.O→Ideal _root_.OAI.ActualEisensteinCubic.O→ℂ) (hη : ∀m,∀n b : NonzeroDualIdeal,‖η m n.val b.val‖≤1) (σ : ℕ→idealRange (completedResidualScale K I Q)→ℂ) (hσ : ∀m k,‖σ m k‖≤1) (W : ℝ→ℂ) (a b : ℝ) (ha : 0NeZero.ne p.val)) have hd:=hn _ (reflectionExtractedDivisor_ne_zero (fun p : d.primes=>p.val) (fun p=>NeZero.ne p.val) (fun p=>completedLocalExponent I F p.val) d.label 1) have he:=hn _ (reflectionExtractedDivisor_ne_zero (fun p : d.primes=>p.val) (fun p=>NeZero.ne p.val) (fun p=>completedLocalExponent I F p.val) d.label 2) have hy : 0p.val) d.label := by unfold completedBranchScale have hl:=d.levelScale_pos positivity exact canonical_reflected_series (fun p : d.primes=>p.val) d.good (fun p=>completedLocalExponent I F p.val) d.label W a b ha hsupp hW (completedResidualScale K I Q) (completedBranchScale K (X/d.levelScale) I F Q (fun p : d.primes=>p.val) d.label) ρ q hK hy hρ hq η σ hη hσ k hk end ReflectedBranchData end CompletedGauss namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal noncomputable abbrev ramifiedFrequencyUnitsFintype : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units lemma ramifiedFrequencyChar_neg_unit (k:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (n:ℕ) : ramifiedFrequencyChar k (-u) n=ramifiedFrequencyChar k u n := by ext x obtain ⟨d,rfl⟩:=Ideal.Quotient.mk_surjective x have hp:lambda^2∣(1+3*d)-1:=by rw [add_sub_cancel_left] exact dvd_mul_of_dvd_left lambda_sq_dvd_three d rw [ramifiedFrequencyChar_mk,ramifiedFrequencyChar_mk,Units.val_neg,neg_mul, symbol_neg_numerator _ _ hp] lemma arithmeticResidueSum_neg_unit (h:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (n:ℕ) (hn:2≤n) : arithmeticResidueSum (-h) (u.val*lambda^n)= arithmeticResidueSum h ((-u).val*lambda^n) := by by_cases hd:u.val*lambda^n∣3*(-h) · obtain ⟨k,hk⟩:=hd have hk':3*h=((-u).val*lambda^n)*k:=by simp only [Units.val_neg] linear_combination -hk rw [ramified_arithmetic_character_test (-h) k u n hn hk, ramified_arithmetic_character_test h k (-u) n hn hk',ramifiedFrequencyChar_neg_unit] · have hl:arithmeticResidueSum (-h) (u.val*lambda^n)=0:=by by_contra he exact hd (ramified_arithmetic_support (-h) u n hn he) have hr:arithmeticResidueSum h ((-u).val*lambda^n)=0:=by by_contra he obtain ⟨k,hk⟩:=ramified_arithmetic_support h (-u) n hn he apply hd refine ⟨k,?_⟩ simp only [Units.val_neg] at hk linear_combination -hk rw [hl,hr] lemma principalResidueTerm_neg (h:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (n:ℕ) : principalResidueTerm (-h) u n=principalResidueTerm h (-u) n := by unfold principalResidueTerm rw [arithmeticResidueSum_neg_unit h u (n+2) (by omega)] congr 2 simp only [Units.val_neg] ring lemma principalArithmeticResidue_neg (h:_root_.OAI.ActualEisensteinCubic.O) : principalArithmeticResidue (-h)=principalArithmeticResidue h := by letI explicitWitness24 := OAI.CubicEisenstein.ramifiedFrequencyUnitsFintype exact ( by by_cases hh:h=0 · rw [hh,neg_zero] let N:=max (ramifiedFrequencyBound (-h)+1) (ramifiedFrequencyBound h+1) rw [principalArithmeticResidue_eq_sum (-h) (neg_ne_zero.mpr hh) N (le_max_left _ _), principalArithmeticResidue_eq_sum h hh N (le_max_right _ _)] apply congrArg (fun z:ℂ=>z/((9*Real.sqrt 3/2:ℝ):ℂ)) simp_rw [principalResidueTerm_neg] exact Fintype.sum_equiv (Equiv.neg _root_.OAI.ActualEisensteinCubic.Oˣ) (fun u=>∑n∈Finset.range N,principalResidueTerm h (-u) n) (fun u=>∑n∈Finset.range N,principalResidueTerm h u n) (fun _=>rfl) ) theorem sourceArithmeticResidue_neg (h:_root_.OAI.ActualEisensteinCubic.O) : sourceArithmeticResidue (-h)=sourceArithmeticResidue h := by have hU:unramifiedGaussResidue (-(9*h))=unramifiedGaussResidue (9*h):=by have he:=unramifiedGaussResidue_of_initial_relation (-(9*h)) (9*h) 0 (fun _=>1) (fun _=>0) (fun _ _=>analyticAt_const) (fun _ _=>analyticAt_const) continuousAt_const continuousAt_const (fun s hs hi=>by simpa only [one_mul,zero_mul,add_zero] using unramifiedCubicGaussSeries_neg s (9*h)) simpa only [one_mul,zero_mul,add_zero] using he simp only [sourceArithmeticResidue,cuspFrequency_neg, AddChar.map_neg_eq_inv,inv_eq_one,principalArithmeticResidue_neg, mul_neg,hU] lemma cubicBesselNormalizer_neg (h:_root_.OAI.ActualEisensteinCubic.O) : cubicBesselNormalizer (-h)=cubicBesselNormalizer h := by simp only [cubicBesselNormalizer,cuspFrequency_neg,norm_neg] theorem sourceResidualFourierCoefficient_neg (h:_root_.OAI.ActualEisensteinCubic.O) : sourceResidualFourierCoefficient (-h)=sourceResidualFourierCoefficient h := by rw [sourceResidualFourierCoefficient,sourceResidualFourierCoefficient, cubicBesselNormalizer_neg,sourceArithmeticResidue_neg] end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma sourceRayPhase_eq_one_iff_coordinate (h:_root_.OAI.ActualEisensteinCubic.O) : ShortDraftTrace.breveE (cuspFrequency h)=1 ↔ (3:ℤ)∣(ActualEisensteinCoordinates.coords h).2 := by have he:ShortDraftTrace.breveE (cuspFrequency h)= eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates 3 (by norm_num) (Ideal.Quotient.mk _ h):=by rw [eisTraceModChar,IdealGaussCRT.traceModChar_mk] unfold cuspFrequency simp only [map_ofNat] rw [he,trace_third_coordinate] simpa only [pow_zero,one_mul,Nat.cast_zero,zero_add] using omega3_pow_exp_eq_one_iff 0 (ActualEisensteinCoordinates.coords h).2 lemma primary_or_negative_primary_of_source_mask (h:_root_.OAI.ActualEisensteinCubic.O) (h3:¬(3:_root_.OAI.ActualEisensteinCubic.O)∣h) (hphase:ShortDraftTrace.breveE (cuspFrequency h)=1) : lambda^2∣h-1 ∨ lambda^2∣(-h)-1 := by let a:ℤ:=(ActualEisensteinCoordinates.coords h).1 let b:ℤ:=(ActualEisensteinCoordinates.coords h).2 have heval:h=(a:_root_.OAI.ActualEisensteinCubic.O)+(b:_root_.OAI.ActualEisensteinCubic.O)*omega:= (ActualEisensteinCoordinates.eval_coords h).symm obtain ⟨B,hB⟩:=(sourceRayPhase_eq_one_iff_coordinate h).mp hphase have hBc:(b:_root_.OAI.ActualEisensteinCubic.O)=3*(B:_root_.OAI.ActualEisensteinCubic.O):=by exact_mod_cast hB have ha:¬(3:ℤ)∣a:=by rintro ⟨A,hA⟩ apply h3 refine ⟨(A:_root_.OAI.ActualEisensteinCubic.O)+(B:_root_.OAI.ActualEisensteinCubic.O)*omega,?_⟩ have hAc:(a:_root_.OAI.ActualEisensteinCubic.O)=3*(A:_root_.OAI.ActualEisensteinCubic.O):=by exact_mod_cast hA rw [heval,hAc,hBc] ring have hcases:(3:ℤ)∣a-1 ∨ (3:ℤ)∣a+1:=by omega rcases hcases with ⟨A,hA⟩|⟨A,hA⟩ · left apply lambda_sq_dvd_three.trans refine ⟨(A:_root_.OAI.ActualEisensteinCubic.O)+(B:_root_.OAI.ActualEisensteinCubic.O)*omega,?_⟩ have hAc:(a:_root_.OAI.ActualEisensteinCubic.O)-1=3*(A:_root_.OAI.ActualEisensteinCubic.O):=by exact_mod_cast hA rw [heval,hBc] linear_combination hAc · right apply lambda_sq_dvd_three.trans refine ⟨-((A:_root_.OAI.ActualEisensteinCubic.O)+(B:_root_.OAI.ActualEisensteinCubic.O)*omega),?_⟩ have hAc:(a:_root_.OAI.ActualEisensteinCubic.O)+1=3*(A:_root_.OAI.ActualEisensteinCubic.O):=by exact_mod_cast hA rw [heval,hBc] linear_combination -hAc end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal theorem sourceFourier_supported_three_of_base_zero (hC:infinityCoefficientScalar=0) (h:_root_.OAI.ActualEisensteinCubic.O) (h3:¬(3:_root_.OAI.ActualEisensteinCubic.O)∣h) : sourceResidualFourierCoefficient h=0 := by by_cases hm:ShortDraftTrace.breveE (cuspFrequency h)=1 · rcases primary_or_negative_primary_of_source_mask h h3 hm with hh|hh · exact sourceFourier_primary_zero_of_base_zero hC h hh · rw [←sourceResidualFourierCoefficient_neg h] exact sourceFourier_primary_zero_of_base_zero hC (-h) hh · simp only [sourceResidualFourierCoefficient,sourceArithmeticResidue,if_neg hm,mul_zero] end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss theorem infinityCoefficientScalar_ne_zero : infinityCoefficientScalar≠0 := by intro hC obtain ⟨h,h3,hn⟩:=exists_source_coefficient_not_three exact hn (sourceFourier_supported_three_of_base_zero hC h h3) theorem normalized_infinityCoefficient_squarefree_cube (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:primaryGenerator I≠0) (hJ:primaryGenerator J≠0) (hsq:Squarefree I) : infinityCoefficientScalar⁻¹* star (sourceResidualFourierCoefficient (primaryGenerator I*(primaryGenerator J)^3))= (‖eisEmbedding (primaryGenerator J)‖:ℂ)* star (eisEmbedding (symbol ramifiedTraceLambda (primaryGenerator I)))*gaussTwo I hI := by rw [infinityCoefficient_squarefree_cube I J hI hJ hsq] simp only [←mul_assoc,inv_mul_cancel₀ infinityCoefficientScalar_ne_zero,one_mul] end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.FiniteTranslations /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CompletedGauss open Filter MeasureTheory open scoped Classical BigOperators Topology ContDiff open CubicEisenstein lemma positive_cpow_comp_continuous (r : ℝ) (hr : 0(r:ℂ)^(f t)) := by let : NeZero (r:ℂ) := ⟨Complex.ofReal_ne_zero.mpr hr.ne'⟩ exact (_root_.continuous_const_cpow (r:ℂ)).comp hf theorem besselSmoothingIntegrand_reflected_integrable {α : Type*} [Countable α] (F : ℝ→ℂ) (r : α→ℝ) (hr : ∀i,0‖a i‖*(r i)^(-(3/2:ℝ)))) (V : ℝ→ℂ) (v0 v1 : ℝ) (hv0 : 0besselSmoothingIntegrand F q V X ((-1:ℂ)+t*Complex.I)) := by let P : ℝ→ℂ := fun t=> A*(Q:ℂ)^(2-2*((-1:ℂ)+t*Complex.I))* besselReflectionFactor q d ((-1:ℂ)+t*Complex.I)* (X:ℂ)^(((-1:ℂ)+t*Complex.I)-1/2) let D : ℝ→ℂ := fun t=>∑'i,a i*(r i:ℂ)^(-((3/2:ℂ)+(-t)*Complex.I)) let K : ℝ→ℂ := fun t=>CubicReflectionKernel.mellinEulerData V 0 ((3/2:ℂ)+(-t)*Complex.I) have hK : Integrable K := by have hh := CubicReflectionKernel.mellinEulerData_vertical_integrable V v0 v1 hv0 hVs hV 2 0 (3/2) (by norm_num) simpa only [K,Complex.ofReal_div,Complex.ofReal_ofNat,Complex.ofReal_neg] using hh.comp_neg have hD : Continuous D := by have hh := (weighted_vertical_series_continuous r hr a (3/2) has).comp continuous_neg simpa only [D,Function.comp_def,Complex.ofReal_div,Complex.ofReal_ofNat,Complex.ofReal_neg] using hh have hDb (t : ℝ) : ‖D t‖≤∑'i,‖a i‖*(r i)^(-(3/2:ℝ)) := by simpa only [D,Complex.ofReal_div,Complex.ofReal_ofNat,Complex.ofReal_neg] using weighted_vertical_series_norm r hr a (3/2) has (-t) have hP : Continuous P := by have h1 := positive_cpow_comp_continuous Q hQ (fun t : ℝ=>2-2*((-1:ℂ)+t*Complex.I)) (by fun_prop) have h2 := positive_cpow_comp_continuous (4*Real.pi*q) (by positivity) (fun t : ℝ=>2*((-1:ℂ)+t*Complex.I)+1) (by fun_prop) have h3 := positive_cpow_comp_continuous 2 (by norm_num) (fun t : ℝ=>2-4*((-1:ℂ)+t*Complex.I)) (by fun_prop) have h4 := positive_cpow_comp_continuous (4*Real.pi*d) (by positivity) (fun t : ℝ=>3-2*((-1:ℂ)+t*Complex.I)) (by fun_prop) have h5 := positive_cpow_comp_continuous X hX (fun t : ℝ=>((-1:ℂ)+t*Complex.I)-1/2) (by fun_prop) have hn (t : ℝ) : (((4*Real.pi*d:ℝ):ℂ)^(3-2*((-1:ℂ)+t*Complex.I)))≠0 := Complex.cpow_ne_zero_iff.mpr (Or.inl (Complex.ofReal_ne_zero.mpr (by positivity))) convert (((continuous_const (y:=A)).mul h1).mul ((h2.mul h3).div h4 hn)).mul h5 using 1 ; (ext t; simp only [P,besselReflectionFactor,Pi.mul_apply,Pi.div_apply,Complex.ofReal_ofNat]) have hPn (t : ℝ) : ‖P t‖=‖P 0‖ := by simp only [P,norm_mul,besselReflectionFactor_norm q d hq hd, Complex.norm_cpow_eq_rpow_re_of_pos hQ,Complex.norm_cpow_eq_rpow_re_of_pos hX] norm_num have hi := (hK.mul_bdd hP.aestronglyMeasurable (Eventually.of_forall (fun t=>(hPn t).le))).mul_bdd hD.aestronglyMeasurable (Eventually.of_forall hDb) apply hi.congr filter_upwards with t have he : ((-1:ℂ)+t*Complex.I).re-1/2=-(3/2:ℝ) := by norm_num have hsum : Summable (fun i=>‖a i‖*(r i)^(((-1:ℂ)+t*Complex.I).re-1/2)) := by simpa only [he] using has have href := continuedBesselDirichlet_reflection F r hr a q d Q hd hQ A hreflect ((-1:ℂ)+t*Complex.I) (by norm_num) hsum change K t*P t*D t=besselSmoothingIntegrand F q V X ((-1:ℂ)+t*Complex.I) rw [besselSmoothingIntegrand,href] dsimp only [K,P,D] unfold CubicReflectionKernel.mellinEulerData CubicReflectionKernel.mellinData simp only [pow_zero,one_mul] have he1 : (1/2:ℂ)-((-1:ℂ)+t*Complex.I)=(3/2:ℂ)+(-t)*Complex.I := by ring have he2 : ((-1:ℂ)+t*Complex.I)-1/2=-((3/2:ℂ)+(-t)*Complex.I) := by ring rw [he1,he2] ring end CompletedGauss namespace CubicEisenstein section open scoped BigOperators Classical open MeasureTheory open Finset AddChar MulChar EisensteinEmbedding section namespace RootNotationFiniteTranslations01 abbrev Eis := ActualEisensteinCubic.O end RootNotationFiniteTranslations01 open RootNotationFiniteTranslations01 (Eis) def finiteTranslationMultiplier {ι : Type*} [Fintype ι] (shift weight : ι→ℂ) (h : Eis) : ℂ := ∑i,weight i*ShortDraftTrace.breveE (cuspFrequency h*shift i) lemma finiteTranslationMultiplier_norm {ι : Type*} [Fintype ι] (shift weight : ι→ℂ) (h : Eis) : ‖finiteTranslationMultiplier shift weight h‖≤∑i,‖weight i‖ := by unfold finiteTranslationMultiplier apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro i hi rw [norm_mul,breveE_norm,mul_one] namespace SubexponentialBesselCoefficients def finiteTranslate {ι : Type*} [Fintype ι] (coeff : SubexponentialBesselCoefficients) (shift weight : ι→ℂ) : SubexponentialBesselCoefficients where value h := finiteTranslationMultiplier shift weight h*coeff.value h growth epsilon he := by obtain ⟨C,hC,hbound⟩:=coeff.growth epsilon he refine ⟨(∑i,‖weight i‖)*C,by positivity,?_⟩ intro h hh rw [norm_mul] calc _ ≤ (∑i,‖weight i‖)*(C*Real.exp (epsilon*‖cuspFrequency h‖)) := mul_le_mul (finiteTranslationMultiplier_norm shift weight h) (hbound h hh) (norm_nonneg _) (Finset.sum_nonneg (fun _ _=>norm_nonneg _)) _ = _ := by ring lemma term_horizontal_translate (coeff : SubexponentialBesselCoefficients) (h : Eis) (v : ℝ) (z a : ℂ) : coeff.term h (v,z+a)=ShortDraftTrace.breveE (cuspFrequency h*a)*coeff.term h (v,z) := by by_cases hh:h=0 · simp only [term,if_pos hh,mul_zero] · simp only [term,if_neg hh,mul_add,AddChar.map_add_eq_mul] ring lemma finiteTranslate_term {ι : Type*} [Fintype ι] (coeff : SubexponentialBesselCoefficients) (shift weight : ι→ℂ) (h : Eis) (v : ℝ) (z : ℂ) : (coeff.finiteTranslate shift weight).term h (v,z)= ∑i,weight i*coeff.term h (v,z+shift i) := by simp_rw [term_horizontal_translate] rw [show (∑i,weight i*(ShortDraftTrace.breveE (cuspFrequency h*shift i)*coeff.term h (v,z)))= finiteTranslationMultiplier shift weight h*coeff.term h (v,z) by simp only [finiteTranslationMultiplier,Finset.sum_mul] apply Finset.sum_congr rfl intro i hi ring] by_cases hh:h=0 · simp only [term,if_pos hh,mul_zero] · simp only [term,if_neg hh,finiteTranslate] ring theorem finiteTranslate_series {ι : Type*} [Fintype ι] (coeff : SubexponentialBesselCoefficients) (shift weight : ι→ℂ) (v : ℝ) (hv : 0(coeff.summable (v,z+shift i) hv).mul_left (weight i))] apply Finset.sum_congr rfl intro i hi exact tsum_mul_left theorem finiteTranslate_fullFunction {ι : Type*} [Fintype ι] (coeff : SubexponentialBesselCoefficients) (shift weight : ι→ℂ) (scalarTerm : ℂ) (v : ℝ) (hv : 0star (weight i)) h)= ∑i,weight i*ShortDraftTrace.breveE (-cuspFrequency h*shift i) := by simp only [finiteTranslationMultiplier,star_sum,star_mul,star_star,breveE_star,neg_mul] apply Finset.sum_congr rfl intro i hi ring lemma finiteTranslate_term_multiplier {ι : Type*} [Fintype ι] (coeff : SubexponentialBesselCoefficients) (shift weight : ι→ℂ) (h : Eis) (v : ℝ) (z : ℂ) : (coeff.finiteTranslate shift weight).term h (v,z)= finiteTranslationMultiplier shift weight h*coeff.term h (v,z) := by by_cases hh:h=0 · simp only [SubexponentialBesselCoefficients.term,if_pos hh,mul_zero] · simp only [SubexponentialBesselCoefficients.term,if_neg hh, SubexponentialBesselCoefficients.finiteTranslate] ring def finiteConjugateSource {ι : Type*} [Fintype ι] (shift weight : ι→ℂ) (v : ℝ) (hv : 0star (weight i))).fullFunction ((∑i,star (weight i))*((3*(Real.pi:ℂ))*constantArithmeticResidue)) (upperPoint z v hv)) := by rw [sourceBesselCoefficients.finiteTranslate_fullFunction] simp only [star_sum,star_mul,star_star,finiteConjugateSource,cubicSourceConjugateFunction, cubicSourceResidualFunction_eq_bessel,sourceBesselFunction] apply Finset.sum_congr rfl intro i hi ring theorem finiteConjugateSource_wirtingerBar {ι : Type*} [Fintype ι] (shift weight : ι→ℂ) (v : ℝ) (hv : 0 star ((sourceBesselCoefficients.finiteTranslate shift (fun i=>star (weight i))).fullFunction ((∑i,star (weight i))*((3*(Real.pi:ℂ))*constantArithmeticResidue)) (upperPoint z v hv)) := funext (finiteConjugateSource_eq_bessel shift weight v hv) rw [hf,horizontalWirtingerBar_star, SubexponentialBesselCoefficients.fullFunction_wirtingerZ,tsum_star] apply tsum_congr intro h rw [finiteTranslate_term_multiplier,star_mul,star_mul,finiteTranslationMultiplier_star] have hphase : star (2*Real.pi*Complex.I*cuspFrequency h)= -2*Real.pi*Complex.I*star (cuspFrequency h) := by simp only [star_mul,Complex.star_def,map_ofNat,Complex.conj_ofReal,Complex.conj_I] ring rw [hphase] ring def traceTwistedConjugateSource (c : Eis) (hc : c≠0) [Fintype (Eis⧸Ideal.span {c})] (φ : (Eis⧸Ideal.span {c})→ℂ) (v : ℝ) (hv : 0hx (hp.mpr hy))] def fixedThetaQuotient (Ψ : Eis→*ℂ) (c : Eis) (x : Eis⧸Ideal.span {c}) : ℂ := fixedThetaTwist Ψ (Quotient.out x) lemma fixedThetaQuotient_mk (Ψ : Eis→*ℂ) (Q : Ideal Eis) (hΨ : CanonicalCoefficientClass.FactorsModulo Q Ψ) (c : Eis) (hc : Ideal.span {c}≤Ideal.span {(9:Eis)}*Q) (x : Eis) : fixedThetaQuotient Ψ c (Ideal.Quotient.mk _ x)=fixedThetaTwist Ψ x := by apply fixedThetaTwist_periodic Ψ Q hΨ exact hc (Ideal.Quotient.eq.mp (Ideal.Quotient.mk_out (Ideal.Quotient.mk (Ideal.span {c}) x))) lemma fixedThetaQuotient_norm_le_one (Ψ : Eis→*ℂ) (hΨ : ∀x,‖Ψ x‖≤1) (c : Eis) (x : Eis⧸Ideal.span {c}) : ‖fixedThetaQuotient Ψ c x‖≤1 := fixedThetaTwist_norm_le_one Ψ hΨ _ lemma paperLambda_symbol_squarefree_cube (n b : Eis) (hb : lambda^2∣b-1) : eisEmbedding (symbol ramifiedTraceLambda (n*b^3))= eisEmbedding (symbol ramifiedTraceLambda n) := by rw [symbol_mul_denominator,cubicSymbol_pow_denominator,map_mul,map_pow, paperLambda_symbol_cube b hb,mul_one] theorem fixedThetaTwist_infinity_coefficient (Ψ : Eis→*ℂ) (I J : Ideal Eis) (hI : primaryGenerator I≠0) (hJ : primaryGenerator J≠0) (hsq : Squarefree I) : infinityCoefficientScalar⁻¹ * star (sourceResidualFourierCoefficient (primaryGenerator I*(primaryGenerator J)^3))* fixedThetaTwist Ψ (primaryGenerator I*(primaryGenerator J)^3)= (‖eisEmbedding (primaryGenerator J)‖:ℂ)*gaussTwo I hI* Ψ (primaryGenerator I)*(Ψ (primaryGenerator J))^3 := by have hn := (primaryGenerator_spec I hI).2 have hb := (primaryGenerator_spec J hJ).2 have hnb : lambda^2∣primaryGenerator I*(primaryGenerator J)^3-1 := CubicJacobiGlobal.primary_mul _ _ hn (primary_pow_congruence _ hb 3) rw [normalized_infinityCoefficient_squarefree_cube I J hI hJ hsq, fixedThetaTwist_primary Ψ _ hnb,paperLambda_symbol_squarefree_cube _ _ hb,map_mul,map_pow] have hunit : star (eisEmbedding (symbol ramifiedTraceLambda (primaryGenerator I)))* eisEmbedding (symbol ramifiedTraceLambda (primaryGenerator I))=1 := by simpa only [Complex.star_def,paperLambda_symbol_norm _ hn,one_pow, Complex.ofReal_one] using Complex.conj_mul' (eisEmbedding (symbol ramifiedTraceLambda (primaryGenerator I))) calc _ = (star (eisEmbedding (symbol ramifiedTraceLambda (primaryGenerator I)))* eisEmbedding (symbol ramifiedTraceLambda (primaryGenerator I)))* ((‖eisEmbedding (primaryGenerator J)‖:ℂ)*gaussTwo I hI* Ψ (primaryGenerator I)*(Ψ (primaryGenerator J))^3) := by ring _ = _ := by rw [hunit,one_mul] end open ActualEisensteinCubic CompletedGauss CubicJacobiGlobal namespace RootNotationFiniteTranslations05 abbrev Eis := ActualEisensteinCubic.O end RootNotationFiniteTranslations05 open RootNotationFiniteTranslations05 (Eis) lemma sourceFourier_primary_squarefree_cube_preimage (x:Eis) (hx:lambda^2∣x-1) (hT:sourceResidualFourierCoefficient x≠0) : ∃p:({I:Ideal Eis // Squarefree I ∧ primaryGenerator I≠0} × {J:Ideal Eis // primaryGenerator J≠0}), primaryGenerator p.1.val*(primaryGenerator p.2.val)^3=x := by have hx0:x≠0:=primary_ne_zero x hx have hgen:primaryGenerator (Ideal.span {x})=x:=primaryGenerator_span x hx0 hx have hg:primaryGenerator (Ideal.span {x})≠0:=by rwa [hgen] have ht:sourceResidualFourierCoefficient (primaryGenerator (Ideal.span {x}))≠0:=by rwa [hgen] obtain ⟨I,J,hI,hgI,hgJ,hIJ⟩:=sourceFourier_squarefree_cube_support (Ideal.span {x}) hg ht refine ⟨(⟨I,hI,hgI⟩,⟨J,hgJ⟩),?_⟩ have he:=congrArg primaryGenerator hIJ simpa only [primaryGenerator_mul,primaryGenerator_pow,hgen] using he theorem sourceFourier_tsum_primary_pairs (w:Eis→ℂ) (hw:∀x:Eis,w x≠0→lambda^2∣x-1) : (∑'x:Eis,w x*star (sourceResidualFourierCoefficient x))= ∑'p:({I:Ideal Eis // Squarefree I ∧ primaryGenerator I≠0} × {J:Ideal Eis // primaryGenerator J≠0}), w (primaryGenerator p.1.val*(primaryGenerator p.2.val)^3)* star (sourceResidualFourierCoefficient (primaryGenerator p.1.val*(primaryGenerator p.2.val)^3)) := by let P:=({I:Ideal Eis // Squarefree I ∧ primaryGenerator I≠0} × {J:Ideal Eis // primaryGenerator J≠0}) let phi:P→Eis:=fun p=>primaryGenerator p.1.val*(primaryGenerator p.2.val)^3 let f:Eis→ℂ:=fun x=>w x*star (sourceResidualFourierCoefficient x) change (∑'x:Eis,f x)=∑'p:P,f (phi p) apply tsum_eq_tsum_of_ne_zero_bij (fun p:Function.support (fun p:P=>f (phi p))=>phi p.val) · exact primary_squarefree_cube_injective.comp Subtype.val_injective · intro x hx have hwx:w x≠0:=by intro hz exact hx (by simp only [f,hz,zero_mul]) have hTx:sourceResidualFourierCoefficient x≠0:=by intro hz exact hx (by simp only [f,hz,star_zero,mul_zero]) obtain ⟨p,hp⟩:=sourceFourier_primary_squarefree_cube_preimage x (hw x hwx) hTx have hphi:phi p=x:=hp have hfp:f (phi p)≠0:=by rwa [hphi] exact ⟨⟨p,hfp⟩,hphi⟩ · intro p rfl end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.RamifiedTransform namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal noncomputable abbrev instFintypeUnitsO_7 : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units def lowRamifiedTransform (F:_root_.OAI.ActualEisensteinCubic.O→ℂ) (h:_root_.OAI.ActualEisensteinCubic.O) :ℂ := letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_7 3*F (9*h)+∑u:_root_.OAI.ActualEisensteinCubic.Oˣ,∑k:Fin 5,ramifiedRawWeight h u k.val* F (h*(9*(u.val*lambda^(k.val+2)))) lemma principalArithmeticResidue_low (a r:Fin 3) (n:_root_.OAI.ActualEisensteinCubic.O) (hn:lambda^2∣n-1) : letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_7 principalArithmeticResidue (lowRamifiedFrequency a r*n)= (∑u:_root_.OAI.ActualEisensteinCubic.Oˣ,∑k:Fin 5,ramifiedRawWeight (lowRamifiedFrequency a r*n) u k.val* unramifiedGaussResidue ((lowRamifiedFrequency a r*n)*(9*(u.val*lambda^(k.val+2)))))/ ((9*Real.sqrt 3/2:ℝ):ℂ) := by letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_7 exact ( by let h:=lowRamifiedFrequency a r*n have hh:h≠0:=mul_ne_zero (lowRamifiedFrequency_ne_zero a r) (primary_ne_zero n hn) let N:=max (ramifiedFrequencyBound h+1) 5 rw [principalArithmeticResidue_eq_sum h hh N (le_max_left _ _)] apply congrArg (fun z:ℂ=>z/((9*Real.sqrt 3/2:ℝ):ℂ)) apply Finset.sum_congr rfl intro u hu change (∑k∈Finset.range N,principalResidueTerm h u k)= ∑k:Fin 5,principalResidueTerm h u k.val rw [Fin.sum_univ_eq_sum_range] symm apply Finset.sum_subset (Finset.range_mono (le_max_right _ _)) intro k hk hk5 have hz:=lowRamifiedFrequency_primary_vanish a r n hn u k (by simpa only [Finset.mem_range,not_lt] using hk5) simp only [principalResidueTerm,h,hz,mul_zero,zero_mul] ) lemma sourceRayPhase_of_three_dvd (h:_root_.OAI.ActualEisensteinCubic.O) (hh:(3:_root_.OAI.ActualEisensteinCubic.O)∣h) : ShortDraftTrace.breveE (cuspFrequency h)=1 := by obtain ⟨z,rfl⟩:=hh have he:cuspFrequency ((3:_root_.OAI.ActualEisensteinCubic.O)*z)=eisEmbedding z/eisLam:=by simp only [cuspFrequency,map_mul,map_ofNat] ring rw [he] exact breveE_embedding_div_traceLambda z lemma lowRamifiedFrequency_three_dvd (a r:Fin 3) : (3:_root_.OAI.ActualEisensteinCubic.O)∣lowRamifiedFrequency a r := by simpa only [lowRamifiedFrequency,←ramifiedOmegaUnit_val,←Units.val_pow_eq_pow_val] using ramifiedElement_level (ramifiedOmegaUnit^a.val) (r.val+2) (by omega) theorem lowRamifiedTransform_actual (a r:Fin 3) (n:_root_.OAI.ActualEisensteinCubic.O) (hn:lambda^2∣n-1) : lowRamifiedTransform unramifiedGaussResidue (lowRamifiedFrequency a r*n)= (4*((9*Real.sqrt 3/2:ℝ):ℂ))*sourceArithmeticResidue (lowRamifiedFrequency a r*n) := by letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_7 exact ( by rw [sourceArithmeticResidue,if_pos (sourceRayPhase_of_three_dvd _ (dvd_mul_of_dvd_left (lowRamifiedFrequency_three_dvd a r) n)), principalArithmeticResidue_low a r n hn] unfold lowRamifiedTransform field_simp [show ((9*Real.sqrt 3/2:ℝ):ℂ)≠0 by exact_mod_cast (show (9*Real.sqrt 3/2:ℝ)≠0 by positivity)] ; ring ) lemma lowRamifiedTransform_sub (F G:_root_.OAI.ActualEisensteinCubic.O→ℂ) (h:_root_.OAI.ActualEisensteinCubic.O) : lowRamifiedTransform (fun x=>F x-G x) h= lowRamifiedTransform F h-lowRamifiedTransform G h := by letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_7 exact ( by simp only [lowRamifiedTransform,mul_sub,Finset.sum_sub_distrib] ring ) lemma ramifiedRawWeight_frequency_cube (h p:_root_.OAI.ActualEisensteinCubic.O) (hp:lambda^2∣p-1) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (k:ℕ) : ramifiedRawWeight (h*p^3) u k=ramifiedRawWeight h u k := by rw [ramifiedRawWeight,ramifiedRawWeight,arithmeticResidueSum_frequency_cube h _ p (ramifiedElement_ne_zero u (k+2)) (ramifiedElement_level u (k+2) (by omega)) hp (ramified_primary_coprime u (k+2) p hp).of_mul_left_right] lemma lowRamifiedTransform_cube_comp (F:_root_.OAI.ActualEisensteinCubic.O→ℂ) (h p:_root_.OAI.ActualEisensteinCubic.O) (hp:lambda^2∣p-1) : lowRamifiedTransform (fun x=>F (x*p^3)) h=lowRamifiedTransform F (h*p^3) := by letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_7 exact ( by simp only [lowRamifiedTransform,ramifiedRawWeight_frequency_cube h p hp] have he:9*h*p^3=9*(h*p^3):=by ring rw [he] congr 1 apply Finset.sum_congr rfl intro u hu apply Finset.sum_congr rfl intro k hk congr 1 ring_nf ) theorem lowRamifiedTransform_cube_difference (p:_root_.OAI.ActualEisensteinCubic.O) (hp:Prime p) (hpp:lambda^2∣p-1) (a r:Fin 3) (n:_root_.OAI.ActualEisensteinCubic.O) (hn:lambda^2∣n-1) : lowRamifiedTransform (fun x=>unramifiedGaussResidue (x*p^3)-unramifiedGaussResidue x) (lowRamifiedFrequency a r*n)=0 := by rw [lowRamifiedTransform_sub,lowRamifiedTransform_cube_comp _ _ p hpp] have hnp:lambda^2∣n*p^3-1:=primary_mul n (p^3) hn (primary_pow_congruence p hpp 3) rw [mul_assoc,lowRamifiedTransform_actual a r (n*p^3) hnp, lowRamifiedTransform_actual a r n hn] rw [←mul_assoc,sourceArithmeticResidue_prime_cube p hp hpp _ (mul_ne_zero (lowRamifiedFrequency_ne_zero a r) (primary_ne_zero n hn)),sub_self] end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal noncomputable abbrev instFintypeUnitsO_8 : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := @Fintype.ofFinite _ PrimaryIdealUnitReindex.finite_units lemma ramifiedFunction_reduce (F:_root_.OAI.ActualEisensteinCubic.O→ℂ) (hneg:∀x,F (-x)=F x) (hpow:∀x m,F (x*lambda^m)=F (x*lambda^(m%3))) (n:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) : ∃j k:Fin 3,F (n*((u:_root_.OAI.ActualEisensteinCubic.O)*lambda^m))=F (n*omega^j.val*lambda^k.val) := by obtain ⟨j,hj|hj⟩:=unit_eq_sign_omega u · refine ⟨j,⟨m%3,Nat.mod_lt _ (by decide)⟩,?_⟩ rw [hj,←mul_assoc,hpow] · refine ⟨j,⟨m%3,Nat.mod_lt _ (by decide)⟩,?_⟩ rw [hj,neg_mul,mul_neg,hneg,←mul_assoc,hpow] lemma ramifiedFunction_family_bound (F:_root_.OAI.ActualEisensteinCubic.O→ℂ) (hneg:∀x,F (-x)=F x) (hpow:∀x m,F (x*lambda^m)=F (x*lambda^(m%3))) (n:_root_.OAI.ActualEisensteinCubic.O) (M:ℝ) (hM:∀j k:Fin 3,‖F (n*omega^j.val*lambda^k.val)‖≤M) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) : ‖F (n*((u:_root_.OAI.ActualEisensteinCubic.O)*lambda^m))‖≤M := by obtain ⟨j,k,hjk⟩:=ramifiedFunction_reduce F hneg hpow n u m rw [hjk] exact hM j k lemma ramifiedNine_eq : (9:_root_.OAI.ActualEisensteinCubic.O)=omega*lambda^4 := by have hw:omega^2=-omega-1:=by linear_combination ramified_omega_relation have hl:lambda^2=-3*omega:=by change (omega-1)^2=-3*omega linear_combination hw calc (9:_root_.OAI.ActualEisensteinCubic.O)=9*omega^3:=by rw [omega_primitive.pow_eq_one]; ring _=omega*((-3*omega)^2):=by ring _=omega*((lambda^2)^2):=by rw [hl] _=omega*lambda^4:=by ring lemma lowRamified_inner_family (a r:Fin 3) (n:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (k:ℕ) : (lowRamifiedFrequency a r*n)*(9*(u.val*lambda^(k+2)))= n*((↑(ramifiedOmegaUnit^(a.val+1)*u):_root_.OAI.ActualEisensteinCubic.O)*lambda^(r.val+k+8)) := by simp only [lowRamifiedFrequency,ramifiedNine_eq,Units.val_mul,Units.val_pow_eq_pow_val, ramifiedOmegaUnit_val] rw [show r.val+k+8=(r.val+2)+(4+(k+2)) by omega] simp only [pow_add,pow_one] ring lemma lowRamifiedLeading (F:_root_.OAI.ActualEisensteinCubic.O→ℂ) (hpow:∀x m,F (x*lambda^m)=F (x*lambda^(m%3))) (n:_root_.OAI.ActualEisensteinCubic.O) (j k:Fin 3) : F (9*(lowRamifiedFrequency ⟨(j.val+2)%3,Nat.mod_lt _ (by decide)⟩ k*n))= F (n*omega^j.val*lambda^k.val) := by have ho:omega^((j.val+2)%3+1)=omega^j.val:=by fin_cases j <;> norm_num [omega_primitive.pow_eq_one] have he:9*(lowRamifiedFrequency ⟨(j.val+2)%3,Nat.mod_lt _ (by decide)⟩ k*n)= (n*omega^j.val)*lambda^(k.val+6):=by simp only [lowRamifiedFrequency,ramifiedNine_eq] rw [show k.val+6=4+(k.val+2) by omega,pow_add,←ho,pow_succ] ring rw [he,hpow,show (k.val+6)%3=k.val by omega] lemma lowRamified_remainder_bound (F:_root_.OAI.ActualEisensteinCubic.O→ℂ) (hneg:∀x,F (-x)=F x) (hpow:∀x m,F (x*lambda^m)=F (x*lambda^(m%3))) (n:_root_.OAI.ActualEisensteinCubic.O) (hn:lambda^2∣n-1) (M:ℝ) (hM0:0≤M) (hM:∀j k:Fin 3,‖F (n*omega^j.val*lambda^k.val)‖≤M) (a r:Fin 3) : letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_8 ‖∑u:_root_.OAI.ActualEisensteinCubic.Oˣ,∑k:Fin 5,ramifiedRawWeight (lowRamifiedFrequency a r*n) u k.val* F ((lowRamifiedFrequency a r*n)*(9*(u.val*lambda^(k.val+2))))‖≤(5/3)*M := by letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_8 exact ( by calc _≤∑u:_root_.OAI.ActualEisensteinCubic.Oˣ,∑k:Fin 5,‖ramifiedRawWeight (lowRamifiedFrequency a r*n) u k.val* F ((lowRamifiedFrequency a r*n)*(9*(u.val*lambda^(k.val+2))))‖:=by exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun u hu=>norm_sum_le _ _)) _≤∑u:_root_.OAI.ActualEisensteinCubic.Oˣ,∑k:Fin 5,‖ramifiedRawWeight (lowRamifiedFrequency a r*n) u k.val‖*M:=by apply Finset.sum_le_sum intro u hu apply Finset.sum_le_sum intro k hk rw [norm_mul,lowRamified_inner_family] exact mul_le_mul_of_nonneg_left (ramifiedFunction_family_bound F hneg hpow n M hM _ _) (norm_nonneg _) _=(∑u:_root_.OAI.ActualEisensteinCubic.Oˣ,∑k:Fin 5,‖ramifiedRawWeight (lowRamifiedFrequency a r*n) u k.val‖)*M:=by simp only [Finset.sum_mul] _≤(5/3)*M:=mul_le_mul_of_nonneg_right (lowRamifiedRawWeight_sum a r n hn) hM0 ) theorem lowRamifiedTransform_injective (F:_root_.OAI.ActualEisensteinCubic.O→ℂ) (hneg:∀x,F (-x)=F x) (hpow:∀x m,F (x*lambda^m)=F (x*lambda^(m%3))) (n:_root_.OAI.ActualEisensteinCubic.O) (hn:lambda^2∣n-1) (hz:∀a r:Fin 3,lowRamifiedTransform F (lowRamifiedFrequency a r*n)=0) : ∀j k:Fin 3,F (n*omega^j.val*lambda^k.val)=0 := by letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_7 letI explicitWitness12 := OAI.CubicEisenstein.instFintypeUnitsO_8 exact ( by obtain ⟨i,hi,himax⟩:=Finset.exists_max_image (Finset.univ:Finset (Fin 3×Fin 3)) (fun i=>‖F (n*omega^i.1.val*lambda^i.2.val)‖) Finset.univ_nonempty let M:=‖F (n*omega^i.1.val*lambda^i.2.val)‖ have hM:∀j k:Fin 3,‖F (n*omega^j.val*lambda^k.val)‖≤M:=by intro j k exact himax (j,k) (Finset.mem_univ _) let a:Fin 3:=⟨(i.1.val+2)%3,Nat.mod_lt _ (by decide)⟩ have hb:=lowRamified_remainder_bound F hneg hpow n hn M (norm_nonneg _) hM a i.2 have he:=hz a i.2 unfold lowRamifiedTransform at he have hlead:F (9*(lowRamifiedFrequency a i.2*n))=F (n*omega^i.1.val*lambda^i.2.val):= lowRamifiedLeading F hpow n i.1 i.2 rw [hlead] at he have hnorm:3*M≤(5/3)*M:=by have heq:3*F (n*omega^i.1.val*lambda^i.2.val)= -(∑u:_root_.OAI.ActualEisensteinCubic.Oˣ,∑k:Fin 5,ramifiedRawWeight (lowRamifiedFrequency a i.2*n) u k.val* F ((lowRamifiedFrequency a i.2*n)*(9*(u.val*lambda^(k.val+2))))):=by linear_combination he have hh:=congrArg norm heq rw [norm_mul,Complex.norm_ofNat,norm_neg] at hh exact hh.le.trans hb have hmzero:M=0:=by have hm0:0≤M:=norm_nonneg _; nlinarith intro j k exact norm_eq_zero.mp (le_antisymm (hmzero ▸ hM j k) (norm_nonneg _)) ) end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss lemma exists_primary_unit_lambda_factor (h:_root_.OAI.ActualEisensteinCubic.O) (hh:h≠0) : ∃n:_root_.OAI.ActualEisensteinCubic.O,∃u:_root_.OAI.ActualEisensteinCubic.Oˣ,∃m:ℕ,lambda^2∣n-1 ∧ h=n*((u:_root_.OAI.ActualEisensteinCubic.O)*lambda^m) := by obtain ⟨⟨m,J⟩,hm⟩:=lambdaFactorMap_bijective.2 ⟨Ideal.span {h},Ideal.span_singleton_eq_bot.not.mpr hh⟩ have hi:ramifiedIdeal^m*J.val=Ideal.span {h}:=congrArg Subtype.val hm have hs:Ideal.span {lambda^m*primaryGenerator J.val}=Ideal.span {h}:=by rw [lambdaFactor_generator_span,hi] obtain ⟨u,hu⟩:=Ideal.span_singleton_eq_span_singleton.mp hs refine ⟨primaryGenerator J.val,u,m,(primaryGenerator_spec J.val J.property).2,?_⟩ linear_combination -hu theorem unramifiedGaussResidue_prime_cube (p:_root_.OAI.ActualEisensteinCubic.O) (hp:Prime p) (hpp:lambda^2∣p-1) (h:_root_.OAI.ActualEisensteinCubic.O) : unramifiedGaussResidue (h*p^3)=unramifiedGaussResidue h := by by_cases hh:h=0 · simp only [hh,zero_mul] obtain ⟨n,u,m,hn,hfactor⟩:=exists_primary_unit_lambda_factor h hh let F:_root_.OAI.ActualEisensteinCubic.O→ℂ:=fun x=>unramifiedGaussResidue (x*p^3)-unramifiedGaussResidue x have hneg:∀x,F (-x)=F x:=by intro x dsimp only [F] rw [neg_mul,unramifiedGaussResidue_neg,unramifiedGaussResidue_neg] have hpow:∀x k,F (x*lambda^k)=F (x*lambda^(k%3)):=by intro x k dsimp only [F] have h1:unramifiedGaussResidue ((x*lambda^k)*p^3)= unramifiedGaussResidue ((x*lambda^(k%3))*p^3):=by rw [show (x*lambda^k)*p^3=(x*p^3)*lambda^k by ring, show (x*lambda^(k%3))*p^3=(x*p^3)*lambda^(k%3) by ring] exact unramifiedGaussResidue_lambda_pow (x*p^3) k exact congrArg₂ (fun a b:ℂ=>a-b) h1 (unramifiedGaussResidue_lambda_pow x k) have hz:∀j k:Fin 3,F (n*omega^j.val*lambda^k.val)=0:= lowRamifiedTransform_injective F hneg hpow n hn (fun a r=>lowRamifiedTransform_cube_difference p hp hpp a r n hn) obtain ⟨j,k,hjk⟩:=ramifiedFunction_reduce F hneg hpow n u m have hF:F h=0:=by rw [hfactor,hjk,hz] exact sub_eq_zero.mp hF end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal lemma unramifiedGaussResidue_prime_pow_mod (p:_root_.OAI.ActualEisensteinCubic.O) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:_root_.OAI.ActualEisensteinCubic.O) (_hh:h≠0) (n:ℕ) : unramifiedGaussResidue (h*p^n)=unramifiedGaussResidue (h*p^(n%3)) := by induction n using Nat.strong_induction_on with | h n ih=> by_cases hn:n<3 · rw [Nat.mod_eq_of_lt hn] · have hn3:3≤n:=by omega have he:h*p^n=(h*p^(n-3))*p^3:=by rw [mul_assoc,←pow_add,Nat.sub_add_cancel hn3] rw [he,unramifiedGaussResidue_prime_cube p hp hprimary _, ih (n-3) (by omega)] have hm:(n-3)%3=n%3:=by omega rw [hm] theorem unramifiedGaussResidue_prime_square (p:_root_.OAI.ActualEisensteinCubic.O) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:_root_.OAI.ActualEisensteinCubic.O) (hph:¬p∣h) : unramifiedGaussResidue (h*p^2)=0 := by have hh:h≠0:=fun he=>hph (he▸dvd_zero p) have he:=unramifiedGaussResidue_square_cube p hp hprimary h hph rw [show h*p^5=(h*p^2)*p^3 by ring, unramifiedGaussResidue_prime_cube p hp hprimary _] at he have hq:(Ideal.absNorm (Ideal.span {p}):ℂ)≠0:=Nat.cast_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (Ideal.span_singleton_eq_bot.not.mpr hp.ne_zero)) have hz:(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹*unramifiedGaussResidue (h*p^2)=0:=by linear_combination -he exact (mul_eq_zero.mp hz).resolve_left (inv_ne_zero hq) theorem unramifiedGaussResidue_prime_factor (p:_root_.OAI.ActualEisensteinCubic.O) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:_root_.OAI.ActualEisensteinCubic.O) (hph:¬p∣h) : unramifiedGaussResidue (h*p)= (Ideal.absNorm (Ideal.span {p}):ℂ)^(-(2/3:ℂ))* primeCubicGauss p hp hprimary 2 h*unramifiedGaussResidue h := by have hh:h≠0:=fun he=>hph (he▸dvd_zero p) have hrec:=unramifiedGaussResidue_prime_recurrence p hp hprimary h hph rw [unramifiedGaussResidue_prime_cube p hp hprimary h] at hrec have hrel:(Ideal.absNorm (Ideal.span {p}):ℂ)^(-(4/3:ℂ))* primeCubicGauss p hp hprimary 1 h*unramifiedGaussResidue (h*p)= (Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹*unramifiedGaussResidue h:=by linear_combination hrec have hG:=primeCubicGauss_one_mul_two p hp hprimary h hph let q:ℂ:=(Ideal.absNorm (Ideal.span {p}):ℂ) have hq:q≠0:=Nat.cast_ne_zero.mpr (Ideal.absNorm_eq_zero_iff.not.mpr (Ideal.span_singleton_eq_bot.not.mpr hp.ne_zero)) have hpower:q^(-(2/3:ℂ))*q^(-(4/3:ℂ))*q^2=1:=by rw [←Complex.cpow_add _ _ hq,←Complex.cpow_natCast q 2, ←Complex.cpow_add _ _ hq] norm_num calc unramifiedGaussResidue (h*p)= (q^(-(2/3:ℂ))*q^(-(4/3:ℂ))*q^2)*unramifiedGaussResidue (h*p):=by rw [hpower,one_mul] _=q^(-(2/3:ℂ))*q*primeCubicGauss p hp hprimary 2 h* (q^(-(4/3:ℂ))*primeCubicGauss p hp hprimary 1 h*unramifiedGaussResidue (h*p)):=by calc _=q^(-(2/3:ℂ))*q^(-(4/3:ℂ))*q* (primeCubicGauss p hp hprimary 1 h*primeCubicGauss p hp hprimary 2 h)* unramifiedGaussResidue (h*p):=by rw [hG];ring _=_:=by ring _=q^(-(2/3:ℂ))*q*primeCubicGauss p hp hprimary 2 h*(q⁻¹*unramifiedGaussResidue h):=by rw [hrel] _=_:=by change q^(-(2/3:ℂ))*q*primeCubicGauss p hp hprimary 2 h*(q⁻¹*unramifiedGaussResidue h)= q^(-(2/3:ℂ))*primeCubicGauss p hp hprimary 2 h*unramifiedGaussResidue h field_simp [hq] theorem unramifiedGaussResidue_prime_power_table (p:_root_.OAI.ActualEisensteinCubic.O) (hp:Prime p) (hprimary:lambda^2∣p-1) (h:_root_.OAI.ActualEisensteinCubic.O) (hph:¬p∣h) (n:ℕ) : unramifiedGaussResidue (h*p^n)= if n%3=0 then unramifiedGaussResidue h else if n%3=1 then (Ideal.absNorm (Ideal.span {p}):ℂ)^(-(2/3:ℂ))* primeCubicGauss p hp hprimary 2 h*unramifiedGaussResidue h else 0 := by have hh:h≠0:=fun he=>hph (he▸dvd_zero p) rw [unramifiedGaussResidue_prime_pow_mod p hp hprimary h hh n] split_ifs with h0 h1 · simp only [h0,pow_zero,mul_one] · simp only [h1,pow_one] exact unramifiedGaussResidue_prime_factor p hp hprimary h hph · have hn:n%3=2:=by omega rw [hn,unramifiedGaussResidue_prime_square p hp hprimary h hph] end section open scoped BigOperators Classical open MeasureTheory open Finset AddChar MulChar EisensteinEmbedding section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss def thetaFrequencyScale : ℂ := 1/((3:ℂ)*eisLam) def thetaBesselScale : ℝ := ‖thetaFrequencyScale‖ def thetaDerivativeScalar : ℂ := (-2*Real.pi*Complex.I)*star thetaFrequencyScale*infinityCoefficientScalar lemma thetaFrequencyScale_ne_zero : thetaFrequencyScale≠0 := by exact one_div_ne_zero (mul_ne_zero (by norm_num) eisLam_ne_zero) lemma thetaBesselScale_pos : 0infinityCoefficientScalar*z) he simp only [←mul_assoc,mul_inv_cancel₀ infinityCoefficientScalar_ne_zero,one_mul] at he' rw [completedCoefficient_mul_length Ψ I J hI hJ hsq,cuspFrequency_eq_thetaFrequencyScale,star_mul] unfold thetaDerivativeScalar calc _ = (-2*Real.pi*Complex.I*star thetaFrequencyScale)* star (eisEmbedding (primaryGenerator I.val*(primaryGenerator J.val)^3))* (star (sourceResidualFourierCoefficient (primaryGenerator I.val*(primaryGenerator J.val)^3))* fixedThetaTwist Ψ (primaryGenerator I.val*(primaryGenerator J.val)^3)) := by ring _ = _ := by rw [he'];ring end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss def thetaTwistedSource (Ψ : _root_.OAI.ActualEisensteinCubic.O→*ℂ) (c : _root_.OAI.ActualEisensteinCubic.O) (hc : c≠0) [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {c})] (v : ℝ) (hv : 0(-2*Real.pi*Complex.I*star (cuspFrequency h))* fixedThetaTwist Ψ h*(v:ℂ)*schlafliBesselK (1/3) (4*Real.pi*‖cuspFrequency h‖*v) have hw : ∀h:_root_.OAI.ActualEisensteinCubic.O,w h≠0→lambda^2∣h-1 := by intro h hwh by_contra hh exact hwh (by simp only [w,fixedThetaTwist_not_primary Ψ h hh,mul_zero,zero_mul]) calc _ = ∑'h:_root_.OAI.ActualEisensteinCubic.O,w h*star (sourceResidualFourierCoefficient h) := by apply tsum_congr intro h dsimp only [w] ring _ = ∑'p:({I:Ideal _root_.OAI.ActualEisensteinCubic.O // Squarefree I ∧ primaryGenerator I≠0} × {J:Ideal _root_.OAI.ActualEisensteinCubic.O // primaryGenerator J≠0}), w (primaryGenerator p.1.val*(primaryGenerator p.2.val)^3)* star (sourceResidualFourierCoefficient (primaryGenerator p.1.val*(primaryGenerator p.2.val)^3)) := sourceFourier_tsum_primary_pairs w hw _ = thetaDerivativeScalar*completedBesselProfile Ψ thetaBesselScale v := by rw [completedBesselProfile_primary_pairs,←tsum_mul_left] apply tsum_congr intro p let ip := primaryCubePairToMellinIndex p have he := thetaPair_derivative_coefficient Ψ ip.1 ip.2 p.1.property.2 p.2.property p.1.property.1 have hn := thetaPair_frequency_norm ip.1 ip.2 p.1.property.2 p.2.property change (-2*Real.pi*Complex.I*star (cuspFrequency (primaryGenerator ip.1.val*(primaryGenerator ip.2.val)^3)))* fixedThetaTwist Ψ (primaryGenerator ip.1.val*(primaryGenerator ip.2.val)^3)*(v:ℂ)* schlafliBesselK (1/3) (4*Real.pi*‖cuspFrequency (primaryGenerator ip.1.val*(primaryGenerator ip.2.val)^3)‖*v)* star (sourceResidualFourierCoefficient (primaryGenerator ip.1.val*(primaryGenerator ip.2.val)^3)) = thetaDerivativeScalar*((completedMellinCoefficient Ψ ip*(completedMellinLength ip:ℂ))*(v:ℂ)* schlafliBesselK (1/3) (4*Real.pi*thetaBesselScale*Real.sqrt (completedMellinLength ip)*v)) rw [hn,show 4*Real.pi*(thetaBesselScale*Real.sqrt (completedMellinLength ip))*v= 4*Real.pi*thetaBesselScale*Real.sqrt (completedMellinLength ip)*v by ring] calc _ = ((-2*Real.pi*Complex.I*star (cuspFrequency (primaryGenerator ip.1.val*(primaryGenerator ip.2.val)^3)))* fixedThetaTwist Ψ (primaryGenerator ip.1.val*(primaryGenerator ip.2.val)^3)* star (sourceResidualFourierCoefficient (primaryGenerator ip.1.val*(primaryGenerator ip.2.val)^3)))* (v:ℂ)*schlafliBesselK (1/3) (4*Real.pi*thetaBesselScale*Real.sqrt (completedMellinLength ip)*v) := by ring _ = _ := by rw [he];ring end open scoped BigOperators Classical open MeasureTheory open Finset AddChar MulChar EisensteinEmbedding open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss lemma horizontalWirtingerBar_finite_sum {ι : Type*} [Fintype ι] (f : ι→ℂ→ℂ) (weight : ι→ℂ) (z : ℂ) (h1 : ∀i,DifferentiableAt ℝ (fun t:ℝ=>f i (z+(t:ℂ))) 0) (hI : ∀i,DifferentiableAt ℝ (fun t:ℝ=>f i (z+(t:ℂ)*Complex.I)) 0) : horizontalWirtingerBar (fun w=>∑i,weight i*f i w) z= ∑i,weight i*horizontalWirtingerBar (f i) z := by unfold horizontalWirtingerBar rw [deriv_fun_sum (fun i hi=>(h1 i).const_mul (weight i)), deriv_fun_sum (fun i hi=>(hI i).const_mul (weight i))] simp only [deriv_const_mul_field,Finset.mul_sum,←Finset.sum_add_distrib] apply Finset.sum_congr rfl intro i hi ring lemma finiteConjugateSource_wirtingerBar_sum {ι : Type*} [Fintype ι] (shift weight : ι→ℂ) (v : ℝ) (hv : 0cubicSourceConjugateFunction (upperPoint (((t:ℂ)*direction)+shift i) v hv)) 0 := by have he : (fun t:ℝ=>cubicSourceConjugateFunction (upperPoint (((t:ℂ)*direction)+shift i) v hv))= fun t:ℝ=>star (sourceBesselCoefficients.fullFunction ((3*(Real.pi:ℂ))*constantArithmeticResidue) (upperPoint (shift i+(t:ℂ)*direction) v hv)) := by funext t simp only [cubicSourceConjugateFunction,cubicSourceResidualFunction_eq_bessel,sourceBesselFunction,add_comm] rw [he] exact (sourceBesselCoefficients.fullFunction_horizontal_hasDerivAt _ v hv (shift i) direction 0).differentiableAt.star rw [show finiteConjugateSource shift weight v hv= fun w=>∑i,weight i*cubicSourceConjugateFunction (upperPoint (w+shift i) v hv) from rfl] rw [horizontalWirtingerBar_finite_sum _ weight 0 (fun i=>by simpa only [zero_add,mul_one] using hd i 1) (fun i=>by simpa only [zero_add] using hd i Complex.I)] apply Finset.sum_congr rfl intro i hi rw [cuspBarProfile_positive _ _ _ hv] apply congrArg (fun z : ℂ => weight i * z) exact horizontalWirtingerBar_translate (fun z=>cubicSourceConjugateFunction (upperPoint z v hv)) (shift i) def thetaTwistedCuspProfile (Ψ : _root_.OAI.ActualEisensteinCubic.O→*ℂ) (c : _root_.OAI.ActualEisensteinCubic.O) (hc : c≠0) [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {c})] (v : ℝ) : ℂ := ∑h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {c},finiteAdditiveFourierCoeff (quotientTrace c hc) (fixedThetaQuotient Ψ c) h*cuspBarProfile cubicSourceConjugateFunction (thetaFourierTranslation c h) v theorem thetaTwistedCuspProfile_eq_completedBesselProfile (Ψ : _root_.OAI.ActualEisensteinCubic.O→*ℂ) (Q : Ideal _root_.OAI.ActualEisensteinCubic.O) (hΨ : CanonicalCoefficientClass.FactorsModulo Q Ψ) (c : _root_.OAI.ActualEisensteinCubic.O) (hc : c≠0) [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {c})] (hcQ : Ideal.span {c}≤Ideal.span {(9:_root_.OAI.ActualEisensteinCubic.O)}*Q) (v : ℝ) (hv : 0∑i,weight i*f i v) s) ∧ Differentiable ℂ (mellin (fun v=>∑i,weight i*f i v)) := by have hs (s : ℂ) (i : ι) : MellinConvergent (fun v=>weight i*f i v) s := by simpa only [smul_eq_mul] using (hf i).1 s |>.const_smul (weight i) have hsi (s : ℂ) (i : ι) : IntegrableOn (fun v:ℝ=>(v:ℂ)^(s-1)*(weight i*f i v)) (Set.Ioi 0) := by simpa only [MellinConvergent,smul_eq_mul] using hs s i have he (s : ℂ) : mellin (fun v=>∑i,weight i*f i v) s=∑i,weight i*mellin (f i) s := by unfold mellin simp only [smul_eq_mul,Finset.mul_sum] rw [integral_finsetSum Finset.univ (fun i hi=>hsi s i)] apply Finset.sum_congr rfl intro i hi simpa only [mellin,smul_eq_mul] using mellin_const_smul (f i) s (weight i) constructor · intro s change IntegrableOn (fun v:ℝ=>(v:ℂ)^(s-1)*(∑i,weight i*f i v)) (Set.Ioi 0) simpa only [IntegrableOn,Finset.mul_sum] using integrable_finsetSum Finset.univ (fun i hi=>hsi s i) · rw [show mellin (fun v=>∑i,weight i*f i v)=(fun s=>∑i,weight i*mellin (f i) s) from funext he] exact Differentiable.fun_sum (fun i hi=>(hf i).2.const_mul (weight i)) lemma thetaTwistedCuspProfile_mellin_entire (Ψ : Eis→*ℂ) (c : Eis) (hc : c≠0) [Fintype (Eis⧸Ideal.span {c})] : (∀s:ℂ,MellinConvergent (thetaTwistedCuspProfile Ψ c hc) s) ∧ Differentiable ℂ (mellin (thetaTwistedCuspProfile Ψ c hc)) := by apply finite_mellin_entire intro h have he : thetaFourierTranslation c h=(-3:ℂ)*eisEmbedding (Quotient.out h)/eisEmbedding c := by rw [thetaFourierTranslation,TraceLambdaPhase.eisLam_sq] rw [he] exact conjugateSource_finite_twist_cusp_mellin_entire (Quotient.out h) c hc theorem completedBesselProfile_mellin_entire_of_periodic (Ψ : Eis→*ℂ) (Q : Ideal Eis) (hΨ : CanonicalCoefficientClass.FactorsModulo Q Ψ) (c : Eis) (hc : c≠0) [Fintype (Eis⧸Ideal.span {c})] (hcQ : Ideal.span {c}≤Ideal.span {(9:Eis)}*Q) : (∀s:ℂ,MellinConvergent (completedBesselProfile Ψ thetaBesselScale) s) ∧ Differentiable ℂ (mellin (completedBesselProfile Ψ thetaBesselScale)) := by have hf := thetaTwistedCuspProfile_mellin_entire Ψ c hc have he (v : ℝ) (hv : 0thetaDerivativeScalar⁻¹*mellin (thetaTwistedCuspProfile Ψ c hc) s) from funext hm] exact hf.2.const_mul _ end CubicEisenstein namespace CompletedGauss open Filter MeasureTheory open scoped Classical BigOperators Topology ContDiff lemma mellin_eq_of_positive_eq (F G : ℝ→ℂ) (hFG : ∀v : ℝ,0∑i,w i*F i v) q s= ∑i,w i*continuedBesselDirichlet (F i) q s := by have hi (i : ι) : IntegrableOn (fun v : ℝ=>(v:ℂ)^(2*s-1)*(w i*F i v)) (Set.Ioi 0) := by simpa only [MellinConvergent,smul_eq_mul] using (hF i).const_smul (w i) have hm : mellin (fun v=>∑i,w i*F i v) (2*s)=∑i,w i*mellin (F i) (2*s) := by unfold mellin simp only [smul_eq_mul,Finset.mul_sum] rw [integral_finsetSum Finset.univ (fun i _=>hi i)] apply Finset.sum_congr rfl intro i _ simpa only [mellin,smul_eq_mul] using mellin_const_smul (F i) (2*s) (w i) rw [continuedBesselDirichlet,hm,Finset.mul_sum] apply Finset.sum_congr rfl intro i _ unfold continuedBesselDirichlet ring lemma besselSmoothingIntegrand_finite_sum {ι : Type*} [Fintype ι] (F : ℝ→ℂ) (G : ι→ℝ→ℂ) (w : ι→ℂ) (hFG : ∀v : ℝ,0∑i,w i*G i v) hFG (2*s) have hd : continuedBesselDirichlet F q s= continuedBesselDirichlet (fun v=>∑i,w i*G i v) q s := by simp only [continuedBesselDirichlet,hm] rw [besselSmoothingIntegrand,hd,continuedBesselDirichlet_finite_sum G w q s hG, Finset.mul_sum] apply Finset.sum_congr rfl intro i _ unfold besselSmoothingIntegrand ring theorem besselSmoothingIntegrand_finite_integrable {ι : Type*} [Fintype ι] (F : ℝ→ℂ) (G : ι→ℝ→ℂ) (w : ι→ℂ) (hFG : ∀v : ℝ,0besselSmoothingIntegrand (G i) q V X ((σ:ℂ)+t*Complex.I))) : Integrable (fun t : ℝ=>besselSmoothingIntegrand F q V X ((σ:ℂ)+t*Complex.I)) := by have hsum := integrable_finsetSum Finset.univ (fun i _=>(hi i).const_mul (w i)) apply hsum.congr filter_upwards with t exact (besselSmoothingIntegrand_finite_sum F G w hFG q V X _ (fun i=>hG i t)).symm end CompletedGauss open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss namespace RootNotationEntireMellinProfile02 abbrev Eis := ActualEisensteinCubic.O end RootNotationEntireMellinProfile02 open RootNotationEntireMellinProfile02 (Eis) def unramifiedResidualCoefficient (h:Eis) :ℂ:=cubicBesselNormalizer h*unramifiedGaussResidue h lemma primeCubicGauss_two_norm (p:Eis) (hp:Prime p) (hpp:lambda^2∣p-1) (h:Eis) (hph:¬p∣h) : ‖primeCubicGauss p hp hpp 2 h‖=‖eisEmbedding p‖ := by have he:=congrArg norm (primeCubicGauss_one_mul_two p hp hpp h hph) rw [norm_mul,primeCubicGauss_two_eq_star,norm_star,Complex.norm_natCast] at he have hn:=eisEmbedding_norm_sq_eq_absNorm_span p have hg:0≤‖primeCubicGauss p hp hpp 1 h‖:=norm_nonneg _ have hr:0≤‖eisEmbedding p‖:=norm_nonneg _ rw [primeCubicGauss_two_eq_star,norm_star] nlinarith lemma unramifiedResidualCoefficient_prime_factor (p:Eis) (hp:Prime p) (hpp:lambda^2∣p-1) (h:Eis) (hph:¬p∣h) : unramifiedResidualCoefficient (h*p)= (primeCubicGauss p hp hpp 2 h/(‖eisEmbedding p‖:ℂ))*unramifiedResidualCoefficient h := by rw [unramifiedResidualCoefficient,cubicBesselNormalizer_mul, unramifiedGaussResidue_prime_factor p hp hpp h hph,unramifiedResidualCoefficient] calc _=((‖eisEmbedding p‖:ℂ)^(1/3:ℂ)*(Ideal.absNorm (Ideal.span {p}):ℂ)^(-(2/3:ℂ)))* primeCubicGauss p hp hpp 2 h*(cubicBesselNormalizer h*unramifiedGaussResidue h):=by ring _=_:=by rw [prime_normalizer_powers p hp.ne_zero]; ring lemma unramifiedResidualCoefficient_prime_norm (p:Eis) (hp:Prime p) (hpp:lambda^2∣p-1) (h:Eis) (hph:¬p∣h) : ‖unramifiedResidualCoefficient (h*p)‖=‖unramifiedResidualCoefficient h‖ := by rw [unramifiedResidualCoefficient_prime_factor p hp hpp h hph,norm_mul,norm_div, primeCubicGauss_two_norm p hp hpp h hph,Complex.norm_real, Real.norm_eq_abs,abs_of_nonneg (norm_nonneg _), div_self (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hp.ne_zero)),one_mul] theorem unramifiedGaussResidue_primary_cube (b:Eis) (hb:b≠0) (hbp:lambda^2∣b-1) (h:Eis) : unramifiedGaussResidue (h*b^3)=unramifiedGaussResidue h := by obtain ⟨s,hs,hpr⟩:=exists_primary_prime_factorization b hb hbp rw [←hs] clear hs hb hbp b induction s using Multiset.induction_on generalizing h with | empty=>simp | @cons p s ih=> have hp:=hpr p (Multiset.mem_cons_self _ _) have hs:∀q∈s,Prime q∧lambda^2∣q-1:=fun q hq=>hpr q (Multiset.mem_cons_of_mem hq) rw [Multiset.prod_cons,show h*(p*s.prod)^3=(h*s.prod^3)*p^3 by ring, unramifiedGaussResidue_prime_cube p hp.1 hp.2] exact ih h hs lemma unramifiedResidualCoefficient_primary_cube (b:Eis) (hb:b≠0) (hbp:lambda^2∣b-1) (h:Eis) : unramifiedResidualCoefficient (h*b^3)= (‖eisEmbedding b‖:ℂ)*unramifiedResidualCoefficient h := by rw [unramifiedResidualCoefficient,cubicBesselNormalizer_mul_cube h b hb, unramifiedGaussResidue_primary_cube b hb hbp h,unramifiedResidualCoefficient] ring theorem unramifiedResidualCoefficient_prime_product_norm {ι:Type*} (s:Finset ι) (p:ι→Eis) (hp:∀i∈s,Prime (p i)) (hprimary:∀i∈s,lambda^2∣p i-1) (hpair:∀i∈s,∀j∈s,i≠j→IsCoprime (p i) (p j)) (h:Eis) (hph:∀i∈s,¬p i∣h) : ‖unramifiedResidualCoefficient (h*(∏i∈s,p i))‖=‖unramifiedResidualCoefficient h‖ := by classical induction s using Finset.induction_on with | empty=>simp | @insert i s hi ih=> have hpi:=hp i (Finset.mem_insert_self _ _) have hpri:=hprimary i (Finset.mem_insert_self _ _) have hps:∀j∈s,Prime (p j):=fun j hj=>hp j (Finset.mem_insert_of_mem hj) have hprs:∀j∈s,lambda^2∣p j-1:=fun j hj=>hprimary j (Finset.mem_insert_of_mem hj) have hcpi:IsCoprime (p i) (∏j∈s,p j):=IsCoprime.prod_right (fun j hj=> hpair i (Finset.mem_insert_self _ _) j (Finset.mem_insert_of_mem hj) (by intro he;subst j;exact hi hj)) have hpb:¬p i∣h*(∏j∈s,p j):=by intro hd rcases hpi.dvd_mul.mp hd with hd|hd · exact hph i (Finset.mem_insert_self _ _) hd · exact hpi.not_isUnit (hcpi.isUnit_of_dvd hd) rw [Finset.prod_insert hi,show h*(p i*(∏j∈s,p j))=(h*(∏j∈s,p j))*p i by ring, unramifiedResidualCoefficient_prime_norm (p i) hpi hpri _ hpb] exact ih hps hprs (fun j hj k hk hjk=>hpair j (Finset.mem_insert_of_mem hj) k (Finset.mem_insert_of_mem hk) hjk) (fun j hj=>hph j (Finset.mem_insert_of_mem hj)) theorem unramifiedResidualCoefficient_squarefree_cube_norm (I J:Ideal Eis) (hI:primaryGenerator I≠0) (hJ:primaryGenerator J≠0) (hsq:Squarefree I) (u:Eisˣ) (m:ℕ) : ‖unramifiedResidualCoefficient ((u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3)‖= ‖eisEmbedding (primaryGenerator J)‖*‖unramifiedResidualCoefficient (u.val*lambda^m)‖ := by rw [unramifiedResidualCoefficient_primary_cube _ hJ (primaryGenerator_spec J hJ).2,norm_mul, Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (norm_nonneg _)] congr 1 rw [primaryGenerator_squarefree_support I hI hsq] apply unramifiedResidualCoefficient_prime_product_norm · exact fun P hP=>primaryPrime_isPrime_of_mem I P hI hP · exact fun P hP=>(primaryPrime_spec P (primaryPrime_factor_ne_zero I P hI (Multiset.mem_toFinset.mp hP))).2.2.2 · exact primaryPrime_support_coprime I hI · intro P hP hd have hp:=primaryPrime_isPrime_of_mem I P hI hP have hpp:lambda^2∣primaryPrime P-1:= (primaryPrime_spec P (primaryPrime_factor_ne_zero I P hI (Multiset.mem_toFinset.mp hP))).2.2.2 have hc:IsCoprime (u.val*lambda^m) (primaryPrime P):= (ramified_primary_coprime u m _ hpp).of_mul_left_right exact hp.not_isUnit (hc.symm.isUnit_of_dvd hd) end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationEntireMellinProfile03 abbrev Eis := ActualEisensteinCubic.O end RootNotationEntireMellinProfile03 open RootNotationEntireMellinProfile03 (Eis) def threeRamifiedUnit :Eisˣ:=-(ramifiedOmegaUnit^2) def traceRamifiedUnit :Eisˣ:=-ramifiedOmegaUnit lemma three_eq_ramifiedUnit : (3:Eis)=(threeRamifiedUnit:Eis)*lambda^2 := by have hw:omega^2=-omega-1:=by linear_combination ramified_omega_relation have hl:lambda^2=-3*omega:=by change (omega-1)^2=-3*omega linear_combination hw simp only [threeRamifiedUnit,Units.val_neg,Units.val_pow_eq_pow_val,ramifiedOmegaUnit_val,hl] calc (3:Eis)=3*omega^3:=by rw [omega_primitive.pow_eq_one]; ring _=_:=by ring lemma trace_eq_ramifiedUnit : ramifiedTraceLambda=(traceRamifiedUnit:Eis)*lambda := by have hw:=ramified_omega_relation simp only [traceRamifiedUnit,Units.val_neg,ramifiedOmegaUnit_val] change 1+2*omega=-omega*(omega-1) linear_combination hw def ramifiedSixUnit (side:Bool) :RamifiedSixBranch→Eisˣ | .inl _=>threeRamifiedUnit*ramifiedCuspRoot side | .inr (.inl _)=>threeRamifiedUnit*(-ramifiedCuspRoot side)⁻¹^4*(-ramifiedCuspRoot side) | .inr (.inr (.inl _))=>threeRamifiedUnit*(-ramifiedCuspRoot side)⁻¹^4 | .inr (.inr (.inr j))=>threeRamifiedUnit*(-ramifiedCuspRoot side)⁻¹^4* ramifiedCuspScaleUnit side*traceRamifiedUnit*ramifiedOmegaUnit^j.val def ramifiedSixPower :RamifiedSixBranch→ℕ | .inl _=>2 | .inr (.inl _)=>2 | .inr (.inr (.inl _))=>2 | .inr (.inr (.inr _))=>3 lemma ramifiedSixPower_bounds (i:RamifiedSixBranch) : 2≤ramifiedSixPower i ∧ ramifiedSixPower i≤3 := by rcases i with i|i · norm_num [ramifiedSixPower] rcases i with i|i · norm_num [ramifiedSixPower] rcases i with i|i <;> norm_num [ramifiedSixPower] lemma unitCuspUnramifiedIndex_multiplier (u t:Eisˣ) (h:Eis) : unitCuspUnramifiedIndex u t h=(3*(↑u⁻¹:Eis)^4*(t:Eis))*h := by unfold unitCuspUnramifiedIndex have ht:(t:Eis)*(↑t⁻¹:Eis)=1:=by simp calc _=(3*(↑u⁻¹:Eis)^4*(t:Eis)*h)*((t:Eis)*(↑t⁻¹:Eis)):=by ring _=_:=by rw [ht,mul_one] theorem ramifiedSixIndex_multiplier (side:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit side)) (i:RamifiedSixBranch) : ramifiedSixIndex side h hf i= ((ramifiedSixUnit side i:Eis)*lambda^(ramifiedSixPower i))*h := by rcases i with i|i · simp only [ramifiedSixIndex,unitCuspUnramifiedIndex_multiplier, ramifiedSixUnit,ramifiedSixPower,Units.val_mul,Units.val_one,inv_one,one_pow] rw [three_eq_ramifiedUnit] ring rcases i with i|i · simp only [ramifiedSixIndex,unitCuspUnramifiedIndex_multiplier, ramifiedSixUnit,ramifiedSixPower,Units.val_mul,Units.val_pow_eq_pow_val] rw [three_eq_ramifiedUnit] ring rcases i with i|j · simp only [ramifiedSixIndex,unitCuspUnramifiedIndex_multiplier, ramifiedSixUnit,ramifiedSixPower,Units.val_mul,Units.val_pow_eq_pow_val,Units.val_one,mul_one] rw [three_eq_ramifiedUnit] ring · have hh:=onceCuspFrequencyQuotient_spec (ramifiedCuspScaleUnit side) h hf j change 3*((↑(-ramifiedCuspRoot side)⁻¹:Eis)^2* (onceCuspScale (ramifiedCuspScaleUnit side)*omega^j.val))^2* onceCuspFrequencyQuotient (ramifiedCuspScaleUnit side) h hf j=_ calc _=3*(↑(-ramifiedCuspRoot side)⁻¹:Eis)^4* (onceCuspScale (ramifiedCuspScaleUnit side)*omega^j.val)*h:=by conv_rhs => rw [hh] ring _=_:=by simp only [ramifiedSixUnit,ramifiedSixPower,Units.val_mul,Units.val_pow_eq_pow_val, ramifiedOmegaUnit_val,onceCuspScale] rw [three_eq_ramifiedUnit,trace_eq_ramifiedUnit] ring theorem ramifiedBesselValue_prime_power_vanish (side:Bool) (p:Eis) (hp:Prime p) (hpp:lambda^2∣p-1) (h:Eis) (hph:¬p∣h) (k:ℕ) (hk:k%3=2) : ramifiedBesselValue side (h*p^k)=0 := by unfold ramifiedBesselValue split_ifs with hf · have hr:ramifiedArithmeticResidue side (h*p^k) hf=0:=by unfold ramifiedArithmeticResidue apply Finset.sum_eq_zero intro i hi rw [ramifiedSixIndex_multiplier] have hc:IsCoprime ((ramifiedSixUnit side i:Eis)*lambda^(ramifiedSixPower i)) p:= (ramified_primary_coprime (ramifiedSixUnit side i) (ramifiedSixPower i) p hpp).of_mul_left_right have hnot:¬p∣((ramifiedSixUnit side i:Eis)*lambda^(ramifiedSixPower i))*h:=by intro hd rcases hp.dvd_mul.mp hd with hd|hd · exact hp.not_isUnit (hc.symm.isUnit_of_dvd hd) · exact hph hd rw [←mul_assoc,unramifiedGaussResidue_prime_power_table p hp hpp _ hnot,hk] norm_num rw [hr,mul_zero,zero_div] · rfl end open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationEntireMellinProfile04 abbrev Eis := ActualEisensteinCubic.O end RootNotationEntireMellinProfile04 open RootNotationEntireMellinProfile04 (Eis) lemma ramified_norm_third (u:Eisˣ) (m:ℕ) : ‖eisEmbedding (u.val*lambda^m)‖^(1/3:ℝ)=(3:ℝ)^((m:ℝ)/6) := by have hs:‖eisEmbedding (u.val*lambda^m)‖^2=(3:ℝ)^m:=by rw [eisEmbedding_norm_sq_eq_absNorm_span,ramifiedElement_absNorm,Nat.cast_pow,Nat.cast_ofNat] calc _=(‖eisEmbedding (u.val*lambda^m)‖^2)^(1/6:ℝ):=by rw [←Real.rpow_natCast_mul (norm_nonneg _)] congr 1 norm_num _=((3:ℝ)^m)^(1/6:ℝ):=by rw [hs] _=(3:ℝ)^((m:ℝ)/6):=by rw [←Real.rpow_natCast_mul (by norm_num : (0:ℝ)≤3)] congr 1 ring lemma cubicBesselNormalizer_ramified_mul_norm (h:Eis) (u:Eisˣ) (m:ℕ) : ‖cubicBesselNormalizer (h*(u.val*lambda^m))‖= ‖cubicBesselNormalizer h‖*(3:ℝ)^((m:ℝ)/6) := by have hp:0<‖eisEmbedding (u.val*lambda^m)‖:= norm_pos_iff.mpr (eisEmbedding_ne_zero (ramifiedElement_ne_zero u m)) rw [cubicBesselNormalizer_mul,norm_mul] have he:=Complex.norm_cpow_eq_rpow_re_of_pos hp (1/3:ℂ) have hre:(1/3:ℂ).re=(1/3:ℝ):=by norm_num rw [hre,ramified_norm_third] at he rw [he] ring def unramifiedCoefficientBaseBound :ℝ:= ‖cubicBesselNormalizer 1‖*ramifiedResidueFamilyMass 1 lemma unramifiedCoefficientBaseBound_nonneg :0≤unramifiedCoefficientBaseBound:= mul_nonneg (norm_nonneg _) (ramifiedResidueFamilyMass_nonneg _) lemma unramifiedResidualCoefficient_ramified_bound (u:Eisˣ) (m:ℕ) : ‖unramifiedResidualCoefficient (u.val*lambda^m)‖≤ unramifiedCoefficientBaseBound*(3:ℝ)^((m:ℝ)/6) := by have hc:‖cubicBesselNormalizer (u.val*lambda^m)‖= ‖cubicBesselNormalizer 1‖*(3:ℝ)^((m:ℝ)/6):=by simpa only [one_mul] using cubicBesselNormalizer_ramified_mul_norm 1 u m rw [unramifiedResidualCoefficient,norm_mul,hc,unramifiedCoefficientBaseBound] have he:=mul_le_mul_of_nonneg_left (unramifiedGaussResidue_unit_lambda_norm_le u m) (mul_nonneg (norm_nonneg (cubicBesselNormalizer 1)) (Real.rpow_nonneg (show (0:ℝ)≤3 by norm_num) ((m:ℝ)/6))) exact he.trans_eq (by ring) theorem unramifiedResidualCoefficient_squarefree_cube_bound (I J:Ideal Eis) (hI:CompletedGauss.primaryGenerator I≠0) (hJ:CompletedGauss.primaryGenerator J≠0) (hsq:Squarefree I) (u:Eisˣ) (m:ℕ) : ‖unramifiedResidualCoefficient ((u.val*lambda^m)*CompletedGauss.primaryGenerator I* (CompletedGauss.primaryGenerator J)^3)‖≤ unramifiedCoefficientBaseBound*(3:ℝ)^((m:ℝ)/6)*‖eisEmbedding (CompletedGauss.primaryGenerator J)‖ := by rw [unramifiedResidualCoefficient_squarefree_cube_norm I J hI hJ hsq u m] exact (mul_le_mul_of_nonneg_left (unramifiedResidualCoefficient_ramified_bound u m) (norm_nonneg _)).trans_eq (by ring) end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss namespace RootNotationEntireMellinProfile05 abbrev Eis := ActualEisensteinCubic.O end RootNotationEntireMellinProfile05 open RootNotationEntireMellinProfile05 (Eis) lemma ramifiedSixWeight_norm_le_one (side:Bool) (h:Eis) (hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit side)) (i:RamifiedSixBranch) : ‖ramifiedSixWeight side h hf i (4/3)‖≤1 := by rcases i with i|i · norm_num [ramifiedSixWeight,norm_mul,breveE_norm] rcases i with i|i · norm_num [ramifiedSixWeight,norm_mul,breveE_norm] rcases i with i|i · norm_num [ramifiedSixWeight,norm_mul,breveE_norm] · unfold ramifiedSixWeight dsimp only split_ifs · simp only [norm_mul,breveE_norm,mul_one] norm_num only [norm_inv,norm_div,norm_one,Complex.norm_ofNat] have hw:=ramifiedWeight_norm_scalar 1 norm_num only [pow_one,Nat.cast_ofNat] at hw have hb:=ramifiedDecayRatio_lt_one.le nlinarith [norm_nonneg ((3:ℂ)^(-(4/3:ℂ)))] · simp lemma ramifiedSixIndex_squarefree_cube (side:Bool) (u:Eisˣ) (m:ℕ) (n b:Eis) (hf:(3:Eis)∣((u.val*lambda^m)*n*b^3)-onceCuspScale (ramifiedCuspScaleUnit side)) (i:RamifiedSixBranch) : ramifiedSixIndex side ((u.val*lambda^m)*n*b^3) hf i= (((ramifiedSixUnit side i*u:Eisˣ):Eis)*lambda^(ramifiedSixPower i+m))*n*b^3 := by rw [ramifiedSixIndex_multiplier,Units.val_mul,pow_add] ring lemma ramifiedSix_normalized_term_bound (side:Bool) (I J:Ideal Eis) (hI:primaryGenerator I≠0) (hJ:primaryGenerator J≠0) (hsq:Squarefree I) (u:Eisˣ) (m:ℕ) (hf:(3:Eis)∣((u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3)- onceCuspScale (ramifiedCuspScaleUnit side)) (i:RamifiedSixBranch) : ‖cubicBesselNormalizer ((u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3)* unramifiedGaussResidue (ramifiedSixIndex side ((u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3) hf i)‖≤ (unramifiedCoefficientBaseBound*(3:ℝ)^(1/2:ℝ))*(3:ℝ)^((m:ℝ)/6)* ‖eisEmbedding (primaryGenerator J)‖ := by let h:=(u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3 let idx:=ramifiedSixIndex side h hf i have hc:‖cubicBesselNormalizer idx‖= ‖cubicBesselNormalizer h‖*(3:ℝ)^((ramifiedSixPower i:ℝ)/6):=by dsimp only [idx] rw [ramifiedSixIndex_multiplier,mul_comm] exact cubicBesselNormalizer_ramified_mul_norm h (ramifiedSixUnit side i) (ramifiedSixPower i) have hp:1≤(3:ℝ)^((ramifiedSixPower i:ℝ)/6):= Real.one_le_rpow (by norm_num) (by positivity) have hcle:‖cubicBesselNormalizer h‖≤‖cubicBesselNormalizer idx‖:=by rw [hc] exact le_mul_of_one_le_right (norm_nonneg _) hp have hnorm:‖unramifiedResidualCoefficient idx‖≤ unramifiedCoefficientBaseBound*(3:ℝ)^(((ramifiedSixPower i+m:ℕ):ℝ)/6)* ‖eisEmbedding (primaryGenerator J)‖:=by dsimp only [idx,h] rw [ramifiedSixIndex_squarefree_cube] exact unramifiedResidualCoefficient_squarefree_cube_bound I J hI hJ hsq (ramifiedSixUnit side i*u) (ramifiedSixPower i+m) have hexp:((ramifiedSixPower i+m:ℕ):ℝ)/6≤(m:ℝ)/6+1/2:=by have hr:(ramifiedSixPower i:ℝ)≤3:=by exact_mod_cast (ramifiedSixPower_bounds i).2 push_cast linarith have hpow:(3:ℝ)^(((ramifiedSixPower i+m:ℕ):ℝ)/6)≤ (3:ℝ)^((m:ℝ)/6)*(3:ℝ)^(1/2:ℝ):=by rw [←Real.rpow_add (by norm_num : (0:ℝ)<3)] exact Real.rpow_le_rpow_of_exponent_le (by norm_num) hexp calc _≤‖unramifiedResidualCoefficient idx‖:=by rw [unramifiedResidualCoefficient,norm_mul,norm_mul] exact mul_le_mul_of_nonneg_right hcle (norm_nonneg _) _≤unramifiedCoefficientBaseBound*(3:ℝ)^(((ramifiedSixPower i+m:ℕ):ℝ)/6)* ‖eisEmbedding (primaryGenerator J)‖:=hnorm _≤unramifiedCoefficientBaseBound*((3:ℝ)^((m:ℝ)/6)*(3:ℝ)^(1/2:ℝ))* ‖eisEmbedding (primaryGenerator J)‖:= mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hpow unramifiedCoefficientBaseBound_nonneg) (norm_nonneg _) _=_:=by ring theorem ramifiedBesselValue_squarefree_cube_bound : ∃C:ℝ,0ramifiedBesselValue_prime_power_vanish side p hp hpp h hph k hk) T P hT0 hP u m hFT have hparts:=thetaParts_mul_cube T (primaryGenerator_ne_zero_ideal T hT0) hv have hgen:primaryGenerator T=primaryGenerator (thetaSquarefreePart T)* (primaryGenerator (thetaCubePart T))^3:=by calc _=primaryGenerator (thetaSquarefreePart T*thetaCubePart T^3):=congrArg primaryGenerator hparts.symm _=_:=by rw [primaryGenerator_mul,primaryGenerator_pow] have hA:primaryGenerator (thetaSquarefreePart T)≠0:=by intro hz exact hT0 (by rw [hgen,hz,zero_mul]) have hC:primaryGenerator (thetaCubePart T)≠0:=by intro hz exact hT0 (by rw [hgen,hz,zero_pow (by decide : (3:ℕ)≠0),mul_zero]) refine ⟨u,m,thetaSquarefreePart T,thetaCubePart T,thetaSquarefreePart_squarefree T,hA,hC,?_⟩ rw [he,←hT,hgen] ring end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss namespace RootNotationRamifiedValuation02 abbrev Eis := ActualEisensteinCubic.O end RootNotationRamifiedValuation02 open RootNotationRamifiedValuation02 (Eis) lemma onceCuspScale_not_three_dvd (t:Eisˣ) : ¬(3:Eis)∣onceCuspScale t := by rintro ⟨z,hz⟩ have hq:Ideal.absNorm (Ideal.span {onceCuspScale t})=3:=by simpa only [Fin.val_zero,pow_zero,mul_one] using onceCusp_q_absNorm t 0 have he:=congrArg (fun x:Eis=>Ideal.absNorm (Ideal.span {x})) hz rw [hq,←Ideal.span_singleton_mul_span_singleton,map_mul,three_absNorm] at he omega lemma onceCuspScale_lambda_dvd (t:Eisˣ) : lambda∣onceCuspScale t := by refine ⟨(t:Eis)*(traceRamifiedUnit:Eis),?_⟩ rw [onceCuspScale,trace_eq_ramifiedUnit] ring theorem ramifiedBesselValue_exact_lambda_valuation (side:Bool) (h:Eis) (hb:ramifiedBesselValue side h≠0) : lambda∣h ∧ ¬lambda^2∣h := by have hf:(3:Eis)∣h-onceCuspScale (ramifiedCuspScaleUnit side):=by by_contra hnot exact hb (by simp only [ramifiedBesselValue,dif_neg hnot]) have hl3:lambda∣(3:Eis):= (dvd_pow_self lambda (by decide : (2:ℕ)≠0)).trans lambda_sq_dvd_three constructor · have hd:=hl3.trans hf simpa only [sub_add_cancel] using dvd_add hd (onceCuspScale_lambda_dvd (ramifiedCuspScaleUnit side)) · intro h2 have h3:(3:Eis)∣h:=three_dvd_lambda_sq.trans h2 have hq:(3:Eis)∣onceCuspScale (ramifiedCuspScaleUnit side):=by convert dvd_sub h3 hf using 1 ; ring exact onceCuspScale_not_three_dvd _ hq end section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss namespace RootNotationRamifiedValuation03 abbrev Eis := ActualEisensteinCubic.O end RootNotationRamifiedValuation03 open RootNotationRamifiedValuation03 (Eis) lemma sourceResidualFourierCoefficient_prime_norm (p:Eis) (hp:Prime p) (hpp:lambda^2∣p-1) (h:Eis) (hph:¬p∣h) : ‖sourceResidualFourierCoefficient (h*p)‖=‖sourceResidualFourierCoefficient h‖ := by have hp9:¬p∣9*h:=by have ht:=ramified_prime_frequency_not_dvd h p hp hpp hph (1:Eisˣ) 0 simpa only [Units.val_one,pow_zero,one_mul,mul_one,mul_comm 9 h] using ht rw [sourceResidualFourierCoefficient_prime_factor p hp hpp h hph,norm_mul,norm_div, primeCubicGauss_two_norm p hp hpp (9*h) hp9,Complex.norm_real, Real.norm_eq_abs,abs_of_nonneg (norm_nonneg _), div_self (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hp.ne_zero)),one_mul] theorem sourceResidualFourierCoefficient_prime_product_norm {ι:Type*} (s:Finset ι) (p:ι→Eis) (hp:∀i∈s,Prime (p i)) (hprimary:∀i∈s,lambda^2∣p i-1) (hpair:∀i∈s,∀j∈s,i≠j→IsCoprime (p i) (p j)) (h:Eis) (hph:∀i∈s,¬p i∣h) : ‖sourceResidualFourierCoefficient (h*(∏i∈s,p i))‖=‖sourceResidualFourierCoefficient h‖ := by classical induction s using Finset.induction_on with | empty=>simp | @insert i s hi ih=> have hpi:=hp i (Finset.mem_insert_self _ _) have hpri:=hprimary i (Finset.mem_insert_self _ _) have hps:∀j∈s,Prime (p j):=fun j hj=>hp j (Finset.mem_insert_of_mem hj) have hprs:∀j∈s,lambda^2∣p j-1:=fun j hj=>hprimary j (Finset.mem_insert_of_mem hj) have hcpi:IsCoprime (p i) (∏j∈s,p j):=IsCoprime.prod_right (fun j hj=> hpair i (Finset.mem_insert_self _ _) j (Finset.mem_insert_of_mem hj) (by intro he;subst j;exact hi hj)) have hpb:¬p i∣h*(∏j∈s,p j):=by intro hd rcases hpi.dvd_mul.mp hd with hd|hd · exact hph i (Finset.mem_insert_self _ _) hd · exact hpi.not_isUnit (hcpi.isUnit_of_dvd hd) rw [Finset.prod_insert hi,show h*(p i*(∏j∈s,p j))=(h*(∏j∈s,p j))*p i by ring, sourceResidualFourierCoefficient_prime_norm (p i) hpi hpri _ hpb] exact ih hps hprs (fun j hj k hk hjk=>hpair j (Finset.mem_insert_of_mem hj) k (Finset.mem_insert_of_mem hk) hjk) (fun j hj=>hph j (Finset.mem_insert_of_mem hj)) lemma sourceResidualFourierCoefficient_ramified_bound (u:Eisˣ) (m:ℕ) : ‖sourceResidualFourierCoefficient (u.val*lambda^m)‖≤ (‖cubicBesselNormalizer 1‖*(9*ramifiedSourceFamilyConstant*ramifiedResidueFamilyMass 1))* (3:ℝ)^((m:ℝ)/6) := by have hc:‖cubicBesselNormalizer (u.val*lambda^m)‖= ‖cubicBesselNormalizer 1‖*(3:ℝ)^((m:ℝ)/6):=by simpa only [one_mul] using cubicBesselNormalizer_ramified_mul_norm 1 u m rw [sourceResidualFourierCoefficient,norm_mul,hc] exact (mul_le_mul_of_nonneg_left (sourceArithmeticResidue_unit_lambda_bound u m) (mul_nonneg (norm_nonneg _) (Real.rpow_nonneg (show (0:ℝ)≤3 by norm_num) ((m:ℝ)/6)))).trans_eq (by ring) lemma sourceResidualFourierCoefficient_squarefree_cube_norm (I J:Ideal Eis) (hI:primaryGenerator I≠0) (hJ:primaryGenerator J≠0) (hsq:Squarefree I) (u:Eisˣ) (m:ℕ) : ‖sourceResidualFourierCoefficient ((u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3)‖= ‖eisEmbedding (primaryGenerator J)‖*‖sourceResidualFourierCoefficient (u.val*lambda^m)‖ := by rw [sourceResidualFourierCoefficient_primary_cube _ hJ (primaryGenerator_spec J hJ).2 _ (mul_ne_zero (ramifiedElement_ne_zero u m) hI),norm_mul, Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (norm_nonneg _)] congr 1 rw [primaryGenerator_squarefree_support I hI hsq] apply sourceResidualFourierCoefficient_prime_product_norm · exact fun P hP=>primaryPrime_isPrime_of_mem I P hI hP · exact fun P hP=>(primaryPrime_spec P (primaryPrime_factor_ne_zero I P hI (Multiset.mem_toFinset.mp hP))).2.2.2 · exact primaryPrime_support_coprime I hI · intro P hP hd have hp:=primaryPrime_isPrime_of_mem I P hI hP have hpp:lambda^2∣primaryPrime P-1:= (primaryPrime_spec P (primaryPrime_factor_ne_zero I P hI (Multiset.mem_toFinset.mp hP))).2.2.2 have hc:IsCoprime (u.val*lambda^m) (primaryPrime P):= (ramified_primary_coprime u m _ hpp).of_mul_left_right exact hp.not_isUnit (hc.symm.isUnit_of_dvd hd) theorem sourceResidualFourierCoefficient_squarefree_cube_bound : ∃C:ℝ,0sourceResidualFourierCoefficient_prime_power_vanish p hp hpp h hph k hk) T P hT0 hP u m hFT have hparts:=thetaParts_mul_cube T (primaryGenerator_ne_zero_ideal T hT0) hv have hgen:primaryGenerator T=primaryGenerator (thetaSquarefreePart T)* (primaryGenerator (thetaCubePart T))^3:=by calc _=primaryGenerator (thetaSquarefreePart T*thetaCubePart T^3):=congrArg primaryGenerator hparts.symm _=_:=by rw [primaryGenerator_mul,primaryGenerator_pow] have hA:primaryGenerator (thetaSquarefreePart T)≠0:=by intro hz exact hT0 (by rw [hgen,hz,zero_mul]) have hC:primaryGenerator (thetaCubePart T)≠0:=by intro hz exact hT0 (by rw [hgen,hz,zero_pow (by decide : (3:ℕ)≠0),mul_zero]) refine ⟨u,m,thetaSquarefreePart T,thetaCubePart T,thetaSquarefreePart_squarefree T,hA,hC,?_⟩ rw [he,←hT,hgen] ring end section open scoped Classical BigOperators open ActualEisensteinCubic CompletedGauss open PrimaryIdealUnitReindex (GoodIdeal) namespace RootNotationRamifiedValuation05 abbrev Eis := ActualEisensteinCubic.O end RootNotationRamifiedValuation05 open RootNotationRamifiedValuation05 (Eis) abbrev ThetaPrimaryCubePair := {I:Ideal Eis // Squarefree I ∧ primaryGenerator I≠0} × {J:Ideal Eis // primaryGenerator J≠0} def thetaPrimaryProduct (p : ThetaPrimaryCubePair) : GoodIdeal := ⟨p.1.val*p.2.val^3,by rw [primaryGenerator_mul,primaryGenerator_pow] exact mul_ne_zero p.1.property.2 (pow_ne_zero 3 p.2.property)⟩ lemma thetaPrimaryProduct_injective : Function.Injective thetaPrimaryProduct := by intro p q he have hprod : p.1.val*p.2.val^3=q.1.val*q.2.val^3 := congrArg Subtype.val he have h := squarefree_cube_decomposition_unique (primaryGenerator_ne_zero_ideal _ p.2.property) (primaryGenerator_ne_zero_ideal _ q.2.property) p.1.property.1 q.1.property.1 hprod exact Prod.ext (Subtype.ext h.1) (Subtype.ext h.2) abbrev ThetaFullIndex := Eisˣ × ℕ × ThetaPrimaryCubePair def thetaFullFrequency (p : ThetaFullIndex) : Eis := (p.1.val*lambda^p.2.1)*primaryGenerator p.2.2.1.val* (primaryGenerator p.2.2.2.val)^3 lemma thetaFullFrequency_product (p : ThetaFullIndex) : thetaFullFrequency p=p.1.val*(lambda^p.2.1*primaryGenerator (thetaPrimaryProduct p.2.2).val) := by simp only [thetaFullFrequency,thetaPrimaryProduct,primaryGenerator_mul,primaryGenerator_pow] ring lemma thetaFullFrequency_ne_zero (p : ThetaFullIndex) : thetaFullFrequency p≠0 := by rw [thetaFullFrequency_product] exact mul_ne_zero p.1.ne_zero (mul_ne_zero (pow_ne_zero _ PrimaryIdealUnitReindex.lambda_prime_actual.ne_zero) (thetaPrimaryProduct p.2.2).property) lemma thetaFullFrequency_span (p : ThetaFullIndex) : Ideal.span {thetaFullFrequency p}=ramifiedIdeal^p.2.1*(thetaPrimaryProduct p.2.2).val := by rw [thetaFullFrequency_product,Ideal.span_singleton_mul_left_unit p.1.isUnit, lambdaFactor_generator_span] theorem thetaFullFrequency_injective : Function.Injective thetaFullFrequency := by rintro ⟨u,m,p⟩ ⟨v,n,q⟩ he have hs := congrArg (fun x:Eis=>Ideal.span {x}) he rw [thetaFullFrequency_span,thetaFullFrequency_span] at hs have hmap : lambdaFactorMap (m,thetaPrimaryProduct p)=lambdaFactorMap (n,thetaPrimaryProduct q) := Subtype.ext hs have hij := lambdaFactorMap_bijective.1 hmap have hmn : m=n := congrArg Prod.fst hij have hpq : p=q := thetaPrimaryProduct_injective (congrArg Prod.snd hij) subst n subst q have huv : u=v := by apply Units.ext have hh : lambda^m*primaryGenerator (thetaPrimaryProduct p).val≠0 := mul_ne_zero (pow_ne_zero _ PrimaryIdealUnitReindex.lambda_prime_actual.ne_zero) (thetaPrimaryProduct p).property apply mul_right_cancel₀ hh simpa only [thetaFullFrequency_product] using he subst v rfl end section open scoped BigOperators Classical MatrixGroups open MeasureTheory open Finset AddChar MulChar EisensteinEmbedding open CubicKubota EisensteinCuspModThree ConcreteTraceCRT namespace RootNotationRamifiedValuation06 abbrev Eis := ActualEisensteinCubic.O end RootNotationRamifiedValuation06 open RootNotationRamifiedValuation06 (Eis) structure SourceCuspDatum where gamma : levelTwo index : Fin 3 lower_ne_zero : (integralComplexMatrix (gamma:SL(2,Eis))*integralComplexMatrix (cuspRepresentative index)) 1 0≠0 namespace SourceCuspDatum def matrix (d : SourceCuspDatum) : SL(2,ℂ) := integralComplexMatrix (d.gamma:SL(2,Eis))*integralComplexMatrix (cuspRepresentative d.index) def point (d : SourceCuspDatum) : ℂ := d.matrix 0 0/d.matrix 1 0 def dualPoint (d : SourceCuspDatum) : ℂ := -d.matrix 1 1/d.matrix 1 0 def heightScale (d : SourceCuspDatum) : ℝ := ‖d.matrix 1 0‖^2 def multiplier (d : SourceCuspDatum) : ℂ := -star (levelTwoComplexCharacter d.gamma)/(d.matrix 1 0)^2 lemma heightScale_pos (d : SourceCuspDatum) : 0cubicSourceConjugateFunction (integralComplexMatrix (cuspRepresentative j) • w)) z theorem SourceCuspDatum.reflection (d : SourceCuspDatum) (v : ℝ) (hv : 0coeff.fullFunction scalarTerm (upperPoint ((z+(t:ℂ)*direction)/(r:ℂ)) (v/r) (div_pos hv hr))) (∑'h:Eis,coeff.directionalTerm h (v/r) (z/(r:ℂ)) (direction/(r:ℂ))) 0 := by have h:=coeff.fullFunction_horizontal_hasDerivAt scalarTerm (v/r) (div_pos hv hr) (z/(r:ℂ)) (direction/(r:ℂ)) 0 simp only [Complex.ofReal_zero,zero_mul,add_zero] at h convert h using 1 funext t congr 2 ring lemma scaled_fullFunction_wirtingerBar (coeff : SubexponentialBesselCoefficients) (scalarTerm : ℂ) (r : ℝ) (hr : 0coeff.fullFunction scalarTerm (upperPoint (w/(r:ℂ)) (v/r) (div_pos hv hr))) z= ∑'h:Eis,(2*Real.pi*Complex.I*star (cuspFrequency h)/(r:ℂ))*coeff.term h (v/r,z/(r:ℂ)) := by have h1:=(coeff.scaled_fullFunction_horizontal_hasDerivAt scalarTerm r hr v hv z 1).deriv have hI:=(coeff.scaled_fullFunction_horizontal_hasDerivAt scalarTerm r hr v hv z Complex.I).deriv simp only [mul_one] at h1 rw [horizontalWirtingerBar,h1,hI] have hs1:=coeff.directionalTerm_summable (v/r) (div_pos hv hr) (z/(r:ℂ)) (1/(r:ℂ)) have hsI:=(coeff.directionalTerm_summable (v/r) (div_pos hv hr) (z/(r:ℂ)) (Complex.I/(r:ℂ))).mul_left Complex.I rw [←tsum_mul_left,←hs1.tsum_add hsI,←tsum_mul_left] apply tsum_congr intro h unfold directionalTerm linear_combination coeff.term h (v/r,z/(r:ℂ))*horizontalPhaseMultiplier_scaled_bar (cuspFrequency h) r def scaledConjugateZTerm (coeff : SubexponentialBesselCoefficients) (r v : ℝ) (z : ℂ) (h : Eis) : ℂ := (-2*Real.pi*Complex.I*cuspFrequency h/(r:ℂ))*star (coeff.term h (v/r,z/(r:ℂ))) theorem scaledConjugate_wirtingerZ (coeff : SubexponentialBesselCoefficients) (scalarTerm : ℂ) (r : ℝ) (hr : 0star (coeff.fullFunction scalarTerm (upperPoint (w/(r:ℂ)) (v/r) (div_pos hv hr)))) z= ∑'h:Eis,coeff.scaledConjugateZTerm r v z h := by rw [horizontalWirtingerZ_star,coeff.scaled_fullFunction_wirtingerBar scalarTerm r hr v hv z,tsum_star] apply tsum_congr intro h unfold scaledConjugateZTerm simp only [star_mul,Complex.star_def,map_div₀,map_mul, map_ofNat,Complex.conj_ofReal,Complex.conj_I,starRingEnd_self_apply] ring lemma scaledConjugateZTerm_zero (coeff : SubexponentialBesselCoefficients) (r v : ℝ) (z : ℂ) : coeff.scaledConjugateZTerm r v z 0=0 := by simp only [scaledConjugateZTerm,cuspFrequency,map_zero,zero_div,mul_zero,zero_mul] lemma scaledConjugateZTerm_bessel (coeff : SubexponentialBesselCoefficients) (r : ℝ) (hr : 0 norm_num [sourceCuspScale] lemma ramifiedSource_scaled_fullFunction (side : Bool) (v : ℝ) (hv : 0cubicSourceConjugateFunction (integralComplexMatrix (cuspRepresentative j) • upperPoint w v hv))= fun w=>star ((sourceCuspCoefficients j).fullFunction (sourceCuspBesselConstant j) (upperPoint (w/(sourceCuspScale j:ℂ)) (v/sourceCuspScale j) (div_pos hv (sourceCuspScale_pos j)))) := by funext w exact congrArg star (sourceCusp_bessel_expansion j v hv w) rw [he] exact (sourceCuspCoefficients j).scaledConjugate_wirtingerZ (sourceCuspBesselConstant j) (sourceCuspScale j) (sourceCuspScale_pos j) v hv z lemma sourceCuspZTerm_zero (j : Fin 3) (z : ℂ) (v : ℝ) : sourceCuspZTerm j z v 0=0 := (sourceCuspCoefficients j).scaledConjugateZTerm_zero _ _ _ lemma sourceCuspZTerm_bessel (j : Fin 3) (z : ℂ) (v : ℝ) (hv : 0 simp | succ n hn => rw [pow_succ,Complex.ofReal_mul,Complex.mul_cpow_ofReal_nonneg (pow_nonneg hx n) hx, hn,pow_succ] lemma positive_reflection_powers (Q u d X r:ℝ) (hQ:0mellin V (-s)*gammaMultiplier s) := by funext s simp only [mellinEulerData,pow_zero,one_mul,mellinData] rw [hf] rfl rw [hl] at he simpa only [mellinInv,smul_eq_mul,Complex.real_smul,Complex.ofReal_div, Complex.ofReal_one,Complex.ofReal_mul,Complex.ofReal_ofNat] using he lemma paperKernel_three_halves_bound (V:ℝ→ℂ) (v0 v1:ℝ) (hv0:0mellin V (-s)*gammaMultiplier s) := by funext s simp only [mellinEulerData,pow_zero,one_mul,mellinData] rw [hf] rfl rw [hl] at he rw [he] exact hb (3/2) (by norm_num) (paperScale*x) (mul_pos paperScale_pos hx) end CubicReflectionKernel namespace CompletedGauss section open CubicReflectionKernel theorem paperKernel_weighted_mellin {α:Type*} [Countable α] (r:α→ℝ) (hr:∀i,0‖a i‖*(r i)^(-(3/2:ℝ)))) (V:ℝ→ℂ) (v0 v1:ℝ) (hv0:0((paperScale*c:ℝ):ℂ)^(-((3/2:ℂ)+t*Complex.I))* mellinEulerData V 0 ((3/2:ℂ)+t*Complex.I) have hM:Integrable M:=by simpa only [M,inverseMellinIntegrand,Complex.ofReal_div,Complex.ofReal_ofNat] using inverseMellinIntegrand_vertical_integrable V v0 v1 hv0 hVs hV 2 0 (3/2) (by norm_num) (paperScale*c) (mul_pos paperScale_pos hc) have hi (i:α) : a i*paperKernel V (c*r i)=(1/(2*Real.pi):ℂ)*∫t:ℝ, a i*(r i:ℂ)^(-((3/2:ℂ)+t*Complex.I))*M t := by rw [paperKernel_three_halves V v0 v1 hv0 hVs hV _ (mul_pos hc (hr i))] rw [←mul_assoc,mul_comm (a i),mul_assoc,←integral_const_mul] congr 1 apply integral_congr_ae filter_upwards with t rw [show paperScale*(c*r i)=(paperScale*c)*r i by ring, Complex.ofReal_mul,Complex.mul_cpow_ofReal_nonneg (mul_pos paperScale_pos hc).le (hr i).le] dsimp only [M] ring simp_rw [hi] rw [tsum_mul_left] congr 1 simpa only [M,Complex.ofReal_div,Complex.ofReal_ofNat] using weighted_vertical_sum_integral r hr a (3/2) has M hM end open CubicEisenstein CubicReflectionKernel lemma besselSmoothingIntegrand_reflected_kernel_line {α:Type*} [Countable α] (F:ℝ→ℂ) (r:α→ℝ) (hr:∀i,0‖a i‖*(r i)^(-(3/2:ℝ)))) (V:ℝ→ℂ) (X:ℝ) (hX:0‖a i‖*(r i)^(s.re-1/2)):=by simpa only [hs] using has have hsw:1/2-w=s:=by dsimp [s,w];ring have hw:1/2-s=w:=by rw [←hsw];ring have hsw':s-1/2=-w:=by rw [←hsw];ring have hp:=bessel_reflection_scale q d Q X 1 hq hd hQ hX (by norm_num) w simp only [hsw,Complex.ofReal_one,Complex.one_cpow,mul_one] at hp have he:=continuedBesselDirichlet_reflection F r hr a q d Q hd hQ A hreflect s hslt hsum change besselSmoothingIntegrand F q V X s=_ rw [besselSmoothingIntegrand,he,hw,hsw'] change _=(A*((Q*(q/d)^2:ℝ):ℂ))* ((∑'i,a i*(r i:ℂ)^(-w))* (((paperScale*(27*q^2*d^2*X/Q^2):ℝ):ℂ)^(-w)*mellinEulerData V 0 w)) rw [mellinEulerData,pow_zero,one_mul,mellinData] calc _=(A*mellin V (-w)*gammaMultiplier w*(∑'i,a i*(r i:ℂ)^(-w)))* ((Q:ℂ)^(2-2*s)*besselReflectionFactor q d s*(X:ℂ)^(-w)):=by ring _=_:=by rw [hp];ring end CompletedGauss open Filter MeasureTheory open scoped Classical BigOperators Topology ContDiff namespace CompletedGauss open CubicEisenstein CubicReflectionKernel theorem besselSmoothingIntegral_reflected_kernel {α:Type*} [Countable α] (F:ℝ→ℂ) (r:α→ℝ) (hr:∀i,0‖a i‖*(r i)^(-(3/2:ℝ)))) (V:ℝ→ℂ) (v0 v1:ℝ) (hv0:0(∑'i,a i*(r i:ℂ)^(-((3/2:ℂ)+t*Complex.I)))* (((paperScale*c:ℝ):ℂ)^(-((3/2:ℂ)+t*Complex.I))* mellinEulerData V 0 ((3/2:ℂ)+t*Complex.I)) have hk:=paperKernel_weighted_mellin r hr a has V v0 v1 hv0 hVs hV c hc have hpoint (t:ℝ) : besselSmoothingIntegrand F q V X ((-1:ℂ)+(-t)*Complex.I)= (A*((Q*(q/d)^2:ℝ):ℂ))*M t := besselSmoothingIntegrand_reflected_kernel_line F r hr a q d Q hq hd hQ A hreflect has V X hX t calc _=(1/(2*Real.pi):ℂ)*∫t:ℝ, besselSmoothingIntegrand F q V X ((-1:ℂ)+(-t)*Complex.I):=by congr 1 simpa only [Complex.ofReal_neg] using (integral_neg_eq_self (fun t:ℝ=> besselSmoothingIntegrand F q V X ((-1:ℂ)+t*Complex.I)) volume).symm _=(A*((Q*(q/d)^2:ℝ):ℂ))*((1/(2*Real.pi):ℂ)*∫t:ℝ,M t):=by simp_rw [hpoint] rw [integral_const_mul] ring _=(A*((Q*(q/d)^2:ℝ):ℂ))*(∑'i,a i*paperKernel V (c*r i)):=by rw [hk] _=_:=by push_cast congr 1 · ring · apply tsum_congr intro i congr 2 dsimp [c] ring theorem paperKernel_weighted_norm_summable {α:Type*} (r:α→ℝ) (hr:∀i,0‖a i‖*(r i)^(-(3/2:ℝ)))) (V:ℝ→ℂ) (v0 v1:ℝ) (hv0:0‖a i*paperKernel V (c*r i)‖) := by obtain ⟨C,hC,hb⟩:=paperKernel_three_halves_bound V v0 v1 hv0 hVs hV apply (has.mul_left (C*(paperScale*c)^(-(3/2:ℝ)))).of_nonneg_of_le (fun i=>norm_nonneg _) intro i rw [norm_mul] calc _≤‖a i‖*(C*(paperScale*(c*r i))^(-(3/2:ℝ))):= mul_le_mul_of_nonneg_left (hb _ (mul_pos hc (hr i))) (norm_nonneg _) _=(C*(paperScale*c)^(-(3/2:ℝ)))*(‖a i‖*(r i)^(-(3/2:ℝ))):=by rw [show paperScale*(c*r i)=(paperScale*c)*r i by ring, Real.mul_rpow (mul_pos paperScale_pos hc).le (hr i).le] ring end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.FullFrequencyExpansion namespace OAI noncomputable section namespace CubicEisenstein open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped Classical BigOperators open ActualEisensteinCubic CompletedGauss theorem thetaFullFrequency_tsum (c w : _root_.OAI.ActualEisensteinCubic.O→ℂ) (hsupp : ∀h:_root_.OAI.ActualEisensteinCubic.O,h≠0→c h≠0→∃p:ThetaFullIndex,thetaFullFrequency p=h) : (∑'h:{h:_root_.OAI.ActualEisensteinCubic.O // h≠0},w h.val*c h.val)= ∑'p:ThetaFullIndex,w (thetaFullFrequency p)*c (thetaFullFrequency p) := by let phi : ThetaFullIndex→{h:_root_.OAI.ActualEisensteinCubic.O // h≠0} := fun p=>⟨thetaFullFrequency p,thetaFullFrequency_ne_zero p⟩ let f : {h:_root_.OAI.ActualEisensteinCubic.O // h≠0}→ℂ := fun h=>w h.val*c h.val have hinj : Function.Injective phi := by intro p q hpq exact thetaFullFrequency_injective (congrArg Subtype.val hpq) change (∑'h:{h:_root_.OAI.ActualEisensteinCubic.O // h≠0},f h)=∑'p:ThetaFullIndex,f (phi p) apply tsum_eq_tsum_of_ne_zero_bij (fun p:Function.support (fun p:ThetaFullIndex=>f (phi p))=>phi p.val) · exact hinj.comp Subtype.val_injective · intro h hh have hc : c h.val≠0 := by intro hz exact hh (by simp only [f,hz,mul_zero]) obtain ⟨p,hp⟩:=hsupp h.val h.property hc have hphi : phi p=h := Subtype.ext hp have hfp : f (phi p)≠0 := by rwa [hphi] exact ⟨⟨p,hfp⟩,hphi⟩ · intro p rfl end section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups section open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss lemma squarefreeCube_scale_le_norm_third (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:primaryGenerator I≠0) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) : (3:ℝ)^((m:ℝ)/6)*‖eisEmbedding (primaryGenerator J)‖≤ ‖eisEmbedding ((u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3)‖^(1/3:ℝ) := by have hn:1≤‖eisEmbedding (primaryGenerator I)‖:=cubePrime_norm_ge_one _ hI have hn':1≤‖eisEmbedding (primaryGenerator I)‖^(1/3:ℝ):= Real.one_le_rpow hn (by norm_num) have hb:(‖eisEmbedding (primaryGenerator J)‖^3)^(1/3:ℝ)=‖eisEmbedding (primaryGenerator J)‖:=by rw [←Real.rpow_natCast_mul (norm_nonneg _)] norm_num have he:‖eisEmbedding ((u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3)‖^(1/3:ℝ)= (3:ℝ)^((m:ℝ)/6)*‖eisEmbedding (primaryGenerator I)‖^(1/3:ℝ)* ‖eisEmbedding (primaryGenerator J)‖:=by rw [map_mul,map_mul,map_pow,norm_mul,norm_mul,norm_pow, Real.mul_rpow (mul_nonneg (norm_nonneg _) (norm_nonneg _)) (pow_nonneg (norm_nonneg _) _), Real.mul_rpow (norm_nonneg _) (norm_nonneg _),ramified_norm_third,hb] rw [he] have hscale:0≤(3:ℝ)^((m:ℝ)/6):=Real.rpow_nonneg (by norm_num) _ have hbn:0≤‖eisEmbedding (primaryGenerator J)‖:=norm_nonneg _ exact mul_le_mul_of_nonneg_right (le_mul_of_one_le_right hscale hn') hbn lemma coefficient_polynomial_of_squarefree_cube_support (F:_root_.OAI.ActualEisensteinCubic.O→ℂ) (C:ℝ) (hC:0≤C) (hsupport:∀h:_root_.OAI.ActualEisensteinCubic.O,h≠0→F h≠0→∃(u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O),Squarefree I ∧ primaryGenerator I≠0 ∧ primaryGenerator J≠0 ∧ h=(u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3) (hbound:∀(I J:Ideal _root_.OAI.ActualEisensteinCubic.O),primaryGenerator I≠0→primaryGenerator J≠0→Squarefree I→ ∀(u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ), ‖F ((u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3)‖≤ C*(3:ℝ)^((m:ℝ)/6)*‖eisEmbedding (primaryGenerator J)‖) (h:_root_.OAI.ActualEisensteinCubic.O) (hh:h≠0) : ‖F h‖≤C*‖eisEmbedding h‖^(1/3:ℝ) := by by_cases hz:F h=0 · rw [hz,norm_zero] positivity obtain ⟨u,m,I,J,hsq,hI,hJ,rfl⟩:=hsupport h hh hz refine (hbound I J hI hJ hsq u m).trans ?_ have hb:=mul_le_mul_of_nonneg_left (squarefreeCube_scale_le_norm_third I J hI u m) hC exact (by simpa only [mul_assoc] using hb) theorem three_cusp_coefficients_polynomial_bound : ∃C:ℝ,0(hbound I J hI hJ hsq u m).1) h hh · intro side exact coefficient_polynomial_of_squarefree_cube_support (ramifiedBesselValue side) C hC.le (ramifiedBesselValue_squarefree_cube_support side) (fun I J hI hJ hsq u m=>(hbound I J hI hJ hsq u m).2 side) h hh end section open ActualEisensteinCubic ConcreteTraceCRT lemma coefficient_weighted_summable_of_polynomial (F:_root_.OAI.ActualEisensteinCubic.O→ℂ) (C:ℝ) (hC:0≤C) (hF:∀h:_root_.OAI.ActualEisensteinCubic.O,h≠0→‖F h‖≤C*‖eisEmbedding h‖^(1/3:ℝ)) : Summable (fun h:_root_.OAI.ActualEisensteinCubic.O=>if h=0 then (0:ℝ) else ‖F h‖*‖cuspFrequency h‖^(-4:ℝ)) := by let D:ℝ:=‖(3:ℂ)*eisLam‖ have hD:0(C/D^(-4:ℝ))*‖eisEmbedding h‖^(-(11/3):ℝ)):= (summable_embedding_rpow (-(11/3):ℝ) (by norm_num)).mul_left _ apply Summable.of_nonneg_of_le (fun h=>by split_ifs <;> positivity) _ hs intro h split_ifs with hh · exact mul_nonneg (div_nonneg hC hDp.le) (Real.rpow_nonneg (norm_nonneg _) _) · have hx:0<‖eisEmbedding h‖:=norm_pos_iff.mpr (eisEmbedding_ne_zero hh) have he:‖eisEmbedding h‖^(1/3:ℝ)*‖eisEmbedding h‖^(-4:ℝ)= ‖eisEmbedding h‖^(-(11/3):ℝ):=by rw [←Real.rpow_add hx] congr 1 norm_num calc _≤(C*‖eisEmbedding h‖^(1/3:ℝ))*‖cuspFrequency h‖^(-4:ℝ):= mul_le_mul_of_nonneg_right (hF h hh) (Real.rpow_nonneg (norm_nonneg _) _) _=(C/D^(-4:ℝ))*(‖eisEmbedding h‖^(1/3:ℝ)*‖eisEmbedding h‖^(-4:ℝ)):=by rw [cuspFrequency,norm_div,Real.div_rpow (norm_nonneg _) (norm_nonneg _)] change (C*‖eisEmbedding h‖^(1/3:ℝ))*(‖eisEmbedding h‖^(-4:ℝ)/D^(-4:ℝ))=_ ring _=_:=by rw [he] theorem three_cusp_coefficients_weighted_summable : Summable (fun h:_root_.OAI.ActualEisensteinCubic.O=>if h=0 then (0:ℝ) else ‖sourceResidualFourierCoefficient h‖*‖cuspFrequency h‖^(-4:ℝ)) ∧ ∀side:Bool,Summable (fun h:_root_.OAI.ActualEisensteinCubic.O=>if h=0 then (0:ℝ) else ‖ramifiedBesselValue side h‖*‖cuspFrequency h‖^(-4:ℝ)) := by obtain ⟨C,hC,hbound⟩:=three_cusp_coefficients_polynomial_bound constructor · exact coefficient_weighted_summable_of_polynomial _ C hC.le (fun h hh=>(hbound h hh).1) · intro side exact coefficient_weighted_summable_of_polynomial _ C hC.le (fun h hh=>(hbound h hh).2 side) lemma derivative_coefficient_weighted_summable (F:_root_.OAI.ActualEisensteinCubic.O→ℂ) (A:ℂ) (hF:Summable (fun h:_root_.OAI.ActualEisensteinCubic.O=>if h=0 then (0:ℝ) else ‖F h‖*‖cuspFrequency h‖^(-4:ℝ))) : Summable (fun h:_root_.OAI.ActualEisensteinCubic.O=>if h=0 then (0:ℝ) else ‖A*cuspFrequency h*star (F h)‖*‖cuspFrequency h‖^(-5:ℝ)) := by apply (hF.mul_left ‖A‖).congr intro h split_ifs with hh · simp · have hx:0<‖cuspFrequency h‖:=norm_pos_iff.mpr (cuspFrequency_ne_zero h hh) have hp:‖cuspFrequency h‖*‖cuspFrequency h‖^(-5:ℝ)=‖cuspFrequency h‖^(-4:ℝ):=by conv_lhs => lhs; rw [←Real.rpow_one ‖cuspFrequency h‖] rw [←Real.rpow_add hx] norm_num rw [norm_mul,norm_mul,norm_star] calc _=‖A‖*‖F h‖*(‖cuspFrequency h‖*‖cuspFrequency h‖^(-5:ℝ)):=by rw [hp];ring _=_:=by ring end section open ActualEisensteinCubic ConcreteTraceCRT lemma radial_inverse_weight (x:ℝ) (hx:0if h=0 then (0:ℝ) else ‖F h‖*‖cuspFrequency h‖^(-4:ℝ))) : Summable (fun h:_root_.OAI.ActualEisensteinCubic.O=>if h=0 then (0:ℝ) else ‖A*cuspFrequency h*star (F h)/((‖eisEmbedding h‖^2:ℝ):ℂ)‖* (‖eisEmbedding h‖^2)^(-(3/2):ℝ)) := by let D:ℝ:=‖(3:ℂ)*eisLam‖ have hD:0if h=0 then (0:ℝ) else ‖(sourceCuspCoefficients j).value h‖*‖cuspFrequency h‖^(-4:ℝ)) := by fin_cases j · exact three_cusp_coefficients_weighted_summable.1 · exact three_cusp_coefficients_weighted_summable.2 false · exact three_cusp_coefficients_weighted_summable.2 true theorem sourceCuspRadialCoefficient_weighted_summable (j:Fin 3) (z:ℂ) : Summable (fun h:_root_.OAI.ActualEisensteinCubic.O=>‖sourceCuspRadialCoefficient j z h‖* (sourceCuspRadialLength h)^(-(3/2):ℝ)) := by let A:ℂ:=(-2*Real.pi*Complex.I)/(sourceCuspScale j:ℂ)^2 have hs:=radialCoefficient_weighted_summable_of_fourth (sourceCuspCoefficients j).value A (sourceCuspCoefficients_weighted_summable j) apply hs.congr intro h by_cases hh:h=0 · subst h simp only [ite_true,sourceCuspRadialCoefficient_zero,norm_zero,zero_mul] · rw [if_neg hh,sourceCuspRadialCoefficient_norm,sourceCuspRadialBaseCoefficient, sourceCuspRadialLength,if_neg hh] congr 1 apply congrArg norm dsimp only [A] simp only [div_eq_mul_inv,mul_inv_rev] ring end section open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff MatrixGroups section open CompletedGauss ConcreteTraceCRT lemma SourceCuspDatum.cuspBarProfile_mellin_entire (d : SourceCuspDatum) : (∀s:ℂ,MellinConvergent (cuspBarProfile cubicSourceConjugateFunction d.point) s) ∧ Differentiable ℂ (mellin (cuspBarProfile cubicSourceConjugateFunction d.point)) := (conjugateSource_levelTwo_three_cusp_mellin_entire d.gamma d.index d.matrix rfl d.lower_ne_zero).1 lemma SourceCuspDatum.reflection_radial (d : SourceCuspDatum) (v:ℝ) (hv:0w h*sourceCuspRadialCoefficient j z h)⊆ {h:_root_.OAI.ActualEisensteinCubic.O|h≠0}:=by intro h hh hz subst h exact hh (by change w 0*sourceCuspRadialCoefficient j z 0=0 rw [sourceCuspRadialCoefficient_zero,mul_zero]) calc _=∑'h:{h:_root_.OAI.ActualEisensteinCubic.O//h≠0},w h.val*sourceCuspRadialCoefficient j z h.val:= (tsum_subtype_eq_of_support_subset hs).symm _=_:=thetaFullFrequency_tsum (sourceCuspRadialCoefficient j z) w (sourceCuspRadialCoefficient_full_support j z) lemma SourceCuspDatum.smoothedKernel_full_index (d:SourceCuspDatum) (W:ℝ→ℂ) (X:ℝ) : d.smoothedKernel W X= (d.multiplier*(d.heightScale:ℂ)*(sourceCuspScale d.index:ℂ)^2)* ∑'p:ThetaFullIndex,sourceCuspRadialCoefficient d.index d.dualPoint (thetaFullFrequency p)* CubicReflectionKernel.paperKernel (Vstar W) (X*sourceCuspRadialLength (thetaFullFrequency p)/ (27*(sourceCuspScale d.index)^2*d.heightScale^2)) := by rw [d.smoothedKernel_eq] congr 1 have he:=sourceCuspRadialCoefficient_tsum_full_index d.index d.dualPoint (fun h=>CubicReflectionKernel.paperKernel (Vstar W) (X*sourceCuspRadialLength h/(27*(sourceCuspScale d.index)^2*d.heightScale^2))) simpa only [mul_comm] using he lemma SourceCuspDatum.smoothedKernel_full_index_norm_summable (d:SourceCuspDatum) (W:ℝ→ℂ) (v0 v1:ℝ) (hv0:0 ‖sourceCuspRadialCoefficient d.index d.dualPoint (thetaFullFrequency p)* CubicReflectionKernel.paperKernel (Vstar W) (X*sourceCuspRadialLength (thetaFullFrequency p)/ (27*(sourceCuspScale d.index)^2*d.heightScale^2))‖) := by have hs:=paperKernel_weighted_norm_summable sourceCuspRadialLength sourceCuspRadialLength_pos (sourceCuspRadialCoefficient d.index d.dualPoint) (sourceCuspRadialCoefficient_weighted_summable _ _) (Vstar W) v0 v1 hv0 (Vstar_support W v0 v1 hWs) (Vstar_contDiff W v0 v1 hv0 hWs hW) (X/(27*(sourceCuspScale d.index)^2*d.heightScale^2)) (by have := sourceCuspScale_pos d.index; have := d.heightScale_pos; positivity) have hp:=hs.comp_injective thetaFullFrequency_injective apply hp.congr intro p exact congrArg (fun y:ℝ=>‖sourceCuspRadialCoefficient d.index d.dualPoint (thetaFullFrequency p)* CubicReflectionKernel.paperKernel (Vstar W) y‖) (by ring : X/(27*(sourceCuspScale d.index)^2*d.heightScale^2)*sourceCuspRadialLength (thetaFullFrequency p)= X*sourceCuspRadialLength (thetaFullFrequency p)/(27*(sourceCuspScale d.index)^2*d.heightScale^2)) end open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss def fixedCuspCoefficientBound : ℝ := Classical.choose three_cusp_coefficients_squarefree_cube_bound lemma fixedCuspCoefficientBound_pos : 0(χ^j) t) h*frequencyMultiplier χ ψ σ ε x h lemma frequencyRow_units (χ : MulChar F ℂ) (ψ : AddChar F ℂ) (j : ℕ) (σ ε : Fˣ) (x : F) : (∑h:Fˣ,frequencyRow χ ψ j σ ε x h)=activeRow χ ψ j σ ε x := by unfold frequencyRow finiteAdditiveFourierCoeff frequencyMultiplier activeRow simp only [Units.ne_zero,ite_false,Units.val_inv_eq_inv_val,Finset.mul_sum] apply Finset.sum_congr rfl intro h hh ring_nf open ActualEisensteinCubic CompletedGauss noncomputable abbrev quotientFieldFrequency (P : Ideal ActualEisensteinCubic.O) [P.IsMaximal] : Field (ActualEisensteinCubic.O⧸P) := Ideal.Quotient.field P noncomputable abbrev quotientFintypeFrequency (P : Ideal ActualEisensteinCubic.O) [P.IsMaximal] : Fintype (ActualEisensteinCubic.O⧸P) := Fintype.ofFinite _ theorem canonical_frequencyRow_units (P : Ideal ActualEisensteinCubic.O) [P.IsMaximal] (hgood : lambda∉P) (hchar : ringChar (ActualEisensteinCubic.O⧸P)≠2) (ψ : AddChar (ActualEisensteinCubic.O⧸P) ℂ) (hψ : ψ.IsPrimitive) (j : ℕ) (hj : j<6) (σ ε : (ActualEisensteinCubic.O⧸P)ˣ) (x : ActualEisensteinCubic.O⧸P) : letI explicitWitness6 := OAI.LocalReflectionBrackets.quotientFieldFrequency (P := P) letI explicitWitness7 := OAI.LocalReflectionBrackets.quotientFintypeFrequency (P := P) (∑h:(ActualEisensteinCubic.O⧸P)ˣ,frequencyRow (actualSextic P hgood) ψ j σ ε x h)= (((actualSextic P hgood)⁻¹)^2) σ * phase (actualSextic P hgood) ψ j ε*bracket (actualSextic P hgood) j x := by letI explicitWitness6 := OAI.LocalReflectionBrackets.quotientFieldFrequency (P := P) letI explicitWitness7 := OAI.LocalReflectionBrackets.quotientFintypeFrequency (P := P) exact ( by rw [frequencyRow_units] simpa only [actualSextic] using canonical_A5_normalized P hgood hchar ψ hψ j hj σ ε x ) end open ActualEisensteinCubic CubicEisenstein IdealGaussCRT CompletedGauss end LocalReflectionBrackets end namespace CubicEisenstein open scoped Classical MatrixGroups Matrix open CubicKubota EisensteinCuspModThree ConcreteTraceCRT lemma upper_right_removed_bottom (M T:SL(2,_root_.OAI.ActualEisensteinCubic.O)) (hT:T 1 0=0) : (M*T⁻¹) 1 0=M 1 0*T 1 1 := by simp [Matrix.SpecialLinearGroup.coe_mul,Matrix.SpecialLinearGroup.coe_inv, Matrix.adjugate_fin_two,Matrix.mul_apply,Fin.sum_univ_two,hT] lemma upper_right_removed_top (M T:SL(2,_root_.OAI.ActualEisensteinCubic.O)) (hT:T 1 0=0) : (M*T⁻¹) 0 0=M 0 0*T 1 1 := by simp [Matrix.SpecialLinearGroup.coe_mul,Matrix.SpecialLinearGroup.coe_inv, Matrix.adjugate_fin_two,Matrix.mul_apply,Fin.sum_univ_two,hT] lemma upper_right_removed_last (M T:SL(2,_root_.OAI.ActualEisensteinCubic.O)) : (M*T⁻¹) 1 1= -M 1 0*T 0 1+M 1 1*T 0 0 := by simp [Matrix.SpecialLinearGroup.coe_mul,Matrix.SpecialLinearGroup.coe_inv, Matrix.adjugate_fin_two,Matrix.mul_apply,Fin.sum_univ_two] lemma upper_diagonal_product (T:SL(2,_root_.OAI.ActualEisensteinCubic.O)) (hT:T 1 0=0) : T 0 0*T 1 1=1 := by have hd:=T.property simpa only [Matrix.det_fin_two,hT,mul_zero,sub_zero] using hd structure FixedCuspShape (H:SL(2,_root_.OAI.ActualEisensteinCubic.O)) where gamma : levelTwo index : Fin 3 upper : SL(2,_root_.OAI.ActualEisensteinCubic.O) lower_zero : upper 1 0=0 upper_unit : IsUnit (upper 0 0) lower_unit : IsUnit (upper 1 1) factorization : H=(gamma:SL(2,_root_.OAI.ActualEisensteinCubic.O))*cuspRepresentative index*upper lemma exists_fixedCuspShape (H:SL(2,_root_.OAI.ActualEisensteinCubic.O)) : Nonempty (FixedCuspShape H) := by obtain ⟨G,j,T,hT,hT0,hT1,he⟩:=three_cusp_decomposition H exact ⟨⟨G,j,T,hT,hT0,hT1,he⟩⟩ namespace FixedCuspShape variable {H:SL(2,_root_.OAI.ActualEisensteinCubic.O)} (s:FixedCuspShape H) (g:levelTwo) lemma removed_eq : (g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H*s.upper⁻¹= ((g*s.gamma:levelTwo):SL(2,_root_.OAI.ActualEisensteinCubic.O))*cuspRepresentative s.index := by calc _ = (g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*((s.gamma:SL(2,_root_.OAI.ActualEisensteinCubic.O))*cuspRepresentative s.index*s.upper)*s.upper⁻¹ := congrArg (fun K:SL(2,_root_.OAI.ActualEisensteinCubic.O)=>(g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*K*s.upper⁻¹) s.factorization _ = _ := by simp only [Subgroup.coe_mul]; group def datum (h:((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0≠0) : SourceCuspDatum where gamma := g*s.gamma index := s.index lower_ne_zero := by rw [←map_mul,←s.removed_eq g,integralComplexMatrix_apply, upper_right_removed_bottom _ _ s.lower_zero,map_mul] exact mul_ne_zero (eisEmbedding_ne_zero h) (eisEmbedding_ne_zero s.lower_unit.ne_zero) lemma datum_matrix (h:((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0≠0) : (s.datum g h).matrix=integralComplexMatrix ((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H*s.upper⁻¹) := by rw [s.removed_eq g,map_mul] rfl lemma _root_.OAI.CubicEisenstein.FixedCuspShape.datum_point (h:((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0≠0) : (s.datum g h).point= eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 0 0)/eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0) := by rw [SourceCuspDatum.point,s.datum_matrix] rw [integralComplexMatrix_apply,integralComplexMatrix_apply, upper_right_removed_top _ _ s.lower_zero,upper_right_removed_bottom _ _ s.lower_zero] simp only [map_mul] exact mul_div_mul_right _ _ (eisEmbedding_ne_zero s.lower_unit.ne_zero) lemma datum_heightScale (h:((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0≠0) : (s.datum g h).heightScale=‖eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0)‖^2 := by rw [SourceCuspDatum.heightScale,s.datum_matrix,integralComplexMatrix_apply, upper_right_removed_bottom _ _ s.lower_zero,map_mul,norm_mul] have hn:‖eisEmbedding (s.upper 1 1)‖=1 := by rcases s.lower_unit with ⟨u,hu⟩ rw [←hu] exact GaussGeneratorTransport.norm_eisEmbedding_unit u rw [hn,mul_one] lemma datum_dualPoint (h:((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0≠0) : (s.datum g h).dualPoint= eisEmbedding (s.upper 0 0*s.upper 0 1)- eisEmbedding (s.upper 0 0)^2* (eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 1)/eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0)) := by rw [SourceCuspDatum.dualPoint,s.datum_matrix] rw [integralComplexMatrix_apply,integralComplexMatrix_apply,upper_right_removed_last, upper_right_removed_bottom _ _ s.lower_zero] simp only [map_add,map_neg,map_mul] have hd:eisEmbedding (s.upper 0 0)*eisEmbedding (s.upper 1 1)=1 := by rw [←map_mul,upper_diagonal_product _ s.lower_zero,map_one] have hc:=eisEmbedding_ne_zero h have ht:=eisEmbedding_ne_zero s.lower_unit.ne_zero field_simp [hc,ht] linear_combination (eisEmbedding (s.upper 0 0)*eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 1)- eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0)*eisEmbedding (s.upper 0 1))*hd lemma datum_multiplier (h:((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0≠0) : (s.datum g h).multiplier= -star (levelTwoComplexCharacter g)*star (levelTwoComplexCharacter s.gamma)* eisEmbedding (s.upper 0 0)^2/eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0)^2 := by rw [SourceCuspDatum.multiplier,s.datum_matrix,integralComplexMatrix_apply, upper_right_removed_bottom _ _ s.lower_zero,map_mul] change -star (levelTwoComplexCharacter (g*s.gamma))/ (eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0)*eisEmbedding (s.upper 1 1))^2=_ rw [map_mul,star_mul] have hc:=eisEmbedding_ne_zero h have ht:=eisEmbedding_ne_zero s.lower_unit.ne_zero have hd:eisEmbedding (s.upper 0 0)*eisEmbedding (s.upper 1 1)=1 := by rw [←map_mul,upper_diagonal_product _ s.lower_zero,map_one] have hp:eisEmbedding (s.upper 0 0)^2*eisEmbedding (s.upper 1 1)^2=1 := by rw [←mul_pow,hd,one_pow] field_simp [hc,ht] linear_combination (star (levelTwoComplexCharacter g)*star (levelTwoComplexCharacter s.gamma))*hp lemma datum_additive_phase (h:((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0≠0) (freq:ℂ) (scale:ℂ) : ShortDraftTrace.breveE (-freq*(s.datum g h).dualPoint/scale)= ShortDraftTrace.breveE (-freq*eisEmbedding (s.upper 0 0*s.upper 0 1)/scale)* ShortDraftTrace.breveE (freq*eisEmbedding (s.upper 0 0)^2* (eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 1)/eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0))/scale) := by rw [s.datum_dualPoint] rw [show -freq*(eisEmbedding (s.upper 0 0*s.upper 0 1)- eisEmbedding (s.upper 0 0)^2*(eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 1)/ eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0)))/scale= -freq*eisEmbedding (s.upper 0 0*s.upper 0 1)/scale+ freq*eisEmbedding (s.upper 0 0)^2*eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 1)/ eisEmbedding (((g:SL(2,_root_.OAI.ActualEisensteinCubic.O))*H) 1 0)/scale by ring] simp only [AddChar.map_add_eq_mul,mul_div_assoc] end FixedCuspShape end CubicEisenstein open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups ContDiff namespace CompletedGauss open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve CompletedDyadic namespace ReflectedBranchData end ReflectedBranchData end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Cusp.WeylRepresentatives /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace ShortDraftCusp open scoped BigOperators Classical MatrixGroups Matrix section open ActualEisensteinCubic CubicKubota CubicEisenstein ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationWeylRepresentatives01 abbrev Eis := ActualEisensteinCubic.O end RootNotationWeylRepresentatives01 open RootNotationWeylRepresentatives01 (Eis) def A3WeylCusp (u : Eis) : SL(2,Eis) := ⟨!![u,-1;1,0],by simp [Matrix.det_fin_two]⟩ lemma A3_ramified_relative_matrix (M : SL(2,Eis)) (u : Eis) : ((M*(lowerCuspMatrix u)⁻¹ : SL(2,Eis)) : Matrix (Fin 2) (Fin 2) Eis) = !![M 0 0-u*M 0 1,M 0 1;M 1 0-u*M 1 1,M 1 1] := by rw [Matrix.SpecialLinearGroup.coe_mul,Matrix.SpecialLinearGroup.coe_inv] ext i j fin_cases i <;> fin_cases j <;> simp [lowerCuspMatrix,Matrix.adjugate_fin_two,Matrix.mul_apply,Fin.sum_univ_two] <;> ring lemma A3_unramified_relative_matrix (M : SL(2,Eis)) (u : Eis) : ((M*(A3WeylCusp u)⁻¹ : SL(2,Eis)) : Matrix (Fin 2) (Fin 2) Eis) = !![-M 0 1,M 0 0+u*M 0 1;-M 1 1,M 1 0+u*M 1 1] := by rw [Matrix.SpecialLinearGroup.coe_mul,Matrix.SpecialLinearGroup.coe_inv] ext i j fin_cases i <;> fin_cases j <;> simp [A3WeylCusp,Matrix.adjugate_fin_two,Matrix.mul_apply,Fin.sum_univ_two] <;> ring lemma A3_ramified_mem_levelThree (M : SL(2,Eis)) (u : Eis) (ha : (3:Eis)∣M 0 0-1) (hb : (3:Eis)∣M 0 1) (hc : (3:Eis)∣M 1 0-u) (hd : (3:Eis)∣M 1 1-1) : M*(lowerCuspMatrix u)⁻¹∈levelThree := by apply (mem_levelThree_iff_entries _).mpr intro i j rw [A3_ramified_relative_matrix] fin_cases i <;> fin_cases j · convert dvd_sub ha (dvd_mul_of_dvd_right hb u) using 1 ; simp ; ring · simpa using hb · convert dvd_sub hc (dvd_mul_of_dvd_right hd u) using 1 ; simp ; ring · simpa using hd lemma A3_unramified_mem_levelThree (M : SL(2,Eis)) (u : Eis) (ha : (3:Eis)∣M 0 0-u) (hb : (3:Eis)∣M 0 1+1) (hc : (3:Eis)∣M 1 0-1) (hd : (3:Eis)∣M 1 1) : M*(A3WeylCusp u)⁻¹∈levelThree := by apply (mem_levelThree_iff_entries _).mpr intro i j rw [A3_unramified_relative_matrix] fin_cases i <;> fin_cases j · convert dvd_neg.mpr hb using 1 ; simp ; ring · convert dvd_add ha (dvd_mul_of_dvd_right hb u) using 1 ; simp ; ring · simpa using dvd_neg.mpr hd · convert dvd_add hc (dvd_mul_of_dvd_right hd u) using 1 ; simp ; ring end open ActualEisensteinCubic CubicKubota CubicEisenstein ConcreteTraceCRT CubicJacobiGlobal namespace RootNotationWeylRepresentatives02 abbrev Eis := ActualEisensteinCubic.O end RootNotationWeylRepresentatives02 open RootNotationWeylRepresentatives02 (Eis) lemma A3_ramified_literal_character (M : SL(2,Eis)) (u : Eis) (hM : M*(lowerCuspMatrix u)⁻¹∈levelThree) : complexCharacter ⟨M*(lowerCuspMatrix u)⁻¹,hM⟩ = eisEmbedding (symbol (M 1 0-u*M 1 1) (M 0 0-u*M 0 1)) := by change eisEmbedding (symbol (((M*(lowerCuspMatrix u)⁻¹ : SL(2,Eis)) : Matrix (Fin 2) (Fin 2) Eis) 1 0) (((M*(lowerCuspMatrix u)⁻¹ : SL(2,Eis)) : Matrix (Fin 2) (Fin 2) Eis) 0 0))=_ rw [A3_ramified_relative_matrix] rfl lemma A3_unramified_literal_character (M : SL(2,Eis)) (u : Eis) (hM : M*(A3WeylCusp u)⁻¹∈levelThree) : complexCharacter ⟨M*(A3WeylCusp u)⁻¹,hM⟩ = eisEmbedding (symbol (-M 1 1) (-M 0 1)) := by change eisEmbedding (symbol (((M*(A3WeylCusp u)⁻¹ : SL(2,Eis)) : Matrix (Fin 2) (Fin 2) Eis) 1 0) (((M*(A3WeylCusp u)⁻¹ : SL(2,Eis)) : Matrix (Fin 2) (Fin 2) Eis) 0 0))=_ rw [A3_unramified_relative_matrix] rfl end ShortDraftCusp namespace CubicEisenstein section open Filter MeasureTheory open scoped BigOperators Classical Topology MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CubicJacobiGlobal CompletedGauss namespace RootNotationWeylRepresentatives03 abbrev Eis := ActualEisensteinCubic.O end RootNotationWeylRepresentatives03 open RootNotationWeylRepresentatives03 (Eis) lemma fixedCuspArrayIndex_ne_zero (u:Eisˣ) (m:ℕ) (I J:Ideal Eis) (hI:primaryGenerator I≠0) (hJ:primaryGenerator J≠0) : fixedCuspArrayIndex u m I J≠0 := mul_ne_zero (mul_ne_zero (ramifiedElement_ne_zero u m) hI) (pow_ne_zero _ hJ) lemma fixedCuspArrayIndex_norm_sq (u:Eisˣ) (m:ℕ) (I J:Ideal Eis) (hI:primaryGenerator I≠0) (hJ:primaryGenerator J≠0) : ‖eisEmbedding (fixedCuspArrayIndex u m I J)‖^2= (3:ℝ)^m*(Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)^3 := by have hr:‖eisEmbedding (u.val*lambda^m)‖^2=(3:ℝ)^m := by rw [eisEmbedding_norm_sq_eq_absNorm_span,ramifiedElement_absNorm,Nat.cast_pow,Nat.cast_ofNat] calc _=‖eisEmbedding (u.val*lambda^m)‖^2*‖eisEmbedding (primaryGenerator I)‖^2* (‖eisEmbedding (primaryGenerator J)‖^2)^3 := by simp only [fixedCuspArrayIndex,map_mul,map_pow,norm_mul,norm_pow] ring _=_ := by rw [hr,primaryGenerator_norm_sq I hI,primaryGenerator_norm_sq J hJ] lemma fixedCuspArrayIndex_norm (u:Eisˣ) (m:ℕ) (I J:Ideal Eis) (hI:primaryGenerator I≠0) (hJ:primaryGenerator J≠0) : ‖eisEmbedding (fixedCuspArrayIndex u m I J)‖= Real.sqrt ((3:ℝ)^m*(Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)^3) := by rw [←fixedCuspArrayIndex_norm_sq u m I J hI hJ,Real.sqrt_sq_eq_abs,abs_of_nonneg (norm_nonneg _)] lemma fixedCuspArrayWeight_div_norm (u:Eisˣ) (m:ℕ) (I J:Ideal Eis) (hI:primaryGenerator I≠0) (hJ:primaryGenerator J≠0) : fixedCuspArrayWeight m J/‖eisEmbedding (fixedCuspArrayIndex u m I J)‖= 1/((3:ℝ)^((m:ℝ)/3)*Real.sqrt (Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ)) := by have hn:0<(Ideal.absNorm I:ℝ) := by rw [←primaryGenerator_norm_sq I hI] exact sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hI)) have hb:0<(Ideal.absNorm J:ℝ) := by rw [←primaryGenerator_norm_sq J hJ] exact sq_pos_of_pos (norm_pos_iff.mpr (eisEmbedding_ne_zero hJ)) rw [fixedCuspArrayWeight,fixedCuspArrayIndex_norm u m I J hI hJ] simpa only [Real.rpow_natCast] using cusp_coefficient_normalization (m:ℝ) (Ideal.absNorm I:ℝ) (Ideal.absNorm J:ℝ) hn hb theorem fixedConjugateCuspArray_div_norm (j:Fin 3) (u:Eisˣ) (m:ℕ) (I J:Ideal Eis) (h:fixedCuspArrayEligible I J) : star ((sourceCuspCoefficients j).value (fixedCuspArrayIndex u m I J))/ (‖eisEmbedding (fixedCuspArrayIndex u m I J)‖:ℂ)= (fixedCuspCoefficientBound:ℂ)*fixedConjugateCuspArray j u m I J/ (((3:ℝ)^((m:ℝ)/3)*Real.sqrt (Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ):ℝ):ℂ) := by rw [fixedConjugateCuspArray_reconstruct j u m I J h] calc _=(fixedCuspCoefficientBound:ℂ)*fixedConjugateCuspArray j u m I J* ((fixedCuspArrayWeight m J/‖eisEmbedding (fixedCuspArrayIndex u m I J)‖:ℝ):ℂ) := by push_cast ring _=_ := by rw [fixedCuspArrayWeight_div_norm u m I J h.2.1 h.2.2] push_cast ring end open Filter MeasureTheory open scoped BigOperators Classical Topology ContDiff MatrixGroups section open CompletedGauss CompletedDyadic ConcreteTraceCRT namespace RootNotationWeylRepresentatives04 abbrev Eis := ActualEisensteinCubic.O end RootNotationWeylRepresentatives04 open RootNotationWeylRepresentatives04 (Eis) lemma thetaFullFrequency_eq_fixedCuspArrayIndex (p:ThetaFullIndex) : thetaFullFrequency p=fixedCuspArrayIndex p.1 p.2.1 p.2.2.1.val p.2.2.2.val := rfl lemma sourceCuspRadialLength_full_index (p:ThetaFullIndex) : sourceCuspRadialLength (thetaFullFrequency p)= (3:ℝ)^p.2.1*(Ideal.absNorm p.2.2.1.val:ℝ)*(Ideal.absNorm p.2.2.2.val:ℝ)^3 := by rw [sourceCuspRadialLength,if_neg (thetaFullFrequency_ne_zero p),thetaFullFrequency_eq_fixedCuspArrayIndex] exact fixedCuspArrayIndex_norm_sq p.1 p.2.1 p.2.2.1.val p.2.2.2.val p.2.2.1.property.2 p.2.2.2.property lemma thetaRamifiedScale_eq (m:ℕ) : ramifiedScale 1 completedRamifiedStep m=(3:ℝ)^((m:ℝ)/3) := by unfold ramifiedScale completedRamifiedStep rw [one_mul,←Real.rpow_mul_natCast (by norm_num)] congr 1 ring lemma thetaRamifiedScale_cube (m:ℕ) : (ramifiedScale 1 completedRamifiedStep m)^3=(3:ℝ)^m := by rw [thetaRamifiedScale_eq,←Real.rpow_mul_natCast (by norm_num)] norm_num only [Nat.cast_ofNat] rw [show ((m:ℝ)/3)*(3:ℝ)=m by ring,Real.rpow_natCast] lemma sourceCusp_full_index_kernel_argument (p:ThetaFullIndex) (j:Fin 3) (Q X:ℝ) : X*sourceCuspRadialLength (thetaFullFrequency p)/(27*(sourceCuspScale j)^2*Q^2)= (X/(27*(sourceCuspScale j)^2*Q^2))*(ramifiedScale 1 completedRamifiedStep p.2.1)^3* (Ideal.absNorm p.2.2.1.val:ℝ)*(Ideal.absNorm p.2.2.2.val:ℝ)^3 := by rw [sourceCuspRadialLength_full_index,thetaRamifiedScale_cube] ring def sourceFrequencyAngle (h:Eis) : ℂ := eisEmbedding h/(‖eisEmbedding h‖:ℂ) lemma sourceFrequencyAngle_norm (h:Eis) (hh:h≠0) : ‖sourceFrequencyAngle h‖=1 := by rw [sourceFrequencyAngle,norm_div,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (norm_nonneg _)] exact div_self (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hh)) lemma sourceCuspRadialCoefficient_angle (j:Fin 3) (z:ℂ) (h:Eis) (hh:h≠0) : sourceCuspRadialCoefficient j z h= ((-2*Real.pi*Complex.I*thetaFrequencyScale)/(sourceCuspScale j:ℂ)^2)* sourceFrequencyAngle h* (star ((sourceCuspCoefficients j).value h)/(‖eisEmbedding h‖:ℂ))* ShortDraftTrace.breveE (-cuspFrequency h*(z/(sourceCuspScale j:ℂ))) := by have hn:(‖eisEmbedding h‖:ℂ)≠0:=Complex.ofReal_ne_zero.mpr (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hh)) have hs:(sourceCuspScale j:ℂ)≠0:=Complex.ofReal_ne_zero.mpr (sourceCuspScale_pos j).ne' rw [sourceCuspRadialCoefficient,sourceCuspRadialBaseCoefficient,sourceCuspRadialLength,if_neg hh] rw [cuspFrequency_eq_thetaFrequencyScale] unfold sourceFrequencyAngle push_cast field_simp [hn,hs] def fixedRadialCoefficientScalar : ℂ := (-2*Real.pi*Complex.I)*thetaFrequencyScale*(fixedCuspCoefficientBound:ℂ) theorem sourceCuspRadialCoefficient_fixed_array (j:Fin 3) (z:ℂ) (u:Eisˣ) (m:ℕ) (I J:Ideal Eis) (h:fixedCuspArrayEligible I J) : sourceCuspRadialCoefficient j z (fixedCuspArrayIndex u m I J)= (fixedRadialCoefficientScalar/(sourceCuspScale j:ℂ)^2)* (fixedConjugateCuspArray j u m I J* sourceFrequencyAngle (fixedCuspArrayIndex u m I J)* ShortDraftTrace.breveE (-cuspFrequency (fixedCuspArrayIndex u m I J)* (z/(sourceCuspScale j:ℂ))))/ ((ramifiedScale 1 completedRamifiedStep m*Real.sqrt (Ideal.absNorm I:ℝ)* (Ideal.absNorm J:ℝ):ℝ):ℂ) := by rw [sourceCuspRadialCoefficient_angle _ _ _ (fixedCuspArrayIndex_ne_zero u m I J h.2.1 h.2.2), fixedConjugateCuspArray_div_norm j u m I J h,thetaRamifiedScale_eq] unfold fixedRadialCoefficientScalar push_cast ring end open CompletedGauss CompletedDyadic ConcreteTraceCRT namespace RootNotationWeylRepresentatives05 abbrev Eis := ActualEisensteinCubic.O end RootNotationWeylRepresentatives05 open RootNotationWeylRepresentatives05 (Eis) lemma thetaFullIndex_denominator_pos (p:ThetaFullIndex) : 0 norm_num def reciprocalRow (a:Eis) (ha:Supported (Ideal.span {a})) : Eis→*ℂ where toFun n:=sexticReciprocityPhase a n*idealRowHom n (Ideal.span {a}) map_one' := by rw [sexticReciprocityPhase_one_right a ha,idealRowHom_one_supported _ ha,one_mul] map_mul' x y := by rw [sexticReciprocityPhase_mul_right,idealRowHom_argument_mul] ring lemma reciprocalRow_eq_idealRowHom (a n:Eis) (ha:Supported (Ideal.span {a})) (hn:Supported (Ideal.span {n})) (hpa:lambda^2∣a-1) (hpn:lambda^2∣n-1) : reciprocalRow a ha n=idealRowHom a (Ideal.span {n}) := by have h:=idealRowHom_primary_reciprocity n a hpn hpa hn ha have hs:sexticReciprocityPhase n a=sexticReciprocityPhase a n := by exact congrArg (fun z:ℤ=>(z:ℂ)) (quadraticRaySign_symm _ _) change sexticReciprocityPhase a n*idealRowHom n (Ideal.span {a})=_ rw [hs] at h exact h.symm end CanonicalRowCompletion namespace CubicEisenstein open scoped Classical BigOperators MatrixGroups Matrix open CubicKubota EisensteinCuspModThree ConcreteTraceCRT CompletedGauss CompletedDyadic namespace RootNotationWeylRepresentatives07 abbrev Eis := ActualEisensteinCubic.O end RootNotationWeylRepresentatives07 open RootNotationWeylRepresentatives07 (Eis) namespace FixedCuspShape variable {H:SL(2,Eis)} (s:FixedCuspShape H) def amplitude (u:Eisˣ) (m:ℕ) (I J:Ideal Eis) : ℂ := fixedConjugateCuspArray s.index u m I J* sourceFrequencyAngle (fixedCuspArrayIndex u m I J)* ShortDraftTrace.breveE (-cuspFrequency (fixedCuspArrayIndex u m I J)* eisEmbedding (s.upper 0 0*s.upper 0 1)/(sourceCuspScale s.index:ℂ)) lemma smoothed_row_factor (g:levelTwo) (hc:((g:SL(2,Eis))*H) 1 0≠0) : (s.datum g hc).multiplier*((s.datum g hc).heightScale:ℂ)= -star (levelTwoComplexCharacter g)* (star (levelTwoComplexCharacter s.gamma)*eisEmbedding (s.upper 0 0)^2)* ((‖eisEmbedding (((g:SL(2,Eis))*H) 1 0)‖^2:ℝ):ℂ)/ eisEmbedding (((g:SL(2,Eis))*H) 1 0)^2 := by rw [s.datum_multiplier,s.datum_heightScale] push_cast ring end FixedCuspShape end CubicEisenstein open scoped BigOperators Classical Matrix MatrixGroups namespace ShortDraftCRT variable {R:Type*} [CommRing R] lemma exists_controlled_inverse (B c a:R) (ha:IsCoprime a (B*c)) : ∃d0:R,B*c∣a*d0-1 := by obtain ⟨x,y,hxy⟩:=ha refine ⟨x,-y,?_⟩ linear_combination hxy lemma exists_controlled_zero_inverse (B c a:R) (hBc:IsCoprime B c) (hac:IsCoprime a c) : ∃d0:R,B∣d0 ∧ c∣a*d0-1 := by obtain ⟨x,y,hxy⟩:=hac.mul_left hBc refine ⟨B*x,⟨x,rfl⟩,-y,?_⟩ linear_combination hxy variable [IsDomain R] lemma fixed_completion_upper_right_dvd (B M c r a d0 b d:R) (hc:c≠0) (hBM:B∣M) (hr:IsCoprime r (M*c)) (hinv:B*c∣a*d0-1) (hdet:a*d-b*(c*r)=1) (hd:M*c∣d-d0) : B∣b := by have hBcM:B*c∣M*c:=mul_dvd_mul_right hBM c have hadd:B*c∣a*(d-d0):=dvd_mul_of_dvd_right (hBcM.trans hd) a have hfull:B*c∣a*d-1:=by convert dvd_add hadd hinv using 1 ; ring have hmul:B*c∣c*(b*r):=by convert hfull using 1 linear_combination -hdet rw [mul_comm B c] at hmul have hbr:B∣b*r:=(mul_dvd_mul_iff_left hc).mp hmul have hBr:IsCoprime B r:=hr.of_mul_right_left.symm.of_isCoprime_of_dvd_left hBM exact hBr.dvd_of_dvd_mul_right hbr theorem exists_fixed_completion_upper_right (B M c r a d0:R) (hc:c≠0) (hBM:B∣M) (hr:IsCoprime r (M*c)) (har:IsCoprime a r) (hinv:B*c∣a*d0-1) : ∃b d:R,a*d-b*(c*r)=1 ∧ M*c∣d-d0 ∧ B∣b := by obtain ⟨b,d,hdet,hd⟩:=exists_fixed_completion M c r a d0 ((dvd_mul_left c B).trans hinv) hr har exact ⟨b,d,hdet,hd,fixed_completion_upper_right_dvd B M c r a d0 b d hc hBM hr hinv hdet hd⟩ omit [IsDomain R] in theorem exists_fixed_completion_lower_right (B M c r a d0:R) (hBM:B∣M) (hr:IsCoprime r (M*c)) (har:IsCoprime a r) (hzero:B∣d0) (hinv:c∣a*d0-1) : ∃b d:R,a*d-b*(c*r)=1 ∧ M*c∣d-d0 ∧ B∣d ∧ B∣a*d ∧ B∣b*(c*r)+1 := by obtain ⟨b,d,hdet,hd⟩:=exists_fixed_completion M c r a d0 hinv hr har have hdd:B∣d-d0:=(hBM.trans (dvd_mul_right M c)).trans hd have hBd:B∣d:=by convert dvd_add hdd hzero using 1 ; ring have hBad:B∣a*d:=dvd_mul_of_dvd_right hBd a refine ⟨b,d,hdet,hd,hBd,hBad,?_⟩ convert hBad using 1 linear_combination -hdet end ShortDraftCRT end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.ChineseRemainder.PrimaryCompletions namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace ShortDraftCRT open scoped BigOperators Classical Matrix MatrixGroups section open ActualEisensteinCubic CubicEisenstein CubicJacobiGlobal lemma primary_coprime_nine (a:_root_.OAI.ActualEisensteinCubic.O) (ha:lambda^2∣a-1) : IsCoprime a (9:_root_.OAI.ActualEisensteinCubic.O) := by have h3:=primary_coprime_three a ha simpa only [show (3:_root_.OAI.ActualEisensteinCubic.O)*3=9 by norm_num] using h3.mul_right h3 lemma nine_coprime_of_not_lambda_dvd (c:_root_.OAI.ActualEisensteinCubic.O) (hc:¬lambda∣c) : IsCoprime (9:_root_.OAI.ActualEisensteinCubic.O) c := by letI principalIdealWitness := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO have hL:IsCoprime lambda c:= PrimaryIdealUnitReindex.lambda_prime_actual.irreducible.coprime_iff_not_dvd.mpr hc have h3:IsCoprime (3:_root_.OAI.ActualEisensteinCubic.O) c:=(hL.mul_left hL).of_isCoprime_of_dvd_left (by simpa only [pow_two] using three_dvd_lambda_sq) simpa only [show (3:_root_.OAI.ActualEisensteinCubic.O)*3=9 by norm_num] using h3.mul_left h3 lemma primary_numerator_controlled_inverse (c a:_root_.OAI.ActualEisensteinCubic.O) (ha:lambda^2∣a-1) (hac:IsCoprime a c) : ∃d0:_root_.OAI.ActualEisensteinCubic.O,(9:_root_.OAI.ActualEisensteinCubic.O)*c∣a*d0-1 := exists_controlled_inverse 9 c a ((primary_coprime_nine a ha).mul_right hac) lemma completion_primary_lower_right (a b c d:_root_.OAI.ActualEisensteinCubic.O) (hdet:a*d-b*c=1) (ha:(3:_root_.OAI.ActualEisensteinCubic.O)∣a-1) (hb:(3:_root_.OAI.ActualEisensteinCubic.O)∣b) : (3:_root_.OAI.ActualEisensteinCubic.O)∣d-1 := by have had:(3:_root_.OAI.ActualEisensteinCubic.O)∣a*d-1:=by convert dvd_mul_of_dvd_left hb c using 1 linear_combination hdet convert dvd_sub had (dvd_mul_of_dvd_left ha d) using 1 ; ring lemma completion_negative_upper_right (a b c d:_root_.OAI.ActualEisensteinCubic.O) (hdet:a*d-b*c=1) (hc:(3:_root_.OAI.ActualEisensteinCubic.O)∣c-1) (hd:(3:_root_.OAI.ActualEisensteinCubic.O)∣d) : (3:_root_.OAI.ActualEisensteinCubic.O)∣b+1 := by have hbc:(3:_root_.OAI.ActualEisensteinCubic.O)∣b*c+1:=by convert dvd_mul_of_dvd_right hd a using 1 linear_combination -hdet convert dvd_sub hbc (dvd_mul_of_dvd_right hc b) using 1 ; ring theorem exists_primary_numerator_completion (M c a:_root_.OAI.ActualEisensteinCubic.O) (hc:c≠0) (h9M:(9:_root_.OAI.ActualEisensteinCubic.O)∣M) (ha:lambda^2∣a-1) (hac:IsCoprime a c) : ∃d0:_root_.OAI.ActualEisensteinCubic.O,(9:_root_.OAI.ActualEisensteinCubic.O)*c∣a*d0-1 ∧ ∀r:_root_.OAI.ActualEisensteinCubic.O,IsCoprime r (M*c)→IsCoprime a r→lambda^2∣r-1→ ∃b d:_root_.OAI.ActualEisensteinCubic.O,a*d-b*(c*r)=1 ∧ M*c∣d-d0 ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣b ∧ (3:_root_.OAI.ActualEisensteinCubic.O)∣d-1 ∧ (3:_root_.OAI.ActualEisensteinCubic.O)∣c*r-c := by obtain ⟨d0,hd0⟩:=primary_numerator_controlled_inverse c a ha hac refine ⟨d0,hd0,?_⟩ intro r hr har hprimary obtain ⟨b,d,hdet,hd,hb⟩:=exists_fixed_completion_upper_right 9 M c r a d0 hc h9M hr har hd0 refine ⟨b,d,hdet,hd,hb,completion_primary_lower_right a b (c*r) d hdet (three_dvd_primary_sub_one a ha) ((show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans hb),?_⟩ convert dvd_mul_of_dvd_right (three_dvd_primary_sub_one r hprimary) c using 1 ; ring theorem exists_unramified_denominator_completion (M c a:_root_.OAI.ActualEisensteinCubic.O) (h9M:(9:_root_.OAI.ActualEisensteinCubic.O)∣M) (hc:¬lambda∣c) (hac:IsCoprime a c) : ∃d0:_root_.OAI.ActualEisensteinCubic.O,(9:_root_.OAI.ActualEisensteinCubic.O)∣d0 ∧ c∣a*d0-1 ∧ ∀r:_root_.OAI.ActualEisensteinCubic.O,IsCoprime r (M*c)→IsCoprime a r→ ∃b d:_root_.OAI.ActualEisensteinCubic.O,a*d-b*(c*r)=1 ∧ M*c∣d-d0 ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣d ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣a*d ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣b*(c*r)+1 := by obtain ⟨d0,hzero,hinv⟩:=exists_controlled_zero_inverse 9 c a (nine_coprime_of_not_lambda_dvd c hc) hac exact ⟨d0,hzero,hinv,fun r hr har=>exists_fixed_completion_lower_right 9 M c r a d0 h9M hr har hzero hinv⟩ theorem exists_primary_denominator_completion (M c a:_root_.OAI.ActualEisensteinCubic.O) (h9M:(9:_root_.OAI.ActualEisensteinCubic.O)∣M) (hc:lambda^2∣c-1) (hac:IsCoprime a c) : ∃d0:_root_.OAI.ActualEisensteinCubic.O,(9:_root_.OAI.ActualEisensteinCubic.O)∣d0 ∧ c∣a*d0-1 ∧ ∀r:_root_.OAI.ActualEisensteinCubic.O,IsCoprime r (M*c)→IsCoprime a r→lambda^2∣r-1→ ∃b d:_root_.OAI.ActualEisensteinCubic.O,a*d-b*(c*r)=1 ∧ M*c∣d-d0 ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣d ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣a*d ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣b*(c*r)+1 ∧ (3:_root_.OAI.ActualEisensteinCubic.O)∣b+1 ∧ (3:_root_.OAI.ActualEisensteinCubic.O)∣c*r-1 := by have hcl:¬lambda∣c:=by intro hd have hcL:IsCoprime lambda c:= (primary_coprime_three c hc).symm.of_isCoprime_of_dvd_left ((dvd_pow_self lambda (by decide : (2:ℕ)≠0)).trans lambda_sq_dvd_three) exact PrimaryIdealUnitReindex.lambda_prime_actual.not_isUnit (hcL.isUnit_of_dvd hd) obtain ⟨d0,hzero,hinv,hcomp⟩:=exists_unramified_denominator_completion M c a h9M hcl hac refine ⟨d0,hzero,hinv,?_⟩ intro r hr har hpr obtain ⟨b,d,hdet,hd,hBd,had,hbc⟩:=hcomp r hr har have hc3:(3:_root_.OAI.ActualEisensteinCubic.O)∣c*r-1:=three_dvd_primary_sub_one _ (primary_mul c r hc hpr) exact ⟨b,d,hdet,hd,hBd,had,hbc,completion_negative_upper_right a b (c*r) d hdet hc3 ((show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans hBd),hc3⟩ end section variable {R:Type*} [CommRing R] [IsDomain R] theorem exists_fixed_matrix_completion_controlled (B N M c a0 r0 b0 d0 bResidue dResidue:R) (hc:c≠0) (hBM:B∣M) (hNM:N∣M) (hdet0:a0*d0-b0*(c*r0)=1) (hb0:B∣b0-bResidue) (hd0:N∣d0-dResidue) : ∀a r:R,M*c∣a-a0→M∣r-r0→IsCoprime r (M*c)→IsCoprime a r→ ∃b d:R,a*d-b*(c*r)=1 ∧ M*c∣d-d0 ∧ B∣b-bResidue ∧ N∣d-dResidue ∧ (!![a,b;c*r,d]:Matrix (Fin 2) (Fin 2) R).map (Ideal.Quotient.mk (Ideal.span {M}))= (!![a0,b0;c*r0,d0]:Matrix (Fin 2) (Fin 2) R).map (Ideal.Quotient.mk (Ideal.span {M})) := by intro a r ha hrr hr har obtain ⟨b,d,hdet,hd,hmat⟩:=exists_fixed_matrix_completion M c a0 r0 d0 b0 hc hdet0 a r ha hrr hr har have hbd:B∣b-b0:=hBM.trans (fixed_completion_congr M c r r0 a a0 b b0 d d0 hc hr.of_mul_right_left.symm hdet hdet0 ha hd hrr) have hdd:N∣d-d0:=(hNM.trans (dvd_mul_right M c)).trans hd refine ⟨b,d,hdet,hd,?_,?_,hmat⟩ · convert dvd_add hbd hb0 using 1 ; ring · convert dvd_add hdd hd0 using 1 ; ring end section open ActualEisensteinCubic CubicEisenstein CubicJacobiGlobal CubicKubota ShortDraftCusp def controlledCompletionMatrix (a b c d:_root_.OAI.ActualEisensteinCubic.O) (hdet:a*d-b*c=1) : SL(2,_root_.OAI.ActualEisensteinCubic.O) := ⟨!![a,b;c,d],by simpa [Matrix.det_fin_two] using hdet⟩ end open ActualEisensteinCubic CubicEisenstein CubicJacobiGlobal theorem exists_primary_numerator_sector_completions {ι Q:Type*} (M c:_root_.OAI.ActualEisensteinCubic.O) (hc:c≠0) (h9M:(9:_root_.OAI.ActualEisensteinCubic.O)∣M) (sector:ι→Q) (a r:ι→_root_.OAI.ActualEisensteinCubic.O) (haPrimary:∀i,lambda^2∣a i-1) (hrPrimary:∀i,lambda^2∣r i-1) (hcop:∀i,IsCoprime (a i) (c*r i)) (hr:∀i,IsCoprime (r i) (M*c)) (ha:∀i j,sector i=sector j→M*c∣a i-a j) (hrr:∀i j,sector i=sector j→M∣r i-r j) : ∃(b d:ι→_root_.OAI.ActualEisensteinCubic.O) (C:Q→Matrix (Fin 2) (Fin 2) (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {M})), (∀i,a i*d i-b i*(c*r i)=1) ∧ (∀i,(9:_root_.OAI.ActualEisensteinCubic.O)∣b i) ∧ (∀i,(3:_root_.OAI.ActualEisensteinCubic.O)∣d i-1) ∧ ∀i,(!![a i,b i;c*r i,d i]:Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O).map (Ideal.Quotient.mk (Ideal.span {M}))=C (sector i) := by have h3M:(3:_root_.OAI.ActualEisensteinCubic.O)∣M:=(show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans h9M have hlocal (q:Q) : ∃C:Matrix (Fin 2) (Fin 2) (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {M}), ∀i,sector i=q→∃b d:_root_.OAI.ActualEisensteinCubic.O,a i*d-b*(c*r i)=1 ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣b ∧ (3:_root_.OAI.ActualEisensteinCubic.O)∣d-1 ∧ (!![a i,b;c*r i,d]:Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O).map (Ideal.Quotient.mk (Ideal.span {M}))=C := by by_cases hq:∃j,sector j=q · obtain ⟨j,hj⟩:=hq obtain ⟨inverse,_,hcompletion⟩:=exists_primary_numerator_completion M c (a j) hc h9M (haPrimary j) (hcop j).of_mul_right_left obtain ⟨b0,d0,hdet0,_,hb0,hd0,_⟩:=hcompletion (r j) (hr j) (hcop j).of_mul_right_right (hrPrimary j) refine ⟨(!![a j,b0;c*r j,d0]:Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O).map (Ideal.Quotient.mk (Ideal.span {M})),?_⟩ intro i hi have hs:sector i=sector j:=hi.trans hj.symm obtain ⟨b,d,hdet,_,hb,hd,hmat⟩:=exists_fixed_matrix_completion_controlled 9 3 M c (a j) (r j) b0 d0 0 1 hc h9M h3M hdet0 (by simpa using hb0) hd0 (a i) (r i) (ha i j hs) (hrr i j hs) (hr i) (hcop i).of_mul_right_right exact ⟨b,d,hdet,by simpa using hb,hd,hmat⟩ · refine ⟨0,?_⟩ intro i hi exact False.elim (hq ⟨i,hi⟩) choose C hC using hlocal have hi (i:ι):=hC (sector i) i rfl choose b d hdet hb hd hmat using hi exact ⟨b,d,C,hdet,hb,hd,hmat⟩ theorem exists_primary_denominator_sector_completions {ι Q:Type*} (M c:_root_.OAI.ActualEisensteinCubic.O) (h9M:(9:_root_.OAI.ActualEisensteinCubic.O)∣M) (hcPrimary:lambda^2∣c-1) (sector:ι→Q) (a r:ι→_root_.OAI.ActualEisensteinCubic.O) (hrPrimary:∀i,lambda^2∣r i-1) (hcop:∀i,IsCoprime (a i) (c*r i)) (hr:∀i,IsCoprime (r i) (M*c)) (ha:∀i j,sector i=sector j→M*c∣a i-a j) (hrr:∀i j,sector i=sector j→M∣r i-r j) : ∃(b d:ι→_root_.OAI.ActualEisensteinCubic.O) (C:Q→Matrix (Fin 2) (Fin 2) (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {M})), (∀i,a i*d i-b i*(c*r i)=1) ∧ (∀i,(3:_root_.OAI.ActualEisensteinCubic.O)∣b i+1) ∧ (∀i,(9:_root_.OAI.ActualEisensteinCubic.O)∣d i) ∧ ∀i,(!![a i,b i;c*r i,d i]:Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O).map (Ideal.Quotient.mk (Ideal.span {M}))=C (sector i) := by have hc:c≠0:=primary_ne_zero c hcPrimary have h3M:(3:_root_.OAI.ActualEisensteinCubic.O)∣M:=(show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans h9M have hlocal (q:Q) : ∃C:Matrix (Fin 2) (Fin 2) (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {M}), ∀i,sector i=q→∃b d:_root_.OAI.ActualEisensteinCubic.O,a i*d-b*(c*r i)=1 ∧ (3:_root_.OAI.ActualEisensteinCubic.O)∣b+1 ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣d ∧ (!![a i,b;c*r i,d]:Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O).map (Ideal.Quotient.mk (Ideal.span {M}))=C := by by_cases hq:∃j,sector j=q · obtain ⟨j,hj⟩:=hq obtain ⟨inverse,_,_,hcompletion⟩:=exists_primary_denominator_completion M c (a j) h9M hcPrimary (hcop j).of_mul_right_left obtain ⟨b0,d0,hdet0,_,hd0,_,_,hb0,_⟩:=hcompletion (r j) (hr j) (hcop j).of_mul_right_right (hrPrimary j) refine ⟨(!![a j,b0;c*r j,d0]:Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O).map (Ideal.Quotient.mk (Ideal.span {M})),?_⟩ intro i hi have hs:sector i=sector j:=hi.trans hj.symm obtain ⟨b,d,hdet,_,hb,hd,hmat⟩:=exists_fixed_matrix_completion_controlled 3 9 M c (a j) (r j) b0 d0 (-1) 0 hc h3M h9M hdet0 (by simpa using hb0) (by simpa using hd0) (a i) (r i) (ha i j hs) (hrr i j hs) (hr i) (hcop i).of_mul_right_right exact ⟨b,d,hdet,by simpa using hb,by simpa using hd,hmat⟩ · refine ⟨0,?_⟩ intro i hi exact False.elim (hq ⟨i,hi⟩) choose C hC using hlocal have hi (i:ι):=hC (sector i) i rfl choose b d hdet hb hd hmat using hi exact ⟨b,d,C,hdet,hb,hd,hmat⟩ end ShortDraftCRT namespace CubicEisenstein open scoped Classical BigOperators ContDiff MatrixGroups open CompletedGauss CompletedDyadic theorem sum_smoothedKernel_common_cusp {ι:Type*} [Fintype ι] (d:ι→SourceCuspDatum) (w:ι→ℂ) (j:Fin 3) (Q:ℝ) (hj:∀i,(d i).index=j) (hQ:∀i,(d i).heightScale=Q) (W:ℝ→ℂ) (a b:ℝ) (ha:0w i* ((d i).multiplier*((d i).heightScale:ℂ)*(sourceCuspScale (d i).index:ℂ)^2)* (sourceCuspRadialCoefficient (d i).index (d i).dualPoint (thetaFullFrequency p)* CubicReflectionKernel.paperKernel (Vstar W) (X*sourceCuspRadialLength (thetaFullFrequency p)/ (27*(sourceCuspScale (d i).index)^2*(d i).heightScale^2))) have hs (i:ι):Summable (F i):=by exact ((d i).smoothedKernel_full_index_norm_summable W a b ha hsupp hW X hX).of_norm.mul_left _ have he (i:ι):w i*(d i).smoothedKernel W X=∑'p,F i p := by rw [(d i).smoothedKernel_full_index] simp only [F,tsum_mul_left] ring simp_rw [he] rw [←Summable.tsum_finsetSum (fun i _=>hs i),←tsum_mul_left] apply tsum_congr intro p rw [Finset.mul_sum,Finset.mul_sum] apply Finset.sum_congr rfl intro i hi have hn:=(d i).smoothedFullCoefficient_normalization p dsimp only [F] calc _=w i*(((d i).multiplier*((d i).heightScale:ℂ)*(sourceCuspScale (d i).index:ℂ)^2)* sourceCuspRadialCoefficient (d i).index (d i).dualPoint (thetaFullFrequency p))* CubicReflectionKernel.paperKernel (Vstar W) (X*sourceCuspRadialLength (thetaFullFrequency p)/ (27*(sourceCuspScale (d i).index)^2*(d i).heightScale^2)):=by ring _=_:=by rw [hn,hj i,hQ i]; ring end CubicEisenstein open scoped Classical BigOperators namespace CanonicalRowCompletion open ActualEisensteinCubic CanonicalQuadraticSieve ConcretePrimeRowBridge open UniqueFactorizationMonoid def coprimalityMask (m:_root_.OAI.ActualEisensteinCubic.O) : _root_.OAI.ActualEisensteinCubic.O→*ℂ where toFun n:=if IsCoprime m n then 1 else 0 map_one' := by simp only [isCoprime_one_right,ite_true] map_mul' x y := by simp only [IsCoprime.mul_right_iff] by_cases hx:IsCoprime m x <;> by_cases hy:IsCoprime m y <;> simp [hx,hy] lemma isCoprime_congr_mod (m x y:_root_.OAI.ActualEisensteinCubic.O) (hxy:m∣x-y) : IsCoprime m x↔IsCoprime m y := by obtain ⟨z,hz⟩:=hxy constructor · rintro ⟨r,s,hrs⟩ refine ⟨r+s*z,s,?_⟩ linear_combination hrs-s*hz · rintro ⟨r,s,hrs⟩ refine ⟨r-s*z,s,?_⟩ linear_combination hrs+s*hz lemma idealRowHom_prime_sixth_mask (m:_root_.OAI.ActualEisensteinCubic.O) (P:Ideal _root_.OAI.ActualEisensteinCubic.O) [P.IsMaximal] (hg:lambda∉P) : idealRowHom (m^6) P=if IsCoprime P (Ideal.span {m}) then 1 else 0 := by rw [idealRowHom_prime _ P hg] have hm:=canonicalSextic_sixth_power_mask P hg m rw [hm] rw [SixthPowerAverage.prime_coprime_span_iff] by_cases hm:m∈P <;> simp [hm] theorem idealRowHom_sixth_mask (m:_root_.OAI.ActualEisensteinCubic.O) (I:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:Supported I) : idealRowHom (m^6) I=if IsCoprime I (Ideal.span {m}) then 1 else 0 := by have hprod (s:Multiset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (hs:∀P∈s,P.IsMaximal ∧ lambda∉P) : idealRowHom (m^6) s.prod=if IsCoprime s.prod (Ideal.span {m}) then 1 else 0 := by induction s using Multiset.induction_on with | empty => change idealRowHom (m^6) 1=if IsCoprime (1:Ideal _root_.OAI.ActualEisensteinCubic.O) (Ideal.span {m}) then 1 else 0 simp only [map_one,isCoprime_one_left,ite_true] | @cons P s ih => have hp:=hs P (Multiset.mem_cons_self _ _) let:P.IsMaximal:=hp.1 have ht:∀R∈s,R.IsMaximal ∧ lambda∉R:=fun R hR=>hs R (Multiset.mem_cons_of_mem hR) rw [Multiset.prod_cons,map_mul,idealRowHom_prime_sixth_mask m P hp.2,ih ht, IsCoprime.mul_left_iff] by_cases hP:IsCoprime P (Ideal.span {m}) <;> by_cases hS:IsCoprime s.prod (Ideal.span {m}) <;> simp [hP,hS] have h:=hprod (normalizedFactors I) (fun P hP=> ⟨(supported_factors_good I hI P hP).1,(supported_factors_good I hI P hP).2.1⟩) rwa [Ideal.prod_normalizedFactors_eq_self hI.1] at h lemma idealRowHom_sixth_eq_mask (m n:_root_.OAI.ActualEisensteinCubic.O) (hn:Supported (Ideal.span {n})) : idealRowHom (m^6) (Ideal.span {n})=coprimalityMask m n := by rw [idealRowHom_sixth_mask m _ hn,Ideal.isCoprime_span_singleton_iff] change (if IsCoprime n m then (1:ℂ) else 0)=(if IsCoprime m n then 1 else 0) rw [isCoprime_comm] lemma rowTwist_extract_sixth_mask (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (m f z n:_root_.OAI.ActualEisensteinCubic.O) (hn:Supported (Ideal.span {n})) : rowTwist Ψ m f z n=Ψ n*coprimalityMask m n* idealRowHom (f^4*z) (Ideal.span {n}) := by change Ψ n*idealRowHom (m^6*f^4*z) (Ideal.span {n})=_ rw [show m^6*f^4*z=m^6*(f^4*z) by ring,idealRowHom_argument_mul, idealRowHom_sixth_eq_mask m n hn] ring end CanonicalRowCompletion open scoped BigOperators Classical MatrixGroups Matrix namespace ShortDraftCusp section open ActualEisensteinCubic CubicKubota CubicEisenstein ConcreteTraceCRT CubicJacobiGlobal open CompletedGauss CanonicalRowCompletion theorem embedded_symbol_product {ι : Type*} [Fintype ι] (p : ι→_root_.OAI.ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (hg : ∀i,lambda∉Ideal.span {p i}) (a : _root_.OAI.ActualEisensteinCubic.O) : eisEmbedding (symbol a (∏i,p i))= ∏i,(actualSextic (Ideal.span {p i}) (hg i) (Ideal.Quotient.mk _ a))^2 := by change eisEmbedding (idealSymbol (Ideal.span {∏i,p i}) a)=_ rw [←idealRowHom_square,idealRowHom_product p hg Finset.univ a] simp only [ActualEisensteinCubic.finiteSquarefreeRow,actualSextic,Finset.prod_pow] theorem conjugate_symbol_product {ι : Type*} [Fintype ι] (p : ι→_root_.OAI.ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (hg : ∀i,lambda∉Ideal.span {p i}) (a : _root_.OAI.ActualEisensteinCubic.O) : star (eisEmbedding (symbol a (∏i,p i)))= ∏i,(((actualSextic (Ideal.span {p i}) (hg i))⁻¹)^2) (Ideal.Quotient.mk _ a) := by rw [embedded_symbol_product p hg a,star_prod] apply Finset.prod_congr rfl intro i hi rw [star_pow,MulChar.star_apply',MulChar.pow_apply' _ (by decide : (2:ℕ)≠0)] theorem conjugate_symbol_product_frequency {ι : Type*} [Fintype ι] (p : ι→_root_.OAI.ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (hg : ∀i,lambda∉Ideal.span {p i}) (a : _root_.OAI.ActualEisensteinCubic.O) (σ : ∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) (h : ∀i,_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) (ha : ∀i,Ideal.Quotient.mk (Ideal.span {p i}) a=(σ i : _root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*h i) : star (eisEmbedding (symbol a (∏i,p i)))= ∏i,(((actualSextic (Ideal.span {p i}) (hg i))⁻¹)^2) ((σ i : _root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*h i) := by rw [conjugate_symbol_product p hg a] simp only [ha] end open ActualEisensteinCubic CubicEisenstein ConcreteTraceCRT FiniteGaussPhase lemma A4_field_inverse {F : Type*} [Field F] (a d B : F) (σ ε : Fˣ) (h x : F) (had : a*d=1) (ha : a=(σ:F)*h) (hε : B*(σ:F)*(ε:F)=-1) : h≠0 ∧ -d*B⁻¹*x=((ε:F)*x)*h⁻¹ := by have hh : h≠0 := by intro hz rw [ha,hz,mul_zero,zero_mul] at had exact zero_ne_one had have hB : B≠0 := by intro hz rw [hz,zero_mul,zero_mul] at hε exact neg_ne_zero.mpr (one_ne_zero : (1:F)≠0) hε.symm have hd : d=((σ:F)*h)⁻¹ := eq_inv_of_mul_eq_one_right (ha ▸ had) have he : (ε:F)=-(B*(σ:F))⁻¹ := by have heq : (B*(σ:F))*(-(ε:F))=1 := by linear_combination -hε exact neg_eq_iff_eq_neg.mp (eq_inv_of_mul_eq_one_right heq) refine ⟨hh,?_⟩ rw [hd,he] field_simp noncomputable abbrev A4quotientField (P : Ideal _root_.OAI.ActualEisensteinCubic.O) [P.IsMaximal] : Field (_root_.OAI.ActualEisensteinCubic.O⧸P) := Ideal.Quotient.field P lemma A4_active_local {ι : Type*} [Fintype ι] (p : ι→_root_.OAI.ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (a b c0 d : _root_.OAI.ActualEisensteinCubic.O) (hdet : a*d-b*(c0*∏i,p i)=1) (σ ε : ∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) (h : ∀i,_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) (ha : ∀i,Ideal.Quotient.mk (Ideal.span {p i}) a=(σ i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*h i) (hε : ∀i,Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^3*c0*cofactor p i)*(σ i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*(ε i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})=-1) (x : _root_.OAI.ActualEisensteinCubic.O) (i : ι) : letI explicitWitness0 := @OAI.ShortDraftCusp.A4quotientField h i≠0 ∧ -(Ideal.Quotient.mk (Ideal.span {p i}) d)* (Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^3*c0*cofactor p i))⁻¹* Ideal.Quotient.mk (Ideal.span {p i}) x = ((ε i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*Ideal.Quotient.mk (Ideal.span {p i}) x)*(h i)⁻¹ := by letI explicitWitness0 := @OAI.ShortDraftCusp.A4quotientField exact ( by have hz : Ideal.Quotient.mk (Ideal.span {p i}) (∏k,p k)=0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr (Finset.dvd_prod_of_mem p (Finset.mem_univ i))) have had : Ideal.Quotient.mk (Ideal.span {p i}) a* Ideal.Quotient.mk (Ideal.span {p i}) d=1 := by have he := congrArg (Ideal.Quotient.mk (Ideal.span {p i})) hdet simpa only [map_sub,map_mul,map_one,hz,mul_zero,sub_zero] using he exact A4_field_inverse _ _ _ (σ i) (ε i) (h i) _ had (ha i) (hε i) ) lemma A4_complement_inverse {ι : Type*} [Fintype ι] (p : ι→_root_.OAI.ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (c0 U w : _root_.OAI.ActualEisensteinCubic.O) (hbez : U*(∏i,p i)+(ramifiedTraceLambda^3*w)*c0=1) (i : ι) (v t : _root_.OAI.ActualEisensteinCubic.O) (hlocal : t*p i+v*cofactor p i=1) : letI explicitWitness0 := @OAI.ShortDraftCusp.A4quotientField (Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^3*c0*cofactor p i))⁻¹= Ideal.Quotient.mk (Ideal.span {p i}) (w*v) := by letI explicitWitness0 := @OAI.ShortDraftCusp.A4quotientField exact ( by have hz : Ideal.Quotient.mk (Ideal.span {p i}) (∏k,p k)=0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr (Finset.dvd_prod_of_mem p (Finset.mem_univ i))) have hp0 : Ideal.Quotient.mk (Ideal.span {p i}) (p i)=0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.subset_span (by simp)) have hw := congrArg (Ideal.Quotient.mk (Ideal.span {p i})) hbez have hv := congrArg (Ideal.Quotient.mk (Ideal.span {p i})) hlocal simp only [map_add,map_mul,map_pow,map_one,hz,mul_zero,zero_add] at hw simp only [map_add,map_mul,map_one,hp0,mul_zero,zero_add] at hv symm apply eq_inv_of_mul_eq_one_right simp only [map_mul,map_pow] calc _ = ((Ideal.Quotient.mk _ ramifiedTraceLambda)^3*Ideal.Quotient.mk _ w* Ideal.Quotient.mk _ c0)*(Ideal.Quotient.mk _ v*Ideal.Quotient.mk _ (cofactor p i)) := by ring _ = 1 := by rw [hw,hv,mul_one] ) end ShortDraftCusp end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Cusp.ResiduePhases namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace ShortDraftCusp open scoped BigOperators Classical MatrixGroups Matrix section open ActualEisensteinCubic CubicEisenstein ConcreteTraceCRT FiniteGaussPhase IdealGaussCRT lemma A4_bad_modulus_ne_zero (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) : ramifiedTraceLambda^3*c0≠0 := by apply mul_ne_zero _ hc0 apply pow_ne_zero intro hz have he:=ramifiedEmbedding_traceLambda rw [hz,map_zero] at he exact eisLam_ne_zero he.symm def A4BadPhase (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (d U x:_root_.OAI.ActualEisensteinCubic.O) : ℂ := quotientTrace (ramifiedTraceLambda^3*c0) (A4_bad_modulus_ne_zero c0 hc0) (Ideal.Quotient.mk _ (-d*U*x)) lemma A4BadPhase_eq (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (d U x:_root_.OAI.ActualEisensteinCubic.O) : A4BadPhase c0 hc0 d U x = ShortDraftTrace.breveE (-(eisEmbedding d*eisEmbedding U*(eisEmbedding x/eisLam^4))/eisEmbedding c0) := by change ShortDraftTrace.breveE (eisEmbedding (-d*U*x)/(eisEmbedding (ramifiedTraceLambda^3*c0)*eisLam))=_ simp only [map_mul,map_pow,map_neg,ramifiedEmbedding_traceLambda] congr 1 field_simp [eisLam_ne_zero,eisEmbedding_ne_zero hc0] noncomputable abbrev A4phaseField (P : Ideal _root_.OAI.ActualEisensteinCubic.O) [P.IsMaximal] : Field (_root_.OAI.ActualEisensteinCubic.O⧸P) := Ideal.Quotient.field P noncomputable abbrev A4phaseFintype (P : Ideal _root_.OAI.ActualEisensteinCubic.O) [P.IsMaximal] : Fintype (_root_.OAI.ActualEisensteinCubic.O⧸P) := Fintype.ofFinite _ theorem A4_phase_product {ι : Type*} [Fintype ι] (p : ι→_root_.OAI.ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (hp : ∀i,p i≠0) (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (a b c0 d U w x:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (hdet:a*d-b*(c0*∏i,p i)=1) (hbez:U*(∏i,p i)+(ramifiedTraceLambda^3*w)*c0=1) (σ ε : ∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) (h : ∀i,_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) (ha : ∀i,Ideal.Quotient.mk (Ideal.span {p i}) a=(σ i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*h i) (hε : ∀i,Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^3*c0*cofactor p i)*(σ i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*(ε i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})=-1) : let : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => A4phaseField (Ideal.span {p i}) let : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => A4phaseFintype (Ideal.span {p i}) ShortDraftTrace.breveE (-(eisEmbedding d*(eisEmbedding x/eisLam^4))/ (eisEmbedding c0*eisEmbedding (∏i,p i))) = A4BadPhase c0 hc0 d U x * ∏i,quotientTrace (p i) (hp i) (((ε i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*Ideal.Quotient.mk _ x)*(h i)⁻¹) := by let : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => A4phaseField (Ideal.span {p i}) let : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => A4phaseFintype (Ideal.span {p i}) let hr : (∏i,p i)≠0:=Finset.prod_ne_zero_iff.mpr (fun i _=>hp i) have hs:=ShortDraftCRT.normalized_crt_pair eisEmbedding ShortDraftTrace.breveE ramifiedTraceLambda c0 (∏i,p i) d x U w (by simpa only [ramifiedEmbedding_traceLambda] using eisLam_ne_zero) (eisEmbedding_ne_zero hc0) (eisEmbedding_ne_zero hr) hbez simp only [ramifiedEmbedding_traceLambda] at hs rw [hs,←A4BadPhase_eq c0 hc0 d U x] congr 1 have he : ShortDraftTrace.breveE (eisEmbedding (-d*w*x)/(eisLam*eisEmbedding (∏i,p i)))= quotientTrace (∏i,p i) hr (Ideal.Quotient.mk _ (-d*w*x)) := by simp only [quotientTrace,eisTraceModChar,traceModChar_mk] congr 1 rw [mul_comm eisLam] rw [he,addChar_finite_crt_factor (fun i=>_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) (productElementCRT p hcop)] apply Finset.prod_congr rfl intro i hi rw [productElementCRT_mk] obtain ⟨t,v,hlocal⟩:=bezout_of_principal_coprime (cofactor_coprime p hcop i) have hc:=coordinate_trace_character p hp hcop i t v hlocal change coordinateAddChar (fun i=>_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) (productElementCRT p hcop) (quotientTrace (∏i,p i) hr) i (Ideal.Quotient.mk _ (-d*w*x))=_ change coordinateAddChar (fun i=>_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) (productElementCRT p hcop) (eisTraceModChar ShortDraftTrace.breveE ConcreteBreveE.breveE_period_coordinates (∏i,p i) hr) i (Ideal.Quotient.mk _ (-d*w*x))=_ rw [hc] change quotientTrace (p i) (hp i) (Ideal.Quotient.mk _ v*Ideal.Quotient.mk _ (-d*w*x))=_ apply congrArg (quotientTrace (p i) (hp i)) have hinv:=A4_complement_inverse p c0 U w hbez i v t hlocal have hphase:=(A4_active_local p a b c0 d hdet σ ε h ha hε x i).2 rw [hinv] at hphase convert hphase using 1 ; simp only [map_mul,map_neg] ; ring end open ActualEisensteinCubic CubicEisenstein ConcreteTraceCRT FiniteGaussPhase open CompletedGauss LocalReflectionBrackets noncomputable abbrev A4frequencyField (P : Ideal _root_.OAI.ActualEisensteinCubic.O) [P.IsMaximal] : Field (_root_.OAI.ActualEisensteinCubic.O⧸P) := Ideal.Quotient.field P noncomputable abbrev A4frequencyFintype (P : Ideal _root_.OAI.ActualEisensteinCubic.O) [P.IsMaximal] : Fintype (_root_.OAI.ActualEisensteinCubic.O⧸P) := Fintype.ofFinite _ theorem A3_A4_frequency_product {ι : Type*} [Fintype ι] (p : ι→_root_.OAI.ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (hp : ∀i,p i≠0) (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg : ∀i,lambda∉Ideal.span {p i}) (a b c0 d U w x:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (hdet:a*d-b*(c0*∏i,p i)=1) (hbez:U*(∏i,p i)+(ramifiedTraceLambda^3*w)*c0=1) (σ ε : ∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) (h : ∀i,_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) (ha : ∀i,Ideal.Quotient.mk (Ideal.span {p i}) a=(σ i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*h i) (hε : ∀i,Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^3*c0*cofactor p i)*(σ i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*(ε i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})=-1) : let : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => A4frequencyField (Ideal.span {p i}) let : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => A4frequencyFintype (Ideal.span {p i}) star (eisEmbedding (CubicJacobiGlobal.symbol a (∏i,p i)))* ShortDraftTrace.breveE (-(eisEmbedding d*(eisEmbedding x/eisLam^4))/ (eisEmbedding c0*eisEmbedding (∏i,p i))) = A4BadPhase c0 hc0 d U x * ∏i,frequencyMultiplier (actualSextic (Ideal.span {p i}) (hg i)) (quotientTrace (p i) (hp i)) (σ i) (ε i) (Ideal.Quotient.mk _ x) (h i) := by let : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => A4frequencyField (Ideal.span {p i}) let : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => A4frequencyFintype (Ideal.span {p i}) rw [conjugate_symbol_product_frequency p hg a σ h ha, A4_phase_product p hp hcop a b c0 d U w x hc0 hdet hbez σ ε h ha hε] calc _ = A4BadPhase c0 hc0 d U x * ((∏i,(((actualSextic (Ideal.span {p i}) (hg i))⁻¹)^2) ((σ i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*h i))* ∏i,quotientTrace (p i) (hp i) (((ε i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*Ideal.Quotient.mk _ x)*(h i)⁻¹)) := by ring _ = _ := by congr 1 rw [←Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i hi have hn:=(A4_active_local p a b c0 d hdet σ ε h ha hε x i).1 simp only [frequencyMultiplier,if_neg hn] lemma A4BadPhase_eq_of_residue (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (d U d' U' x:_root_.OAI.ActualEisensteinCubic.O) (hres:ramifiedTraceLambda^3*c0∣d*U-d'*U') : A4BadPhase c0 hc0 d U x=A4BadPhase c0 hc0 d' U' x := by unfold A4BadPhase congr 1 apply Ideal.Quotient.eq.mpr apply Ideal.mem_span_singleton.mpr have hd:=dvd_mul_of_dvd_left hres (-x) convert hd using 1 ; ring end ShortDraftCusp open scoped BigOperators Classical namespace IdealGaussCRT open CubicEisenstein end IdealGaussCRT namespace LocalReflectionBrackets open ActualEisensteinCubic CubicEisenstein IdealGaussCRT CompletedGauss end LocalReflectionBrackets namespace FiniteGaussPhase section open ActualEisensteinCubic CubicEisenstein ConcreteTraceCRT IdealGaussCRT theorem exists_product_trace_shifts {ι : Type*} [Fintype ι] (p : ι→_root_.OAI.ActualEisensteinCubic.O) (hp : ∀i,p i≠0) (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) : ∃k : ∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ, (∀i,Ideal.Quotient.mk (Ideal.span {p i}) (cofactor p i)*(k i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})=1) ∧ ∀i,coordinateAddChar (fun i=>_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) (productElementCRT p hcop) (quotientTrace (∏i,p i) (Finset.prod_ne_zero_iff.mpr (fun i _=>hp i))) i= (quotientTrace (p i) (hp i)).mulShift (k i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := by have hone (i : ι) : ∃k : (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ, Ideal.Quotient.mk (Ideal.span {p i}) (cofactor p i)*(k:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})=1 ∧ coordinateAddChar (fun i=>_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) (productElementCRT p hcop) (quotientTrace (∏i,p i) (Finset.prod_ne_zero_iff.mpr (fun i _=>hp i))) i= (quotientTrace (p i) (hp i)).mulShift (k:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := by obtain ⟨u,v,hbez⟩:=bezout_of_principal_coprime (cofactor_coprime p hcop i) have hv : Ideal.Quotient.mk (Ideal.span {p i}) v* Ideal.Quotient.mk (Ideal.span {p i}) (cofactor p i)=1 := by simpa only [mul_comm] using bezout_inverse_left hbez refine ⟨Units.mkOfMulEqOne _ _ hv,?_,?_⟩ · simpa only [Units.val_mkOfMulEqOne,mul_comm] using hv · exact coordinate_trace_character p hp hcop i u v hbez choose k hki hkψ using hone exact ⟨k,hki,hkψ⟩ noncomputable def productTraceShift {ι : Type*} [Fintype ι] (p : ι→_root_.OAI.ActualEisensteinCubic.O) (hp : ∀i,p i≠0) (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) : ∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ := (exists_product_trace_shifts p hp hcop).choose lemma productTraceShift_inverse {ι : Type*} [Fintype ι] (p : ι→_root_.OAI.ActualEisensteinCubic.O) (hp : ∀i,p i≠0) (hcop : Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (i:ι) : Ideal.Quotient.mk (Ideal.span {p i}) (cofactor p i)* (productTraceShift p hp hcop i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})=1 := (exists_product_trace_shifts p hp hcop).choose_spec.1 i end open ActualEisensteinCubic CubicEisenstein ConcreteTraceCRT IdealGaussCRT end FiniteGaussPhase namespace LocalReflectionBrackets open ActualEisensteinCubic CubicEisenstein IdealGaussCRT CompletedGauss FiniteGaussPhase end LocalReflectionBrackets open scoped Classical BigOperators namespace ShortDraftCusp open ActualEisensteinCubic CubicEisenstein ConcreteTraceCRT def A4PhaseFromResidue (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (v:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {ramifiedTraceLambda^3*c0}) (x:_root_.OAI.ActualEisensteinCubic.O) : ℂ := quotientTrace (ramifiedTraceLambda^3*c0) (A4_bad_modulus_ne_zero c0 hc0) (v*Ideal.Quotient.mk _ x) lemma A4BadPhase_as_fixed_residue (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (d U:_root_.OAI.ActualEisensteinCubic.O) : A4BadPhase c0 hc0 d U= A4PhaseFromResidue c0 hc0 (Ideal.Quotient.mk _ (-d*U)) := by funext x simp only [A4BadPhase,A4PhaseFromResidue,map_mul] end ShortDraftCusp namespace CompletedGauss open ActualEisensteinCubic CubicEisenstein variable (Ψ Φ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (h:∀n:_root_.OAI.ActualEisensteinCubic.O,lambda^2∣n-1→Ψ n=Φ n) include h lemma columnWeight_congr_primary (I:Ideal _root_.OAI.ActualEisensteinCubic.O) : columnWeight Ψ I=columnWeight Φ I := by by_cases hi:primaryGenerator I=0 · simp only [columnWeight,squarefreeGaussCoefficient,hi,ne_eq,not_true_eq_false,and_false, dite_false,zero_mul] · rw [columnWeight,columnWeight,h _ (primaryGenerator_spec I hi).2] lemma cubeWeight_congr_primary (I:Ideal _root_.OAI.ActualEisensteinCubic.O) : cubeWeight Ψ I=cubeWeight Φ I := by change star (FiniteGaussPhase.angularFactor (primaryGenerator I))^3*Ψ (primaryGenerator I)^3/ (Ideal.absNorm I:ℂ)=star (FiniteGaussPhase.angularFactor (primaryGenerator I))^3*Φ (primaryGenerator I)^3/ (Ideal.absNorm I:ℂ) by_cases hi:primaryGenerator I=0 · simp only [hi,FiniteGaussPhase.angularFactor,map_zero,norm_zero,Complex.ofReal_zero, div_zero,star_zero,zero_pow (by decide : (3:ℕ)≠0),zero_mul,zero_div] · rw [h _ (primaryGenerator_spec I hi).2] theorem completedT_congr_primary (W:ℝ→ℂ) (X:ℝ) : completedT Ψ W X=completedT Φ W X := by unfold completedT apply tsum_congr intro I apply tsum_congr intro J rw [summand,summand,columnWeight_congr_primary Ψ Φ h,cubeWeight_congr_primary Ψ Φ h] end CompletedGauss namespace CubicEisenstein open ActualEisensteinCubic end CubicEisenstein open scoped Classical BigOperators namespace ShortDraftCRT open ActualEisensteinCubic FiniteGaussPhase ConcreteTraceCRT variable {ι:Type*} [Fintype ι] def finiteCrossNumerator (a c l:_root_.OAI.ActualEisensteinCubic.O) (p h:ι→_root_.OAI.ActualEisensteinCubic.O) : _root_.OAI.ActualEisensteinCubic.O := a*(∏i,p i)+l^2*c*∑i,h i*cofactor p i lemma prime_dvd_other_cofactor (p:ι→_root_.OAI.ActualEisensteinCubic.O) {i k:ι} (hik:i≠k) : p i∣cofactor p k := by exact Finset.dvd_prod_of_mem p (Finset.mem_erase.mpr ⟨hik,Finset.mem_univ i⟩) lemma finiteCrossNumerator_local (a c l:_root_.OAI.ActualEisensteinCubic.O) (p h:ι→_root_.OAI.ActualEisensteinCubic.O) (i:ι) : Ideal.Quotient.mk (Ideal.span {p i}) (finiteCrossNumerator a c l p h)= Ideal.Quotient.mk (Ideal.span {p i}) (l^2*c*cofactor p i)* Ideal.Quotient.mk (Ideal.span {p i}) (h i) := by let q:=Ideal.Quotient.mk (Ideal.span {p i}) have hz:q (∏k,p k)=0 := by apply Ideal.Quotient.eq_zero_iff_mem.mpr exact Ideal.mem_span_singleton.mpr ⟨cofactor p i, (prime_mul_cofactor p i).symm⟩ have hs:(∑k,q (h k)*q (cofactor p k))=q (h i)*q (cofactor p i) := by apply Finset.sum_eq_single i · intro k hk hki have hk0:q (cofactor p k)=0:=Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr (prime_dvd_other_cofactor p hki.symm)) rw [hk0,mul_zero] · intro hi exact False.elim (hi (Finset.mem_univ i)) change q (finiteCrossNumerator a c l p h)=q (l^2*c*cofactor p i)*q (h i) simp only [finiteCrossNumerator,map_add,map_mul,map_sum,map_pow,hz,mul_zero,zero_add,hs] ring lemma finiteCrossNumerator_fixed (N a c l:_root_.OAI.ActualEisensteinCubic.O) (p h:ι→_root_.OAI.ActualEisensteinCubic.O) (hh:∀i,N∣h i) : N∣finiteCrossNumerator a c l p h-a*(∏i,p i) := by have hs:N∣∑i,h i*cofactor p i:=Finset.dvd_sum (fun i _=>dvd_mul_of_dvd_left (hh i) _) convert dvd_mul_of_dvd_right hs (l^2*c) using 1 ; simp [finiteCrossNumerator] lemma finiteCrossNumerator_fixed_sector {κ:Type*} [Fintype κ] (M a c l:_root_.OAI.ActualEisensteinCubic.O) (p h:ι→_root_.OAI.ActualEisensteinCubic.O) (p0 h0:κ→_root_.OAI.ActualEisensteinCubic.O) (hc:c∣M) (hh:∀i,M^2∣h i) (hh0:∀i,M^2∣h0 i) (hr:M^2∣(∏i,p i)-(∏i,p0 i)) : M*c∣finiteCrossNumerator a c l p h-finiteCrossNumerator a c l p0 h0 := by have hmc:M*c∣M^2:=by simpa only [pow_two] using mul_dvd_mul_left M hc apply hmc.trans have h1:=finiteCrossNumerator_fixed (M^2) a c l p h hh have h0:=finiteCrossNumerator_fixed (M^2) a c l p0 h0 hh0 have h2:=dvd_mul_of_dvd_right hr a convert dvd_sub (dvd_add h1 h2) h0 using 1 ; ring lemma finiteCrossNumerator_coprime (a c l:_root_.OAI.ActualEisensteinCubic.O) (p h:ι→_root_.OAI.ActualEisensteinCubic.O) (hbase:IsCoprime a c) (hpair:Pairwise (Function.onFun IsCoprime p)) (hc:∀i,IsCoprime c (p i)) (hl:∀i,IsCoprime l (p i)) (hh:∀i,IsCoprime (h i) (p i)) : IsCoprime (finiteCrossNumerator a c l p h) (c*∏i,p i) := by have hmodc:c∣finiteCrossNumerator a c l p h-a*(∏i,p i):=by refine ⟨l^2*(∑i,h i*cofactor p i),?_⟩ unfold finiteCrossNumerator ring have hcR:IsCoprime c (∏i,p i):=IsCoprime.prod_right (fun i _=>hc i) have hca:IsCoprime c (finiteCrossNumerator a c l p h):= (CanonicalRowCompletion.isCoprime_congr_mod c _ _ hmodc).mpr (hbase.symm.mul_right hcR) apply hca.symm.mul_right apply IsCoprime.prod_right intro i hi have hcof:IsCoprime (p i) (cofactor p i):= IsCoprime.prod_right (fun k hk=>hpair (Ne.symm (Finset.mem_erase.mp hk).1)) have hterm:IsCoprime (p i) (l^2*c*cofactor p i*h i):= (((hl i).symm.pow_right : IsCoprime (p i) (l^2)).mul_right (hc i).symm).mul_right hcof |>.mul_right (hh i).symm have he:=finiteCrossNumerator_local a c l p h i rw [←map_mul] at he have hd:p i∣finiteCrossNumerator a c l p h-l^2*c*cofactor p i*h i:= Ideal.mem_span_singleton.mp (Ideal.Quotient.eq.mp he) exact ((CanonicalRowCompletion.isCoprime_congr_mod (p i) _ _ hd).mpr hterm).symm end ShortDraftCRT end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.ChineseRemainder.FrequencyLifts namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped Classical BigOperators namespace ShortDraftCRT open ActualEisensteinCubic FiniteGaussPhase ConcreteTraceCRT CubicEisenstein variable {ι:Type*} [Fintype ι] omit [Fintype ι] in theorem exists_strong_unit_frequency_lifts (M:(_root_.OAI.ActualEisensteinCubic.O)) (p:ι→(_root_.OAI.ActualEisensteinCubic.O)) (hM:∀i,IsCoprime M (p i)) (x:∀i,((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i})ˣ) : ∃h:ι→(_root_.OAI.ActualEisensteinCubic.O),(∀i,M^2∣h i) ∧ (∀i,Ideal.Quotient.mk (Ideal.span {p i}) (h i)=(x i:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i})) ∧ ∀i,IsCoprime (h i) (p i) := by have hx (i:ι) := exists_frequency_lift (M^2) (p i) (Quotient.out (x i:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i})) (hM i).pow_left choose h hh hd using hx have he (i:ι):Ideal.Quotient.mk (Ideal.span {p i}) (h i)=(x i:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i}) := by calc _=Ideal.Quotient.mk (Ideal.span {p i}) (Quotient.out (x i:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i})) := Ideal.Quotient.eq.mpr (Ideal.mem_span_singleton.mpr (hd i)) _=x i:=Ideal.Quotient.mk_out _ refine ⟨h,hh,he,?_⟩ intro i apply IsCoprime.symm apply (isUnit_quotient_span_iff (p i) (h i)).mp rw [he] exact (x i).isUnit theorem finiteCrossNumerator_fraction (a c l:(_root_.OAI.ActualEisensteinCubic.O)) (p h:ι→(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) (hp:∀i,p i≠0) : eisEmbedding (finiteCrossNumerator a c l p h)/eisEmbedding (c*∏i,p i)= eisEmbedding a/eisEmbedding c+eisEmbedding l^2* ∑i,eisEmbedding (h i)/eisEmbedding (p i) := by have hR:(∏i,p i)≠0:=Finset.prod_ne_zero_iff.mpr (fun i _=>hp i) have hcC:=eisEmbedding_ne_zero hc have hRC:=eisEmbedding_ne_zero hR have hs:eisEmbedding (∑i,h i*cofactor p i)/eisEmbedding (∏i,p i)= ∑i,eisEmbedding (h i)/eisEmbedding (p i) := by rw [map_sum,Finset.sum_div] apply Finset.sum_congr rfl intro i hi have hpi:=eisEmbedding_ne_zero (hp i) have hr:eisEmbedding (p i)*eisEmbedding (cofactor p i)=eisEmbedding (∏i,p i) := by rw [←map_mul,prime_mul_cofactor] rw [map_mul] apply (div_eq_div_iff hRC hpi).mpr linear_combination eisEmbedding (h i)*hr simp only [finiteCrossNumerator,map_add,map_mul,map_pow] rw [←hs] field_simp [hcC,hRC] end ShortDraftCRT open scoped BigOperators Classical namespace IdealGaussCRT open CubicEisenstein end IdealGaussCRT namespace FiniteGaussPhase open ActualEisensteinCubic CubicEisenstein IdealGaussCRT end FiniteGaussPhase namespace FixedRayActiveSet lemma sum_nonzero_ite {F : Type*} [Field F] [Fintype F] (f:F→ℂ) : (∑x:F,if x≠0 then f x else 0)=∑u:Fˣ,f (u:F) := by calc _ = ∑x∈(Finset.univ:Finset F).filter (fun x=>x≠0),f x := by rw [Finset.sum_filter] _ = ∑x:{x:F//x≠0},f x := by apply Finset.sum_subtype intro x simp _ = _ := (Equiv.sum_comp unitsEquivNeZero (fun x:{x:F//x≠0}=>f x)).symm def activeStratum {ι : Type*} [Fintype ι] (F : ι→Type*) [∀i,Field (F i)] [∀i,Fintype (F i)] (A:Finset ι) : Finset (∀i,F i) := Finset.univ.filter (fun h=>∀i,h i≠0↔i∈A) theorem sum_active_stratum {ι : Type*} [Fintype ι] (F : ι→Type*) [∀i,Field (F i)] [∀i,Fintype (F i)] (A:Finset ι) (f:∀i,F i→ℂ) : (∑h∈activeStratum F A,∏i,f i (h i))= (∏i∈A,∑u:(F i)ˣ,f i (u:F i))* (∏i∈(Finset.univ:Finset ι)\A,f i 0) := by classical let g:=fun i (x:F i)=>if (x≠0↔i∈A) then f i x else 0 have hs : (∑h∈activeStratum F A,∏i,f i (h i))= ∏i,∑x:F i,g i x := by rw [activeStratum,Finset.sum_filter] calc _ = ∑h:∀i,F i,∏i,g i (h i) := by apply Finset.sum_congr rfl intro h hh exact (Fintype.prod_ite_zero (p:=fun i=>h i≠0↔i∈A) (f:=fun i=>f i (h i))).symm _ = _ := (Fintype.prod_sum g).symm have hg (i:ι) : (∑x:F i,g i x)=if i∈A then ∑u:(F i)ˣ,f i (u:F i) else f i 0 := by by_cases hi:i∈A · simpa only [g,hi,iff_true,ite_true] using sum_nonzero_ite (f i) · simp [g,hi] rw [hs] simp only [hg,Finset.prod_ite] have ha : (Finset.univ:Finset ι).filter (fun i=>i∈A)=A := by ext i;simp have hn : (Finset.univ:Finset ι).filter (fun i=>i∉A)=(Finset.univ:Finset ι)\A := by ext i;simp rw [ha,hn] theorem sum_by_active_strata {ι : Type*} [Fintype ι] (F : ι→Type*) [∀i,Field (F i)] [∀i,Fintype (F i)] (weight:(∀i,F i)→ℂ) : (∑h:∀i,F i,weight h)= ∑A∈(Finset.univ:Finset ι).powerset,∑h∈activeStratum F A,weight h := by classical symm simp only [activeStratum,Finset.sum_filter] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro h hh let A:Finset ι:=Finset.univ.filter (fun i=>h i≠0) have he : ∀i,h i≠0↔i∈A := by intro i;simp [A] rw [Finset.sum_eq_single A] · simp only [he,implies_true,ite_true] · intro B hB hBA have hbad : ¬(∀i,h i≠0↔i∈B) := by intro hgood apply hBA ext i simpa only [A,Finset.mem_filter,Finset.mem_univ,true_and] using (hgood i).symm simp only [hbad,ite_false] · intro hnot exact (hnot (Finset.mem_powerset.mpr (Finset.filter_subset _ _))).elim end FixedRayActiveSet namespace LocalReflectionBrackets open ActualEisensteinCubic CubicEisenstein CompletedGauss end LocalReflectionBrackets namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss lemma ramifiedTraceLambda_dvd_of_lambda_dvd (h:(_root_.OAI.ActualEisensteinCubic.O)) (hh:lambda∣h) : ramifiedTraceLambda∣h := by obtain ⟨q,hq⟩:=hh refine ⟨(paperLambdaUnit⁻¹:(_root_.OAI.ActualEisensteinCubic.O)ˣ)*q,?_⟩ change h=paperLambda*((paperLambdaUnit⁻¹:(_root_.OAI.ActualEisensteinCubic.O)ˣ)*q) rw [paperLambda_eq,hq] have hu : (paperLambdaUnit:(_root_.OAI.ActualEisensteinCubic.O))*(paperLambdaUnit⁻¹:(_root_.OAI.ActualEisensteinCubic.O)ˣ)=1 := by simpa only [Units.val_mul,Units.val_one] using congrArg (fun v:(_root_.OAI.ActualEisensteinCubic.O)ˣ=>(v:(_root_.OAI.ActualEisensteinCubic.O))) (mul_inv_cancel paperLambdaUnit) calc _=(paperLambdaUnit:(_root_.OAI.ActualEisensteinCubic.O))*(paperLambdaUnit⁻¹:(_root_.OAI.ActualEisensteinCubic.O)ˣ)*(lambda*q) := by rw [hu,one_mul] _=_ := by ring def paperLambdaQuotient (h:(_root_.OAI.ActualEisensteinCubic.O)) : (_root_.OAI.ActualEisensteinCubic.O) := if hh:ramifiedTraceLambda∣h then hh.choose else 0 lemma paperLambdaQuotient_mul (h:(_root_.OAI.ActualEisensteinCubic.O)) (hh:ramifiedTraceLambda∣h) : ramifiedTraceLambda*paperLambdaQuotient h=h := by simp only [paperLambdaQuotient,dif_pos hh] exact hh.choose_spec.symm lemma sourceCuspCoefficients_ramified_divisibility (j:Fin 3) (hj:j≠0) (h:(_root_.OAI.ActualEisensteinCubic.O)) (hh:(sourceCuspCoefficients j).value h≠0) : ramifiedTraceLambda∣h := by apply ramifiedTraceLambda_dvd_of_lambda_dvd fin_cases j · exact (hj rfl).elim · exact (ramifiedBesselValue_exact_lambda_valuation false h hh).1 · exact (ramifiedBesselValue_exact_lambda_valuation true h hh).1 def sourceCuspPhaseNumerator (j:Fin 3) (u h:(_root_.OAI.ActualEisensteinCubic.O)) : (_root_.OAI.ActualEisensteinCubic.O) := if j=0 then ramifiedTraceLambda*u^2*h else -u^2*paperLambdaQuotient h lemma sourceCuspPhaseNumerator_embedding (j:Fin 3) (u h:(_root_.OAI.ActualEisensteinCubic.O)) (hh:(sourceCuspCoefficients j).value h≠0) : eisEmbedding (sourceCuspPhaseNumerator j u h)= -eisLam^4*cuspFrequency h*(eisEmbedding u)^2/(sourceCuspScale j:ℂ) := by by_cases hj:j=0 · subst j simp only [sourceCuspPhaseNumerator,ite_true,map_mul,map_pow, ramifiedEmbedding_traceLambda,cuspFrequency,sourceCuspScale] norm_num only [Matrix.cons_val_zero,Complex.ofReal_one,div_one] field_simp [eisLam_ne_zero] linear_combination (eisEmbedding h*(eisEmbedding u)^2)*TraceLambdaPhase.eisLam_sq · have hdiv:=sourceCuspCoefficients_ramified_divisibility j hj h hh have hprod:=congrArg eisEmbedding (paperLambdaQuotient_mul h hdiv) have hscale:sourceCuspScale j=3 := by fin_cases j <;> simp_all [sourceCuspScale] have hfour:eisLam^4=(9:ℂ) := by calc eisLam^4=(eisLam^2)^2:=by ring _=9:=by rw [TraceLambdaPhase.eisLam_sq];norm_num rw [sourceCuspPhaseNumerator,if_neg hj] simp only [map_mul,map_neg,map_pow] rw [cuspFrequency,hscale,←hprod,map_mul,ramifiedEmbedding_traceLambda,hfour] norm_num only [Complex.ofReal_ofNat] field_simp [eisLam_ne_zero] ; ring lemma sourceCuspPhaseNumerator_phase (j:Fin 3) (u h c d:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) (hh:(sourceCuspCoefficients j).value h≠0) : ShortDraftTrace.breveE (cuspFrequency h*(eisEmbedding u)^2* (eisEmbedding d/eisEmbedding c)/(sourceCuspScale j:ℂ))= ShortDraftTrace.breveE (-(eisEmbedding d* (eisEmbedding (sourceCuspPhaseNumerator j u h)/eisLam^4))/eisEmbedding c) := by rw [sourceCuspPhaseNumerator_embedding j u h hh] congr 1 field_simp [eisLam_ne_zero,eisEmbedding_ne_zero hc, Complex.ofReal_ne_zero.mpr (sourceCuspScale_pos j).ne'] end CubicEisenstein namespace CanonicalRowCompletion section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve QuadraticAllOddCRT open ConcreteTraceCRT UniqueFactorizationMonoid def cubicTwoSupplement : (_root_.OAI.ActualEisensteinCubic.O)→*ℂ where toFun n:= letI := cubicTwoIdeal_isMaximal (actualSextic cubicTwoIdeal cubicTwoIdeal_good ^ 2) (Ideal.Quotient.mk cubicTwoIdeal n) map_one' := by simp map_mul' x y := by simp only [map_mul] def quadraticTwoSupplement : (_root_.OAI.ActualEisensteinCubic.O)→*ℂ := InitialMeanSquare.normCharacter (ZMod.χ₈.ringHomComp (Int.castRingHom ℂ)) def twoSupplement : (_root_.OAI.ActualEisensteinCubic.O)→*ℂ := cubicTwoSupplement^2*quadraticTwoSupplement lemma cubicTwoSupplement_norm (n:(_root_.OAI.ActualEisensteinCubic.O)) : ‖cubicTwoSupplement n‖≤1 := by letI := cubicTwoIdeal_isMaximal let : Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸cubicTwoIdeal) := ActualEisensteinCubic.quotientFintype cubicTwoIdeal change ‖(actualSextic cubicTwoIdeal cubicTwoIdeal_good ^ 2) (Ideal.Quotient.mk cubicTwoIdeal n)‖≤1 exact FiniteRayExpansion.norm_char_le_one _ _ lemma twoSupplement_norm (n:(_root_.OAI.ActualEisensteinCubic.O)) : ‖twoSupplement n‖≤1 := by change ‖cubicTwoSupplement n^2*quadraticTwoSupplement n‖≤1 rw [norm_mul,norm_pow] apply (mul_le_of_le_one_left (norm_nonneg _) _).trans (InitialMeanSquare.normCharacter_norm_le_one _ n) exact pow_le_one₀ (norm_nonneg _) (cubicTwoSupplement_norm n) lemma cubicTwoSupplement_periodic (x y:(_root_.OAI.ActualEisensteinCubic.O)) (hxy:x-y∈Ideal.span {(8:(_root_.OAI.ActualEisensteinCubic.O))}) : cubicTwoSupplement x=cubicTwoSupplement y := by letI := cubicTwoIdeal_isMaximal have h2:x-y∈cubicTwoIdeal:=by obtain ⟨k,hk⟩:=Ideal.mem_span_singleton.mp hxy apply Ideal.mem_span_singleton.mpr refine ⟨-4*k,?_⟩ change x-y=(-2:(_root_.OAI.ActualEisensteinCubic.O))*(-4*k) rw [hk] ring change (actualSextic cubicTwoIdeal cubicTwoIdeal_good ^ 2) (Ideal.Quotient.mk cubicTwoIdeal x)= (actualSextic cubicTwoIdeal cubicTwoIdeal_good ^ 2) (Ideal.Quotient.mk cubicTwoIdeal y) rw [Ideal.Quotient.eq.mpr h2] lemma twoSupplement_periodic : CanonicalCoefficientClass.FactorsModulo (Ideal.span {(8:(_root_.OAI.ActualEisensteinCubic.O))}) twoSupplement := by intro x y hxy change cubicTwoSupplement x^2*quadraticTwoSupplement x= cubicTwoSupplement y^2*quadraticTwoSupplement y rw [cubicTwoSupplement_periodic x y hxy] congr 1 exact CanonicalCoefficientClass.normCharacter_factorsModulo _ x y hxy lemma idealRowHom_two_prime (p:(_root_.OAI.ActualEisensteinCubic.O)) (hp:Prime p) (hprimary:lambda^2∣p-1) (hs:Supported (Ideal.span {p})) : idealRowHom (2:(_root_.OAI.ActualEisensteinCubic.O)) (Ideal.span {p})=twoSupplement p := by letI := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO letI := cubicTwoIdeal_isMaximal let:(Ideal.span {p}).IsMaximal:=PrincipalIdealRing.isMaximal_of_irreducible hp.irreducible let:Field ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p}):=Ideal.Quotient.field _ let:Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p}):=Fintype.ofFinite _ obtain ⟨hg,hc⟩:=supported_prime_data p hp hs have h2:idealRowHom (2:(_root_.OAI.ActualEisensteinCubic.O)) (Ideal.span {p})^2=cubicTwoSupplement p:=by rw [idealRowHom_prime _ _ hg] have he:=canonicalSextic_four_eq_fixed_two (Ideal.span {p}) hg p rfl hprimary have hfour:Ideal.Quotient.mk (Ideal.span {p}) (4:(_root_.OAI.ActualEisensteinCubic.O))= (Ideal.Quotient.mk (Ideal.span {p}) (2:(_root_.OAI.ActualEisensteinCubic.O)))^2:=by norm_num [map_ofNat] rw [hfour,map_pow] at he change (actualSextic (Ideal.span {p}) hg) (Ideal.Quotient.mk _ 2)^2= (actualSextic cubicTwoIdeal cubicTwoIdeal_good ^ 2) (Ideal.Quotient.mk cubicTwoIdeal p) rw [canonicalSextic_pow_two] exact he have h3:idealRowHom (2:(_root_.OAI.ActualEisensteinCubic.O)) (Ideal.span {p})^3=quadraticTwoSupplement p:=by rw [idealRowHom_prime _ _ hg,←MulChar.pow_apply' _ (by decide : (3:ℕ)≠0),actualSextic_cube_quadratic] change ((quadraticChar ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p}) (Ideal.Quotient.mk _ (2:(_root_.OAI.ActualEisensteinCubic.O))):ℤ):ℂ)=_ simp only [map_ofNat] rw [quadraticChar_two hc] have hn:Ideal.absNorm (Ideal.span {p})=Fintype.card ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p}):=by rw [Ideal.absNorm_apply,Submodule.cardQuot_apply,Nat.card_eq_fintype_card] change ((ZMod.χ₈ (Fintype.card ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p})):ℤ):ℂ)= ((ZMod.χ₈ (Ideal.absNorm (Ideal.span {p})):ℤ):ℂ) rw [hn] have hn2:(2:(_root_.OAI.ActualEisensteinCubic.O))∉Ideal.span {p}:=by intro hz have he: (2:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p})=0:=by simpa only [map_ofNat] using Ideal.Quotient.eq_zero_iff_mem.mpr hz exact Ring.two_ne_zero hc he have h6:idealRowHom (2:(_root_.OAI.ActualEisensteinCubic.O)) (Ideal.span {p})^6=1:=by rw [idealRowHom_prime _ _ hg] have he:=canonicalSextic_sixth_power_mask (Ideal.span {p}) hg (2:(_root_.OAI.ActualEisensteinCubic.O)) change actualSextic _ hg (Ideal.Quotient.mk _ ((2:(_root_.OAI.ActualEisensteinCubic.O))^6))=_ at he simpa only [map_pow,if_neg hn2] using he calc _=idealRowHom (2:(_root_.OAI.ActualEisensteinCubic.O)) (Ideal.span {p})*idealRowHom (2:(_root_.OAI.ActualEisensteinCubic.O)) (Ideal.span {p})^6:=by rw [h6,mul_one] _=idealRowHom (2:(_root_.OAI.ActualEisensteinCubic.O)) (Ideal.span {p})^3*(idealRowHom (2:(_root_.OAI.ActualEisensteinCubic.O)) (Ideal.span {p})^2)^2:=by ring _=twoSupplement p:=by rw [h2,h3] change quadraticTwoSupplement p*cubicTwoSupplement p^2=cubicTwoSupplement p^2*quadraticTwoSupplement p ring theorem idealRowHom_two_formula (n:(_root_.OAI.ActualEisensteinCubic.O)) (hn:lambda^2∣n-1) (hs:Supported (Ideal.span {n})) : idealRowHom (2:(_root_.OAI.ActualEisensteinCubic.O)) (Ideal.span {n})=twoSupplement n := by have hn0:n≠0:=by intro hz;apply hs.1;simp [hz] obtain ⟨s,hprod,hfactors⟩:=exists_primary_prime_factorization n hn0 hn rw [←hprod] at hs ⊢ clear hprod hn hn0 n induction s using Multiset.induction_on with | empty=>simp only [Multiset.prod_zero,Ideal.span_singleton_one,←Ideal.one_eq_top,map_one] | @cons p s ih=> have hp:=hfactors p (Multiset.mem_cons_self _ _) have htail:∀q∈s,Prime q ∧ lambda^2∣q-1:=fun q hq=>hfactors q (Multiset.mem_cons_of_mem hq) have hsplit:Supported (Ideal.span {p}) ∧ Supported (Ideal.span {s.prod}):=by simpa only [Multiset.prod_cons,←Ideal.span_singleton_mul_span_singleton,supported_mul_iff] using hs rw [Multiset.prod_cons,←Ideal.span_singleton_mul_span_singleton,map_mul, idealRowHom_two_prime p hp.1 hp.2 hsplit.1,ih hsplit.2 htail,map_mul] end section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve open UniqueFactorizationMonoid def supportedIdealRow (a:(_root_.OAI.ActualEisensteinCubic.O)) : (_root_.OAI.ActualEisensteinCubic.O)→*ℂ where toFun n:=if Supported (Ideal.span {n}) then idealRowHom a (Ideal.span {n}) else 0 map_one' := by have hs:Supported (1:Ideal (_root_.OAI.ActualEisensteinCubic.O)):=⟨one_ne_zero,by intro P hP rw [normalizedFactors_one] at hP exact False.elim (Multiset.notMem_zero P hP)⟩ rw [show Ideal.span {(1:(_root_.OAI.ActualEisensteinCubic.O))}=(1:Ideal (_root_.OAI.ActualEisensteinCubic.O)) by simp only [Ideal.span_singleton_one,Ideal.one_eq_top], if_pos hs,map_one] map_mul' x y := by rw [←Ideal.span_singleton_mul_span_singleton,supported_mul_iff,map_mul] by_cases hx:Supported (Ideal.span {x}) <;> by_cases hy:Supported (Ideal.span {y}) <;> simp [hx,hy] lemma supportedIdealRow_norm (a n:(_root_.OAI.ActualEisensteinCubic.O)) : ‖supportedIdealRow a n‖≤1 := by change ‖if _ then _ else _‖≤_ split_ifs · exact idealRowHom_norm _ _ · simp lemma exists_supported_primary_unit (x:(_root_.OAI.ActualEisensteinCubic.O)) (hx:Supported (Ideal.span {x})) : ∃u:(_root_.OAI.ActualEisensteinCubic.O)ˣ,lambda^2∣u.val*x-1 := by have hg:=supported_primaryGenerator_ne_zero (Ideal.span {x}) hx have hp:=primaryGenerator_spec (Ideal.span {x}) hg have ha:Associated x (primaryGenerator (Ideal.span {x})):= Ideal.span_singleton_eq_span_singleton.mp hp.1.symm obtain ⟨u,hu⟩:=ha refine ⟨u,?_⟩ have he:u.val*x=primaryGenerator (Ideal.span {x}):=by simpa only [mul_comm] using hu rw [he] exact hp.2 theorem supportedIdealRow_lambda_periodic : CanonicalCoefficientClass.FactorsModulo (Ideal.span {(36:(_root_.OAI.ActualEisensteinCubic.O))}) (supportedIdealRow lambda) := by intro x y hxy have hs:=CanonicalUnitEuler.supported_span_congruent_mod_thirty_six x y hxy change (if Supported (Ideal.span {x}) then _ else 0)= (if Supported (Ideal.span {y}) then _ else 0) by_cases hx:Supported (Ideal.span {x}) · have hy:=hs.mp hx rw [if_pos hx,if_pos hy] obtain ⟨u,hux⟩:=exists_supported_primary_unit x hx have h36:(36:(_root_.OAI.ActualEisensteinCubic.O))∣u.val*x-u.val*y:=by convert dvd_mul_of_dvd_right (Ideal.mem_span_singleton.mp hxy) u.val using 1 ; ring have hl:lambda^2∣u.val*x-u.val*y:= lambda_sq_dvd_three.trans ((show (3:(_root_.OAI.ActualEisensteinCubic.O))∣36 from ⟨12,by norm_num⟩).trans h36) have huy:lambda^2∣u.val*y-1:=by convert dvd_sub hux hl using 1 ; ring have hsp (z:(_root_.OAI.ActualEisensteinCubic.O)) : Ideal.span {u.val*z}=Ideal.span {z}:= Ideal.span_singleton_mul_left_unit u.isUnit z have he:=idealRowHom_lambda_mod_thirty_six (u.val*x) (u.val*y) hux huy (by rwa [hsp]) (by rwa [hsp]) h36 simpa only [hsp] using he · rw [if_neg hx,if_neg (fun hy=>hx (hs.mpr hy))] lemma supportedIdealRow_lambda_primary (n:(_root_.OAI.ActualEisensteinCubic.O)) (hs:Supported (Ideal.span {n})) : supportedIdealRow lambda n=idealRowHom lambda (Ideal.span {n}) := by change (if Supported (Ideal.span {n}) then _ else _)=_ rw [if_pos hs] end section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve lemma negative_two_prime : Prime (-2:(_root_.OAI.ActualEisensteinCubic.O)) := (Ideal.span_singleton_prime (by norm_num : (-2:(_root_.OAI.ActualEisensteinCubic.O))≠0)).mp (show (Ideal.span {(-2:(_root_.OAI.ActualEisensteinCubic.O))}).IsPrime from cubicTwoIdeal_isMaximal.isPrime) theorem exists_supported_numerator_factorization (x:(_root_.OAI.ActualEisensteinCubic.O)) (hx:x≠0) : ∃u:(_root_.OAI.ActualEisensteinCubic.O)ˣ,∃a b:ℕ,∃r:(_root_.OAI.ActualEisensteinCubic.O),Supported (Ideal.span {r}) ∧ lambda^2∣r-1 ∧ x=u.val*lambda^a*(2:(_root_.OAI.ActualEisensteinCubic.O))^b*r := by obtain ⟨n,u,a,hn,hxform⟩:=CubicEisenstein.exists_primary_unit_lambda_factor x hx have hn0:n≠0:=by intro hz exact hx (by rw [hxform,hz,zero_mul]) obtain ⟨r,hr,hrnot⟩:=(FiniteMultiplicity.of_prime_left negative_two_prime hn0).exists_eq_pow_mul_and_not_dvd let b:ℕ:=multiplicity (-2:(_root_.OAI.ActualEisensteinCubic.O)) n change n=(-2:(_root_.OAI.ActualEisensteinCubic.O))^b*r at hr have hp:lambda^2∣(-2:(_root_.OAI.ActualEisensteinCubic.O))^b-1:=neg_two_primary.trans (sub_one_dvd_pow_sub_one (-2:(_root_.OAI.ActualEisensteinCubic.O)) b) have hprimary:lambda^2∣r-1:=by have hh:=dvd_sub hn (dvd_mul_of_dvd_left hp r) have he:n-1-(((-2:(_root_.OAI.ActualEisensteinCubic.O))^b-1)*r)=r-1:=by rw [hr];ring rwa [he] at hh have hnot2:¬(2:(_root_.OAI.ActualEisensteinCubic.O))∣r:=by intro h2 exact hrnot (by simpa only [neg_dvd] using h2) have hnotlambda:¬lambda∣r:=by intro hLam have hsub:lambda∣r-1:=(dvd_pow_self lambda (by decide : (2:ℕ)≠0)).trans hprimary have hone:lambda∣(1:(_root_.OAI.ActualEisensteinCubic.O)):=by convert dvd_sub hLam hsub using 1 ; ring exact PrimaryIdealUnitReindex.lambda_prime_actual.not_isUnit (isUnit_of_dvd_one hone) let v:(_root_.OAI.ActualEisensteinCubic.O)ˣ:=u*(-1:(_root_.OAI.ActualEisensteinCubic.O)ˣ)^b refine ⟨v,a,b,r,(supported_span_iff r).mpr ⟨hnotlambda,hnot2⟩,hprimary,?_⟩ have hp2:(-2:(_root_.OAI.ActualEisensteinCubic.O))^b=(-1:(_root_.OAI.ActualEisensteinCubic.O))^b*(2:(_root_.OAI.ActualEisensteinCubic.O))^b:=by rw [show (-2:(_root_.OAI.ActualEisensteinCubic.O))=(-1)*2 by ring,mul_pow] rw [hxform,hr,hp2] dsimp only [v] simp only [Units.val_mul,Units.val_pow_eq_pow_val,Units.coe_neg_one] ring end open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CanonicalUnitEuler lemma idealRowHom_argument_pow (a:(_root_.OAI.ActualEisensteinCubic.O)) (k:ℕ) (I:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:Supported I) : idealRowHom (a^k) I=(idealRowHom a I)^k := by induction k with | zero => simpa only [pow_zero] using idealRowHom_one_supported I hI | succ k ih => rw [pow_succ,idealRowHom_argument_mul,ih,pow_succ] def reciprocityPhaseMonoid (r:(_root_.OAI.ActualEisensteinCubic.O)) (hr:Supported (Ideal.span {r})) : (_root_.OAI.ActualEisensteinCubic.O)→*ℂ where toFun n:=sexticReciprocityPhase r n map_one' := sexticReciprocityPhase_one_right r hr map_mul' := sexticReciprocityPhase_mul_right r def numeratorBadTwist (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (a b:ℕ) (r:(_root_.OAI.ActualEisensteinCubic.O)) (hr:Supported (Ideal.span {r})) : (_root_.OAI.ActualEisensteinCubic.O)→*ℂ := unitSupplement u * supportedIdealRow lambda^a * twoSupplement^b * reciprocityPhaseMonoid r hr lemma numeratorBadTwist_norm (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (a b:ℕ) (r:(_root_.OAI.ActualEisensteinCubic.O)) (hr:Supported (Ideal.span {r})) (n:(_root_.OAI.ActualEisensteinCubic.O)) : ‖numeratorBadTwist u a b r hr n‖≤1 := by change ‖((unitSupplement u n * (supportedIdealRow lambda n)^a) * (twoSupplement n)^b) * sexticReciprocityPhase r n‖≤1 simp only [norm_mul,norm_pow] have hu:=unitSupplement_norm u n have ha:‖supportedIdealRow lambda n‖^a≤1:= pow_le_one₀ (norm_nonneg _) (supportedIdealRow_norm lambda n) have hb:‖twoSupplement n‖^b≤1:= pow_le_one₀ (norm_nonneg _) (twoSupplement_norm n) have hrn:=sexticReciprocityPhase_norm r n exact (mul_le_of_le_one_left (norm_nonneg _) ((mul_le_of_le_one_left (pow_nonneg (norm_nonneg _) _) ((mul_le_of_le_one_left (pow_nonneg (norm_nonneg _) _) hu).trans ha)).trans hb)).trans hrn lemma numeratorBadTwist_periodic (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (a b:ℕ) (r:(_root_.OAI.ActualEisensteinCubic.O)) (hr:Supported (Ideal.span {r})) : CanonicalCoefficientClass.FactorsModulo (Ideal.span {(72:(_root_.OAI.ActualEisensteinCubic.O))}) (numeratorBadTwist u a b r hr) := by intro x y hxy have h72:(72:(_root_.OAI.ActualEisensteinCubic.O))∣x-y:=Ideal.mem_span_singleton.mp hxy have h36:x-y∈(Ideal.span {(36:(_root_.OAI.ActualEisensteinCubic.O))}:Ideal (_root_.OAI.ActualEisensteinCubic.O)):= Ideal.mem_span_singleton.mpr ((show (36:(_root_.OAI.ActualEisensteinCubic.O))∣72 from ⟨2,by norm_num⟩).trans h72) have h8:x-y∈(Ideal.span {(8:(_root_.OAI.ActualEisensteinCubic.O))}:Ideal (_root_.OAI.ActualEisensteinCubic.O)):= Ideal.mem_span_singleton.mpr ((show (8:(_root_.OAI.ActualEisensteinCubic.O))∣72 from ⟨9,by norm_num⟩).trans h72) have h4:(4:(_root_.OAI.ActualEisensteinCubic.O))∣x-y:=(show (4:(_root_.OAI.ActualEisensteinCubic.O))∣72 from ⟨18,by norm_num⟩).trans h72 change ((unitSupplement u x * (supportedIdealRow lambda x)^a) * (twoSupplement x)^b) * sexticReciprocityPhase r x = ((unitSupplement u y * (supportedIdealRow lambda y)^a) * (twoSupplement y)^b) * sexticReciprocityPhase r y rw [unitSupplement_periodic u x y h36,supportedIdealRow_lambda_periodic x y h36, twoSupplement_periodic x y h8,sexticReciprocityPhase_congr_right r x y h4] def movingNumeratorRow (r:(_root_.OAI.ActualEisensteinCubic.O)) (hr:Supported (Ideal.span {r})) : (_root_.OAI.ActualEisensteinCubic.O)→*ℂ where toFun n:=idealRowHom n (Ideal.span {r}) map_one' := idealRowHom_one_supported _ hr map_mul' a b := idealRowHom_argument_mul a b _ theorem idealRowHom_factor_numerator (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (a b:ℕ) (r n:(_root_.OAI.ActualEisensteinCubic.O)) (hr:Supported (Ideal.span {r})) (hpr:lambda^2∣r-1) (hn:Supported (Ideal.span {n})) (hpn:lambda^2∣n-1) : idealRowHom (u.val*lambda^a*(2:(_root_.OAI.ActualEisensteinCubic.O))^b*r) (Ideal.span {n})= numeratorBadTwist u a b r hr n * movingNumeratorRow r hr n := by have hu:unitSupplement u n=idealRowHom u.val (Ideal.span {n}):=by change (if Supported (Ideal.span {n}) then _ else 0)=_ rw [if_pos hn] have hrec:=reciprocalRow_eq_idealRowHom r n hr hn hpr hpn change sexticReciprocityPhase r n*idealRowHom n (Ideal.span {r})= idealRowHom r (Ideal.span {n}) at hrec change _=(((unitSupplement u n * (supportedIdealRow lambda n)^a) * (twoSupplement n)^b) * sexticReciprocityPhase r n)*idealRowHom n (Ideal.span {r}) rw [idealRowHom_argument_mul,idealRowHom_argument_mul,idealRowHom_argument_mul, idealRowHom_argument_pow _ _ _ hn,idealRowHom_argument_pow _ _ _ hn, hu,supportedIdealRow_lambda_primary n hn,←idealRowHom_two_formula n hpn hn,←hrec] ring end CanonicalRowCompletion end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.PeriodicRows namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CanonicalRowCompletion open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CanonicalUnitEuler lemma numeratorBadTwist_zero_of_not_supported (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (a b:ℕ) (r:_root_.OAI.ActualEisensteinCubic.O) (hr:Supported (Ideal.span {r})) (n:_root_.OAI.ActualEisensteinCubic.O) (hn:¬Supported (Ideal.span {n})) : numeratorBadTwist u a b r hr n=0 := by have hu:unitSupplement u n=0:=by change (if Supported (Ideal.span {n}) then _ else 0)=0 rw [if_neg hn] change ((unitSupplement u n * (supportedIdealRow lambda n)^a) * (twoSupplement n)^b) * sexticReciprocityPhase r n=0 rw [hu,zero_mul,zero_mul,zero_mul] lemma rowTwist_zero_of_not_supported (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (m f z n:_root_.OAI.ActualEisensteinCubic.O) (hmLam:lambda∣m) (hm2:(2:_root_.OAI.ActualEisensteinCubic.O)∣m) (hn:¬Supported (Ideal.span {n})) : rowTwist Ψ m f z n=0 := by have hu:unitSupplement (1:_root_.OAI.ActualEisensteinCubic.Oˣ) n=0:=by change (if Supported (Ideal.span {n}) then _ else 0)=0 rw [if_neg hn] have h:=congrArg (fun T:_root_.OAI.ActualEisensteinCubic.O→*ℂ=>T n) (rowTwist_unitSupplement Ψ m f z (1:_root_.OAI.ActualEisensteinCubic.Oˣ) hmLam hm2) change rowTwist Ψ m f ((1:_root_.OAI.ActualEisensteinCubic.Oˣ).val*z) n=unitSupplement (1:_root_.OAI.ActualEisensteinCubic.Oˣ) n*rowTwist Ψ m f z n at h simpa only [Units.val_one,one_mul,hu,zero_mul] using h def actualPeriodicRow (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (m:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (a b:ℕ) (r:_root_.OAI.ActualEisensteinCubic.O) (hr:Supported (Ideal.span {r})) : _root_.OAI.ActualEisensteinCubic.O→*ℂ := Ψ * coprimalityMask m * numeratorBadTwist u a b r hr * movingNumeratorRow r hr theorem rowTwist_eq_actualPeriodicRow_primary (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (m f z:_root_.OAI.ActualEisensteinCubic.O) (hmLam:lambda∣m) (hm2:(2:_root_.OAI.ActualEisensteinCubic.O)∣m) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (a b:ℕ) (r:_root_.OAI.ActualEisensteinCubic.O) (hr:Supported (Ideal.span {r})) (hpr:lambda^2∣r-1) (hx:f^4*z=u.val*lambda^a*(2:_root_.OAI.ActualEisensteinCubic.O)^b*r) (n:_root_.OAI.ActualEisensteinCubic.O) (hpn:lambda^2∣n-1) : rowTwist Ψ m f z n=actualPeriodicRow Ψ m u a b r hr n := by by_cases hn:Supported (Ideal.span {n}) · rw [rowTwist_extract_sixth_mask Ψ m f z n hn,hx, idealRowHom_factor_numerator u a b r n hr hpr hn hpn] change _=((Ψ n*coprimalityMask m n)*numeratorBadTwist u a b r hr n)*movingNumeratorRow r hr n ring · rw [rowTwist_zero_of_not_supported Ψ m f z n hmLam hm2 hn] change 0=((Ψ n*coprimalityMask m n)*numeratorBadTwist u a b r hr n)*movingNumeratorRow r hr n rw [numeratorBadTwist_zero_of_not_supported u a b r hr n hn,mul_zero,zero_mul] end CanonicalRowCompletion namespace CompletedGauss section open ActualEisensteinCubic IdealMobiusDivisorSum UniqueFactorizationMonoid def completedReflectionPool (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) : Finset (Ideal _root_.OAI.ActualEisensteinCubic.O) := (primeSupport (I*Q)).filter (fun P=>lambda∉P ∧ ringChar (_root_.OAI.ActualEisensteinCubic.O⧸P)≠2 ∧ ¬P∣rowResidualPart I Q) lemma mem_completedReflectionPool (I Q P:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I≠0) (hQ:Q≠0) : P∈completedReflectionPool I Q ↔ Prime P ∧ P∣I*Q ∧ lambda∉P ∧ ringChar (_root_.OAI.ActualEisensteinCubic.O⧸P)≠2 ∧ ¬P∣rowResidualPart I Q := by simp only [completedReflectionPool,Finset.mem_filter,primeSupport,Multiset.mem_toFinset, UniqueFactorizationMonoid.mem_normalizedFactors_iff (mul_ne_zero hI hQ)] aesop lemma completedReflectionPool_maximal (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (P:completedReflectionPool I Q) : P.val.IsMaximal := by have hm: P.val∈normalizedFactors (I*Q):= Multiset.mem_toFinset.mp (Finset.mem_filter.mp P.property).1 have hp:=prime_of_normalized_factor P.val hm exact (Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero lemma completedReflectionPool_good (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (P:completedReflectionPool I Q) : lambda∉P.val := (Finset.mem_filter.mp P.property).2.1 lemma completedReflectionPool_odd (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (P:completedReflectionPool I Q) : ringChar (_root_.OAI.ActualEisensteinCubic.O⧸P.val)≠2 := (Finset.mem_filter.mp P.property).2.2.1 lemma completedReflectionPool_nonresidual (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (P:completedReflectionPool I Q) : ¬P.val∣rowResidualPart I Q := (Finset.mem_filter.mp P.property).2.2.2 lemma completedReflectionPool_divides (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I≠0) (hQ:Q≠0) (P:completedReflectionPool I Q) : P.val∣I*Q := ((mem_completedReflectionPool I Q P.val hI hQ).mp P.property).2.1 theorem completedReflectionPool_eq_on_fiber (I J Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I≠0) (hJ:J≠0) (hQ:Q≠0) (hA:rowPowerfulPart I=rowPowerfulPart J) (hT:rowMaskPart I Q=rowMaskPart J Q) : completedReflectionPool I Q=completedReflectionPool J Q := by ext P rw [mem_completedReflectionPool I Q P hI hQ,mem_completedReflectionPool J Q P hJ hQ] constructor · rintro ⟨hP,hdiv,hgood,hodd,hres⟩ obtain ⟨hdivJ,hresJ,_⟩:=nonresidual_prime_transport I J 1 Q P hI hJ hP hA hT hdiv hres exact ⟨hP,hdivJ,hgood,hodd,hresJ⟩ · rintro ⟨hP,hdiv,hgood,hodd,hres⟩ obtain ⟨hdivI,hresI,_⟩:=nonresidual_prime_transport J I 1 Q P hJ hI hP hA.symm hT.symm hdiv hres exact ⟨hP,hdivI,hgood,hodd,hresI⟩ lemma completedReflectionPool_exponent_eq (I J F Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I≠0) (hJ:J≠0) (hQ:Q≠0) (hA:rowPowerfulPart I=rowPowerfulPart J) (hT:rowMaskPart I Q=rowMaskPart J Q) (P:completedReflectionPool I Q) : completedLocalExponent I F P.val=completedLocalExponent J F P.val := by rcases (mem_completedReflectionPool I Q P.val hI hQ).mp P.property with ⟨hP,hdiv,_,_,hres⟩ exact (nonresidual_prime_transport I J F Q P.val hI hJ hP hA hT hdiv hres).2.2 end section def reflectionSixActive (e:Fin 6) : Prop := 3≤e.val def reflectionSixLabel (e:Fin 6) : Fin 3 := ⟨e.val%3,Nat.mod_lt _ (by decide)⟩ def reflectionSixValid {ι:Type*} (e:ι→Fin 6) : Prop := ∀i,e i=0 ∨ reflectionSixActive (e i) variable {ι:Type*} [Fintype ι] [DecidableEq ι] def encodeReflectionSix (x:ΣA:Finset ι,A→Fin 3) : ι→Fin 6 := fun i=> if h:i∈x.1 then ⟨3+(x.2 ⟨i,h⟩).val,by have ht:=(x.2 ⟨i,h⟩).isLt; omega⟩ else 0 def reflectionSixSupport (e:ι→Fin 6) : Finset ι := Finset.univ.filter (fun i=>reflectionSixActive (e i)) def decodeReflectionSix (e:ι→Fin 6) : ΣA:Finset ι,A→Fin 3 := ⟨reflectionSixSupport e,fun i=>reflectionSixLabel (e i.val)⟩ omit [Fintype ι] in lemma reflectionSixActive_encode (x:ΣA:Finset ι,A→Fin 3) (i:ι) : reflectionSixActive (encodeReflectionSix x i) ↔ i∈x.1 := by by_cases hi:i∈x.1 · simp [encodeReflectionSix,hi,reflectionSixActive] · simp [encodeReflectionSix,hi,reflectionSixActive] omit [Fintype ι] in lemma encodeReflectionSix_valid (x:ΣA:Finset ι,A→Fin 3) : reflectionSixValid (encodeReflectionSix x) := by intro i by_cases hi:i∈x.1 · exact Or.inr ((reflectionSixActive_encode x i).mpr hi) · left simp [encodeReflectionSix,hi] lemma reflectionSixSupport_encode (x:ΣA:Finset ι,A→Fin 3) : reflectionSixSupport (encodeReflectionSix x)=x.1 := by ext i simp only [reflectionSixSupport,Finset.mem_filter,Finset.mem_univ,true_and, reflectionSixActive_encode] lemma encodeReflectionSix_injective : Function.Injective (encodeReflectionSix (ι:=ι)) := by intro x y hxy have hsets:x.1=y.1:=by rw [←reflectionSixSupport_encode x,←reflectionSixSupport_encode y,hxy] rcases x with ⟨A,e⟩ rcases y with ⟨B,f⟩ dsimp only at hsets subst B congr 1 funext i have he:=congrFun hxy i.val simp only [encodeReflectionSix,dif_pos i.property] at he apply Fin.ext have hv:=congrArg Fin.val he exact Nat.add_left_cancel hv lemma encode_decodeReflectionSix (e:ι→Fin 6) (he:reflectionSixValid e) : encodeReflectionSix (decodeReflectionSix e)=e := by funext i by_cases hi:reflectionSixActive (e i) · have him:i∈reflectionSixSupport e:=by simp [reflectionSixSupport,hi] dsimp only [encodeReflectionSix, decodeReflectionSix] rw [dif_pos him] apply Fin.ext change 3 + (e i).val % 3 = (e i).val have hl:=(e i).isLt dsimp only [reflectionSixActive] at hi omega · have him:i∉reflectionSixSupport e:=by simp [reflectionSixSupport,hi] have hz:e i=0:=(he i).resolve_right hi simp [encodeReflectionSix,decodeReflectionSix,him,hz] lemma decode_encodeReflectionSix (x:ΣA:Finset ι,A→Fin 3) : decodeReflectionSix (encodeReflectionSix x)=x := encodeReflectionSix_injective (encode_decodeReflectionSix _ (encodeReflectionSix_valid x)) def reflectionSixEquiv : (ΣA:Finset ι,A→Fin 3) ≃ {e:ι→Fin 6 // reflectionSixValid e} where toFun x:=⟨encodeReflectionSix x,encodeReflectionSix_valid x⟩ invFun e:=decodeReflectionSix e.val left_inv:=decode_encodeReflectionSix right_inv e:=Subtype.ext (encode_decodeReflectionSix e.val e.property) theorem sum_active_exceptional_eq_six {V:Type*} [AddCommMonoid V] (F:∀A:Finset ι,(A→Fin 3)→V) : (∑A:Finset ι,∑e:A→Fin 3,F A e)= ∑e:ι→Fin 6,if reflectionSixValid e then F (decodeReflectionSix e).1 (decodeReflectionSix e).2 else 0 := by have he:=Equiv.sum_comp (reflectionSixEquiv (ι:=ι)) (fun e:{e:ι→Fin 6 // reflectionSixValid e}=> F (decodeReflectionSix e.val).1 (decodeReflectionSix e.val).2) have hs:(∑x:ΣA:Finset ι,A→Fin 3,F x.1 x.2)= ∑e:{e:ι→Fin 6 // reflectionSixValid e},F (decodeReflectionSix e.val).1 (decodeReflectionSix e.val).2 := by calc _=∑x:ΣA:Finset ι,A→Fin 3, F (decodeReflectionSix (encodeReflectionSix x)).1 (decodeReflectionSix (encodeReflectionSix x)).2 := by apply Finset.sum_congr rfl intro x _ exact (congrArg (fun y:ΣA:Finset ι,A→Fin 3=>F y.1 y.2) (decode_encodeReflectionSix x)).symm _=_ := he rw [Fintype.sum_sigma] at hs rw [hs,←Finset.sum_filter] exact (Finset.sum_subtype (Finset.univ.filter reflectionSixValid) (by simp) (fun e:ι→Fin 6=>F (decodeReflectionSix e).1 (decodeReflectionSix e).2)).symm end section open ActualEisensteinCubic LocalReflectionBrackets variable {ι:Type*} [Fintype ι] [DecidableEq ι] end section open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve CompletedDyadic def reflectionChoiceValue (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (e:completedReflectionPool I Q→Fin 6) (P:Ideal _root_.OAI.ActualEisensteinCubic.O) : Fin 6 := if h:P∈completedReflectionPool I Q then e ⟨P,h⟩ else 0 def reflectionActivePool (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (e:completedReflectionPool I Q→Fin 6) : Finset (Ideal _root_.OAI.ActualEisensteinCubic.O) := (completedReflectionPool I Q).filter (fun P=>reflectionSixActive (reflectionChoiceValue I Q e P)) lemma reflectionActivePool_subset (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (e:completedReflectionPool I Q→Fin 6) : reflectionActivePool I Q e⊆completedReflectionPool I Q := Finset.filter_subset _ _ lemma mem_reflectionActivePool (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (e:completedReflectionPool I Q→Fin 6) (P:completedReflectionPool I Q) : P.val∈reflectionActivePool I Q e ↔ reflectionSixActive (e P) := by rw [reflectionActivePool, Finset.mem_filter] simp only [P.property, true_and] rw [reflectionChoiceValue, dif_pos P.property] def reflectionActiveLabel (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (e:completedReflectionPool I Q→Fin 6) (P:reflectionActivePool I Q e) : Fin 3 := reflectionSixLabel (e ⟨P.val,reflectionActivePool_subset I Q e P.property⟩) def sixReflectedBranch (I F Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I≠0) (hQ:Q≠0) (K levelBound levelScale:ℝ) (hlevel:0completedReflectionPool_maximal I Q ⟨P.val,reflectionActivePool_subset I Q e P.property⟩ good:=fun P=>completedReflectionPool_good I Q ⟨P.val,reflectionActivePool_subset I Q e P.property⟩ coprime:=by intro P R hPR let : P.val.IsMaximal:=completedReflectionPool_maximal I Q ⟨P.val,reflectionActivePool_subset I Q e P.property⟩ let : R.val.IsMaximal:=completedReflectionPool_maximal I Q ⟨R.val,reflectionActivePool_subset I Q e R.property⟩ exact Ideal.isCoprime_of_isMaximal (Subtype.val_injective.ne hPR) divides:=fun P=>completedReflectionPool_divides I Q hI hQ ⟨P.val,reflectionActivePool_subset I Q e P.property⟩ nonresidual:=fun P=>completedReflectionPool_nonresidual I Q ⟨P.val,reflectionActivePool_subset I Q e P.property⟩ label:=reflectionActiveLabel I Q e nColumns:=fun i=>dualIdealDyad i.2.2 bColumns:=fun i=>dualIdealDyad i.2.1 nBounds:=fun i n hn=>dualIdealDyad_bounds i.2.2 n hn bBounds:=fun i b hb=>dualIdealDyad_bounds i.2.1 b hb amplitude:=fun i=>amplitude i.1 amplitude_bound:=fun i n _ b _=>hamp i.1 n b rowPhase:=fun i=>rowPhase i.1 rowPhase_bound:=fun i k=>hrow i.1 k end open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve LocalReflectionBrackets theorem poolMaximal (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (P:completedReflectionPool I Q) : P.val.IsMaximal := completedReflectionPool_maximal I Q P noncomputable abbrev poolField (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (P:completedReflectionPool I Q) : Field (_root_.OAI.ActualEisensteinCubic.O⧸P.val) := let _ : P.val.IsMaximal := poolMaximal I Q P Ideal.Quotient.field P.val noncomputable abbrev poolFintype (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (P:completedReflectionPool I Q) : Fintype (_root_.OAI.ActualEisensteinCubic.O⧸P.val) := let _ : P.val.IsMaximal := poolMaximal I Q P Fintype.ofFinite _ def reflectionInactiveStratumWeight (I F Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (A:Finset (completedReflectionPool I Q)) : ℂ := letI poolFieldInst := @poolField I Q letI poolFintypeInst := @poolFintype I Q let _ : ∀ P : completedReflectionPool I Q, P.val.IsMaximal := poolMaximal I Q ∏P∈(Finset.univ:Finset (completedReflectionPool I Q))\A, zeroFourierCoefficient (actualSextic P.val (completedReflectionPool_good I Q P)) (completedLocalExponent I F P.val) lemma reflectionInactiveStratumWeight_norm_le_one (I F Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (A:Finset (completedReflectionPool I Q)) : ‖reflectionInactiveStratumWeight I F Q A‖≤1 := by letI poolFieldInst := @poolField I Q letI poolFintypeInst := @poolFintype I Q let _ : ∀ P : completedReflectionPool I Q, P.val.IsMaximal := poolMaximal I Q rw [reflectionInactiveStratumWeight,norm_prod] apply Finset.prod_le_one₀ (fun _ _=>norm_nonneg _) intro P _ by_cases hj:completedLocalExponent I F P.val=0 · rw [hj] exact zeroFourierCoefficient_zero_norm_le_one _ · have he:=canonical_zeroFourierCoefficient P.val (completedReflectionPool_good I Q P) (completedReflectionPool_odd I Q P) (completedLocalExponent I F P.val) (Nat.mod_lt _ (by decide : 0<6)) have hz:zeroFourierCoefficient (actualSextic P.val (completedReflectionPool_good I Q P)) (completedLocalExponent I F P.val)=0 := by simpa only [actualSextic,if_neg hj] using he rw [hz] simp def reflectionSixInactiveWeight (I F Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (e:completedReflectionPool I Q→Fin 6) : ℂ := if reflectionSixValid e then reflectionInactiveStratumWeight I F Q (reflectionSixSupport e) else 0 lemma reflectionSixInactiveWeight_norm_le_one (I F Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (e:completedReflectionPool I Q→Fin 6) : ‖reflectionSixInactiveWeight I F Q e‖≤1 := by unfold reflectionSixInactiveWeight split_ifs · exact reflectionInactiveStratumWeight_norm_le_one I F Q _ · simp lemma sum_reflectionSixInactiveWeight_unpad (I F Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (G:(completedReflectionPool I Q→Fin 6)→ℂ) : (∑e:completedReflectionPool I Q→Fin 6,reflectionSixInactiveWeight I F Q e*G e)= ∑A:Finset (completedReflectionPool I Q),∑e:A→Fin 3, reflectionInactiveStratumWeight I F Q A*G (encodeReflectionSix ⟨A,e⟩) := by rw [sum_active_exceptional_eq_six] apply Finset.sum_congr rfl intro e _ by_cases he:reflectionSixValid e · rw [if_pos he,encode_decodeReflectionSix e he] simp only [reflectionSixInactiveWeight,if_pos he,decodeReflectionSix] · simp only [if_neg he,reflectionSixInactiveWeight,zero_mul] abbrev SixReflectionIndex (rays:ℕ) (I Q:Ideal _root_.OAI.ActualEisensteinCubic.O) := Fin rays×(completedReflectionPool I Q→Fin 6) end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.ReflectionPool namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CompletedGauss open ActualEisensteinCubic LocalReflectionBrackets end CompletedGauss namespace CanonicalRowCompletion section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid lemma actualSextic_sixth_one (P:Ideal ActualEisensteinCubic.O) [P.IsMaximal] (hg:lambda∉P) : actualSextic P hg^6=1 := by apply MulChar.ext intro t obtain ⟨n,hn⟩:=Ideal.Quotient.mk_surjective (t:ActualEisensteinCubic.O⧸P) have hnot:n∉P:=by intro hm have ht:(t:ActualEisensteinCubic.O⧸P)=0:=by rw [←hn];exact Ideal.Quotient.eq_zero_iff_mem.mpr hm exact t.ne_zero ht have h:=canonicalSextic_sixth_power_mask P hg n change actualSextic P hg (Ideal.Quotient.mk P (n^6))=_ at h rw [map_pow,map_pow,if_neg hnot] at h rw [MulChar.pow_apply_coe,MulChar.one_apply_coe,←hn] exact h lemma actualSextic_power_mod_six (P:Ideal ActualEisensteinCubic.O) [P.IsMaximal] (hg:lambda∉P) (k:ℕ) (hk:k≠0) (n:ActualEisensteinCubic.O) : actualSextic P hg (Ideal.Quotient.mk P n)^k= (actualSextic P hg^(k%6)) (Ideal.Quotient.mk P n) := by rw [←MulChar.pow_apply' _ hk,pow_eq_pow_mod _ (actualSextic_sixth_one P hg)] lemma idealRowHom_eq_prime_count_product (I:Ideal ActualEisensteinCubic.O) (hI:Supported I) (n:ActualEisensteinCubic.O) : letI (P : PrimeIndex I) : P.val.IsMaximal := primeIndexMaximal I P idealRowHom n I=∏P:PrimeIndex I, (actualSextic P.val ((supported_factors_good I hI P.val (Multiset.mem_toFinset.mp P.property)).2.1) ^ ((normalizedFactors I).count P.val%6)) (Ideal.Quotient.mk P.val n) := by letI (P : PrimeIndex I) : P.val.IsMaximal := primeIndexMaximal I P have he:I=∏P:PrimeIndex I,P.val^((normalizedFactors I).count P.val):=by change I=∏P:(normalizedFactors I).toFinset,P.val^((normalizedFactors I).count P.val) exact ((Ideal.prod_normalizedFactors_eq_self hI.1).symm.trans (Finset.prod_multiset_count _)).trans (Finset.prod_coe_sort (normalizedFactors I).toFinset (fun P=>P^((normalizedFactors I).count P))).symm calc idealRowHom n I = idealRowHom n (∏P:PrimeIndex I,P.val^((normalizedFactors I).count P.val)) := congrArg (idealRowHom n) he _ = ∏P:PrimeIndex I,idealRowHom n P.val ^ ((normalizedFactors I).count P.val) := by simp only [map_prod,map_pow] _ = _ := by apply Finset.prod_congr rfl intro P hP rw [idealRowHom_prime n P.val ((supported_factors_good I hI P.val (Multiset.mem_toFinset.mp P.property)).2.1)] exact actualSextic_power_mod_six P.val _ _ (Nat.ne_of_gt (Multiset.count_pos.mpr (Multiset.mem_toFinset.mp P.property))) n end open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CanonicalUnitEuler lemma coprimalityMask_good_part (u:ActualEisensteinCubic.Oˣ) (a b:ℕ) (r n:ActualEisensteinCubic.O) (hn:Supported (Ideal.span {n})) : coprimalityMask (u.val*lambda^a*(2:ActualEisensteinCubic.O)^b*r) n=coprimalityMask r n := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO have hl:IsCoprime lambda n:= PrimaryIdealUnitReindex.lambda_prime_actual.irreducible.coprime_iff_not_dvd.mpr ((supported_span_iff n).mp hn).1 have hneg2:IsCoprime (-2:ActualEisensteinCubic.O) n:=negative_two_prime.irreducible.coprime_iff_not_dvd.mpr (by simpa only [neg_dvd] using ((supported_span_iff n).mp hn).2) have h2:IsCoprime (2:ActualEisensteinCubic.O) n:=hneg2.of_isCoprime_of_dvd_left ⟨-1,by ring⟩ have hu:IsCoprime u.val n:=⟨(u⁻¹).val,0,by simp⟩ have hla:IsCoprime (lambda^a) n:=hl.pow_left have h2b:IsCoprime ((2:ActualEisensteinCubic.O)^b) n:=h2.pow_left change (if IsCoprime (u.val*lambda^a*(2:ActualEisensteinCubic.O)^b*r) n then (1:ℂ) else 0)=_ rw [IsCoprime.mul_left_iff,IsCoprime.mul_left_iff,IsCoprime.mul_left_iff] simp only [hu,hla,h2b,true_and] rfl lemma idealRowHom_sixth_denominator_mask (r n:ActualEisensteinCubic.O) (hr:Supported (Ideal.span {r})) : idealRowHom n ((Ideal.span {r})^6)=coprimalityMask r n := by rw [map_pow,←idealRowHom_argument_pow n 6 _ hr,idealRowHom_sixth_eq_mask n r hr] change (if IsCoprime n r then (1:ℂ) else 0)=(if IsCoprime r n then 1 else 0) rw [isCoprime_comm] lemma mask_times_good_row (m:ActualEisensteinCubic.O) (um:ActualEisensteinCubic.Oˣ) (am bm:ℕ) (g r n:ActualEisensteinCubic.O) (hg:Supported (Ideal.span {g})) (hm:m=um.val*lambda^am*(2:ActualEisensteinCubic.O)^bm*g) (hn:Supported (Ideal.span {n})) : coprimalityMask m n*idealRowHom n (Ideal.span {r})= idealRowHom n ((Ideal.span {g})^6*Ideal.span {r}) := by rw [hm,coprimalityMask_good_part um am bm g n hn,map_mul, idealRowHom_sixth_denominator_mask g n hg] theorem rowTwist_eq_fixed_times_good_row_primary (Ψ:ActualEisensteinCubic.O→*ℂ) (m f z:ActualEisensteinCubic.O) (hmLam:lambda∣m) (hm2:(2:ActualEisensteinCubic.O)∣m) (um:ActualEisensteinCubic.Oˣ) (am bm:ℕ) (g:ActualEisensteinCubic.O) (hg:Supported (Ideal.span {g})) (hm:m=um.val*lambda^am*(2:ActualEisensteinCubic.O)^bm*g) (u:ActualEisensteinCubic.Oˣ) (a b:ℕ) (r:ActualEisensteinCubic.O) (hr:Supported (Ideal.span {r})) (hpr:lambda^2∣r-1) (hx:f^4*z=u.val*lambda^a*(2:ActualEisensteinCubic.O)^b*r) (n:ActualEisensteinCubic.O) (hpn:lambda^2∣n-1) : rowTwist Ψ m f z n=(Ψ*numeratorBadTwist u a b r hr) n * idealRowHom n ((Ideal.span {g})^6*Ideal.span {r}) := by rw [rowTwist_eq_actualPeriodicRow_primary Ψ m f z hmLam hm2 u a b r hr hpr hx n hpn] by_cases hn:Supported (Ideal.span {n}) · change ((Ψ n*coprimalityMask m n)*numeratorBadTwist u a b r hr n)*idealRowHom n (Ideal.span {r})= (Ψ n*numeratorBadTwist u a b r hr n)*_ rw [show ((Ψ n*coprimalityMask m n)*numeratorBadTwist u a b r hr n)*idealRowHom n (Ideal.span {r})= (Ψ n*numeratorBadTwist u a b r hr n)*(coprimalityMask m n*idealRowHom n (Ideal.span {r})) by ring, mask_times_good_row m um am bm g r n hg hm hn] · change ((Ψ n*coprimalityMask m n)*numeratorBadTwist u a b r hr n)*_= (Ψ n*numeratorBadTwist u a b r hr n)*_ rw [numeratorBadTwist_zero_of_not_supported u a b r hr n hn] simp only [mul_zero,zero_mul] lemma fixedNumeratorTwist_periodic (Ψ:ActualEisensteinCubic.O→*ℂ) (Q:Ideal ActualEisensteinCubic.O) (hΨ:CanonicalCoefficientClass.FactorsModulo Q Ψ) (u:ActualEisensteinCubic.Oˣ) (a b:ℕ) (r:ActualEisensteinCubic.O) (hr:Supported (Ideal.span {r})) : CanonicalCoefficientClass.FactorsModulo (Q*Ideal.span {(72:ActualEisensteinCubic.O)}) (Ψ*numeratorBadTwist u a b r hr) := by intro x y hxy change Ψ x*numeratorBadTwist u a b r hr x=Ψ y*numeratorBadTwist u a b r hr y rw [hΨ x y (Ideal.mul_le_left hxy),numeratorBadTwist_periodic u a b r hr x y (Ideal.mul_le_right hxy)] end CanonicalRowCompletion namespace ShortDraftCusp open ActualEisensteinCubic CubicEisenstein ConcreteTraceCRT FiniteGaussPhase noncomputable abbrev A4unitsField (P:Ideal ActualEisensteinCubic.O) [P.IsMaximal] : Field (ActualEisensteinCubic.O⧸P) := Ideal.Quotient.field P theorem exists_A4_local_units {ι:Type*} [Fintype ι] (p:ι→ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (c0 U w:ActualEisensteinCubic.O) (hbez:U*(∏i,p i)+(ramifiedTraceLambda^3*w)*c0=1) : ∃σ ε:∀i,(ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ, (∀i,(σ i:ActualEisensteinCubic.O⧸Ideal.span {p i})= Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^2*c0*cofactor p i)) ∧ ∀i,Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^3*c0*cofactor p i)* (σ i:ActualEisensteinCubic.O⧸Ideal.span {p i})*(ε i:ActualEisensteinCubic.O⧸Ideal.span {p i})=-1 := by letI (i : ι) : Field (ActualEisensteinCubic.O⧸Ideal.span {p i}) := A4unitsField (Ideal.span {p i}) have hone (i:ι) : ∃σ ε:(ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ, (σ:ActualEisensteinCubic.O⧸Ideal.span {p i})=Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^2*c0*cofactor p i) ∧ Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^3*c0*cofactor p i)* (σ:ActualEisensteinCubic.O⧸Ideal.span {p i})*(ε:ActualEisensteinCubic.O⧸Ideal.span {p i})=-1 := by let q:=Ideal.Quotient.mk (Ideal.span {p i}) have hz:q (∏k,p k)=0 := Ideal.Quotient.eq_zero_iff_mem.mpr (Ideal.mem_span_singleton.mpr (Finset.dvd_prod_of_mem p (Finset.mem_univ i))) have hb:q (ramifiedTraceLambda^3*c0)*q w=1 := by have he:=congrArg q hbez simp only [map_add,map_mul,map_pow,map_one,hz,mul_zero,zero_add] at he simpa only [map_mul,map_pow,mul_assoc,mul_comm,mul_left_comm] using he have hb0:q (ramifiedTraceLambda^3*c0)≠0 := by intro he rw [he,zero_mul] at hb exact zero_ne_one hb have hc0:q (cofactor p i)≠0 := by intro he have hi:=productTraceShift_inverse p hp hcop i change q (cofactor p i)*_=1 at hi rw [he,zero_mul] at hi exact zero_ne_one hi have hB:q (ramifiedTraceLambda^3*c0*cofactor p i)≠0 := by rw [map_mul] exact mul_ne_zero hb0 hc0 have hS:q (ramifiedTraceLambda^2*c0*cofactor p i)≠0 := by intro he apply hB calc _=q ramifiedTraceLambda*q (ramifiedTraceLambda^2*c0*cofactor p i) := by simp only [map_mul,map_pow] ring _=0:=by rw [he,mul_zero] let σ:(ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ:=Units.mk0 _ hS let B:(ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ:=Units.mk0 _ hB refine ⟨σ,-(B*σ)⁻¹,rfl,?_⟩ have hcancel:=congrArg (fun u:(ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ=>(u:ActualEisensteinCubic.O⧸Ideal.span {p i})) (mul_inv_cancel (B*σ)) simpa only [B,Units.val_mk0,Units.val_mul,Units.val_one,Units.val_neg,mul_neg] using congrArg Neg.neg hcancel choose σ ε hσ hε using hone exact ⟨σ,ε,hσ,hε⟩ end ShortDraftCusp section open scoped BigOperators Classical MatrixGroups Matrix namespace ShortDraftCusp open ActualEisensteinCubic CubicEisenstein ConcreteTraceCRT FiniteGaussPhase open CompletedGauss CubicKubota CubicJacobiGlobal LocalReflectionBrackets end ShortDraftCusp namespace CubicEisenstein open ActualEisensteinCubic CubicKubota EisensteinCuspModThree ConcreteTraceCRT lemma cuspRepresentative_zero_eq_one : cuspRepresentative 0=(1:SL(2,ActualEisensteinCubic.O)) := by apply Subtype.ext ext i j fin_cases i <;> fin_cases j <;> simp [cuspRepresentative,cuspParameter,lowerCuspMatrix] def principalCuspDatum (g:levelThree) (hc:(g:SL(2,ActualEisensteinCubic.O)) 1 0≠0) : SourceCuspDatum where gamma:=sourceLevelInclusion g index:=0 lower_ne_zero:=by change (integralComplexMatrix (g:SL(2,ActualEisensteinCubic.O))*integralComplexMatrix (cuspRepresentative 0)) 1 0≠0 rw [cuspRepresentative_zero_eq_one,map_one,mul_one,integralComplexMatrix_apply] exact eisEmbedding_ne_zero hc end CubicEisenstein end namespace CubicEisenstein open scoped BigOperators Classical ContDiff MatrixGroups Matrix open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss CompletedDyadic open CubicKubota CubicJacobiGlobal ShortDraftCusp LocalReflectionBrackets FiniteGaussPhase end CubicEisenstein open scoped Classical BigOperators MatrixGroups namespace ShortDraftCRT open ActualEisensteinCubic CompletedGauss ConcreteTraceCRT PrimaryIdealUnitReindex lemma exists_primary_unit_multiple (x:ActualEisensteinCubic.O) (hx:¬lambda∣x) : ∃u:ActualEisensteinCubic.Oˣ,lambda^2∣u.val*x-1 := by have hg:primaryGenerator (Ideal.span {x})≠0:=primaryGenerator_span_ne_zero_iff x |>.mpr hx have hspec:=primaryGenerator_spec (Ideal.span {x}) hg have ha:Associated x (primaryGenerator (Ideal.span {x})):= Ideal.span_singleton_eq_span_singleton.mp hspec.1.symm obtain ⟨u,hu⟩:=ha refine ⟨u,?_⟩ rw [mul_comm,hu] exact hspec.2 lemma normalize_coprime_pair (a c:ActualEisensteinCubic.O) (hcop:IsCoprime a c) : ∃u:ActualEisensteinCubic.Oˣ,IsCoprime (u.val*a) (u.val*c) ∧ (lambda∣u.val*c→lambda^2∣u.val*a-1) ∧ (¬lambda∣u.val*c→lambda^2∣u.val*c-1) := by have hunit (u:ActualEisensteinCubic.Oˣ):IsCoprime (u.val*a) (u.val*c) := by obtain ⟨r,s,hrs⟩:=hcop refine ⟨r*(↑u⁻¹:ActualEisensteinCubic.O),s*(↑u⁻¹:ActualEisensteinCubic.O),?_⟩ calc _=((↑u⁻¹:ActualEisensteinCubic.O)*u.val)*(r*a+s*c):=by ring _=1:=by rw [Units.inv_mul,hrs,mul_one] have hd (u:ActualEisensteinCubic.Oˣ):lambda∣u.val*c↔lambda∣c := by constructor · intro h have hh:=dvd_mul_of_dvd_right h (↑u⁻¹:ActualEisensteinCubic.O) simpa only [←mul_assoc,Units.inv_mul,one_mul] using hh · intro h exact dvd_mul_of_dvd_right h u.val by_cases hc:lambda∣c · have ha:¬lambda∣a:=fun h=>lambda_prime_actual.not_isUnit (hcop.isUnit_of_dvd' h hc) obtain ⟨u,hu⟩:=exists_primary_unit_multiple a ha exact ⟨u,hunit u,fun _=>hu,fun hn=>False.elim (hn ((hd u).mpr hc))⟩ · obtain ⟨u,hu⟩:=exists_primary_unit_multiple c hc exact ⟨u,hunit u,fun h=>False.elim (hc ((hd u).mp h)),fun _=>hu⟩ theorem exists_normalized_rational_cusp (a c:ActualEisensteinCubic.O) (hc:c≠0) : ∃a0 c0:ActualEisensteinCubic.O,c0≠0 ∧ c0∣c ∧ IsCoprime a0 c0 ∧ eisEmbedding a0/eisEmbedding c0=eisEmbedding a/eisEmbedding c ∧ (lambda∣c0→lambda^2∣a0-1) ∧ (¬lambda∣c0→lambda^2∣c0-1) := by letI importedWitness0 := @OAI.ConcretePrimeRowBridge.instIsPrincipalIdealRingO let d:ActualEisensteinCubic.O:=IsBezout.gcd a c obtain ⟨a',ha⟩:=IsBezout.gcd_dvd_left a c obtain ⟨c',hc'⟩:=IsBezout.gcd_dvd_right a c change a=d*a' at ha change c=d*c' at hc' have hd:d≠0:=by intro hz; exact hc (by rw [hc',hz,zero_mul]) have hcp:c'≠0:=by intro hz; exact hc (by rw [hc',hz,mul_zero]) obtain ⟨r,s,hrs⟩:=IsBezout.gcd_eq_sum a c have hred:IsCoprime a' c':=by refine ⟨r,s,?_⟩ apply mul_left_cancel₀ hd change d*(r*a'+s*c')=d*1 calc _=r*a+s*c:=by rw [ha,hc'];ring _=d:=hrs _=_:=by ring obtain ⟨u,hu,hua,huc⟩:=normalize_coprime_pair a' c' hred refine ⟨u.val*a',u.val*c',mul_ne_zero u.ne_zero hcp,?_,hu,?_,hua,huc⟩ · refine ⟨d*(↑u⁻¹:ActualEisensteinCubic.O),?_⟩ rw [hc'] calc d*c'=((u.val*(↑u⁻¹:ActualEisensteinCubic.O))*d)*c':=by rw [Units.mul_inv,one_mul] _=_:=by ring · rw [ha,hc',map_mul,map_mul,map_mul,map_mul] have he:=eisEmbedding_ne_zero hd have hf:=eisEmbedding_ne_zero hcp have hu0:=eisEmbedding_ne_zero u.ne_zero field_simp end ShortDraftCRT end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.FixedConductor /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped Classical namespace CubicEisenstein section open ActualEisensteinCubic namespace RootNotationFixedConductor01 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedConductor01 open RootNotationFixedConductor01 (Eis) lemma divisor_principal_norm_le (c0 c:Eis) (hc:c≠0) (hdiv:c0∣c) : (Ideal.absNorm (Ideal.span {c0}):ℝ)≤(Ideal.absNorm (Ideal.span {c}):ℝ) := by have hp:0 norm_num [sourceCuspScale] unfold fixedCuspLevelScale fixedCuspLevelBound calc 27*(sourceCuspScale j)^2*(Ideal.absNorm (Ideal.span {c0}):ℝ)^2≤ 27*9*(Ideal.absNorm (Ideal.span {c}):ℝ)^2:=by gcongr _=_:=by ring end section open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss CubicKubota open CubicJacobiGlobal ShortDraftCusp ShortDraftCRT FiniteGaussPhase namespace RootNotationFixedConductor02 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedConductor02 open RootNotationFixedConductor02 (Eis) lemma A4_traceLambda_pow_four : ramifiedTraceLambda^4=(9:Eis) := by apply eisEmbedding_injective rw [map_pow,map_ofNat,ramifiedEmbedding_traceLambda] calc _=(eisLam^2)^2:=by ring _=9:=by rw [TraceLambdaPhase.eisLam_sq];norm_num structure PrincipalStratumArithmetic {ι:Type*} [Fintype ι] (p:ι→Eis) (N a0 c0:Eis) where lift : (∀i,(Eis⧸Ideal.span {p i})ˣ)→ι→Eis lift_period : ∀v i,N^2∣lift v i lift_residue : ∀v i,Ideal.Quotient.mk (Ideal.span {p i}) (lift v i)=(v i:Eis⧸Ideal.span {p i}) U : Eis w : Eis bezout : U*(∏i,p i)+(ramifiedTraceLambda^3*w)*c0=1 sigma : ∀i,(Eis⧸Ideal.span {p i})ˣ epsilon : ∀i,(Eis⧸Ideal.span {p i})ˣ sigma_value : ∀i,(sigma i:Eis⧸Ideal.span {p i})= Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^2*c0*cofactor p i) epsilon_value : ∀i,Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^3*c0*cofactor p i)* (sigma i:Eis⧸Ideal.span {p i})*(epsilon i:Eis⧸Ideal.span {p i})=-1 gamma : (∀i,(Eis⧸Ideal.span {p i})ˣ)→levelThree numerator : ∀v,(gamma v:SL(2,Eis)) 0 0=finiteCrossNumerator a0 c0 ramifiedTraceLambda p (lift v) denominator : ∀v,(gamma v:SL(2,Eis)) 1 0=c0*∏i,p i numerator_fixed : ∀v,(9:Eis)*c0∣(gamma v:SL(2,Eis)) 0 0-(gamma (fun _=>1):SL(2,Eis)) 0 0 inverse_fixed : ∀v,ramifiedTraceLambda^3*c0∣(gamma v:SL(2,Eis)) 1 1-(gamma (fun _=>1):SL(2,Eis)) 1 1 end open scoped BigOperators Classical ContDiff MatrixGroups Matrix open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss CompletedDyadic open CubicKubota CubicJacobiGlobal ShortDraftCusp LocalReflectionBrackets FiniteGaussPhase namespace RootNotationFixedConductor03 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedConductor03 open RootNotationFixedConductor03 (Eis) namespace PrincipalStratumArithmetic variable {ι:Type*} [Fintype ι] {p:ι→Eis} {N a0 c0:Eis} noncomputable def datum (D:PrincipalStratumArithmetic p N a0 c0) (hp:∀i,p i≠0) (hc0:c0≠0) (v:∀i,(Eis⧸Ideal.span {p i})ˣ) : SourceCuspDatum := principalCuspDatum (D.gamma v) (by rw [D.denominator];exact mul_ne_zero hc0 (Finset.prod_ne_zero_iff.mpr (fun i _=>hp i))) noncomputable def smoothedValue (D:PrincipalStratumArithmetic p N a0 c0) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hc0:c0≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (W:ℝ→ℂ) (X:ℝ) : ℂ := by letI (i:ι):Fintype (Eis⧸Ideal.span {p i}):=Fintype.ofFinite _ exact ∑v:∀i,(Eis⧸Ideal.span {p i})ˣ, (∏i,finiteAdditiveFourierCoeff (quotientTrace (p i) (hp i)) (fun t=>(actualSextic (Ideal.span {p i}) (hg i)^j i) t) (v i))* (D.datum hp hc0 v).smoothedKernel W X noncomputable def reflectedValue (D:PrincipalStratumArithmetic p N a0 c0) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hc0:c0≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (W:ℝ→ℂ) (X:ℝ) : ℂ := by letI (i:ι):Field (Eis⧸Ideal.span {p i}):=Ideal.Quotient.field _ letI (i:ι):Fintype (Eis⧸Ideal.span {p i}):=Fintype.ofFinite _ let c:=c0*∏i,p i let Q:ℝ:=‖eisEmbedding c‖^2 exact fixedRadialCoefficientScalar*∑'t:ThetaFullIndex, ((fixedConjugateCuspArray 0 t.1 t.2.1 t.2.2.1.val t.2.2.2.val* sourceFrequencyAngle (thetaFullFrequency t))/ ((ramifiedScale 1 completedRamifiedStep t.2.1* Real.sqrt (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ):ℝ):ℂ))* CubicReflectionKernel.paperKernel (Vstar W) (X*sourceCuspRadialLength (thetaFullFrequency t)/(27*Q^2))* (-(Q:ℂ)/(eisEmbedding c)^2* ((star (eisEmbedding (symbol c0 ((D.gamma (fun _=>1):SL(2,Eis)) 0 0)))* A4BadPhase c0 hc0 ((D.gamma (fun _=>1):SL(2,Eis)) 1 1) D.U (ramifiedTraceLambda*thetaFullFrequency t))* ∏i,(((actualSextic (Ideal.span {p i}) (hg i))⁻¹)^2) (D.sigma i)* phase (actualSextic (Ideal.span {p i}) (hg i)) (quotientTrace (p i) (hp i)) (j i) (D.epsilon i)* bracket (actualSextic (Ideal.span {p i}) (hg i)) (j i) (Ideal.Quotient.mk _ (ramifiedTraceLambda*thetaFullFrequency t)))) end PrincipalStratumArithmetic end CubicEisenstein open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid namespace RootNotationFixedConductor04 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedConductor04 open RootNotationFixedConductor04 (Eis) abbrev BasePrimeIndex (I Q:Ideal Eis) := {P:PrimeIndex I // Q≤P.val} abbrev FreePrimeIndex (I Q:Ideal Eis) := {P:PrimeIndex I // ¬Q≤P.val} def basePrimeRow (I:Ideal Eis) (hI:Supported I) (Q:Ideal Eis) : Eis→*ℂ where toFun n:=∏P:BasePrimeIndex I Q, let : P.val.val.IsMaximal := primeIndexMaximal I P.val (actualSextic P.val.val ((supported_factors_good I hI P.val.val (Multiset.mem_toFinset.mp P.val.property)).2.1)^((normalizedFactors I).count P.val.val%6)) (Ideal.Quotient.mk P.val.val n) map_one' := by simp only [map_one,Finset.prod_const_one] map_mul' x y := by simp only [map_mul,Finset.prod_mul_distrib] def freePrimeRow (I:Ideal Eis) (hI:Supported I) (Q:Ideal Eis) : Eis→*ℂ where toFun n:=∏P:FreePrimeIndex I Q, let : P.val.val.IsMaximal := primeIndexMaximal I P.val (actualSextic P.val.val ((supported_factors_good I hI P.val.val (Multiset.mem_toFinset.mp P.val.property)).2.1)^((normalizedFactors I).count P.val.val%6)) (Ideal.Quotient.mk P.val.val n) map_one' := by simp only [map_one,Finset.prod_const_one] map_mul' x y := by simp only [map_mul,Finset.prod_mul_distrib] lemma basePrimeRow_norm (I:Ideal Eis) (hI:Supported I) (Q:Ideal Eis) (n:Eis) : ‖basePrimeRow I hI Q n‖≤1 := by change ‖∏P:BasePrimeIndex I Q,_‖≤1 rw [norm_prod] apply Finset.prod_le_one₀ · intro P hP;exact norm_nonneg _ · intro P hP let : P.val.val.IsMaximal := primeIndexMaximal I P.val let : Fintype (Eis ⧸ P.val.val) := ActualEisensteinCubic.quotientFintype P.val.val exact FiniteRayExpansion.norm_char_le_one _ _ lemma freePrimeRow_norm (I:Ideal Eis) (hI:Supported I) (Q:Ideal Eis) (n:Eis) : ‖freePrimeRow I hI Q n‖≤1 := by change ‖∏P:FreePrimeIndex I Q,_‖≤1 rw [norm_prod] apply Finset.prod_le_one₀ · intro P hP;exact norm_nonneg _ · intro P hP let : P.val.val.IsMaximal := primeIndexMaximal I P.val let : Fintype (Eis ⧸ P.val.val) := ActualEisensteinCubic.quotientFintype P.val.val exact FiniteRayExpansion.norm_char_le_one _ _ lemma basePrimeRow_periodic (I:Ideal Eis) (hI:Supported I) (Q:Ideal Eis) : CanonicalCoefficientClass.FactorsModulo Q (basePrimeRow I hI Q) := by intro x y hxy change (∏P:BasePrimeIndex I Q,_)=∏P:BasePrimeIndex I Q,_ apply Finset.prod_congr rfl intro P hP have he:Ideal.Quotient.mk P.val.val x=Ideal.Quotient.mk P.val.val y:= Ideal.Quotient.eq.mpr (P.property hxy) rw [he] lemma idealRowHom_fixed_conductor_split (I:Ideal Eis) (hI:Supported I) (Q:Ideal Eis) (n:Eis) : idealRowHom n I=basePrimeRow I hI Q n*freePrimeRow I hI Q n := by rw [idealRowHom_eq_prime_count_product I hI n] exact (Fintype.prod_subtype_mul_prod_subtype (fun P:PrimeIndex I=>Q≤P.val) (fun P:PrimeIndex I=> let : P.val.IsMaximal := primeIndexMaximal I P (actualSextic P.val ((supported_factors_good I hI P.val (Multiset.mem_toFinset.mp P.property)).2.1)^((normalizedFactors I).count P.val%6)) (Ideal.Quotient.mk P.val n))).symm lemma freePrimeIndex_pairwise_coprime (I Q:Ideal Eis) : Pairwise (Function.onFun IsCoprime (fun P:FreePrimeIndex I Q=>P.val.val)) := by intro P R hPR let : P.val.val.IsMaximal := primeIndexMaximal I P.val let : R.val.val.IsMaximal := primeIndexMaximal I R.val exact Ideal.isCoprime_of_isMaximal (fun he=>hPR (Subtype.ext (Subtype.ext he))) lemma freePrimeIndex_coprime (I Q:Ideal Eis) (P:FreePrimeIndex I Q) : IsCoprime Q P.val.val := by let : P.val.val.IsMaximal := primeIndexMaximal I P.val apply Ideal.isCoprime_iff_sup_eq.mpr by_contra ht have he:P.val.val=Q⊔P.val.val:= (show P.val.val.IsMaximal from inferInstance).eq_of_le ht le_sup_right exact P.property (le_sup_left.trans he.symm.le) end section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve namespace RootNotationFixedConductor05 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedConductor05 open RootNotationFixedConductor05 (Eis) lemma freePrimeRow_periodic (I:Ideal Eis) (hI:Supported I) (Q:Ideal Eis) : CanonicalCoefficientClass.FactorsModulo (∏P:FreePrimeIndex I Q,P.val.val) (freePrimeRow I hI Q) := by intro x y hxy change (∏P:FreePrimeIndex I Q,_)=∏P:FreePrimeIndex I Q,_ apply Finset.prod_congr rfl intro P hP have hm:x-y∈P.val.val:= (Ideal.prod_le_inf.trans (Finset.inf_le (Finset.mem_univ P))) hxy rw [Ideal.Quotient.eq.mpr hm] lemma fixedFreeRow_periodic (I:Ideal Eis) (hI:Supported I) (Q:Ideal Eis) (φ:Eis→*ℂ) (hφ:CanonicalCoefficientClass.FactorsModulo Q φ) : CanonicalCoefficientClass.FactorsModulo (Q*(∏P:FreePrimeIndex I Q,P.val.val)) (φ*freePrimeRow I hI Q) := by intro x y hxy change φ x*freePrimeRow I hI Q x=φ y*freePrimeRow I hI Q y rw [hφ x y (Ideal.mul_le_left hxy),freePrimeRow_periodic I hI Q x y (Ideal.mul_le_right hxy)] lemma fixedFreeRow_norm (I:Ideal Eis) (hI:Supported I) (Q:Ideal Eis) (φ:Eis→*ℂ) (hφ:∀n,‖φ n‖≤1) (n:Eis) : ‖(φ*freePrimeRow I hI Q) n‖≤1 := by change ‖φ n*freePrimeRow I hI Q n‖≤1 rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (hφ n)).trans (freePrimeRow_norm I hI Q n) end open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid open ConcretePrimeRowBridge namespace RootNotationFixedConductor06 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedConductor06 open RootNotationFixedConductor06 (Eis) def goodMaskMovingIdeal (g r:Eis) : Ideal Eis := (Ideal.span {g})^6*Ideal.span {r} lemma goodMaskMovingIdeal_supported (g r:Eis) (hg:Supported (Ideal.span {g})) (hr:Supported (Ideal.span {r})) : Supported (goodMaskMovingIdeal g r) := by exact (supported_mul_iff _ _).mpr ⟨supported_pow hg 6,hr⟩ lemma good_odd_prime_two_not_mem (P:Ideal Eis) [P.IsMaximal] (hodd:ringChar (Eis⧸P)≠2) : (2:Eis)∉P := by intro ht have he:=maximal_ideal_eq_span_of_mem P inferInstance (2:Eis) twoIdeal_maximal ht exact hodd (he ▸ twoIdeal_characteristic) lemma count_span_eq_zero_of_not_mem (P:Ideal Eis) (x:Eis) (hx:x∉P) : (normalizedFactors (Ideal.span {x})).count P=0 := by apply Multiset.count_eq_zero.mpr intro hm have h0:(Ideal.span {x}:Ideal Eis)≠0:=by apply Ideal.span_singleton_eq_bot.not.mpr intro he exact hx (he ▸ P.zero_mem) exact hx (Ideal.dvd_span_singleton.mp ((UniqueFactorizationMonoid.mem_normalizedFactors_iff h0).mp hm).2) lemma good_factor_count (P:Ideal Eis) [P.IsMaximal] (hgood:lambda∉P) (hodd:ringChar (Eis⧸P)≠2) (u:Eisˣ) (a b:ℕ) (r:Eis) (hr:Supported (Ideal.span {r})) : (normalizedFactors (Ideal.span {u.val*lambda^a*(2:Eis)^b*r})).count P= (normalizedFactors (Ideal.span {r})).count P := by have hl:(Ideal.span {lambda}:Ideal Eis)≠0:= Ideal.span_singleton_eq_bot.not.mpr PrimaryIdealUnitReindex.lambda_prime_actual.ne_zero have ht:(Ideal.span {(2:Eis)}:Ideal Eis)≠0:=Ideal.span_singleton_eq_bot.not.mpr (by norm_num) have hcl:=count_span_eq_zero_of_not_mem P lambda hgood have hct:=count_span_eq_zero_of_not_mem P 2 (good_odd_prime_two_not_mem P hodd) rw [show u.val*lambda^a*(2:Eis)^b*r=u.val*(lambda^a*(2:Eis)^b*r) by ring, Ideal.span_singleton_mul_left_unit u.isUnit, ←Ideal.span_singleton_mul_span_singleton,←Ideal.span_singleton_mul_span_singleton, ←Ideal.span_singleton_pow,←Ideal.span_singleton_pow, normalizedFactors_mul (mul_ne_zero (pow_ne_zero _ hl) (pow_ne_zero _ ht)) hr.1, normalizedFactors_mul (pow_ne_zero _ hl) (pow_ne_zero _ ht)] simp only [Multiset.count_add,normalizedFactors_pow,Multiset.count_nsmul,hcl,hct,mul_zero,zero_add] theorem goodMaskMovingIdeal_count (I F:Ideal Eis) (hI:I≠0) (hF:F≠0) (m f z:Eis) (hf:Ideal.span {f}=F) (hz:Ideal.span {z}=I) (um:Eisˣ) (am bm:ℕ) (g:Eis) (hg:Supported (Ideal.span {g})) (hm:m=um.val*lambda^am*(2:Eis)^bm*g) (u:Eisˣ) (a b:ℕ) (r:Eis) (hr:Supported (Ideal.span {r})) (hx:f^4*z=u.val*lambda^a*(2:Eis)^b*r) (P:Ideal Eis) [P.IsMaximal] (hgood:lambda∉P) (hodd:ringChar (Eis⧸P)≠2) : (normalizedFactors (goodMaskMovingIdeal g r)).count P= 6*(normalizedFactors (Ideal.span {m})).count P+ 4*(normalizedFactors F).count P+(normalizedFactors I).count P := by have hmc:(normalizedFactors (Ideal.span {m})).count P=(normalizedFactors (Ideal.span {g})).count P:=by rw [hm] exact good_factor_count P hgood hodd um am bm g hg have hrc:(normalizedFactors (Ideal.span {r})).count P= 4*(normalizedFactors F).count P+(normalizedFactors I).count P:=by have hh:=good_factor_count P hgood hodd u a b r hr rw [←hx,←Ideal.span_singleton_mul_span_singleton,←Ideal.span_singleton_pow,hf,hz, normalizedFactors_mul (pow_ne_zero 4 hF) hI] at hh simpa only [Multiset.count_add,normalizedFactors_pow,Multiset.count_nsmul] using hh.symm rw [goodMaskMovingIdeal,normalizedFactors_mul (pow_ne_zero 6 hg.1) hr.1] simp only [Multiset.count_add,normalizedFactors_pow,Multiset.count_nsmul,←hmc,hrc] omega lemma squarefree_prime_count_indicator (F P:Ideal Eis) (hF:Squarefree F) (hP:Prime P) : (normalizedFactors F).count P=if P∣F then 1 else 0 := by have hle:=Multiset.nodup_iff_count_le_one.mp ((squarefree_iff_nodup_normalizedFactors hF.ne_zero).mp hF) P by_cases hPF:P∣F · rw [if_pos hPF] have hp:=Multiset.count_pos.mpr ((UniqueFactorizationMonoid.mem_normalizedFactors_iff hF.ne_zero).mpr ⟨hP,hPF⟩) omega · rw [if_neg hPF] apply Multiset.count_eq_zero.mpr intro hm exact hPF ((UniqueFactorizationMonoid.mem_normalizedFactors_iff hF.ne_zero).mp hm).2 theorem goodMaskMovingIdeal_exponent (I F:Ideal Eis) (hI:I≠0) (hF:Squarefree F) (m f z:Eis) (hf:Ideal.span {f}=F) (hz:Ideal.span {z}=I) (um:Eisˣ) (am bm:ℕ) (g:Eis) (hg:Supported (Ideal.span {g})) (hm:m=um.val*lambda^am*(2:Eis)^bm*g) (u:Eisˣ) (a b:ℕ) (r:Eis) (hr:Supported (Ideal.span {r})) (hx:f^4*z=u.val*lambda^a*(2:Eis)^b*r) (P:Ideal Eis) [P.IsMaximal] (hgood:lambda∉P) (hodd:ringChar (Eis⧸P)≠2) : (normalizedFactors (goodMaskMovingIdeal g r)).count P%6=completedLocalExponent I F P := by rw [goodMaskMovingIdeal_count I F hI hF.ne_zero m f z hf hz um am bm g hg hm u a b r hr hx P hgood hodd, squarefree_prime_count_indicator F P hF (Ideal.prime_of_isPrime (NeZero.ne P) inferInstance)] unfold completedLocalExponent omega end CanonicalRowCompletion end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.FixedCuspBranches /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid open ConcretePrimeRowBridge namespace RootNotationFixedCuspBranches01 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedCuspBranches01 open RootNotationFixedCuspBranches01 (Eis) lemma prime_dvd_iff_factor_count_pos (P A:Ideal Eis) (hP:Prime P) (hA:A≠0) : P∣A ↔ 0<(normalizedFactors A).count P := by simp only [Multiset.count_pos,UniqueFactorizationMonoid.mem_normalizedFactors_iff hA,hP,true_and] theorem goodMaskMovingIdeal_dvd_iff (I F:Ideal Eis) (hI:I≠0) (hF:F≠0) (m f z:Eis) (hm0:m≠0) (hf:Ideal.span {f}=F) (hz:Ideal.span {z}=I) (um:Eisˣ) (am bm:ℕ) (g:Eis) (hg:Supported (Ideal.span {g})) (hm:m=um.val*lambda^am*(2:Eis)^bm*g) (u:Eisˣ) (a b:ℕ) (r:Eis) (hr:Supported (Ideal.span {r})) (hx:f^4*z=u.val*lambda^a*(2:Eis)^b*r) (P:Ideal Eis) [P.IsMaximal] (hgood:lambda∉P) (hodd:ringChar (Eis⧸P)≠2) : P∣goodMaskMovingIdeal g r ↔ P∣I*(Ideal.span {m}*F) := by have hP:Prime P:=Ideal.prime_of_isPrime (NeZero.ne P) inferInstance have hmI:(Ideal.span {m}:Ideal Eis)≠0:=Ideal.span_singleton_eq_bot.not.mpr hm0 rw [prime_dvd_iff_factor_count_pos P _ hP (goodMaskMovingIdeal_supported g r hg hr).1, prime_dvd_iff_factor_count_pos P _ hP (mul_ne_zero hI (mul_ne_zero hmI hF)), goodMaskMovingIdeal_count I F hI hF m f z hf hz um am bm g hg hm u a b r hr hx P hgood hodd, normalizedFactors_mul hI (mul_ne_zero hmI hF),normalizedFactors_mul hmI hF] simp only [Multiset.count_add] omega theorem goodMaskMovingIdeal_primeSupport (I F:Ideal Eis) (hI:I≠0) (hF:F≠0) (m f z:Eis) (hm0:m≠0) (hf:Ideal.span {f}=F) (hz:Ideal.span {z}=I) (um:Eisˣ) (am bm:ℕ) (g:Eis) (hg:Supported (Ideal.span {g})) (hm:m=um.val*lambda^am*(2:Eis)^bm*g) (u:Eisˣ) (a b:ℕ) (r:Eis) (hr:Supported (Ideal.span {r})) (hx:f^4*z=u.val*lambda^a*(2:Eis)^b*r) : IdealMobiusDivisorSum.primeSupport (goodMaskMovingIdeal g r)= (IdealMobiusDivisorSum.primeSupport (I*(Ideal.span {m}*F))).filter (fun P=>lambda∉P ∧ ringChar (Eis⧸P)≠2) := by have hs:=goodMaskMovingIdeal_supported g r hg hr have hmI:(Ideal.span {m}:Ideal Eis)≠0:=Ideal.span_singleton_eq_bot.not.mpr hm0 have hprod:=mul_ne_zero hI (mul_ne_zero hmI hF) ext P simp only [IdealMobiusDivisorSum.primeSupport,Finset.mem_filter,Multiset.mem_toFinset] constructor · intro hP obtain ⟨hmax,hgood,hodd⟩:=supported_factors_good _ hs P hP let:P.IsMaximal:=hmax have hp:Prime P:=prime_of_normalized_factor P hP have hd: P∣goodMaskMovingIdeal g r:= ((UniqueFactorizationMonoid.mem_normalizedFactors_iff hs.1).mp hP).2 exact ⟨(UniqueFactorizationMonoid.mem_normalizedFactors_iff hprod).mpr ⟨hp, (goodMaskMovingIdeal_dvd_iff I F hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx P hgood hodd).mp hd⟩,hgood,hodd⟩ · rintro ⟨hP,hgood,hodd⟩ have hp:Prime P:=prime_of_normalized_factor P hP let:P.IsMaximal:=(Ideal.isPrime_of_prime hp).isMaximal hp.ne_zero have hd:=((UniqueFactorizationMonoid.mem_normalizedFactors_iff hprod).mp hP).2 exact (UniqueFactorizationMonoid.mem_normalizedFactors_iff hs.1).mpr ⟨hp, (goodMaskMovingIdeal_dvd_iff I F hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx P hgood hodd).mpr hd⟩ end open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid open ConcretePrimeRowBridge CanonicalUnitEuler namespace RootNotationFixedCuspBranches02 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedCuspBranches02 open RootNotationFixedCuspBranches02 (Eis) end CanonicalRowCompletion namespace CubicEisenstein section open scoped Classical BigOperators MatrixGroups Matrix open CubicKubota EisensteinCuspModThree ConcreteTraceCRT CompletedGauss CompletedDyadic namespace RootNotationFixedCuspBranches03 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedCuspBranches03 open RootNotationFixedCuspBranches03 (Eis) namespace FixedCuspShape variable {H:SL(2,Eis)} (s:FixedCuspShape H) lemma amplitude_source_nonzero (p:ThetaFullIndex) (hp:s.amplitude p.1 p.2.1 p.2.2.1.val p.2.2.2.val≠0) : (sourceCuspCoefficients s.index).value (thetaFullFrequency p)≠0 := by intro hz apply hp have hz':(sourceCuspCoefficients s.index).value (fixedCuspArrayIndex p.1 p.2.1 p.2.2.1.val p.2.2.2.val)=0:=by simpa only [thetaFullFrequency_eq_fixedCuspArrayIndex] using hz simp only [amplitude,fixedConjugateCuspArray,fixedCuspArray,hz',zero_div,ite_self, star_zero,zero_mul] lemma amplitude_integral_phase (p:ThetaFullIndex) (c d:Eis) (hc:c≠0) : s.amplitude p.1 p.2.1 p.2.2.1.val p.2.2.2.val * ShortDraftTrace.breveE (cuspFrequency (thetaFullFrequency p)*eisEmbedding (s.upper 0 0)^2* (eisEmbedding d/eisEmbedding c)/(sourceCuspScale s.index:ℂ)) = s.amplitude p.1 p.2.1 p.2.2.1.val p.2.2.2.val * ShortDraftTrace.breveE (-(eisEmbedding d* (eisEmbedding (sourceCuspPhaseNumerator s.index (s.upper 0 0) (thetaFullFrequency p))/eisLam^4))/ eisEmbedding c) := by by_cases hp:s.amplitude p.1 p.2.1 p.2.2.1.val p.2.2.2.val=0 · rw [hp,zero_mul,zero_mul] · rw [sourceCuspPhaseNumerator_phase s.index (s.upper 0 0) (thetaFullFrequency p) c d hc (s.amplitude_source_nonzero p hp)] lemma datum_integral_phase (g:levelTwo) (c:Eis) (hc:c≠0) (hg:((g:SL(2,Eis))*H) 1 0=c) (p:ThetaFullIndex) : (fixedConjugateCuspArray s.index p.1 p.2.1 p.2.2.1.val p.2.2.2.val* sourceFrequencyAngle (thetaFullFrequency p))* ShortDraftTrace.breveE (-cuspFrequency (thetaFullFrequency p)* ((s.datum g (by rwa [hg])).dualPoint/(sourceCuspScale s.index:ℂ))) = s.amplitude p.1 p.2.1 p.2.2.1.val p.2.2.2.val* ShortDraftTrace.breveE (-(eisEmbedding (((g:SL(2,Eis))*H) 1 1)* (eisEmbedding (sourceCuspPhaseNumerator s.index (s.upper 0 0) (thetaFullFrequency p))/eisLam^4))/ eisEmbedding c) := by have hphase:=s.datum_additive_phase g (by rwa [hg]) (cuspFrequency (thetaFullFrequency p)) (sourceCuspScale s.index:ℂ) simp only [hg] at hphase calc _=s.amplitude p.1 p.2.1 p.2.2.1.val p.2.2.2.val* ShortDraftTrace.breveE (cuspFrequency (thetaFullFrequency p)*eisEmbedding (s.upper 0 0)^2* (eisEmbedding (((g:SL(2,Eis))*H) 1 1)/eisEmbedding c)/(sourceCuspScale s.index:ℂ)) := by rw [show -cuspFrequency (thetaFullFrequency p)* ((s.datum g (by rwa [hg])).dualPoint/(sourceCuspScale s.index:ℂ))= -cuspFrequency (thetaFullFrequency p)*(s.datum g (by rwa [hg])).dualPoint/ (sourceCuspScale s.index:ℂ) by ring,hphase] unfold amplitude rw [←thetaFullFrequency_eq_fixedCuspArrayIndex] ring _=_:=s.amplitude_integral_phase p c _ hc def stratumShapeFactor (c:Eis) : ℂ := -star (levelTwoComplexCharacter s.gamma)*eisEmbedding (s.upper 0 0)^2* ((Ideal.absNorm (Ideal.span {c}):ℝ):ℂ)/eisEmbedding c^2 lemma datum_common_row_factor (g:levelTwo) (c:Eis) (hc:c≠0) (hg:((g:SL(2,Eis))*H) 1 0=c) : (s.datum g (by rwa [hg])).multiplier*((Ideal.absNorm (Ideal.span {c}):ℝ):ℂ)= s.stratumShapeFactor c*star (levelTwoComplexCharacter g) := by have hm:=s.smoothed_row_factor g (by rwa [hg]) simp only [s.datum_heightScale,hg,ActualEisensteinCubic.eisEmbedding_norm_sq_eq_absNorm_span] at hm rw [hm] unfold stratumShapeFactor ring end FixedCuspShape end open scoped Classical BigOperators ContDiff MatrixGroups Matrix open CubicKubota EisensteinCuspModThree ConcreteTraceCRT CompletedGauss CompletedDyadic namespace RootNotationFixedCuspBranches04 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedCuspBranches04 open RootNotationFixedCuspBranches04 (Eis) namespace FixedCuspShape variable {H:SL(2,Eis)} (s:FixedCuspShape H) theorem sum_smoothedKernel_integral_phase {ι:Type*} [Fintype ι] (g:ι→levelTwo) (c:Eis) (hc:c≠0) (hC:∀v,((g v:SL(2,Eis))*H) 1 0=c) (w:ι→ℂ) (W:ℝ→ℂ) (a b:ℝ) (ha:0s.datum (g v) (by rw [hC v];exact hc) have hindex:∀v,(d v).index=s.index:=fun _=>rfl have hheight:∀v,(d v).heightScale=(Ideal.absNorm (Ideal.span {c}):ℝ):=by intro v dsimp only [d] rw [s.datum_heightScale,hC v,ActualEisensteinCubic.eisEmbedding_norm_sq_eq_absNorm_span] have he:=sum_smoothedKernel_common_cusp d w s.index (Ideal.absNorm (Ideal.span {c}):ℝ) hindex hheight W a b ha hsupp hW X hX rw [he] conv_rhs => rw [mul_assoc] apply congrArg (fun z:ℂ=>fixedRadialCoefficientScalar*z) rw [←tsum_mul_left] apply tsum_congr intro p rw [sourceCusp_full_index_kernel_argument p s.index (Ideal.absNorm (Ideal.span {c}):ℝ) X] let A:ℂ:=fixedConjugateCuspArray s.index p.1 p.2.1 p.2.2.1.val p.2.2.2.val* sourceFrequencyAngle (thetaFullFrequency p) let B:ℂ:=s.amplitude p.1 p.2.1 p.2.2.1.val p.2.2.2.val let lengthScale:ι→ℂ:=fun v=>w v*((d v).multiplier*((Ideal.absNorm (Ideal.span {c}):ℝ):ℂ))* ShortDraftTrace.breveE (-cuspFrequency (thetaFullFrequency p)*((d v).dualPoint/(sourceCuspScale s.index:ℂ))) let R:ι→ℂ:=fun v=>w v*star (levelTwoComplexCharacter (g v))* ShortDraftTrace.breveE (-(eisEmbedding (((g v:SL(2,Eis))*H) 1 1)* (eisEmbedding (sourceCuspPhaseNumerator s.index (s.upper 0 0) (thetaFullFrequency p))/eisLam^4))/eisEmbedding c) have hs:A*(∑v,lengthScale v)=s.stratumShapeFactor c*B*(∑v,R v):=by rw [Finset.mul_sum,Finset.mul_sum] apply Finset.sum_congr rfl intro v hv dsimp only [lengthScale,R] calc _=w v*(((d v).multiplier*((Ideal.absNorm (Ideal.span {c}):ℝ):ℂ))* (A*ShortDraftTrace.breveE (-cuspFrequency (thetaFullFrequency p)* ((d v).dualPoint/(sourceCuspScale s.index:ℂ))))):=by ring _=w v*((s.stratumShapeFactor c*star (levelTwoComplexCharacter (g v)))* (B*ShortDraftTrace.breveE (-(eisEmbedding (((g v:SL(2,Eis))*H) 1 1)* (eisEmbedding (sourceCuspPhaseNumerator s.index (s.upper 0 0) (thetaFullFrequency p))/eisLam^4))/eisEmbedding c))):=by rw [s.datum_common_row_factor (g v) c hc (hC v),s.datum_integral_phase (g v) c hc (hC v) p] _=_:=by ring let D:ℂ:=((ramifiedScale 1 completedRamifiedStep p.2.1* Real.sqrt (Ideal.absNorm p.2.2.1.val:ℝ)*(Ideal.absNorm p.2.2.2.val:ℝ):ℝ):ℂ) let K:ℂ:=CubicReflectionKernel.paperKernel (Vstar W) ((X/(27*(sourceCuspScale s.index)^2*(Ideal.absNorm (Ideal.span {c}):ℝ)^2))* (ramifiedScale 1 completedRamifiedStep p.2.1)^3* (Ideal.absNorm p.2.2.1.val:ℝ)*(Ideal.absNorm p.2.2.2.val:ℝ)^3) change A/D*K*(∑v,lengthScale v)=s.stratumShapeFactor c*(B/D*K*(∑v,R v)) calc _=(A*(∑v,lengthScale v))/D*K:=by ring _=(s.stratumShapeFactor c*B*(∑v,R v))/D*K:=by rw [hs] _=_:=by ring lemma stratumShapeFactor_norm (c:Eis) (hc:c≠0) : ‖s.stratumShapeFactor c‖=1 := by have hu:‖eisEmbedding (s.upper 0 0)‖=1:=by rcases s.upper_unit with ⟨u,hu⟩ rw [←hu] exact GaussGeneratorTransport.norm_eisEmbedding_unit u have hn:‖eisEmbedding c‖^2≠0:=pow_ne_zero _ (norm_ne_zero_iff.mpr (eisEmbedding_ne_zero hc)) rw [stratumShapeFactor,norm_div,norm_mul,norm_mul,norm_neg,norm_star, norm_levelTwoComplexCharacter,norm_pow,hu,one_pow,one_mul,one_mul,norm_pow, Complex.norm_real,Real.norm_of_nonneg (Nat.cast_nonneg _), ←ActualEisensteinCubic.eisEmbedding_norm_sq_eq_absNorm_span] exact div_self hn end FixedCuspShape end CubicEisenstein open scoped BigOperators Classical ContDiff namespace CompletedGauss section open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve CompletedDyadic namespace RootNotationFixedCuspBranches05 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedCuspBranches05 open RootNotationFixedCuspBranches05 (Eis) def fixedCuspArrayWithPhase (cusp:Fin 3) (u:Eisˣ) (phaseArray:ℕ→Ideal Eis→Ideal Eis→ℂ) (m:ℕ) (n b:Ideal Eis) : ℂ := phaseArray m n b*fixedConjugateCuspArray cusp u m n b lemma fixedCuspArrayWithPhase_norm_le_one (cusp:Fin 3) (u:Eisˣ) (phaseArray:ℕ→Ideal Eis→Ideal Eis→ℂ) (hphase:∀m n b,‖phaseArray m n b‖≤1) (m:ℕ) (n b:Ideal Eis) : ‖fixedCuspArrayWithPhase cusp u phaseArray m n b‖≤1 := by rw [fixedCuspArrayWithPhase,norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (hphase m n b)).trans (fixedConjugateCuspArray_norm_le_one cusp u m n b) lemma fixedCuspArrayWithPhase_zero (cusp:Fin 3) (u:Eisˣ) (phaseArray:ℕ→Ideal Eis→Ideal Eis→ℂ) (m:ℕ) (n b:Ideal Eis) (h:¬fixedCuspArrayEligible n b) : fixedCuspArrayWithPhase cusp u phaseArray m n b=0 := by simp only [fixedCuspArrayWithPhase,fixedConjugateCuspArray, fixedCuspArray_zero_of_ineligible _ _ _ _ _ h,star_zero,mul_zero] namespace ReflectedBranchData def extractedFixedCuspArrayWithPhase {levelBound K:ℝ} {I F Q:Ideal Eis} (d:ReflectedBranchData levelBound K I F Q) (cusp:Fin 3) (u:Eisˣ) (phaseArray:ℕ→Ideal Eis→Ideal Eis→ℂ) (m:ℕ) (n b:Ideal Eis) : ℂ := fixedCuspArrayWithPhase cusp u phaseArray m (reflectionExtractedDivisor (fun p:d.primes=>p.val) (fun p=>completedLocalExponent I F p.val) d.label 1*n) (reflectionExtractedDivisor (fun p:d.primes=>p.val) (fun p=>completedLocalExponent I F p.val) d.label 2*b) lemma extractedFixedCuspArrayWithPhase_norm_le_one {levelBound K:ℝ} {I F Q:Ideal Eis} (d:ReflectedBranchData levelBound K I F Q) (cusp:Fin 3) (u:Eisˣ) (phaseArray:ℕ→Ideal Eis→Ideal Eis→ℂ) (hphase:∀m n b,‖phaseArray m n b‖≤1) (m:ℕ) (n b:Ideal Eis) : ‖d.extractedFixedCuspArrayWithPhase cusp u phaseArray m n b‖≤1 := fixedCuspArrayWithPhase_norm_le_one cusp u phaseArray hphase m _ _ def withExtractedFixedCuspArrayWithPhase {levelBound K:ℝ} {I F Q:Ideal Eis} (d:ReflectedBranchData levelBound K I F Q) (cusp:Fin 3) (u:Eisˣ) (phaseArray:ℕ→Ideal Eis→Ideal Eis→ℂ) (hphase:∀m n b,‖phaseArray m n b‖≤1) (rowPhase:ℕ→idealRange (completedResidualScale K I Q)→ℂ) (hrow:∀m k,‖rowPhase m k‖≤1) : ReflectedBranchData levelBound K I F Q := d.withCanonicalCuspArray (d.extractedFixedCuspArrayWithPhase cusp u phaseArray) (fun m n b=>d.extractedFixedCuspArrayWithPhase_norm_le_one cusp u phaseArray hphase m n.val b.val) rowPhase hrow theorem withExtractedFixedCuspArrayWithPhase_value {levelBound K:ℝ} {I F Q:Ideal Eis} (d:ReflectedBranchData levelBound K I F Q) (cusp:Fin 3) (u:Eisˣ) (phaseArray:ℕ→Ideal Eis→Ideal Eis→ℂ) (hphase:∀m n b,‖phaseArray m n b‖≤1) (rowPhase:ℕ→idealRange (completedResidualScale K I Q)→ℂ) (hrow:∀m k,‖rowPhase m k‖≤1) (W:ℝ→ℂ) (a b:ℝ) (ha:0d.extractedFixedCuspArrayWithPhase_norm_le_one cusp u phaseArray hphase m n.val b.val) rowPhase hrow W a b ha hsupp hW X ρ q hX hρ hq hK k hk end ReflectedBranchData end section open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve CompletedDyadic namespace RootNotationFixedCuspBranches06 abbrev Eis := ActualEisensteinCubic.O end RootNotationFixedCuspBranches06 open RootNotationFixedCuspBranches06 (Eis) def sixPhaseFixedCuspBranch (I F Q:Ideal Eis) (hI:I≠0) (hQ:Q≠0) (K levelBound levelScale:ℝ) (hlevel:0sixPhaseFixedCuspBranch I F Q hI hQ K levelBound (levelScale x) (hlevel x) (hlevelBound x) x.2 (cusp x) (unit x) (phaseArray x) (hphase x) (rowPhase x) (hrow x) weight:=fun x=>rayWeight x*reflectionSixInactiveWeight I F Q x.2 weight_bound:=by intro x rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (hray x)).trans (reflectionSixInactiveWeight_norm_le_one I F Q x.2) end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Cusp.StaticReflectionPhases namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped BigOperators Classical MatrixGroups namespace ShortDraftCusp open ActualEisensteinCubic CubicEisenstein ConcreteTraceCRT lemma A4PhaseFromResidue_norm (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (v:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {ramifiedTraceLambda^3*c0}) (x:_root_.OAI.ActualEisensteinCubic.O) : ‖A4PhaseFromResidue c0 hc0 v x‖=1 := by let:Finite (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {ramifiedTraceLambda^3*c0}):= finite_quotient_span (A4_bad_modulus_ne_zero c0 hc0) unfold A4PhaseFromResidue exact AddChar.norm_apply _ _ end ShortDraftCusp namespace CubicEisenstein open ActualEisensteinCubic CompletedGauss ShortDraftCusp ConcreteTraceCRT lemma sourceFrequencyAngle_norm_le_one (h:_root_.OAI.ActualEisensteinCubic.O) : ‖sourceFrequencyAngle h‖≤1 := by by_cases hh:h=0 · simp only [hh,sourceFrequencyAngle,map_zero,norm_zero,Complex.ofReal_zero,div_zero] norm_num · exact (sourceFrequencyAngle_norm h hh).le namespace FixedCuspShape variable {H:SL(2,_root_.OAI.ActualEisensteinCubic.O)} (s:FixedCuspShape H) def reflectionStaticPhase (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (v:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {ramifiedTraceLambda^3*c0}) (dualNumerator:ℕ→Ideal _root_.OAI.ActualEisensteinCubic.O→Ideal _root_.OAI.ActualEisensteinCubic.O→_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) : ℂ := sourceFrequencyAngle (fixedCuspArrayIndex u m I J)* ShortDraftTrace.breveE (-cuspFrequency (fixedCuspArrayIndex u m I J)* eisEmbedding (s.upper 0 0*s.upper 0 1)/(sourceCuspScale s.index:ℂ))* A4PhaseFromResidue c0 hc0 v (dualNumerator m I J) lemma reflectionStaticPhase_norm_le_one (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (v:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {ramifiedTraceLambda^3*c0}) (dualNumerator:ℕ→Ideal _root_.OAI.ActualEisensteinCubic.O→Ideal _root_.OAI.ActualEisensteinCubic.O→_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) : ‖s.reflectionStaticPhase c0 hc0 v dualNumerator u m I J‖≤1 := by simp only [reflectionStaticPhase,norm_mul,breveE_norm,A4PhaseFromResidue_norm,mul_one] exact sourceFrequencyAngle_norm_le_one _ lemma fixedCuspArrayWithPhase_reflectionStaticPhase (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (v:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {ramifiedTraceLambda^3*c0}) (dualNumerator:ℕ→Ideal _root_.OAI.ActualEisensteinCubic.O→Ideal _root_.OAI.ActualEisensteinCubic.O→_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) : fixedCuspArrayWithPhase s.index u (s.reflectionStaticPhase c0 hc0 v dualNumerator u) m I J= s.amplitude u m I J*A4PhaseFromResidue c0 hc0 v (dualNumerator m I J) := by unfold fixedCuspArrayWithPhase reflectionStaticPhase amplitude ring end FixedCuspShape end CubicEisenstein end open scoped Classical BigOperators namespace CanonicalRowCompletion open ActualEisensteinCubic CanonicalQuadraticSieve CanonicalCoefficientClass def reflectionConductor (q:ℕ) : _root_.OAI.ActualEisensteinCubic.O := (2592*q:ℕ) def reflectionExcludedPrimes (q:ℕ) : Finset (Ideal _root_.OAI.ActualEisensteinCubic.O) := gcdMaskPrimes (Ideal.span {reflectionConductor q}) lemma reflectionConductor_ne_zero (q:ℕ) (hq:q≠0) : reflectionConductor q≠0 := by unfold reflectionConductor exact_mod_cast Nat.mul_ne_zero (by decide : 2592≠0) hq lemma reflectionConductor_ideal (q:ℕ) : Ideal.span {reflectionConductor q}= Ideal.span {(9:_root_.OAI.ActualEisensteinCubic.O)}*(fixedBaseConductor q*Ideal.span {(72:_root_.OAI.ActualEisensteinCubic.O)}) := by rw [fixedBaseConductor_principal,Ideal.span_singleton_mul_span_singleton, Ideal.span_singleton_mul_span_singleton] congr 1 unfold reflectionConductor push_cast ring_nf lemma reflectionExcludedPrimes_bad (q:ℕ) : fixedBadPrimes⊆reflectionExcludedPrimes q := Finset.subset_union_left lemma reflectionExcludedPrimes_prime (q:ℕ) (P:Ideal _root_.OAI.ActualEisensteinCubic.O) (hP:P∈reflectionExcludedPrimes q) : Prime P := by let:P.IsMaximal:=gcdMaskPrimes_maximal _ ⟨P,hP⟩ exact Ideal.prime_of_isPrime (NeZero.ne P) inferInstance lemma reflectionConductor_prime_mem (q:ℕ) (hq:q≠0) (P:Ideal _root_.OAI.ActualEisensteinCubic.O) (hP:Prime P) (hd:P∣Ideal.span {reflectionConductor q}) : P∈reflectionExcludedPrimes q := by apply Finset.mem_union_right apply Multiset.mem_toFinset.mpr apply (Ideal.mem_normalizedFactors_iff (Ideal.span_singleton_eq_bot.not.mpr (reflectionConductor_ne_zero q hq))).mpr exact ⟨Ideal.isPrime_of_prime hP,Ideal.dvd_iff_le.mp hd⟩ lemma reflectionExcludedGenerator_ne_zero (q:ℕ) : excludedGenerator (reflectionExcludedPrimes q)≠0 := by apply ConcretePrimeRowBridge.idealGenerator_ne_zero exact Finset.prod_ne_zero_iff.mpr (fun P hP=>(reflectionExcludedPrimes_prime q P hP).ne_zero) lemma reflectionExcludedGenerator_bad (q:ℕ) : lambda∣excludedGenerator (reflectionExcludedPrimes q) ∧ (2:_root_.OAI.ActualEisensteinCubic.O)∣excludedGenerator (reflectionExcludedPrimes q) := by constructor · apply Ideal.mem_span_singleton.mp exact excludedGenerator_mem _ (reflectionExcludedPrimes_bad q (by simp [fixedBadPrimes])) · apply Ideal.mem_span_singleton.mp exact excludedGenerator_mem _ (reflectionExcludedPrimes_bad q (by simp [fixedBadPrimes])) lemma reflectionLevelBound_ge_one (q:ℕ) (hq:q≠0) : 1≤CubicEisenstein.fixedCuspLevelBound (reflectionConductor q) := CubicEisenstein.fixedCuspLevelBound_ge_one _ (reflectionConductor_ne_zero q hq) end CanonicalRowCompletion open scoped BigOperators Classical namespace CompletedGauss open ActualEisensteinCubic UniqueFactorizationMonoid lemma prime_dvd_rowResidualPart_iff (I Q P:Ideal _root_.OAI.ActualEisensteinCubic.O) (hP:Prime P) : P∣rowResidualPart I Q ↔ P∈normalizedFactors (rowSimplePart I) ∧ ¬P∣Q := by have hm:=UniqueFactorizationMonoid.mem_normalizedFactors_iff (squarefreeResidualPart_ne_zero (rowSimplePart I) Q) (p:=P) simp only [hP,true_and] at hm change P∣squarefreeResidualPart (rowSimplePart I) Q ↔ _ rw [←hm] simp only [normalizedFactors_squarefreeResidualPart,Multiset.mem_filter] end CompletedGauss namespace CanonicalRowCompletion open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve end CanonicalRowCompletion open scoped BigOperators Classical MatrixGroups Matrix namespace ShortDraftCusp section open ActualEisensteinCubic CubicEisenstein CubicKubota CubicJacobiGlobal ConcreteTraceCRT theorem A3_ramified_character_of_relative_level (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) (u q r:_root_.OAI.ActualEisensteinCubic.O) (hG:M*(lowerCuspMatrix u)⁻¹∈levelThree) (ha:lambda^2∣M 0 0-1) (hr:lambda^2∣r-1) (hC:M 1 0=(u*q)*r) : complexCharacter ⟨M*(lowerCuspMatrix u)⁻¹,hG⟩= eisEmbedding (symbol (-u) (M 0 0-u*M 0 1)*symbol q (M 0 0))* eisEmbedding (symbol (M 0 0) r) := by have hA:=levelThree_primary ⟨M*(lowerCuspMatrix u)⁻¹,hG⟩ change lambda^2∣(((M*(lowerCuspMatrix u)⁻¹:SL(2,_root_.OAI.ActualEisensteinCubic.O)):Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O) 0 0)-1 at hA rw [A3_ramified_relative_matrix] at hA have hdet:M 0 0*M 1 1-M 0 1*(u*(q*r))=1 := by have hd:=M.property simp only [Matrix.det_fin_two,hC] at hd linear_combination hd rw [A3_ramified_literal_character,hC,show (u*q)*r=u*(q*r) by ring, A3_ramified_global_factor _ _ _ _ _ _ hdet ha hA hr,map_mul] theorem A3_unramified_character_of_relative_level (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) (u c0 r:_root_.OAI.ActualEisensteinCubic.O) (hG:M*(A3WeylCusp u)⁻¹∈levelThree) (hc:lambda^2∣M 1 0-1) (h9:(9:_root_.OAI.ActualEisensteinCubic.O)∣M 0 0*M 1 1) (hC:M 1 0=c0*r) : complexCharacter ⟨M*(A3WeylCusp u)⁻¹,hG⟩= eisEmbedding (symbol (M 0 0) c0)*eisEmbedding (symbol (M 0 0) r) := by have hb:=levelThree_primary ⟨M*(A3WeylCusp u)⁻¹,hG⟩ change lambda^2∣(((M*(A3WeylCusp u)⁻¹:SL(2,_root_.OAI.ActualEisensteinCubic.O)):Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O) 0 0)-1 at hb rw [A3_unramified_relative_matrix] at hb have hdet:M 0 0*M 1 1-M 0 1*(c0*r)=1 := by simpa only [Matrix.det_fin_two,hC] using M.property rw [hC] at hc rw [A3_unramified_literal_character,A3_unramified_global_factor _ _ _ _ _ hdet hb hc h9,map_mul] end section open ActualEisensteinCubic CubicEisenstein ConcreteTraceCRT FiniteGaussPhase open CompletedGauss CubicKubota CubicJacobiGlobal LocalReflectionBrackets noncomputable abbrev stratumMultiplierField (P:Ideal _root_.OAI.ActualEisensteinCubic.O) [P.IsMaximal] : Field (_root_.OAI.ActualEisensteinCubic.O⧸P) := Ideal.Quotient.field P noncomputable abbrev stratumMultiplierFintype (P:Ideal _root_.OAI.ActualEisensteinCubic.O) [P.IsMaximal] : Fintype (_root_.OAI.ActualEisensteinCubic.O⧸P) := Fintype.ofFinite _ theorem stratum_multiplier_of_cubic_factor {ι:Type*} [Fintype ι] (p:ι→_root_.OAI.ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (hchar:∀i,ringChar (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (c0 U w x d0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (hbez:U*(∏i,p i)+(ramifiedTraceLambda^3*w)*c0=1) (a b d:(∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ)→_root_.OAI.ActualEisensteinCubic.O) (κ:(∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ)→ℂ) (κ0:ℂ) (hκ:∀v,κ v=κ0*eisEmbedding (symbol (a v) (∏i,p i))) (hdet:∀v,a v*d v-b v*(c0*∏i,p i)=1) (hD:∀v,ramifiedTraceLambda^3*c0∣d v-d0) (σ ε:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) (hfreq:∀v i,Ideal.Quotient.mk (Ideal.span {p i}) (a v)= (σ i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*(v i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})) (hε:∀i,Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^3*c0*cofactor p i)*(σ i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*(ε i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})=-1) (j:ι→ℕ) (hj:∀i,j i<6) : letI explicitFieldWitness := @OAI.ShortDraftCusp.stratumMultiplierField letI explicitFintypeWitness := @OAI.ShortDraftCusp.stratumMultiplierFintype (∑v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ, (∏i,finiteAdditiveFourierCoeff (quotientTrace (p i) (hp i)) (fun t=>(actualSextic (Ideal.span {p i}) (hg i)^j i) t) (v i))* star (κ v)*ShortDraftTrace.breveE (-(eisEmbedding (d v)*(eisEmbedding x/eisLam^4))/ (eisEmbedding c0*eisEmbedding (∏i,p i)))) = (star κ0*A4BadPhase c0 hc0 d0 U x)* ∏i,(((actualSextic (Ideal.span {p i}) (hg i))⁻¹)^2) (σ i)* phase (actualSextic (Ideal.span {p i}) (hg i)) (quotientTrace (p i) (hp i)) (j i) (ε i)* bracket (actualSextic (Ideal.span {p i}) (hg i)) (j i) (Ideal.Quotient.mk _ x) := by letI explicitFieldWitness := @OAI.ShortDraftCusp.stratumMultiplierField letI explicitFintypeWitness := @OAI.ShortDraftCusp.stratumMultiplierFintype exact ( by let C:=star κ0*A4BadPhase c0 hc0 d0 U x let f:=fun i (v:(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ)=>frequencyRow (actualSextic (Ideal.span {p i}) (hg i)) (quotientTrace (p i) (hp i)) (j i) (σ i) (ε i) (Ideal.Quotient.mk _ x) v have hpoint (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : star (κ v)*ShortDraftTrace.breveE (-(eisEmbedding (d v)*(eisEmbedding x/eisLam^4))/ (eisEmbedding c0*eisEmbedding (∏i,p i)))= C*∏i,frequencyMultiplier (actualSextic (Ideal.span {p i}) (hg i)) (quotientTrace (p i) (hp i)) (σ i) (ε i) (Ideal.Quotient.mk _ x) (v i) := by have hbad:A4BadPhase c0 hc0 (d v) U x=A4BadPhase c0 hc0 d0 U x := by apply A4BadPhase_eq_of_residue convert dvd_mul_of_dvd_left (hD v) U using 1 ; ring have hlocal:=A3_A4_frequency_product p hp hcop hg (a v) (b v) c0 (d v) U w x hc0 (hdet v) hbez σ ε (fun i=>(v i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})) (hfreq v) hε rw [hκ,star_mul] calc _=star κ0*(star (eisEmbedding (symbol (a v) (∏i,p i)))* ShortDraftTrace.breveE (-(eisEmbedding (d v)*(eisEmbedding x/eisLam^4))/ (eisEmbedding c0*eisEmbedding (∏i,p i)))) := by ring _=_ := by rw [hlocal,hbad];dsimp only [C];ring calc _=C*∑v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ,∏i,f i (v i) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro v hv rw [mul_assoc,hpoint] simp only [f,frequencyRow,Finset.prod_mul_distrib] ring _=C*∏i,∑v:(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ,f i v := by rw [Fintype.prod_sum] _=_ := by congr 1 apply Finset.prod_congr rfl intro i hi exact canonical_frequencyRow_units (Ideal.span {p i}) (hg i) (hchar i) (quotientTrace (p i) (hp i)) (GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive (p i) (hp i)) (j i) (hj i) (σ i) (ε i) _ ) end open ActualEisensteinCubic CubicEisenstein CubicKubota CubicJacobiGlobal ConcreteTraceCRT lemma A3_ramified_relative_primary (M:SL(2,_root_.OAI.ActualEisensteinCubic.O)) (u:_root_.OAI.ActualEisensteinCubic.O) (hG:M*(lowerCuspMatrix u)⁻¹∈levelThree) : lambda^2∣(M 0 0-u*M 0 1)-1 := by have hA:=levelThree_primary ⟨M*(lowerCuspMatrix u)⁻¹,hG⟩ change lambda^2∣(((M*(lowerCuspMatrix u)⁻¹:SL(2,_root_.OAI.ActualEisensteinCubic.O)):Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O) 0 0)-1 at hA rw [A3_ramified_relative_matrix] at hA exact hA theorem A3_ramified_fixed_sector_character (M M0:SL(2,_root_.OAI.ActualEisensteinCubic.O)) (N u q r:_root_.OAI.ActualEisensteinCubic.O) (hG:M*(lowerCuspMatrix u)⁻¹∈levelThree) (hG0:M0*(lowerCuspMatrix u)⁻¹∈levelThree) (ha:lambda^2∣M 0 0-1) (ha0:lambda^2∣M0 0 0-1) (hr:lambda^2∣r-1) (hC:M 1 0=(u*q)*r) (h9N:(9:_root_.OAI.ActualEisensteinCubic.O)∣N) (hqN:q∣N) (huN:u∣N) (hA:N∣M 0 0-M0 0 0) (hB:N∣M 0 1-M0 0 1) : complexCharacter ⟨M*(lowerCuspMatrix u)⁻¹,hG⟩= eisEmbedding (symbol (-u) (M0 0 0-u*M0 0 1)*symbol q (M0 0 0))* eisEmbedding (symbol (M 0 0) r) := by rw [A3_ramified_character_of_relative_level M u q r hG ha hr hC] rw [A3_ramified_fixed_factor_congr N q u (M 0 0) (M0 0 0) (M 0 1) (M0 0 1) h9N hqN huN ha ha0 (A3_ramified_relative_primary M u hG) (A3_ramified_relative_primary M0 u hG0) hA hB] theorem A3_unramified_fixed_sector_character (M M0:SL(2,_root_.OAI.ActualEisensteinCubic.O)) (u c0 r:_root_.OAI.ActualEisensteinCubic.O) (hG:M*(A3WeylCusp u)⁻¹∈levelThree) (hc:lambda^2∣M 1 0-1) (h9:(9:_root_.OAI.ActualEisensteinCubic.O)∣M 0 0*M 1 1) (hC:M 1 0=c0*r) (hA:c0∣M 0 0-M0 0 0) : complexCharacter ⟨M*(A3WeylCusp u)⁻¹,hG⟩= eisEmbedding (symbol (M0 0 0) c0)*eisEmbedding (symbol (M 0 0) r) := by rw [A3_unramified_character_of_relative_level M u c0 r hG hc h9 hC, symbol_congr hA] end ShortDraftCusp namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss CubicKubota open CubicJacobiGlobal ShortDraftCusp ShortDraftCRT FiniteGaussPhase structure ControlledStratumArithmetic {ι:Type*} [Fintype ι] (p:ι→_root_.OAI.ActualEisensteinCubic.O) (N a0 c0:_root_.OAI.ActualEisensteinCubic.O) (numeratorMode:Bool) where lift : (∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ)→ι→_root_.OAI.ActualEisensteinCubic.O lift_period : ∀v i,N^2∣lift v i lift_residue : ∀v i,Ideal.Quotient.mk (Ideal.span {p i}) (lift v i)=(v i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) U : _root_.OAI.ActualEisensteinCubic.O w : _root_.OAI.ActualEisensteinCubic.O bezout : U*(∏i,p i)+(ramifiedTraceLambda^3*w)*c0=1 sigma : ∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ epsilon : ∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ sigma_value : ∀i,(sigma i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})= Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^2*c0*cofactor p i) epsilon_value : ∀i,Ideal.Quotient.mk (Ideal.span {p i}) (ramifiedTraceLambda^3*c0*cofactor p i)* (sigma i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*(epsilon i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})=-1 matrix : (∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ)→SL(2,_root_.OAI.ActualEisensteinCubic.O) numerator : ∀v,matrix v 0 0=finiteCrossNumerator a0 c0 ramifiedTraceLambda p (lift v) denominator : ∀v,matrix v 1 0=c0*∏i,p i matrix_fixed : ∀v i j,N∣matrix v i j-matrix (fun _=>1) i j conditions : ∀v,if numeratorMode then (9:_root_.OAI.ActualEisensteinCubic.O)∣matrix v 0 1 ∧ (3:_root_.OAI.ActualEisensteinCubic.O)∣matrix v 1 1-1 else (3:_root_.OAI.ActualEisensteinCubic.O)∣matrix v 0 1+1 ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣matrix v 1 1 theorem exists_controlledStratumArithmetic {ι:Type*} [Fintype ι] (p:ι→_root_.OAI.ActualEisensteinCubic.O) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hprimary:∀i,lambda^2∣p i-1) (N a0 c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (hN:(9:_root_.OAI.ActualEisensteinCubic.O)*c0∣N) (mode:Bool) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (hac:IsCoprime a0 c0) (hNp:∀i,IsCoprime N (p i)) : Nonempty (ControlledStratumArithmetic p N a0 c0 mode) := by have h9N:(9:_root_.OAI.ActualEisensteinCubic.O)∣N:=(dvd_mul_right 9 c0).trans hN have hcN:c0∣N:=(dvd_mul_left c0 9).trans hN have hD9:ramifiedTraceLambda^3*c0∣(9:_root_.OAI.ActualEisensteinCubic.O)*c0 := by refine ⟨ramifiedTraceLambda,?_⟩ rw [←A4_traceLambda_pow_four] ring have hDN:ramifiedTraceLambda^3*c0∣N:=hD9.trans hN have hl9:ramifiedTraceLambda∣(9:_root_.OAI.ActualEisensteinCubic.O) := by rw [←A4_traceLambda_pow_four] exact dvd_pow_self _ (by decide) have hlN:ramifiedTraceLambda∣N:=hl9.trans h9N have hstdN:lambda^2∣N:=lambda_sq_dvd_three.trans ((show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans h9N) let r:_root_.OAI.ActualEisensteinCubic.O:=∏i,p i have hr:lambda^2∣r-1:=primary_finset_product Finset.univ p (fun i _=>hprimary i) have hNr:IsCoprime N r:=IsCoprime.prod_right (fun i _=>hNp i) have hrNc:IsCoprime r (N*c0):=hNr.symm.mul_right (hNr.symm.of_isCoprime_of_dvd_right hcN) obtain ⟨U,w,huw⟩:=hNr.symm.of_isCoprime_of_dvd_right hDN have hbez:U*r+(ramifiedTraceLambda^3*w)*c0=1 := by linear_combination huw obtain ⟨σ,ε,hσ,hε⟩:=exists_A4_local_units p hp hcop c0 U w hbez have hlf (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ):=exists_strong_unit_frequency_lifts N p hNp v choose lift hlift hres hlcop using hlf let a:=fun v=>finiteCrossNumerator a0 c0 ramifiedTraceLambda p (lift v) have hap (ha0:lambda^2∣a0-1):∀v,lambda^2∣a v-1 := by intro v have hfixed:N∣a v-a0*r:=finiteCrossNumerator_fixed N a0 c0 ramifiedTraceLambda p (lift v) (fun i=>(dvd_pow_self N (by decide : (2:ℕ)≠0)).trans (hlift v i)) have hbas:=primary_mul a0 r ha0 hr convert dvd_add (hstdN.trans hfixed) hbas using 1 ; ring have hpairs:Pairwise (Function.onFun IsCoprime p):=by intro i k hik exact (Ideal.isCoprime_span_singleton_iff _ _).mp (hcop hik) have hacop:∀v,IsCoprime (a v) (c0*r) := by intro v exact finiteCrossNumerator_coprime a0 c0 ramifiedTraceLambda p (lift v) hac hpairs (fun i=>(hNp i).of_isCoprime_of_dvd_left hcN) (fun i=>(hNp i).of_isCoprime_of_dvd_left hlN) (hlcop v) have hfixed:∀v z,(fun (_:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ)=>()) v=()→N*c0∣a v-a z := by intro v z _ exact finiteCrossNumerator_fixed_sector N a0 c0 ramifiedTraceLambda p (lift v) p (lift z) hcN (hlift v) (hlift z) (by simp) have hcompletes:∃(b d:(∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ)→_root_.OAI.ActualEisensteinCubic.O) (C:Matrix (Fin 2) (Fin 2) (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {N})), (∀v,a v*d v-b v*(c0*r)=1) ∧ (∀v,if mode then (9:_root_.OAI.ActualEisensteinCubic.O)∣b v ∧ (3:_root_.OAI.ActualEisensteinCubic.O)∣d v-1 else (3:_root_.OAI.ActualEisensteinCubic.O)∣b v+1 ∧ (9:_root_.OAI.ActualEisensteinCubic.O)∣d v) ∧ ∀v,(!![a v,b v;c0*r,d v]:Matrix (Fin 2) (Fin 2) _root_.OAI.ActualEisensteinCubic.O).map (Ideal.Quotient.mk (Ideal.span {N}))=C := by cases mode · obtain ⟨b,d,C,hd,hb,hz,hm⟩:=exists_primary_denominator_sector_completions N c0 h9N hbase (fun (_:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ)=>()) a (fun _=>r) (fun _=>hr) hacop (fun _=>hrNc) (fun v z _=>hfixed v z rfl) (fun _ _ _=>by simp) exact ⟨b,d,C (),hd,fun v=>⟨hb v,hz v⟩,hm⟩ · obtain ⟨b,d,C,hd,hb,hz,hm⟩:=exists_primary_numerator_sector_completions N c0 hc0 h9N (fun (_:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ)=>()) a (fun _=>r) (hap hbase) (fun _=>hr) hacop (fun _=>hrNc) (fun v z _=>hfixed v z rfl) (fun _ _ _=>by simp) exact ⟨b,d,C (),hd,fun v=>⟨hb v,hz v⟩,hm⟩ obtain ⟨b,d,C,hdet,hconditions,hmat⟩:=hcompletes let mat:=fun v=>controlledCompletionMatrix (a v) (b v) (c0*r) (d v) (hdet v) have hentry (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) (i j:Fin 2): N∣(mat v) i j-(mat (fun _=>1)) i j := by have he:=congrArg (fun T:Matrix (Fin 2) (Fin 2) (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {N})=>T i j) ((hmat v).trans (hmat (fun _=>1)).symm) change Ideal.Quotient.mk (Ideal.span {N}) ((mat v) i j)= Ideal.Quotient.mk (Ideal.span {N}) ((mat (fun _=>1)) i j) at he exact Ideal.mem_span_singleton.mp (Ideal.Quotient.eq.mp he) exact ⟨{ lift := lift lift_period := hlift lift_residue := hres U := U w := w bezout := hbez sigma := σ epsilon := ε sigma_value := hσ epsilon_value := hε matrix := mat numerator := fun _=>rfl denominator := fun _=>rfl matrix_fixed := hentry conditions := hconditions }⟩ end open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss CubicKubota open CubicJacobiGlobal ShortDraftCusp ShortDraftCRT FiniteGaussPhase namespace ControlledStratumArithmetic variable {ι:Type*} [Fintype ι] {p:ι→_root_.OAI.ActualEisensteinCubic.O} {N a0 c0:_root_.OAI.ActualEisensteinCubic.O} {mode:Bool} lemma _root_.OAI.CubicEisenstein.ControlledStratumArithmetic.frequency_congruence (D:ControlledStratumArithmetic p N a0 c0 mode) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) (i:ι) : Ideal.Quotient.mk (Ideal.span {p i}) (D.matrix v 0 0)= (D.sigma i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})*(v i:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := by rw [D.numerator,finiteCrossNumerator_local,D.sigma_value,D.lift_residue] lemma numerator_congruence (D:ControlledStratumArithmetic p N a0 c0 mode) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : N∣D.matrix v 0 0-a0*∏i,p i := by rw [D.numerator] exact finiteCrossNumerator_fixed N a0 c0 ramifiedTraceLambda p (D.lift v) (fun i=>(dvd_pow_self N (by decide : (2:ℕ)≠0)).trans (D.lift_period v i)) lemma numerator_mod_three (D:ControlledStratumArithmetic p N a0 c0 mode) (h3N:(3:_root_.OAI.ActualEisensteinCubic.O)∣N) (hr:lambda^2∣(∏i,p i)-1) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : (3:_root_.OAI.ActualEisensteinCubic.O)∣D.matrix v 0 0-a0 := by have hprod:=three_dvd_primary_sub_one (∏i,p i) hr convert dvd_add (h3N.trans (D.numerator_congruence v)) (dvd_mul_of_dvd_right hprod a0) using 1 ; ring lemma numerator_primary (D:ControlledStratumArithmetic p N a0 c0 mode) (h3N:(3:_root_.OAI.ActualEisensteinCubic.O)∣N) (hr:lambda^2∣(∏i,p i)-1) (ha:lambda^2∣a0-1) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : lambda^2∣D.matrix v 0 0-1 := by convert dvd_add (lambda_sq_dvd_three.trans (D.numerator_mod_three h3N hr v)) ha using 1 ; ring lemma denominator_primary (D:ControlledStratumArithmetic p N a0 c0 mode) (hr:lambda^2∣(∏i,p i)-1) (hc:lambda^2∣c0-1) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : lambda^2∣D.matrix v 1 0-1 := by rw [D.denominator] exact primary_mul c0 (∏i,p i) hc hr lemma ramified_relative (D:ControlledStratumArithmetic p N a0 c0 true) (h3N:(3:_root_.OAI.ActualEisensteinCubic.O)∣N) (hr:lambda^2∣(∏i,p i)-1) (ha:lambda^2∣a0-1) (u:_root_.OAI.ActualEisensteinCubic.O) (hcu:(3:_root_.OAI.ActualEisensteinCubic.O)∣c0-u) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : D.matrix v*(lowerCuspMatrix u)⁻¹∈levelThree := by have hcond := D.conditions v simp only [ ↓reduceIte] at hcond apply A3_ramified_mem_levelThree · exact three_dvd_primary_sub_one _ (D.numerator_primary h3N hr ha v) · exact (show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans hcond.1 · rw [D.denominator] have hprod:=three_dvd_primary_sub_one (∏i,p i) hr convert dvd_add (dvd_mul_of_dvd_right hprod c0) hcu using 1 ; ring · exact hcond.2 lemma unramified_relative (D:ControlledStratumArithmetic p N a0 c0 false) (h3N:(3:_root_.OAI.ActualEisensteinCubic.O)∣N) (hr:lambda^2∣(∏i,p i)-1) (hc:lambda^2∣c0-1) (u:_root_.OAI.ActualEisensteinCubic.O) (hau:(3:_root_.OAI.ActualEisensteinCubic.O)∣a0-u) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : D.matrix v*(A3WeylCusp u)⁻¹∈levelThree := by have hcond := D.conditions v simp only [Bool.false_eq_true, ↓reduceIte] at hcond apply A3_unramified_mem_levelThree · convert dvd_add (D.numerator_mod_three h3N hr v) hau using 1 ; ring · exact hcond.1 · exact three_dvd_primary_sub_one _ (D.denominator_primary hr hc v) · exact (show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans hcond.2 lemma inverse_fixed (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:_root_.OAI.ActualEisensteinCubic.O)*c0∣N) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : ramifiedTraceLambda^3*c0∣D.matrix v 1 1-D.matrix (fun _=>1) 1 1 := by have hD9:ramifiedTraceLambda^3*c0∣(9:_root_.OAI.ActualEisensteinCubic.O)*c0 := by refine ⟨ramifiedTraceLambda,?_⟩ rw [←A4_traceLambda_pow_four] ring exact (hD9.trans hN).trans (D.matrix_fixed v 1 1) lemma _root_.OAI.CubicEisenstein.ControlledStratumArithmetic.determinant (D:ControlledStratumArithmetic p N a0 c0 mode) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : D.matrix v 0 0*D.matrix v 1 1-D.matrix v 0 1*(c0*∏i,p i)=1 := by simpa only [Matrix.det_fin_two,D.denominator] using (D.matrix v).property def ramifiedFixedFactor (D:ControlledStratumArithmetic p N a0 c0 true) (u q:_root_.OAI.ActualEisensteinCubic.O) : ℂ := eisEmbedding (symbol (-u) (D.matrix (fun _=>1) 0 0-u*D.matrix (fun _=>1) 0 1)* symbol q (D.matrix (fun _=>1) 0 0)) def unramifiedFixedFactor (D:ControlledStratumArithmetic p N a0 c0 false) : ℂ := eisEmbedding (symbol (D.matrix (fun _=>1) 0 0) c0) theorem ramified_character (D:ControlledStratumArithmetic p N a0 c0 true) (hN:(9:_root_.OAI.ActualEisensteinCubic.O)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (ha:lambda^2∣a0-1) (u q:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0=u*q) (hcu:(3:_root_.OAI.ActualEisensteinCubic.O)∣c0-u) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : complexCharacter ⟨D.matrix v*(lowerCuspMatrix u)⁻¹, D.ramified_relative ((show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans ((dvd_mul_right 9 c0).trans hN)) hr ha u hcu v⟩= D.ramifiedFixedFactor u q*eisEmbedding (symbol (D.matrix v 0 0) (∏i,p i)) := by have h9N:(9:_root_.OAI.ActualEisensteinCubic.O)∣N:=(dvd_mul_right 9 c0).trans hN have h3N:(3:_root_.OAI.ActualEisensteinCubic.O)∣N:=(show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans h9N have hcN:c0∣N:=(dvd_mul_left c0 9).trans hN exact A3_ramified_fixed_sector_character (D.matrix v) (D.matrix (fun _=>1)) N u q (∏i,p i) (D.ramified_relative h3N hr ha u hcu v) (D.ramified_relative h3N hr ha u hcu (fun _=>1)) (D.numerator_primary h3N hr ha v) (D.numerator_primary h3N hr ha (fun _=>1)) hr (by rw [D.denominator,hc0]) h9N ((hc0 ▸ dvd_mul_left q u).trans hcN) ((hc0 ▸ dvd_mul_right u q).trans hcN) (D.matrix_fixed v 0 0) (D.matrix_fixed v 0 1) theorem unramified_character (D:ControlledStratumArithmetic p N a0 c0 false) (hN:(9:_root_.OAI.ActualEisensteinCubic.O)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hc:lambda^2∣c0-1) (u:_root_.OAI.ActualEisensteinCubic.O) (hau:(3:_root_.OAI.ActualEisensteinCubic.O)∣a0-u) (v:∀i,(_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})ˣ) : complexCharacter ⟨D.matrix v*(A3WeylCusp u)⁻¹, D.unramified_relative ((show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans ((dvd_mul_right 9 c0).trans hN)) hr hc u hau v⟩= D.unramifiedFixedFactor*eisEmbedding (symbol (D.matrix v 0 0) (∏i,p i)) := by have h9N:(9:_root_.OAI.ActualEisensteinCubic.O)∣N:=(dvd_mul_right 9 c0).trans hN have h3N:(3:_root_.OAI.ActualEisensteinCubic.O)∣N:=(show (3:_root_.OAI.ActualEisensteinCubic.O)∣9 from ⟨3,by norm_num⟩).trans h9N have hcond:=D.conditions v simp only [Bool.false_eq_true, ↓reduceIte] at hcond exact A3_unramified_fixed_sector_character (D.matrix v) (D.matrix (fun _=>1)) u c0 (∏i,p i) (D.unramified_relative h3N hr hc u hau v) (D.denominator_primary hr hc v) (dvd_mul_of_dvd_right hcond.2 _) (D.denominator v) (((dvd_mul_left c0 9).trans hN).trans (D.matrix_fixed v 0 0)) end ControlledStratumArithmetic end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.FixedFrequencyExpansion namespace OAI abbrev fixedFrequencyEis := ActualEisensteinCubic.O noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicEisenstein section open scoped BigOperators Classical MatrixGroups Matrix open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss CubicKubota open CubicJacobiGlobal ShortDraftCusp ShortDraftCRT FiniteGaussPhase LocalReflectionBrackets namespace ControlledStratumArithmetic variable {ι:Type*} [Fintype ι] {p:ι→fixedFrequencyEis} {N a0 c0:fixedFrequencyEis} {mode:Bool} def fixedCusp (a0 c0:fixedFrequencyEis) (mode:Bool) : SL(2,fixedFrequencyEis) := if mode then lowerCuspMatrix c0 else A3WeylCusp a0 lemma relative (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ) : D.matrix v*(fixedCusp a0 c0 mode)⁻¹∈levelThree := by have h3N:(3:fixedFrequencyEis)∣N:=(show (3:fixedFrequencyEis)∣9 from ⟨3,by norm_num⟩).trans ((dvd_mul_right 9 c0).trans hN) cases mode · exact D.unramified_relative h3N hr hbase a0 (by simp) v · exact D.ramified_relative h3N hr hbase c0 (by simp) v def relativeGamma (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ) : levelThree := ⟨D.matrix v*(fixedCusp a0 c0 mode)⁻¹,D.relative hN hr hbase v⟩ lemma relativeGamma_mul (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ) : (D.relativeGamma hN hr hbase v:SL(2,fixedFrequencyEis))*fixedCusp a0 c0 mode=D.matrix v := by exact inv_mul_cancel_right (D.matrix v) (fixedCusp a0 c0 mode) def fixedFactor (D:ControlledStratumArithmetic p N a0 c0 mode) : ℂ := if mode then eisEmbedding (symbol (-c0) (D.matrix (fun _=>1) 0 0-c0*D.matrix (fun _=>1) 0 1)* symbol 1 (D.matrix (fun _=>1) 0 0)) else eisEmbedding (symbol (D.matrix (fun _=>1) 0 0) c0) theorem relative_character (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ) : complexCharacter (D.relativeGamma hN hr hbase v)= D.fixedFactor*eisEmbedding (symbol (D.matrix v 0 0) (∏i,p i)) := by cases mode · simpa only [relativeGamma,fixedCusp,fixedFactor,Bool.false_eq_true,↓reduceIte, unramifiedFixedFactor] using D.unramified_character hN hr hbase a0 (by simp) v · simpa only [relativeGamma,fixedCusp,fixedFactor,Bool.true_eq,↓reduceIte, ramifiedFixedFactor] using D.ramified_character hN hr hbase c0 1 (by simp) (by simp) v theorem fixedFactor_norm (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) : ‖D.fixedFactor‖=1 := by have h3N:(3:fixedFrequencyEis)∣N:=(show (3:fixedFrequencyEis)∣9 from ⟨3,by norm_num⟩).trans ((dvd_mul_right 9 c0).trans hN) cases mode · exact norm_A3_unramified_fixed_factor _ _ _ _ _ (D.determinant (fun _=>1)) hbase · apply norm_A3_ramified_fixed_factor _ _ 1 (∏i,p i) _ c0 · simpa only [one_mul] using D.determinant (fun _=>1) · exact D.numerator_primary h3N hr hbase (fun _=>1) · exact A3_ramified_relative_primary (D.matrix (fun _=>1)) c0 (D.ramified_relative h3N hr hbase c0 (by simp) (fun _=>1)) noncomputable def fourierWeight [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ) : ℂ := by letI (i:ι):Fintype (fixedFrequencyEis⧸Ideal.span {p i}):=Fintype.ofFinite _ exact ∏i,finiteAdditiveFourierCoeff (quotientTrace (p i) (hp i)) (fun t=>(actualSextic (Ideal.span {p i}) (hg i)^j i) t) (v i) noncomputable def multiplierSum (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (x:fixedFrequencyEis) : ℂ := by letI (i:ι):Fintype (fixedFrequencyEis⧸Ideal.span {p i}):=Fintype.ofFinite _ exact ∑v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ, fourierWeight hp hg j v*star (complexCharacter (D.relativeGamma hN hr hbase v))* ShortDraftTrace.breveE (-(eisEmbedding (D.matrix v 1 1)*(eisEmbedding x/eisLam^4))/ (eisEmbedding c0*eisEmbedding (∏i,p i))) noncomputable def bracketProduct (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (x:fixedFrequencyEis) : ℂ := by letI (i:ι):Field (fixedFrequencyEis⧸Ideal.span {p i}):=Ideal.Quotient.field _ letI (i:ι):Fintype (fixedFrequencyEis⧸Ideal.span {p i}):=Fintype.ofFinite _ exact ∏i,(((actualSextic (Ideal.span {p i}) (hg i))⁻¹)^2) (D.sigma i)* phase (actualSextic (Ideal.span {p i}) (hg i)) (quotientTrace (p i) (hp i)) (j i) (D.epsilon i)* bracket (actualSextic (Ideal.span {p i}) (hg i)) (j i) (Ideal.Quotient.mk _ x) theorem multiplierSum_eq (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (hp:∀i,p i≠0) (hc0:c0≠0) (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (hchar:∀i,ringChar (fixedFrequencyEis⧸Ideal.span {p i})≠2) (j:ι→ℕ) (hj:∀i,j i<6) (x:fixedFrequencyEis) : D.multiplierSum hN hr hbase hp hg j x= (star D.fixedFactor*A4BadPhase c0 hc0 (D.matrix (fun _=>1) 1 1) D.U x)* D.bracketProduct hp hg j x := by exact stratum_multiplier_of_cubic_factor p hp hcop hg hchar c0 D.U D.w x (D.matrix (fun _=>1) 1 1) hc0 D.bezout (fun v=>D.matrix v 0 0) (fun v=>D.matrix v 0 1) (fun v=>D.matrix v 1 1) (fun v=>complexCharacter (D.relativeGamma hN hr hbase v)) D.fixedFactor (D.relative_character hN hr hbase) D.determinant (D.inverse_fixed hN) D.sigma D.epsilon D.frequency_congruence D.epsilon_value j hj end ControlledStratumArithmetic end section open scoped BigOperators Classical ContDiff MatrixGroups Matrix open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss CompletedDyadic CubicKubota open CubicJacobiGlobal ShortDraftCusp ShortDraftCRT FiniteGaussPhase LocalReflectionBrackets namespace ControlledStratumArithmetic variable {ι:Type*} [Fintype ι] {p:ι→fixedFrequencyEis} {N a0 c0:fixedFrequencyEis} {mode:Bool} def sourceGamma (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ) : levelTwo := sourceLevelInclusion (D.relativeGamma hN hr hbase v) lemma sourceGamma_mul (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ) : (D.sourceGamma hN hr hbase v:SL(2,fixedFrequencyEis))*fixedCusp a0 c0 mode=D.matrix v := D.relativeGamma_mul hN hr hbase v lemma sourceGamma_character (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ) : levelTwoComplexCharacter (D.sourceGamma hN hr hbase v)= complexCharacter (D.relativeGamma hN hr hbase v) := sourceLevelInclusion_character _ def datum (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (s:FixedCuspShape (fixedCusp a0 c0 mode)) (hp:∀i,p i≠0) (hc0:c0≠0) (v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ) : SourceCuspDatum := s.datum (D.sourceGamma hN hr hbase v) (by rw [D.sourceGamma_mul,D.denominator] exact mul_ne_zero hc0 (Finset.prod_ne_zero_iff.mpr (fun i _=>hp i))) lemma _root_.OAI.CubicEisenstein.ControlledStratumArithmetic.datum_point (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (s:FixedCuspShape (fixedCusp a0 c0 mode)) (hp:∀i,p i≠0) (hc0:c0≠0) (v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ) : (D.datum hN hr hbase s hp hc0 v).point=eisEmbedding a0/eisEmbedding c0+ eisLam^2*∑i,eisEmbedding (D.lift v i)/eisEmbedding (p i) := by rw [datum,s.datum_point,D.sourceGamma_mul,D.numerator,D.denominator] simpa only [ramifiedEmbedding_traceLambda] using finiteCrossNumerator_fraction a0 c0 ramifiedTraceLambda p (D.lift v) hc0 hp noncomputable def smoothedValue (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (s:FixedCuspShape (fixedCusp a0 c0 mode)) (hp:∀i,p i≠0) (hc0:c0≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (W:ℝ→ℂ) (X:ℝ) : ℂ := by letI (i:ι):Fintype (fixedFrequencyEis⧸Ideal.span {p i}):=Fintype.ofFinite _ exact ∑v:∀i,(fixedFrequencyEis⧸Ideal.span {p i})ˣ,fourierWeight hp hg j v* (D.datum hN hr hbase s hp hc0 v).smoothedKernel W X noncomputable def reflectedValue (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (s:FixedCuspShape (fixedCusp a0 c0 mode)) (hp:∀i,p i≠0) (hc0:c0≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (W:ℝ→ℂ) (X:ℝ) : ℂ := fixedRadialCoefficientScalar*s.stratumShapeFactor (c0*∏i,p i)* ∑'t:ThetaFullIndex, (s.amplitude t.1 t.2.1 t.2.2.1.val t.2.2.2.val / ((ramifiedScale 1 completedRamifiedStep t.2.1* Real.sqrt (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ):ℝ):ℂ))* CubicReflectionKernel.paperKernel (Vstar W) ((X/(27*(sourceCuspScale s.index)^2*(Ideal.absNorm (Ideal.span {c0*∏i,p i}):ℝ)^2))* (ramifiedScale 1 completedRamifiedStep t.2.1)^3* (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ)^3)* ((star D.fixedFactor*A4BadPhase c0 hc0 (D.matrix (fun _=>1) 1 1) D.U (sourceCuspPhaseNumerator s.index (s.upper 0 0) (thetaFullFrequency t)))* D.bracketProduct hp hg j (sourceCuspPhaseNumerator s.index (s.upper 0 0) (thetaFullFrequency t))) theorem _root_.OAI.CubicEisenstein.ControlledStratumArithmetic.smoothed_eq_reflected (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (hN:(9:fixedFrequencyEis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (s:FixedCuspShape (fixedCusp a0 c0 mode)) (hp:∀i,p i≠0) (hc0:c0≠0) (hcop:Pairwise (Function.onFun IsCoprime (fun i=>Ideal.span {p i}))) (hg:∀i,lambda∉Ideal.span {p i}) (hchar:∀i,ringChar (fixedFrequencyEis⧸Ideal.span {p i})≠2) (j:ι→ℕ) (hj:∀i,j i<6) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0hp i)) have hC:∀v,((D.sourceGamma hN hr hbase v:SL(2,fixedFrequencyEis))*fixedCusp a0 c0 mode) 1 0=c0*∏i,p i := by intro v rw [D.sourceGamma_mul,D.denominator] have he:=s.sum_smoothedKernel_integral_phase (D.sourceGamma hN hr hbase) _ hc hC (fourierWeight hp hg j) W lo hi hlo hsupp hW X hX change D.smoothedValue hN hr hbase s hp hc0 hg j W X=_ at he rw [he] unfold reflectedValue apply congrArg (fun z:ℂ=>fixedRadialCoefficientScalar*s.stratumShapeFactor (c0*∏i,p i)*z) apply tsum_congr intro t apply congrArg (fun z:ℂ=> (s.amplitude t.1 t.2.1 t.2.2.1.val t.2.2.2.val / ((ramifiedScale 1 completedRamifiedStep t.2.1* Real.sqrt (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ):ℝ):ℂ))* CubicReflectionKernel.paperKernel (Vstar W) ((X/(27*(sourceCuspScale s.index)^2*(Ideal.absNorm (Ideal.span {c0*∏i,p i}):ℝ)^2))* (ramifiedScale 1 completedRamifiedStep t.2.1)^3* (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ)^3)*z) simpa only [multiplierSum,D.sourceGamma_character,D.sourceGamma_mul,map_mul] using D.multiplierSum_eq hN hr hbase hp hc0 hcop hg hchar j hj (sourceCuspPhaseNumerator s.index (s.upper 0 0) (thetaFullFrequency t)) end ControlledStratumArithmetic end section open scoped Classical BigOperators MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss ShortDraftCusp structure FixedFourierGeometry (c:fixedFrequencyEis) (h:fixedFrequencyEis⧸Ideal.span {c}) where a0 : fixedFrequencyEis c0 : fixedFrequencyEis denominator_ne_zero : c0≠0 denominator_dvd : c0∣c coprime : IsCoprime a0 c0 point : eisEmbedding a0/eisEmbedding c0=thetaFourierTranslation c h mode : Bool primary : if mode then lambda^2∣a0-1 else lambda^2∣c0-1 shape : FixedCuspShape (ControlledStratumArithmetic.fixedCusp a0 c0 mode) lemma exists_fixedFourierGeometry (c:fixedFrequencyEis) (hc:c≠0) (h:fixedFrequencyEis⧸Ideal.span {c}) : Nonempty (FixedFourierGeometry c h) := by obtain ⟨a0,c0,hc0,hdiv,hcop,hpoint,ha,hcp⟩:= ShortDraftCRT.exists_normalized_rational_cusp (-3*Quotient.out h) c hc have hp:eisEmbedding a0/eisEmbedding c0=thetaFourierTranslation c h := by rw [hpoint,thetaFourierTranslation,TraceLambdaPhase.eisLam_sq] simp only [map_mul,map_neg,map_ofNat] by_cases hl:lambda∣c0 · obtain ⟨s⟩:=exists_fixedCuspShape (ControlledStratumArithmetic.fixedCusp a0 c0 true) exact ⟨⟨a0,c0,hc0,hdiv,hcop,hp,true,ha hl,s⟩⟩ · obtain ⟨s⟩:=exists_fixedCuspShape (ControlledStratumArithmetic.fixedCusp a0 c0 false) exact ⟨⟨a0,c0,hc0,hdiv,hcop,hp,false,hcp hl,s⟩⟩ def fixedFourierGeometry (c:fixedFrequencyEis) (hc:c≠0) (h:fixedFrequencyEis⧸Ideal.span {c}) : FixedFourierGeometry c h := Classical.choice (exists_fixedFourierGeometry c hc h) namespace FixedFourierGeometry variable {c:fixedFrequencyEis} {h:fixedFrequencyEis⧸Ideal.span {c}} (G:FixedFourierGeometry c h) abbrev PhaseResidue := fixedFrequencyEis⧸Ideal.span {ramifiedTraceLambda^3*G.c0} theorem phaseResidue_finite : Finite G.PhaseResidue := finite_quotient_span (A4_bad_modulus_ne_zero G.c0 G.denominator_ne_zero) def levelScale : ℝ := fixedCuspLevelScale G.shape.index G.c0 lemma levelScale_pos : 0 cuspBarProfile cubicSourceConjugateFunction (d h).point have hG (h:ι) : ∀s:ℂ,MellinConvergent (G h) s:= (d h).cuspBarProfile_mellin_entire.1 have hF:=completedBesselProfile_mellin_entire_of_periodic Ψ Q hperiod c hc hcQ have hVs:=Vstar_support W v0 v1 hWs have hV:=Vstar_contDiff W v0 v1 hv0 hWs hW let J:ι→ℝ→ℂ:=fun h t=> besselSmoothingIntegrand (G h) thetaBesselScale (Vstar W) X ((-1:ℂ)+t*Complex.I) have hi (h:ι) : Integrable (J h):= besselSmoothingIntegrand_reflected_integrable (G h) sourceCuspRadialLength sourceCuspRadialLength_pos (sourceCuspRadialCoefficient (d h).index (d h).dualPoint) thetaBesselScale (sourceCuspRadialScale (d h).index) (d h).heightScale thetaBesselScale_pos (sourceCuspRadialScale_pos _) (d h).heightScale_pos (d h).multiplier (d h).reflection_radial (sourceCuspRadialCoefficient_weighted_summable _ _) (Vstar W) v0 v1 hv0 hVs hV X hX have hireal (h:ι) : Integrable (fun t:ℝ=> besselSmoothingIntegrand (G h) thetaBesselScale (Vstar W) X (((-1:ℝ):ℂ)+t*Complex.I)):=by simpa only [Complex.ofReal_neg,Complex.ofReal_one,J] using hi h have hleft:=besselSmoothingIntegrand_finite_integrable (completedBesselProfile Ψ thetaBesselScale) G w hFG thetaBesselScale (Vstar W) X (-1) (fun h t=>hG h _) hireal have hshift:=completedT_mellin_shift Ψ hΨ thetaBesselScale thetaBesselScale_pos hF.1 hF.2 W v0 v1 hv0 hWs hW X hX (-1) (by norm_num) hleft have hline (h:ι) : (1/(2*Real.pi):ℂ)*(∫t:ℝ,J h t)=(d h).smoothedKernel W X:=by exact besselSmoothingIntegral_reflected_kernel (G h) sourceCuspRadialLength sourceCuspRadialLength_pos (sourceCuspRadialCoefficient (d h).index (d h).dualPoint) thetaBesselScale (sourceCuspRadialScale (d h).index) (d h).heightScale thetaBesselScale_pos (sourceCuspRadialScale_pos _) (d h).heightScale_pos (d h).multiplier (d h).reflection_radial (sourceCuspRadialCoefficient_weighted_summable _ _) (Vstar W) v0 v1 hv0 hVs hV X hX calc _=(1/(2*Real.pi):ℂ)*∫t:ℝ, besselSmoothingIntegrand (completedBesselProfile Ψ thetaBesselScale) thetaBesselScale (Vstar W) X ((-1:ℂ)+t*Complex.I):=by simpa only [Complex.ofReal_neg,Complex.ofReal_one] using hshift _=(1/(2*Real.pi):ℂ)*∫t:ℝ,∑h,w h*J h t:=by congr 1 apply integral_congr_ae filter_upwards with t exact besselSmoothingIntegrand_finite_sum (completedBesselProfile Ψ thetaBesselScale) G w hFG thetaBesselScale (Vstar W) X _ (fun h=>hG h _) _=∑h,w h*((1/(2*Real.pi):ℂ)*∫t:ℝ,J h t):=by rw [integral_finsetSum Finset.univ (fun h _=>(hi h).const_mul (w h)),Finset.mul_sum] apply Finset.sum_congr rfl intro h hh rw [integral_const_mul] ring _=∑h,w h*(d h).smoothedKernel W X:=by simp_rw [hline] end CubicEisenstein open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic CompletedGauss open CubicEisenstein hiding summand def fixedRowFourierPhase (c:fixedFrequencyEis) (hc:c≠0) (h:fixedFrequencyEis⧸Ideal.span {c}) (n:fixedFrequencyEis) : ℂ := quotientTrace c hc (h*Ideal.Quotient.mk _ n) lemma fixedRowFourierPhase_translation (c:fixedFrequencyEis) (hc:c≠0) (h:fixedFrequencyEis⧸Ideal.span {c}) (n:fixedFrequencyEis) : fixedRowFourierPhase c hc h n= ShortDraftTrace.breveE (-cuspFrequency n*thetaFourierTranslation c h) := (thetaFourierTranslation_phase c hc h n).symm end open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve open CubicEisenstein hiding summand end CanonicalRowCompletion end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.FixedThetaTwists namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CubicEisenstein open ActualEisensteinCubic CompletedGauss CanonicalRowCompletion lemma fixedThetaTwist_mul (φ χ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (n:(_root_.OAI.ActualEisensteinCubic.O)) : fixedThetaTwist (φ*χ) n=fixedThetaTwist φ n*χ n := by by_cases hn:lambda^2∣n-1 · rw [fixedThetaTwist_primary _ n hn,fixedThetaTwist_primary _ n hn,MonoidHom.mul_apply] ring · rw [fixedThetaTwist_not_primary _ n hn,fixedThetaTwist_not_primary _ n hn,zero_mul] def fixedThetaRowCoeff (c:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) [Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c})] (φ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c}) : ℂ := finiteAdditiveFourierCoeff (quotientTrace c hc) (fixedThetaQuotient φ c) h lemma fixedThetaRowCoeff_norm (c:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) [Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c})] (φ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (hφ:∀n,‖φ n‖≤1) (h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c}) : ‖fixedThetaRowCoeff c hc φ h‖≤1 := finiteAdditiveFourierCoeff_norm _ _ (fixedThetaQuotient_norm_le_one φ hφ c) h theorem fixedThetaTwist_fixed_fourier (c:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) [Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c})] (Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hcQ:Ideal.span {c}≤Ideal.span {(9:(_root_.OAI.ActualEisensteinCubic.O))}*Q) (φ χ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (hφ:CanonicalCoefficientClass.FactorsModulo Q φ) (n:(_root_.OAI.ActualEisensteinCubic.O)) : fixedThetaTwist (φ*χ) n= ∑h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c},fixedThetaRowCoeff c hc φ h*fixedRowFourierPhase c hc h n*χ n := by rw [←Finset.sum_mul,fixedThetaTwist_mul] congr 1 have h:=finiteAdditiveFourier_inversion (quotientTrace c hc) (GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive c hc) (fixedThetaQuotient φ c) (Ideal.Quotient.mk _ n) rw [fixedThetaQuotient_mk φ Q hφ c hcQ n] at h exact h.symm end CubicEisenstein namespace CompletedGauss section open ActualEisensteinCubic CanonicalQuadraticSieve ConcretePrimeRowBridge open UniqueFactorizationMonoid LocalReflectionBrackets lemma admissiblePrimeGood (K:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hK:Admissible K) (P:PrimeIndex K) : lambda∉P.val := (hK.2.2 P.val (Multiset.mem_toFinset.mp P.property)).1 theorem quadraticRow_eq_primeIndex (K:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hK:Admissible K) (x:(_root_.OAI.ActualEisensteinCubic.O)) : let : ∀ P : PrimeIndex K, P.val.IsMaximal := primeIndexMaximal K quadraticRow K x=finiteSexticRow (fun P:PrimeIndex K=>P.val) (admissiblePrimeGood K hK) (fun _=>3) x := by let : ∀ P : PrimeIndex K, P.val.IsMaximal := primeIndexMaximal K change quadraticRow K x=finiteSexticRow (fun P:PrimeIndex K=>P.val) (admissiblePrimeGood K hK) (fun _=>3) x have hs:∀I∈({K}:Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O))),Admissible I:=by intro I hI simpa only [Finset.mem_singleton.mp hI] using hK have heq:primePool ({K}:Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O)))=primeSupport K:=by simp [primePool,primeSupport] let e:primePool ({K}:Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O)))≃PrimeIndex K:={ toFun:=fun P=>⟨P.val,heq ▸ P.property⟩ invFun:=fun P=>⟨P.val,heq.symm ▸ P.property⟩ left_inv:=fun _=>rfl right_inv:=fun _=>rfl } rw [quadraticRow_eq_pool {K} hs K (Finset.mem_singleton_self K) x, idealSupport_singleton_univ] simp only [QuadraticInitialBound.quadraticRow,finiteSquarefreeRow,Finset.prod_pow, finiteSexticRow,MulChar.pow_apply' _ (by decide : (3:ℕ)≠0)] congr 1 exact Fintype.prod_equiv e _ _ (fun P=>rfl) theorem completedLocalExponent_residual (I F Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hFQ:F∣Q) (P:PrimeIndex (rowResidualPart I Q)) : completedLocalExponent I F P.val=1 := by have h:=rowResidualPart_prime_exponent I Q P.val (Multiset.mem_toFinset.mp P.property) have hnot:¬P.val∣F:=fun hd=>h.2.2 (hd.trans hFQ) simp only [completedLocalExponent,h.2.1,if_neg hnot,mul_zero,add_zero,Nat.reduceMod] def residualQuadraticPhase (K:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (m:ℕ) (D E:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : ℂ := quadraticRow K ((u.val*lambda^m)*primaryGenerator (D*E)) end section open ActualEisensteinCubic CanonicalQuadraticSieve def actualResidualModelRow (K:ℝ) (I Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:I≠0) (hbad:∀P∈fixedBadPrimes,P∣Q) (hIK:(Ideal.absNorm I:ℝ)≤K) : idealRange (completedResidualScale K I Q) := by refine ⟨rowResidualPart I Q,mem_idealRange.mpr ⟨rowResidualPart_admissible I Q hbad,?_⟩⟩ rw [rowResidualPart_norm I Q hI,completedResidualScale] exact div_le_div_of_nonneg_right hIK (by positivity) lemma actualResidualModelRow_shell (K:ℝ) (I Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:I≠0) (hbad:∀P∈fixedBadPrimes,P∣Q) (hIK:(Ideal.absNorm I:ℝ)≤K) (hlo:K/2≤(Ideal.absNorm I:ℝ)) : completedResidualScale K I Q/2≤(Ideal.absNorm (actualResidualModelRow K I Q hI hbad hIK).val:ℝ) := by change completedResidualScale K I Q/2≤(Ideal.absNorm (rowResidualPart I Q):ℝ) rw [rowResidualPart_norm I Q hI,completedResidualScale] have h:=div_le_div_of_nonneg_right hlo (show 0≤(Ideal.absNorm (rowPowerfulPart I):ℝ)*(Ideal.absNorm (rowMaskPart I Q):ℝ) by positivity) convert h using 1 <;> first | rfl | ring theorem completedBranchScale_raw_argument {ι:Type*} [Fintype ι] (K X c r:ℝ) (I F Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (P:ι→Ideal (_root_.OAI.ActualEisensteinCubic.O)) [∀i,(P i).IsMaximal] (e:ι→Fin 3) (k n b:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hK:0completedLocalExponent I F (P i)) e 1*n):ℝ)* (Ideal.absNorm (reflectionExtractedDivisor P (fun i=>completedLocalExponent I F (P i)) e 2*b):ℝ)^3/ (c*(Ideal.absNorm k:ℝ)^2*(Ideal.absNorm (∏i,P i):ℝ)^2) := by have hkN:(Ideal.absNorm k:ℝ)≠0:=by exact_mod_cast (Ideal.absNorm_eq_zero_iff.not.mpr hk) have hpN:(Ideal.absNorm (∏i,P i):ℝ)≠0:=by exact_mod_cast (Ideal.absNorm_eq_zero_iff.not.mpr (Finset.prod_ne_zero_iff.mpr (fun i _=>NeZero.ne (P i)))) simp only [completedBranchScale,inv_div,map_mul,Nat.cast_mul] field_simp [hK.ne',hc.ne',hkN,hpN] end open ActualEisensteinCubic CanonicalQuadraticSieve CompletedDyadic LocalReflectionBrackets end CompletedGauss open scoped Classical BigOperators ContDiff namespace CompletedGauss.FreeReflection section open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve CompletedDyadic LocalReflectionBrackets def pool (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O)) := (completedReflectionPool I Q).filter (fun P=>¬Q0≤P) lemma pool_subset (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : pool I Q Q0⊆completedReflectionPool I Q := Finset.filter_subset _ _ lemma pool_maximal (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (P:pool I Q Q0) : P.val.IsMaximal := completedReflectionPool_maximal I Q ⟨P.val,pool_subset I Q Q0 P.property⟩ lemma pool_good (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (P:pool I Q Q0) : lambda∉P.val := completedReflectionPool_good I Q ⟨P.val,pool_subset I Q Q0 P.property⟩ lemma pool_odd (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (P:pool I Q Q0) : ringChar ((_root_.OAI.ActualEisensteinCubic.O)⧸P.val)≠2 := completedReflectionPool_odd I Q ⟨P.val,pool_subset I Q Q0 P.property⟩ lemma pool_divides (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:I≠0) (hQ:Q≠0) (P:pool I Q Q0) : P.val∣I*Q := completedReflectionPool_divides I Q hI hQ ⟨P.val,pool_subset I Q Q0 P.property⟩ lemma pool_nonresidual (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (P:pool I Q Q0) : ¬P.val∣rowResidualPart I Q := completedReflectionPool_nonresidual I Q ⟨P.val,pool_subset I Q Q0 P.property⟩ lemma pool_eq_on_fiber (I J Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:I≠0) (hJ:J≠0) (hQ:Q≠0) (hA:rowPowerfulPart I=rowPowerfulPart J) (hT:rowMaskPart I Q=rowMaskPart J Q) : pool I Q Q0=pool J Q Q0 := by unfold pool rw [completedReflectionPool_eq_on_fiber I J Q hI hJ hQ hA hT] end section open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve CompletedDyadic def reflectionChoiceValue (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (e:pool I Q Q0→Fin 6) (P:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : Fin 6 := if h:P∈pool I Q Q0 then e ⟨P,h⟩ else 0 def reflectionActivePool (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (e:pool I Q Q0→Fin 6) : Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O)) := (pool I Q Q0).filter (fun P=>reflectionSixActive (reflectionChoiceValue I Q Q0 e P)) lemma reflectionActivePool_subset (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (e:pool I Q Q0→Fin 6) : reflectionActivePool I Q Q0 e⊆pool I Q Q0 := Finset.filter_subset _ _ lemma mem_reflectionActivePool (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (e:pool I Q Q0→Fin 6) (P:pool I Q Q0) : P.val∈reflectionActivePool I Q Q0 e ↔ reflectionSixActive (e P) := by rw [reflectionActivePool, Finset.mem_filter] simp only [P.property, true_and] rw [reflectionChoiceValue, dif_pos P.property] def reflectionActiveLabel (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (e:pool I Q Q0→Fin 6) (P:reflectionActivePool I Q Q0 e) : Fin 3 := reflectionSixLabel (e ⟨P.val,reflectionActivePool_subset I Q Q0 e P.property⟩) def sixReflectedBranch (I F Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:I≠0) (hQ:Q≠0) (K levelBound levelScale:ℝ) (hlevel:0pool_maximal I Q Q0 ⟨P.val,reflectionActivePool_subset I Q Q0 e P.property⟩ good:=fun P=>pool_good I Q Q0 ⟨P.val,reflectionActivePool_subset I Q Q0 e P.property⟩ coprime:=by intro P R hPR let : P.val.IsMaximal:=pool_maximal I Q Q0 ⟨P.val,reflectionActivePool_subset I Q Q0 e P.property⟩ let : R.val.IsMaximal:=pool_maximal I Q Q0 ⟨R.val,reflectionActivePool_subset I Q Q0 e R.property⟩ exact Ideal.isCoprime_of_isMaximal (Subtype.val_injective.ne hPR) divides:=fun P=>pool_divides I Q Q0 hI hQ ⟨P.val,reflectionActivePool_subset I Q Q0 e P.property⟩ nonresidual:=fun P=>pool_nonresidual I Q Q0 ⟨P.val,reflectionActivePool_subset I Q Q0 e P.property⟩ label:=reflectionActiveLabel I Q Q0 e nColumns:=fun i=>dualIdealDyad i.2.2 bColumns:=fun i=>dualIdealDyad i.2.1 nBounds:=show ∀ (i : ℕ×ℕ×ℕ) (n : Ideal (_root_.OAI.ActualEisensteinCubic.O)), n ∈ dualIdealDyad i.2.2 → n ≠ 0 ∧ (2:ℝ)^i.2.2/2 ≤ (Ideal.absNorm n:ℝ) ∧ (Ideal.absNorm n:ℝ) ≤ (2:ℝ)^i.2.2 from fun i n hn=>dualIdealDyad_bounds i.2.2 n hn bBounds:=show ∀ (i : ℕ×ℕ×ℕ) (b : Ideal (_root_.OAI.ActualEisensteinCubic.O)), b ∈ dualIdealDyad i.2.1 → b ≠ 0 ∧ (2:ℝ)^i.2.1/2 ≤ (Ideal.absNorm b:ℝ) ∧ (Ideal.absNorm b:ℝ) ≤ (2:ℝ)^i.2.1 from fun i b hb=>dualIdealDyad_bounds i.2.1 b hb amplitude:=fun i=>amplitude i.1 amplitude_bound:=fun i n _ b _=>hamp i.1 n b rowPhase:=fun i=>rowPhase i.1 rowPhase_bound:=fun i k=>hrow i.1 k end section open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve CompletedDyadic def sixPhaseFixedCuspBranch (I F Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:I≠0) (hQ:Q≠0) (K levelBound levelScale:ℝ) (hlevel:0norm_nonneg _) intro P _ by_cases hj:completedLocalExponent I F P.val=0 · rw [hj] exact zeroFourierCoefficient_zero_norm_le_one _ · have he:=canonical_zeroFourierCoefficient P.val (pool_good I Q Q0 P) (pool_odd I Q Q0 P) (completedLocalExponent I F P.val) (Nat.mod_lt _ (by decide : 0<6)) have hz:zeroFourierCoefficient (actualSextic P.val (pool_good I Q Q0 P)) (completedLocalExponent I F P.val)=0 := by simpa only [actualSextic,if_neg hj] using he rw [hz] simp def reflectionSixInactiveWeight (I F Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (e:pool I Q Q0→Fin 6) : ℂ := if reflectionSixValid e then reflectionInactiveStratumWeight I F Q Q0 (reflectionSixSupport e) else 0 lemma reflectionSixInactiveWeight_norm_le_one (I F Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (e:pool I Q Q0→Fin 6) : ‖reflectionSixInactiveWeight I F Q Q0 e‖≤1 := by unfold reflectionSixInactiveWeight split_ifs · exact reflectionInactiveStratumWeight_norm_le_one I F Q Q0 _ · simp lemma sum_reflectionSixInactiveWeight_unpad (I F Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (G:(pool I Q Q0→Fin 6)→ℂ) : (∑e:pool I Q Q0→Fin 6,reflectionSixInactiveWeight I F Q Q0 e*G e)= ∑A:Finset (pool I Q Q0),∑e:A→Fin 3, reflectionInactiveStratumWeight I F Q Q0 A*G (encodeReflectionSix ⟨A,e⟩) := by rw [sum_active_exceptional_eq_six] apply Finset.sum_congr rfl intro e _ by_cases he:reflectionSixValid e · rw [if_pos he,encode_decodeReflectionSix e he] simp only [reflectionSixInactiveWeight,if_pos he,decodeReflectionSix] · simp only [if_neg he,reflectionSixInactiveWeight,zero_mul] abbrev SixReflectionIndex (rays:ℕ) (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) := Fin rays×(pool I Q Q0→Fin 6) end open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve LocalReflectionBrackets def sixPhaseFixedCuspFiber (rays:ℕ) (I F Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:I≠0) (hQ:Q≠0) (K levelBound:ℝ) (levelScale:SixReflectionIndex rays I Q Q0→ℝ) (hlevel:∀x,0sixPhaseFixedCuspBranch I F Q Q0 hI hQ K levelBound (levelScale x) (hlevel x) (hlevelBound x) x.2 (cusp x) (unit x) (phaseArray x) (hphase x) (rowPhase x) (hrow x) weight:=fun x=>rayWeight x*reflectionSixInactiveWeight I F Q Q0 x.2 weight_bound:=by intro x rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (hray x)).trans (reflectionSixInactiveWeight_norm_le_one I F Q Q0 x.2) end CompletedGauss.FreeReflection end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.FixedRayFibers namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped Classical BigOperators ContDiff namespace CompletedGauss.FreeReflection open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve abbrev FixedBranchIndex (c:_root_.OAI.ActualEisensteinCubic.O) (hc:c≠0) (I Q Q0:Ideal _root_.OAI.ActualEisensteinCubic.O) := FixedReflectionRay c hc×(pool I Q Q0→Fin 6) def fixedRayFiber (c:_root_.OAI.ActualEisensteinCubic.O) (hc:c≠0) (I F Q Q0:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I≠0) (hQ:Q≠0) (K:ℝ) (rayWeight:FixedBranchIndex c hc I Q Q0→ℂ) (hray:∀x,‖rayWeight x‖≤1) (rowPhase:FixedBranchIndex c hc I Q Q0→ℕ→idealRange (completedResidualScale K I Q)→ℂ) (hrow:∀x m k,‖rowPhase x m k‖≤1) : ReflectedFiberData (fixedReflectionRayCount c hc) (fixedCuspLevelBound c) K I F Q := by let R:SixReflectionIndex (fixedReflectionRayCount c hc) I Q Q0→FixedReflectionRay c hc:= fun x=>(fixedReflectionRayEquiv c hc).symm x.1 let G:=fun x=>fixedFourierGeometry c hc (R x).1 exact sixPhaseFixedCuspFiber (fixedReflectionRayCount c hc) I F Q Q0 hI hQ K (fixedCuspLevelBound c) (fun x=>(G x).levelScale) (fun x=>(G x).levelScale_pos) (fun x=>(G x).levelScale_le hc) (fun x=>(G x).shape.index) (fun x=>(R x).2.2) (fun x=>(G x).staticPhase (R x).2.1 (R x).2.2) (fun x=>(G x).staticPhase_norm_le_one (R x).2.1 (R x).2.2) (fun x=>rayWeight (R x,x.2)) (fun x=>hray (R x,x.2)) (fun x=>rowPhase (R x,x.2)) (fun x=>hrow (R x,x.2)) theorem fixedRayFiber_value (c:_root_.OAI.ActualEisensteinCubic.O) (hc:c≠0) (I F Q Q0:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I≠0) (hQ:Q≠0) (K:ℝ) (rayWeight:FixedBranchIndex c hc I Q Q0→ℂ) (hray:∀x,‖rayWeight x‖≤1) (rowPhase:FixedBranchIndex c hc I Q Q0→ℕ→idealRange (completedResidualScale K I Q)→ℂ) (hrow:∀x m k,‖rowPhase x m k‖≤1) (W:ℝ→ℂ) (X ρ q:ℝ) (k:idealRange (completedResidualScale K I Q)) : let : Fintype (FixedReflectionRay c hc) := fixedReflectionRay_fintype c hc let d:=fixedRayFiber c hc I F Q Q0 hI hQ K rayWeight hray rowPhase hrow d.value W X ρ q k= ∑r:FixedReflectionRay c hc,∑A:Finset (pool I Q Q0),∑e:A→Fin 3, reflectionInactiveStratumWeight I F Q Q0 A*rayWeight (r,encodeReflectionSix ⟨A,e⟩)* (d.branch (fixedReflectionRayEquiv c hc r,encodeReflectionSix ⟨A,e⟩)).value W X ρ q k := by let : Fintype (FixedReflectionRay c hc) := fixedReflectionRay_fintype c hc dsimp only rw [ReflectedFiberData.value,Fintype.sum_prod_type] calc _=∑r:FixedReflectionRay c hc,∑e:pool I Q Q0→Fin 6, reflectionSixInactiveWeight I F Q Q0 e* (rayWeight (r,e)*((fixedRayFiber c hc I F Q Q0 hI hQ K rayWeight hray rowPhase hrow).branch (fixedReflectionRayEquiv c hc r,e)).value W X ρ q k) := by apply Fintype.sum_equiv (fixedReflectionRayEquiv c hc).symm intro t apply Finset.sum_congr rfl intro e he simp only [Equiv.apply_symm_apply] change (rayWeight ((fixedReflectionRayEquiv c hc).symm t,e)* reflectionSixInactiveWeight I F Q Q0 e)*_= _ ring _=_:=by apply Finset.sum_congr rfl intro r hr rw [sum_reflectionSixInactiveWeight_unpad] apply Finset.sum_congr rfl intro A hA apply Finset.sum_congr rfl intro e he exact (mul_assoc _ _ _).symm end CompletedGauss.FreeReflection open scoped BigOperators Classical namespace CompletedGauss section open ActualEisensteinCubic CanonicalQuadraticSieve CompletedDyadic LocalReflectionBrackets def residualArgumentPhase (K:Ideal _root_.OAI.ActualEisensteinCubic.O) (z:_root_.OAI.ActualEisensteinCubic.O) (D E:Ideal _root_.OAI.ActualEisensteinCubic.O) : ℂ := quadraticRow K (z*primaryGenerator (D*E)) lemma residualArgumentPhase_norm_le_one (K:Ideal _root_.OAI.ActualEisensteinCubic.O) (z:_root_.OAI.ActualEisensteinCubic.O) (D E:Ideal _root_.OAI.ActualEisensteinCubic.O) : ‖residualArgumentPhase K z D E‖≤1 := quadraticRow_norm_le_one _ _ end section open ActualEisensteinCubic CubicEisenstein LocalReflectionBrackets lemma reflectedBranch_local_support {ι:Type*} [Fintype ι] (P:ι→Ideal _root_.OAI.ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (j:ι→ℕ) (e:ι→Fin 3) (n b:_root_.OAI.ActualEisensteinCubic.O) (hne:reflectedBranch P hg j e n b≠0) : (∀i,j i=4 → e i=1 → n∈P i) ∧ (∀i,j i=4 → e i=2 → n∉P i ∧ b∈P i) := by have hi (i:ι):reflectedLocalPiece (P i) (hg i) (j i) (e i) n b≠0:= (Finset.prod_ne_zero_iff.mp hne) i (Finset.mem_univ i) constructor · intro i hj he by_contra hn exact hi i (by simp [reflectedLocalPiece,hj,exceptionalPiece,he,hn]) · intro i hj he by_contra hn exact hi i (by simp [reflectedLocalPiece,hj,exceptionalPiece,he,hn]) lemma reflectionExtractedDivisor_dvd_of_local {ι:Type*} [Fintype ι] (P:ι→Ideal _root_.OAI.ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hcop:Pairwise (fun i k=>IsCoprime (P i) (P k))) (j:ι→ℕ) (e:ι→Fin 3) (v:Fin 3) (A:Ideal _root_.OAI.ActualEisensteinCubic.O) (hA:∀i,(j i=4 ∧ e i=v) ∨ (j i=0 ∧ v=0) → P i∣A) : reflectionExtractedDivisor P j e v∣A := by unfold reflectionExtractedDivisor apply Fintype.prod_dvd_of_coprime · intro i k hik change IsCoprime (reflectionExtractedPrime (P i) (j i) (e i) v) (reflectionExtractedPrime (P k) (j k) (e k) v) unfold reflectionExtractedPrime by_cases hi:(j i=4 ∧ e i=v) ∨ (j i=0 ∧ v=0) · rw [if_pos hi] by_cases hk:(j k=4 ∧ e k=v) ∨ (j k=0 ∧ v=0) · rw [if_pos hk] exact hcop hik · rw [if_neg hk] exact isCoprime_one_right · rw [if_neg hi] exact isCoprime_one_left · intro i unfold reflectionExtractedPrime split_ifs with hi · exact hA i hi · exact one_dvd _ theorem reflectedBranch_extracted_divisibility {ι:Type*} [Fintype ι] (P:ι→Ideal _root_.OAI.ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (hcop:Pairwise (fun i k=>IsCoprime (P i) (P k))) (j:ι→ℕ) (e:ι→Fin 3) (n b:_root_.OAI.ActualEisensteinCubic.O) (hne:reflectedBranch P hg j e n b≠0) : reflectionExtractedDivisor P j e 1∣Ideal.span {n} ∧ reflectionExtractedDivisor P j e 2∣Ideal.span {b} ∧ (∀i,j i=4 → e i=2 → n∉P i) := by have hs:=reflectedBranch_local_support P hg j e n b hne refine ⟨reflectionExtractedDivisor_dvd_of_local P hcop j e 1 _ ?_, reflectionExtractedDivisor_dvd_of_local P hcop j e 2 _ ?_,fun i hj he=>(hs.2 i hj he).1⟩ · intro i hi have h:j i=4 ∧ e i=1:=by simpa using hi exact Ideal.dvd_span_singleton.mpr (hs.1 i h.1 h.2) · intro i hi have h:j i=4 ∧ e i=2:=by simpa using hi exact Ideal.dvd_span_singleton.mpr (hs.2 i h.1 h.2).2 def fixedCuspBranchNumerator {ι:Type*} [Fintype ι] (P:ι→Ideal _root_.OAI.ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (j:ι→ℕ) (e:ι→Fin 3) (cusp:Fin 3) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (phaseArray:ℕ→Ideal _root_.OAI.ActualEisensteinCubic.O→Ideal _root_.OAI.ActualEisensteinCubic.O→ℂ) (m:ℕ) (n b:Ideal _root_.OAI.ActualEisensteinCubic.O) : ℂ := fixedCuspArrayWithPhase cusp u phaseArray m n b * reflectedBranch P hg j e (primaryGenerator n) (primaryGenerator b) theorem fixedCuspBranchNumerator_support {ι:Type*} [Fintype ι] (P:ι→Ideal _root_.OAI.ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (hcop:Pairwise (fun i k=>IsCoprime (P i) (P k))) (j:ι→ℕ) (e:ι→Fin 3) (cusp:Fin 3) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (phaseArray:ℕ→Ideal _root_.OAI.ActualEisensteinCubic.O→Ideal _root_.OAI.ActualEisensteinCubic.O→ℂ) (m:ℕ) (n b:Ideal _root_.OAI.ActualEisensteinCubic.O) (hne:fixedCuspBranchNumerator P hg j e cusp u phaseArray m n b≠0) : reflectionExtractedDivisor P j e 1∣n ∧ reflectionExtractedDivisor P j e 2∣b ∧ (∀i,j i=4 → e i=2 → primaryGenerator n∉P i) := by have hn:(fixedCuspArrayWithPhase cusp u phaseArray m n b)≠0:= (mul_ne_zero_iff.mp hne).1 have he:fixedCuspArrayEligible n b:=by by_contra he exact hn (fixedCuspArrayWithPhase_zero cusp u phaseArray m n b he) have hb:reflectedBranch P hg j e (primaryGenerator n) (primaryGenerator b)≠0:= (mul_ne_zero_iff.mp hne).2 have hs:=reflectedBranch_extracted_divisibility P hg hcop j e _ _ hb rwa [(primaryGenerator_spec n he.2.1).1,(primaryGenerator_spec b he.2.2).1] at hs end open ActualEisensteinCubic CubicEisenstein def nonzeroDualDilation (D E:Ideal _root_.OAI.ActualEisensteinCubic.O) (hD:D≠0) (hE:E≠0) (x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal) : ℕ×NonzeroDualIdeal×NonzeroDualIdeal := (x.1,⟨D*x.2.1.val,mul_ne_zero hD x.2.1.property⟩, ⟨E*x.2.2.val,mul_ne_zero hE x.2.2.property⟩) lemma nonzeroDualDilation_injective (D E:Ideal _root_.OAI.ActualEisensteinCubic.O) (hD:D≠0) (hE:E≠0) : Function.Injective (nonzeroDualDilation D E hD hE) := by intro x y h apply Prod.ext · have ht:=congrArg (fun t:ℕ×NonzeroDualIdeal×NonzeroDualIdeal=>t.1) h exact ht · apply Prod.ext · apply Subtype.ext exact mul_left_cancel₀ hD (congrArg (fun t:ℕ×NonzeroDualIdeal×NonzeroDualIdeal=>t.2.1.val) h) · apply Subtype.ext exact mul_left_cancel₀ hE (congrArg (fun t:ℕ×NonzeroDualIdeal×NonzeroDualIdeal=>t.2.2.val) h) theorem tsum_nonzeroDualDilation (D E:Ideal _root_.OAI.ActualEisensteinCubic.O) (hD:D≠0) (hE:E≠0) (f:(ℕ×NonzeroDualIdeal×NonzeroDualIdeal)→ℂ) (hsupport:∀x,f x≠0 → D∣x.2.1.val ∧ E∣x.2.2.val) : (∑'x,f x)=∑'x,f (nonzeroDualDilation D E hD hE x) := by apply tsum_eq_tsum_of_ne_zero_bij (fun x:Function.support (fun y=>f (nonzeroDualDilation D E hD hE y))=> nonzeroDualDilation D E hD hE x.val) · exact (nonzeroDualDilation_injective D E hD hE).comp Subtype.val_injective · intro x hx obtain ⟨hn,hb⟩:=hsupport x hx obtain ⟨n,hn⟩:=hn obtain ⟨b,hb⟩:=hb have hn0:n≠0:=by intro hz apply x.2.1.property rw [hn,hz,mul_zero] have hb0:b≠0:=by intro hz apply x.2.2.property rw [hb,hz,mul_zero] let y:ℕ×NonzeroDualIdeal×NonzeroDualIdeal:=(x.1,⟨n,hn0⟩,⟨b,hb0⟩) have hy:nonzeroDualDilation D E hD hE y=x:=by apply Prod.ext · rfl · apply Prod.ext · exact Subtype.ext hn.symm · exact Subtype.ext hb.symm refine ⟨⟨y,?_⟩,hy⟩ change f (nonzeroDualDilation D E hD hE y)≠0 rwa [hy] · intro x rfl end CompletedGauss open scoped BigOperators Classical MatrixGroups namespace CubicEisenstein section open ActualEisensteinCubic CompletedGauss CubicKubota CubicJacobiGlobal ConcreteTraceCRT open LocalReflectionBrackets lemma fixedConjugateCuspArray_nonzero (j:Fin 3) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) (h:fixedConjugateCuspArray j u m I J≠0) : fixedCuspArrayEligible I J ∧ (sourceCuspCoefficients j).value (fixedCuspArrayIndex u m I J)≠0 := by have helig:fixedCuspArrayEligible I J:=by by_contra he apply h simp only [fixedConjugateCuspArray,fixedCuspArray,if_neg he,star_zero] refine ⟨helig,?_⟩ intro hz apply h simp only [fixedConjugateCuspArray,fixedCuspArray,if_pos helig,hz,zero_div,star_zero] lemma fixedCusp_ramified_index_pos (j:Fin 3) (hj:j≠0) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) (helig:fixedCuspArrayEligible I J) (h:(sourceCuspCoefficients j).value (fixedCuspArrayIndex u m I J)≠0) : 0< m := by apply Nat.pos_of_ne_zero intro hm have hp:lambda∣ramifiedTraceLambda:=by change lambda∣paperLambda rw [paperLambda_eq] exact dvd_mul_left lambda _ have hd:=hp.trans (sourceCuspCoefficients_ramified_divisibility j hj _ h) simp only [fixedCuspArrayIndex,hm,pow_zero,mul_one] at hd have hu:IsCoprime lambda (u:_root_.OAI.ActualEisensteinCubic.O):=⟨0,(↑u⁻¹:_root_.OAI.ActualEisensteinCubic.O),by simp⟩ have hni:IsCoprime lambda (primaryGenerator I):=coprime_of_dvd_sub_one lambda _ ((dvd_pow_self lambda (by decide : (2:ℕ)≠0)).trans (primaryGenerator_spec I helig.2.1).2) have hnj:IsCoprime lambda (primaryGenerator J):=coprime_of_dvd_sub_one lambda _ ((dvd_pow_self lambda (by decide : (2:ℕ)≠0)).trans (primaryGenerator_spec J helig.2.2).2) exact residue_lambda_prime.not_isUnit (((hu.mul_right hni).mul_right hnj.pow_right).isUnit_of_dvd hd) def sourcePhaseUnit (j:Fin 3) (w u:_root_.OAI.ActualEisensteinCubic.Oˣ) : _root_.OAI.ActualEisensteinCubic.Oˣ := if j=0 then paperLambdaUnit*w^2*u else -(w^2*u*paperLambdaUnit⁻¹) def sourcePhaseExponent (j:Fin 3) (m:ℕ) : ℕ := if j=0 then m+1 else m-1 lemma paperLambdaQuotient_succ (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (n b:_root_.OAI.ActualEisensteinCubic.O) : paperLambdaQuotient ((u.val*lambda^(m+1))*n*b^3)= (paperLambdaUnit⁻¹:_root_.OAI.ActualEisensteinCubic.Oˣ).val*u.val*lambda^m*n*b^3 := by have hp:ramifiedTraceLambda*((paperLambdaUnit⁻¹:_root_.OAI.ActualEisensteinCubic.Oˣ).val*u.val*lambda^m*n*b^3)= (u.val*lambda^(m+1))*n*b^3 := by change paperLambda*((paperLambdaUnit⁻¹:_root_.OAI.ActualEisensteinCubic.Oˣ).val*u.val*lambda^m*n*b^3)=_ rw [paperLambda_eq,pow_succ] have hi:(paperLambdaUnit:_root_.OAI.ActualEisensteinCubic.O)*(paperLambdaUnit⁻¹:_root_.OAI.ActualEisensteinCubic.Oˣ)=1:=by simp calc _=((paperLambdaUnit:_root_.OAI.ActualEisensteinCubic.O)*(paperLambdaUnit⁻¹:_root_.OAI.ActualEisensteinCubic.Oˣ))*(u.val*lambda^m*lambda*n*b^3):=by ring _=_:=by rw [hi,one_mul];ring have hd:ramifiedTraceLambda∣(u.val*lambda^(m+1))*n*b^3:=⟨_,hp.symm⟩ have hn:ramifiedTraceLambda≠0:=by intro hz have he:=ramifiedEmbedding_traceLambda rw [hz,map_zero] at he exact eisLam_ne_zero he.symm apply mul_left_cancel₀ hn rw [paperLambdaQuotient_mul _ hd,hp] theorem sourceCuspPhaseNumerator_columns (j:Fin 3) (w u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) (helig:fixedCuspArrayEligible I J) (h:(sourceCuspCoefficients j).value (fixedCuspArrayIndex u m I J)≠0) : sourceCuspPhaseNumerator j w.val (fixedCuspArrayIndex u m I J)= ((sourcePhaseUnit j w u).val*lambda^(sourcePhaseExponent j m))* (primaryGenerator I*(primaryGenerator J)^3) := by by_cases hj:j=0 · subst j simp only [sourceCuspPhaseNumerator,sourcePhaseUnit,sourcePhaseExponent,ite_true, fixedCuspArrayIndex,Units.val_mul,Units.val_pow_eq_pow_val] change paperLambda*w.val^2*((u.val*lambda^m)*primaryGenerator I*(primaryGenerator J)^3)=_ rw [paperLambda_eq,pow_succ] ring · have hm:=fixedCusp_ramified_index_pos j hj u m I J helig h cases m with | zero => omega | succ m => simp only [sourceCuspPhaseNumerator,sourcePhaseUnit,sourcePhaseExponent,if_neg hj, fixedCuspArrayIndex,Nat.succ_sub_succ_eq_sub,Nat.sub_zero,Units.val_neg,Units.val_mul, Units.val_pow_eq_pow_val] rw [paperLambdaQuotient_succ] ring theorem fixedCuspArray_phase_brackets {ι:Type*} [Fintype ι] (P:ι→Ideal _root_.OAI.ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (exponent:ι→ℕ) (j:Fin 3) (w u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) : let : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O ⧸ P i) := fun i => Ideal.Quotient.field (P i) let : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) fixedConjugateCuspArray j u m I J* (∏i,bracket (actualSextic (P i) (hg i)) (exponent i) (Ideal.Quotient.mk (P i) (sourceCuspPhaseNumerator j w.val (fixedCuspArrayIndex u m I J))))= fixedConjugateCuspArray j u m I J* ramifiedBranchPhase P hg exponent (sourcePhaseUnit j w u) (sourcePhaseExponent j m)* ∑e:ι→Fin 3,reflectedBranch P hg exponent e (primaryGenerator I) (primaryGenerator J) := by let : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O ⧸ P i) := fun i => Ideal.Quotient.field (P i) let : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) dsimp only by_cases hz:fixedConjugateCuspArray j u m I J=0 · rw [hz,zero_mul,zero_mul,zero_mul] · obtain ⟨he,hh⟩:=fixedConjugateCuspArray_nonzero j u m I J hz rw [sourceCuspPhaseNumerator_columns j w u m I J he hh, ramified_bracket_full_expansion] ring end open ActualEisensteinCubic CompletedGauss CompletedDyadic CubicKubota CubicJacobiGlobal ConcreteTraceCRT open LocalReflectionBrackets ShortDraftCusp namespace FixedCuspShape variable {H:SL(2,_root_.OAI.ActualEisensteinCubic.O)} (s:FixedCuspShape H) def phaseUpperUnit : _root_.OAI.ActualEisensteinCubic.Oˣ := s.upper_unit.unit lemma phaseUpperUnit_val : (s.phaseUpperUnit:_root_.OAI.ActualEisensteinCubic.O)=s.upper 0 0 := s.upper_unit.unit_spec def modelDualNumerator (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) : _root_.OAI.ActualEisensteinCubic.O := sourceCuspPhaseNumerator s.index (s.upper 0 0) (fixedCuspArrayIndex u m I J) theorem model_array_brackets {ι:Type*} [Fintype ι] (P:ι→Ideal _root_.OAI.ActualEisensteinCubic.O) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (j:ι→ℕ) (c0:_root_.OAI.ActualEisensteinCubic.O) (hc0:c0≠0) (d U:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) : let : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O ⧸ P i) := fun i => Ideal.Quotient.field (P i) let : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) (s.amplitude u m I J*A4BadPhase c0 hc0 d U (s.modelDualNumerator u m I J))* (∏i,bracket (actualSextic (P i) (hg i)) (j i) (Ideal.Quotient.mk (P i) (s.modelDualNumerator u m I J)))= ramifiedBranchPhase P hg j (sourcePhaseUnit s.index s.phaseUpperUnit u) (sourcePhaseExponent s.index m)* ∑e:ι→Fin 3, fixedCuspArrayWithPhase s.index u (s.reflectionStaticPhase c0 hc0 (Ideal.Quotient.mk _ (-d*U)) (s.modelDualNumerator u) u) m I J* reflectedBranch P hg j e (primaryGenerator I) (primaryGenerator J) := by let : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O ⧸ P i) := fun i => Ideal.Quotient.field (P i) let : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) dsimp only let φ:=s.reflectionStaticPhase c0 hc0 (Ideal.Quotient.mk _ (-d*U)) (s.modelDualNumerator u) u have hA:φ m I J*fixedConjugateCuspArray s.index u m I J= s.amplitude u m I J*A4BadPhase c0 hc0 d U (s.modelDualNumerator u m I J) := by rw [A4BadPhase_as_fixed_residue] exact s.fixedCuspArrayWithPhase_reflectionStaticPhase c0 hc0 _ _ u m I J have hbr:=fixedCuspArray_phase_brackets P hg j s.index s.phaseUpperUnit u m I J rw [s.phaseUpperUnit_val] at hbr change fixedConjugateCuspArray s.index u m I J* (∏i,bracket (actualSextic (P i) (hg i)) (j i) (Ideal.Quotient.mk (P i) (s.modelDualNumerator u m I J)))=_ at hbr rw [←hA] calc _=φ m I J*(fixedConjugateCuspArray s.index u m I J* (∏i,bracket (actualSextic (P i) (hg i)) (j i) (Ideal.Quotient.mk (P i) (s.modelDualNumerator u m I J)))) := by ring _=φ m I J*(fixedConjugateCuspArray s.index u m I J* ramifiedBranchPhase P hg j (sourcePhaseUnit s.index s.phaseUpperUnit u) (sourcePhaseExponent s.index m)* ∑e:ι→Fin 3,reflectedBranch P hg j e (primaryGenerator I) (primaryGenerator J)) := by rw [hbr] _=_ := by simp only [fixedCuspArrayWithPhase] rw [←Finset.mul_sum] dsimp only [φ] ring end FixedCuspShape namespace ControlledStratumArithmetic variable {ι:Type*} [Fintype ι] {p:ι→_root_.OAI.ActualEisensteinCubic.O} {N a0 c0:_root_.OAI.ActualEisensteinCubic.O} {mode:Bool} noncomputable abbrev coefficientField (P:Ideal _root_.OAI.ActualEisensteinCubic.O) [P.IsMaximal] : Field (_root_.OAI.ActualEisensteinCubic.O⧸P) := Ideal.Quotient.field P noncomputable abbrev coefficientFintype (P:Ideal _root_.OAI.ActualEisensteinCubic.O) [P.IsMaximal] : Fintype (_root_.OAI.ActualEisensteinCubic.O⧸P) := Fintype.ofFinite _ def activePhase (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) : ℂ := letI : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientField (Ideal.span {p i}) letI : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientFintype (Ideal.span {p i}) ∏i,(((actualSextic (Ideal.span {p i}) (hg i))⁻¹)^2) (D.sigma i)* phase (actualSextic (Ideal.span {p i}) (hg i)) (quotientTrace (p i) (hp i)) (j i) (D.epsilon i) lemma activePhase_norm (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (hchar:∀i,ringChar (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (j:ι→ℕ) (hj:∀i,j i<6) : ‖D.activePhase hp hg j‖=1 := by letI : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientField (Ideal.span {p i}) letI : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientFintype (Ideal.span {p i}) rw [activePhase,norm_prod] have he (i:ι):‖(((actualSextic (Ideal.span {p i}) (hg i))⁻¹)^2) (D.sigma i)* phase (actualSextic (Ideal.span {p i}) (hg i)) (quotientTrace (p i) (hp i)) (j i) (D.epsilon i)‖=1 := by rw [norm_mul,FiniteRayExpansion.norm_char_unit,one_mul] exact canonical_phase_norm (Ideal.span {p i}) (hg i) (hchar i) (quotientTrace (p i) (hp i)) (GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive (p i) (hp i)) (j i) (hj i) (D.epsilon i) simp only [he,Finset.prod_const_one] lemma bracketProduct_eq (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (x:_root_.OAI.ActualEisensteinCubic.O) : letI : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientField (Ideal.span {p i}) letI : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientFintype (Ideal.span {p i}) D.bracketProduct hp hg j x=D.activePhase hp hg j* ∏i,bracket (actualSextic (Ideal.span {p i}) (hg i)) (j i) (Ideal.Quotient.mk _ x) := by letI : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientField (Ideal.span {p i}) letI : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientFintype (Ideal.span {p i}) exact Finset.prod_mul_distrib def modelRowPhase (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (s:FixedCuspShape (fixedCusp a0 c0 mode)) (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) : ℂ := star D.fixedFactor*D.activePhase hp hg j* ramifiedBranchPhase (fun i=>Ideal.span {p i}) hg j (sourcePhaseUnit s.index s.phaseUpperUnit u) (sourcePhaseExponent s.index m) theorem modelRowPhase_norm (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (hN:(9:_root_.OAI.ActualEisensteinCubic.O)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (s:FixedCuspShape (fixedCusp a0 c0 mode)) (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (hchar:∀i,ringChar (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i})≠2) (j:ι→ℕ) (hj:∀i,j i<6) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) : ‖D.modelRowPhase s hp hg j u m‖=1 := by rw [modelRowPhase,norm_mul,norm_mul,norm_star,D.fixedFactor_norm hN hr hbase, D.activePhase_norm hp hg hchar j hj,ramifiedBranchPhase_norm,one_mul,one_mul] theorem model_coefficient (D:ControlledStratumArithmetic p N a0 c0 mode) [∀i,(Ideal.span {p i}).IsMaximal] (s:FixedCuspShape (fixedCusp a0 c0 mode)) (hp:∀i,p i≠0) (hc0:c0≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (m:ℕ) (I J:Ideal _root_.OAI.ActualEisensteinCubic.O) : letI : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientField (Ideal.span {p i}) letI : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientFintype (Ideal.span {p i}) s.amplitude u m I J* (star D.fixedFactor*A4BadPhase c0 hc0 (D.matrix (fun _=>1) 1 1) D.U (s.modelDualNumerator u m I J))* D.bracketProduct hp hg j (s.modelDualNumerator u m I J)= D.modelRowPhase s hp hg j u m* ∑e:ι→Fin 3, fixedCuspArrayWithPhase s.index u (s.reflectionStaticPhase c0 hc0 (Ideal.Quotient.mk _ (-(D.matrix (fun _=>1) 1 1)*D.U)) (s.modelDualNumerator u) u) m I J* reflectedBranch (fun i=>Ideal.span {p i}) hg j e (primaryGenerator I) (primaryGenerator J) := by letI : ∀ i, Field (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientField (Ideal.span {p i}) letI : ∀ i, Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {p i}) := fun i => coefficientFintype (Ideal.span {p i}) rw [D.bracketProduct_eq] have he:=s.model_array_brackets (fun i=>Ideal.span {p i}) hg j c0 hc0 (D.matrix (fun _=>1) 1 1) D.U u m I J calc _=(star D.fixedFactor*D.activePhase hp hg j)* ((s.amplitude u m I J*A4BadPhase c0 hc0 (D.matrix (fun _=>1) 1 1) D.U (s.modelDualNumerator u m I J))* (∏i,bracket (actualSextic (Ideal.span {p i}) (hg i)) (j i) (Ideal.Quotient.mk _ (s.modelDualNumerator u m I J)))) := by ring _=_ := by rw [he];dsimp only [modelRowPhase];ring end ControlledStratumArithmetic lemma fixed_stratum_kernel_scale (j:Fin 3) (c0 r:_root_.OAI.ActualEisensteinCubic.O) : 27*(sourceCuspScale j)^2*(Ideal.absNorm (Ideal.span {c0*r}):ℝ)^2= fixedCuspLevelScale j c0*(Ideal.absNorm (Ideal.span {r}):ℝ)^2 := by rw [←Ideal.span_singleton_mul_span_singleton,map_mul,Nat.cast_mul,mul_pow,fixedCuspLevelScale] ring end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.Eisenstein.ReflectionFibers /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical namespace CubicEisenstein section open scoped BigOperators Classical ContDiff MatrixGroups open ActualEisensteinCubic CompletedGauss CompletedDyadic CubicKubota CubicJacobiGlobal ConcreteTraceCRT open LocalReflectionBrackets ShortDraftCusp namespace RootNotationReflectionFibers01 abbrev Eis := ActualEisensteinCubic.O end RootNotationReflectionFibers01 open RootNotationReflectionFibers01 (Eis) namespace FixedFourierGeometry variable {c:Eis} {h:Eis⧸Ideal.span {c}} (G:FixedFourierGeometry c h) variable {ι:Type*} [Fintype ι] {p:ι→Eis} {N:Eis} lemma stratum_model_coefficient (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (u:Eisˣ) (m:ℕ) (I J:Ideal Eis) : G.shape.amplitude u m I J* (star D.fixedFactor*A4BadPhase G.c0 G.denominator_ne_zero (D.matrix (fun _=>1) 1 1) D.U (G.dualNumerator u m I J))*D.bracketProduct hp hg j (G.dualNumerator u m I J)= D.modelRowPhase G.shape hp hg j u m* ∑e:ι→Fin 3,G.array (Ideal.Quotient.mk _ (-(D.matrix (fun _=>1) 1 1)*D.U)) u m I J* reflectedBranch (fun i=>Ideal.span {p i}) hg j e (primaryGenerator I) (primaryGenerator J) := D.model_coefficient G.shape hp G.denominator_ne_zero hg j u m I J theorem reflectedValue_eq_model_series (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (W:ℝ→ℂ) (X:ℝ) : D.reflectedValue G.shape hp G.denominator_ne_zero hg j W X= fixedRadialCoefficientScalar*G.shape.stratumShapeFactor (G.c0*∏i,p i)* ∑'t:ThetaFullIndex, (D.modelRowPhase G.shape hp hg j t.1 t.2.1* ∑e:ι→Fin 3, G.array (Ideal.Quotient.mk _ (-(D.matrix (fun _=>1) 1 1)*D.U)) t.1 t.2.1 t.2.2.1.val t.2.2.2.val* reflectedBranch (fun i=>Ideal.span {p i}) hg j e (primaryGenerator t.2.2.1.val) (primaryGenerator t.2.2.2.val)) / ((ramifiedScale 1 completedRamifiedStep t.2.1* Real.sqrt (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ):ℝ):ℂ)* CubicReflectionKernel.paperKernel (Vstar W) ((X/(G.levelScale*(Ideal.absNorm (Ideal.span {∏i,p i}):ℝ)^2))* (ramifiedScale 1 completedRamifiedStep t.2.1)^3* (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ)^3) := by unfold ControlledStratumArithmetic.reflectedValue apply congrArg (fun z:ℂ=>fixedRadialCoefficientScalar*G.shape.stratumShapeFactor (G.c0*∏i,p i)*z) apply tsum_congr intro t rw [fixed_stratum_kernel_scale] have he:=G.stratum_model_coefficient D hp hg j t.1 t.2.1 t.2.2.1.val t.2.2.2.val have hx:sourceCuspPhaseNumerator G.shape.index (G.shape.upper 0 0) (thetaFullFrequency t)= G.dualNumerator t.1 t.2.1 t.2.2.1.val t.2.2.2.val := by rw [thetaFullFrequency_eq_fixedCuspArrayIndex] rfl rw [hx] let denominator:ℂ:=((ramifiedScale 1 completedRamifiedStep t.2.1* Real.sqrt (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ):ℝ):ℂ) let kernel:ℂ:=CubicReflectionKernel.paperKernel (Vstar W) ((X/(G.levelScale*(Ideal.absNorm (Ideal.span {∏i,p i}):ℝ)^2))* (ramifiedScale 1 completedRamifiedStep t.2.1)^3* (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ)^3) change _/denominator*kernel*_=_/denominator*kernel calc _=(G.shape.amplitude t.1 t.2.1 t.2.2.1.val t.2.2.2.val* (star D.fixedFactor*A4BadPhase G.c0 G.denominator_ne_zero (D.matrix (fun _=>1) 1 1) D.U (G.dualNumerator t.1 t.2.1 t.2.2.1.val t.2.2.2.val))* D.bracketProduct hp hg j (G.dualNumerator t.1 t.2.1 t.2.2.1.val t.2.2.2.val))/denominator*kernel := by ring _=_:=by rw [he] end FixedFourierGeometry end open ActualEisensteinCubic CompletedGauss namespace RootNotationReflectionFibers02 abbrev Eis := ActualEisensteinCubic.O end RootNotationReflectionFibers02 open RootNotationReflectionFibers02 (Eis) abbrev CuspIdealIndex := Eisˣ×ℕ×NonzeroDualIdeal×NonzeroDualIdeal def thetaFullToIdealIndex (t:ThetaFullIndex) : CuspIdealIndex := (t.1,t.2.1,primaryCubePairToMellinIndex t.2.2) lemma thetaFullToIdealIndex_injective : Function.Injective thetaFullToIdealIndex := by intro t v h apply Prod.ext · exact congrArg (fun x:CuspIdealIndex=>x.1) h · apply Prod.ext · exact congrArg (fun x:CuspIdealIndex=>x.2.1) h · apply primaryCubePairToMellinIndex_injective exact congrArg (fun x:CuspIdealIndex=>x.2.2) h lemma fixedCuspArrayWithPhase_eligible (j:Fin 3) (u:Eisˣ) (φ:ℕ→Ideal Eis→Ideal Eis→ℂ) (m:ℕ) (I J:Ideal Eis) (h:fixedCuspArrayWithPhase j u φ m I J≠0) : fixedCuspArrayEligible I J := by by_contra he exact h (fixedCuspArrayWithPhase_zero j u φ m I J he) theorem fixedCuspArrayWithPhase_tsum_full_index (j:Eisˣ→Fin 3) (φ:Eisˣ→ℕ→Ideal Eis→Ideal Eis→ℂ) (w:CuspIdealIndex→ℂ) : (∑'t:CuspIdealIndex,fixedCuspArrayWithPhase (j t.1) t.1 (φ t.1) t.2.1 t.2.2.1.val t.2.2.2.val*w t)= ∑'t:ThetaFullIndex,fixedCuspArrayWithPhase (j t.1) t.1 (φ t.1) t.2.1 t.2.2.1.val t.2.2.2.val*w (thetaFullToIdealIndex t) := by apply tsum_eq_tsum_of_ne_zero_bij (fun t=>thetaFullToIdealIndex t.val) · exact thetaFullToIdealIndex_injective.comp Subtype.val_injective · intro t ht change fixedCuspArrayWithPhase (j t.1) t.1 (φ t.1) t.2.1 t.2.2.1.val t.2.2.2.val*w t≠0 at ht have ha:fixedCuspArrayWithPhase (j t.1) t.1 (φ t.1) t.2.1 t.2.2.1.val t.2.2.2.val≠0:=by intro hz exact ht (by rw [hz,zero_mul]) obtain ⟨hs,hI,hJ⟩:=fixedCuspArrayWithPhase_eligible _ _ _ _ _ _ ha let v:ThetaFullIndex:=(t.1,t.2.1,⟨t.2.2.1.val,hs,hI⟩,⟨t.2.2.2.val,hJ⟩) have hv:thetaFullToIdealIndex v=t:= Prod.ext rfl (Prod.ext rfl (Prod.ext (Subtype.ext rfl) (Subtype.ext rfl))) refine ⟨⟨v,?_⟩,hv⟩ change fixedCuspArrayWithPhase (j (thetaFullToIdealIndex v).1) (thetaFullToIdealIndex v).1 (φ (thetaFullToIdealIndex v).1) (thetaFullToIdealIndex v).2.1 (thetaFullToIdealIndex v).2.2.1.val (thetaFullToIdealIndex v).2.2.2.val* w (thetaFullToIdealIndex v)≠0 rwa [hv] · intro t rfl end CubicEisenstein open scoped Classical BigOperators namespace CompletedGauss variable {ι:Type*} [Fintype ι] [DecidableEq ι] def mandatoryActiveEquiv (R:Finset ι) : {A:Finset ι // R⊆A}≃Finset {i:ι // i∉R} where toFun A:=A.val.subtype (fun i=>i∉R) invFun B:=⟨R∪B.image Subtype.val,Finset.subset_union_left⟩ left_inv A:=by apply Subtype.ext ext i simp only [Finset.mem_union,Finset.mem_image,Finset.mem_subtype] constructor · rintro (hi|⟨j,hj,rfl⟩) · exact A.property hi · exact hj · intro hi by_cases hr:i∈R · exact Or.inl hr · exact Or.inr ⟨⟨i,hr⟩,hi,rfl⟩ right_inv B:=by ext i simp only [Finset.mem_subtype,Finset.mem_union,Finset.mem_image] constructor · rintro (hi|⟨j,hj,hji⟩) · exact False.elim (i.property hi) · have he:j=i:=Subtype.ext hji simpa only [he] using hj · intro hi exact Or.inr ⟨i,hi,rfl⟩ lemma sum_mandatory_active {V:Type*} [AddCommMonoid V] (R:Finset ι) (F:Finset ι→V) (hz:∀A,¬R⊆A→F A=0) : (∑A:Finset ι,F A)= ∑B:Finset {i:ι // i∉R},F (R∪B.image Subtype.val) := by calc _=∑A:Finset ι,if R⊆A then F A else 0:=by apply Finset.sum_congr rfl intro A hA by_cases h:R⊆A · simp only [if_pos h] · simp only [if_neg h,hz A h] _=∑A:{A:Finset ι // R⊆A},F A.val:=by rw [←Finset.sum_filter] exact Finset.sum_subtype (Finset.univ.filter (fun A:Finset ι=>R⊆A)) (by simp) F _=_:=by apply Fintype.sum_equiv (mandatoryActiveEquiv R) intro A exact congrArg F (congrArg Subtype.val ((mandatoryActiveEquiv R).left_inv A)).symm theorem inactive_weight_mandatory_active (R:Finset ι) (z:ι→ℂ) (hz:∀i∈R,z i=0) (F:Finset ι→ℂ) : (∑A:Finset ι,(∏i∈(Finset.univ:Finset ι)\A,z i)*F A)= ∑B:Finset {i:ι // i∉R}, (∏i∈(Finset.univ:Finset ι)\(R∪B.image Subtype.val),z i)* F (R∪B.image Subtype.val) := by apply sum_mandatory_active R intro A hA have hex:∃i∈R,i∉A:=by by_contra! hn exact hA hn obtain ⟨i,hi,hni⟩:=hex have hm:i∈(Finset.univ:Finset ι)\A:=by simp [hni] rw [Finset.prod_eq_zero hm (hz i hi),zero_mul] lemma inactive_product_complement (R:Finset ι) (z:ι→ℂ) (B:Finset {i:ι // i∉R}) : (∏i∈(Finset.univ:Finset ι)\(R∪B.image Subtype.val),z i)= ∏i∈(Finset.univ:Finset {i:ι // i∉R})\B,z i.val := by symm apply Finset.prod_bij (fun i _=>i.val) · intro i hi simp only [Finset.mem_sdiff,Finset.mem_univ,true_and] at hi ⊢ intro hmem rcases Finset.mem_union.mp hmem with hr|hb · exact i.property hr · obtain ⟨j,hj,hji⟩:=Finset.mem_image.mp hb exact hi ((Subtype.ext hji) ▸ hj) · intro i hi j hj he exact Subtype.ext he · intro i hi have hnot:i∉R∪B.image Subtype.val:=(Finset.mem_sdiff.mp hi).2 have hr:i∉R:=fun h=>hnot (Finset.mem_union_left _ h) refine ⟨⟨i,hr⟩,?_,rfl⟩ simp only [Finset.mem_sdiff,Finset.mem_univ,true_and] intro hb exact hnot (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨⟨i,hr⟩,hb,rfl⟩)) · intro i hi rfl theorem inactive_weight_optional_active (R:Finset ι) (z:ι→ℂ) (hz:∀i∈R,z i=0) (F:Finset ι→ℂ) : (∑A:Finset ι,(∏i∈(Finset.univ:Finset ι)\A,z i)*F A)= ∑B:Finset {i:ι // i∉R}, (∏i∈(Finset.univ:Finset {i:ι // i∉R})\B,z i.val)* F (R∪B.image Subtype.val) := by rw [inactive_weight_mandatory_active R z hz F] apply Finset.sum_congr rfl intro B hB rw [inactive_product_complement] end CompletedGauss namespace CanonicalRowCompletion open ActualEisensteinCubic CanonicalQuadraticSieve CompletedGauss IdealMobiusDivisorSum namespace RootNotationReflectionFibers03 abbrev Eis := ActualEisensteinCubic.O end RootNotationReflectionFibers03 open RootNotationReflectionFibers03 (Eis) lemma excluded_prime_dvd_row_mask (q:ℕ) (m:Eis) (F P:Ideal Eis) (hP:P∈reflectionExcludedPrimes q) : P∣Ideal.span {m*excludedGenerator (reflectionExcludedPrimes q)}*F := by apply dvd_mul_of_dvd_left apply Ideal.dvd_iff_le.mpr apply Ideal.span_le.mpr exact Set.singleton_subset_iff.mpr (P.mul_mem_left m (excludedGenerator_mem _ hP)) lemma residual_prime_not_excluded (q:ℕ) (m:Eis) (F I P:Ideal Eis) (hP:Prime P) (hres:P∣rowResidualPart I (Ideal.span {m*excludedGenerator (reflectionExcludedPrimes q)}*F)) : P∉reflectionExcludedPrimes q := by intro hmem have hn:¬P∣Ideal.span {m*excludedGenerator (reflectionExcludedPrimes q)}*F:= ((prime_dvd_rowResidualPart_iff _ _ P hP).mp hres).2 exact hn (excluded_prime_dvd_row_mask q m F P hmem) lemma residual_coprime_fixed_conductor (q:ℕ) (hq:q≠0) (m:Eis) (F I:Ideal Eis) : IsCoprime (Ideal.span {reflectionConductor q}) (rowResidualPart I (Ideal.span {m*excludedGenerator (reflectionExcludedPrimes q)}*F)) := by let Q:=Ideal.span {m*excludedGenerator (reflectionExcludedPrimes q)}*F apply (IdealCoprimeSieveOperator.primeSupport_disjoint_iff (Ideal.span_singleton_eq_bot.not.mpr (reflectionConductor_ne_zero q hq)) (squarefreeResidualPart_ne_zero (rowSimplePart I) Q)).mp apply Finset.disjoint_left.mpr intro P hfixed hres have hp:Prime P:=support_prime hfixed have hd:P∣Ideal.span {reflectionConductor q}:= UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors (Multiset.mem_toFinset.mp hfixed) have hr:P∣rowResidualPart I Q:= UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors (Multiset.mem_toFinset.mp hres) exact residual_prime_not_excluded q m F I P hp hr (reflectionConductor_prime_mem q hq P hp hd) end CanonicalRowCompletion open scoped BigOperators Classical namespace CompletedGauss section open ActualEisensteinCubic CanonicalQuadraticSieve namespace RootNotationReflectionFibers04 abbrev Eis := ActualEisensteinCubic.O end RootNotationReflectionFibers04 open RootNotationReflectionFibers04 (Eis) def representativeRowFiber (rows:Finset (Ideal Eis)) (I Q:Ideal Eis) : Finset (Ideal Eis) := completedRowFiber rows Q (rowPowerfulPart I) (rowMaskPart I Q) def reconstructFiberRow (I Q k:Ideal Eis) : Ideal Eis := rowPowerfulPart I*rowMaskPart I Q*k lemma reconstructFiberRow_of_original (rows:Finset (Ideal Eis)) (I Q J:Ideal Eis) (hJ:J∈representativeRowFiber rows I Q) (hJ0:J≠0) : reconstructFiberRow I Q (rowResidualPart J Q)=J := by obtain ⟨_,hA,hT⟩:=Finset.mem_filter.mp hJ rw [reconstructFiberRow,←hA,←hT] exact row_powerful_mask_residual_product J Q hJ0 def fiberResidualIndex (rows:Finset (Ideal Eis)) (I Q:Ideal Eis) (K:ℝ) (hbad:∀P∈fixedBadPrimes,P∣Q) (hrows:∀J∈rows,J≠0 ∧ (Ideal.absNorm J:ℝ)≤K) (J:representativeRowFiber rows I Q) : idealRange (completedResidualScale K I Q) := ⟨rowResidualPart J.val Q,completedRowFiber_residual_range rows Q (rowPowerfulPart I) (rowMaskPart I Q) hbad K hrows J.val J.property⟩ def extendFiberRowScalar {α:Type*} (rows:Finset (Ideal Eis)) (I Q:Ideal Eis) (K:ℝ) (scalar:α → representativeRowFiber rows I Q → ℂ) (a:α) (k:idealRange (completedResidualScale K I Q)) : ℂ := if h:reconstructFiberRow I Q k.val∈representativeRowFiber rows I Q then scalar a ⟨reconstructFiberRow I Q k.val,h⟩ else 0 lemma extendFiberRowScalar_norm_le_one {α:Type*} (rows:Finset (Ideal Eis)) (I Q:Ideal Eis) (K:ℝ) (scalar:α → representativeRowFiber rows I Q → ℂ) (hscalar:∀a J,‖scalar a J‖≤1) (a:α) (k:idealRange (completedResidualScale K I Q)) : ‖extendFiberRowScalar rows I Q K scalar a k‖≤1 := by unfold extendFiberRowScalar split_ifs · exact hscalar _ _ · simp lemma extendFiberRowScalar_at_original {α:Type*} (rows:Finset (Ideal Eis)) (I Q:Ideal Eis) (K:ℝ) (hbad:∀P∈fixedBadPrimes,P∣Q) (hrows:∀J∈rows,J≠0 ∧ (Ideal.absNorm J:ℝ)≤K) (scalar:α → representativeRowFiber rows I Q → ℂ) (a:α) (J:representativeRowFiber rows I Q) : extendFiberRowScalar rows I Q K scalar a (fiberResidualIndex rows I Q K hbad hrows J)=scalar a J := by have hJ0:J.val≠0:=(hrows J.val (Finset.mem_filter.mp J.property).1).1 have he:=reconstructFiberRow_of_original rows I Q J.val J.property hJ0 simp only [extendFiberRowScalar,fiberResidualIndex,he,dif_pos J.property] end open ActualEisensteinCubic CanonicalQuadraticSieve namespace RootNotationReflectionFibers05 abbrev Eis := ActualEisensteinCubic.O end RootNotationReflectionFibers05 open RootNotationReflectionFibers05 (Eis) lemma representativeFiber_parts (rows:Finset (Ideal Eis)) (I Q:Ideal Eis) (J:representativeRowFiber rows I Q) : rowPowerfulPart J.val=rowPowerfulPart I ∧ rowMaskPart J.val Q=rowMaskPart I Q := (Finset.mem_filter.mp J.property).2 lemma representativeFiber_residualScale (rows:Finset (Ideal Eis)) (I Q:Ideal Eis) (J:representativeRowFiber rows I Q) (K:ℝ) : completedResidualScale K J.val Q=completedResidualScale K I Q := by have hs:=representativeFiber_parts rows I Q J exact completedResidualScale_eq_on_fiber K J.val I Q hs.1 hs.2 end CompletedGauss open scoped Classical BigOperators namespace CompletedGauss.FreeReflection open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve namespace RootNotationReflectionFibers06 abbrev Eis := ActualEisensteinCubic.O end RootNotationReflectionFibers06 open RootNotationReflectionFibers06 (Eis) def fixedRayFiberFromRows (c:Eis) (hc:c≠0) (rows:Finset (Ideal Eis)) (I F Q Q0:Ideal Eis) (hI:I≠0) (hQ:Q≠0) (K:ℝ) (scalar:(FixedBranchIndex c hc I Q Q0×ℕ)→ representativeRowFiber rows I Q→ℂ) (hscalar:∀a J,‖scalar a J‖≤1) : ReflectedFiberData (fixedReflectionRayCount c hc) (fixedCuspLevelBound c) K I F Q := fixedRayFiber c hc I F Q Q0 hI hQ K (fun _=>1) (by intro x;simp) (fun x m=>extendFiberRowScalar rows I Q K scalar (x,m)) (fun x m=>extendFiberRowScalar_norm_le_one rows I Q K scalar hscalar (x,m)) end CompletedGauss.FreeReflection end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.ControlledPrimeStrata /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CanonicalRowCompletion open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid namespace RootNotationControlledPrimeStrata01 abbrev Eis := ActualEisensteinCubic.O end RootNotationControlledPrimeStrata01 open RootNotationControlledPrimeStrata01 (Eis) def freePrimaryPrime (I Q:Ideal Eis) (P:FreePrimeIndex I Q) : Eis := primaryPrime P.val.val lemma freePrimaryPrime_ne_zero (I Q:Ideal Eis) (hI:Supported I) (P:FreePrimeIndex I Q) : freePrimaryPrime I Q P≠0 := let : P.val.val.IsMaximal := primeIndexMaximal I P.val primaryPrime_ne_zero P.val.val (supported_factors_good I hI P.val.val (Multiset.mem_toFinset.mp P.val.property)).2.1 lemma freePrimaryPrime_span (I Q:Ideal Eis) (hI:Supported I) (P:FreePrimeIndex I Q) : Ideal.span {freePrimaryPrime I Q P}=P.val.val := (primaryPrime_spec P.val.val (freePrimaryPrime_ne_zero I Q hI P)).2.2.1 lemma freePrimaryPrime_primary (I Q:Ideal Eis) (hI:Supported I) (P:FreePrimeIndex I Q) : lambda^2∣freePrimaryPrime I Q P-1 := (primaryPrime_spec P.val.val (freePrimaryPrime_ne_zero I Q hI P)).2.2.2 lemma freePrimaryPrime_maximal (I Q:Ideal Eis) (hI:Supported I) (P:FreePrimeIndex I Q) : (Ideal.span {freePrimaryPrime I Q P}:Ideal Eis).IsMaximal := by let : P.val.val.IsMaximal := primeIndexMaximal I P.val rw [freePrimaryPrime_span I Q hI P] infer_instance lemma freePrimaryPrime_good (I Q:Ideal Eis) (hI:Supported I) (P:FreePrimeIndex I Q) : lambda∉(Ideal.span {freePrimaryPrime I Q P}:Ideal Eis) := by rw [freePrimaryPrime_span I Q hI P] exact (supported_factors_good I hI P.val.val (Multiset.mem_toFinset.mp P.val.property)).2.1 lemma freePrimaryPrime_odd (I Q:Ideal Eis) (hI:Supported I) (P:FreePrimeIndex I Q) : ringChar (Eis⧸Ideal.span {freePrimaryPrime I Q P})≠2 := by rw [freePrimaryPrime_span I Q hI P] exact (supported_factors_good I hI P.val.val (Multiset.mem_toFinset.mp P.val.property)).2.2 lemma freePrimaryPrime_coprime (I Q:Ideal Eis) (hI:Supported I) : Pairwise (fun P R:FreePrimeIndex I Q => IsCoprime (Ideal.span {freePrimaryPrime I Q P}:Ideal Eis) (Ideal.span {freePrimaryPrime I Q R})) := by intro P R hPR rw [freePrimaryPrime_span I Q hI P,freePrimaryPrime_span I Q hI R] exact freePrimeIndex_pairwise_coprime I Q hPR lemma freePrimaryPrime_coprime_fixed (I Q:Ideal Eis) (hI:Supported I) (P:FreePrimeIndex I Q) : IsCoprime Q (Ideal.span {freePrimaryPrime I Q P}:Ideal Eis) := by rw [freePrimaryPrime_span I Q hI P] exact freePrimeIndex_coprime I Q P lemma actualSextic_power_transport (P R:Ideal Eis) [P.IsMaximal] [R.IsMaximal] (hP:lambda∉P) (hR:lambda∉R) (he:P=R) (j:ℕ) (n:Eis) : (actualSextic P hP^j) (Ideal.Quotient.mk P n)= (actualSextic R hR^j) (Ideal.Quotient.mk R n) := by subst R rfl theorem freePrimeRow_eq_primary_family (I Q:Ideal Eis) (hI:Supported I) (n:Eis) : letI : ∀P:FreePrimeIndex I Q,(Ideal.span {freePrimaryPrime I Q P}:Ideal Eis).IsMaximal:= freePrimaryPrime_maximal I Q hI freePrimeRow I hI Q n= finiteSexticRow (fun P:FreePrimeIndex I Q=>Ideal.span {freePrimaryPrime I Q P}) (freePrimaryPrime_good I Q hI) (fun P=>(normalizedFactors I).count P.val.val%6) n := by let : ∀ P : FreePrimeIndex I Q, P.val.val.IsMaximal := fun P => primeIndexMaximal I P.val let : ∀P:FreePrimeIndex I Q,(Ideal.span {freePrimaryPrime I Q P}:Ideal Eis).IsMaximal:= freePrimaryPrime_maximal I Q hI unfold freePrimeRow finiteSexticRow apply Finset.prod_congr rfl intro P _ exact actualSextic_power_transport _ _ _ _ (freePrimaryPrime_span I Q hI P).symm _ n end CanonicalRowCompletion namespace FixedRayActiveSet theorem fourier_inversion_by_active_set {ι:Type*} [Fintype ι] (F:ι→Type*) [∀i,Field (F i)] [∀i,Fintype (F i)] (ψ:∀i,AddChar (F i) ℂ) (hψ:∀i,(ψ i).IsPrimitive) (φ:∀i,F i→ℂ) (x:∀i,F i) : (∏i,φ i (x i))= ∑A∈(Finset.univ:Finset ι).powerset, (∏i∈(Finset.univ:Finset ι)\A,CubicEisenstein.finiteAdditiveFourierCoeff (ψ i) (φ i) 0)* (∑v:∀i:A,(F i.val)ˣ, (∏i:A,CubicEisenstein.finiteAdditiveFourierCoeff (ψ i.val) (φ i.val) (v i)) * (∏i:A,ψ i.val ((v i:F i.val)*x i.val))) := by let f:=fun i (a:F i)=>CubicEisenstein.finiteAdditiveFourierCoeff (ψ i) (φ i) a*ψ i (a*x i) have he: (∑h:∀i,F i,∏i,f i (h i))=∏i,φ i (x i):=by rw [←Fintype.prod_sum] apply Finset.prod_congr rfl intro i hi exact CubicEisenstein.finiteAdditiveFourier_inversion (ψ i) (hψ i) (φ i) (x i) rw [←he,sum_by_active_strata] apply Finset.sum_congr rfl intro A hA rw [sum_active_stratum] have hz:(∏i∈(Finset.univ:Finset ι)\A,f i 0)= ∏i∈(Finset.univ:Finset ι)\A,CubicEisenstein.finiteAdditiveFourierCoeff (ψ i) (φ i) 0:=by apply Finset.prod_congr rfl intro i hi simp only [f,zero_mul,AddChar.map_zero_eq_one,mul_one] rw [hz,mul_comm] congr 1 rw [show (∑v:∀i:A,(F i.val)ˣ, (∏i:A,CubicEisenstein.finiteAdditiveFourierCoeff (ψ i.val) (φ i.val) (v i)) * (∏i:A,ψ i.val ((v i:F i.val)*x i.val)))= ∑v:∀i:A,(F i.val)ˣ,∏i:A,f i.val (v i) by apply Finset.sum_congr rfl intro v hv exact (Finset.prod_mul_distrib).symm] calc _=∏i:A,∑u:(F i.val)ˣ,f i.val (u:F i.val):= (Finset.prod_coe_sort A (fun i=>∑u:(F i)ˣ,f i (u:F i))).symm _=_:=Fintype.prod_sum (fun (i:A) (u:(F i.val)ˣ)=>f i.val (u:F i.val)) end FixedRayActiveSet open scoped BigOperators Classical ContDiff namespace CubicEisenstein section open ActualEisensteinCubic CompletedGauss ConcreteTraceCRT namespace RootNotationControlledPrimeStrata02 abbrev Eis := ActualEisensteinCubic.O end RootNotationControlledPrimeStrata02 open RootNotationControlledPrimeStrata02 (Eis) theorem completedBesselProfile_of_finite_cusp_multiplier (Ψ:Eis→*ℂ) (Q:Ideal Eis) (hperiod:CanonicalCoefficientClass.FactorsModulo Q Ψ) (c:Eis) (hc:c≠0) [Fintype (Eis⧸Ideal.span {c})] (hcQ:Ideal.span {c}≤Ideal.span {(9:Eis)}*Q) {ι:Type*} [Fintype ι] (d:ι→SourceCuspDatum) (w:ι→ℂ) (hmult:∀n:Eis,(∑i,w i*ShortDraftTrace.breveE (-cuspFrequency n*(d i).point))=fixedThetaTwist Ψ n) (v:ℝ) (hv:0(d i).point) w v hv 0 simp only [hmult] at hf have hcseries:=traceTwistedConjugateSource_wirtingerBar c hc (fixedThetaQuotient Ψ c) v hv 0 simp only [fixedThetaQuotient_mk Ψ Q hperiod c hcQ] at hcseries have he:(∑i,w i*cuspBarProfile cubicSourceConjugateFunction (d i).point v)= thetaDerivativeScalar*completedBesselProfile Ψ thetaBesselScale v:=by rw [←finiteConjugateSource_wirtingerBar_sum (fun i=>(d i).point) w v hv] calc _=horizontalWirtingerBar (traceTwistedConjugateSource c hc (fixedThetaQuotient Ψ c) v hv) 0:= hf.trans hcseries.symm _=_:=thetaTwistedSource_wirtingerBar_eq_completedBesselProfile Ψ Q hperiod c hc hcQ v hv rw [he,←mul_assoc,inv_mul_cancel₀ thetaDerivativeScalar_ne_zero,one_mul] theorem completedT_of_finite_cusp_multiplier (Ψ:Eis→*ℂ) (hΨ:∀x,‖Ψ x‖≤1) (Q:Ideal Eis) (hperiod:CanonicalCoefficientClass.FactorsModulo Q Ψ) (c:Eis) (hc:c≠0) [Fintype (Eis⧸Ideal.span {c})] (hcQ:Ideal.span {c}≤Ideal.span {(9:Eis)}*Q) {ι:Type*} [Fintype ι] (d:ι→SourceCuspDatum) (w:ι→ℂ) (hmult:∀n:Eis,(∑i,w i*ShortDraftTrace.breveE (-cuspFrequency n*(d i).point))=fixedThetaTwist Ψ n) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0thetaDerivativeScalar⁻¹*w i) hFG W lo hi hlo hsupp hW X hX,Finset.mul_sum] apply Finset.sum_congr rfl intro i hi ring end open scoped BigOperators Classical MatrixGroups open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss CubicKubota namespace RootNotationControlledPrimeStrata03 abbrev Eis := ActualEisensteinCubic.O end RootNotationControlledPrimeStrata03 open RootNotationControlledPrimeStrata03 (Eis) lemma theta_lifted_phase (c:Eis) (hc:c≠0) (lift n:Eis) : ShortDraftTrace.breveE (-cuspFrequency n*(eisLam^2*eisEmbedding lift/eisEmbedding c))= quotientTrace c hc (Ideal.Quotient.mk _ lift*Ideal.Quotient.mk _ n) := by rw [←map_mul] simp only [quotientTrace,eisTraceModChar,IdealGaussCRT.traceModChar_mk] congr 1 unfold cuspFrequency rw [map_mul] have hc0:=eisEmbedding_ne_zero hc have hl:=eisLam_ne_zero field_simp linear_combination -(eisEmbedding n*eisEmbedding lift)*TraceLambdaPhase.eisLam_sq lemma breveE_finset_sum {ι:Type*} (s:Finset ι) (z:ι→ℂ) : ShortDraftTrace.breveE (∑i∈s,z i)=∏i∈s,ShortDraftTrace.breveE (z i) := by induction s using Finset.induction_on with | empty => simp only [Finset.sum_empty,Finset.prod_empty,AddChar.map_zero_eq_one] | @insert i s hi ih => rw [Finset.sum_insert hi,Finset.prod_insert hi,AddChar.map_add_eq_mul,ih] lemma ControlledStratumArithmetic.datum_fourier_phase {ι:Type*} [Fintype ι] {p:ι→Eis} {N a0 c0:Eis} {mode:Bool} (D:ControlledStratumArithmetic p N a0 c0 mode) (hN:(9:Eis)*c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (s:FixedCuspShape (ControlledStratumArithmetic.fixedCusp a0 c0 mode)) (hp:∀i,p i≠0) (hc0:c0≠0) (v:∀i,(Eis⧸Ideal.span {p i})ˣ) (n:Eis) : ShortDraftTrace.breveE (-cuspFrequency n*(D.datum hN hr hbase s hp hc0 v).point)= ShortDraftTrace.breveE (-cuspFrequency n*(eisEmbedding a0/eisEmbedding c0))* ∏i,quotientTrace (p i) (hp i) ((v i:Eis⧸Ideal.span {p i})*Ideal.Quotient.mk _ n) := by rw [D.datum_point] have he:-cuspFrequency n*(eisEmbedding a0/eisEmbedding c0+ eisLam^2*∑i,eisEmbedding (D.lift v i)/eisEmbedding (p i))= -cuspFrequency n*(eisEmbedding a0/eisEmbedding c0)+ ∑i,-cuspFrequency n*(eisLam^2*eisEmbedding (D.lift v i)/eisEmbedding (p i)):=by simp only [Finset.mul_sum,neg_mul,mul_add] congr 1 apply Finset.sum_congr rfl intro i hi ring rw [he,AddChar.map_add_eq_mul,breveE_finset_sum] congr 1 apply Finset.prod_congr rfl intro i hi rw [theta_lifted_phase,D.lift_residue] end CubicEisenstein open scoped BigOperators Classical ContDiff namespace CompletedGauss open ActualEisensteinCubic CubicEisenstein CompletedDyadic namespace RootNotationControlledPrimeStrata04 abbrev Eis := ActualEisensteinCubic.O end RootNotationControlledPrimeStrata04 open RootNotationControlledPrimeStrata04 (Eis) def unextractedCuspCoefficient {ι:Type*} [Fintype ι] (P:ι→Ideal Eis) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (j:ι→ℕ) (e:ι→Fin 3) (ρ q:ℝ) (η:ℕ→Ideal Eis→Ideal Eis→ℂ) (σ:ℕ→ℂ) (m:ℕ) (I J:Ideal Eis) : ℂ := σ m*η m I J*reflectedBranch P hg j e (primaryGenerator I) (primaryGenerator J)/ ((ramifiedScale ρ q m*Real.sqrt (Ideal.absNorm I:ℝ)*(Ideal.absNorm J:ℝ):ℝ):ℂ) lemma unextractedCuspCoefficient_norm {ι:Type*} [Fintype ι] (P:ι→Ideal Eis) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (j:ι→ℕ) (e:ι→Fin 3) (ρ q:ℝ) (hρ:0<ρ) (hq:1≤q) (η:ℕ→Ideal Eis→Ideal Eis→ℂ) (σ:ℕ→ℂ) (hη:∀m I J,‖η m I J‖≤1) (hσ:∀m,‖σ m‖≤1) (m:ℕ) (I J:NonzeroDualIdeal) : ‖unextractedCuspCoefficient P hg j e ρ q η σ m I.val J.val‖≤ (Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 1):ℝ)* Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 2):ℝ)/ Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 0):ℝ))/ρ := by let C:ℝ:=Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 1):ℝ)* Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 2):ℝ)/ Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 0):ℝ) have hC:0≤C:=by dsimp only [C];positivity have hr:0 ‖rawDualKernelTerm (Vstar W) scale ρ q (unextractedCuspCoefficient P hg j e ρ q η σ) x‖) := by apply rawDualKernelTerm_summable_norm (Vstar W) a b ha (Vstar_support W a b hsupp) (Vstar_contDiff W a b ha hsupp hW) scale ρ q ((Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 1):ℝ)* Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 2):ℝ)/ Real.sqrt (Ideal.absNorm (reflectionExtractedDivisor P j e 0):ℝ))/ρ) hscale hρ hq (by positivity) exact unextractedCuspCoefficient_norm P hg j e ρ q hρ hq.le η σ hη hσ end CompletedGauss namespace CubicEisenstein section open ActualEisensteinCubic CompletedGauss CompletedDyadic namespace RootNotationControlledPrimeStrata05 abbrev Eis := ActualEisensteinCubic.O end RootNotationControlledPrimeStrata05 open RootNotationControlledPrimeStrata05 (Eis) namespace FixedFourierGeometry variable {c:Eis} {h:Eis⧸Ideal.span {c}} (G:FixedFourierGeometry c h) variable {ι:Type*} [Fintype ι] {p:ι→Eis} {N:Eis} def stratumBranchTerm (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (u:Eisˣ) (e:ι→Fin 3) (W:ℝ→ℂ) (X:ℝ) (x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal) : ℂ := rawDualKernelTerm (Vstar W) (X/(G.levelScale*(Ideal.absNorm (Ideal.span {∏i,p i}):ℝ)^2)) 1 completedRamifiedStep (unextractedCuspCoefficient (fun i=>Ideal.span {p i}) hg j e 1 completedRamifiedStep (G.array (Ideal.Quotient.mk _ (-(D.matrix (fun _=>1) 1 1)*D.U)) u) (D.modelRowPhase G.shape hp hg j u)) x theorem stratumBranchTerm_summable (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hN:(9:Eis)*G.c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (hchar:∀i,ringChar (Eis⧸Ideal.span {p i})≠2) (j:ι→ℕ) (hj:∀i,j i<6) (u:Eisˣ) (e:ι→Fin 3) (W:ℝ→ℂ) (a b:ℝ) (ha:0‖G.stratumBranchTerm D hp hg j u e W X x‖) := by have hn:0<(Ideal.absNorm (Ideal.span {∏i,p i}):ℝ):=by exact_mod_cast Nat.pos_of_ne_zero (fun hz=> (Finset.prod_ne_zero_iff.mpr (fun i _=>hp i)) (Ideal.span_singleton_eq_bot.mp (Ideal.absNorm_eq_zero_iff.mp hz))) have hlevel:=G.levelScale_pos apply unextractedCuspCoefficient_summable (fun i=>Ideal.span {p i}) hg j e 1 completedRamifiedStep (by norm_num) completedRamifiedStep_gt_one _ _ (G.array_norm_le_one _ u) (fun m=>(D.modelRowPhase_norm hN hr G.primary G.shape hp hg hchar j hj u m).le) W a b ha hsupp hW _ (by positivity) theorem stratumBranchTerm_fubini (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hN:(9:Eis)*G.c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (hchar:∀i,ringChar (Eis⧸Ideal.span {p i})≠2) (j:ι→ℕ) (hj:∀i,j i<6) (W:ℝ→ℂ) (a b:ℝ) (ha:0 ‖∑e:ι→Fin 3,G.stratumBranchTerm D hp hg j u e W X x‖) := by have hb:Summable (fun x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal=> ∑e:ι→Fin 3,‖G.stratumBranchTerm D hp hg j u e W X x‖) := (hasSum_sum (fun e _=>(hs u e).hasSum)).summable exact hb.of_nonneg_of_le (fun _=>norm_nonneg _) (fun _=>norm_sum_le _ _) have hall:Summable (fun t:CuspIdealIndex=> ‖∑e:ι→Fin 3,G.stratumBranchTerm D hp hg j t.1 e W X t.2‖) := (summable_prod_of_nonneg (fun _=>norm_nonneg _)).mpr ⟨hu,Summable.of_finite⟩ rw [hall.of_norm.tsum_prod] apply tsum_congr intro u exact Summable.tsum_finsetSum (fun e _=>(hs u e).of_norm) end FixedFourierGeometry end open ActualEisensteinCubic CompletedGauss CompletedDyadic namespace RootNotationControlledPrimeStrata06 abbrev Eis := ActualEisensteinCubic.O end RootNotationControlledPrimeStrata06 open RootNotationControlledPrimeStrata06 (Eis) namespace FixedFourierGeometry variable {c:Eis} {h:Eis⧸Ideal.span {c}} (G:FixedFourierGeometry c h) variable {ι:Type*} [Fintype ι] {p:ι→Eis} {N:Eis} theorem reflectedValue_eq_branch_sums (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hN:(9:Eis)*G.c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (hchar:∀i,ringChar (Eis⧸Ideal.span {p i})≠2) (j:ι→ℕ) (hj:∀i,j i<6) (W:ℝ→ℂ) (a b:ℝ) (ha:0fixedRadialCoefficientScalar*G.shape.stratumShapeFactor (G.c0*∏i,p i)*z) rw [←G.stratumBranchTerm_fubini D hN hr hp hg hchar j hj W a b ha hsupp hW X hX] let v:G.PhaseResidue:=Ideal.Quotient.mk _ (-(D.matrix (fun _=>1) 1 1)*D.U) let weight:CuspIdealIndex→ℂ:=fun t=> D.modelRowPhase G.shape hp hg j t.1 t.2.1* (∑e:ι→Fin 3,reflectedBranch (fun i=>Ideal.span {p i}) hg j e (primaryGenerator t.2.2.1.val) (primaryGenerator t.2.2.2.val)) / ((ramifiedScale 1 completedRamifiedStep t.2.1* Real.sqrt (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ):ℝ):ℂ)* CubicReflectionKernel.paperKernel (Vstar W) ((X/(G.levelScale*(Ideal.absNorm (Ideal.span {∏i,p i}):ℝ)^2))* (ramifiedScale 1 completedRamifiedStep t.2.1)^3* (Ideal.absNorm t.2.2.1.val:ℝ)*(Ideal.absNorm t.2.2.2.val:ℝ)^3) calc _=∑'t:ThetaFullIndex,G.array v t.1 t.2.1 t.2.2.1.val t.2.2.2.val* weight (thetaFullToIdealIndex t) := by apply tsum_congr intro t dsimp only [weight,thetaFullToIdealIndex,primaryCubePairToMellinIndex] rw [←Finset.mul_sum] ring _=∑'t:CuspIdealIndex,G.array v t.1 t.2.1 t.2.2.1.val t.2.2.2.val*weight t := (fixedCuspArrayWithPhase_tsum_full_index (fun _=>G.shape.index) (G.staticPhase v) weight).symm _=_ := by apply tsum_congr intro t dsimp only [weight,stratumBranchTerm,rawDualKernelTerm,unextractedCuspCoefficient] simp only [Finset.mul_sum,Finset.sum_mul,Finset.sum_div] apply Finset.sum_congr rfl intro e he dsimp only [v,ramifiedScale] ring theorem stratumBranchTerm_tsum_extract (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (hcop:Pairwise (fun i k=>IsCoprime (Ideal.span {p i}) (Ideal.span {p k}))) (j:ι→ℕ) (e:ι→Fin 3) (u:Eisˣ) (W:ℝ→ℂ) (X:ℝ) : let A:=reflectionExtractedDivisor (fun i=>Ideal.span {p i}) j e 1 let B:=reflectionExtractedDivisor (fun i=>Ideal.span {p i}) j e 2 let hA:=reflectionExtractedDivisor_ne_zero (fun i=>Ideal.span {p i}) (fun _i=>NeZero.ne _) j e 1 let hB:=reflectionExtractedDivisor_ne_zero (fun i=>Ideal.span {p i}) (fun _i=>NeZero.ne _) j e 2 (∑'x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal,G.stratumBranchTerm D hp hg j u e W X x)= ∑'x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal, G.stratumBranchTerm D hp hg j u e W X (nonzeroDualDilation A B hA hB x) := by dsimp only apply tsum_nonzeroDualDilation intro x hx dsimp only [stratumBranchTerm,rawDualKernelTerm,unextractedCuspCoefficient] at hx have hnum:= (div_ne_zero_iff.mp (mul_ne_zero_iff.mp hx).1).1 have hpair:G.array (Ideal.Quotient.mk _ (-(D.matrix (fun _=>1) 1 1)*D.U)) u x.1 x.2.1.val x.2.2.val* reflectedBranch (fun i=>Ideal.span {p i}) hg j e (primaryGenerator x.2.1.val) (primaryGenerator x.2.2.val)≠0 := mul_ne_zero (mul_ne_zero_iff.mp (mul_ne_zero_iff.mp hnum).1).2 (mul_ne_zero_iff.mp hnum).2 have hs:=fixedCuspBranchNumerator_support (fun i=>Ideal.span {p i}) hg hcop j e G.shape.index u (G.staticPhase (Ideal.Quotient.mk _ (-(D.matrix (fun _=>1) 1 1)*D.U)) u) x.1 x.2.1.val x.2.2.val hpair exact ⟨hs.1,hs.2.1⟩ theorem smoothedValue_eq_extracted_branch_sums (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hN:(9:Eis)*G.c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hp:∀i,p i≠0) (hcop:Pairwise (fun i k=>IsCoprime (Ideal.span {p i}) (Ideal.span {p k}))) (hg:∀i,lambda∉Ideal.span {p i}) (hchar:∀i,ringChar (Eis⧸Ideal.span {p i})≠2) (j:ι→ℕ) (hj:∀i,j i<6) (W:ℝ→ℂ) (a b:ℝ) (ha:0Ideal.span {p i}) j e 1 let B:=reflectionExtractedDivisor (fun i=>Ideal.span {p i}) j e 2 let hA:=reflectionExtractedDivisor_ne_zero (fun i=>Ideal.span {p i}) (fun _i=>NeZero.ne _) j e 1 let hB:=reflectionExtractedDivisor_ne_zero (fun i=>Ideal.span {p i}) (fun _i=>NeZero.ne _) j e 2 ∑'x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal, G.stratumBranchTerm D hp hg j u e W X (nonzeroDualDilation A B hA hB x) := by rw [D.smoothed_eq_reflected hN hr G.primary G.shape hp G.denominator_ne_zero hcop hg hchar j hj W a b ha hsupp hW X hX, G.reflectedValue_eq_branch_sums D hN hr hp hg hchar j hj W a b ha hsupp hW X hX] apply congrArg (fun z:ℂ=>fixedRadialCoefficientScalar*G.shape.stratumShapeFactor (G.c0*∏i,p i)*z) apply tsum_congr intro u apply Finset.sum_congr rfl intro e he exact G.stratumBranchTerm_tsum_extract D hp hg hcop j e u W X end FixedFourierGeometry end CubicEisenstein open scoped BigOperators Classical namespace CanonicalRowCompletion open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein namespace RootNotationControlledPrimeStrata07 abbrev Eis := ActualEisensteinCubic.O end RootNotationControlledPrimeStrata07 open RootNotationControlledPrimeStrata07 (Eis) lemma freePrimaryPrime_coprime_completion (I Q:Ideal Eis) (hI:Supported I) (c:Eis) (hcQ:(Ideal.span {c}:Ideal Eis)=Ideal.span {(9:Eis)}*Q) (P:FreePrimeIndex I Q) : IsCoprime ((9:Eis)*c) (freePrimaryPrime I Q P) := by have h9:IsCoprime (9:Eis) (freePrimaryPrime I Q P):= (ShortDraftCRT.primary_coprime_nine _ (freePrimaryPrime_primary I Q hI P)).symm have h9ideal:IsCoprime (Ideal.span {(9:Eis)}:Ideal Eis) (Ideal.span {freePrimaryPrime I Q P}):= (Ideal.isCoprime_span_singleton_iff _ _).mpr h9 have hcideal:IsCoprime (Ideal.span {c}:Ideal Eis) (Ideal.span {freePrimaryPrime I Q P}):=by rw [hcQ] exact h9ideal.mul_left (freePrimaryPrime_coprime_fixed I Q hI P) exact h9.mul_left ((Ideal.isCoprime_span_singleton_iff _ _).mp hcideal) theorem exists_freePrimary_controlled_stratum (I Q:Ideal Eis) (hI:Supported I) (c:Eis) (hcQ:(Ideal.span {c}:Ideal Eis)=Ideal.span {(9:Eis)}*Q) (h:Eis⧸Ideal.span {c}) (G:FixedFourierGeometry c h) (A:Finset (FreePrimeIndex I Q)) : Nonempty (ControlledStratumArithmetic (fun i:A=>freePrimaryPrime I Q i.val) ((9:Eis)*c) G.a0 G.c0 G.mode) := by let : ∀i:A,(Ideal.span {freePrimaryPrime I Q i.val}:Ideal Eis).IsMaximal:= fun i=>freePrimaryPrime_maximal I Q hI i.val apply exists_controlledStratumArithmetic (fun i:A=>freePrimaryPrime I Q i.val) (fun i=>freePrimaryPrime_ne_zero I Q hI i.val) · intro i j hij exact freePrimaryPrime_coprime I Q hI (fun he=>hij (Subtype.ext he)) · exact fun i=>freePrimaryPrime_primary I Q hI i.val · exact G.denominator_ne_zero · exact mul_dvd_mul_left 9 G.denominator_dvd · exact G.primary · exact G.coprime · exact fun i=>freePrimaryPrime_coprime_completion I Q hI c hcQ i.val noncomputable def freePrimaryControlledStratum (I Q:Ideal Eis) (hI:Supported I) (c:Eis) (hcQ:(Ideal.span {c}:Ideal Eis)=Ideal.span {(9:Eis)}*Q) (h:Eis⧸Ideal.span {c}) (G:FixedFourierGeometry c h) (A:Finset (FreePrimeIndex I Q)) : ControlledStratumArithmetic (fun i:A=>freePrimaryPrime I Q i.val) ((9:Eis)*c) G.a0 G.c0 G.mode := Classical.choice (exists_freePrimary_controlled_stratum I Q hI c hcQ h G A) end CanonicalRowCompletion end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.FreePrimePools namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical section open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid def freePrimePool (lengthScale Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O)) := (CompletedGauss.primeSupport lengthScale).filter (fun P=>¬Q0≤P) lemma mem_freePrimePool (lengthScale Q0 P:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : P∈freePrimePool lengthScale Q0 ↔ P∈CompletedGauss.primeSupport lengthScale ∧ ¬Q0≤P := by simp only [freePrimePool,Finset.mem_filter] lemma residual_nonresidual_disjoint (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : Disjoint (CompletedGauss.primeSupport (rowResidualPart I Q)) (FreeReflection.pool I Q Q0) := by apply Finset.disjoint_left.mpr intro P hP ht exact FreeReflection.pool_nonresidual I Q Q0 ⟨P,ht⟩ (dvd_of_mem_normalizedFactors (Multiset.mem_toFinset.mp hP)) theorem freePrimePool_eq_residual_union (lengthScale I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:I≠0) (hQ:Q≠0) (hbad:∀P∈fixedBadPrimes,P∣Q) (hcop:IsCoprime Q0 (rowResidualPart I Q)) (hs:CompletedGauss.primeSupport lengthScale= (CompletedGauss.primeSupport (I*Q)).filter (fun P=>lambda∉P ∧ ringChar ((_root_.OAI.ActualEisensteinCubic.O)⧸P)≠2)) : freePrimePool lengthScale Q0= CompletedGauss.primeSupport (rowResidualPart I Q) ∪ FreeReflection.pool I Q Q0 := by have hk:=rowResidualPart_admissible I Q hbad ext P constructor · intro hP obtain ⟨hL,hfree⟩:=Finset.mem_filter.mp hP rw [hs] at hL obtain ⟨hprod,hgood,hodd⟩:=Finset.mem_filter.mp hL have hp:Prime P:=prime_of_normalized_factor P (Multiset.mem_toFinset.mp hprod) by_cases hr:P∣rowResidualPart I Q · exact Finset.mem_union_left _ (Multiset.mem_toFinset.mpr ((UniqueFactorizationMonoid.mem_normalizedFactors_iff hk.1).mpr ⟨hp,hr⟩)) · apply Finset.mem_union_right apply Finset.mem_filter.mpr exact ⟨Finset.mem_filter.mpr ⟨hprod,hgood,hodd,hr⟩,hfree⟩ · intro hP rcases Finset.mem_union.mp hP with hr|ht · have hfactor:=Multiset.mem_toFinset.mp hr have hp:Prime P:=prime_of_normalized_factor P hfactor have hrow:=rowResidualPart_prime_exponent I Q P hfactor have hgood:=hk.2.2 P hfactor have hfree:¬Q0≤P:=by intro hQP exact hp.not_isUnit (hcop.isUnit_of_dvd' (Ideal.dvd_iff_le.mpr hQP) (dvd_of_mem_normalizedFactors hfactor)) apply Finset.mem_filter.mpr refine ⟨?_,hfree⟩ rw [hs] apply Finset.mem_filter.mpr exact ⟨Multiset.mem_toFinset.mpr ((UniqueFactorizationMonoid.mem_normalizedFactors_iff (mul_ne_zero hI hQ)).mpr ⟨hp,dvd_mul_of_dvd_left (dvd_of_mem_normalizedFactors hrow.1) Q⟩),hgood⟩ · obtain ⟨hpool,hfree⟩:=Finset.mem_filter.mp ht obtain ⟨hprod,hgood,hodd,_⟩:=Finset.mem_filter.mp hpool apply Finset.mem_filter.mpr refine ⟨?_,hfree⟩ rw [hs] exact Finset.mem_filter.mpr ⟨hprod,hgood,hodd⟩ def primeUnionToFree (lengthScale Q0 k:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (T:Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O))) (hs:freePrimePool lengthScale Q0=CompletedGauss.primeSupport k∪T) : PrimeIndex k ⊕ T → FreePrimeIndex lengthScale Q0 := fun P=>by have hm:(Sum.elim Subtype.val Subtype.val P)∈freePrimePool lengthScale Q0:=by rw [hs] cases P with | inl P=>exact Finset.mem_union_left _ P.property | inr P=>exact Finset.mem_union_right _ P.property exact ⟨⟨Sum.elim Subtype.val Subtype.val P,(Finset.mem_filter.mp hm).1⟩, (Finset.mem_filter.mp hm).2⟩ lemma primeUnionToFree_bijective (lengthScale Q0 k:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (T:Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O))) (hs:freePrimePool lengthScale Q0=CompletedGauss.primeSupport k∪T) (hd:Disjoint (CompletedGauss.primeSupport k) T) : Function.Bijective (primeUnionToFree lengthScale Q0 k T hs) := by constructor · intro P R he have hv:=congrArg (fun S:FreePrimeIndex lengthScale Q0=>S.val.val) he change Sum.elim Subtype.val Subtype.val P=Sum.elim Subtype.val Subtype.val R at hv cases P with | inl P=>cases R with | inl R=>exact congrArg Sum.inl (Subtype.ext hv) | inr R=> change P.val=R.val at hv exact (Finset.disjoint_left.mp hd P.property (hv.symm ▸ R.property)).elim | inr P=>cases R with | inl R=> change P.val=R.val at hv exact (Finset.disjoint_left.mp hd R.property (hv ▸ P.property)).elim | inr R=>exact congrArg Sum.inr (Subtype.ext hv) · intro P have hm:P.val.val∈CompletedGauss.primeSupport k∪T:=by rw [←hs] exact Finset.mem_filter.mpr ⟨P.val.property,P.property⟩ rcases Finset.mem_union.mp hm with hl|hr · exact ⟨Sum.inl ⟨P.val.val,hl⟩,Subtype.ext (Subtype.ext rfl)⟩ · exact ⟨Sum.inr ⟨P.val.val,hr⟩,Subtype.ext (Subtype.ext rfl)⟩ noncomputable def primeUnionEquiv (lengthScale Q0 k:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (T:Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O))) (hs:freePrimePool lengthScale Q0=CompletedGauss.primeSupport k∪T) (hd:Disjoint (CompletedGauss.primeSupport k) T) : PrimeIndex k⊕T ≃ FreePrimeIndex lengthScale Q0 := Equiv.ofBijective (primeUnionToFree lengthScale Q0 k T hs) (primeUnionToFree_bijective lengthScale Q0 k T hs hd) end section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid variable (I F Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:I≠0) (hF:Squarefree F) (m f z:(_root_.OAI.ActualEisensteinCubic.O)) (hm0:m≠0) (hf:Ideal.span {f}=F) (hz:Ideal.span {z}=I) (um:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (am bm:ℕ) (g:(_root_.OAI.ActualEisensteinCubic.O)) (hg:Supported (Ideal.span {g})) (hm:m=um.val*lambda^am*(2:(_root_.OAI.ActualEisensteinCubic.O))^bm*g) (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (a b:ℕ) (r:(_root_.OAI.ActualEisensteinCubic.O)) (hr:Supported (Ideal.span {r})) (hx:f^4*z=u.val*lambda^a*(2:(_root_.OAI.ActualEisensteinCubic.O))^b*r) (hbad:∀P∈fixedBadPrimes,P∣Ideal.span {m}*F) (hcop:IsCoprime Q0 (rowResidualPart I (Ideal.span {m}*F))) include I F Q0 hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx hbad hcop theorem goodMaskFreePrimePool : freePrimePool (goodMaskMovingIdeal g r) Q0= CompletedGauss.primeSupport (rowResidualPart I (Ideal.span {m}*F)) ∪ FreeReflection.pool I (Ideal.span {m}*F) Q0 := by apply freePrimePool_eq_residual_union _ _ _ _ hI (mul_ne_zero (Ideal.span_singleton_eq_bot.not.mpr hm0) hF.ne_zero) hbad hcop exact goodMaskMovingIdeal_primeSupport I F hI hF.ne_zero m f z hm0 hf hz um am bm g hg hm u a b r hr hx noncomputable def goodMaskFreePrimeEquiv : PrimeIndex (rowResidualPart I (Ideal.span {m}*F)) ⊕ FreeReflection.pool I (Ideal.span {m}*F) Q0 ≃ FreePrimeIndex (goodMaskMovingIdeal g r) Q0 := primeUnionEquiv _ _ _ _ (goodMaskFreePrimePool I F Q0 hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx hbad hcop) (residual_nonresidual_disjoint I (Ideal.span {m}*F) Q0) lemma goodMaskFreePrimeEquiv_residual_exponent (P:PrimeIndex (rowResidualPart I (Ideal.span {m}*F))) : (normalizedFactors (goodMaskMovingIdeal g r)).count (goodMaskFreePrimeEquiv I F Q0 hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx hbad hcop (Sum.inl P)).val.val%6=1 := by let : P.val.IsMaximal := primeIndexMaximal (rowResidualPart I (Ideal.span {m}*F)) P change (normalizedFactors (goodMaskMovingIdeal g r)).count P.val%6=1 have hp:=(rowResidualPart_admissible I (Ideal.span {m}*F) hbad).2.2 P.val (Multiset.mem_toFinset.mp P.property) rw [goodMaskMovingIdeal_exponent I F hI hF m f z hf hz um am bm g hg hm u a b r hr hx P.val hp.1 hp.2] exact completedLocalExponent_residual I F _ (dvd_mul_left F (Ideal.span {m})) P lemma goodMaskFreePrimeEquiv_nonresidual_exponent (P:FreeReflection.pool I (Ideal.span {m}*F) Q0) : (normalizedFactors (goodMaskMovingIdeal g r)).count (goodMaskFreePrimeEquiv I F Q0 hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx hbad hcop (Sum.inr P)).val.val%6=completedLocalExponent I F P.val := by change (normalizedFactors (goodMaskMovingIdeal g r)).count P.val%6=completedLocalExponent I F P.val let:P.val.IsMaximal:=FreeReflection.pool_maximal I (Ideal.span {m}*F) Q0 P exact goodMaskMovingIdeal_exponent I F hI hF m f z hf hz um am bm g hg hm u a b r hr hx P.val (FreeReflection.pool_good I (Ideal.span {m}*F) Q0 P) (FreeReflection.pool_odd I (Ideal.span {m}*F) Q0 P) end section variable {α β γ:Type*} [Fintype α] [Fintype β] [Fintype γ] def optionalPrimeActive (e:α⊕β ≃ γ) (A:Finset γ) : Finset β := Finset.univ.filter (fun b=>e (Sum.inr b)∈A) omit [Fintype α] [Fintype γ] in lemma mem_optionalPrimeActive (e:α⊕β ≃ γ) (A:Finset γ) (b:β) : b∈optionalPrimeActive e A ↔ e (Sum.inr b)∈A := by simp only [optionalPrimeActive,Finset.mem_filter,Finset.mem_univ,true_and] def activePrimeUnionMap (e:α⊕β ≃ γ) (A:Finset γ) (hA:∀a:α,e (Sum.inl a)∈A) : α⊕optionalPrimeActive e A → A := Sum.elim (fun a=>⟨e (Sum.inl a),hA a⟩) (fun b=>⟨e (Sum.inr b.val),(mem_optionalPrimeActive e A b.val).mp b.property⟩) omit [Fintype α] [Fintype γ] in lemma activePrimeUnionMap_bijective (e:α⊕β ≃ γ) (A:Finset γ) (hA:∀a:α,e (Sum.inl a)∈A) : Function.Bijective (activePrimeUnionMap e A hA) := by constructor · intro x y hxy have hv:=congrArg Subtype.val hxy cases x with | inl x=>cases y with | inl y=>exact congrArg Sum.inl (Sum.inl.inj (e.injective hv)) | inr y=>cases e.injective hv | inr x=>cases y with | inl y=>cases e.injective hv | inr y=>exact congrArg Sum.inr (Subtype.ext (Sum.inr.inj (e.injective hv))) · intro a obtain ⟨x,hx⟩:=e.surjective a.val cases x with | inl x=>exact ⟨Sum.inl x,Subtype.ext hx⟩ | inr x=> have hm:x∈optionalPrimeActive e A:=(mem_optionalPrimeActive e A x).mpr (hx.symm ▸ a.property) exact ⟨Sum.inr ⟨x,hm⟩,Subtype.ext hx⟩ noncomputable def activePrimeUnionEquiv (e:α⊕β ≃ γ) (A:Finset γ) (hA:∀a:α,e (Sum.inl a)∈A) : α⊕optionalPrimeActive e A ≃ A := Equiv.ofBijective (activePrimeUnionMap e A hA) (activePrimeUnionMap_bijective e A hA) end section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid def nonresidualPoolEquiv (R I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hR:R≠0) (hI:I≠0) (hQ:Q≠0) (hA:rowPowerfulPart R=rowPowerfulPart I) (hT:rowMaskPart R Q=rowMaskPart I Q) : FreeReflection.pool R Q Q0 ≃ FreeReflection.pool I Q Q0 := by have he:=FreeReflection.pool_eq_on_fiber R I Q Q0 hR hI hQ hA hT exact { toFun:=fun P=>⟨P.val,he ▸ P.property⟩ invFun:=fun P=>⟨P.val,he.symm ▸ P.property⟩ left_inv:=fun _=>rfl right_inv:=fun _=>rfl } lemma nonresidualPoolEquiv_exponent (R I F Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hR:R≠0) (hI:I≠0) (hQ:Q≠0) (hA:rowPowerfulPart R=rowPowerfulPart I) (hT:rowMaskPart R Q=rowMaskPart I Q) (P:FreeReflection.pool R Q Q0) : completedLocalExponent I F (nonresidualPoolEquiv R I Q Q0 hR hI hQ hA hT P).val= completedLocalExponent R F P.val := (completedReflectionPool_exponent_eq R I F Q hR hI hQ hA hT ⟨P.val,FreeReflection.pool_subset R Q Q0 P.property⟩).symm variable (R I F Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hR:R≠0) (hI:I≠0) (hF:Squarefree F) (m f z:(_root_.OAI.ActualEisensteinCubic.O)) (hm0:m≠0) (hf:Ideal.span {f}=F) (hz:Ideal.span {z}=I) (um:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (am bm:ℕ) (g:(_root_.OAI.ActualEisensteinCubic.O)) (hg:Supported (Ideal.span {g})) (hm:m=um.val*lambda^am*(2:(_root_.OAI.ActualEisensteinCubic.O))^bm*g) (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (a b:ℕ) (r:(_root_.OAI.ActualEisensteinCubic.O)) (hr:Supported (Ideal.span {r})) (hx:f^4*z=u.val*lambda^a*(2:(_root_.OAI.ActualEisensteinCubic.O))^b*r) (hbad:∀P∈fixedBadPrimes,P∣Ideal.span {m}*F) (hcop:IsCoprime Q0 (rowResidualPart I (Ideal.span {m}*F))) (hA:rowPowerfulPart R=rowPowerfulPart I) (hT:rowMaskPart R (Ideal.span {m}*F)=rowMaskPart I (Ideal.span {m}*F)) include R I F Q0 hR hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx hbad hcop hA hT noncomputable def goodMaskFreePrimeFiberEquiv : PrimeIndex (rowResidualPart I (Ideal.span {m}*F)) ⊕ FreeReflection.pool R (Ideal.span {m}*F) Q0 ≃ FreePrimeIndex (goodMaskMovingIdeal g r) Q0 := (Equiv.sumCongr (Equiv.refl _) (nonresidualPoolEquiv R I (Ideal.span {m}*F) Q0 hR hI (mul_ne_zero (Ideal.span_singleton_eq_bot.not.mpr hm0) hF.ne_zero) hA hT)).trans (goodMaskFreePrimeEquiv I F Q0 hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx hbad hcop) theorem goodMaskFreePrimeFiberEquiv_exponent (P:PrimeIndex (rowResidualPart I (Ideal.span {m}*F)) ⊕ FreeReflection.pool R (Ideal.span {m}*F) Q0) : (normalizedFactors (goodMaskMovingIdeal g r)).count (goodMaskFreePrimeFiberEquiv R I F Q0 hR hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx hbad hcop hA hT P).val.val%6= Sum.elim (fun _=>1) (fun S=>completedLocalExponent R F S.val) P := by cases P with | inl P=> exact goodMaskFreePrimeEquiv_residual_exponent I F Q0 hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx hbad hcop P | inr P=> exact (goodMaskFreePrimeEquiv_nonresidual_exponent I F Q0 hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx hbad hcop (nonresidualPoolEquiv R I (Ideal.span {m}*F) Q0 hR hI (mul_ne_zero (Ideal.span_singleton_eq_bot.not.mpr hm0) hF.ne_zero) hA hT P)).trans (nonresidualPoolEquiv_exponent R I F (Ideal.span {m}*F) Q0 hR hI (mul_ne_zero (Ideal.span_singleton_eq_bot.not.mpr hm0) hF.ne_zero) hA hT P) end open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid section variable (R I F Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hR:R≠0) (hI:I≠0) (hF:Squarefree F) (m f z:(_root_.OAI.ActualEisensteinCubic.O)) (hm0:m≠0) (hf:Ideal.span {f}=F) (hz:Ideal.span {z}=I) (um:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (am bm:ℕ) (g:(_root_.OAI.ActualEisensteinCubic.O)) (hg:Supported (Ideal.span {g})) (hm:m=um.val*lambda^am*(2:(_root_.OAI.ActualEisensteinCubic.O))^bm*g) (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (a b:ℕ) (r:(_root_.OAI.ActualEisensteinCubic.O)) (hr:Supported (Ideal.span {r})) (hx:f^4*z=u.val*lambda^a*(2:(_root_.OAI.ActualEisensteinCubic.O))^b*r) (hbad:∀P∈fixedBadPrimes,P∣Ideal.span {m}*F) (hcop:IsCoprime Q0 (rowResidualPart I (Ideal.span {m}*F))) (hA:rowPowerfulPart R=rowPowerfulPart I) (hT:rowMaskPart R (Ideal.span {m}*F)=rowMaskPart I (Ideal.span {m}*F)) include R I F Q0 hR hI hF m f z hm0 hf hz um am bm g hg hm u a b r hr hx hbad hcop hA hT end lemma reflection_row_mask_bad (q:ℕ) (m:(_root_.OAI.ActualEisensteinCubic.O)) (F:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : ∀P∈fixedBadPrimes,P∣Ideal.span {m*excludedGenerator (reflectionExcludedPrimes q)}*F := by intro P hP exact excluded_prime_dvd_row_mask q m F P (reflectionExcludedPrimes_bad q hP) lemma residual_coprime_free_base (q:ℕ) (hq:q≠0) (m:(_root_.OAI.ActualEisensteinCubic.O)) (F I:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : IsCoprime (CanonicalCoefficientClass.fixedBaseConductor q*Ideal.span {(72:(_root_.OAI.ActualEisensteinCubic.O))}) (rowResidualPart I (Ideal.span {m*excludedGenerator (reflectionExcludedPrimes q)}*F)) := by have hc:=residual_coprime_fixed_conductor q hq m F I rw [reflectionConductor_ideal] at hc exact hc.of_isCoprime_of_dvd_left (dvd_mul_left _ (Ideal.span {(9:(_root_.OAI.ActualEisensteinCubic.O))})) end CanonicalRowCompletion noncomputable abbrev residualLabelDecidableEq (A B:Type*) : DecidableEq (A⊕B) := Classical.decEq _ namespace CompletedGauss open ActualEisensteinCubic LocalReflectionBrackets variable {α β:Type*} [Fintype α] [Fintype β] def residualZeroLabel (e:β→Fin 3) : α⊕β→Fin 3 := Sum.elim (fun _=>0) e theorem sum_labels_drop_residual (f:(α⊕β→Fin 3)→ℂ) (hzero:∀e,(∃i:α,e (Sum.inl i)≠0)→f e=0) : letI explicitWitness36 := @OAI.residualLabelDecidableEq (∑e:α⊕β→Fin 3,f e)=∑e:β→Fin 3,f (residualZeroLabel e) := letI explicitWitness36 := @OAI.residualLabelDecidableEq by rw [←(Equiv.sumArrowEquivProdArrow α β (Fin 3)).symm.sum_comp] rw [Fintype.sum_prod_type,Finset.sum_comm] apply Finset.sum_congr rfl intro e he rw [Finset.sum_eq_single (fun _ : α=>0)] · rfl · intro d hd hn apply hzero have hx:∃i:α,d i≠0:=by by_contra h push Not at h exact hn (funext h) obtain ⟨i,hi⟩:=hx exact ⟨i,hi⟩ · simp lemma reflectionExtractedDivisor_drop_residual (P:α⊕β→Ideal (_root_.OAI.ActualEisensteinCubic.O)) (j:α⊕β→ℕ) (hj:∀i:α,j (Sum.inl i)=1) (e:α⊕β→Fin 3) (v:Fin 3) : reflectionExtractedDivisor P j e v= reflectionExtractedDivisor (fun i:β=>P (Sum.inr i)) (fun i=>j (Sum.inr i)) (fun i=>e (Sum.inr i)) v := by simp only [reflectionExtractedDivisor,Fintype.prod_sum_type] have hz:(∏i:α,reflectionExtractedPrime (P (Sum.inl i)) (j (Sum.inl i)) (e (Sum.inl i)) v)=1 := by simp only [hj,reflectionExtractedPrime,show (1:ℕ)≠4 by decide,show (1:ℕ)≠0 by decide, false_and,false_or,ite_false,Finset.prod_const_one] rw [hz,one_mul] lemma reflectedBranch_drop_residual (P:α⊕β→Ideal (_root_.OAI.ActualEisensteinCubic.O)) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (j:α⊕β→ℕ) (hj:∀i:α,j (Sum.inl i)=1) (e:β→Fin 3) (n b:(_root_.OAI.ActualEisensteinCubic.O)) : let : ∀ i, Field ((_root_.OAI.ActualEisensteinCubic.O) ⧸ P i) := fun i => Ideal.Quotient.field (P i) let : ∀ i, Fintype ((_root_.OAI.ActualEisensteinCubic.O) ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) reflectedBranch P hg j (residualZeroLabel e) n b= (∏i:α,bracket (actualSextic (P (Sum.inl i)) (hg (Sum.inl i))) 1 (Ideal.Quotient.mk _ (n*b^3)))* reflectedBranch (fun i:β=>P (Sum.inr i)) (fun i=>hg (Sum.inr i)) (fun i=>j (Sum.inr i)) e n b := by let : ∀ i, Field ((_root_.OAI.ActualEisensteinCubic.O) ⧸ P i) := fun i => Ideal.Quotient.field (P i) let : ∀ i, Fintype ((_root_.OAI.ActualEisensteinCubic.O) ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) dsimp only simp only [reflectedBranch,Fintype.prod_sum_type,residualZeroLabel,Sum.elim_inl,Sum.elim_inr] congr 1 apply Finset.prod_congr rfl intro i hi simp only [reflectedLocalPiece,hj,show (1:ℕ)≠4 by decide,ite_false,ite_true] end CompletedGauss end open scoped BigOperators Classical noncomputable abbrev residualEquivDecidableEq (A B:Type*) : DecidableEq (A⊕B) := Classical.decEq _ namespace CompletedGauss open ActualEisensteinCubic LocalReflectionBrackets variable {α β ι:Type*} [Fintype α] [Fintype β] [Fintype ι] def residualLabelVia (E:α⊕β≃ι) (e:β→Fin 3) : ι→Fin 3 := residualZeroLabel e ∘ E.symm omit [Fintype α] [Fintype β] [Fintype ι] in lemma residualLabelVia_apply (E:α⊕β≃ι) (e:β→Fin 3) (i:α⊕β) : residualLabelVia E e (E i)=residualZeroLabel e i := by simp only [residualLabelVia,Function.comp_apply,Equiv.symm_apply_apply] theorem sum_labels_drop_residual_equiv (E:α⊕β≃ι) (f:(ι→Fin 3)→ℂ) (hzero:∀e,(∃i:α,e (E (Sum.inl i))≠0)→f e=0) : (∑e:ι→Fin 3,f e)=∑e:β→Fin 3,f (residualLabelVia E e) := letI explicitWitness37 := @OAI.residualEquivDecidableEq by let e:=Equiv.arrowCongr E (Equiv.refl (Fin 3)) rw [←e.sum_comp f] apply sum_labels_drop_residual intro l hl apply hzero obtain ⟨i,hi⟩:=hl refine ⟨i,?_⟩ simpa only [e,Equiv.arrowCongr_apply,Function.comp_apply,Equiv.refl_apply,Equiv.symm_apply_apply] using hi omit [Fintype α] [Fintype β] in lemma reflectedBranch_residual_zero_equiv (E:α⊕β≃ι) (P:ι→Ideal (_root_.OAI.ActualEisensteinCubic.O)) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (j:ι→ℕ) (hj:∀i:α,j (E (Sum.inl i))=1) (e:ι→Fin 3) (hbad:∃i:α,e (E (Sum.inl i))≠0) (n b:(_root_.OAI.ActualEisensteinCubic.O)) : reflectedBranch P hg j e n b=0 := by obtain ⟨i,hi⟩:=hbad unfold reflectedBranch apply Finset.prod_eq_zero (Finset.mem_univ (E (Sum.inl i))) simp only [reflectedLocalPiece,hj,show (1:ℕ)≠4 by decide,ite_false,if_neg hi] lemma reflectionExtractedDivisor_drop_residual_equiv (E:α⊕β≃ι) (P:ι→Ideal (_root_.OAI.ActualEisensteinCubic.O)) (j:ι→ℕ) (hj:∀i:α,j (E (Sum.inl i))=1) (e:β→Fin 3) (v:Fin 3) : reflectionExtractedDivisor P j (residualLabelVia E e) v= reflectionExtractedDivisor (fun i:β=>P (E (Sum.inr i))) (fun i=>j (E (Sum.inr i))) e v := by calc _=reflectionExtractedDivisor (fun i=>P (E i)) (fun i=>j (E i)) (residualZeroLabel e) v := by unfold reflectionExtractedDivisor rw [←E.prod_comp] apply Finset.prod_congr rfl intro i hi rw [residualLabelVia_apply] _=_:=reflectionExtractedDivisor_drop_residual _ _ hj _ _ lemma reflectedBranch_drop_residual_equiv (E:α⊕β≃ι) (P:ι→Ideal (_root_.OAI.ActualEisensteinCubic.O)) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (j:ι→ℕ) (hj:∀i:α,j (E (Sum.inl i))=1) (e:β→Fin 3) (n b:(_root_.OAI.ActualEisensteinCubic.O)) : let : ∀ i, Field ((_root_.OAI.ActualEisensteinCubic.O) ⧸ P i) := fun i => Ideal.Quotient.field (P i) let : ∀ i, Fintype ((_root_.OAI.ActualEisensteinCubic.O) ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) reflectedBranch P hg j (residualLabelVia E e) n b= (∏i:α,bracket (actualSextic (P (E (Sum.inl i))) (hg (E (Sum.inl i)))) 1 (Ideal.Quotient.mk _ (n*b^3)))* reflectedBranch (fun i:β=>P (E (Sum.inr i))) (fun i=>hg (E (Sum.inr i))) (fun i=>j (E (Sum.inr i))) e n b := by let : ∀ i, Field ((_root_.OAI.ActualEisensteinCubic.O) ⧸ P i) := fun i => Ideal.Quotient.field (P i) let : ∀ i, Fintype ((_root_.OAI.ActualEisensteinCubic.O) ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) dsimp only calc _=reflectedBranch (fun i=>P (E i)) (fun i=>hg (E i)) (fun i=>j (E i)) (residualZeroLabel e) n b := by unfold reflectedBranch rw [←E.prod_comp] apply Finset.prod_congr rfl intro i hi rw [residualLabelVia_apply] _=_:=reflectedBranch_drop_residual _ _ _ hj _ _ _ end CompletedGauss end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.ResidualEquivalence namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open Filter open MulChar AddChar open MulChar AddChar open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical ContDiff namespace CompletedGauss open ActualEisensteinCubic CubicEisenstein variable {α β ι:Type*} [Fintype α] [Fintype β] [Fintype ι] lemma nonzeroDualDilation_residual_equiv (E:α⊕β≃ι) (P:ι→Ideal (_root_.OAI.ActualEisensteinCubic.O)) [∀i,(P i).IsMaximal] (j:ι→ℕ) (hj:∀i:α,j (E (Sum.inl i))=1) (e:β→Fin 3) (x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal) : nonzeroDualDilation (reflectionExtractedDivisor P j (residualLabelVia E e) 1) (reflectionExtractedDivisor P j (residualLabelVia E e) 2) (reflectionExtractedDivisor_ne_zero P (fun _i=>NeZero.ne _) j _ 1) (reflectionExtractedDivisor_ne_zero P (fun _i=>NeZero.ne _) j _ 2) x= nonzeroDualDilation (reflectionExtractedDivisor (fun i:β=>P (E (Sum.inr i))) (fun i=>j (E (Sum.inr i))) e 1) (reflectionExtractedDivisor (fun i:β=>P (E (Sum.inr i))) (fun i=>j (E (Sum.inr i))) e 2) (reflectionExtractedDivisor_ne_zero _ (fun _i=>NeZero.ne _) _ _ 1) (reflectionExtractedDivisor_ne_zero _ (fun _i=>NeZero.ne _) _ _ 2) x := by apply Prod.ext · rfl · apply Prod.ext <;> apply Subtype.ext <;> simp only [nonzeroDualDilation,reflectionExtractedDivisor_drop_residual_equiv E P j hj] end CompletedGauss namespace CubicEisenstein open ActualEisensteinCubic CompletedGauss CompletedDyadic namespace FixedFourierGeometry variable {c:(_root_.OAI.ActualEisensteinCubic.O)} {h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c}} (G:FixedFourierGeometry c h) variable {α β ι:Type*} [Fintype α] [Fintype β] [Fintype ι] {p:ι→(_root_.OAI.ActualEisensteinCubic.O)} {N:(_root_.OAI.ActualEisensteinCubic.O)} omit [Fintype α] [Fintype β] in lemma stratumBranchTerm_residual_zero_equiv (E:α⊕β≃ι) (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (hres:∀i:α,j (E (Sum.inl i))=1) (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (e:ι→Fin 3) (hbad:∃i:α,e (E (Sum.inl i))≠0) (W:ℝ→ℂ) (X:ℝ) (x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal) : G.stratumBranchTerm D hp hg j u e W X x=0 := by dsimp only [stratumBranchTerm,rawDualKernelTerm,unextractedCuspCoefficient] rw [reflectedBranch_residual_zero_equiv E _ hg j hres e hbad,mul_zero,zero_div,zero_mul] theorem smoothedValue_eq_nonresidual_equiv (E:α⊕β≃ι) (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hN:(9:(_root_.OAI.ActualEisensteinCubic.O))*G.c0∣N) (hr:lambda^2∣(∏i,p i)-1) (hp:∀i,p i≠0) (hcop:Pairwise (fun i k=>IsCoprime (Ideal.span {p i}) (Ideal.span {p k}))) (hg:∀i,lambda∉Ideal.span {p i}) (hchar:∀i,ringChar ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i})≠2) (j:ι→ℕ) (hj:∀i,j i<6) (hres:∀i:α,j (E (Sum.inl i))=1) (W:ℝ→ℂ) (a b:ℝ) (ha:0Ideal.span {p (E (Sum.inr i))} let jβ:β→ℕ:=fun i=>j (E (Sum.inr i)) let A:=reflectionExtractedDivisor P jβ e 1 let B:=reflectionExtractedDivisor P jβ e 2 let hA:=reflectionExtractedDivisor_ne_zero P (fun _i=>NeZero.ne _) jβ e 1 let hB:=reflectionExtractedDivisor_ne_zero P (fun _i=>NeZero.ne _) jβ e 2 ∑'x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal, G.stratumBranchTerm D hp hg j u (residualLabelVia E e) W X (nonzeroDualDilation A B hA hB x) := by rw [G.smoothedValue_eq_extracted_branch_sums D hN hr hp hcop hg hchar j hj W a b ha hsupp hW X hX] apply congrArg (fun z:ℂ=>fixedRadialCoefficientScalar*G.shape.stratumShapeFactor (G.c0*∏i,p i)*z) apply tsum_congr intro u let f:(ι→Fin 3)→ℂ:=fun e=> ∑'x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal, G.stratumBranchTerm D hp hg j u e W X (nonzeroDualDilation (reflectionExtractedDivisor (fun i=>Ideal.span {p i}) j e 1) (reflectionExtractedDivisor (fun i=>Ideal.span {p i}) j e 2) (reflectionExtractedDivisor_ne_zero _ (fun i=>NeZero.ne _) j e 1) (reflectionExtractedDivisor_ne_zero _ (fun i=>NeZero.ne _) j e 2) x) change (∑e,f e)=_ have hz:∀e,(∃i:α,e (E (Sum.inl i))≠0)→f e=0 := by intro e he calc f e=∑'(_x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal),(0:ℂ) := by apply tsum_congr intro x exact G.stratumBranchTerm_residual_zero_equiv E D hp hg j hres u e he W X _ _=0:=tsum_zero rw [sum_labels_drop_residual_equiv E f hz] apply Finset.sum_congr rfl intro e he dsimp only [f] apply tsum_congr intro x rw [nonzeroDualDilation_residual_equiv E _ j hres] end FixedFourierGeometry end CubicEisenstein open scoped BigOperators Classical MatrixGroups namespace CubicEisenstein section open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss CubicKubota CubicJacobiGlobal noncomputable abbrev primeQuotientFintype (P:Ideal (_root_.OAI.ActualEisensteinCubic.O)) [P.IsMaximal] : Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸P) := Fintype.ofFinite _ def primeInactiveFourierWeight {ι:Type*} [Fintype ι] (p:ι→(_root_.OAI.ActualEisensteinCubic.O)) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (A:Finset ι) : ℂ := letI explicitWitness25 := @OAI.CubicEisenstein.primeQuotientFintype ∏i∈(Finset.univ:Finset ι)\A, finiteAdditiveFourierCoeff (quotientTrace (p i) (hp i)) (fun x=>(actualSextic (Ideal.span {p i}) (hg i)^j i) x) 0 lemma primeRow_fourier_by_active {ι:Type*} [Fintype ι] (p:ι→(_root_.OAI.ActualEisensteinCubic.O)) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) (n:(_root_.OAI.ActualEisensteinCubic.O)) : letI explicitWitness25 := @OAI.CubicEisenstein.primeQuotientFintype finiteSexticRow (fun i=>Ideal.span {p i}) hg j n= ∑A:Finset ι,primeInactiveFourierWeight p hp hg j A* ∑v:∀i:A,((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})ˣ, ControlledStratumArithmetic.fourierWeight (p:=fun i:A=>p i.val) (fun i:A=>hp i.val) (fun i:A=>hg i.val) (fun i=>j i.val) v* ∏i:A,quotientTrace (p i.val) (hp i.val) ((v i:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})*Ideal.Quotient.mk (Ideal.span {p i.val}) n) := letI explicitWitness25 := @OAI.CubicEisenstein.primeQuotientFintype by let (i:ι) : Field ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i}) := Ideal.Quotient.field _ have hpow:(Finset.univ:Finset ι).powerset=(Finset.univ:Finset (Finset ι)):=by ext A simp only [Finset.mem_powerset,Finset.subset_univ,Finset.mem_univ] have hFourier:=FixedRayActiveSet.fourier_inversion_by_active_set (fun i=>(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i}) (fun i=>quotientTrace (p i) (hp i)) (fun i=>GeneralPrimitiveTrace.eisTraceModChar_breveE_primitive (p i) (hp i)) (fun i x=>(actualSextic (Ideal.span {p i}) (hg i)^j i) x) (fun i=>Ideal.Quotient.mk (Ideal.span {p i}) n) simpa only [hpow,finiteSexticRow,primeInactiveFourierWeight, ControlledStratumArithmetic.fourierWeight] using hFourier def activeStratumDatum {ι:Type*} [Fintype ι] (p:ι→(_root_.OAI.ActualEisensteinCubic.O)) (hp:∀i,p i≠0) (hprimary:∀i,lambda^2∣p i-1) {N a0 c0:(_root_.OAI.ActualEisensteinCubic.O)} {mode:Bool} (D:∀A:Finset ι,ControlledStratumArithmetic (fun i:A=>p i.val) N a0 c0 mode) (hN:(9:(_root_.OAI.ActualEisensteinCubic.O))*c0∣N) (hc0:c0≠0) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (s:FixedCuspShape (ControlledStratumArithmetic.fixedCusp a0 c0 mode)) (A:Finset ι) (v:∀i:A,((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})ˣ) : SourceCuspDatum := (D A).datum hN (primary_finset_product Finset.univ (fun i:A=>p i.val) (fun i _=>hprimary i.val)) hbase s (fun i=>hp i.val) hc0 v theorem activeStratum_fourier_multiplier {ι:Type*} [Fintype ι] (p:ι→(_root_.OAI.ActualEisensteinCubic.O)) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hprimary:∀i,lambda^2∣p i-1) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) {N a0 c0:(_root_.OAI.ActualEisensteinCubic.O)} {mode:Bool} (D:∀A:Finset ι,ControlledStratumArithmetic (fun i:A=>p i.val) N a0 c0 mode) (hN:(9:(_root_.OAI.ActualEisensteinCubic.O))*c0∣N) (hc0:c0≠0) (hbase:if mode then lambda^2∣a0-1 else lambda^2∣c0-1) (s:FixedCuspShape (ControlledStratumArithmetic.fixedCusp a0 c0 mode)) (n:(_root_.OAI.ActualEisensteinCubic.O)) : letI explicitWitness25 := @OAI.CubicEisenstein.primeQuotientFintype (∑A:Finset ι,primeInactiveFourierWeight p hp hg j A* ∑v:∀i:A,((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})ˣ, ControlledStratumArithmetic.fourierWeight (p:=fun i:A=>p i.val) (fun i:A=>hp i.val) (fun i:A=>hg i.val) (fun i=>j i.val) v* ShortDraftTrace.breveE (-cuspFrequency n* (activeStratumDatum p hp hprimary D hN hc0 hbase s A v).point))= ShortDraftTrace.breveE (-cuspFrequency n*(eisEmbedding a0/eisEmbedding c0))* finiteSexticRow (fun i=>Ideal.span {p i}) hg j n := letI explicitWitness25 := @OAI.CubicEisenstein.primeQuotientFintype by have hlocal (A:Finset ι) (v:∀i:A,((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})ˣ) : ShortDraftTrace.breveE (-cuspFrequency n* (activeStratumDatum p hp hprimary D hN hc0 hbase s A v).point)= ShortDraftTrace.breveE (-cuspFrequency n*(eisEmbedding a0/eisEmbedding c0))* ∏i:A,quotientTrace (p i.val) (hp i.val) ((v i:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})*Ideal.Quotient.mk (Ideal.span {p i.val}) n) := (D A).datum_fourier_phase hN (primary_finset_product Finset.univ (fun i:A=>p i.val) (fun i _=>hprimary i.val)) hbase s (fun i=>hp i.val) hc0 v n calc _=∑A:Finset ι,primeInactiveFourierWeight p hp hg j A* ∑v:∀i:A,((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})ˣ, ControlledStratumArithmetic.fourierWeight (p:=fun i:A=>p i.val) (fun i:A=>hp i.val) (fun i:A=>hg i.val) (fun i=>j i.val) v* (ShortDraftTrace.breveE (-cuspFrequency n*(eisEmbedding a0/eisEmbedding c0))* ∏i:A,quotientTrace (p i.val) (hp i.val) ((v i:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})*Ideal.Quotient.mk (Ideal.span {p i.val}) n)):=by apply Finset.sum_congr rfl intro A hA apply congrArg (fun z:ℂ=>primeInactiveFourierWeight p hp hg j A*z) apply Finset.sum_congr rfl intro v hv exact congrArg (fun z:ℂ=>ControlledStratumArithmetic.fourierWeight (p:=fun i:A=>p i.val) (fun i:A=>hp i.val) (fun i:A=>hg i.val) (fun i=>j i.val) v*z) (hlocal A v) _=ShortDraftTrace.breveE (-cuspFrequency n*(eisEmbedding a0/eisEmbedding c0))* (∑A:Finset ι,primeInactiveFourierWeight p hp hg j A* ∑v:∀i:A,((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})ˣ, ControlledStratumArithmetic.fourierWeight (p:=fun i:A=>p i.val) (fun i:A=>hp i.val) (fun i:A=>hg i.val) (fun i=>j i.val) v* ∏i:A,quotientTrace (p i.val) (hp i.val) ((v i:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})*Ideal.Quotient.mk (Ideal.span {p i.val}) n)):=by simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro A hA apply Finset.sum_congr rfl intro v hv ring _=_:=congrArg (fun z:ℂ=> ShortDraftTrace.breveE (-cuspFrequency n*(eisEmbedding a0/eisEmbedding c0))*z) (primeRow_fourier_by_active p hp hg j n).symm end open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss CubicKubota CubicJacobiGlobal open CanonicalRowCompletion noncomputable abbrev fixedActiveQuotientFintype (P:Ideal (_root_.OAI.ActualEisensteinCubic.O)) [P.IsMaximal] : Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸P) := Fintype.ofFinite _ abbrev FixedActiveCuspIndex {ι:Type*} (c:(_root_.OAI.ActualEisensteinCubic.O)) (p:ι→(_root_.OAI.ActualEisensteinCubic.O)) := Σ_h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c},ΣA:Finset ι,∀i:A,((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})ˣ variable {ι:Type*} [Fintype ι] (p:ι→(_root_.OAI.ActualEisensteinCubic.O)) [∀i,(Ideal.span {p i}).IsMaximal] variable (hp:∀i,p i≠0) (hprimary:∀i,lambda^2∣p i-1) variable (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) variable (c:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) [Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c})] variable (G:∀h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c},FixedFourierGeometry c h) (N:(_root_.OAI.ActualEisensteinCubic.O)) variable (hN:∀h,(9:(_root_.OAI.ActualEisensteinCubic.O))*(G h).c0∣N) variable (D:∀h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c},∀A:Finset ι, ControlledStratumArithmetic (fun i:A=>p i.val) N (G h).a0 (G h).c0 (G h).mode) def fixedActiveCuspDatum (t:FixedActiveCuspIndex c p) : SourceCuspDatum := activeStratumDatum p hp hprimary (D t.1) (hN t.1) (G t.1).denominator_ne_zero (G t.1).primary (G t.1).shape t.2.1 t.2.2 def fixedActiveCuspWeight (φ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (t:FixedActiveCuspIndex c p) : ℂ := fixedThetaRowCoeff c hc φ t.1*primeInactiveFourierWeight p hp hg j t.2.1* ControlledStratumArithmetic.fourierWeight (p:=fun i:t.2.1=>p i.val) (fun i:t.2.1=>hp i.val) (fun i:t.2.1=>hg i.val) (fun i=>j i.val) t.2.2 theorem fixedActiveCusp_fourier_multiplier (Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hcQ:Ideal.span {c}≤Ideal.span {(9:(_root_.OAI.ActualEisensteinCubic.O))}*Q) (φ χ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (hφ:CanonicalCoefficientClass.FactorsModulo Q φ) (hχ:∀n,χ n=finiteSexticRow (fun i=>Ideal.span {p i}) hg j n) (n:(_root_.OAI.ActualEisensteinCubic.O)) : letI explicitWitness26 := @OAI.CubicEisenstein.fixedActiveQuotientFintype (∑t:FixedActiveCuspIndex c p,fixedActiveCuspWeight p hp hg j c hc φ t* ShortDraftTrace.breveE (-cuspFrequency n* (fixedActiveCuspDatum p hp hprimary c G N hN D t).point))= fixedThetaTwist (φ*χ) n := letI explicitWitness26 := @OAI.CubicEisenstein.fixedActiveQuotientFintype letI explicitWitness25 := @OAI.CubicEisenstein.primeQuotientFintype by simp only [FixedActiveCuspIndex,Fintype.sum_sigma,fixedActiveCuspWeight,fixedActiveCuspDatum] rw [fixedThetaTwist_fixed_fourier c hc Q hcQ φ χ hφ n] apply Finset.sum_congr rfl intro h hh calc _=fixedThetaRowCoeff c hc φ h* (∑A:Finset ι,primeInactiveFourierWeight p hp hg j A* ∑v:∀i:A,((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p i.val})ˣ, ControlledStratumArithmetic.fourierWeight (p:=fun i:A=>p i.val) (fun i:A=>hp i.val) (fun i:A=>hg i.val) (fun i=>j i.val) v* ShortDraftTrace.breveE (-cuspFrequency n* (activeStratumDatum p hp hprimary (D h) (hN h) (G h).denominator_ne_zero (G h).primary (G h).shape A v).point)):=by simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro A hA apply Finset.sum_congr rfl intro v hv ring _=fixedThetaRowCoeff c hc φ h* (ShortDraftTrace.breveE (-cuspFrequency n*(eisEmbedding (G h).a0/eisEmbedding (G h).c0))* finiteSexticRow (fun i=>Ideal.span {p i}) hg j n):=by rw [activeStratum_fourier_multiplier p hp hprimary hg j (D h) (hN h) (G h).denominator_ne_zero (G h).primary (G h).shape n] _=fixedThetaRowCoeff c hc φ h*fixedRowFourierPhase c hc h n*χ n:=by rw [(G h).point,←hχ n, fixedRowFourierPhase_translation] ring theorem completedT_fixed_active_strata (Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hcQ:Ideal.span {c}≤Ideal.span {(9:(_root_.OAI.ActualEisensteinCubic.O))}*Q) (φ χ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (hφ:CanonicalCoefficientClass.FactorsModulo Q φ) (hχ:∀n,χ n=finiteSexticRow (fun i=>Ideal.span {p i}) hg j n) (hφχ:∀n,‖(φ*χ) n‖≤1) (Qall:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hperiod:CanonicalCoefficientClass.FactorsModulo Qall (φ*χ)) (call:(_root_.OAI.ActualEisensteinCubic.O)) (hcall:call≠0) [Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {call})] (hcallQ:Ideal.span {call}≤Ideal.span {(9:(_root_.OAI.ActualEisensteinCubic.O))}*Qall) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0p i.val) (fun i _=>hprimary i.val)) (G h).primary (G h).shape (fun i=>hp i.val) (G h).denominator_ne_zero (fun i=>hg i.val) (fun i=>j i.val) W X := letI explicitWitness26 := @OAI.CubicEisenstein.fixedActiveQuotientFintype by rw [completedT_of_finite_cusp_multiplier (φ*χ) hφχ Qall hperiod call hcall hcallQ (fixedActiveCuspDatum p hp hprimary c G N hN D) (fixedActiveCuspWeight p hp hg j c hc φ) (fixedActiveCusp_fourier_multiplier p hp hprimary hg j c hc G N hN D Q hcQ φ χ hφ hχ) W lo hi hlo hsupp hW X hX] congr 1 simp only [FixedActiveCuspIndex,Fintype.sum_sigma,fixedActiveCuspWeight,fixedActiveCuspDatum, ControlledStratumArithmetic.smoothedValue,activeStratumDatum,Finset.mul_sum] apply Finset.sum_congr rfl intro h hh apply Finset.sum_congr rfl intro A hA apply Finset.sum_congr (by ext v; simp only [Finset.mem_univ]) intro v hv ring end CubicEisenstein open scoped BigOperators Classical ContDiff namespace CanonicalRowCompletion section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein CubicJacobiGlobal def actualControlledSource (I Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:Supported I) (c:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) [Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c})] (hcQ:(Ideal.span {c}:Ideal (_root_.OAI.ActualEisensteinCubic.O))=Ideal.span {(9:(_root_.OAI.ActualEisensteinCubic.O))}*Q) (G:∀h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c},FixedFourierGeometry c h) (φ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (W:ℝ→ℂ) (X:ℝ) : ℂ := by letI : ∀P:FreePrimeIndex I Q,(Ideal.span {freePrimaryPrime I Q P}:Ideal (_root_.OAI.ActualEisensteinCubic.O)).IsMaximal:= freePrimaryPrime_maximal I Q hI exact thetaDerivativeScalar⁻¹* ∑h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c},fixedThetaRowCoeff c hc φ h* ∑A:Finset (FreePrimeIndex I Q), primeInactiveFourierWeight (freePrimaryPrime I Q) (freePrimaryPrime_ne_zero I Q hI) (freePrimaryPrime_good I Q hI) (fun P=>(UniqueFactorizationMonoid.normalizedFactors I).count P.val.val%6) A* (freePrimaryControlledStratum I Q hI c hcQ h (G h) A).smoothedValue (mul_dvd_mul_left 9 (G h).denominator_dvd) (primary_finset_product Finset.univ (fun P:A=>freePrimaryPrime I Q P.val) (fun P _=>freePrimaryPrime_primary I Q hI P.val)) (G h).primary (G h).shape (fun P=>freePrimaryPrime_ne_zero I Q hI P.val) (G h).denominator_ne_zero (fun P=>freePrimaryPrime_good I Q hI P.val) (fun P=>(UniqueFactorizationMonoid.normalizedFactors I).count P.val.val.val%6) W X theorem fixedFree_completedT_eq_actualControlledSource (I Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:Supported I) (hQ:Q≠0) (c:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) [Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c})] (hcQ:(Ideal.span {c}:Ideal (_root_.OAI.ActualEisensteinCubic.O))=Ideal.span {(9:(_root_.OAI.ActualEisensteinCubic.O))}*Q) (G:∀h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c},FixedFourierGeometry c h) (φ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (hφ:CanonicalCoefficientClass.FactorsModulo Q φ) (hφn:∀n,‖φ n‖≤1) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0 primeIndexMaximal I P.val let : ∀P:FreePrimeIndex I Q,(Ideal.span {freePrimaryPrime I Q P}:Ideal (_root_.OAI.ActualEisensteinCubic.O)).IsMaximal:= freePrimaryPrime_maximal I Q hI let Qall:Ideal (_root_.OAI.ActualEisensteinCubic.O):=Q*(∏P:FreePrimeIndex I Q,P.val.val) have hQall:Qall≠0:=mul_ne_zero hQ (finite_prime_product_ne_bot (fun P:FreePrimeIndex I Q=>P.val.val)) let call:=ConcretePrimeRowBridge.idealGenerator (Ideal.span {(9:(_root_.OAI.ActualEisensteinCubic.O))}*Qall) have hcall:call≠0:=by apply ConcretePrimeRowBridge.idealGenerator_ne_zero apply mul_ne_zero _ hQall simp only [ne_eq,Ideal.zero_eq_bot,Ideal.span_singleton_eq_bot] norm_num let : Finite ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {call}):=ConcreteTraceCRT.finite_quotient_span hcall let : Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {call}):=Fintype.ofFinite _ have hcallQ:Ideal.span {call}≤Ideal.span {(9:(_root_.OAI.ActualEisensteinCubic.O))}*Qall:=by rw [ConcretePrimeRowBridge.span_idealGenerator] exact completedT_fixed_active_strata (freePrimaryPrime I Q) (freePrimaryPrime_ne_zero I Q hI) (freePrimaryPrime_primary I Q hI) (freePrimaryPrime_good I Q hI) (fun P=>(UniqueFactorizationMonoid.normalizedFactors I).count P.val.val%6) c hc G (9*c) (fun h=>mul_dvd_mul_left 9 (G h).denominator_dvd) (fun h A=>freePrimaryControlledStratum I Q hI c hcQ h (G h) A) Q hcQ.le φ (freePrimeRow I hI Q) hφ (freePrimeRow_eq_primary_family I Q hI) (fixedFreeRow_norm I hI Q φ hφn) Qall (fixedFreeRow_periodic I hI Q φ hφ) call hcall hcallQ W lo hi hlo hsupp hW X hX end section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein structure GoodMaskRowData (m f z:(_root_.OAI.ActualEisensteinCubic.O)) where maskUnit:(_root_.OAI.ActualEisensteinCubic.O)ˣ maskLambda:ℕ maskTwo:ℕ maskGood:(_root_.OAI.ActualEisensteinCubic.O) maskSupported:Supported (Ideal.span {maskGood}) maskPrimary:lambda^2∣maskGood-1 maskFactor:m=maskUnit.val*lambda^maskLambda*(2:(_root_.OAI.ActualEisensteinCubic.O))^maskTwo*maskGood numeratorUnit:(_root_.OAI.ActualEisensteinCubic.O)ˣ numeratorLambda:ℕ numeratorTwo:ℕ numeratorGood:(_root_.OAI.ActualEisensteinCubic.O) numeratorSupported:Supported (Ideal.span {numeratorGood}) numeratorPrimary:lambda^2∣numeratorGood-1 numeratorFactor:f^4*z=numeratorUnit.val*lambda^numeratorLambda*(2:(_root_.OAI.ActualEisensteinCubic.O))^numeratorTwo*numeratorGood theorem exists_goodMaskRowData (m f z:(_root_.OAI.ActualEisensteinCubic.O)) (hm:m≠0) (hf:f≠0) (hz:z≠0) : Nonempty (GoodMaskRowData m f z) := by obtain ⟨um,am,bm,g,hg,hpg,hmf⟩:=exists_supported_numerator_factorization m hm obtain ⟨u,a,b,r,hr,hpr,hxf⟩:=exists_supported_numerator_factorization (f^4*z) (mul_ne_zero (pow_ne_zero _ hf) hz) exact ⟨⟨um,am,bm,g,hg,hpg,hmf,u,a,b,r,hr,hpr,hxf⟩⟩ noncomputable def goodMaskRowData (m f z:(_root_.OAI.ActualEisensteinCubic.O)) (hm:m≠0) (hf:f≠0) (hz:z≠0) : GoodMaskRowData m f z := Classical.choice (exists_goodMaskRowData m f z hm hf hz) namespace GoodMaskRowData variable {m f z:(_root_.OAI.ActualEisensteinCubic.O)} (D:GoodMaskRowData m f z) def movingIdeal : Ideal (_root_.OAI.ActualEisensteinCubic.O) := goodMaskMovingIdeal D.maskGood D.numeratorGood lemma movingSupported : Supported D.movingIdeal := goodMaskMovingIdeal_supported D.maskGood D.numeratorGood D.maskSupported D.numeratorSupported def fixedFactor (Ψ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : (_root_.OAI.ActualEisensteinCubic.O)→*ℂ := (Ψ*numeratorBadTwist D.numeratorUnit D.numeratorLambda D.numeratorTwo D.numeratorGood D.numeratorSupported)*basePrimeRow D.movingIdeal D.movingSupported (Q*Ideal.span {(72:(_root_.OAI.ActualEisensteinCubic.O))}) lemma numeratorFactor_norm (Ψ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (hΨ:∀n,‖Ψ n‖≤1) (n:(_root_.OAI.ActualEisensteinCubic.O)) : ‖(Ψ*numeratorBadTwist D.numeratorUnit D.numeratorLambda D.numeratorTwo D.numeratorGood D.numeratorSupported) n‖≤1 := by change ‖Ψ n*numeratorBadTwist _ _ _ _ _ n‖≤1 rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (hΨ n)).trans (numeratorBadTwist_norm _ _ _ _ _ n) lemma fixedFactor_periodic (Ψ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hΨ:CanonicalCoefficientClass.FactorsModulo Q Ψ) : CanonicalCoefficientClass.FactorsModulo (Q*Ideal.span {(72:(_root_.OAI.ActualEisensteinCubic.O))}) (D.fixedFactor Ψ Q) := by have hn:=fixedNumeratorTwist_periodic Ψ Q hΨ D.numeratorUnit D.numeratorLambda D.numeratorTwo D.numeratorGood D.numeratorSupported intro x y hxy change (Ψ*numeratorBadTwist D.numeratorUnit D.numeratorLambda D.numeratorTwo D.numeratorGood D.numeratorSupported) x*basePrimeRow D.movingIdeal D.movingSupported (Q*Ideal.span {(72:(_root_.OAI.ActualEisensteinCubic.O))}) x= (Ψ*numeratorBadTwist D.numeratorUnit D.numeratorLambda D.numeratorTwo D.numeratorGood D.numeratorSupported) y*basePrimeRow D.movingIdeal D.movingSupported (Q*Ideal.span {(72:(_root_.OAI.ActualEisensteinCubic.O))}) y rw [hn x y hxy,basePrimeRow_periodic D.movingIdeal D.movingSupported _ x y hxy] lemma fixedFactor_norm (Ψ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hΨ:∀n,‖Ψ n‖≤1) (n:(_root_.OAI.ActualEisensteinCubic.O)) : ‖D.fixedFactor Ψ Q n‖≤1 := by change ‖((Ψ*numeratorBadTwist _ _ _ _ _) n)*(basePrimeRow _ _ _ n)‖≤1 rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (D.numeratorFactor_norm Ψ hΨ n)).trans (basePrimeRow_norm _ _ _ n) theorem row_primary (Ψ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hmLam:lambda∣m) (hm2:(2:(_root_.OAI.ActualEisensteinCubic.O))∣m) (n:(_root_.OAI.ActualEisensteinCubic.O)) (hpn:lambda^2∣n-1) : rowTwist Ψ m f z n=D.fixedFactor Ψ Q n* freePrimeRow D.movingIdeal D.movingSupported (Q*Ideal.span {(72:(_root_.OAI.ActualEisensteinCubic.O))}) n := by rw [rowTwist_eq_fixed_times_good_row_primary Ψ m f z hmLam hm2 D.maskUnit D.maskLambda D.maskTwo D.maskGood D.maskSupported D.maskFactor D.numeratorUnit D.numeratorLambda D.numeratorTwo D.numeratorGood D.numeratorSupported D.numeratorPrimary D.numeratorFactor n hpn] change (Ψ*numeratorBadTwist _ _ _ _ _) n*idealRowHom n D.movingIdeal= _ rw [idealRowHom_fixed_conductor_split D.movingIdeal D.movingSupported (Q*Ideal.span {(72:(_root_.OAI.ActualEisensteinCubic.O))}) n] simp only [fixedFactor,MonoidHom.mul_apply] ring theorem completedT_eq_fixedFactor (Ψ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hmLam:lambda∣m) (hm2:(2:(_root_.OAI.ActualEisensteinCubic.O))∣m) (W:ℝ→ℂ) (X:ℝ) : completedT (rowTwist Ψ m f z) W X= completedT (D.fixedFactor Ψ Q*freePrimeRow D.movingIdeal D.movingSupported (Q*Ideal.span {(72:(_root_.OAI.ActualEisensteinCubic.O))})) W X := completedT_congr_primary _ _ (D.row_primary Ψ Q hmLam hm2) W X lemma fixedCoefficient_norm (Ψ:(_root_.OAI.ActualEisensteinCubic.O)→*ℂ) (Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hΨ:∀n,‖Ψ n‖≤1) (c:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) [Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c})] (h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c}) : ‖fixedThetaRowCoeff c hc (D.fixedFactor Ψ Q) h‖≤1 := fixedThetaRowCoeff_norm c hc _ (D.fixedFactor_norm Ψ Q hΨ) h end GoodMaskRowData end open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve UniqueFactorizationMonoid namespace GoodMaskRowData variable {m f z:(_root_.OAI.ActualEisensteinCubic.O)} (D:GoodMaskRowData m f z) variable (R I F Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hR:R≠0) (hI:I≠0) (hF:Squarefree F) (hm:m≠0) (hf:Ideal.span {f}=F) (hz:Ideal.span {z}=I) (hbad:∀P∈fixedBadPrimes,P∣Ideal.span {m}*F) (hcop:IsCoprime Q0 (rowResidualPart I (Ideal.span {m}*F))) (hA:rowPowerfulPart R=rowPowerfulPart I) (hT:rowMaskPart R (Ideal.span {m}*F)=rowMaskPart I (Ideal.span {m}*F)) include R I F Q0 hR hI hF hm hf hz hbad hcop hA hT noncomputable def primeFiberEquiv : PrimeIndex (rowResidualPart I (Ideal.span {m}*F)) ⊕ FreeReflection.pool R (Ideal.span {m}*F) Q0 ≃ FreePrimeIndex D.movingIdeal Q0 := goodMaskFreePrimeFiberEquiv R I F Q0 hR hI hF m f z hm hf hz D.maskUnit D.maskLambda D.maskTwo D.maskGood D.maskSupported D.maskFactor D.numeratorUnit D.numeratorLambda D.numeratorTwo D.numeratorGood D.numeratorSupported D.numeratorFactor hbad hcop hA hT lemma primeFiberEquiv_val (P:PrimeIndex (rowResidualPart I (Ideal.span {m}*F)) ⊕ FreeReflection.pool R (Ideal.span {m}*F) Q0) : (D.primeFiberEquiv R I F Q0 hR hI hF hm hf hz hbad hcop hA hT P).val.val= Sum.elim Subtype.val Subtype.val P := by cases P <;> rfl lemma primeFiberEquiv_exponent (P:PrimeIndex (rowResidualPart I (Ideal.span {m}*F)) ⊕ FreeReflection.pool R (Ideal.span {m}*F) Q0) : (normalizedFactors D.movingIdeal).count (D.primeFiberEquiv R I F Q0 hR hI hF hm hf hz hbad hcop hA hT P).val.val%6= Sum.elim (fun _=>1) (fun S=>completedLocalExponent R F S.val) P := goodMaskFreePrimeFiberEquiv_exponent R I F Q0 hR hI hF m f z hm hf hz D.maskUnit D.maskLambda D.maskTwo D.maskGood D.maskSupported D.maskFactor D.numeratorUnit D.numeratorLambda D.numeratorTwo D.numeratorGood D.numeratorSupported D.numeratorFactor hbad hcop hA hT P end GoodMaskRowData noncomputable def fiberGoodMaskRowData (rows:Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O))) (R F:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (m:(_root_.OAI.ActualEisensteinCubic.O)) (hm:m≠0) (hF:F≠0) (hrows:∀I∈rows,I≠0) (u:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (I:representativeRowFiber rows R (Ideal.span {m}*F)) : GoodMaskRowData m (ConcretePrimeRowBridge.idealGenerator F) (u.val*ConcretePrimeRowBridge.idealGenerator I.val) := goodMaskRowData _ _ _ hm (ConcretePrimeRowBridge.idealGenerator_ne_zero F hF) (mul_ne_zero u.ne_zero (ConcretePrimeRowBridge.idealGenerator_ne_zero I.val (hrows I.val (Finset.mem_filter.mp I.property).1))) end CanonicalRowCompletion end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.RowAmplitudes /- Named aliases replace local notation; original declarations retain their names. -/ namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CanonicalRowCompletion section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein namespace RootNotationRowAmplitudes01 abbrev Eis := ActualEisensteinCubic.O end RootNotationRowAmplitudes01 open RootNotationRowAmplitudes01 (Eis) namespace GoodMaskRowData variable {m f z:Eis} (D:GoodMaskRowData m f z) variable (Q:Ideal Eis) (c:Eis) (hc:c≠0) [Fintype (Eis⧸Ideal.span {c})] (hcQ:(Ideal.span {c}:Ideal Eis)=Ideal.span {(9:Eis)}*(Q*Ideal.span {(72:Eis)})) (h:Eis⧸Ideal.span {c}) (G:FixedFourierGeometry c h) (A:Finset (FreePrimeIndex D.movingIdeal (Q*Ideal.span {(72:Eis)}))) abbrev activeStratum := freePrimaryControlledStratum D.movingIdeal (Q*Ideal.span {(72:Eis)}) D.movingSupported c hcQ h G A def sourceRowScalar (Ψ:Eis→*ℂ) (u:Eisˣ) (n:ℕ) : ℂ := by letI : ∀P:A,(Ideal.span {freePrimaryPrime D.movingIdeal (Q*Ideal.span {(72:Eis)}) P.val}:Ideal Eis).IsMaximal:= fun P=>freePrimaryPrime_maximal D.movingIdeal _ D.movingSupported P.val exact fixedThetaRowCoeff c hc (D.fixedFactor Ψ Q) h* G.shape.stratumShapeFactor (G.c0*∏P:A,freePrimaryPrime D.movingIdeal (Q*Ideal.span {(72:Eis)}) P.val)* (D.activeStratum Q c hcQ h G A).modelRowPhase G.shape (fun P=>freePrimaryPrime_ne_zero D.movingIdeal _ D.movingSupported P.val) (fun P=>freePrimaryPrime_good D.movingIdeal _ D.movingSupported P.val) (fun P=>(UniqueFactorizationMonoid.normalizedFactors D.movingIdeal).count P.val.val.val%6) u n lemma sourceRowScalar_norm (Ψ:Eis→*ℂ) (hΨ:∀n,‖Ψ n‖≤1) (u:Eisˣ) (n:ℕ) : ‖D.sourceRowScalar Q c hc hcQ h G A Ψ u n‖≤1 := by let : ∀P:A,(Ideal.span {freePrimaryPrime D.movingIdeal (Q*Ideal.span {(72:Eis)}) P.val}:Ideal Eis).IsMaximal:= fun P=>freePrimaryPrime_maximal D.movingIdeal _ D.movingSupported P.val have hp:(G.c0*∏P:A,freePrimaryPrime D.movingIdeal (Q*Ideal.span {(72:Eis)}) P.val)≠0:= mul_ne_zero G.denominator_ne_zero (Finset.prod_ne_zero_iff.mpr (fun P _=>freePrimaryPrime_ne_zero D.movingIdeal _ D.movingSupported P.val)) have hs:=G.shape.stratumShapeFactor_norm _ hp have hr:=(D.activeStratum Q c hcQ h G A).modelRowPhase_norm (mul_dvd_mul_left 9 G.denominator_dvd) (primary_finset_product Finset.univ (fun P:A=>freePrimaryPrime D.movingIdeal (Q*Ideal.span {(72:Eis)}) P.val) (fun P _=>freePrimaryPrime_primary D.movingIdeal _ D.movingSupported P.val)) G.primary G.shape (fun P=>freePrimaryPrime_ne_zero D.movingIdeal _ D.movingSupported P.val) (fun P=>freePrimaryPrime_good D.movingIdeal _ D.movingSupported P.val) (fun P=>freePrimaryPrime_odd D.movingIdeal _ D.movingSupported P.val) (fun P=>(UniqueFactorizationMonoid.normalizedFactors D.movingIdeal).count P.val.val.val%6) (fun _=>Nat.mod_lt _ (by decide)) u n unfold sourceRowScalar rw [norm_mul,norm_mul,hs,hr,mul_one,mul_one] exact D.fixedCoefficient_norm Ψ Q hΨ c hc h def sourceRowResidue : G.PhaseResidue := Ideal.Quotient.mk _ (-((D.activeStratum Q c hcQ h G A).matrix (fun _=>1) 1 1)* (D.activeStratum Q c hcQ h G A).U) def selectedSourceRowScalar (Ψ:Eis→*ℂ) (u:Eisˣ) (n:ℕ) (rho:G.PhaseResidue) (k dN dB:Ideal Eis) : ℂ := if rho=D.sourceRowResidue Q c hcQ h G A then D.sourceRowScalar Q c hc hcQ h G A Ψ u n*residualArgumentPhase k 1 dN dB else 0 lemma selectedSourceRowScalar_norm (Ψ:Eis→*ℂ) (hΨ:∀n,‖Ψ n‖≤1) (u:Eisˣ) (n:ℕ) (rho:G.PhaseResidue) (k dN dB:Ideal Eis) : ‖D.selectedSourceRowScalar Q c hc hcQ h G A Ψ u n rho k dN dB‖≤1 := by unfold selectedSourceRowScalar split_ifs · rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (D.sourceRowScalar_norm Q c hc hcQ h G A Ψ hΨ u n)).trans (residualArgumentPhase_norm_le_one k 1 dN dB) · simp lemma sum_selectedSourceRowScalar [Fintype G.PhaseResidue] (Ψ:Eis→*ℂ) (u:Eisˣ) (n:ℕ) (k dN dB:Ideal Eis) : (∑rho:G.PhaseResidue,D.selectedSourceRowScalar Q c hc hcQ h G A Ψ u n rho k dN dB)= D.sourceRowScalar Q c hc hcQ h G A Ψ u n*residualArgumentPhase k 1 dN dB := by simp only [selectedSourceRowScalar,Finset.sum_ite_eq',Finset.mem_univ,ite_true] end GoodMaskRowData end section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein namespace RootNotationRowAmplitudes02 abbrev Eis := ActualEisensteinCubic.O end RootNotationRowAmplitudes02 open RootNotationRowAmplitudes02 (Eis) namespace GoodMaskRowData variable {m f z:Eis} (D:GoodMaskRowData m f z) theorem completedT_eq_actualControlledSource (Q:Ideal Eis) (hQ:Q≠0) (c:Eis) (hc:c≠0) [Fintype (Eis⧸Ideal.span {c})] (hcQ:(Ideal.span {c}:Ideal Eis)=Ideal.span {(9:Eis)}*(Q*Ideal.span {(72:Eis)})) (G:∀h:Eis⧸Ideal.span {c},FixedFourierGeometry c h) (Ψ:Eis→*ℂ) (hΨ:CanonicalCoefficientClass.FactorsModulo Q Ψ) (hΨnorm:∀n,‖Ψ n‖≤1) (hmLam:lambda∣m) (hm2:(2:Eis)∣m) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0e (Sum.inl a)) omit [Fintype β] [Fintype γ] in lemma residualActivePrimes_not_inr (e:α⊕β ≃ γ) (b:β) : e (Sum.inr b)∉residualActivePrimes e := by intro h obtain ⟨a,_,ha⟩:=Finset.mem_image.mp h cases e.injective ha def nonresidualComplementMap (e:α⊕β ≃ γ) : β → {g:γ // g∉residualActivePrimes e} := fun b=>⟨e (Sum.inr b),residualActivePrimes_not_inr e b⟩ omit [Fintype β] [Fintype γ] in lemma nonresidualComplementMap_bijective (e:α⊕β ≃ γ) : Function.Bijective (nonresidualComplementMap e) := by constructor · intro a b hab exact Sum.inr.inj (e.injective (congrArg Subtype.val hab)) · intro g obtain ⟨x,hx⟩:=e.surjective g.val cases x with | inl a=> exact (g.property (Finset.mem_image.mpr ⟨a,Finset.mem_univ a,hx⟩)).elim | inr b=>exact ⟨b,Subtype.ext hx⟩ noncomputable def nonresidualComplementEquiv (e:α⊕β ≃ γ) : β ≃ {g:γ // g∉residualActivePrimes e} := Equiv.ofBijective (nonresidualComplementMap e) (nonresidualComplementMap_bijective e) omit [Fintype β] [Fintype γ] in lemma nonresidualComplementEquiv_val (e:α⊕β ≃ γ) (b:β) : (nonresidualComplementEquiv e b).val=e (Sum.inr b) := rfl omit [Fintype β] [Fintype γ] in lemma complementActive_image (e:α⊕β ≃ γ) (B:Finset β) : (B.map (nonresidualComplementEquiv e).toEmbedding).image Subtype.val= B.image (fun b=>e (Sum.inr b)) := by simp only [Finset.map_eq_image,Finset.image_image,Function.comp_def, Equiv.toEmbedding_apply,nonresidualComplementEquiv_val] lemma inactive_product_nonresidual (e:α⊕β ≃ γ) (z:γ → ℂ) (B:Finset β) : (∏g∈(Finset.univ:Finset {g:γ // g∉residualActivePrimes e})\ B.map (nonresidualComplementEquiv e).toEmbedding,z g.val)= ∏b∈(Finset.univ:Finset β)\B,z (e (Sum.inr b)) := by symm apply Finset.prod_equiv (nonresidualComplementEquiv e) · intro b simp only [Finset.mem_sdiff,Finset.mem_univ,true_and,Finset.mem_map_equiv, Equiv.symm_apply_apply] · intro b hb rfl theorem inactive_weight_nonresidual_subsets (e:α⊕β ≃ γ) (z:γ → ℂ) (hz:∀a:α,z (e (Sum.inl a))=0) (F:Finset γ → ℂ) : (∑A:Finset γ,(∏g∈(Finset.univ:Finset γ)\A,z g)*F A)= ∑B:Finset β,(∏b∈(Finset.univ:Finset β)\B,z (e (Sum.inr b)))* F (residualActivePrimes e∪B.image (fun b=>e (Sum.inr b))) := by have hres:∀g∈residualActivePrimes e,z g=0:=by intro g hg obtain ⟨a,_,rfl⟩:=Finset.mem_image.mp hg exact hz a rw [CompletedGauss.inactive_weight_optional_active (residualActivePrimes e) z hres F] symm apply Fintype.sum_equiv (nonresidualComplementEquiv e).finsetCongr intro B change _=(∏g∈(Finset.univ:Finset {g:γ // g∉residualActivePrimes e})\ B.map (nonresidualComplementEquiv e).toEmbedding,z g.val)* F (residualActivePrimes e∪(B.map (nonresidualComplementEquiv e).toEmbedding).image Subtype.val) rw [inactive_product_nonresidual,complementActive_image] end CanonicalRowCompletion open scoped BigOperators Classical ContDiff namespace CompletedGauss open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve CompletedDyadic LocalReflectionBrackets namespace RootNotationRowAmplitudes03 abbrev Eis := ActualEisensteinCubic.O end RootNotationRowAmplitudes03 open RootNotationRowAmplitudes03 (Eis) lemma actual_bracket_ideal_congr (P Q:Ideal Eis) [P.IsMaximal] [Q.IsMaximal] (hP:lambda∉P) (hQ:lambda∉Q) (hPQ:P=Q) (j:ℕ) (z:Eis) : let : Field (Eis ⧸ P) := Ideal.Quotient.field P let : Fintype (Eis ⧸ P) := ActualEisensteinCubic.quotientFintype P let : Field (Eis ⧸ Q) := Ideal.Quotient.field Q let : Fintype (Eis ⧸ Q) := ActualEisensteinCubic.quotientFintype Q bracket (actualSextic P hP) j (Ideal.Quotient.mk P z)= bracket (actualSextic Q hQ) j (Ideal.Quotient.mk Q z) := by let : Field (Eis ⧸ P) := Ideal.Quotient.field P let : Fintype (Eis ⧸ P) := ActualEisensteinCubic.quotientFintype P let : Field (Eis ⧸ Q) := Ideal.Quotient.field Q let : Fintype (Eis ⧸ Q) := ActualEisensteinCubic.quotientFintype Q dsimp only subst Q rfl end CompletedGauss namespace CubicEisenstein open ActualEisensteinCubic CompletedGauss CompletedDyadic CanonicalQuadraticSieve namespace RootNotationRowAmplitudes04 abbrev Eis := ActualEisensteinCubic.O end RootNotationRowAmplitudes04 open RootNotationRowAmplitudes04 (Eis) namespace FixedFourierGeometry variable {c:Eis} {h:Eis⧸Ideal.span {c}} (G:FixedFourierGeometry c h) variable {ι:Type*} [Fintype ι] {p:ι→Eis} {N:Eis} end FixedFourierGeometry end CubicEisenstein open scoped Classical BigOperators ContDiff namespace CanonicalRowCompletion open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CanonicalCoefficientClass open ConcretePrimeRowBridge SecondPassArithmetic namespace RootNotationRowAmplitudes05 abbrev Eis := ActualEisensteinCubic.O end RootNotationRowAmplitudes05 open RootNotationRowAmplitudes05 (Eis) def HasFixedShellModels (S:Finset (Ideal Eis)) (base:Eis→*ℂ) (rays:ℕ) (scale:ℂ) (ρ q level:ℝ) : Prop := ∀ Ψ:Eis→*ℂ,IsBaseRayTwist base Ψ→∀m:Eis,m≠0→ ∀ F:ℝ,∀f:idealRange F,∀u:Eisˣ,∀ W:ℝ→ℂ,∀a b:ℝ, 0Ideal.span {z}) have hrows:∀I∈rows,I≠0:=by intro I hI obtain ⟨z,hz,rfl⟩:=Finset.mem_image.mp hI exact Ideal.span_singleton_eq_bot.not.mpr (Finset.mem_erase.mp hz).1 intro j hj exact hmodels Ψ hΨ m hm F f u (CompletedHeight.normTwistedSource W θ) (Real.exp (-A)) (Real.exp A) (Real.exp_pos _) hsTw hTw ((2:ℝ)^j) (X/(Ideal.absNorm H:ℝ)^3) (by positivity) hXH (completedRowDyad rows j) (completedRowDyad_bounds rows j hrows) end CanonicalRowCompletion open scoped Classical BigOperators namespace CompletedGauss.ReflectedBranchData open ActualEisensteinCubic CanonicalQuadraticSieve CompletedDyadic namespace RootNotationRowAmplitudes06 abbrev Eis := ActualEisensteinCubic.O end RootNotationRowAmplitudes06 open RootNotationRowAmplitudes06 (Eis) variable {levelBound K:ℝ} {I F Q:Ideal Eis} variable (d:ReflectedBranchData levelBound K I F Q) variable (η:ℕ→Ideal Eis→Ideal Eis→ℂ) variable (σ τ:ℕ→idealRange (completedResidualScale K I Q)→ℂ) variable (W:ℝ→ℂ) (X ρ q:ℝ) (k:idealRange (completedResidualScale K I Q)) lemma rawValue_congr_phase_at (h:∀m,σ m k=τ m k) : d.rawValue η σ W X ρ q k=d.rawValue η τ W X ρ q k := by unfold rawValue apply tsum_congr intro x simp only [rawDualKernelTerm,canonicalRawBranchCoefficient,h] lemma rawValue_zero_phase : d.rawValue η (fun _ _=>0) W X ρ q k=0 := by unfold rawValue simp only [rawDualKernelTerm,canonicalRawBranchCoefficient,zero_mul,tsum_zero] lemma rawValue_mul_phase_at (a:idealRange (completedResidualScale K I Q)→ℂ) : d.rawValue η (fun m l=>a l*σ m l) W X ρ q k=a k*d.rawValue η σ W X ρ q k := by unfold rawValue rw [←tsum_mul_left] apply tsum_congr intro x unfold rawDualKernelTerm canonicalRawBranchCoefficient ring end CompletedGauss.ReflectedBranchData open scoped BigOperators Classical namespace CanonicalRowCompletion variable {α β γ:Type*} [Fintype α] [Fintype β] [Fintype γ] def completeActiveSet (e:α⊕β ≃ γ) (B:Finset β) : Finset γ := residualActivePrimes e∪B.image (fun b=>e (Sum.inr b)) omit [Fintype β] [Fintype γ] in lemma completeActiveSet_residual (e:α⊕β ≃ γ) (B:Finset β) (a:α) : e (Sum.inl a)∈completeActiveSet e B := Finset.mem_union_left _ (Finset.mem_image.mpr ⟨a,Finset.mem_univ a,rfl⟩) omit [Fintype γ] in lemma optionalPrimeActive_completeActiveSet (e:α⊕β ≃ γ) (B:Finset β) : optionalPrimeActive e (completeActiveSet e B)=B := by ext b rw [mem_optionalPrimeActive] change e (Sum.inr b)∈residualActivePrimes e∪B.image (fun b=>e (Sum.inr b)) ↔ b∈B simp only [Finset.mem_union,residualActivePrimes_not_inr,false_or,Finset.mem_image] constructor · rintro ⟨b',hb',he⟩ have hb:b'=b:=Sum.inr.inj (e.injective he) exact hb ▸ hb' · intro hb exact ⟨b,hb,rfl⟩ noncomputable def selectedActiveEquiv (e:α⊕β ≃ γ) (B:Finset β) : α⊕B ≃ completeActiveSet e B := by let t : B ≃ optionalPrimeActive e (completeActiveSet e B):={ toFun:=fun b=>⟨b.val,by simpa only [optionalPrimeActive_completeActiveSet] using b.property⟩ invFun:=fun b=>⟨b.val,by simpa only [optionalPrimeActive_completeActiveSet] using b.property⟩ left_inv:=fun _=>rfl right_inv:=fun _=>rfl } exact (Equiv.sumCongr (Equiv.refl _) t).trans (activePrimeUnionEquiv e (completeActiveSet e B) (completeActiveSet_residual e B)) omit [Fintype γ] in lemma selectedActiveEquiv_inl (e:α⊕β ≃ γ) (B:Finset β) (a:α) : (selectedActiveEquiv e B (Sum.inl a)).val=e (Sum.inl a) := rfl omit [Fintype γ] in lemma selectedActiveEquiv_inr (e:α⊕β ≃ γ) (B:Finset β) (b:B) : (selectedActiveEquiv e B (Sum.inr b)).val=e (Sum.inr b.val) := rfl end CanonicalRowCompletion open scoped BigOperators Classical namespace CanonicalRowCompletion.ActualFiber open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein namespace RootNotationRowAmplitudes07 abbrev Eis := ActualEisensteinCubic.O end RootNotationRowAmplitudes07 open RootNotationRowAmplitudes07 (Eis) def maskElement (q:ℕ) (m:Eis) : Eis := m*excludedGenerator (reflectionExcludedPrimes q) def maskIdeal (q:ℕ) (m:Eis) (F:Ideal Eis) : Ideal Eis := Ideal.span {maskElement q m}*F def freeConductor (q:ℕ) : Ideal Eis := CanonicalCoefficientClass.fixedBaseConductor q*Ideal.span {(72:Eis)} abbrev RowIndex (q:ℕ) (m:Eis) (rows:Finset (Ideal Eis)) (R F:Ideal Eis) := representativeRowFiber rows R (maskIdeal q m F) lemma maskElement_ne_zero (q:ℕ) (m:Eis) (hm:m≠0) : maskElement q m≠0 := mul_ne_zero hm (reflectionExcludedGenerator_ne_zero q) lemma maskIdeal_ne_zero (q:ℕ) (m:Eis) (hm:m≠0) (F:Ideal Eis) (hF:F≠0) : maskIdeal q m F≠0 := mul_ne_zero (Ideal.span_singleton_eq_bot.not.mpr (maskElement_ne_zero q m hm)) hF lemma mask_bad (q:ℕ) (m:Eis) (F:Ideal Eis) : ∀P∈fixedBadPrimes,P∣maskIdeal q m F := reflection_row_mask_bad q m F variable (q:ℕ) (hq:q≠0) (m:Eis) (hm:m≠0) (rows:Finset (Ideal Eis)) (R F:Ideal Eis) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:Eisˣ) noncomputable def data (J:RowIndex q m rows R F) : GoodMaskRowData (maskElement q m) (ConcretePrimeRowBridge.idealGenerator F) (v.val*ConcretePrimeRowBridge.idealGenerator J.val) := fiberGoodMaskRowData rows R F (maskElement q m) (maskElement_ne_zero q m hm) hF.ne_zero hrows v J noncomputable def splitIndex (J:RowIndex q m rows R F) : PrimeIndex (rowResidualPart J.val (maskIdeal q m F)) ⊕ FreeReflection.pool R (maskIdeal q m F) (freeConductor q) ≃ FreePrimeIndex (data q m hm rows R F hF hrows v J).movingIdeal (freeConductor q) := by have hJ:J.val≠0:=hrows J.val (Finset.mem_filter.mp J.property).1 have hz:Ideal.span {v.val*ConcretePrimeRowBridge.idealGenerator J.val}=J.val:=by rw [Ideal.span_singleton_mul_left_unit v.isUnit,ConcretePrimeRowBridge.span_idealGenerator] have parts:=representativeFiber_parts rows R (maskIdeal q m F) J exact (data q m hm rows R F hF hrows v J).primeFiberEquiv R J.val F (freeConductor q) hR hJ hF (maskElement_ne_zero q m hm) (ConcretePrimeRowBridge.span_idealGenerator F) hz (mask_bad q m F) (residual_coprime_free_base q hq m F J.val) parts.1.symm parts.2.symm noncomputable def activeSet (e:FreeReflection.pool R (maskIdeal q m F) (freeConductor q) → Fin 6) (J:RowIndex q m rows R F) : Finset (FreePrimeIndex (data q m hm rows R F hF hrows v J).movingIdeal (freeConductor q)) := completeActiveSet (splitIndex q hq m hm rows R F hR hF hrows v J) (reflectionSixSupport e) def columnDivisor (e:FreeReflection.pool R (maskIdeal q m F) (freeConductor q) → Fin 6) (side:Fin 3) : Ideal Eis := reflectionExtractedDivisor (fun P:FreeReflection.reflectionActivePool R (maskIdeal q m F) (freeConductor q) e=>P.val) (fun P=>completedLocalExponent R F P.val) (FreeReflection.reflectionActiveLabel R (maskIdeal q m F) (freeConductor q) e) side variable [Fintype (Eis⧸Ideal.span {reflectionConductor q})] noncomputable def rowScalar (Ψ:Eis→*ℂ) (x:FreeReflection.FixedBranchIndex (reflectionConductor q) (reflectionConductor_ne_zero q hq) R (maskIdeal q m F) (freeConductor q)) (n:ℕ) (J:RowIndex q m rows R F) : ℂ := (data q m hm rows R F hF hrows v J).selectedSourceRowScalar (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ne_zero q hq) (reflectionConductor_ideal q) x.1.1 (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) x.1.1) (activeSet q hq m hm rows R F hR hF hrows v x.2 J) Ψ x.1.2.2 n x.1.2.1 (rowResidualPart J.val (maskIdeal q m F)) (columnDivisor q m R F x.2 1) (columnDivisor q m R F x.2 2) lemma rowScalar_norm (Ψ:Eis→*ℂ) (hΨ:∀n,‖Ψ n‖≤1) (x:FreeReflection.FixedBranchIndex (reflectionConductor q) (reflectionConductor_ne_zero q hq) R (maskIdeal q m F) (freeConductor q)) (n:ℕ) (J:RowIndex q m rows R F) : ‖rowScalar q hq m hm rows R F hR hF hrows v Ψ x n J‖≤1 := by exact (data q m hm rows R F hF hrows v J).selectedSourceRowScalar_norm (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ne_zero q hq) (reflectionConductor_ideal q) x.1.1 (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) x.1.1) (activeSet q hq m hm rows R F hR hF hrows v x.2 J) Ψ hΨ x.1.2.2 n x.1.2.1 (rowResidualPart J.val (maskIdeal q m F)) (columnDivisor q m R F x.2 1) (columnDivisor q m R F x.2 2) noncomputable def reflectedFiber (K:ℝ) (Ψ:Eis→*ℂ) (hΨ:∀n,‖Ψ n‖≤1) : ReflectedFiberData (fixedReflectionRayCount (reflectionConductor q) (reflectionConductor_ne_zero q hq)) (fixedCuspLevelBound (reflectionConductor q)) K R F (maskIdeal q m F) := FreeReflection.fixedRayFiberFromRows (reflectionConductor q) (reflectionConductor_ne_zero q hq) rows R F (maskIdeal q m F) (freeConductor q) hR (maskIdeal_ne_zero q m hm F hF.ne_zero) K (fun a J=>rowScalar q hq m hm rows R F hR hF hrows v Ψ a.1 a.2 J) (fun a J=>rowScalar_norm q hq m hm rows R F hR hF hrows v Ψ hΨ a.1 a.2 J) end CanonicalRowCompletion.ActualFiber end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.GaussSum.ActiveReindexing namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical ContDiff namespace CompletedGauss open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve CompletedDyadic LocalReflectionBrackets lemma active_product_admissible_equiv {ι β:Type*} [Fintype ι] [Fintype β] (k:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hk:Squarefree k) (P:ι→Ideal (_root_.OAI.ActualEisensteinCubic.O)) (R:β→Ideal (_root_.OAI.ActualEisensteinCubic.O)) (E:PrimeIndex k⊕β≃ι) (hres:∀r,P (E (Sum.inl r))=r.val) (hnonres:∀r,P (E (Sum.inr r))=R r) : (∏i,P i)=k*∏i,R i := by rw [←E.prod_comp,Fintype.prod_sum_type] simp only [hres,hnonres] congr 1 change (∏r:primeSupport k,r.val)=k exact (Finset.prod_coe_sort (primeSupport k) (fun r:Ideal (_root_.OAI.ActualEisensteinCubic.O)=>r)).trans (IdealMobiusDivisorSum.squarefree_support_product_self hk) theorem residual_bracket_extracted_admissible (k:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hk:Admissible k) (z:(_root_.OAI.ActualEisensteinCubic.O)) (A B n b:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : let : ∀ r : PrimeIndex k, r.val.IsMaximal := primeIndexMaximal k let : ∀ r : PrimeIndex k, Field ((_root_.OAI.ActualEisensteinCubic.O) ⧸ r.val) := fun r => Ideal.Quotient.field r.val let : ∀ r : PrimeIndex k, Fintype ((_root_.OAI.ActualEisensteinCubic.O) ⧸ r.val) := fun r => ActualEisensteinCubic.quotientFintype r.val (∏P:PrimeIndex k, bracket (actualSextic P.val (admissiblePrimeGood k hk P)) 1 (Ideal.Quotient.mk P.val (z*primaryGenerator (A*n)*(primaryGenerator (B*b))^3)))= residualArgumentPhase k z A B*quadraticRow k (primaryGenerator (n*b)) := by let : ∀ r : PrimeIndex k, r.val.IsMaximal := primeIndexMaximal k let : ∀ r : PrimeIndex k, Field ((_root_.OAI.ActualEisensteinCubic.O) ⧸ r.val) := fun r => Ideal.Quotient.field r.val let : ∀ r : PrimeIndex k, Fintype ((_root_.OAI.ActualEisensteinCubic.O) ⧸ r.val) := fun r => ActualEisensteinCubic.quotientFintype r.val dsimp only rw [residual_bracket_product] rw [←quadraticRow_eq_primeIndex k hk,←quadraticRow_eq_primeIndex k hk] simp only [primaryGenerator_mul,residualArgumentPhase,canonical_quadraticRow_argument_mul k hk] ring theorem residual_coefficient_eq_canonical_admissible {ι:Type*} [Fintype ι] (k:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hk:Admissible k) (P:ι→Ideal (_root_.OAI.ActualEisensteinCubic.O)) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (j:ι→ℕ) (e:ι→Fin 3) (ρ q:ℝ) (residualArgument:ℕ→(_root_.OAI.ActualEisensteinCubic.O)) (η:ℕ→Ideal (_root_.OAI.ActualEisensteinCubic.O)→Ideal (_root_.OAI.ActualEisensteinCubic.O)→ℂ) (rowPhase:ℕ→ℂ) (m:ℕ) (n b:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : let : ∀ r : PrimeIndex k, r.val.IsMaximal := primeIndexMaximal k let : ∀ r : PrimeIndex k, Field ((_root_.OAI.ActualEisensteinCubic.O) ⧸ r.val) := fun r => Ideal.Quotient.field r.val let : ∀ r : PrimeIndex k, Fintype ((_root_.OAI.ActualEisensteinCubic.O) ⧸ r.val) := fun r => ActualEisensteinCubic.quotientFintype r.val let A:=reflectionExtractedDivisor P j e 1 let B:=reflectionExtractedDivisor P j e 2 (rowPhase m*(∏p:PrimeIndex k, bracket (actualSextic p.val (admissiblePrimeGood k hk p)) 1 (Ideal.Quotient.mk p.val (residualArgument m*primaryGenerator (A*n)*(primaryGenerator (B*b))^3))) * η m (A*n) (B*b)*reflectedBranch P hg j e (primaryGenerator (A*n)) (primaryGenerator (B*b)))/ ((ramifiedScale ρ q m*Real.sqrt (Ideal.absNorm (A*n):ℝ)*(Ideal.absNorm (B*b):ℝ):ℝ):ℂ)= 4*canonicalRawBranchCoefficient P hg j e ρ q (fun l a c=>η l (A*a) (B*c)) (fun l=>rowPhase l*residualArgumentPhase k (residualArgument l) A B) k m n b := by let : ∀ r : PrimeIndex k, r.val.IsMaximal := primeIndexMaximal k let : ∀ r : PrimeIndex k, Field ((_root_.OAI.ActualEisensteinCubic.O) ⧸ r.val) := fun r => Ideal.Quotient.field r.val let : ∀ r : PrimeIndex k, Fintype ((_root_.OAI.ActualEisensteinCubic.O) ⧸ r.val) := fun r => ActualEisensteinCubic.quotientFintype r.val dsimp only rw [residual_bracket_extracted_admissible k hk] unfold canonicalRawBranchCoefficient reflectedDyadicCoefficient push_cast simp only [div_eq_mul_inv,mul_inv_rev] norm_num ring theorem residual_equiv_coefficient_admissible {ι β:Type*} [Fintype ι] [Fintype β] (k:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hk:Admissible k) (P:ι→Ideal (_root_.OAI.ActualEisensteinCubic.O)) [∀i,(P i).IsMaximal] (hg:∀i,lambda∉P i) (R:β→Ideal (_root_.OAI.ActualEisensteinCubic.O)) [∀i,(R i).IsMaximal] (hR:∀i,lambda∉R i) (E:PrimeIndex k⊕β≃ι) (hres:∀r,P (E (Sum.inl r))=r.val) (hnonres:∀r,P (E (Sum.inr r))=R r) (j:ι→ℕ) (jβ:β→ℕ) (hjres:∀r,j (E (Sum.inl r))=1) (hjnonres:∀r,j (E (Sum.inr r))=jβ r) (e:β→Fin 3) (ρ q:ℝ) (η:ℕ→Ideal (_root_.OAI.ActualEisensteinCubic.O)→Ideal (_root_.OAI.ActualEisensteinCubic.O)→ℂ) (σ:ℕ→ℂ) (m:ℕ) (n b:Ideal (_root_.OAI.ActualEisensteinCubic.O)) : let A:=reflectionExtractedDivisor R jβ e 1 let B:=reflectionExtractedDivisor R jβ e 2 unextractedCuspCoefficient P hg j (residualLabelVia E e) ρ q η σ m (A*n) (B*b)= 4*canonicalRawBranchCoefficient R hR jβ e ρ q (fun l a c=>η l (A*a) (B*c)) (fun l=>σ l*residualArgumentPhase k 1 A B) k m n b := by let : ∀ i, Field ((_root_.OAI.ActualEisensteinCubic.O) ⧸ P i) := fun i => Ideal.Quotient.field (P i) let : ∀ i, Fintype ((_root_.OAI.ActualEisensteinCubic.O) ⧸ P i) := fun i => ActualEisensteinCubic.quotientFintype (P i) let : ∀ r : PrimeIndex k, r.val.IsMaximal := primeIndexMaximal k let : ∀ r : PrimeIndex k, Field ((_root_.OAI.ActualEisensteinCubic.O) ⧸ r.val) := fun r => Ideal.Quotient.field r.val let : ∀ r : PrimeIndex k, Fintype ((_root_.OAI.ActualEisensteinCubic.O) ⧸ r.val) := fun r => ActualEisensteinCubic.quotientFintype r.val dsimp only rw [unextractedCuspCoefficient,reflectedBranch_drop_residual_equiv E P hg j hjres] have hchar (r:PrimeIndex k) (z:(_root_.OAI.ActualEisensteinCubic.O)) : bracket (actualSextic (P (E (Sum.inl r))) (hg (E (Sum.inl r)))) 1 (Ideal.Quotient.mk _ z)= bracket (actualSextic r.val (admissiblePrimeGood k hk r)) 1 (Ideal.Quotient.mk _ z) := actual_bracket_ideal_congr _ _ _ _ (hres r) 1 z have hnbranch (a b:(_root_.OAI.ActualEisensteinCubic.O)): reflectedBranch (fun r=>P (E (Sum.inr r))) (fun r=>hg (E (Sum.inr r))) (fun r=>j (E (Sum.inr r))) e a b=reflectedBranch R hR jβ e a b := by unfold reflectedBranch apply Finset.prod_congr rfl intro r hr change reflectedLocalPiece (P (E (Sum.inr r))) _ (j (E (Sum.inr r))) (e r) a b=_ simp only [hnonres r,hjnonres r] simp_rw [hchar] rw [hnbranch] have ht:=residual_coefficient_eq_canonical_admissible k hk R hR jβ e ρ q (fun _=>1) η σ m n b simp only [one_mul] at ht convert ht using 1 ; ring end CompletedGauss namespace CubicEisenstein open ActualEisensteinCubic CompletedGauss CompletedDyadic CanonicalQuadraticSieve namespace FixedFourierGeometry variable {c:(_root_.OAI.ActualEisensteinCubic.O)} {h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c}} (G:FixedFourierGeometry c h) variable {ι:Type*} [Fintype ι] {p:ι→(_root_.OAI.ActualEisensteinCubic.O)} {N:(_root_.OAI.ActualEisensteinCubic.O)} theorem stratumBranchTerm_tsum_eq_rawValue_at_row (D:ControlledStratumArithmetic p N G.a0 G.c0 G.mode) [∀i,(Ideal.span {p i}).IsMaximal] (hp:∀i,p i≠0) (hg:∀i,lambda∉Ideal.span {p i}) (j:ι→ℕ) {I F Q:Ideal (_root_.OAI.ActualEisensteinCubic.O)} {levelBound K:ℝ} (d:ReflectedBranchData levelBound K I F Q) (hK:0r.val) (fun r=>completedLocalExponent I F r.val) d.label 1 let B:=reflectionExtractedDivisor (fun r:d.primes=>r.val) (fun r=>completedLocalExponent I F r.val) d.label 2 let hA:=reflectionExtractedDivisor_ne_zero (fun r:d.primes=>r.val) (fun _r=>NeZero.ne _) (fun r=>completedLocalExponent I F r.val) d.label 1 let hB:=reflectionExtractedDivisor_ne_zero (fun r:d.primes=>r.val) (fun _r=>NeZero.ne _) (fun r=>completedLocalExponent I F r.val) d.label 2 (∑'x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal, G.stratumBranchTerm D hp hg j u (residualLabelVia E d.label) W X (nonzeroDualDilation A B hA hB x))= 4*d.rawValue (fun m n b=>G.array (Ideal.Quotient.mk _ (-(D.matrix (fun _=>1) 1 1)*D.U)) u m (A*n) (B*b)) (fun m k'=>D.modelRowPhase G.shape hp hg j u m*residualArgumentPhase k'.val 1 A B) W X 1 completedRamifiedStep k := by let : ∀r:d.primes,r.val.IsMaximal:=d.maximal dsimp only let A:=reflectionExtractedDivisor (fun r:d.primes=>r.val) (fun r=>completedLocalExponent I F r.val) d.label 1 let B:=reflectionExtractedDivisor (fun r:d.primes=>r.val) (fun r=>completedLocalExponent I F r.val) d.label 2 let η:=G.array (Ideal.Quotient.mk _ (-(D.matrix (fun _=>1) 1 1)*D.U)) u let σ:=D.modelRowPhase G.shape hp hg j u have hfull:Ideal.span {∏i,p i}=k.val*∏r:d.primes,r.val := by rw [FiniteGaussPhase.span_finset_prod] exact active_product_admissible_equiv k.val (mem_idealRange.mp k.property).1.2.1 (fun i=>Ideal.span {p i}) (fun r:d.primes=>r.val) E hres hnonres have hk0:k.val≠0:=(mem_idealRange.mp k.property).1.1 unfold ReflectedBranchData.rawValue rw [←tsum_mul_left] apply tsum_congr intro x have hcoef:=residual_equiv_coefficient_admissible k.val (mem_idealRange.mp k.property).1 (fun i=>Ideal.span {p i}) hg (fun r:d.primes=>r.val) d.good E hres hnonres j (fun r=>completedLocalExponent I F r.val) hjres hjnonres d.label 1 completedRamifiedStep η σ x.1 x.2.1.val x.2.2.val have harg: (X/(G.levelScale*(Ideal.absNorm (Ideal.span {∏i,p i}):ℝ)^2))* (1*completedRamifiedStep^x.1)^3*(Ideal.absNorm (A*x.2.1.val):ℝ)* (Ideal.absNorm (B*x.2.2.val):ℝ)^3= ((completedBranchScale K (X/d.levelScale) I F Q (fun r:d.primes=>r.val) d.label)⁻¹* (completedResidualScale K I Q/(Ideal.absNorm k.val:ℝ))^2)* (1*completedRamifiedStep^x.1)^3*(Ideal.absNorm x.2.1.val:ℝ)* (Ideal.absNorm x.2.2.val:ℝ)^3 := by rw [hlevel,completedBranchScale_raw_argument K X G.levelScale (1*completedRamifiedStep^x.1) I F Q (fun r:d.primes=>r.val) d.label k.val x.2.1.val x.2.2.val hK G.levelScale_pos hk0] rw [hfull] simp only [map_mul,Nat.cast_mul,mul_pow,div_eq_mul_inv,mul_inv_rev] ring dsimp only [stratumBranchTerm,nonzeroDualDilation,rawDualKernelTerm] change unextractedCuspCoefficient (fun i=>Ideal.span {p i}) hg j (residualLabelVia E d.label) 1 completedRamifiedStep η σ x.1 (A*x.2.1.val) (B*x.2.2.val)*_=_ rw [hcoef,harg] exact mul_assoc _ _ _ end FixedFourierGeometry end CubicEisenstein namespace CompletedGauss.FreeReflection open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve CompletedDyadic theorem sixPhaseFixedCuspBranch_value_eq_rawValue (I F Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hI:I≠0) (hQ:Q≠0) (K levelBound levelScale:ℝ) (hlevel:0r.val) (fun r=>completedLocalExponent I F r.val) d.label 1 let B:=reflectionExtractedDivisor (fun r:d.primes=>r.val) (fun r=>completedLocalExponent I F r.val) d.label 2 d.value W X ρ q k= d.rawValue (fun m n b=>G.array v u m (A*n) (B*b)) rowPhase W X ρ q k := by exact sixPhaseFixedCuspBranch_value_eq_rawValue I F Q Q0 hI hQ K levelBound G.levelScale G.levelScale_pos hbound e G.shape.index u (G.staticPhase v u) (G.staticPhase_norm_le_one v u) rowPhase hrow W a b ha hsupp hW X ρ q hX hρ hq hK k hk end CubicEisenstein.FixedFourierGeometry open scoped BigOperators Classical namespace CompletedGauss.FreeReflection open ActualEisensteinCubic def supportActivePoolEquiv (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (e:pool I Q Q0 → Fin 6) : reflectionSixSupport e ≃ reflectionActivePool I Q Q0 e where toFun b:=⟨b.val.val,(mem_reflectionActivePool I Q Q0 e b.val).mpr (Finset.mem_filter.mp b.property).2⟩ invFun P:=⟨⟨P.val,reflectionActivePool_subset I Q Q0 e P.property⟩, Finset.mem_filter.mpr ⟨Finset.mem_univ _,(mem_reflectionActivePool I Q Q0 e _).mp P.property⟩⟩ left_inv _b:=rfl right_inv _P:=rfl end CompletedGauss.FreeReflection namespace CanonicalRowCompletion.ActualFiber open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein variable (q:ℕ) (hq:q≠0) (m:(_root_.OAI.ActualEisensteinCubic.O)) (hm:m≠0) (rows:Finset (Ideal (_root_.OAI.ActualEisensteinCubic.O))) (R F:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:(_root_.OAI.ActualEisensteinCubic.O)ˣ) (e:FreeReflection.pool R (maskIdeal q m F) (freeConductor q) → Fin 6) (J:RowIndex q m rows R F) noncomputable def activeModelPrimeEquiv : PrimeIndex (rowResidualPart J.val (maskIdeal q m F)) ⊕ FreeReflection.reflectionActivePool R (maskIdeal q m F) (freeConductor q) e ≃ activeSet q hq m hm rows R F hR hF hrows v e J := (Equiv.sumCongr (Equiv.refl _) (FreeReflection.supportActivePoolEquiv R (maskIdeal q m F) (freeConductor q) e).symm).trans (selectedActiveEquiv (splitIndex q hq m hm rows R F hR hF hrows v J) (reflectionSixSupport e)) lemma splitIndex_prime_val (P:PrimeIndex (rowResidualPart J.val (maskIdeal q m F)) ⊕ FreeReflection.pool R (maskIdeal q m F) (freeConductor q)) : (splitIndex q hq m hm rows R F hR hF hrows v J P).val.val= Sum.elim Subtype.val Subtype.val P := by cases P <;> rfl lemma splitIndex_local_exponent (P:PrimeIndex (rowResidualPart J.val (maskIdeal q m F)) ⊕ FreeReflection.pool R (maskIdeal q m F) (freeConductor q)) : (UniqueFactorizationMonoid.normalizedFactors (data q m hm rows R F hF hrows v J).movingIdeal).count (splitIndex q hq m hm rows R F hR hF hrows v J P).val.val%6= Sum.elim (fun _=>1) (fun b=>completedLocalExponent R F b.val) P := by unfold splitIndex apply GoodMaskRowData.primeFiberEquiv_exponent lemma activeModelPrimeEquiv_prime_val (P:PrimeIndex (rowResidualPart J.val (maskIdeal q m F)) ⊕ FreeReflection.reflectionActivePool R (maskIdeal q m F) (freeConductor q) e) : (activeModelPrimeEquiv q hq m hm rows R F hR hF hrows v e J P).val.val.val= Sum.elim Subtype.val Subtype.val P := by cases P <;> rfl lemma activeModelPrimeEquiv_span (P:PrimeIndex (rowResidualPart J.val (maskIdeal q m F)) ⊕ FreeReflection.reflectionActivePool R (maskIdeal q m F) (freeConductor q) e) : Ideal.span {(freePrimaryPrime (data q m hm rows R F hF hrows v J).movingIdeal (freeConductor q) (activeModelPrimeEquiv q hq m hm rows R F hR hF hrows v e J P).val)}= Sum.elim Subtype.val Subtype.val P := by rw [freePrimaryPrime_span _ _ (data q m hm rows R F hF hrows v J).movingSupported] exact activeModelPrimeEquiv_prime_val q hq m hm rows R F hR hF hrows v e J P lemma activeModelPrimeEquiv_exponent (P:PrimeIndex (rowResidualPart J.val (maskIdeal q m F)) ⊕ FreeReflection.reflectionActivePool R (maskIdeal q m F) (freeConductor q) e) : (UniqueFactorizationMonoid.normalizedFactors (data q m hm rows R F hF hrows v J).movingIdeal).count (activeModelPrimeEquiv q hq m hm rows R F hR hF hrows v e J P).val.val.val%6= Sum.elim (fun _=>1) (fun b=>completedLocalExponent R F b.val) P := by cases P with | inl P=>exact splitIndex_local_exponent q hq m hm rows R F hR hF hrows v J (Sum.inl P) | inr P=> exact splitIndex_local_exponent q hq m hm rows R F hR hF hrows v J (Sum.inr ⟨P.val,FreeReflection.reflectionActivePool_subset R (maskIdeal q m F) (freeConductor q) e P.property⟩) end CanonicalRowCompletion.ActualFiber namespace CubicEisenstein open ActualEisensteinCubic ConcreteTraceCRT CompletedGauss LocalReflectionBrackets noncomputable abbrev inactiveField (P:Ideal (_root_.OAI.ActualEisensteinCubic.O)) [P.IsMaximal] : Field ((_root_.OAI.ActualEisensteinCubic.O)⧸P) := Ideal.Quotient.field P noncomputable abbrev inactiveFintype (P:Ideal (_root_.OAI.ActualEisensteinCubic.O)) [P.IsMaximal] : Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸P) := Fintype.ofFinite _ lemma finiteAdditiveFourierCoeff_zero {R:Type*} [Field R] [Fintype R] (ψ:AddChar R ℂ) (χ:MulChar R ℂ) (j:ℕ) : finiteAdditiveFourierCoeff ψ (fun x=>(χ^j) x) 0=zeroFourierCoefficient χ j := by simp only [finiteAdditiveFourierCoeff,zeroFourierCoefficient,neg_zero,zero_mul, AddChar.map_zero_eq_one,mul_one,div_eq_mul_inv] ring lemma prime_zeroFourier_norm_formula (p:(_root_.OAI.ActualEisensteinCubic.O)) [(Ideal.span {p}).IsMaximal] (hp:p≠0) (hg:lambda∉Ideal.span {p}) (hodd:ringChar ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p})≠2) (j:ℕ) (hj:j<6) : letI : Field ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p}) := inactiveField (Ideal.span {p}) letI : Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p}) := inactiveFintype (Ideal.span {p}) finiteAdditiveFourierCoeff (quotientTrace p hp) (fun x=>(actualSextic (Ideal.span {p}) hg^j) x) 0= if j=0 then 1-(Ideal.absNorm (Ideal.span {p}):ℂ)⁻¹ else 0 := by letI : Field ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p}) := inactiveField (Ideal.span {p}) letI : Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {p}) := inactiveFintype (Ideal.span {p}) rw [finiteAdditiveFourierCoeff_zero] have he:=canonical_zeroFourierCoefficient (Ideal.span {p}) hg hodd j hj convert he using 1 exact congrArg (fun n:ℕ=>(if j=0 then 1-(n:ℂ)⁻¹ else 0)) (by rw [Ideal.absNorm_apply,Submodule.cardQuot_apply,Nat.card_eq_fintype_card]) end CubicEisenstein namespace CompletedGauss.FreeReflection open ActualEisensteinCubic CubicEisenstein LocalReflectionBrackets theorem inactivePoolMaximal (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (P:pool I Q Q0) : P.val.IsMaximal:= pool_maximal I Q Q0 P noncomputable abbrev inactivePoolField (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (P:pool I Q Q0) : Field ((_root_.OAI.ActualEisensteinCubic.O)⧸P.val):= by letI := inactivePoolMaximal I Q Q0 P exact Ideal.Quotient.field P.val noncomputable abbrev inactivePoolFintype (I Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (P:pool I Q Q0) : Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸P.val):= by letI := inactivePoolMaximal I Q Q0 P exact Fintype.ofFinite _ lemma reflectionInactiveStratumWeight_formula (I F Q Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (A:Finset (pool I Q Q0)) : reflectionInactiveStratumWeight I F Q Q0 A= ∏P∈(Finset.univ:Finset (pool I Q Q0))\A, if completedLocalExponent I F P.val=0 then 1-(Ideal.absNorm P.val:ℂ)⁻¹ else 0 := by unfold reflectionInactiveStratumWeight apply Finset.prod_congr (by ext P; simp only [Finset.mem_sdiff,Finset.mem_univ]) intro P hP letI := inactivePoolMaximal I Q Q0 P letI := inactivePoolField I Q Q0 P letI := inactivePoolFintype I Q Q0 P have he:=canonical_zeroFourierCoefficient P.val (pool_good I Q Q0 P) (pool_odd I Q Q0 P) (completedLocalExponent I F P.val) (Nat.mod_lt _ (by decide)) convert he using 1 exact congrArg (fun n:ℕ=>(if completedLocalExponent I F P.val=0 then 1-(n:ℂ)⁻¹ else 0)) (by rw [Ideal.absNorm_apply,Submodule.cardQuot_apply,Nat.card_eq_fintype_card]) end CompletedGauss.FreeReflection namespace CanonicalRowCompletion open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein namespace GoodMaskRowData variable {m f z:(_root_.OAI.ActualEisensteinCubic.O)} (D:GoodMaskRowData m f z) variable (R I F Q0:Ideal (_root_.OAI.ActualEisensteinCubic.O)) (hR:R≠0) (hI:I≠0) (hF:Squarefree F) (hm:m≠0) (hf:Ideal.span {f}=F) (hz:Ideal.span {z}=I) (hbad:∀P∈fixedBadPrimes,P∣Ideal.span {m}*F) (hcop:IsCoprime Q0 (rowResidualPart I (Ideal.span {m}*F))) (hA:rowPowerfulPart R=rowPowerfulPart I) (hT:rowMaskPart R (Ideal.span {m}*F)=rowMaskPart I (Ideal.span {m}*F)) include R I F Q0 hR hI hF hm hf hz hbad hcop hA hT theorem inactive_source_reindex (w:Finset (FreePrimeIndex D.movingIdeal Q0)→ℂ) : letI : ∀P:FreePrimeIndex D.movingIdeal Q0, (Ideal.span {freePrimaryPrime D.movingIdeal Q0 P}:Ideal (_root_.OAI.ActualEisensteinCubic.O)).IsMaximal:= freePrimaryPrime_maximal D.movingIdeal Q0 D.movingSupported let E:=D.primeFiberEquiv R I F Q0 hR hI hF hm hf hz hbad hcop hA hT (∑A:Finset (FreePrimeIndex D.movingIdeal Q0), primeInactiveFourierWeight (freePrimaryPrime D.movingIdeal Q0) (freePrimaryPrime_ne_zero D.movingIdeal Q0 D.movingSupported) (freePrimaryPrime_good D.movingIdeal Q0 D.movingSupported) (fun P=>(UniqueFactorizationMonoid.normalizedFactors D.movingIdeal).count P.val.val%6) A*w A)= ∑B:Finset (FreeReflection.pool R (Ideal.span {m}*F) Q0), FreeReflection.reflectionInactiveStratumWeight R F (Ideal.span {m}*F) Q0 B* w (residualActivePrimes E∪B.image (fun P=>E (Sum.inr P))) := by let : ∀P:FreePrimeIndex D.movingIdeal Q0, (Ideal.span {freePrimaryPrime D.movingIdeal Q0 P}:Ideal (_root_.OAI.ActualEisensteinCubic.O)).IsMaximal:= freePrimaryPrime_maximal D.movingIdeal Q0 D.movingSupported dsimp only let E:=D.primeFiberEquiv R I F Q0 hR hI hF hm hf hz hbad hcop hA hT let Z:FreePrimeIndex D.movingIdeal Q0→ℂ:=fun P=> if (UniqueFactorizationMonoid.normalizedFactors D.movingIdeal).count P.val.val%6=0 then 1-(Ideal.absNorm P.val.val:ℂ)⁻¹ else 0 have hzero (P:PrimeIndex (rowResidualPart I (Ideal.span {m}*F))) : Z (E (Sum.inl P))=0:=by dsimp only [Z] rw [D.primeFiberEquiv_exponent R I F Q0 hR hI hF hm hf hz hbad hcop hA hT (Sum.inl P)] norm_num have hnonres (P:FreeReflection.pool R (Ideal.span {m}*F) Q0) : Z (E (Sum.inr P))= if completedLocalExponent R F P.val=0 then 1-(Ideal.absNorm P.val:ℂ)⁻¹ else 0:=by dsimp only [Z] rw [D.primeFiberEquiv_exponent R I F Q0 hR hI hF hm hf hz hbad hcop hA hT (Sum.inr P), D.primeFiberEquiv_val R I F Q0 hR hI hF hm hf hz hbad hcop hA hT (Sum.inr P)] rfl have hw (A:Finset (FreePrimeIndex D.movingIdeal Q0)) : primeInactiveFourierWeight (freePrimaryPrime D.movingIdeal Q0) (freePrimaryPrime_ne_zero D.movingIdeal Q0 D.movingSupported) (freePrimaryPrime_good D.movingIdeal Q0 D.movingSupported) (fun P=>(UniqueFactorizationMonoid.normalizedFactors D.movingIdeal).count P.val.val%6) A= ∏P∈(Finset.univ:Finset (FreePrimeIndex D.movingIdeal Q0))\A,Z P:=by unfold primeInactiveFourierWeight apply Finset.prod_congr (by ext P; simp only [Finset.mem_sdiff,Finset.mem_univ]) intro P hP rw [prime_zeroFourier_norm_formula _ _ _ (freePrimaryPrime_odd D.movingIdeal Q0 D.movingSupported P) _ (Nat.mod_lt _ (by decide)),freePrimaryPrime_span D.movingIdeal Q0 D.movingSupported P] simp only [hw] have he:=inactive_weight_nonresidual_subsets E Z hzero w refine Eq.trans ?_ (Eq.trans he ?_) · apply Finset.sum_congr (by ext A; simp only [Finset.mem_univ]) intro A hA congr 1 apply Finset.prod_congr (by ext P; simp only [Finset.mem_sdiff,Finset.mem_univ]) intro P hP rfl apply Finset.sum_congr (by ext B; simp only [Finset.mem_univ]) intro B hB congr 1 · rw [FreeReflection.reflectionInactiveStratumWeight_formula] apply Finset.prod_congr (by ext P; simp only [Finset.mem_sdiff,Finset.mem_univ]) intro P hP exact hnonres P · apply congrArg w ext P simp only [E,residualActivePrimes,Finset.mem_union,Finset.mem_image,Finset.mem_univ,true_and] end GoodMaskRowData end CanonicalRowCompletion open scoped BigOperators Classical namespace CubicEisenstein open ActualEisensteinCubic noncomputable abbrev rayUnitsFintype : Fintype (_root_.OAI.ActualEisensteinCubic.O)ˣ := by letI : Finite (_root_.OAI.ActualEisensteinCubic.O)ˣ:=PrimaryIdealUnitReindex.finite_units exact Fintype.ofFinite _ theorem sum_fixedReflectionRay {M:Type*} [AddCommMonoid M] (c:(_root_.OAI.ActualEisensteinCubic.O)) (hc:c≠0) [Fintype ((_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c})] [∀h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c},Fintype (fixedFourierGeometry c hc h).PhaseResidue] (F:FixedReflectionRay c hc → M) : letI : Fintype (_root_.OAI.ActualEisensteinCubic.O)ˣ := rayUnitsFintype let : Fintype (FixedReflectionRay c hc) := fixedReflectionRay_fintype c hc (∑r:FixedReflectionRay c hc,F r)= ∑h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c},∑rho:(fixedFourierGeometry c hc h).PhaseResidue, ∑u:(_root_.OAI.ActualEisensteinCubic.O)ˣ,F ⟨h,rho,u⟩ := by letI : Fintype (_root_.OAI.ActualEisensteinCubic.O)ˣ := rayUnitsFintype let : Fintype (FixedReflectionRay c hc) := fixedReflectionRay_fintype c hc change (∑r:FixedReflectionRay c hc,F r)= ∑h:(_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c},∑rho:(fixedFourierGeometry c hc h).PhaseResidue, ∑u:(_root_.OAI.ActualEisensteinCubic.O)ˣ,F ⟨h,rho,u⟩ let e : FixedReflectionRay c hc ≃ (Σ h : (_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c}, (fixedFourierGeometry c hc h).PhaseResidue × (_root_.OAI.ActualEisensteinCubic.O)ˣ) := Equiv.refl _ calc _ = ∑ r : (Σ h : (_root_.OAI.ActualEisensteinCubic.O)⧸Ideal.span {c}, (fixedFourierGeometry c hc h).PhaseResidue × (_root_.OAI.ActualEisensteinCubic.O)ˣ), F (e.symm r) := Fintype.sum_equiv e _ _ (fun r => congrArg F (e.symm_apply_apply r).symm) _ = _ := by rw [Fintype.sum_sigma] apply Finset.sum_congr rfl intro h hh exact Fintype.sum_prod_type _ end CubicEisenstein end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.ReflectedFibers namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical namespace CanonicalRowCompletion.GoodMaskRowData open ActualEisensteinCubic CompletedGauss CubicEisenstein end CanonicalRowCompletion.GoodMaskRowData namespace CanonicalRowCompletion.ActualFiber open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein variable (q:ℕ) (hq:q≠0) (m:_root_.OAI.ActualEisensteinCubic.O) (hm:m≠0) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:_root_.OAI.ActualEisensteinCubic.Oˣ) [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q})] [∀h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}, Fintype (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).PhaseResidue] def rowAmplitude (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (e:FreeReflection.pool R (maskIdeal q m F) (freeConductor q) → Fin 6) (n:ℕ) (J:RowIndex q m rows R F) : ℂ := (data q m hm rows R F hF hrows v J).sourceRowScalar (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ne_zero q hq) (reflectionConductor_ideal q) h (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h) (activeSet q hq m hm rows R F hR hF hrows v e J) Ψ u n* residualArgumentPhase (rowResidualPart J.val (maskIdeal q m F)) 1 (columnDivisor q m R F e 1) (columnDivisor q m R F e 2) end CanonicalRowCompletion.ActualFiber namespace CompletedGauss open ActualEisensteinCubic theorem hasExactCompletedModels_of_representative_identity (rays:ℕ) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (K X ρ q levelBound:ℝ) (F Q:Ideal _root_.OAI.ActualEisensteinCubic.O) (W:ℝ→ℂ) (Ψ:Ideal _root_.OAI.ActualEisensteinCubic.O→_root_.OAI.ActualEisensteinCubic.O→*ℂ) (scale:ℂ) (model:∀I:Ideal _root_.OAI.ActualEisensteinCubic.O,I∈rows→ReflectedFiberData rays levelBound K I F Q) (hmodel:∀(I:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I∈rows),∀J∈representativeRowFiber rows I Q, completedT (Ψ J) W X=scale*(model I hI).idealValue W X ρ q (rowResidualPart J Q)) : HasExactCompletedModels rays rows K X ρ q levelBound F Q W Ψ scale := by intro A hA T hT hnonempty obtain ⟨I,hI⟩:=hnonempty obtain ⟨hIrows,hIA,hIT⟩:=Finset.mem_filter.mp hI refine ⟨I,hI,model I hIrows,?_⟩ intro J hJ apply hmodel I hIrows J simpa only [representativeRowFiber,hIA,hIT] using hJ end CompletedGauss open scoped BigOperators Classical ContDiff namespace CanonicalRowCompletion.ActualFiber open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein CubicJacobiGlobal variable (q:ℕ) (hq:q≠0) (m:_root_.OAI.ActualEisensteinCubic.O) (hm:m≠0) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:_root_.OAI.ActualEisensteinCubic.Oˣ) variable [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q})] noncomputable def sourcePrimeSet (B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q))) (J:RowIndex q m rows R F) : Finset (FreePrimeIndex (data q m hm rows R F hF hrows v J).movingIdeal (freeConductor q)) := completeActiveSet (splitIndex q hq m hm rows R F hR hF hrows v J) B noncomputable abbrev sourceStratum (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q))) (J:RowIndex q m rows R F) := (data q m hm rows R F hF hrows v J).activeStratum (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h) (sourcePrimeSet q hq m hm rows R F hR hF hrows v B J) noncomputable def sourceStratumValue (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q))) (J:RowIndex q m rows R F) (W:ℝ→ℂ) (X:ℝ) : ℂ := by let lengthScale:Ideal _root_.OAI.ActualEisensteinCubic.O:=(data q m hm rows R F hF hrows v J).movingIdeal have hL:Supported lengthScale:=(data q m hm rows R F hF hrows v J).movingSupported let A:=sourcePrimeSet q hq m hm rows R F hR hF hrows v B J let G:=fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h letI : ∀P:sourcePrimeSet q hq m hm rows R F hR hF hrows v B J, (Ideal.span {(freePrimaryPrime (data q m hm rows R F hF hrows v J).movingIdeal (CanonicalCoefficientClass.fixedBaseConductor q*Ideal.span {(72:_root_.OAI.ActualEisensteinCubic.O)}) P.val)}:Ideal _root_.OAI.ActualEisensteinCubic.O).IsMaximal:= fun P=>freePrimaryPrime_maximal _ _ (data q m hm rows R F hF hrows v J).movingSupported P.val exact @ControlledStratumArithmetic.smoothedValue A (Finset.Subtype.fintype A) _ _ _ _ _ (sourceStratum q hq m hm rows R F hR hF hrows v h B J) _ (mul_dvd_mul_left 9 G.denominator_dvd) (primary_finset_product Finset.univ (fun P:A=>freePrimaryPrime lengthScale (freeConductor q) P.val) (fun P _=>freePrimaryPrime_primary lengthScale (freeConductor q) hL P.val)) G.primary G.shape (fun P=>freePrimaryPrime_ne_zero lengthScale (freeConductor q) hL P.val) G.denominator_ne_zero (fun P=>freePrimaryPrime_good lengthScale (freeConductor q) hL P.val) (fun P=>(UniqueFactorizationMonoid.normalizedFactors lengthScale).count P.val.val.val%6) W X private lemma finset_union_image_decidableEq_eq {α β : Type*} (d₁ d₂ : DecidableEq β) (t : Finset β) (f : α → β) (s : Finset α) : @Union.union (Finset β) (@Finset.instUnion β d₁) t (@Finset.image α β d₁ f s) = @Union.union (Finset β) (@Finset.instUnion β d₂) t (@Finset.image α β d₂ f s) := by cases Subsingleton.elim d₁ d₂ rfl theorem completedT_eq_nonresidual_source (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (hΨ:CanonicalCoefficientClass.FactorsModulo (CanonicalCoefficientClass.fixedBaseConductor q) Ψ) (hΨnorm:∀n,‖Ψ n‖≤1) (J:RowIndex q m rows R F) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0freePrimaryPrime_maximal D.movingIdeal _ D.movingSupported P.val have hJ:J.val≠0:=hrows J.val (Finset.mem_filter.mp J.property).1 have hz:Ideal.span {v.val*ConcretePrimeRowBridge.idealGenerator J.val}=J.val:=by rw [Ideal.span_singleton_mul_left_unit v.isUnit,ConcretePrimeRowBridge.span_idealGenerator] have parts:=representativeFiber_parts rows R (maskIdeal q m F) J have hsplit:splitIndex q hq m hm rows R F hR hF hrows v J= D.primeFiberEquiv R J.val F (freeConductor q) hR hJ hF (maskElement_ne_zero q m hm) (ConcretePrimeRowBridge.span_idealGenerator F) hz (mask_bad q m F) (residual_coprime_free_base q hq m F J.val) parts.1.symm parts.2.symm := by apply Equiv.ext intro x apply Subtype.ext apply Subtype.ext cases x <;> rfl have hml:lambda∣maskElement q m:=by exact ((reflectionExcludedGenerator_bad q).1).trans (dvd_mul_left _ m) have hm2:(2:_root_.OAI.ActualEisensteinCubic.O)∣maskElement q m:=by exact ((reflectionExcludedGenerator_bad q).2).trans (dvd_mul_left _ m) rw [D.completedT_eq_actualControlledSource (CanonicalCoefficientClass.fixedBaseConductor q) (CanonicalCoefficientClass.fixedBaseConductor_ne_zero q hq) (reflectionConductor q) (reflectionConductor_ne_zero q hq) (reflectionConductor_ideal q) (fun h=>fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h) Ψ hΨ hΨnorm hml hm2 W lo hi hlo hsupp hW X hX] unfold actualControlledSource apply congrArg (fun z:ℂ=>thetaDerivativeScalar⁻¹*z) apply Finset.sum_congr rfl intro h hh apply congrArg (fun z:ℂ=>fixedThetaRowCoeff (reflectionConductor q) (reflectionConductor_ne_zero q hq) (D.fixedFactor Ψ (CanonicalCoefficientClass.fixedBaseConductor q)) h*z) let weight : Finset (FreePrimeIndex D.movingIdeal (freeConductor q)) → ℂ := fun A => @ControlledStratumArithmetic.smoothedValue A (Finset.Subtype.fintype A) _ _ _ _ _ (D.activeStratum (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h) A) _ (mul_dvd_mul_left 9 (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).denominator_dvd) (primary_finset_product Finset.univ (fun P:A=>freePrimaryPrime D.movingIdeal (freeConductor q) P.val) (fun P _=>freePrimaryPrime_primary D.movingIdeal (freeConductor q) D.movingSupported P.val)) (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).primary (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).shape (fun P=>freePrimaryPrime_ne_zero D.movingIdeal (freeConductor q) D.movingSupported P.val) (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).denominator_ne_zero (fun P=>freePrimaryPrime_good D.movingIdeal (freeConductor q) D.movingSupported P.val) (fun P=>(UniqueFactorizationMonoid.normalizedFactors D.movingIdeal).count P.val.val.val%6) W X convert D.inactive_source_reindex R J.val F (freeConductor q) hR hJ hF (maskElement_ne_zero q m hm) (ConcretePrimeRowBridge.span_idealGenerator F) hz (mask_bad q m F) (residual_coprime_free_base q hq m F J.val) parts.1.symm parts.2.symm weight using 1 · apply Finset.sum_congr (by ext A; exact iff_of_true (Finset.mem_univ A) (Finset.mem_univ A)) intro A hA rfl · apply Finset.sum_congr (by ext B; exact iff_of_true (Finset.mem_univ B) (Finset.mem_univ B)) intro B hB congr 1 calc sourceStratumValue q hq m hm rows R F hR hF hrows v h B J W X= weight (sourcePrimeSet q hq m hm rows R F hR hF hrows v B J):=by rfl _=_:=by apply congrArg weight rw [sourcePrimeSet, completeActiveSet, hsplit] exact finset_union_image_decidableEq_eq _ _ _ _ _ end CanonicalRowCompletion.ActualFiber open scoped Classical BigOperators ContDiff namespace CompletedGauss.FreeReflection open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve lemma fixedRayFiber_branch (c:_root_.OAI.ActualEisensteinCubic.O) (hc:c≠0) (I F Q Q0:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I≠0) (hQ:Q≠0) (K:ℝ) (rayWeight:FixedBranchIndex c hc I Q Q0→ℂ) (hray:∀x,‖rayWeight x‖≤1) (rowPhase:FixedBranchIndex c hc I Q Q0→ℕ→idealRange (completedResidualScale K I Q)→ℂ) (hrow:∀x m k,‖rowPhase x m k‖≤1) (r:FixedReflectionRay c hc) (e:pool I Q Q0→Fin 6) : let G:=fixedFourierGeometry c hc r.1 (fixedRayFiber c hc I F Q Q0 hI hQ K rayWeight hray rowPhase hrow).branch (fixedReflectionRayEquiv c hc r,e)= sixPhaseFixedCuspBranch I F Q Q0 hI hQ K (fixedCuspLevelBound c) G.levelScale G.levelScale_pos (G.levelScale_le hc) e G.shape.index r.2.2 (G.staticPhase r.2.1 r.2.2) (G.staticPhase_norm_le_one r.2.1 r.2.2) (rowPhase (r,e)) (hrow (r,e)) := by let f : FixedReflectionRay c hc → ReflectedBranchData (fixedCuspLevelBound c) K I F Q := fun t => let G:=fixedFourierGeometry c hc t.1 sixPhaseFixedCuspBranch I F Q Q0 hI hQ K (fixedCuspLevelBound c) G.levelScale G.levelScale_pos (G.levelScale_le hc) e G.shape.index t.2.2 (G.staticPhase t.2.1 t.2.2) (G.staticPhase_norm_le_one t.2.1 t.2.2) (rowPhase (t,e)) (hrow (t,e)) change f ((fixedReflectionRayEquiv c hc).symm ((fixedReflectionRayEquiv c hc) r))=f r exact congrArg f ((fixedReflectionRayEquiv c hc).symm_apply_apply r) end CompletedGauss.FreeReflection open scoped BigOperators Classical ContDiff namespace CanonicalRowCompletion.ActualFiber open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein variable (q:ℕ) (hq:q≠0) (m:_root_.OAI.ActualEisensteinCubic.O) (hm:m≠0) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:_root_.OAI.ActualEisensteinCubic.Oˣ) variable [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q})] omit [Fintype (_root_.OAI.ActualEisensteinCubic.O ⧸ span {reflectionConductor q})] in lemma columnDivisor_ne_zero (e:FreeReflection.pool R (maskIdeal q m F) (freeConductor q) → Fin 6) (side:Fin 3) : columnDivisor q m R F e side≠0 := by let : ∀P:FreeReflection.reflectionActivePool R (maskIdeal q m F) (freeConductor q) e, P.val.IsMaximal:=fun P=>FreeReflection.pool_maximal R (maskIdeal q m F) (freeConductor q) ⟨P.val,FreeReflection.reflectionActivePool_subset R (maskIdeal q m F) (freeConductor q) e P.property⟩ exact reflectionExtractedDivisor_ne_zero (fun P:FreeReflection.reflectionActivePool R (maskIdeal q m F) (freeConductor q) e=>P.val) (fun P=>NeZero.ne P.val) _ _ _ theorem reflectedFiber_branch_exact (K:ℝ) (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (hΨ:∀n,‖Ψ n‖≤1) (hbound:∀I∈rows,(Ideal.absNorm I:ℝ)≤K) (J:RowIndex q m rows R F) (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (rho:(fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).PhaseResidue) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (e:FreeReflection.pool R (maskIdeal q m F) (freeConductor q) → Fin 6) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0freePrimaryPrime_maximal _ _ D.movingSupported P.val let hp:=fun P:A=>freePrimaryPrime_ne_zero _ _ D.movingSupported P.val let hg:=fun P:A=>freePrimaryPrime_good _ _ D.movingSupported P.val let j:=fun P:A=>(UniqueFactorizationMonoid.normalizedFactors D.movingIdeal).count P.val.val.val%6 let ray:FixedReflectionRay (reflectionConductor q) (reflectionConductor_ne_zero q hq):=⟨h,rho,u⟩ let d:=(reflectedFiber q hq m hm rows R F hR hF hrows v K Ψ hΨ).branch (fixedReflectionRayEquiv (reflectionConductor q) (reflectionConductor_ne_zero q hq) ray,e) let k:=fiberResidualIndex rows R (maskIdeal q m F) K (mask_bad q m F) (fun I hI=>⟨hrows I hI,hbound I hI⟩) J let dN:=columnDivisor q m R F e 1 let dB:=columnDivisor q m R F e 2 let hdN:=columnDivisor_ne_zero q m R F e 1 let hdB:=columnDivisor_ne_zero q m R F e 2 4*d.value W X 1 completedRamifiedStep k= if rho=D.sourceRowResidue (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h G A then fixedThetaRowCoeff (reflectionConductor q) (reflectionConductor_ne_zero q hq) (D.fixedFactor Ψ (CanonicalCoefficientClass.fixedBaseConductor q)) h* G.shape.stratumShapeFactor (G.c0*∏P:A,freePrimaryPrime D.movingIdeal (freeConductor q) P.val)* ∑'x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal, @FixedFourierGeometry.stratumBranchTerm _ _ G A (Finset.Subtype.fintype A) _ _ S _ hp hg j u (residualLabelVia E (FreeReflection.reflectionActiveLabel R (maskIdeal q m F) (freeConductor q) e)) W X (nonzeroDualDilation dN dB hdN hdB x) else 0 := by let D:=data q m hm rows R F hF hrows v J let A:=activeSet q hq m hm rows R F hR hF hrows v e J let G:=fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h let S:=D.activeStratum (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h G A let E:=activeModelPrimeEquiv q hq m hm rows R F hR hF hrows v e J let : ∀P:A,(Ideal.span {freePrimaryPrime D.movingIdeal (CanonicalCoefficientClass.fixedBaseConductor q*Ideal.span {(72:_root_.OAI.ActualEisensteinCubic.O)}) P.val}:Ideal _root_.OAI.ActualEisensteinCubic.O).IsMaximal:= fun P=>freePrimaryPrime_maximal _ _ D.movingSupported P.val let hp:=fun P:A=>freePrimaryPrime_ne_zero _ _ D.movingSupported P.val let hg:=fun P:A=>freePrimaryPrime_good _ _ D.movingSupported P.val let j:=fun P:A=>(UniqueFactorizationMonoid.normalizedFactors D.movingIdeal).count P.val.val.val%6 let ray:FixedReflectionRay (reflectionConductor q) (reflectionConductor_ne_zero q hq):=⟨h,rho,u⟩ let k:=fiberResidualIndex rows R (maskIdeal q m F) K (mask_bad q m F) (fun I hI=>⟨hrows I hI,hbound I hI⟩) J let scalar:(FreeReflection.FixedBranchIndex (reflectionConductor q) (reflectionConductor_ne_zero q hq) R (maskIdeal q m F) (freeConductor q)×ℕ) → RowIndex q m rows R F → ℂ:=fun a J=>rowScalar q hq m hm rows R F hR hF hrows v Ψ a.1 a.2 J have hscalar:∀a J,‖scalar a J‖≤1:=fun a J=>rowScalar_norm q hq m hm rows R F hR hF hrows v Ψ hΨ a.1 a.2 J let σ:ℕ→idealRange (completedResidualScale K R (maskIdeal q m F))→ℂ:= fun n=>extendFiberRowScalar rows R (maskIdeal q m F) K scalar ((ray,e),n) have hσ:∀n k,‖σ n k‖≤1:=fun n=>extendFiberRowScalar_norm_le_one rows R (maskIdeal q m F) K scalar hscalar ((ray,e),n) let d:=FreeReflection.sixPhaseFixedCuspBranch R F (maskIdeal q m F) (freeConductor q) hR (maskIdeal_ne_zero q m hm F hF.ne_zero) K (fixedCuspLevelBound (reflectionConductor q)) G.levelScale G.levelScale_pos (G.levelScale_le (reflectionConductor_ne_zero q hq)) e G.shape.index u (G.staticPhase rho u) (G.staticPhase_norm_le_one rho u) σ hσ have hb:=FreeReflection.fixedRayFiber_branch (reflectionConductor q) (reflectionConductor_ne_zero q hq) R F (maskIdeal q m F) (freeConductor q) hR (maskIdeal_ne_zero q m hm F hF.ne_zero) K (fun _=>1) (by intro;simp) (fun x n=>extendFiberRowScalar rows R (maskIdeal q m F) K scalar (x,n)) (fun x n=>extendFiberRowScalar_norm_le_one rows R (maskIdeal q m F) K scalar hscalar (x,n)) ray e change (reflectedFiber q hq m hm rows R F hR hF hrows v K Ψ hΨ).branch (fixedReflectionRayEquiv (reflectionConductor q) (reflectionConductor_ne_zero q hq) ray,e)=d at hb dsimp only rw [hb] let dN:=columnDivisor q m R F e 1 let dB:=columnDivisor q m R F e 2 let η:=fun n I J=>G.array rho u n (dN*I) (dB*J) let τ:=fun n (l:idealRange (completedResidualScale K R (maskIdeal q m F)))=> @ControlledStratumArithmetic.modelRowPhase A (Finset.Subtype.fintype A) _ _ _ _ _ S _ G.shape hp hg j u n*residualArgumentPhase l.val 1 dN dB let weight:=fixedThetaRowCoeff (reflectionConductor q) (reflectionConductor_ne_zero q hq) (D.fixedFactor Ψ (CanonicalCoefficientClass.fixedBaseConductor q)) h* G.shape.stratumShapeFactor (G.c0*∏P:A,freePrimaryPrime D.movingIdeal (freeConductor q) P.val) have hraw:d.value W X 1 completedRamifiedStep k=d.rawValue η σ W X 1 completedRamifiedStep k:=by exact G.sixPhaseFixedCuspBranch_value_eq_geometric_rawValue R F (maskIdeal q m F) (freeConductor q) hR (maskIdeal_ne_zero q m hm F hF.ne_zero) K (fixedCuspLevelBound (reflectionConductor q)) (G.levelScale_le (reflectionConductor_ne_zero q hq)) e rho u σ hσ W lo hi hlo hsupp hW X 1 completedRamifiedStep hX (by norm_num) completedRamifiedStep_gt_one hK k hk rw [hraw] have hσrow (n:ℕ):σ n k=rowScalar q hq m hm rows R F hR hF hrows v Ψ (ray,e) n J:= extendFiberRowScalar_at_original rows R (maskIdeal q m F) K (mask_bad q m F) (fun I hI=>⟨hrows I hI,hbound I hI⟩) scalar ((ray,e),n) J by_cases hphase:rho=D.sourceRowResidue (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h G A · rw [if_pos hphase] have hσmatch (n:ℕ):σ n k=weight*τ n k := by rw [hσrow] change (if rho=D.sourceRowResidue (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h G A then D.sourceRowScalar (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ne_zero q hq) (reflectionConductor_ideal q) h G A Ψ u n* residualArgumentPhase k.val 1 dN dB else 0)=_ rw [if_pos hphase] dsimp only [GoodMaskRowData.sourceRowScalar,weight,τ] change (weight*@ControlledStratumArithmetic.modelRowPhase A (Finset.Subtype.fintype A) _ _ _ _ _ S _ G.shape hp hg j u n)*residualArgumentPhase k.val 1 dN dB= weight*(@ControlledStratumArithmetic.modelRowPhase A (Finset.Subtype.fintype A) _ _ _ _ _ S _ G.shape hp hg j u n*residualArgumentPhase k.val 1 dN dB) exact mul_assoc _ _ _ rw [d.rawValue_congr_phase_at η σ (fun n l=>weight*τ n l) W X 1 completedRamifiedStep k hσmatch, d.rawValue_mul_phase_at η τ W X 1 completedRamifiedStep k (fun _=>weight)] have hterm:=@FixedFourierGeometry.stratumBranchTerm_tsum_eq_rawValue_at_row _ _ G A (Finset.Subtype.fintype A) _ _ S _ hp hg j _ _ _ _ _ d hK k E (fun P=>activeModelPrimeEquiv_span q hq m hm rows R F hR hF hrows v e J (Sum.inl P)) (fun P=>activeModelPrimeEquiv_span q hq m hm rows R F hR hF hrows v e J (Sum.inr P)) (fun P=>activeModelPrimeEquiv_exponent q hq m hm rows R F hR hF hrows v e J (Sum.inl P)) (fun P=>activeModelPrimeEquiv_exponent q hq m hm rows R F hR hF hrows v e J (Sum.inr P)) rfl u W X have harr:η=fun n I J=>G.array (Ideal.Quotient.mk _ (-(@ControlledStratumArithmetic.matrix A (Finset.Subtype.fintype A) _ _ _ _ _ S (fun _=>1) 1 1)*(@ControlledStratumArithmetic.U A (Finset.Subtype.fintype A) _ _ _ _ _ S))) u n (dN*I) (dB*J):=by dsimp only [η] rw [hphase] rfl rw [harr] calc _=weight*(4*d.rawValue (fun n I J=>G.array (Ideal.Quotient.mk _ (-(@ControlledStratumArithmetic.matrix A (Finset.Subtype.fintype A) _ _ _ _ _ S (fun _=>1) 1 1)*(@ControlledStratumArithmetic.U A (Finset.Subtype.fintype A) _ _ _ _ _ S))) u n (dN*I) (dB*J)) τ W X 1 completedRamifiedStep k):=by ring _=_:=congrArg (fun z:ℂ=>weight*z) hterm.symm · rw [if_neg hphase] have hσzero (n:ℕ):σ n k=0 := by rw [hσrow] change (if rho=D.sourceRowResidue (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h G A then _ else 0)=0 rw [if_neg hphase] rw [d.rawValue_congr_phase_at η σ (fun _ _=>0) W X 1 completedRamifiedStep k hσzero, d.rawValue_zero_phase η W X 1 completedRamifiedStep k,mul_zero] end CanonicalRowCompletion.ActualFiber open scoped Classical namespace CanonicalRowCompletion open ActualEisensteinCubic CompletedGauss CubicEisenstein CanonicalCoefficientClass theorem dirichletTarget_of_reflection_shells (hmodels:∀(q₀:ℕ) [NeZero q₀] (χ:DirichletCharacter ℂ q₀), ∃(rays:ℕ) (scale:ℂ), HasFixedShellModels (reflectionExcludedPrimes q₀) (initialBase χ) rays scale 1 completedRamifiedStep (fixedCuspLevelBound (reflectionConductor q₀))) : ShortDraft.DirichletTarget := by apply dirichletTarget_of_theta_models intro q₀ hq₀ χ obtain ⟨rays,scale,hm⟩:=hmodels q₀ χ refine ⟨reflectionExcludedPrimes q₀,reflectionExcludedPrimes_bad q₀, reflectionExcludedPrimes_prime q₀,1,completedRamifiedStep, fixedCuspLevelBound (reflectionConductor q₀),by norm_num, completedRamifiedStep_gt_one,reflectionLevelBound_ge_one q₀ (NeZero.ne q₀),?_⟩ exact hasCanonicalThetaModels_of_fixed_shell_models (reflectionExcludedPrimes q₀) (initialBase χ) rays scale 1 completedRamifiedStep (fixedCuspLevelBound (reflectionConductor q₀)) hm end CanonicalRowCompletion namespace ShortDraft theorem zeta_nonvanishing_of_dirichletTarget (h:DirichletTarget) (s:ℂ) (hs:(23/24:ℝ)b.val.val) (fun b=>completedLocalExponent R F b.val.val) l side omit [Fintype (_root_.OAI.ActualEisensteinCubic.O ⧸ span {reflectionConductor q})] in lemma sourceDivisor_ne_zero (B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q))) (l:B→Fin 3) (side:Fin 3) : sourceDivisor q m R F B l side≠0 := by have hn (b:B):b.val.val≠0:=by let : b.val.val.IsMaximal:=FreeReflection.pool_maximal R (maskIdeal q m F) (freeConductor q) b.val exact NeZero.ne _ exact reflectionExtractedDivisor_ne_zero _ hn (fun b=>completedLocalExponent R F b.val.val) l side noncomputable def sourceCompressedTerm (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q))) (J:RowIndex q m rows R F) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (l:B→Fin 3) (W:ℝ→ℂ) (X:ℝ) : ℂ := by let lengthScale:Ideal _root_.OAI.ActualEisensteinCubic.O:=(data q m hm rows R F hF hrows v J).movingIdeal have hL:Supported lengthScale:=(data q m hm rows R F hF hrows v J).movingSupported let A:=sourcePrimeSet q hq m hm rows R F hR hF hrows v B J let G:=fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h let E:=selectedActiveEquiv (splitIndex q hq m hm rows R F hR hF hrows v J) B letI : ∀P:sourcePrimeSet q hq m hm rows R F hR hF hrows v B J, (Ideal.span {(freePrimaryPrime (data q m hm rows R F hF hrows v J).movingIdeal (CanonicalCoefficientClass.fixedBaseConductor q*Ideal.span {(72:_root_.OAI.ActualEisensteinCubic.O)}) P.val)}:Ideal _root_.OAI.ActualEisensteinCubic.O).IsMaximal:= fun P=>freePrimaryPrime_maximal _ _ (data q m hm rows R F hF hrows v J).movingSupported P.val exact ∑'x:ℕ×NonzeroDualIdeal×NonzeroDualIdeal, @FixedFourierGeometry.stratumBranchTerm _ _ G A (Finset.Subtype.fintype A) _ _ (sourceStratum q hq m hm rows R F hR hF hrows v h B J) _ (fun P:A=>freePrimaryPrime_ne_zero lengthScale (freeConductor q) hL P.val) (fun P:A=>freePrimaryPrime_good lengthScale (freeConductor q) hL P.val) (fun P:A=>(UniqueFactorizationMonoid.normalizedFactors lengthScale).count P.val.val.val%6) u (residualLabelVia E l) W X (nonzeroDualDilation (sourceDivisor q m R F B l 1) (sourceDivisor q m R F B l 2) (sourceDivisor_ne_zero q m R F B l 1) (sourceDivisor_ne_zero q m R F B l 2) x) end CanonicalRowCompletion.ActualFiber end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.BranchDecoding namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical ContDiff namespace CanonicalRowCompletion section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CanonicalCoefficientClass CubicEisenstein lemma initialOrbit_reflection_inputs {q:ℕ} (χ:DirichletCharacter ℂ q) (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (hΨ:IsBaseRayTwist (initialBase χ) Ψ) : FactorsModulo (fixedBaseConductor q) Ψ ∧ (∀n:_root_.OAI.ActualEisensteinCubic.O,‖Ψ n‖≤1) := ⟨initialOrbit_factorsModulo χ Ψ hΨ,fun n=>hΨ.norm_le (initialBase_norm χ) n⟩ lemma canonicalLabel_squarefree {X:ℝ} (f:idealRange X) : Squarefree f.val := (mem_idealRange.mp f.property).1.2.1 lemma unitRowFamily_actual {X:ℝ} (f:idealRange X) (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (q:ℕ) (m:_root_.OAI.ActualEisensteinCubic.O) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (I:Ideal _root_.OAI.ActualEisensteinCubic.O) : CompletedUnitRows.unitRowFamily Ψ (m*excludedGenerator (reflectionExcludedPrimes q)) u f I= rowTwist Ψ (ActualFiber.maskElement q m) (ConcretePrimeRowBridge.idealGenerator f.val) (u.val*ConcretePrimeRowBridge.idealGenerator I) := rfl theorem fixedShellModels_of_actual_fiber_identity (q:ℕ) (hq:q≠0) (χ:DirichletCharacter ℂ q) (scale:ℂ) [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q})] (hidentity: ∀(Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ),FactorsModulo (fixedBaseConductor q) Ψ→ ∀hΨnorm:(∀n:_root_.OAI.ActualEisensteinCubic.O,‖Ψ n‖≤1),∀(m:_root_.OAI.ActualEisensteinCubic.O)(hm:m≠0), ∀(F:Ideal _root_.OAI.ActualEisensteinCubic.O)(hF:Squarefree F)(u:_root_.OAI.ActualEisensteinCubic.Oˣ),∀(W:ℝ→ℂ)(a b:ℝ), 0(hrows I hI).1) u K Ψ hΨnorm).idealValue W X 1 completedRamifiedStep (rowResidualPart J.val (ActualFiber.maskIdeal q m F))) : HasFixedShellModels (reflectionExcludedPrimes q) (initialBase χ) (fixedReflectionRayCount (reflectionConductor q) (reflectionConductor_ne_zero q hq)) scale 1 completedRamifiedStep (fixedCuspLevelBound (reflectionConductor q)) := by intro Ψ hΨ m hm Xlabel f u W a b ha hs hW K X hK hX rows hrows obtain ⟨hperiod,hnorm⟩:=initialOrbit_reflection_inputs χ Ψ hΨ let models:=fun (R:Ideal _root_.OAI.ActualEisensteinCubic.O) (hR:R∈rows)=> ActualFiber.reflectedFiber q hq m hm rows R f.val (hrows R hR).1 (canonicalLabel_squarefree f) (fun I hI=>(hrows I hI).1) u K Ψ hnorm apply hasExactCompletedModels_of_representative_identity (fixedReflectionRayCount (reflectionConductor q) (reflectionConductor_ne_zero q hq)) rows K X 1 completedRamifiedStep (fixedCuspLevelBound (reflectionConductor q)) f.val (ActualFiber.maskIdeal q m f.val) W (CompletedUnitRows.unitRowFamily Ψ (m*excludedGenerator (reflectionExcludedPrimes q)) u f) scale models intro R hR J hJ rw [unitRowFamily_actual] exact hidentity Ψ hperiod hnorm m hm f.val (canonicalLabel_squarefree f) u W a b ha hs hW K X hK hX rows hrows R hR ⟨J,hJ⟩ end theorem finite_selected_branch_collection {H U B:Type*} {R:H→Type*} {E:B→Type*} [Fintype H] [Fintype U] [Fintype B] [∀h,Fintype (R h)] [∀b,Fintype (E b)] (f:(h:H)→R h→U→(b:B)→E b→ℂ) (g:H→U→(b:B)→E b→ℂ) (chosen:(h:H)→B→R h) (α:H→ℂ) (shape:H→B→ℂ) (w:B→ℂ) (hbranch:∀h r u b e,4*f h r u b e= if r=chosen h b then α h*shape h b*g h u b e else 0) : 4*(∑h,∑r:R h,∑u,∑b,w b*∑e:E b,f h r u b e)= ∑h,α h*∑b,w b*shape h b*∑u,∑e:E b,g h u b e := by have hpoint (h:H) (b:B) : 4*(∑r:R h,∑u,∑e:E b,f h r u b e)= α h*shape h b*(∑u,∑e:E b,g h u b e) := by simp_rw [Finset.mul_sum,hbranch] calc _=∑r:R h,if r=chosen h b then α h*shape h b*(∑u,∑e:E b,g h u b e) else 0 := by apply Finset.sum_congr rfl intro r hr by_cases he:r=chosen h b · simp only [he,ite_true,Finset.mul_sum] · simp only [he,ite_false,Finset.sum_const_zero] _=_:=by simp [Finset.mul_sum] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro h hh have hswap : (∑r:R h,∑u,∑b,w b*∑e:E b,f h r u b e)= ∑b,w b*(∑r:R h,∑u,∑e:E b,f h r u b e) := by calc _=∑r:R h,∑b,∑u,w b*∑e:E b,f h r u b e := by apply Finset.sum_congr rfl intro r hr exact Finset.sum_comm _=∑b,∑r:R h,∑u,w b*∑e:E b,f h r u b e := Finset.sum_comm _=_:=by simp_rw [Finset.mul_sum] rw [hswap,Finset.mul_sum,Finset.mul_sum] apply Finset.sum_congr rfl intro b hb calc _=w b*(4*(∑r:R h,∑u,∑e:E b,f h r u b e)) := by ring _=w b*(α h*shape h b*(∑u,∑e:E b,g h u b e)) := by rw [hpoint] _=_:=by ring end CanonicalRowCompletion open scoped BigOperators Classical ContDiff namespace CompletedGauss.FreeReflection open ActualEisensteinCubic CubicEisenstein CanonicalQuadraticSieve theorem fixedRayFiberFromRows_value (c:_root_.OAI.ActualEisensteinCubic.O) (hc:c≠0) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (I F Q Q0:Ideal _root_.OAI.ActualEisensteinCubic.O) (hI:I≠0) (hQ:Q≠0) (K:ℝ) (scalar:(FixedBranchIndex c hc I Q Q0×ℕ)→ representativeRowFiber rows I Q→ℂ) (hscalar:∀a J,‖scalar a J‖≤1) (W:ℝ→ℂ) (X ρ q:ℝ) (k:idealRange (completedResidualScale K I Q)) : let : Fintype (FixedReflectionRay c hc) := fixedReflectionRay_fintype c hc let d:=fixedRayFiberFromRows c hc rows I F Q Q0 hI hQ K scalar hscalar d.value W X ρ q k= ∑r:FixedReflectionRay c hc,∑B:Finset (pool I Q Q0), reflectionInactiveStratumWeight I F Q Q0 B* ∑l:B→Fin 3,(d.branch (fixedReflectionRayEquiv c hc r,encodeReflectionSix ⟨B,l⟩)).value W X ρ q k := by let : Fintype (FixedReflectionRay c hc) := fixedReflectionRay_fintype c hc dsimp only unfold fixedRayFiberFromRows rw [fixedRayFiber_value] simp only [mul_one, Finset.mul_sum] end CompletedGauss.FreeReflection namespace CanonicalRowCompletion.ActualFiber section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein variable (q:ℕ) (hq:q≠0) (m:_root_.OAI.ActualEisensteinCubic.O) (hm:m≠0) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:_root_.OAI.ActualEisensteinCubic.Oˣ) variable [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q})] theorem reflectedFiber_value (K:ℝ) (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (hΨ:∀n,‖Ψ n‖≤1) (W:ℝ→ℂ) (X:ℝ) (k:idealRange (completedResidualScale K R (maskIdeal q m F))) : let : Fintype (FixedReflectionRay (reflectionConductor q) (reflectionConductor_ne_zero q hq)) := fixedReflectionRay_fintype (reflectionConductor q) (reflectionConductor_ne_zero q hq) let d:=reflectedFiber q hq m hm rows R F hR hF hrows v K Ψ hΨ d.value W X 1 completedRamifiedStep k= ∑r:FixedReflectionRay (reflectionConductor q) (reflectionConductor_ne_zero q hq), ∑B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q)), FreeReflection.reflectionInactiveStratumWeight R F (maskIdeal q m F) (freeConductor q) B* ∑l:B→Fin 3,(d.branch (fixedReflectionRayEquiv (reflectionConductor q) (reflectionConductor_ne_zero q hq) r,encodeReflectionSix ⟨B,l⟩)).value W X 1 completedRamifiedStep k := by let : Fintype (FixedReflectionRay (reflectionConductor q) (reflectionConductor_ne_zero q hq)) := fixedReflectionRay_fintype (reflectionConductor q) (reflectionConductor_ne_zero q hq) dsimp only exact FreeReflection.fixedRayFiberFromRows_value (reflectionConductor q) (reflectionConductor_ne_zero q hq) rows R F (maskIdeal q m F) (freeConductor q) hR (maskIdeal_ne_zero q m hm F hF.ne_zero) K (fun a J=>rowScalar q hq m hm rows R F hR hF hrows v Ψ a.1 a.2 J) (fun a J=>rowScalar_norm q hq m hm rows R F hR hF hrows v Ψ hΨ a.1 a.2 J) W X 1 completedRamifiedStep k end section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein CubicJacobiGlobal variable (q:ℕ) (hq:q≠0) (m:_root_.OAI.ActualEisensteinCubic.O) (hm:m≠0) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:_root_.OAI.ActualEisensteinCubic.Oˣ) variable [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q})] omit [Fintype (_root_.OAI.ActualEisensteinCubic.O ⧸ Ideal.span {reflectionConductor q})] in theorem sourceStratumValue_eq_compressed (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q))) (J:RowIndex q m rows R F) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0freePrimaryPrime lengthScale (freeConductor q) P.val let G:=fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h let E:=selectedActiveEquiv (splitIndex q hq m hm rows R F hR hF hrows v J) B let j:A→ℕ:=fun P=>(UniqueFactorizationMonoid.normalizedFactors lengthScale).count P.val.val.val%6 let : ∀P:sourcePrimeSet q hq m hm rows R F hR hF hrows v B J, (Ideal.span {(freePrimaryPrime (data q m hm rows R F hF hrows v J).movingIdeal (CanonicalCoefficientClass.fixedBaseConductor q*Ideal.span {(72:_root_.OAI.ActualEisensteinCubic.O)}) P.val)}:Ideal _root_.OAI.ActualEisensteinCubic.O).IsMaximal:= fun P=>freePrimaryPrime_maximal _ _ (data q m hm rows R F hF hrows v J).movingSupported P.val have hjres (P:PrimeIndex (rowResidualPart J.val (maskIdeal q m F))) : j (E (Sum.inl P))=1:=by change (UniqueFactorizationMonoid.normalizedFactors lengthScale).count (E (Sum.inl P)).val.val.val%6=1 rw [selectedActiveEquiv_inl] exact splitIndex_local_exponent q hq m hm rows R F hR hF hrows v J (Sum.inl P) have hPB:(fun b:B=>Ideal.span {p (E (Sum.inr b))}:B→Ideal _root_.OAI.ActualEisensteinCubic.O)=(fun b=>b.val.val):=by funext b rw [show p (E (Sum.inr b))=freePrimaryPrime lengthScale (freeConductor q) (E (Sum.inr b)).val from rfl, freePrimaryPrime_span lengthScale (freeConductor q) hL,selectedActiveEquiv_inr] exact splitIndex_prime_val q hq m hm rows R F hR hF hrows v J (Sum.inr b.val) have hjB:(fun b:B=>j (E (Sum.inr b)))=(fun b=>completedLocalExponent R F b.val.val):=by funext b change (UniqueFactorizationMonoid.normalizedFactors lengthScale).count (E (Sum.inr b)).val.val.val%6=completedLocalExponent R F b.val.val rw [selectedActiveEquiv_inr] exact splitIndex_local_exponent q hq m hm rows R F hR hF hrows v J (Sum.inr b.val) have hdiv (l:B→Fin 3) (side:Fin 3) : reflectionExtractedDivisor (fun b:B=>Ideal.span {p (E (Sum.inr b))}) (fun b:B=>j (E (Sum.inr b))) l side=sourceDivisor q m R F B l side := by rw [hPB,hjB] rfl have hcop:Pairwise (fun a b:A=>IsCoprime (Ideal.span {p a}) (Ideal.span {p b})):=by intro a b hab exact freePrimaryPrime_coprime lengthScale (freeConductor q) hL (fun he=>hab (Subtype.ext he)) have he := @FixedFourierGeometry.smoothedValue_eq_nonresidual_equiv _ _ G _ B A _ (Finset.Subtype.fintype B) (Finset.Subtype.fintype A) p _ E (sourceStratum q hq m hm rows R F hR hF hrows v h B J) (fun P => freePrimaryPrime_maximal lengthScale (freeConductor q) hL P.val) (mul_dvd_mul_left 9 G.denominator_dvd) (primary_finset_product Finset.univ p (fun P _=>freePrimaryPrime_primary lengthScale (freeConductor q) hL P.val)) (fun P=>freePrimaryPrime_ne_zero lengthScale (freeConductor q) hL P.val) hcop (fun P=>freePrimaryPrime_good lengthScale (freeConductor q) hL P.val) (fun P=>freePrimaryPrime_odd lengthScale (freeConductor q) hL P.val) j (fun _=>Nat.mod_lt _ (by decide)) hjres W lo hi hlo hsupp hW X hX refine he.trans ?_ apply congrArg (fun z:ℂ=>fixedRadialCoefficientScalar*G.shape.stratumShapeFactor (G.c0*∏P:A,p P)*z) apply tsum_congr intro u apply Finset.sum_congr (by ext l; simp only [Finset.mem_univ]) intro l hl unfold sourceCompressedTerm dsimp only apply tsum_congr intro x congr 1 apply Prod.ext · rfl · apply Prod.ext · apply Subtype.ext exact congrArg (fun I:Ideal _root_.OAI.ActualEisensteinCubic.O=>I*x.2.1.val) (hdiv l 1) · apply Subtype.ext exact congrArg (fun I:Ideal _root_.OAI.ActualEisensteinCubic.O=>I*x.2.2.val) (hdiv l 2) end section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve lemma one_le_residualScale (q:ℕ) (m:_root_.OAI.ActualEisensteinCubic.O) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (K:ℝ) (hrows:∀I∈rows,I≠0 ∧ K/2≤(Ideal.absNorm I:ℝ) ∧ (Ideal.absNorm I:ℝ)≤K) (J:RowIndex q m rows R F) : 1≤completedResidualScale K R (maskIdeal q m F) := by have hJ:=hrows J.val (Finset.mem_filter.mp J.property).1 rw [←representativeFiber_residualScale rows R (maskIdeal q m F) J K] exact one_le_completedResidualScale K J.val (maskIdeal q m F) hJ.1 hJ.2.2 lemma residual_shell (q:ℕ) (m:_root_.OAI.ActualEisensteinCubic.O) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (K:ℝ) (hrows:∀I∈rows,I≠0 ∧ K/2≤(Ideal.absNorm I:ℝ) ∧ (Ideal.absNorm I:ℝ)≤K) (J:RowIndex q m rows R F) : 0thetaDerivativeScalar⁻¹*z) rw [Finset.mul_sum] apply Finset.sum_congr rfl intro h hh rw [mul_left_comm fixedRadialCoefficientScalar] apply congrArg (fun z:ℂ=>sourceFixedCoefficient q hq m hm rows R F hF hrows v Ψ h J*z) rw [Finset.mul_sum] apply Finset.sum_congr rfl intro B hB rw [sourceStratumValue_eq_compressed q hq m hm rows R F hR hF hrows v h B J W lo hi hlo hsupp hW X hX,tsum_fintype] change _=(fixedRadialCoefficientScalar* (FreeReflection.reflectionInactiveStratumWeight R F (maskIdeal q m F) (freeConductor q) B* sourceShapeFactor q hq m hm rows R F hR hF hrows v h B J* ∑u:_root_.OAI.ActualEisensteinCubic.Oˣ,∑l:B→Fin 3,sourceCompressedTerm q hq m hm rows R F hR hF hrows v h B J u l W X)) dsimp only [sourceShapeFactor] ring end CanonicalRowCompletion.ActualFiber open scoped Classical BigOperators namespace CompletedGauss variable {α β γ ι:Type*} [Fintype α] [Fintype β] [Fintype γ] [Fintype ι] omit [Fintype α] [Fintype β] [Fintype γ] [Fintype ι] in lemma residualLabelVia_nonresidual_equiv (E:α⊕β≃ι) (T:β≃γ) (l:β→Fin 3) (l':γ→Fin 3) (hl:∀b,l' (T b)=l b) : residualLabelVia ((Equiv.sumCongr (Equiv.refl α) T.symm).trans E) l'= residualLabelVia E l := by let E':=((Equiv.sumCongr (Equiv.refl α) T.symm).trans E) funext i obtain ⟨a,rfl⟩:=E.surjective i cases a with | inl a=> have he:E (Sum.inl a)=E' (Sum.inl a):=rfl calc _=residualLabelVia E' l' (E' (Sum.inl a)):=by rw [he] _=0:=residualLabelVia_apply E' l' (Sum.inl a) _=_:=(residualLabelVia_apply E l (Sum.inl a)).symm | inr b=> have he:E (Sum.inr b)=E' (Sum.inr (T b)):=by simp [E'] calc _=residualLabelVia E' l' (E' (Sum.inr (T b))):=by rw [he] _=l' (T b):=residualLabelVia_apply E' l' (Sum.inr (T b)) _=l b:=hl b _=_:=(residualLabelVia_apply E l (Sum.inr b)).symm end CompletedGauss namespace CanonicalRowCompletion.ActualFiber open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein lemma activeModelPrimeEquiv_labels (q:ℕ) (hq:q≠0) (m:_root_.OAI.ActualEisensteinCubic.O) (hm:m≠0) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:_root_.OAI.ActualEisensteinCubic.Oˣ) (e:FreeReflection.pool R (maskIdeal q m F) (freeConductor q) → Fin 6) (J:RowIndex q m rows R F) : residualLabelVia (activeModelPrimeEquiv q hq m hm rows R F hR hF hrows v e J) (FreeReflection.reflectionActiveLabel R (maskIdeal q m F) (freeConductor q) e)= residualLabelVia (selectedActiveEquiv (splitIndex q hq m hm rows R F hR hF hrows v J) (reflectionSixSupport e)) (fun b=>reflectionSixLabel (e b.val)) := by exact residualLabelVia_nonresidual_equiv _ (FreeReflection.supportActivePoolEquiv R (maskIdeal q m F) (freeConductor q) e) _ _ (fun _=>rfl) end CanonicalRowCompletion.ActualFiber open scoped BigOperators Classical ContDiff namespace CompletedGauss.FreeReflection open ActualEisensteinCubic lemma supportActivePoolEquiv_divisor (I F Q Q0:Ideal _root_.OAI.ActualEisensteinCubic.O) (e:pool I Q Q0 → Fin 6) (side:Fin 3) : reflectionExtractedDivisor (fun P:reflectionActivePool I Q Q0 e=>P.val) (fun P=>completedLocalExponent I F P.val) (reflectionActiveLabel I Q Q0 e) side= reflectionExtractedDivisor (fun b:reflectionSixSupport e=>b.val.val) (fun b=>completedLocalExponent I F b.val.val) (fun b=>reflectionSixLabel (e b.val)) side := by unfold reflectionExtractedDivisor symm apply Fintype.prod_equiv (supportActivePoolEquiv I Q Q0 e) intro b rfl end CompletedGauss.FreeReflection namespace CanonicalRowCompletion.ActualFiber section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein variable (q:ℕ) (hq:q≠0) (m:_root_.OAI.ActualEisensteinCubic.O) (hm:m≠0) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:_root_.OAI.ActualEisensteinCubic.Oˣ) variable [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q})] theorem reflectedFiber_decoded_branch_exact (K:ℝ) (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (hΨ:∀n,‖Ψ n‖≤1) (hbound:∀I∈rows,(Ideal.absNorm I:ℝ)≤K) (J:RowIndex q m rows R F) (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (rho:(fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).PhaseResidue) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (e:FreeReflection.pool R (maskIdeal q m F) (freeConductor q) → Fin 6) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0reflectionSixLabel (e b.val) let D:=data q m hm rows R F hF hrows v J let A:=sourcePrimeSet q hq m hm rows R F hR hF hrows v B J let G:=fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h let ray:FixedReflectionRay (reflectionConductor q) (reflectionConductor_ne_zero q hq):=⟨h,rho,u⟩ let d:=(reflectedFiber q hq m hm rows R F hR hF hrows v K Ψ hΨ).branch (fixedReflectionRayEquiv (reflectionConductor q) (reflectionConductor_ne_zero q hq) ray, e) let k:=fiberResidualIndex rows R (maskIdeal q m F) K (mask_bad q m F) (fun I hI=>⟨hrows I hI,hbound I hI⟩) J 4*d.value W X 1 completedRamifiedStep k= if rho=D.sourceRowResidue (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h G A then fixedThetaRowCoeff (reflectionConductor q) (reflectionConductor_ne_zero q hq) (D.fixedFactor Ψ (CanonicalCoefficientClass.fixedBaseConductor q)) h* G.shape.stratumShapeFactor (G.c0*∏P:A,freePrimaryPrime D.movingIdeal (freeConductor q) P.val)* sourceCompressedTerm q hq m hm rows R F hR hF hrows v h B J u l W X else 0 := by let D:=data q m hm rows R F hF hrows v J let A:=activeSet q hq m hm rows R F hR hF hrows v e J let G:=fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h let S:=D.activeStratum (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h G A let Em:=activeModelPrimeEquiv q hq m hm rows R F hR hF hrows v e J let Es:=selectedActiveEquiv (splitIndex q hq m hm rows R F hR hF hrows v J) (reflectionSixSupport e) let labels:=fun b:reflectionSixSupport e=>reflectionSixLabel (e b.val) let : ∀P:A,(Ideal.span {freePrimaryPrime D.movingIdeal (CanonicalCoefficientClass.fixedBaseConductor q* Ideal.span {(72:_root_.OAI.ActualEisensteinCubic.O)}) P.val}:Ideal _root_.OAI.ActualEisensteinCubic.O).IsMaximal:= fun P=>freePrimaryPrime_maximal _ _ D.movingSupported P.val let hp:=fun P:A=>freePrimaryPrime_ne_zero _ _ D.movingSupported P.val let hg:=fun P:A=>freePrimaryPrime_good _ _ D.movingSupported P.val let j:=fun P:A=>(UniqueFactorizationMonoid.normalizedFactors D.movingIdeal).count P.val.val.val%6 have ht:=reflectedFiber_branch_exact q hq m hm rows R F hR hF hrows v K Ψ hΨ hbound J h rho u e W lo hi hlo hsupp hW X hX hK hk refine ht.trans (congrArg (fun z:ℂ=>if rho=D.sourceRowResidue (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h G A then fixedThetaRowCoeff (reflectionConductor q) (reflectionConductor_ne_zero q hq) (D.fixedFactor Ψ (CanonicalCoefficientClass.fixedBaseConductor q)) h* G.shape.stratumShapeFactor (G.c0*∏P:A,freePrimaryPrime D.movingIdeal (freeConductor q) P.val)*z else 0) ?_) unfold sourceCompressedTerm apply tsum_congr intro x have hlabel:residualLabelVia Em (FreeReflection.reflectionActiveLabel R (maskIdeal q m F) (freeConductor q) e)= residualLabelVia Es labels:=activeModelPrimeEquiv_labels q hq m hm rows R F hR hF hrows v e J have hdiv (side:Fin 3):columnDivisor q m R F e side= sourceDivisor q m R F (reflectionSixSupport e) labels side:= FreeReflection.supportActivePoolEquiv_divisor R F (maskIdeal q m F) (freeConductor q) e side have harg:nonzeroDualDilation (columnDivisor q m R F e 1) (columnDivisor q m R F e 2) (columnDivisor_ne_zero q m R F e 1) (columnDivisor_ne_zero q m R F e 2) x= nonzeroDualDilation (sourceDivisor q m R F (reflectionSixSupport e) labels 1) (sourceDivisor q m R F (reflectionSixSupport e) labels 2) (sourceDivisor_ne_zero q m R F (reflectionSixSupport e) labels 1) (sourceDivisor_ne_zero q m R F (reflectionSixSupport e) labels 2) x := by apply Prod.ext · rfl · apply Prod.ext <;> apply Subtype.ext <;> dsimp only [nonzeroDualDilation] <;> rw [hdiv] exact congrArg₂ (fun label arg => @FixedFourierGeometry.stratumBranchTerm _ _ G A (Finset.Subtype.fintype A) _ _ S _ hp hg j u label W X arg) hlabel harg end open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein variable (q:ℕ) (hq:q≠0) (m:_root_.OAI.ActualEisensteinCubic.O) (hm:m≠0) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:_root_.OAI.ActualEisensteinCubic.Oˣ) variable [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q})] theorem reflectedFiber_encoded_branch_exact (K:ℝ) (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (hΨ:∀n,‖Ψ n‖≤1) (hbound:∀I∈rows,(Ideal.absNorm I:ℝ)≤K) (J:RowIndex q m rows R F) (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (rho:(fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).PhaseResidue) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q))) (l:B→Fin 3) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0⟨hrows I hI,hbound I hI⟩) J 4*d.value W X 1 completedRamifiedStep k= if rho=D.sourceRowResidue (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h G A then fixedThetaRowCoeff (reflectionConductor q) (reflectionConductor_ne_zero q hq) (D.fixedFactor Ψ (CanonicalCoefficientClass.fixedBaseConductor q)) h* G.shape.stratumShapeFactor (G.c0*∏P:A,freePrimaryPrime D.movingIdeal (freeConductor q) P.val)* sourceCompressedTerm q hq m hm rows R F hR hF hrows v h B J u l W X else 0 := by let result:(ΣB:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q)),B→Fin 3) → ℂ := fun x => let D:=data q m hm rows R F hF hrows v J let A:=sourcePrimeSet q hq m hm rows R F hR hF hrows v x.1 J let G:=fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h if rho=D.sourceRowResidue (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h G A then fixedThetaRowCoeff (reflectionConductor q) (reflectionConductor_ne_zero q hq) (D.fixedFactor Ψ (CanonicalCoefficientClass.fixedBaseConductor q)) h* G.shape.stratumShapeFactor (G.c0*∏P:A,freePrimaryPrime D.movingIdeal (freeConductor q) P.val)* sourceCompressedTerm q hq m hm rows R F hR hF hrows v h x.1 J u x.2 W X else 0 have ht:=reflectedFiber_decoded_branch_exact q hq m hm rows R F hR hF hrows v K Ψ hΨ hbound J h rho u (encodeReflectionSix ⟨B,l⟩) W lo hi hlo hsupp hW X hX hK hk change _=result (decodeReflectionSix (encodeReflectionSix ⟨B,l⟩)) at ht rw [decode_encodeReflectionSix] at ht change _=result ⟨B,l⟩ exact ht end CanonicalRowCompletion.ActualFiber end end OAI end section -- Source module: OAI.NumberTheory.DirichletL.RowCompletion.ZeroFreeRegion namespace OAI noncomputable section open scoped BigOperators open MulChar AddChar open scoped BigOperators open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped FourierTransform SchwartzMap open Finset Complex open scoped Classical open scoped Classical open Filter Real Asymptotics open ActualEisensteinCubic open Filter open ActualEisensteinCubic RationalPrimeExtraction ShortDraftLatticeCount open ActualEisensteinCubic ShortDraftLatticeCount open Filter open scoped Topology open EisensteinEmbedding ConcreteTraceCRT ActualEisensteinCubic open MulChar AddChar open Filter Asymptotics open scoped ArithmeticFunction.Moebius open Filter open MulChar AddChar open MulChar AddChar open scoped ArithmeticFunction.Moebius open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Ideal NumberField RingOfIntegers UniqueFactorizationMonoid open Filter Asymptotics open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics Ideal NumberField open Filter open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open Filter Asymptotics MeasureTheory open scoped Topology open MeasureTheory Real open scoped ContDiff FourierTransform SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical SchwartzMap ContDiff open scoped BigOperators Classical open scoped BigOperators Classical SchwartzMap ContDiff open MeasureTheory Set open scoped BigOperators open scoped BigOperators Classical open scoped BigOperators Classical open ActualEisensteinCubic UniqueFactorizationMonoid open scoped BigOperators open scoped BigOperators open scoped BigOperators Classical SchwartzMap open scoped BigOperators Classical open scoped BigOperators Classical ContDiff namespace CanonicalRowCompletion.ActualFiber open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CubicEisenstein noncomputable def collectionUnitsFintype : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := by letI : Finite _root_.OAI.ActualEisensteinCubic.Oˣ:=PrimaryIdealUnitReindex.finite_units exact Fintype.ofFinite _ variable (q:ℕ) (hq:q≠0) (m:_root_.OAI.ActualEisensteinCubic.O) (hm:m≠0) (rows:Finset (Ideal _root_.OAI.ActualEisensteinCubic.O)) (R F:Ideal _root_.OAI.ActualEisensteinCubic.O) (hR:R≠0) (hF:Squarefree F) (hrows:∀I∈rows,I≠0) (v:_root_.OAI.ActualEisensteinCubic.Oˣ) variable [Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q})] theorem reflectedFiber_four_mul_value (K:ℝ) (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (hΨ:∀n,‖Ψ n‖≤1) (hbound:∀I∈rows,(Ideal.absNorm I:ℝ)≤K) (J:RowIndex q m rows R F) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0⟨hrows I hI,hbound I hI⟩) J 4*(reflectedFiber q hq m hm rows R F hR hF hrows v K Ψ hΨ).value W X 1 completedRamifiedStep k= compressedSourceTotal q hq m hm rows R F hR hF hrows v Ψ J W X := by let : ∀ h : _root_.OAI.ActualEisensteinCubic.O ⧸ Ideal.span {reflectionConductor q}, Finite (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).PhaseResidue := fun h => FixedFourierGeometry.phaseResidue_finite _ letI : Fintype _root_.OAI.ActualEisensteinCubic.Oˣ := collectionUnitsFintype let : ∀h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}, Fintype (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).PhaseResidue := fun h=>by letI := (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).phaseResidue_finite exact Fintype.ofFinite _ let d:=reflectedFiber q hq m hm rows R F hR hF hrows v K Ψ hΨ let k:=fiberResidualIndex rows R (maskIdeal q m F) K (mask_bad q m F) (fun I hI=>⟨hrows I hI,hbound I hI⟩) J let f:=fun (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (rho:(fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h).PhaseResidue) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q))) (l:B→Fin 3)=> (d.branch (fixedReflectionRayEquiv (reflectionConductor q) (reflectionConductor_ne_zero q hq) ⟨h,rho,u⟩,encodeReflectionSix ⟨B,l⟩)).value W X 1 completedRamifiedStep k let g:=fun (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (u:_root_.OAI.ActualEisensteinCubic.Oˣ) (B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q))) (l:B→Fin 3)=> sourceCompressedTerm q hq m hm rows R F hR hF hrows v h B J u l W X let chosen:=fun (h:_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) (B:Finset (FreeReflection.pool R (maskIdeal q m F) (freeConductor q)))=> (data q m hm rows R F hF hrows v J).sourceRowResidue (CanonicalCoefficientClass.fixedBaseConductor q) (reflectionConductor q) (reflectionConductor_ideal q) h (fixedFourierGeometry (reflectionConductor q) (reflectionConductor_ne_zero q hq) h) (sourcePrimeSet q hq m hm rows R F hR hF hrows v B J) let α:=fun h=>sourceFixedCoefficient q hq m hm rows R F hF hrows v Ψ h J let shape:=fun h B=>sourceShapeFactor q hq m hm rows R F hR hF hrows v h B J let w:=FreeReflection.reflectionInactiveStratumWeight R F (maskIdeal q m F) (freeConductor q) have hbranch:∀h rho u B l,4*f h rho u B l= if rho=chosen h B then α h*shape h B*g h u B l else 0 := by intro h rho u B l exact reflectedFiber_encoded_branch_exact q hq m hm rows R F hR hF hrows v K Ψ hΨ hbound J h rho u B l W lo hi hlo hsupp hW X hX hK hk have hvalue:d.value W X 1 completedRamifiedStep k= ∑h,∑rho,∑u,∑B,w B*∑l,f h rho u B l := by rw [reflectedFiber_value q hq m hm rows R F hR hF hrows v K Ψ hΨ W X k] exact sum_fixedReflectionRay (reflectionConductor q) (reflectionConductor_ne_zero q hq) _ change 4*d.value W X 1 completedRamifiedStep k=_ rw [hvalue] exact finite_selected_branch_collection f g chosen α shape w hbranch theorem completedT_eq_reflectedFiber_idealValue (Ψ:_root_.OAI.ActualEisensteinCubic.O→*ℂ) (hΨperiod:CanonicalCoefficientClass.FactorsModulo (CanonicalCoefficientClass.fixedBaseConductor q) Ψ) (hΨ:∀n,‖Ψ n‖≤1) (K:ℝ) (hshell:∀I∈rows,K/2≤(Ideal.absNorm I:ℝ) ∧ (Ideal.absNorm I:ℝ)≤K) (J:RowIndex q m rows R F) (W:ℝ→ℂ) (lo hi:ℝ) (hlo:0⟨hrows I hI,(hshell I hI).2⟩) J have hs:=residual_shell q m rows R F K (fun I hI=>⟨hrows I hI,hshell I hI⟩) J have he:=reflectedFiber_four_mul_value q hq m hm rows R F hR hF hrows v K Ψ hΨ (fun I hI=>(hshell I hI).2) J W lo hi hlo hsupp hW X hX hs.1 hs.2 rw [completedT_eq_compressedSourceTotal q hq m hm rows R F hR hF hrows v Ψ hΨperiod hΨ J W lo hi hlo hsupp hW X hX,←he] have hid:rowResidualPart J.val (maskIdeal q m F)=k.val:=rfl rw [hid,ReflectedFiberData.idealValue_at] ring end CanonicalRowCompletion.ActualFiber namespace CanonicalRowCompletion section open ActualEisensteinCubic CompletedGauss CanonicalQuadraticSieve CanonicalCoefficientClass CubicEisenstein def actualReflectionScale : ℂ := 4*thetaDerivativeScalar⁻¹*fixedRadialCoefficientScalar theorem actual_fixedShellModels (q:ℕ) (hq:q≠0) (χ:DirichletCharacter ℂ q) : HasFixedShellModels (reflectionExcludedPrimes q) (initialBase χ) (fixedReflectionRayCount (reflectionConductor q) (reflectionConductor_ne_zero q hq)) actualReflectionScale 1 completedRamifiedStep (fixedCuspLevelBound (reflectionConductor q)) := by let : Finite (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) := ConcreteTraceCRT.finite_quotient_span (reflectionConductor_ne_zero q hq) let : Fintype (_root_.OAI.ActualEisensteinCubic.O⧸Ideal.span {reflectionConductor q}) := Fintype.ofFinite _ apply fixedShellModels_of_actual_fiber_identity q hq χ actualReflectionScale intro Ψ hperiod hnorm m hm F hF u W a b ha hs hW K X hK hX rows hrows R hR J exact ActualFiber.completedT_eq_reflectedFiber_idealValue q hq m hm rows R F (hrows R hR).1 hF (fun I hI=>(hrows I hI).1) u Ψ hperiod hnorm K (fun I hI=>(hrows I hI).2) J W a b ha hs hW X hX theorem exists_actual_fixedShellModels (q:ℕ) [NeZero q] (χ:DirichletCharacter ℂ q) : ∃(rays:ℕ) (scale:ℂ), HasFixedShellModels (reflectionExcludedPrimes q) (initialBase χ) rays scale 1 completedRamifiedStep (fixedCuspLevelBound (reflectionConductor q)) := by exact ⟨fixedReflectionRayCount (reflectionConductor q) (reflectionConductor_ne_zero q (NeZero.ne q)), actualReflectionScale,actual_fixedShellModels q (NeZero.ne q) χ⟩ end theorem dirichletTarget_unconditional : ShortDraft.DirichletTarget := dirichletTarget_of_reflection_shells exists_actual_fixedShellModels end CanonicalRowCompletion namespace ShortDraft theorem riemannZeta_ne_zero_of_re_gt (s:ℂ) (hs:(23/24:ℝ) (n : ZMod χ.modulus)) · intro n hn exact mem_univ _ · intro n hn m hm he have h := congrArg ZMod.val he simpa only [ZMod.val_natCast_of_lt (mem_range.mp hn), ZMod.val_natCast_of_lt (mem_range.mp hm)] using h · intro a ha exact ⟨a.val, mem_range.mpr a.val_lt, ZMod.natCast_zmod_val a⟩ · intro n hn rfl rw [hsum] exact MulChar.sum_eq_zero_of_ne_one χ.nontrivial theorem PrimitiveComplexCharacter.period_blocks_sum (χ : PrimitiveComplexCharacter) (k : ℕ) : (∑ n ∈ range (k * χ.modulus), χ.character (n : ZMod χ.modulus)) = 0 := by let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ induction k with | zero => simp | succ k ih => rw [Nat.succ_mul, sum_range_add, ih, zero_add] simpa only [Nat.cast_add, Nat.cast_mul, ZMod.natCast_self, mul_zero, zero_add] using χ.period_sum theorem PrimitiveComplexCharacter.prefix_remainder (χ : PrimitiveComplexCharacter) (N : ℕ) : (∑ n ∈ range N, χ.character (n : ZMod χ.modulus)) = ∑ n ∈ range (N % χ.modulus), χ.character (n : ZMod χ.modulus) := by let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ have hN : N = (N / χ.modulus) * χ.modulus + N % χ.modulus := by rw [Nat.mul_comm, Nat.div_add_mod] conv_lhs => rw [hN] rw [sum_range_add, χ.period_blocks_sum, zero_add] simp only [Nat.cast_add, Nat.cast_mul, ZMod.natCast_self, mul_zero, zero_add] theorem PrimitiveComplexCharacter.prefix_bound (χ : PrimitiveComplexCharacter) (N : ℕ) : ‖∑ n ∈ range N, χ.character (n : ZMod χ.modulus)‖ ≤ χ.modulus := by rw [χ.prefix_remainder] calc _ ≤ ∑ n ∈ range (N % χ.modulus), ‖χ.character (n : ZMod χ.modulus)‖ := norm_sum_le _ _ _ ≤ ∑ _n ∈ range (N % χ.modulus), (1 : ℝ) := sum_le_sum (fun _ _ => χ.character.norm_le_one _) _ = (N % χ.modulus : ℕ) := by simp _ ≤ (χ.modulus : ℝ) := by exact_mod_cast (Nat.mod_lt N χ.positive).le theorem PrimitiveComplexCharacter.prefix_Icc_bound (χ : PrimitiveComplexCharacter) (N : ℕ) : ‖∑ n ∈ Icc 1 N, χ.character (n : ZMod χ.modulus)‖ ≤ χ.modulus + 1 := by have he : (∑ n ∈ range (N + 1), χ.character (n : ZMod χ.modulus)) = χ.character 0 + ∑ n ∈ Icc 1 N, χ.character (n : ZMod χ.modulus) := by rw [Nat.range_succ_eq_Icc_zero, ← insert_Icc_add_one_left_eq_Icc (Nat.zero_le N), sum_insert (by simp)] simp have hb := χ.prefix_bound (N + 1) have hn := norm_sub_le (∑ n ∈ range (N + 1), χ.character (n : ZMod χ.modulus)) (χ.character 0) rw [he] at hn hb simpa only [add_sub_cancel_left] using hn.trans (add_le_add hb (χ.character.norm_le_one 0)) end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.Characters.CharacterRightHalfPlane -/ namespace OAI /- # Quantitative initial bounds for the continued character L-function The elementary coefficient bounds and Möbius inverse give a uniform positive lower bound on Re(s)=2, used as the center value in the zero-count argument. -/ namespace Ostmann open MeasureTheory Filter open scoped Classical BigOperators theorem lSeries_norm_bound_re_two (f : ℕ → ℂ) (hf : ∀ n : ℕ, n ≠ 0 → ‖f n‖ ≤ 1) (s : ℂ) (hs : s.re = 2) : ‖LSeries f s‖ ≤ Real.pi ^ 2 / 6 := by have hsum : LSeriesSummable f s := LSeriesSummable_of_bounded_of_one_lt_re hf (by rw [hs]; norm_num) have hpoint (n : ℕ) : ‖LSeries.term f s n‖ ≤ 1 / (n : ℝ) ^ 2 := by rw [LSeries.norm_term_eq, hs, Real.rpow_two] split_ifs with hn · simp [hn] · exact div_le_div_of_nonneg_right (hf n hn) (sq_nonneg _) calc _ ≤ ∑' n : ℕ, ‖LSeries.term f s n‖ := norm_tsum_le_tsum_norm hsum.norm _ ≤ ∑' n : ℕ, 1 / (n : ℝ) ^ 2 := hsum.norm.tsum_le_tsum hpoint hasSum_zeta_two.summable _ = _ := hasSum_zeta_two.tsum_eq theorem PrimitiveComplexCharacter.L_lower_re_two (χ : PrimitiveComplexCharacter) (s : ℂ) (hs : s.re = 2) : 1 / 3 ≤ ‖χ.L s‖ := by let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ let f : ℕ → ℂ := fun n => χ.character (n : ZMod χ.modulus) * ArithmeticFunction.moebius n have hf (n : ℕ) (hn : n ≠ 0) : ‖f n‖ ≤ 1 := by dsimp only [f] rw [norm_mul] have hm : ‖(ArithmeticFunction.moebius n : ℂ)‖ ≤ 1 := by norm_cast exact ArithmeticFunction.abs_moebius_le_one exact (mul_le_mul (χ.character.norm_le_one _) hm (norm_nonneg _) (by norm_num)).trans_eq (one_mul 1) have hb := lSeries_norm_bound_re_two f hf s hs have he : χ.L s * LSeries f s = 1 := by rw [PrimitiveComplexCharacter.L, DirichletCharacter.LFunction_eq_LSeries _ (by rw [hs]; norm_num)] exact DirichletCharacter.LSeries.mul_mu_eq_one χ.character (by rw [hs]; norm_num) have hn := congrArg norm he rw [norm_mul, norm_one] at hn have hpi : Real.pi ^ 2 / 6 ≤ 3 := by have h := Real.pi_lt_four nlinarith [Real.pi_pos] have hmul := mul_le_mul_of_nonneg_left (hb.trans hpi) (norm_nonneg (χ.L s)) rw [hn] at hmul linarith theorem PrimitiveComplexCharacter.partial_sum_bigO (χ : PrimitiveComplexCharacter) : (fun N : ℕ => ∑ n ∈ Finset.Icc 1 N, χ.character (n : ZMod χ.modulus)) =O[atTop] (fun _ : ℕ => (1 : ℝ)) := by apply Asymptotics.IsBigO.of_bound (χ.modulus + 1 : ℝ) filter_upwards with N simpa using χ.prefix_Icc_bound N theorem PrimitiveComplexCharacter.L_integral_right (χ : PrimitiveComplexCharacter) (s : ℂ) (hs : 1 < s.re) : χ.L s = s * ∫ t in Set.Ioi (1 : ℝ), (∑ n ∈ Finset.Icc 1 ⌊t⌋₊, χ.character (n : ZMod χ.modulus)) * (t : ℂ) ^ (-(s + 1)) := by let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ rw [PrimitiveComplexCharacter.L, DirichletCharacter.LFunction_eq_LSeries _ hs] apply LSeries_eq_mul_integral _ (r := 0) le_rfl (by linarith) (χ.character.LSeriesSummable_of_one_lt_re hs) simpa only [Real.rpow_zero] using χ.partial_sum_bigO end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.Characters.CharacterMellinIntegral -/ namespace OAI /- # The bounded-prefix Mellin representation on Re(s)>0 -/ namespace Ostmann open MeasureTheory Filter Set open scoped Classical BigOperators Topology noncomputable def characterSummatory (χ : PrimitiveComplexCharacter) (t : ℝ) : ℂ := (Ioi (1 : ℝ)).indicator (fun t => ∑ n ∈ Finset.Icc 1 ⌊t⌋₊, χ.character (n : ZMod χ.modulus)) t theorem characterSummatory_zero (χ : PrimitiveComplexCharacter) {t : ℝ} (ht : t ≤ 1) : characterSummatory χ t = 0 := by simp [characterSummatory, not_lt.mpr ht] theorem characterSummatory_bound (χ : PrimitiveComplexCharacter) (t : ℝ) : ‖characterSummatory χ t‖ ≤ χ.modulus + 1 := by by_cases ht : 1 < t · simpa [characterSummatory, ht] using χ.prefix_Icc_bound ⌊t⌋₊ · rw [characterSummatory_zero χ (le_of_not_gt ht), norm_zero] positivity theorem characterSummatory_locallyIntegrable (χ : PrimitiveComplexCharacter) : LocallyIntegrableOn (characterSummatory χ) (Ioi 0) := by intro t ht change 0 < t at ht refine ⟨Icc (t / 2) (t + 1), nhdsWithin_le_nhds (Icc_mem_nhds (by linarith) (by linarith)), ?_⟩ have hi := integrableOn_mul_sum_Icc (fun n => χ.character (n : ZMod χ.modulus)) (m := 1) (show 0 ≤ t / 2 by linarith) (b := t + 1) (show IntegrableOn (fun _ : ℝ => (1 : ℂ)) (Icc (t / 2) (t + 1)) from continuousOn_const.integrableOn_Icc) simp only [one_mul] at hi exact hi.indicator measurableSet_Ioi theorem characterSummatory_bigO (χ : PrimitiveComplexCharacter) : characterSummatory χ =O[atTop] (fun t : ℝ => t ^ (-(0 : ℝ))) := by apply Asymptotics.IsBigO.of_bound (χ.modulus + 1 : ℝ) filter_upwards with t simpa using characterSummatory_bound χ t theorem characterSummatory_zero_bigO (χ : PrimitiveComplexCharacter) (b : ℝ) : characterSummatory χ =O[𝓝[>] 0] (fun t : ℝ => t ^ (-b)) := by apply Asymptotics.IsBigO.of_bound 0 filter_upwards [(eventually_lt_nhds (show (0 : ℝ) < 1 by norm_num)).filter_mono nhdsWithin_le_nhds] with t ht simp [characterSummatory_zero χ ht.le] theorem characterSummatory_mellin (χ : PrimitiveComplexCharacter) (s : ℂ) : mellin (characterSummatory χ) (-s) = ∫ t in Ioi (1 : ℝ), (∑ n ∈ Finset.Icc 1 ⌊t⌋₊, χ.character (n : ZMod χ.modulus)) * (t : ℂ) ^ (-(s + 1)) := by let F : ℝ → ℂ := fun t => (t : ℂ) ^ (-s - 1) * characterSummatory χ t have hF (t : ℝ) (ht : t ≤ 1) : F t = 0 := by simp [F, characterSummatory_zero χ ht] change (∫ t in Ioi (0 : ℝ), F t) = _ rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun t ht => hF t (by simp only [mem_Ioi, not_lt] at ht; linarith))] rw [← setIntegral_eq_integral_of_forall_compl_eq_zero (s := Ioi (1 : ℝ)) (fun t ht => hF t (le_of_not_gt ht))] apply setIntegral_congr_fun measurableSet_Ioi intro t ht simp only [F, characterSummatory, indicator_of_mem ht] rw [show -s - 1 = -(s + 1) by ring] exact mul_comm _ _ noncomputable def characterMellinL (χ : PrimitiveComplexCharacter) (s : ℂ) : ℂ := s * mellin (characterSummatory χ) (-s) theorem characterMellinL_differentiableAt (χ : PrimitiveComplexCharacter) (s : ℂ) (hs : 0 < s.re) : DifferentiableAt ℂ (characterMellinL χ) s := by have hm := mellin_differentiableAt_of_isBigO_rpow (characterSummatory_locallyIntegrable χ) (characterSummatory_bigO χ) (s := -s) (by simpa using neg_neg_of_pos hs) (characterSummatory_zero_bigO χ (-s.re - 1)) (by simp) exact differentiableAt_id.mul (hm.comp s differentiableAt_id.neg) theorem characterMellinL_eq_L (χ : PrimitiveComplexCharacter) (s : ℂ) (hs : 0 < s.re) : characterMellinL χ s = χ.L s := by let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ have hopen : IsOpen {s : ℂ | 0 < s.re} := isOpen_lt continuous_const Complex.continuous_re have hf : AnalyticOnNhd ℂ (characterMellinL χ) {s : ℂ | 0 < s.re} := (show DifferentiableOn ℂ (characterMellinL χ) {s : ℂ | 0 < s.re} from fun s hs => (characterMellinL_differentiableAt χ s hs).differentiableWithinAt).analyticOnNhd hopen have hg : AnalyticOnNhd ℂ χ.L {s : ℂ | 0 < s.re} := (DirichletCharacter.differentiable_LFunction χ.nontrivial).differentiableOn.analyticOnNhd hopen have he : characterMellinL χ =ᶠ[𝓝 (2 : ℂ)] χ.L := by filter_upwards [(isOpen_lt continuous_const Complex.continuous_re).mem_nhds (show (2 : ℂ) ∈ {s : ℂ | 1 < s.re} by norm_num)] with z hz rw [characterMellinL, characterSummatory_mellin, χ.L_integral_right z hz] exact hf.eqOn_of_preconnected_of_eventuallyEq hg (convex_halfSpace_re_gt (0 : ℝ)).isPreconnected (by norm_num : (2 : ℂ) ∈ {s : ℂ | 0 < s.re}) he hs end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.Characters.CharacterMellinBound -/ namespace OAI /- # A quantitative bound in the positive half-plane The bounded periodic prefix sums give the polynomial growth needed for local Jensen estimates, without assuming a convexity estimate for L. -/ namespace Ostmann open MeasureTheory Set open scoped BigOperators theorem PrimitiveComplexCharacter.L_integral_positive (χ : PrimitiveComplexCharacter) (s : ℂ) (hs : 0 < s.re) : χ.L s = s * ∫ t in Ioi (1 : ℝ), (∑ n ∈ Finset.Icc 1 ⌊t⌋₊, χ.character (n : ZMod χ.modulus)) * (t : ℂ) ^ (-(s + 1)) := by rw [← characterMellinL_eq_L χ s hs, characterMellinL, characterSummatory_mellin] theorem PrimitiveComplexCharacter.L_norm_bound_positive (χ : PrimitiveComplexCharacter) (s : ℂ) (hs : 0 < s.re) : ‖χ.L s‖ ≤ ‖s‖ * ((χ.modulus : ℝ) + 1) / s.re := by have hg : IntegrableOn (fun t : ℝ => ((χ.modulus : ℝ) + 1) * t ^ (-s.re - 1)) (Ioi 1) := (integrableOn_Ioi_rpow_of_lt (by linarith) (by norm_num : (0 : ℝ) < 1)).const_mul _ have hmean : ‖∫ t in Ioi (1 : ℝ), (∑ n ∈ Finset.Icc 1 ⌊t⌋₊, χ.character (n : ZMod χ.modulus)) * (t : ℂ) ^ (-(s + 1))‖ ≤ ∫ t in Ioi (1 : ℝ), ((χ.modulus : ℝ) + 1) * t ^ (-s.re - 1) := by apply norm_integral_le_of_norm_le hg filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht change 1 < t at ht have ht0 : 0 < t := by linarith rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos ht0] simp only [Complex.neg_re, Complex.add_re, Complex.one_re] rw [show -(s.re + 1) = -s.re - 1 by ring] exact mul_le_mul_of_nonneg_right (χ.prefix_Icc_bound _) (Real.rpow_nonneg ht0.le _) have heval : (∫ t in Ioi (1 : ℝ), ((χ.modulus : ℝ) + 1) * t ^ (-s.re - 1)) = ((χ.modulus : ℝ) + 1) / s.re := by rw [integral_const_mul, integral_Ioi_rpow_of_lt (by linarith) (by norm_num : (0 : ℝ) < 1)] simp only [Real.one_rpow] field_simp [hs.ne'] ring rw [χ.L_integral_positive s hs, norm_mul] calc _ ≤ ‖s‖ * (((χ.modulus : ℝ) + 1) / s.re) := mul_le_mul_of_nonneg_left (hmean.trans_eq heval) (norm_nonneg _) _ = _ := by ring end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.ZeroDensity.CharacterLocalZeroCount -/ namespace OAI /- # Local zero counts for primitive character L-functions Jensen's formula is applied to disks centered on Re(s)=2. The larger radius stays in the positive half-plane; the smaller disk covers a unit ordinate interval in the right half of the critical strip. -/ namespace Ostmann open Metric Set MeromorphicOn open scoped BigOperators noncomputable def characterZeroCenter (t : ℝ) : ℂ := 2 + (t : ℂ) * Complex.I noncomputable def characterLocalZeroMass (χ : PrimitiveComplexCharacter) (t : ℝ) : ℤ := ∑ᶠ z, divisor χ.L (closedBall (characterZeroCenter t) (13 / 8 : ℝ)) z end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroMultiplicity -/ namespace OAI /- # Actual analytic multiplicities of character zeros The divisor on the whole plane is used consistently, so local disk counts and later sums over finitely many zeros count the same multiplicities. -/ namespace Ostmann open Metric Set MeromorphicOn open scoped BigOperators Classical theorem PrimitiveComplexCharacter.L_analytic (χ : PrimitiveComplexCharacter) (z : ℂ) : AnalyticAt ℂ χ.L z := by let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ exact (DirichletCharacter.differentiable_LFunction χ.nontrivial).analyticAt z end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroCover -/ namespace OAI /- # Covering the right critical half-strip by Jensen disks -/ namespace Ostmann open Metric Set open scoped BigOperators Classical end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.ZeroDensity.CharacterRightZeroCount -/ namespace OAI /- # Quantitative zero count in the right half of the critical strip -/ namespace Ostmann open Metric Set open scoped BigOperators Classical end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroCountRate -/ namespace OAI /- # Standard conductor-height form of the right-half zero count -/ namespace Ostmann open scoped BigOperators end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.Characters.CharacterFunctionalEquation -/ namespace OAI /- # Reflection of actual character-zero multiplicities The library functional equation for the completed L-function is combined with the nonvanishing reciprocal Gamma factor inside the critical strip. -/ namespace Ostmann open Filter Set open scoped Topology noncomputable def PrimitiveComplexCharacter.inverse (χ : PrimitiveComplexCharacter) : PrimitiveComplexCharacter := by let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ exact { modulus := χ.modulus positive := χ.positive character := χ.character⁻¹ primitive := by simpa only [DirichletCharacter.isPrimitive_def, DirichletCharacter.conductor_inv] using χ.primitive nontrivial := inv_ne_one.mpr χ.nontrivial } noncomputable def PrimitiveComplexCharacter.completed (χ : PrimitiveComplexCharacter) : ℂ → ℂ := @DirichletCharacter.completedLFunction χ.modulus ⟨χ.positive.ne'⟩ χ.character end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.ZeroDensity.CharacterZeroReflection -/ namespace OAI /- # Functional-equation symmetry preserves zero multiplicity -/ namespace Ostmann open Filter Set open scoped Topology end Ostmann end OAI /- Source module: OAI.NumberTheory.Ostmann.ZeroDensity.CharacterFullZeroCount -/ namespace OAI /- # Ordinary zero-count bound, with analytic multiplicities -/ namespace Ostmann open Set open scoped BigOperators Classical end Ostmann end OAI /- Numerical scheduling lemmas used by the actual seven-eighths nonvanishing proof. Extracted from openai/openai-math, commit adc7f1241b42e322a6451854ab7e4b4c146bf78a: OAI/NumberTheory/DirichletL/Moments/FirstSecondLossParameters.lean OAI/NumberTheory/DirichletL/Moments/SuccessorPaidParameters.lean OAI/NumberTheory/DirichletL/Energy/WidthSchedule.lean Source license: Apache-2.0. The numerical statements and proofs are unchanged except for lexical spacing; unrelated imports and the final live-capacity theorem are omitted. -/ namespace OAI noncomputable section open scoped Classical BigOperators namespace SevenEighths.CenteredMomentFirstSecondLossParameters def depth (Mcap σ:ℝ):ℕ:=⌈2*Mcap/σ⌉₊+1 lemma depth_covers (Mcap σ:ℝ)(hσ:0 < σ):Mcap < (depth Mcap σ:ℝ)*σ/2 := by have hh:=Nat.le_ceil (2*Mcap/σ) have hn:2*Mcap ≤ (⌈2*Mcap/σ⌉₊:ℝ)*σ:=(div_le_iff₀ hσ).mp hh simp only [depth,Nat.cast_add,Nat.cast_one] nlinarith end SevenEighths.CenteredMomentFirstSecondLossParameters namespace SevenEighths.CenteredMomentSuccessorPaidParameters def edge (epsChild epsRemove delta epsilon delta1 delta2 theta kappa mesh : ℝ) : ℝ := epsChild+epsRemove+2*delta+epsilon+delta2+delta1/6+kappa*mesh+7*theta/3 def exceptional (sigma deltafr epsilon delta B theta : ℝ) : ℝ := 3*sigma+5*deltafr/6+2*epsilon+2*delta+2*(5*B+1)*theta lemma mesh_cost (kappa reserve : ℝ) (hk : 0 ≤ kappa) (hr : 0 ≤ reserve) : kappa*(reserve/(kappa+1)) ≤ reserve := by rw [←mul_div_assoc] apply (div_le_iff₀ (by positivity : 0 < kappa+1)).mpr nlinarith end SevenEighths.CenteredMomentSuccessorPaidParameters namespace SevenEighths.CenteredMomentEnergyWidthSchedule open CenteredMomentSuccessorPaidParameters CenteredMomentFirstSecondLossParameters def amplification (ε:ℝ):ℝ := min 1 (ε/16000) def count (M ε:ℝ):ℕ := depth M (amplification ε) def scale (M B ε:ℝ):ℝ := (count M ε:ℝ)+M+10*B+30 def reserve (M B ε:ℝ):ℝ := min (amplification ε/100) (ε/(1000000*scale M B ε)) def mesh (M B κ ε:ℝ):ℝ := reserve M B ε/(κ+1) def width (M B ε:ℝ)(k:ℕ):ℝ := reserve M B ε/16+(k:ℝ)*amplification ε/2 def loss (M B ε:ℝ)(k:ℕ):ℝ := reserve M B ε+64*(k:ℝ)*reserve M B ε theorem bounds (M B κ ε:ℝ)(hM:0 ≤ M)(hB:0 ≤ B)(hκ:0 ≤ κ)(hε:0 < ε): 0 < amplification ε ∧ amplification ε ≤ 1 ∧ amplification ε ≤ ε/16000 ∧ 0 < reserve M B ε ∧ 0 < mesh M B κ ε ∧ mesh M B κ ε ≤ reserve M B ε ∧ κ*mesh M B κ ε ≤ reserve M B ε ∧ 20*reserve M B ε ≤ amplification ε/2 ∧ M < width M B ε (count M ε) ∧ loss M B ε (count M ε) ≤ ε/1000 :=by have hs:0 < amplification ε:=lt_min (by norm_num) (by positivity) have hs1:amplification ε ≤ 1:=min_le_left _ _ have hse:amplification ε ≤ ε/16000:=min_le_right _ _ have hn:0 ≤ (count M ε:ℝ):=Nat.cast_nonneg _ have hL:0 < scale M B ε:=by unfold scale;positivity have hr:0 < reserve M B ε:=lt_min (by positivity) (by positivity) have hrs:reserve M B ε ≤ amplification ε/100:=min_le_left _ _ have hre:reserve M B ε ≤ ε/(1000000*scale M B ε):=min_le_right _ _ have hp:reserve M B ε*(1000000*scale M B ε) ≤ ε:= (le_div_iff₀ (by positivity)).mp hre have hnL:(count M ε:ℝ) ≤ scale M B ε:=by unfold scale;linarith have h1L:1 ≤ scale M B ε:=by unfold scale;linarith have hnR:(count M ε:ℝ)*reserve M B ε ≤ ε/1000000:=by have hh:=mul_le_mul_of_nonneg_right hnL hr.le nlinarith have hR:reserve M B ε ≤ ε/1000000:=by have hh:=mul_le_mul_of_nonneg_right h1L hr.le nlinarith have hm:0 < mesh M B κ ε:=by unfold mesh;positivity have hmr:mesh M B κ ε ≤ reserve M B ε:=by unfold mesh apply (div_le_iff₀ (by positivity)).mpr nlinarith have hkm:κ*mesh M B κ ε ≤ reserve M B ε:=mesh_cost κ _ hκ hr.le have hw:M < width M B ε (count M ε):=by have hd:=depth_covers M (amplification ε) hs change M < (count M ε:ℝ)*amplification ε/2 at hd unfold width linarith refine ⟨hs,hs1,hse,hr,hm,hmr,hkm,by linarith,hw,?_⟩ unfold loss linarith end SevenEighths.CenteredMomentEnergyWidthSchedule end end OAI /- Riesz/Perron contour argument adapted from OpenAI math, Apache-2.0, commit adc7f1241b42e322a6451854ab7e4b4c146bf78a. Only the components needed for the ordinary zero-free rectangle estimate are retained. Local simp and fun_prop attributes are replaced by explicit arguments. -/ /- Source: ZeroDensity/RieszMellinKernel -/ namespace OAI /- # A single integral of the Chebyshev sum The continuous weight max(1-u,0) has Mellin transform 1/(s(s+1)). This is the one-sided smoothing needed to recover the sharp progression count. -/ namespace Ostmann open Complex MeasureTheory Set noncomputable def rieszPrimeTest (u : ℝ) : ℂ := (max (1 - u) 0 : ℝ) noncomputable def rieszMellinKernel (s : ℂ) : ℂ := 1 / (s * (s + 1)) theorem rieszPrimeTest_continuous : Continuous rieszPrimeTest := by unfold rieszPrimeTest fun_prop theorem rieszPrimeTest_hasMellin (s : ℂ) (hs : 0 < s.re) : HasMellin rieszPrimeTest s (rieszMellinKernel s) := by let f : ℝ → ℂ := indicator (Ioc 0 1) (fun _ => 1) let g : ℝ → ℂ := indicator (Ioc 0 1) (fun u => (u : ℂ) ^ (1 : ℂ)) have hf : HasMellin f s (1 / s) := hasMellin_one_Ioc hs have hg : HasMellin g s (1 / (s + 1)) := hasMellin_cpow_Ioc 1 (by simpa using (show 0 < s.re + 1 by linarith)) have hsub := hasMellin_sub hf.1 hg.1 rw [hf.2, hg.2] at hsub have heq : EqOn (fun u => f u - g u) rieszPrimeTest (Ioi 0) := by intro u hu change 0 < u at hu by_cases hle : u ≤ 1 · have hm : u ∈ Ioc (0 : ℝ) 1 := ⟨hu, hle⟩ simp [f, g, hm, rieszPrimeTest, max_eq_left (sub_nonneg.mpr hle), Complex.ofReal_sub] · have hn : u ∉ Ioc (0 : ℝ) 1 := fun h => hle h.2 simp [f, g, indicator_of_notMem hn, rieszPrimeTest, max_eq_right (by linarith : 1 - u ≤ 0)] refine ⟨hsub.1.congr_fun (fun u hu => congrArg (fun a : ℂ => (u : ℂ) ^ (s - 1) • a) (heq hu)) measurableSet_Ioi, ?_⟩ have hi : mellin rieszPrimeTest s = mellin (fun u => f u - g u) s := by apply setIntegral_congr_fun measurableSet_Ioi intro u hu exact congrArg (fun a : ℂ => (u : ℂ) ^ (s - 1) • a) (heq hu).symm rw [hi, hsub.2] have hsn : s ≠ 0 := by intro h; simp [h] at hs have hs1 : s + 1 ≠ 0 := by intro h have hh := congrArg Complex.re h simp only [Complex.add_re, Complex.one_re, Complex.zero_re] at hh linarith dsimp [rieszMellinKernel] field_simp ring theorem rieszMellinKernel_line_bound (σ t : ℝ) (hσ : 1 ≤ σ) : ‖rieszMellinKernel ((σ : ℂ) + (t : ℂ) * I)‖ ≤ 4 * (1 + |t|) ^ (-(2 : ℝ)) := by let s : ℂ := (σ : ℂ) + (t : ℂ) * I have hsre : s.re = σ := by simp [s] have hsim : s.im = t := by simp [s] have h1 : 1 ≤ ‖s‖ := by linarith [Complex.re_le_norm s] have h2 : 1 ≤ ‖s + 1‖ := by have hh := Complex.re_le_norm (s + 1) simp only [Complex.add_re, Complex.one_re, hsre] at hh linarith have ht1 : |t| ≤ ‖s‖ := by simpa only [hsim] using Complex.abs_im_le_norm s have ht2 : |t| ≤ ‖s + 1‖ := by simpa [hsim] using Complex.abs_im_le_norm (s + 1) have ha : 0 < 1 + |t| := by positivity have hp : (1 + |t|) ^ 2 ≤ 4 * (‖s‖ * ‖s + 1‖) := by have hh := mul_le_mul (show 1 + |t| ≤ 2 * ‖s‖ by linarith) (show 1 + |t| ≤ 2 * ‖s + 1‖ by linarith) (by positivity) (by positivity) nlinarith change ‖1 / (s * (s + 1))‖ ≤ _ rw [norm_div, norm_one, norm_mul, Real.rpow_neg (by positivity : 0 ≤ 1 + |t|), Real.rpow_two] rw [← div_eq_mul_inv] apply (div_le_div_iff₀ (by positivity : 0 < ‖s‖ * ‖s + 1‖) (sq_pos_of_pos ha)).mpr nlinarith end Ostmann end OAI /- Source: ZeroDensity/RieszMellinInversion -/ namespace OAI /- # Mellin inversion for the one-sided Riesz weight -/ namespace Ostmann open Complex MeasureTheory theorem rieszMellinKernel_verticalIntegrable (σ : ℝ) (hσ : 1 ≤ σ) : Complex.VerticalIntegrable rieszMellinKernel σ := by have hmajor : Integrable (fun t : ℝ => 4 * (1 + ‖t‖) ^ (-(2 : ℝ))) := (integrable_one_add_norm (E := ℝ) (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 2)).const_mul 4 have hc : Continuous (fun t : ℝ => rieszMellinKernel ((σ : ℂ) + (t : ℂ) * I)) := by unfold rieszMellinKernel apply continuous_const.div · fun_prop · intro t apply mul_ne_zero · intro h have hh := congrArg Complex.re h simp at hh linarith · intro h have hh := congrArg Complex.re h simp at hh linarith apply hmajor.mono' hc.aestronglyMeasurable filter_upwards with t simpa only [Real.norm_eq_abs] using rieszMellinKernel_line_bound σ t hσ theorem rieszPrimeTest_mellin_inversion (σ x : ℝ) (hσ : 1 ≤ σ) (hx : 0 < x) : mellinInv σ rieszMellinKernel x = rieszPrimeTest x := by have hσp : 0 < σ := by linarith have hF : Complex.VerticalIntegrable (mellin rieszPrimeTest) σ := by have hfun : (fun t : ℝ => mellin rieszPrimeTest ((σ : ℂ) + (t : ℂ) * I)) = (fun t : ℝ => rieszMellinKernel ((σ : ℂ) + (t : ℂ) * I)) := by funext t exact (rieszPrimeTest_hasMellin _ (by simpa using hσp)).2 change Integrable (fun t : ℝ => mellin rieszPrimeTest ((σ : ℂ) + (t : ℂ) * I)) rw [hfun] exact rieszMellinKernel_verticalIntegrable σ hσ have hi := mellinInv_mellin_eq σ rieszPrimeTest hx (rieszPrimeTest_hasMellin (σ : ℂ) hσp).1 hF rieszPrimeTest_continuous.continuousAt rw [← hi] unfold mellinInv congr 1 apply integral_congr_ae filter_upwards with t rw [(rieszPrimeTest_hasMellin ((σ : ℂ) + (t : ℂ) * I) (by simpa using hσp)).2] end Ostmann end OAI /- Source: ZeroDensity/SmoothVerticalKernel -/ namespace OAI.Ostmann open Complex MeasureTheory Set open scoped BigOperators Interval noncomputable def characterMangoldtCoefficient (χ : PrimitiveComplexCharacter) (n : ℕ) : ℂ := χ.character (n : ZMod χ.modulus) * (ArithmeticFunction.vonMangoldt n : ℂ) end OAI.Ostmann /- Source: ZeroDensity/SmoothDirichletIntegral -/ namespace OAI.Ostmann open Complex MeasureTheory Set open scoped BigOperators Interval theorem PrimitiveComplexCharacter.mangoldt_LSeries_eq (χ : PrimitiveComplexCharacter) (s : ℂ) (hs : 1 < s.re) : LSeries (characterMangoldtCoefficient χ) s = -deriv χ.L s / χ.L s := by let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ change LSeries (characterMangoldtCoefficient χ) s = -deriv (DirichletCharacter.LFunction χ.character) s / DirichletCharacter.LFunction χ.character s rw [DirichletCharacter.deriv_LFunction_eq_deriv_LSeries χ.character hs, DirichletCharacter.LFunction_eq_LSeries χ.character hs] exact DirichletCharacter.LSeries_twist_vonMangoldt_eq χ.character hs end OAI.Ostmann /- Source: ZeroDensity/CharacterContourZeros -/ namespace OAI.Ostmann open Complex MeasureTheory Set open scoped BigOperators Interval theorem PrimitiveComplexCharacter.L_ne_zero_one_le_re (χ : PrimitiveComplexCharacter) (z : ℂ) (hz : 1 ≤ z.re) : χ.L z ≠ 0 := by let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ exact DirichletCharacter.LFunction_ne_zero_of_one_le_re χ.character (.inl χ.nontrivial) hz end OAI.Ostmann /- Source: ZeroDensity/RieszVerticalWeight -/ namespace OAI /- # The absolutely convergent Riesz contour weight -/ namespace Ostmann open Complex MeasureTheory noncomputable def rieszMellinLine (σ t : ℝ) : ℂ := (σ : ℂ) + (t : ℂ) * I theorem rieszMellinLine_re (σ t : ℝ) : (rieszMellinLine σ t).re = σ := by simp [rieszMellinLine] theorem rieszMellinLine_continuous (σ : ℝ) : Continuous (rieszMellinLine σ) := by unfold rieszMellinLine fun_prop theorem rieszMellinKernel_analyticAt_pos (s : ℂ) (hs : 0 < s.re) : AnalyticAt ℂ rieszMellinKernel s := by apply analyticAt_const.div (analyticAt_id.mul (analyticAt_id.add analyticAt_const)) apply mul_ne_zero · intro h change s = 0 at h simp [h] at hs · intro h change s + 1 = 0 at h have hh := congrArg Complex.re h simp only [Complex.add_re, Complex.one_re, Complex.zero_re] at hh linarith noncomputable def rieszVerticalWeight (X σ t : ℝ) : ℂ := (X : ℂ) ^ rieszMellinLine σ t * rieszMellinKernel (rieszMellinLine σ t) theorem rieszVerticalWeight_continuous (X σ : ℝ) (hX : 0 < X) (hσ : 0 < σ) : Continuous (rieszVerticalWeight X σ) := by apply Continuous.mul · exact (rieszMellinLine_continuous σ).const_cpow (.inl (by exact_mod_cast hX.ne')) · apply continuous_iff_continuousAt.mpr intro t exact ((rieszMellinKernel_analyticAt_pos _ (by simpa [rieszMellinLine] using hσ)).continuousAt).comp (rieszMellinLine_continuous σ).continuousAt theorem rieszVerticalWeight_norm (X σ t : ℝ) (hX : 0 < X) : ‖rieszVerticalWeight X σ t‖ = X ^ σ * ‖rieszMellinKernel (rieszMellinLine σ t)‖ := by rw [rieszVerticalWeight, norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hX, rieszMellinLine_re] theorem rieszVerticalWeight_integrable (X σ : ℝ) (hX : 0 < X) (hσ : 1 ≤ σ) : Integrable (rieszVerticalWeight X σ) := by have hk : Integrable (fun t => rieszMellinKernel (rieszMellinLine σ t)) := rieszMellinKernel_verticalIntegrable σ hσ apply (hk.norm.const_mul (X ^ σ)).mono' (rieszVerticalWeight_continuous X σ hX (by linarith)).aestronglyMeasurable exact Filter.Eventually.of_forall (fun t => (rieszVerticalWeight_norm X σ t hX).le) theorem characterMangoldt_riesz_term_norm (χ : PrimitiveComplexCharacter) (σ t : ℝ) (n : ℕ) : ‖LSeries.term (characterMangoldtCoefficient χ) (rieszMellinLine σ t) n‖ = ‖LSeries.term (characterMangoldtCoefficient χ) (σ : ℂ) n‖ := by simp [LSeries.norm_term_eq, rieszMellinLine] theorem characterMangoldt_riesz_term_continuous (χ : PrimitiveComplexCharacter) (σ : ℝ) (n : ℕ) : Continuous (fun t => LSeries.term (characterMangoldtCoefficient χ) (rieszMellinLine σ t) n) := by by_cases hn : n = 0 · subst n simp only [LSeries.term_zero] exact continuous_const · simp only [LSeries.term_of_ne_zero hn] exact continuous_const.div ((rieszMellinLine_continuous σ).const_cpow (.inl (by exact_mod_cast hn))) (fun _ => Complex.cpow_ne_zero_iff.mpr (.inl (by exact_mod_cast hn))) end Ostmann end OAI /- Source: ZeroDensity/RieszDirichletIntegral -/ namespace OAI /- # The exact starting contour for the integrated Chebyshev sum -/ namespace Ostmann open Complex MeasureTheory open scoped BigOperators noncomputable def characterRieszMean (χ : PrimitiveComplexCharacter) (X : ℝ) : ℂ := ∑' n : ℕ, characterMangoldtCoefficient χ n * rieszPrimeTest (n / X) noncomputable def characterRieszVerticalTerm (χ : PrimitiveComplexCharacter) (X σ : ℝ) (n : ℕ) (t : ℝ) : ℂ := LSeries.term (characterMangoldtCoefficient χ) (rieszMellinLine σ t) n * rieszVerticalWeight X σ t theorem characterRieszVerticalTerm_norm (χ : PrimitiveComplexCharacter) (X σ : ℝ) (n : ℕ) (t : ℝ) : ‖characterRieszVerticalTerm χ X σ n t‖ = ‖LSeries.term (characterMangoldtCoefficient χ) (σ : ℂ) n‖ * ‖rieszVerticalWeight X σ t‖ := by rw [characterRieszVerticalTerm, norm_mul, characterMangoldt_riesz_term_norm] theorem characterRieszVerticalTerm_integrable (χ : PrimitiveComplexCharacter) (X σ : ℝ) (hX : 0 < X) (hσ : 1 ≤ σ) (n : ℕ) : Integrable (characterRieszVerticalTerm χ X σ n) := by apply ((rieszVerticalWeight_integrable X σ hX hσ).norm.const_mul ‖LSeries.term (characterMangoldtCoefficient χ) (σ : ℂ) n‖).mono' · exact ((characterMangoldt_riesz_term_continuous χ σ n).mul (rieszVerticalWeight_continuous X σ hX (by linarith))).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun t => (characterRieszVerticalTerm_norm χ X σ n t).le) theorem characterRieszVerticalTerm_summable_norm (χ : PrimitiveComplexCharacter) (X σ : ℝ) (hσ : 1 < σ) : Summable (fun n => ∫ t : ℝ, ‖characterRieszVerticalTerm χ X σ n t‖) := by have hsum : LSeriesSummable (characterMangoldtCoefficient χ) (σ : ℂ) := DirichletCharacter.LSeriesSummable_twist_vonMangoldt χ.character (by simpa [rieszMellinLine] using hσ) have hs := hsum.norm.mul_right (∫ t : ℝ, ‖rieszVerticalWeight X σ t‖) apply hs.congr intro n simp only [characterRieszVerticalTerm_norm, integral_const_mul] theorem characterMangoldt_riesz_term_inversion (χ : PrimitiveComplexCharacter) (X σ : ℝ) (hX : 0 < X) (hσ : 1 ≤ σ) (n : ℕ) : ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, characterRieszVerticalTerm χ X σ n t) = characterMangoldtCoefficient χ n * rieszPrimeTest (n / X) := by by_cases hn : n = 0 · subst n simp [characterRieszVerticalTerm, characterMangoldtCoefficient] have hnR : 0 < (n : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero hn have hkernel (t : ℝ) : characterRieszVerticalTerm χ X σ n t = characterMangoldtCoefficient χ n * (((n : ℝ) / X : ℝ) : ℂ) ^ (-rieszMellinLine σ t) * rieszMellinKernel (rieszMellinLine σ t) := by rw [characterRieszVerticalTerm, LSeries.term_of_ne_zero hn, rieszVerticalWeight, Complex.cpow_neg, Complex.ofReal_div, Complex.div_cpow_ofReal_nonneg hnR.le hX.le, inv_div] push_cast ring simp_rw [hkernel, mul_assoc] rw [integral_const_mul] have hinv := rieszPrimeTest_mellin_inversion σ ((n : ℝ) / X) hσ (div_pos hnR hX) change ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, (((n : ℝ) / X : ℝ) : ℂ) ^ (-rieszMellinLine σ t) * rieszMellinKernel (rieszMellinLine σ t)) = _ at hinv rw [← hinv] ring theorem characterRieszMean_eq_vertical_logDerivative (χ : PrimitiveComplexCharacter) (X σ : ℝ) (hX : 0 < X) (hσ : 1 < σ) : characterRieszMean χ X = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, (-logDeriv χ.L (rieszMellinLine σ t)) * rieszVerticalWeight X σ t := by unfold characterRieszMean calc _ = ∑' n : ℕ, ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, characterRieszVerticalTerm χ X σ n t := tsum_congr (fun n => (characterMangoldt_riesz_term_inversion χ X σ hX hσ.le n).symm) _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∑' n : ℕ, ∫ t : ℝ, characterRieszVerticalTerm χ X σ n t := tsum_mul_left _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, ∑' n : ℕ, characterRieszVerticalTerm χ X σ n t := by rw [integral_tsum_of_summable_integral_norm (characterRieszVerticalTerm_integrable χ X σ hX hσ.le) (characterRieszVerticalTerm_summable_norm χ X σ hσ)] _ = _ := by congr 1 apply integral_congr_ae filter_upwards with t rw [show (∑' n : ℕ, characterRieszVerticalTerm χ X σ n t) = LSeries (characterMangoldtCoefficient χ) (rieszMellinLine σ t) * rieszVerticalWeight X σ t from tsum_mul_right] rw [χ.mangoldt_LSeries_eq _ (by simpa [rieszMellinLine] using hσ)] simp only [logDeriv_apply, neg_div] end Ostmann end OAI /- Source: ZeroDensity/DirichletLogDerivativeBound -/ namespace OAI /- # A uniform Euler-series bound for real arguments This part uses proved Mathlib theorems only: the continued zeta pole, the Euler logarithmic derivative, and the norm bound for Dirichlet characters. -/ namespace Ostmann open scoped BigOperators ComplexOrder open Complex LSeries theorem residue_one_eq_vonMangoldt : ArithmeticFunction.vonMangoldt.residueClass (0 : ZMod 1) = ArithmeticFunction.vonMangoldt := by funext n simp [ArithmeticFunction.vonMangoldt.residueClass, Subsingleton.elim (n : ZMod 1) 0] theorem exists_vonMangoldt_series_bound : ∃ C : ℝ, 0 < C ∧ ∀ s : ℝ, 1 < s → s ≤ 2 → ‖LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ)‖ ≤ 1 / (s - 1) + C := by let F := ArithmeticFunction.vonMangoldt.LFunctionResidueClassAux (0 : ZMod 1) have hcont : ContinuousOn (fun s : ℝ => F (s : ℂ)) (Set.Icc 1 2) := by apply ArithmeticFunction.vonMangoldt.continuousOn_LFunctionResidueClassAux (0 : ZMod 1) |>.comp Complex.continuous_ofReal.continuousOn intro s hs exact hs.1 obtain ⟨M, hM⟩ := isCompact_Icc.exists_bound_of_continuousOn hcont refine ⟨|M| + 1, by positivity, ?_⟩ intro s hs hs2 have hunit : IsUnit (0 : ZMod 1) := by rw [Subsingleton.elim (0 : ZMod 1) 1] exact isUnit_one have heq := ArithmeticFunction.vonMangoldt.eqOn_LFunctionResidueClassAux hunit (show (s : ℂ) ∈ {z : ℂ | 1 < z.re} by exact hs) rw [residue_one_eq_vonMangoldt] at heq simp only [Nat.totient_one, Nat.cast_one, inv_one] at heq have he : LSeries (fun n => (ArithmeticFunction.vonMangoldt n : ℂ)) (s : ℂ) = F (s : ℂ) + 1 / ((s : ℂ) - 1) := by change F (s : ℂ) = _ at heq rw [heq] ring have hnorm : ‖1 / ((s : ℂ) - 1)‖ = 1 / (s - 1) := by rw [← Complex.ofReal_one, ← Complex.ofReal_sub, ← Complex.ofReal_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (by positivity)] rw [he] have hb := norm_add_le (F (s : ℂ)) (1 / ((s : ℂ) - 1)) rw [hnorm] at hb have hg := hM s ⟨hs.le, hs2⟩ have hMabs := le_abs_self M linarith end Ostmann end OAI /- Source: Characters/CharacterAbsoluteRightBound -/ namespace OAI /- # Absolute Euler-series control on every right-hand vertical line -/ namespace Ostmann open Complex LSeries open scoped ComplexOrder theorem character_logDeriv_right_pole_bound : ∃ C : ℝ, 0 < C ∧ ∀ (χ : PrimitiveComplexCharacter) (s : ℂ), 1 < s.re → s.re ≤ 2 → ‖logDeriv χ.L s‖ ≤ 1 / (s.re - 1) + C := by obtain ⟨C, hC, hb⟩ := exists_vonMangoldt_series_bound refine ⟨C, hC, ?_⟩ intro χ s hs hs2 let a : ℕ → ℂ := fun n => (ArithmeticFunction.vonMangoldt n : ℂ) have ha : LSeriesSummable a (s.re : ℂ) := ArithmeticFunction.LSeriesSummable_vonMangoldt hs have ht : LSeriesSummable (characterMangoldtCoefficient χ) s := DirichletCharacter.LSeriesSummable_twist_vonMangoldt χ.character hs have hsame (n : ℕ) : ‖LSeries.term a s n‖ = ‖LSeries.term a (s.re : ℂ) n‖ := by simp only [LSeries.norm_term_eq, Complex.ofReal_re] have hn (n : ℕ) : ‖LSeries.term (characterMangoldtCoefficient χ) s n‖ ≤ ‖LSeries.term a (s.re : ℂ) n‖ := by rw [← hsame n] apply LSeries.norm_term_le change ‖χ.character (n : ZMod χ.modulus) * a n‖ ≤ ‖a n‖ rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (χ.character.norm_le_one _) have hr (n : ℕ) : ‖LSeries.term a (s.re : ℂ) n‖ = (LSeries.term a (s.re : ℂ) n).re := by have hp : (0 : ℂ) ≤ a n := by change (0 : ℂ) ≤ (ArithmeticFunction.vonMangoldt n : ℂ) exact_mod_cast ArithmeticFunction.vonMangoldt_nonneg (n := n) have hh := congrArg Complex.re (Complex.eq_coe_norm_of_nonneg (LSeries.term_nonneg hp s.re)) simpa only [Complex.ofReal_re] using hh.symm calc _ = ‖LSeries (characterMangoldtCoefficient χ) s‖ := by rw [χ.mangoldt_LSeries_eq s hs, logDeriv_apply, neg_div, norm_neg] _ ≤ ∑' n, ‖LSeries.term (characterMangoldtCoefficient χ) s n‖ := norm_tsum_le_tsum_norm ht.norm _ ≤ ∑' n, ‖LSeries.term a (s.re : ℂ) n‖ := ht.norm.tsum_le_tsum hn ha.norm _ = (LSeries a (s.re : ℂ)).re := by simp_rw [hr]; exact (Complex.re_tsum ha).symm _ ≤ ‖LSeries a (s.re : ℂ)‖ := Complex.re_le_norm _ _ ≤ _ := hb s.re hs hs2 end Ostmann end OAI /- Source: ZeroDensity/RectangleLogIntegrals -/ namespace OAI.Ostmann open Complex MeasureTheory Set open scoped BigOperators Interval noncomputable def rectangleBoundaryIntegral (f : ℂ → ℂ) (a b c d : ℝ) : ℂ := (∫ x in a..b, f (x + c * I)) - (∫ x in a..b, f (x + d * I)) + I * (∫ y in c..d, f (b + y * I)) - I * (∫ y in c..d, f (a + y * I)) end OAI.Ostmann /- Source: ZeroDensity/RectangleGeometry -/ namespace OAI.Ostmann open Complex MeasureTheory Set open scoped BigOperators Interval theorem rectangleBoundaryIntegral_eq_zero {f : ℂ → ℂ} {a b c d : ℝ} (hf : AnalyticOnNhd ℂ f (uIcc a b ×ℂ uIcc c d)) : rectangleBoundaryIntegral f a b c d = 0 := by have h := Complex.integral_boundary_rect_eq_zero_of_differentiableOn f ((a : ℂ) + c * I) ((b : ℂ) + d * I) (by simpa using hf.differentiableOn) simpa [rectangleBoundaryIntegral, smul_eq_mul] using h end OAI.Ostmann /- Source: ZeroDensity/RieszContourRectangle -/ namespace OAI /- # The finite Riesz contour displacement when the rectangle is zero-free -/ namespace Ostmann open Complex Set open scoped Interval noncomputable def rieszContourWeight (X : ℝ) (s : ℂ) : ℂ := (X : ℂ) ^ s * rieszMellinKernel s theorem rieszContourWeight_analyticAt (X : ℝ) (hX : 0 < X) (s : ℂ) (hs : 0 < s.re) : AnalyticAt ℂ (rieszContourWeight X) s := by exact ((differentiable_id.const_cpow (.inl (by exact_mod_cast hX.ne'))).analyticAt s).mul (rieszMellinKernel_analyticAt_pos s hs) theorem rieszContour_rectangle_zero (χ : PrimitiveComplexCharacter) (X : ℝ) (hX : 0 < X) (a b c d : ℝ) (ha : 0 < a) (hab : a ≤ b) (hne : ∀ s ∈ uIcc a b ×ℂ uIcc c d, χ.L s ≠ 0) : rectangleBoundaryIntegral (fun s => -logDeriv χ.L s * rieszContourWeight X s) a b c d = 0 := by apply rectangleBoundaryIntegral_eq_zero intro s hs have hspos : 0 < s.re := ha.trans_le ((uIcc_of_le hab) ▸ hs.1).1 have hl : AnalyticAt ℂ (fun s => -logDeriv χ.L s) s := by exact ((χ.L_analytic s).deriv.div (χ.L_analytic s) (hne s hs)).neg exact hl.mul (rieszContourWeight_analyticAt X hX s hspos) end Ostmann end OAI /- Source: ZeroDensity/RieszTailEstimate -/ namespace OAI /- # Explicit right-contour tails for the Riesz integral -/ namespace Ostmann open Complex MeasureTheory Set theorem rieszMellinKernel_im_bound (s : ℂ) (ht : 0 < |s.im|) : ‖rieszMellinKernel s‖ ≤ 1 / |s.im| ^ 2 := by have hs : 0 < ‖s‖ := ht.trans_le (Complex.abs_im_le_norm s) have hs1 : |s.im| ≤ ‖s + 1‖ := by simpa using Complex.abs_im_le_norm (s + 1) have hprod : |s.im| ^ 2 ≤ ‖s‖ * ‖s + 1‖ := by simpa only [pow_two] using mul_le_mul (Complex.abs_im_le_norm s) hs1 ht.le (norm_nonneg s) rw [rieszMellinKernel, norm_div, norm_one, norm_mul] exact div_le_div_of_nonneg_left zero_le_one (sq_pos_of_pos ht) hprod noncomputable def rightRieszIntegrand (χ : PrimitiveComplexCharacter) (X σ t : ℝ) : ℂ := -logDeriv χ.L (rieszMellinLine σ t) * rieszVerticalWeight X σ t theorem rightRieszIntegrand_tail : ∃ C : ℝ, 0 < C ∧ ∀ (χ : PrimitiveComplexCharacter) (X σ T : ℝ), 0 < X → 1 < σ → σ ≤ 2 → 0 < T → ‖∫ t in Ioi T, rightRieszIntegrand χ X σ t‖ ≤ (1 / (σ - 1) + C) * X ^ σ / T := by obtain ⟨C, hC, hb⟩ := character_logDeriv_right_pole_bound refine ⟨C, hC, ?_⟩ intro χ X σ T hX hσ hσ2 hT let K := (1 / (σ - 1) + C) * X ^ σ have hK : 0 ≤ K := by dsimp [K]; positivity have hg : IntegrableOn (fun t : ℝ => K * t ^ (-(2 : ℝ))) (Ioi T) := (integrableOn_Ioi_rpow_of_lt (by norm_num) hT).const_mul K have hn : ‖∫ t in Ioi T, rightRieszIntegrand χ X σ t‖ ≤ ∫ t in Ioi T, K * t ^ (-(2 : ℝ)) := by apply norm_integral_le_of_norm_le hg filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht have htp : 0 < t := hT.trans ht have hlog := hb χ (rieszMellinLine σ t) (by simpa [rieszMellinLine] using hσ) (by simpa [rieszMellinLine] using hσ2) simp only [rieszMellinLine_re] at hlog have hkernel := rieszMellinKernel_im_bound (rieszMellinLine σ t) (by simpa [rieszMellinLine, abs_of_pos htp] using htp) simp only [rieszMellinLine, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, zero_add, abs_of_pos htp] at hkernel rw [rightRieszIntegrand, norm_mul, norm_neg, rieszVerticalWeight_norm X σ t hX] calc _ ≤ (1 / (σ - 1) + C) * (X ^ σ * (1 / t ^ 2)) := by exact mul_le_mul hlog (mul_le_mul_of_nonneg_left hkernel (Real.rpow_nonneg hX.le _)) (by positivity) (by positivity) _ = K * t ^ (-(2 : ℝ)) := by rw [Real.rpow_neg htp.le, Real.rpow_two] dsimp [K] ring apply hn.trans_eq rw [integral_const_mul, integral_Ioi_rpow_of_lt (by norm_num : -(2 : ℝ) < -1) hT] norm_num only [neg_add_cancel_left, neg_div_neg_eq, div_one, Real.rpow_neg_one] dsimp [K] ring end Ostmann end OAI /- Source: ZeroDensity/RieszNegativeTail -/ namespace OAI /- # The lower right-contour tail -/ namespace Ostmann open Complex MeasureTheory Set theorem rightRieszIntegrand_negative_tail : ∃ C : ℝ, 0 < C ∧ ∀ (χ : PrimitiveComplexCharacter) (X σ T : ℝ), 0 < X → 1 < σ → σ ≤ 2 → 0 < T → ‖∫ t in Iic (-T), rightRieszIntegrand χ X σ t‖ ≤ (1 / (σ - 1) + C) * X ^ σ / T := by obtain ⟨C, hC, hb⟩ := character_logDeriv_right_pole_bound refine ⟨C, hC, ?_⟩ intro χ X σ T hX hσ hσ2 hT rw [← integral_comp_neg_Ioi T (rightRieszIntegrand χ X σ)] let K := (1 / (σ - 1) + C) * X ^ σ have hK : 0 ≤ K := by dsimp [K]; positivity have hg : IntegrableOn (fun t : ℝ => K * t ^ (-(2 : ℝ))) (Ioi T) := (integrableOn_Ioi_rpow_of_lt (by norm_num) hT).const_mul K have hn : ‖∫ t in Ioi T, rightRieszIntegrand χ X σ (-t)‖ ≤ ∫ t in Ioi T, K * t ^ (-(2 : ℝ)) := by apply norm_integral_le_of_norm_le hg filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht have htp : 0 < t := hT.trans ht have hlog := hb χ (rieszMellinLine σ (-t)) (by simpa [rieszMellinLine] using hσ) (by simpa [rieszMellinLine] using hσ2) simp only [rieszMellinLine_re] at hlog have hkernel := rieszMellinKernel_im_bound (rieszMellinLine σ (-t)) (by simpa [rieszMellinLine, abs_neg, abs_of_pos htp] using htp) simp only [rieszMellinLine, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, zero_add, abs_neg, abs_of_pos htp] at hkernel rw [rightRieszIntegrand, norm_mul, norm_neg, rieszVerticalWeight_norm X σ (-t) hX] calc _ ≤ (1 / (σ - 1) + C) * (X ^ σ * (1 / t ^ 2)) := by exact mul_le_mul hlog (mul_le_mul_of_nonneg_left hkernel (Real.rpow_nonneg hX.le _)) (by positivity) (by positivity) _ = K * t ^ (-(2 : ℝ)) := by rw [Real.rpow_neg htp.le, Real.rpow_two] dsimp [K] ring apply hn.trans_eq rw [integral_const_mul, integral_Ioi_rpow_of_lt (by norm_num : -(2 : ℝ) < -1) hT] norm_num only [neg_add_cancel_left, neg_div_neg_eq, div_one, Real.rpow_neg_one] dsimp [K] ring end Ostmann end OAI /- Source: ZeroDensity/RieszHorizontalEstimate -/ namespace OAI /- # Horizontal errors in the finite Riesz contour displacement -/ namespace Ostmann open Complex MeasureTheory Set open scoped Interval theorem riesz_horizontal_segment_bound (χ : PrimitiveComplexCharacter) (X a b t M : ℝ) (hX : 1 ≤ X) (hab : a ≤ b) (ht : 0 < |t|) (hM : 0 ≤ M) (hb : ∀ σ ∈ Icc a b, ‖logDeriv χ.L ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M) : ‖∫ σ in a..b, -logDeriv χ.L ((σ : ℂ) + (t : ℂ) * I) * rieszContourWeight X ((σ : ℂ) + (t : ℂ) * I)‖ ≤ (M * X ^ b / t ^ 2) * (b - a) := by have hXp : 0 < X := by linarith have hpoint : ∀ σ ∈ Ι a b, ‖-logDeriv χ.L ((σ : ℂ) + (t : ℂ) * I) * rieszContourWeight X ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M * X ^ b / t ^ 2 := by intro σ hσ have hσ' : σ ∈ Icc a b := by have hh := uIoc_subset_uIcc hσ rwa [uIcc_of_le hab] at hh have hk := rieszMellinKernel_im_bound ((σ : ℂ) + (t : ℂ) * I) (by simpa using ht) simp only [Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, zero_add, sq_abs] at hk have hx : X ^ σ ≤ X ^ b := Real.rpow_le_rpow_of_exponent_le hX hσ'.2 rw [norm_mul, norm_neg, rieszContourWeight, norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hXp] simp only [Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, mul_zero, Complex.ofReal_im, Complex.I_im, zero_mul, sub_zero, add_zero] have hh := mul_le_mul (hb σ hσ') (mul_le_mul hx hk (norm_nonneg _) (Real.rpow_nonneg hXp.le _)) (by positivity) hM exact hh.trans_eq (by ring) have hi := intervalIntegral.norm_integral_le_of_norm_le_const hpoint simpa only [abs_of_nonneg (sub_nonneg.mpr hab)] using hi theorem rectangle_vertical_shift_norm_bound (f : ℂ → ℂ) (a b c d : ℝ) (hzero : rectangleBoundaryIntegral f a b c d = 0) : ‖∫ y in c..d, f ((b : ℂ) + (y : ℂ) * I)‖ ≤ ‖∫ y in c..d, f ((a : ℂ) + (y : ℂ) * I)‖ + ‖∫ x in a..b, f ((x : ℂ) + (d : ℂ) * I)‖ + ‖∫ x in a..b, f ((x : ℂ) + (c : ℂ) * I)‖ := by let R := ∫ y in c..d, f ((b : ℂ) + (y : ℂ) * I) let L := ∫ y in c..d, f ((a : ℂ) + (y : ℂ) * I) let U := ∫ x in a..b, f ((x : ℂ) + (d : ℂ) * I) let D := ∫ x in a..b, f ((x : ℂ) + (c : ℂ) * I) have he : I * R = I * L + U - D := by dsimp [rectangleBoundaryIntegral] at hzero dsimp [R, L, U, D] linear_combination hzero change ‖R‖ ≤ ‖L‖ + ‖U‖ + ‖D‖ calc ‖R‖ = ‖I * R‖ := by rw [norm_mul, Complex.norm_I, one_mul] _ = ‖I * L + U - D‖ := by rw [he] _ ≤ ‖I * L + U‖ + ‖D‖ := norm_sub_le _ _ _ ≤ (‖I * L‖ + ‖U‖) + ‖D‖ := add_le_add (norm_add_le _ _) le_rfl _ = _ := by rw [norm_mul, Complex.norm_I, one_mul] end Ostmann end OAI /- Source: ZeroDensity/RieszTruncation -/ namespace OAI /- # The exact finite-rectangle truncation of the Riesz integral -/ namespace Ostmann open Complex MeasureTheory Set open scoped Interval theorem rightRieszIntegrand_integrable (χ : PrimitiveComplexCharacter) (X b : ℝ) (hX : 0 < X) (hb : 1 < b) (hb2 : b ≤ 2) : Integrable (rightRieszIntegrand χ X b) := by obtain ⟨C, hC, hbound⟩ := character_logDeriv_right_pole_bound have hcL : Continuous χ.L := continuous_iff_continuousAt.mpr (fun s => (χ.L_analytic s).continuousAt) have hcD : Continuous (deriv χ.L) := continuous_iff_continuousAt.mpr (fun s => (χ.L_analytic s).deriv.continuousAt) have hn (t : ℝ) : χ.L (rieszMellinLine b t) ≠ 0 := χ.L_ne_zero_one_le_re _ (by simpa [rieszMellinLine] using hb.le) have hcont : Continuous (rightRieszIntegrand χ X b) := by change Continuous (fun t => -(deriv χ.L (rieszMellinLine b t) / χ.L (rieszMellinLine b t)) * rieszVerticalWeight X b t) exact ((hcD.comp (rieszMellinLine_continuous b)).div (hcL.comp (rieszMellinLine_continuous b)) hn).neg.mul (rieszVerticalWeight_continuous X b hX (by linarith)) apply ((rieszVerticalWeight_integrable X b hX hb.le).norm.const_mul (1 / (b - 1) + C)).mono' hcont.aestronglyMeasurable filter_upwards with t rw [rightRieszIntegrand, norm_mul, norm_neg] apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) simpa only [rieszMellinLine_re] using hbound χ (rieszMellinLine b t) (by simpa [rieszMellinLine] using hb) (by simpa [rieszMellinLine] using hb2) theorem integral_three_parts (f : ℝ → ℂ) (hf : Integrable f) (T : ℝ) : (∫ t : ℝ, f t) = (∫ t in Iic (-T), f t) + (∫ t in -T..T, f t) + (∫ t in Ioi T, f t) := by have hfull := intervalIntegral.integral_Iic_add_Ioi (b := T) hf.integrableOn hf.integrableOn have hseg := intervalIntegral.integral_Iic_sub_Iic (a := -T) (b := T) hf.integrableOn hf.integrableOn linear_combination hseg - hfull theorem characterRieszMean_truncation : ∃ C : ℝ, 0 < C ∧ ∀ (χ : PrimitiveComplexCharacter) (X b T : ℝ), 0 < X → 1 < b → b ≤ 2 → 0 < T → ‖characterRieszMean χ X‖ ≤ ‖∫ t in -T..T, rightRieszIntegrand χ X b t‖ + 2 * (1 / (b - 1) + C) * X ^ b / T := by obtain ⟨C1, hC1, hpos⟩ := rightRieszIntegrand_tail obtain ⟨C2, hC2, hneg⟩ := rightRieszIntegrand_negative_tail refine ⟨C1 + C2, by positivity, ?_⟩ intro χ X b T hX hb hb2 hT have hp := hpos χ X b T hX hb hb2 hT have hn := hneg χ X b T hX hb hb2 hT have hf := rightRieszIntegrand_integrable χ X b hX hb hb2 have hnorm : ‖characterRieszMean χ X‖ ≤ ‖∫ t : ℝ, rightRieszIntegrand χ X b t‖ := by rw [characterRieszMean_eq_vertical_logDerivative χ X b hX hb, norm_mul] have hc : ‖((1 / (2 * Real.pi) : ℝ) : ℂ)‖ ≤ 1 := by rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (by positivity)] exact (div_le_one (by positivity : 0 < 2 * Real.pi)).mpr (by linarith [Real.pi_gt_three]) exact mul_le_of_le_one_left (norm_nonneg _) hc have hsum : ‖∫ t : ℝ, rightRieszIntegrand χ X b t‖ ≤ ‖∫ t in Iic (-T), rightRieszIntegrand χ X b t‖ + ‖∫ t in -T..T, rightRieszIntegrand χ X b t‖ + ‖∫ t in Ioi T, rightRieszIntegrand χ X b t‖ := by rw [integral_three_parts _ hf T] exact (norm_add_le _ _).trans (add_le_add (norm_add_le _ _) le_rfl) have hbase : 0 ≤ X ^ b / T := div_nonneg (Real.rpow_nonneg hX.le _) hT.le have hslack := mul_nonneg (show 0 ≤ C1 + C2 by positivity) hbase calc _ ≤ ‖∫ t in Iic (-T), rightRieszIntegrand χ X b t‖ + ‖∫ t in -T..T, rightRieszIntegrand χ X b t‖ + ‖∫ t in Ioi T, rightRieszIntegrand χ X b t‖ := hnorm.trans hsum _ ≤ ((1 / (b - 1) + C2) * X ^ b / T) + ‖∫ t in -T..T, rightRieszIntegrand χ X b t‖ + ((1 / (b - 1) + C1) * X ^ b / T) := add_le_add (add_le_add hn le_rfl) hp _ ≤ _ := by apply sub_nonneg.mp calc 0 ≤ (C1 + C2) * (X ^ b / T) := hslack _ = _ := by ring end Ostmann end OAI /- Source: ZeroDensity/RieszLeftEstimate -/ namespace OAI /- # The bounded left vertical segment of the Riesz contour -/ namespace Ostmann open Complex MeasureTheory Set noncomputable def rieszLineMajorant (t : ℝ) : ℝ := 9 * (1 + |t|) ^ (-(2 : ℝ)) theorem rieszLineMajorant_nonneg (t : ℝ) : 0 ≤ rieszLineMajorant t := by unfold rieszLineMajorant positivity theorem rieszLineMajorant_integrable : Integrable rieszLineMajorant := by have hp : Integrable (fun t : ℝ => (1 + ‖t‖) ^ (-(2 : ℝ))) := integrable_one_add_norm (μ := volume) (E := ℝ) (by norm_num : (Module.finrank ℝ ℝ : ℝ) < 2) change Integrable (fun t : ℝ => 9 * (1 + |t|) ^ (-(2 : ℝ))) simpa only [Real.norm_eq_abs] using hp.const_mul 9 theorem rieszMellinKernel_half_strip (s : ℂ) (hs : 1 / 2 ≤ s.re) : ‖rieszMellinKernel s‖ ≤ rieszLineMajorant s.im := by have h1 : 1 ≤ 2 * ‖s‖ := by linarith [Complex.re_le_norm s] have h2 : 1 ≤ 2 * ‖s + 1‖ := by have hh := Complex.re_le_norm (s + 1) simp only [Complex.add_re, Complex.one_re] at hh linarith have hsp : 0 < ‖s‖ := by linarith have hsp1 : 0 < ‖s + 1‖ := by linarith have ht1 := Complex.abs_im_le_norm s have ht2 : |s.im| ≤ ‖s + 1‖ := by simpa using Complex.abs_im_le_norm (s + 1) have ha : 0 < 1 + |s.im| := by positivity have hp : (1 + |s.im|) ^ 2 ≤ 9 * (‖s‖ * ‖s + 1‖) := by have hh := mul_le_mul (show 1 + |s.im| ≤ 3 * ‖s‖ by linarith) (show 1 + |s.im| ≤ 3 * ‖s + 1‖ by linarith) (by positivity) (by positivity) nlinarith rw [rieszMellinKernel, norm_div, norm_one, norm_mul, rieszLineMajorant, Real.rpow_neg (by positivity : 0 ≤ 1 + |s.im|), Real.rpow_two, ← div_eq_mul_inv] apply (div_le_div_iff₀ (by positivity : 0 < ‖s‖ * ‖s + 1‖) (sq_pos_of_pos ha)).mpr nlinarith theorem leftRieszIntegrand_segment_bound : ∃ K : ℝ, 0 < K ∧ ∀ (χ : PrimitiveComplexCharacter) (X a T M : ℝ), 0 < X → 1 / 2 ≤ a → 0 ≤ M → (∀ t ∈ Icc (-T) T, ‖logDeriv χ.L (rieszMellinLine a t)‖ ≤ M) → ‖∫ t in Icc (-T) T, rightRieszIntegrand χ X a t‖ ≤ K * M * X ^ a := by let J := ∫ t : ℝ, rieszLineMajorant t have hJ : 0 ≤ J := integral_nonneg rieszLineMajorant_nonneg refine ⟨J + 1, by linarith, ?_⟩ intro χ X a T M hX ha hM hb have hg : Integrable (fun t : ℝ => (M * X ^ a) * rieszLineMajorant t) := rieszLineMajorant_integrable.const_mul _ have hnorm : ‖∫ t in Icc (-T) T, rightRieszIntegrand χ X a t‖ ≤ ∫ t in Icc (-T) T, (M * X ^ a) * rieszLineMajorant t := by apply norm_integral_le_of_norm_le hg.integrableOn filter_upwards [ae_restrict_mem measurableSet_Icc] with t ht have hk := rieszMellinKernel_half_strip (rieszMellinLine a t) (by simpa [rieszMellinLine] using ha) simp only [rieszMellinLine, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, zero_add] at hk rw [rightRieszIntegrand, norm_mul, norm_neg, rieszVerticalWeight_norm X a t hX] have hh := mul_le_mul (hb t ht) (mul_le_mul_of_nonneg_left hk (Real.rpow_nonneg hX.le a)) (by positivity) hM exact hh.trans_eq (by ring) have hfull := setIntegral_le_integral hg (Filter.Eventually.of_forall (fun t => mul_nonneg (by positivity) (rieszLineMajorant_nonneg t))) (s := Icc (-T) T) simp only [integral_const_mul] at hnorm hfull apply (hnorm.trans hfull).trans dsimp only [J] at hJ ⊢ nlinarith [mul_nonneg hM (Real.rpow_nonneg hX.le a)] end Ostmann end OAI /- Source: ZeroDensity/RieszRectangleBound -/ namespace OAI /- # A quantitative Riesz estimate from a zero-free rectangle -/ namespace Ostmann open Complex MeasureTheory Set open scoped Interval theorem characterRieszMean_rectangle_bound : ∃ K C : ℝ, 0 < K ∧ 0 < C ∧ ∀ (χ : PrimitiveComplexCharacter) (X a b T M : ℝ), 1 ≤ X → 1 / 2 ≤ a → a ≤ b → 1 < b → b ≤ 2 → 0 < T → 0 ≤ M → (∀ z ∈ uIcc a b ×ℂ uIcc (-T) T, χ.L z ≠ 0) → (∀ z ∈ uIcc a b ×ℂ uIcc (-T) T, ‖logDeriv χ.L z‖ ≤ M) → ‖characterRieszMean χ X‖ ≤ K * M * X ^ a + 2 * (M * X ^ b / T ^ 2) * (b - a) + 2 * (1 / (b - 1) + C) * X ^ b / T := by obtain ⟨K, hK, hleft⟩ := leftRieszIntegrand_segment_bound obtain ⟨C, hC, htrunc⟩ := characterRieszMean_truncation refine ⟨K, C, hK, hC, ?_⟩ intro χ X a b T M hX ha hab hb hb2 hT hM hne hbound have hXp : 0 < X := by linarith have hpt (σ t : ℝ) (hσ : σ ∈ Icc a b) (ht : t ∈ Icc (-T) T) : ‖logDeriv χ.L ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M := by apply hbound _ ⟨?_, ?_⟩ · simpa [uIcc_of_le hab] using hσ · simpa [uIcc_of_le (show -T ≤ T by linarith)] using ht have hl := hleft χ X a T M hXp ha hM (fun t ht => hpt a t ⟨le_rfl, hab⟩ ht) have hl' : ‖∫ t in -T..T, rightRieszIntegrand χ X a t‖ ≤ K * M * X ^ a := by simpa only [intervalIntegral.integral_of_le (show -T ≤ T by linarith), integral_Icc_eq_integral_Ioc] using hl have hu := riesz_horizontal_segment_bound χ X a b T M hX hab (by rwa [abs_of_pos hT]) hM (fun σ hσ => hpt σ T hσ ⟨by linarith, le_rfl⟩) have hd := riesz_horizontal_segment_bound χ X a b (-T) M hX hab (by rwa [abs_neg, abs_of_pos hT]) hM (fun σ hσ => hpt σ (-T) hσ ⟨le_rfl, by linarith⟩) rw [neg_sq] at hd have hz := rieszContour_rectangle_zero χ X hXp a b (-T) T (by linarith) hab hne have hv := rectangle_vertical_shift_norm_bound _ a b (-T) T hz change ‖∫ t in -T..T, rightRieszIntegrand χ X b t‖ ≤ ‖∫ t in -T..T, rightRieszIntegrand χ X a t‖ + _ + _ at hv have hm := htrunc χ X b T hXp hb hb2 hT linarith end Ostmann end OAI /- Apache-2.0 license for the adapted OpenAI zero-count code. Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ namespace Bounty open scoped Topology BigOperators section /- The sufficient direction of Korselt's criterion, proved from Fermat's little theorem. -/ theorem isCarmichael_of_korselt {n : ℕ} (hsq : Squarefree n) (hn : 1 < n) (hcomp : ¬ n.Prime) (hdiv : ∀ p : ℕ, p.Prime → p ∣ n → p - 1 ∣ n - 1) : IsCarmichael n := by intro b hb hcoprime refine ⟨?_, hcomp, hn⟩ change n ∣ b ^ (n - 1) - 1 by_cases hz : b ^ (n - 1) - 1 = 0 · simp [hz] nth_rw 1 [← Nat.prod_primeFactors_of_squarefree hsq] rw [Nat.prod_primeFactors_dvd_iff hz] intro p hp have hp' : p.Prime := (Nat.mem_primeFactors.mp hp).1 have hpn : p ∣ n := (Nat.mem_primeFactors.mp hp).2.1 apply Nat.mem_primeFactors.mpr refine ⟨hp', ?_, hz⟩ obtain ⟨k, hk⟩ := hdiv p hp' hpn have hfermat := Nat.ModEq.pow_card_sub_one_eq_one hp' (hcoprime.of_dvd_left hpn).symm have hpow := hfermat.pow k rw [← pow_mul, ← hk, one_pow] at hpow exact Nat.dvd_of_mod_eq_zero (Nat.sub_mod_eq_zero_of_mod_eq hpow) section variable {s : Finset ℕ} {L : ℕ} (hprime : ∀ p ∈ s, p.Prime) (hcard : 2 ≤ s.card) (hL : ∀ p ∈ s, p - 1 ∣ L) include s L hprime hcard hL /- A product of at least two distinct primes is Carmichael if it is one modulo a common multiple of all the prime predecessors. -/ theorem isCarmichael_prod_of_dvd (hprod : L ∣ (∏ p ∈ s, p) - 1) : IsCarmichael (∏ p ∈ s, p) := by have hfactor : (∏ p ∈ s, p).primeFactors = s := Nat.primeFactors_prod hprime have hnonempty : s.Nonempty := Finset.card_pos.mp (by omega) have hgt : 1 < ∏ p ∈ s, p := Nat.nonempty_primeFactors.mp (hfactor.symm ▸ hnonempty) have hsq : Squarefree (∏ p ∈ s, p) := by apply Finset.squarefree_prod_of_pairwise_isCoprime · intro p hp q hq hpq exact Nat.coprime_iff_isRelPrime.mp ((Nat.coprime_primes (hprime p hp) (hprime q hq)).mpr hpq) · intro p hp exact (hprime p hp).squarefree have hcomp : ¬ (∏ p ∈ s, p).Prime := by intro hp have hs : s = {∏ p ∈ s, p} := hfactor.symm.trans hp.primeFactors have : s.card = 1 := by simpa only [Finset.card_singleton] using congrArg Finset.card hs omega apply isCarmichael_of_korselt hsq hgt hcomp intro p hp hpn have hps : p ∈ s := by rw [← hfactor] exact Nat.mem_primeFactors.mpr ⟨hp, hpn, by omega⟩ exact (hL p hps).trans hprod /- The congruence form of the finite-prime-product construction. -/ theorem isCarmichael_prod_of_modEq (hprod : Nat.ModEq L (∏ p ∈ s, p) 1) : IsCarmichael (∏ p ∈ s, p) := by exact isCarmichael_prod_of_dvd hprime hcard hL hprod.symm.dvd' end end section /- A finite set of primes can be recovered from its product. -/ theorem prime_subset_product_injective {P : Finset ℕ} (hP : ∀ p ∈ P, Nat.Prime p) : Set.InjOn (fun s : Finset ℕ => ∏ p ∈ s, p) {s | s ⊆ P} := by intro s hs t ht hst have hs' : ∀ p ∈ s, Nat.Prime p := fun p hp => hP p (hs hp) have ht' : ∀ p ∈ t, Nat.Prime p := fun p hp => hP p (ht hp) simpa only [Nat.primeFactors_prod hs', Nat.primeFactors_prod ht'] using congrArg Nat.primeFactors hst /- Every finite family of admissible prime subsets produces as many distinct Carmichael numbers below the stated bound. -/ theorem subset_family_card_le_carmichaelCounting {P : Finset ℕ} (hP : ∀ p ∈ P, Nat.Prime p) (A : Finset (Finset ℕ)) (x : ℝ) (hsub : ∀ s ∈ A, s ⊆ P) (hcar : ∀ s ∈ A, IsCarmichael (∏ p ∈ s, p)) (hbound : ∀ s ∈ A, ((∏ p ∈ s, p : ℕ) : ℝ) ≤ x) : (A.card : ℝ) ≤ Erdos1057.carmichaelCounting x := by have hfinite : Set.Finite {n : ℕ | IsCarmichael n ∧ (n : ℝ) ≤ x} := by apply (Set.finite_Iic ⌊x⌋₊).subset intro n hn exact Nat.le_floor hn.2 have hinj : Set.InjOn (fun s : Finset ℕ => ∏ p ∈ s, p) (A : Set (Finset ℕ)) := by intro s hs t ht hst exact prime_subset_product_injective hP (hsub s hs) (hsub t ht) hst have hcard := Set.ncard_le_ncard_of_injOn (fun s : Finset ℕ => ∏ p ∈ s, p) (fun s hs => And.intro (hcar s hs) (hbound s hs)) hinj hfinite simp only [Set.ncard_coe_finset] at hcard unfold Erdos1057.carmichaelCounting exact_mod_cast hcard end section /- A prime-power factor of a finite least common multiple occurs in one of its inputs. -/ theorem lcm_prime_power_le_bound {ι : Type*} (s : Finset ι) (f : ι → ℕ) (hs : s.Nonempty) (hne : ∀ i ∈ s, f i ≠ 0) {B : ℕ} (hbound : ∀ i ∈ s, f i ≤ B) (q : ℕ) : q ^ (s.lcm f).factorization q ≤ B := by rw [Finset.factorization_lcm hne q] obtain ⟨i, hi, heq⟩ := Finset.exists_mem_eq_sup s hs (fun i => (f i).factorization q) rw [heq] exact (Nat.ordProj_le q (hne i hi)).trans (hbound i hi) section variable {ι : Type*} (s : Finset ι) (f : ι → ℕ) (hne : ∀ i ∈ s, f i ≠ 0) include ι s f hne /- The least common multiple is at most the input bound raised to the number of distinct prime factors in the modulus. -/ theorem lcm_le_pow_primeFactors_card {B : ℕ} (hbound : ∀ i ∈ s, f i ≤ B) : s.lcm f ≤ B ^ (s.lcm f).primeFactors.card := by classical by_cases hs : s.Nonempty · have hL : s.lcm f ≠ 0 := Finset.lcm_ne_zero_iff.mpr hne calc s.lcm f = ∏ q ∈ (s.lcm f).primeFactors, q ^ (s.lcm f).factorization q := Nat.prod_primeFactors_pow_factorization hL _ ≤ ∏ _q ∈ (s.lcm f).primeFactors, B := by exact Finset.prod_le_prod' (fun q _ => lcm_prime_power_le_bound s f hs hne hbound q) _ = B ^ (s.lcm f).primeFactors.card := by simp · have hempty : s = ∅ := Finset.not_nonempty_iff_eq_empty.mp hs simp [hempty] /- Smoothness of all inputs passes to their least common multiple. -/ theorem primeFactors_lcm_le {K : ℕ} (hsmooth : ∀ i ∈ s, ∀ q : ℕ, q.Prime → q ∣ f i → q ≤ K) {q : ℕ} (hq : q ∈ (s.lcm f).primeFactors) : q ≤ K := by classical by_cases hs : s.Nonempty · have hpos : (s.lcm f).factorization q ≠ 0 := Finsupp.mem_support_iff.mp hq rw [Finset.factorization_lcm hne q] at hpos obtain ⟨i, hi, heq⟩ := Finset.exists_mem_eq_sup s hs (fun i => (f i).factorization q) rw [heq] at hpos exact hsmooth i hi q (Nat.prime_of_mem_primeFactors hq) (Nat.dvd_of_factorization_pos hpos) · have hempty : s = ∅ := Finset.not_nonempty_iff_eq_empty.mp hs simp [hempty] at hq /- A smooth least common multiple obeys a bound independent of the number of inputs. -/ theorem smooth_lcm_le_pow {B K : ℕ} (hB : 1 ≤ B) (hbound : ∀ i ∈ s, f i ≤ B) (hsmooth : ∀ i ∈ s, ∀ q : ℕ, q.Prime → q ∣ f i → q ≤ K) : s.lcm f ≤ B ^ K := by classical have hsub : (s.lcm f).primeFactors ⊆ Finset.Icc 1 K := by intro q hq exact Finset.mem_Icc.mpr ⟨(Nat.prime_of_mem_primeFactors hq).one_le, primeFactors_lcm_le s f hne hsmooth hq⟩ have hcard : (s.lcm f).primeFactors.card ≤ K := by have h := Finset.card_le_card hsub simpa using h exact (lcm_le_pow_primeFactors_card s f hne hbound).trans (pow_le_pow_right₀ hB hcard) /- Logarithmic form of the smooth-modulus bound used in the counting argument. -/ theorem log_smooth_lcm_le {B K : ℕ} (hB : 1 ≤ B) (hbound : ∀ i ∈ s, f i ≤ B) (hsmooth : ∀ i ∈ s, ∀ q : ℕ, q.Prime → q ∣ f i → q ≤ K) : Real.log ((s.lcm f : ℕ) : ℝ) ≤ (K : ℝ) * Real.log (B : ℝ) := by have hL : 0 < ((s.lcm f : ℕ) : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (Finset.lcm_ne_zero_iff.mpr hne) have hbound' : ((s.lcm f : ℕ) : ℝ) ≤ (B : ℝ) ^ K := by exact_mod_cast smooth_lcm_le_pow s f hne hB hbound hsmooth simpa using Real.log_le_log hL hbound' end end section /- The modulus imposed by the predecessors of a prime reservoir. -/ def primePredecessorLCM (P : Finset ℕ) : ℕ := P.lcm (fun p => p - 1) theorem primePredecessorLCM_pos {P : Finset ℕ} (hP : ∀ p ∈ P, Nat.Prime p) : 0 < primePredecessorLCM P := by apply Nat.pos_of_ne_zero apply Finset.lcm_ne_zero_iff.mpr intro p hp have := (hP p hp).two_le omega theorem predecessor_dvd_primePredecessorLCM {P : Finset ℕ} {p : ℕ} (hp : p ∈ P) : p - 1 ∣ primePredecessorLCM P := Finset.dvd_lcm hp theorem primePredecessorLCM_smooth {P : Finset ℕ} (hP : ∀ p ∈ P, Nat.Prime p) {K : ℕ} (hsmooth : ∀ p ∈ P, ∀ q : ℕ, q.Prime → q ∣ p - 1 → q ≤ K) {q : ℕ} (hq : q ∈ (primePredecessorLCM P).primeFactors) : q ≤ K := by apply primeFactors_lcm_le P (fun p => p - 1) _ hsmooth hq intro p hp have := (hP p hp).two_le omega theorem log_primePredecessorLCM_le {P : Finset ℕ} (hP : ∀ p ∈ P, Nat.Prime p) {B K : ℕ} (hB : 1 ≤ B) (hbound : ∀ p ∈ P, p - 1 ≤ B) (hsmooth : ∀ p ∈ P, ∀ q : ℕ, q.Prime → q ∣ p - 1 → q ≤ K) : Real.log (primePredecessorLCM P : ℝ) ≤ (K : ℝ) * Real.log (B : ℝ) := by apply log_smooth_lcm_le P (fun p => p - 1) _ hB hbound hsmooth intro p hp have := (hP p hp).two_le omega /- Any prime larger than every prime factor of a positive modulus is coprime to it. -/ theorem prime_coprime_of_primeFactors_lt {p L : ℕ} (hp : p.Prime) (hL : 0 < L) (hsmall : ∀ q ∈ L.primeFactors, q < p) : p.Coprime L := by apply hp.coprime_iff_not_dvd.mpr intro hdiv have hmem : p ∈ L.primeFactors := (Nat.mem_primeFactors_of_ne_zero (ne_of_gt hL)).mpr ⟨hp, hdiv⟩ exact (Nat.lt_irrefl p) (hsmall p hmem) /- There are at most `L` unit residues modulo a positive integer `L`. -/ theorem card_zmod_units_le {L : ℕ} (hL : 0 < L) : Nat.card (ZMod L)ˣ ≤ L := by let : NeZero L := ⟨ne_of_gt hL⟩ have h := Nat.card_le_card_of_injective (fun u : (ZMod L)ˣ => (u : ZMod L)) Units.val_injective simpa only [Nat.card_zmod] using h end section /- A finite collection of positive natural numbers below a real bound has at most the natural floor of that bound many elements. -/ theorem card_positive_nat_finset_le_floor {S : Finset ℕ} {x : ℝ} (hpos : ∀ p ∈ S, 0 < p) (hbound : ∀ p ∈ S, (p : ℝ) ≤ x) : S.card ≤ ⌊x⌋₊ := by have hsub : S ⊆ Finset.Icc 1 ⌊x⌋₊ := by intro p hp exact Finset.mem_Icc.mpr ⟨hpos p hp, Nat.le_floor (hbound p hp)⟩ simpa using Finset.card_le_card hsub theorem prime_interval_card_le_floor {S : Finset ℕ} {y : ℝ} (hprime : ∀ p ∈ S, p.Prime) (hbound : ∀ p ∈ S, (p : ℝ) ≤ 5 * y) : S.card ≤ ⌊5 * y⌋₊ := card_positive_nat_finset_le_floor (fun p hp => (hprime p hp).pos) hbound theorem prime_interval_card_le {S : Finset ℕ} {y : ℝ} (hy : 0 ≤ y) (hprime : ∀ p ∈ S, p.Prime) (hbound : ∀ p ∈ S, (p : ℝ) ≤ 5 * y) : (S.card : ℝ) ≤ 5 * y := by have hcard : (S.card : ℝ) ≤ (⌊5 * y⌋₊ : ℝ) := by exact_mod_cast prime_interval_card_le_floor hprime hbound exact hcard.trans (Nat.floor_le (by positivity)) /- The integer smooth-modulus estimate with floors removed from its conclusion. -/ theorem log_primePredecessorLCM_le_real {P : Finset ℕ} {y δ : ℝ} (hy : 1 ≤ y) (hprime : ∀ p ∈ P, p.Prime) (hbound : ∀ p ∈ P, (p : ℝ) ≤ 5 * y) (hsmooth : ∀ p ∈ P, ∀ q : ℕ, q.Prime → q ∣ p - 1 → (q : ℝ) ≤ y ^ δ) : Real.log (primePredecessorLCM P : ℝ) ≤ y ^ δ * Real.log (5 * y) := by have hypos : 0 < y := lt_of_lt_of_le zero_lt_one hy have hB : 1 ≤ ⌊5 * y⌋₊ := Nat.le_floor (by norm_num; linarith) have hbound' : ∀ p ∈ P, p - 1 ≤ ⌊5 * y⌋₊ := by intro p hp exact (Nat.sub_le p 1).trans (Nat.le_floor (hbound p hp)) have hsmooth' : ∀ p ∈ P, ∀ q : ℕ, q.Prime → q ∣ p - 1 → q ≤ ⌊y ^ δ⌋₊ := by intro p hp q hq hdiv exact Nat.le_floor (hsmooth p hp q hq hdiv) have hlog := log_primePredecessorLCM_le hprime hB hbound' hsmooth' have hBpos : (0 : ℝ) < (⌊5 * y⌋₊ : ℕ) := by exact_mod_cast hB have hBreal : (⌊5 * y⌋₊ : ℝ) ≤ 5 * y := Nat.floor_le (by positivity) have hKreal : (⌊y ^ δ⌋₊ : ℝ) ≤ y ^ δ := Nat.floor_le (Real.rpow_nonneg hypos.le _) have hlogB : 0 ≤ Real.log (⌊5 * y⌋₊ : ℝ) := by apply Real.log_nonneg exact_mod_cast hB exact hlog.trans (mul_le_mul hKreal (Real.log_le_log hBpos hBreal) hlogB (Real.rpow_nonneg hypos.le _)) end section /- Extend a complex character of the unit group by zero on nonunits. -/ noncomputable def dirichletOfUnitCharacter {L : ℕ} (ξ : (ZMod L)ˣ →* ℂ) : DirichletCharacter ℂ L := MulChar.ofUnitHom ξ.toHomUnits theorem dirichletOfUnitCharacter_apply {L : ℕ} (ξ : (ZMod L)ˣ →* ℂ) (u : (ZMod L)ˣ) : dirichletOfUnitCharacter ξ (u : ZMod L) = ξ u := by exact MulChar.ofUnitHom_coe ξ.toHomUnits u /- Extension preserves and reflects principality. -/ theorem dirichletOfUnitCharacter_eq_one_iff {L : ℕ} (ξ : (ZMod L)ˣ →* ℂ) : dirichletOfUnitCharacter ξ = 1 ↔ ξ = 1 := by constructor · intro h ext u have hu := congrArg (fun χ : DirichletCharacter ℂ L => χ (u : ZMod L)) h simpa only [dirichletOfUnitCharacter_apply, MulChar.one_apply_coe, MonoidHom.one_apply] using hu · intro h apply MulChar.ext intro u rw [dirichletOfUnitCharacter_apply, MulChar.one_apply_coe, h, MonoidHom.one_apply] theorem dirichletOfUnitCharacter_ne_one {L : ℕ} {ξ : (ZMod L)ˣ →* ℂ} (hξ : ξ ≠ 1) : dirichletOfUnitCharacter ξ ≠ 1 := fun h => hξ ((dirichletOfUnitCharacter_eq_one_iff ξ).mp h) /- Compatible unit labels give exactly the conventional character value on a natural number. -/ theorem dirichletOfUnitCharacter_apply_label {L : ℕ} (ξ : (ZMod L)ˣ →* ℂ) {g : ℕ → (ZMod L)ˣ} {p : ℕ} (hcompat : (g p : ZMod L) = p) : dirichletOfUnitCharacter ξ (p : ZMod L) = ξ (g p) := by rw [← hcompat, dirichletOfUnitCharacter_apply] theorem dirichletOfUnitCharacter_sum_eq {L : ℕ} (ξ : (ZMod L)ˣ →* ℂ) (S : Finset ℕ) (g : ℕ → (ZMod L)ˣ) (hcompat : ∀ p ∈ S, (g p : ZMod L) = p) : ∑ p ∈ S, dirichletOfUnitCharacter ξ (p : ZMod L) = ∑ p ∈ S, ξ (g p) := by apply Finset.sum_congr rfl intro p hp exact dirichletOfUnitCharacter_apply_label ξ (hcompat p hp) /- A character-sum estimate stated for Dirichlet characters transfers to compatible unit labels. -/ theorem unitCharacter_sum_bound_of_dirichlet {L : ℕ} (S : Finset ℕ) (g : ℕ → (ZMod L)ˣ) (hcompat : ∀ p ∈ S, (g p : ZMod L) = p) {R : ℝ} (hbound : ∀ χ : DirichletCharacter ℂ L, χ ≠ 1 → ‖∑ p ∈ S, χ (p : ZMod L)‖ ≤ R) (ξ : (ZMod L)ˣ →* ℂ) (hξ : ξ ≠ 1) : ‖∑ p ∈ S, ξ (g p)‖ ≤ R := by rw [← dirichletOfUnitCharacter_sum_eq ξ S g hcompat] exact hbound _ (dirichletOfUnitCharacter_ne_one hξ) end section theorem extend_complex_character {G : Type*} [CommGroup G] [Finite G] (H : Subgroup G) (χ : H →* ℂ) : ∃ ξ : G →* ℂ, ∀ h : H, ξ h = χ h := by obtain ⟨ξ, hξ⟩ := MonoidHom.domRestrict_surjective ℂ H χ.toHomUnits refine ⟨(Units.coeHom ℂ).comp ξ, ?_⟩ intro h have heq := DFunLike.congr_fun hξ h exact congrArg (fun z : ℂˣ => (z : ℂ)) heq end section open OAI.Ostmann /- This is an explicit unproved input, not a new axiom. -/ def PrimitiveZeroFreeHalfPlane : Prop := ∀ χ : PrimitiveComplexCharacter, ∀ s : ℂ, (7 / 8 : ℝ) < s.re → χ.L s ≠ 0 end section open Finset end section open Complex Filter Metric Set open scoped Topology theorem exists_normalized_log_on_ball (g : ℂ → ℂ) (R : ℝ) (hR : 0 < R) (hg : AnalyticOnNhd ℂ g (ball 0 R)) (hne : ∀ z ∈ ball 0 R, g z ≠ 0) : ∃ F : ℂ → ℂ, F 0 = 0 ∧ (∀ z ∈ ball 0 R, HasDerivAt F (logDeriv g z) z) ∧ ∀ z ∈ ball 0 R, g z = g 0 * exp (F z) := by have hd : DifferentiableOn ℂ (logDeriv g) (ball 0 R) := by intro z hz exact ((hg z hz).deriv.div (hg z hz) (hne z hz)).differentiableWithinAt obtain ⟨F, hF0, hF⟩ := hd.isExactOn_ball.with_val_at 0 0 refine ⟨F, hF0, hF, ?_⟩ let H : ℂ → ℂ := fun z => g z * exp (-F z) have hH (z : ℂ) (hz : z ∈ ball 0 R) : HasDerivAt H 0 z := by have h := (hg z hz).differentiableAt.hasDerivAt.mul ((hF z hz).neg.cexp) have he : deriv g z * exp (-F z) + g z * (exp (-F z) * -logDeriv g z) = 0 := by rw [logDeriv_apply] field_simp [hne z hz] ring change HasDerivAt H (deriv g z * exp (-F z) + g z * (exp (-F z) * -logDeriv g z)) z at h rw [he] at h exact h have hHD : DifferentiableOn ℂ H (ball 0 R) := fun z hz => (hH z hz).differentiableAt.differentiableWithinAt intro z hz have hc := isOpen_ball.is_const_of_deriv_eq_zero (convex_ball (0 : ℂ) R).isPreconnected hHD (fun w hw => (hH w hw).deriv) hz (mem_ball_self hR) change g z * exp (-F z) = g 0 * exp (-F 0) at hc rw [hF0, neg_zero, exp_zero, mul_one, exp_neg] at hc have hmul := congrArg (fun w : ℂ => w * exp (F z)) hc simpa [mul_assoc, exp_ne_zero] using hmul theorem normalized_log_re (g F : ℂ → ℂ) (z : ℂ) (hg0 : g 0 ≠ 0) (he : g z = g 0 * exp (F z)) : (F z).re = Real.log ‖g z‖ - Real.log ‖g 0‖ := by have hnorm := congrArg norm he rw [norm_mul, norm_exp] at hnorm have hh := congrArg Real.log hnorm rw [Real.log_mul (norm_ne_zero_iff.mpr hg0) (Real.exp_ne_zero _), Real.log_exp] at hh linarith /- A zero-free analytic function has logarithmic derivative controlled by its logarithmic modulus oscillation and the distance to the boundary of the disk. -/ theorem logDeriv_norm_le_margin_disk (g : ℂ → ℂ) (R A δ : ℝ) (hR : 0 < R) (hA : 0 < A) (hδ : 0 < δ) (hg : AnalyticOnNhd ℂ g (ball 0 R)) (hne : ∀ z ∈ ball 0 R, g z ≠ 0) (hlog : ∀ z ∈ ball 0 R, Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A) (w : ℂ) (hw : ‖w‖ ≤ R - δ) : ‖logDeriv g w‖ ≤ 8 * A * R / δ ^ 2 := by obtain ⟨F, hF0, hF, heF⟩ := exists_normalized_log_on_ball g R hR hg hne have hd : DifferentiableOn ℂ F (ball 0 R) := fun z hz => (hF z hz).differentiableAt.differentiableWithinAt have hreal : MapsTo F (ball 0 R) {z : ℂ | z.re ≤ A} := by intro z hz change (F z).re ≤ A rw [normalized_log_re g F z (hne 0 (mem_ball_self hR)) (heF z hz)] exact hlog z hz have hv (v : ℂ) (hv : v ∈ closedBall w (δ / 2)) : ‖v‖ ≤ R - δ / 2 := by have hh := norm_le_norm_sub_add v w have hdist : ‖v - w‖ ≤ δ / 2 := by simpa only [mem_closedBall, dist_eq_norm] using hv linarith have hvball (v : ℂ) (h : v ∈ closedBall w (δ / 2)) : v ∈ ball 0 R := by rw [mem_ball, dist_zero_right] linarith [hv v h] have hdc : DiffContOnCl ℂ F (ball w (δ / 2)) := by apply DiffContOnCl.mk_ball · intro v hv' exact (hF v (hvball v (ball_subset_closedBall hv'))).differentiableAt.differentiableWithinAt · exact fun v hv' => (hF v (hvball v hv')).continuousAt.continuousWithinAt have hbound : ∀ v ∈ sphere w (δ / 2), ‖F v‖ ≤ 4 * A * R / δ := by intro v hv' have hvC := sphere_subset_closedBall hv' have hnv := hv v hvC have hden : 0 < R - ‖v‖ := by linarith have hh := Complex.borelCaratheodory_zero hA hd hreal hR (hvball v hvC) hF0 apply hh.trans calc 2 * A * ‖v‖ / (R - ‖v‖) ≤ 2 * A * R / (R - ‖v‖) := by apply div_le_div_of_nonneg_right _ hden.le gcongr linarith _ ≤ 2 * A * R / (δ / 2) := div_le_div_of_nonneg_left (by positivity) (by positivity) (by linarith) _ = _ := by field_simp; ring have hh := Complex.norm_deriv_le_of_forall_mem_sphere_norm_le (by positivity : 0 < δ / 2) hdc hbound have hwball : w ∈ ball 0 R := by rw [mem_ball, dist_zero_right]; linarith rw [(hF w hwball).deriv] at hh convert hh using 1 field_simp ring end section open Complex Metric Set OAI.Ostmann /- The zero-free half-plane controls the logarithmic derivative with a fixed interior margin. The conductor enters only through a logarithm. -/ theorem character_logDeriv_bound (hZ : PrimitiveZeroFreeHalfPlane) (χ : PrimitiveComplexCharacter) {ε : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) (s : ℂ) (hs : 7 / 8 + ε ≤ s.re) (hs2 : s.re ≤ 2) : ‖logDeriv χ.L s‖ ≤ (36 / ε ^ 2) * Real.log (24 * (χ.modulus : ℝ) * (|s.im| + 2)) := by let c : ℂ := 2 + (s.im : ℂ) * I let R : ℝ := 9 / 8 - ε / 2 let g : ℂ → ℂ := fun z => χ.L (z + c) let A : ℝ := Real.log (24 * (χ.modulus : ℝ) * (|s.im| + 2)) have hc : c.re = 2 := by simp [c] have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive have hq0 : (0 : ℝ) < χ.modulus := by linarith have hR : 0 < R := by dsimp [R]; linarith have hR2 : R < 2 := by dsimp [R]; linarith have hA : 0 < A := by apply Real.log_pos nlinarith [abs_nonneg s.im] have hg : AnalyticOnNhd ℂ g (ball 0 R) := by intro z hz exact (χ.L_analytic (z + c)).comp (f := fun w : ℂ => w + c) (x := z) (by fun_prop) have hre (z : ℂ) (hz : z ∈ ball 0 R) : 7 / 8 < (z + c).re := by have hn : ‖z‖ < R := by simpa only [mem_ball, dist_zero_right] using hz have hr := (abs_le.mp (abs_re_le_norm z)).1 simp only [add_re, hc] dsimp [R] at hn linarith have hne : ∀ z ∈ ball 0 R, g z ≠ 0 := fun z hz => hZ χ (z + c) (hre z hz) have hcnorm : ‖c‖ ≤ 2 + |s.im| := by calc ‖c‖ ≤ ‖(2 : ℂ)‖ + ‖(s.im : ℂ) * I‖ := norm_add_le _ _ _ = _ := by simp have hnorm (z : ℂ) (hz : z ∈ ball 0 R) : ‖g z‖ ≤ 8 * (χ.modulus : ℝ) * (|s.im| + 2) := by have hn : ‖z‖ < R := by simpa only [mem_ball, dist_zero_right] using hz have hzn : ‖z + c‖ ≤ 2 * (|s.im| + 2) := by have hh := norm_add_le z c linarith [abs_nonneg s.im] have hzr : 1 / 2 ≤ (z + c).re := by linarith [hre z hz] calc ‖g z‖ ≤ ‖z + c‖ * ((χ.modulus : ℝ) + 1) / (z + c).re := χ.L_norm_bound_positive (z + c) (by linarith) _ ≤ (2 * (|s.im| + 2)) * (2 * (χ.modulus : ℝ)) / (1 / 2) := by apply div_le_div₀ (by positivity) _ (by norm_num) hzr exact mul_le_mul hzn (by linarith) (by positivity) (by positivity) _ = _ := by ring have hlog : ∀ z ∈ ball 0 R, Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A := by intro z hz have h0 : 1 / 3 ≤ ‖g 0‖ := by simpa [g] using χ.L_lower_re_two c hc have h0pos : 0 < ‖g 0‖ := by linarith have hzpos : 0 < ‖g z‖ := norm_pos_iff.mpr (hne z hz) rw [← Real.log_div (ne_of_gt hzpos) (ne_of_gt h0pos)] apply Real.log_le_log (div_pos hzpos h0pos) apply (div_le_iff₀ h0pos).mpr have hh := mul_le_mul_of_nonneg_left h0 (show 0 ≤ 24 * (χ.modulus : ℝ) * (|s.im| + 2) by positivity) nlinarith [hnorm z hz] have hw : ‖s - c‖ ≤ R - ε / 2 := by have heq : s - c = ((s.re - 2 : ℝ) : ℂ) := by apply Complex.ext <;> simp [c] rw [heq, norm_real, Real.norm_eq_abs, abs_of_nonpos (by linarith)] dsimp [R] linarith have hb := logDeriv_norm_le_margin_disk g R A (ε / 2) hR hA (by positivity) hg hne hlog (s - c) hw have hcomp : logDeriv g (s - c) = logDeriv χ.L s := by have hh := logDeriv_comp (f := χ.L) (g := fun z : ℂ => z + c) (x := s - c) (χ.L_analytic ((s - c) + c)).differentiableAt (show DifferentiableAt ℂ (fun z : ℂ => z + c) (s - c) by fun_prop) simpa [g, Function.comp_def] using hh rw [hcomp] at hb calc _ ≤ 8 * A * R / (ε / 2) ^ 2 := hb _ ≤ 8 * A * (9 / 8) / (ε / 2) ^ 2 := by apply div_le_div_of_nonneg_right _ (sq_nonneg _) gcongr dsimp [R] linarith _ = _ := by dsimp [A]; field_simp; ring end section open OAI.Ostmann Complex Metric Set end section open Finset end section /- A weighted Cauchy--Schwarz estimate for one complex matrix row. -/ theorem complex_row_weighted_cauchy {ι : Type*} (s : Finset ι) (K f : ι → ℂ) (v : ι → ℝ) (hv : ∀ j ∈ s, 0 < v j) : ‖∑ j ∈ s, K j * f j‖ ^ 2 ≤ (∑ j ∈ s, ‖K j‖ * v j) * ∑ j ∈ s, ‖K j‖ * ‖f j‖ ^ 2 / v j := by have hnorm : ‖∑ j ∈ s, K j * f j‖ ≤ ∑ j ∈ s, ‖K j‖ * ‖f j‖ := by simpa only [norm_mul] using norm_sum_le s (fun j => K j * f j) have hsq : ‖∑ j ∈ s, K j * f j‖ ^ 2 ≤ (∑ j ∈ s, ‖K j‖ * ‖f j‖) ^ 2 := (sq_le_sq₀ (norm_nonneg _) (Finset.sum_nonneg fun j _ => by positivity)).mpr hnorm refine hsq.trans (Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul s ?_ ?_ ?_) · intro j hj exact mul_nonneg (norm_nonneg _) (hv j hj).le · intro j hj exact div_nonneg (by positivity) (hv j hj).le · intro j hj have hvj : v j ≠ 0 := (hv j hj).ne' apply le_of_eq field_simp /- Weighted Schur for a transition matrix. No symmetry is assumed. The column bound uses the underlying measure, and the matrix action itself is unweighted. -/ theorem finite_weighted_schur_transition {ι : Type*} (s : Finset ι) (μ v : ι → ℝ) (K : ι → ι → ℂ) (hμ : ∀ i ∈ s, 0 ≤ μ i) (hv : ∀ i ∈ s, 0 < v i) {A B : ℝ} (hrow : ∀ i ∈ s, (∑ j ∈ s, ‖K i j‖ * v j) ≤ A * v i) (hcol : ∀ j ∈ s, (∑ i ∈ s, μ i * ‖K i j‖ * v i) ≤ B * μ j * v j) (f : ι → ℂ) : (∑ i ∈ s, μ i * ‖∑ j ∈ s, K i j * f j‖ ^ 2) ≤ A * B * ∑ j ∈ s, μ j * ‖f j‖ ^ 2 := by classical rcases s.eq_empty_or_nonempty with rfl | ⟨i₀, hi₀⟩ · simp have hA : 0 ≤ A := by have hsum : 0 ≤ ∑ j ∈ s, ‖K i₀ j‖ * v j := Finset.sum_nonneg fun j hj => mul_nonneg (norm_nonneg _) (hv j hj).le have hAv : 0 ≤ A * v i₀ := hsum.trans (hrow i₀ hi₀) exact nonneg_of_mul_nonneg_left hAv (hv i₀ hi₀) have hpoint : ∀ i ∈ s, ‖∑ j ∈ s, K i j * f j‖ ^ 2 ≤ A * v i * ∑ j ∈ s, ‖K i j‖ * ‖f j‖ ^ 2 / v j := by intro i hi exact (complex_row_weighted_cauchy s (K i) f v hv).trans (mul_le_mul_of_nonneg_right (hrow i hi) (Finset.sum_nonneg fun j hj => div_nonneg (by positivity) (hv j hj).le)) calc (∑ i ∈ s, μ i * ‖∑ j ∈ s, K i j * f j‖ ^ 2) ≤ ∑ i ∈ s, μ i * (A * v i * ∑ j ∈ s, ‖K i j‖ * ‖f j‖ ^ 2 / v j) := Finset.sum_le_sum fun i hi => mul_le_mul_of_nonneg_left (hpoint i hi) (hμ i hi) _ = A * ∑ j ∈ s, (‖f j‖ ^ 2 / v j) * ∑ i ∈ s, μ i * ‖K i j‖ * v i := by simp_rw [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro i hi ring _ ≤ A * ∑ j ∈ s, (‖f j‖ ^ 2 / v j) * (B * μ j * v j) := by apply mul_le_mul_of_nonneg_left _ hA apply Finset.sum_le_sum intro j hj exact mul_le_mul_of_nonneg_left (hcol j hj) (div_nonneg (sq_nonneg _) (hv j hj).le) _ = A * B * ∑ j ∈ s, μ j * ‖f j‖ ^ 2 := by simp_rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj have hvj : v j ≠ 0 := (hv j hj).ne' field_simp /- A weighted transpose identity turns row bounds for two kernels into the column bound needed by Schur. The kernels need not be symmetric or equal. -/ theorem finite_weighted_schur_of_transpose {ι : Type*} (s : Finset ι) (μ v : ι → ℝ) (K K' : ι → ι → ℂ) (hμ : ∀ i ∈ s, 0 ≤ μ i) (hv : ∀ i ∈ s, 0 < v i) (htranspose : ∀ i ∈ s, ∀ j ∈ s, (μ i : ℂ) * K i j = (μ j : ℂ) * K' j i) {A B : ℝ} (hrow : ∀ i ∈ s, (∑ j ∈ s, ‖K i j‖ * v j) ≤ A * v i) (hrow' : ∀ j ∈ s, (∑ i ∈ s, ‖K' j i‖ * v i) ≤ B * v j) (f : ι → ℂ) : (∑ i ∈ s, μ i * ‖∑ j ∈ s, K i j * f j‖ ^ 2) ≤ A * B * ∑ j ∈ s, μ j * ‖f j‖ ^ 2 := by apply finite_weighted_schur_transition s μ v K hμ hv hrow intro j hj calc (∑ i ∈ s, μ i * ‖K i j‖ * v i) = μ j * ∑ i ∈ s, ‖K' j i‖ * v i := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i hi have hn : μ i * ‖K i j‖ = μ j * ‖K' j i‖ := by have he := congrArg norm (htranspose i hi j hj) simpa [abs_of_nonneg (hμ i hi), abs_of_nonneg (hμ j hj)] using he rw [hn, mul_assoc] _ ≤ μ j * (B * v j) := mul_le_mul_of_nonneg_left (hrow' j hj) (hμ j hj) _ = B * μ j * v j := by ring /- The square-root formulation of the transition-matrix estimate. -/ theorem finite_weighted_schur_transition_norm {ι : Type*} (s : Finset ι) (μ v : ι → ℝ) (K : ι → ι → ℂ) (hμ : ∀ i ∈ s, 0 ≤ μ i) (hv : ∀ i ∈ s, 0 < v i) {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hrow : ∀ i ∈ s, (∑ j ∈ s, ‖K i j‖ * v j) ≤ A * v i) (hcol : ∀ j ∈ s, (∑ i ∈ s, μ i * ‖K i j‖ * v i) ≤ B * μ j * v j) (f : ι → ℂ) : Real.sqrt (∑ i ∈ s, μ i * ‖∑ j ∈ s, K i j * f j‖ ^ 2) ≤ Real.sqrt (A * B) * Real.sqrt (∑ j ∈ s, μ j * ‖f j‖ ^ 2) := by have h := Real.sqrt_le_sqrt (finite_weighted_schur_transition s μ v K hμ hv hrow hcol f) simpa only [Real.sqrt_mul (mul_nonneg hA hB)] using h end section noncomputable def tensorSchurWeight {ι α : Type*} [Fintype ι] (v : ι → α → ℝ) (x : ι → α) : ℝ := ∏ i, v i (x i) noncomputable def tensorSchurKernel {ι α : Type*} [Fintype ι] (K : ι → α → α → ℂ) (x y : ι → α) : ℂ := ∏ i, K i (x i) (y i) theorem tensorSchurWeight_nonneg {ι α : Type*} [Fintype ι] (v : ι → α → ℝ) (hv : ∀ i a, 0 ≤ v i a) (x : ι → α) : 0 ≤ tensorSchurWeight v x := Finset.prod_nonneg fun i _ => hv i (x i) theorem tensorSchurWeight_pos {ι α : Type*} [Fintype ι] (v : ι → α → ℝ) (hv : ∀ i a, 0 < v i a) (x : ι → α) : 0 < tensorSchurWeight v x := Finset.prod_pos fun i _ => hv i (x i) /- The absolute weighted row sum of a finite tensor kernel factors exactly. -/ theorem tensor_schur_row_sum {ι α : Type*} [Fintype ι] [Fintype α] [DecidableEq ι] (K : ι → α → α → ℂ) (v : ι → α → ℝ) (x : ι → α) : (∑ y : ι → α, ‖tensorSchurKernel K x y‖ * tensorSchurWeight v y) = ∏ i, ∑ b, ‖K i (x i) b‖ * v i b := by classical unfold tensorSchurKernel tensorSchurWeight simp_rw [norm_prod, ← Finset.prod_mul_distrib] exact (Fintype.prod_sum fun i b => ‖K i (x i) b‖ * v i b).symm /- Coordinate row bounds multiply, without symmetry or sign conditions on the complex kernels. -/ theorem tensor_schur_row_bound {ι α : Type*} [Fintype ι] [Fintype α] [DecidableEq ι] (K : ι → α → α → ℂ) (v : ι → α → ℝ) (A : ι → ℝ) (hv : ∀ i a, 0 ≤ v i a) (hrow : ∀ i a, (∑ b, ‖K i a b‖ * v i b) ≤ A i * v i a) (x : ι → α) : (∑ y : ι → α, ‖tensorSchurKernel K x y‖ * tensorSchurWeight v y) ≤ (∏ i, A i) * tensorSchurWeight v x := by rw [tensor_schur_row_sum] unfold tensorSchurWeight rw [← Finset.prod_mul_distrib] exact Finset.prod_le_prod₀ (fun i _ => Finset.sum_nonneg fun b _ => mul_nonneg (norm_nonneg _) (hv i b)) (fun i _ => hrow i (x i)) /- Coordinate weighted transpose identities multiply to a weighted transpose identity for the tensor kernel. -/ theorem tensor_schur_weighted_transpose {ι α : Type*} [Fintype ι] (μ : ι → α → ℝ) (K K' : ι → α → α → ℂ) (htranspose : ∀ i a b, (μ i a : ℂ) * K i a b = (μ i b : ℂ) * K' i b a) (x y : ι → α) : (tensorSchurWeight μ x : ℂ) * tensorSchurKernel K x y = (tensorSchurWeight μ y : ℂ) * tensorSchurKernel K' y x := by unfold tensorSchurWeight tensorSchurKernel simp only [Complex.ofReal_prod, ← Finset.prod_mul_distrib] exact Finset.prod_congr rfl fun i _ => htranspose i (x i) (y i) /- Full absolute row estimates survive restriction to an arbitrary finite cutoff, hence control the actual restricted operator in weighted squared L2. -/ theorem finite_weighted_schur_cutoff {α : Type*} [Fintype α] (S : Finset α) (μ v : α → ℝ) (K K' : α → α → ℂ) (hμ : ∀ a, 0 ≤ μ a) (hv : ∀ a, 0 < v a) (htranspose : ∀ a b, (μ a : ℂ) * K a b = (μ b : ℂ) * K' b a) {A B : ℝ} (hrow : ∀ a, (∑ b, ‖K a b‖ * v b) ≤ A * v a) (hrow' : ∀ a, (∑ b, ‖K' a b‖ * v b) ≤ B * v a) (f : α → ℂ) : (∑ a ∈ S, μ a * ‖∑ b ∈ S, K a b * f b‖ ^ 2) ≤ A * B * ∑ b ∈ S, μ b * ‖f b‖ ^ 2 := by apply finite_weighted_schur_of_transpose S μ v K K' (fun a _ => hμ a) (fun a _ => hv a) (fun a _ b _ => htranspose a b) · intro a ha exact (Finset.sum_le_univ_sum_of_nonneg (fun b => mul_nonneg (norm_nonneg _) (hv b).le)).trans (hrow a) · intro a ha exact (Finset.sum_le_univ_sum_of_nonneg (fun b => mul_nonneg (norm_nonneg _) (hv b).le)).trans (hrow' a) /- Tensorized coordinate bounds control every finite cutoff of the product state space, including cutoffs coupling different coordinates. -/ theorem tensor_schur_cutoff {ι α : Type*} [Fintype ι] [Fintype α] [DecidableEq ι] (S : Finset (ι → α)) (μ v : ι → α → ℝ) (K K' : ι → α → α → ℂ) (hμ : ∀ i a, 0 ≤ μ i a) (hv : ∀ i a, 0 < v i a) (htranspose : ∀ i a b, (μ i a : ℂ) * K i a b = (μ i b : ℂ) * K' i b a) (A B : ι → ℝ) (hrow : ∀ i a, (∑ b, ‖K i a b‖ * v i b) ≤ A i * v i a) (hrow' : ∀ i a, (∑ b, ‖K' i a b‖ * v i b) ≤ B i * v i a) (f : (ι → α) → ℂ) : (∑ x ∈ S, tensorSchurWeight μ x * ‖∑ y ∈ S, tensorSchurKernel K x y * f y‖ ^ 2) ≤ (∏ i, A i) * (∏ i, B i) * ∑ y ∈ S, tensorSchurWeight μ y * ‖f y‖ ^ 2 := by apply finite_weighted_schur_cutoff S (tensorSchurWeight μ) (tensorSchurWeight v) (tensorSchurKernel K) (tensorSchurKernel K') (tensorSchurWeight_nonneg μ hμ) (tensorSchurWeight_pos v hv) (tensor_schur_weighted_transpose μ K K' htranspose) · exact tensor_schur_row_bound K v A (fun i a => (hv i a).le) hrow · exact tensor_schur_row_bound K' v B (fun i a => (hv i a).le) hrow' end section open Finset /- The factorial weight of a single species with occupancy `n`. -/ noncomputable def ghostWeight (ν : ℝ) (n : ℕ) : ℝ := ν ^ n / (n.factorial : ℝ) /- A ghost transition retains `k` old particles, terminates the others, and creates `m-k` particles. The birth coefficient is `C`, the termination coefficient `D`. -/ noncomputable def ghostKernel (A D C ν : ℝ) (n m : ℕ) : ℝ := ∑ k ∈ range (min n m + 1), (n.choose k : ℝ) * A ^ k * D ^ (n - k) * (C * ν) ^ (m - k) / ((m - k).factorial : ℝ) /- Choosing particles cancels the corresponding occupancy factorials. -/ theorem ghostWeight_mul_choose (ν : ℝ) {n k : ℕ} (hk : k ≤ n) : ghostWeight ν n * (n.choose k : ℝ) = ν ^ n / ((k.factorial : ℝ) * ((n - k).factorial : ℝ)) := by have hn : (n.factorial : ℝ) ≠ 0 := by positivity have hkf : (k.factorial : ℝ) ≠ 0 := by positivity have hnk : ((n - k).factorial : ℝ) ≠ 0 := by positivity have hfac : (n.choose k : ℝ) * (k.factorial : ℝ) * ((n - k).factorial : ℝ) = (n.factorial : ℝ) := by exact_mod_cast Nat.choose_mul_factorial_mul_factorial hk unfold ghostWeight field_simp linear_combination (ν ^ n) * hfac /- Weighted transposition exchanges births and terminations. This remains exact for any finite occupancy cutoff, including repeated particles of the same species. -/ theorem ghostKernel_weighted_transpose (A D C ν : ℝ) (n m : ℕ) : ghostWeight ν n * ghostKernel A D C ν n m = ghostWeight ν m * ghostKernel A C D ν m n := by unfold ghostKernel rw [mul_sum, mul_sum, min_comm m n] apply sum_congr rfl intro k hk have hkn : k ≤ n := (Nat.le_min.mp (Nat.le_of_lt_succ (mem_range.mp hk))).1 have hkm : k ≤ m := (Nat.le_min.mp (Nat.le_of_lt_succ (mem_range.mp hk))).2 have hn : ν ^ n = ν ^ k * ν ^ (n - k) := by rw [← pow_add, Nat.add_sub_of_le hkn] have hm : ν ^ m = ν ^ k * ν ^ (m - k) := by rw [← pow_add, Nat.add_sub_of_le hkm] calc ghostWeight ν n * ((n.choose k : ℝ) * A ^ k * D ^ (n - k) * (C * ν) ^ (m - k) / ((m - k).factorial : ℝ)) = (ghostWeight ν n * (n.choose k : ℝ)) * A ^ k * D ^ (n - k) * (C * ν) ^ (m - k) / ((m - k).factorial : ℝ) := by ring _ = (ghostWeight ν m * (m.choose k : ℝ)) * A ^ k * C ^ (m - k) * (D * ν) ^ (n - k) / ((n - k).factorial : ℝ) := by rw [ghostWeight_mul_choose ν hkn, ghostWeight_mul_choose ν hkm, hn, hm, mul_pow, mul_pow] ring _ = ghostWeight ν m * ((m.choose k : ℝ) * A ^ k * C ^ (m - k) * (D * ν) ^ (n - k) / ((n - k).factorial : ℝ)) := by ring /- Reindex a finite birth-and-retention sum by the number retained and then born. -/ theorem ghost_triangular_sum (f : ℕ → ℕ → ℝ) (n B : ℕ) : (∑ m ∈ range (B + 1), ∑ k ∈ range (min n m + 1), f k (m - k)) = ∑ k ∈ range (n + 1), ∑ b ∈ range (B + 1 - k), f k b := by have hinner (m : ℕ) : (∑ k ∈ range (min n m + 1), f k (m - k)) = ∑ k ∈ range (n + 1), if k ≤ m then f k (m - k) else 0 := by calc _ = ∑ k ∈ range (min n m + 1), if k ≤ m then f k (m - k) else 0 := by apply sum_congr rfl intro k hk have hkm : k ≤ m := (Nat.le_min.mp (Nat.le_of_lt_succ (mem_range.mp hk))).2 rw [if_pos hkm] _ = _ := by apply sum_subset · intro k hk simp only [mem_range] at * omega · intro k hk hnot simp only [mem_range] at hk hnot rw [if_neg (by omega)] simp_rw [hinner] rw [sum_comm] apply sum_congr rfl intro k hk rw [← sum_filter] have hfilter : (range (B + 1)).filter (fun m => k ≤ m) = Ico k (B + 1) := by ext m simp only [mem_filter, mem_range, mem_Ico] omega rw [hfilter, sum_Ico_eq_sum_range] apply sum_congr rfl intro b hb rw [Nat.add_sub_cancel_left] /- Exact finite row formula after separating retained particles from births. -/ theorem ghostKernel_row_sum (A D C ν v : ℝ) (n B : ℕ) : (∑ m ∈ range (B + 1), ghostKernel A D C ν n m * v ^ m) = ∑ k ∈ range (n + 1), ((n.choose k : ℝ) * A ^ k * D ^ (n - k) * v ^ k) * ∑ b ∈ range (B + 1 - k), (C * ν * v) ^ b / (b.factorial : ℝ) := by calc _ = ∑ m ∈ range (B + 1), ∑ k ∈ range (min n m + 1), ((n.choose k : ℝ) * A ^ k * D ^ (n - k) * v ^ k) * ((C * ν * v) ^ (m - k) / ((m - k).factorial : ℝ)) := by apply sum_congr rfl intro m hm unfold ghostKernel rw [sum_mul] apply sum_congr rfl intro k hk have hkm : k ≤ m := (Nat.le_min.mp (Nat.le_of_lt_succ (mem_range.mp hk))).2 have hv : v ^ m = v ^ k * v ^ (m - k) := by rw [← pow_add, Nat.add_sub_of_le hkm] rw [hv, mul_pow] ring _ = ∑ k ∈ range (n + 1), ∑ b ∈ range (B + 1 - k), ((n.choose k : ℝ) * A ^ k * D ^ (n - k) * v ^ k) * ((C * ν * v) ^ b / (b.factorial : ℝ)) := ghost_triangular_sum (fun k b => ((n.choose k : ℝ) * A ^ k * D ^ (n - k) * v ^ k) * ((C * ν * v) ^ b / (b.factorial : ℝ))) n B _ = _ := by simp_rw [mul_sum] /- The truncated positive row is bounded uniformly in the truncation level. -/ theorem ghostKernel_row_le (A D C ν v : ℝ) (n B : ℕ) (hA : 0 ≤ A) (hD : 0 ≤ D) (hC : 0 ≤ C) (hν : 0 ≤ ν) (hv : 0 ≤ v) : (∑ m ∈ range (B + 1), ghostKernel A D C ν n m * v ^ m) ≤ Real.exp (C * ν * v) * (A * v + D) ^ n := by rw [ghostKernel_row_sum] calc _ ≤ ∑ k ∈ range (n + 1), ((n.choose k : ℝ) * A ^ k * D ^ (n - k) * v ^ k) * Real.exp (C * ν * v) := by apply sum_le_sum intro k hk apply mul_le_mul_of_nonneg_left · exact Real.sum_le_exp_of_nonneg (by positivity) _ · positivity _ = Real.exp (C * ν * v) * (A * v + D) ^ n := by rw [add_pow, mul_sum] apply sum_congr rfl intro k hk rw [mul_pow] ring /- Factorial occupancy weights are positive for a positive species weight. -/ theorem ghostWeight_pos {ν : ℝ} (hν : 0 < ν) (n : ℕ) : 0 < ghostWeight ν n := by unfold ghostWeight positivity /- Replacing the signed coefficients by their absolute values dominates the kernel. -/ theorem abs_ghostKernel_le (A D C ν : ℝ) (n m : ℕ) : |ghostKernel A D C ν n m| ≤ ghostKernel |A| |D| |C| |ν| n m := by unfold ghostKernel calc _ ≤ ∑ k ∈ range (min n m + 1), |(n.choose k : ℝ) * A ^ k * D ^ (n - k) * (C * ν) ^ (m - k) / ((m - k).factorial : ℝ)| := abs_sum_le_sum_abs _ _ _ = _ := by apply sum_congr rfl intro k hk simp only [abs_div, abs_mul, abs_pow, Nat.abs_cast] /- The absolute row estimate in the Schur weight `v^n`, with the exact source constants. -/ theorem ghostKernel_abs_row_le {A ν v : ℝ} (D C : ℝ) (n B : ℕ) (hA : 0 ≤ A) (hν : 0 ≤ ν) (hv : 0 < v) : (∑ m ∈ range (B + 1), |ghostKernel A D C ν n m| * v ^ m) ≤ Real.exp (|C| * ν * v) * (A + |D| / v) ^ n * v ^ n := by calc _ ≤ ∑ m ∈ range (B + 1), ghostKernel A |D| |C| ν n m * v ^ m := by apply sum_le_sum intro m hm apply mul_le_mul_of_nonneg_right _ (pow_nonneg hv.le _) simpa only [abs_of_nonneg hA, abs_of_nonneg hν] using abs_ghostKernel_le A D C ν n m _ ≤ Real.exp (|C| * ν * v) * (A * v + |D|) ^ n := ghostKernel_row_le A |D| |C| ν v n B hA (abs_nonneg _) (abs_nonneg _) hν hv.le _ = Real.exp (|C| * ν * v) * (A + |D| / v) ^ n * v ^ n := by have heq : A * v + |D| = (A + |D| / v) * v := by field_simp rw [heq, mul_pow] ring /- Damping makes the absolute row constant independent of the input occupancy. -/ theorem ghostKernel_abs_row_le_of_damping {A ν v : ℝ} (D C : ℝ) (n B : ℕ) (hA : 0 ≤ A) (hν : 0 ≤ ν) (hv : 0 < v) (hdamp : A + |D| / v ≤ 1) : (∑ m ∈ range (B + 1), |ghostKernel A D C ν n m| * v ^ m) ≤ Real.exp (|C| * ν * v) * v ^ n := by apply (ghostKernel_abs_row_le D C n B hA hν hv).trans have hp : (A + |D| / v) ^ n ≤ 1 := pow_le_one₀ (by positivity) hdamp nlinarith [mul_nonneg (Real.exp_pos (|C| * ν * v)).le (pow_nonneg hv.le n), mul_le_mul_of_nonneg_left hp (mul_nonneg (Real.exp_pos (|C| * ν * v)).le (pow_nonneg hv.le n))] end section /- Product factorial measure on bounded species occupancies. -/ noncomputable def ghostMemoryWeight {ι : Type*} [Fintype ι] {B : ℕ} (ν : ι → ℝ) (x : ι → Fin (B + 1)) : ℝ := ∏ i, ghostWeight (ν i) (x i) /- The tensor product of the signed scalar ghost kernels. -/ noncomputable def ghostMemoryKernel {ι : Type*} [Fintype ι] {B : ℕ} (A D C ν : ι → ℝ) (x y : ι → Fin (B + 1)) : ℂ := ∏ i, (ghostKernel (A i) (D i) (C i) (ν i) (x i) (y i) : ℂ) /- Actual row action, with the input and output restricted to the same cutoff. -/ noncomputable def ghostMemoryAction {ι : Type*} [Fintype ι] {B : ℕ} (S : Finset (ι → Fin (B + 1))) (A D C ν : ι → ℝ) (f : (ι → Fin (B + 1)) → ℂ) (x : ι → Fin (B + 1)) : ℂ := ∑ y ∈ S, ghostMemoryKernel A D C ν x y * f y /- The finite ghost memory operator has a cutoff-independent weighted L2 bound. Signed birth and termination coefficients are permitted. -/ theorem ghostMemory_l2_sq_le {ι : Type*} [Fintype ι] {B : ℕ} (S : Finset (ι → Fin (B + 1))) (A D C ν v : ι → ℝ) (hA : ∀ i, 0 ≤ A i) (hν : ∀ i, 0 < ν i) (hv : ∀ i, 0 < v i) (hD : ∀ i, A i + |D i| / v i ≤ 1) (hC : ∀ i, A i + |C i| / v i ≤ 1) (f : (ι → Fin (B + 1)) → ℂ) : (∑ x ∈ S, ghostMemoryWeight ν x * ‖ghostMemoryAction S A D C ν f x‖ ^ 2) ≤ Real.exp (∑ i, (|C i| + |D i|) * ν i * v i) * ∑ y ∈ S, ghostMemoryWeight ν y * ‖f y‖ ^ 2 := by classical let μ : ι → Fin (B + 1) → ℝ := fun i n => ghostWeight (ν i) n let w : ι → Fin (B + 1) → ℝ := fun i n => v i ^ (n : ℕ) let K : ι → Fin (B + 1) → Fin (B + 1) → ℂ := fun i n m => (ghostKernel (A i) (D i) (C i) (ν i) n m : ℂ) let K' : ι → Fin (B + 1) → Fin (B + 1) → ℂ := fun i n m => (ghostKernel (A i) (C i) (D i) (ν i) n m : ℂ) have hμ : ∀ i n, 0 ≤ μ i n := fun i n => (ghostWeight_pos (hν i) n).le have hw : ∀ i n, 0 < w i n := fun i n => pow_pos (hv i) n have htranspose : ∀ i n m, (μ i n : ℂ) * K i n m = (μ i m : ℂ) * K' i m n := by intro i n m simpa only [μ, K, K', Complex.ofReal_mul] using congrArg (fun t : ℝ => (t : ℂ)) (ghostKernel_weighted_transpose (A i) (D i) (C i) (ν i) n m) have hrow : ∀ i n, (∑ m, ‖K i n m‖ * w i m) ≤ Real.exp (|C i| * ν i * v i) * w i n := by intro i n simp only [K, w, Complex.norm_real, Real.norm_eq_abs] rw [Fin.sum_univ_eq_sum_range (fun m : ℕ => |ghostKernel (A i) (D i) (C i) (ν i) (n : ℕ) m| * v i ^ m) (B + 1)] exact ghostKernel_abs_row_le_of_damping (D i) (C i) n B (hA i) (hν i).le (hv i) (hD i) have hrow' : ∀ i n, (∑ m, ‖K' i n m‖ * w i m) ≤ Real.exp (|D i| * ν i * v i) * w i n := by intro i n simp only [K', w, Complex.norm_real, Real.norm_eq_abs] rw [Fin.sum_univ_eq_sum_range (fun m : ℕ => |ghostKernel (A i) (C i) (D i) (ν i) (n : ℕ) m| * v i ^ m) (B + 1)] exact ghostKernel_abs_row_le_of_damping (C i) (D i) n B (hA i) (hν i).le (hv i) (hC i) have h := tensor_schur_cutoff S μ w K K' hμ hw htranspose (fun i => Real.exp (|C i| * ν i * v i)) (fun i => Real.exp (|D i| * ν i * v i)) hrow hrow' f have hprod : (∏ i, Real.exp (|C i| * ν i * v i)) * (∏ i, Real.exp (|D i| * ν i * v i)) = Real.exp (∑ i, (|C i| + |D i|) * ν i * v i) := by rw [← Finset.prod_mul_distrib] simp_rw [← Real.exp_add] rw [← Real.exp_sum] congr 1 apply Finset.sum_congr rfl intro i hi ring simpa only [hprod, tensorSchurWeight, tensorSchurKernel, ghostMemoryWeight, ghostMemoryAction, ghostMemoryKernel, μ, K] using h end section /- Telescoping toward the last index leaves only the strictly later factors. -/ theorem lifespan_suffix_telescoping {A : Type*} [CommRing A] (a : ℕ → A) (n : ℕ) : (∏ i ∈ Finset.range n, (1 - a i)) = 1 - ∑ j ∈ Finset.range n, a j * ∏ t ∈ Finset.Ioo j n, (1 - a t) := by have h := Finset.prod_one_sub_ordered (ι := OrderDual ℕ) (Finset.range n) a change (∏ i ∈ Finset.range n, (1 - a i)) = 1 - ∑ j ∈ Finset.range n, a j * ∏ t ∈ (Finset.range n).filter (fun t => j < t), (1 - a t) at h rw [h] congr 1 apply Finset.sum_congr rfl intro j hj congr 1 have he : (Finset.range n).filter (fun t => j < t) = Finset.Ioo j n := by ext t simp [and_comm] rw [he] /- A pair of residue hits forces the two endpoints to coincide, and fixes the residue in every interior damping factor. -/ theorem lifespan_residue_pair_sum {R : Type*} [Fintype R] [DecidableEq R] (h : ℕ → R) (η : ℕ → ℝ) (j i : ℕ) : (∑ r : R, (η j * (if r = h j then 1 else 0)) * (η i * (if r = h i then 1 else 0)) * ∏ t ∈ Finset.Ioo j i, (1 - η t * (if r = h t then 1 else 0))) = η j * η i * (if h j = h i then ∏ t ∈ Finset.Ioo j i, (1 - η t * (if h t = h j then 1 else 0)) else 0) := by classical rw [Finset.sum_eq_single (h j)] · by_cases hij : h j = h i <;> simp [hij, eq_comm] · intro r hr hneq simp [hneq] · simp end section open Finset /- Occupancy vector of an ordered tuple; every position contributes once. -/ noncomputable def tupleOccupancy {ι : Type*} [DecidableEq ι] {n : ℕ} (p : Fin n → ι) : ι → ℕ := ∑ j, Pi.single (p j) 1 theorem tupleOccupancy_apply {ι : Type*} [DecidableEq ι] {n : ℕ} (p : Fin n → ι) (i : ι) : tupleOccupancy p i = (univ.filter (fun j => p j = i)).card := by simp [tupleOccupancy, Finset.sum_apply, Pi.single_apply, eq_comm] section variable {ι : Type*} [sharedInstance1 : Fintype ι] [sharedInstance2 : DecidableEq ι] (ν : ι → ℝ) (n : ℕ) include ι sharedInstance1 sharedInstance2 ν n /- The same polynomial expanded by ordered positions and by occupancies. -/ theorem tuple_occupancy_generating_identity : (∑ p : Fin n → ι, AddMonoidAlgebra.single (tupleOccupancy p) (∏ j, ν (p j))) = ∑ k ∈ (univ : Finset ι).piAntidiag n, AddMonoidAlgebra.single k ((Nat.multinomial univ k : ℝ) * ∏ i, ν i ^ k i) := by let z : ι → AddMonoidAlgebra ℝ (ι → ℕ) := fun i => AddMonoidAlgebra.single (Pi.single i 1) (ν i) have htuple : (∑ i, z i) ^ n = ∑ p : Fin n → ι, AddMonoidAlgebra.single (tupleOccupancy p) (∏ j, ν (p j)) := by rw [Finset.sum_pow'] simp only [Fintype.piFinset_univ] apply Finset.sum_congr rfl intro p hp exact AddMonoidAlgebra.prod_single univ (fun j => Pi.single (p j) 1) (fun j => ν (p j)) rw [← htuple, Finset.sum_pow_eq_sum_piAntidiag] apply Finset.sum_congr rfl intro k hk have hexp : (∑ i, k i • Pi.single i (1 : ℕ)) = k := by ext i simp [Finset.sum_apply, Pi.single_apply] simp only [z, AddMonoidAlgebra.single_pow, AddMonoidAlgebra.prod_single, hexp] rw [← nsmul_eq_mul] simp /- Grouping ordered tuples by occupancy, with an arbitrary occupancy test. -/ theorem sum_tuple_eq_multinomial (F : (ι → ℕ) → ℝ) : (∑ p : Fin n → ι, (∏ j, ν (p j)) * F (tupleOccupancy p)) = ∑ k ∈ (univ : Finset ι).piAntidiag n, (Nat.multinomial univ k : ℝ) * (∏ i, ν i ^ k i) * F k := by let T : AddMonoidAlgebra ℝ (ι → ℕ) →+ ℝ := (Finsupp.liftAddHom (fun k => AddMonoidHom.mulRight (F k))).comp AddMonoidAlgebra.coeffAddEquiv.toAddMonoidHom have hT (k : ι → ℕ) (r : ℝ) : T (AddMonoidAlgebra.single k r) = r * F k := by simp [T] have h := congrArg T (tuple_occupancy_generating_identity ν n) simpa only [map_sum, hT] using h /- The ordered `1/n!` measure is exactly the product occupancy-factorial measure. There are no positivity assumptions on the weights or the test. -/ theorem sum_tuple_div_factorial_eq_occupancy (F : (ι → ℕ) → ℝ) : (∑ p : Fin n → ι, (∏ j, ν (p j)) * F (tupleOccupancy p)) / (n.factorial : ℝ) = ∑ k ∈ (univ : Finset ι).piAntidiag n, (∏ i, ν i ^ k i / ((k i).factorial : ℝ)) * F k := by rw [sum_tuple_eq_multinomial, Finset.sum_div] apply Finset.sum_congr rfl intro k hk have hsum : ∑ i, k i = n := (Finset.mem_piAntidiag.mp hk).1 have hfac : (∏ i, ((k i).factorial : ℝ)) * (Nat.multinomial univ k : ℝ) = (n.factorial : ℝ) := by exact_mod_cast (Nat.multinomial_spec univ k).trans (congrArg Nat.factorial hsum) have hd : (∏ i, ((k i).factorial : ℝ)) ≠ 0 := by positivity have hn : (n.factorial : ℝ) ≠ 0 := by positivity rw [Finset.prod_div_distrib] field_simp linear_combination ((∏ i, ν i ^ k i) * F k) * hfac end end section open Finset structure GhostLifespanState (R : Type*) where pending : R → ℝ completed : ℝ /- The effective one-visit transition after cancellation of the auxiliary rho factors. The reciprocal residue/baseline cost `β` is paid once at birth. -/ noncomputable def ghostLifespanStep {R : Type*} [DecidableEq R] (hit : R) (η β : ℝ) (s : GhostLifespanState R) : GhostLifespanState R where pending := fun r => s.pending r * (1 - η * (if r = hit then 1 else 0)) - β * η * (if r = hit then 1 else 0) completed := s.completed - η * s.pending hit /- Start with the unborn state and no pending or completed lifespan. -/ noncomputable def ghostLifespanRun {R : Type*} [DecidableEq R] (h : ℕ → R) (η : ℕ → ℝ) (β : ℝ) : ℕ → GhostLifespanState R | 0 => ⟨fun _ => 0, 0⟩ | n + 1 => ghostLifespanStep (h n) (η n) β (ghostLifespanRun h η β n) /- A finite conservation identity records every termination while retaining its sign. No absolute values or positivity assumptions are used. -/ theorem ghostLifespan_completed_balance {R : Type*} [Fintype R] [DecidableEq R] (h : ℕ → R) (η : ℕ → ℝ) (β : ℝ) (n : ℕ) : (ghostLifespanRun h η β n).completed = (∑ r : R, (ghostLifespanRun h η β n).pending r) + β * ∑ i ∈ range n, η i := by induction n with | zero => simp [ghostLifespanRun] | succ n ih => have hstep : (∑ r : R, (ghostLifespanRun h η β (n + 1)).pending r) = (∑ r : R, (ghostLifespanRun h η β n).pending r) - η n * (ghostLifespanRun h η β n).pending (h n) - β * η n := by simp only [ghostLifespanRun, ghostLifespanStep, mul_sub, mul_one, sum_sub_distrib] simp only [mul_ite, mul_one, mul_zero, sum_ite_eq', mem_univ, if_true] ring change (ghostLifespanRun h η β n).completed - η n * (ghostLifespanRun h η β n).pending (h n) = _ rw [hstep, ih, sum_range_succ] ring end section open Finset /- Simultaneous active hits and the damping at the inactive visits. -/ noncomputable def activeResidueWeight {R : Type*} [DecidableEq R] (visits active : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) (r : R) : ℝ := (∏ i ∈ active, if r = h i then 1 else 0) * ∏ i ∈ visits \ active, (1 - η i * (if r = h i then 1 else 0)) /- An active visit fixes the residue. Further active visits impose only compatibility, with no additional reciprocal-residue factor. -/ theorem active_lifespan_residue_sum {R : Type*} [Fintype R] [DecidableEq R] (visits active : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) (a : ℕ) (ha : a ∈ active) : (∑ r : R, activeResidueWeight visits active h η r) = if ∀ i ∈ active, h i = h a then ∏ i ∈ visits \ active, (1 - η i * (if h i = h a then 1 else 0)) else 0 := by classical rw [sum_eq_single (h a)] · simp only [activeResidueWeight, prod_boole] have he : (∀ i ∈ active, h a = h i) ↔ (∀ i ∈ active, h i = h a) := by constructor <;> intro hh i hi <;> exact (hh i hi).symm simp only [he] split <;> simp_all [eq_comm] · intro r hr hne have hh : ¬ (∀ i ∈ active, r = h i) := fun hc => hne (hc a ha) simp [activeResidueWeight, prod_boole, hh] · simp /- Split a finite time set before, during and after a closed lifespan. -/ theorem active_lifespan_split_product (s : Finset ℕ) (f : ℕ → ℝ) {a z : ℕ} (haz : a ≤ z) : (∏ i ∈ s, f i) = (∏ i ∈ s.filter (fun i => i < a), f i) * (∏ i ∈ s.filter (fun i => a ≤ i ∧ i ≤ z), f i) * ∏ i ∈ s.filter (fun i => z < i), f i := by have h₁ := prod_filter_mul_prod_filter_not s (fun i => i < a) f have h₂ := prod_filter_mul_prod_filter_not (s.filter (fun i => ¬ i < a)) (fun i => i ≤ z) f have hm : (s.filter (fun i => ¬ i < a)).filter (fun i => i ≤ z) = s.filter (fun i => a ≤ i ∧ i ≤ z) := by ext i simp only [mem_filter, not_lt, and_assoc] have ht : (s.filter (fun i => ¬ i < a)).filter (fun i => ¬ i ≤ z) = s.filter (fun i => z < i) := by ext i simp only [mem_filter, not_lt, not_le] constructor · rintro ⟨⟨hi, _⟩, hzi⟩ exact ⟨hi, hzi⟩ · rintro ⟨hi, hzi⟩ exact ⟨⟨hi, by omega⟩, hzi⟩ rw [hm, ht] at h₂ rw [← h₁, ← h₂, mul_assoc] /- When `a` and `z` are the first and last active visits, the surviving damping product has exactly the prefix, interior gaps and suffix expected by the single-lifespan description. -/ theorem active_lifespan_first_last_product {R : Type*} [Fintype R] [DecidableEq R] (active : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) {n a z : ℕ} (ha : a ∈ active) (hz : z ∈ active) (hzn : z < n) (hend : ∀ i ∈ active, a ≤ i ∧ i ≤ z) : (∑ r : R, activeResidueWeight (range n) active h η r) = if ∀ i ∈ active, h i = h a then (∏ i ∈ range a, (1 - η i * (if h i = h a then 1 else 0))) * (∏ i ∈ Ioo a z \ active, (1 - η i * (if h i = h a then 1 else 0))) * ∏ i ∈ Ioo z n, (1 - η i * (if h i = h a then 1 else 0)) else 0 := by have haz : a ≤ z := (hend a ha).2 have hp : (range n \ active).filter (fun i => i < a) = range a := by ext i simp only [mem_filter, mem_sdiff, mem_range] constructor · exact fun ht => ht.2 · intro hi refine ⟨⟨by omega, ?_⟩, hi⟩ intro hia have := (hend i hia).1 omega have hm : (range n \ active).filter (fun i => a ≤ i ∧ i ≤ z) = Ioo a z \ active := by ext i simp only [mem_filter, mem_sdiff, mem_range, mem_Ioo] constructor · rintro ⟨⟨hin, hia⟩, hai, hiz⟩ have hne₁ : i ≠ a := by rintro rfl; exact hia ha have hne₂ : i ≠ z := by rintro rfl; exact hia hz exact ⟨⟨by omega, by omega⟩, hia⟩ · rintro ⟨⟨hai, hiz⟩, hia⟩ exact ⟨⟨by omega, hia⟩, by omega, by omega⟩ have hs : (range n \ active).filter (fun i => z < i) = Ioo z n := by ext i simp only [mem_filter, mem_sdiff, mem_range, mem_Ioo] constructor · rintro ⟨⟨hin, _⟩, hzi⟩ exact ⟨hzi, hin⟩ · rintro ⟨hzi, hin⟩ refine ⟨⟨hin, ?_⟩, hzi⟩ intro hia have := (hend i hia).2 omega rw [active_lifespan_residue_sum _ _ _ _ a ha] split · rw [active_lifespan_split_product _ _ haz, hp, hm, hs] · rfl end section open Finset section variable {ι : Type*} [sharedInstance1 : Fintype ι] [sharedInstance2 : DecidableEq ι] (m : ι → ℕ) [sharedInstance4 : ∀ i, NeZero (m i)] (hc : Pairwise (fun i j => Nat.Coprime (m i) (m j))) include ι sharedInstance1 sharedInstance2 m sharedInstance4 hc /- A complete period maps bijectively to its tuple of local residues. -/ theorem lifespan_crt_bijective : Function.Bijective (fun k : Fin (∏ i, m i) => fun i => (k.val : ZMod (m i))) := by apply (Fintype.bijective_iff_surjective_and_card _).2 constructor · intro r have hm : ∀ i ∈ (univ : Finset ι), m i ≠ 0 := fun i _ => NeZero.ne (m i) have hp : Set.Pairwise (↑(univ : Finset ι)) (Function.onFun Nat.Coprime m) := by intro i _ j _ hij exact hc hij let k := Nat.chineseRemainderOfFinset (fun i => (r i).val) m univ hm hp have hk : k.val < ∏ i, m i := Nat.chineseRemainderOfFinset_lt_prod (fun i => (r i).val) m hm hp refine ⟨⟨k.val, hk⟩, ?_⟩ funext i have he : (k.val : ZMod (m i)) = ((r i).val : ZMod (m i)) := (ZMod.natCast_eq_natCast_iff _ _ _).2 (k.property i (mem_univ i)) exact he.trans (ZMod.natCast_zmod_val (r i)) · simp only [Fintype.card_fin, Fintype.card_pi, ZMod.card] /- Signed weights at independent local residues factor exactly over a complete period. This is an identity, so no cancellation is discarded. -/ theorem lifespan_crt_sum (f : ∀ i, ZMod (m i) → ℝ) : (∑ k ∈ range (∏ i, m i), ∏ i, f i (k : ZMod (m i))) = ∏ i, ∑ r : ZMod (m i), f i r := by rw [← Fin.sum_univ_eq_sum_range] let e := Equiv.ofBijective _ (lifespan_crt_bijective m hc) calc _ = ∑ r : ∀ i, ZMod (m i), ∏ i, f i (r i) := e.sum_comp (fun r => ∏ i, f i (r i)) _ = _ := (Fintype.prod_sum f).symm end end section open Finset /- Every full block of a periodic sequence contributes the same signed sum. -/ theorem periodic_full_blocks (f : ℕ → ℝ) {M : ℕ} (hf : Function.Periodic f M) (k : ℕ) : (∑ i ∈ range (k * M), f i) = (k : ℝ) * ∑ i ∈ range M, f i := by induction k with | zero => simp | succ k ih => rw [Nat.succ_mul, sum_range_add, ih] have hs : (∑ i ∈ range M, f (k * M + i)) = ∑ i ∈ range M, f i := by apply sum_congr rfl intro i hi simpa [Nat.add_comm] using hf.nat_mul k i rw [hs, Nat.cast_add, Nat.cast_one] ring /- Split a periodic sum into its full blocks and the final incomplete block. -/ theorem periodic_quotient_remainder (f : ℕ → ℝ) {M : ℕ} (hf : Function.Periodic f M) (N : ℕ) : (∑ i ∈ range N, f i) = ((N / M : ℕ) : ℝ) * (∑ i ∈ range M, f i) + ∑ i ∈ range (N % M), f i := by have hn : N / M * M + N % M = N := by simpa only [Nat.mul_comm] using Nat.div_add_mod N M conv_lhs => rw [← hn] rw [sum_range_add, periodic_full_blocks f hf] congr 1 apply sum_congr rfl intro i hi simpa [Nat.add_comm] using hf.nat_mul (N / M) i /- The error in replacing a finite sum by its period mean is controlled by twice the absolute mass of one period, uniformly in the interval length. -/ theorem periodic_mean_error (f : ℕ → ℝ) {M : ℕ} (hM : 0 < M) (hf : Function.Periodic f M) (N : ℕ) : |(∑ i ∈ range N, f i) - ((N : ℝ) / M) * ∑ i ∈ range M, f i| ≤ 2 * ∑ i ∈ range M, |f i| := by have hMr : (0 : ℝ) < M := by exact_mod_cast hM have hn : (N : ℝ) = ((N / M : ℕ) : ℝ) * M + ((N % M : ℕ) : ℝ) := by have hnat : N = N / M * M + N % M := by simpa only [Nat.mul_comm] using (Nat.div_add_mod N M).symm exact_mod_cast hnat have he : (∑ i ∈ range N, f i) - ((N : ℝ) / M) * ∑ i ∈ range M, f i = (∑ i ∈ range (N % M), f i) - (((N % M : ℕ) : ℝ) / M) * ∑ i ∈ range M, f i := by rw [periodic_quotient_remainder f hf N] conv_lhs => rw [hn] field_simp ring have hratio0 : (0 : ℝ) ≤ ((N % M : ℕ) : ℝ) / M := by positivity have hratio1 : (((N % M : ℕ) : ℝ) / M) ≤ 1 := by apply (div_le_one hMr).2 exact_mod_cast (Nat.mod_lt N hM).le have hpart : |∑ i ∈ range (N % M), f i| ≤ ∑ i ∈ range M, |f i| := by calc _ ≤ ∑ i ∈ range (N % M), |f i| := abs_sum_le_sum_abs _ _ _ ≤ ∑ i ∈ range M, |f i| := by apply sum_le_sum_of_subset_of_nonneg · exact range_mono (Nat.mod_lt N hM).le · intro i hi hnot exact abs_nonneg _ have hwhole : |∑ i ∈ range M, f i| ≤ ∑ i ∈ range M, |f i| := abs_sum_le_sum_abs _ _ rw [he] calc _ ≤ |∑ i ∈ range (N % M), f i| + |(((N % M : ℕ) : ℝ) / M) * ∑ i ∈ range M, f i| := abs_sub _ _ _ = |∑ i ∈ range (N % M), f i| + (((N % M : ℕ) : ℝ) / M) * |∑ i ∈ range M, f i| := by rw [abs_mul, abs_of_nonneg hratio0] _ ≤ (∑ i ∈ range M, |f i|) + 1 * (∑ i ∈ range M, |f i|) := by exact add_le_add hpart (mul_le_mul hratio1 hwhole (abs_nonneg _) (by positivity)) _ = _ := by ring /- The product of local residue weights is periodic with the product modulus. -/ theorem lifespan_crt_periodic {ι : Type*} [Fintype ι] [DecidableEq ι] (m : ι → ℕ) (f : ∀ i, ZMod (m i) → ℝ) : Function.Periodic (fun k : ℕ => ∏ i, f i (k : ZMod (m i))) (∏ i, m i) := by intro k apply prod_congr rfl intro i hi have hm : ((∏ j, m j : ℕ) : ZMod (m i)) = 0 := (ZMod.natCast_eq_zero_iff _ _).2 (dvd_prod_of_mem m hi) rw [Nat.cast_add, hm, add_zero] /- A finite interval differs from its CRT mean by a bounded boundary error. The absolute local masses, rather than a supremum over tuples, control it. -/ theorem lifespan_crt_interval_error {ι : Type*} [Fintype ι] [DecidableEq ι] (m : ι → ℕ) [∀ i, NeZero (m i)] (hc : Pairwise (fun i j => Nat.Coprime (m i) (m j))) (f : ∀ i, ZMod (m i) → ℝ) (N : ℕ) : |(∑ k ∈ range N, ∏ i, f i (k : ZMod (m i))) - ((N : ℝ) / ((∏ i, m i) : ℕ)) * (∏ i, ∑ r : ZMod (m i), f i r)| ≤ 2 * ∏ i, ∑ r : ZMod (m i), |f i r| := by have hM : 0 < ∏ i, m i := prod_pos (fun i _ => Nat.pos_of_ne_zero (NeZero.ne (m i))) have he := periodic_mean_error (fun k : ℕ => ∏ i, f i (k : ZMod (m i))) hM (lifespan_crt_periodic m f) N rw [lifespan_crt_sum m hc f] at he simpa only [abs_prod, lifespan_crt_sum m hc (fun i r => |f i r|)] using he end section open Finset /- Elementary symmetric sum of the local exclusion weights. -/ noncomputable def exclusionElementary {ι : Type*} (s : Finset ι) (w : ι → ℝ) (k : ℕ) : ℝ := ∑ t ∈ s.powersetCard k, ∏ i ∈ t, w i /- Truncate the product expansion strictly before degree `k`. -/ noncomputable def exclusionTruncation {ι : Type*} (s : Finset ι) (w : ι → ℝ) (k : ℕ) : ℝ := ∑ j ∈ range k, (-1 : ℝ)^j * exclusionElementary s w j theorem exclusion_elementary_zero {ι : Type*} (s : Finset ι) (w : ι → ℝ) : exclusionElementary s w 0 = 1 := by simp [exclusionElementary] theorem exclusion_elementary_empty_succ {ι : Type*} (w : ι → ℝ) (k : ℕ) : exclusionElementary ∅ w (k + 1) = 0 := by have he : (∅ : Finset ι).powersetCard (k + 1) = ∅ := powersetCard_eq_empty.mpr (by simp) simp [exclusionElementary, he] /- Separating subsets according to whether they contain the new index. -/ theorem exclusion_elementary_insert {ι : Type*} [DecidableEq ι] {s : Finset ι} {a : ι} (ha : a ∉ s) (w : ι → ℝ) (k : ℕ) : exclusionElementary (insert a s) w (k + 1) = exclusionElementary s w (k + 1) + w a * exclusionElementary s w k := by have hd : Disjoint (s.powersetCard (k + 1)) ((s.powersetCard k).image (insert a)) := by apply disjoint_left.2 intro t ht hti rcases mem_image.mp hti with ⟨u, hu, rfl⟩ exact ha ((mem_powersetCard.mp ht).1 (mem_insert_self a u)) unfold exclusionElementary rw [powersetCard_succ_insert ha, sum_union hd, sum_image] · rw [mul_sum] congr 1 apply sum_congr rfl intro t ht exact prod_insert (fun hat => ha ((mem_powersetCard.mp ht).1 hat)) · intro t ht u hu he have ht' : a ∉ t := fun hat => ha ((mem_powersetCard.mp ht).1 hat) have hu' : a ∉ u := fun hau => ha ((mem_powersetCard.mp hu).1 hau) simpa only [erase_insert ht', erase_insert hu'] using congrArg (fun t => t.erase a) he /- The truncated expansion respects insertion, with adjacent degrees. -/ theorem exclusion_truncation_insert {ι : Type*} [DecidableEq ι] {s : Finset ι} {a : ι} (ha : a ∉ s) (w : ι → ℝ) (k : ℕ) : exclusionTruncation (insert a s) w (k + 1) = exclusionTruncation s w (k + 1) - w a * exclusionTruncation s w k := by unfold exclusionTruncation rw [sum_range_succ', sum_range_succ' (fun j => (-1 : ℝ)^j * exclusionElementary s w j)] simp only [exclusion_elementary_zero, pow_zero, one_mul] simp_rw [exclusion_elementary_insert ha, mul_add, sum_add_distrib] rw [mul_sum] have he : (∑ j ∈ range k, (-1 : ℝ)^(j + 1) * (w a * exclusionElementary s w j)) = -(∑ j ∈ range k, w a * ((-1 : ℝ)^j * exclusionElementary s w j)) := by rw [← sum_neg_distrib] apply sum_congr rfl intro j hj rw [pow_succ] ring rw [he] ring section variable {ι : Type*} (s : Finset ι) (w : ι → ℝ) include ι s w /- Bonferroni's signed remainder lies between zero and the next elementary symmetric sum, for arbitrary finite weights in the unit interval. -/ theorem exclusion_bonferroni (hw : ∀ i ∈ s, 0 ≤ w i ∧ w i ≤ 1) (k : ℕ) : 0 ≤ (-1 : ℝ)^k * ((∏ i ∈ s, (1 - w i)) - exclusionTruncation s w k) ∧ (-1 : ℝ)^k * ((∏ i ∈ s, (1 - w i)) - exclusionTruncation s w k) ≤ exclusionElementary s w k := by classical induction s using Finset.induction_on generalizing k with | empty => cases k with | zero => simp [exclusionTruncation, exclusionElementary] | succ k => simp [exclusionTruncation, exclusion_elementary_zero, exclusion_elementary_empty_succ, sum_range_succ'] | @insert a s ha ih => have hwa := hw a (mem_insert_self a s) have hws : ∀ i ∈ s, 0 ≤ w i ∧ w i ≤ 1 := fun i hi => hw i (mem_insert_of_mem hi) cases k with | zero => simp only [pow_zero, one_mul, exclusionTruncation, range_zero, sum_empty, sub_zero, exclusion_elementary_zero] exact ⟨prod_nonneg (fun i hi => sub_nonneg.mpr (hw i hi).2), prod_le_one₀ (fun i hi => sub_nonneg.mpr (hw i hi).2) (fun i hi => sub_le_self _ (hw i hi).1)⟩ | succ k => have hk := ih hws k have hk1 := ih hws (k + 1) rw [prod_insert ha, exclusion_truncation_insert ha, exclusion_elementary_insert ha] have he : (-1 : ℝ)^(k + 1) * ((1 - w a) * (∏ i ∈ s, (1 - w i)) - (exclusionTruncation s w (k + 1) - w a * exclusionTruncation s w k)) = (-1 : ℝ)^(k + 1) * ((∏ i ∈ s, (1 - w i)) - exclusionTruncation s w (k + 1)) + w a * ((-1 : ℝ)^k * ((∏ i ∈ s, (1 - w i)) - exclusionTruncation s w k)) := by rw [pow_succ] ring rw [he] exact ⟨add_nonneg hk1.1 (mul_nonneg hwa.1 hk.1), add_le_add hk1.2 (mul_le_mul_of_nonneg_left hk.2 hwa.1)⟩ /- The elementary symmetric sum is at most the corresponding exponential coefficient, without any upper bound on the nonnegative weights. -/ theorem exclusion_elementary_factorial (hw : ∀ i ∈ s, 0 ≤ w i) (k : ℕ) : exclusionElementary s w k * (k.factorial : ℝ) ≤ (∑ i ∈ s, w i)^k := by classical induction s using Finset.induction_on generalizing k with | empty => cases k <;> simp [exclusion_elementary_zero, exclusion_elementary_empty_succ] | @insert a s ha ih => have hwa := hw a (mem_insert_self a s) have hws : ∀ i ∈ s, 0 ≤ w i := fun i hi => hw i (mem_insert_of_mem hi) have hsum : 0 ≤ ∑ i ∈ s, w i := sum_nonneg hws cases k with | zero => simp [exclusion_elementary_zero] | succ k => rw [exclusion_elementary_insert ha, sum_insert ha] have hk := ih hws k have hk1 := ih hws (k + 1) have hmul := mul_le_mul_of_nonneg_left hk (show 0 ≤ w a * ((k + 1 : ℕ) : ℝ) by positivity) have hpow := pow_add_mul_le_add_pow hsum (show 0 ≤ 2 * (∑ i ∈ s, w i) + w a by positivity) (k + 1) simp only [Nat.add_sub_cancel] at hpow have he : (exclusionElementary s w (k + 1) + w a * exclusionElementary s w k) * ((k + 1).factorial : ℝ) = exclusionElementary s w (k + 1) * ((k + 1).factorial : ℝ) + (w a * ((k + 1 : ℕ) : ℝ)) * (exclusionElementary s w k * (k.factorial : ℝ)) := by rw [Nat.factorial_succ, Nat.cast_mul] ring rw [he] calc _ ≤ (∑ i ∈ s, w i)^(k + 1) + (w a * ((k + 1 : ℕ) : ℝ)) * (∑ i ∈ s, w i)^k := add_le_add hk1 hmul _ = (∑ i ∈ s, w i)^(k + 1) + ((k + 1 : ℕ) : ℝ) * (∑ i ∈ s, w i)^k * w a := by ring _ ≤ ((∑ i ∈ s, w i) + w a)^(k + 1) := hpow _ = _ := by rw [add_comm] /- The standard factorial bound, written in the form used to control the gap between adjacent Bonferroni truncations. -/ theorem exclusion_elementary_le_pow_div_factorial (hw : ∀ i ∈ s, 0 ≤ w i) (k : ℕ) : exclusionElementary s w k ≤ (∑ i ∈ s, w i)^k / (k.factorial : ℝ) := by apply (le_div_iff₀ (by exact_mod_cast Nat.factorial_pos k)).2 exact exclusion_elementary_factorial s w hw k /- Absolute truncation error, before replacing the elementary coefficient by its exponential majorant. -/ theorem exclusion_truncation_error (hw : ∀ i ∈ s, 0 ≤ w i ∧ w i ≤ 1) (k : ℕ) : |(∏ i ∈ s, (1 - w i)) - exclusionTruncation s w k| ≤ exclusionElementary s w k := by obtain ⟨h0, h1⟩ := exclusion_bonferroni s w hw k calc _ = |(-1 : ℝ)^k * ((∏ i ∈ s, (1 - w i)) - exclusionTruncation s w k)| := by simp [abs_mul] _ = _ := abs_of_nonneg h0 _ ≤ _ := h1 end end section open Finset /- A finite nonnegative average preserves the Bonferroni remainder bound. -/ theorem exclusion_average_remainder {ι Ω : Type*} (s : Finset ι) (t : Finset Ω) (μ : Ω → ℝ) (X : Ω → ι → ℝ) (hμ : ∀ x ∈ t, 0 ≤ μ x) (hX : ∀ x ∈ t, ∀ i ∈ s, 0 ≤ X x i ∧ X x i ≤ 1) (k : ℕ) : |(∑ x ∈ t, μ x * ∏ i ∈ s, (1 - X x i)) - (∑ x ∈ t, μ x * exclusionTruncation s (X x) k)| ≤ ∑ x ∈ t, μ x * exclusionElementary s (X x) k := by rw [← sum_sub_distrib] calc _ ≤ ∑ x ∈ t, |μ x * (∏ i ∈ s, (1 - X x i)) - μ x * exclusionTruncation s (X x) k| := abs_sum_le_sum_abs _ _ _ ≤ _ := by apply sum_le_sum intro x hx rw [← mul_sub, abs_mul, abs_of_nonneg (hμ x hx)] exact mul_le_mul_of_nonneg_left (exclusion_truncation_error s (X x) (hX x hx) k) (hμ x hx) /- The error for a signed truncation is bounded by the sum of its moment errors. Its alternating coefficients have absolute value one. -/ theorem exclusion_average_truncation_error {ι Ω : Type*} (s : Finset ι) (t : Finset Ω) (μ : Ω → ℝ) (X : Ω → ι → ℝ) (v : ι → ℝ) (d : ℕ → ℝ) (k : ℕ) (hd : ∀ j < k, |(∑ x ∈ t, μ x * exclusionElementary s (X x) j) - exclusionElementary s v j| ≤ d j) : |(∑ x ∈ t, μ x * exclusionTruncation s (X x) k) - exclusionTruncation s v k| ≤ ∑ j ∈ range k, d j := by have he : (∑ x ∈ t, μ x * exclusionTruncation s (X x) k) - exclusionTruncation s v k = ∑ j ∈ range k, (-1 : ℝ)^j * ((∑ x ∈ t, μ x * exclusionElementary s (X x) j) - exclusionElementary s v j) := by simp only [exclusionTruncation, mul_sum] rw [sum_comm, ← sum_sub_distrib] apply sum_congr rfl intro j hj rw [mul_sub, mul_sum] congr 1 apply sum_congr rfl intro x hx ring rw [he] calc _ ≤ ∑ j ∈ range k, |(-1 : ℝ)^j * ((∑ x ∈ t, μ x * exclusionElementary s (X x) j) - exclusionElementary s v j)| := abs_sum_le_sum_abs _ _ _ ≤ _ := by apply sum_le_sum intro j hj simpa only [abs_mul, abs_pow, abs_neg, abs_one, one_pow, one_mul] using hd j (mem_range.mp hj) section variable {ι Ω : Type*} (s : Finset ι) (t : Finset Ω) (μ : Ω → ℝ) (X : Ω → ι → ℝ) (v : ι → ℝ) (d : ℕ → ℝ) (hμ : ∀ x ∈ t, 0 ≤ μ x) (hX : ∀ x ∈ t, ∀ i ∈ s, 0 ≤ X x i ∧ X x i ≤ 1) (hv : ∀ i ∈ s, 0 ≤ v i ∧ v i ≤ 1) (k : ℕ) (hd : ∀ j ≤ k, |(∑ x ∈ t, μ x * exclusionElementary s (X x) j) - exclusionElementary s v j| ≤ d j) include ι Ω s t μ X v d hμ hX hv k hd /- Moment comparison through degree `k` controls the full product. This form allows arithmetic CRT errors to be inserted independently at each degree. -/ theorem exclusion_moment_transfer : |(∑ x ∈ t, μ x * ∏ i ∈ s, (1 - X x i)) - (∏ i ∈ s, (1 - v i))| ≤ 2 * exclusionElementary s v k + ∑ j ∈ range (k + 1), d j := by have hrem := exclusion_average_remainder s t μ X hμ hX k have htrunc := exclusion_average_truncation_error s t μ X v d k (fun j hj => hd j hj.le) have hvrem := exclusion_truncation_error s v hv k have hmoment := (le_abs_self ((∑ x ∈ t, μ x * exclusionElementary s (X x) k) - exclusionElementary s v k)).trans (hd k le_rfl) have htri := abs_sub_le (∑ x ∈ t, μ x * ∏ i ∈ s, (1 - X x i)) (∑ x ∈ t, μ x * exclusionTruncation s (X x) k) (∏ i ∈ s, (1 - v i)) have htri₂ := abs_sub_le (∑ x ∈ t, μ x * exclusionTruncation s (X x) k) (exclusionTruncation s v k) (∏ i ∈ s, (1 - v i)) rw [abs_sub_comm (∏ i ∈ s, (1 - v i))] at hvrem rw [sum_range_succ] linarith /- A quantitative version using only the sum of the model exclusion probabilities and the finite arithmetic moment errors. -/ theorem exclusion_moment_transfer_factorial : |(∑ x ∈ t, μ x * ∏ i ∈ s, (1 - X x i)) - (∏ i ∈ s, (1 - v i))| ≤ 2 * ((∑ i ∈ s, v i)^k / (k.factorial : ℝ)) + ∑ j ∈ range (k + 1), d j := by refine (exclusion_moment_transfer s t μ X v d hμ hX hv k hd).trans ?_ have he := exclusion_elementary_le_pow_div_factorial s v (fun i hi => (hv i hi).1) k linarith end end section open Finset /- The uniform local mean of a residue weight. -/ noncomputable def exclusionLocalMean {ι : Type*} (m : ι → ℕ) [∀ i, NeZero (m i)] (X : ∀ i, ZMod (m i) → ℝ) (i : ι) : ℝ := (∑ r, X i r) / (m i : ℝ) /- The unnormalized local absolute mass, controlling the CRT boundary error. -/ noncomputable def exclusionLocalMass {ι : Type*} (m : ι → ℕ) [∀ i, NeZero (m i)] (X : ∀ i, ZMod (m i) → ℝ) (i : ι) : ℝ := ∑ r, |X i r| /- Local means of unit-interval weights are again in the unit interval. -/ theorem exclusion_local_mean_unit {ι : Type*} (m : ι → ℕ) [∀ i, NeZero (m i)] (X : ∀ i, ZMod (m i) → ℝ) (i : ι) (hX : ∀ r, 0 ≤ X i r ∧ X i r ≤ 1) : 0 ≤ exclusionLocalMean m X i ∧ exclusionLocalMean m X i ≤ 1 := by have hm : (0 : ℝ) < m i := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne (m i)) constructor · exact div_nonneg (sum_nonneg (fun r hr => (hX r).1)) hm.le · apply (div_le_one hm).2 calc (∑ r, X i r) ≤ ∑ _r : ZMod (m i), (1 : ℝ) := sum_le_sum (fun r hr => (hX r).2) _ = _ := by simp [ZMod.card] end section open Finset theorem exclusion_elementary_one {ι : Type*} (s : Finset ι) (w : ι → ℝ) : exclusionElementary s w 1 = ∑ i ∈ s, w i := by classical simp [exclusionElementary, powersetCard_one] /- The finite union bound for arbitrary numbers in the unit interval. -/ theorem exclusion_product_defect_le_sum {ι : Type*} (s : Finset ι) (w : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i ∧ w i ≤ 1) : 1 - ∏ i ∈ s, (1 - w i) ≤ ∑ i ∈ s, w i := by have h := (exclusion_bonferroni s w hw 2).1 norm_num [exclusionTruncation, sum_range_succ, exclusion_elementary_zero, exclusion_elementary_one] at h linarith /- Repeated visits at the same residue are collected into a single local weight, retaining the complete damping product at that residue. -/ noncomputable def visitExclusion {R : Type*} [DecidableEq R] (visits : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) (r : R) : ℝ := 1 - ∏ i ∈ visits, (1 - η i * (if r = h i then 1 else 0)) theorem visit_exclusion_unit {R : Type*} [DecidableEq R] (visits : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) (hη : ∀ i ∈ visits, 0 ≤ η i ∧ η i ≤ 1) (r : R) : 0 ≤ visitExclusion visits h η r ∧ visitExclusion visits h η r ≤ 1 := by have hd : ∀ i ∈ visits, 0 ≤ η i * (if r = h i then 1 else 0) ∧ η i * (if r = h i then 1 else 0) ≤ 1 := by intro i hi by_cases hir : r = h i · simpa [hir] using hη i hi · simp [hir] have hp0 : 0 ≤ ∏ i ∈ visits, (1 - η i * (if r = h i then 1 else 0)) := prod_nonneg (fun i hi => sub_nonneg.mpr (hd i hi).2) have hp1 : (∏ i ∈ visits, (1 - η i * (if r = h i then 1 else 0))) ≤ 1 := prod_le_one₀ (fun i hi => sub_nonneg.mpr (hd i hi).2) (fun i hi => sub_le_self _ (hd i hi).1) dsimp [visitExclusion] constructor <;> linarith /- Repeated hits cannot increase the total exclusion mass beyond the sum of the individual visit weights. -/ theorem visit_exclusion_mass {R : Type*} [Fintype R] [DecidableEq R] (visits : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) (hη : ∀ i ∈ visits, 0 ≤ η i ∧ η i ≤ 1) : (∑ r : R, visitExclusion visits h η r) ≤ ∑ i ∈ visits, η i := by have hb : ∀ r, visitExclusion visits h η r ≤ ∑ i ∈ visits, η i * (if r = h i then 1 else 0) := by intro r apply exclusion_product_defect_le_sum intro i hi by_cases hir : r = h i · simpa [hir] using hη i hi · simp [hir] calc _ ≤ ∑ r : R, ∑ i ∈ visits, η i * (if r = h i then 1 else 0) := sum_le_sum (fun r hr => hb r) _ = _ := by rw [sum_comm]; simp /- Dividing by the residue count gives the local probability estimate used in the sum of exclusion probabilities. -/ theorem visit_exclusion_mean_bound (q : ℕ) [NeZero q] (visits : Finset ℕ) (h : ℕ → ZMod q) (η : ℕ → ℝ) (hη : ∀ i ∈ visits, 0 ≤ η i ∧ η i ≤ 1) : (∑ r : ZMod q, visitExclusion visits h η r) / (q : ℝ) ≤ (∑ i ∈ visits, η i) / (q : ℝ) := by exact div_le_div_of_nonneg_right (visit_exclusion_mass visits h η hη) (Nat.cast_nonneg q) /- A small local exclusion probability leaves an exponentially bounded survival probability. -/ theorem exclusion_exp_lower {v : ℝ} (hv0 : 0 ≤ v) (hv1 : v ≤ 1 / 2) : Real.exp (-2 * v) ≤ 1 - v := by have hp : 0 < 1 - v := by linarith have hl : -2 * v ≤ 1 - (1 - v)⁻¹ := by apply (mul_le_mul_iff_right₀ hp).mp have hinv := mul_inv_cancel₀ hp.ne' have hquad := mul_nonneg hv0 (show 0 ≤ 1 - 2 * v by linarith) nlinarith have hlog := hl.trans (Real.one_sub_inv_le_log_of_pos hp) calc _ ≤ Real.exp (Real.log (1 - v)) := Real.exp_le_exp.mpr hlog _ = _ := Real.exp_log hp section variable {ι : Type*} (s : Finset ι) (v : ι → ℝ) (hv : ∀ i ∈ s, 0 ≤ v i ∧ v i ≤ 1 / 2) include ι s v hv /- Independent local survival factors retain mass at least `exp(-2 λ)` when their exclusion probabilities are at most one half. -/ theorem exclusion_product_exp_lower : Real.exp (-2 * ∑ i ∈ s, v i) ≤ ∏ i ∈ s, (1 - v i) := by calc _ = ∏ i ∈ s, Real.exp (-2 * v i) := by rw [mul_sum, Real.exp_sum] _ ≤ _ := prod_le_prod₀ (fun i hi => (Real.exp_pos _).le) (fun i hi => exclusion_exp_lower (hv i hi).1 (hv i hi).2) /- An absolute error becomes a relative one at the cost of the reciprocal survival lower bound. -/ theorem exclusion_relative_error {A E : ℝ} (hE : |A - ∏ i ∈ s, (1 - v i)| ≤ E) : |A / (∏ i ∈ s, (1 - v i)) - 1| ≤ Real.exp (2 * ∑ i ∈ s, v i) * E := by have hp := exclusion_product_exp_lower s v hv have hp0 : 0 < ∏ i ∈ s, (1 - v i) := (Real.exp_pos _).trans_le hp have hE0 : 0 ≤ E := (abs_nonneg _).trans hE calc _ = |A - ∏ i ∈ s, (1 - v i)| / (∏ i ∈ s, (1 - v i)) := by calc _ = |(A - ∏ i ∈ s, (1 - v i)) / (∏ i ∈ s, (1 - v i))| := by congr 1 field_simp _ = _ := by rw [abs_div, abs_of_pos hp0] _ ≤ E / (∏ i ∈ s, (1 - v i)) := div_le_div_of_nonneg_right hE hp0.le _ ≤ E / Real.exp (-2 * ∑ i ∈ s, v i) := div_le_div_of_nonneg_left hE0 (Real.exp_pos _) hp _ = _ := by rw [show -2 * (∑ i ∈ s, v i) = -(2 * ∑ i ∈ s, v i) by ring, Real.exp_neg]; field_simp end end section open Finset /- CRT with one distinguished coordinate and an arbitrary finite set of other coordinates. The distinguished weight can have either sign. -/ theorem distinguished_crt_error {ι : Type*} [DecidableEq ι] (q : ℕ) [NeZero q] (m : ι → ℕ) [∀ i, NeZero (m i)] (hc : Pairwise (fun i j => Nat.Coprime (m i) (m j))) (hqm : ∀ i, Nat.Coprime q (m i)) (F : ZMod q → ℝ) (X : ∀ i, ZMod (m i) → ℝ) (s : Finset ι) (N : ℕ) : |(∑ n ∈ range N, F (n : ZMod q) * ∏ i ∈ s, X i (n : ZMod (m i))) - ((N : ℝ) / q) * (∑ r : ZMod q, F r) * (∏ i ∈ s, exclusionLocalMean m X i)| ≤ 2 * (∑ r : ZMod q, |F r|) * ∏ i ∈ s, exclusionLocalMass m X i := by let M : Unit ⊕ s → ℕ := Sum.elim (fun _ => q) (fun i => m i) let W : ∀ i, ZMod (M i) → ℝ := fun i => match i with | .inl _ => F | .inr j => X j let : ∀ i, NeZero (M i) := fun i => by cases i <;> dsimp [M] <;> infer_instance have hM : Pairwise (fun i j => Nat.Coprime (M i) (M j)) := by intro i j hij cases i with | inl i => cases j with | inl j => exact False.elim (hij (by congr)) | inr j => exact hqm j | inr i => cases j with | inl j => exact (hqm i).symm | inr j => exact hc (fun h => hij (congrArg Sum.inr (Subtype.ext h))) have he := lifespan_crt_interval_error M hM W N simp only [Fintype.prod_sum_type, Fintype.prod_unique] at he change |(∑ n ∈ range N, F (n : ZMod q) * ∏ i : s, X i (n : ZMod (m i))) - ((N : ℝ) / ((q * ∏ i : s, m i) : ℕ)) * ((∑ r : ZMod q, F r) * ∏ i : s, ∑ r, X i r)| ≤ 2 * ((∑ r : ZMod q, |F r|) * ∏ i : s, ∑ r, |X i r|) at he have hp : ∀ n : ℕ, (∏ i : s, X i (n : ZMod (m i))) = ∏ i ∈ s, X i (n : ZMod (m i)) := fun n => prod_coe_sort s (fun i => X i (n : ZMod (m i))) simp_rw [hp] at he rw [prod_coe_sort s m, prod_coe_sort s (fun i => ∑ r, X i r), prod_coe_sort s (fun i => ∑ r, |X i r|)] at he have hmain : ((N : ℝ) / ((q * ∏ i ∈ s, m i) : ℕ)) * ((∑ r : ZMod q, F r) * ∏ i ∈ s, ∑ r, X i r) = ((N : ℝ) / q) * (∑ r : ZMod q, F r) * ∏ i ∈ s, exclusionLocalMean m X i := by simp only [exclusionLocalMean, prod_div_distrib, Nat.cast_mul, prod_natCast] ring rw [hmain] at he simpa only [exclusionLocalMass, mul_assoc] using he /- The normalized finite averaging weight associated to a fixed active residue. It has mass approximately one, with the boundary error retained. -/ noncomputable def activeCongruenceWeight (q N : ℕ) (r : ZMod q) (n : ℕ) : ℝ := (q : ℝ) / N * (if (n : ZMod q) = r then 1 else 0) theorem active_congruence_weight_nonneg (q N : ℕ) (r : ZMod q) (n : ℕ) : 0 ≤ activeCongruenceWeight q N r n := by unfold activeCongruenceWeight positivity section variable {ι : Type*} [sharedInstance1 : DecidableEq ι] (q : ℕ) [sharedInstance3 : NeZero q] (m : ι → ℕ) [sharedInstance5 : ∀ i, NeZero (m i)] (hc : Pairwise (fun i j => Nat.Coprime (m i) (m j))) (hqm : ∀ i, Nat.Coprime q (m i)) (r : ZMod q) (X : ∀ i, ZMod (m i) → ℝ) (s : Finset ι) include ι sharedInstance1 q sharedInstance3 m sharedInstance5 hc hqm r X s /- A fixed active congruence multiplies the monomial boundary error by `q`, and changes none of the model means at the coprime inactive moduli. -/ theorem conditioned_crt_monomial {N : ℕ} (hN : 0 < N) : |(∑ n ∈ range N, activeCongruenceWeight q N r n * ∏ i ∈ s, X i (n : ZMod (m i))) - (∏ i ∈ s, exclusionLocalMean m X i)| ≤ (2 * (q : ℝ) / N) * ∏ i ∈ s, exclusionLocalMass m X i := by have hq : (q : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne q have hNr : (0 : ℝ) < N := by exact_mod_cast hN have hs : 0 ≤ (q : ℝ) / N := by positivity have he := distinguished_crt_error q m hc hqm (fun t => if t = r then 1 else 0) X s N simp only [sum_ite_eq', mem_univ, if_true, abs_ite, abs_one, abs_zero, mul_one] at he have halg : (∑ n ∈ range N, activeCongruenceWeight q N r n * ∏ i ∈ s, X i (n : ZMod (m i))) - (∏ i ∈ s, exclusionLocalMean m X i) = ((q : ℝ) / N) * ((∑ n ∈ range N, (if (n : ZMod q) = r then 1 else 0) * ∏ i ∈ s, X i (n : ZMod (m i))) - ((N : ℝ) / q) * ∏ i ∈ s, exclusionLocalMean m X i) := by simp only [activeCongruenceWeight, mul_assoc, ← mul_sum] field_simp rw [halg, abs_mul, abs_of_nonneg hs] calc _ ≤ ((q : ℝ) / N) * (2 * ∏ i ∈ s, exclusionLocalMass m X i) := mul_le_mul_of_nonneg_left he hs _ = _ := by ring /- The elementary-moment comparison retains the same active-modulus cost at every degree, including degree zero. -/ theorem conditioned_crt_moment {N : ℕ} (hN : 0 < N) (k : ℕ) : |(∑ n ∈ range N, activeCongruenceWeight q N r n * exclusionElementary s (fun i => X i (n : ZMod (m i))) k) - exclusionElementary s (exclusionLocalMean m X) k| ≤ (2 * (q : ℝ) / N) * exclusionElementary s (exclusionLocalMass m X) k := by have he : (∑ n ∈ range N, activeCongruenceWeight q N r n * exclusionElementary s (fun i => X i (n : ZMod (m i))) k) - exclusionElementary s (exclusionLocalMean m X) k = ∑ t ∈ s.powersetCard k, ((∑ n ∈ range N, activeCongruenceWeight q N r n * ∏ i ∈ t, X i (n : ZMod (m i))) - ∏ i ∈ t, exclusionLocalMean m X i) := by simp only [exclusionElementary, mul_sum] rw [sum_comm, ← sum_sub_distrib] rw [he] calc _ ≤ ∑ t ∈ s.powersetCard k, |(∑ n ∈ range N, activeCongruenceWeight q N r n * ∏ i ∈ t, X i (n : ZMod (m i))) - ∏ i ∈ t, exclusionLocalMean m X i| := abs_sum_le_sum_abs _ _ _ ≤ ∑ t ∈ s.powersetCard k, (2 * (q : ℝ) / N) * ∏ i ∈ t, exclusionLocalMass m X i := by exact sum_le_sum (fun t ht => conditioned_crt_monomial q m hc hqm r X t hN) _ = _ := by rw [← mul_sum]; rfl /- Finite residue replacement conditioned on the active congruence. The error uses only low-degree masses at the inactive moduli. -/ theorem conditioned_crt_product_error (hX : ∀ i ∈ s, ∀ t, 0 ≤ X i t ∧ X i t ≤ 1) {N : ℕ} (hN : 0 < N) (k : ℕ) : |(∑ n ∈ range N, activeCongruenceWeight q N r n * ∏ i ∈ s, (1 - X i (n : ZMod (m i)))) - (∏ i ∈ s, (1 - exclusionLocalMean m X i))| ≤ 2 * ((∑ i ∈ s, exclusionLocalMean m X i)^k / (k.factorial : ℝ)) + (2 * (q : ℝ) / N) * ∑ j ∈ range (k + 1), exclusionElementary s (exclusionLocalMass m X) j := by have he := exclusion_moment_transfer_factorial s (range N) (activeCongruenceWeight q N r) (fun n i => X i (n : ZMod (m i))) (exclusionLocalMean m X) (fun j => (2 * (q : ℝ) / N) * exclusionElementary s (exclusionLocalMass m X) j) (fun n hn => active_congruence_weight_nonneg q N r n) (fun n hn i hi => hX i hi _) (fun i hi => exclusion_local_mean_unit m X i (hX i hi)) k (fun j hj => conditioned_crt_moment q m hc hqm r X s hN j) rwa [← mul_sum] at he /- Relative residue replacement with a fixed active congruence. The independent survival probability is bounded below before division. -/ theorem conditioned_crt_relative_error (hX : ∀ i ∈ s, ∀ t, 0 ≤ X i t ∧ X i t ≤ 1) (hsmall : ∀ i ∈ s, exclusionLocalMean m X i ≤ 1 / 2) {N : ℕ} (hN : 0 < N) (k : ℕ) : |(∑ n ∈ range N, activeCongruenceWeight q N r n * ∏ i ∈ s, (1 - X i (n : ZMod (m i)))) / (∏ i ∈ s, (1 - exclusionLocalMean m X i)) - 1| ≤ Real.exp (2 * ∑ i ∈ s, exclusionLocalMean m X i) * (2 * ((∑ i ∈ s, exclusionLocalMean m X i)^k / (k.factorial : ℝ)) + (2 * (q : ℝ) / N) * ∑ j ∈ range (k + 1), exclusionElementary s (exclusionLocalMass m X) j) := by apply exclusion_relative_error s (exclusionLocalMean m X) (fun i hi => ⟨(exclusion_local_mean_unit m X i (hX i hi)).1, hsmall i hi⟩) exact conditioned_crt_product_error q m hc hqm r X s hX hN k end end section open Finset /- A factorial tail bound sufficient for an arbitrary prescribed exponential precision, using only a linear choice of degree. -/ theorem exclusion_factorial_exp_bound {ℓ : ℝ} (hℓ : 0 ≤ ℓ) (k : ℕ) : ℓ^k / (k.factorial : ℝ) ≤ Real.exp (3 * ℓ - k) := by rw [Real.exp_sub] apply (le_div_iff₀ (Real.exp_pos _)).2 have he : (Real.exp 1)^k = Real.exp (k : ℝ) := by rw [← Real.exp_nat_mul] simp calc (ℓ^k / (k.factorial : ℝ)) * Real.exp (k : ℝ) = (Real.exp 1 * ℓ)^k / (k.factorial : ℝ) := by rw [mul_pow, he]; ring _ ≤ Real.exp (Real.exp 1 * ℓ) := Real.pow_div_factorial_le_exp _ (by positivity) k _ ≤ Real.exp (3 * ℓ) := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right Real.exp_one_lt_three.le hℓ) /- The finite sum of elementary absolute masses has a bound involving only their total mass and the truncation degree. -/ theorem exclusion_truncated_mass_bound {ι : Type*} (s : Finset ι) (c : ι → ℝ) (hc : ∀ i ∈ s, 0 ≤ c i) (k : ℕ) : (∑ j ∈ range (k + 1), exclusionElementary s c j) ≤ (k + 1 : ℕ) * (1 + ∑ i ∈ s, c i)^k := by have hsum : 0 ≤ ∑ i ∈ s, c i := sum_nonneg hc calc _ ≤ ∑ _j ∈ range (k + 1), (1 + ∑ i ∈ s, c i)^k := by apply sum_le_sum intro j hj have hjk : j ≤ k := by have := mem_range.mp hj; omega calc exclusionElementary s c j ≤ (∑ i ∈ s, c i)^j / (j.factorial : ℝ) := exclusion_elementary_le_pow_div_factorial s c hc j _ ≤ (∑ i ∈ s, c i)^j := div_le_self (pow_nonneg hsum j) (by exact_mod_cast Nat.factorial_pos j) _ ≤ (1 + ∑ i ∈ s, c i)^j := pow_le_pow_left₀ hsum (by linarith) j _ ≤ (1 + ∑ i ∈ s, c i)^k := pow_le_pow_right₀ (by linarith) hjk _ = _ := by simp /- The factorial part of the relative error is at most half the requested precision once the degree exceeds a linear threshold. -/ theorem exclusion_relative_tail_small {ℓ B : ℝ} (hℓ : 0 ≤ ℓ) (k : ℕ) (hk : 5 * ℓ + B + Real.log 4 ≤ (k : ℝ)) : Real.exp (2 * ℓ) * (2 * (ℓ^k / (k.factorial : ℝ))) ≤ Real.exp (-B) / 2 := by calc _ ≤ Real.exp (2 * ℓ) * (2 * Real.exp (3 * ℓ - k)) := by gcongr exact exclusion_factorial_exp_bound hℓ k _ = 2 * Real.exp (5 * ℓ - k) := by rw [mul_left_comm, ← Real.exp_add] congr 2 ring _ ≤ 2 * Real.exp (-B - Real.log 4) := by apply mul_le_mul_of_nonneg_left _ (by norm_num) exact Real.exp_le_exp.mpr (by linarith) _ = _ := by rw [Real.exp_sub, Real.exp_log (by norm_num : (0 : ℝ) < 4)]; ring /- A direct numerical condition for the arithmetic half of the relative error. Its logarithm will later be compared with the interval length. -/ theorem exclusion_relative_arithmetic_small {ℓ B C q N T : ℝ} (hN : 0 < N) (hq : 0 ≤ q) (k : ℕ) (hT : T ≤ (k + 1 : ℕ) * (1 + C)^k) (hsize : 4 * q * (k + 1 : ℕ) * Real.exp (B + 2 * ℓ) * (1 + C)^k ≤ N) : Real.exp (2 * ℓ) * ((2 * q / N) * T) ≤ Real.exp (-B) / 2 := by have hexp : Real.exp (B + 2 * ℓ) * Real.exp (-B) = Real.exp (2 * ℓ) := by rw [← Real.exp_add] congr 1 ring calc _ ≤ Real.exp (2 * ℓ) * ((2 * q / N) * ((k + 1 : ℕ) * (1 + C)^k)) := by exact mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hT (by positivity)) (by positivity) _ = ((4 * q * (k + 1 : ℕ) * Real.exp (B + 2 * ℓ) * (1 + C)^k) / N) * (Real.exp (-B) / 2) := by rw [show (4 * q * (k + 1 : ℕ) * Real.exp (B + 2 * ℓ) * (1 + C)^k / N) * (Real.exp (-B) / 2) = (2 * q / N) * (k + 1 : ℕ) * (1 + C)^k * (Real.exp (B + 2 * ℓ) * Real.exp (-B)) by ring, hexp] ring _ ≤ 1 * (Real.exp (-B) / 2) := mul_le_mul_of_nonneg_right ((div_le_one hN).2 hsize) (by positivity) _ = _ := one_mul _ /- Finite numerical assumptions that ensure exponentially small relative error after both the Bonferroni and CRT contributions are included. -/ theorem residue_replacement_error_small {ℓ B C q N T : ℝ} (hℓ : 0 ≤ ℓ) (hN : 0 < N) (hq : 0 ≤ q) (k : ℕ) (hk : 5 * ℓ + B + Real.log 4 ≤ (k : ℝ)) (hT : T ≤ (k + 1 : ℕ) * (1 + C)^k) (hsize : 4 * q * (k + 1 : ℕ) * Real.exp (B + 2 * ℓ) * (1 + C)^k ≤ N) : Real.exp (2 * ℓ) * (2 * (ℓ^k / (k.factorial : ℝ)) + (2 * q / N) * T) ≤ Real.exp (-B) := by rw [mul_add] have htail := exclusion_relative_tail_small hℓ k hk have harith := exclusion_relative_arithmetic_small hN hq k hT hsize linarith /- An additive logarithmic budget suffices for the interval-size condition. -/ theorem residue_size_condition_of_log {ℓ B C q N : ℝ} (hC : 0 ≤ C) (hq : 0 < q) (hN : 0 < N) (k : ℕ) (hlog : Real.log 4 + Real.log q + Real.log (k + 1 : ℕ) + B + 2 * ℓ + (k : ℝ) * Real.log (1 + C) ≤ Real.log N) : 4 * q * (k + 1 : ℕ) * Real.exp (B + 2 * ℓ) * (1 + C)^k ≤ N := by apply (Real.log_le_log_iff (by positivity) hN).mp have he : Real.log (4 * q * (k + 1 : ℕ) * Real.exp (B + 2 * ℓ) * (1 + C)^k) = Real.log 4 + Real.log q + Real.log (k + 1 : ℕ) + B + 2 * ℓ + (k : ℝ) * Real.log (1 + C) := by rw [Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), Real.log_mul (by norm_num) hq.ne', Real.log_exp, Real.log_pow] ring rwa [he] /- An explicit finite criterion for exponentially accurate residue replacement with the active congruence imposed. -/ theorem conditioned_crt_exponential_error {ι : Type*} [DecidableEq ι] (q : ℕ) [NeZero q] (m : ι → ℕ) [∀ i, NeZero (m i)] (hc : Pairwise (fun i j => Nat.Coprime (m i) (m j))) (hqm : ∀ i, Nat.Coprime q (m i)) (r : ZMod q) (X : ∀ i, ZMod (m i) → ℝ) (s : Finset ι) (hX : ∀ i ∈ s, ∀ t, 0 ≤ X i t ∧ X i t ≤ 1) (hsmall : ∀ i ∈ s, exclusionLocalMean m X i ≤ 1 / 2) {N : ℕ} (hN : 0 < N) (k : ℕ) (B : ℝ) (hk : 5 * (∑ i ∈ s, exclusionLocalMean m X i) + B + Real.log 4 ≤ (k : ℝ)) (hsize : 4 * (q : ℝ) * (k + 1 : ℕ) * Real.exp (B + 2 * ∑ i ∈ s, exclusionLocalMean m X i) * (1 + ∑ i ∈ s, exclusionLocalMass m X i)^k ≤ N) : |(∑ n ∈ range N, activeCongruenceWeight q N r n * ∏ i ∈ s, (1 - X i (n : ZMod (m i)))) / (∏ i ∈ s, (1 - exclusionLocalMean m X i)) - 1| ≤ Real.exp (-B) := by refine (conditioned_crt_relative_error q m hc hqm r X s hX hsmall hN k).trans ?_ exact residue_replacement_error_small (sum_nonneg (fun i hi => (exclusion_local_mean_unit m X i (hX i hi)).1)) (by exact_mod_cast hN) (Nat.cast_nonneg q) k hk (exclusion_truncated_mass_bound s (exclusionLocalMass m X) (fun i hi => sum_nonneg (fun t ht => abs_nonneg _)) k) hsize end section open Finset /- Parameterize an integer interval by its nonnegative offsets. -/ theorem integer_interval_sum {A : Type*} [AddCommMonoid A] (f : ℤ → A) (z : ℤ) (N : ℕ) : (∑ n ∈ range N, f (z + n)) = ∑ n ∈ Ico z (z + N), f n := by refine sum_bij (fun n hn => z + (n : ℤ)) ?_ ?_ ?_ ?_ · intro n hn simp only [mem_range] at hn simp only [mem_Ico] omega · intro a ha b hb he omega · intro n hn simp only [mem_Ico] at hn refine ⟨(n - z).toNat, ?_, ?_⟩ · simp only [mem_range] omega · omega · intro n hn rfl section variable {ι : Type*} (m : ι → ℕ) [sharedInstance2 : ∀ i, NeZero (m i)] (X : ∀ i, ZMod (m i) → ℝ) (z : ℤ) (i : ι) include ι m sharedInstance2 X z i /- Translation preserves the uniform local mean. -/ theorem exclusion_local_mean_translate : exclusionLocalMean m (fun j t => X j ((z : ZMod (m j)) + t)) i = exclusionLocalMean m X i := by unfold exclusionLocalMean congr 1 exact Equiv.sum_comp (Equiv.addLeft (z : ZMod (m i))) (X i) /- Translation preserves the local absolute mass as well. -/ theorem exclusion_local_mass_translate : exclusionLocalMass m (fun j t => X j ((z : ZMod (m j)) + t)) i = exclusionLocalMass m X i := by unfold exclusionLocalMass exact Equiv.sum_comp (Equiv.addLeft (z : ZMod (m i))) (fun t => |X i t|) end /- The same active-residue weight, evaluated at integer positions. -/ noncomputable def activeIntegerCongruenceWeight (q N : ℕ) (r : ZMod q) (n : ℤ) : ℝ := (q : ℝ) / N * (if (n : ZMod q) = r then 1 else 0) theorem active_congruence_weight_translate (q N : ℕ) (r : ZMod q) (z : ℤ) (n : ℕ) : activeCongruenceWeight q N (r - z) n = activeIntegerCongruenceWeight q N r (z + n) := by simp only [activeCongruenceWeight, activeIntegerCongruenceWeight, Int.cast_add, Int.cast_natCast, eq_sub_iff_add_eq, add_comm] /- Exponentially accurate relative residue replacement on an arbitrary integer interval, with one fixed active congruence. -/ theorem conditioned_crt_integer_interval {ι : Type*} [DecidableEq ι] (q : ℕ) [NeZero q] (m : ι → ℕ) [∀ i, NeZero (m i)] (hc : Pairwise (fun i j => Nat.Coprime (m i) (m j))) (hqm : ∀ i, Nat.Coprime q (m i)) (r : ZMod q) (X : ∀ i, ZMod (m i) → ℝ) (s : Finset ι) (hX : ∀ i ∈ s, ∀ t, 0 ≤ X i t ∧ X i t ≤ 1) (hsmall : ∀ i ∈ s, exclusionLocalMean m X i ≤ 1 / 2) {N : ℕ} (hN : 0 < N) (z : ℤ) (k : ℕ) (B : ℝ) (hk : 5 * (∑ i ∈ s, exclusionLocalMean m X i) + B + Real.log 4 ≤ (k : ℝ)) (hsize : 4 * (q : ℝ) * (k + 1 : ℕ) * Real.exp (B + 2 * ∑ i ∈ s, exclusionLocalMean m X i) * (1 + ∑ i ∈ s, exclusionLocalMass m X i)^k ≤ N) : |(∑ n ∈ Ico z (z + N), activeIntegerCongruenceWeight q N r n * ∏ i ∈ s, (1 - X i (n : ZMod (m i)))) / (∏ i ∈ s, (1 - exclusionLocalMean m X i)) - 1| ≤ Real.exp (-B) := by have hsmall' : ∀ i ∈ s, exclusionLocalMean m (fun j t => X j ((z : ZMod (m j)) + t)) i ≤ 1 / 2 := by intro i hi simpa only [exclusion_local_mean_translate] using hsmall i hi have he := conditioned_crt_exponential_error q m hc hqm (r - z) (fun j t => X j ((z : ZMod (m j)) + t)) s (fun i hi t => hX i hi _) hsmall' hN k B (by simpa only [exclusion_local_mean_translate] using hk) (by simpa only [exclusion_local_mean_translate, exclusion_local_mass_translate] using hsize) simp_rw [exclusion_local_mean_translate, active_congruence_weight_translate] at he rw [← integer_interval_sum] simpa only [Int.cast_add, Int.cast_natCast] using he /- Multiplying both the finite average and its model by a deterministic nonnegative damping factor preserves a relative-error estimate, including the case where that damping factor is zero. -/ theorem restore_deterministic_damping {A P D E : ℝ} (hP : 0 < P) (hD : 0 ≤ D) (hE : |A / P - 1| ≤ E) : |D * A - D * P| ≤ E * (D * P) := by have he : |A / P - 1| * P = |A - P| := by calc _ = |(A / P - 1) * P| := by rw [abs_mul, abs_of_pos hP] _ = _ := by congr 1; field_simp have hb := mul_le_mul_of_nonneg_right hE hP.le rw [he] at hb calc _ = D * |A - P| := by rw [← mul_sub, abs_mul, abs_of_nonneg hD] _ ≤ D * (E * P) := mul_le_mul_of_nonneg_left hb hD _ = _ := by ring end section open Finset /- Congruence at each coprime factor is equivalent to congruence at their product, for arbitrary integer positions. -/ theorem integer_congruences_product_iff {ι : Type*} (m : ι → ℕ) (s : Finset ι) (hc : (s : Set ι).Pairwise (fun i j => Nat.Coprime (m i) (m j))) (n c : ℤ) : (∀ i ∈ s, (n : ZMod (m i)) = (c : ZMod (m i))) ↔ (n : ZMod (∏ i ∈ s, m i)) = (c : ZMod (∏ i ∈ s, m i)) := by simp only [ZMod.intCast_eq_intCast_iff_dvd_sub] rw [prod_natCast] constructor · intro h exact prod_dvd_of_coprime (fun i hi j hj hij => (hc hi hj hij).isCoprime) h · intro h i hi exact (dvd_prod_of_mem (fun j => (m j : ℤ)) hi).trans h /- Arbitrary prescribed residues at pairwise coprime positive moduli have a common integer representative, unique modulo the product. -/ theorem active_congruences_representative {ι : Type*} (m : ι → ℕ) [∀ i, NeZero (m i)] (s : Finset ι) (hc : (s : Set ι).Pairwise (fun i j => Nat.Coprime (m i) (m j))) (r : ∀ i, ZMod (m i)) : ∃ c : ℤ, ∀ n : ℤ, (∀ i ∈ s, (n : ZMod (m i)) = r i) ↔ (n : ZMod (∏ i ∈ s, m i)) = (c : ZMod (∏ i ∈ s, m i)) := by have hm : ∀ i ∈ s, m i ≠ 0 := fun i hi => NeZero.ne (m i) let c := Nat.chineseRemainderOfFinset (fun i => (r i).val) m s hm hc have hr : ∀ i ∈ s, ((c.val : ℤ) : ZMod (m i)) = r i := by intro i hi rw [Int.cast_natCast] have he : (c.val : ZMod (m i)) = ((r i).val : ZMod (m i)) := (ZMod.natCast_eq_natCast_iff _ _ _).2 (c.property i hi) exact he.trans (ZMod.natCast_zmod_val (r i)) refine ⟨c.val, ?_⟩ intro n rw [← integer_congruences_product_iff m s hc n c.val] constructor · intro h i hi exact (h i hi).trans (hr i hi).symm · intro h i hi exact (h i hi).trans (hr i hi) /- The product of active-hit indicators is exactly one indicator at the active product modulus, so it incurs only one density factor. -/ theorem active_indicator_product {ι : Type*} [DecidableEq ι] (m : ι → ℕ) [∀ i, NeZero (m i)] (s : Finset ι) (hc : (s : Set ι).Pairwise (fun i j => Nat.Coprime (m i) (m j))) (r : ∀ i, ZMod (m i)) : ∃ c : ℤ, ∀ n : ℤ, (∏ i ∈ s, (if (n : ZMod (m i)) = r i then (1 : ℝ) else 0)) = if (n : ZMod (∏ i ∈ s, m i)) = (c : ZMod (∏ i ∈ s, m i)) then 1 else 0 := by obtain ⟨c, hc⟩ := active_congruences_representative m s hc r refine ⟨c, ?_⟩ intro n rw [prod_boole] simp only [hc n] /- A nonnegative deterministic damping factor can be restored without weakening the relative finite-interval estimate. -/ theorem conditioned_crt_damped_interval {ι : Type*} [DecidableEq ι] (q : ℕ) [NeZero q] (m : ι → ℕ) [∀ i, NeZero (m i)] (hc : Pairwise (fun i j => Nat.Coprime (m i) (m j))) (hqm : ∀ i, Nat.Coprime q (m i)) (r : ZMod q) (X : ∀ i, ZMod (m i) → ℝ) (s : Finset ι) (hX : ∀ i ∈ s, ∀ t, 0 ≤ X i t ∧ X i t ≤ 1) (hsmall : ∀ i ∈ s, exclusionLocalMean m X i ≤ 1 / 2) {N : ℕ} (hN : 0 < N) (z : ℤ) (k : ℕ) (B D : ℝ) (hD : 0 ≤ D) (hk : 5 * (∑ i ∈ s, exclusionLocalMean m X i) + B + Real.log 4 ≤ (k : ℝ)) (hsize : 4 * (q : ℝ) * (k + 1 : ℕ) * Real.exp (B + 2 * ∑ i ∈ s, exclusionLocalMean m X i) * (1 + ∑ i ∈ s, exclusionLocalMass m X i)^k ≤ N) : |(D / (N : ℝ)) * (∑ n ∈ Ico z (z + N), (if (n : ZMod q) = r then 1 else 0) * ∏ i ∈ s, (1 - X i (n : ZMod (m i)))) - (D / (q : ℝ)) * (∏ i ∈ s, (1 - exclusionLocalMean m X i))| ≤ Real.exp (-B) * ((D / (q : ℝ)) * ∏ i ∈ s, (1 - exclusionLocalMean m X i)) := by have he := conditioned_crt_integer_interval q m hc hqm r X s hX hsmall hN z k B hk hsize have hP : 0 < ∏ i ∈ s, (1 - exclusionLocalMean m X i) := by apply prod_pos intro i hi linarith [hsmall i hi] have hb := restore_deterministic_damping hP (show 0 ≤ D / (q : ℝ) by positivity) he have hq : (q : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne q have hmean : (D / (q : ℝ)) * (∑ n ∈ Ico z (z + N), activeIntegerCongruenceWeight q N r n * ∏ i ∈ s, (1 - X i (n : ZMod (m i)))) = (D / (N : ℝ)) * (∑ n ∈ Ico z (z + N), (if (n : ZMod q) = r then 1 else 0) * ∏ i ∈ s, (1 - X i (n : ZMod (m i)))) := by simp only [activeIntegerCongruenceWeight, mul_assoc, ← mul_sum] field_simp rwa [hmean] at hb end section open Finset /- The inactive damping of a prime whose residue was fixed by an active visit. -/ noncomputable def activeVisitDamping {R : Type*} [DecidableEq R] (visits active : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) (a : ℕ) : ℝ := ∏ i ∈ visits \ active, (1 - η i * (if h i = h a then 1 else 0)) /- Incompatible active visits vanish pointwise, before any averaging. -/ theorem active_residue_weight_incompatible {R : Type*} [DecidableEq R] (visits active : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) {a z : ℕ} (ha : a ∈ active) (hz : z ∈ active) (haz : h a ≠ h z) (r : R) : activeResidueWeight visits active h η r = 0 := by have hn : ¬ ∀ i ∈ active, r = h i := by intro hh exact haz ((hh a ha).symm.trans (hh z hz)) simp [activeResidueWeight, prod_boole, hn] /- Compatible active visits fix one residue; all their inactive damping can then be evaluated at that residue and factored out. -/ theorem active_residue_weight_factor {R : Type*} [DecidableEq R] (visits active : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) (a : ℕ) (ha : a ∈ active) (hc : ∀ i ∈ active, h i = h a) (r : R) : activeResidueWeight visits active h η r = (if r = h a then 1 else 0) * activeVisitDamping visits active h η a := by classical by_cases hr : r = h a · subst r have he : ∀ i ∈ active, h a = h i := fun i hi => (hc i hi).symm have hp : (∏ i ∈ active, (if h a = h i then (1 : ℝ) else 0)) = 1 := by apply prod_eq_one intro i hi simp only [if_pos (he i hi)] unfold activeResidueWeight activeVisitDamping rw [hp] simp only [ite_true, one_mul] apply prod_congr rfl intro i hi simp only [eq_comm] · have he : ¬ ∀ i ∈ active, r = h i := fun hh => hr (hh a ha) simp [activeResidueWeight, prod_boole, he, hr] /- The factored damping is nonnegative for unit-interval visit weights. -/ theorem active_visit_damping_nonneg {R : Type*} [DecidableEq R] (visits active : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) (a : ℕ) (hη : ∀ i ∈ visits, 0 ≤ η i ∧ η i ≤ 1) : 0 ≤ activeVisitDamping visits active h η a := by apply prod_nonneg intro i hi have hηi := hη i (mem_sdiff.mp hi).1 by_cases hh : h i = h a · simp only [hh, if_true, mul_one] linarith · simp [hh] /- A family of compatible active primes contributes exactly one combined congruence, times the product of its deterministic inactive damping. -/ theorem active_path_residue_factorization {ι : Type*} [DecidableEq ι] (m : ι → ℕ) [∀ i, NeZero (m i)] (S : Finset ι) (visits : Finset ℕ) (active : ι → Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) (a : ι → ℕ) (hm : (S : Set ι).Pairwise (fun i j => Nat.Coprime (m i) (m j))) (ha : ∀ i ∈ S, a i ∈ active i) (hc : ∀ i ∈ S, ∀ j ∈ active i, h i j = h i (a i)) : ∃ c : ℤ, ∀ n : ℤ, (∏ i ∈ S, activeResidueWeight visits (active i) (h i) η (n : ZMod (m i))) = (if (n : ZMod (∏ i ∈ S, m i)) = (c : ZMod (∏ i ∈ S, m i)) then 1 else 0) * ∏ i ∈ S, activeVisitDamping visits (active i) (h i) η (a i) := by obtain ⟨c, hroot⟩ := active_indicator_product m S hm (fun i => h i (a i)) refine ⟨c, ?_⟩ intro n calc _ = ∏ i ∈ S, (if (n : ZMod (m i)) = h i (a i) then 1 else 0) * activeVisitDamping visits (active i) (h i) η (a i) := by apply prod_congr rfl intro i hi exact active_residue_weight_factor visits (active i) (h i) η (a i) (ha i hi) (hc i hi) _ _ = _ := by rw [prod_mul_distrib, hroot n] /- A single incompatible active prime makes the full active-family contribution vanish at every integer position. -/ theorem active_path_residue_incompatible {ι : Type*} [DecidableEq ι] (m : ι → ℕ) (S : Finset ι) (visits : Finset ℕ) (active : ι → Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) {i : ι} (hi : i ∈ S) {a z : ℕ} (ha : a ∈ active i) (hz : z ∈ active i) (haz : h i a ≠ h i z) (n : ℤ) : (∏ j ∈ S, activeResidueWeight visits (active j) (h j) η (n : ZMod (m j))) = 0 := by apply prod_eq_zero hi exact active_residue_weight_incompatible visits (active i) (h i) η ha hz haz _ end section /- Reservoir indices whose group labels lie in the selected subgroup. -/ noncomputable def subgroupReservoir {G ι : Type*} [Group G] (S : Finset ι) (g : ι → G) (H : Subgroup G) : Finset ι := by classical exact S.filter fun i => g i ∈ H theorem subgroupReservoir_top {G ι : Type*} [Group G] (S : Finset ι) (g : ι → G) : subgroupReservoir S g ⊤ = S := by classical simp [subgroupReservoir] /- A proper subgroup of a finite group has at most half its order. -/ theorem subgroup_card_twice_le {G : Type*} [Group G] [Finite G] {K H : Subgroup G} (hKH : K < H) : 2 * Nat.card K ≤ Nat.card H := by have hKpos : 0 < Nat.card K := Nat.card_pos have hlt : Nat.card K < Nat.card H := by by_contra h exact hKH.ne (Subgroup.eq_of_le_of_card_ge hKH.le (by omega)) obtain ⟨d, hd⟩ := Subgroup.card_dvd_of_le hKH.le have hd2 : 2 ≤ d := by nlinarith nlinarith /- Logarithmic subgroup complexity drops by at least one at a proper inclusion. -/ theorem subgroup_log_card_step {G : Type*} [Group G] [Finite G] {K H : Subgroup G} (hKH : K < H) : Nat.log 2 (Nat.card K) + 1 ≤ Nat.log 2 (Nat.card H) := by have h := Nat.log_mono_right (b := 2) (subgroup_card_twice_le hKH) rw [Nat.mul_comm 2 (Nat.card K), Nat.log_mul_base (by decide) Nat.card_pos.ne'] at h exact h /- There is a subgroup retaining all but `M * log₂ |G|` reservoir indices, while every proper subgroup of it loses at least `M` further indices. The argument works for any finite group, without commutativity. -/ theorem exists_pruned_subgroup {G ι : Type*} [Group G] [Finite G] (S : Finset ι) (g : ι → G) {M : ℝ} (hM : 0 ≤ M) : ∃ H : Subgroup G, (S.card : ℝ) - ((subgroupReservoir S g H).card : ℝ) ≤ M * Nat.log 2 (Nat.card G) ∧ ∀ K : Subgroup G, K < H → M ≤ ((subgroupReservoir S g H).card : ℝ) - ((subgroupReservoir S g K).card : ℝ) := by classical let := Fintype.ofFinite (Subgroup G) let potential : Subgroup G → ℝ := fun H => ((subgroupReservoir S g H).card : ℝ) - M * Nat.log 2 (Nat.card H) obtain ⟨H, _, hmax⟩ := Finset.exists_max_image (Finset.univ : Finset (Subgroup G)) potential Finset.univ_nonempty have hmax' : ∀ K : Subgroup G, potential K ≤ potential H := fun K => hmax K (Finset.mem_univ K) refine ⟨H, ?_, ?_⟩ · have htop := hmax' ⊤ simp only [potential, subgroupReservoir_top, Subgroup.card_top] at htop have hpenalty : 0 ≤ M * (Nat.log 2 (Nat.card H) : ℝ) := mul_nonneg hM (Nat.cast_nonneg _) linarith · intro K hKH have hK := hmax' K have hlog : (Nat.log 2 (Nat.card K) : ℝ) + 1 ≤ Nat.log 2 (Nat.card H) := by exact_mod_cast subgroup_log_card_step hKH have hmul := mul_le_mul_of_nonneg_left hlog hM dsimp [potential] at hK nlinarith /- A proper subgroup of `H` remains proper when regarded in the ambient group. -/ theorem map_subtype_lt_of_ne_top {G : Type*} [Group G] (H : Subgroup G) (K : Subgroup H) (hK : K ≠ ⊤) : K.map H.subtype < H := by have h : K.map H.subtype < (⊤ : Subgroup H).map H.subtype := Subgroup.map_subtype_lt_map_subtype.mpr (lt_top_iff_ne_top.mpr hK) simpa only [← MonoidHom.range_eq_map, Subgroup.range_subtype] using h section variable {G ι : Type*} [sharedInstance1 : Group G] [sharedInstance2 : Finite G] (S : Finset ι) (g : ι → G) {M : ℝ} (hM : 0 ≤ M) include G ι sharedInstance1 sharedInstance2 S g M hM /- Pruning expressed directly for every proper subgroup of the retained group. -/ theorem exists_pruned_subgroup_internal : ∃ H : Subgroup G, (S.card : ℝ) - ((subgroupReservoir S g H).card : ℝ) ≤ M * Nat.log 2 (Nat.card G) ∧ ∀ K : Subgroup H, K ≠ ⊤ → M ≤ ((subgroupReservoir S g H).card : ℝ) - ((subgroupReservoir S g (K.map H.subtype)).card : ℝ) := by obtain ⟨H, hloss, hstable⟩ := exists_pruned_subgroup S g hM refine ⟨H, hloss, ?_⟩ intro K hK exact hstable _ (map_subtype_lt_of_ne_top H K hK) /- If the pruning budget is at most half the reservoir, at least half survives. -/ theorem exists_pruned_subgroup_half (hbudget : M * Nat.log 2 (Nat.card G) ≤ (S.card : ℝ) / 2) : ∃ H : Subgroup G, (S.card : ℝ) / 2 ≤ ((subgroupReservoir S g H).card : ℝ) ∧ ∀ K : Subgroup H, K ≠ ⊤ → M ≤ ((subgroupReservoir S g H).card : ℝ) - ((subgroupReservoir S g (K.map H.subtype)).card : ℝ) := by obtain ⟨H, hloss, hstable⟩ := exists_pruned_subgroup_internal S g hM exact ⟨H, by linarith, hstable⟩ /- In particular every nontrivial multiplicative character of the retained subgroup has at least `M` indices outside its kernel. -/ theorem exists_character_pruned_subgroup (hbudget : M * Nat.log 2 (Nat.card G) ≤ (S.card : ℝ) / 2) : ∃ H : Subgroup G, (S.card : ℝ) / 2 ≤ ((subgroupReservoir S g H).card : ℝ) ∧ ∀ χ : H →* ℂ, χ ≠ 1 → M ≤ ((subgroupReservoir S g H).card : ℝ) - ((subgroupReservoir S g (χ.ker.map H.subtype)).card : ℝ) := by obtain ⟨H, hhalf, hstable⟩ := exists_pruned_subgroup_half S g hM hbudget refine ⟨H, hhalf, ?_⟩ intro χ hχ exact hstable χ.ker (fun h => hχ (MonoidHom.ker_eq_top_iff.mp h)) end end section open scoped BigOperators /- Powers of a unit complex number move at most linearly far from one. -/ theorem norm_pow_sub_one_le {z : ℂ} (hz : ‖z‖ = 1) (j : ℕ) : ‖z ^ j - 1‖ ≤ (j : ℝ) * ‖z - 1‖ := by induction j with | zero => simp | succ j ih => have he : z ^ (j + 1) - 1 = z * (z ^ j - 1) + (z - 1) := by ring rw [he] calc ‖z * (z ^ j - 1) + (z - 1)‖ ≤ ‖z * (z ^ j - 1)‖ + ‖z - 1‖ := norm_add_le _ _ _ = ‖z ^ j - 1‖ + ‖z - 1‖ := by rw [norm_mul, hz, one_mul] _ ≤ (j : ℝ) * ‖z - 1‖ + ‖z - 1‖ := by linarith _ = (↑(j + 1) : ℝ) * ‖z - 1‖ := by push_cast; ring /- A nontrivial `m`th root of unity is at least `2/m` away from one. -/ theorem root_unity_norm_sub_one_lower {z : ℂ} {m : ℕ} (hm : 0 < m) (hpow : z ^ m = 1) (hz1 : z ≠ 1) : 2 / (m : ℝ) ≤ ‖z - 1‖ := by have hnorm : ‖z‖ = 1 := (isOfFinOrder_iff_pow_eq_one.mpr ⟨m, hm, hpow⟩).norm_eq_one have hgeom : (∑ j ∈ Finset.range m, z ^ j) = 0 := by rw [geom_sum_eq hz1, hpow, sub_self, zero_div] have hsum : (m : ℝ) ≤ (∑ j ∈ Finset.range m, (j : ℝ)) * ‖z - 1‖ := by calc (m : ℝ) = ‖∑ j ∈ Finset.range m, (z ^ j - 1)‖ := by rw [Finset.sum_sub_distrib, hgeom] simp _ ≤ ∑ j ∈ Finset.range m, ‖z ^ j - 1‖ := norm_sum_le _ _ _ ≤ ∑ j ∈ Finset.range m, (j : ℝ) * ‖z - 1‖ := by exact Finset.sum_le_sum (fun j _ => norm_pow_sub_one_le hnorm j) _ = _ := (Finset.sum_mul _ _ _).symm have hm' : (0 : ℝ) < m := by exact_mod_cast hm have hsumtwice : (∑ j ∈ Finset.range m, (j : ℝ)) * 2 = (m : ℝ) * (m - 1 : ℝ) := by have h := congrArg (fun n : ℕ => (n : ℝ)) (Finset.sum_range_id_mul_two m) have hm1 : 1 ≤ m := hm simpa only [Nat.cast_mul, Nat.cast_ofNat, Nat.cast_sum, Nat.cast_sub hm1, Nat.cast_one] using h have htwice : (m : ℝ) * 2 ≤ (m : ℝ) * ((m - 1 : ℝ) * ‖z - 1‖) := by calc (m : ℝ) * 2 ≤ ((∑ j ∈ Finset.range m, (j : ℝ)) * ‖z - 1‖) * 2 := mul_le_mul_of_nonneg_right hsum (by norm_num) _ = ((∑ j ∈ Finset.range m, (j : ℝ)) * 2) * ‖z - 1‖ := by ring _ = _ := by rw [hsumtwice]; ring have htwo : 2 ≤ (m - 1 : ℝ) * ‖z - 1‖ := (mul_le_mul_iff_right₀ hm').mp htwice apply (div_le_iff₀ hm').mpr nlinarith [norm_nonneg (z - 1)] /- A polynomial lower bound on the phase gap of a nontrivial root of unity. -/ theorem root_unity_re_gap {z : ℂ} {m : ℕ} (hm : 0 < m) (hpow : z ^ m = 1) (hz1 : z ≠ 1) : 2 / (m : ℝ) ^ 2 ≤ 1 - z.re := by have hnorm : ‖z‖ = 1 := (isOfFinOrder_iff_pow_eq_one.mpr ⟨m, hm, hpow⟩).norm_eq_one have hlower := root_unity_norm_sub_one_lower hm hpow hz1 have hsquare := pow_le_pow_left₀ (by positivity : 0 ≤ 2 / (m : ℝ)) hlower 2 have he : (2 / (m : ℝ)) ^ 2 = 2 * (2 / (m : ℝ) ^ 2) := by ring rw [he, Complex.norm_sub_one_sq_eq_of_norm_eq_one hnorm] at hsquare linarith /- An upper bound on the order gives a common phase-gap bound. -/ theorem root_unity_re_gap_of_order_le {z : ℂ} {m R : ℕ} (hm : 0 < m) (hmR : m ≤ R) (hpow : z ^ m = 1) (hz1 : z ≠ 1) : 2 / (R : ℝ) ^ 2 ≤ 1 - z.re := by have hm' : (0 : ℝ) < m := by exact_mod_cast hm have hR' : (0 : ℝ) < R := by exact_mod_cast hm.trans_le hmR have hmR' : (m : ℝ) ≤ R := by exact_mod_cast hmR apply le_trans _ (root_unity_re_gap hm hpow hz1) apply (div_le_div_iff₀ (sq_pos_of_pos hR') (sq_pos_of_pos hm')).mpr nlinarith /- Root-of-unity values contribute a nonnegative phase gap. -/ theorem root_unity_re_gap_nonneg {z : ℂ} {m : ℕ} (hm : 0 < m) (hpow : z ^ m = 1) : 0 ≤ 1 - z.re := by have hnorm : ‖z‖ = 1 := (isOfFinOrder_iff_pow_eq_one.mpr ⟨m, hm, hpow⟩).norm_eq_one have h := Complex.re_le_norm z linarith section variable {ι : Type*} (S : Finset ι) (z : ι → ℂ) {m R : ℕ} (hm : 0 < m) (hmR : m ≤ R) (hpow : ∀ p ∈ S, (z p) ^ m = 1) include ι S z m R hm hmR hpow /- The count of separated values gives a total phase-energy lower bound. -/ theorem root_unity_phase_sum_le : (2 / (R : ℝ) ^ 2) * ((S.filter fun p => z p ≠ 1).card : ℝ) ≤ ∑ p ∈ S, (1 - (z p).re) := by classical calc _ = ∑ _p ∈ S.filter (fun p => z p ≠ 1), (2 / (R : ℝ) ^ 2) := by simp; ring _ ≤ ∑ p ∈ S.filter (fun p => z p ≠ 1), (1 - (z p).re) := by apply Finset.sum_le_sum intro p hp obtain ⟨hp, hz1⟩ := Finset.mem_filter.mp hp exact root_unity_re_gap_of_order_le hm hmR (hpow p hp) hz1 _ ≤ ∑ p ∈ S, (1 - (z p).re) := by apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ S) intro p hp _ exact root_unity_re_gap_nonneg hm (hpow p hp) /- If at least `M` values are nontrivial, the phase energy is at least `2M/R²`. -/ theorem root_unity_phase_sum_lower {M : ℝ} (hcount : M ≤ ((S.filter fun p => z p ≠ 1).card : ℝ)) : 2 * M / (R : ℝ) ^ 2 ≤ ∑ p ∈ S, (1 - (z p).re) := by calc _ = (2 / (R : ℝ) ^ 2) * M := by ring _ ≤ (2 / (R : ℝ) ^ 2) * ((S.filter fun p => z p ≠ 1).card : ℝ) := mul_le_mul_of_nonneg_left hcount (by positivity) _ ≤ _ := root_unity_phase_sum_le S z hm hmR hpow end end section open scoped BigOperators /- The normalized squared geometric sum. -/ noncomputable def fejerPolynomial (R : ℕ) (z : ℂ) : ℝ := ‖∑ j ∈ Finset.range R, z ^ j‖ ^ 2 / R theorem fejerPolynomial_nonneg (R : ℕ) (z : ℂ) : 0 ≤ fejerPolynomial R z := by exact div_nonneg (sq_nonneg _) (Nat.cast_nonneg _) /- If all powers in the geometric sum lie in the right half-plane with real part at least one half, the Fejér polynomial is at least `R / 4`. -/ theorem fejerPolynomial_lower_of_re {R : ℕ} (hR : 0 < R) (z : ℂ) (hre : ∀ j ∈ Finset.range R, (1 / 2 : ℝ) ≤ (z ^ j).re) : (R : ℝ) / 4 ≤ fejerPolynomial R z := by have hR' : (0 : ℝ) < R := by exact_mod_cast hR have hsum : (R : ℝ) / 2 ≤ (∑ j ∈ Finset.range R, z ^ j).re := by calc (R : ℝ) / 2 = ∑ _j ∈ Finset.range R, (1 / 2 : ℝ) := by simp; ring _ ≤ ∑ j ∈ Finset.range R, (z ^ j).re := Finset.sum_le_sum hre _ = _ := by simp have hnorm : (R : ℝ) / 2 ≤ ‖∑ j ∈ Finset.range R, z ^ j‖ := hsum.trans (Complex.re_le_norm _) unfold fejerPolynomial apply (le_div_iff₀ hR').mpr nlinarith [norm_nonneg (∑ j ∈ Finset.range R, z ^ j)] /- The elementary finite counting estimate behind Fejér concentration. -/ theorem card_filter_le_of_sum_le {ι : Type*} (S : Finset ι) (F : ι → ℝ) (hF : ∀ p ∈ S, 0 ≤ F p) {c B : ℝ} (hc : 0 < c) (hsum : ∑ p ∈ S, F p ≤ B) : ((S.filter fun p => c ≤ F p).card : ℝ) ≤ B / c := by classical apply (le_div_iff₀ hc).mpr calc ((S.filter fun p => c ≤ F p).card : ℝ) * c = ∑ _p ∈ S.filter (fun p => c ≤ F p), c := by simp _ ≤ ∑ p ∈ S.filter (fun p => c ≤ F p), F p := by apply Finset.sum_le_sum intro p hp exact (Finset.mem_filter.mp hp).2 _ ≤ ∑ p ∈ S, F p := by exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ S) (fun p hp _ => hF p hp) _ ≤ B := hsum /- Total mass at most `2Q` permits at most `8Q/R` large Fejér values. -/ theorem fejer_large_values_card_le {ι : Type*} (S : Finset ι) (z : ι → ℂ) {R : ℕ} (hR : 0 < R) {Q : ℝ} (hsum : ∑ p ∈ S, fejerPolynomial R (z p) ≤ 2 * Q) : ((S.filter fun p => (R : ℝ) / 4 ≤ fejerPolynomial R (z p)).card : ℝ) ≤ 8 * Q / R := by classical have hR' : (0 : ℝ) < R := by exact_mod_cast hR have h := card_filter_le_of_sum_le S (fun p => fejerPolynomial R (z p)) (fun p _ => fejerPolynomial_nonneg R (z p)) (by positivity : 0 < (R : ℝ) / 4) hsum convert h using 1 field_simp ring /- Shifting a geometric sum exposes its first coefficient. -/ theorem geometric_sum_succ (R : ℕ) (z : ℂ) : (∑ j ∈ Finset.range (R + 1), z ^ j) = 1 + z * ∑ j ∈ Finset.range R, z ^ j := by rw [Finset.sum_range_succ'] simp only [pow_zero, Finset.mul_sum, pow_succ'] ring /- The unnormalized Fejér polynomial satisfies this exact recurrence. -/ theorem geometric_norm_sq_succ (R : ℕ) (z : ℂ) (hz : ‖z‖ = 1) : ‖∑ j ∈ Finset.range (R + 1), z ^ j‖ ^ 2 = ‖∑ j ∈ Finset.range R, z ^ j‖ ^ 2 + 1 + 2 * ∑ j ∈ Finset.range R, (z ^ (j + 1)).re := by rw [geometric_sum_succ, ← Complex.normSq_eq_norm_sq, Complex.normSq_add] simp only [map_one, one_mul, Complex.conj_re, Complex.normSq_eq_norm_sq, norm_mul, hz, one_mul] have hsum : (z * ∑ j ∈ Finset.range R, z ^ j).re = ∑ j ∈ Finset.range R, (z ^ (j + 1)).re := by simp only [Finset.mul_sum, ← pow_succ', Complex.re_sum] rw [hsum] ring /- Low-power moment bounds control the total unnormalized Fejér mass. -/ theorem sum_geometric_norm_sq_le {ι : Type*} (S : Finset ι) (z : ι → ℂ) (hz : ∀ p ∈ S, ‖z p‖ = 1) (A : ℝ) (R : ℕ) (hmoment : ∀ j : ℕ, 1 ≤ j → j < R → ∑ p ∈ S, ((z p) ^ j).re ≤ A) : ∑ p ∈ S, ‖∑ j ∈ Finset.range R, (z p) ^ j‖ ^ 2 ≤ (R : ℝ) * S.card + (R : ℝ) * (R - 1 : ℝ) * A := by induction R with | zero => simp | succ R ih => have hprev : ∀ j : ℕ, 1 ≤ j → j < R → ∑ p ∈ S, ((z p) ^ j).re ≤ A := by intro j hj hjR exact hmoment j hj (by omega) have hrec : (∑ p ∈ S, ‖∑ j ∈ Finset.range (R + 1), (z p) ^ j‖ ^ 2) = (∑ p ∈ S, ‖∑ j ∈ Finset.range R, (z p) ^ j‖ ^ 2) + S.card + 2 * ∑ j ∈ Finset.range R, ∑ p ∈ S, ((z p) ^ (j + 1)).re := by calc _ = ∑ p ∈ S, (‖∑ j ∈ Finset.range R, (z p) ^ j‖ ^ 2 + 1 + 2 * ∑ j ∈ Finset.range R, ((z p) ^ (j + 1)).re) := by apply Finset.sum_congr rfl intro p hp exact geometric_norm_sq_succ R (z p) (hz p hp) _ = _ := by simp only [Finset.sum_add_distrib, Finset.sum_const, nsmul_eq_mul, mul_one, ← Finset.mul_sum] rw [Finset.sum_comm] have hm : (∑ j ∈ Finset.range R, ∑ p ∈ S, ((z p) ^ (j + 1)).re) ≤ R * A := by calc _ ≤ ∑ _j ∈ Finset.range R, A := by apply Finset.sum_le_sum intro j hj exact hmoment (j + 1) (by omega) (by have := Finset.mem_range.mp hj; omega) _ = _ := by simp rw [hrec] have hp := ih hprev push_cast nlinarith /- The Fejér total mass follows directly from the real parts of all nontrivial low-power moments. -/ theorem sum_fejerPolynomial_le {ι : Type*} (S : Finset ι) (z : ι → ℂ) (hz : ∀ p ∈ S, ‖z p‖ = 1) (A : ℝ) {R : ℕ} (hR : 0 < R) (hmoment : ∀ j : ℕ, 1 ≤ j → j < R → ∑ p ∈ S, ((z p) ^ j).re ≤ A) : ∑ p ∈ S, fejerPolynomial R (z p) ≤ S.card + (R - 1 : ℝ) * A := by have hR' : (0 : ℝ) < R := by exact_mod_cast hR simp only [fejerPolynomial, ← Finset.sum_div] apply (div_le_iff₀ hR').mpr have h := sum_geometric_norm_sq_le S z hz A R hmoment nlinarith /- A norm bound for each ambient power sum suffices for the Fejér estimate. -/ theorem sum_fejerPolynomial_le_of_norm {ι : Type*} (S : Finset ι) (z : ι → ℂ) (hz : ∀ p ∈ S, ‖z p‖ = 1) (A : ℝ) {R : ℕ} (hR : 0 < R) (hmoment : ∀ j : ℕ, 1 ≤ j → j < R → ‖∑ p ∈ S, (z p) ^ j‖ ≤ A) : ∑ p ∈ S, fejerPolynomial R (z p) ≤ S.card + (R - 1 : ℝ) * A := by apply sum_fejerPolynomial_le S z hz A hR intro j hj hjR calc (∑ p ∈ S, ((z p) ^ j).re) = (∑ p ∈ S, (z p) ^ j).re := by simp _ ≤ ‖∑ p ∈ S, (z p) ^ j‖ := Complex.re_le_norm _ _ ≤ A := hmoment j hj hjR /- The usual short angular arc forces a large Fejér value. -/ theorem fejerPolynomial_lower_of_abs_angle {R : ℕ} (hR : 0 < R) {θ : ℝ} (hθ : |θ| ≤ 1 / (R : ℝ)) : (R : ℝ) / 4 ≤ fejerPolynomial R (Complex.exp (θ * Complex.I)) := by apply fejerPolynomial_lower_of_re hR intro j hj have hR' : (0 : ℝ) < R := by exact_mod_cast hR have hjR : (j : ℝ) ≤ R := by exact_mod_cast (Finset.mem_range.mp hj).le have habs : |(j : ℝ) * θ| ≤ 1 := by rw [abs_mul, abs_of_nonneg (Nat.cast_nonneg j)] calc (j : ℝ) * |θ| ≤ (R : ℝ) * (1 / (R : ℝ)) := mul_le_mul hjR hθ (abs_nonneg _) (by positivity) _ = 1 := by field_simp have hsq : ((j : ℝ) * θ) ^ 2 ≤ 1 := by have := (sq_le_sq₀ (abs_nonneg ((j : ℝ) * θ)) (by norm_num : (0 : ℝ) ≤ 1)).mpr habs simpa only [sq_abs, one_pow] using this have hcos := Real.one_sub_sq_div_two_le_cos (x := (j : ℝ) * θ) rw [← Complex.exp_nat_mul] have he : (j : ℂ) * ((θ : ℂ) * Complex.I) = (((j : ℝ) * θ : ℝ) : ℂ) * Complex.I := by push_cast ring rw [he] simp only [Complex.exp_re, Complex.mul_re, Complex.ofReal_re, Complex.I_re, Complex.ofReal_im, Complex.I_im, mul_zero, sub_self, Real.exp_zero, Complex.mul_im, mul_one, add_zero, one_mul] nlinarith /- Unit complex numbers in the principal short arc have large Fejér value. -/ theorem fejerPolynomial_lower_of_abs_arg {R : ℕ} (hR : 0 < R) {z : ℂ} (hz : ‖z‖ = 1) (harg : |z.arg| ≤ 1 / (R : ℝ)) : (R : ℝ) / 4 ≤ fejerPolynomial R z := by have he : Complex.exp (z.arg * Complex.I) = z := by simpa only [hz, Complex.ofReal_one, one_mul] using Complex.norm_mul_exp_arg_mul_I z rw [← he] exact fejerPolynomial_lower_of_abs_angle hR harg /- The principal short-arc bound for arbitrary unit complex values. -/ theorem short_arg_card_le_of_moments {ι : Type*} (S : Finset ι) (z : ι → ℂ) (hz : ∀ p ∈ S, ‖z p‖ = 1) (A : ℝ) {R : ℕ} (hR : 0 < R) (hsmall : (R - 1 : ℝ) * A ≤ S.card) (hmoment : ∀ j : ℕ, 1 ≤ j → j < R → ‖∑ p ∈ S, (z p) ^ j‖ ≤ A) : ((S.filter fun p => |(z p).arg| ≤ 1 / (R : ℝ)).card : ℝ) ≤ 8 * S.card / R := by classical have hsum := sum_fejerPolynomial_le_of_norm S z hz A hR hmoment have hmass : (∑ p ∈ S, fejerPolynomial R (z p)) ≤ 2 * S.card := by linarith apply le_trans _ (fejer_large_values_card_le S z hR hmass) exact_mod_cast Finset.card_le_card (show (S.filter fun p => |(z p).arg| ≤ 1 / (R : ℝ)) ⊆ S.filter (fun p => (R : ℝ) / 4 ≤ fejerPolynomial R (z p)) from by intro p hp obtain ⟨hp, harg⟩ := Finset.mem_filter.mp hp exact Finset.mem_filter.mpr ⟨hp, fejerPolynomial_lower_of_abs_arg hR (hz p hp) harg⟩) end section /- Away from an arc of radius `1/R`, a unit complex number has definite energy. -/ theorem unit_energy_lower_of_abs_arg {R : ℕ} (hR : 0 < R) {z : ℂ} (hz : ‖z‖ = 1) (harg : 1 / (R : ℝ) ≤ |z.arg|) : 2 / (Real.pi ^ 2 * (R : ℝ) ^ 2) ≤ 1 - z.re := by have hR' : (0 : ℝ) < R := by exact_mod_cast hR have hcos : Real.cos z.arg = z.re := by simpa only [hz, one_mul] using Complex.norm_mul_cos_arg z have hc := Real.cos_le_one_sub_mul_cos_sq (Complex.abs_arg_le_pi z) rw [hcos] at hc have hs : (1 / (R : ℝ)) ^ 2 ≤ z.arg ^ 2 := by have h := (sq_le_sq₀ (by positivity : 0 ≤ 1 / (R : ℝ)) (abs_nonneg z.arg)).mpr harg simpa only [sq_abs] using h calc 2 / (Real.pi ^ 2 * (R : ℝ) ^ 2) = (2 / Real.pi ^ 2) * (1 / (R : ℝ)) ^ 2 := by field_simp _ ≤ (2 / Real.pi ^ 2) * z.arg ^ 2 := mul_le_mul_of_nonneg_left hs (by positivity) _ ≤ 1 - z.re := by linarith /- A large retained set and a small ambient short arc force positive character energy. -/ theorem energy_lower_of_short_arc_card {ι : Type*} (S T : Finset ι) (hTS : T ⊆ S) (z : ι → ℂ) (hz : ∀ i ∈ T, ‖z i‖ = 1) {R : ℕ} (hR : 0 < R) {N : ℝ} (hT : N / 2 ≤ T.card) (harc : ((S.filter fun i => |(z i).arg| ≤ 1 / (R : ℝ)).card : ℝ) ≤ N / 8) : 3 * N / (4 * Real.pi ^ 2 * (R : ℝ) ^ 2) ≤ ∑ i ∈ T, (1 - (z i).re) := by classical let arc : ι → Prop := fun i => |(z i).arg| ≤ 1 / (R : ℝ) let U := T.filter fun i => ¬ arc i have hR' : (0 : ℝ) < R := by exact_mod_cast hR have hsmall : ((T.filter arc).card : ℝ) ≤ N / 8 := by apply le_trans _ harc exact_mod_cast Finset.card_le_card (Finset.filter_subset_filter _ hTS) have hsplit : ((T.filter arc).card : ℝ) + (U.card : ℝ) = T.card := by exact_mod_cast Finset.card_filter_add_card_filter_not (s := T) arc have hU : 3 * N / 8 ≤ (U.card : ℝ) := by linarith have hterm : ∀ i ∈ U, 2 / (Real.pi ^ 2 * (R : ℝ) ^ 2) ≤ 1 - (z i).re := by intro i hi obtain ⟨hiT, hiarc⟩ := Finset.mem_filter.mp hi exact unit_energy_lower_of_abs_arg hR (hz i hiT) (le_of_lt (not_le.mp hiarc)) calc 3 * N / (4 * Real.pi ^ 2 * (R : ℝ) ^ 2) = (3 * N / 8) * (2 / (Real.pi ^ 2 * (R : ℝ) ^ 2)) := by ring _ ≤ (U.card : ℝ) * (2 / (Real.pi ^ 2 * (R : ℝ) ^ 2)) := mul_le_mul_of_nonneg_right hU (by positivity) _ = ∑ _i ∈ U, 2 / (Real.pi ^ 2 * (R : ℝ) ^ 2) := by simp _ ≤ ∑ i ∈ U, (1 - (z i).re) := Finset.sum_le_sum hterm _ ≤ ∑ i ∈ T, (1 - (z i).re) := by apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ T) intro i hi _ have h := Complex.re_le_norm (z i) rw [hz i hi] at h linarith /- Ambient low-power character moments force high energy on any retained half-reservoir. -/ theorem energy_lower_of_moments {ι : Type*} (S T : Finset ι) (hTS : T ⊆ S) (z : ι → ℂ) (hz : ∀ i ∈ S, ‖z i‖ = 1) (A : ℝ) {R : ℕ} (hR : 0 < R) {N : ℝ} (hT : N / 2 ≤ T.card) (hRlarge : 64 * (S.card : ℝ) ≤ N * R) (hsmall : (R - 1 : ℝ) * A ≤ S.card) (hmoment : ∀ j : ℕ, 1 ≤ j → j < R → ‖∑ i ∈ S, (z i) ^ j‖ ≤ A) : 3 * N / (4 * Real.pi ^ 2 * (R : ℝ) ^ 2) ≤ ∑ i ∈ T, (1 - (z i).re) := by apply energy_lower_of_short_arc_card S T hTS z (fun i hi => hz i (hTS hi)) hR hT have hcard := short_arg_card_le_of_moments S z hz A hR hsmall hmoment apply hcard.trans have hR' : (0 : ℝ) < R := by exact_mod_cast hR apply (div_le_iff₀ hR').mpr nlinarith end section open scoped BigOperators /- A complex character on a finite group takes values on the unit circle. -/ theorem finite_character_norm {G : Type*} [Group G] [Finite G] (ξ : G →* ℂ) (g : G) : ‖ξ g‖ = 1 := (ξ.isOfFinOrder (isOfFinOrder_of_finite g)).norm_eq_one /- Low-order extensions use the pruned outlier count. Extensions without low-order relations use the ambient Fejér estimate. Together they give one bound valid for every nontrivial character of the retained subgroup. -/ theorem character_energy_lower_of_pruned_ambient {G ι : Type*} [CommGroup G] [Finite G] (H : Subgroup G) (S T : Finset ι) (hTS : T ⊆ S) (g : ι → G) (h : ι → H) (hlabel : ∀ i ∈ T, (h i : G) = g i) {N M A : ℝ} {R : ℕ} (hR : 0 < R) (hT : N / 2 ≤ (T.card : ℝ)) (hRlarge : 64 * (S.card : ℝ) ≤ N * R) (hsmall : (R - 1 : ℝ) * A ≤ S.card) (hpruned : ∀ χ : H →* ℂ, χ ≠ 1 → M ≤ ((T.filter fun i => χ (h i) ≠ 1).card : ℝ)) (hamb : ∀ ξ : G →* ℂ, ξ ≠ 1 → ‖∑ i ∈ S, ξ (g i)‖ ≤ A) (χ : H →* ℂ) (hχ : χ ≠ 1) : min (2 * M / (R : ℝ) ^ 2) (3 * N / (4 * Real.pi ^ 2 * (R : ℝ) ^ 2)) ≤ ∑ i ∈ T, (1 - (χ (h i)).re) := by classical obtain ⟨ξ, hext⟩ := extend_complex_character H χ have hagree : ∀ i ∈ T, ξ (g i) = χ (h i) := by intro i hi rw [← hlabel i hi] exact hext (h i) by_cases hlow : ∃ m : ℕ, 0 < m ∧ m < R ∧ ξ ^ m = 1 · obtain ⟨m, hm, hmR, hpow⟩ := hlow have hp : ∀ i ∈ T, (χ (h i)) ^ m = 1 := by intro i hi rw [← hagree i hi] have hv := DFunLike.congr_fun hpow (g i) simpa only [MonoidHom.pow_apply, MonoidHom.one_apply] using hv exact (min_le_left _ _).trans (root_unity_phase_sum_lower T (fun i => χ (h i)) hm hmR.le hp (hpruned χ hχ)) · have hmom : ∀ j : ℕ, 1 ≤ j → j < R → ‖∑ i ∈ S, (ξ (g i)) ^ j‖ ≤ A := by intro j hj hjR have hne : ξ ^ j ≠ 1 := by intro heq exact hlow ⟨j, by omega, hjR, heq⟩ simpa only [MonoidHom.pow_apply] using hamb (ξ ^ j) hne have henergy := energy_lower_of_moments S T hTS (fun i => ξ (g i)) (fun i _ => finite_character_norm ξ (g i)) A hR hT hRlarge hsmall hmom have hequal : (∑ i ∈ T, (1 - (ξ (g i)).re)) = ∑ i ∈ T, (1 - (χ (h i)).re) := by apply Finset.sum_congr rfl intro i hi rw [hagree i hi] rw [hequal] at henergy exact (min_le_right _ _).trans henergy end section open scoped BigOperators /- Extend the subgroup-valued reservoir labels by the identity off the subgroup. -/ noncomputable def subgroupLabel {G ι : Type*} [Group G] (H : Subgroup G) (g : ι → G) (i : ι) : H := by classical exact if hi : g i ∈ H then ⟨g i, hi⟩ else 1 theorem subgroupLabel_coe_of_mem {G ι : Type*} [Group G] (H : Subgroup G) (g : ι → G) {i : ι} (hi : g i ∈ H) : (subgroupLabel H g i : G) = g i := by classical simp only [subgroupLabel, hi, dite_true] theorem subgroupReservoir_subset {G ι : Type*} [Group G] (P : Finset ι) (g : ι → G) (H : Subgroup G) : subgroupReservoir P g H ⊆ P := by classical exact Finset.filter_subset _ P /- The ambient reservoir of the mapped kernel is precisely the retained reservoir on which the subgroup character is trivial. -/ theorem subgroupReservoir_kernel_eq {G ι : Type*} [Group G] (P : Finset ι) (g : ι → G) (H : Subgroup G) (χ : H →* ℂ) : subgroupReservoir P g (χ.ker.map H.subtype) = (subgroupReservoir P g H).filter (fun i => χ (subgroupLabel H g i) = 1) := by classical ext i simp only [subgroupReservoir, Finset.mem_filter] constructor · rintro ⟨hiP, hiK⟩ have hiH : g i ∈ H := (Subgroup.map_subtype_le χ.ker) hiK obtain ⟨x, hx, hxg⟩ := Subgroup.mem_map.mp hiK have hlabel : subgroupLabel H g i = x := by apply Subtype.ext rw [subgroupLabel_coe_of_mem H g hiH] exact hxg.symm refine ⟨⟨hiP, hiH⟩, ?_⟩ rw [hlabel] exact hx · rintro ⟨⟨hiP, hiH⟩, hχ⟩ refine ⟨hiP, Subgroup.mem_map.mpr ?_⟩ exact ⟨subgroupLabel H g i, hχ, subgroupLabel_coe_of_mem H g hiH⟩ /- Pruning a reservoir inside an ambient set with character cancellation produces a retained half-reservoir with a uniform positive spectral bound. -/ theorem exists_pruned_energy_reservoir {G ι : Type*} [CommGroup G] [Finite G] (S P : Finset ι) (hPS : P ⊆ S) (g : ι → G) {M A : ℝ} (hM : 0 ≤ M) (hbudget : M * Nat.log 2 (Nat.card G) ≤ (P.card : ℝ) / 2) {R : ℕ} (hR : 0 < R) (hRlarge : 64 * (S.card : ℝ) ≤ (P.card : ℝ) * R) (hsmall : (R - 1 : ℝ) * A ≤ S.card) (hamb : ∀ ξ : G →* ℂ, ξ ≠ 1 → ‖∑ i ∈ S, ξ (g i)‖ ≤ A) : ∃ (H : Subgroup G) (T : Finset ι) (h : ι → H), T = subgroupReservoir P g H ∧ T ⊆ P ∧ (P.card : ℝ) / 2 ≤ (T.card : ℝ) ∧ (∀ i ∈ T, (h i : G) = g i) ∧ ∀ χ : H →* ℂ, χ ≠ 1 → min (2 * M / (R : ℝ) ^ 2) (3 * (P.card : ℝ) / (4 * Real.pi ^ 2 * (R : ℝ) ^ 2)) ≤ ∑ i ∈ T, (1 - (χ (h i)).re) := by classical obtain ⟨H, hhalf, hstable⟩ := exists_character_pruned_subgroup P g hM hbudget let T := subgroupReservoir P g H let h := subgroupLabel H g have hTP : T ⊆ P := subgroupReservoir_subset P g H have hagree : ∀ i ∈ T, (h i : G) = g i := by intro i hi exact subgroupLabel_coe_of_mem H g (Finset.mem_filter.mp hi).2 have hpruned : ∀ χ : H →* ℂ, χ ≠ 1 → M ≤ ((T.filter fun i => χ (h i) ≠ 1).card : ℝ) := by intro χ hχ have hstab := hstable χ hχ have hpart : ((T.filter fun i => χ (h i) = 1).card : ℝ) + ((T.filter fun i => χ (h i) ≠ 1).card : ℝ) = T.card := by exact_mod_cast Finset.card_filter_add_card_filter_not (s := T) (fun i => χ (h i) = 1) rw [subgroupReservoir_kernel_eq P g H χ] at hstab change M ≤ (T.card : ℝ) - ((T.filter fun i => χ (h i) = 1).card : ℝ) at hstab linarith refine ⟨H, T, h, rfl, hTP, hhalf, hagree, ?_⟩ intro χ hχ exact character_energy_lower_of_pruned_ambient H S T (hTP.trans hPS) g h hagree hR hhalf hRlarge hsmall hpruned hamb χ hχ end section /- A family carrying mass at least `m`, with every point of mass at most `p`, has cardinality at least `m / p`. No sign condition on the individual weights is needed. -/ theorem card_ge_mass_div_bound {α : Type*} (A : Finset α) (w : α → ℝ) {m p : ℝ} (hp : 0 < p) (hmass : m ≤ ∑ a ∈ A, w a) (hpoint : ∀ a ∈ A, w a ≤ p) : m / p ≤ (A.card : ℝ) := by apply (div_le_iff₀ hp).2 have hsum : (∑ a ∈ A, w a) ≤ (A.card : ℝ) * p := by calc (∑ a ∈ A, w a) ≤ ∑ _a ∈ A, p := Finset.sum_le_sum hpoint _ = (A.card : ℝ) * p := by simp exact hmass.trans hsum /- The mass assigned to `s` when each element of `S` is selected with probability `ρ`. -/ def bernoulliSubsetWeight {α : Type*} (ρ : ℝ) (S s : Finset α) : ℝ := ρ ^ s.card * (1 - ρ) ^ (S.card - s.card) theorem bernoulliSubsetWeight_nonneg {α : Type*} {ρ : ℝ} (hρ₀ : 0 ≤ ρ) (hρ₁ : ρ ≤ 1) (S s : Finset α) : 0 ≤ bernoulliSubsetWeight ρ S s := by unfold bernoulliSubsetWeight positivity /- A subset with at least `k` elements has mass at most `ρ ^ k`. -/ theorem bernoulliSubsetWeight_le_pow {α : Type*} {ρ : ℝ} (hρ₀ : 0 ≤ ρ) (hρ₁ : ρ ≤ 1) (S s : Finset α) {k : ℕ} (hk : k ≤ s.card) : bernoulliSubsetWeight ρ S s ≤ ρ ^ k := by unfold bernoulliSubsetWeight calc ρ ^ s.card * (1 - ρ) ^ (S.card - s.card) ≤ ρ ^ s.card * 1 := mul_le_mul_of_nonneg_left (pow_le_one₀ (by linarith) (by linarith)) (pow_nonneg hρ₀ _) _ = ρ ^ s.card := mul_one _ _ ≤ ρ ^ k := pow_le_pow_of_le_one hρ₀ hρ₁ hk /- The Bernoulli masses of all subsets sum to one. -/ theorem sum_bernoulliSubsetWeight {α : Type*} (ρ : ℝ) (S : Finset α) : ∑ s ∈ S.powerset, bernoulliSubsetWeight ρ S s = 1 := by unfold bernoulliSubsetWeight rw [Finset.sum_pow_mul_eq_add_pow] simp /- The counting step used after obtaining a positive mass of sufficiently large subsets. -/ theorem card_ge_bernoulli_mass_div_pow {α : Type*} {ρ : ℝ} (hρ₀ : 0 < ρ) (hρ₁ : ρ ≤ 1) (S : Finset α) (A : Finset (Finset α)) {m : ℝ} {k : ℕ} (hmass : m ≤ ∑ s ∈ A, bernoulliSubsetWeight ρ S s) (hsize : ∀ s ∈ A, k ≤ s.card) : m / ρ ^ k ≤ (A.card : ℝ) := by exact card_ge_mass_div_bound A (bernoulliSubsetWeight ρ S) (pow_pos hρ₀ k) hmass (fun s hs => bernoulliSubsetWeight_le_pow hρ₀.le hρ₁ S s (hsize s hs)) /- Finite expansion of the product generating function. It applies, in particular, to complex character values by taking `r = ρ` and `t = 1 - ρ`. -/ theorem subset_weighted_product_expansion {α R : Type*} [CommSemiring R] (S : Finset α) (r t : R) (z : α → R) : (∑ s ∈ S.powerset, (r ^ s.card * t ^ (S.card - s.card)) * ∏ i ∈ s, z i) = ∏ i ∈ S, (t + r * z i) := by classical symm simp_rw [add_comm t] rw [Finset.prod_add] apply Finset.sum_congr rfl intro s hs rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.prod_const, Finset.card_sdiff_of_subset (Finset.mem_powerset.1 hs)] ring /- The complex generating function for the Bernoulli subset distribution. -/ theorem bernoulli_complex_product_expansion {α : Type*} (S : Finset α) (ρ : ℝ) (z : α → ℂ) : (∑ s ∈ S.powerset, (bernoulliSubsetWeight ρ S s : ℂ) * ∏ i ∈ s, z i) = ∏ i ∈ S, (1 - (ρ : ℂ) + (ρ : ℂ) * z i) := by simpa [bernoulliSubsetWeight] using subset_weighted_product_expansion S (ρ : ℂ) (1 - (ρ : ℂ)) z end section /- Exact squared modulus of one Bernoulli character factor. -/ theorem bernoulliFactor_norm_sq (ρ : ℝ) {z : ℂ} (hz : ‖z‖ = 1) : ‖((1 - ρ : ℝ) : ℂ) + (ρ : ℂ) * z‖ ^ 2 = 1 - 2 * ρ * (1 - ρ) * (1 - z.re) := by have hzsq : z.re * z.re + z.im * z.im = 1 := by rw [← Complex.normSq_apply, Complex.normSq_eq_norm_sq, hz, one_pow] simp only [Complex.sq_norm, Complex.normSq_apply, Complex.add_re, Complex.add_im, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, zero_add, add_zero, sub_zero] linear_combination ρ ^ 2 * hzsq /- Exponential contraction for one character value on the unit circle. The estimate in fact holds for every real parameter, and hence for all Bernoulli parameters. -/ theorem bernoulliFactor_norm_le_exp (ρ : ℝ) {z : ℂ} (hz : ‖z‖ = 1) : ‖((1 - ρ : ℝ) : ℂ) + (ρ : ℂ) * z‖ ≤ Real.exp (-ρ * (1 - ρ) * (1 - z.re)) := by have hsq := bernoulliFactor_norm_sq ρ hz have hexp := Real.add_one_le_exp (-2 * ρ * (1 - ρ) * (1 - z.re)) have hexpsq : Real.exp (-ρ * (1 - ρ) * (1 - z.re)) ^ 2 = Real.exp (-2 * ρ * (1 - ρ) * (1 - z.re)) := by rw [pow_two, ← Real.exp_add] congr 1 ring have hpos := Real.exp_pos (-ρ * (1 - ρ) * (1 - z.re)) nlinarith [norm_nonneg (((1 - ρ : ℝ) : ℂ) + (ρ : ℂ) * z)] /- Independent Bernoulli character factors have an exponential bound in their total energy. -/ theorem bernoulliProduct_norm_le_exp {ι : Type*} (s : Finset ι) (ρ : ℝ) (z : ι → ℂ) (hz : ∀ i ∈ s, ‖z i‖ = 1) : ‖∏ i ∈ s, (((1 - ρ : ℝ) : ℂ) + (ρ : ℂ) * z i)‖ ≤ Real.exp (-ρ * (1 - ρ) * ∑ i ∈ s, (1 - (z i).re)) := by rw [norm_prod] calc ∏ i ∈ s, ‖((1 - ρ : ℝ) : ℂ) + (ρ : ℂ) * z i‖ ≤ ∏ i ∈ s, Real.exp (-ρ * (1 - ρ) * (1 - (z i).re)) := by apply Finset.prod_le_prod₀ · intro i hi exact norm_nonneg _ · intro i hi exact bernoulliFactor_norm_le_exp ρ (hz i hi) _ = Real.exp (-ρ * (1 - ρ) * ∑ i ∈ s, (1 - (z i).re)) := by rw [← Real.exp_sum, Finset.mul_sum] /- The Bernoulli-weighted subset-product transform satisfies the energy bound. -/ theorem bernoulliSubsetSum_norm_le_exp {ι : Type*} (s : Finset ι) (ρ : ℝ) (z : ι → ℂ) (hz : ∀ i ∈ s, ‖z i‖ = 1) : ‖∑ t ∈ s.powerset, (bernoulliSubsetWeight ρ s t : ℂ) * ∏ i ∈ t, z i‖ ≤ Real.exp (-ρ * (1 - ρ) * ∑ i ∈ s, (1 - (z i).re)) := by rw [bernoulli_complex_product_expansion] simpa only [Complex.ofReal_sub, Complex.ofReal_one] using bernoulliProduct_norm_le_exp s ρ z hz /- Applying a multiplicative character to each subset product gives the same contraction. -/ theorem bernoulliCharacterSum_norm_le_exp {ι G : Type*} [CommMonoid G] (s : Finset ι) (ρ : ℝ) (g : ι → G) (χ : G →* ℂ) (hχ : ∀ i ∈ s, ‖χ (g i)‖ = 1) : ‖∑ t ∈ s.powerset, (bernoulliSubsetWeight ρ s t : ℂ) * χ (∏ i ∈ t, g i)‖ ≤ Real.exp (-ρ * (1 - ρ) * ∑ i ∈ s, (1 - (χ (g i)).re)) := by simpa only [map_prod] using bernoulliSubsetSum_norm_le_exp s ρ (fun i => χ (g i)) hχ /- Finite additive characters have unit modulus, so their Bernoulli coefficients contract. -/ theorem bernoulliAddCharSum_norm_le_exp {ι G : Type*} [AddCommGroup G] [Finite G] (s : Finset ι) (ρ : ℝ) (g : ι → G) (χ : AddChar G ℂ) : ‖∑ t ∈ s.powerset, (bernoulliSubsetWeight ρ s t : ℂ) * χ (∑ i ∈ t, g i)‖ ≤ Real.exp (-ρ * (1 - ρ) * ∑ i ∈ s, (1 - (χ (g i)).re)) := by have h := bernoulliCharacterSum_norm_le_exp s ρ (fun i => Multiplicative.ofAdd (g i)) χ.toMonoidHom (fun i _ => χ.norm_apply (g i)) simpa only [← ofAdd_sum, AddChar.toMonoidHom_apply, toAdd_ofAdd] using h end section open scoped BigOperators theorem character_sum_real {G : Type*} [AddCommGroup G] [Fintype G] [DecidableEq G] (g : G) : (∑ χ : AddChar G ℂ, (χ g).re) = if g = 0 then (Fintype.card G : ℝ) else 0 := by classical have h := congrArg Complex.re (AddChar.sum_apply_eq_ite g) by_cases hg : g = 0 · simp [hg] · simpa [hg] using h theorem weighted_character_sum_real {G ι : Type*} [AddCommGroup G] [Fintype G] [DecidableEq G] (s : Finset ι) (w : ι → ℝ) (f : ι → G) : (∑ χ : AddChar G ℂ, (∑ a ∈ s, (w a : ℂ) * χ (f a)).re) = (Fintype.card G : ℝ) * ∑ a ∈ s, if f a = 0 then w a else 0 := by classical simp only [Complex.re_sum, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] rw [Finset.sum_comm] simp_rw [← Finset.mul_sum, character_sum_real] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro a ha split_ifs <;> ring /- Small nonprincipal Fourier coefficients force mass near the uniform mass at the identity. The weights need not be nonnegative for this implication. -/ theorem identity_mass_lower_bound {G ι : Type*} [AddCommGroup G] [Fintype G] [DecidableEq G] (s : Finset ι) (w : ι → ℝ) (f : ι → G) (hsum : ∑ a ∈ s, w a = 1) {b : ℝ} (hb : 0 ≤ b) (hfourier : ∀ χ : AddChar G ℂ, χ ≠ 0 → ‖∑ a ∈ s, (w a : ℂ) * χ (f a)‖ ≤ b) : 1 / (Fintype.card G : ℝ) - b ≤ ∑ a ∈ s, if f a = 0 then w a else 0 := by classical let F : AddChar G ℂ → ℂ := fun χ => ∑ a ∈ s, (w a : ℂ) * χ (f a) have hF0 : (F 0).re = 1 := by simp [F, hsum] have hterm (χ : AddChar G ℂ) (hχ : χ ∈ (Finset.univ.erase 0)) : -b ≤ (F χ).re := by have hχ0 : χ ≠ 0 := (Finset.mem_erase.mp hχ).1 have hr := (abs_le.mp (Complex.abs_re_le_norm (F χ))).1 have hn := hfourier χ hχ0 dsimp [F] at hr ⊢ linarith have hsumlower := Finset.sum_le_sum hterm have hcard : (Finset.univ.erase (0 : AddChar G ℂ)).card = Fintype.card G - 1 := by simp [AddChar.card_eq] have hsplit : (∑ χ : AddChar G ℂ, (F χ).re) = 1 + ∑ χ ∈ (Finset.univ.erase 0), (F χ).re := by rw [← Finset.sum_erase_add _ _ (Finset.mem_univ (0 : AddChar G ℂ)), hF0] ring have htotal := weighted_character_sum_real s w f change (∑ χ : AddChar G ℂ, (F χ).re) = _ at htotal have hc : 0 < (Fintype.card G : ℝ) := by exact_mod_cast Fintype.card_pos have hcast : ((Fintype.card G - 1 : ℕ) : ℝ) = Fintype.card G - 1 := by rw [Nat.cast_sub (by have := Fintype.card_pos (α := G); omega)] norm_num simp only [Finset.sum_const, nsmul_eq_mul, hcard, hcast] at hsumlower have hmain : 1 - (Fintype.card G : ℝ) * b ≤ (Fintype.card G : ℝ) * (∑ a ∈ s, if f a = 0 then w a else 0) := by linarith apply (le_of_mul_le_mul_left (a := (Fintype.card G : ℝ)) ?_ hc) calc (Fintype.card G : ℝ) * (1 / (Fintype.card G : ℝ) - b) = 1 - (Fintype.card G : ℝ) * b := by field_simp _ ≤ _ := hmain end section /- Uniform character energy forces the Bernoulli subset sum close to uniform at the identity of a finite abelian group. -/ theorem bernoulli_identity_mass_lower_bound {ι G : Type*} [AddCommGroup G] [Fintype G] [DecidableEq G] (s : Finset ι) (g : ι → G) {ρ E : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) (henergy : ∀ χ : AddChar G ℂ, χ ≠ 0 → E ≤ ∑ i ∈ s, (1 - (χ (g i)).re)) : 1 / (Fintype.card G : ℝ) - Real.exp (-ρ * (1 - ρ) * E) ≤ ∑ t ∈ s.powerset, if (∑ i ∈ t, g i) = 0 then bernoulliSubsetWeight ρ s t else 0 := by apply identity_mass_lower_bound s.powerset (bernoulliSubsetWeight ρ s) (fun t => ∑ i ∈ t, g i) (sum_bernoulliSubsetWeight ρ s) (Real.exp_pos _).le intro χ hχ apply (bernoulliAddCharSum_norm_le_exp s ρ g χ).trans apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonpos_left (henergy χ hχ) (mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr hρ0) (sub_nonneg.mpr hρ1)) end section /- Exponential Markov inequality for a finite weighted space. -/ theorem finite_exponential_markov {α : Type*} (Ω A : Finset α) (hA : A ⊆ Ω) (w f : α → ℝ) (hw : ∀ a ∈ Ω, 0 ≤ w a) {b : ℝ} (hf : ∀ a ∈ A, b ≤ f a) : (∑ a ∈ A, w a) ≤ Real.exp (-b) * ∑ a ∈ Ω, w a * Real.exp (f a) := by calc (∑ a ∈ A, w a) ≤ ∑ a ∈ A, Real.exp (-b) * (w a * Real.exp (f a)) := by apply Finset.sum_le_sum intro a ha calc w a = w a * Real.exp 0 := by simp _ ≤ w a * Real.exp (f a - b) := mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (by linarith [hf a ha])) (hw a (hA ha)) _ = Real.exp (-b) * (w a * Real.exp (f a)) := by rw [sub_eq_add_neg, Real.exp_add] ring _ = Real.exp (-b) * ∑ a ∈ A, w a * Real.exp (f a) := by rw [Finset.mul_sum] _ ≤ Real.exp (-b) * ∑ a ∈ Ω, w a * Real.exp (f a) := by apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le apply Finset.sum_le_sum_of_subset_of_nonneg hA intro a ha _ exact mul_nonneg (hw a ha) (Real.exp_pos _).le section variable {α : Type*} (S : Finset α) include α S /- Exact exponential moment of the subset size. -/ theorem bernoulli_size_mgf (ρ θ : ℝ) : (∑ s ∈ S.powerset, bernoulliSubsetWeight ρ S s * Real.exp (θ * (s.card : ℝ))) = (1 - ρ + ρ * Real.exp θ) ^ S.card := by have h := subset_weighted_product_expansion S ρ (1 - ρ) (fun _ => Real.exp θ) simpa only [bernoulliSubsetWeight, Finset.prod_const, mul_comm θ, Real.exp_nat_mul] using h /- Poisson exponential-moment bound for a Bernoulli subset size. -/ theorem bernoulli_size_mgf_le {ρ : ℝ} (hρ₀ : 0 ≤ ρ) (hρ₁ : ρ ≤ 1) (θ : ℝ) : (∑ s ∈ S.powerset, bernoulliSubsetWeight ρ S s * Real.exp (θ * (s.card : ℝ))) ≤ Real.exp (ρ * S.card * (Real.exp θ - 1)) := by rw [bernoulli_size_mgf] have hbase : 0 ≤ 1 - ρ + ρ * Real.exp θ := by positivity have hstep : 1 - ρ + ρ * Real.exp θ ≤ Real.exp (ρ * (Real.exp θ - 1)) := by have := Real.add_one_le_exp (ρ * (Real.exp θ - 1)) nlinarith calc (1 - ρ + ρ * Real.exp θ) ^ S.card ≤ Real.exp (ρ * (Real.exp θ - 1)) ^ S.card := pow_le_pow_left₀ hbase hstep _ _ = Real.exp (ρ * S.card * (Real.exp θ - 1)) := by rw [← Real.exp_nat_mul] congr 1 ring /- The centered exponential moment is bounded uniformly in either sign of `θ`. -/ theorem bernoulli_centered_mgf_le {ρ : ℝ} (hρ₀ : 0 ≤ ρ) (hρ₁ : ρ ≤ 1) (θ : ℝ) : (∑ s ∈ S.powerset, bernoulliSubsetWeight ρ S s * Real.exp (θ * ((s.card : ℝ) - ρ * S.card))) ≤ Real.exp (ρ * S.card * (Real.exp θ - 1 - θ)) := by calc (∑ s ∈ S.powerset, bernoulliSubsetWeight ρ S s * Real.exp (θ * ((s.card : ℝ) - ρ * S.card))) = Real.exp (-θ * (ρ * S.card)) * ∑ s ∈ S.powerset, bernoulliSubsetWeight ρ S s * Real.exp (θ * (s.card : ℝ)) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro s _ rw [show θ * ((s.card : ℝ) - ρ * S.card) = -θ * (ρ * S.card) + θ * (s.card : ℝ) by ring, Real.exp_add] ring _ ≤ Real.exp (-θ * (ρ * S.card)) * Real.exp (ρ * S.card * (Real.exp θ - 1)) := mul_le_mul_of_nonneg_left (bernoulli_size_mgf_le S hρ₀ hρ₁ θ) (Real.exp_pos _).le _ = Real.exp (ρ * S.card * (Real.exp θ - 1 - θ)) := by rw [← Real.exp_add] congr 1 ring /- A quadratic bound for the centered exponential moment when `|θ| ≤ 1`. -/ theorem bernoulli_centered_mgf_le_quadratic {ρ θ : ℝ} (hρ₀ : 0 ≤ ρ) (hρ₁ : ρ ≤ 1) (hθ : |θ| ≤ 1) : (∑ s ∈ S.powerset, bernoulliSubsetWeight ρ S s * Real.exp (θ * ((s.card : ℝ) - ρ * S.card))) ≤ Real.exp (ρ * S.card * θ ^ 2) := by apply (bernoulli_centered_mgf_le S hρ₀ hρ₁ θ).trans apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonneg_left ((le_abs_self _).trans (Real.abs_exp_sub_one_sub_id_le hθ)) (by positivity) /- Any family above a centered exponential threshold has exponentially small mass. -/ theorem bernoulli_centered_markov (A : Finset (Finset α)) (hA : A ⊆ S.powerset) {ρ θ b : ℝ} (hρ₀ : 0 ≤ ρ) (hρ₁ : ρ ≤ 1) (hθ : |θ| ≤ 1) (hthreshold : ∀ s ∈ A, b ≤ θ * ((s.card : ℝ) - ρ * S.card)) : (∑ s ∈ A, bernoulliSubsetWeight ρ S s) ≤ Real.exp (ρ * S.card * θ ^ 2 - b) := by calc (∑ s ∈ A, bernoulliSubsetWeight ρ S s) ≤ Real.exp (-b) * ∑ s ∈ S.powerset, bernoulliSubsetWeight ρ S s * Real.exp (θ * ((s.card : ℝ) - ρ * S.card)) := finite_exponential_markov S.powerset A hA _ _ (fun s _ => bernoulliSubsetWeight_nonneg hρ₀ hρ₁ S s) hthreshold _ ≤ Real.exp (-b) * Real.exp (ρ * S.card * θ ^ 2) := mul_le_mul_of_nonneg_left (bernoulli_centered_mgf_le_quadratic S hρ₀ hρ₁ hθ) (Real.exp_pos _).le _ = Real.exp (ρ * S.card * θ ^ 2 - b) := by rw [← Real.exp_add] congr 1 ring /- Upper relative deviation of a Bernoulli subset size. -/ theorem bernoulli_upper_tail_mass_le (A : Finset (Finset α)) (hA : A ⊆ S.powerset) {ρ ν : ℝ} (hρ₀ : 0 ≤ ρ) (hρ₁ : ρ ≤ 1) (hν₀ : 0 ≤ ν) (hν₁ : ν ≤ 1) (hsize : ∀ s ∈ A, (1 + ν) * (ρ * S.card) ≤ (s.card : ℝ)) : (∑ s ∈ A, bernoulliSubsetWeight ρ S s) ≤ Real.exp (-ν ^ 2 * (ρ * S.card) / 4) := by have hθ : |ν / 2| ≤ 1 := by rw [abs_of_nonneg (by positivity)]; linarith have hb : ∀ s ∈ A, ν ^ 2 * (ρ * S.card) / 2 ≤ (ν / 2) * ((s.card : ℝ) - ρ * S.card) := by intro s hs have hm := mul_le_mul_of_nonneg_left (hsize s hs) hν₀ nlinarith have h := bernoulli_centered_markov S A hA hρ₀ hρ₁ hθ hb convert h using 1 congr 1 ring /- Lower relative deviation of a Bernoulli subset size. -/ theorem bernoulli_lower_tail_mass_le (A : Finset (Finset α)) (hA : A ⊆ S.powerset) {ρ ν : ℝ} (hρ₀ : 0 ≤ ρ) (hρ₁ : ρ ≤ 1) (hν₀ : 0 ≤ ν) (hν₁ : ν ≤ 1) (hsize : ∀ s ∈ A, (s.card : ℝ) ≤ (1 - ν) * (ρ * S.card)) : (∑ s ∈ A, bernoulliSubsetWeight ρ S s) ≤ Real.exp (-ν ^ 2 * (ρ * S.card) / 4) := by have hθ : |-(ν / 2)| ≤ 1 := by rw [abs_neg, abs_of_nonneg (by positivity)]; linarith have hb : ∀ s ∈ A, ν ^ 2 * (ρ * S.card) / 2 ≤ -(ν / 2) * ((s.card : ℝ) - ρ * S.card) := by intro s hs have hm := mul_le_mul_of_nonneg_left (hsize s hs) hν₀ nlinarith have h := bernoulli_centered_markov S A hA hρ₀ hρ₁ hθ hb convert h using 1 congr 1 ring /- Two-sided relative tail bound; the constant `1/4` is sufficient for the transfer. -/ theorem bernoulli_relative_tail_mass_le {ρ ν : ℝ} (hρ₀ : 0 ≤ ρ) (hρ₁ : ρ ≤ 1) (hν₀ : 0 ≤ ν) (hν₁ : ν ≤ 1) : (∑ s ∈ S.powerset with ν * (ρ * S.card) < |(s.card : ℝ) - ρ * S.card|, bernoulliSubsetWeight ρ S s) ≤ 2 * Real.exp (-ν ^ 2 * (ρ * S.card) / 4) := by classical let U := S.powerset.filter fun s => (1 + ν) * (ρ * S.card) ≤ (s.card : ℝ) let L := S.powerset.filter fun s => (s.card : ℝ) ≤ (1 - ν) * (ρ * S.card) have hu := bernoulli_upper_tail_mass_le S U (Finset.filter_subset _ _) hρ₀ hρ₁ hν₀ hν₁ (fun s hs => (Finset.mem_filter.mp hs).2) have hl := bernoulli_lower_tail_mass_le S L (Finset.filter_subset _ _) hρ₀ hρ₁ hν₀ hν₁ (fun s hs => (Finset.mem_filter.mp hs).2) have hsum : (∑ s ∈ S.powerset with ν * (ρ * S.card) < |(s.card : ℝ) - ρ * S.card|, bernoulliSubsetWeight ρ S s) ≤ (∑ s ∈ U, bernoulliSubsetWeight ρ S s) + ∑ s ∈ L, bernoulliSubsetWeight ρ S s := by dsimp [U, L] simp only [Finset.sum_filter] rw [← Finset.sum_add_distrib] apply Finset.sum_le_sum intro s hs have hw := bernoulliSubsetWeight_nonneg hρ₀ hρ₁ S s have hcover : ν * (ρ * S.card) < |(s.card : ℝ) - ρ * S.card| → (1 + ν) * (ρ * S.card) ≤ (s.card : ℝ) ∨ (s.card : ℝ) ≤ (1 - ν) * (ρ * S.card) := by intro hb by_contra h push Not at h have habs : |(s.card : ℝ) - ρ * S.card| ≤ ν * (ρ * S.card) := abs_le.mpr ⟨by linarith [h.2], by linarith [h.1]⟩ exact (not_lt_of_ge habs) hb split_ifs <;> simp_all linarith end /- Deleting a bad event from a family loses no more than its total ambient mass. -/ theorem finite_mass_filter_lower_bound {α : Type*} (Ω A : Finset α) (hA : A ⊆ Ω) (w : α → ℝ) (hw : ∀ a ∈ Ω, 0 ≤ w a) (good : α → Prop) [DecidablePred good] {m e : ℝ} (hmass : m ≤ ∑ a ∈ A, w a) (hbad : (∑ a ∈ Ω with ¬good a, w a) ≤ e) : m - e ≤ ∑ a ∈ A with good a, w a := by have hsplit := Finset.sum_filter_add_sum_filter_not A good w have hsub : A.filter (fun a => ¬good a) ⊆ Ω.filter (fun a => ¬good a) := by intro a ha exact Finset.mem_filter.mpr ⟨hA (Finset.mem_filter.mp ha).1, (Finset.mem_filter.mp ha).2⟩ have hle : (∑ a ∈ A with ¬good a, w a) ≤ ∑ a ∈ Ω with ¬good a, w a := by apply Finset.sum_le_sum_of_subset_of_nonneg hsub intro a ha _ exact hw a (Finset.mem_filter.mp ha).1 linarith /- Retaining only subsets near their mean preserves the initial family mass, up to the proved exponentially small tail loss. -/ theorem bernoulli_good_size_mass_lower_bound {α : Type*} (S : Finset α) (A : Finset (Finset α)) (hA : A ⊆ S.powerset) {ρ ν m : ℝ} (hρ₀ : 0 ≤ ρ) (hρ₁ : ρ ≤ 1) (hν₀ : 0 ≤ ν) (hν₁ : ν ≤ 1) (hmass : m ≤ ∑ s ∈ A, bernoulliSubsetWeight ρ S s) : m - 2 * Real.exp (-ν ^ 2 * (ρ * S.card) / 4) ≤ ∑ s ∈ A with |(s.card : ℝ) - ρ * S.card| ≤ ν * (ρ * S.card), bernoulliSubsetWeight ρ S s := by apply finite_mass_filter_lower_bound S.powerset A hA _ (fun s _ => bernoulliSubsetWeight_nonneg hρ₀ hρ₁ S s) _ hmass simpa only [not_le] using bernoulli_relative_tail_mass_le S hρ₀ hρ₁ hν₀ hν₁ end section noncomputable def balancedZeroSumSubsets {ι G : Type*} [AddCommGroup G] (S : Finset ι) (g : ι → G) (ρ ν : ℝ) : Finset (Finset ι) := by classical exact (S.powerset.filter fun t => (∑ i ∈ t, g i) = 0).filter fun t => |(t.card : ℝ) - ρ * S.card| ≤ ν * (ρ * S.card) /- A quantitative count of zero-sum subsets concentrated near the desired size. Both the Fourier error and the size-tail error have been proved. -/ theorem balanced_zero_sum_card_lower_bound {ι G : Type*} [AddCommGroup G] [Fintype G] (S : Finset ι) (g : ι → G) {ρ ν E : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ ≤ 1) (hν0 : 0 ≤ ν) (hν1 : ν ≤ 1) (henergy : ∀ χ : AddChar G ℂ, χ ≠ 0 → E ≤ ∑ i ∈ S, (1 - (χ (g i)).re)) {k : ℕ} (hk : (k : ℝ) ≤ (1 - ν) * (ρ * S.card)) : (1 / (Fintype.card G : ℝ) - Real.exp (-ρ * (1 - ρ) * E) - 2 * Real.exp (-ν ^ 2 * (ρ * S.card) / 4)) / ρ ^ k ≤ ((balancedZeroSumSubsets S g ρ ν).card : ℝ) := by classical let A := S.powerset.filter fun t => (∑ i ∈ t, g i) = 0 have hA : A ⊆ S.powerset := Finset.filter_subset _ _ have hmass : 1 / (Fintype.card G : ℝ) - Real.exp (-ρ * (1 - ρ) * E) ≤ ∑ t ∈ A, bernoulliSubsetWeight ρ S t := by simpa only [A, Finset.sum_filter] using bernoulli_identity_mass_lower_bound S g hρ0.le hρ1 henergy have hgood := bernoulli_good_size_mass_lower_bound S A hA hρ0.le hρ1 hν0 hν1 hmass apply card_ge_bernoulli_mass_div_pow hρ0 hρ1 S (balancedZeroSumSubsets S g ρ ν) · exact hgood · intro t ht have hsize := (Finset.mem_filter.mp ht).2 change |(t.card : ℝ) - ρ * S.card| ≤ ν * (ρ * S.card) at hsize have hlow := (abs_le.mp hsize).1 have hcast : (k : ℝ) ≤ t.card := by nlinarith exact_mod_cast hcast end section /- A zero-sum of the additive form of residue units gives a Korselt product. -/ theorem isCarmichael_prod_of_unit_zero_sum {L : ℕ} {P s : Finset ℕ} (hsub : s ⊆ P) (hprime : ∀ p ∈ P, p.Prime) (hcard : 2 ≤ s.card) (hL : ∀ p ∈ P, p - 1 ∣ L) (g : ℕ → (ZMod L)ˣ) (hcompat : ∀ p ∈ P, (g p : ZMod L) = (p : ZMod L)) (hsum : (∑ p ∈ s, Additive.ofMul (g p)) = 0) : IsCarmichael (∏ p ∈ s, p) := by have hunit : (∏ p ∈ s, g p) = 1 := by have h := congrArg Additive.toMul hsum simpa only [toMul_sum, toMul_ofMul, toMul_zero] using h have hcast : (∏ p ∈ s, (g p : ZMod L)) = 1 := by simpa only [map_prod, map_one, Units.coeHom_apply] using congrArg (Units.coeHom (ZMod L)) hunit have hnat : ((∏ p ∈ s, p : ℕ) : ZMod L) = 1 := by rw [Nat.cast_prod] calc (∏ p ∈ s, (p : ZMod L)) = ∏ p ∈ s, (g p : ZMod L) := by apply Finset.prod_congr rfl intro p hp exact (hcompat p (hsub hp)).symm _ = 1 := hcast apply isCarmichael_prod_of_modEq (fun p hp => hprime p (hsub hp)) hcard (fun p hp => hL p (hsub hp)) exact (ZMod.natCast_eq_natCast_iff _ 1 L).mp (by simpa only [Nat.cast_one] using hnat) /- A product of at most `u` factors bounded by `B ≥ 1` is at most `B^u`. -/ theorem nat_product_le_rpow {s : Finset ℕ} {B u : ℝ} (hB : 1 ≤ B) (hbound : ∀ p ∈ s, (p : ℝ) ≤ B) (hcard : (s.card : ℝ) ≤ u) : ((∏ p ∈ s, p : ℕ) : ℝ) ≤ B ^ u := by calc ((∏ p ∈ s, p : ℕ) : ℝ) = ∏ p ∈ s, (p : ℝ) := by rw [Nat.cast_prod] _ ≤ ∏ _p ∈ s, B := Finset.prod_le_prod₀ (fun p _ => Nat.cast_nonneg p) hbound _ = B ^ s.card := Finset.prod_const B _ = B ^ (s.card : ℝ) := (Real.rpow_natCast B s.card).symm _ ≤ B ^ u := Real.rpow_le_rpow_of_exponent_le hB hcard /- Every balanced zero-sum subset yields a distinct Carmichael number below the size bound. -/ theorem balanced_unit_subsets_card_le_carmichaelCounting {L : ℕ} (P : Finset ℕ) (g : ℕ → (ZMod L)ˣ) (hprime : ∀ p ∈ P, p.Prime) (hL : ∀ p ∈ P, p - 1 ∣ L) (hcompat : ∀ p ∈ P, (g p : ZMod L) = (p : ZMod L)) {B ρ ν : ℝ} (hB : 1 ≤ B) (hbound : ∀ p ∈ P, (p : ℝ) ≤ B) (hsize : 2 ≤ (1 - ν) * (ρ * P.card)) : ((balancedZeroSumSubsets P (fun p => Additive.ofMul (g p)) ρ ν).card : ℝ) ≤ Erdos1057.carmichaelCounting (B ^ ((1 + ν) * (ρ * P.card))) := by classical have hmem (s : Finset ℕ) (hs : s ∈ balancedZeroSumSubsets P (fun p => Additive.ofMul (g p)) ρ ν) : (s ⊆ P ∧ (∑ p ∈ s, Additive.ofMul (g p)) = 0) ∧ |(s.card : ℝ) - ρ * P.card| ≤ ν * (ρ * P.card) := by simpa only [balancedZeroSumSubsets, Finset.mem_filter, Finset.mem_powerset] using hs apply subset_family_card_le_carmichaelCounting hprime · intro s hs exact (hmem s hs).1.1 · intro s hs obtain ⟨⟨hsub, hszero⟩, hsbalanced⟩ := hmem s hs have hlow := (abs_le.mp hsbalanced).1 have hcard : (2 : ℝ) ≤ s.card := by nlinarith exact isCarmichael_prod_of_unit_zero_sum hsub hprime (by exact_mod_cast hcard) hL g hcompat hszero · intro s hs obtain ⟨⟨hsub, _⟩, hsbalanced⟩ := hmem s hs apply nat_product_le_rpow hB (fun p hp => hbound p (hsub hp)) have hhigh := (abs_le.mp hsbalanced).2 nlinarith /- The zero-sum construction is valid in any group mapping to the residue units. -/ theorem isCarmichael_prod_of_mapped_unit_zero_sum {H : Type*} [CommGroup H] {L : ℕ} {P s : Finset ℕ} (hsub : s ⊆ P) (hprime : ∀ p ∈ P, p.Prime) (hcard : 2 ≤ s.card) (hL : ∀ p ∈ P, p - 1 ∣ L) (g : ℕ → H) (φ : H →* (ZMod L)ˣ) (hcompat : ∀ p ∈ P, (φ (g p) : ZMod L) = (p : ZMod L)) (hsum : (∑ p ∈ s, Additive.ofMul (g p)) = 0) : IsCarmichael (∏ p ∈ s, p) := by have hunit : (∏ p ∈ s, g p) = 1 := by have h := congrArg Additive.toMul hsum simpa only [toMul_sum, toMul_ofMul, toMul_zero] using h have hmapped : (∏ p ∈ s, φ (g p)) = 1 := by rw [← map_prod, hunit, map_one] apply isCarmichael_prod_of_unit_zero_sum hsub hprime hcard hL (fun p => φ (g p)) hcompat rw [← ofMul_prod, hmapped, ofMul_one] /- Balanced subsets in a subgroup still yield distinct Carmichael products. -/ theorem balanced_mapped_unit_subsets_card_le_carmichaelCounting {H : Type*} [CommGroup H] {L : ℕ} (P : Finset ℕ) (g : ℕ → H) (φ : H →* (ZMod L)ˣ) (hprime : ∀ p ∈ P, p.Prime) (hL : ∀ p ∈ P, p - 1 ∣ L) (hcompat : ∀ p ∈ P, (φ (g p) : ZMod L) = (p : ZMod L)) {B ρ ν : ℝ} (hB : 1 ≤ B) (hbound : ∀ p ∈ P, (p : ℝ) ≤ B) (hsize : 2 ≤ (1 - ν) * (ρ * P.card)) : ((balancedZeroSumSubsets P (fun p => Additive.ofMul (g p)) ρ ν).card : ℝ) ≤ Erdos1057.carmichaelCounting (B ^ ((1 + ν) * (ρ * P.card))) := by classical have hmem (s : Finset ℕ) (hs : s ∈ balancedZeroSumSubsets P (fun p => Additive.ofMul (g p)) ρ ν) : (s ⊆ P ∧ (∑ p ∈ s, Additive.ofMul (g p)) = 0) ∧ |(s.card : ℝ) - ρ * P.card| ≤ ν * (ρ * P.card) := by simpa only [balancedZeroSumSubsets, Finset.mem_filter, Finset.mem_powerset] using hs apply subset_family_card_le_carmichaelCounting hprime · intro s hs exact (hmem s hs).1.1 · intro s hs obtain ⟨⟨hsub, hszero⟩, hsbalanced⟩ := hmem s hs have hlow := (abs_le.mp hsbalanced).1 have hcard : (2 : ℝ) ≤ s.card := by nlinarith exact isCarmichael_prod_of_mapped_unit_zero_sum hsub hprime (by exact_mod_cast hcard) hL g φ hcompat hszero · intro s hs obtain ⟨⟨hsub, _⟩, hsbalanced⟩ := hmem s hs apply nat_product_le_rpow hB (fun p hp => hbound p (hsub hp)) have hhigh := (abs_le.mp hsbalanced).2 nlinarith /- The counting estimate only needs spectral mixing inside the retained group. The homomorphism into residue units need not be injective. -/ theorem carmichaelCounting_lower_bound_of_mapped_unit_energy {H : Type*} [CommGroup H] [Fintype H] {L : ℕ} (P : Finset ℕ) (g : ℕ → H) (φ : H →* (ZMod L)ˣ) (hprime : ∀ p ∈ P, p.Prime) (hL : ∀ p ∈ P, p - 1 ∣ L) (hcompat : ∀ p ∈ P, (φ (g p) : ZMod L) = (p : ZMod L)) {B ρ ν E : ℝ} (hB : 1 ≤ B) (hbound : ∀ p ∈ P, (p : ℝ) ≤ B) (hρ0 : 0 < ρ) (hρ1 : ρ ≤ 1) (hν0 : 0 ≤ ν) (hν1 : ν ≤ 1) (hsize : 2 ≤ (1 - ν) * (ρ * P.card)) (henergy : ∀ χ : AddChar (Additive H) ℂ, χ ≠ 0 → E ≤ ∑ p ∈ P, (1 - (χ (Additive.ofMul (g p))).re)) {k : ℕ} (hk : (k : ℝ) ≤ (1 - ν) * (ρ * P.card)) : (1 / (Fintype.card (Additive H) : ℝ) - Real.exp (-ρ * (1 - ρ) * E) - 2 * Real.exp (-ν ^ 2 * (ρ * P.card) / 4)) / ρ ^ k ≤ Erdos1057.carmichaelCounting (B ^ ((1 + ν) * (ρ * P.card))) := by exact (balanced_zero_sum_card_lower_bound P (fun p => Additive.ofMul (g p)) hρ0 hρ1 hν0 hν1 henergy hk).trans (balanced_mapped_unit_subsets_card_le_carmichaelCounting P g φ hprime hL hcompat hB hbound hsize) end section /- An additive character on the additive type tag is a multiplicative character. -/ def addCharOfMulToMonoidHom {H : Type*} [Monoid H] (χ : AddChar (Additive H) ℂ) : H →* ℂ where toFun x := χ (Additive.ofMul x) map_one' := by simpa only [ofMul_one] using χ.map_zero_eq_one map_mul' x y := by simpa only [ofMul_mul] using χ.map_add_eq_mul (Additive.ofMul x) (Additive.ofMul y) theorem addCharOfMulToMonoidHom_ne_one {H : Type*} [Monoid H] {χ : AddChar (Additive H) ℂ} (hχ : χ ≠ 0) : addCharOfMulToMonoidHom χ ≠ 1 := by intro heq apply hχ ext x change χ x = 1 have h := DFunLike.congr_fun heq x.toMul simpa only [addCharOfMulToMonoidHom, MonoidHom.coe_mk, OneHom.coe_mk, ofMul_toMul, MonoidHom.one_apply] using h /- End-to-end finite transfer: a large reservoir with small predecessor modulus and ambient character cancellation contains a half-reservoir generating many Carmichael numbers. -/ theorem finite_carmichael_transfer {L : ℕ} [NeZero L] (S P : Finset ℕ) (hPS : P ⊆ S) (g : ℕ → (ZMod L)ˣ) (hprime : ∀ p ∈ P, p.Prime) (hL : ∀ p ∈ P, p - 1 ∣ L) (hcompat : ∀ p ∈ P, (g p : ZMod L) = (p : ZMod L)) {B M A : ℝ} (hB : 1 ≤ B) (hbound : ∀ p ∈ P, (p : ℝ) ≤ B) (hM : 0 ≤ M) (hbudget : M * Nat.log 2 (Nat.card ((ZMod L)ˣ)) ≤ (P.card : ℝ) / 2) {R : ℕ} (hR : 0 < R) (hRlarge : 64 * (S.card : ℝ) ≤ (P.card : ℝ) * R) (hsmall : (R - 1 : ℝ) * A ≤ S.card) (hamb : ∀ ξ : (ZMod L)ˣ →* ℂ, ξ ≠ 1 → ‖∑ p ∈ S, ξ (g p)‖ ≤ A) : ∃ (H : Subgroup ((ZMod L)ˣ)) (T : Finset ℕ) (h : ℕ → H), T = subgroupReservoir P g H ∧ T ⊆ P ∧ (P.card : ℝ) / 2 ≤ (T.card : ℝ) ∧ (∀ p ∈ T, (h p : (ZMod L)ˣ) = g p) ∧ ∀ (ρ ν : ℝ) (k : ℕ), 0 < ρ → ρ ≤ 1 → 0 ≤ ν → ν ≤ 1 → 2 ≤ (1 - ν) * (ρ * T.card) → (k : ℝ) ≤ (1 - ν) * (ρ * T.card) → (1 / (Nat.card H : ℝ) - Real.exp (-ρ * (1 - ρ) * min (2 * M / (R : ℝ) ^ 2) (3 * (P.card : ℝ) / (4 * Real.pi ^ 2 * (R : ℝ) ^ 2))) - 2 * Real.exp (-ν ^ 2 * (ρ * T.card) / 4)) / ρ ^ k ≤ Erdos1057.carmichaelCounting (B ^ ((1 + ν) * (ρ * T.card))) := by classical obtain ⟨H, T, h, hTeq, hTP, hhalf, hagree, henergy⟩ := exists_pruned_energy_reservoir S P hPS g hM hbudget hR hRlarge hsmall hamb refine ⟨H, T, h, hTeq, hTP, hhalf, hagree, ?_⟩ intro ρ ν k hρ0 hρ1 hν0 hν1 hsize hk let : Fintype H := Fintype.ofFinite H have henergy' : ∀ χ : AddChar (Additive H) ℂ, χ ≠ 0 → min (2 * M / (R : ℝ) ^ 2) (3 * (P.card : ℝ) / (4 * Real.pi ^ 2 * (R : ℝ) ^ 2)) ≤ ∑ p ∈ T, (1 - (χ (Additive.ofMul (h p))).re) := by intro χ hχ exact henergy (addCharOfMulToMonoidHom χ) (addCharOfMulToMonoidHom_ne_one hχ) have hcompat' : ∀ p ∈ T, (H.subtype (h p) : ZMod L) = (p : ZMod L) := by intro p hp change ((h p : (ZMod L)ˣ) : ZMod L) = (p : ZMod L) rw [hagree p hp] exact hcompat p (hTP hp) have hcount := carmichaelCounting_lower_bound_of_mapped_unit_energy T h H.subtype (fun p hp => hprime p (hTP hp)) (fun p hp => hL p (hTP hp)) hcompat' hB (fun p hp => hbound p (hTP hp)) hρ0 hρ1 hν0 hν1 hsize henergy' hk have hcard : Fintype.card (Additive H) = Nat.card H := by rw [Nat.card_eq_fintype_card] exact Fintype.card_congr Additive.ofMul.symm simpa only [hcard] using hcount end section /- The common spectral bound after using a logarithmic pruning budget. -/ theorem pruning_energy_lower_bound {N D r : ℝ} (hN : 0 ≤ N) (hD : 1 ≤ D) (hr : 0 < r) : N / (100 * D * r ^ 2) ≤ min (2 * (N / (2 * D)) / r ^ 2) (3 * N / (4 * Real.pi ^ 2 * r ^ 2)) := by have hD0 : 0 < D := lt_of_lt_of_le zero_lt_one hD have hr2 : 0 < r ^ 2 := sq_pos_of_pos hr have hpi2 : 0 < Real.pi ^ 2 := sq_pos_of_pos Real.pi_pos have hpi : Real.pi ^ 2 < 16 := by nlinarith [Real.pi_lt_four, Real.pi_pos] apply le_min · have heq : 2 * (N / (2 * D)) / r ^ 2 = N / (D * r ^ 2) := by field_simp rw [heq] apply div_le_div_of_nonneg_left hN (by positivity) nlinarith [mul_pos hD0 hr2] · apply (div_le_div_iff₀ (by positivity) (by positivity)).mpr have hc : 4 * Real.pi ^ 2 ≤ 300 * D := by nlinarith have hm := mul_le_mul_of_nonneg_right hc (mul_nonneg hN hr2.le) nlinarith /- A sample with expected size `t` inherits an explicit Fourier exponent. -/ theorem sampling_energy_lower_bound {N n D r t E : ℝ} (hN : 0 ≤ N) (hn : 0 < n) (hnN : n ≤ N) (hD : 1 ≤ D) (hr : 0 < r) (ht : 0 < t) (htn : t / n ≤ 1 / 2) (hE : N / (100 * D * r ^ 2) ≤ E) : t / (200 * D * r ^ 2) ≤ (t / n) * (1 - t / n) * E := by have hD0 : 0 < D := lt_of_lt_of_le zero_lt_one hD have he0 : 0 ≤ E := le_trans (by positivity) hE have hρ : 0 < t / n := div_pos ht hn have hρN : t ≤ (t / n) * N := by have hh := mul_le_mul_of_nonneg_left hnN hρ.le simpa only [div_mul_cancel₀ _ hn.ne'] using hh calc t / (200 * D * r ^ 2) = (t / (100 * D * r ^ 2)) / 2 := by ring _ ≤ ((t / n) * N / (100 * D * r ^ 2)) / 2 := by gcongr _ = (t / n) * (N / (100 * D * r ^ 2)) / 2 := by ring _ ≤ (t / n) * E / 2 := by gcongr _ ≤ (t / n) * (1 - t / n) * E := by nlinarith [mul_nonneg (by linarith : 0 ≤ 1 / 2 - t / n) (mul_nonneg hρ.le he0)] /- A logarithmic separation makes an exponential error a prescribed fraction of the inverse ambient group-size bound. -/ theorem exp_error_le_inv_group {U a c : ℝ} (hc : 0 < c) (hgap : U + Real.log c ≤ a) : Real.exp (-a) ≤ Real.exp (-U) / c := by calc Real.exp (-a) ≤ Real.exp (-U - Real.log c) := Real.exp_le_exp.mpr (by linarith) _ = Real.exp (-U) / c := by rw [Real.exp_sub, Real.exp_log hc] /- Quantitative Carmichael production with the pruning and Fourier errors absorbed into explicit logarithmic inequalities. The retained size is between half and all of the original prime reservoir. -/ theorem finite_carmichael_counting_bound {L : ℕ} [NeZero L] (S P : Finset ℕ) (hPS : P ⊆ S) (g : ℕ → (ZMod L)ˣ) (hprime : ∀ p ∈ P, p.Prime) (hL : ∀ p ∈ P, p - 1 ∣ L) (hcompat : ∀ p ∈ P, (g p : ZMod L) = (p : ZMod L)) {B D U A : ℝ} (hB : 1 ≤ B) (hbound : ∀ p ∈ P, (p : ℝ) ≤ B) (hD : 1 ≤ D) (hlogD : (Nat.log 2 (Nat.card ((ZMod L)ˣ)) : ℝ) ≤ D) (hU : Real.log (Nat.card ((ZMod L)ˣ) : ℝ) ≤ U) {R : ℕ} (hR : 0 < R) (hRlarge : 64 * (S.card : ℝ) ≤ (P.card : ℝ) * R) (hsmall : (R - 1 : ℝ) * A ≤ S.card) (hamb : ∀ ξ : (ZMod L)ˣ →* ℂ, ξ ≠ 1 → ‖∑ p ∈ S, ξ (g p)‖ ≤ A) : ∃ n : ℕ, (P.card : ℝ) / 2 ≤ n ∧ n ≤ P.card ∧ ∀ (t ν : ℝ) (k : ℕ), 0 < t → 2 * t ≤ n → 0 ≤ ν → ν ≤ 1 → 2 ≤ (1 - ν) * t → (k : ℝ) ≤ (1 - ν) * t → U + Real.log 4 ≤ t / (200 * D * (R : ℝ) ^ 2) → U + Real.log 8 ≤ ν ^ 2 * t / 4 → Real.exp (-U) / 2 * ((n : ℝ) / t) ^ k ≤ Erdos1057.carmichaelCounting (B ^ ((1 + ν) * t)) := by have hD0 : 0 < D := lt_of_lt_of_le zero_lt_one hD have hM : 0 ≤ (P.card : ℝ) / (2 * D) := by positivity have hbudget : (P.card : ℝ) / (2 * D) * Nat.log 2 (Nat.card ((ZMod L)ˣ)) ≤ (P.card : ℝ) / 2 := by calc _ ≤ (P.card : ℝ) / (2 * D) * D := mul_le_mul_of_nonneg_left hlogD hM _ = (P.card : ℝ) / 2 := by field_simp obtain ⟨H, T, h, _, hTP, hhalf, _, hcount⟩ := finite_carmichael_transfer S P hPS g hprime hL hcompat hB hbound hM hbudget hR hRlarge hsmall hamb have hcard : T.card ≤ P.card := Finset.card_le_card hTP refine ⟨T.card, hhalf, hcard, ?_⟩ intro t ν k ht htn hν0 hν1 hsize hk hfourier htail have hn : 0 < (T.card : ℝ) := by linarith have hρ0 : 0 < t / T.card := div_pos ht hn have hρhalf : t / T.card ≤ 1 / 2 := (div_le_iff₀ hn).mpr (by linarith) have hρ1 : t / T.card ≤ 1 := hρhalf.trans (by norm_num) have heq : t / (T.card : ℝ) * T.card = t := div_mul_cancel₀ _ hn.ne' have hresult := hcount (t / T.card) ν k hρ0 hρ1 hν0 hν1 (by rwa [heq]) (by rwa [heq]) rw [heq] at hresult have hr : 0 < (R : ℝ) := by exact_mod_cast hR have hE := pruning_energy_lower_bound (N := (P.card : ℝ)) (Nat.cast_nonneg _) hD hr have hsample := sampling_energy_lower_bound (Nat.cast_nonneg P.card) hn (by exact_mod_cast hcard) hD hr ht hρhalf hE have herr1 : Real.exp (-(t / T.card) * (1 - t / T.card) * min (2 * ((P.card : ℝ) / (2 * D)) / (R : ℝ) ^ 2) (3 * (P.card : ℝ) / (4 * Real.pi ^ 2 * (R : ℝ) ^ 2))) ≤ Real.exp (-U) / 4 := by refine (Real.exp_le_exp.mpr ?_).trans (exp_error_le_inv_group (by norm_num) hfourier) linarith have herr2 : 2 * Real.exp (-ν ^ 2 * t / 4) ≤ Real.exp (-U) / 4 := by have h := exp_error_le_inv_group (by norm_num : (0 : ℝ) < 8) htail have he : -ν ^ 2 * t / 4 = -(ν ^ 2 * t / 4) := by ring rw [he] linarith have hHpos : 0 < (Nat.card H : ℝ) := by exact_mod_cast (Nat.card_pos (α := H)) have hHlog : Real.log (Nat.card H : ℝ) ≤ U := (Real.log_le_log hHpos (by exact_mod_cast H.card_le_card_group)).trans hU have hinv : Real.exp (-U) ≤ 1 / (Nat.card H : ℝ) := by calc _ ≤ Real.exp (-Real.log (Nat.card H : ℝ)) := Real.exp_le_exp.mpr (by linarith) _ = 1 / (Nat.card H : ℝ) := by rw [Real.exp_neg, Real.exp_log hHpos, one_div] have hnum : Real.exp (-U) / 2 ≤ 1 / (Nat.card H : ℝ) - Real.exp (-(t / T.card) * (1 - t / T.card) * min (2 * ((P.card : ℝ) / (2 * D)) / (R : ℝ) ^ 2) (3 * (P.card : ℝ) / (4 * Real.pi ^ 2 * (R : ℝ) ^ 2))) - 2 * Real.exp (-ν ^ 2 * t / 4) := by linarith calc Real.exp (-U) / 2 * ((T.card : ℝ) / t) ^ k = (Real.exp (-U) / 2) / (t / T.card) ^ k := by rw [div_pow, div_pow] field_simp _ ≤ _ := (div_le_div_of_nonneg_right hnum (pow_nonneg hρ0.le _)).trans hresult end section /- Rounding the reservoir-to-ambient size ratio gives all the finite spectral conditions as soon as the ambient character error is at most `N / 64`. -/ theorem fejer_length_parameters {N Q A : ℝ} (hN : 0 < N) (hNQ : N ≤ Q) (hA : 0 ≤ A) (hsmall : 64 * A ≤ N) : ∃ R : ℕ, 0 < R ∧ 64 * Q ≤ N * R ∧ (R - 1 : ℝ) * A ≤ Q ∧ (R : ℝ) ≤ 65 * Q / N := by let z : ℝ := 64 * Q / N have hQ : 0 < Q := hN.trans_le hNQ have hz : 0 < z := div_pos (by positivity) hN have hratio : 1 ≤ Q / N := (le_div_iff₀ hN).mpr (by simpa using hNQ) have hceil := Nat.le_ceil z have hceil' := Nat.ceil_lt_add_one hz.le have hR : 0 < ⌈z⌉₊ := Nat.ceil_pos.mpr hz refine ⟨⌈z⌉₊, hR, ?_, ?_, ?_⟩ · exact (div_le_iff₀ hN).mp hceil |>.trans_eq (by ring) · have hle : (⌈z⌉₊ : ℝ) - 1 ≤ z := by linarith have hmul := mul_le_mul_of_nonneg_right hle hA have hlast : z * A ≤ Q := by change 64 * Q / N * A ≤ Q rw [div_mul_eq_mul_div] apply (div_le_iff₀ hN).mpr have h := mul_le_mul_of_nonneg_left hsmall hQ.le convert h using 1 ring exact hmul.trans hlast · dsimp [z] at hceil' ⊢ have hid : 65 * Q / N = 64 * Q / N + Q / N := by ring rw [hid] linarith end section open Filter Set open scoped Topology /- A continuous cofinal real function maps every terminal ray onto a terminal ray. -/ theorem eventually_exists_preimage_ge {X : ℝ → ℝ} {a : ℝ} (hcont : ContinuousOn X (Ici a)) (htop : Tendsto X atTop atTop) (c : ℝ) : ∀ᶠ x : ℝ in atTop, ∃ y : ℝ, c ≤ y ∧ X y = x := by have hc : ContinuousOn X (Ici (max a c)) := hcont.mono (Ici_subset_Ici.mpr (le_max_left a c)) refine eventually_atTop.mpr ⟨X (max a c), ?_⟩ intro x hx obtain ⟨y, hy, hxy⟩ := intermediate_value_Ici hc htop hx exact ⟨y, (le_max_right a c).trans hy, hxy⟩ /- An eventual property verified along a continuous cofinal parameter holds for all large values. -/ theorem eventually_of_eventually_comp_cofinal {X : ℝ → ℝ} {a : ℝ} (hcont : ContinuousOn X (Ici a)) (htop : Tendsto X atTop atTop) {P : ℝ → Prop} (hP : ∀ᶠ y : ℝ in atTop, P (X y)) : ∀ᶠ x : ℝ in atTop, P x := by obtain ⟨c, hc⟩ := eventually_atTop.mp hP filter_upwards [eventually_exists_preimage_ge hcont htop c] with x hx obtain ⟨y, hy, rfl⟩ := hx exact hc y hy /- The size parameter used for prime-subset products in the transfer argument. -/ noncomputable def carmichaelSizeParameter (η ν y : ℝ) : ℝ := (5 * y) ^ ((1 + ν) * y ^ η) /- The size parameter is continuous on the ray where its bases are positive. -/ theorem carmichaelSizeParameter_continuousOn (η ν : ℝ) : ContinuousOn (carmichaelSizeParameter η ν) (Ici 1) := by unfold carmichaelSizeParameter have hpow : ContinuousOn (fun y : ℝ => y ^ η) (Ici 1) := continuousOn_id.rpow_const (fun y hy => Or.inl (ne_of_gt (lt_of_lt_of_le zero_lt_one hy))) exact (continuousOn_const.mul continuousOn_id).rpow (continuousOn_const.mul hpow) (fun y hy => Or.inl (mul_ne_zero (by norm_num) (ne_of_gt (lt_of_lt_of_le zero_lt_one hy)))) /- This elementary comparison already proves that the size parameter tends to infinity. -/ theorem self_le_carmichaelSizeParameter {η ν y : ℝ} (hη : 0 ≤ η) (hν : 0 ≤ ν) (hy : 1 ≤ y) : y ≤ carmichaelSizeParameter η ν y := by have hpow : 1 ≤ y ^ η := Real.one_le_rpow hy hη have hexp : 1 ≤ (1 + ν) * y ^ η := by nlinarith have hbase : 1 ≤ 5 * y := by linarith have hle : 5 * y ≤ (5 * y) ^ ((1 + ν) * y ^ η) := by simpa only [Real.rpow_one] using Real.rpow_le_rpow_of_exponent_le hbase hexp exact (by linarith : y ≤ 5 * y).trans hle theorem carmichaelSizeParameter_tendsto_atTop {η ν : ℝ} (hη : 0 ≤ η) (hν : 0 ≤ ν) : Tendsto (carmichaelSizeParameter η ν) atTop atTop := by apply tendsto_atTop_mono' atTop _ tendsto_id filter_upwards [eventually_ge_atTop (1 : ℝ)] with y hy exact self_le_carmichaelSizeParameter hη hν hy /- All-large-parameter estimates at the Carmichael size scale imply all-large-X estimates. -/ theorem eventually_of_carmichaelSizeParameter {η ν : ℝ} (hη : 0 ≤ η) (hν : 0 ≤ ν) {P : ℝ → Prop} (hP : ∀ᶠ y : ℝ in atTop, P (carmichaelSizeParameter η ν y)) : ∀ᶠ x : ℝ in atTop, P x := eventually_of_eventually_comp_cofinal (carmichaelSizeParameter_continuousOn η ν) (carmichaelSizeParameter_tendsto_atTop hη hν) hP end section open Filter open scoped Topology /- A logarithm times a smaller real power is negligible compared with a larger power. -/ theorem tendsto_rpow_log_div_rpow {a b : ℝ} (hab : a < b) : Tendsto (fun y : ℝ => y ^ a * Real.log y / y ^ b) atTop (𝓝 0) := by have h := (isLittleO_log_rpow_atTop (sub_pos.mpr hab)).tendsto_div_nhds_zero refine h.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℝ)] with y hy rw [Real.rpow_sub hy] have ha : y ^ a ≠ 0 := ne_of_gt (Real.rpow_pos_of_pos hy a) have hb : y ^ b ≠ 0 := ne_of_gt (Real.rpow_pos_of_pos hy b) field_simp /- Arbitrary fixed coefficients and an additive constant preserve the comparison. -/ theorem tendsto_mul_rpow_log_add_div_rpow {a b : ℝ} (hb : 0 < b) (hab : a < b) (d k : ℝ) : Tendsto (fun y : ℝ => (d * y ^ a * Real.log y + k) / y ^ b) atTop (𝓝 0) := by have h := ((tendsto_rpow_log_div_rpow hab).const_mul d).add ((tendsto_rpow_atTop hb).const_div_atTop k) have heq : (fun y : ℝ => (d * y ^ a * Real.log y + k) / y ^ b) = (fun y : ℝ => d * (y ^ a * Real.log y / y ^ b) + k / y ^ b) := by funext y ring rw [heq] simpa only [mul_zero, zero_add] using h /- Eventually every positive multiple of the larger power absorbs the error term. -/ theorem eventually_mul_rpow_log_add_le_rpow {a b c : ℝ} (hb : 0 < b) (hab : a < b) (hc : 0 < c) (d k : ℝ) : ∀ᶠ y : ℝ in atTop, d * y ^ a * Real.log y + k ≤ c * y ^ b := by filter_upwards [(tendsto_mul_rpow_log_add_div_rpow hb hab d k).eventually_le_const hc, eventually_gt_atTop (0 : ℝ)] with y h hy exact (div_le_iff₀ (Real.rpow_pos_of_pos hy b)).mp h end section open Filter Finset open scoped Topology /- The complete logarithmic size budget is sublinear when `a + d < 1`. This is uniform in all local weights and active moduli satisfying the stated growth bounds. The degree is chosen explicitly by a ceiling. -/ theorem eventually_residue_precision_parameters {a d A γ : ℝ} (ha : 0 ≤ a) (hd : 0 ≤ d) (had : a + d < 1) (hA : 0 < A) (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, ∀ ℓ B C q N : ℝ, 0 ≤ ℓ → 0 ≤ B → 0 ≤ C → 0 < q → 0 < N → ℓ ≤ A * (L^a * Real.log L) → B ≤ A * (L^a * Real.log L) → Real.log q ≤ A * (L^(a + d) * Real.log L) → Real.log (1 + C) ≤ A * L^d → γ * L ≤ Real.log N → let k := Nat.ceil (5 * ℓ + B + Real.log 4) 5 * ℓ + B + Real.log 4 ≤ (k : ℝ) ∧ (k : ℝ) ≤ (6 * A + Real.log 4 + 1) * (L^a * Real.log L) ∧ 4 * q * (k + 1 : ℕ) * Real.exp (B + 2 * ℓ) * (1 + C)^k ≤ N := by let K : ℝ := 6 * A + Real.log 4 + 1 let H : ℝ := Real.log 4 + K + 1 + 4 * A + K * A have hlog4 : 0 ≤ Real.log 4 := Real.log_nonneg (by norm_num) have hK : 0 ≤ K := by dsimp [K]; positivity have hscale : ∀ᶠ L : ℝ in atTop, H * (L^(a + d) * Real.log L) ≤ γ * L := by simpa only [add_zero, Real.rpow_one, mul_assoc] using eventually_mul_rpow_log_add_le_rpow (b := 1) (by norm_num) had hγ H 0 filter_upwards [hscale, eventually_ge_atTop (Real.exp 1)] with L hbudget hL have hL1 : 1 ≤ L := le_trans (Real.one_le_exp (by norm_num : (0 : ℝ) ≤ 1)) hL have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL1 have hlogL : 1 ≤ Real.log L := by simpa only [Real.log_exp] using Real.log_le_log (Real.exp_pos 1) hL let u := L^a * Real.log L let v := L^(a + d) * Real.log L have hu : 1 ≤ u := by dsimp [u] nlinarith [Real.one_le_rpow hL1 ha] have huv : u ≤ v := by exact mul_le_mul_of_nonneg_right (Real.rpow_le_rpow_of_exponent_le hL1 (by linarith)) (by linarith) have hv : 1 ≤ v := hu.trans huv have hmul : u * L^d = v := by dsimp [u, v] rw [Real.rpow_add hL0] ring intro ℓ B C q N hℓ hB hC hq hN hℓbound hBbound hqbound hCbound hNbound dsimp only let k := Nat.ceil (5 * ℓ + B + Real.log 4) have hk : 5 * ℓ + B + Real.log 4 ≤ (k : ℝ) := Nat.le_ceil _ have hkupper : (k : ℝ) ≤ 5 * ℓ + B + Real.log 4 + 1 := (Nat.ceil_lt_add_one (by positivity : 0 ≤ 5 * ℓ + B + Real.log 4)).le have hku : (k : ℝ) ≤ K * u := by dsimp [K] change ℓ ≤ A * u at hℓbound change B ≤ A * u at hBbound nlinarith [mul_le_mul_of_nonneg_left hu (show 0 ≤ Real.log 4 + 1 by positivity)] refine ⟨hk, hku, ?_⟩ apply residue_size_condition_of_log hC hq hN k have hlogk : Real.log (k + 1 : ℕ) ≤ (K + 1) * v := by have hl := Real.log_le_self (by positivity : (0 : ℝ) ≤ (k + 1 : ℕ)) have hk1 : ((k + 1 : ℕ) : ℝ) ≤ (K + 1) * u := by push_cast nlinarith exact hl.trans (hk1.trans (mul_le_mul_of_nonneg_left huv (by positivity))) have hlinear : B + 2 * ℓ ≤ 3 * A * v := by have hAv := mul_le_mul_of_nonneg_left huv hA.le change ℓ ≤ A * u at hℓbound change B ≤ A * u at hBbound nlinarith have hlogmass : (k : ℝ) * Real.log (1 + C) ≤ K * A * v := by calc _ ≤ (k : ℝ) * (A * L^d) := mul_le_mul_of_nonneg_left hCbound (Nat.cast_nonneg k) _ ≤ (K * u) * (A * L^d) := mul_le_mul_of_nonneg_right hku (by positivity) _ = K * A * v := by rw [← hmul]; ring have hlogconst : Real.log 4 ≤ Real.log 4 * v := by nlinarith change Real.log q ≤ A * v at hqbound change H * v ≤ γ * L at hbudget calc _ ≤ Real.log 4 * v + A * v + (K + 1) * v + 3 * A * v + K * A * v := by linarith _ = H * v := by dsimp [H]; ring _ ≤ γ * L := hbudget _ ≤ Real.log N := hNbound end section open Finset /- The contribution of the primes that have no active visit in the path. -/ noncomputable def inactivePathResidueWeight {ι : Type*} (m : ι → ℕ) (S : Finset ι) (visits : Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) (n : ℤ) : ℝ := ∏ i ∈ S, ∏ j ∈ visits, (1 - η j * (if (n : ZMod (m i)) = h i j then 1 else 0)) theorem inactive_path_residue_weight_eq {ι : Type*} (m : ι → ℕ) (S : Finset ι) (visits : Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) (n : ℤ) : inactivePathResidueWeight m S visits h η n = ∏ i ∈ S, (1 - visitExclusion visits (h i) η (n : ZMod (m i))) := by simp [inactivePathResidueWeight, visitExclusion] /- The local average of a never-active prime is one minus its exclusion probability, including all repeated visits. -/ theorem inactive_path_local_average {ι : Type*} (m : ι → ℕ) [∀ i, NeZero (m i)] (visits : Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) (i : ι) : ((∑ r : ZMod (m i), ∏ j ∈ visits, (1 - η j * (if r = h i j then 1 else 0))) / (m i : ℝ)) = 1 - exclusionLocalMean m (fun i => visitExclusion visits (h i) η) i := by have hm : (m i : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne (m i) simp only [exclusionLocalMean, visitExclusion, sum_sub_distrib, sum_const, card_univ, ZMod.card, nsmul_eq_mul, mul_one] field_simp ring /- The independent-residue expectation is the product of all local averages, with uniform measure at each active and inactive modulus. -/ noncomputable def pathResidueExpectation {α β : Type*} (ma : α → ℕ) [∀ i, NeZero (ma i)] (mb : β → ℕ) [∀ i, NeZero (mb i)] (Sa : Finset α) (Sb : Finset β) (visits : Finset ℕ) (active : α → Finset ℕ) (ha : ∀ i, ℕ → ZMod (ma i)) (hb : ∀ i, ℕ → ZMod (mb i)) (η : ℕ → ℝ) : ℝ := (∏ i ∈ Sa, (∑ r, activeResidueWeight visits (active i) (ha i) η r) / (ma i : ℝ)) * ∏ i ∈ Sb, (∑ r, ∏ j ∈ visits, (1 - η j * (if r = hb i j then 1 else 0))) / (mb i : ℝ) section variable {α β : Type*} [sharedInstance1 : DecidableEq α] [sharedInstance2 : DecidableEq β] (ma : α → ℕ) [sharedInstance4 : ∀ i, NeZero (ma i)] (mb : β → ℕ) [sharedInstance6 : ∀ i, NeZero (mb i)] (Sa : Finset α) (Sb : Finset β) (visits : Finset ℕ) (active : α → Finset ℕ) (ha : ∀ i, ℕ → ZMod (ma i)) (hb : ∀ i, ℕ → ZMod (mb i)) (η : ℕ → ℝ) (anchor : α → ℕ) include α β sharedInstance1 sharedInstance2 ma sharedInstance4 mb sharedInstance6 Sa Sb visits active ha hb η anchor /- For compatible active visits, the product-density main term in residue replacement is exactly the independent-residue expectation. -/ theorem path_residue_expectation_eq (hanchor : ∀ i ∈ Sa, anchor i ∈ active i) (hcompat : ∀ i ∈ Sa, ∀ j ∈ active i, ha i j = ha i (anchor i)) : pathResidueExpectation ma mb Sa Sb visits active ha hb η = ((∏ i ∈ Sa, activeVisitDamping visits (active i) (ha i) η (anchor i)) / ((∏ i ∈ Sa, ma i) : ℕ)) * ∏ i ∈ Sb, (1 - exclusionLocalMean mb (fun i => visitExclusion visits (hb i) η) i) := by unfold pathResidueExpectation have he : (∏ i ∈ Sa, (∑ r, activeResidueWeight visits (active i) (ha i) η r) / (ma i : ℝ)) = (∏ i ∈ Sa, activeVisitDamping visits (active i) (ha i) η (anchor i)) / ((∏ i ∈ Sa, ma i) : ℕ) := by rw [prod_natCast, ← prod_div_distrib] apply prod_congr rfl intro i hi rw [active_lifespan_residue_sum visits (active i) (ha i) η (anchor i) (hanchor i hi), if_pos (hcompat i hi)] rfl rw [he] congr 1 apply prod_congr rfl intro i hi exact inactive_path_local_average mb visits hb η i /- Complete finite path replacement. Compatible active primes fix one congruence; their deterministic damping is retained in both the main term and the error. The hypotheses on degree and interval length are explicit. -/ theorem path_residue_replacement (hma : (Sa : Set α).Pairwise (fun i j => Nat.Coprime (ma i) (ma j))) (hmb : Pairwise (fun i j => Nat.Coprime (mb i) (mb j))) (hcross : ∀ i ∈ Sa, ∀ j, Nat.Coprime (ma i) (mb j)) (hanchor : ∀ i ∈ Sa, anchor i ∈ active i) (hcompat : ∀ i ∈ Sa, ∀ j ∈ active i, ha i j = ha i (anchor i)) (hη : ∀ j ∈ visits, 0 ≤ η j ∧ η j ≤ 1) (hsmall : ∀ i ∈ Sb, exclusionLocalMean mb (fun i => visitExclusion visits (hb i) η) i ≤ 1 / 2) {N : ℕ} (hN : 0 < N) (z : ℤ) (k : ℕ) (B : ℝ) (hk : 5 * (∑ i ∈ Sb, exclusionLocalMean mb (fun i => visitExclusion visits (hb i) η) i) + B + Real.log 4 ≤ (k : ℝ)) (hsize : 4 * ((∏ i ∈ Sa, ma i) : ℕ) * (k + 1 : ℕ) * Real.exp (B + 2 * ∑ i ∈ Sb, exclusionLocalMean mb (fun i => visitExclusion visits (hb i) η) i) * (1 + ∑ i ∈ Sb, exclusionLocalMass mb (fun i => visitExclusion visits (hb i) η) i)^k ≤ N) : |((∑ n ∈ Ico z (z + N), (∏ i ∈ Sa, activeResidueWeight visits (active i) (ha i) η (n : ZMod (ma i))) * inactivePathResidueWeight mb Sb visits hb η n) / (N : ℝ)) - pathResidueExpectation ma mb Sa Sb visits active ha hb η| ≤ Real.exp (-B) * pathResidueExpectation ma mb Sa Sb visits active ha hb η := by rw [path_residue_expectation_eq ma mb Sa Sb visits active ha hb η anchor hanchor hcompat] let Q := ∏ i ∈ Sa, ma i have hQ : 0 < Q := prod_pos (fun i hi => Nat.pos_of_ne_zero (NeZero.ne (ma i))) let : NeZero Q := ⟨ne_of_gt hQ⟩ have hQcop : ∀ j, Nat.Coprime Q (mb j) := fun j => Nat.coprime_prod_left_iff.mpr (fun i hi => hcross i hi j) obtain ⟨c, hfactor⟩ := active_path_residue_factorization ma Sa visits active ha η anchor hma hanchor hcompat let D := ∏ i ∈ Sa, activeVisitDamping visits (active i) (ha i) η (anchor i) have hD : 0 ≤ D := prod_nonneg (fun i hi => active_visit_damping_nonneg visits (active i) (ha i) η (anchor i) hη) have he := conditioned_crt_damped_interval Q mb hmb hQcop (c : ZMod Q) (fun i => visitExclusion visits (hb i) η) Sb (fun i hi t => visit_exclusion_unit visits (hb i) η hη t) hsmall hN z k B D hD hk hsize have hsum : (∑ n ∈ Ico z (z + N), (∏ i ∈ Sa, activeResidueWeight visits (active i) (ha i) η (n : ZMod (ma i))) * inactivePathResidueWeight mb Sb visits hb η n) = D * (∑ n ∈ Ico z (z + N), (if (n : ZMod Q) = (c : ZMod Q) then 1 else 0) * ∏ i ∈ Sb, (1 - visitExclusion visits (hb i) η (n : ZMod (mb i)))) := by rw [mul_sum] apply sum_congr rfl intro n hn rw [hfactor n, inactive_path_residue_weight_eq] change (_ * D) * _ = D * (_ * _) ring rw [hsum] simpa only [Q, D, mul_div_right_comm] using he end end section open Finset /- The absolute local mass is bounded by the total visit weight, since the grouped exclusion weight is nonnegative. -/ theorem visit_local_mass_le {ι : Type*} (m : ι → ℕ) [∀ i, NeZero (m i)] (visits : Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) (hη : ∀ j ∈ visits, 0 ≤ η j ∧ η j ≤ 1) (i : ι) : exclusionLocalMass m (fun i => visitExclusion visits (h i) η) i ≤ ∑ j ∈ visits, η j := by unfold exclusionLocalMass have he : ∀ r, |visitExclusion visits (h i) η r| = visitExclusion visits (h i) η r := fun r => abs_of_nonneg (visit_exclusion_unit visits (h i) η hη r).1 simp_rw [he] exact visit_exclusion_mass visits (h i) η hη section variable {ι : Type*} (m : ι → ℕ) [sharedInstance2 : ∀ i, NeZero (m i)] (S : Finset ι) (visits : Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) (hη : ∀ j ∈ visits, 0 ≤ η j ∧ η j ≤ 1) include ι m sharedInstance2 S visits h η hη /- Summing the local means costs only the harmonic mass of the modulus set. -/ theorem visit_mean_sum_le_harmonic : (∑ i ∈ S, exclusionLocalMean m (fun i => visitExclusion visits (h i) η) i) ≤ (∑ j ∈ visits, η j) * ∑ i ∈ S, 1 / (m i : ℝ) := by calc _ ≤ ∑ i ∈ S, (∑ j ∈ visits, η j) / (m i : ℝ) := sum_le_sum (fun i hi => visit_exclusion_mean_bound (m i) visits (h i) η hη) _ = _ := by rw [mul_sum]; apply sum_congr rfl; intro i hi; ring /- Summing absolute masses is bounded by the number of moduli times the total visit weight. -/ theorem visit_mass_sum_le_card : (∑ i ∈ S, exclusionLocalMass m (fun i => visitExclusion visits (h i) η) i) ≤ (S.card : ℝ) * ∑ j ∈ visits, η j := by calc _ ≤ ∑ _i ∈ S, ∑ j ∈ visits, η j := sum_le_sum (fun i hi => visit_local_mass_le m visits h η hη i) _ = _ := by simp end /- A modulus exceeding twice the total visit weight gives a local exclusion probability at most one half. -/ theorem visit_mean_le_half {ι : Type*} (m : ι → ℕ) [∀ i, NeZero (m i)] (visits : Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) (hη : ∀ j ∈ visits, 0 ≤ η j ∧ η j ≤ 1) (i : ι) (hm : 2 * (∑ j ∈ visits, η j) ≤ (m i : ℝ)) : exclusionLocalMean m (fun i => visitExclusion visits (h i) η) i ≤ 1 / 2 := by refine (visit_exclusion_mean_bound (m i) visits (h i) η hη).trans ?_ apply (div_le_iff₀ (by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne (m i)))).2 linarith /- Disjoint prime groups add their harmonic masses without multiplicity. -/ theorem prime_group_harmonic_bound {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (hdisj : (groups : Set G).PairwiseDisjoint P) (V : ℝ) (hV : ∀ g ∈ groups, (∑ p ∈ P g, 1 / (p : ℝ)) ≤ V) : (∑ p ∈ groups.biUnion P, 1 / (p : ℝ)) ≤ (groups.card : ℝ) * V := by rw [sum_biUnion hdisj] calc _ ≤ ∑ _g ∈ groups, V := sum_le_sum hV _ = _ := by simp /- Distinct positive integers bounded by `exp H` number at most `exp H`. -/ theorem prime_pool_card_le_exp (P : Finset ℕ) (H : ℝ) (hpos : ∀ p ∈ P, 0 < p) (hmax : ∀ p ∈ P, (p : ℝ) ≤ Real.exp H) : (P.card : ℝ) ≤ Real.exp H := by have hc : (P.card : ℝ) ≤ (⌊Real.exp H⌋₊ : ℝ) := by exact_mod_cast card_positive_nat_finset_le_floor hpos hmax exact hc.trans (Nat.floor_le (Real.exp_pos H).le) /- An injective family of positive integer moduli inherits the cardinality bound for its image. -/ theorem moduli_card_le_exp {ι : Type*} [DecidableEq ι] (m : ι → ℕ) (S : Finset ι) (H : ℝ) (hinj : Set.InjOn m S) (hpos : ∀ i ∈ S, 0 < m i) (hmax : ∀ i ∈ S, (m i : ℝ) ≤ Real.exp H) : (S.card : ℝ) ≤ Real.exp H := by have he := prime_pool_card_le_exp (S.image m) H (by intro p hp; obtain ⟨i, hi, rfl⟩ := mem_image.mp hp; exact hpos i hi) (by intro p hp; obtain ⟨i, hi, rfl⟩ := mem_image.mp hp; exact hmax i hi) simpa only [card_image_of_injOn hinj] using he /- Indexed modulus products satisfy the same logarithmic estimate, even without injectivity of the indexing map. -/ theorem modulus_product_log_bound {ι : Type*} (m : ι → ℕ) (S : Finset ι) (H : ℝ) (hpos : ∀ i ∈ S, 0 < m i) (hmax : ∀ i ∈ S, (m i : ℝ) ≤ Real.exp H) : Real.log ((∏ i ∈ S, m i : ℕ) : ℝ) ≤ (S.card : ℝ) * H := by have hp : ∀ i ∈ S, (m i : ℝ) ≠ 0 := fun i hi => ne_of_gt (by exact_mod_cast hpos i hi) rw [Nat.cast_prod, Real.log_prod hp] calc _ ≤ ∑ _i ∈ S, H := by apply sum_le_sum intro i hi have ht := Real.log_le_log (by exact_mod_cast hpos i hi) (hmax i hi) simpa only [Real.log_exp] using ht _ = _ := by simp end section open Filter Finset open scoped Topology /- Every fixed real power is negligible relative to an exponential of a positive power. -/ theorem tendsto_rpow_div_exp_rpow (a : ℝ) {c : ℝ} (hc : 0 < c) : Tendsto (fun L : ℝ => L^a / Real.exp (L^c)) atTop (𝓝 0) := by have he := ((isLittleO_rpow_exp_atTop (a / c)).tendsto_div_nhds_zero).comp (tendsto_rpow_atTop hc) apply he.congr' filter_upwards [eventually_gt_atTop (0 : ℝ)] with L hL simp only [Function.comp_apply] rw [← Real.rpow_mul hL.le] congr 2 field_simp /- The lower end of a prime pool eventually dominates any fixed power bound for the total visit weight. -/ theorem eventually_mul_rpow_le_exp_rpow (a A : ℝ) {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, A * L^a ≤ Real.exp (L^c) := by have he := (tendsto_rpow_div_exp_rpow a hc).const_mul A have hz : A * (0 : ℝ) < 1 := by simp filter_upwards [he.eventually_le_const hz] with L hL have hd : 0 < Real.exp (L^c) := Real.exp_pos _ have hh : A * L^a / Real.exp (L^c) ≤ 1 := by simpa only [mul_div_assoc] using hL simpa only [one_mul] using (div_le_iff₀ hd).mp hh /- Taking a logarithm removes the exponential size of the complete prime pool. The polynomial visit factor only changes a lower-order term. -/ theorem eventually_log_polynomial_exp_bound {a d A : ℝ} (ha : 0 ≤ a) (hd : 0 < d) (hA : 0 ≤ A) : ∀ᶠ L : ℝ in atTop, ∀ C : ℝ, 0 ≤ C → C ≤ A * L^a * Real.exp (L^d) → Real.log (1 + C) ≤ 2 * L^d := by have he := eventually_mul_rpow_log_add_le_rpow (a := 0) hd hd (show (0 : ℝ) < 1 by norm_num) a (Real.log (1 + A)) filter_upwards [he, eventually_ge_atTop (1 : ℝ)] with L hlog hL have hLpos : 0 < L := lt_of_lt_of_le zero_lt_one hL have hLa : 1 ≤ L^a := Real.one_le_rpow hL ha have hexp : 1 ≤ Real.exp (L^d) := Real.one_le_exp (Real.rpow_nonneg hLpos.le d) have hprod : 1 ≤ L^a * Real.exp (L^d) := by nlinarith intro C hC hbound have hupper : 1 + C ≤ (1 + A) * L^a * Real.exp (L^d) := by nlinarith calc Real.log (1 + C) ≤ Real.log ((1 + A) * L^a * Real.exp (L^d)) := Real.log_le_log (by positivity) hupper _ = Real.log (1 + A) + a * Real.log L + L^d := by rw [Real.log_mul (by positivity) (ne_of_gt (Real.exp_pos _)), Real.log_mul (by positivity) (ne_of_gt (Real.rpow_pos_of_pos hLpos a)), Real.log_rpow hLpos, Real.log_exp] _ ≤ 2 * L^d := by simp only [Real.rpow_zero, mul_one, one_mul] at hlog; linarith /- The prime-pool range, harmonic mass, and active-modulus bound give all numerical hypotheses needed by conditioned residue replacement. The threshold is independent of the individual path and its residues. -/ theorem eventually_prime_pool_precision {a c d A γ : ℝ} (ha : 0 ≤ a) (hc : 0 < c) (hd : 0 < d) (had : a + d < 1) (hA : 0 < A) (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, ∀ t H ℓ B C q N : ℝ, 0 ≤ t → 0 ≤ H → 0 ≤ ℓ → 0 ≤ B → 0 ≤ C → 0 < q → 0 < N → t ≤ A * L^a → H ≤ A * Real.log L → ℓ ≤ t * H → B ≤ A * (L^a * Real.log L) → C ≤ t * Real.exp (L^d) → Real.log q ≤ A * (L^(a + d) * Real.log L) → γ * L ≤ Real.log N → let k := Nat.ceil (5 * ℓ + B + Real.log 4) 2 * t ≤ Real.exp (L^c) ∧ 5 * ℓ + B + Real.log 4 ≤ (k : ℝ) ∧ (k : ℝ) ≤ (6 * (A^2 + A + 2) + Real.log 4 + 1) * (L^a * Real.log L) ∧ 4 * q * (k + 1 : ℕ) * Real.exp (B + 2 * ℓ) * (1 + C)^k ≤ N := by let K : ℝ := A^2 + A + 2 have hK : 0 < K := by dsimp [K]; positivity have hAK : A ≤ K := by dsimp [K]; nlinarith [sq_nonneg A] have hA2K : A^2 ≤ K := by dsimp [K]; linarith have h2K : 2 ≤ K := by dsimp [K]; nlinarith [sq_nonneg A] filter_upwards [eventually_mul_rpow_le_exp_rpow a (2 * A) hc, eventually_log_polynomial_exp_bound ha hd hA.le, eventually_residue_precision_parameters ha hd.le had hK hγ, eventually_ge_atTop (1 : ℝ)] with L hmin hmass hprecision hL have hL0 : 0 ≤ L := zero_le_one.trans hL have hlog : 0 ≤ Real.log L := Real.log_nonneg hL have hu : 0 ≤ L^a * Real.log L := mul_nonneg (Real.rpow_nonneg hL0 a) hlog have hv : 0 ≤ L^(a + d) * Real.log L := mul_nonneg (Real.rpow_nonneg hL0 (a + d)) hlog intro t H ℓ B C q N ht hH hℓ hB hC hq hN htbound hHbound hℓbound hBbound hCbound hqbound hNbound have hmin' : 2 * t ≤ Real.exp (L^c) := by nlinarith have hℓ' : ℓ ≤ K * (L^a * Real.log L) := by calc ℓ ≤ t * H := hℓbound _ ≤ (A * L^a) * (A * Real.log L) := mul_le_mul htbound hHbound hH (by positivity) _ = A^2 * (L^a * Real.log L) := by ring _ ≤ K * (L^a * Real.log L) := mul_le_mul_of_nonneg_right hA2K hu have hB' : B ≤ K * (L^a * Real.log L) := hBbound.trans (mul_le_mul_of_nonneg_right hAK hu) have hq' : Real.log q ≤ K * (L^(a + d) * Real.log L) := hqbound.trans (mul_le_mul_of_nonneg_right hAK hv) have hC' : Real.log (1 + C) ≤ K * L^d := by apply (hmass C hC ?_).trans (mul_le_mul_of_nonneg_right h2K (Real.rpow_nonneg hL0 d)) exact hCbound.trans (mul_le_mul_of_nonneg_right htbound (Real.exp_pos _).le) exact ⟨hmin', hprecision ℓ B C q N hℓ hB hC hq hN hℓ' hB' hq' hC' hNbound⟩ end section open Filter Finset open scoped Topology /- An inconsistent active prime has zero independent-residue expectation. -/ theorem path_residue_expectation_incompatible {α β : Type*} [DecidableEq α] (ma : α → ℕ) [∀ i, NeZero (ma i)] (mb : β → ℕ) [∀ i, NeZero (mb i)] (Sa : Finset α) (Sb : Finset β) (visits : Finset ℕ) (active : α → Finset ℕ) (ha : ∀ i, ℕ → ZMod (ma i)) (hb : ∀ i, ℕ → ZMod (mb i)) (η : ℕ → ℝ) {i : α} (hi : i ∈ Sa) {a z : ℕ} (hfirst : a ∈ active i) (hlast : z ∈ active i) (hne : ha i a ≠ ha i z) : pathResidueExpectation ma mb Sa Sb visits active ha hb η = 0 := by have hz : (∏ j ∈ Sa, (∑ r, activeResidueWeight visits (active j) (ha j) η r) / (ma j : ℝ)) = 0 := by apply prod_eq_zero hi have hr : ∀ r, activeResidueWeight visits (active i) (ha i) η r = 0 := active_residue_weight_incompatible visits (active i) (ha i) η hfirst hlast hne simp only [hr, sum_const_zero, zero_div] unfold pathResidueExpectation rw [hz, zero_mul] /- Prime-pool bounds imply exponentially accurate residue replacement, uniformly over the residues, marks, damping, and integer interval. The active visits may be incompatible; in that case both sides vanish exactly. -/ theorem eventually_path_replacement_of_prime_bounds {a c d A γ : ℝ} (ha0 : 0 ≤ a) (hc : 0 < c) (hd : 0 < d) (had : a + d < 1) (hA : 0 < A) (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, ∀ (α β : Type) [DecidableEq α] [DecidableEq β] (ma : α → ℕ) [∀ i, NeZero (ma i)] (mb : β → ℕ) [∀ i, NeZero (mb i)] (Sa : Finset α) (Sb : Finset β) (visits : Finset ℕ) (active : α → Finset ℕ) (ha : ∀ i, ℕ → ZMod (ma i)) (hb : ∀ i, ℕ → ZMod (mb i)) (η : ℕ → ℝ) (anchor : α → ℕ) (N : ℕ) (z : ℤ) (B : ℝ), (Sa : Set α).Pairwise (fun i j => Nat.Coprime (ma i) (ma j)) → Pairwise (fun i j => Nat.Coprime (mb i) (mb j)) → (∀ i ∈ Sa, ∀ j, Nat.Coprime (ma i) (mb j)) → (∀ i ∈ Sa, anchor i ∈ active i) → (∀ j ∈ visits, 0 ≤ η j ∧ η j ≤ 1) → (∑ j ∈ visits, η j) ≤ A * L^a → (Sb.card : ℝ) ≤ Real.exp (L^d) → (∑ i ∈ Sb, 1 / (mb i : ℝ)) ≤ A * Real.log L → (∀ i ∈ Sb, Real.exp (L^c) ≤ (mb i : ℝ)) → (Sa.card : ℝ) ≤ A * (L^a * Real.log L) → (∀ i ∈ Sa, (ma i : ℝ) ≤ Real.exp (L^d)) → 0 < N → γ * L ≤ Real.log (N : ℝ) → 0 ≤ B → B ≤ A * (L^a * Real.log L) → |((∑ n ∈ Ico z (z + N), (∏ i ∈ Sa, activeResidueWeight visits (active i) (ha i) η (n : ZMod (ma i))) * inactivePathResidueWeight mb Sb visits hb η n) / (N : ℝ)) - pathResidueExpectation ma mb Sa Sb visits active ha hb η| ≤ Real.exp (-B) * pathResidueExpectation ma mb Sa Sb visits active ha hb η := by filter_upwards [eventually_prime_pool_precision ha0 hc hd had hA hγ, eventually_ge_atTop (1 : ℝ)] with L hprecision hL intro α β _ _ ma _ mb _ Sa Sb visits active ha hb η anchor N z B hma hmb hcross hanchor hη htbound hcount hHbound hmin hactive hmax hN hNbound hB hBbound have hLpos : 0 < L := lt_of_lt_of_le zero_lt_one hL let t := ∑ j ∈ visits, η j let H := ∑ i ∈ Sb, 1 / (mb i : ℝ) let ℓ := ∑ i ∈ Sb, exclusionLocalMean mb (fun i => visitExclusion visits (hb i) η) i let C := ∑ i ∈ Sb, exclusionLocalMass mb (fun i => visitExclusion visits (hb i) η) i let Q := ∏ i ∈ Sa, ma i have ht : 0 ≤ t := sum_nonneg (fun j hj => (hη j hj).1) have hH : 0 ≤ H := sum_nonneg (fun i hi => by positivity) have hℓ : 0 ≤ ℓ := sum_nonneg (fun i hi => (exclusion_local_mean_unit mb (fun i => visitExclusion visits (hb i) η) i (visit_exclusion_unit visits (hb i) η hη)).1) have hC : 0 ≤ C := by apply sum_nonneg intro i hi exact sum_nonneg (fun r hr => abs_nonneg _) have hQ : 0 < Q := prod_pos (fun i hi => Nat.pos_of_ne_zero (NeZero.ne (ma i))) have hℓbound : ℓ ≤ t * H := visit_mean_sum_le_harmonic mb Sb visits hb η hη have hCbound : C ≤ t * Real.exp (L^d) := by calc C ≤ (Sb.card : ℝ) * t := visit_mass_sum_le_card mb Sb visits hb η hη _ ≤ Real.exp (L^d) * t := mul_le_mul_of_nonneg_right hcount ht _ = _ := mul_comm _ _ have hqbound : Real.log (Q : ℝ) ≤ A * (L^(a + d) * Real.log L) := by calc _ ≤ (Sa.card : ℝ) * L^d := modulus_product_log_bound ma Sa (L^d) (fun i hi => Nat.pos_of_ne_zero (NeZero.ne (ma i))) hmax _ ≤ (A * (L^a * Real.log L)) * L^d := mul_le_mul_of_nonneg_right hactive (Real.rpow_nonneg hLpos.le d) _ = _ := by rw [Real.rpow_add hLpos]; ring obtain ⟨hsmall, hk, _hkupper, hsize⟩ := hprecision t H ℓ B C (Q : ℝ) (N : ℝ) ht hH hℓ hB hC (by exact_mod_cast hQ) (by exact_mod_cast hN) htbound hHbound hℓbound hBbound hCbound hqbound hNbound by_cases hcompat : ∀ i ∈ Sa, ∀ j ∈ active i, ha i j = ha i (anchor i) · apply path_residue_replacement ma mb Sa Sb visits active ha hb η anchor hma hmb hcross hanchor hcompat hη _ hN z (Nat.ceil (5 * ℓ + B + Real.log 4)) B hk hsize intro i hi apply visit_mean_le_half mb visits hb η hη i exact hsmall.trans (hmin i hi) · push Not at hcompat obtain ⟨i, hi, j, hj, hne⟩ := hcompat have hexpect := path_residue_expectation_incompatible ma mb Sa Sb visits active ha hb η hi hj (hanchor i hi) hne have hzero : ∀ n : ℤ, (∏ j ∈ Sa, activeResidueWeight visits (active j) (ha j) η (n : ZMod (ma j))) = 0 := active_path_residue_incompatible ma Sa visits active ha η hi hj (hanchor i hi) hne simp only [hzero, zero_mul, sum_const_zero, zero_div, hexpect, sub_self, abs_zero, mul_zero, le_refl] end section open Finset /- The same estimate applies to complex coefficients in the operator expansion while the path residue factors remain real. -/ theorem complex_path_error_bound {P : Type*} (paths : Finset P) (c : P → ℂ) (actual expected : P → ℝ) (ε : ℝ) (herror : ∀ p ∈ paths, |actual p - expected p| ≤ ε * expected p) : ‖(∑ p ∈ paths, c p * (actual p : ℂ)) - ∑ p ∈ paths, c p * (expected p : ℂ)‖ ≤ ε * ∑ p ∈ paths, ‖c p‖ * expected p := by rw [← sum_sub_distrib] calc _ ≤ ∑ p ∈ paths, ‖c p * (actual p : ℂ) - c p * (expected p : ℂ)‖ := norm_sum_le _ _ _ = ∑ p ∈ paths, ‖c p‖ * |actual p - expected p| := by apply sum_congr rfl intro p hp rw [← mul_sub, norm_mul, ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs] _ ≤ ∑ p ∈ paths, ‖c p‖ * (ε * expected p) := sum_le_sum (fun p hp => mul_le_mul_of_nonneg_left (herror p hp) (norm_nonneg _)) _ = _ := by rw [mul_sum]; apply sum_congr rfl; intro p hp; ring end section open Finset /- Damping once for every successful hit is the corresponding product of affine indicator factors. -/ theorem damping_product_power {P : Type*} (S : Finset P) (hit : P → Prop) [DecidablePred hit] (q : ℝ) : (∏ p ∈ S, (1 - (1 - q) * (if hit p then 1 else 0))) = q^(S.filter hit).card := by have he : ∀ p, (1 - (1 - q) * (if hit p then 1 else 0)) = if hit p then q else 1 := by intro p by_cases h : hit p <;> simp [h] simp only [he, prod_ite, prod_const, one_pow, mul_one] /- A local active residue weight can be read as a product over visits. -/ theorem active_residue_weight_as_visit_product {R : Type*} [DecidableEq R] (visits active : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) (r : R) (hactive : active ⊆ visits) : activeResidueWeight visits active h η r = ∏ j ∈ visits, (if j ∈ active then (if r = h j then 1 else 0) else 1 - η j * (if r = h j then 1 else 0)) := by have hfilter : visits.filter (fun j => j ∈ active) = active := by ext j simp only [mem_filter] exact ⟨And.right, fun hj => ⟨hactive hj, hj⟩⟩ have hnot : visits.filter (fun j => j ∉ active) = visits \ active := by ext j simp only [mem_filter, mem_sdiff] rw [prod_ite, hfilter, hnot] rfl /- At a vertex, active divisibility indicators and damping for the other group primes equal a single product over the whole prime pool. -/ theorem vertex_residue_factor_as_product {P : Type*} [DecidableEq P] (pool marked : Finset P) (hit : P → Prop) [DecidablePred hit] (q : ℝ) (hmarked : marked ⊆ pool) : (∏ p ∈ marked, (if hit p then (1 : ℝ) else 0)) * q^((pool \ marked).filter hit).card = ∏ p ∈ pool, (if p ∈ marked then (if hit p then 1 else 0) else 1 - (1 - q) * (if hit p then 1 else 0)) := by have hfilter : pool.filter (fun p => p ∈ marked) = marked := by ext p simp only [mem_filter] exact ⟨And.right, fun hp => ⟨hmarked hp, hp⟩⟩ have hnot : pool.filter (fun p => p ∉ marked) = pool \ marked := by ext p simp only [mem_filter, mem_sdiff] symm rw [prod_ite, hfilter, hnot, damping_product_power] /- Regrouping the physical path factor by prime gives precisely the local active-residue weights used by residue replacement. -/ theorem physical_path_residue_factorization {P : Type*} [DecidableEq P] (m : P → ℕ) (pool : Finset P) (visits : Finset ℕ) (marked : ℕ → Finset P) (h : ∀ p, ℕ → ZMod (m p)) (q : ℕ → ℝ) (n : ℤ) (hmarked : ∀ j ∈ visits, marked j ⊆ pool) : (∏ j ∈ visits, (∏ p ∈ marked j, (if (n : ZMod (m p)) = h p j then (1 : ℝ) else 0)) * (q j)^((pool \ marked j).filter (fun p => (n : ZMod (m p)) = h p j)).card) = ∏ p ∈ pool, activeResidueWeight visits (visits.filter (fun j => p ∈ marked j)) (h p) (fun j => 1 - q j) (n : ZMod (m p)) := by calc _ = ∏ j ∈ visits, ∏ p ∈ pool, (if p ∈ marked j then (if (n : ZMod (m p)) = h p j then 1 else 0) else 1 - (1 - q j) * (if (n : ZMod (m p)) = h p j then 1 else 0)) := by apply prod_congr rfl intro j hj exact vertex_residue_factor_as_product pool (marked j) (fun p => (n : ZMod (m p)) = h p j) (q j) (hmarked j hj) _ = _ := by rw [prod_comm] apply prod_congr rfl intro p hp rw [active_residue_weight_as_visit_product visits _ (h p) _ _ (filter_subset _ _)] apply prod_congr rfl intro j hj simp only [mem_filter, hj, true_and] /- A shifted divisibility condition is the residue constraint used in the local path factors. This also holds for a zero integer offset. -/ theorem shifted_congruence_iff_dvd (m : ℕ) (n h : ℤ) : (n : ZMod m) = -(h : ZMod m) ↔ (m : ℤ) ∣ n + h := by rw [eq_neg_iff_add_eq_zero, ← Int.cast_add, ZMod.intCast_zmod_eq_zero_iff_dvd] /- The divisibility-and-damping expression in the physical path expansion has exactly the grouped-residue form, including repeated offsets. -/ theorem physical_path_divisibility_factorization {P : Type*} [DecidableEq P] (m : P → ℕ) (pool : Finset P) (visits : Finset ℕ) (marked : ℕ → Finset P) (offset : ℕ → ℤ) (q : ℕ → ℝ) (n : ℤ) (hmarked : ∀ j ∈ visits, marked j ⊆ pool) : (∏ j ∈ visits, (∏ p ∈ marked j, (if (m p : ℤ) ∣ n + offset j then (1 : ℝ) else 0)) * (q j)^((pool \ marked j).filter (fun p => (m p : ℤ) ∣ n + offset j)).card) = ∏ p ∈ pool, activeResidueWeight visits (visits.filter (fun j => p ∈ marked j)) (fun j => -(offset j : ZMod (m p))) (fun j => 1 - q j) (n : ZMod (m p)) := by have he := physical_path_residue_factorization m pool visits marked (fun p j => -(offset j : ZMod (m p))) q n hmarked simpa only [shifted_congruence_iff_dvd] using he end section open Finset /- A single binomial-geometric term is bounded by its positive total sum. -/ theorem damped_choose_bound {ρ : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ < 1) (z t : ℕ) : ((z + t).choose t : ℝ) * ρ^z ≤ 1 / (1 - ρ)^(t + 1) := by have hnorm : ‖ρ‖ < 1 := by simpa only [Real.norm_eq_abs, abs_of_nonneg hρ0] using hρ1 have hs := hasSum_choose_mul_geometric_of_norm_lt_one t hnorm have hb := sum_le_hasSum ({z} : Finset ℕ) (fun n hn => show (0 : ℝ) ≤ ((n + t).choose t : ℝ) * ρ^n by positivity) hs simpa only [sum_singleton] using hb /- The ordered-list count with geometric damping has an explicit bound independent of the excess number of available labels. -/ theorem damped_descFactorial_bound {ρ : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ < 1) (z t : ℕ) : ((z + t).descFactorial t : ℝ) * ρ^z ≤ (t.factorial : ℝ) / (1 - ρ)^(t + 1) := by rw [Nat.descFactorial_eq_factorial_mul_choose, Nat.cast_mul, mul_assoc] simpa only [mul_one_div] using mul_le_mul_of_nonneg_left (damped_choose_bound hρ0 hρ1 z t) (Nat.cast_nonneg t.factorial) /- A single constant works for every unshared-slot count up to a fixed bound and for every group harmonic mass bounded below by a positive value. -/ theorem uniform_damped_descFactorial_bound {ρ v V : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ < 1) (hv : 0 < v) (hV : v ≤ V) (T z t : ℕ) (ht : t ≤ T) : (((z + t).descFactorial t : ℝ) * ρ^z) / V^t ≤ ((T.factorial : ℝ) * (max 1 (1 / v))^T) / (1 - ρ)^(T + 1) := by have hVpos : 0 < V := hv.trans_le hV have hden : 0 < 1 - ρ := sub_pos.mpr hρ1 have hvInv : 1 / V ≤ max 1 (1 / v) := (one_div_le_one_div_of_le hv hV).trans (le_max_right _ _) have hInv : (1 / V)^t ≤ (max 1 (1 / v))^T := by exact (pow_le_pow_left₀ (by positivity) hvInv t).trans (pow_le_pow_right₀ (le_max_left _ _) ht) have hfac : (t.factorial : ℝ) ≤ (T.factorial : ℝ) := by exact_mod_cast Nat.factorial_le ht have hbase : 1 ≤ 1 / (1 - ρ) := (one_le_div hden).2 (by linarith) have hpow : (1 / (1 - ρ))^(t + 1) ≤ (1 / (1 - ρ))^(T + 1) := pow_le_pow_right₀ hbase (Nat.add_le_add_right ht 1) calc _ ≤ ((t.factorial : ℝ) / (1 - ρ)^(t + 1)) / V^t := div_le_div_of_nonneg_right (damped_descFactorial_bound hρ0 hρ1 z t) (pow_nonneg hVpos.le t) _ = (t.factorial : ℝ) * (1 / (1 - ρ))^(t + 1) * (1 / V)^t := by rw [one_div_pow, one_div_pow] ring _ ≤ (T.factorial : ℝ) * (1 / (1 - ρ))^(T + 1) * (max 1 (1 / v))^T := by apply mul_le_mul · exact mul_le_mul hfac hpow (by positivity) (by positivity) · exact hInv · positivity · positivity _ = _ := by rw [one_div_pow]; ring /- Endpoint damping by `q^(z/2)` uniformly absorbs the unshared-list count. The constant only uses `q`, the lower mass bound, and the maximum number of unshared slots. -/ theorem exists_physical_damping_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (T : ℕ) : ∃ C : ℝ, 1 ≤ C ∧ ∀ (V : ℝ), v ≤ V → ∀ z t : ℕ, t ≤ T → (((z + t).descFactorial t : ℝ) * q^((z : ℝ) / 2)) / V^t ≤ C := by let ρ := Real.sqrt q have hρ0 : 0 ≤ ρ := Real.sqrt_nonneg q have hρ1 : ρ < 1 := by have hs : ρ^2 = q := Real.sq_sqrt hq0 nlinarith let C := ((T.factorial : ℝ) * (max 1 (1 / v))^T) / (1 - ρ)^(T + 1) refine ⟨max 1 C, le_max_left _ _, ?_⟩ intro V hV z t ht have hp : q^((z : ℝ) / 2) = ρ^z := by dsimp [ρ] rw [Real.sqrt_eq_rpow, ← Real.rpow_natCast, ← Real.rpow_mul hq0] congr 1 ring rw [hp] exact (uniform_damped_descFactorial_bound hρ0 hρ1 hv hV T z t ht).trans (le_max_right _ _) /- A constant loss in each of logarithmically many groups gives a fixed power of `L`. -/ theorem group_product_bound_of_log_card {G : Type*} (groups : Finset G) (f : G → ℝ) {C L K : ℝ} (hC : 1 ≤ C) (hL : 0 < L) (hf0 : ∀ g ∈ groups, 0 ≤ f g) (hfC : ∀ g ∈ groups, f g ≤ C) (hcard : (groups.card : ℝ) ≤ K * Real.log L) : (∏ g ∈ groups, f g) ≤ L^(K * Real.log C) := by have hCpos : 0 < C := lt_of_lt_of_le zero_lt_one hC calc _ ≤ ∏ _g ∈ groups, C := prod_le_prod₀ hf0 hfC _ = C^groups.card := by simp _ = Real.exp ((groups.card : ℝ) * Real.log C) := by rw [← Real.rpow_natCast, Real.rpow_def_of_pos hCpos] congr 1 ring _ ≤ Real.exp ((K * Real.log L) * Real.log C) := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right hcard (Real.log_nonneg hC)) _ = L^(K * Real.log C) := by rw [Real.rpow_def_of_pos hL] congr 1 ring end section open Filter Finset open scoped Topology /- Independent uniform residues for every modulus in one prime pool. -/ noncomputable def poolPathResidueExpectation {ι : Type*} (m : ι → ℕ) [∀ i, NeZero (m i)] (pool : Finset ι) (visits : Finset ℕ) (active : ι → Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) : ℝ := ∏ i ∈ pool, (∑ r, activeResidueWeight visits (active i) (h i) η r) / (m i : ℝ) /- The residue factor of a label with no active visit is just its product of inactive damping factors. -/ theorem active_residue_weight_empty {R : Type*} [DecidableEq R] (visits : Finset ℕ) (h : ℕ → R) (η : ℕ → ℝ) (r : R) : activeResidueWeight visits ∅ h η r = ∏ j ∈ visits, (1 - η j * (if r = h j then 1 else 0)) := by simp [activeResidueWeight] /- Splitting the prime pool into ever-active and never-active labels recovers exactly the two-family finite path weight. -/ theorem pool_path_weight_split {ι : Type*} [DecidableEq ι] (m : ι → ℕ) (pool A : Finset ι) (visits : Finset ℕ) (active : ι → Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) (hA : A ⊆ pool) (hempty : ∀ i ∈ pool \ A, active i = ∅) (n : ℤ) : (∏ i ∈ pool, activeResidueWeight visits (active i) (h i) η (n : ZMod (m i))) = (∏ i : A, activeResidueWeight visits (active i.val) (h i.val) η (n : ZMod (m i.val))) * inactivePathResidueWeight (fun i : ↥(pool \ A) => m i.val) univ visits (fun i => h i.val) η n := by change _ = (∏ i : A, activeResidueWeight visits (active i.val) (h i.val) η (n : ZMod (m i.val))) * ∏ i : ↥(pool \ A), ∏ j ∈ visits, (1 - η j * (if (n : ZMod (m i.val)) = h i.val j then 1 else 0)) rw [prod_coe_sort A (fun i => activeResidueWeight visits (active i) (h i) η (n : ZMod (m i))), prod_coe_sort (pool \ A) (fun i => ∏ j ∈ visits, (1 - η j * (if (n : ZMod (m i)) = h i j then 1 else 0)))] rw [← prod_sdiff (f := fun i => activeResidueWeight visits (active i) (h i) η (n : ZMod (m i))) hA, mul_comm] congr 1 apply prod_congr rfl intro i hi rw [hempty i hi, active_residue_weight_empty] /- The two-family expectation is the full product of uniform local averages over the original prime pool, with no normalization lost. -/ theorem pool_path_expectation_split {ι : Type*} [DecidableEq ι] (m : ι → ℕ) [∀ i, NeZero (m i)] (pool A : Finset ι) (visits : Finset ℕ) (active : ι → Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) (hA : A ⊆ pool) (hempty : ∀ i ∈ pool \ A, active i = ∅) : poolPathResidueExpectation m pool visits active h η = pathResidueExpectation (fun i : A => m i.val) (fun i : ↥(pool \ A) => m i.val) univ univ visits (fun i => active i.val) (fun i => h i.val) (fun i => h i.val) η := by unfold poolPathResidueExpectation pathResidueExpectation rw [prod_coe_sort A (fun i => (∑ r, activeResidueWeight visits (active i) (h i) η r) / (m i : ℝ)), prod_coe_sort (pool \ A) (fun i => (∑ r, ∏ j ∈ visits, (1 - η j * (if r = h i j then 1 else 0))) / (m i : ℝ))] rw [← prod_sdiff (f := fun i => (∑ r, activeResidueWeight visits (active i) (h i) η r) / (m i : ℝ)) hA, mul_comm] congr 1 apply prod_congr rfl intro i hi simp only [hempty i hi, active_residue_weight_empty] /- The full pool has the same uniform relative replacement estimate as the active/inactive model. Only the prime-pool bounds and the number of ever-active labels occur in the hypotheses. -/ theorem eventually_single_pool_path_replacement {a c d A γ : ℝ} (ha0 : 0 ≤ a) (hc : 0 < c) (hd : 0 < d) (had : a + d < 1) (hA : 0 < A) (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, ∀ (ι : Type) [DecidableEq ι] (m : ι → ℕ) [∀ i, NeZero (m i)] (pool : Finset ι) (visits : Finset ℕ) (active : ι → Finset ℕ) (h : ∀ i, ℕ → ZMod (m i)) (η : ℕ → ℝ) (N : ℕ) (z : ℤ) (B : ℝ), (pool : Set ι).Pairwise (fun i j => Nat.Coprime (m i) (m j)) → Set.InjOn m pool → (∀ j ∈ visits, 0 ≤ η j ∧ η j ≤ 1) → (∑ j ∈ visits, η j) ≤ A * L^a → (∑ i ∈ pool, 1 / (m i : ℝ)) ≤ A * Real.log L → (∀ i ∈ pool, Real.exp (L^c) ≤ (m i : ℝ)) → (∀ i ∈ pool, (m i : ℝ) ≤ Real.exp (L^d)) → ((pool.filter (fun i => (active i).Nonempty)).card : ℝ) ≤ A * (L^a * Real.log L) → 0 < N → γ * L ≤ Real.log (N : ℝ) → 0 ≤ B → B ≤ A * (L^a * Real.log L) → |((∑ n ∈ Ico z (z + N), ∏ i ∈ pool, activeResidueWeight visits (active i) (h i) η (n : ZMod (m i))) / (N : ℝ)) - poolPathResidueExpectation m pool visits active h η| ≤ Real.exp (-B) * poolPathResidueExpectation m pool visits active h η := by classical filter_upwards [eventually_path_replacement_of_prime_bounds ha0 hc hd had hA hγ] with L hlarge intro ι _ m _ pool visits active h η N z B hcop hinj hη ht hH hmin hmax hcount hN hNbound hB hBbound let S := pool.filter (fun i => (active i).Nonempty) let I := pool \ S have hS : S ⊆ pool := filter_subset _ _ have hI : I ⊆ pool := sdiff_subset have hempty : ∀ i ∈ I, active i = ∅ := by intro i hi have hip := (mem_sdiff.mp hi).1 have his := (mem_sdiff.mp hi).2 by_contra hn exact his (mem_filter.mpr ⟨hip, nonempty_iff_ne_empty.mpr hn⟩) have hnonempty : ∀ i : S, (active i.val).Nonempty := fun i => (mem_filter.mp i.property).2 let anchor : S → ℕ := fun i => Classical.choose (hnonempty i) have hanchor : ∀ i : S, anchor i ∈ active i.val := fun i => Classical.choose_spec (hnonempty i) have hcopa : ((univ : Finset S) : Set S).Pairwise (fun i j => Nat.Coprime (m i.val) (m j.val)) := by intro i hi j hj hij exact hcop (hS i.property) (hS j.property) (fun he => hij (Subtype.ext he)) have hcopb : Pairwise (fun i j : I => Nat.Coprime (m i.val) (m j.val)) := by intro i j hij exact hcop (hI i.property) (hI j.property) (fun he => hij (Subtype.ext he)) have hcross : ∀ i : S, ∀ j : I, Nat.Coprime (m i.val) (m j.val) := by intro i j apply hcop (hS i.property) (hI j.property) intro he exact (mem_sdiff.mp j.property).2 (he ▸ i.property) have hcardI : ((univ : Finset I).card : ℝ) ≤ Real.exp (L^d) := by simpa only [card_univ, Fintype.card_coe] using moduli_card_le_exp m I (L^d) (fun i hi j hj hij => hinj (hI hi) (hI hj) hij) (fun i hi => Nat.pos_of_ne_zero (NeZero.ne (m i))) (fun i hi => hmax i (hI hi)) have hHI : (∑ i : I, 1 / (m i.val : ℝ)) ≤ A * Real.log L := by rw [sum_coe_sort I (fun i => 1 / (m i : ℝ))] exact (sum_le_sum_of_subset_of_nonneg hI (fun i hi hn => by positivity)).trans hH have hcardS : ((univ : Finset S).card : ℝ) ≤ A * (L^a * Real.log L) := by simpa only [card_univ, Fintype.card_coe] using hcount have he := hlarge S I (fun i => m i.val) (fun i => m i.val) univ univ visits (fun i => active i.val) (fun i => h i.val) (fun i => h i.val) η anchor N z B hcopa hcopb (fun i hi j => hcross i j) (fun i hi => hanchor i) hη ht hcardI hHI (fun i hi => hmin i.val (hI i.property)) hcardS (fun i hi => hmax i.val (hS i.property)) hN hNbound hB hBbound have hweight := pool_path_weight_split m pool S visits active h η hS hempty have hexpect := pool_path_expectation_split m pool S visits active h η hS hempty rw [hexpect] simp_rw [hweight] exact he end section open Finset /- The ever-active labels are exactly the union of the visit mark sets. -/ theorem active_visit_pool_eq_biUnion {ι : Type*} [DecidableEq ι] (pool : Finset ι) (visits : Finset ℕ) (marked : ℕ → Finset ι) (hmarked : ∀ j ∈ visits, marked j ⊆ pool) : pool.filter (fun i => (visits.filter (fun j => i ∈ marked j)).Nonempty) = visits.biUnion marked := by ext i simp only [mem_filter, nonempty_iff_ne_empty, mem_biUnion] constructor · rintro ⟨hi, hn⟩ obtain ⟨j, hj⟩ := nonempty_iff_ne_empty.mpr hn exact ⟨j, (mem_filter.mp hj).1, (mem_filter.mp hj).2⟩ · rintro ⟨j, hj, hi⟩ exact ⟨hmarked j hj hi, nonempty_iff_ne_empty.mp ⟨j, mem_filter.mpr ⟨hj, hi⟩⟩⟩ /- The distinct labels appearing anywhere in a path are bounded by its number of visits times the per-visit mark bound. -/ theorem marked_path_pool_card_bound {ι : Type*} [DecidableEq ι] (pool : Finset ι) (visits : Finset ℕ) (marked : ℕ → Finset ι) (K : ℕ) (hmarked : ∀ j ∈ visits, marked j ⊆ pool) (hK : ∀ j ∈ visits, (marked j).card ≤ K) : (pool.filter (fun i => (visits.filter (fun j => i ∈ marked j)).Nonempty)).card ≤ visits.card * K := by rw [active_visit_pool_eq_biUnion pool visits marked hmarked] calc _ ≤ ∑ j ∈ visits, (marked j).card := card_biUnion_le _ ≤ ∑ _j ∈ visits, K := sum_le_sum hK _ = _ := by simp /- Ceiling the real moment length and including both endpoints changes its bound by only an absolute factor. -/ theorem ceiling_path_length_bounds {L a : ℝ} (hL : 1 ≤ L) (ha : 0 ≤ a) : let n := 2 * Nat.ceil (L^a) (n : ℝ) ≤ 4 * L^a ∧ (n + 1 : ℕ) ≤ 5 * L^a := by have hp : 1 ≤ L^a := Real.one_le_rpow hL ha have hc := (Nat.ceil_lt_add_one (show 0 ≤ L^a by linarith)).le dsimp only push_cast constructor <;> nlinarith /- Unit-interval damping defects have total mass bounded by the number of visits. -/ theorem visit_weight_sum_le_card (visits : Finset ℕ) (η : ℕ → ℝ) (hη : ∀ j ∈ visits, η j ≤ 1) : (∑ j ∈ visits, η j) ≤ visits.card := by calc _ ≤ ∑ _j ∈ visits, (1 : ℝ) := sum_le_sum hη _ = _ := by simp end section open Filter Finset open scoped Topology /- A logarithmic number of groups and the ceiling moment length give the uniform replacement estimate for the physical divisibility factor. -/ theorem eventually_grouped_path_replacement {a c d C V E γ : ℝ} (ha : 0 ≤ a) (hc : 0 < c) (hd : 0 < d) (had : a + d < 1) (hC : 0 < C) (hV : 0 < V) (hE : 0 ≤ E) (hγ : 0 < γ) (M : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (ι : Type) [DecidableEq ι] (m : ι → ℕ) [∀ i, NeZero (m i)] (pool : Finset ι) (s : ℕ) (marked : ℕ → Finset ι) (offset : ℕ → ℤ) (q : ℕ → ℝ) (N : ℕ) (z : ℤ), let n := 2 * Nat.ceil (L^a) let visits := range (n + 1) (pool : Set ι).Pairwise (fun i j => Nat.Coprime (m i) (m j)) → Set.InjOn m pool → (s : ℝ) ≤ C * Real.log L → (∑ i ∈ pool, 1 / (m i : ℝ)) ≤ s * V → (∀ i ∈ pool, Real.exp (L^c) ≤ (m i : ℝ)) → (∀ i ∈ pool, (m i : ℝ) ≤ Real.exp (L^d)) → (∀ j ∈ visits, marked j ⊆ pool) → (∀ j ∈ visits, (marked j).card ≤ M * s) → (∀ j ∈ visits, 0 ≤ q j ∧ q j ≤ 1) → 0 < N → γ * L ≤ Real.log (N : ℝ) → |((∑ k ∈ Ico z (z + N), ∏ j ∈ visits, (∏ i ∈ marked j, (if (m i : ℤ) ∣ k + offset j then (1 : ℝ) else 0)) * (q j)^((pool \ marked j).filter (fun i => (m i : ℤ) ∣ k + offset j)).card) / (N : ℝ)) - poolPathResidueExpectation m pool visits (fun i => visits.filter (fun j => i ∈ marked j)) (fun i j => -(offset j : ZMod (m i))) (fun j => 1 - q j)| ≤ Real.exp (-E * n * Real.log L) * poolPathResidueExpectation m pool visits (fun i => visits.filter (fun j => i ∈ marked j)) (fun i j => -(offset j : ZMod (m i))) (fun j => 1 - q j) := by let A : ℝ := 6 + 5 * M * C + C * V + 4 * E have hA : 0 < A := by dsimp [A]; nlinarith [mul_nonneg (Nat.cast_nonneg M) hC.le, mul_nonneg hC.le hV.le] have h5A : 5 ≤ A := by dsimp [A]; nlinarith [mul_nonneg (Nat.cast_nonneg M) hC.le, mul_nonneg hC.le hV.le] have hMCA : 5 * M * C ≤ A := by dsimp [A]; nlinarith [mul_nonneg (Nat.cast_nonneg M) hC.le, mul_nonneg hC.le hV.le] have hCVA : C * V ≤ A := by dsimp [A]; nlinarith [mul_nonneg (Nat.cast_nonneg M) hC.le, mul_nonneg hC.le hV.le] have hEA : 4 * E ≤ A := by dsimp [A]; nlinarith [mul_nonneg (Nat.cast_nonneg M) hC.le, mul_nonneg hC.le hV.le] filter_upwards [eventually_single_pool_path_replacement ha hc hd had hA hγ, eventually_ge_atTop (1 : ℝ)] with L hlarge hL intro ι _ m _ pool s marked offset q N z dsimp only let n := 2 * Nat.ceil (L^a) let visits := range (n + 1) intro hcop hinj hs hH hmin hmax hmarked hmarks hq hN hNbound have hlog : 0 ≤ Real.log L := Real.log_nonneg hL have hpow : 0 ≤ L^a := Real.rpow_nonneg (zero_le_one.trans hL) a obtain ⟨hn, hn1⟩ := ceiling_path_length_bounds hL ha change (n : ℝ) ≤ 4 * L^a at hn change (n + 1 : ℕ) ≤ 5 * L^a at hn1 have hη : ∀ j ∈ visits, 0 ≤ 1 - q j ∧ 1 - q j ≤ 1 := by intro j hj have hh := hq j hj constructor <;> linarith have ht : (∑ j ∈ visits, (1 - q j)) ≤ A * L^a := by calc _ ≤ (visits.card : ℝ) := visit_weight_sum_le_card visits _ (fun j hj => (hη j hj).2) _ ≤ 5 * L^a := by simpa only [visits, card_range] using hn1 _ ≤ A * L^a := mul_le_mul_of_nonneg_right h5A hpow have hHbound : (∑ i ∈ pool, 1 / (m i : ℝ)) ≤ A * Real.log L := by calc _ ≤ (s : ℝ) * V := hH _ ≤ (C * Real.log L) * V := mul_le_mul_of_nonneg_right hs hV.le _ = (C * V) * Real.log L := by ring _ ≤ A * Real.log L := mul_le_mul_of_nonneg_right hCVA hlog have hactive : ((pool.filter (fun i => (visits.filter (fun j => i ∈ marked j)).Nonempty)).card : ℝ) ≤ A * (L^a * Real.log L) := by have hbound : ((pool.filter (fun i => (visits.filter (fun j => i ∈ marked j)).Nonempty)).card : ℝ) ≤ (visits.card : ℝ) * ((M : ℝ) * s) := by exact_mod_cast marked_path_pool_card_bound pool visits marked (M * s) hmarked hmarks calc _ ≤ (visits.card : ℝ) * ((M : ℝ) * s) := hbound _ ≤ (5 * L^a) * ((M : ℝ) * (C * Real.log L)) := by apply mul_le_mul · simpa only [visits, card_range] using hn1 · exact mul_le_mul_of_nonneg_left hs (Nat.cast_nonneg M) · positivity · positivity _ = (5 * M * C) * (L^a * Real.log L) := by ring _ ≤ A * (L^a * Real.log L) := mul_le_mul_of_nonneg_right hMCA (mul_nonneg hpow hlog) have hB : 0 ≤ E * n * Real.log L := by positivity have hBbound : E * n * Real.log L ≤ A * (L^a * Real.log L) := by calc _ ≤ E * (4 * L^a) * Real.log L := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hn hE) hlog _ = (4 * E) * (L^a * Real.log L) := by ring _ ≤ A * (L^a * Real.log L) := mul_le_mul_of_nonneg_right hEA (mul_nonneg hpow hlog) have he := hlarge ι m pool visits (fun i => visits.filter (fun j => i ∈ marked j)) (fun i j => -(offset j : ZMod (m i))) (fun j => 1 - q j) N z (E * n * Real.log L) hcop hinj hη ht hHbound hmin hmax hactive hN hNbound hB hBbound have hfactor := fun k => physical_path_divisibility_factorization m pool visits marked offset q k hmarked dsimp only [visits, n] at he hfactor simp_rw [hfactor] simpa only [neg_mul] using he end section open Finset /- Completing a shared embedding is equivalent to embedding the unshared slots into the labels not used by the shared slots. -/ def sharedCompletionEquiv {S U P : Type*} (shared : S ↪ P) : {f : S ⊕ U ↪ P // ∀ s, f (Sum.inl s) = shared s} ≃ (U ↪ {p : P // p ∉ Set.range shared}) where toFun f := { toFun := fun u => ⟨f.val (Sum.inr u), by rintro ⟨s, hs⟩ have he : f.val (Sum.inl s) = f.val (Sum.inr u) := (f.property s).trans hs have hx := f.val.injective he cases hx⟩ inj' := by intro u v huv have he := f.val.injective (congrArg Subtype.val huv) exact Sum.inr.inj he } invFun g := ⟨{ toFun := Sum.elim shared (fun u => (g u).val) inj' := by intro x y hxy cases x with | inl s => cases y with | inl t => exact congrArg Sum.inl (shared.injective hxy) | inr u => exact False.elim ((g u).property ⟨s, hxy⟩) | inr u => cases y with | inl s => exact False.elim ((g u).property ⟨s, hxy.symm⟩) | inr v => exact congrArg Sum.inr (g.injective (Subtype.ext hxy)) }, fun s => rfl⟩ left_inv f := by apply Subtype.ext apply Function.Embedding.ext intro x cases x with | inl s => exact (f.property s).symm | inr u => rfl right_inv g := by apply Function.Embedding.ext intro u rfl /- The number of ordered injective completions is the descending factorial of the number of labels left after fixing the shared slots. -/ theorem shared_completion_card {S U P : Type*} [Fintype S] [Fintype U] [Fintype P] (shared : S ↪ P) : Nat.card {f : S ⊕ U ↪ P // ∀ s, f (Sum.inl s) = shared s} = (Fintype.card P - Fintype.card S).descFactorial (Fintype.card U) := by classical rw [Nat.card_congr (sharedCompletionEquiv shared), Nat.card_eq_fintype_card, Fintype.card_embedding_eq] have he : Fintype.card {p : P // p ∉ Set.range shared} = Fintype.card P - Fintype.card S := by let e : {p : P // p ∉ Set.range shared} ≃ ↥((Set.range shared)ᶜ) := { toFun := fun p => ⟨p.val, p.property⟩ invFun := fun p => ⟨p.val, p.property⟩ left_inv := fun p => rfl right_inv := fun p => rfl } rw [Fintype.card_congr e] simpa only [Fintype.card_range] using Fintype.card_compl_set (Set.range shared) rw [he] end section open Finset /- The completion bound also holds for arbitrary finite shared and unshared slot types, so no particular ordering of the shared slots is needed. -/ theorem exists_completion_mass_bound_types {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (T : ℕ) : ∃ C : ℝ, 1 ≤ C ∧ ∀ (S U P : Type) [Fintype S] [Fintype U] [Fintype P] (shared : S ↪ P) (V : ℝ), v ≤ V → Fintype.card U ≤ T → ((Nat.card {f : S ⊕ U ↪ P // ∀ s, f (Sum.inl s) = shared s} : ℝ) * q^(((Fintype.card P - (Fintype.card S + Fintype.card U) : ℕ) : ℝ) / 2)) / V^(Fintype.card U) ≤ C := by obtain ⟨C, hC, hbound⟩ := exists_physical_damping_bound hq0 hq1 hv T refine ⟨C, hC, ?_⟩ intro S U P _ _ _ shared V hV hT rw [shared_completion_card] have hS := Fintype.card_le_of_embedding shared by_cases hM : Fintype.card S + Fintype.card U ≤ Fintype.card P · have he : Fintype.card P - Fintype.card S = Fintype.card P - (Fintype.card S + Fintype.card U) + Fintype.card U := by omega rw [he] exact hbound V hV _ _ hT · have hz : (Fintype.card P - Fintype.card S).descFactorial (Fintype.card U) = 0 := Nat.descFactorial_eq_zero_iff_lt.mpr (by omega) rw [hz] simp only [Nat.cast_zero, zero_mul, zero_div] exact zero_le_one.trans hC /- Independent auxiliary choices with total mass at most one preserve a uniform nonnegative row bound. -/ theorem auxiliary_average_row_bound {ι : Type*} (choices : Finset ι) (μ row : ι → ℝ) {C : ℝ} (hC : 0 ≤ C) (hμ : ∀ i ∈ choices, 0 ≤ μ i) (hmass : (∑ i ∈ choices, μ i) ≤ 1) (hrow : ∀ i ∈ choices, row i ≤ C) : (∑ i ∈ choices, μ i * row i) ≤ C := by calc _ ≤ ∑ i ∈ choices, μ i * C := sum_le_sum (fun i hi => mul_le_mul_of_nonneg_left (hrow i hi) (hμ i hi)) _ = (∑ i ∈ choices, μ i) * C := by rw [sum_mul] _ ≤ 1 * C := mul_le_mul_of_nonneg_right hmass hC _ = C := one_mul C end section open Finset /- Averaging complex row coefficients over auxiliary choices of total mass at most one preserves a uniform absolute row estimate. -/ theorem auxiliary_complex_row_bound {A P : Type*} (choices : Finset A) (rows : Finset P) (μ : A → ℝ) (K : A → P → ℂ) {C : ℝ} (hC : 0 ≤ C) (hμ : ∀ a ∈ choices, 0 ≤ μ a) (hmass : (∑ a ∈ choices, μ a) ≤ 1) (hrow : ∀ a ∈ choices, (∑ p ∈ rows, ‖K a p‖) ≤ C) : (∑ p ∈ rows, ‖∑ a ∈ choices, (μ a : ℂ) * K a p‖) ≤ C := by calc _ ≤ ∑ p ∈ rows, ∑ a ∈ choices, μ a * ‖K a p‖ := by apply sum_le_sum intro p hp calc _ ≤ ∑ a ∈ choices, ‖(μ a : ℂ) * K a p‖ := norm_sum_le _ _ _ = _ := by apply sum_congr rfl intro a ha simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hμ a ha)] _ = ∑ a ∈ choices, μ a * ∑ p ∈ rows, ‖K a p‖ := by rw [sum_comm] simp only [mul_sum] _ ≤ C := auxiliary_average_row_bound choices μ _ hC hμ hmass hrow /- Summing patterns costs only the sum of their absolute coefficient bounds. No orthogonality between patterns is required. -/ theorem pattern_absolute_row_bound {A P : Type*} (patterns : Finset A) (rows : Finset P) (K : A → P → ℂ) (mass : A → ℝ) (C : ℝ) (hrow : ∀ a ∈ patterns, (∑ p ∈ rows, ‖K a p‖) ≤ mass a * C) : (∑ p ∈ rows, ‖∑ a ∈ patterns, K a p‖) ≤ (∑ a ∈ patterns, mass a) * C := by calc _ ≤ ∑ p ∈ rows, ∑ a ∈ patterns, ‖K a p‖ := sum_le_sum (fun p hp => norm_sum_le _ _) _ = ∑ a ∈ patterns, ∑ p ∈ rows, ‖K a p‖ := sum_comm _ ≤ ∑ a ∈ patterns, mass a * C := sum_le_sum hrow _ = _ := by rw [sum_mul] end section open Finset /- Iterated finite row action; the terminal weight can impose a return condition or any other restriction on the final state. -/ noncomputable def finitePathMass {ι : Type*} (states : Finset ι) (K : ℕ → ι → ι → ℝ) (terminal : ι → ℝ) : ℕ → ι → ℝ | 0, i => terminal i | n + 1, i => ∑ j ∈ states, K n i j * finitePathMass states K terminal n j /- A row bound multiplies once per step, even when the kernels vary and the endpoint is restricted. -/ theorem finite_path_mass_le_pow {ι : Type*} (states : Finset ι) (K : ℕ → ι → ι → ℝ) (terminal : ι → ℝ) {A : ℝ} (hA : 0 ≤ A) (hK : ∀ n i, i ∈ states → ∀ j ∈ states, 0 ≤ K n i j) (hrow : ∀ n i, i ∈ states → (∑ j ∈ states, K n i j) ≤ A) (ht : ∀ i ∈ states, terminal i ≤ 1) (n : ℕ) : ∀ i ∈ states, finitePathMass states K terminal n i ≤ A^n := by induction n with | zero => simpa only [finitePathMass, pow_zero] using ht | succ n ih => intro i hi calc _ ≤ ∑ j ∈ states, K n i j * A^n := sum_le_sum (fun j hj => mul_le_mul_of_nonneg_left (ih j hj) (hK n i hi j hj)) _ = (∑ j ∈ states, K n i j) * A^n := by rw [sum_mul] _ ≤ A * A^n := mul_le_mul_of_nonneg_right (hrow n i hi) (pow_nonneg hA n) _ = A^(n + 1) := by rw [pow_succ'] end section open Finset /- The first `J` slots and the final `ell` slots of a mark list. -/ abbrev PhysicalSlots (J ell : ℕ) := Fin J ⊕ Fin ell /- Each group carries an injective ordered list of its own prime labels. -/ abbrev PhysicalMarkLists {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) := ∀ g, PhysicalSlots J ell ↪ ↥(P g) /- The finite mark lists that divide a specified integer position. -/ abbrev PhysicalMarksAt {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) (n : ℤ) := {labels : PhysicalMarkLists P J ell // ∀ g s, (((labels g s).val : ℕ) : ℤ) ∣ n} /- A physical state consists of its integer position and admissible marks. -/ abbrev PhysicalState {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) := Σ n : ℤ, PhysicalMarksAt P J ell n /- The group primes available at an integer position, including zero. -/ def physicalDivisorPool {G : Type*} (P : G → Finset ℕ) (g : G) (n : ℤ) : Finset ℕ := (P g).filter (fun p => (p : ℤ) ∣ n) /- The number of available labels in one group. -/ def physicalOmega {G : Type*} (P : G → Finset ℕ) (g : G) (n : ℤ) : ℕ := (physicalDivisorPool P g n).card /- An admissible mark list embeds all its slots into the available pool. -/ def physicalMarksEmbedding {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) (n : ℤ) (labels : PhysicalMarksAt P J ell n) (g : G) : PhysicalSlots J ell ↪ ↥(physicalDivisorPool P g n) where toFun s := ⟨(labels.val g s).val, mem_filter.mpr ⟨(labels.val g s).property, labels.property g s⟩⟩ inj' := by intro s t hst have he : (labels.val g s).val = (labels.val g t).val := congrArg (fun p : ↥(physicalDivisorPool P g n) => p.val) hst exact (labels.val g).injective (Subtype.ext he) /- Only first-block slots outside `C` are shared by a pattern. -/ def physicalSharedSlots {J ell : ℕ} (C : Finset (Fin J)) : Finset (PhysicalSlots J ell) := (univ \ C).map Function.Embedding.inl /- The complementary slots are resampled at each endpoint. -/ def physicalUnsharedSlots {J ell : ℕ} (C : Finset (Fin J)) : Finset (PhysicalSlots J ell) := (physicalSharedSlots (ell := ell) C)ᶜ theorem physical_shared_slots_card {J ell : ℕ} (C : Finset (Fin J)) : (physicalSharedSlots (ell := ell) C).card = J - C.card := by simp only [physicalSharedSlots, card_map, card_sdiff, inter_univ, card_univ, Fintype.card_fin] theorem physical_unshared_slots_card {J ell : ℕ} (C : Finset (Fin J)) : (physicalUnsharedSlots (ell := ell) C).card = ell + C.card := by have hc : C.card ≤ J := by simpa only [Fintype.card_fin] using card_le_univ C simp only [physicalUnsharedSlots, card_compl, Fintype.card_sum, Fintype.card_fin, physical_shared_slots_card] omega /- Groupwise endpoint damping. Natural subtraction equals the genuine excess count at every physical state by `physical_slots_le_omega`. -/ noncomputable def physicalDamping {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (q : ℝ) (n : ℤ) : ℝ := ∏ g, q^(((physicalOmega P g n - (J + ell) : ℕ) : ℝ) / 2) theorem physical_damping_unit {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (n : ℤ) : 0 ≤ physicalDamping P J ell q n ∧ physicalDamping P J ell q n ≤ 1 := by constructor · exact prod_nonneg (fun g hg => Real.rpow_nonneg hq0 _) · exact prod_le_one₀ (fun g hg => Real.rpow_nonneg hq0 _) (fun g hg => Real.rpow_le_one hq0 hq1 (by positivity)) /- Every marked state has the same counting-measure normalization. -/ noncomputable def physicalStateMass {G : Type*} [Fintype G] (V : G → ℝ) (J ell : ℕ) : ℝ := ∏ g, 1 / (V g)^(J + ell) theorem physical_state_mass_pos {G : Type*} [Fintype G] (V : G → ℝ) (hV : ∀ g, 0 < V g) (J ell : ℕ) : 0 < physicalStateMass V J ell := prod_pos (fun g hg => by exact div_pos zero_lt_one (pow_pos (hV g) _)) end section open Finset /- Free labels are sampled independently; no injectivity is imposed. -/ abbrev PhysicalAuxLabels {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) := ∀ g, ↥(C g) → ↥(P g) /- The source and target copy precisely the first-block slots outside C. -/ def physicalSharedCompatible {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (src tgt : PhysicalMarkLists P J ell) : Prop := ∀ g j, j ∉ C g → src g (Sum.inl j) = tgt g (Sum.inl j) /- A free label may not occur in any slot of the indicated endpoint. -/ def physicalAuxAvoids {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (labels : PhysicalMarkLists P J ell) : Prop := ∀ g (j : C g) s, aux g j ≠ labels g s /- For disjoint prime groups, banning a free label from its own endpoint group is equivalent to banning it from the entire endpoint list. -/ theorem physical_aux_avoids_global_iff {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (labels : PhysicalMarkLists P J ell) (hP : Pairwise (fun g h => Disjoint (P g) (P h))) : physicalAuxAvoids C aux labels ↔ ∀ g (j : C g) h s, (aux g j).val ≠ (labels h s).val := by constructor · intro ha g j h s he by_cases hgh : g = h · subst h exact ha g j s (Subtype.ext he) · have hp : (aux g j).val ∈ P h := by rw [he]; exact (labels h s).property exact (disjoint_left.mp (hP hgh)) (aux g j).property hp · intro ha g j s he exact ha g j g s (congrArg Subtype.val he) /- One group contributes one factor for every first-block slot: the copied shared label or an independent auxiliary label. -/ noncomputable def physicalGroupD {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (g : G) : ℕ := (∏ j ∈ univ \ C g, (labels g (Sum.inl j)).val) * ∏ j : C g, (aux g j).val noncomputable def physicalD {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) : ℕ := ∏ g, physicalGroupD C labels aux g theorem physical_shared_compatible_symm {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) {src tgt : PhysicalMarkLists P J ell} (h : physicalSharedCompatible C src tgt) : physicalSharedCompatible C tgt src := fun g j hj => (h g j hj).symm section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) include G sharedInstance1 P J ell C /- D is unchanged when compatible endpoint lists are reversed. -/ theorem physical_D_eq_of_shared {src tgt : PhysicalMarkLists P J ell} (h : physicalSharedCompatible C src tgt) (aux : PhysicalAuxLabels P C) : physicalD C src aux = physicalD C tgt aux := by unfold physicalD physicalGroupD apply prod_congr rfl intro g hg congr 1 apply prod_congr rfl intro j hj rw [h g j (mem_sdiff.mp hj).2] theorem physical_D_pos (labels : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (hP : ∀ g p, p ∈ P g → 0 < p) : 0 < physicalD C labels aux := by apply prod_pos intro g hg apply mul_pos · exact prod_pos (fun j hj => hP g _ (labels g (Sum.inl j)).property) · exact prod_pos (fun j hj => hP g _ (aux g j).property) /- Each shared label is one of the factors of D. -/ theorem physical_shared_label_dvd_D (labels : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (g : G) (j : Fin J) (hj : j ∉ C g) : (labels g (Sum.inl j)).val ∣ physicalD C labels aux := by have hmem : j ∈ univ \ C g := mem_sdiff.mpr ⟨mem_univ j, hj⟩ have hlocal : (labels g (Sum.inl j)).val ∣ physicalGroupD C labels aux g := dvd_mul_of_dvd_left (dvd_prod_of_mem (fun j => (labels g (Sum.inl j)).val) hmem) _ exact dvd_trans hlocal (dvd_prod_of_mem (fun g => physicalGroupD C labels aux g) (mem_univ g)) /- Shared divisibility is preserved by the dilation step n -> n+kD. -/ theorem physical_shared_divides_target (x : PhysicalState P J ell) (aux : PhysicalAuxLabels P C) (k : ℤ) (g : G) (j : Fin J) (hj : j ∉ C g) : (((x.2.val g (Sum.inl j)).val : ℕ) : ℤ) ∣ x.1 + k * (physicalD C x.2.val aux : ℕ) := by have hD : (((x.2.val g (Sum.inl j)).val : ℕ) : ℤ) ∣ (physicalD C x.2.val aux : ℕ) := by exact_mod_cast physical_shared_label_dvd_D C x.2.val aux g j hj exact dvd_add (x.2.property g (Sum.inl j)) (dvd_mul_of_dvd_right hD k) end /- Support conditions of an unsymmetrized physical edge. -/ def physicalAdmissible {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (x y : PhysicalState P J ell) : Prop := physicalSharedCompatible C x.2.val y.2.val ∧ physicalAuxAvoids C aux x.2.val ∧ physicalAuxAvoids C aux y.2.val ∧ y.1 = x.1 + k * (physicalD C x.2.val aux : ℕ) section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) include G sharedInstance1 P J ell C aux k /- Reversing an edge exchanges endpoint bans and negates the dilation step, while leaving the sampled free labels and D unchanged. -/ theorem physical_admissible_reverse {x y : PhysicalState P J ell} (h : physicalAdmissible C aux k x y) : physicalAdmissible C aux (-k) y x := by rcases h with ⟨hshared, hx, hy, hpos⟩ refine ⟨physical_shared_compatible_symm C hshared, hy, hx, ?_⟩ rw [← physical_D_eq_of_shared C hshared aux, hpos] ring theorem physical_admissible_reverse_iff (x y : PhysicalState P J ell) : physicalAdmissible C aux k x y ↔ physicalAdmissible C aux (-k) y x := by constructor · exact physical_admissible_reverse C aux k · intro h simpa only [neg_neg] using physical_admissible_reverse C aux (-k) h end end section open Finset /- The reciprocal-prime probability assigned to a group label. -/ noncomputable def physicalLabelLaw {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (g : G) (p : P g) : ℝ := 1 / (V g * (p.val : ℝ)) theorem physical_label_law_nonneg {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (hV : ∀ g, 0 ≤ V g) (g : G) (p : P g) : 0 ≤ physicalLabelLaw V g p := by unfold physicalLabelLaw exact div_nonneg zero_le_one (mul_nonneg (hV g) (Nat.cast_nonneg p.val)) /- The auxiliary law is normalized by the group's harmonic mass. -/ theorem physical_label_law_sum {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (g : G) (hV : 0 < V g) (hMass : ∑ p ∈ P g, 1 / (p : ℝ) = V g) : (∑ p : P g, physicalLabelLaw V g p) = 1 := by have he : ∀ p : P g, physicalLabelLaw V g p = (1 / (p.val : ℝ)) / V g := by intro p unfold physicalLabelLaw rw [div_div, mul_comm] simp_rw [he] rw [← sum_div, sum_coe_sort (P g) (fun p => 1 / (p : ℝ)), hMass, div_self (ne_of_gt hV)] /- Every free slot is sampled independently, including coincidences between two different free slots. -/ noncomputable def physicalAuxMass {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) : ℝ := ∏ g, ∏ j : C g, physicalLabelLaw V g (aux g j) theorem physical_aux_mass_nonneg {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 ≤ V g) (aux : PhysicalAuxLabels P C) : 0 ≤ physicalAuxMass V C aux := prod_nonneg (fun g _ => prod_nonneg (fun j _ => physical_label_law_nonneg V hV g (aux g j))) theorem physical_aux_mass_sum {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) : (∑ aux : PhysicalAuxLabels P C, physicalAuxMass V C aux) = 1 := by classical unfold physicalAuxMass have hout : (∑ aux : PhysicalAuxLabels P C, ∏ g, ∏ j : C g, physicalLabelLaw V g (aux g j)) = ∏ g, ∑ f : ↥(C g) → ↥(P g), ∏ j : C g, physicalLabelLaw V g (f j) := (Fintype.prod_sum (fun g (f : ↥(C g) → ↥(P g)) => ∏ j : C g, physicalLabelLaw V g (f j))).symm rw [hout] apply prod_eq_one intro g hg have hin : (∑ f : ↥(C g) → ↥(P g), ∏ j : C g, physicalLabelLaw V g (f j)) = ∏ _j : C g, ∑ p : P g, physicalLabelLaw V g p := (Fintype.prod_sum (fun (_j : C g) (p : P g) => physicalLabelLaw V g p)).symm rw [hin] apply prod_eq_one intro j hj exact physical_label_law_sum V g (hV g) (hMass g) /- Each target completion is weighted by one inverse harmonic mass for every unshared slot. -/ noncomputable def physicalCompletionMass {G : Type*} [Fintype G] {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (ell : ℕ) : ℝ := ∏ g, 1 / (V g)^(ell + (C g).card) theorem physical_completion_mass_pos {G : Type*} [Fintype G] {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (ell : ℕ) (hV : ∀ g, 0 < V g) : 0 < physicalCompletionMass V C ell := prod_pos (fun g _ => div_pos zero_lt_one (pow_pos (hV g) _)) end section open Finset /- The unit-modulus phase D^(i zeta), written using the real logarithm. -/ noncomputable def physicalPhase (ζ : ℝ) (D : ℕ) : ℂ := Complex.exp ((ζ * Real.log (D : ℝ) : ℝ) * Complex.I) theorem physical_phase_norm (ζ : ℝ) (D : ℕ) : ‖physicalPhase ζ D‖ = 1 := by rw [physicalPhase, Complex.norm_exp] simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, zero_mul, sub_self, Real.exp_zero] theorem physical_phase_reverse (ζ : ℝ) (D : ℕ) : physicalPhase (-ζ) D = (starRingEnd ℂ) (physicalPhase ζ D) := by unfold physicalPhase rw [← Complex.exp_conj] congr 1 simp only [map_mul, Complex.conj_ofReal, Complex.conj_I, neg_mul, Complex.ofReal_neg] ring /- One sampled auxiliary choice contributes this row coefficient. The coefficient function may depend on both ordered lists and the free labels. -/ noncomputable def physicalEdgeCoeff {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (x y : PhysicalState P J ell) : ℂ := by classical exact if physicalAdmissible C aux k x y then ((physicalAuxMass V C aux * physicalCompletionMass V C ell * physicalDamping P J ell q x.1 * physicalDamping P J ell q y.1 : ℝ) : ℂ) * K x.2.val y.2.val aux * physicalPhase ζ (physicalD C x.2.val aux) else 0 /- The adjoint edge uses the same auxiliary choice, reverses the two lists and the step, and conjugates the list coefficient and phase. -/ theorem physical_edge_reverse {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (x y : PhysicalState P J ell) : physicalEdgeCoeff V C q (-ζ) (-k) (fun a b f => (starRingEnd ℂ) (K b a f)) aux y x = (starRingEnd ℂ) (physicalEdgeCoeff V C q ζ k K aux x y) := by classical by_cases h : physicalAdmissible C aux k x y · have hr := physical_admissible_reverse C aux k h have hD := physical_D_eq_of_shared C h.1 aux have hscalar : physicalAuxMass V C aux * physicalCompletionMass V C ell * physicalDamping P J ell q y.1 * physicalDamping P J ell q x.1 = physicalAuxMass V C aux * physicalCompletionMass V C ell * physicalDamping P J ell q x.1 * physicalDamping P J ell q y.1 := by ring simp only [physicalEdgeCoeff, if_pos h, if_pos hr, hscalar, ← hD, physical_phase_reverse, map_mul, Complex.conj_ofReal] · have hr : ¬ physicalAdmissible C aux (-k) y x := by exact fun hr => h ((physical_admissible_reverse_iff C aux k x y).mpr hr) simp only [physicalEdgeCoeff, if_neg h, if_neg hr, map_zero] /- Summing all auxiliary choices gives the unsymmetrized pattern kernel. -/ noncomputable def physicalPatternKernel {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (x y : PhysicalState P J ell) : ℂ := ∑ aux : PhysicalAuxLabels P C, physicalEdgeCoeff V C q ζ k K aux x y theorem physical_pattern_reverse {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (x y : PhysicalState P J ell) : physicalPatternKernel V C q (-ζ) (-k) (fun a b f => (starRingEnd ℂ) (K b a f)) y x = (starRingEnd ℂ) (physicalPatternKernel V C q ζ k K x y) := by unfold physicalPatternKernel simp only [physical_edge_reverse, map_sum] end section open Finset /- Multiplicativity of the phase permits the small/big group split. -/ theorem physical_phase_mul (ζ : ℝ) {D E : ℕ} (hD : 0 < D) (hE : 0 < E) : physicalPhase ζ (D * E) = physicalPhase ζ D * physicalPhase ζ E := by unfold physicalPhase rw [Nat.cast_mul, Real.log_mul (by exact_mod_cast ne_of_gt hD) (by exact_mod_cast ne_of_gt hE), ← Complex.exp_add] congr 1 push_cast ring /- The mass of one permitted sampled edge before its bounded list coefficient and its unit-modulus phase are applied. -/ noncomputable def physicalEdgeMass {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q : ℝ) (k : ℤ) (aux : PhysicalAuxLabels P C) (x y : PhysicalState P J ell) : ℝ := by classical exact if physicalAdmissible C aux k x y then physicalAuxMass V C aux * physicalCompletionMass V C ell * physicalDamping P J ell q x.1 * physicalDamping P J ell q y.1 else 0 section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) include G sharedInstance1 P J ell V C theorem physical_edge_mass_nonneg {q : ℝ} (k : ℤ) (hV : ∀ g, 0 < V g) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (aux : PhysicalAuxLabels P C) (x y : PhysicalState P J ell) : 0 ≤ physicalEdgeMass V C q k aux x y := by classical unfold physicalEdgeMass split_ifs · exact mul_nonneg (mul_nonneg (mul_nonneg (physical_aux_mass_nonneg V C (fun g => (hV g).le) aux) (physical_completion_mass_pos V C ell hV).le) (physical_damping_unit P J ell hq0 hq1 x.1).1) (physical_damping_unit P J ell hq0 hq1 y.1).1 · exact le_rfl /- The sampled coefficient is its real mass times the list coefficient and dilation phase. -/ theorem physical_edge_coefficient_factor (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (x y : PhysicalState P J ell) : physicalEdgeCoeff V C q ζ k K aux x y = (physicalEdgeMass V C q k aux x y : ℂ) * K x.2.val y.2.val aux * physicalPhase ζ (physicalD C x.2.val aux) := by classical unfold physicalEdgeCoeff physicalEdgeMass split_ifs <;> simp only [Complex.ofReal_zero, zero_mul] /- The absolute coefficient retains the exact support and real edge mass; taking absolute values does not introduce a phase loss. -/ theorem physical_edge_norm {q : ℝ} (ζ : ℝ) (k : ℤ) (hV : ∀ g, 0 < V g) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (x y : PhysicalState P J ell) : ‖physicalEdgeCoeff V C q ζ k K aux x y‖ = physicalEdgeMass V C q k aux x y * ‖K x.2.val y.2.val aux‖ := by rw [physical_edge_coefficient_factor, norm_mul, norm_mul, physical_phase_norm, mul_one, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (physical_edge_mass_nonneg V C k hV hq0 hq1 aux x y)] /- A uniform list-coefficient bound multiplies the exact nonnegative edge mass, without dropping the transition support. -/ theorem physical_edge_norm_le {q : ℝ} (ζ : ℝ) (k : ℤ) (hV : ∀ g, 0 < V g) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (x y : PhysicalState P J ell) {B : ℝ} (hK : ‖K x.2.val y.2.val aux‖ ≤ B) : ‖physicalEdgeCoeff V C q ζ k K aux x y‖ ≤ physicalEdgeMass V C q k aux x y * B := by rw [physical_edge_norm V C ζ k hV hq0 hq1] exact mul_le_mul_of_nonneg_left hK (physical_edge_mass_nonneg V C k hV hq0 hq1 aux x y) end end section open Finset /- Mark lists satisfying divisibility are exactly lists taking their values in the corresponding available divisor pools. -/ def physicalMarksAtEquiv {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) (n : ℤ) : PhysicalMarksAt P J ell n ≃ (∀ g, PhysicalSlots J ell ↪ ↥(physicalDivisorPool P g n)) where toFun labels g := physicalMarksEmbedding P J ell n labels g invFun f := ⟨fun g => { toFun := fun s => ⟨(f g s).val, (mem_filter.mp (f g s).property).1⟩ inj' := by intro s t hst have he : (f g s).val = (f g t).val := congrArg (fun p : P g => p.val) hst exact (f g).injective (Subtype.ext he) }, fun g s => (mem_filter.mp (f g s).property).2⟩ left_inv labels := by apply Subtype.ext funext g apply Function.Embedding.ext intro s rfl right_inv f := by funext g apply Function.Embedding.ext intro s rfl /- The full physical fiber has the expected product of falling-factorial cardinalities; a group with too few divisors makes the fiber empty. -/ theorem physical_marks_fiber_card {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (n : ℤ) : Nat.card (PhysicalMarksAt P J ell n) = ∏ g, (physicalOmega P g n).descFactorial (J + ell) := by classical rw [Nat.card_congr (physicalMarksAtEquiv P J ell n), Nat.card_eq_fintype_card, Fintype.card_pi] apply prod_congr rfl intro g hg rw [Fintype.card_embedding_eq] simp only [Fintype.card_coe, Fintype.card_sum, Fintype.card_fin, physicalOmega] /- A finite position cutoff gives a finite type of physical states. -/ def physicalCutoffEquiv {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) (I : Finset ℤ) : {x : PhysicalState P J ell // x.1 ∈ I} ≃ (Σ n : I, PhysicalMarksAt P J ell n.val) where toFun x := ⟨⟨x.val.1, x.property⟩, x.val.2⟩ invFun y := ⟨⟨y.1.val, y.2⟩, y.1.property⟩ left_inv x := by cases x with | mk x hx => cases x; rfl right_inv y := by cases y with | mk n labels => cases n; rfl /- No global instance is added: the finite cutoff enumeration is an explicit object that can be installed locally when a finite matrix is used. -/ noncomputable abbrev physicalCutoffFintype {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (I : Finset ℤ) : Fintype {x : PhysicalState P J ell // x.1 ∈ I} := by classical exact Fintype.ofEquiv (Σ n : I, PhysicalMarksAt P J ell n.val) (physicalCutoffEquiv P J ell I).symm /- The cutoff cardinality is the sum of the exact fiber counts. -/ theorem physical_cutoff_card {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (I : Finset ℤ) : Nat.card {x : PhysicalState P J ell // x.1 ∈ I} = ∑ n ∈ I, ∏ g, (physicalOmega P g n).descFactorial (J + ell) := by classical rw [Nat.card_congr (physicalCutoffEquiv P J ell I), Nat.card_eq_fintype_card, Fintype.card_sigma] simp only [← Nat.card_eq_fintype_card, physical_marks_fiber_card] exact sum_coe_sort I (fun n => ∏ g, (physicalOmega P g n).descFactorial (J + ell)) end section open Finset /- Reorder a full list into its shared slots followed by the free first-block slots and the final ell slots. -/ def physicalSlotSplit {J ell : ℕ} (C : Finset (Fin J)) : ({j : Fin J // j ∉ C} ⊕ (↥C ⊕ Fin ell)) ≃ PhysicalSlots J ell where toFun | Sum.inl s => Sum.inl s.val | Sum.inr (Sum.inl s) => Sum.inl s.val | Sum.inr (Sum.inr s) => Sum.inr s invFun | Sum.inl j => if hj : j ∈ C then Sum.inr (Sum.inl ⟨j, hj⟩) else Sum.inl ⟨j, hj⟩ | Sum.inr j => Sum.inr (Sum.inr j) left_inv := by rintro (s | (s | s)) · simp only [s.property, ↓reduceDIte] · simp only [s.property, ↓reduceDIte] · rfl right_inv := by intro s cases s with | inl j => by_cases hj : j ∈ C <;> simp only [hj, ↓reduceDIte] | inr j => rfl /- Reordering the slots identifies actual full-list completions with the shared/unshared completion type used by the counting argument. -/ def physicalSlotCompletionEquiv {J ell : ℕ} {Q : Type*} (C : Finset (Fin J)) (shared : {j : Fin J // j ∉ C} ↪ Q) : {f : PhysicalSlots J ell ↪ Q // ∀ s : {j : Fin J // j ∉ C}, f (Sum.inl s.val) = shared s} ≃ {f : ({j : Fin J // j ∉ C} ⊕ (↥C ⊕ Fin ell)) ↪ Q // ∀ s, f (Sum.inl s) = shared s} where toFun f := ⟨(physicalSlotSplit C).toEmbedding.trans f.val, f.property⟩ invFun f := ⟨(physicalSlotSplit C).symm.toEmbedding.trans f.val, by intro s change f.val ((physicalSlotSplit C).symm ((physicalSlotSplit C) (Sum.inl s))) = shared s rw [Equiv.symm_apply_apply] exact f.property s⟩ left_inv f := by apply Subtype.ext apply Function.Embedding.ext intro s change f.val ((physicalSlotSplit C) ((physicalSlotSplit C).symm s)) = f.val s rw [Equiv.apply_symm_apply] right_inv f := by apply Subtype.ext apply Function.Embedding.ext intro s change f.val ((physicalSlotSplit C).symm ((physicalSlotSplit C) s)) = f.val s rw [Equiv.symm_apply_apply] /- The copied-slot type has cardinality J-|C|. -/ theorem physical_shared_slot_type_card {J : ℕ} (C : Finset (Fin J)) : Fintype.card {j : Fin J // j ∉ C} = J - C.card := by classical rw [Fintype.card_subtype_compl] simp only [Fintype.card_fin, Fintype.card_coe] /- The copied labels of an actual source state embed into the divisors available at the target position n+kD. -/ def physicalSharedTargetEmbedding {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (x : PhysicalState P J ell) (aux : PhysicalAuxLabels P C) (k : ℤ) (g : G) : {j : Fin J // j ∉ C g} ↪ ↥(physicalDivisorPool P g (x.1 + k * (physicalD C x.2.val aux : ℕ))) where toFun s := ⟨(x.2.val g (Sum.inl s.val)).val, mem_filter.mpr ⟨(x.2.val g (Sum.inl s.val)).property, physical_shared_divides_target C x aux k g s.val s.property⟩⟩ inj' := by intro s t hst have he : (x.2.val g (Sum.inl s.val)).val = (x.2.val g (Sum.inl t.val)).val := congrArg (fun p : ↥(physicalDivisorPool P g (x.1 + k * (physicalD C x.2.val aux : ℕ))) => p.val) hst have hs := (x.2.val g).injective (Subtype.ext he) exact Subtype.ext (Sum.inl.inj hs) /- The damped completion bound now applies in the original physical slot order, uniformly in J and in the target divisor pool. -/ theorem exists_physical_target_mass_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell m : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (J : ℕ) (C : Finset (Fin J)), C.card ≤ m → ∀ (Q : Type) [Fintype Q] (shared : {j : Fin J // j ∉ C} ↪ Q) (V : ℝ), v ≤ V → ((Nat.card {f : PhysicalSlots J ell ↪ Q // ∀ s : {j : Fin J // j ∉ C}, f (Sum.inl s.val) = shared s} : ℝ) * q^(((Fintype.card Q - (J + ell) : ℕ) : ℝ) / 2)) / V^(ell + C.card) ≤ A := by obtain ⟨A, hA, hbound⟩ := exists_completion_mass_bound_types hq0 hq1 hv (ell + m) refine ⟨A, hA, ?_⟩ intro J C hC Q _ shared V hV have hcard : C.card ≤ J := by simpa only [Fintype.card_fin] using card_le_univ C have hM : Fintype.card {j : Fin J // j ∉ C} + Fintype.card (↥C ⊕ Fin ell) = J + ell := by rw [physical_shared_slot_type_card, Fintype.card_sum, Fintype.card_coe, Fintype.card_fin] omega have hU : Fintype.card (↥C ⊕ Fin ell) = ell + C.card := by simp only [Fintype.card_sum, Fintype.card_coe, Fintype.card_fin, Nat.add_comm] have hc := Nat.card_congr (physicalSlotCompletionEquiv (ell := ell) C shared) have he := hbound {j : Fin J // j ∉ C} (↥C ⊕ Fin ell) Q shared V hV (by rw [hU]; exact Nat.add_le_add_left hC ell) rw [hM, hU, ← hc] at he exact he end section open Finset noncomputable def physicalNextPosition {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (x : PhysicalState P J ell) (aux : PhysicalAuxLabels P C) (k : ℤ) : ℤ := x.1 + k * (physicalD C x.2.val aux : ℕ) abbrev PhysicalCompatibleTargets {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (x : PhysicalState P J ell) (aux : PhysicalAuxLabels P C) (k : ℤ) := {y : PhysicalMarksAt P J ell (physicalNextPosition C x aux k) // physicalSharedCompatible C x.2.val y.val} abbrev PhysicalLocalTargets {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (x : PhysicalState P J ell) (aux : PhysicalAuxLabels P C) (k : ℤ) (g : G) := {f : PhysicalSlots J ell ↪ ↥(physicalDivisorPool P g (physicalNextPosition C x aux k)) // ∀ s : {j : Fin J // j ∉ C g}, f (Sum.inl s.val) = physicalSharedTargetEmbedding C x aux k g s} /- A compatible target state is exactly one independent ordered completion in each group, in the original physical slot order. -/ noncomputable def physicalCompatibleTargetsEquiv {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (x : PhysicalState P J ell) (aux : PhysicalAuxLabels P C) (k : ℤ) : PhysicalCompatibleTargets C x aux k ≃ (∀ g, PhysicalLocalTargets C x aux k g) where toFun y g := ⟨physicalMarksEmbedding P J ell (physicalNextPosition C x aux k) y.val g, by intro s apply Subtype.ext exact (congrArg Subtype.val (y.property g s.val s.property)).symm⟩ invFun f := ⟨(physicalMarksAtEquiv P J ell (physicalNextPosition C x aux k)).symm (fun g => (f g).val), by intro g j hj apply Subtype.ext exact (congrArg (fun p : ↥(physicalDivisorPool P g (physicalNextPosition C x aux k)) => p.val) ((f g).property ⟨j, hj⟩)).symm⟩ left_inv y := by apply Subtype.ext apply Subtype.ext funext g apply Function.Embedding.ext intro s rfl right_inv f := by funext g apply Subtype.ext apply Function.Embedding.ext intro s rfl theorem physical_compatible_targets_card {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (x : PhysicalState P J ell) (aux : PhysicalAuxLabels P C) (k : ℤ) : Nat.card (PhysicalCompatibleTargets C x aux k) = ∏ g, Nat.card (PhysicalLocalTargets C x aux k g) := by classical rw [Nat.card_congr (physicalCompatibleTargetsEquiv C x aux k), Nat.card_eq_fintype_card, Fintype.card_pi] simp only [Nat.card_eq_fintype_card] /- The complete compatible-target row mass, with target damping and completion normalization, is bounded by one fixed constant per group. The constant depends on ell+m, q, and the lower harmonic mass, but not J. -/ theorem exists_physical_compatible_target_mass_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell m : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] (P : G → Finset ℕ) (J : ℕ) (V : G → ℝ) (C : G → Finset (Fin J)), (∀ g, v ≤ V g) → (∀ g, (C g).card ≤ m) → ∀ (x : PhysicalState P J ell) (aux : PhysicalAuxLabels P C) (k : ℤ), (Nat.card (PhysicalCompatibleTargets C x aux k) : ℝ) * physicalCompletionMass V C ell * physicalDamping P J ell q (physicalNextPosition C x aux k) ≤ A^(Fintype.card G) := by obtain ⟨A, hA, hbound⟩ := exists_physical_target_mass_bound hq0 hq1 hv ell m refine ⟨A, hA, ?_⟩ intro G _ P J V C hV hC x aux k classical have hVp : ∀ g, 0 < V g := fun g => hv.trans_le (hV g) rw [physical_compatible_targets_card, Nat.cast_prod] unfold physicalCompletionMass physicalDamping rw [← prod_mul_distrib, ← prod_mul_distrib] have hpoint : ∀ g, (Nat.card (PhysicalLocalTargets C x aux k g) : ℝ) * (1 / (V g)^(ell + (C g).card)) * q^(((physicalOmega P g (physicalNextPosition C x aux k) - (J + ell) : ℕ) : ℝ) / 2) ≤ A := by intro g have hh := hbound J (C g) (hC g) ↥(physicalDivisorPool P g (physicalNextPosition C x aux k)) (physicalSharedTargetEmbedding C x aux k g) (V g) (hV g) have hcard : Nat.card ↥(physicalDivisorPool P g (physicalNextPosition C x aux k)) = physicalOmega P g (physicalNextPosition C x aux k) := by rw [Nat.card_eq_fintype_card, Fintype.card_coe] rfl rw [← Nat.card_eq_fintype_card, hcard] at hh have hlocal : ((Nat.card (PhysicalLocalTargets C x aux k g) : ℝ) * q^(((physicalOmega P g (physicalNextPosition C x aux k) - (J + ell) : ℕ) : ℝ) / 2)) / (V g)^(ell + (C g).card) ≤ A := by convert hh using 1 calc _ = ((Nat.card (PhysicalLocalTargets C x aux k g) : ℝ) * q^(((physicalOmega P g (physicalNextPosition C x aux k) - (J + ell) : ℕ) : ℝ) / 2)) / (V g)^(ell + (C g).card) := by ring _ ≤ A := hlocal calc _ ≤ ∏ _g : G, A := by apply prod_le_prod₀ · intro g hg exact mul_nonneg (mul_nonneg (Nat.cast_nonneg _) (div_nonneg zero_le_one (pow_nonneg (hVp g).le _))) (Real.rpow_nonneg hq0 _) · intro g hg exact hpoint g _ = _ := by simp end section open Finset Classical theorem physical_state_ext {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} {x y : PhysicalState P J ell} (hpos : x.1 = y.1) (hmarks : x.2.val = y.2.val) : x = y := by rcases x with ⟨n, a, ha⟩ rcases y with ⟨r, b, hb⟩ dsimp only at hpos hmarks cases hpos cases hmarks rfl /- Forgetting the endpoint exclusion bans embeds admissible targets into the finite collection of compatible completions. -/ def physicalAdmissibleTargetEmbedding {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (x : PhysicalState P J ell) (aux : PhysicalAuxLabels P C) (k : ℤ) : {y : PhysicalState P J ell // physicalAdmissible C aux k x y} ↪ PhysicalCompatibleTargets C x aux k where toFun y := ⟨⟨y.val.2.val, by intro g s rw [physicalNextPosition, ← y.property.2.2.2] exact y.val.2.property g s⟩, y.property.1⟩ inj' := by intro y z h apply Subtype.ext apply physical_state_ext · exact y.property.2.2.2.trans z.property.2.2.2.symm · exact congrArg (fun t : PhysicalCompatibleTargets C x aux k => t.val.val) h /- A finite cutoff or additional restriction can only reduce the number of admissible targets. -/ theorem physical_admissible_targets_card_le {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (x : PhysicalState P J ell) (aux : PhysicalAuxLabels P C) (k : ℤ) (rows : Finset (PhysicalState P J ell)) : (rows.filter (fun y => physicalAdmissible C aux k x y)).card ≤ Nat.card (PhysicalCompatibleTargets C x aux k) := by classical let f : ↥(rows.filter (fun y => physicalAdmissible C aux k x y)) → PhysicalCompatibleTargets C x aux k := fun y => physicalAdmissibleTargetEmbedding C x aux k ⟨y.val, (mem_filter.mp y.property).2⟩ have hf : Function.Injective f := by intro y z h have he := (physicalAdmissibleTargetEmbedding C x aux k).injective h exact Subtype.ext (congrArg (fun t : {y : PhysicalState P J ell // physicalAdmissible C aux k x y} => t.val) he) simpa only [Fintype.card_coe, Nat.card_eq_fintype_card] using Fintype.card_le_of_injective f hf section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) include G sharedInstance1 P J ell V C /- Every supported edge has the same target position and therefore the same endpoint damping. This gives an exact row-mass formula. -/ theorem physical_edge_mass_sum (q : ℝ) (k : ℤ) (aux : PhysicalAuxLabels P C) (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)) : (∑ y ∈ rows, physicalEdgeMass V C q k aux x y) = (rows.filter (fun y => physicalAdmissible C aux k x y)).card * (physicalAuxMass V C aux * physicalCompletionMass V C ell * physicalDamping P J ell q x.1 * physicalDamping P J ell q (physicalNextPosition C x aux k)) := by classical have he : (∑ y ∈ rows, physicalEdgeMass V C q k aux x y) = ∑ _y ∈ rows.filter (fun y => physicalAdmissible C aux k x y), physicalAuxMass V C aux * physicalCompletionMass V C ell * physicalDamping P J ell q x.1 * physicalDamping P J ell q (physicalNextPosition C x aux k) := by rw [sum_filter] apply sum_congr rfl intro y hy by_cases ha : physicalAdmissible C aux k x y · simp only [physicalEdgeMass, if_pos ha] rw [ha.2.2.2] rfl · simp only [physicalEdgeMass, if_neg ha] rw [he, sum_const, nsmul_eq_mul] /- The damped completion estimate bounds the mass of actual edges, including all exclusion bans and any finite cutoff. -/ theorem physical_edge_mass_row_le {q A : ℝ} (k : ℤ) (hV : ∀ g, 0 < V g) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (aux : PhysicalAuxLabels P C) (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)) (hA : (Nat.card (PhysicalCompatibleTargets C x aux k) : ℝ) * physicalCompletionMass V C ell * physicalDamping P J ell q (physicalNextPosition C x aux k) ≤ A) : (∑ y ∈ rows, physicalEdgeMass V C q k aux x y) ≤ physicalAuxMass V C aux * A := by classical have haux := physical_aux_mass_nonneg V C (fun g => (hV g).le) aux have hc := (physical_completion_mass_pos V C ell hV).le have hx := physical_damping_unit P J ell hq0 hq1 x.1 have ht := (physical_damping_unit P J ell hq0 hq1 (physicalNextPosition C x aux k)).1 have hcount : ((rows.filter (fun y => physicalAdmissible C aux k x y)).card : ℝ) ≤ (Nat.card (PhysicalCompatibleTargets C x aux k) : ℝ) := by exact_mod_cast physical_admissible_targets_card_le C x aux k rows rw [physical_edge_mass_sum] calc _ ≤ (Nat.card (PhysicalCompatibleTargets C x aux k) : ℝ) * (physicalAuxMass V C aux * physicalCompletionMass V C ell * physicalDamping P J ell q x.1 * physicalDamping P J ell q (physicalNextPosition C x aux k)) := mul_le_mul_of_nonneg_right hcount (mul_nonneg (mul_nonneg (mul_nonneg haux hc) hx.1) ht) _ = physicalAuxMass V C aux * ((Nat.card (PhysicalCompatibleTargets C x aux k) : ℝ) * physicalCompletionMass V C ell * physicalDamping P J ell q (physicalNextPosition C x aux k)) * physicalDamping P J ell q x.1 := by ring _ ≤ physicalAuxMass V C aux * ((Nat.card (PhysicalCompatibleTargets C x aux k) : ℝ) * physicalCompletionMass V C ell * physicalDamping P J ell q (physicalNextPosition C x aux k)) * 1 := mul_le_mul_of_nonneg_left hx.2 (mul_nonneg haux (mul_nonneg (mul_nonneg (Nat.cast_nonneg _) hc) ht)) _ ≤ physicalAuxMass V C aux * A := by rw [mul_one] exact mul_le_mul_of_nonneg_left hA haux /- The absolute row sum of a sampled physical coefficient is bounded by its auxiliary probability times the damped completion bound. -/ theorem physical_edge_norm_row_le {q A B : ℝ} (ζ : ℝ) (k : ℤ) (hV : ∀ g, 0 < V g) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)) (hB : 0 ≤ B) (hK : ∀ y ∈ rows, ‖K x.2.val y.2.val aux‖ ≤ B) (hA : (Nat.card (PhysicalCompatibleTargets C x aux k) : ℝ) * physicalCompletionMass V C ell * physicalDamping P J ell q (physicalNextPosition C x aux k) ≤ A) : (∑ y ∈ rows, ‖physicalEdgeCoeff V C q ζ k K aux x y‖) ≤ physicalAuxMass V C aux * A * B := by calc _ ≤ ∑ y ∈ rows, physicalEdgeMass V C q k aux x y * B := sum_le_sum (fun y hy => physical_edge_norm_le V C ζ k hV hq0 hq1 K aux x y (hK y hy)) _ = (∑ y ∈ rows, physicalEdgeMass V C q k aux x y) * B := by rw [sum_mul] _ ≤ _ := mul_le_mul_of_nonneg_right (physical_edge_mass_row_le V C k hV hq0 hq1 aux x rows hA) hB end end section open Finset /- Summing the sampled edge bounds costs exactly the total auxiliary probability, which is one. -/ theorem physical_pattern_norm_row_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) {q A B : ℝ} (ζ : ℝ) (k : ℤ) (hV : ∀ g, 0 < V g) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)) (hB : 0 ≤ B) (hK : ∀ aux y, y ∈ rows → ‖K x.2.val y.2.val aux‖ ≤ B) (hA : ∀ aux, (Nat.card (PhysicalCompatibleTargets C x aux k) : ℝ) * physicalCompletionMass V C ell * physicalDamping P J ell q (physicalNextPosition C x aux k) ≤ A) : (∑ y ∈ rows, ‖physicalPatternKernel V C q ζ k K x y‖) ≤ A * B := by classical calc _ ≤ ∑ y ∈ rows, ∑ aux : PhysicalAuxLabels P C, ‖physicalEdgeCoeff V C q ζ k K aux x y‖ := sum_le_sum (fun y _ => norm_sum_le _ _) _ = ∑ aux : PhysicalAuxLabels P C, ∑ y ∈ rows, ‖physicalEdgeCoeff V C q ζ k K aux x y‖ := sum_comm _ ≤ ∑ aux : PhysicalAuxLabels P C, physicalAuxMass V C aux * A * B := sum_le_sum (fun aux _ => physical_edge_norm_row_le V C ζ k hV hq0 hq1 K aux x rows hB (hK aux) (hA aux)) _ = (∑ aux : PhysicalAuxLabels P C, physicalAuxMass V C aux) * A * B := by rw [sum_mul, sum_mul] _ = A * B := by rw [physical_aux_mass_sum V C hV hMass, one_mul] /- The physical kernel has a bound of one fixed constant per prime group, independent of the number of copied mark slots and the cutoff. -/ theorem exists_physical_pattern_row_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell m : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J : ℕ) (V : G → ℝ) (C : G → Finset (Fin J)), (∀ g, v ≤ V g) → (∀ g, (C g).card ≤ m) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → ∀ (ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ), 0 ≤ B → (∀ a b aux, ‖K a b aux‖ ≤ B) → ∀ (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)), (∑ y ∈ rows, ‖physicalPatternKernel V C q ζ k K x y‖) ≤ A^(Fintype.card G) * B := by obtain ⟨A, hA, hbound⟩ := exists_physical_compatible_target_mass_bound hq0 hq1 hv ell m refine ⟨A, hA, ?_⟩ intro G _ _ P J V C hV hC hMass ζ k K B hB hK x rows exact physical_pattern_norm_row_le V C ζ k (fun g => hv.trans_le (hV g)) hq0 hq1.le hMass K x rows hB (fun aux y _ => hK x.2.val y.2.val aux) (fun aux => hbound G P J V C hV hC x aux k) /- Edge reversal preserves absolute values, so the reverse kernel provides exactly the column estimates for the original kernel. -/ theorem physical_pattern_norm_reverse {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (x y : PhysicalState P J ell) : ‖physicalPatternKernel V C q (-ζ) (-k) (fun a b f => (starRingEnd ℂ) (K b a f)) y x‖ = ‖physicalPatternKernel V C q ζ k K x y‖ := by rw [physical_pattern_reverse] exact RCLike.norm_conj _ end section open Finset end section open Finset abbrev PhysicalPermutations (G : Type*) (J ell : ℕ) := G → Equiv.Perm (PhysicalSlots J ell) /- Reorder each group's ordered marks by an independent slot permutation. -/ def physicalPermutationEquiv {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations G J ell) : PhysicalState P J ell ≃ PhysicalState P J ell where toFun x := ⟨x.1, ⟨fun g => (σ g).toEmbedding.trans (x.2.val g), fun g s => x.2.property g (σ g s)⟩⟩ invFun x := ⟨x.1, ⟨fun g => (σ g).symm.toEmbedding.trans (x.2.val g), fun g s => x.2.property g ((σ g).symm s)⟩⟩ left_inv x := by apply physical_state_ext · rfl · funext g apply Function.Embedding.ext intro s exact congrArg (x.2.val g) ((σ g).apply_symm_apply s) right_inv x := by apply physical_state_ext · rfl · funext g apply Function.Embedding.ext intro s exact congrArg (x.2.val g) ((σ g).symm_apply_apply s) theorem physical_permutation_position {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations G J ell) (x : PhysicalState P J ell) : (physicalPermutationEquiv σ x).1 = x.1 := rfl /- Uniformly average over all independent within-group slot permutations. -/ noncomputable def physicalSymmetrize {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (f : PhysicalState P J ell → ℂ) (x : PhysicalState P J ell) : ℂ := (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * ∑ σ : PhysicalPermutations G J ell, f (physicalPermutationEquiv σ x) end section open Finset theorem finite_uniform_average_row_bound {A X : Type*} [Fintype A] [Nonempty A] (rows : Finset X) (K : A → X → ℂ) {C : ℝ} (hC : 0 ≤ C) (hrow : ∀ a, (∑ y ∈ rows, ‖K a y‖) ≤ C) : (∑ y ∈ rows, ‖(Fintype.card A : ℂ)⁻¹ * ∑ a, K a y‖) ≤ C := by classical have hn : (Fintype.card A : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero have hmass : (∑ _a : A, (Fintype.card A : ℝ)⁻¹) ≤ 1 := by simp only [sum_const, card_univ, nsmul_eq_mul, mul_inv_cancel₀ hn, le_refl] have hh := auxiliary_complex_row_bound (univ : Finset A) rows (fun _ => (Fintype.card A : ℝ)⁻¹) K hC (fun _ _ => inv_nonneg.mpr (Nat.cast_nonneg _)) hmass (fun a _ => hrow a) simpa only [Complex.ofReal_inv, Complex.ofReal_natCast, ← mul_sum] using hh /- A row estimate over all finite sets remains true after any bijective reindexing of the source and target states. -/ theorem equiv_kernel_row_bound {X : Type*} (K : X → X → ℂ) {C : ℝ} (hrow : ∀ x rows, (∑ y ∈ rows, ‖K x y‖) ≤ C) (a b : X ≃ X) (x : X) (rows : Finset X) : (∑ y ∈ rows, ‖K (a x) (b y)‖) ≤ C := by have hh := hrow (a x) (rows.map b.toEmbedding) simpa only [sum_map, Equiv.coe_toEmbedding] using hh /- Averaging independently on both ends of a kernel preserves its absolute row bound, including for cutoffs not invariant under the maps. -/ theorem finite_permutation_kernel_row_bound {A B X : Type*} [Fintype A] [Nonempty A] [Fintype B] [Nonempty B] (a : A → X ≃ X) (b : B → X ≃ X) (K : X → X → ℂ) {C : ℝ} (hC : 0 ≤ C) (hrow : ∀ x rows, (∑ y ∈ rows, ‖K x y‖) ≤ C) (x : X) (rows : Finset X) : (∑ y ∈ rows, ‖(Fintype.card A : ℂ)⁻¹ * ∑ i, (Fintype.card B : ℂ)⁻¹ * ∑ j, K (a i x) (b j y)‖) ≤ C := by apply finite_uniform_average_row_bound rows _ hC intro i apply finite_uniform_average_row_bound rows _ hC intro j exact equiv_kernel_row_bound K hrow (a i) (b j) x rows end section open Finset noncomputable def physicalSymmetricKernel {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (K : PhysicalState P J ell → PhysicalState P J ell → ℂ) (x y : PhysicalState P J ell) : ℂ := physicalSymmetrize (fun a => physicalSymmetrize (K a) y) x section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (K : PhysicalState P J ell → PhysicalState P J ell → ℂ) include G sharedInstance1 sharedInstance2 P J ell K theorem physical_symmetric_kernel_double_sum (x y : PhysicalState P J ell) : physicalSymmetricKernel K x y = (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * ∑ σ : PhysicalPermutations G J ell, ∑ τ : PhysicalPermutations G J ell, K (physicalPermutationEquiv σ x) (physicalPermutationEquiv τ y) := by classical unfold physicalSymmetricKernel physicalSymmetrize rw [← mul_sum, mul_assoc] /- Symmetrizing the transpose is the transpose of the symmetrized kernel. -/ theorem physical_symmetric_kernel_transpose (x y : PhysicalState P J ell) : physicalSymmetricKernel (fun a b => K b a) x y = physicalSymmetricKernel K y x := by classical rw [physical_symmetric_kernel_double_sum, physical_symmetric_kernel_double_sum] congr 1 exact sum_comm /- Averaging permutations on both endpoints preserves every uniform absolute row bound on finite subsets of the physical state space. -/ theorem physical_symmetric_kernel_row_bound {A : ℝ} (hA : 0 ≤ A) (hrow : ∀ x rows, (∑ y ∈ rows, ‖K x y‖) ≤ A) (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)) : (∑ y ∈ rows, ‖physicalSymmetricKernel K x y‖) ≤ A := by exact finite_permutation_kernel_row_bound (fun σ : PhysicalPermutations G J ell => physicalPermutationEquiv σ) (fun τ : PhysicalPermutations G J ell => physicalPermutationEquiv τ) K hA hrow x rows /- The corresponding column bound follows by transposing before averaging. -/ theorem physical_symmetric_kernel_column_bound {A : ℝ} (hA : 0 ≤ A) (hcol : ∀ y rows, (∑ x ∈ rows, ‖K x y‖) ≤ A) (y : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)) : (∑ x ∈ rows, ‖physicalSymmetricKernel K x y‖) ≤ A := by have hh := physical_symmetric_kernel_row_bound (fun a b => K b a) hA hcol y rows simpa only [physical_symmetric_kernel_transpose] using hh end end section open Finset /- Absolute row and column bounds for the full symmetrized physical operator. The only pattern loss is the sum of the coefficient bounds. -/ theorem exists_physical_operator_bounds {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell m : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J : ℕ) (V : G → ℝ), (∀ g, v ≤ V g) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → ∀ (I : Type) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (B : I → ℝ), (∀ i ∈ patterns, ∀ g, (C i g).card ≤ m) → (∀ i ∈ patterns, 0 ≤ B i) → (∀ i ∈ patterns, ∀ a b aux, ‖K i a b aux‖ ≤ B i) → ∀ (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)), let W := fun a b => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) a b (∑ y ∈ rows, ‖physicalSymmetricKernel W x y‖) ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) ∧ (∑ y ∈ rows, ‖physicalSymmetricKernel W y x‖) ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) := by obtain ⟨A, hA, hbound⟩ := exists_physical_pattern_row_bound hq0 hq1 hv ell m refine ⟨A, hA, ?_⟩ intro G _ _ P J V hV hMass I patterns C ζ k K B hC hB hK x rows classical let W := fun a b => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) a b have hnonneg : 0 ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) := mul_nonneg (sum_nonneg hB) (pow_nonneg (zero_le_one.trans hA) _) have hrow : ∀ a s, (∑ b ∈ s, ‖W a b‖) ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) := by intro a s apply pattern_absolute_row_bound patterns s _ B (A^(Fintype.card G)) intro i hi have hh := hbound G P J V (C i) hV (hC i hi) hMass (ζ i) (k i) (K i) (B i) (hB i hi) (hK i hi) a s simpa only [mul_comm] using hh have hcol : ∀ b s, (∑ a ∈ s, ‖W a b‖) ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) := by intro b s apply pattern_absolute_row_bound patterns s _ B (A^(Fintype.card G)) intro i hi have hKi : ∀ a b aux, ‖(starRingEnd ℂ) (K i b a aux)‖ ≤ B i := by intro a b aux rw [RCLike.norm_conj] exact hK i hi b a aux have hh := hbound G P J V (C i) hV (hC i hi) hMass (-(ζ i)) (-(k i)) (fun a b aux => (starRingEnd ℂ) (K i b a aux)) (B i) (hB i hi) hKi b s simpa only [physical_pattern_norm_reverse, mul_comm] using hh exact ⟨physical_symmetric_kernel_row_bound W hnonneg hrow x rows, physical_symmetric_kernel_column_bound W hnonneg hcol x rows⟩ /- Any constant-measure kernel with uniform row and column bounds satisfies the finite weighted Schur estimate. -/ theorem constant_measure_schur {X : Type*} (rows : Finset X) (K : X → X → ℂ) {μ A : ℝ} (hμ : 0 ≤ μ) (hrow : ∀ x ∈ rows, (∑ y ∈ rows, ‖K x y‖) ≤ A) (hcol : ∀ y ∈ rows, (∑ x ∈ rows, ‖K x y‖) ≤ A) (f : X → ℂ) : (∑ x ∈ rows, μ * ‖∑ y ∈ rows, K x y * f y‖^2) ≤ A^2 * ∑ y ∈ rows, μ * ‖f y‖^2 := by have hr : ∀ x ∈ rows, (∑ y ∈ rows, ‖K x y‖ * (1 : ℝ)) ≤ A * 1 := by simpa only [mul_one] using hrow have hc : ∀ y ∈ rows, (∑ x ∈ rows, μ * ‖K x y‖ * (1 : ℝ)) ≤ A * μ * 1 := by intro y hy simp only [mul_one] rw [← mul_sum] exact (mul_le_mul_of_nonneg_left (hcol y hy) hμ).trans_eq (mul_comm _ _) simpa only [pow_two] using finite_weighted_schur_transition rows (fun _ => μ) (fun _ => (1 : ℝ)) K (fun _ _ => hμ) (fun _ _ => zero_lt_one) hr hc f end section open Finset /- Enumerate all physical states whose position belongs to a finite set. -/ noncomputable def physicalCutoff {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (I : Finset ℤ) : Finset (PhysicalState P J ell) := by classical letI := physicalCutoffFintype P J ell I exact (univ : Finset {x : PhysicalState P J ell // x.1 ∈ I}).map ⟨Subtype.val, Subtype.val_injective⟩ theorem mem_physical_cutoff {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (I : Finset ℤ) (x : PhysicalState P J ell) : x ∈ physicalCutoff P J ell I ↔ x.1 ∈ I := by classical unfold physicalCutoff simp only [mem_map, mem_univ, true_and, Function.Embedding.coeFn_mk] constructor · rintro ⟨y, rfl⟩ exact y.property · intro hx exact ⟨⟨x, hx⟩, rfl⟩ theorem physical_cutoff_permutation {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (I : Finset ℤ) (σ : PhysicalPermutations G J ell) (x : PhysicalState P J ell) : physicalPermutationEquiv σ x ∈ physicalCutoff P J ell I ↔ x ∈ physicalCutoff P J ell I := by rw [mem_physical_cutoff, mem_physical_cutoff, physical_permutation_position] /- A permutation of the marks preserves finite counting measure on any complete position cutoff. -/ theorem physical_permutation_sum {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (I : Finset ℤ) (σ : PhysicalPermutations G J ell) (f : PhysicalState P J ell → ℂ) : (∑ x ∈ physicalCutoff P J ell I, f (physicalPermutationEquiv σ x)) = ∑ x ∈ physicalCutoff P J ell I, f x := by apply sum_equiv (physicalPermutationEquiv σ) · intro x exact (physical_cutoff_permutation P J ell I σ x).symm · intro x _ rfl end section open Finset noncomputable def physicalAbsolutePattern {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (x y : PhysicalState P J ell) : ℝ := ∑ aux : PhysicalAuxLabels P C, ‖physicalEdgeCoeff V C q ζ k K aux x y‖ section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (x y : PhysicalState P J ell) include G sharedInstance1 sharedInstance2 P J ell V C q ζ k K x y theorem physical_absolute_pattern_nonneg : 0 ≤ physicalAbsolutePattern V C q ζ k K x y := sum_nonneg (fun _ _ => norm_nonneg _) theorem physical_pattern_norm_le_absolute : ‖physicalPatternKernel V C q ζ k K x y‖ ≤ physicalAbsolutePattern V C q ζ k K x y := norm_sum_le _ _ theorem physical_absolute_pattern_reverse : physicalAbsolutePattern V C q (-ζ) (-k) (fun a b f => (starRingEnd ℂ) (K b a f)) y x = physicalAbsolutePattern V C q ζ k K x y := by unfold physicalAbsolutePattern simp only [physical_edge_reverse, RCLike.norm_conj] end /- The expanded auxiliary sum obeys the same row bound as the summed complex kernel, without relying on cancellation between its terms. -/ theorem physical_absolute_pattern_row_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) {q A B : ℝ} (ζ : ℝ) (k : ℤ) (hV : ∀ g, 0 < V g) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)) (hB : 0 ≤ B) (hK : ∀ aux y, y ∈ rows → ‖K x.2.val y.2.val aux‖ ≤ B) (hA : ∀ aux, (Nat.card (PhysicalCompatibleTargets C x aux k) : ℝ) * physicalCompletionMass V C ell * physicalDamping P J ell q (physicalNextPosition C x aux k) ≤ A) : (∑ y ∈ rows, physicalAbsolutePattern V C q ζ k K x y) ≤ A * B := by classical unfold physicalAbsolutePattern rw [sum_comm] calc _ ≤ ∑ aux : PhysicalAuxLabels P C, physicalAuxMass V C aux * A * B := sum_le_sum (fun aux _ => physical_edge_norm_row_le V C ζ k hV hq0 hq1 K aux x rows hB (hK aux) (hA aux)) _ = (∑ aux : PhysicalAuxLabels P C, physicalAuxMass V C aux) * A * B := by rw [sum_mul, sum_mul] _ = A * B := by rw [physical_aux_mass_sum V C hV hMass, one_mul] theorem exists_physical_absolute_pattern_row_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell m : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J : ℕ) (V : G → ℝ) (C : G → Finset (Fin J)), (∀ g, v ≤ V g) → (∀ g, (C g).card ≤ m) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → ∀ (ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ), 0 ≤ B → (∀ a b aux, ‖K a b aux‖ ≤ B) → ∀ (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)), (∑ y ∈ rows, physicalAbsolutePattern V C q ζ k K x y) ≤ A^(Fintype.card G) * B := by obtain ⟨A, hA, hbound⟩ := exists_physical_compatible_target_mass_bound hq0 hq1 hv ell m refine ⟨A, hA, ?_⟩ intro G _ _ P J V C hV hC hMass ζ k K B hB hK x rows exact physical_absolute_pattern_row_le V C ζ k (fun g => hv.trans_le (hV g)) hq0 hq1.le hMass K x rows hB (fun aux y _ => hK x.2.val y.2.val aux) (fun aux => hbound G P J V C hV hC x aux k) end section open Finset noncomputable def physicalAverageMass {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (M : PhysicalState P J ell → PhysicalState P J ell → ℝ) (x y : PhysicalState P J ell) : ℝ := (Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹ * ∑ σ : PhysicalPermutations G J ell, (Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹ * ∑ τ : PhysicalPermutations G J ell, M (physicalPermutationEquiv σ x) (physicalPermutationEquiv τ y) theorem physical_average_mass_nonneg {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (M : PhysicalState P J ell → PhysicalState P J ell → ℝ) (hM : ∀ x y, 0 ≤ M x y) (x y : PhysicalState P J ell) : 0 ≤ physicalAverageMass M x y := by unfold physicalAverageMass exact mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg _)) (sum_nonneg (fun σ _ => mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg _)) (sum_nonneg (fun τ _ => hM _ _)))) theorem physical_average_mass_cast {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (M : PhysicalState P J ell → PhysicalState P J ell → ℝ) (x y : PhysicalState P J ell) : (physicalAverageMass M x y : ℂ) = physicalSymmetricKernel (fun a b => (M a b : ℂ)) x y := by simp only [physicalAverageMass, physicalSymmetricKernel, physicalSymmetrize, Complex.ofReal_mul, Complex.ofReal_sum, Complex.ofReal_inv, Complex.ofReal_natCast] /- Comparison for one finite uniform average, before adding its terms. -/ theorem finite_uniform_average_norm_le {A : Type*} [Fintype A] (K : A → ℂ) (M : A → ℝ) (hKM : ∀ a, ‖K a‖ ≤ M a) : ‖(Fintype.card A : ℂ)⁻¹ * ∑ a, K a‖ ≤ (Fintype.card A : ℝ)⁻¹ * ∑ a, M a := by rw [norm_mul, norm_inv, Complex.norm_natCast] exact mul_le_mul_of_nonneg_left ((norm_sum_le _ _).trans (sum_le_sum (fun a _ => hKM a))) (inv_nonneg.mpr (Nat.cast_nonneg _)) /- A pointwise majorant before symmetrization majorizes the complete symmetrized kernel after independent averaging of both endpoints. -/ theorem physical_symmetric_kernel_norm_le_mass {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (K : PhysicalState P J ell → PhysicalState P J ell → ℂ) (M : PhysicalState P J ell → PhysicalState P J ell → ℝ) (hKM : ∀ x y, ‖K x y‖ ≤ M x y) (x y : PhysicalState P J ell) : ‖physicalSymmetricKernel K x y‖ ≤ physicalAverageMass M x y := by apply finite_uniform_average_norm_le intro σ apply finite_uniform_average_norm_le intro τ exact hKM _ _ section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (M : PhysicalState P J ell → PhysicalState P J ell → ℝ) include G sharedInstance1 sharedInstance2 P J ell M theorem physical_average_mass_transpose (x y : PhysicalState P J ell) : physicalAverageMass (fun a b => M b a) x y = physicalAverageMass M y x := by apply Complex.ofReal_injective rw [physical_average_mass_cast, physical_average_mass_cast, physical_symmetric_kernel_transpose] /- Nonnegative averaging preserves the absolute row sum, not just a norm bound for the corresponding complex operator. -/ theorem physical_average_mass_row_bound (hM : ∀ x y, 0 ≤ M x y) {A : ℝ} (hA : 0 ≤ A) (hrow : ∀ x rows, (∑ y ∈ rows, M x y) ≤ A) (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)) : (∑ y ∈ rows, physicalAverageMass M x y) ≤ A := by have hr : ∀ x rows, (∑ y ∈ rows, ‖(M x y : ℂ)‖) ≤ A := by intro x rows simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hM _ _)] using hrow x rows have hh := physical_symmetric_kernel_row_bound (fun x y => (M x y : ℂ)) hA hr x rows simpa only [← physical_average_mass_cast, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (physical_average_mass_nonneg M hM _ _)] using hh theorem physical_average_mass_column_bound (hM : ∀ x y, 0 ≤ M x y) {A : ℝ} (hA : 0 ≤ A) (hcol : ∀ y rows, (∑ x ∈ rows, M x y) ≤ A) (y : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)) : (∑ x ∈ rows, physicalAverageMass M x y) ≤ A := by have hh := physical_average_mass_row_bound (fun a b => M b a) (fun a b => hM b a) hA hcol y rows simpa only [physical_average_mass_transpose] using hh end end section open Finset /- Sum absolute sampled-edge coefficients over the auxiliary choices and patterns, then average over both endpoint permutations. -/ noncomputable def physicalAbsoluteOperator {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (x y : PhysicalState P J ell) : ℝ := physicalAverageMass (fun a b => ∑ i ∈ patterns, physicalAbsolutePattern V (C i) q (ζ i) (k i) (K i) a b) x y /- The expanded nonnegative operator pointwise dominates the original complex operator, including both symmetrizing averages. -/ theorem physical_operator_norm_le_absolute {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (x y : PhysicalState P J ell) : ‖physicalSymmetricKernel (fun a b => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) a b) x y‖ ≤ physicalAbsoluteOperator V patterns C q ζ k K x y := by apply physical_symmetric_kernel_norm_le_mass intro a b exact (norm_sum_le _ _).trans (sum_le_sum (fun i _ => physical_pattern_norm_le_absolute V (C i) q (ζ i) (k i) (K i) a b)) /- The stronger absolute bounds apply before all path labels are summed. Consequently no cancellation is used in bounding expanded path masses. -/ theorem exists_physical_absolute_operator_bounds {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell m : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J : ℕ) (V : G → ℝ), (∀ g, v ≤ V g) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → ∀ (I : Type) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (B : I → ℝ), (∀ i ∈ patterns, ∀ g, (C i g).card ≤ m) → (∀ i ∈ patterns, 0 ≤ B i) → (∀ i ∈ patterns, ∀ a b aux, ‖K i a b aux‖ ≤ B i) → ∀ (x : PhysicalState P J ell) (rows : Finset (PhysicalState P J ell)), (∑ y ∈ rows, physicalAbsoluteOperator V patterns C q ζ k K x y) ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) ∧ (∑ y ∈ rows, physicalAbsoluteOperator V patterns C q ζ k K y x) ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) := by obtain ⟨A, hA, hbound⟩ := exists_physical_absolute_pattern_row_bound hq0 hq1 hv ell m refine ⟨A, hA, ?_⟩ intro G _ _ P J V hV hMass I patterns C ζ k K B hC hB hK x rows classical let W := fun a b => ∑ i ∈ patterns, physicalAbsolutePattern V (C i) q (ζ i) (k i) (K i) a b have hW : ∀ a b, 0 ≤ W a b := fun a b => sum_nonneg (fun i _ => physical_absolute_pattern_nonneg V (C i) q (ζ i) (k i) (K i) a b) have hnonneg : 0 ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) := mul_nonneg (sum_nonneg hB) (pow_nonneg (zero_le_one.trans hA) _) have hrow : ∀ a s, (∑ b ∈ s, W a b) ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) := by intro a s unfold W rw [sum_comm] calc _ ≤ ∑ i ∈ patterns, A^(Fintype.card G) * B i := sum_le_sum (fun i hi => hbound G P J V (C i) hV (hC i hi) hMass (ζ i) (k i) (K i) (B i) (hB i hi) (hK i hi) a s) _ = _ := by rw [← mul_sum, mul_comm] have hcol : ∀ b s, (∑ a ∈ s, W a b) ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) := by intro b s unfold W rw [sum_comm] calc _ ≤ ∑ i ∈ patterns, A^(Fintype.card G) * B i := by apply sum_le_sum intro i hi have hKi : ∀ a b aux, ‖(starRingEnd ℂ) (K i b a aux)‖ ≤ B i := by intro a b aux rw [RCLike.norm_conj] exact hK i hi b a aux have hh := hbound G P J V (C i) hV (hC i hi) hMass (-(ζ i)) (-(k i)) (fun a b aux => (starRingEnd ℂ) (K i b a aux)) (B i) (hB i hi) hKi b s simpa only [physical_absolute_pattern_reverse] using hh _ = _ := by rw [← mul_sum, mul_comm] exact ⟨physical_average_mass_row_bound W hW hnonneg hrow x rows, physical_average_mass_column_bound W hW hnonneg hcol x rows⟩ end section open Finset /- A finite maximum over all source lists and auxiliary labels. -/ noncomputable def physicalDMax {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J ell : ℕ) (C : G → Finset (Fin J)) : ℕ := univ.sup (fun a : PhysicalMarkLists P J ell × PhysicalAuxLabels P C => physicalD C a.1 a.2) theorem physical_D_le_max {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J ell : ℕ) (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) : physicalD C labels aux ≤ physicalDMax P J ell C := by exact le_sup (f := fun a : PhysicalMarkLists P J ell × PhysicalAuxLabels P C => physicalD C a.1 a.2) (mem_univ (labels, aux)) /- Natural displacement bound, allowing negative translation steps. -/ noncomputable def physicalStepBound {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J ell : ℕ) (C : G → Finset (Fin J)) (k : ℤ) : ℕ := k.natAbs * physicalDMax P J ell C theorem physical_admissible_displacement {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) {x y : PhysicalState P J ell} (h : physicalAdmissible C aux k x y) : (y.1 - x.1).natAbs ≤ physicalStepBound P J ell C k := by have he : y.1 - x.1 = k * (physicalD C x.2.val aux : ℕ) := by rw [h.2.2.2]; ring rw [he, Int.natAbs_mul, Int.natAbs_natCast] exact Nat.mul_le_mul_left _ (physical_D_le_max P J ell C x.2.val aux) theorem physical_step_bound_neg {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J ell : ℕ) (C : G → Finset (Fin J)) (k : ℤ) : physicalStepBound P J ell C (-k) = physicalStepBound P J ell C k := by simp only [physicalStepBound, Int.natAbs_neg] section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) include G sharedInstance1 sharedInstance2 P J ell V C q ζ k K /- Coefficients outside the displacement bound vanish individually. -/ theorem physical_edge_zero_of_far (aux : PhysicalAuxLabels P C) (x y : PhysicalState P J ell) (hfar : physicalStepBound P J ell C k < (y.1 - x.1).natAbs) : physicalEdgeCoeff V C q ζ k K aux x y = 0 := by classical have hnot : ¬ physicalAdmissible C aux k x y := fun h => (not_lt_of_ge (physical_admissible_displacement C aux k h)) hfar simp only [physicalEdgeCoeff, if_neg hnot] theorem physical_absolute_pattern_zero_of_far (x y : PhysicalState P J ell) (hfar : physicalStepBound P J ell C k < (y.1 - x.1).natAbs) : physicalAbsolutePattern V C q ζ k K x y = 0 := by unfold physicalAbsolutePattern apply sum_eq_zero intro aux _ rw [physical_edge_zero_of_far V C q ζ k K aux x y hfar, norm_zero] end end section open Finset noncomputable def physicalOperatorStepBound {G I : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J ell : ℕ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (k : I → ℤ) : ℕ := patterns.sup (fun i => physicalStepBound P J ell (C i) (k i)) theorem physical_operator_step_bound_neg {G I : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J ell : ℕ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (k : I → ℤ) : physicalOperatorStepBound P J ell patterns C (fun i => -(k i)) = physicalOperatorStepBound P J ell patterns C k := by simp only [physicalOperatorStepBound, physical_step_bound_neg] /- Taking absolute values, adding patterns, and averaging mark permutations do not enlarge the possible displacement of any individual edge. -/ theorem physical_absolute_operator_zero_of_far {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (x y : PhysicalState P J ell) (hfar : physicalOperatorStepBound P J ell patterns C k < (y.1 - x.1).natAbs) : physicalAbsoluteOperator V patterns C q ζ k K x y = 0 := by classical have hzero : ∀ σ τ : PhysicalPermutations G J ell, (∑ i ∈ patterns, physicalAbsolutePattern V (C i) q (ζ i) (k i) (K i) (physicalPermutationEquiv σ x) (physicalPermutationEquiv τ y)) = 0 := by intro σ τ apply sum_eq_zero intro i hi apply physical_absolute_pattern_zero_of_far change physicalStepBound P J ell (C i) (k i) < (y.1 - x.1).natAbs exact (le_sup (f := fun i => physicalStepBound P J ell (C i) (k i)) hi).trans_lt hfar simp only [physicalAbsoluteOperator, physicalAverageMass, hzero, sum_const_zero, mul_zero] /- The complex physical kernel has the same finite displacement bound. -/ theorem physical_operator_zero_of_far {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (x y : PhysicalState P J ell) (hfar : physicalOperatorStepBound P J ell patterns C k < (y.1 - x.1).natAbs) : physicalSymmetricKernel (fun a b => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) a b) x y = 0 := by apply norm_eq_zero.mp apply le_antisymm _ (norm_nonneg _) have hh := physical_operator_norm_le_absolute V patterns C q ζ k K x y rwa [physical_absolute_operator_zero_of_far V patterns C q ζ k K x y hfar] at hh end section open Finset theorem integer_walk_displacement {p : ℕ → ℤ} {N b : ℕ} (hstep : ∀ j < N, (p (j + 1) - p j).natAbs ≤ b) : ∀ j ≤ N, (p j - p 0).natAbs ≤ j * b := by intro j induction j with | zero => simp | succ j ih => intro hj have hjN : j < N := by omega have hh := ih (by omega) calc (p (j + 1) - p 0).natAbs = ((p (j + 1) - p j) + (p j - p 0)).natAbs := by congr 1; ring _ ≤ (p (j + 1) - p j).natAbs + (p j - p 0).natAbs := Int.natAbs_add_le _ _ _ ≤ b + j * b := Nat.add_le_add (hstep j hjN) hh _ = (j + 1) * b := by ring /- The union of radius-R integer intervals around a finite starting set. -/ def reachablePositions (I : Finset ℤ) (R : ℕ) : Finset ℤ := I.biUnion (fun n => Icc (n - (R : ℤ)) (n + (R : ℤ))) theorem mem_reachable_positions {I : Finset ℤ} {R : ℕ} {n r : ℤ} (hr : r ∈ I) (hd : (n - r).natAbs ≤ R) : n ∈ reachablePositions I R := by have hh : ((n - r).natAbs : ℤ) ≤ (R : ℤ) := by exact_mod_cast hd rw [Int.natCast_natAbs] at hh have habs := abs_le.mp hh exact mem_biUnion.mpr ⟨r, hr, mem_Icc.mpr ⟨by omega, by omega⟩⟩ end section open Finset /- Finite operator action in reverse step order, matching finitePathMass. -/ noncomputable def finitePathAction {X R : Type*} [Fintype X] [Semiring R] (K : ℕ → X → X → R) (terminal : X → R) : ℕ → X → R | 0, x => terminal x | n + 1, x => ∑ y, K n x y * finitePathAction K terminal n y /- One fully expanded path records an edge label and the next state at each step. Its weight includes the terminal value. -/ def labeledPathTerm {A X R : Type*} [Mul R] (K : ℕ → A → X → X → R) (terminal : X → R) : (n : ℕ) → X → (Fin n → A × X) → R | 0, x, _ => terminal x | n + 1, x, p => K n (p 0).1 x (p 0).2 * labeledPathTerm K terminal n (p 0).2 (Fin.tail p) /- Finite matrix iteration is exactly the sum over all edge labels and all visited states, without any suppression of individual terms. -/ theorem finite_labeled_path_expansion {A X R : Type*} [Fintype A] [Fintype X] [Semiring R] (K : ℕ → A → X → X → R) (terminal : X → R) (n : ℕ) (x : X) : (∑ p : Fin n → A × X, labeledPathTerm K terminal n x p) = finitePathAction (fun j a b => ∑ label, K j label a b) terminal n x := by classical induction n generalizing x with | zero => simp [labeledPathTerm, finitePathAction] | succ n ih => calc _ = ∑ z : A × X, ∑ p : Fin n → A × X, K n z.1 x z.2 * labeledPathTerm K terminal n z.2 p := by rw [← Equiv.sum_comp (Fin.consEquiv (fun _ : Fin (n + 1) => A × X)) (fun p => labeledPathTerm K terminal (n + 1) x p), Fintype.sum_prod_type] rfl _ = ∑ z : A × X, K n z.1 x z.2 * finitePathAction (fun j a b => ∑ label, K j label a b) terminal n z.2 := by apply sum_congr rfl intro z _ rw [← mul_sum, ih] _ = _ := by rw [Fintype.sum_prod_type, sum_comm] simp only [finitePathAction, sum_mul] /- Norms factor over every individual labeled path. -/ theorem norm_labeled_path_term {A X : Type*} (K : ℕ → A → X → X → ℂ) (terminal : X → ℂ) (n : ℕ) (x : X) (p : Fin n → A × X) : ‖labeledPathTerm K terminal n x p‖ = labeledPathTerm (fun j a x y => ‖K j a x y‖) (fun y => ‖terminal y‖) n x p := by induction n generalizing x with | zero => rfl | succ n ih => simp only [labeledPathTerm, norm_mul, ih] theorem real_finite_path_action_eq_mass {X : Type*} [Fintype X] (K : ℕ → X → X → ℝ) (terminal : X → ℝ) (n : ℕ) (x : X) : finitePathAction K terminal n x = finitePathMass univ K terminal n x := by induction n generalizing x with | zero => rfl | succ n ih => simp only [finitePathAction, finitePathMass, ih] /- The sum of the norms of all fully expanded path terms is exactly iteration of the kernel that sums the norms of individual edge coefficients. -/ theorem absolute_labeled_path_expansion {A X : Type*} [Fintype A] [Fintype X] (K : ℕ → A → X → X → ℂ) (terminal : X → ℂ) (n : ℕ) (x : X) : (∑ p : Fin n → A × X, ‖labeledPathTerm K terminal n x p‖) = finitePathMass univ (fun j a b => ∑ label, ‖K j label a b‖) (fun y => ‖terminal y‖) n x := by simp only [norm_labeled_path_term] rw [finite_labeled_path_expansion, real_finite_path_action_eq_mass] /- Uniform absolute row bounds control the sum of all expanded path magnitudes, not only the norm after the paths have been added. -/ theorem absolute_labeled_path_bound {A X : Type*} [Fintype A] [Fintype X] (K : ℕ → A → X → X → ℂ) (terminal : X → ℂ) {B : ℝ} (hB : 0 ≤ B) (hrow : ∀ j x, (∑ y, ∑ label, ‖K j label x y‖) ≤ B) (ht : ∀ x, ‖terminal x‖ ≤ 1) (n : ℕ) (x : X) : (∑ p : Fin n → A × X, ‖labeledPathTerm K terminal n x p‖) ≤ B^n := by rw [absolute_labeled_path_expansion] exact finite_path_mass_le_pow univ _ _ hB (fun _ _ _ _ _ => sum_nonneg (fun _ _ => norm_nonneg _)) (fun j x _ => hrow j x) (fun x _ => ht x) n x (mem_univ x) end section open Finset abbrev PhysicalEdgeLabels {G I : Type*} (P : G → Finset ℕ) (J ell : ℕ) (patterns : Finset I) (C : I → G → Finset (Fin J)) := PhysicalPermutations G J ell × PhysicalPermutations G J ell × (Σ i : patterns, PhysicalAuxLabels P (C i.val)) theorem physical_edge_labels_sum {G I R : Type*} [Fintype G] [DecidableEq G] [AddCommMonoid R] {P : G → Finset ℕ} {J ell : ℕ} (patterns : Finset I) (C : I → G → Finset (Fin J)) (F : PhysicalPermutations G J ell → PhysicalPermutations G J ell → (i : I) → PhysicalAuxLabels P (C i) → R) : (∑ a : PhysicalEdgeLabels P J ell patterns C, F a.1 a.2.1 a.2.2.1.val a.2.2.2) = ∑ σ : PhysicalPermutations G J ell, ∑ τ : PhysicalPermutations G J ell, ∑ i ∈ patterns, ∑ aux : PhysicalAuxLabels P (C i), F σ τ i aux := by classical simp only [Fintype.sum_prod_type, Fintype.sum_sigma] apply sum_congr rfl intro σ _ apply sum_congr rfl intro τ _ exact sum_coe_sort patterns (fun i => ∑ aux : PhysicalAuxLabels P (C i), F σ τ i aux) noncomputable def physicalLabeledCoeff {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (x y : PhysicalState P J ell) : ℂ := (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * physicalEdgeCoeff V (C a.2.2.1.val) q (ζ a.2.2.1.val) (k a.2.2.1.val) (K a.2.2.1.val) a.2.2.2 (physicalPermutationEquiv a.1 x) (physicalPermutationEquiv a.2.1 y) /- The labeled coefficients sum to exactly the symmetrized physical operator, with both permutation normalizations included. -/ theorem physical_labeled_coefficient_sum {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (x y : PhysicalState P J ell) : (∑ a : PhysicalEdgeLabels P J ell patterns C, physicalLabeledCoeff V patterns C q ζ k K a x y) = physicalSymmetricKernel (fun b c => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) b c) x y := by classical unfold physicalLabeledCoeff rw [physical_edge_labels_sum patterns C (fun σ τ i aux => (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * physicalEdgeCoeff V (C i) q (ζ i) (k i) (K i) aux (physicalPermutationEquiv σ x) (physicalPermutationEquiv τ y)), physical_symmetric_kernel_double_sum] simp only [← mul_sum, physicalPatternKernel] /- Taking the norm before summing any edge labels gives exactly the expanded absolute operator, retaining all normalization factors. -/ theorem physical_labeled_coefficient_abs_sum {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (x y : PhysicalState P J ell) : (∑ a : PhysicalEdgeLabels P J ell patterns C, ‖physicalLabeledCoeff V patterns C q ζ k K a x y‖) = physicalAbsoluteOperator V patterns C q ζ k K x y := by classical unfold physicalLabeledCoeff simp only [norm_mul, norm_inv, Complex.norm_natCast] rw [physical_edge_labels_sum patterns C (fun σ τ i aux => (Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹ * (Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹ * ‖physicalEdgeCoeff V (C i) q (ζ i) (k i) (K i) aux (physicalPermutationEquiv σ x) (physicalPermutationEquiv τ y)‖)] unfold physicalAbsoluteOperator physicalAverageMass physicalAbsolutePattern simp only [← mul_sum, mul_assoc] end section open Finset Classical /- A normalized starting distribution preserves the labeled path bound, including when the terminal condition depends on the starting state. -/ theorem averaged_absolute_labeled_path_bound {A X : Type*} [Fintype A] [Fintype X] (K : ℕ → A → X → X → ℂ) (terminal : X → X → ℂ) (μ : X → ℝ) {B : ℝ} (hB : 0 ≤ B) (hrow : ∀ j x, (∑ y, ∑ label, ‖K j label x y‖) ≤ B) (ht : ∀ x y, ‖terminal x y‖ ≤ 1) (hμ : ∀ x, 0 ≤ μ x) (hmass : (∑ x, μ x) ≤ 1) (n : ℕ) : (∑ x, μ x * ∑ p : Fin n → A × X, ‖labeledPathTerm K (terminal x) n x p‖) ≤ B^n := by calc _ ≤ ∑ x, μ x * B^n := sum_le_sum (fun x _ => mul_le_mul_of_nonneg_left (absolute_labeled_path_bound K (terminal x) hB hrow (ht x) n x) (hμ x)) _ = (∑ x, μ x) * B^n := by rw [sum_mul] _ ≤ 1 * B^n := mul_le_mul_of_nonneg_right hmass (pow_nonneg hB n) _ = B^n := one_mul _ end section open Finset /- Logarithmically many group losses and polynomial total pattern mass give a fixed power of L, with no dependence on the shared-slot count. -/ theorem group_pattern_weight_power_bound {L A B C D : ℝ} {s : ℕ} (hL : 0 < L) (hA : 1 ≤ A) (hs : (s : ℝ) ≤ D * Real.log L) (hB : B ≤ L^C) : B * A^s ≤ L^(C + D * Real.log A) := by have hA0 : 0 ≤ A := zero_le_one.trans hA have hprod : A^s ≤ L^(D * Real.log A) := by simpa only [prod_const, card_range] using group_product_bound_of_log_card (range s) (fun _ => A) hA hL (fun _ _ => hA0) (fun _ _ => le_rfl) (by simpa only [card_range] using hs) calc _ ≤ L^C * A^s := mul_le_mul_of_nonneg_right hB (pow_nonneg hA0 s) _ ≤ L^C * L^(D * Real.log A) := mul_le_mul_of_nonneg_left hprod (Real.rpow_nonneg hL.le C) _ = _ := (Real.rpow_add hL _ _).symm end section open Finset end section open Finset def physicalGroupMarkEmbedding {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (g : G) : PhysicalSlots J ell ↪ ℕ := (labels g).trans ⟨Subtype.val, Subtype.val_injective⟩ def physicalGroupMarks {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (g : G) : Finset ℕ := univ.map (physicalGroupMarkEmbedding labels g) theorem mem_physical_group_marks {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (g : G) (p : ℕ) : p ∈ physicalGroupMarks labels g ↔ ∃ s, (labels g s).val = p := by simp only [physicalGroupMarks, mem_map, mem_univ, true_and] rfl theorem physical_group_marks_card {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (g : G) : (physicalGroupMarks labels g).card = J + ell := by simp only [physicalGroupMarks, card_map, card_univ, Fintype.card_sum, Fintype.card_fin] theorem physical_group_marks_subset {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (g : G) : physicalGroupMarks labels g ⊆ P g := by intro p hp obtain ⟨s, rfl⟩ := (mem_physical_group_marks labels g p).mp hp exact (labels g s).property theorem physical_group_marks_divisor_subset {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (n : ℤ) (labels : PhysicalMarksAt P J ell n) (g : G) : physicalGroupMarks labels.val g ⊆ physicalDivisorPool P g n := by intro p hp obtain ⟨s, rfl⟩ := (mem_physical_group_marks labels.val g p).mp hp exact mem_filter.mpr ⟨(labels.val g s).property, labels.property g s⟩ /- The excess divisor count equals the number of unmarked dividing primes; natural subtraction causes no loss on a physical state. -/ theorem physical_unmarked_divisor_count {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (n : ℤ) (labels : PhysicalMarksAt P J ell n) (g : G) : ((P g \ physicalGroupMarks labels.val g).filter (fun p : ℕ => (p : ℤ) ∣ n)).card = physicalOmega P g n - (J + ell) := by have he : (P g \ physicalGroupMarks labels.val g).filter (fun p : ℕ => (p : ℤ) ∣ n) = physicalDivisorPool P g n \ physicalGroupMarks labels.val g := by ext p simp only [mem_filter, mem_sdiff, physicalDivisorPool] tauto rw [he, card_sdiff_of_subset (physical_group_marks_divisor_subset n labels g), physical_group_marks_card] rfl /- A half-power of the excess count is one square-root damping factor for each unmarked dividing prime. -/ theorem physical_group_damping_as_unmarked {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (n : ℤ) (labels : PhysicalMarksAt P J ell n) (g : G) {q : ℝ} (hq : 0 ≤ q) : q^(((physicalOmega P g n - (J + ell) : ℕ) : ℝ) / 2) = (Real.sqrt q)^((P g \ physicalGroupMarks labels.val g).filter (fun p : ℕ => (p : ℤ) ∣ n)).card := by rw [physical_unmarked_divisor_count n labels g, Real.sqrt_eq_rpow, ← Real.rpow_natCast, ← Real.rpow_mul hq] congr 1 ring theorem physical_damping_as_unmarked {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (n : ℤ) (labels : PhysicalMarksAt P J ell n) {q : ℝ} (hq : 0 ≤ q) : physicalDamping P J ell q n = ∏ g, (Real.sqrt q)^((P g \ physicalGroupMarks labels.val g).filter (fun p : ℕ => (p : ℤ) ∣ n)).card := by unfold physicalDamping apply prod_congr rfl intro g _ exact physical_group_damping_as_unmarked n labels g hq end section open Finset /- Summing a nonnegative product law over embeddings loses mass relative to summing over all functions, for any finite slot type. -/ theorem embedding_weight_bound {S P : Type*} [Fintype S] [Fintype P] (w : P → ℝ) (hw : ∀ p, 0 ≤ w p) : (∑ f : S ↪ P, ∏ s, w (f s)) ≤ (∑ p, w p)^(Fintype.card S) := by classical let e : (S ↪ P) ↪ (S → P) := ⟨fun f => f, fun _ _ h => Function.Embedding.ext (fun s => congrFun h s)⟩ calc _ = ∑ f ∈ univ.map e, ∏ s, w (f s) := by rw [sum_map]; rfl _ ≤ ∑ f : S → P, ∏ s, w (f s) := sum_le_univ_sum_of_nonneg (fun f => prod_nonneg (fun s _ => hw (f s))) _ = ∏ _s : S, ∑ p, w p := (Fintype.prod_sum (fun (_s : S) p => w p)).symm _ = _ := by simp theorem normalized_embedding_weight_bound {S P : Type*} [Fintype S] [Fintype P] (w : P → ℝ) (hw : ∀ p, 0 ≤ w p) {V : ℝ} (hV : 0 < V) (hsum : ∑ p, w p = V) : (∑ f : S ↪ P, (∏ s, w (f s)) / V^(Fintype.card S)) ≤ 1 := by rw [← sum_div, div_le_one (pow_pos hV _)] simpa only [hsum] using embedding_weight_bound (S := S) w hw /- Independent-prime weight of a tuple of distinct ordered mark lists. -/ noncomputable def physicalMarkPriorMass {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (labels : PhysicalMarkLists P J ell) : ℝ := ∏ g, (∏ s, 1 / ((labels g s).val : ℝ)) / (V g)^(J + ell) /- Summing over all physical mark lists gives mass at most one. No normalization of the actual integer-position starting measure is assumed. -/ theorem physical_mark_prior_total_mass {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) : (∑ labels : PhysicalMarkLists P J ell, physicalMarkPriorMass V labels) ≤ 1 := by classical have he : (∑ labels : PhysicalMarkLists P J ell, physicalMarkPriorMass V labels) = ∏ g, ∑ f : PhysicalSlots J ell ↪ ↥(P g), (∏ s, 1 / ((f s).val : ℝ)) / (V g)^(J + ell) := (Fintype.prod_sum (fun g (f : PhysicalSlots J ell ↪ ↥(P g)) => (∏ s, 1 / ((f s).val : ℝ)) / (V g)^(J + ell))).symm rw [he] apply prod_le_one₀ · intro g _ exact sum_nonneg (fun f _ => div_nonneg (prod_nonneg (fun s _ => by positivity)) (pow_nonneg (hV g).le _)) · intro g _ have hs : (∑ p : P g, 1 / (p.val : ℝ)) = V g := by rw [sum_coe_sort (P g) (fun p : ℕ => 1 / (p : ℝ))] exact hMass g have hh := normalized_embedding_weight_bound (S := PhysicalSlots J ell) (fun p : P g => 1 / (p.val : ℝ)) (fun _ => by positivity) (hV g) hs simpa only [Fintype.card_sum, Fintype.card_fin] using hh /- The prior weight is the original state normalization times the product of the marked-prime divisibility probabilities. -/ theorem physical_mark_prior_factor {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (labels : PhysicalMarkLists P J ell) : physicalMarkPriorMass V labels = physicalStateMass V J ell * ∏ g, ∏ s, 1 / ((labels g s).val : ℝ) := by unfold physicalMarkPriorMass physicalStateMass rw [← prod_mul_distrib] apply prod_congr rfl intro g _ ring end section open Finset abbrev PhysicalPrime {G : Type*} (P : G → Finset ℕ) := Σ g, ↥(P g) theorem _root_.Bounty.NeZeroReindexAux.seed {N M : ℕ} {P : Fin N → Finset ℕ} [∀ z : Bounty.PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) : let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : Bounty.PhysicalPrime P).2.val) True := True.intro def physicalMarkInjection {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) : (Σ _g : G, PhysicalSlots J ell) ↪ PhysicalPrime P := Function.Embedding.sigmaMap (Function.Embedding.refl G) labels def physicalMarkedPrimes {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) : Finset (PhysicalPrime P) := univ.map (physicalMarkInjection labels) theorem mem_physical_marked_primes {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (p : PhysicalPrime P) : p ∈ physicalMarkedPrimes labels ↔ p.2.val ∈ physicalGroupMarks labels p.1 := by rcases p with ⟨g, p⟩ rw [mem_physical_group_marks] constructor · intro hp obtain ⟨⟨h, s⟩, _, he⟩ := mem_map.mp hp change (⟨h, labels h s⟩ : PhysicalPrime P) = ⟨g, p⟩ at he have hg : h = g := congrArg Sigma.fst he cases hg exact ⟨s, congrArg Subtype.val (eq_of_heq (Sigma.mk.inj_iff.mp he).2)⟩ · rintro ⟨s, hs⟩ apply mem_map.mpr refine ⟨⟨g, s⟩, mem_univ _, ?_⟩ change (⟨g, labels g s⟩ : PhysicalPrime P) = ⟨g, p⟩ exact congrArg (Sigma.mk g) (Subtype.ext hs) theorem physical_marked_primes_card {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) : (physicalMarkedPrimes labels).card = (J + ell) * Fintype.card G := by simp only [physicalMarkedPrimes, card_map, card_univ, Fintype.card_sigma, Fintype.card_sum, Fintype.card_fin, sum_const, card_univ, nsmul_eq_mul] change Fintype.card G * (J + ell) = (J + ell) * Fintype.card G exact Nat.mul_comm _ _ /- Divisibility of the tagged marked subset is exactly physical admissibility of the ordered mark lists at the given position. -/ theorem physical_marked_divisibility_iff {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (n : ℤ) : (∀ p ∈ physicalMarkedPrimes labels, (p.2.val : ℤ) ∣ n) ↔ ∀ g s, ((labels g s).val : ℤ) ∣ n := by constructor · intro h g s apply h ⟨g, labels g s⟩ rw [mem_physical_marked_primes, mem_physical_group_marks] exact ⟨s, rfl⟩ · intro h p hp obtain ⟨s, hs⟩ := (mem_physical_group_marks labels p.1 p.2.val).mp ((mem_physical_marked_primes labels p).mp hp) rw [← hs] exact h p.1 s /- If the prime groups are disjoint, forgetting a prime's group tag is injective, as required by the grouped residue theorem. -/ theorem physical_prime_value_injective {G : Type*} {P : G → Finset ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) : Function.Injective (fun p : PhysicalPrime P => p.2.val) := by rintro ⟨g, p⟩ ⟨h, q⟩ hpq change p.val = q.val at hpq have hg : g = h := by by_contra hne apply (Finset.disjoint_left.mp (hP hne)) p.property rw [hpq] exact q.property cases hg exact congrArg (Sigma.mk g) (Subtype.ext hpq) end section open Finset Classical theorem unmarked_damping_product {T : Type*} [DecidableEq T] (pool marked : Finset T) (hit : T → Prop) [DecidablePred hit] (q : ℝ) : (∏ p ∈ pool, if p ∈ marked then (1 : ℝ) else if hit p then q else 1) = q^((pool \ marked).filter hit).card := by have he : ∀ p, (if p ∈ marked then (1 : ℝ) else if hit p then q else 1) = if p ∉ marked ∧ hit p then q else 1 := by intro p by_cases hm : p ∈ marked <;> by_cases hh : hit p <;> simp only [hm, hh, if_true, if_false, not_true_eq_false, not_false_eq_true, false_and, true_and] have hf : pool.filter (fun p => p ∉ marked ∧ hit p) = (pool \ marked).filter hit := by ext p simp only [mem_filter, mem_sdiff] tauto simp only [he, prod_ite, prod_const, one_pow, mul_one, hf] /- The full-excess damping product is a power of the number of unmarked hits in the tagged prime pool. -/ theorem physical_count_damping_as_pool {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (n : ℤ) (labels : PhysicalMarksAt P J ell n) (q : ℝ) : (∏ g, q^(physicalOmega P g n - (J + ell))) = q^((univ \ physicalMarkedPrimes labels.val).filter (fun p : PhysicalPrime P => (p.2.val : ℤ) ∣ n)).card := by classical rw [← unmarked_damping_product] rw [Fintype.prod_sigma] apply prod_congr rfl intro g _ simp only [mem_physical_marked_primes] rw [prod_coe_sort (P g) (fun p : ℕ => if p ∈ physicalGroupMarks labels.val g then (1 : ℝ) else if (p : ℤ) ∣ n then q else 1), unmarked_damping_product, physical_unmarked_divisor_count n labels g] /- The indicator of simultaneous divisibility is the product of its individual zero-one indicators. -/ theorem finite_divisibility_indicator_product {T : Type*} (S : Finset T) (hit : T → Prop) [DecidablePred hit] : (∏ p ∈ S, if hit p then (1 : ℝ) else 0) = if ∀ p ∈ S, hit p then 1 else 0 := by classical by_cases h : ∀ p ∈ S, hit p · rw [if_pos h] exact prod_eq_one (fun p hp => if_pos (h p hp)) · rw [if_neg h] push Not at h obtain ⟨p, hp, hn⟩ := h exact prod_eq_zero hp (if_neg hn) /- A weight defined for all mark lists, including those not dividing n. Its parameter is the per-unmarked-prime damping, not its square. -/ noncomputable def physicalVertexWeight {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (q : ℝ) (n : ℤ) : ℝ := if ∀ g s, ((labels g s).val : ℤ) ∣ n then ∏ g, q^(physicalOmega P g n - (J + ell)) else 0 /- This is exactly the vertex factor in grouped residue replacement. -/ theorem physical_vertex_weight_factor {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (q : ℝ) (n : ℤ) : physicalVertexWeight labels q n = (∏ p ∈ physicalMarkedPrimes labels, if (p.2.val : ℤ) ∣ n then (1 : ℝ) else 0) * q^((univ \ physicalMarkedPrimes labels).filter (fun p : PhysicalPrime P => (p.2.val : ℤ) ∣ n)).card := by classical rw [finite_divisibility_indicator_product] simp only [physical_marked_divisibility_iff] unfold physicalVertexWeight by_cases h : ∀ g s, ((labels g s).val : ℤ) ∣ n · simp only [if_pos h, one_mul] exact physical_count_damping_as_pool n ⟨labels, h⟩ q · simp only [if_neg h, zero_mul] /- On an actual physical state, square-root vertex damping is exactly the original physical endpoint damping. -/ theorem physical_vertex_weight_endpoint {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (n : ℤ) (labels : PhysicalMarksAt P J ell n) {q : ℝ} (hq : 0 ≤ q) : physicalVertexWeight labels.val (Real.sqrt q) n = physicalDamping P J ell q n := by rw [physicalVertexWeight, if_pos labels.property, physical_damping_as_unmarked n labels hq] apply prod_congr rfl intro g _ rw [physical_unmarked_divisor_count n labels g] /- Repeated vertex factors multiply their per-prime damping parameters; the divisibility indicator remains a single zero-one indicator. -/ theorem physical_vertex_weight_mul {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (q r : ℝ) (n : ℤ) : physicalVertexWeight labels q n * physicalVertexWeight labels r n = physicalVertexWeight labels (q * r) n := by unfold physicalVertexWeight by_cases h : ∀ g s, ((labels g s).val : ℤ) ∣ n · simp only [if_pos h] rw [← prod_mul_distrib] apply prod_congr rfl intro g _ exact (mul_pow q r _).symm · simp only [if_neg h, mul_zero] end section open Finset theorem physical_prime_pool_coprime {G : Type*} {P : G → Finset ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) : Pairwise (fun p q : PhysicalPrime P => Nat.Coprime p.2.val q.2.val) := by intro p q hpq exact (Nat.coprime_primes (hprime p.1 p.2.val p.2.property) (hprime q.1 q.2.val q.2.property)).mpr ((physical_prime_value_injective hP).ne hpq) theorem physical_prime_harmonic_sum {G : Type*} [Fintype G] (P : G → Finset ℕ) : (∑ p : PhysicalPrime P, 1 / (p.2.val : ℝ)) = ∑ g, ∑ p ∈ P g, 1 / (p : ℝ) := by rw [Fintype.sum_sigma] apply sum_congr rfl intro g _ exact sum_coe_sort (P g) (fun p : ℕ => 1 / (p : ℝ)) theorem physical_prime_harmonic_bound {G : Type*} [Fintype G] (P : G → Finset ℕ) {V : ℝ} (hV : ∀ g, (∑ p ∈ P g, 1 / (p : ℝ)) ≤ V) : (∑ p : PhysicalPrime P, 1 / (p.2.val : ℝ)) ≤ Fintype.card G * V := by rw [physical_prime_harmonic_sum] calc _ ≤ ∑ _g : G, V := sum_le_sum (fun g _ => hV g) _ = _ := by simp /- All marked labels are distinct in the tagged pool, so their individual divisibility probabilities form the original ordered product. -/ theorem physical_marked_probability_product {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) : (∏ p ∈ physicalMarkedPrimes labels, 1 / (p.2.val : ℝ)) = ∏ g, ∏ s, 1 / ((labels g s).val : ℝ) := by rw [physicalMarkedPrimes, prod_map, Fintype.prod_sigma] rfl theorem physical_mark_prior_tagged_factor {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (labels : PhysicalMarkLists P J ell) : physicalMarkPriorMass V labels = physicalStateMass V J ell * ∏ p ∈ physicalMarkedPrimes labels, 1 / (p.2.val : ℝ) := by rw [physical_mark_prior_factor, physical_marked_probability_product] /- The state-free physical vertex product is exactly the local residue product, with arbitrary offsets and damping values. -/ theorem physical_vertex_path_factorization {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (q : ℕ → ℝ) (n : ℤ) : (∏ j ∈ visits, physicalVertexWeight (labels j) (q j) (n + offset j)) = ∏ p : PhysicalPrime P, activeResidueWeight visits (visits.filter (fun j => p ∈ physicalMarkedPrimes (labels j))) (fun j => -(offset j : ZMod p.2.val)) (fun j => 1 - q j) (n : ZMod p.2.val) := by classical simp only [physical_vertex_weight_factor] exact physical_path_divisibility_factorization (fun p : PhysicalPrime P => p.2.val) univ visits (fun j => physicalMarkedPrimes (labels j)) offset q n (fun _ _ => subset_univ _) end section open Filter Finset open scoped Topology theorem eventually_physical_vertex_replacement {a c d C V E γ : ℝ} (ha : 0 ≤ a) (hc : 0 < c) (hd : 0 < d) (had : a + d < 1) (hC : 0 < C) (hV : 0 < V) (hE : 0 ≤ E) (hγ : 0 < γ) (J ell : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] (labels : ℕ → PhysicalMarkLists P J ell) (offset : ℕ → ℤ) (q : ℕ → ℝ) (N : ℕ) (z : ℤ), let n := 2 * Nat.ceil (L^a) let visits := range (n + 1) Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime) → (Fintype.card G : ℝ) ≤ C * Real.log L → (∀ g, (∑ p ∈ P g, 1 / (p : ℝ)) ≤ V) → (∀ g p, p ∈ P g → Real.exp (L^c) ≤ (p : ℝ)) → (∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp (L^d)) → (∀ j ∈ visits, 0 ≤ q j ∧ q j ≤ 1) → 0 < N → γ * L ≤ Real.log (N : ℝ) → |((∑ k ∈ Ico z (z + N), ∏ j ∈ visits, physicalVertexWeight (labels j) (q j) (k + offset j)) / (N : ℝ)) - poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) univ visits (fun p => visits.filter (fun j => p ∈ physicalMarkedPrimes (labels j))) (fun p j => -(offset j : ZMod p.2.val)) (fun j => 1 - q j)| ≤ Real.exp (-E * n * Real.log L) * poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) univ visits (fun p => visits.filter (fun j => p ∈ physicalMarkedPrimes (labels j))) (fun p j => -(offset j : ZMod p.2.val)) (fun j => 1 - q j) := by filter_upwards [eventually_grouped_path_replacement ha hc hd had hC hV hE hγ (J + ell)] with L hL intro G _ _ P _ labels offset q N z dsimp only intro hdis hprime hs hH hmin hmax hq hN hNb have hcop : ((univ : Finset (PhysicalPrime P)) : Set (PhysicalPrime P)).Pairwise (fun p r => Nat.Coprime p.2.val r.2.val) := by intro p _ r _ hne exact physical_prime_pool_coprime hdis hprime hne have he := hL (PhysicalPrime P) (fun p => p.2.val) univ (Fintype.card G) (fun j => physicalMarkedPrimes (labels j)) offset q N z hcop (physical_prime_value_injective hdis).injOn hs (physical_prime_harmonic_bound P hH) (fun p _ => hmin p.1 p.2.val p.2.property) (fun p _ => hmax p.1 p.2.val p.2.property) (fun _ _ => subset_univ _) (fun j _ => by rw [physical_marked_primes_card]) hq hN hNb simpa only [← physical_vertex_weight_factor] using he end section open Finset /- A path of N+1 edges visits N interior vertices twice. -/ theorem adjacent_endpoint_product (d : ℕ → ℝ) (N : ℕ) : (∏ j ∈ range (N + 1), d j * d (j + 1)) = d 0 * d (N + 1) * ∏ j ∈ range N, (d (j + 1))^2 := by induction N with | zero => simp | succ N ih => rw [prod_range_succ, ih, prod_range_succ] ring /- The zero-one state condition is preserved when two endpoint damping factors meet at an interior vertex. -/ theorem physical_vertex_endpoint_square {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) {q : ℝ} (hq : 0 ≤ q) (n : ℤ) : (physicalVertexWeight labels (Real.sqrt q) n)^2 = physicalVertexWeight labels q n := by rw [pow_two, physical_vertex_weight_mul, Real.mul_self_sqrt hq] /- Edge endpoint factors equal the vertex damping factors used in the residue expression, including when a divisibility condition fails. -/ theorem physical_edge_endpoint_product {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (labels : ℕ → PhysicalMarkLists P J ell) (position : ℕ → ℤ) {q : ℝ} (hq : 0 ≤ q) (N : ℕ) : (∏ j ∈ range (N + 1), physicalVertexWeight (labels j) (Real.sqrt q) (position j) * physicalVertexWeight (labels (j + 1)) (Real.sqrt q) (position (j + 1))) = physicalVertexWeight (labels 0) (Real.sqrt q) (position 0) * physicalVertexWeight (labels (N + 1)) (Real.sqrt q) (position (N + 1)) * ∏ j ∈ range N, physicalVertexWeight (labels (j + 1)) q (position (j + 1)) := by rw [adjacent_endpoint_product] simp only [physical_vertex_endpoint_square _ hq] end section open Finset /- A product of uniform residue laws assigns simultaneous zero residues at marked coordinates probability equal to the product of their reciprocals. -/ theorem uniform_marked_residue_probability {ι : Type*} [Fintype ι] [DecidableEq ι] (m : ι → ℕ) [∀ i, NeZero (m i)] (marked : Finset ι) : (∑ r : ∀ i, ZMod (m i), ∏ i, (if i ∈ marked then (if r i = 0 then (1 : ℝ) else 0) else 1) / (m i : ℝ)) = ∏ i ∈ marked, 1 / (m i : ℝ) := by classical have he : (∑ r : ∀ i, ZMod (m i), ∏ i, (if i ∈ marked then (if r i = 0 then (1 : ℝ) else 0) else 1) / (m i : ℝ)) = ∏ i, ∑ a : ZMod (m i), (if i ∈ marked then (if a = 0 then (1 : ℝ) else 0) else 1) / (m i : ℝ) := (Fintype.prod_sum (fun i (a : ZMod (m i)) => (if i ∈ marked then (if a = 0 then (1 : ℝ) else 0) else 1) / (m i : ℝ))).symm rw [he] have hlocal : ∀ i, (∑ a : ZMod (m i), (if i ∈ marked then (if a = 0 then (1 : ℝ) else 0) else 1) / (m i : ℝ)) = if i ∈ marked then 1 / (m i : ℝ) else 1 := by intro i have hm : (m i : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne (m i) by_cases hi : i ∈ marked · simp only [if_pos hi] rw [← sum_div] simp · simp [hi, ZMod.card, hm] simp only [hlocal, prod_ite_mem, univ_inter] /- The independent-residue mass of an initial marked state is exactly the prior whose total mass was bounded using injective tuples. -/ theorem physical_initial_residue_mass {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : G → ℝ) (labels : PhysicalMarkLists P J ell) : physicalStateMass V J ell * (∑ r : ∀ p : PhysicalPrime P, ZMod p.2.val, ∏ p : PhysicalPrime P, (if p ∈ physicalMarkedPrimes labels then (if r p = 0 then (1 : ℝ) else 0) else 1) / (p.2.val : ℝ)) = physicalMarkPriorMass V labels := by rw [uniform_marked_residue_probability, ← physical_mark_prior_tagged_factor] /- After averaging the residue coordinates, the total initial physical mark mass is at most one. This is an explicit averaging identity, not an assumed normalization of the integer-position state count. -/ theorem physical_initial_residue_total_mass {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) : (∑ labels : PhysicalMarkLists P J ell, physicalStateMass V J ell * (∑ r : ∀ p : PhysicalPrime P, ZMod p.2.val, ∏ p : PhysicalPrime P, (if p ∈ physicalMarkedPrimes labels then (if r p = 0 then (1 : ℝ) else 0) else 1) / (p.2.val : ℝ))) ≤ 1 := by simp only [physical_initial_residue_mass] exact physical_mark_prior_total_mass V hV hMass end section open Finset noncomputable def physicalEndpointSchedule (q : ℝ) (edges j : ℕ) : ℝ := if j = 0 ∨ j = edges then Real.sqrt q else q theorem physical_endpoint_schedule_unit {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (edges j : ℕ) : 0 ≤ physicalEndpointSchedule q edges j ∧ physicalEndpointSchedule q edges j ≤ 1 := by have hs : Real.sqrt q ≤ 1 := by simpa only [Real.sqrt_one] using Real.sqrt_le_sqrt hq1 unfold physicalEndpointSchedule split_ifs · exact ⟨Real.sqrt_nonneg q, hs⟩ · exact ⟨hq0, hq1⟩ theorem range_product_endpoints (f : ℕ → ℝ) (N : ℕ) : (∏ j ∈ range (N + 2), f j) = f 0 * f (N + 1) * ∏ j ∈ range N, f (j + 1) := by rw [prod_range_succ, prod_range_succ'] ring /- The entire edge damping is precisely the vertex product to which the physical residue-replacement estimate applies. -/ theorem physical_endpoint_schedule_product {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (labels : ℕ → PhysicalMarkLists P J ell) (position : ℕ → ℤ) {q : ℝ} (hq : 0 ≤ q) (N : ℕ) : (∏ j ∈ range (N + 1), physicalVertexWeight (labels j) (Real.sqrt q) (position j) * physicalVertexWeight (labels (j + 1)) (Real.sqrt q) (position (j + 1))) = ∏ j ∈ range (N + 2), physicalVertexWeight (labels j) (physicalEndpointSchedule q (N + 1) j) (position j) := by rw [physical_edge_endpoint_product labels position hq N, range_product_endpoints] have h0 : physicalEndpointSchedule q (N + 1) 0 = Real.sqrt q := by simp [physicalEndpointSchedule] have hlast : physicalEndpointSchedule q (N + 1) (N + 1) = Real.sqrt q := by simp [physicalEndpointSchedule] rw [h0, hlast] congr 1 apply prod_congr rfl intro j hj have hjN : j < N := mem_range.mp hj have hne0 : j + 1 ≠ 0 := by omega have hnelast : j + 1 ≠ N + 1 := by omega simp only [physicalEndpointSchedule, hne0, hnelast, or_self, if_false] end section open Finset /- Structural constraints of an edge, with no integer position. -/ def physicalListAdmissible {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) : Prop := physicalSharedCompatible C L R ∧ physicalAuxAvoids C aux L ∧ physicalAuxAvoids C aux R theorem physical_admissible_split {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (x y : PhysicalState P J ell) : physicalAdmissible C aux k x y ↔ physicalListAdmissible C aux x.2.val y.2.val ∧ y.1 = x.1 + k * (physicalD C x.2.val aux : ℕ) := by unfold physicalAdmissible physicalListAdmissible tauto /- The bare scalar contains all list constraints, normalized label weights, the list coefficient, and the phase. It has no position or damping. -/ noncomputable def physicalBarePatternScalar {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) : ℂ := by classical exact if physicalListAdmissible C aux L R then ((physicalAuxMass V C aux * physicalCompletionMass V C ell : ℝ) : ℂ) * K L R aux * physicalPhase ζ (physicalD C L aux) else 0 /- An actual edge is a bare scalar times its two endpoint damping factors, and its only remaining support condition is translation. -/ theorem physical_edge_scalar_factor {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (x y : PhysicalState P J ell) : physicalEdgeCoeff V C q ζ k K aux x y = if y.1 = x.1 + k * (physicalD C x.2.val aux : ℕ) then physicalBarePatternScalar V C ζ K aux x.2.val y.2.val * ((physicalDamping P J ell q x.1 * physicalDamping P J ell q y.1 : ℝ) : ℂ) else 0 := by classical by_cases hs : physicalListAdmissible C aux x.2.val y.2.val · by_cases ht : y.1 = x.1 + k * (physicalD C x.2.val aux : ℕ) · have ha := (physical_admissible_split C aux k x y).mpr ⟨hs, ht⟩ simp only [physicalEdgeCoeff, physicalBarePatternScalar, if_pos hs, if_pos ht, if_pos ha] push_cast ring · have ha : ¬ physicalAdmissible C aux k x y := fun h => ht ((physical_admissible_split C aux k x y).mp h).2 simp only [physicalEdgeCoeff, if_neg ha, if_neg ht] · have ha : ¬ physicalAdmissible C aux k x y := fun h => hs ((physical_admissible_split C aux k x y).mp h).1 simp only [physicalEdgeCoeff, physicalBarePatternScalar, if_neg ha, if_neg hs, zero_mul, ite_self] end section open Finset def physicalPermuteLabels {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations G J ell) (L : PhysicalMarkLists P J ell) : PhysicalMarkLists P J ell := fun g => (σ g).toEmbedding.trans (L g) /- Translation of a labeled edge is determined by its source marks. -/ noncomputable def physicalBareStep {G I : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} {patterns : Finset I} (C : I → G → Finset (Fin J)) (k : I → ℤ) (a : PhysicalEdgeLabels P J ell patterns C) (L : PhysicalMarkLists P J ell) : ℤ := k a.2.2.1.val * (physicalD (C a.2.2.1.val) (physicalPermuteLabels a.1 L) a.2.2.2 : ℕ) /- All scalar factors of a labeled edge except its vertex damping and translation condition. The expression is independent of the starting integer. -/ noncomputable def physicalBareLabeledScalar {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) : ℂ := (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * physicalBarePatternScalar V (C a.2.2.1.val) (ζ a.2.2.1.val) (K a.2.2.1.val) a.2.2.2 (physicalPermuteLabels a.1 L) (physicalPermuteLabels a.2.1 R) section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) include G I sharedInstance1 sharedInstance2 P J ell V patterns C /- Exact factorization of the individual labeled physical coefficient. -/ theorem physical_labeled_vertex_factor {q : ℝ} (hq : 0 ≤ q) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (x y : PhysicalState P J ell) : physicalLabeledCoeff V patterns C q ζ k K a x y = if y.1 = x.1 + physicalBareStep C k a x.2.val then physicalBareLabeledScalar V patterns C ζ K a x.2.val y.2.val * ((physicalVertexWeight x.2.val (Real.sqrt q) x.1 * physicalVertexWeight y.2.val (Real.sqrt q) y.1 : ℝ) : ℂ) else 0 := by unfold physicalLabeledCoeff rw [physical_edge_scalar_factor, mul_ite, mul_zero] change (if y.1 = x.1 + physicalBareStep C k a x.2.val then (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * (physicalBarePatternScalar V (C a.2.2.1.val) (ζ a.2.2.1.val) (K a.2.2.1.val) a.2.2.2 (physicalPermuteLabels a.1 x.2.val) (physicalPermuteLabels a.2.1 y.2.val) * ((physicalDamping P J ell q x.1 * physicalDamping P J ell q y.1 : ℝ) : ℂ)) else 0) = _ rw [physical_vertex_weight_endpoint x.1 x.2 hq, physical_vertex_weight_endpoint y.1 y.2 hq] unfold physicalBareLabeledScalar split_ifs <;> ring /- The bare scalar vanishes whenever its structural list conditions fail. -/ theorem physical_bare_scalar_zero_of_incompatible (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) (h : ¬ physicalListAdmissible (C a.2.2.1.val) a.2.2.2 (physicalPermuteLabels a.1 L) (physicalPermuteLabels a.2.1 R)) : physicalBareLabeledScalar V patterns C ζ K a L R = 0 := by simp only [physicalBareLabeledScalar, physicalBarePatternScalar, if_neg h, mul_zero] end end section open Finset noncomputable def physicalBareOffset {G I : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} {patterns : Finset I} (C : I → G → Finset (Fin J)) (k : ℕ → I → ℤ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) : ℕ → ℤ | 0 => 0 | j + 1 => physicalBareOffset C k a L edges j + physicalBareStep C (k (edges - 1 - j)) (a j) (L j) /- Every bare step obeys the same finite displacement bound as a physical edge, without requiring divisibility at any integer position. -/ theorem physical_bare_step_bound {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} {patterns : Finset I} (C : I → G → Finset (Fin J)) (k : I → ℤ) (a : PhysicalEdgeLabels P J ell patterns C) (L : PhysicalMarkLists P J ell) : (physicalBareStep C k a L).natAbs ≤ physicalOperatorStepBound P J ell patterns C k := by unfold physicalBareStep rw [Int.natAbs_mul, Int.natAbs_natCast] exact (Nat.mul_le_mul_left _ (physical_D_le_max P J ell (C a.2.2.1.val) (physicalPermuteLabels a.1 L) a.2.2.2)).trans (le_sup (f := fun i => physicalStepBound P J ell (C i) (k i)) a.2.2.1.property) end section open Finset /- The coefficient of a path before imposing its vertex divisibilities. -/ noncomputable def physicalBareWalkScalar {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) : ℂ := ∏ j ∈ range edges, physicalBareLabeledScalar V patterns C (ζ (edges - 1 - j)) (K (edges - 1 - j)) (a j) (L j) (L (j + 1)) end section open Finset Classical section variable {G R : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] [sharedInstance3 : AddCommMonoid R] (P : G → Finset ℕ) (J ell : ℕ) include G R sharedInstance1 sharedInstance2 sharedInstance3 P J ell theorem physical_cutoff_sum (positions : Finset ℤ) (f : PhysicalState P J ell → R) : (∑ x ∈ physicalCutoff P J ell positions, f x) = ∑ n ∈ positions, ∑ L : PhysicalMarksAt P J ell n, f ⟨n, L⟩ := by classical let _ := physicalCutoffFintype P J ell positions unfold physicalCutoff rw [sum_map] change (∑ x : {x : PhysicalState P J ell // x.1 ∈ positions}, f x.val) = _ rw [← Equiv.sum_comp (physicalCutoffEquiv P J ell positions).symm (fun x => f x.val), Fintype.sum_sigma] exact sum_coe_sort positions (fun n => ∑ L : PhysicalMarksAt P J ell n, f ⟨n, L⟩) /- Restricting a complete cutoff to one position leaves precisely that position's mark fiber. -/ theorem physical_cutoff_sum_at (positions : Finset ℤ) (m : ℤ) (f : PhysicalMarkLists P J ell → R) : (∑ x ∈ physicalCutoff P J ell positions, if x.1 = m then f x.2.val else 0) = if m ∈ positions then ∑ L : PhysicalMarksAt P J ell m, f L.val else 0 := by classical rw [physical_cutoff_sum] have he : ∀ n : ℤ, (∑ L : PhysicalMarksAt P J ell n, if n = m then f L.val else 0) = if n = m then ∑ L : PhysicalMarksAt P J ell m, f L.val else 0 := by intro n by_cases h : n = m · subst n simp · simp [h] simp only [he] simp /- A function vanishing on inadmissible mark lists can be summed over all lists instead of the divisibility fiber. -/ theorem physical_marks_sum_all (n : ℤ) (f : PhysicalMarkLists P J ell → R) (hzero : ∀ L, ¬ (∀ g s, ((L g s).val : ℤ) ∣ n) → f L = 0) : (∑ L : PhysicalMarksAt P J ell n, f L.val) = ∑ L : PhysicalMarkLists P J ell, f L := by exact (sum_congr_set {L : PhysicalMarkLists P J ell | ∀ g s, ((L g s).val : ℤ) ∣ n} f (fun L => f L.val) (fun _ _ => rfl) hzero).symm end end section open Finset Classical theorem physical_labeled_row_as_marks {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (x : PhysicalState P J ell) (positions : Finset ℤ) (f : ℤ → PhysicalMarkLists P J ell → ℂ) : (∑ y ∈ physicalCutoff P J ell positions, physicalLabeledCoeff V patterns C q ζ k K a x y * f y.1 y.2.val) = if x.1 + physicalBareStep C k a x.2.val ∈ positions then ∑ R : PhysicalMarkLists P J ell, physicalBareLabeledScalar V patterns C ζ K a x.2.val R * ((physicalVertexWeight x.2.val (Real.sqrt q) x.1 * physicalVertexWeight R (Real.sqrt q) (x.1 + physicalBareStep C k a x.2.val) : ℝ) : ℂ) * f (x.1 + physicalBareStep C k a x.2.val) R else 0 := by let m := x.1 + physicalBareStep C k a x.2.val let F : PhysicalMarkLists P J ell → ℂ := fun R => physicalBareLabeledScalar V patterns C ζ K a x.2.val R * ((physicalVertexWeight x.2.val (Real.sqrt q) x.1 * physicalVertexWeight R (Real.sqrt q) m : ℝ) : ℂ) * f m R have he : ∀ y : PhysicalState P J ell, physicalLabeledCoeff V patterns C q ζ k K a x y * f y.1 y.2.val = if y.1 = m then F y.2.val else 0 := by intro y rw [physical_labeled_vertex_factor V patterns C hq] change (if y.1 = m then _ else _) * _ = _ rcases y with ⟨n, L⟩ change (if n = m then _ else _) * _ = if n = m then _ else _ by_cases h : n = m · subst n simp only [if_true] rfl · simp only [if_neg h, zero_mul] simp only [he] rw [physical_cutoff_sum_at] change (if m ∈ positions then ∑ L : PhysicalMarksAt P J ell m, F L.val else 0) = if m ∈ positions then ∑ L : PhysicalMarkLists P J ell, F L else 0 congr 1 apply physical_marks_sum_all P J ell m F intro L h simp only [F, physicalVertexWeight, if_neg h, mul_zero, Complex.ofReal_zero, zero_mul] end section open Finset noncomputable def finiteCutoffAction {X R : Type*} [Semiring R] (rows : Finset X) (K : ℕ → X → X → R) (terminal : X → R) : ℕ → X → R | 0, x => terminal x | r + 1, x => ∑ y ∈ rows, K r x y * finiteCutoffAction rows K terminal r y theorem finite_cutoff_action_eq_finite {X R : Type*} [Semiring R] (rows : Finset X) (K : ℕ → X → X → R) (terminal : X → R) (r : ℕ) (x : rows) : finiteCutoffAction rows K terminal r x.val = finitePathAction (fun j (a b : rows) => K j a.val b.val) (fun a : rows => terminal a.val) r x := by induction r generalizing x with | zero => rfl | succ r ih => rw [finiteCutoffAction, finitePathAction, ← sum_coe_sort] apply sum_congr rfl intro y _ rw [ih y] end section open Finset Classical noncomputable def physicalBareAction {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (terminal : ℤ → PhysicalMarkLists P J ell → ℂ) : ℕ → ℤ → PhysicalMarkLists P J ell → ℂ | 0, n, L => terminal n L | r + 1, n, L => ∑ a : PhysicalEdgeLabels P J ell patterns C, if n + physicalBareStep C (k r) a L ∈ positions then ∑ R : PhysicalMarkLists P J ell, physicalBareLabeledScalar V patterns C (ζ r) (K r) a L R * ((physicalVertexWeight L (Real.sqrt q) n * physicalVertexWeight R (Real.sqrt q) (n + physicalBareStep C (k r) a L) : ℝ) : ℂ) * physicalBareAction V patterns C q ζ k K positions terminal r (n + physicalBareStep C (k r) a L) R else 0 /- Every finite physical iterate equals the corresponding bare iterate. Divisibility failures are included with zero weight. -/ theorem physical_cutoff_action_eq_bare {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (terminal : ℤ → PhysicalMarkLists P J ell → ℂ) (r : ℕ) (x : PhysicalState P J ell) : finiteCutoffAction (physicalCutoff P J ell positions) (fun j a b => ∑ label : PhysicalEdgeLabels P J ell patterns C, physicalLabeledCoeff V patterns C q (ζ j) (k j) (K j) label a b) (fun a => terminal a.1 a.2.val) r x = physicalBareAction V patterns C q ζ k K positions terminal r x.1 x.2.val := by induction r generalizing x with | zero => rfl | succ r ih => rw [finiteCutoffAction, physicalBareAction] simp only [sum_mul, ih] rw [sum_comm] apply sum_congr rfl intro a _ exact physical_labeled_row_as_marks V patterns C hq (ζ r) (k r) (K r) a x positions (physicalBareAction V patterns C q ζ k K positions terminal r) end section open Finset noncomputable def translatedPathAction {A M R : Type*} [Fintype A] [Fintype M] [Semiring R] (step : ℕ → A → M → ℤ) (E : ℕ → A → ℤ → M → M → R) (terminal : ℤ → M → R) : ℕ → ℤ → M → R | 0, n, L => terminal n L | r + 1, n, L => ∑ a, ∑ R, E r a n L R * translatedPathAction step E terminal r (n + step r a L) R def translatedPathTerm {A M R : Type*} [Mul R] (step : ℕ → A → M → ℤ) (E : ℕ → A → ℤ → M → M → R) (terminal : ℤ → M → R) : (r : ℕ) → ℤ → M → (Fin r → A × M) → R | 0, n, L, _ => terminal n L | r + 1, n, L, p => E r (p 0).1 n L (p 0).2 * translatedPathTerm step E terminal r (n + step r (p 0).1 L) (p 0).2 (Fin.tail p) theorem translated_path_expansion {A M R : Type*} [Fintype A] [Fintype M] [Semiring R] (step : ℕ → A → M → ℤ) (E : ℕ → A → ℤ → M → M → R) (terminal : ℤ → M → R) (r : ℕ) (n : ℤ) (L : M) : (∑ p : Fin r → A × M, translatedPathTerm step E terminal r n L p) = translatedPathAction step E terminal r n L := by classical induction r generalizing n L with | zero => simp [translatedPathTerm, translatedPathAction] | succ r ih => calc _ = ∑ z : A × M, ∑ p : Fin r → A × M, E r z.1 n L z.2 * translatedPathTerm step E terminal r (n + step r z.1 L) z.2 p := by rw [← Equiv.sum_comp (Fin.consEquiv (fun _ : Fin (r + 1) => A × M)) (fun p => translatedPathTerm step E terminal (r + 1) n L p), Fintype.sum_prod_type] rfl _ = ∑ z : A × M, E r z.1 n L z.2 * translatedPathAction step E terminal r (n + step r z.1 L) z.2 := by apply sum_congr rfl intro z _ rw [← mul_sum, ih] _ = _ := by rw [Fintype.sum_prod_type]; rfl end section open Finset Classical noncomputable def physicalBareKernel {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (n : ℤ) (L R : PhysicalMarkLists P J ell) : ℂ := physicalBareLabeledScalar V patterns C ζ K a L R * ((physicalVertexWeight L (Real.sqrt q) n * physicalVertexWeight R (Real.sqrt q) (n + physicalBareStep C k a L) : ℝ) : ℂ) noncomputable def physicalBareFreeAction {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (terminal : ℤ → PhysicalMarkLists P J ell → ℂ) : ℕ → ℤ → PhysicalMarkLists P J ell → ℂ := translatedPathAction (fun r => physicalBareStep C (k r)) (fun r => physicalBareKernel V patterns C q (ζ r) (k r) (K r)) terminal section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) include G I sharedInstance1 sharedInstance2 P J ell V patterns C q ζ k K /- A radius containing every possible remaining walk makes the cutoff irrelevant, including for terms whose marks fail divisibility. -/ theorem physical_bare_action_remove_cutoff (positions : Finset ℤ) (terminal : ℤ → PhysicalMarkLists P J ell → ℂ) (r b : ℕ) (hbound : ∀ j < r, physicalOperatorStepBound P J ell patterns C (k j) ≤ b) (n : ℤ) (L : PhysicalMarkLists P J ell) (hsafe : ∀ m : ℤ, (m - n).natAbs ≤ r * b → m ∈ positions) : physicalBareAction V patterns C q ζ k K positions terminal r n L = physicalBareFreeAction V patterns C q ζ k K terminal r n L := by induction r generalizing n L with | zero => rfl | succ r ih => change _ = translatedPathAction _ _ _ (r + 1) n L rw [physicalBareAction, translatedPathAction] apply sum_congr rfl intro a _ have hs : (physicalBareStep C (k r) a L).natAbs ≤ b := (physical_bare_step_bound C (k r) a L).trans (hbound r (by omega)) have hm : n + physicalBareStep C (k r) a L ∈ positions := by apply hsafe simpa only [add_sub_cancel_left] using hs.trans (Nat.le_mul_of_pos_left b (by omega)) rw [if_pos hm] apply sum_congr rfl intro R _ change _ * physicalBareAction V patterns C q ζ k K positions terminal r _ R = _ * physicalBareFreeAction V patterns C q ζ k K terminal r _ R congr 1 apply ih (fun j hj => hbound j (by omega)) intro m hmn apply hsafe calc (m - n).natAbs = ((m - (n + physicalBareStep C (k r) a L)) + physicalBareStep C (k r) a L).natAbs := by congr 1; ring _ ≤ (m - (n + physicalBareStep C (k r) a L)).natAbs + (physicalBareStep C (k r) a L).natAbs := Int.natAbs_add_le _ _ _ ≤ r * b + b := Nat.add_le_add hmn hs _ = (r + 1) * b := by ring /- The previously constructed reachable-position cutoff is large enough for the unrestricted bare action. -/ theorem physical_bare_action_reachable (starts : Finset ℤ) (terminal : ℤ → PhysicalMarkLists P J ell → ℂ) (r b : ℕ) (hbound : ∀ j < r, physicalOperatorStepBound P J ell patterns C (k j) ≤ b) (n : ℤ) (L : PhysicalMarkLists P J ell) (hn : n ∈ starts) : physicalBareAction V patterns C q ζ k K (reachablePositions starts (r * b)) terminal r n L = physicalBareFreeAction V patterns C q ζ k K terminal r n L := by apply physical_bare_action_remove_cutoff V patterns C q ζ k K _ terminal r b hbound n L intro m hm exact mem_reachable_positions hn hm end end section open Finset theorem physical_bare_position_step {G I : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} {patterns : Finset I} (C : I → G → Finset (Fin J)) (k : ℕ → I → ℤ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges j : ℕ) (n : ℤ) : n + physicalBareOffset C k a L edges j + physicalBareStep C (k (edges - 1 - j)) (a j) (L j) = n + physicalBareOffset C k a L edges (j + 1) := by rw [physicalBareOffset] ring /- The complete bare path factors for all n. Consequently a fixed path's dependence on n is exactly the previously verified vertex product. -/ theorem physical_bare_path_factor {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (N : ℕ) (n : ℤ) : (∏ j ∈ range (N + 1), physicalBareKernel V patterns C q (ζ (N - j)) (k (N - j)) (K (N - j)) (a j) (n + physicalBareOffset C k a L (N + 1) j) (L j) (L (j + 1))) = physicalBareWalkScalar V patterns C ζ K a L (N + 1) * ((∏ j ∈ range (N + 2), physicalVertexWeight (L j) (physicalEndpointSchedule q (N + 1) j) (n + physicalBareOffset C k a L (N + 1) j) : ℝ) : ℂ) := by have he : ∀ j, n + physicalBareOffset C k a L (N + 1) j + physicalBareStep C (k (N - j)) (a j) (L j) = n + physicalBareOffset C k a L (N + 1) (j + 1) := by intro j exact physical_bare_position_step C k a L (N + 1) j n simp only [physicalBareKernel, he] rw [prod_mul_distrib, ← Complex.ofReal_prod, physical_endpoint_schedule_product L (fun j => n + physicalBareOffset C k a L (N + 1) j) hq] rfl /- The return-to-root condition is independent of the root integer. -/ theorem physical_bare_return_iff {G I : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} {patterns : Finset I} (C : I → G → Finset (Fin J)) (k : ℕ → I → ℤ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) (n : ℤ) : n + physicalBareOffset C k a L edges edges = n ↔ physicalBareOffset C k a L edges edges = 0 := by omega end section open Finset theorem translated_path_term_product {A M R : Type*} [CommMonoid R] (step : ℕ → A → M → ℤ) (E : ℕ → A → ℤ → M → M → R) (terminal : ℤ → M → R) (edges : ℕ) (a : ℕ → A) (L : ℕ → M) (position : ℕ → ℤ) (hstep : ∀ j < edges, position (j + 1) = position j + step (edges - 1 - j) (a j) (L j)) : translatedPathTerm step E terminal edges (position 0) (L 0) (fun j : Fin edges => (a j.val, L (j.val + 1))) = (∏ j ∈ range edges, E (edges - 1 - j) (a j) (position j) (L j) (L (j + 1))) * terminal (position edges) (L edges) := by induction edges generalizing a L position with | zero => simp [translatedPathTerm] | succ edges ih => have htime : ∀ j, edges + 1 - 1 - (j + 1) = edges - 1 - j := by omega have ht : ∀ j < edges, position (j + 1 + 1) = position (j + 1) + step (edges - 1 - j) (a (j + 1)) (L (j + 1)) := by intro j hj simpa only [htime] using hstep (j + 1) (by omega) have hi := ih (fun j => a (j + 1)) (fun j => L (j + 1)) (fun j => position (j + 1)) ht have hfirst : position 1 = position 0 + step edges (a 0) (L 0) := by simpa only [Nat.add_sub_cancel, Nat.sub_zero] using hstep 0 (by omega) rw [translatedPathTerm] change E edges (a 0) (position 0) (L 0) (L 1) * translatedPathTerm step E terminal edges (position 0 + step edges (a 0) (L 0)) (L 1) (fun j : Fin edges => (a (j.val + 1), L (j.val + 1 + 1))) = _ rw [← hfirst, hi, prod_range_succ'] simp only [Nat.add_sub_cancel, Nat.sub_zero, Nat.sub_sub, Nat.add_comm] ac_rfl end section def finitePathLabels {A M : Type*} {r : ℕ} (p : Fin (r + 1) → A × M) (j : ℕ) : A := if h : j < r + 1 then (p ⟨j, h⟩).1 else (p 0).1 def finitePathMarks {A M : Type*} {r : ℕ} (L : M) (p : Fin r → A × M) : ℕ → M | 0 => L | j + 1 => if h : j < r then (p ⟨j, h⟩).2 else L theorem finite_path_sequences {A M : Type*} {r : ℕ} (L : M) (p : Fin (r + 1) → A × M) : (fun j : Fin (r + 1) => (finitePathLabels p j.val, finitePathMarks L p (j.val + 1))) = p := by funext j simp only [finitePathLabels, finitePathMarks, dif_pos j.isLt] end section open Finset Classical theorem physical_free_path_expansion {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (terminal : ℤ → PhysicalMarkLists P J ell → ℂ) (r : ℕ) (n : ℤ) (L : PhysicalMarkLists P J ell) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance (∑ p : Fin r → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, translatedPathTerm (fun j => physicalBareStep C (k j)) (fun j => physicalBareKernel V patterns C q (ζ j) (k j) (K j)) terminal r n L p) = physicalBareFreeAction V patterns C q ζ k K terminal r n L := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance exact translated_path_expansion _ _ _ r n L section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) include G I sharedInstance1 sharedInstance2 P J ell V patterns C q hq ζ k K /- The original finite operator, on the complete reachable cutoff, equals the unrestricted bare action at every original starting state. -/ theorem physical_reachable_action_eq_free (starts : Finset ℤ) (terminal : ℤ → PhysicalMarkLists P J ell → ℂ) (r b : ℕ) (hbound : ∀ j < r, physicalOperatorStepBound P J ell patterns C (k j) ≤ b) (x : PhysicalState P J ell) (hx : x.1 ∈ starts) : finiteCutoffAction (physicalCutoff P J ell (reachablePositions starts (r * b))) (fun j a b => physicalSymmetricKernel (fun s t => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ j i) (k j i) (K j i) s t) a b) (fun a => terminal a.1 a.2.val) r x = physicalBareFreeAction V patterns C q ζ k K terminal r x.1 x.2.val := by have h := physical_cutoff_action_eq_bare V patterns C hq ζ k K (reachablePositions starts (r * b)) terminal r x simp only [physical_labeled_coefficient_sum] at h rw [h] exact physical_bare_action_reachable V patterns C q ζ k K starts terminal r b hbound x.1 x.2.val hx /- A bare path term, including an arbitrary terminal function, has no hidden dependence on the starting integer. -/ theorem physical_free_path_term_factor (terminal : ℤ → PhysicalMarkLists P J ell → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (N : ℕ) (n : ℤ) : translatedPathTerm (fun j => physicalBareStep C (k j)) (fun j => physicalBareKernel V patterns C q (ζ j) (k j) (K j)) terminal (N + 1) n (L 0) (fun j : Fin (N + 1) => (a j.val, L (j.val + 1))) = physicalBareWalkScalar V patterns C ζ K a L (N + 1) * ((∏ j ∈ range (N + 2), physicalVertexWeight (L j) (physicalEndpointSchedule q (N + 1) j) (n + physicalBareOffset C k a L (N + 1) j) : ℝ) : ℂ) * terminal (n + physicalBareOffset C k a L (N + 1) (N + 1)) (L (N + 1)) := by have hpos : ∀ j < N + 1, n + physicalBareOffset C k a L (N + 1) (j + 1) = (n + physicalBareOffset C k a L (N + 1) j) + physicalBareStep C (k (N + 1 - 1 - j)) (a j) (L j) := by intro j _ exact (physical_bare_position_step C k a L (N + 1) j n).symm have ht := translated_path_term_product (fun j => physicalBareStep C (k j)) (fun j => physicalBareKernel V patterns C q (ζ j) (k j) (K j)) terminal (N + 1) a L (fun j => n + physicalBareOffset C k a L (N + 1) j) hpos have hzero : n + physicalBareOffset C k a L (N + 1) 0 = n := by simp only [physicalBareOffset, add_zero] rw [hzero] at ht simp only [Nat.add_sub_cancel] at ht rw [ht, physical_bare_path_factor V patterns C hq ζ k K a L N n] end end section open Finset Classical noncomputable def physicalBareReturnScalar {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) : ℂ := if physicalBareOffset C k a L edges edges = 0 then physicalBareWalkScalar V patterns C ζ K a L edges else 0 section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) include G I sharedInstance1 sharedInstance2 P J ell V patterns C q hq ζ k K /- Every return-path term is a root-independent scalar times the nonnegative divisibility-and-damping vertex factor. -/ theorem physical_return_path_factor (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (N : ℕ) (n : ℤ) : translatedPathTerm (fun j => physicalBareStep C (k j)) (fun j => physicalBareKernel V patterns C q (ζ j) (k j) (K j)) (fun m _ => if m = n then 1 else 0) (N + 1) n (L 0) (fun j : Fin (N + 1) => (a j.val, L (j.val + 1))) = physicalBareReturnScalar V patterns C ζ k K a L (N + 1) * ((∏ j ∈ range (N + 2), physicalVertexWeight (L j) (physicalEndpointSchedule q (N + 1) j) (n + physicalBareOffset C k a L (N + 1) j) : ℝ) : ℂ) := by rw [physical_free_path_term_factor V patterns C hq ζ k K] simp only [physical_bare_return_iff, physicalBareReturnScalar] split_ifs <;> simp only [mul_one, mul_zero, zero_mul] /- The same factorization applies to every term of the finite bare path sum, using canonical extensions independent of the initial integer. -/ theorem physical_return_finite_path_factor (N : ℕ) (L₀ : PhysicalMarkLists P J ell) (p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (n : ℤ) : let a := finitePathLabels p let L := finitePathMarks L₀ p translatedPathTerm (fun j => physicalBareStep C (k j)) (fun j => physicalBareKernel V patterns C q (ζ j) (k j) (K j)) (fun m _ => if m = n then 1 else 0) (N + 1) n L₀ p = physicalBareReturnScalar V patterns C ζ k K a L (N + 1) * ((∏ j ∈ range (N + 2), physicalVertexWeight (L j) (physicalEndpointSchedule q (N + 1) j) (n + physicalBareOffset C k a L (N + 1) j) : ℝ) : ℂ) := by have h := physical_return_path_factor V patterns C hq ζ k K (finitePathLabels p) (finitePathMarks L₀ p) N n rw [finite_path_sequences] at h exact h end end section open Finset Classical section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) include G I sharedInstance1 sharedInstance2 P J ell V patterns C theorem physical_free_action_zero_of_invalid (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (terminal : ℤ → PhysicalMarkLists P J ell → ℂ) (r : ℕ) (n : ℤ) (L : PhysicalMarkLists P J ell) (h : ¬ ∀ g s, ((L g s).val : ℤ) ∣ n) : physicalBareFreeAction V patterns C q ζ k K terminal (r + 1) n L = 0 := by unfold physicalBareFreeAction rw [translatedPathAction] apply sum_eq_zero intro a _ apply sum_eq_zero intro R _ simp only [physicalBareKernel, physicalVertexWeight, if_neg h, zero_mul, Complex.ofReal_zero, mul_zero] /- The unnormalized root moment sums all admissible initial lists. After reindexing, all bare initial lists may be used with zero weights for the inadmissible ones. -/ theorem physical_initial_return_sum_eq_free {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (starts : Finset ℤ) (r b : ℕ) (hbound : ∀ j < r + 1, physicalOperatorStepBound P J ell patterns C (k j) ≤ b) (n : ℤ) (hn : n ∈ starts) : (∑ L : PhysicalMarksAt P J ell n, finiteCutoffAction (physicalCutoff P J ell (reachablePositions starts ((r + 1) * b))) (fun j a b => physicalSymmetricKernel (fun s t => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ j i) (k j i) (K j i) s t) a b) (fun a => if a.1 = n then 1 else 0) (r + 1) ⟨n, L⟩) = ∑ L : PhysicalMarkLists P J ell, physicalBareFreeAction V patterns C q ζ k K (fun m _ => if m = n then 1 else 0) (r + 1) n L := by calc _ = ∑ L : PhysicalMarksAt P J ell n, physicalBareFreeAction V patterns C q ζ k K (fun m _ => if m = n then 1 else 0) (r + 1) n L.val := by apply sum_congr rfl intro L _ exact physical_reachable_action_eq_free V patterns C hq ζ k K starts (fun m _ => if m = n then 1 else 0) (r + 1) b hbound ⟨n, L⟩ hn _ = _ := by apply physical_marks_sum_all P J ell n intro L h exact physical_free_action_zero_of_invalid V patterns C q ζ k K _ r n L h end end section open Finset Classical noncomputable def physicalFiniteReturnScalar {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : ℂ := physicalBareReturnScalar V patterns C ζ k K (finitePathLabels p) (finitePathMarks L p) (r + 1) noncomputable def physicalFiniteVertexProduct {G I : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} {patterns : Finset I} (C : I → G → Finset (Fin J)) (q : ℝ) (k : ℕ → I → ℤ) (r : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (n : ℤ) : ℝ := ∏ j ∈ range (r + 2), physicalVertexWeight (finitePathMarks L p j) (physicalEndpointSchedule q (r + 1) j) (n + physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (r + 1) j) theorem physical_free_return_factor_sum {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : ℕ) (n : ℤ) (L : PhysicalMarkLists P J ell) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance physicalBareFreeAction V patterns C q ζ k K (fun m _ => if m = n then 1 else 0) (r + 1) n L = ∑ p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, physicalFiniteReturnScalar V patterns C ζ k K r L p * (physicalFiniteVertexProduct C q k r L p n : ℂ) := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance rw [← physical_free_path_expansion] apply sum_congr rfl intro p _ exact physical_return_finite_path_factor V patterns C hq ζ k K r L p n end section open Finset Classical theorem complex_average_finite_sum {A X : Type*} (roots : Finset X) (terms : Finset A) (c : A → ℂ) (w : A → X → ℝ) (denominator : ℝ) : ((∑ n ∈ roots, ∑ a ∈ terms, c a * (w a n : ℂ)) / (denominator : ℂ)) = ∑ a ∈ terms, c a * (((∑ n ∈ roots, w a n) / denominator : ℝ) : ℂ) := by rw [sum_comm, sum_div] apply sum_congr rfl intro a _ simp only [Complex.ofReal_div, Complex.ofReal_sum] rw [← mul_sum, mul_div_assoc] noncomputable def physicalRootMoment {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (starts : Finset ℤ) (r b : ℕ) : ℂ := (physicalStateMass V J ell : ℂ) * (∑ n ∈ starts, ∑ L : PhysicalMarksAt P J ell n, finiteCutoffAction (physicalCutoff P J ell (reachablePositions starts ((r + 1) * b))) (fun j a b => physicalSymmetricKernel (fun s t => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ j i) (k j i) (K j i) s t) a b) (fun a => if a.1 = n then 1 else 0) (r + 1) ⟨n, L⟩) / (starts.card : ℂ) /- This is an identity for the actual physical root moment, not an assumption about a proposed path expansion. -/ theorem physical_root_moment_as_vertex_averages {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (starts : Finset ℤ) (r b : ℕ) (hbound : ∀ j < r + 1, physicalOperatorStepBound P J ell patterns C (k j) ≤ b) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance physicalRootMoment V patterns C q ζ k K starts r b = (physicalStateMass V J ell : ℂ) * ∑ L : PhysicalMarkLists P J ell, ∑ p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, physicalFiniteReturnScalar V patterns C ζ k K r L p * (((∑ n ∈ starts, physicalFiniteVertexProduct C q k r L p n) / (starts.card : ℝ) : ℝ) : ℂ) := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance unfold physicalRootMoment rw [mul_div_assoc] congr 1 have he : (∑ n ∈ starts, ∑ L : PhysicalMarksAt P J ell n, finiteCutoffAction (physicalCutoff P J ell (reachablePositions starts ((r + 1) * b))) (fun j a b => physicalSymmetricKernel (fun s t => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ j i) (k j i) (K j i) s t) a b) (fun a => if a.1 = n then 1 else 0) (r + 1) ⟨n, L⟩) = ∑ n ∈ starts, ∑ L : PhysicalMarkLists P J ell, ∑ p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, physicalFiniteReturnScalar V patterns C ζ k K r L p * (physicalFiniteVertexProduct C q k r L p n : ℂ) := by apply sum_congr rfl intro n hn rw [physical_initial_return_sum_eq_free V patterns C hq ζ k K starts r b hbound n hn] apply sum_congr rfl intro L _ exact physical_free_return_factor_sum V patterns C hq ζ k K r n L rw [he, sum_comm, sum_div] apply sum_congr rfl intro L _ exact complex_average_finite_sum starts univ (physicalFiniteReturnScalar V patterns C ζ k K r L) (physicalFiniteVertexProduct C q k r L) (starts.card : ℝ) end section open Finset Classical noncomputable def physicalFiniteVertexExpectation {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} {patterns : Finset I} (C : I → G → Finset (Fin J)) (q : ℝ) (k : ℕ → I → ℤ) (r : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : ℝ := poolPathResidueExpectation (fun v : PhysicalPrime P => v.2.val) univ (range (r + 2)) (fun v => (range (r + 2)).filter (fun j => v ∈ physicalMarkedPrimes (finitePathMarks L p j))) (fun v j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (r + 1) j : ZMod v.2.val)) (fun j => 1 - physicalEndpointSchedule q (r + 1) j) noncomputable def physicalRootResidueModel {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : ℕ) : ℂ := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance exact (physicalStateMass V J ell : ℂ) * ∑ L : PhysicalMarkLists P J ell, ∑ p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, physicalFiniteReturnScalar V patterns C ζ k K r L p * (physicalFiniteVertexExpectation C q k r L p : ℂ) theorem complex_double_path_error_bound {A B : Type*} [Fintype A] [Fintype B] (c : A → B → ℂ) (actual expected : A → B → ℝ) (ε : ℝ) (h : ∀ a b, |actual a b - expected a b| ≤ ε * expected a b) : ‖(∑ a, ∑ b, c a b * (actual a b : ℂ)) - ∑ a, ∑ b, c a b * (expected a b : ℂ)‖ ≤ ε * ∑ a, ∑ b, ‖c a b‖ * expected a b := by simpa only [Fintype.sum_prod_type] using complex_path_error_bound (univ : Finset (A × B)) (fun p => c p.1 p.2) (fun p => actual p.1 p.2) (fun p => expected p.1 p.2) ε (fun p _ => h p.1 p.2) /- The per-path relative replacement controls the actual root moment, with the exact expected absolute path mass as its only multiplicative loss. -/ theorem physical_root_replacement_error {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (starts : Finset ℤ) (r b : ℕ) (hbound : ∀ j < r + 1, physicalOperatorStepBound P J ell patterns C (k j) ≤ b) (ε : ℝ) (herror : ∀ (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell), |(∑ n ∈ starts, physicalFiniteVertexProduct C q k r L p n) / (starts.card : ℝ) - physicalFiniteVertexExpectation C q k r L p| ≤ ε * physicalFiniteVertexExpectation C q k r L p) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance ‖physicalRootMoment V patterns C q ζ k K starts r b - physicalRootResidueModel V patterns C q ζ k K r‖ ≤ ε * (physicalStateMass V J ell * ∑ L : PhysicalMarkLists P J ell, ∑ p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, ‖physicalFiniteReturnScalar V patterns C ζ k K r L p‖ * physicalFiniteVertexExpectation C q k r L p) := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance rw [physical_root_moment_as_vertex_averages V patterns C hq ζ k K starts r b hbound] unfold physicalRootResidueModel rw [← mul_sub, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (physical_state_mass_pos V hV J ell).le] have h := complex_double_path_error_bound (physicalFiniteReturnScalar V patterns C ζ k K r) (fun L p => (∑ n ∈ starts, physicalFiniteVertexProduct C q k r L p n) / (starts.card : ℝ)) (physicalFiniteVertexExpectation C q k r) ε herror exact (mul_le_mul_of_nonneg_left h (physical_state_mass_pos V hV J ell).le).trans_eq (by ring) end section open Filter Finset theorem eventually_physical_finite_vertex_replacement {a c d C V E γ : ℝ} (ha : 0 ≤ a) (hc : 0 < c) (hd : 0 < d) (had : a + d < 1) (hC : 0 < C) (hV : 0 < V) (hE : 0 ≤ E) (hγ : 0 < γ) (J ell : ℕ) : ∀ᶠ T : ℝ in atTop, ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] (I : Type) (patterns : Finset I) (pattern : I → G → Finset (Fin J)) (k : ℕ → I → ℤ) (r : ℕ), r + 1 = 2 * Nat.ceil (T^a) → ∀ (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns pattern × PhysicalMarkLists P J ell) (q : ℝ) (N : ℕ) (z : ℤ), Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime) → (Fintype.card G : ℝ) ≤ C * Real.log T → (∀ g, (∑ p ∈ P g, 1 / (p : ℝ)) ≤ V) → (∀ g p, p ∈ P g → Real.exp (T^c) ≤ (p : ℝ)) → (∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp (T^d)) → 0 ≤ q → q ≤ 1 → 0 < N → γ * T ≤ Real.log (N : ℝ) → |(∑ n ∈ Ico z (z + N), physicalFiniteVertexProduct pattern q k r L p n) / (N : ℝ) - physicalFiniteVertexExpectation pattern q k r L p| ≤ Real.exp (-E * (r + 1) * Real.log T) * physicalFiniteVertexExpectation pattern q k r L p := by filter_upwards [eventually_physical_vertex_replacement ha hc hd had hC hV hE hγ J ell] with T hT intro G _ _ P _ I patterns pattern k r hlen L p q N z hdis hprime hs hH hmin hmax hq0 hq1 hN hNb have hh := hT G P (finitePathMarks L p) (physicalBareOffset pattern k (finitePathLabels p) (finitePathMarks L p) (r + 1)) (physicalEndpointSchedule q (r + 1)) N z dsimp only at hh rw [← hlen] at hh simpa only [physicalFiniteVertexProduct, physicalFiniteVertexExpectation, Nat.cast_add, Nat.cast_one] using hh hdis hprime hs hH hmin hmax (fun j _ => physical_endpoint_schedule_unit hq0 hq1 (r + 1) j) hN hNb end section /- A nonzero integer whose absolute value is smaller than `p` is not divisible by `p`. No primality assumption is needed. -/ theorem nat_not_dvd_int_of_natAbs_lt {p : ℕ} {k : ℤ} (hkpos : 0 < k.natAbs) (hklt : k.natAbs < p) : ¬ (p : ℤ) ∣ k := by intro h exact (not_le_of_gt hklt) (Nat.le_of_dvd hkpos (Int.natCast_dvd.mp h)) /- If a prime divides both endpoints of a dilation step and does not divide the step coefficient, it divides the natural-number dilation factor. -/ theorem nat_prime_dvd_dilation_of_dvd_endpoints {p D : ℕ} {n k : ℤ} (hp : Nat.Prime p) (hk : ¬ (p : ℤ) ∣ k) (hn : (p : ℤ) ∣ n) (htarget : (p : ℤ) ∣ n + k * (D : ℤ)) : p ∣ D := by have hproduct : (p : ℤ) ∣ k * (D : ℤ) := by simpa only [add_sub_cancel_left] using dvd_sub htarget hn exact Int.natCast_dvd_natCast.mp (((Nat.prime_iff_prime_int.mp hp).dvd_or_dvd hproduct).resolve_left hk) section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) {x y : PhysicalState P J ell} (hadm : physicalAdmissible C aux k x y) include G sharedInstance1 P J ell C aux k x y hadm /- A prime marked at both endpoints divides the dilation, provided it does not divide the step coefficient. The two marks may have different groups and slots. -/ theorem physical_common_mark_dvd_D_of_prime (g h : G) (s t : PhysicalSlots J ell) (heq : (x.2.val g s).val = (y.2.val h t).val) (hp : Nat.Prime (x.2.val g s).val) (hk : ¬ ((x.2.val g s).val : ℤ) ∣ k) : (x.2.val g s).val ∣ physicalD C x.2.val aux := by apply nat_prime_dvd_dilation_of_dvd_endpoints hp hk (x.2.property g s) rw [← hadm.2.2.2, heq] exact y.2.property h t /- The common-mark criterion for prime pools. -/ theorem physical_common_mark_dvd_D (hP : ∀ g p, p ∈ P g → Nat.Prime p) (g h : G) (s t : PhysicalSlots J ell) (heq : (x.2.val g s).val = (y.2.val h t).val) (hk : ¬ ((x.2.val g s).val : ℤ) ∣ k) : (x.2.val g s).val ∣ physicalD C x.2.val aux := physical_common_mark_dvd_D_of_prime C aux k hadm g h s t heq (hP g _ (x.2.val g s).property) hk end end section open Finset theorem physical_mem_shared_slots_iff {J ell : ℕ} (C : Finset (Fin J)) (s : PhysicalSlots J ell) : s ∈ physicalSharedSlots C ↔ ∃ j : Fin J, j ∉ C ∧ s = Sum.inl j := by simp only [physicalSharedSlots, mem_map, mem_sdiff, mem_univ, true_and] constructor · rintro ⟨j, hj, he⟩ exact ⟨j, hj, he.symm⟩ · rintro ⟨j, hj, he⟩ exact ⟨j, hj, he.symm⟩ /- Every prime divisor of the dilation is a shared label or a sampled auxiliary label. The auxiliary labels need not be distinct. -/ theorem physical_prime_dvd_D_iff {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (hP : ∀ g p, p ∈ P g → Nat.Prime p) {p : ℕ} (hp : Nat.Prime p) : p ∣ physicalD C labels aux ↔ (∃ g j, j ∉ C g ∧ p = (labels g (Sum.inl j)).val) ∨ (∃ (g : G) (j : C g), p = (aux g j).val) := by classical constructor · intro hd obtain ⟨g, _, hg⟩ := (hp.prime.dvd_finsetProd_iff _).mp hd rcases hp.dvd_mul.mp hg with hs | ha · obtain ⟨j, hj, hjp⟩ := (hp.prime.dvd_finsetProd_iff _).mp hs exact Or.inl ⟨g, j, (mem_sdiff.mp hj).2, ((Nat.dvd_prime (hP g _ (labels g (Sum.inl j)).property)).mp hjp).resolve_left hp.ne_one⟩ · obtain ⟨j, _, hjp⟩ := (hp.prime.dvd_finsetProd_iff _).mp ha exact Or.inr ⟨g, j, ((Nat.dvd_prime (hP g _ (aux g j).property)).mp hjp).resolve_left hp.ne_one⟩ · rintro (⟨g, j, hj, rfl⟩ | ⟨g, j, rfl⟩) · exact physical_shared_label_dvd_D C labels aux g j hj · apply dvd_trans _ (dvd_prod_of_mem (fun g => physicalGroupD C labels aux g) (mem_univ g)) exact dvd_mul_of_dvd_right (dvd_prod_of_mem (fun j : C g => (aux g j).val) (mem_univ j)) _ /- Equality of values of endpoint labels in disjoint groups determines the group, even when the two mark lists differ. -/ theorem physical_mark_value_eq_group {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (src tgt : PhysicalMarkLists P J ell) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) {g h : G} {s t : PhysicalSlots J ell} (he : (src g s).val = (tgt h t).val) : g = h := by by_contra hne apply disjoint_left.mp (hdis hne) (src g s).property rw [he] exact (tgt h t).property /- For an endpoint satisfying the auxiliary ban, the marked primes dividing the dilation are precisely its prescribed shared slots. -/ theorem physical_mark_dvd_D_iff_shared {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (havoid : physicalAuxAvoids C aux labels) (g : G) (s : PhysicalSlots J ell) : (labels g s).val ∣ physicalD C labels aux ↔ s ∈ physicalSharedSlots (C g) := by classical rw [physical_mem_shared_slots_iff] constructor · intro hd rcases (physical_prime_dvd_D_iff C labels aux hP (hP g _ (labels g s).property)).mp hd with ⟨h, j, hj, he⟩ | ⟨h, j, he⟩ · have hgh : g = h := physical_mark_value_eq_group labels labels hdis he subst h exact ⟨j, hj, (labels g).injective (Subtype.ext he)⟩ · exact False.elim (((physical_aux_avoids_global_iff C aux labels hdis).mp havoid) h j g s he.symm) · rintro ⟨j, hj, rfl⟩ exact physical_shared_label_dvd_D C labels aux g j hj /- A prime marked at both endpoints must occupy the same prescribed shared slot, provided the prime does not divide the step coefficient. -/ theorem physical_common_mark_shared {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) {x y : PhysicalState P J ell} (hadm : physicalAdmissible C aux k x y) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g h : G) (s t : PhysicalSlots J ell) (he : (x.2.val g s).val = (y.2.val h t).val) (hk : ¬ ((x.2.val g s).val : ℤ) ∣ k) : g = h ∧ s = t ∧ s ∈ physicalSharedSlots (C g) := by have hd := physical_common_mark_dvd_D C aux k hadm hP g h s t he hk have hs := (physical_mark_dvd_D_iff_shared C x.2.val aux hP hdis hadm.2.1 g s).mp hd have hgh : g = h := physical_mark_value_eq_group x.2.val y.2.val hdis he subst h obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff (C g) s).mp hs have hcopy := hadm.1 g j hj have hst : Sum.inl j = t := (y.2.val g).injective (by rw [← hcopy]; exact Subtype.ext he) exact ⟨rfl, hst, hs⟩ /- An unshared source mark cannot divide the dilation. -/ theorem physical_unshared_mark_not_dvd_D {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (havoid : physicalAuxAvoids C aux labels) (g : G) (s : PhysicalSlots J ell) (hs : s ∈ physicalUnsharedSlots (C g)) : ¬ (labels g s).val ∣ physicalD C labels aux := by intro hd exact (mem_compl.mp hs) ((physical_mark_dvd_D_iff_shared C labels aux hP hdis havoid g s).mp hd) end section open Finset open scoped Classical /- The tagged primes occupying the prescribed shared slots. -/ def physicalSharedPrimes {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) : Finset (PhysicalPrime P) := (univ.filter (fun a : Σ _g : G, PhysicalSlots J ell => a.2 ∈ physicalSharedSlots (C a.1))).map (physicalMarkInjection labels) /- Membership in the tagged shared set is witnessed by a shared slot in the tag's own group. -/ theorem mem_physical_shared_primes {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (p : PhysicalPrime P) : p ∈ physicalSharedPrimes C labels ↔ ∃ s, s ∈ physicalSharedSlots (C p.1) ∧ (labels p.1 s).val = p.2.val := by rcases p with ⟨g, p⟩ constructor · intro hp obtain ⟨⟨h, s⟩, hs, he⟩ := mem_map.mp hp change (⟨h, labels h s⟩ : PhysicalPrime P) = ⟨g, p⟩ at he have hg : h = g := congrArg Sigma.fst he cases hg exact ⟨s, (mem_filter.mp hs).2, congrArg Subtype.val (eq_of_heq (Sigma.mk.inj_iff.mp he).2)⟩ · rintro ⟨s, hs, he⟩ apply mem_map.mpr refine ⟨⟨g, s⟩, mem_filter.mpr ⟨mem_univ _, hs⟩, ?_⟩ change (⟨g, labels g s⟩ : PhysicalPrime P) = ⟨g, p⟩ exact congrArg (Sigma.mk g) (Subtype.ext he) /- Every tagged shared prime is marked. -/ theorem physical_shared_primes_subset_marked {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) : physicalSharedPrimes C labels ⊆ physicalMarkedPrimes labels := by intro p hp obtain ⟨s, _, he⟩ := (mem_physical_shared_primes C labels p).mp hp rw [mem_physical_marked_primes, mem_physical_group_marks] exact ⟨s, he⟩ /- Compatible endpoint lists have the same tagged shared primes. -/ theorem physical_shared_primes_eq_of_compatible {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) {src tgt : PhysicalMarkLists P J ell} (hshared : physicalSharedCompatible C src tgt) : physicalSharedPrimes C src = physicalSharedPrimes C tgt := by have forward : ∀ (a b : PhysicalMarkLists P J ell), physicalSharedCompatible C a b → physicalSharedPrimes C a ⊆ physicalSharedPrimes C b := by intro a b hab p hp obtain ⟨s, hs, he⟩ := (mem_physical_shared_primes C a p).mp hp obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff (C p.1) s).mp hs apply (mem_physical_shared_primes C b p).mpr exact ⟨Sum.inl j, hs, (congrArg Subtype.val (hab p.1 j hj)).symm.trans he⟩ exact Subset.antisymm (forward src tgt hshared) (forward tgt src (physical_shared_compatible_symm C hshared)) end section open Finset /- The natural prime values in the shared slots of one group. -/ def physicalGroupSharedPrimes {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (g : G) : Finset ℕ := (physicalSharedSlots (C g)).map (physicalGroupMarkEmbedding labels g) theorem mem_physical_group_shared_primes {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (g : G) (p : ℕ) : p ∈ physicalGroupSharedPrimes C labels g ↔ ∃ s, s ∈ physicalSharedSlots (C g) ∧ (labels g s).val = p := by simp only [physicalGroupSharedPrimes, mem_map] rfl /- Injectivity of each group's mark list preserves the shared-slot count. -/ theorem physical_group_shared_primes_card {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (g : G) : (physicalGroupSharedPrimes C labels g).card = J - (C g).card := by simp only [physicalGroupSharedPrimes, card_map, physical_shared_slots_card] /- The groupwise primes common to both endpoints are exactly the shared source primes. Nondivisibility is needed only for this source group. -/ theorem physical_group_marks_inter_eq_shared {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) {x y : PhysicalState P J ell} (hadm : physicalAdmissible C aux k x y) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ s, ¬ ((x.2.val g s).val : ℤ) ∣ k) : physicalGroupMarks x.2.val g ∩ physicalGroupMarks y.2.val g = physicalGroupSharedPrimes C x.2.val g := by ext p rw [mem_inter, mem_physical_group_marks, mem_physical_group_marks, mem_physical_group_shared_primes] constructor · rintro ⟨⟨s, hs⟩, ⟨t, ht⟩⟩ have hcommon := physical_common_mark_shared C aux k hadm hP hdis g g s t (hs.trans ht.symm) (hk s) exact ⟨s, hcommon.2.2, hs⟩ · rintro ⟨s, hs, he⟩ obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff (C g) s).mp hs exact ⟨⟨Sum.inl j, he⟩, ⟨Sum.inl j, (congrArg Subtype.val (hadm.1 g j hj)).symm.trans he⟩⟩ /- Exactly the unshared-slot count of new primes appears at the target. -/ theorem physical_group_new_marks_card {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) {x y : PhysicalState P J ell} (hadm : physicalAdmissible C aux k x y) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ s, ¬ ((x.2.val g s).val : ℤ) ∣ k) : (physicalGroupMarks y.2.val g \ physicalGroupMarks x.2.val g).card = ell + (C g).card := by rw [card_sdiff, physical_group_marks_inter_eq_shared C aux k hadm hP hdis g hk, physical_group_marks_card, physical_group_shared_primes_card] have hc : (C g).card ≤ J := by simpa only [Fintype.card_fin] using card_le_univ (C g) omega /- Permuting slots leaves the set of marked prime values unchanged. -/ theorem physical_group_marks_permute {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations G J ell) (labels : PhysicalMarkLists P J ell) (g : G) : physicalGroupMarks (physicalPermuteLabels σ labels) g = physicalGroupMarks labels g := by ext p rw [mem_physical_group_marks, mem_physical_group_marks] constructor · rintro ⟨s, hs⟩ exact ⟨σ g s, hs⟩ · rintro ⟨s, hs⟩ refine ⟨(σ g).symm s, ?_⟩ simpa only [physicalPermuteLabels, Function.Embedding.trans_apply, Equiv.toEmbedding_apply, Equiv.apply_symm_apply] using hs end section open Finset section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (L R : PhysicalMarkLists P J ell) (hlist : physicalListAdmissible C aux L R) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) include G sharedInstance1 P J ell C aux k L R hlist hP hdis /- A common prime of two structurally compatible lists occupies the same shared slot when it divides the step but does not divide its coefficient. -/ theorem physical_bare_common_mark_shared (g : G) (s t : PhysicalSlots J ell) (he : (L g s).val = (R g t).val) (hstep : ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) (hk : ¬ ((L g s).val : ℤ) ∣ k) : s = t ∧ s ∈ physicalSharedSlots (C g) := by have hp := hP g _ (L g s).property have hd : (L g s).val ∣ physicalD C L aux := Int.natCast_dvd_natCast.mp (((Nat.prime_iff_prime_int.mp hp).dvd_or_dvd hstep).resolve_left hk) have hs := (physical_mark_dvd_D_iff_shared C L aux hP hdis hlist.2.1 g s).mp hd obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff (C g) s).mp hs have hcopy := hlist.1 g j hj have hst : Sum.inl j = t := (R g).injective (by rw [← hcopy] exact Subtype.ext he) exact ⟨hst, hs⟩ /- The common prime values of a bare edge are exactly its shared source values, assuming divisibility compatibility for each common mark. -/ theorem physical_bare_group_marks_inter_eq_shared (hcompat : ∀ g s t, (L g s).val = (R g t).val → ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) (g : G) (hk : ∀ s, ¬ ((L g s).val : ℤ) ∣ k) : physicalGroupMarks L g ∩ physicalGroupMarks R g = physicalGroupSharedPrimes C L g := by ext p rw [mem_inter, mem_physical_group_marks, mem_physical_group_marks, mem_physical_group_shared_primes] constructor · rintro ⟨⟨s, hs⟩, ⟨t, ht⟩⟩ have he := hs.trans ht.symm exact ⟨s, (physical_bare_common_mark_shared C aux k L R hlist hP hdis g s t he (hcompat g s t he) (hk s)).2, hs⟩ · rintro ⟨s, hs, he⟩ obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff (C g) s).mp hs exact ⟨⟨Sum.inl j, he⟩, ⟨Sum.inl j, (congrArg Subtype.val (hlist.1 g j hj)).symm.trans he⟩⟩ /- The new-prime count of a compatible bare edge. -/ theorem physical_bare_group_new_marks_card (hcompat : ∀ g s t, (L g s).val = (R g t).val → ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) (g : G) (hk : ∀ s, ¬ ((L g s).val : ℤ) ∣ k) : (physicalGroupMarks R g \ physicalGroupMarks L g).card = ell + (C g).card := by rw [card_sdiff, physical_bare_group_marks_inter_eq_shared C aux k L R hlist hP hdis hcompat g hk, physical_group_marks_card, physical_group_shared_primes_card] have hc : (C g).card ≤ J := by simpa only [Fintype.card_fin] using card_le_univ (C g) omega end /- If the same tagged residue satisfies the marked constraints at two offsets, the common prime divides the difference of the offsets. -/ theorem physical_common_mark_step_dvd_of_residues {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (L R : PhysicalMarkLists P J ell) (ρ : ∀ p : PhysicalPrime P, ZMod p.2.val) (a step : ℤ) (hL : ∀ p ∈ physicalMarkedPrimes L, ρ p = -(a : ZMod p.2.val)) (hR : ∀ p ∈ physicalMarkedPrimes R, ρ p = -((a + step : ℤ) : ZMod p.2.val)) (g : G) (s t : PhysicalSlots J ell) (he : (L g s).val = (R g t).val) : ((L g s).val : ℤ) ∣ step := by let p : PhysicalPrime P := ⟨g, L g s⟩ have hpL : p ∈ physicalMarkedPrimes L := by rw [mem_physical_marked_primes, mem_physical_group_marks] exact ⟨s, rfl⟩ have hpR : p ∈ physicalMarkedPrimes R := by rw [mem_physical_marked_primes, mem_physical_group_marks] exact ⟨t, he.symm⟩ have hcast : (a : ZMod p.2.val) = ((a + step : ℤ) : ZMod p.2.val) := neg_injective ((hL p hpL).symm.trans (hR p hpR)) have hd := (ZMod.intCast_eq_intCast_iff_dvd_sub a (a + step) p.2.val).mp hcast simpa only [add_sub_cancel_left] using hd /- Mark constraints in an independent residue tuple supply exactly the bare-edge compatibility hypothesis used in the new-prime count. -/ theorem physical_bare_step_compatibility_of_residues {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (L R : PhysicalMarkLists P J ell) (ρ : ∀ p : PhysicalPrime P, ZMod p.2.val) (a : ℤ) (hL : ∀ p ∈ physicalMarkedPrimes L, ρ p = -(a : ZMod p.2.val)) (hR : ∀ p ∈ physicalMarkedPrimes R, ρ p = -((a + k * (physicalD C L aux : ℤ) : ℤ) : ZMod p.2.val)) : ∀ g s t, (L g s).val = (R g t).val → ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ) := physical_common_mark_step_dvd_of_residues L R ρ a (k * (physicalD C L aux : ℤ)) hL hR end section open Finset /- Number of active runs of a label during `edges + 1` visits. -/ def activeRunCount {α : Type*} [DecidableEq α] (A : ℕ → Finset α) (edges : ℕ) (p : α) : ℕ := (if p ∈ A 0 then 1 else 0) + ∑ j ∈ range edges, if p ∈ A (j + 1) \ A j then 1 else 0 /- Summing the membership indicator over an ambient pool gives the subset's cardinality. -/ theorem sum_mem_indicator_of_subset {α : Type*} [DecidableEq α] (pool s : Finset α) (hs : s ⊆ pool) : (∑ p ∈ pool, if p ∈ s then (1 : ℕ) else 0) = s.card := by rw [← sum_filter] have he : pool.filter (fun p => p ∈ s) = s := by ext p simp only [mem_filter] exact ⟨fun h => h.2, fun h => ⟨hs h, h⟩⟩ simp only [he, sum_const, smul_eq_mul, mul_one] /- Total run count equals initial cardinality plus all subsequent entries. -/ theorem sum_activeRunCount {α : Type*} [DecidableEq α] (pool : Finset α) (A : ℕ → Finset α) (edges : ℕ) (hA : ∀ j ≤ edges, A j ⊆ pool) : (∑ p ∈ pool, activeRunCount A edges p) = (A 0).card + ∑ j ∈ range edges, (A (j + 1) \ A j).card := by simp only [activeRunCount, sum_add_distrib] rw [sum_mem_indicator_of_subset pool (A 0) (hA 0 (Nat.zero_le edges)), sum_comm] congr 1 apply sum_congr rfl intro j hj apply sum_mem_indicator_of_subset exact subset_trans sdiff_subset (hA (j + 1) (by simpa using mem_range.mp hj)) end section open Finset /- The state and completion measures collect into one inverse harmonic mass per initial mark and per newly introduced mark. -/ theorem physical_path_mass_grouped {G : Type*} [Fintype G] {J : ℕ} (V : G → ℝ) (C : ℕ → G → Finset (Fin J)) (ell edges : ℕ) : physicalStateMass V J ell * (∏ j ∈ range edges, physicalCompletionMass V (C j) ell) = ∏ g, (1 / V g) ^ ((J + ell) + ∑ j ∈ range edges, (ell + (C j g).card)) := by unfold physicalStateMass physicalCompletionMass simp only [one_div, ← inv_pow] rw [prod_comm (s := range edges) (t := univ), ← prod_mul_distrib] apply prod_congr rfl intro g hg rw [prod_pow_eq_pow_sum, ← pow_add] /- Sum of the run counts in a group, using the exact number of new marks on every edge. -/ theorem physical_group_run_count {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (L : ℕ → PhysicalMarkLists P J ell) (C : ℕ → G → Finset (Fin J)) (edges : ℕ) (g : G) (hnew : ∀ j < edges, (physicalGroupMarks (L (j + 1)) g \ physicalGroupMarks (L j) g).card = ell + (C j g).card) : (∑ p ∈ P g, activeRunCount (fun j => physicalGroupMarks (L j) g) edges p) = (J + ell) + ∑ j ∈ range edges, (ell + (C j g).card) := by rw [sum_activeRunCount (P g) _ edges (fun j _ => physical_group_marks_subset (L j) g), physical_group_marks_card] congr 1 apply sum_congr rfl intro j hj exact hnew j (mem_range.mp hj) end section open scoped BigOperators open MeasureTheory /- Fourier phase attached to an integer displacement. -/ noncomputable def physicalReturnPhase (θ : ℝ) (h : ℤ) : ℂ := Complex.exp (2 * (Real.pi : ℂ) * Complex.I * (θ : ℂ) * (h : ℂ)) theorem physicalReturnPhase_zero (θ : ℝ) : physicalReturnPhase θ 0 = 1 := by simp [physicalReturnPhase] theorem physicalReturnPhase_add (θ : ℝ) (h k : ℤ) : physicalReturnPhase θ (h + k) = physicalReturnPhase θ h * physicalReturnPhase θ k := by simp only [physicalReturnPhase, Int.cast_add, mul_add, Complex.exp_add] theorem physicalReturnPhase_continuous (h : ℤ) : Continuous (fun θ : ℝ => physicalReturnPhase θ h) := by unfold physicalReturnPhase fun_prop theorem physicalReturnPhase_intervalIntegrable (h : ℤ) (a b : ℝ) : IntervalIntegrable (fun θ : ℝ => physicalReturnPhase θ h) volume a b := (physicalReturnPhase_continuous h).intervalIntegrable a b /- Exact orthogonality on one period: integration retains precisely zero displacement. -/ theorem physicalReturnPhase_integral (h : ℤ) : (∫ θ : ℝ in (0 : ℝ)..1, physicalReturnPhase θ h) = if h = 0 then 1 else 0 := by by_cases hh : h = 0 · subst h simp [physicalReturnPhase_zero] · have hc : (h : ℂ) * (2 * (Real.pi : ℂ) * Complex.I) ≠ 0 := by exact mul_ne_zero (by exact_mod_cast hh) Complex.two_pi_I_ne_zero have he : (fun θ : ℝ => physicalReturnPhase θ h) = (fun θ : ℝ => Complex.exp (((h : ℂ) * (2 * (Real.pi : ℂ) * Complex.I)) * θ)) := by funext θ unfold physicalReturnPhase congr 1 ring rw [he, integral_exp_mul_complex hc] simp [hh, Complex.exp_int_mul_two_pi_mul_I] /- Product of edge phases equals the phase of total displacement. -/ theorem physicalReturnPhase_finset_sum {E : Type*} (edges : Finset E) (offset : E → ℤ) (θ : ℝ) : physicalReturnPhase θ (∑ e ∈ edges, offset e) = ∏ e ∈ edges, physicalReturnPhase θ (offset e) := by classical induction edges using Finset.induction_on with | empty => simp [physicalReturnPhase_zero] | @insert e edges he ih => simp [Finset.sum_insert he, Finset.prod_insert he, physicalReturnPhase_add, ih] end section open Finset Classical open MeasureTheory section variable {G I : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} {patterns : Finset I} (C : I → G → Finset (Fin J)) (k : ℕ → I → ℤ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges j : ℕ) include G I sharedInstance1 P J ell patterns C k a L edges j theorem physical_bare_offset_eq_sum : physicalBareOffset C k a L edges j = ∑ t ∈ range j, physicalBareStep C (k (edges - 1 - t)) (a t) (L t) := by induction j with | zero => simp [physicalBareOffset] | succ j ih => simp [physicalBareOffset, sum_range_succ, ih] theorem physical_bare_offset_phase_eq_prod (θ : ℝ) : physicalReturnPhase θ (physicalBareOffset C k a L edges j) = ∏ t ∈ range j, physicalReturnPhase θ (physicalBareStep C (k (edges - 1 - t)) (a t) (L t)) := by rw [physical_bare_offset_eq_sum, physicalReturnPhase_finset_sum] end end section open Finset abbrev GhostFiniteState (R : Type*) := Option (Option R) /- Initial mass is concentrated at the unborn state. -/ def ghostFiniteInitial {R : Type*} : GhostFiniteState R → ℝ | none => 1 | some _ => 0 /- The first state argument is the output, the second is the input. This orientation makes `finitePathAction` propagate distributions forward. -/ noncomputable def ghostFiniteKernel {R : Type*} [DecidableEq R] (hit : R) (η β : ℝ) : GhostFiniteState R → GhostFiniteState R → ℝ | none, none => 1 | none, some _ => 0 | some none, none => 0 | some none, some none => 1 | some none, some (some r) => if r = hit then -η else 0 | some (some r), none => if r = hit then -β * η else 0 | some (some _), some none => 0 | some (some r), some (some s) => if s = r then 1 - η * (if r = hit then 1 else 0) else 0 /- Embed the scalar ghost recurrence into a finite vector. -/ def ghostFiniteVector {R : Type*} (s : GhostLifespanState R) : GhostFiniteState R → ℝ | none => 1 | some none => s.completed | some (some r) => s.pending r end section open Finset end section theorem ordered_retrieval_factorial {j a : ℕ} (ha : a ≤ j) : (j.descFactorial a : ℝ) / j.factorial = 1 / ((j-a).factorial : ℝ) := by have hj : (j.factorial : ℝ) ≠ 0 := by positivity have hja : ((j-a).factorial : ℝ) ≠ 0 := by positivity have hfac : ((j-a).factorial : ℝ) * (j.descFactorial a : ℝ) = j.factorial := by exact_mod_cast Nat.factorial_mul_descFactorial ha field_simp nlinarith [hfac] /- The memory factorial is invariant under reversing an ordered retrieval of `a` old particles and storage of `b` new particles. -/ theorem ordered_retrieval_reversal (u a b : ℕ) : ((u+a).descFactorial a : ℝ) / (u+a).factorial = ((u+b).descFactorial b : ℝ) / (u+b).factorial := by rw [ordered_retrieval_factorial (by omega), ordered_retrieval_factorial (by omega)] simp end section open Finset /- A finite path action with coordinatewise kernels and terminal values factors into the product of its coordinate path actions. -/ theorem finite_path_action_tensor {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] {R : Type*} [CommSemiring R] (K : ℕ → (i : I) → X i → X i → R) (f : (i : I) → X i → R) (n : ℕ) (x : (i : I) → X i) : finitePathAction (fun j x y => ∏ i, K j i (x i) (y i)) (fun x => ∏ i, f i (x i)) n x = ∏ i, finitePathAction (fun j => K j i) (f i) n (x i) := by classical induction n generalizing x with | zero => rfl | succ n ih => simp only [finitePathAction, ih] simp_rw [← prod_mul_distrib] exact (Fintype.prod_sum (fun i y => K n i (x i) y * finitePathAction (fun j => K j i) (f i) n y)).symm end section open Finset end section open Finset structure ActiveGhostState (R : Type*) where unborn : ℝ pending : R → ℝ completed : ℝ noncomputable def activeGhostStep {R : Type*} [DecidableEq R] (active : Bool) (hit : R) (η β : ℝ) (s : ActiveGhostState R) : ActiveGhostState R := if active then { unborn := 0 pending := fun r => if r = hit then s.pending r + β * s.unborn else 0 completed := s.pending hit + β * s.unborn } else { unborn := s.unborn pending := fun r => s.pending r * (1 - η * (if r = hit then 1 else 0)) - β * s.unborn * η * (if r = hit then 1 else 0) completed := s.completed - η * s.pending hit } noncomputable def activeGhostRun {R : Type*} [DecidableEq R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (β : ℝ) : ℕ → ActiveGhostState R | 0 => ⟨1, fun _ => 0, 0⟩ | n + 1 => activeGhostStep (a n) (h n) (η n) β (activeGhostRun a h η β n) noncomputable def activeGhostLocalFactor {R : Type*} [DecidableEq R] (active : Bool) (hit : R) (η : ℝ) (r : R) : ℝ := if active then (if r = hit then 1 else 0) else 1 - η * (if r = hit then 1 else 0) /- Each pending residue retains the full local product, with the surviving unborn coefficient removed. The birth factor is paid exactly once. -/ theorem activeGhost_pending {R : Type*} [DecidableEq R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (β : ℝ) (n : ℕ) (r : R) : (activeGhostRun a h η β n).pending r = β * ((∏ i ∈ range n, activeGhostLocalFactor (a i) (h i) (η i) r) - (activeGhostRun a h η β n).unborn) := by induction n with | zero => simp [activeGhostRun] | succ n ih => cases ha : a n <;> simp only [activeGhostRun, activeGhostStep, activeGhostLocalFactor, ha, Bool.false_eq_true, ↓reduceIte, prod_range_succ] <;> rw [ih] <;> simp only [activeGhostLocalFactor] <;> split <;> simp_all <;> ring /- Signed conservation identity, including the unborn compensation term. -/ theorem activeGhost_completed_balance {R : Type*} [Fintype R] [DecidableEq R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (β : ℝ) (n : ℕ) : (activeGhostRun a h η β n).completed = (∑ r : R, (activeGhostRun a h η β n).pending r) + β * (activeGhostRun a h η β n).unborn * ∑ i ∈ range n, η i := by induction n with | zero => simp [activeGhostRun] | succ n ih => cases ha : a n · have hs : (∑ r : R, (activeGhostRun a h η β (n + 1)).pending r) = (∑ r : R, (activeGhostRun a h η β n).pending r) - η n * (activeGhostRun a h η β n).pending (h n) - β * (activeGhostRun a h η β n).unborn * η n := by simp only [activeGhostRun, activeGhostStep, ha, Bool.false_eq_true, ↓reduceIte, mul_sub, mul_one, sum_sub_distrib] simp only [mul_ite, mul_one, mul_zero, sum_ite_eq', mem_univ, if_true] ring rw [hs] simp only [activeGhostRun, activeGhostStep, ha, Bool.false_eq_true, ↓reduceIte, sum_range_succ] rw [ih] ring · simp [activeGhostRun, activeGhostStep, ha] /- The local product splits into active indicator factors and inactive damping. -/ theorem activeGhost_product_eq_weight {R : Type*} [DecidableEq R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (n : ℕ) (r : R) : (∏ i ∈ range n, activeGhostLocalFactor (a i) (h i) (η i) r) = activeResidueWeight (range n) ((range n).filter (fun i => a i = true)) h η r := by classical have hs : range n \ (range n).filter (fun i => a i = true) = (range n).filter (fun i => ¬ a i = true) := by ext i simp only [mem_sdiff, mem_filter] tauto rw [activeResidueWeight, hs] rw [← prod_filter_mul_prod_filter_not (range n) (fun i => a i = true) (fun i => activeGhostLocalFactor (a i) (h i) (η i) r)] congr 1 · apply prod_congr rfl intro i hi simp only [mem_filter] at hi simp [activeGhostLocalFactor, hi.2] · apply prod_congr rfl intro i hi simp only [mem_filter] at hi simp [activeGhostLocalFactor, hi.2] /- A product formula valid with any activity pattern. -/ theorem activeGhost_completed_product {R : Type*} [Fintype R] [DecidableEq R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (β : ℝ) (n : ℕ) : (activeGhostRun a h η β n).completed = β * ((∑ r : R, ∏ i ∈ range n, activeGhostLocalFactor (a i) (h i) (η i) r) - (Fintype.card R : ℝ) * (activeGhostRun a h η β n).unborn + (activeGhostRun a h η β n).unborn * ∑ i ∈ range n, η i) := by rw [activeGhost_completed_balance] simp_rw [activeGhost_pending] rw [← mul_sum, sum_sub_distrib] simp only [sum_const, card_univ, nsmul_eq_mul] ring /- The unborn-plus-completed coefficient is the normalized local expectation, for every pattern of active and inactive visits. -/ theorem activeGhost_vacuum_identity {R : Type*} [Fintype R] [DecidableEq R] [Nonempty R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (n : ℕ) (b : ℝ) (hb : b = 1 - (∑ i ∈ range n, η i) / Fintype.card R) (hb0 : b ≠ 0) : (activeGhostRun a h η ((Fintype.card R : ℝ) * b)⁻¹ n).unborn + (activeGhostRun a h η ((Fintype.card R : ℝ) * b)⁻¹ n).completed = ((∑ r : R, ∏ i ∈ range n, activeGhostLocalFactor (a i) (h i) (η i) r) / Fintype.card R) / b := by have hc : (Fintype.card R : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero have heq : b * Fintype.card R = Fintype.card R - ∑ i ∈ range n, η i := by rw [hb] field_simp have hcancel : 1 - ((Fintype.card R : ℝ) * b)⁻¹ * Fintype.card R + ((Fintype.card R : ℝ) * b)⁻¹ * (∑ i ∈ range n, η i) = 0 := by field_simp nlinarith [heq] rw [activeGhost_completed_product] calc _ = ((Fintype.card R : ℝ) * b)⁻¹ * (∑ r : R, ∏ i ∈ range n, activeGhostLocalFactor (a i) (h i) (η i) r) + (activeGhostRun a h η ((Fintype.card R : ℝ) * b)⁻¹ n).unborn * (1 - ((Fintype.card R : ℝ) * b)⁻¹ * Fintype.card R + ((Fintype.card R : ℝ) * b)⁻¹ * (∑ i ∈ range n, η i)) := by ring _ = _ := by rw [hcancel]; simp only [mul_zero, add_zero, div_eq_mul_inv, mul_inv_rev]; ring end section open Finset /- An active visit forces a hit. It may begin or finish an active lifespan, but neither leaves an unborn prime nor revives a completed lifespan. -/ noncomputable def activeGhostFiniteKernel {R : Type*} [DecidableEq R] (active : Bool) (hit : R) (η β : ℝ) : GhostFiniteState R → GhostFiniteState R → ℝ := if active then fun x y => match x, y with | none, _ => 0 | some none, none => β | some none, some none => 0 | some none, some (some r) => if r = hit then 1 else 0 | some (some r), none => if r = hit then β else 0 | some (some _), some none => 0 | some (some r), some (some s) => if r = hit ∧ s = r then 1 else 0 else ghostFiniteKernel hit η β /- All three evolving coefficients form the finite state vector. -/ def activeGhostFiniteVector {R : Type*} (s : ActiveGhostState R) : GhostFiniteState R → ℝ | none => s.unborn | some none => s.completed | some (some r) => s.pending r /- The transition matrix is exactly the unified ghost recurrence. -/ theorem active_ghost_finite_kernel_step {R : Type*} [Fintype R] [DecidableEq R] (active : Bool) (hit : R) (η β : ℝ) (s : ActiveGhostState R) (x : GhostFiniteState R) : (∑ y, activeGhostFiniteKernel active hit η β x y * activeGhostFiniteVector s y) = activeGhostFiniteVector (activeGhostStep active hit η β s) x := by cases active <;> rcases x with _ | (_ | r) · simp [activeGhostFiniteKernel, ghostFiniteKernel, activeGhostFiniteVector, activeGhostStep] · simp [activeGhostFiniteKernel, ghostFiniteKernel, activeGhostFiniteVector, activeGhostStep, sub_eq_add_neg, mul_comm] · simp [activeGhostFiniteKernel, ghostFiniteKernel, activeGhostFiniteVector, activeGhostStep] split <;> simp_all ring · simp [activeGhostFiniteKernel, activeGhostFiniteVector, activeGhostStep] · simp [activeGhostFiniteKernel, activeGhostFiniteVector, activeGhostStep, add_comm] · by_cases hr : r = hit · subst r simp [activeGhostFiniteKernel, activeGhostFiniteVector, activeGhostStep, add_comm] · simp [activeGhostFiniteKernel, activeGhostFiniteVector, activeGhostStep, hr] /- Finite matrix evolution tracks the exact mixed active/inactive history. -/ theorem active_ghost_finite_action_eq_vector {R : Type*} [Fintype R] [DecidableEq R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (β : ℝ) (n : ℕ) (x : GhostFiniteState R) : finitePathAction (fun j => activeGhostFiniteKernel (a j) (h j) (η j) β) ghostFiniteInitial n x = activeGhostFiniteVector (activeGhostRun a h η β n) x := by induction n generalizing x with | zero => rcases x with _ | (_ | r) <;> rfl | succ n ih => simp only [finitePathAction, ih, activeGhostRun] exact active_ghost_finite_kernel_step (a n) (h n) (η n) β _ x end section open Finset end section end section open Finset /- Translate pending residues by `r ↦ r - t`; leave both vacuum states fixed. -/ def ghostMemoryShift {R : Type*} [AddGroup R] (t : R) : GhostFiniteState R ≃ GhostFiniteState R where toFun | none => none | some none => some none | some (some r) => some (some (r - t)) invFun | none => none | some none => some none | some (some r) => some (some (r + t)) left_inv := by intro x; rcases x with _ | (_ | r) <;> simp right_inv := by intro x; rcases x with _ | (_ | r) <;> simp /- Composition works in an arbitrary additive group, with the displayed order. -/ theorem ghostMemoryShift_add {R : Type*} [AddGroup R] (t u : R) (x : GhostFiniteState R) : ghostMemoryShift (t + u) x = ghostMemoryShift t (ghostMemoryShift u x) := by rcases x with _ | (_ | r) <;> simp [ghostMemoryShift, sub_add_eq_sub_sub_swap] theorem ghostMemoryShift_symm {R : Type*} [AddGroup R] (t : R) (x : GhostFiniteState R) : (ghostMemoryShift t).symm x = ghostMemoryShift (-t) x := by rcases x with _ | (_ | r) <;> simp [ghostMemoryShift] end section open Finset /- Every tuple for finite pairwise-coprime nonzero moduli has an integer lift. -/ theorem independent_residues_integer_lift {ι : Type*} [Fintype ι] [DecidableEq ι] (m : ι → ℕ) [∀ i, NeZero (m i)] (hc : Pairwise (fun i j => Nat.Coprime (m i) (m j))) (r : ∀ i, ZMod (m i)) : ∃ n : ℤ, ∀ i, (n : ZMod (m i)) = r i := by obtain ⟨k, hk⟩ := (lifespan_crt_bijective m hc).surjective r refine ⟨(k.val : ℤ), ?_⟩ intro i simpa only [Int.cast_natCast] using congrFun hk i /- Disjoint physical prime groups admit simultaneous integer lifts. Nonzero modulus instances are derived from the explicit primality hypotheses. -/ theorem physical_residues_integer_lift {G : Type*} [Fintype G] {P : G → Finset ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (r : ∀ p : PhysicalPrime P, ZMod p.2.val) : ∃ n : ℤ, ∀ p : PhysicalPrime P, (n : ZMod p.2.val) = r p := by classical let : ∀ p : PhysicalPrime P, NeZero p.2.val := fun p => ⟨(hprime p.1 p.2.val p.2.property).ne_zero⟩ exact independent_residues_integer_lift (fun p : PhysicalPrime P => p.2.val) (physical_prime_pool_coprime hP hprime) r end section open Finset abbrev PhysicalResidues {G : Type*} (P : G → Finset ℕ) := ∀ p : PhysicalPrime P, ZMod p.2.val def physicalResiduesOfInt {G : Type*} (P : G → Finset ℕ) (n : ℤ) : PhysicalResidues P := fun _ => n def physicalTranslateResidues {G : Type*} {P : G → Finset ℕ} (r : PhysicalResidues P) (d : ℤ) : PhysicalResidues P := fun p => r p + d theorem physical_translate_residues_int {G : Type*} (P : G → Finset ℕ) (n d : ℤ) : physicalTranslateResidues (physicalResiduesOfInt P n) d = physicalResiduesOfInt P (n + d) := by funext p exact (Int.cast_add n d).symm theorem physical_translate_residues_zero {G : Type*} {P : G → Finset ℕ} (r : PhysicalResidues P) : physicalTranslateResidues r 0 = r := by funext p simp [physicalTranslateResidues] theorem physical_translate_residues_add {G : Type*} {P : G → Finset ℕ} (r : PhysicalResidues P) (a b : ℤ) : physicalTranslateResidues (physicalTranslateResidues r a) b = physicalTranslateResidues r (a + b) := by funext p simp [physicalTranslateResidues, add_assoc] def physicalResidueMarksValid {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (r : PhysicalResidues P) (L : PhysicalMarkLists P J ell) : Prop := ∀ g s, r ⟨g, L g s⟩ = 0 abbrev PhysicalResidueMarksAt {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) (r : PhysicalResidues P) := {L : PhysicalMarkLists P J ell // physicalResidueMarksValid r L} theorem physical_residue_marks_int_iff {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (n : ℤ) (L : PhysicalMarkLists P J ell) : physicalResidueMarksValid (physicalResiduesOfInt P n) L ↔ ∀ g s, ((L g s).val : ℤ) ∣ n := by simp only [physicalResidueMarksValid, physicalResiduesOfInt, ZMod.intCast_zmod_eq_zero_iff_dvd] noncomputable def physicalResidueDivisorPool {G : Type*} (P : G → Finset ℕ) (g : G) (r : PhysicalResidues P) : Finset ℕ := by classical exact (P g).attach.filter (fun p => r ⟨g, p⟩ = 0) |>.image Subtype.val theorem physical_residue_divisor_pool_int {G : Type*} (P : G → Finset ℕ) (g : G) (n : ℤ) : physicalResidueDivisorPool P g (physicalResiduesOfInt P n) = physicalDivisorPool P g n := by classical ext p simp only [physicalResidueDivisorPool, mem_image, mem_filter, mem_attach, true_and, physicalResiduesOfInt, ZMod.intCast_zmod_eq_zero_iff_dvd, physicalDivisorPool] constructor · rintro ⟨a, ha, rfl⟩ exact ⟨a.property, ha⟩ · rintro ⟨hp, hd⟩ exact ⟨⟨p, hp⟩, hd, rfl⟩ noncomputable def physicalResidueOmega {G : Type*} (P : G → Finset ℕ) (g : G) (r : PhysicalResidues P) : ℕ := (physicalResidueDivisorPool P g r).card noncomputable def physicalResidueVertexWeight {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (q : ℝ) (r : PhysicalResidues P) : ℝ := by classical exact if physicalResidueMarksValid r L then ∏ g, q^(physicalResidueOmega P g r - (J + ell)) else 0 theorem physical_residue_vertex_weight_int {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (q : ℝ) (n : ℤ) : physicalResidueVertexWeight L q (physicalResiduesOfInt P n) = physicalVertexWeight L q n := by simp only [physicalResidueVertexWeight, physical_residue_marks_int_iff, physicalResidueOmega, physical_residue_divisor_pool_int, physicalVertexWeight, physicalOmega] end section open Finset Classical noncomputable def physicalBareStepCoeff {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (n : ℤ) (L R : PhysicalMarkLists P J ell) : ℂ := physicalBareLabeledScalar V patterns C ζ K a L R * ((physicalVertexWeight L (Real.sqrt q) n * physicalVertexWeight R (Real.sqrt q) (n + physicalBareStep C k a L) : ℝ) : ℂ) theorem physical_labeled_norm_row_as_marks {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (x : PhysicalState P J ell) (positions : Finset ℤ) (hm : x.1 + physicalBareStep C k a x.2.val ∈ positions) : (∑ y ∈ physicalCutoff P J ell positions, ‖physicalLabeledCoeff V patterns C q ζ k K a x y‖) = ∑ R : PhysicalMarkLists P J ell, ‖physicalBareStepCoeff V patterns C q ζ k K a x.1 x.2.val R‖ := by let m := x.1 + physicalBareStep C k a x.2.val let F : PhysicalMarkLists P J ell → ℝ := fun R => ‖physicalBareStepCoeff V patterns C q ζ k K a x.1 x.2.val R‖ have he : ∀ y : PhysicalState P J ell, ‖physicalLabeledCoeff V patterns C q ζ k K a x y‖ = if y.1 = m then F y.2.val else 0 := by intro y rw [physical_labeled_vertex_factor V patterns C hq] change ‖(if y.1 = m then _ else _)‖ = _ by_cases h : y.1 = m · simp only [h] rfl · simp only [if_neg h, norm_zero] simp only [he] rw [physical_cutoff_sum_at, if_pos hm] apply physical_marks_sum_all P J ell m F intro L h dsimp only [m] at h simp only [F, physicalBareStepCoeff, physicalVertexWeight, if_neg h, mul_zero, Complex.ofReal_zero, norm_zero] noncomputable def physicalResidueStepCoeff {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (r : PhysicalResidues P) (L R : PhysicalMarkLists P J ell) : ℂ := physicalBareLabeledScalar V patterns C ζ K a L R * ((physicalResidueVertexWeight L (Real.sqrt q) r * physicalResidueVertexWeight R (Real.sqrt q) (physicalTranslateResidues r (physicalBareStep C k a L)) : ℝ) : ℂ) section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (n : ℤ) (L R : PhysicalMarkLists P J ell) include G I sharedInstance1 sharedInstance2 P J ell V patterns C q ζ k K a n L R theorem physical_residue_step_coeff_int : physicalResidueStepCoeff V patterns C q ζ k K a (physicalResiduesOfInt P n) L R = physicalBareStepCoeff V patterns C q ζ k K a n L R := by simp only [physicalResidueStepCoeff, physical_translate_residues_int, physical_residue_vertex_weight_int, physicalBareStepCoeff] theorem physical_bare_step_coeff_zero (h : ¬ ∀ g s, ((L g s).val : ℤ) ∣ n) : physicalBareStepCoeff V patterns C q ζ k K a n L R = 0 := by simp only [physicalBareStepCoeff, physicalVertexWeight, if_neg h, zero_mul, Complex.ofReal_zero, mul_zero] end /- Every bare row has the existing physical bound. The finite cutoff contains all one-step targets, so this reindexing loses no mass. -/ theorem exists_physical_bare_step_row_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell m : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J : ℕ) (V : G → ℝ), (∀ g, v ≤ V g) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → ∀ (I : Type) (patterns : Finset I) (C : I → G → Finset (Fin J)) (B : I → ℝ), (∀ i ∈ patterns, ∀ g, (C i g).card ≤ m) → (∀ i ∈ patterns, 0 ≤ B i) → ∀ (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ), (∀ i ∈ patterns, ∀ L R aux, ‖K i L R aux‖ ≤ B i) → letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance ∀ (n : ℤ) (L : PhysicalMarkLists P J ell), (∑ a : PhysicalEdgeLabels P J ell patterns C, ∑ R : PhysicalMarkLists P J ell, ‖physicalBareStepCoeff V patterns C q ζ k K a n L R‖) ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) := by obtain ⟨A, hA, hbound⟩ := exists_physical_absolute_operator_bounds hq0 hq1 hv ell m refine ⟨A, hA, ?_⟩ intro G _ _ P J V hV hMass I patterns C B hC hB ζ k K hK classical let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance intro n L by_cases hL : ∀ g s, ((L g s).val : ℤ) ∣ n · let x : PhysicalState P J ell := ⟨n, L, hL⟩ let positions := univ.image (fun a : PhysicalEdgeLabels P J ell patterns C => n + physicalBareStep C k a L) have hm : ∀ a : PhysicalEdgeLabels P J ell patterns C, x.1 + physicalBareStep C k a x.2.val ∈ positions := by intro a exact mem_image.mpr ⟨a, mem_univ a, rfl⟩ have he : (∑ a : PhysicalEdgeLabels P J ell patterns C, ∑ R : PhysicalMarkLists P J ell, ‖physicalBareStepCoeff V patterns C q ζ k K a n L R‖) = ∑ y ∈ physicalCutoff P J ell positions, physicalAbsoluteOperator V patterns C q ζ k K x y := by calc _ = ∑ a : PhysicalEdgeLabels P J ell patterns C, ∑ y ∈ physicalCutoff P J ell positions, ‖physicalLabeledCoeff V patterns C q ζ k K a x y‖ := by apply sum_congr rfl intro a _ exact (physical_labeled_norm_row_as_marks V patterns C hq0 ζ k K a x positions (hm a)).symm _ = _ := by rw [sum_comm]; simp only [physical_labeled_coefficient_abs_sum] rw [he] exact (hbound G P J V hV hMass I patterns C ζ k K B hC hB hK x (physicalCutoff P J ell positions)).1 · simp only [physical_bare_step_coeff_zero V patterns C q ζ k K _ n L _ hL, norm_zero, sum_const_zero] exact mul_nonneg (sum_nonneg hB) (pow_nonneg (zero_le_one.trans hA) _) end section open Finset abbrev PhysicalBareResidueState {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) := PhysicalResidues P × PhysicalMarkLists P J ell noncomputable def physicalResidueInitialMass {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (x : PhysicalBareResidueState P J ell) : ℝ := by classical exact physicalStateMass V J ell * ∏ p : PhysicalPrime P, (if p ∈ physicalMarkedPrimes x.2 then (if x.1 p = 0 then (1 : ℝ) else 0) else 1) / (p.2.val : ℝ) theorem physical_residue_initial_mass_nonneg {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (x : PhysicalBareResidueState P J ell) : 0 ≤ physicalResidueInitialMass V x := by classical unfold physicalResidueInitialMass apply mul_nonneg (physical_state_mass_pos V hV J ell).le apply prod_nonneg intro p _ apply div_nonneg · split_ifs <;> positivity · exact Nat.cast_nonneg _ theorem physical_residue_initial_mass_total {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) : (∑ x : PhysicalBareResidueState P J ell, physicalResidueInitialMass V x) ≤ 1 := by classical rw [Fintype.sum_prod_type, sum_comm] simp only [physicalResidueInitialMass, ← mul_sum] simpa only [← mul_sum] using (physical_initial_residue_total_mass (J := J) (ell := ell) V hV hMass) theorem physical_residue_initial_mass_zero {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (x : PhysicalBareResidueState P J ell) (h : ¬ physicalResidueMarksValid x.1 x.2) : physicalResidueInitialMass V x = 0 := by classical unfold physicalResidueMarksValid at h push Not at h obtain ⟨g, s, hs⟩ := h have hm : (⟨g, x.2 g s⟩ : PhysicalPrime P) ∈ physicalMarkedPrimes x.2 := by rw [mem_physical_marked_primes, mem_physical_group_marks] exact ⟨s, rfl⟩ unfold physicalResidueInitialMass have hz : (∏ p : PhysicalPrime P, (if p ∈ physicalMarkedPrimes x.2 then (if x.1 p = 0 then (1 : ℝ) else 0) else 1) / (p.2.val : ℝ)) = 0 := by apply prod_eq_zero (mem_univ (⟨g, x.2 g s⟩ : PhysicalPrime P)) simp only [if_pos hm, if_neg hs, zero_div] rw [hz, mul_zero] end section open Finset noncomputable def deterministicTargetKernel {R M A : Type*} (step : A → R → M → R) (weight : A → R → M → M → ℂ) (a : A) (x y : R × M) : ℂ := by classical exact if y.1 = step a x.1 x.2 then weight a x.1 x.2 y.2 else 0 theorem deterministic_target_norm_row {R M A : Type*} [Fintype R] [Fintype M] [Fintype A] (step : A → R → M → R) (weight : A → R → M → M → ℂ) (x : R × M) : (∑ y : R × M, ∑ a : A, ‖deterministicTargetKernel step weight a x y‖) = ∑ a : A, ∑ m : M, ‖weight a x.1 x.2 m‖ := by classical rw [sum_comm] apply sum_congr rfl intro a _ rw [Fintype.sum_prod_type] simp [deterministicTargetKernel, apply_ite] end section open Finset Classical theorem physical_residues_of_int_surjective {G : Type*} [Fintype G] {P : G → Finset ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) : Function.Surjective (physicalResiduesOfInt P) := by intro r obtain ⟨n, hn⟩ := physical_residues_integer_lift hP hprime r exact ⟨n, funext hn⟩ noncomputable def physicalResidueLabeledCoeff {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (x y : PhysicalBareResidueState P J ell) : ℂ := deterministicTargetKernel (fun a r L => physicalTranslateResidues r (physicalBareStep C k a L)) (physicalResidueStepCoeff V patterns C q ζ k K) a x y section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} [sharedInstance4 : ∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) include G I sharedInstance1 sharedInstance2 P sharedInstance4 J ell V patterns C q ζ k K theorem physical_residue_labeled_norm_row : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance ∀ x : PhysicalBareResidueState P J ell, (∑ y : PhysicalBareResidueState P J ell, ∑ a : PhysicalEdgeLabels P J ell patterns C, ‖physicalResidueLabeledCoeff V patterns C q ζ k K a x y‖) = ∑ a : PhysicalEdgeLabels P J ell patterns C, ∑ R : PhysicalMarkLists P J ell, ‖physicalResidueStepCoeff V patterns C q ζ k K a x.1 x.2 R‖ := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance intro x exact deterministic_target_norm_row _ _ x theorem physical_residue_row_bound_of_lift (hlift : ∀ r : PhysicalResidues P, ∃ n : ℤ, physicalResiduesOfInt P n = r) (H : ℝ) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance (∀ (n : ℤ) (L : PhysicalMarkLists P J ell), (∑ a : PhysicalEdgeLabels P J ell patterns C, ∑ R : PhysicalMarkLists P J ell, ‖physicalBareStepCoeff V patterns C q ζ k K a n L R‖) ≤ H) → ∀ x : PhysicalBareResidueState P J ell, (∑ y : PhysicalBareResidueState P J ell, ∑ a : PhysicalEdgeLabels P J ell patterns C, ‖physicalResidueLabeledCoeff V patterns C q ζ k K a x y‖) ≤ H := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance intro hrow x rw [physical_residue_labeled_norm_row] obtain ⟨n, hn⟩ := hlift x.1 rw [← hn] simp only [physical_residue_step_coeff_int] exact hrow n x.2 end /- The full independent-residue operator has the same absolute row bound as the physical operator. Norms are taken before summing labels. -/ theorem exists_physical_residue_operator_row_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell m : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val], Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime) → ∀ (J : ℕ) (V : G → ℝ), (∀ g, v ≤ V g) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → ∀ (I : Type) (patterns : Finset I) (C : I → G → Finset (Fin J)) (B : I → ℝ), (∀ i ∈ patterns, ∀ g, (C i g).card ≤ m) → (∀ i ∈ patterns, 0 ≤ B i) → ∀ (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ), (∀ i ∈ patterns, ∀ L R aux, ‖K i L R aux‖ ≤ B i) → letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance ∀ x : PhysicalBareResidueState P J ell, (∑ y : PhysicalBareResidueState P J ell, ∑ a : PhysicalEdgeLabels P J ell patterns C, ‖physicalResidueLabeledCoeff V patterns C q ζ k K a x y‖) ≤ (∑ i ∈ patterns, B i) * A^(Fintype.card G) := by obtain ⟨A, hA, hbound⟩ := exists_physical_bare_step_row_bound hq0 hq1 hv ell m refine ⟨A, hA, ?_⟩ intro G _ _ P _ hP hprime J V hV hMass I patterns C B hC hB ζ k K hK let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance exact physical_residue_row_bound_of_lift V patterns C q ζ k K (physical_residues_of_int_surjective hP hprime) _ (hbound G P J V hV hMass I patterns C B hC hB ζ k K hK) /- The normalized independent-residue law converts a uniform absolute row bound into a bound for all labeled paths, with no cancellation assumed. -/ theorem physical_residue_averaged_path_bound {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (H : ℝ) (hH : 0 ≤ H) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance (∀ j (x : PhysicalBareResidueState P J ell), (∑ y : PhysicalBareResidueState P J ell, ∑ a : PhysicalEdgeLabels P J ell patterns C, ‖physicalResidueLabeledCoeff V patterns C q (ζ j) (k j) (K j) a x y‖) ≤ H) → ∀ terminal : PhysicalBareResidueState P J ell → PhysicalBareResidueState P J ell → ℂ, (∀ x y, ‖terminal x y‖ ≤ 1) → ∀ n : ℕ, (∑ x : PhysicalBareResidueState P J ell, physicalResidueInitialMass V x * ∑ p : Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalBareResidueState P J ell, ‖labeledPathTerm (fun j a u v => physicalResidueLabeledCoeff V patterns C q (ζ j) (k j) (K j) a u v) (terminal x) n x p‖) ≤ H^n := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance intro hrow terminal ht n exact averaged_absolute_labeled_path_bound _ terminal (physicalResidueInitialMass V) hH hrow ht (physical_residue_initial_mass_nonneg V hV) (physical_residue_initial_mass_total V hV hMass) n end section open Finset theorem physical_residue_vertex_path_factorization {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (q : ℕ → ℝ) (r : PhysicalResidues P) : (∏ j ∈ visits, physicalResidueVertexWeight (labels j) (q j) (physicalTranslateResidues r (offset j))) = ∏ p : PhysicalPrime P, activeResidueWeight visits (visits.filter (fun j => p ∈ physicalMarkedPrimes (labels j))) (fun j => -(offset j : ZMod p.2.val)) (fun j => 1 - q j) (r p) := by obtain ⟨n, rfl⟩ := physical_residues_of_int_surjective hP hprime r simpa only [physical_translate_residues_int, physical_residue_vertex_weight_int, physicalResiduesOfInt] using physical_vertex_path_factorization labels visits offset q n /- The whole finite residue-vector expectation equals the product of local expectations used by the existing uniform replacement theorem. -/ theorem physical_residue_vertex_expectation {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (q : ℕ → ℝ) : (∑ r : PhysicalResidues P, (∏ p : PhysicalPrime P, 1 / (p.2.val : ℝ)) * ∏ j ∈ visits, physicalResidueVertexWeight (labels j) (q j) (physicalTranslateResidues r (offset j))) = poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) univ visits (fun p => visits.filter (fun j => p ∈ physicalMarkedPrimes (labels j))) (fun p j => -(offset j : ZMod p.2.val)) (fun j => 1 - q j) := by classical simp only [physical_residue_vertex_path_factorization hP hprime] let f := fun (p : PhysicalPrime P) (a : ZMod p.2.val) => activeResidueWeight visits (visits.filter (fun j => p ∈ physicalMarkedPrimes (labels j))) (fun j => -(offset j : ZMod p.2.val)) (fun j => 1 - q j) a change (∑ r : PhysicalResidues P, (∏ p : PhysicalPrime P, 1 / (p.2.val : ℝ)) * ∏ p : PhysicalPrime P, f p (r p)) = ∏ p : PhysicalPrime P, (∑ a, f p a) / (p.2.val : ℝ) have he : ∀ r : PhysicalResidues P, (∏ p : PhysicalPrime P, 1 / (p.2.val : ℝ)) * (∏ p : PhysicalPrime P, f p (r p)) = ∏ p : PhysicalPrime P, f p (r p) / (p.2.val : ℝ) := by intro r rw [← prod_mul_distrib] apply prod_congr rfl intro p _ ring simp only [he] simpa only [← sum_div] using (Fintype.prod_sum (fun (p : PhysicalPrime P) (a : ZMod p.2.val) => f p a / (p.2.val : ℝ))).symm end section open Finset theorem physical_residue_marks_valid_iff_marked {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (r : PhysicalResidues P) (L : PhysicalMarkLists P J ell) : physicalResidueMarksValid r L ↔ ∀ p ∈ physicalMarkedPrimes L, r p = 0 := by constructor · intro h p hp rcases p with ⟨g, p⟩ obtain ⟨s, hs⟩ := (mem_physical_group_marks L g p.val).mp ((mem_physical_marked_primes L ⟨g, p⟩).mp hp) have he : L g s = p := Subtype.ext hs rw [← he] exact h g s · intro h g s apply h ⟨g, L g s⟩ rw [mem_physical_marked_primes, mem_physical_group_marks] exact ⟨s, rfl⟩ theorem physical_residue_initial_mass_of_valid {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (r : PhysicalResidues P) (L : PhysicalMarkLists P J ell) (h : physicalResidueMarksValid r L) : physicalResidueInitialMass V (r, L) = physicalStateMass V J ell * ∏ p : PhysicalPrime P, 1 / (p.2.val : ℝ) := by classical unfold physicalResidueInitialMass congr 1 apply prod_congr rfl intro p _ by_cases hp : p ∈ physicalMarkedPrimes L · have hr := (physical_residue_marks_valid_iff_marked r L).mp h p hp simp only [hp, hr, if_true] · simp only [hp, if_false] /- A function supported on valid marked states can be averaged against the uniform residue law, with the constant state mass outside both finite sums. -/ theorem physical_residue_initial_mass_sum_of_supported {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : G → ℝ) (F : PhysicalResidues P → PhysicalMarkLists P J ell → ℝ) (hF : ∀ r L, ¬ physicalResidueMarksValid r L → F r L = 0) : (∑ x : PhysicalBareResidueState P J ell, physicalResidueInitialMass V x * F x.1 x.2) = physicalStateMass V J ell * ∑ L : PhysicalMarkLists P J ell, ∑ r : PhysicalResidues P, (∏ p : PhysicalPrime P, 1 / (p.2.val : ℝ)) * F r L := by classical have hpoint (r : PhysicalResidues P) (L : PhysicalMarkLists P J ell) : physicalResidueInitialMass V (r, L) * F r L = physicalStateMass V J ell * ((∏ p : PhysicalPrime P, 1 / (p.2.val : ℝ)) * F r L) := by by_cases h : physicalResidueMarksValid r L · rw [physical_residue_initial_mass_of_valid V r L h, mul_assoc] · rw [hF r L h, mul_zero, mul_zero, mul_zero] rw [Fintype.sum_prod_type, sum_comm] simp only [hpoint, ← mul_sum] section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} include G sharedInstance1 P J ell theorem physical_residue_vertex_weight_nonneg (L : PhysicalMarkLists P J ell) {q : ℝ} (hq : 0 ≤ q) (r : PhysicalResidues P) : 0 ≤ physicalResidueVertexWeight L q r := by classical unfold physicalResidueVertexWeight split_ifs · exact prod_nonneg (fun _ _ => pow_nonneg hq _) · exact le_rfl theorem physical_residue_vertex_weight_zero_of_invalid (L : PhysicalMarkLists P J ell) (q : ℝ) (r : PhysicalResidues P) (h : ¬ physicalResidueMarksValid r L) : physicalResidueVertexWeight L q r = 0 := by classical simp only [physicalResidueVertexWeight, if_neg h] theorem physical_residue_vertex_product_nonneg (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (q : ℕ → ℝ) (hq : ∀ j ∈ visits, 0 ≤ q j) (r : PhysicalResidues P) : 0 ≤ ∏ j ∈ visits, physicalResidueVertexWeight (labels j) (q j) (physicalTranslateResidues r (offset j)) := by exact prod_nonneg (fun j hj => physical_residue_vertex_weight_nonneg (labels j) (hq j hj) (physicalTranslateResidues r (offset j))) end end section open Finset theorem physical_endpoint_schedule_nonneg {q : ℝ} (hq : 0 ≤ q) (edges j : ℕ) : 0 ≤ physicalEndpointSchedule q edges j := by unfold physicalEndpointSchedule split_ifs · exact Real.sqrt_nonneg q · exact hq noncomputable def physicalFiniteResidueExpectation {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} {patterns : Finset I} (C : I → G → Finset (Fin J)) (q : ℝ) (k : ℕ → I → ℤ) (N : ℕ) (L₀ : PhysicalMarkLists P J ell) (p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : ℝ := poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) univ (range (N + 2)) (fun a => (range (N + 2)).filter (fun j => a ∈ physicalMarkedPrimes (finitePathMarks L₀ p j))) (fun a j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L₀ p) (N + 1) j : ZMod a.2.val)) (fun j => 1 - physicalEndpointSchedule q (N + 1) j) theorem physical_finite_residue_expectation_nonneg {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} {patterns : Finset I} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (k : ℕ → I → ℤ) (N : ℕ) (L₀ : PhysicalMarkLists P J ell) (p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : 0 ≤ physicalFiniteResidueExpectation C q k N L₀ p := by unfold physicalFiniteResidueExpectation rw [← physical_residue_vertex_expectation hP hprime] apply sum_nonneg intro r _ apply mul_nonneg · exact prod_nonneg (fun p _ => div_nonneg zero_le_one (Nat.cast_nonneg _)) · exact physical_residue_vertex_product_nonneg _ _ _ _ (fun j _ => physical_endpoint_schedule_nonneg hq (N + 1) j) r theorem physical_bare_return_scalar_norm_le {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) : ‖physicalBareReturnScalar V patterns C ζ k K a L edges‖ ≤ ‖physicalBareWalkScalar V patterns C ζ K a L edges‖ := by unfold physicalBareReturnScalar split_ifs · exact le_rfl · simpa only [norm_zero] using norm_nonneg (physicalBareWalkScalar V patterns C ζ K a L edges) end section open Finset def deterministicBarePathTerm {R M A S : Type*} [Mul S] (step : ℕ → A → R → M → R) (weight : ℕ → A → R → M → M → S) (terminal : R → M → S) : (n : ℕ) → R → M → (Fin n → A × M) → S | 0, r, m, _ => terminal r m | n + 1, r, m, p => weight n (p 0).1 r m (p 0).2 * deterministicBarePathTerm step weight terminal n (step n (p 0).1 r m) (p 0).2 (Fin.tail p) theorem deterministic_target_absolute_path_sum {R M A : Type*} [Fintype R] [Fintype M] [Fintype A] (step : ℕ → A → R → M → R) (weight : ℕ → A → R → M → M → ℂ) (terminal : R → M → ℂ) (n : ℕ) (r : R) (m : M) : (∑ p : Fin n → A × (R × M), ‖labeledPathTerm (fun j => deterministicTargetKernel (step j) (weight j)) (fun x => terminal x.1 x.2) n (r, m) p‖) = ∑ p : Fin n → A × M, ‖deterministicBarePathTerm step weight terminal n r m p‖ := by classical induction n generalizing r m with | zero => simp [labeledPathTerm, deterministicBarePathTerm] | succ n ih => calc _ = ∑ z : A × (R × M), ∑ p : Fin n → A × (R × M), ‖deterministicTargetKernel (step n) (weight n) z.1 (r, m) z.2‖ * ‖labeledPathTerm (fun j => deterministicTargetKernel (step j) (weight j)) (fun x => terminal x.1 x.2) n z.2 p‖ := by rw [← Equiv.sum_comp (Fin.consEquiv (fun _ : Fin (n + 1) => A × (R × M))) (fun p => ‖labeledPathTerm (fun j => deterministicTargetKernel (step j) (weight j)) (fun x => terminal x.1 x.2) (n + 1) (r, m) p‖), Fintype.sum_prod_type] apply sum_congr rfl intro z _ apply sum_congr rfl intro p _ exact norm_mul _ _ _ = ∑ z : A × (R × M), ‖deterministicTargetKernel (step n) (weight n) z.1 (r, m) z.2‖ * ∑ p : Fin n → A × M, ‖deterministicBarePathTerm step weight terminal n z.2.1 z.2.2 p‖ := by apply sum_congr rfl intro z _ rw [← mul_sum] exact congrArg (fun s => ‖deterministicTargetKernel (step n) (weight n) z.1 (r, m) z.2‖ * s) (ih z.2.1 z.2.2) _ = ∑ z : A × M, ∑ p : Fin n → A × M, ‖weight n z.1 r m z.2‖ * ‖deterministicBarePathTerm step weight terminal n (step n z.1 r m) z.2 p‖ := by simp [Fintype.sum_prod_type, deterministicTargetKernel, apply_ite, ite_mul, mul_sum] _ = _ := by symm rw [← Equiv.sum_comp (Fin.consEquiv (fun _ : Fin (n + 1) => A × M)) (fun p => ‖deterministicBarePathTerm step weight terminal (n + 1) r m p‖), Fintype.sum_prod_type] apply sum_congr rfl intro z _ apply sum_congr rfl intro p _ exact norm_mul _ _ end section open Finset noncomputable def physicalResidueBarePathTerm {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (N : ℕ) (r : PhysicalResidues P) (L₀ : PhysicalMarkLists P J ell) (p : Fin N → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : ℂ := deterministicBarePathTerm (fun j a r L => physicalTranslateResidues r (physicalBareStep C (k j) a L)) (fun j => physicalResidueStepCoeff V patterns C q (ζ j) (k j) (K j)) (fun _ _ => (1 : ℂ)) N r L₀ p section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) include G I sharedInstance1 sharedInstance2 P J ell V patterns C theorem physical_residue_bare_path_term_zero_of_invalid (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (N : ℕ) (r : PhysicalResidues P) (L₀ : PhysicalMarkLists P J ell) (p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (hL : ¬ physicalResidueMarksValid r L₀) : physicalResidueBarePathTerm V patterns C q ζ k K (N + 1) r L₀ p = 0 := by simp only [physicalResidueBarePathTerm, deterministicBarePathTerm, physicalResidueStepCoeff, physicalResidueVertexWeight, if_neg hL, zero_mul, Complex.ofReal_zero, mul_zero] /- A deterministic residue path starting at an integer residue vector is exactly the corresponding unrestricted physical path. -/ theorem physical_residue_path_term_int (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (t : ℕ) (n : ℤ) (L : PhysicalMarkLists P J ell) (p : Fin t → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : deterministicBarePathTerm (fun j a r L => physicalTranslateResidues r (physicalBareStep C (k j) a L)) (fun j => physicalResidueStepCoeff V patterns C q (ζ j) (k j) (K j)) (fun _ _ => (1 : ℂ)) t (physicalResiduesOfInt P n) L p = translatedPathTerm (fun j => physicalBareStep C (k j)) (fun j => physicalBareKernel V patterns C q (ζ j) (k j) (K j)) (fun _ _ => (1 : ℂ)) t n L p := by induction t generalizing n L with | zero => rfl | succ t ih => simp only [deterministicBarePathTerm, translatedPathTerm, physical_translate_residues_int, physical_residue_step_coeff_int, ih] rfl /- Positive-length residue paths at integer sources factor into the unrestricted walk scalar and the scheduled residue vertex product. -/ theorem physical_residue_path_term_factor_int {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (N : ℕ) (n : ℤ) : deterministicBarePathTerm (fun j a r L => physicalTranslateResidues r (physicalBareStep C (k j) a L)) (fun j => physicalResidueStepCoeff V patterns C q (ζ j) (k j) (K j)) (fun _ _ => (1 : ℂ)) (N + 1) (physicalResiduesOfInt P n) (L 0) (fun j : Fin (N + 1) => (a j.val, L (j.val + 1))) = physicalBareWalkScalar V patterns C ζ K a L (N + 1) * ((∏ j ∈ range (N + 2), physicalResidueVertexWeight (L j) (physicalEndpointSchedule q (N + 1) j) (physicalTranslateResidues (physicalResiduesOfInt P n) (physicalBareOffset C k a L (N + 1) j)) : ℝ) : ℂ) := by rw [physical_residue_path_term_int] simpa only [physical_translate_residues_int, physical_residue_vertex_weight_int, mul_one] using physical_free_path_term_factor V patterns C hq ζ k K (fun _ _ => (1 : ℂ)) a L N n end section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) include G I sharedInstance1 sharedInstance2 P J ell hP hprime V patterns C q hq ζ k K /- CRT transfers the physical path factorization to every independent residue vector, simultaneously along the entire path. -/ theorem physical_residue_path_term_factor (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (N : ℕ) (r : PhysicalResidues P) : deterministicBarePathTerm (fun j a r L => physicalTranslateResidues r (physicalBareStep C (k j) a L)) (fun j => physicalResidueStepCoeff V patterns C q (ζ j) (k j) (K j)) (fun _ _ => (1 : ℂ)) (N + 1) r (L 0) (fun j : Fin (N + 1) => (a j.val, L (j.val + 1))) = physicalBareWalkScalar V patterns C ζ K a L (N + 1) * ((∏ j ∈ range (N + 2), physicalResidueVertexWeight (L j) (physicalEndpointSchedule q (N + 1) j) (physicalTranslateResidues r (physicalBareOffset C k a L (N + 1) j)) : ℝ) : ℂ) := by obtain ⟨n, rfl⟩ := physical_residues_of_int_surjective hP hprime r exact physical_residue_path_term_factor_int V patterns C hq ζ k K a L N n /- Every finite positive-length residue path has the walk factorization used to sum its mass against the independent-residue initial law. -/ theorem physical_residue_finite_path_factor (N : ℕ) (L₀ : PhysicalMarkLists P J ell) (p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (r : PhysicalResidues P) : let a := finitePathLabels p let L := finitePathMarks L₀ p physicalResidueBarePathTerm V patterns C q ζ k K (N + 1) r L₀ p = physicalBareWalkScalar V patterns C ζ K a L (N + 1) * ((∏ j ∈ range (N + 2), physicalResidueVertexWeight (L j) (physicalEndpointSchedule q (N + 1) j) (physicalTranslateResidues r (physicalBareOffset C k a L (N + 1) j)) : ℝ) : ℂ) := by have h := physical_residue_path_term_factor hP hprime V patterns C hq ζ k K (finitePathLabels p) (finitePathMarks L₀ p) N r rw [finite_path_sequences] at h exact h end end section open Finset theorem physical_residue_bare_path_mass_bound {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (H : ℝ) (hH : 0 ≤ H) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance (∀ j (x : PhysicalBareResidueState P J ell), (∑ y : PhysicalBareResidueState P J ell, ∑ a : PhysicalEdgeLabels P J ell patterns C, ‖physicalResidueLabeledCoeff V patterns C q (ζ j) (k j) (K j) a x y‖) ≤ H) → ∀ n : ℕ, (∑ x : PhysicalBareResidueState P J ell, physicalResidueInitialMass V x * ∑ p : Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, ‖deterministicBarePathTerm (fun j a r L => physicalTranslateResidues r (physicalBareStep C (k j) a L)) (fun j => physicalResidueStepCoeff V patterns C q (ζ j) (k j) (K j)) (fun _ _ => (1 : ℂ)) n x.1 x.2 p‖) ≤ H^n := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance intro hrow n have hb := physical_residue_averaged_path_bound V hV hMass patterns C q ζ k K H hH hrow (fun _ _ => (1 : ℂ)) (fun _ _ => by simp) n have he (x : PhysicalBareResidueState P J ell) : (∑ p : Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalBareResidueState P J ell, ‖labeledPathTerm (fun j a u v => physicalResidueLabeledCoeff V patterns C q (ζ j) (k j) (K j) a u v) (fun _ => (1 : ℂ)) n x p‖) = ∑ p : Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, ‖deterministicBarePathTerm (fun j a r L => physicalTranslateResidues r (physicalBareStep C (k j) a L)) (fun j => physicalResidueStepCoeff V patterns C q (ζ j) (k j) (K j)) (fun _ _ => (1 : ℂ)) n x.1 x.2 p‖ := by exact deterministic_target_absolute_path_sum _ _ (fun _ _ => (1 : ℂ)) n x.1 x.2 simpa only [he] using hb end section open Finset section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} [sharedInstance4 : ∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) include G I sharedInstance1 sharedInstance2 P sharedInstance4 J ell hP hprime V theorem physical_residue_path_norm_expectation (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (N : ℕ) (L₀ : PhysicalMarkLists P J ell) (p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : (∑ r : PhysicalResidues P, (∏ a : PhysicalPrime P, 1 / (a.2.val : ℝ)) * ‖physicalResidueBarePathTerm V patterns C q ζ k K (N + 1) r L₀ p‖) = ‖physicalBareWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L₀ p) (N + 1)‖ * physicalFiniteResidueExpectation C q k N L₀ p := by let L := finitePathMarks L₀ p let a := finitePathLabels p let W := fun r : PhysicalResidues P => ∏ j ∈ range (N + 2), physicalResidueVertexWeight (L j) (physicalEndpointSchedule q (N + 1) j) (physicalTranslateResidues r (physicalBareOffset C k a L (N + 1) j)) have hW (r : PhysicalResidues P) : 0 ≤ W r := physical_residue_vertex_product_nonneg _ _ _ _ (fun j _ => physical_endpoint_schedule_nonneg hq (N + 1) j) r have he (r : PhysicalResidues P) : ‖physicalResidueBarePathTerm V patterns C q ζ k K (N + 1) r L₀ p‖ = ‖physicalBareWalkScalar V patterns C ζ K a L (N + 1)‖ * W r := by rw [physical_residue_finite_path_factor hP hprime V patterns C hq ζ k K] change ‖physicalBareWalkScalar V patterns C ζ K a L (N + 1) * (W r : ℂ)‖ = _ rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hW r)] simp only [he] calc _ = ‖physicalBareWalkScalar V patterns C ζ K a L (N + 1)‖ * ∑ r : PhysicalResidues P, (∏ a : PhysicalPrime P, 1 / (a.2.val : ℝ)) * W r := by rw [mul_sum] apply sum_congr rfl intro r _ ring _ = _ := congrArg (fun z => ‖physicalBareWalkScalar V patterns C ζ K a L (N + 1)‖ * z) (physical_residue_vertex_expectation hP hprime L (range (N + 2)) (physicalBareOffset C k a L (N + 1)) (physicalEndpointSchedule q (N + 1))) theorem physical_residue_expected_walk_mass (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (N : ℕ) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance (∑ x : PhysicalBareResidueState P J ell, physicalResidueInitialMass V x * ∑ p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, ‖physicalResidueBarePathTerm V patterns C q ζ k K (N + 1) x.1 x.2 p‖) = physicalStateMass V J ell * ∑ L₀ : PhysicalMarkLists P J ell, ∑ p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, ‖physicalBareWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L₀ p) (N + 1)‖ * physicalFiniteResidueExpectation C q k N L₀ p := by classical let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance let F := fun (r : PhysicalResidues P) (L : PhysicalMarkLists P J ell) => ∑ p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, ‖physicalResidueBarePathTerm V patterns C q ζ k K (N + 1) r L p‖ have hF : ∀ r L, ¬ physicalResidueMarksValid r L → F r L = 0 := by intro r L h apply sum_eq_zero intro p _ rw [physical_residue_bare_path_term_zero_of_invalid V patterns C q ζ k K N r L p h, norm_zero] change (∑ x : PhysicalBareResidueState P J ell, physicalResidueInitialMass V x * F x.1 x.2) = _ rw [physical_residue_initial_mass_sum_of_supported V F hF] congr 1 apply sum_congr rfl intro L₀ _ simp only [F, mul_sum] rw [sum_comm] apply sum_congr rfl intro p _ exact physical_residue_path_norm_expectation hP hprime V patterns C hq ζ k K N L₀ p theorem physical_expected_walk_mass_bound (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (H : ℝ) (hH : 0 ≤ H) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance (∀ j (x : PhysicalBareResidueState P J ell), (∑ y : PhysicalBareResidueState P J ell, ∑ a : PhysicalEdgeLabels P J ell patterns C, ‖physicalResidueLabeledCoeff V patterns C q (ζ j) (k j) (K j) a x y‖) ≤ H) → ∀ N : ℕ, physicalStateMass V J ell * ∑ L₀ : PhysicalMarkLists P J ell, ∑ p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, ‖physicalBareWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L₀ p) (N + 1)‖ * physicalFiniteResidueExpectation C q k N L₀ p ≤ H^(N + 1) := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance intro hrow N rw [← physical_residue_expected_walk_mass hP hprime V patterns C hq ζ k K N] exact physical_residue_bare_path_mass_bound V hV hMass patterns C q ζ k K H hH hrow (N + 1) /- Integer-return paths are a subset of unrestricted residue walks. This is the exact nonnegative mass needed to sum the CRT error estimates. -/ theorem physical_expected_return_mass_bound (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (H : ℝ) (hH : 0 ≤ H) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance (∀ j (x : PhysicalBareResidueState P J ell), (∑ y : PhysicalBareResidueState P J ell, ∑ a : PhysicalEdgeLabels P J ell patterns C, ‖physicalResidueLabeledCoeff V patterns C q (ζ j) (k j) (K j) a x y‖) ≤ H) → ∀ N : ℕ, physicalStateMass V J ell * ∑ L₀ : PhysicalMarkLists P J ell, ∑ p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, ‖physicalBareReturnScalar V patterns C ζ k K (finitePathLabels p) (finitePathMarks L₀ p) (N + 1)‖ * physicalFiniteResidueExpectation C q k N L₀ p ≤ H^(N + 1) := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance intro hrow N calc _ ≤ physicalStateMass V J ell * ∑ L₀ : PhysicalMarkLists P J ell, ∑ p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, ‖physicalBareWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L₀ p) (N + 1)‖ * physicalFiniteResidueExpectation C q k N L₀ p := by apply mul_le_mul_of_nonneg_left _ (physical_state_mass_pos V hV J ell).le apply sum_le_sum intro L₀ _ apply sum_le_sum intro p _ exact mul_le_mul_of_nonneg_right (physical_bare_return_scalar_norm_le V patterns C ζ k K (finitePathLabels p) (finitePathMarks L₀ p) (N + 1)) (physical_finite_residue_expectation_nonneg hP hprime C hq k N L₀ p) _ ≤ _ := physical_expected_walk_mass_bound hP hprime V hV hMass patterns C hq ζ k K H hH hrow N end end section open Finset Classical section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} [sharedInstance4 : ∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (starts : Finset ℤ) (r b : ℕ) (hbound : ∀ j < r + 1, physicalOperatorStepBound P J ell patterns C (k j) ≤ b) include G I sharedInstance1 sharedInstance2 P sharedInstance4 J ell hP hprime V hV hMass patterns C q hq ζ k K starts r b hbound theorem physical_root_error_of_residue_rows (H ε : ℝ) (hH : 0 ≤ H) (hε : 0 ≤ ε) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance (∀ j (x : PhysicalBareResidueState P J ell), (∑ y : PhysicalBareResidueState P J ell, ∑ label : PhysicalEdgeLabels P J ell patterns C, ‖physicalResidueLabeledCoeff V patterns C q (ζ j) (k j) (K j) label x y‖) ≤ H) → (∀ (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell), |(∑ n ∈ starts, physicalFiniteVertexProduct C q k r L p n) / (starts.card : ℝ) - physicalFiniteVertexExpectation C q k r L p| ≤ ε * physicalFiniteVertexExpectation C q k r L p) → ‖physicalRootMoment V patterns C q ζ k K starts r b - physicalRootResidueModel V patterns C q ζ k K r‖ ≤ ε * H^(r + 1) := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance intro hrow herror have hm := physical_expected_return_mass_bound hP hprime V hV hMass patterns C hq ζ k K H hH hrow r have he := physical_root_replacement_error V hV patterns C hq ζ k K starts r b hbound ε herror apply he.trans exact mul_le_mul_of_nonneg_left hm hε /- A polynomial residue-row bound is absorbed by choosing the per-path relative error exponent larger by the row exponent. -/ theorem physical_root_exponential_error {T : ℝ} (hT : 0 < T) (D E : ℝ) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance (∀ j (x : PhysicalBareResidueState P J ell), (∑ y : PhysicalBareResidueState P J ell, ∑ label : PhysicalEdgeLabels P J ell patterns C, ‖physicalResidueLabeledCoeff V patterns C q (ζ j) (k j) (K j) label x y‖) ≤ T^D) → (∀ (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell), |(∑ n ∈ starts, physicalFiniteVertexProduct C q k r L p n) / (starts.card : ℝ) - physicalFiniteVertexExpectation C q k r L p| ≤ Real.exp (-(E + D) * (r + 1) * Real.log T) * physicalFiniteVertexExpectation C q k r L p) → ‖physicalRootMoment V patterns C q ζ k K starts r b - physicalRootResidueModel V patterns C q ζ k K r‖ ≤ Real.exp (-E * (r + 1) * Real.log T) := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance intro hrow herror have he := physical_root_error_of_residue_rows hP hprime V hV hMass patterns C hq ζ k K starts r b hbound (T^D) (Real.exp (-(E + D) * (r + 1) * Real.log T)) (Real.rpow_nonneg hT.le D) (Real.exp_pos _).le hrow herror apply he.trans_eq rw [Real.rpow_def_of_pos hT, ← Real.exp_nat_mul, ← Real.exp_add] congr 1 push_cast ring end end section open Finset section variable {X Y R : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] [sharedInstance3 : Semiring R] (e : ℕ → X ≃ Y) (K : ℕ → X → X → R) (f : X → R) (n : ℕ) include X Y R sharedInstance1 sharedInstance2 sharedInstance3 e K f n /- Transporting the state coordinates separately at each time preserves the finite path action. The row at step `j` uses the coordinates at time `j + 1`, and the column uses those at time `j`. -/ theorem finite_path_action_conjugate (x : X) : finitePathAction (fun j y z => K j ((e (j + 1)).symm y) ((e j).symm z)) (fun y => f ((e 0).symm y)) n (e n x) = finitePathAction K f n x := by classical induction n generalizing x with | zero => simp [finitePathAction] | succ n ih => simp only [finitePathAction, Equiv.symm_apply_apply] rw [← (e n).sum_comp] simp only [Equiv.symm_apply_apply, ih] /- The same change-of-coordinates identity at an arbitrary target state. -/ theorem finite_path_action_conjugate_apply (y : Y) : finitePathAction (fun j y z => K j ((e (j + 1)).symm y) ((e j).symm z)) (fun y => f ((e 0).symm y)) n y = finitePathAction K f n ((e n).symm y) := by simpa using finite_path_action_conjugate e K f n ((e n).symm y) end end section open Finset end section open Finset end section open Finset /- A total local damping at most half the residue modulus leaves a baseline between one half and one. -/ theorem memory_baseline_bounds {T p : ℝ} (hT : 0 ≤ T) (hp : 0 < p) (hTp : 2 * T ≤ p) : 1 / 2 ≤ 1 - T / p ∧ 1 - T / p ≤ 1 := by have hlo : 0 ≤ T / p := div_nonneg hT hp.le have hhi : T / p ≤ 1 / 2 := (div_le_iff₀ hp).2 (by linarith) constructor <;> linarith /- Dividing by an admissible baseline changes a nonnegative weight by a factor between one and two. -/ theorem memory_baseline_inv_bounds {b : ℝ} (hb : 1 / 2 ≤ b ∧ b ≤ 1) : 1 ≤ 1 / b ∧ 1 / b ≤ 2 := by have hb0 : 0 < b := by linarith [hb.1] constructor · exact (le_div_iff₀ hb0).2 (by linarith [hb.2]) · exact (div_le_iff₀ hb0).2 (by linarith [hb.1]) /- Abstract tilted finite mass: any weights of total mass `V` are multiplied by at most two when every baseline lies between one half and one. -/ theorem memory_tilted_mass_bounds {ι : Type*} (S : Finset ι) (w b : ι → ℝ) (V : ℝ) (hV : 0 < V) (hw : ∀ i ∈ S, 0 ≤ w i) (hMass : ∑ i ∈ S, w i = V) (hb : ∀ i ∈ S, 1 / 2 ≤ b i ∧ b i ≤ 1) : 1 ≤ (∑ i ∈ S, w i / b i) / V ∧ (∑ i ∈ S, w i / b i) / V ≤ 2 := by have hterm : ∀ i ∈ S, w i ≤ w i / b i ∧ w i / b i ≤ 2 * w i := by intro i hi have hbi := memory_baseline_inv_bounds (hb i hi) constructor · calc w i = w i * 1 := by ring _ ≤ w i * (1 / b i) := mul_le_mul_of_nonneg_left hbi.1 (hw i hi) _ = _ := by ring · calc w i / b i = w i * (1 / b i) := by ring _ ≤ w i * 2 := mul_le_mul_of_nonneg_left hbi.2 (hw i hi) _ = _ := by ring have hlo : V ≤ ∑ i ∈ S, w i / b i := by rw [← hMass] exact sum_le_sum (fun i hi => (hterm i hi).1) have hhi : (∑ i ∈ S, w i / b i) ≤ 2 * V := by rw [← hMass, mul_sum] exact sum_le_sum (fun i hi => (hterm i hi).2) constructor · exact (le_div_iff₀ hV).2 (by simpa using hlo) · exact (div_le_iff₀ hV).2 hhi /- The existing normalized physical label law obeys the same factor-two tilt. -/ theorem memory_tilted_physical_label_mass {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (g : G) (b : P g → ℝ) (hV : 0 < V g) (hMass : ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hb : ∀ p, 1 / 2 ≤ b p ∧ b p ≤ 1) : 1 ≤ ∑ p : P g, physicalLabelLaw V g p / b p ∧ (∑ p : P g, physicalLabelLaw V g p / b p) ≤ 2 := by have hl : ∀ p : P g, 0 ≤ physicalLabelLaw V g p := by intro p exact div_nonneg zero_le_one (mul_nonneg hV.le (Nat.cast_nonneg p.val)) simpa only [div_one] using memory_tilted_mass_bounds univ (physicalLabelLaw V g) b 1 zero_lt_one (fun p _ => hl p) (physical_label_law_sum V g hV hMass) (fun p _ => hb p) /- Any finite product of admissible baselines is positive and at most one. -/ theorem memory_baseline_prod_bounds {ι : Type*} (S : Finset ι) (b : ι → ℝ) (hb : ∀ i ∈ S, 1 / 2 ≤ b i ∧ b i ≤ 1) : 0 < ∏ i ∈ S, b i ∧ (∏ i ∈ S, b i) ≤ 1 := by have hb0 : ∀ i ∈ S, 0 < b i := by intro i hi linarith [(hb i hi).1] exact ⟨prod_pos hb0, prod_le_one₀ (fun i hi => (hb0 i hi).le) (fun i hi => (hb i hi).2)⟩ end section open Finset end section open Finset end section open Finset end section open Finset Classical /- The absolute row sum has a fixed polynomial bound when there are logarithmically many groups and polynomial total pattern coefficient mass. -/ theorem exists_physical_residue_operator_power_row_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell m : ℕ) {C B : ℝ} (hC : 0 ≤ C) (hB : 0 ≤ B) : ∃ D : ℝ, 0 ≤ D ∧ ∀ (T : ℝ), 0 < T → ∀ (G : Type) [Fintype G] [DecidableEq G], (Fintype.card G : ℝ) ≤ C * Real.log T → ∀ (P : G → Finset ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val], Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime) → ∀ (J : ℕ) (V : G → ℝ), (∀ g, v ≤ V g) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → ∀ (I : Type) (patterns : Finset I) (slots : I → G → Finset (Fin J)) (bounds : I → ℝ), (∀ i ∈ patterns, ∀ g, (slots i g).card ≤ m) → (∀ i ∈ patterns, 0 ≤ bounds i) → (∑ i ∈ patterns, bounds i) ≤ T^B → ∀ (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (slots i) → ℂ), (∀ i ∈ patterns, ∀ L R aux, ‖K i L R aux‖ ≤ bounds i) → letI : Fintype (PhysicalEdgeLabels P J ell patterns slots) := inferInstance ∀ x : PhysicalBareResidueState P J ell, (∑ y : PhysicalBareResidueState P J ell, ∑ a : PhysicalEdgeLabels P J ell patterns slots, ‖physicalResidueLabeledCoeff V patterns slots q ζ k K a x y‖) ≤ T^D := by obtain ⟨A, hA, hrow⟩ := exists_physical_residue_operator_row_bound hq0 hq1 hv ell m refine ⟨B + C * Real.log A, add_nonneg hB (mul_nonneg hC (Real.log_nonneg hA)), ?_⟩ intro T hT G _ _ hG P _ hP hprime J V hV hMass I patterns slots bounds hslots hbounds hsum ζ k K hK let _ : Fintype (PhysicalEdgeLabels P J ell patterns slots) := inferInstance intro x exact (hrow G P hP hprime J V hV hMass I patterns slots bounds hslots hbounds ζ k K hK x).trans (group_pattern_weight_power_bound hT hA hG hsum) end section open Filter Finset theorem eventually_physical_root_replacement_of_power_rows {a c d C V E γ D q : ℝ} (ha : 0 ≤ a) (hc : 0 < c) (hd : 0 < d) (had : a + d < 1) (hC : 0 < C) (hV : 0 < V) (hE : 0 ≤ E) (hγ : 0 < γ) (hD : 0 ≤ D) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (J ell : ℕ) : ∀ᶠ T : ℝ in atTop, ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] (weights : G → ℝ) (I : Type) (patterns : Finset I) (slots : I → G → Finset (Fin J)) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (slots i) → ℂ) (r b N : ℕ) (z : ℤ), r + 1 = 2 * Nat.ceil (T^a) → Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime) → (Fintype.card G : ℝ) ≤ C * Real.log T → (∀ g, 0 < weights g) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = weights g) → (∀ g, weights g ≤ V) → (∀ g p, p ∈ P g → Real.exp (T^c) ≤ (p : ℝ)) → (∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp (T^d)) → (∀ j < r + 1, physicalOperatorStepBound P J ell patterns slots (k j) ≤ b) → 0 < N → γ * T ≤ Real.log (N : ℝ) → letI : Fintype (PhysicalEdgeLabels P J ell patterns slots) := inferInstance (∀ j (x : PhysicalBareResidueState P J ell), (∑ y : PhysicalBareResidueState P J ell, ∑ label : PhysicalEdgeLabels P J ell patterns slots, ‖physicalResidueLabeledCoeff weights patterns slots q (ζ j) (k j) (K j) label x y‖) ≤ T^D) → ‖physicalRootMoment weights patterns slots q ζ k K (Ico z (z + N)) r b - physicalRootResidueModel weights patterns slots q ζ k K r‖ ≤ Real.exp (-E * (r + 1) * Real.log T) := by filter_upwards [eventually_physical_finite_vertex_replacement ha hc hd had hC hV (add_nonneg hE hD) hγ J ell, eventually_gt_atTop (0 : ℝ)] with T hreplace hT intro G _ _ P _ weights I patterns slots ζ k K r b N z hlen hP hprime hs hweights hMass hupper hmin hmax hbound hN hNb let _ : Fintype (PhysicalEdgeLabels P J ell patterns slots) := inferInstance intro hrow apply physical_root_exponential_error hP hprime weights hweights hMass patterns slots hq0 ζ k K (Ico z (z + N)) r b hbound hT D E hrow intro L p have hp := hreplace G P I patterns slots k r hlen L p q N z hP hprime hs (fun g => (hMass g).trans_le (hupper g)) hmin hmax hq0 hq1 hN hNb simpa only [Int.card_Ico, add_sub_cancel_left, Int.toNat_natCast] using hp end section open Filter Finset theorem eventually_physical_root_replacement {a c d C V v E γ B q : ℝ} (ha : 0 ≤ a) (hc : 0 < c) (hd : 0 < d) (had : a + d < 1) (hC : 0 < C) (hV : 0 < V) (hv : 0 < v) (hE : 0 ≤ E) (hγ : 0 < γ) (hB : 0 ≤ B) (hq0 : 0 ≤ q) (hq1 : q < 1) (J ell m : ℕ) : ∀ᶠ T : ℝ in atTop, ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] (weights : G → ℝ) (I : Type) (patterns : Finset I) (slots : I → G → Finset (Fin J)) (bounds : I → ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (slots i) → ℂ) (r b N : ℕ) (z : ℤ), r + 1 = 2 * Nat.ceil (T^a) → Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime) → (Fintype.card G : ℝ) ≤ C * Real.log T → (∀ g, v ≤ weights g) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = weights g) → (∀ g, weights g ≤ V) → (∀ g p, p ∈ P g → Real.exp (T^c) ≤ (p : ℝ)) → (∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp (T^d)) → (∀ i ∈ patterns, ∀ g, (slots i g).card ≤ m) → (∀ i ∈ patterns, 0 ≤ bounds i) → (∑ i ∈ patterns, bounds i) ≤ T^B → (∀ j i, i ∈ patterns → ∀ L R aux, ‖K j i L R aux‖ ≤ bounds i) → (∀ j < r + 1, physicalOperatorStepBound P J ell patterns slots (k j) ≤ b) → 0 < N → γ * T ≤ Real.log (N : ℝ) → ‖physicalRootMoment weights patterns slots q ζ k K (Ico z (z + N)) r b - physicalRootResidueModel weights patterns slots q ζ k K r‖ ≤ Real.exp (-E * (r + 1) * Real.log T) := by obtain ⟨D, hD, hrow⟩ := exists_physical_residue_operator_power_row_bound hq0 hq1 hv ell m hC.le hB filter_upwards [eventually_physical_root_replacement_of_power_rows ha hc hd had hC hV hE hγ hD hq0 hq1.le J ell, eventually_gt_atTop (0 : ℝ)] with T hreplace hT intro G _ _ P _ weights I patterns slots bounds ζ k K r b N z hlen hP hprime hs hlow hMass hupper hmin hmax hslots hbounds hsum hK hcut hN hNb let _ : Fintype (PhysicalEdgeLabels P J ell patterns slots) := inferInstance apply hreplace G P weights I patterns slots ζ k K r b N z hlen hP hprime hs (fun g => hv.trans_le (hlow g)) hMass hupper hmin hmax hcut hN hNb intro j x exact hrow T hT G hs P hP hprime J weights hlow hMass I patterns slots bounds hslots hbounds hsum (ζ j) (k j) (K j) (hK j) x end section open Finset end section open Filter Finset end section open Finset open scoped BigOperators Classical /- In a finite set of primes, prime divisibility detects membership. -/ theorem prime_dvd_finset_prod_iff_mem (s : Finset ℕ) (hs : ∀ q ∈ s, Nat.Prime q) {p : ℕ} (hp : Nat.Prime p) : p ∣ ∏ q ∈ s, q ↔ p ∈ s := by constructor · intro hd obtain ⟨q, hq, hpq⟩ := (hp.prime.dvd_finsetProd_iff _).mp hd have he : p = q := ((Nat.dvd_prime (hs q hq)).mp hpq).resolve_left hp.ne_one exact he ▸ hq · intro hp exact dvd_prod_of_mem (fun q => q) hp section variable {G : Type*} [sharedInstance1 : Fintype G] (S : G → Finset ℕ) (hS : ∀ g p, p ∈ S g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (S g) (S h))) include G sharedInstance1 S hS hdis /- In disjoint prime groups, divisibility of the full product detects membership in the unique group containing the prime. -/ theorem grouped_prime_dvd_prod_iff_mem (A : G → Finset ℕ) (hA : ∀ g, A g ⊆ S g) (g : G) {p : ℕ} (hp : p ∈ S g) : p ∣ (∏ h, ∏ q ∈ A h, q) ↔ p ∈ A g := by constructor · intro hd obtain ⟨h, _, hdh⟩ := ((hS g p hp).prime.dvd_finsetProd_iff _).mp hd have hmem : p ∈ A h := (prime_dvd_finset_prod_iff_mem (A h) (fun q hq => hS h q (hA h hq)) (hS g p hp)).mp hdh have hgh : g = h := by by_contra hne exact (disjoint_left.mp (hdis hne)) hp (hA h hmem) subst h exact hmem · intro hpA exact dvd_trans (dvd_prod_of_mem (fun q => q) hpA) (dvd_prod_of_mem (fun h => ∏ q ∈ A h, q) (mem_univ g)) /- The product over disjoint prime groups determines every chosen subset. -/ theorem grouped_prime_subset_prod_eq_iff {A B : G → Finset ℕ} (hA : ∀ g, A g ⊆ S g) (hB : ∀ g, B g ⊆ S g) : (∏ g, ∏ p ∈ A g, p) = (∏ g, ∏ p ∈ B g, p) ↔ A = B := by constructor · intro he funext g ext p constructor · intro hp have hd := (grouped_prime_dvd_prod_iff_mem S hS hdis A hA g (hA g hp)).mpr hp rw [he] at hd exact (grouped_prime_dvd_prod_iff_mem S hS hdis B hB g (hA g hp)).mp hd · intro hp have hd := (grouped_prime_dvd_prod_iff_mem S hS hdis B hB g (hB g hp)).mpr hp rw [← he] at hd exact (grouped_prime_dvd_prod_iff_mem S hS hdis A hA g (hB g hp)).mp hd · rintro rfl rfl end /- An omission choice selects an `ell`-element subset from every group. -/ abbrev PrimeOmissionChoices {G : Type*} (S : G → Finset ℕ) (ell : ℕ) := ∀ g, ↥((S g).powersetCard ell) /- The positive integer formed by all omitted labels. -/ noncomputable def primeOmissionProduct {G : Type*} [Fintype G] (S : G → Finset ℕ) (ell : ℕ) (A : PrimeOmissionChoices S ell) : ℕ := ∏ g, ∏ p ∈ (A g).val, p /- Distinct tuples of omitted subsets give distinct natural products. -/ theorem prime_omission_product_injective {G : Type*} [Fintype G] (S : G → Finset ℕ) (ell : ℕ) (hS : ∀ g p, p ∈ S g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (S g) (S h))) : Function.Injective (primeOmissionProduct S ell) := by intro A B he have hAB : (fun g => (A g).val) = (fun g => (B g).val) := (grouped_prime_subset_prod_eq_iff S hS hdis (fun g => (mem_powersetCard.mp (A g).property).1) (fun g => (mem_powersetCard.mp (B g).property).1)).mp he funext g exact Subtype.ext (congrFun hAB g) end section open Finset /- Casts of distinct small natural omission products remain distinct. -/ theorem omission_natCast_injective {Ω : Type*} (p : ℕ) (U : Ω → ℕ) (hU : Function.Injective U) (hlt : ∀ c, U c < p) : Function.Injective (fun c => (U c : ZMod p)) := by intro c d he apply hU have h := (ZMod.natCast_eq_natCast_iff' (U c) (U d) p).mp he simpa only [Nat.mod_eq_of_lt (hlt c), Nat.mod_eq_of_lt (hlt d)] using h /- An omission is rare when at least one pending particle admits it. -/ noncomputable def rareOmissionChoices {Ω Particle : Type*} (choices : Finset Ω) (pending : Finset Particle) (allows : Particle → Ω → Prop) : Finset Ω := by classical exact choices.filter (fun c => ∃ z ∈ pending, allows z c) /- The union of at most one admissible omission per pending particle has cardinality at most the number of pending particles. -/ theorem rare_omission_choices_card_le {Ω Particle : Type*} (choices : Finset Ω) (pending : Finset Particle) (allows : Particle → Ω → Prop) (hunique : ∀ z ∈ pending, ∀ c ∈ choices, ∀ d ∈ choices, allows z c → allows z d → c = d) : (rareOmissionChoices choices pending allows).card ≤ pending.card := by classical have he : rareOmissionChoices choices pending allows = pending.biUnion (fun z => choices.filter (allows z)) := by ext c simp only [rareOmissionChoices, mem_filter, mem_biUnion] aesop rw [he] calc _ ≤ ∑ z ∈ pending, (choices.filter (allows z)).card := card_biUnion_le _ ≤ ∑ _z ∈ pending, 1 := by apply sum_le_sum intro z hz apply card_le_one.mpr intro c hc d hd exact hunique z hz c (mem_filter.mp hc).1 d (mem_filter.mp hd).1 (mem_filter.mp hc).2 (mem_filter.mp hd).2 _ = pending.card := by simp /- An equivalent uniqueness argument works directly with complementary products. Eligibility supplies nonvanishing of the dilation, so no global assumption about the full product is needed. -/ theorem complementary_omission_unique {Ω K : Type*} [Field K] (U D : Ω → K) (hU : Function.Injective U) (F r k : K) (hk : k ≠ 0) (hfactor : ∀ c, U c * D c = F) {c d : Ω} (hDc : D c ≠ 0) (hc : r + k * D c = 0) (hd : r + k * D d = 0) : c = d := by have hD : D c = D d := mul_left_cancel₀ hk (add_left_cancel (hc.trans hd.symm)) apply hU apply mul_right_cancel₀ hDc calc U c * D c = F := hfactor c _ = U d * D d := (hfactor d).symm _ = U d * D c := by rw [hD] /- A modular version of the actual eligible-promotion test. The fixed product relation may include the already conditioned big-prime factor. -/ theorem modular_complementary_omission_unique {Ω : Type*} {p : ℕ} (hp : p.Prime) (U D : Ω → ℕ) (hU : Function.Injective U) (hlt : ∀ c, U c < p) (F : ℕ) (hfactor : ∀ c, U c * D c = F) (r : ZMod p) (k : ℤ) (hk : ¬ (p : ℤ) ∣ k) {c d : Ω} (hDc : ¬ p ∣ D c) (hc : r + (k : ZMod p) * (D c : ZMod p) = 0) (hd : r + (k : ZMod p) * (D d : ZMod p) = 0) : c = d := by have : Fact p.Prime := ⟨hp⟩ apply complementary_omission_unique (fun c => (U c : ZMod p)) (fun c => (D c : ZMod p)) (omission_natCast_injective p U hU hlt) (F : ZMod p) r (k : ZMod p) ((ZMod.intCast_zmod_eq_zero_iff_dvd k p).not.mpr hk) (fun c => by rw [← Nat.cast_mul, hfactor c]) ((ZMod.natCast_eq_zero_iff (D c) p).not.mpr hDc) hc hd /- In the physical promotion test, nondivisibility of the dilation is part of eligibility. Even with that condition included, at most one omission choice is available per pending particle. -/ theorem modular_eligible_omission_card_le {Ω Particle : Type*} (choices : Finset Ω) (pending : Finset Particle) (U : Ω → ℕ) (hU : Function.Injective U) (p : Particle → ℕ) (hp : ∀ z, (p z).Prime) (D : Particle → Ω → ℕ) (F : Particle → ℕ) (hfactor : ∀ z c, U c * D z c = F z) (r : ∀ z, ZMod (p z)) (k : ℤ) (hk : ∀ z ∈ pending, ¬ (p z : ℤ) ∣ k) (hlt : ∀ z ∈ pending, ∀ c, U c < p z) : (rareOmissionChoices choices pending (fun z c => ¬ p z ∣ D z c ∧ r z + (k : ZMod (p z)) * (D z c : ZMod (p z)) = 0)).card ≤ pending.card := by apply rare_omission_choices_card_le intro z hz c hc d hd hcz hdz exact modular_complementary_omission_unique (hp z) U (D z) hU (hlt z hz) (F z) (hfactor z) (r z) k (hk z hz) hcz.1 hcz.2 hdz.2 end section open Finset open scoped BigOperators Classical /- The product of all labels in the source groups. -/ noncomputable def primeFullProduct {G : Type*} [Fintype G] (S : G → Finset ℕ) : ℕ := ∏ g, ∏ p ∈ S g, p /- The product of source labels retained after the omission choice. -/ noncomputable def primeRetainedProduct {G : Type*} [Fintype G] (S : G → Finset ℕ) (ell : ℕ) (A : PrimeOmissionChoices S ell) : ℕ := ∏ g, ∏ p ∈ S g \ (A g).val, p /- The dilation with a fixed factor from the already conditioned groups. -/ noncomputable def primeOmissionDilation {G : Type*} [Fintype G] (S : G → Finset ℕ) (ell D_B : ℕ) (A : PrimeOmissionChoices S ell) : ℕ := D_B * primeRetainedProduct S ell A /- Omitted and retained factors partition the full product. This identity needs only the subset condition and does not assume primality. -/ theorem prime_omission_mul_retained_eq_full {G : Type*} [Fintype G] (S : G → Finset ℕ) (ell : ℕ) (A : PrimeOmissionChoices S ell) : primeOmissionProduct S ell A * primeRetainedProduct S ell A = primeFullProduct S := by unfold primeOmissionProduct primeRetainedProduct primeFullProduct rw [← prod_mul_distrib] apply prod_congr rfl intro g _ rw [mul_comm] exact prod_sdiff (mem_powersetCard.mp (A g).property).1 /- Multiplying each dilation by its omitted product gives the same constant, including the fixed conditioned factor. -/ theorem prime_omission_mul_dilation_eq {G : Type*} [Fintype G] (S : G → Finset ℕ) (ell D_B : ℕ) (A : PrimeOmissionChoices S ell) : primeOmissionProduct S ell A * primeOmissionDilation S ell D_B A = D_B * primeFullProduct S := by unfold primeOmissionDilation rw [mul_left_comm, prime_omission_mul_retained_eq_full] end section open Finset end section open Finset end section open Finset open scoped Classical end section open Filter open scoped Topology /- For positive omission size, the binomial choice count grows at least linearly in the number of retained slots. -/ theorem succ_le_choose_add (ell J : ℕ) (hell : 0 < ell) : J + 1 ≤ (J + ell).choose ell := by calc J + 1 = (J + 1).choose J := (Nat.choose_succ_self_right J).symm _ ≤ (J + ell).choose J := Nat.choose_le_choose J (by omega) _ = (J + ell).choose ell := Nat.choose_symm_add /- With positive fixed omission size, the choice count tends to infinity. -/ theorem tendsto_choose_add_atTop (ell : ℕ) (hell : 0 < ell) : Tendsto (fun J : ℕ => (J + ell).choose ell) atTop atTop := by apply tendsto_atTop_mono (fun J => (Nat.le_succ J).trans (succ_le_choose_add ell J hell)) exact tendsto_id /- The logarithm of the choice count also tends to infinity with `J`. -/ theorem tendsto_log_choose_add_atTop (ell : ℕ) (hell : 0 < ell) : Tendsto (fun J : ℕ => Real.log (((J + ell).choose ell : ℕ) : ℝ)) atTop atTop := by exact Real.tendsto_log_atTop.comp ((tendsto_natCast_atTop_atTop : Tendsto (fun n : ℕ => (n : ℝ)) atTop atTop).comp (tendsto_choose_add_atTop ell hell)) /- The threshold can be achieved together with any previous lower bound on `J`, so this choice is compatible with other fixed-parameter conditions. -/ theorem exists_log_choose_add_gt_ge (ell : ℕ) (hell : 0 < ell) (K : ℝ) (J₀ : ℕ) : ∃ J : ℕ, J₀ ≤ J ∧ K < Real.log (((J + ell).choose ell : ℕ) : ℝ) := ((eventually_ge_atTop J₀).and ((tendsto_log_choose_add_atTop ell hell).eventually_gt_atTop K)).exists end section open Finset open scoped BigOperators Classical /- A map of finite types with equally sized fibres carries the uniform average to the uniform average. -/ theorem uniform_average_of_equal_fiber_card {Ω T : Type*} [Fintype Ω] [Nonempty Ω] [Fintype T] [DecidableEq T] (q : Ω → T) (hcard : ∀ t u : T, Fintype.card {a : Ω // q a = t} = Fintype.card {a : Ω // q a = u}) (f : T → ℝ) : (∑ a : Ω, f (q a)) / (Fintype.card Ω : ℝ) = (∑ t : T, f t) / (Fintype.card T : ℝ) := by let a₀ : Ω := Classical.choice inferInstance let m : ℕ := Fintype.card {a : Ω // q a = q a₀} have hm : ∀ t : T, Fintype.card {a : Ω // q a = t} = m := fun t => hcard t (q a₀) have hmpos : 0 < m := by apply Fintype.card_pos_iff.mpr exact ⟨⟨a₀, rfl⟩⟩ have hmne : (m : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hmpos) have hsum : ∀ f : T → ℝ, (∑ a : Ω, f (q a)) = (m : ℝ) * ∑ t : T, f t := by intro f rw [← Fintype.sum_fiberwise' q f] simp only [sum_const, card_univ, hm, nsmul_eq_mul] rw [← mul_sum] have htotal : (Fintype.card Ω : ℝ) = (m : ℝ) * (Fintype.card T : ℝ) := by simpa only [sum_const, card_univ, nsmul_eq_mul, mul_one] using hsum (fun _ => 1) rw [hsum f, htotal] exact mul_div_mul_left _ _ hmne /- All possible fixed-cardinality omissions from a finite type. -/ abbrev UniformOmissionSubsets (α : Type*) [Fintype α] (ell : ℕ) := ↥((univ : Finset α).powersetCard ell) /- Permuting a fixed set of slots produces a fixed-cardinality omission. -/ def permutedOmissionSubset {α : Type*} [Fintype α] {ell : ℕ} (s : Finset α) (hs : s.card = ell) (σ : Equiv.Perm α) : UniformOmissionSubsets α ell := ⟨s.map σ.toEmbedding, mem_powersetCard.mpr ⟨subset_univ _, by simpa only [card_map] using hs⟩⟩ /- The number of possible omissions is the binomial choice count. -/ theorem uniform_omission_subsets_card (α : Type*) [Fintype α] (ell : ℕ) : Fintype.card (UniformOmissionSubsets α ell) = (Fintype.card α).choose ell := by simp only [UniformOmissionSubsets, Fintype.card_coe, card_powersetCard, card_univ] /- Composition with a permutation taking `t` to `u` bijects the two fibres of the omission map. -/ theorem permuted_omission_fiber_card_eq {α : Type*} [Fintype α] {ell : ℕ} (s : Finset α) (hs : s.card = ell) (t u : UniformOmissionSubsets α ell) : Fintype.card {σ : Equiv.Perm α // permutedOmissionSubset s hs σ = t} = Fintype.card {σ : Equiv.Perm α // permutedOmissionSubset s hs σ = u} := by obtain ⟨τ, hτ⟩ := Equiv.Perm.exists_map_finset_eq t.val u.val ((mem_powersetCard.mp t.property).2.trans (mem_powersetCard.mp u.property).2.symm) apply Fintype.card_congr refine Equiv.subtypeEquiv (Equiv.mulLeft τ) ?_ intro σ constructor · intro hσ apply Subtype.ext have hv : s.map σ.toEmbedding = t.val := congrArg Subtype.val hσ change s.map (τ * σ).toEmbedding = u.val calc s.map (τ * σ).toEmbedding = (s.map σ.toEmbedding).map τ.toEmbedding := by rw [map_map] rfl _ = u.val := by rw [hv, hτ] · intro hσ apply Subtype.ext apply (map_injective τ.toEmbedding) have hv : s.map (τ * σ).toEmbedding = u.val := congrArg Subtype.val hσ change (s.map σ.toEmbedding).map τ.toEmbedding = t.val.map τ.toEmbedding rw [hτ, map_map] exact hv end section open Finset open scoped BigOperators Classical /- A fibre of a pointwise map is the product of its coordinate fibres. -/ def pointwiseMapFiberEquiv {G Ω T : Type*} (q : Ω → T) (t : G → T) : {a : G → Ω // (fun g => q (a g)) = t} ≃ (∀ g, {a : Ω // q a = t g}) where toFun a g := ⟨a.val g, congrFun a.property g⟩ invFun a := ⟨fun g => (a g).val, funext (fun g => (a g).property)⟩ left_inv a := by apply Subtype.ext rfl right_inv a := by funext g rfl /- Coordinate fibre sizes multiply for a finite pointwise map. -/ theorem pointwise_map_fiber_card {G Ω T : Type*} [Fintype G] [Fintype Ω] [DecidableEq T] (q : Ω → T) (t : G → T) : Fintype.card {a : G → Ω // (fun g => q (a g)) = t} = ∏ g, Fintype.card {a : Ω // q a = t g} := by rw [← Fintype.card_pi] exact Fintype.card_congr (pointwiseMapFiberEquiv q t) /- Equal coordinate fibres give equal fibres on arbitrary tuples. -/ theorem pointwise_map_fiber_card_eq {G Ω T : Type*} [Fintype G] [Fintype Ω] [DecidableEq T] (q : Ω → T) (hcard : ∀ t u : T, Fintype.card {a : Ω // q a = t} = Fintype.card {a : Ω // q a = u}) (t u : G → T) : Fintype.card {a : G → Ω // (fun g => q (a g)) = t} = Fintype.card {a : G → Ω // (fun g => q (a g)) = u} := by rw [pointwise_map_fiber_card, pointwise_map_fiber_card] exact prod_congr rfl (fun g _ => hcard (t g) (u g)) /- The uniform pointwise pushforward identity holds for every function of the full output tuple, with no separability assumption. -/ theorem uniform_pointwise_average_of_equal_fiber_card {G Ω T : Type*} [Fintype G] [Fintype Ω] [Nonempty Ω] [Fintype T] [DecidableEq T] (q : Ω → T) (hcard : ∀ t u : T, Fintype.card {a : Ω // q a = t} = Fintype.card {a : Ω // q a = u}) (f : (G → T) → ℝ) : (∑ a : G → Ω, f (fun g => q (a g))) / (Fintype.card (G → Ω) : ℝ) = (∑ t : G → T, f t) / ((Fintype.card T) ^ Fintype.card G : ℕ) := by have h := uniform_average_of_equal_fiber_card (Ω := G → Ω) (T := G → T) (fun a g => q (a g)) (fun t u => pointwise_map_fiber_card_eq q hcard t u) f simpa only [Fintype.card_pi, prod_const, card_univ] using h /- A simultaneous omission choice in every group. -/ abbrev GroupedOmissionSubsets (G α : Type*) [Fintype α] (ell : ℕ) := G → UniformOmissionSubsets α ell /- Independent permutations act on the fixed omission slots groupwise. -/ def groupedPermutedOmissions {G α : Type*} [Fintype α] {ell : ℕ} (s : Finset α) (hs : s.card = ell) (σ : G → Equiv.Perm α) : GroupedOmissionSubsets G α ell := fun g => permutedOmissionSubset s hs (σ g) section variable {G α : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : Fintype α] {ell : ℕ} (s : Finset α) (hs : s.card = ell) include G α sharedInstance1 sharedInstance2 ell s hs /- The exact joint averaging identity for independent group permutations. -/ theorem grouped_uniform_omission_average (f : GroupedOmissionSubsets G α ell → ℝ) : (∑ σ : G → Equiv.Perm α, f (groupedPermutedOmissions s hs σ)) / (Fintype.card (G → Equiv.Perm α) : ℝ) = (∑ t : GroupedOmissionSubsets G α ell, f t) / (((Fintype.card α).choose ell) ^ Fintype.card G : ℕ) := by unfold groupedPermutedOmissions have h := uniform_pointwise_average_of_equal_fiber_card (G := G) (Ω := Equiv.Perm α) (T := UniformOmissionSubsets α ell) (permutedOmissionSubset s hs) (fun t u => permuted_omission_fiber_card_eq s hs t u) f simpa only [uniform_omission_subsets_card] using h /- The bad-omission fraction remains exact for arbitrary joint bad sets. -/ theorem grouped_uniform_bad_omission_fraction (bad : Finset (GroupedOmissionSubsets G α ell)) : ((univ.filter (fun σ : G → Equiv.Perm α => groupedPermutedOmissions s hs σ ∈ bad)).card : ℝ) / (Fintype.card (G → Equiv.Perm α) : ℝ) = (bad.card : ℝ) / (((Fintype.card α).choose ell) ^ Fintype.card G : ℕ) := by have h := grouped_uniform_omission_average s hs (fun t => if t ∈ bad then 1 else 0) simpa only [sum_boole, filter_mem_eq_inter, univ_inter] using h /- Any joint bad-set cardinality bound therefore transfers to the actual uniform law on independent groupwise permutations. -/ theorem grouped_uniform_bad_omission_fraction_le (bad : Finset (GroupedOmissionSubsets G α ell)) (B : ℕ) (hbad : bad.card ≤ B) : ((univ.filter (fun σ : G → Equiv.Perm α => groupedPermutedOmissions s hs σ ∈ bad)).card : ℝ) / (Fintype.card (G → Equiv.Perm α) : ℝ) ≤ (B : ℝ) / (((Fintype.card α).choose ell) ^ Fintype.card G : ℕ) := by rw [grouped_uniform_bad_omission_fraction] exact div_le_div_of_nonneg_right (by exact_mod_cast hbad) (Nat.cast_nonneg _) end end section open Filter open scoped Topology theorem integral_one_div_mul_log {A B : ℝ} (hA : 1 < A) (hAB : A ≤ B) : (∫ x in A..B, 1 / (x * Real.log x)) = Real.log (Real.log B) - Real.log (Real.log A) := by simpa only [one_div, mul_inv, div_eq_mul_inv, one_mul] using integral_inv_div_log hA (hA.trans_le hAB) theorem integral_one_div_mul_log_exp {t lam : ℝ} (ht : 0 < t) (hlam : 1 ≤ lam) : (∫ x in Real.exp t..Real.exp (lam * t), 1 / (x * Real.log x)) = Real.log lam := by rw [integral_one_div_mul_log (Real.one_lt_exp_iff.mpr ht) (Real.exp_le_exp.mpr (le_mul_of_one_le_left ht.le hlam)), Real.log_exp, Real.log_exp, Real.log_mul (by positivity) ht.ne'] ring theorem prime_counting_lower_constant_pos : 0 < Real.log 2 / 2 := by positivity theorem prime_counting_upper_constant_pos : 0 < Real.log 4 + 1 := by positivity theorem eventually_primeCounting_chebyshev_bounds : ∀ᶠ x : ℝ in atTop, (Real.log 2 / 2) * x / Real.log x ≤ (Nat.primeCounting ⌊x⌋₊ : ℝ) ∧ (Nat.primeCounting ⌊x⌋₊ : ℝ) ≤ (Real.log 4 + 1) * x / Real.log x := by have hlog : Tendsto (fun x : ℝ => Real.log (x + 2) / x) atTop (𝓝 0) := by simpa only [Function.comp_def, id_eq, pow_one, one_mul, add_neg_cancel_right] using (Real.tendsto_pow_log_div_mul_add_atTop 1 (-2) 1 one_ne_zero).comp (tendsto_atTop_add_const_right atTop (2 : ℝ) tendsto_id) have hsmall : ∀ᶠ x : ℝ in atTop, Real.log (x + 2) / x < Real.log 2 / 4 := hlog.eventually_lt_const (by positivity) filter_upwards [hsmall, eventually_ge_atTop (4 : ℝ), Chebyshev.eventually_primeCounting_le (show (0 : ℝ) < 1 by norm_num)] with x hx hx4 hupper refine ⟨?_, hupper⟩ have hx0 : 0 < x := by linarith have hx1 : 1 < x := by linarith have hlog2 : 0 < Real.log 2 := by positivity have hsmall' := (div_lt_iff₀ hx0).mp hx apply le_trans ?_ (Chebyshev.pi_ge' hx1) apply div_le_div_of_nonneg_right _ (Real.log_pos hx1).le nlinarith end section open Finset MeasureTheory open Filter open scoped Topology noncomputable def primeBand (A B : ℝ) : Finset ℕ := (Ioc ⌊A⌋₊ ⌊B⌋₊).filter Nat.Prime noncomputable def primeBandHarmonic (A B : ℝ) : ℝ := ∑ p ∈ primeBand A B, 1 / (p : ℝ) noncomputable def primeCountingReal (x : ℝ) : ℝ := (Nat.primeCounting ⌊x⌋₊ : ℝ) theorem mem_primeBand_iff {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (p : ℕ) : p ∈ primeBand A B ↔ p.Prime ∧ A < (p : ℝ) ∧ (p : ℝ) ≤ B := by simp only [primeBand, mem_filter, mem_Ioc, Nat.floor_lt hA, Nat.le_floor_iff hB] tauto theorem primeCountingReal_eq_sum (x : ℝ) : primeCountingReal x = ∑ n ∈ Icc 0 ⌊x⌋₊, if n.Prime then (1 : ℝ) else 0 := by rw [sum_boole] simp only [primeCountingReal, Nat.primeCounting, Nat.primeCounting', Nat.count_eq_card_filter_range, Nat.range_succ_eq_Icc_zero] theorem primeBandHarmonic_nonneg (A B : ℝ) : 0 ≤ primeBandHarmonic A B := by exact sum_nonneg (fun _ _ => by positivity) theorem primeCountingReal_nonneg (x : ℝ) : 0 ≤ primeCountingReal x := by exact Nat.cast_nonneg _ theorem prime_counting_quotient_intervalIntegrable {A B : ℝ} (hA : 0 < A) (hAB : A ≤ B) : IntervalIntegrable (fun t => primeCountingReal t / t^2) volume A B := by rw [intervalIntegrable_iff_integrableOn_Icc_of_le hAB] have hg : IntegrableOn (fun t : ℝ => (t^2)⁻¹) (Set.Icc A B) := by apply ContinuousOn.integrableOn_Icc intro t ht have ht0 : t ≠ 0 := ne_of_gt (hA.trans_le ht.1) have ht2 : t^2 ≠ 0 := pow_ne_zero 2 ht0 fun_prop have h := integrableOn_mul_sum_Icc (fun n => if n.Prime then (1 : ℝ) else 0) hA.le hg (m := 0) simpa only [← primeCountingReal_eq_sum, div_eq_mul_inv, mul_comm] using h /- Exact partial summation on a real prime interval. -/ theorem primeBandHarmonic_eq_abel {A B : ℝ} (hA : 0 < A) (hAB : A ≤ B) : primeBandHarmonic A B = primeCountingReal B / B - primeCountingReal A / A + ∫ t in A..B, primeCountingReal t / t^2 := by let c : ℕ → ℝ := fun n => if n.Prime then 1 else 0 have hc (x : ℝ) : (∑ n ∈ Icc 0 ⌊x⌋₊, c n) = primeCountingReal x := (primeCountingReal_eq_sum x).symm have hd : ∀ t ∈ Set.Icc A B, DifferentiableAt ℝ (fun t : ℝ => t⁻¹) t := by intro t ht have ht0 : t ≠ 0 := ne_of_gt (hA.trans_le ht.1) fun_prop have hi : IntegrableOn (deriv (fun t : ℝ => t⁻¹)) (Set.Icc A B) := by simp only [deriv_inv'] apply ContinuousOn.integrableOn_Icc intro t ht have ht0 : t ≠ 0 := ne_of_gt (hA.trans_le ht.1) have ht2 : t^2 ≠ 0 := pow_ne_zero 2 ht0 fun_prop have hs := sum_mul_eq_sub_sub_integral_mul c hA.le hAB hd hi have hl : (∑ n ∈ Ioc ⌊A⌋₊ ⌊B⌋₊, (n : ℝ)⁻¹ * c n) = primeBandHarmonic A B := by simp only [primeBandHarmonic, primeBand, sum_filter, c, mul_ite, mul_one, mul_zero, one_div] have he : (fun t : ℝ => deriv (fun t : ℝ => t⁻¹) t * ∑ n ∈ Icc 0 ⌊t⌋₊, c n) = (fun t => -(primeCountingReal t / t^2)) := by funext t rw [deriv_inv, hc] ring rw [hl, hc, hc, he, integral_neg, ← intervalIntegral.integral_of_le hAB, sub_neg_eq_add] at hs simpa only [div_eq_mul_inv, mul_comm] using hs /- Uniform prime-counting bounds give reciprocal prime mass bounds, retaining only the two endpoint errors and one elementary logarithmic integral. -/ theorem primeBandHarmonic_bounds_of_counting {A B a b : ℝ} (hA : 1 < A) (hAB : A ≤ B) (hlower : ∀ t ∈ Set.Icc A B, a * t / Real.log t ≤ primeCountingReal t) (hupper : ∀ t ∈ Set.Icc A B, primeCountingReal t ≤ b * t / Real.log t) : a * (∫ t in A..B, 1 / (t * Real.log t)) - b / Real.log A ≤ primeBandHarmonic A B ∧ primeBandHarmonic A B ≤ b * (∫ t in A..B, 1 / (t * Real.log t)) + b / Real.log B := by have hA0 : 0 < A := lt_trans zero_lt_one hA have hB0 : 0 < B := hA0.trans_le hAB have hlogint : IntervalIntegrable (fun t : ℝ => 1 / (t * Real.log t)) volume A B := by rw [intervalIntegrable_iff_integrableOn_Icc_of_le hAB] apply ContinuousOn.integrableOn_Icc intro t ht have ht1 : 1 < t := hA.trans_le ht.1 have ht0 : t ≠ 0 := ne_of_gt (lt_trans zero_lt_one ht1) have hlog0 : Real.log t ≠ 0 := ne_of_gt (Real.log_pos ht1) have hprod0 : t * Real.log t ≠ 0 := mul_ne_zero ht0 hlog0 fun_prop have hpiint := prime_counting_quotient_intervalIntegrable hA0 hAB have hloint : a * (∫ t in A..B, 1 / (t * Real.log t)) ≤ ∫ t in A..B, primeCountingReal t / t^2 := by rw [← intervalIntegral.integral_const_mul] apply intervalIntegral.integral_mono_on hAB (hlogint.const_mul a) hpiint intro t ht have ht0 : t ≠ 0 := ne_of_gt (hA0.trans_le ht.1) have he : a * (1 / (t * Real.log t)) = (a * t / Real.log t) / t^2 := by field_simp rw [he] exact div_le_div_of_nonneg_right (hlower t ht) (sq_nonneg t) have hupint : (∫ t in A..B, primeCountingReal t / t^2) ≤ b * (∫ t in A..B, 1 / (t * Real.log t)) := by rw [← intervalIntegral.integral_const_mul] apply intervalIntegral.integral_mono_on hAB hpiint (hlogint.const_mul b) intro t ht have ht0 : t ≠ 0 := ne_of_gt (hA0.trans_le ht.1) have he : b * (1 / (t * Real.log t)) = (b * t / Real.log t) / t^2 := by field_simp rw [he] exact div_le_div_of_nonneg_right (hupper t ht) (sq_nonneg t) have hleft : primeCountingReal A / A ≤ b / Real.log A := by apply (div_le_iff₀ hA0).mpr calc primeCountingReal A ≤ b * A / Real.log A := hupper A ⟨le_rfl, hAB⟩ _ = (b / Real.log A) * A := by ring have hright : primeCountingReal B / B ≤ b / Real.log B := by apply (div_le_iff₀ hB0).mpr calc primeCountingReal B ≤ b * B / Real.log B := hupper B ⟨hAB, le_rfl⟩ _ = (b / Real.log B) * B := by ring have hleft0 : 0 ≤ primeCountingReal A / A := div_nonneg (primeCountingReal_nonneg A) hA0.le have hright0 : 0 ≤ primeCountingReal B / B := div_nonneg (primeCountingReal_nonneg B) hB0.le rw [primeBandHarmonic_eq_abel hA0 hAB] constructor <;> linarith theorem primeBandHarmonic_exp_bounds_of_counting {t lam a b : ℝ} (ht : 0 < t) (hlam : 1 ≤ lam) (hlower : ∀ u ∈ Set.Icc (Real.exp t) (Real.exp (lam * t)), a * u / Real.log u ≤ primeCountingReal u) (hupper : ∀ u ∈ Set.Icc (Real.exp t) (Real.exp (lam * t)), primeCountingReal u ≤ b * u / Real.log u) : a * Real.log lam - b / t ≤ primeBandHarmonic (Real.exp t) (Real.exp (lam * t)) ∧ primeBandHarmonic (Real.exp t) (Real.exp (lam * t)) ≤ b * Real.log lam + b / (lam * t) := by have h := primeBandHarmonic_bounds_of_counting (Real.one_lt_exp_iff.mpr ht) (Real.exp_le_exp.mpr (le_mul_of_one_le_left ht.le hlam)) hlower hupper simpa only [integral_one_div_mul_log_exp ht hlam, Real.log_exp] using h /- Positive two-sided Chebyshev constants already suffice for uniform reciprocal prime mass in every fixed-ratio logarithmic band. -/ theorem eventually_primeBandHarmonic_bounds_of_counting {a b lam : ℝ} (ha : 0 < a) (hb : 0 < b) (hlam : 1 < lam) (hcount : ∀ᶠ u : ℝ in atTop, a * u / Real.log u ≤ primeCountingReal u ∧ primeCountingReal u ≤ b * u / Real.log u) : ∀ᶠ t : ℝ in atTop, a * Real.log lam / 2 ≤ primeBandHarmonic (Real.exp t) (Real.exp (lam * t)) ∧ primeBandHarmonic (Real.exp t) (Real.exp (lam * t)) ≤ 2 * b * Real.log lam := by obtain ⟨u0, hu0⟩ := eventually_atTop.1 hcount have hlog : 0 < Real.log lam := Real.log_pos hlam filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop u0, eventually_ge_atTop (2 * b / (a * Real.log lam)), eventually_ge_atTop (1 / Real.log lam)] with t ht1 htu htl hth have ht : 0 < t := zero_lt_one.trans_le ht1 have hu : u0 ≤ Real.exp t := htu.trans (by linarith [Real.add_one_le_exp t]) have hband := primeBandHarmonic_exp_bounds_of_counting ht hlam.le (fun u hmem => (hu0 u (hu.trans hmem.1)).1) (fun u hmem => (hu0 u (hu.trans hmem.1)).2) have hlo : b / t ≤ a * Real.log lam / 2 := by have h := (div_le_iff₀ (mul_pos ha hlog)).mp htl apply (div_le_iff₀ ht).mpr nlinarith have hhi : b / (lam * t) ≤ b * Real.log lam := by have h := (div_le_iff₀ hlog).mp hth have hlt : t ≤ lam * t := le_mul_of_one_le_left ht.le hlam.le have hh : 1 ≤ Real.log lam * (lam * t) := by nlinarith apply (div_le_iff₀ (mul_pos (zero_lt_one.trans hlam) ht)).mpr nlinarith [mul_nonneg hb.le (sub_nonneg.mpr hh)] constructor <;> linarith [hband.1, hband.2] /- The required fixed-ratio prime-band bounds are unconditional consequences of the elementary Chebyshev estimates. -/ theorem eventually_primeBandHarmonic_bounds {lam : ℝ} (hlam : 1 < lam) : ∀ᶠ t : ℝ in atTop, (Real.log 2 / 2) * Real.log lam / 2 ≤ primeBandHarmonic (Real.exp t) (Real.exp (lam * t)) ∧ primeBandHarmonic (Real.exp t) (Real.exp (lam * t)) ≤ 2 * (Real.log 4 + 1) * Real.log lam := by apply eventually_primeBandHarmonic_bounds_of_counting prime_counting_lower_constant_pos prime_counting_upper_constant_pos hlam exact eventually_primeCounting_chebyshev_bounds theorem exists_primeBandHarmonic_bounds {lam : ℝ} (hlam : 1 < lam) : ∃ vmin vmax : ℝ, 0 < vmin ∧ 0 < vmax ∧ ∀ᶠ t : ℝ in atTop, vmin ≤ primeBandHarmonic (Real.exp t) (Real.exp (lam * t)) ∧ primeBandHarmonic (Real.exp t) (Real.exp (lam * t)) ≤ vmax := by refine ⟨(Real.log 2 / 2) * Real.log lam / 2, 2 * (Real.log 4 + 1) * Real.log lam, ?_, ?_, eventually_primeBandHarmonic_bounds hlam⟩ · exact div_pos (mul_pos prime_counting_lower_constant_pos (Real.log_pos hlam)) (by norm_num) · exact mul_pos (mul_pos (by norm_num) prime_counting_upper_constant_pos) (Real.log_pos hlam) theorem exists_primeBandHarmonic_threshold {lam : ℝ} (hlam : 1 < lam) : ∃ vmin vmax t0 : ℝ, 0 < vmin ∧ 0 < vmax ∧ 0 < t0 ∧ ∀ t : ℝ, t0 ≤ t → vmin ≤ primeBandHarmonic (Real.exp t) (Real.exp (lam * t)) ∧ primeBandHarmonic (Real.exp t) (Real.exp (lam * t)) ≤ vmax := by obtain ⟨vmin, vmax, hvmin, hvmax, hevent⟩ := exists_primeBandHarmonic_bounds hlam obtain ⟨t0, ht0⟩ := eventually_atTop.1 hevent refine ⟨vmin, vmax, max 1 t0, hvmin, hvmax, zero_lt_one.trans_le (le_max_left _ _), ?_⟩ intro t ht exact ht0 t ((le_max_right _ _).trans ht) end section open Finset theorem primeBand_subset_of_bounds {A B C D : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hD : 0 ≤ D) (hCA : C ≤ A) (hBD : B ≤ D) : primeBand A B ⊆ primeBand C D := by intro p hp obtain ⟨hp, hAp, hpB⟩ := (mem_primeBand_iff hA hB p).mp hp exact (mem_primeBand_iff hC hD p).mpr ⟨hp, hCA.trans_lt hAp, hpB.trans hBD⟩ theorem disjoint_primeBand_of_le {A B C D : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hD : 0 ≤ D) (hBC : B ≤ C) : Disjoint (primeBand A B) (primeBand C D) := by apply disjoint_left.mpr intro p hp hq have hpB := ((mem_primeBand_iff hA hB p).mp hp).2.2 have hCp := ((mem_primeBand_iff hC hD p).mp hq).2.1 exact (not_lt_of_ge (hpB.trans hBC)) hCp noncomputable def dyadicPrimeBand (s lower upper : ℝ) (j : ℕ) : Finset ℕ := primeBand (Real.exp (lower * s / 2^j)) (Real.exp (upper * s / 2^j)) theorem mem_dyadicPrimeBand_iff (s lower upper : ℝ) (j p : ℕ) : p ∈ dyadicPrimeBand s lower upper j ↔ p.Prime ∧ Real.exp (lower * s / 2^j) < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp (upper * s / 2^j) := by exact mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le p section variable {s lower upper : ℝ} {i j : ℕ} (hs : 0 ≤ s) (hlower : 0 ≤ lower) (hgap : upper ≤ 2 * lower) (hij : i < j) include s lower upper i j hs hlower hgap hij theorem dyadic_band_endpoint_le : upper * s / 2^j ≤ lower * s / 2^i := by apply (div_le_div_iff₀ (by positivity : (0 : ℝ) < 2^j) (by positivity : (0 : ℝ) < 2^i)).mpr have hp : (2 : ℝ)^(i+1) ≤ 2^j := pow_le_pow_right₀ (by norm_num) hij have hmul := mul_le_mul_of_nonneg_left hp (mul_nonneg hlower hs) have hbound := mul_le_mul_of_nonneg_right hgap (mul_nonneg hs (by positivity : (0 : ℝ) ≤ 2^i)) rw [pow_succ] at hmul nlinarith theorem disjoint_dyadicPrimeBand_of_lt : Disjoint (dyadicPrimeBand s lower upper i) (dyadicPrimeBand s lower upper j) := by apply Disjoint.symm apply disjoint_primeBand_of_le (Real.exp_pos _).le (Real.exp_pos _).le (Real.exp_pos _).le (Real.exp_pos _).le exact Real.exp_le_exp.mpr (dyadic_band_endpoint_le hs hlower hgap hij) end theorem pairwise_disjoint_dyadicPrimeBand {s lower upper : ℝ} (hs : 0 ≤ s) (hlower : 0 ≤ lower) (hgap : upper ≤ 2 * lower) : Pairwise (fun i j : ℕ => Disjoint (dyadicPrimeBand s lower upper i) (dyadicPrimeBand s lower upper j)) := by intro i j hij rcases lt_or_gt_of_ne hij with hij | hji · exact disjoint_dyadicPrimeBand_of_lt hs hlower hgap hij · exact (disjoint_dyadicPrimeBand_of_lt hs hlower hgap hji).symm theorem dyadicPrimeBand_subset_of_bounds {s lower upper lower' upper' : ℝ} (j : ℕ) (hs : 0 ≤ s) (hlower : lower' ≤ lower) (hupper : upper ≤ upper') : dyadicPrimeBand s lower upper j ⊆ dyadicPrimeBand s lower' upper' j := by apply primeBand_subset_of_bounds (Real.exp_pos _).le (Real.exp_pos _).le (Real.exp_pos _).le (Real.exp_pos _).le · apply Real.exp_le_exp.mpr exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hlower hs) (by positivity) · apply Real.exp_le_exp.mpr exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hupper hs) (by positivity) theorem disjoint_dyadicPrimeBand_of_separated {s a b c d : ℝ} (j : ℕ) (hs : 0 ≤ s) (hbc : b ≤ c) : Disjoint (dyadicPrimeBand s a b j) (dyadicPrimeBand s c d j) := by apply disjoint_primeBand_of_le (Real.exp_pos _).le (Real.exp_pos _).le (Real.exp_pos _).le (Real.exp_pos _).le apply Real.exp_le_exp.mpr exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hbc hs) (by positivity) noncomputable def candidateQBand (s : ℝ) (j : ℕ) : Finset ℕ := dyadicPrimeBand s 1 (6/5) j noncomputable def candidatePBand (s : ℝ) (j : ℕ) : Finset ℕ := dyadicPrimeBand s (3/2) (9/5) j noncomputable def candidatePrimeBand (s : ℝ) (a : ℕ × Bool) : Finset ℕ := if a.2 then candidatePBand s a.1 else candidateQBand s a.1 theorem candidatePrimeBand_subset_outer {s : ℝ} (hs : 0 ≤ s) (a : ℕ × Bool) : candidatePrimeBand s a ⊆ dyadicPrimeBand s 1 (9/5) a.1 := by rcases a with ⟨j, u⟩ cases u <;> simp only [candidatePrimeBand, Bool.false_eq_true, ↓reduceIte, candidateQBand, candidatePBand] · exact dyadicPrimeBand_subset_of_bounds j hs (by norm_num) (by norm_num) · exact dyadicPrimeBand_subset_of_bounds j hs (by norm_num) (by norm_num) theorem pairwise_disjoint_candidatePrimeBand {s : ℝ} (hs : 0 ≤ s) : Pairwise (fun a b : ℕ × Bool => Disjoint (candidatePrimeBand s a) (candidatePrimeBand s b)) := by intro a b hab by_cases h : a.1 = b.1 · rcases a with ⟨i, u⟩ rcases b with ⟨j, v⟩ simp only at h subst j cases u <;> cases v · exact (hab rfl).elim · exact disjoint_dyadicPrimeBand_of_separated i hs (by norm_num) · exact (disjoint_dyadicPrimeBand_of_separated i hs (by norm_num : (6/5 : ℝ) ≤ 3/2)).symm · exact (hab rfl).elim · exact (pairwise_disjoint_dyadicPrimeBand hs (by norm_num) (by norm_num : (9/5 : ℝ) ≤ 2*1) h).mono (candidatePrimeBand_subset_outer hs a) (candidatePrimeBand_subset_outer hs b) theorem disjoint_candidatePBand_candidateQBand {s : ℝ} (hs : 0 ≤ s) (i j : ℕ) : Disjoint (candidatePBand s i) (candidateQBand s j) := by exact pairwise_disjoint_candidatePrimeBand hs (show (i, true) ≠ (j, false) by intro h; cases Prod.mk.inj h |>.2) theorem dyadicPrimeBand_prime_range {s lower upper A B : ℝ} {j p : ℕ} (hp : p ∈ dyadicPrimeBand s lower upper j) (hA : A ≤ lower * s / 2^j) (hB : upper * s / 2^j ≤ B) : p.Prime ∧ Real.exp A < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp B := by obtain ⟨hp, hl, hu⟩ := (mem_dyadicPrimeBand_iff s lower upper j p).mp hp exact ⟨hp, (Real.exp_le_exp.mpr hA).trans_lt hl, hu.trans (Real.exp_le_exp.mpr hB)⟩ theorem dyadicPrimeBand_eq_log_ratio (s lower upper : ℝ) (j : ℕ) (hlower : lower ≠ 0) : dyadicPrimeBand s lower upper j = primeBand (Real.exp (lower * s / 2^j)) (Real.exp ((upper / lower) * (lower * s / 2^j))) := by have h : (upper / lower) * (lower * s / 2^j) = upper * s / 2^j := by field_simp rw [h] rfl theorem dyadicPrimeBand_harmonic_eq_log_ratio (s lower upper : ℝ) (j : ℕ) (hlower : lower ≠ 0) : (∑ p ∈ dyadicPrimeBand s lower upper j, 1 / (p : ℝ)) = primeBandHarmonic (Real.exp (lower * s / 2^j)) (Real.exp ((upper / lower) * (lower * s / 2^j))) := by rw [dyadicPrimeBand_eq_log_ratio s lower upper j hlower] rfl end section open Finset noncomputable def dyadicGroupIndices (s lower upper A B : ℝ) : Finset ℕ := Icc (Nat.ceil (Real.log (upper * s / B) / Real.log 2)) (Nat.floor (Real.log (lower * s / A) / Real.log 2)) section variable {s lower upper A B : ℝ} {j : ℕ} (hs : 0 < s) (hlower : 0 < lower) (hupper : 0 < upper) (hA : 0 < A) (hB : 0 < B) include s lower upper A B j hs hlower hupper hA hB theorem dyadic_scale_bounds_of_log_bounds (hjLower : Real.log (upper * s / B) / Real.log 2 ≤ j) (hjUpper : (j : ℝ) ≤ Real.log (lower * s / A) / Real.log 2) : A ≤ lower * s / 2^j ∧ upper * s / 2^j ≤ B := by have htwo : (0 : ℝ) < Real.log 2 := Real.log_pos (by norm_num) have hp : (0 : ℝ) < 2^j := by positivity have hupper' := (div_le_iff₀ htwo).mp hjLower have hlower' := (le_div_iff₀ htwo).mp hjUpper rw [← Real.log_pow] at hupper' hlower' have hu := (Real.log_le_log_iff (by positivity : 0 < upper * s / B) hp).mp hupper' have hl := (Real.log_le_log_iff hp (by positivity : 0 < lower * s / A)).mp hlower' constructor · apply (le_div_iff₀ hp).mpr simpa only [mul_comm] using (le_div_iff₀ hA).mp hl · apply (div_le_iff₀ hp).mpr simpa only [mul_comm] using (div_le_iff₀ hB).mp hu theorem dyadic_scale_bounds_of_mem (hNonneg : 0 ≤ Real.log (lower * s / A) / Real.log 2) (hj : j ∈ dyadicGroupIndices s lower upper A B) : A ≤ lower * s / 2^j ∧ upper * s / 2^j ≤ B := by obtain ⟨hjLower, hjUpper⟩ := mem_Icc.mp hj exact dyadic_scale_bounds_of_log_bounds hs hlower hupper hA hB (Nat.ceil_le.mp hjLower) ((Nat.le_floor_iff hNonneg).mp hjUpper) end end section open Filter Finset open scoped Topology /- Rounding the endpoints of a nonnegative real interval changes its natural-index count from its length by at most one. -/ theorem nat_ceil_floor_Icc_card_bounds {u v : ℝ} (hu : 0 ≤ u) (huv : u ≤ v) : v - u - 1 ≤ ((Icc (Nat.ceil u) (Nat.floor v)).card : ℝ) ∧ ((Icc (Nat.ceil u) (Nat.floor v)).card : ℝ) ≤ v - u + 1 := by have hc := Nat.le_ceil u have hc' := Nat.ceil_lt_add_one hu have hf := Nat.floor_le (hu.trans huv) have hf' := Nat.lt_floor_add_one v have hsub : Nat.ceil u ≤ Nat.floor v + 1 := (Nat.ceil_le).mpr (by exact_mod_cast huv.trans hf'.le) rw [Nat.card_Icc, Nat.cast_sub hsub, Nat.cast_add, Nat.cast_one] constructor <;> linarith /- Any positive logarithmic gap yields a number of natural indices comparable to log L; fixed endpoint offsets only affect the threshold. -/ theorem eventually_log_affine_index_count {A B : ℝ} (hA : 0 < A) (hAB : A < B) (a b : ℝ) : ∀ᶠ L : ℝ in atTop, ((B - A) / 2) * Real.log L ≤ ((Icc (Nat.ceil (A * Real.log L + a)) (Nat.floor (B * Real.log L + b))).card : ℝ) ∧ ((Icc (Nat.ceil (A * Real.log L + a)) (Nat.floor (B * Real.log L + b))).card : ℝ) ≤ (2 * (B - A)) * Real.log L := by have hleft : Tendsto (fun L : ℝ => A * Real.log L) atTop atTop := Tendsto.const_mul_atTop hA Real.tendsto_log_atTop have hgap : Tendsto (fun L : ℝ => (B - A) * Real.log L) atTop atTop := Tendsto.const_mul_atTop (sub_pos.mpr hAB) Real.tendsto_log_atTop filter_upwards [hleft.eventually (eventually_ge_atTop (-a)), hgap.eventually (eventually_ge_atTop (2 * (|b - a| + 1)))] with L hl hg have habs₁ := le_abs_self (b - a) have habs₂ := neg_abs_le (b - a) have hu : 0 ≤ A * Real.log L + a := by linarith have huv : A * Real.log L + a ≤ B * Real.log L + b := by nlinarith obtain ⟨hlo, hhi⟩ := nat_ceil_floor_Icc_card_bounds hu huv constructor <;> nlinarith /- The endpoint index of a geometric scale is affine in log L. -/ theorem geometric_log_index_eq {c s L : ℝ} (hc : 0 < c) (hs : 0 < s) (hL : 0 < L) (γ : ℝ) : Real.log (c * (s * L) / L^γ) / Real.log 2 = ((1 - γ) / Real.log 2) * Real.log L + Real.log (c * s) / Real.log 2 := by have hp : c * (s * L) = (c * s) * L := by ring rw [hp, Real.log_div (by positivity) (by positivity), Real.log_mul (by positivity) (by positivity), Real.log_rpow hL] ring section variable {α β s c₃ c₄ : ℝ} (hαβ : α < β) (hβ : β < 1) (hs : 0 < s) (hc₃ : 0 < c₃) (hc₄ : 0 < c₄) include α β s c₃ c₄ hαβ hβ hs hc₃ hc₄ /- The dyadic index interval for a power band contains a positive constant times log L indices and at most a constant times log L indices. -/ theorem eventually_geometric_log_index_count : ∀ᶠ L : ℝ in atTop, ((β - α) / (2 * Real.log 2)) * Real.log L ≤ ((Icc (Nat.ceil (Real.log (c₄ * (s * L) / L^β) / Real.log 2)) (Nat.floor (Real.log (c₃ * (s * L) / L^α) / Real.log 2))).card : ℝ) ∧ ((Icc (Nat.ceil (Real.log (c₄ * (s * L) / L^β) / Real.log 2)) (Nat.floor (Real.log (c₃ * (s * L) / L^α) / Real.log 2))).card : ℝ) ≤ (2 * (β - α) / Real.log 2) * Real.log L := by have hlog : 0 < Real.log (2 : ℝ) := Real.log_pos (by norm_num) have hA : 0 < (1 - β) / Real.log 2 := div_pos (by linarith) hlog have hAB : (1 - β) / Real.log 2 < (1 - α) / Real.log 2 := (div_lt_div_iff_of_pos_right hlog).mpr (by linarith) have hcount := eventually_log_affine_index_count hA hAB (Real.log (c₄ * s) / Real.log 2) (Real.log (c₃ * s) / Real.log 2) filter_upwards [hcount, eventually_gt_atTop (0 : ℝ)] with L hcount hL rw [geometric_log_index_eq hc₄ hs hL β, geometric_log_index_eq hc₃ hs hL α] have hlo : ((1 - α) / Real.log 2 - (1 - β) / Real.log 2) / 2 = (β - α) / (2 * Real.log 2) := by ring have hhi : 2 * ((1 - α) / Real.log 2 - (1 - β) / Real.log 2) = 2 * (β - α) / Real.log 2 := by ring simpa only [hlo, hhi] using hcount /- Both real endpoints of the dyadic index interval are eventually nonnegative, so natural floor and ceiling implement the real inequalities. -/ theorem eventually_geometric_log_indices_nonneg : ∀ᶠ L : ℝ in atTop, 0 ≤ Real.log (c₄ * (s * L) / L^β) / Real.log 2 ∧ 0 ≤ Real.log (c₃ * (s * L) / L^α) / Real.log 2 := by have hlog : 0 < Real.log (2 : ℝ) := Real.log_pos (by norm_num) have hA : 0 < (1 - β) / Real.log 2 := div_pos (by linarith) hlog have hB : 0 < (1 - α) / Real.log 2 := div_pos (by linarith) hlog have htA : Tendsto (fun L : ℝ => ((1 - β) / Real.log 2) * Real.log L) atTop atTop := Tendsto.const_mul_atTop hA Real.tendsto_log_atTop have htB : Tendsto (fun L : ℝ => ((1 - α) / Real.log 2) * Real.log L) atTop atTop := Tendsto.const_mul_atTop hB Real.tendsto_log_atTop filter_upwards [htA.eventually (eventually_ge_atTop (-(Real.log (c₄ * s) / Real.log 2))), htB.eventually (eventually_ge_atTop (-(Real.log (c₃ * s) / Real.log 2))), eventually_gt_atTop (0 : ℝ)] with L hA' hB' hL rw [geometric_log_index_eq hc₄ hs hL β, geometric_log_index_eq hc₃ hs hL α] constructor <;> linarith end end section open Filter Finset noncomputable def powerRangePrimeIndices (s lower upper α β L : ℝ) : Finset ℕ := dyadicGroupIndices (s * L) lower upper (L^α) (L^β) theorem eventually_concrete_dyadic_prime_groups {s lower upper α β : ℝ} (hs : 0 < s) (hlower : 0 < lower) (hlu : lower < upper) (hgap : upper ≤ 2 * lower) (hα : 0 < α) (hαβ : α < β) (hβ : β < 1) : ∃ v V : ℝ, 0 < v ∧ 0 < V ∧ ∀ᶠ L : ℝ in atTop, ((β - α) / (2 * Real.log 2)) * Real.log L ≤ ((powerRangePrimeIndices s lower upper α β L).card : ℝ) ∧ ((powerRangePrimeIndices s lower upper α β L).card : ℝ) ≤ (2 * (β - α) / Real.log 2) * Real.log L ∧ Pairwise (fun i j : ℕ => Disjoint (dyadicPrimeBand (s * L) lower upper i) (dyadicPrimeBand (s * L) lower upper j)) ∧ ∀ j ∈ powerRangePrimeIndices s lower upper α β L, (v ≤ ∑ p ∈ dyadicPrimeBand (s * L) lower upper j, 1 / (p : ℝ)) ∧ (∑ p ∈ dyadicPrimeBand (s * L) lower upper j, 1 / (p : ℝ)) ≤ V ∧ ∀ p ∈ dyadicPrimeBand (s * L) lower upper j, p.Prime ∧ Real.exp (L^α) < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp (L^β) := by have hupper : 0 < upper := hlower.trans hlu have hlam : 1 < upper / lower := (one_lt_div hlower).mpr hlu obtain ⟨v, V, t0, hv, hV, _, ht0⟩ := exists_primeBandHarmonic_threshold hlam refine ⟨v, V, hv, hV, ?_⟩ filter_upwards [eventually_geometric_log_index_count hαβ hβ hs hlower hupper, eventually_geometric_log_indices_nonneg hαβ hβ hs hlower hupper, (tendsto_rpow_atTop hα).eventually (eventually_ge_atTop t0), eventually_gt_atTop (0 : ℝ)] with L hcard hind ht hL refine ⟨hcard.1, hcard.2, pairwise_disjoint_dyadicPrimeBand (mul_pos hs hL).le hlower.le hgap, ?_⟩ intro j hj have hA : 0 < L^α := Real.rpow_pos_of_pos hL α have hB : 0 < L^β := Real.rpow_pos_of_pos hL β obtain ⟨hlo, hhi⟩ := dyadic_scale_bounds_of_mem (mul_pos hs hL) hlower hupper hA hB hind.2 hj have hmass := ht0 (lower * (s * L) / 2^j) (ht.trans hlo) rw [← dyadicPrimeBand_harmonic_eq_log_ratio (s * L) lower upper j hlower.ne'] at hmass refine ⟨hmass.1, hmass.2, ?_⟩ intro p hp exact dyadicPrimeBand_prime_range hp hlo hhi theorem eventually_candidate_P_groups {s α β : ℝ} (hs : 0 < s) (hα : 0 < α) (hαβ : α < β) (hβ : β < 1) : ∃ v V : ℝ, 0 < v ∧ 0 < V ∧ ∀ᶠ L : ℝ in atTop, ((β - α) / (2 * Real.log 2)) * Real.log L ≤ ((powerRangePrimeIndices s (3/2) (9/5) α β L).card : ℝ) ∧ ((powerRangePrimeIndices s (3/2) (9/5) α β L).card : ℝ) ≤ (2 * (β - α) / Real.log 2) * Real.log L ∧ Pairwise (fun i j : ℕ => Disjoint (candidatePBand (s * L) i) (candidatePBand (s * L) j)) ∧ ∀ j ∈ powerRangePrimeIndices s (3/2) (9/5) α β L, (v ≤ ∑ p ∈ candidatePBand (s * L) j, 1 / (p : ℝ)) ∧ (∑ p ∈ candidatePBand (s * L) j, 1 / (p : ℝ)) ≤ V ∧ ∀ p ∈ candidatePBand (s * L) j, p.Prime ∧ Real.exp (L^α) < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp (L^β) := by exact eventually_concrete_dyadic_prime_groups hs (by norm_num) (by norm_num) (by norm_num) hα hαβ hβ end section open Finset Filter open scoped Topology noncomputable def candidateQIndices (c L : ℝ) : Finset ℕ := Icc 0 ⌊Real.log (c * L / (20 * Real.log L)) / Real.log 2⌋₊ theorem candidateQIndices_geometry {c L : ℝ} (hc : 0 < c) (hL : 0 < L) (hlog : 1 ≤ Real.log L) (hlarge : 20 * Real.log L ≤ c * L) (hsmall : c ≤ 20 * Real.log L) : ((candidateQIndices c L).card : ℝ) ≤ (1 / Real.log 2 + 1) * Real.log L ∧ ∀ j ∈ candidateQIndices c L, 20 * Real.log L ≤ c * L / 2^j ∧ (6/5 : ℝ) * (c * L) / 2^j ≤ (6/5 : ℝ) * c * L := by have hlog0 : 0 < Real.log L := zero_lt_one.trans_le hlog have hlog2 : 0 < Real.log 2 := by positivity have hden : 0 < 20 * Real.log L := by positivity let z := c * L / (20 * Real.log L) have hz1 : 1 ≤ z := (one_le_div hden).mpr hlarge have hz0 : 0 < z := zero_lt_one.trans_le hz1 have hf0 : 0 ≤ Real.log z / Real.log 2 := div_nonneg (Real.log_nonneg hz1) hlog2.le have hzL : z ≤ L := by apply (div_le_iff₀ hden).mpr nlinarith [mul_le_mul_of_nonneg_right hsmall hL.le] constructor · have hf : Real.log z / Real.log 2 ≤ Real.log L / Real.log 2 := div_le_div_of_nonneg_right (Real.log_le_log hz0 hzL) hlog2.le have hfloor := Nat.floor_le hf0 have hcard : ((candidateQIndices c L).card : ℝ) = (⌊Real.log z / Real.log 2⌋₊ : ℝ) + 1 := by simp [candidateQIndices, z, Nat.card_Icc] rw [hcard] calc _ ≤ Real.log L / Real.log 2 + 1 := by linarith _ ≤ Real.log L / Real.log 2 + Real.log L := by linarith _ = _ := by ring · intro j hj have hj' : (j : ℝ) ≤ Real.log z / Real.log 2 := (Nat.le_floor_iff hf0).mp (mem_Icc.mp hj).2 have hp : (2 : ℝ)^j ≤ z := by apply (Real.log_le_log_iff (by positivity) hz0).mp rw [Real.log_pow] exact (le_div_iff₀ hlog2).mp hj' have hp0 : (0 : ℝ) < 2^j := by positivity constructor · apply (le_div_iff₀ hp0).mpr have hh := (le_div_iff₀ hden).mp hp nlinarith · have hp1 : (1 : ℝ) ≤ 2^j := one_le_pow₀ (by norm_num) apply (div_le_iff₀ hp0).mpr nlinarith [mul_le_mul_of_nonneg_left hp1 (show 0 ≤ (6/5 : ℝ) * c * L by positivity)] theorem eventually_candidateQIndices_parameters {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, 0 < L ∧ 1 ≤ Real.log L ∧ 20 * Real.log L ≤ c * L ∧ c ≤ 20 * Real.log L := by have hlogdiv : Tendsto (fun L : ℝ => Real.log L / L) atTop (𝓝 0) := by simpa using Real.tendsto_pow_log_div_mul_add_atTop 1 0 1 one_ne_zero filter_upwards [eventually_gt_atTop (0 : ℝ), Real.tendsto_log_atTop.eventually (eventually_ge_atTop (1 : ℝ)), Real.tendsto_log_atTop.eventually (eventually_ge_atTop (c / 20)), hlogdiv.eventually_lt_const (show 0 < c / 20 by positivity)] with L hL hlog hcL hratio refine ⟨hL, hlog, ?_, ?_⟩ · have hh := (div_lt_iff₀ hL).mp hratio nlinarith · linarith theorem eventually_candidateQIndices_geometry {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ((candidateQIndices c L).card : ℝ) ≤ (1 / Real.log 2 + 1) * Real.log L ∧ ∀ j ∈ candidateQIndices c L, 20 * Real.log L ≤ c * L / 2^j ∧ (6/5 : ℝ) * (c * L) / 2^j ≤ (6/5 : ℝ) * c * L := by filter_upwards [eventually_candidateQIndices_parameters hc] with L h exact candidateQIndices_geometry hc h.1 h.2.1 h.2.2.1 h.2.2.2 /- The fixed-width Q bands have a positive uniform harmonic mass, while their number and endpoints satisfy the required logarithmic bounds. -/ theorem exists_candidateQBands_bounds {c : ℝ} (hc : 0 < c) : ∃ vmin vmax : ℝ, 0 < vmin ∧ 0 < vmax ∧ ∀ᶠ L : ℝ in atTop, 0 < L ∧ ((candidateQIndices c L).card : ℝ) ≤ (1 / Real.log 2 + 1) * Real.log L ∧ ∀ j ∈ candidateQIndices c L, 20 * Real.log L ≤ c * L / 2^j ∧ (6/5 : ℝ) * (c * L) / 2^j ≤ (6/5 : ℝ) * c * L ∧ vmin ≤ (∑ p ∈ candidateQBand (c * L) j, 1 / (p : ℝ)) ∧ (∑ p ∈ candidateQBand (c * L) j, 1 / (p : ℝ)) ≤ vmax := by obtain ⟨vmin, vmax, t0, hvmin, hvmax, ht0, hmass⟩ := exists_primeBandHarmonic_threshold (show (1 : ℝ) < 6/5 by norm_num) refine ⟨vmin, vmax, hvmin, hvmax, ?_⟩ filter_upwards [eventually_candidateQIndices_parameters hc, Real.tendsto_log_atTop.eventually (eventually_ge_atTop (t0 / 20))] with L h hthreshold obtain ⟨hcard, hends⟩ := candidateQIndices_geometry hc h.1 h.2.1 h.2.2.1 h.2.2.2 refine ⟨h.1, hcard, ?_⟩ intro j hj obtain ⟨hlo, hhi⟩ := hends j hj refine ⟨hlo, hhi, ?_⟩ have ht : t0 ≤ c * L / 2^j := by linarith have hm := hmass (c * L / 2^j) ht have he : (∑ p ∈ candidateQBand (c * L) j, 1 / (p : ℝ)) = primeBandHarmonic (Real.exp (c * L / 2^j)) (Real.exp ((6/5 : ℝ) * (c * L / 2^j))) := by simpa only [candidateQBand, one_mul, div_one] using dyadicPrimeBand_harmonic_eq_log_ratio (c * L) 1 (6/5) j one_ne_zero rwa [he] end section open Filter Finset noncomputable def candidateSmallPIndices (s L : ℝ) : Finset ℕ := powerRangePrimeIndices s (3/2) (9/5) (1/10) (1/5) L noncomputable def candidateBigPIndices (s L : ℝ) : Finset ℕ := powerRangePrimeIndices s (3/2) (9/5) (3/10) (2/5) L noncomputable def candidatePIndices (s L : ℝ) : Finset ℕ := candidateSmallPIndices s L ∪ candidateBigPIndices s L /- Small and big index families retain their individual logarithmic lower bounds. Their union has a common positive bounded reciprocal-prime mass, the required global prime range, and pairwise disjoint groups. -/ theorem exists_candidate_P_pool_bounds {s : ℝ} (hs : 0 < s) : ∃ v V : ℝ, 0 < v ∧ 0 < V ∧ ∀ᶠ L : ℝ in atTop, 1 ≤ L ∧ (1 / (20 * Real.log 2)) * Real.log L ≤ ((candidateSmallPIndices s L).card : ℝ) ∧ (1 / (20 * Real.log 2)) * Real.log L ≤ ((candidateBigPIndices s L).card : ℝ) ∧ ((candidatePIndices s L).card : ℝ) ≤ (2 / (5 * Real.log 2)) * Real.log L ∧ Pairwise (fun i j : ℕ => Disjoint (candidatePBand (s * L) i) (candidatePBand (s * L) j)) ∧ ∀ j ∈ candidatePIndices s L, (v ≤ ∑ p ∈ candidatePBand (s * L) j, 1 / (p : ℝ)) ∧ (∑ p ∈ candidatePBand (s * L) j, 1 / (p : ℝ)) ≤ V ∧ ∀ p ∈ candidatePBand (s * L) j, p.Prime ∧ Real.exp (L^(1/10 : ℝ)) < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp (L^(2/5 : ℝ)) := by obtain ⟨v₁, V₁, hv₁, hV₁, hsmall⟩ := eventually_candidate_P_groups (α := (1/10 : ℝ)) (β := (1/5 : ℝ)) hs (by norm_num) (by norm_num) (by norm_num) obtain ⟨v₂, V₂, hv₂, hV₂, hbig⟩ := eventually_candidate_P_groups (α := (3/10 : ℝ)) (β := (2/5 : ℝ)) hs (by norm_num) (by norm_num) (by norm_num) refine ⟨min v₁ v₂, max V₁ V₂, lt_min hv₁ hv₂, hV₁.trans_le (le_max_left _ _), ?_⟩ filter_upwards [hsmall, hbig, eventually_ge_atTop (1 : ℝ)] with L hsmall hbig hL rcases hsmall with ⟨hslo, hshi, hpair, hsdata⟩ rcases hbig with ⟨hblo, hbhi, _, hbdata⟩ have hlo : ((1/5 : ℝ) - 1/10) / (2 * Real.log 2) = 1 / (20 * Real.log 2) := by ring have hlo' : ((2/5 : ℝ) - 3/10) / (2 * Real.log 2) = 1 / (20 * Real.log 2) := by ring have hhi : 2 * ((1/5 : ℝ) - 1/10) / Real.log 2 = 1 / (5 * Real.log 2) := by ring have hhi' : 2 * ((2/5 : ℝ) - 3/10) / Real.log 2 = 1 / (5 * Real.log 2) := by ring rw [hlo] at hslo rw [hlo'] at hblo rw [hhi] at hshi rw [hhi'] at hbhi refine ⟨hL, hslo, hblo, ?_, hpair, ?_⟩ · have hcard : ((candidatePIndices s L).card : ℝ) ≤ ((candidateSmallPIndices s L).card : ℝ) + ((candidateBigPIndices s L).card : ℝ) := by exact_mod_cast (card_union_le (candidateSmallPIndices s L) (candidateBigPIndices s L)) change ((candidateSmallPIndices s L).card : ℝ) ≤ _ at hshi change ((candidateBigPIndices s L).card : ℝ) ≤ _ at hbhi calc _ ≤ ((candidateSmallPIndices s L).card : ℝ) + ((candidateBigPIndices s L).card : ℝ) := hcard _ ≤ (1 / (5 * Real.log 2)) * Real.log L + (1 / (5 * Real.log 2)) * Real.log L := add_le_add hshi hbhi _ = _ := by ring · intro j hj rcases mem_union.mp hj with hj | hj · obtain ⟨hv, hV, hp⟩ := hsdata j hj refine ⟨(min_le_left _ _).trans hv, hV.trans (le_max_left _ _), ?_⟩ intro p hpj obtain ⟨hpp, hpl, hpu⟩ := hp p hpj exact ⟨hpp, hpl, hpu.trans (Real.exp_le_exp.mpr (Real.rpow_le_rpow_of_exponent_le hL (by norm_num)))⟩ · obtain ⟨hv, hV, hp⟩ := hbdata j hj refine ⟨(min_le_right _ _).trans hv, hV.trans (le_max_right _ _), ?_⟩ intro p hpj obtain ⟨hpp, hpl, hpu⟩ := hp p hpj exact ⟨hpp, (Real.exp_le_exp.mpr (Real.rpow_le_rpow_of_exponent_le hL (by norm_num))).trans_lt hpl, hpu⟩ end section open Finset /- Birth j either starts a component or chooses one parent strictly before j. -/ abbrev BirthForestCode (n : ℕ) := ∀ j : Fin n, Option (Fin j.val) /- Regard an earlier birth as an index in the full birth list. -/ def birthForestParentEmbedding {n : ℕ} (j : Fin n) : Fin j.val ↪ Fin n where toFun p := ⟨p.val, p.isLt.trans j.isLt⟩ inj' := by intro p q h exact Fin.ext (congrArg (fun x : Fin n => x.val) h) /- The directed links (parent, child) selected by a birth code. -/ def birthForestEdges {n : ℕ} (code : BirthForestCode n) : Finset (Fin n × Fin n) := univ.filter fun e => (code e.2).map (birthForestParentEmbedding e.2) = some e.1 theorem mem_birthForestEdges {n : ℕ} (code : BirthForestCode n) (p j : Fin n) : (p, j) ∈ birthForestEdges code ↔ (code j).map (birthForestParentEmbedding j) = some p := by simp [birthForestEdges] /- The edge set remembers every parent choice, including the no-parent choice. -/ theorem birthForestEdges_injective {n : ℕ} : Function.Injective (@birthForestEdges n) := by intro c d h funext j apply Option.map_injective (birthForestParentEmbedding j).injective apply Option.ext intro p simpa only [mem_birthForestEdges] using (show (p, j) ∈ birthForestEdges c ↔ (p, j) ∈ birthForestEdges d from by rw [h]) /- Rank is the number of parent links. -/ def birthForestRank {n : ℕ} (code : BirthForestCode n) : ℕ := (birthForestEdges code).card /- Two selected edges with the same child have the same parent. -/ theorem birthForestEdges_child_injective {n : ℕ} (code : BirthForestCode n) : Set.InjOn Prod.snd (birthForestEdges code : Set (Fin n × Fin n)) := by rintro ⟨p, j⟩ hp ⟨q, k⟩ hq hjk change j = k at hjk subst k have hp' := (mem_birthForestEdges code p j).mp hp have hq' := (mem_birthForestEdges code q j).mp hq exact Prod.ext (Option.some.inj (hp'.symm.trans hq')) rfl /- Children incident to a parent link are precisely the `some` entries. -/ theorem birthForestEdges_image_snd {n : ℕ} (code : BirthForestCode n) : (birthForestEdges code).image Prod.snd = univ.filter (fun j => (code j).isSome) := by ext j simp only [mem_image, mem_filter, mem_univ, true_and] constructor · rintro ⟨⟨p, k⟩, hp, hkj⟩ change k = j at hkj subst k have h := Option.isSome_of_eq_some ((mem_birthForestEdges code p j).mp hp) simpa only [Option.isSome_map] using h · intro hj obtain ⟨p, hp⟩ := Option.isSome_iff_exists.mp hj refine ⟨(birthForestParentEmbedding j p, j), ?_, rfl⟩ simp [mem_birthForestEdges, hp] /- Graph rank agrees with the count of nonempty parent choices. -/ theorem birthForestRank_eq_card_isSome {n : ℕ} (code : BirthForestCode n) : birthForestRank code = (univ.filter (fun j => (code j).isSome)).card := by rw [birthForestRank, ← birthForestEdges_image_snd code] exact (card_image_of_injOn (birthForestEdges_child_injective code)).symm /- The local rank sum used in product expansions equals graph rank. -/ theorem birthForestRank_eq_sum {n : ℕ} (code : BirthForestCode n) : birthForestRank code = ∑ j : Fin n, (match code j with | none => 0 | some _ => 1) := by rw [birthForestRank_eq_card_isSome, card_eq_sum_ones, sum_filter] apply sum_congr rfl intro j hj cases code j <;> simp /- Births incident to at least one parent link. -/ def birthForestTouched {n : ℕ} (code : BirthForestCode n) : Finset (Fin n) := (birthForestEdges code).image Prod.fst ∪ (birthForestEdges code).image Prod.snd theorem birthForestTouched_card_le {n : ℕ} (code : BirthForestCode n) : (birthForestTouched code).card ≤ 2 * birthForestRank code := by calc (birthForestTouched code).card ≤ ((birthForestEdges code).image Prod.fst).card + ((birthForestEdges code).image Prod.snd).card := card_union_le _ _ _ ≤ (birthForestEdges code).card + (birthForestEdges code).card := Nat.add_le_add (card_image_le) (card_image_le) _ = 2 * birthForestRank code := by simp [birthForestRank, two_mul] /- All codes with exactly r parent links. -/ def birthForestCodesOfRank (n r : ℕ) : Finset (BirthForestCode n) := univ.filter fun code => birthForestRank code = r /- The powerset bound before replacing the binomial coefficient by a power. -/ theorem birthForestCodesOfRank_card_le_choose (n r : ℕ) : (birthForestCodesOfRank n r).card ≤ (n * n).choose r := by have hsubset : (birthForestCodesOfRank n r).image birthForestEdges ⊆ powersetCard r (univ : Finset (Fin n × Fin n)) := by intro edges he obtain ⟨code, hc, rfl⟩ := mem_image.mp he exact mem_powersetCard.mpr ⟨subset_univ _, (mem_filter.mp hc).2⟩ calc (birthForestCodesOfRank n r).card = ((birthForestCodesOfRank n r).image birthForestEdges).card := (card_image_of_injective _ birthForestEdges_injective).symm _ ≤ (powersetCard r (univ : Finset (Fin n × Fin n))).card := card_le_card hsubset _ = (n * n).choose r := by simp /- There are at most n^(2r) rank-r birth codes, including n=0 and r=0. -/ theorem birthForestCodesOfRank_card_le_pow (n r : ℕ) : (birthForestCodesOfRank n r).card ≤ n ^ (2 * r) := by calc (birthForestCodesOfRank n r).card ≤ (n * n).choose r := birthForestCodesOfRank_card_le_choose n r _ ≤ (n * n) ^ r := Nat.choose_le_pow _ _ _ = n ^ (2 * r) := by rw [← pow_two, ← pow_mul] end section open Finset Classical /- Only addresses at which a birth is performed participate in distinctness. -/ def birthValuesDistinct {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) : Prop := Set.InjOn f {i | performed i} /- Number of earlier performed addresses with the same value. -/ noncomputable def earlierBirthCollisionSum {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) (j : Fin n) : ℤ := by classical exact ∑ i : Fin n, if i < j ∧ performed i ∧ performed j ∧ f i = f j then 1 else 0 /- For distinct performed values every earlier-collision count vanishes. -/ theorem earlierBirthCollisionSum_eq_zero {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) (h : birthValuesDistinct performed f) (j : Fin n) : earlierBirthCollisionSum performed f j = 0 := by classical apply sum_eq_zero intro i _ have hn : ¬ (i < j ∧ performed i ∧ performed j ∧ f i = f j) := by rintro ⟨hij, hi, hj, hf⟩ exact (ne_of_lt hij) (h hi hj hf) exact if_neg hn /- If distinctness fails, the first repeated address has exactly one earlier performed address of its value. -/ theorem exists_earlierBirthCollisionSum_eq_one {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) (h : ¬ birthValuesDistinct performed f) : ∃ j, earlierBirthCollisionSum performed f j = 1 := by classical let bad : Finset (Fin n) := univ.filter (fun j => ∃ i, i < j ∧ performed i ∧ performed j ∧ f i = f j) have hbad : bad.Nonempty := by have hn : ¬ ∀ i j, performed i → performed j → f i = f j → i = j := by intro hh exact h (fun _ hi _ hj hf => hh _ _ hi hj hf) push Not at hn obtain ⟨i, j, hi, hj, hf, hne⟩ := hn rcases lt_or_gt_of_ne hne with hij | hji · exact ⟨j, mem_filter.mpr ⟨mem_univ _, i, hij, hi, hj, hf⟩⟩ · exact ⟨i, mem_filter.mpr ⟨mem_univ _, j, hji, hj, hi, hf.symm⟩⟩ let j := bad.min' hbad have hjmem : j ∈ bad := min'_mem bad hbad obtain ⟨i, hij, hpi, hpj, hfij⟩ := (mem_filter.mp hjmem).2 have hminimal : ∀ k ∈ bad, j ≤ k := fun k hk => min'_le bad k hk have hsingle : ∀ k, (k < j ∧ performed k ∧ performed j ∧ f k = f j) ↔ k = i := by intro k constructor · rintro ⟨hkj, hpk, _, hfkj⟩ rcases lt_trichotomy k i with hki | hki | hik · have himem : i ∈ bad := mem_filter.mpr ⟨mem_univ _, k, hki, hpk, hpi, hfkj.trans hfij.symm⟩ exact False.elim ((not_lt_of_ge (hminimal i himem)) hij) · exact hki · have hkmem : k ∈ bad := mem_filter.mpr ⟨mem_univ _, i, hik, hpi, hpk, hfij.trans hfkj.symm⟩ exact False.elim ((not_lt_of_ge (hminimal k hkmem)) hkj) · rintro rfl exact ⟨hij, hpi, hpj, hfij⟩ refine ⟨j, ?_⟩ simp only [earlierBirthCollisionSum, hsingle, sum_ite_eq', mem_univ, if_true] /- Exact global distinctness indicator as a product of chronological local collision factors. No probabilistic independence assumption is involved. -/ theorem distinct_birth_product {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) : (if birthValuesDistinct performed f then (1 : ℤ) else 0) = ∏ j : Fin n, (1 - earlierBirthCollisionSum performed f j) := by classical by_cases h : birthValuesDistinct performed f · simp only [if_pos h, earlierBirthCollisionSum_eq_zero performed f h, sub_zero, prod_const_one] · obtain ⟨j, hj⟩ := exists_earlierBirthCollisionSum_eq_one performed f h rw [if_neg h] exact (prod_eq_zero (mem_univ j) (by rw [hj, sub_self])).symm /- Summing over earlier addresses is summing over the parent's smaller finite index type. -/ theorem sum_birthForestParents {n : ℕ} (j : Fin n) (F : Fin n → ℤ) : (∑ i : Fin n, if i < j then F i else 0) = ∑ i : Fin j.val, F (birthForestParentEmbedding j i) := by have he : (univ : Finset (Fin n)).filter (fun i => i < j) = (univ : Finset (Fin j.val)).map (birthForestParentEmbedding j) := by ext i simp only [mem_filter, mem_univ, true_and, mem_map] constructor · intro hij exact ⟨⟨i.val, hij⟩, Fin.ext rfl⟩ · rintro ⟨k, rfl⟩ exact k.isLt rw [← sum_filter, he, sum_map] /- A parent choice is admissible exactly when both births are performed and have the same value; the empty choice imposes no condition. -/ def birthForestChoiceCompatible {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) (j : Fin n) : Option (Fin j.val) → Prop | none => True | some i => performed (birthForestParentEmbedding j i) ∧ performed j ∧ f (birthForestParentEmbedding j i) = f j def birthForestCompatible {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) (code : BirthForestCode n) : Prop := ∀ j, birthForestChoiceCompatible performed f j (code j) /- Signed local factor for a chronological parent choice. -/ noncomputable def birthForestChoiceWeight {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) (j : Fin n) : Option (Fin j.val) → ℤ | none => 1 | some i => if birthForestChoiceCompatible performed f j (some i) then -1 else 0 section variable {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) include n α performed f /- One chronological collision factor is the sum over all its parent choices. -/ theorem birthForestChoiceWeight_sum (j : Fin n) : (∑ p : Option (Fin j.val), birthForestChoiceWeight performed f j p) = 1 - earlierBirthCollisionSum performed f j := by rw [Fintype.sum_option] simp only [birthForestChoiceWeight] have he : earlierBirthCollisionSum performed f j = ∑ i : Fin j.val, if birthForestChoiceCompatible performed f j (some i) then 1 else 0 := by unfold earlierBirthCollisionSum simp only [ite_and] rw [sum_birthForestParents] apply sum_congr rfl intro i _ by_cases hi : performed (birthForestParentEmbedding j i) <;> by_cases hj : performed j <;> by_cases hf : f (birthForestParentEmbedding j i) = f j <;> simp [birthForestChoiceCompatible, hi, hj, hf] rw [he] have hn : (∑ i : Fin j.val, if birthForestChoiceCompatible performed f j (some i) then (-1 : ℤ) else 0) = -(∑ i : Fin j.val, if birthForestChoiceCompatible performed f j (some i) then (1 : ℤ) else 0) := by rw [← sum_neg_distrib] apply sum_congr rfl intro i _ split_ifs <;> rfl rw [hn] rfl /- The signed weight of one parent code is its sign times the conjunction of all selected chronological equality constraints. -/ theorem birthForestChoiceWeight_prod (code : BirthForestCode n) : (∏ j, birthForestChoiceWeight performed f j (code j)) = (-1 : ℤ) ^ birthForestRank code * (if birthForestCompatible performed f code then 1 else 0) := by have hlocal : ∀ j, birthForestChoiceWeight performed f j (code j) = (-1 : ℤ) ^ (match code j with | none => 0 | some _ => 1) * (if birthForestChoiceCompatible performed f j (code j) then 1 else 0) := by intro j cases code j with | none => simp [birthForestChoiceWeight, birthForestChoiceCompatible] | some i => by_cases h : birthForestChoiceCompatible performed f j (some i) <;> simp [birthForestChoiceWeight, h] simp_rw [hlocal] rw [prod_mul_distrib, prod_pow_eq_pow_sum, birthForestRank_eq_sum code] congr 1 rw [Fintype.prod_boole] by_cases h : birthForestCompatible performed f code · have hh : ∀ i, birthForestChoiceCompatible performed f i (code i) := h rw [if_pos hh, if_pos h] · have hh : ¬ ∀ i, birthForestChoiceCompatible performed f i (code i) := h rw [if_neg hh, if_neg h] /- Exact distinctness expansion indexed by chronological forests. Each selected parent link contributes one sign and one dependent birth. -/ theorem distinct_birth_forest_expansion : (if birthValuesDistinct performed f then (1 : ℤ) else 0) = ∑ code : BirthForestCode n, (-1 : ℤ) ^ birthForestRank code * (if birthForestCompatible performed f code then 1 else 0) := by rw [distinct_birth_product] simp_rw [← birthForestChoiceWeight_sum performed f] rw [Fintype.prod_sum] apply sum_congr rfl intro code _ exact birthForestChoiceWeight_prod performed f code end /- The same exact expansion in any ring, including real and complex path coefficient rings. -/ theorem distinct_birth_forest_expansion_ring {R : Type*} [Ring R] {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) : (if birthValuesDistinct performed f then (1 : R) else 0) = ∑ code : BirthForestCode n, (-1 : R) ^ birthForestRank code * (if birthForestCompatible performed f code then 1 else 0) := by have h := congrArg (fun z : ℤ => (z : R)) (distinct_birth_forest_expansion performed f) push_cast at h exact h /- Forest compatibility imposes exactly the performed-birth and equal-value conditions along its selected parent links. -/ theorem birthForestCompatible_iff_edges {n : ℕ} {α : Type*} (performed : Fin n → Prop) (f : Fin n → α) (code : BirthForestCode n) : birthForestCompatible performed f code ↔ ∀ i j, (i, j) ∈ birthForestEdges code → performed i ∧ performed j ∧ f i = f j := by constructor · intro h i j hij have hj := h j rw [mem_birthForestEdges] at hij cases hc : code j with | none => simp [hc] at hij | some p => have he : birthForestParentEmbedding j p = i := by simpa [hc] using hij simpa only [hc, birthForestChoiceCompatible, he] using hj · intro h j cases hc : code j with | none => trivial | some p => exact h (birthForestParentEmbedding j p) j (by simp [mem_birthForestEdges, hc]) end section open Finset Classical /- There is at most one parent link for each potential birth address. -/ theorem birthForestRank_le_addresses {n : ℕ} (code : BirthForestCode n) : birthForestRank code ≤ n := by rw [birthForestRank_eq_card_isSome] exact (card_filter_le _ _).trans (by simp) /- Signed weights of paths whose performed birth values are all distinct. -/ noncomputable def distinctBirthPathSum {Ω α : Type*} {n : ℕ} (paths : Finset Ω) (w : Ω → ℂ) (performed : Ω → Fin n → Prop) (f : Ω → Fin n → α) : ℂ := ∑ ω ∈ paths, if birthValuesDistinct (performed ω) (f ω) then w ω else 0 /- Signed weights of paths satisfying one chronological forest of equality and performed-birth constraints. -/ noncomputable def birthForestPathSum {Ω α : Type*} {n : ℕ} (paths : Finset Ω) (w : Ω → ℂ) (performed : Ω → Fin n → Prop) (f : Ω → Fin n → α) (code : BirthForestCode n) : ℂ := ∑ ω ∈ paths, if birthForestCompatible (performed ω) (f ω) code then w ω else 0 /- The exact global restoration identity for arbitrary finite complex path weights and path-dependent performed addresses. -/ theorem distinct_birth_path_expansion {Ω α : Type*} {n : ℕ} (paths : Finset Ω) (w : Ω → ℂ) (performed : Ω → Fin n → Prop) (f : Ω → Fin n → α) : distinctBirthPathSum paths w performed f = ∑ code : BirthForestCode n, (-1 : ℂ) ^ birthForestRank code * birthForestPathSum paths w performed f code := by have hpoint : ∀ ω, (if birthValuesDistinct (performed ω) (f ω) then w ω else 0) = ∑ code : BirthForestCode n, (-1 : ℂ) ^ birthForestRank code * (if birthForestCompatible (performed ω) (f ω) code then w ω else 0) := by intro ω have h := congrArg (fun z : ℂ => z * w ω) (distinct_birth_forest_expansion_ring (R := ℂ) (performed ω) (f ω)) simpa only [sum_mul, mul_assoc, ite_mul, one_mul, zero_mul] using h unfold distinctBirthPathSum birthForestPathSum simp_rw [hpoint] rw [sum_comm] apply sum_congr rfl intro code _ rw [mul_sum] /- Group any scalar rank envelope by the finite forest rank. -/ theorem sum_birthForestRank_envelope (n : ℕ) (B : ℕ → ℝ) : (∑ code : BirthForestCode n, B (birthForestRank code)) = ∑ r ∈ range (n + 1), (birthForestCodesOfRank n r).card * B r := by have hmem : ∀ code ∈ (univ : Finset (BirthForestCode n)), birthForestRank code ∈ range (n + 1) := by intro code _ exact mem_range.mpr (Nat.lt_succ_of_le (birthForestRank_le_addresses code)) have h := sum_fiberwise_of_maps_to' hmem B simpa only [birthForestCodesOfRank, sum_const, nsmul_eq_mul] using h.symm end section open Finset Classical /- The restriction of a birth code to its first n entries. -/ def birthForestCodeInit {n : ℕ} (code : BirthForestCode (n + 1)) : BirthForestCode n := fun j => code j.castSucc theorem birthForestParentEmbedding_castSucc {n : ℕ} (j : Fin n) (p : Fin j.val) : birthForestParentEmbedding j.castSucc p = (birthForestParentEmbedding j p).castSucc := rfl theorem birthForestParentEmbedding_last {n : ℕ} (p : Fin n) : birthForestParentEmbedding (Fin.last n) p = p.castSucc := rfl theorem birthForestRank_init {n : ℕ} (code : BirthForestCode (n + 1)) : birthForestRank code = birthForestRank (birthForestCodeInit code) + (match code (Fin.last n) with | none => 0 | some _ => 1) := by rw [birthForestRank_eq_sum, Fin.sum_univ_castSucc, birthForestRank_eq_sum] congr 1 · apply sum_congr rfl intro j hj unfold birthForestCodeInit cases code j.castSucc <;> rfl · cases code (Fin.last n) <;> rfl /- All selected parent equalities hold for this assignment of birth values. -/ def birthForestEqualValues {n : ℕ} {α : Type*} (code : BirthForestCode n) (f : Fin n → α) : Prop := ∀ (j : Fin n) (p : Fin j.val), code j = some p → f j = f (birthForestParentEmbedding j p) /- One birth's weight, set to zero if its selected parent equality fails. -/ noncomputable def birthForestLocalFactor {n : ℕ} {α : Type*} (code : BirthForestCode n) (w : Fin n → α → ℝ) (f : Fin n → α) (j : Fin n) : ℝ := by classical exact match code j with | none => w j (f j) | some p => if f j = f (birthForestParentEmbedding j p) then w j (f j) else 0 noncomputable def birthForestAssignmentMass {n : ℕ} {α : Type*} (code : BirthForestCode n) (w : Fin n → α → ℝ) (f : Fin n → α) : ℝ := ∏ j, birthForestLocalFactor code w f j noncomputable def birthForestMass {n : ℕ} {α : Type*} [Fintype α] (code : BirthForestCode n) (w : Fin n → α → ℝ) : ℝ := ∑ f : Fin n → α, birthForestAssignmentMass code w f theorem birthForestAssignmentMass_nonneg {n : ℕ} {α : Type*} (code : BirthForestCode n) (w : Fin n → α → ℝ) (hw : ∀ j a, 0 ≤ w j a) (f : Fin n → α) : 0 ≤ birthForestAssignmentMass code w f := by apply prod_nonneg intro j hj unfold birthForestLocalFactor split · exact hw _ _ · split_ifs <;> simp_all /- Splitting off the last birth never changes any earlier local factor. -/ theorem birthForestAssignmentMass_snoc {n : ℕ} {α : Type*} (code : BirthForestCode (n + 1)) (w : Fin (n + 1) → α → ℝ) (f : Fin n → α) (a : α) : birthForestAssignmentMass code w (Fin.snoc f a) = birthForestAssignmentMass (birthForestCodeInit code) (fun j => w j.castSucc) f * (match code (Fin.last n) with | none => w (Fin.last n) a | some p => if a = f p then w (Fin.last n) a else 0) := by classical unfold birthForestAssignmentMass rw [Fin.prod_univ_castSucc] congr 1 · apply prod_congr rfl intro j hj unfold birthForestLocalFactor birthForestCodeInit cases hc : code j.castSucc with | none => simp | some p => dsimp only rw [show birthForestParentEmbedding j.castSucc p = (birthForestParentEmbedding j p).castSucc from rfl] simp · unfold birthForestLocalFactor cases hc : code (Fin.last n) with | none => simp | some p => dsimp only rw [show birthForestParentEmbedding (Fin.last n) p = p.castSucc from rfl] simp /- Exact chronological summation identity. -/ theorem birthForestMass_last {n : ℕ} {α : Type*} [Fintype α] (code : BirthForestCode (n + 1)) (w : Fin (n + 1) → α → ℝ) : birthForestMass code w = match code (Fin.last n) with | none => birthForestMass (birthForestCodeInit code) (fun j => w j.castSucc) * ∑ a, w (Fin.last n) a | some p => ∑ f : Fin n → α, birthForestAssignmentMass (birthForestCodeInit code) (fun j => w j.castSucc) f * w (Fin.last n) (f p) := by classical unfold birthForestMass rw [← (Fin.snocEquiv (fun _ : Fin (n + 1) => α)).sum_comp] rw [Fintype.sum_prod_type, sum_comm] change (∑ f : Fin n → α, ∑ a : α, birthForestAssignmentMass code w (Fin.snoc f a)) = _ simp only [birthForestAssignmentMass_snoc] cases hc : code (Fin.last n) with | none => simp [← mul_sum, ← sum_mul] | some p => simp /- The local product is exactly the usual product of weights restricted to assignments satisfying all forest equalities. -/ theorem birthForestAssignmentMass_eq {n : ℕ} {α : Type*} (code : BirthForestCode n) (w : Fin n → α → ℝ) (f : Fin n → α) : birthForestAssignmentMass code w f = if birthForestEqualValues code f then ∏ j, w j (f j) else 0 := by classical by_cases h : birthForestEqualValues code f · rw [if_pos h] apply prod_congr rfl intro j hj unfold birthForestLocalFactor cases hc : code j with | none => rfl | some p => simp [h j p hc] · rw [if_neg h] unfold birthForestEqualValues at h push Not at h obtain ⟨j, p, hc, hneq⟩ := h apply prod_eq_zero (mem_univ j) simp [birthForestLocalFactor, hc, hneq] end section open Finset Classical /- All values strictly before a specified birth. -/ def birthForestHistory {n : ℕ} {α : Type*} (f : Fin n → α) (j : Fin n) : Fin j.val → α := fun p => f (birthForestParentEmbedding j p) theorem birthForestHistory_snoc_castSucc {n : ℕ} {α : Type*} (f : Fin n → α) (a : α) (j : Fin n) : birthForestHistory (Fin.snoc f a) j.castSucc = birthForestHistory f j := by funext p unfold birthForestHistory rw [birthForestParentEmbedding_castSucc, Fin.snoc_castSucc] theorem birthForestHistory_snoc_last {n : ℕ} {α : Type*} (f : Fin n → α) (a : α) : birthForestHistory (Fin.snoc f a) (Fin.last n) = f := by funext p unfold birthForestHistory rw [birthForestParentEmbedding_last, Fin.snoc_castSucc] /- A conditional weight may depend on every earlier birth value. -/ abbrev BirthForestCausalWeights (n : ℕ) (α : Type*) := ∀ j : Fin n, (Fin j.val → α) → α → ℝ noncomputable def birthForestCausalAssignmentMass {n : ℕ} {α : Type*} (code : BirthForestCode n) (w : BirthForestCausalWeights n α) (f : Fin n → α) : ℝ := birthForestAssignmentMass code (fun j a => w j (birthForestHistory f j) a) f noncomputable def birthForestCausalMass {n : ℕ} {α : Type*} [Fintype α] (code : BirthForestCode n) (w : BirthForestCausalWeights n α) : ℝ := ∑ f : Fin n → α, birthForestCausalAssignmentMass code w f theorem birthForestCausalAssignmentMass_nonneg {n : ℕ} {α : Type*} (code : BirthForestCode n) (w : BirthForestCausalWeights n α) (hw : ∀ j h a, 0 ≤ w j h a) (f : Fin n → α) : 0 ≤ birthForestCausalAssignmentMass code w f := birthForestAssignmentMass_nonneg code _ (fun j a => hw j _ a) f /- The last birth cannot affect any earlier conditional weight. -/ theorem birthForestCausalAssignmentMass_snoc {n : ℕ} {α : Type*} (code : BirthForestCode (n + 1)) (w : BirthForestCausalWeights (n + 1) α) (f : Fin n → α) (a : α) : birthForestCausalAssignmentMass code w (Fin.snoc f a) = birthForestCausalAssignmentMass (birthForestCodeInit code) (fun j => w j.castSucc) f * (match code (Fin.last n) with | none => w (Fin.last n) f a | some p => if a = f p then w (Fin.last n) f a else 0) := by unfold birthForestCausalAssignmentMass rw [birthForestAssignmentMass_snoc] cases code (Fin.last n) <;> simp only [birthForestHistory_snoc_castSucc, birthForestHistory_snoc_last] /- Exact conditional summation over the last birth. -/ theorem birthForestCausalMass_last {n : ℕ} {α : Type*} [Fintype α] (code : BirthForestCode (n + 1)) (w : BirthForestCausalWeights (n + 1) α) : birthForestCausalMass code w = match code (Fin.last n) with | none => ∑ f : Fin n → α, birthForestCausalAssignmentMass (birthForestCodeInit code) (fun j => w j.castSucc) f * ∑ a, w (Fin.last n) f a | some p => ∑ f : Fin n → α, birthForestCausalAssignmentMass (birthForestCodeInit code) (fun j => w j.castSucc) f * w (Fin.last n) f (f p) := by unfold birthForestCausalMass rw [← (Fin.snocEquiv (fun _ : Fin (n + 1) => α)).sum_comp] rw [Fintype.sum_prod_type, sum_comm] change (∑ f : Fin n → α, ∑ a : α, birthForestCausalAssignmentMass code w (Fin.snoc f a)) = _ simp only [birthForestCausalAssignmentMass_snoc] cases code (Fin.last n) with | none => simp [← mul_sum] | some p => simp end section open Finset MeasureTheory open scoped BigOperators /- Net frequency at a vertex: incoming frequencies minus outgoing ones. -/ noncomputable def birthEdgeLocalFrequency {n : ℕ} (E : Finset (Fin n × Fin n)) (θ : (Fin n × Fin n) → ℝ) (j : Fin n) : ℝ := (∑ e ∈ E with e.2 = j, θ e) - ∑ e ∈ E with e.1 = j, θ e /- Net frequency at one birth of a forest code. -/ noncomputable def birthForestLocalFrequency {n : ℕ} (code : BirthForestCode n) (θ : (Fin n × Fin n) → ℝ) (j : Fin n) : ℝ := birthEdgeLocalFrequency (birthForestEdges code) θ j /- Collecting a weighted edge sum by its endpoint. -/ theorem birth_edge_incidence_sum {V E : Type*} [Fintype V] [DecidableEq V] (edges : Finset E) (endpoint : E → V) (θ : E → ℝ) (f : V → ℝ) : (∑ j : V, (∑ e ∈ edges with endpoint e = j, θ e) * f j) = ∑ e ∈ edges, θ e * f (endpoint e) := by simp only [sum_mul, sum_filter] rw [sum_comm] simp /- The edge differences pair with precisely the net vertex frequencies. -/ theorem birth_edge_frequency_pairing {n : ℕ} (E : Finset (Fin n × Fin n)) (θ : (Fin n × Fin n) → ℝ) (f : Fin n → ℝ) : (∑ e ∈ E, θ e * (f e.2 - f e.1)) = ∑ j : Fin n, birthEdgeLocalFrequency E θ j * f j := by simp only [birthEdgeLocalFrequency, sub_mul, mul_sub, sum_sub_distrib] rw [birth_edge_incidence_sum, birth_edge_incidence_sum] /- Products of phases are exponentials of the corresponding weighted sum. -/ theorem physicalReturnPhase_weighted_product {E : Type*} (edges : Finset E) (θ : E → ℝ) (f : E → ℤ) : (∏ e ∈ edges, physicalReturnPhase (θ e) (f e)) = Complex.exp (2 * (Real.pi : ℂ) * Complex.I * ((∑ e ∈ edges, θ e * (f e : ℝ) : ℝ) : ℂ)) := by simp only [physicalReturnPhase, ← Complex.exp_sum] congr 1 push_cast rw [mul_sum] apply sum_congr rfl intro e _ ring /- The product of edge phases factors into one local phase per vertex. -/ theorem birth_edge_phases_eq_vertex_phases {n : ℕ} (E : Finset (Fin n × Fin n)) (θ : (Fin n × Fin n) → ℝ) (f : Fin n → ℤ) : (∏ e ∈ E, physicalReturnPhase (θ e) (f e.2 - f e.1)) = ∏ j : Fin n, physicalReturnPhase (birthEdgeLocalFrequency E θ j) (f j) := by rw [physicalReturnPhase_weighted_product, physicalReturnPhase_weighted_product] have h := birth_edge_frequency_pairing E θ (fun j => (f j : ℝ)) exact congrArg (fun a : ℝ => Complex.exp (2 * (Real.pi : ℂ) * Complex.I * (a : ℂ))) (by simpa only [Int.cast_sub] using h) /- The edge-to-birth phase factorization for a forest code. -/ theorem birth_forest_phases_eq_local_phases {n : ℕ} (code : BirthForestCode n) (θ : (Fin n × Fin n) → ℝ) (f : Fin n → ℤ) : (∏ e ∈ birthForestEdges code, physicalReturnPhase (θ e) (f e.2 - f e.1)) = ∏ j : Fin n, physicalReturnPhase (birthForestLocalFrequency code θ j) (f j) := birth_edge_phases_eq_vertex_phases (birthForestEdges code) θ f /- An untouched birth has no incoming or outgoing frequency. -/ theorem birthForestLocalFrequency_eq_zero_of_not_touched {n : ℕ} (code : BirthForestCode n) (θ : (Fin n × Fin n) → ℝ) (j : Fin n) (hj : j ∉ birthForestTouched code) : birthForestLocalFrequency code θ j = 0 := by have hp : ∀ e ∈ birthForestEdges code, e.1 ≠ j := by intro e he hej exact hj (mem_union.mpr (Or.inl (mem_image.mpr ⟨e, he, hej⟩))) have hc : ∀ e ∈ birthForestEdges code, e.2 ≠ j := by intro e he hej exact hj (mem_union.mpr (Or.inr (mem_image.mpr ⟨e, he, hej⟩))) have hpempty : (birthForestEdges code).filter (fun e => e.1 = j) = ∅ := filter_eq_empty_iff.mpr hp have hcempty : (birthForestEdges code).filter (fun e => e.2 = j) = ∅ := filter_eq_empty_iff.mpr hc simp only [birthForestLocalFrequency, birthEdgeLocalFrequency, hpempty, hcempty, sum_empty, sub_self] /- A zero frequency gives the constant unit phase. -/ theorem physicalReturnPhase_frequency_zero (h : ℤ) : physicalReturnPhase 0 h = 1 := by simp [physicalReturnPhase] /- The phase at an untouched birth is identically one. -/ theorem birth_forest_phase_eq_one_of_not_touched {n : ℕ} (code : BirthForestCode n) (θ : (Fin n × Fin n) → ℝ) (f : Fin n → ℤ) (j : Fin n) (hj : j ∉ birthForestTouched code) : physicalReturnPhase (birthForestLocalFrequency code θ j) (f j) = 1 := by rw [birthForestLocalFrequency_eq_zero_of_not_touched code θ j hj, physicalReturnPhase_frequency_zero] /- Every real-frequency Fourier phase has norm one. -/ theorem physicalReturnPhase_norm (θ : ℝ) (h : ℤ) : ‖physicalReturnPhase θ h‖ = 1 := by simp [physicalReturnPhase, Complex.norm_exp, Complex.mul_re, Complex.mul_im] /- Exact equality constraints are the product of their one-dimensional Fourier integrals. No multidimensional integration is used here. -/ theorem birth_edge_equalities_fourier {n : ℕ} (E : Finset (Fin n × Fin n)) (f : Fin n → ℤ) : (if ∀ e ∈ E, f e.2 = f e.1 then (1 : ℂ) else 0) = ∏ e ∈ E, ∫ t : ℝ in (0 : ℝ)..1, physicalReturnPhase t (f e.2 - f e.1) := by simp_rw [physicalReturnPhase_integral, sub_eq_zero] rw [Finset.prod_boole] split_ifs <;> rfl end section open Finset Classical /- Split a finite forest expansion at any rank threshold. -/ theorem birthForest_rank_split {M : Type*} [AddCommMonoid M] {n : ℕ} (F : BirthForestCode n → M) (r₀ : ℕ) : (∑ code : BirthForestCode n, F code) = (∑ code ∈ univ.filter (fun code => birthForestRank code < r₀), F code) + ∑ code ∈ univ.filter (fun code => r₀ ≤ birthForestRank code), F code := by simpa only [not_lt] using (sum_filter_add_sum_filter_not univ (fun code => birthForestRank code < r₀) F).symm /- Group a high-rank scalar envelope by its exact rank multiplicity. -/ theorem sum_birthForestRank_tail (n r₀ : ℕ) (B : ℕ → ℝ) : (∑ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => r₀ ≤ birthForestRank code), B (birthForestRank code)) = ∑ r ∈ Ico r₀ (n + 1), (birthForestCodesOfRank n r).card * B r := by rw [sum_filter, sum_birthForestRank_envelope n (fun r => if r₀ ≤ r then B r else 0)] simp_rw [mul_ite, mul_zero] rw [← sum_filter] congr 1 ext r simp only [mem_filter, mem_range, mem_Ico, and_comm] /- A geometric point-mass gain per independent equality beats the number of forest constraints. The bound includes n=0 and arbitrary thresholds. -/ theorem birthForest_rank_tail_norm_le {n : ℕ} (F : BirthForestCode n → ℂ) (r₀ : ℕ) {H ε : ℝ} (hH : 0 ≤ H) (hε : 0 ≤ ε) (hδ : (n : ℝ) ^ 2 * ε < 1) (hF : ∀ code, r₀ ≤ birthForestRank code → ‖F code‖ ≤ H * ε ^ birthForestRank code) : ‖∑ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => r₀ ≤ birthForestRank code), (-1 : ℂ) ^ birthForestRank code * F code‖ ≤ H * ((n : ℝ) ^ 2 * ε) ^ r₀ / (1 - (n : ℝ) ^ 2 * ε) := by have hδ0 : 0 ≤ (n : ℝ) ^ 2 * ε := mul_nonneg (sq_nonneg _) hε calc ‖∑ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => r₀ ≤ birthForestRank code), (-1 : ℂ) ^ birthForestRank code * F code‖ ≤ ∑ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => r₀ ≤ birthForestRank code), ‖(-1 : ℂ) ^ birthForestRank code * F code‖ := norm_sum_le _ _ _ = ∑ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => r₀ ≤ birthForestRank code), ‖F code‖ := by simp only [norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul] _ ≤ ∑ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => r₀ ≤ birthForestRank code), H * ε ^ birthForestRank code := sum_le_sum (fun code hc => hF code (mem_filter.mp hc).2) _ = ∑ r ∈ Ico r₀ (n + 1), (birthForestCodesOfRank n r).card * (H * ε ^ r) := sum_birthForestRank_tail n r₀ (fun r => H * ε ^ r) _ ≤ ∑ r ∈ Ico r₀ (n + 1), H * ((n : ℝ) ^ 2 * ε) ^ r := by apply sum_le_sum intro r _ have hc : ((birthForestCodesOfRank n r).card : ℝ) ≤ (n : ℝ) ^ (2 * r) := by exact_mod_cast birthForestCodesOfRank_card_le_pow n r calc ((birthForestCodesOfRank n r).card : ℝ) * (H * ε ^ r) ≤ (n : ℝ) ^ (2 * r) * (H * ε ^ r) := mul_le_mul_of_nonneg_right hc (mul_nonneg hH (pow_nonneg hε r)) _ = H * ((n : ℝ) ^ 2 * ε) ^ r := by rw [mul_pow, pow_mul] ring _ = H * ∑ r ∈ Ico r₀ (n + 1), ((n : ℝ) ^ 2 * ε) ^ r := (mul_sum _ _ _).symm _ ≤ H * (((n : ℝ) ^ 2 * ε) ^ r₀ / (1 - (n : ℝ) ^ 2 * ε)) := mul_le_mul_of_nonneg_left (geom_sum_Ico_le_of_lt_one hδ0 hδ) hH _ = H * ((n : ℝ) ^ 2 * ε) ^ r₀ / (1 - (n : ℝ) ^ 2 * ε) := by rw [mul_div_assoc] end section open Finset Classical /- A selected child cannot be inactive. Root weights are unchanged. -/ noncomputable def birthForestOptionalWeights {n : ℕ} {α : Type*} (code : BirthForestCode n) (w : BirthForestCausalWeights n (Option α)) : BirthForestCausalWeights n (Option α) := fun j h a => match code j, a with | some _, none => 0 | _, _ => w j h a end section noncomputable def tiltedPhysicalBirthLaw {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (g : G) (b : P g → ℝ) (p : P g) : ℝ := physicalLabelLaw V g p / b p theorem tiltedPhysicalBirthLaw_nonneg {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (g : G) (b : P g → ℝ) (hV : 0 ≤ V g) (hb : ∀ p, 0 ≤ b p) (p : P g) : 0 ≤ tiltedPhysicalBirthLaw V g b p := by exact div_nonneg (div_nonneg zero_le_one (mul_nonneg hV (Nat.cast_nonneg p.val))) (hb p) theorem tiltedPhysicalBirthLaw_sum_bounds {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (g : G) (b : P g → ℝ) (hV : 0 < V g) (hMass : ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hb : ∀ p, 1 / 2 ≤ b p ∧ b p ≤ 1) : 1 ≤ ∑ p : P g, tiltedPhysicalBirthLaw V g b p ∧ (∑ p : P g, tiltedPhysicalBirthLaw V g b p) ≤ 2 := memory_tilted_physical_label_mass V g b hV hMass hb end section open Finset Classical end section open Finset Classical end section open Finset Classical /- Reindex an entire ordered assignment by a permutation. -/ def birthAssignmentPermutation {α : Type*} {n : ℕ} (σ : Equiv.Perm (Fin n)) : (Fin n → α) ≃ (Fin n → α) where toFun f := fun j => f (σ j) invFun f := fun j => f (σ.symm j) left_inv f := by funext j; simp right_inv f := by funext j; simp noncomputable def birthPermutationAverage {α : Type*} {n : ℕ} (φ : (Fin n → α) → ℂ) (f : Fin n → α) : ℂ := (Fintype.card (Equiv.Perm (Fin n)) : ℂ)⁻¹ * ∑ σ : Equiv.Perm (Fin n), φ (fun j => f (σ j)) /- Permuting inputs does not change their averaged local multiplier. -/ theorem birthPermutationAverage_invariant {α : Type*} {n : ℕ} (φ : (Fin n → α) → ℂ) (f : Fin n → α) (τ : Equiv.Perm (Fin n)) : birthPermutationAverage φ (fun j => f (τ j)) = birthPermutationAverage φ f := by unfold birthPermutationAverage congr 1 exact Equiv.sum_comp (Equiv.mulLeft τ) (fun σ : Equiv.Perm (Fin n) => φ (fun j => f (σ j))) end section open Finset /- The canonical kernel first factors through `A`, then `G`, then `B`. -/ noncomputable def finiteCompressionKernel {C S R : Type*} [Fintype S] [Semiring R] (A : ℕ → C → S → R) (B : ℕ → S → C → R) (G : ℕ → S → S → R) (j : ℕ) (x y : C) : R := ∑ z, ∑ w, A j x z * G j z w * B j w y /- The compressed transition joins `G (j+1)`, `B (j+1)`, and `A j`. -/ noncomputable def finiteCompressionStep {C S R : Type*} [Fintype C] [Fintype S] [Semiring R] (A : ℕ → C → S → R) (B : ℕ → S → C → R) (G : ℕ → S → S → R) (j : ℕ) (z w : S) : R := ∑ u, ∑ c, G (j + 1) z u * B (j + 1) u c * A j c w /- The initial compressed vector is `G 0` followed by `B 0` and the canonical initial vector. -/ noncomputable def finiteCompressionInitial {C S R : Type*} [Fintype C] [Fintype S] [Semiring R] (B : ℕ → S → C → R) (G : ℕ → S → S → R) (f : C → R) (z : S) : R := ∑ w, ∑ c, G 0 z w * B 0 w c * f c section variable {C S R : Type*} [sharedInstance1 : Fintype C] [sharedInstance2 : Fintype S] [sharedInstance3 : Semiring R] (A : ℕ → C → S → R) (B : ℕ → S → C → R) (G : ℕ → S → S → R) include C S R sharedInstance1 sharedInstance2 sharedInstance3 A B G /- Reassociate one factored kernel action without changing scalar order. -/ theorem finite_compression_kernel_action (v : C → R) (j : ℕ) (x : C) : (∑ y, finiteCompressionKernel A B G j x y * v y) = ∑ z, A j x z * (∑ w, ∑ y, G j z w * B j w y * v y) := by simp only [finiteCompressionKernel, sum_mul, mul_sum, mul_assoc] rw [sum_comm] apply sum_congr rfl intro z _ exact sum_comm /- Iterating the canonical `A j * G j * B j` kernels compresses to a single final `A n`, the phase transitions `G (j+1) * B (j+1) * A j`, and the initial vector `G 0 * B 0 * f`. -/ theorem finite_path_action_compress (f : C → R) (n : ℕ) (x : C) : finitePathAction (finiteCompressionKernel A B G) f (n + 1) x = ∑ z, A n x z * finitePathAction (finiteCompressionStep A B G) (finiteCompressionInitial B G f) n z := by induction n generalizing x with | zero => change (∑ y, finiteCompressionKernel A B G 0 x y * f y) = ∑ z, A 0 x z * finiteCompressionInitial B G f z exact finite_compression_kernel_action A B G f 0 x | succ n ih => rw [finitePathAction, finite_compression_kernel_action] apply sum_congr rfl intro z _ congr 1 simp_rw [ih] simp only [finitePathAction, finiteCompressionStep, sum_mul, mul_sum, mul_assoc] symm rw [sum_comm] apply sum_congr rfl intro u _ exact sum_comm /- A weighted canonical boundary compresses into the final rectangular factor. This is the finite boundary-pairing version of path compression. -/ theorem finite_path_action_compress_weighted (f q : C → R) (n : ℕ) : (∑ x, q x * finitePathAction (finiteCompressionKernel A B G) f (n + 1) x) = ∑ z, (∑ x, q x * A n x z) * finitePathAction (finiteCompressionStep A B G) (finiteCompressionInitial B G f) n z := by simp only [finite_path_action_compress, mul_sum, sum_mul, mul_assoc] exact sum_comm end end section open Finset /- Time-dependent diagonal conjugation telescopes through the full path. -/ theorem finite_path_action_diagonal_gauge {X 𝕜 : Type*} [Fintype X] [Field 𝕜] (K : ℕ → X → X → 𝕜) (d : ℕ → X → 𝕜) (hd : ∀ j x, d j x ≠ 0) (f : X → 𝕜) (n : ℕ) (x : X) : finitePathAction (fun j x y => (d (j + 1) x)⁻¹ * K j x y * d j y) (fun x => (d 0 x)⁻¹ * f x) n x = (d n x)⁻¹ * finitePathAction K f n x := by induction n generalizing x with | zero => rfl | succ n ih => simp only [finitePathAction, ih, mul_sum] apply sum_congr rfl intro y hy field_simp [hd] /- A normalized visit followed, on its right, by a normalized incoming edge is exactly the diagonal gauge of their unnormalized composition. -/ theorem diagonal_visit_edge_composition {X 𝕜 : Type*} [Fintype X] [Field 𝕜] (G E : X → X → 𝕜) (dnext dprev : X → 𝕜) (hdnext : ∀ x, dnext x ≠ 0) (x y : X) : (∑ z, (G x z / (dnext x * dnext z)) * (dnext z * E z y * dprev y)) = (dnext x)⁻¹ * (∑ z, G x z * E z y) * dprev y := by rw [mul_sum, sum_mul] apply sum_congr rfl intro z hz field_simp [hdnext] /- Normalizing the first visit leaves only its output diagonal when the initial vector is supported on states with diagonal one. -/ theorem diagonal_initial_visit {X 𝕜 : Type*} [Fintype X] [Field 𝕜] (G : X → X → 𝕜) (d f : X → 𝕜) (hd : ∀ x, d x ≠ 0) (hf : ∀ x, f x ≠ 0 → d x = 1) (x : X) : (∑ y, (G x y / (d x * d y)) * f y) = (d x)⁻¹ * ∑ y, G x y * f y := by rw [mul_sum] apply sum_congr rfl intro y hy by_cases hfy : f y = 0 · simp [hfy] · rw [hf y hfy] field_simp [hd] section variable {X 𝕜 : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Field 𝕜] (G E : ℕ → X → X → 𝕜) (d : ℕ → X → 𝕜) (hd : ∀ j x, d j x ≠ 0) include X 𝕜 sharedInstance1 sharedInstance2 G E d hd /- The whole alternating evolution `G_n E_(n-1) ... E_0 G_0` has only the final inverse diagonal after all normalized interior factors cancel. -/ theorem alternating_visit_edge_diagonal_gauge (f : X → 𝕜) (hf : ∀ x, f x ≠ 0 → d 0 x = 1) (n : ℕ) (x : X) : finitePathAction (fun j x y => ∑ z, (G (j + 1) x z / (d (j + 1) x * d (j + 1) z)) * (d (j + 1) z * E j z y * d j y)) (fun x => ∑ y, (G 0 x y / (d 0 x * d 0 y)) * f y) n x = (d n x)⁻¹ * finitePathAction (fun j x y => ∑ z, G (j + 1) x z * E j z y) (fun x => ∑ y, G 0 x y * f y) n x := by simp_rw [diagonal_visit_edge_composition _ _ _ _ (hd _), diagonal_initial_visit _ _ _ (hd 0) hf] exact finite_path_action_diagonal_gauge _ d hd _ n x /- With vacuum boundary tests, the paired alternating visit/edge product is invariant under the auxiliary diagonal normalization. -/ theorem alternating_visit_edge_diagonal_pairing (f q : X → 𝕜) (n : ℕ) (hf : ∀ x, f x ≠ 0 → d 0 x = 1) (hq : ∀ x, q x ≠ 0 → d n x = 1) : (∑ x, q x * finitePathAction (fun j x y => ∑ z, (G (j + 1) x z / (d (j + 1) x * d (j + 1) z)) * (d (j + 1) z * E j z y * d j y)) (fun x => ∑ y, (G 0 x y / (d 0 x * d 0 y)) * f y) n x) = ∑ x, q x * finitePathAction (fun j x y => ∑ z, G (j + 1) x z * E j z y) (fun x => ∑ y, G 0 x y * f y) n x := by simp_rw [alternating_visit_edge_diagonal_gauge G E d hd f hf] apply sum_congr rfl intro x hx by_cases hqx : q x = 0 · simp [hqx] · simp [hq x hqx] end end section open Finset abbrev GhostPhaseState (R : Type*) := Option (GhostFiniteState R) /- Gather an unborn or matching pending lifespan into an active visit. -/ noncomputable def ghostActiveInput {R : Type*} [DecidableEq R] (h : R) (β : ℝ) : GhostFiniteState R → ℝ | none => β | some none => 0 | some (some r) => if r = h then 1 else 0 /- Scatter an active visit to a completed or matching pending lifespan. -/ noncomputable def ghostActiveOutput {R : Type*} [DecidableEq R] (h : R) : GhostFiniteState R → ℝ | none => 0 | some none => 1 | some (some r) => if r = h then 1 else 0 noncomputable def ghostPhaseGather {R : Type*} [DecidableEq R] (a : Bool) (h : R) (β : ℝ) : GhostPhaseState R → GhostFiniteState R → ℝ := if a then fun z y => match z with | none => ghostActiveInput h β y | some _ => 0 else fun z y => match z with | none => 0 | some c => if c = y then 1 else 0 noncomputable def ghostPhaseScatter {R : Type*} [DecidableEq R] (a : Bool) (h : R) : GhostFiniteState R → GhostPhaseState R → ℝ := if a then fun x z => match z with | none => ghostActiveOutput h x | some _ => 0 else fun x z => match z with | none => 0 | some c => if x = c then 1 else 0 noncomputable def ghostPhaseVisit {R : Type*} [DecidableEq R] (a : Bool) (h : R) (η β : ℝ) : GhostPhaseState R → GhostPhaseState R → ℝ := if a then fun z w => match z, w with | none, none => 1 | _, _ => 0 else fun z w => match z, w with | some x, some y => ghostFiniteKernel h η β x y | _, _ => 0 /- The edge joins a source scatter to the following target gather. -/ noncomputable def ghostPhaseEdge {R : Type*} [Fintype R] [DecidableEq R] (aTarget aSource : Bool) (hTarget hSource : R) (β : ℝ) (z w : GhostPhaseState R) : ℝ := ∑ c : GhostFiniteState R, ghostPhaseGather aTarget hTarget β z c * ghostPhaseScatter aSource hSource c w /- An active canonical transition has rank one. -/ theorem ghost_active_kernel_factor {R : Type*} [DecidableEq R] (h : R) (η β : ℝ) (x y : GhostFiniteState R) : activeGhostFiniteKernel true h η β x y = ghostActiveOutput h x * ghostActiveInput h β y := by rcases x with _ | (_ | r) <;> rcases y with _ | (_ | s) <;> simp [activeGhostFiniteKernel, ghostActiveOutput, ghostActiveInput] split <;> simp_all tauto /- Exact factorization through active or inactive phase memory. -/ theorem ghost_phase_kernel_factorization {R : Type*} [Fintype R] [DecidableEq R] (a : Bool) (h : R) (η β : ℝ) (x y : GhostFiniteState R) : activeGhostFiniteKernel a h η β x y = ∑ z : GhostPhaseState R, ∑ w : GhostPhaseState R, ghostPhaseScatter a h x z * ghostPhaseVisit a h η β z w * ghostPhaseGather a h β w y := by cases a · simp [ghostPhaseScatter, ghostPhaseVisit, ghostPhaseGather, activeGhostFiniteKernel, ite_mul, mul_ite] · simp [ghostPhaseScatter, ghostPhaseVisit, ghostPhaseGather, ghost_active_kernel_factor] /- Consecutive active visits require equal hit residues, with no new birth cost. -/ theorem ghost_phase_edge_active_active {R : Type*} [Fintype R] [DecidableEq R] (hTarget hSource : R) (β : ℝ) : ghostPhaseEdge true true hTarget hSource β none none = if hSource = hTarget then 1 else 0 := by simp [ghostPhaseEdge, ghostPhaseGather, ghostPhaseScatter, ghostActiveInput, ghostActiveOutput, mul_ite, eq_comm] /- Leaving an active phase scatters to canonical inactive memory. -/ theorem ghost_phase_edge_inactive_active {R : Type*} [Fintype R] [DecidableEq R] (hTarget hSource : R) (β : ℝ) (x : GhostFiniteState R) : ghostPhaseEdge false true hTarget hSource β (some x) none = ghostActiveOutput hSource x := by simp [ghostPhaseEdge, ghostPhaseGather, ghostPhaseScatter, ite_mul] /- Entering an active phase gathers canonical inactive memory. -/ theorem ghost_phase_edge_active_inactive {R : Type*} [Fintype R] [DecidableEq R] (hTarget hSource : R) (β : ℝ) (y : GhostFiniteState R) : ghostPhaseEdge true false hTarget hSource β none (some y) = ghostActiveInput hTarget β y := by simp [ghostPhaseEdge, ghostPhaseGather, ghostPhaseScatter, mul_ite] /- Consecutive inactive phases carry canonical memory without changing it. -/ theorem ghost_phase_edge_inactive_inactive {R : Type*} [Fintype R] [DecidableEq R] (hTarget hSource : R) (β : ℝ) (x y : GhostFiniteState R) : ghostPhaseEdge false false hTarget hSource β (some x) (some y) = if x = y then 1 else 0 := by simp [ghostPhaseEdge, ghostPhaseGather, ghostPhaseScatter] end section open Finset def ghostPhaseMask {I : Type*} {R : I → Type*} (a : I → Bool) (x : (i : I) → Option (GhostFiniteState (R i))) : Prop := ∀ i, (x i).isSome = !(a i) end section /- The local diagonal whose neighboring factors supply the endpoint rho factors and the two rho factors at an internal pending hit. -/ noncomputable def ghostPhaseDiagonal {R : Type*} [DecidableEq R] (hit : R) (ρ : ℝ) : GhostPhaseState R → ℝ | some (some (some r)) => if r = hit then ρ else 1 | _ => 1 theorem ghostPhaseDiagonal_ne_zero {R : Type*} [DecidableEq R] (hit : R) {ρ : ℝ} (hρ : ρ ≠ 0) (x : Option (GhostFiniteState R)) : ghostPhaseDiagonal hit ρ x ≠ 0 := by rcases x with _ | (_ | (_ | r)) · exact one_ne_zero · exact one_ne_zero · exact one_ne_zero · simp only [ghostPhaseDiagonal] split · exact hρ · exact one_ne_zero /- The visit normalization matching the adjacent diagonal edge factors. -/ noncomputable def ghostPhaseDampedVisit {R : Type*} [DecidableEq R] (a : Bool) (hit : R) (η β ρ : ℝ) (z w : GhostPhaseState R) : ℝ := ghostPhaseVisit a hit η β z w / (ghostPhaseDiagonal hit ρ z * ghostPhaseDiagonal hit ρ w) end section /- Multiply the phase edge by the target and source diagonals, in the output-row/input-column convention. -/ noncomputable def ghostPhaseDampedEdge {R : Type*} [Fintype R] [DecidableEq R] (aTarget aSource : Bool) (hTarget hSource : R) (β ρTarget ρSource : ℝ) (z w : GhostPhaseState R) : ℝ := ghostPhaseDiagonal hTarget ρTarget z * ghostPhaseEdge aTarget aSource hTarget hSource β z w * ghostPhaseDiagonal hSource ρSource w end section open Finset def ghostFiniteTerminal {R : Type*} : GhostFiniteState R → ℝ | none => 1 | some none => 1 | some (some _) => 0 noncomputable def ghostPhaseInitial {R : Type*} (a : Bool) (β : ℝ) : GhostPhaseState R → ℝ := if a then fun z => match z with | none => β | some _ => 0 else fun z => match z with | none => 0 | some c => ghostFiniteInitial c def ghostPhaseTerminal {R : Type*} (a : Bool) : GhostPhaseState R → ℝ := if a then fun z => match z with | none => 1 | some _ => 0 else fun z => match z with | none => 0 | some c => ghostFiniteTerminal c theorem ghost_phase_gather_initial {R : Type*} [Fintype R] [DecidableEq R] (a : Bool) (h : R) (β : ℝ) (z : GhostPhaseState R) : (∑ c, ghostPhaseGather a h β z c * ghostFiniteInitial c) = ghostPhaseInitial a β z := by cases a <;> cases z <;> simp [ghostPhaseGather, ghostPhaseInitial, ghostActiveInput, ghostFiniteInitial] theorem ghost_phase_scatter_terminal {R : Type*} [Fintype R] [DecidableEq R] (a : Bool) (h : R) (z : GhostPhaseState R) : (∑ c, ghostFiniteTerminal c * ghostPhaseScatter a h c z) = ghostPhaseTerminal a z := by cases a <;> cases z <;> simp [ghostPhaseScatter, ghostPhaseTerminal, ghostActiveOutput, ghostFiniteTerminal, mul_ite] noncomputable def ghostPhaseHistory {R : Type*} [Fintype R] [DecidableEq R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (β : ℝ) (n : ℕ) : ℝ := ∑ x, ghostPhaseTerminal (a n) x * finitePathAction (fun j x y => ∑ z, ghostPhaseVisit (a (j + 1)) (h (j + 1)) (η (j + 1)) β x z * ghostPhaseEdge (a (j + 1)) (a j) (h (j + 1)) (h j) β z y) (fun x => ∑ y, ghostPhaseVisit (a 0) (h 0) (η 0) β x y * ghostPhaseInitial (a 0) β y) n x /- The phase history is exactly the canonical vacuum after all `n+1` visits. -/ theorem ghost_phase_history_eq_vacuum {R : Type*} [Fintype R] [DecidableEq R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (β : ℝ) (n : ℕ) : ghostPhaseHistory a h η β n = (activeGhostRun a h η β (n + 1)).unborn + (activeGhostRun a h η β (n + 1)).completed := by let A := fun j => ghostPhaseScatter (a j) (h j) let B := fun j => ghostPhaseGather (a j) (h j) β let G := fun j => ghostPhaseVisit (a j) (h j) (η j) β have hK : finiteCompressionKernel A B G = (fun j => activeGhostFiniteKernel (a j) (h j) (η j) β) := by funext j x y exact (ghost_phase_kernel_factorization (a j) (h j) (η j) β x y).symm have hE : finiteCompressionStep A B G = (fun j x y => ∑ z, G (j + 1) x z * ghostPhaseEdge (a (j + 1)) (a j) (h (j + 1)) (h j) β z y) := by funext j x y simp only [finiteCompressionStep, ghostPhaseEdge, mul_sum, mul_assoc, A, B] have hI : finiteCompressionInitial B G ghostFiniteInitial = (fun x => ∑ y, G 0 x y * ghostPhaseInitial (a 0) β y) := by funext x simp only [finiteCompressionInitial, B] simp_rw [mul_assoc, ← mul_sum, ghost_phase_gather_initial] have hc := finite_path_action_compress_weighted A B G ghostFiniteInitial ghostFiniteTerminal n rw [hK, hE, hI] at hc simp_rw [A, ghost_phase_scatter_terminal] at hc have hv : (∑ x, ghostFiniteTerminal x * finitePathAction (fun j => activeGhostFiniteKernel (a j) (h j) (η j) β) ghostFiniteInitial (n + 1) x) = (activeGhostRun a h η β (n + 1)).unborn + (activeGhostRun a h η β (n + 1)).completed := by simp only [active_ghost_finite_action_eq_vector, ghostFiniteTerminal, Fintype.sum_option, activeGhostFiniteVector, one_mul, zero_mul, sum_const_zero, add_zero] rw [hv] at hc exact hc.symm /- This is the exact normalized active-residue expectation, including single global births and the full active/inactive pattern. -/ theorem ghost_phase_history_residue_identity {R : Type*} [Fintype R] [DecidableEq R] [Nonempty R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (n : ℕ) (b : ℝ) (hb : b = 1 - (∑ j ∈ range (n + 1), η j) / Fintype.card R) (hb0 : b ≠ 0) : b * ghostPhaseHistory a h η ((Fintype.card R : ℝ) * b)⁻¹ n = (∑ r : R, activeResidueWeight (range (n + 1)) ((range (n + 1)).filter (fun j => a j = true)) h η r) / Fintype.card R := by rw [ghost_phase_history_eq_vacuum, activeGhost_vacuum_identity a h η (n + 1) b hb hb0] simp_rw [activeGhost_product_eq_weight] exact mul_div_cancel₀ _ hb0 end section open Finset section Local variable {R : Type*} [DecidableEq R] end Local /- A single incompatible coordinate annihilates a supported tensor product. -/ theorem ghost_phase_prod_invalid {I M : Type*} [Fintype I] [CommMonoidWithZero M] {R : I → Type*} (a : I → Bool) (z : (i : I) → GhostPhaseState (R i)) (f : I → M) (hf : ∀ i, (z i).isSome ≠ !(a i) → f i = 0) (hz : ¬ ghostPhaseMask a z) : (∏ i, f i) = 0 := by classical obtain ⟨i, hi⟩ : ∃ i, (z i).isSome ≠ !(a i) := by simpa only [ghostPhaseMask, not_forall] using hz exact prod_eq_zero (mem_univ i) (hf i hi) section Tensor variable {I : Type*} [Fintype I] {R : I → Type*} [∀ i, DecidableEq (R i)] end Tensor section Weighted variable {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} variable [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] end Weighted end section open Finset noncomputable def alternatingTensorPairing {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] {𝕜 : Type*} [CommSemiring 𝕜] (G E : ℕ → (i : I) → X i → X i → 𝕜) (f q : (i : I) → X i → 𝕜) (n : ℕ) : 𝕜 := ∑ x : (i : I) → X i, (∏ i, q i (x i)) * finitePathAction (fun j (x y : (i : I) → X i) => ∑ z : (i : I) → X i, (∏ i, G (j + 1) i (x i) (z i)) * ∏ i, E j i (z i) (y i)) (fun x => ∑ y : (i : I) → X i, (∏ i, G 0 i (x i) (y i)) * ∏ i, f i (y i)) n x theorem alternating_tensor_pairing_factor {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] {𝕜 : Type*} [CommSemiring 𝕜] (G E : ℕ → (i : I) → X i → X i → 𝕜) (f q : (i : I) → X i → 𝕜) (n : ℕ) : alternatingTensorPairing G E f q n = ∏ i, ∑ x : X i, q i x * finitePathAction (fun j x y => ∑ z, G (j + 1) i x z * E j i z y) (fun x => ∑ y, G 0 i x y * f i y) n x := by classical unfold alternatingTensorPairing have hstep : (fun j (x y : (i : I) → X i) => ∑ z : (i : I) → X i, (∏ i, G (j + 1) i (x i) (z i)) * ∏ i, E j i (z i) (y i)) = (fun j (x y : (i : I) → X i) => ∏ i, ∑ z, G (j + 1) i (x i) z * E j i z (y i)) := by funext j x y simp_rw [← prod_mul_distrib] exact (Fintype.prod_sum (fun i z => G (j + 1) i (x i) z * E j i z (y i))).symm have hinit : (fun x : (i : I) → X i => ∑ y : (i : I) → X i, (∏ i, G 0 i (x i) (y i)) * ∏ i, f i (y i)) = (fun x : (i : I) → X i => ∏ i, ∑ y, G 0 i (x i) y * f i y) := by funext x simp_rw [← prod_mul_distrib] exact (Fintype.prod_sum (fun i y => G 0 i (x i) y * f i y)).symm rw [hstep, hinit] simp_rw [finite_path_action_tensor (fun j i x y => ∑ z, G (j + 1) i x z * E j i z y) (fun i x => ∑ y, G 0 i x y * f i y)] simp only [← prod_mul_distrib] exact (Fintype.prod_sum (fun i x => q i x * finitePathAction (fun j x y => ∑ z, G (j + 1) i x z * E j i z y) (fun x => ∑ y, G 0 i x y * f i y) n x)).symm end section open Finset /- The initial phase test never starts with an inactive pending particle. -/ theorem ghost_phase_initial_diagonal_one {R : Type*} [DecidableEq R] (a : Bool) (hit : R) (β ρ : ℝ) (z : GhostPhaseState R) (hz : ghostPhaseInitial a β z ≠ 0) : ghostPhaseDiagonal hit ρ z = 1 := by cases a <;> rcases z with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseInitial, ghostFiniteInitial, ghostPhaseDiagonal] /- The terminal phase test excludes all inactive pending particles. -/ theorem ghost_phase_terminal_diagonal_one {R : Type*} [DecidableEq R] (a : Bool) (hit : R) (ρ : ℝ) (z : GhostPhaseState R) (hz : ghostPhaseTerminal a z ≠ 0) : ghostPhaseDiagonal hit ρ z = 1 := by cases a <;> rcases z with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseTerminal, ghostFiniteTerminal, ghostPhaseDiagonal] end section open Finset end section open Finset /- The number of active runs among visits `0,...,n`. -/ def ghostPhaseRunCount (a : ℕ → Bool) : ℕ → ℕ | 0 => if a 0 then 1 else 0 | n + 1 => ghostPhaseRunCount a n + if a (n + 1) && !(a n) then 1 else 0 /- An initial active slot starts one active run. -/ noncomputable def ghostPhaseRunInitial {R : Type*} (a : Bool) (β V : ℝ) (x : GhostPhaseState R) : ℝ := (if a then V⁻¹ else 1) * ghostPhaseInitial a β x /- Only an inactive-to-active entry starts a new run across an edge. -/ noncomputable def ghostPhaseRunEdge {R : Type*} [Fintype R] [DecidableEq R] (aTarget aSource : Bool) (hTarget hSource : R) (β V : ℝ) (x y : GhostPhaseState R) : ℝ := (if aTarget && !aSource then V⁻¹ else 1) * ghostPhaseEdge aTarget aSource hTarget hSource β x y /- The alternating phase history with the group factor charged at exactly the start of each active run. The terminal test is unchanged. -/ noncomputable def ghostPhaseRunHistory {R : Type*} [Fintype R] [DecidableEq R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (β V : ℝ) (n : ℕ) : ℝ := ∑ x, ghostPhaseTerminal (a n) x * finitePathAction (fun j x y => ∑ z, ghostPhaseVisit (a (j + 1)) (h (j + 1)) (η (j + 1)) β x z * ghostPhaseRunEdge (a (j + 1)) (a j) (h (j + 1)) (h j) β V z y) (fun x => ∑ y, ghostPhaseVisit (a 0) (h 0) (η 0) β x y * ghostPhaseRunInitial (a 0) β V y) n x /- The full normalized alternating history differs by exactly one group factor per active run, including the initial run and excluding the terminal test. -/ theorem ghost_phase_run_history_eq {R : Type*} [Fintype R] [DecidableEq R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (β V : ℝ) (n : ℕ) : ghostPhaseRunHistory a h η β V n = (V⁻¹) ^ ghostPhaseRunCount a n * ghostPhaseHistory a h η β n := by let K := fun j (x y : GhostPhaseState R) => ∑ z, ghostPhaseVisit (a (j + 1)) (h (j + 1)) (η (j + 1)) β x z * ghostPhaseEdge (a (j + 1)) (a j) (h (j + 1)) (h j) β z y let f := fun x : GhostPhaseState R => ∑ y, ghostPhaseVisit (a 0) (h 0) (η 0) β x y * ghostPhaseInitial (a 0) β y let c := fun j => if a (j + 1) && !(a j) then V⁻¹ else 1 let d := if a 0 then V⁻¹ else 1 have hK : (fun j (x y : GhostPhaseState R) => ∑ z, ghostPhaseVisit (a (j + 1)) (h (j + 1)) (η (j + 1)) β x z * ghostPhaseRunEdge (a (j + 1)) (a j) (h (j + 1)) (h j) β V z y) = (fun j x y => c j * K j x y) := by funext j x y simp only [ghostPhaseRunEdge, K, c, mul_sum] apply sum_congr rfl intro z _ ring have hf : (fun x : GhostPhaseState R => ∑ y, ghostPhaseVisit (a 0) (h 0) (η 0) β x y * ghostPhaseRunInitial (a 0) β V y) = (fun x => d * f x) := by funext x simp only [ghostPhaseRunInitial, d, f, mul_sum] apply sum_congr rfl intro y _ ring have hc (j : ℕ) : c j * (V⁻¹) ^ ghostPhaseRunCount a j = (V⁻¹) ^ ghostPhaseRunCount a (j + 1) := by simp only [ghostPhaseRunCount, pow_add, c] cases a (j + 1) <;> cases a j <;> simp [mul_comm] have haction (m : ℕ) (x : GhostPhaseState R) : finitePathAction (fun j x y => c j * K j x y) (fun x => d * f x) m x = (V⁻¹) ^ ghostPhaseRunCount a m * finitePathAction K f m x := by induction m generalizing x with | zero => simp only [finitePathAction, ghostPhaseRunCount, d] cases a 0 <;> simp | succ m ih => simp only [finitePathAction, ih] calc _ = (c m * (V⁻¹) ^ ghostPhaseRunCount a m) * (∑ y, K m x y * finitePathAction K f m y) := by rw [mul_sum] apply sum_congr rfl intro y _ ring _ = _ := by rw [hc] unfold ghostPhaseRunHistory rw [hK, hf] simp_rw [haction] change (∑ x, ghostPhaseTerminal (a n) x * ((V⁻¹) ^ ghostPhaseRunCount a n * finitePathAction K f n x)) = (V⁻¹) ^ ghostPhaseRunCount a n * (∑ x, ghostPhaseTerminal (a n) x * finitePathAction K f n x) rw [mul_sum] apply sum_congr rfl intro x _ ring /- Restoring the baseline gives the original residue expectation with the required `V^(-number of active runs)` mark normalization. -/ theorem ghost_phase_run_history_residue_identity {R : Type*} [Fintype R] [DecidableEq R] [Nonempty R] (a : ℕ → Bool) (h : ℕ → R) (η : ℕ → ℝ) (V : ℝ) (n : ℕ) (b : ℝ) (hb : b = 1 - (∑ j ∈ range (n + 1), η j) / Fintype.card R) (hb0 : b ≠ 0) : b * ghostPhaseRunHistory a h η ((Fintype.card R : ℝ) * b)⁻¹ V n = (V⁻¹) ^ ghostPhaseRunCount a n * ((∑ r : R, activeResidueWeight (range (n + 1)) ((range (n + 1)).filter (fun j => a j = true)) h η r) / Fintype.card R) := by rw [ghost_phase_run_history_eq, ← mul_assoc, mul_comm b, mul_assoc] rw [ghost_phase_history_residue_identity a h η n b hb hb0] end section open Finset end section /- Shift inactive pending residues, fixing the active phase and both vacua. -/ def ghostPhaseShift {R : Type*} [AddGroup R] (t : R) : GhostPhaseState R ≃ GhostPhaseState R := Equiv.optionCongr (ghostMemoryShift t) theorem ghostPhaseShift_active {R : Type*} [AddGroup R] (t : R) : ghostPhaseShift t (none : GhostPhaseState R) = none := rfl theorem ghostPhaseShift_unborn {R : Type*} [AddGroup R] (t : R) : ghostPhaseShift t (some none : GhostPhaseState R) = some none := rfl theorem ghostPhaseShift_completed {R : Type*} [AddGroup R] (t : R) : ghostPhaseShift t (some (some none) : GhostPhaseState R) = some (some none) := rfl theorem ghostPhaseShift_pending {R : Type*} [AddGroup R] (t r : R) : ghostPhaseShift t (some (some (some r))) = some (some (some (r - t))) := rfl theorem ghostPhaseShift_add {R : Type*} [AddGroup R] (t u : R) (x : GhostPhaseState R) : ghostPhaseShift (t + u) x = ghostPhaseShift t (ghostPhaseShift u x) := by cases x with | none => rfl | some x => change some (ghostMemoryShift (t + u) x) = some (ghostMemoryShift t (ghostMemoryShift u x)) rw [ghostMemoryShift_add] theorem ghostPhaseShift_symm {R : Type*} [AddGroup R] (t : R) (x : GhostPhaseState R) : (ghostPhaseShift t).symm x = ghostPhaseShift (-t) x := by cases x with | none => rfl | some x => change some ((ghostMemoryShift t).symm x) = some (ghostMemoryShift (-t) x) rw [ghostMemoryShift_symm] section variable {R : Type*} [sharedInstance1 : AddGroup R] [sharedInstance2 : DecidableEq R] (a : Bool) (h t : R) include R sharedInstance1 sharedInstance2 a h t /- Simultaneous translation preserves the gather operation. -/ theorem ghost_phase_gather_translation (β : ℝ) (z : GhostPhaseState R) (c : GhostFiniteState R) : ghostPhaseGather a h β z c = ghostPhaseGather a (h - t) β (ghostPhaseShift t z) (ghostMemoryShift t c) := by cases a <;> rcases z with _ | (_ | (_ | r)) <;> rcases c with _ | (_ | s) <;> simp [ghostPhaseGather, ghostActiveInput, ghostPhaseShift, ghostMemoryShift] /- Simultaneous translation preserves the scatter operation. -/ theorem ghost_phase_scatter_translation (c : GhostFiniteState R) (z : GhostPhaseState R) : ghostPhaseScatter a h c z = ghostPhaseScatter a (h - t) (ghostMemoryShift t c) (ghostPhaseShift t z) := by cases a <;> rcases z with _ | (_ | (_ | r)) <;> rcases c with _ | (_ | s) <;> simp [ghostPhaseScatter, ghostActiveOutput, ghostPhaseShift, ghostMemoryShift] /- Simultaneous translation preserves the actual phase visit. -/ theorem ghost_phase_visit_translation (η β : ℝ) (x y : GhostPhaseState R) : ghostPhaseVisit a h η β x y = ghostPhaseVisit a (h - t) η β (ghostPhaseShift t x) (ghostPhaseShift t y) := by cases a <;> rcases x with _ | (_ | (_ | r)) <;> rcases y with _ | (_ | (_ | s)) <;> simp [ghostPhaseVisit, ghostFiniteKernel, ghostPhaseShift, ghostMemoryShift] end /- An edge is unchanged when both endpoint hit residues and both endpoint phase states are translated by the same frame. -/ theorem ghost_phase_edge_translation {R : Type*} [AddGroup R] [Fintype R] [DecidableEq R] (aTarget aSource : Bool) (hTarget hSource t : R) (β : ℝ) (x y : GhostPhaseState R) : ghostPhaseEdge aTarget aSource hTarget hSource β x y = ghostPhaseEdge aTarget aSource (hTarget - t) (hSource - t) β (ghostPhaseShift t x) (ghostPhaseShift t y) := by unfold ghostPhaseEdge calc _ = ∑ c, ghostPhaseGather aTarget (hTarget - t) β (ghostPhaseShift t x) (ghostMemoryShift t c) * ghostPhaseScatter aSource (hSource - t) (ghostMemoryShift t c) (ghostPhaseShift t y) := by apply Finset.sum_congr rfl intro c hc rw [ghost_phase_gather_translation aTarget hTarget t, ghost_phase_scatter_translation aSource hSource t] _ = _ := (ghostMemoryShift t).sum_comp (fun c => ghostPhaseGather aTarget (hTarget - t) β (ghostPhaseShift t x) c * ghostPhaseScatter aSource (hSource - t) c (ghostPhaseShift t y)) /- The rho diagonal is covariant under the same translation. -/ theorem ghost_phase_diagonal_translation {R : Type*} [AddGroup R] [DecidableEq R] (h t : R) (ρ : ℝ) (x : GhostPhaseState R) : ghostPhaseDiagonal h ρ x = ghostPhaseDiagonal (h - t) ρ (ghostPhaseShift t x) := by rcases x with _ | (_ | (_ | r)) <;> simp [ghostPhaseDiagonal, ghostPhaseShift, ghostMemoryShift] theorem ghost_phase_damped_visit_translation {R : Type*} [AddGroup R] [DecidableEq R] (a : Bool) (h t : R) (η β ρ : ℝ) (x y : GhostPhaseState R) : ghostPhaseDampedVisit a h η β ρ x y = ghostPhaseDampedVisit a (h - t) η β ρ (ghostPhaseShift t x) (ghostPhaseShift t y) := by unfold ghostPhaseDampedVisit rw [ghost_phase_visit_translation a h t, ghost_phase_diagonal_translation h t ρ x, ghost_phase_diagonal_translation h t ρ y] theorem ghost_phase_diagonal_relative_zero {R : Type*} [AddGroup R] [DecidableEq R] (h : R) (ρ : ℝ) (x : GhostPhaseState R) : ghostPhaseDiagonal h ρ ((ghostPhaseShift h).symm x) = ghostPhaseDiagonal 0 ρ x := by rw [ghost_phase_diagonal_translation h h] simp only [sub_self, Equiv.apply_symm_apply] theorem ghost_phase_damped_visit_relative_zero {R : Type*} [AddGroup R] [DecidableEq R] (a : Bool) (h : R) (η β ρ : ℝ) (x y : GhostPhaseState R) : ghostPhaseDampedVisit a h η β ρ ((ghostPhaseShift h).symm x) ((ghostPhaseShift h).symm y) = ghostPhaseDampedVisit a 0 η β ρ x y := by rw [ghost_phase_damped_visit_translation a h h] simp only [sub_self, Equiv.apply_symm_apply] /- The source-frame pending coordinate is translated into the target frame by r -> r-delta. In that frame the two hit residues are zero and -delta. -/ noncomputable def ghostPhaseMovingEdge {R : Type*} [AddGroup R] [Fintype R] [DecidableEq R] (aTarget aSource : Bool) (delta : R) (β : ℝ) (x y : GhostPhaseState R) : ℝ := ghostPhaseEdge aTarget aSource 0 (-delta) β x (ghostPhaseShift delta y) theorem ghost_phase_edge_conjugation {R : Type*} [AddGroup R] [Fintype R] [DecidableEq R] (aTarget aSource : Bool) (hTarget hSource : R) (β : ℝ) (x y : GhostPhaseState R) : ghostPhaseEdge aTarget aSource hTarget hSource β ((ghostPhaseShift hTarget).symm x) ((ghostPhaseShift hSource).symm y) = ghostPhaseMovingEdge aTarget aSource (hTarget - hSource) β x y := by rw [ghost_phase_edge_translation aTarget aSource hTarget hSource hTarget, Equiv.apply_symm_apply, ghostPhaseShift_symm, ← ghostPhaseShift_add] simp only [ghostPhaseMovingEdge, sub_self, sub_eq_add_neg, neg_add_rev, neg_neg] /- In local frames each endpoint damping tests residue zero in that endpoint's own coordinate system. -/ noncomputable def ghostPhaseDampedMovingEdge {R : Type*} [AddGroup R] [Fintype R] [DecidableEq R] (aTarget aSource : Bool) (delta : R) (β ρTarget ρSource : ℝ) (x y : GhostPhaseState R) : ℝ := ghostPhaseDiagonal 0 ρTarget x * ghostPhaseMovingEdge aTarget aSource delta β x y * ghostPhaseDiagonal 0 ρSource y section variable {R : Type*} [sharedInstance1 : AddGroup R] [sharedInstance2 : Fintype R] [sharedInstance3 : DecidableEq R] include R sharedInstance1 sharedInstance2 sharedInstance3 /- Equivalently, shift the input to the target frame before evaluating the damped edge whose source hit is minus delta in that frame. -/ theorem ghost_phase_damped_moving_edge_eq_shifted (aTarget aSource : Bool) (delta : R) (β ρTarget ρSource : ℝ) (x y : GhostPhaseState R) : ghostPhaseDampedMovingEdge aTarget aSource delta β ρTarget ρSource x y = ghostPhaseDampedEdge aTarget aSource 0 (-delta) β ρTarget ρSource x (ghostPhaseShift delta y) := by unfold ghostPhaseDampedMovingEdge ghostPhaseDampedEdge ghostPhaseMovingEdge rw [ghost_phase_diagonal_translation 0 delta ρSource y] simp only [zero_sub] theorem ghost_phase_damped_edge_conjugation (aTarget aSource : Bool) (hTarget hSource : R) (β ρTarget ρSource : ℝ) (x y : GhostPhaseState R) : ghostPhaseDampedEdge aTarget aSource hTarget hSource β ρTarget ρSource ((ghostPhaseShift hTarget).symm x) ((ghostPhaseShift hSource).symm y) = ghostPhaseDampedMovingEdge aTarget aSource (hTarget - hSource) β ρTarget ρSource x y := by unfold ghostPhaseDampedEdge ghostPhaseDampedMovingEdge rw [ghost_phase_edge_conjugation, ghost_phase_diagonal_relative_zero, ghost_phase_diagonal_relative_zero] /- Shared activity requires zero frame displacement. -/ theorem ghost_phase_moving_edge_active_active (delta : R) (β : ℝ) : ghostPhaseMovingEdge true true delta β none none = if delta = 0 then 1 else 0 := by rw [ghostPhaseMovingEdge, ghostPhaseShift_active, ghost_phase_edge_active_active] simp only [neg_eq_zero] /- Storage is born at source residue zero and arrives at target residue minus delta. Dropping an active particle instead completes its lifespan. -/ theorem ghost_phase_moving_edge_inactive_active (delta : R) (β : ℝ) (x : GhostFiniteState R) : ghostPhaseMovingEdge false true delta β (some x) none = match x with | none => 0 | some none => 1 | some (some r) => if r = -delta then 1 else 0 := by rw [ghostPhaseMovingEdge, ghostPhaseShift_active, ghost_phase_edge_inactive_active] rcases x with _ | (_ | r) <;> rfl /- Promotion checks target residue zero: the source-frame pending residue must equal delta. Fresh active births retain their single beta factor. -/ theorem ghost_phase_moving_edge_active_inactive (delta : R) (β : ℝ) (y : GhostFiniteState R) : ghostPhaseMovingEdge true false delta β none (some y) = match y with | none => β | some none => 0 | some (some r) => if r = delta then 1 else 0 := by change ghostPhaseEdge true false 0 (-delta) β none (some (ghostMemoryShift delta y)) = _ rw [ghost_phase_edge_active_inactive] rcases y with _ | (_ | r) <;> simp [ghostActiveInput, ghostMemoryShift, sub_eq_zero] /- Inactive memory is transported by the frame displacement. -/ theorem ghost_phase_moving_edge_inactive_inactive (delta : R) (β : ℝ) (x y : GhostFiniteState R) : ghostPhaseMovingEdge false false delta β (some x) (some y) = if x = ghostMemoryShift delta y then 1 else 0 := by exact ghost_phase_edge_inactive_inactive 0 (-delta) β x (ghostMemoryShift delta y) end end section open Finset /- The recursive phase count equals the set-membership active-run count. -/ theorem ghost_phase_run_count_eq_active_run_count {α : Type*} [DecidableEq α] (A : ℕ → Finset α) (n : ℕ) (p : α) : ghostPhaseRunCount (fun j => decide (p ∈ A j)) n = activeRunCount A n p := by induction n with | zero => simp [ghostPhaseRunCount, activeRunCount] | succ n ih => rw [ghostPhaseRunCount, ih] simp only [activeRunCount] rw [sum_range_succ] simp [mem_sdiff, Nat.add_assoc] /- Tagged prime activity and the corresponding group's marks count the same runs, including the initial visit. -/ theorem physical_phase_run_count {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (L : ℕ → PhysicalMarkLists P J ell) (n : ℕ) (p : PhysicalPrime P) : ghostPhaseRunCount (fun j => decide (p ∈ physicalMarkedPrimes (L j))) n = activeRunCount (fun j => physicalGroupMarks (L j) p.1) n p.2.val := by simp_rw [mem_physical_marked_primes] exact ghost_phase_run_count_eq_active_run_count _ n p.2.val end section open Finset /- A product of retain-or-move kernels is exactly the sum over all choices of which coordinates move. The test function need not factor across coordinates, and the retained and moved values may coincide. -/ theorem finite_binary_kernel_expansion {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] [∀ i, DecidableEq (X i)] {R : Type*} [CommSemiring R] (x u : (i : I) → X i) (a b : I → R) (F : ((i : I) → X i) → R) : (∑ y : (i : I) → X i, (∏ i, (a i * (if y i = x i then 1 else 0) + b i * (if y i = u i then 1 else 0))) * F y) = ∑ c : I → Bool, (∏ i, if c i then b i else a i) * F (fun i => if c i then u i else x i) := by classical have hlocal (i : I) (y : X i) : a i * (if y = x i then 1 else 0) + b i * (if y = u i then 1 else 0) = ∑ c : Bool, if y = (if c then u i else x i) then (if c then b i else a i) else 0 := by simp [mul_ite, add_comm] have hcollapse (v : (i : I) → X i) (w : I → R) : (∑ y : (i : I) → X i, (∏ i, if y i = v i then w i else 0) * F y) = (∏ i, w i) * F v := by simp_rw [Fintype.prod_ite_zero, ← funext_iff] simp calc _ = ∑ y : (i : I) → X i, (∏ i, ∑ c : Bool, if y i = (if c then u i else x i) then (if c then b i else a i) else 0) * F y := by simp_rw [hlocal] _ = ∑ y : (i : I) → X i, (∑ c : I → Bool, ∏ i, if y i = (if c i then u i else x i) then (if c i then b i else a i) else 0) * F y := by simp_rw [Fintype.prod_sum] _ = ∑ c : I → Bool, ∑ y : (i : I) → X i, (∏ i, if y i = (if c i then u i else x i) then (if c i then b i else a i) else 0) * F y := by simp only [sum_mul] exact sum_comm _ = _ := by apply sum_congr rfl intro c _ exact hcollapse (fun i => if c i then u i else x i) (fun i => if c i then b i else a i) end section open Finset def ghostPhaseEndpoint {R : Type*} (h : R) : GhostPhaseState R → GhostPhaseState R | some none => some (some (some h)) | some (some (some _)) => some (some none) | z => z noncomputable def ghostPhaseRetain {R : Type*} [DecidableEq R] (a : Bool) (h : R) (η ρ : ℝ) (z : GhostPhaseState R) : ℝ := ghostPhaseDampedVisit a h η 0 ρ z z noncomputable def ghostPhaseEndpointWeight {R : Type*} [DecidableEq R] (a : Bool) (h : R) (η β ρ : ℝ) : GhostPhaseState R → ℝ := if a then fun _ => 0 else fun z => match z with | some none => -β * η / ρ | some (some (some r)) => if r = h then -η / ρ else 0 | _ => 0 theorem ghost_phase_visit_two_choices {R : Type*} [DecidableEq R] (a : Bool) (h : R) (η β ρ : ℝ) (x y : GhostPhaseState R) : ghostPhaseDampedVisit a h η β ρ x y = ghostPhaseRetain a h η ρ y * (if x = y then 1 else 0) + ghostPhaseEndpointWeight a h η β ρ y * (if x = ghostPhaseEndpoint h y then 1 else 0) := by cases a <;> rcases x with _ | (_ | (_ | r)) <;> rcases y with _ | (_ | (_ | s)) <;> simp [ghostPhaseRetain, ghostPhaseDampedVisit, ghostPhaseVisit, ghostFiniteKernel, ghostPhaseDiagonal, ghostPhaseEndpointWeight, ghostPhaseEndpoint] all_goals split_ifs <;> simp_all /- The full visit row is a sum over independent retain/endpoint choices, even when the continuation test couples all prime coordinates. -/ theorem ghost_phase_tensor_visit_choices {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (a : I → Bool) (h : (i : I) → R i) (η β ρ : I → ℝ) (y : (i : I) → GhostPhaseState (R i)) (F : ((i : I) → GhostPhaseState (R i)) → ℝ) : (∑ x, (∏ i, ghostPhaseDampedVisit (a i) (h i) (η i) (β i) (ρ i) (x i) (y i)) * F x) = ∑ c : I → Bool, (∏ i, if c i then ghostPhaseEndpointWeight (a i) (h i) (η i) (β i) (ρ i) (y i) else ghostPhaseRetain (a i) (h i) (η i) (ρ i) (y i)) * F (fun i => if c i then ghostPhaseEndpoint (h i) (y i) else y i) := by simp_rw [ghost_phase_visit_two_choices] exact finite_binary_kernel_expansion y (fun i => ghostPhaseEndpoint (h i) (y i)) (fun i => ghostPhaseRetain (a i) (h i) (η i) (ρ i) (y i)) (fun i => ghostPhaseEndpointWeight (a i) (h i) (η i) (β i) (ρ i) (y i)) F theorem ghost_phase_endpoint_weight_support {R : Type*} [DecidableEq R] (a : Bool) (h : R) (η β ρ : ℝ) (y : GhostPhaseState R) (hy : ghostPhaseEndpointWeight a h η β ρ y ≠ 0) : a = false ∧ (y = some none ∨ y = some (some (some h))) := by cases a <;> rcases y with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseEndpointWeight] end section theorem finite_weighted_power_le {ι : Type*} [Fintype ι] (w l : ι → ℝ) (hw : ∀ i, 0 ≤ w i) (hl : ∀ i, 0 ≤ l i) {R : ℕ} (hR : 1 ≤ R) : (∑ i, w i * l i) ^ R ≤ (∑ i, w i) ^ (R - 1) * ∑ i, w i * (l i) ^ R := by classical obtain ⟨n, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : R ≠ 0) let W := ∑ i, w i have hW : 0 ≤ W := Finset.sum_nonneg (fun i _ => hw i) by_cases hzero : W = 0 · have hwzero : ∀ i, w i = 0 := by intro i have hi : w i ≤ W := Finset.single_le_sum (fun j _ => hw j) (Finset.mem_univ i) exact le_antisymm (hzero ▸ hi) (hw i) simp [hwzero] · have hWpos : 0 < W := lt_of_le_of_ne hW (Ne.symm hzero) have hj := (convexOn_pow (𝕜 := ℝ) (n + 1)).map_centerMass_le (t := Finset.univ) (w := w) (p := l) (fun i _ => hw i) hWpos (fun i _ => hl i) simp only [Finset.centerMass, smul_eq_mul, Function.comp_apply] at hj change (W⁻¹ * ∑ i, w i * l i) ^ (n + 1) ≤ W⁻¹ * ∑ i, w i * l i ^ (n + 1) at hj have hm := mul_le_mul_of_nonneg_left hj (pow_nonneg hW (n + 1)) have hc : W ^ (n + 1) * W⁻¹ ^ (n + 1) = 1 := by rw [← mul_pow, mul_inv_cancel₀ hzero, one_pow] rw [mul_pow, ← mul_assoc, hc, one_mul] at hm simpa only [Nat.succ_sub_one, pow_succ, mul_assoc, mul_inv_cancel_left₀ hzero, W] using hm end section open scoped BigOperators InnerProductSpace variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [FiniteDimensional ℂ E] theorem spectral_coordinates_pow (T : E →ₗ[ℂ] E) (hT : T.IsSymmetric) (R : ℕ) (f : E) (i : Fin (Module.finrank ℂ E)) : (hT.eigenvectorBasis rfl).repr ((T ^ R) f) i = (hT.eigenvalues rfl i : ℂ) ^ R * (hT.eigenvectorBasis rfl).repr f i := by induction R with | zero => simp | succ R ih => rw [pow_succ', Module.End.mul_apply, hT.eigenvectorBasis_apply_self_apply rfl, ih, pow_succ'] simp only [RCLike.ofReal_eq_complex_ofReal, mul_assoc] theorem spectral_moment_eq_sum (T : E →ₗ[ℂ] E) (hT : T.IsSymmetric) (R : ℕ) (f : E) : (inner ℂ f ((T ^ R) f)).re = ∑ i, ‖inner ℂ (hT.eigenvectorBasis rfl i) f‖ ^ 2 * (hT.eigenvalues rfl i) ^ R := by rw [← (hT.eigenvectorBasis rfl).sum_inner_mul_inner f ((T ^ R) f), Complex.re_sum] apply Finset.sum_congr rfl intro i _ have hi := spectral_coordinates_pow T hT R f i simp only [OrthonormalBasis.repr_apply_apply] at hi rw [hi] rw [show (inner ℂ f (hT.eigenvectorBasis rfl i)) * ((hT.eigenvalues rfl i : ℂ) ^ R * inner ℂ (hT.eigenvectorBasis rfl i) f) = (hT.eigenvalues rfl i : ℂ) ^ R * (inner ℂ f (hT.eigenvectorBasis rfl i) * inner ℂ (hT.eigenvectorBasis rfl i) f) by ring] rw [← inner_conj_symm f (hT.eigenvectorBasis rfl i), RCLike.conj_mul] simp only [RCLike.ofReal_eq_complex_ofReal, ← Complex.ofReal_pow, ← Complex.ofReal_mul, Complex.ofReal_re] ring end section open scoped BigOperators InnerProductSpace variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [FiniteDimensional ℂ E] theorem positive_spectral_moment_power (T : E →ₗ[ℂ] E) (hT : T.IsSymmetric) (hpos : ∀ f : E, 0 ≤ (inner ℂ f (T f)).re) (f : E) {R : ℕ} (hR : 1 ≤ R) : (inner ℂ f (T f)).re ^ R ≤ ‖f‖ ^ (2 * (R - 1)) * (inner ℂ f ((T ^ R) f)).re := by have hl (i : Fin (Module.finrank ℂ E)) : 0 ≤ hT.eigenvalues rfl i := eigenvalue_nonneg_of_nonneg (hT.hasEigenvalue_eigenvalues rfl i) hpos have h := finite_weighted_power_le (fun i => ‖inner ℂ (hT.eigenvectorBasis rfl i) f‖ ^ 2) (hT.eigenvalues rfl) (fun _ => sq_nonneg _) hl hR rw [(hT.eigenvectorBasis rfl).sum_sq_norm_inner_right, ← spectral_moment_eq_sum T hT R f, ← pow_mul] at h have hfirst := spectral_moment_eq_sum T hT 1 f simp only [pow_one] at hfirst rwa [← hfirst] at h theorem positive_spectral_moment_nonneg (T : E →ₗ[ℂ] E) (hT : T.IsSymmetric) (hpos : ∀ f : E, 0 ≤ (inner ℂ f (T f)).re) (R : ℕ) (f : E) : 0 ≤ (inner ℂ f ((T ^ R) f)).re := by rw [spectral_moment_eq_sum T hT R f] apply Finset.sum_nonneg intro i _ apply mul_nonneg (sq_nonneg _) exact pow_nonneg (eigenvalue_nonneg_of_nonneg (hT.hasEigenvalue_eigenvalues rfl i) hpos) R theorem finite_pairing_moment_power (A : E →ₗ[ℂ] E) (f g : E) {R : ℕ} (hR : 1 ≤ R) : ‖inner ℂ f (A g)‖ ^ (2 * R) ≤ ‖g‖ ^ (2 * R) * ‖f‖ ^ (2 * (R - 1)) * (inner ℂ f (((A * A.adjoint) ^ R) f)).re := by have hsym : (A * A.adjoint).IsSymmetric := LinearMap.isSymmetric_self_comp_adjoint A have hpos (v : E) : 0 ≤ (inner ℂ v ((A * A.adjoint) v)).re := by rw [Module.End.mul_apply, ← LinearMap.adjoint_inner_left] exact inner_self_nonneg (𝕜 := ℂ) (x := A.adjoint v) have hmoment := positive_spectral_moment_power (A * A.adjoint) hsym hpos f hR have hinner : (inner ℂ f ((A * A.adjoint) f)).re = ‖A.adjoint f‖ ^ 2 := by rw [Module.End.mul_apply, ← LinearMap.adjoint_inner_left, inner_self_eq_norm_sq_to_K] norm_cast rw [hinner, ← pow_mul] at hmoment have hcs : ‖inner ℂ f (A g)‖ ≤ ‖A.adjoint f‖ * ‖g‖ := by rw [← LinearMap.adjoint_inner_left] exact norm_inner_le_norm _ _ calc ‖inner ℂ f (A g)‖ ^ (2 * R) ≤ (‖A.adjoint f‖ * ‖g‖) ^ (2 * R) := pow_le_pow_left₀ (norm_nonneg _) hcs _ _ = ‖g‖ ^ (2 * R) * ‖A.adjoint f‖ ^ (2 * R) := by rw [mul_pow, mul_comm] _ ≤ ‖g‖ ^ (2 * R) * (‖f‖ ^ (2 * (R - 1)) * (inner ℂ f (((A * A.adjoint) ^ R) f)).re) := mul_le_mul_of_nonneg_left hmoment (pow_nonneg (norm_nonneg _) _) _ = _ := by ring theorem finite_pairing_moment (A : E →ₗ[ℂ] E) (f g : E) {R : ℕ} (hR : 1 ≤ R) : ‖inner ℂ f (A g)‖ ≤ ‖g‖ * ‖f‖ ^ (1 - 1 / (R : ℝ)) * (inner ℂ f (((A * A.adjoint) ^ R) f)).re ^ (1 / (2 * (R : ℝ))) := by have hN : 2 * R ≠ 0 := by omega have hRzero : (R : ℝ) ≠ 0 := by exact_mod_cast (by omega : R ≠ 0) have hpos (v : E) : 0 ≤ (inner ℂ v ((A * A.adjoint) v)).re := by rw [Module.End.mul_apply, ← LinearMap.adjoint_inner_left] exact inner_self_nonneg (𝕜 := ℂ) (x := A.adjoint v) have hmpos := positive_spectral_moment_nonneg (A * A.adjoint) (LinearMap.isSymmetric_self_comp_adjoint A) hpos R f have h := Real.rpow_le_rpow (pow_nonneg (norm_nonneg (inner ℂ f (A g))) (2 * R)) (finite_pairing_moment_power A f g hR) (show 0 ≤ (((2 * R : ℕ) : ℝ)⁻¹) by positivity) rw [Real.pow_rpow_inv_natCast (norm_nonneg _) hN, Real.mul_rpow (mul_nonneg (pow_nonneg (norm_nonneg _) _) (pow_nonneg (norm_nonneg _) _)) hmpos, Real.mul_rpow (pow_nonneg (norm_nonneg _) _) (pow_nonneg (norm_nonneg _) _), Real.pow_rpow_inv_natCast (norm_nonneg _) hN] at h have hexp : ((2 * (R - 1) : ℕ) : ℝ) * (((2 * R : ℕ) : ℝ)⁻¹) = 1 - 1 / (R : ℝ) := by rw [Nat.cast_mul, Nat.cast_mul, Nat.cast_sub hR] push_cast field_simp have hf : (‖f‖ ^ (2 * (R - 1))) ^ (((2 * R : ℕ) : ℝ)⁻¹) = ‖f‖ ^ (1 - 1 / (R : ℝ)) := by rw [← Real.rpow_natCast, ← Real.rpow_mul (norm_nonneg _), hexp] rw [hf] at h simpa only [Nat.cast_mul, Nat.cast_ofNat, one_div] using h end section open Finset /- The completely multiplicative real power of a natural number. -/ noncomputable def natRealRpowHom (s : ℝ) : ℕ →* ℝ where toFun n := (n : ℝ) ^ s map_one' := by simp map_mul' m n := by simp only [Nat.cast_mul] exact Real.mul_rpow (Nat.cast_nonneg m) (Nat.cast_nonneg n) /- A finite set of permitted primes gives a convergent Euler product for every positive exponent. -/ theorem smooth_rpow_summable_and_sum (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {s : ℝ} (hs : 0 < s) : Summable (fun n : Nat.factoredNumbers P => (n.val : ℝ) ^ (-s)) ∧ (∑' n : Nat.factoredNumbers P, (n.val : ℝ) ^ (-s)) = ∏ p ∈ P, (1 - (p : ℝ) ^ (-s))⁻¹ := by have hp : ∀ {p : ℕ}, p.Prime → ‖natRealRpowHom (-s) p‖ < 1 := by intro p hp change ‖(p : ℝ) ^ (-s)‖ < 1 rw [Real.norm_eq_abs, abs_of_nonneg (Real.rpow_nonneg (Nat.cast_nonneg p) _)] exact Real.rpow_lt_one_of_one_lt_of_neg (by exact_mod_cast hp.one_lt) (by linarith) obtain ⟨hsum, hval⟩ := EulerProduct.summable_and_hasSum_factoredNumbers_prod_filter_prime_geometric hp P have heq : P.filter Nat.Prime = P := filter_eq_self.mpr hP constructor · simpa only [natRealRpowHom, MonoidHom.coe_mk, OneHom.coe_mk, Real.norm_eq_abs, abs_of_nonneg (Real.rpow_nonneg (Nat.cast_nonneg _) _)] using hsum · simpa only [natRealRpowHom, MonoidHom.coe_mk, OneHom.coe_mk, heq] using hval.tsum_eq /- Rewrite the geometric factor in a form suited to an exponential product estimate. -/ theorem smooth_geometric_factor {p s : ℝ} (hp : 1 < p) (hs : 0 < s) : (1 - p ^ (-s))⁻¹ = 1 + 1 / (p ^ s - 1) := by have hps : 1 < p ^ s := Real.one_lt_rpow hp hs rw [Real.rpow_neg (by linarith)] have h0 : p ^ s ≠ 0 := ne_of_gt (by linarith) have h1 : p ^ s - 1 ≠ 0 := ne_of_gt (by linarith) field_simp [h0, h1] ring /- Local geometric-factor bounds control the entire finite-prime Euler product. -/ theorem smooth_rpow_sum_le_exp (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {s K : ℝ} (hs : 0 < s) (hlocal : ∀ p ∈ P, 1 / ((p : ℝ) ^ s - 1) ≤ K / (p : ℝ)) : (∑' n : Nat.factoredNumbers P, (n.val : ℝ) ^ (-s)) ≤ Real.exp (K * ∑ p ∈ P, 1 / (p : ℝ)) := by rw [(smooth_rpow_summable_and_sum P hP hs).2] have hnonneg (p : ℕ) (hp : p ∈ P) : 0 ≤ (1 - (p : ℝ) ^ (-s))⁻¹ := by rw [smooth_geometric_factor (by exact_mod_cast (hP p hp).one_lt) hs] have := Real.one_lt_rpow (by exact_mod_cast (hP p hp).one_lt : (1:ℝ) < p) hs positivity calc (∏ p ∈ P, (1 - (p : ℝ) ^ (-s))⁻¹) ≤ ∏ p ∈ P, Real.exp (K / (p : ℝ)) := by apply prod_le_prod₀ hnonneg intro p hp rw [smooth_geometric_factor (by exact_mod_cast (hP p hp).one_lt) hs] have h1 := hlocal p hp have h2 := Real.add_one_le_exp (K / (p : ℝ)) linarith _ = Real.exp (K * ∑ p ∈ P, 1 / (p : ℝ)) := by rw [← Real.exp_sum] congr 1 simp only [mul_sum, mul_one_div] /- The positive-exponent Markov inequality for an individual weighted term. -/ theorem weighted_reciprocal_le_tilt {n X theta w M : ℝ} (hX : 0 < X) (hn : X ≤ n) (htheta : 0 ≤ theta) (hw : 0 ≤ w) (hwM : w ≤ M) : w / n ≤ (M * X ^ (-theta)) * n ^ (-(1 - theta)) := by have hn0 : 0 < n := hX.trans_le hn have hM : 0 ≤ M := hw.trans hwM have hpow : n ^ (-theta) ≤ X ^ (-theta) := Real.rpow_le_rpow_of_nonpos hX hn (by linarith) have hid : n ^ (-theta) * n ^ (-(1-theta)) = n⁻¹ := by rw [← Real.rpow_add hn0] have he : -theta + -(1-theta) = (-1 : ℝ) := by ring rw [he, Real.rpow_neg_one] calc w / n ≤ M / n := div_le_div_of_nonneg_right hwM hn0.le _ = (M * n ^ (-theta)) * n ^ (-(1-theta)) := by rw [mul_assoc, hid, div_eq_mul_inv] _ ≤ (M * X ^ (-theta)) * n ^ (-(1-theta)) := by gcongr /- A cutoff term, indexed by the positive integers with prime factors in `P`. -/ noncomputable def weightedSmoothTailTerm (P : Finset ℕ) (W : ℕ → ℝ) (X : ℝ) (n : Nat.factoredNumbers P) : ℝ := if X ≤ (n.val : ℝ) then W n.val / (n.val : ℝ) else 0 /- Bounded nonnegative weights preserve convergence of the tilted smooth tail. -/ theorem weighted_smooth_tail_summable (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (W : ℕ → ℝ) {M X theta : ℝ} (hM : 0 ≤ M) (hX : 0 < X) (htheta0 : 0 ≤ theta) (htheta1 : theta < 1) (hw0 : ∀ n ∈ Nat.factoredNumbers P, 0 ≤ W n) (hwM : ∀ n ∈ Nat.factoredNumbers P, W n ≤ M) : Summable (weightedSmoothTailTerm P W X) := by apply Summable.of_nonneg_of_le (f := fun n : Nat.factoredNumbers P => (M * X ^ (-theta)) * (n.val : ℝ) ^ (-(1-theta))) · intro n unfold weightedSmoothTailTerm have hw := hw0 n.val n.property split_ifs <;> positivity · intro n unfold weightedSmoothTailTerm split_ifs with hn · exact weighted_reciprocal_le_tilt hX hn htheta0 (hw0 n.val n.property) (hwM n.val n.property) · positivity · exact (smooth_rpow_summable_and_sum P hP (by linarith : 0 < 1-theta)).1.mul_left _ /- The weighted smooth tail is exponentially controlled by its local prime factors. -/ theorem weighted_smooth_tail_le (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (W : ℕ → ℝ) {M X theta K : ℝ} (hM : 0 ≤ M) (hX : 0 < X) (htheta0 : 0 ≤ theta) (htheta1 : theta < 1) (hw0 : ∀ n ∈ Nat.factoredNumbers P, 0 ≤ W n) (hwM : ∀ n ∈ Nat.factoredNumbers P, W n ≤ M) (hlocal : ∀ p ∈ P, 1 / ((p : ℝ) ^ (1-theta) - 1) ≤ K / (p : ℝ)) : (∑' n : Nat.factoredNumbers P, weightedSmoothTailTerm P W X n) ≤ (M * X ^ (-theta)) * Real.exp (K * ∑ p ∈ P, 1 / (p : ℝ)) := by have hsum := weighted_smooth_tail_summable P hP W hM hX htheta0 htheta1 hw0 hwM calc (∑' n : Nat.factoredNumbers P, weightedSmoothTailTerm P W X n) ≤ ∑' n : Nat.factoredNumbers P, (M * X ^ (-theta)) * (n.val : ℝ) ^ (-(1-theta)) := by apply hsum.tsum_le_tsum · intro n unfold weightedSmoothTailTerm split_ifs with hn · exact weighted_reciprocal_le_tilt hX hn htheta0 (hw0 n.val n.property) (hwM n.val n.property) · positivity · exact (smooth_rpow_summable_and_sum P hP (by linarith : 0 < 1-theta)).1.mul_left _ _ = (M * X ^ (-theta)) * (∑' n : Nat.factoredNumbers P, (n.val : ℝ) ^ (-(1-theta))) := tsum_mul_left _ ≤ (M * X ^ (-theta)) * Real.exp (K * ∑ p ∈ P, 1 / (p : ℝ)) := by exact mul_le_mul_of_nonneg_left (smooth_rpow_sum_le_exp P hP (by linarith) hlocal) (by positivity) end section open Filter open scoped Topology theorem prime_tilt_geometric_factor_bound {p theta A : ℝ} (hp : 0 < p) (hlog : theta * Real.log p ≤ A) (hlarge : 2 * Real.exp A ≤ p) : 0 ≤ 1 / (p^(1 - theta) - 1) ∧ 1 / (p^(1 - theta) - 1) ≤ 2 * Real.exp A / p := by have htpos : 0 < p^theta := Real.rpow_pos_of_pos hp theta have hrpos : 0 < p^(1 - theta) := Real.rpow_pos_of_pos hp (1 - theta) have htbound : p^theta ≤ Real.exp A := by rw [Real.rpow_def_of_pos hp] exact Real.exp_le_exp.mpr (by simpa only [mul_comm] using hlog) have hprod : p^(1 - theta) * p^theta = p := by rw [Real.rpow_sub hp, Real.rpow_one, div_mul_cancel₀ _ htpos.ne'] have hpbound : p ≤ Real.exp A * p^(1 - theta) := by nlinarith [mul_le_mul_of_nonneg_left htbound hrpos.le] have hexp : 0 < Real.exp A := Real.exp_pos A have hr : 2 ≤ p^(1 - theta) := by nlinarith have hden : 0 < p^(1 - theta) - 1 := by linarith refine ⟨by positivity, ?_⟩ apply (div_le_div_iff₀ hden hp).mpr nlinarith /- A tilt of size `sigma / L^d` is uniformly controlled throughout an exponential window whose lower logarithmic endpoint tends to infinity. -/ theorem eventually_prime_tilt_factor_bounds {c d sigma : ℝ} (hc : 0 < c) (hd : 0 < d) (hsigma : 0 < sigma) : ∀ᶠ L : ℝ in atTop, 0 < L ∧ 0 < sigma / L^d ∧ sigma / L^d < 1 ∧ ∀ p : ℝ, Real.exp (L^c) ≤ p → p ≤ Real.exp (L^d) → 0 ≤ 1 / (p^(1 - sigma / L^d) - 1) ∧ 1 / (p^(1 - sigma / L^d) - 1) ≤ 2 * Real.exp sigma / p := by have hlower : Tendsto (fun L : ℝ => Real.exp (L^c)) atTop atTop := Real.tendsto_exp_atTop.comp (tendsto_rpow_atTop hc) filter_upwards [eventually_gt_atTop (0 : ℝ), (tendsto_rpow_atTop hd).eventually (eventually_gt_atTop sigma), hlower.eventually (eventually_ge_atTop (2 * Real.exp sigma))] with L hL hpow hlarge have hpow0 : 0 < L^d := Real.rpow_pos_of_pos hL d have htheta : 0 < sigma / L^d := div_pos hsigma hpow0 refine ⟨hL, htheta, (div_lt_one hpow0).mpr hpow, ?_⟩ intro p hlo hhi have hp : 0 < p := (Real.exp_pos _).trans_le hlo have hlogp : Real.log p ≤ L^d := by simpa only [Real.log_exp] using Real.log_le_log hp hhi have hlog : sigma / L^d * Real.log p ≤ sigma := by calc _ ≤ sigma / L^d * L^d := mul_le_mul_of_nonneg_left hlogp htheta.le _ = sigma := div_mul_cancel₀ _ hpow0.ne' exact prime_tilt_geometric_factor_bound hp hlog (hlarge.trans hlo) end section open Finset noncomputable def markedDivisorFactor (q V : ℝ) (omega t : ℕ) : ℝ := ((omega.descFactorial t : ℝ) * q^(omega - t)) / V^t noncomputable def markedDivisorWeight {G : Type*} (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (n : ℤ) : ℝ := ∏ g ∈ groups, markedDivisorFactor q (V g) (physicalOmega P g n) (t g) noncomputable def markedDivisorBound (q v : ℝ) (T : ℕ) : ℝ := max 1 (((T.factorial : ℝ) * (max 1 (1 / v))^T) / (1 - q)^(T + 1)) theorem one_le_markedDivisorBound (q v : ℝ) (T : ℕ) : 1 ≤ markedDivisorBound q v T := le_max_left _ _ theorem marked_divisor_factor_zero_of_lt (q V : ℝ) {omega t : ℕ} (h : omega < t) : markedDivisorFactor q V omega t = 0 := by simp only [markedDivisorFactor, Nat.descFactorial_of_lt h, Nat.cast_zero, zero_mul, zero_div] theorem marked_divisor_factor_nonneg {q V : ℝ} (hq : 0 ≤ q) (hV : 0 ≤ V) (omega t : ℕ) : 0 ≤ markedDivisorFactor q V omega t := by unfold markedDivisorFactor positivity theorem marked_divisor_factor_le_bound {q v V : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (hV : v ≤ V) (T omega t : ℕ) (ht : t ≤ T) : markedDivisorFactor q V omega t ≤ markedDivisorBound q v T := by by_cases hto : t ≤ omega · have he := uniform_damped_descFactorial_bound hq0 hq1 hv hV T (omega - t) t ht have hsum : omega - t + t = omega := Nat.sub_add_cancel hto rw [hsum] at he exact he.trans (le_max_right _ _) · rw [marked_divisor_factor_zero_of_lt q V (Nat.lt_of_not_ge hto)] exact zero_le_one.trans (one_le_markedDivisorBound q v T) theorem marked_divisor_weight_nonneg {G : Type*} (groups : Finset G) (P : G → Finset ℕ) {q : ℝ} (hq : 0 ≤ q) (V : G → ℝ) (t : G → ℕ) (hV : ∀ g ∈ groups, 0 ≤ V g) (n : ℤ) : 0 ≤ markedDivisorWeight groups P q V t n := by exact prod_nonneg (fun g hg => marked_divisor_factor_nonneg hq (hV g hg) _ _) /- The uniform bound is independent of n, the prime groups, and the mark counts, once every mark count is at most T and every mass is at least v. -/ theorem marked_divisor_weight_le_pow {G : Type*} (groups : Finset G) (P : G → Finset ℕ) {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (V : G → ℝ) (t : G → ℕ) (T : ℕ) (hV : ∀ g ∈ groups, v ≤ V g) (ht : ∀ g ∈ groups, t g ≤ T) (n : ℤ) : markedDivisorWeight groups P q V t n ≤ (markedDivisorBound q v T)^groups.card := by calc _ ≤ ∏ _g ∈ groups, markedDivisorBound q v T := by exact prod_le_prod₀ (fun g hg => marked_divisor_factor_nonneg hq0 (hv.le.trans (hV g hg)) _ _) (fun g hg => marked_divisor_factor_le_bound hq0 hq1 hv (hV g hg) T _ _ (ht g hg)) _ = _ := by simp /- Logarithmically many groups give the polynomial supremum bound claimed for the unweighted W_t in Section 04. -/ theorem marked_divisor_weight_le_rpow {G : Type*} (groups : Finset G) (P : G → Finset ℕ) {q v L K : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (hL : 0 < L) (V : G → ℝ) (t : G → ℕ) (T : ℕ) (hV : ∀ g ∈ groups, v ≤ V g) (ht : ∀ g ∈ groups, t g ≤ T) (hcard : (groups.card : ℝ) ≤ K * Real.log L) (n : ℤ) : markedDivisorWeight groups P q V t n ≤ L^(K * Real.log (markedDivisorBound q v T)) := by exact group_product_bound_of_log_card groups (fun g => markedDivisorFactor q (V g) (physicalOmega P g n) (t g)) (one_le_markedDivisorBound q v T) hL (fun g hg => marked_divisor_factor_nonneg hq0 (hv.le.trans (hV g hg)) _ _) (fun g hg => marked_divisor_factor_le_bound hq0 hq1 hv (hV g hg) T _ _ (ht g hg)) hcard end section open Filter theorem exponential_cutoff_tilt_identity {L : ℝ} (hL : 0 < L) (κ σ d : ℝ) : (Real.exp (κ * L)) ^ (-(σ / L^d)) = Real.exp (-(κ * σ) * L^(1-d)) := by rw [← Real.exp_mul, Real.rpow_sub hL, Real.rpow_one] congr 1 ring theorem tilted_tail_bound_to_power {L M S T K H D κ σ d : ℝ} (hL : 0 < L) (hK : 0 ≤ K) (hML : M ≤ L^D) (hS : S ≤ H * Real.log L) (hT : T ≤ M * (Real.exp (κ * L)) ^ (-(σ / L^d)) * Real.exp (K * S)) : T ≤ Real.exp (-(κ * σ) * L^(1-d)) * L^(D + K * H) := by rw [exponential_cutoff_tilt_identity hL] at hT have hm : Real.exp (K * S) ≤ L^(K * H) := by rw [Real.rpow_def_of_pos hL] apply Real.exp_le_exp.mpr nlinarith [mul_le_mul_of_nonneg_left hS hK] apply hT.trans calc M * Real.exp (-(κ * σ) * L^(1-d)) * Real.exp (K * S) ≤ L^D * Real.exp (-(κ * σ) * L^(1-d)) * L^(K * H) := by exact mul_le_mul (mul_le_mul_of_nonneg_right hML (Real.exp_pos _).le) hm (Real.exp_pos _).le (mul_nonneg (Real.rpow_pos_of_pos hL D).le (Real.exp_pos _).le) _ = Real.exp (-(κ * σ) * L^(1-d)) * L^(D + K * H) := by rw [Real.rpow_add hL] ring theorem eventually_exp_neg_rpow_mul_rpow_le {b c : ℝ} (hb : 0 < b) (hc : 0 < c) (D A : ℝ) : ∀ᶠ L : ℝ in atTop, Real.exp (-c * L^b) * L^D ≤ L^(-A) := by filter_upwards [eventually_mul_rpow_log_add_le_rpow (a := 0) hb hb hc (D + A) 0, eventually_gt_atTop (0 : ℝ)] with L h hL simp only [Real.rpow_zero, mul_one, add_zero] at h rw [Real.rpow_def_of_pos hL D, Real.rpow_def_of_pos hL (-A), ← Real.exp_add] apply Real.exp_le_exp.mpr nlinarith theorem eventually_weighted_smooth_tail_bound {c d σ : ℝ} (hc : 0 < c) (hd : 0 < d) (hσ : 0 < σ) (κ H D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (P : Finset ℕ) (W : ℕ → ℝ), (∀ p ∈ P, p.Prime) → (∀ p ∈ P, Real.exp (L^c) ≤ (p : ℝ)) → (∀ p ∈ P, (p : ℝ) ≤ Real.exp (L^d)) → (∑ p ∈ P, 1 / (p : ℝ)) ≤ H * Real.log L → (∀ n ∈ Nat.factoredNumbers P, 0 ≤ W n) → (∀ n ∈ Nat.factoredNumbers P, W n ≤ L^D) → (∑' n : Nat.factoredNumbers P, weightedSmoothTailTerm P W (Real.exp (κ * L)) n) ≤ Real.exp (-(κ * σ) * L^(1-d)) * L^(D + 2 * Real.exp σ * H) := by filter_upwards [eventually_prime_tilt_factor_bounds hc hd hσ] with L hL intro P W hP hmin hmax hmass hw0 hwM have hlocal : ∀ p ∈ P, 1 / ((p : ℝ)^(1 - σ / L^d) - 1) ≤ (2 * Real.exp σ) / (p : ℝ) := by intro p hp exact (hL.2.2.2 (p : ℝ) (hmin p hp) (hmax p hp)).2 have htail := weighted_smooth_tail_le P hP W (Real.rpow_pos_of_pos hL.1 D).le (Real.exp_pos (κ * L)) hL.2.1.le hL.2.2.1 hw0 hwM hlocal exact tilted_tail_bound_to_power hL.1 (by positivity) le_rfl hmass htail theorem eventually_exp_neg_rpow_mul_rpow_mul_exp_sqrt_le {b c K : ℝ} (hb : (1/2 : ℝ) < b) (hc : 0 < c) (hK : 0 ≤ K) (D A : ℝ) : ∀ᶠ L : ℝ in atTop, (Real.exp (-c * L^b) * L^D) * Real.exp (K * Real.sqrt L) ≤ L^(-A) := by have hb0 : 0 < b := lt_trans (by norm_num) hb have hc2 : 0 < c / 2 := by positivity filter_upwards [eventually_mul_rpow_log_add_le_rpow (a := 0) hb0 hb0 hc2 (D + A) 0, eventually_mul_rpow_log_add_le_rpow hb0 hb hc2 K 0, Real.tendsto_log_atTop.eventually (eventually_ge_atTop (1 : ℝ)), eventually_gt_atTop (0 : ℝ)] with L hpoly hsqrt hlog hL simp only [Real.rpow_zero, mul_one, add_zero] at hpoly simp only [add_zero] at hsqrt have hKsqrt : K * Real.sqrt L ≤ K * L^(1/2 : ℝ) * Real.log L := by rw [Real.sqrt_eq_rpow] exact le_mul_of_one_le_right (mul_nonneg hK (Real.rpow_nonneg hL.le _)) hlog rw [Real.rpow_def_of_pos hL D, Real.rpow_def_of_pos hL (-A), ← Real.exp_add, ← Real.exp_add] apply Real.exp_le_exp.mpr nlinarith end section open Filter Finset noncomputable def markedSmoothTail {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (mass : G → ℝ) (t : G → ℕ) (X : ℝ) : ℝ := ∑' n : Nat.factoredNumbers (groups.biUnion P), weightedSmoothTailTerm (groups.biUnion P) (fun m : ℕ => markedDivisorWeight groups P q mass t (m : ℤ)) X n /- A logarithmic group count and bounded group harmonic mass bound the harmonic mass of the full smooth-prime pool. -/ theorem marked_prime_pool_harmonic_bound {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (hdisj : (groups : Set G).PairwiseDisjoint P) {V C L : ℝ} (hV : 0 ≤ V) (hmass : ∀ g ∈ groups, (∑ p ∈ P g, 1 / (p : ℝ)) ≤ V) (hcard : (groups.card : ℝ) ≤ C * Real.log L) : (∑ p ∈ groups.biUnion P, 1 / (p : ℝ)) ≤ (C * V) * Real.log L := by calc _ ≤ (groups.card : ℝ) * V := prime_group_harmonic_bound groups P hdisj V hmass _ ≤ (C * Real.log L) * V := mul_le_mul_of_nonneg_right hcard hV _ = _ := by ring /- The actual marked weight has an exponentially small reciprocal tail. The polynomial loss depends only on the fixed group parameters. -/ theorem eventually_marked_smooth_tail_bound {q v V c d σ : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (hV : 0 ≤ V) (hc : 0 < c) (hd : 0 < d) (hσ : 0 < σ) (κ C : ℝ) (T : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type*) [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (mass : G → ℝ) (t : G → ℕ), (groups : Set G).PairwiseDisjoint P → (∀ g ∈ groups, ∀ p ∈ P g, p.Prime) → (∀ g ∈ groups, ∀ p ∈ P g, Real.exp (L^c) ≤ (p : ℝ)) → (∀ g ∈ groups, ∀ p ∈ P g, (p : ℝ) ≤ Real.exp (L^d)) → (∀ g ∈ groups, (∑ p ∈ P g, 1 / (p : ℝ)) ≤ V) → (∀ g ∈ groups, v ≤ mass g) → (∀ g ∈ groups, t g ≤ T) → (groups.card : ℝ) ≤ C * Real.log L → markedSmoothTail groups P q mass t (Real.exp (κ * L)) ≤ Real.exp (-(κ * σ) * L^(1-d)) * L^(C * Real.log (markedDivisorBound q v T) + 2 * Real.exp σ * (C * V)) := by filter_upwards [eventually_weighted_smooth_tail_bound hc hd hσ κ (C * V) (C * Real.log (markedDivisorBound q v T)), eventually_gt_atTop (0 : ℝ)] with L htail hL intro G _ groups P mass t hdisj hprime hmin hmax hmass hnorm ht hcard apply htail (groups.biUnion P) (fun m : ℕ => markedDivisorWeight groups P q mass t (m : ℤ)) · intro p hp obtain ⟨g, hg, hpg⟩ := mem_biUnion.mp hp exact hprime g hg p hpg · intro p hp obtain ⟨g, hg, hpg⟩ := mem_biUnion.mp hp exact hmin g hg p hpg · intro p hp obtain ⟨g, hg, hpg⟩ := mem_biUnion.mp hp exact hmax g hg p hpg · exact marked_prime_pool_harmonic_bound groups P hdisj hV hmass hcard · intro n _ exact marked_divisor_weight_nonneg groups P hq0 mass t (fun g hg => hv.le.trans (hnorm g hg)) (n : ℤ) · intro n _ exact marked_divisor_weight_le_rpow groups P hq0 hq1 hv hL mass t T hnorm ht hcard (n : ℤ) end section open Filter Finset noncomputable def candidateMarkedSmoothTail (s L q : ℝ) (ell : ℕ) (X : ℝ) : ℝ := markedSmoothTail (candidatePIndices s L) (candidatePBand (s * L)) q (fun j => ∑ p ∈ candidatePBand (s * L) j, 1 / (p : ℝ)) (fun _ => ell) X /- The concrete small and big P-pools have an exponentially decaying marked reciprocal tail, with only a fixed polynomial loss. -/ theorem exists_candidate_marked_smooth_tail_exp_bound {s q κ : ℝ} (hs : 0 < s) (hq0 : 0 ≤ q) (hq1 : q < 1) (ell : ℕ) : ∃ D : ℝ, ∀ᶠ L : ℝ in atTop, candidateMarkedSmoothTail s L q ell (Real.exp (κ * L)) ≤ Real.exp (-κ * L^(3/5 : ℝ)) * L^D := by obtain ⟨v, V, hv, hV, hpool⟩ := exists_candidate_P_pool_bounds hs let C : ℝ := 2 / (5 * Real.log 2) refine ⟨C * Real.log (markedDivisorBound q v ell) + 2 * Real.exp 1 * (C * V), ?_⟩ filter_upwards [hpool, eventually_marked_smooth_tail_bound (c := (1/10 : ℝ)) (d := (2/5 : ℝ)) (σ := 1) hq0 hq1 hv hV.le (by norm_num) (by norm_num) (by norm_num) κ C ell] with L hp ht rcases hp with ⟨_, _, _, hcard, hpair, hdata⟩ have hdisj : (candidatePIndices s L : Set ℕ).PairwiseDisjoint (candidatePBand (s * L)) := by intro i _ j _ hij exact hpair hij have htail := ht ℕ (candidatePIndices s L) (candidatePBand (s * L)) (fun j => ∑ p ∈ candidatePBand (s * L) j, 1 / (p : ℝ)) (fun _ => ell) hdisj (fun j hj p hp => ((hdata j hj).2.2 p hp).1) (fun j hj p hp => ((hdata j hj).2.2 p hp).2.1.le) (fun j hj p hp => ((hdata j hj).2.2 p hp).2.2) (fun j hj => (hdata j hj).2.1) (fun j hj => (hdata j hj).1) (fun _ _ => le_rfl) hcard norm_num only [mul_one, show (1 : ℝ) - 2/5 = 3/5 by norm_num] at htail exact htail /- No abstract supply hypothesis remains: the actual marked candidate tail beyond `exp (κ L)` beats every fixed power. -/ theorem eventually_candidate_marked_smooth_tail_power_saving {s q κ : ℝ} (hs : 0 < s) (hq0 : 0 ≤ q) (hq1 : q < 1) (hκ : 0 < κ) (ell : ℕ) (A : ℝ) : ∀ᶠ L : ℝ in atTop, candidateMarkedSmoothTail s L q ell (Real.exp (κ * L)) ≤ L^(-A) := by obtain ⟨D, htail⟩ := exists_candidate_marked_smooth_tail_exp_bound (κ := κ) hs hq0 hq1 ell filter_upwards [htail, eventually_exp_neg_rpow_mul_rpow_le (by norm_num : (0 : ℝ) < 3/5) hκ D A] with L ht hdecay exact ht.trans hdecay end section open Finset /- The complete prime-power part supported in the selected pool. -/ noncomputable def primePoolPart (P : Finset ℕ) (n : ℕ) : ℕ := (n.factorization.filter (fun p => p ∈ P)).prod (fun p k => p ^ k) /- The complementary part. This convention also gives `primePoolFreePart P 0 = 0`. -/ noncomputable def primePoolFreePart (P : Finset ℕ) (n : ℕ) : ℕ := n / primePoolPart P n private theorem pool_factorization_filter_le (P : Finset ℕ) (n : ℕ) : n.factorization.filter (fun p => p ∈ P) ≤ n.factorization := by intro p by_cases hp : p ∈ P <;> simp [hp] /- No primality assumption on the pool is needed: factorization already discards nonprimes. -/ theorem primePoolPart_dvd (P : Finset ℕ) (n : ℕ) : primePoolPart P n ∣ n := Nat.prod_pow_dvd_of_le_factorization (pool_factorization_filter_le P n) theorem primePoolPart_ne_zero (P : Finset ℕ) (n : ℕ) : primePoolPart P n ≠ 0 := by apply Finsupp.prod_ne_zero_iff.mpr intro p hp have hp' : p ∈ n.primeFactors := (mem_filter.mp hp).1 exact pow_ne_zero _ (Nat.prime_of_mem_primeFactors hp').ne_zero /- The manuscript decomposition holds also at zero. -/ theorem primePoolPart_mul_primePoolFreePart (P : Finset ℕ) (n : ℕ) : primePoolPart P n * primePoolFreePart P n = n := Nat.mul_div_cancel' (primePoolPart_dvd P n) theorem factorization_primePoolPart (P : Finset ℕ) (n : ℕ) : (primePoolPart P n).factorization = n.factorization.filter (fun p => p ∈ P) := Nat.factorization_prod_pow_eq_self_of_le_factorization (pool_factorization_filter_le P n) theorem factorization_primePoolFreePart (P : Finset ℕ) (n : ℕ) : (primePoolFreePart P n).factorization = n.factorization.filter (fun p => p ∉ P) := by rw [primePoolFreePart, Nat.factorization_div (primePoolPart_dvd P n), factorization_primePoolPart] ext p by_cases hp : p ∈ P <;> simp [hp] /- The extracted part is supported on the pool, including when the input is zero. -/ theorem primePoolPart_mem_factoredNumbers (P : Finset ℕ) (n : ℕ) : primePoolPart P n ∈ Nat.factoredNumbers P := by apply Nat.mem_factoredNumbers_of_primeFactors_subset (primePoolPart_ne_zero P n) intro p hp rw [← Nat.support_factorization, factorization_primePoolPart, Finsupp.support_filter] at hp exact (mem_filter.mp hp).2 /- The literal manuscript condition `n_* = 1` is exactly finite-prime support. -/ theorem mem_factoredNumbers_iff_primePoolFreePart_eq_one (P : Finset ℕ) (n : ℕ) : n ∈ Nat.factoredNumbers P ↔ primePoolFreePart P n = 1 := by constructor · intro hn have hn0 := Nat.ne_zero_of_mem_factoredNumbers hn have hsupport := Nat.primeFactors_subset_of_mem_factoredNumbers hn have hf : n.factorization.filter (fun p => p ∈ P) = n.factorization := by apply (Finsupp.filter_eq_self_iff _ _).mpr intro p hp exact hsupport (Finsupp.mem_support_iff.mpr hp) have heq : primePoolPart P n = n := by rw [primePoolPart, hf, Nat.prod_factorization_pow_eq_self hn0] rw [primePoolFreePart, heq, Nat.div_self (Nat.pos_of_ne_zero hn0)] · intro hn have heq := primePoolPart_mul_primePoolFreePart P n rw [hn, mul_one] at heq exact heq ▸ primePoolPart_mem_factoredNumbers P n theorem primePoolFreePart_ne_zero (P : Finset ℕ) {n : ℕ} (hn : n ≠ 0) : primePoolFreePart P n ≠ 0 := by intro h have heq := primePoolPart_mul_primePoolFreePart P n rw [h, mul_zero] at heq exact hn heq.symm /- The complement contains no prime from the selected pool. -/ theorem primePoolFreePart_primeFactors_disjoint (P : Finset ℕ) (n : ℕ) : Disjoint (primePoolFreePart P n).primeFactors P := by apply disjoint_left.mpr intro p hp hpP rw [← Nat.support_factorization, factorization_primePoolFreePart, Finsupp.support_filter] at hp exact (mem_filter.mp hp).2 hpP /- An explicit prime-power product for the extracted part. -/ theorem primePoolPart_eq_prod (P : Finset ℕ) (n : ℕ) : primePoolPart P n = ∏ p ∈ P, p ^ n.factorization p := by unfold primePoolPart rw [Finsupp.prod_of_support_subset _ (s := P) (by intro p hp exact (mem_filter.mp hp).2) _ (by intros; simp)] apply prod_congr rfl intro p hp simp [hp] end section open Finset /- An atomic actual phase transition, selected from a visit or an edge. -/ noncomputable def ghostPhaseMixedStep {R : Type*} [Fintype R] [DecidableEq R] (isVisit atgt asrc : Bool) (htgt hsrc : R) (η β : ℝ) (z w : GhostPhaseState R) : ℝ := if isVisit then ghostPhaseVisit atgt htgt η β z w else ghostPhaseEdge atgt asrc htgt hsrc β z w end section open Finset def finiteChronologicalPrefix {X 𝕜 : Type*} [CommMonoid 𝕜] (K : ℕ → X → X → 𝕜) (f : X → 𝕜) (n : ℕ) (x : Fin (n + 1) → X) : 𝕜 := f (x 0) * ∏ j : Fin n, K j.val (x j.succ) (x j.castSucc) theorem finite_chronological_prefix_snoc {X 𝕜 : Type*} [CommMonoid 𝕜] (K : ℕ → X → X → 𝕜) (f : X → 𝕜) (n : ℕ) (x : Fin (n + 1) → X) (z : X) : finiteChronologicalPrefix K f (n + 1) (Fin.snoc x z) = K n z (x (Fin.last n)) * finiteChronologicalPrefix K f n x := by unfold finiteChronologicalPrefix rw [Fin.prod_univ_castSucc] simp only [Fin.val_castSucc, Fin.succ_castSucc, Fin.snoc_castSucc, Fin.val_last, Fin.succ_last, Fin.snoc_last] have hzero : (Fin.snoc (α := fun _ : Fin (n + 2) => X) x z) 0 = x 0 := by exact Fin.snoc_castSucc (α := fun _ : Fin (n + 2) => X) z x 0 rw [hzero] ac_rfl /- Sum over all chronological states, with both boundary tests, is exactly the finite matrix pairing. Every intermediate cut is retained explicitly. -/ theorem finite_chronological_trace_expansion {X 𝕜 : Type*} [Fintype X] [CommSemiring 𝕜] (K : ℕ → X → X → 𝕜) (f q : X → 𝕜) (n : ℕ) : (∑ x : Fin (n + 1) → X, q (x (Fin.last n)) * finiteChronologicalPrefix K f n x) = ∑ z, q z * finitePathAction K f n z := by classical induction n generalizing q with | zero => rw [← (Fin.snocEquiv (fun _ : Fin 1 => X)).sum_comp] simp [finiteChronologicalPrefix, finitePathAction, Fin.snocEquiv, Fin.snoc_zero, Fintype.sum_prod_type] | succ n ih => rw [← (Fin.snocEquiv (fun _ : Fin (n + 2) => X)).sum_comp] simp only [Fintype.sum_prod_type, Fin.snocEquiv, Equiv.coe_fn_mk, Fin.snoc_last, finite_chronological_prefix_snoc] simp_rw [← mul_assoc, mul_assoc (q _) (K n _ _) _, ← mul_sum, ih] rfl /- Interleave visits G_0,G_1,... and edges E_0,E_1,... in chronological order. -/ noncomputable def finiteAlternatingKernel {X 𝕜 : Type*} (G E : ℕ → X → X → 𝕜) (j : ℕ) : X → X → 𝕜 := if j % 2 = 0 then G (j / 2) else E (j / 2) theorem finite_alternating_kernel_even {X 𝕜 : Type*} (G E : ℕ → X → X → 𝕜) (j : ℕ) : finiteAlternatingKernel G E (2 * j) = G j := by simp [finiteAlternatingKernel] theorem finite_alternating_kernel_odd {X 𝕜 : Type*} (G E : ℕ → X → X → 𝕜) (j : ℕ) : finiteAlternatingKernel G E (2 * j + 1) = E j := by simp [finiteAlternatingKernel, Nat.add_div] theorem finite_alternating_action {X 𝕜 : Type*} [Fintype X] [CommSemiring 𝕜] (G E : ℕ → X → X → 𝕜) (f : X → 𝕜) (n : ℕ) (x : X) : finitePathAction (finiteAlternatingKernel G E) f (2 * n + 1) x = finitePathAction (fun j x y => ∑ z, G (j + 1) x z * E j z y) (fun x => ∑ y, G 0 x y * f y) n x := by induction n generalizing x with | zero => simp [finitePathAction, finiteAlternatingKernel] | succ n ih => have hstep (y : X) : finitePathAction (finiteAlternatingKernel G E) f (2 * n + 1 + 1) y = ∑ z, E n y z * finitePathAction (fun j x y => ∑ z, G (j + 1) x z * E j z y) (fun x => ∑ y, G 0 x y * f y) n z := by rw [finitePathAction, finite_alternating_kernel_odd] simp only [ih] have hn : 2 * (n + 1) + 1 = (2 * n + 1) + 1 + 1 := by omega rw [hn, finitePathAction] have he : 2 * n + 1 + 1 = 2 * (n + 1) := by omega rw [show finiteAlternatingKernel G E (2 * n + 1 + 1) = G (n + 1) by rw [he, finite_alternating_kernel_even]] simp_rw [hstep] rw [finitePathAction] simp only [sum_mul, mul_sum, mul_assoc] rw [sum_comm] end section open Finset /- Complete finite trace weight, with all transitions indexed directly by `Fin n`. -/ noncomputable def ghostPhaseFiniteTraceWeight {R : Type*} [Fintype R] [DecidableEq R] (isVisit atgt asrc : ℕ → Bool) (htgt hsrc : ℕ → R) (η β : ℕ → ℝ) (a0 : Bool) (β0 : ℝ) (an : Bool) {n : ℕ} (x : Fin (n + 1) → GhostPhaseState R) : ℝ := ghostPhaseInitial a0 β0 (x 0) * (∏ j : Fin n, ghostPhaseMixedStep (isVisit j) (atgt j) (asrc j) (htgt j) (hsrc j) (η j) (β j) (x j.succ) (x j.castSucc)) * ghostPhaseTerminal an (x (Fin.last n)) end section open Finset end section open Finset end section open Finset /- A Boolean endpoint decision is its finite set of selected coordinates. -/ noncomputable def ghostChoiceFinsetEquiv {I : Type*} [Fintype I] [DecidableEq I] : (I → Bool) ≃ Finset I where toFun c := univ.filter (fun i => c i = true) invFun S i := decide (i ∈ S) left_inv c := by funext i; simp right_inv S := by ext i; simp /- Reindex endpoint decisions as subsets, retaining zero-weight valid choices. -/ theorem ghost_choice_sum_subsets {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (y u : (i : I) → X i) (r w : I → ℝ) (Q : Finset I) (hw : ∀ i, i ∉ Q → w i = 0) (F : ((i : I) → X i) → ℝ) : (∑ c : I → Bool, (∏ i, if c i then w i else r i) * F (fun i => if c i then u i else y i)) = ∑ S ∈ Q.powerset, (∏ i, if i ∈ S then w i else r i) * F (fun i => if i ∈ S then u i else y i) := by classical have he := ghostChoiceFinsetEquiv.symm.sum_comp (fun c : I → Bool => (∏ i, if c i then w i else r i) * F (fun i => if c i then u i else y i)) have hall : (∑ c : I → Bool, (∏ i, if c i then w i else r i) * F (fun i => if c i then u i else y i)) = ∑ S : Finset I, (∏ i, if i ∈ S then w i else r i) * F (fun i => if i ∈ S then u i else y i) := by simpa only [ghostChoiceFinsetEquiv, Equiv.symm_mk, Equiv.coe_fn_mk, decide_eq_true_eq] using he.symm rw [hall] symm apply sum_subset (subset_univ _) intro S hS hnot have hnot' : ¬ S ⊆ Q := by simpa only [mem_powerset] using hnot obtain ⟨i, hi, hiQ⟩ := not_subset.mp hnot' have hp : (∏ j, if j ∈ S then w j else r j) = 0 := by apply prod_eq_zero (mem_univ i) simp only [if_pos hi, hw i hiQ] rw [hp, zero_mul] /- Subsets of two disjoint eligible event sets are exactly independent subsets of each set. -/ theorem ghost_sum_powerset_disjoint_union {I : Type*} [DecidableEq I] (D U : Finset I) (hDU : Disjoint D U) (F : Finset I → ℝ) : (∑ S ∈ (D ∪ U).powerset, F S) = ∑ A ∈ D.powerset, ∑ B ∈ U.powerset, F (A ∪ B) := by classical rw [← sum_product D.powerset U.powerset (fun p => F (p.1 ∪ p.2))] symm apply sum_bij (fun p _ => p.1 ∪ p.2) · intro p hp simp only [mem_product, mem_powerset] at hp ⊢ exact union_subset (hp.1.trans subset_union_left) (hp.2.trans subset_union_right) · intro p hp q hq hpq simp only [mem_product, mem_powerset] at hp hq have hdis := disjoint_left.mp hDU apply Prod.ext <;> ext i · have hu : i ∈ p.1 ∪ p.2 ↔ i ∈ q.1 ∪ q.2 := by rw [hpq] simp only [mem_union] at hu constructor · intro hip rcases hu.mp (Or.inl hip) with hiq | hiq · exact hiq · exact (hdis (hp.1 hip) (hq.2 hiq)).elim · intro hiq rcases hu.mpr (Or.inl hiq) with hip | hip · exact hip · exact (hdis (hq.1 hiq) (hp.2 hip)).elim · have hu : i ∈ p.1 ∪ p.2 ↔ i ∈ q.1 ∪ q.2 := by rw [hpq] simp only [mem_union] at hu constructor · intro hip rcases hu.mp (Or.inr hip) with hiq | hiq · exact (hdis (hq.1 hiq) (hp.2 hip)).elim · exact hiq · intro hiq rcases hu.mpr (Or.inr hiq) with hip | hip · exact (hdis (hp.1 hip) (hq.2 hiq)).elim · exact hip · intro S hS have hsub := mem_powerset.mp hS refine ⟨(S ∩ D, S ∩ U), ?_, ?_⟩ · simp only [mem_product, mem_powerset] exact ⟨inter_subset_right, inter_subset_right⟩ · ext i have hs : i ∈ S → i ∈ D ∨ i ∈ U := fun hi => mem_union.mp (hsub hi) simp only [mem_union, mem_inter] aesop · intro p hp rfl /- Inactive pending coordinates eligible to terminate at the current hit. -/ noncomputable def ghostVisitDeaths {I : Type*} [Fintype I] {R : I → Type*} [∀ i, DecidableEq (R i)] (a : I → Bool) (h : (i : I) → R i) (y : (i : I) → GhostPhaseState (R i)) : Finset I := by classical exact univ.filter (fun i => a i = false ∧ y i = some (some (some (h i)))) /- Inactive unborn coordinates eligible to begin a new ghost lifespan. -/ noncomputable def ghostVisitBirths {I : Type*} [Fintype I] {R : I → Type*} (a : I → Bool) (y : (i : I) → GhostPhaseState (R i)) : Finset I := by classical exact univ.filter (fun i => a i = false ∧ y i = some none) theorem ghost_visit_eligible_disjoint {I : Type*} [Fintype I] {R : I → Type*} [∀ i, DecidableEq (R i)] (a : I → Bool) (h : (i : I) → R i) (y : (i : I) → GhostPhaseState (R i)) : Disjoint (ghostVisitDeaths a h y) (ghostVisitBirths a y) := by classical apply disjoint_left.mpr intro i hiD hiU simp only [ghostVisitDeaths, ghostVisitBirths, mem_filter, mem_univ, true_and] at hiD hiU rw [hiD.2] at hiU simp at hiU theorem ghost_visit_endpoint_zero_outside {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, DecidableEq (R i)] (a : I → Bool) (h : (i : I) → R i) (η β ρ : I → ℝ) (y : (i : I) → GhostPhaseState (R i)) (i : I) (hi : i ∉ ghostVisitDeaths a h y ∪ ghostVisitBirths a y) : ghostPhaseEndpointWeight (a i) (h i) (η i) (β i) (ρ i) (y i) = 0 := by by_contra hn obtain ⟨ha, hy⟩ := ghost_phase_endpoint_weight_support (a i) (h i) (η i) (β i) (ρ i) (y i) hn apply hi simp only [ghostVisitDeaths, ghostVisitBirths, mem_union, mem_filter, mem_univ, true_and] rcases hy with hy | hy · exact Or.inr ⟨ha, hy⟩ · exact Or.inl ⟨ha, hy⟩ /- Apply the selected terminations and births to the original input state. The valid event sets are disjoint, so a newly born particle cannot terminate. -/ noncomputable def ghostVisitBatchOutput {I : Type*} [DecidableEq I] {R : I → Type*} (h : (i : I) → R i) (y : (i : I) → GhostPhaseState (R i)) (A B : Finset I) : (i : I) → GhostPhaseState (R i) := fun i => if i ∈ A then some (some none) else if i ∈ B then some (some (some (h i))) else y i /- On a valid phase state, only an inactive pending hit has nontrivial retention weight. -/ theorem ghost_phase_retain_valid {R : Type*} [DecidableEq R] (a : Bool) (h : R) (η ρ : ℝ) (y : GhostPhaseState R) (hy : y.isSome = !a) : ghostPhaseRetain a h η ρ y = if a = false ∧ y = some (some (some h)) then (1 - η) / ρ ^ 2 else 1 := by cases a <;> rcases y with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseRetain, ghostPhaseDampedVisit, ghostPhaseVisit, ghostFiniteKernel, ghostPhaseDiagonal, pow_two] split_ifs <;> simp_all theorem ghost_visit_retain_eq {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, DecidableEq (R i)] (a : I → Bool) (h : (i : I) → R i) (η ρ : I → ℝ) (y : (i : I) → GhostPhaseState (R i)) (hy : ghostPhaseMask a y) (i : I) : ghostPhaseRetain (a i) (h i) (η i) (ρ i) (y i) = if i ∈ ghostVisitDeaths a h y then (1 - η i) / (ρ i) ^ 2 else 1 := by simpa only [ghostVisitDeaths, mem_filter, mem_univ, true_and] using ghost_phase_retain_valid (a i) (h i) (η i) (ρ i) (y i) (hy i) /- The simultaneous endpoint choices agree with the explicit death/birth update. -/ theorem ghost_visit_batch_output_eq {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, DecidableEq (R i)] (a : I → Bool) (h : (i : I) → R i) (y : (i : I) → GhostPhaseState (R i)) (A B : Finset I) (hA : A ⊆ ghostVisitDeaths a h y) (hB : B ⊆ ghostVisitBirths a y) : (fun i => if i ∈ A ∪ B then ghostPhaseEndpoint (h i) (y i) else y i) = ghostVisitBatchOutput h y A B := by funext i by_cases hiA : i ∈ A · have hi := hA hiA simp only [ghostVisitDeaths, mem_filter, mem_univ, true_and] at hi simp [ghostVisitBatchOutput, hiA, hi.2, ghostPhaseEndpoint] · by_cases hiB : i ∈ B · have hi := hB hiB simp only [ghostVisitBirths, mem_filter, mem_univ, true_and] at hi simp [ghostVisitBatchOutput, hiA, hiB, hi.2, ghostPhaseEndpoint] · simp [ghostVisitBatchOutput, hiA, hiB] /- Each terminated particle, surviving hit, and newly born particle pays its coefficient once. There is no ambient-memory factorial in this weight. -/ noncomputable def ghostVisitBatchWeight {I : Type*} [DecidableEq I] (D A B : Finset I) (η β ρ : I → ℝ) : ℝ := (∏ i ∈ A, -η i / ρ i) * (∏ i ∈ D \ A, (1 - η i) / (ρ i) ^ 2) * ∏ i ∈ B, -β i * η i / ρ i theorem ghost_visit_batch_weight_eq {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, DecidableEq (R i)] (a : I → Bool) (h : (i : I) → R i) (η β ρ : I → ℝ) (y : (i : I) → GhostPhaseState (R i)) (hy : ghostPhaseMask a y) (A B : Finset I) (hA : A ⊆ ghostVisitDeaths a h y) (hB : B ⊆ ghostVisitBirths a y) : (∏ i, if i ∈ A ∪ B then ghostPhaseEndpointWeight (a i) (h i) (η i) (β i) (ρ i) (y i) else ghostPhaseRetain (a i) (h i) (η i) (ρ i) (y i)) = ghostVisitBatchWeight (ghostVisitDeaths a h y) A B η β ρ := by classical have hdis := disjoint_left.mp (ghost_visit_eligible_disjoint a h y) have hp (i : I) : (if i ∈ A ∪ B then ghostPhaseEndpointWeight (a i) (h i) (η i) (β i) (ρ i) (y i) else ghostPhaseRetain (a i) (h i) (η i) (ρ i) (y i)) = (if i ∈ A then -η i / ρ i else 1) * (if i ∈ ghostVisitDeaths a h y \ A then (1 - η i) / (ρ i) ^ 2 else 1) * (if i ∈ B then -β i * η i / ρ i else 1) := by by_cases hiA : i ∈ A · have hiD := hA hiA have hiB : i ∉ B := fun hi => hdis hiD (hB hi) have hi := hiD simp only [ghostVisitDeaths, mem_filter, mem_univ, true_and] at hi simp [hiA, hiB, hi.1, hi.2, ghostPhaseEndpointWeight] · by_cases hiB : i ∈ B · have hiU := hB hiB have hiD : i ∉ ghostVisitDeaths a h y := fun hi => hdis hi hiU have hi := hiU simp only [ghostVisitBirths, mem_filter, mem_univ, true_and] at hi simp [hiA, hiB, hiD, hi.1, hi.2, ghostPhaseEndpointWeight] · simp [hiA, hiB, ghost_visit_retain_eq a h η ρ y hy i] simp_rw [hp] simp only [prod_mul_distrib, Fintype.prod_ite_mem, ghostVisitBatchWeight] /- Exact chronological transition expansion into eligible termination and birth subsets. Even when their coefficients vanish, the valid choices remain in the indexing sets. The test can couple every output coordinate. -/ theorem ghost_phase_transition_batches {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (a : I → Bool) (h : (i : I) → R i) (η β ρ : I → ℝ) (y : (i : I) → GhostPhaseState (R i)) (hy : ghostPhaseMask a y) (F : ((i : I) → GhostPhaseState (R i)) → ℝ) : (∑ x, (∏ i, ghostPhaseDampedVisit (a i) (h i) (η i) (β i) (ρ i) (x i) (y i)) * F x) = ∑ A ∈ (ghostVisitDeaths a h y).powerset, ∑ B ∈ (ghostVisitBirths a y).powerset, ghostVisitBatchWeight (ghostVisitDeaths a h y) A B η β ρ * F (ghostVisitBatchOutput h y A B) := by classical rw [ghost_phase_tensor_visit_choices] rw [ghost_choice_sum_subsets y (fun i => ghostPhaseEndpoint (h i) (y i)) (fun i => ghostPhaseRetain (a i) (h i) (η i) (ρ i) (y i)) (fun i => ghostPhaseEndpointWeight (a i) (h i) (η i) (β i) (ρ i) (y i)) (ghostVisitDeaths a h y ∪ ghostVisitBirths a y) (ghost_visit_endpoint_zero_outside a h η β ρ y) F] rw [ghost_sum_powerset_disjoint_union _ _ (ghost_visit_eligible_disjoint a h y)] apply sum_congr rfl intro A hA apply sum_congr rfl intro B hB rw [ghost_visit_batch_weight_eq a h η β ρ y hy A B (mem_powerset.mp hA) (mem_powerset.mp hB), ghost_visit_batch_output_eq a h y A B (mem_powerset.mp hA) (mem_powerset.mp hB)] end section open Finset /- The deterministic outcome, or the drop outcome when leaving an active phase. -/ def ghostPhaseEdgeBaseTarget {R : Type*} (atgt asrc : Bool) (w : GhostPhaseState R) : GhostPhaseState R := match atgt, asrc with | true, _ => none | false, true => some (some none) | false, false => w /- The alternative outcome stores the outgoing active lifespan at its source hit. -/ def ghostPhaseEdgeStoreTarget {R : Type*} (hsrc : R) : GhostPhaseState R := some (some (some hsrc)) /- Primary edge coefficient: shared active compatibility, drop, promotion, or deterministic retention, with every applicable rho factor. -/ noncomputable def ghostPhaseEdgeBaseWeight {R : Type*} [DecidableEq R] (atgt asrc : Bool) (htgt hsrc : R) (β ρtgt ρsrc : ℝ) (w : GhostPhaseState R) : ℝ := match atgt, asrc, w with | true, true, none => if hsrc = htgt then 1 else 0 | false, true, none => 1 | true, false, some c => ghostActiveInput htgt β c * ghostPhaseDiagonal hsrc ρsrc (some c) | false, false, some c => ghostPhaseDiagonal htgt ρtgt (some c) * ghostPhaseDiagonal hsrc ρsrc (some c) | _, _, _ => 0 /- Storage is possible only from a supported active input to an inactive target. -/ noncomputable def ghostPhaseEdgeStoreWeight {R : Type*} [DecidableEq R] (atgt asrc : Bool) (htgt hsrc : R) (ρtgt : ℝ) (w : GhostPhaseState R) : ℝ := match atgt, asrc, w with | false, true, none => if hsrc = htgt then ρtgt else 1 | _, _, _ => 0 /- The damped edge has exactly the primary and storage outcomes. Unsupported input phases contribute zero to both coefficients. -/ theorem ghost_phase_damped_edge_sparse {R : Type*} [Fintype R] [DecidableEq R] (atgt asrc : Bool) (htgt hsrc : R) (β ρtgt ρsrc : ℝ) (z w : GhostPhaseState R) : ghostPhaseDampedEdge atgt asrc htgt hsrc β ρtgt ρsrc z w = ghostPhaseEdgeBaseWeight atgt asrc htgt hsrc β ρtgt ρsrc w * (if z = ghostPhaseEdgeBaseTarget atgt asrc w then 1 else 0) + ghostPhaseEdgeStoreWeight atgt asrc htgt hsrc ρtgt w * (if z = ghostPhaseEdgeStoreTarget hsrc then 1 else 0) := by cases atgt <;> cases asrc <;> rcases z with _ | (_ | (_ | r)) <;> rcases w with _ | (_ | (_ | s)) <;> simp [ghostPhaseDampedEdge, ghostPhaseEdge, ghostPhaseGather, ghostPhaseScatter, ghostActiveInput, ghostActiveOutput, ghostPhaseDiagonal, ghostPhaseEdgeBaseWeight, ghostPhaseEdgeStoreWeight, ghostPhaseEdgeBaseTarget, ghostPhaseEdgeStoreTarget] all_goals split <;> simp_all /- A storage coefficient can be nonzero only at an actual active-to-inactive edge. -/ theorem ghost_phase_edge_store_supported {R : Type*} [DecidableEq R] (atgt asrc : Bool) (htgt hsrc : R) (ρtgt : ℝ) (w : GhostPhaseState R) (hn : ghostPhaseEdgeStoreWeight atgt asrc htgt hsrc ρtgt w ≠ 0) : atgt = false ∧ asrc = true ∧ w = none := by cases atgt <;> cases asrc <;> cases w <;> simp_all [ghostPhaseEdgeStoreWeight] /- For fixed physical labels and fixed input memory, the full tensor edge acts by a sum over storage choices. The test function may couple all prime coordinates. -/ theorem ghost_phase_tensor_edge_action_expansion {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (htgt hsrc : (i : I) → R i) (β ρtgt ρsrc : I → ℝ) (w : (i : I) → GhostPhaseState (R i)) (F : ((i : I) → GhostPhaseState (R i)) → ℝ) : (∑ z : (i : I) → GhostPhaseState (R i), (∏ i, ghostPhaseDampedEdge (atgt i) (asrc i) (htgt i) (hsrc i) (β i) (ρtgt i) (ρsrc i) (z i) (w i)) * F z) = ∑ c : I → Bool, (∏ i, if c i then ghostPhaseEdgeStoreWeight (atgt i) (asrc i) (htgt i) (hsrc i) (ρtgt i) (w i) else ghostPhaseEdgeBaseWeight (atgt i) (asrc i) (htgt i) (hsrc i) (β i) (ρtgt i) (ρsrc i) (w i)) * F (fun i => if c i then ghostPhaseEdgeStoreTarget (hsrc i) else ghostPhaseEdgeBaseTarget (atgt i) (asrc i) (w i)) := by simp_rw [ghost_phase_damped_edge_sparse] exact finite_binary_kernel_expansion (fun i => ghostPhaseEdgeBaseTarget (atgt i) (asrc i) (w i)) (fun i => ghostPhaseEdgeStoreTarget (hsrc i)) (fun i => ghostPhaseEdgeBaseWeight (atgt i) (asrc i) (htgt i) (hsrc i) (β i) (ρtgt i) (ρsrc i) (w i)) (fun i => ghostPhaseEdgeStoreWeight (atgt i) (asrc i) (htgt i) (hsrc i) (ρtgt i) (w i)) F end section open Finset /- Choose the old index of each required target label. Distinct target labels make this map injective even before uniqueness of the old labels is used. -/ noncomputable def distinctPromotionEmbedding {S J P : Type*} (f : J → P) (t : S → P) (ht : Function.Injective t) (hin : ∀ s, ∃ j, f j = t s) : S ↪ J where toFun s := Classical.choose (hin s) inj' := by intro s r hsr apply ht exact (Classical.choose_spec (hin s)).symm.trans ((congrArg f hsr).trans (Classical.choose_spec (hin r))) theorem distinct_promotion_embedding_spec {S J P : Type*} (f : J → P) (t : S → P) (ht : Function.Injective t) (hin : ∀ s, ∃ j, f j = t s) (s : S) : f (distinctPromotionEmbedding f t ht hin s) = t s := Classical.choose_spec (hin s) /- Distinct old labels force every matching injection to be the chosen one. -/ theorem distinct_promotion_embedding_unique {S J P : Type*} (f : J → P) (t : S → P) (hf : Function.Injective f) (ht : Function.Injective t) (hin : ∀ s, ∃ j, f j = t s) (e : S ↪ J) (he : ∀ s, f (e s) = t s) : e = distinctPromotionEmbedding f t ht hin := by ext s exact hf ((he s).trans (distinct_promotion_embedding_spec f t ht hin s).symm) /- All injections of the selected ordered slots whose labels match. -/ noncomputable def matchingPromotionEmbeddings {S J P : Type*} [Fintype S] [Fintype J] (f : J → P) (t : S → P) : Finset (S ↪ J) := by classical exact univ.filter (fun e => ∀ s, f (e s) = t s) theorem matching_promotion_embeddings_eq_singleton {S J P : Type*} [Fintype S] [Fintype J] (f : J → P) (t : S → P) (hf : Function.Injective f) (ht : Function.Injective t) (hin : ∀ s, ∃ j, f j = t s) : matchingPromotionEmbeddings f t = {distinctPromotionEmbedding f t ht hin} := by classical ext e simp only [matchingPromotionEmbeddings, mem_filter, mem_univ, true_and, mem_singleton] constructor · exact distinct_promotion_embedding_unique f t hf ht hin e · intro he rw [he] exact distinct_promotion_embedding_spec f t ht hin end section open Finset Classical noncomputable def birthForestAffectedOperations {n : ℕ} {Op : Type*} (code : BirthForestCode n) (operation : Fin n → Op) : Finset Op := (birthForestTouched code).image operation theorem birthForestAffectedOperations_card_le {n : ℕ} {Op : Type*} (code : BirthForestCode n) (operation : Fin n → Op) : (birthForestAffectedOperations code operation).card ≤ 2 * birthForestRank code := card_image_le.trans (birthForestTouched_card_le code) /- The full multiplier local to an operation includes both the performed birth tests and the Fourier phases. -/ noncomputable def birthForestOperationMultiplier {n : ℕ} {Op : Type*} (code : BirthForestCode n) (operation : Fin n → Op) (θ : (Fin n × Fin n) → ℝ) (performed : Fin n → Prop) (f : Fin n → ℤ) (o : Op) : ℂ := ∏ j ∈ univ.filter (fun j => operation j = o), if j ∈ birthForestTouched code → performed j then physicalReturnPhase (birthForestLocalFrequency code θ j) (f j) else 0 section variable {n : ℕ} {Op : Type*} (code : BirthForestCode n) (operation : Fin n → Op) (θ : (Fin n × Fin n) → ℝ) (performed : Fin n → Prop) (f : Fin n → ℤ) (o : Op) include n Op code operation θ performed f o theorem birthForestOperationMultiplier_norm_le_one : ‖birthForestOperationMultiplier code operation θ performed f o‖ ≤ 1 := by unfold birthForestOperationMultiplier rw [norm_prod] apply prod_le_one₀ (fun j _ => norm_nonneg _) intro j _ split_ifs · rw [physicalReturnPhase_norm] · simp /- An operation with no touched birth is exactly unchanged. -/ theorem birthForestOperationMultiplier_eq_one (ho : o ∉ birthForestAffectedOperations code operation) : birthForestOperationMultiplier code operation θ performed f o = 1 := by apply prod_eq_one intro j hj have heq : operation j = o := (mem_filter.mp hj).2 have hjnot : j ∉ birthForestTouched code := by intro h exact ho (mem_image.mpr ⟨j, h, heq⟩) rw [if_pos (fun h => False.elim (hjnot h))] exact birth_forest_phase_eq_one_of_not_touched code θ f j hjnot end /- Grouping by operation preserves the exact full performed-and-phase multiplier on a path. This identity does not assert operator contractivity. -/ theorem birthForestOperationMultiplier_product {n : ℕ} {Op : Type*} [Fintype Op] (code : BirthForestCode n) (operation : Fin n → Op) (θ : (Fin n × Fin n) → ℝ) (performed : Fin n → Prop) (f : Fin n → ℤ) : (∏ o : Op, birthForestOperationMultiplier code operation θ performed f o) = if ∀ j ∈ birthForestTouched code, performed j then ∏ j : Fin n, physicalReturnPhase (birthForestLocalFrequency code θ j) (f j) else 0 := by classical unfold birthForestOperationMultiplier rw [prod_fiberwise univ operation (fun j => if j ∈ birthForestTouched code → performed j then physicalReturnPhase (birthForestLocalFrequency code θ j) (f j) else 0)] rw [Fintype.prod_ite_zero] split_ifs <;> rfl /- Performed constraints at all edge endpoints are exactly the performed constraints at the union of touched birth addresses. -/ theorem birthForestTouched_performed_iff {n : ℕ} (code : BirthForestCode n) (performed : Fin n → Prop) : (∀ j ∈ birthForestTouched code, performed j) ↔ ∀ e ∈ birthForestEdges code, performed e.1 ∧ performed e.2 := by constructor · intro h e he exact ⟨h e.1 (mem_union.mpr (Or.inl (mem_image.mpr ⟨e, he, rfl⟩))), h e.2 (mem_union.mpr (Or.inr (mem_image.mpr ⟨e, he, rfl⟩)))⟩ · intro h j hj rcases mem_union.mp hj with hj | hj · obtain ⟨e, he, rfl⟩ := mem_image.mp hj exact (h e he).1 · obtain ⟨e, he, rfl⟩ := mem_image.mp hj exact (h e he).2 end section open Finset Classical end section open Finset Classical /- The exact scalar cost of using A on a finite set of bad edges and q elsewhere, written as the baseline q^N times the relative loss per bad edge. -/ theorem edge_scalar_product_eq {N : ℕ} (bad : Finset (Fin N)) {q A : ℝ} (hq : q ≠ 0) : (∏ j : Fin N, if j ∈ bad then A else q) = q ^ N * (A / q) ^ bad.card := by have hp (j : Fin N) : (if j ∈ bad then A else q) = q * (if j ∈ bad then A / q else 1) := by split_ifs <;> field_simp simp_rw [hp] rw [prod_mul_distrib, prod_ite] simp [div_pow] /- Deduplicated affected edge indices. `none` allows initial or ghost births to have no edge index, and several birth addresses may map to one edge. -/ noncomputable def birthForestAffectedEdges {n N : ℕ} (code : BirthForestCode n) (edgeOf : Fin n → Option (Fin N)) : Finset (Fin N) := (birthForestTouched code).biUnion (fun j => (edgeOf j).toFinset) theorem mem_birthForestAffectedEdges {n N : ℕ} (code : BirthForestCode n) (edgeOf : Fin n → Option (Fin N)) (e : Fin N) : e ∈ birthForestAffectedEdges code edgeOf ↔ ∃ j ∈ birthForestTouched code, edgeOf j = some e := by simp [birthForestAffectedEdges, Option.mem_toFinset] end section open Finset Classical MeasureTheory noncomputable def birthFourierIntervalMeasure : Measure ℝ := volume.restrict (Set.Ioc (0 : ℝ) 1) theorem birthFourierIntervalMeasure_probability : IsProbabilityMeasure birthFourierIntervalMeasure := by constructor simp [birthFourierIntervalMeasure] noncomputable def birthFourierCubeMeasure (ι : Type*) [Fintype ι] : Measure (ι → ℝ) := Measure.pi (fun _ : ι => birthFourierIntervalMeasure) theorem birthFourierCubeMeasure_probability (ι : Type*) [Fintype ι] : IsProbabilityMeasure (birthFourierCubeMeasure ι) := by let _ : IsProbabilityMeasure birthFourierIntervalMeasure := birthFourierIntervalMeasure_probability unfold birthFourierCubeMeasure infer_instance theorem birth_fourier_interval_phase_integrable (h : ℤ) : Integrable (fun t => physicalReturnPhase t h) birthFourierIntervalMeasure := by exact (intervalIntegrable_iff_integrableOn_Ioc_of_le (by norm_num : (0 : ℝ) ≤ 1)).mp (physicalReturnPhase_intervalIntegrable h 0 1) theorem birth_fourier_interval_phase_integral (h : ℤ) : (∫ t, physicalReturnPhase t h ∂birthFourierIntervalMeasure) = if h = 0 then 1 else 0 := by change (∫ t in Set.Ioc (0 : ℝ) 1, physicalReturnPhase t h) = _ rw [← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), physicalReturnPhase_integral] theorem birth_fourier_cube_phase_integrable {ι : Type*} [Fintype ι] (h : ι → ℤ) : Integrable (fun θ : ι → ℝ => ∏ i, physicalReturnPhase (θ i) (h i)) (birthFourierCubeMeasure ι) := by let _ : IsProbabilityMeasure birthFourierIntervalMeasure := birthFourierIntervalMeasure_probability exact Integrable.fintype_prod (fun i => birth_fourier_interval_phase_integrable (h i)) theorem birth_fourier_cube_phase_integral {ι : Type*} [Fintype ι] (h : ι → ℤ) : (∫ θ : ι → ℝ, ∏ i, physicalReturnPhase (θ i) (h i) ∂birthFourierCubeMeasure ι) = if ∀ i, h i = 0 then 1 else 0 := by let _ : IsProbabilityMeasure birthFourierIntervalMeasure := birthFourierIntervalMeasure_probability unfold birthFourierCubeMeasure rw [integral_fintype_prod_eq_prod (fun (i : ι) (t : ℝ) => physicalReturnPhase t (h i))] simp_rw [birth_fourier_interval_phase_integral] exact Fintype.prod_boole /- Product Fourier integration extracts simultaneous integer equalities from any finite complex path sum. -/ theorem birth_fourier_finite_sum_integral {Ω ι : Type*} [Fintype ι] (paths : Finset Ω) (w : Ω → ℂ) (h : Ω → ι → ℤ) : (∫ θ : ι → ℝ, ∑ ω ∈ paths, w ω * ∏ i, physicalReturnPhase (θ i) (h ω i) ∂birthFourierCubeMeasure ι) = ∑ ω ∈ paths, if ∀ i, h ω i = 0 then w ω else 0 := by rw [integral_finsetSum] · apply sum_congr rfl intro ω _ rw [integral_const_mul, birth_fourier_cube_phase_integral] split_ifs <;> simp · intro ω _ exact (birth_fourier_cube_phase_integrable (h ω)).const_mul (w ω) /- Unselected edge coordinates carry zero displacement and therefore the constant unit phase in the full product cube. -/ def birthForestEdgeDifference {n : ℕ} (code : BirthForestCode n) (f : Fin n → ℤ) (e : Fin n × Fin n) : ℤ := if e ∈ birthForestEdges code then f e.2 - f e.1 else 0 theorem birthForestEdgeDifference_zero_iff {n : ℕ} (code : BirthForestCode n) (f : Fin n → ℤ) : (∀ e, birthForestEdgeDifference code f e = 0) ↔ ∀ e ∈ birthForestEdges code, f e.2 = f e.1 := by constructor · intro h e he simpa only [birthForestEdgeDifference, if_pos he, sub_eq_zero] using h e · intro h e by_cases he : e ∈ birthForestEdges code · simp only [birthForestEdgeDifference, if_pos he, h e he, sub_self] · simp only [birthForestEdgeDifference, if_neg he] theorem birthForestEdgeDifference_phase_product {n : ℕ} (code : BirthForestCode n) (f : Fin n → ℤ) (θ : (Fin n × Fin n) → ℝ) : (∏ e, physicalReturnPhase (θ e) (birthForestEdgeDifference code f e)) = ∏ j, physicalReturnPhase (birthForestLocalFrequency code θ j) (f j) := by calc _ = ∏ e ∈ birthForestEdges code, physicalReturnPhase (θ e) (f e.2 - f e.1) := by simp only [birthForestEdgeDifference, apply_ite, physicalReturnPhase_zero, prod_ite_mem_eq] _ = _ := birth_forest_phases_eq_local_phases code θ f /- Performed masks remain attached to every touched birth, including when the incident Fourier frequencies cancel at that birth. -/ theorem birthForestCompatible_iff_touched_equalities {n : ℕ} (code : BirthForestCode n) (performed : Fin n → Prop) (f : Fin n → ℤ) : birthForestCompatible performed f code ↔ (∀ j ∈ birthForestTouched code, performed j) ∧ ∀ e ∈ birthForestEdges code, f e.2 = f e.1 := by rw [birthForestCompatible_iff_edges, birthForestTouched_performed_iff] constructor · intro h exact ⟨fun e he => ⟨(h e.1 e.2 he).1, (h e.1 e.2 he).2.1⟩, fun e he => (h e.1 e.2 he).2.2.symm⟩ · rintro ⟨hp, hf⟩ i j hij exact ⟨(hp (i, j) hij).1, (hp (i, j) hij).2, (hf (i, j) hij).symm⟩ /- Product Fourier integration equals the complete forest-constrained finite path sum, including every performed-birth test. -/ theorem birthForestPathSum_fourier_integral {Ω : Type*} {n : ℕ} (paths : Finset Ω) (w : Ω → ℂ) (performed : Ω → Fin n → Prop) (f : Ω → Fin n → ℤ) (code : BirthForestCode n) : (∫ θ : (Fin n × Fin n) → ℝ, ∑ ω ∈ paths, if ∀ j ∈ birthForestTouched code, performed ω j then w ω * ∏ j, physicalReturnPhase (birthForestLocalFrequency code θ j) (f ω j) else 0 ∂birthFourierCubeMeasure (Fin n × Fin n)) = birthForestPathSum paths w performed f code := by let w' : Ω → ℂ := fun ω => if ∀ j ∈ birthForestTouched code, performed ω j then w ω else 0 have hphase : ∀ θ, (∑ ω ∈ paths, w' ω * ∏ e, physicalReturnPhase (θ e) (birthForestEdgeDifference code (f ω) e)) = ∑ ω ∈ paths, if ∀ j ∈ birthForestTouched code, performed ω j then w ω * ∏ j, physicalReturnPhase (birthForestLocalFrequency code θ j) (f ω j) else 0 := by intro θ apply sum_congr rfl intro ω _ rw [birthForestEdgeDifference_phase_product] simp only [w', ite_mul, zero_mul] rw [← show (fun θ => ∑ ω ∈ paths, w' ω * ∏ e, physicalReturnPhase (θ e) (birthForestEdgeDifference code (f ω) e)) = (fun θ => ∑ ω ∈ paths, if ∀ j ∈ birthForestTouched code, performed ω j then w ω * ∏ j, physicalReturnPhase (birthForestLocalFrequency code θ j) (f ω j) else 0) from funext hphase] rw [birth_fourier_finite_sum_integral] unfold birthForestPathSum apply sum_congr rfl intro ω _ by_cases hp : ∀ j ∈ birthForestTouched code, performed ω j · by_cases he : ∀ e ∈ birthForestEdges code, f ω e.2 = f ω e.1 · have hc := (birthForestCompatible_iff_touched_equalities code (performed ω) (f ω)).mpr ⟨hp, he⟩ have hz := (birthForestEdgeDifference_zero_iff code (f ω)).mpr he simp only [if_pos hz, if_pos hc, w', if_pos hp] · have hc : ¬ birthForestCompatible (performed ω) (f ω) code := fun hc => he ((birthForestCompatible_iff_touched_equalities code (performed ω) (f ω)).mp hc).2 have hz : ¬ ∀ e, birthForestEdgeDifference code (f ω) e = 0 := fun hz => he ((birthForestEdgeDifference_zero_iff code (f ω)).mp hz) simp only [if_neg hz, if_neg hc] · have hc : ¬ birthForestCompatible (performed ω) (f ω) code := fun hc => hp ((birthForestCompatible_iff_touched_equalities code (performed ω) (f ω)).mp hc).1 simp only [w', if_neg hp, hc, if_false, ite_self] end section open Finset Classical theorem sum_birthForestRank_head (n r₀ : ℕ) (B : ℕ → ℝ) : (∑ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => birthForestRank code < r₀), B (birthForestRank code)) = ∑ r ∈ range r₀, (birthForestCodesOfRank n r).card * B r := by have hmem : ∀ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => birthForestRank code < r₀), birthForestRank code ∈ range r₀ := by intro code hc exact mem_range.mpr (mem_filter.mp hc).2 rw [← sum_fiberwise_of_maps_to' hmem B] apply sum_congr rfl intro r hr have he : ((univ : Finset (BirthForestCode n)).filter (fun code => birthForestRank code < r₀)).filter (fun code => birthForestRank code = r) = birthForestCodesOfRank n r := by ext code simp only [mem_filter, mem_univ, true_and, birthForestCodesOfRank] exact ⟨fun h => h.2, fun h => ⟨h ▸ mem_range.mp hr, h⟩⟩ rw [he, sum_const, nsmul_eq_mul] theorem birthForest_rank_head_norm_le {n : ℕ} (F : BirthForestCode n → ℂ) (r₀ : ℕ) (B : ℕ → ℝ) (hB : ∀ r ∈ range r₀, 0 ≤ B r) (hF : ∀ code, birthForestRank code < r₀ → ‖F code‖ ≤ B (birthForestRank code)) : ‖∑ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => birthForestRank code < r₀), (-1 : ℂ) ^ birthForestRank code * F code‖ ≤ ∑ r ∈ range r₀, (n : ℝ) ^ (2 * r) * B r := by calc _ ≤ ∑ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => birthForestRank code < r₀), ‖F code‖ := by simpa only [norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul] using norm_sum_le ((univ : Finset (BirthForestCode n)).filter (fun code => birthForestRank code < r₀)) (fun code => (-1 : ℂ) ^ birthForestRank code * F code) _ ≤ ∑ code ∈ (univ : Finset (BirthForestCode n)).filter (fun code => birthForestRank code < r₀), B (birthForestRank code) := sum_le_sum (fun code hc => hF code (mem_filter.mp hc).2) _ = ∑ r ∈ range r₀, (birthForestCodesOfRank n r).card * B r := sum_birthForestRank_head n r₀ B _ ≤ _ := by apply sum_le_sum intro r hr apply mul_le_mul_of_nonneg_right _ (hB r hr) exact_mod_cast birthForestCodesOfRank_card_le_pow n r end section open Finset open scoped BigOperators Classical /- The prime values in the first `J` slots. -/ def physicalFirstMarks {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (g : G) : Finset ℕ := univ.map (Function.Embedding.inl.trans (physicalGroupMarkEmbedding labels g)) /- The prime values in the last `ell` slots, which the small-group dilation omits. -/ def physicalLastMarks {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (g : G) : Finset ℕ := univ.map (Function.Embedding.inr.trans (physicalGroupMarkEmbedding labels g)) theorem mem_physical_first_marks {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (g : G) (p : ℕ) : p ∈ physicalFirstMarks labels g ↔ ∃ j : Fin J, (labels g (Sum.inl j)).val = p := by simp only [physicalFirstMarks, mem_map, mem_univ, true_and] rfl theorem mem_physical_last_marks {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (g : G) (p : ℕ) : p ∈ physicalLastMarks labels g ↔ ∃ j : Fin ell, (labels g (Sum.inr j)).val = p := by simp only [physicalLastMarks, mem_map, mem_univ, true_and] rfl /- Injectivity of the ordered mark list makes the two slot blocks exact set complements inside the full source set. -/ theorem physical_group_marks_sdiff_last {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (g : G) : physicalGroupMarks labels g \ physicalLastMarks labels g = physicalFirstMarks labels g := by ext p rw [mem_sdiff, mem_physical_group_marks, mem_physical_first_marks] constructor · rintro ⟨⟨s, hs⟩, hnot⟩ cases s with | inl j => exact ⟨j, hs⟩ | inr j => exact False.elim (hnot ((mem_physical_last_marks labels g p).mpr ⟨j, hs⟩)) · rintro ⟨j, hj⟩ refine ⟨⟨Sum.inl j, hj⟩, ?_⟩ intro hp obtain ⟨k, hk⟩ := (mem_physical_last_marks labels g p).mp hp have he : Sum.inl j = Sum.inr k := (labels g).injective (Subtype.ext (hj.trans hk.symm)) cases he /- An empty small-group resampling pattern contributes exactly the first-slot product; there are no auxiliary factors in this group. -/ theorem physical_groupD_eq_first_product {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (g : G) (hC : C g = ∅) : physicalGroupD C labels aux g = ∏ p ∈ physicalFirstMarks labels g, p := by let : IsEmpty ↥(C g) := ⟨fun j => by simpa only [hC, notMem_empty] using j.property⟩ have haux : (∏ j : C g, (aux g j).val) = 1 := by simp rw [physicalGroupD, haux, mul_one] simp [hC, physicalFirstMarks, physicalGroupMarkEmbedding] end section open scoped BigOperators InnerProductSpace theorem finite_gram_norm_sum_sq {ι E : Type*} [Fintype ι] [NormedAddCommGroup E] [NormedSpace ℂ E] (c : ι → ℂ) (u : ι → E) : ‖∑ i, c i • u i‖ ^ 2 ≤ (∑ i, ‖c i‖ ^ 2) * ∑ i, ‖u i‖ ^ 2 := by have htriangle : ‖∑ i, c i • u i‖ ≤ ∑ i, ‖c i‖ * ‖u i‖ := by simpa only [norm_smul] using norm_sum_le Finset.univ (fun i => c i • u i) exact (pow_le_pow_left₀ (norm_nonneg _) htriangle 2).trans (Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (fun i => ‖c i‖) (fun i => ‖u i‖)) variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [FiniteDimensional ℂ E] theorem positive_quadratic_gram_bound {ι : Type*} [Fintype ι] (T : E →ₗ[ℂ] E) (hT : T.IsSymmetric) (hpos : ∀ f : E, 0 ≤ (inner ℂ f (T f)).re) (c : ι → ℂ) (u : ι → E) : (inner ℂ (∑ i, c i • u i) (T (∑ i, c i • u i))).re ≤ (∑ i, ‖c i‖ ^ 2) * ∑ i, (inner ℂ (u i) (T (u i))).re := by have hsplit (v : E) : (inner ℂ v (T v)).re = ∑ j, ‖inner ℂ (hT.eigenvectorBasis rfl j) v‖ ^ 2 * hT.eigenvalues rfl j := by simpa only [pow_one] using spectral_moment_eq_sum T hT 1 v have hl (j : Fin (Module.finrank ℂ E)) : 0 ≤ hT.eigenvalues rfl j := eigenvalue_nonneg_of_nonneg (hT.hasEigenvalue_eigenvalues rfl j) hpos have hcoord (j : Fin (Module.finrank ℂ E)) : ‖inner ℂ (hT.eigenvectorBasis rfl j) (∑ i, c i • u i)‖ ^ 2 ≤ (∑ i, ‖c i‖ ^ 2) * ∑ i, ‖inner ℂ (hT.eigenvectorBasis rfl j) (u i)‖ ^ 2 := by simpa only [inner_sum, inner_smul_right, smul_eq_mul] using finite_gram_norm_sum_sq c (fun i => inner ℂ (hT.eigenvectorBasis rfl j) (u i)) rw [hsplit] calc _ ≤ ∑ j, ((∑ i, ‖c i‖ ^ 2) * ∑ i, ‖inner ℂ (hT.eigenvectorBasis rfl j) (u i)‖ ^ 2) * hT.eigenvalues rfl j := Finset.sum_le_sum (fun j _ => mul_le_mul_of_nonneg_right (hcoord j) (hl j)) _ = (∑ i, ‖c i‖ ^ 2) * ∑ i, ∑ j, ‖inner ℂ (hT.eigenvectorBasis rfl j) (u i)‖ ^ 2 * hT.eigenvalues rfl j := by simp only [mul_assoc] rw [← Finset.mul_sum] congr 1 simp only [Finset.sum_mul] exact Finset.sum_comm _ = _ := by simp only [← hsplit] theorem gram_power_quadratic_bound {ι : Type*} [Fintype ι] (A : E →ₗ[ℂ] E) (R : ℕ) (c : ι → ℂ) (u : ι → E) : (inner ℂ (∑ i, c i • u i) (((A * A.adjoint) ^ R) (∑ i, c i • u i))).re ≤ (∑ i, ‖c i‖ ^ 2) * ∑ i, (inner ℂ (u i) (((A * A.adjoint) ^ R) (u i))).re := by have hsym : (A * A.adjoint).IsSymmetric := LinearMap.isSymmetric_self_comp_adjoint A have hpos (v : E) : 0 ≤ (inner ℂ v ((A * A.adjoint) v)).re := by rw [Module.End.mul_apply, ← LinearMap.adjoint_inner_left] exact inner_self_nonneg (𝕜 := ℂ) (x := A.adjoint v) exact positive_quadratic_gram_bound ((A * A.adjoint) ^ R) (hsym.pow R) (positive_spectral_moment_nonneg (A * A.adjoint) hsym hpos R) c u end section open scoped BigOperators /- A consecutive integer block of length `H`. -/ def integerBlock (H j : ℤ) : Finset ℤ := Finset.Ico (j * H) ((j + 1) * H) /- The block containing `x` and its two adjacent blocks. -/ abbrev integerBlockNear (H j x : ℤ) : Prop := |x / H - j| ≤ 1 /- Restriction of a function to one position block. -/ noncomputable def integerBlockMask {α E : Type*} [Zero E] (pos : α → ℤ) (H j : ℤ) (f : α → E) (x : α) : E := if pos x / H = j then f x else 0 /- Restriction to a block and its two neighbors. -/ noncomputable def integerBlockNearMask {α E : Type*} [Zero E] (pos : α → ℤ) (H j : ℤ) (f : α → E) (x : α) : E := if integerBlockNear H j (pos x) then f x else 0 lemma mem_integerBlock_iff {H j x : ℤ} (hH : 0 < H) : x ∈ integerBlock H j ↔ x / H = j := by rw [integerBlock, Finset.mem_Ico, Int.ediv_eq_iff_of_pos hH] rw [add_mul, one_mul] lemma integerBlock_card (H j : ℤ) : (integerBlock H j).card = H.toNat := by rw [integerBlock, Int.card_Ico] congr 1 ring lemma integerBlock_filter_card_le (s : Finset ℤ) {H j : ℤ} (hH : 0 < H) : (s.filter fun x => x / H = j).card ≤ H.toNat := by rw [← integerBlock_card H j] apply Finset.card_le_card intro x hx exact (mem_integerBlock_iff hH).mpr (Finset.mem_filter.mp hx).2 lemma integerBlockNear_of_abs_sub_le {H x y : ℤ} (hH : 0 < H) (hxy : |x - y| ≤ H) : integerBlockNear H (x / H) y := by have habs := abs_le.mp hxy have hl := Int.ediv_le_ediv hH (show x - H ≤ y by omega) have hu := Int.ediv_le_ediv hH (show y ≤ x + H by omega) rw [Int.sub_ediv_of_dvd x (dvd_refl H), Int.ediv_self (ne_of_gt hH)] at hl rw [Int.add_ediv_of_dvd_right (dvd_refl H), Int.ediv_self (ne_of_gt hH)] at hu exact abs_le.mpr ⟨by omega, by omega⟩ lemma integerBlockNear_iff {H j x : ℤ} : integerBlockNear H j x ↔ x / H - 1 ≤ j ∧ j ≤ x / H + 1 := by unfold integerBlockNear rw [abs_le] omega lemma integerBlockNear_filter_card_le (J : Finset ℤ) (H x : ℤ) : (J.filter fun j => integerBlockNear H j x).card ≤ 3 := by have hs : (J.filter fun j => integerBlockNear H j x) ⊆ Finset.Icc (x / H - 1) (x / H + 1) := by intro j hj exact Finset.mem_Icc.mpr (integerBlockNear_iff.mp (Finset.mem_filter.mp hj).2) calc _ ≤ (Finset.Icc (x / H - 1) (x / H + 1)).card := Finset.card_le_card hs _ = 3 := by rw [Int.card_Icc]; omega lemma sum_integerBlock_fibers {α E : Type*} [AddCommMonoid E] (s : Finset α) (pos : α → ℤ) (H : ℤ) (f : α → E) : ∑ j ∈ s.image (fun x => pos x / H), ∑ x ∈ s with pos x / H = j, f x = ∑ x ∈ s, f x := by classical apply Finset.sum_fiberwise_of_maps_to intro x hx exact Finset.mem_image_of_mem _ hx lemma sum_integerBlock_masks {α E : Type*} [AddCommMonoid E] (s : Finset α) (pos : α → ℤ) (H : ℤ) (f : α → E) : ∑ j ∈ s.image (fun x => pos x / H), ∑ x ∈ s, integerBlockMask pos H j f x = ∑ x ∈ s, f x := by classical simp only [integerBlockMask, ← Finset.sum_filter] exact sum_integerBlock_fibers s pos H f lemma sum_integerBlockNear_weights_le {α : Type*} (s : Finset α) (J : Finset ℤ) (pos : α → ℤ) (H : ℤ) (w : α → ℝ) (hw : ∀ x ∈ s, 0 ≤ w x) : ∑ j ∈ J, ∑ x ∈ s with integerBlockNear H j (pos x), w x ≤ 3 * ∑ x ∈ s, w x := by classical simp only [Finset.sum_filter] rw [Finset.sum_comm, Finset.mul_sum] apply Finset.sum_le_sum intro x hx calc (∑ j ∈ J, if integerBlockNear H j (pos x) then w x else 0) = ((J.filter fun j => integerBlockNear H j (pos x)).card : ℝ) * w x := by rw [← Finset.sum_filter, Finset.sum_const, nsmul_eq_mul] _ ≤ 3 * w x := by apply mul_le_mul_of_nonneg_right _ (hw x hx) exact_mod_cast integerBlockNear_filter_card_le J H (pos x) lemma sum_integerBlockNear_sq_norm_le {α E : Type*} [SeminormedAddCommGroup E] (s : Finset α) (J : Finset ℤ) (pos : α → ℤ) (H : ℤ) (w : α → ℝ) (g : α → E) (hw : ∀ x ∈ s, 0 ≤ w x) : ∑ j ∈ J, ∑ x ∈ s, w x * ‖integerBlockNearMask pos H j g x‖ ^ 2 ≤ 3 * ∑ x ∈ s, w x * ‖g x‖ ^ 2 := by classical convert sum_integerBlockNear_weights_le s J pos H (fun x => w x * ‖g x‖ ^ 2) (fun x hx => mul_nonneg (hw x hx) (sq_nonneg _)) using 1 apply Finset.sum_congr rfl intro j hj rw [Finset.sum_filter] apply Finset.sum_congr rfl intro x hx by_cases h : integerBlockNear H j (pos x) · simp [integerBlockNearMask, h] · simp [integerBlockNearMask, h] lemma integerBlock_kernel_localization {α : Type*} (s : Finset α) (pos : α → ℤ) {H : ℤ} (hH : 0 < H) (j : ℤ) (K : α → α → ℂ) (f g : α → ℂ) (hK : ∀ x ∈ s, ∀ y ∈ s, H < |pos x - pos y| → K x y = 0) : (∑ x ∈ s, star (integerBlockMask pos H j f x) * ∑ y ∈ s, K x y * g y) = ∑ x ∈ s, star (integerBlockMask pos H j f x) * ∑ y ∈ s, K x y * integerBlockNearMask pos H j g y := by classical apply Finset.sum_congr rfl intro x hx by_cases hblock : pos x / H = j · congr 1 apply Finset.sum_congr rfl intro y hy by_cases hnear : integerBlockNear H j (pos y) · simp [integerBlockNearMask, hnear] · have hfar : H < |pos x - pos y| := by by_contra h apply hnear rw [← hblock] exact integerBlockNear_of_abs_sub_le hH (le_of_not_gt h) simp [integerBlockNearMask, hnear, hK x hx y hy hfar] · simp [integerBlockMask, hblock] lemma sum_integerBlockMask_eq {α E : Type*} [AddCommMonoid E] (s : Finset α) (pos : α → ℤ) (H : ℤ) (f : α → E) {x : α} (hx : x ∈ s) : ∑ j ∈ s.image (fun y => pos y / H), integerBlockMask pos H j f x = f x := by classical rw [Finset.sum_eq_single (pos x / H)] · simp [integerBlockMask] · intro j _ hj simp [integerBlockMask, Ne.symm hj] · intro h exact (h (Finset.mem_image_of_mem (fun y => pos y / H) hx)).elim lemma integerBlock_sq_norm_le_card_mul {E : Type*} [SeminormedAddCommGroup E] (s : Finset ℤ) {H : ℤ} (hH : 0 < H) (j : ℤ) (f : ℤ → E) {M : ℝ} (hM : 0 ≤ M) (hf : ∀ x ∈ s, ‖f x‖ ≤ M) : ∑ x ∈ s with x / H = j, ‖f x‖ ^ 2 ≤ (H.toNat : ℝ) * M ^ 2 := by calc _ ≤ ∑ _x ∈ s with _x / H = j, M ^ 2 := by apply Finset.sum_le_sum intro x hx exact (sq_le_sq₀ (norm_nonneg _) hM).mpr (hf x (Finset.mem_filter.mp hx).1) _ = ((s.filter fun x => x / H = j).card : ℝ) * M ^ 2 := by rw [Finset.sum_const, nsmul_eq_mul] _ ≤ _ := mul_le_mul_of_nonneg_right (by exact_mod_cast integerBlock_filter_card_le s hH (j := j)) (sq_nonneg M) end section open scoped BigOperators theorem finite_geometric_sum_le {ι : Type*} [Fintype ι] (x y : ι → ℝ) (hx : ∀ i, 0 ≤ x i) (hy : ∀ i, 0 ≤ y i) {θ : ℝ} (hθ : 0 < θ) (hθ1 : θ < 1) : ∑ i, (x i) ^ θ * (y i) ^ (1 - θ) ≤ (∑ i, x i) ^ θ * (∑ i, y i) ^ (1 - θ) := by have hconj : (1 / θ).HolderConjugate (1 / (1 - θ)) := by rw [Real.holderConjugate_iff] constructor · exact (lt_div_iff₀ hθ).2 (by linarith) · simp have h := Real.inner_le_Lp_mul_Lq_of_nonneg Finset.univ hconj (fun i _ => Real.rpow_nonneg (hx i) θ) (fun i _ => Real.rpow_nonneg (hy i) (1 - θ)) have hxpow (i : ι) : ((x i) ^ θ) ^ (1 / θ) = x i := by rw [← Real.rpow_mul (hx i), mul_one_div_cancel hθ.ne', Real.rpow_one] have hypow (i : ι) : ((y i) ^ (1 - θ)) ^ (1 / (1 - θ)) = y i := by rw [← Real.rpow_mul (hy i), mul_one_div_cancel (by linarith : 1 - θ ≠ 0), Real.rpow_one] simpa only [hxpow, hypow, one_div_one_div] using h theorem finite_block_holder {ι : Type*} [Fintype ι] (g f d : ι → ℝ) (hg : ∀ i, 0 ≤ g i) (hf : ∀ i, 0 ≤ f i) (hd : ∀ i, 0 ≤ d i) {θ : ℝ} (hθ : 0 < θ) (hθ1 : θ < 1) : ∑ i, g i * (f i) ^ θ * (d i) ^ ((1 - θ) / 2) ≤ (∑ i, (g i) ^ 2) ^ (1 / 2 : ℝ) * (∑ i, (f i) ^ 2) ^ (θ / 2) * (∑ i, d i) ^ ((1 - θ) / 2) := by have hconj : (2 : ℝ).HolderConjugate 2 := by rw [Real.holderConjugate_iff] norm_num have hcs := Real.inner_le_Lp_mul_Lq_of_nonneg Finset.univ hconj (fun i _ => hg i) (fun i _ => mul_nonneg (Real.rpow_nonneg (hf i) θ) (Real.rpow_nonneg (hd i) ((1 - θ) / 2))) have hpower (i : ι) : ((f i) ^ θ * (d i) ^ ((1 - θ) / 2)) ^ (2 : ℝ) = ((f i) ^ 2) ^ θ * (d i) ^ (1 - θ) := by rw [Real.mul_rpow (Real.rpow_nonneg (hf i) θ) (Real.rpow_nonneg (hd i) ((1 - θ) / 2)), ← Real.rpow_mul (hf i), ← Real.rpow_mul (hd i)] rw [show (1 - θ) / 2 * 2 = 1 - θ by ring] congr 1 rw [← Real.rpow_natCast, ← Real.rpow_mul (hf i)] congr 1 ring simp only [hpower, Real.rpow_two] at hcs have hgeom := finite_geometric_sum_le (fun i => (f i) ^ 2) d (fun i => sq_nonneg _) hd hθ hθ1 have hmono := Real.rpow_le_rpow (Finset.sum_nonneg (fun i _ => mul_nonneg (Real.rpow_nonneg (sq_nonneg _) θ) (Real.rpow_nonneg (hd i) (1 - θ)))) hgeom (by norm_num : (0 : ℝ) ≤ 1 / 2) have hmul := mul_le_mul_of_nonneg_left hmono (Real.rpow_nonneg (show 0 ≤ ∑ i, (g i) ^ 2 from Finset.sum_nonneg (fun i _ => sq_nonneg (g i))) (1 / 2)) have hx : 0 ≤ ∑ i, (f i) ^ 2 := Finset.sum_nonneg (fun i _ => sq_nonneg _) have hy : 0 ≤ ∑ i, d i := Finset.sum_nonneg (fun i _ => hd i) rw [Real.mul_rpow (Real.rpow_nonneg hx θ) (Real.rpow_nonneg hy (1 - θ)), ← Real.rpow_mul hx, ← Real.rpow_mul hy] at hmul simp only [mul_one_div] at hmul simpa only [mul_assoc] using hcs.trans hmul end section open scoped BigOperators InnerProductSpace variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [FiniteDimensional ℂ E] theorem finite_pairing_gram_bound {ι : Type*} [Fintype ι] (A : E →ₗ[ℂ] E) (f g : E) (c : ι → ℂ) (u : ι → E) (hf : f = ∑ i, c i • u i) {C : ℝ} (hC : ∑ i, ‖c i‖ ^ 2 ≤ C) {R : ℕ} (hR : 1 ≤ R) : ‖inner ℂ f (A g)‖ ≤ C ^ (1 / (2 * (R : ℝ))) * (‖g‖ * ‖f‖ ^ (1 - 1 / (R : ℝ)) * (∑ i, (inner ℂ (u i) (((A * A.adjoint) ^ R) (u i))).re) ^ (1 / (2 * (R : ℝ)))) := by have hsym : (A * A.adjoint).IsSymmetric := LinearMap.isSymmetric_self_comp_adjoint A have hpos (v : E) : 0 ≤ (inner ℂ v ((A * A.adjoint) v)).re := by rw [Module.End.mul_apply, ← LinearMap.adjoint_inner_left] exact inner_self_nonneg (𝕜 := ℂ) (x := A.adjoint v) have hmpos (v : E) : 0 ≤ (inner ℂ v (((A * A.adjoint) ^ R) v)).re := positive_spectral_moment_nonneg (A * A.adjoint) hsym hpos R v have hd : 0 ≤ ∑ i, (inner ℂ (u i) (((A * A.adjoint) ^ R) (u i))).re := Finset.sum_nonneg (fun i _ => hmpos (u i)) have hCpos : 0 ≤ C := (Finset.sum_nonneg (fun i _ => sq_nonneg ‖c i‖)).trans hC have hm : (inner ℂ f (((A * A.adjoint) ^ R) f)).re ≤ C * ∑ i, (inner ℂ (u i) (((A * A.adjoint) ^ R) (u i))).re := by rw [hf] exact (gram_power_quadratic_bound A R c u).trans (mul_le_mul_of_nonneg_right hC hd) have hp := Real.rpow_le_rpow (hmpos f) hm (by positivity : 0 ≤ 1 / (2 * (R : ℝ))) rw [Real.mul_rpow hCpos hd] at hp calc ‖inner ℂ f (A g)‖ ≤ ‖g‖ * ‖f‖ ^ (1 - 1 / (R : ℝ)) * (inner ℂ f (((A * A.adjoint) ^ R) f)).re ^ (1 / (2 * (R : ℝ))) := finite_pairing_moment A f g hR _ ≤ ‖g‖ * ‖f‖ ^ (1 - 1 / (R : ℝ)) * (C ^ (1 / (2 * (R : ℝ))) * (∑ i, (inner ℂ (u i) (((A * A.adjoint) ^ R) (u i))).re) ^ (1 / (2 * (R : ℝ)))) := mul_le_mul_of_nonneg_left hp (mul_nonneg (norm_nonneg _) (Real.rpow_nonneg (norm_nonneg _) _)) _ = _ := by ring theorem finite_endpoint_block_bound {J ι : Type*} [Fintype J] [Fintype ι] (A : E →ₗ[ℂ] E) (f g : J → E) (c : J → ι → ℂ) (u : J → ι → E) (hf : ∀ j, f j = ∑ i, c j i • u j i) {C : ℝ} (hC : ∀ j, ∑ i, ‖c j i‖ ^ 2 ≤ C) {R : ℕ} (hR : 2 ≤ R) : ∑ j, ‖inner ℂ (f j) (A (g j))‖ ≤ C ^ (1 / (2 * (R : ℝ))) * (∑ j, ‖g j‖ ^ 2) ^ (1 / 2 : ℝ) * (∑ j, ‖f j‖ ^ 2) ^ ((1 - 1 / (R : ℝ)) / 2) * (∑ j, ∑ i, (inner ℂ (u j i) (((A * A.adjoint) ^ R) (u j i))).re) ^ (1 / (2 * (R : ℝ))) := by classical rcases isEmpty_or_nonempty J with hJ | hJ · simp · let j₀ : J := Classical.choice hJ have hCpos : 0 ≤ C := (Finset.sum_nonneg (fun i _ => sq_nonneg ‖c j₀ i‖)).trans (hC j₀) have hsym : (A * A.adjoint).IsSymmetric := LinearMap.isSymmetric_self_comp_adjoint A have hpos (v : E) : 0 ≤ (inner ℂ v ((A * A.adjoint) v)).re := by rw [Module.End.mul_apply, ← LinearMap.adjoint_inner_left] exact inner_self_nonneg (𝕜 := ℂ) (x := A.adjoint v) let d : J → ℝ := fun j => ∑ i, (inner ℂ (u j i) (((A * A.adjoint) ^ R) (u j i))).re have hd (j : J) : 0 ≤ d j := Finset.sum_nonneg (fun i _ => positive_spectral_moment_nonneg (A * A.adjoint) hsym hpos R (u j i)) have hRpos : (0 : ℝ) < R := by exact_mod_cast (by omega : 0 < R) have hRone : (1 : ℝ) < R := by exact_mod_cast hR have hθ : 0 < 1 - 1 / (R : ℝ) := by have := (div_lt_one hRpos).2 hRone linarith have hθ1 : 1 - 1 / (R : ℝ) < 1 := by have := one_div_pos.mpr hRpos linarith have hexp : (1 - (1 - 1 / (R : ℝ))) / 2 = 1 / (2 * (R : ℝ)) := by ring have hh := finite_block_holder (fun j => ‖g j‖) (fun j => ‖f j‖) d (fun _ => norm_nonneg _) (fun _ => norm_nonneg _) hd hθ hθ1 rw [hexp] at hh calc ∑ j, ‖inner ℂ (f j) (A (g j))‖ ≤ ∑ j, C ^ (1 / (2 * (R : ℝ))) * (‖g j‖ * ‖f j‖ ^ (1 - 1 / (R : ℝ)) * (d j) ^ (1 / (2 * (R : ℝ)))) := Finset.sum_le_sum (fun j _ => finite_pairing_gram_bound A (f j) (g j) (c j) (u j) (hf j) (hC j) (by omega)) _ = C ^ (1 / (2 * (R : ℝ))) * ∑ j, ‖g j‖ * ‖f j‖ ^ (1 - 1 / (R : ℝ)) * (d j) ^ (1 / (2 * (R : ℝ))) := (Finset.mul_sum _ _ _).symm _ ≤ C ^ (1 / (2 * (R : ℝ))) * ((∑ j, ‖g j‖ ^ 2) ^ (1 / 2 : ℝ) * (∑ j, ‖f j‖ ^ 2) ^ ((1 - 1 / (R : ℝ)) / 2) * (∑ j, d j) ^ (1 / (2 * (R : ℝ)))) := mul_le_mul_of_nonneg_left hh (Real.rpow_nonneg hCpos _) _ = _ := by dsimp only [d]; ring end section open Filter open scoped Topology theorem moment_root_le_exp_of_log {M R C : ℝ} (hM : 0 < M) (hR : 0 < R) (hlog : Real.log M ≤ R * C) : M ^ (1 / R) ≤ Real.exp C := by rw [Real.rpow_def_of_pos hM] apply Real.exp_le_exp.mpr rw [mul_one_div] exact (div_le_iff₀ hR).mpr (by nlinarith) theorem eventually_block_sup_moment_bound {a d C : ℝ} (ha : (1 / 2 : ℝ) < a) (hd : d < a) (hC : 0 ≤ C) (D : ℝ) : ∀ᶠ T : ℝ in atTop, ∀ H : ℝ, 0 < H → Real.log H ≤ D * T ^ d * Real.log T → (H * Real.exp (C * Real.sqrt T) ^ 2) ^ (1 / (2 * (Nat.ceil (T ^ a) : ℝ))) ≤ Real.exp 1 := by have ha0 : 0 < a := by linarith filter_upwards [eventually_mul_rpow_log_add_le_rpow ha0 hd (show (0 : ℝ) < 1 by norm_num) D 0, eventually_mul_rpow_log_add_le_rpow ha0 ha (show (0 : ℝ) < 1 by norm_num) (2 * C) 0, Real.tendsto_log_atTop.eventually_ge_atTop 1, eventually_gt_atTop (0 : ℝ)] with T hD hCbound hlogT hT intro H hH hlogH have hsqrt : Real.sqrt T = T ^ (1 / 2 : ℝ) := Real.sqrt_eq_rpow T have hClog : 2 * C * Real.sqrt T ≤ 2 * C * T ^ (1 / 2 : ℝ) * Real.log T := by rw [hsqrt] exact le_mul_of_one_le_right (by positivity) hlogT have hceil : T ^ a ≤ (Nat.ceil (T ^ a) : ℝ) := Nat.le_ceil _ have hR : 0 < 2 * (Nat.ceil (T ^ a) : ℝ) := by have : 0 < T ^ a := Real.rpow_pos_of_pos hT a linarith apply moment_root_le_exp_of_log (mul_pos hH (sq_pos_of_pos (Real.exp_pos _))) hR rw [Real.log_mul hH.ne' (pow_ne_zero 2 (Real.exp_ne_zero _)), Real.log_pow, Real.log_exp] norm_num only [Nat.cast_ofNat] nlinarith end section open scoped BigOperators section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (K : PhysicalState P J ell → PhysicalState P J ell → ℂ) (x y : PhysicalState P J ell) include G sharedInstance1 sharedInstance2 P J ell K x y theorem physical_symmetric_kernel_conjugate : physicalSymmetricKernel (fun a b => (starRingEnd ℂ) (K a b)) x y = (starRingEnd ℂ) (physicalSymmetricKernel K x y) := by rw [physical_symmetric_kernel_double_sum, physical_symmetric_kernel_double_sum] simp only [map_mul, map_inv₀, Complex.conj_natCast, map_sum] theorem physical_symmetric_kernel_adjoint : physicalSymmetricKernel (fun a b => (starRingEnd ℂ) (K b a)) x y = (starRingEnd ℂ) (physicalSymmetricKernel K y x) := by rw [physical_symmetric_kernel_conjugate, physical_symmetric_kernel_transpose] end end section open scoped BigOperators ComplexConjugate noncomputable def finiteKernelOperator {X : Type*} [Fintype X] (K : X → X → ℂ) : EuclideanSpace ℂ X →ₗ[ℂ] EuclideanSpace ℂ X := by classical exact Matrix.toEuclideanLin K theorem finite_kernel_operator_apply {X : Type*} [Fintype X] (K : X → X → ℂ) (v : EuclideanSpace ℂ X) (x : X) : finiteKernelOperator K v x = ∑ y, K x y * v y := by classical rfl theorem finite_kernel_operator_adjoint {X : Type*} [Fintype X] (K : X → X → ℂ) : (finiteKernelOperator K).adjoint = finiteKernelOperator (fun x y => star (K y x)) := by classical exact (Matrix.toEuclideanLin_conjTranspose_eq_adjoint K).symm noncomputable def finiteGramAlternatingKernel {X : Type*} (K : X → X → ℂ) (j : ℕ) (x y : X) : ℂ := if j % 2 = 0 then star (K y x) else K x y theorem finite_gram_alternating_kernel_even {X : Type*} (K : X → X → ℂ) (r : ℕ) (x y : X) : finiteGramAlternatingKernel K (2 * r) x y = star (K y x) := by simp [finiteGramAlternatingKernel] theorem finite_gram_alternating_kernel_odd {X : Type*} (K : X → X → ℂ) (r : ℕ) (x y : X) : finiteGramAlternatingKernel K (2 * r + 1) x y = K x y := by simp [finiteGramAlternatingKernel] theorem finite_alternating_action_eq_gram_power {X : Type*} [Fintype X] (K : X → X → ℂ) (terminal : X → ℂ) (R : ℕ) (x : X) : finitePathAction (finiteGramAlternatingKernel K) terminal (2 * R) x = (((finiteKernelOperator K * (finiteKernelOperator K).adjoint) ^ R) (WithLp.toLp 2 terminal)) x := by induction R generalizing x with | zero => rfl | succ R ih => rw [show 2 * (R + 1) = (2 * R + 1) + 1 by omega, finitePathAction, pow_succ', Module.End.mul_apply, Module.End.mul_apply, finite_kernel_operator_apply] apply Finset.sum_congr rfl intro y _ rw [finite_gram_alternating_kernel_odd, finitePathAction, finite_kernel_operator_adjoint, finite_kernel_operator_apply] congr 1 apply Finset.sum_congr rfl intro z _ rw [finite_gram_alternating_kernel_even, ih] simp only [finite_kernel_operator_adjoint] theorem finite_cutoff_alternating_action_eq_gram_power {X : Type*} (rows : Finset X) (K : X → X → ℂ) (terminal : X → ℂ) (R : ℕ) (x : rows) : finiteCutoffAction rows (finiteGramAlternatingKernel K) terminal (2 * R) x.val = (((finiteKernelOperator (fun a b : rows => K a.val b.val) * (finiteKernelOperator (fun a b : rows => K a.val b.val)).adjoint) ^ R) (WithLp.toLp 2 (fun a : rows => terminal a.val))) x := by rw [finite_cutoff_action_eq_finite] exact finite_alternating_action_eq_gram_power (fun a b : rows => K a.val b.val) (fun a : rows => terminal a.val) R x end section open scoped BigOperators InnerProductSpace variable {X : Type*} noncomputable def finiteFiberIndicator (position : X → ℤ) (n : ℤ) : EuclideanSpace ℂ X := WithLp.toLp 2 (fun x => if position x = n then 1 else 0) noncomputable def finiteFiberVector (position : X → ℤ) (mass : ℝ) (n : ℤ) : EuclideanSpace ℂ X := (Real.sqrt mass : ℂ) • finiteFiberIndicator position n theorem finiteFiberIndicator_apply (position : X → ℤ) (n : ℤ) (x : X) : finiteFiberIndicator position n x = if position x = n then 1 else 0 := rfl variable [Fintype X] theorem finiteFiberIndicator_inner (position : X → ℤ) (n : ℤ) (v : EuclideanSpace ℂ X) : inner ℂ (finiteFiberIndicator position n) v = ∑ x ∈ Finset.univ.filter (fun x => position x = n), v x := by rw [PiLp.inner_apply, Finset.sum_filter] apply Finset.sum_congr rfl intro x _ by_cases hx : position x = n <;> simp [finiteFiberIndicator_apply, hx] theorem finiteFiberVector_inner_operator (position : X → ℤ) {mass : ℝ} (hmass : 0 ≤ mass) (n : ℤ) (T : EuclideanSpace ℂ X →ₗ[ℂ] EuclideanSpace ℂ X) : inner ℂ (finiteFiberVector position mass n) (T (finiteFiberVector position mass n)) = (mass : ℂ) * ∑ x ∈ Finset.univ.filter (fun x => position x = n), T (finiteFiberIndicator position n) x := by simp only [finiteFiberVector, map_smul, inner_smul_left, inner_smul_right, Complex.conj_ofReal, ← mul_assoc, ← Complex.ofReal_mul, Real.mul_self_sqrt hmass, finiteFiberIndicator_inner] theorem sum_finiteFiberVector_inner_operator (position : X → ℤ) {mass : ℝ} (hmass : 0 ≤ mass) (starts : Finset ℤ) (T : EuclideanSpace ℂ X →ₗ[ℂ] EuclideanSpace ℂ X) : (∑ n ∈ starts, inner ℂ (finiteFiberVector position mass n) (T (finiteFiberVector position mass n))) = (mass : ℂ) * ∑ n ∈ starts, ∑ x ∈ Finset.univ.filter (fun x => position x = n), T (finiteFiberIndicator position n) x := by simp only [finiteFiberVector_inner_operator position hmass, Finset.mul_sum] end section open scoped BigOperators InnerProductSpace theorem finite_cutoff_fiber_gram_eq_return_root {X : Type*} (rows : Finset X) (position : X → ℤ) {mass : ℝ} (hmass : 0 ≤ mass) (K : X → X → ℂ) (starts : Finset ℤ) (R : ℕ) : (∑ n ∈ starts, inner ℂ (finiteFiberVector (fun x : rows => position x.val) mass n) (((finiteKernelOperator (fun a b : rows => K a.val b.val) * (finiteKernelOperator (fun a b : rows => K a.val b.val)).adjoint) ^ R) (finiteFiberVector (fun x : rows => position x.val) mass n))) = (mass : ℂ) * ∑ n ∈ starts, ∑ x ∈ rows.filter (fun x => position x = n), finiteCutoffAction rows (finiteGramAlternatingKernel K) (fun y => if position y = n then 1 else 0) (2 * R) x := by classical rw [sum_finiteFiberVector_inner_operator (fun x : rows => position x.val) hmass] congr 1 apply Finset.sum_congr rfl intro n _ rw [Finset.sum_filter, Finset.sum_filter, ← Finset.sum_coe_sort rows] apply Finset.sum_congr rfl intro x _ split_ifs with hx · exact (finite_cutoff_alternating_action_eq_gram_power rows K (fun y => if position y = n then 1 else 0) R x).symm · rfl end section open scoped BigOperators ComplexConjugate noncomputable def cleanFourierSynthesis {R : Type*} [AddCommGroup R] [Fintype R] (c : AddChar R ℂ → ℂ) (r : R) : ℂ := ∑ χ, c χ * χ r noncomputable def cleanFourierCoefficients {R : Type*} [AddCommGroup R] [Fintype R] (f : R → ℂ) (χ : AddChar R ℂ) : ℂ := (AddChar.complexBasis R).repr f χ noncomputable def cleanTranslatedOperator {X R : Type*} [Fintype X] [AddCommGroup R] (K : X → X → ℂ) (δ : X → X → R) (f : X → R → ℂ) (x : X) (r : R) : ℂ := ∑ y, K x y * f y (r + δ x y) noncomputable def cleanFourierBlock {X R : Type*} [Fintype X] [AddCommGroup R] (K : X → X → ℂ) (δ : X → X → R) (χ : AddChar R ℂ) (v : X → ℂ) (x : X) : ℂ := ∑ y, (K x y * χ (δ x y)) * v y theorem clean_fourier_synthesis_coefficients {R : Type*} [AddCommGroup R] [Fintype R] (f : R → ℂ) (r : R) : cleanFourierSynthesis (cleanFourierCoefficients f) r = f r := by have h := congr_fun ((AddChar.complexBasis R).sum_repr f) r simpa only [cleanFourierSynthesis, cleanFourierCoefficients, AddChar.complexBasis_apply, Finset.sum_apply, Pi.smul_apply, smul_eq_mul] using h theorem clean_character_orthogonality {R : Type*} [AddCommGroup R] [Fintype R] (χ ψ : AddChar R ℂ) : ∑ r, χ r * conj (ψ r) = if χ = ψ then (Fintype.card R : ℂ) else 0 := by classical have h := AddChar.sum_eq_ite (χ - ψ) simpa only [AddChar.sub_apply, AddChar.map_neg_eq_inv, AddChar.inv_apply_eq_conj, sub_eq_zero] using h theorem clean_fourier_synthesis_pairing {R : Type*} [AddCommGroup R] [Fintype R] (c d : AddChar R ℂ → ℂ) : ∑ r, cleanFourierSynthesis c r * conj (cleanFourierSynthesis d r) = (Fintype.card R : ℂ) * ∑ χ, c χ * conj (d χ) := by classical simp only [cleanFourierSynthesis, map_sum, map_mul, Fintype.sum_mul_sum] calc ∑ r, ∑ χ, ∑ ψ, c χ * χ r * (conj (d ψ) * conj (ψ r)) = ∑ χ, ∑ ψ, (c χ * conj (d ψ)) * ∑ r, χ r * conj (ψ r) := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro χ hχ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro ψ hψ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro r hr ring _ = (Fintype.card R : ℂ) * ∑ χ, c χ * conj (d χ) := by simp_rw [clean_character_orthogonality] simp only [mul_ite, mul_zero, Finset.sum_ite_eq, Finset.mem_univ, if_true] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro χ hχ ring theorem clean_fourier_synthesis_energy {R : Type*} [AddCommGroup R] [Fintype R] (c : AddChar R ℂ → ℂ) : ∑ r, ‖cleanFourierSynthesis c r‖ ^ 2 = (Fintype.card R : ℝ) * ∑ χ, ‖c χ‖ ^ 2 := by have h := clean_fourier_synthesis_pairing c c simp only [Complex.mul_conj, Complex.normSq_eq_norm_sq] at h exact_mod_cast h theorem clean_fourier_translated_synthesis {X R : Type*} [Fintype X] [AddCommGroup R] [Fintype R] (K : X → X → ℂ) (δ : X → X → R) (c : AddChar R ℂ → X → ℂ) (x : X) (r : R) : cleanTranslatedOperator K δ (fun y => cleanFourierSynthesis (fun χ => c χ y)) x r = cleanFourierSynthesis (fun χ => cleanFourierBlock K δ χ (c χ) x) r := by simp only [cleanTranslatedOperator, cleanFourierBlock, cleanFourierSynthesis, AddChar.map_add_eq_mul, Finset.mul_sum, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro χ hχ apply Finset.sum_congr rfl intro y hy ring /- Parseval with an arbitrary weight on the active states. -/ theorem clean_fourier_weighted_energy {X R : Type*} [Fintype X] [AddCommGroup R] [Fintype R] (w : X → ℝ) (c : AddChar R ℂ → X → ℂ) : ∑ x, w x * ∑ r, ‖cleanFourierSynthesis (fun χ => c χ x) r‖ ^ 2 = (Fintype.card R : ℝ) * ∑ χ, ∑ x, w x * ‖c χ x‖ ^ 2 := by simp_rw [clean_fourier_synthesis_energy, ← mul_assoc, mul_comm (w _) (Fintype.card R : ℝ), mul_assoc, Finset.mul_sum] rw [Finset.sum_comm] /- Weighted counting-measure L² norm on active states and residues. -/ noncomputable def cleanWeightedNorm {X R : Type*} [Fintype X] [Fintype R] (w : X → ℝ) (f : X → R → ℂ) : ℝ := Real.sqrt (∑ x, w x * ∑ r, ‖f x r‖ ^ 2) /- Weighted L² norm on the active states alone. -/ noncomputable def cleanActiveNorm {X : Type*} [Fintype X] (w : X → ℝ) (v : X → ℂ) : ℝ := Real.sqrt (∑ x, w x * ‖v x‖ ^ 2) theorem clean_active_norm_sq {X : Type*} [Fintype X] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (v : X → ℂ) : cleanActiveNorm w v ^ 2 = ∑ x, w x * ‖v x‖ ^ 2 := by apply Real.sq_sqrt exact Finset.sum_nonneg (fun x _ => mul_nonneg (hw x) (sq_nonneg _)) end section open scoped BigOperators InnerProductSpace end section open scoped BigOperators noncomputable def physicalHilbertOperator {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) : EuclideanSpace ℂ (physicalCutoff P J ell positions) →ₗ[ℂ] EuclideanSpace ℂ (physicalCutoff P J ell positions) := finiteKernelOperator (fun x y : physicalCutoff P J ell positions => physicalSymmetricKernel (fun s t => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) s t) x.val y.val) theorem physical_symmetric_alternating_kernel {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) : (fun j x y => physicalSymmetricKernel (fun s t => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (if j % 2 = 0 then -ζ i else ζ i) (if j % 2 = 0 then -k i else k i) (fun a b aux => if j % 2 = 0 then (starRingEnd ℂ) (K i b a aux) else K i a b aux) s t) x y) = finiteGramAlternatingKernel (fun x y => physicalSymmetricKernel (fun s t => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) s t) x y) := by funext j x y unfold finiteGramAlternatingKernel by_cases hj : j % 2 = 0 · simp only [if_pos hj] exact (by have heq : (fun s t => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (-ζ i) (-k i) (fun a b f => (starRingEnd ℂ) (K i b a f)) s t) = (fun s t => (starRingEnd ℂ) (∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) t s)) := by funext s t simp only [physical_pattern_reverse, map_sum] rw [heq, physical_symmetric_kernel_adjoint] rfl ) · simp only [if_neg hj] end section open Finset Classical theorem physical_cutoff_fiber_sum_eq_ite {G R : Type*} [Fintype G] [DecidableEq G] [AddCommMonoid R] (P : G → Finset ℕ) (J ell : ℕ) (I : Finset ℤ) (n : ℤ) (f : PhysicalState P J ell → R) : (∑ x ∈ (physicalCutoff P J ell I).filter (fun x => x.1 = n), f x) = if n ∈ I then ∑ L : PhysicalMarksAt P J ell n, f ⟨n, L⟩ else 0 := by classical rw [sum_filter, physical_cutoff_sum] have hs (m : ℤ) : (∑ L : PhysicalMarksAt P J ell m, if m = n then f ⟨m, L⟩ else 0) = if m = n then ∑ L : PhysicalMarksAt P J ell n, f ⟨n, L⟩ else 0 := by by_cases hm : m = n · subst m simp · simp [hm] simp only [hs] simp theorem physical_cutoff_fiber_sum {G R : Type*} [Fintype G] [DecidableEq G] [AddCommMonoid R] (P : G → Finset ℕ) (J ell : ℕ) (I : Finset ℤ) (n : ℤ) (hn : n ∈ I) (f : PhysicalState P J ell → R) : (∑ x ∈ (physicalCutoff P J ell I).filter (fun x => x.1 = n), f x) = ∑ L : PhysicalMarksAt P J ell n, f ⟨n, L⟩ := by rw [physical_cutoff_fiber_sum_eq_ite, if_pos hn] theorem mem_reachable_positions_self {I : Finset ℤ} {n : ℤ} (hn : n ∈ I) (radius : ℕ) : n ∈ reachablePositions I radius := by exact mem_reachable_positions hn (by simp) end section open scoped BigOperators InnerProductSpace section variable {G I : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (starts : Finset ℤ) (R b : ℕ) (hR : 0 < R) include G I sharedInstance1 sharedInstance2 P J ell V hV patterns C q ζ k K starts R b hR theorem physical_root_moment_eq_fiber_gram : let positions := reachablePositions starts (2 * R * b) let A := physicalHilbertOperator V patterns C q ζ k K positions let u : ℤ → EuclideanSpace ℂ (physicalCutoff P J ell positions) := fun n => finiteFiberVector (fun x : physicalCutoff P J ell positions => x.val.1) (physicalStateMass V J ell) n physicalRootMoment V patterns C q (fun j i => if j % 2 = 0 then -ζ i else ζ i) (fun j i => if j % 2 = 0 then -k i else k i) (fun j i a c aux => if j % 2 = 0 then (starRingEnd ℂ) (K i c a aux) else K i a c aux) starts (2 * R - 1) b = (∑ n ∈ starts, inner ℂ (u n) (((A * A.adjoint) ^ R) (u n))) / (starts.card : ℂ) := by dsimp only have hlen : 2 * R - 1 + 1 = 2 * R := by omega have hmass := (physical_state_mass_pos V hV J ell).le let base : PhysicalState P J ell → PhysicalState P J ell → ℂ := fun x y => physicalSymmetricKernel (fun s t => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) s t) x y have hg := finite_cutoff_fiber_gram_eq_return_root (physicalCutoff P J ell (reachablePositions starts (2 * R * b))) (fun x : PhysicalState P J ell => x.1) hmass base starts R have hs : (∑ n ∈ starts, ∑ x ∈ (physicalCutoff P J ell (reachablePositions starts (2 * R * b))).filter (fun x => x.1 = n), finiteCutoffAction (physicalCutoff P J ell (reachablePositions starts (2 * R * b))) (finiteGramAlternatingKernel base) (fun y => if y.1 = n then 1 else 0) (2 * R) x) = ∑ n ∈ starts, ∑ L : PhysicalMarksAt P J ell n, finiteCutoffAction (physicalCutoff P J ell (reachablePositions starts (2 * R * b))) (finiteGramAlternatingKernel base) (fun y => if y.1 = n then 1 else 0) (2 * R) ⟨n, L⟩ := by apply Finset.sum_congr rfl intro n hn exact physical_cutoff_fiber_sum P J ell (reachablePositions starts (2 * R * b)) n (mem_reachable_positions hn (by simp)) _ rw [hs] at hg unfold physicalRootMoment rw [hlen, physical_symmetric_alternating_kernel] exact congrArg (fun z : ℂ => z / (starts.card : ℂ)) hg.symm theorem physical_root_moment_re_eq_fiber_gram : let positions := reachablePositions starts (2 * R * b) let A := physicalHilbertOperator V patterns C q ζ k K positions let u : ℤ → EuclideanSpace ℂ (physicalCutoff P J ell positions) := fun n => finiteFiberVector (fun x : physicalCutoff P J ell positions => x.val.1) (physicalStateMass V J ell) n (physicalRootMoment V patterns C q (fun j i => if j % 2 = 0 then -ζ i else ζ i) (fun j i => if j % 2 = 0 then -k i else k i) (fun j i a c aux => if j % 2 = 0 then (starRingEnd ℂ) (K i c a aux) else K i a c aux) starts (2 * R - 1) b).re = (∑ n ∈ starts, (inner ℂ (u n) (((A * A.adjoint) ^ R) (u n))).re) / (starts.card : ℝ) := by dsimp only have h := congrArg Complex.re (physical_root_moment_eq_fiber_gram V hV patterns C q ζ k K starts R b hR) simpa only [← Complex.ofReal_natCast, Complex.div_ofReal_re, Complex.re_sum] using h end end section open Finset noncomputable def primeOccupancyWeight (q : ℝ) (n : ℕ) : ℝ := q^n.primeFactors.card / (n : ℝ) theorem prime_occupancy_weight_one (q : ℝ) : primeOccupancyWeight q 1 = 1 := by simp [primeOccupancyWeight] theorem prime_occupancy_weight_mul (q : ℝ) {m n : ℕ} (h : m.Coprime n) : primeOccupancyWeight q (m * n) = primeOccupancyWeight q m * primeOccupancyWeight q n := by simp only [primeOccupancyWeight, h.primeFactors_mul, card_union_of_disjoint h.disjoint_primeFactors, pow_add, Nat.cast_mul, mul_div_mul_comm] theorem norm_prime_occupancy_weight (q : ℝ) (n : ℕ) : ‖primeOccupancyWeight q n‖ = primeOccupancyWeight ‖q‖ n := by simp [primeOccupancyWeight, norm_div, norm_pow] theorem prime_occupancy_weight_prime_pow_succ (q : ℝ) {p : ℕ} (hp : p.Prime) (e : ℕ) : primeOccupancyWeight q (p^(e + 1)) = q / (p : ℝ)^(e + 1) := by simp [primeOccupancyWeight, Nat.primeFactors_prime_pow (Nat.succ_ne_zero e) hp] theorem hasSum_prime_occupancy_prime_powers (q : ℝ) {p : ℕ} (hp : p.Prime) : HasSum (fun e : ℕ => primeOccupancyWeight q (p^e)) (1 + q / ((p : ℝ) - 1)) := by have hp1 : (1 : ℝ) < p := by exact_mod_cast hp.one_lt have hp0 : (0 : ℝ) < p := by linarith have hpinv : (p : ℝ)⁻¹ < 1 := (inv_lt_one₀ hp0).mpr hp1 have hgeo := hasSum_geometric_of_lt_one (inv_nonneg.mpr hp0.le) hpinv have htail : HasSum (fun e : ℕ => primeOccupancyWeight q (p^(e + 1))) (q / ((p : ℝ) - 1)) := by have he : (fun e : ℕ => primeOccupancyWeight q (p^(e + 1))) = (fun e : ℕ => (q / (p : ℝ)) * (p : ℝ)⁻¹^e) := by funext e rw [prime_occupancy_weight_prime_pow_succ q hp e, pow_succ] simp only [div_eq_mul_inv, mul_inv, inv_pow] ring have hv : (q / (p : ℝ)) * (1 - (p : ℝ)⁻¹)⁻¹ = q / ((p : ℝ) - 1) := by field_simp rw [he, ← hv] exact hgeo.mul_left (q / (p : ℝ)) have hh := (hasSum_nat_add_iff (f := fun e => primeOccupancyWeight q (p^e)) 1).mp htail simpa [prime_occupancy_weight_one, add_comm] using hh theorem prime_occupancy_prime_powers_summable_norm (q : ℝ) {p : ℕ} (hp : p.Prime) : Summable (fun e : ℕ => ‖primeOccupancyWeight q (p^e)‖) := by simpa only [norm_prime_occupancy_weight] using (hasSum_prime_occupancy_prime_powers ‖q‖ hp).summable theorem prime_occupancy_summable_and_sum (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (q : ℝ) : Summable (fun n : Nat.factoredNumbers P => ‖primeOccupancyWeight q n.val‖) ∧ (∑' n : Nat.factoredNumbers P, primeOccupancyWeight q n.val) = ∏ p ∈ P, (1 + q / ((p : ℝ) - 1)) := by obtain ⟨hsum, hvalue⟩ := EulerProduct.summable_and_hasSum_factoredNumbers_prod_filter_prime_tsum (prime_occupancy_weight_one q) (prime_occupancy_weight_mul q) (prime_occupancy_prime_powers_summable_norm q) P refine ⟨hsum, ?_⟩ rw [hvalue.tsum_eq, filter_eq_self.mpr hP] apply prod_congr rfl intro p hp exact (hasSum_prime_occupancy_prime_powers q (hP p hp)).tsum_eq theorem prime_occupancy_euler_product (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (q : ℝ) : (∑' n : Nat.factoredNumbers P, q^n.val.primeFactors.card / (n.val : ℝ)) = ∏ p ∈ P, (1 + q / ((p : ℝ) - 1)) := (prime_occupancy_summable_and_sum P hP q).2 end section open Finset theorem prime_euler_log_lower {p q : ℝ} (hp : 1 < p) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) : q / p ≤ Real.log (1 + q / (p - 1)) := by have hp0 : 0 < p := zero_lt_one.trans hp have hden : 0 < p - 1 := sub_pos.mpr hp have hsum : 0 < p - 1 + q := by positivity have hfactor : 0 < 1 + q / (p - 1) := by positivity calc q / p ≤ q / (p - 1 + q) := div_le_div_of_nonneg_left hq0 hsum (by linarith) _ = 1 - (1 + q / (p - 1))⁻¹ := by field_simp; ring _ ≤ _ := Real.one_sub_inv_le_log_of_pos hfactor theorem prime_euler_product_lower (P : Finset ℕ) (hP : ∀ p ∈ P, (1 : ℝ) < p) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) : Real.exp (q * ∑ p ∈ P, 1 / (p : ℝ)) ≤ ∏ p ∈ P, (1 + q / ((p : ℝ) - 1)) := by rw [mul_sum] simp only [mul_one_div] rw [Real.exp_sum] apply prod_le_prod₀ (fun _ _ => (Real.exp_pos _).le) intro p hp have hden : 0 < (p : ℝ) - 1 := sub_pos.mpr (hP p hp) exact (Real.le_log_iff_exp_le (by positivity)).mp (prime_euler_log_lower (hP p hp) hq0 hq1) end section open Finset /- Marking one element of a weighted subset is the derivative of the finite subset generating polynomial. No positivity assumption is needed. -/ theorem finite_marked_subset_sum {α : Type*} [DecidableEq α] (P : Finset α) (q : ℝ) (a : α → ℝ) : (∑ S ∈ P.powerset, (S.card : ℝ) * q^(S.card - 1) * ∏ p ∈ S, a p) = ∑ p ∈ P, a p * ∏ r ∈ P.erase p, (1 + q * a r) := by classical have he : (fun x : ℝ => ∑ S ∈ P.powerset, x^S.card * ∏ p ∈ S, a p) = (fun x : ℝ => ∏ p ∈ P, (1 + x * a p)) := by funext x simpa only [one_pow, mul_one] using subset_weighted_product_expansion P x 1 a have hleft : HasDerivAt (fun x : ℝ => ∑ S ∈ P.powerset, x^S.card * ∏ p ∈ S, a p) (∑ S ∈ P.powerset, (S.card : ℝ) * q^(S.card - 1) * ∏ p ∈ S, a p) q := by exact HasDerivAt.fun_sum (fun S _ => (hasDerivAt_pow S.card q).mul_const _) have hlocal : ∀ p ∈ P, HasDerivAt (fun x : ℝ => 1 + x * a p) (a p) q := by intro p _ simpa only [id_eq, one_mul] using ((hasDerivAt_id q).mul_const (a p)).const_add 1 have hright : HasDerivAt (fun x : ℝ => ∏ p ∈ P, (1 + x * a p)) (∑ p ∈ P, a p * ∏ r ∈ P.erase p, (1 + q * a r)) q := by simpa only [smul_eq_mul, mul_comm] using HasDerivAt.fun_finsetProd hlocal rw [he] at hleft exact hleft.unique hright /- Factor the marked polynomial as its unmarked product times the sum of individual mark-to-unmarked ratios. -/ theorem finite_marked_subset_factor {α : Type*} (P : Finset α) (q : ℝ) (a : α → ℝ) (hn : ∀ p ∈ P, 1 + q * a p ≠ 0) : (∑ S ∈ P.powerset, (S.card : ℝ) * q^(S.card - 1) * ∏ p ∈ S, a p) = (∏ p ∈ P, (1 + q * a p)) * ∑ p ∈ P, a p / (1 + q * a p) := by classical rw [finite_marked_subset_sum, mul_sum] apply sum_congr rfl intro p hp rw [← prod_erase_mul P (fun r => 1 + q * a r) hp] have hn' : 1 + a p * q ≠ 0 := by simpa only [mul_comm] using hn p hp field_simp [hn p hp, hn'] /- For 0 ≤ q ≤ 1, marking a prime contributes at least its harmonic mass relative to the unmarked Euler factor. -/ theorem reciprocal_prime_mark_ratio {x q : ℝ} (hx : 1 < x) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) : 1 / x ≤ (1 / (x - 1)) / (1 + q * (1 / (x - 1))) := by have hx1 : 0 < x - 1 := sub_pos.mpr hx have hden : 0 < x - 1 + q := by linarith have hfac : 0 < 1 + q * (1 / (x - 1)) := by positivity have he : (1 / (x - 1)) / (1 + q * (1 / (x - 1))) = 1 / (x - 1 + q) := by field_simp rw [he] exact one_div_le_one_div_of_le hden (by linarith) /- The normalized one-mark subset expression dominates the unmarked Euler product when V is the reciprocal-prime mass of the group. -/ theorem finite_marked_prime_subset_lower_bound (P : Finset ℕ) (hP : ∀ p ∈ P, 1 < p) {q V : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hV : 0 < V) (hmass : (∑ p ∈ P, 1 / (p : ℝ)) = V) : (∏ p ∈ P, (1 + q / ((p : ℝ) - 1))) ≤ (∑ S ∈ P.powerset, (S.card : ℝ) * q^(S.card - 1) * ∏ p ∈ S, 1 / ((p : ℝ) - 1)) / V := by have hpos : ∀ p ∈ P, 0 < 1 + q * (1 / ((p : ℝ) - 1)) := by intro p hp have hx : (1 : ℝ) < p := by exact_mod_cast hP p hp have hx1 : 0 < (p : ℝ) - 1 := sub_pos.mpr hx positivity have he := finite_marked_subset_factor P q (fun p => 1 / ((p : ℝ) - 1)) (fun p hp => (hpos p hp).ne') rw [he] have hsum : V ≤ ∑ p ∈ P, (1 / ((p : ℝ) - 1)) / (1 + q * (1 / ((p : ℝ) - 1))) := by rw [← hmass] exact sum_le_sum (fun p hp => reciprocal_prime_mark_ratio (by exact_mod_cast hP p hp) hq0 hq1) have hprod : 0 ≤ ∏ p ∈ P, (1 + q * (1 / ((p : ℝ) - 1))) := prod_nonneg (fun p hp => (hpos p hp).le) simp only [div_eq_mul_inv, one_mul] at * rw [← div_eq_mul_inv] apply (le_div_iff₀ hV).mpr exact mul_le_mul_of_nonneg_left hsum hprod end section open Set theorem bounded_power_norm_le {y B : ℝ} (hB : 1 ≤ B) (hy : |y| ≤ B) {m N : ℕ} (hm : m ≤ N) : ‖y^m‖ ≤ B^N := by rw [norm_pow, Real.norm_eq_abs] exact (pow_le_pow_left₀ (abs_nonneg y) hy m).trans (pow_le_pow_right₀ hB hm) theorem summable_bounded_powers {ι : Type*} (a : ι → ℝ) (ha : Summable (fun i => ‖a i‖)) (m : ι → ℕ) (N : ℕ) (hm : ∀ i, m i ≤ N) (q : ℝ) : Summable (fun i => a i * q^(m i)) := by apply (ha.mul_right ((|q| + 1)^N)).of_norm_bounded intro i rw [norm_mul] exact mul_le_mul_of_nonneg_left (bounded_power_norm_le (by linarith [abs_nonneg q]) (by linarith) (hm i)) (norm_nonneg _) theorem bounded_power_derivative_norm_le {a y B : ℝ} (hB : 1 ≤ B) (hy : |y| ≤ B) {m N : ℕ} (hm : m ≤ N) : ‖a * (m : ℝ) * y^(m - 1)‖ ≤ ‖a‖ * ((N : ℝ) * B^N) := by have hm' : (m : ℝ) ≤ N := by exact_mod_cast hm have hpow := bounded_power_norm_le hB hy ((Nat.sub_le m 1).trans hm) rw [norm_mul, norm_mul, Real.norm_eq_abs (m : ℝ), abs_of_nonneg (Nat.cast_nonneg m)] calc ‖a‖ * (m : ℝ) * ‖y^(m - 1)‖ ≤ ‖a‖ * (N : ℝ) * B^N := mul_le_mul (mul_le_mul_of_nonneg_left hm' (norm_nonneg _)) hpow (norm_nonneg _) (by positivity) _ = _ := by ring theorem summable_bounded_power_derivatives {ι : Type*} (a : ι → ℝ) (ha : Summable (fun i => ‖a i‖)) (m : ι → ℕ) (N : ℕ) (hm : ∀ i, m i ≤ N) (q : ℝ) : Summable (fun i => a i * (m i : ℝ) * q^(m i - 1)) := by apply (ha.mul_right ((N : ℝ) * (|q| + 1)^N)).of_norm_bounded intro i exact bounded_power_derivative_norm_le (by linarith [abs_nonneg q]) (by linarith) (hm i) /- The bounded exponent hypothesis supplies a summable derivative majorant on a neighborhood of every q, including q = 0 and maximum exponent N = 0. -/ theorem hasDerivAt_tsum_bounded_powers {ι : Type*} (a : ι → ℝ) (ha : Summable (fun i => ‖a i‖)) (m : ι → ℕ) (N : ℕ) (hm : ∀ i, m i ≤ N) (q : ℝ) : HasDerivAt (fun x : ℝ => ∑' i, a i * x^(m i)) (∑' i, a i * (m i : ℝ) * q^(m i - 1)) q := by have hB : 1 ≤ |q| + 1 := by linarith [abs_nonneg q] have hq : q ∈ Ioo (q - 1) (q + 1) := ⟨by linarith, by linarith⟩ apply hasDerivAt_tsum_of_isPreconnected (ha.mul_right ((N : ℝ) * (|q| + 1)^N)) isOpen_Ioo (convex_Ioo _ _).isPreconnected (g := fun i x => a i * x^(m i)) (g' := fun i x => a i * (m i : ℝ) * x^(m i - 1)) ?_ ?_ hq (summable_bounded_powers a ha m N hm q) hq · intro i x _ simpa only [mul_assoc] using (hasDerivAt_pow (m i) x).const_mul (a i) · intro i x hx have hxq : |x - q| < 1 := abs_lt.mpr ⟨by linarith [hx.1], by linarith [hx.2]⟩ have hxB : |x| ≤ |q| + 1 := by have htri := abs_add_le (x - q) q have he : x - q + q = x := by ring rw [he] at htri linarith exact bounded_power_derivative_norm_le hB hxB (hm i) end section open Finset theorem physical_divisor_pool_eq_primeFactors {G : Type*} (P : G → Finset ℕ) (g : G) (hP : ∀ p ∈ P g, p.Prime) {n : ℕ} (hn : n ∈ Nat.factoredNumbers (P g)) : physicalDivisorPool P g (n : ℤ) = n.primeFactors := by ext p simp only [physicalDivisorPool, mem_filter, Nat.mem_primeFactors] constructor · rintro ⟨hp, hpn⟩ exact ⟨hP p hp, by exact_mod_cast hpn, Nat.ne_zero_of_mem_factoredNumbers hn⟩ · rintro ⟨hp, hpn, hn0⟩ exact ⟨Nat.primeFactors_subset_of_mem_factoredNumbers hn (Nat.mem_primeFactors.mpr ⟨hp, hpn, hn0⟩), by exact_mod_cast hpn⟩ theorem physical_omega_eq_primeFactors_card {G : Type*} (P : G → Finset ℕ) (g : G) (hP : ∀ p ∈ P g, p.Prime) {n : ℕ} (hn : n ∈ Nat.factoredNumbers (P g)) : physicalOmega P g (n : ℤ) = n.primeFactors.card := by exact congrArg Finset.card (physical_divisor_pool_eq_primeFactors P g hP hn) theorem one_marked_divisor_factor_eq (q V : ℝ) (omega : ℕ) : markedDivisorFactor q V omega 1 = (omega : ℝ) * q^(omega-1) / V := by simp [markedDivisorFactor] end section open Finset section variable (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) include P hP theorem prime_supported_reciprocal_summable : Summable (fun n : Nat.factoredNumbers P => 1 / (n.val : ℝ)) := by simpa only [neg_mul, Real.rpow_neg_one, one_div] using (smooth_rpow_summable_and_sum P hP (show (0 : ℝ) < 1 by norm_num)).1 theorem prime_one_marked_harmonic_summable (q : ℝ) : Summable (fun n : Nat.factoredNumbers P => (n.val.primeFactors.card : ℝ) * q^(n.val.primeFactors.card - 1) / (n.val : ℝ)) := by have h := summable_bounded_power_derivatives (fun n : Nat.factoredNumbers P => 1 / (n.val : ℝ)) (prime_supported_reciprocal_summable P hP).norm (fun n => n.val.primeFactors.card) P.card (fun n => card_le_card (Nat.primeFactors_subset_of_mem_factoredNumbers n.property)) q convert h using 1 funext n ring theorem prime_one_marked_harmonic_sum (q : ℝ) : (∑' n : Nat.factoredNumbers P, (n.val.primeFactors.card : ℝ) * q^(n.val.primeFactors.card - 1) / (n.val : ℝ)) = ∑ p ∈ P, (1 / ((p : ℝ) - 1)) * ∏ r ∈ P.erase p, (1 + q / ((r : ℝ) - 1)) := by classical have hd := hasDerivAt_tsum_bounded_powers (fun n : Nat.factoredNumbers P => 1 / (n.val : ℝ)) (prime_supported_reciprocal_summable P hP).norm (fun n => n.val.primeFactors.card) P.card (fun n => card_le_card (Nat.primeFactors_subset_of_mem_factoredNumbers n.property)) q have he : (fun x : ℝ => ∑' n : Nat.factoredNumbers P, (1 / (n.val : ℝ)) * x^n.val.primeFactors.card) = (fun x => ∏ p ∈ P, (1 + x / ((p : ℝ) - 1))) := by funext x rw [← prime_occupancy_euler_product P hP x] apply tsum_congr intro n ring rw [he] at hd have hp : ∀ p ∈ P, HasDerivAt (fun x : ℝ => 1 + x / ((p : ℝ) - 1)) (1 / ((p : ℝ) - 1)) q := by intro p _ simpa only [id_eq] using ((hasDerivAt_id q).div_const ((p : ℝ) - 1)).const_add 1 have hd' : HasDerivAt (fun x : ℝ => ∏ p ∈ P, (1 + x / ((p : ℝ) - 1))) (∑ p ∈ P, (1 / ((p : ℝ) - 1)) * ∏ r ∈ P.erase p, (1 + q / ((r : ℝ) - 1))) q := by simpa only [smul_eq_mul, mul_comm] using HasDerivAt.fun_finsetProd hp calc _ = ∑' n : Nat.factoredNumbers P, (1 / (n.val : ℝ)) * (n.val.primeFactors.card : ℝ) * q^(n.val.primeFactors.card - 1) := by apply tsum_congr intro n ring _ = _ := hd.unique hd' theorem prime_one_marked_harmonic_eq_subset (q : ℝ) : (∑' n : Nat.factoredNumbers P, (n.val.primeFactors.card : ℝ) * q^(n.val.primeFactors.card - 1) / (n.val : ℝ)) = ∑ S ∈ P.powerset, (S.card : ℝ) * q^(S.card - 1) * ∏ p ∈ S, 1 / ((p : ℝ) - 1) := by rw [prime_one_marked_harmonic_sum P hP q, finite_marked_subset_sum] simp only [mul_one_div] theorem normalized_one_marked_harmonic_lower {q V : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hV : 0 < V) (hmass : (∑ p ∈ P, 1 / (p : ℝ)) = V) : (∏ p ∈ P, (1 + q / ((p : ℝ) - 1))) ≤ (∑' n : Nat.factoredNumbers P, (n.val.primeFactors.card : ℝ) * q^(n.val.primeFactors.card - 1) / (n.val : ℝ)) / V := by rw [prime_one_marked_harmonic_eq_subset P hP q] exact finite_marked_prime_subset_lower_bound P (fun p hp => (hP p hp).one_lt) hq0 hq1 hV hmass end noncomputable def oneMarkedHarmonicMass (P : Finset ℕ) (q V : ℝ) : ℝ := ∑' n : Nat.factoredNumbers P, markedDivisorFactor q V n.val.primeFactors.card 1 / (n.val : ℝ) theorem one_marked_harmonic_mass_eq_normalized (P : Finset ℕ) (q V : ℝ) : oneMarkedHarmonicMass P q V = (∑' n : Nat.factoredNumbers P, (n.val.primeFactors.card : ℝ) * q^(n.val.primeFactors.card - 1) / (n.val : ℝ)) / V := by rw [← tsum_div_const] apply tsum_congr intro n rw [one_marked_divisor_factor_eq] ring theorem one_marked_harmonic_summable (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (q V : ℝ) : Summable (fun n : Nat.factoredNumbers P => markedDivisorFactor q V n.val.primeFactors.card 1 / (n.val : ℝ)) := by have h := (prime_one_marked_harmonic_summable P hP q).div_const V convert h using 1 <;> try rfl funext n rw [one_marked_divisor_factor_eq] ring theorem one_marked_harmonic_mass_ge_exp (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {q V : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hV : 0 < V) (hmass : (∑ p ∈ P, 1 / (p : ℝ)) = V) : Real.exp (q * V) ≤ oneMarkedHarmonicMass P q V := by have hprod := prime_euler_product_lower P (fun p hp => show (1 : ℝ) < p by exact_mod_cast (hP p hp).one_lt) hq0 hq1 rw [hmass] at hprod rw [one_marked_harmonic_mass_eq_normalized] exact hprod.trans (normalized_one_marked_harmonic_lower P hP hq0 hq1 hV hmass) end section open Finset theorem mul_mem_factoredNumbers_union {P Q : Finset ℕ} {a b : ℕ} (ha : a ∈ Nat.factoredNumbers P) (hb : b ∈ Nat.factoredNumbers Q) : a * b ∈ Nat.factoredNumbers (P ∪ Q) := Nat.mul_mem_factoredNumbers (Nat.factoredNumbers_mono subset_union_left ha) (Nat.factoredNumbers_mono subset_union_right hb) theorem primePoolPart_eq_self_of_mem {P : Finset ℕ} {n : ℕ} (hn : n ∈ Nat.factoredNumbers P) : primePoolPart P n = n := by have h := primePoolPart_mul_primePoolFreePart P n rw [(mem_factoredNumbers_iff_primePoolFreePart_eq_one P n).mp hn, mul_one] at h exact h theorem primePoolPart_eq_one_of_disjoint {P Q : Finset ℕ} (hPQ : Disjoint P Q) {n : ℕ} (hn : n ∈ Nat.factoredNumbers Q) : primePoolPart P n = 1 := by have hf : n.factorization.filter (fun p => p ∈ P) = 0 := by ext p by_cases hp : p ∈ P · have hfac : n.factorization p = 0 := by by_contra h exact disjoint_left.mp hPQ hp (Nat.primeFactors_subset_of_mem_factoredNumbers hn (Finsupp.mem_support_iff.mpr h)) simp [hp, hfac] · simp [hp] simp [primePoolPart, hf] theorem primePoolPart_mul (P : Finset ℕ) {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) : primePoolPart P (a * b) = primePoolPart P a * primePoolPart P b := by simp only [primePoolPart_eq_prod, Nat.factorization_mul ha hb, Finsupp.add_apply, pow_add, prod_mul_distrib] theorem primePoolPart_mul_of_disjoint {P Q : Finset ℕ} (hPQ : Disjoint P Q) {a b : ℕ} (ha : a ∈ Nat.factoredNumbers P) (hb : b ∈ Nat.factoredNumbers Q) : primePoolPart P (a * b) = a := by rw [primePoolPart_mul P ha.1 hb.1, primePoolPart_eq_self_of_mem ha, primePoolPart_eq_one_of_disjoint hPQ hb, mul_one] theorem primePoolFreePart_mul_of_disjoint {P Q : Finset ℕ} (hPQ : Disjoint P Q) {a b : ℕ} (ha : a ∈ Nat.factoredNumbers P) (hb : b ∈ Nat.factoredNumbers Q) : primePoolFreePart P (a * b) = b := by rw [primePoolFreePart, primePoolPart_mul_of_disjoint hPQ ha hb] exact Nat.mul_div_cancel_left _ (Nat.pos_of_ne_zero ha.1) /- The part complementary to P is Q-supported whenever the original number is P-union-Q-supported. -/ theorem primePoolFreePart_mem_of_union {P Q : Finset ℕ} {n : ℕ} (hn : n ∈ Nat.factoredNumbers (P ∪ Q)) : primePoolFreePart P n ∈ Nat.factoredNumbers Q := by apply Nat.mem_factoredNumbers_of_primeFactors_subset (primePoolFreePart_ne_zero P hn.1) intro p hp rw [← Nat.support_factorization, factorization_primePoolFreePart, Finsupp.support_filter] at hp obtain ⟨hfac, hnot⟩ := mem_filter.mp hp exact (mem_union.mp (Nat.primeFactors_subset_of_mem_factoredNumbers hn hfac)).resolve_left hnot /- Multiplication is a bijection from the two supported factors to their disjoint union. -/ noncomputable def disjointPrimePoolProductEquiv (P Q : Finset ℕ) (hPQ : Disjoint P Q) : Nat.factoredNumbers P × Nat.factoredNumbers Q ≃ Nat.factoredNumbers (P ∪ Q) where toFun x := ⟨x.1.val * x.2.val, mul_mem_factoredNumbers_union x.1.property x.2.property⟩ invFun n := (⟨primePoolPart P n.val, primePoolPart_mem_factoredNumbers P n.val⟩, ⟨primePoolFreePart P n.val, primePoolFreePart_mem_of_union n.property⟩) left_inv x := by apply Prod.ext <;> apply Subtype.ext · exact primePoolPart_mul_of_disjoint hPQ x.1.property x.2.property · exact primePoolFreePart_mul_of_disjoint hPQ x.1.property x.2.property right_inv n := Subtype.ext (primePoolPart_mul_primePoolFreePart P n.val) /- Reindex any real-valued series over a disjoint prime-pool union. -/ theorem tsum_factoredNumbers_union_eq (P Q : Finset ℕ) (hPQ : Disjoint P Q) (f : ℕ → ℝ) : (∑' n : Nat.factoredNumbers (P ∪ Q), f n.val) = ∑' x : Nat.factoredNumbers P × Nat.factoredNumbers Q, f (x.1.val * x.2.val) := ((disjointPrimePoolProductEquiv P Q hPQ).tsum_eq (fun n => f n.val)).symm end section section variable (P Q : Finset ℕ) (hPQ : Disjoint P Q) (f a b : ℕ → ℝ) (ha : Summable (fun n : Nat.factoredNumbers P => a n.val)) (hb : Summable (fun n : Nat.factoredNumbers Q => b n.val)) (hmul : ∀ m ∈ Nat.factoredNumbers P, ∀ n ∈ Nat.factoredNumbers Q, f (m * n) = a m * b n) include P Q hPQ f a b ha hb hmul theorem summable_factored_union_of_mul : Summable (fun n : Nat.factoredNumbers (P ∪ Q) => f n.val) := by apply (disjointPrimePoolProductEquiv P Q hPQ).summable_iff.mp apply (summable_mul_of_summable_norm ha.norm hb.norm).congr intro x exact (hmul x.1.val x.1.property x.2.val x.2.property).symm theorem tsum_factored_union_mul : (∑' n : Nat.factoredNumbers (P ∪ Q), f n.val) = (∑' n : Nat.factoredNumbers P, a n.val) * ∑' n : Nat.factoredNumbers Q, b n.val := by rw [tsum_factoredNumbers_union_eq P Q hPQ f] calc _ = ∑' x : Nat.factoredNumbers P × Nat.factoredNumbers Q, a x.1.val * b x.2.val := by apply tsum_congr intro x exact hmul x.1.val x.1.property x.2.val x.2.property _ = _ := (tsum_mul_tsum_of_summable_norm ha.norm hb.norm).symm end end section open Finset theorem prime_not_dvd_of_disjoint_support {P Q : Finset ℕ} (hPQ : Disjoint P Q) {p b : ℕ} (hp : p.Prime) (hpP : p ∈ P) (hb : b ∈ Nat.factoredNumbers Q) : ¬ p ∣ b := by intro hpb exact disjoint_left.mp hPQ hpP (Nat.primeFactors_subset_of_mem_factoredNumbers hb (Nat.mem_primeFactors.mpr ⟨hp, hpb, Nat.ne_zero_of_mem_factoredNumbers hb⟩)) theorem physical_divisor_pool_mul_disjoint {G : Type*} (P : G → Finset ℕ) (g : G) (hP : ∀ p ∈ P g, p.Prime) {Q : Finset ℕ} (hPQ : Disjoint (P g) Q) {b : ℕ} (hb : b ∈ Nat.factoredNumbers Q) (a : ℕ) : physicalDivisorPool P g ((a * b : ℕ) : ℤ) = physicalDivisorPool P g (a : ℤ) := by ext p simp only [physicalDivisorPool, mem_filter] constructor · rintro ⟨hp, hab⟩ have hab' : p ∣ a * b := by exact_mod_cast hab have ha : p ∣ a := ((hP p hp).dvd_mul.mp hab').resolve_right (prime_not_dvd_of_disjoint_support hPQ (hP p hp) hp hb) exact ⟨hp, by exact_mod_cast ha⟩ · rintro ⟨hp, ha⟩ have ha' : p ∣ a := by exact_mod_cast ha exact ⟨hp, by exact_mod_cast dvd_mul_of_dvd_left ha' b⟩ theorem physical_omega_mul_disjoint {G : Type*} (P : G → Finset ℕ) (g : G) (hP : ∀ p ∈ P g, p.Prime) {Q : Finset ℕ} (hPQ : Disjoint (P g) Q) {b : ℕ} (hb : b ∈ Nat.factoredNumbers Q) (a : ℕ) : physicalOmega P g ((a * b : ℕ) : ℤ) = physicalOmega P g (a : ℤ) := congrArg Finset.card (physical_divisor_pool_mul_disjoint P g hP hPQ hb a) theorem marked_divisor_weight_mul_disjoint {G : Type*} (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (mass : G → ℝ) (t : G → ℕ) (hP : ∀ g ∈ groups, ∀ p ∈ P g, p.Prime) {Q : Finset ℕ} (hPQ : ∀ g ∈ groups, Disjoint (P g) Q) {b : ℕ} (hb : b ∈ Nat.factoredNumbers Q) (a : ℕ) : markedDivisorWeight groups P q mass t ((a * b : ℕ) : ℤ) = markedDivisorWeight groups P q mass t (a : ℤ) := by apply prod_congr rfl intro g hg rw [physical_omega_mul_disjoint P g (hP g hg) (hPQ g hg) hb a] theorem marked_divisor_weight_union_mul {G : Type*} [DecidableEq G] (I J : Finset G) (P : G → Finset ℕ) (q : ℝ) (mass : G → ℝ) (t : G → ℕ) (hIJ : Disjoint I J) (hP : ∀ g ∈ I ∪ J, ∀ p ∈ P g, p.Prime) (hPQ : ∀ g ∈ I, ∀ h ∈ J, Disjoint (P g) (P h)) {a b : ℕ} (ha : a ∈ Nat.factoredNumbers (I.biUnion P)) (hb : b ∈ Nat.factoredNumbers (J.biUnion P)) : markedDivisorWeight (I ∪ J) P q mass t ((a * b : ℕ) : ℤ) = markedDivisorWeight I P q mass t (a : ℤ) * markedDivisorWeight J P q mass t (b : ℤ) := by have hi : markedDivisorWeight I P q mass t ((a * b : ℕ) : ℤ) = markedDivisorWeight I P q mass t (a : ℤ) := by apply marked_divisor_weight_mul_disjoint I P q mass t (fun g hg => hP g (mem_union_left J hg)) _ hb a intro g hg apply disjoint_left.mpr intro p hp hq obtain ⟨h, hh, hph⟩ := mem_biUnion.mp hq exact disjoint_left.mp (hPQ g hg h hh) hp hph have hj : markedDivisorWeight J P q mass t ((a * b : ℕ) : ℤ) = markedDivisorWeight J P q mass t (b : ℤ) := by rw [Nat.mul_comm a b] apply marked_divisor_weight_mul_disjoint J P q mass t (fun g hg => hP g (mem_union_right I hg)) _ ha b intro h hh apply disjoint_left.mpr intro p hp hq obtain ⟨g, hg, hpg⟩ := mem_biUnion.mp hq exact disjoint_left.mp (hPQ g hg h hh) hpg hp change (∏ g ∈ I ∪ J, _) = _ rw [prod_union hIJ] exact congrArg₂ (· * ·) hi hj end section open Finset noncomputable def oneMarkedGroupTerm {G : Type*} (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (mass : G → ℝ) (n : ℕ) : ℝ := markedDivisorWeight groups P q mass (fun _ => 1) (n : ℤ) / (n : ℝ) section variable {G : Type*} [sharedInstance1 : DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (hdisj : (groups : Set G).PairwiseDisjoint P) (hP : ∀ g ∈ groups, ∀ p ∈ P g, p.Prime) include G sharedInstance1 groups P hdisj hP theorem one_marked_groups_summable_and_sum (q : ℝ) (mass : G → ℝ) : Summable (fun n : Nat.factoredNumbers (groups.biUnion P) => oneMarkedGroupTerm groups P q mass n.val) ∧ (∑' n : Nat.factoredNumbers (groups.biUnion P), oneMarkedGroupTerm groups P q mass n.val) = ∏ g ∈ groups, oneMarkedHarmonicMass (P g) q (mass g) := by induction groups using Finset.induction_on with | empty => simp only [biUnion_empty, oneMarkedGroupTerm, markedDivisorWeight, prod_empty] constructor · simpa only [one_div] using prime_supported_reciprocal_summable ∅ (by simp) · simpa only [Real.rpow_neg_one, prod_empty, one_div] using (smooth_rpow_summable_and_sum ∅ (by simp) (show (0 : ℝ) < 1 by norm_num)).2 | @insert g S hg ih => have hdisjS : (S : Set G).PairwiseDisjoint P := by intro i hi j hj hij exact hdisj (mem_insert_of_mem hi) (mem_insert_of_mem hj) hij have hPS : ∀ i ∈ S, ∀ p ∈ P i, p.Prime := fun i hi => hP i (mem_insert_of_mem hi) have hPg : ∀ p ∈ P g, p.Prime := hP g (mem_insert_self g S) obtain ⟨hrest, hrestsum⟩ := ih hdisjS hPS have hcross : ∀ i ∈ ({g} : Finset G), ∀ j ∈ S, Disjoint (P i) (P j) := by intro i hi j hj have hig := mem_singleton.mp hi subst i exact hdisj (mem_insert_self g S) (mem_insert_of_mem hj) (by intro h; exact hg (h ▸ hj)) have hPQ : Disjoint (P g) (S.biUnion P) := by apply disjoint_left.mpr intro p hp hq obtain ⟨j, hj, hpj⟩ := mem_biUnion.mp hq exact disjoint_left.mp (hcross g (mem_singleton_self g) j hj) hp hpj let a : ℕ → ℝ := fun n => markedDivisorFactor q (mass g) n.primeFactors.card 1 / (n : ℝ) have ha : Summable (fun n : Nat.factoredNumbers (P g) => a n.val) := one_marked_harmonic_summable (P g) hPg q (mass g) have hmul : ∀ m ∈ Nat.factoredNumbers (P g), ∀ n ∈ Nat.factoredNumbers (S.biUnion P), oneMarkedGroupTerm (insert g S) P q mass (m * n) = a m * oneMarkedGroupTerm S P q mass n := by intro m hm n hn have hw := marked_divisor_weight_union_mul ({g} : Finset G) S P q mass (fun _ => 1) (disjoint_singleton_left.mpr hg) (by simpa only [singleton_union] using hP) hcross (by simpa only [singleton_biUnion] using hm) hn simp only [singleton_union, markedDivisorWeight, prod_singleton] at hw rw [physical_omega_eq_primeFactors_card P g hPg hm] at hw dsimp only [oneMarkedGroupTerm, markedDivisorWeight, a] rw [hw, Nat.cast_mul] ring constructor · rw [biUnion_insert] exact summable_factored_union_of_mul (P g) (S.biUnion P) hPQ (oneMarkedGroupTerm (insert g S) P q mass) a (oneMarkedGroupTerm S P q mass) ha hrest hmul · have hsum := tsum_factored_union_mul (P g) (S.biUnion P) hPQ (oneMarkedGroupTerm (insert g S) P q mass) a (oneMarkedGroupTerm S P q mass) ha hrest hmul rw [hrestsum] at hsum rw [biUnion_insert, prod_insert hg] exact hsum theorem one_marked_groups_harmonic_lower {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (mass : G → ℝ) (hpos : ∀ g ∈ groups, 0 < mass g) (hmass : ∀ g ∈ groups, (∑ p ∈ P g, 1 / (p : ℝ)) = mass g) : Real.exp (q * ∑ g ∈ groups, mass g) ≤ ∑' n : Nat.factoredNumbers (groups.biUnion P), oneMarkedGroupTerm groups P q mass n.val := by rw [(one_marked_groups_summable_and_sum groups P hdisj hP q mass).2, mul_sum, Real.exp_sum] exact prod_le_prod₀ (fun _ _ => (Real.exp_pos _).le) (fun g hg => one_marked_harmonic_mass_ge_exp (P g) (hP g hg) hq0 hq1 (hpos g hg) (hmass g hg)) end end section open Finset end section open Filter Finset open scoped Topology end section open Filter Finset open scoped Topology noncomputable def candidatePHarmonicMass (s L : ℝ) : ℝ := ∑ j ∈ candidatePIndices s L, ∑ p ∈ candidatePBand (s * L) j, 1 / (p : ℝ) noncomputable def candidateOneMarkedHarmonicMass (s L q : ℝ) : ℝ := ∑' n : Nat.factoredNumbers ((candidatePIndices s L).biUnion (candidatePBand (s * L))), oneMarkedGroupTerm (candidatePIndices s L) (candidatePBand (s * L)) q (fun j => ∑ p ∈ candidatePBand (s * L) j, 1 / (p : ℝ)) n.val theorem candidate_P_harmonic_mass_nonneg (s L : ℝ) : 0 ≤ candidatePHarmonicMass s L := by exact sum_nonneg (fun _ _ => sum_nonneg (fun _ _ => by positivity)) theorem eventually_candidate_one_marked_mass_lower {s q : ℝ} (hs : 0 < s) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) : ∀ᶠ L : ℝ in atTop, Real.exp (q * candidatePHarmonicMass s L) ≤ candidateOneMarkedHarmonicMass s L q := by obtain ⟨v, V, hv, _, hpool⟩ := exists_candidate_P_pool_bounds hs filter_upwards [hpool] with L hp rcases hp with ⟨_, _, _, _, hpair, hdata⟩ apply one_marked_groups_harmonic_lower (candidatePIndices s L) (candidatePBand (s * L)) (fun i _ j _ hij => hpair hij) (fun j hj p hp => ((hdata j hj).2.2 p hp).1) hq0 hq1 · exact fun j hj => hv.trans_le (hdata j hj).1 · exact fun _ _ => rfl theorem eventually_candidate_one_marked_mass_ge_one {s q : ℝ} (hs : 0 < s) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) : ∀ᶠ L : ℝ in atTop, 1 ≤ candidateOneMarkedHarmonicMass s L q := by filter_upwards [eventually_candidate_one_marked_mass_lower hs hq0 hq1] with L h exact (Real.one_le_exp (mul_nonneg hq0 (candidate_P_harmonic_mass_nonneg s L))).trans h end section open Finset end section open Finset /- An actual ordered tuple of distinct labels whose image is exactly `S`. -/ abbrev DistinctOrderedSupport (J : Type*) {P : Type*} (S : Finset P) := {f : J ↪ P // ∀ p, p ∈ S ↔ ∃ j, f j = p} /- Read an actual distinct tuple as an enumeration of its specified support. -/ noncomputable def distinctOrderedSupportAsEquiv {J P : Type*} {S : Finset P} (f : DistinctOrderedSupport J S) : J ≃ S := Equiv.ofBijective (fun j => ⟨f.val j, (f.property (f.val j)).2 ⟨j, rfl⟩⟩) ⟨by intro j k hjk exact f.val.injective (congrArg Subtype.val hjk), by intro p obtain ⟨j, hj⟩ := (f.property p.val).1 p.property exact ⟨j, Subtype.ext hj⟩⟩ /- Forget the subtype tag on each label in a support enumeration. -/ def distinctOrderedSupportOfEquiv {J P : Type*} {S : Finset P} (e : J ≃ S) : DistinctOrderedSupport J S := ⟨{ toFun := fun j => (e j).val inj' := by intro j k hjk exact e.injective (Subtype.ext hjk) }, by intro p constructor · intro hp obtain ⟨j, hj⟩ := e.surjective ⟨p, hp⟩ exact ⟨j, congrArg Subtype.val hj⟩ · rintro ⟨j, rfl⟩ exact (e j).property⟩ end section open Finset /- Occupancy of the retained positions of an ordered tuple. -/ noncomputable def retainedTupleOccupancy {ι : Type*} [DecidableEq ι] {n : ℕ} (p : Fin n → ι) (s : Finset (Fin n)) : ι → ℕ := ∑ j ∈ s, Pi.single (p j) 1 /- Position products can be grouped by the species occupancy of the tuple. -/ theorem tuple_prod_eq_occupancy_prod {ι M : Type*} [Fintype ι] [DecidableEq ι] [CommMonoid M] {n : ℕ} (p : Fin n → ι) (z : ι → M) : (∏ j, z (p j)) = ∏ i, z i ^ tupleOccupancy p i := by rw [← Finset.prod_fiberwise' univ p z] simp only [Finset.prod_const, tupleOccupancy_apply] section variable {ι : Type*} [sharedInstance1 : Fintype ι] [sharedInstance2 : DecidableEq ι] {n : ℕ} (p : Fin n → ι) include ι sharedInstance1 sharedInstance2 n p /- The retention polynomial, expanded by retained positions and by species. -/ theorem retained_occupancy_generating_identity (A D : ι → ℝ) : (∑ s ∈ (univ : Finset (Fin n)).powerset, AddMonoidAlgebra.single (retainedTupleOccupancy p s) ((∏ j ∈ s, A (p j)) * ∏ j ∈ univ \ s, D (p j))) = ∑ k ∈ Fintype.piFinset (fun i => range (tupleOccupancy p i + 1)), AddMonoidAlgebra.single k (∏ i, (Nat.choose (tupleOccupancy p i) (k i) : ℝ) * A i ^ k i * D i ^ (tupleOccupancy p i - k i)) := by let z : ι → AddMonoidAlgebra ℝ (ι → ℕ) := fun i => AddMonoidAlgebra.single (Pi.single i 1) (A i) + AddMonoidAlgebra.single 0 (D i) have hpos : (∏ j, z (p j)) = ∑ s ∈ (univ : Finset (Fin n)).powerset, AddMonoidAlgebra.single (retainedTupleOccupancy p s) ((∏ j ∈ s, A (p j)) * ∏ j ∈ univ \ s, D (p j)) := by simp only [z, Finset.prod_add, AddMonoidAlgebra.prod_single, AddMonoidAlgebra.single_mul_single, Finset.sum_const_zero, add_zero, retainedTupleOccupancy] have hpow (i : ι) : z i ^ tupleOccupancy p i = ∑ k ∈ range (tupleOccupancy p i + 1), AddMonoidAlgebra.single (k • Pi.single i 1) ((Nat.choose (tupleOccupancy p i) k : ℝ) * A i ^ k * D i ^ (tupleOccupancy p i - k)) := by rw [show z i = _ from rfl, add_pow] apply Finset.sum_congr rfl intro k hk simp only [AddMonoidAlgebra.single_pow, nsmul_zero, AddMonoidAlgebra.single_mul_single, add_zero] rw [mul_comm, ← nsmul_eq_mul] simp [mul_assoc] rw [← hpos, tuple_prod_eq_occupancy_prod p z] simp_rw [hpow] rw [Finset.prod_univ_sum] apply Finset.sum_congr rfl intro k hk have hexp : (∑ i, k i • Pi.single i (1 : ℕ)) = k := by ext i simp [Finset.sum_apply, Pi.single_apply] simp only [AddMonoidAlgebra.prod_single, hexp] /- Group retained index subsets by occupancy. Repeated numerical species are allowed, and the test is an arbitrary function of the whole retained vector. -/ theorem sum_retained_eq_occupancy (A D : ι → ℝ) (F : (ι → ℕ) → ℝ) : (∑ s ∈ (univ : Finset (Fin n)).powerset, ((∏ j ∈ s, A (p j)) * ∏ j ∈ univ \ s, D (p j)) * F (retainedTupleOccupancy p s)) = ∑ k ∈ Fintype.piFinset (fun i => range (tupleOccupancy p i + 1)), (∏ i, (Nat.choose (tupleOccupancy p i) (k i) : ℝ) * A i ^ k i * D i ^ (tupleOccupancy p i - k i)) * F k := by let T : AddMonoidAlgebra ℝ (ι → ℕ) →+ ℝ := (Finsupp.liftAddHom (fun k => AddMonoidHom.mulRight (F k))).comp AddMonoidAlgebra.coeffAddEquiv.toAddMonoidHom have hT (k : ι → ℕ) (r : ℝ) : T (AddMonoidAlgebra.single k r) = r * F k := by simp [T] have h := congrArg T (retained_occupancy_generating_identity p A D) simpa only [map_sum, hT] using h /- Retain old positions, then append an ordered birth batch with its `1/b!` weight. The result is the exact coupled occupancy sum; births may repeat species. No positivity assumption or factorization of the output test is used. -/ theorem sum_retained_ordered_births_eq_occupancy (A D C ν : ι → ℝ) (b : ℕ) (F : (ι → ℕ) → ℝ) : (∑ s ∈ (univ : Finset (Fin n)).powerset, ((∏ j ∈ s, A (p j)) * ∏ j ∈ univ \ s, D (p j)) * ((∑ q : Fin b → ι, (∏ j, C (q j) * ν (q j)) * F (retainedTupleOccupancy p s + tupleOccupancy q)) / (b.factorial : ℝ))) = ∑ k ∈ Fintype.piFinset (fun i => range (tupleOccupancy p i + 1)), (∏ i, (Nat.choose (tupleOccupancy p i) (k i) : ℝ) * A i ^ k i * D i ^ (tupleOccupancy p i - k i)) * ∑ l ∈ (univ : Finset ι).piAntidiag b, (∏ i, (C i * ν i) ^ l i / ((l i).factorial : ℝ)) * F (k + l) := by rw [sum_retained_eq_occupancy p A D (fun k => (∑ q : Fin b → ι, (∏ j, C (q j) * ν (q j)) * F (k + tupleOccupancy q)) / (b.factorial : ℝ))] apply Finset.sum_congr rfl intro k hk congr 1 exact sum_tuple_div_factorial_eq_occupancy (fun i => C i * ν i) b (fun l => F (k + l)) end end section open Finset /- All occupancy vectors with total size at most `B`. -/ noncomputable def ghostOccupancyBall {ι : Type*} [Fintype ι] [DecidableEq ι] (B : ℕ) : Finset (ι → ℕ) := (range (B + 1)).biUnion (fun b => (univ : Finset ι).piAntidiag b) theorem mem_ghostOccupancyBall {ι : Type*} [Fintype ι] [DecidableEq ι] (B : ℕ) (m : ι → ℕ) : m ∈ ghostOccupancyBall B ↔ (∑ i, m i) ≤ B := by classical simp only [ghostOccupancyBall, mem_biUnion, mem_range, mem_piAntidiag, mem_univ, implies_true, and_true] constructor · rintro ⟨b, hb, hm⟩ exact hm ▸ Nat.le_of_lt_succ hb · intro hm exact ⟨∑ i, m i, by omega, rfl⟩ theorem sum_ghostOccupancyBall {ι : Type*} [Fintype ι] [DecidableEq ι] (B : ℕ) (f : (ι → ℕ) → ℝ) : (∑ b ∈ range (B + 1), ∑ m ∈ (univ : Finset ι).piAntidiag b, f m) = ∑ m ∈ ghostOccupancyBall B, f m := by classical unfold ghostOccupancyBall rw [sum_biUnion] intro b hb c hc hbc apply disjoint_left.mpr intro m hm hn exact hbc ((mem_piAntidiag.mp hm).1.symm.trans (mem_piAntidiag.mp hn).1) /- Translate births to total output occupancy, preserving the total cutoff. -/ theorem ghost_occupancy_translate_sum {ι : Type*} [Fintype ι] [DecidableEq ι] (B : ℕ) (k : ι → ℕ) (f : (ι → ℕ) → ℝ) : (∑ l ∈ ghostOccupancyBall B, if (∑ i, (k + l) i) ≤ B then f l else 0) = ∑ m ∈ ghostOccupancyBall B, if ∀ i, k i ≤ m i then f (m - k) else 0 := by classical rw [← sum_filter, ← sum_filter] apply sum_bij (fun l _ => k + l) · intro l hl rw [mem_filter] at hl ⊢ exact ⟨(mem_ghostOccupancyBall B _).mpr hl.2, fun i => Nat.le_add_right _ _⟩ · intro l hl l' hl' h exact add_left_cancel h · intro m hm rw [mem_filter] at hm have hsum : (∑ i, (m - k) i) ≤ B := (sum_le_sum (fun i _ => Nat.sub_le (m i) (k i))).trans ((mem_ghostOccupancyBall B m).mp hm.1) have heq : k + (m - k) = m := by ext i exact Nat.add_sub_of_le (hm.2 i) refine ⟨m - k, ?_, heq⟩ exact mem_filter.mpr ⟨(mem_ghostOccupancyBall B _).mpr hsum, by simpa only [heq] using (mem_ghostOccupancyBall B m).mp hm.1⟩ · intro l hl congr 1 ext i exact (Nat.add_sub_cancel_left (k i) (l i)).symm /- A finite vector version of birth-and-retention triangular reindexing. -/ theorem ghost_occupancy_triangular_sum {ι : Type*} [Fintype ι] [DecidableEq ι] (n : ι → ℕ) (B : ℕ) (f : (ι → ℕ) → (ι → ℕ) → ℝ) : (∑ k ∈ Fintype.piFinset (fun i => range (n i + 1)), ∑ l ∈ ghostOccupancyBall B, if (∑ i, (k + l) i) ≤ B then f k l else 0) = ∑ m ∈ ghostOccupancyBall B, ∑ k ∈ Fintype.piFinset (fun i => range (min (n i) (m i) + 1)), f k (m - k) := by classical simp_rw [ghost_occupancy_translate_sum] rw [sum_comm] apply sum_congr rfl intro m hm rw [← sum_filter] have hset : (Fintype.piFinset (fun i => range (n i + 1))).filter (fun k => ∀ i, k i ≤ m i) = Fintype.piFinset (fun i => range (min (n i) (m i) + 1)) := by ext k simp only [mem_filter, Fintype.mem_piFinset, mem_range, Nat.lt_succ_iff, le_min_iff] exact forall_and.symm rw [hset] /- Product coefficient for retaining `k` old particles of each species. -/ noncomputable def ghostRetainedCoefficient {ι : Type*} [Fintype ι] (n : ι → ℕ) (A D : ι → ℝ) (k : ι → ℕ) : ℝ := ∏ i, (Nat.choose (n i) (k i) : ℝ) * A i ^ k i * D i ^ (n i - k i) /- The ordered-birth factorial measure after grouping by species. -/ noncomputable def ghostBirthCoefficient {ι : Type*} [Fintype ι] (C ν : ι → ℝ) (l : ι → ℕ) : ℝ := ∏ i, (C i * ν i) ^ l i / ((l i).factorial : ℝ) theorem ghost_kernel_product_retained_births {ι : Type*} [Fintype ι] [DecidableEq ι] (n m : ι → ℕ) (A D C ν : ι → ℝ) : (∏ i, ghostKernel (A i) (D i) (C i) (ν i) (n i) (m i)) = ∑ k ∈ Fintype.piFinset (fun i => range (min (n i) (m i) + 1)), ghostRetainedCoefficient n A D k * ghostBirthCoefficient C ν (m - k) := by simp only [ghostKernel] rw [prod_univ_sum] apply sum_congr rfl intro k hk unfold ghostRetainedCoefficient ghostBirthCoefficient rw [← prod_mul_distrib] apply prod_congr rfl intro i hi simp only [Pi.sub_apply] ring /- Exact ordered-particle row with total output occupancy at most `B`. The birth-length sum only needs `b ≤ B`; rejected outputs have zero test value. -/ theorem ordered_ghost_row_eq_kernel_product {ι : Type*} [Fintype ι] [DecidableEq ι] {N : ℕ} (p : Fin N → ι) (A D C ν : ι → ℝ) (B : ℕ) (F : (ι → ℕ) → ℝ) : (∑ b ∈ range (B + 1), ∑ s ∈ (univ : Finset (Fin N)).powerset, ((∏ j ∈ s, A (p j)) * ∏ j ∈ univ \ s, D (p j)) * ((∑ q : Fin b → ι, (∏ j, C (q j) * ν (q j)) * (if (∑ i, (retainedTupleOccupancy p s + tupleOccupancy q) i) ≤ B then F (retainedTupleOccupancy p s + tupleOccupancy q) else 0)) / (b.factorial : ℝ))) = ∑ m ∈ ghostOccupancyBall B, (∏ i, ghostKernel (A i) (D i) (C i) (ν i) (tupleOccupancy p i) (m i)) * F m := by classical calc _ = ∑ b ∈ range (B + 1), ∑ k ∈ Fintype.piFinset (fun i => range (tupleOccupancy p i + 1)), ghostRetainedCoefficient (tupleOccupancy p) A D k * ∑ l ∈ (univ : Finset ι).piAntidiag b, ghostBirthCoefficient C ν l * (if (∑ i, (k + l) i) ≤ B then F (k + l) else 0) := by apply sum_congr rfl intro b hb exact sum_retained_ordered_births_eq_occupancy p A D C ν b (fun m => if (∑ i, m i) ≤ B then F m else 0) _ = ∑ k ∈ Fintype.piFinset (fun i => range (tupleOccupancy p i + 1)), ∑ l ∈ ghostOccupancyBall B, if (∑ i, (k + l) i) ≤ B then ghostRetainedCoefficient (tupleOccupancy p) A D k * ghostBirthCoefficient C ν l * F (k + l) else 0 := by rw [sum_comm] apply sum_congr rfl intro k hk simp_rw [mul_sum] rw [← sum_ghostOccupancyBall] apply sum_congr rfl intro b hb apply sum_congr rfl intro l hl split_ifs <;> ring _ = ∑ m ∈ ghostOccupancyBall B, ∑ k ∈ Fintype.piFinset (fun i => range (min (tupleOccupancy p i) (m i) + 1)), ghostRetainedCoefficient (tupleOccupancy p) A D k * ghostBirthCoefficient C ν (m - k) * F (k + (m - k)) := ghost_occupancy_triangular_sum (tupleOccupancy p) B _ _ = _ := by apply sum_congr rfl intro m hm rw [ghost_kernel_product_retained_births, sum_mul] apply sum_congr rfl intro k hk have hkm : k ≤ m := by intro i have h := (Fintype.mem_piFinset.mp hk) i simp only [mem_range, Nat.lt_succ_iff, le_min_iff] at h exact h.2 have heq : k + (m - k) = m := by ext i exact Nat.add_sub_of_le (hkm i) rw [heq] end section open Finset /- The actual ordered row, including repeated species and the birth `1/b!`. Each ordered event is tested only when its total output size is at most `B`. -/ noncomputable def complexOrderedGhostRow {ι : Type*} [Fintype ι] [DecidableEq ι] {N : ℕ} (p : Fin N → ι) (A D C ν : ι → ℝ) (B : ℕ) (F : (ι → ℕ) → ℂ) : ℂ := ∑ b ∈ range (B + 1), ∑ s ∈ (univ : Finset (Fin N)).powerset, ∑ q : Fin b → ι, ((((∏ j ∈ s, A (p j)) * ∏ j ∈ univ \ s, D (p j)) * (∏ j, C (q j) * ν (q j)) / (b.factorial : ℝ) : ℝ) : ℂ) * (if (∑ i, (retainedTupleOccupancy p s + tupleOccupancy q) i) ≤ B then F (retainedTupleOccupancy p s + tupleOccupancy q) else 0) theorem complex_ordered_ghost_row_eq_kernel_product {ι : Type*} [Fintype ι] [DecidableEq ι] {N : ℕ} (p : Fin N → ι) (A D C ν : ι → ℝ) (B : ℕ) (F : (ι → ℕ) → ℂ) : complexOrderedGhostRow p A D C ν B F = ∑ m ∈ ghostOccupancyBall B, ((∏ i, ghostKernel (A i) (D i) (C i) (ν i) (tupleOccupancy p i) (m i) : ℝ) : ℂ) * F m := by have hr (f : (ι → ℕ) → ℝ) : (∑ b ∈ range (B + 1), ∑ s ∈ (univ : Finset (Fin N)).powerset, ∑ q : Fin b → ι, (((∏ j ∈ s, A (p j)) * ∏ j ∈ univ \ s, D (p j)) * (∏ j, C (q j) * ν (q j)) / (b.factorial : ℝ)) * (if (∑ i, (retainedTupleOccupancy p s + tupleOccupancy q) i) ≤ B then f (retainedTupleOccupancy p s + tupleOccupancy q) else 0)) = ∑ m ∈ ghostOccupancyBall B, (∏ i, ghostKernel (A i) (D i) (C i) (ν i) (tupleOccupancy p i) (m i)) * f m := by simpa only [sum_div, mul_sum, div_mul_eq_mul_div, mul_div_assoc, mul_assoc] using ordered_ghost_row_eq_kernel_product p A D C ν B f apply Complex.ext · simpa only [complexOrderedGhostRow, Complex.re_sum, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, apply_ite, Complex.zero_re] using hr (fun m => (F m).re) · simpa only [complexOrderedGhostRow, Complex.im_sum, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, add_zero, apply_ite, Complex.zero_im] using hr (fun m => (F m).im) /- The total-size cutoff inside the existing bounded occupancy state space. -/ noncomputable def ghostBoundedTotalCutoff {ι : Type*} [Fintype ι] [DecidableEq ι] (B : ℕ) : Finset (ι → Fin (B + 1)) := univ.filter (fun x => (∑ i, (x i : ℕ)) ≤ B) /- Extend a bounded occupancy test by zero outside its coordinate box. -/ noncomputable def ghostBoundedTest {ι : Type*} [Fintype ι] (B : ℕ) (f : (ι → Fin (B + 1)) → ℂ) (m : ι → ℕ) : ℂ := if h : ∀ i, m i ≤ B then f (fun i => ⟨m i, Nat.lt_succ_of_le (h i)⟩) else 0 theorem ghostBoundedTest_coe {ι : Type*} [Fintype ι] (B : ℕ) (f : (ι → Fin (B + 1)) → ℂ) (x : ι → Fin (B + 1)) : ghostBoundedTest B f (fun i => (x i : ℕ)) = f x := by unfold ghostBoundedTest rw [dif_pos (fun i => Nat.le_of_lt_succ (x i).isLt)] /- Natural occupancy vectors in the total-size ball give exactly the same kernel row as bounded `Fin` occupancies in `ghostMemoryAction`. -/ theorem ghost_nat_row_eq_memory_action {ι : Type*} [Fintype ι] [DecidableEq ι] (B : ℕ) (A D C ν : ι → ℝ) (f : (ι → Fin (B + 1)) → ℂ) (x : ι → Fin (B + 1)) : (∑ m ∈ ghostOccupancyBall B, ((∏ i, ghostKernel (A i) (D i) (C i) (ν i) (x i) (m i) : ℝ) : ℂ) * ghostBoundedTest B f m) = ghostMemoryAction (ghostBoundedTotalCutoff B) A D C ν f x := by classical symm unfold ghostMemoryAction apply sum_bij (fun y _ => fun i => (y i : ℕ)) · intro y hy apply (mem_ghostOccupancyBall B _).mpr simpa only [ghostBoundedTotalCutoff, mem_filter, mem_univ, true_and] using hy · intro y hy z hz heq funext i exact Fin.ext (congrFun heq i) · intro m hm have htotal := (mem_ghostOccupancyBall B m).mp hm have hbound (i : ι) : m i ≤ B := (single_le_sum (fun j _ => Nat.zero_le (m j)) (mem_univ i)).trans htotal let y : ι → Fin (B + 1) := fun i => ⟨m i, Nat.lt_succ_of_le (hbound i)⟩ refine ⟨y, ?_, rfl⟩ simpa only [ghostBoundedTotalCutoff, mem_filter, mem_univ, true_and] using htotal · intro y hy rw [ghostBoundedTest_coe] simp only [ghostMemoryKernel, Complex.ofReal_prod] /- A canonical ordered representative of a bounded occupancy vector. -/ noncomputable def ghostOccupancyTuple {ι : Type*} [Fintype ι] {B : ℕ} (x : ι → Fin (B + 1)) : Fin (Fintype.card (Σ i, Fin (x i : ℕ))) → ι := fun j => ((Fintype.equivFin (Σ i, Fin (x i : ℕ))).symm j).1 theorem ghostOccupancyTuple_occupancy {ι : Type*} [Fintype ι] [DecidableEq ι] {B : ℕ} (x : ι → Fin (B + 1)) : tupleOccupancy (ghostOccupancyTuple x) = fun i => (x i : ℕ) := by unfold tupleOccupancy ghostOccupancyTuple rw [(Fintype.equivFin (Σ i, Fin (x i : ℕ))).symm.sum_comp (fun a : Σ i, Fin (x i : ℕ) => (Pi.single a.1 1 : ι → ℕ))] rw [Fintype.sum_sigma] ext i simp [Finset.sum_apply, Pi.single_apply] end section open Finset end section open Finset end section open Finset noncomputable def distinctBirthRange {P : Type*} {b : ℕ} (f : Fin b ↪ P) : Finset P := univ.map f theorem distinct_birth_range_equiv {P : Type*} {b : ℕ} (B : Finset P) (e : Fin b ≃ B) : distinctBirthRange (distinctOrderedSupportOfEquiv e).val = B := by classical ext p simp only [distinctBirthRange, mem_map, mem_univ, true_and] exact ((distinctOrderedSupportOfEquiv e).property p).symm /- Classify every actual distinct ordered tuple by its image and enumeration. -/ noncomputable def distinctBirthSupportEquiv (P : Type*) (b : ℕ) : (Σ B : Finset P, Fin b ≃ B) ≃ (Fin b ↪ P) := Equiv.ofBijective (fun z => (distinctOrderedSupportOfEquiv z.2).val) (by classical constructor · rintro ⟨B, e⟩ ⟨C, f⟩ h change (distinctOrderedSupportOfEquiv e).val = (distinctOrderedSupportOfEquiv f).val at h have hBC : B = C := by rw [← distinct_birth_range_equiv B e, ← distinct_birth_range_equiv C f, h] subst C have hef : e = f := by ext j exact congrArg (fun g : Fin b ↪ P => g j) h subst f rfl · intro f let g : DistinctOrderedSupport (Fin b) (distinctBirthRange f) := ⟨f, by intro p simp only [distinctBirthRange, mem_map, mem_univ, true_and]⟩ refine ⟨⟨distinctBirthRange f, distinctOrderedSupportAsEquiv g⟩, ?_⟩ ext j rfl) /- At a fixed length, the normalized injective-tuple sum selects supports of exactly that cardinality. -/ theorem distinct_birth_fixed_length_sum {P : Type*} [Fintype P] [DecidableEq P] (b : ℕ) (w : P → ℝ) (F : Finset P → ℝ) : (∑ f : Fin b ↪ P, (∏ j, w (f j)) * F (distinctBirthRange f)) / (b.factorial : ℝ) = ∑ B : Finset P, if B.card = b then (∏ p ∈ B, w p) * F B else 0 := by classical rw [← (distinctBirthSupportEquiv P b).sum_comp] rw [Fintype.sum_sigma, sum_div] apply sum_congr rfl intro B _ have hterm (e : Fin b ≃ B) : (∏ j, w ((distinctOrderedSupportOfEquiv e).val j)) * F (distinctBirthRange (distinctOrderedSupportOfEquiv e).val) = (∏ p ∈ B, w p) * F B := by rw [distinct_birth_range_equiv] congr 1 calc _ = ∏ p : B, w p.val := e.prod_comp (fun p : B => w p.val) _ = _ := prod_coe_sort B w change (∑ e : Fin b ≃ B, (∏ j, w ((distinctOrderedSupportOfEquiv e).val j)) * F (distinctBirthRange (distinctOrderedSupportOfEquiv e).val)) / _ = _ simp_rw [hterm] by_cases hB : B.card = b · have hcard : Fintype.card (Fin b ≃ B) = b.factorial := by have hsz : Fintype.card (Fin b) = Fintype.card B := by simpa using hB.symm simpa only [Fintype.card_fin] using Fintype.card_equiv (Fintype.equivOfCardEq hsz) simp only [hB, if_true, sum_const, card_univ, nsmul_eq_mul, hcard] exact mul_div_cancel_left₀ _ (Nat.cast_ne_zero.mpr (Nat.factorial_ne_zero b)) · have he : IsEmpty (Fin b ≃ B) := ⟨fun e => hB (by simpa only [Fintype.card_coe, Fintype.card_fin] using (Fintype.card_congr e).symm)⟩ simp [hB] /- Sum all actual distinct tuples up to the pool size. The only factorial is the new-batch factorial, and an arbitrary support-dependent test is retained. -/ theorem distinct_birth_batch_sum {P : Type*} [Fintype P] [DecidableEq P] (w : P → ℝ) (F : Finset P → ℝ) : (∑ b ∈ range (Fintype.card P + 1), (∑ f : Fin b ↪ P, (∏ j, w (f j)) * F (distinctBirthRange f)) / (b.factorial : ℝ)) = ∑ B : Finset P, (∏ p ∈ B, w p) * F B := by simp_rw [distinct_birth_fixed_length_sum] rw [sum_comm] apply sum_congr rfl intro B _ have hB : B.card ∈ range (Fintype.card P + 1) := by simp only [mem_range] exact Nat.lt_succ_of_le (card_le_univ B) simp [hB] /- The measured birth coefficient cancels the pool mass exactly. -/ theorem distinct_birth_measured_coefficient (η V ρ β : ℝ) (hV : V ≠ 0) : (-η * V / ρ) * (β / V) = -β * η / ρ := by field_simp /- Subsets of a finite subtype are exactly subsets of the original finite pool. -/ theorem distinct_birth_subtype_subsets {P : Type*} [DecidableEq P] (U : Finset P) (F : Finset P → ℝ) : (∑ B : Finset U, F (B.map (Function.Embedding.subtype (fun p => p ∈ U)))) = ∑ B ∈ U.powerset, F B := by classical apply sum_bij (fun B _ => B.map (Function.Embedding.subtype (fun p => p ∈ U))) · intro B _ apply mem_powerset.mpr intro p hp exact property_of_mem_map_subtype B hp · intro B _ C _ h exact map_injective _ h · intro B hB refine ⟨B.subtype (fun p => p ∈ U), mem_univ _, ?_⟩ exact subtype_map_of_mem (fun p hp => mem_powerset.mp hB hp) · intro B _ rfl /- Actual distinct tuples range over the unborn pool, while the continuation may depend arbitrarily on their support in the original label type. -/ theorem distinct_birth_pool_sum {P : Type*} [DecidableEq P] (U : Finset P) (w : P → ℝ) (F : Finset P → ℝ) : (∑ b ∈ range (U.card + 1), (∑ f : Fin b ↪ U, (∏ j, w (f j).val) * F ((distinctBirthRange f).map (Function.Embedding.subtype (fun p => p ∈ U)))) / (b.factorial : ℝ)) = ∑ B ∈ U.powerset, (∏ p ∈ B, w p) * F B := by classical calc _ = ∑ B : Finset U, (∏ p ∈ B, w p.val) * F (B.map (Function.Embedding.subtype (fun p => p ∈ U))) := by simpa only [Fintype.card_coe] using distinct_birth_batch_sum (fun p : U => w p.val) (fun B => F (B.map (Function.Embedding.subtype (fun p => p ∈ U)))) _ = ∑ B : Finset U, (∏ p ∈ B.map (Function.Embedding.subtype (fun p => p ∈ U)), w p) * F (B.map (Function.Embedding.subtype (fun p => p ∈ U))) := by simp only [prod_map, Function.Embedding.coe_subtype] _ = _ := distinct_birth_subtype_subsets U (fun B => (∏ p ∈ B, w p) * F B) /- The common row birth coefficient and the product prime measure agree with the concrete birth coefficients at every actual ordered tuple. -/ theorem distinct_birth_measured_product {P : Type*} (β : P → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (b : ℕ) (f : Fin b → P) : (-η * V / ρ) ^ b * (∏ j, β (f j) / V) = ∏ j, -β (f j) * η / ρ := by calc _ = ∏ j : Fin b, (-η * V / ρ) * (β (f j) / V) := by rw [prod_mul_distrib] simp only [prod_const, card_univ, Fintype.card_fin] _ = _ := by simp_rw [distinct_birth_measured_coefficient η V ρ _ hV] /- Measured varying-length distinct-birth integration equals the concrete support sum. This retains any coupled continuation as a function of the new support. -/ theorem distinct_birth_measured_pool_sum {P : Type*} [DecidableEq P] (U : Finset P) (β : P → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (F : Finset P → ℝ) : (∑ b ∈ range (U.card + 1), (∑ f : Fin b ↪ U, ((-η * V / ρ) ^ b * (∏ j, β (f j).val / V)) * F ((distinctBirthRange f).map (Function.Embedding.subtype (fun p => p ∈ U)))) / (b.factorial : ℝ)) = ∑ B ∈ U.powerset, (∏ p ∈ B, -β p * η / ρ) * F B := by simp_rw [distinct_birth_measured_product β η V ρ hV] exact distinct_birth_pool_sum U (fun p => -β p * η / ρ) F /- The actual chronological visit action is the measured distinct-birth batch integral. Old-memory terminations retain their separate coefficients; new births are actual injective tuples in the unborn pool at the fixed hit. -/ theorem ghost_phase_transition_measured_births {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (a : I → Bool) (h : (i : I) → R i) (β : I → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (y : (i : I) → GhostPhaseState (R i)) (hy : ghostPhaseMask a y) (F : ((i : I) → GhostPhaseState (R i)) → ℝ) : (∑ x, (∏ i, ghostPhaseDampedVisit (a i) (h i) η (β i) ρ (x i) (y i)) * F x) = ∑ A ∈ (ghostVisitDeaths a h y).powerset, ((∏ _i ∈ A, -η / ρ) * (∏ _i ∈ ghostVisitDeaths a h y \ A, (1 - η) / ρ ^ 2)) * (∑ b ∈ range ((ghostVisitBirths a y).card + 1), (∑ f : Fin b ↪ ghostVisitBirths a y, ((-η * V / ρ) ^ b * (∏ j, β (f j).val / V)) * F (ghostVisitBatchOutput h y A ((distinctBirthRange f).map (Function.Embedding.subtype (fun p => p ∈ ghostVisitBirths a y))))) / (b.factorial : ℝ)) := by rw [ghost_phase_transition_batches a h (fun _ => η) β (fun _ => ρ) y hy F] apply sum_congr rfl intro A _ rw [distinct_birth_measured_pool_sum (ghostVisitBirths a y) β η V ρ hV (fun B => F (ghostVisitBatchOutput h y A B))] simp only [ghostVisitBatchWeight, mul_sum, mul_assoc] end section open Finset theorem tuple_occupancy_total {I : Type*} [Fintype I] [DecidableEq I] {n : ℕ} (p : Fin n → I) : (∑ i, tupleOccupancy p i) = n := by simp only [tupleOccupancy, Finset.sum_apply] rw [sum_comm] simp [Pi.single_apply] theorem tuple_occupancy_permutation {I : Type*} [DecidableEq I] {n : ℕ} (p q : Fin n → I) (hpq : tupleOccupancy p = tupleOccupancy q) : ∃ e : Equiv.Perm (Fin n), ∀ j, q (e j) = p j := by classical have hc (i : I) : Fintype.card {j : Fin n // p j = i} = Fintype.card {j : Fin n // q j = i} := by simpa only [Fintype.card_subtype, ← tupleOccupancy_apply] using congrFun hpq i let e : ∀ i, {j : Fin n // p j = i} ≃ {j : Fin n // q j = i} := fun i => Fintype.equivOfCardEq (hc i) exact ⟨Equiv.ofFiberEquiv e, Equiv.ofFiberEquiv_map e⟩ abbrev FiniteOrderedTuple (I : Type*) := Σ n : ℕ, Fin n → I noncomputable def orderedTupleOccupancy {I : Type*} [DecidableEq I] (p : FiniteOrderedTuple I) : I → ℕ := tupleOccupancy p.2 def OrderedTupleSymmetric {I K : Type*} (F : FiniteOrderedTuple I → K) : Prop := ∀ n (p : Fin n → I) (e : Equiv.Perm (Fin n)), F ⟨n, p ∘ e⟩ = F ⟨n, p⟩ theorem symmetric_tuple_equal_on_occupancy {I K : Type*} [Fintype I] [DecidableEq I] (F : FiniteOrderedTuple I → K) (hF : OrderedTupleSymmetric F) (p q : FiniteOrderedTuple I) (hpq : orderedTupleOccupancy p = orderedTupleOccupancy q) : F p = F q := by rcases p with ⟨n,p⟩ rcases q with ⟨m,q⟩ have hnm : n = m := by rw [← tuple_occupancy_total p, ← tuple_occupancy_total q] exact congrArg (fun k : I → ℕ => ∑ i, k i) hpq subst m obtain ⟨e,he⟩ := tuple_occupancy_permutation p q hpq have hfun : p = q ∘ e := by funext j; exact (he j).symm rw [hfun] exact hF n q e noncomputable def symmetricOccupancyFunction {I K : Type*} [DecidableEq I] [Zero K] (F : FiniteOrderedTuple I → K) (k : I → ℕ) : K := by classical exact if hk : ∃ p : FiniteOrderedTuple I, orderedTupleOccupancy p = k then F (Classical.choose hk) else 0 theorem symmetric_occupancy_function_apply {I K : Type*} [Fintype I] [DecidableEq I] [Zero K] (F : FiniteOrderedTuple I → K) (hF : OrderedTupleSymmetric F) (p : FiniteOrderedTuple I) : symmetricOccupancyFunction F (orderedTupleOccupancy p) = F p := by classical have hp : ∃ q : FiniteOrderedTuple I, orderedTupleOccupancy q = orderedTupleOccupancy p := ⟨p,rfl⟩ simp only [symmetricOccupancyFunction, dif_pos hp] exact symmetric_tuple_equal_on_occupancy F hF _ p (Classical.choose_spec hp) /- The factorial memory measure formula applies to any symmetric ordered test, not only to functions originally supplied in occupancy form. -/ theorem symmetric_ordered_measure_eq_occupancy {I : Type*} [Fintype I] [DecidableEq I] (ν : I → ℝ) (F : FiniteOrderedTuple I → ℝ) (hF : OrderedTupleSymmetric F) (n : ℕ) : (∑ p : Fin n → I, (∏ j, ν (p j)) * F ⟨n,p⟩) / (n.factorial : ℝ) = ∑ k ∈ (univ : Finset I).piAntidiag n, (∏ i, ν i ^ k i / ((k i).factorial : ℝ)) * symmetricOccupancyFunction F k := by have h := sum_tuple_div_factorial_eq_occupancy ν n (symmetricOccupancyFunction F) have hp (p : Fin n → I) : symmetricOccupancyFunction F (tupleOccupancy p) = F ⟨n,p⟩ := symmetric_occupancy_function_apply F hF ⟨n,p⟩ simpa only [hp] using h end section open Finset theorem symmetric_occupancy_norm_sq {I : Type*} [DecidableEq I] (F : FiniteOrderedTuple I → ℂ) (k : I → ℕ) : symmetricOccupancyFunction (fun p => ‖F p‖ ^ 2) k = ‖symmetricOccupancyFunction F k‖ ^ 2 := by classical unfold symmetricOccupancyFunction split_ifs <;> simp theorem symmetric_ordered_l2_measure_eq_occupancy {I : Type*} [Fintype I] [DecidableEq I] (ν : I → ℝ) (F : FiniteOrderedTuple I → ℂ) (hF : OrderedTupleSymmetric F) (n : ℕ) : (∑ p : Fin n → I, (∏ j, ν (p j)) * ‖F ⟨n,p⟩‖ ^ 2) / (n.factorial : ℝ) = ∑ k ∈ (univ : Finset I).piAntidiag n, (∏ i, ν i ^ k i / ((k i).factorial : ℝ)) * ‖symmetricOccupancyFunction F k‖ ^ 2 := by have hnorm : OrderedTupleSymmetric (fun p => ‖F p‖ ^ 2) := by intro m p e exact congrArg (fun z : ℂ => ‖z‖ ^ 2) (hF m p e) have h := symmetric_ordered_measure_eq_occupancy ν (fun p => ‖F p‖ ^ 2) hnorm n simpa only [symmetric_occupancy_norm_sq] using h theorem symmetric_ordered_l2_cutoff_eq_occupancy {I : Type*} [Fintype I] [DecidableEq I] (ν : I → ℝ) (F : FiniteOrderedTuple I → ℂ) (hF : OrderedTupleSymmetric F) (B : ℕ) : (∑ n ∈ range (B + 1), (∑ p : Fin n → I, (∏ j, ν (p j)) * ‖F ⟨n,p⟩‖ ^ 2) / (n.factorial : ℝ)) = ∑ k ∈ ghostOccupancyBall (ι := I) B, (∏ i, ν i ^ k i / ((k i).factorial : ℝ)) * ‖symmetricOccupancyFunction F k‖ ^ 2 := by simp_rw [symmetric_ordered_l2_measure_eq_occupancy ν F hF] exact sum_ghostOccupancyBall B _ theorem ghost_occupancy_ball_sum_bounded {I M : Type*} [Fintype I] [DecidableEq I] [AddCommMonoid M] (B : ℕ) (F : (I → ℕ) → M) : (∑ m ∈ ghostOccupancyBall B, F m) = ∑ x ∈ ghostBoundedTotalCutoff B, F (fun i => (x i : ℕ)) := by classical symm apply sum_bij (fun x _ => fun i => (x i : ℕ)) · intro x hx apply (mem_ghostOccupancyBall B _).mpr simpa only [ghostBoundedTotalCutoff, mem_filter, mem_univ, true_and] using hx · intro x hx y hy hxy funext i exact Fin.ext (congrFun hxy i) · intro m hm have htotal := (mem_ghostOccupancyBall B m).mp hm have hbound (i : I) : m i ≤ B := (single_le_sum (fun j _ => Nat.zero_le (m j)) (mem_univ i)).trans htotal let x : I → Fin (B + 1) := fun i => ⟨m i, Nat.lt_succ_of_le (hbound i)⟩ refine ⟨x, ?_, rfl⟩ simpa only [ghostBoundedTotalCutoff, mem_filter, mem_univ, true_and] using htotal · intro x hx rfl /- The literal symmetric ordered-list norm is exactly the existing bounded occupancy norm used by the ghost-memory operator theorem. -/ theorem symmetric_ordered_l2_cutoff_eq_bounded {I : Type*} [Fintype I] [DecidableEq I] (ν : I → ℝ) (F : FiniteOrderedTuple I → ℂ) (hF : OrderedTupleSymmetric F) (B : ℕ) : (∑ n ∈ range (B + 1), (∑ p : Fin n → I, (∏ j, ν (p j)) * ‖F ⟨n,p⟩‖ ^ 2) / (n.factorial : ℝ)) = ∑ x ∈ ghostBoundedTotalCutoff B, ghostMemoryWeight ν x * ‖symmetricOccupancyFunction F (fun i => (x i : ℕ))‖ ^ 2 := by rw [symmetric_ordered_l2_cutoff_eq_occupancy ν F hF B, ghost_occupancy_ball_sum_bounded] rfl end section open Finset /- Enumerate the retained old indices; the symmetric test makes the choice of enumeration immaterial. This need not preserve their original order. -/ noncomputable def retainedOrderedTuple {ι : Type*} {N : ℕ} (p : Fin N → ι) (s : Finset (Fin N)) : Fin s.card → ι := fun j => p ((s.equivFin.symm j).val) theorem retained_ordered_tuple_occupancy {ι : Type*} [DecidableEq ι] {N : ℕ} (p : Fin N → ι) (s : Finset (Fin N)) : tupleOccupancy (retainedOrderedTuple p s) = retainedTupleOccupancy p s := by unfold tupleOccupancy retainedOrderedTuple retainedTupleOccupancy rw [s.equivFin.symm.sum_comp (fun j : s => (Pi.single (p j.val) 1 : ι → ℕ))] exact sum_coe_sort s (fun j => (Pi.single (p j) 1 : ι → ℕ)) theorem tuple_occupancy_append {ι : Type*} [DecidableEq ι] {m n : ℕ} (p : Fin m → ι) (q : Fin n → ι) : tupleOccupancy (Fin.addCases p q) = tupleOccupancy p + tupleOccupancy q := by unfold tupleOccupancy rw [Fin.sum_univ_add] simp only [Fin.addCases_left, Fin.addCases_right] /- The actual output list for one retention-and-birth event. -/ noncomputable def retainedBirthTuple {ι : Type*} {N b : ℕ} (p : Fin N → ι) (s : Finset (Fin N)) (q : Fin b → ι) : FiniteOrderedTuple ι := ⟨s.card + b, Fin.addCases (retainedOrderedTuple p s) q⟩ theorem retained_birth_tuple_occupancy {ι : Type*} [DecidableEq ι] {N b : ℕ} (p : Fin N → ι) (s : Finset (Fin N)) (q : Fin b → ι) : orderedTupleOccupancy (retainedBirthTuple p s q) = retainedTupleOccupancy p s + tupleOccupancy q := by exact (tuple_occupancy_append (retainedOrderedTuple p s) q).trans (congrArg (fun k => k + tupleOccupancy q) (retained_ordered_tuple_occupancy p s)) theorem retained_birth_tuple_total {ι : Type*} [Fintype ι] [DecidableEq ι] {N b : ℕ} (p : Fin N → ι) (s : Finset (Fin N)) (q : Fin b → ι) : (∑ i, (retainedTupleOccupancy p s + tupleOccupancy q) i) = s.card + b := by rw [← retained_birth_tuple_occupancy] exact tuple_occupancy_total (retainedBirthTuple p s q).2 theorem symmetric_retained_birth_test {ι : Type*} [Fintype ι] [DecidableEq ι] {N b : ℕ} (F : FiniteOrderedTuple ι → ℂ) (hF : OrderedTupleSymmetric F) (p : Fin N → ι) (s : Finset (Fin N)) (q : Fin b → ι) : F (retainedBirthTuple p s q) = symmetricOccupancyFunction F (retainedTupleOccupancy p s + tupleOccupancy q) := by rw [← retained_birth_tuple_occupancy] exact (symmetric_occupancy_function_apply F hF (retainedBirthTuple p s q)).symm /- The literal ordered ghost row. Outputs are retained old entries followed by the ordered birth batch; the cutoff is their actual list length. -/ noncomputable def symmetricOrderedGhostRow {ι : Type*} [Fintype ι] [DecidableEq ι] {N : ℕ} (p : Fin N → ι) (A D C ν : ι → ℝ) (B : ℕ) (F : FiniteOrderedTuple ι → ℂ) : ℂ := ∑ b ∈ range (B + 1), ∑ s ∈ (univ : Finset (Fin N)).powerset, ∑ q : Fin b → ι, ((((∏ j ∈ s, A (p j)) * ∏ j ∈ univ \ s, D (p j)) * (∏ j, C (q j) * ν (q j)) / (b.factorial : ℝ) : ℝ) : ℂ) * (if s.card + b ≤ B then F (retainedBirthTuple p s q) else 0) section variable {ι : Type*} [sharedInstance1 : Fintype ι] [sharedInstance2 : DecidableEq ι] {N : ℕ} (p : Fin N → ι) (A D C ν : ι → ℝ) (B : ℕ) (F : FiniteOrderedTuple ι → ℂ) (hF : OrderedTupleSymmetric F) include ι sharedInstance1 sharedInstance2 N p A D C ν B F hF theorem symmetric_ordered_ghost_row_eq_occupancy_row : symmetricOrderedGhostRow p A D C ν B F = complexOrderedGhostRow p A D C ν B (symmetricOccupancyFunction F) := by unfold symmetricOrderedGhostRow complexOrderedGhostRow simp_rw [symmetric_retained_birth_test F hF, retained_birth_tuple_total] theorem symmetric_ordered_ghost_row_eq_kernel_product : symmetricOrderedGhostRow p A D C ν B F = ∑ m ∈ ghostOccupancyBall B, ((∏ i, ghostKernel (A i) (D i) (C i) (ν i) (tupleOccupancy p i) (m i) : ℝ) : ℂ) * symmetricOccupancyFunction F m := by rw [symmetric_ordered_ghost_row_eq_occupancy_row p A D C ν B F hF] exact complex_ordered_ghost_row_eq_kernel_product p A D C ν B _ end /- An occupancy test lifted to the bounded state space agrees with its bounded extension at every output in the total-size ball. -/ theorem ghostBoundedTest_lift_of_total {ι : Type*} [Fintype ι] (B : ℕ) (G : (ι → ℕ) → ℂ) (m : ι → ℕ) (hm : (∑ i, m i) ≤ B) : ghostBoundedTest B (fun x => G (fun i => (x i : ℕ))) m = G m := by have hi (i : ι) : m i ≤ B := (single_le_sum (fun j _ => Nat.zero_le (m j)) (mem_univ i)).trans hm unfold ghostBoundedTest rw [dif_pos hi] theorem symmetric_ordered_ghost_row_eq_memory_action {ι : Type*} [Fintype ι] [DecidableEq ι] {N : ℕ} (p : Fin N → ι) (A D C ν : ι → ℝ) (B : ℕ) (F : FiniteOrderedTuple ι → ℂ) (hF : OrderedTupleSymmetric F) (x : ι → Fin (B + 1)) (hp : tupleOccupancy p = fun i => (x i : ℕ)) : symmetricOrderedGhostRow p A D C ν B F = ghostMemoryAction (ghostBoundedTotalCutoff B) A D C ν (fun y => symmetricOccupancyFunction F (fun i => (y i : ℕ))) x := by rw [symmetric_ordered_ghost_row_eq_kernel_product p A D C ν B F hF, hp, ← ghost_nat_row_eq_memory_action] apply sum_congr rfl intro m hm rw [ghostBoundedTest_lift_of_total B _ m ((mem_ghostOccupancyBall B m).mp hm)] /- The row depends on the old ordered tuple only through its occupancy. -/ theorem symmetric_ordered_ghost_row_occupancy_congr {ι : Type*} [Fintype ι] [DecidableEq ι] {N M : ℕ} (p : Fin N → ι) (q : Fin M → ι) (A D C ν : ι → ℝ) (B : ℕ) (F : FiniteOrderedTuple ι → ℂ) (hF : OrderedTupleSymmetric F) (hpq : tupleOccupancy p = tupleOccupancy q) : symmetricOrderedGhostRow p A D C ν B F = symmetricOrderedGhostRow q A D C ν B F := by rw [symmetric_ordered_ghost_row_eq_kernel_product p A D C ν B F hF, symmetric_ordered_ghost_row_eq_kernel_product q A D C ν B F hF, hpq] /- The event-level row as a function on all finite ordered input tuples. -/ noncomputable def symmetricOrderedGhostOperator {ι : Type*} [Fintype ι] [DecidableEq ι] (A D C ν : ι → ℝ) (B : ℕ) (F : FiniteOrderedTuple ι → ℂ) (p : FiniteOrderedTuple ι) : ℂ := symmetricOrderedGhostRow p.2 A D C ν B F theorem symmetric_ordered_ghost_operator_symmetric {ι : Type*} [Fintype ι] [DecidableEq ι] (A D C ν : ι → ℝ) (B : ℕ) (F : FiniteOrderedTuple ι → ℂ) (hF : OrderedTupleSymmetric F) : OrderedTupleSymmetric (symmetricOrderedGhostOperator A D C ν B F) := by intro n p e apply symmetric_ordered_ghost_row_occupancy_congr (p ∘ e) p A D C ν B F hF exact Equiv.sum_comp e (fun j => (Pi.single (p j) 1 : ι → ℕ)) end section open Finset /- On bounded occupancies, the descended literal ordered operator is the existing ghost-memory action on the descended input function. -/ theorem symmetric_ghost_operator_occupancy_action {ι : Type*} [Fintype ι] [DecidableEq ι] (A D C ν : ι → ℝ) (B : ℕ) (F : FiniteOrderedTuple ι → ℂ) (hF : OrderedTupleSymmetric F) (x : ι → Fin (B + 1)) : symmetricOccupancyFunction (symmetricOrderedGhostOperator A D C ν B F) (fun i => (x i : ℕ)) = ghostMemoryAction (ghostBoundedTotalCutoff B) A D C ν (fun y => symmetricOccupancyFunction F (fun i => (y i : ℕ))) x := by let p : FiniteOrderedTuple ι := ⟨_, ghostOccupancyTuple x⟩ have hp : orderedTupleOccupancy p = fun i => (x i : ℕ) := ghostOccupancyTuple_occupancy x calc _ = symmetricOrderedGhostOperator A D C ν B F p := by rw [← hp] exact symmetric_occupancy_function_apply _ (symmetric_ordered_ghost_operator_symmetric A D C ν B F hF) p _ = _ := symmetric_ordered_ghost_row_eq_memory_action p.2 A D C ν B F hF x hp /- The actual symmetric ordered-list ghost operator obeys the ghost Schur bound. Repetitions are permitted, the cutoff is total list length, and the factorial denominator is the ordered-list measure on both sides. -/ theorem symmetric_ordered_ghost_l2_sq_le {ι : Type*} [Fintype ι] [DecidableEq ι] (A D C ν v : ι → ℝ) (B : ℕ) (hA : ∀ i, 0 ≤ A i) (hν : ∀ i, 0 < ν i) (hv : ∀ i, 0 < v i) (hD : ∀ i, A i + |D i| / v i ≤ 1) (hC : ∀ i, A i + |C i| / v i ≤ 1) (F : FiniteOrderedTuple ι → ℂ) (hF : OrderedTupleSymmetric F) : (∑ n ∈ range (B + 1), (∑ p : Fin n → ι, (∏ j, ν (p j)) * ‖symmetricOrderedGhostOperator A D C ν B F ⟨n, p⟩‖ ^ 2) / (n.factorial : ℝ)) ≤ Real.exp (∑ i, (|C i| + |D i|) * ν i * v i) * ∑ n ∈ range (B + 1), (∑ p : Fin n → ι, (∏ j, ν (p j)) * ‖F ⟨n, p⟩‖ ^ 2) / (n.factorial : ℝ) := by rw [symmetric_ordered_l2_cutoff_eq_bounded ν _ (symmetric_ordered_ghost_operator_symmetric A D C ν B F hF) B, symmetric_ordered_l2_cutoff_eq_bounded ν F hF B] simp_rw [symmetric_ghost_operator_occupancy_action A D C ν B F hF] exact ghostMemory_l2_sq_le (ghostBoundedTotalCutoff B) A D C ν v hA hν hv hD hC (fun x => symmetricOccupancyFunction F (fun i => (x i : ℕ))) end section open Finset open scoped BigOperators Classical /- The fixed final block of omission slots. -/ def physicalOmissionSlots (J ell : ℕ) : Finset (PhysicalSlots J ell) := univ.map Function.Embedding.inr theorem physical_omission_slots_card (J ell : ℕ) : (physicalOmissionSlots J ell).card = ell := by simp only [physicalOmissionSlots, card_map, card_univ, Fintype.card_fin] end section open Filter Finset open scoped Topology theorem eventually_log_times_rpow_lt {a b : ℝ} (hab : a < b) (D : ℝ) : ∀ᶠ L : ℝ in atTop, D * L ^ a * Real.log L < L ^ b := by have h := ((isLittleO_log_rpow_atTop (sub_pos.mpr hab)).const_mul_left D).bound (show (0 : ℝ) < 1 / 2 by norm_num) filter_upwards [h, eventually_gt_atTop (0 : ℝ)] with L hL hpos have hp : 0 < L ^ (b - a) := Real.rpow_pos_of_pos hpos _ have ht : D * Real.log L < L ^ (b - a) := by have hn : D * Real.log L ≤ ‖D * Real.log L‖ := le_abs_self _ simp only [Real.norm_eq_abs, abs_of_pos hp] at hL hn linarith have hm := mul_lt_mul_of_pos_left ht (Real.rpow_pos_of_pos hpos a) have he : L ^ a * L ^ (b - a) = L ^ b := by rw [← Real.rpow_add hpos] congr 1 ring rw [he] at hm nlinarith /- Products with ell factors from each of logarithmically many small groups are eventually below the lower endpoint of a separated big group. -/ theorem eventually_small_omission_power_lt {a b : ℝ} (hab : a < b) (ell : ℕ) (C : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ s : ℕ, (s : ℝ) ≤ C * Real.log L → (Real.exp (L ^ a)) ^ (ell * s) < Real.exp (L ^ b) := by filter_upwards [eventually_log_times_rpow_lt hab ((ell : ℝ) * C), eventually_gt_atTop (0 : ℝ)] with L hL hpos intro s hs rw [← Real.exp_nat_mul] apply Real.exp_lt_exp.mpr have hmul := mul_le_mul_of_nonneg_left hs (mul_nonneg (Nat.cast_nonneg ell) (Real.rpow_pos_of_pos hpos a).le) push_cast calc (ell : ℝ) * s * L ^ a ≤ (ell : ℝ) * C * L ^ a * Real.log L := by nlinarith _ < L ^ b := hL /- A real bound for all source labels bounds their omission product. -/ theorem prime_omission_product_real_le_pow {G : Type*} [Fintype G] (S : G → Finset ℕ) (ell : ℕ) {H : ℝ} (hlabels : ∀ g p, p ∈ S g → (p : ℝ) ≤ H) (A : PrimeOmissionChoices S ell) : (primeOmissionProduct S ell A : ℝ) ≤ H ^ (ell * Fintype.card G) := by classical unfold primeOmissionProduct push_cast calc (∏ g, ∏ p ∈ (A g).val, (p : ℝ)) ≤ ∏ _g : G, H ^ ell := by apply Finset.prod_le_prod₀ · intro g _ positivity · intro g _ calc (∏ p ∈ (A g).val, (p : ℝ)) ≤ ∏ _p ∈ (A g).val, H := by apply Finset.prod_le_prod₀ · intro p _ exact Nat.cast_nonneg p · intro p hp exact hlabels g p ((mem_powersetCard.mp (A g).property).1 hp) _ = H ^ ell := by rw [prod_const, (mem_powersetCard.mp (A g).property).2] _ = H ^ (ell * Fintype.card G) := by rw [prod_const, card_univ, ← pow_mul] end section open Finset open scoped Classical /- A real lower endpoint for the big-prime range supplies the nonzero short-step congruence condition. -/ theorem physical_pending_step_not_dvd_of_bounds {p : ℕ} {k : ℤ} {P₀ : ℝ} (hkpos : 0 < k.natAbs) (hstep : (k.natAbs : ℝ) < P₀) (hp : P₀ ≤ (p : ℝ)) : ¬ (p : ℤ) ∣ k := by apply nat_not_dvd_int_of_natAbs_lt hkpos exact_mod_cast hstep.trans_le hp end section open scoped BigOperators ComplexConjugate /- A label may change the translation even when both active endpoints are fixed. -/ noncomputable def cleanTranslatedSumOperator {A X R : Type*} [Fintype A] [Fintype X] [AddCommGroup R] (K : A → X → X → ℂ) (δ : A → X → X → R) (f : X → R → ℂ) (x : X) (r : R) : ℂ := ∑ a, cleanTranslatedOperator (K a) (δ a) f x r /- All auxiliary and pattern labels are summed before estimating this block. -/ noncomputable def cleanFourierSumBlock {A X R : Type*} [Fintype A] [Fintype X] [AddCommGroup R] (K : A → X → X → ℂ) (δ : A → X → X → R) (χ : AddChar R ℂ) (v : X → ℂ) (x : X) : ℂ := ∑ a, cleanFourierBlock (K a) (δ a) χ v x /- The summed Fourier block is the finite matrix whose entries retain all phases. -/ theorem clean_fourier_sum_block_matrix {A X R : Type*} [Fintype A] [Fintype X] [AddCommGroup R] (K : A → X → X → ℂ) (δ : A → X → X → R) (χ : AddChar R ℂ) (v : X → ℂ) (x : X) : cleanFourierSumBlock K δ χ v x = ∑ y, (∑ a, K a x y * χ (δ a x y)) * v y := by simp only [cleanFourierSumBlock, cleanFourierBlock, Finset.sum_mul] exact Finset.sum_comm /- Fourier synthesis intertwines the full translated label sum with the full block sum. -/ theorem clean_fourier_sum_translated_synthesis {A X R : Type*} [Fintype A] [Fintype X] [AddCommGroup R] [Fintype R] (K : A → X → X → ℂ) (δ : A → X → X → R) (c : AddChar R ℂ → X → ℂ) (x : X) (r : R) : cleanTranslatedSumOperator K δ (fun y => cleanFourierSynthesis (fun χ => c χ y)) x r = cleanFourierSynthesis (fun χ => cleanFourierSumBlock K δ χ (c χ) x) r := by simp only [cleanTranslatedSumOperator, clean_fourier_translated_synthesis, cleanFourierSynthesis, cleanFourierSumBlock, Finset.sum_mul] exact Finset.sum_comm end section abbrev PhysicalSharedLists {G : Type*} (P : G → Finset ℕ) (J : ℕ) := ∀ g, Fin J ↪ ↥(P g) def physicalSharedPrefix {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) : PhysicalSharedLists P J := fun g => Function.Embedding.inl.trans (L g) def physicalResidueSharedValid {G : Type*} {P : G → Finset ℕ} {J : ℕ} (r : PhysicalResidues P) (d : PhysicalSharedLists P J) : Prop := ∀ g j, r ⟨g, d g j⟩ = 0 abbrev PhysicalResidueSharedFiber {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) (r : PhysicalResidues P) (d : PhysicalSharedLists P J) := {L : PhysicalResidueMarksAt P J ell r // physicalSharedPrefix L.val = d} section variable {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} include G P J ell theorem physical_shared_prefix_apply (L : PhysicalMarkLists P J ell) (g : G) (j : Fin J) : physicalSharedPrefix L g j = L g (Sum.inl j) := rfl theorem physical_shared_prefix_valid (r : PhysicalResidues P) (L : PhysicalResidueMarksAt P J ell r) : physicalResidueSharedValid r (physicalSharedPrefix L.val) := by intro g j exact L.property g (Sum.inl j) theorem physical_shared_fiber_valid (r : PhysicalResidues P) (d : PhysicalSharedLists P J) (L : PhysicalResidueSharedFiber P J ell r d) : physicalResidueSharedValid r d := by rw [← L.property] exact physical_shared_prefix_valid r L.val end end section open Finset Classical abbrev PhysicalResidueZeroLabels {G : Type*} (P : G → Finset ℕ) (g : G) (r : PhysicalResidues P) := {p : ↥(P g) // r ⟨g, p⟩ = 0} theorem physical_residue_divisor_pool_subset {G : Type*} (P : G → Finset ℕ) (g : G) (r : PhysicalResidues P) : physicalResidueDivisorPool P g r ⊆ P g := by classical intro p hp rcases mem_image.mp hp with ⟨q, _, rfl⟩ exact q.property theorem mem_physical_residue_divisor_pool {G : Type*} (P : G → Finset ℕ) (g : G) (r : PhysicalResidues P) (p : ↥(P g)) : p.val ∈ physicalResidueDivisorPool P g r ↔ r ⟨g, p⟩ = 0 := by classical constructor · intro hp rcases mem_image.mp hp with ⟨q, hq, he⟩ have hqp : q = p := Subtype.ext he subst q exact (mem_filter.mp hq).2 · intro hp exact mem_image.mpr ⟨p, mem_filter.mpr ⟨mem_attach _ _, hp⟩, rfl⟩ noncomputable def physicalResidueZeroLabelsEquiv {G : Type*} (P : G → Finset ℕ) (g : G) (r : PhysicalResidues P) : PhysicalResidueZeroLabels P g r ≃ ↥(physicalResidueDivisorPool P g r) := Equiv.ofBijective (fun p => ⟨p.val.val, (mem_physical_residue_divisor_pool P g r p.val).mpr p.property⟩) ⟨by intro p q hpq have he : p.val.val = q.val.val := congrArg (fun z : ↥(physicalResidueDivisorPool P g r) => z.val) hpq exact Subtype.ext (Subtype.ext he), by intro p let q : ↥(P g) := ⟨p.val, physical_residue_divisor_pool_subset P g r p.property⟩ exact ⟨⟨q, (mem_physical_residue_divisor_pool P g r q).mp p.property⟩, rfl⟩⟩ theorem physical_residue_zero_labels_card {G : Type*} (P : G → Finset ℕ) (g : G) (r : PhysicalResidues P) : Fintype.card (PhysicalResidueZeroLabels P g r) = physicalResidueOmega P g r := by rw [Fintype.card_congr (physicalResidueZeroLabelsEquiv P g r), Fintype.card_coe] rfl def physicalResidueMarksEmbedding {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) (r : PhysicalResidues P) (L : PhysicalResidueMarksAt P J ell r) (g : G) : PhysicalSlots J ell ↪ PhysicalResidueZeroLabels P g r where toFun s := ⟨L.val g s, L.property g s⟩ inj' := by intro s t hst exact (L.val g).injective (congrArg Subtype.val hst) theorem physical_residue_slots_le_omega {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) (r : PhysicalResidues P) (L : PhysicalResidueMarksAt P J ell r) (g : G) : J + ell ≤ physicalResidueOmega P g r := by have h := Fintype.card_le_of_embedding (physicalResidueMarksEmbedding P J ell r L g) simpa only [Fintype.card_sum, Fintype.card_fin, physical_residue_zero_labels_card] using h end section open scoped BigOperators open Classical def physicalResidueSharedEmbedding {G : Type*} {P : G → Finset ℕ} {J : ℕ} (r : PhysicalResidues P) (d : PhysicalSharedLists P J) (hd : physicalResidueSharedValid r d) (g : G) : Fin J ↪ PhysicalResidueZeroLabels P g r where toFun j := ⟨d g j, hd g j⟩ inj' _ _ h := (d g).injective (congrArg Subtype.val h) def physicalResidueSharedFiberEquiv {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (r : PhysicalResidues P) (d : PhysicalSharedLists P J) (hd : physicalResidueSharedValid r d) : PhysicalResidueSharedFiber P J ell r d ≃ (∀ g, {f : Fin J ⊕ Fin ell ↪ PhysicalResidueZeroLabels P g r // ∀ j, f (Sum.inl j) = physicalResidueSharedEmbedding r d hd g j}) where toFun L g := ⟨physicalResidueMarksEmbedding P J ell r L.val g, by intro j apply Subtype.ext exact congrArg (fun e : PhysicalSharedLists P J => e g j) L.property⟩ invFun f := ⟨⟨(fun g => { toFun := fun s => ((f g).val s).val inj' := by intro s t h exact (f g).val.injective (Subtype.ext h) }), (fun g s => ((f g).val s).property)⟩, by funext g apply Function.Embedding.ext intro j exact congrArg Subtype.val ((f g).property j)⟩ left_inv L := by apply Subtype.ext apply Subtype.ext funext g apply Function.Embedding.ext intro s rfl right_inv f := by funext g apply Subtype.ext apply Function.Embedding.ext intro s apply Subtype.ext rfl theorem physical_residue_shared_fiber_card {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (r : PhysicalResidues P) (d : PhysicalSharedLists P J) : Nat.card (PhysicalResidueSharedFiber P J ell r d) = if physicalResidueSharedValid r d then ∏ g, (physicalResidueOmega P g r - J).descFactorial ell else 0 := by classical by_cases hd : physicalResidueSharedValid r d · rw [if_pos hd, Nat.card_congr (physicalResidueSharedFiberEquiv r d hd), Nat.card_pi] apply Finset.prod_congr rfl intro g _ rw [shared_completion_card, physical_residue_zero_labels_card, Fintype.card_fin, Fintype.card_fin] · rw [if_neg hd] let _ : IsEmpty (PhysicalResidueSharedFiber P J ell r d) := ⟨fun L => hd (physical_shared_fiber_valid r d L)⟩ exact Nat.card_of_isEmpty theorem physical_residue_shared_filter_card {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (r : PhysicalResidues P) (d : PhysicalSharedLists P J) : (Finset.univ.filter (fun L : PhysicalMarkLists P J ell => physicalResidueMarksValid r L ∧ physicalSharedPrefix L = d)).card = if physicalResidueSharedValid r d then ∏ g, (physicalResidueOmega P g r - J).descFactorial ell else 0 := by classical have h := physical_residue_shared_fiber_card P J ell r d rw [Nat.card_congr (Equiv.subtypeSubtypeEquivSubtypeInter (physicalResidueMarksValid r) (fun L => physicalSharedPrefix L = d)), Nat.card_eq_fintype_card, Fintype.card_subtype] at h exact h end section open scoped BigOperators theorem norm_sum_sq_le_card_energy {X : Type*} (s : Finset X) (f : X → ℂ) : ‖∑ x ∈ s, f x‖ ^ 2 ≤ (s.card : ℝ) * ∑ x ∈ s, ‖f x‖ ^ 2 := by simpa using complex_row_weighted_cauchy s (fun _ => 1) f (fun _ => 1) (fun _ _ => by norm_num) theorem fiber_conditioning_energy_bound {X Y : Type*} [Fintype X] [Fintype Y] [DecidableEq Y] (π : X → Y) (f : X → ℂ) (c : ℝ) {A : ℝ} (hcard : ∀ y, c ^ 2 * ((Finset.univ.filter fun x => π x = y).card : ℝ) ≤ A) : (∑ y, ‖(c : ℂ) * ∑ x ∈ Finset.univ.filter (fun x => π x = y), f x‖ ^ 2) ≤ A * ∑ x, ‖f x‖ ^ 2 := by classical have hsum : (∑ y, ∑ x ∈ Finset.univ.filter (fun x => π x = y), ‖f x‖ ^ 2) = ∑ x, ‖f x‖ ^ 2 := by simp only [Finset.sum_filter] rw [Finset.sum_comm] simp calc _ = ∑ y, c ^ 2 * ‖∑ x ∈ Finset.univ.filter (fun x => π x = y), f x‖ ^ 2 := by apply Finset.sum_congr rfl intro y _ rw [norm_mul, mul_pow, Complex.norm_real, Real.norm_eq_abs, sq_abs] _ ≤ ∑ y, c ^ 2 * (((Finset.univ.filter fun x => π x = y).card : ℝ) * ∑ x ∈ Finset.univ.filter (fun x => π x = y), ‖f x‖ ^ 2) := Finset.sum_le_sum (fun y _ => mul_le_mul_of_nonneg_left (norm_sum_sq_le_card_energy _ f) (sq_nonneg c)) _ ≤ ∑ y, A * ∑ x ∈ Finset.univ.filter (fun x => π x = y), ‖f x‖ ^ 2 := by apply Finset.sum_le_sum intro y _ rw [← mul_assoc] exact mul_le_mul_of_nonneg_right (hcard y) (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) _ = _ := by rw [← Finset.mul_sum, hsum] theorem fiber_conditioning_weighted_energy_bound {X Y : Type*} [Fintype X] [Fintype Y] [DecidableEq Y] (π : X → Y) (f : X → ℂ) (c : ℝ) {A mass : ℝ} (hcard : ∀ y, c ^ 2 * ((Finset.univ.filter fun x => π x = y).card : ℝ) ≤ A * mass) : (∑ y, ‖(c : ℂ) * ∑ x ∈ Finset.univ.filter (fun x => π x = y), f x‖ ^ 2) ≤ A * ∑ x, mass * ‖f x‖ ^ 2 := by have h := fiber_conditioning_energy_bound π f c hcard simpa only [← Finset.mul_sum, mul_assoc] using h end section open scoped BigOperators noncomputable def physicalSmallConditioningScale {G : Type*} [Fintype G] (V : G → ℝ) (J ell : ℕ) : ℝ := Real.sqrt (physicalStateMass V J ell * physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell) theorem physical_small_conditioning_scale_sq {G : Type*} [Fintype G] (V : G → ℝ) (hV : ∀ g, 0 < V g) (J ell : ℕ) : physicalSmallConditioningScale V J ell ^ 2 = physicalStateMass V J ell * physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell := by apply Real.sq_sqrt exact mul_nonneg (physical_state_mass_pos V hV J ell).le (physical_completion_mass_pos V _ ell hV).le theorem exists_small_completion_energy_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] (J : ℕ) (V : G → ℝ), (∀ g, v ≤ V g) → ∀ omega : G → ℕ, (∀ g, J + ell ≤ omega g) → physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell * (∏ g, q ^ (omega g - (J + ell))) * (∏ g, ((omega g - J).descFactorial ell : ℝ)) ≤ A ^ Fintype.card G := by let A := max 1 (((ell.factorial : ℝ) * (max 1 (1 / v)) ^ ell) / (1 - q) ^ (ell + 1)) refine ⟨A, le_max_left _ _, ?_⟩ intro G _ J V hV omega homega have hf (g : G) : (((omega g - J).descFactorial ell : ℝ) * q ^ (omega g - (J + ell))) / (V g) ^ ell ≤ A := by have hsub : omega g - J = (omega g - (J + ell)) + ell := by have := homega g omega rw [hsub] exact (uniform_damped_descFactorial_bound hq0 hq1 hv (hV g) ell (omega g - (J + ell)) ell le_rfl).trans (le_max_right _ _) have heq : physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell * (∏ g, q ^ (omega g - (J + ell))) * (∏ g, ((omega g - J).descFactorial ell : ℝ)) = ∏ g, (((omega g - J).descFactorial ell : ℝ) * q ^ (omega g - (J + ell))) / (V g) ^ ell := by simp only [physicalCompletionMass, Finset.card_empty, add_zero] rw [← Finset.prod_mul_distrib, ← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro g _ ring rw [heq] calc _ ≤ ∏ _g : G, A := by apply Finset.prod_le_prod₀ · intro g _ exact div_nonneg (mul_nonneg (Nat.cast_nonneg _) (pow_nonneg hq0 _)) (pow_nonneg (hv.trans_le (hV g)).le _) · intro g _ exact hf g _ = _ := by simp theorem small_conditioning_scale_damping_sq {G : Type*} [Fintype G] (V : G → ℝ) (hV : ∀ g, 0 < V g) (J ell : ℕ) {q : ℝ} (hq : 0 ≤ q) (omega : G → ℕ) : (physicalSmallConditioningScale V J ell * ∏ g, (Real.sqrt q) ^ (omega g - (J + ell))) ^ 2 = physicalStateMass V J ell * physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell * ∏ g, q ^ (omega g - (J + ell)) := by rw [mul_pow, physical_small_conditioning_scale_sq V hV, ← Finset.prod_pow] congr 1 apply Finset.prod_congr rfl intro g _ rw [← pow_mul, Nat.mul_comm, pow_mul, Real.sq_sqrt hq] end section open scoped BigOperators Classical noncomputable def physicalSmallCondition {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (q : ℝ) (r : PhysicalResidues P) (d : PhysicalSharedLists P J) (w : PhysicalMarkLists P J ell → ℂ) : ℂ := by classical exact ((physicalSmallConditioningScale V J ell * ∏ g, (Real.sqrt q) ^ (physicalResidueOmega P g r - (J + ell)) : ℝ) : ℂ) * ∑ L ∈ (Finset.univ : Finset (PhysicalResidueMarksAt P J ell r)).filter (fun L => physicalSharedPrefix L.val = d), w L.val theorem exists_physical_small_conditioning_energy_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J : ℕ) (V : G → ℝ), (∀ g, v ≤ V g) → ∀ (r : PhysicalResidues P) (w : PhysicalMarkLists P J ell → ℂ), (∑ d : PhysicalSharedLists P J, ‖physicalSmallCondition V q r d w‖ ^ 2) ≤ A ^ Fintype.card G * ∑ L : PhysicalResidueMarksAt P J ell r, physicalStateMass V J ell * ‖w L.val‖ ^ 2 := by obtain ⟨A, hA, hbound⟩ := exists_small_completion_energy_bound hq0 hq1 hv ell refine ⟨A, hA, ?_⟩ intro G _ _ P J V hV r w classical have hVpos (g : G) : 0 < V g := hv.trans_le (hV g) have hmass : 0 < physicalStateMass V J ell := physical_state_mass_pos V hVpos J ell let amp : ℝ := physicalSmallConditioningScale V J ell * ∏ g, (Real.sqrt q) ^ (physicalResidueOmega P g r - (J + ell)) have hcard (d : PhysicalSharedLists P J) : amp ^ 2 * ((Finset.univ.filter (fun L : PhysicalResidueMarksAt P J ell r => physicalSharedPrefix L.val = d)).card : ℝ) ≤ A ^ Fintype.card G * physicalStateMass V J ell := by let S := Finset.univ.filter (fun L : PhysicalResidueMarksAt P J ell r => physicalSharedPrefix L.val = d) by_cases hS : S.card = 0 · change amp ^ 2 * (S.card : ℝ) ≤ _ rw [hS, Nat.cast_zero, mul_zero] exact mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) hmass.le · obtain ⟨L, hL⟩ := Finset.card_pos.mp (Nat.pos_of_ne_zero hS) have hd : physicalResidueSharedValid r d := by rw [← (Finset.mem_filter.mp hL).2] exact physical_shared_prefix_valid r L have hc := physical_residue_shared_fiber_card P J ell r d rw [if_pos hd, Nat.card_eq_fintype_card, Fintype.card_subtype] at hc have hcreal : ((Finset.univ.filter (fun L : PhysicalResidueMarksAt P J ell r => physicalSharedPrefix L.val = d)).card : ℝ) = ∏ g, ((physicalResidueOmega P g r - J).descFactorial ell : ℝ) := by exact_mod_cast hc have hb := hbound G J V hV (fun g => physicalResidueOmega P g r) (physical_residue_slots_le_omega P J ell r L) change (physicalSmallConditioningScale V J ell * ∏ g, (Real.sqrt q) ^ (physicalResidueOmega P g r - (J + ell))) ^ 2 * _ ≤ _ rw [small_conditioning_scale_damping_sq V hVpos J ell hq0, hcreal] calc _ = physicalStateMass V J ell * (physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell * (∏ g, q ^ (physicalResidueOmega P g r - (J + ell))) * (∏ g, ((physicalResidueOmega P g r - J).descFactorial ell : ℝ))) := by ring _ ≤ physicalStateMass V J ell * A ^ Fintype.card G := mul_le_mul_of_nonneg_left hb hmass.le _ = _ := mul_comm _ _ exact fiber_conditioning_weighted_energy_bound (fun L : PhysicalResidueMarksAt P J ell r => physicalSharedPrefix L.val) (fun L => w L.val) amp hcard end section open scoped BigOperators Classical theorem physical_small_condition_eq_vertex_sum {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (q : ℝ) (r : PhysicalResidues P) (d : PhysicalSharedLists P J) (w : PhysicalMarkLists P J ell → ℂ) : physicalSmallCondition V q r d w = (physicalSmallConditioningScale V J ell : ℂ) * ∑ L : PhysicalMarkLists P J ell, if physicalSharedPrefix L = d then (physicalResidueVertexWeight L (Real.sqrt q) r : ℂ) * w L else 0 := by classical let F : PhysicalMarkLists P J ell → ℂ := fun L => if physicalSharedPrefix L = d then (physicalResidueVertexWeight L (Real.sqrt q) r : ℂ) * w L else 0 have he : (∑ L : PhysicalResidueMarksAt P J ell r, F L.val) = ∑ L, F L := by apply (Finset.sum_congr_set {L | physicalResidueMarksValid r L} F (fun L => F L.val) (fun _ _ => rfl) ?_).symm intro L hL change ¬ physicalResidueMarksValid r L at hL dsimp [F] simp only [physicalResidueVertexWeight, if_neg hL, Complex.ofReal_zero, zero_mul, ite_self] change physicalSmallCondition V q r d w = _ * ∑ L, F L rw [← he] unfold physicalSmallCondition rw [Complex.ofReal_mul, mul_assoc] congr 1 rw [Finset.sum_filter, Finset.mul_sum] apply Finset.sum_congr rfl intro L _ dsimp [F] simp only [physicalResidueVertexWeight, if_pos L.property] split_ifs <;> simp end section open Finset def distinctSurvivorStorageEmbedding {J K P : Type*} (f : J ↪ P) (g : K ↪ P) (T : Finset P) (hdis : ∀ j k, f j ≠ g k) : {j : J // f j ∉ T} ⊕ K ↪ P where toFun := Sum.elim (fun j => f j.val) g inj' := by intro x y hxy cases x with | inl j => cases y with | inl l => exact congrArg Sum.inl (Subtype.ext (f.injective hxy)) | inr k => exact (hdis j.val k hxy).elim | inr k => cases y with | inl j => exact (hdis j.val k hxy.symm).elim | inr l => exact congrArg Sum.inr (g.injective hxy) theorem distinct_survivor_storage_support {J K P : Type*} [Fintype J] [Fintype K] [DecidableEq P] (f : J ↪ P) (g : K ↪ P) (T : Finset P) (hdis : ∀ j k, f j ≠ g k) : univ.image (distinctSurvivorStorageEmbedding f g T hdis) = (univ.image f \ T) ∪ univ.image g := by ext p simp only [mem_image, mem_univ, true_and, mem_union, mem_sdiff] constructor · rintro ⟨x,hx⟩ cases x with | inl j => change f j.val = p at hx exact Or.inl ⟨⟨j.val,hx⟩, hx ▸ j.property⟩ | inr k => exact Or.inr ⟨k,hx⟩ · rintro (⟨⟨j,hj⟩,hp⟩ | ⟨k,hk⟩) · exact ⟨Sum.inl ⟨j,hj.symm ▸ hp⟩,hj⟩ · exact ⟨Sum.inr k,hk⟩ def distinctSurvivorStorageResidue {J K P : Type*} (f : J ↪ P) (g : K ↪ P) (T : Finset P) (hdis : ∀ j k, f j ≠ g k) (R : P → Type*) (transport : (p : P) → R p → R p) (old : (j : J) → R (f j)) (stored : (k : K) → R (g k)) : (z : {j : J // f j ∉ T} ⊕ K) → R (distinctSurvivorStorageEmbedding f g T hdis z) | Sum.inl j => transport (f j.val) (old j.val) | Sum.inr k => stored k end section open Finset noncomputable def ghostPhasePendingSupport {I : Type*} [Fintype I] {R : I → Type*} (w : (i : I) → GhostPhaseState (R i)) : Finset I := by classical exact univ.filter (fun i => ∃ r, w i = some (some (some r))) noncomputable def ghostPhaseActivitySupport {I : Type*} [Fintype I] (a : I → Bool) : Finset I := univ.filter (fun i => a i = true) noncomputable def ghostPhaseChoiceSupport {I : Type*} [Fintype I] (c : I → Bool) : Finset I := univ.filter (fun i => c i = true) def ghostPhaseEdgeChoiceOutput {I : Type*} {R : I → Type*} (atgt asrc : I → Bool) (hsrc : (i : I) → R i) (w : (i : I) → GhostPhaseState (R i)) (c : I → Bool) : (i : I) → GhostPhaseState (R i) := fun i => if c i then ghostPhaseEdgeStoreTarget (hsrc i) else ghostPhaseEdgeBaseTarget (atgt i) (asrc i) (w i) /- Local support update for an allowed storage choice. -/ theorem ghost_phase_edge_choice_pending_iff {R : Type*} (atgt asrc c : Bool) (hsrc : R) (w : GhostPhaseState R) (hw : w.isSome = !asrc) (hc : c = true → atgt = false ∧ asrc = true) : (∃ r, (if c then ghostPhaseEdgeStoreTarget hsrc else ghostPhaseEdgeBaseTarget atgt asrc w) = some (some (some r))) ↔ ((∃ r, w = some (some (some r))) ∧ atgt = false) ∨ c = true := by cases atgt <;> cases asrc <;> cases c <;> rcases w with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseEdgeStoreTarget, ghostPhaseEdgeBaseTarget] /- The exact pending support after the chosen edge: delete promoted labels, then append precisely the stored source-active labels. -/ theorem ghost_phase_edge_choice_support {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} (atgt asrc c : I → Bool) (hsrc : (i : I) → R i) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (hc : ∀ i, c i = true → atgt i = false ∧ asrc i = true) : ghostPhasePendingSupport (ghostPhaseEdgeChoiceOutput atgt asrc hsrc w c) = (ghostPhasePendingSupport w \ ghostPhaseActivitySupport atgt) ∪ ghostPhaseChoiceSupport c := by classical ext i simp only [mem_union, mem_sdiff] simp only [ghostPhasePendingSupport, ghostPhaseActivitySupport, ghostPhaseChoiceSupport, mem_filter, mem_univ, true_and] change (∃ r, (if c i then ghostPhaseEdgeStoreTarget (hsrc i) else ghostPhaseEdgeBaseTarget (atgt i) (asrc i) (w i)) = some (some (some r))) ↔ _ rw [ghost_phase_edge_choice_pending_iff (atgt i) (asrc i) (c i) (hsrc i) (w i) (hw i) (hc i)] cases atgt i <;> simp /- Surviving old pending residues are retained exactly, with no relabeling. -/ theorem ghost_phase_edge_choice_survivor {I : Type*} {R : I → Type*} (atgt asrc c : I → Bool) (hsrc : (i : I) → R i) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (hc : ∀ i, c i = true → atgt i = false ∧ asrc i = true) (i : I) (r : R i) (hr : w i = some (some (some r))) (ht : atgt i = false) : ghostPhaseEdgeChoiceOutput atgt asrc hsrc w c i = some (some (some r)) := by have hs : asrc i = false := by have hi := hw i rw [hr] at hi cases ha : asrc i <;> simp_all have hci : c i = false := by cases hi : c i · rfl · have := (hc i hi).2 simp_all simp [ghostPhaseEdgeChoiceOutput, hci, ht, hs, hr, ghostPhaseEdgeBaseTarget] end section open Finset /- The selected target: transport retained memory, drop an outgoing active lifespan by default, or store it at target residue `-delta`. -/ noncomputable def ghostPhaseMovingChoiceTarget {R : Type*} [AddGroup R] (atgt asrc : Bool) (delta : R) (store : Bool) (w : GhostPhaseState R) : GhostPhaseState R := if store then ghostPhaseEdgeStoreTarget (-delta) else ghostPhaseEdgeBaseTarget atgt asrc (ghostPhaseShift delta w) /- A fresh active lifespan begins exactly at an unborn inactive coordinate. -/ def ghostPhaseEdgeFresh {R : Type*} [DecidableEq R] (atgt asrc : Bool) (w : GhostPhaseState R) : Bool := atgt && !asrc && decide (w = some none) /- Shared active coordinates require zero displacement; promotions require the old pending residue to equal the displacement. Completed lifespans cannot be promoted. Other supported transitions impose no further hit condition. -/ def ghostPhaseMovingEdgeCompatible {R : Type*} [AddGroup R] [DecidableEq R] (atgt asrc : Bool) (delta : R) (w : GhostPhaseState R) : Bool := match atgt, asrc, w with | true, true, _ => decide (delta = 0) | true, false, some none => true | true, false, some (some (some r)) => decide (r = delta) | true, false, _ => false | false, _, _ => true /- The compatibility bit expresses precisely shared-hit agreement and the fresh-or-promoted alternative for every newly active coordinate. -/ theorem ghost_phase_moving_edge_compatible_iff {R : Type*} [AddGroup R] [DecidableEq R] (atgt asrc : Bool) (delta : R) (w : GhostPhaseState R) (hw : w.isSome = !asrc) : ghostPhaseMovingEdgeCompatible atgt asrc delta w = true ↔ (atgt = true ∧ asrc = true → delta = 0) ∧ (atgt = true ∧ asrc = false → w = some none ∨ w = some (some (some delta))) := by cases atgt <;> cases asrc <;> rcases w with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseMovingEdgeCompatible] /- The actual undamped coefficient at the selected target. Storage may be chosen only on a source-active, target-inactive coordinate. -/ theorem ghost_phase_moving_choice_coefficient {R : Type*} [AddGroup R] [Fintype R] [DecidableEq R] (atgt asrc store : Bool) (delta : R) (β : ℝ) (w : GhostPhaseState R) (hw : w.isSome = !asrc) (hs : store = true → atgt = false ∧ asrc = true) : ghostPhaseMovingEdge atgt asrc delta β (ghostPhaseMovingChoiceTarget atgt asrc delta store w) w = (if ghostPhaseEdgeFresh atgt asrc w then β else 1) * (if ghostPhaseMovingEdgeCompatible atgt asrc delta w then 1 else 0) := by cases atgt <;> cases asrc <;> cases store <;> rcases w with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseMovingChoiceTarget, ghostPhaseEdgeBaseTarget, ghostPhaseEdgeStoreTarget, ghostPhaseEdgeFresh, ghostPhaseMovingEdgeCompatible, ghostPhaseShift, ghostMemoryShift, ghost_phase_moving_edge_active_active, ghost_phase_moving_edge_inactive_active, ghost_phase_moving_edge_active_inactive, ghost_phase_moving_edge_inactive_inactive] /- Diagonal damping detects exactly pending residue zero. -/ theorem ghost_phase_diagonal_eq_zero_indicator {R : Type*} [Zero R] [DecidableEq R] (ρ : ℝ) (w : GhostPhaseState R) : ghostPhaseDiagonal 0 ρ w = if w = some (some (some 0)) then ρ else 1 := by rcases w with _ | (_ | (_ | r)) <;> simp [ghostPhaseDiagonal] /- The selected actual damped edge coefficient splits into both endpoint diagonals, a fresh beta factor, and the explicit compatibility indicator. -/ theorem ghost_phase_damped_moving_choice_coefficient {R : Type*} [AddGroup R] [Fintype R] [DecidableEq R] (atgt asrc store : Bool) (delta : R) (β ρtgt ρsrc : ℝ) (w : GhostPhaseState R) (hw : w.isSome = !asrc) (hs : store = true → atgt = false ∧ asrc = true) : ghostPhaseDampedMovingEdge atgt asrc delta β ρtgt ρsrc (ghostPhaseMovingChoiceTarget atgt asrc delta store w) w = (if w = some (some (some 0)) then ρsrc else 1) * (if ghostPhaseMovingChoiceTarget atgt asrc delta store w = some (some (some 0)) then ρtgt else 1) * (if ghostPhaseEdgeFresh atgt asrc w then β else 1) * (if ghostPhaseMovingEdgeCompatible atgt asrc delta w then 1 else 0) := by rw [ghostPhaseDampedMovingEdge, ghost_phase_moving_choice_coefficient atgt asrc store delta β w hw hs] simp only [ghost_phase_diagonal_eq_zero_indicator] ring /- Pending-zero coordinates of a finite phase configuration. -/ noncomputable def ghostPhaseZeroSet {I : Type*} [Fintype I] {R : I → Type*} [∀ i, Zero (R i)] [∀ i, DecidableEq (R i)] (w : (i : I) → GhostPhaseState (R i)) : Finset I := univ.filter (fun i => w i = some (some (some 0))) noncomputable def ghostPhaseFreshSet {I : Type*} [Fintype I] {R : I → Type*} [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (w : (i : I) → GhostPhaseState (R i)) : Finset I := univ.filter (fun i => ghostPhaseEdgeFresh (atgt i) (asrc i) (w i)) /- Source-inactive coordinates entering the target active label. -/ noncomputable def ghostPhaseNewRunSet {I : Type*} [Fintype I] (atgt asrc : I → Bool) : Finset I := univ.filter (fun i => atgt i && !(asrc i)) section variable {I : Type*} [sharedInstance1 : Fintype I] {R : I → Type*} [sharedInstance3 : ∀ i, AddGroup (R i)] [sharedInstance4 : ∀ i, Fintype (R i)] [sharedInstance5 : ∀ i, DecidableEq (R i)] (atgt asrc store : I → Bool) (delta : (i : I) → R i) (β : I → ℝ) include I sharedInstance1 R sharedInstance3 sharedInstance4 sharedInstance5 atgt asrc store delta β /- Exact finite coefficient of one supported moving-frame edge choice. The zero counts include promoted old particles at the source and newly stored particles at the target. The indicator keeps all shared-hit and promotion conditions, so zero-weight choices remain represented. -/ theorem ghost_phase_moving_edge_choice_product (ρtgt ρsrc : ℝ) (w : (i : I) → GhostPhaseState (R i)) (hw : ∀ i, (w i).isSome = !(asrc i)) (hs : ∀ i, store i = true → atgt i = false ∧ asrc i = true) : (∏ i, ghostPhaseDampedMovingEdge (atgt i) (asrc i) (delta i) (β i) ρtgt ρsrc (ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i)) (w i)) = ρsrc ^ (ghostPhaseZeroSet w).card * ρtgt ^ (ghostPhaseZeroSet (fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i))).card * (∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i) * (if ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true then 1 else 0) := by classical have hc : (∏ i, if ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) then (1 : ℝ) else 0) = if ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true then 1 else 0 := by by_cases h : ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true · simp [h] · rw [if_neg h] push Not at h obtain ⟨i, hi⟩ := h exact prod_eq_zero (mem_univ i) (if_neg hi) have hd (v : (i : I) → GhostPhaseState (R i)) (ρ : ℝ) : (∏ i, if v i = some (some (some 0)) then ρ else 1) = ρ ^ (ghostPhaseZeroSet v).card := by unfold ghostPhaseZeroSet rw [← prod_filter, prod_const] simp_rw [ghost_phase_damped_moving_choice_coefficient _ _ _ _ _ _ _ _ (hw _) (hs _)] simp only [prod_mul_distrib, hc] rw [hd w ρsrc, hd (fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i)) ρtgt] rw [ghostPhaseFreshSet, prod_filter] /- If each new active run is explicitly normalized by `V⁻¹`, the same actual edge coefficient acquires exactly one such factor per entering active index. -/ theorem ghost_phase_run_normalized_edge_choice_product (ρtgt ρsrc V : ℝ) (w : (i : I) → GhostPhaseState (R i)) (hw : ∀ i, (w i).isSome = !(asrc i)) (hs : ∀ i, store i = true → atgt i = false ∧ asrc i = true) : (∏ i, (if atgt i && !(asrc i) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt i) (asrc i) (delta i) (β i) ρtgt ρsrc (ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i)) (w i)) = ρsrc ^ (ghostPhaseZeroSet w).card * ρtgt ^ (ghostPhaseZeroSet (fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i))).card * (∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i) * (V⁻¹) ^ (ghostPhaseNewRunSet atgt asrc).card * (if ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true then 1 else 0) := by classical rw [prod_mul_distrib, ghost_phase_moving_edge_choice_product atgt asrc store delta β ρtgt ρsrc w hw hs] have hV : (∏ i, if atgt i && !(asrc i) then V⁻¹ else 1) = (V⁻¹) ^ (ghostPhaseNewRunSet atgt asrc).card := by rw [ghostPhaseNewRunSet, ← prod_const] exact (prod_filter _ _).symm rw [hV] ring end end section open Finset /- Translation changes neither active/inactive status nor the U/D flags. -/ theorem ghost_phase_shift_isSome {R : Type*} [AddGroup R] (delta : R) (w : GhostPhaseState R) : (ghostPhaseShift delta w).isSome = w.isSome := by cases w <;> rfl theorem ghost_phase_shift_pending_iff {R : Type*} [AddGroup R] (delta : R) (w : GhostPhaseState R) : (∃ r, ghostPhaseShift delta w = some (some (some r))) ↔ ∃ r, w = some (some (some r)) := by rcases w with _ | (_ | (_ | r)) <;> simp [ghostPhaseShift_active, ghostPhaseShift_unborn, ghostPhaseShift_completed, ghostPhaseShift_pending] /- Independent frame shifts preserve the pending support. -/ theorem ghost_phase_pending_support_shift {I : Type*} [Fintype I] {R : I → Type*} [∀ i, AddGroup (R i)] (delta : (i : I) → R i) (w : (i : I) → GhostPhaseState (R i)) : ghostPhasePendingSupport (fun i => ghostPhaseShift (delta i) (w i)) = ghostPhasePendingSupport w := by classical ext i simp only [ghostPhasePendingSupport, mem_filter, mem_univ, true_and, ghost_phase_shift_pending_iff] theorem ghost_phase_mask_shift {I : Type*} {R : I → Type*} [∀ i, AddGroup (R i)] (a : I → Bool) (delta : (i : I) → R i) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask a w) : ghostPhaseMask a (fun i => ghostPhaseShift (delta i) (w i)) := by intro i rw [ghost_phase_shift_isSome] exact hw i /- The moving choice is precisely the fixed-frame choice on translated input, with the source hit at -delta in the target frame. -/ theorem ghost_phase_moving_choice_output_eq {I : Type*} {R : I → Type*} [∀ i, AddGroup (R i)] (atgt asrc store : I → Bool) (delta : (i : I) → R i) (w : (i : I) → GhostPhaseState (R i)) : (fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i)) = ghostPhaseEdgeChoiceOutput atgt asrc (fun i => -delta i) (fun i => ghostPhaseShift (delta i) (w i)) store := rfl /- Moving coordinates have exactly the same delete-and-store support update. -/ theorem ghost_phase_moving_choice_support {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, AddGroup (R i)] (atgt asrc store : I → Bool) (delta : (i : I) → R i) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (hs : ∀ i, store i = true → atgt i = false ∧ asrc i = true) : ghostPhasePendingSupport (fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i)) = (ghostPhasePendingSupport w \ ghostPhaseActivitySupport atgt) ∪ ghostPhaseChoiceSupport store := by rw [ghost_phase_moving_choice_output_eq, ghost_phase_edge_choice_support atgt asrc store (fun i => -delta i) (fun i => ghostPhaseShift (delta i) (w i)) (ghost_phase_mask_shift asrc delta w hw) hs, ghost_phase_pending_support_shift] /- A stored outgoing active label has target-frame residue -delta. -/ theorem ghost_phase_moving_choice_stored {R : Type*} [AddGroup R] (atgt asrc store : Bool) (delta : R) (w : GhostPhaseState R) (hs : store = true) : ghostPhaseMovingChoiceTarget atgt asrc delta store w = some (some (some (-delta))) := by simp [ghostPhaseMovingChoiceTarget, hs, ghostPhaseEdgeStoreTarget] /- A retained old residue r is translated to r-delta. -/ theorem ghost_phase_moving_choice_survivor {I : Type*} {R : I → Type*} [∀ i, AddGroup (R i)] (atgt asrc store : I → Bool) (delta : (i : I) → R i) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (hs : ∀ i, store i = true → atgt i = false ∧ asrc i = true) (i : I) (r : R i) (hr : w i = some (some (some r))) (ht : atgt i = false) : ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i) = some (some (some (r - delta i))) := by have hshift : ghostPhaseShift (delta i) (w i) = some (some (some (r - delta i))) := by rw [hr, ghostPhaseShift_pending] exact ghost_phase_edge_choice_survivor atgt asrc store (fun i => -delta i) (fun i => ghostPhaseShift (delta i) (w i)) (ghost_phase_mask_shift asrc delta w hw) hs i (r - delta i) hshift ht end section open Finset /- Old pending labels entering the target active set are promotions. -/ noncomputable def ghostPhasePromotionSet {I : Type*} [Fintype I] {R : I → Type*} (atgt : I → Bool) (w : (i : I) → GhostPhaseState (R i)) : Finset I := by classical exact ghostPhasePendingSupport w ∩ ghostPhaseActivitySupport atgt /- Promotion and fresh birth are disjoint alternatives regardless of coefficients. -/ theorem ghost_phase_promotion_fresh_disjoint {I : Type*} [Fintype I] {R : I → Type*} [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (w : (i : I) → GhostPhaseState (R i)) : Disjoint (ghostPhasePromotionSet atgt w) (ghostPhaseFreshSet atgt asrc w) := by classical apply disjoint_left.mpr intro i hp hf simp only [ghostPhasePromotionSet, ghostPhasePendingSupport, ghostPhaseActivitySupport, mem_inter, mem_filter, mem_univ, true_and] at hp obtain ⟨r, hr⟩ := hp.1 simp [ghostPhaseFreshSet, ghostPhaseEdgeFresh, hr] at hf section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] {R : I → Type*} [sharedInstance4 : ∀ i, AddGroup (R i)] [sharedInstance5 : ∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (delta : (i : I) → R i) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (hcompat : ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true) include I sharedInstance1 sharedInstance2 R sharedInstance4 sharedInstance5 atgt asrc delta w hw hcompat /- A compatible new active run is exactly one old-pending promotion or one fresh unborn label. Completed labels cannot enter this partition. -/ theorem ghost_phase_new_run_partition : ghostPhaseNewRunSet atgt asrc = ghostPhasePromotionSet atgt w ∪ ghostPhaseFreshSet atgt asrc w := by classical ext i have hwi := hw i have hci := hcompat i cases ht : atgt i <;> cases hs : asrc i <;> rcases he : w i with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseNewRunSet, ghostPhasePromotionSet, ghostPhasePendingSupport, ghostPhaseActivitySupport, ghostPhaseFreshSet, ghostPhaseEdgeFresh, ghostPhaseMovingEdgeCompatible] /- The entering-run count splits into promotion count plus fresh count. -/ theorem ghost_phase_new_run_card : (ghostPhaseNewRunSet atgt asrc).card = (ghostPhasePromotionSet atgt w).card + (ghostPhaseFreshSet atgt asrc w).card := by rw [ghost_phase_new_run_partition atgt asrc delta w hw hcompat, card_union_of_disjoint (ghost_phase_promotion_fresh_disjoint atgt asrc w)] end /- A product of fresh-label masses beta/V pays one inverse V per fresh label. -/ theorem ghost_phase_fresh_measure_product {I : Type*} [Fintype I] {R : I → Type*} [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (w : (i : I) → GhostPhaseState (R i)) (β : I → ℝ) (V : ℝ) : (∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i / V) = (∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i) * (V⁻¹) ^ (ghostPhaseFreshSet atgt asrc w).card := by simp only [div_eq_mul_inv, prod_mul_distrib, prod_const] /- Exact normalization split, including the zero indicator on incompatible choices. There is no additional inverse V for fresh labels after beta/V. -/ theorem ghost_phase_new_run_measure_split {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, AddGroup (R i)] [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (delta : (i : I) → R i) (β : I → ℝ) (V : ℝ) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) : (∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i) * (V⁻¹) ^ (ghostPhaseNewRunSet atgt asrc).card * (if ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true then 1 else 0) = (V⁻¹) ^ (ghostPhasePromotionSet atgt w).card * (∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i / V) * (if ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true then 1 else 0) := by classical by_cases hc : ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true · rw [if_pos hc, ghost_phase_new_run_card atgt asrc delta w hw hc, ghost_phase_fresh_measure_product, pow_add] ring · simp only [if_neg hc, mul_zero] /- The actual edge with explicit all-new-run normalization has only a promotion-count inverse power after fresh beta/V measures are extracted. Both endpoint rho factors and the full compatibility indicator are retained. -/ theorem ghost_phase_run_normalized_edge_fresh_measure {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, AddGroup (R i)] [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (atgt asrc store : I → Bool) (delta : (i : I) → R i) (β : I → ℝ) (ρtgt ρsrc V : ℝ) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (hs : ∀ i, store i = true → atgt i = false ∧ asrc i = true) : (∏ i, (if atgt i && !(asrc i) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt i) (asrc i) (delta i) (β i) ρtgt ρsrc (ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i)) (w i)) = ρsrc ^ (ghostPhaseZeroSet w).card * ρtgt ^ (ghostPhaseZeroSet (fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i))).card * (V⁻¹) ^ (ghostPhasePromotionSet atgt w).card * (∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i / V) * (if ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true then 1 else 0) := by rw [ghost_phase_run_normalized_edge_choice_product atgt asrc store delta β ρtgt ρsrc V w hw hs] have he := ghost_phase_new_run_measure_split atgt asrc delta β V w hw calc _ = (ρsrc ^ (ghostPhaseZeroSet w).card * ρtgt ^ (ghostPhaseZeroSet (fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (store i) (w i))).card) * ((∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i) * (V⁻¹) ^ (ghostPhaseNewRunSet atgt asrc).card * (if ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true then 1 else 0)) := by ring _ = _ := by rw [he]; ring end section open Finset /- An injective labeling reindexes subsets without multiplicity. -/ theorem distinct_slot_subset_sum {J P : Type*} [Fintype J] [DecidableEq J] [DecidableEq P] (g : J ↪ P) (F : Finset P → ℝ) : (∑ B ∈ (univ.image g).powerset, F B) = ∑ S ∈ (univ : Finset J).powerset, F (S.image g) := by rw [powerset_image, sum_image] intro S _ T _ h exact image_injective g.injective h /- Only labels leaving the active set have a storage alternative. -/ theorem ghost_phase_tensor_edge_storage_subsets {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (htgt hsrc : (i : I) → R i) (β ρtgt ρsrc : I → ℝ) (w : (i : I) → GhostPhaseState (R i)) (F : ((i : I) → GhostPhaseState (R i)) → ℝ) : (∑ z, (∏ i, ghostPhaseDampedEdge (atgt i) (asrc i) (htgt i) (hsrc i) (β i) (ρtgt i) (ρsrc i) (z i) (w i)) * F z) = ∑ B ∈ (ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt).powerset, (∏ i, if i ∈ B then ghostPhaseEdgeStoreWeight (atgt i) (asrc i) (htgt i) (hsrc i) (ρtgt i) (w i) else ghostPhaseEdgeBaseWeight (atgt i) (asrc i) (htgt i) (hsrc i) (β i) (ρtgt i) (ρsrc i) (w i)) * F (ghostPhaseEdgeChoiceOutput atgt asrc hsrc w (fun i => decide (i ∈ B))) := by rw [ghost_phase_tensor_edge_action_expansion] unfold ghostPhaseEdgeChoiceOutput have hz : ∀ i, i ∉ ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt → ghostPhaseEdgeStoreWeight (atgt i) (asrc i) (htgt i) (hsrc i) (ρtgt i) (w i) = 0 := by intro i hi by_contra hn obtain ⟨ht, hs, _⟩ := ghost_phase_edge_store_supported _ _ _ _ _ _ hn apply hi simp [ghostPhaseActivitySupport, hs, ht] simpa only [ghostPhaseEdgeChoiceOutput, decide_eq_true_eq] using ghost_choice_sum_subsets (fun i => ghostPhaseEdgeBaseTarget (atgt i) (asrc i) (w i)) (fun i => ghostPhaseEdgeStoreTarget (hsrc i)) (fun i => ghostPhaseEdgeBaseWeight (atgt i) (asrc i) (htgt i) (hsrc i) (β i) (ρtgt i) (ρsrc i) (w i)) (fun i => ghostPhaseEdgeStoreWeight (atgt i) (asrc i) (htgt i) (hsrc i) (ρtgt i) (w i)) (ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt) hz F /- A supported selected outcome has exactly its binary-expansion coefficient. -/ theorem ghost_phase_edge_selected_weight {R : Type*} [Fintype R] [DecidableEq R] (atgt asrc store : Bool) (htgt hsrc : R) (β ρtgt ρsrc : ℝ) (w : GhostPhaseState R) (hw : w.isSome = !asrc) (hs : store = true → atgt = false ∧ asrc = true) : ghostPhaseDampedEdge atgt asrc htgt hsrc β ρtgt ρsrc (if store then ghostPhaseEdgeStoreTarget hsrc else ghostPhaseEdgeBaseTarget atgt asrc w) w = if store then ghostPhaseEdgeStoreWeight atgt asrc htgt hsrc ρtgt w else ghostPhaseEdgeBaseWeight atgt asrc htgt hsrc β ρtgt ρsrc w := by rw [ghost_phase_damped_edge_sparse] cases atgt <;> cases asrc <;> cases store <;> rcases w with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseEdgeBaseTarget, ghostPhaseEdgeStoreTarget, ghostPhaseEdgeStoreWeight, ghostPhaseEdgeBaseWeight] /- The full edge action is the sum of its actual coefficients at the distinct storage outputs, including compatible choices whose coefficient vanishes. -/ theorem ghost_phase_tensor_edge_storage_actual {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (htgt hsrc : (i : I) → R i) (β ρtgt ρsrc : I → ℝ) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (F : ((i : I) → GhostPhaseState (R i)) → ℝ) : (∑ z, (∏ i, ghostPhaseDampedEdge (atgt i) (asrc i) (htgt i) (hsrc i) (β i) (ρtgt i) (ρsrc i) (z i) (w i)) * F z) = ∑ B ∈ (ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt).powerset, let z := ghostPhaseEdgeChoiceOutput atgt asrc hsrc w (fun i => decide (i ∈ B)) (∏ i, ghostPhaseDampedEdge (atgt i) (asrc i) (htgt i) (hsrc i) (β i) (ρtgt i) (ρsrc i) (z i) (w i)) * F z := by rw [ghost_phase_tensor_edge_storage_subsets] apply sum_congr rfl intro B hB apply congrArg (fun t => t * F (ghostPhaseEdgeChoiceOutput atgt asrc hsrc w (fun i => decide (i ∈ B)))) apply prod_congr rfl intro i _ have hs : decide (i ∈ B) = true → atgt i = false ∧ asrc i = true := by intro hi have h := mem_powerset.mp hB (of_decide_eq_true hi) simpa [ghostPhaseActivitySupport, and_comm] using h simpa only [ghostPhaseEdgeChoiceOutput, decide_eq_true_eq] using (ghost_phase_edge_selected_weight (atgt i) (asrc i) (decide (i ∈ B)) (htgt i) (hsrc i) (β i) (ρtgt i) (ρsrc i) (w i) (hw i) hs).symm /- Moving-frame storage outputs translate retained residues and store at minus the displacement; the action still sums once per departing-label subset. -/ theorem ghost_phase_moving_storage_actual {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, AddGroup (R i)] [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (delta : (i : I) → R i) (β ρtgt ρsrc : I → ℝ) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (F : ((i : I) → GhostPhaseState (R i)) → ℝ) : (∑ z, (∏ i, ghostPhaseDampedMovingEdge (atgt i) (asrc i) (delta i) (β i) (ρtgt i) (ρsrc i) (z i) (w i)) * F z) = ∑ B ∈ (ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt).powerset, let z := fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (decide (i ∈ B)) (w i) (∏ i, ghostPhaseDampedMovingEdge (atgt i) (asrc i) (delta i) (β i) (ρtgt i) (ρsrc i) (z i) (w i)) * F z := by simp_rw [ghost_phase_damped_moving_edge_eq_shifted] apply ghost_phase_tensor_edge_storage_actual intro i have h := hw i rcases hwi : w i with _ | (_ | (_ | r)) <;> simpa [hwi, ghostPhaseShift, ghostMemoryShift] using h end section open Finset /- Every old pending index is outside the source-active mask. -/ theorem distinct_phase_old_inactive {J P : Type*} [Fintype P] {R : P → Type*} (asrc : P → Bool) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (f : DistinctOrderedSupport J (ghostPhasePendingSupport w)) (j : J) : asrc (f.val j) = false := by classical have hf := (f.property (f.val j)).mpr ⟨j, rfl⟩ simp only [ghostPhasePendingSupport, mem_filter, mem_univ, true_and] at hf obtain ⟨r, hr⟩ := hf have hm := hw (f.val j) rw [hr] at hm cases ha : asrc (f.val j) <;> simp_all /- Storage indices were source-active and are target-inactive. -/ theorem distinct_phase_storage_active {K P : Type*} [Fintype P] (atgt asrc store : P → Bool) (hs : ∀ p, store p = true → atgt p = false ∧ asrc p = true) (g : DistinctOrderedSupport K (ghostPhaseChoiceSupport store)) (k : K) : atgt (g.val k) = false ∧ asrc (g.val k) = true := by have hg := (g.property (g.val k)).mpr ⟨k, rfl⟩ simp only [ghostPhaseChoiceSupport, mem_filter, mem_univ, true_and] at hg exact hs (g.val k) hg /- The source phase mask guarantees that old and stored ordered labels cannot coincide. No additional distinctness hypothesis is needed. -/ theorem distinct_phase_old_storage_disjoint {J K P : Type*} [Fintype P] {R : P → Type*} (atgt asrc store : P → Bool) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hs : ∀ p, store p = true → atgt p = false ∧ asrc p = true) (f : DistinctOrderedSupport J (ghostPhasePendingSupport w)) (g : DistinctOrderedSupport K (ghostPhaseChoiceSupport store)) : ∀ j k, f.val j ≠ g.val k := by intro j k heq have hf := distinct_phase_old_inactive asrc w hw f j have hg := (distinct_phase_storage_active atgt asrc store hs g k).2 rw [heq, hg] at hf contradiction /- The delete/append embedding enumerates the actual moving output support. -/ theorem distinct_phase_moving_embedding_support {J K P : Type*} [Fintype J] [Fintype K] [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] (atgt asrc store : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hs : ∀ p, store p = true → atgt p = false ∧ asrc p = true) (f : DistinctOrderedSupport J (ghostPhasePendingSupport w)) (g : DistinctOrderedSupport K (ghostPhaseChoiceSupport store)) (hdis : ∀ j k, f.val j ≠ g.val k) : univ.image (distinctSurvivorStorageEmbedding f.val g.val (ghostPhaseActivitySupport atgt) hdis) = ghostPhasePendingSupport (fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (store p) (w p)) := by have hf : univ.image f.val = ghostPhasePendingSupport w := by ext p simp only [mem_image, mem_univ, true_and] exact (f.property p).symm have hg : univ.image g.val = ghostPhaseChoiceSupport store := by ext p simp only [mem_image, mem_univ, true_and] exact (g.property p).symm rw [distinct_survivor_storage_support, hf, hg] exact (ghost_phase_moving_choice_support atgt asrc store delta w hw hs).symm /- The ordered transported/stored residues agree at every actual moving output coordinate, for any proof of old/storage disjointness. -/ theorem distinct_phase_moving_residue {J K P : Type*} [Fintype P] {R : P → Type*} [∀ p, AddGroup (R p)] (atgt asrc store : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hs : ∀ p, store p = true → atgt p = false ∧ asrc p = true) (f : DistinctOrderedSupport J (ghostPhasePendingSupport w)) (g : DistinctOrderedSupport K (ghostPhaseChoiceSupport store)) (hdis : ∀ j k, f.val j ≠ g.val k) (old : (j : J) → R (f.val j)) (hold : ∀ j, w (f.val j) = some (some (some (old j)))) (j : {j : J // f.val j ∉ ghostPhaseActivitySupport atgt} ⊕ K) : let fout := distinctSurvivorStorageEmbedding f.val g.val (ghostPhaseActivitySupport atgt) hdis let rout := distinctSurvivorStorageResidue f.val g.val (ghostPhaseActivitySupport atgt) hdis R (fun p r => r - delta p) old (fun k => -delta (g.val k)) ghostPhaseMovingChoiceTarget (atgt (fout j)) (asrc (fout j)) (delta (fout j)) (store (fout j)) (w (fout j)) = some (some (some (rout j))) := by cases j with | inl j => have ht : atgt (f.val j.val) = false := by have hj := j.property simp only [ghostPhaseActivitySupport, mem_filter, mem_univ, true_and] at hj exact Bool.eq_false_of_not_eq_true hj exact ghost_phase_moving_choice_survivor atgt asrc store delta w hw hs (f.val j.val) (old j.val) (hold j.val) ht | inr k => have hg := (g.property (g.val k)).mpr ⟨k, rfl⟩ have hk : store (g.val k) = true := by simpa only [ghostPhaseChoiceSupport, mem_filter, mem_univ, true_and] using hg exact ghost_phase_moving_choice_stored _ _ _ _ _ hk end section open Finset /- Number of zero residues in an ordered dependent tuple. -/ noncomputable def orderedResidueZeroCount {J : Type*} [Fintype J] {R : J → Type*} [∀ j, Zero (R j)] [∀ j, DecidableEq (R j)] (r : (j : J) → R j) : ℕ := (univ.filter (fun j => r j = 0)).card theorem ordered_zero_count_eq_sum {J : Type*} [Fintype J] {R : J → Type*} [∀ j, Zero (R j)] [∀ j, DecidableEq (R j)] (r : (j : J) → R j) : orderedResidueZeroCount r = ∑ j, if r j = 0 then (1 : ℕ) else 0 := by exact (sum_boole (fun j => r j = 0) univ).symm theorem distinct_ordered_support_image {J P : Type*} [Fintype J] [DecidableEq P] {S : Finset P} (f : DistinctOrderedSupport J S) : univ.image f.val = S := by ext p simp only [mem_image, mem_univ, true_and] exact (f.property p).symm /- A distinct ordered enumeration of actual pending phase coordinates has the same zero count as the full phase-state zero set. -/ theorem distinct_phase_zero_count {J P : Type*} [Fintype J] [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, Zero (R p)] [∀ p, DecidableEq (R p)] {S : Finset P} (f : DistinctOrderedSupport J S) (w : (p : P) → GhostPhaseState (R p)) (hs : ghostPhasePendingSupport w = S) (r : (j : J) → R (f.val j)) (hr : ∀ j, w (f.val j) = some (some (some (r j)))) : orderedResidueZeroCount r = (ghostPhaseZeroSet w).card := by classical unfold orderedResidueZeroCount apply card_bij (fun j _ => f.val j) · intro j hj have hj' : r j = 0 := by simpa only [mem_filter, mem_univ, true_and] using hj simp only [ghostPhaseZeroSet, mem_filter, mem_univ, true_and, hr j, hj'] · intro j hj k hk heq exact f.val.injective heq · intro p hp have hz : w p = some (some (some 0)) := by simpa only [ghostPhaseZeroSet, mem_filter, mem_univ, true_and] using hp have hpS : p ∈ S := by rw [← hs] simp only [ghostPhasePendingSupport, mem_filter, mem_univ, true_and] exact ⟨0, hz⟩ obtain ⟨j, rfl⟩ := (f.property p).mp hpS refine ⟨j, ?_, rfl⟩ simp only [mem_filter, mem_univ, true_and] have h := (hr j).symm.trans hz simpa only [Option.some.injEq] using h /- Source damping includes zero residues that will be promoted as well as zero residues that will remain in pending memory. -/ theorem ordered_zero_count_partition {J P : Type*} [Fintype J] [DecidableEq P] (f : J ↪ P) (T : Finset P) (R : P → Type*) [∀ p, Zero (R p)] [∀ p, DecidableEq (R p)] (old : (j : J) → R (f j)) : orderedResidueZeroCount old = (univ.filter (fun j => f j ∉ T ∧ old j = 0)).card + (univ.filter (fun j => f j ∈ T ∧ old j = 0)).card := by classical simpa only [orderedResidueZeroCount, filter_filter, not_not, and_comm] using (card_filter_add_card_filter_not (s := univ.filter (fun j => old j = 0)) (fun j => f j ∉ T)).symm end section open Finset /- Exact normalized edge action with both endpoint damping factors and the fresh-label measure. Compatibility is retained even for zero-weight choices. -/ theorem ghost_phase_measured_edge_storage {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, AddGroup (R i)] [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (delta : (i : I) → R i) (β : I → ℝ) (ρtgt ρsrc V : ℝ) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (F : ((i : I) → GhostPhaseState (R i)) → ℝ) : (∑ z, (∏ i, (if atgt i && !(asrc i) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt i) (asrc i) (delta i) (β i) ρtgt ρsrc (z i) (w i)) * F z) = ∑ B ∈ (ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt).powerset, let z := fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (decide (i ∈ B)) (w i) (ρsrc ^ (ghostPhaseZeroSet w).card * ρtgt ^ (ghostPhaseZeroSet z).card * (V⁻¹) ^ (ghostPhasePromotionSet atgt w).card * (∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i / V) * (if ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true then 1 else 0)) * F z := by let N := ∏ i, if atgt i && !(asrc i) then V⁻¹ else 1 have hN : (∑ z, (∏ i, (if atgt i && !(asrc i) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt i) (asrc i) (delta i) (β i) ρtgt ρsrc (z i) (w i)) * F z) = ∑ z, (∏ i, ghostPhaseDampedMovingEdge (atgt i) (asrc i) (delta i) (β i) ρtgt ρsrc (z i) (w i)) * (N * F z) := by apply sum_congr rfl intro z _ rw [prod_mul_distrib] dsimp only [N] ring rw [hN, ghost_phase_moving_storage_actual atgt asrc delta β (fun _ => ρtgt) (fun _ => ρsrc) w hw (fun z => N * F z)] apply sum_congr rfl intro B hB have hs : ∀ i, decide (i ∈ B) = true → atgt i = false ∧ asrc i = true := by intro i hi have h := mem_powerset.mp hB (of_decide_eq_true hi) simpa [ghostPhaseActivitySupport, and_comm] using h have hc := ghost_phase_run_normalized_edge_fresh_measure atgt asrc (fun i => decide (i ∈ B)) delta β ρtgt ρsrc V w hw hs rw [prod_mul_distrib] at hc dsimp only dsimp only [N] rw [← mul_assoc, mul_comm _ (∏ i, if atgt i && !(asrc i) then V⁻¹ else 1), hc] /- The same actual edge action indexed by the canonical departing source slots. The label embedding is injective; storage subsets carry no factorial. -/ theorem ghost_phase_measured_edge_slots {J I : Type*} [Fintype J] [DecidableEq J] [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, AddGroup (R i)] [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (delta : (i : I) → R i) (β : I → ℝ) (ρtgt ρsrc V : ℝ) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (g : J ↪ I) (hg : univ.image g = ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt) (F : ((i : I) → GhostPhaseState (R i)) → ℝ) : (∑ z, (∏ i, (if atgt i && !(asrc i) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt i) (asrc i) (delta i) (β i) ρtgt ρsrc (z i) (w i)) * F z) = ∑ S ∈ (univ : Finset J).powerset, let z := fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (decide (i ∈ S.image g)) (w i) (ρsrc ^ (ghostPhaseZeroSet w).card * ρtgt ^ (ghostPhaseZeroSet z).card * (V⁻¹) ^ (ghostPhasePromotionSet atgt w).card * (∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i / V) * (if ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true then 1 else 0)) * F z := by rw [ghost_phase_measured_edge_storage atgt asrc delta β ρtgt ρsrc V w hw F, ← hg, distinct_slot_subset_sum] end section open Finset /- A real kernel identity for all real tests extends to complex tests. -/ theorem finite_real_action_complex {X J : Type*} [Fintype X] (S : Finset J) (K : X → ℝ) (W : J → ℝ) (out : J → X) (h : ∀ f : X → ℝ, (∑ x, K x * f x) = ∑ j ∈ S, W j * f (out j)) (F : X → ℂ) : (∑ x, (K x : ℂ) * F x) = ∑ j ∈ S, (W j : ℂ) * F (out j) := by apply Complex.ext · simpa using h (fun x => (F x).re) · simpa using h (fun x => (F x).im) /- Canonical departing-slot form, with the physical complex continuation and no storage factorial. -/ theorem ghost_phase_measured_edge_complex_slots {J I : Type*} [Fintype J] [DecidableEq J] [Fintype I] [DecidableEq I] {R : I → Type*} [∀ i, AddGroup (R i)] [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (atgt asrc : I → Bool) (delta : (i : I) → R i) (β : I → ℝ) (ρtgt ρsrc V : ℝ) (w : (i : I) → GhostPhaseState (R i)) (hw : ghostPhaseMask asrc w) (g : J ↪ I) (hg : univ.image g = ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt) (F : ((i : I) → GhostPhaseState (R i)) → ℂ) : (∑ z, ((∏ i, (if atgt i && !(asrc i) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt i) (asrc i) (delta i) (β i) ρtgt ρsrc (z i) (w i) : ℝ) : ℂ) * F z) = ∑ S ∈ (univ : Finset J).powerset, let z := fun i => ghostPhaseMovingChoiceTarget (atgt i) (asrc i) (delta i) (decide (i ∈ S.image g)) (w i) ((ρsrc ^ (ghostPhaseZeroSet w).card * ρtgt ^ (ghostPhaseZeroSet z).card * (V⁻¹) ^ (ghostPhasePromotionSet atgt w).card * (∏ i ∈ ghostPhaseFreshSet atgt asrc w, β i / V) * (if ∀ i, ghostPhaseMovingEdgeCompatible (atgt i) (asrc i) (delta i) (w i) = true then 1 else 0) : ℝ) : ℂ) * F z := by exact finite_real_action_complex _ _ _ _ (ghost_phase_measured_edge_slots atgt asrc delta β ρtgt ρsrc V w hw g hg) F end section open Finset Classical /- Choosing eligible indices is equivalent to an ambient embedding together with the assertion that every chosen index lies in the eligible set. -/ def promotionIndexEquiv {A J : Type*} (Z : Finset J) : (A ↪ ↥Z) ≃ {e : A ↪ J // ∀ a, e a ∈ Z} where toFun e := ⟨e.trans ⟨Subtype.val, Subtype.val_injective⟩, fun a => (e a).property⟩ invFun e := ⟨fun a => ⟨e.val a, e.property a⟩, fun _ _ h => e.val.injective (congrArg Subtype.val h)⟩ left_inv e := by ext a; rfl right_inv e := by apply Subtype.ext; ext a; rfl /- Exact reindexing into the eligible embedding type. The summand can retain all information about the old particle indices and their numerical labels. -/ theorem promotionChoice_sum_ambient {A J M : Type*} [Fintype A] [Fintype J] [AddCommMonoid M] (Z : Finset J) (F : (A ↪ J) → M) : (∑ e : A ↪ ↥Z, F (e.trans ⟨Subtype.val, Subtype.val_injective⟩)) = ∑ e : A ↪ J, if ∀ a, e a ∈ Z then F e else 0 := by calc _ = ∑ e : {e : A ↪ J // ∀ a, e a ∈ Z}, F e.val := (promotionIndexEquiv Z).sum_comp (fun e => F e.val) _ = ∑ e ∈ (univ : Finset (A ↪ J)).filter (fun e => ∀ a, e a ∈ Z), F e := (sum_subtype _ (by simp) F).symm _ = _ := sum_filter _ _ /- Distinct specified slots are filled by distinct eligible old indices. -/ theorem promotionChoice_card {A J : Type*} [Fintype A] (Z : Finset J) : Fintype.card (A ↪ ↥Z) = Z.card.descFactorial (Fintype.card A) := by simpa only [Fintype.card_coe] using (Fintype.card_embedding_eq (α := A) (β := ↥Z)) /- Old indices selected by an ordered promotion choice. -/ def promotionSelectedIndices {A J : Type*} [Fintype A] {Z : Finset J} (e : A ↪ ↥Z) : Finset J := univ.map (e.trans ⟨Subtype.val, Subtype.val_injective⟩) section variable {A J : Type*} [sharedInstance1 : Fintype A] {Z : Finset J} (e : A ↪ ↥Z) include A J sharedInstance1 Z e theorem promotionSelectedIndices_card : (promotionSelectedIndices e).card = Fintype.card A := by simp only [promotionSelectedIndices, card_map, card_univ] theorem promotionSelectedIndices_subset : promotionSelectedIndices e ⊆ Z := by intro j hj obtain ⟨a, _, rfl⟩ := mem_map.mp hj exact (e a).property theorem promotionSlots_card_le : Fintype.card A ≤ Z.card := by simpa only [Fintype.card_coe] using Fintype.card_le_of_embedding e end /- Removing a promotion choice leaves exactly the unselected eligible indices. -/ theorem promotionEligibleSurvivors_card {A J : Type*} [Fintype A] [DecidableEq J] {Z : Finset J} (e : A ↪ ↥Z) : (Z \ promotionSelectedIndices e).card = Z.card - Fintype.card A := by rw [card_sdiff_of_subset (promotionSelectedIndices_subset e), promotionSelectedIndices_card] /- Total old memory loses one index for each promoted slot, including when different old indices carry equal numerical particle values. -/ theorem promotionOldSurvivors_card {A J : Type*} [Fintype A] [Fintype J] [DecidableEq J] {Z : Finset J} (e : A ↪ ↥Z) : ((univ : Finset J) \ promotionSelectedIndices e).card = Fintype.card J - Fintype.card A := by rw [card_sdiff_of_subset (subset_univ _), promotionSelectedIndices_card, card_univ] end section open Finset Classical noncomputable def unrestrictedEdgeDampingBound (ρ vmin : ℝ) (T : ℕ) : ℝ := ((T.factorial : ℝ) * (max 1 (1 / vmin)) ^ T) / (1 - ρ) ^ (T + 1) noncomputable def unrestrictedEdgeChoiceBound (ρ v vmin : ℝ) (T : ℕ) : ℝ := unrestrictedEdgeDampingBound ρ vmin T * v ^ T * 2 ^ T noncomputable def unrestrictedEdgeRowBound (ρ v vmin : ℝ) (T : ℕ) : ℝ := 4 ^ T * unrestrictedEdgeChoiceBound ρ v vmin T noncomputable def unrestrictedEdgeReversalBound (vmin vmax : ℝ) (T : ℕ) : ℝ := (max 1 vmax) ^ T * (max 1 (1 / vmin)) ^ T /- For a promotions and b stores among t slots: ordered retrieval and remaining output damping, promotion normalization, Schur weight change, and fresh mass. The ratio v^b/v^a is exactly the integer-exponent factor v^(b-a). -/ noncomputable def unrestrictedEdgeChoiceCost (ρ v V mass : ℝ) (z t a b : ℕ) : ℝ := (((z.descFactorial a : ℝ) * ρ ^ (z - a)) / V ^ a) * (v ^ b / v ^ a) * mass ^ (t - a) theorem unrestrictedEdgeDampingBound_nonneg {ρ vmin : ℝ} (hρ : ρ < 1) (T : ℕ) : 0 ≤ unrestrictedEdgeDampingBound ρ vmin T := by unfold unrestrictedEdgeDampingBound have hd : 0 < 1 - ρ := sub_pos.mpr hρ have hm : 0 ≤ max 1 (1 / vmin) := le_trans zero_le_one (le_max_left _ _) positivity theorem unrestrictedEdgeChoiceCost_nonneg {ρ v V mass : ℝ} (hρ : 0 ≤ ρ) (hv : 0 ≤ v) (hV : 0 ≤ V) (hmass : 0 ≤ mass) (z t a b : ℕ) : 0 ≤ unrestrictedEdgeChoiceCost ρ v V mass z t a b := by unfold unrestrictedEdgeChoiceCost positivity /- Ordered retrievals are controlled uniformly, including the impossible case z if hi : i ∈ T then promoted ⟨i, hi⟩ else fresh ⟨i, hi⟩ theorem unrestrictedTargetLabels_promoted {I P : Type*} [DecidableEq I] (T : Finset I) (promoted : T → P) (fresh : UnrestrictedFreshLabels P T) (i : T) : unrestrictedTargetLabels T promoted fresh i.val = promoted i := by simp [unrestrictedTargetLabels, i.property] theorem unrestrictedTargetLabels_fresh {I P : Type*} [DecidableEq I] (T : Finset I) (promoted : T → P) (fresh : UnrestrictedFreshLabels P T) (i : {i : I // i ∉ T}) : unrestrictedTargetLabels T promoted fresh i.val = fresh i := by simp [unrestrictedTargetLabels, i.property] /- The complementary slots have exactly total-slot-count minus promotion-count entries. -/ theorem unrestricted_fresh_slot_card {I : Type*} [Fintype I] [DecidableEq I] (T : Finset I) : Fintype.card {i : I // i ∉ T} = Fintype.card I - T.card := by rw [Fintype.card_subtype_compl] simp noncomputable def unrestrictedFreshWeight {I P : Type*} [Fintype I] [DecidableEq I] (μ : P → ℝ) (T : Finset I) (fresh : UnrestrictedFreshLabels P T) : ℝ := ∏ i : {i : I // i ∉ T}, μ (fresh i) theorem unrestrictedFreshWeight_nonneg {I P : Type*} [Fintype I] [DecidableEq I] (μ : P → ℝ) (T : Finset I) (hμ : ∀ p, 0 ≤ μ p) (fresh : UnrestrictedFreshLabels P T) : 0 ≤ unrestrictedFreshWeight μ T fresh := prod_nonneg fun i _ => hμ (fresh i) /- The unrestricted product draw has exactly the corresponding power of the total fresh mass. -/ theorem unrestricted_fresh_mass_eq {I P : Type*} [Fintype I] [DecidableEq I] [Fintype P] (μ : P → ℝ) (T : Finset I) : (∑ fresh : UnrestrictedFreshLabels P T, unrestrictedFreshWeight μ T fresh) = (∑ p : P, μ p) ^ (Fintype.card I - T.card) := by unfold unrestrictedFreshWeight rw [← Fintype.prod_sum] simp only [prod_const, card_univ, unrestricted_fresh_slot_card] end section open Finset Classical noncomputable def orderedPredicateCount {Z : Type*} (q : FiniteOrderedTuple Z) (hit : Z → Prop) : ℕ := ∑ j, if hit (q.2 j) then 1 else 0 theorem orderedPredicateCount_append {Z : Type*} {m n : ℕ} (p : Fin m → Z) (q : Fin n → Z) (hit : Z → Prop) : orderedPredicateCount ⟨m + n, Fin.addCases p q⟩ hit = orderedPredicateCount ⟨m, p⟩ hit + orderedPredicateCount ⟨n, q⟩ hit := by unfold orderedPredicateCount rw [Fin.sum_univ_add] simp only [Fin.addCases_left, Fin.addCases_right] theorem orderedPredicateCount_retained {Z : Type*} {N : ℕ} (p : Fin N → Z) (s : Finset (Fin N)) (hit : Z → Prop) : orderedPredicateCount ⟨s.card, retainedOrderedTuple p s⟩ hit = (s.filter (fun j => hit (p j))).card := by unfold orderedPredicateCount retainedOrderedTuple rw [s.equivFin.symm.sum_comp (fun j : s => if hit (p j.val) then 1 else 0)] calc _ = ∑ j ∈ s, if hit (p j) then 1 else 0 := sum_coe_sort s (fun j => if hit (p j) then 1 else 0) _ = _ := by simp /- Survivors of a promotion choice are old indices, never newly stored entries. -/ noncomputable def unrestrictedEdgeSurvivors {A : Type*} [Fintype A] {N : ℕ} {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) : Finset (Fin N) := univ \ promotionSelectedIndices e /- Store the source entries, transport all memory, and remove the selected old indices. This order is equivalent to transport-then-delete because the promotion injection only ranges over the original index set. -/ noncomputable def unrestrictedEdgeMemory {A Z : Type*} [Fintype A] {N b : ℕ} (old : Fin N → Z) (transport : Z → Z) (stored : Fin b → Z) {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) : FiniteOrderedTuple Z := retainedBirthTuple (transport ∘ old) (unrestrictedEdgeSurvivors e) (transport ∘ stored) section variable {A Z : Type*} [sharedInstance1 : Fintype A] {N b : ℕ} (old : Fin N → Z) (transport : Z → Z) (stored : Fin b → Z) include A Z sharedInstance1 N b old transport stored theorem unrestrictedEdgeMemory_length {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) : (unrestrictedEdgeMemory old transport stored e).1 = N - Fintype.card A + b := by change (univ \ promotionSelectedIndices e).card + b = _ rw [promotionOldSurvivors_card] simp only [Fintype.card_fin] /- Every eligible old particle that is not promoted survives as an output zero. Newly stored particles can only increase the number of output zeros. -/ theorem unrestrictedEdgeMemory_hit_count_le (hit : Z → Prop) {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) (heligible : ∀ j ∈ eligible, hit (transport (old j))) : eligible.card - Fintype.card A ≤ orderedPredicateCount (unrestrictedEdgeMemory old transport stored e) hit := by rw [← promotionEligibleSurvivors_card e] change (eligible \ promotionSelectedIndices e).card ≤ orderedPredicateCount ⟨(unrestrictedEdgeSurvivors e).card + b, Fin.addCases (retainedOrderedTuple (transport ∘ old) (unrestrictedEdgeSurvivors e)) (transport ∘ stored)⟩ hit rw [orderedPredicateCount_append, orderedPredicateCount_retained] apply (card_le_card ?_).trans (Nat.le_add_right _ _) intro j hj obtain ⟨hjE, hjN⟩ := mem_sdiff.mp hj exact mem_filter.mpr ⟨mem_sdiff.mpr ⟨mem_univ _, hjN⟩, heligible j hjE⟩ theorem unrestrictedEdgeMemory_damping_le (hit : Z → Prop) {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) (heligible : ∀ j ∈ eligible, hit (transport (old j))) {ρ : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) : ρ ^ orderedPredicateCount (unrestrictedEdgeMemory old transport stored e) hit ≤ ρ ^ (eligible.card - Fintype.card A) := pow_le_pow_of_le_one hρ0 hρ1 (unrestrictedEdgeMemory_hit_count_le old transport stored hit e heligible) /- The literal input and output damping factors admit the old-survivor bound. -/ theorem unrestrictedEdgeMemory_two_damping_le (hit : Z → Prop) {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) (heligible : ∀ j ∈ eligible, hit (transport (old j))) {ρ : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) : ρ ^ orderedPredicateCount ⟨N, old⟩ hit * ρ ^ orderedPredicateCount (unrestrictedEdgeMemory old transport stored e) hit ≤ ρ ^ (eligible.card - Fintype.card A) := by have hi : ρ ^ orderedPredicateCount ⟨N, old⟩ hit ≤ 1 := pow_le_one₀ hρ0 hρ1 calc _ ≤ 1 * ρ ^ orderedPredicateCount (unrestrictedEdgeMemory old transport stored e) hit := mul_le_mul_of_nonneg_right hi (pow_nonneg hρ0 _) _ ≤ _ := by simpa only [one_mul] using unrestrictedEdgeMemory_damping_le old transport stored hit e heligible hρ0 hρ1 /- Exact change of the geometric memory weight for each individual event. -/ theorem unrestrictedEdgeMemory_weight {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) {v : ℝ} (hv : v ≠ 0) : v ^ (unrestrictedEdgeMemory old transport stored e).1 = v ^ N * (v ^ b / v ^ Fintype.card A) := by have ha : Fintype.card A ≤ N := (promotionSlots_card_le e).trans (by simpa using card_le_card (subset_univ eligible)) rw [unrestrictedEdgeMemory_length, pow_add] have hn : v ^ N = v ^ (N - Fintype.card A) * v ^ Fintype.card A := by rw [← pow_add, Nat.sub_add_cancel ha] rw [hn] field_simp end end section open Finset Classical /- The selected old indices and their complement reconstruct every old index. -/ noncomputable def promotionIndexSplit {A J : Type*} (e : A ↪ J) : A ⊕ {j : J // j ∉ Set.range e} ≃ J := (Equiv.sumCongr (Equiv.ofInjective e e.injective) (Equiv.refl _)).trans (Equiv.sumCompl (fun j => j ∈ Set.range e)) end section open Finset Classical abbrev UnrestrictedResidueParticle {P : Type*} (n : P → ℕ) := Σ p : P, ZMod (n p) /- Move the residue frame by Δ without changing the particle label. -/ def unrestrictedResidueTransport {P : Type*} (n : P → ℕ) (Δ : ℤ) : UnrestrictedResidueParticle n ≃ UnrestrictedResidueParticle n where toFun z := ⟨z.1, z.2 - (Δ : ZMod (n z.1))⟩ invFun z := ⟨z.1, z.2 + (Δ : ZMod (n z.1))⟩ left_inv := by rintro ⟨p, r⟩; simp right_inv := by rintro ⟨p, r⟩; simp theorem unrestrictedResidueTransport_apply {P : Type*} (n : P → ℕ) (Δ : ℤ) (p : P) (r : ZMod (n p)) : unrestrictedResidueTransport n Δ ⟨p, r⟩ = ⟨p, r - (Δ : ZMod (n p))⟩ := rfl theorem unrestrictedResidueTransport_symm {P : Type*} (n : P → ℕ) (Δ : ℤ) : (unrestrictedResidueTransport n Δ).symm = unrestrictedResidueTransport n (-Δ) := by apply Equiv.ext rintro ⟨p, r⟩ simp [unrestrictedResidueTransport] /- Birth or storage starts a particle at residue zero. -/ def unrestrictedResidueSeed {P : Type*} (n : P → ℕ) (p : P) : UnrestrictedResidueParticle n := ⟨p, 0⟩ def unrestrictedResidueHit {P : Type*} {n : P → ℕ} (z : UnrestrictedResidueParticle n) : Prop := z.2 = 0 theorem unrestrictedResidueTransport_seed {P : Type*} (n : P → ℕ) (Δ : ℤ) (p : P) : unrestrictedResidueTransport n Δ (unrestrictedResidueSeed n p) = ⟨p, -(Δ : ZMod (n p))⟩ := by simp [unrestrictedResidueTransport, unrestrictedResidueSeed] /- Under the minus-displacement convention, an old particle hits zero exactly when its old residue equals the displacement. -/ theorem unrestrictedResidueTransport_hit_iff {P : Type*} (n : P → ℕ) (Δ : ℤ) (z : UnrestrictedResidueParticle n) : unrestrictedResidueHit (unrestrictedResidueTransport n Δ z) ↔ z.2 = (Δ : ZMod (n z.1)) := by rcases z with ⟨p, r⟩ change r - (Δ : ZMod (n p)) = 0 ↔ r = (Δ : ZMod (n p)) exact sub_eq_zero /- The particle measure is label mass times counting measure on residues. -/ def unrestrictedResidueWeight {P : Type*} {n : P → ℕ} (μ : P → ℝ) (z : UnrestrictedResidueParticle n) : ℝ := μ z.1 theorem unrestrictedResidueWeight_transport {P : Type*} (n : P → ℕ) (μ : P → ℝ) (Δ : ℤ) (z : UnrestrictedResidueParticle n) : unrestrictedResidueWeight μ (unrestrictedResidueTransport n Δ z) = unrestrictedResidueWeight μ z := rfl /- Eligibility retains old particle indices and requires the dilation ban. Nothing in this definition identifies particles with equal labels or residues. -/ noncomputable def unrestrictedResidueEligible {P : Type*} {N : ℕ} (n : P → ℕ) (Δ D : ℤ) (old : Fin N → UnrestrictedResidueParticle n) : Finset (Fin N) := univ.filter fun j => (old j).2 = (Δ : ZMod (n (old j).1)) ∧ ¬ (n (old j).1 : ℤ) ∣ D section variable {P : Type*} {N : ℕ} (n : P → ℕ) (Δ D : ℤ) (old : Fin N → UnrestrictedResidueParticle n) include P N n Δ D old theorem mem_unrestrictedResidueEligible (j : Fin N) : j ∈ unrestrictedResidueEligible n Δ D old ↔ (old j).2 = (Δ : ZMod (n (old j).1)) ∧ ¬ (n (old j).1 : ℤ) ∣ D := by simp [unrestrictedResidueEligible] theorem unrestrictedResidueEligible_iff_hit (j : Fin N) : j ∈ unrestrictedResidueEligible n Δ D old ↔ unrestrictedResidueHit (unrestrictedResidueTransport n Δ (old j)) ∧ ¬ (n (old j).1 : ℤ) ∣ D := by rw [mem_unrestrictedResidueEligible, unrestrictedResidueTransport_hit_iff] /- The precise translated-hit hypothesis consumed by the generic ordered memory survivor/damping theorems. -/ theorem unrestrictedResidueEligible_translated_hit : ∀ j ∈ unrestrictedResidueEligible n Δ D old, unrestrictedResidueHit (unrestrictedResidueTransport n Δ (old j)) := by intro j hj exact ((unrestrictedResidueEligible_iff_hit n Δ D old j).mp hj).1 end end section open Finset Classical noncomputable def unrestrictedStoredTuple {P Z : Type*} {t : ℕ} (source : Fin t → P) (seed : P → Z) (stores : Finset (Fin t)) : Fin stores.card → Z := retainedOrderedTuple (seed ∘ source) stores noncomputable def unrestrictedEdgeOutput {P Z : Type*} {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) (stores promotions : Finset (Fin t)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) : FiniteOrderedTuple Z := unrestrictedEdgeMemory old transport (unrestrictedStoredTuple source seed stores) e noncomputable def unrestrictedEdgeTarget {P Z : Type*} {t N : ℕ} (old : Fin N → Z) (label : Z → P) (promotions : Finset (Fin t)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (fresh : UnrestrictedFreshLabels P promotions) : Fin t → P := unrestrictedTargetLabels promotions (fun i => label (old (e i).val)) fresh /- The two damping factors occur on the actual input and output memories. -/ noncomputable def unrestrictedEdgeEventMass {P Z : Type*} {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V : ℝ) (stores promotions : Finset (Fin t)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (fresh : UnrestrictedFreshLabels P promotions) : ℝ := (ρ ^ orderedPredicateCount ⟨N, old⟩ hit * ρ ^ orderedPredicateCount (unrestrictedEdgeOutput source old seed transport stores promotions e) hit / V ^ promotions.card) * unrestrictedFreshWeight μ promotions fresh section variable {P Z : Type*} {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) {ρ V : ℝ} include P Z t N source old seed transport hit μ ρ V theorem unrestrictedEdgeEventMass_nonneg (hρ : 0 ≤ ρ) (hV : 0 ≤ V) (hμ : ∀ p, 0 ≤ μ p) (stores promotions : Finset (Fin t)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (fresh : UnrestrictedFreshLabels P promotions) : 0 ≤ unrestrictedEdgeEventMass source old seed transport hit μ ρ V stores promotions e fresh := by unfold unrestrictedEdgeEventMass exact mul_nonneg (div_nonneg (mul_nonneg (pow_nonneg hρ _) (pow_nonneg hρ _)) (pow_nonneg hV _)) (unrestrictedFreshWeight_nonneg μ promotions hμ fresh) theorem unrestrictedEdgeEventMass_le (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) (hV : 0 ≤ V) (hμ : ∀ p, 0 ≤ μ p) (stores promotions : Finset (Fin t)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (heligible : ∀ j ∈ eligible, hit (transport (old j))) (fresh : UnrestrictedFreshLabels P promotions) : unrestrictedEdgeEventMass source old seed transport hit μ ρ V stores promotions e fresh ≤ (ρ ^ (eligible.card - promotions.card) / V ^ promotions.card) * unrestrictedFreshWeight μ promotions fresh := by unfold unrestrictedEdgeEventMass unrestrictedEdgeOutput apply mul_le_mul_of_nonneg_right _ (unrestrictedFreshWeight_nonneg μ promotions hμ fresh) apply div_le_div_of_nonneg_right _ (pow_nonneg hV _) simpa only [Fintype.card_coe] using unrestrictedEdgeMemory_two_damping_le old transport (unrestrictedStoredTuple source seed stores) hit e heligible hρ0 hρ1 end noncomputable def unrestrictedEdgeChoiceRowMass {P Z : Type*} [Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V v : ℝ) (eligible : Finset (Fin N)) (stores promotions : Finset (Fin t)) : ℝ := ∑ e : promotions ↪ ↥eligible, ∑ fresh : UnrestrictedFreshLabels P promotions, unrestrictedEdgeEventMass source old seed transport hit μ ρ V stores promotions e fresh * v ^ (unrestrictedEdgeOutput source old seed transport stores promotions e).1 theorem unrestricted_edge_choice_row_mass_le {P Z : Type*} [Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) {ρ V v : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) (hV : 0 ≤ V) (hv : 0 < v) (hμ : ∀ p, 0 ≤ μ p) (eligible : Finset (Fin N)) (heligible : ∀ j ∈ eligible, hit (transport (old j))) (stores promotions : Finset (Fin t)) : unrestrictedEdgeChoiceRowMass source old seed transport hit μ ρ V v eligible stores promotions ≤ v ^ N * unrestrictedEdgeChoiceCost ρ v V (∑ p, μ p) eligible.card t promotions.card stores.card := by calc _ ≤ ∑ e : promotions ↪ ↥eligible, ∑ fresh : UnrestrictedFreshLabels P promotions, (ρ ^ (eligible.card - promotions.card) / V ^ promotions.card) * unrestrictedFreshWeight μ promotions fresh * (v ^ N * (v ^ stores.card / v ^ promotions.card)) := by apply sum_le_sum intro e he apply sum_le_sum intro fresh hf have hout : v ^ (unrestrictedEdgeOutput source old seed transport stores promotions e).1 = v ^ N * (v ^ stores.card / v ^ promotions.card) := by simpa only [unrestrictedEdgeOutput, Fintype.card_coe] using unrestrictedEdgeMemory_weight old transport (unrestrictedStoredTuple source seed stores) e (ne_of_gt hv) rw [← hout] exact mul_le_mul_of_nonneg_right (unrestrictedEdgeEventMass_le source old seed transport hit μ hρ0 hρ1 hV hμ stores promotions e heligible fresh) (pow_nonneg hv.le _) _ = _ := by simp_rw [← sum_mul, ← mul_sum] simp_rw [unrestricted_fresh_mass_eq μ promotions] simp only [Fintype.card_fin, sum_const, card_univ, nsmul_eq_mul, promotionChoice_card, Fintype.card_coe] unfold unrestrictedEdgeChoiceCost ring noncomputable def unrestrictedEdgeRowMass {P Z : Type*} [Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V v : ℝ) (eligible : Finset (Fin N)) : ℝ := ∑ stores : Finset (Fin t), ∑ promotions : Finset (Fin t), unrestrictedEdgeChoiceRowMass source old seed transport hit μ ρ V v eligible stores promotions section variable {P Z : Type*} [sharedInstance1 : Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) include P Z sharedInstance1 t N source old seed transport hit μ theorem unrestricted_edge_row_mass_le_cost {ρ V v : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) (hV : 0 ≤ V) (hv : 0 < v) (hμ : ∀ p, 0 ≤ μ p) (eligible : Finset (Fin N)) (heligible : ∀ j ∈ eligible, hit (transport (old j))) : unrestrictedEdgeRowMass source old seed transport hit μ ρ V v eligible ≤ v ^ N * unrestrictedEdgeRowCost ρ v V (∑ p, μ p) t (fun _ _ => eligible.card) := by unfold unrestrictedEdgeRowMass unrestrictedEdgeRowCost simp_rw [mul_sum] apply sum_le_sum intro stores hs apply sum_le_sum intro promotions hp exact unrestricted_edge_choice_row_mass_le source old seed transport hit μ hρ0 hρ1 hV hv hμ eligible heligible stores promotions theorem unrestricted_edge_row_mass_le {ρ V v vmin : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : vmin ≤ V) (hμ : ∀ p, 0 ≤ μ p) (hmass : ∑ p, μ p ≤ 2) (eligible : Finset (Fin N)) (heligible : ∀ j ∈ eligible, hit (transport (old j))) (T : ℕ) (ht : t ≤ T) : unrestrictedEdgeRowMass source old seed transport hit μ ρ V v eligible ≤ v ^ N * unrestrictedEdgeRowBound ρ v vmin T := by have hv0 : 0 < v := zero_lt_one.trans hv exact (unrestricted_edge_row_mass_le_cost source old seed transport hit μ hρ0.le hρ1.le (hvmin.trans_le hV).le hv0 hμ eligible heligible).trans (mul_le_mul_of_nonneg_left (unrestricted_edge_row_cost_le hρ0 hρ1 hv hvmin hV (sum_nonneg fun p _ => hμ p) hmass T t ht (fun _ _ => eligible.card)) (pow_nonneg hv0.le _)) end end section open Finset Classical noncomputable def unrestrictedEdgeAction {P Z : Type*} [Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (label : Z → P) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V : ℝ) (eligible : Finset (Fin N)) (B : ℕ) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥eligible) → UnrestrictedFreshLabels P promotions → ℂ) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) : ℂ := ∑ stores : Finset (Fin t), ∑ promotions : Finset (Fin t), ∑ e : promotions ↪ ↥eligible, ∑ fresh : UnrestrictedFreshLabels P promotions, (unrestrictedEdgeEventMass source old seed transport hit μ ρ V stores promotions e fresh : ℂ) * phase stores promotions e fresh * (if (unrestrictedEdgeOutput source old seed transport stores promotions e).1 ≤ B then F (unrestrictedEdgeTarget old label promotions e fresh) (unrestrictedEdgeOutput source old seed transport stores promotions e) else 0) end section open Finset Classical def unrestrictedResidueStorageAllowed {P : Type*} {t : ℕ} (n : P → ℕ) (D : ℤ) (source : Fin t → P) (stores : Finset (Fin t)) : Prop := ∀ i ∈ stores, ¬ (n (source i) : ℤ) ∣ D /- The displacement and dilation are fixed before the target fresh draws. Storage and promotion both obey the dilation ban; only old indices may be promoted. A phase can record additional bounded physical multipliers. -/ noncomputable def unrestrictedResidueEdgeAction {P : Type*} [Fintype P] {t N : ℕ} (n : P → ℕ) (Δ D : ℤ) (source : Fin t → P) (old : Fin N → UnrestrictedResidueParticle n) (μ : P → ℝ) (ρ V : ℝ) (B : ℕ) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥(unrestrictedResidueEligible n Δ D old)) → UnrestrictedFreshLabels P promotions → ℂ) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : ℂ := unrestrictedEdgeAction source old Sigma.fst (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ ρ V (unrestrictedResidueEligible n Δ D old) B (fun stores promotions e fresh => if unrestrictedResidueStorageAllowed n D source stores then phase stores promotions e fresh else 0) F end section open Finset Classical /- Old indices not selected by the ordered retrieval. -/ noncomputable def retrievalSurvivorIndices {a n : ℕ} (e : Fin a ↪ Fin n) : Finset (Fin n) := univ \ univ.map e theorem mem_retrievalSurvivorIndices {a n : ℕ} (e : Fin a ↪ Fin n) (j : Fin n) : j ∈ retrievalSurvivorIndices e ↔ j ∉ Set.range e := by simp [retrievalSurvivorIndices, Set.mem_range] theorem retrieval_survivor_card {a n : ℕ} (e : Fin a ↪ Fin n) : (retrievalSurvivorIndices e).card = n - a := by rw [retrievalSurvivorIndices, card_sdiff_of_subset (subset_univ _)] simp /- Identify the complement subtype with the existing retained tuple's index set. -/ noncomputable def retrievalSurvivorEquiv {a n : ℕ} (e : Fin a ↪ Fin n) : {j : Fin n // j ∉ Set.range e} ≃ Fin (retrievalSurvivorIndices e).card := (Equiv.subtypeEquivRight (fun j => (mem_retrievalSurvivorIndices e j).symm)).trans (retrievalSurvivorIndices e).equivFin /- The selected and retained finite coordinates enumerate all old indices. -/ noncomputable def retrievalIndexSplit {a n : ℕ} (e : Fin a ↪ Fin n) : Fin a ⊕ Fin (retrievalSurvivorIndices e).card ≃ Fin n := (Equiv.sumCongr (Equiv.refl _) (retrievalSurvivorEquiv e).symm).trans (promotionIndexSplit e) /- The coordinate split with the retained tuple's precise enumeration. -/ noncomputable def retrievalTupleSplit {a n : ℕ} (e : Fin a ↪ Fin n) (Z : Type*) : (Fin n → Z) ≃ (Fin a → Z) × (Fin (retrievalSurvivorIndices e).card → Z) := (Equiv.arrowCongr (retrievalIndexSplit e).symm (Equiv.refl Z)).trans (Equiv.sumArrowEquivProdArrow (Fin a) (Fin (retrievalSurvivorIndices e).card) Z) section variable {a n : ℕ} {Z : Type*} include a n Z /- The product weight splits over selected entries and the retained tuple. -/ theorem ordered_retrieval_weight_split (e : Fin a ↪ Fin n) (μ : Z → ℝ) (q : Fin n → Z) : (∏ j, μ (q j)) = (∏ i, μ (q (e i))) * ∏ j, μ (retainedOrderedTuple q (retrievalSurvivorIndices e) j) := by have hp := (retrievalIndexSplit e).prod_comp (fun j => μ (q j)) rw [Fintype.prod_sum_type] at hp exact hp.symm /- Exact extraction for one injection, initially retaining the survivor-card index. -/ theorem ordered_retrieval_fixed_sum_card [Fintype Z] (e : Fin a ↪ Fin n) (μ : Z → ℝ) (F : (Fin a → Z) → FiniteOrderedTuple Z → ℝ) : (∑ q : Fin n → Z, (∏ j, μ (q j)) * F (fun i => q (e i)) ⟨(retrievalSurvivorIndices e).card, retainedOrderedTuple q (retrievalSurvivorIndices e)⟩) = ∑ x : Fin a → Z, ∑ u : Fin (retrievalSurvivorIndices e).card → Z, ((∏ i, μ (x i)) * ∏ j, μ (u j)) * F x ⟨(retrievalSurvivorIndices e).card, u⟩ := by let E := retrievalTupleSplit e Z let H : (Fin a → Z) × (Fin (retrievalSurvivorIndices e).card → Z) → ℝ := fun v => ((∏ i, μ (v.1 i)) * ∏ j, μ (v.2 j)) * F v.1 ⟨(retrievalSurvivorIndices e).card, v.2⟩ calc _ = ∑ q : Fin n → Z, H (E q) := by apply sum_congr rfl intro q _ rw [ordered_retrieval_weight_split e μ q] rfl _ = ∑ v, H v := E.sum_comp H _ = _ := Fintype.sum_prod_type H /- Fixed ordered retrieval leaves exactly `n-a` survivor coordinates. -/ theorem ordered_retrieval_fixed_sum [Fintype Z] (e : Fin a ↪ Fin n) (μ : Z → ℝ) (F : (Fin a → Z) → FiniteOrderedTuple Z → ℝ) : (∑ q : Fin n → Z, (∏ j, μ (q j)) * F (fun i => q (e i)) ⟨(retrievalSurvivorIndices e).card, retainedOrderedTuple q (retrievalSurvivorIndices e)⟩) = ∑ x : Fin a → Z, ∑ u : Fin (n - a) → Z, ((∏ i, μ (x i)) * ∏ j, μ (u j)) * F x ⟨n - a, u⟩ := by rw [ordered_retrieval_fixed_sum_card] let H (k : ℕ) := ∑ x : Fin a → Z, ∑ u : Fin k → Z, ((∏ i, μ (x i)) * ∏ j, μ (u j)) * F x ⟨k, u⟩ change H (retrievalSurvivorIndices e).card = H (n - a) exact congrArg H (retrieval_survivor_card e) /- Summing all ordered retrieval choices gives the descending factorial. No distinctness of numerical labels or symmetry of the test is required. -/ theorem ordered_retrieval_sum [Fintype Z] (μ : Z → ℝ) (F : (Fin a → Z) → FiniteOrderedTuple Z → ℝ) : (∑ e : Fin a ↪ Fin n, ∑ q : Fin n → Z, (∏ j, μ (q j)) * F (fun i => q (e i)) ⟨(retrievalSurvivorIndices e).card, retainedOrderedTuple q (retrievalSurvivorIndices e)⟩) = (n.descFactorial a : ℝ) * ∑ x : Fin a → Z, ∑ u : Fin (n - a) → Z, ((∏ i, μ (x i)) * ∏ j, μ (u j)) * F x ⟨n - a, u⟩ := by simp_rw [ordered_retrieval_fixed_sum] simp [Fintype.card_embedding_eq, nsmul_eq_mul] /- The full old-memory factorial cancels ordered retrieval multiplicity, leaving exactly the factorial of the surviving old coordinates. -/ theorem ordered_retrieval_normalized_sum [Fintype Z] (ha : a ≤ n) (μ : Z → ℝ) (F : (Fin a → Z) → FiniteOrderedTuple Z → ℝ) : (∑ e : Fin a ↪ Fin n, ∑ q : Fin n → Z, (∏ j, μ (q j)) * F (fun i => q (e i)) ⟨(retrievalSurvivorIndices e).card, retainedOrderedTuple q (retrievalSurvivorIndices e)⟩) / (n.factorial : ℝ) = (1 / ((n - a).factorial : ℝ)) * ∑ x : Fin a → Z, ∑ u : Fin (n - a) → Z, ((∏ i, μ (x i)) * ∏ j, μ (u j)) * F x ⟨n - a, u⟩ := by rw [ordered_retrieval_sum, mul_div_right_comm, ordered_retrieval_factorial ha] end end section open Finset Classical def unrestrictedJointInput {P : Type*} {k a : ℕ} (n : P → ℕ) (Δ : ℤ) (u : Fin k → UnrestrictedResidueParticle n) (p : Fin a → P) : FiniteOrderedTuple (UnrestrictedResidueParticle n) := ⟨k + a, Fin.addCases u (fun i => ⟨p i, (Δ : ZMod (n (p i)))⟩)⟩ def unrestrictedJointOutput {P : Type*} {k b : ℕ} (n : P → ℕ) (Δ : ℤ) (u : Fin k → UnrestrictedResidueParticle n) (s : Fin b → P) : FiniteOrderedTuple (UnrestrictedResidueParticle n) := unrestrictedJointInput n (-Δ) (unrestrictedResidueTransport n Δ ∘ u) s theorem unrestricted_joint_reverse_input {P : Type*} {k b : ℕ} (n : P → ℕ) (Δ : ℤ) (u : Fin k → UnrestrictedResidueParticle n) (s : Fin b → P) : unrestrictedJointInput n (-Δ) (unrestrictedResidueTransport n Δ ∘ u) s = unrestrictedJointOutput n Δ u s := rfl theorem unrestricted_joint_reverse_output {P : Type*} {k a : ℕ} (n : P → ℕ) (Δ : ℤ) (u : Fin k → UnrestrictedResidueParticle n) (p : Fin a → P) : unrestrictedJointOutput n (-Δ) (unrestrictedResidueTransport n Δ ∘ u) p = unrestrictedJointInput n Δ u p := by have hback : unrestrictedResidueTransport n (-Δ) ∘ (unrestrictedResidueTransport n Δ ∘ u) = u := by funext j change unrestrictedResidueTransport n (-Δ) (unrestrictedResidueTransport n Δ (u j)) = u j rw [← unrestrictedResidueTransport_symm] exact (unrestrictedResidueTransport n Δ).symm_apply_apply (u j) simp only [unrestrictedJointOutput, neg_neg, hback] noncomputable def unrestrictedJointIntegral {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ : ℤ) (k a b : ℕ) (F : (Fin a → P) → (Fin b → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : ℂ := ∑ u : Fin k → UnrestrictedResidueParticle n, ∑ p : Fin a → P, ∑ s : Fin b → P, (((∏ j, unrestrictedResidueWeight μ (u j)) * (∏ i, μ (p i)) * (∏ i, μ (s i)) / (k.factorial : ℝ) : ℝ) : ℂ) * F p s (unrestrictedJointInput n Δ u p) (unrestrictedJointOutput n Δ u s) /- Translation preserves each residue counting measure; swapping promoted and stored label integrations preserves the remaining product measure. -/ theorem unrestricted_joint_integral_reverse {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ : ℤ) (k a b : ℕ) (F : (Fin a → P) → (Fin b → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : unrestrictedJointIntegral n μ Δ k a b F = unrestrictedJointIntegral n μ (-Δ) k b a (fun s p Y X => F p s X Y) := by let E : (Fin k → UnrestrictedResidueParticle n) ≃ (Fin k → UnrestrictedResidueParticle n) := Equiv.piCongrRight (fun _ => unrestrictedResidueTransport n Δ) unfold unrestrictedJointIntegral conv_rhs => rw [← E.sum_comp] apply sum_congr rfl intro u hu rw [sum_comm] apply sum_congr rfl intro s hs apply sum_congr rfl intro p hp have hE : E u = unrestrictedResidueTransport n Δ ∘ u := rfl rw [hE, unrestricted_joint_reverse_input, unrestricted_joint_reverse_output] simp only [Function.comp_apply, unrestrictedResidueWeight_transport] congr 1 congr 1 ring end section open Finset Classical /- Joint selection leaves exactly one residue tuple for every label tuple. The sum is over all label functions, without any distinctness condition. -/ theorem unrestricted_residue_tuple_selection_sum {P E : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] [AddCommMonoid E] [SMul ℝ E] (μ : P → ℝ) (Δ : ℤ) (ban : P → Prop) (a : ℕ) (F : (Fin a → UnrestrictedResidueParticle n) → E) : (∑ q : Fin a → UnrestrictedResidueParticle n, if ∀ i, unrestrictedResidueHit (unrestrictedResidueTransport n Δ (q i)) ∧ ban (q i).1 then (∏ i, unrestrictedResidueWeight μ (q i)) • F q else 0) = ∑ p : Fin a → P, if ∀ i, ban (p i) then (∏ i, μ (p i)) • F (fun i => ⟨p i, (Δ : ZMod (n (p i)))⟩) else 0 := by have hrestore (q : Fin a → UnrestrictedResidueParticle n) (hq : ∀ i, unrestrictedResidueHit (unrestrictedResidueTransport n Δ (q i)) ∧ ban (q i).1) : (fun i => (⟨(q i).1, (Δ : ZMod (n (q i).1))⟩ : UnrestrictedResidueParticle n)) = q := by funext i have hi := (unrestrictedResidueTransport_hit_iff n Δ (q i)).mp (hq i).1 calc (⟨(q i).1, (Δ : ZMod (n (q i).1))⟩ : UnrestrictedResidueParticle n) = ⟨(q i).1, (q i).2⟩ := congrArg (Sigma.mk (q i).1) hi.symm _ = q i := Sigma.eta _ rw [← Finset.sum_filter, ← Finset.sum_filter] apply Finset.sum_bij (fun q _ i => (q i).1) · intro q hq simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hq ⊢ exact fun i => (hq i).2 · intro q hq q' hq' hqq' simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hq hq' rw [← hrestore q hq, ← hrestore q' hq'] exact congrArg (fun p : Fin a → P => fun i => (⟨p i, (Δ : ZMod (n (p i)))⟩ : UnrestrictedResidueParticle n)) hqq' · intro p hp refine ⟨fun i => ⟨p i, (Δ : ZMod (n (p i)))⟩, ?_, rfl⟩ simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hp ⊢ intro i exact ⟨(unrestrictedResidueTransport_hit_iff n Δ _).mpr rfl, hp i⟩ · intro q hq simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hq change (∏ i, μ (q i).1) • F q = (∏ i, μ (q i).1) • F (fun i => ⟨(q i).1, (Δ : ZMod (n (q i).1))⟩) rw [hrestore q hq] end section open Finset Classical /- Reconstruct the source tuple from its retained and selected coordinates. -/ def retrievalSourceTuple {a : ℕ} {Z : Type*} (x : Fin a → Z) (u : FiniteOrderedTuple Z) : FiniteOrderedTuple Z := ⟨u.1 + a, Fin.addCases u.2 x⟩ theorem symmetric_ordered_tuple_reindex {Z K : Type*} (H : FiniteOrderedTuple Z → K) (hH : OrderedTupleSymmetric H) {m n : ℕ} (q : Fin n → Z) (E : Fin m ≃ Fin n) : H ⟨m, q ∘ E⟩ = H ⟨n, q⟩ := by have hmn : m = n := by simpa using Fintype.card_congr E subst m exact hH n q E /- Symmetry identifies the original source with retained entries followed by the selected entries, using the existing retained-tuple enumeration. -/ theorem symmetric_retrieval_source {a n : ℕ} {Z K : Type*} (H : FiniteOrderedTuple Z → K) (hH : OrderedTupleSymmetric H) (e : Fin a ↪ Fin n) (q : Fin n → Z) : H ⟨n, q⟩ = H (retrievalSourceTuple (fun i => q (e i)) ⟨(retrievalSurvivorIndices e).card, retainedOrderedTuple q (retrievalSurvivorIndices e)⟩) := by let E : Fin ((retrievalSurvivorIndices e).card + a) ≃ Fin n := (finSumFinEquiv.symm.trans (Equiv.sumComm _ _)).trans (retrievalIndexSplit e) have hq : q ∘ E = Fin.addCases (retainedOrderedTuple q (retrievalSurvivorIndices e)) (fun i => q (e i)) := by funext j refine Fin.addCases (fun i => ?_) (fun i => ?_) j · simp only [Function.comp_apply, E, Equiv.trans_apply, finSumFinEquiv_symm_apply_castAdd, Equiv.sumComm_apply, Fin.addCases_left] rfl · simp only [Function.comp_apply, E, Equiv.trans_apply, finSumFinEquiv_symm_apply_natAdd, Equiv.sumComm_apply, Fin.addCases_right] rfl have hs := symmetric_ordered_tuple_reindex H hH q E rw [hq] at hs exact hs.symm /- Complex-valued ordered extraction with exact factorial normalization. -/ theorem ordered_retrieval_normalized_sum_complex {a n : ℕ} {Z : Type*} [Fintype Z] (ha : a ≤ n) (μ : Z → ℝ) (F : (Fin a → Z) → FiniteOrderedTuple Z → ℂ) : (∑ e : Fin a ↪ Fin n, ∑ q : Fin n → Z, ((∏ j, μ (q j) : ℝ) : ℂ) * F (fun i => q (e i)) ⟨(retrievalSurvivorIndices e).card, retainedOrderedTuple q (retrievalSurvivorIndices e)⟩) / ((n.factorial : ℝ) : ℂ) = (((1 / ((n - a).factorial : ℝ)) : ℝ) : ℂ) * ∑ x : Fin a → Z, ∑ u : Fin (n - a) → Z, ((((∏ i, μ (x i)) * ∏ j, μ (u j)) : ℝ) : ℂ) * F x ⟨n - a, u⟩ := by apply Complex.ext · simpa only [Complex.re_sum, Complex.div_ofReal_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] using ordered_retrieval_normalized_sum ha μ (fun x u => (F x u).re) · simpa only [Complex.im_sum, Complex.div_ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, add_zero] using ordered_retrieval_normalized_sum ha μ (fun x u => (F x u).im) /- The integrand may depend jointly on selected labels, the entire source, and survivors, provided its source dependence is symmetric. -/ theorem ordered_retrieval_symmetric_normalized_sum_complex {a n : ℕ} {Z : Type*} [Fintype Z] (ha : a ≤ n) (μ : Z → ℝ) (F : (Fin a → Z) → FiniteOrderedTuple Z → FiniteOrderedTuple Z → ℂ) (hF : ∀ x u, OrderedTupleSymmetric (fun source => F x source u)) : (∑ e : Fin a ↪ Fin n, ∑ q : Fin n → Z, ((∏ j, μ (q j) : ℝ) : ℂ) * F (fun i => q (e i)) ⟨n, q⟩ ⟨(retrievalSurvivorIndices e).card, retainedOrderedTuple q (retrievalSurvivorIndices e)⟩) / ((n.factorial : ℝ) : ℂ) = (((1 / ((n - a).factorial : ℝ)) : ℝ) : ℂ) * ∑ x : Fin a → Z, ∑ u : Fin (n - a) → Z, ((((∏ i, μ (x i)) * ∏ j, μ (u j)) : ℝ) : ℂ) * F x (retrievalSourceTuple x ⟨n - a, u⟩) ⟨n - a, u⟩ := by rw [← ordered_retrieval_normalized_sum_complex ha μ (fun x u => F x (retrievalSourceTuple x u) u)] congr 1 apply sum_congr rfl intro e _ apply sum_congr rfl intro q _ congr 1 exact symmetric_retrieval_source _ (hF _ _) e q end section open Finset Classical theorem unrestricted_active_weight_split {I P : Type*} [Fintype I] [DecidableEq I] (μ : P → ℝ) (S : Finset I) (x : I → P) : (∏ i : I, μ (x i)) = (∏ i : S, μ (x i)) * unrestrictedFreshWeight μ S (fun i => x i) := by let e : S ⊕ {i : I // i ∉ S} ≃ I := Equiv.sumCompl (fun i => i ∈ S) have h := e.prod_comp (fun i => μ (x i)) rw [Fintype.prod_sum_type] at h exact h.symm /- Splitting the source active product measure into stored and complementary labels is an exact finite-sum reindexing, valid for real and complex outputs. -/ theorem unrestricted_active_sum_split {I P E : Type*} [Fintype I] [DecidableEq I] [Fintype P] [AddCommMonoid E] [SMul ℝ E] (μ : P → ℝ) (S : Finset I) (F : (I → P) → E) : (∑ x : I → P, (∏ i : I, μ (x i)) • F x) = ∑ s : S → P, ∑ d : UnrestrictedFreshLabels P S, ((∏ i : S, μ (s i)) * unrestrictedFreshWeight μ S d) • F (unrestrictedTargetLabels S s d) := by let e := Equiv.piEquivPiSubtypeProd (fun i : I => i ∈ S) (fun _ => P) let G : (S → P) × UnrestrictedFreshLabels P S → E := fun y => ((∏ i : S, μ (y.1 i)) * unrestrictedFreshWeight μ S y.2) • F (unrestrictedTargetLabels S y.1 y.2) have hrestore (x : I → P) : unrestrictedTargetLabels S (fun i => x i) (fun i => x i) = x := by funext i by_cases hi : i ∈ S <;> simp [unrestrictedTargetLabels, hi] calc _ = ∑ x : I → P, G (e x) := by apply Finset.sum_congr rfl intro x hx change (∏ i : I, μ (x i)) • F x = ((∏ i : S, μ (x i)) * unrestrictedFreshWeight μ S (fun i => x i)) • F (unrestrictedTargetLabels S (fun i => x i) (fun i => x i)) rw [unrestricted_active_weight_split μ S x, hrestore x] _ = ∑ y, G y := e.sum_comp G _ = _ := Fintype.sum_prod_type G /- Index stored labels in the canonical finite order used by the ordered memory operations. The product measure is unchanged by this reindexing. -/ theorem unrestricted_store_sum_equivFin {I P E : Type*} [DecidableEq I] [Fintype P] [AddCommMonoid E] [SMul ℝ E] (μ : P → ℝ) (S : Finset I) (F : (S → P) → E) : (∑ s : S → P, (∏ i : S, μ (s i)) • F s) = ∑ s : Fin S.card → P, (∏ i : Fin S.card, μ (s i)) • F (fun i => s (S.equivFin i)) := by let e := Equiv.arrowCongr S.equivFin (Equiv.refl P) calc _ = ∑ s : Fin S.card → P, (∏ i : S, μ (e.symm s i)) • F (e.symm s) := (e.symm.sum_comp (fun s => (∏ i : S, μ (s i)) • F s)).symm _ = _ := by apply Finset.sum_congr rfl intro s hs change (∏ i : S, μ (s (S.equivFin i))) • F (fun i => s (S.equivFin i)) = _ rw [S.equivFin.prod_comp (fun i => μ (s i))] end section open Finset Classical theorem orderedPredicateCount_permutation {Z : Type*} {N : ℕ} (q : Fin N → Z) (hit : Z → Prop) (e : Equiv.Perm (Fin N)) : orderedPredicateCount ⟨N, q ∘ e⟩ hit = orderedPredicateCount ⟨N, q⟩ hit := Equiv.sum_comp e (fun j => if hit (q j) then 1 else 0) end section open Finset /- The literal output index splits into a retained old slot or a birth slot. -/ noncomputable def retainedBirthIndexEquiv {N : ℕ} (s : Finset (Fin N)) (b : ℕ) : Fin (s.card + b) ≃ (s ⊕ Fin b) := finSumFinEquiv.symm.trans (Equiv.sumCongr s.equivFin.symm (Equiv.refl _)) theorem retained_birth_index_equiv_left {N b : ℕ} (s : Finset (Fin N)) (j : Fin s.card) : retainedBirthIndexEquiv s b (Fin.castAdd b j) = Sum.inl (s.equivFin.symm j) := by simp [retainedBirthIndexEquiv] theorem retained_birth_index_equiv_right {N b : ℕ} (s : Finset (Fin N)) (j : Fin b) : retainedBirthIndexEquiv s b (Fin.natAdd s.card j) = Sum.inr j := by simp [retainedBirthIndexEquiv] /- Evaluation of the actual tuple under its explicit sum-index equivalence. -/ theorem retained_birth_tuple_apply_index_equiv {ι : Type*} {N b : ℕ} (old : Fin N → ι) (s : Finset (Fin N)) (stored : Fin b → ι) (j : Fin (s.card + b)) : (retainedBirthTuple old s stored).2 j = Sum.elim (fun k : s => old k.val) stored (retainedBirthIndexEquiv s b j) := by induction j using Fin.addCases with | left j => simp [retainedBirthTuple, retainedOrderedTuple, retained_birth_index_equiv_left] | right j => simp [retainedBirthTuple, retained_birth_index_equiv_right] /- Conversely, a sum-indexed entry is the corresponding literal tuple entry. -/ theorem retained_birth_tuple_apply_index_equiv_symm {ι : Type*} {N b : ℕ} (old : Fin N → ι) (s : Finset (Fin N)) (stored : Fin b → ι) (j : s ⊕ Fin b) : (retainedBirthTuple old s stored).2 ((retainedBirthIndexEquiv s b).symm j) = Sum.elim (fun k : s => old k.val) stored j := by rw [retained_birth_tuple_apply_index_equiv, Equiv.apply_symm_apply] /- Applying any transport or label map commutes with retaining and appending. -/ theorem retained_birth_tuple_map {ι κ : Type*} {N b : ℕ} (map : ι → κ) (old : Fin N → ι) (s : Finset (Fin N)) (stored : Fin b → ι) : (retainedBirthTuple (map ∘ old) s (map ∘ stored)).2 = map ∘ (retainedBirthTuple old s stored).2 := by funext j change Fin (s.card + b) at j change (retainedBirthTuple (map ∘ old) s (map ∘ stored)).2 j = map ((retainedBirthTuple old s stored).2 j) rw [retained_birth_tuple_apply_index_equiv] simp only [Function.comp_apply, retained_birth_tuple_apply_index_equiv] cases retainedBirthIndexEquiv s b j <;> rfl /- Distinct old entries and distinct appended entries stay distinct when the retained old entries and appended entries have disjoint labels. -/ theorem retained_birth_tuple_injective {ι : Type*} {N b : ℕ} (old : Fin N → ι) (s : Finset (Fin N)) (stored : Fin b → ι) (hold : Function.Injective old) (hstored : Function.Injective stored) (hdis : ∀ j ∈ s, ∀ k, old j ≠ stored k) : Function.Injective (retainedBirthTuple old s stored).2 := by have hsum : Function.Injective (Sum.elim (fun k : s => old k.val) stored) := by intro x y hxy cases x with | inl j => cases y with | inl k => exact congrArg Sum.inl (Subtype.ext (hold hxy)) | inr k => exact (hdis j.val j.property k hxy).elim | inr j => cases y with | inl k => exact (hdis k.val k.property j hxy.symm).elim | inr k => exact congrArg Sum.inr (hstored hxy) intro i j hij apply (retainedBirthIndexEquiv s b).injective apply hsum exact (retained_birth_tuple_apply_index_equiv old s stored i).symm.trans (hij.trans (retained_birth_tuple_apply_index_equiv old s stored j)) /- In particular, distinctness concerns the numerical labels even when each entry also carries a residue or other data. -/ theorem retained_birth_tuple_label_injective {ι P : Type*} {N b : ℕ} (label : ι → P) (old : Fin N → ι) (s : Finset (Fin N)) (stored : Fin b → ι) (hold : Function.Injective (label ∘ old)) (hstored : Function.Injective (label ∘ stored)) (hdis : ∀ j ∈ s, ∀ k, label (old j) ≠ label (stored k)) : Function.Injective (label ∘ (retainedBirthTuple old s stored).2) := by rw [← retained_birth_tuple_map] exact retained_birth_tuple_injective (label ∘ old) s (label ∘ stored) hold hstored hdis end section open Finset /- Target slots whose label occurs in the old memory. -/ noncomputable def distinctPromotedTargetSlots {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) : Finset S := univ.filter (fun s => t s ∈ univ.image f) theorem mem_distinctPromotedTargetSlots {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (s : S) : s ∈ distinctPromotedTargetSlots f t ↔ t s ∈ univ.image f := by simp only [distinctPromotedTargetSlots, mem_filter, mem_univ, true_and] /- Matching promoted slots and genuinely fresh complementary slots determine the selected target-slot set itself, not merely its matching injection. -/ theorem distinct_promoted_slots_forced {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (U : Finset S) (e : U ↪ J) (hmatch : ∀ s : U, f (e s) = t s.val) (hfresh : ∀ s, s ∉ U → t s ∉ univ.image f) : U = distinctPromotedTargetSlots f t := by ext s rw [mem_distinctPromotedTargetSlots] constructor · intro hs exact mem_image.mpr ⟨e ⟨s, hs⟩, mem_univ _, hmatch ⟨s, hs⟩⟩ · intro hs by_contra hn exact hfresh s hn hs /- The old index required by each canonically selected target slot exists. -/ theorem distinct_promoted_slot_has_old {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (s : distinctPromotedTargetSlots f t) : ∃ j, f j = t s.val := by obtain ⟨j, hj, he⟩ := mem_image.mp ((mem_distinctPromotedTargetSlots f t s.val).mp s.property) exact ⟨j, he⟩ /- The unique matching old-index injection for the forced target subset. -/ noncomputable def distinctCanonicalPromotion {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) : distinctPromotedTargetSlots f t ↪ J := distinctPromotionEmbedding f (fun s : distinctPromotedTargetSlots f t => t s.val) (t.injective.comp Subtype.val_injective) (distinct_promoted_slot_has_old f t) theorem distinct_canonical_promotion_matches {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (s : distinctPromotedTargetSlots f t) : f (distinctCanonicalPromotion f t s) = t s.val := distinct_promotion_embedding_spec f (fun s : distinctPromotedTargetSlots f t => t s.val) (t.injective.comp Subtype.val_injective) (distinct_promoted_slot_has_old f t) s /- The selected OLD indices are exactly those whose label occurs anywhere in the target tuple, independently of how the event was initially described. -/ theorem distinct_promotion_selected_old_indices {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (U : Finset S) (e : U ↪ J) (hmatch : ∀ s : U, f (e s) = t s.val) (hfresh : ∀ s, s ∉ U → t s ∉ univ.image f) : univ.image e = univ.filter (fun j => f j ∈ univ.image t) := by ext j simp only [mem_filter, mem_univ, true_and] constructor · intro hj obtain ⟨s, hs, rfl⟩ := mem_image.mp hj exact mem_image.mpr ⟨s.val, mem_univ _, (hmatch s).symm⟩ · intro hj obtain ⟨s, hs, hsj⟩ := mem_image.mp hj have hsU : s ∈ U := by by_contra hn exact hfresh s hn (mem_image.mpr ⟨j, mem_univ _, hsj.symm⟩) refine mem_image.mpr ⟨⟨s, hsU⟩, mem_univ _, ?_⟩ exact f.injective ((hmatch ⟨s, hsU⟩).trans hsj) end section open Finset /- Matching an eligible promotion event identifies its selected OLD indices with precisely the old labels occurring in the full target tuple. -/ theorem distinct_eligible_promotion_selected_indices {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (U : Finset S) (Z : Finset J) (e : U ↪ Z) (hmatch : ∀ s : U, f (e s).val = t s.val) (hfresh : ∀ s, s ∉ U → t s ∉ univ.image f) : promotionSelectedIndices e = univ.filter (fun j => f j ∈ univ.image t) := by rw [promotionSelectedIndices, map_eq_image] exact distinct_promotion_selected_old_indices f t U (e.trans ⟨Subtype.val, Subtype.val_injective⟩) hmatch hfresh /- For the canonical promoted target subset, the fresh-outside-old condition is automatic, so only matching and eligibility remain as hypotheses. -/ theorem distinct_canonical_eligible_selected_indices {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (Z : Finset J) (e : distinctPromotedTargetSlots f t ↪ Z) (hmatch : ∀ s : distinctPromotedTargetSlots f t, f (e s).val = t s.val) : promotionSelectedIndices e = univ.filter (fun j => f j ∈ univ.image t) := by apply distinct_eligible_promotion_selected_indices f t _ Z e hmatch intro s hs hm exact hs ((mem_distinctPromotedTargetSlots f t s).mpr hm) end section open Finset /- The literal unrestricted memory is evaluated on retained old slots and appended storage slots by the retained/birth index equivalence. -/ theorem unrestricted_edge_memory_apply_index {A Z : Type*} [Fintype A] {N b : ℕ} (old : Fin N → Z) (transport : Z → Z) (stored : Fin b → Z) {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) (j : Fin (unrestrictedEdgeMemory old transport stored e).1) : (unrestrictedEdgeMemory old transport stored e).2 j = Sum.elim (fun k : unrestrictedEdgeSurvivors e => transport (old k.val)) (transport ∘ stored) (retainedBirthIndexEquiv (unrestrictedEdgeSurvivors e) b j) := retained_birth_tuple_apply_index_equiv (transport ∘ old) (unrestrictedEdgeSurvivors e) (transport ∘ stored) j /- Label-preserving transport keeps a distinct, disjoint old/storage tuple distinct in the literal unrestricted output. -/ theorem unrestricted_edge_memory_label_injective {A Z P : Type*} [Fintype A] {N b : ℕ} (label : Z → P) (old : Fin N → Z) (transport : Z → Z) (stored : Fin b → Z) {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) (htransport : ∀ z, label (transport z) = label z) (hold : Function.Injective (label ∘ old)) (hstored : Function.Injective (label ∘ stored)) (hdis : ∀ j ∈ unrestrictedEdgeSurvivors e, ∀ k, label (old j) ≠ label (stored k)) : Function.Injective (label ∘ (unrestrictedEdgeMemory old transport stored e).2) := by apply retained_birth_tuple_label_injective label (transport ∘ old) (unrestrictedEdgeSurvivors e) (transport ∘ stored) · simpa only [Function.comp_def, htransport] using hold · simpa only [Function.comp_def, htransport] using hstored · simpa only [Function.comp_apply, htransport] using hdis /- Moving-frame transport for particles with dependent residue types. -/ def unrestrictedPhaseTransport {P : Type*} {R : P → Type*} [∀ p, AddGroup (R p)] (delta : (p : P) → R p) (z : Σ p, R p) : Σ p, R p := ⟨z.1, z.2 - delta z.1⟩ /- Selecting precisely target-active old labels identifies unrestricted survivors with the old-index subtype used by the phase construction. -/ noncomputable def distinctUnrestrictedSurvivorEquiv {A P : Type*} [Fintype A] [Fintype P] {N : ℕ} (atgt : P → Bool) (label : Fin N → P) {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) (he : ∀ j, j ∈ promotionSelectedIndices e ↔ atgt (label j) = true) : unrestrictedEdgeSurvivors e ≃ {j : Fin N // label j ∉ ghostPhaseActivitySupport atgt} where toFun j := ⟨j.val, by have hj := j.property simpa only [unrestrictedEdgeSurvivors, mem_sdiff, mem_univ, true_and, he, ghostPhaseActivitySupport, mem_filter, mem_univ, true_and] using hj⟩ invFun j := ⟨j.val, by have hj := j.property simpa only [unrestrictedEdgeSurvivors, mem_sdiff, mem_univ, true_and, he, ghostPhaseActivitySupport, mem_filter, mem_univ, true_and] using hj⟩ left_inv _ := rfl right_inv _ := rfl /- Exact order map from the literal output to phase survivor/storage indices. -/ noncomputable def distinctUnrestrictedIndexEquiv {A P : Type*} [Fintype A] [Fintype P] {N : ℕ} (atgt : P → Bool) (label : Fin N → P) {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) (he : ∀ j, j ∈ promotionSelectedIndices e ↔ atgt (label j) = true) (b : ℕ) : Fin ((unrestrictedEdgeSurvivors e).card + b) ≃ ({j : Fin N // label j ∉ ghostPhaseActivitySupport atgt} ⊕ Fin b) := (retainedBirthIndexEquiv (unrestrictedEdgeSurvivors e) b).trans (Equiv.sumCongr (distinctUnrestrictedSurvivorEquiv atgt label e he) (Equiv.refl _)) /- The literal sigma-valued output equals the existing distinct delete/append embedding and residue tuple, under the explicit index equivalence. -/ theorem distinct_unrestricted_memory_representation {A P : Type*} [Fintype A] [Fintype P] {R : P → Type*} [∀ p, AddGroup (R p)] {N b : ℕ} (atgt : P → Bool) (delta : (p : P) → R p) (f : Fin N ↪ P) (g : Fin b ↪ P) (hdis : ∀ j k, f j ≠ g k) (old : (j : Fin N) → R (f j)) {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) (he : ∀ j, j ∈ promotionSelectedIndices e ↔ atgt (f j) = true) (j : Fin (unrestrictedEdgeMemory (fun j => (⟨f j, old j⟩ : Σ p, R p)) (unrestrictedPhaseTransport delta) (fun k => ⟨g k, 0⟩) e).1) : let k := distinctUnrestrictedIndexEquiv atgt f e he b j (unrestrictedEdgeMemory (fun j => (⟨f j, old j⟩ : Σ p, R p)) (unrestrictedPhaseTransport delta) (fun k => ⟨g k, 0⟩) e).2 j = ⟨distinctSurvivorStorageEmbedding f g (ghostPhaseActivitySupport atgt) hdis k, distinctSurvivorStorageResidue f g (ghostPhaseActivitySupport atgt) hdis R (fun p r => r - delta p) old (fun k => -delta (g k)) k⟩ := by dsimp only have hidx : distinctUnrestrictedIndexEquiv atgt f e he b j = (Equiv.sumCongr (distinctUnrestrictedSurvivorEquiv atgt f e he) (Equiv.refl (Fin b))) (retainedBirthIndexEquiv (unrestrictedEdgeSurvivors e) b j) := rfl rw [hidx, unrestricted_edge_memory_apply_index] generalize hk : retainedBirthIndexEquiv (unrestrictedEdgeSurvivors e) b j = k cases k with | inl k => rfl | inr k => change (⟨g k, 0 - delta (g k)⟩ : Σ p, R p) = ⟨g k, -delta (g k)⟩ rw [zero_sub] section PhaseOutput variable {A P : Type*} [Fintype A] [Fintype P] {R : P → Type*} [∀ p, AddGroup (R p)] {N b : ℕ} (atgt asrc store : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hs : ∀ p, store p = true → atgt p = false ∧ asrc p = true) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (g : DistinctOrderedSupport (Fin b) (ghostPhaseChoiceSupport store)) (old : (j : Fin N) → R (f.val j)) {eligible : Finset (Fin N)} (e : A ↪ ↥eligible) (he : ∀ j, j ∈ promotionSelectedIndices e ↔ atgt (f.val j) = true) include hw hs /- The actual unrestricted output has distinct numerical labels. -/ theorem distinct_unrestricted_memory_label_injective : Function.Injective (Sigma.fst ∘ (unrestrictedEdgeMemory (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (unrestrictedPhaseTransport delta) (fun k => ⟨g.val k, 0⟩) e).2) := by apply unrestricted_edge_memory_label_injective · intro z rfl · exact f.val.injective · exact g.val.injective · intro j _ k exact distinct_phase_old_storage_disjoint atgt asrc store w hw hs f g j k include he /- The image of the literal unrestricted output labels is exactly the pending support of the selected moving phase output. -/ theorem distinct_unrestricted_memory_support [DecidableEq P] : univ.image (fun j => ((unrestrictedEdgeMemory (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (unrestrictedPhaseTransport delta) (fun k => ⟨g.val k, 0⟩) e).2 j).1) = ghostPhasePendingSupport (fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (store p) (w p)) := by classical let hdis := distinct_phase_old_storage_disjoint atgt asrc store w hw hs f g let emb := distinctSurvivorStorageEmbedding f.val g.val (ghostPhaseActivitySupport atgt) hdis let idx := distinctUnrestrictedIndexEquiv atgt f.val e he b have hl (j) : ((unrestrictedEdgeMemory (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (unrestrictedPhaseTransport delta) (fun k => ⟨g.val k, 0⟩) e).2 j).1 = emb (idx j) := congrArg Sigma.fst (distinct_unrestricted_memory_representation atgt delta f.val g.val hdis old e he j) calc _ = univ.image emb := by ext p simp only [mem_image, mem_univ, true_and] constructor · rintro ⟨j, hj⟩ exact ⟨idx j, (hl j).symm.trans hj⟩ · rintro ⟨k, hk⟩ exact ⟨idx.symm k, (hl (idx.symm k)).trans (by simpa only [idx.apply_symm_apply] using hk)⟩ _ = _ := distinct_phase_moving_embedding_support atgt asrc store delta w hw hs f g hdis /- Every literal output particle has exactly its label and residue in the selected moving phase output, including newly stored particles. -/ theorem distinct_unrestricted_memory_particle (hold : ∀ j, w (f.val j) = some (some (some (old j)))) (j : Fin (unrestrictedEdgeMemory (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (unrestrictedPhaseTransport delta) (fun k => ⟨g.val k, 0⟩) e).1) : let z := (unrestrictedEdgeMemory (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (unrestrictedPhaseTransport delta) (fun k => ⟨g.val k, 0⟩) e).2 j ghostPhaseMovingChoiceTarget (atgt z.1) (asrc z.1) (delta z.1) (store z.1) (w z.1) = some (some (some z.2)) := by let hdis := distinct_phase_old_storage_disjoint atgt asrc store w hw hs f g have hv := distinct_unrestricted_memory_representation atgt delta f.val g.val hdis old e he j dsimp only rw [hv] exact distinct_phase_moving_residue atgt asrc store delta w hw hs f g hdis old hold (distinctUnrestrictedIndexEquiv atgt f.val e he b j) end PhaseOutput end section open Finset /- Enumerate precisely the selected source slots, retaining their literal `retainedOrderedTuple` enumeration. -/ noncomputable def distinctUnrestrictedStorageEmbedding {P : Type*} {t : ℕ} (source : Fin t ↪ P) (stores : Finset (Fin t)) : Fin stores.card ↪ P where toFun k := source (stores.equivFin.symm k).val inj' := by intro i j hij apply stores.equivFin.symm.injective exact Subtype.ext (source.injective hij) /- The phase storage choice determined by selected source slots. -/ def distinctUnrestrictedStorageChoice {P : Type*} [DecidableEq P] {t : ℕ} (source : Fin t ↪ P) (stores : Finset (Fin t)) (p : P) : Bool := decide (p ∈ stores.image source) theorem distinct_unrestricted_storage_choice_support {P : Type*} [Fintype P] [DecidableEq P] {t : ℕ} (source : Fin t ↪ P) (stores : Finset (Fin t)) : ghostPhaseChoiceSupport (distinctUnrestrictedStorageChoice source stores) = stores.image source := by ext p simp [ghostPhaseChoiceSupport, distinctUnrestrictedStorageChoice] /- The selected source enumeration is a distinct ordered enumeration of the corresponding phase storage support. -/ noncomputable def distinctUnrestrictedStorageSupport {P : Type*} [Fintype P] [DecidableEq P] {t : ℕ} (source : Fin t ↪ P) (stores : Finset (Fin t)) : DistinctOrderedSupport (Fin stores.card) (ghostPhaseChoiceSupport (distinctUnrestrictedStorageChoice source stores)) := ⟨distinctUnrestrictedStorageEmbedding source stores, by intro p rw [distinct_unrestricted_storage_choice_support] constructor · intro hp obtain ⟨j, hj, rfl⟩ := mem_image.mp hp refine ⟨stores.equivFin ⟨j, hj⟩, ?_⟩ change source (stores.equivFin.symm (stores.equivFin ⟨j, hj⟩)).val = source j rw [Equiv.symm_apply_apply] · rintro ⟨k, rfl⟩ exact mem_image.mpr ⟨(stores.equivFin.symm k).val, (stores.equivFin.symm k).property, rfl⟩⟩ /- Source-active slots that are target-inactive give an allowed phase choice. -/ theorem distinct_unrestricted_storage_allowed {P : Type*} [DecidableEq P] {t : ℕ} (source : Fin t ↪ P) (stores : Finset (Fin t)) (atgt asrc : P → Bool) (hsource : ∀ j, asrc (source j) = true) (hstores : ∀ j ∈ stores, atgt (source j) = false) : ∀ p, distinctUnrestrictedStorageChoice source stores p = true → atgt p = false ∧ asrc p = true := by intro p hp have hp' : p ∈ stores.image source := by simpa only [distinctUnrestrictedStorageChoice, decide_eq_true_eq] using hp obtain ⟨j, hj, rfl⟩ := mem_image.mp hp' exact ⟨hstores j hj, hsource j⟩ section ActualOutput variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] {t N : ℕ} (source : Fin t ↪ P) (stores promotions : Finset (Fin t)) (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hsource : ∀ j, asrc (source j) = true) (hstores : ∀ j ∈ stores, atgt (source j) = false) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (he : ∀ j, j ∈ promotionSelectedIndices e ↔ atgt (f.val j) = true) include hw hsource hstores /- The actual source-slot output has distinct numerical labels. -/ theorem distinct_unrestricted_output_label_injective : Function.Injective (Sigma.fst ∘ (unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores promotions e).2) := by exact distinct_unrestricted_memory_label_injective atgt asrc (distinctUnrestrictedStorageChoice source stores) delta w hw (distinct_unrestricted_storage_allowed source stores atgt asrc hsource hstores) f (distinctUnrestrictedStorageSupport source stores) old e include he /- The actual source-slot output enumerates all and only the selected moving phase output's pending labels. -/ theorem distinct_unrestricted_output_support : univ.image (fun j => ((unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores promotions e).2 j).1) = ghostPhasePendingSupport (fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (distinctUnrestrictedStorageChoice source stores p) (w p)) := by exact distinct_unrestricted_memory_support atgt asrc (distinctUnrestrictedStorageChoice source stores) delta w hw (distinct_unrestricted_storage_allowed source stores atgt asrc hsource hstores) f (distinctUnrestrictedStorageSupport source stores) old e he /- Every actual source-slot output particle agrees with its moving phase coordinate, including both transported survivors and newly stored labels. -/ theorem distinct_unrestricted_output_particle (hold : ∀ j, w (f.val j) = some (some (some (old j)))) (j : Fin (unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores promotions e).1) : let z := (unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores promotions e).2 j ghostPhaseMovingChoiceTarget (atgt z.1) (asrc z.1) (delta z.1) (distinctUnrestrictedStorageChoice source stores z.1) (w z.1) = some (some (some z.2)) := by exact distinct_unrestricted_memory_particle atgt asrc (distinctUnrestrictedStorageChoice source stores) delta w hw (distinct_unrestricted_storage_allowed source stores atgt asrc hsource hstores) f (distinctUnrestrictedStorageSupport source stores) old e he hold j end ActualOutput end section open Finset /- On slots not canonically promoted, use their fixed target label as fresh. -/ noncomputable def distinctCanonicalFresh {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) : UnrestrictedFreshLabels P (distinctPromotedTargetSlots f t) := fun s => t s.val theorem distinct_canonical_fresh_injective {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) : Function.Injective (distinctCanonicalFresh f t) := by intro s r hsr exact Subtype.ext (t.injective hsr) theorem distinct_canonical_fresh_outside_old {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (s : {s : S // s ∉ distinctPromotedTargetSlots f t}) : distinctCanonicalFresh f t s ∉ univ.image f := by intro hs exact s.property ((mem_distinctPromotedTargetSlots f t s.val).mpr hs) /- The fresh numerical labels are exactly target labels absent from old memory. -/ theorem distinct_canonical_fresh_image {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq S] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) : univ.image (distinctCanonicalFresh f t) = univ.image t \ univ.image f := by ext p simp only [mem_image, mem_univ, true_and, mem_sdiff] constructor · rintro ⟨s, rfl⟩ refine ⟨⟨s.val, rfl⟩, ?_⟩ simpa only [mem_image, mem_univ, true_and] using distinct_canonical_fresh_outside_old f t s · rintro ⟨⟨s, rfl⟩, hs⟩ have hn : s ∉ distinctPromotedTargetSlots f t := by rw [mem_distinctPromotedTargetSlots] simpa only [mem_image, mem_univ, true_and] using hs exact ⟨⟨s, hn⟩, rfl⟩ /- Promoted numerical labels are exactly the overlap of target and old labels. -/ theorem distinct_canonical_promoted_image {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) : univ.image (fun s : distinctPromotedTargetSlots f t => t s.val) = univ.image t ∩ univ.image f := by ext p simp only [mem_image, mem_univ, true_and, mem_inter] constructor · rintro ⟨s, rfl⟩ refine ⟨⟨s.val, rfl⟩, ?_⟩ simpa only [mem_image, mem_univ, true_and] using (mem_distinctPromotedTargetSlots f t s.val).mp s.property · rintro ⟨⟨s, rfl⟩, hs⟩ have hp : s ∈ distinctPromotedTargetSlots f t := by rw [mem_distinctPromotedTargetSlots] simpa only [mem_image, mem_univ, true_and] using hs exact ⟨⟨s, hp⟩, rfl⟩ theorem distinct_canonical_promotion_card {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) : (distinctPromotedTargetSlots f t).card = (univ.image t ∩ univ.image f).card := by rw [← distinct_canonical_promoted_image f t, card_image_of_injective _ (show Function.Injective (fun s : distinctPromotedTargetSlots f t => t s.val) from fun a b h => Subtype.ext (t.injective h)), card_univ, Fintype.card_coe] /- Matching old values on the canonical promotion slots, together with the fresh restriction on the complement, reconstruct the entire target tuple. -/ theorem distinct_unrestricted_target_labels {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq S] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (Z : Finset J) (e : distinctPromotedTargetSlots f t ↪ Z) (hmatch : ∀ s : distinctPromotedTargetSlots f t, f (e s).val = t s.val) : unrestrictedTargetLabels (distinctPromotedTargetSlots f t) (fun s => f (e s).val) (distinctCanonicalFresh f t) = t := by funext s by_cases hs : s ∈ distinctPromotedTargetSlots f t · simp only [unrestrictedTargetLabels, dif_pos hs] exact hmatch ⟨s, hs⟩ · simp only [unrestrictedTargetLabels, dif_neg hs, distinctCanonicalFresh] /- The target tuple generated by the literal unrestricted edge is the given fixed target, when its old labels and promotion matching agree. -/ theorem distinct_unrestricted_edge_target {P Q : Type*} [DecidableEq P] {N n : ℕ} (old : Fin N → Q) (label : Q → P) (f : Fin N ↪ P) (hlabel : ∀ j, label (old j) = f j) (t : Fin n ↪ P) (eligible : Finset (Fin N)) (e : distinctPromotedTargetSlots f t ↪ eligible) (hmatch : ∀ s : distinctPromotedTargetSlots f t, f (e s).val = t s.val) : unrestrictedEdgeTarget old label (distinctPromotedTargetSlots f t) e (distinctCanonicalFresh f t) = t := by unfold unrestrictedEdgeTarget have he : (fun s : distinctPromotedTargetSlots f t => label (old (e s).val)) = (fun s : distinctPromotedTargetSlots f t => f (e s).val) := by funext s exact hlabel _ rw [he] exact distinct_unrestricted_target_labels f t eligible e hmatch end section open Finset /- A distinct literal particle list representing a phase memory has exactly the phase memory's number of zero residues. -/ theorem distinct_particle_phase_zero_count {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, Zero (R p)] [∀ p, DecidableEq (R p)] (q : FiniteOrderedTuple (Σ p, R p)) (w : (p : P) → GhostPhaseState (R p)) (hinj : Function.Injective (fun j => (q.2 j).1)) (hsupport : univ.image (fun j => (q.2 j).1) = ghostPhasePendingSupport w) (hvalue : ∀ j, w (q.2 j).1 = some (some (some (q.2 j).2))) : orderedPredicateCount q (fun z => z.2 = 0) = (ghostPhaseZeroSet w).card := by let f : DistinctOrderedSupport (Fin q.1) (ghostPhasePendingSupport w) := ⟨⟨fun j => (q.2 j).1, hinj⟩, by intro p rw [← hsupport] simp only [mem_image, mem_univ, true_and] rfl⟩ have h := distinct_phase_zero_count f w rfl (fun j => (q.2 j).2) hvalue rw [ordered_zero_count_eq_sum] at h refine Eq.trans ?_ h unfold orderedPredicateCount apply sum_congr rfl intro j _ by_cases hz : (q.2 j).2 = 0 <;> simp only [hz, if_true, if_false] /- Distinct fresh slots enumerate their label support once. -/ theorem distinct_unrestricted_fresh_weight {I P : Type*} [Fintype I] [DecidableEq I] [DecidableEq P] (μ : P → ℝ) (T : Finset I) (fresh : UnrestrictedFreshLabels P T) (hinj : Function.Injective fresh) (S : Finset P) (hS : univ.image fresh = S) : unrestrictedFreshWeight μ T fresh = ∏ p ∈ S, μ p := by rw [← hS, prod_image] · rfl · intro i _ j _ hij exact hinj hij /- The literal unrestricted event mass agrees with the phase endpoint damping and numerical fresh-label weight on a distinct-label event. The represented output is the actual unrestrictedEdgeOutput, not a surrogate. -/ theorem distinct_unrestricted_event_mass {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, Zero (R p)] [∀ p, DecidableEq (R p)] {t N : ℕ} (source : Fin t → P) (old : Fin N → Σ p, R p) (seed : P → Σ p, R p) (transport : (Σ p, R p) → Σ p, R p) (μ : P → ℝ) (ρ V : ℝ) (stores promotions : Finset (Fin t)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (fresh : UnrestrictedFreshLabels P promotions) (w z : (p : P) → GhostPhaseState (R p)) (holdinj : Function.Injective (fun j => (old j).1)) (houtsinj : Function.Injective (fun j => ((unrestrictedEdgeOutput source old seed transport stores promotions e).2 j).1)) (holdsupport : univ.image (fun j => (old j).1) = ghostPhasePendingSupport w) (houtsupport : univ.image (fun j => ((unrestrictedEdgeOutput source old seed transport stores promotions e).2 j).1) = ghostPhasePendingSupport z) (holdvalue : ∀ j, w (old j).1 = some (some (some (old j).2))) (houtvalue : ∀ j, z ((unrestrictedEdgeOutput source old seed transport stores promotions e).2 j).1 = some (some (some ((unrestrictedEdgeOutput source old seed transport stores promotions e).2 j).2))) (hfresh : Function.Injective fresh) (S : Finset P) (hS : univ.image fresh = S) : unrestrictedEdgeEventMass source old seed transport (fun x => x.2 = 0) μ ρ V stores promotions e fresh = ρ ^ (ghostPhaseZeroSet w).card * ρ ^ (ghostPhaseZeroSet z).card * (V⁻¹) ^ promotions.card * ∏ p ∈ S, μ p := by unfold unrestrictedEdgeEventMass rw [distinct_particle_phase_zero_count ⟨N, old⟩ w holdinj holdsupport holdvalue, distinct_particle_phase_zero_count (unrestrictedEdgeOutput source old seed transport stores promotions e) z houtsinj houtsupport houtvalue, distinct_unrestricted_fresh_weight μ promotions fresh hfresh S hS] simp only [div_eq_mul_inv, inv_pow] end section open Finset end section open Finset /- The old labels among entering active slots are precisely promotions. -/ theorem ghost_phase_new_run_pending {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (atgt asrc : P → Bool) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) : ghostPhaseNewRunSet atgt asrc ∩ ghostPhasePendingSupport w = ghostPhasePromotionSet atgt w := by classical ext p have hwp := hw p cases ht : atgt p <;> cases hs : asrc p <;> rcases hp : w p with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseNewRunSet, ghostPhasePromotionSet, ghostPhasePendingSupport, ghostPhaseActivitySupport] /- The entering active labels outside the old memory are precisely fresh labels. Compatibility excludes an attempted rebirth of a completed label. -/ theorem ghost_phase_new_run_without_pending {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hc : ∀ p, ghostPhaseMovingEdgeCompatible (atgt p) (asrc p) (delta p) (w p) = true) : ghostPhaseNewRunSet atgt asrc \ ghostPhasePendingSupport w = ghostPhaseFreshSet atgt asrc w := by classical ext p have hwp := hw p have hcp := hc p cases ht : atgt p <;> cases hs : asrc p <;> rcases hp : w p with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseNewRunSet, ghostPhasePendingSupport, ghostPhaseFreshSet, ghostPhaseEdgeFresh, ghostPhaseMovingEdgeCompatible] end section open Finset section variable {P : Type*} [sharedInstance1 : Fintype P] [sharedInstance2 : DecidableEq P] {R : P → Type*} {N t : ℕ} (atgt asrc : P → Bool) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (target : Fin t ↪ P) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) include P sharedInstance1 sharedInstance2 R N t atgt asrc w hw f target htarget /- A matching eligible injection selects precisely the target-active old indices when the target tuple enumerates the newly active labels. -/ theorem distinct_phase_event_selected (eligible : Finset (Fin N)) (e : distinctPromotedTargetSlots f.val target ↪ eligible) (hmatch : ∀ s : distinctPromotedTargetSlots f.val target, f.val (e s).val = target s.val) : ∀ j, j ∈ promotionSelectedIndices e ↔ atgt (f.val j) = true := by rw [distinct_canonical_eligible_selected_indices f.val target eligible e hmatch] intro j rw [mem_filter, and_iff_right (mem_univ j), htarget] have hi := distinct_phase_old_inactive asrc w hw f j simp [ghostPhaseNewRunSet, hi] theorem distinct_phase_event_promotion_card : (distinctPromotedTargetSlots f.val target).card = (ghostPhasePromotionSet atgt w).card := by rw [distinct_canonical_promotion_card, htarget, distinct_ordered_support_image f, ghost_phase_new_run_pending atgt asrc w hw] end theorem distinct_phase_event_fresh_image {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {N t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (target : Fin t ↪ P) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (hc : ∀ p, ghostPhaseMovingEdgeCompatible (atgt p) (asrc p) (delta p) (w p) = true) : univ.image (distinctCanonicalFresh f.val target) = ghostPhaseFreshSet atgt asrc w := by rw [distinct_canonical_fresh_image, htarget, distinct_ordered_support_image f, ghost_phase_new_run_without_pending atgt asrc delta w hw hc] /- On a compatible distinct event, the actual unrestricted event mass equals the product of actual normalized phase kernels. No output-count or scalar mass equality is assumed: both follow from the ordered event construction. -/ theorem distinct_unrestricted_phase_event_mass {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {N t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (source target : Fin t ↪ P) (stores : Finset (Fin t)) (hsource : ∀ j, asrc (source j) = true) (hstores : ∀ j ∈ stores, atgt (source j) = false) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) (hold : ∀ j, w (f.val j) = some (some (some (old j)))) (eligible : Finset (Fin N)) (e : distinctPromotedTargetSlots f.val target ↪ eligible) (hmatch : ∀ s : distinctPromotedTargetSlots f.val target, f.val (e s).val = target s.val) (hc : ∀ p, ghostPhaseMovingEdgeCompatible (atgt p) (asrc p) (delta p) (w p) = true) (β : P → ℝ) (ρ V : ℝ) : unrestrictedEdgeEventMass source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) (fun z => z.2 = 0) (fun p => β p / V) ρ V stores (distinctPromotedTargetSlots f.val target) e (distinctCanonicalFresh f.val target) = ∏ p, (if atgt p && !(asrc p) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt p) (asrc p) (delta p) (β p) ρ ρ (ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (distinctUnrestrictedStorageChoice source stores p) (w p)) (w p) := by have he := distinct_phase_event_selected atgt asrc w hw f target htarget eligible e hmatch have hcount := distinct_phase_event_promotion_card atgt asrc w hw f target htarget have hfresh := distinct_phase_event_fresh_image atgt asrc delta w hw f target htarget hc have hs := distinct_unrestricted_storage_allowed source stores atgt asrc hsource hstores have hmass := distinct_unrestricted_event_mass source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) (fun p => β p / V) ρ V stores (distinctPromotedTargetSlots f.val target) e (distinctCanonicalFresh f.val target) w (fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (distinctUnrestrictedStorageChoice source stores p) (w p)) f.val.injective (distinct_unrestricted_output_label_injective source stores _ atgt asrc delta w hw hsource hstores f old e) (distinct_ordered_support_image f) (distinct_unrestricted_output_support source stores _ atgt asrc delta w hw hsource hstores f old e he) hold (distinct_unrestricted_output_particle source stores _ atgt asrc delta w hw hsource hstores f old e he hold) (distinct_canonical_fresh_injective f.val target) (ghostPhaseFreshSet atgt asrc w) hfresh rw [hmass, hcount] rw [ghost_phase_run_normalized_edge_fresh_measure atgt asrc (distinctUnrestrictedStorageChoice source stores) delta β ρ ρ V w hw hs, if_pos hc, mul_one] end section open Finset /- The total number of prime factors, counted with multiplicity. -/ noncomputable def primeFactorMultiplicity (n : ℕ) : ℕ := ∑ p ∈ n.primeFactors, n.factorization p theorem card_divisors_le_two_pow_multiplicity {n : ℕ} (hn : n ≠ 0) : n.divisors.card ≤ 2 ^ primeFactorMultiplicity n := by rw [Nat.card_divisors hn, primeFactorMultiplicity, ← Finset.prod_pow_eq_pow_sum] exact Finset.prod_le_prod₀ (fun _ _ => Nat.zero_le _) (fun p _ => Nat.succ_le_iff.mpr Nat.lt_two_pow_self) theorem pow_multiplicity_le_of_large_primeFactors {n : ℕ} (hn : n ≠ 0) {W : ℝ} (hW : 0 ≤ W) (hlarge : ∀ p ∈ n.primeFactors, W ≤ (p : ℝ)) : W ^ primeFactorMultiplicity n ≤ (n : ℝ) := by have hnprod : (n : ℝ) = ∏ p ∈ n.primeFactors, (p : ℝ) ^ n.factorization p := by exact_mod_cast Nat.prod_primeFactors_pow_factorization hn rw [hnprod, primeFactorMultiplicity, ← Finset.prod_pow_eq_pow_sum] exact Finset.prod_le_prod₀ (fun _ _ => pow_nonneg hW _) (fun p hp => pow_le_pow_left₀ hW (hlarge p hp) _) section variable {n : ℕ} (hn : n ≠ 0) {W : ℝ} (hW : 1 < W) (hlarge : ∀ p ∈ n.primeFactors, W ≤ (p : ℝ)) include n hn W hW hlarge theorem multiplicity_le_log_div_of_large_primeFactors : (primeFactorMultiplicity n : ℝ) ≤ Real.log n / Real.log W := by have hW0 : 0 < W := lt_trans zero_lt_one hW have h := Real.log_le_log (pow_pos hW0 _) (pow_multiplicity_le_of_large_primeFactors hn hW0.le hlarge) rw [Real.log_pow] at h exact (le_div_iff₀ (Real.log_pos hW)).mpr h theorem card_divisors_le_exp_of_large_primeFactors : (n.divisors.card : ℝ) ≤ Real.exp (Real.log 2 * Real.log n / Real.log W) := by have hm := multiplicity_le_log_div_of_large_primeFactors hn hW hlarge have hc : (n.divisors.card : ℝ) ≤ (2 : ℝ) ^ primeFactorMultiplicity n := by exact_mod_cast card_divisors_le_two_pow_multiplicity hn calc _ ≤ (2 : ℝ) ^ primeFactorMultiplicity n := hc _ = Real.exp ((primeFactorMultiplicity n : ℝ) * Real.log 2) := by rw [Real.exp_nat_mul, Real.exp_log (by norm_num : (0 : ℝ) < 2)] _ ≤ Real.exp (Real.log 2 * Real.log n / Real.log W) := by apply Real.exp_le_exp.mpr have h := mul_le_mul_of_nonneg_left hm (Real.log_pos (by norm_num : (1 : ℝ) < 2)).le simpa only [mul_div_assoc, mul_comm (primeFactorMultiplicity n : ℝ) (Real.log 2)] using h end /- Divisors all of whose prime factors are at least `W`. -/ noncomputable def roughDivisors (W : ℝ) (n : ℕ) : Finset ℕ := by classical exact n.divisors.filter (fun d => ∀ p ∈ d.primeFactors, W ≤ (p : ℝ)) /- The full prime-power part of an integer supported on primes at least `W`. -/ noncomputable def roughPrimePart (W : ℝ) (n : ℕ) : ℕ := by classical exact primePoolPart (n.primeFactors.filter (fun p => W ≤ (p : ℝ))) n theorem roughPrimePart_ne_zero (W : ℝ) (n : ℕ) : roughPrimePart W n ≠ 0 := primePoolPart_ne_zero _ _ theorem roughPrimePart_dvd (W : ℝ) (n : ℕ) : roughPrimePart W n ∣ n := primePoolPart_dvd _ _ theorem roughPrimePart_primeFactors_large (W : ℝ) (n : ℕ) : ∀ p ∈ (roughPrimePart W n).primeFactors, W ≤ (p : ℝ) := by classical intro p hp exact (mem_filter.mp (Nat.primeFactors_subset_of_mem_factoredNumbers (primePoolPart_mem_factoredNumbers (n.primeFactors.filter (fun p => W ≤ (p : ℝ))) n) hp)).2 theorem roughDivisors_eq_divisors_roughPrimePart (W : ℝ) {n : ℕ} (hn : n ≠ 0) : roughDivisors W n = (roughPrimePart W n).divisors := by classical ext d simp only [roughDivisors, mem_filter, Nat.mem_divisors] constructor · rintro ⟨⟨hdn, _⟩, hlarge⟩ have hd0 : d ≠ 0 := by intro hd subst d exact hn (by simpa using hdn) refine ⟨(Nat.factorization_le_iff_dvd hd0 (roughPrimePart_ne_zero W n)).mp ?_, roughPrimePart_ne_zero W n⟩ rw [roughPrimePart, factorization_primePoolPart] intro p by_cases hp : p ∈ n.primeFactors.filter (fun q : ℕ => W ≤ (q : ℝ)) · rw [Finsupp.filter_apply_pos _ _ hp] exact (Nat.factorization_le_iff_dvd hd0 hn).mpr hdn p · have hdf : d.factorization p = 0 := by apply Finsupp.notMem_support_iff.mp intro hpd exact hp (mem_filter.mpr ⟨Nat.primeFactors_mono hdn hn hpd, hlarge p hpd⟩) rw [Finsupp.filter_apply_neg _ _ hp, hdf] · rintro ⟨hd, _⟩ refine ⟨⟨hd.trans (roughPrimePart_dvd W n), hn⟩, ?_⟩ intro p hp exact roughPrimePart_primeFactors_large W n p (Nat.primeFactors_mono hd (roughPrimePart_ne_zero W n) hp) theorem roughDivisors_card_le_exp_log {W : ℝ} (hW : 1 < W) {n : ℕ} (hn : n ≠ 0) : ((roughDivisors W n).card : ℝ) ≤ Real.exp (Real.log 2 * Real.log n / Real.log W) := by rw [roughDivisors_eq_divisors_roughPrimePart W hn] refine (card_divisors_le_exp_of_large_primeFactors (roughPrimePart_ne_zero W n) hW (roughPrimePart_primeFactors_large W n)).trans ?_ apply Real.exp_le_exp.mpr apply div_le_div_of_nonneg_right _ (Real.log_pos hW).le apply mul_le_mul_of_nonneg_left _ (Real.log_pos (by norm_num : (1 : ℝ) < 2)).le apply Real.log_le_log · exact_mod_cast Nat.pos_of_ne_zero (roughPrimePart_ne_zero W n) · exact_mod_cast Nat.le_of_dvd (Nat.pos_of_ne_zero hn) (roughPrimePart_dvd W n) end section open Finset theorem roughDivisors_card_le_exp_of_exp_bound {U V : ℝ} (hV : 0 < V) {n : ℕ} (hn : n ≠ 0) (hsize : (n : ℝ) ≤ Real.exp U) : ((roughDivisors (Real.exp V) n).card : ℝ) ≤ Real.exp (Real.log 2 * U / V) := by have h := roughDivisors_card_le_exp_log (W := Real.exp V) (by simpa using Real.exp_lt_exp.mpr hV) hn rw [Real.log_exp] at h refine h.trans (Real.exp_le_exp.mpr ?_) apply div_le_div_of_nonneg_right _ hV.le apply mul_le_mul_of_nonneg_left _ (Real.log_pos (by norm_num : (1 : ℝ) < 2)).le exact (Real.log_le_iff_le_exp (by exact_mod_cast Nat.pos_of_ne_zero hn)).mpr hsize theorem roughDivisors_card_le_exp_sqrt {L C : ℝ} (hL : 0 < L) {n : ℕ} (hn : n ≠ 0) (hsize : (n : ℝ) ≤ Real.exp (C * L)) : ((roughDivisors (Real.exp (Real.sqrt L)) n).card : ℝ) ≤ Real.exp ((C * Real.log 2) * Real.sqrt L) := by have h := roughDivisors_card_le_exp_of_exp_bound (Real.sqrt_pos.mpr hL) hn hsize have hid : Real.log 2 * (C * L) / Real.sqrt L = (C * Real.log 2) * Real.sqrt L := by apply (div_eq_iff (Real.sqrt_pos.mpr hL).ne').mpr calc _ = (C * Real.log 2) * (Real.sqrt L ^ 2) := by rw [Real.sq_sqrt hL.le]; ring _ = _ := by ring simpa only [hid] using h theorem odd_nat_le_exp_twice {L : ℝ} (hL : Real.log 3 ≤ L) {u : ℕ} (hu : (u : ℝ) ≤ Real.exp L) : ((2 * u + 1 : ℕ) : ℝ) ≤ Real.exp (2 * L) := by have he : (3 : ℝ) ≤ Real.exp L := (Real.log_le_iff_le_exp (by norm_num : (0 : ℝ) < 3)).mp hL calc _ = 2 * (u : ℝ) + 1 := by norm_cast _ ≤ 3 * Real.exp L := by linarith _ ≤ Real.exp L * Real.exp L := mul_le_mul_of_nonneg_right he (Real.exp_pos _).le _ = Real.exp (2 * L) := by rw [← Real.exp_add]; congr 1; ring theorem odd_roughDivisors_card_le_exp_sqrt {L : ℝ} (hL : Real.log 3 ≤ L) {u : ℕ} (hu : (u : ℝ) ≤ Real.exp L) : ((roughDivisors (Real.exp (Real.sqrt L)) (2 * u + 1)).card : ℝ) ≤ Real.exp ((2 * Real.log 2) * Real.sqrt L) := by apply roughDivisors_card_le_exp_sqrt ((Real.log_pos (by norm_num : (1 : ℝ) < 3)).trans_le hL) (by omega : 2 * u + 1 ≠ 0) exact odd_nat_le_exp_twice hL hu end section open Filter Finset open scoped Topology end section open Finset /- The natural-number product of one selected value in each ordered slot. -/ noncomputable def orderedSlotProduct {I : Type*} [Fintype I] (choices : I → Finset ℕ) (x : ∀ i, choices i) : ℕ := ∏ i, (x i).val /- Counting admissible ordered lists, divided by the prescribed normalization. -/ noncomputable def orderedSlotWeight {I : Type*} [Fintype I] (choices : I → Finset ℕ) (normalization : ℝ) (n : ℕ) : ℝ := by classical exact ∑ x : ∀ i, choices i, if orderedSlotProduct choices x = n then 1 / normalization else 0 section variable {I : Type*} [sharedInstance1 : Fintype I] (choices : I → Finset ℕ) include I sharedInstance1 choices theorem ordered_slot_weight_nonneg {normalization : ℝ} (hnorm : 0 ≤ normalization) (n : ℕ) : 0 ≤ orderedSlotWeight choices normalization n := by classical exact sum_nonneg (fun _ _ => by split_ifs <;> positivity) theorem ordered_slot_weight_eq_count (normalization : ℝ) (n : ℕ) : orderedSlotWeight choices normalization n = (Nat.card {x : ∀ i, choices i // orderedSlotProduct choices x = n} : ℝ) / normalization := by classical simp [orderedSlotWeight, Nat.card_eq_fintype_card, Fintype.card_subtype, ← Finset.sum_filter, div_eq_mul_inv] theorem ordered_slot_harmonic_summable (normalization : ℝ) : Summable (fun n : ℕ => orderedSlotWeight choices normalization n / (n : ℝ)) := by classical simp only [orderedSlotWeight, Finset.sum_div] apply summable_sum intro x _ apply (hasSum_single (orderedSlotProduct choices x) ?_).summable intro n hn simp [Ne.symm hn] theorem ordered_slot_harmonic_sum (normalization : ℝ) : (∑' n : ℕ, orderedSlotWeight choices normalization n / (n : ℝ)) = (∏ i, ∑ p ∈ choices i, 1 / (p : ℝ)) / normalization := by classical simp only [orderedSlotWeight, Finset.sum_div] rw [Summable.tsum_finsetSum] · have hsingle : ∀ x : ∀ i, choices i, (∑' n : ℕ, (if orderedSlotProduct choices x = n then 1 / normalization else 0) / (n : ℝ)) = (1 / (orderedSlotProduct choices x : ℝ)) / normalization := by intro x simp_rw [ite_div, zero_div] rw [tsum_ite_eq'] ring simp_rw [hsingle] rw [← Finset.sum_div] congr 1 simp_rw [orderedSlotProduct, Nat.cast_prod, one_div, ← Finset.prod_inv_distrib] calc _ = ∏ i, ∑ p : choices i, (p.val : ℝ)⁻¹ := by convert (Fintype.prod_sum (fun i (p : choices i) => (p.val : ℝ)⁻¹)).symm using 1 _ = _ := prod_congr rfl (fun i _ => Finset.sum_coe_sort (choices i) (fun p => (p : ℝ)⁻¹)) · intro x _ apply (hasSum_single (orderedSlotProduct choices x) ?_).summable intro n hn simp [Ne.symm hn] end end section open Finset Filter open scoped Topology noncomputable def roughBand (A B W : ℝ) : Finset ℕ := by classical exact (Ioc ⌊A⌋₊ ⌊B⌋₊).filter (fun n => ∀ p ∈ n.primeFactors, W < (p : ℝ)) noncomputable def roughBandHarmonic (A B W : ℝ) : ℝ := ∑ n ∈ roughBand A B W, 1 / (n : ℝ) theorem roughBand_pos {A B W : ℝ} {n : ℕ} (hn : n ∈ roughBand A B W) : 0 < n := by classical exact lt_of_le_of_lt (Nat.zero_le _) (mem_Ioc.mp (mem_filter.mp hn).1).1 theorem roughBand_subset_Icc (A B W : ℝ) : roughBand A B W ⊆ Icc 1 ⌊B⌋₊ := by classical intro n hn exact mem_Icc.mpr ⟨roughBand_pos hn, (mem_Ioc.mp (mem_filter.mp hn).1).2⟩ theorem primeBand_subset_roughBand {A B W : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hW : W ≤ A) : primeBand A B ⊆ roughBand A B W := by classical intro p hp obtain ⟨hpp, hpA, _⟩ := (mem_primeBand_iff hA hB p).mp hp refine mem_filter.mpr ⟨(mem_filter.mp hp).1, ?_⟩ intro q hq have hq' := Nat.mem_primeFactors.mp hq have hqp : q = p := ((Nat.dvd_prime hpp).mp hq'.2.1).resolve_left hq'.1.ne_one simpa only [hqp] using hW.trans_lt hpA theorem primeBandHarmonic_le_roughBandHarmonic {A B W : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hW : W ≤ A) : primeBandHarmonic A B ≤ roughBandHarmonic A B W := by apply sum_le_sum_of_subset_of_nonneg (primeBand_subset_roughBand hA hB hW) intro n _ _ positivity theorem roughBandHarmonic_le_log {A B W : ℝ} (hB : 1 ≤ B) : roughBandHarmonic A B W ≤ 1 + Real.log B := by have heq : (∑ n ∈ Icc 1 ⌊B⌋₊, 1 / (n : ℝ)) = (harmonic ⌊B⌋₊ : ℝ) := by simp only [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast, one_div] calc _ ≤ ∑ n ∈ Icc 1 ⌊B⌋₊, 1 / (n : ℝ) := sum_le_sum_of_subset_of_nonneg (roughBand_subset_Icc A B W) (by intros; positivity) _ = (harmonic ⌊B⌋₊ : ℝ) := heq _ ≤ 1 + Real.log B := harmonic_floor_le_one_add_log B hB noncomputable def candidateRoughBand (c L : ℝ) (j : ℕ) : Finset ℕ := roughBand (Real.exp (c * L / 2^j)) (Real.exp ((6/5 : ℝ) * c * L / 2^j)) (Real.exp (Real.sqrt L)) theorem eventually_sqrt_le_dyadic_scale {c : ℝ} (hc : 0 < c) (j : ℕ) : ∀ᶠ L : ℝ in atTop, Real.sqrt L ≤ c * L / 2^j := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (((2 : ℝ)^j / c)^2)] with L hL hlarge have hroot := Real.sqrt_le_sqrt hlarge rw [Real.sqrt_sq (by positivity : 0 ≤ (2 : ℝ)^j / c)] at hroot have hm : (2 : ℝ)^j ≤ Real.sqrt L * c := (div_le_iff₀ hc).mp hroot apply (le_div_iff₀ (by positivity : (0 : ℝ) < 2^j)).mpr calc _ = (2 : ℝ)^j * Real.sqrt L := mul_comm _ _ _ ≤ (Real.sqrt L * c) * Real.sqrt L := mul_le_mul_of_nonneg_right hm (Real.sqrt_nonneg L) _ = c * (Real.sqrt L)^2 := by ring _ = c * L := by rw [Real.sq_sqrt (by linarith : 0 ≤ L)] theorem exists_candidate_rough_slot_harmonic_bounds {c : ℝ} (hc : 0 < c) : ∃ v : ℝ, 0 < v ∧ ∀ j : ℕ, ∀ᶠ L : ℝ in atTop, v ≤ (∑ n ∈ candidateRoughBand c L j, 1 / (n : ℝ)) ∧ (∑ n ∈ candidateRoughBand c L j, 1 / (n : ℝ)) ≤ 1 + (6/5 : ℝ) * c * L := by obtain ⟨v, V, t0, hv, _, _, hmass⟩ := exists_primeBandHarmonic_threshold (show (1 : ℝ) < 6/5 by norm_num) refine ⟨v, hv, ?_⟩ intro j filter_upwards [eventually_sqrt_le_dyadic_scale hc j, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (t0 * (2 : ℝ)^j / c)] with L hsqrt hL ht have hscale : t0 ≤ c * L / 2^j := by apply (le_div_iff₀ (by positivity : (0 : ℝ) < 2^j)).mpr simpa only [mul_comm c L] using (div_le_iff₀ hc).mp ht have hL0 : 0 < L := by linarith have hB : 1 ≤ Real.exp ((6/5 : ℝ) * c * L / 2^j) := Real.one_le_exp (by positivity) have hP : v ≤ primeBandHarmonic (Real.exp (c * L / 2^j)) (Real.exp ((6/5 : ℝ) * c * L / 2^j)) := by convert (hmass (c * L / 2^j) hscale).1 using 1 congr 2 ring constructor · exact hP.trans (primeBandHarmonic_le_roughBandHarmonic (Real.exp_pos _).le (Real.exp_pos _).le (Real.exp_le_exp.mpr hsqrt)) · refine (roughBandHarmonic_le_log hB).trans ?_ rw [Real.log_exp] apply add_le_add le_rfl exact div_le_self (by positivity) (one_le_pow₀ (by norm_num : (1 : ℝ) ≤ 2)) end section open Finset Filter open scoped Topology noncomputable def candidateQSlotChoices (c L : ℝ) (r jStar : ℕ) (slot : (candidateQIndices c L) × Fin r) : Finset ℕ := if slot.1.val = jStar ∧ slot.2.val = 0 then candidateRoughBand c L jStar else candidateQBand (c * L) slot.1.val noncomputable def candidateQWeight (c L : ℝ) (r jStar n : ℕ) : ℝ := orderedSlotWeight (candidateQSlotChoices c L r jStar) ((r.factorial : ℝ) ^ (candidateQIndices c L).card) n noncomputable def candidateQHarmonicMass (c L : ℝ) (r jStar : ℕ) : ℝ := ∑' n : ℕ, candidateQWeight c L r jStar n / (n : ℝ) theorem candidate_Q_weight_nonneg (c L : ℝ) (r jStar n : ℕ) : 0 ≤ candidateQWeight c L r jStar n := ordered_slot_weight_nonneg _ (by positivity) n section variable (c L : ℝ) (r jStar : ℕ) include c L r jStar theorem candidate_Q_harmonic_summable : Summable (fun n : ℕ => candidateQWeight c L r jStar n / (n : ℝ)) := ordered_slot_harmonic_summable _ _ theorem candidate_Q_harmonic_eq_product : candidateQHarmonicMass c L r jStar = (∏ slot : (candidateQIndices c L) × Fin r, ∑ p ∈ candidateQSlotChoices c L r jStar slot, 1 / (p : ℝ)) / ((r.factorial : ℝ) ^ (candidateQIndices c L).card) := ordered_slot_harmonic_sum _ _ theorem candidate_Q_slot_harmonic_nonneg (slot : (candidateQIndices c L) × Fin r) : 0 ≤ ∑ p ∈ candidateQSlotChoices c L r jStar slot, 1 / (p : ℝ) := sum_nonneg (fun _ _ => by positivity) theorem candidate_Q_slot_nonzero (slot : (candidateQIndices c L) × Fin r) {n : ℕ} (hn : n ∈ candidateQSlotChoices c L r jStar slot) : n ≠ 0 := by unfold candidateQSlotChoices at hn split_ifs at hn · exact (roughBand_pos hn).ne' · exact (mem_filter.mp hn).2.ne_zero theorem candidate_Q_weight_zero_at_zero : candidateQWeight c L r jStar 0 = 0 := by classical unfold candidateQWeight orderedSlotWeight apply sum_eq_zero intro x _ have hprod : orderedSlotProduct (candidateQSlotChoices c L r jStar) x ≠ 0 := by apply Finset.prod_ne_zero_iff.mpr intro slot _ exact candidate_Q_slot_nonzero c L r jStar slot (x slot).property exact if_neg hprod theorem candidate_Q_harmonic_eq_group_product : candidateQHarmonicMass c L r jStar = ∏ j : candidateQIndices c L, (∏ k : Fin r, ∑ p ∈ candidateQSlotChoices c L r jStar (j, k), 1 / (p : ℝ)) / (r.factorial : ℝ) := by classical rw [candidate_Q_harmonic_eq_product, Fintype.prod_prod_type] simp only [prod_div_distrib, prod_const, card_univ, Fintype.card_coe] end end section open Finset theorem product_le_with_one_exception {I : Type*} [DecidableEq I] (s : Finset I) (f : I → ℝ) (P : I → Prop) {V Z : ℝ} (hV : 1 ≤ V) (hZ : 1 ≤ Z) (hf0 : ∀ i ∈ s, 0 ≤ f i) (hsmall : ∀ i ∈ s, ¬P i → f i ≤ V) (hlarge : ∀ i ∈ s, P i → f i ≤ Z) (hunique : ∀ i ∈ s, ∀ j ∈ s, P i → P j → i = j) : (∏ i ∈ s, f i) ≤ Z * V^s.card := by classical by_cases h : ∃ i ∈ s, P i · obtain ⟨a, ha, hPa⟩ := h rw [← mul_prod_erase s f ha] have hprod : (∏ i ∈ s.erase a, f i) ≤ V^(s.erase a).card := by rw [← prod_const] apply prod_le_prod₀ (fun i hi => hf0 i (mem_of_mem_erase hi)) intro i hi apply hsmall i (mem_of_mem_erase hi) intro hPi exact (mem_erase.mp hi).1 (hunique i (mem_of_mem_erase hi) a ha hPi hPa) refine (mul_le_mul (hlarge a ha hPa) hprod (prod_nonneg (fun i hi => hf0 i (mem_of_mem_erase hi))) (by linarith)).trans ?_ exact mul_le_mul_of_nonneg_left (pow_le_pow_right₀ hV (card_erase_le)) (by linarith) · have hprod : (∏ i ∈ s, f i) ≤ V^s.card := by rw [← prod_const] exact prod_le_prod₀ hf0 (fun i hi => hsmall i hi (fun hp => h ⟨i, hi, hp⟩)) exact hprod.trans (le_mul_of_one_le_left (pow_nonneg (by linarith) _) hZ) theorem product_lower_of_log_card {I : Type*} (s : Finset I) (f : I → ℝ) {v L K : ℝ} (hv : 0 < v) (hv1 : v ≤ 1) (hL : 0 < L) (hf : ∀ i ∈ s, v ≤ f i) (hcard : (s.card : ℝ) ≤ K * Real.log L) : L^(K * Real.log v) ≤ ∏ i ∈ s, f i := by have hvlog : Real.log v ≤ 0 := Real.log_nonpos hv.le hv1 calc _ = Real.exp ((K * Real.log L) * Real.log v) := by rw [Real.rpow_def_of_pos hL] congr 1 ring _ ≤ Real.exp ((s.card : ℝ) * Real.log v) := Real.exp_le_exp.mpr (mul_le_mul_of_nonpos_right hcard hvlog) _ = v^s.card := by rw [Real.exp_nat_mul, Real.exp_log hv] _ = ∏ _i ∈ s, v := by simp _ ≤ ∏ i ∈ s, f i := prod_le_prod₀ (fun _ _ => hv.le) hf end section open Finset Filter open scoped Topology theorem candidate_Q_harmonic_lower_of_slot_bounds {c L a v K : ℝ} {r jStar : ℕ} (ha : 0 < a) (ha1 : a ≤ 1) (hv : 0 ≤ v) (hL : 0 < L) (hav : a ≤ v^r / (r.factorial : ℝ)) (hslot : ∀ slot : (candidateQIndices c L) × Fin r, v ≤ ∑ p ∈ candidateQSlotChoices c L r jStar slot, 1 / (p : ℝ)) (hcard : ((candidateQIndices c L).card : ℝ) ≤ K * Real.log L) : L^(K * Real.log a) ≤ candidateQHarmonicMass c L r jStar := by classical rw [candidate_Q_harmonic_eq_group_product] apply product_lower_of_log_card univ _ ha ha1 hL _ (by simpa using hcard) intro j _ refine hav.trans (div_le_div_of_nonneg_right ?_ (Nat.cast_nonneg _)) calc v^r = ∏ _k : Fin r, v := by simp _ ≤ _ := prod_le_prod₀ (fun _ _ => hv) (fun k _ => hslot (j, k)) theorem candidate_Q_harmonic_upper_of_slot_bounds {c L V Z K : ℝ} {r jStar : ℕ} (hV : 1 ≤ V) (hZ : 1 ≤ Z) (hL : 0 < L) (hsmall : ∀ slot : (candidateQIndices c L) × Fin r, ¬(slot.1.val = jStar ∧ slot.2.val = 0) → (∑ p ∈ candidateQSlotChoices c L r jStar slot, 1 / (p : ℝ)) ≤ V) (hlarge : ∀ slot : (candidateQIndices c L) × Fin r, slot.1.val = jStar ∧ slot.2.val = 0 → (∑ p ∈ candidateQSlotChoices c L r jStar slot, 1 / (p : ℝ)) ≤ Z) (hcard : ((candidateQIndices c L).card : ℝ) ≤ K * Real.log L) : candidateQHarmonicMass c L r jStar ≤ Z * L^((r : ℝ) * K * Real.log V) := by classical rw [candidate_Q_harmonic_eq_product] let f : (candidateQIndices c L) × Fin r → ℝ := fun slot => ∑ p ∈ candidateQSlotChoices c L r jStar slot, 1 / (p : ℝ) have hf0 : ∀ slot, 0 ≤ f slot := candidate_Q_slot_harmonic_nonneg c L r jStar have hnorm : 1 ≤ (r.factorial : ℝ)^(candidateQIndices c L).card := one_le_pow₀ (by exact_mod_cast Nat.factorial_pos r) have hprod := product_le_with_one_exception univ f (fun slot => slot.1.val = jStar ∧ slot.2.val = 0) hV hZ (fun slot _ => hf0 slot) (fun slot _ => hsmall slot) (fun slot _ => hlarge slot) (by intro i _ j _ hi hj exact Prod.ext (Subtype.ext (hi.1.trans hj.1.symm)) (Fin.ext (hi.2.trans hj.2.symm))) have hcardslot : ((univ : Finset ((candidateQIndices c L) × Fin r)).card : ℝ) ≤ ((r : ℝ) * K) * Real.log L := by simp only [card_univ, Fintype.card_prod, Fintype.card_coe, Fintype.card_fin, Nat.cast_mul] have h := mul_le_mul_of_nonneg_left hcard (Nat.cast_nonneg r) nlinarith only [h] have hp := group_product_bound_of_log_card univ (fun _slot : (candidateQIndices c L) × Fin r => V) hV hL (fun _ _ => by linarith) (fun _ _ => le_rfl) hcardslot simp only [prod_const] at hp exact (div_le_self (prod_nonneg (fun slot _ => hf0 slot)) hnorm).trans (hprod.trans (mul_le_mul_of_nonneg_left hp (by linarith))) /- The exponent is independent of the fixed band containing the rough slot. -/ theorem exists_candidate_Q_harmonic_polynomial_bounds {c : ℝ} (hc : 0 < c) (r : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ jStar : ℕ, ∀ᶠ L : ℝ in atTop, L^(-C) ≤ candidateQHarmonicMass c L r jStar ∧ candidateQHarmonicMass c L r jStar ≤ L^C := by obtain ⟨vl, vu, hvl, hvu, hbands⟩ := exists_candidateQBands_bounds hc obtain ⟨vr, hvr, hrough⟩ := exists_candidate_rough_slot_harmonic_bounds hc let v : ℝ := min vl vr let V : ℝ := max 1 vu let K : ℝ := 1 / Real.log 2 + 1 let a : ℝ := min 1 (v^r / (r.factorial : ℝ)) let D : ℝ := K * Real.log a let E : ℝ := (r : ℝ) * K * Real.log V let C : ℝ := max (-D) (E + 2) have hv : 0 < v := lt_min hvl hvr have ha : 0 < a := lt_min zero_lt_one (by positivity) have ha1 : a ≤ 1 := min_le_left _ _ have hV : 1 ≤ V := le_max_left _ _ have hK : 0 ≤ K := by dsimp [K]; positivity have hE : 0 ≤ E := mul_nonneg (mul_nonneg (Nat.cast_nonneg _) hK) (Real.log_nonneg hV) have hC0 : 0 ≤ C := (by linarith : 0 ≤ E + 2).trans (le_max_right _ _) refine ⟨C, hC0, ?_⟩ intro jStar filter_upwards [hbands, hrough jStar, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (1 + (6/5 : ℝ) * c)] with L hb hr hL hLbig have hL0 : 0 < L := zero_lt_one.trans_le hL have hslots : ∀ slot : (candidateQIndices c L) × Fin r, v ≤ ∑ p ∈ candidateQSlotChoices c L r jStar slot, 1 / (p : ℝ) := by intro slot unfold candidateQSlotChoices split_ifs · exact (min_le_right vl vr).trans hr.1 · exact (min_le_left vl vr).trans ((hb.2.2 slot.1.val slot.1.property).2.2.1) have hlo : L^D ≤ candidateQHarmonicMass c L r jStar := candidate_Q_harmonic_lower_of_slot_bounds ha ha1 hv.le hL0 (min_le_right _ _) hslots hb.2.1 have hZ : 1 ≤ 1 + (6/5 : ℝ) * c * L := le_add_of_nonneg_right (by positivity) have hhi : candidateQHarmonicMass c L r jStar ≤ (1 + (6/5 : ℝ) * c * L) * L^E := by apply candidate_Q_harmonic_upper_of_slot_bounds hV hZ hL0 _ _ hb.2.1 · intro slot hslot rw [candidateQSlotChoices, if_neg hslot] exact ((hb.2.2 slot.1.val slot.1.property).2.2.2).trans (le_max_right 1 vu) · intro slot hslot rw [candidateQSlotChoices, if_pos hslot] exact hr.2 have hZL : 1 + (6/5 : ℝ) * c * L ≤ L^2 := by calc _ ≤ L * (1 + (6/5 : ℝ) * c) := by nlinarith _ ≤ L * L := mul_le_mul_of_nonneg_left hLbig hL0.le _ = _ := by ring have hpow : (1 + (6/5 : ℝ) * c * L) * L^E ≤ L^(E + 2) := by calc _ ≤ L^2 * L^E := mul_le_mul_of_nonneg_right hZL (Real.rpow_nonneg hL0.le E) _ = L^(E + 2) := by rw [Real.rpow_add hL0, Real.rpow_two]; ring constructor · refine (Real.rpow_le_rpow_of_exponent_le hL ?_).trans hlo have hDC : -D ≤ C := le_max_left _ _ linarith · exact hhi.trans (hpow.trans (Real.rpow_le_rpow_of_exponent_le hL (le_max_right _ _))) end section open Finset Filter open scoped Topology theorem primeBand_card_eq_counting_sub {A B : ℝ} (hAB : A ≤ B) : ((primeBand A B).card : ℝ) = primeCountingReal B - primeCountingReal A := by have hfloor := Nat.floor_le_floor hAB have hset : Ioc ⌊A⌋₊ ⌊B⌋₊ = Ico (⌊A⌋₊ + 1) (⌊B⌋₊ + 1) := by ext n simp only [mem_Ioc, mem_Ico] omega have hsum := sum_Ico_eq_sub (fun n : ℕ => if n.Prime then (1 : ℝ) else 0) (Nat.add_le_add_right hfloor 1) rw [← hset] at hsum rw [sum_boole] at hsum simpa only [primeBand, primeCountingReal_eq_sum, Nat.range_succ_eq_Icc_zero] using hsum theorem primeBandHarmonic_card_bounds {A B : ℝ} (hA : 0 < A) (hAB : A ≤ B) : ((primeBand A B).card : ℝ) / B ≤ primeBandHarmonic A B ∧ primeBandHarmonic A B ≤ ((primeBand A B).card : ℝ) / A := by have hB : 0 < B := hA.trans_le hAB have hlow : (∑ _p ∈ primeBand A B, 1 / B) ≤ primeBandHarmonic A B := by apply sum_le_sum intro p hp have hdata := (mem_primeBand_iff hA.le hB.le p).mp hp exact one_div_le_one_div_of_le (hA.trans hdata.2.1) hdata.2.2 have hhigh : primeBandHarmonic A B ≤ ∑ _p ∈ primeBand A B, 1 / A := by apply sum_le_sum intro p hp have hdata := (mem_primeBand_iff hA.le hB.le p).mp hp exact one_div_le_one_div_of_le hA hdata.2.1.le simpa only [sum_const, nsmul_eq_mul, mul_one_div] using And.intro hlow hhigh theorem primeBandHarmonic_fixed_ratio_bounds_of_counting {A R a b : ℝ} (hA : 1 < A) (hR : 1 ≤ R) (ha : 0 ≤ a) (hb : 0 ≤ b) (hlog : Real.log (R * A) ≤ 2 * Real.log A) (hlow : a * (R * A) / Real.log (R * A) ≤ primeCountingReal (R * A)) (hup : primeCountingReal A ≤ b * A / Real.log A) (hupR : primeCountingReal (R * A) ≤ b * (R * A) / Real.log (R * A)) : (a / 2 - b / R) / Real.log A ≤ primeBandHarmonic A (R * A) ∧ primeBandHarmonic A (R * A) ≤ R * b / Real.log A := by have hA0 : 0 < A := zero_lt_one.trans hA have hR0 : 0 < R := zero_lt_one.trans_le hR have hAB : A ≤ R * A := le_mul_of_one_le_left hA0.le hR have hRA : 1 < R * A := hA.trans_le hAB have hlA : 0 < Real.log A := Real.log_pos hA have hlRA : 0 < Real.log (R * A) := Real.log_pos hRA have hlogs : Real.log A ≤ Real.log (R * A) := Real.log_le_log hA0 hAB obtain ⟨hcardlo, hcardhi⟩ := primeBandHarmonic_card_bounds hA0 hAB rw [primeBand_card_eq_counting_sub hAB] at hcardlo hcardhi constructor · have hlow' : a * (R * A) / (2 * Real.log A) ≤ primeCountingReal (R * A) := (div_le_div_of_nonneg_left (by positivity) hlRA hlog).trans hlow have hdiff := sub_le_sub hlow' hup refine (le_trans ?_ (div_le_div_of_nonneg_right hdiff (by positivity))).trans hcardlo have heq : (a / 2 - b / R) / Real.log A = (a * (R * A) / (2 * Real.log A) - b * A / Real.log A) / (R * A) := by field_simp exact heq.le · have hdiff : primeCountingReal (R * A) - primeCountingReal A ≤ b * (R * A) / Real.log A := by have h : b * (R * A) / Real.log (R * A) ≤ b * (R * A) / Real.log A := div_le_div_of_nonneg_left (by positivity) hlA hlogs have h' := hupR.trans h linarith [primeCountingReal_nonneg A] refine hcardhi.trans ((div_le_div_of_nonneg_right hdiff hA0.le).trans ?_) have heq : (b * (R * A) / Real.log A) / A = R * b / Real.log A := by field_simp exact heq.le theorem wide_prime_window_lower_constant_pos : 0 < (2 * Real.log 2 - 1) / 16 := by linarith [Real.log_two_gt_d9] theorem eventually_wide_prime_window_harmonic_bounds : ∀ᶠ y : ℝ in atTop, ((2 * Real.log 2 - 1) / 16) / Real.log y ≤ primeBandHarmonic y (16 * y) ∧ primeBandHarmonic y (16 * y) ≤ (16 * (Real.log 4 + 1)) / Real.log y := by obtain ⟨y0, hcount⟩ := eventually_atTop.mp eventually_primeCounting_chebyshev_bounds filter_upwards [eventually_ge_atTop y0, eventually_ge_atTop (16 : ℝ)] with y hy0 hy have hy1 : 1 < y := by linarith have hyle : y ≤ 16 * y := by linarith have hcounty := hcount y hy0 have hcount16 := hcount (16 * y) (hy0.trans hyle) have hlog : Real.log (16 * y) ≤ 2 * Real.log y := by rw [Real.log_mul (by norm_num : (16 : ℝ) ≠ 0) (by linarith : y ≠ 0)] have h := Real.log_le_log (by norm_num : (0 : ℝ) < 16) hy linarith have h := primeBandHarmonic_fixed_ratio_bounds_of_counting hy1 (by norm_num : (1 : ℝ) ≤ 16) prime_counting_lower_constant_pos.le prime_counting_upper_constant_pos.le hlog hcount16.1 hcounty.2 hcount16.2 have hlog4 : Real.log 4 = 2 * Real.log 2 := by simpa only [show (2 : ℝ)^2 = 4 by norm_num, Nat.cast_ofNat] using Real.log_pow (2 : ℝ) 2 have hcoeff : (Real.log 2 / 2) / 2 - (Real.log 4 + 1) / 16 = (2 * Real.log 2 - 1) / 16 := by rw [hlog4]; ring simpa only [hcoeff] using h theorem eventually_wide_prime_log_window_harmonic_bounds : ∀ᶠ t : ℝ in atTop, ((2 * Real.log 2 - 1) / 16) / t ≤ primeBandHarmonic (Real.exp t) (Real.exp (t + Real.log 16)) ∧ primeBandHarmonic (Real.exp t) (Real.exp (t + Real.log 16)) ≤ (16 * (Real.log 4 + 1)) / t := by have h := Real.tendsto_exp_atTop.eventually eventually_wide_prime_window_harmonic_bounds simpa only [Real.log_exp, Real.exp_add, Real.exp_log (by norm_num : (0 : ℝ) < 16), mul_comm (Real.exp _) 16] using h end section open Filter open scoped Topology theorem eventually_uniform_wide_prime_log_window {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : ∀ᶠ L : ℝ in atTop, ∀ t : ℝ, a * L ≤ t → t ≤ b * L → (((2 * Real.log 2 - 1) / 16) / b) / L ≤ primeBandHarmonic (Real.exp t) (Real.exp (t + Real.log 16)) ∧ primeBandHarmonic (Real.exp t) (Real.exp (t + Real.log 16)) ≤ ((16 * (Real.log 4 + 1)) / a) / L := by have hb : 0 < b := ha.trans_le hab obtain ⟨t0, ht0⟩ := eventually_atTop.mp eventually_wide_prime_log_window_harmonic_bounds filter_upwards [eventually_gt_atTop (0 : ℝ), eventually_ge_atTop (t0 / a)] with L hL hlarge intro t hat htb have ht : 0 < t := (mul_pos ha hL).trans_le hat have hthreshold : t0 ≤ t := by have h := (div_le_iff₀ ha).mp hlarge nlinarith only [h, hat] obtain ⟨hlo, hhi⟩ := ht0 t hthreshold constructor · have h := div_le_div_of_nonneg_left wide_prime_window_lower_constant_pos.le ht htb have hid : (((2 * Real.log 2 - 1) / 16) / b) / L = ((2 * Real.log 2 - 1) / 16) / (b * L) := by ring rw [hid] exact h.trans hlo · have h := div_le_div_of_nonneg_left (show 0 ≤ 16 * (Real.log 4 + 1) by positivity) (mul_pos ha hL) hat have hid : ((16 * (Real.log 4 + 1)) / a) / L = (16 * (Real.log 4 + 1)) / (a * L) := by ring rw [hid] exact hhi.trans h end section open Finset Filter open scoped Topology noncomputable def primeProductWindow (P : Finset ℕ) (r X : ℝ) : Finset ℕ := P.filter (fun p => X < (p : ℝ) * r ∧ (p : ℝ) * r ≤ 16 * X) theorem primeProductWindow_eq_primeBand {P : Finset ℕ} {r X : ℝ} (hP : ∀ p ∈ P, p.Prime) (hr : 0 < r) (hX : 0 < X) (hsubset : primeBand (X / r) (16 * (X / r)) ⊆ P) : primeProductWindow P r X = primeBand (X / r) (16 * (X / r)) := by ext p rw [primeProductWindow, mem_filter, mem_primeBand_iff (by positivity) (by positivity)] constructor · rintro ⟨hp, hlo, hhi⟩ refine ⟨hP p hp, (div_lt_iff₀ hr).mpr hlo, ?_⟩ simpa only [mul_div_assoc] using (le_div_iff₀ hr).mpr hhi · rintro ⟨hpp, hlo, hhi⟩ have hp : p ∈ primeBand (X / r) (16 * (X / r)) := (mem_primeBand_iff (by positivity) (by positivity) p).mpr ⟨hpp, hlo, hhi⟩ refine ⟨hsubset hp, (div_lt_iff₀ hr).mp hlo, ?_⟩ have hhi' : (p : ℝ) ≤ (16 * X) / r := by simpa only [mul_div_assoc] using hhi exact (le_div_iff₀ hr).mp hhi' theorem primeBand_card_ge_lower_endpoint_mul_harmonic {A B : ℝ} (hA : 0 < A) (hAB : A ≤ B) : A * primeBandHarmonic A B ≤ ((primeBand A B).card : ℝ) := by have h := (primeBandHarmonic_card_bounds hA hAB).2 have h' := (le_div_iff₀ hA).mp h simpa only [mul_comm A] using h' theorem primeProductWindow_card_lower {P : Finset ℕ} {r X H : ℝ} (hP : ∀ p ∈ P, p.Prime) (hr : 0 < r) (hX : 0 < X) (hsubset : primeBand (X / r) (16 * (X / r)) ⊆ P) (hmass : H ≤ primeBandHarmonic (X / r) (16 * (X / r))) : (X / r) * H ≤ ((primeProductWindow P r X).card : ℝ) := by rw [primeProductWindow_eq_primeBand hP hr hX hsubset] refine (mul_le_mul_of_nonneg_left hmass (by positivity)).trans ?_ exact primeBand_card_ge_lower_endpoint_mul_harmonic (by positivity) (by nlinarith [div_pos hX hr]) theorem eventually_primeProductWindow_card_lower {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : ∀ᶠ L : ℝ in atTop, ∀ (P : Finset ℕ) (r X : ℝ), (∀ p ∈ P, p.Prime) → 0 < r → 0 < X → primeBand (X / r) (16 * (X / r)) ⊆ P → a * L ≤ Real.log (X / r) → Real.log (X / r) ≤ b * L → (X / r) * ((((2 * Real.log 2 - 1) / 16) / b) / L) ≤ ((primeProductWindow P r X).card : ℝ) := by filter_upwards [eventually_uniform_wide_prime_log_window ha hab] with L hL intro P r X hP hr hX hsubset hlo hhi apply primeProductWindow_card_lower hP hr hX hsubset have h := (hL (Real.log (X / r)) hlo hhi).1 simpa only [Real.exp_add, Real.exp_log (div_pos hX hr), Real.exp_log (by norm_num : (0 : ℝ) < 16), mul_comm (X / r) 16] using h theorem wide_prime_window_subset_candidateQBand {c L r X : ℝ} (hr : 0 < r) (hX : 0 < X) (hlo : c * L ≤ Real.log (X / r)) (hhi : Real.log (X / r) + Real.log 16 ≤ (6/5 : ℝ) * c * L) : primeBand (X / r) (16 * (X / r)) ⊆ candidateQBand (c * L) 0 := by have hlo' : Real.exp (c * L) ≤ X / r := (Real.exp_le_exp.mpr hlo).trans_eq (Real.exp_log (div_pos hX hr)) have hhi' : 16 * (X / r) ≤ Real.exp ((6/5 : ℝ) * c * L) := by have h := Real.exp_le_exp.mpr hhi simpa only [Real.exp_add, Real.exp_log (div_pos hX hr), Real.exp_log (by norm_num : (0 : ℝ) < 16), mul_comm (X / r) 16] using h simpa only [candidateQBand, dyadicPrimeBand, pow_zero, div_one, one_mul, mul_assoc] using primeBand_subset_of_bounds (by positivity : 0 ≤ X / r) (by positivity : 0 ≤ 16 * (X / r)) (Real.exp_pos (c * L)).le (Real.exp_pos ((6/5 : ℝ) * c * L)).le hlo' hhi' end section open scoped BigOperators noncomputable def physicalSharedProduct {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (d : PhysicalSharedLists P J) : ℕ := ∏ g, ∏ j, (d g j).val theorem physical_shared_empty_iff {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (L R : PhysicalMarkLists P J ell) : physicalSharedCompatible (fun _ => (∅ : Finset (Fin J))) L R ↔ physicalSharedPrefix L = physicalSharedPrefix R := by constructor · intro h funext g apply Function.Embedding.ext intro j exact h g j (Finset.notMem_empty j) · intro h g j _ exact congrArg (fun d : PhysicalSharedLists P J => d g j) h section variable {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) include G P J ell aux theorem physical_aux_avoids_empty (L : PhysicalMarkLists P J ell) : physicalAuxAvoids (fun _ => (∅ : Finset (Fin J))) aux L := by intro g j exact False.elim (Finset.notMem_empty j.val j.property) theorem physical_list_admissible_empty_iff (L R : PhysicalMarkLists P J ell) : physicalListAdmissible (fun _ => (∅ : Finset (Fin J))) aux L R ↔ physicalSharedPrefix L = physicalSharedPrefix R := by simp only [physicalListAdmissible, physical_aux_avoids_empty, and_true, physical_shared_empty_iff] end theorem physical_aux_mass_empty {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) : physicalAuxMass V (fun _ => (∅ : Finset (Fin J))) aux = 1 := by simp [physicalAuxMass] theorem physical_D_empty {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (L : PhysicalMarkLists P J ell) : physicalD (fun _ => (∅ : Finset (Fin J))) L aux = physicalSharedProduct (physicalSharedPrefix L) := by simp [physicalD, physicalGroupD, physicalSharedProduct, physical_shared_prefix_apply] theorem physical_bare_empty_prefix {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (ζ : ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (L R : PhysicalMarkLists P J ell) : physicalBarePatternScalar V (fun _ => (∅ : Finset (Fin J))) ζ (fun L _ _ => κ (physicalSharedPrefix L)) aux L R = if physicalSharedPrefix L = physicalSharedPrefix R then (physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell : ℂ) * κ (physicalSharedPrefix L) * physicalPhase ζ (physicalSharedProduct (physicalSharedPrefix L)) else 0 := by simp only [physicalBarePatternScalar, physical_list_admissible_empty_iff, physical_aux_mass_empty, one_mul, physical_D_empty] end section open scoped BigOperators theorem finite_fiber_bilinear_sum {X Y : Type*} [Fintype X] [Fintype Y] [DecidableEq Y] (π : X → Y) (a : X → ℂ) (b : Y → X → ℂ) (c : Y → ℂ) : (∑ d, (∑ x ∈ Finset.univ.filter (fun x => π x = d), a x) * c d * (∑ y ∈ Finset.univ.filter (fun y => π y = d), b d y)) = ∑ x, ∑ y, if π x = π y then a x * c (π x) * b (π x) y else 0 := by classical simp only [Finset.sum_filter] simp_rw [Finset.sum_mul, Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro y _ calc (∑ d, (if π x = d then a x else 0) * c d * (if π y = d then b d y else 0)) = ∑ d, if π x = d then (if π y = d then a x * c d * b d y else 0) else 0 := by apply Finset.sum_congr rfl intro d _ split_ifs <;> ring _ = _ := by simp [eq_comm] end section open scoped BigOperators Classical end section open scoped BigOperators end section open scoped BigOperators Classical def physicalResidueTranslationEquiv {G : Type*} {P : G → Finset ℕ} (h : ℤ) : PhysicalResidues P ≃ PhysicalResidues P where toFun r := physicalTranslateResidues r h invFun r := physicalTranslateResidues r (-h) left_inv r := by dsimp only; rw [physical_translate_residues_add]; simp [physical_translate_residues_zero] right_inv r := by dsimp only; rw [physical_translate_residues_add]; simp [physical_translate_residues_zero] end section /- Adding real frequencies multiplies the corresponding closure phases. -/ theorem physicalReturnPhase_frequency_add (θ η : ℝ) (n : ℤ) : physicalReturnPhase (θ + η) n = physicalReturnPhase θ n * physicalReturnPhase η n := by unfold physicalReturnPhase rw [← Complex.exp_add] congr 1 push_cast ring /- A fixed integer factor in the displacement rescales the real frequency. -/ theorem physicalReturnPhase_scale (θ : ℝ) (c n : ℤ) : physicalReturnPhase θ (c * n) = physicalReturnPhase (θ * c) n := by unfold physicalReturnPhase congr 1 push_cast ring /- A character restricted to a fixed integer direction has an explicit real frequency. The frequency depends only on the direction, not on the varying integer multiplier. -/ theorem physical_character_phase {R : Type*} [AddCommGroup R] [Finite R] (χ : AddChar R ℂ) (φ : ℤ →+ R) (c n : ℤ) : χ (φ (c * n)) = physicalReturnPhase ((Complex.arg (χ (φ c))) / (2 * Real.pi)) n := by have hunit : Complex.exp ((Complex.arg (χ (φ c)) : ℂ) * Complex.I) = χ (φ c) := by simpa only [χ.norm_apply, Complex.ofReal_one, one_mul] using Complex.norm_mul_exp_arg_mul_I (χ (φ c)) have hdir : φ (c * n) = n • φ c := by rw [← map_zsmul] congr 1 simp only [zsmul_eq_mul, Int.cast_id, mul_comm] rw [hdir, AddChar.map_zsmul_eq_zpow] calc χ (φ c) ^ n = Complex.exp ((Complex.arg (χ (φ c)) : ℂ) * Complex.I) ^ n := congrArg (fun z : ℂ => z ^ n) hunit.symm _ = Complex.exp ((n : ℂ) * ((Complex.arg (χ (φ c)) : ℂ) * Complex.I)) := (Complex.exp_int_mul _ n).symm _ = _ := by unfold physicalReturnPhase congr 1 push_cast field_simp /- The character of a translated residue direction and the closure phase form one real phase. This identity holds for every integer multiplier, including negatives. -/ theorem exists_physical_character_return_frequency {R : Type*} [AddCommGroup R] [Finite R] (χ : AddChar R ℂ) (φ : ℤ →+ R) (θ : ℝ) (c : ℤ) : ∃ Θ : ℝ, ∀ n : ℤ, χ (φ (c * n)) * physicalReturnPhase θ (c * n) = physicalReturnPhase Θ n := by refine ⟨Complex.arg (χ (φ c)) / (2 * Real.pi) + θ * c, ?_⟩ intro n rw [physical_character_phase, physicalReturnPhase_scale, physicalReturnPhase_frequency_add] end section open Finset open scoped Classical /- An unrestricted event includes the fresh draw on every unpromoted slot. -/ abbrev FixedTargetEdgeEvent (S J P : Type*) (eligible : Finset J) := Σ U : Finset S, (U ↪ eligible) × UnrestrictedFreshLabels P U /- The event generates the specified target, and its fresh draws avoid all old labels. Further arithmetic or history restrictions remain separate. -/ def FixedTargetEdgeEventValid {S J P : Type*} [Fintype J] [DecidableEq S] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) {eligible : Finset J} (event : FixedTargetEdgeEvent S J P eligible) : Prop := unrestrictedTargetLabels event.1 (fun s => f (event.2.1 s).val) event.2.2 = t ∧ ∀ s, event.2.2 s ∉ univ.image f section variable {S J P : Type*} [sharedInstance1 : Fintype J] [sharedInstance2 : DecidableEq S] [sharedInstance3 : DecidableEq P] (f : J ↪ P) (t : S ↪ P) {eligible : Finset J} (event : FixedTargetEdgeEvent S J P eligible) (h : FixedTargetEdgeEventValid f t event) include S J P sharedInstance1 sharedInstance2 sharedInstance3 f t eligible event h theorem fixed_target_edge_event_matches (s : event.1) : f (event.2.1 s).val = t s.val := by have hs := congrFun h.1 s.val rw [unrestrictedTargetLabels_promoted] at hs exact hs theorem fixed_target_edge_event_fresh : event.2.2 = fun s => t s.val := by funext s have hs := congrFun h.1 s.val rw [unrestrictedTargetLabels_fresh] at hs exact hs end theorem fixed_target_edge_event_slots {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq S] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) {eligible : Finset J} (event : FixedTargetEdgeEvent S J P eligible) (h : FixedTargetEdgeEventValid f t event) : event.1 = distinctPromotedTargetSlots f t := by apply distinct_promoted_slots_forced f t event.1 (event.2.1.trans ⟨Subtype.val, Subtype.val_injective⟩) (fixed_target_edge_event_matches f t event h) intro s hs have hf := h.2 ⟨s, hs⟩ rw [fixed_target_edge_event_fresh f t event h] at hf exact hf /- Once its selected slots are fixed, every matching eligible injection is the event's injection. Old-label injectivity removes the multiplicity. -/ theorem fixed_target_edge_event_injection_unique {S J P : Type*} [Fintype J] [DecidableEq S] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) {eligible : Finset J} (event : FixedTargetEdgeEvent S J P eligible) (h : FixedTargetEdgeEventValid f t event) (e : event.1 ↪ eligible) (he : ∀ s, f (e s).val = t s.val) : event.2.1 = e := by ext s exact f.injective ((fixed_target_edge_event_matches f t event h s).trans (he s).symm) noncomputable def fixedTargetCanonicalEvent {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) {eligible : Finset J} (e : distinctPromotedTargetSlots f t ↪ eligible) : FixedTargetEdgeEvent S J P eligible := ⟨distinctPromotedTargetSlots f t, e, distinctCanonicalFresh f t⟩ section variable {S J P : Type*} [sharedInstance1 : Fintype S] [sharedInstance2 : Fintype J] [sharedInstance3 : DecidableEq S] [sharedInstance4 : DecidableEq P] (f : J ↪ P) (t : S ↪ P) {eligible : Finset J} (e : distinctPromotedTargetSlots f t ↪ eligible) (he : ∀ s, f (e s).val = t s.val) include S J P sharedInstance1 sharedInstance2 sharedInstance3 sharedInstance4 f t eligible e he theorem fixed_target_canonical_event_valid : FixedTargetEdgeEventValid f t (fixedTargetCanonicalEvent f t e) := by exact ⟨distinct_unrestricted_target_labels f t eligible e he, distinct_canonical_fresh_outside_old f t⟩ /- This equality includes the dependent selected subset, eligible matching, and all complementary fresh draws, so no event data are forgotten. -/ theorem fixed_target_edge_event_unique (event : FixedTargetEdgeEvent S J P eligible) (h : FixedTargetEdgeEventValid f t event) : event = fixedTargetCanonicalEvent f t e := by rcases event with ⟨U, g, fresh⟩ have hU := fixed_target_edge_event_slots f t ⟨U, g, fresh⟩ h change U = distinctPromotedTargetSlots f t at hU subst U have hg := fixed_target_edge_event_injection_unique f t ⟨distinctPromotedTargetSlots f t, g, fresh⟩ h e he have hf := fixed_target_edge_event_fresh f t ⟨distinctPromotedTargetSlots f t, g, fresh⟩ h change g = e at hg change fresh = distinctCanonicalFresh f t at hf rw [hg, hf] rfl end noncomputable def fixedTargetEdgeEvents {S J P : Type*} [Fintype S] [Fintype J] [Fintype P] [DecidableEq S] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (eligible : Finset J) : Finset (FixedTargetEdgeEvent S J P eligible) := univ.filter (FixedTargetEdgeEventValid f t) theorem fixed_target_edge_events_eq_singleton {S J P : Type*} [Fintype S] [Fintype J] [Fintype P] [DecidableEq S] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (eligible : Finset J) (e : distinctPromotedTargetSlots f t ↪ eligible) (he : ∀ s, f (e s).val = t s.val) : fixedTargetEdgeEvents f t eligible = {fixedTargetCanonicalEvent f t e} := by ext event simp only [fixedTargetEdgeEvents, mem_filter, mem_univ, true_and, mem_singleton] constructor · exact fixed_target_edge_event_unique f t e he event · intro h rw [h] exact fixed_target_canonical_event_valid f t e he section variable {S J P M : Type*} [sharedInstance1 : Fintype S] [sharedInstance2 : Fintype J] [sharedInstance3 : Fintype P] [sharedInstance4 : DecidableEq S] [sharedInstance5 : DecidableEq P] [sharedInstance6 : AddCommMonoid M] (f : J ↪ P) (t : S ↪ P) (eligible : Finset J) (e : distinctPromotedTargetSlots f t ↪ eligible) (he : ∀ s, f (e s).val = t s.val) (F : FixedTargetEdgeEvent S J P eligible → M) include S J P M sharedInstance1 sharedInstance2 sharedInstance3 sharedInstance4 sharedInstance5 sharedInstance6 f t eligible e he F /- Arbitrary coupled real, complex, or other additive event tests collapse once, without a factorial normalization. -/ theorem sum_fixed_target_edge_events : (∑ event ∈ fixedTargetEdgeEvents f t eligible, F event) = F (fixedTargetCanonicalEvent f t e) := by rw [fixed_target_edge_events_eq_singleton f t eligible e he, sum_singleton] /- The literal nested enumeration over subsets, eligible injections, and fresh tuples has the same one-term value after fixing the distinct target. -/ theorem sum_fixed_target_edge_subsets_injections_fresh : (∑ U : Finset S, ∑ g : U ↪ eligible, ∑ fresh : UnrestrictedFreshLabels P U, if FixedTargetEdgeEventValid f t ⟨U, g, fresh⟩ then F ⟨U, g, fresh⟩ else 0) = F (fixedTargetCanonicalEvent f t e) := by have h := sum_fixed_target_edge_events f t eligible e he F simpa only [fixedTargetEdgeEvents, sum_filter, Fintype.sum_sigma, Fintype.sum_prod_type] using h end end section open Finset /- The canonical matching index is an old index required by the target. -/ theorem canonical_promotion_mem_required {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (s : distinctPromotedTargetSlots f t) : distinctCanonicalPromotion f t s ∈ univ.filter (fun j => f j ∈ univ.image t) := by exact mem_filter.mpr ⟨mem_univ _, mem_image.mpr ⟨s.val, mem_univ _, (distinct_canonical_promotion_matches f t s).symm⟩⟩ /- The unique old matching injection, restricted to the eligibility set. -/ noncomputable def canonicalEligiblePromotion {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (eligible : Finset J) (h : univ.filter (fun j => f j ∈ univ.image t) ⊆ eligible) : distinctPromotedTargetSlots f t ↪ eligible where toFun s := ⟨distinctCanonicalPromotion f t s, h (canonical_promotion_mem_required f t s)⟩ inj' := by intro s r hsr exact (distinctCanonicalPromotion f t).injective (congrArg Subtype.val hsr) theorem canonical_eligible_promotion_matches {S J P : Type*} [Fintype S] [Fintype J] [DecidableEq P] (f : J ↪ P) (t : S ↪ P) (eligible : Finset J) (h : univ.filter (fun j => f j ∈ univ.image t) ⊆ eligible) (s : distinctPromotedTargetSlots f t) : f (canonicalEligiblePromotion f t eligible h s).val = t s.val := distinct_canonical_promotion_matches f t s end section open Finset open scoped Classical end section open Finset open scoped Classical /- Restricting the actual edge action to one distinct target and fresh labels outside old memory leaves one promotion/fresh event for each storage subset. The actual memory cutoff and arbitrary complex event phase are retained. -/ theorem unrestricted_edge_action_fixed_target {P Z : Type*} [Fintype P] [DecidableEq P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (label : Z → P) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V : ℝ) (eligible : Finset (Fin N)) (B : ℕ) (f : Fin N ↪ P) (hlabel : ∀ j, label (old j) = f j) (target : Fin t ↪ P) (e : distinctPromotedTargetSlots f target ↪ eligible) (hmatch : ∀ s : distinctPromotedTargetSlots f target, f (e s).val = target s.val) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ eligible) → UnrestrictedFreshLabels P promotions → ℂ) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) : unrestrictedEdgeAction source old label seed transport hit μ ρ V eligible B (fun stores promotions g fresh => if FixedTargetEdgeEventValid f target ⟨promotions, g, fresh⟩ then phase stores promotions g fresh else 0) F = ∑ stores : Finset (Fin t), (unrestrictedEdgeEventMass source old seed transport hit μ ρ V stores (distinctPromotedTargetSlots f target) e (distinctCanonicalFresh f target) : ℂ) * phase stores (distinctPromotedTargetSlots f target) e (distinctCanonicalFresh f target) * (if (unrestrictedEdgeOutput source old seed transport stores (distinctPromotedTargetSlots f target) e).1 ≤ B then F target (unrestrictedEdgeOutput source old seed transport stores (distinctPromotedTargetSlots f target) e) else 0) := by classical unfold unrestrictedEdgeAction apply sum_congr rfl intro stores _ have h := sum_fixed_target_edge_subsets_injections_fresh f target eligible e hmatch (fun event : FixedTargetEdgeEvent (Fin t) (Fin N) P eligible => (unrestrictedEdgeEventMass source old seed transport hit μ ρ V stores event.1 event.2.1 event.2.2 : ℂ) * phase stores event.1 event.2.1 event.2.2 * (if (unrestrictedEdgeOutput source old seed transport stores event.1 event.2.1).1 ≤ B then F (unrestrictedEdgeTarget old label event.1 event.2.1 event.2.2) (unrestrictedEdgeOutput source old seed transport stores event.1 event.2.1) else 0)) dsimp only [fixedTargetCanonicalEvent] at h rw [distinct_unrestricted_edge_target old label f hlabel target eligible e hmatch] at h refine Eq.trans ?_ h apply sum_congr rfl intro U _ apply sum_congr rfl intro g _ apply sum_congr rfl intro fresh _ by_cases hv : FixedTargetEdgeEventValid f target ⟨U, g, fresh⟩ <;> simp only [hv, if_true, if_false, mul_zero, zero_mul] end section open Finset open scoped Classical end section open Finset /- A particle read at an equal label, with its residue transported through the label equality. -/ def ghostPhaseParticleReadout {P : Type*} {R : P → Type*} (particle : Σ p, R p) (p : P) (h : particle.1 = p) : GhostPhaseState (R p) := h ▸ some (some (some particle.2)) theorem ghost_phase_particle_readout_eq {P : Type*} {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) (particle : Σ p, R p) (hp : z particle.1 = some (some (some particle.2))) (p : P) (h : particle.1 = p) : ghostPhaseParticleReadout particle p h = z p := by cases h exact hp.symm theorem ghost_phase_particle_readout_congr {P : Type*} {R : P → Type*} (x y : Σ p, R p) (p : P) (hx : x.1 = p) (hy : y.1 = p) (h : x = y) : ghostPhaseParticleReadout x p hx = ghostPhaseParticleReadout y p hy := by subst y rfl /- Prefer a pending particle at each represented label, using the base phase at all other labels. The choice is harmless whenever all particles agree with one phase configuration, even without a distinctness hypothesis. -/ noncomputable def ghostPhaseMemoryReadout {P : Type*} {R : P → Type*} (base : (p : P) → GhostPhaseState (R p)) (memory : FiniteOrderedTuple (Σ p, R p)) : (p : P) → GhostPhaseState (R p) := by classical exact fun p => if h : ∃ j, (memory.2 j).1 = p then ghostPhaseParticleReadout (memory.2 h.choose) p h.choose_spec else base p /- On a tuple with distinct labels, reading any represented coordinate returns its specified particle independently of the internal choice. -/ theorem ghost_phase_memory_readout_at {P : Type*} {R : P → Type*} (base : (p : P) → GhostPhaseState (R p)) (memory : FiniteOrderedTuple (Σ p, R p)) (hinj : Function.Injective (Sigma.fst ∘ memory.2)) (j : Fin memory.1) : ghostPhaseMemoryReadout base memory (memory.2 j).1 = some (some (some (memory.2 j).2)) := by classical have h : ∃ k, (memory.2 k).1 = (memory.2 j).1 := ⟨j, rfl⟩ rw [ghostPhaseMemoryReadout, dif_pos h] have hj : h.choose = j := hinj h.choose_spec exact ghost_phase_particle_readout_congr (memory.2 h.choose) (memory.2 j) (memory.2 j).1 h.choose_spec rfl (congrArg memory.2 hj) /- Complete support, particle agreement, and agreement of the base off the support identify the entire configuration, not only its pending coordinates. -/ theorem ghost_phase_memory_readout_eq {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (base z : (p : P) → GhostPhaseState (R p)) (memory : FiniteOrderedTuple (Σ p, R p)) (hsupport : univ.image (fun j => (memory.2 j).1) = ghostPhasePendingSupport z) (hparticle : ∀ j, z (memory.2 j).1 = some (some (some (memory.2 j).2))) (hbase : ∀ p, p ∉ ghostPhasePendingSupport z → base p = z p) : ghostPhaseMemoryReadout base memory = z := by classical funext p by_cases h : ∃ j, (memory.2 j).1 = p · rw [ghostPhaseMemoryReadout, dif_pos h] exact ghost_phase_particle_readout_eq z (memory.2 h.choose) (hparticle h.choose) p h.choose_spec · rw [ghostPhaseMemoryReadout, dif_neg h] apply hbase p rw [← hsupport] simpa only [mem_image, mem_univ, true_and] using h /- With distinct labels the literal tuple length equals its pending-support cardinality. This supplies the actual output memory-sector index. -/ theorem ghost_phase_memory_length_eq {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) (memory : FiniteOrderedTuple (Σ p, R p)) (hinj : Function.Injective (Sigma.fst ∘ memory.2)) (hsupport : univ.image (fun j => (memory.2 j).1) = ghostPhasePendingSupport z) : memory.1 = (ghostPhasePendingSupport z).card := by rw [← hsupport, card_image_of_injective _ (show Function.Injective (fun j => (memory.2 j).1) from hinj), card_univ, Fintype.card_fin] section ActualOutput variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] {t N : ℕ} (source : Fin t ↪ P) (stores promotions : Finset (Fin t)) (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hsource : ∀ j, asrc (source j) = true) (hstores : ∀ j ∈ stores, atgt (source j) = false) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (he : ∀ j, j ∈ promotionSelectedIndices e ↔ atgt (f.val j) = true) include hw hsource hstores he /- The literal unrestricted output lies in precisely the memory sector indexed by the selected phase output's pending-support cardinality. -/ theorem distinct_unrestricted_output_length : (unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores promotions e).1 = (ghostPhasePendingSupport (fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (distinctUnrestrictedStorageChoice source stores p) (w p))).card := by apply ghost_phase_memory_length_eq · exact distinct_unrestricted_output_label_injective source stores promotions atgt asrc delta w hw hsource hstores f old e · exact distinct_unrestricted_output_support source stores promotions atgt asrc delta w hw hsource hstores f old e he end ActualOutput end section open Finset open scoped Classical theorem unrestricted_fixed_target_phase_coefficients {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {N t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (source target : Fin t ↪ P) (hsource : ∀ j, asrc (source j) = true) (hdepart : ∀ j, atgt (source j) = false) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) (hold : ∀ j, w (f.val j) = some (some (some (old j)))) (eligible : Finset (Fin N)) (e : distinctPromotedTargetSlots f.val target ↪ eligible) (hmatch : ∀ s : distinctPromotedTargetSlots f.val target, f.val (e s).val = target s.val) (hc : ∀ p, ghostPhaseMovingEdgeCompatible (atgt p) (asrc p) (delta p) (w p) = true) (β : P → ℝ) (ρ V : ℝ) (B : ℕ) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ eligible) → UnrestrictedFreshLabels P promotions → ℂ) (F : (Fin t → P) → FiniteOrderedTuple (Σ p, R p) → ℂ) : unrestrictedEdgeAction source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) Sigma.fst (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) (fun z => z.2 = 0) (fun p => β p / V) ρ V eligible B (fun stores promotions g fresh => if FixedTargetEdgeEventValid f.val target ⟨promotions, g, fresh⟩ then phase stores promotions g fresh else 0) F = ∑ stores : Finset (Fin t), ((∏ p, (if atgt p && !(asrc p) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt p) (asrc p) (delta p) (β p) ρ ρ (ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (distinctUnrestrictedStorageChoice source stores p) (w p)) (w p) : ℝ) : ℂ) * phase stores (distinctPromotedTargetSlots f.val target) e (distinctCanonicalFresh f.val target) * (if (unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores (distinctPromotedTargetSlots f.val target) e).1 ≤ B then F target (unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores (distinctPromotedTargetSlots f.val target) e) else 0) := by rw [unrestricted_edge_action_fixed_target source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) Sigma.fst (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) (fun z => z.2 = 0) (fun p => β p / V) ρ V eligible B f.val (fun _ => rfl) target e hmatch phase F] apply sum_congr rfl intro stores _ rw [distinct_unrestricted_phase_event_mass atgt asrc delta w hw source target stores hsource (fun j _ => hdepart j) htarget f old hold eligible e hmatch hc β ρ V] end section open Finset open scoped Classical end section open Finset /- The tuple contains each pending label of its reconstructed phase exactly once, with no additional pending labels contributed by the base. -/ def GhostPhaseReadoutSupported {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (base : (p : P) → GhostPhaseState (R p)) (q : FiniteOrderedTuple (Σ p, R p)) : Prop := Function.Injective (Sigma.fst ∘ q.2) ∧ univ.image (fun j => (q.2 j).1) = ghostPhasePendingSupport (ghostPhaseMemoryReadout base q) /- Read the phase test on complete distinct particle memories, and extend by zero on all other tuples, including repeated numerical labels. -/ noncomputable def symmetricPhaseReadout {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (base : (p : P) → GhostPhaseState (R p)) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) (q : FiniteOrderedTuple (Σ p, R p)) : ℂ := by classical exact if GhostPhaseReadoutSupported base q then F (ghostPhaseMemoryReadout base q) else 0 /- On a complete distinct reconstruction the extension is the original phase test, not merely a bound on that test. -/ theorem symmetric_phase_readout_eq_of_reconstruction {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (base z : (p : P) → GhostPhaseState (R p)) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) (q : FiniteOrderedTuple (Σ p, R p)) (hinj : Function.Injective (Sigma.fst ∘ q.2)) (hsupport : univ.image (fun j => (q.2 j).1) = ghostPhasePendingSupport z) (hread : ghostPhaseMemoryReadout base q = z) : symmetricPhaseReadout base F q = F z := by classical have hs : GhostPhaseReadoutSupported base q := ⟨hinj, by rw [hread]; exact hsupport⟩ rw [symmetricPhaseReadout, if_pos hs, hread] section ActualOutput variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] {t N : ℕ} (source : Fin t ↪ P) (stores promotions : Finset (Fin t)) (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hsource : ∀ j, asrc (source j) = true) (hstores : ∀ j ∈ stores, atgt (source j) = false) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (he : ∀ j, j ∈ promotionSelectedIndices e ↔ atgt (f.val j) = true) include hw hsource hstores he end ActualOutput end section open Finset open scoped Classical end section open Finset Classical open scoped ComplexConjugate end section open Finset Classical /- The literal ordered output after old-index extraction: translated survivors followed by translated stored source labels. -/ def unrestrictedRetrievedOutput {P : Type*} {b : ℕ} (n : P → ℕ) (Δ : ℤ) (s : Fin b → P) (u : FiniteOrderedTuple (UnrestrictedResidueParticle n)) : FiniteOrderedTuple (UnrestrictedResidueParticle n) := unrestrictedJointOutput n Δ u.2 s theorem unrestricted_edge_memory_eq_retrieved {P : Type*} {N a b : ℕ} (n : P → ℕ) (Δ : ℤ) (q : Fin N → UnrestrictedResidueParticle n) (s : Fin b → P) {eligible : Finset (Fin N)} (e : Fin a ↪ ↥eligible) : unrestrictedEdgeMemory q (unrestrictedResidueTransport n Δ) (unrestrictedResidueSeed n ∘ s) e = unrestrictedRetrievedOutput n Δ s ⟨(unrestrictedEdgeSurvivors e).card, retainedOrderedTuple q (unrestrictedEdgeSurvivors e)⟩ := by unfold unrestrictedEdgeMemory retainedBirthTuple unrestrictedRetrievedOutput unrestrictedJointOutput unrestrictedJointInput congr 1 funext j refine Fin.addCases (fun i => ?_) (fun i => ?_) j · simp only [Fin.addCases_left] rfl · simp only [Fin.addCases_right, Function.comp_apply, unrestrictedResidueTransport_seed, Int.cast_neg] /- Selected residues collapse to one old residue per promoted label. This is the exact counting-measure identity after factorial retrieval, and permits arbitrary complex functions of both endpoint memories. -/ theorem unrestricted_extracted_selection_to_joint {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ : ℤ) (ban : P → Prop) (k a b : ℕ) (F : (Fin a → P) → (Fin b → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : (∑ u : Fin k → UnrestrictedResidueParticle n, ((∏ j, unrestrictedResidueWeight μ (u j)) / (k.factorial : ℝ)) • ∑ x : Fin a → UnrestrictedResidueParticle n, if ∀ i, unrestrictedResidueHit (unrestrictedResidueTransport n Δ (x i)) ∧ ban (x i).1 then (∏ i, unrestrictedResidueWeight μ (x i)) • ∑ s : Fin b → P, (∏ i, μ (s i)) • F (fun i => (x i).1) s (retrievalSourceTuple x ⟨k, u⟩) (unrestrictedRetrievedOutput n Δ s ⟨k, u⟩) else 0) = unrestrictedJointIntegral n μ Δ k a b (fun p s X Y => if ∀ i, ban (p i) then F p s X Y else 0) := by unfold unrestrictedJointIntegral apply sum_congr rfl intro u hu rw [unrestricted_residue_tuple_selection_sum n μ Δ ban a] rw [smul_sum] apply sum_congr rfl intro p hp by_cases hban : ∀ i, ban (p i) · simp only [if_pos hban, smul_sum, Complex.real_smul] apply sum_congr rfl intro s hs change _ * (_ * (_ * F p s _ _)) = _ * F p s _ _ rw [← mul_assoc, ← mul_assoc] congr 1 push_cast ring · simp [hban] /- Reindex eligible promotions as all old-index injections with an explicit translated-hit and dilation indicator. This retains multiplicities of equal old particles. -/ theorem unrestricted_residue_retrieval_sum {P : Type*} {N a : ℕ} (n : P → ℕ) (Δ D : ℤ) (q : Fin N → UnrestrictedResidueParticle n) (F : (Fin a → UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : (∑ e : Fin a ↪ ↥(unrestrictedResidueEligible n Δ D q), F (fun i => q (e i).val) ⟨(unrestrictedEdgeSurvivors e).card, retainedOrderedTuple q (unrestrictedEdgeSurvivors e)⟩) = ∑ e : Fin a ↪ Fin N, if ∀ i, unrestrictedResidueHit (unrestrictedResidueTransport n Δ (q (e i))) ∧ ¬ (n (q (e i)).1 : ℤ) ∣ D then F (fun i => q (e i)) ⟨(retrievalSurvivorIndices e).card, retainedOrderedTuple q (retrievalSurvivorIndices e)⟩ else 0 := by have h := promotionChoice_sum_ambient (unrestrictedResidueEligible n Δ D q) (fun e : Fin a ↪ Fin N => F (fun i => q (e i)) ⟨(retrievalSurvivorIndices e).card, retainedOrderedTuple q (retrievalSurvivorIndices e)⟩) simpa only [unrestrictedEdgeSurvivors, retrievalSurvivorIndices, promotionSelectedIndices, unrestrictedResidueEligible_iff_hit, Function.Embedding.trans_apply, Function.Embedding.coeFn_mk] using h /- Factorial-normalized extraction from the literal eligible-index sum. The integrand can inspect both endpoint memories, provided the source dependence is symmetric. -/ theorem unrestricted_residue_retrieval_normalized {P : Type*} [Fintype P] {N a : ℕ} (ha : a ≤ N) (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (F : (Fin a → UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hF : ∀ x u, OrderedTupleSymmetric (fun X => F x X u)) : (∑ q : Fin N → UnrestrictedResidueParticle n, ((∏ j, unrestrictedResidueWeight μ (q j) : ℝ) : ℂ) * ∑ e : Fin a ↪ ↥(unrestrictedResidueEligible n Δ D q), F (fun i => q (e i).val) ⟨N, q⟩ ⟨(unrestrictedEdgeSurvivors e).card, retainedOrderedTuple q (unrestrictedEdgeSurvivors e)⟩) / ((N.factorial : ℝ) : ℂ) = ((1 / ((N - a).factorial : ℝ) : ℝ) : ℂ) * ∑ x : Fin a → UnrestrictedResidueParticle n, ∑ u : Fin (N - a) → UnrestrictedResidueParticle n, (((∏ i, unrestrictedResidueWeight μ (x i)) * ∏ j, unrestrictedResidueWeight μ (u j) : ℝ) : ℂ) * if ∀ i, unrestrictedResidueHit (unrestrictedResidueTransport n Δ (x i)) ∧ ¬ (n (x i).1 : ℤ) ∣ D then F x (retrievalSourceTuple x ⟨N - a, u⟩) ⟨N - a, u⟩ else 0 := by let G : (Fin a → UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ := fun x X u => if ∀ i, unrestrictedResidueHit (unrestrictedResidueTransport n Δ (x i)) ∧ ¬ (n (x i).1 : ℤ) ∣ D then F x X u else 0 have hG : ∀ x u, OrderedTupleSymmetric (fun X => G x X u) := by intro x u m q e dsimp only [G] split_ifs · exact hF x u m q e · rfl have hnormalize := ordered_retrieval_symmetric_normalized_sum_complex ha (unrestrictedResidueWeight μ) G hG change _ = _ at hnormalize rw [← hnormalize] congr 1 rw [sum_comm] apply sum_congr rfl intro q hq have hs := unrestricted_residue_retrieval_sum n Δ D q (fun x u => F x ⟨N, q⟩ u) rw [hs, mul_sum] /- The finite ordered transfer block with `a` old promotions and `b` source labels stored. This is integrated against the full old-memory factorial measure and the stored active-label product measure. -/ noncomputable def unrestrictedOrderedTransferBlock {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (N a b : ℕ) (F : (Fin a → P) → (Fin b → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : ℂ := (∑ q : Fin N → UnrestrictedResidueParticle n, ((∏ j, unrestrictedResidueWeight μ (q j) : ℝ) : ℂ) * ∑ e : Fin a ↪ ↥(unrestrictedResidueEligible n Δ D q), ∑ s : Fin b → P, ((∏ i, μ (s i) : ℝ) : ℂ) * F (fun i => (q (e i).val).1) s ⟨N, q⟩ (unrestrictedEdgeMemory q (unrestrictedResidueTransport n Δ) (unrestrictedResidueSeed n ∘ s) e)) / ((N.factorial : ℝ) : ℂ) /- Concrete factorial-weighted ordered promotion/storage events equal the common-variable integral. The only source hypothesis is permutation symmetry; target symmetry is not needed for this one-way identification. -/ theorem unrestricted_ordered_transfer_eq_joint {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) {N a : ℕ} (ha : a ≤ N) (b : ℕ) (F : (Fin a → P) → (Fin b → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hF : ∀ p s Y, OrderedTupleSymmetric (fun X => F p s X Y)) : unrestrictedOrderedTransferBlock n μ Δ D N a b F = unrestrictedJointIntegral n μ Δ (N - a) a b (fun p s X Y => if ∀ i, ¬ (n (p i) : ℤ) ∣ D then F p s X Y else 0) := by let G : (Fin a → UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ := fun x X u => ∑ s : Fin b → P, ((∏ i, μ (s i) : ℝ) : ℂ) * F (fun i => (x i).1) s X (unrestrictedRetrievedOutput n Δ s u) have hG : ∀ x u, OrderedTupleSymmetric (fun X => G x X u) := by intro x u m q e apply sum_congr rfl intro s hs congr 1 exact hF (fun i => (x i).1) s (unrestrictedRetrievedOutput n Δ s u) m q e have hn := unrestricted_residue_retrieval_normalized ha n μ Δ D G hG unfold unrestrictedOrderedTransferBlock simp_rw [unrestricted_edge_memory_eq_retrieved] dsimp only [G] at hn rw [hn] have hsel := unrestricted_extracted_selection_to_joint n μ Δ (fun p => ¬ (n p : ℤ) ∣ D) (N - a) a b F convert hsel using 1 rw [sum_comm] simp_rw [Complex.real_smul, mul_sum] apply sum_congr rfl intro u hu apply sum_congr rfl intro x hx by_cases he : ∀ i, unrestrictedResidueHit (unrestrictedResidueTransport n Δ (x i)) ∧ ¬ (n (x i).1 : ℤ) ∣ D · simp only [if_pos he, mul_sum] apply sum_congr rfl intro s hs push_cast ring · simp only [if_neg he, mul_zero] all_goals congr 1 funext p s X Y split_ifs <;> rfl /- On functions symmetric in both endpoint memories, the actual ordered transfer block reverses by exchanging promoted/stored counts and negating displacement. Both directions enforce the same dilation ban. -/ theorem unrestricted_ordered_transfer_reverse {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (k a b : ℕ) (F : (Fin a → P) → (Fin b → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hX : ∀ p s Y, OrderedTupleSymmetric (fun X => F p s X Y)) (hY : ∀ p s X, OrderedTupleSymmetric (fun Y => F p s X Y)) : unrestrictedOrderedTransferBlock n μ Δ D (k + a) a b (fun p s X Y => if ∀ i, ¬ (n (s i) : ℤ) ∣ D then F p s X Y else 0) = unrestrictedOrderedTransferBlock n μ (-Δ) D (k + b) b a (fun s p Y X => if ∀ i, ¬ (n (p i) : ℤ) ∣ D then F p s X Y else 0) := by have hforward := unrestricted_ordered_transfer_eq_joint n μ Δ D (Nat.le_add_left a k) b (fun p s X Y => if ∀ i, ¬ (n (s i) : ℤ) ∣ D then F p s X Y else 0) (by intro p s Y m q e split_ifs · exact hX p s Y m q e · rfl) have hback := unrestricted_ordered_transfer_eq_joint n μ (-Δ) D (Nat.le_add_left b k) a (fun s p Y X => if ∀ i, ¬ (n (p i) : ℤ) ∣ D then F p s X Y else 0) (by intro s p X m q e split_ifs · exact hY p s X m q e · rfl) simp only [Nat.add_sub_cancel_right] at hforward hback rw [hforward, hback, unrestricted_joint_integral_reverse] congr 1 funext s p Y X by_cases hp : ∀ i, ¬ (n (p i) : ℤ) ∣ D · by_cases hs : ∀ i, ¬ (n (s i) : ℤ) ∣ D · simp only [if_pos hp, if_pos hs] · simp only [if_pos hp, if_neg hs] · by_cases hs : ∀ i, ¬ (n (s i) : ℤ) ∣ D · simp only [if_neg hp, if_pos hs] · simp only [if_neg hp, if_neg hs] end section open Finset Classical theorem unrestricted_edge_action_bounded_phase_norm_le_row_mass {P Z : Type*} [Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (label : Z → P) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) {ρ V v C H : ℝ} (hρ : 0 ≤ ρ) (hV : 0 ≤ V) (hv : 0 ≤ v) (hC : 0 ≤ C) (hH : 0 ≤ H) (hμ : ∀ p, 0 ≤ μ p) (eligible : Finset (Fin N)) (B : ℕ) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥eligible) → UnrestrictedFreshLabels P promotions → ℂ) (hphase : ∀ stores promotions e fresh, ‖phase stores promotions e fresh‖ ≤ H) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) (hF : ∀ target memory, memory.1 ≤ B → ‖F target memory‖ ≤ C * v ^ memory.1) : ‖unrestrictedEdgeAction source old label seed transport hit μ ρ V eligible B phase F‖ ≤ (H * C) * unrestrictedEdgeRowMass source old seed transport hit μ ρ V v eligible := by unfold unrestrictedEdgeAction unrestrictedEdgeRowMass unrestrictedEdgeChoiceRowMass simp_rw [mul_sum] refine (norm_sum_le _ _).trans (sum_le_sum fun stores _ => ?_) refine (norm_sum_le _ _).trans (sum_le_sum fun promotions _ => ?_) refine (norm_sum_le _ _).trans (sum_le_sum fun e _ => ?_) refine (norm_sum_le _ _).trans (sum_le_sum fun fresh _ => ?_) have hm := unrestrictedEdgeEventMass_nonneg source old seed transport hit μ hρ hV hμ stores promotions e fresh have hf : ‖(if (unrestrictedEdgeOutput source old seed transport stores promotions e).1 ≤ B then F (unrestrictedEdgeTarget old label promotions e fresh) (unrestrictedEdgeOutput source old seed transport stores promotions e) else 0 : ℂ)‖ ≤ C * v ^ (unrestrictedEdgeOutput source old seed transport stores promotions e).1 := by split_ifs with hout · exact hF _ _ hout · simpa only [norm_zero] using mul_nonneg hC (pow_nonneg hv _) rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hm] calc _ ≤ (unrestrictedEdgeEventMass source old seed transport hit μ ρ V stores promotions e fresh * H) * (C * v ^ (unrestrictedEdgeOutput source old seed transport stores promotions e).1) := mul_le_mul (mul_le_mul_of_nonneg_left (hphase stores promotions e fresh) hm) hf (norm_nonneg _) (mul_nonneg hm hH) _ = _ := by ring /- Reversing a block interchanges promotion and storage counts. The retained forward coefficient is implemented by the explicit ratio V^promotions/V^stores. -/ theorem unrestricted_reverse_residue_edge_action_norm_le {P : Type*} [Fintype P] {t N : ℕ} (n : P → ℕ) (Δ D : ℤ) (source : Fin t → P) (old : Fin N → UnrestrictedResidueParticle n) (μ : P → ℝ) {ρ V v vmin vmax C : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : vmin ≤ V) (hVhi : V ≤ vmax) (hC : 0 ≤ C) (hμ : ∀ p, 0 ≤ μ p) (hmass : ∑ p, μ p ≤ 2) (B T : ℕ) (ht : t ≤ T) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥(unrestrictedResidueEligible n Δ D old)) → UnrestrictedFreshLabels P promotions → ℂ) (hphase : ∀ stores promotions e fresh, ‖phase stores promotions e fresh‖ ≤ 1) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hF : ∀ target memory, memory.1 ≤ B → ‖F target memory‖ ≤ C * v ^ memory.1) : ‖unrestrictedResidueEdgeAction n Δ D source old μ ρ V B (fun stores promotions e fresh => ((V ^ promotions.card / V ^ stores.card : ℝ) : ℂ) * phase stores promotions e fresh) F‖ ≤ C * v ^ N * unrestrictedEdgeRowBound ρ v vmin T * unrestrictedEdgeReversalBound vmin vmax T := by let H := unrestrictedEdgeReversalBound vmin vmax T have hH : 0 ≤ H := by unfold H unrestrictedEdgeReversalBound exact mul_nonneg (pow_nonneg (zero_le_one.trans (le_max_left _ _)) _) (pow_nonneg (zero_le_one.trans (le_max_left _ _)) _) have hV : 0 ≤ V := (hvmin.trans_le hVlo).le have hv0 : 0 ≤ v := (zero_lt_one.trans hv).le have hp : ∀ (stores promotions : Finset (Fin t)) (e : promotions ↪ ↥(unrestrictedResidueEligible n Δ D old)) (fresh : UnrestrictedFreshLabels P promotions), ‖(if unrestrictedResidueStorageAllowed n D source stores then ((V ^ promotions.card / V ^ stores.card : ℝ) : ℂ) * phase stores promotions e fresh else 0)‖ ≤ H := by intro stores promotions e fresh split_ifs · rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (div_nonneg (pow_nonneg hV _) (pow_nonneg hV _))] calc _ ≤ (V ^ promotions.card / V ^ stores.card) * 1 := mul_le_mul_of_nonneg_left (hphase stores promotions e fresh) (div_nonneg (pow_nonneg hV _) (pow_nonneg hV _)) _ ≤ H := by rw [mul_one] apply unrestricted_edge_reversal_ratio_le hvmin hVlo hVhi T · exact ((by simpa using card_le_card (subset_univ stores)) : stores.card ≤ t).trans ht · exact ((by simpa using card_le_card (subset_univ promotions)) : promotions.card ≤ t).trans ht · simpa only [norm_zero] using hH calc _ ≤ (H * C) * unrestrictedEdgeRowMass source old (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ ρ V v (unrestrictedResidueEligible n Δ D old) := unrestricted_edge_action_bounded_phase_norm_le_row_mass source old Sigma.fst (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ hρ0.le hV hv0 hC hH hμ (unrestrictedResidueEligible n Δ D old) B _ hp F hF _ ≤ (H * C) * (v ^ N * unrestrictedEdgeRowBound ρ v vmin T) := mul_le_mul_of_nonneg_left (unrestricted_edge_row_mass_le source old (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ hρ0 hρ1 hv hvmin hVlo hμ hmass (unrestrictedResidueEligible n Δ D old) (unrestrictedResidueEligible_translated_hit n Δ D old) T ht) (mul_nonneg hH hC) _ = _ := by dsimp [H]; ring end section open Finset Classical /- Eligibility for the old tuple `old ∘ τ` is the inverse image under `τ`. -/ def unrestrictedPermutedEligible {N : ℕ} (τ : Equiv.Perm (Fin N)) (eligible : Finset (Fin N)) : Finset (Fin N) := eligible.map τ.symm.toEmbedding theorem mem_unrestrictedPermutedEligible {N : ℕ} (τ : Equiv.Perm (Fin N)) (eligible : Finset (Fin N)) (j : Fin N) : j ∈ unrestrictedPermutedEligible τ eligible ↔ τ j ∈ eligible := by simp [unrestrictedPermutedEligible] def unrestrictedEligiblePermEquiv {N : ℕ} (τ : Equiv.Perm (Fin N)) (eligible : Finset (Fin N)) : eligible ≃ unrestrictedPermutedEligible τ eligible where toFun j := ⟨τ.symm j, (mem_unrestrictedPermutedEligible τ eligible _).mpr (by simp)⟩ invFun j := ⟨τ j, (mem_unrestrictedPermutedEligible τ eligible _).mp j.property⟩ left_inv j := by ext; simp right_inv j := by ext; simp def unrestrictedPromotionPermEquiv {A : Type*} {N : ℕ} (τ : Equiv.Perm (Fin N)) (eligible : Finset (Fin N)) : (A ↪ ↥eligible) ≃ (A ↪ ↥(unrestrictedPermutedEligible τ eligible)) where toFun e := e.trans (unrestrictedEligiblePermEquiv τ eligible).toEmbedding invFun e := e.trans (unrestrictedEligiblePermEquiv τ eligible).symm.toEmbedding left_inv e := by ext; simp right_inv e := by ext; simp theorem unrestrictedPromotionPermEquiv_val {A : Type*} {N : ℕ} (τ : Equiv.Perm (Fin N)) (eligible : Finset (Fin N)) (e : A ↪ ↥eligible) (a : A) : (unrestrictedPromotionPermEquiv τ eligible e a).val = τ.symm (e a).val := rfl theorem unrestrictedPromotionPermEquiv_selected {A : Type*} [Fintype A] {N : ℕ} (τ : Equiv.Perm (Fin N)) (eligible : Finset (Fin N)) (e : A ↪ ↥eligible) : promotionSelectedIndices (unrestrictedPromotionPermEquiv τ eligible e) = (promotionSelectedIndices e).map τ.symm.toEmbedding := by simp only [promotionSelectedIndices, Finset.map_map] rfl theorem unrestrictedPromotionPermEquiv_survivors {A : Type*} [Fintype A] {N : ℕ} (τ : Equiv.Perm (Fin N)) (eligible : Finset (Fin N)) (e : A ↪ ↥eligible) : unrestrictedEdgeSurvivors (unrestrictedPromotionPermEquiv τ eligible e) = (unrestrictedEdgeSurvivors e).map τ.symm.toEmbedding := by rw [unrestrictedEdgeSurvivors, unrestrictedPromotionPermEquiv_selected] simp [unrestrictedEdgeSurvivors, Finset.map_sdiff] theorem unrestricted_edge_target_perm {P Z : Type*} {t N : ℕ} (old : Fin N → Z) (label : Z → P) (τ : Equiv.Perm (Fin N)) (promotions : Finset (Fin t)) (eligible : Finset (Fin N)) (e : promotions ↪ ↥eligible) (fresh : UnrestrictedFreshLabels P promotions) : unrestrictedEdgeTarget (old ∘ τ) label promotions (unrestrictedPromotionPermEquiv τ eligible e) fresh = unrestrictedEdgeTarget old label promotions e fresh := by unfold unrestrictedEdgeTarget congr 1 funext i simp [Function.comp_apply, unrestrictedPromotionPermEquiv_val] theorem unrestricted_edge_memory_perm_occupancy {A Z : Type*} [Fintype A] [DecidableEq Z] {N b : ℕ} (old : Fin N → Z) (transport : Z → Z) (stored : Fin b → Z) (τ : Equiv.Perm (Fin N)) (eligible : Finset (Fin N)) (e : A ↪ ↥eligible) : orderedTupleOccupancy (unrestrictedEdgeMemory (old ∘ τ) transport stored (unrestrictedPromotionPermEquiv τ eligible e)) = orderedTupleOccupancy (unrestrictedEdgeMemory old transport stored e) := by simp only [unrestrictedEdgeMemory, retained_birth_tuple_occupancy] rw [unrestrictedPromotionPermEquiv_survivors] congr 1 simp [retainedTupleOccupancy, Finset.sum_map, Function.comp_apply] theorem unrestricted_edge_memory_perm_symmetric {A Z K : Type*} [Fintype A] [Fintype Z] [DecidableEq Z] {N b : ℕ} (old : Fin N → Z) (transport : Z → Z) (stored : Fin b → Z) (τ : Equiv.Perm (Fin N)) (eligible : Finset (Fin N)) (e : A ↪ ↥eligible) (F : FiniteOrderedTuple Z → K) (hF : OrderedTupleSymmetric F) : F (unrestrictedEdgeMemory (old ∘ τ) transport stored (unrestrictedPromotionPermEquiv τ eligible e)) = F (unrestrictedEdgeMemory old transport stored e) := symmetric_tuple_equal_on_occupancy F hF _ _ (unrestricted_edge_memory_perm_occupancy old transport stored τ eligible e) theorem unrestricted_edge_event_mass_perm {P Z : Type*} [Fintype Z] [DecidableEq Z] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V : ℝ) (τ : Equiv.Perm (Fin N)) (stores promotions : Finset (Fin t)) (eligible : Finset (Fin N)) (e : promotions ↪ ↥eligible) (fresh : UnrestrictedFreshLabels P promotions) : unrestrictedEdgeEventMass source (old ∘ τ) seed transport hit μ ρ V stores promotions (unrestrictedPromotionPermEquiv τ eligible e) fresh = unrestrictedEdgeEventMass source old seed transport hit μ ρ V stores promotions e fresh := by have hc : orderedPredicateCount (unrestrictedEdgeMemory (old ∘ τ) transport (unrestrictedStoredTuple source seed stores) (unrestrictedPromotionPermEquiv τ eligible e)) hit = orderedPredicateCount (unrestrictedEdgeMemory old transport (unrestrictedStoredTuple source seed stores) e) hit := unrestricted_edge_memory_perm_symmetric old transport (unrestrictedStoredTuple source seed stores) τ eligible e (fun q => orderedPredicateCount q hit) (fun _ q e' => orderedPredicateCount_permutation q hit e') unfold unrestrictedEdgeEventMass unrestrictedEdgeOutput rw [orderedPredicateCount_permutation, hc] /- The whole finite edge action respects old-index permutation whenever the phase respects the explicit event correspondence and the output test is symmetric. -/ theorem unrestricted_edge_action_perm {P Z : Type*} [Fintype P] [Fintype Z] [DecidableEq Z] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (label : Z → P) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V : ℝ) (τ : Equiv.Perm (Fin N)) (eligible : Finset (Fin N)) (B : ℕ) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥eligible) → UnrestrictedFreshLabels P promotions → ℂ) (phase' : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥(unrestrictedPermutedEligible τ eligible)) → UnrestrictedFreshLabels P promotions → ℂ) (hphase : ∀ stores promotions e fresh, phase' stores promotions (unrestrictedPromotionPermEquiv τ eligible e) fresh = phase stores promotions e fresh) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) (hF : ∀ target, OrderedTupleSymmetric (F target)) : unrestrictedEdgeAction source (old ∘ τ) label seed transport hit μ ρ V (unrestrictedPermutedEligible τ eligible) B phase' F = unrestrictedEdgeAction source old label seed transport hit μ ρ V eligible B phase F := by unfold unrestrictedEdgeAction apply Finset.sum_congr rfl intro stores hs apply Finset.sum_congr rfl intro promotions hp rw [← (unrestrictedPromotionPermEquiv (A := ↥promotions) τ eligible).sum_comp] apply Finset.sum_congr rfl intro e he apply Finset.sum_congr rfl intro fresh hf rw [unrestricted_edge_event_mass_perm, hphase, unrestricted_edge_target_perm] have hlength : (unrestrictedEdgeOutput source (old ∘ τ) seed transport stores promotions (unrestrictedPromotionPermEquiv τ eligible e)).1 = (unrestrictedEdgeOutput source old seed transport stores promotions e).1 := by simp only [unrestrictedEdgeOutput, unrestrictedEdgeMemory_length] rw [hlength] congr 2 exact unrestricted_edge_memory_perm_symmetric old transport (unrestrictedStoredTuple source seed stores) τ eligible e _ (hF _) theorem unrestricted_residue_eligible_perm {P : Type*} {N : ℕ} (n : P → ℕ) (Δ D : ℤ) (old : Fin N → UnrestrictedResidueParticle n) (τ : Equiv.Perm (Fin N)) : unrestrictedResidueEligible n Δ D (old ∘ τ) = unrestrictedPermutedEligible τ (unrestrictedResidueEligible n Δ D old) := by ext j rw [mem_unrestrictedResidueEligible, mem_unrestrictedPermutedEligible, mem_unrestrictedResidueEligible] rfl /- The actual residue edge with phase one sends symmetric memory tests to symmetric source-memory tests. Storage bans and the total-memory cutoff remain. -/ theorem unrestricted_residue_edge_one_symmetric {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] {t : ℕ} (Δ D : ℤ) (source : Fin t → P) (μ : P → ℝ) (ρ V : ℝ) (B : ℕ) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hF : ∀ target, OrderedTupleSymmetric (F target)) : OrderedTupleSymmetric (fun old : FiniteOrderedTuple (UnrestrictedResidueParticle n) => unrestrictedResidueEdgeAction n Δ D source old.2 μ ρ V B (fun _ _ _ _ => 1) F) := by intro N old τ dsimp only unfold unrestrictedResidueEdgeAction rw [unrestricted_residue_eligible_perm] apply unrestricted_edge_action_perm · intro stores promotions e fresh rfl · exact hF end section open Finset section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] (choices : I → Finset ℕ) (i : I) include I sharedInstance1 sharedInstance2 choices i theorem ordered_slot_product_split (x : ∀ j, choices j) : orderedSlotProduct choices x = (x i).val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) (fun j => x j.val) := Fintype.prod_eq_mul_prod_subtype_ne (fun j => (x j).val) i theorem ordered_slot_sum_test_split (F : ℕ → ℝ) : (∑ x : ∀ j, choices j, F (orderedSlotProduct choices x)) = ∑ p : choices i, ∑ y : ∀ j : {j : I // j ≠ i}, choices j.val, F (p.val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y) := by classical let f : choices i × (∀ j : {j : I // j ≠ i}, choices j.val) → ℝ := fun z => F (z.1.val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) z.2) calc _ = ∑ z, f z := by apply Fintype.sum_equiv (Equiv.piSplitAt i (fun j => choices j)) intro x simp only [f, Equiv.piSplitAt_apply] rw [ordered_slot_product_split choices i x] _ = _ := Fintype.sum_prod_type f theorem ordered_slot_weight_split (normalization : ℝ) (n : ℕ) : orderedSlotWeight choices normalization n = ∑ p : choices i, ∑ y : ∀ j : {j : I // j ≠ i}, choices j.val, if p.val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y = n then 1 / normalization else 0 := by classical unfold orderedSlotWeight have h := ordered_slot_sum_test_split choices i (fun m => if m = n then 1 / normalization else 0) convert h using 1 apply Finset.sum_congr · ext x simp · intro x _ rfl theorem ordered_slot_harmonic_split (normalization : ℝ) : (∑' n : ℕ, orderedSlotWeight choices normalization n / (n : ℝ)) = (∑ p ∈ choices i, 1 / (p : ℝ)) * (∑' n : ℕ, orderedSlotWeight (fun j : {j : I // j ≠ i} => choices j.val) normalization n / (n : ℝ)) := by rw [ordered_slot_harmonic_sum, ordered_slot_harmonic_sum, Fintype.prod_eq_mul_prod_subtype_ne (fun j => ∑ p ∈ choices j, 1 / (p : ℝ)) i] ring end end section open Finset noncomputable def restrictedSlotChoices {I : Type*} [DecidableEq I] (choices restricted : I → Finset ℕ) (E : Finset I) (i : I) : Finset ℕ := if i ∈ E then restricted i else choices i theorem restricted_slot_harmonic_lower {I : Type*} [Fintype I] [DecidableEq I] (choices restricted : I → Finset ℕ) (E : Finset I) {eta normalization : ℝ} (heta : 0 ≤ eta) (hnorm : 0 ≤ normalization) (hmass : ∀ i ∈ E, eta * (∑ p ∈ choices i, 1 / (p : ℝ)) ≤ ∑ p ∈ restricted i, 1 / (p : ℝ)) : eta^E.card * (∑' n : ℕ, orderedSlotWeight choices normalization n / (n : ℝ)) ≤ ∑' n : ℕ, orderedSlotWeight (restrictedSlotChoices choices restricted E) normalization n / (n : ℝ) := by classical rw [ordered_slot_harmonic_sum, ordered_slot_harmonic_sum] have hprod : eta^E.card * (∏ i, ∑ p ∈ choices i, 1 / (p : ℝ)) ≤ ∏ i, ∑ p ∈ restrictedSlotChoices choices restricted E i, 1 / (p : ℝ) := by have hid : eta^E.card * (∏ i, ∑ p ∈ choices i, 1 / (p : ℝ)) = ∏ i, (if i ∈ E then eta else 1) * (∑ p ∈ choices i, 1 / (p : ℝ)) := by rw [prod_mul_distrib, prod_ite_mem] simp rw [hid] apply prod_le_prod₀ · intro i _ exact mul_nonneg (by split_ifs <;> positivity) (sum_nonneg (fun _ _ => by positivity)) · intro i _ by_cases hi : i ∈ E · simpa only [restrictedSlotChoices, if_pos hi] using hmass i hi · simp only [restrictedSlotChoices, if_neg hi, one_mul, le_refl] have h := div_le_div_of_nonneg_right hprod hnorm simpa only [mul_div_assoc] using h end section open Finset Filter open scoped Topology noncomputable def narrowQBand (s eps : ℝ) (j : ℕ) : Finset ℕ := dyadicPrimeBand s ((11/10 : ℝ) - eps) ((11/10 : ℝ) + eps) j theorem narrowQBand_subset_candidateQBand {s eps : ℝ} (hs : 0 ≤ s) (heps : eps ≤ 1/10) (j : ℕ) : narrowQBand s eps j ⊆ candidateQBand s j := by exact dyadicPrimeBand_subset_of_bounds j hs (by linarith) (by linarith) theorem exists_narrowQBand_harmonic_lower {c eps : ℝ} (hc : 0 < c) (heps0 : 0 < eps) (heps1 : eps ≤ 1/10) : ∃ v : ℝ, 0 < v ∧ ∀ᶠ L : ℝ in atTop, ∀ j ∈ candidateQIndices c L, v ≤ ∑ p ∈ narrowQBand (c * L) eps j, 1 / (p : ℝ) := by have ha : 0 < (11/10 : ℝ) - eps := by linarith have hab : (11/10 : ℝ) - eps < (11/10 : ℝ) + eps := by linarith obtain ⟨v, V, t0, hv, _, _, ht0⟩ := exists_primeBandHarmonic_threshold ((one_lt_div ha).mpr hab) refine ⟨v, hv, ?_⟩ filter_upwards [eventually_candidateQIndices_geometry hc, eventually_gt_atTop (0 : ℝ), Real.tendsto_log_atTop.eventually (eventually_ge_atTop (t0 / 20))] with L hg hL ht intro j hj have hlo := (hg.2 j hj).1 have hscale : t0 ≤ ((11/10 : ℝ) - eps) * (c * L) / 2^j := by have hbase : 0 ≤ c * L / 2^j := by positivity have hh : 1 ≤ (11/10 : ℝ) - eps := by linarith have hmul := le_mul_of_one_le_left hbase hh rw [← mul_div_assoc] at hmul linarith have h := (ht0 (((11/10 : ℝ) - eps) * (c * L) / 2^j) hscale).1 rw [← dyadicPrimeBand_harmonic_eq_log_ratio (c * L) ((11/10 : ℝ) - eps) ((11/10 : ℝ) + eps) j ha.ne'] at h exact h theorem exists_narrowQBand_harmonic_ratio {c eps : ℝ} (hc : 0 < c) (heps0 : 0 < eps) (heps1 : eps ≤ 1/10) : ∃ eta : ℝ, 0 < eta ∧ eta ≤ 1 ∧ ∀ᶠ L : ℝ in atTop, ∀ j ∈ candidateQIndices c L, eta * (∑ p ∈ candidateQBand (c * L) j, 1 / (p : ℝ)) ≤ ∑ p ∈ narrowQBand (c * L) eps j, 1 / (p : ℝ) := by obtain ⟨v, hv, hnarrow⟩ := exists_narrowQBand_harmonic_lower hc heps0 heps1 obtain ⟨vl, V, _, hV, hwide⟩ := exists_candidateQBands_bounds hc let eta : ℝ := min 1 (v / V) have heta : 0 < eta := lt_min zero_lt_one (div_pos hv hV) refine ⟨eta, heta, min_le_left _ _, ?_⟩ filter_upwards [hnarrow, hwide] with L hn hw intro j hj calc eta * (∑ p ∈ candidateQBand (c * L) j, 1 / (p : ℝ)) ≤ eta * V := mul_le_mul_of_nonneg_left ((hw.2.2 j hj).2.2.2) heta.le _ ≤ v := (le_div_iff₀ hV).mp (min_le_right _ _) _ ≤ _ := hn j hj end section open Finset Filter open scoped Topology noncomputable def candidatePrefixSlots (c L : ℝ) (r J : ℕ) : Finset ((candidateQIndices c L) × Fin r) := by classical exact univ.filter (fun slot => slot.1.val ≤ J ∧ ¬(slot.1.val = 0 ∧ slot.2.val = 0)) noncomputable def candidatePrefixChoices (c L eps : ℝ) (r jStar J : ℕ) : (candidateQIndices c L) × Fin r → Finset ℕ := restrictedSlotChoices (candidateQSlotChoices c L r jStar) (fun slot => narrowQBand (c * L) eps slot.1.val) (candidatePrefixSlots c L r J) noncomputable def candidatePrefixHarmonicMass (c L eps : ℝ) (r jStar J : ℕ) : ℝ := ∑' n : ℕ, orderedSlotWeight (candidatePrefixChoices c L eps r jStar J) ((r.factorial : ℝ)^(candidateQIndices c L).card) n / (n : ℝ) theorem candidatePrefixSlots_card_le (c L : ℝ) (r J : ℕ) : (candidatePrefixSlots c L r J).card ≤ (J + 1) * r := by classical have h := card_le_card_of_injOn (s := candidatePrefixSlots c L r J) (t := Icc 0 J ×ˢ (univ : Finset (Fin r))) (fun slot => (slot.1.val, slot.2)) (by intro slot hslot have hJ := (mem_filter.mp hslot).2.1 exact mem_product.mpr ⟨mem_Icc.mpr ⟨Nat.zero_le _, hJ⟩, mem_univ _⟩) (by intro x _ y _ hxy exact Prod.ext (Subtype.ext (congrArg (fun z : ℕ × Fin r => z.1) hxy)) (congrArg (fun z : ℕ × Fin r => z.2) hxy)) simpa only [card_product, Nat.card_Icc, Nat.sub_zero, card_univ, Fintype.card_fin] using h theorem candidatePrefixChoices_subset {c L eps : ℝ} (hcL : 0 ≤ c * L) (heps : eps ≤ 1/10) {r jStar J : ℕ} (hJ : J < jStar) (slot : (candidateQIndices c L) × Fin r) : candidatePrefixChoices c L eps r jStar J slot ⊆ candidateQSlotChoices c L r jStar slot := by classical unfold candidatePrefixChoices restrictedSlotChoices split_ifs with hslot · have hidx : slot.1.val ≤ J := (mem_filter.mp hslot).2.1 have hneq : ¬(slot.1.val = jStar ∧ slot.2.val = 0) := by omega rw [candidateQSlotChoices, if_neg hneq] exact narrowQBand_subset_candidateQBand hcL heps slot.1.val · exact subset_rfl theorem exists_candidate_prefix_harmonic_fraction {c eps : ℝ} (hc : 0 < c) (heps0 : 0 < eps) (heps1 : eps ≤ 1/10) (r J : ℕ) : ∃ rho : ℝ, 0 < rho ∧ ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → rho * candidateQHarmonicMass c L r jStar ≤ candidatePrefixHarmonicMass c L eps r jStar J := by obtain ⟨eta, heta, heta1, hratio⟩ := exists_narrowQBand_harmonic_ratio hc heps0 heps1 refine ⟨eta^((J + 1) * r), pow_pos heta _, ?_⟩ filter_upwards [hratio] with L hL intro jStar hJ have hmass : ∀ slot ∈ candidatePrefixSlots c L r J, eta * (∑ p ∈ candidateQSlotChoices c L r jStar slot, 1 / (p : ℝ)) ≤ ∑ p ∈ narrowQBand (c * L) eps slot.1.val, 1 / (p : ℝ) := by intro slot hslot have hidx : slot.1.val ≤ J := (mem_filter.mp hslot).2.1 have hneq : ¬(slot.1.val = jStar ∧ slot.2.val = 0) := by omega rw [candidateQSlotChoices, if_neg hneq] exact hL slot.1.val slot.1.property have h := restricted_slot_harmonic_lower (candidateQSlotChoices c L r jStar) (fun slot => narrowQBand (c * L) eps slot.1.val) (candidatePrefixSlots c L r J) heta.le (by positivity : 0 ≤ (r.factorial : ℝ)^(candidateQIndices c L).card) hmass have hnonneg : 0 ≤ candidateQHarmonicMass c L r jStar := by exact tsum_nonneg (fun n => div_nonneg (candidate_Q_weight_nonneg c L r jStar n) (Nat.cast_nonneg n)) exact (mul_le_mul_of_nonneg_right (pow_le_pow_of_le_one heta.le heta1 (candidatePrefixSlots_card_le c L r J)) hnonneg).trans h end section open scoped BigOperators Classical end section open scoped BigOperators Classical theorem physical_small_bilinear_factorization_with_prefix {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (q ζ : ℝ) (k : ℤ) (r : PhysicalResidues P) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (f : PhysicalMarkLists P J ell → ℂ) (g : PhysicalSharedLists P J → PhysicalResidues P → PhysicalMarkLists P J ell → ℂ) : let tr := fun d : PhysicalSharedLists P J => physicalTranslateResidues r (k * (physicalSharedProduct d : ℕ)) (∑ L, ∑ R, (physicalStateMass V J ell : ℂ) * (starRingEnd ℂ) (f L) * physicalBarePatternScalar V (fun _ => (∅ : Finset (Fin J))) ζ (fun L _ _ => κ (physicalSharedPrefix L)) aux L R * ((physicalResidueVertexWeight L (Real.sqrt q) r * physicalResidueVertexWeight R (Real.sqrt q) (tr (physicalSharedPrefix L)) : ℝ) : ℂ) * g (physicalSharedPrefix L) (tr (physicalSharedPrefix L)) R) = ∑ d, (starRingEnd ℂ) (physicalSmallCondition V q r d f) * (κ d * physicalPhase ζ (physicalSharedProduct d)) * physicalSmallCondition V q (tr d) d (g d (tr d)) := by classical intro tr let s : ℂ := physicalSmallConditioningScale V J ell let N : ℂ := (physicalStateMass V J ell * physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell : ℝ) let a : PhysicalMarkLists P J ell → ℂ := fun L => (physicalResidueVertexWeight L (Real.sqrt q) r : ℂ) * (starRingEnd ℂ) (f L) let b : PhysicalSharedLists P J → PhysicalMarkLists P J ell → ℂ := fun d R => (physicalResidueVertexWeight R (Real.sqrt q) (tr d) : ℂ) * g d (tr d) R let c : PhysicalSharedLists P J → ℂ := fun d => κ d * physicalPhase ζ (physicalSharedProduct d) have hs : (starRingEnd ℂ) s * s = N := by dsimp [s, N] rw [Complex.conj_ofReal, ← Complex.ofReal_mul, ← pow_two, physical_small_conditioning_scale_sq V hV] have hf (d : PhysicalSharedLists P J) : (starRingEnd ℂ) (physicalSmallCondition V q r d f) = (starRingEnd ℂ) s * ∑ L ∈ Finset.univ.filter (fun L => physicalSharedPrefix L = d), a L := by rw [physical_small_condition_eq_vertex_sum, map_mul] congr 1 rw [map_sum, Finset.sum_filter] apply Finset.sum_congr rfl intro L _ by_cases h : physicalSharedPrefix L = d · simp only [if_pos h, map_mul, Complex.conj_ofReal] rfl · simp only [if_neg h, map_zero] have hg (d : PhysicalSharedLists P J) : physicalSmallCondition V q (tr d) d (g d (tr d)) = s * ∑ R ∈ Finset.univ.filter (fun R => physicalSharedPrefix R = d), b d R := by rw [physical_small_condition_eq_vertex_sum, Finset.sum_filter] symm calc _ = N * ∑ d, (∑ L ∈ Finset.univ.filter (fun L => physicalSharedPrefix L = d), a L) * c d * (∑ R ∈ Finset.univ.filter (fun R => physicalSharedPrefix R = d), b d R) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro d _ rw [hf, hg] change (starRingEnd ℂ) s * _ * c d * (s * _) = _ rw [← hs] ring _ = N * ∑ L, ∑ R, if physicalSharedPrefix L = physicalSharedPrefix R then a L * c (physicalSharedPrefix L) * b (physicalSharedPrefix L) R else 0 := by rw [finite_fiber_bilinear_sum] _ = _ := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro L _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro R _ rw [physical_bare_empty_prefix] by_cases h : physicalSharedPrefix L = physicalSharedPrefix R · simp only [if_pos h] dsimp [N, a, b, c] push_cast ring · simp only [if_neg h, mul_zero, zero_mul] end section open Finset Classical noncomputable def unrestrictedPromotionSlotEquiv {I : Type*} [DecidableEq I] {N : ℕ} (T : Finset I) (eligible : Finset (Fin N)) : (T ↪ ↥eligible) ≃ (Fin T.card ↪ ↥eligible) := Equiv.embeddingCongr T.equivFin (Equiv.refl _) theorem unrestrictedPromotionSlotEquiv_apply {I : Type*} [DecidableEq I] {N : ℕ} (T : Finset I) (eligible : Finset (Fin N)) (e : T ↪ ↥eligible) (i : Fin T.card) : unrestrictedPromotionSlotEquiv T eligible e i = e (T.equivFin.symm i) := rfl theorem unrestrictedPromotionSlotEquiv_selected {I : Type*} [DecidableEq I] {N : ℕ} (T : Finset I) (eligible : Finset (Fin N)) (e : T ↪ ↥eligible) : promotionSelectedIndices (unrestrictedPromotionSlotEquiv T eligible e) = promotionSelectedIndices e := by ext j simp only [promotionSelectedIndices, mem_map, mem_univ, true_and, Function.Embedding.trans_apply, Function.Embedding.coeFn_mk, unrestrictedPromotionSlotEquiv_apply] constructor · rintro ⟨i, hi⟩ exact ⟨T.equivFin.symm i, hi⟩ · rintro ⟨i, hi⟩ exact ⟨T.equivFin i, by simpa using hi⟩ theorem unrestrictedPromotionSlotEquiv_survivors {I : Type*} [DecidableEq I] {N : ℕ} (T : Finset I) (eligible : Finset (Fin N)) (e : T ↪ ↥eligible) : unrestrictedEdgeSurvivors (unrestrictedPromotionSlotEquiv T eligible e) = unrestrictedEdgeSurvivors e := by simp only [unrestrictedEdgeSurvivors, unrestrictedPromotionSlotEquiv_selected] theorem unrestricted_edge_memory_slot_reindex {I Z : Type*} [DecidableEq I] {N b : ℕ} (T : Finset I) (eligible : Finset (Fin N)) (e : T ↪ ↥eligible) (old : Fin N → Z) (transport : Z → Z) (stored : Fin b → Z) : unrestrictedEdgeMemory old transport stored (unrestrictedPromotionSlotEquiv T eligible e) = unrestrictedEdgeMemory old transport stored e := by simp only [unrestrictedEdgeMemory, unrestrictedPromotionSlotEquiv_survivors] theorem unrestricted_promotion_slot_sum {I Z E : Type*} [DecidableEq I] [AddCommMonoid E] {N b : ℕ} (T : Finset I) (eligible : Finset (Fin N)) (old : Fin N → Z) (transport : Z → Z) (stored : Fin b → Z) (F : (T → Z) → FiniteOrderedTuple Z → E) : (∑ e : T ↪ ↥eligible, F (fun i => old (e i).val) (unrestrictedEdgeMemory old transport stored e)) = ∑ e : Fin T.card ↪ ↥eligible, F (fun i => old (e (T.equivFin i)).val) (unrestrictedEdgeMemory old transport stored e) := by rw [← (unrestrictedPromotionSlotEquiv T eligible).sum_comp] apply sum_congr rfl intro e he simp only [unrestrictedPromotionSlotEquiv_apply, Equiv.symm_apply_apply, unrestricted_edge_memory_slot_reindex] end section open Finset Classical end section open Finset Classical theorem unrestricted_size_reindex {E : Type*} [AddCommMonoid E] (F : ℕ → E) (a b Bsrc Btgt : ℕ) : (∑ N ∈ range (Bsrc + 1), if a ≤ N ∧ N - a + b ≤ Btgt then F (N - a) else 0) = ∑ M ∈ range (Btgt + 1), if b ≤ M ∧ M - b + a ≤ Bsrc then F (M - b) else 0 := by rw [← sum_filter, ← sum_filter] apply sum_bij (fun N _ => N - a + b) · intro N hN simp only [mem_filter, mem_range] at hN ⊢ omega · intro N hN N' hN' hNN' simp only [mem_filter, mem_range] at hN hN' omega · intro M hM simp only [mem_filter, mem_range] at hM refine ⟨M - b + a, ?_, ?_⟩ · simp only [mem_filter, mem_range] omega · omega · intro N hN simp /- Pointwise reversal of blocks implies reversal of their finite size sums. Blocks too short to contain the selected slots vanish; normalization factors may already be included in the two block functions. -/ theorem unrestricted_paired_size_reindex {E : Type*} [AddCommMonoid E] (A B : ℕ → E) (a b Bsrc Btgt : ℕ) (hA : ∀ N, N < a → A N = 0) (hB : ∀ M, M < b → B M = 0) (hAB : ∀ k, A (k + a) = B (k + b)) : (∑ N ∈ range (Bsrc + 1), if N - a + b ≤ Btgt then A N else 0) = ∑ M ∈ range (Btgt + 1), if M - b + a ≤ Bsrc then B M else 0 := by calc _ = ∑ N ∈ range (Bsrc + 1), if a ≤ N ∧ N - a + b ≤ Btgt then A (N - a + a) else 0 := by apply sum_congr rfl intro N hN by_cases ha : a ≤ N · simp only [ha, true_and, Nat.sub_add_cancel ha] · simp [ha, hA N (Nat.lt_of_not_ge ha)] _ = ∑ M ∈ range (Btgt + 1), if b ≤ M ∧ M - b + a ≤ Bsrc then A (M - b + a) else 0 := unrestricted_size_reindex (fun k => A (k + a)) a b Bsrc Btgt _ = _ := by apply sum_congr rfl intro M hM by_cases hb : b ≤ M · simp only [hb, true_and, hAB, Nat.sub_add_cancel hb] · simp [hb, hB M (Nat.lt_of_not_ge hb)] end section open Finset abbrev BoundedOrderedTuple (Z : Type*) (B : ℕ) := Σ N : Fin (B + 1), Fin N.val → Z def boundedOrderedTupleToFinite {Z : Type*} {B : ℕ} (q : BoundedOrderedTuple Z B) : FiniteOrderedTuple Z := ⟨q.1.val, q.2⟩ theorem boundedOrderedTupleToFinite_length_le {Z : Type*} {B : ℕ} (q : BoundedOrderedTuple Z B) : (boundedOrderedTupleToFinite q).1 ≤ B := by exact Nat.le_of_lt_succ q.1.isLt /- The product particle measure divided by the actual memory factorial. -/ noncomputable def boundedOrderedMemoryWeight {Z : Type*} {B : ℕ} (ν : Z → ℝ) (q : BoundedOrderedTuple Z B) : ℝ := (∏ j, ν (q.2 j)) / (q.1.val.factorial : ℝ) theorem boundedOrderedMemoryWeight_nonneg {Z : Type*} {B : ℕ} (ν : Z → ℝ) (hν : ∀ z, 0 ≤ ν z) (q : BoundedOrderedTuple Z B) : 0 ≤ boundedOrderedMemoryWeight ν q := by exact div_nonneg (prod_nonneg fun j _ => hν (q.2 j)) (Nat.cast_nonneg _) /- Split integration into memory length and ordered particle coordinates. The scalar form applies in particular to complex-valued test functions. -/ theorem bounded_ordered_memory_smul_sum {Z E : Type*} [Fintype Z] [AddCommMonoid E] [Module ℝ E] (ν : Z → ℝ) (B : ℕ) (F : FiniteOrderedTuple Z → E) : (∑ q : BoundedOrderedTuple Z B, boundedOrderedMemoryWeight ν q • F (boundedOrderedTupleToFinite q)) = ∑ N : Fin (B + 1), (1 / (N.val.factorial : ℝ)) • ∑ q : Fin N.val → Z, (∏ j, ν (q j)) • F ⟨N.val, q⟩ := by rw [Fintype.sum_sigma] apply sum_congr rfl intro N _ rw [smul_sum] apply sum_congr rfl intro q _ change ((∏ j, ν (q j)) / (N.val.factorial : ℝ)) • F ⟨N.val, q⟩ = _ rw [smul_smul] congr 1 ring theorem bounded_ordered_memory_smul_sum_range {Z E : Type*} [Fintype Z] [AddCommMonoid E] [Module ℝ E] (ν : Z → ℝ) (B : ℕ) (F : FiniteOrderedTuple Z → E) : (∑ q : BoundedOrderedTuple Z B, boundedOrderedMemoryWeight ν q • F (boundedOrderedTupleToFinite q)) = ∑ N ∈ range (B + 1), (1 / (N.factorial : ℝ)) • ∑ q : Fin N → Z, (∏ j, ν (q j)) • F ⟨N, q⟩ := by rw [bounded_ordered_memory_smul_sum] exact Fin.sum_univ_eq_sum_range (fun N => (1 / (N.factorial : ℝ)) • ∑ q : Fin N → Z, (∏ j, ν (q j)) • F ⟨N, q⟩) (B + 1) abbrev BoundedOrderedState (P Z : Type*) (t B : ℕ) := (Fin t → P) × BoundedOrderedTuple Z B /- Active coordinates have product measure; memory has factorial measure. -/ noncomputable def boundedOrderedStateWeight {P Z : Type*} {t B : ℕ} (μ : P → ℝ) (ν : Z → ℝ) (s : BoundedOrderedState P Z t B) : ℝ := (∏ i, μ (s.1 i)) * boundedOrderedMemoryWeight ν s.2 theorem boundedOrderedStateWeight_nonneg {P Z : Type*} {t B : ℕ} (μ : P → ℝ) (ν : Z → ℝ) (hμ : ∀ p, 0 ≤ μ p) (hν : ∀ z, 0 ≤ ν z) (s : BoundedOrderedState P Z t B) : 0 ≤ boundedOrderedStateWeight μ ν s := mul_nonneg (prod_nonneg fun i _ => hμ (s.1 i)) (boundedOrderedMemoryWeight_nonneg ν hν s.2) /- Integrate an active tuple and a bounded ordered memory in coordinates. -/ theorem bounded_ordered_state_smul_sum {P Z E : Type*} [Fintype P] [Fintype Z] [AddCommMonoid E] [Module ℝ E] (μ : P → ℝ) (ν : Z → ℝ) (t B : ℕ) (F : (Fin t → P) → FiniteOrderedTuple Z → E) : (∑ s : BoundedOrderedState P Z t B, boundedOrderedStateWeight μ ν s • F s.1 (boundedOrderedTupleToFinite s.2)) = ∑ active : Fin t → P, ∑ N : Fin (B + 1), (1 / (N.val.factorial : ℝ)) • ∑ q : Fin N.val → Z, ((∏ i, μ (active i)) * ∏ j, ν (q j)) • F active ⟨N.val, q⟩ := by rw [Fintype.sum_prod_type] apply sum_congr rfl intro active _ rw [Fintype.sum_sigma] apply sum_congr rfl intro N _ rw [smul_sum] apply sum_congr rfl intro q _ change ((∏ i, μ (active i)) * ((∏ j, ν (q j)) / (N.val.factorial : ℝ))) • F active ⟨N.val, q⟩ = _ rw [smul_smul] congr 1 ring theorem bounded_ordered_state_smul_sum_range {P Z E : Type*} [Fintype P] [Fintype Z] [AddCommMonoid E] [Module ℝ E] (μ : P → ℝ) (ν : Z → ℝ) (t B : ℕ) (F : (Fin t → P) → FiniteOrderedTuple Z → E) : (∑ s : BoundedOrderedState P Z t B, boundedOrderedStateWeight μ ν s • F s.1 (boundedOrderedTupleToFinite s.2)) = ∑ active : Fin t → P, ∑ N ∈ range (B + 1), (1 / (N.factorial : ℝ)) • ∑ q : Fin N → Z, ((∏ i, μ (active i)) * ∏ j, ν (q j)) • F active ⟨N, q⟩ := by rw [bounded_ordered_state_smul_sum] apply sum_congr rfl intro active _ exact Fin.sum_univ_eq_sum_range (fun N => (1 / (N.factorial : ℝ)) • ∑ q : Fin N → Z, ((∏ i, μ (active i)) * ∏ j, ν (q j)) • F active ⟨N, q⟩) (B + 1) end section open Finset /- Integrate the pointwise bound and transfer its positive term through the exact weighted pairing. The reverse row estimate cancels the target weight. -/ theorem finite_weighted_energy_of_pairing {I J : Type*} [Fintype I] [Fintype J] (μ : I → ℝ) (ν w : J → ℝ) (v A : I → ℝ) (D : J → ℝ) (u : I → ℂ) (f : J → ℂ) {R C : ℝ} (hμ : ∀ i, 0 ≤ μ i) (hν : ∀ j, 0 ≤ ν j) (hw : ∀ j, 0 < w j) (hR : 0 ≤ R) (hcauchy : ∀ i, ‖u i‖ ^ 2 ≤ R * v i * A i) (hpair : (∑ i, μ i * v i * A i) = ∑ j, ν j * D j * (‖f j‖ ^ 2 / w j)) (hreverse : ∀ j, D j ≤ C * w j) : (∑ i, μ i * ‖u i‖ ^ 2) ≤ R * C * ∑ j, ν j * ‖f j‖ ^ 2 := by calc _ ≤ ∑ i, μ i * (R * v i * A i) := sum_le_sum fun i _ => mul_le_mul_of_nonneg_left (hcauchy i) (hμ i) _ = R * ∑ i, μ i * v i * A i := by rw [mul_sum] apply sum_congr rfl intro i hi ring _ = R * ∑ j, ν j * D j * (‖f j‖ ^ 2 / w j) := by rw [hpair] _ ≤ R * ∑ j, ν j * (C * w j) * (‖f j‖ ^ 2 / w j) := by apply mul_le_mul_of_nonneg_left _ hR apply sum_le_sum intro j hj exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hreverse j) (hν j)) (div_nonneg (sq_nonneg _) (hw j).le) _ = _ := by simp_rw [mul_sum] apply sum_congr rfl intro j hj have hwj : w j ≠ 0 := (hw j).ne' field_simp /- Complex pairing form, matching the literal edge action. Only the real parts of the positive forward and reverse actions enter the energy estimate. -/ theorem finite_weighted_energy_of_complex_pairing {I J : Type*} [Fintype I] [Fintype J] (μ : I → ℝ) (ν w : J → ℝ) (v : I → ℝ) (A : I → ℂ) (D : J → ℂ) (u : I → ℂ) (f : J → ℂ) {R C : ℝ} (hμ : ∀ i, 0 ≤ μ i) (hν : ∀ j, 0 ≤ ν j) (hw : ∀ j, 0 < w j) (hR : 0 ≤ R) (hcauchy : ∀ i, ‖u i‖ ^ 2 ≤ R * v i * (A i).re) (hpair : (∑ i, (μ i : ℂ) * (v i : ℂ) * A i) = ∑ j, (ν j : ℂ) * D j * ((‖f j‖ ^ 2 / w j : ℝ) : ℂ)) (hreverse : ∀ j, (D j).re ≤ C * w j) : (∑ i, μ i * ‖u i‖ ^ 2) ≤ R * C * ∑ j, ν j * ‖f j‖ ^ 2 := by apply finite_weighted_energy_of_pairing μ ν w v (fun i => (A i).re) (fun j => (D j).re) u f hμ hν hw hR hcauchy _ hreverse simpa only [Complex.re_sum, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, mul_zero, zero_mul, add_zero, sub_zero] using congrArg Complex.re hpair end section open Finset open scoped Classical noncomputable def cleanAuxiliaryWeight {A P : Type*} [Fintype A] [DecidableEq A] (μ : P → ℝ) (aux : A → P) : ℝ := ∏ a, μ (aux a) def cleanAuxiliaryCollision {A S I P : Type*} (source : S → P) (target : I → P) (aux : A → P) : Prop := ∃ a, (∃ s, aux a = source s) ∨ (∃ i, aux a = target i) /- The marginal at one auxiliary coordinate is exactly its given probability law. -/ theorem clean_auxiliary_coordinate_mass {A P : Type*} [Fintype A] [DecidableEq A] [Fintype P] (μ : P → ℝ) (hμ : ∑ p, μ p = 1) (a : A) (p : P) : (∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if aux a = p then 1 else 0)) = μ p := by have hprod (aux : A → P) : cleanAuxiliaryWeight μ aux * (if aux a = p then 1 else 0) = ∏ i, μ (aux i) * (if i = a then (if aux i = p then 1 else 0) else 1) := by rw [prod_mul_distrib] congr 1 rw [prod_eq_single a] · simp · intro b hb hba simp only [if_neg hba] · simp simp_rw [hprod] rw [← Fintype.prod_sum (fun i (z : P) => μ z * (if i = a then (if z = p then 1 else 0) else 1))] have hlocal (i : A) : (∑ z : P, μ z * (if i = a then (if z = p then 1 else 0) else 1)) = if i = a then μ p else 1 := by by_cases hi : i = a · simp [hi] · simp [hi, hμ] simp_rw [hlocal] rw [prod_eq_single a] · simp · intro b hb hba simp only [if_neg hba] · simp /- A union bound stated in the same weighted finite-sum convention as the row kernels. -/ theorem clean_weighted_exists_le_sum {Ω J : Type*} [Fintype Ω] [Fintype J] (w : Ω → ℝ) (hw : ∀ x, 0 ≤ w x) (event : J → Ω → Prop) : (∑ x, w x * (if ∃ j, event j x then 1 else 0)) ≤ ∑ j, ∑ x, w x * (if event j x then 1 else 0) := by rw [sum_comm] apply sum_le_sum intro x hx by_cases he : ∃ j, event j x · obtain ⟨j, hj⟩ := he rw [if_pos ⟨j, hj⟩, mul_one] calc w x = w x * (if event j x then 1 else 0) := by rw [if_pos hj, mul_one] _ ≤ ∑ i, w x * (if event i x then 1 else 0) := by have hnn : ∀ i ∈ (univ : Finset J), 0 ≤ w x * (if event i x then 1 else 0) := by intro i hi exact mul_nonneg (hw x) (by split_ifs <;> norm_num) exact single_le_sum hnn (mem_univ j) · rw [if_neg he, mul_zero] exact sum_nonneg (fun i _ => mul_nonneg (hw x) (by split_ifs <;> norm_num)) /- Any fixed finite label list is hit with at most the number of comparisons times one auxiliary atom. Repeated labels need not be removed from the list. -/ theorem clean_auxiliary_hits_mass_le {A S P : Type*} [Fintype A] [DecidableEq A] [Fintype S] [Fintype P] (μ : P → ℝ) (hμ0 : ∀ p, 0 ≤ μ p) (hμ : ∑ p, μ p = 1) (labels : S → P) (a₀ : ℝ) (hatom : ∀ p, μ p ≤ a₀) : (∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if ∃ a s, aux a = labels s then 1 else 0)) ≤ (Fintype.card A : ℝ) * Fintype.card S * a₀ := by have he (aux : A → P) : (∃ a s, aux a = labels s) ↔ ∃ z : A × S, aux z.1 = labels z.2 := by constructor · rintro ⟨a, s, h⟩ exact ⟨⟨a, s⟩, h⟩ · rintro ⟨⟨a, s⟩, h⟩ exact ⟨a, s, h⟩ simp_rw [he] calc _ ≤ ∑ z : A × S, ∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if aux z.1 = labels z.2 then 1 else 0) := clean_weighted_exists_le_sum _ (fun aux => prod_nonneg (fun a _ => hμ0 (aux a))) _ _ = ∑ z : A × S, μ (labels z.2) := by simp_rw [clean_auxiliary_coordinate_mass μ hμ] _ ≤ ∑ _z : A × S, a₀ := sum_le_sum (fun z _ => hatom (labels z.2)) _ = _ := by simp [Fintype.card_prod, mul_assoc] /- Auxiliary collisions with either active endpoint obey the same bound. -/ theorem clean_auxiliary_collision_mass_le {A S I P : Type*} [Fintype A] [DecidableEq A] [Fintype S] [Fintype I] [Fintype P] (μ : P → ℝ) (hμ0 : ∀ p, 0 ≤ μ p) (hμ : ∑ p, μ p = 1) (source : S → P) (target : I → P) (a₀ : ℝ) (hatom : ∀ p, μ p ≤ a₀) : (∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if cleanAuxiliaryCollision source target aux then 1 else 0)) ≤ (Fintype.card A : ℝ) * (Fintype.card S + Fintype.card I) * a₀ := by have he (aux : A → P) : cleanAuxiliaryCollision source target aux ↔ ∃ a s, aux a = Sum.elim source target s := by constructor · rintro ⟨a, ⟨s, hs⟩ | ⟨i, hi⟩⟩ · exact ⟨a, Sum.inl s, hs⟩ · exact ⟨a, Sum.inr i, hi⟩ · rintro ⟨a, s | i, h⟩ · exact ⟨a, Or.inl ⟨s, h⟩⟩ · exact ⟨a, Or.inr ⟨i, h⟩⟩ simp_rw [he] simpa only [Fintype.card_sum, Nat.cast_add] using clean_auxiliary_hits_mass_le μ hμ0 hμ (Sum.elim source target) a₀ hatom /- The actual auxiliary law has the reciprocal-prime atom bound, without tilting. -/ theorem physical_label_law_atom_le {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (g : G) (hV : 0 < V g) {P₀ : ℝ} (hP₀ : 0 < P₀) (p : P g) (hp : P₀ ≤ (p.val : ℝ)) : physicalLabelLaw V g p ≤ 1 / (V g * P₀) := by unfold physicalLabelLaw exact one_div_le_one_div_of_le (mul_pos hV hP₀) (mul_le_mul_of_nonneg_left hp hV.le) end section open Finset theorem sum_dyadic_reciprocal_Icc (J : ℕ) : (∑ j ∈ Icc 0 J, (1 : ℝ) / 2^j) = 2 - 1 / 2^J := by rw [← Nat.range_succ_eq_Icc_zero] simp_rw [← one_div_pow] rw [geom_sum_eq (by norm_num : (1 / (2 : ℝ)) ≠ 1)] rw [pow_succ] rw [one_div_pow] ring theorem sum_dyadic_reciprocal_Icc_le_two (J : ℕ) : (∑ j ∈ Icc 0 J, (1 : ℝ) / 2^j) ≤ 2 := by rw [sum_dyadic_reciprocal_Icc] have h : (0 : ℝ) ≤ 1 / 2^J := by positivity linarith theorem sum_dyadic_reciprocal_Ioc_le (J N : ℕ) : (∑ j ∈ Ioc J N, (1 : ℝ) / 2^j) ≤ 1 / 2^J := by have hset : Ioc J N = Ico (J + 1) (N + 1) := by ext j simp only [mem_Ioc, mem_Ico] omega rw [hset] simp_rw [← one_div_pow] have h := geom_sum_Ico_le_of_lt_one (m := J + 1) (n := N + 1) (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1 / (2 : ℝ)) < 1) have hid : (1 / (2 : ℝ))^(J + 1) / (1 - 1 / 2) = (1 / 2)^J := by rw [pow_succ] ring rwa [hid] at h theorem sum_Icc_zero_split {N J : ℕ} (hJN : J ≤ N) (f : ℕ → ℝ) : (∑ j ∈ Icc 0 N, f j) = (∑ j ∈ Icc 0 J, f j) + ∑ j ∈ Ioc J N, f j := by have hu : Icc 0 N = Icc 0 J ∪ Ioc J N := by ext j simp only [mem_Icc, mem_Ioc, mem_union] omega have hd : Disjoint (Icc 0 J) (Ioc J N) := by apply disjoint_left.mpr intro j hj hk have h1 := (mem_Icc.mp hj).2 have h2 := (mem_Ioc.mp hk).1 omega rw [hu, sum_union hd] theorem dyadic_prefix_sum_error {J : ℕ} {B eps : ℝ} (hB : 0 ≤ B) (heps : 0 ≤ eps) (f : ℕ → ℝ) (hprefix : ∀ j ∈ Icc 0 J, |f j - (11/10 : ℝ) * B / 2^j| ≤ eps * B / 2^j) : |(∑ j ∈ Icc 0 J, f j) - ((11/5 : ℝ) * B - (11/10 : ℝ) * B / 2^J)| ≤ 2 * eps * B := by have hm : (∑ j ∈ Icc 0 J, (11/10 : ℝ) * B / 2^j) = (11/5 : ℝ) * B - (11/10 : ℝ) * B / 2^J := by simp_rw [div_eq_mul_inv] rw [← mul_sum] have hs : (∑ j ∈ Icc 0 J, ((2 : ℝ)^j)⁻¹) = 2 - 1 / 2^J := by simpa only [one_div] using sum_dyadic_reciprocal_Icc J rw [hs] ring rw [← hm, ← sum_sub_distrib] refine (abs_sum_le_sum_abs _ _).trans ((sum_le_sum hprefix).trans ?_) calc (∑ j ∈ Icc 0 J, eps * B / 2^j) = eps * B * (∑ j ∈ Icc 0 J, (1 : ℝ) / 2^j) := by rw [mul_sum] apply sum_congr rfl intros ring _ ≤ eps * B * 2 := mul_le_mul_of_nonneg_left (sum_dyadic_reciprocal_Icc_le_two J) (mul_nonneg heps hB) _ = 2 * eps * B := by ring theorem dyadic_sum_midpoint_error {N J : ℕ} (hJN : J ≤ N) {B eps : ℝ} (hB : 0 ≤ B) (heps : 0 ≤ eps) (f : ℕ → ℝ) (hprefix : ∀ j ∈ Icc 0 J, |f j - (11/10 : ℝ) * B / 2^j| ≤ eps * B / 2^j) (htail : ∀ j ∈ Ioc J N, 0 ≤ f j ∧ f j ≤ (6/5 : ℝ) * B / 2^j) : |(∑ j ∈ Icc 0 N, f j) - (11/5 : ℝ) * B| ≤ 2 * eps * B + (6/5 : ℝ) * B / 2^J := by have hpre := abs_le.mp (dyadic_prefix_sum_error hB heps f hprefix) have htail0 : 0 ≤ ∑ j ∈ Ioc J N, f j := sum_nonneg (fun j hj => (htail j hj).1) have htail1 : (∑ j ∈ Ioc J N, f j) ≤ (6/5 : ℝ) * B / 2^J := by calc _ ≤ ∑ j ∈ Ioc J N, (6/5 : ℝ) * B / 2^j := sum_le_sum (fun j hj => (htail j hj).2) _ = (6/5 : ℝ) * B * (∑ j ∈ Ioc J N, (1 : ℝ) / 2^j) := by rw [mul_sum] apply sum_congr rfl intros ring _ ≤ (6/5 : ℝ) * B * (1 / 2^J) := mul_le_mul_of_nonneg_left (sum_dyadic_reciprocal_Ioc_le J N) (by positivity) _ = _ := by ring rw [sum_Icc_zero_split hJN] apply abs_le.mpr have hcompare : (11/10 : ℝ) * B / 2^J ≤ (6/5 : ℝ) * B / 2^J := by apply div_le_div_of_nonneg_right _ (by positivity) nlinarith have hmid : 0 ≤ (11/10 : ℝ) * B / 2^J := by positivity constructor <;> linarith end section open Finset Filter open scoped Topology theorem mem_candidateQIndices_of_scale {c L : ℝ} {j : ℕ} (hlog : 0 < Real.log L) (hscale : 20 * Real.log L ≤ c * L / 2^j) : j ∈ candidateQIndices c L := by have hd : 0 < 20 * Real.log L := by positivity have hp0 : (0 : ℝ) < 2^j := by positivity have hpow : (2 : ℝ)^j ≤ c * L / (20 * Real.log L) := by apply (le_div_iff₀ hd).mpr have h := (le_div_iff₀ hp0).mp hscale nlinarith only [h] have hz1 : 1 ≤ c * L / (20 * Real.log L) := (one_le_pow₀ (by norm_num : (1 : ℝ) ≤ 2)).trans hpow have hz0 : 0 < c * L / (20 * Real.log L) := zero_lt_one.trans_le hz1 have hf : 0 ≤ Real.log (c * L / (20 * Real.log L)) / Real.log 2 := by exact div_nonneg (Real.log_nonneg hz1) (by positivity) have hlg := Real.log_le_log hp0 hpow rw [Real.log_pow] at hlg apply mem_Icc.mpr refine ⟨Nat.zero_le _, (Nat.le_floor_iff hf).mpr ?_⟩ exact (le_div_iff₀ (by positivity : 0 < Real.log 2)).mpr hlg theorem eventually_fixed_candidateQ_prefix {c : ℝ} (hc : 0 < c) (J : ℕ) : ∀ᶠ L : ℝ in atTop, Icc 0 J ⊆ candidateQIndices c L := by have hlogdiv : Tendsto (fun L : ℝ => Real.log L / L) atTop (𝓝 0) := by simpa using Real.tendsto_pow_log_div_mul_add_atTop 1 0 1 one_ne_zero have hsmall := hlogdiv.eventually_le_const (show (0 : ℝ) < c / (20 * 2^J) by positivity) filter_upwards [hsmall, eventually_gt_atTop (1 : ℝ)] with L hratio hL have hL0 : 0 < L := zero_lt_one.trans hL have hscale : 20 * Real.log L ≤ c * L / 2^J := by apply (le_div_iff₀ (by positivity : (0 : ℝ) < 2^J)).mpr have h := (div_le_div_iff₀ hL0 (show (0 : ℝ) < 20 * 2^J by positivity)).mp hratio nlinarith only [h] have hJ := mem_candidateQIndices_of_scale (Real.log_pos hL) hscale intro j hj exact mem_Icc.mpr ⟨Nat.zero_le _, (mem_Icc.mp hj).2.trans (mem_Icc.mp hJ).2⟩ end section open Finset theorem roughBand_value_bounds {A B W : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) {n : ℕ} (hn : n ∈ roughBand A B W) : A < (n : ℝ) ∧ (n : ℝ) ≤ B := by have h := mem_Ioc.mp (mem_filter.mp hn).1 exact ⟨(Nat.floor_lt hA).mp h.1, (Nat.le_floor_iff hB).mp h.2⟩ theorem candidate_Q_slot_log_bounds (c L : ℝ) (r jStar : ℕ) (slot : (candidateQIndices c L) × Fin r) {n : ℕ} (hn : n ∈ candidateQSlotChoices c L r jStar slot) : c * L / 2^slot.1.val < Real.log n ∧ Real.log n ≤ (6/5 : ℝ) * (c * L) / 2^slot.1.val := by have hn0 : (0 : ℝ) < n := by exact_mod_cast Nat.pos_of_ne_zero (candidate_Q_slot_nonzero c L r jStar slot hn) unfold candidateQSlotChoices at hn split_ifs at hn with hslot · have h := roughBand_value_bounds (Real.exp_pos (c * L / 2^jStar)).le (Real.exp_pos ((6/5 : ℝ) * c * L / 2^jStar)).le hn rw [hslot.1] exact ⟨(Real.lt_log_iff_exp_lt hn0).mpr h.1, (Real.log_le_iff_le_exp hn0).mpr (by simpa only [mul_assoc] using h.2)⟩ · have h := (mem_dyadicPrimeBand_iff (c * L) 1 (6/5) slot.1.val n).mp hn exact ⟨(Real.lt_log_iff_exp_lt hn0).mpr (by simpa only [one_mul] using h.2.1), (Real.log_le_iff_le_exp hn0).mpr h.2.2⟩ theorem narrowQBand_log_deviation (s eps : ℝ) (j : ℕ) {n : ℕ} (hn : n ∈ narrowQBand s eps j) : |Real.log n - (11/10 : ℝ) * s / 2^j| ≤ eps * s / 2^j := by have h := (mem_dyadicPrimeBand_iff s ((11/10 : ℝ) - eps) ((11/10 : ℝ) + eps) j n).mp hn have hn0 : (0 : ℝ) < n := by exact_mod_cast h.1.pos have hlo := (Real.lt_log_iff_exp_lt hn0).mpr h.2.1 have hhi := (Real.log_le_iff_le_exp hn0).mpr h.2.2 have hloweq : ((11/10 : ℝ) - eps) * s / 2^j = (11/10 : ℝ) * s / 2^j - eps * s / 2^j := by ring have hhieq : ((11/10 : ℝ) + eps) * s / 2^j = (11/10 : ℝ) * s / 2^j + eps * s / 2^j := by ring rw [hloweq] at hlo rw [hhieq] at hhi apply abs_le.mpr constructor <;> linarith theorem candidate_prefix_slot_log_deviation {c L eps : ℝ} {r jStar J : ℕ} (slot : (candidateQIndices c L) × Fin r) (hidx : slot.1.val ≤ J) (hfree : ¬(slot.1.val = 0 ∧ slot.2.val = 0)) {n : ℕ} (hn : n ∈ candidatePrefixChoices c L eps r jStar J slot) : |Real.log n - (11/10 : ℝ) * (c * L) / 2^slot.1.val| ≤ eps * (c * L) / 2^slot.1.val := by classical have hm : slot ∈ candidatePrefixSlots c L r J := mem_filter.mpr ⟨mem_univ _, hidx, hfree⟩ simp only [candidatePrefixChoices, restrictedSlotChoices, if_pos hm] at hn exact narrowQBand_log_deviation (c * L) eps slot.1.val hn theorem candidate_prefix_slot_log_bounds {c L eps : ℝ} (hcL : 0 ≤ c * L) (heps : eps ≤ 1/10) {r jStar J : ℕ} (hJ : J < jStar) (slot : (candidateQIndices c L) × Fin r) {n : ℕ} (hn : n ∈ candidatePrefixChoices c L eps r jStar J slot) : 0 ≤ Real.log n ∧ Real.log n ≤ (6/5 : ℝ) * (c * L) / 2^slot.1.val := by have h := candidate_Q_slot_log_bounds c L r jStar slot (candidatePrefixChoices_subset hcL heps hJ slot hn) exact ⟨(by positivity : (0 : ℝ) ≤ c * L / 2^slot.1.val).trans h.1.le, h.2⟩ end section open Finset noncomputable def completedSlotLog {I : Type*} [DecidableEq I] (x : I → ℕ) (free : I) (midpoint : ℝ) (i : I) : ℝ := if i = free then midpoint else Real.log (x i) section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] (x : I → ℕ) (free : I) (midpoint : ℝ) (hx : ∀ i : {i : I // i ≠ free}, x i.val ≠ 0) include I sharedInstance1 sharedInstance2 x free midpoint hx theorem completed_slot_log_sum : (∑ i, completedSlotLog x free midpoint i) = midpoint + Real.log (∏ i : {i : I // i ≠ free}, (x i.val : ℝ)) := by rw [Fintype.sum_eq_add_sum_subtype_ne _ free] simp only [completedSlotLog] congr 1 rw [Real.log_prod (fun i _ => by exact_mod_cast hx i)] apply sum_congr rfl intro i _ simp only [if_neg i.property] theorem completed_slot_log_sum_nat_product : (∑ i, completedSlotLog x free midpoint i) = midpoint + Real.log ((∏ i : {i : I // i ≠ free}, x i.val : ℕ) : ℝ) := by simpa only [Nat.cast_prod] using completed_slot_log_sum x free midpoint hx end end section open Finset /- The product density relative to the untilted active-label law. Lists may repeat labels. -/ noncomputable def cleanActiveDensity {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (b : (g : G) → P g → ℝ) (L : (g : G) → PhysicalSlots J ell → P g) : ℝ := ∏ g, ∏ s, 1 / b g (L g s) noncomputable def cleanSharedDensity {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (b : (g : G) → P g → ℝ) (C : G → Finset (Fin J)) (L : (g : G) → PhysicalSlots J ell → P g) : ℝ := ∏ g, ∏ s ∈ physicalSharedSlots (ell := ell) (C g), 1 / b g (L g s) noncomputable def cleanUnsharedDensity {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (b : (g : G) → P g → ℝ) (C : G → Finset (Fin J)) (L : (g : G) → PhysicalSlots J ell → P g) : ℝ := ∏ g, ∏ s ∈ physicalUnsharedSlots (ell := ell) (C g), 1 / b g (L g s) section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (b : (g : G) → P g → ℝ) include G sharedInstance1 P J ell b theorem clean_active_density_split (C : G → Finset (Fin J)) (L : (g : G) → PhysicalSlots J ell → P g) : cleanActiveDensity b L = cleanSharedDensity b C L * cleanUnsharedDensity b C L := by unfold cleanActiveDensity cleanSharedDensity cleanUnsharedDensity physicalUnsharedSlots rw [← prod_mul_distrib] apply prod_congr rfl intro g hg exact (prod_mul_prod_compl _ _).symm end end section open Finset section variable {I : Type*} (S : Finset I) (b ε : I → ℝ) (hb0 : ∀ i ∈ S, 0 ≤ b i) (hb1 : ∀ i ∈ S, b i ≤ 1) (hε : ∀ i ∈ S, 0 ≤ ε i) (hlo : ∀ i ∈ S, 1 - ε i ≤ b i) include I S b ε hb0 hb1 hε hlo theorem finite_baseline_product_lower : 1 - ∑ i ∈ S, ε i ≤ ∏ i ∈ S, b i := by classical induction S using Finset.induction_on with | empty => simp | @insert i S hi ih => rw [sum_insert hi, prod_insert hi] have hSi : ∀ j ∈ S, j ∈ insert i S := fun j hj => mem_insert_of_mem hj have hih := ih (fun j hj => hb0 j (hSi j hj)) (fun j hj => hb1 j (hSi j hj)) (fun j hj => hε j (hSi j hj)) (fun j hj => hlo j (hSi j hj)) have hi0 := hb0 i (mem_insert_self i S) have hi1 := hb1 i (mem_insert_self i S) have hil := hlo i (mem_insert_self i S) have hsum : 0 ≤ ∑ j ∈ S, ε j := sum_nonneg (fun j hj => hε j (hSi j hj)) have hm := mul_le_mul_of_nonneg_left hih hi0 nlinarith [mul_nonneg (sub_nonneg.mpr hi1) hsum] theorem finite_inverse_baseline_product_bounds (hsmall : ∑ i ∈ S, ε i ≤ 1 / 2) : 1 ≤ ∏ i ∈ S, 1 / b i ∧ (∏ i ∈ S, 1 / b i) ≤ 1 + 2 * ∑ i ∈ S, ε i := by have hs : 0 ≤ ∑ i ∈ S, ε i := sum_nonneg hε have hprod := finite_baseline_product_lower S b ε hb0 hb1 hε hlo have hp0 : 0 < ∏ i ∈ S, b i := by linarith have hp1 : (∏ i ∈ S, b i) ≤ 1 := prod_le_one₀ hb0 hb1 have heq : (∏ i ∈ S, 1 / b i) = 1 / ∏ i ∈ S, b i := by simp only [one_div, prod_inv_distrib] rw [heq] constructor · exact (le_div_iff₀ hp0).mpr (by simpa using hp1) · apply (div_le_iff₀ hp0).mpr have hm := mul_le_mul_of_nonneg_left hprod (by linarith : 0 ≤ 1 + 2 * ∑ i ∈ S, ε i) nlinarith [mul_nonneg hs (show 0 ≤ 1 - 2 * ∑ i ∈ S, ε i by linarith)] end theorem sqrt_density_sub_one_bounds {d E : ℝ} (hE : 0 ≤ E) (hd : 1 ≤ d) (hdE : d ≤ 1 + 2 * E) : 0 ≤ Real.sqrt d - 1 ∧ Real.sqrt d - 1 ≤ E := by have hd0 : 0 ≤ d := le_trans zero_le_one hd have hs := Real.sq_sqrt hd0 have hp := Real.sqrt_nonneg d constructor · nlinarith · nlinarith [sq_nonneg E] section variable {I : Type*} (S : Finset I) (T p : I → ℝ) (hT : ∀ i ∈ S, 0 ≤ T i) (hp : ∀ i ∈ S, 0 < p i) (hsmall : ∑ i ∈ S, T i / p i ≤ 1 / 2) include I S T p hT hp hsmall /- The actual lifespan baseline uses the total damping divided by the label modulus. -/ theorem memory_lifespan_inverse_product_bounds : 1 ≤ ∏ i ∈ S, 1 / (1 - T i / p i) ∧ (∏ i ∈ S, 1 / (1 - T i / p i)) ≤ 1 + 2 * ∑ i ∈ S, T i / p i := by have he (i) (hi : i ∈ S) : 0 ≤ T i / p i := div_nonneg (hT i hi) (hp i hi).le have hb0 (i) (hi : i ∈ S) : 0 ≤ 1 - T i / p i := by have hle := single_le_sum he hi linarith exact finite_inverse_baseline_product_bounds S (fun i => 1 - T i / p i) (fun i => T i / p i) hb0 (fun i hi => by linarith [he i hi]) he (fun _ _ => le_rfl) hsmall theorem memory_lifespan_inverse_sqrt_bounds : 0 ≤ Real.sqrt (∏ i ∈ S, 1 / (1 - T i / p i)) - 1 ∧ Real.sqrt (∏ i ∈ S, 1 / (1 - T i / p i)) - 1 ≤ ∑ i ∈ S, T i / p i := by obtain ⟨h1, h2⟩ := memory_lifespan_inverse_product_bounds S T p hT hp hsmall exact sqrt_density_sub_one_bounds (sum_nonneg (fun i hi => div_nonneg (hT i hi) (hp i hi).le)) h1 h2 end /- A uniform lower label bound gives an explicit loss proportional to the number of sampled coordinates, allowing the same label at several coordinates. -/ theorem memory_lifespan_uniform_density_bounds {I : Type*} (S : Finset I) (p : I → ℝ) {T P₀ : ℝ} (hT : 0 ≤ T) (hP₀ : 0 < P₀) (hp : ∀ i ∈ S, P₀ ≤ p i) (hsmall : (S.card : ℝ) * T / P₀ ≤ 1 / 2) : (1 ≤ ∏ i ∈ S, 1 / (1 - T / p i) ∧ (∏ i ∈ S, 1 / (1 - T / p i)) ≤ 1 + 2 * ((S.card : ℝ) * T / P₀)) ∧ (0 ≤ Real.sqrt (∏ i ∈ S, 1 / (1 - T / p i)) - 1 ∧ Real.sqrt (∏ i ∈ S, 1 / (1 - T / p i)) - 1 ≤ (S.card : ℝ) * T / P₀) := by have hsum : (∑ i ∈ S, T / p i) ≤ (S.card : ℝ) * T / P₀ := by calc _ ≤ ∑ _i ∈ S, T / P₀ := sum_le_sum (fun i hi => div_le_div_of_nonneg_left hT hP₀ (hp i hi)) _ = _ := by simp [mul_div_assoc] obtain ⟨h1, h2⟩ := memory_lifespan_inverse_product_bounds S (fun _ => T) p (fun _ _ => hT) (fun i hi => hP₀.trans_le (hp i hi)) (hsum.trans hsmall) obtain ⟨hs1, hs2⟩ := memory_lifespan_inverse_sqrt_bounds S (fun _ => T) p (fun _ _ => hT) (fun i hi => hP₀.trans_le (hp i hi)) (hsum.trans hsmall) exact ⟨⟨h1, h2.trans (by linarith)⟩, hs1, hs2.trans hsum⟩ /- Pointwise active-coordinate density for the physical lifespan baseline. The index set can contain several occurrences of one numerical prime. -/ theorem physical_lifespan_tilt_density_bounds {I G : Type*} [Fintype I] {P : G → Finset ℕ} (γ : I → G) (labels : ∀ i, P (γ i)) (b : ∀ g, P g → ℝ) {T P₀ : ℝ} (hT : 0 ≤ T) (hP₀ : 0 < P₀) (hp : ∀ i, P₀ ≤ ((labels i).val : ℝ)) (hb : ∀ i, b (γ i) (labels i) = 1 - T / ((labels i).val : ℝ)) (hsmall : (Fintype.card I : ℝ) * T / P₀ ≤ 1 / 2) : (1 ≤ ∏ i, 1 / b (γ i) (labels i) ∧ (∏ i, 1 / b (γ i) (labels i)) ≤ 1 + 2 * ((Fintype.card I : ℝ) * T / P₀)) ∧ (0 ≤ Real.sqrt (∏ i, 1 / b (γ i) (labels i)) - 1 ∧ Real.sqrt (∏ i, 1 / b (γ i) (labels i)) - 1 ≤ (Fintype.card I : ℝ) * T / P₀) := by simp_rw [hb] exact memory_lifespan_uniform_density_bounds univ (fun i => ((labels i).val : ℝ)) hT hP₀ (fun i _ => hp i) (by simpa using hsmall) end section /- Tilting each independent slot multiplies the product law by the product density. -/ theorem physical_tilted_birth_product_eq {I G : Type*} [Fintype I] {P : G → Finset ℕ} (V : G → ℝ) (γ : I → G) (b : ∀ g, P g → ℝ) (labels : ∀ i, P (γ i)) : (∏ i, tiltedPhysicalBirthLaw V (γ i) (b (γ i)) (labels i)) = (∏ i, physicalLabelLaw V (γ i) (labels i)) * ∏ i, 1 / b (γ i) (labels i) := by simp only [tiltedPhysicalBirthLaw, div_eq_mul_inv, one_mul, Finset.prod_mul_distrib] end section open Finset open scoped Classical /- The unique promotion map from the empty selected target-slot set. -/ def unrestrictedCleanPromotion (t : ℕ) {N : ℕ} (eligible : Finset (Fin N)) : (∅ : Finset (Fin t)) ↪ eligible := Function.Embedding.ofIsEmpty theorem unrestricted_clean_promotion_unique {t N : ℕ} (eligible : Finset (Fin N)) (e : (∅ : Finset (Fin t)) ↪ eligible) : e = unrestrictedCleanPromotion t eligible := by ext s exact (notMem_empty s.val s.property).elim theorem unrestricted_clean_selected_indices {t N : ℕ} (eligible : Finset (Fin N)) : promotionSelectedIndices (unrestrictedCleanPromotion t eligible) = ∅ := by apply card_eq_zero.mp rw [promotionSelectedIndices_card] simp theorem unrestricted_clean_survivors {t N : ℕ} (eligible : Finset (Fin N)) : unrestrictedEdgeSurvivors (unrestrictedCleanPromotion t eligible) = univ := by rw [unrestrictedEdgeSurvivors, unrestricted_clean_selected_indices, sdiff_empty] /- No promotion removes an old slot, irrespective of numerical label repetitions. -/ noncomputable def unrestrictedCleanSurvivorEquiv (t : ℕ) {N : ℕ} (eligible : Finset (Fin N)) : unrestrictedEdgeSurvivors (unrestrictedCleanPromotion t eligible) ≃ Fin N where toFun j := j.val invFun j := ⟨j, by rw [unrestricted_clean_survivors]; exact mem_univ j⟩ left_inv _ := rfl right_inv _ := rfl /- The actual retained-and-appended output index, with an empty appended block, identified with an old slot. It does not assume the retained enumeration is identity. -/ noncomputable def unrestrictedCleanIndexEquiv (t : ℕ) {N : ℕ} (eligible : Finset (Fin N)) : Fin ((unrestrictedEdgeSurvivors (unrestrictedCleanPromotion t eligible)).card + 0) ≃ Fin N := (retainedBirthIndexEquiv _ 0).trans ((Equiv.sumEmpty _ (Fin 0)).trans (unrestrictedCleanSurvivorEquiv t eligible)) section variable {P Z : Type*} {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) (eligible : Finset (Fin N)) include P Z t N source old seed transport eligible /- Pointwise evaluation of the actual clean output under its index equivalence. -/ theorem unrestricted_clean_output_apply (j : Fin (unrestrictedEdgeOutput source old seed transport ∅ ∅ (unrestrictedCleanPromotion t eligible)).1) : (unrestrictedEdgeOutput source old seed transport ∅ ∅ (unrestrictedCleanPromotion t eligible)).2 j = transport (old (unrestrictedCleanIndexEquiv t eligible j)) := by change Fin ((unrestrictedEdgeSurvivors (unrestrictedCleanPromotion t eligible)).card + 0) at j change (retainedBirthTuple (transport ∘ old) (unrestrictedEdgeSurvivors (unrestrictedCleanPromotion t eligible)) (transport ∘ unrestrictedStoredTuple source seed ∅)).2 j = _ refine Eq.trans (retained_birth_tuple_apply_index_equiv (b := 0) (transport ∘ old) (unrestrictedEdgeSurvivors (unrestrictedCleanPromotion t eligible)) (transport ∘ unrestrictedStoredTuple source seed ∅) j) ?_ have hi : unrestrictedCleanIndexEquiv t eligible j = unrestrictedCleanSurvivorEquiv t eligible (Equiv.sumEmpty _ (Fin 0) (retainedBirthIndexEquiv (unrestrictedEdgeSurvivors (unrestrictedCleanPromotion t eligible)) 0 j)) := rfl rw [hi] generalize hk : retainedBirthIndexEquiv (unrestrictedEdgeSurvivors (unrestrictedCleanPromotion t eligible)) 0 j = k cases k with | inl k => rfl | inr k => exact Fin.elim0 k theorem unrestricted_clean_output_length : (unrestrictedEdgeOutput source old seed transport ∅ ∅ (unrestrictedCleanPromotion t eligible)).1 = N := by change (unrestrictedEdgeMemory old transport (unrestrictedStoredTuple source seed ∅) (unrestrictedCleanPromotion t eligible)).1 = N rw [unrestrictedEdgeMemory_length] simp end /- A symmetric tuple test is unchanged by any explicit index equivalence. -/ theorem ordered_tuple_symmetric_of_index_equiv {Z K : Type*} (F : FiniteOrderedTuple Z → K) (hF : OrderedTupleSymmetric F) (q : FiniteOrderedTuple Z) {N : ℕ} (p : Fin N → Z) (e : Fin q.1 ≃ Fin N) (hv : ∀ j, q.2 j = p (e j)) : F q = F ⟨N, p⟩ := by rcases q with ⟨n, q⟩ have hn : n = N := by simpa only [Fintype.card_fin] using Fintype.card_congr e subst n have hq : q = p ∘ e := funext hv change F ⟨N, q⟩ = _ rw [hq] exact hF N p e /- A symmetric tuple test only sees the transported old memory. -/ theorem unrestricted_clean_output_symmetric {P Z K : Type*} {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) (eligible : Finset (Fin N)) (F : FiniteOrderedTuple Z → K) (hF : OrderedTupleSymmetric F) : F (unrestrictedEdgeOutput source old seed transport ∅ ∅ (unrestrictedCleanPromotion t eligible)) = F ⟨N, transport ∘ old⟩ := ordered_tuple_symmetric_of_index_equiv F hF _ (transport ∘ old) (unrestrictedCleanIndexEquiv t eligible) (unrestricted_clean_output_apply source old seed transport eligible) section variable {P Z : Type*} {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (seed : P → Z) (transport : Z → Z) include P Z t N source old seed transport /- Output hit counts include all transported old occurrences, even repeated ones. -/ theorem unrestricted_clean_output_count (eligible : Finset (Fin N)) (hit : Z → Prop) : orderedPredicateCount (unrestrictedEdgeOutput source old seed transport ∅ ∅ (unrestrictedCleanPromotion t eligible)) hit = orderedPredicateCount ⟨N, transport ∘ old⟩ hit := by unfold orderedPredicateCount calc _ = ∑ j, if hit (transport (old (unrestrictedCleanIndexEquiv t eligible j))) then 1 else 0 := by apply sum_congr rfl intro j _ rw [unrestricted_clean_output_apply] _ = _ := (unrestrictedCleanIndexEquiv t eligible).sum_comp (fun j => if hit (transport (old j)) then (1 : ℕ) else 0) /- Empty promotions remove the V denominator entirely. Both actual endpoint rho counts remain, with no factorial or per-old-particle measure inserted. -/ theorem unrestricted_clean_event_mass (hit : Z → Prop) (μ : P → ℝ) (ρ V : ℝ) (eligible : Finset (Fin N)) (fresh : UnrestrictedFreshLabels P (∅ : Finset (Fin t))) : unrestrictedEdgeEventMass source old seed transport hit μ ρ V ∅ ∅ (unrestrictedCleanPromotion t eligible) fresh = (ρ ^ orderedPredicateCount ⟨N, old⟩ hit * ρ ^ orderedPredicateCount ⟨N, transport ∘ old⟩ hit) * unrestrictedFreshWeight μ ∅ fresh := by unfold unrestrictedEdgeEventMass rw [unrestricted_clean_output_count] simp only [card_empty, pow_zero, div_one] end /- With no promotions, the fresh slots are every target slot. -/ def unrestrictedCleanFreshSlotEquiv (t : ℕ) : {j : Fin t // j ∉ (∅ : Finset (Fin t))} ≃ Fin t where toFun j := j.val invFun j := ⟨j, notMem_empty j⟩ left_inv _ := rfl right_inv _ := rfl def unrestrictedCleanFreshEquiv (P : Type*) (t : ℕ) : UnrestrictedFreshLabels P (∅ : Finset (Fin t)) ≃ (Fin t → P) where toFun fresh j := fresh ((unrestrictedCleanFreshSlotEquiv t).symm j) invFun target j := target j.val left_inv _ := rfl right_inv _ := rfl theorem unrestricted_clean_target {P Z : Type*} {t N : ℕ} (old : Fin N → Z) (label : Z → P) (eligible : Finset (Fin N)) (fresh : UnrestrictedFreshLabels P (∅ : Finset (Fin t))) : unrestrictedEdgeTarget old label ∅ (unrestrictedCleanPromotion t eligible) fresh = unrestrictedCleanFreshEquiv P t fresh := by funext j simp only [unrestrictedEdgeTarget, unrestrictedTargetLabels, notMem_empty] rfl theorem unrestricted_clean_fresh_weight {P : Type*} {t : ℕ} (μ : P → ℝ) (fresh : UnrestrictedFreshLabels P (∅ : Finset (Fin t))) : unrestrictedFreshWeight μ ∅ fresh = ∏ j, μ (unrestrictedCleanFreshEquiv P t fresh j) := by exact (unrestrictedCleanFreshSlotEquiv t).prod_comp (fun j => μ (unrestrictedCleanFreshEquiv P t fresh j)) /- Complex tests have the same unrestricted product fresh-label integral. -/ theorem unrestricted_clean_fresh_complex_sum {P : Type*} [Fintype P] {t : ℕ} (μ : P → ℝ) (G : (Fin t → P) → ℂ) : (∑ fresh : UnrestrictedFreshLabels P (∅ : Finset (Fin t)), (unrestrictedFreshWeight μ ∅ fresh : ℂ) * G (unrestrictedCleanFreshEquiv P t fresh)) = ∑ target : Fin t → P, ((∏ j, μ (target j) : ℝ) : ℂ) * G target := by simp_rw [unrestricted_clean_fresh_weight] exact (unrestrictedCleanFreshEquiv P t).sum_comp (fun target => ((∏ j, μ (target j) : ℝ) : ℂ) * G target) section variable {P Z : Type*} [sharedInstance1 : Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (label : Z → P) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V : ℝ) (eligible : Finset (Fin N)) include P Z sharedInstance1 t N source old label seed transport hit μ ρ V eligible /- Exact complex event integral with both real rho factors retained. -/ theorem unrestricted_clean_event_complex_sum (G : (Fin t → P) → ℂ) : (∑ fresh : UnrestrictedFreshLabels P (∅ : Finset (Fin t)), (unrestrictedEdgeEventMass source old seed transport hit μ ρ V ∅ ∅ (unrestrictedCleanPromotion t eligible) fresh : ℂ) * G (unrestrictedEdgeTarget old label ∅ (unrestrictedCleanPromotion t eligible) fresh)) = ((ρ ^ orderedPredicateCount ⟨N, old⟩ hit * ρ ^ orderedPredicateCount ⟨N, transport ∘ old⟩ hit : ℝ) : ℂ) * ∑ target : Fin t → P, ((∏ j, μ (target j) : ℝ) : ℂ) * G target := by simp_rw [unrestricted_clean_event_mass, unrestricted_clean_target, Complex.ofReal_mul, mul_assoc] rw [← mul_sum, ← mul_sum, unrestricted_clean_fresh_complex_sum] /- A coupled complex continuation symmetric in memory is evaluated on the transported old tuple inside the full unrestricted target integral. -/ theorem unrestricted_clean_symmetric_continuation (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) (hF : ∀ target, OrderedTupleSymmetric (F target)) : (∑ fresh : UnrestrictedFreshLabels P (∅ : Finset (Fin t)), (unrestrictedEdgeEventMass source old seed transport hit μ ρ V ∅ ∅ (unrestrictedCleanPromotion t eligible) fresh : ℂ) * F (unrestrictedEdgeTarget old label ∅ (unrestrictedCleanPromotion t eligible) fresh) (unrestrictedEdgeOutput source old seed transport ∅ ∅ (unrestrictedCleanPromotion t eligible))) = ((ρ ^ orderedPredicateCount ⟨N, old⟩ hit * ρ ^ orderedPredicateCount ⟨N, transport ∘ old⟩ hit : ℝ) : ℂ) * ∑ target : Fin t → P, ((∏ j, μ (target j) : ℝ) : ℂ) * F target ⟨N, transport ∘ old⟩ := by simp_rw [unrestricted_clean_output_symmetric source old seed transport eligible _ (hF _)] exact unrestricted_clean_event_complex_sum source old label seed transport hit μ ρ V eligible (fun target => F target ⟨N, transport ∘ old⟩) end end section open Finset /- Fixed prime labels at every ordered memory index, allowing repetitions. -/ abbrev FixedOrderedMemoryLabels {G : Type*} (P : G → Finset ℕ) (N : G → ℕ) := (g : G) → Fin (N g) → P g /- Residues are indexed by occurrences, even when their prime labels agree. -/ abbrev FixedOrderedResidues {G : Type*} {P : G → Finset ℕ} {N : G → ℕ} (p : FixedOrderedMemoryLabels P N) := (g : G) → (j : Fin (N g)) → ZMod (p g j).val /- The common physical integer direction on all fixed residue coordinates. -/ def fixedOrderedResidueDirection {G : Type*} {P : G → Finset ℕ} {N : G → ℕ} (p : FixedOrderedMemoryLabels P N) : ℤ →+ FixedOrderedResidues p where toFun Δ g j := Δ map_zero' := by funext g j; exact Int.cast_zero map_add' a b := by funext g j; exact Int.cast_add a b /- Physical translation adds Delta; prime labels and lengths are parameters. -/ def fixedOrderedResidueTranslate {G : Type*} {P : G → Finset ℕ} {N : G → ℕ} (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) (Δ : ℤ) : FixedOrderedResidues p := r + fixedOrderedResidueDirection p Δ theorem fixed_ordered_residue_translate_apply {G : Type*} {P : G → Finset ℕ} {N : G → ℕ} (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) (Δ : ℤ) (g : G) (j : Fin (N g)) : fixedOrderedResidueTranslate p r Δ g j = r g j + (Δ : ZMod (p g j).val) := rfl /- Embed one fixed group fiber into the actual sigma-particle tuple type. -/ def fixedOrderedResidueMemory {G : Type*} {P : G → Finset ℕ} {N : G → ℕ} (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) (g : G) : FiniteOrderedTuple (UnrestrictedResidueParticle (fun q : P g => q.val)) := ⟨N g, fun j => ⟨p g j, r g j⟩⟩ /- The sign conversion to the existing unrestricted transport is exact at every actual ordered particle, without any injectivity assumption. -/ theorem fixed_ordered_residue_memory_transport_apply {G : Type*} {P : G → Finset ℕ} {N : G → ℕ} (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) (Δ : ℤ) (g : G) (j : Fin (N g)) : (fixedOrderedResidueMemory p (fixedOrderedResidueTranslate p r Δ) g).2 j = unrestrictedResidueTransport (fun q : P g => q.val) (-Δ) ((fixedOrderedResidueMemory p r g).2 j) := by simp only [fixedOrderedResidueMemory, fixed_ordered_residue_translate_apply, unrestrictedResidueTransport_apply, Int.cast_neg, sub_neg_eq_add] end section open Finset open scoped Classical abbrev RepeatedBigLists {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) := ∀ g, PhysicalSlots J ell → P g def repeatedBigUnshared {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) : PhysicalSlots J ell → Prop | Sum.inl j => j ∈ C g | Sum.inr _ => True abbrev RepeatedBigFresh {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) := ∀ g, {s : PhysicalSlots J ell // repeatedBigUnshared C g s} → P g def repeatedBigSharedCompatible {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (source target : RepeatedBigLists P J ell) : Prop := ∀ g j, j ∉ C g → source g (Sum.inl j) = target g (Sum.inl j) noncomputable def repeatedBigFill {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (source : RepeatedBigLists P J ell) (fresh : RepeatedBigFresh P C ell) : RepeatedBigLists P J ell := by classical exact fun g s => if h : repeatedBigUnshared C g s then fresh g ⟨s, h⟩ else source g s section variable {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (source : RepeatedBigLists P J ell) (fresh : RepeatedBigFresh P C ell) include G P J ell C source fresh theorem repeated_big_fill_unshared (g : G) (s : {s : PhysicalSlots J ell // repeatedBigUnshared C g s}) : repeatedBigFill C source fresh g s.val = fresh g s := by simp [repeatedBigFill, s.property] theorem repeated_big_fill_shared : repeatedBigSharedCompatible C source (repeatedBigFill C source fresh) := by intro g j hj simp [repeatedBigFill, repeatedBigUnshared, hj] end noncomputable def repeatedBigFreshEquiv {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (source : RepeatedBigLists P J ell) : RepeatedBigFresh P C ell ≃ {target : RepeatedBigLists P J ell // repeatedBigSharedCompatible C source target} where toFun fresh := ⟨repeatedBigFill C source fresh, repeated_big_fill_shared C source fresh⟩ invFun target g s := target.val g s.val left_inv fresh := by funext g s exact repeated_big_fill_unshared C source fresh g s right_inv target := by apply Subtype.ext funext g s dsimp [repeatedBigFill] split_ifs with h · rfl · cases s with | inl j => exact target.property g j h | inr j => exact (h trivial).elim theorem repeated_big_target_sum {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (source : RepeatedBigLists P J ell) {A : Type*} [AddCommMonoid A] (F : RepeatedBigLists P J ell → A) : (∑ fresh : RepeatedBigFresh P C ell, F (repeatedBigFill C source fresh)) = ∑ target : RepeatedBigLists P J ell, if repeatedBigSharedCompatible C source target then F target else 0 := by classical calc _ = ∑ target : {target : RepeatedBigLists P J ell // repeatedBigSharedCompatible C source target}, F target.val := (repeatedBigFreshEquiv C source).sum_comp (fun target => F target.val) _ = _ := by rw [← Finset.sum_filter] exact Finset.sum_subtype (p := fun target => repeatedBigSharedCompatible C source target) (Finset.univ.filter (fun target => repeatedBigSharedCompatible C source target)) (fun _ => by simp) F |>.symm end section open Finset end section open scoped BigOperators InnerProductSpace theorem finite_gram_row_norm_sq {X E : Type*} [Fintype X] [NormedAddCommGroup E] [InnerProductSpace ℂ E] (u : X → E) (c : X → ℂ) {B : ℝ} (hrow : ∀ i, (∑ j, ‖inner ℂ (u i) (u j)‖) ≤ B) : ‖∑ i, c i • u i‖ ^ 2 ≤ B * ∑ i, ‖c i‖ ^ 2 := by classical have he : ‖∑ i, c i • u i‖ ^ 2 = ∑ i, ∑ j, (inner ℂ (c i • u i) (c j • u j)).re := by rw [norm_sq_eq_re_inner (𝕜 := ℂ)] change (inner ℂ (∑ i, c i • u i) (∑ i, c i • u i)).re = _ simp only [sum_inner, inner_sum, Complex.re_sum] exact Finset.sum_comm have hp (i j : X) : 2 * (inner ℂ (c i • u i) (c j • u j)).re ≤ ‖c i‖ ^ 2 * ‖inner ℂ (u i) (u j)‖ + ‖c j‖ ^ 2 * ‖inner ℂ (u i) (u j)‖ := by have h := Complex.re_le_norm (inner ℂ (c i • u i) (c j • u j)) have hn : ‖inner ℂ (c i • u i) (c j • u j)‖ = ‖c i‖ * ‖c j‖ * ‖inner ℂ (u i) (u j)‖ := by rw [inner_smul_left, inner_smul_right] simp only [norm_mul, Complex.norm_conj, mul_assoc] rw [hn] at h nlinarith [mul_nonneg (sq_nonneg (‖c i‖ - ‖c j‖)) (norm_nonneg (inner ℂ (u i) (u j)))] have hs := Finset.sum_le_sum (fun i (_ : i ∈ (Finset.univ : Finset X)) => Finset.sum_le_sum (fun j (_ : j ∈ (Finset.univ : Finset X)) => hp i j)) have hswap : (∑ i, ∑ j, ‖c j‖ ^ 2 * ‖inner ℂ (u i) (u j)‖) = ∑ i, ‖c i‖ ^ 2 * ∑ j, ‖inner ℂ (u i) (u j)‖ := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ rw [norm_inner_symm (𝕜 := ℂ) (u j) (u i)] simp only [Finset.sum_add_distrib] at hs simp_rw [← Finset.mul_sum] at hs rw [hswap] at hs have hmid : ‖∑ i, c i • u i‖ ^ 2 ≤ ∑ i, ‖c i‖ ^ 2 * ∑ j, ‖inner ℂ (u i) (u j)‖ := by rw [he] linarith calc _ ≤ ∑ i, ‖c i‖ ^ 2 * ∑ j, ‖inner ℂ (u i) (u j)‖ := hmid _ ≤ ∑ i, ‖c i‖ ^ 2 * B := Finset.sum_le_sum (fun i _ => mul_le_mul_of_nonneg_left (hrow i) (sq_nonneg _)) _ = _ := by rw [← Finset.sum_mul, mul_comm] theorem finite_near_orthogonal_norm_sq {X E : Type*} [Fintype X] [NormedAddCommGroup E] [InnerProductSpace ℂ E] (u : X → E) (c : X → ℂ) {ε : ℝ} (_hε : 0 ≤ ε) (hdiag : ∀ i, ‖u i‖ ^ 2 ≤ 1) (hoff : ∀ i j, i ≠ j → ‖inner ℂ (u i) (u j)‖ ≤ ε) : ‖∑ i, c i • u i‖ ^ 2 ≤ (1 + (Fintype.card X - 1 : ℕ) * ε) * ∑ i, ‖c i‖ ^ 2 := by classical apply finite_gram_row_norm_sq u c intro i have hrow : (∑ j, ‖inner ℂ (u i) (u j)‖) ≤ ∑ j : X, if j = i then 1 else ε := by apply Finset.sum_le_sum intro j _ by_cases h : j = i · subst j have hn : inner ℂ (u i) (u i) = (‖u i‖ : ℂ) ^ 2 := inner_self_eq_norm_sq_to_K (𝕜 := ℂ) (u i) rw [hn, norm_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (norm_nonneg _), if_pos rfl] exact hdiag i · simpa only [if_neg h] using hoff i j (Ne.symm h) refine hrow.trans_eq ?_ rw [← Finset.sum_erase_add _ _ (Finset.mem_univ i)] simp only [if_true] rw [Finset.sum_congr rfl (fun j hj => if_neg (Finset.ne_of_mem_erase hj))] simp [Finset.card_erase_of_mem (Finset.mem_univ i), add_comm] theorem finite_gram_row_analysis_sq {X E : Type*} [Fintype X] [NormedAddCommGroup E] [InnerProductSpace ℂ E] (u : X → E) {B : ℝ} (hB : 0 ≤ B) (hrow : ∀ i, (∑ j, ‖inner ℂ (u i) (u j)‖) ≤ B) (f : E) : (∑ i, ‖inner ℂ (u i) f‖ ^ 2) ≤ B * ‖f‖ ^ 2 := by let energy : ℝ := ∑ i, ‖inner ℂ (u i) f‖ ^ 2 let v : E := ∑ i, inner ℂ (u i) f • u i have he0 : 0 ≤ energy := Finset.sum_nonneg (fun _ _ => sq_nonneg _) have he : (inner ℂ v f).re = energy := by dsimp [v, energy] rw [sum_inner] simp only [Complex.re_sum, inner_smul_left, Complex.conj_mul', ← Complex.ofReal_pow, Complex.ofReal_re] have hn := finite_gram_row_norm_sq u (fun i => inner ℂ (u i) f) hrow change ‖v‖ ^ 2 ≤ B * energy at hn have he_le : energy ≤ ‖v‖ * ‖f‖ := by rw [← he] exact (Complex.re_le_norm _).trans (norm_inner_le_norm _ _) have hs : energy ^ 2 ≤ (B * energy) * ‖f‖ ^ 2 := by calc _ ≤ (‖v‖ * ‖f‖) ^ 2 := (sq_le_sq₀ he0 (by positivity)).mpr he_le _ = ‖v‖ ^ 2 * ‖f‖ ^ 2 := mul_pow _ _ _ _ ≤ _ := mul_le_mul_of_nonneg_right hn (sq_nonneg _) change energy ≤ B * ‖f‖ ^ 2 rcases eq_or_lt_of_le he0 with heq | hpos · rw [← heq] positivity · nlinarith theorem finite_near_orthogonal_frame_sq {X E : Type*} [Fintype X] [NormedAddCommGroup E] [InnerProductSpace ℂ E] (u : X → E) {ε : ℝ} (hε : 0 ≤ ε) (hdiag : ∀ i, ‖u i‖ ^ 2 ≤ 1) (hoff : ∀ i j, i ≠ j → ‖inner ℂ (u i) (u j)‖ ≤ ε) (f : E) : ‖∑ i, inner ℂ (u i) f • u i‖ ^ 2 ≤ (1 + (Fintype.card X - 1 : ℕ) * ε) ^ 2 * ‖f‖ ^ 2 := by let B : ℝ := 1 + (Fintype.card X - 1 : ℕ) * ε have hB : 0 ≤ B := by dsimp [B]; positivity have hs (c : X → ℂ) : ‖∑ i, c i • u i‖ ^ 2 ≤ B * ∑ i, ‖c i‖ ^ 2 := finite_near_orthogonal_norm_sq u c hε hdiag hoff let energy : ℝ := ∑ i, ‖inner ℂ (u i) f‖ ^ 2 let v : E := ∑ i, inner ℂ (u i) f • u i have he0 : 0 ≤ energy := Finset.sum_nonneg (fun _ _ => sq_nonneg _) have he : (inner ℂ v f).re = energy := by dsimp [v, energy] rw [sum_inner] simp only [Complex.re_sum, inner_smul_left, Complex.conj_mul', ← Complex.ofReal_pow, Complex.ofReal_re] have hn : ‖v‖ ^ 2 ≤ B * energy := hs _ have he_le : energy ≤ ‖v‖ * ‖f‖ := by rw [← he] exact (Complex.re_le_norm _).trans (norm_inner_le_norm _ _) have hsquare : energy ^ 2 ≤ (B * energy) * ‖f‖ ^ 2 := by calc _ ≤ (‖v‖ * ‖f‖) ^ 2 := (sq_le_sq₀ he0 (by positivity)).mpr he_le _ = ‖v‖ ^ 2 * ‖f‖ ^ 2 := mul_pow _ _ _ _ ≤ _ := mul_le_mul_of_nonneg_right hn (sq_nonneg _) have henergy : energy ≤ B * ‖f‖ ^ 2 := by rcases eq_or_lt_of_le he0 with heq | hpos · rw [← heq]; positivity · nlinarith change ‖v‖ ^ 2 ≤ B ^ 2 * ‖f‖ ^ 2 calc _ ≤ B * energy := hn _ ≤ B * (B * ‖f‖ ^ 2) := mul_le_mul_of_nonneg_left henergy hB _ = _ := by ring end section open Finset Classical theorem finite_gated_weighted_cauchy {I : Type*} [Fintype I] (a gate w : I → ℝ) (phase f : I → ℂ) (ha : ∀ i, 0 ≤ a i) (hgate0 : ∀ i, 0 ≤ gate i) (hgate1 : ∀ i, gate i ≤ 1) (hw : ∀ i, 0 < w i) (hphase : ∀ i, ‖phase i‖ ≤ 1) : ‖∑ i, (a i : ℂ) * ((gate i : ℂ) * phase i) * f i‖ ^ 2 ≤ (∑ i, a i * w i) * ∑ i, (a i * gate i) * ‖f i‖ ^ 2 / w i := by have hag (i : I) : 0 ≤ a i * gate i := mul_nonneg (ha i) (hgate0 i) have hnorm (i : I) : ‖((a i * gate i : ℝ) : ℂ)‖ = a i * gate i := by rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hag i)] have hc := complex_row_weighted_cauchy (univ : Finset I) (fun i => ((a i * gate i : ℝ) : ℂ)) (fun i => phase i * f i) w (fun i _ => hw i) simp_rw [hnorm] at hc have hrow : (∑ i, (a i * gate i) * w i) ≤ ∑ i, a i * w i := by apply sum_le_sum intro i hi exact mul_le_mul_of_nonneg_right (by simpa only [mul_one] using mul_le_mul_of_nonneg_left (hgate1 i) (ha i)) (hw i).le have hsquare : (∑ i, (a i * gate i) * ‖phase i * f i‖ ^ 2 / w i) ≤ ∑ i, (a i * gate i) * ‖f i‖ ^ 2 / w i := by apply sum_le_sum intro i hi apply div_le_div_of_nonneg_right _ (hw i).le apply mul_le_mul_of_nonneg_left _ (hag i) apply (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr rw [norm_mul] simpa only [one_mul] using mul_le_mul_of_nonneg_right (hphase i) (norm_nonneg (f i)) have hbound := hc.trans (mul_le_mul hrow hsquare (sum_nonneg fun i _ => div_nonneg (mul_nonneg (hag i) (sq_nonneg _)) (hw i).le) (sum_nonneg fun i _ => mul_nonneg (ha i) (hw i).le)) simpa only [Complex.ofReal_mul, mul_assoc] using hbound noncomputable def unrestrictedEdgeGatedSquareMass {P Z : Type*} [Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (label : Z → P) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V v : ℝ) (eligible : Finset (Fin N)) (B : ℕ) (gate : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥eligible) → UnrestrictedFreshLabels P promotions → ℝ) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) : ℝ := ∑ stores : Finset (Fin t), ∑ promotions : Finset (Fin t), ∑ e : promotions ↪ ↥eligible, ∑ fresh : UnrestrictedFreshLabels P promotions, (unrestrictedEdgeEventMass source old seed transport hit μ ρ V stores promotions e fresh * gate stores promotions e fresh) * (if (unrestrictedEdgeOutput source old seed transport stores promotions e).1 ≤ B then ‖F (unrestrictedEdgeTarget old label promotions e fresh) (unrestrictedEdgeOutput source old seed transport stores promotions e)‖ ^ 2 / v ^ (unrestrictedEdgeOutput source old seed transport stores promotions e).1 else 0) section variable {P Z : Type*} [sharedInstance1 : Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (label : Z → P) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) {ρ V v : ℝ} (hρ : 0 ≤ ρ) (hV : 0 ≤ V) include P Z sharedInstance1 t N source old label seed transport hit μ ρ V v hρ hV theorem unrestricted_edge_gated_square_mass_nonneg (hv : 0 ≤ v) (hμ : ∀ p, 0 ≤ μ p) (eligible : Finset (Fin N)) (B : ℕ) (gate : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥eligible) → UnrestrictedFreshLabels P promotions → ℝ) (hgate0 : ∀ stores promotions e fresh, 0 ≤ gate stores promotions e fresh) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) : 0 ≤ unrestrictedEdgeGatedSquareMass source old label seed transport hit μ ρ V v eligible B gate F := by apply sum_nonneg intro stores hs apply sum_nonneg intro promotions hp apply sum_nonneg intro e he apply sum_nonneg intro fresh hf apply mul_nonneg (mul_nonneg (unrestrictedEdgeEventMass_nonneg source old seed transport hit μ hρ hV hμ stores promotions e fresh) (hgate0 stores promotions e fresh)) split_ifs · exact div_nonneg (sq_nonneg _) (pow_nonneg hv _) · exact le_rfl theorem unrestricted_edge_action_gated_cauchy (hv : 0 < v) (hμ : ∀ p, 0 ≤ μ p) (eligible : Finset (Fin N)) (B : ℕ) (gate : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥eligible) → UnrestrictedFreshLabels P promotions → ℝ) (hgate0 : ∀ stores promotions e fresh, 0 ≤ gate stores promotions e fresh) (hgate1 : ∀ stores promotions e fresh, gate stores promotions e fresh ≤ 1) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥eligible) → UnrestrictedFreshLabels P promotions → ℂ) (hphase : ∀ stores promotions e fresh, ‖phase stores promotions e fresh‖ ≤ 1) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) : ‖unrestrictedEdgeAction source old label seed transport hit μ ρ V eligible B (fun stores promotions e fresh => (gate stores promotions e fresh : ℂ) * phase stores promotions e fresh) F‖ ^ 2 ≤ unrestrictedEdgeRowMass source old seed transport hit μ ρ V v eligible * unrestrictedEdgeGatedSquareMass source old label seed transport hit μ ρ V v eligible B gate F := by let Q := Σ stores : Finset (Fin t), Σ promotions : Finset (Fin t), (promotions ↪ ↥eligible) × UnrestrictedFreshLabels P promotions let mass : Q → ℝ := fun q => unrestrictedEdgeEventMass source old seed transport hit μ ρ V q.1 q.2.1 q.2.2.1 q.2.2.2 let gateQ : Q → ℝ := fun q => gate q.1 q.2.1 q.2.2.1 q.2.2.2 let weight : Q → ℝ := fun q => v ^ (unrestrictedEdgeOutput source old seed transport q.1 q.2.1 q.2.2.1).1 let phaseQ : Q → ℂ := fun q => phase q.1 q.2.1 q.2.2.1 q.2.2.2 let value : Q → ℂ := fun q => if (unrestrictedEdgeOutput source old seed transport q.1 q.2.1 q.2.2.1).1 ≤ B then F (unrestrictedEdgeTarget old label q.2.1 q.2.2.1 q.2.2.2) (unrestrictedEdgeOutput source old seed transport q.1 q.2.1 q.2.2.1) else 0 have hc := finite_gated_weighted_cauchy mass gateQ weight phaseQ value (fun q => unrestrictedEdgeEventMass_nonneg source old seed transport hit μ hρ hV hμ q.1 q.2.1 q.2.2.1 q.2.2.2) (fun q => hgate0 q.1 q.2.1 q.2.2.1 q.2.2.2) (fun q => hgate1 q.1 q.2.1 q.2.2.1 q.2.2.2) (fun _ => pow_pos hv _) (fun q => hphase q.1 q.2.1 q.2.2.1 q.2.2.2) have hsquare : (∑ q : Q, (mass q * gateQ q) * ‖value q‖ ^ 2 / weight q) = unrestrictedEdgeGatedSquareMass source old label seed transport hit μ ρ V v eligible B gate F := by simp only [Q, Fintype.sum_sigma, Fintype.sum_prod_type, mass, gateQ, value, weight, unrestrictedEdgeGatedSquareMass] apply sum_congr rfl intro stores hs apply sum_congr rfl intro promotions hp apply sum_congr rfl intro e he apply sum_congr rfl intro fresh hf split_ifs <;> simp [mul_div_assoc] rw [hsquare] at hc simpa only [Q, Fintype.sum_sigma, Fintype.sum_prod_type, mass, gateQ, weight, phaseQ, value, unrestrictedEdgeAction, unrestrictedEdgeRowMass, unrestrictedEdgeChoiceRowMass] using hc end noncomputable def unrestrictedResidueEdgeSquareMass {P : Type*} [Fintype P] {t N : ℕ} (n : P → ℕ) (Δ D : ℤ) (source : Fin t → P) (old : Fin N → UnrestrictedResidueParticle n) (μ : P → ℝ) (ρ V v : ℝ) (B : ℕ) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : ℝ := unrestrictedEdgeGatedSquareMass source old Sigma.fst (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ ρ V v (unrestrictedResidueEligible n Δ D old) B (fun stores _ _ _ => if unrestrictedResidueStorageAllowed n D source stores then 1 else 0) F section variable {P : Type*} [sharedInstance1 : Fintype P] {t N : ℕ} (n : P → ℕ) (Δ D : ℤ) (source : Fin t → P) (old : Fin N → UnrestrictedResidueParticle n) (μ : P → ℝ) include P sharedInstance1 t N n Δ D source old μ /- Physical Cauchy retains the storage ban in its squared contribution. -/ theorem unrestricted_residue_edge_weighted_cauchy {ρ V v : ℝ} (hρ : 0 ≤ ρ) (hV : 0 ≤ V) (hv : 0 < v) (hμ : ∀ p, 0 ≤ μ p) (B : ℕ) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥(unrestrictedResidueEligible n Δ D old)) → UnrestrictedFreshLabels P promotions → ℂ) (hphase : ∀ stores promotions e fresh, ‖phase stores promotions e fresh‖ ≤ 1) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : ‖unrestrictedResidueEdgeAction n Δ D source old μ ρ V B phase F‖ ^ 2 ≤ unrestrictedEdgeRowMass source old (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ ρ V v (unrestrictedResidueEligible n Δ D old) * unrestrictedResidueEdgeSquareMass n Δ D source old μ ρ V v B F := by have hc := unrestricted_edge_action_gated_cauchy source old Sigma.fst (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ hρ hV hv hμ (unrestrictedResidueEligible n Δ D old) B (fun stores _ _ _ => if unrestrictedResidueStorageAllowed n D source stores then 1 else 0) (by intros; split_ifs <;> norm_num) (by intros; split_ifs <;> norm_num) phase hphase F have hgate stores promotions e fresh : ((if unrestrictedResidueStorageAllowed n D source stores then 1 else 0 : ℝ) : ℂ) * phase stores promotions e fresh = if unrestrictedResidueStorageAllowed n D source stores then phase stores promotions e fresh else 0 := by split_ifs <;> simp simpa only [hgate, unrestrictedResidueEdgeAction, unrestrictedResidueEdgeSquareMass] using hc theorem unrestricted_residue_edge_sq_le_row_bound {ρ V v vmin : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : vmin ≤ V) (hμ : ∀ p, 0 ≤ μ p) (hmass : ∑ p, μ p ≤ 2) (B T : ℕ) (ht : t ≤ T) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥(unrestrictedResidueEligible n Δ D old)) → UnrestrictedFreshLabels P promotions → ℂ) (hphase : ∀ stores promotions e fresh, ‖phase stores promotions e fresh‖ ≤ 1) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : ‖unrestrictedResidueEdgeAction n Δ D source old μ ρ V B phase F‖ ^ 2 ≤ (v ^ N * unrestrictedEdgeRowBound ρ v vmin T) * unrestrictedResidueEdgeSquareMass n Δ D source old μ ρ V v B F := by have hv0 : 0 < v := zero_lt_one.trans hv have hV0 : 0 ≤ V := (hvmin.trans_le hV).le exact (unrestricted_residue_edge_weighted_cauchy n Δ D source old μ hρ0.le hV0 hv0 hμ B phase hphase F).trans (mul_le_mul_of_nonneg_right (unrestricted_edge_row_mass_le source old (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ hρ0 hρ1 hv hvmin hV hμ hmass (unrestrictedResidueEligible n Δ D old) (unrestrictedResidueEligible_translated_hit n Δ D old) T ht) (unrestricted_edge_gated_square_mass_nonneg source old Sigma.fst (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ hρ0.le hV0 hv0.le hμ (unrestrictedResidueEligible n Δ D old) B _ (by intros; split_ifs <;> norm_num) F)) /- The retained-mask square mass is precisely the phase-one physical edge applied to the divided squared-norm test. This is the interface for adjointness. -/ theorem unrestricted_residue_square_mass_eq_action (ρ V v : ℝ) (B : ℕ) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : (unrestrictedResidueEdgeSquareMass n Δ D source old μ ρ V v B F : ℂ) = unrestrictedResidueEdgeAction n Δ D source old μ ρ V B (fun _ _ _ _ => 1) (fun target memory => ((‖F target memory‖ ^ 2 / v ^ memory.1 : ℝ) : ℂ)) := by unfold unrestrictedResidueEdgeSquareMass unrestrictedEdgeGatedSquareMass unrestrictedResidueEdgeAction unrestrictedEdgeAction simp only [Complex.ofReal_sum] apply sum_congr rfl intro stores hs apply sum_congr rfl intro promotions hp apply sum_congr rfl intro e he apply sum_congr rfl intro fresh hf split_ifs <;> simp [Complex.ofReal_mul] end end section open Finset Classical open scoped ComplexConjugate noncomputable def unrestrictedCanonicalStitch {I P : Type*} [DecidableEq I] (S : Finset I) (s : Fin S.card → P) (d : UnrestrictedFreshLabels P S) : I → P := unrestrictedTargetLabels S (fun i => s (S.equivFin i)) d theorem unrestricted_canonical_stored_tuple {P Z : Type*} {t : ℕ} (S : Finset (Fin t)) (s : Fin S.card → P) (d : UnrestrictedFreshLabels P S) (seed : P → Z) : unrestrictedStoredTuple (unrestrictedCanonicalStitch S s d) seed S = seed ∘ s := by funext i unfold unrestrictedStoredTuple retainedOrderedTuple unrestrictedCanonicalStitch simp only [Function.comp_apply, unrestrictedTargetLabels_promoted, Equiv.apply_symm_apply] theorem unrestricted_canonical_storage_allowed {P : Type*} {t : ℕ} (n : P → ℕ) (D : ℤ) (S : Finset (Fin t)) (s : Fin S.card → P) (d : UnrestrictedFreshLabels P S) : unrestrictedResidueStorageAllowed n D (unrestrictedCanonicalStitch S s d) S ↔ ∀ i, ¬ (n (s i) : ℤ) ∣ D := by constructor · intro h i have hi := h (S.equivFin.symm i).val (S.equivFin.symm i).property simpa only [unrestrictedCanonicalStitch, unrestrictedTargetLabels_promoted, Equiv.apply_symm_apply] using hi · intro h i hi have hs := h (S.equivFin ⟨i, hi⟩) simpa only [unrestrictedCanonicalStitch, unrestrictedTargetLabels, dif_pos hi] using hs /- The entire active-label product integral splits into a stored ordered tuple and its complementary source slots. No factorial is introduced. -/ theorem unrestricted_canonical_active_sum {P E : Type*} [Fintype P] [AddCommMonoid E] [Module ℝ E] {t : ℕ} (μ : P → ℝ) (S : Finset (Fin t)) (F : (Fin t → P) → E) : (∑ source : Fin t → P, (∏ i, μ (source i)) • F source) = ∑ s : Fin S.card → P, ∑ d : UnrestrictedFreshLabels P S, ((∏ i, μ (s i)) * unrestrictedFreshWeight μ S d) • F (unrestrictedCanonicalStitch S s d) := by rw [unrestricted_active_sum_split μ S F] have hstore := unrestricted_store_sum_equivFin μ S (fun s : S → P => ∑ d : UnrestrictedFreshLabels P S, unrestrictedFreshWeight μ S d • F (unrestrictedTargetLabels S s d)) simp_rw [smul_sum, smul_smul] at hstore exact hstore /- Fixed source-storage labels and fixed old memory reduce the literal promotion-slot sum to the ordered promotion slots of the transfer block. -/ theorem unrestricted_canonical_choice_sum {P : Type*} [Fintype P] {t N : ℕ} (n : P → ℕ) (μ : P → ℝ) (Δ D : ℤ) (S T : Finset (Fin t)) (s : Fin S.card → P) (d : UnrestrictedFreshLabels P S) (q : Fin N → UnrestrictedResidueParticle n) (F : (Fin t → P) → (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : (∑ e : T ↪ ↥(unrestrictedResidueEligible n Δ D q), ∑ f : UnrestrictedFreshLabels P T, (unrestrictedFreshWeight μ T f : ℂ) * if unrestrictedResidueStorageAllowed n D (unrestrictedCanonicalStitch S s d) S then F (unrestrictedCanonicalStitch S s d) (unrestrictedEdgeTarget q Sigma.fst T e f) ⟨N, q⟩ (unrestrictedEdgeOutput (unrestrictedCanonicalStitch S s d) q (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) S T e) else 0) = ∑ e : Fin T.card ↪ ↥(unrestrictedResidueEligible n Δ D q), ∑ f : UnrestrictedFreshLabels P T, (unrestrictedFreshWeight μ T f : ℂ) * if ∀ i, ¬ (n (s i) : ℤ) ∣ D then F (unrestrictedCanonicalStitch S s d) (unrestrictedCanonicalStitch T (fun i => (q (e i).val).1) f) ⟨N, q⟩ (unrestrictedEdgeMemory q (unrestrictedResidueTransport n Δ) (unrestrictedResidueSeed n ∘ s) e) else 0 := by simp only [unrestrictedEdgeTarget, unrestrictedEdgeOutput, unrestricted_canonical_stored_tuple, unrestricted_canonical_storage_allowed] exact unrestricted_promotion_slot_sum T (unrestrictedResidueEligible n Δ D q) q (unrestrictedResidueTransport n Δ) (unrestrictedResidueSeed n ∘ s) (fun p Y => ∑ f : UnrestrictedFreshLabels P T, (unrestrictedFreshWeight μ T f : ℂ) * if ∀ i, ¬ (n (s i) : ℤ) ∣ D then F (unrestrictedCanonicalStitch S s d) (unrestrictedTargetLabels T (fun i => (p i).1) f) ⟨N, q⟩ Y else 0) /- Pairing for one fixed pair of storage/promotion slot subsets. Input active labels and old memory carry their full product/factorial measure. -/ noncomputable def unrestrictedFixedSlotPairing {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (t N : ℕ) (S T : Finset (Fin t)) (F : (Fin t → P) → (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : ℂ := (∑ source : Fin t → P, ((∏ i, μ (source i) : ℝ) : ℂ) * ∑ q : Fin N → UnrestrictedResidueParticle n, ((∏ j, unrestrictedResidueWeight μ (q j) : ℝ) : ℂ) * ∑ e : T ↪ ↥(unrestrictedResidueEligible n Δ D q), ∑ f : UnrestrictedFreshLabels P T, (unrestrictedFreshWeight μ T f : ℂ) * if unrestrictedResidueStorageAllowed n D source S then F source (unrestrictedEdgeTarget q Sigma.fst T e f) ⟨N, q⟩ (unrestrictedEdgeOutput source q (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) S T e) else 0) / ((N.factorial : ℝ) : ℂ) /- Move the two complementary active-label sums outside the dependent old-memory/promotion sum, while placing stored labels innermost. -/ theorem unrestricted_nested_sum_reorder {A B C E M : Type*} {D : C → Type*} [Fintype A] [Fintype B] [Fintype C] [∀ c, Fintype (D c)] [Fintype E] [AddCommMonoid M] (f : A → B → (c : C) → D c → E → M) : (∑ a, ∑ b, ∑ c, ∑ d : D c, ∑ e, f a b c d e) = ∑ b, ∑ e, ∑ c, ∑ d : D c, ∑ a, f a b c d e := by rw [sum_comm] apply sum_congr rfl intro b hb calc _ = ∑ c, ∑ a, ∑ d : D c, ∑ e, f a b c d e := sum_comm _ = ∑ c, ∑ d : D c, ∑ e, ∑ a, f a b c d e := by apply sum_congr rfl intro c hc rw [sum_comm] apply sum_congr rfl intro d hd rw [sum_comm] _ = ∑ c, ∑ e, ∑ d : D c, ∑ a, f a b c d e := by apply sum_congr rfl intro c hc rw [sum_comm] _ = _ := sum_comm /- The full fixed-slot pairing is exactly the ordered transfer block, integrated over source slots that were discarded and target slots drawn fresh. This equality requires no memory symmetry. -/ theorem unrestricted_fixed_slot_pairing_decompose {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (t N : ℕ) (S T : Finset (Fin t)) (F : (Fin t → P) → (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : unrestrictedFixedSlotPairing n μ Δ D t N S T F = ∑ d : UnrestrictedFreshLabels P S, ∑ f : UnrestrictedFreshLabels P T, ((unrestrictedFreshWeight μ S d * unrestrictedFreshWeight μ T f : ℝ) : ℂ) * unrestrictedOrderedTransferBlock n μ Δ D N T.card S.card (fun p s X Y => if ∀ i, ¬ (n (s i) : ℤ) ∣ D then F (unrestrictedCanonicalStitch S s d) (unrestrictedCanonicalStitch T p f) X Y else 0) := by unfold unrestrictedFixedSlotPairing have hs := unrestricted_canonical_active_sum μ S (fun source => ∑ q : Fin N → UnrestrictedResidueParticle n, ((∏ j, unrestrictedResidueWeight μ (q j) : ℝ) : ℂ) * ∑ e : T ↪ ↥(unrestrictedResidueEligible n Δ D q), ∑ f : UnrestrictedFreshLabels P T, (unrestrictedFreshWeight μ T f : ℂ) * if unrestrictedResidueStorageAllowed n D source S then F source (unrestrictedEdgeTarget q Sigma.fst T e f) ⟨N, q⟩ (unrestrictedEdgeOutput source q (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) S T e) else 0) simp only [Complex.real_smul] at hs rw [hs] simp_rw [unrestricted_canonical_choice_sum] unfold unrestrictedOrderedTransferBlock simp_rw [mul_sum, sum_div, mul_div_assoc] rw [unrestricted_nested_sum_reorder] apply sum_congr rfl intro d hd apply sum_congr rfl intro f hf simp_rw [mul_sum] apply sum_congr rfl intro q hq apply sum_congr rfl intro e he apply sum_congr rfl intro s hs push_cast ring /- Exact reversal of the full fixed-slot edge pairing, including the active source measure and independent fresh target draws. Both memory arguments must be symmetric; the two active tuples remain fully ordered. -/ theorem unrestricted_fixed_slot_pairing_reverse {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (t k : ℕ) (S T : Finset (Fin t)) (F : (Fin t → P) → (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hX : ∀ source target Y, OrderedTupleSymmetric (fun X => F source target X Y)) (hY : ∀ source target X, OrderedTupleSymmetric (fun Y => F source target X Y)) : unrestrictedFixedSlotPairing n μ Δ D t (k + T.card) S T F = unrestrictedFixedSlotPairing n μ (-Δ) D t (k + S.card) T S (fun target source Y X => F source target X Y) := by rw [unrestricted_fixed_slot_pairing_decompose, unrestricted_fixed_slot_pairing_decompose] conv_rhs => rw [sum_comm] apply sum_congr rfl intro d hd apply sum_congr rfl intro f hf rw [mul_comm (unrestrictedFreshWeight μ T f) (unrestrictedFreshWeight μ S d)] congr 1 exact unrestricted_ordered_transfer_reverse n μ Δ D k T.card S.card (fun p s X Y => F (unrestrictedCanonicalStitch S s d) (unrestrictedCanonicalStitch T p f) X Y) (fun p s Y => hX _ _ Y) (fun p s X => hY _ _ X) /- A block with more promoted slots than old indices contributes zero. -/ theorem unrestricted_fixed_slot_pairing_eq_zero_of_lt {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (t N : ℕ) (S T : Finset (Fin t)) (hN : N < T.card) (F : (Fin t → P) → (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : unrestrictedFixedSlotPairing n μ Δ D t N S T F = 0 := by have hempty (q : Fin N → UnrestrictedResidueParticle n) : IsEmpty (T ↪ ↥(unrestrictedResidueEligible n Δ D q)) := by constructor intro e have hc : T.card ≤ N := by calc T.card = Fintype.card T := (Fintype.card_coe T).symm _ ≤ (unrestrictedResidueEligible n Δ D q).card := promotionSlots_card_le e _ ≤ (univ : Finset (Fin N)).card := card_le_card (subset_univ _) _ = N := by simp exact (Nat.not_le_of_gt hN) hc unfold unrestrictedFixedSlotPairing suffices hz : (∑ source : Fin t → P, ((∏ i, μ (source i) : ℝ) : ℂ) * ∑ q : Fin N → UnrestrictedResidueParticle n, ((∏ j, unrestrictedResidueWeight μ (q j) : ℝ) : ℂ) * ∑ e : T ↪ ↥(unrestrictedResidueEligible n Δ D q), ∑ f : UnrestrictedFreshLabels P T, (unrestrictedFreshWeight μ T f : ℂ) * if unrestrictedResidueStorageAllowed n D source S then F source (unrestrictedEdgeTarget q Sigma.fst T e f) ⟨N, q⟩ (unrestrictedEdgeOutput source q (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) S T e) else 0) = 0 by rw [hz, zero_div] apply sum_eq_zero intro source hs apply mul_eq_zero_of_right apply sum_eq_zero intro q hq let _ := hempty q simp end section open Finset theorem bounded_ordered_state_smul_sum_range_first {P Z E : Type*} [Fintype P] [Fintype Z] [AddCommMonoid E] [Module ℝ E] (μ : P → ℝ) (ν : Z → ℝ) (t B : ℕ) (F : (Fin t → P) → FiniteOrderedTuple Z → E) : (∑ s : BoundedOrderedState P Z t B, boundedOrderedStateWeight μ ν s • F s.1 (boundedOrderedTupleToFinite s.2)) = ∑ N ∈ range (B + 1), (1 / (N.factorial : ℝ)) • ∑ active : Fin t → P, ∑ q : Fin N → Z, ((∏ i, μ (active i)) * ∏ j, ν (q j)) • F active ⟨N, q⟩ := by rw [bounded_ordered_state_smul_sum_range, sum_comm] apply sum_congr rfl intro N hN rw [smul_sum] theorem bounded_ordered_state_complex_sum_range_first {P Z : Type*} [Fintype P] [Fintype Z] (μ : P → ℝ) (ν : Z → ℝ) (t B : ℕ) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) : (∑ s : BoundedOrderedState P Z t B, (boundedOrderedStateWeight μ ν s : ℂ) * F s.1 (boundedOrderedTupleToFinite s.2)) = ∑ N ∈ range (B + 1), ((1 / (N.factorial : ℝ) : ℝ) : ℂ) * ∑ active : Fin t → P, ∑ q : Fin N → Z, ((((∏ i, μ (active i)) * ∏ j, ν (q j)) : ℝ) : ℂ) * F active ⟨N, q⟩ := by simpa only [Complex.real_smul] using bounded_ordered_state_smul_sum_range_first μ ν t B F end section def BoundedOrderedSymmetric {P Z K : Type*} {t B : ℕ} (f : BoundedOrderedState P Z t B → K) : Prop := ∀ (active : Fin t → P) (N : Fin (B + 1)) (q : Fin N.val → Z) (τ : Equiv.Perm (Fin N.val)), f (active, ⟨N, q ∘ τ⟩) = f (active, ⟨N, q⟩) def boundedOrderedZeroExtension {P Z K : Type*} [Zero K] {t B : ℕ} (f : BoundedOrderedState P Z t B → K) (active : Fin t → P) (q : FiniteOrderedTuple Z) : K := if h : q.1 ≤ B then f (active, ⟨⟨q.1, Nat.lt_succ_of_le h⟩, q.2⟩) else 0 theorem boundedOrderedZeroExtension_of_le {P Z K : Type*} [Zero K] {t B : ℕ} (f : BoundedOrderedState P Z t B → K) (active : Fin t → P) (q : FiniteOrderedTuple Z) (h : q.1 ≤ B) : boundedOrderedZeroExtension f active q = f (active, ⟨⟨q.1, Nat.lt_succ_of_le h⟩, q.2⟩) := by simp only [boundedOrderedZeroExtension, dif_pos h] theorem boundedOrderedZeroExtension_apply {P Z K : Type*} [Zero K] {t B : ℕ} (f : BoundedOrderedState P Z t B → K) (s : BoundedOrderedState P Z t B) : boundedOrderedZeroExtension f s.1 (boundedOrderedTupleToFinite s.2) = f s := by rcases s with ⟨active, N, q⟩ exact boundedOrderedZeroExtension_of_le f active ⟨N.val, q⟩ (Nat.le_of_lt_succ N.isLt) theorem boundedOrderedZeroExtension_symmetric_iff {P Z K : Type*} [Zero K] {t B : ℕ} (f : BoundedOrderedState P Z t B → K) : (∀ active, OrderedTupleSymmetric (boundedOrderedZeroExtension f active)) ↔ BoundedOrderedSymmetric f := by constructor · intro hf active N q τ have h := hf active N.val q τ change boundedOrderedZeroExtension f active (boundedOrderedTupleToFinite (⟨N, q ∘ τ⟩ : BoundedOrderedTuple Z B)) = boundedOrderedZeroExtension f active (boundedOrderedTupleToFinite (⟨N, q⟩ : BoundedOrderedTuple Z B)) at h exact (boundedOrderedZeroExtension_apply f (active, ⟨N, q ∘ τ⟩)).symm.trans (h.trans (boundedOrderedZeroExtension_apply f (active, ⟨N, q⟩))) · intro hf active N q τ by_cases hN : N ≤ B · simp only [boundedOrderedZeroExtension, dif_pos hN] exact hf active ⟨N, Nat.lt_succ_of_le hN⟩ q τ · simp only [boundedOrderedZeroExtension, dif_neg hN] end section open Finset theorem dyadic_slot_sum_midpoint_error {N J r : ℕ} (hJN : J ≤ N) {scale eps : ℝ} (hscale : 0 ≤ scale) (heps : 0 ≤ eps) (f : ℕ → Fin r → ℝ) (hprefix : ∀ j ∈ Icc 0 J, ∀ k, |f j k - (11/10 : ℝ) * scale / 2^j| ≤ eps * scale / 2^j) (htail : ∀ j ∈ Ioc J N, ∀ k, 0 ≤ f j k ∧ f j k ≤ (6/5 : ℝ) * scale / 2^j) : |(∑ j ∈ Icc 0 N, ∑ k, f j k) - (11/5 : ℝ) * (r : ℝ) * scale| ≤ 2 * eps * (r : ℝ) * scale + (6/5 : ℝ) * (r : ℝ) * scale / 2^J := by have hp : ∀ j ∈ Icc 0 J, |(∑ k, f j k) - (11/10 : ℝ) * ((r : ℝ) * scale) / 2^j| ≤ eps * ((r : ℝ) * scale) / 2^j := by intro j hj have hid : (∑ k, f j k) - (11/10 : ℝ) * ((r : ℝ) * scale) / 2^j = ∑ k, (f j k - (11/10 : ℝ) * scale / 2^j) := by rw [sum_sub_distrib] simp only [sum_const, card_univ, Fintype.card_fin, nsmul_eq_mul] ring rw [hid] refine (abs_sum_le_sum_abs _ _).trans ((sum_le_sum (fun k _ => hprefix j hj k)).trans_eq ?_) simp only [sum_const, card_univ, Fintype.card_fin, nsmul_eq_mul] ring have ht : ∀ j ∈ Ioc J N, 0 ≤ (∑ k, f j k) ∧ (∑ k, f j k) ≤ (6/5 : ℝ) * ((r : ℝ) * scale) / 2^j := by intro j hj refine ⟨sum_nonneg (fun k _ => (htail j hj k).1), ?_⟩ calc _ ≤ ∑ _k : Fin r, (6/5 : ℝ) * scale / 2^j := sum_le_sum (fun k _ => (htail j hj k).2) _ = _ := by simp only [sum_const, card_univ, Fintype.card_fin, nsmul_eq_mul] ring have h := dyadic_sum_midpoint_error hJN (mul_nonneg (Nat.cast_nonneg r) hscale) heps (fun j => ∑ k, f j k) hp ht simpa only [mul_assoc] using h theorem candidate_midpoint_error_small {N J r : ℕ} (hJN : J ≤ N) {c L eps : ℝ} (hcL : 0 ≤ c * L) (heps : 0 ≤ eps) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hepsr : eps * (r : ℝ) ≤ 1/400) (hJ : 1000 * (r : ℝ) ≤ 2^J) (f : ℕ → Fin r → ℝ) (hprefix : ∀ j ∈ Icc 0 J, ∀ k, |f j k - (11/10 : ℝ) * (c * L) / 2^j| ≤ eps * (c * L) / 2^j) (htail : ∀ j ∈ Ioc J N, ∀ k, 0 ≤ f j k ∧ f j k ≤ (6/5 : ℝ) * (c * L) / 2^j) : |(∑ j ∈ Icc 0 N, ∑ k, f j k) - L| ≤ c * L / 100 := by have h := dyadic_slot_sum_midpoint_error hJN hcL heps f hprefix htail have hcenteq : (11/5 : ℝ) * (r : ℝ) * (c * L) = L := by nlinarith [congrArg (fun x : ℝ => x * L) hcenter] rw [hcenteq] at h have hp : 2 * eps * (r : ℝ) * (c * L) ≤ (1/200 : ℝ) * (c * L) := by have h := mul_le_mul_of_nonneg_right hepsr hcL nlinarith have ht : (6/5 : ℝ) * (r : ℝ) * (c * L) / 2^J ≤ (3/2500 : ℝ) * (c * L) := by apply (div_le_iff₀ (by positivity : (0 : ℝ) < 2^J)).mpr have hmul := mul_le_mul_of_nonneg_right hJ hcL nlinarith exact h.trans (by nlinarith) /- Adding a small P-part still leaves a fixed margin for the free prime. -/ theorem candidate_free_log_window_of_midpoint {c L total rest pLog : ℝ} (hmid : |total - L| ≤ c * L / 100) (hrest : rest = total - (11/10 : ℝ) * (c * L) + pLog) (hp0 : 0 ≤ pLog) (hp1 : pLog ≤ c * L / 100) (hlarge : Real.log 16 ≤ c * L / 20) : c * L ≤ L - rest ∧ L - rest + Real.log 16 ≤ (6/5 : ℝ) * c * L := by have hm := abs_le.mp hmid have hlog : 0 < Real.log 16 := Real.log_pos (by norm_num) constructor <;> nlinarith end section end section open Finset open scoped Classical section variable {P Z : Type*} [sharedInstance1 : Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (label : Z → P) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V : ℝ) (eligible : Finset (Fin N)) (B : ℕ) include P Z sharedInstance1 t N source old label seed transport hit μ ρ V eligible B /- The empty-choice mask extracts precisely the clean event sum from the actual unrestricted action, including its original output-memory cutoff. -/ theorem unrestricted_edge_action_clean_extract (θ : (Fin t → P) → ℂ) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) : unrestrictedEdgeAction source old label seed transport hit μ ρ V eligible B (fun stores promotions e fresh => if stores = ∅ ∧ promotions = ∅ then θ (unrestrictedEdgeTarget old label promotions e fresh) else 0) F = ∑ fresh : UnrestrictedFreshLabels P (∅ : Finset (Fin t)), (unrestrictedEdgeEventMass source old seed transport hit μ ρ V ∅ ∅ (unrestrictedCleanPromotion t eligible) fresh : ℂ) * θ (unrestrictedEdgeTarget old label ∅ (unrestrictedCleanPromotion t eligible) fresh) * (if (unrestrictedEdgeOutput source old seed transport ∅ ∅ (unrestrictedCleanPromotion t eligible)).1 ≤ B then F (unrestrictedEdgeTarget old label ∅ (unrestrictedCleanPromotion t eligible) fresh) (unrestrictedEdgeOutput source old seed transport ∅ ∅ (unrestrictedCleanPromotion t eligible)) else 0) := by unfold unrestrictedEdgeAction rw [sum_eq_single ∅] · rw [sum_eq_single ∅] · rw [sum_eq_single (unrestrictedCleanPromotion t eligible)] · simp only [true_and, if_true] · intro e _ he exact (he (unrestricted_clean_promotion_unique eligible e)).elim · intro h exact (h (mem_univ _)).elim · intro promotions _ hp simp only [hp, and_false, if_false, mul_zero, zero_mul, sum_const_zero] · intro h exact (h (mem_univ _)).elim · intro stores _ hs simp only [hs, false_and, if_false, mul_zero, zero_mul, sum_const_zero] · intro h exact (h (mem_univ _)).elim /- The clean action is zero above the actual old-memory cutoff, independently of symmetry or any size bound on the continuation. -/ theorem unrestricted_edge_action_clean_of_cutoff (hB : ¬ N ≤ B) (θ : (Fin t → P) → ℂ) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) : unrestrictedEdgeAction source old label seed transport hit μ ρ V eligible B (fun stores promotions e fresh => if stores = ∅ ∧ promotions = ∅ then θ (unrestrictedEdgeTarget old label promotions e fresh) else 0) F = 0 := by rw [unrestricted_edge_action_clean_extract] simp only [unrestricted_clean_output_length, if_neg hB, mul_zero, sum_const_zero] /- The complete clean part of the actual action on arbitrary repeated ordered memory. Symmetry is used only to identify the retained-tuple enumeration with the transported old order. Fresh target labels remain fully unrestricted. -/ theorem unrestricted_edge_action_clean (θ : (Fin t → P) → ℂ) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) (hF : ∀ target, OrderedTupleSymmetric (F target)) : unrestrictedEdgeAction source old label seed transport hit μ ρ V eligible B (fun stores promotions e fresh => if stores = ∅ ∧ promotions = ∅ then θ (unrestrictedEdgeTarget old label promotions e fresh) else 0) F = if N ≤ B then ((ρ ^ orderedPredicateCount ⟨N, old⟩ hit * ρ ^ orderedPredicateCount ⟨N, transport ∘ old⟩ hit : ℝ) : ℂ) * ∑ target : Fin t → P, ((∏ j, μ (target j) : ℝ) : ℂ) * θ target * F target ⟨N, transport ∘ old⟩ else 0 := by by_cases hB : N ≤ B · rw [if_pos hB, unrestricted_edge_action_clean_extract] simp only [unrestricted_clean_output_length, if_pos hB] have hsym : ∀ target, OrderedTupleSymmetric (fun q => θ target * F target q) := by intro target n p e exact congrArg (fun z : ℂ => θ target * z) (hF target n p e) simpa only [mul_assoc] using unrestricted_clean_symmetric_continuation source old label seed transport hit μ ρ V eligible (fun target q => θ target * F target q) hsym · rw [if_neg hB] exact unrestricted_edge_action_clean_of_cutoff source old label seed transport hit μ ρ V eligible B hB θ F end end section open Finset open scoped Classical noncomputable def repeatedBigActiveMass {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (source : RepeatedBigLists P J ell) : ℝ := ∏ g, ∏ s, tiltedPhysicalBirthLaw V g (b g) (source g s) noncomputable def repeatedBigFreshMass {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (fresh : RepeatedBigFresh P C ell) : ℝ := ∏ g, ∏ s, tiltedPhysicalBirthLaw V g (b g) (fresh g s) noncomputable def repeatedBigTargetMass {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (target : RepeatedBigLists P J ell) : ℝ := ∏ g, ∏ s : {s : PhysicalSlots J ell // repeatedBigUnshared C g s}, tiltedPhysicalBirthLaw V g (b g) (target g s.val) section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (source : RepeatedBigLists P J ell) include G sharedInstance1 P J ell V b C source theorem repeated_big_fill_mass (fresh : RepeatedBigFresh P C ell) : repeatedBigTargetMass V b C (repeatedBigFill C source fresh) = repeatedBigFreshMass V b C fresh := by unfold repeatedBigTargetMass repeatedBigFreshMass simp_rw [repeated_big_fill_unshared] theorem repeated_big_weighted_target_sum (F : RepeatedBigLists P J ell → ℂ) : (∑ fresh : RepeatedBigFresh P C ell, (repeatedBigFreshMass V b C fresh : ℂ) * F (repeatedBigFill C source fresh)) = ∑ target : RepeatedBigLists P J ell, if repeatedBigSharedCompatible C source target then (repeatedBigTargetMass V b C target : ℂ) * F target else 0 := by have h := repeated_big_target_sum C source (fun target => (repeatedBigTargetMass V b C target : ℂ) * F target) simpa only [repeated_big_fill_mass] using h end def repeatedBigAuxAvoids {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (labels : RepeatedBigLists P J ell) : Prop := ∀ g (j : C g) s, aux g j ≠ labels g s noncomputable def repeatedBigD {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (source : RepeatedBigLists P J ell) (aux : PhysicalAuxLabels P C) : ℕ := ∏ g, ((∏ j ∈ univ \ C g, (source g (Sum.inl j)).val) * ∏ j : C g, (aux g j).val) theorem repeated_big_D_eq_of_shared {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) {source target : RepeatedBigLists P J ell} (h : repeatedBigSharedCompatible C source target) (aux : PhysicalAuxLabels P C) : repeatedBigD C source aux = repeatedBigD C target aux := by unfold repeatedBigD apply prod_congr rfl intro g _ congr 1 apply prod_congr rfl intro j hj rw [h g j (mem_sdiff.mp hj).2] /- The free-label law is untilted; only fresh active target labels are tilted. There is no additional completion normalization after those tilted factors. -/ noncomputable def repeatedBigKernel {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (source target : RepeatedBigLists P J ell) : ℂ := by classical exact if repeatedBigSharedCompatible C source target ∧ repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target then ((physicalAuxMass V C aux * repeatedBigTargetMass V b C target : ℝ) : ℂ) * K source target aux * physicalPhase ζ (repeatedBigD C source aux) else 0 /- Explicit fresh integration and the full repeated target-list kernel agree. -/ theorem repeated_big_kernel_row {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (source : RepeatedBigLists P J ell) (F : RepeatedBigLists P J ell → ℂ) : (∑ fresh : RepeatedBigFresh P C ell, if repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux (repeatedBigFill C source fresh) then ((physicalAuxMass V C aux * repeatedBigFreshMass V b C fresh : ℝ) : ℂ) * K source (repeatedBigFill C source fresh) aux * physicalPhase ζ (repeatedBigD C source aux) * F (repeatedBigFill C source fresh) else 0) = ∑ target : RepeatedBigLists P J ell, repeatedBigKernel V b C ζ K aux source target * F target := by have h := repeated_big_weighted_target_sum V b C source (fun target => if repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target then (physicalAuxMass V C aux : ℂ) * K source target aux * physicalPhase ζ (repeatedBigD C source aux) * F target else 0) calc _ = _ := ?_ _ = _ := h _ = _ := ?_ · apply sum_congr rfl intro fresh _ split_ifs <;> push_cast <;> ring · apply sum_congr rfl intro target _ unfold repeatedBigKernel by_cases hs : repeatedBigSharedCompatible C source target · by_cases hb : repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target · simp only [and_true, hs, hb, if_true] push_cast ring · simp [hs, hb] · simp [hs] end section open Finset Classical abbrev UnrestrictedBoundedPhase {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) := ∀ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B, ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ ↥(unrestrictedResidueEligible n Δ D s.2.2)) → UnrestrictedFreshLabels P promotions → ℂ noncomputable def unrestrictedBoundedAction {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (phase : UnrestrictedBoundedPhase n Δ D t B) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : ℂ := unrestrictedResidueEdgeAction n Δ D s.1 s.2.2 μ ρ V B (phase s) F noncomputable def unrestrictedBoundedPositive {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ := unrestrictedBoundedAction n Δ D μ ρ V t B (fun _ _ _ _ _ => 1) F /- The reversed displacement is `-Δ`; its ratio retains the original promotion normalization after exchanging stores and promotions. -/ noncomputable def unrestrictedBoundedReverse {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ := unrestrictedBoundedAction n (-Δ) D μ ρ V t B (fun _ stores promotions _ _ => ((V ^ promotions.card / V ^ stores.card : ℝ) : ℂ)) F /- Concrete full positive/reverse duality on symmetric memory tests. The bounded source type and the row cutoff restrict both endpoint memory sizes. -/ def UnrestrictedBoundedDuality {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) : Prop := ∀ f g : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ, (∀ active, OrderedTupleSymmetric (f active)) → (∀ active, OrderedTupleSymmetric (g active)) → (∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B, (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * f s.1 (boundedOrderedTupleToFinite s.2) * unrestrictedBoundedPositive n Δ D μ ρ V t B g s) = ∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B, (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * unrestrictedBoundedReverse n Δ D μ ρ V t B f s * g s.1 (boundedOrderedTupleToFinite s.2) noncomputable def unrestrictedMemoryWeightTest {P Z : Type*} {t : ℕ} (v : ℝ) (_active : Fin t → P) (q : FiniteOrderedTuple Z) : ℂ := (v ^ q.1 : ℝ) noncomputable def unrestrictedDividedSquareTest {P Z : Type*} {t : ℕ} (v : ℝ) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) (active : Fin t → P) (q : FiniteOrderedTuple Z) : ℂ := ((‖F active q‖ ^ 2 / v ^ q.1 : ℝ) : ℂ) theorem unrestrictedMemoryWeightTest_symmetric {P Z : Type*} {t : ℕ} (v : ℝ) (active : Fin t → P) : OrderedTupleSymmetric (unrestrictedMemoryWeightTest (Z := Z) v active) := by intro N q e rfl theorem unrestrictedDividedSquareTest_symmetric {P Z : Type*} {t : ℕ} (v : ℝ) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) (hF : ∀ active, OrderedTupleSymmetric (F active)) (active : Fin t → P) : OrderedTupleSymmetric (unrestrictedDividedSquareTest v F active) := by intro N q e unfold unrestrictedDividedSquareTest rw [hF active N q e] theorem unrestricted_bounded_action_cauchy {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) {ρ V v vmin : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : vmin ≤ V) (hμ : ∀ p, 0 ≤ μ p) (hmass : ∑ p, μ p ≤ 2) (t B T : ℕ) (ht : t ≤ T) (phase : UnrestrictedBoundedPhase n Δ D t B) (hphase : ∀ s stores promotions e fresh, ‖phase s stores promotions e fresh‖ ≤ 1) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : ‖unrestrictedBoundedAction n Δ D μ ρ V t B phase F s‖ ^ 2 ≤ unrestrictedEdgeRowBound ρ v vmin T * v ^ s.2.1.val * (unrestrictedBoundedPositive n Δ D μ ρ V t B (unrestrictedDividedSquareTest v F) s).re := by have hc := unrestricted_residue_edge_sq_le_row_bound n Δ D s.1 s.2.2 μ hρ0 hρ1 hv hvmin hV hμ hmass B T ht (phase s) (hphase s) F have heq := congrArg Complex.re (unrestricted_residue_square_mass_eq_action n Δ D s.1 s.2.2 μ ρ V v B F) have hsquare : unrestrictedResidueEdgeSquareMass n Δ D s.1 s.2.2 μ ρ V v B F = (unrestrictedBoundedPositive n Δ D μ ρ V t B (unrestrictedDividedSquareTest v F) s).re := by change unrestrictedResidueEdgeSquareMass n Δ D s.1 s.2.2 μ ρ V v B F = (unrestrictedResidueEdgeAction n Δ D s.1 s.2.2 μ ρ V B (fun _ _ _ _ => 1) (fun target memory => ((‖F target memory‖ ^ 2 / v ^ memory.1 : ℝ) : ℂ))).re simpa only [Complex.ofReal_re] using heq calc _ ≤ (v ^ s.2.1.val * unrestrictedEdgeRowBound ρ v vmin T) * unrestrictedResidueEdgeSquareMass n Δ D s.1 s.2.2 μ ρ V v B F := hc _ = _ := by rw [hsquare]; ring theorem unrestricted_bounded_reverse_weight_le {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) {ρ V v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : vmin ≤ V) (hVhi : V ≤ vmax) (hμ : ∀ p, 0 ≤ μ p) (hmass : ∑ p, μ p ≤ 2) (t B T : ℕ) (ht : t ≤ T) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : (unrestrictedBoundedReverse n Δ D μ ρ V t B (unrestrictedMemoryWeightTest v) s).re ≤ (unrestrictedEdgeRowBound ρ v vmin T * unrestrictedEdgeReversalBound vmin vmax T) * v ^ s.2.1.val := by have hv0 : 0 ≤ v := (zero_lt_one.trans hv).le have hb := unrestricted_reverse_residue_edge_action_norm_le n (-Δ) D s.1 s.2.2 μ hρ0 hρ1 hv hvmin hVlo hVhi (C := 1) (by norm_num) hμ hmass B T ht (fun _ _ _ _ => 1) (by intros; norm_num) (unrestrictedMemoryWeightTest v) (by intro active memory _ simp only [unrestrictedMemoryWeightTest, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (pow_nonneg hv0 _), one_mul, le_refl]) have hb' : ‖unrestrictedBoundedReverse n Δ D μ ρ V t B (unrestrictedMemoryWeightTest v) s‖ ≤ (unrestrictedEdgeRowBound ρ v vmin T * unrestrictedEdgeReversalBound vmin vmax T) * v ^ s.2.1.val := by simpa only [unrestrictedBoundedReverse, unrestrictedBoundedAction, mul_one, one_mul, mul_assoc, mul_comm, mul_left_comm] using hb exact (Complex.re_le_norm _).trans hb' /- The literal phase-bounded edge satisfies the finite energy estimate once its concrete positive/reverse pairing identity has been established. No symmetry of the phase or of the resulting output function is required. -/ theorem unrestricted_bounded_energy_le_of_duality {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) (μ : P → ℝ) {ρ V v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : vmin ≤ V) (hVhi : V ≤ vmax) (hμ : ∀ p, 0 ≤ μ p) (hmass : ∑ p, μ p ≤ 2) (t B T : ℕ) (ht : t ≤ T) (hduality : UnrestrictedBoundedDuality n Δ D μ ρ V t B) (phase : UnrestrictedBoundedPhase n Δ D t B) (hphase : ∀ s stores promotions e fresh, ‖phase s stores promotions e fresh‖ ≤ 1) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hF : ∀ active, OrderedTupleSymmetric (F active)) : (∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B, boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s * ‖unrestrictedBoundedAction n Δ D μ ρ V t B phase F s‖ ^ 2) ≤ (unrestrictedEdgeRowBound ρ v vmin T) ^ 2 * unrestrictedEdgeReversalBound vmin vmax T * ∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B, boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s * ‖F s.1 (boundedOrderedTupleToFinite s.2)‖ ^ 2 := by let S := BoundedOrderedState P (UnrestrictedResidueParticle n) t B let m : S → ℝ := boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) let w : S → ℝ := fun s => v ^ s.2.1.val let A : S → ℂ := unrestrictedBoundedPositive n Δ D μ ρ V t B (unrestrictedDividedSquareTest v F) let E : S → ℂ := unrestrictedBoundedReverse n Δ D μ ρ V t B (unrestrictedMemoryWeightTest v) let R := unrestrictedEdgeRowBound ρ v vmin T let H := unrestrictedEdgeReversalBound vmin vmax T have hm : ∀ s, 0 ≤ m s := fun s => boundedOrderedStateWeight_nonneg μ (unrestrictedResidueWeight μ) hμ (fun z => hμ z.1) s have hw : ∀ s, 0 < w s := fun s => pow_pos (zero_lt_one.trans hv) _ have hR : 0 ≤ R := by unfold R unrestrictedEdgeRowBound unrestrictedEdgeChoiceBound have hd := unrestrictedEdgeDampingBound_nonneg (vmin := vmin) hρ1 T have hv0 := (zero_lt_one.trans hv).le positivity have hp := hduality (unrestrictedMemoryWeightTest v) (unrestrictedDividedSquareTest v F) (unrestrictedMemoryWeightTest_symmetric v) (unrestrictedDividedSquareTest_symmetric v F hF) change (∑ s : S, (m s : ℂ) * (w s : ℂ) * A s) = ∑ s : S, (m s : ℂ) * E s * ((‖F s.1 (boundedOrderedTupleToFinite s.2)‖ ^ 2 / w s : ℝ) : ℂ) at hp have h := finite_weighted_energy_of_complex_pairing m m w w A E (unrestrictedBoundedAction n Δ D μ ρ V t B phase F) (fun s => F s.1 (boundedOrderedTupleToFinite s.2)) (R := R) (C := R * H) hm hm hw hR (fun s => unrestricted_bounded_action_cauchy n Δ D μ hρ0 hρ1 hv hvmin hVlo hμ hmass t B T ht phase hphase F s) hp (fun s => unrestricted_bounded_reverse_weight_le n Δ D μ hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass t B T ht s) calc _ ≤ R * (R * H) * ∑ s : S, m s * ‖F s.1 (boundedOrderedTupleToFinite s.2)‖ ^ 2 := h _ = _ := by dsimp only [R, H, m, S]; ring /- An actual map on functions on the finite bounded state space. -/ noncomputable def unrestrictedBoundedOperator {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (phase : UnrestrictedBoundedPhase n Δ D t B) (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ := unrestrictedBoundedAction n Δ D μ ρ V t B phase (boundedOrderedZeroExtension f) /- Finite-state version: the input is only defined on the bounded state space and is symmetric there. The output is allowed to be nonsymmetric. -/ theorem unrestricted_bounded_operator_energy_le_of_duality {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) (μ : P → ℝ) {ρ V v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : vmin ≤ V) (hVhi : V ≤ vmax) (hμ : ∀ p, 0 ≤ μ p) (hmass : ∑ p, μ p ≤ 2) (t B T : ℕ) (ht : t ≤ T) (hduality : UnrestrictedBoundedDuality n Δ D μ ρ V t B) (phase : UnrestrictedBoundedPhase n Δ D t B) (hphase : ∀ s stores promotions e fresh, ‖phase s stores promotions e fresh‖ ≤ 1) (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) (hf : BoundedOrderedSymmetric f) : (∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B, boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s * ‖unrestrictedBoundedOperator n Δ D μ ρ V t B phase f s‖ ^ 2) ≤ (unrestrictedEdgeRowBound ρ v vmin T) ^ 2 * unrestrictedEdgeReversalBound vmin vmax T * ∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B, boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s * ‖f s‖ ^ 2 := by have h := unrestricted_bounded_energy_le_of_duality n Δ D μ hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass t B T ht hduality phase hphase (boundedOrderedZeroExtension f) ((boundedOrderedZeroExtension_symmetric_iff f).mpr hf) simpa only [unrestrictedBoundedOperator, boundedOrderedZeroExtension_apply] using h end section open Finset Classical theorem unrestricted_sum_pair_swap {A B C D M : Type*} [Fintype A] [Fintype B] [Fintype C] [Fintype D] [AddCommMonoid M] (f : A → B → C → D → M) : (∑ a, ∑ b, ∑ c, ∑ d, f a b c d) = ∑ c, ∑ d, ∑ a, ∑ b, f a b c d := by calc _ = ∑ a, ∑ c, ∑ d, ∑ b, f a b c d := by apply sum_congr rfl intro a ha rw [sum_comm] apply sum_congr rfl intro c hc rw [sum_comm] _ = _ := by rw [sum_comm] apply sum_congr rfl intro c hc rw [sum_comm] noncomputable def unrestrictedDampedPair {P : Type*} {t : ℕ} (n : P → ℕ) (ρ : ℝ) (F H : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (source target : Fin t → P) (X Y : FiniteOrderedTuple (UnrestrictedResidueParticle n)) : ℂ := ((ρ ^ orderedPredicateCount X unrestrictedResidueHit * ρ ^ orderedPredicateCount Y unrestrictedResidueHit : ℝ) : ℂ) * F source X * H target Y section variable {P : Type*} {t : ℕ} (n : P → ℕ) (ρ : ℝ) (F H : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) include P t n ρ F H theorem unrestricted_damped_pair_source_symmetric (hF : ∀ source, OrderedTupleSymmetric (F source)) (source target : Fin t → P) (Y : FiniteOrderedTuple (UnrestrictedResidueParticle n)) : OrderedTupleSymmetric (fun X => unrestrictedDampedPair n ρ F H source target X Y) := by intro N q e simp only [unrestrictedDampedPair, orderedPredicateCount_permutation, hF source N q e] theorem unrestricted_damped_pair_target_symmetric (hH : ∀ target, OrderedTupleSymmetric (H target)) (source target : Fin t → P) (X : FiniteOrderedTuple (UnrestrictedResidueParticle n)) : OrderedTupleSymmetric (fun Y => unrestrictedDampedPair n ρ F H source target X Y) := by intro N q e simp only [unrestrictedDampedPair, orderedPredicateCount_permutation, hH target N q e] end theorem unrestricted_fixed_slot_output_cutoff {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (t N B : ℕ) (S T : Finset (Fin t)) (F : (Fin t → P) → (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : unrestrictedFixedSlotPairing n μ Δ D t N S T (fun source target X Y => if Y.1 ≤ B then F source target X Y else 0) = if N - T.card + S.card ≤ B then unrestrictedFixedSlotPairing n μ Δ D t N S T F else 0 := by unfold unrestrictedFixedSlotPairing simp only [unrestrictedEdgeOutput, unrestrictedEdgeMemory_length, Fintype.card_coe] split_ifs with h · rfl · simp noncomputable def unrestrictedActionLevelPairing {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (ρ V : ℝ) (t N B : ℕ) (F H : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : ℂ := (∑ source : Fin t → P, ((∏ i, μ (source i) : ℝ) : ℂ) * ∑ q : Fin N → UnrestrictedResidueParticle n, ((∏ j, unrestrictedResidueWeight μ (q j) : ℝ) : ℂ) * F source ⟨N, q⟩ * unrestrictedResidueEdgeAction n Δ D source q μ ρ V B (fun _ _ _ _ => 1) H) / ((N.factorial : ℝ) : ℂ) theorem unrestricted_action_level_pairing_slots {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (ρ V : ℝ) (t N B : ℕ) (F H : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : unrestrictedActionLevelPairing n μ Δ D ρ V t N B F H = ∑ S : Finset (Fin t), ∑ T : Finset (Fin t), ((1 / V ^ T.card : ℝ) : ℂ) * unrestrictedFixedSlotPairing n μ Δ D t N S T (fun source target X Y => if Y.1 ≤ B then unrestrictedDampedPair n ρ F H source target X Y else 0) := by unfold unrestrictedActionLevelPairing unrestrictedResidueEdgeAction unrestrictedEdgeAction simp_rw [mul_sum, sum_div, mul_div_assoc] rw [unrestricted_sum_pair_swap] apply sum_congr rfl intro S hS apply sum_congr rfl intro T hT unfold unrestrictedFixedSlotPairing simp_rw [mul_sum, sum_div, mul_div_assoc] simp_rw [mul_sum] apply sum_congr rfl intro source hs apply sum_congr rfl intro q hq apply sum_congr rfl intro e he apply sum_congr rfl intro f hf unfold unrestrictedEdgeEventMass unrestrictedDampedPair split_ifs <;> push_cast <;> ring /- The output cutoff exchanges with the source-size summation exactly. -/ theorem unrestricted_fixed_slot_bounded_reverse {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (t Bsrc Btgt : ℕ) (S T : Finset (Fin t)) (F : (Fin t → P) → (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hX : ∀ source target Y, OrderedTupleSymmetric (fun X => F source target X Y)) (hY : ∀ source target X, OrderedTupleSymmetric (fun Y => F source target X Y)) : (∑ N ∈ range (Bsrc + 1), unrestrictedFixedSlotPairing n μ Δ D t N S T (fun source target X Y => if Y.1 ≤ Btgt then F source target X Y else 0)) = ∑ M ∈ range (Btgt + 1), unrestrictedFixedSlotPairing n μ (-Δ) D t M T S (fun target source Y X => if X.1 ≤ Bsrc then F source target X Y else 0) := by simp_rw [unrestricted_fixed_slot_output_cutoff] exact unrestricted_paired_size_reindex (fun N => unrestrictedFixedSlotPairing n μ Δ D t N S T F) (fun M => unrestrictedFixedSlotPairing n μ (-Δ) D t M T S (fun target source Y X => F source target X Y)) T.card S.card Bsrc Btgt (fun N hN => unrestricted_fixed_slot_pairing_eq_zero_of_lt n μ Δ D t N S T hN F) (fun M hM => unrestricted_fixed_slot_pairing_eq_zero_of_lt n μ (-Δ) D t M T S hM _) (fun k => unrestricted_fixed_slot_pairing_reverse n μ Δ D t k S T F hX hY) noncomputable def unrestrictedWeightedActionLevelPairing {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (ρ V : ℝ) (t N B : ℕ) (w : Finset (Fin t) → Finset (Fin t) → ℂ) (F H : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : ℂ := (∑ source : Fin t → P, ((∏ i, μ (source i) : ℝ) : ℂ) * ∑ q : Fin N → UnrestrictedResidueParticle n, ((∏ j, unrestrictedResidueWeight μ (q j) : ℝ) : ℂ) * F source ⟨N, q⟩ * unrestrictedResidueEdgeAction n Δ D source q μ ρ V B (fun S T _ _ => w S T) H) / ((N.factorial : ℝ) : ℂ) theorem unrestricted_weighted_action_level_pairing_slots {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (ρ V : ℝ) (t N B : ℕ) (w : Finset (Fin t) → Finset (Fin t) → ℂ) (F H : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : unrestrictedWeightedActionLevelPairing n μ Δ D ρ V t N B w F H = ∑ S : Finset (Fin t), ∑ T : Finset (Fin t), (w S T * ((1 / V ^ T.card : ℝ) : ℂ)) * unrestrictedFixedSlotPairing n μ Δ D t N S T (fun source target X Y => if Y.1 ≤ B then unrestrictedDampedPair n ρ F H source target X Y else 0) := by unfold unrestrictedWeightedActionLevelPairing unrestrictedResidueEdgeAction unrestrictedEdgeAction simp_rw [mul_sum, sum_div, mul_div_assoc] rw [unrestricted_sum_pair_swap] apply sum_congr rfl intro S hS apply sum_congr rfl intro T hT unfold unrestrictedFixedSlotPairing simp_rw [mul_sum, sum_div, mul_div_assoc] simp_rw [mul_sum] apply sum_congr rfl intro source hs apply sum_congr rfl intro q hq apply sum_congr rfl intro e he apply sum_congr rfl intro f hf unfold unrestrictedEdgeEventMass unrestrictedDampedPair split_ifs <;> push_cast <;> ring theorem unrestricted_three_sum_rotate {A B C M : Type*} [Fintype B] [Fintype C] [AddCommMonoid M] (S : Finset A) (f : A → B → C → M) : (∑ a ∈ S, ∑ b, ∑ c, f a b c) = ∑ b, ∑ c, ∑ a ∈ S, f a b c := by rw [sum_comm] apply sum_congr rfl intro b hb rw [sum_comm] /- Full finite product/factorial-measure duality for the phase-one residue edge, with both endpoint cutoffs and the exact reversed normalization. -/ theorem unrestricted_bounded_action_pairing_reverse {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (ρ : ℝ) {V : ℝ} (hV : V ≠ 0) (t Bsrc Btgt : ℕ) (F H : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hF : ∀ source, OrderedTupleSymmetric (F source)) (hH : ∀ target, OrderedTupleSymmetric (H target)) : (∑ N ∈ range (Bsrc + 1), unrestrictedActionLevelPairing n μ Δ D ρ V t N Btgt F H) = ∑ M ∈ range (Btgt + 1), unrestrictedWeightedActionLevelPairing n μ (-Δ) D ρ V t M Bsrc (fun S T => ((V ^ T.card / V ^ S.card : ℝ) : ℂ)) H F := by simp_rw [unrestricted_action_level_pairing_slots, unrestricted_weighted_action_level_pairing_slots] rw [unrestricted_three_sum_rotate, unrestricted_three_sum_rotate] conv_rhs => rw [sum_comm] apply sum_congr rfl intro S hS apply sum_congr rfl intro T hT conv_lhs => rw [← mul_sum] conv_rhs => rw [← mul_sum] have hc : ((V ^ S.card / V ^ T.card : ℝ) : ℂ) * ((1 / V ^ S.card : ℝ) : ℂ) = ((1 / V ^ T.card : ℝ) : ℂ) := by rw [← Complex.ofReal_mul] congr 1 field_simp conv_rhs => rw [hc] apply congrArg (fun z : ℂ => ((1 / V ^ T.card : ℝ) : ℂ) * z) have hreverse := unrestricted_fixed_slot_bounded_reverse n μ Δ D t Bsrc Btgt S T (unrestrictedDampedPair n ρ F H) (unrestricted_damped_pair_source_symmetric n ρ F H hF) (unrestricted_damped_pair_target_symmetric n ρ F H hH) refine hreverse.trans ?_ apply sum_congr rfl intro M hM apply congrArg (unrestrictedFixedSlotPairing n μ (-Δ) D t M T S) funext target source Y X split_ifs · unfold unrestrictedDampedPair push_cast ring · rfl end section open Finset noncomputable def candidateQMaxIndex (c L : ℝ) : ℕ := ⌊Real.log (c * L / (20 * Real.log L)) / Real.log 2⌋₊ theorem candidateQIndices_eq_Icc (c L : ℝ) : candidateQIndices c L = Icc 0 (candidateQMaxIndex c L) := rfl noncomputable def candidateFreeSlot (c L : ℝ) (r : ℕ) (hr : 0 < r) : (candidateQIndices c L) × Fin r := (⟨0, by simp [candidateQIndices]⟩, ⟨0, hr⟩) theorem candidate_free_slot_eq_iff (c L : ℝ) (r : ℕ) (hr : 0 < r) (slot : (candidateQIndices c L) × Fin r) : slot = candidateFreeSlot c L r hr ↔ slot.1.val = 0 ∧ slot.2.val = 0 := by simp only [candidateFreeSlot, Prod.ext_iff, Subtype.ext_iff, Fin.ext_iff] noncomputable def candidateCompletedLogArray (c L : ℝ) (r : ℕ) (hr : 0 < r) (x : (candidateQIndices c L) × Fin r → ℕ) (j : ℕ) (k : Fin r) : ℝ := by classical exact if hj : j ∈ candidateQIndices c L then completedSlotLog x (candidateFreeSlot c L r hr) ((11/10 : ℝ) * (c * L)) (⟨j, hj⟩, k) else 0 theorem candidate_completed_log_array_sum (c L : ℝ) (r : ℕ) (hr : 0 < r) (x : (candidateQIndices c L) × Fin r → ℕ) : (∑ j ∈ Icc 0 (candidateQMaxIndex c L), ∑ k, candidateCompletedLogArray c L r hr x j k) = ∑ slot, completedSlotLog x (candidateFreeSlot c L r hr) ((11/10 : ℝ) * (c * L)) slot := by classical rw [← candidateQIndices_eq_Icc] rw [← Finset.sum_coe_sort (candidateQIndices c L) (fun j => ∑ k, candidateCompletedLogArray c L r hr x j k)] rw [Fintype.sum_prod_type] apply sum_congr rfl intro j _ apply sum_congr rfl intro k _ simp only [candidateCompletedLogArray, dif_pos j.property] section variable {c L eps : ℝ} {r jStar J : ℕ} (hr : 0 < r) include c L eps r jStar J hr theorem candidate_completed_log_array_prefix (heps : 0 ≤ eps) (hcL : 0 ≤ c * L) (hJN : J ≤ candidateQMaxIndex c L) (x : (candidateQIndices c L) × Fin r → ℕ) (hx : ∀ slot, x slot ∈ candidatePrefixChoices c L eps r jStar J slot) : ∀ j ∈ Icc 0 J, ∀ k, |candidateCompletedLogArray c L r hr x j k - (11/10 : ℝ) * (c * L) / 2^j| ≤ eps * (c * L) / 2^j := by classical intro j hj k have hjmem : j ∈ candidateQIndices c L := mem_Icc.mpr ⟨Nat.zero_le _, (mem_Icc.mp hj).2.trans hJN⟩ rw [candidateCompletedLogArray, dif_pos hjmem] unfold completedSlotLog split_ifs with hfree · have hzero : j = 0 := ((candidate_free_slot_eq_iff c L r hr (⟨j, hjmem⟩, k)).mp hfree).1 subst j simp only [pow_zero, div_one, sub_self, abs_zero] exact mul_nonneg heps hcL · exact candidate_prefix_slot_log_deviation (⟨j, hjmem⟩, k) (mem_Icc.mp hj).2 (fun h => hfree ((candidate_free_slot_eq_iff c L r hr (⟨j, hjmem⟩, k)).mpr h)) (hx _) theorem candidate_completed_log_array_tail (hcL : 0 ≤ c * L) (heps : eps ≤ 1/10) (hJ : J < jStar) (x : (candidateQIndices c L) × Fin r → ℕ) (hx : ∀ slot, x slot ∈ candidatePrefixChoices c L eps r jStar J slot) : ∀ j ∈ Ioc J (candidateQMaxIndex c L), ∀ k, 0 ≤ candidateCompletedLogArray c L r hr x j k ∧ candidateCompletedLogArray c L r hr x j k ≤ (6/5 : ℝ) * (c * L) / 2^j := by classical intro j hj k have hjmem : j ∈ candidateQIndices c L := mem_Icc.mpr ⟨Nat.zero_le _, (mem_Ioc.mp hj).2⟩ have hfree : (⟨j, hjmem⟩, k) ≠ candidateFreeSlot c L r hr := by intro h have hz : j = 0 := ((candidate_free_slot_eq_iff c L r hr (⟨j, hjmem⟩, k)).mp h).1 have hJj := (mem_Ioc.mp hj).1 omega rw [candidateCompletedLogArray, dif_pos hjmem, completedSlotLog, if_neg hfree] exact candidate_prefix_slot_log_bounds hcL heps hJ (⟨j, hjmem⟩, k) (hx _) theorem candidate_completed_midpoint_error (hcL : 0 ≤ c * L) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1/10) (hJN : J ≤ candidateQMaxIndex c L) (hJstar : J < jStar) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hepsr : eps * (r : ℝ) ≤ 1/400) (hJ : 1000 * (r : ℝ) ≤ 2^J) (x : (candidateQIndices c L) × Fin r → ℕ) (hx : ∀ slot, x slot ∈ candidatePrefixChoices c L eps r jStar J slot) : |(∑ slot, completedSlotLog x (candidateFreeSlot c L r hr) ((11/10 : ℝ) * (c * L)) slot) - L| ≤ c * L / 100 := by rw [← candidate_completed_log_array_sum] exact candidate_midpoint_error_small hJN hcL heps0 hcenter hepsr hJ _ (candidate_completed_log_array_prefix hr heps0 hcL hJN x hx) (candidate_completed_log_array_tail hr hcL heps1 hJstar x hx) end end section open Finset open scoped Classical /- The actual residue action with empty storage and promotions transports the whole repeated memory and integrates unrestricted fresh targets. -/ theorem unrestricted_residue_edge_action_clean {P : Type*} [Fintype P] {t N : ℕ} (n : P → ℕ) (Δ D : ℤ) (source : Fin t → P) (old : Fin N → UnrestrictedResidueParticle n) (μ : P → ℝ) (ρ V : ℝ) (B : ℕ) (θ : (Fin t → P) → ℂ) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hF : ∀ target, OrderedTupleSymmetric (F target)) : unrestrictedResidueEdgeAction n Δ D source old μ ρ V B (fun stores promotions e fresh => if stores = ∅ ∧ promotions = ∅ then θ (unrestrictedEdgeTarget old Sigma.fst promotions e fresh) else 0) F = if N ≤ B then ((ρ ^ orderedPredicateCount ⟨N, old⟩ unrestrictedResidueHit * ρ ^ orderedPredicateCount ⟨N, unrestrictedResidueTransport n Δ ∘ old⟩ unrestrictedResidueHit : ℝ) : ℂ) * ∑ target : Fin t → P, ((∏ j, μ (target j) : ℝ) : ℂ) * θ target * F target ⟨N, unrestrictedResidueTransport n Δ ∘ old⟩ else 0 := by unfold unrestrictedResidueEdgeAction have hmask : (fun (stores promotions : Finset (Fin t)) (e : promotions ↪ unrestrictedResidueEligible n Δ D old) (fresh : UnrestrictedFreshLabels P promotions) => if unrestrictedResidueStorageAllowed n D source stores then (if stores = ∅ ∧ promotions = ∅ then θ (unrestrictedEdgeTarget old Sigma.fst promotions e fresh) else 0) else 0) = (fun (stores promotions : Finset (Fin t)) (e : promotions ↪ unrestrictedResidueEligible n Δ D old) (fresh : UnrestrictedFreshLabels P promotions) => if stores = ∅ ∧ promotions = ∅ then θ (unrestrictedEdgeTarget old Sigma.fst promotions e fresh) else 0) := by funext stores promotions e fresh by_cases hs : stores = ∅ · subst stores have hallowed : unrestrictedResidueStorageAllowed n D source ∅ := by intro i hi exact (notMem_empty i hi).elim rw [if_pos hallowed] · simp only [hs, false_and, if_false, ite_self] rw [hmask] exact unrestricted_edge_action_clean source old Sigma.fst (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ ρ V (unrestrictedResidueEligible n Δ D old) B θ F hF end section open Finset Classical theorem bounded_ordered_pairing_levels {P Z : Type*} [Fintype P] [Fintype Z] (μ : P → ℝ) (ν : Z → ℝ) (t B : ℕ) (F G : (Fin t → P) → FiniteOrderedTuple Z → ℂ) : (∑ s : BoundedOrderedState P Z t B, (boundedOrderedStateWeight μ ν s : ℂ) * F s.1 (boundedOrderedTupleToFinite s.2) * G s.1 (boundedOrderedTupleToFinite s.2)) = ∑ N ∈ range (B + 1), (∑ active : Fin t → P, ((∏ i, μ (active i) : ℝ) : ℂ) * ∑ q : Fin N → Z, ((∏ j, ν (q j) : ℝ) : ℂ) * F active ⟨N, q⟩ * G active ⟨N, q⟩) / ((N.factorial : ℝ) : ℂ) := by calc _ = ∑ s : BoundedOrderedState P Z t B, (boundedOrderedStateWeight μ ν s : ℂ) * (F s.1 (boundedOrderedTupleToFinite s.2) * G s.1 (boundedOrderedTupleToFinite s.2)) := by apply sum_congr rfl intro s hs ring _ = _ := by rw [bounded_ordered_state_complex_sum_range_first μ ν t B (fun a q => F a q * G a q)] apply sum_congr rfl intro N hN simp_rw [mul_sum, sum_div] apply sum_congr rfl intro active ha apply sum_congr rfl intro q hq push_cast ring /- The actual positive/reverse action duality, with all slot subsets and all bounded memory lengths summed. The only algebraic normalization condition is that the group mass is nonzero. -/ theorem unrestricted_bounded_duality {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) (μ : P → ℝ) (ρ : ℝ) {V : ℝ} (hV : V ≠ 0) (t B : ℕ) : UnrestrictedBoundedDuality n Δ D μ ρ V t B := by intro F G hF hG let A (source : Fin t → P) (q : FiniteOrderedTuple (UnrestrictedResidueParticle n)) : ℂ := unrestrictedResidueEdgeAction n Δ D source q.2 μ ρ V B (fun _ _ _ _ => 1) G let R (source : Fin t → P) (q : FiniteOrderedTuple (UnrestrictedResidueParticle n)) : ℂ := unrestrictedResidueEdgeAction n (-Δ) D source q.2 μ ρ V B (fun stores promotions _ _ => ((V ^ promotions.card / V ^ stores.card : ℝ) : ℂ)) F have hleft := bounded_ordered_pairing_levels μ (unrestrictedResidueWeight μ) t B F A have hright := bounded_ordered_pairing_levels μ (unrestrictedResidueWeight μ) t B G R calc _ = ∑ N ∈ range (B + 1), unrestrictedActionLevelPairing n μ Δ D ρ V t N B F G := hleft _ = ∑ N ∈ range (B + 1), unrestrictedWeightedActionLevelPairing n μ (-Δ) D ρ V t N B (fun stores promotions => ((V ^ promotions.card / V ^ stores.card : ℝ) : ℂ)) G F := unrestricted_bounded_action_pairing_reverse n μ Δ D ρ hV t B B F G hF hG _ = ∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B, (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * G s.1 (boundedOrderedTupleToFinite s.2) * R s.1 (boundedOrderedTupleToFinite s.2) := hright.symm _ = _ := by apply sum_congr rfl intro s hs change (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * G s.1 (boundedOrderedTupleToFinite s.2) * R s.1 (boundedOrderedTupleToFinite s.2) = (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * R s.1 (boundedOrderedTupleToFinite s.2) * G s.1 (boundedOrderedTupleToFinite s.2) ring /- The actual finite ordered-memory edge satisfies the energy estimate. There is no remaining duality or column-estimate hypothesis. -/ theorem unrestricted_bounded_operator_energy_le {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) (μ : P → ℝ) {ρ V v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : vmin ≤ V) (hVhi : V ≤ vmax) (hμ : ∀ p, 0 ≤ μ p) (hmass : ∑ p, μ p ≤ 2) (t B T : ℕ) (ht : t ≤ T) (phase : UnrestrictedBoundedPhase n Δ D t B) (hphase : ∀ s stores promotions e fresh, ‖phase s stores promotions e fresh‖ ≤ 1) (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) (hf : BoundedOrderedSymmetric f) : (∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B, boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s * ‖unrestrictedBoundedOperator n Δ D μ ρ V t B phase f s‖ ^ 2) ≤ (unrestrictedEdgeRowBound ρ v vmin T) ^ 2 * unrestrictedEdgeReversalBound vmin vmax T * ∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B, boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s * ‖f s‖ ^ 2 := unrestricted_bounded_operator_energy_le_of_duality n Δ D μ hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass t B T ht (unrestricted_bounded_duality n Δ D μ ρ (hvmin.trans_le hVlo).ne' t B) phase hphase f hf end section open Finset Filter open scoped Topology noncomputable def candidateRestProduct (c L : ℝ) (r : ℕ) (hr : 0 < r) (x : (candidateQIndices c L) × Fin r → ℕ) : ℕ := ∏ slot : {slot : (candidateQIndices c L) × Fin r // slot ≠ candidateFreeSlot c L r hr}, x slot.val theorem candidate_remainder_log_window {c L eps : ℝ} {r jStar J : ℕ} (hr : 0 < r) (hcL : 0 ≤ c * L) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1/10) (hJN : J ≤ candidateQMaxIndex c L) (hJstar : J < jStar) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hepsr : eps * (r : ℝ) ≤ 1/400) (hJ : 1000 * (r : ℝ) ≤ 2^J) (hlarge : Real.log 16 ≤ c * L / 20) (x : (candidateQIndices c L) × Fin r → ℕ) (hx : ∀ slot, x slot ∈ candidatePrefixChoices c L eps r jStar J slot) {p : ℕ} (hp : p ≠ 0) (hpLog : Real.log p ≤ c * L / 100) : c * L ≤ Real.log (Real.exp L / ((p * candidateRestProduct c L r hr x : ℕ) : ℝ)) ∧ Real.log (Real.exp L / ((p * candidateRestProduct c L r hr x : ℕ) : ℝ)) + Real.log 16 ≤ (6/5 : ℝ) * c * L := by classical have hx0 : ∀ slot, x slot ≠ 0 := fun slot => candidate_Q_slot_nonzero c L r jStar slot (candidatePrefixChoices_subset hcL heps1 hJstar slot (hx slot)) have hrest0 : candidateRestProduct c L r hr x ≠ 0 := prod_ne_zero_iff.mpr (fun slot _ => hx0 slot.val) have hrestR : (candidateRestProduct c L r hr x : ℝ) ≠ 0 := by exact_mod_cast hrest0 have hpR : (p : ℝ) ≠ 0 := by exact_mod_cast hp have hpLog0 : 0 ≤ Real.log p := Real.log_nonneg (by exact_mod_cast Nat.one_le_iff_ne_zero.mpr hp) have hsum := completed_slot_log_sum_nat_product x (candidateFreeSlot c L r hr) ((11/10 : ℝ) * (c * L)) (fun slot => hx0 slot.val) change (∑ slot, completedSlotLog x (candidateFreeSlot c L r hr) ((11/10 : ℝ) * (c * L)) slot) = (11/10 : ℝ) * (c * L) + Real.log (candidateRestProduct c L r hr x) at hsum have hmid := candidate_completed_midpoint_error hr hcL heps0 heps1 hJN hJstar hcenter hepsr hJ x hx have hwindow := candidate_free_log_window_of_midpoint hmid (rest := Real.log (candidateRestProduct c L r hr x) + Real.log p) (pLog := Real.log p) (by linarith) hpLog0 hpLog hlarge rw [Nat.cast_mul, Real.log_div (Real.exp_pos L).ne' (mul_ne_zero hpR hrestR), Real.log_exp, Real.log_mul hpR hrestR] simpa only [add_comm (Real.log p) (Real.log (candidateRestProduct c L r hr x))] using hwindow theorem eventually_candidate_remainder_log_window {c eps : ℝ} {r J : ℕ} (hc : 0 < c) (hr : 0 < r) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1/10) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hepsr : eps * (r : ℝ) ≤ 1/400) (hJ : 1000 * (r : ℝ) ≤ 2^J) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → ∀ x : (candidateQIndices c L) × Fin r → ℕ, (∀ slot, x slot ∈ candidatePrefixChoices c L eps r jStar J slot) → ∀ p : ℕ, p ≠ 0 → Real.log p ≤ c * L / 100 → c * L ≤ Real.log (Real.exp L / ((p * candidateRestProduct c L r hr x : ℕ) : ℝ)) ∧ Real.log (Real.exp L / ((p * candidateRestProduct c L r hr x : ℕ) : ℝ)) + Real.log 16 ≤ (6/5 : ℝ) * c * L := by filter_upwards [eventually_fixed_candidateQ_prefix hc J, eventually_ge_atTop (0 : ℝ), eventually_ge_atTop (20 * Real.log 16 / c)] with L hprefix hL hbig have hJN : J ≤ candidateQMaxIndex c L := (mem_Icc.mp (hprefix (by simp))).2 have hlarge : Real.log 16 ≤ c * L / 20 := by have h := (div_le_iff₀ hc).mp hbig nlinarith intro jStar hJstar x hx p hp hpLog exact candidate_remainder_log_window hr (mul_nonneg hc.le hL) heps0 heps1 hJN hJstar hcenter hepsr hJ hlarge x hx hp hpLog end section open Finset open scoped Classical end section open Finset open scoped Classical noncomputable def cleanHybridStep {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell : ℕ} (k : ℤ) (C : G → Finset (Fin J)) (source : RepeatedBigLists Pb J ell) (aux : PhysicalAuxLabels Pb C) (d : PhysicalSharedLists Ps J) : ℤ := (k * (repeatedBigD C source aux : ℤ)) * (physicalSharedProduct d : ℤ) /- Both endpoint rho weights and each actual output cutoff remain explicit. A clean edge has the same length at input and output. -/ noncomputable def cleanHybridMemoryFactor {G : Type*} [Fintype G] {Pb : G → Finset ℕ} {N : G → ℕ} (ρ : ℝ) (B : G → ℕ) (p : FixedOrderedMemoryLabels Pb N) (r : FixedOrderedResidues p) (Δ : ℤ) : ℝ := by classical exact ∏ g, if N g ≤ B g then ρ ^ orderedPredicateCount (fixedOrderedResidueMemory p r g) unrestrictedResidueHit * ρ ^ orderedPredicateCount (fixedOrderedResidueMemory p (fixedOrderedResidueTranslate p r Δ) g) unrestrictedResidueHit else 0 /- K receives big list coordinates only. Small shared labels affect this coefficient solely through the common physical displacement. -/ noncomputable def cleanHybridBetweenKernel {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell : ℕ} {N : G → ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (B : G → ℕ) (p : FixedOrderedMemoryLabels Pb N) (r : FixedOrderedResidues p) (K : RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb C → ℂ) (d : PhysicalSharedLists Ps J) (aux : PhysicalAuxLabels Pb C) (source target : RepeatedBigLists Pb J ell) : ℂ := repeatedBigKernel Vb b C ζ K aux source target * physicalReturnPhase θ (cleanHybridStep k C source aux d) * (cleanHybridMemoryFactor ρ B p r (cleanHybridStep k C source aux d) : ℂ) end section open Finset Filter open scoped Topology theorem exists_candidate_localization_parameters {r : ℕ} (hr : 0 < r) : ∃ eps : ℝ, ∃ J : ℕ, 0 < eps ∧ eps ≤ 1/10 ∧ eps * (r : ℝ) ≤ 1/400 ∧ 1000 * (r : ℝ) ≤ 2^J := by have hr0 : (0 : ℝ) < r := by exact_mod_cast hr have hr1 : (1 : ℝ) ≤ r := by exact_mod_cast hr obtain ⟨J, hJ⟩ := pow_unbounded_of_one_lt (1000 * (r : ℝ)) (by norm_num : (1 : ℝ) < 2) refine ⟨1 / (400 * (r : ℝ)), J, by positivity, ?_, ?_, hJ.le⟩ · apply (div_le_iff₀ (by positivity : 0 < 400 * (r : ℝ))).mpr nlinarith · have heq : (1 / (400 * (r : ℝ))) * (r : ℝ) = 1/400 := by field_simp exact heq.le end section open Finset open scoped Classical theorem clean_hybrid_shared_product_pos {S : Type*} [Fintype S] {Ps : S → Finset ℕ} {J : ℕ} (d : PhysicalSharedLists Ps J) (hP : ∀ s p, p ∈ Ps s → 0 < p) : 0 < physicalSharedProduct d := by apply prod_pos intro s _ exact prod_pos (fun j _ => hP s _ (d s j).property) end section open Finset /- Input damping counts every old pending zero, including repeated labels. -/ noncomputable def cleanMemoryInputWeight {G : Type*} [Fintype G] {P : G → Finset ℕ} {N : G → ℕ} (ρ : ℝ) (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) : ℝ := ∏ g, ρ ^ orderedPredicateCount (fixedOrderedResidueMemory p r g) unrestrictedResidueHit /- Output damping includes the actual groupwise memory-sector cutoff. -/ noncomputable def cleanMemoryOutputWeight {G : Type*} [Fintype G] {P : G → Finset ℕ} {N : G → ℕ} (ρ : ℝ) (B : G → ℕ) (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) : ℝ := ∏ g, if N g ≤ B g then ρ ^ orderedPredicateCount (fixedOrderedResidueMemory p r g) unrestrictedResidueHit else 0 section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {N : G → ℕ} include G sharedInstance1 P N /- The output factor is evaluated at the translated coordinates. No residue-dependent multiplier needs to remain in the between-test kernel. -/ theorem clean_hybrid_memory_factor_split (ρ : ℝ) (B : G → ℕ) (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) (Δ : ℤ) : cleanHybridMemoryFactor ρ B p r Δ = cleanMemoryInputWeight ρ p r * cleanMemoryOutputWeight ρ B p (fixedOrderedResidueTranslate p r Δ) := by unfold cleanHybridMemoryFactor cleanMemoryInputWeight cleanMemoryOutputWeight rw [← prod_mul_distrib] apply prod_congr rfl intro g _ by_cases h : N g ≤ B g <;> simp only [h, if_true, if_false, mul_zero] theorem clean_memory_input_weight_nonneg {ρ : ℝ} (hρ : 0 ≤ ρ) (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) : 0 ≤ cleanMemoryInputWeight ρ p r := prod_nonneg (fun _ _ => pow_nonneg hρ _) theorem clean_memory_output_weight_nonneg {ρ : ℝ} (hρ : 0 ≤ ρ) (B : G → ℕ) (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) : 0 ≤ cleanMemoryOutputWeight ρ B p r := by apply prod_nonneg intro g _ split_ifs · exact pow_nonneg hρ _ · exact le_rfl theorem clean_memory_input_weight_le_one {ρ : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) : cleanMemoryInputWeight ρ p r ≤ 1 := prod_le_one₀ (fun _ _ => pow_nonneg hρ0 _) (fun _ _ => pow_le_one₀ hρ0 hρ1) theorem clean_memory_output_weight_le_one {ρ : ℝ} (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) (B : G → ℕ) (p : FixedOrderedMemoryLabels P N) (r : FixedOrderedResidues p) : cleanMemoryOutputWeight ρ B p r ≤ 1 := by apply prod_le_one₀ · intro g _ split_ifs · exact pow_nonneg hρ0 _ · exact le_rfl · intro g _ split_ifs · exact pow_le_one₀ hρ0 hρ1 · exact zero_le_one end end section open Finset open scoped Classical end section open scoped BigOperators InnerProductSpace noncomputable def finiteMeasureVector {X : Type*} (μ : X → ℝ) (f : X → ℂ) : EuclideanSpace ℂ X := WithLp.toLp 2 (fun x => (Real.sqrt (μ x) : ℂ) * f x) theorem finite_measure_vector_apply {X : Type*} (μ : X → ℝ) (f : X → ℂ) (x : X) : finiteMeasureVector μ f x = (Real.sqrt (μ x) : ℂ) * f x := rfl theorem finite_measure_vector_norm_sq {X : Type*} [Fintype X] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (f : X → ℂ) : ‖finiteMeasureVector μ f‖ ^ 2 = ∑ x, μ x * ‖f x‖ ^ 2 := by rw [EuclideanSpace.norm_sq_eq] apply Finset.sum_congr rfl intro x _ rw [finite_measure_vector_apply, norm_mul, mul_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg _), Real.sq_sqrt (hμ x)] theorem finite_measure_vector_inner {X : Type*} [Fintype X] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (f g : X → ℂ) : inner ℂ (finiteMeasureVector μ f) (finiteMeasureVector μ g) = ∑ x, (μ x : ℂ) * (starRingEnd ℂ) (f x) * g x := by rw [PiLp.inner_apply] apply Finset.sum_congr rfl intro x _ simp only [finite_measure_vector_apply, RCLike.inner_apply, map_mul, Complex.conj_ofReal] have hs : (Real.sqrt (μ x) : ℂ) * Real.sqrt (μ x) = (μ x : ℂ) := by rw [← Complex.ofReal_mul, Real.mul_self_sqrt (hμ x)] calc _ = ((Real.sqrt (μ x) : ℂ) * Real.sqrt (μ x)) * (starRingEnd ℂ) (f x) * g x := by ring _ = _ := by rw [hs] noncomputable def finiteMeasureFrameKernel {X I : Type*} [Fintype I] (ψ : I → X → ℂ) (x y : X) : ℂ := ∑ i, ψ i x * (starRingEnd ℂ) (ψ i y) noncomputable def finiteMeasureFrameAction {X I : Type*} [Fintype X] [Fintype I] (μ : X → ℝ) (ψ : I → X → ℂ) (f : X → ℂ) (x : X) : ℂ := ∑ y, (μ y : ℂ) * finiteMeasureFrameKernel ψ x y * f y section variable {X I : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype I] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) include X I sharedInstance1 sharedInstance2 μ hμ theorem finite_measure_frame_vector (ψ : I → X → ℂ) (f : X → ℂ) : finiteMeasureVector μ (finiteMeasureFrameAction μ ψ f) = ∑ i, inner ℂ (finiteMeasureVector μ (ψ i)) (finiteMeasureVector μ f) • finiteMeasureVector μ (ψ i) := by apply PiLp.ext intro x simp only [finite_measure_vector_apply, finiteMeasureFrameAction, finiteMeasureFrameKernel, finite_measure_vector_inner μ hμ, WithLp.ofLp_sum, Finset.sum_apply, PiLp.smul_apply, smul_eq_mul] simp_rw [Finset.mul_sum, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro y _ ring theorem finite_measure_frame_energy_le (ψ : I → X → ℂ) {ε : ℝ} (hε : 0 ≤ ε) (hdiag : ∀ i, (∑ x, μ x * ‖ψ i x‖ ^ 2) ≤ 1) (hoff : ∀ i j, i ≠ j → ‖∑ x, (μ x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x‖ ≤ ε) (f : X → ℂ) : (∑ x, μ x * ‖finiteMeasureFrameAction μ ψ f x‖ ^ 2) ≤ (1 + (Fintype.card I - 1 : ℕ) * ε) ^ 2 * ∑ x, μ x * ‖f x‖ ^ 2 := by have h := finite_near_orthogonal_frame_sq (fun i => finiteMeasureVector μ (ψ i)) hε (fun i => by simpa only [finite_measure_vector_norm_sq μ hμ] using hdiag i) (fun i j hij => by simpa only [finite_measure_vector_inner μ hμ] using hoff i j hij) (finiteMeasureVector μ f) simpa only [← finite_measure_frame_vector μ hμ, finite_measure_vector_norm_sq μ hμ] using h theorem finite_probability_frame_energy_le (hmass : ∑ x, μ x = 1) (ψ : I → X → ℂ) (hunit : ∀ i x, μ x ≠ 0 → ‖ψ i x‖ = 1) {ε : ℝ} (hε : 0 ≤ ε) (hoff : ∀ i j, i ≠ j → ‖∑ x, (μ x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x‖ ≤ ε) (f : X → ℂ) : (∑ x, μ x * ‖finiteMeasureFrameAction μ ψ f x‖ ^ 2) ≤ (1 + (Fintype.card I - 1 : ℕ) * ε) ^ 2 * ∑ x, μ x * ‖f x‖ ^ 2 := by apply finite_measure_frame_energy_le μ hμ ψ hε _ hoff f intro i calc _ = ∑ x, μ x := by apply Finset.sum_congr rfl intro x _ by_cases hx : μ x = 0 · simp [hx] · rw [hunit i x hx, one_pow, mul_one] _ ≤ 1 := hmass.le end end section open scoped BigOperators Classical noncomputable def finiteCellMass {X D : Type*} [Fintype X] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (d : D) : ℝ := ∑ x, if cell x = d then μ x else 0 noncomputable def finiteCellLaw {X D : Type*} [Fintype X] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (d : D) (x : X) : ℝ := if cell x = d then μ x / finiteCellMass μ cell d else 0 section variable {X D : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : DecidableEq D] (μ : X → ℝ) include X D sharedInstance1 sharedInstance2 μ theorem finite_cell_mass_nonneg (hμ : ∀ x, 0 ≤ μ x) (cell : X → D) (d : D) : 0 ≤ finiteCellMass μ cell d := by apply Finset.sum_nonneg intro x _ split_ifs · exact hμ x · exact le_rfl theorem finite_cell_law_nonneg (hμ : ∀ x, 0 ≤ μ x) (cell : X → D) (d : D) (x : X) : 0 ≤ finiteCellLaw μ cell d x := by unfold finiteCellLaw split_ifs · exact div_nonneg (hμ x) (finite_cell_mass_nonneg μ hμ cell d) · exact le_rfl theorem finite_cell_law_mass (cell : X → D) (d : D) (hd : finiteCellMass μ cell d ≠ 0) : (∑ x, finiteCellLaw μ cell d x) = 1 := by calc _ = (∑ x, if cell x = d then μ x else 0) / finiteCellMass μ cell d := by rw [Finset.sum_div] apply Finset.sum_congr rfl intro x _ unfold finiteCellLaw split_ifs <;> simp _ = 1 := div_self hd theorem finite_cell_expectation_scale (cell : X → D) (d : D) (hd : finiteCellMass μ cell d ≠ 0) (F : X → ℝ) : finiteCellMass μ cell d * (∑ x, finiteCellLaw μ cell d x * F x) = ∑ x, if cell x = d then μ x * F x else 0 := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ unfold finiteCellLaw by_cases hx : cell x = d · simp only [if_pos hx] field_simp · simp only [if_neg hx, mul_zero, zero_mul] end noncomputable def finiteCellFrameAction {X D I : Type*} [Fintype X] [Fintype I] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (kept : Finset D) (ψ : I → X → ℂ) (f : X → ℂ) (x : X) : ℂ := if cell x ∈ kept then finiteMeasureFrameAction (finiteCellLaw μ cell (cell x)) ψ f x else 0 theorem finite_cell_frame_energy_partition {X D I : Type*} [Fintype X] [Fintype I] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (kept : Finset D) (ψ : I → X → ℂ) (f : X → ℂ) : (∑ x, μ x * ‖finiteCellFrameAction μ cell kept ψ f x‖ ^ 2) = ∑ d ∈ kept, ∑ x, if cell x = d then μ x * ‖finiteMeasureFrameAction (finiteCellLaw μ cell d) ψ f x‖ ^ 2 else 0 := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x _ unfold finiteCellFrameAction by_cases hx : cell x ∈ kept · rw [if_pos hx, Finset.sum_eq_single (cell x)] · simp · intro d _ hd simp [Ne.symm hd] · exact fun h => (h hx).elim · rw [if_neg hx] simp only [norm_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, mul_zero] symm apply Finset.sum_eq_zero intro d hd have he : cell x ≠ d := by intro he; exact hx (he ▸ hd) simp [he] theorem finite_cell_frame_energy_le {X D I : Type*} [Fintype X] [Fintype I] [DecidableEq D] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (cell : X → D) (kept : Finset D) (hkept : ∀ d ∈ kept, 0 < finiteCellMass μ cell d) (ψ : I → X → ℂ) (hunit : ∀ i x, μ x ≠ 0 → ‖ψ i x‖ = 1) {ε : ℝ} (hε : 0 ≤ ε) (hoff : ∀ d ∈ kept, ∀ i j, i ≠ j → ‖∑ x, (finiteCellLaw μ cell d x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x‖ ≤ ε) (f : X → ℂ) : (∑ x, μ x * ‖finiteCellFrameAction μ cell kept ψ f x‖ ^ 2) ≤ (1 + (Fintype.card I - 1 : ℕ) * ε) ^ 2 * ∑ x, μ x * ‖f x‖ ^ 2 := by let B : ℝ := (1 + (Fintype.card I - 1 : ℕ) * ε) ^ 2 have hB : 0 ≤ B := sq_nonneg _ have hlocal (d : D) (hd : d ∈ kept) : (∑ x, if cell x = d then μ x * ‖finiteMeasureFrameAction (finiteCellLaw μ cell d) ψ f x‖ ^ 2 else 0) ≤ B * ∑ x, if cell x = d then μ x * ‖f x‖ ^ 2 else 0 := by have hn : finiteCellMass μ cell d ≠ 0 := (hkept d hd).ne' have hc := finite_probability_frame_energy_le (finiteCellLaw μ cell d) (finite_cell_law_nonneg μ hμ cell d) (finite_cell_law_mass μ cell d hn) ψ (fun i x hx => hunit i x (by intro hz simp [finiteCellLaw, hz] at hx)) hε (hoff d hd) f have hm := mul_le_mul_of_nonneg_left hc (hkept d hd).le rw [finite_cell_expectation_scale μ cell d hn] at hm calc _ ≤ finiteCellMass μ cell d * (B * ∑ x, finiteCellLaw μ cell d x * ‖f x‖ ^ 2) := hm _ = B * (finiteCellMass μ cell d * ∑ x, finiteCellLaw μ cell d x * ‖f x‖ ^ 2) := by ring _ = _ := by rw [finite_cell_expectation_scale μ cell d hn] rw [finite_cell_frame_energy_partition] calc _ ≤ ∑ d ∈ kept, B * ∑ x, if cell x = d then μ x * ‖f x‖ ^ 2 else 0 := Finset.sum_le_sum hlocal _ = B * ∑ x, ∑ d ∈ kept, if cell x = d then μ x * ‖f x‖ ^ 2 else 0 := by rw [← Finset.mul_sum, Finset.sum_comm] _ ≤ B * ∑ x, μ x * ‖f x‖ ^ 2 := by apply mul_le_mul_of_nonneg_left _ hB apply Finset.sum_le_sum intro x _ by_cases hx : cell x ∈ kept · simp [Finset.sum_ite_eq, hx] · simp [Finset.sum_ite_eq, hx, mul_nonneg (hμ x) (sq_nonneg _)] end section open scoped BigOperators Classical noncomputable def finiteCellFrameKernel {X D I : Type*} [Fintype X] [Fintype I] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (kept : Finset D) (ψ : I → X → ℂ) (x y : X) : ℂ := if cell x = cell y ∧ cell x ∈ kept then ((1 / finiteCellMass μ cell (cell x) : ℝ) : ℂ) * finiteMeasureFrameKernel ψ x y else 0 theorem finite_cell_kernel_action {X D I : Type*} [Fintype X] [Fintype I] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (kept : Finset D) (ψ : I → X → ℂ) (f : X → ℂ) (x : X) : (∑ y, (μ y : ℂ) * finiteCellFrameKernel μ cell kept ψ x y * f y) = finiteCellFrameAction μ cell kept ψ f x := by unfold finiteCellFrameAction by_cases hx : cell x ∈ kept · rw [if_pos hx] unfold finiteMeasureFrameAction apply Finset.sum_congr rfl intro y _ by_cases hxy : cell x = cell y · simp only [finiteCellFrameKernel, if_pos (And.intro hxy hx), finiteCellLaw, if_pos hxy.symm] push_cast ring · simp only [finiteCellFrameKernel, hxy, false_and, if_false, finiteCellLaw, if_neg (Ne.symm hxy), Complex.ofReal_zero, mul_zero, zero_mul] · rw [if_neg hx] apply Finset.sum_eq_zero intro y _ simp [finiteCellFrameKernel, hx] section variable {X D I : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype I] [sharedInstance3 : DecidableEq D] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (cell : X → D) (kept : Finset D) (hkept : ∀ d ∈ kept, 0 < finiteCellMass μ cell d) (ψ : I → X → ℂ) (hunit : ∀ i x, μ x ≠ 0 → ‖ψ i x‖ = 1) {ε : ℝ} (hε : 0 ≤ ε) include X D I sharedInstance1 sharedInstance2 sharedInstance3 μ hμ cell kept hkept ψ hunit ε hε theorem finite_cell_kernel_energy_le (hoff : ∀ d ∈ kept, ∀ i j, i ≠ j → ‖∑ x, (finiteCellLaw μ cell d x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x‖ ≤ ε) (f : X → ℂ) : (∑ x, μ x * ‖∑ y, (μ y : ℂ) * finiteCellFrameKernel μ cell kept ψ x y * f y‖ ^ 2) ≤ (1 + (Fintype.card I - 1 : ℕ) * ε) ^ 2 * ∑ x, μ x * ‖f x‖ ^ 2 := by simp only [finite_cell_kernel_action] exact finite_cell_frame_energy_le μ hμ cell kept hkept ψ hunit hε hoff f theorem finite_cell_kernel_energy_le_four (hsmall : (Fintype.card I - 1 : ℕ) * ε ≤ 1) (hoff : ∀ d ∈ kept, ∀ i j, i ≠ j → ‖∑ x, (finiteCellLaw μ cell d x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x‖ ≤ ε) (f : X → ℂ) : (∑ x, μ x * ‖∑ y, (μ y : ℂ) * finiteCellFrameKernel μ cell kept ψ x y * f y‖ ^ 2) ≤ 4 * ∑ x, μ x * ‖f x‖ ^ 2 := by have hb : (1 + (Fintype.card I - 1 : ℕ) * ε) ^ 2 ≤ 4 := by have hnonneg : 0 ≤ (Fintype.card I - 1 : ℕ) * ε := by positivity nlinarith exact (finite_cell_kernel_energy_le μ hμ cell kept hkept ψ hunit hε hoff f).trans (mul_le_mul_of_nonneg_right hb (Finset.sum_nonneg (fun x _ => mul_nonneg (hμ x) (sq_nonneg _)))) end theorem finite_measure_frame_kernel_norm_le {X I : Type*} [Fintype I] (ψ : I → X → ℂ) (hψ : ∀ i x, ‖ψ i x‖ ≤ 1) (x y : X) : ‖finiteMeasureFrameKernel ψ x y‖ ≤ Fintype.card I := by calc _ ≤ ∑ i, ‖ψ i x * (starRingEnd ℂ) (ψ i y)‖ := norm_sum_le _ _ _ ≤ ∑ _i : I, (1 : ℝ) := by apply Finset.sum_le_sum intro i _ rw [norm_mul, Complex.norm_conj] exact mul_le_one₀ (hψ i x) (norm_nonneg _) (hψ i y) _ = _ := by simp section variable {X D I : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype I] [sharedInstance3 : DecidableEq D] (μ : X → ℝ) include X D I sharedInstance1 sharedInstance2 sharedInstance3 μ theorem finite_cell_kernel_norm_le (cell : X → D) (kept : Finset D) (ψ : I → X → ℂ) (hψ : ∀ i x, ‖ψ i x‖ ≤ 1) {ξ : ℝ} (hξ : 0 < ξ) (hkept : ∀ d ∈ kept, ξ ≤ finiteCellMass μ cell d) (x y : X) : ‖finiteCellFrameKernel μ cell kept ψ x y‖ ≤ (Fintype.card I : ℝ) / ξ := by unfold finiteCellFrameKernel split_ifs with h · have hpos := lt_of_lt_of_le hξ (hkept _ h.2) rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (one_div_pos.mpr hpos)] calc _ ≤ (1 / finiteCellMass μ cell (cell x)) * Fintype.card I := mul_le_mul_of_nonneg_left (finite_measure_frame_kernel_norm_le ψ hψ x y) (by positivity) _ = (Fintype.card I : ℝ) / finiteCellMass μ cell (cell x) := by ring _ ≤ _ := div_le_div_of_nonneg_left (Nat.cast_nonneg _) hξ (hkept _ h.2) · simp only [norm_zero] positivity theorem finite_cell_kernel_conj (cell : X → D) (kept : Finset D) (ψ : I → X → ℂ) (x y : X) : (starRingEnd ℂ) (finiteCellFrameKernel μ cell kept ψ x y) = finiteCellFrameKernel μ cell kept ψ y x := by by_cases h : cell x = cell y · unfold finiteCellFrameKernel rw [h] by_cases hy : cell y ∈ kept · simp only [eq_self, true_and, if_pos hy, map_mul, Complex.conj_ofReal] congr 1 unfold finiteMeasureFrameKernel rw [map_sum] apply Finset.sum_congr rfl intro i _ simp only [map_mul, Complex.conj_conj] ring · simp only [eq_self, true_and, if_neg hy, map_zero] · simp only [finiteCellFrameKernel, h, Ne.symm h, false_and, if_false, map_zero] theorem finite_cell_kernel_abs_row_le (hμ : ∀ x, 0 ≤ μ x) (cell : X → D) (kept : Finset D) (hkept : ∀ d ∈ kept, 0 < finiteCellMass μ cell d) (ψ : I → X → ℂ) (hψ : ∀ i x, ‖ψ i x‖ ≤ 1) (x : X) : (∑ y, μ y * ‖finiteCellFrameKernel μ cell kept ψ x y‖) ≤ Fintype.card I := by by_cases hx : cell x ∈ kept · have hpos := hkept _ hx have he (y : X) : μ y * ‖finiteCellFrameKernel μ cell kept ψ x y‖ = finiteCellLaw μ cell (cell x) y * ‖finiteMeasureFrameKernel ψ x y‖ := by by_cases hxy : cell x = cell y · simp only [finiteCellFrameKernel, if_pos (And.intro hxy hx), finiteCellLaw, if_pos hxy.symm, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (one_div_pos.mpr hpos)] ring · simp only [finiteCellFrameKernel, hxy, false_and, if_false, finiteCellLaw, if_neg (Ne.symm hxy), norm_zero, mul_zero, zero_mul] simp_rw [he] calc _ ≤ ∑ y, finiteCellLaw μ cell (cell x) y * (Fintype.card I : ℝ) := Finset.sum_le_sum (fun y _ => mul_le_mul_of_nonneg_left (finite_measure_frame_kernel_norm_le ψ hψ x y) (finite_cell_law_nonneg μ hμ cell _ y)) _ = Fintype.card I := by rw [← Finset.sum_mul, finite_cell_law_mass μ cell _ hpos.ne', one_mul] · simp [finiteCellFrameKernel, hx] end end section open scoped BigOperators Classical section variable {X D I : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : DecidableEq D] (μ : X → ℝ) (cell : X → D) (d : D) (ψ : I → X → ℂ) (i j : I) include X D I sharedInstance1 sharedInstance2 μ cell d ψ i j theorem finite_cell_gram_scale : (∑ x, (finiteCellLaw μ cell d x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x) = ((1 / finiteCellMass μ cell d : ℝ) : ℂ) * ∑ x, if cell x = d then (μ x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x else 0 := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ by_cases hx : cell x = d · simp only [finiteCellLaw, if_pos hx] push_cast ring · simp only [finiteCellLaw, if_neg hx, Complex.ofReal_zero, zero_mul, mul_zero] theorem finite_cell_gram_norm_le {δ ξ : ℝ} (hδ : 0 ≤ δ) (hξ : 0 < ξ) (hd : ξ ≤ finiteCellMass μ cell d) (hraw : ‖∑ x, if cell x = d then (μ x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x else 0‖ ≤ δ) : ‖∑ x, (finiteCellLaw μ cell d x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x‖ ≤ δ / ξ := by have hpos : 0 < finiteCellMass μ cell d := hξ.trans_le hd rw [finite_cell_gram_scale, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (one_div_pos.mpr hpos)] calc _ ≤ (1 / finiteCellMass μ cell d) * δ := mul_le_mul_of_nonneg_left hraw (by positivity) _ = δ / finiteCellMass μ cell d := by ring _ ≤ δ / ξ := div_le_div_of_nonneg_left hδ hξ hd end theorem finite_cell_kernel_energy_of_raw_gram {X D I : Type*} [Fintype X] [Fintype I] [DecidableEq D] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (cell : X → D) (kept : Finset D) {δ ξ : ℝ} (hδ : 0 ≤ δ) (hξ : 0 < ξ) (hkept : ∀ d ∈ kept, ξ ≤ finiteCellMass μ cell d) (ψ : I → X → ℂ) (hunit : ∀ i x, μ x ≠ 0 → ‖ψ i x‖ = 1) (hsmall : (Fintype.card I - 1 : ℕ) * (δ / ξ) ≤ 1) (hraw : ∀ d ∈ kept, ∀ i j, i ≠ j → ‖∑ x, if cell x = d then (μ x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x else 0‖ ≤ δ) (f : X → ℂ) : (∑ x, μ x * ‖∑ y, (μ y : ℂ) * finiteCellFrameKernel μ cell kept ψ x y * f y‖ ^ 2) ≤ 4 * ∑ x, μ x * ‖f x‖ ^ 2 := by apply finite_cell_kernel_energy_le_four μ hμ cell kept (fun d hd => hξ.trans_le (hkept d hd)) ψ hunit (div_nonneg hδ hξ.le) hsmall _ f intro d hd i j hij exact finite_cell_gram_norm_le μ cell d ψ i j hδ hξ (hkept d hd) (hraw d hd i j hij) end section open Filter open scoped Topology /- The quotient of two powers tends to zero when the numerator has lower exponent. -/ theorem tendsto_rpow_div_rpow {a b : ℝ} (hab : a < b) : Tendsto (fun y : ℝ => y ^ a / y ^ b) atTop (𝓝 0) := by refine (tendsto_rpow_neg_atTop (sub_pos.mpr hab)).congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℝ)] with y hy rw [neg_sub, Real.rpow_sub hy] /- A positive higher power eventually absorbs a fixed multiple of a smaller power and a fixed additive constant. -/ theorem eventually_mul_rpow_add_le_mul_rpow {a b c : ℝ} (hb : 0 < b) (hab : a < b) (hc : 0 < c) (D k : ℝ) : ∀ᶠ y : ℝ in atTop, D * y ^ a + k ≤ c * y ^ b := by have hlim : Tendsto (fun y : ℝ => (D * y ^ a + k) / y ^ b) atTop (𝓝 0) := by have h := ((tendsto_rpow_div_rpow hab).const_mul D).add ((tendsto_rpow_atTop hb).const_div_atTop k) have heq : (fun y : ℝ => (D * y ^ a + k) / y ^ b) = (fun y : ℝ => D * (y ^ a / y ^ b) + k / y ^ b) := by funext y ring rw [heq] simpa only [mul_zero, zero_add] using h filter_upwards [hlim.eventually_le_const hc, eventually_gt_atTop (0 : ℝ)] with y hy hy0 exact (div_le_iff₀ (Real.rpow_pos_of_pos hy0 b)).mp hy /- The Fourier error condition, uniformly for every allowed real cutoff `R`. -/ theorem eventually_fourier_sampling_gap {d r η K : ℝ} (hd : 0 ≤ d) (hr : 0 ≤ r) (hgap : 2 * d + 2 * r < η) : ∀ᶠ y : ℝ in atTop, ∀ R : ℝ, 0 < R → R ≤ K * y ^ r → y ^ d + Real.log 4 ≤ y ^ η / (200 * y ^ d * R ^ 2) := by have hη : 0 < η := by linarith have hlim := eventually_mul_rpow_add_le_mul_rpow hη hgap (show (0 : ℝ) < 1 by norm_num) (200 * (1 + Real.log 4) * K ^ 2) 0 filter_upwards [hlim, eventually_ge_atTop (1 : ℝ)] with y hy hy1 have hy0 : 0 < y := lt_of_lt_of_le zero_lt_one hy1 have hyd : 1 ≤ y ^ d := Real.one_le_rpow hy1 hd have hyr : 0 < y ^ r := Real.rpow_pos_of_pos hy0 r have hlog : 0 ≤ Real.log 4 := Real.log_nonneg (by norm_num) have hadd : y ^ d + Real.log 4 ≤ (1 + Real.log 4) * y ^ d := by nlinarith [mul_le_mul_of_nonneg_left hyd hlog] intro R hR hbound apply (le_div_iff₀ (by positivity : 0 < 200 * y ^ d * R ^ 2)).mpr calc (y ^ d + Real.log 4) * (200 * y ^ d * R ^ 2) ≤ ((1 + Real.log 4) * y ^ d) * (200 * y ^ d * (K * y ^ r) ^ 2) := by gcongr _ = (200 * (1 + Real.log 4) * K ^ 2) * y ^ (2 * d + 2 * r) := by rw [Real.rpow_add hy0] have heqd : y ^ (2 * d) = (y ^ d) ^ (2 : ℕ) := by rw [mul_comm (2 : ℝ) d, Real.rpow_mul hy0.le] exact Real.rpow_natCast _ 2 have heqr : y ^ (2 * r) = (y ^ r) ^ (2 : ℕ) := by rw [mul_comm (2 : ℝ) r, Real.rpow_mul hy0.le] exact Real.rpow_natCast _ 2 rw [heqd, heqr] ring _ ≤ y ^ η := by simpa only [add_zero, one_mul] using hy /- The Chernoff exponent eventually absorbs the group-size term. -/ theorem eventually_chernoff_sampling_gap {d η ν : ℝ} (hη : 0 < η) (hdη : d < η) (hν : 0 < ν) : ∀ᶠ y : ℝ in atTop, y ^ d + Real.log 8 ≤ ν ^ 2 * y ^ η / 4 := by have hlim := eventually_mul_rpow_add_le_mul_rpow hη hdη (show 0 < ν ^ 2 / 4 by positivity) 1 (Real.log 8) filter_upwards [hlim] with y hy simpa only [one_mul, div_mul_eq_mul_div] using hy /- Any fixed fraction of a positive power eventually exceeds a fixed size. -/ theorem eventually_const_le_mul_rpow {η c : ℝ} (hη : 0 < η) (hc : 0 < c) (m : ℝ) : ∀ᶠ y : ℝ in atTop, m ≤ c * y ^ η := by filter_upwards [(tendsto_rpow_atTop hη).eventually_ge_atTop (m / c)] with y hy simpa only [mul_comm c] using (div_le_iff₀ hc).mp hy /- All sampling inequalities hold simultaneously. The Fourier bound is uniform in the cutoff; no positivity hypothesis on `K` is needed because its bound is only used for positive `R`. -/ theorem eventually_finite_sampling_feasible {d r η σ ν K : ℝ} (hd : 0 ≤ d) (hr : 0 ≤ r) (hgap : 2 * d + 2 * r < η) (hησ : η < 1 - σ) (hν0 : 0 < ν) (hν1 : ν < 1) : ∀ᶠ y : ℝ in atTop, (∀ R : ℝ, 0 < R → R ≤ K * y ^ r → y ^ d + Real.log 4 ≤ y ^ η / (200 * y ^ d * R ^ 2)) ∧ y ^ d + Real.log 8 ≤ ν ^ 2 * y ^ η / 4 ∧ 4 * y ^ η ≤ y ^ (1 - σ) ∧ 2 ≤ (1 - ν) * y ^ η := by have hη : 0 < η := by linarith have hdη : d < η := by linarith have hσ : 0 < 1 - σ := lt_trans hη hησ have hsupply := eventually_mul_rpow_add_le_mul_rpow hσ hησ (show (0 : ℝ) < 1 by norm_num) 4 0 filter_upwards [eventually_fourier_sampling_gap hd hr hgap (K := K), eventually_chernoff_sampling_gap hη hdη hν0, hsupply, eventually_const_le_mul_rpow hη (sub_pos.mpr hν1) 2] with y hF hC hS hm exact ⟨hF, hC, by simpa only [add_zero, one_mul] using hS, hm⟩ /- The group-size contribution is negligible in the entropy exponent. -/ theorem tendsto_rpow_div_rpow_log {d η : ℝ} (hdη : d < η) : Tendsto (fun y : ℝ => y ^ d / (y ^ η * Real.log y)) atTop (𝓝 0) := by have h := (tendsto_rpow_div_rpow hdη).div_atTop Real.tendsto_log_atTop simpa only [div_div] using h end section open Filter open scoped Topology /- Taking logarithms of the finite Bernoulli counting lower bound. -/ theorem log_lower_of_bernoulli_count {C H ρ : ℝ} {k : ℕ} (hH : 0 < H) (hρ : 0 < ρ) (hcount : 1 / (2 * H) / ρ ^ k ≤ C) : (k : ℝ) * Real.log (1 / ρ) - Real.log (2 * H) ≤ Real.log C := by have hbase : 0 < 1 / (2 * H) := by positivity have hlog := Real.log_le_log (div_pos hbase (pow_pos hρ k)) hcount rw [Real.log_div hbase.ne' (pow_ne_zero k hρ.ne'), Real.log_div one_ne_zero (by positivity : 2 * H ≠ 0), Real.log_one, Real.log_pow] at hlog rw [Real.log_div one_ne_zero hρ.ne', Real.log_one] linarith /- A generic normalized entropy criterion. The number of choices is controlled by the retained subset size and reciprocal sampling probability, while group size is negligible. -/ theorem eventual_power_lower_of_entropy_limits (C X H ρ t l : ℝ → ℝ) (k : ℝ → ℕ) {a κ d b : ℝ} (hpos : ∀ᶠ y in atTop, 0 < X y ∧ 0 < H y ∧ 0 < ρ y ∧ 0 < t y ∧ 0 < l y) (hcount : ∀ᶠ y in atTop, 1 / (2 * H y) / ρ y ^ k y ≤ C y) (hprob : ∀ᶠ y in atTop, a * l y ≤ Real.log (1 / ρ y)) (hk : Tendsto (fun y => (k y : ℝ) / t y) atTop (𝓝 κ)) (hgroup : Tendsto (fun y => Real.log (2 * H y) / (t y * l y)) atTop (𝓝 0)) (hsize : Tendsto (fun y => Real.log (X y) / (t y * l y)) atTop (𝓝 d)) (hmargin : b * d < κ * a) : ∀ᶠ y in atTop, X y ^ b ≤ C y := by have hentropy := ((hk.mul_const a).sub hgroup).sub (hsize.const_mul b) have hpositive : 0 < κ * a - 0 - b * d := by linarith have hev := hentropy.eventually_const_lt hpositive filter_upwards [hpos, hcount, hprob, hev] with y hy hCy hρy he obtain ⟨hX, hH, hρ, ht, hl⟩ := hy have hC : 0 < C y := lt_of_lt_of_le (by positivity) hCy have hlog := log_lower_of_bernoulli_count hH hρ hCy have hprob' := mul_le_mul_of_nonneg_left hρy (Nat.cast_nonneg (k y)) have heq : ((k y : ℝ) * (a * l y) - Real.log (2 * H y) - b * Real.log (X y)) / (t y * l y) = (k y : ℝ) / t y * a - Real.log (2 * H y) / (t y * l y) - b * (Real.log (X y) / (t y * l y)) := by field_simp have hnum : 0 < (k y : ℝ) * (a * l y) - Real.log (2 * H y) - b * Real.log (X y) := by apply (div_pos_iff_of_pos_right (mul_pos ht hl)).mp rw [heq] exact he apply (Real.log_le_log_iff (Real.rpow_pos_of_pos hX b) hC).mp rw [Real.log_rpow hX] linarith /- At the Carmichael size scale the logarithmic size has normalized limit `1+ν`. -/ theorem tendsto_log_carmichaelSizeParameter_normalized (η ν : ℝ) : Tendsto (fun y => Real.log (carmichaelSizeParameter η ν y) / (y ^ η * Real.log y)) atTop (𝓝 (1 + ν)) := by have hlog : Tendsto (fun y : ℝ => Real.log 5 / Real.log y) atTop (𝓝 0) := tendsto_const_nhds.div_atTop Real.tendsto_log_atTop have hlim := (hlog.add_const 1).const_mul (1 + ν) simp only [zero_add, mul_one] at hlim apply hlim.congr' filter_upwards [eventually_gt_atTop (1 : ℝ)] with y hy have hy0 : 0 < y := by linarith have hp : 0 < y ^ η := Real.rpow_pos_of_pos hy0 η have hl : 0 < Real.log y := Real.log_pos hy unfold carmichaelSizeParameter rw [Real.log_rpow (by positivity : 0 < 5 * y), Real.log_mul (by norm_num : (5 : ℝ) ≠ 0) hy0.ne'] field_simp /- The floor used for the minimum selected size has the expected normalized limit. -/ theorem tendsto_floor_subset_size_ratio {η ν : ℝ} (hη : 0 < η) (hν : ν ≤ 1) : Tendsto (fun y : ℝ => (⌊(1 - ν) * y ^ η⌋₊ : ℝ) / y ^ η) atTop (𝓝 (1 - ν)) := (tendsto_nat_floor_mul_div_atTop (sub_nonneg.mpr hν)).comp (tendsto_rpow_atTop hη) /- A power-sized reservoir supplies the required reciprocal sampling entropy. -/ theorem log_reciprocal_sampling_lower {y η σ n : ℝ} (hy : 0 < y) (hn : y ^ (1 - σ) ≤ n) : (1 - η - σ) * Real.log y ≤ Real.log (1 / (y ^ η / n)) := by have hnpos : 0 < n := lt_of_lt_of_le (Real.rpow_pos_of_pos hy _) hn have htpos : 0 < y ^ η := Real.rpow_pos_of_pos hy _ have hlog := Real.log_le_log (Real.rpow_pos_of_pos hy _) hn rw [Real.log_rpow hy] at hlog rw [Real.log_div one_ne_zero (div_ne_zero htpos.ne' hnpos.ne'), Real.log_one, Real.log_div htpos.ne' hnpos.ne', Real.log_rpow hy] linarith /- A fixed factor of two does not affect a negligible normalized logarithmic group size. -/ theorem tendsto_log_two_mul_normalized {η : ℝ} (hη : 0 < η) (H : ℝ → ℝ) (hH : ∀ᶠ y in atTop, 0 < H y) (hgroup : Tendsto (fun y => Real.log (H y) / (y ^ η * Real.log y)) atTop (𝓝 0)) : Tendsto (fun y => Real.log (2 * H y) / (y ^ η * Real.log y)) atTop (𝓝 0) := by have hscale : Tendsto (fun y : ℝ => y ^ η * Real.log y) atTop atTop := (tendsto_rpow_atTop hη).atTop_mul_atTop₀ Real.tendsto_log_atTop have hc : Tendsto (fun y : ℝ => Real.log 2 / (y ^ η * Real.log y)) atTop (𝓝 0) := tendsto_const_nhds.div_atTop hscale have hlim := hc.add hgroup simp only [add_zero] at hlim apply hlim.congr' filter_upwards [hH] with y hy rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) hy.ne', add_div] section variable {η ν σ ε : ℝ} (hη : 0 < η) (hν0 : 0 ≤ ν) (hν1 : ν ≤ 1) (hmargin : 1 - ε < ((1 - ν) / (1 + ν)) * (1 - η - σ)) include η ν σ ε hη hν0 hν1 hmargin /- A near-linear reservoir and negligible logarithmic group size turn the finite entropy count into the desired all-large-X density exponent. -/ theorem eventual_carmichael_power_lower_of_entropy (n H : ℝ → ℝ) (hH : ∀ᶠ y in atTop, 0 < H y) (hn : ∀ᶠ y in atTop, y ^ (1 - σ) ≤ n y) (hgroup : Tendsto (fun y => Real.log (H y) / (y ^ η * Real.log y)) atTop (𝓝 0)) (hcount : ∀ᶠ y in atTop, 1 / (2 * H y) / (y ^ η / n y) ^ ⌊(1 - ν) * y ^ η⌋₊ ≤ Erdos1057.carmichaelCounting (carmichaelSizeParameter η ν y)) : ∀ᶠ x in atTop, x ^ (1 - ε) ≤ Erdos1057.carmichaelCounting x := by apply eventually_of_carmichaelSizeParameter hη.le hν0 have hpos : ∀ᶠ y : ℝ in atTop, 0 < carmichaelSizeParameter η ν y ∧ 0 < H y ∧ 0 < y ^ η / n y ∧ 0 < y ^ η ∧ 0 < Real.log y := by filter_upwards [hH, hn, eventually_gt_atTop (1 : ℝ)] with y hHy hny hy have hy0 : 0 < y := by linarith have hnpos : 0 < n y := lt_of_lt_of_le (Real.rpow_pos_of_pos hy0 _) hny have htpos : 0 < y ^ η := Real.rpow_pos_of_pos hy0 _ exact ⟨Real.rpow_pos_of_pos (by positivity) _, hHy, div_pos htpos hnpos, htpos, Real.log_pos hy⟩ have hprob : ∀ᶠ y : ℝ in atTop, (1 - η - σ) * Real.log y ≤ Real.log (1 / (y ^ η / n y)) := by filter_upwards [hn, eventually_gt_atTop (0 : ℝ)] with y hny hy exact log_reciprocal_sampling_lower hy hny have hmargin' : (1 - ε) * (1 + ν) < (1 - ν) * (1 - η - σ) := by rw [div_mul_eq_mul_div] at hmargin exact (lt_div_iff₀ (by linarith : 0 < 1 + ν)).mp hmargin exact eventual_power_lower_of_entropy_limits (fun y => Erdos1057.carmichaelCounting (carmichaelSizeParameter η ν y)) (carmichaelSizeParameter η ν) H (fun y => y ^ η / n y) (fun y => y ^ η) Real.log (fun y => ⌊(1 - ν) * y ^ η⌋₊) hpos hcount hprob (tendsto_floor_subset_size_ratio hη hν1) (tendsto_log_two_mul_normalized hη H hH hgroup) (tendsto_log_carmichaelSizeParameter_normalized η ν) hmargin' /- The exponential-mass form produced by the finite transfer has the same entropy consequence. -/ theorem eventual_carmichael_power_lower_of_exp_entropy (n U : ℝ → ℝ) (hn : ∀ᶠ y in atTop, y ^ (1 - σ) ≤ n y) (hgroup : Tendsto (fun y => U y / (y ^ η * Real.log y)) atTop (𝓝 0)) (hcount : ∀ᶠ y in atTop, Real.exp (-U y) / 2 * (n y / y ^ η) ^ ⌊(1 - ν) * y ^ η⌋₊ ≤ Erdos1057.carmichaelCounting (carmichaelSizeParameter η ν y)) : ∀ᶠ x in atTop, x ^ (1 - ε) ≤ Erdos1057.carmichaelCounting x := by apply eventual_carmichael_power_lower_of_entropy hη hν0 hν1 hmargin n (fun y => Real.exp (U y)) (Eventually.of_forall (fun y => Real.exp_pos _)) hn · simpa only [Real.log_exp] using hgroup · filter_upwards [hcount] with y hy convert hy using 1 rw [Real.exp_neg] simp only [div_eq_mul_inv, mul_inv_rev] ring_nf simp only [inv_inv] ring end end section end section end section end section open Filter /- All primes in the ambient interval at a real scale. -/ noncomputable def ambientPrimes (y : ℝ) : Finset ℕ := (Finset.Icc 1 ⌊5 * y⌋₊).filter fun p => p.Prime ∧ 2 * y < (p : ℝ) end section open Filter open scoped Topology /- Any fixed multiple of the modulus logarithm is eventually absorbed by an arbitrarily small positive increase in its power exponent. -/ theorem eventually_mul_rpow_log_five_mul_le_rpow (δ : ℝ) {σ : ℝ} (hσ : 0 < σ) (d : ℝ) : ∀ᶠ y : ℝ in atTop, d * y ^ δ * Real.log (5 * y) ≤ y ^ (δ + σ) := by filter_upwards [eventually_mul_rpow_log_add_le_rpow (a := 0) (b := σ) (c := 1) hσ hσ zero_lt_one d (d * Real.log 5), eventually_gt_atTop (0 : ℝ)] with y h hy have hlog : d * Real.log (5 * y) ≤ y ^ σ := by rw [Real.log_mul (by norm_num) (ne_of_gt hy)] simp only [Real.rpow_zero, mul_one, one_mul] at h nlinarith calc d * y ^ δ * Real.log (5 * y) = y ^ δ * (d * Real.log (5 * y)) := by ring _ ≤ y ^ δ * y ^ σ := mul_le_mul_of_nonneg_left hlog (Real.rpow_nonneg hy.le _) _ = y ^ (δ + σ) := (Real.rpow_add hy δ σ).symm /- The threshold is uniform in the natural number whose logarithm is bounded. The result also holds at `q = 0`, under Mathlib's total logarithm conventions. -/ theorem eventually_log_natLog_le_rpow (δ : ℝ) {σ : ℝ} (hσ : 0 < σ) : ∀ᶠ y : ℝ in atTop, ∀ q : ℕ, Real.log (q : ℝ) ≤ y ^ δ * Real.log (5 * y) → Real.log (q : ℝ) ≤ y ^ (δ + σ) ∧ (Nat.log 2 q : ℝ) ≤ y ^ (δ + σ) := by filter_upwards [eventually_mul_rpow_log_five_mul_le_rpow δ hσ 1, eventually_mul_rpow_log_five_mul_le_rpow δ hσ (1 / Real.log 2)] with y hreal hbase intro q hlog have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) refine ⟨hlog.trans (by simpa only [one_mul] using hreal), ?_⟩ calc (Nat.log 2 q : ℝ) ≤ Real.logb 2 (q : ℝ) := by simpa using Real.natLog_le_logb q 2 _ = Real.log (q : ℝ) / Real.log 2 := rfl _ ≤ (y ^ δ * Real.log (5 * y)) / Real.log 2 := div_le_div_of_nonneg_right hlog hlog2.le _ = (1 / Real.log 2) * y ^ δ * Real.log (5 * y) := by ring _ ≤ y ^ (δ + σ) := hbase theorem log_card_zmod_units_le {L : ℕ} (hL : 0 < L) : Real.log (Nat.card (ZMod L)ˣ : ℝ) ≤ Real.log (L : ℝ) := by let : NeZero L := ⟨ne_of_gt hL⟩ apply Real.log_le_log · exact_mod_cast (Nat.card_pos (α := (ZMod L)ˣ)) · exact_mod_cast card_zmod_units_le hL /- A single threshold bounds both logarithms of every unit group of every positive modulus satisfying the smooth-modulus estimate. -/ theorem eventually_unitGroup_log_natLog_le_rpow (δ : ℝ) {σ : ℝ} (hσ : 0 < σ) : ∀ᶠ y : ℝ in atTop, ∀ L : ℕ, 0 < L → Real.log (L : ℝ) ≤ y ^ δ * Real.log (5 * y) → Real.log (Nat.card (ZMod L)ˣ : ℝ) ≤ y ^ (δ + σ) ∧ (Nat.log 2 (Nat.card (ZMod L)ˣ) : ℝ) ≤ y ^ (δ + σ) := by filter_upwards [eventually_log_natLog_le_rpow δ hσ] with y hy intro L hL hlog exact hy _ ((log_card_zmod_units_le hL).trans hlog) end section open Filter open scoped Topology end section open Filter end section open Filter Set open scoped Topology theorem carmichaelCounting_nonneg (x : ℝ) : 0 ≤ Erdos1057.carmichaelCounting x := by unfold Erdos1057.carmichaelCounting positivity theorem carmichaelCounting_le {x : ℝ} (hx : 0 ≤ x) : Erdos1057.carmichaelCounting x ≤ x := by have hsub : {n : ℕ | IsCarmichael n ∧ (n : ℝ) ≤ x} ⊆ Set.Icc 1 ⌊x⌋₊ := by intro n hn refine ⟨?_, (Nat.le_floor_iff hx).2 hn.2⟩ have hn' := hn.1 1 (by omega) (Nat.coprime_one_right n) exact Nat.le_of_lt hn'.2.2 have hcard := Set.ncard_le_ncard hsub (Set.finite_Icc 1 ⌊x⌋₊) simp only [Set.ncard_Icc_nat, Nat.add_sub_cancel] at hcard exact (Nat.cast_le.mpr hcard).trans (Nat.floor_le hx) theorem log_ratio_le_one {x : ℝ} (hx : 1 < x) : Real.log (Erdos1057.carmichaelCounting x) / Real.log x ≤ 1 := by have hx0 : 0 < x := lt_trans zero_lt_one hx apply (div_le_iff₀ (Real.log_pos hx)).2 rw [one_mul] by_cases hc : Erdos1057.carmichaelCounting x = 0 · simpa [hc] using (Real.log_pos hx).le · exact Real.log_le_log (lt_of_le_of_ne (carmichaelCounting_nonneg x) (Ne.symm hc)) (carmichaelCounting_le hx0.le) /- The lower bound still needed from the number-theoretic argument. -/ def NearLinearLowerBound : Prop := ∀ ε : ℝ, 0 < ε → ∀ᶠ x : ℝ in atTop, x ^ (1 - ε) ≤ Erdos1057.carmichaelCounting x /- The final analytic step, conditional on a near-linear counting lower bound. -/ theorem counting_limit_of_lower_bound (h : NearLinearLowerBound) : Tendsto (fun x : ℝ => Real.log (Erdos1057.carmichaelCounting x) / Real.log x) atTop (𝓝 1) := by apply tendsto_order.2 constructor · intro a ha have he : 0 < (1 - a) / 2 := by linarith filter_upwards [h ((1 - a) / 2) he, eventually_gt_atTop (1 : ℝ)] with x hl hx have hx0 : 0 < x := lt_trans zero_lt_one hx have hr : 0 < x ^ (1 - (1 - a) / 2) := Real.rpow_pos_of_pos hx0 _ have hlog := Real.log_le_log hr hl rw [Real.log_rpow hx0] at hlog have hratio : 1 - (1 - a) / 2 ≤ Real.log (Erdos1057.carmichaelCounting x) / Real.log x := (le_div_iff₀ (Real.log_pos hx)).2 hlog linarith · intro a ha filter_upwards [eventually_gt_atTop (1 : ℝ)] with x hx exact lt_of_le_of_lt (log_ratio_le_one hx) ha /- This has an extra hypothesis and is not the unconditional challenge target. -/ theorem target_of_lower_bound (h : NearLinearLowerBound) : fcTypeOfName% "Erdos1057.erdos_1057" := by exact ⟨fun _ => counting_limit_of_lower_bound h, fun _ => True.intro⟩ end section open Filter open scoped Topology end section end section /- A nonnegative decreasing weight costs at most twice its initial value when all complex prefix sums are bounded. This is finite summation by parts. -/ theorem norm_sum_Ioc_smul_le_of_antitone (f : ℕ → ℝ) (g : ℕ → ℂ) {m n : ℕ} (hmn : m < n) {B : ℝ} (hf : ∀ i ∈ Finset.Icc (m + 1) n, 0 ≤ f i) (hanti : AntitoneOn f (Set.Icc (m + 1) n)) (hprefix : ∀ i ∈ Finset.Icc m n, ‖∑ j ∈ Finset.range (i + 1), g j‖ ≤ B) : ‖∑ i ∈ Finset.Ioc m n, f i • g i‖ ≤ 2 * f (m + 1) * B := by have hm1 : m + 1 ≤ n := by omega have hm1mem : m + 1 ∈ Finset.Icc (m + 1) n := Finset.mem_Icc.mpr ⟨le_rfl, hm1⟩ have hnmem : n ∈ Finset.Icc (m + 1) n := Finset.mem_Icc.mpr ⟨hm1, le_rfl⟩ have hsum : ∀ i ∈ Finset.Ioc m (n - 1), ‖(f (i + 1) - f i) • (∑ j ∈ Finset.range (i + 1), g j)‖ ≤ (f i - f (i + 1)) * B := by intro i hi obtain ⟨hmi, hin⟩ := Finset.mem_Ioc.mp hi have hdiff : f (i + 1) ≤ f i := hanti ⟨by omega, by omega⟩ ⟨by omega, by omega⟩ (by omega) rw [norm_smul, Real.norm_eq_abs, abs_of_nonpos (sub_nonpos.mpr hdiff), neg_sub] exact mul_le_mul_of_nonneg_left (hprefix i (Finset.mem_Icc.mpr ⟨by omega, by omega⟩)) (sub_nonneg.mpr hdiff) have htel : (∑ i ∈ Finset.Ioc m (n - 1), (f i - f (i + 1))) = f (m + 1) - f n := by rw [← Finset.Ico_add_one_add_one_eq_Ioc, Nat.sub_add_cancel (by omega : 1 ≤ n)] calc _ = -(∑ i ∈ Finset.Ico (m + 1) n, (f (i + 1) - f i)) := by rw [← Finset.sum_neg_distrib] apply Finset.sum_congr rfl intro i hi ring _ = _ := by rw [Finset.sum_Ico_sub f hm1]; ring rw [Finset.sum_Ioc_by_parts f g hmn] calc _ ≤ ‖f n • (∑ j ∈ Finset.range (n + 1), g j)‖ + ‖f (m + 1) • (∑ j ∈ Finset.range (m + 1), g j)‖ + ‖∑ i ∈ Finset.Ioc m (n - 1), (f (i + 1) - f i) • (∑ j ∈ Finset.range (i + 1), g j)‖ := (norm_sub_le _ _).trans (add_le_add (norm_sub_le _ _) le_rfl) _ ≤ f n * B + f (m + 1) * B + ∑ i ∈ Finset.Ioc m (n - 1), (f i - f (i + 1)) * B := by gcongr · rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (hf n hnmem)] exact mul_le_mul_of_nonneg_left (hprefix n (Finset.mem_Icc.mpr ⟨hmn.le, le_rfl⟩)) (hf n hnmem) · rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (hf (m + 1) hm1mem)] exact mul_le_mul_of_nonneg_left (hprefix m (Finset.mem_Icc.mpr ⟨le_rfl, hmn.le⟩)) (hf (m + 1) hm1mem) · exact (norm_sum_le _ _).trans (Finset.sum_le_sum hsum) _ = 2 * f (m + 1) * B := by rw [← Finset.sum_mul, htel]; ring end section noncomputable def twistedPsi {q : ℕ} (χ : DirichletCharacter ℂ q) (x : ℝ) : ℂ := ∑ n ∈ Finset.Ioc 0 ⌊x⌋₊, (ArithmeticFunction.vonMangoldt n : ℂ) * χ (n : ZMod q) noncomputable def twistedTheta {q : ℕ} (χ : DirichletCharacter ℂ q) (x : ℝ) : ℂ := ∑ p ∈ (Finset.Ioc 0 ⌊x⌋₊).filter Nat.Prime, (Real.log p : ℂ) * χ (p : ZMod q) /- Removing nontrivial prime powers is uniformly dominated by the untwisted error. -/ theorem norm_twistedPsi_sub_twistedTheta_le {q : ℕ} (χ : DirichletCharacter ℂ q) (x : ℝ) : ‖twistedPsi χ x - twistedTheta χ x‖ ≤ Chebyshev.psi x - Chebyshev.theta x := by classical have hid : twistedPsi χ x - twistedTheta χ x = ∑ n ∈ (Finset.Ioc 0 ⌊x⌋₊).filter (fun n => ¬n.Prime), (ArithmeticFunction.vonMangoldt n : ℂ) * χ (n : ZMod q) := by unfold twistedPsi twistedTheta simp only [Finset.sum_filter, ← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro n hn by_cases hp : n.Prime · simp [hp, ArithmeticFunction.vonMangoldt_apply_prime hp] · simp [hp] rw [hid, Chebyshev.psi_sub_theta_eq_sum_not_prime] apply (norm_sum_le _ _).trans apply Finset.sum_le_sum intro n hn rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg ArithmeticFunction.vonMangoldt_nonneg] exact mul_le_of_le_one_right ArithmeticFunction.vonMangoldt_nonneg (χ.norm_le_one _) /- Explicit modulus-independent prime-power removal. -/ theorem norm_twistedPsi_sub_twistedTheta_le_sqrt {q : ℕ} (χ : DirichletCharacter ℂ q) {x : ℝ} (hx : 1 ≤ x) : ‖twistedPsi χ x - twistedTheta χ x‖ ≤ 2 * Real.sqrt x * Real.log x := (norm_twistedPsi_sub_twistedTheta_le χ x).trans (Chebyshev.psi_sub_theta_le hx) /- A prefix estimate for the Mangoldt sum gives one for the prime-log sum. -/ theorem norm_twistedTheta_le {q : ℕ} (χ : DirichletCharacter ℂ q) {x B : ℝ} (hx : 1 ≤ x) (hψ : ‖twistedPsi χ x‖ ≤ B) : ‖twistedTheta χ x‖ ≤ B + 2 * Real.sqrt x * Real.log x := by have he : twistedTheta χ x = twistedPsi χ x - (twistedPsi χ x - twistedTheta χ x) := by ring rw [he] exact (norm_sub_le _ _).trans (add_le_add hψ (norm_twistedPsi_sub_twistedTheta_le_sqrt χ hx)) end section noncomputable def primeLogTerm {q : ℕ} (χ : DirichletCharacter ℂ q) (n : ℕ) : ℂ := if n.Prime then (Real.log n : ℂ) * χ (n : ZMod q) else 0 theorem sum_primeLogTerm_range {q : ℕ} (χ : DirichletCharacter ℂ q) (n : ℕ) : (∑ j ∈ Finset.range (n + 1), primeLogTerm χ j) = twistedTheta χ n := by rw [twistedTheta, Finset.sum_filter] simp only [Nat.floor_natCast] rw [Nat.range_succ_eq_Icc_zero, ← Finset.add_sum_Ioc_eq_sum_Icc (Nat.zero_le n)] simp only [primeLogTerm, Nat.not_prime_zero, ↓reduceIte, zero_add] /- A uniform prefix bound for prime-log sums controls every terminal interval. -/ theorem norm_prime_sum_Ioc_le {q : ℕ} (χ : DirichletCharacter ℂ q) {m n : ℕ} (hm : 1 ≤ m) {B : ℝ} (hB : 0 ≤ B) (hprefix : ∀ k : ℕ, k ≤ n → ‖twistedTheta χ k‖ ≤ B) : ‖∑ p ∈ (Finset.Ioc m n).filter Nat.Prime, χ (p : ZMod q)‖ ≤ 4 * B := by classical by_cases hmn : m < n · have hlog : ∀ i : ℕ, m + 1 ≤ i → 0 < Real.log i := by intro i hi apply Real.log_pos exact_mod_cast (show 1 < i by omega) have hf : ∀ i ∈ Finset.Icc (m + 1) n, 0 ≤ 1 / Real.log i := by intro i hi exact (one_div_pos.mpr (hlog i (Finset.mem_Icc.mp hi).1)).le have hanti : AntitoneOn (fun i : ℕ => 1 / Real.log i) (Set.Icc (m + 1) n) := by intro i hi j hj hij exact one_div_le_one_div_of_le (hlog i hi.1) (Real.log_le_log (by exact_mod_cast (show 0 < i by have := hi.1; omega)) (by exact_mod_cast hij)) have hab := norm_sum_Ioc_smul_le_of_antitone (fun i : ℕ => 1 / Real.log i) (primeLogTerm χ) hmn hf hanti (fun k hk => by rw [sum_primeLogTerm_range] exact hprefix k (Finset.mem_Icc.mp hk).2) have heq : (∑ i ∈ Finset.Ioc m n, (1 / Real.log i) • primeLogTerm χ i) = ∑ p ∈ (Finset.Ioc m n).filter Nat.Prime, χ (p : ZMod q) := by rw [Finset.sum_filter] apply Finset.sum_congr rfl intro i hi by_cases hp : i.Prime · simp only [primeLogTerm, hp, ↓reduceIte] rw [← Complex.real_smul, smul_smul] simp [(hlog i (by have := (Finset.mem_Ioc.mp hi).1; omega)).ne'] · simp [primeLogTerm, hp] rw [heq] at hab have hl2 : (1 : ℝ) / 2 ≤ Real.log 2 := by have hh := Real.one_sub_inv_le_log_of_pos (by norm_num : (0 : ℝ) < 2) norm_num at hh ⊢ exact hh have hln : (1 : ℝ) / 2 ≤ Real.log (m + 1 : ℕ) := hl2.trans (Real.log_le_log (by norm_num) (by exact_mod_cast (show 2 ≤ m + 1 by omega))) have hinv : 1 / Real.log (m + 1 : ℕ) ≤ 2 := (div_le_iff₀ (hlog (m + 1) le_rfl)).mpr (by linarith) exact hab.trans (by nlinarith [mul_le_mul_of_nonneg_right hinv hB]) · simp only [Finset.Ioc_eq_empty_of_le (by omega : n ≤ m), Finset.filter_empty, Finset.sum_empty, norm_zero] positivity end section end section /- Away from prime divisors of the level, a character and its primitive character agree. At the excluded primes their difference has norm at most one. -/ theorem primitive_prime_value_error {q p : ℕ} (hq : 0 < q) (χ : DirichletCharacter ℂ q) (hp : p.Prime) : ‖χ (p : ZMod q) - χ.primitiveCharacter (p : ZMod χ.conductor)‖ ≤ if p ∈ q.primeFactors then (1 : ℝ) else 0 := by classical by_cases hdiv : p ∣ q · have hc : ¬ IsCoprime (p : ℤ) q := by rw [Nat.isCoprime_iff_coprime, hp.coprime_iff_not_dvd] exact not_not.mpr hdiv have hz := (χ.apply_eq_zero_iff (p : ℤ)).mpr hc simp only [Int.cast_natCast] at hz rw [hz, zero_sub, norm_neg, if_pos (hp.mem_primeFactors hdiv hq.ne')] exact χ.primitiveCharacter.norm_le_one _ · have he := χ.primitiveCharacter_apply_of_isCoprime (Nat.isCoprime_iff_coprime.mpr (hp.coprime_iff_not_dvd.mpr hdiv)) simp only [Int.cast_natCast] at he rw [he, sub_self, norm_zero] split_ifs <;> norm_num /- Distinct prime factors consume at least one factor of two each. -/ theorem primeFactors_card_le_log_div_log_two {q : ℕ} (hq : 0 < q) : (q.primeFactors.card : ℝ) ≤ Real.log q / Real.log 2 := by have hpow : 2 ^ q.primeFactors.card ≤ q := (Finset.pow_card_le_prod q.primeFactors (fun p => p) 2 (fun p hp => (Nat.prime_of_mem_primeFactors hp).two_le)).trans (Nat.le_of_dvd hq (Nat.prod_primeFactors_dvd q)) have hpow' : (2 : ℝ) ^ q.primeFactors.card ≤ q := by exact_mod_cast hpow have hh := Real.log_le_log (pow_pos (by norm_num : (0 : ℝ) < 2) _) hpow' rw [Real.log_pow] at hh exact (le_div_iff₀ (Real.log_pos (by norm_num : (1 : ℝ) < 2))).mpr hh theorem primeFactors_card_le_two_log {q : ℕ} (hq : 0 < q) : (q.primeFactors.card : ℝ) ≤ 2 * Real.log q := by have hcard := primeFactors_card_le_log_div_log_two hq have hlog : (1 : ℝ) / 2 ≤ Real.log 2 := by have hh := Real.one_sub_inv_le_log_of_pos (by norm_num : (0 : ℝ) < 2) norm_num at hh ⊢ exact hh have hm := (le_div_iff₀ (Real.log_pos (by norm_num : (1 : ℝ) < 2))).mp hcard have hc : (0 : ℝ) ≤ q.primeFactors.card := by positivity nlinarith end section end section open OAI.Ostmann end section open Filter open scoped Topology BigOperators /- The pointwise prime and character data sufficient for the counting argument. This proposition is an input contract, not an assumed theorem. -/ def PowerPrimeReservoirAt (β δ σ y : ℝ) : Prop := ∃ (L : ℕ) (S P : Finset ℕ) (g : ℕ → (ZMod L)ˣ), 0 < L ∧ P ⊆ S ∧ (∀ p ∈ S, p.Prime) ∧ (∀ p ∈ S, (p : ℝ) ≤ 5 * y) ∧ (∀ p ∈ P, p - 1 ∣ L) ∧ (∀ p ∈ P, (g p : ZMod L) = (p : ZMod L)) ∧ y ^ (1 - σ) ≤ (P.card : ℝ) ∧ Real.log (Nat.card ((ZMod L)ˣ) : ℝ) ≤ y ^ (δ + σ) ∧ (Nat.log 2 (Nat.card ((ZMod L)ˣ)) : ℝ) ≤ y ^ (δ + σ) ∧ ∀ ξ : (ZMod L)ˣ →* ℂ, ξ ≠ 1 → ‖∑ p ∈ S, ξ (g p)‖ ≤ y ^ (β + 2 * δ + σ) theorem asymptotic_density_parameters_at {β ε : ℝ} (hβ : β < 1) (hε : 0 < ε) : ∃ δ η ν σ : ℝ, 0 < δ ∧ δ < 1 / 16 ∧ 0 < σ ∧ 0 < ν ∧ ν < 1 ∧ 2 * δ + 4 * σ < η ∧ η < 1 - σ ∧ β + 2 * δ + 2 * σ < 1 ∧ 1 - ε < ((1 - ν) / (1 + ν)) * (1 - η - 2 * σ) := by let e : ℝ := min (min (ε / 16) ((1 - β) / 16)) (1 / 32) have he0 : 0 < e := lt_min (lt_min (by linarith) (by linarith)) (by norm_num) have heε : e ≤ ε / 16 := (min_le_left _ _).trans (min_le_left _ _) have heβ : e ≤ (1 - β) / 16 := (min_le_left _ _).trans (min_le_right _ _) have he1 : e ≤ 1 / 32 := min_le_right _ _ refine ⟨e / 8, e, e, e / 16, by linarith, by linarith, by linarith, he0, by linarith, by linarith, by linarith, by linarith, ?_⟩ rw [div_mul_eq_mul_div] apply (lt_div_iff₀ (by linarith : 0 < 1 + e)).mpr nlinarith /- At fixed separated exponents, the finite construction supplies the entropy lower bound. -/ theorem eventually_entropy_bound_of_power_reservoir_at {β δ η ν σ : ℝ} (hδ : 0 < δ) (hσ : 0 < σ) (hν0 : 0 < ν) (hν1 : ν < 1) (hgap : 2 * δ + 4 * σ < η) (hησ : η < 1 - σ) (herror : β + 2 * δ + 2 * σ < 1) (hsupply : ∀ᶠ y in atTop, PowerPrimeReservoirAt β δ σ y) : ∀ᶠ y in atTop, ∃ n : ℕ, y ^ (1 - 2 * σ) ≤ (n : ℝ) ∧ Real.exp (-y ^ (δ + σ)) / 2 * ((n : ℝ) / y ^ η) ^ ⌊(1 - ν) * y ^ η⌋₊ ≤ Erdos1057.carmichaelCounting (carmichaelSizeParameter η ν y) := by have hη : 0 < η := by linarith have hpower : 0 < 1 - σ := by linarith have hsmall := eventually_mul_rpow_add_le_mul_rpow (a := β + 2 * δ + σ) (b := 1 - σ) hpower (by linarith) (by norm_num : (0 : ℝ) < 1) 64 0 have hfeasible := eventually_finite_sampling_feasible (d := δ + σ) (r := σ) (η := η) (σ := σ) (ν := ν) (K := 325) (by linarith) hσ.le (by linarith) hησ hν0 hν1 have htwopower := eventually_const_le_mul_rpow (η := σ) hσ (by norm_num : (0 : ℝ) < 1) 2 filter_upwards [hsupply, hsmall, hfeasible, htwopower, eventually_ge_atTop (1 : ℝ)] with y hs hyA hyF hyσ hy1 have hy0 : 0 < y := lt_of_lt_of_le zero_lt_one hy1 obtain ⟨L, S, P, g, hLpos, hPS, hprime, hbound, hL, hcompat, hN, hlogU, hlogD, hamb⟩ := hs let : NeZero L := ⟨hLpos.ne'⟩ have hNpos : 0 < (P.card : ℝ) := lt_of_lt_of_le (Real.rpow_pos_of_pos hy0 _) hN have hNQ : (P.card : ℝ) ≤ S.card := by exact_mod_cast Finset.card_le_card hPS have hQbound : (S.card : ℝ) ≤ 5 * y := prime_interval_card_le hy0.le hprime hbound have hA : 0 ≤ y ^ (β + 2 * δ + σ) := Real.rpow_nonneg hy0.le _ have hAN : 64 * y ^ (β + 2 * δ + σ) ≤ P.card := by have hAy : 64 * y ^ (β + 2 * δ + σ) ≤ y ^ (1 - σ) := by simpa only [add_zero, one_mul] using hyA exact hAy.trans hN obtain ⟨R, hR, hRlarge, hRsmall, hRbound⟩ := fejer_length_parameters hNpos hNQ hA hAN have hRpow : (R : ℝ) ≤ 325 * y ^ σ := by calc (R : ℝ) ≤ 65 * (S.card : ℝ) / P.card := hRbound _ ≤ 65 * (5 * y) / P.card := by gcongr _ ≤ 65 * (5 * y) / y ^ (1 - σ) := div_le_div_of_nonneg_left (by positivity) (Real.rpow_pos_of_pos hy0 _) hN _ = 325 * (y / y ^ (1 - σ)) := by ring _ = 325 * y ^ σ := by congr 1 calc y / y ^ (1 - σ) = y ^ (1 : ℝ) / y ^ (1 - σ) := by rw [Real.rpow_one] _ = y ^ ((1 : ℝ) - (1 - σ)) := (Real.rpow_sub hy0 1 (1 - σ)).symm _ = y ^ σ := by congr 1; ring have hD : 1 ≤ y ^ (δ + σ) := Real.one_le_rpow hy1 (by linarith) obtain ⟨n, hnlow, hnhigh, hncount⟩ := finite_carmichael_counting_bound S P hPS g (fun p hp => hprime p (hPS hp)) hL hcompat (by linarith : 1 ≤ 5 * y) (fun p hp => hbound p (hPS hp)) hD hlogD hlogU hR hRlarge hRsmall hamb have hnnew : y ^ (1 - 2 * σ) ≤ (n : ℝ) := by have htwo : 2 ≤ y ^ σ := by simpa only [one_mul] using hyσ have hmul := mul_le_mul_of_nonneg_left htwo (Real.rpow_nonneg hy0.le (1 - 2 * σ)) have heq : y ^ (1 - 2 * σ) * y ^ σ = y ^ (1 - σ) := by rw [← Real.rpow_add hy0] congr 1 ring rw [heq] at hmul linarith refine ⟨n, hnnew, ?_⟩ obtain ⟨hfourier, htail, hsampling, hsize⟩ := hyF have ht : 0 < y ^ η := Real.rpow_pos_of_pos hy0 _ have htn : 2 * y ^ η ≤ (n : ℝ) := by linarith have hk : (⌊(1 - ν) * y ^ η⌋₊ : ℝ) ≤ (1 - ν) * y ^ η := Nat.floor_le (by positivity) exact hncount (y ^ η) ν ⌊(1 - ν) * y ^ η⌋₊ ht htn hν0.le hν1.le hsize hk (hfourier R (by exact_mod_cast hR) hRpow) htail /- The analytic reservoir contract for every fixed pair of small exponents is sufficient for the exact Erdős 1057 target. This theorem does not assert that contract. -/ theorem target_of_power_prime_reservoirs_at {β : ℝ} (hβ : β < 1) (hsupply : ∀ δ : ℝ, 0 < δ → δ < 1 / 16 → ∀ σ : ℝ, 0 < σ → ∀ᶠ y in atTop, PowerPrimeReservoirAt β δ σ y) : fcTypeOfName% "Erdos1057.erdos_1057" := by classical apply target_of_lower_bound intro ε hε obtain ⟨δ, η, ν, σ, hδ, hδ16, hσ, hν0, hν1, hgap, hησ, herror, hmargin⟩ := asymptotic_density_parameters_at hβ hε have hη : 0 < η := by linarith have hfinite := eventually_entropy_bound_of_power_reservoir_at hδ hσ hν0 hν1 hgap hησ herror (hsupply δ hδ hδ16 σ hσ) let W : ℝ → ℕ → Prop := fun y n => y ^ (1 - 2 * σ) ≤ (n : ℝ) ∧ Real.exp (-y ^ (δ + σ)) / 2 * ((n : ℝ) / y ^ η) ^ ⌊(1 - ν) * y ^ η⌋₊ ≤ Erdos1057.carmichaelCounting (carmichaelSizeParameter η ν y) have hW : ∀ᶠ y in atTop, ∃ n : ℕ, W y n := hfinite let n : ℝ → ℕ := fun y => Classical.epsilon (W y) have hn : ∀ᶠ y in atTop, W y (n y) := hW.mono (fun y hy => Classical.epsilon_spec hy) apply eventual_carmichael_power_lower_of_exp_entropy (σ := 2 * σ) hη hν0.le hν1.le hmargin (fun y => (n y : ℝ)) (fun y => y ^ (δ + σ)) · exact hn.mono (fun y hy => hy.1) · exact tendsto_rpow_div_rpow_log (by linarith) · exact hn.mono (fun y hy => hy.2) end section open Complex Finset ArithmeticFunction open scoped BigOperators noncomputable def mangoldtTwist {q : ℕ} (χ : DirichletCharacter ℂ q) (n : ℕ) : ℂ := χ (n : ZMod q) * (ArithmeticFunction.vonMangoldt n : ℂ) noncomputable def smoothedTwistedPsi {q : ℕ} (χ : DirichletCharacter ℂ q) (x : ℝ) : ℂ := ∑ n ∈ Icc 1 ⌊x⌋₊, mangoldtTwist χ n * ((1 - (n : ℝ) / x : ℝ) : ℂ) open Complex Finset ArithmeticFunction open scoped BigOperators lemma riesz_smoothed_scale {q : ℕ} (χ : DirichletCharacter ℂ q) {x : ℝ} (hx : x ≠ 0) : (x : ℂ) * smoothedTwistedPsi χ x = ∑ n ∈ Icc 1 ⌊x⌋₊, mangoldtTwist χ n * ((x - (n : ℝ) : ℝ) : ℂ) := by rw [smoothedTwistedPsi, mul_sum] apply sum_congr rfl intro n hn have hxc : (x : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hx push_cast field_simp lemma riesz_smoothed_difference {q : ℕ} (χ : DirichletCharacter ℂ q) {x : ℝ} (hx : 0 < x) (m : ℕ) : (((x + m : ℝ) : ℂ) * smoothedTwistedPsi χ (x + m) - (x : ℂ) * smoothedTwistedPsi χ x) = (m : ℂ) * (∑ n ∈ Icc 1 ⌊x⌋₊, mangoldtTwist χ n) + ∑ n ∈ Icc (⌊x⌋₊ + 1) (⌊x⌋₊ + m), mangoldtTwist χ n * ((x + m - (n : ℝ) : ℝ) : ℂ) := by rw [riesz_smoothed_scale χ (by positivity), riesz_smoothed_scale χ hx.ne', Nat.floor_add_natCast hx.le] have hsplit (f : ℕ → ℂ) : (∑ n ∈ Icc 1 (⌊x⌋₊ + m), f n) = (∑ n ∈ Icc 1 ⌊x⌋₊, f n) + (∑ n ∈ Icc (⌊x⌋₊ + 1) (⌊x⌋₊ + m), f n) := by simpa only [Ico_add_one_right_eq_Icc] using (sum_Ico_consecutive f (by omega : 1 ≤ ⌊x⌋₊ + 1) (by omega : ⌊x⌋₊ + 1 ≤ (⌊x⌋₊ + m) + 1)).symm rw [hsplit] have hmain : (∑ n ∈ Icc 1 ⌊x⌋₊, mangoldtTwist χ n * ((x + m - (n : ℝ) : ℝ) : ℂ)) - (∑ n ∈ Icc 1 ⌊x⌋₊, mangoldtTwist χ n * ((x - (n : ℝ) : ℝ) : ℂ)) = (m : ℂ) * (∑ n ∈ Icc 1 ⌊x⌋₊, mangoldtTwist χ n) := by rw [← sum_sub_distrib, mul_sum] apply sum_congr rfl intro n hn push_cast ring linear_combination hmain lemma riesz_mangoldt_norm_le_log {q : ℕ} (χ : DirichletCharacter ℂ q) (n : ℕ) : ‖mangoldtTwist χ n‖ ≤ Real.log (n : ℝ) := by unfold mangoldtTwist rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg vonMangoldt_nonneg] exact (mul_le_mul_of_nonneg_right (χ.norm_le_one _) vonMangoldt_nonneg).trans (by simpa using (vonMangoldt_le_log (n := n))) lemma riesz_smoothed_remainder {q : ℕ} (χ : DirichletCharacter ℂ q) {x : ℝ} (hx : 0 < x) (m : ℕ) : ‖∑ n ∈ Icc (⌊x⌋₊ + 1) (⌊x⌋₊ + m), mangoldtTwist χ n * ((x + m - (n : ℝ) : ℝ) : ℂ)‖ ≤ (m : ℝ) ^ 2 * Real.log (x + m) := by have hy : 0 < x + (m : ℝ) := by positivity have hpoint (n : ℕ) (hn : n ∈ Icc (⌊x⌋₊ + 1) (⌊x⌋₊ + m)) : ‖mangoldtTwist χ n * ((x + m - (n : ℝ) : ℝ) : ℂ)‖ ≤ Real.log (x + m) * m := by obtain ⟨hnlo, hnhi⟩ := mem_Icc.mp hn have hn1 : 1 ≤ n := by omega have hnx : x < (n : ℝ) := (Nat.lt_floor_add_one x).trans_le (by exact_mod_cast hnlo) have hny : (n : ℝ) ≤ x + m := by have hb := Nat.floor_le hx.le have hc : (n : ℝ) ≤ (⌊x⌋₊ : ℝ) + m := by exact_mod_cast hnhi linarith have hwt : 0 ≤ x + m - (n : ℝ) := by linarith have hwtm : x + m - (n : ℝ) ≤ (m : ℝ) := by linarith have hlog : ‖mangoldtTwist χ n‖ ≤ Real.log (x + m) := (riesz_mangoldt_norm_le_log χ n).trans (Real.log_le_log (by exact_mod_cast (show 0 < n by omega)) hny) rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hwt] exact mul_le_mul hlog hwtm hwt (le_trans (norm_nonneg _) hlog) have hc : (Icc (⌊x⌋₊ + 1) (⌊x⌋₊ + m)).card = m := by rw [Nat.card_Icc] omega calc _ ≤ ∑ n ∈ Icc (⌊x⌋₊ + 1) (⌊x⌋₊ + m), ‖mangoldtTwist χ n * ((x + m - (n : ℝ) : ℝ) : ℂ)‖ := norm_sum_le _ _ _ ≤ ∑ _n ∈ Icc (⌊x⌋₊ + 1) (⌊x⌋₊ + m), Real.log (x + m) * m := sum_le_sum hpoint _ = _ := by rw [sum_const, hc, nsmul_eq_mul]; ring lemma riesz_twistedPsi_sum {q : ℕ} (χ : DirichletCharacter ℂ q) (x : ℝ) : twistedPsi χ x = ∑ n ∈ Icc 1 ⌊x⌋₊, mangoldtTwist χ n := by have he : Ioc 0 ⌊x⌋₊ = Icc 1 ⌊x⌋₊ := by ext n simp only [mem_Ioc, mem_Icc] omega simp [twistedPsi, mangoldtTwist, he, mul_comm] /- A completely finite unsmoothing inequality, with the short-interval cost bounded only by the elementary Mangoldt estimate Λ(n)≤log n. -/ theorem riesz_unsmoothing_bound {q : ℕ} (χ : DirichletCharacter ℂ q) {x : ℝ} (hx : 0 < x) {m : ℕ} (hm : 0 < m) : ‖twistedPsi χ x‖ ≤ ((x + m) * ‖smoothedTwistedPsi χ (x + m)‖ + x * ‖smoothedTwistedPsi χ x‖ + (m : ℝ) ^ 2 * Real.log (x + m)) / m := by have hmp : 0 < (m : ℝ) := by exact_mod_cast hm have he := riesz_smoothed_difference χ hx m have halg : (m : ℂ) * (∑ n ∈ Icc 1 ⌊x⌋₊, mangoldtTwist χ n) = (((x + m : ℝ) : ℂ) * smoothedTwistedPsi χ (x + m) - (x : ℂ) * smoothedTwistedPsi χ x) - ∑ n ∈ Icc (⌊x⌋₊ + 1) (⌊x⌋₊ + m), mangoldtTwist χ n * ((x + m - (n : ℝ) : ℝ) : ℂ) := by linear_combination -he rw [riesz_twistedPsi_sum] apply (le_div_iff₀ hmp).mpr calc _ = ‖(m : ℂ) * (∑ n ∈ Icc 1 ⌊x⌋₊, mangoldtTwist χ n)‖ := by rw [norm_mul, Complex.norm_natCast] ring _ ≤ ‖((x + m : ℝ) : ℂ) * smoothedTwistedPsi χ (x + m) - (x : ℂ) * smoothedTwistedPsi χ x‖ + ‖∑ n ∈ Icc (⌊x⌋₊ + 1) (⌊x⌋₊ + m), mangoldtTwist χ n * ((x + m - (n : ℝ) : ℝ) : ℂ)‖ := by rw [halg] exact norm_sub_le _ _ _ ≤ (‖((x + m : ℝ) : ℂ) * smoothedTwistedPsi χ (x + m)‖ + ‖(x : ℂ) * smoothedTwistedPsi χ x‖) + (m : ℝ) ^ 2 * Real.log (x + m) := add_le_add (norm_sub_le _ _) (riesz_smoothed_remainder χ hx m) _ = _ := by rw [norm_mul, norm_mul, Complex.norm_real, Complex.norm_real, Real.norm_eq_abs, Real.norm_eq_abs, abs_of_pos hx, abs_of_pos (by positivity : 0 < x + (m : ℝ))] end section open OAI.Ostmann Complex Set /- The finite contour argument gives a uniform smoothed estimate, with only logarithmic dependence on the conductor. It assumes only the zero-free input. -/ theorem character_riesz_bound_of_zero_free (hZ : PrimitiveZeroFreeHalfPlane) : ∃ D : ℝ, 0 < D ∧ ∀ (χ : PrimitiveComplexCharacter) (x : ℝ), 2 ≤ x → ‖characterRieszMean χ x‖ ≤ D * x ^ ((15 : ℝ) / 16) * (1 + Real.log (24 * (χ.modulus : ℝ) * (x ^ 2 + 2))) := by obtain ⟨K, C, hK, hC, hrect⟩ := characterRieszMean_rectangle_bound refine ⟨(K + 5 + 2 * C) * 9216, by positivity, ?_⟩ intro χ x hx let L : ℝ := 1 + Real.log (24 * (χ.modulus : ℝ) * (x ^ 2 + 2)) let M : ℝ := 9216 * L have hx0 : 0 < x := by linarith have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive have hq0 : (0 : ℝ) < χ.modulus := by linarith have hx2 : 1 ≤ x ^ 2 := by nlinarith have hL : 1 ≤ L := by have hh : 1 ≤ 24 * (χ.modulus : ℝ) * (x ^ 2 + 2) := by nlinarith have hl := Real.log_nonneg hh dsimp [L] linarith have hM : 1 ≤ M := by dsimp [M]; linarith have hzre (z : ℂ) (hz : z ∈ uIcc (15 / 16 : ℝ) 2 ×ℂ uIcc (-x ^ 2) (x ^ 2)) : 15 / 16 ≤ z.re ∧ z.re ≤ 2 ∧ |z.im| ≤ x ^ 2 := by have hz' : z.re ∈ Icc (15 / 16 : ℝ) 2 ∧ z.im ∈ Icc (-x ^ 2) (x ^ 2) := by simpa only [mem_reProdIm, uIcc_of_le (by norm_num : (15 / 16 : ℝ) ≤ 2), uIcc_of_le (by nlinarith : -x ^ 2 ≤ x ^ 2)] using hz exact ⟨hz'.1.1, hz'.1.2, abs_le.mpr hz'.2⟩ have hne : ∀ z ∈ uIcc (15 / 16 : ℝ) 2 ×ℂ uIcc (-x ^ 2) (x ^ 2), χ.L z ≠ 0 := by intro z hz apply hZ χ z linarith [(hzre z hz).1] have hbound : ∀ z ∈ uIcc (15 / 16 : ℝ) 2 ×ℂ uIcc (-x ^ 2) (x ^ 2), ‖logDeriv χ.L z‖ ≤ M := by intro z hz obtain ⟨hzlo, hzhi, hzim⟩ := hzre z hz have hh := character_logDeriv_bound hZ χ (ε := 1 / 16) (by norm_num) (by norm_num) z (by linarith) hzhi norm_num only [one_div, inv_pow, Nat.cast_ofNat] at hh have hl : Real.log (24 * (χ.modulus : ℝ) * (|z.im| + 2)) ≤ L := by have hhlog : Real.log (24 * (χ.modulus : ℝ) * (|z.im| + 2)) ≤ Real.log (24 * (χ.modulus : ℝ) * (x ^ 2 + 2)) := by apply Real.log_le_log (by positivity) gcongr dsimp [L] linarith dsimp [M] linarith have hraw := hrect χ x (15 / 16) 2 (x ^ 2) M (by linarith) (by norm_num) (by norm_num) (by norm_num) le_rfl (by positivity) (by linarith) hne hbound rw [Real.rpow_two] at hraw have hx24 : x ^ 2 ≤ (x ^ 2) ^ 2 := by nlinarith [sq_nonneg (x ^ 2 - 1)] have hquot : M * x ^ 2 / (x ^ 2) ^ 2 ≤ M := by apply (div_le_iff₀ (by positivity : 0 < (x ^ 2) ^ 2)).mpr exact mul_le_mul_of_nonneg_left hx24 (by linarith) have hquot0 : 0 ≤ M * x ^ 2 / (x ^ 2) ^ 2 := by positivity have herr : 2 * (M * x ^ 2 / (x ^ 2) ^ 2) * (2 - 15 / 16) ≤ 3 * M := by nlinarith have htail : 2 * (1 / (2 - 1) + C) * x ^ 2 / x ^ 2 = 2 * (1 + C) := by field_simp ring rw [htail] at hraw have hp : 1 ≤ x ^ ((15 : ℝ) / 16) := Real.one_le_rpow (by linarith) (by norm_num) have hscale : M ≤ M * x ^ ((15 : ℝ) / 16) := by nlinarith have hone : 1 ≤ M * x ^ ((15 : ℝ) / 16) := by nlinarith calc _ ≤ K * M * x ^ ((15 : ℝ) / 16) + 3 * M + 2 * (1 + C) := by linarith _ ≤ K * M * x ^ ((15 : ℝ) / 16) + 3 * (M * x ^ ((15 : ℝ) / 16)) + 2 * (1 + C) * (M * x ^ ((15 : ℝ) / 16)) := by apply add_le_add · exact add_le_add le_rfl (mul_le_mul_of_nonneg_left hscale (show (0 : ℝ) ≤ 3 by norm_num)) · simpa only [mul_one] using mul_le_mul_of_nonneg_left hone (show 0 ≤ 2 * (1 + C) by positivity) _ = _ := by dsimp [M, L]; ring end section open OAI.Ostmann Complex Finset theorem smoothedTwistedPsi_eq_riesz (χ : PrimitiveComplexCharacter) {x : ℝ} (hx : 0 < x) : smoothedTwistedPsi χ.character x = characterRieszMean χ x := by classical have hs (n : ℕ) (hn : n ∉ Icc 1 ⌊x⌋₊) : characterMangoldtCoefficient χ n * rieszPrimeTest (n / x) = 0 := by by_cases hn0 : n = 0 · subst n simp [characterMangoldtCoefficient] · have hlarge : ⌊x⌋₊ < n := by simp only [mem_Icc] at hn; omega have hnlarge : x < n := Nat.lt_of_floor_lt hlarge have hdiv : 1 < (n : ℝ) / x := (one_lt_div hx).mpr hnlarge simp [rieszPrimeTest, max_eq_right (by linarith : 1 - (n : ℝ) / x ≤ 0)] rw [characterRieszMean, tsum_eq_sum hs] unfold smoothedTwistedPsi apply sum_congr rfl intro n hn have hnle : (n : ℝ) ≤ x := (Nat.le_floor_iff hx.le).mp (mem_Icc.mp hn).2 have hdiv : (n : ℝ) / x ≤ 1 := (div_le_one hx).mpr hnle simp [mangoldtTwist, characterMangoldtCoefficient, rieszPrimeTest, max_eq_left (by linarith : 0 ≤ 1 - (n : ℝ) / x)] theorem riesz_conductor_log_bound {q x : ℝ} (hq : 1 ≤ q) (hx : 2 ≤ x) : 1 + Real.log (24 * q * (x ^ 2 + 2)) ≤ 12 * Real.log (q * x) := by have hx0 : 0 < x := by linarith have hq0 : 0 < q := by linarith have hlq : 0 ≤ Real.log q := Real.log_nonneg hq have hlx : Real.log 2 ≤ Real.log x := Real.log_le_log (by norm_num) hx have hl2 : 1 / 2 ≤ Real.log (2 : ℝ) := by have h := Real.one_sub_inv_le_log_of_pos (by norm_num : (0 : ℝ) < 2) norm_num at h ⊢ exact h have hl48 : Real.log (48 : ℝ) ≤ 6 * Real.log 2 := by have h := Real.log_le_log (by norm_num : (0 : ℝ) < 48) (by norm_num : (48 : ℝ) ≤ 2 ^ 6) simpa only [Real.log_pow, Nat.cast_ofNat] using h have harg : 24 * q * (x ^ 2 + 2) ≤ 48 * q * x ^ 2 := by nlinarith [mul_nonneg (show 0 ≤ q by linarith) (show 0 ≤ x ^ 2 - 2 by nlinarith)] have hlog := Real.log_le_log (show 0 < 24 * q * (x ^ 2 + 2) by positivity) harg rw [Real.log_mul (by positivity : 48 * q ≠ 0) (by positivity : x ^ 2 ≠ 0), Real.log_mul (by norm_num : (48 : ℝ) ≠ 0) hq0.ne', Real.log_pow] at hlog rw [Real.log_mul hq0.ne' hx0.ne'] norm_num at hlog linarith theorem primitive_smoothed_estimate_of_zero_free (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (χ : PrimitiveComplexCharacter) (x : ℝ), 2 ≤ x → ‖smoothedTwistedPsi χ.character x‖ ≤ C * x ^ ((15 : ℝ) / 16) * Real.log ((χ.modulus : ℝ) * x) := by obtain ⟨D, hD, hbound⟩ := character_riesz_bound_of_zero_free hZ refine ⟨12 * D, by positivity, ?_⟩ intro χ x hx rw [smoothedTwistedPsi_eq_riesz χ (by linarith)] have hl := riesz_conductor_log_bound (q := (χ.modulus : ℝ)) (by exact_mod_cast χ.positive) hx calc _ ≤ D * x ^ ((15 : ℝ) / 16) * (1 + Real.log (24 * (χ.modulus : ℝ) * (x ^ 2 + 2))) := hbound χ x hx _ ≤ D * x ^ ((15 : ℝ) / 16) * (12 * Real.log ((χ.modulus : ℝ) * x)) := by gcongr _ = _ := by ring end section open OAI.Ostmann theorem log_three_scale_le {q x y : ℝ} (hq : 1 ≤ q) (hx : 2 ≤ x) (hy : 0 < y) (hyx : y ≤ 3 * x) : Real.log (q * y) ≤ 3 * Real.log (q * x) := by have hq0 : 0 < q := by linarith have hx0 : 0 < x := by linarith have hqx : 2 ≤ q * x := by nlinarith have hlog2 := Real.log_le_log (by norm_num : (0 : ℝ) < 2) hqx have hlog3 : Real.log (3 : ℝ) ≤ 2 * Real.log 2 := by have hh := Real.log_le_log (by norm_num : (0 : ℝ) < 3) (by norm_num : (3 : ℝ) ≤ 2 ^ 2) simpa only [Real.log_pow, Nat.cast_ofNat] using hh have hlog := Real.log_le_log (mul_pos hq0 hy) (mul_le_mul_of_nonneg_left hyx hq0.le) have he : q * (3 * x) = 3 * (q * x) := by ring rw [he, Real.log_mul (by norm_num : (3 : ℝ) ≠ 0) (by positivity : q * x ≠ 0)] at hlog linarith theorem power_three_scale_le {x y : ℝ} (hx : 0 < x) (hy : 0 ≤ y) (hyx : y ≤ 3 * x) : y ^ ((15 : ℝ) / 16) ≤ 3 * x ^ ((15 : ℝ) / 16) := by have hthree : (3 : ℝ) ^ ((15 : ℝ) / 16) ≤ 3 := by calc _ ≤ (3 : ℝ) ^ (1 : ℝ) := Real.rpow_le_rpow_of_exponent_le (by norm_num) (by norm_num) _ = _ := Real.rpow_one _ calc _ ≤ (3 * x) ^ ((15 : ℝ) / 16) := Real.rpow_le_rpow hy hyx (by norm_num) _ = (3 : ℝ) ^ ((15 : ℝ) / 16) * x ^ ((15 : ℝ) / 16) := Real.mul_rpow (by norm_num) hx.le _ ≤ _ := mul_le_mul_of_nonneg_right hthree (Real.rpow_nonneg hx.le _) /- The triangular estimate at exponent 15/16 gives a sharp sum estimate at 31/32. Its constant is independent of the modulus and character. -/ theorem twistedPsi_bound_of_smoothed {q : ℕ} (χ : DirichletCharacter ℂ q) (hq : 0 < q) {C : ℝ} (hC : 0 < C) (hbound : ∀ y : ℝ, 2 ≤ y → ‖smoothedTwistedPsi χ y‖ ≤ C * y ^ ((15 : ℝ) / 16) * Real.log ((q : ℝ) * y)) {x : ℝ} (hx : 2 ≤ x) : ‖twistedPsi χ x‖ ≤ (28 * C + 6) * x ^ ((31 : ℝ) / 32) * Real.log ((q : ℝ) * x) := by let p : ℝ := x ^ ((31 : ℝ) / 32) let m : ℕ := ⌈p⌉₊ let L : ℝ := Real.log ((q : ℝ) * x) have hx0 : 0 < x := by linarith have hq1 : (1 : ℝ) ≤ q := by exact_mod_cast hq have hq0 : (0 : ℝ) < q := by exact_mod_cast hq have hL : 0 ≤ L := Real.log_nonneg (by nlinarith) have hp1 : 1 ≤ p := Real.one_le_rpow (by linarith) (by norm_num) have hp0 : 0 < p := by linarith have hpx : p ≤ x := by calc _ ≤ x ^ (1 : ℝ) := Real.rpow_le_rpow_of_exponent_le (by linarith) (by norm_num) _ = x := Real.rpow_one _ have hmp : p ≤ (m : ℝ) := Nat.le_ceil p have hm2p : (m : ℝ) ≤ 2 * p := by have hh := Nat.ceil_lt_add_one hp0.le dsimp [m] linarith have hm : 0 < m := Nat.ceil_pos.mpr hp0 have hm0 : 0 < (m : ℝ) := by exact_mod_cast hm have hym : x + (m : ℝ) ≤ 3 * x := by linarith have hy2 : 2 ≤ x + (m : ℝ) := by linarith have hpow := power_three_scale_le hx0 (by positivity : 0 ≤ x + (m : ℝ)) hym have hlog := log_three_scale_le hq1 hx (by positivity : 0 < x + (m : ℝ)) hym have hlog0 : 0 ≤ Real.log ((q : ℝ) * (x + (m : ℝ))) := Real.log_nonneg (by nlinarith) have hsmy : ‖smoothedTwistedPsi χ (x + m)‖ ≤ 9 * C * x ^ ((15 : ℝ) / 16) * L := by calc _ ≤ C * (x + m) ^ ((15 : ℝ) / 16) * Real.log ((q : ℝ) * (x + m)) := hbound _ hy2 _ ≤ C * (3 * x ^ ((15 : ℝ) / 16)) * (3 * L) := by gcongr _ = _ := by ring have hsmx : ‖smoothedTwistedPsi χ x‖ ≤ C * x ^ ((15 : ℝ) / 16) * L := hbound x hx have hp2 : x * x ^ ((15 : ℝ) / 16) = p ^ 2 := by dsimp [p] calc _ = x ^ (1 : ℝ) * x ^ ((15 : ℝ) / 16) := by rw [Real.rpow_one] _ = x ^ ((1 : ℝ) + 15 / 16) := (Real.rpow_add hx0 _ _).symm _ = x ^ (((31 : ℝ) / 32) * 2) := by congr 1; norm_num _ = _ := by rw [Real.rpow_mul hx0.le, Real.rpow_two] have hpair : (x + m) * ‖smoothedTwistedPsi χ (x + m)‖ + x * ‖smoothedTwistedPsi χ x‖ ≤ 28 * C * p ^ 2 * L := by calc _ ≤ (3 * x) * (9 * C * x ^ ((15 : ℝ) / 16) * L) + x * (C * x ^ ((15 : ℝ) / 16) * L) := by gcongr _ = 28 * C * (x * x ^ ((15 : ℝ) / 16)) * L := by ring _ = _ := by rw [hp2] have hlogy : Real.log (x + (m : ℝ)) ≤ 3 * L := by apply le_trans _ hlog apply Real.log_le_log (by positivity) nlinarith have hpp : p ^ 2 ≤ p * m := by nlinarith have hmp2 : (m : ℝ) ^ 2 ≤ 2 * p * m := by nlinarith calc _ ≤ ((x + m) * ‖smoothedTwistedPsi χ (x + m)‖ + x * ‖smoothedTwistedPsi χ x‖ + (m : ℝ) ^ 2 * Real.log (x + m)) / m := riesz_unsmoothing_bound χ hx0 hm _ ≤ (28 * C + 6) * p * L := by apply (div_le_iff₀ hm0).mpr calc _ ≤ 28 * C * p ^ 2 * L + (m : ℝ) ^ 2 * (3 * L) := by gcongr _ = 28 * C * p ^ 2 * L + 3 * (m : ℝ) ^ 2 * L := by ring _ ≤ 28 * C * (p * m) * L + 3 * (2 * p * m) * L := by gcongr _ = _ := by ring theorem primitive_twistedPsi_power_saving (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (χ : PrimitiveComplexCharacter) (x : ℝ), 2 ≤ x → ‖twistedPsi χ.character x‖ ≤ C * x ^ ((31 : ℝ) / 32) * Real.log ((χ.modulus : ℝ) * x) := by obtain ⟨D, hD, hbound⟩ := primitive_smoothed_estimate_of_zero_free hZ refine ⟨28 * D + 6, by positivity, ?_⟩ intro χ x hx exact twistedPsi_bound_of_smoothed χ.character χ.positive hD (hbound χ) hx end section open OAI.Ostmann def PrimitivePrimeCharacterEstimateWeak : Prop := ∃ C : ℝ, 0 < C ∧ ∀ y : ℝ, 2 ≤ y → ∀ q : ℕ, 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → χ.IsPrimitive → ‖∑ p ∈ ambientPrimes y, χ (p : ZMod q)‖ ≤ C * y ^ ((31 : ℝ) / 32) * (Real.log (5 * (q : ℝ) * y)) ^ 2 end section open Finset Classical end section open Finset Classical noncomputable def finiteWeightedEnergy {X : Type*} [Fintype X] (μ : X → ℝ) (f : X → ℂ) : ℝ := ∑ x, μ x * ‖f x‖ ^ 2 noncomputable def finiteProductWeight {I : Type*} [Fintype I] {X : I → Type*} (μ : ∀ i, X i → ℝ) (x : ∀ i, X i) : ℝ := ∏ i, μ i (x i) noncomputable def finiteCoordinateLift {I : Type*} [DecidableEq I] {X : I → Type*} (i : I) (A : (X i → ℂ) → X i → ℂ) (f : (∀ j, X j) → ℂ) (x : ∀ j, X j) : ℂ := let E := Equiv.piSplitAt i X A (fun y => f (E.symm (y, (E x).2))) (E x).1 theorem finite_product_weight_split {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (μ : ∀ i, X i → ℝ) (i : I) (x : ∀ j, X j) : finiteProductWeight μ x = μ i (x i) * ∏ j : {j : I // j ≠ i}, μ j.val (x j.val) := by have h := Fintype.prod_subtype_mul_prod_subtype (fun j => j = i) (fun j => μ j (x j)) have heq (j : {j : I // j = i}) : μ j.val (x j.val) = μ i (x i) := by rcases j with ⟨j, rfl⟩ rfl simpa only [finiteProductWeight, Fintype.prod_unique, heq] using h.symm section variable {I : Type*} [sharedInstance1 : DecidableEq I] {X : I → Type*} (i : I) include I sharedInstance1 X i theorem finite_coordinate_lift_split (A : (X i → ℂ) → X i → ℂ) (f : (∀ j, X j) → ℂ) (y : X i) (z : ∀ j : {j : I // j ≠ i}, X j.val) : finiteCoordinateLift i A f ((Equiv.piSplitAt i X).symm (y, z)) = A (fun y' => f ((Equiv.piSplitAt i X).symm (y', z))) y := by simp only [finiteCoordinateLift, Equiv.apply_symm_apply] /- The split-coordinate definition is literal replacement of coordinate i. -/ theorem finite_split_replace_eq_update (x : ∀ j, X j) (y : X i) : (Equiv.piSplitAt i X).symm (y, (Equiv.piSplitAt i X x).2) = Function.update x i y := by funext j by_cases h : j = i · subst j simp [Equiv.piSplitAt] · simp [Equiv.piSplitAt, h] theorem finite_coordinate_lift_eq_update (A : (X i → ℂ) → X i → ℂ) (f : (∀ j, X j) → ℂ) (x : ∀ j, X j) : finiteCoordinateLift i A f x = A (fun y => f (Function.update x i y)) (x i) := by unfold finiteCoordinateLift simp only [finite_split_replace_eq_update] rfl end /- Exact energy disintegration into the chosen coordinate and its complement. -/ theorem finite_product_energy_split {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i : I) (f : (∀ j, X j) → ℂ) : finiteWeightedEnergy (finiteProductWeight μ) f = ∑ z : (∀ j : {j : I // j ≠ i}, X j.val), (∏ j, μ j.val (z j)) * finiteWeightedEnergy (μ i) (fun y => f ((Equiv.piSplitAt i X).symm (y, z))) := by let E := Equiv.piSplitAt i X unfold finiteWeightedEnergy rw [← E.symm.sum_comp, Fintype.sum_prod_type, sum_comm] apply sum_congr rfl intro z hz rw [mul_sum] apply sum_congr rfl intro y hy rw [finite_product_weight_split μ i] have hE := E.apply_symm_apply (y, z) have hfirst : E.symm (y, z) i = y := congrArg Prod.fst hE have hrest : (fun j : {j : I // j ≠ i} => E.symm (y, z) j.val) = z := congrArg Prod.snd hE have hprod : (∏ j : {j : I // j ≠ i}, μ j.val (E.symm (y, z) j.val)) = ∏ j, μ j.val (z j) := congrArg (fun q => ∏ j, μ j.val (q j)) hrest rw [hfirst, hprod] ring /- A full-domain coordinate energy bound lifts to the dependent product. Only the complementary measure factors need nonnegativity. -/ theorem finite_coordinate_lift_energy_le {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (i : I) (A : (X i → ℂ) → X i → ℂ) (C : ℝ) (hA : ∀ f, finiteWeightedEnergy (μ i) (A f) ≤ C * finiteWeightedEnergy (μ i) f) (f : (∀ j, X j) → ℂ) : finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateLift i A f) ≤ C * finiteWeightedEnergy (finiteProductWeight μ) f := by rw [finite_product_energy_split μ i, finite_product_energy_split μ i] simp_rw [finite_coordinate_lift_split] rw [mul_sum] apply sum_le_sum intro z hz calc _ ≤ (∏ j : {j : I // j ≠ i}, μ j.val (z j)) * (C * finiteWeightedEnergy (μ i) (fun y => f ((Equiv.piSplitAt i X).symm (y, z)))) := mul_le_mul_of_nonneg_left (hA _) (prod_nonneg fun j _ => hμ _ _) _ = _ := by ring /- An ordered composition of coordinate actions, with the head acting last. The list may repeat coordinates and no commutation assumption is made. -/ noncomputable def finiteCoordinateCompose {I : Type*} [DecidableEq I] {X : I → Type*} (A : ∀ i, (X i → ℂ) → X i → ℂ) : List I → ((∀ i, X i) → ℂ) → ((∀ i, X i) → ℂ) | [], f => f | i :: is, f => finiteCoordinateLift i (A i) (finiteCoordinateCompose A is f) /- Coordinate energy constants multiply under arbitrary ordered composition. -/ theorem finite_coordinate_compose_energy_le {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (A : ∀ i, (X i → ℂ) → X i → ℂ) (C : I → ℝ) (hC : ∀ i, 0 ≤ C i) (hA : ∀ i f, finiteWeightedEnergy (μ i) (A i f) ≤ C i * finiteWeightedEnergy (μ i) f) (is : List I) (f : (∀ i, X i) → ℂ) : finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateCompose A is f) ≤ (is.map C).prod * finiteWeightedEnergy (finiteProductWeight μ) f := by induction is with | nil => simp [finiteCoordinateCompose] | cons i is ih => calc _ ≤ C i * finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateCompose A is f) := finite_coordinate_lift_energy_le μ hμ i (A i) (C i) (hA i) _ _ ≤ C i * ((is.map C).prod * finiteWeightedEnergy (finiteProductWeight μ) f) := mul_le_mul_of_nonneg_left ih (hC i) _ = _ := by simp only [List.map_cons, List.prod_cons, mul_assoc] /- A canonical ordered action of a finite set of coordinates. This definition chooses an order; its energy estimate does not require order independence. -/ noncomputable def finiteCoordinateFinsetAction {I : Type*} [DecidableEq I] {X : I → Type*} (A : ∀ i, (X i → ℂ) → X i → ℂ) (s : Finset I) (f : (∀ i, X i) → ℂ) : (∀ i, X i) → ℂ := finiteCoordinateCompose A s.toList f theorem finite_coordinate_finset_energy_le {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (A : ∀ i, (X i → ℂ) → X i → ℂ) (C : I → ℝ) (hC : ∀ i, 0 ≤ C i) (hA : ∀ i f, finiteWeightedEnergy (μ i) (A i f) ≤ C i * finiteWeightedEnergy (μ i) f) (s : Finset I) (f : (∀ i, X i) → ℂ) : finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateFinsetAction A s f) ≤ (∏ i ∈ s, C i) * finiteWeightedEnergy (finiteProductWeight μ) f := by simpa only [finiteCoordinateFinsetAction, prod_map_toList] using finite_coordinate_compose_energy_le μ hμ A C hC hA s.toList f end section open Finset Classical /- Jensen's inequality for the actual finite permutation average. -/ theorem birthPermutationAverage_norm_sq_le {Z : Type*} {n : ℕ} (φ : (Fin n → Z) → ℂ) (q : Fin n → Z) : ‖birthPermutationAverage φ q‖ ^ 2 ≤ (Fintype.card (Equiv.Perm (Fin n)) : ℝ)⁻¹ * ∑ σ : Equiv.Perm (Fin n), ‖φ (fun j => q (σ j))‖ ^ 2 := by have hc : (0 : ℝ) < Fintype.card (Equiv.Perm (Fin n)) := by exact_mod_cast Fintype.card_pos have hsum := complex_row_weighted_cauchy (univ : Finset (Equiv.Perm (Fin n))) (fun _ => 1) (fun σ => φ (fun j => q (σ j))) (fun _ => 1) (by intros; norm_num) have hsum' : ‖∑ σ : Equiv.Perm (Fin n), φ (fun j => q (σ j))‖ ^ 2 ≤ (Fintype.card (Equiv.Perm (Fin n)) : ℝ) * ∑ σ : Equiv.Perm (Fin n), ‖φ (fun j => q (σ j))‖ ^ 2 := by simpa using hsum unfold birthPermutationAverage rw [norm_mul, norm_inv, Complex.norm_natCast, mul_pow] calc _ ≤ ((Fintype.card (Equiv.Perm (Fin n)) : ℝ)⁻¹) ^ 2 * ((Fintype.card (Equiv.Perm (Fin n)) : ℝ) * ∑ σ : Equiv.Perm (Fin n), ‖φ (fun j => q (σ j))‖ ^ 2) := mul_le_mul_of_nonneg_left hsum' (sq_nonneg _) _ = _ := by field_simp /- A real invariant weight gives an exact permutation change of variables. -/ theorem birth_permutation_weighted_energy_eq {Z : Type*} [Fintype Z] {n : ℕ} (W : (Fin n → Z) → ℝ) (φ : (Fin n → Z) → ℂ) (hW : ∀ q (σ : Equiv.Perm (Fin n)), W (fun j => q (σ j)) = W q) (σ : Equiv.Perm (Fin n)) : (∑ q : Fin n → Z, W q * ‖φ (fun j => q (σ j))‖ ^ 2) = ∑ q : Fin n → Z, W q * ‖φ q‖ ^ 2 := by have h := (birthAssignmentPermutation (α := Z) σ).sum_comp (fun q => W q * ‖φ q‖ ^ 2) simpa only [birthAssignmentPermutation, Equiv.coe_fn_mk, hW] using h /- Permutation averaging contracts energy under any nonnegative invariant finite weight, without assuming that the test is symmetric. -/ theorem birthPermutationAverage_energy_le {Z : Type*} [Fintype Z] {n : ℕ} (W : (Fin n → Z) → ℝ) (φ : (Fin n → Z) → ℂ) (hW0 : ∀ q, 0 ≤ W q) (hW : ∀ q (σ : Equiv.Perm (Fin n)), W (fun j => q (σ j)) = W q) : (∑ q : Fin n → Z, W q * ‖birthPermutationAverage φ q‖ ^ 2) ≤ ∑ q : Fin n → Z, W q * ‖φ q‖ ^ 2 := by have hc : (Fintype.card (Equiv.Perm (Fin n)) : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero calc _ ≤ ∑ q : Fin n → Z, W q * ((Fintype.card (Equiv.Perm (Fin n)) : ℝ)⁻¹ * ∑ σ : Equiv.Perm (Fin n), ‖φ (fun j => q (σ j))‖ ^ 2) := sum_le_sum fun q _ => mul_le_mul_of_nonneg_left (birthPermutationAverage_norm_sq_le φ q) (hW0 q) _ = (Fintype.card (Equiv.Perm (Fin n)) : ℝ)⁻¹ * ∑ σ : Equiv.Perm (Fin n), ∑ q : Fin n → Z, W q * ‖φ (fun j => q (σ j))‖ ^ 2 := by rw [sum_comm] simp_rw [mul_sum] apply sum_congr rfl intro q _ apply sum_congr rfl intro σ _ ring _ = (Fintype.card (Equiv.Perm (Fin n)) : ℝ)⁻¹ * ∑ _σ : Equiv.Perm (Fin n), ∑ q : Fin n → Z, W q * ‖φ q‖ ^ 2 := by simp_rw [birth_permutation_weighted_energy_eq W φ hW] _ = _ := by simp only [sum_const, card_univ, nsmul_eq_mul] rw [← mul_assoc, inv_mul_cancel₀ hc, one_mul] /- Average only the memory indices, keeping active labels and length fixed. -/ noncomputable def boundedMemorySymmetrize {P Z : Type*} {t B : ℕ} (f : BoundedOrderedState P Z t B → ℂ) (s : BoundedOrderedState P Z t B) : ℂ := birthPermutationAverage (fun q => f (s.1, ⟨s.2.1, q⟩)) s.2.2 theorem boundedMemorySymmetrize_symmetric {P Z : Type*} {t B : ℕ} (f : BoundedOrderedState P Z t B → ℂ) : BoundedOrderedSymmetric (boundedMemorySymmetrize f) := by intro active N q τ exact birthPermutationAverage_invariant (fun q => f (active, ⟨N, q⟩)) q τ theorem boundedMemorySymmetrize_eq_self {P Z : Type*} {t B : ℕ} (f : BoundedOrderedState P Z t B → ℂ) (hf : BoundedOrderedSymmetric f) : boundedMemorySymmetrize f = f := by funext s have hc : (Fintype.card (Equiv.Perm (Fin s.2.1.val)) : ℂ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero have hs (σ : Equiv.Perm (Fin s.2.1.val)) : f (s.1, ⟨s.2.1, fun j => s.2.2 (σ j)⟩) = f s := hf s.1 s.2.1 s.2.2 σ unfold boundedMemorySymmetrize birthPermutationAverage simp_rw [hs] simp only [sum_const, card_univ, nsmul_eq_mul] rw [← mul_assoc, inv_mul_cancel₀ hc, one_mul] section variable {P Z : Type*} [sharedInstance1 : Fintype P] [sharedInstance2 : Fintype Z] {t B : ℕ} (μ : P → ℝ) (ν : Z → ℝ) (hμ : ∀ p, 0 ≤ μ p) (hν : ∀ z, 0 ≤ ν z) include P Z sharedInstance1 sharedInstance2 t B μ ν hμ hν /- The actual active-product and factorial-memory measure is invariant under the local average, which therefore contracts its weighted energy. -/ theorem boundedMemorySymmetrize_energy_le (f : BoundedOrderedState P Z t B → ℂ) : (∑ s : BoundedOrderedState P Z t B, boundedOrderedStateWeight μ ν s * ‖boundedMemorySymmetrize f s‖ ^ 2) ≤ ∑ s : BoundedOrderedState P Z t B, boundedOrderedStateWeight μ ν s * ‖f s‖ ^ 2 := by rw [Fintype.sum_prod_type, Fintype.sum_prod_type] apply sum_le_sum intro active _ rw [Fintype.sum_sigma, Fintype.sum_sigma] apply sum_le_sum intro N _ apply birthPermutationAverage_energy_le (fun q => boundedOrderedStateWeight μ ν (active, ⟨N, q⟩)) (fun q => f (active, ⟨N, q⟩)) · intro q exact boundedOrderedStateWeight_nonneg μ ν hμ hν _ · intro q σ unfold boundedOrderedStateWeight boundedOrderedMemoryWeight rw [Equiv.prod_comp σ (fun j => ν (q j))] /- Precomposing with the actual permutation average extends an energy estimate on symmetric inputs to every bounded-state input. -/ theorem boundedMemorySymmetrize_transfer_energy_le {C : ℝ} (hC : 0 ≤ C) (T : (BoundedOrderedState P Z t B → ℂ) → BoundedOrderedState P Z t B → ℂ) (hT : ∀ g, BoundedOrderedSymmetric g → (∑ s : BoundedOrderedState P Z t B, boundedOrderedStateWeight μ ν s * ‖T g s‖ ^ 2) ≤ C * ∑ s : BoundedOrderedState P Z t B, boundedOrderedStateWeight μ ν s * ‖g s‖ ^ 2) (f : BoundedOrderedState P Z t B → ℂ) : (∑ s : BoundedOrderedState P Z t B, boundedOrderedStateWeight μ ν s * ‖T (boundedMemorySymmetrize f) s‖ ^ 2) ≤ C * ∑ s : BoundedOrderedState P Z t B, boundedOrderedStateWeight μ ν s * ‖f s‖ ^ 2 := (hT _ (boundedMemorySymmetrize_symmetric f)).trans (mul_le_mul_of_nonneg_left (boundedMemorySymmetrize_energy_le μ ν hμ hν f) hC) end end section open Finset Classical abbrev ProductBoundedOrderedState {G : Type*} (P Z : G → Type*) (t : G → ℕ) (B : ℕ) := ∀ g, BoundedOrderedState (P g) (Z g) (t g) B noncomputable def productMemoryWeight {G : Type*} [Fintype G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (x : ProductBoundedOrderedState P Z t B) : ℝ := ∏ g, boundedOrderedStateWeight (μ g) (ν g) (x g) noncomputable def productTotalMemory {G : Type*} [Fintype G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z t B) : ℕ := ∑ g, (x g).2.1.val noncomputable def productMemoryCutoff {G : Type*} [Fintype G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} {K : Type*} [Zero K] (f : ProductBoundedOrderedState P Z t B → K) (x : ProductBoundedOrderedState P Z t B) : K := if productTotalMemory x ≤ B then f x else 0 theorem productMemoryWeight_nonneg {G : Type*} [Fintype G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (x : ProductBoundedOrderedState P Z t B) : 0 ≤ productMemoryWeight μ ν x := prod_nonneg fun g _ => boundedOrderedStateWeight_nonneg (μ g) (ν g) (hμ g) (hν g) (x g) theorem productMemoryCutoff_norm_le {G : Type*} [Fintype G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z t B → ℂ) (x : ProductBoundedOrderedState P Z t B) : ‖productMemoryCutoff f x‖ ≤ ‖f x‖ := by unfold productMemoryCutoff split_ifs · exact le_rfl · simpa only [norm_zero] using norm_nonneg (f x) theorem productMemoryCutoff_energy_le {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {t : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (f : ProductBoundedOrderedState P Z t B → ℂ) : (∑ x : ProductBoundedOrderedState P Z t B, productMemoryWeight μ ν x * ‖productMemoryCutoff f x‖ ^ 2) ≤ ∑ x : ProductBoundedOrderedState P Z t B, productMemoryWeight μ ν x * ‖f x‖ ^ 2 := by apply sum_le_sum intro x hx apply mul_le_mul_of_nonneg_left _ (productMemoryWeight_nonneg μ ν hμ hν x) exact (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr (productMemoryCutoff_norm_le f x) theorem productMemoryCutoff_idempotent {G : Type*} [Fintype G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} {K : Type*} [Zero K] (f : ProductBoundedOrderedState P Z t B → K) : productMemoryCutoff (productMemoryCutoff f) = productMemoryCutoff f := by funext x unfold productMemoryCutoff split_ifs <;> rfl /- Reorder one group's old memory, leaving every active tuple and all other groups unchanged. -/ def productMemoryPermuteAt {G : Type*} [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z t B) (g : G) (τ : Equiv.Perm (Fin (x g).2.1.val)) : ProductBoundedOrderedState P Z t B := Function.update x g ((x g).1, ⟨(x g).2.1, (x g).2.2 ∘ τ⟩) theorem productTotalMemory_permuteAt {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z t B) (g : G) (τ : Equiv.Perm (Fin (x g).2.1.val)) : productTotalMemory (productMemoryPermuteAt x g τ) = productTotalMemory x := by apply sum_congr rfl intro h hh by_cases heq : h = g · subst h simp [productMemoryPermuteAt] · simp [productMemoryPermuteAt, heq] def ProductMemorySymmetric {G : Type*} [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} {K : Type*} (f : ProductBoundedOrderedState P Z t B → K) : Prop := ∀ x g τ, f (productMemoryPermuteAt x g τ) = f x theorem productMemoryCutoff_symmetric {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} {K : Type*} [Zero K] (f : ProductBoundedOrderedState P Z t B → K) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (productMemoryCutoff f) := by intro x g τ simp only [productMemoryCutoff, productTotalMemory_permuteAt, hf x g τ] end section open Finset Filter open scoped Topology noncomputable def candidatePHarmonicTerm (s L q : ℝ) (n : ℕ) : ℝ := oneMarkedGroupTerm (candidatePIndices s L) (candidatePBand (s * L)) q (fun j => ∑ p ∈ candidatePBand (s * L) j, 1 / (p : ℝ)) n noncomputable def candidateSmallPHarmonicMass (s L q X : ℝ) : ℝ := ∑' n : Nat.factoredNumbers ((candidatePIndices s L).biUnion (candidatePBand (s * L))), if (n.val : ℝ) < X then candidatePHarmonicTerm s L q n.val else 0 theorem candidate_P_harmonic_summable {s L : ℝ} (hsL : 0 ≤ s * L) (q : ℝ) : Summable (fun n : Nat.factoredNumbers ((candidatePIndices s L).biUnion (candidatePBand (s * L))) => candidatePHarmonicTerm s L q n.val) := by have hpair := pairwise_disjoint_dyadicPrimeBand (s := s * L) (lower := (3/2 : ℝ)) (upper := (9/5 : ℝ)) hsL (by norm_num) (by norm_num) exact (one_marked_groups_summable_and_sum (candidatePIndices s L) (candidatePBand (s * L)) (fun i _ j _ hij => hpair hij) (fun _ _ _ hp => (mem_filter.mp hp).2) q _).1 theorem candidate_small_P_harmonic_summable {s L : ℝ} (hsL : 0 ≤ s * L) (q X : ℝ) : Summable (fun n : Nat.factoredNumbers ((candidatePIndices s L).biUnion (candidatePBand (s * L))) => if (n.val : ℝ) < X then candidatePHarmonicTerm s L q n.val else 0) := by simpa only [Set.indicator, Set.mem_ofPred_eq] using! (candidate_P_harmonic_summable hsL q).indicator {n | (n.val : ℝ) < X} theorem candidate_P_small_add_tail {s L : ℝ} (hsL : 0 ≤ s * L) (q X : ℝ) : candidateSmallPHarmonicMass s L q X + candidateMarkedSmoothTail s L q 1 X = candidateOneMarkedHarmonicMass s L q := by have hsmall := candidate_small_P_harmonic_summable hsL q X have hbig : Summable (fun n : Nat.factoredNumbers ((candidatePIndices s L).biUnion (candidatePBand (s * L))) => if X ≤ (n.val : ℝ) then candidatePHarmonicTerm s L q n.val else 0) := by simpa only [Set.indicator, Set.mem_ofPred_eq] using! (candidate_P_harmonic_summable hsL q).indicator {n | X ≤ (n.val : ℝ)} change (∑' n : Nat.factoredNumbers ((candidatePIndices s L).biUnion (candidatePBand (s * L))), if (n.val : ℝ) < X then candidatePHarmonicTerm s L q n.val else 0) + (∑' n : Nat.factoredNumbers ((candidatePIndices s L).biUnion (candidatePBand (s * L))), if X ≤ (n.val : ℝ) then candidatePHarmonicTerm s L q n.val else 0) = _ rw [← hsmall.tsum_add hbig] apply tsum_congr intro n by_cases hn : (n.val : ℝ) < X · simp only [hn, not_le.mpr hn, if_true, if_false, add_zero, candidatePHarmonicTerm] · simp only [hn, le_of_not_gt hn, if_true, if_false, zero_add, candidatePHarmonicTerm] theorem candidate_small_P_harmonic_nonneg (s L q X : ℝ) (hq : 0 ≤ q) : 0 ≤ candidateSmallPHarmonicMass s L q X := by apply tsum_nonneg intro n split_ifs · apply div_nonneg · exact marked_divisor_weight_nonneg _ _ hq _ _ (fun _ _ => sum_nonneg (fun _ _ => by positivity)) _ · exact Nat.cast_nonneg _ · exact le_rfl theorem eventually_candidate_small_P_half_mass {s q κ : ℝ} (hs : 0 < s) (hq0 : 0 ≤ q) (hq1 : q < 1) (hκ : 0 < κ) : ∀ᶠ L : ℝ in atTop, candidateOneMarkedHarmonicMass s L q / 2 ≤ candidateSmallPHarmonicMass s L q (Real.exp (κ * L)) := by filter_upwards [eventually_candidate_one_marked_mass_ge_one hs hq0 hq1.le, eventually_candidate_marked_smooth_tail_power_saving hs hq0 hq1 hκ 1 1, eventually_ge_atTop (2 : ℝ)] with L hmass htail hL have hL0 : 0 < L := by linarith have hpart := candidate_P_small_add_tail (mul_nonneg hs.le hL0.le) q (Real.exp (κ * L)) have hhalf : L^(-(1 : ℝ)) ≤ 1/2 := by rw [Real.rpow_neg_one] simpa only [one_div] using one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 2) hL linarith end section open Finset theorem ordered_slot_tuple_harmonic_sum {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) : (∑ x : ∀ i, choices i, 1 / (orderedSlotProduct choices x : ℝ)) = ∏ i, ∑ p ∈ choices i, 1 / (p : ℝ) := by classical simp_rw [orderedSlotProduct, Nat.cast_prod, one_div, ← Finset.prod_inv_distrib] calc _ = ∏ i, ∑ p : choices i, (p.val : ℝ)⁻¹ := (Fintype.prod_sum (fun i (p : choices i) => (p.val : ℝ)⁻¹)).symm _ = _ := prod_congr rfl (fun i _ => Finset.sum_coe_sort (choices i) (fun p => (p : ℝ)⁻¹)) theorem ordered_slot_harmonic_eq_tuple_sum {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (normalization : ℝ) : (∑' n : ℕ, orderedSlotWeight choices normalization n / (n : ℝ)) = ∑ x : ∀ i, choices i, (1 / (orderedSlotProduct choices x : ℝ)) / normalization := by rw [ordered_slot_harmonic_sum, ← ordered_slot_tuple_harmonic_sum choices, sum_div] end section open Finset Filter open scoped Topology noncomputable def candidatePrefixRestChoices (c L eps : ℝ) (r jStar J : ℕ) (hr : 0 < r) (slot : {slot : (candidateQIndices c L) × Fin r // slot ≠ candidateFreeSlot c L r hr}) : Finset ℕ := candidatePrefixChoices c L eps r jStar J slot.val noncomputable def candidatePrefixRestHarmonicMass (c L eps : ℝ) (r jStar J : ℕ) (hr : 0 < r) : ℝ := ∑' n : ℕ, orderedSlotWeight (candidatePrefixRestChoices c L eps r jStar J hr) ((r.factorial : ℝ)^(candidateQIndices c L).card) n / (n : ℝ) theorem candidate_free_slot_not_in_prefix (c L : ℝ) (r J : ℕ) (hr : 0 < r) : candidateFreeSlot c L r hr ∉ candidatePrefixSlots c L r J := by simp [candidateFreeSlot, candidatePrefixSlots] section variable (c L eps : ℝ) (r jStar J : ℕ) (hr : 0 < r) include c L eps r jStar J hr theorem candidate_prefix_free_choice (hJ : J < jStar) : candidatePrefixChoices c L eps r jStar J (candidateFreeSlot c L r hr) = candidateQBand (c * L) 0 := by rw [candidatePrefixChoices, restrictedSlotChoices, if_neg (candidate_free_slot_not_in_prefix c L r J hr)] have hnot : (0 : ℕ) ≠ jStar := by omega simp only [candidateQSlotChoices, candidateFreeSlot, hnot, false_and, if_false] theorem candidate_prefix_mass_free_factor (hJ : J < jStar) : candidatePrefixHarmonicMass c L eps r jStar J = (∑ p ∈ candidateQBand (c * L) 0, 1 / (p : ℝ)) * candidatePrefixRestHarmonicMass c L eps r jStar J hr := by have h := ordered_slot_harmonic_split (candidatePrefixChoices c L eps r jStar J) (candidateFreeSlot c L r hr) ((r.factorial : ℝ)^(candidateQIndices c L).card) rw [candidate_prefix_free_choice c L eps r jStar J hr hJ] at h exact h theorem candidate_prefix_rest_mass_nonneg : 0 ≤ candidatePrefixRestHarmonicMass c L eps r jStar J hr := by apply tsum_nonneg intro n exact div_nonneg (ordered_slot_weight_nonneg _ (by positivity) n) (Nat.cast_nonneg n) end theorem exists_candidate_prefix_rest_mass_fraction {c eps : ℝ} (hc : 0 < c) (heps0 : 0 < eps) (heps1 : eps ≤ 1/10) (r J : ℕ) (hr : 0 < r) : ∃ rho : ℝ, 0 < rho ∧ ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → rho * candidateQHarmonicMass c L r jStar ≤ candidatePrefixRestHarmonicMass c L eps r jStar J hr := by obtain ⟨rho, hrho, hmass⟩ := exists_candidate_prefix_harmonic_fraction hc heps0 heps1 r J obtain ⟨v, V, _, hV, hband⟩ := exists_candidateQBands_bounds hc refine ⟨rho / V, div_pos hrho hV, ?_⟩ filter_upwards [hmass, hband] with L hm hb intro jStar hJ have hzero : 0 ∈ candidateQIndices c L := by simp [candidateQIndices] have hupper := (hb.2.2 0 hzero).2.2.2 have h := hm jStar hJ rw [candidate_prefix_mass_free_factor c L eps r jStar J hr hJ] at h have h' := h.trans (mul_le_mul_of_nonneg_right hupper (candidate_prefix_rest_mass_nonneg c L eps r jStar J hr)) calc (rho / V) * candidateQHarmonicMass c L r jStar = (rho * candidateQHarmonicMass c L r jStar) / V := by ring _ ≤ _ := (div_le_iff₀ hV).mpr (by simpa only [mul_comm V] using h') end section open Finset theorem indexed_free_prime_mass_lower {T : Type*} [Fintype T] (S P : Finset ℕ) (W : ℕ → ℝ) (R : T → ℕ) (N X H : ℝ) (hN : 0 ≤ N) (hW : ∀ n ∈ S, 0 ≤ W n) (hcount : ∀ n ∈ S, ∀ t : T, (X / ((n * R t : ℕ) : ℝ)) * H ≤ ((primeProductWindow P ((n * R t : ℕ) : ℝ) X).card : ℝ)) : X * H * (∑ n ∈ S, W n / (n : ℝ)) * (∑ t : T, (1 / (R t : ℝ)) / N) ≤ ∑ n ∈ S, ∑ t : T, (W n / N) * ((primeProductWindow P ((n * R t : ℕ) : ℝ) X).card : ℝ) := by classical calc _ = ∑ n ∈ S, ∑ t : T, (W n / N) * ((X / ((n * R t : ℕ) : ℝ)) * H) := by simp only [mul_sum, sum_mul] rw [sum_comm] apply sum_congr rfl intro n hn apply sum_congr rfl intro t ht simp only [Nat.cast_mul, div_eq_mul_inv, mul_inv] ring _ ≤ _ := by apply sum_le_sum intro n hn apply sum_le_sum intro t ht exact mul_le_mul_of_nonneg_left (hcount n hn t) (div_nonneg (hW n hn) hN) end section open Finset theorem primeProductWindow_card_eq_sum (P : Finset ℕ) (R X : ℝ) : ((primeProductWindow P R X).card : ℝ) = ∑ p : P, if X < (p.val : ℝ) * R ∧ (p.val : ℝ) * R ≤ 16 * X then (1 : ℝ) else 0 := by classical have hsum := sum_coe_sort P (fun p => if X < (p : ℝ) * R ∧ (p : ℝ) * R ≤ 16 * X then (1 : ℝ) else 0) rw [hsum] simp only [primeProductWindow, ← sum_filter, sum_const, nsmul_eq_mul, mul_one] end section open Finset theorem ordered_slot_weight_window_sum {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (normalization : ℝ) (S : Finset ℕ) : (∑ n ∈ S, orderedSlotWeight choices normalization n) = ∑ x : ∀ i, choices i, if orderedSlotProduct choices x ∈ S then 1 / normalization else 0 := by classical simp only [orderedSlotWeight] rw [sum_comm] apply sum_congr · ext x simp · intro x _ simp end section open Finset theorem ordered_slot_product_sum_mono {I : Type*} [Fintype I] [DecidableEq I] (A B : I → Finset ℕ) (hAB : ∀ i, A i ⊆ B i) (F : ℕ → ℝ) (hF : ∀ n, 0 ≤ F n) : (∑ x : ∀ i, A i, F (orderedSlotProduct A x)) ≤ ∑ y : ∀ i, B i, F (orderedSlotProduct B y) := by classical let f : (∀ i, A i) → (∀ i, B i) := fun x i => ⟨(x i).val, hAB i (x i).property⟩ have hf : Function.Injective f := by intro x y hxy funext i exact Subtype.ext (congrArg (fun z => (z i).val) hxy) calc _ = ∑ y ∈ univ.image f, F (orderedSlotProduct B y) := by rw [sum_image] · rfl · intro x hx y hy hxy exact hf hxy _ ≤ _ := sum_le_sum_of_subset_of_nonneg (subset_univ _) (fun y _ _ => hF (orderedSlotProduct B y)) theorem ordered_slot_weight_mono {I : Type*} [Fintype I] (A B : I → Finset ℕ) (hAB : ∀ i, A i ⊆ B i) {N : ℝ} (hN : 0 ≤ N) (n : ℕ) : orderedSlotWeight A N n ≤ orderedSlotWeight B N n := by classical exact ordered_slot_product_sum_mono A B hAB (fun k => if k = n then 1 / N else 0) (fun k => by split_ifs <;> positivity) end section open Finset theorem repeated_big_unshared_iff_physical {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) (s : PhysicalSlots J ell) : repeatedBigUnshared C g s ↔ s ∈ physicalUnsharedSlots (ell := ell) (C g) := by classical cases s <;> simp [repeatedBigUnshared, physicalUnsharedSlots, physicalSharedSlots] theorem repeated_big_target_mass_physical {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (target : RepeatedBigLists P J ell) : repeatedBigTargetMass V b C target = ∏ g, ∏ s ∈ physicalUnsharedSlots (ell := ell) (C g), tiltedPhysicalBirthLaw V g (b g) (target g s) := by classical apply prod_congr rfl intro g hg exact (prod_subtype (physicalUnsharedSlots (ell := ell) (C g)) (fun s => (repeated_big_unshared_iff_physical C g s).symm) (fun s => tiltedPhysicalBirthLaw V g (b g) (target g s))).symm end section open Finset section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (b : (g : G) → P g → ℝ) (C : G → Finset (Fin J)) (source target : (g : G) → PhysicalSlots J ell → P g) {T Pmin : ℝ} (hT : 0 ≤ T) (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (hb : ∀ g (p : P g), b g p = 1 - T / (p.val : ℝ)) (hsmall : ((2 * ∑ g, (ell + (C g).card) : ℕ) : ℝ) * T / Pmin ≤ 1 / 2) include G sharedInstance1 P J ell b C source target T Pmin hT hPmin hp hb hsmall end end section open Finset open scoped Classical /- Both small-prime and ordered pending-prime residues follow the same integer step. -/ def cleanHybridResidueDirection {S G : Type*} {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {N : G → ℕ} (p : FixedOrderedMemoryLabels Pb N) : ℤ →+ (PhysicalResidues Ps × FixedOrderedResidues p) where toFun n := (physicalResiduesOfInt Ps n, fixedOrderedResidueDirection p n) map_zero' := by apply Prod.ext · funext q exact Int.cast_zero · exact map_zero _ map_add' a b := by apply Prod.ext · funext q exact Int.cast_add a b · exact map_add _ a b theorem clean_hybrid_residue_translation {S G : Type*} {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {N : G → ℕ} (p : FixedOrderedMemoryLabels Pb N) (r : PhysicalResidues Ps × FixedOrderedResidues p) (n : ℤ) : r + cleanHybridResidueDirection p n = (physicalTranslateResidues r.1 n, fixedOrderedResidueTranslate p r.2 n) := rfl /- The residue-independent coefficient after the two memory damping factors are absorbed into the endpoint functions. -/ noncomputable def cleanHybridCoreCoefficient {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell : ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (K : RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb C → ℂ) (d : PhysicalSharedLists Ps J) (aux : PhysicalAuxLabels Pb C) (source target : RepeatedBigLists Pb J ell) : ℂ := repeatedBigKernel Vb b C ζ K aux source target * physicalReturnPhase θ (cleanHybridStep k C source aux d) * physicalPhase ζ (physicalSharedProduct d) noncomputable def cleanHybridCoreAction {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell : ℕ} {N : G → ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (p : FixedOrderedMemoryLabels Pb N) (K : RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb C → ℂ) (d : PhysicalSharedLists Ps J) (f : RepeatedBigLists Pb J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ) (source : RepeatedBigLists Pb J ell) (r : PhysicalResidues Ps × FixedOrderedResidues p) : ℂ := ∑ aux, ∑ target, cleanHybridCoreCoefficient Vb b C ζ θ k K d aux source target * f target (physicalTranslateResidues r.1 (cleanHybridStep k C source aux d), fixedOrderedResidueTranslate p r.2 (cleanHybridStep k C source aux d)) end section open scoped BigOperators Classical theorem finite_weighted_sum_cauchy {X : Type*} (s : Finset X) (μ : X → ℝ) (hμ : ∀ x ∈ s, 0 ≤ μ x) (f : X → ℂ) : ‖∑ x ∈ s, (μ x : ℂ) * f x‖ ^ 2 ≤ (∑ x ∈ s, μ x) * ∑ x ∈ s, μ x * ‖f x‖ ^ 2 := by have h := complex_row_weighted_cauchy s (fun x => (μ x : ℂ)) f (fun _ => 1) (fun _ _ => by norm_num) simp only [Complex.norm_real, Real.norm_eq_abs, mul_one, div_one] at h have ha : ∀ x ∈ s, |μ x| = μ x := fun x hx => abs_of_nonneg (hμ x hx) simpa only [Finset.sum_congr rfl ha, Finset.sum_congr rfl (fun x hx => congrArg (fun a => a * ‖f x‖ ^ 2) (ha x hx))] using h theorem finite_weighted_fiber_energy_le {X Y : Type*} [Fintype X] (values : Finset Y) (π : X → Y) (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (f : X → ℂ) {B : ℝ} (hB : 0 ≤ B) (hmass : ∀ y ∈ values, (∑ x ∈ Finset.univ.filter (fun x => π x = y), μ x) ≤ B) : (∑ y ∈ values, ‖∑ x ∈ Finset.univ.filter (fun x => π x = y), (μ x : ℂ) * f x‖ ^ 2) ≤ B * ∑ x, μ x * ‖f x‖ ^ 2 := by have hc (y : Y) (hy : y ∈ values) : ‖∑ x ∈ Finset.univ.filter (fun x => π x = y), (μ x : ℂ) * f x‖ ^ 2 ≤ B * ∑ x ∈ Finset.univ.filter (fun x => π x = y), μ x * ‖f x‖ ^ 2 := by exact (finite_weighted_sum_cauchy _ μ (fun x _ => hμ x) f).trans (mul_le_mul_of_nonneg_right (hmass y hy) (Finset.sum_nonneg (fun x _ => mul_nonneg (hμ x) (sq_nonneg _)))) calc _ ≤ ∑ y ∈ values, B * ∑ x ∈ Finset.univ.filter (fun x => π x = y), μ x * ‖f x‖ ^ 2 := Finset.sum_le_sum hc _ = B * ∑ x, ∑ y ∈ values, if π x = y then μ x * ‖f x‖ ^ 2 else 0 := by simp only [Finset.sum_filter] rw [← Finset.mul_sum, Finset.sum_comm] _ ≤ B * ∑ x, μ x * ‖f x‖ ^ 2 := by apply mul_le_mul_of_nonneg_left _ hB apply Finset.sum_le_sum intro x _ by_cases hx : π x ∈ values · simp [Finset.sum_ite_eq, hx] · simp [Finset.sum_ite_eq, hx, mul_nonneg (hμ x) (sq_nonneg _)] end section /- Finite Abel summation with the exact weight `1/(n log n)`. -/ theorem norm_reciprocal_prime_sum_Ioc_le {q : ℕ} (χ : DirichletCharacter ℂ q) {m n : ℕ} (hm : 1 ≤ m) {B : ℝ} (hB : 0 ≤ B) (hprefix : ∀ k ∈ Finset.Icc m n, ‖twistedTheta χ k‖ ≤ B) : ‖∑ p ∈ (Finset.Ioc m n).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ 2 * (1 / ((m + 1 : ℕ) * Real.log (m + 1 : ℕ))) * B := by classical by_cases hmn : m < n · have hpos : ∀ i : ℕ, m + 1 ≤ i → 0 < (i : ℝ) := by intro i hi exact_mod_cast (show 0 < i by omega) have hlog : ∀ i : ℕ, m + 1 ≤ i → 0 < Real.log i := by intro i hi apply Real.log_pos exact_mod_cast (show 1 < i by omega) have hf : ∀ i ∈ Finset.Icc (m + 1) n, 0 ≤ 1 / ((i : ℝ) * Real.log i) := by intro i hi exact (one_div_pos.mpr (mul_pos (hpos i (Finset.mem_Icc.mp hi).1) (hlog i (Finset.mem_Icc.mp hi).1))).le have hanti : AntitoneOn (fun i : ℕ => 1 / ((i : ℝ) * Real.log i)) (Set.Icc (m + 1) n) := by intro i hi j hj hij apply one_div_le_one_div_of_le (mul_pos (hpos i hi.1) (hlog i hi.1)) apply mul_le_mul (by exact_mod_cast hij) (Real.log_le_log (hpos i hi.1) (by exact_mod_cast hij)) (hlog i hi.1).le (hpos j hj.1).le have hab := norm_sum_Ioc_smul_le_of_antitone (fun i : ℕ => 1 / ((i : ℝ) * Real.log i)) (primeLogTerm χ) hmn hf hanti (fun k hk => by rw [sum_primeLogTerm_range] exact hprefix k hk) have heq : (∑ i ∈ Finset.Ioc m n, (1 / ((i : ℝ) * Real.log i)) • primeLogTerm χ i) = ∑ p ∈ (Finset.Ioc m n).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q) := by rw [Finset.sum_filter] apply Finset.sum_congr rfl intro i hi by_cases hp : i.Prime · simp only [primeLogTerm, hp, ↓reduceIte] rw [← Complex.real_smul, smul_smul] congr 1 field_simp [(hlog i (by have := (Finset.mem_Ioc.mp hi).1; omega)).ne'] · simp [primeLogTerm, hp] rwa [heq] at hab · simp only [Finset.Ioc_eq_empty_of_le (by omega : n ≤ m), Finset.filter_empty, Finset.sum_empty, norm_zero] have hlog : 0 ≤ Real.log (m + 1 : ℕ) := Real.log_nonneg (by exact_mod_cast (show 1 ≤ m + 1 by omega)) positivity /- Real endpoints cost only the reciprocal logarithmic weight at the lower endpoint. -/ theorem norm_reciprocal_prime_sum_real_Ioc_le {q : ℕ} (χ : DirichletCharacter ℂ q) {x y B : ℝ} (hx : 2 ≤ x) (hB : 0 ≤ B) (hprefix : ∀ k ∈ Finset.Icc ⌊x⌋₊ ⌊y⌋₊, ‖twistedTheta χ k‖ ≤ B) : ‖∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ 2 * (1 / (x * Real.log x)) * B := by have hx0 : 0 < x := by linarith have hlogx : 0 < Real.log x := Real.log_pos (by linarith) have hm : 1 ≤ ⌊x⌋₊ := by apply Nat.le_floor norm_num linarith have hmx : x ≤ (⌊x⌋₊ + 1 : ℕ) := by exact_mod_cast (Nat.lt_floor_add_one x).le have hlog : Real.log x ≤ Real.log (⌊x⌋₊ + 1 : ℕ) := Real.log_le_log hx0 hmx have hinv : 1 / ((⌊x⌋₊ + 1 : ℕ) * Real.log (⌊x⌋₊ + 1 : ℕ)) ≤ 1 / (x * Real.log x) := by apply one_div_le_one_div_of_le (mul_pos hx0 hlogx) exact mul_le_mul hmx hlog hlogx.le (hx0.le.trans hmx) exact (norm_reciprocal_prime_sum_Ioc_le χ hm hB hprefix).trans (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hinv (by norm_num)) hB) end section /- A contracting dyadic envelope turns local shell estimates into a uniform bound for arbitrary finite upper endpoints. No infinite-series interchange is used. -/ theorem norm_sum_real_Ioc_le_of_dyadic_bound (f : ℕ → ℂ) (A : ℝ → ℝ) {K r : ℝ} (hK : 0 ≤ K) (hr0 : 0 ≤ r) (hr1 : r < 1) (hA : ∀ x : ℝ, 2 ≤ x → 0 ≤ A x) (hscale : ∀ x : ℝ, 2 ≤ x → A (2 * x) ≤ r * A x) (hlocal : ∀ x y : ℝ, 2 ≤ x → x ≤ y → y ≤ 2 * x → ‖∑ n ∈ Finset.Ioc ⌊x⌋₊ ⌊y⌋₊, f n‖ ≤ K * A x) {x y : ℝ} (hx : 2 ≤ x) (hxy : x ≤ y) : ‖∑ n ∈ Finset.Ioc ⌊x⌋₊ ⌊y⌋₊, f n‖ ≤ (K / (1 - r)) * A x := by have hd : 0 < 1 - r := by linarith have hKd : 0 ≤ K / (1 - r) := div_nonneg hK hd.le have hKK : K ≤ K / (1 - r) := by apply (le_div_iff₀ hd).mpr nlinarith have hall : ∀ N : ℕ, ∀ a b : ℝ, 2 ≤ a → a ≤ b → b ≤ (2 : ℝ) ^ N * a → ‖∑ n ∈ Finset.Ioc ⌊a⌋₊ ⌊b⌋₊, f n‖ ≤ (K / (1 - r)) * A a := by intro N induction N with | zero => intro a b ha hab hb have he : b = a := le_antisymm (by simpa using hb) hab subst b simpa using mul_nonneg hKd (hA a ha) | succ N ih => intro a b ha hab hb by_cases hshort : b ≤ 2 * a · exact (hlocal a b ha hab hshort).trans (mul_le_mul_of_nonneg_right hKK (hA a ha)) · have ha0 : 0 < a := by linarith have ha2 : 2 ≤ 2 * a := by linarith have h2b : 2 * a ≤ b := (lt_of_not_ge hshort).le have hb' : b ≤ (2 : ℝ) ^ N * (2 * a) := by calc b ≤ (2 : ℝ) ^ (N + 1) * a := hb _ = _ := by rw [pow_succ]; ring have hfirst := hlocal a (2 * a) ha (by linarith) le_rfl have hrest := ih (2 * a) b ha2 h2b hb' rw [← Finset.sum_Ioc_consecutive f (Nat.floor_le_floor (by linarith : a ≤ 2 * a)) (Nat.floor_le_floor h2b)] calc _ ≤ ‖∑ n ∈ Finset.Ioc ⌊a⌋₊ ⌊2 * a⌋₊, f n‖ + ‖∑ n ∈ Finset.Ioc ⌊2 * a⌋₊ ⌊b⌋₊, f n‖ := norm_add_le _ _ _ ≤ K * A a + (K / (1 - r)) * A (2 * a) := add_le_add hfirst hrest _ ≤ K * A a + (K / (1 - r)) * (r * A a) := add_le_add_right (mul_le_mul_of_nonneg_left (hscale a ha) hKd) _ _ = (K / (1 - r)) * A a := by field_simp; ring obtain ⟨N, hN⟩ := pow_unbounded_of_one_lt (y / x) (by norm_num : (1 : ℝ) < 2) apply hall N x y hx hxy exact ((div_lt_iff₀ (by linarith : 0 < x)).mp hN).le end section section variable {q : ℕ} (hq : 0 < q) (χ : DirichletCharacter ℂ q) (S : Finset ℕ) (hS : ∀ p ∈ S, p.Prime) include q hq χ S hS theorem norm_weighted_prime_sum_sub_primitive_le (w : ℕ → ℝ) {W : ℝ} (hW : 0 ≤ W) (hw : ∀ p ∈ S, 0 ≤ w p) (hwW : ∀ p ∈ S, w p ≤ W) : ‖(∑ p ∈ S, w p • χ (p : ZMod q)) - ∑ p ∈ S, w p • χ.primitiveCharacter (p : ZMod χ.conductor)‖ ≤ W * (q.primeFactors.card : ℝ) := by classical rw [← Finset.sum_sub_distrib] calc _ ≤ ∑ p ∈ S, ‖w p • χ (p : ZMod q) - w p • χ.primitiveCharacter (p : ZMod χ.conductor)‖ := norm_sum_le _ _ _ ≤ ∑ p ∈ S, if p ∈ q.primeFactors then W else 0 := by apply Finset.sum_le_sum intro p hp rw [← smul_sub, norm_smul, Real.norm_eq_abs, abs_of_nonneg (hw p hp)] have he := primitive_prime_value_error hq χ (hS p hp) by_cases hmem : p ∈ q.primeFactors · rw [if_pos hmem] at he ⊢ exact (mul_le_mul_of_nonneg_left he (hw p hp)).trans (by simpa using hwW p hp) · rw [if_neg hmem] at he ⊢ exact (mul_le_mul_of_nonneg_left he (hw p hp)).trans (by simp) _ = W * ((S.filter fun p => p ∈ q.primeFactors).card : ℝ) := by rw [← Finset.sum_filter] simp [mul_comm] _ ≤ W * (q.primeFactors.card : ℝ) := by apply mul_le_mul_of_nonneg_left _ hW exact_mod_cast (Finset.card_le_card (show (S.filter fun p => p ∈ q.primeFactors) ⊆ q.primeFactors from fun p hp => (Finset.mem_filter.mp hp).2)) theorem norm_reciprocal_prime_sum_sub_primitive_le {a : ℝ} (ha : 0 < a) (haS : ∀ p ∈ S, a ≤ (p : ℝ)) : ‖(∑ p ∈ S, (1 / (p : ℝ)) • χ (p : ZMod q)) - ∑ p ∈ S, (1 / (p : ℝ)) • χ.primitiveCharacter (p : ZMod χ.conductor)‖ ≤ (q.primeFactors.card : ℝ) / a := by calc _ ≤ (1 / a) * (q.primeFactors.card : ℝ) := norm_weighted_prime_sum_sub_primitive_le hq χ S hS (fun p => 1 / (p : ℝ)) (by positivity : 0 ≤ 1 / a) (fun p hp => by positivity) (fun p hp => one_div_le_one_div_of_le ha (haS p hp)) _ = _ := by ring theorem norm_reciprocal_prime_sum_sub_primitive_le_two_log {a : ℝ} (ha : 0 < a) (haS : ∀ p ∈ S, a ≤ (p : ℝ)) : ‖(∑ p ∈ S, (1 / (p : ℝ)) • χ (p : ZMod q)) - ∑ p ∈ S, (1 / (p : ℝ)) • χ.primitiveCharacter (p : ZMod χ.conductor)‖ ≤ 2 * Real.log q / a := by exact (norm_reciprocal_prime_sum_sub_primitive_le hq χ S hS ha haS).trans (div_le_div_of_nonneg_right (primeFactors_card_le_two_log hq) ha.le) end theorem reciprocal_prime_induction_error_absorbed {q x : ℝ} (hq : 1 ≤ q) (hx : 2 ≤ x) : 2 * Real.log q / x ≤ 4 * x ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log x) := by have hx0 : 0 < x := by linarith have hlx : 0 < Real.log x := Real.log_pos (by linarith) have hlq : 0 ≤ Real.log q := Real.log_nonneg hq have hr : 0 < x ^ (-(1 : ℝ) / 32) := Real.rpow_pos_of_pos hx0 _ have hp : x ^ ((31 : ℝ) / 32) = x * x ^ (-(1 : ℝ) / 32) := by calc _ = x ^ ((1 : ℝ) + (-(1 : ℝ) / 32)) := by norm_num _ = _ := by rw [Real.rpow_add hx0, Real.rpow_one] have hlog : Real.log x ≤ 2 * (x * x ^ (-(1 : ℝ) / 32)) := by have hh := Real.log_le_rpow_div hx0.le (by norm_num : (0 : ℝ) < 31 / 32) rw [hp] at hh have hxp : 0 ≤ x * x ^ (-(1 : ℝ) / 32) := by positivity linarith have hratio : Real.log x / x ≤ 2 * x ^ (-(1 : ℝ) / 32) := (div_le_iff₀ hx0).mpr (by nlinarith [hlog]) calc 2 * Real.log q / x = (2 * (Real.log q / Real.log x)) * (Real.log x / x) := by field_simp _ ≤ (2 * (Real.log q / Real.log x)) * (2 * x ^ (-(1 : ℝ) / 32)) := mul_le_mul_of_nonneg_left hratio (by positivity) _ ≤ _ := by nlinarith theorem norm_reciprocal_prime_sum_sub_primitive_le_decay {q : ℕ} (hq : 0 < q) (χ : DirichletCharacter ℂ q) (S : Finset ℕ) (hS : ∀ p ∈ S, p.Prime) {a : ℝ} (ha : 2 ≤ a) (haS : ∀ p ∈ S, a ≤ (p : ℝ)) : ‖(∑ p ∈ S, (1 / (p : ℝ)) • χ (p : ZMod q)) - ∑ p ∈ S, (1 / (p : ℝ)) • χ.primitiveCharacter (p : ZMod χ.conductor)‖ ≤ 4 * a ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log a) := by exact (norm_reciprocal_prime_sum_sub_primitive_le_two_log hq χ S hS (by linarith : 0 < a) haS).trans (reciprocal_prime_induction_error_absorbed (by exact_mod_cast hq) ha) end section theorem prime_power_error_le_character_scale_linear {q x : ℝ} (hq : 1 ≤ q) (hx : 2 ≤ x) : 2 * Real.sqrt x * Real.log x ≤ 2 * x ^ ((31 : ℝ) / 32) * Real.log (q * x) := by have hx0 : 0 < x := by linarith have hx1 : 1 ≤ x := by linarith have hlog : Real.log x ≤ Real.log (q * x) := Real.log_le_log hx0 (by nlinarith) have hsqrt : Real.sqrt x ≤ x ^ ((31 : ℝ) / 32) := by rw [Real.sqrt_eq_rpow] exact Real.rpow_le_rpow_of_exponent_le hx1 (by norm_num) have hlog0 : 0 ≤ Real.log x := Real.log_nonneg hx1 gcongr theorem primitive_twistedTheta_power_saving_linear_log (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (χ : OAI.Ostmann.PrimitiveComplexCharacter) (x : ℝ), 2 ≤ x → ‖twistedTheta χ.character x‖ ≤ C * x ^ ((31 : ℝ) / 32) * Real.log ((χ.modulus : ℝ) * x) := by obtain ⟨C, hC, hbound⟩ := primitive_twistedPsi_power_saving hZ refine ⟨C + 2, by linarith, ?_⟩ intro χ x hx have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive have he := prime_power_error_le_character_scale_linear hq hx have ht := norm_twistedTheta_le χ.character (by linarith : 1 ≤ x) (hbound χ x hx) nlinarith end section open Finset Classical end section open Finset Classical def FiniteLocalInvariant {X : Type*} (R : X → X → Prop) (f : X → ℂ) : Prop := ∀ x y, R x y → f y = f x def FiniteCoordinateInvariant {I : Type*} [DecidableEq I] {X : I → Type*} (i : I) (R : X i → X i → Prop) (f : (∀ j, X j) → ℂ) : Prop := ∀ x y, R (x i) y → f (Function.update x i y) = f x section variable {I : Type*} [sharedInstance1 : DecidableEq I] {X : I → Type*} include I sharedInstance1 X theorem finite_coordinate_invariant_slice (i : I) (R : X i → X i → Prop) (f : (∀ j, X j) → ℂ) (hf : FiniteCoordinateInvariant i R f) (x : ∀ j, X j) : FiniteLocalInvariant R (fun y => f (Function.update x i y)) := by intro y z hyz have h := hf (Function.update x i y) z (by simpa using hyz) simpa only [Function.update_idem] using h theorem finite_coordinate_lift_preserves_other (i j : I) (hij : i ≠ j) (R : X i → X i → Prop) (A : (X j → ℂ) → X j → ℂ) (f : (∀ k, X k) → ℂ) (hf : FiniteCoordinateInvariant i R f) : FiniteCoordinateInvariant i R (finiteCoordinateLift j A f) := by intro x y hxy simp only [finite_coordinate_lift_eq_update] have hsection : (fun z => f (Function.update (Function.update x i y) j z)) = (fun z => f (Function.update x j z)) := by funext z rw [Function.update_comm hij] apply hf simpa only [Function.update_of_ne hij] using hxy rw [hsection, Function.update_of_ne hij.symm] theorem finite_coordinate_compose_preserves_absent (i : I) (R : X i → X i → Prop) (A : ∀ j, (X j → ℂ) → X j → ℂ) (is : List I) (hi : i ∉ is) (f : (∀ j, X j) → ℂ) (hf : FiniteCoordinateInvariant i R f) : FiniteCoordinateInvariant i R (finiteCoordinateCompose A is f) := by induction is with | nil => exact hf | cons j js ih => apply finite_coordinate_lift_preserves_other i j · intro hij exact hi (by simp [hij]) · apply ih intro hmem exact hi (List.mem_cons_of_mem j hmem) theorem finite_coordinate_projected_lift_eq (i : I) (R : X i → X i → Prop) (A P : (X i → ℂ) → X i → ℂ) (hP : ∀ g, FiniteLocalInvariant R g → P g = g) (f : (∀ j, X j) → ℂ) (hf : FiniteCoordinateInvariant i R f) : finiteCoordinateLift i (fun g => A (P g)) f = finiteCoordinateLift i A f := by funext x simp only [finite_coordinate_lift_eq_update] rw [hP _ (finite_coordinate_invariant_slice i R f hf x)] /- On separately invariant inputs, inserted local symmetry projections do not change a composition with no repeated coordinate. -/ theorem finite_coordinate_projected_compose_eq (R : ∀ i, X i → X i → Prop) (A P : ∀ i, (X i → ℂ) → X i → ℂ) (hP : ∀ i g, FiniteLocalInvariant (R i) g → P i g = g) (is : List I) (his : is.Nodup) (f : (∀ i, X i) → ℂ) (hf : ∀ i, FiniteCoordinateInvariant i (R i) f) : finiteCoordinateCompose (fun i g => A i (P i g)) is f = finiteCoordinateCompose A is f := by induction is with | nil => rfl | cons i is ih => obtain ⟨hi, htail⟩ := List.nodup_cons.mp his simp only [finiteCoordinateCompose, ih htail] apply finite_coordinate_projected_lift_eq i (R i) (A i) (P i) (hP i) exact finite_coordinate_compose_preserves_absent i (R i) A is hi f (hf i) end /- A within-memory permutation preserves the active tuple and memory length. -/ def BoundedMemoryPermutationRelation {P Z : Type*} {t B : ℕ} (x y : BoundedOrderedState P Z t B) : Prop := ∃ τ : Equiv.Perm (Fin x.2.1.val), y = (x.1, ⟨x.2.1, x.2.2 ∘ τ⟩) theorem finite_local_memory_invariant_iff {P Z : Type*} {t B : ℕ} (f : BoundedOrderedState P Z t B → ℂ) : FiniteLocalInvariant BoundedMemoryPermutationRelation f ↔ BoundedOrderedSymmetric f := by constructor · intro h active N q τ exact h (active, ⟨N, q⟩) (active, ⟨N, q ∘ τ⟩) ⟨τ, rfl⟩ · intro h x y hxy obtain ⟨τ, rfl⟩ := hxy exact h x.1 x.2.1 x.2.2 τ theorem product_memory_symmetric_iff_coordinate {G : Type*} [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z t B → ℂ) : ProductMemorySymmetric f ↔ ∀ g : G, FiniteCoordinateInvariant (X := fun h => BoundedOrderedState (P h) (Z h) (t h) B) g (BoundedMemoryPermutationRelation (P := P g) (Z := Z g) (t := t g) (B := B)) f := by constructor · intro h g x y hxy obtain ⟨τ, rfl⟩ := hxy exact h x g τ · intro h x g τ exact h g x _ ⟨τ, rfl⟩ section variable {G : Type*} [sharedInstance1 : DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (A : ∀ g, (BoundedOrderedState (P g) (Z g) (t g) B → ℂ) → BoundedOrderedState (P g) (Z g) (t g) B → ℂ) include G sharedInstance1 P Z t B A /- Inserting actual bounded-memory permutation averaging before every coordinate action leaves the raw product unchanged on separately symmetric input, as long as no group is used twice. -/ theorem product_memory_projected_compose_eq (is : List G) (his : is.Nodup) (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) : finiteCoordinateCompose (fun g h => A g (boundedMemorySymmetrize h)) is f = finiteCoordinateCompose A is f := by apply finite_coordinate_projected_compose_eq (fun g => BoundedMemoryPermutationRelation (P := P g) (Z := Z g) (t := t g) (B := B)) A (fun _ => boundedMemorySymmetrize) · intro g h hh exact boundedMemorySymmetrize_eq_self h ((finite_local_memory_invariant_iff h).mp hh) · exact his · exact (product_memory_symmetric_iff_coordinate f).mp hf theorem product_memory_projected_finset_eq (s : Finset G) (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) : finiteCoordinateFinsetAction (fun g h => A g (boundedMemorySymmetrize h)) s f = finiteCoordinateFinsetAction A s f := by exact product_memory_projected_compose_eq A s.toList s.nodup_toList f hf end end section open Finset Classical noncomputable def unrestrictedEdgeEnergyBound (ρ v vmin vmax : ℝ) (T : ℕ) : ℝ := unrestrictedEdgeRowBound ρ v vmin T ^ 2 * unrestrictedEdgeReversalBound vmin vmax T theorem unrestrictedEdgeEnergyBound_nonneg (ρ v vmin vmax : ℝ) (T : ℕ) : 0 ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T := by unfold unrestrictedEdgeEnergyBound unrestrictedEdgeReversalBound positivity noncomputable def unrestrictedProjectedOperator {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (phase : UnrestrictedBoundedPhase n Δ D t B) (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) := unrestrictedBoundedOperator n Δ D μ ρ V t B phase (boundedMemorySymmetrize f) theorem unrestricted_projected_operator_energy_le {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) (μ : P → ℝ) {ρ V v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : vmin ≤ V) (hVhi : V ≤ vmax) (hμ : ∀ p, 0 ≤ μ p) (hmass : ∑ p, μ p ≤ 2) (t B T : ℕ) (ht : t ≤ T) (phase : UnrestrictedBoundedPhase n Δ D t B) (hphase : ∀ s stores promotions e fresh, ‖phase s stores promotions e fresh‖ ≤ 1) (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) : finiteWeightedEnergy (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ)) (unrestrictedProjectedOperator n Δ D μ ρ V t B phase f) ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T * finiteWeightedEnergy (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ)) f := by apply boundedMemorySymmetrize_transfer_energy_le μ (unrestrictedResidueWeight μ) hμ (fun z => hμ z.1) (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) (unrestrictedBoundedOperator n Δ D μ ρ V t B phase) intro g hg exact unrestricted_bounded_operator_energy_le n Δ D μ hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass t B T ht phase hphase g hg end section open Finset noncomputable def candidateSmallPSet (s L X : ℝ) : Finset ℕ := by classical exact (Iio ⌈X⌉₊).filter (fun n => n ∈ Nat.factoredNumbers ((candidatePIndices s L).biUnion (candidatePBand (s * L)))) theorem mem_candidateSmallPSet_iff (s L X : ℝ) (n : ℕ) : n ∈ candidateSmallPSet s L X ↔ (n : ℝ) < X ∧ n ∈ Nat.factoredNumbers ((candidatePIndices s L).biUnion (candidatePBand (s * L))) := by classical simp only [candidateSmallPSet, mem_filter, mem_Iio, Nat.lt_ceil] theorem candidate_small_P_set_nonzero {s L X : ℝ} {n : ℕ} (hn : n ∈ candidateSmallPSet s L X) : n ≠ 0 := Nat.ne_zero_of_mem_factoredNumbers ((mem_candidateSmallPSet_iff s L X n).mp hn).2 theorem candidate_small_P_set_log_bound {s L κ : ℝ} {n : ℕ} (hn : n ∈ candidateSmallPSet s L (Real.exp (κ * L))) : Real.log n < κ * L := by have hn0 : (0 : ℝ) < n := by exact_mod_cast Nat.pos_of_ne_zero (candidate_small_P_set_nonzero hn) exact (Real.log_lt_iff_lt_exp hn0).mpr ((mem_candidateSmallPSet_iff s L _ n).mp hn).1 theorem candidate_small_P_mass_eq_finite_sum (s L q X : ℝ) : candidateSmallPHarmonicMass s L q X = ∑ n ∈ candidateSmallPSet s L X, candidatePHarmonicTerm s L q n := by classical let P := (candidatePIndices s L).biUnion (candidatePBand (s * L)) let S := candidateSmallPSet s L X let T : Finset (Nat.factoredNumbers P) := S.subtype (fun n => n ∈ Nat.factoredNumbers P) have hcut : ∀ n ∈ T, (n.val : ℝ) < X := by intro n hn exact ((mem_candidateSmallPSet_iff s L X n.val).mp (mem_subtype.mp hn)).1 change (∑' n : Nat.factoredNumbers P, if (n.val : ℝ) < X then candidatePHarmonicTerm s L q n.val else 0) = _ calc _ = ∑ n ∈ T, if (n.val : ℝ) < X then candidatePHarmonicTerm s L q n.val else 0 := by apply tsum_eq_sum intro n hn have hnot : ¬(n.val : ℝ) < X := by intro h apply hn exact mem_subtype.mpr ((mem_candidateSmallPSet_iff s L X n.val).mpr ⟨h, n.property⟩) simp only [if_neg hnot] _ = ∑ n ∈ T, candidatePHarmonicTerm s L q n.val := sum_congr rfl (fun n hn => if_pos (hcut n hn)) _ = ∑ n ∈ S, candidatePHarmonicTerm s L q n := by apply sum_subtype_of_mem intro n hn exact ((mem_candidateSmallPSet_iff s L X n).mp hn).2 end section open Finset noncomputable def arithmeticProductWindow (p : ℕ) (X : ℝ) : Finset ℕ := (Iic ⌊16 * X⌋₊).filter (fun n => X < (p * n : ℕ) ∧ (p * n : ℕ) ≤ 16 * X) theorem mem_arithmeticProductWindow_iff {p n : ℕ} (hp : p ≠ 0) (X : ℝ) : n ∈ arithmeticProductWindow p X ↔ X < (p * n : ℕ) ∧ (p * n : ℕ) ≤ 16 * X := by simp only [arithmeticProductWindow, mem_filter, mem_Iic] constructor · exact And.right · intro h refine ⟨Nat.le_floor ?_, h⟩ have hn : n ≤ p * n := Nat.le_mul_of_pos_left n (Nat.pos_of_ne_zero hp) exact (by exact_mod_cast hn : (n : ℝ) ≤ (p * n : ℕ)).trans h.2 theorem ordered_slot_arithmetic_window_sum {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (N : ℝ) {p : ℕ} (hp : p ≠ 0) (X : ℝ) : (∑ n ∈ arithmeticProductWindow p X, orderedSlotWeight choices N n) = ∑ x : ∀ i, choices i, if X < (p * orderedSlotProduct choices x : ℕ) ∧ (p * orderedSlotProduct choices x : ℕ) ≤ 16 * X then 1 / N else 0 := by rw [ordered_slot_weight_window_sum] simp only [mem_arithmeticProductWindow_iff hp] theorem ordered_slot_arithmetic_window_split {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (i : I) (N : ℝ) {p : ℕ} (hp : p ≠ 0) (X : ℝ) : (∑ n ∈ arithmeticProductWindow p X, orderedSlotWeight choices N n) = ∑ y : ∀ j : {j : I // j ≠ i}, choices j.val, ((primeProductWindow (choices i) ((p * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y : ℕ) : ℝ) X).card : ℝ) / N := by rw [ordered_slot_arithmetic_window_sum choices N hp X] exact (by classical rw [ordered_slot_sum_test_split choices i (fun n => if X < (p * n : ℕ) ∧ (p * n : ℕ) ≤ 16 * X then 1 / N else 0)] rw [sum_comm] apply sum_congr rfl intro y _ rw [primeProductWindow_card_eq_sum, sum_div] apply sum_congr rfl intro a _ have heq : ((p * (a.val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y) : ℕ) : ℝ) = (a.val : ℝ) * ((p * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y : ℕ) : ℝ) := by simp only [Nat.cast_mul] ring rw [heq] split_ifs <;> simp ) end section end section open Finset open scoped Classical theorem repeated_big_shared_compatible_symm {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) {source target : RepeatedBigLists P J ell} (h : repeatedBigSharedCompatible C source target) : repeatedBigSharedCompatible C target source := fun g j hj => (h g j hj).symm section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) include G sharedInstance1 P J ell V /- The shared factors cancel between the source and target product measures. The identity even holds for an arbitrary baseline, before positivity or normalization. -/ theorem repeated_big_active_target_mass_balance (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) {source target : RepeatedBigLists P J ell} (h : repeatedBigSharedCompatible C source target) : repeatedBigActiveMass V b source * repeatedBigTargetMass V b C target = repeatedBigActiveMass V b target * repeatedBigTargetMass V b C source := by let shared (L : RepeatedBigLists P J ell) : ℝ := ∏ g, ∏ s ∈ physicalSharedSlots (ell := ell) (C g), tiltedPhysicalBirthLaw V g (b g) (L g s) have hsplit (L : RepeatedBigLists P J ell) : repeatedBigActiveMass V b L = shared L * repeatedBigTargetMass V b C L := by rw [repeated_big_target_mass_physical] unfold repeatedBigActiveMass shared physicalUnsharedSlots rw [← prod_mul_distrib] apply prod_congr rfl intro g hg exact (prod_mul_prod_compl _ _).symm have hshared : shared source = shared target := by apply prod_congr rfl intro g hg apply prod_congr rfl intro s hs obtain ⟨j, hj, rfl⟩ := mem_map.mp hs change tiltedPhysicalBirthLaw V g (b g) (source g (Sum.inl j)) = tiltedPhysicalBirthLaw V g (b g) (target g (Sum.inl j)) rw [h g j (mem_sdiff.mp hj).2] rw [hsplit source, hsplit target, hshared] ring /- Reversing the endpoints preserves the two auxiliary bans and the untilted auxiliary law. Swapping K gives an exact weighted transpose identity. -/ theorem repeated_big_kernel_weighted_transpose (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (source target : RepeatedBigLists P J ell) : (repeatedBigActiveMass V b source : ℂ) * repeatedBigKernel V b C ζ K aux source target = (repeatedBigActiveMass V b target : ℂ) * repeatedBigKernel V b C ζ (fun x y a => K y x a) aux target source := by have hs : repeatedBigSharedCompatible C source target ↔ repeatedBigSharedCompatible C target source := ⟨repeated_big_shared_compatible_symm C, repeated_big_shared_compatible_symm C⟩ by_cases h : repeatedBigSharedCompatible C source target ∧ repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target · have hr : repeatedBigSharedCompatible C target source ∧ repeatedBigAuxAvoids C aux target ∧ repeatedBigAuxAvoids C aux source := ⟨hs.mp h.1, h.2.2, h.2.1⟩ simp only [repeatedBigKernel] rw [if_pos h, if_pos hr] rw [← repeated_big_D_eq_of_shared C h.1 aux] have hm := congrArg (fun x : ℝ => (x : ℂ)) (repeated_big_active_target_mass_balance V b C h.1) push_cast at hm ⊢ linear_combination (physicalAuxMass V C aux : ℂ) * K source target aux * physicalPhase ζ (repeatedBigD C source aux) * hm · have hr : ¬ (repeatedBigSharedCompatible C target source ∧ repeatedBigAuxAvoids C aux target ∧ repeatedBigAuxAvoids C aux source) := by rintro ⟨hc, ht, hs'⟩ exact h ⟨hs.mpr hc, hs', ht⟩ simp [repeatedBigKernel, h, hr] theorem repeated_big_untilted_active_mass_nonneg (hV : ∀ g, 0 ≤ V g) (source : RepeatedBigLists P J ell) : 0 ≤ repeatedBigActiveMass V (fun _ _ => 1) source := by unfold repeatedBigActiveMass apply prod_nonneg intro g hg apply prod_nonneg intro s hs simpa only [tiltedPhysicalBirthLaw, div_one] using physical_label_law_nonneg V hV g (source g s) theorem repeated_big_untilted_kernel_weighted_norm_reverse (hV : ∀ g, 0 ≤ V g) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (source target : RepeatedBigLists P J ell) : repeatedBigActiveMass V (fun _ _ => 1) source * ‖repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖ = repeatedBigActiveMass V (fun _ _ => 1) target * ‖repeatedBigKernel V (fun _ _ => 1) C ζ (fun x y a => K y x a) aux target source‖ := by have h := congrArg norm (repeated_big_kernel_weighted_transpose V (fun _ _ => 1) C ζ K aux source target) simpa only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (repeated_big_untilted_active_mass_nonneg V hV source), abs_of_nonneg (repeated_big_untilted_active_mass_nonneg V hV target)] using h end end section /- The logarithm in a character prefix estimate loses only a logarithmic ratio. -/ theorem reciprocal_character_shell_scale_le {q x C : ℝ} (hq : 1 ≤ q) (hx : 2 ≤ x) (hC : 0 ≤ C) : 2 * (1 / (x * Real.log x)) * (C * (2 * x) ^ ((31 : ℝ) / 32) * Real.log (q * (2 * x))) ≤ 8 * C * x ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log x) := by have hx0 : 0 < x := by linarith have hq0 : 0 < q := by linarith have hlx : 0 < Real.log x := Real.log_pos (by linarith) have hlq : 0 ≤ Real.log q := Real.log_nonneg hq have hltwo : Real.log 2 ≤ Real.log x := Real.log_le_log (by norm_num) hx have hp : (2 : ℝ) ^ ((31 : ℝ) / 32) ≤ 2 := Real.rpow_le_self_of_one_le (by norm_num) (by norm_num) have hxpow : x ^ ((31 : ℝ) / 32) = x * x ^ (-(1 : ℝ) / 32) := by calc _ = x ^ ((1 : ℝ) + (-(1 : ℝ) / 32)) := by norm_num _ = x ^ (1 : ℝ) * x ^ (-(1 : ℝ) / 32) := Real.rpow_add hx0 _ _ _ = _ := by rw [Real.rpow_one] have hl : Real.log (q * (2 * x)) ≤ 2 * (Real.log x + Real.log q) := by rw [Real.log_mul hq0.ne' (by positivity), Real.log_mul (by norm_num) hx0.ne'] linarith have hratio : Real.log (q * (2 * x)) / Real.log x ≤ 2 * (1 + Real.log q / Real.log x) := by apply (div_le_iff₀ hlx).mpr calc _ ≤ 2 * (Real.log x + Real.log q) := hl _ = _ := by field_simp have hr0 : 0 ≤ Real.log (q * (2 * x)) / Real.log x := by apply div_nonneg _ hlx.le exact Real.log_nonneg (by nlinarith) calc _ = (2 * C * (2 : ℝ) ^ ((31 : ℝ) / 32) * x ^ (-(1 : ℝ) / 32)) * (Real.log (q * (2 * x)) / Real.log x) := by rw [Real.mul_rpow (by norm_num) hx0.le, hxpow] field_simp _ ≤ (2 * C * 2 * x ^ (-(1 : ℝ) / 32)) * (2 * (1 + Real.log q / Real.log x)) := by have hfirst : 2 * C * (2 : ℝ) ^ ((31 : ℝ) / 32) * x ^ (-(1 : ℝ) / 32) ≤ 2 * C * 2 * x ^ (-(1 : ℝ) / 32) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hp (by positivity)) (Real.rpow_nonneg hx0.le _) exact mul_le_mul hfirst hratio hr0 (by positivity) _ = _ := by ring /- Every subinterval ending within twice its lower endpoint has a true reciprocal-prime power saving. The prefix hypothesis is the actual twisted theta sum. -/ theorem reciprocal_prime_partial_dyadic_shell_bound {q : ℕ} (χ : DirichletCharacter ℂ q) (hq : 0 < q) {C : ℝ} (hC : 0 ≤ C) (hbound : ∀ z : ℝ, 2 ≤ z → ‖twistedTheta χ z‖ ≤ C * z ^ ((31 : ℝ) / 32) * Real.log ((q : ℝ) * z)) {x y : ℝ} (hx : 2 ≤ x) (hxy : x ≤ y) (hy : y ≤ 2 * x) : ‖∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ 8 * C * x ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log x) := by have hx0 : 0 < x := by linarith have hy0 : 0 ≤ y := by linarith have hq1 : (1 : ℝ) ≤ q := by exact_mod_cast hq let B := C * (2 * x) ^ ((31 : ℝ) / 32) * Real.log ((q : ℝ) * (2 * x)) have hB : 0 ≤ B := by have hl : 0 ≤ Real.log ((q : ℝ) * (2 * x)) := Real.log_nonneg (by nlinarith) positivity have hm : 2 ≤ ⌊x⌋₊ := by apply Nat.le_floor norm_num exact hx have hprefix : ∀ k ∈ Finset.Icc ⌊x⌋₊ ⌊y⌋₊, ‖twistedTheta χ k‖ ≤ B := by intro k hk obtain ⟨hmk, hkn⟩ := Finset.mem_Icc.mp hk have hk2 : (2 : ℝ) ≤ k := by exact_mod_cast hm.trans hmk have hkx : (k : ℝ) ≤ 2 * x := ((Nat.le_floor_iff hy0).mp hkn).trans hy have hl : 0 ≤ Real.log ((q : ℝ) * k) := Real.log_nonneg (by nlinarith) apply (hbound k hk2).trans dsimp [B] gcongr exact (norm_reciprocal_prime_sum_real_Ioc_le χ hx hB hprefix).trans (reciprocal_character_shell_scale_le hq1 hx hC) end section open Finset Classical section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) noncomputable def unrestrictedProductOperator (phase : ∀ g, UnrestrictedBoundedPhase (n g) (Δ g) (D g) (t g) B) (groups : Finset G) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) := finiteCoordinateFinsetAction (fun g => unrestrictedBoundedOperator (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (phase g)) groups f noncomputable def unrestrictedProjectedProductOperator (phase : ∀ g, UnrestrictedBoundedPhase (n g) (Δ g) (D g) (t g) B) (groups : Finset G) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) := finiteCoordinateFinsetAction (fun g => unrestrictedProjectedOperator (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (phase g)) groups f noncomputable def unrestrictedCutoffProductOperator (phase : ∀ g, UnrestrictedBoundedPhase (n g) (Δ g) (D g) (t g) B) (groups : Finset G) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) := productMemoryCutoff (unrestrictedProductOperator n Δ D μ ρ V t B phase groups (productMemoryCutoff f)) omit [Fintype G] in theorem unrestricted_projected_product_eq_of_symmetric (phase : ∀ g, UnrestrictedBoundedPhase (n g) (Δ g) (D g) (t g) B) (groups : Finset G) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : unrestrictedProjectedProductOperator n Δ D μ ρ V t B phase groups f = unrestrictedProductOperator n Δ D μ ρ V t B phase groups f := by exact product_memory_projected_finset_eq (fun g => unrestrictedBoundedOperator (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (phase g)) groups f hf theorem unrestricted_product_energy_le {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, t g ≤ T) (phase : ∀ g, UnrestrictedBoundedPhase (n g) (Δ g) (D g) (t g) B) (hphase : ∀ g s stores promotions e fresh, ‖phase g s stores promotions e fresh‖ ≤ 1) (groups : Finset G) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (unrestrictedProductOperator n Δ D μ ρ V t B phase groups f) ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ groups.card * finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by rw [← unrestricted_projected_product_eq_of_symmetric n Δ D μ ρ V t B phase groups f hf] exact (by have h := finite_coordinate_finset_energy_le (fun g => boundedOrderedStateWeight (μ g) (unrestrictedResidueWeight (μ g))) (fun g s => boundedOrderedStateWeight_nonneg (μ g) (unrestrictedResidueWeight (μ g)) (hμ g) (fun z => hμ g z.1) s) (fun g => unrestrictedProjectedOperator (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (phase g)) (fun _ => unrestrictedEdgeEnergyBound ρ v vmin vmax T) (fun _ => unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) (fun g f => unrestricted_projected_operator_energy_le (n g) (Δ g) (D g) (μ g) hρ0 hρ1 hv hvmin (hVlo g) (hVhi g) (hμ g) (hmass g) (t g) B T (ht g) (phase g) (hphase g) f) groups f simpa only [prod_const, finiteWeightedEnergy, finiteProductWeight, productMemoryWeight, unrestrictedProjectedProductOperator] using h ) end end section open Finset Filter open scoped Topology theorem candidate_prefix_rest_mass_eq_tuple_sum (c L eps : ℝ) (r jStar J : ℕ) (hr : 0 < r) : candidatePrefixRestHarmonicMass c L eps r jStar J hr = ∑ y : ∀ slot, candidatePrefixRestChoices c L eps r jStar J hr slot, (1 / (orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr) y : ℝ)) / ((r.factorial : ℝ)^(candidateQIndices c L).card) := by exact ordered_slot_harmonic_eq_tuple_sum _ _ theorem candidate_rest_tuple_complete (c L eps : ℝ) (r jStar J : ℕ) (hr : 0 < r) (p0 : candidatePrefixChoices c L eps r jStar J (candidateFreeSlot c L r hr)) (y : ∀ slot, candidatePrefixRestChoices c L eps r jStar J hr slot) : ∃ x : (candidateQIndices c L) × Fin r → ℕ, (∀ slot, x slot ∈ candidatePrefixChoices c L eps r jStar J slot) ∧ candidateRestProduct c L r hr x = orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr) y := by classical let x := fun slot => if h : slot = candidateFreeSlot c L r hr then p0.val else (y ⟨slot, h⟩).val refine ⟨x, ?_, ?_⟩ · intro slot by_cases h : slot = candidateFreeSlot c L r hr · subst slot simpa only [x, dif_pos rfl] using p0.property · simpa only [x, dif_neg h, candidatePrefixRestChoices] using (y ⟨slot, h⟩).property · unfold candidateRestProduct orderedSlotProduct apply prod_congr rfl intro slot _ simp only [x, dif_neg slot.property] theorem candidate_rest_tuple_nonzero {c L eps : ℝ} {r jStar J : ℕ} (hr : 0 < r) (hcL : 0 ≤ c * L) (heps1 : eps ≤ 1/10) (hJ : J < jStar) (y : ∀ slot, candidatePrefixRestChoices c L eps r jStar J hr slot) : orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr) y ≠ 0 := by apply prod_ne_zero_iff.mpr intro slot _ exact candidate_Q_slot_nonzero c L r jStar slot.val (candidatePrefixChoices_subset hcL heps1 hJ slot.val (y slot).property) theorem eventually_candidate_rest_tuple_log_window {c eps : ℝ} {r J : ℕ} (hc : 0 < c) (hr : 0 < r) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1/10) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hepsr : eps * (r : ℝ) ≤ 1/400) (hJ : 1000 * (r : ℝ) ≤ 2^J) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → ∀ y : ∀ slot, candidatePrefixRestChoices c L eps r jStar J hr slot, ∀ p ∈ candidateSmallPSet c L (Real.exp ((c / 100) * L)), c * L ≤ Real.log (Real.exp L / ((p * orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr) y : ℕ) : ℝ)) ∧ Real.log (Real.exp L / ((p * orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr) y : ℕ) : ℝ)) + Real.log 16 ≤ (6/5 : ℝ) * c * L := by classical obtain ⟨v, V, hv, _, hband⟩ := exists_candidateQBands_bounds hc filter_upwards [eventually_candidate_remainder_log_window hc hr heps0 heps1 hcenter hepsr hJ, hband] with L hwindow hb intro jStar hJstar y p hp have hzero : 0 ∈ candidateQIndices c L := by simp [candidateQIndices] have hlower := (hb.2.2 0 hzero).2.2.1 have hne : (candidateQBand (c * L) 0).Nonempty := by by_contra hn rw [not_nonempty_iff_eq_empty.mp hn, sum_empty] at hlower linarith obtain ⟨p0, hp0⟩ := hne have hp0' : p0 ∈ candidatePrefixChoices c L eps r jStar J (candidateFreeSlot c L r hr) := by rw [candidate_prefix_free_choice c L eps r jStar J hr hJstar] exact hp0 obtain ⟨x, hx, hprod⟩ := candidate_rest_tuple_complete c L eps r jStar J hr ⟨p0, hp0'⟩ y have hpLog : Real.log p ≤ c * L / 100 := by have h := candidate_small_P_set_log_bound hp nlinarith have h := hwindow jStar hJstar x hx p (candidate_small_P_set_nonzero hp) hpLog rwa [hprod] at h end section open Finset end section open Finset open scoped Classical theorem repeated_big_untilted_target_mass_nonneg {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 ≤ V g) (C : G → Finset (Fin J)) (target : RepeatedBigLists P J ell) : 0 ≤ repeatedBigTargetMass V (fun _ _ => 1) C target := by unfold repeatedBigTargetMass apply prod_nonneg intro g hg apply prod_nonneg intro s hs simpa only [tiltedPhysicalBirthLaw, div_one] using physical_label_law_nonneg V hV g (target g s.val) theorem repeated_big_untilted_fresh_mass_sum {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) : (∑ fresh : RepeatedBigFresh P C ell, repeatedBigFreshMass V (fun _ _ => 1) C fresh) = 1 := by unfold repeatedBigFreshMass simp only [tiltedPhysicalBirthLaw, div_one] have hout := (Fintype.prod_sum (fun g (f : {s : PhysicalSlots J ell // repeatedBigUnshared C g s} → P g) => ∏ s, physicalLabelLaw V g (f s))).symm rw [hout] apply prod_eq_one intro g hg rw [← Fintype.prod_sum] apply prod_eq_one intro s hs exact physical_label_law_sum V g (hV g) (hMass g) theorem repeated_big_untilted_compatible_target_mass_sum {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (source : RepeatedBigLists P J ell) : (∑ target : RepeatedBigLists P J ell, if repeatedBigSharedCompatible C source target then repeatedBigTargetMass V (fun _ _ => 1) C target else 0) = 1 := by rw [← repeated_big_target_sum] simp_rw [repeated_big_fill_mass] exact repeated_big_untilted_fresh_mass_sum V C hV hMass theorem repeated_big_untilted_kernel_norm_le {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 ≤ V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) (aux : PhysicalAuxLabels P C) (source target : RepeatedBigLists P J ell) : ‖repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖ ≤ physicalAuxMass V C aux * B * (if repeatedBigSharedCompatible C source target then repeatedBigTargetMass V (fun _ _ => 1) C target else 0) := by have ha := physical_aux_mass_nonneg V C hV aux have ht := repeated_big_untilted_target_mass_nonneg V hV C target unfold repeatedBigKernel by_cases h : repeatedBigSharedCompatible C source target ∧ repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target · rw [if_pos h, if_pos h.1, norm_mul, norm_mul, physical_phase_norm, mul_one, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg ha ht)] calc _ ≤ (physicalAuxMass V C aux * repeatedBigTargetMass V (fun _ _ => 1) C target) * B := mul_le_mul_of_nonneg_left (hK source target aux) (mul_nonneg ha ht) _ = _ := by ring · rw [if_neg h, norm_zero] by_cases hs : repeatedBigSharedCompatible C source target · rw [if_pos hs] exact mul_nonneg (mul_nonneg ha hB) ht · rw [if_neg hs, mul_zero] /- Both independent draws and endpoint collision bans are the actual kernel's. Dropping the bans can only increase this nonnegative row mass. -/ theorem repeated_big_untilted_kernel_row_bound {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) (source : RepeatedBigLists P J ell) : (∑ aux, ∑ target, ‖repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖) ≤ B := by calc _ ≤ ∑ aux : PhysicalAuxLabels P C, ∑ target : RepeatedBigLists P J ell, physicalAuxMass V C aux * B * (if repeatedBigSharedCompatible C source target then repeatedBigTargetMass V (fun _ _ => 1) C target else 0) := by exact sum_le_sum (fun aux _ => sum_le_sum (fun target _ => repeated_big_untilted_kernel_norm_le V C (fun g => (hV g).le) ζ K B hB hK aux source target)) _ = ∑ aux : PhysicalAuxLabels P C, physicalAuxMass V C aux * B := by simp_rw [← mul_sum, repeated_big_untilted_compatible_target_mass_sum V C hV hMass source, mul_one] _ = B := by rw [← sum_mul, physical_aux_mass_sum V C hV hMass, one_mul] end section theorem reciprocal_character_profile_doubling {q x : ℝ} (hq : 1 ≤ q) (hx : 2 ≤ x) : (2 * x) ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log (2 * x)) ≤ (2 : ℝ) ^ (-(1 : ℝ) / 32) * (x ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log x)) := by have hx0 : 0 < x := by linarith have hlx : 0 < Real.log x := Real.log_pos (by linarith) have hlq : 0 ≤ Real.log q := Real.log_nonneg hq have hlogs : Real.log x ≤ Real.log (2 * x) := Real.log_le_log hx0 (by linarith) have hratio : Real.log q / Real.log (2 * x) ≤ Real.log q / Real.log x := div_le_div_of_nonneg_left hlq hlx hlogs rw [Real.mul_rpow (by norm_num) hx0.le] calc _ ≤ ((2 : ℝ) ^ (-(1 : ℝ) / 32) * x ^ (-(1 : ℝ) / 32)) * (1 + Real.log q / Real.log x) := by gcongr _ = _ := by ring /- The upper endpoint is unrestricted. The constant and decay depend only on the theta prefix constant and the lower endpoint. -/ theorem reciprocal_prime_interval_bound_of_theta {q : ℕ} (χ : DirichletCharacter ℂ q) (hq : 0 < q) {C : ℝ} (hC : 0 ≤ C) (hbound : ∀ z : ℝ, 2 ≤ z → ‖twistedTheta χ z‖ ≤ C * z ^ ((31 : ℝ) / 32) * Real.log ((q : ℝ) * z)) {x y : ℝ} (hx : 2 ≤ x) (hxy : x ≤ y) : ‖∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ (8 * C / (1 - (2 : ℝ) ^ (-(1 : ℝ) / 32))) * x ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log x) := by classical have hq1 : (1 : ℝ) ≤ q := by exact_mod_cast hq have hlq : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg hq1 have htail := norm_sum_real_Ioc_le_of_dyadic_bound (fun p : ℕ => if p.Prime then (1 / (p : ℝ)) • χ (p : ZMod q) else 0) (fun a : ℝ => a ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log a)) (K := 8 * C) (r := (2 : ℝ) ^ (-(1 : ℝ) / 32)) (by positivity) (Real.rpow_nonneg (by norm_num) _) (Real.rpow_lt_one_of_one_lt_of_neg (by norm_num) (by norm_num)) (by intro a ha have hla : 0 ≤ Real.log a := Real.log_nonneg (by linarith) have ha0 : 0 ≤ a := by linarith positivity) (fun a ha => reciprocal_character_profile_doubling hq1 ha) (by intro a b ha hab hb rw [← Finset.sum_filter] simpa only [mul_assoc] using reciprocal_prime_partial_dyadic_shell_bound χ hq hC hbound ha hab hb) hx hxy rw [← Finset.sum_filter] at htail simpa only [mul_assoc] using htail end section open Finset Classical end section open Finset Filter open scoped Topology noncomputable def candidatePWeight (c L q : ℝ) (p : ℕ) : ℝ := (p : ℝ) * candidatePHarmonicTerm c L q p noncomputable def candidateLocalizedWindowMass (c L eps q : ℝ) (r jStar J : ℕ) (hr : 0 < r) : ℝ := ∑ p ∈ candidateSmallPSet c L (Real.exp ((c / 100) * L)), ∑ y : ∀ slot, candidatePrefixRestChoices c L eps r jStar J hr slot, (candidatePWeight c L q p / ((r.factorial : ℝ)^(candidateQIndices c L).card)) * ((primeProductWindow (candidateQBand (c * L) 0) ((p * orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr) y : ℕ) : ℝ) (Real.exp L)).card : ℝ) theorem candidate_P_weight_eq_marked (c L q : ℝ) {p : ℕ} (hp : p ≠ 0) : candidatePWeight c L q p = markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ a ∈ candidatePBand (c * L) j, 1 / (a : ℝ)) (fun _ => 1) (p : ℤ) := by have hpR : (p : ℝ) ≠ 0 := by exact_mod_cast hp unfold candidatePWeight candidatePHarmonicTerm oneMarkedGroupTerm field_simp theorem candidate_P_weight_nonneg (c L : ℝ) {q : ℝ} (hq : 0 ≤ q) (p : ℕ) : 0 ≤ candidatePWeight c L q p := by apply mul_nonneg (Nat.cast_nonneg p) apply div_nonneg · exact marked_divisor_weight_nonneg _ _ hq _ _ (fun _ _ => sum_nonneg (fun _ _ => by positivity)) _ · exact Nat.cast_nonneg p theorem candidate_P_weight_harmonic (c L q : ℝ) {p : ℕ} (hp : p ≠ 0) : candidatePWeight c L q p / (p : ℝ) = candidatePHarmonicTerm c L q p := by have hpR : (p : ℝ) ≠ 0 := by exact_mod_cast hp unfold candidatePWeight exact mul_div_cancel_left₀ _ hpR theorem candidate_small_P_weight_harmonic_sum (c L q X : ℝ) : (∑ p ∈ candidateSmallPSet c L X, candidatePWeight c L q p / (p : ℝ)) = candidateSmallPHarmonicMass c L q X := by rw [candidate_small_P_mass_eq_finite_sum] exact sum_congr rfl (fun _ hp => candidate_P_weight_harmonic c L q (candidate_small_P_set_nonzero hp)) theorem eventually_candidate_rest_free_prime_count {c eps : ℝ} {r J : ℕ} (hc : 0 < c) (hr : 0 < r) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1/10) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hepsr : eps * (r : ℝ) ≤ 1/400) (hJ : 1000 * (r : ℝ) ≤ 2^J) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → ∀ p ∈ candidateSmallPSet c L (Real.exp ((c / 100) * L)), ∀ y : ∀ slot, candidatePrefixRestChoices c L eps r jStar J hr slot, (Real.exp L / ((p * orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr) y : ℕ) : ℝ)) * ((((2 * Real.log 2 - 1) / 16) / ((6/5 : ℝ) * c)) / L) ≤ ((primeProductWindow (candidateQBand (c * L) 0) ((p * orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr) y : ℕ) : ℝ) (Real.exp L)).card : ℝ) := by have hcc : c ≤ (6/5 : ℝ) * c := by linarith filter_upwards [eventually_candidate_rest_tuple_log_window hc hr heps0 heps1 hcenter hepsr hJ, eventually_primeProductWindow_card_lower hc hcc, eventually_ge_atTop (0 : ℝ)] with L hw hcCount hL intro jStar hJstar p hp y have hrest := candidate_rest_tuple_nonzero hr (mul_nonneg hc.le hL) heps1 hJstar y have hn0 : (0 : ℝ) < (p * orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr) y : ℕ) := by exact_mod_cast Nat.pos_of_ne_zero (mul_ne_zero (candidate_small_P_set_nonzero hp) hrest) have hwindow := hw jStar hJstar y p hp refine hcCount _ _ _ (fun _ ha => (mem_filter.mp ha).2) hn0 (Real.exp_pos L) (wide_prime_window_subset_candidateQBand hn0 (Real.exp_pos L) hwindow.1 hwindow.2) hwindow.1 ?_ have hlog16 : 0 ≤ Real.log 16 := Real.log_nonneg (by norm_num) nlinarith [hwindow.2] end section open Finset open scoped Classical theorem repeated_big_untilted_kernel_column_bound {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) (target : RepeatedBigLists P J ell) : (∑ aux, ∑ source, repeatedBigActiveMass V (fun _ _ => 1) source * ‖repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖) ≤ B * repeatedBigActiveMass V (fun _ _ => 1) target := by calc _ = ∑ aux, ∑ source, repeatedBigActiveMass V (fun _ _ => 1) target * ‖repeatedBigKernel V (fun _ _ => 1) C ζ (fun x y a => K y x a) aux target source‖ := by apply sum_congr rfl intro aux ha apply sum_congr rfl intro source hs exact repeated_big_untilted_kernel_weighted_norm_reverse V (fun g => (hV g).le) C ζ K aux source target _ = repeatedBigActiveMass V (fun _ _ => 1) target * ∑ aux, ∑ source, ‖repeatedBigKernel V (fun _ _ => 1) C ζ (fun x y a => K y x a) aux target source‖ := by simp_rw [mul_sum] _ ≤ repeatedBigActiveMass V (fun _ _ => 1) target * B := mul_le_mul_of_nonneg_left (repeated_big_untilted_kernel_row_bound V C hV hMass ζ (fun x y a => K y x a) B hB (fun x y a => hK y x a) target) (repeated_big_untilted_active_mass_nonneg V (fun g => (hV g).le) target) _ = _ := mul_comm _ _ /- A pointwise error dominated by the actual base transition has a concrete operator bound; its row and weighted column masses are derived, not assumed. -/ theorem repeated_big_dominated_schur {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) (E : RepeatedBigLists P J ell → RepeatedBigLists P J ell → ℂ) (η : ℝ) (hη : 0 ≤ η) (hE : ∀ source target, ‖E source target‖ ≤ η * ∑ aux, ‖repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖) (f : RepeatedBigLists P J ell → ℂ) : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (fun source => ∑ target, E source target * f target) ≤ (η * B) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f := by have hμ := repeated_big_untilted_active_mass_nonneg (P := P) (J := J) (ell := ell) V (fun g => (hV g).le) have hrow (source : RepeatedBigLists P J ell) : ∑ target, ‖E source target‖ ≤ η * B := by calc _ ≤ ∑ target, η * ∑ aux, ‖repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖ := sum_le_sum (fun target _ => hE source target) _ = η * ∑ aux, ∑ target, ‖repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖ := by rw [← mul_sum, sum_comm] _ ≤ η * B := mul_le_mul_of_nonneg_left (repeated_big_untilted_kernel_row_bound V C hV hMass ζ K B hB hK source) hη have hcol (target : RepeatedBigLists P J ell) : ∑ source, repeatedBigActiveMass V (fun _ _ => 1) source * ‖E source target‖ ≤ (η * B) * repeatedBigActiveMass V (fun _ _ => 1) target := by calc _ ≤ ∑ source, repeatedBigActiveMass V (fun _ _ => 1) source * (η * ∑ aux, ‖repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖) := sum_le_sum (fun source _ => mul_le_mul_of_nonneg_left (hE source target) (hμ source)) _ = η * ∑ aux, ∑ source, repeatedBigActiveMass V (fun _ _ => 1) source * ‖repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖ := by simp_rw [mul_sum] rw [sum_comm] apply sum_congr rfl intro aux ha apply sum_congr rfl intro source hs ring _ ≤ η * (B * repeatedBigActiveMass V (fun _ _ => 1) target) := mul_le_mul_of_nonneg_left (repeated_big_untilted_kernel_column_bound V C hV hMass ζ K B hB hK target) hη _ = _ := by ring have h := finite_weighted_schur_transition_norm univ (repeatedBigActiveMass V (fun _ _ => 1)) (fun _ => 1) E (fun source _ => hμ source) (fun _ _ => zero_lt_one) (mul_nonneg hη hB) (mul_nonneg hη hB) (fun source _ => by simpa only [mul_one] using hrow source) (fun target _ => by simpa only [mul_one] using hcol target) f simpa only [cleanActiveNorm, ← pow_two, Real.sqrt_sq (mul_nonneg hη hB)] using h end section /- Uniform in the upper endpoint, the modulus, and the nonprincipal character. The lower endpoint retains the full `1/32` power saving. -/ theorem reciprocal_prime_interval_bound_of_zero_free (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ x y : ℝ, 2 ≤ x → x ≤ y → ‖∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ C * x ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log x) := by classical obtain ⟨A, hA, htheta⟩ := primitive_twistedTheta_power_saving_linear_log hZ let D := 8 * A / (1 - (2 : ℝ) ^ (-(1 : ℝ) / 32)) have hr : (2 : ℝ) ^ (-(1 : ℝ) / 32) < 1 := Real.rpow_lt_one_of_one_lt_of_neg (by norm_num) (by norm_num) have hD : 0 < D := by dsimp [D]; positivity refine ⟨D + 4, by positivity, ?_⟩ intro q hq χ hχ x y hx hxy let : NeZero q := ⟨hq.ne'⟩ have hd : 0 < χ.conductor := Nat.pos_of_ne_zero χ.conductor_ne_zero have hdq : χ.conductor ≤ q := Nat.le_of_dvd hq χ.conductor_dvd_level have hprimitive : χ.primitiveCharacter ≠ 1 := by intro he apply hχ rw [← χ.changeLevel_primitiveCharacter, he, map_one] let ψ : OAI.Ostmann.PrimitiveComplexCharacter := ⟨χ.conductor, hd, χ.primitiveCharacter, χ.primitiveCharacter_isPrimitive, hprimitive⟩ have hp := reciprocal_prime_interval_bound_of_theta χ.primitiveCharacter hd hA.le (fun z hz => htheta ψ z hz) hx hxy have hx0 : 0 < x := by linarith have hlx : 0 < Real.log x := Real.log_pos (by linarith) have hd0 : (0 : ℝ) < χ.conductor := by exact_mod_cast hd have hlogs : Real.log (χ.conductor : ℝ) ≤ Real.log (q : ℝ) := Real.log_le_log hd0 (by exact_mod_cast hdq) have hp' : ‖∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ.primitiveCharacter (p : ZMod χ.conductor)‖ ≤ D * x ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log x) := by apply hp.trans change D * x ^ (-(1 : ℝ) / 32) * (1 + Real.log χ.conductor / Real.log x) ≤ _ gcongr have he := norm_reciprocal_prime_sum_sub_primitive_le_decay hq χ ((Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime) (fun p hp => (Finset.mem_filter.mp hp).2) hx (fun p hp => by have hm := (Finset.mem_Ioc.mp (Finset.mem_filter.mp hp).1).1 exact ((Nat.floor_lt hx0.le).mp hm).le) calc _ = ‖((∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q)) - (∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ.primitiveCharacter (p : ZMod χ.conductor))) + (∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ.primitiveCharacter (p : ZMod χ.conductor))‖ := by rw [sub_add_cancel] _ ≤ _ := (norm_add_le _ _).trans (add_le_add he hp') _ = _ := by ring end section open Finset Filter open scoped Topology theorem eventually_candidate_localized_mass_harmonic_lower {c eps q : ℝ} {r J : ℕ} (hc : 0 < c) (hr : 0 < r) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1/10) (hq : 0 ≤ q) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hepsr : eps * (r : ℝ) ≤ 1/400) (hJ : 1000 * (r : ℝ) ≤ 2^J) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → Real.exp L * ((((2 * Real.log 2 - 1) / 16) / ((6/5 : ℝ) * c)) / L) * candidateSmallPHarmonicMass c L q (Real.exp ((c / 100) * L)) * candidatePrefixRestHarmonicMass c L eps r jStar J hr ≤ candidateLocalizedWindowMass c L eps q r jStar J hr := by filter_upwards [eventually_candidate_rest_free_prime_count hc hr heps0 heps1 hcenter hepsr hJ] with L hcount intro jStar hJstar have h := indexed_free_prime_mass_lower (candidateSmallPSet c L (Real.exp ((c / 100) * L))) (candidateQBand (c * L) 0) (candidatePWeight c L q) (orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr)) ((r.factorial : ℝ)^(candidateQIndices c L).card) (Real.exp L) ((((2 * Real.log 2 - 1) / 16) / ((6/5 : ℝ) * c)) / L) (by positivity) (fun p _ => candidate_P_weight_nonneg c L hq p) (hcount jStar hJstar) rw [candidate_small_P_weight_harmonic_sum, ← candidate_prefix_rest_mass_eq_tuple_sum] at h exact h theorem exists_candidate_localized_window_mass_lower {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) : ∃ eps : ℝ, ∃ J : ℕ, ∃ K : ℝ, 0 < eps ∧ eps ≤ 1/10 ∧ 0 < K ∧ ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → K * (Real.exp L / L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar ≤ candidateLocalizedWindowMass c L eps q r jStar J hr := by obtain ⟨eps, J, heps, heps1, hepsr, hJ⟩ := exists_candidate_localization_parameters hr obtain ⟨rho, hrho, hrest⟩ := exists_candidate_prefix_rest_mass_fraction hc heps heps1 r J hr let D : ℝ := ((2 * Real.log 2 - 1) / 16) / ((6/5 : ℝ) * c) have hD : 0 < D := div_pos wide_prime_window_lower_constant_pos (by positivity) refine ⟨eps, J, D * rho / 2, heps, heps1, by positivity, ?_⟩ filter_upwards [eventually_candidate_localized_mass_harmonic_lower hc hr heps.le heps1 hq0 hcenter hepsr hJ, hrest, eventually_candidate_small_P_half_mass hc hq0 hq1 (by positivity : 0 < c / 100), eventually_gt_atTop (0 : ℝ)] with L hmass hrmass hsmall hL intro jStar hJstar have hQ0 : 0 ≤ candidateQHarmonicMass c L r jStar := by apply tsum_nonneg intro n exact div_nonneg (candidate_Q_weight_nonneg c L r jStar n) (Nat.cast_nonneg n) have hparts : (candidateOneMarkedHarmonicMass c L q / 2) * (rho * candidateQHarmonicMass c L r jStar) ≤ candidateSmallPHarmonicMass c L q (Real.exp ((c / 100) * L)) * candidatePrefixRestHarmonicMass c L eps r jStar J hr := mul_le_mul hsmall (hrmass jStar hJstar) (mul_nonneg hrho.le hQ0) (candidate_small_P_harmonic_nonneg c L q _ hq0) calc _ = (Real.exp L * (D / L)) * ((candidateOneMarkedHarmonicMass c L q / 2) * (rho * candidateQHarmonicMass c L r jStar)) := by ring _ ≤ (Real.exp L * (D / L)) * (candidateSmallPHarmonicMass c L q (Real.exp ((c / 100) * L)) * candidatePrefixRestHarmonicMass c L eps r jStar J hr) := mul_le_mul_of_nonneg_left hparts (by positivity) _ = Real.exp L * (D / L) * candidateSmallPHarmonicMass c L q (Real.exp ((c / 100) * L)) * candidatePrefixRestHarmonicMass c L eps r jStar J hr := by ring _ ≤ _ := hmass jStar hJstar end section open Finset open scoped Classical end section open Finset Filter open scoped Topology noncomputable def candidateRestrictedOrdinaryMass (c L eps q : ℝ) (r jStar J : ℕ) : ℝ := ∑ p ∈ candidateSmallPSet c L (Real.exp ((c / 100) * L)), candidatePWeight c L q p * ∑ n ∈ arithmeticProductWindow p (Real.exp L), orderedSlotWeight (candidatePrefixChoices c L eps r jStar J) ((r.factorial : ℝ)^(candidateQIndices c L).card) n noncomputable def candidateOrdinaryWindowMass (c L q : ℝ) (r jStar : ℕ) : ℝ := ∑ p ∈ candidateSmallPSet c L (Real.exp ((c / 100) * L)), candidatePWeight c L q p * ∑ n ∈ arithmeticProductWindow p (Real.exp L), candidateQWeight c L r jStar n theorem candidate_restricted_ordinary_eq_localized (c L eps q : ℝ) (r jStar J : ℕ) (hr : 0 < r) (hJ : J < jStar) : candidateRestrictedOrdinaryMass c L eps q r jStar J = candidateLocalizedWindowMass c L eps q r jStar J hr := by classical unfold candidateRestrictedOrdinaryMass candidateLocalizedWindowMass apply sum_congr rfl intro p hp rw [ordered_slot_arithmetic_window_split _ (candidateFreeSlot c L r hr) _ (candidate_small_P_set_nonzero hp), candidate_prefix_free_choice c L eps r jStar J hr hJ, mul_sum] apply sum_congr rfl intro y _ change candidatePWeight c L q p * (((primeProductWindow (candidateQBand (c * L) 0) ((p * orderedSlotProduct (candidatePrefixRestChoices c L eps r jStar J hr) y : ℕ) : ℝ) (Real.exp L)).card : ℝ) / ((r.factorial : ℝ)^(candidateQIndices c L).card)) = _ ring end section open Finset Filter open scoped Topology theorem candidate_restricted_ordinary_mass_le {c L eps q : ℝ} {r jStar J : ℕ} (hcL : 0 ≤ c * L) (heps : eps ≤ 1/10) (hq : 0 ≤ q) (hJ : J < jStar) : candidateRestrictedOrdinaryMass c L eps q r jStar J ≤ candidateOrdinaryWindowMass c L q r jStar := by apply sum_le_sum intro p _ apply mul_le_mul_of_nonneg_left _ (candidate_P_weight_nonneg c L hq p) apply sum_le_sum intro n _ exact ordered_slot_weight_mono _ _ (candidatePrefixChoices_subset hcL heps hJ) (by positivity) n theorem candidate_localized_mass_le_ordinary {c L eps q : ℝ} {r jStar J : ℕ} (hr : 0 < r) (hcL : 0 ≤ c * L) (heps : eps ≤ 1/10) (hq : 0 ≤ q) (hJ : J < jStar) : candidateLocalizedWindowMass c L eps q r jStar J hr ≤ candidateOrdinaryWindowMass c L q r jStar := by rw [← candidate_restricted_ordinary_eq_localized c L eps q r jStar J hr hJ] exact candidate_restricted_ordinary_mass_le hcL heps hq hJ /- The small P-part and full Q candidate supply positive ordinary mass in the exact wider interval (exp L, 16 exp L]. Constants and thresholds are uniform in every later rough-slot index jStar > J. -/ theorem exists_candidate_ordinary_window_mass_lower {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) : ∃ K : ℝ, 0 < K ∧ ∃ J : ℕ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → K * (Real.exp L / L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar ≤ candidateOrdinaryWindowMass c L q r jStar := by obtain ⟨eps, J, K, _, heps1, hK, hmass⟩ := exists_candidate_localized_window_mass_lower hc hr hq0 hq1 hcenter refine ⟨K, hK, J, ?_⟩ filter_upwards [hmass, eventually_ge_atTop (0 : ℝ)] with L hL hL0 intro jStar hJ exact (hL jStar hJ).trans (candidate_localized_mass_le_ordinary hr (mul_nonneg hc.le hL0) heps1 hq0 hJ) end section open Finset /- A coordinate has left the unborn state. -/ def ghostPhaseBorn {R : Type*} (z : GhostPhaseState R) : Prop := z ≠ some none /- All coordinates with active, pending, or completed phase tags. -/ noncomputable def ghostPhaseBornSupport {P : Type*} [Fintype P] {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) : Finset P := by classical exact univ.filter (fun p => ghostPhaseBorn (z p)) theorem ghost_phase_mem_born_support {P : Type*} [Fintype P] {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) (p : P) : p ∈ ghostPhaseBornSupport z ↔ z p ≠ some none := by classical unfold ghostPhaseBornSupport exact mem_filter.trans (and_iff_right (mem_univ p)) /- Every pending particle has already left the unborn state. -/ theorem ghost_phase_pending_subset_born {P : Type*} [Fintype P] {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) : ghostPhasePendingSupport z ⊆ ghostPhaseBornSupport z := by classical intro p hp obtain ⟨r, hr⟩ : ∃ r, z p = some (some (some r)) := by simpa only [ghostPhasePendingSupport, mem_filter, mem_univ, true_and] using hp rw [ghost_phase_mem_born_support, hr] simp end section open Finset open scoped Classical end section /- Pull a terminal test at cut `n` backwards through rows `n-1,...,0`. The resulting function is on the initial state space. -/ def finiteRowComposition {S : Nat → Type*} {V : Type*} (row : (i : Nat) → (S (i + 1) → V) → S i → V) : (n : Nat) → (S n → V) → S 0 → V | 0, F => F | n + 1, F => finiteRowComposition row n (row n F) section variable {S : Nat → Type*} {V : Type*} (row : (i : Nat) → (S (i + 1) → V) → S i → V) include S V row theorem finite_row_composition_zero (F : S 0 → V) : finiteRowComposition row 0 F = F := rfl theorem finite_row_composition_succ (n : Nat) (F : S (n + 1) → V) : finiteRowComposition row (n + 1) F = finiteRowComposition row n (row n F) := rfl end /- If each actual row pulls readout tests back to the corresponding target row, the complete finite chronological compositions satisfy the same exact readout identity. The maps and both state spaces may vary at every cut. -/ theorem finite_row_composition_intertwines {S T : Nat → Type*} {V : Type*} (rowS : (i : Nat) → (S (i + 1) → V) → S i → V) (rowT : (i : Nat) → (T (i + 1) → V) → T i → V) (readout : (i : Nat) → S i → T i) (hrow : ∀ i (F : T (i + 1) → V), rowS i (F ∘ readout (i + 1)) = (rowT i F) ∘ readout i) (n : Nat) (F : T n → V) : finiteRowComposition rowS n (F ∘ readout n) = (finiteRowComposition rowT n F) ∘ readout 0 := by induction n with | zero => rfl | succ n ih => rw [finite_row_composition_succ, hrow n F, finite_row_composition_succ] exact ih (rowT n F) end section open Finset /- Active labels read directly from the phase snapshot. -/ noncomputable def ghostPhaseStateActiveSupport {P : Type*} [Fintype P] {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) : Finset P := by classical exact univ.filter (fun p => z p = none) theorem ghost_phase_mem_state_active_support {P : Type*} [Fintype P] {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) (p : P) : p ∈ ghostPhaseStateActiveSupport z ↔ z p = none := by classical unfold ghostPhaseStateActiveSupport exact mem_filter.trans (and_iff_right (mem_univ p)) theorem ghost_phase_state_active_subset_born {P : Type*} [Fintype P] {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) : ghostPhaseStateActiveSupport z ⊆ ghostPhaseBornSupport z := by intro p hp rw [ghost_phase_mem_state_active_support] at hp rw [ghost_phase_mem_born_support, hp] simp /- The state-level active support agrees with the physical activity mask. -/ theorem ghost_phase_state_active_support_of_mask {P : Type*} [Fintype P] {R : P → Type*} (a : P → Bool) (z : (p : P) → GhostPhaseState (R p)) (hz : ghostPhaseMask a z) : ghostPhaseStateActiveSupport z = ghostPhaseActivitySupport a := by classical ext p rw [ghost_phase_mem_state_active_support] simp only [ghostPhaseActivitySupport, mem_filter, mem_univ, true_and] have hp := hz p cases ha : a p <;> cases he : z p <;> simp_all /- Active labels are active; other previously born labels are completed; all remaining labels are unborn. Pending particles are supplied separately. -/ noncomputable def globalBirthMemoryBase {P : Type*} {R : P → Type*} (active born : Finset P) : (p : P) → GhostPhaseState (R p) := by classical exact fun p => if p ∈ active then none else if p ∈ born then some (some none) else some none /- A uniform snapshot readout. Compatible pending particles override the base only at inactive born labels. On an incompatible arbitrary tuple, the pending preference may override active or unborn metadata; exact reconstruction below supplies compatibility through support and particle agreement. -/ noncomputable def globalBirthMemoryReadout {P : Type*} {R : P → Type*} (active born : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) : (p : P) → GhostPhaseState (R p) := ghostPhaseMemoryReadout (globalBirthMemoryBase active born) q /- Off the pending support, the cumulative-born base already reconstructs the complete phase tag. -/ theorem global_birth_memory_base_eq_outside_pending {P : Type*} [Fintype P] {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) (p : P) (hp : p ∉ ghostPhasePendingSupport z) : globalBirthMemoryBase (ghostPhaseStateActiveSupport z) (ghostPhaseBornSupport z) p = z p := by classical have hn : ¬ ∃ r, z p = some (some (some r)) := by simpa only [ghostPhasePendingSupport, mem_filter, mem_univ, true_and] using hp cases he : z p with | none => simp [globalBirthMemoryBase, ghost_phase_mem_state_active_support, he] | some c => cases c with | none => simp [globalBirthMemoryBase, ghost_phase_mem_state_active_support, ghost_phase_mem_born_support, he] | some c => cases c with | none => simp [globalBirthMemoryBase, ghost_phase_mem_state_active_support, ghost_phase_mem_born_support, he] | some r => exact (hn ⟨r, he⟩).elim /- Exact snapshot reconstruction. Particle consistency and complete support suffice; distinctness is only needed for the ordered-memory sector and norm. -/ theorem global_birth_memory_readout_eq {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) (q : FiniteOrderedTuple (Σ p, R p)) (hsupport : univ.image (fun j => (q.2 j).1) = ghostPhasePendingSupport z) (hparticle : ∀ j, z (q.2 j).1 = some (some (some (q.2 j).2))) : globalBirthMemoryReadout (ghostPhaseStateActiveSupport z) (ghostPhaseBornSupport z) q = z := by exact ghost_phase_memory_readout_eq _ z q hsupport hparticle (global_birth_memory_base_eq_outside_pending z) /- The same reconstruction with a supplied physical activity mask. -/ theorem global_birth_memory_readout_eq_of_mask {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (a : P → Bool) (z : (p : P) → GhostPhaseState (R p)) (hz : ghostPhaseMask a z) (q : FiniteOrderedTuple (Σ p, R p)) (hsupport : univ.image (fun j => (q.2 j).1) = ghostPhasePendingSupport z) (hparticle : ∀ j, z (q.2 j).1 = some (some (some (q.2 j).2))) : globalBirthMemoryReadout (ghostPhaseActivitySupport a) (ghostPhaseBornSupport z) q = z := by rw [← ghost_phase_state_active_support_of_mask a z hz] exact global_birth_memory_readout_eq z q hsupport hparticle end section open Finset open scoped Classical /- Full finite tensor trace coefficient, including initial and terminal tests. -/ noncomputable def ghostPhaseFiniteTensorTraceWeight {P : Type*} [Fintype P] {R : P → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (isVisit : ℕ → Bool) (atgt asrc : ℕ → P → Bool) (htgt hsrc : ℕ → (p : P) → R p) (η β : ℕ → P → ℝ) (a0 : P → Bool) (β0 : P → ℝ) (an : P → Bool) {n : ℕ} (x : Fin (n + 1) → (p : P) → GhostPhaseState (R p)) : ℝ := ∏ p, ghostPhaseFiniteTraceWeight isVisit (fun j => atgt j p) (fun j => asrc j p) (fun j => htgt j p) (fun j => hsrc j p) (fun j => η j p) (fun j => β j p) (a0 p) (β0 p) (an p) (fun j => x j p) section TensorTrace variable {P : Type*} [Fintype P] {R : P → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (isVisit : ℕ → Bool) (atgt asrc : ℕ → P → Bool) (htgt hsrc : ℕ → (p : P) → R p) (η β : ℕ → P → ℝ) (a0 : P → Bool) (β0 : P → ℝ) (an : P → Bool) {n : ℕ} (x : Fin (n + 1) → (p : P) → GhostPhaseState (R p)) (hx : ghostPhaseFiniteTensorTraceWeight isVisit atgt asrc htgt hsrc η β a0 β0 an x ≠ 0) include hx end TensorTrace end section open Finset end section open Finset open scoped Classical /- The actual target reconstruction and the global all-previous-births ban. H is cumulative, rather than just the labels currently held in memory. -/ def GlobalBirthEdgeEventValid {S J P : Type*} [DecidableEq S] [DecidableEq P] (H : Finset P) (f : J ↪ P) (target : S ↪ P) {eligible : Finset J} (event : FixedTargetEdgeEvent S J P eligible) : Prop := unrestrictedTargetLabels event.1 (fun s => f (event.2.1 s).val) event.2.2 = target ∧ ∀ s, event.2.2 s ∉ H theorem global_birth_event_implies_fixed_target {S J P : Type*} [Fintype J] [DecidableEq S] [DecidableEq P] (H : Finset P) (f : J ↪ P) (target : S ↪ P) (hH : univ.image f ⊆ H) {eligible : Finset J} (event : FixedTargetEdgeEvent S J P eligible) (h : GlobalBirthEdgeEventValid H f target event) : FixedTargetEdgeEventValid f target event := ⟨h.1, fun s hs => h.2 s (hH hs)⟩ /- Every fresh value of a compatible fixed-target event is genuinely unborn, including labels whose previous lifespans have already completed. -/ theorem fixed_target_fresh_outside_born {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {N t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (target : Fin t ↪ P) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (hc : ∀ p, ghostPhaseMovingEdgeCompatible (atgt p) (asrc p) (delta p) (w p) = true) {eligible : Finset (Fin N)} (event : FixedTargetEdgeEvent (Fin t) (Fin N) P eligible) (h : FixedTargetEdgeEventValid f.val target event) : ∀ s, event.2.2 s ∉ ghostPhaseBornSupport w := by intro s have hp : event.2.2 s ∈ ghostPhaseFreshSet atgt asrc w := by rw [← ghost_phase_new_run_without_pending atgt asrc delta w hw hc, ← htarget, ← distinct_ordered_support_image f] refine mem_sdiff.mpr ⟨?_, h.2 s⟩ refine mem_image.mpr ⟨s.val, mem_univ _, ?_⟩ exact (congrFun (fixed_target_edge_event_fresh f.val target event h) s).symm have hu : w (event.2.2 s) = some none := by simp only [ghostPhaseFreshSet, mem_filter, mem_univ, true_and, ghostPhaseEdgeFresh, Bool.and_eq_true, decide_eq_true_eq] at hp exact hp.2 rw [ghost_phase_mem_born_support, hu] exact not_not_intro rfl /- The global birth ban may replace the local fresh-avoidance filter on every compatible phase snapshot. The equality concerns all actual events. -/ theorem global_birth_event_valid_iff_fixed_target {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {N t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (target : Fin t ↪ P) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (hc : ∀ p, ghostPhaseMovingEdgeCompatible (atgt p) (asrc p) (delta p) (w p) = true) {eligible : Finset (Fin N)} (event : FixedTargetEdgeEvent (Fin t) (Fin N) P eligible) : GlobalBirthEdgeEventValid (ghostPhaseBornSupport w) f.val target event ↔ FixedTargetEdgeEventValid f.val target event := by constructor · apply global_birth_event_implies_fixed_target rw [distinct_ordered_support_image f] exact ghost_phase_pending_subset_born w · intro h exact ⟨h.1, fixed_target_fresh_outside_born atgt asrc delta w hw f target htarget hc event h⟩ end section open Finset section variable {R : Type*} [sharedInstance1 : AddGroup R] (atgt asrc store : Bool) (delta : R) (w : GhostPhaseState R) (hw : w.isSome = !asrc) (hs : store = true → atgt = false ∧ asrc = true) include R sharedInstance1 atgt asrc store delta w hw hs /- An allowed selected local outcome has the target activity tag, independent of hit compatibility or its numerical coefficient. -/ theorem ghost_phase_selected_moving_isSome : (ghostPhaseMovingChoiceTarget atgt asrc delta store w).isSome = !atgt := by cases atgt <;> cases asrc <;> cases store <;> rcases w with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseMovingChoiceTarget, ghostPhaseEdgeBaseTarget, ghostPhaseEdgeStoreTarget, ghostPhaseShift_unborn, ghostPhaseShift_completed, ghostPhaseShift_pending] /- Selecting an allowed edge output preserves previous birth and adds target activity, even if the selected coefficient is zero. -/ theorem ghost_phase_selected_moving_born_iff : ghostPhaseBorn (ghostPhaseMovingChoiceTarget atgt asrc delta store w) ↔ ghostPhaseBorn w ∨ atgt = true := by cases atgt <;> cases asrc <;> cases store <;> rcases w with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseBorn, ghostPhaseMovingChoiceTarget, ghostPhaseEdgeBaseTarget, ghostPhaseEdgeStoreTarget, ghostPhaseShift_unborn, ghostPhaseShift_completed, ghostPhaseShift_pending] end theorem ghost_phase_selected_moving_mask {P : Type*} {R : P → Type*} [∀ p, AddGroup (R p)] (atgt asrc store : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hs : ∀ p, store p = true → atgt p = false ∧ asrc p = true) : ghostPhaseMask atgt (fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (store p) (w p)) := fun p => ghost_phase_selected_moving_isSome (atgt p) (asrc p) (store p) (delta p) (w p) (hw p) (hs p) theorem ghost_phase_selected_moving_active_support {P : Type*} [Fintype P] {R : P → Type*} [∀ p, AddGroup (R p)] (atgt asrc store : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hs : ∀ p, store p = true → atgt p = false ∧ asrc p = true) : ghostPhaseStateActiveSupport (fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (store p) (w p)) = ghostPhaseActivitySupport atgt := ghost_phase_state_active_support_of_mask atgt _ (ghost_phase_selected_moving_mask atgt asrc store delta w hw hs) theorem ghost_phase_selected_moving_born_support {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] (atgt asrc store : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hs : ∀ p, store p = true → atgt p = false ∧ asrc p = true) : ghostPhaseBornSupport (fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (store p) (w p)) = ghostPhaseBornSupport w ∪ ghostPhaseActivitySupport atgt := by classical ext p rw [mem_union, ghost_phase_mem_born_support, ghost_phase_mem_born_support] change ghostPhaseBorn _ ↔ ghostPhaseBorn (w p) ∨ _ simpa only [ghostPhaseActivitySupport, mem_filter, mem_univ, true_and] using ghost_phase_selected_moving_born_iff (atgt p) (asrc p) (store p) (delta p) (w p) (hw p) (hs p) section ActualOutput variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] {t N : ℕ} (source : Fin t ↪ P) (stores promotions : Finset (Fin t)) (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hsource : ∀ j, asrc (source j) = true) (hstores : ∀ j ∈ stores, atgt (source j) = false) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (he : ∀ j, j ∈ promotionSelectedIndices e ↔ atgt (f.val j) = true) include hw hsource hstores he /- The literal retained-and-stored output reconstructs the selected phase using only target activity and the updated cumulative born-label set. -/ theorem global_birth_selected_edge_readout (hold : ∀ j, w (f.val j) = some (some (some (old j)))) : globalBirthMemoryReadout (ghostPhaseActivitySupport atgt) (ghostPhaseBornSupport w ∪ ghostPhaseActivitySupport atgt) (unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores promotions e) = fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (distinctUnrestrictedStorageChoice source stores p) (w p) := by have hs := distinct_unrestricted_storage_allowed source stores atgt asrc hsource hstores rw [← ghost_phase_selected_moving_born_support atgt asrc (distinctUnrestrictedStorageChoice source stores) delta w hw hs] apply global_birth_memory_readout_eq_of_mask · exact ghost_phase_selected_moving_mask atgt asrc (distinctUnrestrictedStorageChoice source stores) delta w hw hs · exact distinct_unrestricted_output_support source stores promotions atgt asrc delta w hw hsource hstores f old e he · exact distinct_unrestricted_output_particle source stores promotions atgt asrc delta w hw hsource hstores f old e he hold /- An arbitrary coupled complex phase continuation is read exactly on the literal distinct output. No nonzero-weight or hit-compatibility assumption is needed for this deterministic output correspondence. -/ theorem global_birth_selected_edge_symmetric_readout (hold : ∀ j, w (f.val j) = some (some (some (old j)))) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : symmetricPhaseReadout (globalBirthMemoryBase (ghostPhaseActivitySupport atgt) (ghostPhaseBornSupport w ∪ ghostPhaseActivitySupport atgt)) F (unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores promotions e) = F (fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (distinctUnrestrictedStorageChoice source stores p) (w p)) := by apply symmetric_phase_readout_eq_of_reconstruction · exact distinct_unrestricted_output_label_injective source stores promotions atgt asrc delta w hw hsource hstores f old e · exact distinct_unrestricted_output_support source stores promotions atgt asrc delta w hw hsource hstores f old e he · exact global_birth_selected_edge_readout source stores promotions atgt asrc delta w hw hsource hstores f old e he hold end ActualOutput end section open Finset /- Compatibility of global birth metadata with a literal pending tuple. -/ structure GlobalBirthMemoryCoherent {P : Type*} [DecidableEq P] {R : P → Type*} (active born : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) : Prop where label_injective : Function.Injective (Sigma.fst ∘ q.2) labels_born : univ.image (fun j => (q.2 j).1) ⊆ born labels_inactive : Disjoint (univ.image (fun j => (q.2 j).1)) active active_born : active ⊆ born /- The pending tuple cannot alter a coordinate outside its label image. -/ theorem global_birth_memory_readout_off_labels {P : Type*} [DecidableEq P] {R : P → Type*} (active born : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (p : P) (hp : p ∉ univ.image (fun j => (q.2 j).1)) : globalBirthMemoryReadout active born q p = globalBirthMemoryBase active born p := by classical have hn : ¬ ∃ j, (q.2 j).1 = p := by simpa only [mem_image, mem_univ, true_and] using hp simp only [globalBirthMemoryReadout, ghostPhaseMemoryReadout, dif_neg hn] section variable {P : Type*} {R : P → Type*} (active born : Finset P) (p : P) include P R active born p /- The activity tag of the global base is exactly its supplied activity set. -/ theorem global_birth_memory_base_active_iff : @globalBirthMemoryBase P R active born p = none ↔ p ∈ active := by classical by_cases ha : p ∈ active <;> by_cases hb : p ∈ born <;> simp [globalBirthMemoryBase, ha, hb] /- The global base contains no pending particles. -/ theorem global_birth_memory_base_not_pending : ¬ ∃ r, @globalBirthMemoryBase P R active born p = some (some (some r)) := by classical by_cases ha : p ∈ active <;> by_cases hb : p ∈ born <;> simp [globalBirthMemoryBase, ha, hb] /- The born tag of the base is the union of its activity and birth metadata. -/ theorem global_birth_memory_base_born_iff : ghostPhaseBorn (@globalBirthMemoryBase P R active born p) ↔ p ∈ active ∨ p ∈ born := by classical by_cases ha : p ∈ active <;> by_cases hb : p ∈ born <;> simp [ghostPhaseBorn, globalBirthMemoryBase, ha, hb] end /- On a coherent state, every listed particle is read at its own label with exactly its own residue. -/ theorem global_birth_coherent_readout_particle {P : Type*} [DecidableEq P] {R : P → Type*} (active born : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent active born q) (j : Fin q.1) : globalBirthMemoryReadout active born q (q.2 j).1 = some (some (some (q.2 j).2)) := ghost_phase_memory_readout_at _ q hq.label_injective j /- Coherent pending memory leaves exactly the specified labels active. -/ theorem global_birth_coherent_readout_active_support {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (active born : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent active born q) : ghostPhaseStateActiveSupport (globalBirthMemoryReadout active born q) = active := by classical ext p rw [ghost_phase_mem_state_active_support] by_cases hp : p ∈ univ.image (fun j => (q.2 j).1) · have hna : p ∉ active := fun ha => Finset.disjoint_left.mp hq.labels_inactive hp ha obtain ⟨j, _, rfl⟩ := mem_image.mp hp rw [global_birth_coherent_readout_particle active born q hq j] simp only [Option.some_ne_none, false_iff] exact hna · rw [global_birth_memory_readout_off_labels active born q p hp] exact global_birth_memory_base_active_iff active born p /- Coherent pending memory neither adds nor erases cumulative born labels. -/ theorem global_birth_coherent_readout_born_support {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (active born : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent active born q) : ghostPhaseBornSupport (globalBirthMemoryReadout active born q) = born := by classical ext p rw [ghost_phase_mem_born_support] by_cases hp : p ∈ univ.image (fun j => (q.2 j).1) · have hb := hq.labels_born hp obtain ⟨j, _, rfl⟩ := mem_image.mp hp rw [global_birth_coherent_readout_particle active born q hq j] simp [hb] · rw [global_birth_memory_readout_off_labels active born q p hp] change ghostPhaseBorn _ ↔ p ∈ born rw [global_birth_memory_base_born_iff] exact or_iff_right_of_imp (fun ha => hq.active_born ha) /- On the coherent state space the pending support is precisely the literal tuple's label image; the base contributes no extra pending coordinates. -/ theorem global_birth_coherent_readout_pending_support {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (active born : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent active born q) : ghostPhasePendingSupport (globalBirthMemoryReadout active born q) = univ.image (fun j => (q.2 j).1) := by classical ext p change (p ∈ univ.filter (fun p => ∃ r, globalBirthMemoryReadout active born q p = some (some (some r)))) ↔ _ simp only [mem_filter, mem_univ, true_and] by_cases hp : p ∈ univ.image (fun j => (q.2 j).1) · have hex : ∃ r, globalBirthMemoryReadout active born q p = some (some (some r)) := by obtain ⟨j, _, rfl⟩ := mem_image.mp hp exact ⟨(q.2 j).2, global_birth_coherent_readout_particle active born q hq j⟩ exact iff_of_true hex hp · rw [global_birth_memory_readout_off_labels active born q p hp] exact iff_of_false (global_birth_memory_base_not_pending active born p) hp /- True snapshot metadata always gives a coherent global memory state when the pending tuple has distinct labels and complete support. No residue agreement is needed merely to establish this metadata compatibility. -/ theorem global_birth_memory_coherent_of_snapshot {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (z : (p : P) → GhostPhaseState (R p)) (q : FiniteOrderedTuple (Σ p, R p)) (hinj : Function.Injective (Sigma.fst ∘ q.2)) (hsupport : univ.image (fun j => (q.2 j).1) = ghostPhasePendingSupport z) : GlobalBirthMemoryCoherent (ghostPhaseStateActiveSupport z) (ghostPhaseBornSupport z) q := by refine ⟨hinj, ?_, ?_, ghost_phase_state_active_subset_born z⟩ · rw [hsupport] exact ghost_phase_pending_subset_born z · rw [hsupport] apply Finset.disjoint_left.mpr intro p hp ha rw [ghost_phase_mem_state_active_support] at ha have hex : ∃ r, z p = some (some (some r)) := by simpa only [ghostPhasePendingSupport, mem_filter, mem_univ, true_and] using hp obtain ⟨r, hr⟩ := hex rw [ha] at hr cases hr section variable {P : Type*} [sharedInstance1 : Fintype P] [sharedInstance2 : DecidableEq P] {R : P → Type*} (active born : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent active born q) include P sharedInstance1 sharedInstance2 R active born q hq /- Every coherent tuple belongs to the support of the symmetric readout. -/ theorem global_birth_coherent_readout_supported : GhostPhaseReadoutSupported (globalBirthMemoryBase active born) q := ⟨hq.label_injective, (global_birth_coherent_readout_pending_support active born q hq).symm⟩ /- The symmetric zero extension reads the global snapshot on every coherent state, with no additional support condition. -/ theorem global_birth_coherent_symmetric_readout (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : symmetricPhaseReadout (globalBirthMemoryBase active born) F q = F (globalBirthMemoryReadout active born q) := by classical rw [symmetricPhaseReadout, if_pos (global_birth_coherent_readout_supported active born q hq)] rfl end end section open Finset open scoped Classical /- Current active and pending labels are already included in a coherent phase snapshot's cumulative born support. -/ theorem ghost_phase_activity_subset_born_of_mask {P : Type*} [Fintype P] {R : P → Type*} (a : P → Bool) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask a w) : ghostPhaseActivitySupport a ⊆ ghostPhaseBornSupport w := by classical intro p hp have ha : a p = true := by simpa [ghostPhaseActivitySupport] using hp rw [ghost_phase_mem_born_support] have hm := hw p cases he : w p <;> simp_all /- For target unshared slots, adjoining their image is the same as adjoining all target-active labels, because shared source activity was already born. -/ theorem global_birth_new_run_update {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (atgt asrc : P → Bool) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) : ghostPhaseBornSupport w ∪ ghostPhaseNewRunSet atgt asrc = ghostPhaseBornSupport w ∪ ghostPhaseActivitySupport atgt := by have ha := ghost_phase_activity_subset_born_of_mask asrc w hw ext p by_cases hs : asrc p = true · have hb : p ∈ ghostPhaseBornSupport w := ha (by simp [ghostPhaseActivitySupport, hs]) simp [hb] · have hs' : asrc p = false := Bool.eq_false_iff.mpr hs simp [ghostPhaseNewRunSet, ghostPhaseActivitySupport, hs'] end section open Finset section variable {P : Type*} [sharedInstance1 : Fintype P] [sharedInstance2 : DecidableEq P] {R : P → Type*} [sharedInstance4 : ∀ p, AddGroup (R p)] [sharedInstance5 : ∀ p, DecidableEq (R p)] {N t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) (hold : ∀ j, w (f.val j) = some (some (some (old j)))) (target : Fin t ↪ P) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (eligible : Finset (Fin N)) (heligible : ∀ j, j ∈ eligible ↔ old j = delta (f.val j)) (hc : ∀ p, ghostPhaseMovingEdgeCompatible (atgt p) (asrc p) (delta p) (w p) = true) include P sharedInstance1 sharedInstance2 R sharedInstance4 sharedInstance5 N t atgt asrc delta w f old hold target htarget eligible heligible hc /- Any old pending label needed at a compatible target is eligible when eligibility is exactly the transported-zero test on old indices. -/ theorem global_birth_required_indices_eligible : univ.filter (fun j => f.val j ∈ univ.image target) ⊆ eligible := by intro j hj rw [mem_filter, and_iff_right (mem_univ j), htarget] at hj have ha : atgt (f.val j) = true ∧ asrc (f.val j) = false := by simpa [ghostPhaseNewRunSet] using hj have h := hc (f.val j) rw [ha.1, ha.2, hold] at h apply (heligible j).mpr simpa only [ghostPhaseMovingEdgeCompatible, decide_eq_true_eq] using h /- Compatible target data construct a matching eligible promotion without assuming its existence as an independent row hypothesis. -/ theorem global_birth_matching_promotion_exists : ∃ e : distinctPromotedTargetSlots f.val target ↪ eligible, ∀ s, f.val (e s).val = target s.val := by have hreq := global_birth_required_indices_eligible atgt asrc delta w f old hold target htarget eligible heligible hc exact ⟨canonicalEligiblePromotion f.val target eligible hreq, canonical_eligible_promotion_matches f.val target eligible hreq⟩ end end section open Finset /- Any nonzero actual damped moving edge satisfies its compatibility bit. -/ theorem ghost_phase_damped_moving_edge_compatible {R : Type*} [AddGroup R] [Fintype R] [DecidableEq R] (atgt asrc : Bool) (delta : R) (β ρtgt ρsrc : ℝ) (z w : GhostPhaseState R) (hw : w.isSome = !asrc) (hn : ghostPhaseDampedMovingEdge atgt asrc delta β ρtgt ρsrc z w ≠ 0) : ghostPhaseMovingEdgeCompatible atgt asrc delta w = true := by cases atgt <;> cases asrc <;> rcases z with _ | (_ | (_ | r)) <;> rcases w with _ | (_ | (_ | s)) <;> simp_all [ghostPhaseDampedMovingEdge, ghostPhaseMovingEdge, ghostPhaseEdge, ghostPhaseGather, ghostPhaseScatter, ghostActiveInput, ghostActiveOutput, ghostPhaseDiagonal, ghostPhaseShift, ghostMemoryShift, ghostPhaseMovingEdgeCompatible, sub_eq_zero] all_goals split_ifs at hn <;> simp_all /- Incompatibility annihilates every output coefficient, irrespective of rho or beta values. This includes the zero-weight boundary parameter cases. -/ theorem ghost_phase_damped_moving_edge_eq_zero_of_incompatible {R : Type*} [AddGroup R] [Fintype R] [DecidableEq R] (atgt asrc : Bool) (delta : R) (β ρtgt ρsrc : ℝ) (z w : GhostPhaseState R) (hw : w.isSome = !asrc) (hc : ghostPhaseMovingEdgeCompatible atgt asrc delta w ≠ true) : ghostPhaseDampedMovingEdge atgt asrc delta β ρtgt ρsrc z w = 0 := by by_contra hn exact hc (ghost_phase_damped_moving_edge_compatible atgt asrc delta β ρtgt ρsrc z w hw hn) /- A globally valid event can only use an unborn coordinate or promote a matching eligible pending particle. Thus, after shared-active physical hits are supplied, every coordinate of the source satisfies edge compatibility. -/ theorem global_birth_event_implies_compatible {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {N t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hshared : ∀ p, atgt p = true ∧ asrc p = true → delta p = 0) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) (hold : ∀ j, w (f.val j) = some (some (some (old j)))) (target : Fin t ↪ P) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (eligible : Finset (Fin N)) (heligible : ∀ j ∈ eligible, old j = delta (f.val j)) (event : FixedTargetEdgeEvent (Fin t) (Fin N) P eligible) (hvalid : GlobalBirthEdgeEventValid (ghostPhaseBornSupport w) f.val target event) : ∀ p, ghostPhaseMovingEdgeCompatible (atgt p) (asrc p) (delta p) (w p) = true := by have hH : univ.image f.val ⊆ ghostPhaseBornSupport w := by rw [distinct_ordered_support_image f] exact ghost_phase_pending_subset_born w have hv := global_birth_event_implies_fixed_target (ghostPhaseBornSupport w) f.val target hH event hvalid intro p rw [ghost_phase_moving_edge_compatible_iff _ _ _ _ (hw p)] refine ⟨hshared p, ?_⟩ intro hp have hpt : p ∈ univ.image target := by rw [htarget] simp [ghostPhaseNewRunSet, hp.1, hp.2] obtain ⟨s, _, hs⟩ := mem_image.mp hpt by_cases hsp : s ∈ event.1 · let j := (event.2.1 ⟨s, hsp⟩).val have hj : f.val j = p := (fixed_target_edge_event_matches f.val target event hv ⟨s, hsp⟩).trans hs have hh : w (f.val j) = some (some (some (delta (f.val j)))) := by rw [hold j, heligible j (event.2.1 ⟨s, hsp⟩).property] cases hj exact Or.inr hh · have hf := fixed_target_edge_event_fresh f.val target event hv have he : event.2.2 ⟨s, hsp⟩ = p := (congrFun hf ⟨s, hsp⟩).trans hs have hn := hvalid.2 ⟨s, hsp⟩ rw [he, ghost_phase_mem_born_support] at hn exact Or.inl (not_not.mp hn) end section open Finset open scoped Classical /- On a valid phase snapshot the unborn pool is exactly the complement of all previously born labels, including completed labels. -/ theorem ghost_visit_births_eq_unborn {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (a : P → Bool) (y : (p : P) → GhostPhaseState (R p)) (hy : ghostPhaseMask a y) : ghostVisitBirths a y = univ \ ghostPhaseBornSupport y := by ext p simp only [ghostVisitBirths, mem_filter, mem_univ, true_and, mem_sdiff, ghost_phase_mem_born_support, not_not] constructor · exact And.right · intro hp refine ⟨?_, hp⟩ have hm := hy p rw [hp] at hm cases ha : a p <;> simp_all /- Retain precisely the old slots whose labels were not terminated. -/ noncomputable def ghostVisitSurvivingIndices {P : Type*} [DecidableEq P] {R : P → Type*} {N : ℕ} (old : Fin N → Σ p, R p) (D : Finset P) : Finset (Fin N) := univ.filter (fun j => (old j).1 ∉ D) /- The literal visit output is a retained old tuple followed by new particles at the current hit, with its actual length stored in the sigma type. -/ noncomputable def globalBirthVisitOutput {P : Type*} [DecidableEq P] {R : P → Type*} {N b : ℕ} (h : (p : P) → R p) (old : Fin N → Σ p, R p) (D : Finset P) (birth : Fin b → P) : FiniteOrderedTuple (Σ p, R p) := retainedBirthTuple old (ghostVisitSurvivingIndices old D) (fun j => ⟨birth j, h (birth j)⟩) /- Labels of the old memory entries at the current hit. -/ noncomputable def globalBirthVisitZeros {P : Type*} [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (old : Fin N → Σ p, R p) : Finset P := (univ.filter (fun j => (old j).2 = h (old j).1)).image (fun j => (old j).1) /- Label image of a literal retained-and-appended tuple. -/ theorem retained_birth_tuple_label_image {P Z : Type*} [DecidableEq P] {N b : ℕ} (label : Z → P) (old : Fin N → Z) (s : Finset (Fin N)) (birth : Fin b → Z) : univ.image (fun j => label ((retainedBirthTuple old s birth).2 j)) = s.image (label ∘ old) ∪ univ.image (label ∘ birth) := by ext p simp only [mem_image, mem_univ, true_and, mem_union, Function.comp_apply] constructor · rintro ⟨j, hj⟩ change Fin (s.card + b) at j rw [retained_birth_tuple_apply_index_equiv old s birth j] at hj cases e : retainedBirthIndexEquiv s b j with | inl k => exact Or.inl ⟨k.val, k.property, by simpa only [e, Sum.elim_inl] using hj⟩ | inr k => exact Or.inr ⟨k, by simpa only [e, Sum.elim_inr] using hj⟩ · rintro (⟨j, hj, hp⟩ | ⟨j, hp⟩) · refine ⟨(retainedBirthIndexEquiv s b).symm (Sum.inl ⟨j, hj⟩), ?_⟩ simpa only [retained_birth_tuple_apply_index_equiv_symm, Sum.elim_inl] using hp · refine ⟨(retainedBirthIndexEquiv s b).symm (Sum.inr j), ?_⟩ simpa only [retained_birth_tuple_apply_index_equiv_symm, Sum.elim_inr] using hp section Batch variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] (a : P → Bool) (h : (p : P) → R p) (y : (p : P) → GhostPhaseState (R p)) (hy : ghostPhaseMask a y) (D B : Finset P) (hD : D ⊆ ghostVisitDeaths a h y) (hB : B ⊆ ghostVisitBirths a y) include hD hB in theorem ghost_visit_batch_pending_support : ghostPhasePendingSupport (ghostVisitBatchOutput h y D B) = (ghostPhasePendingSupport y \ D) ∪ B := by have hdis := disjoint_left.mp (ghost_visit_eligible_disjoint a h y) ext p simp only [ghostPhasePendingSupport, mem_filter, mem_univ, true_and, mem_union, mem_sdiff] by_cases hpD : p ∈ D · have hpB : p ∉ B := fun hp => hdis (hD hpD) (hB hp) simp [ghostVisitBatchOutput, hpD, hpB] · by_cases hpB : p ∈ B · simp [ghostVisitBatchOutput, hpD, hpB] · simp [ghostVisitBatchOutput, hpD, hpB] include hD in theorem ghost_visit_batch_born_support : ghostPhaseBornSupport (ghostVisitBatchOutput h y D B) = ghostPhaseBornSupport y ∪ B := by ext p rw [ghost_phase_mem_born_support, mem_union, ghost_phase_mem_born_support] by_cases hpD : p ∈ D · have hp := hD hpD simp only [ghostVisitDeaths, mem_filter, mem_univ, true_and] at hp simp [ghostVisitBatchOutput, hpD, hp.2] · by_cases hpB : p ∈ B <;> simp [ghostVisitBatchOutput, hpD, hpB] include hy hD hB in theorem ghost_visit_batch_mask : ghostPhaseMask a (ghostVisitBatchOutput h y D B) := by intro p by_cases hpD : p ∈ D · have hp := hD hpD simp only [ghostVisitDeaths, mem_filter, mem_univ, true_and] at hp simp [ghostVisitBatchOutput, hpD, hp.1] · by_cases hpB : p ∈ B · have hp := hB hpB simp only [ghostVisitBirths, mem_filter, mem_univ, true_and] at hp simp [ghostVisitBatchOutput, hpD, hpB, hp.1] · simpa only [ghostVisitBatchOutput, if_neg hpD, if_neg hpB] using hy p variable {N b : ℕ} (old : Fin N → Σ p, R p) (hsupport : univ.image (fun j => (old j).1) = ghostPhasePendingSupport y) (hold : ∀ j, y (old j).1 = some (some (some (old j).2))) (birth : Fin b → P) (hbirth : univ.image birth = B) include hD hB hsupport hbirth in theorem global_birth_visit_output_support : univ.image (fun j => ((globalBirthVisitOutput h old D birth).2 j).1) = ghostPhasePendingSupport (ghostVisitBatchOutput h y D B) := by rw [ghost_visit_batch_pending_support a h y D B hD hB] rw [globalBirthVisitOutput, retained_birth_tuple_label_image] change (ghostVisitSurvivingIndices old D).image (fun j => (old j).1) ∪ univ.image birth = _ rw [hbirth, ← hsupport] congr 1 ext p simp only [ghostVisitSurvivingIndices, mem_image, mem_filter, mem_univ, true_and, mem_sdiff] constructor · rintro ⟨j, hj, rfl⟩ exact ⟨⟨j, rfl⟩, hj⟩ · rintro ⟨⟨j, rfl⟩, hj⟩ exact ⟨j, hj, rfl⟩ include hD hB hold hbirth in theorem global_birth_visit_output_particle (j : Fin (globalBirthVisitOutput h old D birth).1) : let q := (globalBirthVisitOutput h old D birth).2 j ghostVisitBatchOutput h y D B q.1 = some (some (some q.2)) := by dsimp only change Fin ((ghostVisitSurvivingIndices old D).card + b) at j simp only [globalBirthVisitOutput] rw [retained_birth_tuple_apply_index_equiv old (ghostVisitSurvivingIndices old D) (fun k => (⟨birth k, h (birth k)⟩ : Σ p, R p)) j] generalize he : retainedBirthIndexEquiv (ghostVisitSurvivingIndices old D) b j = k cases k with | inl k => have hkD : (old k.val).1 ∉ D := by simpa only [ghostVisitSurvivingIndices, mem_filter, mem_univ, true_and] using k.property have hkB : (old k.val).1 ∉ B := by intro hk have hb := hB hk simp only [ghostVisitBirths, mem_filter, mem_univ, true_and] at hb rw [hold k.val] at hb simp at hb simpa [ghostVisitBatchOutput, hkD, hkB] using hold k.val | inr k => have hkB : birth k ∈ B := hbirth ▸ mem_image.mpr ⟨k, mem_univ _, rfl⟩ have hkD : birth k ∉ D := fun hd => disjoint_left.mp (ghost_visit_eligible_disjoint a h y) (hD hd) (hB hkB) simp [ghostVisitBatchOutput, hkD, hkB] include hy hD hB hsupport hold hbirth in theorem global_birth_visit_output_readout : globalBirthMemoryReadout (ghostPhaseActivitySupport a) (ghostPhaseBornSupport y ∪ B) (globalBirthVisitOutput h old D birth) = ghostVisitBatchOutput h y D B := by rw [← ghost_visit_batch_born_support a h y D B hD] exact global_birth_memory_readout_eq_of_mask a _ (ghost_visit_batch_mask a h y hy D B hD hB) _ (global_birth_visit_output_support a h y D B hD hB old hsupport birth hbirth) (global_birth_visit_output_particle a h y D B hD hB old hold birth hbirth) include hB hold hbirth in omit [∀ p, DecidableEq (R p)] in theorem global_birth_visit_output_injective (hi : Function.Injective (Sigma.fst ∘ old)) (hb : Function.Injective birth) : Function.Injective (Sigma.fst ∘ (globalBirthVisitOutput h old D birth).2) := by apply retained_birth_tuple_label_injective Sigma.fst old (ghostVisitSurvivingIndices old D) (fun j => ⟨birth j, h (birth j)⟩) hi hb intro j _ k heq have hkB : birth k ∈ B := hbirth ▸ mem_image.mpr ⟨k, mem_univ _, rfl⟩ have hjB : (old j).1 ∈ B := heq.symm ▸ hkB have hj := hB hjB simp only [ghostVisitBirths, mem_filter, mem_univ, true_and] at hj simp [hold j] at hj include hD hB hsupport hold hbirth in theorem global_birth_visit_output_length (hi : Function.Injective (Sigma.fst ∘ old)) (hb : Function.Injective birth) : (globalBirthVisitOutput h old D birth).1 = (ghostPhasePendingSupport (ghostVisitBatchOutput h y D B)).card := ghost_phase_memory_length_eq _ _ (global_birth_visit_output_injective a h y D B hB old hold birth hbirth hi hb) (global_birth_visit_output_support a h y D B hD hB old hsupport birth hbirth) include hy hD hB hsupport hold hbirth in theorem global_birth_visit_output_symmetric_readout (hi : Function.Injective (Sigma.fst ∘ old)) (hb : Function.Injective birth) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : symmetricPhaseReadout (globalBirthMemoryBase (ghostPhaseActivitySupport a) (ghostPhaseBornSupport y ∪ B)) F (globalBirthVisitOutput h old D birth) = F (ghostVisitBatchOutput h y D B) := by exact symmetric_phase_readout_eq_of_reconstruction _ _ F _ (global_birth_visit_output_injective a h y D B hB old hold birth hbirth hi hb) (global_birth_visit_output_support a h y D B hD hB old hsupport birth hbirth) (global_birth_visit_output_readout a h y hy D B hD hB old hsupport hold birth hbirth) include hy hsupport hold in theorem global_birth_visit_zeros_eq : globalBirthVisitZeros h old = ghostVisitDeaths a h y := by ext p simp only [globalBirthVisitZeros, mem_image, mem_filter, mem_univ, true_and, ghostVisitDeaths] constructor · rintro ⟨j, hj, rfl⟩ have hp : y (old j).1 = some (some (some (h (old j).1))) := by rw [hold j, hj] refine ⟨?_, hp⟩ have hm := hy (old j).1 rw [hp] at hm cases ha : a (old j).1 <;> simp_all · rintro ⟨_, hp⟩ have hmem : p ∈ ghostPhasePendingSupport y := by simp only [ghostPhasePendingSupport, mem_filter, mem_univ, true_and] exact ⟨h p, hp⟩ rw [← hsupport] at hmem obtain ⟨j, _, rfl⟩ := mem_image.mp hmem refine ⟨j, ?_, rfl⟩ exact Option.some.inj (Option.some.inj (Option.some.inj ((hold j).symm.trans hp))) end Batch end section open Finset open scoped Classical theorem distinct_unrestricted_global_birth_phase_row {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {N t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (source target : Fin t ↪ P) (hsource : univ.image source = ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) (hold : ∀ j, w (f.val j) = some (some (some (old j)))) (eligible : Finset (Fin N)) (e : distinctPromotedTargetSlots f.val target ↪ eligible) (hmatch : ∀ s : distinctPromotedTargetSlots f.val target, f.val (e s).val = target s.val) (hc : ∀ p, ghostPhaseMovingEdgeCompatible (atgt p) (asrc p) (delta p) (w p) = true) (β : P → ℝ) (ρ V : ℝ) (B : ℕ) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : unrestrictedEdgeAction source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) Sigma.fst (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) (fun z => z.2 = 0) (fun p => β p / V) ρ V eligible B (fun _stores promotions g fresh => if GlobalBirthEdgeEventValid (ghostPhaseBornSupport w) f.val target ⟨promotions, g, fresh⟩ then 1 else 0) (fun target q => symmetricPhaseReadout (globalBirthMemoryBase (ghostPhaseActivitySupport atgt) (ghostPhaseBornSupport w ∪ univ.image target)) F q) = ∑ z, ((∏ p, (if atgt p && !(asrc p) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt p) (asrc p) (delta p) (β p) ρ ρ (z p) (w p) : ℝ) : ℂ) * (if (ghostPhasePendingSupport z).card ≤ B then F z else 0) := by simp_rw [global_birth_event_valid_iff_fixed_target atgt asrc delta w hw f target htarget hc] have hsrc : ∀ j, asrc (source j) = true ∧ atgt (source j) = false := by intro j have hj : source j ∈ univ.image source := mem_image.mpr ⟨j, mem_univ _, rfl⟩ rw [hsource] at hj simpa [ghostPhaseActivitySupport] using hj have he := distinct_phase_event_selected atgt asrc w hw f target htarget eligible e hmatch rw [unrestricted_fixed_target_phase_coefficients atgt asrc delta w hw source target (fun j => (hsrc j).1) (fun j => (hsrc j).2) htarget f old hold eligible e hmatch hc β ρ V B (fun _ _ _ _ => 1)] rw [ghost_phase_measured_edge_complex_slots atgt asrc delta β ρ ρ V w hw source hsource] simp only [powerset_univ] apply sum_congr rfl intro stores _ simp only [mul_one] rw [htarget, global_birth_new_run_update atgt asrc w hw] rw [global_birth_selected_edge_symmetric_readout source stores _ atgt asrc delta w hw (fun j => (hsrc j).1) (fun j _ => (hsrc j).2) f old e he hold F, distinct_unrestricted_output_length source stores _ atgt asrc delta w hw (fun j => (hsrc j).1) (fun j _ => (hsrc j).2) f old e he] rw [ghost_phase_run_normalized_edge_fresh_measure atgt asrc (distinctUnrestrictedStorageChoice source stores) delta β ρ ρ V w hw (distinct_unrestricted_storage_allowed source stores atgt asrc (fun j => (hsrc j).1) (fun j _ => (hsrc j).2))] rfl end section open Finset open scoped Classical /- Complex form of the exact measured birth expansion. This is an algebraic identity with arbitrary coupled continuation, not a norm comparison. -/ theorem ghost_phase_transition_measured_births_complex {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : P → Bool) (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (y : (p : P) → GhostPhaseState (R p)) (hy : ghostPhaseMask a y) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : (∑ x, ((∏ p, ghostPhaseDampedVisit (a p) (h p) η (β p) ρ (x p) (y p) : ℝ) : ℂ) * F x) = ∑ D ∈ (ghostVisitDeaths a h y).powerset, ∑ b ∈ range ((ghostVisitBirths a y).card + 1), ∑ f : Fin b ↪ ghostVisitBirths a y, ((((-η / ρ) ^ D.card * ((1 - η) / ρ ^ 2) ^ (ghostVisitDeaths a h y \ D).card) * ((-η * V / ρ) ^ b * (∏ j, β (f j).val / V)) / (b.factorial : ℝ) : ℝ) : ℂ) * F (ghostVisitBatchOutput h y D ((distinctBirthRange f).map (Function.Embedding.subtype (fun p => p ∈ ghostVisitBirths a y)))) := by have hr (G : ((p : P) → GhostPhaseState (R p)) → ℝ) := ghost_phase_transition_measured_births a h β η V ρ hV y hy G apply Complex.ext · simpa only [Complex.re_sum, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, prod_const, sum_div, mul_sum, div_mul_eq_mul_div, mul_div_assoc, mul_assoc] using hr (fun x => (F x).re) · simpa only [Complex.im_sum, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, add_zero, prod_const, sum_div, mul_sum, div_mul_eq_mul_div, mul_div_assoc, mul_assoc] using hr (fun x => (F x).im) /- The support in the original pool of an actual ordered birth tuple. -/ noncomputable def globalVisitBirthRange {P : Type*} (U : Finset P) {b : ℕ} (f : Fin b ↪ U) : Finset P := (distinctBirthRange f).map (Function.Embedding.subtype (fun p => p ∈ U)) theorem global_visit_birth_range_image {P : Type*} [DecidableEq P] (U : Finset P) {b : ℕ} (f : Fin b ↪ U) : univ.image (fun j => (f j).val) = globalVisitBirthRange U f := by ext p simp [globalVisitBirthRange, distinctBirthRange] theorem global_visit_birth_range_subset {P : Type*} (U : Finset P) {b : ℕ} (f : Fin b ↪ U) : globalVisitBirthRange U f ⊆ U := by intro p hp exact property_of_mem_map_subtype (distinctBirthRange f) hp /- Literal chronological ghost row with global birth exclusion. Terminations range over subsets of old hit labels; retained old entries precede new entries. The memory continuation is the symmetric zero extension of the phase test. -/ noncomputable def globalBirthGhostVisitRow {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (active H : Finset P) (old : Fin N → Σ p, R p) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : ℂ := ∑ D ∈ (globalBirthVisitZeros h old).powerset, ∑ b ∈ range ((univ \ H).card + 1), ∑ f : Fin b ↪ ↥((univ : Finset P) \ H), ((((-η / ρ) ^ D.card * ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeros h old \ D).card) * ((-η * V / ρ) ^ b * (∏ j, β (f j).val / V)) / (b.factorial : ℝ) : ℝ) : ℂ) * (if (globalBirthVisitOutput h old D (fun j => (f j).val)).1 ≤ cap then symmetricPhaseReadout (globalBirthMemoryBase active (H ∪ globalVisitBirthRange (univ \ H) f)) F (globalBirthVisitOutput h old D (fun j => (f j).val)) else 0) /- The exact global-birth-filtered ordered row is the full damped phase tensor visit with the same output-memory cutoff. No extra old-memory factorial is inserted, and no completed label may be born again. -/ theorem global_birth_ghost_visit_row_eq {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {N : ℕ} (a : P → Bool) (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) (y : (p : P) → GhostPhaseState (R p)) (hy : ghostPhaseMask a y) (old : Fin N → Σ p, R p) (hi : Function.Injective (Sigma.fst ∘ old)) (hsupport : univ.image (fun j => (old j).1) = ghostPhasePendingSupport y) (hold : ∀ j, y (old j).1 = some (some (some (old j).2))) (H : Finset P) (hH : H = ghostPhaseBornSupport y) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : globalBirthGhostVisitRow h β η V ρ cap (ghostPhaseActivitySupport a) H old F = ∑ x, ((∏ p, ghostPhaseDampedVisit (a p) (h p) η (β p) ρ (x p) (y p) : ℝ) : ℂ) * (if (ghostPhasePendingSupport x).card ≤ cap then F x else 0) := by subst H have hu := ghost_visit_births_eq_unborn a y hy have hz := global_birth_visit_zeros_eq a h y hy old hsupport hold rw [ghost_phase_transition_measured_births_complex a h β η V ρ hV y hy] unfold globalBirthGhostVisitRow rw [hz, ← hu] apply sum_congr rfl intro D hD apply sum_congr rfl intro b _ apply sum_congr rfl intro f _ congr 1 have hf : Function.Injective (fun j => (f j).val) := by intro j k hjk exact f.injective (Subtype.ext hjk) have hB := global_visit_birth_range_subset (ghostVisitBirths a y) f have hbi := global_visit_birth_range_image (ghostVisitBirths a y) f have hl := global_birth_visit_output_length a h y D (globalVisitBirthRange (ghostVisitBirths a y) f) (mem_powerset.mp hD) hB old hsupport hold (fun j => (f j).val) hbi hi hf rw [hl] have hr := global_birth_visit_output_symmetric_readout a h y hy D (globalVisitBirthRange (ghostVisitBirths a y) f) (mem_powerset.mp hD) hB old hsupport hold (fun j => (f j).val) hbi hi hf F convert congrArg (fun v : ℂ => if (ghostPhasePendingSupport (ghostVisitBatchOutput h y D (globalVisitBirthRange (ghostVisitBirths a y) f))).card ≤ cap then v else 0) hr using 1 congr 1 end section open Finset open scoped Classical noncomputable def globalBirthCoherentSupport {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (A H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent A H q) : DistinctOrderedSupport (Fin q.1) (ghostPhasePendingSupport (globalBirthMemoryReadout A H q)) := ⟨⟨fun j => (q.2 j).1, hq.label_injective⟩, by intro p rw [global_birth_coherent_readout_pending_support A H q hq] simp only [mem_image, mem_univ, true_and] rfl⟩ theorem global_birth_coherent_readout_mask {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (a : P → Bool) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H q) : ghostPhaseMask a (globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q) := by have he := global_birth_coherent_readout_active_support (ghostPhaseActivitySupport a) H q hq intro p have hp : globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q p = none ↔ a p = true := by rw [← ghost_phase_mem_state_active_support, he] simp [ghostPhaseActivitySupport] cases ha : a p <;> cases hz : globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q p <;> simp_all end section open Finset open scoped Classical theorem distinct_unrestricted_complete_global_birth_phase_row {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {N t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (hshared : ∀ p, atgt p = true ∧ asrc p = true → delta p = 0) (source target : Fin t ↪ P) (hsource : univ.image source = ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) (hold : ∀ j, w (f.val j) = some (some (some (old j)))) (eligible : Finset (Fin N)) (heligible : ∀ j, j ∈ eligible ↔ old j = delta (f.val j)) (β : P → ℝ) (ρ V : ℝ) (B : ℕ) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : unrestrictedEdgeAction source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) Sigma.fst (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) (fun z => z.2 = 0) (fun p => β p / V) ρ V eligible B (fun _stores promotions g fresh => if GlobalBirthEdgeEventValid (ghostPhaseBornSupport w) f.val target ⟨promotions, g, fresh⟩ then 1 else 0) (fun target q => symmetricPhaseReadout (globalBirthMemoryBase (ghostPhaseActivitySupport atgt) (ghostPhaseBornSupport w ∪ univ.image target)) F q) = ∑ z, ((∏ p, (if atgt p && !(asrc p) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt p) (asrc p) (delta p) (β p) ρ ρ (z p) (w p) : ℝ) : ℂ) * (if (ghostPhasePendingSupport z).card ≤ B then F z else 0) := by by_cases hc : ∀ p, ghostPhaseMovingEdgeCompatible (atgt p) (asrc p) (delta p) (w p) = true · obtain ⟨e, he⟩ := global_birth_matching_promotion_exists atgt asrc delta w f old hold target htarget eligible heligible hc exact distinct_unrestricted_global_birth_phase_row atgt asrc delta w hw source target hsource htarget f old hold eligible e he hc β ρ V B F · have hvalid : ∀ event : FixedTargetEdgeEvent (Fin t) (Fin N) P eligible, ¬GlobalBirthEdgeEventValid (ghostPhaseBornSupport w) f.val target event := by intro event hv apply hc exact global_birth_event_implies_compatible atgt asrc delta w hw hshared f old hold target htarget eligible (fun j hj => (heligible j).mp hj) event hv have hout : ∀ z : (p : P) → GhostPhaseState (R p), (∏ p, (if atgt p && !(asrc p) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt p) (asrc p) (delta p) (β p) ρ ρ (z p) (w p) : ℝ) = 0 := by intro z obtain ⟨p, hp⟩ := not_forall.mp hc apply prod_eq_zero (mem_univ p) rw [ghost_phase_damped_moving_edge_eq_zero_of_incompatible (atgt p) (asrc p) (delta p) (β p) ρ ρ (z p) (w p) (hw p) hp, mul_zero] simp only [unrestrictedEdgeAction, hvalid, if_false, mul_zero, zero_mul, sum_const_zero, hout, Complex.ofReal_zero] end section open Finset open scoped Classical /- Actual old positions eligible to terminate at the current hit. -/ noncomputable def globalBirthVisitZeroIndices {P : Type*} {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (old : Fin N → Σ p, R p) : Finset (Fin N) := univ.filter (fun j => (old j).2 = h (old j).1) theorem global_birth_visit_zero_labels {P : Type*} [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (old : Fin N → Σ p, R p) : globalBirthVisitZeros h old = (globalBirthVisitZeroIndices h old).image (fun j => (old j).1) := rfl theorem global_visit_death_subset_sum {J P M : Type*} [DecidableEq J] [DecidableEq P] [AddCommMonoid M] (Z : Finset J) (label : J → P) (hi : Function.Injective label) (F : Finset P → M) : (∑ T ∈ Z.powerset, F (T.image label)) = ∑ D ∈ (Z.image label).powerset, F D := by rw [powerset_image, sum_image] intro T _ U _ hTU exact (image_injective hi) hTU /- The number of deaths and of retained old hits are unchanged by the label map. -/ theorem global_visit_death_counts {J P : Type*} [DecidableEq J] [DecidableEq P] (Z T : Finset J) (label : J → P) (hi : Function.Injective label) : (T.image label).card = T.card ∧ (Z.image label \ T.image label).card = (Z \ T).card := by constructor · exact card_image_of_injective _ hi · rw [← image_sdiff Z T hi, card_image_of_injective _ hi] /- Deleting labels of the chosen indices removes exactly those indices. -/ theorem global_birth_visit_surviving_indices {P : Type*} [DecidableEq P] {R : P → Type*} {N : ℕ} (old : Fin N → Σ p, R p) (hi : Function.Injective (Sigma.fst ∘ old)) (T : Finset (Fin N)) : ghostVisitSurvivingIndices old (T.image (fun j => (old j).1)) = univ \ T := by ext j have heq : ∀ k, (old k).1 = (old j).1 ↔ k = j := fun k => hi.eq_iff simp [ghostVisitSurvivingIndices, mem_image, heq] /- The output is the same literal retained tuple, not just a permutation. -/ theorem global_birth_visit_index_output {P : Type*} [DecidableEq P] {R : P → Type*} {N b : ℕ} (h : (p : P) → R p) (old : Fin N → Σ p, R p) (hi : Function.Injective (Sigma.fst ∘ old)) (T : Finset (Fin N)) (birth : Fin b → P) : globalBirthVisitOutput h old (T.image (fun j => (old j).1)) birth = retainedBirthTuple old (univ \ T) (fun j => ⟨birth j, h (birth j)⟩) := by rw [globalBirthVisitOutput, global_birth_visit_surviving_indices old hi T] /- The actual-index global ghost row: select old hit indices to terminate, retain all other old entries, and append the globally new ordered birth batch. -/ noncomputable def globalBirthGhostVisitIndexRow {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (active H : Finset P) (old : Fin N → Σ p, R p) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : ℂ := ∑ T ∈ (globalBirthVisitZeroIndices h old).powerset, ∑ b ∈ range ((univ \ H).card + 1), ∑ f : Fin b ↪ ↥((univ : Finset P) \ H), ((((-η / ρ) ^ T.card * ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeroIndices h old \ T).card) * ((-η * V / ρ) ^ b * (∏ j, β (f j).val / V)) / (b.factorial : ℝ) : ℝ) : ℂ) * (if (retainedBirthTuple old (univ \ T) (fun j => ⟨(f j).val, h (f j).val⟩)).1 ≤ cap then symmetricPhaseReadout (globalBirthMemoryBase active (H ∪ globalVisitBirthRange (univ \ H) f)) F (retainedBirthTuple old (univ \ T) (fun j => ⟨(f j).val, h (f j).val⟩)) else 0) /- Exact index-to-label reindexing of the full complex visit row. -/ theorem global_birth_ghost_visit_index_row_eq_label {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (active H : Finset P) (old : Fin N → Σ p, R p) (hi : Function.Injective (Sigma.fst ∘ old)) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : globalBirthGhostVisitIndexRow h β η V ρ cap active H old F = globalBirthGhostVisitRow h β η V ρ cap active H old F := by unfold globalBirthGhostVisitRow globalBirthGhostVisitIndexRow rw [global_birth_visit_zero_labels, ← global_visit_death_subset_sum (globalBirthVisitZeroIndices h old) (fun j => (old j).1) hi] apply sum_congr rfl intro T _ have hc := global_visit_death_counts (globalBirthVisitZeroIndices h old) T (fun j => (old j).1) hi simp only [hc.1, hc.2, global_birth_visit_index_output h old hi T] /- The globally filtered actual-index row equals the damped phase tensor row. -/ theorem global_birth_ghost_visit_index_row_eq {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {N : ℕ} (a : P → Bool) (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) (y : (p : P) → GhostPhaseState (R p)) (hy : ghostPhaseMask a y) (old : Fin N → Σ p, R p) (hi : Function.Injective (Sigma.fst ∘ old)) (hsupport : univ.image (fun j => (old j).1) = ghostPhasePendingSupport y) (hold : ∀ j, y (old j).1 = some (some (some (old j).2))) (H : Finset P) (hH : H = ghostPhaseBornSupport y) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : globalBirthGhostVisitIndexRow h β η V ρ cap (ghostPhaseActivitySupport a) H old F = ∑ x, ((∏ p, ghostPhaseDampedVisit (a p) (h p) η (β p) ρ (x p) (y p) : ℝ) : ℂ) * (if (ghostPhasePendingSupport x).card ≤ cap then F x else 0) := by rw [global_birth_ghost_visit_index_row_eq_label h β η V ρ cap _ H old hi F] exact global_birth_ghost_visit_row_eq a h β η V ρ hV cap y hy old hi hsupport hold H hH F end section open Finset open scoped Classical theorem coherent_complete_global_birth_edge_row {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (hshared : ∀ p, atgt p = true ∧ asrc p = true → delta p = 0) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport asrc) H q) (source target : Fin t ↪ P) (hsource : univ.image source = ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (eligible : Finset (Fin q.1)) (heligible : ∀ j, j ∈ eligible ↔ (q.2 j).2 = delta (q.2 j).1) (β : P → ℝ) (ρ V : ℝ) (B : ℕ) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : unrestrictedEdgeAction source q.2 Sigma.fst (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) (fun z => z.2 = 0) (fun p => β p / V) ρ V eligible B (fun _stores promotions g fresh => if GlobalBirthEdgeEventValid H (globalBirthCoherentSupport (ghostPhaseActivitySupport asrc) H q hq).val target ⟨promotions, g, fresh⟩ then 1 else 0) (fun target q' => symmetricPhaseReadout (globalBirthMemoryBase (ghostPhaseActivitySupport atgt) (H ∪ univ.image target)) F q') = ∑ z, ((∏ p, (if atgt p && !(asrc p) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt p) (asrc p) (delta p) (β p) ρ ρ (z p) (globalBirthMemoryReadout (ghostPhaseActivitySupport asrc) H q p) : ℝ) : ℂ) * (if (ghostPhasePendingSupport z).card ≤ B then F z else 0) := by let w := globalBirthMemoryReadout (ghostPhaseActivitySupport asrc) H q let f := globalBirthCoherentSupport (ghostPhaseActivitySupport asrc) H q hq have hw : ghostPhaseMask asrc w := global_birth_coherent_readout_mask asrc H q hq have hold : ∀ j, w (f.val j) = some (some (some (q.2 j).2)) := global_birth_coherent_readout_particle (ghostPhaseActivitySupport asrc) H q hq have hborn : ghostPhaseBornSupport w = H := global_birth_coherent_readout_born_support (ghostPhaseActivitySupport asrc) H q hq have heq : (fun j => (⟨f.val j, (q.2 j).2⟩ : Σ p, R p)) = q.2 := by funext j rfl have h := distinct_unrestricted_complete_global_birth_phase_row atgt asrc delta w hw hshared source target hsource htarget f (fun j => (q.2 j).2) hold eligible heligible β ρ V B F simpa only [heq, hborn] using h end section open Finset open scoped Classical /- The actual-index ghost visit of a coherent snapshot equals the full damped phase tensor visit with precisely the same output-memory cutoff. -/ theorem coherent_global_birth_visit_row {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : P → Bool) (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H q) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : globalBirthGhostVisitIndexRow h β η V ρ cap (ghostPhaseActivitySupport a) H q.2 F = ∑ z, ((∏ p, ghostPhaseDampedVisit (a p) (h p) η (β p) ρ (z p) (globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q p) : ℝ) : ℂ) * (if (ghostPhasePendingSupport z).card ≤ cap then F z else 0) := by apply global_birth_ghost_visit_index_row_eq a h β η V ρ hV cap (globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q) (global_birth_coherent_readout_mask a H q hq) q.2 hq.label_injective · exact (global_birth_coherent_readout_pending_support _ H q hq).symm · exact global_birth_coherent_readout_particle _ H q hq · exact (global_birth_coherent_readout_born_support _ H q hq).symm /- Each admissible literal visit event remains a coherent global snapshot, including zero-weight events. Deaths retain their labels in the born set. -/ theorem coherent_global_birth_visit_output {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] (a : P → Bool) (h : (p : P) → R p) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H q) (D B : Finset P) (hD : D ⊆ globalBirthVisitZeros h q.2) (hB : B ⊆ univ \ H) {b : ℕ} (birth : Fin b → P) (hb : Function.Injective birth) (hrange : univ.image birth = B) : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) (H ∪ B) (globalBirthVisitOutput h q.2 D birth) := by let y := globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q have hy : ghostPhaseMask a y := global_birth_coherent_readout_mask a H q hq have hs : univ.image (fun j => (q.2 j).1) = ghostPhasePendingSupport y := (global_birth_coherent_readout_pending_support _ H q hq).symm have hp : ∀ j, y (q.2 j).1 = some (some (some (q.2 j).2)) := global_birth_coherent_readout_particle _ H q hq have hborn : ghostPhaseBornSupport y = H := global_birth_coherent_readout_born_support _ H q hq have hd : D ⊆ ghostVisitDeaths a h y := by rw [← global_birth_visit_zeros_eq a h y hy q.2 hs hp] exact hD have hnew : B ⊆ ghostVisitBirths a y := by rw [ghost_visit_births_eq_unborn a y hy, hborn] exact hB have hcoh := global_birth_memory_coherent_of_snapshot (ghostVisitBatchOutput h y D B) (globalBirthVisitOutput h q.2 D birth) (global_birth_visit_output_injective a h y D B hnew q.2 hp birth hrange hq.label_injective hb) (global_birth_visit_output_support a h y D B hd hnew q.2 hs birth hrange) rw [ghost_phase_state_active_support_of_mask a _ (ghost_visit_batch_mask a h y hy D B hd hnew), ghost_visit_batch_born_support a h y D B hd, hborn] at hcoh exact hcoh end section open Finset open scoped Classical theorem global_birth_edge_output_coherent {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] {N t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (w : (p : P) → GhostPhaseState (R p)) (hw : ghostPhaseMask asrc w) (source target : Fin t ↪ P) (hsource : univ.image source = ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (f : DistinctOrderedSupport (Fin N) (ghostPhasePendingSupport w)) (old : (j : Fin N) → R (f.val j)) (eligible : Finset (Fin N)) (stores : Finset (Fin t)) (event : FixedTargetEdgeEvent (Fin t) (Fin N) P eligible) (hv : GlobalBirthEdgeEventValid (ghostPhaseBornSupport w) f.val target event) : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport atgt) (ghostPhaseBornSupport w ∪ univ.image target) (unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores event.1 event.2.1) := by have hH : univ.image f.val ⊆ ghostPhaseBornSupport w := by rw [distinct_ordered_support_image f] exact ghost_phase_pending_subset_born w have hfixed := global_birth_event_implies_fixed_target (ghostPhaseBornSupport w) f.val target hH event hv rcases event with ⟨U, e, fresh⟩ have hU := fixed_target_edge_event_slots f.val target ⟨U, e, fresh⟩ hfixed change U = distinctPromotedTargetSlots f.val target at hU subst U have hm := fixed_target_edge_event_matches f.val target _ hfixed have he := distinct_phase_event_selected atgt asrc w hw f target htarget eligible e hm have hsrc : ∀ j, asrc (source j) = true ∧ atgt (source j) = false := by intro j have hj : source j ∈ univ.image source := mem_image.mpr ⟨j, mem_univ _, rfl⟩ rw [hsource] at hj simpa [ghostPhaseActivitySupport] using hj have hs := distinct_unrestricted_storage_allowed source stores atgt asrc (fun j => (hsrc j).1) (fun j _ => (hsrc j).2) have hz := global_birth_memory_coherent_of_snapshot (fun p => ghostPhaseMovingChoiceTarget (atgt p) (asrc p) (delta p) (distinctUnrestrictedStorageChoice source stores p) (w p)) (unrestrictedEdgeOutput source (fun j => (⟨f.val j, old j⟩ : Σ p, R p)) (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores _ e) (distinct_unrestricted_output_label_injective source stores _ atgt asrc delta w hw (fun j => (hsrc j).1) (fun j _ => (hsrc j).2) f old e) (distinct_unrestricted_output_support source stores _ atgt asrc delta w hw (fun j => (hsrc j).1) (fun j _ => (hsrc j).2) f old e he) rw [ghost_phase_selected_moving_active_support atgt asrc _ delta w hw hs, ghost_phase_selected_moving_born_support atgt asrc _ delta w hw hs] at hz simpa only [htarget, global_birth_new_run_update atgt asrc w hw] using hz end section open Finset open scoped Classical /- Actual old-index ghost visit with an arbitrary raw snapshot continuation. The only denominator is the new-batch factorial; output cutoff is literal length. -/ noncomputable def globalBirthGhostVisitRawRow {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (H : Finset P) (old : Fin N → Σ p, R p) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) : ℂ := ∑ T ∈ (globalBirthVisitZeroIndices h old).powerset, ∑ b ∈ range ((univ \ H).card + 1), ∑ f : Fin b ↪ ↥((univ : Finset P) \ H), ((((-η / ρ) ^ T.card * ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeroIndices h old \ T).card) * ((-η * V / ρ) ^ b * (∏ j, β (f j).val / V)) / (b.factorial : ℝ) : ℝ) : ℂ) * (if (retainedBirthTuple old (univ \ T) (fun j => ⟨(f j).val, h (f j).val⟩)).1 ≤ cap then G (H ∪ globalVisitBirthRange (univ \ H) f) (retainedBirthTuple old (univ \ T) (fun j => ⟨(f j).val, h (f j).val⟩)) else 0) section variable {P : Type*} [sharedInstance1 : Fintype P] [sharedInstance2 : DecidableEq P] {R : P → Type*} include P sharedInstance1 sharedInstance2 R /- The earlier phase-test row is an exact specialization of the raw operator. -/ theorem global_birth_visit_raw_row_specialize [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (active H : Finset P) (old : Fin N → Σ p, R p) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) : globalBirthGhostVisitRawRow h β η V ρ cap H old (fun H' q' => symmetricPhaseReadout (globalBirthMemoryBase active H') F q') = globalBirthGhostVisitIndexRow h β η V ρ cap active H old F := rfl /- Every literal raw event sends a coherent input to coherent output, including events whose signed coefficient happens to vanish. -/ theorem global_birth_visit_raw_output_coherent [∀ p, DecidableEq (R p)] (a : P → Bool) (h : (p : P) → R p) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H q) (T : Finset (Fin q.1)) (hT : T ⊆ globalBirthVisitZeroIndices h q.2) {b : ℕ} (f : Fin b ↪ ↥((univ : Finset P) \ H)) : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) (H ∪ globalVisitBirthRange (univ \ H) f) (retainedBirthTuple q.2 (univ \ T) (fun j => ⟨(f j).val, h (f j).val⟩)) := by have hd : T.image (fun j => (q.2 j).1) ⊆ globalBirthVisitZeros h q.2 := by rw [global_birth_visit_zero_labels] exact image_subset_image hT have hf : Function.Injective (fun j => (f j).val) := by intro j k hjk exact f.injective (Subtype.ext hjk) have hc := coherent_global_birth_visit_output a h H q hq (T.image (fun j => (q.2 j).1)) (globalVisitBirthRange (univ \ H) f) hd (global_visit_birth_range_subset _ f) (fun j => (f j).val) hf (global_visit_birth_range_image _ f) rw [global_birth_visit_index_output h q.2 hq.label_injective T] at hc exact hc /- Equality of continuations is needed only on coherent, cutoff-supported output snapshots. This is the induction interface for consecutive raw rows. -/ theorem global_birth_visit_raw_row_congr [∀ p, DecidableEq (R p)] (a : P → Bool) (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H q) (G K : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (hGK : ∀ H' q', GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H' q' → q'.1 ≤ cap → G H' q' = K H' q') : globalBirthGhostVisitRawRow h β η V ρ cap H q.2 G = globalBirthGhostVisitRawRow h β η V ρ cap H q.2 K := by unfold globalBirthGhostVisitRawRow apply sum_congr rfl intro T hT apply sum_congr rfl intro b _ apply sum_congr rfl intro f _ congr 1 split_ifs with hc · exact hGK _ _ (global_birth_visit_raw_output_coherent a h H q hq T (mem_powerset.mp hT) f) hc · rfl /- Raw-row intertwining on coherent inputs. An arbitrary continuation that agrees with a phase test on coherent bounded outputs gives the exact phase row. -/ theorem coherent_global_birth_visit_raw_row [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : P → Bool) (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H q) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) (hG : ∀ H' q', GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H' q' → q'.1 ≤ cap → G H' q' = F (globalBirthMemoryReadout (ghostPhaseActivitySupport a) H' q')) : globalBirthGhostVisitRawRow h β η V ρ cap H q.2 G = ∑ z, ((∏ p, ghostPhaseDampedVisit (a p) (h p) η (β p) ρ (z p) (globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q p) : ℝ) : ℂ) * (if (ghostPhasePendingSupport z).card ≤ cap then F z else 0) := by calc _ = globalBirthGhostVisitRawRow h β η V ρ cap H q.2 (fun H' q' => symmetricPhaseReadout (globalBirthMemoryBase (ghostPhaseActivitySupport a) H') F q') := by apply global_birth_visit_raw_row_congr a h β η V ρ cap H q hq intro H' q' hq' hcap rw [hG H' q' hq' hcap, global_birth_coherent_symmetric_readout _ H' q' hq' F] _ = _ := by rw [global_birth_visit_raw_row_specialize] exact coherent_global_birth_visit_row a h β η V ρ hV cap H q hq F end end section open Finset open scoped Classical noncomputable def globalBirthEdgeRawRow {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] {N t : ℕ} (source target : Fin t ↪ P) (delta : (p : P) → R p) (H : Finset P) (old : Fin N → Σ p, R p) (eligible : Finset (Fin N)) (β : P → ℝ) (ρ V : ℝ) (cap : ℕ) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) : ℂ := unrestrictedEdgeAction source old Sigma.fst (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) (fun z => z.2 = 0) (fun p => β p / V) ρ V eligible cap (fun _stores promotions e fresh => if unrestrictedEdgeTarget old Sigma.fst promotions e fresh = target ∧ (∀ s, fresh s ∉ H) then 1 else 0) (fun target' q' => G (H ∪ univ.image target') q') section variable {P : Type*} [sharedInstance1 : Fintype P] [sharedInstance2 : DecidableEq P] {R : P → Type*} [sharedInstance4 : ∀ p, AddGroup (R p)] {t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport asrc) H q) (source target : Fin t ↪ P) (hsource : univ.image source = ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (eligible : Finset (Fin q.1)) include P sharedInstance1 sharedInstance2 R sharedInstance4 t atgt asrc delta H q hq source target hsource htarget eligible theorem coherent_global_birth_edge_raw_output (stores promotions : Finset (Fin t)) (e : promotions ↪ eligible) (fresh : UnrestrictedFreshLabels P promotions) (hv : unrestrictedEdgeTarget q.2 Sigma.fst promotions e fresh = target ∧ (∀ s, fresh s ∉ H)) : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport atgt) (H ∪ univ.image (unrestrictedEdgeTarget q.2 Sigma.fst promotions e fresh)) (unrestrictedEdgeOutput source q.2 (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) stores promotions e) := by let w := globalBirthMemoryReadout (ghostPhaseActivitySupport asrc) H q let f := globalBirthCoherentSupport (ghostPhaseActivitySupport asrc) H q hq have hw := global_birth_coherent_readout_mask asrc H q hq have hborn : ghostPhaseBornSupport w = H := global_birth_coherent_readout_born_support (ghostPhaseActivitySupport asrc) H q hq have heq : (fun j => (⟨f.val j, (q.2 j).2⟩ : Σ p, R p)) = q.2 := by funext j rfl have hvalid : GlobalBirthEdgeEventValid (ghostPhaseBornSupport w) f.val target ⟨promotions, e, fresh⟩ := by rw [hborn] exact hv have hc := global_birth_edge_output_coherent atgt asrc delta w hw source target hsource htarget f (fun j => (q.2 j).2) eligible stores ⟨promotions, e, fresh⟩ hvalid simpa only [hborn, heq, hv.1] using hc /- Continuations need agree only on coherent outputs within the actual cutoff. -/ theorem global_birth_edge_raw_row_congr (β : P → ℝ) (ρ V : ℝ) (cap : ℕ) (G K : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (hGK : ∀ H' q', GlobalBirthMemoryCoherent (ghostPhaseActivitySupport atgt) H' q' → q'.1 ≤ cap → G H' q' = K H' q') : globalBirthEdgeRawRow source target delta H q.2 eligible β ρ V cap G = globalBirthEdgeRawRow source target delta H q.2 eligible β ρ V cap K := by unfold globalBirthEdgeRawRow unrestrictedEdgeAction apply sum_congr rfl intro stores _ apply sum_congr rfl intro promotions _ apply sum_congr rfl intro e _ apply sum_congr rfl intro fresh _ by_cases hv : unrestrictedEdgeTarget q.2 Sigma.fst promotions e fresh = target ∧ (∀ s, fresh s ∉ H) · simp only [if_pos hv, mul_one] congr 1 split_ifs with hc · exact hGK _ _ (coherent_global_birth_edge_raw_output atgt asrc delta H q hq source target hsource htarget eligible stores promotions e fresh hv) hc · rfl · simp only [if_neg hv, mul_zero, zero_mul] end /- Exact raw-row intertwining on every coherent source, including incompatible sources. Shared active hits and the exact old-hit eligibility rule are explicit. -/ theorem coherent_global_birth_edge_raw_row {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {t : ℕ} (atgt asrc : P → Bool) (delta : (p : P) → R p) (hshared : ∀ p, atgt p = true ∧ asrc p = true → delta p = 0) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport asrc) H q) (source target : Fin t ↪ P) (hsource : univ.image source = ghostPhaseActivitySupport asrc \ ghostPhaseActivitySupport atgt) (htarget : univ.image target = ghostPhaseNewRunSet atgt asrc) (eligible : Finset (Fin q.1)) (heligible : ∀ j, j ∈ eligible ↔ (q.2 j).2 = delta (q.2 j).1) (β : P → ℝ) (ρ V : ℝ) (cap : ℕ) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) (hG : ∀ H' q', GlobalBirthMemoryCoherent (ghostPhaseActivitySupport atgt) H' q' → q'.1 ≤ cap → G H' q' = F (globalBirthMemoryReadout (ghostPhaseActivitySupport atgt) H' q')) : globalBirthEdgeRawRow source target delta H q.2 eligible β ρ V cap G = ∑ z, ((∏ p, (if atgt p && !(asrc p) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt p) (asrc p) (delta p) (β p) ρ ρ (z p) (globalBirthMemoryReadout (ghostPhaseActivitySupport asrc) H q p) : ℝ) : ℂ) * (if (ghostPhasePendingSupport z).card ≤ cap then F z else 0) := by calc _ = globalBirthEdgeRawRow source target delta H q.2 eligible β ρ V cap (fun H' q' => symmetricPhaseReadout (globalBirthMemoryBase (ghostPhaseActivitySupport atgt) H') F q') := by apply global_birth_edge_raw_row_congr atgt asrc delta H q hq source target hsource htarget eligible β ρ V cap intro H' q' hq' hcap rw [hG H' q' hq' hcap, global_birth_coherent_symmetric_readout _ H' q' hq' F] _ = _ := by have he := coherent_complete_global_birth_edge_row atgt asrc delta hshared H q hq source target hsource htarget eligible heligible β ρ V cap F refine Eq.trans ?_ he unfold globalBirthEdgeRawRow congr 1 funext stores promotions e fresh by_cases hv : unrestrictedEdgeTarget q.2 Sigma.fst promotions e fresh = target ∧ (∀ s, fresh s ∉ H) · rw [if_pos hv, if_pos (show GlobalBirthEdgeEventValid H (globalBirthCoherentSupport (ghostPhaseActivitySupport asrc) H q hq).val target ⟨promotions, e, fresh⟩ from hv)] · rw [if_neg hv, if_neg (show ¬GlobalBirthEdgeEventValid H (globalBirthCoherentSupport (ghostPhaseActivitySupport asrc) H q hq).val target ⟨promotions, e, fresh⟩ from hv)] end section open Finset /- A literal visit preserves the activity mask. A literal edge has fixed source/target slot enumerations and the physical shared-hit constraint. -/ inductive GlobalBirthRawStep {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] : (P → Bool) → (P → Bool) → Type _ | visit {a : P → Bool} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (cap : Nat) : GlobalBirthRawStep (R := R) a a | edge {a b : P → Bool} (delta : (p : P) → R p) (hshared : ∀ p, b p = true ∧ a p = true → delta p = 0) {t : Nat} (source target : Fin t ↪ P) (hsource : univ.image source = ghostPhaseActivitySupport a \ ghostPhaseActivitySupport b) (htarget : univ.image target = ghostPhaseNewRunSet b a) (β : P → ℝ) (ρ V : ℝ) (cap : Nat) : GlobalBirthRawStep (R := R) a b /- The cutoff is physical step data and is independent of the input memory. -/ def globalBirthRawStepCap {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] {a b : P → Bool} (step : GlobalBirthRawStep (R := R) a b) : Nat := match step with | .visit _ _ _ _ _ _ cap => cap | .edge _ _ _ _ _ _ _ _ _ cap => cap /- Eligible promotion positions are exactly the old particles hitting the target frame. No extra compatibility or matching witness is supplied. -/ noncomputable def globalBirthRawHitIndices {P : Type*} {R : P → Type*} [∀ p, DecidableEq (R p)] (delta : (p : P) → R p) (q : FiniteOrderedTuple (Σ p, R p)) : Finset (Fin q.1) := univ.filter (fun j => (q.2 j).2 = delta (q.2 j).1) theorem global_birth_raw_hit_indices_mem {P : Type*} {R : P → Type*} [∀ p, DecidableEq (R p)] (delta : (p : P) → R p) (q : FiniteOrderedTuple (Σ p, R p)) (j : Fin q.1) : j ∈ globalBirthRawHitIndices delta q ↔ (q.2 j).2 = delta (q.2 j).1 := by simp only [globalBirthRawHitIndices, mem_filter, mem_univ, true_and] /- The actual event row accepts an arbitrary continuation on the updated birth ledger and literal ordered memory. It contains no phase readout. -/ noncomputable def globalBirthRawStepRow {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {a b : P → Bool} (step : GlobalBirthRawStep (R := R) a b) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) : ℂ := match step with | .visit h β η V ρ _ cap => globalBirthGhostVisitRawRow h β η V ρ cap H q.2 G | .edge delta _ source target _ _ β ρ V cap => globalBirthEdgeRawRow source target delta H q.2 (globalBirthRawHitIndices delta q) β ρ V cap G /- The exact finite tensor phase row, with the same output cutoff. Visit coefficients and normalized moving-edge coefficients keep their signs. -/ noncomputable def globalBirthRawStepPhaseRow {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {a b : P → Bool} (step : GlobalBirthRawStep (R := R) a b) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) (w : (p : P) → GhostPhaseState (R p)) : ℂ := by classical cases step with | visit h β η V ρ hV cap => exact ∑ z, ((∏ p, ghostPhaseDampedVisit (a p) (h p) η (β p) ρ (z p) (w p) : ℝ) : ℂ) * (if (ghostPhasePendingSupport z).card ≤ cap then F z else 0) | edge delta hshared source target hsource htarget β ρ V cap => exact ∑ z, ((∏ p, (if b p && !(a p) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (b p) (a p) (delta p) (β p) ρ ρ (z p) (w p) : ℝ) : ℂ) * (if (ghostPhasePendingSupport z).card ≤ cap then F z else 0) /- Actual raw rows depend only on the continuation on coherent outputs inside the step's output cap. This is sufficient to substitute suffix rows. -/ theorem global_birth_raw_step_row_congr {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {a b : P → Bool} (step : GlobalBirthRawStep (R := R) a b) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H q) (G K : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (hGK : ∀ H' q', GlobalBirthMemoryCoherent (ghostPhaseActivitySupport b) H' q' → q'.1 ≤ globalBirthRawStepCap step → G H' q' = K H' q') : globalBirthRawStepRow step G H q = globalBirthRawStepRow step K H q := by cases step with | visit h β η V ρ hV cap => exact global_birth_visit_raw_row_congr a h β η V ρ cap H q hq G K hGK | edge delta hshared source target hsource htarget β ρ V cap => exact global_birth_edge_raw_row_congr b a delta H q hq source target hsource htarget (globalBirthRawHitIndices delta q) β ρ V cap G K hGK /- Every actual chronological step intertwines with its exact finite phase row. The continuation hypothesis is needed only on coherent bounded outputs; no compatibility or eligible-promotion existence hypothesis is hidden here. -/ theorem global_birth_raw_step_intertwines {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {a b : P → Bool} (step : GlobalBirthRawStep (R := R) a b) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H q) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) (hG : ∀ H' q', GlobalBirthMemoryCoherent (ghostPhaseActivitySupport b) H' q' → q'.1 ≤ globalBirthRawStepCap step → G H' q' = F (globalBirthMemoryReadout (ghostPhaseActivitySupport b) H' q')) : globalBirthRawStepRow step G H q = globalBirthRawStepPhaseRow step F (globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q) := by cases step with | visit h β η V ρ hV cap => exact coherent_global_birth_visit_raw_row a h β η V ρ hV cap H q hq G F hG | edge delta hshared source target hsource htarget β ρ V cap => exact coherent_global_birth_edge_raw_row b a delta hshared H q hq source target hsource htarget (globalBirthRawHitIndices delta q) (global_birth_raw_hit_indices_mem delta q) β ρ V cap G F hG end section open Finset abbrev GlobalBirthHistoryState {P : Type*} (R : P → Type*) := Finset P × FiniteOrderedTuple (Σ p, R p) section History variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : ℕ → P → Bool) (steps : ∀ i, GlobalBirthRawStep (R := R) (a i) (a (i + 1))) end History end section theorem primePoolPart_mul_of_free {P : Finset ℕ} {p n : ℕ} (hp : p ∈ Nat.factoredNumbers P) (hn : n ≠ 0) (hfree : Disjoint n.primeFactors P) : primePoolPart P (p * n) = p := by exact primePoolPart_mul_of_disjoint hfree.symm hp (Nat.mem_factoredNumbers_of_primeFactors_subset hn (fun _ h => h)) theorem primePoolFreePart_mul_of_free {P : Finset ℕ} {p n : ℕ} (hp : p ∈ Nat.factoredNumbers P) (hn : n ≠ 0) (hfree : Disjoint n.primeFactors P) : primePoolFreePart P (p * n) = n := by exact primePoolFreePart_mul_of_disjoint hfree.symm hp (Nat.mem_factoredNumbers_of_primeFactors_subset hn (fun _ h => h)) theorem supported_free_product_unique {P : Finset ℕ} {p₁ n₁ p₂ n₂ : ℕ} (hp₁ : p₁ ∈ Nat.factoredNumbers P) (hn₁ : n₁ ≠ 0) (hfree₁ : Disjoint n₁.primeFactors P) (hp₂ : p₂ ∈ Nat.factoredNumbers P) (hn₂ : n₂ ≠ 0) (hfree₂ : Disjoint n₂.primeFactors P) (hmul : p₁ * n₁ = p₂ * n₂) : p₁ = p₂ ∧ n₁ = n₂ := by have hpart := congrArg (primePoolPart P) hmul have hfree := congrArg (primePoolFreePart P) hmul rw [primePoolPart_mul_of_free hp₁ hn₁ hfree₁, primePoolPart_mul_of_free hp₂ hn₂ hfree₂] at hpart rw [primePoolFreePart_mul_of_free hp₁ hn₁ hfree₁, primePoolFreePart_mul_of_free hp₂ hn₂ hfree₂] at hfree exact ⟨hpart, hfree⟩ end section open Filter open scoped Topology theorem exists_candidate_ordinary_mass_polynomial_lower {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) : ∃ C : ℝ, 0 ≤ C ∧ ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, Real.exp L * L^(-C) ≤ candidateOrdinaryWindowMass c L q r jStar := by obtain ⟨K, hK, J, hmass⟩ := exists_candidate_ordinary_window_mass_lower hc hr hq0 hq1 hcenter obtain ⟨D, hD, hQ⟩ := exists_candidate_Q_harmonic_polynomial_bounds hc r refine ⟨D + 2, by linarith, J, ?_⟩ intro jStar hj filter_upwards [hmass, hQ jStar, eventually_candidate_one_marked_mass_ge_one hc hq0 hq1.le, eventually_gt_atTop (0 : ℝ), eventually_ge_atTop (1 / K)] with L hm hq hp hL hlarge have hInv : 1 / L ≤ K := by apply (div_le_iff₀ hL).mpr have h := (div_le_iff₀ hK).mp hlarge linarith have hQ0 : 0 ≤ candidateQHarmonicMass c L r jStar := (Real.rpow_pos_of_pos hL (-D)).le.trans hq.1 have hsmall : (1 / L) * (Real.exp L / L) * L^(-D) ≤ K * (Real.exp L / L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar := by calc _ ≤ K * (Real.exp L / L) * L^(-D) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hInv (by positivity)) (by positivity) _ ≤ K * (Real.exp L / L) * candidateQHarmonicMass c L r jStar := mul_le_mul_of_nonneg_left hq.1 (by positivity) _ = (K * (Real.exp L / L) * 1) * candidateQHarmonicMass c L r jStar := by ring _ ≤ _ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hp (by positivity)) hQ0 have heq : Real.exp L * L^(-(D + 2)) = (1 / L) * (Real.exp L / L) * L^(-D) := by rw [show -(D + 2) = (-D + (-1)) + (-1) by ring, Real.rpow_add hL, Real.rpow_add hL, Real.rpow_neg_one] ring exact heq.le.trans (hsmall.trans (hm jStar hj)) end section open Finset private theorem prod_mem_factored_pool {I : Type*} (S : Finset I) (P : Finset ℕ) (v : I → ℕ) (hv : ∀ i ∈ S, v i ∈ Nat.factoredNumbers P) : (∏ i ∈ S, v i) ∈ Nat.factoredNumbers P := by classical induction S using Finset.induction_on with | empty => simp [Nat.mem_factoredNumbers] | @insert i S hi ih => rw [prod_insert hi] exact Nat.mul_mem_factoredNumbers (hv i (mem_insert_self _ _)) (ih (fun j hj => hv j (mem_insert_of_mem hj))) private theorem primePoolPart_prod {I : Type*} (S : Finset I) (P : Finset ℕ) (v : I → ℕ) (hv : ∀ i ∈ S, v i ≠ 0) : primePoolPart P (∏ i ∈ S, v i) = ∏ i ∈ S, primePoolPart P (v i) := by classical induction S using Finset.induction_on with | empty => simp [primePoolPart, Finsupp.filter_zero] | @insert i S hi ih => rw [prod_insert hi, prod_insert hi, primePoolPart_mul P (hv i (mem_insert_self _ _)) (prod_ne_zero_iff.mpr (fun j hj => hv j (mem_insert_of_mem hj))), ih (fun j hj => hv j (mem_insert_of_mem hj))] private theorem primePoolPart_group_prod {G : Type*} [Fintype G] (P : G → Finset ℕ) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (v : G → ℕ) (hv : ∀ g, v g ∈ Nat.factoredNumbers (P g)) (g : G) : primePoolPart (P g) (∏ h, v h) = v g := by classical rw [primePoolPart_prod univ (P g) v (fun h _ => (hv h).1)] calc (∏ h, primePoolPart (P g) (v h)) = primePoolPart (P g) (v g) := by apply prod_eq_single g · intro h _ hne exact primePoolPart_eq_one_of_disjoint (hdisj (Ne.symm hne)) (hv h) · simp _ = v g := primePoolPart_eq_self_of_mem (hv g) private theorem prime_tuple_prod_mem {k : ℕ} (P : Finset ℕ) (x : Fin k → ℕ) (hprime : ∀ p ∈ P, p.Prime) (hx : ∀ i, x i ∈ P) : (∏ i, x i) ∈ Nat.factoredNumbers P := by apply prod_mem_factored_pool intro i _ apply Nat.mem_factoredNumbers'.mpr intro p hp hpi have heq := (Nat.prime_dvd_prime_iff_eq hp (hprime _ (hx i))).mp hpi simpa only [heq] using hx i /- Equal full products determine the ordered prime list in each group up to permutation. Repeated primes remain repeated; no injectivity condition on slot values is used. -/ theorem prime_group_lists_perm_of_prod_eq {G : Type*} [Fintype G] (P : G → Finset ℕ) (k : G → ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x y : ∀ g, Fin (k g) → ℕ) (hx : ∀ g i, x g i ∈ P g) (hy : ∀ g i, y g i ∈ P g) (hprod : (∏ g, ∏ i, x g i) = ∏ g, ∏ i, y g i) (g : G) : (List.ofFn (x g)).Perm (List.ofFn (y g)) := by have heq : (∏ i, x g i) = ∏ i, y g i := by rw [← primePoolPart_group_prod P hdisj (fun h => ∏ i, x h i) (fun h => prime_tuple_prod_mem (P h) (x h) (hprime h) (hx h)) g, ← primePoolPart_group_prod P hdisj (fun h => ∏ i, y h i) (fun h => prime_tuple_prod_mem (P h) (y h) (hprime h) (hy h)) g, hprod] apply perm_of_prod_eq_prod · simpa only [List.prod_ofFn] using heq · exact List.forall_mem_ofFn_iff.mpr (fun i => (hprime g _ (hx g i)).prime) · exact List.forall_mem_ofFn_iff.mpr (fun i => (hprime g _ (hy g i)).prime) /- Any finite injectively represented family of grouped ordered slots has at most `∏ g, (k g)!` members in a fixed product fiber. Repeated slot values are permitted. -/ theorem card_prime_group_product_fiber {G Ω : Type*} [Fintype G] [Fintype Ω] (P : G → Finset ℕ) (k : G → ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : Ω → ∀ g, Fin (k g) → ℕ) (hxinj : Function.Injective x) (hx : ∀ a g i, x a g i ∈ P g) (n : ℕ) : Nat.card {a : Ω // (∏ g, ∏ i, x a g i) = n} ≤ ∏ g, (k g).factorial := by classical let F := {a : Ω // (∏ g, ∏ i, x a g i) = n} change Nat.card F ≤ _ by_cases hF : Nonempty F · obtain ⟨a0⟩ := hF let target (g : G) := (List.ofFn (x a0.val g)).permutations.toFinset let f : F → ∀ g, target g := fun a g => ⟨List.ofFn (x a.val g), by apply List.mem_toFinset.mpr apply List.mem_permutations.mpr exact prime_group_lists_perm_of_prod_eq P k hprime hdisj (x a.val) (x a0.val) (hx a.val) (hx a0.val) (a.property.trans a0.property.symm) g⟩ have hfinj : Function.Injective f := by intro a b hab apply Subtype.ext apply hxinj funext g apply List.ofFn_injective exact congrArg Subtype.val (congrFun hab g) rw [Nat.card_eq_fintype_card] calc Fintype.card F ≤ Fintype.card (∀ g, target g) := Fintype.card_le_of_injective f hfinj _ = ∏ g, (target g).card := by simp only [Fintype.card_pi, Fintype.card_coe] _ ≤ ∏ g, (k g).factorial := by apply prod_le_prod' intro g _ simpa only [target, List.length_permutations, List.length_ofFn] using List.toFinset_card_le (List.ofFn (x a0.val g)).permutations · rw [Nat.card_eq_fintype_card, Fintype.card_eq_zero_iff.mpr (not_nonempty_iff.mp hF)] exact Nat.zero_le _ /- The direct product fiber bound for all ordered choices in each prime group. -/ theorem card_ordered_prime_group_product_fiber {G : Type*} [Fintype G] (P : G → Finset ℕ) (k : G → ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (n : ℕ) : Nat.card {x : ∀ g, Fin (k g) → P g // (∏ g, ∏ i, (x g i).val) = n} ≤ ∏ g, (k g).factorial := by classical have hinj : Function.Injective (fun x : ∀ g, Fin (k g) → P g => fun g i => (x g i).val) := by intro x y h funext g i apply Subtype.ext exact congrFun (congrFun h g) i exact card_prime_group_product_fiber P k hprime hdisj (fun x : ∀ g, Fin (k g) → P g => fun g i => (x g i).val) hinj (fun x g i => (x g i).property) n /- Constant reciprocal weight on a product fiber, with arbitrary finite slot restrictions. -/ theorem prime_group_product_fiber_harmonic_bound {G Ω : Type*} [Fintype G] [Fintype Ω] (P : G → Finset ℕ) (k : G → ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : Ω → ∀ g, Fin (k g) → ℕ) (hxinj : Function.Injective x) (hx : ∀ a g i, x a g i ∈ P g) (V : G → ℝ) (hV : ∀ g, 0 ≤ V g) (n : ℕ) : ((Nat.card {a : Ω // (∏ g, ∏ i, x a g i) = n} : ℝ) / (n : ℝ)) / (∏ g, (V g)^(k g)) ≤ (1 / (n : ℝ)) * ∏ g, ((k g).factorial : ℝ) / (V g)^(k g) := by have hcard : (Nat.card {a : Ω // (∏ g, ∏ i, x a g i) = n} : ℝ) ≤ ∏ g, ((k g).factorial : ℝ) := by exact_mod_cast card_prime_group_product_fiber P k hprime hdisj x hxinj hx n calc _ ≤ ((∏ g, ((k g).factorial : ℝ)) / (n : ℝ)) / (∏ g, (V g)^(k g)) := div_le_div_of_nonneg_right (div_le_div_of_nonneg_right hcard (Nat.cast_nonneg n)) (prod_nonneg (fun g _ => pow_nonneg (hV g) _)) _ = _ := by rw [prod_div_distrib]; ring /- The normalized product of slot reciprocals is constant on each product fiber. -/ theorem prime_group_slot_reciprocal_identity {G : Type*} [Fintype G] (k : G → ℕ) (x : ∀ g, Fin (k g) → ℕ) (V : G → ℝ) : (∏ g, ∏ i, (1 / (x g i : ℝ)) / V g) = (1 / ((∏ g, ∏ i, x g i : ℕ) : ℝ)) / (∏ g, (V g)^(k g)) := by simp only [div_eq_mul_inv, one_mul, prod_mul_distrib, prod_inv_distrib, prod_const, Finset.card_univ, Fintype.card_fin, Nat.cast_prod] /- The harmonic atom bound in the form needed for finite weighted fibers. -/ theorem prime_group_slot_harmonic_atom_bound {G Ω : Type*} [Fintype G] [Fintype Ω] (P : G → Finset ℕ) (k : G → ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : Ω → ∀ g, Fin (k g) → ℕ) (hxinj : Function.Injective x) (hx : ∀ a g i, x a g i ∈ P g) (V : G → ℝ) (hV : ∀ g, 0 ≤ V g) (n : ℕ) : (∑ a : Ω, if (∏ g, ∏ i, x a g i) = n then (∏ g, ∏ i, (1 / (x a g i : ℝ)) / V g) else 0) ≤ (1 / (n : ℝ)) * ∏ g, ((k g).factorial : ℝ) / (V g)^(k g) := by classical have heq : (∑ a : Ω, if (∏ g, ∏ i, x a g i) = n then (∏ g, ∏ i, (1 / (x a g i : ℝ)) / V g) else 0) = ((Nat.card {a : Ω // (∏ g, ∏ i, x a g i) = n} : ℝ) / (n : ℝ)) / (∏ g, (V g)^(k g)) := by simp_rw [prime_group_slot_reciprocal_identity] have ht : ∀ a : Ω, (if (∏ g, ∏ i, x a g i) = n then (1 / ((∏ g, ∏ i, x a g i : ℕ) : ℝ)) / (∏ g, (V g)^(k g)) else 0) = (if (∏ g, ∏ i, x a g i) = n then (1 / (n : ℝ)) / (∏ g, (V g)^(k g)) else 0) := by intro a split_ifs with h · rw [h] · rfl simp_rw [ht] simp [Nat.card_eq_fintype_card, Fintype.card_subtype, ← sum_filter, div_eq_mul_inv, mul_assoc] rw [heq] exact prime_group_product_fiber_harmonic_bound P k hprime hdisj x hxinj hx V hV n end section open Finset noncomputable def primeFiberFactorBound (v : ℝ) (m : ℕ) : ℝ := (m.factorial : ℝ) * (max 1 (1 / v))^m theorem one_le_primeFiberFactorBound (v : ℝ) (m : ℕ) : 1 ≤ primeFiberFactorBound v m := by have hfac : (1 : ℝ) ≤ m.factorial := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Nat.factorial_ne_zero m) have hpow : (1 : ℝ) ≤ (max 1 (1 / v))^m := one_le_pow₀ (le_max_left _ _) simpa only [one_mul, primeFiberFactorBound] using mul_le_mul hfac hpow (by norm_num) (by positivity) theorem prime_fiber_factor_le_bound {v V : ℝ} (hv : 0 < v) (hV : v ≤ V) {k m : ℕ} (hk : k ≤ m) : (k.factorial : ℝ) / V^k ≤ primeFiberFactorBound v m := by have hVpos : 0 < V := hv.trans_le hV have hinv : 1 / V ≤ max 1 (1 / v) := (one_div_le_one_div_of_le hv hV).trans (le_max_right _ _) have hpow : (1 / V)^k ≤ (max 1 (1 / v))^m := (pow_le_pow_left₀ (by positivity) hinv k).trans (pow_le_pow_right₀ (le_max_left _ _) hk) have hfac : (k.factorial : ℝ) ≤ m.factorial := by exact_mod_cast Nat.factorial_le hk calc _ = (k.factorial : ℝ) * (1 / V)^k := by rw [one_div_pow]; ring _ ≤ primeFiberFactorBound v m := mul_le_mul hfac hpow (by positivity) (by positivity) theorem prime_fiber_factor_product_le_rpow {G : Type*} (groups : Finset G) (V : G → ℝ) (k : G → ℕ) (m : ℕ) {v L D : ℝ} (hv : 0 < v) (hL : 0 < L) (hV : ∀ g ∈ groups, v ≤ V g) (hk : ∀ g ∈ groups, k g ≤ m) (hcard : (groups.card : ℝ) ≤ D * Real.log L) : (∏ g ∈ groups, ((k g).factorial : ℝ) / (V g)^(k g)) ≤ L^(D * Real.log (primeFiberFactorBound v m)) := by exact group_product_bound_of_log_card groups (fun g => ((k g).factorial : ℝ) / (V g)^(k g)) (one_le_primeFiberFactorBound v m) hL (fun g hg => div_nonneg (Nat.cast_nonneg _) (pow_nonneg (hv.le.trans (hV g hg)) _)) (fun g hg => prime_fiber_factor_le_bound hv (hV g hg) (hk g hg)) hcard theorem prime_fiber_factor_fintype_product_le_rpow {G : Type*} [Fintype G] (V : G → ℝ) (k : G → ℕ) (m : ℕ) {v L D : ℝ} (hv : 0 < v) (hL : 0 < L) (hV : ∀ g, v ≤ V g) (hk : ∀ g, k g ≤ m) (hcard : (Fintype.card G : ℝ) ≤ D * Real.log L) : (∏ g, ((k g).factorial : ℝ) / (V g)^(k g)) ≤ L^(D * Real.log (primeFiberFactorBound v m)) := by exact prime_fiber_factor_product_le_rpow univ V k m hv hL (fun g _ => hV g) (fun g _ => hk g) (by simpa only [card_univ] using hcard) end section open Finset open scoped Classical def ghostPhaseInitialState {P : Type*} {R : P → Type*} (a : P → Bool) (p : P) : GhostPhaseState (R p) := if a p then none else some none theorem ghost_phase_initial_point_mass {R : Type*} [DecidableEq R] (a : Bool) (β : ℝ) (z : GhostPhaseState R) : ghostPhaseInitial a β z = if z = (if a then none else some none) then (if a then β else 1) else 0 := by cases a <;> rcases z with _ | (_ | (_ | r)) <;> simp [ghostPhaseInitial, ghostFiniteInitial] theorem ghost_phase_initial_tensor_point_mass {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] (a : P → Bool) (β : P → ℝ) (z : (p : P) → GhostPhaseState (R p)) : (∏ p, ghostPhaseInitial (a p) (β p) (z p)) = if z = ghostPhaseInitialState a then (∏ p, if a p then β p else 1) else 0 := by by_cases hz : z = ghostPhaseInitialState a · subst z simp only [ghost_phase_initial_point_mass, ghostPhaseInitialState] simp only [ite_true] · rw [if_neg hz] obtain ⟨p, hp⟩ := Function.ne_iff.mp hz apply prod_eq_zero (mem_univ p) rw [ghost_phase_initial_point_mass] exact if_neg hp end section open Finset open scoped Classical /- The literal ordered memory with no particles. -/ def globalBirthEmptyMemory {P : Type*} {R : P → Type*} : FiniteOrderedTuple (Σ p, R p) := ⟨0, Fin.elim0⟩ /- Empty memory and a ledger equal to the active labels are coherent. -/ theorem global_birth_empty_memory_coherent {P : Type*} [DecidableEq P] {R : P → Type*} (active : Finset P) : GlobalBirthMemoryCoherent active active (globalBirthEmptyMemory (R := R)) := by refine ⟨?_, ?_, ?_, Subset.rfl⟩ · intro i exact Fin.elim0 i · intro p hp obtain ⟨j, _, _⟩ := mem_image.mp hp exact Fin.elim0 j · apply disjoint_left.mpr intro p hp _ obtain ⟨j, _, _⟩ := mem_image.mp hp exact Fin.elim0 j /- Reading the empty initial memory gives active tags on the initial active set and unborn tags everywhere else, with no completed or pending labels. -/ theorem global_birth_empty_memory_readout {P : Type*} [DecidableEq P] {R : P → Type*} (active : Finset P) : globalBirthMemoryReadout active active (globalBirthEmptyMemory (R := R)) = fun p => if p ∈ active then none else some none := by funext p rw [global_birth_memory_readout_off_labels active active _ p (by simp [globalBirthEmptyMemory])] by_cases hp : p ∈ active <;> simp [globalBirthMemoryBase, hp] /- Boolean-activity form of the usual initial phase snapshot. -/ theorem global_birth_initial_phase {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (a : P → Bool) : globalBirthMemoryReadout (ghostPhaseActivitySupport a) (ghostPhaseActivitySupport a) (globalBirthEmptyMemory (R := R)) = fun p => if a p then none else some none := by rw [global_birth_empty_memory_readout] funext p simp [ghostPhaseActivitySupport] /- On a valid phase tag the terminal test rejects exactly pending memory. -/ theorem ghost_phase_terminal_eq_pending_indicator {R : Type*} (a : Bool) (z : GhostPhaseState R) (hz : z.isSome = !a) : ghostPhaseTerminal a z = if ∃ r, z = some (some (some r)) then 0 else 1 := by classical cases a <;> rcases z with _ | (_ | (_ | r)) <;> simp_all [ghostPhaseTerminal, ghostFiniteTerminal] /- The actual tensor terminal test is one exactly when the literal coherent ordered memory is empty. It imposes no requirement that the born ledger be empty. -/ theorem global_birth_coherent_terminal_tensor {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} (a : P → Bool) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) (hq : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport a) H q) : (∏ p, ghostPhaseTerminal (a p) (globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q p)) = if q.1 = 0 then 1 else 0 := by classical have hm := global_birth_coherent_readout_mask a H q hq by_cases hn : q.1 = 0 · rw [if_pos hn] apply prod_eq_one intro p _ have hp : p ∉ ghostPhasePendingSupport (globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q) := by rw [global_birth_coherent_readout_pending_support _ H q hq] intro hp obtain ⟨j, _, _⟩ := mem_image.mp hp exact Nat.not_lt_zero j.val (j.isLt.trans_eq hn) have hnp : ¬ ∃ r, globalBirthMemoryReadout (ghostPhaseActivitySupport a) H q p = some (some (some r)) := by simpa only [ghostPhasePendingSupport, mem_filter, mem_univ, true_and] using hp rw [ghost_phase_terminal_eq_pending_indicator _ _ (hm p), if_neg hnp] · rw [if_neg hn] let j : Fin q.1 := ⟨0, Nat.pos_of_ne_zero hn⟩ apply prod_eq_zero (mem_univ (q.2 j).1) rw [global_birth_coherent_readout_particle _ H q hq j] cases a (q.2 j).1 <;> simp [ghostPhaseTerminal, ghostFiniteTerminal] end section open Finset /- Pull a test backwards across one kernel whose first state is the output. -/ noncomputable def finiteKernelPullback {X 𝕜 : Type*} [Fintype X] [Semiring 𝕜] (K : ℕ → X → X → 𝕜) (i : ℕ) (F : X → 𝕜) (w : X) : 𝕜 := ∑ z, K i z w * F z /- Pairing an initial weight with chronological row composition is exactly pairing the terminal test with forward kernel evolution. -/ theorem finite_row_composition_path_pairing {X 𝕜 : Type*} [Fintype X] [CommSemiring 𝕜] (K : ℕ → X → X → 𝕜) (initial F : X → 𝕜) (n : ℕ) : (∑ w, initial w * finiteRowComposition (S := fun _ => X) (finiteKernelPullback K) n F w) = ∑ z, F z * finitePathAction K initial n z := by induction n generalizing F with | zero => simp [finiteRowComposition, finitePathAction, mul_comm] | succ n ih => rw [finite_row_composition_succ, ih] simp only [finiteKernelPullback, finitePathAction, sum_mul, mul_sum] rw [sum_comm] apply sum_congr rfl intro z _ apply sum_congr rfl intro w _ ac_rfl /- The same chronological composition is the sum of every complete state trace, with both its initial weight and terminal test retained. -/ theorem finite_row_composition_trace_pairing {X 𝕜 : Type*} [Fintype X] [CommSemiring 𝕜] (K : ℕ → X → X → 𝕜) (initial F : X → 𝕜) (n : ℕ) : (∑ w, initial w * finiteRowComposition (S := fun _ => X) (finiteKernelPullback K) n F w) = ∑ x : Fin (n + 1) → X, F (x (Fin.last n)) * finiteChronologicalPrefix K initial n x := by rw [finite_row_composition_path_pairing] exact (finite_chronological_trace_expansion K initial F n).symm end section open Finset open scoped Classical /- The exact marginal of one auxiliary group under the physical product law. -/ theorem physical_auxiliary_group_marginal {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (g : G) (F : (C g → P g) → ℝ) : (∑ aux : PhysicalAuxLabels P C, physicalAuxMass V C aux * F (aux g)) = ∑ a : C g → P g, cleanAuxiliaryWeight (physicalLabelLaw V g) a * F a := by let factors (i : G) (a : C i → P i) : ℝ := (∏ j, physicalLabelLaw V i (a j)) * (if h : i = g then F (h ▸ a) else 1) have hprod (aux : PhysicalAuxLabels P C) : physicalAuxMass V C aux * F (aux g) = ∏ i, factors i (aux i) := by simp only [factors, prod_mul_distrib, physicalAuxMass] congr 1 rw [prod_eq_single g] · simp · intro i hi hig simp only [dif_neg hig] · simp simp_rw [hprod] rw [← Fintype.prod_sum factors, prod_eq_single g] · simp only [factors, ↓reduceDIte, cleanAuxiliaryWeight] · intro i hi hig simp only [factors, dif_neg hig, mul_one] rw [← Fintype.prod_sum (fun (_j : C i) (q : P i) => physicalLabelLaw V i q)] simp only [physical_label_law_sum V i (hV i) (hMass i), prod_const_one] · simp theorem repeated_big_auxiliary_ban_failure_iff {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (source target : RepeatedBigLists P J ell) (aux : PhysicalAuxLabels P C) : ¬(repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target) ↔ ∃ g, cleanAuxiliaryCollision (source g) (target g) (aux g) := by constructor · intro h by_contra hn apply h constructor · intro g j s he exact hn ⟨g, j, Or.inl ⟨s, he⟩⟩ · intro g j s he exact hn ⟨g, j, Or.inr ⟨s, he⟩⟩ · rintro ⟨g, j, ⟨s, hs⟩ | ⟨s, hs⟩⟩ ⟨h1, h2⟩ · exact h1 g j s hs · exact h2 g j s hs /- A uniform collision estimate for both endpoints, with all group laws and all auxiliary coordinates integrated exactly. Repeated labels are allowed. -/ theorem repeated_big_auxiliary_collision_mass_le {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (source target : RepeatedBigLists P J ell) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) : (∑ aux : PhysicalAuxLabels P C, physicalAuxMass V C aux * (if ¬(repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target) then 1 else 0)) ≤ ∑ g, (C g).card * (2 * (J + ell : ℕ)) / (V g * Pmin) := by simp_rw [repeated_big_auxiliary_ban_failure_iff] calc _ ≤ ∑ g, ∑ aux : PhysicalAuxLabels P C, physicalAuxMass V C aux * (if cleanAuxiliaryCollision (source g) (target g) (aux g) then 1 else 0) := clean_weighted_exists_le_sum _ (fun a => physical_aux_mass_nonneg V C (fun g => (hV g).le) a) _ _ = ∑ g, ∑ a : C g → P g, cleanAuxiliaryWeight (physicalLabelLaw V g) a * (if cleanAuxiliaryCollision (source g) (target g) a then 1 else 0) := by apply sum_congr rfl intro g hg exact physical_auxiliary_group_marginal V C hV hMass g (fun a => if cleanAuxiliaryCollision (source g) (target g) a then 1 else 0) _ ≤ _ := by apply sum_le_sum intro g hg have h := clean_auxiliary_collision_mass_le (A := ↥(C g)) (physicalLabelLaw V g) (physical_label_law_nonneg V (fun g => (hV g).le) g) (physical_label_law_sum V g (hV g) (hMass g)) (source g) (target g) (1 / (V g * Pmin)) (fun p => physical_label_law_atom_le V g (hV g) hPmin p (hp g p)) apply h.trans_eq simp only [PhysicalSlots, Fintype.card_coe, Fintype.card_sum, Fintype.card_fin, Nat.cast_add] ring end section end section theorem primitive_changeLevel_eq_implies_sigma_eq {q r m : ℕ} [NeZero m] (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (hχ : χ.IsPrimitive) (hψ : ψ.IsPrimitive) (hq : q ∣ m) (hr : r ∣ m) (he : χ.changeLevel hq = ψ.changeLevel hr) : (⟨q, χ⟩ : (n : ℕ) × DirichletCharacter ℂ n) = ⟨r, ψ⟩ := by have hqr : q = r := by have hc := congrArg DirichletCharacter.conductor he rw [DirichletCharacter.conductor_changeLevel, DirichletCharacter.conductor_changeLevel, hχ, hψ] at hc exact hc subst r have he' : χ = ψ := DirichletCharacter.changeLevel_injective hq he subst ψ rfl theorem primitive_changeLevel_mul_star_ne_one {q r m : ℕ} [NeZero m] (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (hχ : χ.IsPrimitive) (hψ : ψ.IsPrimitive) (hq : q ∣ m) (hr : r ∣ m) (hne : (⟨q, χ⟩ : (n : ℕ) × DirichletCharacter ℂ n) ≠ ⟨r, ψ⟩) : χ.changeLevel hq * star (ψ.changeLevel hr) ≠ 1 := by intro he rw [MulChar.star_eq_inv] at he apply hne apply primitive_changeLevel_eq_implies_sigma_eq χ ψ hχ hψ hq hr exact mul_inv_eq_one.mp he theorem primitive_product_level_mul_star_ne_one {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (hq : 0 < q) (hr : 0 < r) (hχ : χ.IsPrimitive) (hψ : ψ.IsPrimitive) (hne : (⟨q, χ⟩ : (n : ℕ) × DirichletCharacter ℂ n) ≠ ⟨r, ψ⟩) : χ.changeLevel (Nat.dvd_mul_right q r) * star (ψ.changeLevel (Nat.dvd_mul_left r q)) ≠ 1 := by let : NeZero (q * r) := ⟨Nat.mul_ne_zero hq.ne' hr.ne'⟩ exact primitive_changeLevel_mul_star_ne_one χ ψ hχ hψ _ _ hne /- Evaluation commutes with the product lift even at integers not coprime to either modulus: the corresponding original character factor is already zero. -/ theorem product_level_mul_star_int_apply {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (a : ℤ) : (χ.changeLevel (Nat.dvd_mul_right q r) * star (ψ.changeLevel (Nat.dvd_mul_left r q))) (a : ZMod (q * r)) = χ (a : ZMod q) * star (ψ (a : ZMod r)) := by rw [MulChar.mul_apply, MulChar.star_apply] by_cases ha : IsCoprime a ((q * r : ℕ) : ℤ) · rw [DirichletCharacter.changeLevel_eq_cast_of_dvd' χ _ ha, DirichletCharacter.changeLevel_eq_cast_of_dvd' ψ _ ha] · have hz := (χ.changeLevel (Nat.dvd_mul_right q r)).apply_eq_zero_iff a |>.mpr ha rw [hz, zero_mul] have hh : ¬ (IsCoprime a (q : ℤ) ∧ IsCoprime a (r : ℤ)) := by simpa only [Nat.cast_mul, IsCoprime.mul_right_iff] using ha rcases not_and_or.mp hh with hqa | hra · rw [(χ.apply_eq_zero_iff a).mpr hqa, zero_mul] · rw [(ψ.apply_eq_zero_iff a).mpr hra, star_zero, mul_zero] theorem product_level_mul_star_nat_apply {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (a : ℕ) : (χ.changeLevel (Nat.dvd_mul_right q r) * star (ψ.changeLevel (Nat.dvd_mul_left r q))) (a : ZMod (q * r)) = χ (a : ZMod q) * star (ψ (a : ZMod r)) := by simpa only [Int.cast_natCast] using product_level_mul_star_int_apply χ ψ (a : ℤ) end section open Finset Classical noncomputable def complexNormEnvelope {X : Type*} (f : X → ℂ) : X → ℂ := fun x => (‖f x‖ : ℂ) theorem complexNormEnvelope_norm {X : Type*} (f : X → ℂ) (x : X) : ‖complexNormEnvelope f x‖ = ‖f x‖ := by simp [complexNormEnvelope] theorem complexNormEnvelope_energy {X : Type*} [Fintype X] (μ : X → ℝ) (f : X → ℂ) : finiteWeightedEnergy μ (complexNormEnvelope f) = finiteWeightedEnergy μ f := by unfold finiteWeightedEnergy simp only [complexNormEnvelope_norm] theorem complexNormEnvelope_memory_symmetric {G : Type*} [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (complexNormEnvelope f) := by intro x g τ unfold complexNormEnvelope rw [hf x g τ] theorem finiteWeightedEnergy_le_of_norm_le {X : Type*} [Fintype X] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (f g : X → ℂ) (h : ∀ x, ‖f x‖ ≤ ‖g x‖) : finiteWeightedEnergy μ f ≤ finiteWeightedEnergy μ g := by apply sum_le_sum intro x _ exact mul_le_mul_of_nonneg_left ((sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr (h x)) (hμ x) /- A globally coupled action may be estimated by a positive product action on the norm envelope; no factorization of its phase is assumed. -/ theorem finiteWeightedEnergy_le_of_envelope_domination {X : Type*} [Fintype X] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (f output : X → ℂ) (positive : (X → ℂ) → X → ℂ) (C : ℝ) (hdom : ∀ x, ‖output x‖ ≤ ‖positive (complexNormEnvelope f) x‖) (hbound : finiteWeightedEnergy μ (positive (complexNormEnvelope f)) ≤ C * finiteWeightedEnergy μ (complexNormEnvelope f)) : finiteWeightedEnergy μ output ≤ C * finiteWeightedEnergy μ f := by calc _ ≤ finiteWeightedEnergy μ (positive (complexNormEnvelope f)) := finiteWeightedEnergy_le_of_norm_le μ hμ output _ hdom _ ≤ C * finiteWeightedEnergy μ (complexNormEnvelope f) := hbound _ = _ := by rw [complexNormEnvelope_energy] end section open Finset Classical abbrev UnrestrictedBoundedEvent {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) := Σ _stores : Finset (Fin t), Σ promotions : Finset (Fin t), (promotions ↪ ↥(unrestrictedResidueEligible n Δ D s.2.2)) × UnrestrictedFreshLabels P promotions noncomputable def unrestrictedBoundedEventTarget {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) : BoundedOrderedState P (UnrestrictedResidueParticle n) t B := let q := unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) e.1 e.2.1 e.2.2.1 if h : q.1 ≤ B then (unrestrictedEdgeTarget s.2.2 Sigma.fst e.2.1 e.2.2.1 e.2.2.2, ⟨⟨q.1, Nat.lt_succ_of_le h⟩, q.2⟩) else s noncomputable def unrestrictedBoundedEventWeight {P : Type*} (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) : ℝ := if unrestrictedResidueStorageAllowed n D s.1 e.1 ∧ (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) e.1 e.2.1 e.2.2.1).1 ≤ B then unrestrictedEdgeEventMass s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ ρ V e.1 e.2.1 e.2.2.1 e.2.2.2 else 0 theorem unrestrictedBoundedEventWeight_nonneg {P : Type*} (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) {ρ V : ℝ} (hρ : 0 ≤ ρ) (hV : 0 ≤ V) (hμ : ∀ p, 0 ≤ μ p) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) : 0 ≤ unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e := by unfold unrestrictedBoundedEventWeight split_ifs · exact unrestrictedEdgeEventMass_nonneg _ _ _ _ _ μ hρ hV hμ _ _ _ _ · exact le_rfl theorem unrestricted_bounded_operator_eq_event_sum {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (phase : UnrestrictedBoundedPhase n Δ D t B) (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : unrestrictedBoundedOperator n Δ D μ ρ V t B phase f s = ∑ e : UnrestrictedBoundedEvent n Δ D t B s, (unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e : ℂ) * phase s e.1 e.2.1 e.2.2.1 e.2.2.2 * f (unrestrictedBoundedEventTarget n Δ D t B s e) := by unfold unrestrictedBoundedOperator unrestrictedBoundedAction unrestrictedResidueEdgeAction unrestrictedEdgeAction rw [Fintype.sum_sigma] apply sum_congr rfl intro stores _ rw [Fintype.sum_sigma] apply sum_congr rfl intro promotions _ rw [Fintype.sum_prod_type] apply sum_congr rfl intro e _ apply sum_congr rfl intro fresh _ by_cases hs : unrestrictedResidueStorageAllowed n D s.1 stores · by_cases hq : (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) stores promotions e).1 ≤ B · simp [unrestrictedBoundedEventWeight, unrestrictedBoundedEventTarget, hs, hq, boundedOrderedZeroExtension] · simp [unrestrictedBoundedEventWeight, unrestrictedBoundedEventTarget, hs, hq] · simp [unrestrictedBoundedEventWeight, hs] end section open Finset Classical noncomputable def finiteLocalEventAction {I : Type*} {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (i : I) (f : X i → ℂ) (x : X i) : ℂ := ∑ e : E i x, (weight i x e : ℂ) * f (target i x e) noncomputable def finiteProductEventAction {I : Type*} [Fintype I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (phase : ∀ x : (∀ i, X i), (∀ i, E i (x i)) → ℂ) (f : (∀ i, X i) → ℂ) (x : ∀ i, X i) : ℂ := ∑ e : (∀ i, E i (x i)), ((∏ i, weight i (x i) (e i) : ℝ) : ℂ) * phase x e * f (fun i => target i (x i) (e i)) noncomputable def finiteProductEventPositive {I : Type*} [Fintype I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (f : (∀ i, X i) → ℝ) (x : ∀ i, X i) : ℝ := ∑ e : (∀ i, E i (x i)), (∏ i, weight i (x i) (e i)) * f (fun i => target i (x i) (e i)) theorem finite_product_event_positive_cast {I : Type*} [Fintype I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (f : (∀ i, X i) → ℝ) (x : ∀ i, X i) : (finiteProductEventPositive E weight target f x : ℂ) = finiteProductEventAction E weight target (fun _ _ => 1) (fun y => (f y : ℂ)) x := by simp only [finiteProductEventPositive, finiteProductEventAction, Complex.ofReal_sum, Complex.ofReal_mul, mul_one] section variable {I : Type*} [sharedInstance1 : Fintype I] {X : I → Type*} (E : ∀ i, X i → Type*) [sharedInstance4 : ∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (hweight : ∀ i x e, 0 ≤ weight i x e) (phase : ∀ x : (∀ i, X i), (∀ i, E i (x i)) → ℂ) (hphase : ∀ x e, ‖phase x e‖ ≤ 1) (f : (∀ i, X i) → ℂ) (x : ∀ i, X i) include I sharedInstance1 X E sharedInstance4 weight target hweight phase hphase f x /- A globally coupled phase is dominated by the simultaneous positive event operator. No product decomposition of the phase is assumed. -/ theorem finite_product_event_norm_le : ‖finiteProductEventAction E weight target phase f x‖ ≤ finiteProductEventPositive E weight target (fun y => ‖f y‖) x := by unfold finiteProductEventAction finiteProductEventPositive refine (norm_sum_le _ _).trans (sum_le_sum fun e _ => ?_) have hw : 0 ≤ ∏ i, weight i (x i) (e i) := prod_nonneg fun i _ => hweight i _ _ rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hw] calc _ ≤ ((∏ i, weight i (x i) (e i)) * 1) * ‖f (fun i => target i (x i) (e i))‖ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hphase x e) hw) (norm_nonneg _) _ = _ := by rw [mul_one] theorem finite_product_event_norm_le_positive_re : ‖finiteProductEventAction E weight target phase f x‖ ≤ (finiteProductEventAction E weight target (fun _ _ => 1) (fun y => (‖f y‖ : ℂ)) x).re := by rw [← finite_product_event_positive_cast, Complex.ofReal_re] exact finite_product_event_norm_le E weight target hweight phase hphase f x end end section open Finset Classical section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P Z : G → Type*} [sharedInstance4 : ∀ g, Fintype (P g)] [sharedInstance5 : ∀ g, Fintype (Z g)] {t : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (A : ∀ g, (BoundedOrderedState (P g) (Z g) (t g) B → ℂ) → BoundedOrderedState (P g) (Z g) (t g) B → ℂ) (C : G → ℝ) (hC : ∀ g, 0 ≤ C g) (hA : ∀ g f, BoundedOrderedSymmetric f → finiteWeightedEnergy (boundedOrderedStateWeight (μ g) (ν g)) (A g f) ≤ C g * finiteWeightedEnergy (boundedOrderedStateWeight (μ g) (ν g)) f) (groups : Finset G) (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) include G sharedInstance1 sharedInstance2 P Z sharedInstance4 sharedInstance5 t B μ ν hμ hν A C hC hA groups f hf theorem product_symmetric_finset_energy_le : (∑ x : ProductBoundedOrderedState P Z t B, productMemoryWeight μ ν x * ‖finiteCoordinateFinsetAction A groups f x‖ ^ 2) ≤ (∏ g ∈ groups, C g) * ∑ x : ProductBoundedOrderedState P Z t B, productMemoryWeight μ ν x * ‖f x‖ ^ 2 := by have hprojected (g : G) (q : BoundedOrderedState (P g) (Z g) (t g) B → ℂ) : finiteWeightedEnergy (boundedOrderedStateWeight (μ g) (ν g)) (A g (boundedMemorySymmetrize q)) ≤ C g * finiteWeightedEnergy (boundedOrderedStateWeight (μ g) (ν g)) q := boundedMemorySymmetrize_transfer_energy_le (μ g) (ν g) (hμ g) (hν g) (hC g) (A g) (hA g) q have h := finite_coordinate_finset_energy_le (fun g => boundedOrderedStateWeight (μ g) (ν g)) (fun g x => boundedOrderedStateWeight_nonneg (μ g) (ν g) (hμ g) (hν g) x) (fun g q => A g (boundedMemorySymmetrize q)) C hC hprojected groups f rw [product_memory_projected_finset_eq A groups f hf] at h exact h theorem product_symmetric_cutoff_sandwich_energy_le : (∑ x : ProductBoundedOrderedState P Z t B, productMemoryWeight μ ν x * ‖productMemoryCutoff (finiteCoordinateFinsetAction A groups (productMemoryCutoff f)) x‖ ^ 2) ≤ (∏ g ∈ groups, C g) * ∑ x : ProductBoundedOrderedState P Z t B, productMemoryWeight μ ν x * ‖f x‖ ^ 2 := by calc _ ≤ ∑ x : ProductBoundedOrderedState P Z t B, productMemoryWeight μ ν x * ‖finiteCoordinateFinsetAction A groups (productMemoryCutoff f) x‖ ^ 2 := productMemoryCutoff_energy_le μ ν hμ hν _ _ ≤ (∏ g ∈ groups, C g) * ∑ x : ProductBoundedOrderedState P Z t B, productMemoryWeight μ ν x * ‖productMemoryCutoff f x‖ ^ 2 := product_symmetric_finset_energy_le μ ν hμ hν A C hC hA groups (productMemoryCutoff f) (productMemoryCutoff_symmetric f hf) _ ≤ _ := mul_le_mul_of_nonneg_left (productMemoryCutoff_energy_le μ ν hμ hν f) (prod_nonneg fun g _ => hC g) end end section open Finset Classical theorem finite_coordinate_lift_preserves_own {I : Type*} [DecidableEq I] {X : I → Type*} (i : I) (R : X i → X i → Prop) (A : (X i → ℂ) → X i → ℂ) (hA : ∀ q, FiniteLocalInvariant R q → FiniteLocalInvariant R (A q)) (f : (∀ j, X j) → ℂ) (hf : FiniteCoordinateInvariant i R f) : FiniteCoordinateInvariant i R (finiteCoordinateLift i A f) := by intro x y hxy simp only [finite_coordinate_lift_eq_update, Function.update_self, Function.update_idem] exact hA _ (finite_coordinate_invariant_slice i R f hf x) (x i) y hxy theorem finite_coordinate_lift_preserves_all {I : Type*} [DecidableEq I] {X : I → Type*} (R : ∀ i, X i → X i → Prop) (j : I) (A : (X j → ℂ) → X j → ℂ) (hA : ∀ q, FiniteLocalInvariant (R j) q → FiniteLocalInvariant (R j) (A q)) (f : (∀ i, X i) → ℂ) (hf : ∀ i, FiniteCoordinateInvariant i (R i) f) : ∀ i, FiniteCoordinateInvariant i (R i) (finiteCoordinateLift j A f) := by intro i by_cases hij : i = j · subst i exact finite_coordinate_lift_preserves_own j (R j) A hA f (hf j) · exact finite_coordinate_lift_preserves_other i j hij (R i) A f (hf i) theorem finite_coordinate_compose_preserves_all {I : Type*} [DecidableEq I] {X : I → Type*} (R : ∀ i, X i → X i → Prop) (A : ∀ i, (X i → ℂ) → X i → ℂ) (hA : ∀ i q, FiniteLocalInvariant (R i) q → FiniteLocalInvariant (R i) (A i q)) (is : List I) (f : (∀ i, X i) → ℂ) (hf : ∀ i, FiniteCoordinateInvariant i (R i) f) : ∀ i, FiniteCoordinateInvariant i (R i) (finiteCoordinateCompose A is f) := by induction is with | nil => exact hf | cons j js ih => exact finite_coordinate_lift_preserves_all R j (A j) (hA j) (finiteCoordinateCompose A js f) ih section variable {G : Type*} [sharedInstance1 : DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (A : ∀ g, (BoundedOrderedState (P g) (Z g) (t g) B → ℂ) → BoundedOrderedState (P g) (Z g) (t g) B → ℂ) (hA : ∀ g q, BoundedOrderedSymmetric q → BoundedOrderedSymmetric (A g q)) include G sharedInstance1 P Z t B A hA theorem product_memory_compose_symmetric (is : List G) (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (finiteCoordinateCompose A is f) := by apply (product_memory_symmetric_iff_coordinate _).mpr apply finite_coordinate_compose_preserves_all (fun g => BoundedMemoryPermutationRelation (P := P g) (Z := Z g) (t := t g) (B := B)) A · intro g q hq exact (finite_local_memory_invariant_iff _).mpr (hA g q ((finite_local_memory_invariant_iff q).mp hq)) · exact (product_memory_symmetric_iff_coordinate f).mp hf theorem product_memory_finset_symmetric (groups : Finset G) (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (finiteCoordinateFinsetAction A groups f) := product_memory_compose_symmetric A hA groups.toList f hf end theorem product_memory_cutoff_sandwich_symmetric {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (A : ∀ g, (BoundedOrderedState (P g) (Z g) (t g) B → ℂ) → BoundedOrderedState (P g) (Z g) (t g) B → ℂ) (hA : ∀ g q, BoundedOrderedSymmetric q → BoundedOrderedSymmetric (A g q)) (groups : Finset G) (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (productMemoryCutoff (finiteCoordinateFinsetAction A groups (productMemoryCutoff f))) := productMemoryCutoff_symmetric _ (product_memory_finset_symmetric A hA groups (productMemoryCutoff f) (productMemoryCutoff_symmetric f hf)) end section noncomputable def finiteOperatorListAction {E X : Type*} (A : E → (X → ℂ) → X → ℂ) : List E → (X → ℂ) → X → ℂ | [], f => f | e :: es, f => A e (finiteOperatorListAction A es f) theorem finite_operator_list_preserves {E X : Type*} (S : (X → ℂ) → Prop) (A : E → (X → ℂ) → X → ℂ) (hA : ∀ e f, S f → S (A e f)) (es : List E) (f : X → ℂ) (hf : S f) : S (finiteOperatorListAction A es f) := by induction es with | nil => exact hf | cons e es ih => exact hA e _ ih theorem finite_operator_list_energy_le {E X : Type*} [Fintype X] (μ : X → ℝ) (S : (X → ℂ) → Prop) (A : E → (X → ℂ) → X → ℂ) (hS : ∀ e f, S f → S (A e f)) (C : E → ℝ) (hC : ∀ e, 0 ≤ C e) (hA : ∀ e f, S f → finiteWeightedEnergy μ (A e f) ≤ C e * finiteWeightedEnergy μ f) (es : List E) (f : X → ℂ) (hf : S f) : finiteWeightedEnergy μ (finiteOperatorListAction A es f) ≤ (es.map C).prod * finiteWeightedEnergy μ f := by induction es with | nil => simp [finiteOperatorListAction] | cons e es ih => calc _ ≤ C e * finiteWeightedEnergy μ (finiteOperatorListAction A es f) := hA e _ (finite_operator_list_preserves S A hS es f hf) _ ≤ C e * ((es.map C).prod * finiteWeightedEnergy μ f) := mul_le_mul_of_nonneg_left ih (hC e) _ = _ := by simp only [List.map_cons, List.prod_cons, mul_assoc] end section open Finset Classical end section open Finset Classical noncomputable def finiteFiberEnergy {C : Type*} [Fintype C] {X : C → Type*} [∀ c, Fintype (X c)] (κ : C → ℝ) (μ : ∀ c, X c → ℝ) (f : ∀ c, X c → ℂ) : ℝ := ∑ c, κ c * finiteWeightedEnergy (μ c) (f c) /- Averaging under a subprobability law contracts the average squared norm. -/ theorem finite_subprobability_average_energy_le {A X : Type*} [Fintype A] [Fintype X] (ν : A → ℝ) (μ : X → ℝ) (hν : ∀ a, 0 ≤ ν a) (hνmass : ∑ a, ν a ≤ 1) (hμ : ∀ x, 0 ≤ μ x) (F : A → X → ℂ) : finiteWeightedEnergy μ (fun x => ∑ a, (ν a : ℂ) * F a x) ≤ ∑ a, ν a * finiteWeightedEnergy μ (F a) := by have hpoint (x : X) : ‖∑ a, (ν a : ℂ) * F a x‖ ^ 2 ≤ ∑ a, ν a * ‖F a x‖ ^ 2 := by calc _ ≤ (∑ a, ν a) * ∑ a, ν a * ‖F a x‖ ^ 2 := finite_weighted_sum_cauchy univ ν (fun a _ => hν a) (fun a => F a x) _ ≤ 1 * ∑ a, ν a * ‖F a x‖ ^ 2 := mul_le_mul_of_nonneg_right hνmass (sum_nonneg fun a _ => mul_nonneg (hν a) (sq_nonneg _)) _ = _ := one_mul _ unfold finiteWeightedEnergy calc _ ≤ ∑ x, μ x * ∑ a, ν a * ‖F a x‖ ^ 2 := sum_le_sum fun x _ => mul_le_mul_of_nonneg_left (hpoint x) (hμ x) _ = ∑ a, ν a * ∑ x, μ x * ‖F a x‖ ^ 2 := by simp only [mul_sum] rw [sum_comm] apply sum_congr rfl intro a _ apply sum_congr rfl intro x _ ring end section open scoped BigOperators section variable (z : ℂ) (hz : ‖z‖ = 1) include z hz theorem unit_geometric_sum_norm_le_length (N : ℕ) : ‖∑ n ∈ Finset.range N, z ^ n‖ ≤ N := by calc _ ≤ ∑ n ∈ Finset.range N, ‖z ^ n‖ := norm_sum_le _ _ _ = N := by simp [norm_pow, hz] theorem unit_geometric_sum_norm_mul_chord_le (N : ℕ) : ‖∑ n ∈ Finset.range N, z ^ n‖ * ‖z - 1‖ ≤ 2 := by calc _ = ‖(∑ n ∈ Finset.range N, z ^ n) * (z - 1)‖ := (norm_mul _ _).symm _ = ‖z ^ N - 1‖ := by rw [geom_sum_mul] _ ≤ ‖z ^ N‖ + ‖(1 : ℂ)‖ := norm_sub_le _ _ _ = 2 := by simpa only [norm_pow, hz, one_pow, norm_one] using (show (1:ℝ)+1=2 by norm_num) theorem unit_geometric_sum_norm_le_min (hne : z ≠ 1) (N : ℕ) : ‖∑ n ∈ Finset.range N, z ^ n‖ ≤ min (N : ℝ) (2 / ‖z - 1‖) := by refine le_min (unit_geometric_sum_norm_le_length z hz N) ?_ exact (le_div_iff₀ (norm_pos_iff.mpr (sub_ne_zero.mpr hne))).mpr (unit_geometric_sum_norm_mul_chord_le z hz N) theorem unit_geometric_interval_norm_le_min (hne : z ≠ 1) (a N : ℕ) : ‖∑ n ∈ Finset.range N, z ^ (a + n)‖ ≤ min (N : ℝ) (2 / ‖z - 1‖) := by simp_rw [pow_add] rw [← Finset.mul_sum, norm_mul, norm_pow, hz, one_pow, one_mul] exact unit_geometric_sum_norm_le_min z hz hne N end end section open scoped BigOperators InnerProductSpace theorem finite_matrix_gram_energy_le {X Y : Type*} [Fintype X] [Fintype Y] (K : X → Y → ℂ) (b : Y → ℂ) {B : ℝ} (hrow : ∀ y, (∑ z, ‖∑ x, (starRingEnd ℂ) (K x y) * K x z‖) ≤ B) : (∑ x, ‖∑ y, K x y * b y‖ ^ 2) ≤ B * ∑ y, ‖b y‖ ^ 2 := by let u : Y → EuclideanSpace ℂ X := fun y => finiteMeasureVector (fun _ => 1) (fun x => K x y) have hg := finite_gram_row_norm_sq u b (fun y => by simpa only [u, finite_measure_vector_inner _ (fun _ => zero_le_one), Complex.ofReal_one, one_mul] using hrow y) have hu : (∑ y, b y • u y) = finiteMeasureVector (fun _ => 1) (fun x => ∑ y, K x y * b y) := by apply PiLp.ext intro x simp only [u, WithLp.ofLp_sum, Finset.sum_apply, PiLp.smul_apply, finite_measure_vector_apply, Real.sqrt_one, Complex.ofReal_one, one_mul, smul_eq_mul] apply Finset.sum_congr rfl intro y _ exact mul_comm _ _ rw [hu, finite_measure_vector_norm_sq _ (fun _ => zero_le_one)] at hg simpa only [one_mul] using hg theorem finite_bilinear_gram_norm_sq_le {X Y : Type*} [Fintype X] [Fintype Y] (K : X → Y → ℂ) (a : X → ℂ) (b : Y → ℂ) {B : ℝ} (hrow : ∀ y, (∑ z, ‖∑ x, (starRingEnd ℂ) (K x y) * K x z‖) ≤ B) : ‖∑ x, ∑ y, a x * b y * K x y‖ ^ 2 ≤ B * (∑ x, ‖a x‖ ^ 2) * ∑ y, ‖b y‖ ^ 2 := by let f : X → ℂ := fun x => ∑ y, K x y * b y let u := finiteMeasureVector (fun _ : X => 1) (fun x => (starRingEnd ℂ) (a x)) let v := finiteMeasureVector (fun _ : X => 1) f have hi : inner ℂ u v = ∑ x, ∑ y, a x * b y * K x y := by rw [finite_measure_vector_inner _ (fun _ => zero_le_one)] simp only [Complex.ofReal_one, one_mul, RingHomCompTriple.comp_apply, RingHom.id_apply, f, Finset.mul_sum] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ ring have hc : ‖inner ℂ u v‖ ^ 2 ≤ ‖u‖ ^ 2 * ‖v‖ ^ 2 := by simpa only [mul_pow] using (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _))).mpr (norm_inner_le_norm u v) rw [hi] at hc have hu : ‖u‖ ^ 2 = ∑ x, ‖a x‖ ^ 2 := by simp only [u, finite_measure_vector_norm_sq _ (fun _ => zero_le_one), Complex.norm_conj, one_mul] have hv : ‖v‖ ^ 2 = ∑ x, ‖f x‖ ^ 2 := by simp only [v, finite_measure_vector_norm_sq _ (fun _ => zero_le_one), one_mul] rw [hu, hv] at hc have hg := finite_matrix_gram_energy_le K b hrow calc _ ≤ (∑ x, ‖a x‖ ^ 2) * ∑ x, ‖f x‖ ^ 2 := hc _ ≤ (∑ x, ‖a x‖ ^ 2) * (B * ∑ y, ‖b y‖ ^ 2) := mul_le_mul_of_nonneg_left hg (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) _ = _ := by ring end section open Finset Filter open scoped Topology theorem eventually_candidate_P_pool_below_rough_cutoff {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ p ∈ (candidatePIndices c L).biUnion (candidatePBand (c * L)), (p : ℝ) ≤ Real.exp (Real.sqrt L) := by obtain ⟨v, V, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool] with L hL intro p hp obtain ⟨j, hj, hpj⟩ := mem_biUnion.mp hp have hu := ((hL.2.2.2.2.2 j hj).2.2 p hpj).2.2 refine hu.trans (Real.exp_le_exp.mpr ?_) rw [Real.sqrt_eq_rpow] exact Real.rpow_le_rpow_of_exponent_le hL.1 (by norm_num) section variable {c L : ℝ} {r jStar : ℕ} (hcL : 0 ≤ c * L) (hpool : ∀ p ∈ (candidatePIndices c L).biUnion (candidatePBand (c * L)), (p : ℝ) ≤ Real.exp (Real.sqrt L)) include c L r jStar hcL hpool theorem candidate_Q_slot_primeFactors_disjoint (slot : (candidateQIndices c L) × Fin r) {n : ℕ} (hn : n ∈ candidateQSlotChoices c L r jStar slot) : Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c * L))) := by apply disjoint_left.mpr intro p hp hP simp only [candidateQSlotChoices] at hn split_ifs at hn with hs · exact (not_lt_of_ge (hpool p hP)) ((mem_filter.mp hn).2 p hp) · have hnPrime : n.Prime := (mem_filter.mp hn).2 have hpPrime := Nat.mem_primeFactors.mp hp have hpn : p = n := ((Nat.dvd_prime hnPrime).mp hpPrime.2.1).resolve_left hpPrime.1.ne_one subst p obtain ⟨j, _, hnj⟩ := mem_biUnion.mp hP exact disjoint_left.mp (disjoint_candidatePBand_candidateQBand hcL j slot.1.val) hnj hn theorem candidate_Q_tuple_primeFactors_disjoint (x : ∀ slot, candidateQSlotChoices c L r jStar slot) : Disjoint (orderedSlotProduct (candidateQSlotChoices c L r jStar) x).primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c * L))) := by classical apply disjoint_left.mpr intro p hp hP obtain ⟨hpp, hpdvd, _⟩ := Nat.mem_primeFactors.mp hp obtain ⟨slot, _, hpslot⟩ := ((Nat.prime_iff.mp hpp).dvd_finsetProd_iff (fun slot => (x slot).val)).mp hpdvd have hmem : p ∈ (x slot).val.primeFactors := Nat.mem_primeFactors.mpr ⟨hpp, hpslot, candidate_Q_slot_nonzero c L r jStar slot (x slot).property⟩ exact disjoint_left.mp (candidate_Q_slot_primeFactors_disjoint hcL hpool slot (x slot).property) hmem hP end theorem ordered_slot_weight_ne_zero_support {I : Type*} [Fintype I] (choices : I → Finset ℕ) (N : ℝ) {n : ℕ} (hn : orderedSlotWeight choices N n ≠ 0) : ∃ x : ∀ i, choices i, orderedSlotProduct choices x = n := by classical by_contra h push Not at h apply hn unfold orderedSlotWeight exact sum_eq_zero (fun x _ => if_neg (h x)) theorem eventually_candidate_Q_weight_free_support {c : ℝ} (hc : 0 < c) (r : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ jStar n : ℕ, candidateQWeight c L r jStar n ≠ 0 → n ≠ 0 ∧ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c * L))) := by filter_upwards [eventually_candidate_P_pool_below_rough_cutoff hc, eventually_ge_atTop (0 : ℝ)] with L hp hL intro jStar n hn obtain ⟨x, hx⟩ := ordered_slot_weight_ne_zero_support _ _ hn refine ⟨?_, ?_⟩ · rw [← hx] exact prod_ne_zero_iff.mpr (fun slot _ => candidate_Q_slot_nonzero c L r jStar slot (x slot).property) · rw [← hx] exact candidate_Q_tuple_primeFactors_disjoint (mul_nonneg hc.le hL) hp x end section open Finset theorem supported_free_window_convolution_le (P S : Finset ℕ) (a b W : ℕ → ℝ) (X : ℝ) (hS : ∀ p ∈ S, p ∈ Nat.factoredNumbers P) (hb : ∀ n, b n ≠ 0 → n ≠ 0 ∧ Disjoint n.primeFactors P) (hW : ∀ u ∈ arithmeticProductWindow 1 X, 0 ≤ W u) (hprod : ∀ p ∈ S, ∀ n, b n ≠ 0 → W (p * n) = a p * b n) : (∑ p ∈ S, a p * ∑ n ∈ arithmeticProductWindow p X, b n) ≤ ∑ u ∈ arithmeticProductWindow 1 X, W u := by classical let T : Finset (Σ _p : ℕ, ℕ) := S.sigma (fun p => (arithmeticProductWindow p X).filter (fun n => b n ≠ 0)) let f : (Σ _p : ℕ, ℕ) → ℕ := fun z => z.1 * z.2 have hinj : Set.InjOn f T := by intro x hx y hy hxy have hx' := mem_sigma.mp hx have hy' := mem_sigma.mp hy have hbx := hb x.2 (mem_filter.mp hx'.2).2 have hby := hb y.2 (mem_filter.mp hy'.2).2 obtain ⟨hp, hn⟩ := supported_free_product_unique (hS x.1 hx'.1) hbx.1 hbx.2 (hS y.1 hy'.1) hby.1 hby.2 hxy exact Sigma.ext hp (heq_of_eq hn) have hsubset : T.image f ⊆ arithmeticProductWindow 1 X := by intro u hu obtain ⟨z, hz, rfl⟩ := mem_image.mp hu have hz' := mem_sigma.mp hz have hwindow := (mem_filter.mp hz'.2).1 have hp0 := Nat.ne_zero_of_mem_factoredNumbers (hS z.1 hz'.1) have hrange := (mem_arithmeticProductWindow_iff hp0 X).mp hwindow apply (mem_arithmeticProductWindow_iff one_ne_zero X).mpr simpa only [one_mul, f] using hrange calc _ = ∑ z ∈ T, W (f z) := by dsimp only [T, f] rw [sum_sigma] apply sum_congr rfl intro p hp rw [← sum_filter_ne_zero (arithmeticProductWindow p X), mul_sum] apply sum_congr rfl intro n hn exact (hprod p hp n (mem_filter.mp hn).2).symm _ = ∑ u ∈ T.image f, W u := (sum_image hinj).symm _ ≤ _ := sum_le_sum_of_subset_of_nonneg hsubset (fun u hu _ => hW u hu) end section open Finset theorem prime_group_slot_harmonic_atom_rpow {G Ω : Type*} [Fintype G] [Fintype Ω] (P : G → Finset ℕ) (k : G → ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : Ω → ∀ g, Fin (k g) → ℕ) (hxinj : Function.Injective x) (hx : ∀ a g i, x a g i ∈ P g) (V : G → ℝ) (m : ℕ) {v L D : ℝ} (hv : 0 < v) (hL : 0 < L) (hV : ∀ g, v ≤ V g) (hk : ∀ g, k g ≤ m) (hcard : (Fintype.card G : ℝ) ≤ D * Real.log L) (n : ℕ) : (∑ a : Ω, if (∏ g, ∏ i, x a g i) = n then (∏ g, ∏ i, (1 / (x a g i : ℝ)) / V g) else 0) ≤ L^(D * Real.log (primeFiberFactorBound v m)) / (n : ℝ) := by calc _ ≤ (1 / (n : ℝ)) * ∏ g, ((k g).factorial : ℝ) / (V g)^(k g) := prime_group_slot_harmonic_atom_bound P k hprime hdisj x hxinj hx V (fun g => hv.le.trans (hV g)) n _ ≤ (1 / (n : ℝ)) * L^(D * Real.log (primeFiberFactorBound v m)) := mul_le_mul_of_nonneg_left (prime_fiber_factor_fintype_product_le_rpow V k m hv hL hV hk hcard) (by positivity) _ = _ := by ring end section open Finset open scoped Classical end section open Finset /- The actual step matrix, indexed by output then input. Its output-memory cutoff is part of the matrix entry. -/ noncomputable def globalBirthRawStepKernel {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {a b : P → Bool} (step : GlobalBirthRawStep (R := R) a b) (z w : (p : P) → GhostPhaseState (R p)) : ℂ := by classical cases step with | visit h β η V ρ hV cap => exact if (ghostPhasePendingSupport z).card ≤ cap then ((∏ p, ghostPhaseDampedVisit (a p) (h p) η (β p) ρ (z p) (w p) : ℝ) : ℂ) else 0 | edge delta hshared source target hsource htarget β ρ V cap => exact if (ghostPhasePendingSupport z).card ≤ cap then ((∏ p, (if b p && !(a p) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (b p) (a p) (delta p) (β p) ρ ρ (z p) (w p) : ℝ) : ℂ) else 0 /- The existing phase row is exactly pullback by the extracted step matrix. -/ theorem global_birth_raw_step_phase_row_eq {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {a b : P → Bool} (step : GlobalBirthRawStep (R := R) a b) (F : ((p : P) → GhostPhaseState (R p)) → ℂ) (w : (p : P) → GhostPhaseState (R p)) : globalBirthRawStepPhaseRow step F w = ∑ z, globalBirthRawStepKernel step z w * F z := by cases step <;> simp only [globalBirthRawStepPhaseRow, globalBirthRawStepKernel] all_goals apply sum_congr rfl intro z _ split_ifs <;> simp section History variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : ℕ → P → Bool) (steps : ∀ i, GlobalBirthRawStep (R := R) (a i) (a (i + 1))) end History end section open Finset open scoped Classical /- The actual repeated-list kernel with just the two auxiliary collision bans removed. -/ noncomputable def repeatedBigUnbannedKernel {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (source target : RepeatedBigLists P J ell) : ℂ := if repeatedBigSharedCompatible C source target then ((physicalAuxMass V C aux * repeatedBigTargetMass V b C target : ℝ) : ℂ) * K source target aux * physicalPhase ζ (repeatedBigD C source aux) else 0 section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) include G sharedInstance1 P J ell V theorem repeated_big_ban_difference_norm_le (C : G → Finset (Fin J)) (hV : ∀ g, 0 ≤ V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (_hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) (aux : PhysicalAuxLabels P C) (source target : RepeatedBigLists P J ell) : ‖repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K aux source target - repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖ ≤ B * (if repeatedBigSharedCompatible C source target then repeatedBigTargetMass V (fun _ _ => 1) C target else 0) * (physicalAuxMass V C aux * (if ¬(repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target) then 1 else 0)) := by have ha := physical_aux_mass_nonneg V C hV aux have ht := repeated_big_untilted_target_mass_nonneg V hV C target by_cases hs : repeatedBigSharedCompatible C source target · by_cases hb : repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target · simp [repeatedBigUnbannedKernel, repeatedBigKernel, hs, hb] · simp only [repeatedBigUnbannedKernel, repeatedBigKernel, hs, true_and, if_true, hb, if_false, not_false_eq_true, sub_zero, mul_one, norm_mul, physical_phase_norm, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg ha, abs_of_nonneg ht] calc _ ≤ (physicalAuxMass V C aux * repeatedBigTargetMass V (fun _ _ => 1) C target) * B := mul_le_mul_of_nonneg_left (hK source target aux) (mul_nonneg ha ht) _ = _ := by ring · simp [repeatedBigUnbannedKernel, repeatedBigKernel, hs] /- Summing all free-label collisions costs only the total number of endpoint comparisons. -/ theorem repeated_big_ban_difference_absolute_row_bound (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (source : RepeatedBigLists P J ell) : (∑ aux, ∑ target, ‖repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K aux source target - repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖) ≤ B * ∑ g, (C g).card * (2 * (J + ell : ℕ)) / (V g * Pmin) := by let δ : ℝ := ∑ g, (C g).card * (2 * (J + ell : ℕ)) / (V g * Pmin) let mass (target : RepeatedBigLists P J ell) : ℝ := if repeatedBigSharedCompatible C source target then repeatedBigTargetMass V (fun _ _ => 1) C target else 0 have hm (target) : 0 ≤ mass target := by dsimp [mass] split_ifs · exact repeated_big_untilted_target_mass_nonneg V (fun g => (hV g).le) C target · exact le_rfl calc _ = ∑ target, ∑ aux, ‖repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K aux source target - repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖ := sum_comm _ ≤ ∑ target, B * mass target * δ := by apply sum_le_sum intro target ht calc _ ≤ ∑ aux, B * mass target * (physicalAuxMass V C aux * (if ¬(repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target) then 1 else 0)) := sum_le_sum (fun aux _ => repeated_big_ban_difference_norm_le V C (fun g => (hV g).le) ζ K B hB hK aux source target) _ = B * mass target * ∑ aux, physicalAuxMass V C aux * (if ¬(repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux target) then 1 else 0) := (mul_sum _ _ _).symm _ ≤ _ := mul_le_mul_of_nonneg_left (repeated_big_auxiliary_collision_mass_le V C hV hMass source target hPmin hp) (mul_nonneg hB (hm target)) _ = B * δ := by rw [← sum_mul, ← mul_sum] dsimp [mass] rw [repeated_big_untilted_compatible_target_mass_sum V C hV hMass source, mul_one] theorem repeated_big_unbanned_kernel_weighted_transpose (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (source target : RepeatedBigLists P J ell) : (repeatedBigActiveMass V b source : ℂ) * repeatedBigUnbannedKernel V b C ζ K aux source target = (repeatedBigActiveMass V b target : ℂ) * repeatedBigUnbannedKernel V b C ζ (fun x y a => K y x a) aux target source := by unfold repeatedBigUnbannedKernel by_cases hs : repeatedBigSharedCompatible C source target · rw [if_pos hs, if_pos (repeated_big_shared_compatible_symm C hs), ← repeated_big_D_eq_of_shared C hs aux] have hm := congrArg (fun x : ℝ => (x : ℂ)) (repeated_big_active_target_mass_balance V b C hs) push_cast at hm ⊢ linear_combination (physicalAuxMass V C aux : ℂ) * K source target aux * physicalPhase ζ (repeatedBigD C source aux) * hm · have hr : ¬ repeatedBigSharedCompatible C target source := fun h => hs (repeated_big_shared_compatible_symm C h) rw [if_neg hs, if_neg hr, mul_zero, mul_zero] end section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) include G sharedInstance1 P J ell V C hV hMass ζ K B hB hK Pmin hPmin hp theorem repeated_big_ban_difference_row_bound (source : RepeatedBigLists P J ell) : (∑ target, ‖∑ aux, (repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K aux source target - repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target)‖) ≤ B * ∑ g, (C g).card * (2 * (J + ell : ℕ)) / (V g * Pmin) := by calc _ ≤ ∑ target, ∑ aux, ‖repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K aux source target - repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖ := sum_le_sum (fun target _ => norm_sum_le _ _) _ = ∑ aux, ∑ target, ‖repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K aux source target - repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target‖ := sum_comm _ ≤ _ := repeated_big_ban_difference_absolute_row_bound V C hV hMass ζ K B hB hK hPmin hp source /- Removing the two actual auxiliary bans costs the global collision probability in the true product-weighted active norm. No operator bound is assumed. -/ theorem repeated_big_ban_removal_operator_error (f : RepeatedBigLists P J ell → ℂ) : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (fun source => ∑ target, (∑ aux, (repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K aux source target - repeatedBigKernel V (fun _ _ => 1) C ζ K aux source target)) * f target) ≤ (B * ∑ g, (C g).card * (2 * (J + ell : ℕ)) / (V g * Pmin)) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f := by let δ : ℝ := ∑ g, (C g).card * (2 * (J + ell : ℕ)) / (V g * Pmin) have hδ : 0 ≤ δ := by apply sum_nonneg intro g hg exact div_nonneg (mul_nonneg (Nat.cast_nonneg _) (mul_nonneg (by norm_num) (Nat.cast_nonneg _))) (mul_nonneg (hV g).le hPmin.le) let E (K' : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (source target : RepeatedBigLists P J ell) : ℂ := ∑ aux, (repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K' aux source target - repeatedBigKernel V (fun _ _ => 1) C ζ K' aux source target) have htrans (source target : RepeatedBigLists P J ell) : (repeatedBigActiveMass V (fun _ _ => 1) source : ℂ) * E K source target = (repeatedBigActiveMass V (fun _ _ => 1) target : ℂ) * E (fun x y a => K y x a) target source := by unfold E rw [mul_sum, mul_sum] apply sum_congr rfl intro aux ha rw [mul_sub, mul_sub, repeated_big_unbanned_kernel_weighted_transpose V (fun _ _ => 1) C ζ K aux source target, repeated_big_kernel_weighted_transpose V (fun _ _ => 1) C ζ K aux source target] have hr (source : RepeatedBigLists P J ell) : ∑ target, ‖E K source target‖ ≤ B * δ := repeated_big_ban_difference_row_bound V C hV hMass ζ K B hB hK hPmin hp source have hr' (target : RepeatedBigLists P J ell) : ∑ source, ‖E (fun x y a => K y x a) target source‖ ≤ B * δ := repeated_big_ban_difference_row_bound V C hV hMass ζ (fun x y a => K y x a) B hB (fun x y a => hK y x a) hPmin hp target have h := finite_weighted_schur_of_transpose univ (repeatedBigActiveMass V (fun _ _ => 1)) (fun _ => 1) (E K) (E (fun x y a => K y x a)) (fun source _ => repeated_big_untilted_active_mass_nonneg V (fun g => (hV g).le) source) (fun _ _ => zero_lt_one) (fun source _ target _ => htrans source target) (fun source _ => by simpa only [mul_one] using hr source) (fun target _ => by simpa only [mul_one] using hr' target) f have hs := Real.sqrt_le_sqrt h simpa only [cleanActiveNorm, E, ← pow_two, Real.sqrt_mul (sq_nonneg (B * δ)), Real.sqrt_sq (mul_nonneg hB hδ)] using hs end end section end section open Finset Classical theorem finite_local_event_compose_sum {I K : Type*} [DecidableEq I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (is : List I) (s : Finset K) (f : K → (∀ i, X i) → ℂ) (x : ∀ i, X i) : finiteCoordinateCompose (finiteLocalEventAction E weight target) is (fun y => ∑ k ∈ s, f k y) x = ∑ k ∈ s, finiteCoordinateCompose (finiteLocalEventAction E weight target) is (f k) x := by induction is generalizing x with | nil => rfl | cons i is ih => simp only [finiteCoordinateCompose, finite_coordinate_lift_eq_update, finiteLocalEventAction] simp_rw [ih, mul_sum] rw [sum_comm] theorem finite_local_event_compose_const_mul {I : Type*} [DecidableEq I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (is : List I) (c : ℂ) (f : (∀ i, X i) → ℂ) (x : ∀ i, X i) : finiteCoordinateCompose (finiteLocalEventAction E weight target) is (fun y => c * f y) x = c * finiteCoordinateCompose (finiteLocalEventAction E weight target) is f x := by induction is generalizing x with | nil => rfl | cons i is ih => simp only [finiteCoordinateCompose, finite_coordinate_lift_eq_update, finiteLocalEventAction] simp_rw [ih, ← mul_assoc, mul_comm _ c, mul_assoc] rw [mul_sum] theorem finite_local_event_lift_prod {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (i : I) (φ : ∀ i, X i → ℂ) (x : ∀ i, X i) : finiteCoordinateLift i (finiteLocalEventAction E weight target i) (fun y => ∏ j, φ j (y j)) x = ∏ j, if j = i then finiteLocalEventAction E weight target j (φ j) (x j) else φ j (x j) := by rw [finite_coordinate_lift_eq_update, Fintype.prod_eq_mul_prod_compl i] simp only [ite_true] have hprod (y : X i) : (∏ j, φ j (Function.update x i y j)) = φ i y * ∏ j ∈ {i}ᶜ, φ j (x j) := by rw [Fintype.prod_eq_mul_prod_compl i] simp only [Function.update_self] congr 1 apply prod_congr rfl intro j hj exact congrArg (φ j) (Function.update_of_ne (by simpa using hj) _ _) have hrest : (∏ j ∈ {i}ᶜ, if j = i then finiteLocalEventAction E weight target j (φ j) (x j) else φ j (x j)) = ∏ j ∈ {i}ᶜ, φ j (x j) := by apply prod_congr rfl intro j hj exact if_neg (by simpa using hj) rw [hrest] simp only [finiteLocalEventAction, hprod, ← mul_assoc, sum_mul] theorem finite_local_event_compose_prod {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (is : List I) (his : is.Nodup) (φ : ∀ i, X i → ℂ) (x : ∀ i, X i) : finiteCoordinateCompose (finiteLocalEventAction E weight target) is (fun y => ∏ j, φ j (y j)) x = ∏ j, if j ∈ is then finiteLocalEventAction E weight target j (φ j) (x j) else φ j (x j) := by induction is generalizing x with | nil => simp [finiteCoordinateCompose] | cons i is ih => have hi : i ∉ is := (List.nodup_cons.mp his).1 have htail : is.Nodup := (List.nodup_cons.mp his).2 simp only [finiteCoordinateCompose] have hfun : finiteCoordinateCompose (finiteLocalEventAction E weight target) is (fun y => ∏ j, φ j (y j)) = fun y => ∏ j, (if j ∈ is then finiteLocalEventAction E weight target j (φ j) else φ j) (y j) := by funext y simpa only [ite_apply] using ih htail y rw [hfun, finite_local_event_lift_prod] apply prod_congr rfl intro j hj by_cases hji : j = i · subst j simp [hi] · simp [hji, ite_apply] theorem finite_local_event_finset_sum {I K : Type*} [DecidableEq I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (s : Finset I) (u : Finset K) (f : K → (∀ i, X i) → ℂ) (x : ∀ i, X i) : finiteCoordinateFinsetAction (finiteLocalEventAction E weight target) s (fun y => ∑ k ∈ u, f k y) x = ∑ k ∈ u, finiteCoordinateFinsetAction (finiteLocalEventAction E weight target) s (f k) x := finite_local_event_compose_sum E weight target s.toList u f x theorem finite_local_event_finset_const_mul {I : Type*} [DecidableEq I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (s : Finset I) (c : ℂ) (f : (∀ i, X i) → ℂ) (x : ∀ i, X i) : finiteCoordinateFinsetAction (finiteLocalEventAction E weight target) s (fun y => c * f y) x = c * finiteCoordinateFinsetAction (finiteLocalEventAction E weight target) s f x := finite_local_event_compose_const_mul E weight target s.toList c f x theorem finite_local_event_finset_prod {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (s : Finset I) (φ : ∀ i, X i → ℂ) (x : ∀ i, X i) : finiteCoordinateFinsetAction (finiteLocalEventAction E weight target) s (fun y => ∏ j, φ j (y j)) x = ∏ j, if j ∈ s then finiteLocalEventAction E weight target j (φ j) (x j) else φ j (x j) := by simpa only [finiteCoordinateFinsetAction, mem_toList] using finite_local_event_compose_prod E weight target s.toList s.nodup_toList φ x theorem finite_local_event_univ_prod {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (φ : ∀ i, X i → ℂ) (x : ∀ i, X i) : finiteCoordinateFinsetAction (finiteLocalEventAction E weight target) univ (fun y => ∏ j, φ j (y j)) x = ∏ j, finiteLocalEventAction E weight target j (φ j) (x j) := by simpa only [mem_univ, ite_true] using finite_local_event_finset_prod E weight target univ φ x end section open Finset Classical abbrev UnrestrictedProductPhase {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (t : G → ℕ) (B : ℕ) := ∀ s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B, (∀ g, UnrestrictedBoundedEvent (n g) (Δ g) (D g) (t g) B (s g)) → ℂ noncomputable def unrestrictedCoupledProductOperator {G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (phase : UnrestrictedProductPhase n Δ D t B) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) := finiteProductEventAction (fun g => UnrestrictedBoundedEvent (n g) (Δ g) (D g) (t g) B) (fun g => unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B) (fun g => unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B) phase f noncomputable def unrestrictedCoupledCutoffProductOperator {G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (phase : UnrestrictedProductPhase n Δ D t B) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) := productMemoryCutoff (unrestrictedCoupledProductOperator n Δ D μ ρ V t B phase (productMemoryCutoff f)) theorem unrestricted_coupled_product_norm_le_positive {G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) {ρ : ℝ} (V : G → ℝ) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ V g) (hμ : ∀ g p, 0 ≤ μ g p) (t : G → ℕ) (B : ℕ) (phase : UnrestrictedProductPhase n Δ D t B) (hphase : ∀ s e, ‖phase s e‖ ≤ 1) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : ‖unrestrictedCoupledProductOperator n Δ D μ ρ V t B phase f s‖ ≤ ‖unrestrictedCoupledProductOperator n Δ D μ ρ V t B (fun _ _ => 1) (complexNormEnvelope f) s‖ := by exact (finite_product_event_norm_le_positive_re (fun g => UnrestrictedBoundedEvent (n g) (Δ g) (D g) (t g) B) (fun g => unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B) (fun g => unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B) (fun g x e => unrestrictedBoundedEventWeight_nonneg (n g) (Δ g) (D g) (μ g) hρ (hV g) (hμ g) (t g) B x e) phase hphase f s).trans (Complex.re_le_norm _) end section theorem unrestricted_bounded_one_symmetric {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) (hf : BoundedOrderedSymmetric f) : BoundedOrderedSymmetric (unrestrictedBoundedOperator n Δ D μ ρ V t B (fun _ _ _ _ _ => 1) f) := by intro active N q τ exact unrestricted_residue_edge_one_symmetric n Δ D active μ ρ V B (boundedOrderedZeroExtension f) ((boundedOrderedZeroExtension_symmetric_iff f).mpr hf) N.val q τ section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Type*} [sharedInstance4 : ∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [sharedInstance6 : ∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (groups : Finset G) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) include G sharedInstance1 sharedInstance2 P sharedInstance4 n sharedInstance6 Δ D μ ρ V t B groups f hf theorem unrestricted_positive_product_symmetric : ProductMemorySymmetric (unrestrictedProductOperator n Δ D μ ρ V t B (fun _ _ _ _ _ _ => 1) groups f) := by exact product_memory_finset_symmetric (fun g => unrestrictedBoundedOperator (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (fun _ _ _ _ _ => 1)) (fun g q hq => unrestricted_bounded_one_symmetric (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B q hq) groups f hf theorem unrestricted_positive_cutoff_product_symmetric : ProductMemorySymmetric (unrestrictedCutoffProductOperator n Δ D μ ρ V t B (fun _ _ _ _ _ _ => 1) groups f) := by exact productMemoryCutoff_symmetric _ (unrestricted_positive_product_symmetric n Δ D μ ρ V t B groups (productMemoryCutoff f) (productMemoryCutoff_symmetric f hf)) end end section open Finset Classical end section open scoped BigOperators theorem norm_circle_phase_sub_one_ge (x : ℝ) : 4 * ‖(x : UnitAddCircle)‖ ≤ ‖Complex.exp (Complex.I * (2 * Real.pi * x : ℝ)) - 1‖ := by rw [Complex.norm_exp_I_mul_ofReal_sub_one, UnitAddCircle.norm_eq, Real.norm_eq_abs, abs_mul, abs_of_pos (show (0 : ℝ) < 2 by norm_num)] have hhalf := abs_sub_round x have harg : |Real.pi * (x - round x)| ≤ Real.pi / 2 := by rw [abs_mul, abs_of_pos Real.pi_pos] nlinarith [Real.pi_pos] have hsin := Real.mul_abs_le_abs_sin harg have habs : |Real.sin (Real.pi * (x - round x))| = |Real.sin (Real.pi * x)| := by rw [mul_sub, mul_comm Real.pi (round x : ℝ), Real.sin_sub_int_mul_pi, abs_mul, abs_zpow, abs_neg, abs_one, one_zpow, one_mul] rw [habs, abs_mul, abs_of_pos Real.pi_pos] at hsin have hpi : 2 / Real.pi * (Real.pi * |x - round x|) = 2 * |x - round x| := by field_simp rw [hpi] at hsin have he : 2 * Real.pi * x / 2 = Real.pi * x := by ring rw [he] linarith theorem norm_circle_phase_sub_one_pos (x : ℝ) (hx : (x : UnitAddCircle) ≠ 0) : 0 < ‖Complex.exp (Complex.I * (2 * Real.pi * x : ℝ)) - 1‖ := by exact lt_of_lt_of_le (mul_pos (by norm_num) (norm_pos_iff.mpr hx)) (norm_circle_phase_sub_one_ge x) end section open Finset Filter open scoped Topology noncomputable def candidateCoefficient (c L q : ℝ) (r jStar u : ℕ) : ℝ := candidateQWeight c L r jStar (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c * L))) u) * markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ p ∈ candidatePBand (c * L) j, 1 / (p : ℝ)) (fun _ => 1) (u : ℤ) theorem candidate_coefficient_nonneg (c L : ℝ) {q : ℝ} (hq : 0 ≤ q) (r jStar u : ℕ) : 0 ≤ candidateCoefficient c L q r jStar u := by apply mul_nonneg (candidate_Q_weight_nonneg _ _ _ _ _) exact marked_divisor_weight_nonneg _ _ hq _ _ (fun _ _ => sum_nonneg (fun _ _ => by positivity)) _ theorem candidate_marked_weight_mul_of_free (c L q : ℝ) {n : ℕ} (hn : n ≠ 0) (hfree : Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c * L)))) (p : ℕ) : markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ a ∈ candidatePBand (c * L) j, 1 / (a : ℝ)) (fun _ => 1) ((p * n : ℕ) : ℤ) = markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ a ∈ candidatePBand (c * L) j, 1 / (a : ℝ)) (fun _ => 1) (p : ℤ) := by apply marked_divisor_weight_mul_disjoint _ _ q _ _ (fun _ _ _ hp => (mem_filter.mp hp).2) (Q := n.primeFactors) · intro j hj exact hfree.symm.mono (fun _ hp => mem_biUnion.mpr ⟨j, hj, hp⟩) (subset_refl _) · exact Nat.mem_factoredNumbers_of_primeFactors_subset hn (subset_refl _) theorem candidate_coefficient_mul_of_free (c L q : ℝ) (r jStar : ℕ) {p n : ℕ} (hp : p ∈ Nat.factoredNumbers ((candidatePIndices c L).biUnion (candidatePBand (c * L)))) (hn : n ≠ 0) (hfree : Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c * L)))) : candidateCoefficient c L q r jStar (p * n) = candidatePWeight c L q p * candidateQWeight c L r jStar n := by unfold candidateCoefficient rw [primePoolFreePart_mul_of_free hp hn hfree, candidate_marked_weight_mul_of_free c L q hn hfree p, candidate_P_weight_eq_marked c L q (Nat.ne_zero_of_mem_factoredNumbers hp)] exact mul_comm _ _ end section open Finset open scoped Classical end section open Finset Classical theorem finite_product_delta_expansion {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (f : (∀ i, X i) → ℂ) (x : ∀ i, X i) : f x = ∑ y : (∀ i, X i), f y * ∏ i, (if x i = y i then (1 : ℂ) else 0) := by have hdelta (y : ∀ i, X i) : (∏ i, (if x i = y i then (1 : ℂ) else 0)) = if x = y then 1 else 0 := by rw [Fintype.prod_ite_zero] simp only [prod_const_one] congr 1 exact propext ⟨fun h => funext h, fun h i => congrFun h i⟩ simp only [hdelta] simp section variable {I : Type*} [sharedInstance1 : Fintype I] {X : I → Type*} (E : ∀ i, X i → Type*) [sharedInstance4 : ∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) include I sharedInstance1 X E sharedInstance4 weight target theorem finite_product_event_sum (phase : ∀ x : (∀ i, X i), (∀ i, E i (x i)) → ℂ) {K : Type*} (s : Finset K) (f : K → (∀ i, X i) → ℂ) (x : ∀ i, X i) : finiteProductEventAction E weight target phase (fun y => ∑ k ∈ s, f k y) x = ∑ k ∈ s, finiteProductEventAction E weight target phase (f k) x := by simp only [finiteProductEventAction, mul_sum] exact sum_comm theorem finite_product_event_const_mul (phase : ∀ x : (∀ i, X i), (∀ i, E i (x i)) → ℂ) (c : ℂ) (f : (∀ i, X i) → ℂ) (x : ∀ i, X i) : finiteProductEventAction E weight target phase (fun y => c * f y) x = c * finiteProductEventAction E weight target phase f x := by simp only [finiteProductEventAction, mul_sum] apply sum_congr rfl intro e _ ring theorem finite_product_event_tensor (f : ∀ i, X i → ℂ) (x : ∀ i, X i) : finiteProductEventAction E weight target (fun _ _ => 1) (fun y => ∏ i, f i (y i)) x = ∏ i, finiteLocalEventAction E weight target i (f i) (x i) := by simp only [finiteProductEventAction, finiteLocalEventAction, mul_one, Complex.ofReal_prod, ← prod_mul_distrib] exact (Fintype.prod_sum (fun i (e : E i (x i)) => (weight i (x i) e : ℂ) * f i (target i (x i) e))).symm end /- Simultaneously drawing independent local events is exactly the composition of their coordinate actions. The phase is identically one in this identity. -/ theorem finite_product_event_eq_coordinate_action {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (f : (∀ i, X i) → ℂ) : finiteProductEventAction E weight target (fun _ _ => 1) f = finiteCoordinateFinsetAction (finiteLocalEventAction E weight target) univ f := by have hf : f = fun z => ∑ y : (∀ i, X i), f y * ∏ i, (if z i = y i then (1 : ℂ) else 0) := funext (finite_product_delta_expansion f) rw [hf] funext x simp only [finite_product_event_sum, finite_product_event_const_mul, finite_local_event_finset_sum, finite_local_event_finset_const_mul] apply sum_congr rfl intro y _ rw [finite_product_event_tensor E weight target (fun i a => if a = y i then (1 : ℂ) else 0) x, finite_local_event_univ_prod E weight target (fun i a => if a = y i then (1 : ℂ) else 0) x] end section section variable {E G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : E → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (groups : Finset G) end end section open scoped BigOperators noncomputable def geometricChordBound (N : ℕ) (z : ℂ) : ℝ := if z = 1 then N else min (N : ℝ) (2 / ‖z - 1‖) theorem unit_geometric_interval_bound (z : ℂ) (hz : ‖z‖ = 1) (a N : ℕ) : ‖∑ n ∈ Finset.range N, z ^ (a + n)‖ ≤ geometricChordBound N z := by by_cases he : z = 1 · subst z simp [geometricChordBound] · simpa only [geometricChordBound, if_neg he] using unit_geometric_interval_norm_le_min z hz he a N theorem unit_geometric_column_gram_bound (z w : ℂ) (hz : ‖z‖ = 1) (hw : ‖w‖ = 1) (a N : ℕ) : ‖∑ n : Fin N, (starRingEnd ℂ) (z ^ (a + n.val)) * w ^ (a + n.val)‖ ≤ geometricChordBound N ((starRingEnd ℂ) z * w) := by have hr : ‖(starRingEnd ℂ) z * w‖ = 1 := by rw [norm_mul, Complex.norm_conj, hz, hw, one_mul] simp only [map_pow, ← mul_pow] rw [Fin.sum_univ_eq_sum_range (fun n => ((starRingEnd ℂ) z * w) ^ (a + n)) N] exact unit_geometric_interval_bound _ hr a N theorem unit_geometric_bilinear_norm_sq_le {Y : Type*} [Fintype Y] (z : Y → ℂ) (hz : ∀ y, ‖z y‖ = 1) (a N : ℕ) (c : Fin N → ℂ) (b : Y → ℂ) {B : ℝ} (hrow : ∀ y, (∑ w, geometricChordBound N ((starRingEnd ℂ) (z y) * z w)) ≤ B) : ‖∑ n : Fin N, ∑ y, c n * b y * (z y) ^ (a + n.val)‖ ^ 2 ≤ B * (∑ n : Fin N, ‖c n‖ ^ 2) * ∑ y, ‖b y‖ ^ 2 := by apply finite_bilinear_gram_norm_sq_le intro y exact (Finset.sum_le_sum (fun w _ => unit_geometric_column_gram_bound _ _ (hz y) (hz w) a N)).trans (hrow y) end section theorem circle_rational_norm_ge {a : ℤ} {r : ℕ} (hr : 0 < r) (hdiv : ¬(r : ℤ) ∣ a) : 1 / (r : ℝ) ≤ ‖(((a : ℝ) / (r : ℝ) : ℝ) : UnitAddCircle)‖ := by have hrR : (0 : ℝ) < r := by exact_mod_cast hr let k : ℤ := round ((a : ℝ) / r) have hn : a - k * r ≠ 0 := by intro h apply hdiv refine ⟨k, ?_⟩ linarith have hnR : (1 : ℝ) ≤ |((a - k * r : ℤ) : ℝ)| := by exact_mod_cast (show (1 : ℤ) ≤ |a - k * r| by have hp : (0 : ℤ) < |a - k * r| := abs_pos.mpr hn omega) rw [UnitAddCircle.norm_eq] change 1 / (r : ℝ) ≤ |(a : ℝ) / r - k| have he : ((a - k * r : ℤ) : ℝ) = ((a : ℝ) / r - k) * r := by push_cast field_simp rw [he, abs_mul, abs_of_pos hrR] at hnR exact (div_le_iff₀ hrR).mpr hnR theorem circle_perturbation_lower (x e : ℝ) : ‖(x : UnitAddCircle)‖ - |e| ≤ ‖((x + e : ℝ) : UnitAddCircle)‖ := by have ht := norm_sub_le (x + e : UnitAddCircle) (e : UnitAddCircle) have he : ‖(e : UnitAddCircle)‖ ≤ |e| := by simpa only [Real.norm_eq_abs] using (QuotientAddGroup.norm_mk_le_norm (m := e) (S := AddSubgroup.zmultiples (1 : ℝ))) have heq : (x + e : UnitAddCircle) - (e : UnitAddCircle) = (x : UnitAddCircle) := by abel rw [heq] at ht rw [AddCircle.coe_add] linarith theorem rational_perturbed_phase_separation {u h : ℤ} {r : ℕ} (hr : 0 < r) (hdiv : ¬(r : ℤ) ∣ u * h) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) (hh : |(h : ℝ)| ≤ (r : ℝ) / 2) : 1 / (2 * (r : ℝ)) ≤ ‖((((u : ℝ) / r + β) * h : ℝ) : UnitAddCircle)‖ := by have hrR : (0 : ℝ) < r := by exact_mod_cast hr have he : |β * (h : ℝ)| ≤ 1 / (2 * (r : ℝ)) := by rw [abs_mul] calc _ ≤ (1 / (r : ℝ) ^ 2) * ((r : ℝ) / 2) := mul_le_mul hβ hh (abs_nonneg _) (by positivity) _ = _ := by field_simp have hrat := circle_rational_norm_ge hr hdiv have hp := circle_perturbation_lower (((u * h : ℤ) : ℝ) / r) (β * h) have ha : ((u : ℝ) / r + β) * h = ((u * h : ℤ) : ℝ) / r + β * h := by push_cast ring rw [ha] have hc : 1 / (r : ℝ) - 1 / (2 * (r : ℝ)) = 1 / (2 * (r : ℝ)) := by field_simp ring linarith theorem coprime_rational_phase_separation {u h : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) (hh0 : h ≠ 0) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) (hh : |(h : ℝ)| ≤ (r : ℝ) / 2) : 1 / (2 * (r : ℝ)) ≤ ‖((((u : ℝ) / r + β) * h : ℝ) : UnitAddCircle)‖ := by apply rational_perturbed_phase_separation hr _ hβ hh intro hdiv have hd : (r : ℤ) ∣ h := Int.dvd_of_dvd_mul_right_of_gcd_one hdiv hcop have ha : (r : ℤ) ≤ |h| := Int.le_of_dvd (abs_pos.mpr hh0) ((dvd_abs _ _).mpr hd) have hrR : (0 : ℝ) < r := by exact_mod_cast hr have haR : (r : ℝ) ≤ |(h : ℝ)| := by exact_mod_cast ha linarith end section open Finset Filter open scoped Topology noncomputable def candidateCoefficientWindowMass (c L q : ℝ) (r jStar : ℕ) : ℝ := ∑ u ∈ arithmeticProductWindow 1 (Real.exp L), candidateCoefficient c L q r jStar u theorem eventually_candidate_ordinary_le_coefficient_mass {c q : ℝ} (hc : 0 < c) (hq : 0 ≤ q) (r : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, candidateOrdinaryWindowMass c L q r jStar ≤ candidateCoefficientWindowMass c L q r jStar := by filter_upwards [eventually_candidate_Q_weight_free_support hc r] with L hfree intro jStar apply supported_free_window_convolution_le ((candidatePIndices c L).biUnion (candidatePBand (c * L))) (candidateSmallPSet c L (Real.exp ((c / 100) * L))) (candidatePWeight c L q) (candidateQWeight c L r jStar) (candidateCoefficient c L q r jStar) (Real.exp L) · intro p hp exact ((mem_candidateSmallPSet_iff c L _ p).mp hp).2 · exact hfree jStar · exact fun u _ => candidate_coefficient_nonneg c L hq r jStar u · intro p hp n hn exact candidate_coefficient_mul_of_free c L q r jStar ((mem_candidateSmallPSet_iff c L _ p).mp hp).2 (hfree jStar n hn).1 (hfree jStar n hn).2 section variable {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) include c q r hc hr hq0 hq1 hcenter theorem exists_candidate_coefficient_window_mass_lower : ∃ K : ℝ, 0 < K ∧ ∃ J : ℕ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → K * (Real.exp L / L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar ≤ candidateCoefficientWindowMass c L q r jStar := by obtain ⟨K, hK, J, hmass⟩ := exists_candidate_ordinary_window_mass_lower hc hr hq0 hq1 hcenter refine ⟨K, hK, J, ?_⟩ filter_upwards [hmass, eventually_candidate_ordinary_le_coefficient_mass hc hq0 r] with L hm hcMass intro jStar hj exact (hm jStar hj).trans (hcMass jStar) theorem exists_candidate_coefficient_mass_polynomial_lower : ∃ C : ℝ, 0 ≤ C ∧ ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, Real.exp L * L^(-C) ≤ candidateCoefficientWindowMass c L q r jStar := by obtain ⟨C, hC, J, hmass⟩ := exists_candidate_ordinary_mass_polynomial_lower hc hr hq0 hq1 hcenter refine ⟨C, hC, J, ?_⟩ intro jStar hj filter_upwards [hmass jStar hj, eventually_candidate_ordinary_le_coefficient_mass hc hq0 r] with L hm hcMass exact hm.trans (hcMass jStar) end end section open Finset Classical section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) theorem unrestricted_coupled_positive_eq_product (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) : unrestrictedCoupledProductOperator n Δ D μ ρ V t B (fun _ _ => 1) f = unrestrictedProductOperator n Δ D μ ρ V t B (fun _ _ _ _ _ _ => 1) univ f := by let E := fun g => UnrestrictedBoundedEvent (n g) (Δ g) (D g) (t g) B let w := fun g => unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B let target := fun g => unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B have hlocal : finiteLocalEventAction E w target = fun g => unrestrictedBoundedOperator (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (fun _ _ _ _ _ => 1) := by funext g F s simpa only [finiteLocalEventAction, mul_one] using (unrestricted_bounded_operator_eq_event_sum (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (fun _ _ _ _ _ => 1) F s).symm have h := finite_product_event_eq_coordinate_action E w target f rw [hlocal] at h exact h theorem unrestricted_coupled_product_energy_le {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, t g ≤ T) (phase : UnrestrictedProductPhase n Δ D t B) (hphase : ∀ s e, ‖phase s e‖ ≤ 1) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (unrestrictedCoupledProductOperator n Δ D μ ρ V t B phase f) ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by apply finiteWeightedEnergy_le_of_envelope_domination (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productMemoryWeight_nonneg μ (fun g => unrestrictedResidueWeight (μ g)) hμ (fun g z => hμ g z.1)) f _ (unrestrictedProductOperator n Δ D μ ρ V t B (fun _ _ _ _ _ _ => 1) univ) · intro s rw [← unrestricted_coupled_positive_eq_product n Δ D μ ρ V t B] exact unrestricted_coupled_product_norm_le_positive n Δ D μ V hρ0.le (fun g => (hvmin.trans_le (hVlo g)).le) hμ t B phase hphase f s · simpa only [card_univ] using unrestricted_product_energy_le n Δ D μ ρ V t B hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht (fun _ _ _ _ _ _ => 1) (by intros; simp) univ (complexNormEnvelope f) (complexNormEnvelope_memory_symmetric f hf) theorem unrestricted_coupled_cutoff_product_energy_le {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, t g ≤ T) (phase : UnrestrictedProductPhase n Δ D t B) (hphase : ∀ s e, ‖phase s e‖ ≤ 1) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (unrestrictedCoupledCutoffProductOperator n Δ D μ ρ V t B phase f) ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by calc _ ≤ finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (unrestrictedCoupledProductOperator n Δ D μ ρ V t B phase (productMemoryCutoff f)) := productMemoryCutoff_energy_le μ (fun g => unrestrictedResidueWeight (μ g)) hμ (fun g z => hμ g z.1) _ _ ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productMemoryCutoff f) := unrestricted_coupled_product_energy_le n Δ D μ ρ V t B hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht phase hphase _ (productMemoryCutoff_symmetric f hf) _ ≤ _ := mul_le_mul_of_nonneg_left (productMemoryCutoff_energy_le μ (fun g => unrestrictedResidueWeight (μ g)) hμ (fun g z => hμ g z.1) f) (pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _) end end section open scoped BigOperators noncomputable def circleGeometricBound (N : ℕ) (x : ℝ) : ℝ := if (x : UnitAddCircle) = 0 then N else min (N : ℝ) (1 / (2 * ‖(x : UnitAddCircle)‖)) theorem geometric_chord_le_circle_bound (N : ℕ) (x : ℝ) : geometricChordBound N (Complex.exp (Complex.I * (2 * Real.pi * x : ℝ))) ≤ circleGeometricBound N x := by by_cases hx : (x : UnitAddCircle) = 0 · simp only [circleGeometricBound, if_pos hx, geometricChordBound] split_ifs · exact le_rfl · exact min_le_left _ _ · have hd := norm_circle_phase_sub_one_pos x hx have hz : Complex.exp (Complex.I * (2 * Real.pi * x : ℝ)) ≠ 1 := by simpa only [norm_pos_iff, sub_ne_zero] using hd simp only [geometricChordBound, if_neg hz, circleGeometricBound, if_neg hx] apply min_le_min_left apply (div_le_div_iff₀ hd (mul_pos (by norm_num) (norm_pos_iff.mpr hx))).mpr have h := norm_circle_phase_sub_one_ge x nlinarith theorem circle_exponential_conj_mul (x y : ℝ) : (starRingEnd ℂ) (Complex.exp (Complex.I * (2 * Real.pi * x : ℝ))) * Complex.exp (Complex.I * (2 * Real.pi * y : ℝ)) = Complex.exp (Complex.I * (2 * Real.pi * (y - x) : ℝ)) := by rw [← Complex.exp_conj] simp only [map_mul, Complex.conj_I, Complex.conj_ofReal] rw [← Complex.exp_add] congr 1 push_cast ring theorem circle_bilinear_norm_sq_le {Y : Type*} [Fintype Y] (θ : Y → ℝ) (a N : ℕ) (c : Fin N → ℂ) (b : Y → ℂ) {B : ℝ} (hrow : ∀ y, (∑ w, circleGeometricBound N (θ w - θ y)) ≤ B) : ‖∑ n : Fin N, ∑ y, c n * b y * (Complex.exp (Complex.I * (2 * Real.pi * θ y : ℝ))) ^ (a + n.val)‖ ^ 2 ≤ B * (∑ n : Fin N, ‖c n‖ ^ 2) * ∑ y, ‖b y‖ ^ 2 := by apply unit_geometric_bilinear_norm_sq_le (fun y => Complex.exp (Complex.I * (2 * Real.pi * θ y : ℝ))) (fun y => by simpa only [mul_comm Complex.I] using Complex.norm_exp_ofReal_mul_I (2 * Real.pi * θ y)) a N c b intro y calc _ = ∑ w, geometricChordBound N (Complex.exp (Complex.I * (2 * Real.pi * (θ w - θ y) : ℝ))) := by apply Finset.sum_congr rfl intro w _ rw [circle_exponential_conj_mul] _ ≤ ∑ w, circleGeometricBound N (θ w - θ y) := Finset.sum_le_sum (fun w _ => geometric_chord_le_circle_bound N _) _ ≤ B := hrow y end section open Finset Classical end section open Finset Classical end section open Finset def physicalGroupPhaseActivity {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (g : G) (p : ↥(P g)) : Bool := decide (p.val ∈ physicalGroupMarks L g) def physicalGroupPhaseDelta {G : Type*} {P : G → Finset ℕ} (n m : ℤ) (g : G) (p : ↥(P g)) : ZMod p.val := ((n - m : ℤ) : ZMod p.val) theorem physical_group_phase_activity_iff {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (g : G) (p : ↥(P g)) : physicalGroupPhaseActivity L g p = true ↔ p.val ∈ physicalGroupMarks L g := by simp [physicalGroupPhaseActivity] theorem physical_group_phase_activity_support_mem {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (g : G) (p : ↥(P g)) : p ∈ ghostPhaseActivitySupport (physicalGroupPhaseActivity L g) ↔ p.val ∈ physicalGroupMarks L g := by simp [ghostPhaseActivitySupport, physicalGroupPhaseActivity] theorem physical_group_phase_activity_support_eq_image {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (g : G) : ghostPhaseActivitySupport (physicalGroupPhaseActivity L g) = univ.image (L g) := by ext p rw [physical_group_phase_activity_support_mem, mem_physical_group_marks] simp only [mem_image, mem_univ, true_and] constructor · rintro ⟨s, hs⟩ exact ⟨s, Subtype.ext hs⟩ · rintro ⟨s, hs⟩ exact ⟨s, congrArg Subtype.val hs⟩ section variable {G : Type*} {P : G → Finset ℕ} include G P theorem physical_group_phase_delta_eq_neg_step (n m : ℤ) (g : G) (p : ↥(P g)) : physicalGroupPhaseDelta n m g p = -((m - n : ℤ) : ZMod p.val) := by simp [physicalGroupPhaseDelta] theorem physical_group_phase_delta_eq_hit_difference (n m : ℤ) (g : G) (p : ↥(P g)) : physicalGroupPhaseDelta n m g p = -(m : ZMod p.val) - (-(n : ZMod p.val)) := by simp [physicalGroupPhaseDelta, sub_eq_add_neg, add_comm] theorem physical_group_phase_delta_zero_of_dvd (n m : ℤ) (g : G) (p : ↥(P g)) (hd : (p.val : ℤ) ∣ m - n) : physicalGroupPhaseDelta n m g p = 0 := by rw [physical_group_phase_delta_eq_neg_step, (ZMod.intCast_zmod_eq_zero_iff_dvd (m - n) p.val).mpr hd, neg_zero] /- Bare lists need only divisibility of the displacement by every common mark. -/ theorem physical_group_phase_shared_delta_zero_of_common_marks {J ell : ℕ} (L R : PhysicalMarkLists P J ell) (n m : ℤ) (g : G) (hcommon : ∀ s t, (L g s).val = (R g t).val → ((L g s).val : ℤ) ∣ m - n) (p : ↥(P g)) (hp : physicalGroupPhaseActivity R g p = true ∧ physicalGroupPhaseActivity L g p = true) : physicalGroupPhaseDelta n m g p = 0 := by obtain ⟨s, hs⟩ := (mem_physical_group_marks L g p.val).mp ((physical_group_phase_activity_iff L g p).mp hp.2) obtain ⟨t, ht⟩ := (mem_physical_group_marks R g p.val).mp ((physical_group_phase_activity_iff R g p).mp hp.1) apply physical_group_phase_delta_zero_of_dvd simpa only [hs] using hcommon s t (hs.trans ht.symm) end end section open Finset def globalBirthReindexStep {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] {a b a' b' : P → Bool} (ha : a = a') (hb : b = b') (step : GlobalBirthRawStep (R := R) a b) : GlobalBirthRawStep (R := R) a' b' := by subst a' subst b' exact step theorem global_birth_reindex_step_row {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {a b a' b' : P → Bool} (ha : a = a') (hb : b = b') (step : GlobalBirthRawStep (R := R) a b) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) : globalBirthRawStepRow (globalBirthReindexStep ha hb step) G H q = globalBirthRawStepRow step G H q := by subst a' subst b' rfl theorem global_birth_reindex_step_kernel {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] {a b a' b' : P → Bool} (ha : a = a') (hb : b = b') (step : GlobalBirthRawStep (R := R) a b) (z w : (p : P) → GhostPhaseState (R p)) : globalBirthRawStepKernel (globalBirthReindexStep ha hb step) z w = globalBirthRawStepKernel step z w := by subst a' subst b' rfl noncomputable def globalBirthAlternatingStep {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] (a : ℕ → P → Bool) (visit : ∀ i, GlobalBirthRawStep (R := R) (a i) (a i)) (edge : ∀ i, GlobalBirthRawStep (R := R) (a i) (a (i + 1))) (i : ℕ) : GlobalBirthRawStep (R := R) (a (i / 2)) (a ((i + 1) / 2)) := by by_cases hi : i % 2 = 0 · have he : (i + 1) / 2 = i / 2 := by omega exact globalBirthReindexStep rfl (congrArg a he.symm) (visit (i / 2)) · have he : (i + 1) / 2 = i / 2 + 1 := by omega exact globalBirthReindexStep rfl (congrArg a he.symm) (edge (i / 2)) section variable {P : Type*} [sharedInstance1 : Fintype P] [sharedInstance2 : DecidableEq P] {R : P → Type*} [sharedInstance4 : ∀ p, AddGroup (R p)] [sharedInstance5 : ∀ p, DecidableEq (R p)] (a : ℕ → P → Bool) (visit : ∀ i, GlobalBirthRawStep (R := R) (a i) (a i)) (edge : ∀ i, GlobalBirthRawStep (R := R) (a i) (a (i + 1))) (i : ℕ) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) include P sharedInstance1 sharedInstance2 R sharedInstance4 sharedInstance5 a visit edge i G H q theorem global_birth_alternating_step_row_even : globalBirthRawStepRow (globalBirthAlternatingStep a visit edge (2 * i)) G H q = globalBirthRawStepRow (visit i) G H q := by simp [globalBirthAlternatingStep, global_birth_reindex_step_row] exact congrArg (fun j => globalBirthRawStepRow (visit j) G H q) (show 2 * i / 2 = i by omega) theorem global_birth_alternating_step_row_odd : globalBirthRawStepRow (globalBirthAlternatingStep a visit edge (2 * i + 1)) G H q = globalBirthRawStepRow (edge i) G H q := by simp [globalBirthAlternatingStep, global_birth_reindex_step_row] exact congrArg (fun j => globalBirthRawStepRow (edge j) G H q) (show (2 * i + 1) / 2 = i by omega) end theorem global_birth_alternating_step_kernel_even {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : ℕ → P → Bool) (visit : ∀ i, GlobalBirthRawStep (R := R) (a i) (a i)) (edge : ∀ i, GlobalBirthRawStep (R := R) (a i) (a (i + 1))) (i : ℕ) (z w : (p : P) → GhostPhaseState (R p)) : globalBirthRawStepKernel (globalBirthAlternatingStep a visit edge (2 * i)) z w = globalBirthRawStepKernel (visit i) z w := by simp [globalBirthAlternatingStep, global_birth_reindex_step_kernel] exact congrArg (fun j => globalBirthRawStepKernel (visit j) z w) (show 2 * i / 2 = i by omega) theorem global_birth_alternating_step_kernel_odd {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : ℕ → P → Bool) (visit : ∀ i, GlobalBirthRawStep (R := R) (a i) (a i)) (edge : ∀ i, GlobalBirthRawStep (R := R) (a i) (a (i + 1))) (i : ℕ) (z w : (p : P) → GhostPhaseState (R p)) : globalBirthRawStepKernel (globalBirthAlternatingStep a visit edge (2 * i + 1)) z w = globalBirthRawStepKernel (edge i) z w := by simp [globalBirthAlternatingStep, global_birth_reindex_step_kernel] exact congrArg (fun j => globalBirthRawStepKernel (edge j) z w) (show (2 * i + 1) / 2 = i by omega) end section open Finset noncomputable def physicalMemoryLabeledScalar {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) : ℂ := by classical exact (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * if physicalListAdmissible (C a.2.2.1.val) a.2.2.2 (physicalPermuteLabels a.1 L) (physicalPermuteLabels a.2.1 R) then (physicalAuxMass V (C a.2.2.1.val) a.2.2.2 : ℂ) * K a.2.2.1.val (physicalPermuteLabels a.1 L) (physicalPermuteLabels a.2.1 R) a.2.2.2 * physicalPhase (ζ a.2.2.1.val) (physicalD (C a.2.2.1.val) (physicalPermuteLabels a.1 L) a.2.2.2) else 0 theorem physical_memory_labeled_scalar_factor {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) : physicalBareLabeledScalar V patterns C ζ K a L R = (physicalCompletionMass V (C a.2.2.1.val) ell : ℂ) * physicalMemoryLabeledScalar V patterns C ζ K a L R := by classical unfold physicalBareLabeledScalar physicalBarePatternScalar physicalMemoryLabeledScalar split_ifs <;> push_cast <;> ring noncomputable def physicalMemoryWalkScalar {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) : ℂ := ∏ j ∈ range edges, physicalMemoryLabeledScalar V patterns C (ζ (edges - 1 - j)) (K (edges - 1 - j)) (a j) (L j) (L (j + 1)) theorem physical_memory_walk_scalar_factor {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) : physicalBareWalkScalar V patterns C ζ K a L edges = ((∏ j ∈ range edges, physicalCompletionMass V (C (a j).2.2.1.val) ell : ℝ) : ℂ) * physicalMemoryWalkScalar V patterns C ζ K a L edges := by simp only [physicalBareWalkScalar, physical_memory_labeled_scalar_factor, prod_mul_distrib, Complex.ofReal_prod, physicalMemoryWalkScalar] end section open Finset open scoped Classical def repeatedBigPermutationEquiv {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations G J ell) : RepeatedBigLists P J ell ≃ RepeatedBigLists P J ell where toFun L g s := L g (σ g s) invFun L g s := L g ((σ g).symm s) left_inv L := by funext g s; exact congrArg (L g) ((σ g).apply_symm_apply s) right_inv L := by funext g s; exact congrArg (L g) ((σ g).symm_apply_apply s) theorem repeated_big_permutation_mul {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (σ τ : PhysicalPermutations G J ell) (L : RepeatedBigLists P J ell) : repeatedBigPermutationEquiv σ (repeatedBigPermutationEquiv τ L) = repeatedBigPermutationEquiv (τ * σ) L := rfl def repeatedBigSymmetricSubspace {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} : Submodule ℂ (RepeatedBigLists P J ell → ℂ) where carrier := {f | ∀ σ : PhysicalPermutations G J ell, ∀ L, f (repeatedBigPermutationEquiv σ L) = f L} zero_mem' := fun _ _ => rfl add_mem' := by intro f g hf hg σ L; exact congrArg₂ (· + ·) (hf σ L) (hg σ L) smul_mem' := by intro a f hf σ L; exact congrArg (a * ·) (hf σ L) noncomputable def repeatedBigSymmetrize {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (f : RepeatedBigLists P J ell → ℂ) (L : RepeatedBigLists P J ell) : ℂ := (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * ∑ σ : PhysicalPermutations G J ell, f (repeatedBigPermutationEquiv σ L) noncomputable def repeatedBigSymmetrizeLinear {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} : (RepeatedBigLists P J ell → ℂ) →ₗ[ℂ] (RepeatedBigLists P J ell → ℂ) where toFun := repeatedBigSymmetrize map_add' f g := by ext L; simp [repeatedBigSymmetrize, sum_add_distrib, mul_add] map_smul' a f := by ext L simp only [repeatedBigSymmetrize, Pi.smul_apply, smul_eq_mul, RingHom.id_apply] rw [← mul_sum] ring theorem repeated_big_symmetrize_invariant {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (f : RepeatedBigLists P J ell → ℂ) (τ : PhysicalPermutations G J ell) (L : RepeatedBigLists P J ell) : repeatedBigSymmetrize f (repeatedBigPermutationEquiv τ L) = repeatedBigSymmetrize f L := by unfold repeatedBigSymmetrize simp only [repeated_big_permutation_mul] congr 1 exact Equiv.sum_comp (Equiv.mulLeft τ) (fun σ => f (repeatedBigPermutationEquiv σ L)) theorem repeated_big_symmetrize_mem {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (f : RepeatedBigLists P J ell → ℂ) : repeatedBigSymmetrizeLinear f ∈ repeatedBigSymmetricSubspace := repeated_big_symmetrize_invariant f section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} include G sharedInstance1 sharedInstance2 P J ell theorem repeated_big_symmetrize_norm_sq_le (f : RepeatedBigLists P J ell → ℂ) (L : RepeatedBigLists P J ell) : ‖repeatedBigSymmetrize f L‖ ^ 2 ≤ (Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹ * ∑ σ : PhysicalPermutations G J ell, ‖f (repeatedBigPermutationEquiv σ L)‖ ^ 2 := by have hc : (0 : ℝ) < Fintype.card (PhysicalPermutations G J ell) := by exact_mod_cast Fintype.card_pos have hsum := complex_row_weighted_cauchy (univ : Finset (PhysicalPermutations G J ell)) (fun _ => 1) (fun σ => f (repeatedBigPermutationEquiv σ L)) (fun _ => 1) (by intros; norm_num) have hsum' : ‖∑ σ : PhysicalPermutations G J ell, f (repeatedBigPermutationEquiv σ L)‖ ^ 2 ≤ (Fintype.card (PhysicalPermutations G J ell) : ℝ) * ∑ σ : PhysicalPermutations G J ell, ‖f (repeatedBigPermutationEquiv σ L)‖ ^ 2 := by simpa using hsum unfold repeatedBigSymmetrize rw [norm_mul, norm_inv, Complex.norm_natCast, mul_pow] calc _ ≤ ((Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹) ^ 2 * ((Fintype.card (PhysicalPermutations G J ell) : ℝ) * ∑ σ : PhysicalPermutations G J ell, ‖f (repeatedBigPermutationEquiv σ L)‖ ^ 2) := mul_le_mul_of_nonneg_left hsum' (sq_nonneg _) _ = _ := by field_simp theorem repeated_big_permutation_energy_eq (w : RepeatedBigLists P J ell → ℝ) (f : RepeatedBigLists P J ell → ℂ) (hw : ∀ (σ : PhysicalPermutations G J ell) L, w (repeatedBigPermutationEquiv σ L) = w L) (σ : PhysicalPermutations G J ell) : (∑ L, w L * ‖f (repeatedBigPermutationEquiv σ L)‖ ^ 2) = ∑ L, w L * ‖f L‖ ^ 2 := by have h := (repeatedBigPermutationEquiv (P := P) σ).sum_comp (fun L => w L * ‖f L‖ ^ 2) simpa only [hw] using h theorem repeated_big_symmetrize_energy_le (w : RepeatedBigLists P J ell → ℝ) (hw0 : ∀ L, 0 ≤ w L) (hw : ∀ (σ : PhysicalPermutations G J ell) L, w (repeatedBigPermutationEquiv σ L) = w L) (f : RepeatedBigLists P J ell → ℂ) : (∑ L, w L * ‖repeatedBigSymmetrizeLinear f L‖ ^ 2) ≤ ∑ L, w L * ‖f L‖ ^ 2 := by have hc : (Fintype.card (PhysicalPermutations G J ell) : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero calc _ ≤ ∑ L, w L * ((Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹ * ∑ σ : PhysicalPermutations G J ell, ‖f (repeatedBigPermutationEquiv σ L)‖ ^ 2) := sum_le_sum fun L _ => mul_le_mul_of_nonneg_left (repeated_big_symmetrize_norm_sq_le f L) (hw0 L) _ = (Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹ * ∑ σ : PhysicalPermutations G J ell, ∑ L, w L * ‖f (repeatedBigPermutationEquiv σ L)‖ ^ 2 := by rw [sum_comm] simp_rw [mul_sum] apply sum_congr rfl intro L _ apply sum_congr rfl intro σ _ ring _ = (Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹ * ∑ _σ : PhysicalPermutations G J ell, ∑ L, w L * ‖f L‖ ^ 2 := by simp_rw [repeated_big_permutation_energy_eq w f hw] _ = _ := by simp only [sum_const, card_univ, nsmul_eq_mul] rw [← mul_assoc, inv_mul_cancel₀ hc, one_mul] theorem repeated_big_symmetrize_norm_le (w : RepeatedBigLists P J ell → ℝ) (hw0 : ∀ L, 0 ≤ w L) (hw : ∀ (σ : PhysicalPermutations G J ell) L, w (repeatedBigPermutationEquiv σ L) = w L) (f : RepeatedBigLists P J ell → ℂ) : cleanActiveNorm w (repeatedBigSymmetrizeLinear f) ≤ cleanActiveNorm w f := Real.sqrt_le_sqrt (repeated_big_symmetrize_energy_le w hw0 hw f) end theorem repeated_big_active_mass_permutation {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (σ : PhysicalPermutations G J ell) (L : RepeatedBigLists P J ell) : repeatedBigActiveMass V b (repeatedBigPermutationEquiv σ L) = repeatedBigActiveMass V b L := by unfold repeatedBigActiveMass apply prod_congr rfl intro g _ exact Equiv.prod_comp (σ g) (fun s => tiltedPhysicalBirthLaw V g (b g) (L g s)) end section open Finset open scoped ComplexConjugate noncomputable def cleanActiveMap {X R : Type*} (P : (X → ℂ) →ₗ[ℂ] (X → ℂ)) (f : X → R → ℂ) (x : X) (r : R) : ℂ := P (fun y => f y r) x noncomputable def cleanProjectedTranslatedSum {A X R : Type*} [Fintype A] [Fintype X] [AddCommGroup R] (P : (X → ℂ) →ₗ[ℂ] (X → ℂ)) (K : A → X → X → ℂ) (δ : A → X → X → R) (f : X → R → ℂ) : X → R → ℂ := cleanActiveMap P (cleanTranslatedSumOperator K δ (cleanActiveMap P f)) /- Every active linear map commutes with Fourier synthesis in the independent residue variable. -/ theorem clean_active_map_synthesis {X R : Type*} [AddCommGroup R] [Fintype R] (P : (X → ℂ) →ₗ[ℂ] (X → ℂ)) (c : AddChar R ℂ → X → ℂ) (x : X) (r : R) : cleanActiveMap P (fun y => cleanFourierSynthesis (fun χ => c χ y)) x r = cleanFourierSynthesis (fun χ => P (c χ) x) r := by have hf : (fun y => cleanFourierSynthesis (fun χ => c χ y) r) = ∑ χ, χ r • c χ := by funext y simp only [cleanFourierSynthesis, Finset.sum_apply, Pi.smul_apply, smul_eq_mul, mul_comm] unfold cleanActiveMap rw [hf, map_sum] simp only [map_smul, Finset.sum_apply, Pi.smul_apply, smul_eq_mul, cleanFourierSynthesis, mul_comm] theorem clean_projected_translated_synthesis {A X R : Type*} [Fintype A] [Fintype X] [AddCommGroup R] [Fintype R] (P : (X → ℂ) →ₗ[ℂ] (X → ℂ)) (K : A → X → X → ℂ) (δ : A → X → X → R) (c : AddChar R ℂ → X → ℂ) (x : X) (r : R) : cleanProjectedTranslatedSum P K δ (fun y => cleanFourierSynthesis (fun χ => c χ y)) x r = cleanFourierSynthesis (fun χ => P (cleanFourierSumBlock K δ χ (P (c χ))) x) r := by have hin : cleanActiveMap P (fun y => cleanFourierSynthesis (fun χ => c χ y)) = fun y => cleanFourierSynthesis (fun χ => P (c χ) y) := by funext y s exact clean_active_map_synthesis P c y s have hmid : cleanTranslatedSumOperator K δ (fun y => cleanFourierSynthesis (fun χ => P (c χ) y)) = fun y => cleanFourierSynthesis (fun χ => cleanFourierSumBlock K δ χ (P (c χ)) y) := by funext y s exact clean_fourier_sum_translated_synthesis K δ _ y s unfold cleanProjectedTranslatedSum rw [hin, hmid] exact clean_active_map_synthesis P _ x r /- Only the projected Fourier blocks need to be bounded. The raw row may leave the subspace. -/ theorem clean_projected_translated_energy_le {A X R : Type*} [Fintype A] [Fintype X] [AddCommGroup R] [Fintype R] (P : (X → ℂ) →ₗ[ℂ] (X → ℂ)) (w : X → ℝ) (K : A → X → X → ℂ) (δ : A → X → X → R) (C : ℝ) (hblock : ∀ (χ : AddChar R ℂ) (v : X → ℂ), (∑ x, w x * ‖P (cleanFourierSumBlock K δ χ (P v)) x‖ ^ 2) ≤ C ^ 2 * ∑ x, w x * ‖v x‖ ^ 2) (f : X → R → ℂ) : (∑ x, w x * ∑ r, ‖cleanProjectedTranslatedSum P K δ f x r‖ ^ 2) ≤ C ^ 2 * ∑ x, w x * ∑ r, ‖f x r‖ ^ 2 := by let c (χ : AddChar R ℂ) (x : X) := cleanFourierCoefficients (f x) χ have hf : f = fun x => cleanFourierSynthesis (fun χ => c χ x) := by funext x r exact (clean_fourier_synthesis_coefficients (f x) r).symm rw [hf] simp_rw [clean_projected_translated_synthesis] rw [clean_fourier_weighted_energy, clean_fourier_weighted_energy] calc _ ≤ (Fintype.card R : ℝ) * ∑ χ, C ^ 2 * ∑ x, w x * ‖c χ x‖ ^ 2 := mul_le_mul_of_nonneg_left (sum_le_sum (fun χ _ => hblock χ (c χ))) (Nat.cast_nonneg _) _ = _ := by rw [← mul_sum]; ring /- A contraction P into U reduces P T P to projected block bounds on U. There is no assumption that T itself maps U to U. -/ theorem clean_projected_translated_norm_le {A X R : Type*} [Fintype A] [Fintype X] [AddCommGroup R] [Fintype R] (P : (X → ℂ) →ₗ[ℂ] (X → ℂ)) (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (U : Submodule ℂ (X → ℂ)) (hPU : ∀ v, P v ∈ U) (hP : ∀ v, cleanActiveNorm w (P v) ≤ cleanActiveNorm w v) (K : A → X → X → ℂ) (δ : A → X → X → R) (C : ℝ) (hC : 0 ≤ C) (hblock : ∀ (χ : AddChar R ℂ) (v : X → ℂ), v ∈ U → cleanActiveNorm w (P (cleanFourierSumBlock K δ χ v)) ≤ C * cleanActiveNorm w v) (f : X → R → ℂ) : cleanWeightedNorm w (cleanProjectedTranslatedSum P K δ f) ≤ C * cleanWeightedNorm w f := by have he : ∀ (χ : AddChar R ℂ) (v : X → ℂ), (∑ x, w x * ‖P (cleanFourierSumBlock K δ χ (P v)) x‖ ^ 2) ≤ C ^ 2 * ∑ x, w x * ‖v x‖ ^ 2 := by intro χ v have hn := (hblock χ (P v) (hPU v)).trans (mul_le_mul_of_nonneg_left (hP v) hC) calc _ = cleanActiveNorm w (P (cleanFourierSumBlock K δ χ (P v))) ^ 2 := (clean_active_norm_sq w hw _).symm _ ≤ (C * cleanActiveNorm w v) ^ 2 := pow_le_pow_left₀ (Real.sqrt_nonneg _) hn 2 _ = _ := by rw [mul_pow, clean_active_norm_sq w hw] have h := Real.sqrt_le_sqrt (clean_projected_translated_energy_le P w K δ C he f) simpa only [cleanWeightedNorm, Real.sqrt_mul (sq_nonneg C), Real.sqrt_sq hC] using h end section noncomputable def signedDistanceBin (R x : ℝ) : Bool × ℕ := (decide (0 ≤ x), ⌊R * |x|⌋₊) theorem signed_distance_bin_abs_sub_lt {R x y : ℝ} (hR : 0 < R) (he : signedDistanceBin R x = signedDistanceBin R y) : |x - y| < 1 / R := by have he0 : decide (0 ≤ x) = decide (0 ≤ y) := congrArg Prod.fst he have he1 : ⌊R * |x|⌋₊ = ⌊R * |y|⌋₊ := congrArg Prod.snd he have hxL := Nat.floor_le (show 0 ≤ R * |x| by positivity) have hyL := Nat.floor_le (show 0 ≤ R * |y| by positivity) have hxU := Nat.lt_floor_add_one (R * |x|) have hyU := Nat.lt_floor_add_one (R * |y|) rw [← he1] at hyL hyU have hdiff : |R * (|x|) - R * (|y|)| < 1 := by rw [abs_lt] constructor <;> linarith have habs : |R * (|x|) - R * (|y|)| = R * |x - y| := by by_cases hx : 0 ≤ x · have hy : 0 ≤ y := by simpa [hx] using he0 rw [abs_of_nonneg hx, abs_of_nonneg hy, ← mul_sub, abs_mul, abs_of_pos hR] · have hy : ¬ 0 ≤ y := by simpa [hx] using he0 rw [abs_of_neg (lt_of_not_ge hx), abs_of_neg (lt_of_not_ge hy)] rw [← mul_sub, abs_mul, abs_of_pos hR] congr 1 rw [neg_sub_neg, abs_sub_comm] rw [habs] at hdiff exact (lt_div_iff₀ hR).mpr (by nlinarith) theorem signed_distance_bin_injOn {ι : Type*} (S : Finset ι) (t : ι → ℝ) {R : ℝ} (hR : 0 < R) (hsep : ∀ i ∈ S, ∀ j ∈ S, i ≠ j → 1 / R ≤ |t i - t j|) : Set.InjOn (fun i => signedDistanceBin R (t i)) S := by intro i hi j hj he by_contra hne exact (not_lt_of_ge (hsep i hi j hj hne)) (signed_distance_bin_abs_sub_lt hR he) theorem circle_norm_sub_le_centered_difference (x y : ℝ) : ‖((x - y : ℝ) : UnitAddCircle)‖ ≤ |(x - (round x : ℝ)) - (y - (round y : ℝ))| := by rw [UnitAddCircle.norm_eq] have h := round_le (x - y) (round x - round y) rw [Int.cast_sub] at h have he : (x - y) - ((round x : ℝ) - (round y : ℝ)) = (x - (round x : ℝ)) - (y - (round y : ℝ)) := by ring rwa [he] at h theorem centered_circle_distance_bin_injOn {ι : Type*} (S : Finset ι) (θ : ι → ℝ) {R : ℝ} (hR : 0 < R) (hsep : ∀ i ∈ S, ∀ j ∈ S, i ≠ j → 1 / R ≤ ‖((θ i - θ j : ℝ) : UnitAddCircle)‖) : Set.InjOn (fun i => signedDistanceBin R (θ i - (round (θ i) : ℝ))) S := signed_distance_bin_injOn S (fun i => θ i - (round (θ i) : ℝ)) hR (fun i hi j hj hne => (hsep i hi j hj hne).trans (circle_norm_sub_le_centered_difference (θ i) (θ j))) end section theorem same_positive_ediv_abs_sub_lt {x y H : ℤ} (hH : 0 < H) (he : x / H = y / H) : |x - y| < H := by have hx := (Int.ediv_eq_iff_of_pos hH).mp (rfl : x / H = x / H) have hy := (Int.ediv_eq_iff_of_pos hH).mp he.symm rw [abs_lt] constructor <;> omega theorem shifted_integer_block_image_card_le {ι : Type*} (S : Finset ι) (t : ι → ℤ) (A : ℤ) (V : ℕ) {H : ℕ} (hH : 0 < H) (ht : ∀ i ∈ S, A ≤ t i ∧ t i ≤ A + (V : ℤ)) : (S.image (fun i => (t i - A) / (H : ℤ))).card ≤ V / H + 1 := by classical have hHZ : (0 : ℤ) < H := by exact_mod_cast hH have hsub : S.image (fun i => (t i - A) / (H : ℤ)) ⊆ Finset.Icc (0 : ℤ) ((V / H : ℕ) : ℤ) := by intro j hj obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hj obtain ⟨hl, hu⟩ := ht i hi apply Finset.mem_Icc.mpr constructor · exact Int.ediv_nonneg (by omega) hHZ.le · have hh := Int.ediv_le_ediv hHZ (show t i - A ≤ (V : ℤ) by omega) simpa only [Int.natCast_ediv] using hh calc _ ≤ (Finset.Icc (0 : ℤ) ((V / H : ℕ) : ℤ)).card := Finset.card_le_card hsub _ = V / H + 1 := by generalize V / H = k rw [Int.card_Icc] omega theorem half_integer_block_pos {r : ℕ} (hr : 2 ≤ r) : 0 < r / 2 := by omega theorem half_integer_block_comparison {r : ℕ} (hr : 2 ≤ r) : (r : ℝ) ≤ 3 * (r / 2 : ℕ) ∧ (r / 2 : ℕ) ≤ (r : ℝ) / 2 := by have hlow : r ≤ 3 * (r / 2) := by omega have hhigh : 2 * (r / 2) ≤ r := by omega constructor · exact_mod_cast hlow · have hh : (2 : ℝ) * (r / 2 : ℕ) ≤ r := by exact_mod_cast hhigh linarith theorem half_integer_block_count_le {r : ℕ} (hr : 2 ≤ r) (V : ℕ) : ((V / (r / 2) + 1 : ℕ) : ℝ) ≤ 1 + 3 * (V : ℝ) / r := by have hr0 : (0 : ℝ) < r := by exact_mod_cast (show 0 < r by omega) have hh := (half_integer_block_comparison hr).1 have hmul : (V / (r / 2) : ℕ) * (r / 2 : ℕ) ≤ (V : ℝ) := by exact_mod_cast Nat.div_mul_le_self V (r / 2) have hquot : (0 : ℝ) ≤ (V / (r / 2) : ℕ) := by positivity push_cast have hgoal : (V / (r / 2) : ℕ) ≤ 3 * (V : ℝ) / r := by apply (le_div_iff₀ hr0).mpr nlinarith linarith theorem integer_interval_injOn_card_le {ι : Type*} (S : Finset ι) (t : ι → ℤ) (hinj : Set.InjOn t S) (A : ℤ) (V : ℕ) (ht : ∀ i ∈ S, A ≤ t i ∧ t i ≤ A + (V : ℤ)) : S.card ≤ V + 1 := by classical have hs : S.image t ⊆ Finset.Icc A (A + (V : ℤ)) := by intro z hz obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hz exact Finset.mem_Icc.mpr (ht i hi) calc S.card = (S.image t).card := (Finset.card_image_of_injOn hinj).symm _ ≤ (Finset.Icc A (A + (V : ℤ))).card := Finset.card_le_card hs _ = V + 1 := by rw [Int.card_Icc] have he : A + (V : ℤ) + 1 - A = ((V + 1 : ℕ) : ℤ) := by push_cast; ring rw [he, Int.toNat_natCast] end section open Finset theorem grouped_prime_slot_weight_le_one {G : Type*} [Fintype G] (P : G → Finset ℕ) (r : ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (n : ℕ) : orderedSlotWeight (fun s : G × Fin r => P s.1) ((r.factorial : ℝ)^(Fintype.card G)) n ≤ 1 := by classical let x : (∀ s : G × Fin r, P s.1) → ∀ _g : G, Fin r → ℕ := fun a g i => (a (g, i)).val have hxinj : Function.Injective x := by intro a b h funext s rcases s with ⟨g, i⟩ exact Subtype.ext (congrFun (congrFun h g) i) have hx : ∀ a g i, x a g i ∈ P g := fun a g i => (a (g, i)).property have heq (a : ∀ s : G × Fin r, P s.1) : orderedSlotProduct (fun s : G × Fin r => P s.1) a = ∏ g, ∏ i, x a g i := Fintype.prod_prod_type (fun s : G × Fin r => (a s).val) have hcard := card_prime_group_product_fiber P (fun _ => r) hprime hdisj x hxinj hx n have hcard' : Nat.card {a : ∀ s : G × Fin r, P s.1 // orderedSlotProduct (fun s : G × Fin r => P s.1) a = n} ≤ r.factorial^(Fintype.card G) := by simpa only [heq, prod_const, card_univ] using hcard rw [ordered_slot_weight_eq_count] apply (div_le_one (by positivity : 0 < (r.factorial : ℝ)^(Fintype.card G))).mpr exact_mod_cast hcard' end section open Finset theorem roughBand_divisor_filter_subset {A B W : ℝ} {n : ℕ} (hn : n ≠ 0) : (roughBand A B W).filter (fun d => d ∣ n) ⊆ roughDivisors W n := by intro d hd obtain ⟨hdR, hdvd⟩ := mem_filter.mp hd apply mem_filter.mpr exact ⟨Nat.mem_divisors.mpr ⟨hdvd, hn⟩, fun p hp => ((mem_filter.mp hdR).2 p hp).le⟩ theorem roughBand_divisor_filter_card_le {A B W : ℝ} {n : ℕ} (hn : n ≠ 0) : ((roughBand A B W).filter (fun d => d ∣ n)).card ≤ (roughDivisors W n).card := card_le_card (roughBand_divisor_filter_subset hn) theorem one_mem_roughDivisors (W : ℝ) {n : ℕ} (hn : n ≠ 0) : 1 ∈ roughDivisors W n := by simp [roughDivisors, Nat.mem_divisors, hn] theorem one_le_roughDivisors_card (W : ℝ) {n : ℕ} (hn : n ≠ 0) : 1 ≤ (roughDivisors W n).card := card_pos.mpr ⟨1, one_mem_roughDivisors W hn⟩ end section open Finset private theorem prod_replace_eq_mul_div {I : Type*} [Fintype I] [DecidableEq I] (x : I → ℕ) (e : I) (q : ℕ) (he : x e ≠ 0) : (∏ i, if i = e then q else x i) = q * ((∏ i, x i) / x e) := by have hrest : (∏ i ∈ univ.erase e, if i = e then q else x i) = ∏ i ∈ univ.erase e, x i := by apply prod_congr rfl intro i hi exact if_neg (mem_erase.mp hi).1 rw [← mul_prod_erase univ (fun i => if i = e then q else x i) (mem_univ e), if_pos rfl, hrest, ← mul_prod_erase univ x (mem_univ e), Nat.mul_div_cancel_left _ (Nat.pos_of_ne_zero he)] /- An injectively represented finite family with one exceptional slot has the stated product-fiber bound. -/ theorem card_one_exception_prime_product_fiber {G Ω : Type*} [Fintype G] [Fintype Ω] (P : G → Finset ℕ) (R : Finset ℕ) (r : ℕ) (e : G × Fin r) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (hR0 : ∀ d ∈ R, d ≠ 0) (q0 : ℕ) (hq0 : q0 ∈ P e.1) (x : Ω → G × Fin r → ℕ) (hxinj : Function.Injective x) (hxR : ∀ a, x a e ∈ R) (hxP : ∀ a s, s ≠ e → x a s ∈ P s.1) (n : ℕ) : Nat.card {a : Ω // (∏ s, x a s) = n} ≤ (R.filter (fun d => d ∣ n)).card * ∏ _g : G, r.factorial := by classical let F := {a : Ω // (∏ s, x a s) = n} let D := R.filter (fun d => d ∣ n) let B (d : D) := {y : ∀ g : G, Fin r → P g // (∏ g, ∏ i, (y g i).val) = q0 * (n / d.val)} let y (a : Ω) (g : G) (i : Fin r) : P g := ⟨if (g, i) = e then q0 else x a (g, i), by split_ifs with hs · have hg : g = e.1 := congrArg Prod.fst hs simpa only [hg] using hq0 · exact hxP a (g, i) hs⟩ let f : F → Σ d : D, B d := fun a => ⟨⟨x a.val e, by refine mem_filter.mpr ⟨hxR a.val, ?_⟩ simpa only [a.property] using dvd_prod_of_mem (x a.val) (mem_univ e)⟩, ⟨y a.val, by change (∏ g, ∏ i, if (g, i) = e then q0 else x a.val (g, i)) = q0 * (n / x a.val e) rw [← Fintype.prod_prod_type (fun s : G × Fin r => if s = e then q0 else x a.val s), prod_replace_eq_mul_div (x a.val) e q0 (hR0 _ (hxR a.val)), a.property]⟩⟩ let recover (b : Σ d : D, B d) (s : G × Fin r) : ℕ := if s = e then b.1.val else (b.2.val s.1 s.2).val have hrecovery (a : F) : recover (f a) = x a.val := by funext s by_cases hs : s = e · simp [recover, f, hs] · simp [recover, f, y, hs] have hfinj : Function.Injective f := by intro a b hab apply Subtype.ext apply hxinj rw [← hrecovery a, ← hrecovery b, hab] change Nat.card F ≤ D.card * _ rw [Nat.card_eq_fintype_card] calc Fintype.card F ≤ Fintype.card (Σ d : D, B d) := Fintype.card_le_of_injective f hfinj _ = ∑ d : D, Fintype.card (B d) := Fintype.card_sigma _ ≤ ∑ _d : D, ∏ _g : G, r.factorial := by apply sum_le_sum intro d _ simpa only [B, Nat.card_eq_fintype_card] using card_ordered_prime_group_product_fiber P (fun _ => r) hprime hdisj (q0 * (n / d.val)) _ = D.card * ∏ _g : G, r.factorial := by simp /- Slot choices for a single nonprime exception. -/ noncomputable def oneExceptionPrimeChoices {G : Type*} [DecidableEq G] (P : G → Finset ℕ) (R : Finset ℕ) {r : ℕ} (e : G × Fin r) (s : G × Fin r) : Finset ℕ := if s = e then R else P s.1 section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] (P : G → Finset ℕ) (R : Finset ℕ) (r : ℕ) (e : G × Fin r) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (hR0 : ∀ d ∈ R, d ≠ 0) (q0 : ℕ) (hq0 : q0 ∈ P e.1) (n : ℕ) include G sharedInstance1 sharedInstance2 P R r e hprime hdisj hR0 q0 hq0 n /- The direct ordered-slot specialization, including arbitrary repeated prime choices. -/ theorem card_one_exception_ordered_slot_fiber : Nat.card {x : ∀ s, oneExceptionPrimeChoices P R e s // orderedSlotProduct (oneExceptionPrimeChoices P R e) x = n} ≤ (R.filter (fun d => d ∣ n)).card * r.factorial ^ Fintype.card G := by classical have hinj : Function.Injective (fun x : ∀ s, oneExceptionPrimeChoices P R e s => fun s => (x s).val) := by intro x y h funext s exact Subtype.ext (congrFun h s) have h := card_one_exception_prime_product_fiber P R r e hprime hdisj hR0 q0 hq0 (fun x : ∀ s, oneExceptionPrimeChoices P R e s => fun s => (x s).val) hinj (fun x => by simpa [oneExceptionPrimeChoices] using (x e).property) (fun x s hs => by simpa only [oneExceptionPrimeChoices, if_neg hs] using (x s).property) n simpa only [orderedSlotProduct, prod_const, card_univ] using h /- With the natural factorial normalization, the ordered-slot weight costs only a rough-divisor count. -/ theorem one_exception_ordered_slot_weight_le : orderedSlotWeight (oneExceptionPrimeChoices P R e) ((r.factorial : ℝ)^Fintype.card G) n ≤ (R.filter (fun d => d ∣ n)).card := by rw [ordered_slot_weight_eq_count] apply (div_le_iff₀ (by positivity : (0 : ℝ) < (r.factorial : ℝ)^Fintype.card G)).mpr exact_mod_cast card_one_exception_ordered_slot_fiber P R r e hprime hdisj hR0 q0 hq0 n end end section open Finset Filter theorem exists_candidate_marked_weight_rpow_bound {c q : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) : ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ L : ℝ in atTop, ∀ u : ℤ, 0 ≤ markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ p ∈ candidatePBand (c * L) j, 1 / (p : ℝ)) (fun _ => 1) u ∧ markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ p ∈ candidatePBand (c * L) j, 1 / (p : ℝ)) (fun _ => 1) u ≤ L^C := by obtain ⟨v, V, hv, hV, hpool⟩ := exists_candidate_P_pool_bounds hc refine ⟨(2 / (5 * Real.log 2)) * Real.log (markedDivisorBound q v 1), mul_nonneg (by positivity) (Real.log_nonneg (one_le_markedDivisorBound q v 1)), ?_⟩ filter_upwards [hpool] with L hp rcases hp with ⟨hL, _, _, hcard, _, hdata⟩ intro u constructor · exact marked_divisor_weight_nonneg _ _ hq0 _ _ (fun _ _ => sum_nonneg (fun _ _ => by positivity)) u · exact marked_divisor_weight_le_rpow _ _ hq0 hq1 hv (zero_lt_one.trans_le hL) _ _ 1 (fun j hj => (hdata j hj).1) (fun _ _ => le_rfl) hcard u theorem eventually_rpow_mul_exp_sqrt_le (C K : ℝ) : ∀ᶠ L : ℝ in atTop, L^C * Real.exp (K * Real.sqrt L) ≤ Real.exp ((K + 1) * Real.sqrt L) := by filter_upwards [eventually_mul_rpow_log_add_le_rpow (a := (0 : ℝ)) (b := (1/2 : ℝ)) (c := (1 : ℝ)) (by norm_num) (by norm_num) (by norm_num) C 0, eventually_gt_atTop (0 : ℝ)] with L h hL simp only [Real.rpow_zero, mul_one, add_zero, one_mul] at h rw [Real.rpow_def_of_pos hL, ← Real.exp_add] apply Real.exp_le_exp.mpr rw [Real.sqrt_eq_rpow] nlinarith /- Any nonnegative factor with a square-root exponential bound can be multiplied by the actual marked weight with just one extra unit in its exponent. -/ theorem eventually_candidate_marked_multiplier_bound {c q : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (K : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (u : ℤ) (a : ℝ), 0 ≤ a → a ≤ Real.exp (K * Real.sqrt L) → a * markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ p ∈ candidatePBand (c * L) j, 1 / (p : ℝ)) (fun _ => 1) u ≤ Real.exp ((K + 1) * Real.sqrt L) := by obtain ⟨C, hC, hweight⟩ := exists_candidate_marked_weight_rpow_bound hc hq0 hq1 filter_upwards [hweight, eventually_rpow_mul_exp_sqrt_le C K] with L hw habsorb intro u a ha habound calc _ ≤ Real.exp (K * Real.sqrt L) * L^C := mul_le_mul habound (hw u).2 (hw u).1 (Real.exp_pos _).le _ = L^C * Real.exp (K * Real.sqrt L) := mul_comm _ _ _ ≤ _ := habsorb end section open Finset Filter theorem eventually_log_sqrt_loss_le_linear (C K : ℝ) {eps : ℝ} (heps : 0 < eps) : ∀ᶠ L : ℝ in atTop, C * Real.log L + K * Real.sqrt L ≤ eps * L := by have heps2 : 0 < eps / 2 := by positivity filter_upwards [eventually_mul_rpow_log_add_le_rpow (a := (0 : ℝ)) (b := (1 : ℝ)) (by norm_num) (by norm_num) heps2 C 0, eventually_mul_rpow_log_add_le_rpow (a := (1/2 : ℝ)) (b := (1 : ℝ)) (by norm_num) (by norm_num) heps2 (max K 0) 0, Real.tendsto_log_atTop.eventually (eventually_ge_atTop (1 : ℝ)), eventually_gt_atTop (0 : ℝ)] with L hpoly hsqrt hlog hL simp only [Real.rpow_zero, Real.rpow_one, mul_one, add_zero] at hpoly hsqrt have hroot : K * Real.sqrt L ≤ (max K 0) * L^(1/2 : ℝ) * Real.log L := by calc _ ≤ max K 0 * Real.sqrt L := mul_le_mul_of_nonneg_right (le_max_left _ _) (Real.sqrt_nonneg L) _ = max K 0 * L^(1/2 : ℝ) := by rw [Real.sqrt_eq_rpow] _ ≤ _ := le_mul_of_one_le_right (mul_nonneg (le_max_right _ _) (Real.rpow_nonneg hL.le _)) hlog linarith /- The threshold is uniform over every finite set and every real weight. No positivity of individual weights is required for this counting implication. -/ theorem eventually_weighted_mass_card_lower (C K : ℝ) {eps : ℝ} (heps : 0 < eps) : ∀ᶠ L : ℝ in atTop, ∀ (α : Type*) (S : Finset α) (w : α → ℝ), Real.exp L * L^(-C) ≤ (∑ u ∈ S, w u) → (∀ u ∈ S, w u ≤ Real.exp (K * Real.sqrt L)) → Real.exp ((1 - eps) * L) ≤ (S.card : ℝ) := by filter_upwards [eventually_log_sqrt_loss_le_linear C K heps, eventually_gt_atTop (0 : ℝ)] with L hloss hL intro α S w hmass hw have hsum : (∑ u ∈ S, w u) ≤ (S.card : ℝ) * Real.exp (K * Real.sqrt L) := by calc _ ≤ ∑ _u ∈ S, Real.exp (K * Real.sqrt L) := sum_le_sum hw _ = _ := by simp have hexp : Real.exp ((1 - eps) * L) * Real.exp (K * Real.sqrt L) ≤ Real.exp L * L^(-C) := by rw [Real.rpow_def_of_pos hL, ← Real.exp_add, ← Real.exp_add] apply Real.exp_le_exp.mpr nlinarith have hbound := hexp.trans (hmass.trans hsum) have hpos := Real.exp_pos (K * Real.sqrt L) nlinarith end section open Finset Filter open scoped Topology private theorem support_eventually_pow_twenty_le_exp_rpow {a : ℝ} (ha : 0 < a) : ∀ᶠ L : ℝ in atTop, L^20 ≤ Real.exp (L^a) := by filter_upwards [eventually_mul_rpow_log_add_le_rpow (a := 0) ha ha (show (0 : ℝ) < 1 by norm_num) 20 0, eventually_gt_atTop (0 : ℝ)] with L hbound hL have hpow : L^20 = Real.exp (20 * Real.log L) := by rw [mul_comm, Real.exp_mul, Real.exp_log hL] norm_num rw [hpow] apply Real.exp_le_exp.mpr simpa only [Real.rpow_zero, mul_one, add_zero, one_mul] using hbound theorem ordered_slot_product_primeFactors_inherit {I : Type*} [Fintype I] (choices : I → Finset ℕ) (hzero : ∀ i, ∀ n ∈ choices i, n ≠ 0) (property : ℕ → Prop) (hproperty : ∀ i, ∀ n ∈ choices i, ∀ p ∈ n.primeFactors, property p) (x : ∀ i, choices i) : ∀ p ∈ (orderedSlotProduct choices x).primeFactors, property p := by classical intro p hp obtain ⟨hpp, hpdvd, _⟩ := Nat.mem_primeFactors.mp hp obtain ⟨i, _, hpi⟩ := ((Nat.prime_iff.mp hpp).dvd_finsetProd_iff (fun i => (x i).val)).mp hpdvd exact hproperty i (x i).val (x i).property p (Nat.mem_primeFactors.mpr ⟨hpp, hpi, hzero i (x i).val (x i).property⟩) theorem candidate_Q_slot_primeFactors_range {c L A B : ℝ} {r jStar : ℕ} (hcL : 0 ≤ c * L) (hrough : A ≤ Real.exp (Real.sqrt L)) (hupper : (6/5 : ℝ) * c * L ≤ B) (hregular : ∀ j ∈ candidateQIndices c L, A ≤ Real.exp (c * L / 2^j)) (slot : (candidateQIndices c L) × Fin r) {n : ℕ} (hn : n ∈ candidateQSlotChoices c L r jStar slot) : ∀ p ∈ n.primeFactors, A < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp B := by classical have hscale (j : ℕ) : (6/5 : ℝ) * c * L / 2^j ≤ B := by apply le_trans _ hupper apply (div_le_iff₀ (by positivity : (0 : ℝ) < 2^j)).mpr have hnonneg : 0 ≤ (6/5 : ℝ) * c * L := by nlinarith simpa only [mul_one] using mul_le_mul_of_nonneg_left (one_le_pow₀ (by norm_num : (1 : ℝ) ≤ 2) : (1 : ℝ) ≤ 2^j) hnonneg intro p hp simp only [candidateQSlotChoices] at hn split_ifs at hn with hs · refine ⟨hrough.trans_lt ((mem_filter.mp hn).2 p hp), ?_⟩ have hpn : p ≤ n := Nat.le_of_dvd (roughBand_pos hn) (Nat.dvd_of_mem_primeFactors hp) have hnUpper : (n : ℝ) ≤ Real.exp ((6/5 : ℝ) * c * L / 2^jStar) := by have hh := (mem_Ioc.mp (mem_filter.mp hn).1).2 exact (Nat.cast_le.mpr hh).trans (Nat.floor_le (Real.exp_pos _).le) exact (Nat.cast_le.mpr hpn).trans (hnUpper.trans (Real.exp_le_exp.mpr (hscale jStar))) · obtain ⟨hnp, hnlo, hnhi⟩ := (mem_dyadicPrimeBand_iff (c * L) 1 (6/5) slot.1.val n).mp hn obtain ⟨hpp, hpdvd, _⟩ := Nat.mem_primeFactors.mp hp have hpn : p = n := ((Nat.dvd_prime hnp).mp hpdvd).resolve_left hpp.ne_one subst p refine ⟨(hregular slot.1.val slot.1.property).trans_lt ?_, ?_⟩ · simpa only [one_mul] using hnlo · apply hnhi.trans (Real.exp_le_exp.mpr ?_) simpa only [mul_assoc] using hscale slot.1.val theorem candidate_Q_weight_primeFactors_range {c L A B : ℝ} {r jStar n : ℕ} (hcL : 0 ≤ c * L) (hrough : A ≤ Real.exp (Real.sqrt L)) (hupper : (6/5 : ℝ) * c * L ≤ B) (hregular : ∀ j ∈ candidateQIndices c L, A ≤ Real.exp (c * L / 2^j)) (hn : candidateQWeight c L r jStar n ≠ 0) : ∀ p ∈ n.primeFactors, A < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp B := by obtain ⟨x, hx⟩ := ordered_slot_weight_ne_zero_support _ _ hn rw [← hx] apply ordered_slot_product_primeFactors_inherit _ (fun i n hn => candidate_Q_slot_nonzero c L r jStar i hn) exact fun i n hn => candidate_Q_slot_primeFactors_range hcL hrough hupper hregular i hn theorem eventually_candidate_Q_weight_primeFactors_range {c δ : ℝ} (hc : 0 < c) (hsmall : (6/5 : ℝ) * c ≤ δ) : ∀ᶠ L : ℝ in atTop, ∀ r jStar n : ℕ, candidateQWeight c L r jStar n ≠ 0 → ∀ p ∈ n.primeFactors, L^20 < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp (δ * L) := by filter_upwards [eventually_candidateQIndices_geometry hc, support_eventually_pow_twenty_le_exp_rpow (show (0 : ℝ) < 1/2 by norm_num), eventually_gt_atTop (0 : ℝ)] with L hQ hrough hL intro r jStar n hn apply candidate_Q_weight_primeFactors_range (mul_nonneg hc.le hL.le) _ (mul_le_mul_of_nonneg_right hsmall hL.le) _ hn · simpa only [Real.sqrt_eq_rpow] using hrough · intro j hj have hpow : L^20 = Real.exp (20 * Real.log L) := by rw [mul_comm, Real.exp_mul, Real.exp_log hL] norm_num rw [hpow] exact Real.exp_le_exp.mpr (hQ.2 j hj).1 theorem eventually_candidate_P_pool_prime_range {c δ : ℝ} (hc : 0 < c) (hδ : 0 < δ) : ∀ᶠ L : ℝ in atTop, ∀ p ∈ (candidatePIndices c L).biUnion (candidatePBand (c * L)), L^20 < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp (δ * L) := by obtain ⟨v, V, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool, support_eventually_pow_twenty_le_exp_rpow (show (0 : ℝ) < 1/10 by norm_num), eventually_mul_rpow_log_add_le_rpow (a := (2/5 : ℝ)) (b := 1) (by norm_num) (by norm_num) hδ 1 0, Real.tendsto_log_atTop.eventually (eventually_ge_atTop (1 : ℝ))] with L hpool hlower hupper hlog intro p hp obtain ⟨j, hj, hpj⟩ := mem_biUnion.mp hp obtain ⟨_, hlo, hhi⟩ := (hpool.2.2.2.2.2 j hj).2.2 p hpj refine ⟨?_, hhi.trans (Real.exp_le_exp.mpr ?_)⟩ · exact hlower.trans_lt hlo · calc L^(2/5 : ℝ) ≤ L^(2/5 : ℝ) * Real.log L := by simpa only [mul_one] using mul_le_mul_of_nonneg_left hlog (Real.rpow_nonneg (by linarith [hpool.1]) (2/5 : ℝ)) _ ≤ δ * L := by simpa only [one_mul, add_zero, Real.rpow_one] using hupper theorem eventually_candidate_coefficient_primeFactors_range {c δ : ℝ} (hc : 0 < c) (hsmall : (6/5 : ℝ) * c ≤ δ) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar u : ℕ), candidateCoefficient c L q r jStar u ≠ 0 → ∀ p ∈ u.primeFactors, L^20 < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp (δ * L) := by have hδ : 0 < δ := lt_of_lt_of_le (by positivity) hsmall filter_upwards [eventually_candidate_Q_weight_primeFactors_range hc hsmall, eventually_candidate_P_pool_prime_range hc hδ] with L hQ hP intro q r jStar u hu p hp obtain ⟨hpp, hpdiv, hu0⟩ := Nat.mem_primeFactors.mp hp let P := (candidatePIndices c L).biUnion (candidatePBand (c * L)) have hprod : p ∣ primePoolPart P u * primePoolFreePart P u := by rwa [primePoolPart_mul_primePoolFreePart] rcases hpp.dvd_mul.mp hprod with hpart | hfree · exact hP p ((Nat.mem_factoredNumbers'.mp (primePoolPart_mem_factoredNumbers P u)) p hpp hpart) · apply hQ r jStar (primePoolFreePart P u) (left_ne_zero_of_mul hu) p exact Nat.mem_primeFactors.mpr ⟨hpp, hfree, primePoolFreePart_ne_zero P hu0⟩ end section end section open Finset Classical universe u v w def FiniteEventPath {K : Type u} {X : Type v} (E : K → X → Type w) (target : ∀ k x, E k x → X) : List K → X → Type w | [], _ => PUnit.{w + 1} | k :: ks, x => Σ e : E k x, FiniteEventPath E target ks (target k x e) noncomputable abbrev finiteEventPathFintype {K : Type u} {X : Type v} (E : K → X → Type w) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) : ∀ ks x, Fintype (FiniteEventPath E target ks x) | [], _ => inferInstanceAs (Fintype PUnit.{w + 1}) | k :: ks, x => let _ : ∀ e : E k x, Fintype (FiniteEventPath E target ks (target k x e)) := fun e => finiteEventPathFintype E target ks (target k x e) inferInstanceAs (Fintype (Σ e : E k x, FiniteEventPath E target ks (target k x e))) def finiteEventPathTerminal {K : Type u} {X : Type v} (E : K → X → Type w) (target : ∀ k x, E k x → X) : ∀ ks x, FiniteEventPath E target ks x → X | [], x, _ => x | _ :: ks, _, ⟨_e, p⟩ => finiteEventPathTerminal E target ks _ p def finiteEventPathWeight {K : Type u} {X : Type v} (E : K → X → Type w) (target : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) : ∀ ks x, FiniteEventPath E target ks x → ℝ | [], _, _ => 1 | k :: ks, x, ⟨e, p⟩ => w k x e * finiteEventPathWeight E target w ks _ p noncomputable def finiteEventPathPositive {K : Type u} {X : Type v} (E : K → X → Type w) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (ks : List K) (f : X → ℂ) (x : X) : ℂ := let _ := finiteEventPathFintype E target ks x ∑ p : FiniteEventPath E target ks x, (finiteEventPathWeight E target w ks x p : ℂ) * f (finiteEventPathTerminal E target ks x p) noncomputable def finiteEventPathAction {K : Type u} {X : Type v} (E : K → X → Type w) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (ks : List K) (phase : ∀ x, FiniteEventPath E target ks x → ℂ) (f : X → ℂ) (x : X) : ℂ := let _ := finiteEventPathFintype E target ks x ∑ p : FiniteEventPath E target ks x, (finiteEventPathWeight E target w ks x p : ℂ) * phase x p * f (finiteEventPathTerminal E target ks x p) section variable {K : Type u} {X : Type v} (E : K → X → Type w) [sharedInstance3 : ∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) include K X E sharedInstance3 target w theorem finite_event_path_positive_nil (f : X → ℂ) (x : X) : finiteEventPathPositive E target w [] f x = f x := by change (∑ _p : PUnit.{w + 1}, (1 : ℂ) * f x) = f x simp theorem finite_event_path_positive_cons (k : K) (ks : List K) (f : X → ℂ) (x : X) : finiteEventPathPositive E target w (k :: ks) f x = ∑ e : E k x, (w k x e : ℂ) * finiteEventPathPositive E target w ks f (target k x e) := by let _ : ∀ e : E k x, Fintype (FiniteEventPath E target ks (target k x e)) := fun e => finiteEventPathFintype E target ks (target k x e) change (∑ p : (Σ e : E k x, FiniteEventPath E target ks (target k x e)), ((w k x p.1 * finiteEventPathWeight E target w ks _ p.2 : ℝ) : ℂ) * f (finiteEventPathTerminal E target ks _ p.2)) = _ rw [Fintype.sum_sigma] simp only [finiteEventPathPositive, Complex.ofReal_mul, mul_sum, mul_assoc] theorem finite_event_path_positive_eq_list (ks : List K) (f : X → ℂ) : finiteEventPathPositive E target w ks f = finiteOperatorListAction (finiteLocalEventAction E w target) ks f := by induction ks with | nil => funext x; exact finite_event_path_positive_nil E target w f x | cons k ks ih => funext x rw [finite_event_path_positive_cons] simp only [ih, finiteOperatorListAction, finiteLocalEventAction] end end section open Finset Classical section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) theorem unrestricted_coupled_positive_cutoff_eq_product (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) : unrestrictedCoupledCutoffProductOperator n Δ D μ ρ V t B (fun _ _ => 1) f = unrestrictedCutoffProductOperator n Δ D μ ρ V t B (fun _ _ _ _ _ _ => 1) univ f := by unfold unrestrictedCoupledCutoffProductOperator unrestrictedCutoffProductOperator rw [unrestricted_coupled_positive_eq_product] end section variable {E G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : E → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) end end section open Finset Classical abbrev UnrestrictedJointEvent {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) := ∀ g, UnrestrictedBoundedEvent (n g) (Δ g) (D g) (t g) B (s g) noncomputable def unrestrictedJointEventTarget {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (e : UnrestrictedJointEvent n Δ D t B s) : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B := fun g => unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B (s g) (e g) noncomputable def unrestrictedJointCutoffEventWeight {G : Type*} [Fintype G] {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (e : UnrestrictedJointEvent n Δ D t B s) : ℝ := if productTotalMemory s ≤ B ∧ productTotalMemory (unrestrictedJointEventTarget n Δ D t B s e) ≤ B then ∏ g, unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (s g) (e g) else 0 theorem unrestrictedJointCutoffEventWeight_nonneg {G : Type*} [Fintype G] {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) {ρ : ℝ} (V : G → ℝ) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ V g) (hμ : ∀ g p, 0 ≤ μ g p) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (e : UnrestrictedJointEvent n Δ D t B s) : 0 ≤ unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B s e := by unfold unrestrictedJointCutoffEventWeight split_ifs · exact prod_nonneg fun g _ => unrestrictedBoundedEventWeight_nonneg (n g) (Δ g) (D g) (μ g) hρ (hV g) (hμ g) (t g) B (s g) (e g) · exact le_rfl theorem unrestricted_coupled_cutoff_eq_joint_event_sum {G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (phase : UnrestrictedProductPhase n Δ D t B) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : unrestrictedCoupledCutoffProductOperator n Δ D μ ρ V t B phase f s = ∑ e : UnrestrictedJointEvent n Δ D t B s, (unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B s e : ℂ) * phase s e * f (unrestrictedJointEventTarget n Δ D t B s e) := by unfold unrestrictedCoupledCutoffProductOperator unrestrictedCoupledProductOperator finiteProductEventAction productMemoryCutoff by_cases hs : productTotalMemory s ≤ B · rw [if_pos hs] apply sum_congr rfl intro e _ by_cases ht : productTotalMemory (unrestrictedJointEventTarget n Δ D t B s e) ≤ B · simp [unrestrictedJointCutoffEventWeight, hs, ht, show productTotalMemory (fun g => unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B (s g) (e g)) ≤ B from ht] exact Or.inl rfl · simp [unrestrictedJointCutoffEventWeight, hs, ht, show ¬productTotalMemory (fun g => unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B (s g) (e g)) ≤ B from ht] · simp [hs, unrestrictedJointCutoffEventWeight] end section open scoped BigOperators theorem reciprocal_character_profile_antitone {a x Q : ℝ} (ha : 2 ≤ a) (hax : a ≤ x) (hQ : 1 ≤ Q) : x ^ (-(1 : ℝ) / 32) * (1 + Real.log Q / Real.log x) ≤ a ^ (-(1 : ℝ) / 32) * (1 + Real.log Q / Real.log a) := by have ha0 : 0 < a := by linarith have hla : 0 < Real.log a := Real.log_pos (by linarith) have hlog : Real.log a ≤ Real.log x := Real.log_le_log ha0 hax have hlx : 0 < Real.log x := hla.trans_le hlog have hQlog : 0 ≤ Real.log Q := Real.log_nonneg hQ apply mul_le_mul · exact Real.rpow_le_rpow_of_nonpos ha0 hax (by norm_num) · have h := div_le_div_of_nonneg_left hQlog hla hlog linarith · positivity · positivity theorem primeBand_eq_empty_of_upper_le {a b : ℝ} (hba : b ≤ a) : primeBand a b = ∅ := by unfold primeBand rw [Finset.Ioc_eq_empty_of_le (Nat.floor_le_floor hba), Finset.filter_empty] theorem primeBand_product_interval {a b c U V : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 < c) (_hU : 0 ≤ U) (hV : 0 ≤ V) : (primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V) = primeBand (max a (U / c)) (min b (V / c)) := by classical ext p have hmax : 0 ≤ max a (U / c) := ha.trans (le_max_left _ _) have hmin : 0 ≤ min b (V / c) := le_min hb (div_nonneg hV hc.le) rw [Finset.mem_filter, mem_primeBand_iff ha hb, mem_primeBand_iff hmax hmin] simp only [max_lt_iff, le_min_iff, div_lt_iff₀ hc, le_div_iff₀ hc] constructor · rintro ⟨⟨hp, hap, hpb⟩, hUp, hpV⟩ exact ⟨hp, ⟨hap, by simpa only [mul_comm] using hUp⟩, ⟨hpb, by simpa only [mul_comm] using hpV⟩⟩ · rintro ⟨hp, ⟨hap, hUp⟩, hpb, hpV⟩ exact ⟨⟨hp, hap, hpb⟩, by simpa only [mul_comm] using hUp, by simpa only [mul_comm] using hpV⟩ theorem reciprocal_prime_band_product_interval_bound (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ a b c U V : ℝ, 2 ≤ a → 0 ≤ b → 0 < c → 0 ≤ U → 0 ≤ V → ‖∑ p ∈ (primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V), (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ C * a ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log a) := by obtain ⟨C, hC, hbound⟩ := reciprocal_prime_interval_bound_of_zero_free hZ refine ⟨C, hC, ?_⟩ intro q hq χ hχ a b c U V ha hb hc hU hV rw [primeBand_product_interval (by linarith : 0 ≤ a) hb hc hU hV] let x := max a (U / c) let y := min b (V / c) have hax : a ≤ x := le_max_left _ _ have hx : 2 ≤ x := ha.trans hax have hqR : (1 : ℝ) ≤ q := by exact_mod_cast hq by_cases hxy : x ≤ y · have h := hbound q hq χ hχ x y hx hxy change ‖∑ p ∈ primeBand x y, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ _ at h apply h.trans simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (reciprocal_character_profile_antitone ha hax hqR) hC.le · change ‖∑ p ∈ primeBand x y, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ _ rw [primeBand_eq_empty_of_upper_le (le_of_not_ge hxy), Finset.sum_empty, norm_zero] have hlq : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg hqR have hla : 0 < Real.log a := Real.log_pos (by linarith) positivity end section open Finset open scoped Classical /- Fixed finite indexing of the actual unshared slots, independent of labels. -/ noncomputable def physicalGroupUnsharedIndex {J ell : ℕ} (C : Finset (Fin J)) : Fin (ell + C.card) ≃ ↥(physicalUnsharedSlots (ell := ell) C) := (Fintype.equivFinOfCardEq (by simpa only [Fintype.card_coe] using physical_unshared_slots_card (ell := ell) C)).symm /- Read a physical list at its indexed unshared slots. -/ noncomputable def physicalGroupUnsharedEmbedding {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (g : G) : Fin (ell + (C g).card) ↪ ↥(P g) where toFun j := L g (physicalGroupUnsharedIndex (ell := ell) (C g) j).val inj' := by intro j k h apply (physicalGroupUnsharedIndex (ell := ell) (C g)).injective exact Subtype.ext ((L g).injective h) theorem physical_group_unshared_embedding_mem {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (g : G) (p : P g) : p ∈ univ.image (physicalGroupUnsharedEmbedding C L g) ↔ p.val ∈ physicalGroupMarks L g ∧ p.val ∉ physicalGroupSharedPrimes C L g := by constructor · intro hp obtain ⟨j, _, rfl⟩ := mem_image.mp hp let s := physicalGroupUnsharedIndex (ell := ell) (C g) j refine ⟨(mem_physical_group_marks L g _).mpr ⟨s.val, rfl⟩, ?_⟩ intro hs obtain ⟨t, ht, he⟩ := (mem_physical_group_shared_primes C L g _).mp hs have hts : t = s.val := (L g).injective (Subtype.ext he) have hns : s.val ∉ physicalSharedSlots (C g) := by simpa only [physicalUnsharedSlots, mem_compl] using s.property exact hns (hts ▸ ht) · rintro ⟨hp, hn⟩ obtain ⟨s, hs⟩ := (mem_physical_group_marks L g _).mp hp have hns : s ∈ physicalUnsharedSlots (ell := ell) (C g) := by rw [physicalUnsharedSlots, mem_compl] intro h exact hn ((mem_physical_group_shared_primes C L g _).mpr ⟨s, h, hs⟩) refine mem_image.mpr ⟨(physicalGroupUnsharedIndex (ell := ell) (C g)).symm ⟨s, hns⟩, mem_univ _, ?_⟩ change L g ((physicalGroupUnsharedIndex (ell := ell) (C g)) ((physicalGroupUnsharedIndex (ell := ell) (C g)).symm ⟨s, hns⟩)).val = p simpa only [Equiv.apply_symm_apply] using (Subtype.ext hs : L g s = p) theorem physical_group_shared_primes_of_compatible {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (hshared : physicalSharedCompatible C L R) (g : G) : physicalGroupSharedPrimes C L g = physicalGroupSharedPrimes C R g := by ext p simp only [mem_physical_group_shared_primes] constructor · rintro ⟨s, hs, hp⟩ obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff (C g) s).mp hs exact ⟨Sum.inl j, (physical_mem_shared_slots_iff (C g) _).mpr ⟨j, hj, rfl⟩, (congrArg Subtype.val (hshared g j hj)).symm.trans hp⟩ · rintro ⟨s, hs, hp⟩ obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff (C g) s).mp hs exact ⟨Sum.inl j, (physical_mem_shared_slots_iff (C g) _).mpr ⟨j, hj, rfl⟩, (congrArg Subtype.val (hshared g j hj)).trans hp⟩ /- If the only common labels are the shared labels, the actual unshared source slots enumerate exactly the departing activity. -/ theorem physical_group_phase_source_image {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (g : G) (hinter : physicalGroupMarks L g ∩ physicalGroupMarks R g = physicalGroupSharedPrimes C L g) : univ.image (physicalGroupUnsharedEmbedding C L g) = ghostPhaseActivitySupport (physicalGroupPhaseActivity L g) \ ghostPhaseActivitySupport (physicalGroupPhaseActivity R g) := by ext p rw [physical_group_unshared_embedding_mem, mem_sdiff, physical_group_phase_activity_support_mem, physical_group_phase_activity_support_mem, ← hinter, mem_inter] tauto /- The actual target unshared slots enumerate exactly the newly active labels. -/ theorem physical_group_phase_target_image {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (hshared : physicalSharedCompatible C L R) (g : G) (hinter : physicalGroupMarks L g ∩ physicalGroupMarks R g = physicalGroupSharedPrimes C L g) : univ.image (physicalGroupUnsharedEmbedding C R g) = ghostPhaseNewRunSet (physicalGroupPhaseActivity R g) (physicalGroupPhaseActivity L g) := by have hi : physicalGroupMarks R g ∩ physicalGroupMarks L g = physicalGroupSharedPrimes C R g := by rw [inter_comm, hinter, physical_group_shared_primes_of_compatible C L R hshared g] rw [physical_group_phase_source_image C R L g hi] ext p simp only [ghostPhaseActivitySupport, ghostPhaseNewRunSet, mem_sdiff, mem_filter, mem_univ, true_and, Bool.and_eq_true, Bool.not_eq_true'] cases physicalGroupPhaseActivity L g p <;> simp section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) include G sharedInstance1 P J ell C aux k /- The same construction applies to bare physical lists once their common marks satisfy the actual step divisibility condition. -/ theorem physical_group_phase_images_of_bare (L R : PhysicalMarkLists P J ell) (hlist : physicalListAdmissible C aux L R) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hcompat : ∀ g s t, (L g s).val = (R g t).val → ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) (g : G) (hk : ∀ s, ¬ ((L g s).val : ℤ) ∣ k) : univ.image (physicalGroupUnsharedEmbedding C L g) = ghostPhaseActivitySupport (physicalGroupPhaseActivity L g) \ ghostPhaseActivitySupport (physicalGroupPhaseActivity R g) ∧ univ.image (physicalGroupUnsharedEmbedding C R g) = ghostPhaseNewRunSet (physicalGroupPhaseActivity R g) (physicalGroupPhaseActivity L g) := by have hi := physical_bare_group_marks_inter_eq_shared C aux k L R hlist hP hdis hcompat g hk exact ⟨physical_group_phase_source_image C L R g hi, physical_group_phase_target_image C L R hlist.1 g hi⟩ end end section def globalBirthFiniteIndex (n i : ℕ) : Fin (n + 1) := ⟨min i n, lt_of_le_of_lt (min_le_right _ _) (Nat.lt_succ_self _)⟩ theorem global_birth_finite_index_at {n : ℕ} (j : Fin (n + 1)) : globalBirthFiniteIndex n j.val = j := by apply Fin.ext exact min_eq_left (Nat.le_of_lt_succ j.isLt) theorem global_birth_finite_index_tail (n i : ℕ) (hi : n ≤ i) : globalBirthFiniteIndex n i = Fin.last n := by apply Fin.ext exact min_eq_right hi def globalBirthFiniteActivity {P : Type*} {n : ℕ} (a : Fin (n + 1) → P → Bool) (i : ℕ) : P → Bool := a (globalBirthFiniteIndex n i) theorem global_birth_finite_activity_at {P : Type*} {n : ℕ} (a : Fin (n + 1) → P → Bool) (j : Fin (n + 1)) : globalBirthFiniteActivity a j.val = a j := by rw [globalBirthFiniteActivity, global_birth_finite_index_at] theorem global_birth_finite_activity_tail {P : Type*} {n : ℕ} (a : Fin (n + 1) → P → Bool) (i : ℕ) (hi : n ≤ i) : globalBirthFiniteActivity a i = a (Fin.last n) := by rw [globalBirthFiniteActivity, global_birth_finite_index_tail n i hi] section Steps variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] {n : ℕ} (a : Fin (n + 1) → P → Bool) (visit : ∀ j, GlobalBirthRawStep (R := R) (a j) (a j)) (edge : ∀ j : Fin n, GlobalBirthRawStep (R := R) (a j.castSucc) (a j.succ)) def globalBirthFiniteVisit (i : ℕ) : GlobalBirthRawStep (R := R) (globalBirthFiniteActivity a i) (globalBirthFiniteActivity a i) := visit (globalBirthFiniteIndex n i) def globalBirthFiniteEdge (i : ℕ) : GlobalBirthRawStep (R := R) (globalBirthFiniteActivity a i) (globalBirthFiniteActivity a (i + 1)) := by by_cases hi : i < n · exact globalBirthReindexStep (global_birth_finite_activity_at a (Fin.castSucc ⟨i, hi⟩)).symm (global_birth_finite_activity_at a (Fin.succ ⟨i, hi⟩)).symm (edge ⟨i, hi⟩) · exact globalBirthReindexStep (global_birth_finite_activity_tail a i (by omega)).symm (global_birth_finite_activity_tail a (i + 1) (by omega)).symm (visit (Fin.last n)) noncomputable def globalBirthFiniteAlternatingStep (i : ℕ) : GlobalBirthRawStep (R := R) (globalBirthFiniteActivity a (i / 2)) (globalBirthFiniteActivity a ((i + 1) / 2)) := globalBirthAlternatingStep (globalBirthFiniteActivity a) (globalBirthFiniteVisit a visit) (globalBirthFiniteEdge a visit edge) i variable [∀ p, DecidableEq (R p)] theorem global_birth_finite_visit_row (j : Fin (n + 1)) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) : globalBirthRawStepRow (globalBirthFiniteVisit a visit j.val) G H q = globalBirthRawStepRow (visit j) G H q := by unfold globalBirthFiniteVisit exact congrArg (fun k => globalBirthRawStepRow (visit k) G H q) (global_birth_finite_index_at j) theorem global_birth_finite_edge_row (j : Fin n) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) : globalBirthRawStepRow (globalBirthFiniteEdge a visit edge j.val) G H q = globalBirthRawStepRow (edge j) G H q := by simp only [globalBirthFiniteEdge, dif_pos j.isLt, global_birth_reindex_step_row] theorem global_birth_finite_alternating_row_even (j : Fin (n + 1)) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) : globalBirthRawStepRow (globalBirthFiniteAlternatingStep a visit edge (2 * j.val)) G H q = globalBirthRawStepRow (visit j) G H q := by rw [globalBirthFiniteAlternatingStep, global_birth_alternating_step_row_even, global_birth_finite_visit_row] theorem global_birth_finite_alternating_row_odd (j : Fin n) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (H : Finset P) (q : FiniteOrderedTuple (Σ p, R p)) : globalBirthRawStepRow (globalBirthFiniteAlternatingStep a visit edge (2 * j.val + 1)) G H q = globalBirthRawStepRow (edge j) G H q := by rw [globalBirthFiniteAlternatingStep, global_birth_alternating_step_row_odd, global_birth_finite_edge_row] variable [∀ p, Fintype (R p)] theorem global_birth_finite_visit_kernel (j : Fin (n + 1)) (z w : (p : P) → GhostPhaseState (R p)) : globalBirthRawStepKernel (globalBirthFiniteVisit a visit j.val) z w = globalBirthRawStepKernel (visit j) z w := by unfold globalBirthFiniteVisit exact congrArg (fun k => globalBirthRawStepKernel (visit k) z w) (global_birth_finite_index_at j) theorem global_birth_finite_edge_kernel (j : Fin n) (z w : (p : P) → GhostPhaseState (R p)) : globalBirthRawStepKernel (globalBirthFiniteEdge a visit edge j.val) z w = globalBirthRawStepKernel (edge j) z w := by simp only [globalBirthFiniteEdge, dif_pos j.isLt, global_birth_reindex_step_kernel] theorem global_birth_finite_alternating_kernel_even (j : Fin (n + 1)) (z w : (p : P) → GhostPhaseState (R p)) : globalBirthRawStepKernel (globalBirthFiniteAlternatingStep a visit edge (2 * j.val)) z w = globalBirthRawStepKernel (visit j) z w := by rw [globalBirthFiniteAlternatingStep, global_birth_alternating_step_kernel_even, global_birth_finite_visit_kernel] theorem global_birth_finite_alternating_kernel_odd (j : Fin n) (z w : (p : P) → GhostPhaseState (R p)) : globalBirthRawStepKernel (globalBirthFiniteAlternatingStep a visit edge (2 * j.val + 1)) z w = globalBirthRawStepKernel (edge j) z w := by rw [globalBirthFiniteAlternatingStep, global_birth_alternating_step_kernel_odd, global_birth_finite_edge_kernel] end Steps end section open Finset section variable {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (g : G) (β : ↥(P g) → ℝ) include G P J ell L g β /- An injective physical slot list visits each active group label exactly once. -/ theorem physical_group_slot_product_eq_active : (∏ s : PhysicalSlots J ell, β (L g s)) = ∏ p : ↥(P g), if physicalGroupPhaseActivity L g p then β p else 1 := by calc _ = ∏ p ∈ ghostPhaseActivitySupport (physicalGroupPhaseActivity L g), β p := by rw [physical_group_phase_activity_support_eq_image, prod_image (L g).injective.injOn] _ = _ := prod_filter (fun p => physicalGroupPhaseActivity L g p = true) β /- The actual tilted initial slot product is the initial active-label product. -/ theorem physical_group_initial_tilt_eq_active (V : ℝ) : (∏ s : PhysicalSlots J ell, β (L g s) / V) = ∏ p : ↥(P g), if physicalGroupPhaseActivity L g p then β p / V else 1 := physical_group_slot_product_eq_active L g (fun p => β p / V) end /- Run normalization is a change to the initial parameter only. The beta parameter in later kernels may stay unchanged. This includes both inactive vacua and pending states, not just the supported initial active state. -/ theorem ghost_phase_run_initial_eq_tilted {R : Type*} (a : Bool) (β V : ℝ) (z : GhostPhaseState R) : ghostPhaseRunInitial a β V z = ghostPhaseInitial a (β / V) z := by cases a <;> cases z <;> simp [ghostPhaseRunInitial, ghostPhaseInitial, div_eq_mul_inv, mul_comm] end section open Finset open scoped Classical end section noncomputable def distanceBinCap (N r j : ℕ) : ℝ := if j = 0 then N else (r : ℝ) / j theorem distance_bin_cap_nonneg (N r j : ℕ) : 0 ≤ distanceBinCap N r j := by unfold distanceBinCap split_ifs <;> positivity theorem distance_bin_cap_sum (N r : ℕ) : (∑ j ∈ Finset.range (r + 1), distanceBinCap N r j) = N + (r : ℝ) * (harmonic r : ℝ) := by rw [Finset.sum_range_succ'] simp only [distanceBinCap, Nat.add_eq_zero_iff, one_ne_zero, and_false, ↓reduceIte, Nat.cast_add, Nat.cast_one] have hh : (∑ j ∈ Finset.range r, (r : ℝ) / (j + 1)) = (r : ℝ) * (harmonic r : ℝ) := by simp only [harmonic, Rat.cast_sum, Rat.cast_inv, Rat.cast_add, Rat.cast_one, Rat.cast_natCast, Finset.mul_sum, Nat.cast_add, Nat.cast_one, div_eq_mul_inv] rw [hh, add_comm] theorem centered_circle_bin_le (r : ℕ) (x : ℝ) : (signedDistanceBin (2 * (r : ℝ)) (x - (round x : ℝ))).2 ≤ r := by change ⌊2 * (r : ℝ) * |x - (round x : ℝ)|⌋₊ ≤ r have hb : 2 * (r : ℝ) * |x - (round x : ℝ)| ≤ r := by have h := abs_sub_round x nlinarith exact (Nat.floor_le_floor hb).trans_eq (Nat.floor_natCast r) theorem circle_geometric_le_distance_bin_cap (N : ℕ) {r : ℕ} (hr : 0 < r) (x : ℝ) : circleGeometricBound N x ≤ distanceBinCap N r (signedDistanceBin (2 * (r : ℝ)) (x - (round x : ℝ))).2 := by let j := (signedDistanceBin (2 * (r : ℝ)) (x - (round x : ℝ))).2 change circleGeometricBound N x ≤ distanceBinCap N r j by_cases hj : j = 0 · rw [distanceBinCap, if_pos hj] unfold circleGeometricBound split_ifs · exact le_rfl · exact min_le_left _ _ · have hj0 : (0 : ℝ) < j := by exact_mod_cast (Nat.pos_of_ne_zero hj) have hr0 : (0 : ℝ) < r := by exact_mod_cast hr have hfloor : (j : ℝ) ≤ 2 * (r : ℝ) * ‖(x : UnitAddCircle)‖ := by rw [UnitAddCircle.norm_eq] exact Nat.floor_le (by positivity) have hd : 0 < ‖(x : UnitAddCircle)‖ := by nlinarith rw [distanceBinCap, if_neg hj, circleGeometricBound, if_neg (norm_pos_iff.mp hd)] apply (min_le_right _ _).trans apply (div_le_div_iff₀ (by positivity : 0 < 2 * ‖(x : UnitAddCircle)‖) hj0).mpr nlinarith /- Mutually `1/(2r)`-separated phases have two near-zero bins and a harmonic tail. -/ theorem circle_geometric_finite_sum_le {ι : Type*} (S : Finset ι) (θ : ι → ℝ) (N : ℕ) {r : ℕ} (hr : 0 < r) (hsep : ∀ i ∈ S, ∀ j ∈ S, i ≠ j → 1 / (2 * (r : ℝ)) ≤ ‖((θ i - θ j : ℝ) : UnitAddCircle)‖) : (∑ i ∈ S, circleGeometricBound N (θ i)) ≤ 2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r) := by classical let key := fun i => signedDistanceBin (2 * (r : ℝ)) (θ i - (round (θ i) : ℝ)) let W : Bool × ℕ → ℝ := fun b => distanceBinCap N r b.2 have hi : Set.InjOn key S := centered_circle_distance_bin_injOn S θ (by positivity) hsep have hs : S.image key ⊆ Finset.univ ×ˢ Finset.range (r + 1) := by intro b hb obtain ⟨i, hiS, rfl⟩ := Finset.mem_image.mp hb simp only [Finset.mem_product, Finset.mem_univ, true_and, Finset.mem_range] exact Nat.lt_succ_of_le (centered_circle_bin_le r (θ i)) calc _ ≤ ∑ i ∈ S, W (key i) := Finset.sum_le_sum (fun i hiS => circle_geometric_le_distance_bin_cap N hr (θ i)) _ = ∑ b ∈ S.image key, W b := (Finset.sum_image hi).symm _ ≤ ∑ b ∈ Finset.univ ×ˢ Finset.range (r + 1), W b := Finset.sum_le_sum_of_subset_of_nonneg hs (fun b hb hn => distance_bin_cap_nonneg N r b.2) _ = 2 * ((N : ℝ) + (r : ℝ) * (harmonic r : ℝ)) := by rw [Finset.sum_product] simp only [W, distance_bin_cap_sum, Finset.sum_const, Finset.card_univ, Fintype.card_bool, nsmul_eq_mul, Nat.cast_ofNat] _ ≤ _ := by have hh := harmonic_le_one_add_log r have hr0 : (0 : ℝ) ≤ r := by positivity nlinarith end section open Finset Filter open scoped Topology noncomputable def candidateRoughSlot (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) : (candidateQIndices c L) × Fin r := (⟨jStar, hj⟩, ⟨0, hr⟩) theorem candidate_Q_choices_eq_single_rough (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) : candidateQSlotChoices c L r jStar = fun slot => if slot = candidateRoughSlot c L r jStar hr hj then candidateRoughBand c L jStar else candidateQBand (c * L) slot.1.val := by funext slot have hiff : (slot.1.val = jStar ∧ slot.2.val = 0) ↔ slot = candidateRoughSlot c L r jStar hr hj := by constructor · intro h exact Prod.ext (Subtype.ext h.1) (Fin.ext h.2) · intro h subst slot exact ⟨rfl, rfl⟩ simp only [candidateQSlotChoices, hiff] theorem candidate_Q_choices_eq_pure {c L : ℝ} {r jStar : ℕ} (hj : jStar ∉ candidateQIndices c L) : candidateQSlotChoices c L r jStar = fun slot => candidateQBand (c * L) slot.1.val := by funext slot have hnot : ¬(slot.1.val = jStar ∧ slot.2.val = 0) := by intro h exact hj (h.1 ▸ slot.1.property) exact if_neg hnot theorem candidate_Q_group_disjoint {c L : ℝ} (hcL : 0 ≤ c * L) : Pairwise (fun i j : candidateQIndices c L => Disjoint (candidateQBand (c * L) i.val) (candidateQBand (c * L) j.val)) := by have hpair : Pairwise (fun i j : ℕ => Disjoint (candidateQBand (c * L) i) (candidateQBand (c * L) j)) := pairwise_disjoint_dyadicPrimeBand hcL (by norm_num) (by norm_num) intro i j hij exact hpair (fun h => hij (Subtype.ext h)) theorem candidate_Q_weight_le_one_of_rough_absent {c L : ℝ} {r jStar : ℕ} (hcL : 0 ≤ c * L) (hj : jStar ∉ candidateQIndices c L) (n : ℕ) : candidateQWeight c L r jStar n ≤ 1 := by rw [candidateQWeight, candidate_Q_choices_eq_pure hj] simpa only [Fintype.card_coe] using grouped_prime_slot_weight_le_one (fun j : candidateQIndices c L => candidateQBand (c * L) j.val) r (fun _ _ hp => (mem_filter.mp hp).2) (candidate_Q_group_disjoint hcL) n theorem eventually_candidateQBand_nonempty {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ j ∈ candidateQIndices c L, (candidateQBand (c * L) j).Nonempty := by obtain ⟨v, V, hv, _, hband⟩ := exists_candidateQBands_bounds hc filter_upwards [hband] with L hL intro j hj by_contra hempty have hm := (hL.2.2 j hj).2.2.1 rw [not_nonempty_iff_eq_empty.mp hempty, sum_empty] at hm linarith end section open Finset Classical section variable {K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : K → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) end end section open scoped BigOperators theorem prime_band_product_character_factor {q : ℕ} (χ : DirichletCharacter ℂ q) (S : Finset ℕ) (c : ℕ) (v : ℝ) : (∑ p ∈ S, (1 / (v * (p : ℝ))) • χ ((c * p : ℕ) : ZMod q)) = (1 / v : ℝ) • (χ (c : ZMod q) * ∑ p ∈ S, (1 / (p : ℝ)) • χ (p : ZMod q)) := by rw [Finset.mul_sum, Finset.smul_sum] apply Finset.sum_congr rfl intro p _ simp only [Nat.cast_mul, map_mul, Complex.real_smul, Complex.ofReal_mul, one_div, mul_inv_rev] ring theorem prime_band_product_mixture_bound {X : Type*} [Fintype X] {q : ℕ} (χ : DirichletCharacter ℂ q) (S : X → Finset ℕ) (c : X → ℕ) (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hmass : ∑ x, μ x ≤ 1) {v B : ℝ} (hv : 0 < v) (hB : 0 ≤ B) (hinner : ∀ x, ‖∑ p ∈ S x, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ B) : ‖∑ x, (μ x : ℂ) * ∑ p ∈ S x, (1 / (v * (p : ℝ))) • χ ((c x * p : ℕ) : ZMod q)‖ ≤ B / v := by have hlocal (x : X) : ‖∑ p ∈ S x, (1 / (v * (p : ℝ))) • χ ((c x * p : ℕ) : ZMod q)‖ ≤ B / v := by rw [prime_band_product_character_factor, norm_smul, norm_mul, Real.norm_eq_abs, abs_of_pos (one_div_pos.mpr hv)] calc _ ≤ (1 / v) * (1 * B) := mul_le_mul_of_nonneg_left (mul_le_mul (χ.norm_le_one _) (hinner x) (norm_nonneg _) (by norm_num)) (by positivity) _ = _ := by ring calc _ ≤ ∑ x, ‖(μ x : ℂ) * ∑ p ∈ S x, (1 / (v * (p : ℝ))) • χ ((c x * p : ℕ) : ZMod q)‖ := norm_sum_le _ _ _ = ∑ x, μ x * ‖∑ p ∈ S x, (1 / (v * (p : ℝ))) • χ ((c x * p : ℕ) : ZMod q)‖ := by apply Finset.sum_congr rfl intro x _ rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hμ x)] _ ≤ ∑ x, μ x * (B / v) := Finset.sum_le_sum (fun x _ => mul_le_mul_of_nonneg_left (hlocal x) (hμ x)) _ = (∑ x, μ x) * (B / v) := (Finset.sum_mul _ _ _).symm _ ≤ B / v := by simpa only [one_mul] using mul_le_mul_of_nonneg_right hmass (div_nonneg hB hv.le) end section open Finset noncomputable def physicalGroupRawVisit {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (g : G) (β : ↥(P g) → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) : GlobalBirthRawStep (R := fun p : ↥(P g) => ZMod p.val) (physicalGroupPhaseActivity L g) (physicalGroupPhaseActivity L g) := .visit (fun _ => 0) β η V ρ hV cap end section open Finset noncomputable def physicalGroupBareRawEdge {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (L R : PhysicalMarkLists P J ell) (n : ℤ) (hlist : physicalListAdmissible C aux L R) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hcompat : ∀ g s t, (L g s).val = (R g t).val → ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) (g : G) (hk : ∀ s, ¬ ((L g s).val : ℤ) ∣ k) (β : ↥(P g) → ℝ) (ρ V : ℝ) (cap : ℕ) : GlobalBirthRawStep (R := fun p : ↥(P g) => ZMod p.val) (physicalGroupPhaseActivity L g) (physicalGroupPhaseActivity R g) := .edge (physicalGroupPhaseDelta n (n + k * (physicalD C L aux : ℤ)) g) (physical_group_phase_shared_delta_zero_of_common_marks L R n (n + k * (physicalD C L aux : ℤ)) g (by intro s t he simpa only [add_sub_cancel_left] using hcompat g s t he)) (physicalGroupUnsharedEmbedding C L g) (physicalGroupUnsharedEmbedding C R g) (physical_group_phase_images_of_bare C aux k L R hlist hP hdis hcompat g hk).1 (physical_group_phase_images_of_bare C aux k L R hlist hP hdis hcompat g hk).2 β ρ V cap /- The constructed edge evaluates the literal unrestricted event row using the physical unshared slots and the exact transported-hit eligibility set. -/ theorem physical_group_bare_raw_edge_row {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (L R : PhysicalMarkLists P J ell) (n : ℤ) (hlist : physicalListAdmissible C aux L R) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hcompat : ∀ g s t, (L g s).val = (R g t).val → ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) (g : G) (hk : ∀ s, ¬ ((L g s).val : ℤ) ∣ k) (β : ↥(P g) → ℝ) (ρ V : ℝ) (cap : ℕ) (F : Finset ↥(P g) → FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val) → ℂ) (H : Finset ↥(P g)) (q : FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val)) : globalBirthRawStepRow (physicalGroupBareRawEdge C aux k L R n hlist hP hdis hcompat g hk β ρ V cap) F H q = globalBirthEdgeRawRow (physicalGroupUnsharedEmbedding C L g) (physicalGroupUnsharedEmbedding C R g) (physicalGroupPhaseDelta n (n + k * (physicalD C L aux : ℤ)) g) H q.2 (globalBirthRawHitIndices (physicalGroupPhaseDelta n (n + k * (physicalD C L aux : ℤ)) g) q) β ρ V cap F := rfl end section open Finset open scoped Classical noncomputable def cleanHybridPatternCoreAction {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell : ℕ} {N : G → ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (p : FixedOrderedMemoryLabels Pb N) (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : RepeatedBigLists Pb J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ) (source : RepeatedBigLists Pb J ell) (r : PhysicalResidues Ps × FixedOrderedResidues p) : ℂ := ∑ i, cleanHybridCoreAction Vb b (C i) ζ θ k p (K i) d f source r section variable {I S G : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : Fintype S] [sharedInstance3 : Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell : ℕ} {N : G → ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (p : FixedOrderedMemoryLabels Pb N) include I S G sharedInstance1 sharedInstance2 sharedInstance3 Ps Pb J ell N Vb b C ζ θ k p theorem clean_hybrid_pattern_core_translated (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : RepeatedBigLists Pb J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ) : cleanHybridPatternCoreAction Vb b C ζ θ k p K d f = cleanTranslatedSumOperator (fun a : (i : I) × PhysicalAuxLabels Pb (C i) => cleanHybridCoreCoefficient Vb b (C a.1) ζ θ k (K a.1) d a.2) (fun a source _ => cleanHybridResidueDirection p (cleanHybridStep k (C a.1) source a.2 d)) f := by funext source r simp only [cleanHybridPatternCoreAction, cleanHybridCoreAction, cleanTranslatedSumOperator, cleanTranslatedOperator, Fintype.sum_sigma, clean_hybrid_residue_translation] /- The frequency is independent of the pattern, so all signed patterns remain inside a single real-frequency ideal block. -/ theorem clean_hybrid_pattern_block_real_frequency [∀ q : PhysicalPrime Ps, NeZero q.2.val] [∀ g j, NeZero (p g j).val] (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (χ : AddChar (PhysicalResidues Ps × FixedOrderedResidues p) ℂ) : ∃ Θ : ℝ, ∀ (v : RepeatedBigLists Pb J ell → ℂ) source, cleanFourierSumBlock (fun a : (i : I) × PhysicalAuxLabels Pb (C i) => cleanHybridCoreCoefficient Vb b (C a.1) ζ θ k (K a.1) d a.2) (fun a source _ => cleanHybridResidueDirection p (cleanHybridStep k (C a.1) source a.2 d)) χ v source = physicalPhase ζ (physicalSharedProduct d) * ∑ target, (∑ i, ∑ aux, repeatedBigKernel Vb b (C i) ζ (K i) aux source target * physicalReturnPhase Θ (repeatedBigD (C i) source aux)) * v target := by obtain ⟨Θ, hΘ⟩ := exists_physical_character_return_frequency χ (cleanHybridResidueDirection (Ps := Ps) p) θ (k * (physicalSharedProduct d : ℤ)) refine ⟨Θ, ?_⟩ intro v source rw [clean_fourier_sum_block_matrix, mul_sum] apply sum_congr rfl intro target ht rw [← mul_assoc] congr 1 rw [Fintype.sum_sigma, mul_sum] apply sum_congr rfl intro i hi rw [mul_sum] apply sum_congr rfl intro aux ha have hstep : cleanHybridStep k (C i) source aux d = (k * (physicalSharedProduct d : ℤ)) * (repeatedBigD (C i) source aux : ℤ) := by unfold cleanHybridStep ring unfold cleanHybridCoreCoefficient rw [hstep] have h := hΘ (repeatedBigD (C i) source aux : ℤ) calc _ = physicalPhase ζ (physicalSharedProduct d) * (repeatedBigKernel Vb b (C i) ζ (K i) aux source target * (χ (cleanHybridResidueDirection p ((k * (physicalSharedProduct d : ℤ)) * (repeatedBigD (C i) source aux : ℤ))) * physicalReturnPhase θ ((k * (physicalSharedProduct d : ℤ)) * (repeatedBigD (C i) source aux : ℤ)))) := by ring _ = _ := by rw [h] theorem clean_hybrid_pattern_projected_norm_le [∀ q : PhysicalPrime Ps, NeZero q.2.val] [∀ g j, NeZero (p g j).val] (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (w : RepeatedBigLists Pb J ell → ℝ) (hw : ∀ x, 0 ≤ w x) (Proj : (RepeatedBigLists Pb J ell → ℂ) →ₗ[ℂ] (RepeatedBigLists Pb J ell → ℂ)) (U : Submodule ℂ (RepeatedBigLists Pb J ell → ℂ)) (hProjU : ∀ v, Proj v ∈ U) (hProj : ∀ v, cleanActiveNorm w (Proj v) ≤ cleanActiveNorm w v) (M : ℝ) (hM : 0 ≤ M) (hblock : ∀ (Θ : ℝ) (v : RepeatedBigLists Pb J ell → ℂ), v ∈ U → cleanActiveNorm w (Proj (fun source => ∑ target, (∑ i, ∑ aux, repeatedBigKernel Vb b (C i) ζ (K i) aux source target * physicalReturnPhase Θ (repeatedBigD (C i) source aux)) * v target)) ≤ M * cleanActiveNorm w v) (f : RepeatedBigLists Pb J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ) : cleanWeightedNorm w (cleanActiveMap Proj (cleanHybridPatternCoreAction Vb b C ζ θ k p K d (cleanActiveMap Proj f))) ≤ M * cleanWeightedNorm w f := by rw [clean_hybrid_pattern_core_translated] change cleanWeightedNorm w (cleanProjectedTranslatedSum Proj _ _ f) ≤ _ apply clean_projected_translated_norm_le Proj w hw U hProjU hProj _ _ M hM _ f intro χ v hv obtain ⟨Θ, hΘ⟩ := clean_hybrid_pattern_block_real_frequency Vb b C ζ θ k p K d χ have he : cleanFourierSumBlock (fun a : (i : I) × PhysicalAuxLabels Pb (C i) => cleanHybridCoreCoefficient Vb b (C a.1) ζ θ k (K a.1) d a.2) (fun a source _ => cleanHybridResidueDirection p (cleanHybridStep k (C a.1) source a.2 d)) χ v = physicalPhase ζ (physicalSharedProduct d) • (fun source => ∑ target, (∑ i, ∑ aux, repeatedBigKernel Vb b (C i) ζ (K i) aux source target * physicalReturnPhase Θ (repeatedBigD (C i) source aux)) * v target) := by funext source exact hΘ v source rw [he, map_smul] simpa only [cleanActiveNorm, Pi.smul_apply, smul_eq_mul, norm_mul, physical_phase_norm, one_mul] using hblock Θ v hv end end section end section /- Each short integer block is separated; the number of blocks is controlled by the actual width of the supporting integer interval. -/ theorem rational_phase_interval_row_sum_le {ι : Type*} (S : Finset ι) (t : ι → ℤ) (hinj : Set.InjOn t S) (A : ℤ) (V N : ℕ) (ht : ∀ i ∈ S, A ≤ t i ∧ t i ≤ A + (V : ℤ)) {u : ℤ} {r : ℕ} (hr : 2 ≤ r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) (base : ℝ) : (∑ i ∈ S, circleGeometricBound N (((u : ℝ) / r + β) * t i - base)) ≤ (1 + 3 * (V : ℝ) / r) * (2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r)) := by classical let H : ℕ := r / 2 let B : ℝ := 2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r) have hH : 0 < H := half_integer_block_pos hr have hHZ : (0 : ℤ) < H := by exact_mod_cast hH have hr0 : 0 < r := by omega have hlog : 0 ≤ Real.log (r : ℝ) := Real.log_nonneg (by exact_mod_cast (show 1 ≤ r by omega)) have hB : 0 ≤ B := by dsimp [B]; positivity have hfiber : ∀ j : ℤ, (∑ i ∈ S with (t i - A) / (H : ℤ) = j, circleGeometricBound N (((u : ℝ) / r + β) * t i - base)) ≤ B := by intro j apply circle_geometric_finite_sum_le _ _ N hr0 intro i hi k hk hik obtain ⟨hiS, hiB⟩ := Finset.mem_filter.mp hi obtain ⟨hkS, hkB⟩ := Finset.mem_filter.mp hk have hsmall := same_positive_ediv_abs_sub_lt hHZ (hiB.trans hkB.symm) have heZ : (t i - A) - (t k - A) = t i - t k := by ring rw [heZ] at hsmall have hsmallR : |((t i - t k : ℤ) : ℝ)| < (H : ℝ) := by exact_mod_cast hsmall have hsize : |((t i - t k : ℤ) : ℝ)| ≤ (r : ℝ) / 2 := hsmallR.le.trans (half_integer_block_comparison hr).2 have hne : t i - t k ≠ 0 := by intro he exact hik (hinj hiS hkS (sub_eq_zero.mp he)) have hs := coprime_rational_phase_separation hr0 hcop hne hβ hsize have he : (((u : ℝ) / r + β) * t i - base) - (((u : ℝ) / r + β) * t k - base) = ((u : ℝ) / r + β) * ((t i - t k : ℤ) : ℝ) := by push_cast ring rw [he] exact hs have hcard : ((S.image (fun i => (t i - A) / (H : ℤ))).card : ℝ) ≤ 1 + 3 * (V : ℝ) / r := by have hh : ((S.image (fun i => (t i - A) / (H : ℤ))).card : ℝ) ≤ ((V / H + 1 : ℕ) : ℝ) := by exact_mod_cast shifted_integer_block_image_card_le S t A V hH ht exact hh.trans (half_integer_block_count_le hr V) rw [← sum_integerBlock_fibers S (fun i => t i - A) (H : ℤ) (fun i => circleGeometricBound N (((u : ℝ) / r + β) * t i - base))] calc _ ≤ ∑ _j ∈ S.image (fun i => (t i - A) / (H : ℤ)), B := Finset.sum_le_sum (fun j hj => hfiber j) _ = ((S.image (fun i => (t i - A) / (H : ℤ))).card : ℝ) * B := by rw [Finset.sum_const, nsmul_eq_mul] _ ≤ _ := mul_le_mul_of_nonneg_right hcard hB theorem circle_geometric_bound_le_length (N : ℕ) (x : ℝ) : circleGeometricBound N x ≤ (N : ℝ) := by unfold circleGeometricBound split_ifs · exact le_rfl · exact min_le_left _ _ section variable {ι : Type*} (S : Finset ι) (t : ι → ℤ) (hinj : Set.InjOn t S) (A : ℤ) (V N : ℕ) (ht : ∀ i ∈ S, A ≤ t i ∧ t i ≤ A + (V : ℤ)) include ι S t hinj A V N ht theorem integer_interval_trivial_circle_row (θ : ι → ℝ) : (∑ i ∈ S, circleGeometricBound N (θ i)) ≤ ((V : ℝ) + 1) * N := by calc _ ≤ ∑ _i ∈ S, (N : ℝ) := Finset.sum_le_sum (fun i hi => circle_geometric_bound_le_length N (θ i)) _ = (S.card : ℝ) * N := by rw [Finset.sum_const, nsmul_eq_mul] _ ≤ _ := mul_le_mul_of_nonneg_right (by exact_mod_cast integer_interval_injOn_card_le S t hinj A V ht) (by positivity) /- Positive moduli, including modulus one by the finite interval count. -/ theorem rational_phase_interval_row_sum_le_of_pos {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) (base : ℝ) : (∑ i ∈ S, circleGeometricBound N (((u : ℝ) / r + β) * t i - base)) ≤ (1 + 3 * (V : ℝ) / r) * (2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r)) := by by_cases hr1 : r = 1 · subst r have hb := integer_interval_trivial_circle_row S t hinj A V N ht (fun i => ((u : ℝ) / 1 + β) * t i - base) simp only [Nat.cast_one, div_one, Real.log_one] at hb ⊢ have hprod : 0 ≤ (V : ℝ) * (N : ℝ) := by positivity nlinarith · exact rational_phase_interval_row_sum_le S t hinj A V N ht (by omega) hcop hβ base end end section open Finset Filter open scoped Topology theorem candidate_Q_weight_le_roughDivisors_of_present {c L : ℝ} {r jStar : ℕ} (hcL : 0 ≤ c * L) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (hband : (candidateQBand (c * L) jStar).Nonempty) {n : ℕ} (hn : n ≠ 0) : candidateQWeight c L r jStar n ≤ ((roughDivisors (Real.exp (Real.sqrt L)) n).card : ℝ) := by classical obtain ⟨q0, hq0⟩ := hband let P := fun j : candidateQIndices c L => candidateQBand (c * L) j.val let R := candidateRoughBand c L jStar let e := candidateRoughSlot c L r jStar hr hj have heq : candidateQSlotChoices c L r jStar = oneExceptionPrimeChoices P R e := by exact candidate_Q_choices_eq_single_rough c L r jStar hr hj have h := one_exception_ordered_slot_weight_le P R r e (fun _ _ hp => (mem_filter.mp hp).2) (candidate_Q_group_disjoint hcL) (fun _ hd => (roughBand_pos hd).ne') q0 hq0 n rw [candidateQWeight, heq] have h' : orderedSlotWeight (oneExceptionPrimeChoices P R e) ((r.factorial : ℝ)^(candidateQIndices c L).card) n ≤ ((R.filter (fun d => d ∣ n)).card : ℝ) := by simpa only [Fintype.card_coe] using h refine h'.trans ?_ exact Nat.cast_le.mpr (roughBand_divisor_filter_card_le hn) theorem eventually_candidate_Q_weight_le_roughDivisors {c : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) : ∀ᶠ L : ℝ in atTop, ∀ jStar n : ℕ, candidateQWeight c L r jStar n ≤ ((roughDivisors (Real.exp (Real.sqrt L)) n).card : ℝ) := by filter_upwards [eventually_candidateQBand_nonempty hc, eventually_ge_atTop (0 : ℝ)] with L hb hL intro jStar n by_cases hn : n = 0 · subst n rw [candidate_Q_weight_zero_at_zero] positivity · by_cases hj : jStar ∈ candidateQIndices c L · exact candidate_Q_weight_le_roughDivisors_of_present (mul_nonneg hc.le hL) hr hj (hb jStar hj) hn · exact (candidate_Q_weight_le_one_of_rough_absent (mul_nonneg hc.le hL) hj n).trans (by exact_mod_cast one_le_roughDivisors_card (Real.exp (Real.sqrt L)) hn) theorem eventually_candidate_Q_weight_le_divisors {c : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) : ∀ᶠ L : ℝ in atTop, ∀ jStar n : ℕ, candidateQWeight c L r jStar n ≤ (n.divisors.card : ℝ) := by filter_upwards [eventually_candidate_Q_weight_le_roughDivisors hc hr] with L hL intro jStar n refine (hL jStar n).trans ?_ exact_mod_cast card_filter_le n.divisors (fun d => ∀ p ∈ d.primeFactors, Real.exp (Real.sqrt L) ≤ (p : ℝ)) theorem wide_window_nat_le_exp_twice {L : ℝ} (hL : Real.log 16 ≤ L) {n : ℕ} (hn : (n : ℝ) ≤ 16 * Real.exp L) : (n : ℝ) ≤ Real.exp (2 * L) := by have h16 : (16 : ℝ) ≤ Real.exp L := (Real.log_le_iff_le_exp (by norm_num : (0 : ℝ) < 16)).mp hL calc _ ≤ 16 * Real.exp L := hn _ ≤ Real.exp L * Real.exp L := mul_le_mul_of_nonneg_right h16 (Real.exp_pos _).le _ = Real.exp (2 * L) := by rw [← Real.exp_add]; congr 1; ring theorem eventually_candidate_Q_weight_le_exp_sqrt {c : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) : ∀ᶠ L : ℝ in atTop, ∀ jStar n : ℕ, (n : ℝ) ≤ 16 * Real.exp L → candidateQWeight c L r jStar n ≤ Real.exp ((2 * Real.log 2) * Real.sqrt L) := by filter_upwards [eventually_candidate_Q_weight_le_roughDivisors hc hr, eventually_ge_atTop (Real.log 16), eventually_gt_atTop (0 : ℝ)] with L hq hlarge hL intro jStar n hn by_cases hn0 : n = 0 · subst n rw [candidate_Q_weight_zero_at_zero] exact (Real.exp_pos _).le · exact (hq jStar n).trans (roughDivisors_card_le_exp_sqrt hL hn0 (wide_window_nat_le_exp_twice hlarge hn)) end section open Finset open scoped Classical section PhysicalPath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (x : Fin (n + 1) → PhysicalState P J ell) (hadm : ∀ j : Fin n, physicalAdmissible (C j) (aux j) (k j) (x j.castSucc) (x j.succ)) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ (((x j.castSucc).2.val g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) variable [∀ p : ↥(P g), NeZero p.val] end PhysicalPath end section theorem physical_group_phase_activity_permute {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations G J ell) (L : PhysicalMarkLists P J ell) (g : G) : physicalGroupPhaseActivity (physicalPermuteLabels σ L) g = physicalGroupPhaseActivity L g := by funext p simp only [physicalGroupPhaseActivity, physical_group_marks_permute] section Edge variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (σ τ : PhysicalPermutations G J ell) {x y : PhysicalState P J ell} (hadm : physicalAdmissible C aux k (physicalPermutationEquiv σ x) (physicalPermutationEquiv τ y)) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ s, ¬ ((x.2.val g s).val : ℤ) ∣ k) (β : ↥(P g) → ℝ) (ρ V : ℝ) (cap : ℕ) end Edge end section open Finset open scoped Classical /- Full-slot symmetrization and the physical active product weight instantiate all projection hypotheses. The only analytic input is the compressed ideal block. -/ theorem clean_hybrid_symmetric_pattern_norm_le {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell : ℕ} {N : G → ℕ} (Vb : G → ℝ) (hV : ∀ g, 0 ≤ Vb g) (b : ∀ g, Pb g → ℝ) (hb : ∀ g q, 0 ≤ b g q) (C : I → G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (p : FixedOrderedMemoryLabels Pb N) [∀ q : PhysicalPrime Ps, NeZero q.2.val] [∀ g j, NeZero (p g j).val] (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (M : ℝ) (hM : 0 ≤ M) (hblock : ∀ (Θ : ℝ) (v : RepeatedBigLists Pb J ell → ℂ), v ∈ repeatedBigSymmetricSubspace → cleanActiveNorm (repeatedBigActiveMass Vb b) (repeatedBigSymmetrizeLinear (fun source => ∑ target, (∑ i, ∑ aux, repeatedBigKernel Vb b (C i) ζ (K i) aux source target * physicalReturnPhase Θ (repeatedBigD (C i) source aux)) * v target)) ≤ M * cleanActiveNorm (repeatedBigActiveMass Vb b) v) (f : RepeatedBigLists Pb J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ) : cleanWeightedNorm (repeatedBigActiveMass Vb b) (cleanActiveMap repeatedBigSymmetrizeLinear (cleanHybridPatternCoreAction Vb b C ζ θ k p K d (cleanActiveMap repeatedBigSymmetrizeLinear f))) ≤ M * cleanWeightedNorm (repeatedBigActiveMass Vb b) f := by have hμ (source : RepeatedBigLists Pb J ell) : 0 ≤ repeatedBigActiveMass Vb b source := by apply prod_nonneg intro g hg apply prod_nonneg intro s hs exact tiltedPhysicalBirthLaw_nonneg Vb g (b g) (hV g) (hb g) (source g s) exact clean_hybrid_pattern_projected_norm_le Vb b C ζ θ k p K d (repeatedBigActiveMass Vb b) hμ repeatedBigSymmetrizeLinear repeatedBigSymmetricSubspace (fun v => repeated_big_symmetrize_mem v) (fun v => repeated_big_symmetrize_norm_le _ hμ (repeated_big_active_mass_permutation Vb b) v) M hM hblock f end section theorem rational_phase_fintype_interval_row_sum_le {Y : Type*} [Fintype Y] (t : Y → ℤ) (hinj : Function.Injective t) (A : ℤ) (V N : ℕ) (ht : ∀ y, A ≤ t y ∧ t y ≤ A + (V : ℤ)) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) (base : ℝ) : (∑ y, circleGeometricBound N (((u : ℝ) / r + β) * t y - base)) ≤ (1 + 3 * (V : ℝ) / r) * (2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r)) := rational_phase_interval_row_sum_le_of_pos Finset.univ t hinj.injOn A V N (fun y _ => ht y) hr hcop hβ base /- The arbitrary-width integer interval version of the separated bilinear bound. All coefficients may be complex; there are no prime or positivity assumptions on them. -/ theorem rational_phase_integer_interval_bilinear_norm_sq_le {Y : Type*} [Fintype Y] (t : Y → ℤ) (hinj : Function.Injective t) (A : ℤ) (V : ℕ) (ht : ∀ y, A ≤ t y ∧ t y ≤ A + (V : ℤ)) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) (a N : ℕ) (c : Fin N → ℂ) (b : Y → ℂ) : ‖∑ n : Fin N, ∑ y, c n * b y * (Complex.exp (Complex.I * (2 * Real.pi * (((u : ℝ) / r + β) * t y) : ℝ))) ^ (a + n.val)‖ ^ 2 ≤ ((1 + 3 * (V : ℝ) / r) * (2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r))) * (∑ n : Fin N, ‖c n‖ ^ 2) * ∑ y, ‖b y‖ ^ 2 := by apply circle_bilinear_norm_sq_le (fun y => ((u : ℝ) / r + β) * t y) a N c b intro y exact rational_phase_fintype_interval_row_sum_le t hinj A V N ht hr hcop hβ (((u : ℝ) / r + β) * t y) end section open Finset Filter open scoped Topology theorem exists_candidate_coefficient_divisor_bound {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) : ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ L : ℝ in atTop, ∀ jStar u : ℕ, 0 ≤ candidateCoefficient c L q r jStar u ∧ candidateCoefficient c L q r jStar u ≤ L^C * ((primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c * L))) u).divisors.card : ℝ) := by obtain ⟨C, hC, hW⟩ := exists_candidate_marked_weight_rpow_bound hc hq0 hq1 refine ⟨C, hC, ?_⟩ filter_upwards [hW, eventually_candidate_Q_weight_le_divisors hc hr] with L hw hq intro jStar u refine ⟨candidate_coefficient_nonneg c L hq0 r jStar u, ?_⟩ unfold candidateCoefficient let n := primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c * L))) u have h := mul_le_mul (hq jStar n) (hw (u : ℤ)).2 (hw (u : ℤ)).1 (Nat.cast_nonneg _) simpa only [mul_comm] using h theorem eventually_candidate_coefficient_le_exp_sqrt {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) : ∀ᶠ L : ℝ in atTop, ∀ jStar u : ℕ, (u : ℝ) ≤ 16 * Real.exp L → candidateCoefficient c L q r jStar u ≤ Real.exp ((2 * Real.log 2 + 1) * Real.sqrt L) := by filter_upwards [eventually_candidate_Q_weight_le_exp_sqrt hc hr, eventually_candidate_marked_multiplier_bound hc hq0 hq1 (2 * Real.log 2)] with L hq hW intro jStar u hu let n := primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c * L))) u have hn : (n : ℝ) ≤ 16 * Real.exp L := by have hnu : n ≤ u := Nat.div_le_self _ _ exact (by exact_mod_cast hnu : (n : ℝ) ≤ (u : ℝ)).trans hu exact hW (u : ℤ) (candidateQWeight c L r jStar n) (candidate_Q_weight_nonneg c L r jStar n) (hq jStar n hn) end section open Finset open scoped Classical section PhysicalPath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (x : Fin (n + 1) → PhysicalState P J ell) (σ τ : Fin n → PhysicalPermutations G J ell) (hadm : ∀ j : Fin n, physicalAdmissible (C j) (aux j) (k j) (physicalPermutationEquiv (σ j) (x j.castSucc)) (physicalPermutationEquiv (τ j) (x j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ (((x j.castSucc).2.val g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) variable [∀ p : ↥(P g), NeZero p.val] end PhysicalPath end section section Edge variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (L R : PhysicalMarkLists P J ell) (a : ℤ) (σ τ : PhysicalPermutations G J ell) (hlist : physicalListAdmissible C aux (physicalPermuteLabels σ L) (physicalPermuteLabels τ R)) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hcompat : ∀ g s t, ((physicalPermuteLabels σ L) g s).val = ((physicalPermuteLabels τ R) g t).val → (((physicalPermuteLabels σ L) g s).val : ℤ) ∣ k * (physicalD C (physicalPermuteLabels σ L) aux : ℤ)) (g : G) (hk : ∀ s, ¬ ((L g s).val : ℤ) ∣ k) (β : ↥(P g) → ℝ) (ρ V : ℝ) (cap : ℕ) noncomputable def physicalGroupPermutedBareRawEdge : GlobalBirthRawStep (R := fun p : ↥(P g) => ZMod p.val) (physicalGroupPhaseActivity L g) (physicalGroupPhaseActivity R g) := globalBirthReindexStep (physical_group_phase_activity_permute σ L g) (physical_group_phase_activity_permute τ R g) (physicalGroupBareRawEdge C aux k (physicalPermuteLabels σ L) (physicalPermuteLabels τ R) a hlist hP hdis hcompat g (fun s => hk (σ g s)) β ρ V cap) theorem physical_group_permuted_bare_raw_edge_row (F : Finset ↥(P g) → FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val) → ℂ) (H : Finset ↥(P g)) (q : FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val)) : globalBirthRawStepRow (physicalGroupPermutedBareRawEdge C aux k L R a σ τ hlist hP hdis hcompat g hk β ρ V cap) F H q = globalBirthEdgeRawRow (physicalGroupUnsharedEmbedding C (physicalPermuteLabels σ L) g) (physicalGroupUnsharedEmbedding C (physicalPermuteLabels τ R) g) (physicalGroupPhaseDelta a (a + k * (physicalD C (physicalPermuteLabels σ L) aux : ℤ)) g) H q.2 (globalBirthRawHitIndices (physicalGroupPhaseDelta a (a + k * (physicalD C (physicalPermuteLabels σ L) aux : ℤ)) g) q) β ρ V cap F := by exact global_birth_reindex_step_row _ _ _ F H q theorem physical_group_permuted_bare_raw_edge_kernel [∀ p : ↥(P g), NeZero p.val] (z w : (p : ↥(P g)) → GhostPhaseState (ZMod p.val)) : globalBirthRawStepKernel (physicalGroupPermutedBareRawEdge C aux k L R a σ τ hlist hP hdis hcompat g hk β ρ V cap) z w = globalBirthRawStepKernel (physicalGroupBareRawEdge C aux k (physicalPermuteLabels σ L) (physicalPermuteLabels τ R) a hlist hP hdis hcompat g (fun s => hk (σ g s)) β ρ V cap) z w := by exact global_birth_reindex_step_kernel _ _ _ z w end Edge end section open Finset Filter /- Any subset retaining the stated polynomial weighted mass already contains exponentially many distinct elements. -/ theorem eventually_candidate_subset_card_lower {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (C : ℝ) {eps : ℝ} (heps : 0 < eps) : ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (S : Finset ℕ), S ⊆ arithmeticProductWindow 1 (Real.exp L) → Real.exp L * L^(-C) ≤ (∑ u ∈ S, candidateCoefficient c L q r jStar u) → Real.exp ((1 - eps) * L) ≤ (S.card : ℝ) := by filter_upwards [eventually_candidate_coefficient_le_exp_sqrt hc hr hq0 hq1, eventually_weighted_mass_card_lower C (2 * Real.log 2 + 1) heps] with L hpoint hcard intro jStar S hS hmass apply hcard ℕ S (candidateCoefficient c L q r jStar) hmass intro u hu have hwindow := (mem_arithmeticProductWindow_iff one_ne_zero (Real.exp L)).mp (hS hu) exact hpoint jStar u (by simpa only [one_mul] using hwindow.2) end section open Finset open scoped Classical section PhysicalPath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (x : Fin (n + 1) → PhysicalState P J ell) (σ τ : Fin n → PhysicalPermutations G J ell) (hadm : ∀ j : Fin n, physicalAdmissible (C j) (aux j) (k j) (physicalPermutationEquiv (σ j) (x j.castSucc)) (physicalPermutationEquiv (τ j) (x j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ (((x j.castSucc).2.val g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) variable [∀ p : ↥(P g), NeZero p.val] end PhysicalPath end section open Finset open scoped Classical section PhysicalPath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations G J ell) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) /- The activity at each actual vertex of the finite physical path. -/ def physicalGroupBareFiniteActivity (j : Fin (n + 1)) : ↥(P g) → Bool := physicalGroupPhaseActivity (L j) g /- All visits use the zero hit in their own moving frame. -/ noncomputable def physicalGroupBareFiniteVisit (j : Fin (n + 1)) : GlobalBirthRawStep (R := fun p : ↥(P g) => ZMod p.val) (physicalGroupBareFiniteActivity L g j) (physicalGroupBareFiniteActivity L g j) := physicalGroupRawVisit (L j) g β (η j) V ρ hV cap /- Each edge uses its start offset and actual permuted unshared slot lists. -/ noncomputable def physicalGroupBareFiniteEdge (j : Fin n) : GlobalBirthRawStep (R := fun p : ↥(P g) => ZMod p.val) (physicalGroupBareFiniteActivity L g j.castSucc) (physicalGroupBareFiniteActivity L g j.succ) := physicalGroupPermutedBareRawEdge (C j) (aux j) (k j) (L j.castSucc) (L j.succ) (a j.castSucc) (σ j) (τ j) (hlist j) hP hdis (hcompat j) g (hk j) β ρ V cap /- The extended atomic activity is used only through cut 2*n+1. -/ def physicalGroupBareAtomicActivity (i : ℕ) : ↥(P g) → Bool := globalBirthFiniteActivity (physicalGroupBareFiniteActivity L g) (i / 2) /- Interleave n+1 physical visits with precisely n physical edges. -/ noncomputable def physicalGroupBareFiniteStep (i : ℕ) : GlobalBirthRawStep (R := fun p : ↥(P g) => ZMod p.val) (physicalGroupBareAtomicActivity L g i) (physicalGroupBareAtomicActivity L g (i + 1)) := globalBirthFiniteAlternatingStep (physicalGroupBareFiniteActivity L g) (physicalGroupBareFiniteVisit L g β η V ρ hV cap) (physicalGroupBareFiniteEdge C aux k L a σ τ hlist hP hdis hcompat g hk β V ρ cap) i omit [Fintype G] in theorem physical_group_bare_atomic_activity_initial : physicalGroupBareAtomicActivity L g 0 = physicalGroupPhaseActivity (L 0) g := by simpa only [physicalGroupBareAtomicActivity, Nat.zero_div, physicalGroupBareFiniteActivity, Fin.val_zero] using (global_birth_finite_activity_at (physicalGroupBareFiniteActivity L g) (0 : Fin (n + 1))) omit [Fintype G] in theorem physical_group_bare_atomic_activity_terminal : physicalGroupBareAtomicActivity L g (2 * n + 1) = physicalGroupPhaseActivity (L (Fin.last n)) g := by unfold physicalGroupBareAtomicActivity rw [show (2 * n + 1) / 2 = n by omega] exact global_birth_finite_activity_tail (physicalGroupBareFiniteActivity L g) n le_rfl theorem physical_group_bare_finite_visit_row (j : Fin (n + 1)) (F : Finset ↥(P g) → FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val) → ℂ) (H : Finset ↥(P g)) (q : FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val)) : globalBirthRawStepRow (physicalGroupBareFiniteStep C aux k L a σ τ hlist hP hdis hcompat g hk β η V ρ hV cap (2 * j.val)) F H q = globalBirthGhostVisitRawRow (fun _ => 0) β (η j) V ρ cap H q.2 F := by exact global_birth_finite_alternating_row_even (physicalGroupBareFiniteActivity L g) (physicalGroupBareFiniteVisit L g β η V ρ hV cap) (physicalGroupBareFiniteEdge C aux k L a σ τ hlist hP hdis hcompat g hk β V ρ cap) j F H q theorem physical_group_bare_finite_edge_row (j : Fin n) (F : Finset ↥(P g) → FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val) → ℂ) (H : Finset ↥(P g)) (q : FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val)) : globalBirthRawStepRow (physicalGroupBareFiniteStep C aux k L a σ τ hlist hP hdis hcompat g hk β η V ρ hV cap (2 * j.val + 1)) F H q = globalBirthRawStepRow (physicalGroupPermutedBareRawEdge (C j) (aux j) (k j) (L j.castSucc) (L j.succ) (a j.castSucc) (σ j) (τ j) (hlist j) hP hdis (hcompat j) g (hk j) β ρ V cap) F H q := global_birth_finite_alternating_row_odd (physicalGroupBareFiniteActivity L g) (physicalGroupBareFiniteVisit L g β η V ρ hV cap) (physicalGroupBareFiniteEdge C aux k L a σ τ hlist hP hdis hcompat g hk β V ρ cap) j F H q variable [∀ p : ↥(P g), NeZero p.val] end PhysicalPath end section open Finset Filter open scoped Topology end section open Finset open scoped Classical theorem physical_marked_primes_permute {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations G J ell) (L : PhysicalMarkLists P J ell) : physicalMarkedPrimes (physicalPermuteLabels σ L) = physicalMarkedPrimes L := by ext p simp only [mem_physical_marked_primes, physical_group_marks_permute] section ResiduePath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations G J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) include hstep hmarks in theorem physical_group_residue_path_compatibility (j : Fin n) : ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ) := by apply physical_bare_step_compatibility_of_residues (C j) (aux j) (k j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ)) ζ (a j.castSucc) · simpa only [physical_marked_primes_permute] using hmarks j.castSucc · simpa only [physical_marked_primes_permute, ← hstep j] using hmarks j.succ variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) variable [∀ p : ↥(P g), NeZero p.val] end ResiduePath end section open Finset open scoped Classical section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (b : ∀ g, P g → ℝ) (hb : ∀ g p, 0 < b g p) include G sharedInstance1 P J ell b hb end section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) include G sharedInstance1 P J ell V b theorem repeated_big_active_mass_density (L : RepeatedBigLists P J ell) : repeatedBigActiveMass V b L = repeatedBigActiveMass V (fun _ _ => 1) L * cleanActiveDensity b L := by unfold repeatedBigActiveMass cleanActiveDensity rw [← prod_mul_distrib] apply prod_congr rfl intro g _ simpa only [tiltedPhysicalBirthLaw, div_one] using physical_tilted_birth_product_eq V (fun _ : PhysicalSlots J ell => g) b (L g) end end section open Finset open scoped Classical noncomputable def cleanActiveEmbedding {X : Type*} [Fintype X] (w : X → ℝ) : (X → ℂ) →ₗ[ℂ] EuclideanSpace ℂ X where toFun f := WithLp.toLp 2 (fun x => (Real.sqrt (w x) : ℂ) * f x) map_add' f g := by ext x; exact mul_add _ _ _ map_smul' c f := by ext x; change _ * (c * _) = c * (_ * _); ring section variable {X : Type*} [sharedInstance1 : Fintype X] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) include X sharedInstance1 w hw theorem clean_active_embedding_norm (f : X → ℂ) : ‖cleanActiveEmbedding w f‖ = cleanActiveNorm w f := by rw [EuclideanSpace.norm_eq] congr 1 apply sum_congr rfl intro x _ change ‖(Real.sqrt (w x) : ℂ) * f x‖ ^ 2 = w x * ‖f x‖ ^ 2 rw [norm_mul, mul_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg _), Real.sq_sqrt (hw x)] theorem clean_active_norm_add_le (f g : X → ℂ) : cleanActiveNorm w (f + g) ≤ cleanActiveNorm w f + cleanActiveNorm w g := by simp only [← clean_active_embedding_norm w hw, map_add] exact norm_add_le _ _ theorem clean_active_norm_sub_le (f g : X → ℂ) : cleanActiveNorm w (f - g) ≤ cleanActiveNorm w f + cleanActiveNorm w g := by simp only [← clean_active_embedding_norm w hw, map_sub] exact norm_sub_le _ _ end theorem clean_active_norm_sum_le {X I : Type*} [Fintype X] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (s : Finset I) (f : I → X → ℂ) : cleanActiveNorm w (∑ i ∈ s, f i) ≤ ∑ i ∈ s, cleanActiveNorm w (f i) := by simp only [← clean_active_embedding_norm w hw, map_sum] exact norm_sum_le _ _ theorem clean_active_norm_smul {X : Type*} [Fintype X] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (c : ℂ) (f : X → ℂ) : cleanActiveNorm w (c • f) = ‖c‖ * cleanActiveNorm w f := by simp only [← clean_active_embedding_norm w hw, map_smul, norm_smul] end section open Finset Filter open scoped Topology /- A restricted product window always lies in its full prime band. -/ theorem primeProductWindow_subset_primeBand {P : Finset ℕ} {R X : ℝ} (hP : ∀ p ∈ P, p.Prime) (hR : 0 < R) (hX : 0 < X) : primeProductWindow P R X ⊆ primeBand (X / R) (16 * (X / R)) := by intro p hp obtain ⟨hpP, hlo, hhi⟩ := mem_filter.mp hp apply (mem_primeBand_iff (by positivity) (by positivity) p).mpr refine ⟨hP p hpP, (div_lt_iff₀ hR).mpr hlo, ?_⟩ simpa only [mul_div_assoc] using (le_div_iff₀ hR).mpr hhi /- A harmonic bound on the full prime band bounds the restricted window's cardinality. -/ theorem primeProductWindow_card_upper_from_harmonic {P : Finset ℕ} {R X H : ℝ} (hP : ∀ p ∈ P, p.Prime) (hR : 0 < R) (hX : 0 < X) (hH : primeBandHarmonic (X / R) (16 * (X / R)) ≤ H) : ((primeProductWindow P R X).card : ℝ) ≤ 16 * (X / R) * H := by have hA : 0 < X / R := div_pos hX hR have hB : 0 < 16 * (X / R) := by positivity calc ((primeProductWindow P R X).card : ℝ) ≤ ((primeBand (X / R) (16 * (X / R))).card : ℝ) := by exact_mod_cast card_le_card (primeProductWindow_subset_primeBand hP hR hX) _ ≤ H * (16 * (X / R)) := (div_le_iff₀ hB).mp ((primeBandHarmonic_card_bounds hA (by linarith)).1.trans hH) _ = 16 * (X / R) * H := by ring /- A nonempty restricted Q-zero window determines the required logarithmic range. -/ theorem candidate_free_prime_log_bounds_of_nonempty {c L R : ℝ} (hR : 0 < R) (hne : (primeProductWindow (candidateQBand (c * L) 0) R (Real.exp L)).Nonempty) : c * L - Real.log 16 ≤ Real.log (Real.exp L / R) ∧ Real.log (Real.exp L / R) ≤ (6 / 5 : ℝ) * c * L := by obtain ⟨q, hq⟩ := hne obtain ⟨hqP, hqlo, hqhi⟩ := mem_filter.mp hq have hband : q.Prime ∧ Real.exp (c * L) < (q : ℝ) ∧ (q : ℝ) ≤ Real.exp ((6 / 5 : ℝ) * c * L) := by simpa only [candidateQBand, mem_dyadicPrimeBand_iff, pow_zero, div_one, one_mul, mul_assoc] using hqP have hY : 0 < Real.exp L / R := div_pos (Real.exp_pos L) hR have hYq : Real.exp L / R < (q : ℝ) := (div_lt_iff₀ hR).mpr hqlo have hqY : (q : ℝ) ≤ 16 * (Real.exp L / R) := by simpa only [mul_div_assoc] using (le_div_iff₀ hR).mpr hqhi constructor · have hlog := Real.log_le_log (Real.exp_pos (c * L)) (hband.2.1.le.trans hqY) rw [Real.log_exp, Real.log_mul (by norm_num : (16 : ℝ) ≠ 0) hY.ne'] at hlog linarith · simpa only [Real.log_exp] using Real.log_le_log hY (hYq.le.trans hband.2.2) /- Uniformly over every positive remaining factor, the free-prime count is O_c(exp(L)/(R L)). -/ theorem eventually_candidate_free_prime_card_upper {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ R : ℝ, 0 < R → ((primeProductWindow (candidateQBand (c * L) 0) R (Real.exp L)).card : ℝ) ≤ (512 * (Real.log 4 + 1) / c) * Real.exp L / (R * L) := by have ha : 0 < c / 2 := by positivity have hab : c / 2 ≤ (6 / 5 : ℝ) * c := by linarith filter_upwards [eventually_uniform_wide_prime_log_window ha hab, eventually_gt_atTop (0 : ℝ), eventually_ge_atTop ((2 * Real.log 16) / c)] with L hwide hL hlarge intro R hR by_cases hne : (primeProductWindow (candidateQBand (c * L) 0) R (Real.exp L)).Nonempty · obtain ⟨hlo, hhi⟩ := candidate_free_prime_log_bounds_of_nonempty hR hne have hthreshold : 2 * Real.log 16 ≤ L * c := (div_le_iff₀ hc).mp hlarge have hlo' : (c / 2) * L ≤ Real.log (Real.exp L / R) := by nlinarith have hH := (hwide (Real.log (Real.exp L / R)) hlo' hhi).2 have hH' : primeBandHarmonic (Real.exp L / R) (16 * (Real.exp L / R)) ≤ ((16 * (Real.log 4 + 1)) / (c / 2)) / L := by simpa only [Real.exp_add, Real.exp_log (div_pos (Real.exp_pos L) hR), Real.exp_log (by norm_num : (0 : ℝ) < 16), mul_comm (Real.exp L / R) 16] using hH have hb := primeProductWindow_card_upper_from_harmonic (P := candidateQBand (c * L) 0) (fun p hp => (mem_filter.mp hp).2) hR (Real.exp_pos L) hH' convert hb using 1 ring · rw [not_nonempty_iff_eq_empty.mp hne, card_empty, Nat.cast_zero] positivity end section open Finset Filter noncomputable def candidateQRestChoices (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (slot : {slot : (candidateQIndices c L) × Fin r // slot ≠ candidateFreeSlot c L r hr}) : Finset ℕ := candidateQSlotChoices c L r jStar slot.val noncomputable def candidateQRestHarmonicMass (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) : ℝ := ∑' n : ℕ, orderedSlotWeight (candidateQRestChoices c L r jStar hr) ((r.factorial : ℝ)^(candidateQIndices c L).card) n / (n : ℝ) section variable (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) include c L r jStar hr theorem candidate_Q_free_choice (hj : 0 < jStar) : candidateQSlotChoices c L r jStar (candidateFreeSlot c L r hr) = candidateQBand (c * L) 0 := by have hnot : (0 : ℕ) ≠ jStar := Nat.ne_of_lt hj simp only [candidateQSlotChoices, candidateFreeSlot, hnot, false_and, if_false] theorem candidate_Q_harmonic_mass_free_factor (hj : 0 < jStar) : candidateQHarmonicMass c L r jStar = (∑ p ∈ candidateQBand (c * L) 0, 1 / (p : ℝ)) * candidateQRestHarmonicMass c L r jStar hr := by have h := ordered_slot_harmonic_split (candidateQSlotChoices c L r jStar) (candidateFreeSlot c L r hr) ((r.factorial : ℝ)^(candidateQIndices c L).card) rw [candidate_Q_free_choice c L r jStar hr hj] at h exact h theorem candidate_Q_rest_harmonic_nonneg : 0 ≤ candidateQRestHarmonicMass c L r jStar hr := by apply tsum_nonneg intro n exact div_nonneg (ordered_slot_weight_nonneg _ (by positivity) n) (Nat.cast_nonneg n) theorem candidate_Q_rest_harmonic_eq_tuple_sum : candidateQRestHarmonicMass c L r jStar hr = ∑ x : ∀ slot, candidateQRestChoices c L r jStar hr slot, (1 / (orderedSlotProduct (candidateQRestChoices c L r jStar hr) x : ℝ)) / ((r.factorial : ℝ)^(candidateQIndices c L).card) := ordered_slot_harmonic_eq_tuple_sum _ _ end theorem exists_candidate_Q_rest_harmonic_upper {c : ℝ} (hc : 0 < c) (r : ℕ) (hr : 0 < r) : ∃ V : ℝ, 0 < V ∧ ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, 0 < jStar → candidateQRestHarmonicMass c L r jStar hr ≤ V * candidateQHarmonicMass c L r jStar := by obtain ⟨v, V, hv, hV, hband⟩ := exists_candidateQBands_bounds hc refine ⟨1 / v, by positivity, ?_⟩ filter_upwards [hband] with L hb intro jStar hj have hzero : 0 ∈ candidateQIndices c L := by simp [candidateQIndices] have hlower := (hb.2.2 0 hzero).2.2.1 have h := mul_le_mul_of_nonneg_right hlower (candidate_Q_rest_harmonic_nonneg c L r jStar hr) rw [← candidate_Q_harmonic_mass_free_factor c L r jStar hr hj] at h calc _ ≤ candidateQHarmonicMass c L r jStar / v := (le_div_iff₀ hv).mpr (by simpa only [mul_comm v] using h) _ = _ := by ring end section open Finset theorem supported_free_window_convolution_eq (P S : Finset ℕ) (a b W : ℕ → ℝ) (X : ℝ) (hS : ∀ p ∈ S, p ∈ Nat.factoredNumbers P) (hb : ∀ n, b n ≠ 0 → n ≠ 0 ∧ Disjoint n.primeFactors P) (hprod : ∀ p ∈ S, ∀ n, b n ≠ 0 → W (p * n) = a p * b n) (hcovered : ∀ u ∈ arithmeticProductWindow 1 X, W u ≠ 0 → ∃ p ∈ S, ∃ n ∈ arithmeticProductWindow p X, b n ≠ 0 ∧ p * n = u) : (∑ p ∈ S, a p * ∑ n ∈ arithmeticProductWindow p X, b n) = ∑ u ∈ arithmeticProductWindow 1 X, W u := by classical let T : Finset (Σ _p : ℕ, ℕ) := S.sigma (fun p => (arithmeticProductWindow p X).filter (fun n => b n ≠ 0)) let f : (Σ _p : ℕ, ℕ) → ℕ := fun z => z.1 * z.2 have hinj : Set.InjOn f T := by intro x hx y hy hxy have hx' := mem_sigma.mp hx have hy' := mem_sigma.mp hy have hbx := hb x.2 (mem_filter.mp hx'.2).2 have hby := hb y.2 (mem_filter.mp hy'.2).2 obtain ⟨hp, hn⟩ := supported_free_product_unique (hS x.1 hx'.1) hbx.1 hbx.2 (hS y.1 hy'.1) hby.1 hby.2 hxy exact Sigma.ext hp (heq_of_eq hn) have hsubset : T.image f ⊆ arithmeticProductWindow 1 X := by intro u hu obtain ⟨z, hz, rfl⟩ := mem_image.mp hu have hz' := mem_sigma.mp hz have hwindow := (mem_filter.mp hz'.2).1 have hp0 := Nat.ne_zero_of_mem_factoredNumbers (hS z.1 hz'.1) have hrange := (mem_arithmeticProductWindow_iff hp0 X).mp hwindow apply (mem_arithmeticProductWindow_iff one_ne_zero X).mpr simpa only [one_mul, f] using hrange calc _ = ∑ z ∈ T, W (f z) := by dsimp only [T, f] rw [sum_sigma] apply sum_congr rfl intro p hp rw [← sum_filter_ne_zero (arithmeticProductWindow p X), mul_sum] apply sum_congr rfl intro n hn exact (hprod p hp n (mem_filter.mp hn).2).symm _ = ∑ u ∈ T.image f, W u := (sum_image hinj).symm _ = _ := by apply sum_subset hsubset intro u hu hnot by_contra hWu obtain ⟨p, hp, n, hn, hbn, hpn⟩ := hcovered u hu hWu apply hnot exact mem_image.mpr ⟨⟨p, n⟩, mem_sigma.mpr ⟨hp, mem_filter.mpr ⟨hn, hbn⟩⟩, hpn⟩ end section open Finset theorem indexed_free_prime_mass_upper {T : Type*} [Fintype T] (S P : Finset ℕ) (W : ℕ → ℝ) (R : T → ℕ) (N X H : ℝ) (hN : 0 ≤ N) (hW : ∀ n ∈ S, 0 ≤ W n) (hcount : ∀ n ∈ S, ∀ t : T, ((primeProductWindow P ((n * R t : ℕ) : ℝ) X).card : ℝ) ≤ (X / ((n * R t : ℕ) : ℝ)) * H) : (∑ n ∈ S, ∑ t : T, (W n / N) * ((primeProductWindow P ((n * R t : ℕ) : ℝ) X).card : ℝ)) ≤ X * H * (∑ n ∈ S, W n / (n : ℝ)) * (∑ t : T, (1 / (R t : ℝ)) / N) := by classical calc _ ≤ ∑ n ∈ S, ∑ t : T, (W n / N) * ((X / ((n * R t : ℕ) : ℝ)) * H) := by apply sum_le_sum intro n hn apply sum_le_sum intro t _ exact mul_le_mul_of_nonneg_left (hcount n hn t) (div_nonneg (hW n hn) hN) _ = _ := by symm simp only [mul_sum, sum_mul] rw [sum_comm] apply sum_congr rfl intro n _ apply sum_congr rfl intro t _ simp only [Nat.cast_mul, div_eq_mul_inv, mul_inv] ring end section open Finset Filter open scoped Topology end section open Finset open scoped Classical section Events variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {a b : P → Bool} def GlobalBirthRawEvent (step : GlobalBirthRawStep (R := R) a b) (s : GlobalBirthHistoryState R) : Type _ := match step with | .visit h _ _ _ _ _ _ => Σ _T : ↥((globalBirthVisitZeroIndices h s.2.2).powerset), Σ m : ↥(range (((univ : Finset P) \ s.1).card + 1)), Fin m.val ↪ ↥((univ : Finset P) \ s.1) | .edge (t := t) delta _ _ _ _ _ _ _ _ _ => Finset (Fin t) × FixedTargetEdgeEvent (Fin t) (Fin s.2.1) P (globalBirthRawHitIndices delta s.2) noncomputable abbrev globalBirthRawEventFintype (step : GlobalBirthRawStep (R := R) a b) (s : GlobalBirthHistoryState R) : Fintype (GlobalBirthRawEvent step s) := by cases step <;> unfold GlobalBirthRawEvent <;> infer_instance noncomputable def globalBirthRawEventTarget (step : GlobalBirthRawStep (R := R) a b) (s : GlobalBirthHistoryState R) : GlobalBirthRawEvent step s → GlobalBirthHistoryState R := match step with | .visit h _ _ _ _ _ _ => fun e => (s.1 ∪ globalVisitBirthRange (univ \ s.1) e.2.2, retainedBirthTuple s.2.2 (univ \ e.1.val) (fun j => ⟨(e.2.2 j).val, h (e.2.2 j).val⟩)) | .edge delta _ source _ _ _ _ _ _ _ => fun e => (s.1 ∪ univ.image (unrestrictedEdgeTarget s.2.2 Sigma.fst e.2.1 e.2.2.1 e.2.2.2), unrestrictedEdgeOutput source s.2.2 (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) e.1 e.2.1 e.2.2.1) noncomputable def globalBirthRawEventWeight (step : GlobalBirthRawStep (R := R) a b) (s : GlobalBirthHistoryState R) : GlobalBirthRawEvent step s → ℝ := match step with | .visit h β η V ρ _ _ => fun e => (((-η / ρ) ^ e.1.val.card * ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeroIndices h s.2.2 \ e.1.val).card) * ((-η * V / ρ) ^ e.2.1.val * (∏ j, β (e.2.2 j).val / V))) / (e.2.1.val.factorial : ℝ) | .edge delta _ source _ _ _ β ρ V _ => fun e => unrestrictedEdgeEventMass source s.2.2 (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) (fun z => z.2 = 0) (fun p => β p / V) ρ V e.1 e.2.1 e.2.2.1 e.2.2.2 def globalBirthRawEventAllowed (step : GlobalBirthRawStep (R := R) a b) (s : GlobalBirthHistoryState R) : GlobalBirthRawEvent step s → Prop := match step with | .visit h _ _ _ _ _ cap => fun e => (retainedBirthTuple s.2.2 (univ \ e.1.val) (fun j => ⟨(e.2.2 j).val, h (e.2.2 j).val⟩)).1 ≤ cap | .edge delta _ source target _ _ _ _ _ cap => fun e => (unrestrictedEdgeTarget s.2.2 Sigma.fst e.2.1 e.2.2.1 e.2.2.2 = target ∧ ∀ j, e.2.2.2 j ∉ s.1) ∧ (unrestrictedEdgeOutput source s.2.2 (fun p => ⟨p, 0⟩) (unrestrictedPhaseTransport delta) e.1 e.2.1 e.2.2.1).1 ≤ cap noncomputable def globalBirthRawEventMass (step : GlobalBirthRawStep (R := R) a b) (s : GlobalBirthHistoryState R) (e : GlobalBirthRawEvent step s) : ℝ := if globalBirthRawEventAllowed step s e then globalBirthRawEventWeight step s e else 0 theorem global_birth_raw_step_event_sum (step : GlobalBirthRawStep (R := R) a b) (s : GlobalBirthHistoryState R) (F : GlobalBirthHistoryState R → ℂ) : let _ := globalBirthRawEventFintype step s globalBirthRawStepRow step (fun H q => F (H, q)) s.1 s.2 = ∑ e : GlobalBirthRawEvent step s, (globalBirthRawEventMass step s e : ℂ) * F (globalBirthRawEventTarget step s e) := by cases step with | visit h β η V ρ hV cap => simp only [GlobalBirthRawEvent, Fintype.sum_sigma, globalBirthRawStepRow, globalBirthGhostVisitRawRow, globalBirthRawEventMass, globalBirthRawEventAllowed, globalBirthRawEventWeight, globalBirthRawEventTarget] rw [← sum_coe_sort (globalBirthVisitZeroIndices h s.2.2).powerset] apply sum_congr rfl intro T hT rw [← sum_coe_sort (range (((univ : Finset P) \ s.1).card + 1))] apply sum_congr rfl intro m hm apply sum_congr rfl intro f _ split_ifs <;> simp | edge delta hshared source target hsource htarget β ρ V cap => simp only [GlobalBirthRawEvent, Fintype.sum_prod_type, Fintype.sum_sigma, globalBirthRawStepRow, globalBirthEdgeRawRow, unrestrictedEdgeAction, globalBirthRawEventMass, globalBirthRawEventAllowed, globalBirthRawEventWeight, globalBirthRawEventTarget] apply sum_congr rfl intro stores _ apply sum_congr rfl intro promotions _ apply sum_congr rfl intro e _ apply sum_congr rfl intro fresh _ split_ifs <;> simp_all end Events end section open Finset open scoped Classical theorem finite_operator_list_action_append {K X : Type*} (row : K → (X → ℂ) → X → ℂ) (ks ls : List K) (F : X → ℂ) : finiteOperatorListAction row (ks ++ ls) F = finiteOperatorListAction row ks (finiteOperatorListAction row ls F) := by induction ks with | nil => rfl | cons k ks ih => simp only [List.cons_append, finiteOperatorListAction, ih] theorem finite_row_composition_eq_operator_list {X : Type*} (row : ℕ → (X → ℂ) → X → ℂ) (n : ℕ) (F : X → ℂ) : finiteRowComposition (S := fun _ => X) row n F = finiteOperatorListAction row (List.range n) F := by induction n generalizing F with | zero => rfl | succ n ih => rw [finite_row_composition_succ, List.range_succ, finite_operator_list_action_append] exact ih (row n F) def finiteEventPathAllowed {K X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (allowed : ∀ k x, E k x → Prop) : ∀ ks x, FiniteEventPath E target ks x → Prop | [], _, _ => True | k :: ks, x, ⟨e, p⟩ => allowed k x e ∧ finiteEventPathAllowed E target allowed ks _ p end section open Finset noncomputable def finiteAlternatingPairing {X : Type*} [Fintype X] (G E : ℕ → X → X → ℝ) (f q : X → ℝ) (n : ℕ) : ℝ := ∑ x, q x * finitePathAction (finiteAlternatingKernel G E) f (2 * n + 1) x section Kernels variable {I : Type*} [Fintype I] {R : I → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] noncomputable def ghostPhaseTensorDiagonal (h : (p : I) → R p) (ρ : I → ℝ) (z : (p : I) → GhostPhaseState (R p)) : ℝ := ∏ p, ghostPhaseDiagonal (h p) (ρ p) (z p) noncomputable def ghostPhaseCappedVisit (a : I → Bool) (h : (p : I) → R p) (η β : I → ℝ) (cap : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ℝ := if (ghostPhasePendingSupport z).card ≤ cap then ∏ p, ghostPhaseVisit (a p) (h p) (η p) (β p) (z p) (w p) else 0 noncomputable def ghostPhaseCappedDampedVisit (a : I → Bool) (h : (p : I) → R p) (η β ρ : I → ℝ) (cap : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ℝ := if (ghostPhasePendingSupport z).card ≤ cap then ∏ p, ghostPhaseDampedVisit (a p) (h p) (η p) (β p) (ρ p) (z p) (w p) else 0 noncomputable def ghostPhaseCappedEdge (atgt asrc : I → Bool) (htgt hsrc : (p : I) → R p) (β V : I → ℝ) (cap : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ℝ := if (ghostPhasePendingSupport z).card ≤ cap then ∏ p, (if atgt p && !(asrc p) then (V p)⁻¹ else 1) * ghostPhaseEdge (atgt p) (asrc p) (htgt p) (hsrc p) (β p) (z p) (w p) else 0 noncomputable def ghostPhaseCappedDampedEdge (atgt asrc : I → Bool) (htgt hsrc : (p : I) → R p) (β V ρtgt ρsrc : I → ℝ) (cap : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ℝ := if (ghostPhasePendingSupport z).card ≤ cap then ∏ p, (if atgt p && !(asrc p) then (V p)⁻¹ else 1) * ghostPhaseDampedEdge (atgt p) (asrc p) (htgt p) (hsrc p) (β p) (ρtgt p) (ρsrc p) (z p) (w p) else 0 omit [∀ p, Fintype (R p)] in theorem ghost_phase_tensor_diagonal_ne_zero (h : (p : I) → R p) (ρ : I → ℝ) (hρ : ∀ p, ρ p ≠ 0) (z : (p : I) → GhostPhaseState (R p)) : ghostPhaseTensorDiagonal h ρ z ≠ 0 := prod_ne_zero_iff.mpr (fun p _ => ghostPhaseDiagonal_ne_zero (h p) (hρ p) (z p)) omit [∀ p, Fintype (R p)] in theorem ghost_phase_capped_visit_diagonal (a : I → Bool) (h : (p : I) → R p) (η β ρ : I → ℝ) (cap : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ghostPhaseCappedDampedVisit a h η β ρ cap z w = ghostPhaseCappedVisit a h η β cap z w / (ghostPhaseTensorDiagonal h ρ z * ghostPhaseTensorDiagonal h ρ w) := by unfold ghostPhaseCappedDampedVisit ghostPhaseCappedVisit split_ifs · simp only [ghostPhaseDampedVisit, prod_div_distrib, prod_mul_distrib, ghostPhaseTensorDiagonal] · exact (zero_div _).symm theorem ghost_phase_capped_edge_diagonal (atgt asrc : I → Bool) (htgt hsrc : (p : I) → R p) (β V ρtgt ρsrc : I → ℝ) (cap : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ghostPhaseCappedDampedEdge atgt asrc htgt hsrc β V ρtgt ρsrc cap z w = ghostPhaseTensorDiagonal htgt ρtgt z * ghostPhaseCappedEdge atgt asrc htgt hsrc β V cap z w * ghostPhaseTensorDiagonal hsrc ρsrc w := by unfold ghostPhaseCappedDampedEdge ghostPhaseCappedEdge split_ifs · simp only [ghostPhaseDampedEdge, prod_mul_distrib, ghostPhaseTensorDiagonal] ring · ring end Kernels section History variable {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : I → ℕ → Bool) (h : (p : I) → ℕ → R p) (η : I → ℕ → ℝ) (β V : I → ℝ) (ρ : I → ℕ → ℝ) (visitCap edgeCap : ℕ → ℕ) noncomputable def ghostPhaseCappedHistory (n : ℕ) : ℝ := finiteAlternatingPairing (fun j => ghostPhaseCappedVisit (fun p => a p j) (fun p => h p j) (fun p => η p j) β (visitCap j)) (fun j => ghostPhaseCappedEdge (fun p => a p (j + 1)) (fun p => a p j) (fun p => h p (j + 1)) (fun p => h p j) β V (edgeCap j)) (fun z => ∏ p, ghostPhaseRunInitial (a p 0) (β p) (V p) (z p)) (fun z => ∏ p, ghostPhaseTerminal (a p n) (z p)) n noncomputable def ghostPhaseCappedDampedHistory (n : ℕ) : ℝ := finiteAlternatingPairing (fun j => ghostPhaseCappedDampedVisit (fun p => a p j) (fun p => h p j) (fun p => η p j) β (fun p => ρ p j) (visitCap j)) (fun j => ghostPhaseCappedDampedEdge (fun p => a p (j + 1)) (fun p => a p j) (fun p => h p (j + 1)) (fun p => h p j) β V (fun p => ρ p (j + 1)) (fun p => ρ p j) (edgeCap j)) (fun z => ∏ p, ghostPhaseRunInitial (a p 0) (β p) (V p) (z p)) (fun z => ∏ p, ghostPhaseTerminal (a p n) (z p)) n /- Exact tensor rho cancellation with all visit and edge cutoffs retained. The rho values may vary independently by prime and physical vertex. -/ theorem ghost_phase_capped_damped_history_eq (hρ : ∀ p j, ρ p j ≠ 0) (n : ℕ) : ghostPhaseCappedDampedHistory a h η β V ρ visitCap edgeCap n = ghostPhaseCappedHistory a h η β V visitCap edgeCap n := by unfold ghostPhaseCappedDampedHistory ghostPhaseCappedHistory finiteAlternatingPairing simp_rw [finite_alternating_action, ghost_phase_capped_visit_diagonal, ghost_phase_capped_edge_diagonal] refine alternating_visit_edge_diagonal_pairing (fun j => ghostPhaseCappedVisit (fun p => a p j) (fun p => h p j) (fun p => η p j) β (visitCap j)) (fun j => ghostPhaseCappedEdge (fun p => a p (j + 1)) (fun p => a p j) (fun p => h p (j + 1)) (fun p => h p j) β V (edgeCap j)) (fun j => ghostPhaseTensorDiagonal (fun p => h p j) (fun p => ρ p j)) ?_ (fun z => ∏ p, ghostPhaseRunInitial (a p 0) (β p) (V p) (z p)) (fun z => ∏ p, ghostPhaseTerminal (a p n) (z p)) n ?_ ?_ · intro j z exact ghost_phase_tensor_diagonal_ne_zero _ _ (fun p => hρ p j) z · intro z hz apply prod_eq_one intro p _ have hp := prod_ne_zero_iff.mp hz p (mem_univ p) have hi : ghostPhaseInitial (a p 0) (β p) (z p) ≠ 0 := (mul_ne_zero_iff.mp hp).2 exact ghost_phase_initial_diagonal_one (a p 0) (h p 0) (β p) (ρ p 0) (z p) hi · intro z hz apply prod_eq_one intro p _ exact ghost_phase_terminal_diagonal_one (a p n) (h p n) (ρ p n) (z p) (prod_ne_zero_iff.mp hz p (mem_univ p)) end History end section noncomputable def finTensorRow {V : Type*} : (n : Nat) → {S T : Fin n → Type*} → ((g : Fin n) → (T g → V) → S g → V) → (((g : Fin n) → T g) → V) → ((g : Fin n) → S g) → V | 0, _, _, _, F, _ => F (fun g => Fin.elim0 g) | n + 1, _, _, row, F, s => row 0 (fun t => finTensorRow n (fun g => row g.succ) (fun u => F (Fin.cons t u)) (Fin.tail s)) (s 0) theorem fin_tensor_row_succ {V : Type*} (n : Nat) {S T : Fin (n + 1) → Type*} (row : (g : Fin (n + 1)) → (T g → V) → S g → V) (F : ((g : Fin (n + 1)) → T g) → V) (s : (g : Fin (n + 1)) → S g) : finTensorRow (n + 1) row F s = row 0 (fun t => finTensorRow n (fun g => row g.succ) (fun u => F (Fin.cons t u)) (Fin.tail s)) (s 0) := rfl /- Coordinate identities requiring agreement only on admissible outputs combine into a full tensor identity. The output predicate is tested on all coordinates jointly, so a terminal mask can depend on their total size. -/ theorem fin_tensor_row_intertwines_on {V : Type*} (n : Nat) {S T X Y : Fin n → Type*} (rowS : (g : Fin n) → (T g → V) → S g → V) (rowX : (g : Fin n) → (Y g → V) → X g → V) (source : (g : Fin n) → S g → X g) (target : (g : Fin n) → T g → Y g) (validS : (g : Fin n) → S g → Prop) (validT : (g : Fin n) → T g → Prop) (hrow : ∀ g s, validS g s → ∀ G F, (∀ t, validT g t → G t = F (target g t)) → rowS g G s = rowX g F (source g s)) (G : ((g : Fin n) → T g) → V) (F : ((g : Fin n) → Y g) → V) (hGF : ∀ t, (∀ g, validT g (t g)) → G t = F (fun g => target g (t g))) (s : (g : Fin n) → S g) (hs : ∀ g, validS g (s g)) : finTensorRow n rowS G s = finTensorRow n rowX F (fun g => source g (s g)) := by induction n with | zero => change G _ = F _ have h := hGF (fun g => Fin.elim0 g) (fun g => Fin.elim0 g) convert h using 1 congr 1 funext g exact Fin.elim0 g | succ n ih => simp only [fin_tensor_row_succ] apply hrow 0 (s 0) (hs 0) intro t ht apply ih (fun g => rowS g.succ) (fun g => rowX g.succ) (fun g => source g.succ) (fun g => target g.succ) (fun g => validS g.succ) (fun g => validT g.succ) (fun g => hrow g.succ) · intro u hu have hv : ∀ g, validT g (Fin.cons t u g) := by intro g refine Fin.cases ?_ (fun j => ?_) g · exact ht · exact hu j have he := hGF (Fin.cons t u) hv convert he using 1 congr 1 funext g refine Fin.cases ?_ (fun j => ?_) g <;> rfl · exact fun g => hs g.succ end section open Finset section Kernel variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] theorem global_birth_raw_step_kernel_visit (a : P → Bool) (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) (z w : (p : P) → GhostPhaseState (R p)) : globalBirthRawStepKernel (.visit (a := a) h β η V ρ hV cap) z w = if (ghostPhasePendingSupport z).card ≤ cap then ((∏ p, ghostPhaseDampedVisit (a p) (h p) η (β p) ρ (z p) (w p) : ℝ) : ℂ) else 0 := rfl theorem global_birth_raw_step_kernel_edge (a b : P → Bool) (delta : (p : P) → R p) (hshared : ∀ p, b p = true ∧ a p = true → delta p = 0) {t : ℕ} (source target : Fin t ↪ P) (hsource : univ.image source = ghostPhaseActivitySupport a \ ghostPhaseActivitySupport b) (htarget : univ.image target = ghostPhaseNewRunSet b a) (β : P → ℝ) (ρ V : ℝ) (cap : ℕ) (z w : (p : P) → GhostPhaseState (R p)) : globalBirthRawStepKernel (.edge delta hshared source target hsource htarget β ρ V cap) z w = if (ghostPhasePendingSupport z).card ≤ cap then ((∏ p, (if b p && !(a p) then V⁻¹ else 1) * ghostPhaseDampedMovingEdge (b p) (a p) (delta p) (β p) ρ ρ (z p) (w p) : ℝ) : ℂ) else 0 := rfl end Kernel end section open Finset noncomputable def finiteInputMaskedKernel {X 𝕜 : Type*} [Zero 𝕜] (C : Nat → X → Prop) (K : Nat → X → X → 𝕜) (i : Nat) (z w : X) : 𝕜 := by classical exact if C i w then K i z w else 0 section variable {X 𝕜 : Type*} [sharedInstance1 : CommMonoidWithZero 𝕜] (C : Nat → X → Prop) (K : Nat → X → X → 𝕜) (initial : X → 𝕜) (hK : ∀ i z w, ¬ C (i + 1) z → K i z w = 0) (hinit : ∀ z, ¬ C 0 z → initial z = 0) (n : Nat) (x : Fin (n + 1) → X) include X 𝕜 sharedInstance1 C K initial hK hinit n x theorem finite_chronological_prefix_zero_of_cut (j : Fin (n + 1)) (hj : ¬ C j.val (x j)) : finiteChronologicalPrefix K initial n x = 0 := by classical by_cases hzero : j.val = 0 · have he : j = 0 := Fin.ext hzero subst j simp only [finiteChronologicalPrefix, hinit (x 0) hj, zero_mul] · let i : Fin n := ⟨j.val - 1, by omega⟩ have hi : i.succ = j := by apply Fin.ext dsimp [i] omega have hk : K i.val (x i.succ) (x i.castSucc) = 0 := by apply hK simpa only [← hi, Fin.val_succ] using hj unfold finiteChronologicalPrefix rw [prod_eq_zero (mem_univ i) hk, mul_zero] /- No sum or cancellation is required: duplicate cut projectors collapse on each individual chronological state trace. -/ theorem finite_chronological_input_masks_collapse : finiteChronologicalPrefix (finiteInputMaskedKernel C K) initial n x = finiteChronologicalPrefix K initial n x := by classical by_cases hcut : ∀ j : Fin (n + 1), C j.val (x j) · unfold finiteChronologicalPrefix congr 1 apply prod_congr rfl intro j _ exact if_pos (hcut j.castSucc) · obtain ⟨j, hj⟩ := not_forall.mp hcut have hmasked : ∀ i z w, ¬ C (i + 1) z → finiteInputMaskedKernel C K i z w = 0 := by intro i z w hz unfold finiteInputMaskedKernel rw [hK i z w hz] split_ifs <;> rfl rw [finite_chronological_prefix_zero_of_cut C _ initial hmasked hinit n x j hj, finite_chronological_prefix_zero_of_cut C K initial hK hinit n x j hj] end end section open Finset Classical noncomputable def boundedOrderedGhostOperator {P Z : Type*} [Fintype Z] [DecidableEq Z] (A D C ν : Z → ℝ) (t B : ℕ) (f : BoundedOrderedState P Z t B → ℂ) (s : BoundedOrderedState P Z t B) : ℂ := symmetricOrderedGhostOperator A D C ν B (boundedOrderedZeroExtension f s.1) (boundedOrderedTupleToFinite s.2) theorem bounded_ordered_memory_energy_range {Z : Type*} [Fintype Z] (ν : Z → ℝ) (B : ℕ) (F : FiniteOrderedTuple Z → ℂ) : finiteWeightedEnergy (boundedOrderedMemoryWeight ν) (fun q : BoundedOrderedTuple Z B => F (boundedOrderedTupleToFinite q)) = ∑ n ∈ range (B + 1), (∑ q : Fin n → Z, (∏ j, ν (q j)) * ‖F ⟨n, q⟩‖ ^ 2) / (n.factorial : ℝ) := by simpa only [finiteWeightedEnergy, smul_eq_mul, one_div_mul_eq_div] using bounded_ordered_memory_smul_sum_range ν B (fun q => ‖F q‖ ^ 2) theorem bounded_ordered_state_energy_split {P Z : Type*} [Fintype P] [Fintype Z] (μ : P → ℝ) (ν : Z → ℝ) (t B : ℕ) (f : BoundedOrderedState P Z t B → ℂ) : finiteWeightedEnergy (boundedOrderedStateWeight μ ν) f = ∑ active : Fin t → P, (∏ i, μ (active i)) * finiteWeightedEnergy (boundedOrderedMemoryWeight ν) (fun q => f (active, q)) := by simp only [finiteWeightedEnergy, Fintype.sum_prod_type, boundedOrderedStateWeight, mul_sum, mul_assoc] theorem bounded_ordered_ghost_symmetric {P Z : Type*} [Fintype Z] [DecidableEq Z] (A D C ν : Z → ℝ) (t B : ℕ) (f : BoundedOrderedState P Z t B → ℂ) (hf : BoundedOrderedSymmetric f) : BoundedOrderedSymmetric (boundedOrderedGhostOperator A D C ν t B f) := by intro active N q τ exact symmetric_ordered_ghost_operator_symmetric A D C ν B (boundedOrderedZeroExtension f active) ((boundedOrderedZeroExtension_symmetric_iff f).mpr hf active) N.val q τ theorem bounded_ordered_ghost_energy_le {P Z : Type*} [Fintype P] [Fintype Z] [DecidableEq Z] (μ : P → ℝ) (A D C ν v : Z → ℝ) (t B : ℕ) (hμ : ∀ p, 0 ≤ μ p) (hA : ∀ z, 0 ≤ A z) (hν : ∀ z, 0 < ν z) (hv : ∀ z, 0 < v z) (hD : ∀ z, A z + |D z| / v z ≤ 1) (hC : ∀ z, A z + |C z| / v z ≤ 1) (f : BoundedOrderedState P Z t B → ℂ) (hf : BoundedOrderedSymmetric f) : finiteWeightedEnergy (boundedOrderedStateWeight μ ν) (boundedOrderedGhostOperator A D C ν t B f) ≤ Real.exp (∑ z, (|C z| + |D z|) * ν z * v z) * finiteWeightedEnergy (boundedOrderedStateWeight μ ν) f := by have hlocal (active : Fin t → P) : finiteWeightedEnergy (boundedOrderedMemoryWeight ν) (fun q => boundedOrderedGhostOperator A D C ν t B f (active, q)) ≤ Real.exp (∑ z, (|C z| + |D z|) * ν z * v z) * finiteWeightedEnergy (boundedOrderedMemoryWeight ν) (fun q => f (active, q)) := by have h := symmetric_ordered_ghost_l2_sq_le A D C ν v B hA hν hv hD hC (boundedOrderedZeroExtension f active) ((boundedOrderedZeroExtension_symmetric_iff f).mpr hf active) rw [← bounded_ordered_memory_energy_range, ← bounded_ordered_memory_energy_range] at h have hext (q : BoundedOrderedTuple Z B) : boundedOrderedZeroExtension f active (boundedOrderedTupleToFinite q) = f (active, q) := boundedOrderedZeroExtension_apply f (active, q) simpa only [boundedOrderedGhostOperator, hext] using h rw [bounded_ordered_state_energy_split, bounded_ordered_state_energy_split, mul_sum] apply sum_le_sum intro active _ calc _ ≤ (∏ i, μ (active i)) * (Real.exp (∑ z, (|C z| + |D z|) * ν z * v z) * finiteWeightedEnergy (boundedOrderedMemoryWeight ν) (fun q => f (active, q))) := mul_le_mul_of_nonneg_left (hlocal active) (prod_nonneg fun i _ => hμ (active i)) _ = _ := by ring end section end section open Finset Classical section variable {I : Type*} [sharedInstance1 : Fintype I] {X : I → Type*} (E : ∀ i, X i → Type*) [sharedInstance4 : ∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (phase : ∀ x : (∀ i, X i), (∀ i, E i (x i)) → ℂ) (hphase : ∀ x e, ‖phase x e‖ ≤ 1) (f : (∀ i, X i) → ℂ) (x : ∀ i, X i) include I sharedInstance1 X E sharedInstance4 weight target phase hphase f x theorem finite_product_event_norm_le_abs_positive : ‖finiteProductEventAction E weight target phase f x‖ ≤ finiteProductEventPositive E (fun i x e => |weight i x e|) target (fun y => ‖f y‖) x := by unfold finiteProductEventAction finiteProductEventPositive refine (norm_sum_le _ _).trans (sum_le_sum fun e _ => ?_) rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, Finset.abs_prod] calc _ ≤ ((∏ i, |weight i (x i) (e i)|) * 1) * ‖f (fun i => target i (x i) (e i))‖ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hphase x e) (prod_nonneg fun _ _ => abs_nonneg _)) (norm_nonneg _) _ = _ := by rw [mul_one] theorem finite_product_event_norm_le_abs_positive_re : ‖finiteProductEventAction E weight target phase f x‖ ≤ (finiteProductEventAction E (fun i x e => |weight i x e|) target (fun _ _ => 1) (complexNormEnvelope f) x).re := by rw [show complexNormEnvelope f = fun y => (‖f y‖ : ℂ) from rfl, ← finite_product_event_positive_cast, Complex.ofReal_re] exact finite_product_event_norm_le_abs_positive E weight target phase hphase f x end theorem finite_event_path_weight_abs {K X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (ks : List K) (x : X) (p : FiniteEventPath E target ks x) : |finiteEventPathWeight E target w ks x p| = finiteEventPathWeight E target (fun k x e => |w k x e|) ks x p := by induction ks generalizing x with | nil => exact abs_one | cons k ks ih => rcases p with ⟨e, p⟩ exact (abs_mul _ _).trans (congrArg (fun a => |w k x e| * a) (ih _ p)) theorem finite_event_path_norm_le_abs_list_re {K X : Type*} (E : K → X → Type*) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (ks : List K) (phase : ∀ x, FiniteEventPath E target ks x → ℂ) (hphase : ∀ x p, ‖phase x p‖ ≤ 1) (f : X → ℂ) (x : X) : ‖finiteEventPathAction E target w ks phase f x‖ ≤ (finiteOperatorListAction (finiteLocalEventAction E (fun k x e => |w k x e|) target) ks (complexNormEnvelope f) x).re := by rw [← finite_event_path_positive_eq_list] let _ := finiteEventPathFintype E target ks x have hpos : (finiteEventPathPositive E target (fun k x e => |w k x e|) ks (complexNormEnvelope f) x).re = ∑ p : FiniteEventPath E target ks x, |finiteEventPathWeight E target w ks x p| * ‖f (finiteEventPathTerminal E target ks x p)‖ := by simp only [finiteEventPathPositive, complexNormEnvelope, Complex.re_sum, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero, ← finite_event_path_weight_abs] rw [hpos] unfold finiteEventPathAction refine (norm_sum_le _ _).trans (sum_le_sum fun p _ => ?_) rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs] calc _ ≤ (|finiteEventPathWeight E target w ks x p| * 1) * ‖f (finiteEventPathTerminal E target ks x p)‖ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hphase x p) (abs_nonneg _)) (norm_nonneg _) _ = _ := by rw [mul_one] end section open scoped BigOperators theorem finite_product_expectation_split {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i : I) (f : (∀ j, X j) → ℂ) : (∑ x, (finiteProductWeight μ x : ℂ) * f x) = ∑ z : (∀ j : {j : I // j ≠ i}, X j.val), ((∏ j, μ j.val (z j) : ℝ) : ℂ) * ∑ y, (μ i y : ℂ) * f ((Equiv.piSplitAt i X).symm (y, z)) := by let E := Equiv.piSplitAt i X rw [← E.symm.sum_comp, Fintype.sum_prod_type, Finset.sum_comm] apply Finset.sum_congr rfl intro z _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro y _ rw [finite_product_weight_split μ i] have hE := E.apply_symm_apply (y, z) have hfirst : E.symm (y, z) i = y := congrArg Prod.fst hE have hrest : (fun j : {j : I // j ≠ i} => E.symm (y, z) j.val) = z := congrArg Prod.snd hE have hprod : (∏ j : {j : I // j ≠ i}, μ j.val (E.symm (y, z) j.val)) = ∏ j, μ j.val (z j) := congrArg (fun q => ∏ j, μ j.val (q j)) hrest rw [hfirst, hprod, Complex.ofReal_mul] ring theorem finite_product_weight_sum_one {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ x, μ i x = 1) : ∑ x, finiteProductWeight μ x = 1 := by classical unfold finiteProductWeight rw [← Fintype.prod_sum] exact Finset.prod_eq_one (fun i _ => hmass i) theorem finite_product_value_split {I M : Type*} [Fintype I] [DecidableEq I] [CommMonoid M] {X : I → Type*} (v : ∀ i, X i → M) (i : I) (x : ∀ j, X j) : (∏ j, v j (x j)) = v i (x i) * ∏ j : {j : I // j ≠ i}, v j.val (x j.val) := by have h := Fintype.prod_subtype_mul_prod_subtype (fun j => j = i) (fun j => v j (x j)) have heq (j : {j : I // j = i}) : v j.val (x j.val) = v i (x i) := by rcases j with ⟨j, rfl⟩ rfl simpa only [Fintype.prod_unique, heq] using h.symm theorem finite_product_value_expectation_split {I M : Type*} [Fintype I] [DecidableEq I] [CommMonoid M] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (v : ∀ i, X i → M) (i : I) (F : M → ℂ) : (∑ x, (finiteProductWeight μ x : ℂ) * F (∏ j, v j (x j))) = ∑ z : (∀ j : {j : I // j ≠ i}, X j.val), ((∏ j, μ j.val (z j) : ℝ) : ℂ) * ∑ y, (μ i y : ℂ) * F (v i y * ∏ j, v j.val (z j)) := by rw [finite_product_expectation_split μ i] apply Finset.sum_congr rfl intro z _ congr 1 apply Finset.sum_congr rfl intro y _ congr 2 let E := Equiv.piSplitAt i X have hE := E.apply_symm_apply (y, z) have hfirst : E.symm (y, z) i = y := congrArg Prod.fst hE have hrest : (fun j : {j : I // j ≠ i} => E.symm (y, z) j.val) = z := congrArg Prod.snd hE rw [finite_product_value_split v i, hfirst] congr 1 exact congrArg (fun q => ∏ j, v j.val (q j)) hrest end section open scoped Classical theorem finite_fiber_pushforward_sum {X I : Type*} [Fintype X] [Fintype I] (π : X → I) (a : X → ℂ) (K : I → ℂ) : (∑ i, (∑ x ∈ Finset.univ.filter (fun x => π x = i), a x) * K i) = ∑ x, a x * K (π x) := by classical simp only [Finset.sum_filter, Finset.sum_mul, ite_mul, zero_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x hx simp theorem finite_fiber_pushforward_bilinear {X Y I J : Type*} [Fintype X] [Fintype Y] [Fintype I] [Fintype J] (π : X → I) (τ : Y → J) (a : X → ℂ) (b : Y → ℂ) (K : I → J → ℂ) : (∑ i, ∑ j, (∑ x ∈ Finset.univ.filter (fun x => π x = i), a x) * (∑ y ∈ Finset.univ.filter (fun y => τ y = j), b y) * K i j) = ∑ x, ∑ y, a x * b y * K (π x) (τ y) := by classical calc _ = ∑ i, (∑ x ∈ Finset.univ.filter (fun x => π x = i), a x) * ∑ j, (∑ y ∈ Finset.univ.filter (fun y => τ y = j), b y) * K i j := by apply Finset.sum_congr rfl intro i hi conv_rhs => rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj exact mul_assoc _ _ _ _ = ∑ i, (∑ x ∈ Finset.univ.filter (fun x => π x = i), a x) * ∑ y, b y * K i (τ y) := by simp_rw [finite_fiber_pushforward_sum] _ = ∑ y, ∑ i, (∑ x ∈ Finset.univ.filter (fun x => π x = i), a x) * (b y * K i (τ y)) := by simp only [Finset.mul_sum] rw [Finset.sum_comm] _ = ∑ y, ∑ x, a x * (b y * K (π x) (τ y)) := by apply Finset.sum_congr rfl intro y hy exact finite_fiber_pushforward_sum π a (fun i => b y * K i (τ y)) _ = _ := by rw [Finset.sum_comm]; simp only [mul_assoc] end section open scoped Classical theorem weighted_fiber_mass_le_of_atom_bound {X I : Type*} [Fintype X] (π : X → I) (n : I → ℕ) (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) {C P : ℝ} (hC : 0 ≤ C) (hP : 0 < P) (hlower : ∀ x, P ≤ (n (π x) : ℝ)) (hatom : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => n (π x) = m), μ x) ≤ C / (m : ℝ)) (i : I) : (∑ x ∈ Finset.univ.filter (fun x => π x = i), μ x) ≤ C / P := by classical by_cases hi : ∃ x, π x = i · obtain ⟨x, hx⟩ := hi have hPi : P ≤ (n i : ℝ) := by simpa only [hx] using hlower x have hs : Finset.univ.filter (fun x => π x = i) ⊆ Finset.univ.filter (fun x => n (π x) = n i) := by intro y hy obtain ⟨hyU, hyi⟩ := Finset.mem_filter.mp hy exact Finset.mem_filter.mpr ⟨hyU, congrArg n hyi⟩ calc _ ≤ ∑ x ∈ Finset.univ.filter (fun x => n (π x) = n i), μ x := Finset.sum_le_sum_of_subset_of_nonneg hs (fun x _ _ => hμ x) _ ≤ C / (n i : ℝ) := hatom (n i) _ ≤ C / P := div_le_div_of_nonneg_left hC hP hPi · have he : Finset.univ.filter (fun x => π x = i) = ∅ := by apply Finset.filter_eq_empty_iff.mpr intro x hx hxi exact hi ⟨x, hxi⟩ rw [he, Finset.sum_empty] exact div_nonneg hC hP.le theorem weighted_fiber_energy_le_of_atom_bound {X I : Type*} [Fintype X] (values : Finset I) (π : X → I) (n : I → ℕ) (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (f : X → ℂ) {C P : ℝ} (hC : 0 ≤ C) (hP : 0 < P) (hlower : ∀ x, P ≤ (n (π x) : ℝ)) (hatom : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => n (π x) = m), μ x) ≤ C / (m : ℝ)) : (∑ i ∈ values, ‖∑ x ∈ Finset.univ.filter (fun x => π x = i), (μ x : ℂ) * f x‖ ^ 2) ≤ (C / P) * ∑ x, μ x * ‖f x‖ ^ 2 := finite_weighted_fiber_energy_le values π μ hμ f (div_nonneg hC hP.le) (fun i _ => weighted_fiber_mass_le_of_atom_bound π n μ hμ hC hP hlower hatom i) end section open Finset /- A single nonnegative term of Vandermonde's identity bounds the numerator. -/ theorem hoeffding_retained_choose_mul_le (M m ell j : ℕ) (hmj : m ≤ j) (hjM : j + ell ≤ M) : (M - m - ell).choose (j - m) * (m + ell).choose m ≤ M.choose j := by have hsum := Nat.add_choose_eq (M - m - ell) (m + ell) j have hadd : M - m - ell + (m + ell) = M := by omega rw [hadd] at hsum rw [hsum] exact single_le_sum (f := fun ij : ℕ × ℕ => (M - m - ell).choose ij.1 * (m + ell).choose ij.2) (fun _ _ => Nat.zero_le _) (show (j - m, m) ∈ antidiagonal j from by rw [Finset.HasAntidiagonal.mem_antidiagonal] omega) /- A crude binomial lower bound is enough for the required polynomial decay. -/ theorem hoeffding_probe_power_le_choose (m ell : ℕ) : m ^ ell ≤ ell ^ ell * (m + ell).choose m := by have h := Nat.pow_sub_le_descFactorial (m + ell) ell have hsub : m + ell + 1 - ell = m + 1 := by omega rw [hsub, Nat.descFactorial_eq_factorial_mul_choose] at h calc m ^ ell ≤ (m + 1) ^ ell := Nat.pow_le_pow_left (by omega) ell _ ≤ ell.factorial * (m + ell).choose ell := h _ ≤ ell ^ ell * (m + ell).choose ell := Nat.mul_le_mul_right _ (Nat.factorial_le_pow ell) _ = _ := by rw [Nat.choose_symm_add] end section open Finset open scoped Classical noncomputable def repeatedBigUnbannedRowAction {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (f : RepeatedBigLists P J ell → ℂ) : RepeatedBigLists P J ell → ℂ := fun source => ∑ target, (∑ aux, repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K aux source target) * f target end section open Finset noncomputable def candidateFullPSet (c L : ℝ) : Finset ℕ := candidateSmallPSet c L (16 * Real.exp L + 1) noncomputable def candidateFullOrdinaryWindowMass (c L q : ℝ) (r jStar : ℕ) : ℝ := ∑ p ∈ candidateFullPSet c L, candidatePWeight c L q p * ∑ n ∈ arithmeticProductWindow p (Real.exp L), candidateQWeight c L r jStar n theorem candidate_full_P_set_nonzero {c L : ℝ} {p : ℕ} (hp : p ∈ candidateFullPSet c L) : p ≠ 0 := candidate_small_P_set_nonzero hp theorem candidate_full_ordinary_window_split (c L q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) : candidateFullOrdinaryWindowMass c L q r jStar = ∑ p ∈ candidateFullPSet c L, ∑ y : ∀ slot, candidateQRestChoices c L r jStar hr slot, (candidatePWeight c L q p / ((r.factorial : ℝ)^(candidateQIndices c L).card)) * ((primeProductWindow (candidateQBand (c * L) 0) ((p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y : ℕ) : ℝ) (Real.exp L)).card : ℝ) := by classical unfold candidateFullOrdinaryWindowMass apply sum_congr rfl intro p hp simp only [candidateQWeight] rw [ordered_slot_arithmetic_window_split _ (candidateFreeSlot c L r hr) _ (candidate_full_P_set_nonzero hp), candidate_Q_free_choice c L r jStar hr hj, mul_sum] apply sum_congr rfl intro y _ change candidatePWeight c L q p * (((primeProductWindow (candidateQBand (c * L) 0) ((p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y : ℕ) : ℝ) (Real.exp L)).card : ℝ) / ((r.factorial : ℝ)^(candidateQIndices c L).card)) = _ ring theorem candidate_Q_rest_product_nonzero (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (y : ∀ slot, candidateQRestChoices c L r jStar hr slot) : orderedSlotProduct (candidateQRestChoices c L r jStar hr) y ≠ 0 := by apply Finset.prod_ne_zero_iff.mpr intro slot _ exact candidate_Q_slot_nonzero c L r jStar slot.val (y slot).property theorem candidate_small_P_harmonic_le_total {c L q : ℝ} (hcL : 0 ≤ c * L) (hq : 0 ≤ q) (X : ℝ) : candidateSmallPHarmonicMass c L q X ≤ candidateOneMarkedHarmonicMass c L q := by have hnonneg (n : ℕ) : 0 ≤ candidatePHarmonicTerm c L q n := by exact div_nonneg (marked_divisor_weight_nonneg _ _ hq _ _ (fun _ _ => sum_nonneg (fun _ _ => by positivity)) _) (Nat.cast_nonneg n) change (∑' n : Nat.factoredNumbers ((candidatePIndices c L).biUnion (candidatePBand (c * L))), if (n.val : ℝ) < X then candidatePHarmonicTerm c L q n.val else 0) ≤ ∑' n : Nat.factoredNumbers ((candidatePIndices c L).biUnion (candidatePBand (c * L))), candidatePHarmonicTerm c L q n.val apply hasSum_le _ (candidate_small_P_harmonic_summable hcL q X).hasSum (candidate_P_harmonic_summable hcL q).hasSum intro n split_ifs · exact le_rfl · exact hnonneg n.val theorem candidate_full_P_harmonic_sum_le_total {c L q : ℝ} (hcL : 0 ≤ c * L) (hq : 0 ≤ q) : (∑ p ∈ candidateFullPSet c L, candidatePWeight c L q p / (p : ℝ)) ≤ candidateOneMarkedHarmonicMass c L q := by rw [candidateFullPSet, candidate_small_P_weight_harmonic_sum] exact candidate_small_P_harmonic_le_total hcL hq _ end section open Finset Filter open scoped Topology theorem candidate_coefficient_full_convolution_of_free (c L q : ℝ) (r jStar : ℕ) (hfree : ∀ n, candidateQWeight c L r jStar n ≠ 0 → n ≠ 0 ∧ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c * L)))) : candidateCoefficientWindowMass c L q r jStar = ∑ p ∈ candidateSmallPSet c L (16 * Real.exp L + 1), candidatePWeight c L q p * ∑ n ∈ arithmeticProductWindow p (Real.exp L), candidateQWeight c L r jStar n := by symm apply supported_free_window_convolution_eq ((candidatePIndices c L).biUnion (candidatePBand (c * L))) (candidateSmallPSet c L (16 * Real.exp L + 1)) (candidatePWeight c L q) (candidateQWeight c L r jStar) (candidateCoefficient c L q r jStar) (Real.exp L) · intro p hp exact ((mem_candidateSmallPSet_iff c L _ p).mp hp).2 · exact hfree · intro p hp n hn exact candidate_coefficient_mul_of_free c L q r jStar ((mem_candidateSmallPSet_iff c L _ p).mp hp).2 (hfree n hn).1 (hfree n hn).2 · intro u hu hWu let P := (candidatePIndices c L).biUnion (candidatePBand (c * L)) let p := primePoolPart P u let n := primePoolFreePart P u have hurange : Real.exp L < (u : ℝ) ∧ (u : ℝ) ≤ 16 * Real.exp L := by simpa only [one_mul] using (mem_arithmeticProductWindow_iff one_ne_zero (Real.exp L)).mp hu have hu0 : u ≠ 0 := by have hpos : (0 : ℝ) < u := (Real.exp_pos L).trans hurange.1 exact_mod_cast ne_of_gt hpos have hpu : p ≤ u := Nat.le_of_dvd (Nat.pos_of_ne_zero hu0) (primePoolPart_dvd P u) have hpSupport : p ∈ Nat.factoredNumbers P := primePoolPart_mem_factoredNumbers P u have hpn : p * n = u := primePoolPart_mul_primePoolFreePart P u have hp : p ∈ candidateSmallPSet c L (16 * Real.exp L + 1) := by apply (mem_candidateSmallPSet_iff c L _ p).mpr refine ⟨?_, hpSupport⟩ have hpuR : (p : ℝ) ≤ u := Nat.cast_le.mpr hpu linarith [hurange.2] have hn : n ∈ arithmeticProductWindow p (Real.exp L) := by apply (mem_arithmeticProductWindow_iff (primePoolPart_ne_zero P u) (Real.exp L)).mpr change Real.exp L < (p * n : ℕ) ∧ (p * n : ℕ) ≤ 16 * Real.exp L simpa only [hpn] using hurange exact ⟨p, hp, n, hn, left_ne_zero_of_mul hWu, hpn⟩ /- The eventual threshold is uniform over the damping parameter, the number of slots, and the distinguished rough-slot index. -/ theorem eventually_candidate_coefficient_full_convolution {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ), candidateCoefficientWindowMass c L q r jStar = ∑ p ∈ candidateSmallPSet c L (16 * Real.exp L + 1), candidatePWeight c L q p * ∑ n ∈ arithmeticProductWindow p (Real.exp L), candidateQWeight c L r jStar n := by filter_upwards [eventually_candidate_P_pool_below_rough_cutoff hc, eventually_ge_atTop (0 : ℝ)] with L hpool hL intro q r jStar apply candidate_coefficient_full_convolution_of_free intro n hn obtain ⟨x, hx⟩ := ordered_slot_weight_ne_zero_support _ _ hn refine ⟨?_, ?_⟩ · rw [← hx] exact prod_ne_zero_iff.mpr (fun slot _ => candidate_Q_slot_nonzero c L r jStar slot (x slot).property) · rw [← hx] exact candidate_Q_tuple_primeFactors_disjoint (mul_nonneg hc.le hL) hpool x end section open Finset open scoped Classical section Paths variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] (a : ℕ → P → Bool) (steps : ∀ i, GlobalBirthRawStep (R := R) (a i) (a (i + 1))) end Paths end section open Finset open scoped Classical /- At a fixed length, finite-pool embeddings are exactly ordered ambient draws selected by injectivity and membership in that pool. -/ theorem birth_pool_sum_eq_ambient_mask {P : Type*} [Fintype P] [DecidableEq P] (U : Finset P) (m : ℕ) (F : (Fin m → P) → ℂ) : (∑ f : Fin m ↪ U, F (fun j => (f j).val)) = ∑ f : Fin m → P, if Function.Injective f ∧ (∀ j, f j ∈ U) then F f else 0 := by rw [← sum_filter] apply sum_bij (fun f _ => fun j => (f j).val) · intro f _ refine mem_filter.mpr ⟨mem_univ _, ?_, fun j => (f j).property⟩ intro j k hjk exact f.injective (Subtype.ext hjk) · intro f _ g _ hfg apply Function.Embedding.ext intro j exact Subtype.ext (congrFun hfg j) · intro f hf have hv := (mem_filter.mp hf).2 refine ⟨⟨fun j => ⟨f j, hv.2 j⟩, ?_⟩, mem_univ _, rfl⟩ intro j k hjk exact hv.1 (congrArg Subtype.val hjk) · intro f _ rfl /- Extending the length range to the whole ambient label pool adds only zero terms, since an accepted injection cannot exceed its allowed pool. -/ theorem birth_pool_batch_sum_eq_ambient_mask {P : Type*} [Fintype P] [DecidableEq P] (U : Finset P) (F : ∀ m, (Fin m → P) → ℂ) : (∑ m ∈ range (U.card + 1), ∑ f : Fin m ↪ U, F m (fun j => (f j).val)) = ∑ m ∈ range (Fintype.card P + 1), ∑ f : Fin m → P, if Function.Injective f ∧ (∀ j, f j ∈ U) then F m f else 0 := by simp_rw [birth_pool_sum_eq_ambient_mask] apply sum_subset (range_mono (Nat.add_le_add_right (card_le_univ U) 1)) intro m _ hm apply sum_eq_zero intro f _ apply if_neg intro hf let e : Fin m ↪ U := ⟨fun j => ⟨f j, hf.2 j⟩, fun _ _ h => hf.1 (congrArg Subtype.val h)⟩ have hcard : m ≤ U.card := by simpa only [Fintype.card_fin, Fintype.card_coe] using Fintype.card_le_of_embedding e exact hm (mem_range.mpr (Nat.lt_succ_of_le hcard)) /- Ambient repeated-birth row with distinctness and the entire cumulative ledger exclusion expressed only in an explicit acceptance predicate. -/ noncomputable def globalBirthGhostVisitAmbientRow {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (H : Finset P) (old : Fin N → Σ p, R p) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) : ℂ := ∑ T ∈ (globalBirthVisitZeroIndices h old).powerset, ∑ m ∈ range (Fintype.card P + 1), ∑ f : Fin m → P, if Function.Injective f ∧ (∀ j, f j ∉ H) then ((((-η / ρ) ^ T.card * ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeroIndices h old \ T).card) * ((-η * V / ρ) ^ m * (∏ j, β (f j) / V)) / (m.factorial : ℝ) : ℝ) : ℂ) * (if (retainedBirthTuple old (univ \ T) (fun j => ⟨f j, h (f j)⟩)).1 ≤ cap then G (H ∪ univ.image f) (retainedBirthTuple old (univ \ T) (fun j => ⟨f j, h (f j)⟩)) else 0) else 0 /- The original global-birth visit is exactly the ambient repeated-draw row. Every ordered batch coefficient, including its single 1/m! factor, is unchanged. -/ theorem global_birth_ghost_visit_eq_ambient_row {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (H : Finset P) (old : Fin N → Σ p, R p) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) : globalBirthGhostVisitRawRow h β η V ρ cap H old G = globalBirthGhostVisitAmbientRow h β η V ρ cap H old G := by unfold globalBirthGhostVisitRawRow globalBirthGhostVisitAmbientRow apply sum_congr rfl intro T _ have hs := birth_pool_batch_sum_eq_ambient_mask (univ \ H) (fun m f => ((((-η / ρ) ^ T.card * ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeroIndices h old \ T).card) * ((-η * V / ρ) ^ m * (∏ j, β (f j) / V)) / (m.factorial : ℝ) : ℝ) : ℂ) * (if (retainedBirthTuple old (univ \ T) (fun j => ⟨f j, h (f j)⟩)).1 ≤ cap then G (H ∪ univ.image f) (retainedBirthTuple old (univ \ T) (fun j => ⟨f j, h (f j)⟩)) else 0)) simpa only [← global_visit_birth_range_image, mem_sdiff, mem_univ, true_and] using hs end section open Finset /- A separate coordinate equivalence at each physical vertex reindexes both cuts of its visit and the adjoining cuts of its edges. -/ theorem finite_alternating_pairing_conjugate {X : Type*} [Fintype X] (e : ℕ → X ≃ X) (G E : ℕ → X → X → ℝ) (f q : X → ℝ) (n : ℕ) : finiteAlternatingPairing (fun j x y => G j ((e j).symm x) ((e j).symm y)) (fun j x y => E j ((e (j + 1)).symm x) ((e j).symm y)) (fun x => f ((e 0).symm x)) (fun x => q ((e n).symm x)) n = finiteAlternatingPairing G E f q n := by unfold finiteAlternatingPairing simp_rw [finite_alternating_action] have hK : (fun j x y => ∑ z, G (j + 1) ((e (j + 1)).symm x) ((e (j + 1)).symm z) * E j ((e (j + 1)).symm z) ((e j).symm y)) = (fun j x y => (fun u v => ∑ z, G (j + 1) u z * E j z v) ((e (j + 1)).symm x) ((e j).symm y)) := by funext j x y exact (e (j + 1)).symm.sum_comp (fun z => G (j + 1) ((e (j + 1)).symm x) z * E j z ((e j).symm y)) have hF : (fun x => ∑ y, G 0 ((e 0).symm x) ((e 0).symm y) * f ((e 0).symm y)) = (fun x => (fun u => ∑ y, G 0 u y * f y) ((e 0).symm x)) := by funext x exact (e 0).symm.sum_comp (fun y => G 0 ((e 0).symm x) y * f y) rw [hK, hF] simp_rw [finite_path_action_conjugate_apply e (fun j u v => ∑ z, G (j + 1) u z * E j z v) (fun u => ∑ y, G 0 u y * f y) n] exact (e n).symm.sum_comp (fun x => q x * finitePathAction (fun j u v => ∑ z, G (j + 1) u z * E j z v) (fun u => ∑ y, G 0 u y * f y) n x) section Shift variable {I : Type*} {R : I → Type*} [∀ p, AddGroup (R p)] def ghostPhaseTensorShift (h : (p : I) → R p) : ((p : I) → GhostPhaseState (R p)) ≃ ((p : I) → GhostPhaseState (R p)) := Equiv.piCongrRight (fun p => ghostPhaseShift (h p)) theorem ghost_phase_tensor_shift_symm_apply (h : (p : I) → R p) (z : (p : I) → GhostPhaseState (R p)) (p : I) : (ghostPhaseTensorShift h).symm z p = (ghostPhaseShift (h p)).symm (z p) := rfl theorem ghost_phase_run_initial_shift_symm {S : Type*} [AddGroup S] (a : Bool) (β V : ℝ) (h : S) (z : GhostPhaseState S) : ghostPhaseRunInitial a β V ((ghostPhaseShift h).symm z) = ghostPhaseRunInitial a β V z := by cases a <;> rcases z with _ | (_ | (_ | r)) <;> rfl theorem ghost_phase_terminal_shift_symm {S : Type*} [AddGroup S] (a : Bool) (h : S) (z : GhostPhaseState S) : ghostPhaseTerminal a ((ghostPhaseShift h).symm z) = ghostPhaseTerminal a z := by cases a <;> rcases z with _ | (_ | (_ | r)) <;> rfl variable [Fintype I] theorem ghost_phase_pending_support_tensor_shift_symm (h : (p : I) → R p) (z : (p : I) → GhostPhaseState (R p)) : ghostPhasePendingSupport ((ghostPhaseTensorShift h).symm z) = ghostPhasePendingSupport z := by change ghostPhasePendingSupport (fun p => (ghostPhaseShift (h p)).symm (z p)) = _ simpa only [ghostPhaseShift_symm] using ghost_phase_pending_support_shift (fun p => -h p) z variable [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] noncomputable def ghostPhaseCappedDampedMovingEdge (atgt asrc : I → Bool) (delta : (p : I) → R p) (β V ρtgt ρsrc : I → ℝ) (cap : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ℝ := if (ghostPhasePendingSupport z).card ≤ cap then ∏ p, (if atgt p && !(asrc p) then (V p)⁻¹ else 1) * ghostPhaseDampedMovingEdge (atgt p) (asrc p) (delta p) (β p) (ρtgt p) (ρsrc p) (z p) (w p) else 0 omit [∀ p, Fintype (R p)] in theorem ghost_phase_capped_damped_visit_relative_zero (a : I → Bool) (h : (p : I) → R p) (η β ρ : I → ℝ) (cap : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ghostPhaseCappedDampedVisit a h η β ρ cap ((ghostPhaseTensorShift h).symm z) ((ghostPhaseTensorShift h).symm w) = ghostPhaseCappedDampedVisit a (fun _ => 0) η β ρ cap z w := by unfold ghostPhaseCappedDampedVisit rw [ghost_phase_pending_support_tensor_shift_symm] split_ifs · apply prod_congr rfl intro p _ exact ghost_phase_damped_visit_relative_zero (a p) (h p) (η p) (β p) (ρ p) (z p) (w p) · rfl theorem ghost_phase_capped_damped_edge_conjugation (atgt asrc : I → Bool) (htgt hsrc : (p : I) → R p) (β V ρtgt ρsrc : I → ℝ) (cap : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ghostPhaseCappedDampedEdge atgt asrc htgt hsrc β V ρtgt ρsrc cap ((ghostPhaseTensorShift htgt).symm z) ((ghostPhaseTensorShift hsrc).symm w) = ghostPhaseCappedDampedMovingEdge atgt asrc (fun p => htgt p - hsrc p) β V ρtgt ρsrc cap z w := by unfold ghostPhaseCappedDampedEdge ghostPhaseCappedDampedMovingEdge rw [ghost_phase_pending_support_tensor_shift_symm] split_ifs · apply prod_congr rfl intro p _ congr 1 exact ghost_phase_damped_edge_conjugation (atgt p) (asrc p) (htgt p) (hsrc p) (β p) (ρtgt p) (ρsrc p) (z p) (w p) · rfl end Shift section History variable {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : I → ℕ → Bool) (h : (p : I) → ℕ → R p) (η : I → ℕ → ℝ) (β V : I → ℝ) (ρ : I → ℕ → ℝ) (visitCap edgeCap : ℕ → ℕ) noncomputable def ghostPhaseCappedMovingDampedHistory (n : ℕ) : ℝ := finiteAlternatingPairing (fun j => ghostPhaseCappedDampedVisit (fun p => a p j) (fun _ => 0) (fun p => η p j) β (fun p => ρ p j) (visitCap j)) (fun j => ghostPhaseCappedDampedMovingEdge (fun p => a p (j + 1)) (fun p => a p j) (fun p => h p (j + 1) - h p j) β V (fun p => ρ p (j + 1)) (fun p => ρ p j) (edgeCap j)) (fun z => ∏ p, ghostPhaseRunInitial (a p 0) (β p) (V p) (z p)) (fun z => ∏ p, ghostPhaseTerminal (a p n) (z p)) n /- Reindex every phase cut to its absolute residue frame. All pending-card cutoffs are preserved exactly, with no nonzero-rho assumption needed. -/ theorem ghost_phase_capped_moving_history_eq_absolute (n : ℕ) : ghostPhaseCappedMovingDampedHistory a h η β V ρ visitCap edgeCap n = ghostPhaseCappedDampedHistory a h η β V ρ visitCap edgeCap n := by have he := finite_alternating_pairing_conjugate (fun j => ghostPhaseTensorShift (fun p => h p j)) (fun j => ghostPhaseCappedDampedVisit (fun p => a p j) (fun p => h p j) (fun p => η p j) β (fun p => ρ p j) (visitCap j)) (fun j => ghostPhaseCappedDampedEdge (fun p => a p (j + 1)) (fun p => a p j) (fun p => h p (j + 1)) (fun p => h p j) β V (fun p => ρ p (j + 1)) (fun p => ρ p j) (edgeCap j)) (fun z => ∏ p, ghostPhaseRunInitial (a p 0) (β p) (V p) (z p)) (fun z => ∏ p, ghostPhaseTerminal (a p n) (z p)) n simpa only [ghostPhaseCappedMovingDampedHistory, ghostPhaseCappedDampedHistory, ghost_phase_capped_damped_visit_relative_zero, ghost_phase_capped_damped_edge_conjugation, ghost_phase_tensor_shift_symm_apply, ghost_phase_run_initial_shift_symm, ghost_phase_terminal_shift_symm] using he /- The capped normalized moving history equals the undamped absolute-hit history whenever every local rho is nonzero. No cap is discarded. -/ theorem ghost_phase_capped_moving_history_eq_undamped (hρ : ∀ p j, ρ p j ≠ 0) (n : ℕ) : ghostPhaseCappedMovingDampedHistory a h η β V ρ visitCap edgeCap n = ghostPhaseCappedHistory a h η β V visitCap edgeCap n := by rw [ghost_phase_capped_moving_history_eq_absolute, ghost_phase_capped_damped_history_eq a h η β V ρ visitCap edgeCap hρ n] end History end section open Finset section Joint variable {N : Nat} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} abbrev GlobalBirthJointState (R : (g : Fin N) → P g → Type*) := (g : Fin N) → GlobalBirthHistoryState (R g) abbrev GlobalBirthJointPhase (R : (g : Fin N) → P g → Type*) := (g : Fin N) → (p : P g) → GhostPhaseState (R g p) def GlobalBirthJointCoherent (a : (g : Fin N) → P g → Bool) (s : GlobalBirthJointState R) : Prop := ∀ g, GlobalBirthMemoryCoherent (ghostPhaseActivitySupport (a g)) (s g).1 (s g).2 noncomputable def globalBirthJointReadout (a : (g : Fin N) → P g → Bool) (s : GlobalBirthJointState R) : GlobalBirthJointPhase R := fun g => globalBirthMemoryReadout (ghostPhaseActivitySupport (a g)) (s g).1 (s g).2 def globalBirthJointLength (s : GlobalBirthJointState R) : Nat := ∑ g, (s g).2.1 noncomputable def globalBirthJointPending (z : GlobalBirthJointPhase R) : Nat := ∑ g, (ghostPhasePendingSupport (z g)).card def globalBirthJointRawCutoff (cap : Nat) (G : GlobalBirthJointState R → ℂ) (s : GlobalBirthJointState R) : ℂ := if globalBirthJointLength s ≤ cap then G s else 0 noncomputable def globalBirthJointPhaseCutoff (cap : Nat) (F : GlobalBirthJointPhase R → ℂ) (z : GlobalBirthJointPhase R) : ℂ := if globalBirthJointPending z ≤ cap then F z else 0 theorem global_birth_coherent_readout_pending_card {Q : Type*} [Fintype Q] [DecidableEq Q] {S : Q → Type*} (active born : Finset Q) (q : FiniteOrderedTuple (Σ p, S p)) (hq : GlobalBirthMemoryCoherent active born q) : (ghostPhasePendingSupport (globalBirthMemoryReadout active born q)).card = q.1 := by rw [global_birth_coherent_readout_pending_support active born q hq] have hinj : Function.Injective (fun j => (q.2 j).1) := hq.label_injective rw [Finset.card_image_of_injective _ hinj] simp only [card_univ, Fintype.card_fin] theorem global_birth_joint_readout_pending (a : (g : Fin N) → P g → Bool) (s : GlobalBirthJointState R) (hs : GlobalBirthJointCoherent a s) : globalBirthJointPending (globalBirthJointReadout a s) = globalBirthJointLength s := by apply Finset.sum_congr rfl intro g _ exact global_birth_coherent_readout_pending_card _ _ _ (hs g) theorem global_birth_joint_cutoff_readout (a : (g : Fin N) → P g → Bool) (cap : Nat) (G : GlobalBirthJointState R → ℂ) (F : GlobalBirthJointPhase R → ℂ) (hGF : ∀ s, GlobalBirthJointCoherent a s → G s = F (globalBirthJointReadout a s)) (s : GlobalBirthJointState R) (hs : GlobalBirthJointCoherent a s) : globalBirthJointRawCutoff cap G s = globalBirthJointPhaseCutoff cap F (globalBirthJointReadout a s) := by unfold globalBirthJointRawCutoff globalBirthJointPhaseCutoff rw [global_birth_joint_readout_pending a s hs, hGF s hs] variable [∀ g p, AddGroup (R g p)] [∀ g p, Fintype (R g p)] [∀ g p, DecidableEq (R g p)] noncomputable def globalBirthJointRawRow {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (cap : Nat) (G : GlobalBirthJointState R → ℂ) (s : GlobalBirthJointState R) : ℂ := finTensorRow N (fun g K t => globalBirthRawStepRow (step g) (fun H q => K (H, q)) t.1 t.2) (globalBirthJointRawCutoff cap G) s noncomputable def globalBirthJointPhaseRow {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (cap : Nat) (F : GlobalBirthJointPhase R → ℂ) (z : GlobalBirthJointPhase R) : ℂ := finTensorRow N (fun g => globalBirthRawStepPhaseRow (step g)) (globalBirthJointPhaseCutoff cap F) z /- The actual group rows commute with readout when the one joint cutoff is applied to the completed output, regardless of the continuation's shape. -/ theorem global_birth_joint_raw_row_intertwines {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (cap : Nat) (G : GlobalBirthJointState R → ℂ) (F : GlobalBirthJointPhase R → ℂ) (hGF : ∀ s, GlobalBirthJointCoherent b s → G s = F (globalBirthJointReadout b s)) (s : GlobalBirthJointState R) (hs : GlobalBirthJointCoherent a s) : globalBirthJointRawRow step cap G s = globalBirthJointPhaseRow step cap F (globalBirthJointReadout a s) := by unfold globalBirthJointRawRow globalBirthJointPhaseRow globalBirthJointReadout apply fin_tensor_row_intertwines_on N (S := fun g => GlobalBirthHistoryState (R g)) (T := fun g => GlobalBirthHistoryState (R g)) (X := fun g => (p : P g) → GhostPhaseState (R g p)) (Y := fun g => (p : P g) → GhostPhaseState (R g p)) (fun g K t => globalBirthRawStepRow (step g) (fun H q => K (H, q)) t.1 t.2) (fun g => globalBirthRawStepPhaseRow (step g)) (fun g t => globalBirthMemoryReadout (ghostPhaseActivitySupport (a g)) t.1 t.2) (fun g t => globalBirthMemoryReadout (ghostPhaseActivitySupport (b g)) t.1 t.2) (fun g t => GlobalBirthMemoryCoherent (ghostPhaseActivitySupport (a g)) t.1 t.2) (fun g t => GlobalBirthMemoryCoherent (ghostPhaseActivitySupport (b g)) t.1 t.2) · intro g t ht K L hKL exact global_birth_raw_step_intertwines (step g) t.1 t.2 ht (fun H q => K (H, q)) L (fun H q hq _ => hKL (H, q) hq) · intro t ht exact global_birth_joint_cutoff_readout b cap G F hGF t ht · exact hs end Joint end section open Finset theorem fin_tensor_row_kernel (n : Nat) {S T : Fin n → Type*} [∀ g, Fintype (T g)] (K : (g : Fin n) → T g → S g → ℂ) (F : ((g : Fin n) → T g) → ℂ) (s : (g : Fin n) → S g) : finTensorRow n (fun g G w => ∑ z, K g z w * G z) F s = ∑ z, (∏ g, K g (z g) (s g)) * F z := by classical induction n with | zero => simp only [finTensorRow, Fintype.prod_empty, one_mul, Fintype.sum_unique] exact congrArg F (Subsingleton.elim _ _) | succ n ih => simp only [finTensorRow, ih, mul_sum] rw [← (Fin.consEquiv T).sum_comp] rw [Fintype.sum_prod_type] apply sum_congr rfl intro t _ apply sum_congr rfl intro u _ simp only [Fin.consEquiv, Equiv.coe_fn_mk, Fin.prod_univ_succ, Fin.cons_zero, Fin.cons_succ, Fin.tail] rw [mul_assoc] end section open Finset theorem finite_alternating_pairing_complex_trace {X : Type*} [Fintype X] (G E : ℕ → X → X → ℝ) (f q : X → ℝ) (n : ℕ) : (finiteAlternatingPairing G E f q n : ℂ) = ∑ x : Fin (2 * n + 2) → X, (q (x (Fin.last (2 * n + 1))) : ℂ) * ((f (x 0) : ℂ) * ∏ j : Fin (2 * n + 1), ((finiteAlternatingKernel G E j.val (x j.succ) (x j.castSucc) : ℝ) : ℂ)) := by have ht := (finite_chronological_trace_expansion (finiteAlternatingKernel G E) f q (2 * n + 1)).symm simpa only [finiteAlternatingPairing, finiteChronologicalPrefix, Complex.ofReal_sum, Complex.ofReal_mul, Complex.ofReal_prod] using congrArg (fun r : ℝ => (r : ℂ)) ht theorem complex_trace_eq_real_alternating {X : Type*} [Fintype X] (G E : ℕ → X → X → ℝ) (K : ℕ → X → X → ℂ) (f q : X → ℝ) (n : ℕ) (hK : ∀ j < 2 * n + 1, ∀ z w, K j z w = ((finiteAlternatingKernel G E j z w : ℝ) : ℂ)) : (∑ x : Fin (2 * n + 2) → X, (q (x (Fin.last (2 * n + 1))) : ℂ) * ((f (x 0) : ℂ) * ∏ j : Fin (2 * n + 1), K j.val (x j.succ) (x j.castSucc))) = (finiteAlternatingPairing G E f q n : ℂ) := by rw [finite_alternating_pairing_complex_trace] apply sum_congr rfl intro x _ congr 2 apply prod_congr rfl intro j _ exact hK j.val j.isLt _ _ end section open Finset section Ledger variable {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) def finiteLedgerEventTarget (k : K) (s : L × X) (e : E k s.2) : L × X := (update k s.1 s.2 e, target k s.2 e) def finiteEventPathLedger : ∀ ks, L → (x : X) → FiniteEventPath E target ks x → L | [], l, _, _ => l | k :: ks, l, x, ⟨e, p⟩ => finiteEventPathLedger ks (update k l x e) (target k x e) p def finiteLedgerEventPathEquiv : ∀ ks (l : L) (x : X), FiniteEventPath (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) ks (l, x) ≃ FiniteEventPath E target ks x | [], _, _ => Equiv.refl _ | k :: ks, l, x => Equiv.sigmaCongrRight (fun e : E k x => finiteLedgerEventPathEquiv ks (update k l x e) (target k x e)) theorem finite_ledger_event_path_terminal (ks : List K) (l : L) (x : X) (p : FiniteEventPath (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) ks (l, x)) : finiteEventPathTerminal (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) ks (l, x) p = (finiteEventPathLedger E target update ks l x (finiteLedgerEventPathEquiv E target update ks l x p), finiteEventPathTerminal E target ks x (finiteLedgerEventPathEquiv E target update ks l x p)) := by induction ks generalizing l x with | nil => rfl | cons k ks ih => rcases p with ⟨e, p⟩ exact ih (update k l x e) (target k x e) p theorem finite_ledger_event_path_weight (w : ∀ k x, E k x → ℝ) (ks : List K) (l : L) (x : X) (p : FiniteEventPath (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) ks (l, x)) : finiteEventPathWeight (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) (fun k s => w k s.2) ks (l, x) p = finiteEventPathWeight E target w ks x (finiteLedgerEventPathEquiv E target update ks l x p) := by induction ks generalizing l x with | nil => rfl | cons k ks ih => rcases p with ⟨e, p⟩ exact congrArg (w k x e * ·) (ih (update k l x e) (target k x e) p) variable [∀ k x, Fintype (E k x)] /- A deterministic ledger can be removed from the state of the path sum. Every dependence on its history is retained in a pulled-back path phase. -/ theorem finite_ledger_event_path_action_memory (w : ∀ k x, E k x → ℝ) (ks : List K) (phase : ∀ s : L × X, FiniteEventPath (fun k s => E k s.2) (finiteLedgerEventTarget E target update) ks s → ℂ) (F : X → ℂ) (l : L) (x : X) : finiteEventPathAction (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) (fun k s => w k s.2) ks phase (fun s => F s.2) (l, x) = finiteEventPathAction E target w ks (fun y p => phase (l, y) ((finiteLedgerEventPathEquiv E target update ks l y).symm p)) F x := by classical let _ := finiteEventPathFintype E target ks x let _ := finiteEventPathFintype (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) ks (l, x) unfold finiteEventPathAction rw [← (finiteLedgerEventPathEquiv E target update ks l x).symm.sum_comp] apply sum_congr rfl intro p _ rw [finite_ledger_event_path_weight, finite_ledger_event_path_terminal] simp only [Equiv.apply_symm_apply] end Ledger end section open Finset Classical noncomputable def physicalGhostRetention {P : Type*} (n : P → ℕ) (q ρ : ℝ) (z : UnrestrictedResidueParticle n) : ℝ := if unrestrictedResidueHit z then q / ρ ^ 2 else 1 noncomputable def physicalGhostTermination {P : Type*} (n : P → ℕ) (q ρ : ℝ) (z : UnrestrictedResidueParticle n) : ℝ := if unrestrictedResidueHit z then -((1 - q) / ρ) else 0 noncomputable def physicalGhostBirth {P : Type*} (n : P → ℕ) (q ρ V : ℝ) (z : UnrestrictedResidueParticle n) : ℝ := if unrestrictedResidueHit z then -((1 - q) * V / ρ) else 0 theorem physical_ghost_exponent_eq {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (q ρ V v : ℝ) (hq : q ≤ 1) (hρ : 0 ≤ ρ) (hV : 0 ≤ V) : (∑ z : UnrestrictedResidueParticle n, (|physicalGhostBirth n q ρ V z| + |physicalGhostTermination n q ρ z|) * unrestrictedResidueWeight μ z * v) = ((1 - q) * V / ρ + (1 - q) / ρ) * v * ∑ p, μ p := by have hη : 0 ≤ 1 - q := sub_nonneg.mpr hq have hD : 0 ≤ (1 - q) / ρ := div_nonneg hη hρ have hC : 0 ≤ (1 - q) * V / ρ := div_nonneg (mul_nonneg hη hV) hρ rw [Fintype.sum_sigma] calc _ = ∑ p, (((1 - q) * V / ρ + (1 - q) / ρ) * μ p * v) := by apply sum_congr rfl intro p _ rw [sum_eq_single (0 : ZMod (n p))] · simp [physicalGhostBirth, physicalGhostTermination, unrestrictedResidueHit, unrestrictedResidueWeight, abs_of_nonneg hC, abs_of_nonneg hD] · intro r _ hr simp [physicalGhostBirth, physicalGhostTermination, unrestrictedResidueHit, hr] · simp _ = _ := by rw [mul_sum] apply sum_congr rfl intro p _ ring /- A group-independent energy constant, independent of memory cutoff and the number or sizes of the prime moduli. -/ noncomputable def physicalGhostUniformEnergyBound (ρ vmax v : ℝ) : ℝ := Real.exp (2 * (vmax + 1) * v / ρ) end section open Finset Classical abbrev BoundedGhostEvent {P Z : Type*} (t B : ℕ) (s : BoundedOrderedState P Z t B) := Σ b : Fin (B + 1), Finset (Fin s.2.1.val) × (Fin b.val → Z) noncomputable def boundedGhostEventTarget {P Z : Type*} (t B : ℕ) (s : BoundedOrderedState P Z t B) (e : BoundedGhostEvent t B s) : BoundedOrderedState P Z t B := let q := retainedBirthTuple s.2.2 e.2.1 e.2.2 if h : q.1 ≤ B then (s.1, ⟨⟨q.1, Nat.lt_succ_of_le h⟩, q.2⟩) else s noncomputable def boundedGhostEventWeight {P Z : Type*} (A D C ν : Z → ℝ) (t B : ℕ) (s : BoundedOrderedState P Z t B) (e : BoundedGhostEvent t B s) : ℝ := if e.2.1.card + e.1.val ≤ B then ((∏ j ∈ e.2.1, A (s.2.2 j)) * (∏ j ∈ univ \ e.2.1, D (s.2.2 j))) * (∏ j, C (e.2.2 j) * ν (e.2.2 j)) / (e.1.val.factorial : ℝ) else 0 theorem bounded_ordered_ghost_eq_event_sum {P Z : Type*} [Fintype Z] [DecidableEq Z] (A D C ν : Z → ℝ) (t B : ℕ) (f : BoundedOrderedState P Z t B → ℂ) (s : BoundedOrderedState P Z t B) : boundedOrderedGhostOperator A D C ν t B f s = ∑ e : BoundedGhostEvent t B s, (boundedGhostEventWeight A D C ν t B s e : ℂ) * f (boundedGhostEventTarget t B s e) := by change symmetricOrderedGhostRow s.2.2 A D C ν B (boundedOrderedZeroExtension f s.1) = _ unfold symmetricOrderedGhostRow rw [Fintype.sum_sigma] simp only [Fintype.sum_prod_type] rw [← Fin.sum_univ_eq_sum_range] apply sum_congr rfl intro b _ rw [powerset_univ] apply sum_congr rfl intro retained _ apply sum_congr rfl intro births _ by_cases h : retained.card + b.val ≤ B · simp [boundedGhostEventWeight, boundedGhostEventTarget, retainedBirthTuple, boundedOrderedZeroExtension, h] · simp [boundedGhostEventWeight, h] theorem boundedGhostEventWeight_abs {P Z : Type*} (A D C ν : Z → ℝ) (hA : ∀ z, 0 ≤ A z) (hν : ∀ z, 0 ≤ ν z) (t B : ℕ) (s : BoundedOrderedState P Z t B) (e : BoundedGhostEvent t B s) : |boundedGhostEventWeight A D C ν t B s e| = boundedGhostEventWeight A (fun z => |D z|) (fun z => |C z|) ν t B s e := by unfold boundedGhostEventWeight split_ifs · simp only [abs_div, abs_mul, abs_prod, abs_of_nonneg (Nat.cast_nonneg e.1.val.factorial : (0 : ℝ) ≤ _)] simp only [abs_of_nonneg (hA _), abs_of_nonneg (hν _)] · exact abs_zero end section end section open scoped BigOperators Classical theorem prime_tuple_cell_norm_le {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (i : I) (hV : ∀ j, 0 < V j) (hp : ∀ j p, p ∈ P j → 0 < p) (hmass : ∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) {q : ℕ} (χ : DirichletCharacter ℂ q) (U W : ℝ) {B : ℝ} (hB : 0 ≤ B) (hinner : ∀ c : ℕ, 0 < c → ‖∑ p ∈ (P i).filter (fun p : ℕ => U < ((c * p : ℕ) : ℝ) ∧ ((c * p : ℕ) : ℝ) ≤ W), (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ B) : ‖∑ x : (∀ j, P j), (finiteProductWeight (physicalLabelLaw V) x : ℂ) * (if U < ((∏ j, (x j).val : ℕ) : ℝ) ∧ ((∏ j, (x j).val : ℕ) : ℝ) ≤ W then χ ((∏ j, (x j).val : ℕ) : ZMod q) else 0)‖ ≤ B / V i := by let μ : ∀ j, P j → ℝ := physicalLabelLaw V let F : ℕ → ℂ := fun n => if U < (n : ℝ) ∧ (n : ℝ) ≤ W then χ (n : ZMod q) else 0 let R := ∀ j : {j : I // j ≠ i}, P j.val let c : R → ℕ := fun z => ∏ j, (z j).val let ν : R → ℝ := fun z => ∏ j, μ j.val (z j) let S : R → Finset ℕ := fun z => (P i).filter (fun p : ℕ => U < ((c z * p : ℕ) : ℝ) ∧ ((c z * p : ℕ) : ℝ) ≤ W) have hsplit := finite_product_value_expectation_split μ (fun j (p : P j) => p.val) i F change ‖∑ x, (finiteProductWeight μ x : ℂ) * F (∏ j, (x j).val)‖ ≤ B / V i rw [hsplit] have hrow (z : R) : (∑ y : P i, (μ i y : ℂ) * F (y.val * c z)) = ∑ p ∈ S z, (1 / (V i * (p : ℝ))) • χ ((c z * p : ℕ) : ZMod q) := by unfold S rw [Finset.sum_filter] rw [← Finset.sum_coe_sort (P i)] apply Finset.sum_congr rfl intro y _ dsimp only [μ, physicalLabelLaw] rw [Nat.mul_comm y.val] dsimp only [F] split_ifs <;> simp only [mul_zero, Complex.real_smul] have heq : (∑ z : R, (ν z : ℂ) * ∑ y : P i, (μ i y : ℂ) * F (y.val * c z)) = ∑ z : R, (ν z : ℂ) * ∑ p ∈ S z, (1 / (V i * (p : ℝ))) • χ ((c z * p : ℕ) : ZMod q) := by apply Finset.sum_congr rfl intro z _ rw [hrow] change ‖∑ z : R, (ν z : ℂ) * ∑ y : P i, (μ i y : ℂ) * F (y.val * c z)‖ ≤ _ rw [heq] refine prime_band_product_mixture_bound χ S c ν ?_ ?_ (hV i) hB ?_ · intro z exact Finset.prod_nonneg (fun j _ => physical_label_law_nonneg V (fun j => (hV j).le) j.val (z j)) · have hn := finite_product_weight_sum_one (fun (j : {j : I // j ≠ i}) (p : P j.val) => μ j.val p) (fun j => physical_label_law_sum V j.val (hV j.val) (hmass j.val)) exact le_of_eq hn · intro z apply hinner exact Finset.prod_pos (fun j _ => hp j.val (z j).val (z j).property) theorem prime_tuple_cell_bound_of_zero_free (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → 0 < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ U W : ℝ, 0 ≤ U → 0 ≤ W → ‖∑ x : (∀ j, P j), (finiteProductWeight (physicalLabelLaw V) x : ℂ) * (if U < ((∏ j, (x j).val : ℕ) : ℝ) ∧ ((∏ j, (x j).val : ℕ) : ℝ) ≤ W then χ ((∏ j, (x j).val : ℕ) : ZMod q) else 0)‖ ≤ (C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log a) := by obtain ⟨C, hC, hbound⟩ := reciprocal_prime_band_product_interval_bound hZ refine ⟨C, hC, ?_⟩ intro q hq χ hχ I _ _ P V i hV hp hmass a b hPi ha hb U W hU hW have hqR : (1 : ℝ) ≤ q := by exact_mod_cast hq have hlq : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg hqR have hla : 0 < Real.log a := Real.log_pos (by linarith) have hB : 0 ≤ C * a ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log a) := by positivity have h := prime_tuple_cell_norm_le P V i hV hp hmass χ U W hB (fun c hc => by rw [hPi] simpa only [Nat.cast_mul] using hbound q hq χ hχ a b (c : ℝ) U W ha hb (by exact_mod_cast hc) hU hW) calc _ ≤ (C * a ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log a)) / V i := h _ = _ := by ring end section open scoped Classical /- Arbitrary tuple tests may be compressed by their integer products; only an upper bound for each product atom is needed. -/ theorem weighted_indexed_rational_bilinear_bound {X Y I : Type*} [Fintype X] [Fintype Y] [Fintype I] (a N : ℕ) (π : X → Fin N) (τ : Y → I) (t : I → ℕ) (hinj : Function.Injective t) (A : ℤ) (V : ℕ) (ht : ∀ i, A ≤ (t i : ℤ) ∧ (t i : ℤ) ≤ A + (V : ℤ)) (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (f : X → ℂ) (g : Y → ℂ) {C D P Q : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hP : 0 < P) (hQ : 0 < Q) (hπ : ∀ x, P ≤ (a + (π x).val : ℕ)) (hτ : ∀ y, Q ≤ (t (τ y) : ℝ)) (hμatom : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => a + (π x).val = m), μ x) ≤ C / (m : ℝ)) (hνatom : ∀ m : ℕ, (∑ y ∈ Finset.univ.filter (fun y => t (τ y) = m), ν y) ≤ D / (m : ℝ)) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) : ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * (Complex.exp (Complex.I * (2 * Real.pi * (((u : ℝ) / r + β) * t (τ y)) : ℝ))) ^ (a + (π x).val)‖ ^ 2 ≤ ((1 + 3 * (V : ℝ) / r) * (2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r))) * ((C / P) * ∑ x, μ x * ‖f x‖ ^ 2) * ((D / Q) * ∑ y, ν y * ‖g y‖ ^ 2) := by classical let : DecidableEq (Fin N) := Classical.decEq _ let c : Fin N → ℂ := fun k => ∑ x ∈ Finset.univ.filter (fun x => π x = k), (μ x : ℂ) * f x let d : I → ℂ := fun i => ∑ y ∈ Finset.univ.filter (fun y => τ y = i), (ν y : ℂ) * g y let K : Fin N → I → ℂ := fun k i => (Complex.exp (Complex.I * (2 * Real.pi * (((u : ℝ) / r + β) * t i) : ℝ))) ^ (a + k.val) let R : ℝ := (1 + 3 * (V : ℝ) / r) * (2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r)) have hR : 0 ≤ R := by have hl : 0 ≤ Real.log (r : ℝ) := Real.log_nonneg (by exact_mod_cast hr) dsimp [R] positivity have hc : (∑ k, ‖c k‖ ^ 2) ≤ (C / P) * ∑ x, μ x * ‖f x‖ ^ 2 := by simpa only [c] using weighted_fiber_energy_le_of_atom_bound Finset.univ π (fun k => a + k.val) μ hμ f hC hP hπ hμatom have hd : (∑ i, ‖d i‖ ^ 2) ≤ (D / Q) * ∑ y, ν y * ‖g y‖ ^ 2 := weighted_fiber_energy_le_of_atom_bound Finset.univ τ t ν hν g hD hQ hτ hνatom have htinj : Function.Injective (fun i => (t i : ℤ)) := by intro i j he apply hinj change (t i : ℤ) = (t j : ℤ) at he exact_mod_cast he have hb : ‖∑ k, ∑ i, c k * d i * K k i‖ ^ 2 ≤ R * (∑ k, ‖c k‖ ^ 2) * ∑ i, ‖d i‖ ^ 2 := rational_phase_integer_interval_bilinear_norm_sq_le (fun i => (t i : ℤ)) htinj A V ht hr hcop hβ a N c d have he : (∑ k, ∑ i, c k * d i * K k i) = ∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * K (π x) (τ y) := by simpa only [c, d] using finite_fiber_pushforward_bilinear π τ (fun x => (μ x : ℂ) * f x) (fun y => (ν y : ℂ) * g y) K change ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * K (π x) (τ y)‖ ^ 2 ≤ _ rw [← he] apply hb.trans exact mul_le_mul (mul_le_mul_of_nonneg_left hc hR) hd (Finset.sum_nonneg (fun i _ => sq_nonneg ‖d i‖)) (mul_nonneg hR (mul_nonneg (div_nonneg hC hP.le) (Finset.sum_nonneg (fun x _ => mul_nonneg (hμ x) (sq_nonneg _))))) end section open Finset open scoped Classical section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K q : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (source target : RepeatedBigLists P J ell) include G sharedInstance1 P J ell V b C ζ K q aux source target end end section open Finset Filter theorem eventually_candidate_full_mass_harmonic_upper {c q : ℝ} {r : ℕ} (hc : 0 < c) (hq : 0 ≤ q) (hr : 0 < r) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, 0 < jStar → candidateFullOrdinaryWindowMass c L q r jStar ≤ (512 * (Real.log 4 + 1) / c) * (Real.exp L / L) * candidateSmallPHarmonicMass c L q (16 * Real.exp L + 1) * candidateQRestHarmonicMass c L r jStar hr := by filter_upwards [eventually_candidate_free_prime_card_upper hc] with L hcount intro jStar hj rw [candidate_full_ordinary_window_split c L q r jStar hr hj] have h := indexed_free_prime_mass_upper (candidateFullPSet c L) (candidateQBand (c * L) 0) (candidatePWeight c L q) (orderedSlotProduct (candidateQRestChoices c L r jStar hr)) ((r.factorial : ℝ)^(candidateQIndices c L).card) (Real.exp L) ((512 * (Real.log 4 + 1) / c) / L) (by positivity) (fun p _ => candidate_P_weight_nonneg c L hq p) ?_ · rw [candidateFullPSet, candidate_small_P_weight_harmonic_sum, ← candidate_Q_rest_harmonic_eq_tuple_sum] at h exact h.trans_eq (by ring) · intro p hp y have hn : 0 < p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y := Nat.pos_of_ne_zero (mul_ne_zero (candidate_full_P_set_nonzero hp) (candidate_Q_rest_product_nonzero c L r jStar hr y)) have hnR : (0 : ℝ) < (p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y : ℕ) := Nat.cast_pos.mpr hn convert hcount _ hnR using 1; ring theorem exists_candidate_coefficient_window_mass_upper {c q : ℝ} {r : ℕ} (hc : 0 < c) (hq : 0 ≤ q) (hr : 0 < r) : ∃ K : ℝ, 0 < K ∧ ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, 0 < jStar → candidateCoefficientWindowMass c L q r jStar ≤ K * (Real.exp L / L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar := by obtain ⟨V, hV, hrest⟩ := exists_candidate_Q_rest_harmonic_upper hc r hr let D : ℝ := 512 * (Real.log 4 + 1) / c have hD : 0 < D := by dsimp only [D]; positivity refine ⟨D * V, mul_pos hD hV, ?_⟩ filter_upwards [eventually_candidate_full_mass_harmonic_upper hc hq hr, hrest, eventually_candidate_coefficient_full_convolution hc, eventually_gt_atTop (0 : ℝ)] with L hmass hrest hconv hL intro jStar hj have hsmall := candidate_small_P_harmonic_le_total (mul_nonneg hc.le hL.le) hq (16 * Real.exp L + 1) have hparts : candidateSmallPHarmonicMass c L q (16 * Real.exp L + 1) * candidateQRestHarmonicMass c L r jStar hr ≤ candidateOneMarkedHarmonicMass c L q * (V * candidateQHarmonicMass c L r jStar) := mul_le_mul hsmall (hrest jStar hj) (candidate_Q_rest_harmonic_nonneg c L r jStar hr) ((candidate_small_P_harmonic_nonneg c L q _ hq).trans hsmall) calc _ = candidateFullOrdinaryWindowMass c L q r jStar := hconv q r jStar _ ≤ D * (Real.exp L / L) * candidateSmallPHarmonicMass c L q (16 * Real.exp L + 1) * candidateQRestHarmonicMass c L r jStar hr := hmass jStar hj _ = (D * (Real.exp L / L)) * (candidateSmallPHarmonicMass c L q (16 * Real.exp L + 1) * candidateQRestHarmonicMass c L r jStar hr) := by ring _ ≤ (D * (Real.exp L / L)) * (candidateOneMarkedHarmonicMass c L q * (V * candidateQHarmonicMass c L r jStar)) := mul_le_mul_of_nonneg_left hparts (by positivity) _ = _ := by ring end section open Finset open scoped Classical section Events variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {a b : P → Bool} end Events end section open Finset section Kernels variable {I : Type*} [Fintype I] {R : I → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] omit [∀ p, Fintype (R p)] in theorem ghost_phase_capped_visit_eq_of_card_le (a : I → Bool) (h : (p : I) → R p) (η β : I → ℝ) (cap : ℕ) (hc : Fintype.card I ≤ cap) (z w : (p : I) → GhostPhaseState (R p)) : ghostPhaseCappedVisit a h η β cap z w = ∏ p, ghostPhaseVisit (a p) (h p) (η p) (β p) (z p) (w p) := by have hz : (ghostPhasePendingSupport z).card ≤ cap := (card_le_univ _).trans hc exact if_pos hz theorem ghost_phase_capped_edge_eq_of_card_le (atgt asrc : I → Bool) (htgt hsrc : (p : I) → R p) (β V : I → ℝ) (cap : ℕ) (hc : Fintype.card I ≤ cap) (z w : (p : I) → GhostPhaseState (R p)) : ghostPhaseCappedEdge atgt asrc htgt hsrc β V cap z w = ∏ p, ghostPhaseRunEdge (atgt p) (asrc p) (htgt p) (hsrc p) (β p) (V p) (z p) (w p) := by have hz : (ghostPhasePendingSupport z).card ≤ cap := (card_le_univ _).trans hc exact if_pos hz end Kernels section History variable {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : I → ℕ → Bool) (h : (p : I) → ℕ → R p) (η : I → ℕ → ℝ) (β V : I → ℝ) (visitCap edgeCap : ℕ → ℕ) /- If no finite phase configuration can exceed the cap, the capped tensor history factors into the original one-prime run-normalized histories. -/ theorem ghost_phase_capped_history_eq_run_product (hv : ∀ j, Fintype.card I ≤ visitCap j) (he : ∀ j, Fintype.card I ≤ edgeCap j) (n : ℕ) : ghostPhaseCappedHistory a h η β V visitCap edgeCap n = ∏ p, ghostPhaseRunHistory (a p) (h p) (η p) (β p) (V p) n := by have hG (j : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ghostPhaseCappedVisit (fun p => a p j) (fun p => h p j) (fun p => η p j) β (visitCap j) z w = ∏ p, ghostPhaseVisit (a p j) (h p j) (η p j) (β p) (z p) (w p) := ghost_phase_capped_visit_eq_of_card_le _ _ _ _ _ (hv j) z w have hE (j : ℕ) (z w : (p : I) → GhostPhaseState (R p)) : ghostPhaseCappedEdge (fun p => a p (j + 1)) (fun p => a p j) (fun p => h p (j + 1)) (fun p => h p j) β V (edgeCap j) z w = ∏ p, ghostPhaseRunEdge (a p (j + 1)) (a p j) (h p (j + 1)) (h p j) (β p) (V p) (z p) (w p) := ghost_phase_capped_edge_eq_of_card_le _ _ _ _ _ _ _ (he j) z w unfold ghostPhaseCappedHistory finiteAlternatingPairing simp_rw [finite_alternating_action, hG, hE] exact alternating_tensor_pairing_factor (fun j p => ghostPhaseVisit (a p j) (h p j) (η p j) (β p)) (fun j p => ghostPhaseRunEdge (a p (j + 1)) (a p j) (h p (j + 1)) (h p j) (β p) (V p)) (fun p => ghostPhaseRunInitial (a p 0) (β p) (V p)) (fun p => ghostPhaseTerminal (a p n)) n variable [∀ p, AddGroup (R p)] end History end section open Finset section Joint variable {N : Nat} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, Fintype (R g p)] [∀ g p, DecidableEq (R g p)] noncomputable def globalBirthJointCutRawRow {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (inputCap outputCap : Nat) (G : GlobalBirthJointState R → ℂ) : GlobalBirthJointState R → ℂ := globalBirthJointRawCutoff inputCap (globalBirthJointRawRow step outputCap G) noncomputable def globalBirthJointCutPhaseRow {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (inputCap outputCap : Nat) (F : GlobalBirthJointPhase R → ℂ) : GlobalBirthJointPhase R → ℂ := globalBirthJointPhaseCutoff inputCap (globalBirthJointPhaseRow step outputCap F) theorem global_birth_joint_cut_raw_row_intertwines {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (inputCap outputCap : Nat) (G : GlobalBirthJointState R → ℂ) (F : GlobalBirthJointPhase R → ℂ) (hGF : ∀ s, GlobalBirthJointCoherent b s → G s = F (globalBirthJointReadout b s)) (s : GlobalBirthJointState R) (hs : GlobalBirthJointCoherent a s) : globalBirthJointCutRawRow step inputCap outputCap G s = globalBirthJointCutPhaseRow step inputCap outputCap F (globalBirthJointReadout a s) := global_birth_joint_cutoff_readout a inputCap _ _ (fun t ht => global_birth_joint_raw_row_intertwines step outputCap G F hGF t ht) s hs variable (a : Nat → (g : Fin N) → P g → Bool) (steps : (i : Nat) → (g : Fin N) → GlobalBirthRawStep (R := R g) (a i g) (a (i + 1) g)) (cap : Nat → Nat) noncomputable def globalBirthJointRawHistory (n : Nat) (G : GlobalBirthJointState R → ℂ) : GlobalBirthJointState R → ℂ := finiteRowComposition (S := fun _ => GlobalBirthJointState R) (fun i => globalBirthJointCutRawRow (steps i) (cap i) (cap (i + 1))) n G noncomputable def globalBirthJointPhaseHistory (n : Nat) (F : GlobalBirthJointPhase R → ℂ) : GlobalBirthJointPhase R → ℂ := finiteRowComposition (S := fun _ => GlobalBirthJointPhase R) (fun i => globalBirthJointCutPhaseRow (steps i) (cap i) (cap (i + 1))) n F theorem global_birth_joint_raw_history_intertwines (n : Nat) (G : GlobalBirthJointState R → ℂ) (F : GlobalBirthJointPhase R → ℂ) (hGF : ∀ s, GlobalBirthJointCoherent (a n) s → G s = F (globalBirthJointReadout (a n) s)) (s : GlobalBirthJointState R) (hs : GlobalBirthJointCoherent (a 0) s) : globalBirthJointRawHistory a steps cap n G s = globalBirthJointPhaseHistory a steps cap n F (globalBirthJointReadout (a 0) s) := by induction n generalizing G F with | zero => exact hGF s hs | succ n ih => change globalBirthJointRawHistory a steps cap n (globalBirthJointCutRawRow (steps n) (cap n) (cap (n + 1)) G) s = globalBirthJointPhaseHistory a steps cap n (globalBirthJointCutPhaseRow (steps n) (cap n) (cap (n + 1)) F) (globalBirthJointReadout (a 0) s) apply ih intro t ht exact global_birth_joint_cut_raw_row_intertwines (steps n) (cap n) (cap (n + 1)) G F hGF t ht end Joint end section open Finset variable {G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] {R : (g : G) → P g → Type*} def globalBirthFlattenPhase (z : (g : G) → (p : P g) → GhostPhaseState (R g p)) : (p : Σ g, P g) → GhostPhaseState (R p.1 p.2) := fun p => z p.1 p.2 theorem global_birth_flatten_pending_support (z : (g : G) → (p : P g) → GhostPhaseState (R g p)) : ghostPhasePendingSupport (globalBirthFlattenPhase z) = univ.sigma (fun g => ghostPhasePendingSupport (z g)) := by classical ext p change (p ∈ univ.filter (fun i : Σ g, P g => ∃ r, z i.1 i.2 = some (some (some r)))) ↔ p ∈ univ.sigma (fun g => univ.filter (fun q : P g => ∃ r, z g q = some (some (some r)))) simp only [mem_filter, mem_sigma, mem_univ, true_and] theorem global_birth_flatten_pending_card (z : (g : G) → (p : P g) → GhostPhaseState (R g p)) : (ghostPhasePendingSupport (globalBirthFlattenPhase z)).card = ∑ g, (ghostPhasePendingSupport (z g)).card := by rw [global_birth_flatten_pending_support, card_sigma] end section open Finset open scoped Classical section ResiduePath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations G J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) variable [∀ p : ↥(P g), NeZero p.val] end ResiduePath end section open Finset open scoped Classical theorem birth_ambient_cap_range {P : Type*} [Fintype P] [DecidableEq P] (retained cap : ℕ) (H : Finset P) (F : ∀ m, (Fin m → P) → ℂ) : (∑ m ∈ range (Fintype.card P + 1), ∑ f : Fin m → P, if Function.Injective f ∧ (∀ j, f j ∉ H) ∧ retained + m ≤ cap then F m f else 0) = ∑ m ∈ range (cap + 1), ∑ f : Fin m → P, if Function.Injective f ∧ (∀ j, f j ∉ H) ∧ retained + m ≤ cap then F m f else 0 := by have hp (m : ℕ) (hm : Fintype.card P < m) : (∑ f : Fin m → P, if Function.Injective f ∧ (∀ j, f j ∉ H) ∧ retained + m ≤ cap then F m f else 0) = 0 := by apply sum_eq_zero intro f _ apply if_neg intro hf have hc : m ≤ Fintype.card P := by simpa only [Fintype.card_fin] using Fintype.card_le_of_injective f hf.1 omega have hb (m : ℕ) (hm : cap < m) : (∑ f : Fin m → P, if Function.Injective f ∧ (∀ j, f j ∉ H) ∧ retained + m ≤ cap then F m f else 0) = 0 := by apply sum_eq_zero intro f _ apply if_neg intro hf have hc := hf.2.2 omega by_cases h : Fintype.card P ≤ cap · apply sum_subset (range_mono (Nat.add_le_add_right h 1)) intro m _ hm apply hp have := mt mem_range.mpr hm omega · symm apply sum_subset (range_mono (Nat.add_le_add_right (Nat.le_of_lt (Nat.lt_of_not_ge h)) 1)) intro m _ hm apply hb have := mt mem_range.mpr hm omega theorem birth_ambient_cap_range_nested {P : Type*} [Fintype P] [DecidableEq P] (retained cap : ℕ) (H : Finset P) (F G : ∀ m, (Fin m → P) → ℂ) : (∑ m ∈ range (Fintype.card P + 1), ∑ f : Fin m → P, if Function.Injective f ∧ (∀ j, f j ∉ H) then F m f * (if retained + m ≤ cap then G m f else 0) else 0) = ∑ m ∈ range (cap + 1), ∑ f : Fin m → P, if Function.Injective f ∧ (∀ j, f j ∉ H) ∧ retained + m ≤ cap then F m f * G m f else 0 := by rw [← birth_ambient_cap_range retained cap H (fun m f => F m f * G m f)] apply sum_congr rfl intro m _ apply sum_congr rfl intro f _ split_ifs <;> simp_all noncomputable def globalBirthGhostVisitCapRow {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (H : Finset P) (old : Fin N → Σ p, R p) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) : ℂ := ∑ T ∈ (globalBirthVisitZeroIndices h old).powerset, ∑ m ∈ range (cap + 1), ∑ f : Fin m → P, if Function.Injective f ∧ (∀ j, f j ∉ H) ∧ (univ \ T).card + m ≤ cap then ((((-η / ρ) ^ T.card * ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeroIndices h old \ T).card) * ((-η * V / ρ) ^ m * (∏ j, β (f j) / V)) / (m.factorial : ℝ) : ℝ) : ℂ) * G (H ∪ univ.image f) (retainedBirthTuple old (univ \ T) (fun j => ⟨f j, h (f j)⟩)) else 0 /- The literal ambient raw visit can use the bounded ghost operator's birth range once distinctness and the actual output-length cutoff are imposed. -/ theorem global_birth_ghost_visit_cap_range {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (H : Finset P) (old : Fin N → Σ p, R p) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) : globalBirthGhostVisitRawRow h β η V ρ cap H old G = globalBirthGhostVisitCapRow h β η V ρ cap H old G := by rw [global_birth_ghost_visit_eq_ambient_row] unfold globalBirthGhostVisitAmbientRow globalBirthGhostVisitCapRow apply sum_congr rfl intro T _ exact birth_ambient_cap_range_nested (univ \ T).card cap H _ _ end section open Finset Classical end section open Finset Classical abbrev CoupledGhostEvent {G : Type*} {P Z : G → Type*} (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) := ∀ g, BoundedGhostEvent (t g) B (s g) abbrev CoupledGhostPhase {G : Type*} (P Z : G → Type*) (t : G → ℕ) (B : ℕ) := ∀ s : ProductBoundedOrderedState P Z t B, CoupledGhostEvent t B s → ℂ noncomputable def coupledGhostOperator {G : Type*} [Fintype G] {P Z : G → Type*} [∀ g, Fintype (Z g)] (A D C ν : ∀ g, Z g → ℝ) (t : G → ℕ) (B : ℕ) (phase : CoupledGhostPhase P Z t B) (f : ProductBoundedOrderedState P Z t B → ℂ) := finiteProductEventAction (fun g => BoundedGhostEvent (t g) B) (fun g => boundedGhostEventWeight (A g) (D g) (C g) (ν g) (t g) B) (fun g => boundedGhostEventTarget (t g) B) phase f noncomputable def coupledGhostCutoffOperator {G : Type*} [Fintype G] {P Z : G → Type*} [∀ g, Fintype (Z g)] (A D C ν : ∀ g, Z g → ℝ) (t : G → ℕ) (B : ℕ) (phase : CoupledGhostPhase P Z t B) (f : ProductBoundedOrderedState P Z t B → ℂ) := productMemoryCutoff (coupledGhostOperator A D C ν t B phase (productMemoryCutoff f)) noncomputable def coupledGhostJointEventTarget {G : Type*} {P Z : G → Type*} (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (e : CoupledGhostEvent t B s) : ProductBoundedOrderedState P Z t B := fun g => boundedGhostEventTarget (t g) B (s g) (e g) noncomputable def coupledGhostJointEventWeight {G : Type*} [Fintype G] {P Z : G → Type*} (A D C ν : ∀ g, Z g → ℝ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (e : CoupledGhostEvent t B s) : ℝ := if productTotalMemory s ≤ B ∧ productTotalMemory (coupledGhostJointEventTarget t B s e) ≤ B then ∏ g, boundedGhostEventWeight (A g) (D g) (C g) (ν g) (t g) B (s g) (e g) else 0 theorem coupled_ghost_one_eq_coordinate_action {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] [∀ g, DecidableEq (Z g)] (A D C ν : ∀ g, Z g → ℝ) (t : G → ℕ) (B : ℕ) (f : ProductBoundedOrderedState P Z t B → ℂ) : coupledGhostOperator A D C ν t B (fun _ _ => 1) f = finiteCoordinateFinsetAction (fun g => boundedOrderedGhostOperator (A g) (D g) (C g) (ν g) (t g) B) univ f := by let E := fun g => @BoundedGhostEvent (P g) (Z g) (t g) B let w := fun g => @boundedGhostEventWeight (P g) (Z g) (A g) (D g) (C g) (ν g) (t g) B let target := fun g => @boundedGhostEventTarget (P g) (Z g) (t g) B have hlocal : finiteLocalEventAction E w target = fun g => boundedOrderedGhostOperator (A g) (D g) (C g) (ν g) (t g) B := by funext g q s have h := bounded_ordered_ghost_eq_event_sum (A g) (D g) (C g) (ν g) (t g) B q s refine Eq.trans ?_ h.symm apply sum_congr · ext e simp only [mem_univ] · intro e _ rfl have h := finite_product_event_eq_coordinate_action E w target f rw [hlocal] at h exact h theorem coupled_ghost_cutoff_one_eq_coordinate_action {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] [∀ g, DecidableEq (Z g)] (A D C ν : ∀ g, Z g → ℝ) (t : G → ℕ) (B : ℕ) (f : ProductBoundedOrderedState P Z t B → ℂ) : coupledGhostCutoffOperator A D C ν t B (fun _ _ => 1) f = productMemoryCutoff (finiteCoordinateFinsetAction (fun g => boundedOrderedGhostOperator (A g) (D g) (C g) (ν g) (t g) B) univ (productMemoryCutoff f)) := by unfold coupledGhostCutoffOperator rw [coupled_ghost_one_eq_coordinate_action] theorem coupled_ghost_norm_le_positive_re {G : Type*} [Fintype G] {P Z : G → Type*} [∀ g, Fintype (Z g)] (A D C ν : ∀ g, Z g → ℝ) (hA : ∀ g z, 0 ≤ A g z) (hν : ∀ g z, 0 ≤ ν g z) (t : G → ℕ) (B : ℕ) (phase : CoupledGhostPhase P Z t B) (hphase : ∀ s e, ‖phase s e‖ ≤ 1) (f : ProductBoundedOrderedState P Z t B → ℂ) (s : ProductBoundedOrderedState P Z t B) : ‖coupledGhostOperator A D C ν t B phase f s‖ ≤ (coupledGhostOperator A (fun g z => |D g z|) (fun g z => |C g z|) ν t B (fun _ _ => 1) (complexNormEnvelope f) s).re := by have h := finite_product_event_norm_le_abs_positive_re (fun g => @BoundedGhostEvent (P g) (Z g) (t g) B) (fun g => boundedGhostEventWeight (A g) (D g) (C g) (ν g) (t g) B) (fun g => boundedGhostEventTarget (t g) B) phase hphase f s have habs : (fun g x e => |boundedGhostEventWeight (A g) (D g) (C g) (ν g) (t g) B x e|) = fun g => @boundedGhostEventWeight (P g) (Z g) (A g) (fun z => |D g z|) (fun z => |C g z|) (ν g) (t g) B := by funext g x e exact boundedGhostEventWeight_abs (A g) (D g) (C g) (ν g) (hA g) (hν g) (t g) B x e rw [habs] at h exact h theorem coupled_ghost_cutoff_norm_le_positive_re {G : Type*} [Fintype G] {P Z : G → Type*} [∀ g, Fintype (Z g)] (A D C ν : ∀ g, Z g → ℝ) (hA : ∀ g z, 0 ≤ A g z) (hν : ∀ g z, 0 ≤ ν g z) (t : G → ℕ) (B : ℕ) (phase : CoupledGhostPhase P Z t B) (hphase : ∀ s e, ‖phase s e‖ ≤ 1) (f : ProductBoundedOrderedState P Z t B → ℂ) (s : ProductBoundedOrderedState P Z t B) : ‖coupledGhostCutoffOperator A D C ν t B phase f s‖ ≤ (coupledGhostCutoffOperator A (fun g z => |D g z|) (fun g z => |C g z|) ν t B (fun _ _ => 1) (complexNormEnvelope f) s).re := by have he : complexNormEnvelope (productMemoryCutoff f) = productMemoryCutoff (complexNormEnvelope f) := by funext x simp only [complexNormEnvelope, productMemoryCutoff] split_ifs · rfl · simp only [norm_zero, Complex.ofReal_zero] have h := coupled_ghost_norm_le_positive_re A D C ν hA hν t B phase hphase (productMemoryCutoff f) s rw [he] at h unfold coupledGhostCutoffOperator simp only [productMemoryCutoff] split_ifs · exact h · simp only [norm_zero, Complex.zero_re, le_refl] theorem coupled_ghost_cutoff_eq_joint_event_sum {G : Type*} [Fintype G] {P Z : G → Type*} [∀ g, Fintype (Z g)] (A D C ν : ∀ g, Z g → ℝ) (t : G → ℕ) (B : ℕ) (phase : CoupledGhostPhase P Z t B) (f : ProductBoundedOrderedState P Z t B → ℂ) (s : ProductBoundedOrderedState P Z t B) : coupledGhostCutoffOperator A D C ν t B phase f s = ∑ e : CoupledGhostEvent t B s, (coupledGhostJointEventWeight A D C ν t B s e : ℂ) * phase s e * f (coupledGhostJointEventTarget t B s e) := by unfold coupledGhostCutoffOperator coupledGhostOperator finiteProductEventAction productMemoryCutoff by_cases hs : productTotalMemory s ≤ B · rw [if_pos hs] apply sum_congr rfl intro e _ by_cases ht : productTotalMemory (coupledGhostJointEventTarget t B s e) ≤ B · simp [coupledGhostJointEventWeight, hs, ht, show productTotalMemory (fun g => boundedGhostEventTarget (t g) B (s g) (e g)) ≤ B from ht] exact Or.inl rfl · simp [coupledGhostJointEventWeight, hs, ht, show ¬productTotalMemory (fun g => boundedGhostEventTarget (t g) B (s g) (e g)) ≤ B from ht] · simp [hs, coupledGhostJointEventWeight] theorem coupledGhostJointEventWeight_abs {G : Type*} [Fintype G] {P Z : G → Type*} (A D C ν : ∀ g, Z g → ℝ) (hA : ∀ g z, 0 ≤ A g z) (hν : ∀ g z, 0 ≤ ν g z) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (e : CoupledGhostEvent t B s) : |coupledGhostJointEventWeight A D C ν t B s e| = coupledGhostJointEventWeight A (fun g z => |D g z|) (fun g z => |C g z|) ν t B s e := by unfold coupledGhostJointEventWeight split_ifs · rw [abs_prod] apply prod_congr rfl intro g _ exact boundedGhostEventWeight_abs (A g) (D g) (C g) (ν g) (hA g) (hν g) (t g) B (s g) (e g) · exact abs_zero end section open scoped BigOperators Classical theorem prime_tuple_cell_correlation_bound (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (q r : ℕ), 0 < q → 0 < r → ∀ (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r), χ.IsPrimitive → ψ.IsPrimitive → (⟨q, χ⟩ : (n : ℕ) × DirichletCharacter ℂ n) ≠ ⟨r, ψ⟩ → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → 0 < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ U W : ℝ, 0 ≤ U → 0 ≤ W → ‖∑ x : (∀ j, P j), (finiteProductWeight (physicalLabelLaw V) x : ℂ) * (if U < ((∏ j, (x j).val : ℕ) : ℝ) ∧ ((∏ j, (x j).val : ℕ) : ℝ) ≤ W then χ ((∏ j, (x j).val : ℕ) : ZMod q) * star (ψ ((∏ j, (x j).val : ℕ) : ZMod r)) else 0)‖ ≤ (C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (q * r : ℕ) / Real.log a) := by obtain ⟨C, hC, hbound⟩ := prime_tuple_cell_bound_of_zero_free hZ refine ⟨C, hC, ?_⟩ intro q r hq hr χ ψ hχ hψ hne I _ _ P V i hV hp hmass a b hPi ha hb U W hU hW have hn := primitive_product_level_mul_star_ne_one χ ψ hq hr hχ hψ hne have h := hbound (q * r) (Nat.mul_pos hq hr) (χ.changeLevel (Nat.dvd_mul_right q r) * star (ψ.changeLevel (Nat.dvd_mul_left r q))) hn P V i hV hp hmass a b hPi ha hb U W hU hW simpa only [product_level_mul_star_nat_apply] using h end section open scoped Classical /- A direct weighted bilinear estimate on the original tuple spaces. Neither test is required to be constant on product fibers. -/ theorem weighted_product_rational_bilinear_bound {X Y : Type*} [Fintype X] [Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (a N : ℕ) (A : ℤ) (V : ℕ) (hπrange : ∀ x, a ≤ π x ∧ π x < a + N) (hτrange : ∀ y, A ≤ (τ y : ℤ) ∧ (τ y : ℤ) ≤ A + (V : ℤ)) (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (f : X → ℂ) (g : Y → ℂ) {C D P Q : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hP : 0 < P) (hQ : 0 < Q) (hπ : ∀ x, P ≤ (π x : ℝ)) (hτ : ∀ y, Q ≤ (τ y : ℝ)) (hμatom : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => π x = m), μ x) ≤ C / (m : ℝ)) (hνatom : ∀ m : ℕ, (∑ y ∈ Finset.univ.filter (fun y => τ y = m), ν y) ≤ D / (m : ℝ)) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) : ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * (Complex.exp (Complex.I * (2 * Real.pi * (((u : ℝ) / r + β) * τ y) : ℝ))) ^ (π x)‖ ^ 2 ≤ ((1 + 3 * (V : ℝ) / r) * (2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r))) * ((C / P) * ∑ x, μ x * ‖f x‖ ^ 2) * ((D / Q) * ∑ y, ν y * ‖g y‖ ^ 2) := by let ρ : X → Fin N := fun x => ⟨π x - a, by obtain ⟨hlo, hhi⟩ := hπrange x; omega⟩ have hρ : ∀ x, a + (ρ x).val = π x := by intro x obtain ⟨hlo, hhi⟩ := hπrange x dsimp only [ρ] omega let I := ↥(Finset.univ.image τ) let σ : Y → I := fun y => ⟨τ y, Finset.mem_image.mpr ⟨y, Finset.mem_univ y, rfl⟩⟩ have hI : Function.Injective (fun i : I => i.val) := fun _ _ h => Subtype.ext h have hIr : ∀ i : I, A ≤ (i.val : ℤ) ∧ (i.val : ℤ) ≤ A + (V : ℤ) := by intro i obtain ⟨y, hy, he⟩ := Finset.mem_image.mp i.property simpa only [he] using hτrange y have hπ' : ∀ x, P ≤ (a + (ρ x).val : ℕ) := by intro x simpa only [hρ] using hπ x have hμ' : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => a + (ρ x).val = m), μ x) ≤ C / (m : ℝ) := by intro m simpa only [hρ] using hμatom m have hb := weighted_indexed_rational_bilinear_bound a N ρ σ (fun i : I => i.val) hI A V hIr μ ν hμ hν f g hC hD hP hQ hπ' hτ hμ' hνatom hr hcop hβ simpa only [hρ] using hb end section open Filter theorem exists_candidate_coefficient_window_mass_comparison {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) : ∃ Klo Khi : ℝ, 0 < Klo ∧ 0 < Khi ∧ ∃ J : ℕ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → Klo * (Real.exp L / L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar ≤ candidateCoefficientWindowMass c L q r jStar ∧ candidateCoefficientWindowMass c L q r jStar ≤ Khi * (Real.exp L / L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar := by obtain ⟨Klo, hlo, J, hlower⟩ := exists_candidate_coefficient_window_mass_lower hc hr hq0 hq1 hcenter obtain ⟨Khi, hhi, hupper⟩ := exists_candidate_coefficient_window_mass_upper hc hq0 hr refine ⟨Klo, Khi, hlo, hhi, J, ?_⟩ filter_upwards [hlower, hupper] with L hloL hhiL intro jStar hj exact ⟨hloL jStar hj, hhiL jStar (lt_of_le_of_lt (Nat.zero_le J) hj)⟩ end section open Finset open scoped Classical section Paths variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] (a : ℕ → P → Bool) (steps : ∀ i, GlobalBirthRawStep (R := R) (a i) (a (i + 1))) end Paths end section open Finset section Single variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] end Single section Joint variable {N : Nat} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, Fintype (R g p)] [∀ g p, DecidableEq (R g p)] noncomputable def globalBirthJointKernel {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (cap : Nat) (z w : GlobalBirthJointPhase R) : ℂ := if globalBirthJointPending z ≤ cap then ∏ g, globalBirthRawStepKernel (step g) (z g) (w g) else 0 theorem global_birth_joint_phase_row_eq {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (cap : Nat) (F : GlobalBirthJointPhase R → ℂ) (w : GlobalBirthJointPhase R) : globalBirthJointPhaseRow step cap F w = ∑ z, globalBirthJointKernel step cap z w * F z := by classical unfold globalBirthJointPhaseRow have hrow : (fun g => globalBirthRawStepPhaseRow (step g)) = (fun g G v => ∑ z, globalBirthRawStepKernel (step g) z v * G z) := by funext g G v exact global_birth_raw_step_phase_row_eq (step g) G v rw [hrow, fin_tensor_row_kernel] apply sum_congr rfl intro z _ unfold globalBirthJointPhaseCutoff globalBirthJointKernel split_ifs <;> simp noncomputable def globalBirthJointCutKernel {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (inputCap outputCap : Nat) (z w : GlobalBirthJointPhase R) : ℂ := if globalBirthJointPending w ≤ inputCap then globalBirthJointKernel step outputCap z w else 0 theorem global_birth_joint_cut_phase_row_eq {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (inputCap outputCap : Nat) (F : GlobalBirthJointPhase R → ℂ) (w : GlobalBirthJointPhase R) : globalBirthJointCutPhaseRow step inputCap outputCap F w = ∑ z, globalBirthJointCutKernel step inputCap outputCap z w * F z := by classical unfold globalBirthJointCutPhaseRow globalBirthJointPhaseCutoff globalBirthJointCutKernel split_ifs with hw · exact global_birth_joint_phase_row_eq step outputCap F w · simp only [zero_mul, sum_const_zero] end Joint end section open Finset open scoped Classical section Boundary variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} noncomputable def globalBirthJointInitial (a : (g : Fin N) → P g → Bool) : GlobalBirthJointState R := fun g => (ghostPhaseActivitySupport (a g), globalBirthEmptyMemory) theorem global_birth_joint_initial_coherent (a : (g : Fin N) → P g → Bool) : GlobalBirthJointCoherent a (globalBirthJointInitial (R := R) a) := fun g => global_birth_empty_memory_coherent (ghostPhaseActivitySupport (a g)) theorem global_birth_joint_initial_readout (a : (g : Fin N) → P g → Bool) : globalBirthJointReadout a (globalBirthJointInitial (R := R) a) = fun g p => if a g p then none else some none := by funext g exact global_birth_initial_phase (a g) theorem global_birth_joint_terminal_tensor (a : (g : Fin N) → P g → Bool) (s : GlobalBirthJointState R) (hs : GlobalBirthJointCoherent a s) : (∏ g, ∏ p, ghostPhaseTerminal (a g p) (globalBirthJointReadout a s g p)) = if ∀ g, (s g).2.1 = 0 then 1 else 0 := by have he (g : Fin N) : (∏ p, ghostPhaseTerminal (a g p) (globalBirthJointReadout a s g p)) = if (s g).2.1 = 0 then 1 else 0 := global_birth_coherent_terminal_tensor (a g) (s g).1 (s g).2 (hs g) simp_rw [he] by_cases h : ∀ g, (s g).2.1 = 0 · simp only [h, if_pos, prod_const_one, implies_true] · rw [if_neg h] obtain ⟨g, hg⟩ := not_forall.mp h exact prod_eq_zero (mem_univ g) (if_neg hg) variable [∀ g p, AddGroup (R g p)] [∀ g p, Fintype (R g p)] [∀ g p, DecidableEq (R g p)] /- The actual joint history with every total input/output cutoff agrees with the full terminal phase tensor, evaluated at the actual initial state. -/ theorem global_birth_joint_raw_history_empty_boundary (a : ℕ → (g : Fin N) → P g → Bool) (steps : (i : ℕ) → (g : Fin N) → GlobalBirthRawStep (R := R g) (a i g) (a (i + 1) g)) (cap : ℕ → ℕ) (n : ℕ) : globalBirthJointRawHistory a steps cap n (fun s => if ∀ g, (s g).2.1 = 0 then 1 else 0) (globalBirthJointInitial (a 0)) = globalBirthJointPhaseHistory a steps cap n (fun z => ((∏ g, ∏ p, ghostPhaseTerminal (a n g p) (z g p) : ℝ) : ℂ)) (fun g p => if a 0 g p then none else some none) := by have he := global_birth_joint_raw_history_intertwines a steps cap n (fun s => if ∀ g, (s g).2.1 = 0 then (1 : ℂ) else 0) (fun z => ((∏ g, ∏ p, ghostPhaseTerminal (a n g p) (z g p) : ℝ) : ℂ)) (by intro s hs rw [global_birth_joint_terminal_tensor (a n) s hs] split_ifs <;> rfl) (globalBirthJointInitial (a 0)) (global_birth_joint_initial_coherent (a 0)) rw [global_birth_joint_initial_readout] at he exact he end Boundary end section open Finset section PhysicalPath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (x : Fin (n + 1) → PhysicalState P J ell) (σ τ : Fin n → PhysicalPermutations G J ell) (hadm : ∀ j : Fin n, physicalAdmissible (C j) (aux j) (k j) (physicalPermutationEquiv (σ j) (x j.castSucc)) (physicalPermutationEquiv (τ j) (x j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ (((x j.castSucc).2.val g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) variable [∀ p : ↥(P g), NeZero p.val] end PhysicalPath end section open Finset Classical end section open Finset Classical noncomputable def physicalAbsoluteBoundedGhostOperator {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (q ρ V : ℝ) (t B : ℕ) := boundedOrderedGhostOperator (P := P) (physicalGhostRetention n q ρ) (fun z => |physicalGhostTermination n q ρ z|) (fun z => |physicalGhostBirth n q ρ V z|) (unrestrictedResidueWeight μ) t B theorem physical_bounded_ghost_absolute_energy_le_uniform {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (q ρ V v vmax : ℝ) (t B : ℕ) (hμ : ∀ p, 0 < μ p) (hmass : ∑ p, μ p ≤ 2) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hρ : 0 < ρ) (hV : 0 ≤ V) (hVmax : V ≤ vmax) (hv : 0 < v) (hD : q / ρ ^ 2 + ((1 - q) / ρ) / v ≤ 1) (hC : q / ρ ^ 2 + ((1 - q) * V / ρ) / v ≤ 1) (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) (hf : BoundedOrderedSymmetric f) : finiteWeightedEnergy (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ)) (physicalAbsoluteBoundedGhostOperator n μ q ρ V t B f) ≤ physicalGhostUniformEnergyBound ρ vmax v * finiteWeightedEnergy (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ)) f := by have hη : 0 ≤ 1 - q := sub_nonneg.mpr hq1 have hD0 : 0 ≤ (1 - q) / ρ := div_nonneg hη hρ.le have hC0 : 0 ≤ (1 - q) * V / ρ := div_nonneg (mul_nonneg hη hV) hρ.le have hA' (z : UnrestrictedResidueParticle n) : 0 ≤ physicalGhostRetention n q ρ z := by unfold physicalGhostRetention split_ifs · exact div_nonneg hq0 (sq_nonneg ρ) · exact zero_le_one have hD' (z : UnrestrictedResidueParticle n) : physicalGhostRetention n q ρ z + abs (abs (physicalGhostTermination n q ρ z)) / v ≤ 1 := by by_cases hz : unrestrictedResidueHit z · simpa [physicalGhostRetention, physicalGhostTermination, hz, abs_of_nonneg hD0] using hD · simp [physicalGhostRetention, physicalGhostTermination, hz] have hC' (z : UnrestrictedResidueParticle n) : physicalGhostRetention n q ρ z + abs (abs (physicalGhostBirth n q ρ V z)) / v ≤ 1 := by by_cases hz : unrestrictedResidueHit z · simpa [physicalGhostRetention, physicalGhostBirth, hz, abs_of_nonneg hC0] using hC · simp [physicalGhostRetention, physicalGhostBirth, hz] have h := bounded_ordered_ghost_energy_le μ (physicalGhostRetention n q ρ) (fun z => |physicalGhostTermination n q ρ z|) (fun z => |physicalGhostBirth n q ρ V z|) (unrestrictedResidueWeight μ) (fun _ => v) t B (fun p => (hμ p).le) hA' (fun z => hμ z.1) (fun _ => hv) hD' hC' f hf simp only [abs_abs] at h rw [physical_ghost_exponent_eq n μ q ρ V v hq1 hρ.le hV] at h have hη1 : 1 - q ≤ 1 := sub_le_self _ hq0 have hAV : (1 - q) * V ≤ vmax := by have hAV' : (1 - q) * V ≤ V := by simpa only [one_mul] using mul_le_mul_of_nonneg_right hη1 hV exact hAV'.trans hVmax have hcoeff : (1 - q) * V / ρ + (1 - q) / ρ ≤ (vmax + 1) / ρ := by rw [add_div] exact add_le_add (div_le_div_of_nonneg_right hAV hρ.le) (div_le_div_of_nonneg_right hη1 hρ.le) have he : ((1 - q) * V / ρ + (1 - q) / ρ) * v * (∑ p, μ p) ≤ 2 * (vmax + 1) * v / ρ := by calc _ ≤ ((1 - q) * V / ρ + (1 - q) / ρ) * v * 2 := mul_le_mul_of_nonneg_left hmass (mul_nonneg (add_nonneg hC0 hD0) hv.le) _ ≤ ((vmax + 1) / ρ) * v * 2 := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hcoeff hv.le) (by norm_num) _ = _ := by ring exact h.trans (mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr he) (sum_nonneg fun s _ => mul_nonneg (boundedOrderedStateWeight_nonneg μ (unrestrictedResidueWeight μ) (fun p => (hμ p).le) (fun z => (hμ z.1).le) s) (sq_nonneg _))) noncomputable def physicalAbsoluteGhostProductOperator {G : Type*} [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (μ : ∀ g, P g → ℝ) (q ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (groups : Finset G) := finiteCoordinateFinsetAction (fun g => physicalAbsoluteBoundedGhostOperator (n g) (μ g) q ρ (V g) (t g) B) groups noncomputable def physicalAbsoluteGhostCutoffProductOperator {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (μ : ∀ g, P g → ℝ) (q ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (groups : Finset G) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) := productMemoryCutoff (physicalAbsoluteGhostProductOperator n μ q ρ V t B groups (productMemoryCutoff f)) theorem physical_ghost_absolute_cutoff_product_energy_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (μ : ∀ g, P g → ℝ) (q ρ : ℝ) (V : G → ℝ) (v vmax : ℝ) (t : G → ℕ) (B : ℕ) (hμ : ∀ g p, 0 < μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hρ : 0 < ρ) (hV : ∀ g, 0 ≤ V g) (hVmax : ∀ g, V g ≤ vmax) (hv : 0 < v) (hD : q / ρ ^ 2 + ((1 - q) / ρ) / v ≤ 1) (hC : ∀ g, q / ρ ^ 2 + ((1 - q) * V g / ρ) / v ≤ 1) (groups : Finset G) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalAbsoluteGhostCutoffProductOperator n μ q ρ V t B groups f) ≤ physicalGhostUniformEnergyBound ρ vmax v ^ groups.card * finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by have hlocal (g : G) (h : BoundedOrderedState (P g) (UnrestrictedResidueParticle (n g)) (t g) B → ℂ) (hh : BoundedOrderedSymmetric h) := physical_bounded_ghost_absolute_energy_le_uniform (n g) (μ g) q ρ (V g) v vmax (t g) B (hμ g) (hmass g) hq0 hq1 hρ (hV g) (hVmax g) hv hD (hC g) h hh have h := product_symmetric_cutoff_sandwich_energy_le μ (fun g => unrestrictedResidueWeight (μ g)) (fun g p => (hμ g p).le) (fun g z => (hμ g z.1).le) (fun g => physicalAbsoluteBoundedGhostOperator (n g) (μ g) q ρ (V g) (t g) B) (fun _ => physicalGhostUniformEnergyBound ρ vmax v) (fun _ => (Real.exp_pos _).le) hlocal groups f hf simpa only [prod_const, physicalAbsoluteGhostCutoffProductOperator, physicalAbsoluteGhostProductOperator, finiteWeightedEnergy] using h end section open Finset Classical theorem coupled_ghost_cutoff_one_symmetric {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] [∀ g, DecidableEq (Z g)] (A D C ν : ∀ g, Z g → ℝ) (t : G → ℕ) (B : ℕ) (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (coupledGhostCutoffOperator A D C ν t B (fun _ _ => 1) f) := by rw [coupled_ghost_cutoff_one_eq_coordinate_action] apply product_memory_cutoff_sandwich_symmetric · intro g h hh exact bounded_ordered_ghost_symmetric (A g) (D g) (C g) (ν g) (t g) B h hh · exact hf end section noncomputable def upperLogCell (h z : ℝ) : ℤ := ⌈z / h⌉ theorem upper_log_cell_eq_iff {h : ℝ} (hh : 0 < h) (z : ℝ) (d : ℤ) : upperLogCell h z = d ↔ ((d : ℝ) - 1) * h < z ∧ z ≤ (d : ℝ) * h := by rw [upperLogCell, Int.ceil_eq_iff, lt_div_iff₀ hh, div_le_iff₀ hh] theorem upper_log_cell_nat_eq_iff {h : ℝ} (hh : 0 < h) {n : ℕ} (hn : 0 < n) (d : ℤ) : upperLogCell h (Real.log n) = d ↔ Real.exp (((d : ℝ) - 1) * h) < (n : ℝ) ∧ (n : ℝ) ≤ Real.exp ((d : ℝ) * h) := by have hnR : (0 : ℝ) < n := by exact_mod_cast hn rw [upper_log_cell_eq_iff hh, Real.lt_log_iff_exp_lt hnR, Real.log_le_iff_le_exp hnR] theorem upper_log_cell_distance_lt {h x y : ℝ} (hh : 0 < h) (heq : upperLogCell h x = upperLogCell h y) : |x - y| < h := by let d := upperLogCell h y have hx := (upper_log_cell_eq_iff hh x d).mp heq have hy := (upper_log_cell_eq_iff hh y d).mp rfl rw [abs_lt] constructor <;> nlinarith end section open Finset variable {N : Nat} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, Fintype (R g p)] [∀ g p, DecidableEq (R g p)] (a : Nat → (g : Fin N) → P g → Bool) (steps : (i : Nat) → (g : Fin N) → GlobalBirthRawStep (R := R g) (a i g) (a (i + 1) g)) (cap : Nat → Nat) noncomputable def globalBirthJointHistoryKernel (i : Nat) (z w : GlobalBirthJointPhase R) : ℂ := globalBirthJointCutKernel (steps i) (cap i) (cap (i + 1)) z w theorem global_birth_joint_history_phase_row_eq : (fun i => globalBirthJointCutPhaseRow (steps i) (cap i) (cap (i + 1))) = finiteKernelPullback (globalBirthJointHistoryKernel a steps cap) := by funext i F w exact global_birth_joint_cut_phase_row_eq (steps i) (cap i) (cap (i + 1)) F w theorem global_birth_joint_phase_history_trace_pairing (initial F : GlobalBirthJointPhase R → ℂ) (n : Nat) : (∑ w, initial w * globalBirthJointPhaseHistory a steps cap n F w) = ∑ x : Fin (n + 1) → GlobalBirthJointPhase R, F (x (Fin.last n)) * finiteChronologicalPrefix (globalBirthJointHistoryKernel a steps cap) initial n x := by unfold globalBirthJointPhaseHistory rw [global_birth_joint_history_phase_row_eq] exact finite_row_composition_trace_pairing _ initial F n end section open Finset open scoped Classical section Initial variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, Fintype (R g p)] [∀ g p, DecidableEq (R g p)] omit [∀ g p, Fintype (R g p)] in theorem ghost_phase_joint_initial_tensor_point_mass (a : (g : Fin N) → P g → Bool) (β : (g : Fin N) → P g → ℝ) (z : GlobalBirthJointPhase R) : (∏ g, ∏ p, ghostPhaseInitial (a g p) (β g p) (z g p)) = if z = (fun g => ghostPhaseInitialState (a g)) then ∏ g, ∏ p, if a g p then β g p else 1 else 0 := by simp_rw [ghost_phase_initial_tensor_point_mass] by_cases hz : z = (fun g => ghostPhaseInitialState (a g)) · subst z simp only [ite_true] · rw [if_neg hz] have hg : ∃ g, z g ≠ ghostPhaseInitialState (a g) := by by_contra h apply hz funext g exact not_not.mp (not_exists.mp h g) obtain ⟨g, hg⟩ := hg exact prod_eq_zero (mem_univ g) (if_neg hg) theorem ghost_phase_joint_initial_tensor_sum (a : (g : Fin N) → P g → Bool) (β : (g : Fin N) → P g → ℝ) (F : GlobalBirthJointPhase R → ℂ) : (∑ z, ((∏ g, ∏ p, ghostPhaseInitial (a g p) (β g p) (z g p) : ℝ) : ℂ) * F z) = ((∏ g, ∏ p, if a g p then β g p else 1 : ℝ) : ℂ) * F (fun g => ghostPhaseInitialState (a g)) := by simp_rw [ghost_phase_joint_initial_tensor_point_mass] simp only [apply_ite, Complex.ofReal_zero, ite_mul, zero_mul, sum_ite_eq', mem_univ, if_true] variable [∀ g p, AddGroup (R g p)] theorem global_birth_joint_initial_terminal_pairing (a : ℕ → (g : Fin N) → P g → Bool) (steps : (i : ℕ) → (g : Fin N) → GlobalBirthRawStep (R := R g) (a i g) (a (i + 1) g)) (cap : ℕ → ℕ) (β : (g : Fin N) → P g → ℝ) (n : ℕ) : (∑ w, ((∏ g, ∏ p, ghostPhaseInitial (a 0 g p) (β g p) (w g p) : ℝ) : ℂ) * globalBirthJointPhaseHistory a steps cap n (fun z => ((∏ g, ∏ p, ghostPhaseTerminal (a n g p) (z g p) : ℝ) : ℂ)) w) = ((∏ g, ∏ p, if a 0 g p then β g p else 1 : ℝ) : ℂ) * globalBirthJointRawHistory a steps cap n (fun s => if ∀ g, (s g).2.1 = 0 then 1 else 0) (globalBirthJointInitial (a 0)) := by rw [ghost_phase_joint_initial_tensor_sum, global_birth_joint_raw_history_empty_boundary] rfl end Initial end section open Finset open scoped Classical section Events variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {a b : P → Bool} end Events section Paths variable {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] (a : ℕ → P → Bool) (steps : ∀ i, GlobalBirthRawStep (R := R) (a i) (a (i + 1))) end Paths end section open Finset Classical end section open scoped BigOperators Classical theorem prime_tuple_log_cell_correlation_bound (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (q r : ℕ), 0 < q → 0 < r → ∀ (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r), χ.IsPrimitive → ψ.IsPrimitive → (⟨q, χ⟩ : (n : ℕ) × DirichletCharacter ℂ n) ≠ ⟨r, ψ⟩ → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → 0 < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h : ℝ, 0 < h → ∀ d : ℤ, ‖∑ x : (∀ j, P j), if upperLogCell h (Real.log (∏ j, (x j).val : ℕ)) = d then (finiteProductWeight (physicalLabelLaw V) x : ℂ) * χ ((∏ j, (x j).val : ℕ) : ZMod q) * star (ψ ((∏ j, (x j).val : ℕ) : ZMod r)) else 0‖ ≤ (C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (q * r : ℕ) / Real.log a) := by obtain ⟨C, hC, hbound⟩ := prime_tuple_cell_correlation_bound hZ refine ⟨C, hC, ?_⟩ intro q r hq hr χ ψ hχ hψ hne I _ _ P V i hV hp hmass a b hPi ha hb h hh d let U := Real.exp (((d : ℝ) - 1) * h) let W := Real.exp ((d : ℝ) * h) have hbnd := hbound q r hq hr χ ψ hχ hψ hne P V i hV hp hmass a b hPi ha hb U W (Real.exp_pos _).le (Real.exp_pos _).le have heq (x : ∀ j, P j) : (if upperLogCell h (Real.log (∏ j, (x j).val : ℕ)) = d then (finiteProductWeight (physicalLabelLaw V) x : ℂ) * χ ((∏ j, (x j).val : ℕ) : ZMod q) * star (ψ ((∏ j, (x j).val : ℕ) : ZMod r)) else 0) = (finiteProductWeight (physicalLabelLaw V) x : ℂ) * (if U < ((∏ j, (x j).val : ℕ) : ℝ) ∧ ((∏ j, (x j).val : ℕ) : ℝ) ≤ W then χ ((∏ j, (x j).val : ℕ) : ZMod q) * star (ψ ((∏ j, (x j).val : ℕ) : ZMod r)) else 0) := by have hn : 0 < ∏ j, (x j).val := Finset.prod_pos (fun j _ => hp j _ (x j).property) simp only [upper_log_cell_nat_eq_iff hh hn] change (if U < _ ∧ _ ≤ W then _ else _) = _ split_ifs <;> simp only [mul_assoc, mul_zero] rw [Finset.sum_congr rfl (fun x _ => heq x)] exact hbnd end section open Finset open scoped Classical theorem global_birth_joint_weighted_empty_history_product {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, Fintype (R g p)] [∀ g p, DecidableEq (R g p)] (a : ℕ → (g : Fin N) → P g → Bool) (steps : (i : ℕ) → (g : Fin N) → GlobalBirthRawStep (R := R g) (a i g) (a (i + 1) g)) (cap : ℕ → ℕ) (β : (g : Fin N) → P g → ℝ) (n : ℕ) : ((∏ g, ∏ p, if a 0 g p then β g p else 1 : ℝ) : ℂ) * globalBirthJointRawHistory a steps cap n (fun s => if ∀ g, (s g).2.1 = 0 then 1 else 0) (globalBirthJointInitial (a 0)) = ∑ x : Fin (n + 1) → GlobalBirthJointPhase R, ((∏ g, ∏ p, ghostPhaseTerminal (a n g p) (x (Fin.last n) g p) : ℝ) : ℂ) * (((∏ g, ∏ p, ghostPhaseInitial (a 0 g p) (β g p) (x 0 g p) : ℝ) : ℂ) * ∏ j : Fin n, globalBirthJointHistoryKernel a steps cap j.val (x j.succ) (x j.castSucc)) := by rw [← global_birth_joint_initial_terminal_pairing a steps cap β n] exact global_birth_joint_phase_history_trace_pairing a steps cap _ _ n end section open Finset section Initial variable {N : Nat} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} omit [∀ g, DecidableEq (P g)] in theorem global_birth_joint_initial_pending_zero (a : (g : Fin N) → P g → Bool) : globalBirthJointPending (R := R) (fun g => ghostPhaseInitialState (a g)) = 0 := by classical apply sum_eq_zero intro g _ have he : ghostPhasePendingSupport (R := R g) (ghostPhaseInitialState (a g)) = ∅ := by ext p change (p ∈ univ.filter (fun q => ∃ r, ghostPhaseInitialState (R := R g) (a g) q = some (some (some r)))) ↔ p ∈ (∅ : Finset (P g)) simp only [mem_filter, mem_univ, true_and, Finset.notMem_empty] unfold ghostPhaseInitialState split_ifs <;> simp rw [he, card_empty] variable [∀ g p, DecidableEq (R g p)] theorem ghost_phase_joint_initial_zero_of_pending (a : (g : Fin N) → P g → Bool) (β : (g : Fin N) → P g → ℝ) (cap : Nat) (z : GlobalBirthJointPhase R) (hz : ¬ globalBirthJointPending z ≤ cap) : ((∏ g, ∏ p, ghostPhaseInitial (a g p) (β g p) (z g p) : ℝ) : ℂ) = 0 := by classical rw [ghost_phase_joint_initial_tensor_point_mass] have hne : z ≠ (fun g => ghostPhaseInitialState (a g)) := by intro he apply hz rw [he, global_birth_joint_initial_pending_zero] exact Nat.zero_le cap rw [if_neg hne, Complex.ofReal_zero] end Initial section History variable {N : Nat} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, Fintype (R g p)] [∀ g p, DecidableEq (R g p)] (a : Nat → (g : Fin N) → P g → Bool) (steps : (i : Nat) → (g : Fin N) → GlobalBirthRawStep (R := R g) (a i g) (a (i + 1) g)) (cap : Nat → Nat) theorem global_birth_joint_prefix_output_only (initial : GlobalBirthJointPhase R → ℂ) (hinit : ∀ z, ¬ globalBirthJointPending z ≤ cap 0 → initial z = 0) (n : Nat) (x : Fin (n + 1) → GlobalBirthJointPhase R) : finiteChronologicalPrefix (globalBirthJointHistoryKernel a steps cap) initial n x = finiteChronologicalPrefix (fun i => globalBirthJointKernel (steps i) (cap (i + 1))) initial n x := by have he : globalBirthJointHistoryKernel a steps cap = finiteInputMaskedKernel (fun i z => globalBirthJointPending z ≤ cap i) (fun i => globalBirthJointKernel (steps i) (cap (i + 1))) := by funext i z w unfold globalBirthJointHistoryKernel globalBirthJointCutKernel finiteInputMaskedKernel split_ifs <;> rfl rw [he] apply finite_chronological_input_masks_collapse (fun i z => globalBirthJointPending z ≤ cap i) (fun i => globalBirthJointKernel (steps i) (cap (i + 1))) initial · intro i z w hz exact if_neg hz · exact hinit theorem global_birth_joint_initial_prefix_output_only (β : (g : Fin N) → P g → ℝ) (n : Nat) (x : Fin (n + 1) → GlobalBirthJointPhase R) : finiteChronologicalPrefix (globalBirthJointHistoryKernel a steps cap) (fun z => ((∏ g, ∏ p, ghostPhaseInitial (a 0 g p) (β g p) (z g p) : ℝ) : ℂ)) n x = finiteChronologicalPrefix (fun i => globalBirthJointKernel (steps i) (cap (i + 1))) (fun z => ((∏ g, ∏ p, ghostPhaseInitial (a 0 g p) (β g p) (z g p) : ℝ) : ℂ)) n x := global_birth_joint_prefix_output_only a steps cap _ (ghost_phase_joint_initial_zero_of_pending (a 0) β (cap 0)) n x /- Full weighted traces retain precisely the output projector at each cut. The initial tensor may already use beta/V independently of all step data. -/ theorem global_birth_joint_initial_trace_output_only (β : (g : Fin N) → P g → ℝ) (F : GlobalBirthJointPhase R → ℂ) (n : Nat) : (∑ x : Fin (n + 1) → GlobalBirthJointPhase R, F (x (Fin.last n)) * finiteChronologicalPrefix (globalBirthJointHistoryKernel a steps cap) (fun z => ((∏ g, ∏ p, ghostPhaseInitial (a 0 g p) (β g p) (z g p) : ℝ) : ℂ)) n x) = ∑ x : Fin (n + 1) → GlobalBirthJointPhase R, F (x (Fin.last n)) * finiteChronologicalPrefix (fun i => globalBirthJointKernel (steps i) (cap (i + 1))) (fun z => ((∏ g, ∏ p, ghostPhaseInitial (a 0 g p) (β g p) (z g p) : ℝ) : ℂ)) n x := by apply sum_congr rfl intro x _ rw [global_birth_joint_initial_prefix_output_only a steps cap β n x] end History end section open Finset Classical section variable {J K G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : K → G → ℤ) (t : G → ℕ) (B : ℕ) def MixedMemoryEvent : (J ⊕ K) → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → Type _ | .inl _, s => CoupledGhostEvent t B s | .inr k, s => UnrestrictedJointEvent n (Δ k) (D k) t B s noncomputable abbrev mixedMemoryEventFintype [Fintype G] [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] (k : J ⊕ K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : Fintype (MixedMemoryEvent n Δ D t B k s) := by cases k <;> dsimp [MixedMemoryEvent] <;> infer_instance noncomputable def mixedMemoryEventTarget (k : J ⊕ K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : MixedMemoryEvent n Δ D t B k s → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B := match k with | .inl _ => coupledGhostJointEventTarget t B s | .inr k => unrestrictedJointEventTarget n (Δ k) (D k) t B s end end section open scoped BigOperators Classical theorem prime_tuple_character_norm_one {I : Type*} [Fintype I] (P : I → Finset ℕ) {q : ℕ} (χ : DirichletCharacter ℂ q) (hcop : ∀ i p, p ∈ P i → p.Coprime q) (x : ∀ i, P i) : ‖χ ((∏ i, (x i).val : ℕ) : ZMod q)‖ = 1 := by have hc : (∏ i, (x i).val : ℕ).Coprime q := Nat.coprime_prod_left_iff.mpr (fun i _ => hcop i _ (x i).property) obtain ⟨u, hu⟩ := (ZMod.isUnit_iff_coprime _ _).mpr hc rw [← hu] exact χ.unit_norm_eq_one u theorem prime_tuple_log_cell_kernel_energy (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ {T : Type*} [Fintype T] (q : T → ℕ) (χ : (t : T) → DirichletCharacter ℂ (q t)), (∀ t, 0 < q t) → (∀ t, (χ t).IsPrimitive) → Function.Injective (fun t => (⟨q t, χ t⟩ : (n : ℕ) × DirichletCharacter ℂ n)) → ∀ Q : ℕ, 0 < Q → (∀ t, q t ≤ Q) → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → 0 < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → (∀ t j p, p ∈ P j → p.Coprime (q t)) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h ξ : ℝ, 0 < h → 0 < ξ → ∀ kept : Finset ℤ, (∀ d ∈ kept, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) → (Fintype.card T - 1 : ℕ) * (((C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 → ∀ f : (∀ j, P j) → ℂ, (∑ x, finiteProductWeight (physicalLabelLaw (P := P) V) x * ‖∑ y, (finiteProductWeight (physicalLabelLaw (P := P) V) y : ℂ) * finiteCellFrameKernel (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell h (Real.log (∏ j, (z j).val : ℕ))) kept (fun t z => star (χ t ((∏ j, (z j).val : ℕ) : ZMod (q t)))) x y * f y‖ ^ 2) ≤ 4 * ∑ x, finiteProductWeight (physicalLabelLaw (P := P) V) x * ‖f x‖ ^ 2 := by obtain ⟨C, hC, hbnd⟩ := prime_tuple_log_cell_correlation_bound hZ refine ⟨C, hC, ?_⟩ intro T _ q χ hq hχ hinj Q hQ hqQ I _ _ P V i hV hp hmass hcop a b hPi ha hb h ξ hh hξ kept hkept hsmall f have hVi := hV i have ha0 : 0 < a := by linarith have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hQ1 : (1 : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Nat.mul_ne_zero (Nat.ne_of_gt hQ) (Nat.ne_of_gt hQ)) have hδ : 0 ≤ (C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a) := by have := Real.log_nonneg hQ1 positivity refine finite_cell_kernel_energy_of_raw_gram (finiteProductWeight (physicalLabelLaw (P := P) V)) ?_ (fun z => upperLogCell h (Real.log (∏ j, (z j).val : ℕ))) kept hδ hξ hkept (fun t z => star (χ t ((∏ j, (z j).val : ℕ) : ZMod (q t)))) ?_ hsmall ?_ f · intro x exact Finset.prod_nonneg (fun j _ => physical_label_law_nonneg V (fun k => (hV k).le) j (x j)) · intro t x _ rw [norm_star] exact prime_tuple_character_norm_one P (χ t) (hcop t) x · intro d hd t s hts have hraw := hbnd (q t) (q s) (hq t) (hq s) (χ t) (χ s) (hχ t) (hχ s) (fun he => hts (hinj he)) P V i hV hp hmass a b hPi ha hb h hh d have hqprod : (0 : ℝ) < (q t * q s : ℕ) := by exact_mod_cast Nat.mul_pos (hq t) (hq s) have hprod : (q t * q s : ℕ) ≤ Q * Q := Nat.mul_le_mul (hqQ t) (hqQ s) have hlogs : Real.log (q t * q s : ℕ) ≤ Real.log (Q * Q : ℕ) := Real.log_le_log hqprod (by exact_mod_cast hprod) have hmono : (C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (q t * q s : ℕ) / Real.log a) ≤ (C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a) := mul_le_mul_of_nonneg_left (add_le_add le_rfl (div_le_div_of_nonneg_right hlogs hlog.le)) (by positivity) simpa only [starRingEnd_apply, star_star] using hraw.trans hmono end section open Finset open scoped Classical section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V ρ : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) (cap : ℕ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] end ResiduePath end section open Finset Classical section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : K → G → ℤ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) end end section open scoped BigOperators Classical abbrev BoundedPrimitiveCharacter (Q : ℕ) := {t : (n : Fin Q) × DirichletCharacter ℂ (n.val + 1) // t.2.IsPrimitive} noncomputable def boundedPrimitiveModulus {Q : ℕ} (t : BoundedPrimitiveCharacter Q) : ℕ := t.val.1.val + 1 noncomputable def boundedPrimitiveValue {Q : ℕ} (t : BoundedPrimitiveCharacter Q) : DirichletCharacter ℂ (boundedPrimitiveModulus t) := t.val.2 theorem bounded_primitive_modulus_pos {Q : ℕ} (t : BoundedPrimitiveCharacter Q) : 0 < boundedPrimitiveModulus t := Nat.zero_lt_succ _ theorem bounded_primitive_modulus_le {Q : ℕ} (t : BoundedPrimitiveCharacter Q) : boundedPrimitiveModulus t ≤ Q := t.val.1.isLt theorem bounded_primitive_value_primitive {Q : ℕ} (t : BoundedPrimitiveCharacter Q) : (boundedPrimitiveValue t).IsPrimitive := t.property theorem bounded_primitive_character_card_le (Q : ℕ) : Fintype.card (BoundedPrimitiveCharacter Q) ≤ Q * Q := by calc _ ≤ Fintype.card ((n : Fin Q) × DirichletCharacter ℂ (n.val + 1)) := Fintype.card_subtype_le _ _ = ∑ n : Fin Q, Fintype.card (DirichletCharacter ℂ (n.val + 1)) := Fintype.card_sigma _ ≤ ∑ _n : Fin Q, Q := by apply Finset.sum_le_sum intro n _ rw [← Nat.card_eq_fintype_card, DirichletCharacter.card_eq_totient_of_hasEnoughRootsOfUnity] exact (Nat.totient_le _).trans n.isLt _ = Q * Q := by simp theorem bounded_primitive_character_injective (Q : ℕ) : Function.Injective (fun t : BoundedPrimitiveCharacter Q => (⟨boundedPrimitiveModulus t, boundedPrimitiveValue t⟩ : (n : ℕ) × DirichletCharacter ℂ n)) := by rintro ⟨⟨i, χ⟩, hi⟩ ⟨⟨j, ψ⟩, hj⟩ he have hn : i.val + 1 = j.val + 1 := congrArg Sigma.fst he have hij : i = j := Fin.ext (Nat.add_right_cancel hn) subst j have hc : χ = ψ := eq_of_heq (Sigma.mk.inj he).2 subst ψ rfl end section open Finset theorem block_sieve_local_bounds {ι : Type*} (s : Finset ι) (w : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i ∧ w i ≤ 1) {h : ℕ} (hh : Even h) : 0 ≤ exclusionTruncation s w (h + 1) ∧ (∏ i ∈ s, (1 - w i)) ≤ exclusionTruncation s w (h + 1) ∧ exclusionTruncation s w (h + 1) - (∏ i ∈ s, (1 - w i)) ≤ exclusionElementary s w (h + 1) := by have hb := exclusion_bonferroni s w hw (h + 1) rw [pow_succ, hh.neg_one_pow, one_mul] at hb have hprod : 0 ≤ ∏ i ∈ s, (1 - w i) := prod_nonneg (fun i hi => sub_nonneg.mpr (hw i hi).2) constructor · linarith [hb.1] constructor <;> linarith [hb.1, hb.2] theorem block_sieve_log_factor_lower {η u : ℝ} (hη : 0 < η) (hu0 : 0 ≤ u) (hu1 : u ≤ 1 - η) : -u / η ≤ Real.log (1 - u) := by have hden : 0 < 1 - u := by linarith have hηden : η ≤ 1 - u := by linarith have hdiv : u / (1 - u) ≤ u / η := div_le_div_of_nonneg_left hu0 hη hηden have hlog := Real.one_sub_inv_le_log_of_pos hden have he : 1 - (1 - u)⁻¹ = -u / (1 - u) := by field_simp; ring rw [he] at hlog have hneg : -u / η ≤ -u / (1 - u) := by simpa only [neg_div] using neg_le_neg hdiv exact hneg.trans hlog theorem block_sieve_avoidance_lower {ι : Type*} (s : Finset ι) (w : ι → ℝ) {η C : ℝ} (hη : 0 < η) (hw : ∀ i ∈ s, 0 ≤ w i ∧ w i ≤ 1 - η) (hsum : (∑ i ∈ s, w i) ≤ C) : Real.exp (-C / η) ≤ ∏ i ∈ s, (1 - w i) := by have hf : ∀ i ∈ s, Real.exp (-w i / η) ≤ 1 - w i := by intro i hi have hpos : 0 < 1 - w i := by linarith [(hw i hi).2] exact (Real.exp_le_exp.mpr (block_sieve_log_factor_lower hη (hw i hi).1 (hw i hi).2)).trans_eq (Real.exp_log hpos) calc _ ≤ Real.exp (-(∑ i ∈ s, w i) / η) := Real.exp_le_exp.mpr (div_le_div_of_nonneg_right (neg_le_neg hsum) hη.le) _ = ∏ i ∈ s, Real.exp (-w i / η) := by rw [← Real.exp_sum] congr 1 rw [← sum_neg_distrib, sum_div] _ ≤ _ := prod_le_prod₀ (fun _ _ => (Real.exp_pos _).le) hf theorem block_sieve_relative_error_bound {ι : Type*} (s : Finset ι) (w : ι → ℝ) {η C : ℝ} (hη : 0 < η) (hC : 0 ≤ C) (hw : ∀ i ∈ s, 0 ≤ w i ∧ w i ≤ 1 - η) (hsum : (∑ i ∈ s, w i) ≤ C) (h : ℕ) : exclusionElementary s w (h + 1) / (∏ i ∈ s, (1 - w i)) ≤ Real.exp (C / η) * (C^(h + 1) / ((h + 1).factorial : ℝ)) := by have ha := block_sieve_avoidance_lower s w hη hw hsum have ha0 : 0 < ∏ i ∈ s, (1 - w i) := (Real.exp_pos _).trans_le ha have hE : exclusionElementary s w (h + 1) ≤ C^(h + 1) / ((h + 1).factorial : ℝ) := by apply (exclusion_elementary_le_pow_div_factorial s w (fun i hi => (hw i hi).1) (h + 1)).trans exact div_le_div_of_nonneg_right (pow_le_pow_left₀ (sum_nonneg (fun i hi => (hw i hi).1)) hsum _) (Nat.cast_nonneg _) calc _ ≤ (C^(h + 1) / ((h + 1).factorial : ℝ)) / (∏ i ∈ s, (1 - w i)) := div_le_div_of_nonneg_right hE ha0.le _ ≤ (C^(h + 1) / ((h + 1).factorial : ℝ)) / Real.exp (-C / η) := div_le_div_of_nonneg_left (by positivity) (Real.exp_pos _) ha _ = _ := by rw [neg_div, Real.exp_neg, div_inv_eq_mul]; ring end section open Finset theorem block_product_correction_insert {G : Type*} [DecidableEq G] (s : Finset G) (U E : G → ℝ) {a : G} (ha : a ∉ s) : (∑ g ∈ insert a s, E g * ∏ k ∈ (insert a s).erase g, U k) = E a * (∏ k ∈ s, U k) + U a * (∑ g ∈ s, E g * ∏ k ∈ s.erase g, U k) := by rw [sum_insert ha, erase_insert ha, mul_sum] congr 1 apply sum_congr rfl intro g hg have hag : a ≠ g := by intro h exact ha (h ▸ hg) rw [erase_insert_of_ne hag, prod_insert (not_mem_subset (erase_subset _ _) ha)] ring section variable {G : Type*} [sharedInstance1 : DecidableEq G] (s : Finset G) (I U E : G → ℝ) (hI : ∀ g ∈ s, 0 ≤ I g) (hIU : ∀ g ∈ s, I g ≤ U g) (hE : ∀ g ∈ s, U g - I g ≤ E g) include G sharedInstance1 s I U E hI hIU hE theorem block_product_difference_bound : 0 ≤ (∏ g ∈ s, U g) - (∏ g ∈ s, I g) ∧ (∏ g ∈ s, U g) - (∏ g ∈ s, I g) ≤ ∑ g ∈ s, E g * ∏ k ∈ s.erase g, U k := by refine ⟨sub_nonneg.mpr (prod_le_prod₀ hI hIU), ?_⟩ induction s using Finset.induction_on with | empty => simp | @insert a s ha ih => have hIa : 0 ≤ I a := hI a (mem_insert_self _ _) have hIUa : I a ≤ U a := hIU a (mem_insert_self _ _) have hEa : U a - I a ≤ E a := hE a (mem_insert_self _ _) have hIs : ∀ g ∈ s, 0 ≤ I g := fun g hg => hI g (mem_insert_of_mem hg) have hIUs : ∀ g ∈ s, I g ≤ U g := fun g hg => hIU g (mem_insert_of_mem hg) have hEs : ∀ g ∈ s, U g - I g ≤ E g := fun g hg => hE g (mem_insert_of_mem hg) have hUs : 0 ≤ ∏ g ∈ s, U g := prod_nonneg (fun g hg => (hIs g hg).trans (hIUs g hg)) have hCs : 0 ≤ ∑ g ∈ s, E g * ∏ k ∈ s.erase g, U k := by apply sum_nonneg intro g hg apply mul_nonneg · exact (sub_nonneg.mpr (hIUs g hg)).trans (hEs g hg) · exact prod_nonneg (fun k hk => (hIs k (mem_of_mem_erase hk)).trans (hIUs k (mem_of_mem_erase hk))) have h1 := mul_le_mul_of_nonneg_right hEa hUs have h2 := mul_le_mul_of_nonneg_left (ih hIs hIUs hEs) hIa have h3 := mul_le_mul_of_nonneg_right hIUa hCs rw [prod_insert ha, prod_insert ha, block_product_correction_insert s U E ha] nlinarith theorem block_product_sandwich : (∏ g ∈ s, U g) - (∑ g ∈ s, E g * ∏ k ∈ s.erase g, U k) ≤ (∏ g ∈ s, I g) ∧ (∏ g ∈ s, I g) ≤ (∏ g ∈ s, U g) := by have h := block_product_difference_bound s I U E hI hIU hE constructor <;> linarith [h.1, h.2] end end section open Finset def blockSieveUpperSupport {G : Type*} (J : Finset G) (h n : G → ℕ) : Prop := ∀ g ∈ J, n g ≤ h g def blockSieveCorrectionSupport {G : Type*} (J : Finset G) (h n : G → ℕ) (j : G) : Prop := j ∈ J ∧ n j = h j + 1 ∧ ∀ g ∈ J, g ≠ j → n g ≤ h g theorem block_sieve_upper_correction_disjoint {G : Type*} {J : Finset G} {h n : G → ℕ} {j : G} (hu : blockSieveUpperSupport J h n) (hj : blockSieveCorrectionSupport J h n j) : False := by have := hu j hj.1 have := hj.2.1 omega theorem block_sieve_correction_support_unique {G : Type*} {J : Finset G} {h n : G → ℕ} {j k : G} (hj : blockSieveCorrectionSupport J h n j) (hk : blockSieveCorrectionSupport J h n k) : j = k := by by_contra hne have := hk.2.2 j hj.1 hne have := hj.2.1 omega noncomputable def blockSieveUpperCoefficient {G : Type*} (J : Finset G) (h n : G → ℕ) : ℝ := by classical exact if blockSieveUpperSupport J h n then (-1 : ℝ)^(∑ g ∈ J, n g) else 0 noncomputable def blockSieveCorrectionAt {G : Type*} (J : Finset G) (h n : G → ℕ) (j : G) : ℝ := by classical exact if blockSieveCorrectionSupport J h n j then (-1 : ℝ)^(∑ g ∈ J.erase j, n g) else 0 noncomputable def blockSieveCorrectionCoefficient {G : Type*} (J : Finset G) (h n : G → ℕ) : ℝ := ∑ j ∈ J, blockSieveCorrectionAt J h n j noncomputable def blockSieveLowerCoefficient {G : Type*} (J : Finset G) (h n : G → ℕ) : ℝ := blockSieveUpperCoefficient J h n - blockSieveCorrectionCoefficient J h n theorem block_sieve_upper_coefficient_ne_zero_iff {G : Type*} (J : Finset G) (h n : G → ℕ) : blockSieveUpperCoefficient J h n ≠ 0 ↔ blockSieveUpperSupport J h n := by classical by_cases hs : blockSieveUpperSupport J h n <;> simp [blockSieveUpperCoefficient, hs] theorem block_sieve_correction_at_ne_zero_iff {G : Type*} (J : Finset G) (h n : G → ℕ) (j : G) : blockSieveCorrectionAt J h n j ≠ 0 ↔ blockSieveCorrectionSupport J h n j := by classical by_cases hs : blockSieveCorrectionSupport J h n j <;> simp [blockSieveCorrectionAt, hs] theorem block_sieve_correction_coefficient_eq_at {G : Type*} {J : Finset G} {h n : G → ℕ} {j : G} (hj : blockSieveCorrectionSupport J h n j) : blockSieveCorrectionCoefficient J h n = blockSieveCorrectionAt J h n j := by classical apply sum_eq_single j · intro k _ hkj apply not_ne_iff.mp intro hk exact hkj (block_sieve_correction_support_unique ((block_sieve_correction_at_ne_zero_iff J h n k).mp hk) hj) · exact fun hnot => (hnot hj.1).elim theorem block_sieve_correction_coefficient_eq_zero {G : Type*} {J : Finset G} {h n : G → ℕ} (hn : ¬ ∃ j, blockSieveCorrectionSupport J h n j) : blockSieveCorrectionCoefficient J h n = 0 := by classical apply sum_eq_zero intro j _ exact not_ne_iff.mp (fun hj => hn ⟨j, (block_sieve_correction_at_ne_zero_iff J h n j).mp hj⟩) theorem block_sieve_correction_coefficient_ne_zero_iff {G : Type*} (J : Finset G) (h n : G → ℕ) : blockSieveCorrectionCoefficient J h n ≠ 0 ↔ ∃! j, blockSieveCorrectionSupport J h n j := by classical constructor · intro hc have hex : ∃ j, blockSieveCorrectionSupport J h n j := by by_contra hn exact hc (block_sieve_correction_coefficient_eq_zero hn) obtain ⟨j, hj⟩ := hex exact ⟨j, hj, fun k hk => block_sieve_correction_support_unique hk hj⟩ · rintro ⟨j, hj, _⟩ rw [block_sieve_correction_coefficient_eq_at hj] exact (block_sieve_correction_at_ne_zero_iff J h n j).mpr hj theorem block_sieve_correction_coefficient_eq_zero_of_upper {G : Type*} {J : Finset G} {h n : G → ℕ} (hu : blockSieveUpperSupport J h n) : blockSieveCorrectionCoefficient J h n = 0 := by apply block_sieve_correction_coefficient_eq_zero rintro ⟨j, hj⟩ exact block_sieve_upper_correction_disjoint hu hj section variable {G : Type*} (J : Finset G) (h n : G → ℕ) include G J h n theorem abs_block_sieve_upper_coefficient_le_one : |blockSieveUpperCoefficient J h n| ≤ 1 := by classical unfold blockSieveUpperCoefficient split_ifs <;> simp [abs_pow] theorem abs_block_sieve_correction_at_le_one (j : G) : |blockSieveCorrectionAt J h n j| ≤ 1 := by classical unfold blockSieveCorrectionAt split_ifs <;> simp [abs_pow] theorem abs_block_sieve_correction_coefficient_le_one : |blockSieveCorrectionCoefficient J h n| ≤ 1 := by classical by_cases hex : ∃ j, blockSieveCorrectionSupport J h n j · obtain ⟨j, hj⟩ := hex rw [block_sieve_correction_coefficient_eq_at hj] exact abs_block_sieve_correction_at_le_one J h n j · rw [block_sieve_correction_coefficient_eq_zero hex] norm_num theorem block_sieve_lower_coefficient_ne_zero_iff : blockSieveLowerCoefficient J h n ≠ 0 ↔ blockSieveUpperSupport J h n ∨ ∃! j, blockSieveCorrectionSupport J h n j := by classical by_cases hu : blockSieveUpperSupport J h n · have hc := block_sieve_correction_coefficient_eq_zero_of_upper hu simp [blockSieveLowerCoefficient, hc, (block_sieve_upper_coefficient_ne_zero_iff J h n).mpr hu, hu] · have hz : blockSieveUpperCoefficient J h n = 0 := not_ne_iff.mp (fun hn => hu ((block_sieve_upper_coefficient_ne_zero_iff J h n).mp hn)) simp only [blockSieveLowerCoefficient, hz, zero_sub, neg_ne_zero, hu, false_or] exact block_sieve_correction_coefficient_ne_zero_iff J h n theorem abs_block_sieve_lower_coefficient_le_one : |blockSieveLowerCoefficient J h n| ≤ 1 := by classical by_cases hu : blockSieveUpperSupport J h n · rw [blockSieveLowerCoefficient, block_sieve_correction_coefficient_eq_zero_of_upper hu, sub_zero] exact abs_block_sieve_upper_coefficient_le_one J h n · have hz : blockSieveUpperCoefficient J h n = 0 := not_ne_iff.mp (fun hn => hu ((block_sieve_upper_coefficient_ne_zero_iff J h n).mp hn)) rw [blockSieveLowerCoefficient, hz, zero_sub, abs_neg] exact abs_block_sieve_correction_coefficient_le_one J h n end def blockSieveOccupancy {G α : Type*} [DecidableEq α] (B : G → Finset α) (S : Finset α) (g : G) : ℕ := (S ∩ B g).card noncomputable def blockSieveSubsetUpperCoefficient {G α : Type*} [DecidableEq α] (J : Finset G) (B : G → Finset α) (h : G → ℕ) (S : Finset α) : ℝ := if S ⊆ J.biUnion B then blockSieveUpperCoefficient J h (blockSieveOccupancy B S) else 0 noncomputable def blockSieveSubsetCorrectionAt {G α : Type*} [DecidableEq α] (J : Finset G) (B : G → Finset α) (h : G → ℕ) (j : G) (S : Finset α) : ℝ := if S ⊆ J.biUnion B then blockSieveCorrectionAt J h (blockSieveOccupancy B S) j else 0 noncomputable def blockSieveSubsetLowerCoefficient {G α : Type*} [DecidableEq α] (J : Finset G) (B : G → Finset α) (h : G → ℕ) (S : Finset α) : ℝ := if S ⊆ J.biUnion B then blockSieveLowerCoefficient J h (blockSieveOccupancy B S) else 0 section variable {G α : Type*} [sharedInstance1 : DecidableEq α] (J : Finset G) (B : G → Finset α) include G α sharedInstance1 J B theorem block_sieve_subset_lower_coefficient_eq (h : G → ℕ) (S : Finset α) : blockSieveSubsetLowerCoefficient J B h S = blockSieveSubsetUpperCoefficient J B h S - ∑ j ∈ J, blockSieveSubsetCorrectionAt J B h j S := by classical by_cases hs : S ⊆ J.biUnion B <;> simp [blockSieveSubsetLowerCoefficient, blockSieveSubsetUpperCoefficient, blockSieveSubsetCorrectionAt, blockSieveLowerCoefficient, blockSieveCorrectionCoefficient, hs] theorem abs_block_sieve_subset_upper_coefficient_le_one (h : G → ℕ) (S : Finset α) : |blockSieveSubsetUpperCoefficient J B h S| ≤ 1 := by classical unfold blockSieveSubsetUpperCoefficient split_ifs · exact abs_block_sieve_upper_coefficient_le_one _ _ _ · norm_num theorem abs_block_sieve_subset_correction_sum_le_one (h : G → ℕ) (S : Finset α) : |∑ j ∈ J, blockSieveSubsetCorrectionAt J B h j S| ≤ 1 := by classical by_cases hs : S ⊆ J.biUnion B · simpa only [blockSieveSubsetCorrectionAt, if_pos hs, blockSieveCorrectionCoefficient] using abs_block_sieve_correction_coefficient_le_one J h (blockSieveOccupancy B S) · simp [blockSieveSubsetCorrectionAt, hs] theorem abs_block_sieve_subset_lower_coefficient_le_one (h : G → ℕ) (S : Finset α) : |blockSieveSubsetLowerCoefficient J B h S| ≤ 1 := by classical unfold blockSieveSubsetLowerCoefficient split_ifs · exact abs_block_sieve_lower_coefficient_le_one _ _ _ · norm_num theorem block_sieve_subset_upper_coefficient_ne_zero_iff (h : G → ℕ) (S : Finset α) : blockSieveSubsetUpperCoefficient J B h S ≠ 0 ↔ S ⊆ J.biUnion B ∧ blockSieveUpperSupport J h (blockSieveOccupancy B S) := by classical by_cases hs : S ⊆ J.biUnion B <;> simp_all [blockSieveSubsetUpperCoefficient, block_sieve_upper_coefficient_ne_zero_iff] theorem block_sieve_subset_correction_at_ne_zero_iff (h : G → ℕ) (j : G) (S : Finset α) : blockSieveSubsetCorrectionAt J B h j S ≠ 0 ↔ S ⊆ J.biUnion B ∧ blockSieveCorrectionSupport J h (blockSieveOccupancy B S) j := by classical by_cases hs : S ⊆ J.biUnion B <;> simp_all [blockSieveSubsetCorrectionAt, block_sieve_correction_at_ne_zero_iff] theorem block_sieve_subset_lower_coefficient_ne_zero_iff (h : G → ℕ) (S : Finset α) : blockSieveSubsetLowerCoefficient J B h S ≠ 0 ↔ S ⊆ J.biUnion B ∧ (blockSieveUpperSupport J h (blockSieveOccupancy B S) ∨ ∃! j, blockSieveCorrectionSupport J h (blockSieveOccupancy B S) j) := by classical by_cases hs : S ⊆ J.biUnion B <;> simp_all [blockSieveSubsetLowerCoefficient, block_sieve_lower_coefficient_ne_zero_iff] theorem block_sieve_occupancy_sum_eq_card (S : Finset α) (hdisj : (J : Set G).PairwiseDisjoint B) (hs : S ⊆ J.biUnion B) : (∑ g ∈ J, blockSieveOccupancy B S g) = S.card := by classical have he : J.biUnion (fun g => S ∩ B g) = S := by ext p simp only [mem_biUnion, mem_inter] constructor · rintro ⟨g, _, hp, _⟩ exact hp · intro hp obtain ⟨g, hg, hpg⟩ := mem_biUnion.mp (hs hp) exact ⟨g, hg, hp, hpg⟩ have hd : (J : Set G).PairwiseDisjoint (fun g => S ∩ B g) := by intro i hi j hj hij exact (hdisj hi hj hij).mono inter_subset_right inter_subset_right calc _ = (J.biUnion (fun g => S ∩ B g)).card := (card_biUnion hd).symm _ = S.card := congrArg Finset.card he theorem block_sieve_subset_upper_coefficient_eq (h : G → ℕ) (S : Finset α) (hdisj : (J : Set G).PairwiseDisjoint B) (hs : S ⊆ J.biUnion B) (hu : blockSieveUpperSupport J h (blockSieveOccupancy B S)) : blockSieveSubsetUpperCoefficient J B h S = (-1 : ℝ)^S.card := by classical simp only [blockSieveSubsetUpperCoefficient, if_pos hs, blockSieveUpperCoefficient, if_pos hu, block_sieve_occupancy_sum_eq_card J B S hdisj hs] end /- Arbitrary finite-subset weights can be evaluated term by term, so in particular this applies to the monomial `w S = ∏ p ∈ S, x p`. -/ theorem block_sieve_subset_weighted_expansion {G α : Type*} [DecidableEq α] (J : Finset G) (B : G → Finset α) (h : G → ℕ) (w : Finset α → ℝ) : (∑ S ∈ (J.biUnion B).powerset, blockSieveSubsetLowerCoefficient J B h S * w S) = (∑ S ∈ (J.biUnion B).powerset, blockSieveSubsetUpperCoefficient J B h S * w S) - ∑ j ∈ J, ∑ S ∈ (J.biUnion B).powerset, blockSieveSubsetCorrectionAt J B h j S * w S := by simp_rw [block_sieve_subset_lower_coefficient_eq, sub_mul, sum_sub_distrib, sum_mul] rw [sum_comm] end section open Finset theorem block_sieve_model_product_upper {G : Type*} (s : Finset G) (a e u : G → ℝ) (ha : ∀ g ∈ s, 0 < a g) (hu : ∀ g ∈ s, 0 ≤ u g) (hub : ∀ g ∈ s, u g ≤ a g + e g) : (∏ g ∈ s, u g) ≤ (∏ g ∈ s, a g) * Real.exp (∑ g ∈ s, e g / a g) := by calc _ ≤ ∏ g ∈ s, a g * Real.exp (e g / a g) := by apply prod_le_prod₀ hu intro g hg apply (hub g hg).trans have h := mul_le_mul_of_nonneg_left (Real.add_one_le_exp (e g / a g)) (ha g hg).le have he : a g * (e g / a g + 1) = a g + e g := by field_simp [(ha g hg).ne']; ring rwa [he] at h _ = _ := by rw [prod_mul_distrib, Real.exp_sum] theorem block_sieve_model_correction_upper {G : Type*} [DecidableEq G] (s : Finset G) (a e u : G → ℝ) (ha : ∀ g ∈ s, 0 < a g) (he : ∀ g ∈ s, 0 ≤ e g) (hu : ∀ g ∈ s, 0 ≤ u g) (hub : ∀ g ∈ s, u g ≤ a g + e g) : (∑ j ∈ s, e j * ∏ g ∈ s.erase j, u g) ≤ (∏ g ∈ s, a g) * (∑ g ∈ s, e g / a g) * Real.exp (∑ g ∈ s, e g / a g) := by have hterm : ∀ j ∈ s, e j * (∏ g ∈ s.erase j, u g) ≤ (∏ g ∈ s, a g) * (e j / a j) * Real.exp (∑ g ∈ s, e g / a g) := by intro j hj have hprod := block_sieve_model_product_upper (s.erase j) a e u (fun g hg => ha g (mem_of_mem_erase hg)) (fun g hg => hu g (mem_of_mem_erase hg)) (fun g hg => hub g (mem_of_mem_erase hg)) have hsum : (∑ g ∈ s.erase j, e g / a g) ≤ ∑ g ∈ s, e g / a g := by apply sum_le_sum_of_subset_of_nonneg (erase_subset j s) intro g hg _ exact div_nonneg (he g hg) (ha g hg).le have hid : e j * (∏ g ∈ s.erase j, a g) = (∏ g ∈ s, a g) * (e j / a j) := by rw [← prod_erase_mul s a hj] field_simp [(ha j hj).ne'] calc _ ≤ e j * ((∏ g ∈ s.erase j, a g) * Real.exp (∑ g ∈ s.erase j, e g / a g)) := mul_le_mul_of_nonneg_left hprod (he j hj) _ ≤ e j * ((∏ g ∈ s.erase j, a g) * Real.exp (∑ g ∈ s, e g / a g)) := by apply mul_le_mul_of_nonneg_left _ (he j hj) exact mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hsum) (prod_nonneg (fun g hg => (ha g (mem_of_mem_erase hg)).le)) _ = _ := by rw [← mul_assoc, hid] calc _ ≤ ∑ j ∈ s, (∏ g ∈ s, a g) * (e j / a j) * Real.exp (∑ g ∈ s, e g / a g) := sum_le_sum hterm _ = _ := by rw [← sum_mul, ← mul_sum] end section open Finset theorem factorial_term_le_exp_decay {C : ℝ} (hC : 0 ≤ C) (n : ℕ) : C^n / (n.factorial : ℝ) ≤ Real.exp (C * Real.exp 1) * Real.exp (-(n : ℝ)) := by have hexp : (Real.exp 1)^n * Real.exp (-(n : ℝ)) = 1 := by rw [← Real.exp_nat_mul, mul_one, ← Real.exp_add] simp calc C^n / (n.factorial : ℝ) = ((C * Real.exp 1)^n / (n.factorial : ℝ)) * Real.exp (-(n : ℝ)) := by rw [mul_pow] calc _ = (C^n / (n.factorial : ℝ)) * ((Real.exp 1)^n * Real.exp (-(n : ℝ))) := by rw [hexp, mul_one] _ = _ := by ring _ ≤ _ := mul_le_mul_of_nonneg_right (Real.pow_div_factorial_le_exp (C * Real.exp 1) (mul_nonneg hC (Real.exp_pos _).le) n) (Real.exp_pos _).le theorem finite_sum_exp_neg_nat_le (J : Finset ℕ) : (∑ j ∈ J, Real.exp (-(j : ℝ))) ≤ (1 - Real.exp (-1))⁻¹ := by have hlt : Real.exp (-1) < 1 := Real.exp_lt_one_iff.mpr (by norm_num) have hs := hasSum_geometric_of_lt_one (Real.exp_pos (-1)).le hlt calc (∑ j ∈ J, Real.exp (-(j : ℝ))) = ∑ j ∈ J, (Real.exp (-1))^j := by apply sum_congr rfl intro j _ rw [← Real.exp_nat_mul, mul_neg_one] _ ≤ ∑' j : ℕ, (Real.exp (-1))^j := hs.summable.sum_le_tsum J (fun _ _ => by positivity) _ = _ := hs.tsum_eq theorem block_sieve_factorial_tail_bound {C : ℝ} (hC : 0 ≤ C) {h : ℕ} (hh : 1 ≤ h) (J : Finset ℕ) : (∑ j ∈ J, C^((j + 1)*h + 1) / (((j + 1)*h + 1).factorial : ℝ)) ≤ (Real.exp (C * Real.exp 1) / (1 - Real.exp (-1))) * Real.exp (-(h : ℝ)) := by have hterm (j : ℕ) : C^((j + 1)*h + 1) / (((j + 1)*h + 1).factorial : ℝ) ≤ (Real.exp (C * Real.exp 1) * Real.exp (-(h : ℝ))) * Real.exp (-(j : ℝ)) := by have hn : h + j ≤ (j + 1)*h + 1 := by nlinarith have hn' : (h : ℝ) + j ≤ (((j + 1)*h + 1 : ℕ) : ℝ) := by exact_mod_cast hn calc _ ≤ Real.exp (C * Real.exp 1) * Real.exp (-((((j + 1)*h + 1 : ℕ) : ℝ))) := factorial_term_le_exp_decay hC _ _ ≤ Real.exp (C * Real.exp 1) * Real.exp (-(h : ℝ) - (j : ℝ)) := by apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le apply Real.exp_le_exp.mpr linarith _ = _ := by rw [sub_eq_add_neg, Real.exp_add]; ring calc _ ≤ ∑ j ∈ J, (Real.exp (C * Real.exp 1) * Real.exp (-(h : ℝ))) * Real.exp (-(j : ℝ)) := sum_le_sum (fun j _ => hterm j) _ = (Real.exp (C * Real.exp 1) * Real.exp (-(h : ℝ))) * (∑ j ∈ J, Real.exp (-(j : ℝ))) := (mul_sum ..).symm _ ≤ (Real.exp (C * Real.exp 1) * Real.exp (-(h : ℝ))) * (1 - Real.exp (-1))⁻¹ := mul_le_mul_of_nonneg_left (finite_sum_exp_neg_nat_le J) (by positivity) _ = _ := by ring end section open Finset theorem block_sieve_dyadic_degree_sum (J : Finset ℕ) (h : ℕ) : (∑ j ∈ J, (((j + 1) * h + 1 : ℕ) : ℝ) / (2 : ℝ)^j) ≤ 4 * (h : ℝ) + 2 := by have hg : HasSum (fun j : ℕ => (1/2 : ℝ)^j) 2 := by convert! hasSum_geometric_of_lt_one (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) < 1) using 1; norm_num have hn : HasSum (fun j : ℕ => (j : ℝ) * (1/2 : ℝ)^j) 2 := by convert! hasSum_coe_mul_geometric_of_norm_lt_one (by norm_num : ‖(1/2 : ℝ)‖ < 1) using 1; norm_num have hall : HasSum (fun j : ℕ => (((j + 1) * h + 1 : ℕ) : ℝ) / (2 : ℝ)^j) (4 * (h : ℝ) + 2) := by convert! ((hn.add hg).mul_left (h : ℝ)).add hg using 1 · ext j simp only [Nat.cast_add, Nat.cast_mul, Nat.cast_one, div_pow, one_pow] ring · ring exact (hall.summable.sum_le_tsum J (fun j _ => by positivity)).trans_eq hall.tsum_eq theorem block_sieve_weighted_degree_sum (J : Finset ℕ) (h : ℕ) (n : ℕ → ℕ) (hn : ∀ j ∈ J, n j ≤ (j + 1) * h + 1) : (∑ j ∈ J, (n j : ℝ) / (2 : ℝ)^j) ≤ 4 * (h : ℝ) + 2 := by apply le_trans _ (block_sieve_dyadic_degree_sum J h) exact sum_le_sum (fun j hj => div_le_div_of_nonneg_right (Nat.cast_le.mpr (hn j hj)) (by positivity)) theorem block_sieve_log_product_level {ι : Type*} [DecidableEq ι] (J : Finset ℕ) (B : ℕ → Finset ι) (x : ι → ℝ) (h : ℕ) {z : ℝ} (hz : 1 ≤ z) (hdisj : (J : Set ℕ).PairwiseDisjoint B) (hpos : ∀ j ∈ J, ∀ p ∈ B j, 0 < x p) (hsize : ∀ j ∈ J, ∀ p ∈ B j, Real.log (x p) ≤ Real.log z / (2 : ℝ)^j) (hcard : ∀ j ∈ J, (B j).card ≤ (j + 1) * h + 1) : (∏ p ∈ J.biUnion B, x p) ≤ z^(4 * (h : ℝ) + 2) := by have hz0 : 0 < z := zero_lt_one.trans_le hz have hprodpos : 0 < ∏ p ∈ J.biUnion B, x p := by apply prod_pos intro p hp obtain ⟨j, hj, hp⟩ := mem_biUnion.mp hp exact hpos j hj p hp have hlog : Real.log (∏ p ∈ J.biUnion B, x p) ≤ (4 * (h : ℝ) + 2) * Real.log z := by rw [prod_biUnion hdisj, Real.log_prod (fun j hj => ne_of_gt (prod_pos (hpos j hj)))] calc _ = ∑ j ∈ J, ∑ p ∈ B j, Real.log (x p) := by apply sum_congr rfl intro j hj exact Real.log_prod (fun p hp => ne_of_gt (hpos j hj p hp)) _ ≤ ∑ j ∈ J, ((B j).card : ℝ) * (Real.log z / (2 : ℝ)^j) := by apply sum_le_sum intro j hj exact (sum_le_sum (hsize j hj)).trans_eq (by simp) _ = (∑ j ∈ J, ((B j).card : ℝ) / (2 : ℝ)^j) * Real.log z := by rw [sum_mul] apply sum_congr rfl intro j _ ring _ ≤ _ := mul_le_mul_of_nonneg_right (block_sieve_weighted_degree_sum J h (fun j => (B j).card) hcard) (Real.log_nonneg hz) rw [← Real.exp_log hprodpos, Real.rpow_def_of_pos hz0] exact Real.exp_le_exp.mpr (by simpa only [mul_comm (Real.log z)] using hlog) end section open Finset noncomputable def subsetPolynomial {ι : Type*} (P : Finset ι) (a : Finset ι → ℝ) (x : ι → ℝ) : ℝ := ∑ S ∈ P.powerset, a S * ∏ p ∈ S, x p section variable {ι Ω : Type*} (P : Finset ι) (T : Finset Ω) (a r : Finset ι → ℝ) (μ : Ω → ℝ) (x : Ω → ι → ℝ) (g : ι → ℝ) (X : ℝ) include ι Ω P T a r μ x g X theorem subset_polynomial_average_identity (hmoment : ∀ S ∈ P.powerset, (∑ t ∈ T, μ t * ∏ p ∈ S, x t p) = X * (∏ p ∈ S, g p) + r S) : (∑ t ∈ T, μ t * subsetPolynomial P a (x t)) - X * subsetPolynomial P a g = ∑ S ∈ P.powerset, a S * r S := by have heq : (∑ t ∈ T, μ t * subsetPolynomial P a (x t)) = ∑ S ∈ P.powerset, a S * (∑ t ∈ T, μ t * ∏ p ∈ S, x t p) := by simp only [subsetPolynomial, mul_sum] rw [sum_comm] apply sum_congr rfl intro S _ apply sum_congr rfl intro t _ ring rw [heq] have hmainsum : (∑ S ∈ P.powerset, a S * (∑ t ∈ T, μ t * ∏ p ∈ S, x t p)) = ∑ S ∈ P.powerset, a S * (X * (∏ p ∈ S, g p) + r S) := by apply sum_congr rfl intro S hS rw [hmoment S hS] rw [hmainsum] simp only [subsetPolynomial, mul_add, sum_add_distrib, mul_sum] have hmain : (∑ S ∈ P.powerset, a S * (X * ∏ p ∈ S, g p)) = ∑ S ∈ P.powerset, X * (a S * ∏ p ∈ S, g p) := by apply sum_congr rfl intro S _ ring rw [hmain] ring theorem subset_polynomial_average_error (ha : ∀ S ∈ P.powerset, |a S| ≤ 1) (hmoment : ∀ S ∈ P.powerset, (∑ t ∈ T, μ t * ∏ p ∈ S, x t p) = X * (∏ p ∈ S, g p) + r S) : |(∑ t ∈ T, μ t * subsetPolynomial P a (x t)) - X * subsetPolynomial P a g| ≤ ∑ S ∈ P.powerset, if a S = 0 then 0 else |r S| := by classical rw [subset_polynomial_average_identity P T a r μ x g X hmoment] apply (abs_sum_le_sum_abs _ _).trans apply sum_le_sum intro S hS by_cases hzero : a S = 0 · simp [hzero] · rw [if_neg hzero, abs_mul] exact mul_le_of_le_one_left (abs_nonneg _) (ha S hS) end theorem subset_polynomial_sandwich_transfer {ι Ω : Type*} (P : Finset ι) (T : Finset Ω) (a b : Finset ι → ℝ) (μ F : Ω → ℝ) (x : Ω → ι → ℝ) (g : ι → ℝ) (X A E R : ℝ) (hμ : ∀ t ∈ T, 0 ≤ μ t) (hX : 0 ≤ X) (hpoint : ∀ t ∈ T, subsetPolynomial P b (x t) ≤ F t ∧ F t ≤ subsetPolynomial P a (x t)) (hmodela : |subsetPolynomial P a g - A| ≤ E) (hmodelb : |subsetPolynomial P b g - A| ≤ E) (herra : |(∑ t ∈ T, μ t * subsetPolynomial P a (x t)) - X * subsetPolynomial P a g| ≤ R) (herrb : |(∑ t ∈ T, μ t * subsetPolynomial P b (x t)) - X * subsetPolynomial P b g| ≤ R) : |(∑ t ∈ T, μ t * F t) - X * A| ≤ X * E + R := by have hlo : (∑ t ∈ T, μ t * subsetPolynomial P b (x t)) ≤ ∑ t ∈ T, μ t * F t := sum_le_sum (fun t ht => mul_le_mul_of_nonneg_left (hpoint t ht).1 (hμ t ht)) have hhi : (∑ t ∈ T, μ t * F t) ≤ ∑ t ∈ T, μ t * subsetPolynomial P a (x t) := sum_le_sum (fun t ht => mul_le_mul_of_nonneg_left (hpoint t ht).2 (hμ t ht)) have hma := mul_le_mul_of_nonneg_left (abs_le.mp hmodela).2 hX have hmb := mul_le_mul_of_nonneg_left (abs_le.mp hmodelb).1 hX apply abs_le.mpr constructor <;> nlinarith [(abs_le.mp herra).2, (abs_le.mp herrb).1] end section open Finset def physicalResidueAbsoluteHit {G : Type*} {P : G → Finset ℕ} {n : ℕ} (a : Fin (n + 1) → ℤ) (g : G) (p : ↥(P g)) (j : ℕ) : ZMod p.val := -(a (globalBirthFiniteIndex n j) : ZMod p.val) theorem physical_residue_absolute_hit_step {G : Type*} {P : G → Finset ℕ} {n : ℕ} (a : Fin (n + 1) → ℤ) (g : G) (j : Fin n) (p : ↥(P g)) : physicalResidueAbsoluteHit a g p (j.val + 1) - physicalResidueAbsoluteHit a g p j.val = physicalGroupPhaseDelta (a j.castSucc) (a j.succ) g p := by unfold physicalResidueAbsoluteHit rw [show globalBirthFiniteIndex n (j.val + 1) = j.succ from global_birth_finite_index_at j.succ] rw [show globalBirthFiniteIndex n j.val = j.castSucc from global_birth_finite_index_at j.castSucc] exact (physical_group_phase_delta_eq_hit_difference _ _ g p).symm section ResiduePath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations G J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) noncomputable def physicalResidueCappedVisitKernel (j : ℕ) : ((p : ↥(P g)) → GhostPhaseState (ZMod p.val)) → ((p : ↥(P g)) → GhostPhaseState (ZMod p.val)) → ℝ := ghostPhaseCappedDampedVisit (globalBirthFiniteActivity (physicalGroupBareFiniteActivity L g) j) (fun _ => 0) (fun _ => η (globalBirthFiniteIndex n j)) β (fun _ => ρ) cap variable [∀ p : ↥(P g), NeZero p.val] noncomputable def physicalResidueCappedMovingEdgeKernel (j : ℕ) : ((p : ↥(P g)) → GhostPhaseState (ZMod p.val)) → ((p : ↥(P g)) → GhostPhaseState (ZMod p.val)) → ℝ := ghostPhaseCappedDampedMovingEdge (globalBirthFiniteActivity (physicalGroupBareFiniteActivity L g) (j + 1)) (globalBirthFiniteActivity (physicalGroupBareFiniteActivity L g) j) (fun p => physicalResidueAbsoluteHit a g p (j + 1) - physicalResidueAbsoluteHit a g p j) β (fun _ => V) (fun _ => ρ) (fun _ => ρ) cap omit [Fintype G] in theorem physical_residue_visit_kernel_to_real (j : Fin (n + 1)) (z w : (p : ↥(P g)) → GhostPhaseState (ZMod p.val)) : globalBirthRawStepKernel (physicalGroupBareFiniteVisit L g β η V ρ hV cap j) z w = (physicalResidueCappedVisitKernel L g β η ρ cap j.val z w : ℂ) := by unfold physicalResidueCappedVisitKernel rw [global_birth_finite_activity_at, global_birth_finite_index_at] change globalBirthRawStepKernel (.visit (a := physicalGroupPhaseActivity (L j) g) (fun _ => 0) β (η j) V ρ hV cap) z w = _ rw [global_birth_raw_step_kernel_visit] unfold ghostPhaseCappedDampedVisit split_ifs <;> rfl end ResiduePath end section open Finset section Groups variable {G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] {R : (g : G) → P g → Type*} [∀ g p, DecidableEq (R g p)] theorem ghost_phase_grouped_capped_visit (a : (g : G) → P g → Bool) (h : (g : G) → (p : P g) → R g p) (η β ρ : (g : G) → P g → ℝ) (cap : ℕ) (z w : (g : G) → (p : P g) → GhostPhaseState (R g p)) : (if (∑ g, (ghostPhasePendingSupport (z g)).card) ≤ cap then ∏ g, ghostPhaseCappedDampedVisit (a g) (h g) (η g) (β g) (ρ g) cap (z g) (w g) else 0) = ghostPhaseCappedDampedVisit (fun p : Σ g, P g => a p.1 p.2) (fun p => h p.1 p.2) (fun p => η p.1 p.2) (fun p => β p.1 p.2) (fun p => ρ p.1 p.2) cap (globalBirthFlattenPhase z) (globalBirthFlattenPhase w) := by classical unfold ghostPhaseCappedDampedVisit rw [global_birth_flatten_pending_card] split_ifs with hz · rw [Fintype.prod_sigma] apply prod_congr rfl intro g _ have hg : (ghostPhasePendingSupport (z g)).card ≤ cap := (single_le_sum (fun i _ => Nat.zero_le _) (mem_univ g)).trans hz rw [if_pos hg] rfl · rfl variable [∀ g p, AddGroup (R g p)] [∀ g p, Fintype (R g p)] theorem ghost_phase_grouped_capped_moving_edge (atgt asrc : (g : G) → P g → Bool) (δ : (g : G) → (p : P g) → R g p) (β V ρtgt ρsrc : (g : G) → P g → ℝ) (cap : ℕ) (z w : (g : G) → (p : P g) → GhostPhaseState (R g p)) : (if (∑ g, (ghostPhasePendingSupport (z g)).card) ≤ cap then ∏ g, ghostPhaseCappedDampedMovingEdge (atgt g) (asrc g) (δ g) (β g) (V g) (ρtgt g) (ρsrc g) cap (z g) (w g) else 0) = ghostPhaseCappedDampedMovingEdge (fun p : Σ g, P g => atgt p.1 p.2) (fun p => asrc p.1 p.2) (fun p => δ p.1 p.2) (fun p => β p.1 p.2) (fun p => V p.1 p.2) (fun p => ρtgt p.1 p.2) (fun p => ρsrc p.1 p.2) cap (globalBirthFlattenPhase z) (globalBirthFlattenPhase w) := by classical unfold ghostPhaseCappedDampedMovingEdge rw [global_birth_flatten_pending_card] split_ifs with hz · rw [Fintype.prod_sigma] apply prod_congr rfl intro g _ have hg : (ghostPhasePendingSupport (z g)).card ≤ cap := (single_le_sum (fun i _ => Nat.zero_le _) (mem_univ g)).trans hz rw [if_pos hg] rfl · rfl end Groups end section open Finset def globalBirthFlattenEquiv {G : Type*} {P : G → Type*} {R : (g : G) → P g → Type*} : ((g : G) → (p : P g) → GhostPhaseState (R g p)) ≃ ((p : Σ g, P g) → GhostPhaseState (R p.1 p.2)) where toFun z p := z p.1 p.2 invFun z g p := z ⟨g, p⟩ left_inv _z := rfl right_inv _z := rfl theorem finite_alternating_pairing_fixed_equiv {X Y : Type*} [Fintype X] [Fintype Y] (e : X ≃ Y) (G E : ℕ → X → X → ℝ) (f q : X → ℝ) (n : ℕ) : finiteAlternatingPairing (fun j y z => G j (e.symm y) (e.symm z)) (fun j y z => E j (e.symm y) (e.symm z)) (fun y => f (e.symm y)) (fun y => q (e.symm y)) n = finiteAlternatingPairing G E f q n := by have hK : finiteAlternatingKernel (fun j y z => G j (e.symm y) (e.symm z)) (fun j y z => E j (e.symm y) (e.symm z)) = (fun j y z => finiteAlternatingKernel G E j (e.symm y) (e.symm z)) := by funext j y z unfold finiteAlternatingKernel split_ifs <;> rfl unfold finiteAlternatingPairing rw [hK, ← e.sum_comp] apply sum_congr rfl intro x _ dsimp only rw [Equiv.symm_apply_apply] exact congrArg (q x * ·) (finite_path_action_conjugate (fun _ => e) (finiteAlternatingKernel G E) f (2 * n + 1) x) theorem complex_trace_eq_real_alternating_equiv {X Y : Type*} [Fintype X] [Fintype Y] (e : X ≃ Y) (G E : ℕ → Y → Y → ℝ) (K : ℕ → X → X → ℂ) (f q : Y → ℝ) (n : ℕ) (hK : ∀ j < 2 * n + 1, ∀ z w, K j z w = ((finiteAlternatingKernel G E j (e z) (e w) : ℝ) : ℂ)) : (∑ x : Fin (2 * n + 2) → X, (q (e (x (Fin.last (2 * n + 1)))) : ℂ) * ((f (e (x 0)) : ℂ) * ∏ j : Fin (2 * n + 1), K j.val (x j.succ) (x j.castSucc))) = (finiteAlternatingPairing G E f q n : ℂ) := by have h := complex_trace_eq_real_alternating (fun j z w => G j (e z) (e w)) (fun j z w => E j (e z) (e w)) K (fun x => f (e x)) (fun x => q (e x)) n (by intro j hj z w by_cases hp : j % 2 = 0 · simpa only [finiteAlternatingKernel, hp, ite_true] using hK j hj z w · simpa only [finiteAlternatingKernel, hp, ite_false] using hK j hj z w) rw [h] exact congrArg (fun r : ℝ => (r : ℂ)) (finite_alternating_pairing_fixed_equiv e.symm G E f q n) end section open Finset theorem fin_tensor_row_events (n : ℕ) {S T : Fin n → Type*} (E : (g : Fin n) → S g → Type*) [∀ g s, Fintype (E g s)] (target : ∀ g s, E g s → T g) (weight : ∀ g s, E g s → ℂ) (F : ((g : Fin n) → T g) → ℂ) (s : (g : Fin n) → S g) : finTensorRow n (fun g G x => ∑ e : E g x, weight g x e * G (target g x e)) F s = ∑ e : (g : Fin n) → E g (s g), (∏ g, weight g (s g) (e g)) * F (fun g => target g (s g) (e g)) := by classical induction n with | zero => simp only [finTensorRow, Fintype.prod_empty, one_mul, Fintype.sum_unique] exact congrArg F (Subsingleton.elim _ _) | succ n ih => simp only [finTensorRow, ih, mul_sum] rw [← (Fin.consEquiv (fun g => E g (s g))).sum_comp] rw [Fintype.sum_prod_type] apply sum_congr rfl intro t _ apply sum_congr rfl intro u _ simp only [Fin.consEquiv, Equiv.coe_fn_mk, Fin.prod_univ_succ, Fin.tail] rw [mul_assoc] congr 1 congr 1 apply congrArg F funext g refine Fin.cases ?_ (fun j => ?_) g <;> rfl end section open Finset Classical noncomputable def activeTupleSplit {P : Type*} {M : ℕ} (S : Finset (Fin M)) : (Fin M → P) ≃ (Fin S.card → P) × (Fin Sᶜ.card → P) where toFun x := (fun j => x (S.equivFin.symm j), fun j => x (Sᶜ.equivFin.symm j)) invFun y i := if h : i ∈ S then y.1 (S.equivFin ⟨i, h⟩) else y.2 (Sᶜ.equivFin ⟨i, mem_compl.mpr h⟩) left_inv x := by funext i by_cases h : i ∈ S <;> simp [h] right_inv y := by apply Prod.ext · funext j have h : (S.equivFin.symm j).val ∈ S := (S.equivFin.symm j).property simp [h] · funext j have h : (Sᶜ.equivFin.symm j).val ∉ S := mem_compl.mp (Sᶜ.equivFin.symm j).property simp [h] theorem activeTupleSplit_weight {P : Type*} {M : ℕ} (S : Finset (Fin M)) (μ : P → ℝ) (x : Fin M → P) : (∏ i, μ (x i)) = (∏ i, μ ((activeTupleSplit S x).1 i)) * (∏ i, μ ((activeTupleSplit S x).2 i)) := by have h : (∏ i : ↥S, μ (x i)) * (∏ i : ↥Sᶜ, μ (x i)) = ∏ i, μ (x i) := by rw [prod_coe_sort S (fun i => μ (x i)), prod_coe_sort Sᶜ (fun i => μ (x i))] exact prod_mul_prod_compl S (fun i => μ (x i)) rw [← h] congr 1 · exact (Equiv.prod_comp S.equivFin.symm (fun i : ↥S => μ (x i))).symm · exact (Equiv.prod_comp Sᶜ.equivFin.symm (fun i : ↥Sᶜ => μ (x i))).symm noncomputable def activeMemorySplit {P Z : Type*} {M : ℕ} (S : Finset (Fin M)) (B : ℕ) : BoundedOrderedState P Z M B ≃ (Fin S.card → P) × BoundedOrderedState P Z Sᶜ.card B := (Equiv.prodCongr (activeTupleSplit S) (Equiv.refl (BoundedOrderedTuple Z B))).trans (Equiv.prodAssoc _ _ _) theorem activeMemorySplit_weight {P Z : Type*} {M : ℕ} (S : Finset (Fin M)) (B : ℕ) (μ : P → ℝ) (ν : Z → ℝ) (x : BoundedOrderedState P Z M B) : boundedOrderedStateWeight μ ν x = (∏ i, μ ((activeMemorySplit S B x).1 i)) * boundedOrderedStateWeight μ ν (activeMemorySplit S B x).2 := by change (∏ i, μ (x.1 i)) * boundedOrderedMemoryWeight ν x.2 = (∏ i, μ ((activeTupleSplit S x.1).1 i)) * ((∏ i, μ ((activeTupleSplit S x.1).2 i)) * boundedOrderedMemoryWeight ν x.2) rw [activeTupleSplit_weight S μ x.1] exact mul_assoc _ _ _ end section open Finset Classical def equivFiberSlice {X C Y : Type*} (e : X ≃ C × Y) (f : X → ℂ) (c : C) (y : Y) : ℂ := f (e.symm (c, y)) theorem finite_energy_equiv_fibers {X C Y : Type*} [Fintype X] [Fintype C] [Fintype Y] (e : X ≃ C × Y) (W : X → ℝ) (κ : C → ℝ) (μ : Y → ℝ) (hW : ∀ c y, W (e.symm (c, y)) = κ c * μ y) (f : X → ℂ) : finiteWeightedEnergy W f = finiteFiberEnergy κ (fun _ => μ) (equivFiberSlice e f) := by unfold finiteWeightedEnergy finiteFiberEnergy rw [← Equiv.sum_comp e.symm, Fintype.sum_prod_type] simp only [hW, finiteWeightedEnergy, equivFiberSlice, mul_sum, mul_assoc] end section open scoped BigOperators Classical noncomputable def primeProductIdealKernel {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (Q : ℕ) (h : ℝ) (kept : Finset ℤ) (x y : ∀ j, P j) : ℂ := finiteCellFrameKernel (finiteProductWeight (physicalLabelLaw V)) (fun z => upperLogCell h (Real.log (∏ j, (z j).val : ℕ))) kept (fun t : BoundedPrimitiveCharacter Q => fun z => star (boundedPrimitiveValue t ((∏ j, (z j).val : ℕ) : ZMod (boundedPrimitiveModulus t)))) x y theorem prime_above_modulus_coprime {p q Q : ℕ} (hp : p.Prime) (hq : 0 < q) (hqQ : q ≤ Q) (hQp : Q < p) : p.Coprime q := by apply hp.coprime_iff_not_dvd.mpr intro hd have := Nat.le_of_dvd hq hd omega theorem bounded_primitive_smallness (Q : ℕ) {V C a ξ : ℝ} (hV : 0 < V) (hC : 0 < C) (ha : 2 ≤ a) (hQ : 0 < Q) (hξ : 0 < ξ) (hsmall : (Q * Q - 1 : ℕ) * (((C / V) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1) : (Fintype.card (BoundedPrimitiveCharacter Q) - 1 : ℕ) * (((C / V) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 := by have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hQ1 : (1 : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Nat.mul_ne_zero (Nat.ne_of_gt hQ) (Nat.ne_of_gt hQ)) have hδ : 0 ≤ ((C / V) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ := by have := Real.log_nonneg hQ1 positivity have hcard : (Fintype.card (BoundedPrimitiveCharacter Q) - 1 : ℕ) ≤ Q * Q - 1 := Nat.sub_le_sub_right (bounded_primitive_character_card_le Q) 1 exact (mul_le_mul_of_nonneg_right (by exact_mod_cast hcard) hδ).trans hsmall theorem prime_product_ideal_kernel_energy (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → p.Prime ∧ Q < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h ξ : ℝ, 0 < h → 0 < ξ → ∀ kept : Finset ℤ, (∀ d ∈ kept, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) → (Q * Q - 1 : ℕ) * (((C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 → ∀ f : (∀ j, P j) → ℂ, (∑ x, finiteProductWeight (physicalLabelLaw V) x * ‖∑ y, (finiteProductWeight (physicalLabelLaw V) y : ℂ) * primeProductIdealKernel P V Q h kept x y * f y‖ ^ 2) ≤ 4 * ∑ x, finiteProductWeight (physicalLabelLaw V) x * ‖f x‖ ^ 2 := by obtain ⟨C, hC, hbnd⟩ := prime_tuple_log_cell_kernel_energy hZ refine ⟨C, hC, ?_⟩ intro Q hQ I _ _ P V i hV hp hmass a b hPi ha hb h ξ hh hξ kept hkept hsmall f have hs := bounded_primitive_smallness Q (hV i) hC ha hQ hξ hsmall change _ ≤ _ unfold primeProductIdealKernel have test := hbnd (T := BoundedPrimitiveCharacter Q) boundedPrimitiveModulus boundedPrimitiveValue bounded_primitive_modulus_pos bounded_primitive_value_primitive (bounded_primitive_character_injective Q) Q hQ bounded_primitive_modulus_le P V i hV (fun j p h => (hp j p h).1.pos) hmass (fun t j p h => prime_above_modulus_coprime (hp j p h).1 (bounded_primitive_modulus_pos t) (bounded_primitive_modulus_le t) (hp j p h).2) a b hPi ha hb h ξ hh hξ kept hkept hs f exact test end section open scoped BigOperators Classical noncomputable def finiteCoordinateAverage {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i : I) (f : (∀ j, X j) → ℂ) : (∀ j, X j) → ℂ := finiteCoordinateLift i (fun v _ => ∑ y, (μ i y : ℂ) * v y) f section variable {I : Type*} [sharedInstance1 : DecidableEq I] {X : I → Type*} [sharedInstance3 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i : I) include I sharedInstance1 X sharedInstance3 μ i theorem finite_coordinate_average_update (f : (∀ j, X j) → ℂ) (x : ∀ j, X j) : finiteCoordinateAverage μ i f x = ∑ y, (μ i y : ℂ) * f (Function.update x i y) := by exact finite_coordinate_lift_eq_update i _ f x theorem finite_coordinate_average_split (f : (∀ j, X j) → ℂ) (y : X i) (z : ∀ j : {j : I // j ≠ i}, X j.val) : finiteCoordinateAverage μ i f ((Equiv.piSplitAt i X).symm (y, z)) = ∑ y', (μ i y' : ℂ) * f ((Equiv.piSplitAt i X).symm (y', z)) := by exact finite_coordinate_lift_split i _ f y z theorem finite_coordinate_average_invariant (f : (∀ j, X j) → ℂ) (x : ∀ j, X j) (y : X i) : finiteCoordinateAverage μ i f (Function.update x i y) = finiteCoordinateAverage μ i f x := by simp only [finite_coordinate_average_update, Function.update_idem] theorem finite_coordinate_average_add (f g : (∀ j, X j) → ℂ) : finiteCoordinateAverage μ i (f + g) = finiteCoordinateAverage μ i f + finiteCoordinateAverage μ i g := by funext x simp only [finite_coordinate_average_update, Pi.add_apply, mul_add, Finset.sum_add_distrib] end theorem finite_coordinate_average_idempotent {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i : I) (hmass : ∑ y, μ i y = 1) (f : (∀ j, X j) → ℂ) : finiteCoordinateAverage μ i (finiteCoordinateAverage μ i f) = finiteCoordinateAverage μ i f := by funext x rw [finite_coordinate_average_update] simp only [finite_coordinate_average_invariant, ← Finset.sum_mul, ← Complex.ofReal_sum, hmass, Complex.ofReal_one, one_mul] theorem finite_coordinate_average_commute {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i j : I) (f : (∀ j, X j) → ℂ) : finiteCoordinateAverage μ i (finiteCoordinateAverage μ j f) = finiteCoordinateAverage μ j (finiteCoordinateAverage μ i f) := by by_cases hij : i = j · subst j; rfl funext x simp only [finite_coordinate_average_update, Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro y _ apply Finset.sum_congr rfl intro z _ rw [Function.update_comm hij] ring end section open Finset noncomputable def blockSieveUpper {G ι : Type*} (J : Finset G) (B : G → Finset ι) (w : ι → ℝ) (h : G → ℕ) : ℝ := ∏ g ∈ J, exclusionTruncation (B g) w (h g + 1) noncomputable def blockSieveCorrection {G ι : Type*} (J : Finset G) (B : G → Finset ι) (w : ι → ℝ) (h : G → ℕ) : ℝ := by classical exact ∑ g ∈ J, exclusionElementary (B g) w (h g + 1) * ∏ k ∈ J.erase g, exclusionTruncation (B k) w (h k + 1) noncomputable def blockSieveLower {G ι : Type*} (J : Finset G) (B : G → Finset ι) (w : ι → ℝ) (h : G → ℕ) : ℝ := blockSieveUpper J B w h - blockSieveCorrection J B w h section variable {G ι : Type*} (J : Finset G) (B : G → Finset ι) (w : ι → ℝ) (h : G → ℕ) (hw : ∀ g ∈ J, ∀ i ∈ B g, 0 ≤ w i ∧ w i ≤ 1) (hh : ∀ g ∈ J, Even (h g)) include G ι J B w h hw hh theorem block_sieve_sandwich : blockSieveLower J B w h ≤ (∏ g ∈ J, ∏ i ∈ B g, (1 - w i)) ∧ (∏ g ∈ J, ∏ i ∈ B g, (1 - w i)) ≤ blockSieveUpper J B w h := by classical exact block_product_sandwich J (fun g => ∏ i ∈ B g, (1 - w i)) (fun g => exclusionTruncation (B g) w (h g + 1)) (fun g => exclusionElementary (B g) w (h g + 1)) (fun g hg => prod_nonneg (fun i hi => sub_nonneg.mpr (hw g hg i hi).2)) (fun g hg => (block_sieve_local_bounds (B g) w (hw g hg) (hh g hg)).2.1) (fun g hg => (block_sieve_local_bounds (B g) w (hw g hg) (hh g hg)).2.2) theorem block_sieve_upper_nonneg : 0 ≤ blockSieveUpper J B w h := by exact prod_nonneg (fun g hg => (block_sieve_local_bounds (B g) w (hw g hg) (hh g hg)).1) theorem block_sieve_difference_bound : 0 ≤ blockSieveUpper J B w h - (∏ g ∈ J, ∏ i ∈ B g, (1 - w i)) ∧ blockSieveUpper J B w h - (∏ g ∈ J, ∏ i ∈ B g, (1 - w i)) ≤ blockSieveCorrection J B w h := by have hs := block_sieve_sandwich J B w h hw hh dsimp only [blockSieveLower] at hs constructor <;> linarith [hs.1, hs.2] end end section open Finset theorem block_sieve_subset_product_level (J : Finset ℕ) (B : ℕ → Finset ℕ) (S : Finset ℕ) (h : ℕ) {z : ℝ} (hz : 1 ≤ z) (hdisj : (J : Set ℕ).PairwiseDisjoint B) (hprime : ∀ j ∈ J, ∀ p ∈ B j, p.Prime) (hsize : ∀ j ∈ J, ∀ p ∈ B j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hs : S ⊆ J.biUnion B) (hcard : ∀ j ∈ J, (S ∩ B j).card ≤ (j + 1) * h + 1) : Squarefree (∏ p ∈ S, p) ∧ (∏ p ∈ S, (p : ℝ)) ≤ z^(4 * (h : ℝ) + 2) := by have hp : ∀ p ∈ S, p.Prime := by intro p hpS obtain ⟨j, hj, hpB⟩ := mem_biUnion.mp (hs hpS) exact hprime j hj p hpB constructor · refine squarefree_prod_of_pairwise_isCoprime (fun p hpS q hqS hpq => ?_) (fun p hpS => (hp p hpS).squarefree) simp only [← Nat.coprime_iff_isRelPrime] exact (Nat.coprime_primes (hp p hpS) (hp q hqS)).mpr hpq · have heq : J.biUnion (fun j => S ∩ B j) = S := by ext p simp only [mem_biUnion, mem_inter] constructor · rintro ⟨j, _, hpS, _⟩ exact hpS · intro hpS obtain ⟨j, hj, hpB⟩ := mem_biUnion.mp (hs hpS) exact ⟨j, hj, hpS, hpB⟩ have hb := block_sieve_log_product_level J (fun j => S ∩ B j) (fun p => (p : ℝ)) h hz (fun i hi j hj hij => (hdisj hi hj hij).mono inter_subset_right inter_subset_right) (fun j hj p hpS => Nat.cast_pos.mpr (hprime j hj p (mem_inter.mp hpS).2).pos) (fun j hj p hpS => hsize j hj p (mem_inter.mp hpS).2) hcard rwa [heq] at hb theorem block_sieve_upper_coefficient_level (J : Finset ℕ) (B : ℕ → Finset ℕ) (S : Finset ℕ) (h : ℕ) {z : ℝ} (hz : 1 ≤ z) (hdisj : (J : Set ℕ).PairwiseDisjoint B) (hprime : ∀ j ∈ J, ∀ p ∈ B j, p.Prime) (hsize : ∀ j ∈ J, ∀ p ∈ B j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hc : blockSieveSubsetUpperCoefficient J B (fun j => (j + 1) * h) S ≠ 0) : Squarefree (∏ p ∈ S, p) ∧ (∏ p ∈ S, (p : ℝ)) ≤ z^(4 * (h : ℝ) + 2) := by obtain ⟨hs, hupper⟩ := (block_sieve_subset_upper_coefficient_ne_zero_iff _ _ _ _).mp hc apply block_sieve_subset_product_level J B S h hz hdisj hprime hsize hs intro j hj exact (hupper j hj).trans (Nat.le_succ _) theorem block_sieve_correction_coefficient_level (J : Finset ℕ) (B : ℕ → Finset ℕ) (S : Finset ℕ) (h jStar : ℕ) {z : ℝ} (hz : 1 ≤ z) (hdisj : (J : Set ℕ).PairwiseDisjoint B) (hprime : ∀ j ∈ J, ∀ p ∈ B j, p.Prime) (hsize : ∀ j ∈ J, ∀ p ∈ B j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hc : blockSieveSubsetCorrectionAt J B (fun j => (j + 1) * h) jStar S ≠ 0) : Squarefree (∏ p ∈ S, p) ∧ (∏ p ∈ S, (p : ℝ)) ≤ z^(4 * (h : ℝ) + 2) := by obtain ⟨hs, hcorr⟩ := (block_sieve_subset_correction_at_ne_zero_iff _ _ _ _ _).mp hc apply block_sieve_subset_product_level J B S h hz hdisj hprime hsize hs intro j hj by_cases heq : j = jStar · subst j exact hcorr.2.1.le · exact (hcorr.2.2 j hj heq).trans (Nat.le_succ _) theorem block_sieve_lower_coefficient_level (J : Finset ℕ) (B : ℕ → Finset ℕ) (S : Finset ℕ) (h : ℕ) {z : ℝ} (hz : 1 ≤ z) (hdisj : (J : Set ℕ).PairwiseDisjoint B) (hprime : ∀ j ∈ J, ∀ p ∈ B j, p.Prime) (hsize : ∀ j ∈ J, ∀ p ∈ B j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hc : blockSieveSubsetLowerCoefficient J B (fun j => (j + 1) * h) S ≠ 0) : Squarefree (∏ p ∈ S, p) ∧ (∏ p ∈ S, (p : ℝ)) ≤ z^(4 * (h : ℝ) + 2) := by obtain ⟨hs, hsupport⟩ := (block_sieve_subset_lower_coefficient_ne_zero_iff _ _ _ _).mp hc apply block_sieve_subset_product_level J B S h hz hdisj hprime hsize hs intro j hj rcases hsupport with hupper | ⟨jStar, hcorr, _⟩ · exact (hupper j hj).trans (Nat.le_succ _) · by_cases heq : j = jStar · subst j exact hcorr.2.1.le · exact (hcorr.2.2 j hj heq).trans (Nat.le_succ _) end section open Finset noncomputable def blockSieveModuli (P : Finset ℕ) (D : ℝ) : Finset ℕ := (Icc 1 ⌊D⌋₊).filter (fun d => d ∣ ∏ p ∈ P, p) theorem block_sieve_modulus_properties (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (D : ℝ) {d : ℕ} (hd : d ∈ blockSieveModuli P D) : 0 < d ∧ (d : ℝ) ≤ D ∧ Squarefree d ∧ d ∣ ∏ p ∈ P, p := by obtain ⟨hdrange, hdvd⟩ := mem_filter.mp hd obtain ⟨hd0, hdD⟩ := mem_Icc.mp hdrange have hsq : Squarefree (∏ p ∈ P, p) := by refine squarefree_prod_of_pairwise_isCoprime (fun p hp q hq hpq => ?_) (fun p hp => (hP p hp).squarefree) simp only [← Nat.coprime_iff_isRelPrime] exact (Nat.coprime_primes (hP p hp) (hP q hq)).mpr hpq exact ⟨hd0, (Nat.le_floor_iff' (Nat.ne_zero_of_lt hd0)).mp hdD, hsq.squarefree_of_dvd hdvd, hdvd⟩ theorem sieve_prime_subset_product_injective (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) : Set.InjOn (fun S : Finset ℕ => ∏ p ∈ S, p) P.powerset := by intro S hS T hT heq have hs : (∏ p ∈ S, p).primeFactors = S := Nat.primeFactors_prod (fun p hp => hP p ((mem_powerset.mp hS) hp)) have ht : (∏ p ∈ T, p).primeFactors = T := Nat.primeFactors_prod (fun p hp => hP p ((mem_powerset.mp hT) hp)) rw [← hs, ← ht] exact congrArg Nat.primeFactors heq theorem subset_remainder_le_modulus_sum (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (a : Finset ℕ → ℝ) (r : ℕ → ℝ) (D : ℝ) (hlevel : ∀ S ∈ P.powerset, a S ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D) : (∑ S ∈ P.powerset, if a S = 0 then 0 else |r (∏ p ∈ S, p)|) ≤ ∑ d ∈ blockSieveModuli P D, |r d| := by classical let F := P.powerset.filter (fun S => a S ≠ 0) have hinj : Set.InjOn (fun S : Finset ℕ => ∏ p ∈ S, p) F := (sieve_prime_subset_product_injective P hP).mono (filter_subset _ _) have hsubset : F.image (fun S => ∏ p ∈ S, p) ⊆ blockSieveModuli P D := by intro d hd obtain ⟨S, hS, rfl⟩ := mem_image.mp hd apply mem_filter.mpr refine ⟨mem_Icc.mpr ⟨?_, Nat.le_floor (hlevel S (mem_filter.mp hS).1 (mem_filter.mp hS).2)⟩, ?_⟩ · exact prod_pos (fun p hp => (hP p ((mem_powerset.mp (mem_filter.mp hS).1) hp)).pos) · exact prod_dvd_prod_of_subset S P (fun p => p) (mem_powerset.mp (mem_filter.mp hS).1) calc _ = ∑ S ∈ F, |r (∏ p ∈ S, p)| := by rw [sum_filter] apply sum_congr rfl intro S _ by_cases hzero : a S = 0 <;> simp [hzero] _ = ∑ d ∈ F.image (fun S => ∏ p ∈ S, p), |r d| := (sum_image (f := fun d => |r d|) hinj).symm _ ≤ _ := sum_le_sum_of_subset_of_nonneg hsubset (fun d _ _ => abs_nonneg (r d)) theorem subset_polynomial_average_error_level {Ω : Type*} (P : Finset ℕ) (T : Finset Ω) (a : Finset ℕ → ℝ) (r : ℕ → ℝ) (μ : Ω → ℝ) (x : Ω → ℕ → ℝ) (g : ℕ → ℝ) (X D : ℝ) (hP : ∀ p ∈ P, p.Prime) (ha : ∀ S ∈ P.powerset, |a S| ≤ 1) (hlevel : ∀ S ∈ P.powerset, a S ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D) (hmoment : ∀ S ∈ P.powerset, (∑ t ∈ T, μ t * ∏ p ∈ S, x t p) = X * (∏ p ∈ S, g p) + r (∏ p ∈ S, p)) : |(∑ t ∈ T, μ t * subsetPolynomial P a (x t)) - X * subsetPolynomial P a g| ≤ ∑ d ∈ blockSieveModuli P D, |r d| := by exact (subset_polynomial_average_error P T a (fun S => r (∏ p ∈ S, p)) μ x g X ha hmoment).trans (subset_remainder_le_modulus_sum P hP a r D hlevel) end section open Finset theorem exists_dyadic_log_band {p z : ℝ} (hp : 1 < p) (hpz : p ≤ z) : ∃ j : ℕ, Real.log z / (2 : ℝ)^(j + 1) < Real.log p ∧ Real.log p ≤ Real.log z / (2 : ℝ)^j := by have hlp : 0 < Real.log p := Real.log_pos hp have hlpz : Real.log p ≤ Real.log z := Real.log_le_log (by linarith) hpz have hx : 1 ≤ Real.log z / Real.log p := (le_div_iff₀ hlp).mpr (by simpa) obtain ⟨j, hlo, hhi⟩ := exists_nat_pow_near hx (by norm_num : (1 : ℝ) < 2) refine ⟨j, (div_lt_iff₀ (by positivity)).mpr ?_, (le_div_iff₀ (by positivity)).mpr ?_⟩ · simpa only [mul_comm] using (div_lt_iff₀ hlp).mp hhi · simpa only [mul_comm] using (le_div_iff₀ hlp).mp hlo theorem exists_dyadic_sieve_blocks_log (P : Finset ℕ) {z : ℝ} (hP : ∀ p ∈ P, p.Prime) (hPz : ∀ p ∈ P, (p : ℝ) ≤ z) : ∃ (J : Finset ℕ) (B : ℕ → Finset ℕ), J.biUnion B = P ∧ (J : Set ℕ).PairwiseDisjoint B ∧ (∀ j, B j ⊆ P) ∧ (∀ j ∈ J, ∀ p ∈ B j, Real.log z / (2 : ℝ)^(j + 1) < Real.log (p : ℝ) ∧ Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) := by classical have hex : ∀ p : ℕ, ∃ j : ℕ, p ∉ P ∨ (Real.log z / (2 : ℝ)^(j + 1) < Real.log (p : ℝ) ∧ Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) := by intro p by_cases hp : p ∈ P · obtain ⟨j, hj⟩ := exists_dyadic_log_band (by exact_mod_cast (hP p hp).one_lt) (hPz p hp) exact ⟨j, Or.inr hj⟩ · exact ⟨0, Or.inl hp⟩ choose f hf using hex refine ⟨P.image f, (fun j => P.filter (fun p => f p = j)), ?_, ?_, ?_, ?_⟩ · ext p constructor · intro hp obtain ⟨j, _, hp⟩ := mem_biUnion.mp hp exact (mem_filter.mp hp).1 · intro hp exact mem_biUnion.mpr ⟨f p, mem_image.mpr ⟨p, hp, rfl⟩, mem_filter.mpr ⟨hp, rfl⟩⟩ · exact Set.pairwiseDisjoint_filter f _ P · intro j exact filter_subset _ _ · intro j _ p hp obtain ⟨hp, hj⟩ := mem_filter.mp hp exact hj ▸ (hf p).resolve_left (fun hnot => hnot hp) end section open Finset theorem dyadic_sieve_block_mass (P B : Finset ℕ) (g : ℕ → ℝ) {z C : ℝ} (hz : 1 < z) (j : ℕ) (hP : ∀ p ∈ P, p.Prime) (hg : ∀ p ∈ P, 0 ≤ g p) (hB : B ⊆ P) (hlo : ∀ p ∈ B, Real.log z / (2 : ℝ)^(j + 1) < Real.log (p : ℝ)) (hhi : ∀ p ∈ B, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hshell : ∀ w : ℝ, 1 < w → (∑ p ∈ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2), g p) ≤ C) : (∑ p ∈ B, g p) ≤ C := by let w := Real.exp (Real.log z / (2 : ℝ)^(j + 1)) have hw : 1 < w := Real.one_lt_exp_iff.mpr (div_pos (Real.log_pos hz) (by positivity)) have hsquare : w^2 = Real.exp (Real.log z / (2 : ℝ)^j) := by dsimp only [w] rw [pow_two, ← Real.exp_add] congr 1 rw [pow_succ] field_simp ring have hsubset : B ⊆ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2) := by intro p hp have hp0 : (0 : ℝ) < p := Nat.cast_pos.mpr (hP p (hB hp)).pos refine mem_filter.mpr ⟨hB hp, ?_, ?_⟩ · simpa only [Real.exp_log hp0] using Real.exp_lt_exp.mpr (hlo p hp) · rw [hsquare] simpa only [Real.exp_log hp0] using Real.exp_le_exp.mpr (hhi p hp) exact (sum_le_sum_of_subset_of_nonneg hsubset (fun p hp _ => hg p (mem_filter.mp hp).1)).trans (hshell w hw) end section open Finset section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V ρ : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) (cap : ℕ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] noncomputable def physicalJointCappedVisitKernel (j : ℕ) : ((p : PhysicalPrime P) → GhostPhaseState (ZMod p.2.val)) → ((p : PhysicalPrime P) → GhostPhaseState (ZMod p.2.val)) → ℝ := ghostPhaseCappedDampedVisit (fun p => globalBirthFiniteActivity (physicalGroupBareFiniteActivity L p.1) j p.2) (fun _ => 0) (fun p => η p.1 (globalBirthFiniteIndex n j)) (fun p => β p.1 p.2) (fun p => ρ p.1) cap noncomputable def physicalJointCappedMovingEdgeKernel (j : ℕ) : ((p : PhysicalPrime P) → GhostPhaseState (ZMod p.2.val)) → ((p : PhysicalPrime P) → GhostPhaseState (ZMod p.2.val)) → ℝ := ghostPhaseCappedDampedMovingEdge (fun p => globalBirthFiniteActivity (physicalGroupBareFiniteActivity L p.1) (j + 1) p.2) (fun p => globalBirthFiniteActivity (physicalGroupBareFiniteActivity L p.1) j p.2) (fun p => physicalResidueAbsoluteHit a p.1 p.2 (j + 1) - physicalResidueAbsoluteHit a p.1 p.2 j) (fun p => β p.1 p.2) (fun p => V p.1) (fun p => ρ p.1) (fun p => ρ p.1) cap end ResiduePath end section open Finset open scoped Classical section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, DecidableEq (R g p)] {a b : (g : Fin N) → P g → Bool} end Joint end section open Finset Classical abbrev SharedActiveLabels {G : Type*} (P : G → Type*) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) := ∀ g, Fin (S g).card → P g noncomputable def productActiveMemorySplit {G : Type*} {P Z : G → Type*} {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) : ProductBoundedOrderedState P Z M B ≃ SharedActiveLabels P S × ProductBoundedOrderedState P Z (fun g => (S g)ᶜ.card) B where toFun x := (fun g => (activeMemorySplit (S g) B (x g)).1, fun g => (activeMemorySplit (S g) B (x g)).2) invFun y := fun g => (activeMemorySplit (S g) B).symm (y.1 g, y.2 g) left_inv x := by funext g exact (activeMemorySplit (S g) B).symm_apply_apply (x g) right_inv y := by apply Prod.ext · funext g exact congrArg Prod.fst ((activeMemorySplit (S g) B).apply_symm_apply (y.1 g, y.2 g)) · funext g exact congrArg Prod.snd ((activeMemorySplit (S g) B).apply_symm_apply (y.1 g, y.2 g)) noncomputable def sharedActiveWeight {G : Type*} [Fintype G] {P : G → Type*} {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (μ : ∀ g, P g → ℝ) (c : SharedActiveLabels P S) : ℝ := ∏ g, ∏ i, μ g (c g i) theorem sharedActiveWeight_nonneg {G : Type*} [Fintype G] {P : G → Type*} {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (μ : ∀ g, P g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (c : SharedActiveLabels P S) : 0 ≤ sharedActiveWeight S μ c := prod_nonneg fun g _ => prod_nonneg fun _i _ => hμ g _ section variable {G : Type*} [sharedInstance1 : Fintype G] {P Z : G → Type*} {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) include G sharedInstance1 P Z M S B theorem productActiveMemorySplit_weight (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (x : ProductBoundedOrderedState P Z M B) : productMemoryWeight μ ν x = sharedActiveWeight S μ (productActiveMemorySplit S B x).1 * productMemoryWeight μ ν (productActiveMemorySplit S B x).2 := by unfold productMemoryWeight sharedActiveWeight simp_rw [activeMemorySplit_weight (S _) B] exact prod_mul_distrib theorem productActiveMemorySplit_weight_symm (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (c : SharedActiveLabels P S) (y : ProductBoundedOrderedState P Z (fun g => (S g)ᶜ.card) B) : productMemoryWeight μ ν ((productActiveMemorySplit S B).symm (c, y)) = sharedActiveWeight S μ c * productMemoryWeight μ ν y := by rw [productActiveMemorySplit_weight S B μ ν, Equiv.apply_symm_apply] theorem productActiveMemorySplit_total_memory (x : ProductBoundedOrderedState P Z M B) : productTotalMemory (productActiveMemorySplit S B x).2 = productTotalMemory x := by apply sum_congr rfl intro g _ rfl theorem productActiveMemorySplit_total_memory_symm (c : SharedActiveLabels P S) (y : ProductBoundedOrderedState P Z (fun g => (S g)ᶜ.card) B) : productTotalMemory ((productActiveMemorySplit S B).symm (c, y)) = productTotalMemory y := by have h := productActiveMemorySplit_total_memory S B ((productActiveMemorySplit S B).symm (c, y)) simpa only [Equiv.apply_symm_apply] using h.symm end section variable {G : Type*} [sharedInstance1 : DecidableEq G] {P Z : G → Type*} {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) include G sharedInstance1 P Z M S B theorem productActiveMemorySplit_symm_permute (c : SharedActiveLabels P S) (y : ProductBoundedOrderedState P Z (fun g => (S g)ᶜ.card) B) (g : G) (τ : Equiv.Perm (Fin (y g).2.1.val)) : (productActiveMemorySplit S B).symm (c, productMemoryPermuteAt y g τ) = productMemoryPermuteAt ((productActiveMemorySplit S B).symm (c, y)) g τ := by funext h by_cases hh : h = g · subst h change (activeMemorySplit (S g) B).symm (c g, (productMemoryPermuteAt y g τ) g) = _ simp only [productMemoryPermuteAt, Function.update_self] rfl · change (activeMemorySplit (S h) B).symm (c h, (productMemoryPermuteAt y g τ) h) = _ simp only [productMemoryPermuteAt, Function.update_of_ne hh] rfl theorem productActiveMemorySlice_symmetric (f : ProductBoundedOrderedState P Z M B → ℂ) (hf : ProductMemorySymmetric f) (c : SharedActiveLabels P S) : ProductMemorySymmetric (equivFiberSlice (productActiveMemorySplit S B) f c) := by intro y g τ unfold equivFiberSlice rw [productActiveMemorySplit_symm_permute] exact hf ((productActiveMemorySplit S B).symm (c, y)) g τ theorem productActiveMemorySplit_permute (x : ProductBoundedOrderedState P Z M B) (g : G) (τ : Equiv.Perm (Fin (x g).2.1.val)) : productActiveMemorySplit S B (productMemoryPermuteAt x g τ) = ((productActiveMemorySplit S B x).1, productMemoryPermuteAt (productActiveMemorySplit S B x).2 g τ) := by apply Prod.ext · funext h change (activeMemorySplit (S h) B ((productMemoryPermuteAt x g τ) h)).1 = _ by_cases hh : h = g · subst h simp only [productMemoryPermuteAt, Function.update_self] rfl · simp only [productMemoryPermuteAt, Function.update_of_ne hh] rfl · funext h change (activeMemorySplit (S h) B ((productMemoryPermuteAt x g τ) h)).2 = _ by_cases hh : h = g · subst h simp only [productMemoryPermuteAt, Function.update_self] rfl · simp only [productMemoryPermuteAt, Function.update_of_ne hh] rfl end end section open Finset Classical end section open scoped BigOperators Classical theorem finite_weighted_mean_selfadjoint {X : Type*} [Fintype X] (μ : X → ℝ) (f g : X → ℂ) : (∑ x, (μ x : ℂ) * ((starRingEnd ℂ) (∑ y, (μ y : ℂ) * f y) * g x)) = ∑ x, (μ x : ℂ) * ((starRingEnd ℂ) (f x) * ∑ y, (μ y : ℂ) * g y) := by calc _ = (starRingEnd ℂ) (∑ y, (μ y : ℂ) * f y) * ∑ x, (μ x : ℂ) * g x := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ ring _ = _ := by rw [map_sum, Finset.sum_mul] apply Finset.sum_congr rfl intro x _ simp only [map_mul, Complex.conj_ofReal, mul_assoc] theorem finite_coordinate_average_selfadjoint {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i : I) (f g : (∀ j, X j) → ℂ) : (∑ x, (finiteProductWeight μ x : ℂ) * ((starRingEnd ℂ) (finiteCoordinateAverage μ i f x) * g x)) = ∑ x, (finiteProductWeight μ x : ℂ) * ((starRingEnd ℂ) (f x) * finiteCoordinateAverage μ i g x) := by rw [finite_product_expectation_split μ i, finite_product_expectation_split μ i] apply Finset.sum_congr rfl intro z _ congr 1 simp only [finite_coordinate_average_split] exact finite_weighted_mean_selfadjoint (μ i) (fun y => f ((Equiv.piSplitAt i X).symm (y, z))) (fun y => g ((Equiv.piSplitAt i X).symm (y, z))) section variable {I : Type*} [sharedInstance1 : DecidableEq I] {X : I → Type*} [sharedInstance3 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i : I) include I sharedInstance1 X sharedInstance3 μ i theorem finite_coordinate_average_sub (f g : (∀ j, X j) → ℂ) : finiteCoordinateAverage μ i (f - g) = finiteCoordinateAverage μ i f - finiteCoordinateAverage μ i g := by funext x simp only [finite_coordinate_average_update, Pi.sub_apply, mul_sub, Finset.sum_sub_distrib] theorem finite_coordinate_average_complement_zero (hmass : ∑ y, μ i y = 1) (f : (∀ j, X j) → ℂ) : finiteCoordinateAverage μ i (f - finiteCoordinateAverage μ i f) = 0 := by rw [finite_coordinate_average_sub, finite_coordinate_average_idempotent μ i hmass, sub_self] end end section open Finset theorem sum_subsets_disjoint_blocks_product {G α : Type*} [Fintype G] [DecidableEq α] (B : G → Finset α) (F : G → Finset α → ℝ) (hdisj : Pairwise (fun g k => Disjoint (B g) (B k))) : (∑ S ∈ (univ.biUnion B).powerset, ∏ g, F g (S ∩ B g)) = ∏ g, ∑ S ∈ (B g).powerset, F g S := by classical let Pool := univ.biUnion B let forward : Pool.powerset → ∀ g, (B g).powerset := fun S g => ⟨S.val ∩ B g, mem_powerset.mpr inter_subset_right⟩ let backward : (∀ g, (B g).powerset) → Pool.powerset := fun x => ⟨univ.biUnion (fun g => (x g).val), mem_powerset.mpr (by intro p hp obtain ⟨g, hg, hpg⟩ := mem_biUnion.mp hp exact mem_biUnion.mpr ⟨g, hg, (mem_powerset.mp (x g).property) hpg⟩)⟩ have hleft : Function.LeftInverse backward forward := by intro S apply Subtype.ext ext p change p ∈ univ.biUnion (fun g => S.val ∩ B g) ↔ p ∈ S.val constructor · intro hp obtain ⟨g, _, hpg⟩ := mem_biUnion.mp hp exact (mem_inter.mp hpg).1 · intro hp obtain ⟨g, hg, hpg⟩ := mem_biUnion.mp ((mem_powerset.mp S.property) hp) exact mem_biUnion.mpr ⟨g, hg, mem_inter.mpr ⟨hp, hpg⟩⟩ have hright : Function.RightInverse backward forward := by intro x funext g apply Subtype.ext ext p change p ∈ (univ.biUnion (fun k => (x k).val)) ∩ B g ↔ p ∈ (x g).val constructor · intro hp obtain ⟨hpU, hpB⟩ := mem_inter.mp hp obtain ⟨k, _, hpk⟩ := mem_biUnion.mp hpU by_cases hkg : k = g · subst k exact hpk · exact (disjoint_left.mp (hdisj hkg) ((mem_powerset.mp (x k).property) hpk) hpB).elim · intro hp exact mem_inter.mpr ⟨mem_biUnion.mpr ⟨g, mem_univ g, hp⟩, (mem_powerset.mp (x g).property) hp⟩ let e : Pool.powerset ≃ (∀ g, (B g).powerset) := ⟨forward, backward, hleft, hright⟩ calc _ = ∑ S : Pool.powerset, ∏ g, F g (S.val ∩ B g) := (sum_coe_sort Pool.powerset _).symm _ = ∑ x : ∀ g, (B g).powerset, ∏ g, F g (x g).val := Fintype.sum_equiv e _ _ (fun _ => rfl) _ = ∏ g, ∑ S : (B g).powerset, F g S.val := (Fintype.prod_sum (fun g (S : (B g).powerset) => F g S.val)).symm _ = _ := prod_congr rfl (fun g _ => sum_coe_sort (B g).powerset (F g)) theorem sum_subsets_disjoint_finset_blocks_product {G α : Type*} [DecidableEq α] (J : Finset G) (B : G → Finset α) (F : G → Finset α → ℝ) (hdisj : (J : Set G).PairwiseDisjoint B) : (∑ S ∈ (J.biUnion B).powerset, ∏ g ∈ J, F g (S ∩ B g)) = ∏ g ∈ J, ∑ S ∈ (B g).powerset, F g S := by classical have hd : Pairwise (fun g k : J => Disjoint (B g.val) (B k.val)) := by intro g k hne exact hdisj g.property k.property (fun he => hne (Subtype.ext he)) have he : univ.biUnion (fun g : J => B g.val) = J.biUnion B := by ext p simp only [mem_biUnion, mem_univ, true_and, Subtype.exists, exists_prop] have hh := sum_subsets_disjoint_blocks_product (fun g : J => B g.val) (fun g : J => F g.val) hd rw [he] at hh have hp (S : Finset α) : (∏ g : J, F g.val (S ∩ B g.val)) = ∏ g ∈ J, F g (S ∩ B g) := prod_coe_sort J (fun g => F g (S ∩ B g)) simp_rw [hp] at hh rw [prod_coe_sort J (fun g => ∑ S ∈ (B g).powerset, F g S)] at hh exact hh theorem block_sieve_subset_monomial_factor {G α : Type*} [DecidableEq α] (J : Finset G) (B : G → Finset α) (w : α → ℝ) (S : Finset α) (hdisj : (J : Set G).PairwiseDisjoint B) (hs : S ⊆ J.biUnion B) : (∏ g ∈ J, ∏ p ∈ S ∩ B g, w p) = ∏ p ∈ S, w p := by classical have he : J.biUnion (fun g => S ∩ B g) = S := by ext p simp only [mem_biUnion, mem_inter] constructor · rintro ⟨g, _, hp, _⟩ exact hp · intro hp obtain ⟨g, hg, hpg⟩ := mem_biUnion.mp (hs hp) exact ⟨g, hg, hp, hpg⟩ have hd : (J : Set G).PairwiseDisjoint (fun g => S ∩ B g) := by intro i hi j hj hij exact (hdisj hi hj hij).mono inter_subset_right inter_subset_right rw [← prod_biUnion hd, he] theorem exclusion_truncation_eq_subset_sum {α : Type*} [DecidableEq α] (B : Finset α) (w : α → ℝ) (h : ℕ) : exclusionTruncation B w (h + 1) = ∑ S ∈ B.powerset, if S.card ≤ h then (-1 : ℝ)^S.card * ∏ p ∈ S, w p else 0 := by classical unfold exclusionTruncation simp_rw [exclusionElementary, powersetCard_eq_filter, sum_filter, mul_sum, mul_ite, mul_zero] rw [sum_comm] simp [mem_range] theorem block_sieve_upper_atom_factor {G α : Type*} [DecidableEq α] (J : Finset G) (B : G → Finset α) (w : α → ℝ) (h : G → ℕ) (S : Finset α) (hdisj : (J : Set G).PairwiseDisjoint B) (hs : S ⊆ J.biUnion B) : blockSieveSubsetUpperCoefficient J B h S * (∏ p ∈ S, w p) = ∏ g ∈ J, if (S ∩ B g).card ≤ h g then (-1 : ℝ)^((S ∩ B g).card) * (∏ p ∈ S ∩ B g, w p) else 0 := by classical by_cases hu : blockSieveUpperSupport J h (blockSieveOccupancy B S) · have hp : (∏ g ∈ J, if (S ∩ B g).card ≤ h g then (-1 : ℝ)^((S ∩ B g).card) * (∏ p ∈ S ∩ B g, w p) else 0) = ∏ g ∈ J, (-1 : ℝ)^(blockSieveOccupancy B S g) * (∏ p ∈ S ∩ B g, w p) := by apply prod_congr rfl intro g hg exact if_pos (hu g hg) rw [hp, prod_mul_distrib, prod_pow_eq_pow_sum, block_sieve_occupancy_sum_eq_card J B S hdisj hs, block_sieve_subset_monomial_factor J B w S hdisj hs, block_sieve_subset_upper_coefficient_eq J B h S hdisj hs hu] · have hz : blockSieveSubsetUpperCoefficient J B h S = 0 := by apply not_ne_iff.mp exact fun hn => hu ((block_sieve_subset_upper_coefficient_ne_zero_iff J B h S).mp hn).2 rw [hz, zero_mul] symm have hbad : ∃ g ∈ J, ¬blockSieveOccupancy B S g ≤ h g := by simpa only [blockSieveUpperSupport, not_forall, not_le, exists_prop] using hu obtain ⟨g, hg, hng⟩ := hbad apply prod_eq_zero hg exact if_neg hng theorem block_sieve_upper_expansion {G α : Type*} [DecidableEq α] (J : Finset G) (B : G → Finset α) (w : α → ℝ) (h : G → ℕ) (hdisj : (J : Set G).PairwiseDisjoint B) : blockSieveUpper J B w h = ∑ S ∈ (J.biUnion B).powerset, blockSieveSubsetUpperCoefficient J B h S * ∏ p ∈ S, w p := by symm calc _ = ∑ S ∈ (J.biUnion B).powerset, ∏ g ∈ J, if (S ∩ B g).card ≤ h g then (-1 : ℝ)^((S ∩ B g).card) * (∏ p ∈ S ∩ B g, w p) else 0 := by apply sum_congr rfl intro S hS exact block_sieve_upper_atom_factor J B w h S hdisj (mem_powerset.mp hS) _ = ∏ g ∈ J, ∑ S ∈ (B g).powerset, if S.card ≤ h g then (-1 : ℝ)^S.card * (∏ p ∈ S, w p) else 0 := sum_subsets_disjoint_finset_blocks_product J B (fun g S => if S.card ≤ h g then (-1 : ℝ)^S.card * (∏ p ∈ S, w p) else 0) hdisj _ = _ := prod_congr rfl (fun g _ => (exclusion_truncation_eq_subset_sum (B g) w (h g)).symm) theorem exclusion_elementary_eq_subset_sum {α : Type*} [DecidableEq α] (B : Finset α) (w : α → ℝ) (k : ℕ) : exclusionElementary B w k = ∑ S ∈ B.powerset, if S.card = k then ∏ p ∈ S, w p else 0 := by simp only [exclusionElementary, powersetCard_eq_filter, sum_filter] theorem block_sieve_correction_atom_factor {G α : Type*} [DecidableEq G] [DecidableEq α] (J : Finset G) (B : G → Finset α) (w : α → ℝ) (h : G → ℕ) (j : G) (S : Finset α) (hdisj : (J : Set G).PairwiseDisjoint B) (hj : j ∈ J) (hs : S ⊆ J.biUnion B) : blockSieveSubsetCorrectionAt J B h j S * (∏ p ∈ S, w p) = ∏ g ∈ J, if g = j then (if (S ∩ B g).card = h g + 1 then ∏ p ∈ S ∩ B g, w p else 0) else (if (S ∩ B g).card ≤ h g then (-1 : ℝ)^((S ∩ B g).card) * (∏ p ∈ S ∩ B g, w p) else 0) := by classical let n := blockSieveOccupancy B S let m : G → ℝ := fun g => ∏ p ∈ S ∩ B g, w p have hm : m j * (∏ g ∈ J.erase j, m g) = ∏ p ∈ S, w p := by rw [mul_prod_erase J m hj] exact block_sieve_subset_monomial_factor J B w S hdisj hs change _ = ∏ g ∈ J, if g = j then (if n g = h g + 1 then m g else 0) else (if n g ≤ h g then (-1 : ℝ)^(n g) * m g else 0) by_cases hc : blockSieveCorrectionSupport J h n j · have hcoef : blockSieveSubsetCorrectionAt J B h j S = (-1 : ℝ)^(∑ g ∈ J.erase j, n g) := by dsimp only [n] at hc ⊢ simp only [blockSieveSubsetCorrectionAt, if_pos hs, blockSieveCorrectionAt, if_pos hc] congr 1 apply sum_congr · ext g simp only [mem_erase] · intro g _ rfl rw [hcoef, ← mul_prod_erase J _ hj, if_pos rfl, if_pos hc.2.1] have hrest : (∏ g ∈ J.erase j, if g = j then (if n g = h g + 1 then m g else 0) else (if n g ≤ h g then (-1 : ℝ)^(n g) * m g else 0)) = ∏ g ∈ J.erase j, (-1 : ℝ)^(n g) * m g := by apply prod_congr rfl intro g hg rw [if_neg (mem_erase.mp hg).1, if_pos (hc.2.2 g (mem_erase.mp hg).2 (mem_erase.mp hg).1)] rw [hrest, prod_mul_distrib, prod_pow_eq_pow_sum, ← hm] ring · have hcoef : blockSieveSubsetCorrectionAt J B h j S = 0 := by dsimp only [n] at hc simp only [blockSieveSubsetCorrectionAt, if_pos hs, blockSieveCorrectionAt, if_neg hc] rw [hcoef, zero_mul] symm by_cases hjc : n j = h j + 1 · have hex : ∃ g ∈ J, g ≠ j ∧ ¬n g ≤ h g := by by_contra hn apply hc refine ⟨hj, hjc, ?_⟩ intro g hg hgj by_contra hb exact hn ⟨g, hg, hgj, hb⟩ obtain ⟨g, hg, hgj, hbad⟩ := hex apply prod_eq_zero hg rw [if_neg hgj, if_neg hbad] · apply prod_eq_zero hj rw [if_pos rfl, if_neg hjc] theorem block_sieve_correction_at_expansion {G α : Type*} [DecidableEq G] [DecidableEq α] (J : Finset G) (B : G → Finset α) (w : α → ℝ) (h : G → ℕ) (j : G) (hdisj : (J : Set G).PairwiseDisjoint B) (hj : j ∈ J) : exclusionElementary (B j) w (h j + 1) * (∏ g ∈ J.erase j, exclusionTruncation (B g) w (h g + 1)) = ∑ S ∈ (J.biUnion B).powerset, blockSieveSubsetCorrectionAt J B h j S * ∏ p ∈ S, w p := by classical symm let F : G → Finset α → ℝ := fun g S => if g = j then (if S.card = h g + 1 then ∏ p ∈ S, w p else 0) else (if S.card ≤ h g then (-1 : ℝ)^S.card * (∏ p ∈ S, w p) else 0) calc _ = ∑ S ∈ (J.biUnion B).powerset, ∏ g ∈ J, F g (S ∩ B g) := by apply sum_congr rfl intro S hS exact block_sieve_correction_atom_factor J B w h j S hdisj hj (mem_powerset.mp hS) _ = ∏ g ∈ J, ∑ S ∈ (B g).powerset, F g S := sum_subsets_disjoint_finset_blocks_product J B F hdisj _ = exclusionElementary (B j) w (h j + 1) * (∏ g ∈ J.erase j, exclusionTruncation (B g) w (h g + 1)) := by rw [← mul_prod_erase J (fun g => ∑ S ∈ (B g).powerset, F g S) hj] apply congrArg₂ (· * ·) · simp only [F, if_pos rfl, ← exclusion_elementary_eq_subset_sum] · apply prod_congr rfl intro g hg simp only [F, if_neg (mem_erase.mp hg).1, ← exclusion_truncation_eq_subset_sum] theorem block_sieve_lower_expansion {G α : Type*} [DecidableEq α] (J : Finset G) (B : G → Finset α) (w : α → ℝ) (h : G → ℕ) (hdisj : (J : Set G).PairwiseDisjoint B) : blockSieveLower J B w h = ∑ S ∈ (J.biUnion B).powerset, blockSieveSubsetLowerCoefficient J B h S * ∏ p ∈ S, w p := by classical rw [block_sieve_subset_weighted_expansion, blockSieveLower, block_sieve_upper_expansion J B w h hdisj] apply congrArg₂ (· - ·) rfl apply sum_congr rfl intro j hj exact block_sieve_correction_at_expansion J B w h j hdisj hj end section open Finset noncomputable def blockSieveRelativeTailConstant (C η : ℝ) : ℝ := Real.exp (C / η) * (Real.exp (C * Real.exp 1) / (1 - Real.exp (-1))) noncomputable def blockSieveModelErrorConstant (C η : ℝ) : ℝ := blockSieveRelativeTailConstant C η * Real.exp (blockSieveRelativeTailConstant C η) theorem block_sieve_relative_tail_constant_pos (C η : ℝ) : 0 < blockSieveRelativeTailConstant C η := by unfold blockSieveRelativeTailConstant apply mul_pos (Real.exp_pos _) (div_pos (Real.exp_pos _) _) exact sub_pos.mpr (Real.exp_lt_one_iff.mpr (by norm_num)) theorem block_sieve_model_error_constant_pos (C η : ℝ) : 0 < blockSieveModelErrorConstant C η := mul_pos (block_sieve_relative_tail_constant_pos C η) (Real.exp_pos _) theorem block_sieve_relative_sum_bound {ι : Type*} {C η : ℝ} (hη : 0 < η) (hC : 0 ≤ C) {h : ℕ} (hh : 1 ≤ h) (J : Finset ℕ) (B : ℕ → Finset ι) (w : ι → ℝ) (hw : ∀ j ∈ J, ∀ i ∈ B j, 0 ≤ w i ∧ w i ≤ 1 - η) (hsum : ∀ j ∈ J, (∑ i ∈ B j, w i) ≤ C) : (∑ j ∈ J, exclusionElementary (B j) w ((j + 1)*h + 1) / (∏ i ∈ B j, (1 - w i))) ≤ blockSieveRelativeTailConstant C η * Real.exp (-(h : ℝ)) := by calc _ ≤ ∑ j ∈ J, Real.exp (C / η) * (C^((j + 1)*h + 1) / (((j + 1)*h + 1).factorial : ℝ)) := by apply sum_le_sum intro j hj exact block_sieve_relative_error_bound (B j) w hη hC (hw j hj) (hsum j hj) _ _ = Real.exp (C / η) * (∑ j ∈ J, C^((j + 1)*h + 1) / (((j + 1)*h + 1).factorial : ℝ)) := (mul_sum ..).symm _ ≤ Real.exp (C / η) * ((Real.exp (C * Real.exp 1) / (1 - Real.exp (-1))) * Real.exp (-(h : ℝ))) := mul_le_mul_of_nonneg_left (block_sieve_factorial_tail_bound hC hh J) (Real.exp_pos _).le _ = _ := by unfold blockSieveRelativeTailConstant; ring theorem block_sieve_model_bounds {ι : Type*} {C η : ℝ} (hη : 0 < η) (hC : 0 ≤ C) {h : ℕ} (hh : 1 ≤ h) (heven : Even h) (J : Finset ℕ) (B : ℕ → Finset ι) (w : ι → ℝ) (hw : ∀ j ∈ J, ∀ i ∈ B j, 0 ≤ w i ∧ w i ≤ 1 - η) (hsum : ∀ j ∈ J, (∑ i ∈ B j, w i) ≤ C) : let A := ∏ j ∈ J, ∏ i ∈ B j, (1 - w i) let cap := fun j => (j + 1)*h let err := A * blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) 0 ≤ blockSieveCorrection J B w cap ∧ blockSieveCorrection J B w cap ≤ err ∧ |blockSieveUpper J B w cap - A| ≤ err ∧ |blockSieveLower J B w cap - A| ≤ err := by classical dsimp only have hdec : (fun a b : ℕ => Classical.propDecidable (a = b)) = instDecidableEqNat := Subsingleton.elim _ _ let a := fun j => ∏ i ∈ B j, (1 - w i) let e := fun j => exclusionElementary (B j) w ((j + 1)*h + 1) let u := fun j => exclusionTruncation (B j) w ((j + 1)*h + 1) let R := ∑ j ∈ J, e j / a j let K₀ := blockSieveRelativeTailConstant C η have hcorr_eq : blockSieveCorrection J B w (fun j => (j + 1)*h) = ∑ j ∈ J, e j * ∏ k ∈ J.erase j, u k := by unfold blockSieveCorrection rw [hdec] have hw1 : ∀ j ∈ J, ∀ i ∈ B j, 0 ≤ w i ∧ w i ≤ 1 := by intro j hj i hi exact ⟨(hw j hj i hi).1, by linarith [(hw j hj i hi).2]⟩ have hc : ∀ j ∈ J, Even ((j + 1)*h) := fun j _ => heven.mul_left (j + 1) have ha : ∀ j ∈ J, 0 < a j := by intro j hj apply prod_pos intro i hi linarith [(hw j hj i hi).2] have hloc : ∀ j ∈ J, 0 ≤ u j ∧ a j ≤ u j ∧ u j - a j ≤ e j := by intro j hj exact block_sieve_local_bounds (B j) w (hw1 j hj) (hc j hj) have he : ∀ j ∈ J, 0 ≤ e j := by intro j hj linarith [(hloc j hj).2.1, (hloc j hj).2.2] have hA : 0 ≤ ∏ j ∈ J, a j := prod_nonneg (fun j hj => (ha j hj).le) have hR0 : 0 ≤ R := sum_nonneg (fun j hj => div_nonneg (he j hj) (ha j hj).le) have hR : R ≤ K₀ * Real.exp (-(h : ℝ)) := block_sieve_relative_sum_bound hη hC hh J B w hw hsum have hdecay : Real.exp (-(h : ℝ)) ≤ 1 := Real.exp_le_one_iff.mpr (neg_nonpos.mpr (Nat.cast_nonneg h)) have hK₀ : 0 ≤ K₀ := (block_sieve_relative_tail_constant_pos C η).le have hRK : R ≤ K₀ := hR.trans (mul_le_of_le_one_right hK₀ hdecay) have hRexp : R * Real.exp R ≤ blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) := by calc _ ≤ (K₀ * Real.exp (-(h : ℝ))) * Real.exp K₀ := mul_le_mul hR (Real.exp_le_exp.mpr hRK) (Real.exp_pos _).le (mul_nonneg hK₀ (Real.exp_pos _).le) _ = _ := by unfold blockSieveModelErrorConstant; dsimp [K₀]; ring have hcorr0 : 0 ≤ blockSieveCorrection J B w (fun j => (j + 1)*h) := by have hraw : 0 ≤ ∑ j ∈ J, e j * ∏ k ∈ J.erase j, u k := by apply sum_nonneg intro j hj exact mul_nonneg (he j hj) (prod_nonneg (fun k hk => (hloc k (mem_of_mem_erase hk)).1)) rw [hcorr_eq] exact hraw have hcorr : blockSieveCorrection J B w (fun j => (j + 1)*h) ≤ (∏ j ∈ J, a j) * blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) := by calc _ ≤ (∏ j ∈ J, a j) * R * Real.exp R := by rw [hcorr_eq] exact block_sieve_model_correction_upper J a e u ha he (fun j hj => (hloc j hj).1) (fun j hj => by linarith [(hloc j hj).2.2]) _ = (∏ j ∈ J, a j) * (R * Real.exp R) := by ring _ ≤ (∏ j ∈ J, a j) * (blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ))) := mul_le_mul_of_nonneg_left hRexp hA _ = _ := by ring have hs := block_sieve_sandwich J B w (fun j => (j + 1)*h) hw1 hc have hd := block_sieve_difference_bound J B w (fun j => (j + 1)*h) hw1 hc refine ⟨hcorr0, hcorr, ?_, ?_⟩ · rw [abs_of_nonneg hd.1] exact hd.2.trans hcorr · rw [abs_of_nonpos (sub_nonpos.mpr hs.1)] dsimp only [blockSieveLower] at * change _ ≤ (∏ j ∈ J, a j) * blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) have hsa : (∏ j ∈ J, a j) ≤ blockSieveUpper J B w (fun j => (j + 1)*h) := hs.2 change -((blockSieveUpper J B w (fun j => (j + 1)*h) - blockSieveCorrection J B w (fun j => (j + 1)*h)) - (∏ j ∈ J, a j)) ≤ _ linarith end section open Finset section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V ρ : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) (cap : ℕ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] end ResiduePath end section open Finset open scoped Classical section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} variable [∀ g p, AddGroup (R g p)] [∀ g p, DecidableEq (R g p)] {a b : (g : Fin N) → P g → Bool} end Joint end section open Finset Classical section variable {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) {A : SharedActiveLabels P S → Type*} [∀ c, Fintype (A c)] end end section open scoped BigOperators Classical noncomputable def finiteCoordinateChoice {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i : I) (active : Finset I) (f : (∀ j, X j) → ℂ) : (∀ j, X j) → ℂ := if i ∈ active then f - finiteCoordinateAverage μ i f else finiteCoordinateAverage μ i f noncomputable def finiteCoordinateComponent {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (active : Finset I) : List I → ((∀ j, X j) → ℂ) → ((∀ j, X j) → ℂ) | [], f => f | i :: is, f => finiteCoordinateChoice μ i active (finiteCoordinateComponent μ active is f) section variable {I : Type*} [sharedInstance1 : DecidableEq I] {X : I → Type*} [sharedInstance3 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) include I sharedInstance1 X sharedInstance3 μ theorem finite_coordinate_average_zero (i : I) : finiteCoordinateAverage μ i 0 = 0 := by funext x simp only [finite_coordinate_average_update, Pi.zero_apply, mul_zero, Finset.sum_const_zero] theorem finite_coordinate_choice_zero (i : I) (S : Finset I) : finiteCoordinateChoice μ i S 0 = 0 := by simp only [finiteCoordinateChoice, finite_coordinate_average_zero, sub_self, ite_self] theorem finite_coordinate_average_choice (i j : I) (S : Finset I) (f : (∀ k, X k) → ℂ) : finiteCoordinateAverage μ i (finiteCoordinateChoice μ j S f) = finiteCoordinateChoice μ j S (finiteCoordinateAverage μ i f) := by by_cases hj : j ∈ S · simp only [finiteCoordinateChoice, if_pos hj, finite_coordinate_average_sub] rw [finite_coordinate_average_commute μ i j] · simp only [finiteCoordinateChoice, if_neg hj] exact finite_coordinate_average_commute μ i j f theorem finite_coordinate_component_congr (S T : Finset I) (is : List I) (h : ∀ i ∈ is, (i ∈ S ↔ i ∈ T)) (f : (∀ j, X j) → ℂ) : finiteCoordinateComponent μ S is f = finiteCoordinateComponent μ T is f := by induction is with | nil => rfl | cons i is ih => simp only [finiteCoordinateComponent] rw [ih (fun j hj => h j (List.mem_cons_of_mem _ hj))] simp only [finiteCoordinateChoice, h i (List.mem_cons_self)] theorem finite_coordinate_component_average (hmass : ∀ i, ∑ y, μ i y = 1) (S : Finset I) (is : List I) (i : I) (hi : i ∈ is) (f : (∀ j, X j) → ℂ) : finiteCoordinateAverage μ i (finiteCoordinateComponent μ S is f) = if i ∈ S then 0 else finiteCoordinateComponent μ S is f := by induction is with | nil => simp only [List.not_mem_nil] at hi | cons j js ih => by_cases hij : i = j · subst j by_cases his : i ∈ S · simp only [finiteCoordinateComponent, finiteCoordinateChoice, if_pos his] exact finite_coordinate_average_complement_zero μ i (hmass i) _ · simp only [finiteCoordinateComponent, finiteCoordinateChoice, if_neg his] exact finite_coordinate_average_idempotent μ i (hmass i) _ · have hit : i ∈ js := (List.mem_cons.mp hi).resolve_left hij rw [finiteCoordinateComponent, finite_coordinate_average_choice, ih hit] by_cases his : i ∈ S · simp only [if_pos his, finite_coordinate_choice_zero] · simp only [if_neg his] end end section open Finset theorem finite_block_sieve {Ω : Type*} (J : Finset ℕ) (B : ℕ → Finset ℕ) (T : Finset Ω) (μ : Ω → ℝ) (x : Ω → ℕ → ℝ) (g r : ℕ → ℝ) {z X C η : ℝ} {h : ℕ} (hz : 1 ≤ z) (hX : 0 ≤ X) (hC : 0 ≤ C) (hη : 0 < η) (hh : 1 ≤ h) (heven : Even h) (hdisj : (J : Set ℕ).PairwiseDisjoint B) (hprime : ∀ j ∈ J, ∀ p ∈ B j, p.Prime) (hsize : ∀ j ∈ J, ∀ p ∈ B j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hμ : ∀ t ∈ T, 0 ≤ μ t) (hx : ∀ t ∈ T, ∀ p ∈ J.biUnion B, 0 ≤ x t p ∧ x t p ≤ 1) (hg : ∀ j ∈ J, ∀ p ∈ B j, 0 ≤ g p ∧ g p ≤ 1 - η) (hsum : ∀ j ∈ J, (∑ p ∈ B j, g p) ≤ C) (hmoment : ∀ S ∈ (J.biUnion B).powerset, (∑ t ∈ T, μ t * ∏ p ∈ S, x t p) = X * (∏ p ∈ S, g p) + r (∏ p ∈ S, p)) : |(∑ t ∈ T, μ t * ∏ p ∈ J.biUnion B, (1 - x t p)) - X * (∏ p ∈ J.biUnion B, (1 - g p))| ≤ X * (∏ p ∈ J.biUnion B, (1 - g p)) * blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli (J.biUnion B) (z^(4 * (h : ℝ) + 2)), |r d| := by classical let P := J.biUnion B let cap := fun j => (j + 1) * h let a := blockSieveSubsetUpperCoefficient J B cap let b := blockSieveSubsetLowerCoefficient J B cap let A := ∏ p ∈ P, (1 - g p) let E := A * blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) let D := z^(4 * (h : ℝ) + 2) let R := ∑ d ∈ blockSieveModuli P D, |r d| have hP : ∀ p ∈ P, p.Prime := by intro p hp obtain ⟨j, hj, hp⟩ := mem_biUnion.mp hp exact hprime j hj p hp have haeq (w : ℕ → ℝ) : subsetPolynomial P a w = blockSieveUpper J B w cap := (block_sieve_upper_expansion J B w cap hdisj).symm have hbeq (w : ℕ → ℝ) : subsetPolynomial P b w = blockSieveLower J B w cap := (block_sieve_lower_expansion J B w cap hdisj).symm have hA : (∏ j ∈ J, ∏ p ∈ B j, (1 - g p)) = A := (prod_biUnion hdisj).symm have hmodel := block_sieve_model_bounds hη hC hh heven J B g hg hsum dsimp only at hmodel rw [hA] at hmodel have hma : |subsetPolynomial P a g - A| ≤ E := by rw [haeq]; exact hmodel.2.2.1 have hmb : |subsetPolynomial P b g - A| ≤ E := by rw [hbeq]; exact hmodel.2.2.2 have hla : ∀ S ∈ P.powerset, a S ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D := by intro S _ hS simpa only [Nat.cast_prod] using (block_sieve_upper_coefficient_level J B S h hz hdisj hprime hsize hS).2 have hlb : ∀ S ∈ P.powerset, b S ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D := by intro S _ hS simpa only [Nat.cast_prod] using (block_sieve_lower_coefficient_level J B S h hz hdisj hprime hsize hS).2 have herra := subset_polynomial_average_error_level P T a r μ x g X D hP (fun S _ => abs_block_sieve_subset_upper_coefficient_le_one J B cap S) hla hmoment have herrb := subset_polynomial_average_error_level P T b r μ x g X D hP (fun S _ => abs_block_sieve_subset_lower_coefficient_le_one J B cap S) hlb hmoment have hpoint : ∀ t ∈ T, subsetPolynomial P b (x t) ≤ (∏ p ∈ P, (1 - x t p)) ∧ (∏ p ∈ P, (1 - x t p)) ≤ subsetPolynomial P a (x t) := by intro t ht rw [haeq, hbeq] have hs := block_sieve_sandwich J B (x t) cap (fun j hj p hp => hx t ht p (mem_biUnion.mpr ⟨j, hj, hp⟩)) (fun j _ => heven.mul_left (j + 1)) simpa only [P, prod_biUnion hdisj] using hs have hfinal := subset_polynomial_sandwich_transfer P T a b μ (fun t => ∏ p ∈ P, (1 - x t p)) x g X A E R hμ hX hpoint hma hmb herra herrb exact hfinal.trans_eq (by dsimp only [E, A, R, P, D]; ring) end section open Finset section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V ρ : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) (cap : ℕ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] end ResiduePath end section open Finset open scoped Classical section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, DecidableEq (R g p)] {a b : (g : Fin N) → P g → Bool} end Joint end section open Finset Classical section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) {A : SharedActiveLabels P S → Type*} [∀ c, Fintype (A c)] (ω : ∀ c, A c → ℝ) (Δ D : ∀ c, A c → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) end end section open scoped BigOperators Classical theorem finite_coordinate_component_sum {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (is : List I) (hnodup : is.Nodup) (f : (∀ j, X j) → ℂ) : (∑ S ∈ is.toFinset.powerset, finiteCoordinateComponent μ S is f) = f := by induction is with | nil => simp [finiteCoordinateComponent] | cons i is ih => obtain ⟨hi, hrest⟩ := List.nodup_cons.mp hnodup have hi' : i ∉ is.toFinset := by simpa only [List.mem_toFinset] using hi rw [List.toFinset_cons, Finset.sum_powerset_insert hi', ← Finset.sum_add_distrib] calc _ = ∑ S ∈ is.toFinset.powerset, finiteCoordinateComponent μ S is f := by apply Finset.sum_congr rfl intro S hS have his : i ∉ S := fun h => hi' ((Finset.mem_powerset.mp hS) h) have hc : finiteCoordinateComponent μ (insert i S) is f = finiteCoordinateComponent μ S is f := by apply finite_coordinate_component_congr intro j hj have hji : j ≠ i := by intro he; subst j; exact hi hj simp only [Finset.mem_insert, hji, false_or] simp only [finiteCoordinateComponent, finiteCoordinateChoice, if_neg his, Finset.mem_insert_self, if_true, hc] abel _ = f := ih hrest theorem finite_coordinate_components_orthogonal {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ y, μ i y = 1) (is : List I) (S T : Finset I) (hS : S ⊆ is.toFinset) (hT : T ⊆ is.toFinset) (hST : S ≠ T) (f g : (∀ j, X j) → ℂ) : (∑ x, (finiteProductWeight μ x : ℂ) * ((starRingEnd ℂ) (finiteCoordinateComponent μ S is f x) * finiteCoordinateComponent μ T is g x)) = 0 := by have hne : ¬ ∀ i, i ∈ S ↔ i ∈ T := fun h => hST (Finset.ext h) obtain ⟨i, hi⟩ := not_forall.mp hne by_cases his : i ∈ S · have hit : i ∉ T := fun ht => hi (iff_of_true his ht) have hil : i ∈ is := List.mem_toFinset.mp (hS his) have h := finite_coordinate_average_selfadjoint μ i (finiteCoordinateComponent μ S is f) (finiteCoordinateComponent μ T is g) rw [finite_coordinate_component_average μ hmass S is i hil, finite_coordinate_component_average μ hmass T is i hil, if_pos his, if_neg hit] at h simpa only [Pi.zero_apply, map_zero, zero_mul, mul_zero, Finset.sum_const_zero] using h.symm · have hit : i ∈ T := by by_contra ht exact hi (iff_of_false his ht) have hil : i ∈ is := List.mem_toFinset.mp (hT hit) have h := finite_coordinate_average_selfadjoint μ i (finiteCoordinateComponent μ S is f) (finiteCoordinateComponent μ T is g) rw [finite_coordinate_component_average μ hmass S is i hil, finite_coordinate_component_average μ hmass T is i hil, if_neg his, if_pos hit] at h simpa only [Pi.zero_apply, map_zero, zero_mul, mul_zero, Finset.sum_const_zero] using h end section open Finset theorem finite_bad_event_indicator_product {α : Type*} [DecidableEq α] (S : Finset α) (bad : α → Prop) [DecidablePred bad] : (∏ p ∈ S, if bad p then (1 : ℝ) else 0) = if ∀ p ∈ S, bad p then 1 else 0 := by classical by_cases hall : ∀ p ∈ S, bad p · rw [if_pos hall] exact prod_eq_one (fun p hp => if_pos (hall p hp)) · rw [if_neg hall] push Not at hall obtain ⟨p, hp, hbad⟩ := hall exact prod_eq_zero hp (if_neg hbad) theorem finite_bad_event_avoidance_product {α : Type*} [DecidableEq α] (S : Finset α) (bad : α → Prop) [DecidablePred bad] : (∏ p ∈ S, ((1 : ℝ) - (if bad p then 1 else 0))) = if ∀ p ∈ S, ¬bad p then 1 else 0 := by classical calc _ = ∏ p ∈ S, if ¬bad p then (1 : ℝ) else 0 := by apply prod_congr rfl intro p _ by_cases hp : bad p <;> simp [hp] _ = _ := finite_bad_event_indicator_product S (fun p => ¬bad p) section variable {Ω α : Type*} [sharedInstance1 : DecidableEq α] (T : Finset Ω) (μ : Ω → ℝ) (S : Finset α) (bad : Ω → α → Prop) [sharedInstance6 : ∀ t p, Decidable (bad t p)] include Ω α sharedInstance1 T μ S bad sharedInstance6 theorem finite_bad_event_weighted_intersection : (∑ t ∈ T, μ t * ∏ p ∈ S, if bad t p then (1 : ℝ) else 0) = ∑ t ∈ T.filter (fun t => ∀ p ∈ S, bad t p), μ t := by classical simp_rw [finite_bad_event_indicator_product] rw [sum_filter] apply sum_congr rfl intro t _ split_ifs <;> simp theorem finite_bad_event_weighted_avoidance : (∑ t ∈ T, μ t * ∏ p ∈ S, ((1 : ℝ) - (if bad t p then 1 else 0))) = ∑ t ∈ T.filter (fun t => ∀ p ∈ S, ¬bad t p), μ t := by classical simp_rw [finite_bad_event_avoidance_product] rw [sum_filter] apply sum_congr rfl intro t _ split_ifs <;> simp end theorem finite_block_sieve_events {Ω : Type*} (J : Finset ℕ) (B : ℕ → Finset ℕ) (T : Finset Ω) (μ : Ω → ℝ) (bad : Ω → ℕ → Prop) [∀ t p, Decidable (bad t p)] (g r : ℕ → ℝ) {z X C η : ℝ} {h : ℕ} (hz : 1 ≤ z) (hX : 0 ≤ X) (hC : 0 ≤ C) (hη : 0 < η) (hh : 1 ≤ h) (heven : Even h) (hdisj : (J : Set ℕ).PairwiseDisjoint B) (hprime : ∀ j ∈ J, ∀ p ∈ B j, p.Prime) (hsize : ∀ j ∈ J, ∀ p ∈ B j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hμ : ∀ t ∈ T, 0 ≤ μ t) (hg : ∀ j ∈ J, ∀ p ∈ B j, 0 ≤ g p ∧ g p ≤ 1 - η) (hsum : ∀ j ∈ J, (∑ p ∈ B j, g p) ≤ C) (hmoment : ∀ S ∈ (J.biUnion B).powerset, (∑ t ∈ T.filter (fun t => ∀ p ∈ S, bad t p), μ t) = X * (∏ p ∈ S, g p) + r (∏ p ∈ S, p)) : |(∑ t ∈ T.filter (fun t => ∀ p ∈ J.biUnion B, ¬bad t p), μ t) - X * (∏ p ∈ J.biUnion B, (1 - g p))| ≤ X * (∏ p ∈ J.biUnion B, (1 - g p)) * blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli (J.biUnion B) (z^(4 * (h : ℝ) + 2)), |r d| := by classical have h := finite_block_sieve J B T μ (fun t p => if bad t p then 1 else 0) g r hz hX hC hη hh heven hdisj hprime hsize hμ (fun t _ p _ => by by_cases hp : bad t p <;> simp [hp]) hg hsum (by intro S hS rw [finite_bad_event_weighted_intersection] exact hmoment S hS) rw [finite_bad_event_weighted_avoidance] at h exact h end section open Finset open scoped Classical section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, DecidableEq (R g p)] (a : ℕ → (g : Fin N) → P g → Bool) (steps : (i : ℕ) → (g : Fin N) → GlobalBirthRawStep (R := R g) (a i g) (a (i + 1) g)) (cap : ℕ → ℕ) end Joint end section open Finset Classical section variable {E G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : E → ∀ g, Finset (Fin (M g))) (B : ℕ) {A : ∀ e, SharedActiveLabels P (S e) → Type*} [∀ e c, Fintype (A e c)] (ω : ∀ e c, A e c → ℝ) (Δ D : ∀ e c, A e c → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) end end section open scoped BigOperators InnerProductSpace Classical theorem finite_orthogonal_norm_sum_sq {J E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] (s : Finset J) (v : J → E) (hoff : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → inner ℂ (v i) (v j) = 0) : ‖∑ i ∈ s, v i‖ ^ 2 = ∑ i ∈ s, ‖v i‖ ^ 2 := by rw [norm_sq_eq_re_inner (𝕜 := ℂ)] change (inner ℂ (∑ i ∈ s, v i) (∑ i ∈ s, v i)).re = _ simp only [sum_inner, inner_sum, Complex.re_sum] apply Finset.sum_congr rfl intro j hj rw [Finset.sum_eq_single j] · exact (norm_sq_eq_re_inner (𝕜 := ℂ) (v j)).symm · intro i hi hij rw [hoff i hi j hj hij] rfl · exact fun h => (h hj).elim theorem finite_measure_vector_sum {J X : Type*} (s : Finset J) (μ : X → ℝ) (v : J → X → ℂ) : finiteMeasureVector μ (∑ i ∈ s, v i) = ∑ i ∈ s, finiteMeasureVector μ (v i) := by apply PiLp.ext intro x simp only [finite_measure_vector_apply, Finset.sum_apply, WithLp.ofLp_sum, Finset.mul_sum] theorem finite_weighted_orthogonal_energy {J X : Type*} [Fintype X] (s : Finset J) (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (v : J → X → ℂ) (hoff : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → (∑ x, (μ x : ℂ) * ((starRingEnd ℂ) (v i x) * v j x)) = 0) : finiteWeightedEnergy μ (∑ i ∈ s, v i) = ∑ i ∈ s, finiteWeightedEnergy μ (v i) := by unfold finiteWeightedEnergy rw [← finite_measure_vector_norm_sq μ hμ, finite_measure_vector_sum] rw [finite_orthogonal_norm_sum_sq s (fun i => finiteMeasureVector μ (v i))] · simp only [finite_measure_vector_norm_sq μ hμ] · intro i hi j hj hij rw [finite_measure_vector_inner μ hμ] simpa only [mul_assoc] using hoff i hi j hj hij theorem finite_coordinate_component_energy_sum {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ y, μ i y = 1) (is : List I) (hnodup : is.Nodup) (f : (∀ j, X j) → ℂ) : (∑ S ∈ is.toFinset.powerset, finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ S is f)) = finiteWeightedEnergy (finiteProductWeight μ) f := by have h := finite_weighted_orthogonal_energy is.toFinset.powerset (finiteProductWeight μ) (fun x => Finset.prod_nonneg (fun i _ => hμ i (x i))) (fun S => finiteCoordinateComponent μ S is f) (fun S hS T hT hST => finite_coordinate_components_orthogonal μ hmass is S T (Finset.mem_powerset.mp hS) (Finset.mem_powerset.mp hT) hST f f) rw [finite_coordinate_component_sum μ is hnodup] at h exact h.symm end section open scoped BigOperators Classical section variable {I : Type*} [sharedInstance1 : DecidableEq I] {X : I → Type*} [sharedInstance3 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) include I sharedInstance1 X sharedInstance3 μ theorem finite_coordinate_choice_add (i : I) (S : Finset I) (f g : (∀ j, X j) → ℂ) : finiteCoordinateChoice μ i S (f + g) = finiteCoordinateChoice μ i S f + finiteCoordinateChoice μ i S g := by by_cases hi : i ∈ S · simp only [finiteCoordinateChoice, if_pos hi, finite_coordinate_average_add] abel · simp only [finiteCoordinateChoice, if_neg hi, finite_coordinate_average_add] theorem finite_coordinate_choice_commute (i j : I) (S T : Finset I) (f : (∀ k, X k) → ℂ) : finiteCoordinateChoice μ i S (finiteCoordinateChoice μ j T f) = finiteCoordinateChoice μ j T (finiteCoordinateChoice μ i S f) := by by_cases hi : i ∈ S <;> by_cases hj : j ∈ T · simp only [finiteCoordinateChoice, if_pos hi, if_pos hj, finite_coordinate_average_sub] rw [finite_coordinate_average_commute μ i j] abel · simp only [finiteCoordinateChoice, if_pos hi, if_neg hj, finite_coordinate_average_sub] rw [finite_coordinate_average_commute μ i j] · simp only [finiteCoordinateChoice, if_neg hi, if_pos hj, finite_coordinate_average_sub] rw [finite_coordinate_average_commute μ i j] · simp only [finiteCoordinateChoice, if_neg hi, if_neg hj] exact finite_coordinate_average_commute μ i j f theorem finite_coordinate_component_add (S : Finset I) (is : List I) (f g : (∀ j, X j) → ℂ) : finiteCoordinateComponent μ S is (f + g) = finiteCoordinateComponent μ S is f + finiteCoordinateComponent μ S is g := by induction is with | nil => rfl | cons i is ih => simp only [finiteCoordinateComponent, ih, finite_coordinate_choice_add] theorem finite_coordinate_component_zero (S : Finset I) (is : List I) : finiteCoordinateComponent μ S is 0 = 0 := by induction is with | nil => rfl | cons i is ih => simp only [finiteCoordinateComponent, ih, finite_coordinate_choice_zero] theorem finite_coordinate_component_perm (S : Finset I) {is js : List I} (h : is.Perm js) (f : (∀ j, X j) → ℂ) : finiteCoordinateComponent μ S is f = finiteCoordinateComponent μ S js f := by induction h with | nil => rfl | cons i h ih => simp only [finiteCoordinateComponent, ih] | swap i j is => exact finite_coordinate_choice_commute μ j i S S _ | trans h₁ h₂ ih₁ ih₂ => exact ih₁.trans ih₂ end theorem finite_coordinate_component_finset_sum {I J : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (S : Finset I) (is : List I) (s : Finset J) (f : J → (∀ j, X j) → ℂ) : finiteCoordinateComponent μ S is (∑ j ∈ s, f j) = ∑ j ∈ s, finiteCoordinateComponent μ S is (f j) := by induction s using Finset.induction_on with | empty => simp only [Finset.sum_empty, finite_coordinate_component_zero] | @insert j s hj ih => rw [Finset.sum_insert hj, finite_coordinate_component_add, ih, Finset.sum_insert hj] end section open Finset theorem finite_prime_sieve_events {Ω : Type*} (P : Finset ℕ) (T : Finset Ω) (μ : Ω → ℝ) (bad : Ω → ℕ → Prop) [∀ t p, Decidable (bad t p)] (g r : ℕ → ℝ) {z X C η : ℝ} {h : ℕ} (hz : 1 < z) (hX : 0 ≤ X) (hC : 0 ≤ C) (hη : 0 < η) (hh : 1 ≤ h) (heven : Even h) (hP : ∀ p ∈ P, p.Prime) (hPz : ∀ p ∈ P, (p : ℝ) ≤ z) (hμ : ∀ t ∈ T, 0 ≤ μ t) (hg : ∀ p ∈ P, 0 ≤ g p ∧ g p ≤ 1 - η) (hshell : ∀ w : ℝ, 1 < w → (∑ p ∈ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2), g p) ≤ C) (hmoment : ∀ S ∈ P.powerset, (∑ t ∈ T.filter (fun t => ∀ p ∈ S, bad t p), μ t) = X * (∏ p ∈ S, g p) + r (∏ p ∈ S, p)) : |(∑ t ∈ T.filter (fun t => ∀ p ∈ P, ¬bad t p), μ t) - X * (∏ p ∈ P, (1 - g p))| ≤ X * (∏ p ∈ P, (1 - g p)) * blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli P (z^(4 * (h : ℝ) + 2)), |r d| := by obtain ⟨J, B, hunion, hdisj, hsub, hband⟩ := exists_dyadic_sieve_blocks_log P hP hPz have hlocal : ∀ j ∈ J, (∑ p ∈ B j, g p) ≤ C := by intro j hj exact dyadic_sieve_block_mass P (B j) g hz j hP (fun p hp => (hg p hp).1) (hsub j) (fun p hp => (hband j hj p hp).1) (fun p hp => (hband j hj p hp).2) hshell have hm : ∀ S ∈ (J.biUnion B).powerset, (∑ t ∈ T.filter (fun t => ∀ p ∈ S, bad t p), μ t) = X * (∏ p ∈ S, g p) + r (∏ p ∈ S, p) := by simpa only [hunion] using hmoment have hsieve := finite_block_sieve_events J B T μ bad g r hz.le hX hC hη hh heven hdisj (fun j _ p hp => hP p (hsub j hp)) (fun j hj p hp => (hband j hj p hp).2) hμ (fun j _ p hp => hg p (hsub j hp)) hlocal hm simpa only [hunion] using hsieve end section open Finset theorem block_sieve_correction_expansion {G α : Type*} [DecidableEq α] (J : Finset G) (B : G → Finset α) (w : α → ℝ) (h : G → ℕ) (hdisj : (J : Set G).PairwiseDisjoint B) : blockSieveCorrection J B w h = ∑ S ∈ (J.biUnion B).powerset, (∑ j ∈ J, blockSieveSubsetCorrectionAt J B h j S) * ∏ p ∈ S, w p := by have hid := block_sieve_subset_weighted_expansion J B h (fun S => ∏ p ∈ S, w p) rw [← block_sieve_upper_expansion J B w h hdisj, ← block_sieve_lower_expansion J B w h hdisj] at hid have hc : blockSieveCorrection J B w h = ∑ j ∈ J, ∑ S ∈ (J.biUnion B).powerset, blockSieveSubsetCorrectionAt J B h j S * ∏ p ∈ S, w p := by dsimp only [blockSieveLower] at hid linarith rw [hc] simp_rw [sum_mul] exact sum_comm theorem block_sieve_correction_sum_coefficient_level (J : Finset ℕ) (B : ℕ → Finset ℕ) (S : Finset ℕ) (h : ℕ) {z : ℝ} (hz : 1 ≤ z) (hdisj : (J : Set ℕ).PairwiseDisjoint B) (hprime : ∀ j ∈ J, ∀ p ∈ B j, p.Prime) (hsize : ∀ j ∈ J, ∀ p ∈ B j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hc : (∑ j ∈ J, blockSieveSubsetCorrectionAt J B (fun k => (k + 1) * h) j S) ≠ 0) : Squarefree (∏ p ∈ S, p) ∧ (∏ p ∈ S, (p : ℝ)) ≤ z^(4 * (h : ℝ) + 2) := by classical have hex : ∃ j ∈ J, blockSieveSubsetCorrectionAt J B (fun k => (k + 1) * h) j S ≠ 0 := by by_contra hn push Not at hn exact hc (sum_eq_zero hn) obtain ⟨j, _, hj⟩ := hex exact block_sieve_correction_coefficient_level J B S h j hz hdisj hprime hsize hj theorem finite_block_sieve_overcount {Ω : Type*} (J : Finset ℕ) (B : ℕ → Finset ℕ) (T : Finset Ω) (μ : Ω → ℝ) (x : Ω → ℕ → ℝ) (g r : ℕ → ℝ) {z X C η : ℝ} {h : ℕ} (hz : 1 ≤ z) (hX : 0 ≤ X) (hC : 0 ≤ C) (hη : 0 < η) (hh : 1 ≤ h) (heven : Even h) (hdisj : (J : Set ℕ).PairwiseDisjoint B) (hprime : ∀ j ∈ J, ∀ p ∈ B j, p.Prime) (hsize : ∀ j ∈ J, ∀ p ∈ B j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hμ : ∀ t ∈ T, 0 ≤ μ t) (hx : ∀ t ∈ T, ∀ p ∈ J.biUnion B, 0 ≤ x t p ∧ x t p ≤ 1) (hg : ∀ j ∈ J, ∀ p ∈ B j, 0 ≤ g p ∧ g p ≤ 1 - η) (hsum : ∀ j ∈ J, (∑ p ∈ B j, g p) ≤ C) (hmoment : ∀ S ∈ (J.biUnion B).powerset, (∑ t ∈ T, μ t * ∏ p ∈ S, x t p) = X * (∏ p ∈ S, g p) + r (∏ p ∈ S, p)) : 0 ≤ (∑ t ∈ T, μ t * blockSieveUpper J B (x t) (fun j => (j + 1) * h)) - (∑ t ∈ T, μ t * ∏ p ∈ J.biUnion B, (1 - x t p)) ∧ (∑ t ∈ T, μ t * blockSieveUpper J B (x t) (fun j => (j + 1) * h)) - (∑ t ∈ T, μ t * ∏ p ∈ J.biUnion B, (1 - x t p)) ≤ X * (∏ p ∈ J.biUnion B, (1 - g p)) * blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli (J.biUnion B) (z^(4 * (h : ℝ) + 2)), |r d| := by classical let P := J.biUnion B let cap := fun j => (j + 1) * h let a := fun S => ∑ j ∈ J, blockSieveSubsetCorrectionAt J B cap j S let A := ∏ p ∈ P, (1 - g p) let D := z^(4 * (h : ℝ) + 2) let R := ∑ d ∈ blockSieveModuli P D, |r d| have hP : ∀ p ∈ P, p.Prime := by intro p hp obtain ⟨j, hj, hp⟩ := mem_biUnion.mp hp exact hprime j hj p hp have haeq (w : ℕ → ℝ) : subsetPolynomial P a w = blockSieveCorrection J B w cap := (block_sieve_correction_expansion J B w cap hdisj).symm have hlevel : ∀ S ∈ P.powerset, a S ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D := by intro S _ hS simpa only [Nat.cast_prod] using (block_sieve_correction_sum_coefficient_level J B S h hz hdisj hprime hsize hS).2 have herr := subset_polynomial_average_error_level P T a r μ x g X D hP (fun S _ => abs_block_sieve_subset_correction_sum_le_one J B cap S) hlevel hmoment simp_rw [haeq] at herr have hmodel := (block_sieve_model_bounds hη hC hh heven J B g hg hsum).2.1 have hA : (∏ j ∈ J, ∏ p ∈ B j, (1 - g p)) = A := (prod_biUnion hdisj).symm rw [hA] at hmodel have havg : (∑ t ∈ T, μ t * blockSieveCorrection J B (x t) cap) ≤ X * A * blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) + R := by have hm := mul_le_mul_of_nonneg_left hmodel hX have he := (abs_le.mp herr).2 change _ ≤ R at he dsimp only [cap] at hm ⊢ nlinarith have hpoint : ∀ t ∈ T, 0 ≤ blockSieveUpper J B (x t) cap - (∏ p ∈ P, (1 - x t p)) ∧ blockSieveUpper J B (x t) cap - (∏ p ∈ P, (1 - x t p)) ≤ blockSieveCorrection J B (x t) cap := by intro t ht have hd := block_sieve_difference_bound J B (x t) cap (fun j hj p hp => hx t ht p (mem_biUnion.mpr ⟨j, hj, hp⟩)) (fun j _ => heven.mul_left (j + 1)) simpa only [P, prod_biUnion hdisj] using hd have hnonneg : 0 ≤ ∑ t ∈ T, μ t * (blockSieveUpper J B (x t) cap - (∏ p ∈ P, (1 - x t p))) := sum_nonneg (fun t ht => mul_nonneg (hμ t ht) (hpoint t ht).1) have hupper : (∑ t ∈ T, μ t * (blockSieveUpper J B (x t) cap - (∏ p ∈ P, (1 - x t p)))) ≤ ∑ t ∈ T, μ t * blockSieveCorrection J B (x t) cap := sum_le_sum (fun t ht => mul_le_mul_of_nonneg_left (hpoint t ht).2 (hμ t ht)) simpa only [mul_sub, sum_sub_distrib] using And.intro hnonneg (hupper.trans havg) theorem finite_block_sieve_event_overcount {Ω : Type*} (J : Finset ℕ) (B : ℕ → Finset ℕ) (T : Finset Ω) (μ : Ω → ℝ) (bad : Ω → ℕ → Prop) [∀ t p, Decidable (bad t p)] (g r : ℕ → ℝ) {z X C η : ℝ} {h : ℕ} (hz : 1 ≤ z) (hX : 0 ≤ X) (hC : 0 ≤ C) (hη : 0 < η) (hh : 1 ≤ h) (heven : Even h) (hdisj : (J : Set ℕ).PairwiseDisjoint B) (hprime : ∀ j ∈ J, ∀ p ∈ B j, p.Prime) (hsize : ∀ j ∈ J, ∀ p ∈ B j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hμ : ∀ t ∈ T, 0 ≤ μ t) (hg : ∀ j ∈ J, ∀ p ∈ B j, 0 ≤ g p ∧ g p ≤ 1 - η) (hsum : ∀ j ∈ J, (∑ p ∈ B j, g p) ≤ C) (hmoment : ∀ S ∈ (J.biUnion B).powerset, (∑ t ∈ T.filter (fun t => ∀ p ∈ S, bad t p), μ t) = X * (∏ p ∈ S, g p) + r (∏ p ∈ S, p)) : let M := (∑ t ∈ T, μ t * blockSieveUpper J B (fun p => if bad t p then 1 else 0) (fun j => (j + 1) * h)) - (∑ t ∈ T.filter (fun t => ∀ p ∈ J.biUnion B, ¬bad t p), μ t) 0 ≤ M ∧ M ≤ X * (∏ p ∈ J.biUnion B, (1 - g p)) * blockSieveModelErrorConstant C η * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli (J.biUnion B) (z^(4 * (h : ℝ) + 2)), |r d| := by classical have hresult := finite_block_sieve_overcount J B T μ (fun t p => if bad t p then 1 else 0) g r hz hX hC hη hh heven hdisj hprime hsize hμ (fun t _ p _ => by by_cases hp : bad t p <;> simp [hp]) hg hsum (by intro S hS rw [finite_bad_event_weighted_intersection] exact hmoment S hS) simpa only [finite_bad_event_weighted_avoidance] using hresult end section open Finset open scoped Classical section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, DecidableEq (R g p)] (a : ℕ → (g : Fin N) → P g → Bool) (steps : (i : ℕ) → (g : Fin N) → GlobalBirthRawStep (R := R g) (a i g) (a (i + 1) g)) (cap : ℕ → ℕ) end Joint end section open scoped BigOperators Classical def finiteCoordinatePatternMatches {I : Type*} [DecidableEq I] (A : Finset I) (js : List I) (S : Finset I) : Prop := ∀ i ∈ js, (i ∈ A ↔ i ∈ S) theorem finite_coordinate_choice_component {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ y, μ i y = 1) (A S : Finset I) (is : List I) (i : I) (hi : i ∈ is) (f : (∀ j, X j) → ℂ) : finiteCoordinateChoice μ i A (finiteCoordinateComponent μ S is f) = if (i ∈ A ↔ i ∈ S) then finiteCoordinateComponent μ S is f else 0 := by unfold finiteCoordinateChoice rw [finite_coordinate_component_average μ hmass S is i hi] by_cases hA : i ∈ A <;> by_cases hS : i ∈ S <;> simp only [hA, hS, if_true, if_false, iff_self, true_iff, false_iff, not_true_eq_false, sub_zero, sub_self] theorem finite_coordinate_component_retains {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ y, μ i y = 1) (A S : Finset I) (is js : List I) (hsub : ∀ i ∈ js, i ∈ is) (f : (∀ j, X j) → ℂ) : finiteCoordinateComponent μ A js (finiteCoordinateComponent μ S is f) = if (∀ i ∈ js, (i ∈ A ↔ i ∈ S)) then finiteCoordinateComponent μ S is f else 0 := by induction js with | nil => simp only [finiteCoordinateComponent, List.not_mem_nil, false_implies, implies_true, if_true] | cons j js ih => rw [finiteCoordinateComponent, ih (fun i hi => hsub i (List.mem_cons_of_mem _ hi))] simp only [List.forall_mem_cons] by_cases ht : ∀ i ∈ js, (i ∈ A ↔ i ∈ S) · rw [if_pos ht, finite_coordinate_choice_component μ hmass A S is j (hsub j (List.mem_cons_self))] by_cases hh : (j ∈ A ↔ j ∈ S) · rw [if_pos hh, if_pos ⟨hh, ht⟩] · rw [if_neg hh, if_neg (fun h => hh h.1)] · rw [if_neg ht, finite_coordinate_choice_zero] simp only [ht, and_false, if_false] theorem finite_coordinate_retained_decomposition {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ y, μ i y = 1) (A : Finset I) (is js : List I) (hnodup : is.Nodup) (hsub : ∀ i ∈ js, i ∈ is) (f : (∀ j, X j) → ℂ) : finiteCoordinateComponent μ A js f = ∑ S ∈ is.toFinset.powerset.filter (finiteCoordinatePatternMatches A js), finiteCoordinateComponent μ S is f := by calc _ = finiteCoordinateComponent μ A js (∑ S ∈ is.toFinset.powerset, finiteCoordinateComponent μ S is f) := by rw [finite_coordinate_component_sum μ is hnodup] _ = ∑ S ∈ is.toFinset.powerset, if (∀ i ∈ js, (i ∈ A ↔ i ∈ S)) then finiteCoordinateComponent μ S is f else 0 := by rw [finite_coordinate_component_finset_sum] apply Finset.sum_congr rfl intro S _ exact finite_coordinate_component_retains μ hmass A S is js hsub f _ = _ := by rw [Finset.sum_filter] apply Finset.sum_congr rfl intro S _ by_cases h : finiteCoordinatePatternMatches A js S · rw [if_pos h, if_pos (show ∀ i ∈ js, (i ∈ A ↔ i ∈ S) from h)] · rw [if_neg h, if_neg (show ¬ (∀ i ∈ js, (i ∈ A ↔ i ∈ S)) from h)] theorem finite_coordinate_retained_energy {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ y, μ i y = 1) (A : Finset I) (is js : List I) (hnodup : is.Nodup) (hsub : ∀ i ∈ js, i ∈ is) (f : (∀ j, X j) → ℂ) : finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ A js f) = ∑ S ∈ is.toFinset.powerset.filter (finiteCoordinatePatternMatches A js), finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ S is f) := by rw [finite_coordinate_retained_decomposition μ hmass A is js hnodup hsub] refine finite_weighted_orthogonal_energy _ (finiteProductWeight μ) (fun x => Finset.prod_nonneg (fun i _ => hμ i (x i))) _ ?_ intro S hS T hT hST exact finite_coordinate_components_orthogonal μ hmass is S T (Finset.mem_powerset.mp (Finset.mem_filter.mp hS).1) (Finset.mem_powerset.mp (Finset.mem_filter.mp hT).1) hST f f end section open scoped BigOperators Classical def finiteSlotRelabel {I X : Type*} (σ : Equiv.Perm I) : (I → X) ≃ (I → X) where toFun x i := x (σ i) invFun x i := x (σ.symm i) left_inv x := by funext i; simp right_inv x := by funext i; simp def finiteSlotPermute {I X : Type*} (σ : Equiv.Perm I) (f : (I → X) → ℂ) : (I → X) → ℂ := fun x => f (finiteSlotRelabel σ x) theorem finite_slot_relabel_update {I X : Type*} [DecidableEq I] (σ : Equiv.Perm I) (x : I → X) (i : I) (y : X) : finiteSlotRelabel σ (Function.update x i y) = Function.update (finiteSlotRelabel σ x) (σ.symm i) y := Function.update_comp_equiv x σ i y theorem finite_slot_weight_invariant {I X : Type*} [Fintype I] (μ : X → ℝ) (σ : Equiv.Perm I) (x : I → X) : finiteProductWeight (fun _ : I => μ) (finiteSlotRelabel σ x) = finiteProductWeight (fun _ : I => μ) x := Equiv.prod_comp σ (fun i => μ (x i)) theorem finite_slot_energy_invariant {I X : Type*} [Fintype I] [DecidableEq I] [Fintype X] (μ : X → ℝ) (σ : Equiv.Perm I) (f : (I → X) → ℂ) : finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) (finiteSlotPermute σ f) = finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) f := by unfold finiteWeightedEnergy finiteSlotPermute have h := (finiteSlotRelabel (X := X) σ).sum_comp (fun x => finiteProductWeight (fun _ : I => μ) x * ‖f x‖ ^ 2) simpa only [finite_slot_weight_invariant] using h section variable {I X : Type*} [sharedInstance1 : DecidableEq I] [sharedInstance2 : Fintype X] (μ : X → ℝ) (σ : Equiv.Perm I) include I X sharedInstance1 sharedInstance2 μ σ theorem finite_slot_average_covariant (i : I) (f : (I → X) → ℂ) : finiteCoordinateAverage (fun _ : I => μ) (σ i) (finiteSlotPermute σ f) = finiteSlotPermute σ (finiteCoordinateAverage (fun _ : I => μ) i f) := by funext x simp only [finite_coordinate_average_update, finiteSlotPermute, finite_slot_relabel_update, Equiv.symm_apply_apply] theorem finite_slot_choice_covariant (i : I) (S : Finset I) (f : (I → X) → ℂ) : finiteCoordinateChoice (fun _ : I => μ) (σ i) (S.map σ.toEmbedding) (finiteSlotPermute σ f) = finiteSlotPermute σ (finiteCoordinateChoice (fun _ : I => μ) i S f) := by have hm : σ i ∈ S.map σ.toEmbedding ↔ i ∈ S := by simp by_cases hi : i ∈ S · simp only [finiteCoordinateChoice, hm, if_pos hi, finite_slot_average_covariant] rfl · simp only [finiteCoordinateChoice, hm, if_neg hi, finite_slot_average_covariant] theorem finite_slot_component_covariant (S : Finset I) (is : List I) (f : (I → X) → ℂ) : finiteCoordinateComponent (fun _ : I => μ) (S.map σ.toEmbedding) (is.map σ) (finiteSlotPermute σ f) = finiteSlotPermute σ (finiteCoordinateComponent (fun _ : I => μ) S is f) := by induction is with | nil => rfl | cons i is ih => simp only [List.map_cons, finiteCoordinateComponent, ih] exact finite_slot_choice_covariant μ σ i S _ end end section open Finset open scoped Classical section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V ρ : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) (cap : ℕ) end ResiduePath end section open scoped BigOperators Classical theorem finite_full_list_map_perm {I : Type*} [DecidableEq I] (is : List I) (hnodup : is.Nodup) (hall : ∀ i, i ∈ is) (σ : Equiv.Perm I) : (is.map σ).Perm is := by apply (List.perm_ext_iff_of_nodup (hnodup.map σ.injective) hnodup).mpr intro i constructor · intro _; exact hall i · intro _ exact List.mem_map.mpr ⟨σ.symm i, hall _, σ.apply_symm_apply i⟩ theorem exists_perm_map_finset_of_card_eq {I : Type*} [Fintype I] [DecidableEq I] (S T : Finset I) (hcard : S.card = T.card) : ∃ σ : Equiv.Perm I, S.map σ.toEmbedding = T := by let e : S ≃ T := Finset.equivOfCardEq hcard let σ := e.extendSubtype refine ⟨σ, Finset.eq_of_subset_of_card_le ?_ ?_⟩ · intro y hy obtain ⟨x, hx, rfl⟩ := Finset.mem_map.mp hy exact e.extendSubtype_mem x hx · simpa only [Finset.card_map] using hcard.ge theorem finite_symmetric_component_energy_map {I X : Type*} [Fintype I] [DecidableEq I] [Fintype X] (μ : X → ℝ) (is : List I) (hnodup : is.Nodup) (hall : ∀ i, i ∈ is) (S : Finset I) (σ : Equiv.Perm I) (f : (I → X) → ℂ) (hsym : finiteSlotPermute σ f = f) : finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) (finiteCoordinateComponent (fun _ : I => μ) (S.map σ.toEmbedding) is f) = finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) (finiteCoordinateComponent (fun _ : I => μ) S is f) := by have hc := finite_slot_component_covariant μ σ S is f rw [hsym, finite_coordinate_component_perm (fun _ : I => μ) _ (finite_full_list_map_perm is hnodup hall σ)] at hc rw [hc, finite_slot_energy_invariant] theorem finite_symmetric_component_energy_card {I X : Type*} [Fintype I] [DecidableEq I] [Fintype X] (μ : X → ℝ) (is : List I) (hnodup : is.Nodup) (hall : ∀ i, i ∈ is) (S T : Finset I) (hcard : S.card = T.card) (f : (I → X) → ℂ) (hsym : ∀ σ : Equiv.Perm I, finiteSlotPermute σ f = f) : finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) (finiteCoordinateComponent (fun _ : I => μ) S is f) = finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) (finiteCoordinateComponent (fun _ : I => μ) T is f) := by obtain ⟨σ, hσ⟩ := exists_perm_map_finset_of_card_eq S T hcard have h := finite_symmetric_component_energy_map μ is hnodup hall S σ f (hsym σ) rw [hσ] at h exact h.symm end section open scoped BigOperators Classical def retainsProbes {I : Type*} [DecidableEq I] (A B S : Finset I) : Prop := A ⊆ S ∧ Disjoint S B noncomputable def retainedSubsets {I : Type*} [DecidableEq I] (Ω A B : Finset I) (j : ℕ) : Finset (Finset I) := (Ω.powersetCard j).filter (retainsProbes A B) theorem retained_subsets_sdiff {I : Type*} [DecidableEq I] (Ω A B : Finset I) (j : ℕ) : retainedSubsets Ω A B j = ((Ω \ B).powersetCard j).filter (A ⊆ ·) := by ext S simp only [retainedSubsets, Finset.mem_filter, Finset.mem_powersetCard, retainsProbes] constructor · rintro ⟨⟨hS, hj⟩, hA, hB⟩ exact ⟨⟨fun x hx => Finset.mem_sdiff.mpr ⟨hS hx, fun hb => Finset.disjoint_left.mp hB hx hb⟩, hj⟩, hA⟩ · rintro ⟨⟨hS, hj⟩, hA⟩ exact ⟨⟨hS.trans Finset.sdiff_subset, hj⟩, hA, Finset.disjoint_left.mpr (fun x hx hb => (Finset.mem_sdiff.mp (hS hx)).2 hb)⟩ theorem retained_subsets_card {I : Type*} [DecidableEq I] (Ω A B : Finset I) (j : ℕ) (hA : A ⊆ Ω) (hB : B ⊆ Ω) (hAB : Disjoint A B) (hj : A.card ≤ j) : (retainedSubsets Ω A B j).card = (Ω.card - A.card - B.card).choose (j - A.card) := by have hAs : A ⊆ Ω \ B := fun x hx => Finset.mem_sdiff.mpr ⟨hA hx, fun hb => Finset.disjoint_left.mp hAB hx hb⟩ rw [retained_subsets_sdiff, Finset.card_filter_powersetCard_subset A (Ω \ B) j hAs hj, Finset.card_sdiff_of_subset hB] congr 1 omega theorem retained_subsets_feasible {I : Type*} [DecidableEq I] (Ω A B : Finset I) (j : ℕ) (hB : B ⊆ Ω) (hne : (retainedSubsets Ω A B j).Nonempty) : A.card ≤ j ∧ j + B.card ≤ Ω.card := by obtain ⟨S, hS⟩ := hne obtain ⟨⟨hSΩ, hj⟩, hAS, hSB⟩ := (show (S ⊆ Ω ∧ S.card = j) ∧ A ⊆ S ∧ Disjoint S B from by simpa only [retainedSubsets, Finset.mem_filter, Finset.mem_powersetCard, retainsProbes] using hS) refine ⟨hj ▸ Finset.card_le_card hAS, ?_⟩ have hc := Finset.card_le_card (Finset.union_subset hSΩ hB) rwa [Finset.card_union_of_disjoint hSB, hj] at hc theorem retained_subsets_card_mul_le {I : Type*} [DecidableEq I] (Ω A B : Finset I) (j : ℕ) (hA : A ⊆ Ω) (hB : B ⊆ Ω) (hAB : Disjoint A B) : (retainedSubsets Ω A B j).card * A.card ^ B.card ≤ B.card ^ B.card * (Ω.card).choose j := by by_cases hne : (retainedSubsets Ω A B j).Nonempty · obtain ⟨hmj, hjM⟩ := retained_subsets_feasible Ω A B j hB hne rw [retained_subsets_card Ω A B j hA hB hAB hmj] have hp := hoeffding_probe_power_le_choose A.card B.card have hv := hoeffding_retained_choose_mul_le Ω.card A.card B.card j hmj hjM calc _ ≤ (Ω.card - A.card - B.card).choose (j - A.card) * (B.card ^ B.card * (A.card + B.card).choose A.card) := Nat.mul_le_mul_left _ hp _ = B.card ^ B.card * ((Ω.card - A.card - B.card).choose (j - A.card) * (A.card + B.card).choose A.card) := by ring _ ≤ _ := Nat.mul_le_mul_left _ hv · rw [Finset.not_nonempty_iff_eq_empty.mp hne, Finset.card_empty, zero_mul] exact Nat.zero_le _ theorem retained_subsets_card_le {I : Type*} [DecidableEq I] (Ω A B : Finset I) (j : ℕ) (hA : A ⊆ Ω) (hB : B ⊆ Ω) (hAB : Disjoint A B) (hm : 0 < A.card) : ((retainedSubsets Ω A B j).card : ℝ) ≤ ((B.card : ℝ) ^ B.card / (A.card : ℝ) ^ B.card) * ((Ω.powersetCard j).card : ℝ) := by have hmR : (0 : ℝ) < A.card := by exact_mod_cast hm have hc : ((retainedSubsets Ω A B j).card : ℝ) * (A.card : ℝ) ^ B.card ≤ (B.card : ℝ) ^ B.card * ((Ω.card).choose j : ℝ) := by exact_mod_cast retained_subsets_card_mul_le Ω A B j hA hB hAB rw [Finset.card_powersetCard, div_mul_eq_mul_div] exact (le_div_iff₀ (pow_pos hmR B.card)).mpr hc end section open scoped BigOperators Classical theorem finite_constant_subset_sum_le {J : Type*} (s t : Finset J) (hst : s ⊆ t) (e : J → ℝ) (he : ∀ j ∈ t, 0 ≤ e j) (hconst : ∀ i ∈ t, ∀ j ∈ t, e i = e j) {θ : ℝ} (hcard : (s.card : ℝ) ≤ θ * (t.card : ℝ)) : (∑ i ∈ s, e i) ≤ θ * ∑ i ∈ t, e i := by by_cases ht : t.Nonempty · obtain ⟨j, hj⟩ := ht have hs : (∑ i ∈ s, e i) = (s.card : ℝ) * e j := by calc _ = ∑ _i ∈ s, e j := Finset.sum_congr rfl (fun i hi => hconst i (hst hi) j hj) _ = _ := by simp have ht' : (∑ i ∈ t, e i) = (t.card : ℝ) * e j := by calc _ = ∑ _i ∈ t, e j := Finset.sum_congr rfl (fun i hi => hconst i hi j hj) _ = _ := by simp rw [hs, ht', ← mul_assoc] exact mul_le_mul_of_nonneg_right hcard (he j hj) · have ht' := Finset.not_nonempty_iff_eq_empty.mp ht have hs := Finset.subset_empty.mp (ht' ▸ hst) simp only [ht', hs, Finset.sum_empty, mul_zero, le_refl] theorem finite_powerset_sum_by_card {I : Type*} (Ω : Finset I) (e : Finset I → ℝ) : (∑ S ∈ Ω.powerset, e S) = ∑ j ∈ Finset.range (Ω.card + 1), ∑ S ∈ Ω.powersetCard j, e S := by have hm : Set.MapsTo (fun S : Finset I => S.card) (↑Ω.powerset) (↑(Finset.range (Ω.card + 1))) := by intro S hS exact Finset.mem_range.mpr (Nat.lt_succ_of_le (Finset.card_le_card (Finset.mem_powerset.mp hS))) rw [← Finset.sum_fiberwise_of_maps_to hm e] apply Finset.sum_congr rfl intro j _ rw [Finset.powersetCard_eq_filter] theorem finite_retained_sum_by_card {I : Type*} [DecidableEq I] (Ω A B : Finset I) (e : Finset I → ℝ) : (∑ S ∈ Ω.powerset.filter (retainsProbes A B), e S) = ∑ j ∈ Finset.range (Ω.card + 1), ∑ S ∈ retainedSubsets Ω A B j, e S := by have hm : Set.MapsTo (fun S : Finset I => S.card) (↑(Ω.powerset.filter (retainsProbes A B))) (↑(Finset.range (Ω.card + 1))) := by intro S hS exact Finset.mem_range.mpr (Nat.lt_succ_of_le (Finset.card_le_card (Finset.mem_powerset.mp (Finset.mem_filter.mp hS).1))) rw [← Finset.sum_fiberwise_of_maps_to hm e] apply Finset.sum_congr rfl intro j _ unfold retainedSubsets rw [Finset.powersetCard_eq_filter, Finset.filter_comm] theorem finite_symmetric_subset_retention_bound {I : Type*} [DecidableEq I] (Ω A B : Finset I) (hA : A ⊆ Ω) (hB : B ⊆ Ω) (hAB : Disjoint A B) (hm : 0 < A.card) (e : Finset I → ℝ) (he : ∀ S ⊆ Ω, 0 ≤ e S) (hconst : ∀ S ⊆ Ω, ∀ T ⊆ Ω, S.card = T.card → e S = e T) : (∑ S ∈ Ω.powerset.filter (retainsProbes A B), e S) ≤ ((B.card : ℝ) ^ B.card / (A.card : ℝ) ^ B.card) * ∑ S ∈ Ω.powerset, e S := by rw [finite_retained_sum_by_card, finite_powerset_sum_by_card, Finset.mul_sum] apply Finset.sum_le_sum intro j _ refine finite_constant_subset_sum_le (retainedSubsets Ω A B j) (Ω.powersetCard j) (Finset.filter_subset _ _) e ?_ ?_ (retained_subsets_card_le Ω A B j hA hB hAB hm) · intro S hS exact he S (Finset.mem_powersetCard.mp hS).1 · intro S hS T hT obtain ⟨hSΩ, hSj⟩ := Finset.mem_powersetCard.mp hS obtain ⟨hTΩ, hTj⟩ := Finset.mem_powersetCard.mp hT exact hconst S hSΩ T hTΩ (hSj.trans hTj.symm) end section open scoped BigOperators Classical theorem coordinate_pattern_matches_probes {I : Type*} [DecidableEq I] (A B S : Finset I) (hAB : Disjoint A B) : finiteCoordinatePatternMatches A (A ∪ B).toList S ↔ retainsProbes A B S := by constructor · intro h refine ⟨?_, Finset.disjoint_left.mpr ?_⟩ · intro i hi exact (h i (Finset.mem_toList.mpr (Finset.mem_union_left B hi))).mp hi · intro i hiS hiB have hiA := (h i (Finset.mem_toList.mpr (Finset.mem_union_right A hiB))).mpr hiS exact Finset.disjoint_left.mp hAB hiA hiB · rintro ⟨hA, hB⟩ i hi have hu := Finset.mem_toList.mp hi constructor · exact fun hiA => hA hiA · intro hiS rcases Finset.mem_union.mp hu with hiA | hiB · exact hiA · exact (Finset.disjoint_left.mp hB hiS hiB).elim theorem finite_symmetric_probe_energy {I X : Type*} [Fintype I] [DecidableEq I] [Fintype X] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hmass : ∑ x, μ x = 1) (A B : Finset I) (hAB : Disjoint A B) (hm : 0 < A.card) (f : (I → X) → ℂ) (hsym : ∀ σ : Equiv.Perm I, finiteSlotPermute σ f = f) : finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) (finiteCoordinateComponent (fun _ : I => μ) A (A ∪ B).toList f) ≤ ((B.card : ℝ) ^ B.card / (A.card : ℝ) ^ B.card) * finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) f := by let is := (Finset.univ : Finset I).toList have hn : is.Nodup := Finset.nodup_toList _ have hall : ∀ i, i ∈ is := by intro i; simp [is] have hset : is.toFinset = Finset.univ := by simp [is] let e : Finset I → ℝ := fun S => finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) (finiteCoordinateComponent (fun _ : I => μ) S is f) have he : ∀ S ⊆ (Finset.univ : Finset I), 0 ≤ e S := by intro S _ exact Finset.sum_nonneg (fun x _ => mul_nonneg (Finset.prod_nonneg (fun i _ => hμ (x i))) (sq_nonneg _)) have hc : ∀ S ⊆ (Finset.univ : Finset I), ∀ T ⊆ Finset.univ, S.card = T.card → e S = e T := by intro S _ T _ hST exact finite_symmetric_component_energy_card μ is hn hall S T hST f hsym have htotal : (∑ S ∈ (Finset.univ : Finset I).powerset, e S) = finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) f := by simpa only [hset] using finite_coordinate_component_energy_sum (fun _ : I => μ) (fun _ x => hμ x) (fun _ => hmass) is hn f have hb := finite_symmetric_subset_retention_bound (Finset.univ : Finset I) A B (Finset.subset_univ A) (Finset.subset_univ B) hAB hm e he hc rw [htotal] at hb have hfilter : is.toFinset.powerset.filter (finiteCoordinatePatternMatches A (A ∪ B).toList) = (Finset.univ : Finset I).powerset.filter (retainsProbes A B) := by rw [hset] exact Finset.filter_congr (fun S _ => coordinate_pattern_matches_probes A B S hAB) rw [finite_coordinate_retained_energy (fun _ : I => μ) (fun _ x => hμ x) (fun _ => hmass) A is (A ∪ B).toList hn (fun i _ => hall i), hfilter] exact hb end section open Finset theorem seeded_tuple_sum {P Z : Type*} [Fintype P] [Fintype Z] (seed : P → Z) (label : Z → P) (hseed : Function.LeftInverse label seed) (w : Z → ℝ) (hw : ∀ z, seed (label z) ≠ z → w z = 0) (b : ℕ) (F : (Fin b → Z) → ℂ) : (∑ f : Fin b → P, ((∏ j, w (seed (f j)) : ℝ) : ℂ) * F (fun j => seed (f j))) = ∑ q : Fin b → Z, ((∏ j, w (q j) : ℝ) : ℂ) * F q := by classical let e : (Fin b → P) → (Fin b → Z) := fun f j => seed (f j) have he : Function.Injective e := by intro f g h funext j exact hseed.injective (congrFun h j) apply Fintype.sum_of_injective e he · intro q hq have h : ¬ ∀ j, seed (label (q j)) = q j := by intro hh exact hq ⟨fun j => label (q j), funext hh⟩ obtain ⟨j, hj⟩ := not_forall.mp h have hz : (∏ k, w (q k)) = 0 := prod_eq_zero (mem_univ j) (hw _ hj) simp only [hz, Complex.ofReal_zero, zero_mul] · intro f rfl theorem physical_ghost_seed_birth_weight {P : Type*} (n : P → ℕ) (β : P → ℝ) (η V ρ : ℝ) (p : P) : physicalGhostBirth n (1 - η) ρ V (unrestrictedResidueSeed n p) * unrestrictedResidueWeight (fun p => β p / V) (unrestrictedResidueSeed n p) = (-η * V / ρ) * (β p / V) := by unfold physicalGhostBirth split_ifs with h · simp only [unrestrictedResidueWeight, unrestrictedResidueSeed] ring · exact False.elim (h rfl) theorem physical_ghost_birth_tuple_sum {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (β : P → ℝ) (η V ρ : ℝ) (b : ℕ) (F : (Fin b → UnrestrictedResidueParticle n) → ℂ) : (∑ f : Fin b → P, (((-η * V / ρ) ^ b * (∏ j, β (f j) / V) : ℝ) : ℂ) * F (fun j => unrestrictedResidueSeed n (f j))) = ∑ q : Fin b → UnrestrictedResidueParticle n, ((∏ j, physicalGhostBirth n (1 - η) ρ V (q j) * unrestrictedResidueWeight (fun p => β p / V) (q j) : ℝ) : ℂ) * F q := by have he := seeded_tuple_sum (unrestrictedResidueSeed n) Sigma.fst (fun _ => rfl) (fun z => physicalGhostBirth n (1 - η) ρ V z * unrestrictedResidueWeight (fun p => β p / V) z) (by rintro ⟨p, r⟩ h have hr : r ≠ 0 := by intro hr subst r exact h rfl unfold physicalGhostBirth split_ifs with hz · exact False.elim (hr hz) · exact zero_mul _) b F simpa only [physical_ghost_seed_birth_weight, prod_mul_distrib, prod_const, card_univ, Fintype.card_fin] using he end section open Finset theorem physical_ghost_retained_coefficient {P : Type*} (n : P → ℕ) {N : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (η ρ : ℝ) (T : Finset (Fin N)) : (∏ j ∈ univ \ T, physicalGhostRetention n (1 - η) ρ (old j)) = ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeroIndices (fun _ => 0) old \ T).card := by classical have he (j : Fin N) : physicalGhostRetention n (1 - η) ρ (old j) = if j ∈ globalBirthVisitZeroIndices (fun _ => 0) old then (1 - η) / ρ ^ 2 else 1 := by unfold physicalGhostRetention split_ifs with h1 h2 h2 · rfl · exact False.elim (h2 (mem_filter.mpr ⟨mem_univ _, h1⟩)) · exact False.elim (h1 (mem_filter.mp h2).2) · rfl simp_rw [he] rw [Finset.prod_ite_mem, prod_const] congr 1 congr 1 ext j simp only [mem_inter, mem_sdiff, mem_univ, true_and] exact and_comm theorem physical_ghost_terminated_coefficient {P : Type*} (n : P → ℕ) {N : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (η ρ : ℝ) (T : Finset (Fin N)) (hT : T ⊆ globalBirthVisitZeroIndices (fun _ => 0) old) : (∏ j ∈ T, physicalGhostTermination n (1 - η) ρ (old j)) = (-η / ρ) ^ T.card := by classical calc _ = ∏ _j ∈ T, (-η / ρ) := by apply prod_congr rfl intro j hj have hz := (mem_filter.mp (hT hj)).2 unfold physicalGhostTermination split_ifs with h · ring · exact False.elim (h hz) _ = _ := prod_const _ theorem physical_ghost_terminated_coefficient_zero {P : Type*} (n : P → ℕ) {N : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (η ρ : ℝ) (T : Finset (Fin N)) (hT : ¬ T ⊆ globalBirthVisitZeroIndices (fun _ => 0) old) : (∏ j ∈ T, physicalGhostTermination n (1 - η) ρ (old j)) = 0 := by classical obtain ⟨j, hj, hz⟩ := not_subset.mp hT apply prod_eq_zero hj have hr : (old j).2 ≠ 0 := by simpa only [globalBirthVisitZeroIndices, mem_filter, mem_univ, true_and] using hz unfold physicalGhostTermination split_ifs with h · exact False.elim (hr h) · rfl theorem physical_ghost_old_event_coefficient {P : Type*} (n : P → ℕ) {N : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (η ρ : ℝ) (T : Finset (Fin N)) (hT : T ⊆ globalBirthVisitZeroIndices (fun _ => 0) old) : (∏ j ∈ univ \ T, physicalGhostRetention n (1 - η) ρ (old j)) * (∏ j ∈ T, physicalGhostTermination n (1 - η) ρ (old j)) = (-η / ρ) ^ T.card * ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeroIndices (fun _ => 0) old \ T).card := by rw [physical_ghost_retained_coefficient, physical_ghost_terminated_coefficient n old η ρ T hT, mul_comm] end section open Finset Classical section variable {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) abbrev FullActiveEdgeEvent (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) := Σ a : A (productActiveMemorySplit S B x).1, UnrestrictedJointEvent n (Δ (productActiveMemorySplit S B x).1 a) (D (productActiveMemorySplit S B x).1 a) (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B x).2 noncomputable def fullActiveEdgeEventTarget (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B := (productActiveMemorySplit S B).symm ((productActiveMemorySplit S B x).1, unrestrictedJointEventTarget n (Δ (productActiveMemorySplit S B x).1 e.1) (D (productActiveMemorySplit S B x).1 e.1) (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B x).2 e.2) noncomputable def fullActiveEdgeEventWeight [Fintype G] (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) : ℝ := ω (productActiveMemorySplit S B x).1 e.1 * unrestrictedJointCutoffEventWeight n (Δ (productActiveMemorySplit S B x).1 e.1) (D (productActiveMemorySplit S B x).1 e.1) μ ρ V (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B x).2 e.2 theorem fullActiveEdgeEventWeight_nonneg [Fintype G] (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (hω : ∀ c a, 0 ≤ ω c a) (hμ : ∀ g p, 0 ≤ μ g p) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ V g) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) : 0 ≤ fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e := by exact mul_nonneg (hω _ _) (unrestrictedJointCutoffEventWeight_nonneg n _ _ μ V hρ hV hμ _ B _ e.2) end end section open scoped BigOperators Classical noncomputable def finiteSlotSymmetrize {I X : Type*} [Fintype I] [DecidableEq I] (f : (I → X) → ℂ) (x : I → X) : ℂ := (Fintype.card (Equiv.Perm I) : ℂ)⁻¹ * ∑ σ : Equiv.Perm I, f (finiteSlotRelabel σ x) theorem finite_slot_relabel_mul {I X : Type*} (σ τ : Equiv.Perm I) (x : I → X) : finiteSlotRelabel σ (finiteSlotRelabel τ x) = finiteSlotRelabel (τ * σ) x := rfl section variable {I X : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] include I X sharedInstance1 sharedInstance2 theorem finite_slot_symmetrize_invariant (f : (I → X) → ℂ) (τ : Equiv.Perm I) : finiteSlotPermute τ (finiteSlotSymmetrize f) = finiteSlotSymmetrize f := by funext x simp only [finiteSlotPermute, finiteSlotSymmetrize, finite_slot_relabel_mul] congr 1 exact Equiv.sum_comp (Equiv.mulLeft τ) (fun σ => f (finiteSlotRelabel σ x)) theorem finite_slot_symmetrize_eq_self (f : (I → X) → ℂ) (hsym : ∀ σ : Equiv.Perm I, finiteSlotPermute σ f = f) : finiteSlotSymmetrize f = f := by funext x have hv (σ : Equiv.Perm I) : f (finiteSlotRelabel σ x) = f x := congrFun (hsym σ) x simp only [finiteSlotSymmetrize, hv, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] rw [← mul_assoc, inv_mul_cancel₀, one_mul] exact_mod_cast Fintype.card_ne_zero theorem finite_slot_symmetrize_pointwise (f : (I → X) → ℂ) (x : I → X) : ‖finiteSlotSymmetrize f x‖ ^ 2 ≤ (Fintype.card (Equiv.Perm I) : ℝ)⁻¹ * ∑ σ : Equiv.Perm I, ‖f (finiteSlotRelabel σ x)‖ ^ 2 := by have hc : (0 : ℝ) < Fintype.card (Equiv.Perm I) := by exact_mod_cast Fintype.card_pos have hsum := complex_row_weighted_cauchy (Finset.univ : Finset (Equiv.Perm I)) (fun _ => 1) (fun σ => f (finiteSlotRelabel σ x)) (fun _ => 1) (by intros; norm_num) have hs : ‖∑ σ : Equiv.Perm I, f (finiteSlotRelabel σ x)‖ ^ 2 ≤ (Fintype.card (Equiv.Perm I) : ℝ) * ∑ σ : Equiv.Perm I, ‖f (finiteSlotRelabel σ x)‖ ^ 2 := by simpa using hsum unfold finiteSlotSymmetrize rw [norm_mul, norm_inv, Complex.norm_natCast, mul_pow] calc _ ≤ ((Fintype.card (Equiv.Perm I) : ℝ)⁻¹) ^ 2 * ((Fintype.card (Equiv.Perm I) : ℝ) * ∑ σ : Equiv.Perm I, ‖f (finiteSlotRelabel σ x)‖ ^ 2) := mul_le_mul_of_nonneg_left hs (sq_nonneg _) _ = _ := by field_simp theorem finite_slot_symmetrize_energy [Fintype X] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (f : (I → X) → ℂ) : finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) (finiteSlotSymmetrize f) ≤ finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) f := by let w := finiteProductWeight (fun _ : I => μ) have hw : ∀ x, 0 ≤ w x := fun x => Finset.prod_nonneg (fun i _ => hμ (x i)) have hc : (Fintype.card (Equiv.Perm I) : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero change (∑ x, w x * ‖finiteSlotSymmetrize f x‖ ^ 2) ≤ ∑ x, w x * ‖f x‖ ^ 2 calc _ ≤ ∑ x, w x * ((Fintype.card (Equiv.Perm I) : ℝ)⁻¹ * ∑ σ : Equiv.Perm I, ‖f (finiteSlotRelabel σ x)‖ ^ 2) := Finset.sum_le_sum (fun x _ => mul_le_mul_of_nonneg_left (finite_slot_symmetrize_pointwise f x) (hw x)) _ = (Fintype.card (Equiv.Perm I) : ℝ)⁻¹ * ∑ σ : Equiv.Perm I, ∑ x, w x * ‖f (finiteSlotRelabel σ x)‖ ^ 2 := by rw [Finset.sum_comm] simp_rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro σ _ ring _ = (Fintype.card (Equiv.Perm I) : ℝ)⁻¹ * ∑ _σ : Equiv.Perm I, ∑ x, w x * ‖f x‖ ^ 2 := by congr 1 apply Finset.sum_congr rfl intro σ _ exact finite_slot_energy_invariant μ σ f _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul]; field_simp theorem finite_projected_probe_energy [Fintype X] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hmass : ∑ x, μ x = 1) (A B : Finset I) (hAB : Disjoint A B) (hm : 0 < A.card) (f : (I → X) → ℂ) : finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) (finiteCoordinateComponent (fun _ : I => μ) A (A ∪ B).toList (finiteSlotSymmetrize f)) ≤ ((B.card : ℝ) ^ B.card / (A.card : ℝ) ^ B.card) * finiteWeightedEnergy (finiteProductWeight (fun _ : I => μ)) f := by exact (finite_symmetric_probe_energy μ hμ hmass A B hAB hm (finiteSlotSymmetrize f) (finite_slot_symmetrize_invariant f)).trans (mul_le_mul_of_nonneg_left (finite_slot_symmetrize_energy μ hμ f) (by positivity)) end end section open scoped BigOperators Classical theorem finite_coordinate_lift_preserves_invariance {G : Type*} [DecidableEq G] {Y : G → Type*} (g h : G) (hgh : g ≠ h) (r : Y g → Y g) (A : (Y h → ℂ) → Y h → ℂ) (f : (∀ j, Y j) → ℂ) (hf : ∀ x, f (Function.update x g (r (x g))) = f x) (x : ∀ j, Y j) : finiteCoordinateLift h A f (Function.update x g (r (x g))) = finiteCoordinateLift h A f x := by rw [finite_coordinate_lift_eq_update, finite_coordinate_lift_eq_update, Function.update_of_ne hgh.symm] congr 1 funext y rw [Function.update_comm hgh] have hy : (Function.update x h y) g = x g := Function.update_of_ne hgh _ _ simpa only [hy] using hf (Function.update x h y) theorem finite_coordinate_compose_preserves_invariance {G : Type*} [DecidableEq G] {Y : G → Type*} (g : G) (r : Y g → Y g) (A : ∀ h, (Y h → ℂ) → Y h → ℂ) (is : List G) (hg : g ∉ is) (f : (∀ j, Y j) → ℂ) (hf : ∀ x, f (Function.update x g (r (x g))) = f x) (x : ∀ j, Y j) : finiteCoordinateCompose A is f (Function.update x g (r (x g))) = finiteCoordinateCompose A is f x := by induction is generalizing x with | nil => exact hf x | cons h is ih => have hgh : g ≠ h := fun he => hg (List.mem_cons.mpr (Or.inl he)) have htail : g ∉ is := fun hi => hg (List.mem_cons_of_mem _ hi) exact finite_coordinate_lift_preserves_invariance g h hgh r (A h) (finiteCoordinateCompose A is f) (fun y => ih htail y) x end section open scoped BigOperators Classical section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] {X : I → Type*} [sharedInstance4 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ y, μ i y = 1) include I sharedInstance1 sharedInstance2 X sharedInstance4 μ hμ hmass theorem finite_coordinate_component_energy_le (is : List I) (hnodup : is.Nodup) (S : Finset I) (hS : S ⊆ is.toFinset) (f : (∀ j, X j) → ℂ) : finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ S is f) ≤ finiteWeightedEnergy (finiteProductWeight μ) f := by have h := Finset.single_le_sum (f := fun T => finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ T is f)) (s := is.toFinset.powerset) (fun T _ => Finset.sum_nonneg (fun x _ => mul_nonneg (Finset.prod_nonneg (fun i _ => hμ i (x i))) (sq_nonneg _))) (Finset.mem_powerset.mpr hS) exact h.trans_eq (finite_coordinate_component_energy_sum μ hμ hmass is hnodup f) theorem finite_coordinate_averaging_energy_le (s : Finset I) (f : (∀ j, X j) → ℂ) : finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ ∅ s.toList f) ≤ finiteWeightedEnergy (finiteProductWeight μ) f := finite_coordinate_component_energy_le μ hμ hmass s.toList (Finset.nodup_toList s) ∅ (Finset.empty_subset _) f end theorem finite_tensor_averaging_energy_le {G : Type*} [Fintype G] [DecidableEq G] {I X : G → Type*} [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)] [∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (hμ : ∀ g x, 0 ≤ μ g x) (hmass : ∀ g, ∑ x, μ g x = 1) (B : ∀ g, Finset (I g)) (s : Finset G) (f : (∀ g, I g → X g) → ℂ) : finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) (finiteCoordinateFinsetAction (fun g v => finiteCoordinateComponent (fun _ : I g => μ g) ∅ (B g).toList v) s f) ≤ finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f := by have hlocal (g : G) (v : (I g → X g) → ℂ) : finiteWeightedEnergy (finiteProductWeight (fun _ : I g => μ g)) (finiteCoordinateComponent (fun _ : I g => μ g) ∅ (B g).toList v) ≤ 1 * finiteWeightedEnergy (finiteProductWeight (fun _ : I g => μ g)) v := by simpa only [one_mul] using (finite_coordinate_averaging_energy_le (fun _ : I g => μ g) (fun _ x => hμ g x) (fun _ => hmass g) (B g) v) have h := finite_coordinate_finset_energy_le (fun g => finiteProductWeight (fun _ : I g => μ g)) (fun g x => Finset.prod_nonneg (fun i _ => hμ g (x i))) (fun g v => finiteCoordinateComponent (fun _ : I g => μ g) ∅ (B g).toList v) (fun _ => (1 : ℝ)) (fun _ => zero_le_one) hlocal s f simpa only [Finset.prod_const_one, one_mul] using h end section open Finset Classical abbrev FullActiveSlotPermutations {G : Type*} (M : G → ℕ) := ∀ g, Equiv.Perm (Fin (M g)) def fullActivePermutation {G : Type*} {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (τ : FullActiveSlotPermutations M) : ProductBoundedOrderedState P Z M B ≃ ProductBoundedOrderedState P Z M B where toFun x g := ((x g).1 ∘ τ g, (x g).2) invFun x g := ((x g).1 ∘ (τ g).symm, (x g).2) left_inv x := by funext g apply Prod.ext · funext i exact congrArg (x g).1 ((τ g).apply_symm_apply i) · rfl right_inv x := by funext g apply Prod.ext · funext i exact congrArg (x g).1 ((τ g).symm_apply_apply i) · rfl theorem fullActivePermutation_weight {G : Type*} [Fintype G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (τ : FullActiveSlotPermutations M) (x : ProductBoundedOrderedState P Z M B) : productMemoryWeight μ ν (fullActivePermutation τ x) = productMemoryWeight μ ν x := by apply prod_congr rfl intro g _ change (∏ i, μ g ((x g).1 (τ g i))) * boundedOrderedMemoryWeight (ν g) (x g).2 = (∏ i, μ g ((x g).1 i)) * boundedOrderedMemoryWeight (ν g) (x g).2 exact congrArg (fun r : ℝ => r * boundedOrderedMemoryWeight (ν g) (x g).2) (Equiv.prod_comp (τ g) (fun i => μ g ((x g).1 i))) theorem fullActivePermutation_total_memory {G : Type*} [Fintype G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (τ : FullActiveSlotPermutations M) (x : ProductBoundedOrderedState P Z M B) : productTotalMemory (fullActivePermutation τ x) = productTotalMemory x := rfl theorem fullActivePermutation_memory_permute {G : Type*} [DecidableEq G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (τ : FullActiveSlotPermutations M) (x : ProductBoundedOrderedState P Z M B) (g : G) (σ : Equiv.Perm (Fin (x g).2.1.val)) : fullActivePermutation τ (productMemoryPermuteAt x g σ) = productMemoryPermuteAt (fullActivePermutation τ x) g σ := by funext h by_cases hh : h = g · subst h change (((productMemoryPermuteAt x g σ) g).1 ∘ τ g, ((productMemoryPermuteAt x g σ) g).2) = _ simp only [productMemoryPermuteAt, Function.update_self] rfl · change (((productMemoryPermuteAt x g σ) h).1 ∘ τ h, ((productMemoryPermuteAt x g σ) h).2) = _ simp only [productMemoryPermuteAt, Function.update_of_ne hh] rfl theorem fullActivePermutation_symmetric {G : Type*} [DecidableEq G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (τ : FullActiveSlotPermutations M) (f : ProductBoundedOrderedState P Z M B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (fun x => f (fullActivePermutation τ x)) := by intro x g σ change f (fullActivePermutation τ (productMemoryPermuteAt x g σ)) = f (fullActivePermutation τ x) rw [fullActivePermutation_memory_permute τ x g σ] exact hf (fullActivePermutation τ x) g σ theorem fullActivePermutation_energy {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {M : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (τ : FullActiveSlotPermutations M) (f : ProductBoundedOrderedState P Z M B → ℂ) : finiteWeightedEnergy (productMemoryWeight μ ν) (fun x => f (fullActivePermutation τ x)) = finiteWeightedEnergy (productMemoryWeight μ ν) f := by have h := Equiv.sum_comp (fullActivePermutation τ) (fun x => productMemoryWeight μ ν x * ‖f x‖ ^ 2) simpa only [finiteWeightedEnergy, fullActivePermutation_weight] using h end section open Finset open scoped Classical def promotionEligibilityInclusion {A J : Type*} {small large : Finset J} (h : small ⊆ large) (e : A ↪ small) : A ↪ large := ⟨fun a => ⟨(e a).val, h (e a).property⟩, fun _ _ he => e.injective (Subtype.ext (congrArg (fun x : large => x.val) he))⟩ theorem promotion_eligibility_inclusion_injective {A J : Type*} {small large : Finset J} (h : small ⊆ large) : Function.Injective (promotionEligibilityInclusion (A := A) h) := by intro e f he ext a exact congrArg (fun x : large => x.val) (congrArg (fun k : A ↪ large => k a) he) theorem promotion_eligibility_sum_restrict {A J M : Type*} [Fintype A] [AddCommMonoid M] {small large : Finset J} (h : small ⊆ large) (F : (A ↪ large) → M) (hzero : ∀ e, (∃ a, (e a).val ∉ small) → F e = 0) : (∑ e : A ↪ small, F (promotionEligibilityInclusion h e)) = ∑ e : A ↪ large, F e := by classical apply Fintype.sum_of_injective (promotionEligibilityInclusion h) (promotion_eligibility_inclusion_injective h) · intro e he apply hzero e by_contra! hn apply he refine ⟨⟨fun a => ⟨(e a).val, hn a⟩, ?_⟩, ?_⟩ · intro a b hab exact e.injective (Subtype.ext (congrArg (fun x : small => x.val) hab)) · ext a rfl · intro e rfl theorem unrestricted_edge_action_restrict_eligibility {P Z : Type*} [Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (label : Z → P) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V : ℝ) (small large : Finset (Fin N)) (h : small ⊆ large) (B : ℕ) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ large) → UnrestrictedFreshLabels P promotions → ℂ) (hzero : ∀ stores promotions e fresh, (∃ a, (e a).val ∉ small) → phase stores promotions e fresh = 0) (F : (Fin t → P) → FiniteOrderedTuple Z → ℂ) : unrestrictedEdgeAction source old label seed transport hit μ ρ V small B (fun stores promotions e fresh => phase stores promotions (promotionEligibilityInclusion h e) fresh) F = unrestrictedEdgeAction source old label seed transport hit μ ρ V large B phase F := by unfold unrestrictedEdgeAction apply sum_congr rfl intro stores _ apply sum_congr rfl intro promotions _ apply promotion_eligibility_sum_restrict h (fun e => ∑ fresh : UnrestrictedFreshLabels P promotions, (unrestrictedEdgeEventMass source old seed transport hit μ ρ V stores promotions e fresh : ℂ) * phase stores promotions e fresh * (if (unrestrictedEdgeOutput source old seed transport stores promotions e).1 ≤ B then F (unrestrictedEdgeTarget old label promotions e fresh) (unrestrictedEdgeOutput source old seed transport stores promotions e) else 0)) intro e he apply sum_eq_zero intro fresh _ rw [hzero stores promotions e fresh he] simp only [mul_zero, zero_mul] end section open Finset open scoped Classical theorem unrestricted_edge_action_cutoff_congr {P Z : Type*} [Fintype P] {t N : ℕ} (source : Fin t → P) (old : Fin N → Z) (label : Z → P) (seed : P → Z) (transport : Z → Z) (hit : Z → Prop) (μ : P → ℝ) (ρ V : ℝ) (eligible : Finset (Fin N)) (B : ℕ) (phase : ∀ (_stores promotions : Finset (Fin t)), (promotions ↪ eligible) → UnrestrictedFreshLabels P promotions → ℂ) (F K : (Fin t → P) → FiniteOrderedTuple Z → ℂ) (hFK : ∀ target q, q.1 ≤ B → F target q = K target q) : unrestrictedEdgeAction source old label seed transport hit μ ρ V eligible B phase F = unrestrictedEdgeAction source old label seed transport hit μ ρ V eligible B phase K := by unfold unrestrictedEdgeAction apply sum_congr rfl intro stores _ apply sum_congr rfl intro promotions _ apply sum_congr rfl intro e _ apply sum_congr rfl intro fresh _ congr 1 split_ifs with hq · exact hFK _ _ hq · rfl theorem unrestricted_residue_action_raw_event_sum {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (phase : UnrestrictedBoundedPhase n Δ D t B) (F : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : unrestrictedResidueEdgeAction n Δ D s.1 s.2.2 μ ρ V B (phase s) F = ∑ e : UnrestrictedBoundedEvent n Δ D t B s, (unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e : ℂ) * phase s e.1 e.2.1 e.2.2.1 e.2.2.2 * F (unrestrictedBoundedEventTarget n Δ D t B s e).1 (boundedOrderedTupleToFinite (unrestrictedBoundedEventTarget n Δ D t B s e).2) := by let f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ := fun u => F u.1 (boundedOrderedTupleToFinite u.2) have he : unrestrictedResidueEdgeAction n Δ D s.1 s.2.2 μ ρ V B (phase s) F = unrestrictedBoundedOperator n Δ D μ ρ V t B phase f s := by unfold unrestrictedBoundedOperator unrestrictedBoundedAction unrestrictedResidueEdgeAction apply unrestricted_edge_action_cutoff_congr intro target q hq rw [boundedOrderedZeroExtension_of_le _ _ _ hq] rfl rw [he, unrestricted_bounded_operator_eq_event_sum] end section open Finset theorem physical_group_unshared_source_not_dvd {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (havoid : physicalAuxAvoids C aux L) (g : G) (i : Fin (ell + (C g).card)) : ¬ ((physicalGroupUnsharedEmbedding C L g i).val : ℤ) ∣ (physicalD C L aux : ℤ) := by rw [Int.natCast_dvd_natCast] exact physical_unshared_mark_not_dvd_D C L aux hP hdis havoid g (physicalGroupUnsharedIndex (ell := ell) (C g) i).val (physicalGroupUnsharedIndex (ell := ell) (C g) i).property theorem physical_group_unshared_target_not_dvd {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (hlist : physicalListAdmissible C aux L R) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (i : Fin (ell + (C g).card)) : ¬ ((physicalGroupUnsharedEmbedding C R g i).val : ℤ) ∣ (physicalD C L aux : ℤ) := by rw [physical_D_eq_of_shared C hlist.1 aux] exact physical_group_unshared_source_not_dvd C R aux hP hdis hlist.2.2 g i theorem physical_group_phase_delta_as_integer_step {G : Type*} {P : G → Finset ℕ} (a b k D : ℤ) (hstep : b = a + k * D) (g : G) : physicalGroupPhaseDelta (P := P) a b g = fun p : ↥(P g) => ((-k * D : ℤ) : ZMod p.val) := by funext p unfold physicalGroupPhaseDelta congr 1 rw [hstep] ring end section open Finset theorem exists_prime_reciprocal_shell_bound : ∃ C : ℝ, 0 ≤ C ∧ ∀ w : ℝ, 1 < w → primeBandHarmonic w (w^2) ≤ C := by obtain ⟨vmin, vmax, t0, _, hvmax, _, hlarge⟩ := exists_primeBandHarmonic_threshold (by norm_num : (1 : ℝ) < 2) let M := primeBandHarmonic 0 (Real.exp (2*t0)) have hM : 0 ≤ M := primeBandHarmonic_nonneg _ _ refine ⟨vmax + M, add_nonneg hvmax.le hM, ?_⟩ intro w hw have hw0 : 0 < w := zero_lt_one.trans hw have he : Real.exp (2 * Real.log w) = w^2 := by rw [two_mul, Real.exp_add, Real.exp_log hw0, pow_two] by_cases ht : t0 ≤ Real.log w · have hb := (hlarge (Real.log w) ht).2 rw [Real.exp_log hw0, he] at hb exact hb.trans (le_add_of_nonneg_right hM) · have hwtop : w^2 ≤ Real.exp (2*t0) := by rw [← he] apply Real.exp_le_exp.mpr linarith have hsub : primeBand w (w^2) ⊆ primeBand 0 (Real.exp (2*t0)) := by intro p hp obtain ⟨hp, hwp, hpw⟩ := (mem_primeBand_iff hw0.le (sq_nonneg w) p).mp hp exact (mem_primeBand_iff le_rfl (Real.exp_pos _).le p).mpr ⟨hp, hw0.trans hwp, hpw.trans hwtop⟩ have hb : primeBandHarmonic w (w^2) ≤ M := sum_le_sum_of_subset_of_nonneg hsub (fun p _ _ => by positivity) exact hb.trans (le_add_of_nonneg_left hvmax.le) theorem finite_prime_reciprocal_shell_le_band (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {w : ℝ} (hw : 1 < w) : (∑ p ∈ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2), 1 / (p : ℝ)) ≤ primeBandHarmonic w (w^2) := by have hsub : P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2) ⊆ primeBand w (w^2) := by intro p hp obtain ⟨hp, hlo, hhi⟩ := mem_filter.mp hp exact (mem_primeBand_iff (zero_lt_one.trans hw).le (sq_nonneg w) p).mpr ⟨hP p hp, hlo, hhi⟩ exact sum_le_sum_of_subset_of_nonneg hsub (fun p _ _ => by positivity) theorem exists_finite_prime_reciprocal_shell_bound : ∃ C : ℝ, 0 ≤ C ∧ ∀ P : Finset ℕ, (∀ p ∈ P, p.Prime) → ∀ w : ℝ, 1 < w → (∑ p ∈ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2), 1 / (p : ℝ)) ≤ C := by obtain ⟨C, hC, hbound⟩ := exists_prime_reciprocal_shell_bound refine ⟨C, hC, ?_⟩ intro P hP w hw exact (finite_prime_reciprocal_shell_le_band P hP hw).trans (hbound w hw) end section open Finset theorem interval_multiples_card (A B d : ℕ) (hAB : A ≤ B) : ((Ioc A B).filter (fun n => d ∣ n)).card = B / d - A / d := by have hd : Disjoint ((Ioc 0 A).filter (fun n => d ∣ n)) ((Ioc A B).filter (fun n => d ∣ n)) := (Ioc_disjoint_Ioc_of_le (le_refl A)).mono (filter_subset _ _) (filter_subset _ _) have hu : ((Ioc 0 A).filter (fun n => d ∣ n)) ∪ ((Ioc A B).filter (fun n => d ∣ n)) = (Ioc 0 B).filter (fun n => d ∣ n) := by rw [← filter_union, Ioc_union_Ioc_eq_Ioc (Nat.zero_le A) hAB] have hcard := card_union_of_disjoint hd rw [hu, Nat.Ioc_filter_dvd_card_eq_div, Nat.Ioc_filter_dvd_card_eq_div] at hcard omega theorem nat_real_div_lt_cast_div_add_one (m d : ℕ) (hd : 0 < d) : (m : ℝ) / (d : ℝ) < ((m / d : ℕ) : ℝ) + 1 := by have hm : m < (m / d + 1) * d := by calc m = m % d + d * (m / d) := (Nat.mod_add_div m d).symm _ < d + d * (m / d) := Nat.add_lt_add_right (Nat.mod_lt m hd) _ _ = (m / d + 1) * d := by ring have hmR : (m : ℝ) < (((m / d : ℕ) : ℝ) + 1) * (d : ℝ) := by exact_mod_cast hm exact (div_lt_iff₀ (Nat.cast_pos.mpr hd)).mpr hmR theorem interval_multiples_error_lt_one (A B d : ℕ) (hAB : A ≤ B) (hd : 0 < d) : |(((Ioc A B).filter (fun n => d ∣ n)).card : ℝ) - ((B : ℝ) - (A : ℝ)) / (d : ℝ)| < 1 := by rw [interval_multiples_card A B d hAB, Nat.cast_sub (Nat.div_le_div_right hAB), sub_div] have hAlo : ((A / d : ℕ) : ℝ) ≤ (A : ℝ) / d := Nat.cast_div_le have hBlo : ((B / d : ℕ) : ℝ) ≤ (B : ℝ) / d := Nat.cast_div_le have hAhi := nat_real_div_lt_cast_div_add_one A d hd have hBhi := nat_real_div_lt_cast_div_add_one B d hd apply abs_lt.mpr constructor <;> linarith theorem interval_multiples_error_le_one (A B d : ℕ) (hAB : A ≤ B) (hd : 0 < d) : |(((Ioc A B).filter (fun n => d ∣ n)).card : ℝ) - ((B : ℝ) - (A : ℝ)) / (d : ℝ)| ≤ 1 := (interval_multiples_error_lt_one A B d hAB hd).le end section open Finset theorem mem_small_prime_pool_iff {z : ℝ} (hz : 0 ≤ z) (p : ℕ) : p ∈ primeBand 0 z ↔ p.Prime ∧ (p : ℝ) ≤ z := by rw [mem_primeBand_iff le_rfl hz] constructor · exact fun hp => ⟨hp.1, hp.2.2⟩ · exact fun hp => ⟨hp.1, Nat.cast_pos.mpr hp.1.pos, hp.2⟩ theorem small_prime_pool_prime {z : ℝ} {p : ℕ} (hp : p ∈ primeBand 0 z) : p.Prime := (mem_filter.mp hp).2 theorem small_prime_pool_le {z : ℝ} (hz : 0 ≤ z) {p : ℕ} (hp : p ∈ primeBand 0 z) : (p : ℝ) ≤ z := ((mem_small_prime_pool_iff hz p).mp hp).2 theorem small_prime_avoidance_iff_rough {z : ℝ} {n : ℕ} (hz : 0 ≤ z) (hn : n ≠ 0) : (∀ p ∈ primeBand 0 z, ¬p ∣ n) ↔ ∀ p ∈ n.primeFactors, z < (p : ℝ) := by constructor · intro hav p hp by_contra hnot exact hav p ((mem_small_prime_pool_iff hz p).mpr ⟨Nat.prime_of_mem_primeFactors hp, le_of_not_gt hnot⟩) (Nat.dvd_of_mem_primeFactors hp) · intro hrough p hp hdiv have hlarge := hrough p (Nat.mem_primeFactors.mpr ⟨small_prime_pool_prime hp, hdiv, hn⟩) exact (not_lt_of_ge (small_prime_pool_le hz hp)) hlarge theorem interval_small_prime_avoidance_eq_rough (A B : ℕ) {z : ℝ} (hz : 0 ≤ z) : (Ioc A B).filter (fun n : ℕ => ∀ p ∈ primeBand 0 z, ¬p ∣ n) = (Ioc A B).filter (fun n : ℕ => ∀ p : ℕ, p ∈ n.primeFactors → z < (p : ℝ)) := by classical apply filter_congr intro n hn have hn0 : n ≠ 0 := (lt_of_le_of_lt (Nat.zero_le A) (mem_Ioc.mp hn).1).ne' exact small_prime_avoidance_iff_rough hz hn0 end section open Finset MeasureTheory private theorem theta_eq_log_sum (x : ℝ) : Chebyshev.theta x = ∑ n ∈ Icc 0 ⌊x⌋₊, if n.Prime then Real.log (n : ℝ) else 0 := by rw [Chebyshev.theta_eq_sum_Icc, sum_filter] private theorem theta_quotient_integrable {z : ℝ} (hz : 1 ≤ z) : IntervalIntegrable (fun t => Chebyshev.theta t / t^2) volume 1 z := by rw [intervalIntegrable_iff_integrableOn_Icc_of_le hz] have hg : IntegrableOn (fun t : ℝ => (t^2)⁻¹) (Set.Icc 1 z) := by apply ContinuousOn.integrableOn_Icc intro t ht have ht0 : t ≠ 0 := by linarith [ht.1] have ht2 : t^2 ≠ 0 := pow_ne_zero 2 ht0 fun_prop have hi := integrableOn_mul_sum_Icc (fun n => if n.Prime then Real.log (n : ℝ) else 0) (by norm_num : (0 : ℝ) ≤ 1) hg (m := 0) simpa only [← theta_eq_log_sum, div_eq_mul_inv, mul_comm] using hi theorem prime_log_reciprocal_sum_eq_abel {z : ℝ} (hz : 1 ≤ z) : (∑ p ∈ primeBand 0 z, Real.log (p : ℝ) / p) = Chebyshev.theta z / z + ∫ t in (1 : ℝ)..z, Chebyshev.theta t / t^2 := by let c : ℕ → ℝ := fun n => if n.Prime then Real.log (n : ℝ) else 0 have hc (x : ℝ) : (∑ n ∈ Icc 0 ⌊x⌋₊, c n) = Chebyshev.theta x := (theta_eq_log_sum x).symm have hd : ∀ t ∈ Set.Icc (1 : ℝ) z, DifferentiableAt ℝ (fun t : ℝ => t⁻¹) t := by intro t ht have ht0 : t ≠ 0 := by linarith [ht.1] fun_prop have hi : IntegrableOn (deriv (fun t : ℝ => t⁻¹)) (Set.Icc 1 z) := by simp only [deriv_inv'] apply ContinuousOn.integrableOn_Icc intro t ht have ht0 : t ≠ 0 := by linarith [ht.1] have ht2 : t^2 ≠ 0 := pow_ne_zero 2 ht0 fun_prop have hs := sum_mul_eq_sub_sub_integral_mul c (by norm_num : (0 : ℝ) ≤ 1) hz hd hi have hl : (∑ n ∈ Ioc ⌊(1 : ℝ)⌋₊ ⌊z⌋₊, (n : ℝ)⁻¹ * c n) = ∑ p ∈ primeBand 0 z, Real.log (p : ℝ) / p := by have hsets : (Ioc 1 ⌊z⌋₊).filter Nat.Prime = primeBand 0 z := by ext p simp only [primeBand, Nat.floor_zero, mem_filter, mem_Ioc] constructor · rintro ⟨⟨hp, hpz⟩, hprime⟩ exact ⟨⟨by omega, hpz⟩, hprime⟩ · rintro ⟨⟨_, hpz⟩, hprime⟩ exact ⟨⟨hprime.one_lt, hpz⟩, hprime⟩ rw [Nat.floor_one, ← hsets, sum_filter] apply sum_congr rfl intro p _ simp only [c, mul_ite, mul_zero, div_eq_mul_inv] split_ifs <;> ring have he : (fun t : ℝ => deriv (fun t : ℝ => t⁻¹) t * ∑ n ∈ Icc 0 ⌊t⌋₊, c n) = (fun t => -(Chebyshev.theta t / t^2)) := by funext t rw [deriv_inv, hc] ring rw [hl, hc, hc, Chebyshev.theta_one, mul_zero, sub_zero, he, integral_neg, ← intervalIntegral.integral_of_le hz, sub_neg_eq_add] at hs simpa only [div_eq_mul_inv, mul_comm] using hs theorem prime_log_reciprocal_sum_le {z : ℝ} (hz : 1 ≤ z) : (∑ p ∈ primeBand 0 z, Real.log (p : ℝ) / p) ≤ Real.log 4 * (1 + Real.log z) := by have hz0 : 0 < z := zero_lt_one.trans_le hz have hlog : IntervalIntegrable (fun t : ℝ => 1 / t) volume 1 z := by apply ContinuousOn.intervalIntegrable intro t ht rw [Set.uIcc_of_le hz] at ht have ht0 : t ≠ 0 := by linarith [ht.1] fun_prop have hib : (∫ t in (1 : ℝ)..z, Chebyshev.theta t / t^2) ≤ Real.log 4 * Real.log z := by calc _ ≤ ∫ t in (1 : ℝ)..z, Real.log 4 * (1 / t) := by apply intervalIntegral.integral_mono_on hz (theta_quotient_integrable hz) (hlog.const_mul _) intro t ht have ht0 : 0 < t := zero_lt_one.trans_le ht.1 have htheta := Chebyshev.theta_le_log4_mul_x ht0.le calc Chebyshev.theta t / t^2 ≤ (Real.log 4 * t) / t^2 := div_le_div_of_nonneg_right htheta (sq_nonneg t) _ = Real.log 4 * (1 / t) := by field_simp _ = Real.log 4 * Real.log z := by rw [intervalIntegral.integral_const_mul] congr 1 simp only [one_div] rw [integral_inv (by simp [Set.uIcc_of_le hz]), div_one] have he : Chebyshev.theta z / z ≤ Real.log 4 := by exact (div_le_iff₀ hz0).mpr (Chebyshev.theta_le_log4_mul_x hz0.le) rw [prime_log_reciprocal_sum_eq_abel hz] nlinarith theorem finite_prime_log_reciprocal_sum_le (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {z : ℝ} (hz : 1 ≤ z) (hbound : ∀ p ∈ P, (p : ℝ) ≤ z) : (∑ p ∈ P, Real.log (p : ℝ) / p) ≤ Real.log 4 * (1 + Real.log z) := by apply le_trans _ (prime_log_reciprocal_sum_le hz) apply sum_le_sum_of_subset_of_nonneg · intro p hp exact (mem_primeBand_iff (by norm_num) (by linarith) p).mpr ⟨hP p hp, by exact_mod_cast (hP p hp).pos, hbound p hp⟩ · intro p _ _ exact div_nonneg (Real.log_natCast_nonneg p) (Nat.cast_nonneg p) theorem subset_log_moment_bound {ι : Type*} (P : Finset ι) (a w : ι → ℝ) (ha : ∀ p ∈ P, 0 ≤ a p) (hw : ∀ p ∈ P, 0 ≤ w p) : (∑ S ∈ P.powerset, (∑ p ∈ S, w p) * ∏ p ∈ S, a p) ≤ (∏ p ∈ P, (1 + a p)) * ∑ p ∈ P, w p * a p := by classical induction P using Finset.induction_on with | empty => simp | @insert p P hp ih => have hap := ha p (mem_insert_self _ _) have hwp := hw p (mem_insert_self _ _) have haP : ∀ r ∈ P, 0 ≤ a r := fun r hr => ha r (mem_insert_of_mem hr) have hwP : ∀ r ∈ P, 0 ≤ w r := fun r hr => hw r (mem_insert_of_mem hr) have hrec := ih haP hwP have hZ : 0 ≤ ∏ r ∈ P, (1 + a r) := prod_nonneg (fun r hr => by linarith [haP r hr]) have hnew : (∑ S ∈ P.powerset, (∑ r ∈ insert p S, w r) * ∏ r ∈ insert p S, a r) = a p * (∑ S ∈ P.powerset, (∑ r ∈ S, w r) * ∏ r ∈ S, a r) + (w p * a p) * ∏ r ∈ P, (1 + a r) := by rw [prod_one_add, mul_sum, mul_sum, ← sum_add_distrib] apply sum_congr rfl intro S hS have hpS : p ∉ S := fun h => hp ((mem_powerset.mp hS) h) rw [sum_insert hpS, prod_insert hpS] ring rw [sum_powerset_insert hp, hnew, prod_insert hp, sum_insert hp] have hdiff := mul_nonneg hap (sub_nonneg.mpr hrec) have hextra := mul_nonneg (mul_nonneg hap (mul_nonneg hwp hap)) hZ nlinarith /- A logarithmic moment bound converts directly into a bound for reciprocal mass. -/ theorem finite_reciprocal_mass_le_of_log_moment (T : Finset ℕ) (hT : ∀ n ∈ T, 0 < n) {B : ℝ} (hB : 0 < B) (hmoment : (∑ n ∈ T, Real.log (n : ℝ) / n) ≤ B * ∑ n ∈ T, 1 / (n : ℝ)) : (∑ n ∈ T, 1 / (n : ℝ)) ≤ 2 + 4 * B := by classical let F : Finset ℕ := T.filter (fun n : ℕ => (n : ℝ) ≤ Real.exp (2 * B)) have hF : F ⊆ Icc 1 ⌊Real.exp (2 * B)⌋₊ := by intro n hn obtain ⟨hnT, hcut⟩ := mem_filter.mp hn exact mem_Icc.mpr ⟨hT n hnT, Nat.le_floor hcut⟩ have hlow : (∑ n ∈ F, 1 / (n : ℝ)) ≤ 1 + 2 * B := by calc _ ≤ ∑ n ∈ Icc 1 ⌊Real.exp (2 * B)⌋₊, 1 / (n : ℝ) := sum_le_sum_of_subset_of_nonneg hF (fun n _ _ => by positivity) _ = (harmonic ⌊Real.exp (2 * B)⌋₊ : ℝ) := by simp only [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast, one_div] _ ≤ 1 + Real.log (Real.exp (2 * B)) := harmonic_floor_le_one_add_log _ (Real.one_le_exp (by linarith)) _ = 1 + 2 * B := by rw [Real.log_exp] have hpoint (n : ℕ) (hn : n ∈ T) : (2 * B) * (1 / (n : ℝ)) ≤ (2 * B) * (if (n : ℝ) ≤ Real.exp (2 * B) then 1 / (n : ℝ) else 0) + Real.log (n : ℝ) / n := by have hn0 : (0 : ℝ) < n := by exact_mod_cast hT n hn split_ifs with hcut · linarith [div_nonneg (Real.log_natCast_nonneg n) hn0.le] · have hlog : 2 * B ≤ Real.log (n : ℝ) := (Real.le_log_iff_exp_le hn0).mpr (le_of_not_ge hcut) simpa only [mul_zero, zero_add, mul_one_div] using (div_le_div_of_nonneg_right hlog hn0.le) have hsum := sum_le_sum hpoint simp only [sum_add_distrib, ← mul_sum, ← sum_filter] at hsum change (2 * B) * (∑ n ∈ T, 1 / (n : ℝ)) ≤ (2 * B) * (∑ n ∈ F, 1 / (n : ℝ)) + ∑ n ∈ T, Real.log (n : ℝ) / n at hsum have hhalf : (∑ n ∈ T, 1 / (n : ℝ)) ≤ 2 * (∑ n ∈ F, 1 / (n : ℝ)) := by nlinarith linarith theorem finite_prime_euler_product_le_of_log_sum (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {B : ℝ} (hB : 0 < B) (hlog : (∑ p ∈ P, Real.log (p : ℝ) / p) ≤ B) : (∏ p ∈ P, (1 + 1 / (p : ℝ))) ≤ 2 + 4 * B := by classical let T : Finset ℕ := P.powerset.image (fun S : Finset ℕ => ∏ p ∈ S, p) have hinj : Set.InjOn (fun S : Finset ℕ => ∏ p ∈ S, p) P.powerset := by intro S hS U hU heq have hs : (∏ p ∈ S, p).primeFactors = S := Nat.primeFactors_prod (fun p hp => hP p ((mem_powerset.mp hS) hp)) have hu : (∏ p ∈ U, p).primeFactors = U := Nat.primeFactors_prod (fun p hp => hP p ((mem_powerset.mp hU) hp)) rw [← hs, ← hu] exact congrArg Nat.primeFactors heq have hpos (S : Finset ℕ) (hS : S ∈ P.powerset) : 0 < ∏ p ∈ S, p := prod_pos (fun p hp => (hP p ((mem_powerset.mp hS) hp)).pos) have hT : ∀ n ∈ T, 0 < n := by intro n hn obtain ⟨S, hS, rfl⟩ := mem_image.mp hn exact hpos S hS have hprod (S : Finset ℕ) : (1 : ℝ) / ((∏ p ∈ S, p : ℕ) : ℝ) = ∏ p ∈ S, 1 / (p : ℝ) := by simp only [Nat.cast_prod, one_div, prod_inv_distrib] have hmass : (∑ n ∈ T, 1 / (n : ℝ)) = ∏ p ∈ P, (1 + 1 / (p : ℝ)) := by change (∑ n ∈ P.powerset.image (fun S => ∏ p ∈ S, p), 1 / (n : ℝ)) = _ rw [sum_image hinj] simp_rw [hprod] exact (prod_one_add P).symm have hmoment : (∑ n ∈ T, Real.log (n : ℝ) / n) = ∑ S ∈ P.powerset, (∑ p ∈ S, Real.log (p : ℝ)) * ∏ p ∈ S, 1 / (p : ℝ) := by change (∑ n ∈ P.powerset.image (fun S => ∏ p ∈ S, p), Real.log (n : ℝ) / n) = _ rw [sum_image hinj] apply sum_congr rfl intro S hS rw [div_eq_mul_inv, ← one_div, hprod] congr 1 rw [Nat.cast_prod, Real.log_prod] intro p hp exact_mod_cast (hP p ((mem_powerset.mp hS) hp)).ne_zero rw [← hmass] apply finite_reciprocal_mass_le_of_log_moment T hT hB rw [hmoment, hmass] calc _ ≤ (∏ p ∈ P, (1 + 1 / (p : ℝ))) * ∑ p ∈ P, Real.log (p : ℝ) * (1 / p) := subset_log_moment_bound P (fun p => 1 / (p : ℝ)) (fun p => Real.log (p : ℝ)) (fun p _ => by positivity) (fun p _ => Real.log_natCast_nonneg p) _ ≤ (∏ p ∈ P, (1 + 1 / (p : ℝ))) * B := by apply mul_le_mul_of_nonneg_left _ (prod_nonneg (fun p _ => by positivity)) simpa only [mul_one_div] using hlog _ = B * ∏ p ∈ P, (1 + 1 / (p : ℝ)) := by ring theorem finite_prime_euler_product_le (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {z : ℝ} (hz : 1 ≤ z) (hbound : ∀ p ∈ P, (p : ℝ) ≤ z) : (∏ p ∈ P, (1 + 1 / (p : ℝ))) ≤ 2 + 4 * Real.log 4 * (1 + Real.log z) := by have hB : 0 < Real.log 4 * (1 + Real.log z) := mul_pos (Real.log_pos (by norm_num)) (by linarith [Real.log_nonneg hz]) convert finite_prime_euler_product_le_of_log_sum P hP hB (finite_prime_log_reciprocal_sum_le P hP hz hbound) using 1 ring noncomputable def primeEulerProductUpperConstant : ℝ := (2 + 4 * Real.log 4) / Real.log 2 + 4 * Real.log 4 theorem primeEulerProductUpperConstant_pos : 0 < primeEulerProductUpperConstant := by have h2 : 0 < Real.log 2 := Real.log_pos (by norm_num) have h4 : 0 < Real.log 4 := Real.log_pos (by norm_num) unfold primeEulerProductUpperConstant positivity theorem finite_prime_euler_product_le_log (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {z : ℝ} (hz : 1 ≤ z) (hbound : ∀ p ∈ P, (p : ℝ) ≤ z) : (∏ p ∈ P, (1 + 1 / (p : ℝ))) ≤ primeEulerProductUpperConstant * Real.log (2 * z) := by apply (finite_prime_euler_product_le P hP hz hbound).trans have h2 : 0 < Real.log 2 := Real.log_pos (by norm_num) have h4 : 0 < Real.log 4 := Real.log_pos (by norm_num) have hzlog : 0 ≤ Real.log z := Real.log_nonneg hz have hz0 : z ≠ 0 := ne_of_gt (zero_lt_one.trans_le hz) unfold primeEulerProductUpperConstant rw [Real.log_mul (by norm_num) hz0] have hcancel : ((2 + 4 * Real.log 4) / Real.log 2) * Real.log 2 = 2 + 4 * Real.log 4 := div_mul_cancel₀ _ h2.ne' have hpos : 0 ≤ (2 + 4 * Real.log 4) / Real.log 2 := by positivity nlinarith [mul_nonneg hpos hzlog, mul_nonneg h4.le h2.le] end section open scoped BigOperators Classical theorem finite_probability_gram_diagonal {X : Type*} [Fintype X] (μ : X → ℝ) (hmass : ∑ x, μ x = 1) (ψ : X → ℂ) (hunit : ∀ x, μ x ≠ 0 → ‖ψ x‖ = 1) : (∑ x, (μ x : ℂ) * (starRingEnd ℂ) (ψ x) * ψ x) = 1 := by calc _ = ∑ x, (μ x : ℂ) := by apply Finset.sum_congr rfl intro x _ by_cases hx : μ x = 0 · simp only [hx, Complex.ofReal_zero, zero_mul] · rw [mul_assoc, Complex.conj_mul', hunit x hx] simp _ = 1 := by rw [← Complex.ofReal_sum, hmass, Complex.ofReal_one] theorem finite_measure_frame_reverse_pairing {X I : Type*} [Fintype X] [Fintype I] (μ : X → ℝ) (ψ : I → X → ℂ) (k : I) (y : X) : (∑ x, (μ x : ℂ) * finiteMeasureFrameKernel ψ x y * (starRingEnd ℂ) (ψ k x)) = ∑ i, (∑ x, (μ x : ℂ) * (starRingEnd ℂ) (ψ k x) * ψ i x) * (starRingEnd ℂ) (ψ i y) := by unfold finiteMeasureFrameKernel simp_rw [Finset.mul_sum, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro x _ ring theorem finite_probability_frame_reproduction {X I : Type*} [Fintype X] [Fintype I] (μ : X → ℝ) (hmass : ∑ x, μ x = 1) (ψ : I → X → ℂ) (hunit : ∀ i x, μ x ≠ 0 → ‖ψ i x‖ = 1) {ε : ℝ} (hε : 0 ≤ ε) (hoff : ∀ i j, i ≠ j → ‖∑ x, (μ x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x‖ ≤ ε) (k : I) (y : X) (hy : ∀ i, ‖ψ i y‖ ≤ 1) : ‖(∑ x, (μ x : ℂ) * finiteMeasureFrameKernel ψ x y * (starRingEnd ℂ) (ψ k x)) - (starRingEnd ℂ) (ψ k y)‖ ≤ (Fintype.card I - 1 : ℕ) * ε := by rw [finite_measure_frame_reverse_pairing, ← Finset.sum_erase_add _ _ (Finset.mem_univ k), finite_probability_gram_diagonal μ hmass (ψ k) (hunit k), one_mul, add_sub_cancel_right] calc _ ≤ ∑ i ∈ Finset.univ.erase k, ‖(∑ x, (μ x : ℂ) * (starRingEnd ℂ) (ψ k x) * ψ i x) * (starRingEnd ℂ) (ψ i y)‖ := norm_sum_le _ _ _ ≤ ∑ _i ∈ Finset.univ.erase k, ε := by apply Finset.sum_le_sum intro i hi rw [norm_mul, Complex.norm_conj] simpa only [mul_one] using mul_le_mul (hoff k i (Finset.ne_of_mem_erase hi).symm) (hy i) (norm_nonneg _) hε _ = _ := by simp end section open scoped BigOperators Classical theorem prime_family_log_cell_gram (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → 0 < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h : ℝ, 0 < h → ∀ d : ℤ, ∀ t s : BoundedPrimitiveCharacter Q, t ≠ s → ‖∑ x : (∀ j, P j), if upperLogCell h (Real.log (∏ j, (x j).val : ℕ)) = d then (finiteProductWeight (physicalLabelLaw V) x : ℂ) * boundedPrimitiveValue t ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus t)) * star (boundedPrimitiveValue s ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus s))) else 0‖ ≤ (C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a) := by obtain ⟨C, hC, hbnd⟩ := prime_tuple_log_cell_correlation_bound hZ refine ⟨C, hC, ?_⟩ intro Q hQ I _ _ P V i hV hp hmass a b hPi ha hb h hh d t s hts have hVi := hV i have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hraw := hbnd (boundedPrimitiveModulus t) (boundedPrimitiveModulus s) (bounded_primitive_modulus_pos t) (bounded_primitive_modulus_pos s) (boundedPrimitiveValue t) (boundedPrimitiveValue s) (bounded_primitive_value_primitive t) (bounded_primitive_value_primitive s) (fun he => hts (bounded_primitive_character_injective Q he)) P V i hV hp hmass a b hPi ha hb h hh d have hprod : boundedPrimitiveModulus t * boundedPrimitiveModulus s ≤ Q * Q := Nat.mul_le_mul (bounded_primitive_modulus_le t) (bounded_primitive_modulus_le s) have hpos : (0 : ℝ) < (boundedPrimitiveModulus t * boundedPrimitiveModulus s : ℕ) := by exact_mod_cast Nat.mul_pos (bounded_primitive_modulus_pos t) (bounded_primitive_modulus_pos s) have hl := Real.log_le_log hpos (show ((boundedPrimitiveModulus t * boundedPrimitiveModulus s : ℕ) : ℝ) ≤ (Q * Q : ℕ) by exact_mod_cast hprod) apply hraw.trans exact mul_le_mul_of_nonneg_left (add_le_add le_rfl (div_le_div_of_nonneg_right hl hlog.le)) (by positivity) end section open scoped BigOperators Classical section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) include I sharedInstance1 sharedInstance2 P V theorem prime_ideal_kernel_conj (Q : ℕ) (h : ℝ) (kept : Finset ℤ) (x y : ∀ j, P j) : (starRingEnd ℂ) (primeProductIdealKernel P V Q h kept x y) = primeProductIdealKernel P V Q h kept y x := finite_cell_kernel_conj _ _ _ _ x y theorem prime_ideal_kernel_log_localized (Q : ℕ) {h : ℝ} (hh : 0 < h) (kept : Finset ℤ) (x y : ∀ j, P j) (hne : primeProductIdealKernel P V Q h kept x y ≠ 0) : |Real.log (∏ j, (x j).val : ℕ) - Real.log (∏ j, (y j).val : ℕ)| < h := by apply upper_log_cell_distance_lt hh unfold primeProductIdealKernel finiteCellFrameKernel at hne split_ifs at hne with he · exact he.1 · exact (hne rfl).elim theorem prime_ideal_kernel_norm_le (Q : ℕ) (h : ℝ) (kept : Finset ℤ) {ξ : ℝ} (hξ : 0 < ξ) (hkept : ∀ d ∈ kept, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) (x y : ∀ j, P j) : ‖primeProductIdealKernel P V Q h kept x y‖ ≤ (Q * Q : ℕ) / ξ := by have hψ (t : BoundedPrimitiveCharacter Q) (z : ∀ j, P j) : ‖star (boundedPrimitiveValue t ((∏ j, (z j).val : ℕ) : ZMod (boundedPrimitiveModulus t)))‖ ≤ 1 := by rw [norm_star] exact (boundedPrimitiveValue t).norm_le_one _ have hb := finite_cell_kernel_norm_le (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell h (Real.log (∏ j, (z j).val : ℕ))) kept _ hψ hξ hkept x y exact hb.trans (div_le_div_of_nonneg_right (by exact_mod_cast bounded_primitive_character_card_le Q) hξ.le) theorem prime_ideal_kernel_abs_row_le (hV : ∀ i, 0 ≤ V i) (Q : ℕ) (h : ℝ) (kept : Finset ℤ) (hkept : ∀ d ∈ kept, 0 < finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) (x : ∀ j, P j) : (∑ y, finiteProductWeight (physicalLabelLaw V) y * ‖primeProductIdealKernel P V Q h kept x y‖) ≤ (Q * Q : ℕ) := by have hμ (z : ∀ j, P j) : 0 ≤ finiteProductWeight (physicalLabelLaw V) z := Finset.prod_nonneg (fun j _ => physical_label_law_nonneg V hV j (z j)) have hψ (t : BoundedPrimitiveCharacter Q) (z : ∀ j, P j) : ‖star (boundedPrimitiveValue t ((∏ j, (z j).val : ℕ) : ZMod (boundedPrimitiveModulus t)))‖ ≤ 1 := by rw [norm_star] exact (boundedPrimitiveValue t).norm_le_one _ exact (finite_cell_kernel_abs_row_le _ hμ _ kept hkept _ hψ x).trans (by exact_mod_cast bounded_primitive_character_card_le Q) theorem prime_ideal_kernel_abs_column_le (hV : ∀ i, 0 ≤ V i) (Q : ℕ) (h : ℝ) (kept : Finset ℤ) (hkept : ∀ d ∈ kept, 0 < finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) (y : ∀ j, P j) : (∑ x, finiteProductWeight (physicalLabelLaw V) x * ‖primeProductIdealKernel P V Q h kept x y‖) ≤ (Q * Q : ℕ) := by have hn (x : ∀ j, P j) : ‖primeProductIdealKernel P V Q h kept x y‖ = ‖primeProductIdealKernel P V Q h kept y x‖ := by rw [← prime_ideal_kernel_conj P V Q h kept y x, Complex.norm_conj] simp_rw [hn] exact prime_ideal_kernel_abs_row_le P V hV Q h kept hkept y end end section theorem dirichlet_coprime_nat_bound (α : ℝ) (n : ℕ) (hn : 0 < n) : ∃ (u : ℤ) (r : ℕ), 0 < r ∧ r ≤ n ∧ (r : ℤ).gcd u = 1 ∧ |α - (u : ℝ) / (r : ℝ)| ≤ 1 / (((n : ℝ) + 1) * (r : ℝ)) := by obtain ⟨q, hq, hden⟩ := Real.exists_rat_abs_sub_le_and_den_le α hn refine ⟨q.num, q.den, q.pos, hden, ?_, ?_⟩ · simpa only [Int.gcd_def, Int.natAbs_natCast] using q.reduced.symm · simpa only [Rat.cast_def] using hq /- The `n+1` denominator in finite Dirichlet approximation absorbs the floor loss, so the scaled error has constant one rather than two. -/ theorem dirichlet_coprime_real_bound (α Z S : ℝ) (hZ : 0 < Z) (hS : 0 < S) (hscale : 1 ≤ Z / S) : ∃ (u : ℤ) (r : ℕ), 0 < r ∧ (r : ℝ) ≤ Z / S ∧ (r : ℤ).gcd u = 1 ∧ |α - (u : ℝ) / (r : ℝ)| ≤ 1 / (r : ℝ) ^ 2 ∧ |α - (u : ℝ) / (r : ℝ)| * Z ≤ S / (r : ℝ) := by let n : ℕ := ⌊Z / S⌋₊ have hn : 0 < n := Nat.floor_pos.mpr hscale obtain ⟨u, r, hr, hrn, hcop, hβ⟩ := dirichlet_coprime_nat_bound α n hn have hrR : (0 : ℝ) < r := by exact_mod_cast hr have hnR : (0 : ℝ) < n + 1 := by positivity have hrnR : (r : ℝ) ≤ n := by exact_mod_cast hrn have hnle : (n : ℝ) ≤ Z / S := Nat.floor_le (by positivity) have hZle : Z ≤ ((n : ℝ) + 1) * S := (div_le_iff₀ hS).mp (Nat.lt_floor_add_one (Z / S)).le refine ⟨u, r, hr, hrnR.trans hnle, hcop, ?_, ?_⟩ · refine hβ.trans (one_div_le_one_div_of_le (sq_pos_of_pos hrR) ?_) nlinarith · calc _ ≤ (1 / (((n : ℝ) + 1) * (r : ℝ))) * Z := mul_le_mul_of_nonneg_right hβ hZ.le _ ≤ (1 / (((n : ℝ) + 1) * (r : ℝ))) * (((n : ℝ) + 1) * S) := mul_le_mul_of_nonneg_left hZle (by positivity) _ = S / (r : ℝ) := by field_simp /- A decomposition in the exact coprime form used by rational phase separation. -/ theorem dirichlet_scaled_decomposition (α Z S : ℝ) (hZ : 0 < Z) (hS : 0 < S) (hscale : 1 ≤ Z / S) : ∃ (u : ℤ) (r : ℕ) (β : ℝ), 0 < r ∧ (r : ℝ) ≤ Z / S ∧ (r : ℤ).gcd u = 1 ∧ α = (u : ℝ) / (r : ℝ) + β ∧ |β| ≤ 1 / (r : ℝ) ^ 2 ∧ |β| * Z ≤ S / (r : ℝ) := by obtain ⟨u, r, hr, hbudget, hcop, hβ, hscaled⟩ := dirichlet_coprime_real_bound α Z S hZ hS hscale exact ⟨u, r, α - (u : ℝ) / (r : ℝ), hr, hbudget, hcop, by ring, hβ, hscaled⟩ end section noncomputable def majorArcMultiplier (ζ β v : ℝ) : ℂ := Complex.exp (Complex.I * (ζ * v + 2 * Real.pi * β * Real.exp v : ℝ)) theorem real_exp_sub_le_endpoint (v w R : ℝ) (hvw : v ≤ w) (hw : Real.exp w ≤ R) : Real.exp w - Real.exp v ≤ R * (w - v) := by have ht := mul_le_mul_of_nonneg_left (Real.add_one_le_exp (v - w)) (Real.exp_pos w).le rw [← Real.exp_add, show w + (v - w) = v by ring] at ht have hR := mul_le_mul_of_nonneg_right hw (sub_nonneg.mpr hvw) nlinarith theorem real_exp_lipschitz_of_endpoint_bounds (v w R : ℝ) (hv : Real.exp v ≤ R) (hw : Real.exp w ≤ R) : |Real.exp v - Real.exp w| ≤ R * |v - w| := by rcases le_total v w with h | h · rw [abs_of_nonpos (sub_nonpos.mpr (Real.exp_le_exp.mpr h)), abs_of_nonpos (sub_nonpos.mpr h)] simpa only [neg_sub] using real_exp_sub_le_endpoint v w R h hw · rw [abs_of_nonneg (sub_nonneg.mpr (Real.exp_le_exp.mpr h)), abs_of_nonneg (sub_nonneg.mpr h)] exact real_exp_sub_le_endpoint w v R h hv theorem unit_complex_phase_lipschitz (v w : ℝ) : ‖Complex.exp (Complex.I * (v : ℂ)) - Complex.exp (Complex.I * (w : ℂ))‖ ≤ |v - w| := by have he : Complex.exp (Complex.I * (v : ℂ)) - Complex.exp (Complex.I * (w : ℂ)) = Complex.exp (Complex.I * (w : ℂ)) * (Complex.exp (Complex.I * ((v - w : ℝ) : ℂ)) - 1) := by rw [mul_sub, mul_one, ← Complex.exp_add] congr 2 push_cast ring rw [he, norm_mul] have hn : ‖Complex.exp (Complex.I * (w : ℂ))‖ = 1 := by simpa only [mul_comm] using Complex.norm_exp_ofReal_mul_I w rw [hn, one_mul] exact Real.norm_exp_I_mul_ofReal_sub_one_le theorem major_arc_multiplier_norm (ζ β v : ℝ) : ‖majorArcMultiplier ζ β v‖ = 1 := by unfold majorArcMultiplier simpa only [mul_comm] using Complex.norm_exp_ofReal_mul_I (ζ * v + 2 * Real.pi * β * Real.exp v) theorem major_arc_multiplier_lipschitz (ζ β v w R : ℝ) (hv : Real.exp v ≤ R) (hw : Real.exp w ≤ R) : ‖majorArcMultiplier ζ β v - majorArcMultiplier ζ β w‖ ≤ (|ζ| + 2 * Real.pi * |β| * R) * |v - w| := by have hc : 0 ≤ 2 * Real.pi * |β| := by positivity have he : (ζ * v + 2 * Real.pi * β * Real.exp v) - (ζ * w + 2 * Real.pi * β * Real.exp w) = ζ * (v - w) + (2 * Real.pi * β) * (Real.exp v - Real.exp w) := by ring calc _ ≤ |(ζ * v + 2 * Real.pi * β * Real.exp v) - (ζ * w + 2 * Real.pi * β * Real.exp w)| := unit_complex_phase_lipschitz _ _ _ ≤ |ζ * (v - w)| + |(2 * Real.pi * β) * (Real.exp v - Real.exp w)| := by rw [he] exact abs_add_le _ _ _ = |ζ| * |v - w| + (2 * Real.pi * |β|) * |Real.exp v - Real.exp w| := by simp only [abs_mul, abs_of_pos Real.pi_pos, abs_of_pos (show (0 : ℝ) < 2 by norm_num)] _ ≤ |ζ| * |v - w| + (2 * Real.pi * |β|) * (R * |v - w|) := add_le_add_right (mul_le_mul_of_nonneg_left (real_exp_lipschitz_of_endpoint_bounds v w R hv hw) hc) _ _ = _ := by ring /- Two logarithmic coordinates moving by at most one cell width move their sum by at most two widths. The same endpoint product bound controls the multiplier. -/ theorem major_arc_multiplier_two_coordinates (ζ β a b a' b' R h : ℝ) (ha : |a - a'| ≤ h) (hb : |b - b'| ≤ h) (hab : Real.exp (a + b) ≤ R) (hab' : Real.exp (a' + b') ≤ R) : ‖majorArcMultiplier ζ β (a + b) - majorArcMultiplier ζ β (a' + b')‖ ≤ 2 * h * (|ζ| + 2 * Real.pi * |β| * R) := by have hR : 0 ≤ R := (Real.exp_pos (a + b)).le.trans hab have hC : 0 ≤ |ζ| + 2 * Real.pi * |β| * R := by positivity have hdiff : |(a + b) - (a' + b')| ≤ 2 * h := by calc _ = |(a - a') + (b - b')| := by congr 1; ring _ ≤ |a - a'| + |b - b'| := abs_add_le _ _ _ ≤ 2 * h := by linarith calc _ ≤ (|ζ| + 2 * Real.pi * |β| * R) * |(a + b) - (a' + b')| := major_arc_multiplier_lipschitz ζ β _ _ R hab hab' _ ≤ (|ζ| + 2 * Real.pi * |β| * R) * (2 * h) := mul_le_mul_of_nonneg_left hdiff hC _ = _ := by ring /- Product notation for cell representatives, with their enlarged product range stated explicitly rather than inferred from individual endpoint bounds. -/ theorem major_arc_multiplier_log_products (ζ β x y x' y' R h : ℝ) (hx : 0 < x) (hy : 0 < y) (hx' : 0 < x') (hy' : 0 < y') (hlogx : |Real.log x - Real.log x'| ≤ h) (hlogy : |Real.log y - Real.log y'| ≤ h) (hxy : x * y ≤ R) (hxy' : x' * y' ≤ R) : ‖majorArcMultiplier ζ β (Real.log (x * y)) - majorArcMultiplier ζ β (Real.log (x' * y'))‖ ≤ 2 * h * (|ζ| + 2 * Real.pi * |β| * R) := by rw [Real.log_mul hx.ne' hy.ne', Real.log_mul hx'.ne' hy'.ne'] apply major_arc_multiplier_two_coordinates ζ β _ _ _ _ R h hlogx hlogy · simpa only [Real.exp_add, Real.exp_log hx, Real.exp_log hy] using hxy · simpa only [Real.exp_add, Real.exp_log hx', Real.exp_log hy'] using hxy' end section open Finset theorem fin_tensor_row_events_at (N : ℕ) {S T : Fin N → Type*} (row : (g : Fin N) → (T g → ℂ) → S g → ℂ) (s : (g : Fin N) → S g) (E : Fin N → Type*) [∀ g, Fintype (E g)] (target : (g : Fin N) → E g → T g) (weight : (g : Fin N) → E g → ℂ) (hrow : ∀ g F, row g F (s g) = ∑ e : E g, weight g e * F (target g e)) (F : ((g : Fin N) → T g) → ℂ) : finTensorRow N row F s = ∑ e : (g : Fin N) → E g, (∏ g, weight g (e g)) * F (fun g => target g (e g)) := by classical have he := fin_tensor_row_intertwines_on N (S := fun _ => Unit) (T := T) (fun g G _ => ∑ e : E g, weight g e * G (target g e)) row (fun g _ => s g) (fun _ t => t) (fun _ _ => True) (fun _ _ => True) (by intro g u _ G K hGK have hh : G = K := funext (fun t => hGK t trivial) rw [hh] exact (hrow g K).symm) F F (fun _ _ => rfl) (fun _ => ()) (fun _ => trivial) rw [← he] exact fin_tensor_row_events N (fun g (_ : Unit) => E g) (fun g _ => target g) (fun g _ => weight g) F (fun _ => ()) end section open scoped BigOperators Classical noncomputable def finiteOccupiedCells {X D : Type*} [Fintype X] [DecidableEq D] (cell : X → D) : Finset D := Finset.univ.image cell noncomputable def finiteRetainedCells {X D : Type*} [Fintype X] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (ξ : ℝ) : Finset D := (finiteOccupiedCells cell).filter (fun d => ξ ≤ finiteCellMass μ cell d) theorem finite_cell_mem_occupied {X D : Type*} [Fintype X] [DecidableEq D] (cell : X → D) (x : X) : cell x ∈ finiteOccupiedCells cell := by exact Finset.mem_image.mpr ⟨x, Finset.mem_univ x, rfl⟩ theorem finite_retained_cell_mass {X D : Type*} [Fintype X] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (ξ : ℝ) {d : D} (hd : d ∈ finiteRetainedCells μ cell ξ) : ξ ≤ finiteCellMass μ cell d := (Finset.mem_filter.mp hd).2 theorem finite_cell_not_retained_iff {X D : Type*} [Fintype X] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (ξ : ℝ) (x : X) : cell x ∉ finiteRetainedCells μ cell ξ ↔ finiteCellMass μ cell (cell x) < ξ := by simp only [finiteRetainedCells, Finset.mem_filter, finite_cell_mem_occupied, true_and, not_le] theorem finite_cell_mass_partition {X D : Type*} [Fintype X] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (S : Finset D) : (∑ d ∈ S, finiteCellMass μ cell d) = ∑ x, if cell x ∈ S then μ x else 0 := by unfold finiteCellMass rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x _ by_cases hx : cell x ∈ S · rw [if_pos hx, Finset.sum_eq_single (cell x)] · simp · intro d _ hd simp [Ne.symm hd] · exact fun h => (h hx).elim · rw [if_neg hx] apply Finset.sum_eq_zero intro d hd have he : cell x ≠ d := by intro he; exact hx (he ▸ hd) simp [he] theorem finite_discarded_cell_mass_identity {X D : Type*} [Fintype X] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (ξ : ℝ) : (∑ x, if cell x ∉ finiteRetainedCells μ cell ξ then μ x else 0) = ∑ d ∈ (finiteOccupiedCells cell).filter (fun d => finiteCellMass μ cell d < ξ), finiteCellMass μ cell d := by rw [finite_cell_mass_partition] apply Finset.sum_congr rfl intro x _ simp only [Finset.mem_filter, finite_cell_mem_occupied, true_and, finite_cell_not_retained_iff] theorem finite_discarded_cell_mass_le {X D : Type*} [Fintype X] [DecidableEq D] (μ : X → ℝ) (cell : X → D) {ξ : ℝ} (hξ : 0 ≤ ξ) : (∑ x, if cell x ∉ finiteRetainedCells μ cell ξ then μ x else 0) ≤ (finiteOccupiedCells cell).card * ξ := by rw [finite_discarded_cell_mass_identity] calc _ ≤ ∑ _d ∈ (finiteOccupiedCells cell).filter (fun d => finiteCellMass μ cell d < ξ), ξ := by apply Finset.sum_le_sum intro d hd exact (Finset.mem_filter.mp hd).2.le _ = (((finiteOccupiedCells cell).filter (fun d => finiteCellMass μ cell d < ξ)).card : ℝ) * ξ := by simp _ ≤ _ := mul_le_mul_of_nonneg_right (by exact_mod_cast Finset.card_filter_le _ _) hξ end section open Finset Filter open scoped Topology theorem primeFactors_card_le_multiplicity (n : ℕ) : n.primeFactors.card ≤ primeFactorMultiplicity n := by calc _ = ∑ _p ∈ n.primeFactors, (1 : ℕ) := by simp _ ≤ ∑ p ∈ n.primeFactors, n.factorization p := by apply sum_le_sum intro p hp apply Nat.one_le_iff_ne_zero.mpr exact Finsupp.mem_support_iff.mp (by simpa only [Nat.support_factorization] using hp) theorem prime_factor_inverse_sum_le_card {n : ℕ} {Y : ℝ} (hY : 1 < Y) (hlarge : ∀ p ∈ n.primeFactors, Y ≤ (p : ℝ)) : (∑ p ∈ n.primeFactors, 1 / ((p : ℝ) - 1)) ≤ (n.primeFactors.card : ℝ) / (Y - 1) := by calc _ ≤ ∑ _p ∈ n.primeFactors, 1 / (Y - 1) := by apply sum_le_sum intro p hp exact one_div_le_one_div_of_le (by linarith) (by linarith [hlarge p hp]) _ = _ := by simp [div_eq_mul_inv] theorem prime_factor_inverse_sum_le_log {n : ℕ} (hn : n ≠ 0) {Y : ℝ} (hY : 1 < Y) (hlarge : ∀ p ∈ n.primeFactors, Y ≤ (p : ℝ)) : (∑ p ∈ n.primeFactors, 1 / ((p : ℝ) - 1)) ≤ Real.log (n : ℝ) / (Real.log Y * (Y - 1)) := by have hcard : (n.primeFactors.card : ℝ) ≤ (primeFactorMultiplicity n : ℝ) := Nat.cast_le.mpr (primeFactors_card_le_multiplicity n) calc _ ≤ (n.primeFactors.card : ℝ) / (Y - 1) := prime_factor_inverse_sum_le_card hY hlarge _ ≤ (primeFactorMultiplicity n : ℝ) / (Y - 1) := div_le_div_of_nonneg_right hcard (by linarith) _ ≤ (Real.log (n : ℝ) / Real.log Y) / (Y - 1) := div_le_div_of_nonneg_right (multiplicity_le_log_div_of_large_primeFactors hn hY hlarge) (by linarith) _ = _ := by rw [div_div] theorem prime_factor_inverse_sum_le_four_rpow {L : ℝ} (hL : 2 ≤ L) (hlog16 : Real.log 16 ≤ L) (hlogL : 1 ≤ Real.log L) {n : ℕ} (hn : n ≠ 0) (hsize : (n : ℝ) ≤ 16 * Real.exp L) (hlarge : ∀ p ∈ n.primeFactors, L^20 ≤ (p : ℝ)) : (∑ p ∈ n.primeFactors, 1 / ((p : ℝ) - 1)) ≤ 4 * L^(-19 : ℝ) := by have hL0 : 0 < L := by linarith have hpow : (2 : ℝ) ≤ L^20 := by have hh := pow_le_pow_left₀ (by norm_num : (0 : ℝ) ≤ 2) hL 20 norm_num at hh linarith have hY : 1 < L^20 := by linarith have hlogY : 1 ≤ Real.log (L^20) := by rw [Real.log_pow] norm_num linarith have hden : L^20 / 2 ≤ Real.log (L^20) * (L^20 - 1) := by have hmul := mul_le_mul_of_nonneg_right hlogY (by linarith : 0 ≤ L^20 - 1) nlinarith have hn0 : (0 : ℝ) < n := by exact_mod_cast Nat.pos_of_ne_zero hn have hnum : Real.log (n : ℝ) ≤ 2 * L := by have hh := Real.log_le_log hn0 hsize rw [Real.log_mul (by norm_num) (Real.exp_ne_zero L), Real.log_exp] at hh linarith calc _ ≤ Real.log (n : ℝ) / (Real.log (L^20) * (L^20 - 1)) := prime_factor_inverse_sum_le_log hn hY hlarge _ ≤ (2 * L) / (L^20 / 2) := div_le_div₀ (by positivity) hnum (by positivity) hden _ = 4 * L^(-19 : ℝ) := by rw [Real.rpow_neg hL0.le] norm_num field_simp ring theorem eventually_prime_factor_inverse_sum_le_four_rpow : ∀ᶠ L : ℝ in atTop, ∀ n : ℕ, n ≠ 0 → (n : ℝ) ≤ 16 * Real.exp L → (∀ p ∈ n.primeFactors, L^20 ≤ (p : ℝ)) → (∑ p ∈ n.primeFactors, 1 / ((p : ℝ) - 1)) ≤ 4 * L^(-19 : ℝ) := by filter_upwards [eventually_ge_atTop (2 : ℝ), eventually_ge_atTop (Real.log 16), Real.tendsto_log_atTop.eventually (eventually_ge_atTop (1 : ℝ))] with L hL hlog16 hlogL exact fun n hn hsize hlarge => prime_factor_inverse_sum_le_four_rpow hL hlog16 hlogL hn hsize hlarge end section open Finset theorem totient_sieve_prime_product (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) : Nat.totient (∏ p ∈ P, p) = ∏ p ∈ P, (p - 1) := by have hp0 : (∏ p ∈ P, p) ≠ 0 := prod_ne_zero_iff.mpr (fun p hp => (hP p hp).ne_zero) rw [Nat.totient_eq_div_primeFactors_mul, Nat.primeFactors_prod hP, Nat.div_self (Nat.pos_of_ne_zero hp0), one_mul] theorem totient_sieve_prime_product_reciprocal (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) : 1 / (Nat.totient (∏ p ∈ P, p) : ℝ) = ∏ p ∈ P, (1 / ((p : ℝ) - 1)) := by rw [totient_sieve_prime_product P hP, Nat.cast_prod] simp only [one_div, prod_inv_distrib] congr 1 apply prod_congr rfl intro p hp rw [Nat.cast_sub (hP p hp).one_le, Nat.cast_one] theorem totient_sieve_prime_product_divisors (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) : (∏ p ∈ P, p).divisors = P.powerset.image (fun S => ∏ p ∈ S, p) := by have hp0 : (∏ p ∈ P, p) ≠ 0 := prod_ne_zero_iff.mpr (fun p hp => (hP p hp).ne_zero) have hsq : Squarefree (∏ p ∈ P, p) := by refine squarefree_prod_of_pairwise_isCoprime (fun p hp q hq hpq => ?_) (fun p hp => (hP p hp).squarefree) simp only [← Nat.coprime_iff_isRelPrime] exact (Nat.coprime_primes (hP p hp) (hP q hq)).mpr hpq ext d constructor · intro hd have hdvd := Nat.dvd_of_mem_divisors hd refine mem_image.mpr ⟨d.primeFactors, mem_powerset.mpr ?_, Nat.prod_primeFactors_of_squarefree (hsq.squarefree_of_dvd hdvd)⟩ simpa only [Nat.primeFactors_prod hP] using Nat.primeFactors_mono hdvd hp0 · intro hd obtain ⟨S, hS, rfl⟩ := mem_image.mp hd exact Nat.mem_divisors.mpr ⟨prod_dvd_prod_of_subset S P (fun p => p) (mem_powerset.mp hS), hp0⟩ theorem totient_sieve_sum_divisors_eq_subsets (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (F : ℕ → ℝ) : (∑ d ∈ (∏ p ∈ P, p).divisors, F d) = ∑ S ∈ P.powerset, F (∏ p ∈ S, p) := by rw [totient_sieve_prime_product_divisors P hP] apply sum_image intro S hS T hT heq have hs : (∏ p ∈ S, p).primeFactors = S := Nat.primeFactors_prod (fun p hp => hP p ((mem_powerset.mp hS) hp)) have ht : (∏ p ∈ T, p).primeFactors = T := Nat.primeFactors_prod (fun p hp => hP p ((mem_powerset.mp hT) hp)) rw [← hs, ← ht] exact congrArg Nat.primeFactors heq theorem totient_sieve_divisor_mass (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) : (∑ d ∈ (∏ p ∈ P, p).divisors, 1 / (Nat.totient d : ℝ)) = ∏ p ∈ P, (1 + 1 / ((p : ℝ) - 1)) := by rw [totient_sieve_sum_divisors_eq_subsets P hP] calc _ = ∑ S ∈ P.powerset, ∏ p ∈ S, 1 / ((p : ℝ) - 1) := by apply sum_congr rfl intro S hS exact totient_sieve_prime_product_reciprocal S (fun p hp => hP p ((mem_powerset.mp hS) hp)) _ = _ := (prod_one_add P).symm end section open Finset theorem totient_sieve_marked_subset_sum (P : Finset ℕ) (w : ℕ → ℝ) {p : ℕ} (hp : p ∈ P) : (∑ S ∈ P.powerset, if p ∈ S then ∏ q ∈ S, w q else 0) = w p * ∏ q ∈ P.erase p, (1 + w q) := by classical have hn : ∀ S ∈ (P.erase p).powerset, p ∉ S := by intro S hS exact notMem_mono (mem_powerset.mp hS) (notMem_erase p P) calc _ = (∑ S ∈ (P.erase p).powerset, if p ∈ S then ∏ q ∈ S, w q else 0) + ∑ S ∈ (P.erase p).powerset, if p ∈ insert p S then ∏ q ∈ insert p S, w q else 0 := by conv_lhs => rw [← insert_erase hp] exact sum_powerset_insert (notMem_erase p P) _ _ = 0 + ∑ S ∈ (P.erase p).powerset, w p * ∏ q ∈ S, w q := by congr 1 · exact sum_eq_zero (fun S hS => if_neg (hn S hS)) · apply sum_congr rfl intro S hS rw [if_pos (mem_insert_self _ _), prod_insert (hn S hS)] _ = _ := by rw [zero_add, ← mul_sum, ← prod_one_add] theorem totient_sieve_subset_union_bound (P : Finset ℕ) (w : ℕ → ℝ) (hw : ∀ p ∈ P, 0 ≤ w p) (bad : ℕ → Prop) [DecidablePred bad] : (∑ S ∈ P.powerset.filter (fun S => ∃ p ∈ S, bad p), ∏ p ∈ S, w p) ≤ (∑ p ∈ P.filter bad, w p) * ∏ p ∈ P, (1 + w p) := by classical have hprod : ∀ S ∈ P.powerset, 0 ≤ ∏ p ∈ S, w p := by intro S hS exact prod_nonneg (fun p hp => hw p ((mem_powerset.mp hS) hp)) calc _ = ∑ S ∈ P.powerset, if ∃ p ∈ S, bad p then ∏ p ∈ S, w p else 0 := sum_filter _ _ _ ≤ ∑ S ∈ P.powerset, ∑ p ∈ P.filter bad, if p ∈ S then ∏ q ∈ S, w q else 0 := by apply sum_le_sum intro S hS by_cases hb : ∃ p ∈ S, bad p · rw [if_pos hb] obtain ⟨p, hpS, hpb⟩ := hb have hpP : p ∈ P.filter bad := mem_filter.mpr ⟨(mem_powerset.mp hS) hpS, hpb⟩ have hsingle := single_le_sum (f := fun p => if p ∈ S then ∏ q ∈ S, w q else 0) (fun q _ => by split_ifs <;> first | exact hprod S hS | positivity) hpP simpa only [if_pos hpS] using hsingle · rw [if_neg hb] apply sum_nonneg intro p _ split_ifs <;> first | exact hprod S hS | positivity _ = ∑ p ∈ P.filter bad, ∑ S ∈ P.powerset, if p ∈ S then ∏ q ∈ S, w q else 0 := sum_comm _ = ∑ p ∈ P.filter bad, w p * ∏ q ∈ P.erase p, (1 + w q) := by apply sum_congr rfl intro p hp exact totient_sieve_marked_subset_sum P w (mem_filter.mp hp).1 _ ≤ ∑ p ∈ P.filter bad, w p * ∏ q ∈ P, (1 + w q) := by apply sum_le_sum intro p hp apply mul_le_mul_of_nonneg_left _ (hw p (mem_filter.mp hp).1) apply prod_le_prod_of_subset_of_one_le₀ (erase_subset p P) · intro q hq linarith [hw q (mem_of_mem_erase hq)] · intro q hq _ linarith [hw q hq] _ = _ := (sum_mul _ _ _).symm end section open Finset theorem totient_sieve_principal_error_eq_bad_mass {Ω : Type*} (T : Finset Ω) (μ : Ω → ℝ) (value : Ω → ℕ) (hμ : ∀ u ∈ T, 0 ≤ μ u) (d : ℕ) : |(∑ u ∈ T.filter (fun u => Nat.Coprime d (value u)), μ u) / (Nat.totient d : ℝ) - (∑ u ∈ T, μ u) / (Nat.totient d : ℝ)| = (∑ u ∈ T.filter (fun u => ¬ Nat.Coprime d (value u)), μ u) / (Nat.totient d : ℝ) := by have hsplit := sum_filter_add_sum_filter_not T (fun u => Nat.Coprime d (value u)) μ have hbad : 0 ≤ ∑ u ∈ T.filter (fun u => ¬ Nat.Coprime d (value u)), μ u := sum_nonneg (fun u hu => hμ u (mem_filter.mp hu).1) rw [← hsplit, add_div] have hdiv : 0 ≤ (∑ u ∈ T.filter (fun u => ¬ Nat.Coprime d (value u)), μ u) / (Nat.totient d : ℝ) := div_nonneg hbad (Nat.cast_nonneg _) rw [show (∑ u ∈ T.filter (fun u => Nat.Coprime d (value u)), μ u) / (Nat.totient d : ℝ) - ((∑ u ∈ T.filter (fun u => Nat.Coprime d (value u)), μ u) / (Nat.totient d : ℝ) + (∑ u ∈ T.filter (fun u => ¬ Nat.Coprime d (value u)), μ u) / (Nat.totient d : ℝ)) = -((∑ u ∈ T.filter (fun u => ¬ Nat.Coprime d (value u)), μ u) / (Nat.totient d : ℝ)) by ring, abs_neg, abs_of_nonneg hdiv] theorem totient_sieve_principal_replacement_identity {Ω : Type*} (T : Finset Ω) (M : Finset ℕ) (μ : Ω → ℝ) (value : Ω → ℕ) (hμ : ∀ u ∈ T, 0 ≤ μ u) : (∑ d ∈ M, |(∑ u ∈ T.filter (fun u => Nat.Coprime d (value u)), μ u) / (Nat.totient d : ℝ) - (∑ u ∈ T, μ u) / (Nat.totient d : ℝ)|) = ∑ u ∈ T, μ u * ∑ d ∈ M.filter (fun d => ¬ Nat.Coprime d (value u)), 1 / (Nat.totient d : ℝ) := by calc _ = ∑ d ∈ M, (∑ u ∈ T.filter (fun u => ¬ Nat.Coprime d (value u)), μ u) / (Nat.totient d : ℝ) := by apply sum_congr rfl intro d _ exact totient_sieve_principal_error_eq_bad_mass T μ value hμ d _ = ∑ d ∈ M, ∑ u ∈ T, μ u * (if ¬ Nat.Coprime d (value u) then 1 / (Nat.totient d : ℝ) else 0) := by apply sum_congr rfl intro d _ rw [sum_div, sum_filter] apply sum_congr rfl intro u _ split_ifs <;> simp [div_eq_mul_inv] _ = ∑ u ∈ T, ∑ d ∈ M, μ u * (if ¬ Nat.Coprime d (value u) then 1 / (Nat.totient d : ℝ) else 0) := sum_comm _ = _ := by apply sum_congr rfl intro u _ rw [← mul_sum, sum_filter] theorem totient_sieve_principal_replacement_bound {Ω : Type*} (T : Finset Ω) (M : Finset ℕ) (μ : Ω → ℝ) (value : Ω → ℕ) (hμ : ∀ u ∈ T, 0 ≤ μ u) (X B : ℝ) (hX : (∑ u ∈ T, μ u) = X) (hpoint : ∀ u ∈ T, μ u ≠ 0 → (∑ d ∈ M.filter (fun d => ¬ Nat.Coprime d (value u)), 1 / (Nat.totient d : ℝ)) ≤ B) : (∑ d ∈ M, |(∑ u ∈ T.filter (fun u => Nat.Coprime d (value u)), μ u) / (Nat.totient d : ℝ) - X / (Nat.totient d : ℝ)|) ≤ X * B := by rw [← hX, totient_sieve_principal_replacement_identity T M μ value hμ, sum_mul] apply sum_le_sum intro u hu by_cases hz : μ u = 0 · simp only [hz, zero_mul, le_refl] · exact mul_le_mul_of_nonneg_left (hpoint u hu hz) (hμ u hu) end section open scoped BigOperators Classical noncomputable def finitePairEventMass {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (E : X → Y → Prop) : ℝ := ∑ x, ∑ y, if E x y then μ x * ν y else 0 section variable {X Y : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (E : X → Y → Prop) include X Y sharedInstance1 sharedInstance2 μ ν hμ hν E theorem finite_pair_event_mass_nonneg : 0 ≤ finitePairEventMass μ ν E := by apply Finset.sum_nonneg intro x _ apply Finset.sum_nonneg intro y _ split_ifs · exact mul_nonneg (hμ x) (hν y) · exact le_rfl theorem finite_pair_event_pairing_sq_le (K : X → Y → ℂ) (hK : ∀ x y, ‖K x y‖ ≤ 1) (f : X → ℂ) (g : Y → ℂ) : ‖∑ x, ∑ y, if E x y then ((μ x * ν y : ℝ) : ℂ) * (K x y * f x * g y) else 0‖ ^ 2 ≤ finitePairEventMass μ ν E * ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by let w (z : X × Y) : ℝ := if E z.1 z.2 then μ z.1 * ν z.2 else 0 let F (z : X × Y) : ℂ := K z.1 z.2 * f z.1 * g z.2 have hw (z : X × Y) : 0 ≤ w z := by dsimp only [w] split_ifs · exact mul_nonneg (hμ z.1) (hν z.2) · exact le_rfl have hmass : (∑ z, w z) = finitePairEventMass μ ν E := by rw [Fintype.sum_prod_type] rfl have hleft : (∑ z, (w z : ℂ) * F z) = ∑ x, ∑ y, if E x y then ((μ x * ν y : ℝ) : ℂ) * (K x y * f x * g y) else 0 := by rw [Fintype.sum_prod_type] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ by_cases he : E x y <;> simp [w, F, he] have hnorm (x : X) (y : Y) : ‖K x y * f x * g y‖ ^ 2 ≤ ‖f x‖ ^ 2 * ‖g y‖ ^ 2 := by have hk : ‖K x y‖ ^ 2 ≤ 1 := by nlinarith [hK x y, norm_nonneg (K x y)] calc _ = ‖K x y‖ ^ 2 * (‖f x‖ ^ 2 * ‖g y‖ ^ 2) := by rw [norm_mul, norm_mul]; ring _ ≤ 1 * (‖f x‖ ^ 2 * ‖g y‖ ^ 2) := mul_le_mul_of_nonneg_right hk (mul_nonneg (sq_nonneg _) (sq_nonneg _)) _ = _ := one_mul _ have henergy : (∑ z, w z * ‖F z‖ ^ 2) ≤ (∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2 := by calc _ ≤ ∑ z : X × Y, μ z.1 * ν z.2 * (‖f z.1‖ ^ 2 * ‖g z.2‖ ^ 2) := by apply Finset.sum_le_sum intro z _ dsimp only [w, F] split_ifs · exact mul_le_mul_of_nonneg_left (hnorm z.1 z.2) (mul_nonneg (hμ z.1) (hν z.2)) · simp only [zero_mul] exact mul_nonneg (mul_nonneg (hμ z.1) (hν z.2)) (mul_nonneg (sq_nonneg _) (sq_nonneg _)) _ = _ := by rw [Fintype.sum_prod_type, Finset.sum_mul_sum] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ ring have hc := finite_weighted_sum_cauchy Finset.univ w (fun z _ => hw z) F rw [hleft, hmass] at hc exact hc.trans (mul_le_mul_of_nonneg_left henergy (finite_pair_event_mass_nonneg μ ν hμ hν E)) theorem finite_pair_event_pairing_le (K : X → Y → ℂ) (hK : ∀ x y, ‖K x y‖ ≤ 1) (f : X → ℂ) (g : Y → ℂ) : ‖∑ x, ∑ y, if E x y then ((μ x * ν y : ℝ) : ℂ) * (K x y * f x * g y) else 0‖ ≤ Real.sqrt (finitePairEventMass μ ν E) * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by have hc := finite_pair_event_pairing_sq_le μ ν hμ hν E K hK f g have hm := finite_pair_event_mass_nonneg μ ν hμ hν E have hE : 0 ≤ (∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2 := by exact mul_nonneg (Finset.sum_nonneg (fun x _ => mul_nonneg (hμ x) (sq_nonneg _))) (Finset.sum_nonneg (fun y _ => mul_nonneg (hν y) (sq_nonneg _))) have hs := Real.sqrt_le_sqrt hc rw [Real.sqrt_sq (norm_nonneg _), Real.sqrt_mul hm] at hs exact hs end end section open Finset theorem sum_subsets_complement {I M : Type*} [Fintype I] [DecidableEq I] [AddCommMonoid M] (Z : Finset I) (F : Finset I → M) : (∑ T ∈ Z.powerset, F T) = ∑ S : Finset I, if univ \ S ⊆ Z then F (univ \ S) else 0 := by classical have he : (∑ T ∈ Z.powerset, F T) = ∑ T : Finset I, if T ⊆ Z then F T else 0 := by rw [← sum_filter] congr 1 ext T simp only [mem_powerset, mem_filter, mem_univ, true_and] rw [he] let e : Finset I ≃ Finset I := ⟨fun T => Tᶜ, fun T => Tᶜ, compl_compl, compl_compl⟩ exact (e.sum_comp (fun T => if T ⊆ Z then F T else 0)).symm theorem physical_ghost_old_event_sum {P : Type*} (n : P → ℕ) {N : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (η ρ : ℝ) (F : Finset (Fin N) → ℂ) : (∑ T ∈ (globalBirthVisitZeroIndices (fun _ => 0) old).powerset, (((-η / ρ) ^ T.card * ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeroIndices (fun _ => 0) old \ T).card : ℝ) : ℂ) * F (univ \ T)) = ∑ S : Finset (Fin N), (((∏ j ∈ S, physicalGhostRetention n (1 - η) ρ (old j)) * ∏ j ∈ univ \ S, physicalGhostTermination n (1 - η) ρ (old j) : ℝ) : ℂ) * F S := by classical rw [sum_subsets_complement] apply sum_congr rfl intro S _ have hc : univ \ (univ \ S) = S := by ext j simp only [mem_sdiff, mem_univ, true_and, not_not] by_cases hS : univ \ S ⊆ globalBirthVisitZeroIndices (fun _ => 0) old · rw [if_pos hS, hc] have hw := physical_ghost_old_event_coefficient n old η ρ (univ \ S) hS rw [hc] at hw rw [← hw] · rw [if_neg hS, physical_ghost_terminated_coefficient_zero n old η ρ (univ \ S) hS, mul_zero, Complex.ofReal_zero, zero_mul] end section open Finset Classical section variable {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) theorem fullActiveEdgeEventTarget_shared : (productActiveMemorySplit S B (fullActiveEdgeEventTarget n S B A Δ D x e)).1 = (productActiveMemorySplit S B x).1 := by simp only [fullActiveEdgeEventTarget, Equiv.apply_symm_apply] theorem fullActiveEdgeEventTarget_total [Fintype G] : productTotalMemory (fullActiveEdgeEventTarget n S B A Δ D x e) = productTotalMemory (unrestrictedJointEventTarget n (Δ (productActiveMemorySplit S B x).1 e.1) (D (productActiveMemorySplit S B x).1 e.1) (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B x).2 e.2) := by exact productActiveMemorySplit_total_memory_symm S B _ _ theorem fullActiveEdgeEventWeight_full_caps [Fintype G] (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) : fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e = if productTotalMemory x ≤ B ∧ productTotalMemory (fullActiveEdgeEventTarget n S B A Δ D x e) ≤ B then ω (productActiveMemorySplit S B x).1 e.1 * ∏ g, unrestrictedBoundedEventWeight (n g) (Δ (productActiveMemorySplit S B x).1 e.1 g) (D (productActiveMemorySplit S B x).1 e.1 g) (μ g) ρ (V g) (S g)ᶜ.card B ((productActiveMemorySplit S B x).2 g) (e.2 g) else 0 := by rw [fullActiveEdgeEventTarget_total] unfold fullActiveEdgeEventWeight unrestrictedJointCutoffEventWeight rw [productActiveMemorySplit_total_memory] split_ifs <;> simp only [mul_zero] end end section open Finset Classical universe uJ uK uG uP uA section variable {J : Type uJ} {K : Type uK} {G : Type uG} {P : G → Type uP} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) (Δ D : ∀ k c, A k c → G → ℤ) def FullMixedMemoryEvent : (J ⊕ K) → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → Type _ | .inl _, s => ULift.{uA} (CoupledGhostEvent M B s) | .inr k, s => FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) s noncomputable abbrev fullMixedMemoryEventFintype [Fintype G] [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] (k : J ⊕ K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : Fintype (FullMixedMemoryEvent n S B A Δ D k s) := by cases k <;> dsimp [FullMixedMemoryEvent] <;> infer_instance noncomputable def fullMixedMemoryEventTarget (k : J ⊕ K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FullMixedMemoryEvent n S B A Δ D k s → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B := match k with | .inl _ => fun e => coupledGhostJointEventTarget M B s e.down | .inr k => fullActiveEdgeEventTarget n (S k) B (A k) (Δ k) (D k) s noncomputable def fullMixedMemoryEventWeight [Fintype G] (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) (k : J ⊕ K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FullMixedMemoryEvent n S B A Δ D k s → ℝ := match k with | .inl j => fun e => coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (q j) ρ) (fun g => physicalGhostTermination (n g) (q j) ρ) (fun g => physicalGhostBirth (n g) (q j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B s e.down | .inr k => fullActiveEdgeEventWeight n (S k) B (A k) (Δ k) (D k) (ω k) μ ρ V s end end section open scoped BigOperators Classical theorem finite_projected_probe_tensor_energy {G : Type*} [Fintype G] [DecidableEq G] {I X : G → Type*} [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)] [∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (hμ : ∀ g x, 0 ≤ μ g x) (hmass : ∀ g, ∑ x, μ g x = 1) (A B : ∀ g, Finset (I g)) (hAB : ∀ g, Disjoint (A g) (B g)) (hm : ∀ g, 0 < (A g).card) (s : Finset G) (f : (∀ g, I g → X g) → ℂ) : finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) (finiteCoordinateFinsetAction (fun g v => finiteCoordinateComponent (fun _ : I g => μ g) (A g) (A g ∪ B g).toList (finiteSlotSymmetrize v)) s f) ≤ (∏ g ∈ s, (((B g).card : ℝ) ^ (B g).card / ((A g).card : ℝ) ^ (B g).card)) * finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f := by apply finite_coordinate_finset_energy_le (fun g => finiteProductWeight (fun _ : I g => μ g)) (fun g x => Finset.prod_nonneg (fun i _ => hμ g (x i))) (fun g v => finiteCoordinateComponent (fun _ : I g => μ g) (A g) (A g ∪ B g).toList (finiteSlotSymmetrize v)) (fun g => (((B g).card : ℝ) ^ (B g).card / ((A g).card : ℝ) ^ (B g).card)) (fun _ => by positivity) intro g v exact finite_projected_probe_energy (μ g) (hμ g) (hmass g) (A g) (B g) (hAB g) (hm g) v end section open scoped BigOperators Classical def finiteGroupSlotSymmetric {G : Type*} [DecidableEq G] {I X : G → Type*} (g : G) (f : (∀ h, I h → X h) → ℂ) : Prop := ∀ (σ : Equiv.Perm (I g)) x, f (Function.update x g (finiteSlotRelabel σ (x g))) = f x section variable {G : Type*} [sharedInstance1 : DecidableEq G] {I X : G → Type*} include G sharedInstance1 I X theorem finite_group_section_symmetric (g : G) (f : (∀ h, I h → X h) → ℂ) (hf : finiteGroupSlotSymmetric g f) (x : ∀ h, I h → X h) (σ : Equiv.Perm (I g)) : finiteSlotPermute σ (fun y => f (Function.update x g y)) = fun y => f (Function.update x g y) := by funext y have h := hf σ (Function.update x g y) simpa only [Function.update_self, Function.update_idem, finiteSlotPermute] using h theorem finite_group_symmetrized_lift_eq [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)] (g : G) (P : ((I g → X g) → ℂ) → (I g → X g) → ℂ) (f : (∀ h, I h → X h) → ℂ) (hf : finiteGroupSlotSymmetric g f) : finiteCoordinateLift g (fun v => P (finiteSlotSymmetrize v)) f = finiteCoordinateLift g P f := by funext x rw [finite_coordinate_lift_eq_update, finite_coordinate_lift_eq_update, finite_slot_symmetrize_eq_self _ (finite_group_section_symmetric g f hf x)] theorem finite_group_compose_preserves_symmetry (g : G) (P : ∀ h, ((I h → X h) → ℂ) → (I h → X h) → ℂ) (is : List G) (hg : g ∉ is) (f : (∀ h, I h → X h) → ℂ) (hf : finiteGroupSlotSymmetric g f) : finiteGroupSlotSymmetric g (finiteCoordinateCompose P is f) := by intro σ x exact finite_coordinate_compose_preserves_invariance g (finiteSlotRelabel σ) P is hg f (hf σ) x theorem finite_group_symmetrized_compose_eq [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)] (P : ∀ h, ((I h → X h) → ℂ) → (I h → X h) → ℂ) (is : List G) (hnodup : is.Nodup) (f : (∀ h, I h → X h) → ℂ) (hf : ∀ g, finiteGroupSlotSymmetric g f) : finiteCoordinateCompose (fun g v => P g (finiteSlotSymmetrize v)) is f = finiteCoordinateCompose P is f := by induction is with | nil => rfl | cons g is ih => obtain ⟨hg, ht⟩ := List.nodup_cons.mp hnodup simp only [finiteCoordinateCompose, ih ht] exact finite_group_symmetrized_lift_eq g (P g) _ (finite_group_compose_preserves_symmetry g P is hg f (hf g)) end end section open Finset Classical noncomputable def fullActivePermutationWeight {G : Type*} [Fintype G] [DecidableEq G] (M : G → ℕ) (_τ : FullActiveSlotPermutations M) : ℝ := (Fintype.card (FullActiveSlotPermutations M) : ℝ)⁻¹ theorem fullActivePermutationWeight_nonneg {G : Type*} [Fintype G] [DecidableEq G] (M : G → ℕ) (τ : FullActiveSlotPermutations M) : 0 ≤ fullActivePermutationWeight M τ := inv_nonneg.mpr (Nat.cast_nonneg _) theorem fullActivePermutationWeight_mass {G : Type*} [Fintype G] [DecidableEq G] (M : G → ℕ) : ∑ τ, fullActivePermutationWeight M τ = 1 := by have hc : (Fintype.card (FullActiveSlotPermutations M) : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero simp only [fullActivePermutationWeight, sum_const, card_univ, nsmul_eq_mul] exact mul_inv_cancel₀ hc noncomputable def fullActiveAverage {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z M B → ℂ) (x : ProductBoundedOrderedState P Z M B) : ℂ := ∑ τ : FullActiveSlotPermutations M, (fullActivePermutationWeight M τ : ℂ) * f (fullActivePermutation τ x) theorem fullActiveAverage_symmetric {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z M B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (fullActiveAverage f) := by intro x g σ unfold fullActiveAverage apply sum_congr rfl intro τ _ exact congrArg (fun z : ℂ => (fullActivePermutationWeight M τ : ℂ) * z) (fullActivePermutation_symmetric τ f hf x g σ) theorem fullActiveAverage_energy_le {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {M : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (f : ProductBoundedOrderedState P Z M B → ℂ) : finiteWeightedEnergy (productMemoryWeight μ ν) (fullActiveAverage f) ≤ finiteWeightedEnergy (productMemoryWeight μ ν) f := by calc _ ≤ ∑ τ, fullActivePermutationWeight M τ * finiteWeightedEnergy (productMemoryWeight μ ν) (fun x => f (fullActivePermutation τ x)) := finite_subprobability_average_energy_le (fullActivePermutationWeight M) (productMemoryWeight μ ν) (fullActivePermutationWeight_nonneg M) (fullActivePermutationWeight_mass M).le (productMemoryWeight_nonneg μ ν hμ hν) (fun τ x => f (fullActivePermutation τ x)) _ = _ := by simp_rw [fullActivePermutation_energy μ ν] rw [← sum_mul, fullActivePermutationWeight_mass, one_mul] end section open Finset open scoped Classical theorem unrestricted_residue_eligible_subset_raw_hit {P : Type*} {N : ℕ} (n : P → ℕ) (Δ D : ℤ) (old : Fin N → UnrestrictedResidueParticle n) : unrestrictedResidueEligible n Δ D old ⊆ globalBirthRawHitIndices (fun p => (Δ : ZMod (n p))) ⟨N, old⟩ := by intro j hj exact (global_birth_raw_hit_indices_mem (fun p => (Δ : ZMod (n p))) ⟨N, old⟩ j).mpr ((mem_unrestrictedResidueEligible n Δ D old j).mp hj).1 theorem global_birth_edge_raw_row_eq_residue_action {P : Type*} [Fintype P] [DecidableEq P] {t N : ℕ} (n : P → ℕ) (Δ D : ℤ) (source target : Fin t ↪ P) (hsource : ∀ i, ¬ (n (source i) : ℤ) ∣ D) (htarget : ∀ i, ¬ (n (target i) : ℤ) ∣ D) (H : Finset P) (old : Fin N → UnrestrictedResidueParticle n) (β : P → ℝ) (ρ V : ℝ) (B : ℕ) (F : Finset P → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : globalBirthEdgeRawRow source target (fun p => (Δ : ZMod (n p))) H old (globalBirthRawHitIndices (fun p => (Δ : ZMod (n p))) ⟨N, old⟩) β ρ V B F = unrestrictedResidueEdgeAction n Δ D source old (fun p => β p / V) ρ V B (fun _stores promotions e fresh => if unrestrictedEdgeTarget old Sigma.fst promotions e fresh = target ∧ (∀ s, fresh s ∉ H) then 1 else 0) (fun target' q => F (H ∪ univ.image target') q) := by let small := unrestrictedResidueEligible n Δ D old let large := globalBirthRawHitIndices (fun p => (Δ : ZMod (n p))) ⟨N, old⟩ have hsub : small ⊆ large := unrestricted_residue_eligible_subset_raw_hit n Δ D old let phase := fun (_stores promotions : Finset (Fin t)) (e : promotions ↪ large) (fresh : UnrestrictedFreshLabels P promotions) => if unrestrictedEdgeTarget old Sigma.fst promotions e fresh = target ∧ (∀ s, fresh s ∉ H) then (1 : ℂ) else 0 have hz : ∀ stores promotions e fresh, (∃ i, (e i).val ∉ small) → phase stores promotions e fresh = 0 := by intro stores promotions e fresh he obtain ⟨i, hi⟩ := he have hn : ¬ (unrestrictedEdgeTarget old Sigma.fst promotions e fresh = target ∧ (∀ s, fresh s ∉ H)) := by intro hv apply hi apply (mem_unrestrictedResidueEligible n Δ D old _).mpr refine ⟨(global_birth_raw_hit_indices_mem _ _ _).mp (e i).property, ?_⟩ have hlabel : (old (e i).val).1 = target i.val := by rw [← hv.1] exact (unrestrictedTargetLabels_promoted promotions (fun j => (old (e j).val).1) fresh i).symm rw [hlabel] exact htarget i.val exact if_neg hn have he := unrestricted_edge_action_restrict_eligibility source old Sigma.fst (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit (fun p => β p / V) ρ V small large hsub B phase hz (fun target' q => F (H ∪ univ.image target') q) have hs (stores : Finset (Fin t)) : unrestrictedResidueStorageAllowed n D source stores := fun i _ => hsource i unfold unrestrictedResidueEdgeAction simp only [hs, if_true] exact he.symm end section open Finset noncomputable def intervalDivisibilityRemainder (A B d : ℕ) : ℝ := (((Ioc A B).filter (fun n => d ∣ n)).card : ℝ) - ((B : ℝ) - (A : ℝ)) / (d : ℝ) theorem prime_subset_product_dvd_iff (S : Finset ℕ) (hS : ∀ p ∈ S, p.Prime) (n : ℕ) : (∏ p ∈ S, p) ∣ n ↔ ∀ p ∈ S, p ∣ n := by constructor · intro hn p hp exact (dvd_prod_of_mem (fun p : ℕ => p) hp).trans hn · intro hn induction S using Finset.induction_on with | empty => simp | @insert p S hp ih => rw [prod_insert hp] have hpPrime := hS p (mem_insert_self _ _) have hSPrime : ∀ q ∈ S, q.Prime := fun q hq => hS q (mem_insert_of_mem hq) have hcop : p.Coprime (∏ q ∈ S, q) := by apply Nat.Coprime.prod_right intro q hq exact (Nat.coprime_primes hpPrime (hSPrime q hq)).mpr (fun heq => hp (heq ▸ hq)) exact hcop.mul_dvd_of_dvd_of_dvd (hn p (mem_insert_self _ _)) (ih hSPrime (fun q hq => hn q (mem_insert_of_mem hq))) theorem interval_prime_intersection_moment (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (A B : ℕ) (S : Finset ℕ) (hS : S ⊆ P) : (∑ _n ∈ (Ioc A B).filter (fun n => ∀ p ∈ S, p ∣ n), (1 : ℝ)) = ((B : ℝ) - (A : ℝ)) * (∏ p ∈ S, 1 / (p : ℝ)) + intervalDivisibilityRemainder A B (∏ p ∈ S, p) := by have hfilter : (Ioc A B).filter (fun n => ∀ p ∈ S, p ∣ n) = (Ioc A B).filter (fun n => (∏ p ∈ S, p) ∣ n) := by apply filter_congr intro n _ exact (prime_subset_product_dvd_iff S (fun p hp => hP p (hS hp)) n).symm have hrecip : (∏ p ∈ S, 1 / (p : ℝ)) = 1 / ((∏ p ∈ S, p : ℕ) : ℝ) := by simp only [one_div, prod_inv_distrib, Nat.cast_prod] rw [hfilter, hrecip] simp only [sum_const, nsmul_eq_mul, mul_one, intervalDivisibilityRemainder] ring theorem interval_divisibility_remainder_abs_le_one (A B d : ℕ) (hAB : A ≤ B) (hd : 0 < d) : |intervalDivisibilityRemainder A B d| ≤ 1 := interval_multiples_error_le_one A B d hAB hd theorem interval_divisibility_remainder_sum_le (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (A B : ℕ) (hAB : A ≤ B) (D : ℝ) (hD : 0 ≤ D) : (∑ d ∈ blockSieveModuli P D, |intervalDivisibilityRemainder A B d|) ≤ D := by calc _ ≤ ∑ _d ∈ blockSieveModuli P D, (1 : ℝ) := by apply sum_le_sum intro d hd exact interval_divisibility_remainder_abs_le_one A B d hAB (block_sieve_modulus_properties P hP D hd).1 _ = ((blockSieveModuli P D).card : ℝ) := by simp _ ≤ ((Icc 1 ⌊D⌋₊).card : ℝ) := by exact_mod_cast card_le_card (filter_subset (fun d => d ∣ ∏ p ∈ P, p) (Icc 1 ⌊D⌋₊)) _ = (⌊D⌋₊ : ℝ) := by simp _ ≤ D := Nat.floor_le hD end section open Finset theorem exists_reciprocal_prime_sieve_events : ∃ K : ℝ, 0 < K ∧ ∀ {Ω : Type*} (P : Finset ℕ) (T : Finset Ω) (μ : Ω → ℝ) (bad : Ω → ℕ → Prop) [∀ t p, Decidable (bad t p)] (r : ℕ → ℝ) {z X : ℝ} {h : ℕ}, 1 < z → 0 ≤ X → 1 ≤ h → Even h → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, (p : ℝ) ≤ z) → (∀ t ∈ T, 0 ≤ μ t) → (∀ S ∈ P.powerset, (∑ t ∈ T.filter (fun t => ∀ p ∈ S, bad t p), μ t) = X * (∏ p ∈ S, 1 / (p : ℝ)) + r (∏ p ∈ S, p)) → |(∑ t ∈ T.filter (fun t => ∀ p ∈ P, ¬bad t p), μ t) - X * (∏ p ∈ P, (1 - 1 / (p : ℝ)))| ≤ X * (∏ p ∈ P, (1 - 1 / (p : ℝ))) * K * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli P (z^(4 * (h : ℝ) + 2)), |r d| := by obtain ⟨C, hC, hshell⟩ := exists_finite_prime_reciprocal_shell_bound refine ⟨blockSieveModelErrorConstant C (1/2), block_sieve_model_error_constant_pos C (1/2), ?_⟩ intro Ω P T μ bad decBad r z X h hz hX hh heven hP hPz hμ hmoment have hg : ∀ p ∈ P, 0 ≤ 1 / (p : ℝ) ∧ 1 / (p : ℝ) ≤ 1 - (1/2 : ℝ) := by intro p hp have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast (hP p hp).two_le refine ⟨by positivity, ?_⟩ have hb := one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 2) hp2 norm_num at hb ⊢ exact hb exact finite_prime_sieve_events P T μ bad (fun p => 1 / (p : ℝ)) r hz hX hC (by norm_num) hh heven hP hPz hμ hg (hshell P hP) hmoment end section open Finset theorem prime_predecessor_reciprocal_le_twice {p : ℕ} (hp : p.Prime) : 1 / ((p : ℝ) - 1) ≤ 2 / (p : ℝ) := by have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hp.two_le apply (div_le_div_iff₀ (by linarith) (by linarith)).mpr nlinarith theorem exists_prime_predecessor_reciprocal_shell_bound : ∃ C : ℝ, 0 ≤ C ∧ ∀ P : Finset ℕ, (∀ p ∈ P, p.Prime) → ∀ w : ℝ, 1 < w → (∑ p ∈ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2), 1 / ((p : ℝ) - 1)) ≤ C := by obtain ⟨C, hC, hbound⟩ := exists_finite_prime_reciprocal_shell_bound refine ⟨2*C, by positivity, ?_⟩ intro P hP w hw calc _ ≤ ∑ p ∈ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2), 2 / (p : ℝ) := by apply sum_le_sum intro p hp exact prime_predecessor_reciprocal_le_twice (hP p (mem_filter.mp hp).1) _ = 2 * (∑ p ∈ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2), 1 / (p : ℝ)) := by rw [mul_sum]; congr 1; ext p; ring _ ≤ 2*C := mul_le_mul_of_nonneg_left (hbound P hP w hw) (by norm_num) theorem exists_odd_prime_reciprocal_sieve_events : ∃ K : ℝ, 0 < K ∧ ∀ {Ω : Type*} (P : Finset ℕ) (T : Finset Ω) (μ : Ω → ℝ) (bad : Ω → ℕ → Prop) [∀ t p, Decidable (bad t p)] (r : ℕ → ℝ) {z X : ℝ} {h : ℕ}, 1 < z → 0 ≤ X → 1 ≤ h → Even h → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, p ≠ 2) → (∀ p ∈ P, (p : ℝ) ≤ z) → (∀ t ∈ T, 0 ≤ μ t) → (∀ S ∈ P.powerset, (∑ t ∈ T.filter (fun t => ∀ p ∈ S, bad t p), μ t) = X * (∏ p ∈ S, 1 / ((p : ℝ) - 1)) + r (∏ p ∈ S, p)) → |(∑ t ∈ T.filter (fun t => ∀ p ∈ P, ¬bad t p), μ t) - X * (∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1)))| ≤ X * (∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1))) * K * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli P (z^(4 * (h : ℝ) + 2)), |r d| := by obtain ⟨C, hC, hshell⟩ := exists_prime_predecessor_reciprocal_shell_bound refine ⟨blockSieveModelErrorConstant C (1/2), block_sieve_model_error_constant_pos C (1/2), ?_⟩ intro Ω P T μ bad decBad r z X h hz hX hh heven hP hodd hPz hμ hmoment have hg : ∀ p ∈ P, 0 ≤ 1 / ((p : ℝ) - 1) ∧ 1 / ((p : ℝ) - 1) ≤ 1 - (1/2 : ℝ) := by intro p hp have hp3 : 3 ≤ p := by have := (hP p hp).two_le; have := hodd p hp; omega have hp3R : (3 : ℝ) ≤ p := by exact_mod_cast hp3 have hden : (2 : ℝ) ≤ (p : ℝ) - 1 := by linarith refine ⟨by positivity, ?_⟩ have hb := one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 2) hden norm_num at hb ⊢ exact hb exact finite_prime_sieve_events P T μ bad (fun p => 1 / ((p : ℝ) - 1)) r hz hX hC (by norm_num) hh heven hP hPz hμ hg (hshell P hP) hmoment theorem odd_small_prime_avoidance_iff_rough {z : ℝ} {n : ℕ} (hz : 0 ≤ z) (hodd : ¬2 ∣ n) : (∀ p ∈ (primeBand 0 z).erase 2, ¬p ∣ n) ↔ ∀ p ∈ n.primeFactors, z < (p : ℝ) := by have hn : n ≠ 0 := by intro hn; subst n; exact hodd (dvd_zero 2) rw [← small_prime_avoidance_iff_rough hz hn] constructor · intro hav p hp by_cases hp2 : p = 2 · simpa only [hp2] using hodd · exact hav p (mem_erase.mpr ⟨hp2, hp⟩) · intro hav p hp exact hav p (mem_of_mem_erase hp) theorem not_two_dvd_two_mul_add_one (u : ℕ) : ¬2 ∣ 2*u + 1 := by omega theorem two_mul_add_one_odd_prime_avoidance_iff_rough (u : ℕ) {z : ℝ} (hz : 0 ≤ z) : (∀ p ∈ (primeBand 0 z).erase 2, ¬p ∣ 2*u + 1) ↔ ∀ p ∈ (2*u + 1).primeFactors, z < (p : ℝ) := odd_small_prime_avoidance_iff_rough hz (not_two_dvd_two_mul_add_one u) end section open scoped BigOperators Classical theorem finite_cell_reverse_pairing {X D I : Type*} [Fintype X] [Fintype I] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (kept : Finset D) (ψ : I → X → ℂ) (k : I) (y : X) (hy : cell y ∈ kept) : (∑ x, (μ x : ℂ) * finiteCellFrameKernel μ cell kept ψ x y * (starRingEnd ℂ) (ψ k x)) = ∑ x, (finiteCellLaw μ cell (cell y) x : ℂ) * finiteMeasureFrameKernel ψ x y * (starRingEnd ℂ) (ψ k x) := by apply Finset.sum_congr rfl intro x _ by_cases hxy : cell x = cell y · simp only [finiteCellFrameKernel, hxy, hy, and_self, if_true, finiteCellLaw] push_cast ring · simp only [finiteCellFrameKernel, hxy, false_and, if_false, finiteCellLaw, Complex.ofReal_zero, zero_mul, mul_zero] theorem finite_cell_character_reproduction {X D I : Type*} [Fintype X] [Fintype I] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (kept : Finset D) (ψ : I → X → ℂ) (hunit : ∀ i x, μ x ≠ 0 → ‖ψ i x‖ = 1) {δ ξ : ℝ} (hδ : 0 ≤ δ) (hξ : 0 < ξ) (hkept : ∀ d ∈ kept, ξ ≤ finiteCellMass μ cell d) (hraw : ∀ d ∈ kept, ∀ i j, i ≠ j → ‖∑ x, if cell x = d then (μ x : ℂ) * (starRingEnd ℂ) (ψ i x) * ψ j x else 0‖ ≤ δ) (k : I) (y : X) (hy : cell y ∈ kept) (hψy : ∀ i, ‖ψ i y‖ ≤ 1) : ‖(∑ x, (μ x : ℂ) * finiteCellFrameKernel μ cell kept ψ x y * (starRingEnd ℂ) (ψ k x)) - (starRingEnd ℂ) (ψ k y)‖ ≤ (Fintype.card I - 1 : ℕ) * (δ / ξ) := by rw [finite_cell_reverse_pairing μ cell kept ψ k y hy] refine finite_probability_frame_reproduction (finiteCellLaw μ cell (cell y)) (finite_cell_law_mass μ cell (cell y) (ne_of_gt (hξ.trans_le (hkept _ hy)))) ψ ?_ (div_nonneg hδ hξ.le) ?_ k y hψy · intro i x hx apply hunit i x intro hzero apply hx simp only [finiteCellLaw, hzero, zero_div, ite_self] · intro i j hij exact finite_cell_gram_norm_le μ cell (cell y) ψ i j hδ hξ (hkept _ hy) (hraw _ hy i j hij) end section open scoped BigOperators Classical theorem upper_log_cell_monotone {h : ℝ} (hh : 0 < h) : Monotone (upperLogCell h) := by intro x y hxy exact Int.ceil_mono (div_le_div_of_nonneg_right hxy hh.le) section variable {X : Type*} [sharedInstance1 : Fintype X] (z : X → ℝ) {h a b : ℝ} (hh : 0 < h) include X sharedInstance1 z h a b hh theorem upper_log_occupied_cells_subset (hz : ∀ x, a ≤ z x ∧ z x ≤ b) : finiteOccupiedCells (fun x => upperLogCell h (z x)) ⊆ Finset.Icc (upperLogCell h a) (upperLogCell h b) := by intro d hd obtain ⟨x, _, rfl⟩ := Finset.mem_image.mp hd exact Finset.mem_Icc.mpr ⟨upper_log_cell_monotone hh (hz x).1, upper_log_cell_monotone hh (hz x).2⟩ theorem upper_log_occupied_cells_card_le (hz : ∀ x, a ≤ z x ∧ z x ≤ b) : (finiteOccupiedCells (fun x => upperLogCell h (z x))).card ≤ (upperLogCell h b - upperLogCell h a + 1).toNat := by have hc := Finset.card_le_card (upper_log_occupied_cells_subset z hh hz) rw [Int.card_Icc] at hc have he : upperLogCell h b - upperLogCell h a + 1 = upperLogCell h b + 1 - upperLogCell h a := by ring simpa only [he] using hc theorem upper_log_occupied_cells_card_real_le (hab : a ≤ b) (hz : ∀ x, a ≤ z x ∧ z x ≤ b) : ((finiteOccupiedCells (fun x => upperLogCell h (z x))).card : ℝ) ≤ (b - a) / h + 2 := by have hle := upper_log_cell_monotone hh hab have hnonneg : 0 ≤ upperLogCell h b - upperLogCell h a + 1 := by omega have hc : ((finiteOccupiedCells (fun x => upperLogCell h (z x))).card : ℝ) ≤ ((upperLogCell h b : ℤ) : ℝ) - ((upperLogCell h a : ℤ) : ℝ) + 1 := by have hc := upper_log_occupied_cells_card_le z hh hz have hcZ : ((finiteOccupiedCells (fun x => upperLogCell h (z x))).card : ℤ) ≤ ((upperLogCell h b - upperLogCell h a + 1).toNat : ℤ) := by exact_mod_cast hc rw [Int.toNat_of_nonneg hnonneg] at hcZ exact_mod_cast hcZ have hu := Int.ceil_lt_add_one (b / h) have hl := Int.le_ceil (a / h) change (upperLogCell h b : ℝ) < b / h + 1 at hu change a / h ≤ (upperLogCell h a : ℝ) at hl rw [sub_div] linarith end end section open Finset theorem euler_correction_interval_product (N : ℕ) : (∏ n ∈ Icc 2 (N + 1), (1 + 1 / ((n : ℝ)^2 - 1))) = 2 * ((N : ℝ) + 1) / ((N : ℝ) + 2) := by induction N with | zero => norm_num | succ N ih => rw [show N.succ + 1 = (N + 1) + 1 by omega, prod_Icc_succ_top (by omega : 2 ≤ (N + 1) + 1), ih] push_cast have h1 : (N : ℝ) + 2 ≠ 0 := by positivity have h2 : (N : ℝ) + 1 + 2 ≠ 0 := by positivity have h3 : ((N : ℝ) + 1 + 1)^2 - 1 ≠ 0 := by have hN : (0 : ℝ) ≤ N := Nat.cast_nonneg N nlinarith field_simp ring theorem euler_correction_product_le_two (P : Finset ℕ) (hP : ∀ p ∈ P, 2 ≤ p) : (∏ p ∈ P, (1 + 1 / ((p : ℝ)^2 - 1))) ≤ 2 := by have hcorr (p : ℕ) (hp : 2 ≤ p) : 1 ≤ (1 : ℝ) + 1 / ((p : ℝ)^2 - 1) := by have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hp have hden : 0 < (p : ℝ)^2 - 1 := by nlinarith exact le_add_of_nonneg_right (le_of_lt (one_div_pos.mpr hden)) have hsub : P ⊆ Icc 2 (P.sup id + 1) := by intro p hp exact mem_Icc.mpr ⟨hP p hp, (Finset.le_sup (f := id) hp).trans (Nat.le_succ _)⟩ calc _ ≤ ∏ n ∈ Icc 2 (P.sup id + 1), (1 + 1 / ((n : ℝ)^2 - 1)) := by apply prod_le_prod_of_subset_of_one_le₀ hsub · intro p hp exact zero_le_one.trans (hcorr p (hP p hp)) · intro p hp _ exact hcorr p (mem_Icc.mp hp).1 _ = 2 * ((P.sup id : ℕ) + 1 : ℝ) / ((P.sup id : ℕ) + 2 : ℝ) := euler_correction_interval_product (P.sup id) _ ≤ 2 := by apply (div_le_iff₀ (by positivity : (0 : ℝ) < (P.sup id : ℕ) + 2)).mpr linarith theorem inverse_euler_factor_eq (p : ℕ) (hp : 2 ≤ p) : (1 : ℝ) + 1 / ((p : ℝ) - 1) = (1 + 1 / (p : ℝ)) * (1 + 1 / ((p : ℝ)^2 - 1)) := by have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hp have h0 : (p : ℝ) ≠ 0 := by linarith have h1 : (p : ℝ) - 1 ≠ 0 := by linarith have h2 : (p : ℝ)^2 - 1 ≠ 0 := by nlinarith field_simp ring theorem finite_inverse_prime_euler_product_le_twice (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) : (∏ p ∈ P, ((1 : ℝ) + 1 / ((p : ℝ) - 1))) ≤ 2 * ∏ p ∈ P, (1 + 1 / (p : ℝ)) := by calc _ = (∏ p ∈ P, (1 + 1 / (p : ℝ))) * ∏ p ∈ P, (1 + 1 / ((p : ℝ)^2 - 1)) := by rw [← prod_mul_distrib] exact prod_congr rfl (fun p hp => inverse_euler_factor_eq p (hP p hp).two_le) _ ≤ (∏ p ∈ P, (1 + 1 / (p : ℝ))) * 2 := by exact mul_le_mul_of_nonneg_left (euler_correction_product_le_two P (fun p hp => (hP p hp).two_le)) (prod_nonneg (fun p _ => by positivity)) _ = 2 * ∏ p ∈ P, (1 + 1 / (p : ℝ)) := by ring theorem finite_inverse_prime_euler_product_le_log (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {z : ℝ} (hz : 1 ≤ z) (hbound : ∀ p ∈ P, (p : ℝ) ≤ z) : (∏ p ∈ P, ((1 : ℝ) + 1 / ((p : ℝ) - 1))) ≤ (2 * primeEulerProductUpperConstant) * Real.log (2 * z) := by calc _ ≤ 2 * ∏ p ∈ P, (1 + 1 / (p : ℝ)) := finite_inverse_prime_euler_product_le_twice P hP _ ≤ 2 * (primeEulerProductUpperConstant * Real.log (2 * z)) := mul_le_mul_of_nonneg_left (finite_prime_euler_product_le_log P hP hz hbound) (by norm_num) _ = _ := by ring end section open Finset theorem totient_sieve_prime_product_not_coprime (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (n : ℕ) : ¬ Nat.Coprime (∏ p ∈ P, p) n ↔ ∃ p ∈ P, p ∣ n := by constructor · intro h by_contra hnot apply h apply Nat.coprime_prod_left_iff.mpr intro p hp apply (hP p hp).coprime_iff_not_dvd.mpr intro hd exact hnot ⟨p, hp, hd⟩ · rintro ⟨p, hp, hpn⟩ hc exact ((hP p hp).coprime_iff_not_dvd.mp ((Nat.coprime_prod_left_iff.mp hc) p hp)) hpn theorem totient_sieve_noncoprime_divisor_mass (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (n : ℕ) : (∑ d ∈ (∏ p ∈ P, p).divisors.filter (fun d => ¬ Nat.Coprime d n), 1 / (Nat.totient d : ℝ)) ≤ (∑ p ∈ P.filter (fun p => p ∣ n), 1 / ((p : ℝ) - 1)) * ∏ p ∈ P, (1 + 1 / ((p : ℝ) - 1)) := by classical calc _ = ∑ S ∈ P.powerset, if ¬ Nat.Coprime (∏ p ∈ S, p) n then 1 / (Nat.totient (∏ p ∈ S, p) : ℝ) else 0 := by rw [sum_filter, totient_sieve_sum_divisors_eq_subsets P hP] _ = ∑ S ∈ P.powerset.filter (fun S => ∃ p ∈ S, p ∣ n), ∏ p ∈ S, 1 / ((p : ℝ) - 1) := by rw [sum_filter] apply sum_congr rfl intro S hS have hSP : ∀ p ∈ S, p.Prime := fun p hp => hP p ((mem_powerset.mp hS) hp) simp only [totient_sieve_prime_product_not_coprime S hSP n, totient_sieve_prime_product_reciprocal S hSP] _ ≤ _ := by apply totient_sieve_subset_union_bound intro p hp have hple : (1 : ℝ) < p := by exact_mod_cast (hP p hp).one_lt positivity theorem totient_sieve_noncoprime_mass_of_subset (P M : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (hM : M ⊆ (∏ p ∈ P, p).divisors) (n : ℕ) : (∑ d ∈ M.filter (fun d => ¬ Nat.Coprime d n), 1 / (Nat.totient d : ℝ)) ≤ (∑ p ∈ P.filter (fun p => p ∣ n), 1 / ((p : ℝ) - 1)) * ∏ p ∈ P, (1 + 1 / ((p : ℝ) - 1)) := by apply le_trans _ (totient_sieve_noncoprime_divisor_mass P hP n) apply sum_le_sum_of_subset_of_nonneg (filter_subset_filter _ hM) intro d _ _ positivity section variable (P M : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (hMsq : ∀ d ∈ M, Squarefree d) (hMprime : ∀ d ∈ M, d.primeFactors ⊆ P) include P M hP hMsq hMprime theorem totient_sieve_squarefree_moduli_subset : M ⊆ (∏ p ∈ P, p).divisors := by have hp0 : (∏ p ∈ P, p) ≠ 0 := prod_ne_zero_iff.mpr (fun p hp => (hP p hp).ne_zero) intro d hd apply Nat.mem_divisors.mpr refine ⟨?_, hp0⟩ rw [← Nat.prod_primeFactors_of_squarefree (hMsq d hd)] exact prod_dvd_prod_of_subset d.primeFactors P (fun p => p) (hMprime d hd) theorem totient_sieve_squarefree_noncoprime_mass (n : ℕ) : (∑ d ∈ M.filter (fun d => ¬ Nat.Coprime d n), 1 / (Nat.totient d : ℝ)) ≤ (∑ p ∈ P.filter (fun p => p ∣ n), 1 / ((p : ℝ) - 1)) * ∏ p ∈ P, (1 + 1 / ((p : ℝ) - 1)) := totient_sieve_noncoprime_mass_of_subset P M hP (totient_sieve_squarefree_moduli_subset P M hP hMsq hMprime) n end end section open scoped BigOperators Classical theorem finite_pair_or_event_mass_le {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (hμmass : ∑ x, μ x = 1) (hνmass : ∑ y, ν y = 1) (A : X → Prop) (B : Y → Prop) [DecidablePred A] [DecidablePred B] : finitePairEventMass μ ν (fun x y => A x ∨ B y) ≤ (∑ x, if A x then μ x else 0) + ∑ y, if B y then ν y else 0 := by calc _ ≤ ∑ x, ∑ y, ((if A x then μ x else 0) * ν y + μ x * (if B y then ν y else 0)) := by apply Finset.sum_le_sum intro x _ apply Finset.sum_le_sum intro y _ by_cases ha : A x <;> by_cases hb : B y <;> simp [ha, hb, mul_nonneg (hμ x) (hν y)] _ = ((∑ x, if A x then μ x else 0) * ∑ y, ν y) + (∑ x, μ x) * ∑ y, if B y then ν y else 0 := by simp only [Finset.sum_add_distrib, Finset.sum_mul_sum] _ = _ := by rw [hμmass, hνmass, mul_one, one_mul] theorem finite_pair_discarded_mass_le {X Y D E : Type*} [Fintype X] [Fintype Y] [DecidableEq D] [DecidableEq E] (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (hμmass : ∑ x, μ x = 1) (hνmass : ∑ y, ν y = 1) (cellX : X → D) (cellY : Y → E) {ξ : ℝ} (hξ : 0 ≤ ξ) : finitePairEventMass μ ν (fun x y => cellX x ∉ finiteRetainedCells μ cellX ξ ∨ cellY y ∉ finiteRetainedCells ν cellY ξ) ≤ ((finiteOccupiedCells cellX).card + (finiteOccupiedCells cellY).card : ℝ) * ξ := by have h := finite_pair_or_event_mass_le μ ν hμ hν hμmass hνmass (fun x => cellX x ∉ finiteRetainedCells μ cellX ξ) (fun y => cellY y ∉ finiteRetainedCells ν cellY ξ) have hx := finite_discarded_cell_mass_le μ cellX hξ have hy := finite_discarded_cell_mass_le ν cellY hξ calc _ ≤ _ := h _ ≤ (finiteOccupiedCells cellX).card * ξ + (finiteOccupiedCells cellY).card * ξ := add_le_add hx hy _ = _ := by ring end section open Finset open scoped Classical noncomputable def globalBirthGhostParticleRow {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) [∀ p, NeZero (n p)] {N : ℕ} (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (H : Finset P) (old : Fin N → UnrestrictedResidueParticle n) (G : Finset P → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : ℂ := ∑ b ∈ range (cap + 1), ∑ S : Finset (Fin N), (((∏ j ∈ S, physicalGhostRetention n (1 - η) ρ (old j)) * ∏ j ∈ univ \ S, physicalGhostTermination n (1 - η) ρ (old j) : ℝ) : ℂ) * (∑ z : Fin b → UnrestrictedResidueParticle n, ((∏ j, physicalGhostBirth n (1 - η) ρ V (z j) * unrestrictedResidueWeight (fun p => β p / V) (z j) : ℝ) : ℂ) * (if Function.Injective (fun j => (z j).1) ∧ (∀ j, (z j).1 ∉ H) ∧ S.card + b ≤ cap then G (H ∪ univ.image (fun j => (z j).1)) (retainedBirthTuple old S z) else 0)) / (b.factorial : ℂ) theorem global_birth_ghost_visit_eq_particle_row {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) [∀ p, NeZero (n p)] {N : ℕ} (β : P → ℝ) (η V ρ : ℝ) (cap : ℕ) (H : Finset P) (old : Fin N → UnrestrictedResidueParticle n) (G : Finset P → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : globalBirthGhostVisitRawRow (fun _ => 0) β η V ρ cap H old G = globalBirthGhostParticleRow n β η V ρ cap H old G := by rw [global_birth_ghost_visit_cap_range] unfold globalBirthGhostVisitCapRow globalBirthGhostParticleRow rw [sum_comm] apply sum_congr rfl intro b _ let F : Finset (Fin N) → ℂ := fun S => ∑ f : Fin b → P, (((-η * V / ρ) ^ b * (∏ j, β (f j) / V) : ℝ) : ℂ) * (if Function.Injective f ∧ (∀ j, f j ∉ H) ∧ S.card + b ≤ cap then G (H ∪ univ.image f) (retainedBirthTuple old S (fun j => ⟨f j, 0⟩)) else 0) calc _ = (∑ T ∈ (globalBirthVisitZeroIndices (fun _ => 0) old).powerset, (((-η / ρ) ^ T.card * ((1 - η) / ρ ^ 2) ^ (globalBirthVisitZeroIndices (fun _ => 0) old \ T).card : ℝ) : ℂ) * F (univ \ T)) / (b.factorial : ℂ) := by rw [sum_div] apply sum_congr rfl intro T _ dsimp only [F] rw [mul_sum, sum_div] apply sum_congr rfl intro f _ split_ifs · push_cast ring · simp only [mul_zero, zero_div] _ = (∑ S : Finset (Fin N), (((∏ j ∈ S, physicalGhostRetention n (1 - η) ρ (old j)) * ∏ j ∈ univ \ S, physicalGhostTermination n (1 - η) ρ (old j) : ℝ) : ℂ) * F S) / (b.factorial : ℂ) := by rw [physical_ghost_old_event_sum] _ = _ := by rw [sum_div] apply sum_congr rfl intro S _ apply congrArg (fun z : ℂ => (((∏ j ∈ S, physicalGhostRetention n (1 - η) ρ (old j)) * ∏ j ∈ univ \ S, physicalGhostTermination n (1 - η) ρ (old j) : ℝ) : ℂ) * z / (b.factorial : ℂ)) exact physical_ghost_birth_tuple_sum n β η V ρ b (fun z => if Function.Injective (fun j => (z j).1) ∧ (∀ j, (z j).1 ∉ H) ∧ S.card + b ≤ cap then G (H ∪ univ.image (fun j => (z j).1)) (retainedBirthTuple old S z) else 0) end section open Finset Classical section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end end section open scoped BigOperators Classical section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {I X : G → Type*} [sharedInstance4 : ∀ g, Fintype (I g)] [sharedInstance5 : ∀ g, DecidableEq (I g)] [sharedInstance6 : ∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (hμ : ∀ g x, 0 ≤ μ g x) (hmass : ∀ g, ∑ x, μ g x = 1) (A B : ∀ g, Finset (I g)) (hAB : ∀ g, Disjoint (A g) (B g)) include G sharedInstance1 sharedInstance2 I X sharedInstance4 sharedInstance5 sharedInstance6 μ hμ hmass A B hAB theorem finite_symmetric_probe_tensor_energy (hm : ∀ g, 0 < (A g).card) (s : Finset G) (f : (∀ g, I g → X g) → ℂ) (hf : ∀ g, finiteGroupSlotSymmetric g f) : finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) (finiteCoordinateFinsetAction (fun (g : G) (v : (I g → X g) → ℂ) => finiteCoordinateComponent (fun _ : I g => μ g) (A g) (A g ∪ B g).toList v) s f) ≤ (∏ g ∈ s, (((B g).card : ℝ) ^ (B g).card / ((A g).card : ℝ) ^ (B g).card)) * finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f := by have h := finite_projected_probe_tensor_energy μ hμ hmass A B hAB hm s f unfold finiteCoordinateFinsetAction at h ⊢ rw [finite_group_symmetrized_compose_eq (I := I) (X := X) (fun (g : G) (v : (I g → X g) → ℂ) => finiteCoordinateComponent (fun _ : I g => μ g) (A g) (A g ∪ B g).toList v) s.toList (Finset.nodup_toList s) f hf] at h exact h theorem finite_symmetric_probe_tensor_uniform (m ell : ℕ) (hm : 0 < m) (hA : ∀ g, (A g).card = m) (hB : ∀ g, (B g).card = ell) (s : Finset G) (f : (∀ g, I g → X g) → ℂ) (hf : ∀ g, finiteGroupSlotSymmetric g f) : finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) (finiteCoordinateFinsetAction (fun (g : G) (v : (I g → X g) → ℂ) => finiteCoordinateComponent (fun _ : I g => μ g) (A g) (A g ∪ B g).toList v) s f) ≤ (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ s.card) * finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f := by simpa only [hA, hB, Finset.prod_const] using finite_symmetric_probe_tensor_energy μ hμ hmass A B hAB (fun g => (hA g).symm ▸ hm) s f hf end end section open Finset Classical theorem fullActivePermutation_mul {G : Type*} {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (σ τ : FullActiveSlotPermutations M) (x : ProductBoundedOrderedState P Z M B) : fullActivePermutation σ (fullActivePermutation τ x) = fullActivePermutation (τ * σ) x := rfl theorem fullActiveAverage_invariant {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z M B → ℂ) (τ : FullActiveSlotPermutations M) (x : ProductBoundedOrderedState P Z M B) : fullActiveAverage f (fullActivePermutation τ x) = fullActiveAverage f x := by simp only [fullActiveAverage, fullActivePermutation_mul, fullActivePermutationWeight] exact Equiv.sum_comp (Equiv.mulLeft τ) (fun σ => (((Fintype.card (FullActiveSlotPermutations M) : ℝ)⁻¹ : ℝ) : ℂ) * f (fullActivePermutation σ x)) end section open Finset open scoped Classical noncomputable def globalBirthBoundedEdgePhase {P : Type*} [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (target : Fin t → P) (H : Finset P) : UnrestrictedBoundedPhase n Δ D t B := fun s _stores promotions e fresh => if unrestrictedEdgeTarget s.2.2 Sigma.fst promotions e fresh = target ∧ (∀ i, fresh i ∉ H) then 1 else 0 theorem global_birth_bounded_edge_phase_norm_le {P : Type*} [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (target : Fin t → P) (H : Finset P) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (stores promotions : Finset (Fin t)) (e : promotions ↪ unrestrictedResidueEligible n Δ D s.2.2) (fresh : UnrestrictedFreshLabels P promotions) : ‖globalBirthBoundedEdgePhase n Δ D t B target H s stores promotions e fresh‖ ≤ 1 := by unfold globalBirthBoundedEdgePhase split_ifs <;> norm_num theorem global_birth_edge_raw_row_bounded_events {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (source target : Fin t ↪ P) (hsource : ∀ i, ¬ (n (source i) : ℤ) ∣ D) (htarget : ∀ i, ¬ (n (target i) : ℤ) ∣ D) (H : Finset P) (q : BoundedOrderedTuple (UnrestrictedResidueParticle n) B) (β : P → ℝ) (ρ V : ℝ) (F : Finset P → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : globalBirthEdgeRawRow source target (fun p => (Δ : ZMod (n p))) H q.2 (globalBirthRawHitIndices (fun p => (Δ : ZMod (n p))) (boundedOrderedTupleToFinite q)) β ρ V B F = ∑ e : UnrestrictedBoundedEvent n Δ D t B (source, q), (unrestrictedBoundedEventWeight n Δ D (fun p => β p / V) ρ V t B (source, q) e : ℂ) * globalBirthBoundedEdgePhase n Δ D t B target H (source, q) e.1 e.2.1 e.2.2.1 e.2.2.2 * F (H ∪ univ.image (unrestrictedBoundedEventTarget n Δ D t B (source, q) e).1) (boundedOrderedTupleToFinite (unrestrictedBoundedEventTarget n Δ D t B (source, q) e).2) := by refine (global_birth_edge_raw_row_eq_residue_action n Δ D source target hsource htarget H q.2 β ρ V B F).trans ?_ exact unrestricted_residue_action_raw_event_sum n Δ D (fun p => β p / V) ρ V t B (globalBirthBoundedEdgePhase n Δ D t B target H) (fun target' q' => F (H ∪ univ.image target') q') (source, q) end section open Finset theorem exists_rough_interval_count_bound : ∃ K : ℝ, 0 < K ∧ ∀ (P : Finset ℕ) (A B : ℕ) {z : ℝ} {h : ℕ}, 1 < z → A ≤ B → 1 ≤ h → Even h → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, (p : ℝ) ≤ z) → |(((Ioc A B).filter (fun n => ∀ p ∈ P, ¬p ∣ n)).card : ℝ) - ((B : ℝ) - A) * (∏ p ∈ P, (1 - 1 / (p : ℝ)))| ≤ ((B : ℝ) - A) * (∏ p ∈ P, (1 - 1 / (p : ℝ))) * K * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2) := by obtain ⟨K, hK, hsieve⟩ := exists_reciprocal_prime_sieve_events refine ⟨K, hK, ?_⟩ intro P A B z h hz hAB hh heven hP hPz have hX : 0 ≤ (B : ℝ) - A := sub_nonneg.mpr (Nat.cast_le.mpr hAB) have hcount := hsieve P (Ioc A B) (fun _ => 1) (fun n p => p ∣ n) (intervalDivisibilityRemainder A B) hz hX hh heven hP hPz (by intros; norm_num) (fun S hS => interval_prime_intersection_moment P hP A B S (mem_powerset.mp hS)) have hrem := interval_divisibility_remainder_sum_le P hP A B hAB (z^(4 * (h : ℝ) + 2)) (Real.rpow_nonneg (zero_lt_one.trans hz).le _) have hresult := hcount.trans (add_le_add le_rfl hrem) simpa only [sum_const, nsmul_eq_mul, mul_one] using hresult end section open Finset noncomputable def natSieveCoefficient (P : Finset ℕ) (D : ℝ) (a : Finset ℕ → ℝ) (d : ℕ) : ℝ := if d ∈ blockSieveModuli P D then a d.primeFactors else 0 theorem block_sieve_modulus_primeFactors_subset (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (D : ℝ) {d : ℕ} (hd : d ∈ blockSieveModuli P D) : d.primeFactors ⊆ P := by have hm := block_sieve_modulus_properties P hP D hd have hp0 : (∏ p ∈ P, p) ≠ 0 := prod_ne_zero_iff.mpr (fun p hp => (hP p hp).ne_zero) simpa only [Nat.primeFactors_prod hP] using Nat.primeFactors_mono hm.2.2.2 hp0 theorem nat_sieve_coefficient_abs_le_one (P : Finset ℕ) (D : ℝ) (a : Finset ℕ → ℝ) (hP : ∀ p ∈ P, p.Prime) (ha : ∀ S ∈ P.powerset, |a S| ≤ 1) (d : ℕ) : |natSieveCoefficient P D a d| ≤ 1 := by unfold natSieveCoefficient split_ifs with hd · exact ha _ (mem_powerset.mpr (block_sieve_modulus_primeFactors_subset P hP D hd)) · norm_num theorem nat_sieve_coefficient_support (P : Finset ℕ) (D : ℝ) (a : Finset ℕ → ℝ) (hP : ∀ p ∈ P, p.Prime) {d : ℕ} (hd : natSieveCoefficient P D a d ≠ 0) : 0 < d ∧ (d : ℝ) ≤ D ∧ Squarefree d ∧ d ∣ ∏ p ∈ P, p := by have hm : d ∈ blockSieveModuli P D := by by_contra hm exact hd (by simp [natSieveCoefficient, hm]) exact block_sieve_modulus_properties P hP D hm theorem block_sieve_moduli_eq_subset_products (P : Finset ℕ) (D : ℝ) (hP : ∀ p ∈ P, p.Prime) : blockSieveModuli P D = (P.powerset.filter (fun S => ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D)).image (fun S => ∏ p ∈ S, p) := by ext d constructor · intro hd have hm := block_sieve_modulus_properties P hP D hd have heq := Nat.prod_primeFactors_of_squarefree hm.2.2.1 refine mem_image.mpr ⟨d.primeFactors, mem_filter.mpr ⟨?_, ?_⟩, heq⟩ · exact mem_powerset.mpr (block_sieve_modulus_primeFactors_subset P hP D hd) · simpa only [heq] using hm.2.1 · intro hd obtain ⟨S, hS, rfl⟩ := mem_image.mp hd obtain ⟨hS, hD⟩ := mem_filter.mp hS have hSP : S ⊆ P := mem_powerset.mp hS apply mem_filter.mpr refine ⟨mem_Icc.mpr ⟨?_, Nat.le_floor hD⟩, ?_⟩ · exact prod_pos (fun p hp => (hP p (hSP hp)).pos) · exact prod_dvd_prod_of_subset S P (fun p => p) hSP section variable (P : Finset ℕ) (D : ℝ) (a : Finset ℕ → ℝ) (hP : ∀ p ∈ P, p.Prime) include P D a hP theorem nat_sieve_coefficient_sum (hlevel : ∀ S ∈ P.powerset, a S ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D) (F : ℕ → ℝ) : (∑ S ∈ P.powerset, a S * F (∏ p ∈ S, p)) = ∑ d ∈ blockSieveModuli P D, natSieveCoefficient P D a d * F d := by let L := P.powerset.filter (fun S => ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D) have hLP : L ⊆ P.powerset := filter_subset _ _ have himage : blockSieveModuli P D = L.image (fun S => ∏ p ∈ S, p) := block_sieve_moduli_eq_subset_products P D hP have hinj : Set.InjOn (fun S : Finset ℕ => ∏ p ∈ S, p) L := by intro S hS T hT heq have hs : (∏ p ∈ S, p).primeFactors = S := Nat.primeFactors_prod (fun p hp => hP p ((mem_powerset.mp (hLP hS)) hp)) have ht : (∏ p ∈ T, p).primeFactors = T := Nat.primeFactors_prod (fun p hp => hP p ((mem_powerset.mp (hLP hT)) hp)) rw [← hs, ← ht] exact congrArg Nat.primeFactors heq have hcoef : ∀ S ∈ L, natSieveCoefficient P D a (∏ p ∈ S, p) = a S := by intro S hS have hm : (∏ p ∈ S, p) ∈ blockSieveModuli P D := by rw [himage] exact mem_image.mpr ⟨S, hS, rfl⟩ have hpf : (∏ p ∈ S, p).primeFactors = S := Nat.primeFactors_prod (fun p hp => hP p ((mem_powerset.mp (hLP hS)) hp)) simp only [natSieveCoefficient, if_pos hm, hpf] symm calc _ = ∑ S ∈ L, natSieveCoefficient P D a (∏ p ∈ S, p) * F (∏ p ∈ S, p) := by rw [himage, sum_image hinj] _ = ∑ S ∈ L, a S * F (∏ p ∈ S, p) := sum_congr rfl (fun S hS => by rw [hcoef S hS]) _ = _ := by apply sum_subset hLP intro S hS hn have hz : a S = 0 := by by_contra hz exact hn (mem_filter.mpr ⟨hS, hlevel S hS hz⟩) rw [hz, zero_mul] theorem nat_sieve_coefficient_harmonic_bound (ha : ∀ S ∈ P.powerset, |a S| ≤ 1) (hlevel : ∀ S ∈ P.powerset, a S ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D) : (∑ d ∈ blockSieveModuli P D, |natSieveCoefficient P D a d| / (d : ℝ)) ≤ ∏ p ∈ P, (1 + 1 / (p : ℝ)) := by have hlevel' : ∀ S ∈ P.powerset, |a S| ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D := by intro S hS hz exact hlevel S hS (abs_ne_zero.mp hz) calc _ = ∑ d ∈ blockSieveModuli P D, natSieveCoefficient P D (fun S => |a S|) d * (1 / (d : ℝ)) := by apply sum_congr rfl intro d hd simp only [natSieveCoefficient, if_pos hd] ring _ = ∑ S ∈ P.powerset, |a S| * (1 / ((∏ p ∈ S, p : ℕ) : ℝ)) := (nat_sieve_coefficient_sum P D (fun S => |a S|) hP hlevel' (fun d => 1 / (d : ℝ))).symm _ ≤ ∑ S ∈ P.powerset, 1 / ((∏ p ∈ S, p : ℕ) : ℝ) := by apply sum_le_sum intro S hS exact mul_le_of_le_one_left (by positivity) (ha S hS) _ = ∑ S ∈ P.powerset, ∏ p ∈ S, 1 / (p : ℝ) := by apply sum_congr rfl intro S _ simp only [Nat.cast_prod, one_div, prod_inv_distrib] _ = _ := (prod_one_add P).symm theorem nat_sieve_polynomial_eq_divisor_sum (hlevel : ∀ S ∈ P.powerset, a S ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D) (n : ℕ) : subsetPolynomial P a (fun p => if p ∣ n then 1 else 0) = ∑ d ∈ blockSieveModuli P D, if d ∣ n then natSieveCoefficient P D a d else 0 := by calc _ = ∑ S ∈ P.powerset, a S * (if (∏ p ∈ S, p) ∣ n then 1 else 0) := by apply sum_congr rfl intro S hS rw [finite_bad_event_indicator_product] simp only [prime_subset_product_dvd_iff S (fun p hp => hP p ((mem_powerset.mp hS) hp)) n] _ = ∑ d ∈ blockSieveModuli P D, natSieveCoefficient P D a d * (if d ∣ n then 1 else 0) := nat_sieve_coefficient_sum P D a hP hlevel (fun d => if d ∣ n then 1 else 0) _ = _ := by apply sum_congr rfl intro d _ split_ifs <;> simp theorem nat_sieve_polynomial_eq_sum_divisors (hlevel : ∀ S ∈ P.powerset, a S ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D) {n : ℕ} (hn : n ≠ 0) : subsetPolynomial P a (fun p => if p ∣ n then 1 else 0) = ∑ d ∈ n.divisors, natSieveCoefficient P D a d := by rw [nat_sieve_polynomial_eq_divisor_sum P D a hP hlevel n, ← sum_filter] apply sum_subset · intro d hd exact Nat.mem_divisors.mpr ⟨(mem_filter.mp hd).2, hn⟩ · intro d hd hnot have hm : d ∉ blockSieveModuli P D := by intro hm exact hnot (mem_filter.mpr ⟨hm, Nat.dvd_of_mem_divisors hd⟩) simp only [natSieveCoefficient, if_neg hm] end end section open Finset noncomputable def roughBlockUpper (J : Finset ℕ) (B : ℕ → Finset ℕ) (h n : ℕ) : ℝ := blockSieveUpper J B (fun p => if p ∣ n then 1 else 0) (fun j => (j + 1) * h) theorem interval_block_sieve_overcount (J : Finset ℕ) (P : ℕ → Finset ℕ) (A B : ℕ) {z C : ℝ} {h : ℕ} (hz : 1 < z) (hC : 0 ≤ C) (hAB : A ≤ B) (hh : 1 ≤ h) (heven : Even h) (hdisj : (J : Set ℕ).PairwiseDisjoint P) (hprime : ∀ j ∈ J, ∀ p ∈ P j, p.Prime) (hsize : ∀ j ∈ J, ∀ p ∈ P j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) (hsum : ∀ j ∈ J, (∑ p ∈ P j, 1 / (p : ℝ)) ≤ C) : let M := (∑ n ∈ Ioc A B, roughBlockUpper J P h n) - (((Ioc A B).filter (fun n => ∀ p ∈ J.biUnion P, ¬p ∣ n)).card : ℝ) 0 ≤ M ∧ M ≤ ((B : ℝ) - A) * blockSieveModelErrorConstant C (1/2) * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2) := by have hX : 0 ≤ (B : ℝ) - A := sub_nonneg.mpr (Nat.cast_le.mpr hAB) have hP : ∀ p ∈ J.biUnion P, p.Prime := by intro p hp obtain ⟨j, hj, hp⟩ := mem_biUnion.mp hp exact hprime j hj p hp have hg : ∀ j ∈ J, ∀ p ∈ P j, 0 ≤ 1 / (p : ℝ) ∧ 1 / (p : ℝ) ≤ 1 - (1/2 : ℝ) := by intro j hj p hp have hp2 : (2 : ℝ) ≤ p := Nat.cast_le.mpr (hprime j hj p hp).two_le refine ⟨by positivity, ?_⟩ have hd := one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 2) hp2 norm_num at hd ⊢ exact hd have hresult := finite_block_sieve_event_overcount J P (Ioc A B) (fun _ => 1) (fun n p => p ∣ n) (fun p => 1 / (p : ℝ)) (intervalDivisibilityRemainder A B) hz.le hX hC (by norm_num) hh heven hdisj hprime hsize (by intros; norm_num) hg hsum (fun S hS => interval_prime_intersection_moment (J.biUnion P) hP A B S (mem_powerset.mp hS)) dsimp only at hresult ⊢ simp only [one_mul, sum_const, nsmul_eq_mul, mul_one] at hresult have hproduct : (∏ p ∈ J.biUnion P, (1 - 1 / (p : ℝ))) ≤ 1 := by apply prod_le_one₀ · intro p hp have hp1 : (1 : ℝ) ≤ p := by exact_mod_cast (hP p hp).one_lt.le apply sub_nonneg.mpr simpa only [div_one] using one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 1) hp1 · intro p _ exact sub_le_self 1 (by positivity) have hmain : ((B : ℝ) - A) * (∏ p ∈ J.biUnion P, (1 - 1 / (p : ℝ))) * blockSieveModelErrorConstant C (1/2) * Real.exp (-(h : ℝ)) ≤ ((B : ℝ) - A) * blockSieveModelErrorConstant C (1/2) * Real.exp (-(h : ℝ)) := by apply mul_le_mul_of_nonneg_right _ (Real.exp_pos _).le apply mul_le_mul_of_nonneg_right _ (block_sieve_model_error_constant_pos C (1/2)).le exact mul_le_of_le_one_right hX hproduct have hrem := interval_divisibility_remainder_sum_le (J.biUnion P) hP A B hAB (z^(4 * (h : ℝ) + 2)) (Real.rpow_nonneg (zero_lt_one.trans hz).le _) exact ⟨hresult.1, hresult.2.trans (add_le_add hmain hrem)⟩ theorem exists_rough_interval_sieve_blocks : ∃ K : ℝ, 0 < K ∧ ∀ (P : Finset ℕ) {z : ℝ}, 1 < z → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, (p : ℝ) ≤ z) → ∃ (J : Finset ℕ) (B : ℕ → Finset ℕ), J.biUnion B = P ∧ (J : Set ℕ).PairwiseDisjoint B ∧ (∀ j ∈ J, ∀ p ∈ B j, Real.log (p : ℝ) ≤ Real.log z / (2 : ℝ)^j) ∧ ∀ h : ℕ, 1 ≤ h → Even h → (∀ n : ℕ, 0 ≤ roughBlockUpper J B h n ∧ (if ∀ p ∈ P, ¬p ∣ n then (1 : ℝ) else 0) ≤ roughBlockUpper J B h n) ∧ (∀ a b : ℕ, a ≤ b → let M := (∑ n ∈ Ioc a b, roughBlockUpper J B h n) - (((Ioc a b).filter (fun n => ∀ p ∈ P, ¬p ∣ n)).card : ℝ) 0 ≤ M ∧ M ≤ ((b : ℝ) - a) * K * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2)) := by obtain ⟨C, hC, hshell⟩ := exists_finite_prime_reciprocal_shell_bound refine ⟨blockSieveModelErrorConstant C (1/2), block_sieve_model_error_constant_pos C (1/2), ?_⟩ intro P z hz hP hPz obtain ⟨J, B, hunion, hdisj, hsub, hband⟩ := exists_dyadic_sieve_blocks_log P hP hPz refine ⟨J, B, hunion, hdisj, fun j hj p hp => (hband j hj p hp).2, ?_⟩ intro h hh heven constructor · intro n have hw : ∀ j ∈ J, ∀ p ∈ B j, 0 ≤ (if p ∣ n then (1 : ℝ) else 0) ∧ (if p ∣ n then (1 : ℝ) else 0) ≤ 1 := by intros split_ifs <;> norm_num have hc : ∀ j ∈ J, Even ((j + 1) * h) := fun j _ => heven.mul_left (j + 1) refine ⟨block_sieve_upper_nonneg J B _ _ hw hc, ?_⟩ have hs := (block_sieve_sandwich J B _ _ hw hc).2 rw [← prod_biUnion hdisj, hunion, finite_bad_event_avoidance_product] at hs exact hs · intro a b hab have hm := interval_block_sieve_overcount J B a b hz hC hab hh heven hdisj (fun j _ p hp => hP p (hsub j hp)) (fun j hj p hp => (hband j hj p hp).2) (by intro j hj exact dyadic_sieve_block_mass P (B j) (fun p => 1 / (p : ℝ)) hz j hP (by intros; positivity) (hsub j) (fun p hp => (hband j hj p hp).1) (fun p hp => (hband j hj p hp).2) (hshell P hP)) simpa only [hunion] using hm end section open scoped BigOperators Classical theorem prime_product_ideal_character_reproduction (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → p.Prime ∧ Q < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h ξ : ℝ, 0 < h → 0 < ξ → ∀ kept : Finset ℤ, (∀ d ∈ kept, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) → ∀ (t : BoundedPrimitiveCharacter Q) (y : ∀ j, P j), upperLogCell h (Real.log (∏ j, (y j).val : ℕ)) ∈ kept → ‖(∑ x, (finiteProductWeight (physicalLabelLaw V) x : ℂ) * primeProductIdealKernel P V Q h kept x y * boundedPrimitiveValue t ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus t))) - boundedPrimitiveValue t ((∏ j, (y j).val : ℕ) : ZMod (boundedPrimitiveModulus t))‖ ≤ (Q * Q : ℕ) * (((C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) := by obtain ⟨C, hC, hbnd⟩ := prime_family_log_cell_gram hZ refine ⟨C, hC, ?_⟩ intro Q hQ I _ _ P V i hV hp hmass a b hPi ha hb h ξ hh hξ kept hkept t y hy let ψ : BoundedPrimitiveCharacter Q → (∀ j, P j) → ℂ := fun s x => star (boundedPrimitiveValue s ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus s))) let δ := (C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a) have hVi := hV i have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hQ1 : (1 : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Nat.mul_ne_zero (Nat.ne_of_gt hQ) (Nat.ne_of_gt hQ)) have hδ : 0 ≤ δ := by have := Real.log_nonneg hQ1 dsimp only [δ] positivity have hunit : ∀ s x, finiteProductWeight (physicalLabelLaw (P := P) V) x ≠ 0 → ‖ψ s x‖ = 1 := by intro s x _ rw [show ψ s x = star (boundedPrimitiveValue s ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus s))) from rfl, norm_star] exact prime_tuple_character_norm_one P (boundedPrimitiveValue s) (fun j p hj => prime_above_modulus_coprime (hp j p hj).1 (bounded_primitive_modulus_pos s) (bounded_primitive_modulus_le s) (hp j p hj).2) x have hraw : ∀ d ∈ kept, ∀ s u, s ≠ u → ‖∑ x : (∀ j, P j), if upperLogCell h (Real.log (∏ j, (x j).val : ℕ)) = d then (finiteProductWeight (physicalLabelLaw V) x : ℂ) * (starRingEnd ℂ) (ψ s x) * ψ u x else 0‖ ≤ δ := by intro d _ s u hsu simpa only [ψ, starRingEnd_apply, star_star] using hbnd Q hQ P V i hV (fun j p hj => (hp j p hj).1.pos) hmass a b hPi ha hb h hh d s u hsu have hrec := finite_cell_character_reproduction (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) kept ψ hunit hδ hξ hkept hraw t y hy (fun s => by dsimp only [ψ] rw [norm_star] exact (boundedPrimitiveValue s).norm_le_one _) have hc : ((Fintype.card (BoundedPrimitiveCharacter Q) - 1 : ℕ) : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast (Nat.sub_le (Fintype.card (BoundedPrimitiveCharacter Q)) 1).trans (bounded_primitive_character_card_le Q) have hout := hrec.trans (mul_le_mul_of_nonneg_right hc (div_nonneg hδ hξ.le)) simpa only [primeProductIdealKernel, ψ, starRingEnd_apply, star_star, δ] using hout end section open scoped BigOperators Classical noncomputable def primeProductRetainedCells {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (h ξ : ℝ) : Finset ℤ := finiteRetainedCells (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) ξ theorem prime_product_retained_cell_mass {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (h ξ : ℝ) {d : ℤ} (hd : d ∈ primeProductRetainedCells P V h ξ) : ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d := finite_retained_cell_mass _ _ _ hd end section open Finset theorem totient_sieve_interval_squarefree_prime_support (N : ℕ) : ∀ d ∈ (Icc 1 N).filter Squarefree, d.primeFactors ⊆ (Icc 1 N).filter Nat.Prime := by intro d hd p hp have hpri := Nat.prime_of_mem_primeFactors hp exact mem_filter.mpr ⟨mem_Icc.mpr ⟨hpri.one_le, (Nat.le_of_mem_primeFactors hp).trans (mem_Icc.mp (mem_filter.mp hd).1).2⟩, hpri⟩ theorem totient_sieve_interval_noncoprime_mass (N n : ℕ) (hn : n ≠ 0) : (∑ d ∈ (Icc 1 N).filter (fun d => Squarefree d ∧ ¬ Nat.Coprime d n), 1 / (Nat.totient d : ℝ)) ≤ (∑ p ∈ n.primeFactors.filter (fun p => p ≤ N), 1 / ((p : ℝ) - 1)) * ∏ p ∈ (Icc 1 N).filter Nat.Prime, (1 + 1 / ((p : ℝ) - 1)) := by have hprime : ∀ p ∈ (Icc 1 N).filter Nat.Prime, p.Prime := fun p hp => (mem_filter.mp hp).2 have hf : ((Icc 1 N).filter Nat.Prime).filter (fun p => p ∣ n) = n.primeFactors.filter (fun p => p ≤ N) := by ext p simp only [mem_filter, mem_Icc, Nat.mem_primeFactors, hn, ne_eq, not_false_eq_true, and_true] constructor · rintro ⟨⟨⟨_, hpN⟩, hp⟩, hpn⟩ exact ⟨⟨hp, hpn⟩, hpN⟩ · rintro ⟨⟨hp, hpn⟩, hpN⟩ exact ⟨⟨⟨hp.one_le, hpN⟩, hp⟩, hpn⟩ have hb := totient_sieve_squarefree_noncoprime_mass ((Icc 1 N).filter Nat.Prime) ((Icc 1 N).filter Squarefree) hprime (fun d hd => (mem_filter.mp hd).2) (totient_sieve_interval_squarefree_prime_support N) n simpa only [filter_filter, hf] using hb end section open Finset open scoped Classical def globalBirthGhostEventFresh {P : Type*} (n : P → ℕ) (H : Finset P) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : BoundedGhostEvent t B s) : Prop := Function.Injective (fun j => (e.2.2 j).1) ∧ ∀ j, (e.2.2 j).1 ∉ H theorem global_birth_visit_eq_bounded_ghost_ledger_sum {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) [∀ p, NeZero (n p)] (β : P → ℝ) (η V ρ : ℝ) (H : Finset P) (t B : ℕ) (F : Finset P → BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : globalBirthGhostVisitRawRow (fun _ => 0) β η V ρ B H s.2.2 (fun H' q => boundedOrderedZeroExtension (F H') s.1 q) = ∑ e : BoundedGhostEvent t B s, (boundedGhostEventWeight (physicalGhostRetention n (1 - η) ρ) (physicalGhostTermination n (1 - η) ρ) (physicalGhostBirth n (1 - η) ρ V) (unrestrictedResidueWeight (fun p => β p / V)) t B s e : ℂ) * (if globalBirthGhostEventFresh n H t B s e then 1 else 0) * F (H ∪ univ.image (fun j => (e.2.2 j).1)) (boundedGhostEventTarget t B s e) := by rw [global_birth_ghost_visit_eq_particle_row] unfold globalBirthGhostParticleRow rw [Fintype.sum_sigma] simp only [Fintype.sum_prod_type] rw [← Fin.sum_univ_eq_sum_range] apply sum_congr rfl intro b _ apply sum_congr rfl intro S _ rw [mul_sum, sum_div] apply sum_congr rfl intro z _ by_cases hc : S.card + b.val ≤ B · by_cases hf : globalBirthGhostEventFresh n H t B s ⟨b, S, z⟩ · have ha : Function.Injective (fun j => (z j).1) ∧ (∀ j, (z j).1 ∉ H) ∧ S.card + b.val ≤ B := ⟨hf.1, hf.2, hc⟩ rw [if_pos ha, if_pos hf, mul_one] have hq : (retainedBirthTuple s.2.2 S z).1 ≤ B := hc rw [boundedOrderedZeroExtension_of_le _ _ _ hq] simp only [boundedGhostEventWeight, if_pos hc, boundedGhostEventTarget, dif_pos hq] push_cast ring · have ha : ¬ (Function.Injective (fun j => (z j).1) ∧ (∀ j, (z j).1 ∉ H) ∧ S.card + b.val ≤ B) := fun h => hf ⟨h.1, h.2.1⟩ rw [if_neg ha, if_neg hf, mul_zero, mul_zero, zero_div, mul_zero, zero_mul] · have ha : ¬ (Function.Injective (fun j => (z j).1) ∧ (∀ j, (z j).1 ∉ H) ∧ S.card + b.val ≤ B) := fun h => hc h.2.2 rw [if_neg ha, mul_zero, mul_zero, zero_div] simp only [boundedGhostEventWeight, if_neg hc, Complex.ofReal_zero, zero_mul] end section open Finset open scoped Classical section ResiduePath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations G J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (B : ℕ) end ResiduePath end section open Finset theorem exists_rough_sieve_divisor_weights : ∃ K : ℝ, 0 < K ∧ ∀ (P : Finset ℕ) {z : ℝ}, 1 < z → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, (p : ℝ) ≤ z) → ∀ h : ℕ, 1 ≤ h → Even h → ∃ lam : ℕ → ℝ, (∀ d, |lam d| ≤ 1) ∧ (∀ d, lam d ≠ 0 → 0 < d ∧ (d : ℝ) ≤ z^(4 * (h : ℝ) + 2) ∧ Squarefree d ∧ d ∣ ∏ p ∈ P, p) ∧ (∀ n : ℕ, n ≠ 0 → 0 ≤ ∑ d ∈ n.divisors, lam d ∧ (if ∀ p ∈ P, ¬p ∣ n then (1 : ℝ) else 0) ≤ ∑ d ∈ n.divisors, lam d) ∧ (∑ d ∈ blockSieveModuli P (z^(4 * (h : ℝ) + 2)), |lam d| / (d : ℝ)) ≤ ∏ p ∈ P, (1 + 1 / (p : ℝ)) ∧ ∀ a b : ℕ, a ≤ b → let M := (∑ n ∈ Ioc a b, ∑ d ∈ n.divisors, lam d) - (((Ioc a b).filter (fun n => ∀ p ∈ P, ¬p ∣ n)).card : ℝ) 0 ≤ M ∧ M ≤ ((b : ℝ) - a) * K * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2) := by obtain ⟨K, hK, hblocks⟩ := exists_rough_interval_sieve_blocks refine ⟨K, hK, ?_⟩ intro P z hz hP hPz h hh heven obtain ⟨J, B, hunion, hdisj, hsize, hcontrol⟩ := hblocks P hz hP hPz let cap := fun j => (j + 1) * h let a := blockSieveSubsetUpperCoefficient J B cap let D := z^(4 * (h : ℝ) + 2) let lam := natSieveCoefficient P D a have ha : ∀ S ∈ P.powerset, |a S| ≤ 1 := fun S _ => abs_block_sieve_subset_upper_coefficient_le_one J B cap S have hlevel : ∀ S ∈ P.powerset, a S ≠ 0 → ((∏ p ∈ S, p : ℕ) : ℝ) ≤ D := by intro S _ hS have hprime : ∀ j ∈ J, ∀ p ∈ B j, p.Prime := by intro j hj p hp apply hP p rw [← hunion] exact mem_biUnion.mpr ⟨j, hj, hp⟩ simpa only [Nat.cast_prod] using (block_sieve_upper_coefficient_level J B S h hz.le hdisj hprime hsize hS).2 have heq (n : ℕ) (hn : n ≠ 0) : roughBlockUpper J B h n = ∑ d ∈ n.divisors, lam d := by have hexp := block_sieve_upper_expansion J B (fun p => if p ∣ n then (1 : ℝ) else 0) cap hdisj rw [hunion] at hexp exact hexp.trans (nat_sieve_polynomial_eq_sum_divisors P D a hP hlevel hn) have hpoint := (hcontrol h hh heven).1 have hover := (hcontrol h hh heven).2 refine ⟨lam, fun d => nat_sieve_coefficient_abs_le_one P D a hP ha d, fun d hd => nat_sieve_coefficient_support P D a hP hd, ?_, nat_sieve_coefficient_harmonic_bound P D a hP ha hlevel, ?_⟩ · intro n hn simpa only [heq n hn] using hpoint n · intro a b hab have hsum : (∑ n ∈ Ioc a b, roughBlockUpper J B h n) = ∑ n ∈ Ioc a b, ∑ d ∈ n.divisors, lam d := by apply sum_congr rfl intro n hn exact heq n (Nat.ne_of_gt (lt_of_le_of_lt (Nat.zero_le a) (mem_Ioc.mp hn).1)) have hm := hover a b hab dsimp only at hm ⊢ rwa [hsum] at hm end section open Finset open scoped Classical section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) (Δ D : Fin N → ℤ) (t : Fin N → ℕ) (B : ℕ) (source target : (g : Fin N) → Fin (t g) ↪ P g) (H : (g : Fin N) → Finset (P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (n g)) B) end Joint end section open scoped BigOperators Classical end section open Finset theorem totient_sieve_interval_euler_product_le_log (N : ℕ) {D : ℝ} (hD : 1 ≤ D) (hND : (N : ℝ) ≤ D) : (∏ p ∈ (Icc 1 N).filter Nat.Prime, (1 + 1 / ((p : ℝ) - 1))) ≤ (2 * primeEulerProductUpperConstant) * Real.log (2 * D) := by apply finite_inverse_prime_euler_product_le_log _ (fun _ hp => (mem_filter.mp hp).2) hD intro p hp exact (Nat.cast_le.mpr (mem_Icc.mp (mem_filter.mp hp).1).2).trans hND theorem totient_sieve_squarefree_mass_le_log (N : ℕ) {D : ℝ} (hD : 1 ≤ D) (hND : (N : ℝ) ≤ D) : (∑ d ∈ (Icc 1 N).filter Squarefree, 1 / (Nat.totient d : ℝ)) ≤ (2 * primeEulerProductUpperConstant) * Real.log (2 * D) := by let P := (Icc 1 N).filter Nat.Prime have hP : ∀ p ∈ P, p.Prime := fun _ hp => (mem_filter.mp hp).2 have hsub := totient_sieve_squarefree_moduli_subset P ((Icc 1 N).filter Squarefree) hP (fun _ hd => (mem_filter.mp hd).2) (totient_sieve_interval_squarefree_prime_support N) calc _ ≤ ∑ d ∈ (∏ p ∈ P, p).divisors, 1 / (Nat.totient d : ℝ) := sum_le_sum_of_subset_of_nonneg hsub (fun _ _ _ => by positivity) _ = ∏ p ∈ P, (1 + 1 / ((p : ℝ) - 1)) := totient_sieve_divisor_mass P hP _ ≤ _ := totient_sieve_interval_euler_product_le_log N hD hND theorem totient_sieve_noncoprime_mass_le_log (N n : ℕ) (hn : n ≠ 0) {D : ℝ} (hD : 1 ≤ D) (hND : (N : ℝ) ≤ D) : (∑ d ∈ (Icc 1 N).filter (fun d => Squarefree d ∧ ¬ Nat.Coprime d n), 1 / (Nat.totient d : ℝ)) ≤ (∑ p ∈ n.primeFactors, 1 / ((p : ℝ) - 1)) * ((2 * primeEulerProductUpperConstant) * Real.log (2 * D)) := by have hnonneg (p : ℕ) (hp : p ∈ n.primeFactors) : 0 ≤ 1 / ((p : ℝ) - 1) := by have hp1 : (1 : ℝ) ≤ p := by exact_mod_cast (Nat.prime_of_mem_primeFactors hp).one_le positivity apply (totient_sieve_interval_noncoprime_mass N n hn).trans apply mul_le_mul · exact sum_le_sum_of_subset_of_nonneg (filter_subset _ _) (fun p hp _ => hnonneg p hp) · exact totient_sieve_interval_euler_product_le_log N hD hND · apply prod_nonneg intro p hp have hp1 : (1 : ℝ) ≤ p := by exact_mod_cast (mem_filter.mp hp).2.one_le positivity · exact sum_nonneg hnonneg end section open Finset open scoped Classical end section open Finset open scoped Classical theorem global_birth_visit_raw_cutoff_congr {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, DecidableEq (R p)] {N : ℕ} (h : (p : P) → R p) (β : P → ℝ) (η V ρ : ℝ) (B : ℕ) (H : Finset P) (old : Fin N → Σ p, R p) (F G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) (hFG : ∀ H' q, q.1 ≤ B → F H' q = G H' q) : globalBirthGhostVisitRawRow h β η V ρ B H old F = globalBirthGhostVisitRawRow h β η V ρ B H old G := by unfold globalBirthGhostVisitRawRow apply sum_congr rfl intro T _ apply sum_congr rfl intro b _ apply sum_congr rfl intro f _ congr 1 split_ifs with hq · exact hFG _ _ hq · rfl def boundedGhostLedgerDecode {P : Type*} (n : P → ℕ) (t B : ℕ) (s : Finset P × BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : Finset P × FiniteOrderedTuple (UnrestrictedResidueParticle n) := (s.1, boundedOrderedTupleToFinite s.2.2) noncomputable def boundedGhostLedgerTarget {P : Type*} [DecidableEq P] (n : P → ℕ) (t B : ℕ) (s : Finset P × BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : BoundedGhostEvent t B s.2) : Finset P × BoundedOrderedState P (UnrestrictedResidueParticle n) t B := (s.1 ∪ univ.image (fun j => (e.2.2 j).1), boundedGhostEventTarget t B s.2 e) noncomputable def boundedGhostLedgerRow {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) [∀ p, NeZero (n p)] (β : P → ℝ) (η V ρ : ℝ) (t B : ℕ) (F : Finset P × BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) (s : Finset P × BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : ℂ := ∑ e : BoundedGhostEvent t B s.2, (boundedGhostEventWeight (physicalGhostRetention n (1 - η) ρ) (physicalGhostTermination n (1 - η) ρ) (physicalGhostBirth n (1 - η) ρ V) (unrestrictedResidueWeight (fun p => β p / V)) t B s.2 e : ℂ) * (if globalBirthGhostEventFresh n s.1 t B s.2 e then 1 else 0) * F (boundedGhostLedgerTarget n t B s e) theorem bounded_ghost_ledger_row_decode {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) [∀ p, NeZero (n p)] (β : P → ℝ) (η V ρ : ℝ) (t B : ℕ) (F : (Finset P × FiniteOrderedTuple (UnrestrictedResidueParticle n)) → ℂ) (s : Finset P × BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : boundedGhostLedgerRow n β η V ρ t B (F ∘ boundedGhostLedgerDecode n t B) s = globalBirthGhostVisitRawRow (fun _ => 0) β η V ρ B s.1 s.2.2.2 (fun H q => F (H, q)) := by symm calc _ = globalBirthGhostVisitRawRow (fun _ => 0) β η V ρ B s.1 s.2.2.2 (fun H q => boundedOrderedZeroExtension (fun u => F (H, boundedOrderedTupleToFinite u.2)) s.2.1 q) := by apply global_birth_visit_raw_cutoff_congr intro H q hq rw [boundedOrderedZeroExtension_of_le _ _ _ hq] rfl _ = _ := global_birth_visit_eq_bounded_ghost_ledger_sum n β η V ρ s.1 t B (fun H u => F (H, boundedOrderedTupleToFinite u.2)) s.2 end section open Finset theorem exists_rough_integer_divisor_weights : ∃ K : ℝ, 0 < K ∧ ∀ {z : ℝ}, 1 < z → ∀ h : ℕ, 1 ≤ h → Even h → ∃ lam : ℕ → ℝ, (∀ d, |lam d| ≤ 1) ∧ (∀ d, lam d ≠ 0 → 0 < d ∧ (d : ℝ) ≤ z^(4 * (h : ℝ) + 2) ∧ Squarefree d ∧ d ∣ ∏ p ∈ primeBand 0 z, p) ∧ (∀ n : ℕ, n ≠ 0 → 0 ≤ ∑ d ∈ n.divisors, lam d ∧ (if ∀ p ∈ n.primeFactors, z < (p : ℝ) then (1 : ℝ) else 0) ≤ ∑ d ∈ n.divisors, lam d) ∧ (∑ d ∈ blockSieveModuli (primeBand 0 z) (z^(4 * (h : ℝ) + 2)), |lam d| / (d : ℝ)) ≤ ∏ p ∈ primeBand 0 z, (1 + 1 / (p : ℝ)) ∧ ∀ a b : ℕ, a ≤ b → let M := (∑ n ∈ Ioc a b, ∑ d ∈ n.divisors, lam d) - (((Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ))).card : ℝ) 0 ≤ M ∧ M ≤ ((b : ℝ) - a) * K * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2) := by obtain ⟨K, hK, hweights⟩ := exists_rough_sieve_divisor_weights refine ⟨K, hK, ?_⟩ intro z hz h hh heven have hz0 : 0 ≤ z := (zero_lt_one.trans hz).le obtain ⟨lam, habs, hsupport, hpoint, hharm, hover⟩ := hweights (primeBand 0 z) hz (fun _ hp => small_prime_pool_prime hp) (fun _ hp => small_prime_pool_le hz0 hp) h hh heven refine ⟨lam, habs, hsupport, ?_, hharm, ?_⟩ · intro n hn simpa only [small_prime_avoidance_iff_rough hz0 hn] using hpoint n hn · intro a b hab simpa only [interval_small_prime_avoidance_eq_rough a b hz0] using hover a b hab theorem exists_rough_integer_interval_count : ∃ K : ℝ, 0 < K ∧ ∀ (a b : ℕ) {z : ℝ} {h : ℕ}, 1 < z → a ≤ b → 1 ≤ h → Even h → |(((Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ))).card : ℝ) - ((b : ℝ) - a) * (∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ)))| ≤ ((b : ℝ) - a) * (∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ))) * K * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2) := by obtain ⟨K, hK, hcount⟩ := exists_rough_interval_count_bound refine ⟨K, hK, ?_⟩ intro a b z h hz hab hh heven have hz0 : 0 ≤ z := (zero_lt_one.trans hz).le simpa only [interval_small_prime_avoidance_eq_rough a b hz0] using hcount (primeBand 0 z) a b hz hab hh heven (fun _ hp => small_prime_pool_prime hp) (fun _ hp => small_prime_pool_le hz0 hp) end section open Finset open scoped Classical section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) end ResiduePath end section open Finset Filter open scoped Topology theorem eventually_totient_sieve_noncoprime_mass_le : ∀ᶠ L : ℝ in atTop, ∀ N n : ℕ, (N : ℝ) ≤ Real.exp L → n ≠ 0 → (n : ℝ) ≤ 16 * Real.exp L → (∀ p ∈ n.primeFactors, L^20 ≤ (p : ℝ)) → (∑ d ∈ (Icc 1 N).filter (fun d => Squarefree d ∧ ¬ Nat.Coprime d n), 1 / (Nat.totient d : ℝ)) ≤ (16 * primeEulerProductUpperConstant) * L^(-18 : ℝ) := by filter_upwards [eventually_prime_factor_inverse_sum_le_four_rpow, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (Real.log 2)] with L hprime hL hlog2 intro N n hN hn hsize hlarge have hL0 : 0 < L := zero_lt_one.trans_le hL have hD : 1 ≤ Real.exp L := Real.one_le_exp hL0.le have hlog : Real.log (2 * Real.exp L) ≤ 2 * L := by rw [Real.log_mul (by norm_num) (Real.exp_ne_zero L), Real.log_exp] linarith have hS : 0 ≤ ∑ p ∈ n.primeFactors, 1 / ((p : ℝ) - 1) := by apply sum_nonneg intro p hp have hp1 : (1 : ℝ) ≤ p := by exact_mod_cast (Nat.prime_of_mem_primeFactors hp).one_le positivity have hconst : 0 ≤ 2 * primeEulerProductUpperConstant := mul_nonneg (by norm_num) primeEulerProductUpperConstant_pos.le have hid : L^(-19 : ℝ) * L = L^(-18 : ℝ) := by calc _ = L^(-19 : ℝ) * L^(1 : ℝ) := by rw [Real.rpow_one] _ = L^((-19 : ℝ) + 1) := (Real.rpow_add hL0 _ _).symm _ = _ := by norm_num calc _ ≤ (∑ p ∈ n.primeFactors, 1 / ((p : ℝ) - 1)) * ((2 * primeEulerProductUpperConstant) * Real.log (2 * Real.exp L)) := totient_sieve_noncoprime_mass_le_log N n hn hD hN _ ≤ (4 * L^(-19 : ℝ)) * ((2 * primeEulerProductUpperConstant) * (2 * L)) := by apply mul_le_mul (hprime n hn hsize hlarge) (mul_le_mul_of_nonneg_left hlog hconst) · exact mul_nonneg hconst (Real.log_nonneg (by linarith [Real.exp_pos L])) · positivity _ = (16 * primeEulerProductUpperConstant) * (L^(-19 : ℝ) * L) := by ring _ = _ := by rw [hid] end section open Finset open scoped Classical section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] (β : (g : Fin N) → P g → ℝ) (η V ρ : Fin N → ℝ) (t : Fin N → ℕ) (B : ℕ) abbrev BoundedGhostJointLedgerState := (g : Fin N) → Finset (P g) × BoundedOrderedState (P g) (UnrestrictedResidueParticle (n g)) (t g) B def boundedGhostJointDecode (s : BoundedGhostJointLedgerState n t B) : GlobalBirthJointState (fun g p => ZMod (n g p)) := fun g => boundedGhostLedgerDecode (n g) (t g) B (s g) noncomputable def boundedGhostJointTarget (s : BoundedGhostJointLedgerState n t B) (e : CoupledGhostEvent t B (fun g => (s g).2)) : BoundedGhostJointLedgerState n t B := fun g => boundedGhostLedgerTarget (n g) (t g) B (s g) (e g) noncomputable def boundedGhostJointRow (F : BoundedGhostJointLedgerState n t B → ℂ) (s : BoundedGhostJointLedgerState n t B) : ℂ := finTensorRow N (fun g => boundedGhostLedgerRow (n g) (β g) (η g) (V g) (ρ g) (t g) B) F s theorem bounded_ghost_joint_row_decode (F : GlobalBirthJointState (fun g p => ZMod (n g p)) → ℂ) (s : BoundedGhostJointLedgerState n t B) : boundedGhostJointRow n β η V ρ t B (F ∘ boundedGhostJointDecode n t B) s = finTensorRow N (fun g (K : GlobalBirthHistoryState (fun p => ZMod (n g p)) → ℂ) (u : GlobalBirthHistoryState (fun p => ZMod (n g p))) => globalBirthGhostVisitRawRow (fun _ => 0) (β g) (η g) (V g) (ρ g) B u.1 u.2.2 (fun H q => K (H, q))) F (boundedGhostJointDecode n t B s) := by unfold boundedGhostJointRow boundedGhostJointDecode apply fin_tensor_row_intertwines_on N (fun g => boundedGhostLedgerRow (n g) (β g) (η g) (V g) (ρ g) (t g) B) (fun g (K : GlobalBirthHistoryState (fun p => ZMod (n g p)) → ℂ) (u : GlobalBirthHistoryState (fun p => ZMod (n g p))) => globalBirthGhostVisitRawRow (fun _ => 0) (β g) (η g) (V g) (ρ g) B u.1 u.2.2 (fun H q => K (H, q))) (fun g => boundedGhostLedgerDecode (n g) (t g) B) (fun g => boundedGhostLedgerDecode (n g) (t g) B) (fun _ _ => True) (fun _ _ => True) · intro g u _ G K hGK have he : G = K ∘ boundedGhostLedgerDecode (n g) (t g) B := funext (fun v => hGK v trivial) rw [he] exact bounded_ghost_ledger_row_decode (n g) (β g) (η g) (V g) (ρ g) (t g) B K u · intro u _ rfl · exact fun _ => trivial theorem bounded_ghost_joint_row_events (F : BoundedGhostJointLedgerState n t B → ℂ) (s : BoundedGhostJointLedgerState n t B) : boundedGhostJointRow n β η V ρ t B F s = ∑ e : CoupledGhostEvent t B (fun g => (s g).2), (∏ g, (boundedGhostEventWeight (physicalGhostRetention (n g) (1 - η g) (ρ g)) (physicalGhostTermination (n g) (1 - η g) (ρ g)) (physicalGhostBirth (n g) (1 - η g) (ρ g) (V g)) (unrestrictedResidueWeight (fun p => β g p / V g)) (t g) B (s g).2 (e g) : ℂ) * (if globalBirthGhostEventFresh (n g) (s g).1 (t g) B (s g).2 (e g) then 1 else 0)) * F (boundedGhostJointTarget n t B s e) := by unfold boundedGhostJointRow boundedGhostLedgerRow rw [fin_tensor_row_events] rfl end Joint end section open Finset theorem finite_majorant_complex_error {ι : Type*} (T : Finset ι) (R : ι → Prop) [DecidablePred R] (U : ι → ℝ) (F : ι → ℂ) {B : ℝ} (hU : ∀ n ∈ T, (if R n then (1 : ℝ) else 0) ≤ U n) (hF : ∀ n ∈ T, ‖F n‖ ≤ B) : ‖(∑ n ∈ T.filter R, F n) - ∑ n ∈ T, (U n : ℂ) * F n‖ ≤ B * ((∑ n ∈ T, U n) - ((T.filter R).card : ℝ)) := by classical let I : ι → ℝ := fun n => if R n then 1 else 0 have hI : (∑ n ∈ T, I n) = ((T.filter R).card : ℝ) := by simp only [I, ← sum_filter, sum_const, nsmul_eq_mul, mul_one] have hIF : (∑ n ∈ T, (I n : ℂ) * F n) = ∑ n ∈ T.filter R, F n := by rw [sum_filter] apply sum_congr rfl intro n _ by_cases hn : R n <;> simp [I, hn] rw [← hIF, ← sum_sub_distrib] calc ‖∑ n ∈ T, ((I n : ℂ) * F n - (U n : ℂ) * F n)‖ ≤ ∑ n ∈ T, ‖(I n : ℂ) * F n - (U n : ℂ) * F n‖ := norm_sum_le _ _ _ ≤ ∑ n ∈ T, B * (U n - I n) := by apply sum_le_sum intro n hn have hnonneg : 0 ≤ U n - I n := sub_nonneg.mpr (hU n hn) rw [← sub_mul, ← Complex.ofReal_sub, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonpos (by linarith : I n - U n ≤ 0)] nlinarith [hF n hn] _ = B * ((∑ n ∈ T, U n) - ((T.filter R).card : ℝ)) := by rw [← mul_sum, sum_sub_distrib, hI] theorem rough_divisor_majorant_complex_error (lam : ℕ → ℝ) {z B E : ℝ} (a b : ℕ) (F : ℕ → ℂ) (hB : 0 ≤ B) (hpoint : ∀ n : ℕ, n ≠ 0 → (if ∀ p ∈ n.primeFactors, z < (p : ℝ) then (1 : ℝ) else 0) ≤ ∑ d ∈ n.divisors, lam d) (hF : ∀ n ∈ Ioc a b, ‖F n‖ ≤ B) (hover : (∑ n ∈ Ioc a b, ∑ d ∈ n.divisors, lam d) - (((Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ))).card : ℝ) ≤ E) : ‖(∑ n ∈ (Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ)), F n) - ∑ n ∈ Ioc a b, ((∑ d ∈ n.divisors, lam d : ℝ) : ℂ) * F n‖ ≤ B * E := by apply (finite_majorant_complex_error (Ioc a b) _ (fun n => ∑ d ∈ n.divisors, lam d) F ?_ hF).trans (mul_le_mul_of_nonneg_left hover hB) intro n hn exact hpoint n (Nat.ne_of_gt (lt_of_le_of_lt (Nat.zero_le a) (mem_Ioc.mp hn).1)) end section open Finset theorem floor_interval_length_le {a b : ℝ} (hb : 0 ≤ b) : (⌊b⌋₊ : ℝ) - ⌊a⌋₊ ≤ b - a + 1 := by have ha' := Nat.lt_floor_add_one a have hb' := Nat.floor_le hb linarith theorem real_interval_rough_overcount (lam : ℕ → ℝ) {z K : ℝ} {h : ℕ} (hz : 1 ≤ z) (hK : 0 ≤ K) (hover : ∀ a b : ℕ, a ≤ b → let M := (∑ n ∈ Ioc a b, ∑ d ∈ n.divisors, lam d) - (((Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ))).card : ℝ) 0 ≤ M ∧ M ≤ ((b : ℝ) - a) * K * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2)) {a b : ℝ} (ha : 0 ≤ a) (hab : a ≤ b) : let M := (∑ n ∈ Ioc ⌊a⌋₊ ⌊b⌋₊, ∑ d ∈ n.divisors, lam d) - ((roughBand a b z).card : ℝ) 0 ≤ M ∧ M ≤ (K + 1) * ((b - a) * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2)) := by have hh := hover ⌊a⌋₊ ⌊b⌋₊ (Nat.floor_mono hab) change 0 ≤ _ ∧ _ ≤ _ at hh have hset : roughBand a b z = (Ioc ⌊a⌋₊ ⌊b⌋₊).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ)) := by rfl dsimp only rw [hset] refine ⟨hh.1, hh.2.trans ?_⟩ have he0 := (Real.exp_pos (-(h : ℝ))).le have he1 : Real.exp (-(h : ℝ)) ≤ 1 := Real.exp_le_one_iff.mpr (neg_nonpos.mpr (Nat.cast_nonneg h)) have hD : 1 ≤ z^(4 * (h : ℝ) + 2) := Real.one_le_rpow hz (by positivity) have hlen := floor_interval_length_le (a := a) (ha.trans hab) have hlen' := mul_le_mul_of_nonneg_right hlen (mul_nonneg hK he0) have hKD := mul_le_mul_of_nonneg_left (he1.trans hD) hK have hterm := mul_nonneg (sub_nonneg.mpr hab) he0 nlinarith end section open Finset Filter open scoped Topology theorem eventually_weighted_principal_coprime_loss : ∀ᶠ L : ℝ in atTop, ∀ (T : Finset ℕ) (μ : ℕ → ℝ) (N : ℕ), (N : ℝ) ≤ Real.exp L → (∀ u ∈ T, 0 ≤ μ u) → (∀ u ∈ T, μ u ≠ 0 → u ≠ 0 ∧ (u : ℝ) ≤ 16 * Real.exp L ∧ ∀ p ∈ u.primeFactors, L^20 ≤ (p : ℝ)) → (∑ d ∈ (Icc 1 N).filter Squarefree, |(∑ u ∈ T.filter (fun u => Nat.Coprime d u), μ u) / (Nat.totient d : ℝ) - (∑ u ∈ T, μ u) / (Nat.totient d : ℝ)|) ≤ (∑ u ∈ T, μ u) * ((16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := by filter_upwards [eventually_totient_sieve_noncoprime_mass_le] with L hL intro T μ N hN hμ hsupp apply totient_sieve_principal_replacement_bound T ((Icc 1 N).filter Squarefree) μ (fun u => u) hμ (∑ u ∈ T, μ u) _ rfl intro u hu hne obtain ⟨hu0, husize, hularge⟩ := hsupp u hu hne simpa only [filter_filter] using hL N u hN hu0 husize hularge theorem eventually_candidate_principal_coprime_loss {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ q : ℝ, 0 ≤ q → ∀ r jStar N : ℕ, (N : ℝ) ≤ Real.exp L → (∑ d ∈ (Icc 1 N).filter Squarefree, |(∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => Nat.Coprime d u), candidateCoefficient c L q r jStar u) / (Nat.totient d : ℝ) - candidateCoefficientWindowMass c L q r jStar / (Nat.totient d : ℝ)|) ≤ candidateCoefficientWindowMass c L q r jStar * ((16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := by filter_upwards [eventually_weighted_principal_coprime_loss, eventually_candidate_coefficient_primeFactors_range hc (δ := (6/5 : ℝ) * c) le_rfl] with L hloss hprime intro q hq r jStar N hN apply hloss (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) N hN (fun u _ => candidate_coefficient_nonneg c L hq r jStar u) intro u hu hne have hwin : Real.exp L < (u : ℝ) ∧ (u : ℝ) ≤ 16 * Real.exp L := by simpa only [one_mul] using (mem_arithmeticProductWindow_iff one_ne_zero (Real.exp L)).mp hu refine ⟨Nat.ne_of_gt (Nat.cast_pos.mp ((Real.exp_pos L).trans hwin.1)), hwin.2, ?_⟩ intro p hp exact (hprime q r jStar u hne p hp).1.le end section open Finset open scoped Classical section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] (β : (g : Fin N) → P g → ℝ) (η V ρ : Fin N → ℝ) (t : Fin N → ℕ) (B : ℕ) def boundedGhostJointFresh (s : BoundedGhostJointLedgerState n t B) (e : CoupledGhostEvent t B (fun g => (s g).2)) : Prop := ∀ g, globalBirthGhostEventFresh (n g) (s g).1 (t g) B (s g).2 (e g) omit [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] [∀ g p, NeZero (n g p)] in theorem bounded_ghost_joint_fresh_product (s : BoundedGhostJointLedgerState n t B) (e : CoupledGhostEvent t B (fun g => (s g).2)) : (∏ g, (if globalBirthGhostEventFresh (n g) (s g).1 (t g) B (s g).2 (e g) then 1 else 0 : ℂ)) = if boundedGhostJointFresh n t B s e then 1 else 0 := by by_cases h : boundedGhostJointFresh n t B s e · simp only [if_pos h, if_pos (h _), prod_const_one] · rw [if_neg h] obtain ⟨g, hg⟩ := not_forall.mp h exact prod_eq_zero (mem_univ g) (if_neg hg) theorem bounded_ghost_joint_row_events_factorized (F : BoundedGhostJointLedgerState n t B → ℂ) (s : BoundedGhostJointLedgerState n t B) : boundedGhostJointRow n β η V ρ t B F s = ∑ e : CoupledGhostEvent t B (fun g => (s g).2), ((∏ g, boundedGhostEventWeight (physicalGhostRetention (n g) (1 - η g) (ρ g)) (physicalGhostTermination (n g) (1 - η g) (ρ g)) (physicalGhostBirth (n g) (1 - η g) (ρ g) (V g)) (unrestrictedResidueWeight (fun p => β g p / V g)) (t g) B (s g).2 (e g) : ℝ) : ℂ) * (if boundedGhostJointFresh n t B s e then 1 else 0) * F (boundedGhostJointTarget n t B s e) := by rw [bounded_ghost_joint_row_events] apply sum_congr rfl intro e _ rw [prod_mul_distrib, ← Complex.ofReal_prod, bounded_ghost_joint_fresh_product] end Joint end section open Finset theorem sieve_weight_harmonic_tsum_eq (P : Finset ℕ) (D : ℝ) (lam : ℕ → ℝ) (hsupport : ∀ d, lam d ≠ 0 → 0 < d ∧ (d : ℝ) ≤ D ∧ d ∣ ∏ p ∈ P, p) : (∑' d : ℕ, |lam d| / (d : ℝ)) = ∑ d ∈ blockSieveModuli P D, |lam d| / (d : ℝ) := by apply tsum_eq_sum intro d hd have hzero : lam d = 0 := by by_contra hn obtain ⟨hd0, hdD, hdP⟩ := hsupport d hn exact hd (mem_filter.mpr ⟨mem_Icc.mpr ⟨hd0, Nat.le_floor hdD⟩, hdP⟩) simp only [hzero, abs_zero, zero_div] theorem exists_rough_integer_polynomial : ∃ K : ℝ, 0 < K ∧ ∀ {z : ℝ}, 1 < z → ∀ h : ℕ, 1 ≤ h → Even h → ∃ lam : ℕ → ℝ, (∀ d, |lam d| ≤ 1) ∧ (∀ d, lam d ≠ 0 → 0 < d ∧ (d : ℝ) ≤ z^(4 * (h : ℝ) + 2) ∧ Squarefree d ∧ d ∣ ∏ p ∈ primeBand 0 z, p) ∧ (∀ n : ℕ, n ≠ 0 → 0 ≤ ∑ d ∈ n.divisors, lam d ∧ (if ∀ p ∈ n.primeFactors, z < (p : ℝ) then (1 : ℝ) else 0) ≤ ∑ d ∈ n.divisors, lam d) ∧ (∑' d : ℕ, |lam d| / (d : ℝ)) ≤ K * Real.log (2 * z) ∧ ∀ a b : ℝ, 0 ≤ a → a ≤ b → let M := (∑ n ∈ Ioc ⌊a⌋₊ ⌊b⌋₊, ∑ d ∈ n.divisors, lam d) - ((roughBand a b z).card : ℝ) 0 ≤ M ∧ M ≤ K * ((b - a) * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2)) := by obtain ⟨K, hK, hweights⟩ := exists_rough_integer_divisor_weights let C := K + primeEulerProductUpperConstant + 1 have hC : 0 < C := by dsimp [C]; linarith [primeEulerProductUpperConstant_pos] refine ⟨C, hC, ?_⟩ intro z hz h hh heven obtain ⟨lam, habs, hsupport, hpoint, hharm, hover⟩ := hweights hz h hh heven refine ⟨lam, habs, hsupport, hpoint, ?_, ?_⟩ · rw [sieve_weight_harmonic_tsum_eq (primeBand 0 z) (z^(4 * (h : ℝ) + 2)) lam (fun d hd => ⟨(hsupport d hd).1, (hsupport d hd).2.1, (hsupport d hd).2.2.2⟩)] apply hharm.trans apply (finite_prime_euler_product_le_log (primeBand 0 z) (fun _ hp => small_prime_pool_prime hp) hz.le (fun _ hp => small_prime_pool_le (zero_lt_one.trans hz).le hp)).trans apply mul_le_mul_of_nonneg_right · dsimp [C] linarith · exact Real.log_nonneg (by linarith) · intro a b ha hab have hr := real_interval_rough_overcount lam hz.le hK.le hover ha hab dsimp only at hr ⊢ refine ⟨hr.1, hr.2.trans ?_⟩ apply mul_le_mul_of_nonneg_right · dsimp [C] linarith [primeEulerProductUpperConstant_pos] · exact add_nonneg (mul_nonneg (sub_nonneg.mpr hab) (Real.exp_pos _).le) (Real.rpow_nonneg (zero_lt_one.trans hz).le _) end section open Finset open scoped Classical section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] (β : (g : Fin N) → P g → ℝ) (η V ρ : Fin N → ℝ) (t : Fin N → ℕ) (B : ℕ) theorem global_birth_joint_visit_bounded_events (a : (g : Fin N) → P g → Bool) (hV : ∀ g, V g ≠ 0) (F : GlobalBirthJointState (fun g p => ZMod (n g p)) → ℂ) (s : BoundedGhostJointLedgerState n t B) : globalBirthJointCutRawRow (fun g => GlobalBirthRawStep.visit (a := a g) (fun _ => 0) (β g) (η g) (V g) (ρ g) (hV g) B) B B F (boundedGhostJointDecode n t B s) = ∑ e : CoupledGhostEvent t B (fun g => (s g).2), (coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (1 - η g) (ρ g)) (fun g => physicalGhostTermination (n g) (1 - η g) (ρ g)) (fun g => physicalGhostBirth (n g) (1 - η g) (ρ g) (V g)) (fun g => unrestrictedResidueWeight (fun p => β g p / V g)) t B (fun g => (s g).2) e : ℂ) * (if boundedGhostJointFresh n t B s e then 1 else 0) * F (boundedGhostJointDecode n t B (boundedGhostJointTarget n t B s e)) := by have hr := bounded_ghost_joint_row_decode n β η V ρ t B (globalBirthJointRawCutoff B F) s change boundedGhostJointRow n β η V ρ t B (globalBirthJointRawCutoff B F ∘ boundedGhostJointDecode n t B) s = globalBirthJointRawRow (fun g => GlobalBirthRawStep.visit (a := a g) (fun _ => 0) (β g) (η g) (V g) (ρ g) (hV g) B) B F (boundedGhostJointDecode n t B s) at hr unfold globalBirthJointCutRawRow change (if productTotalMemory (fun g => (s g).2) ≤ B then globalBirthJointRawRow _ B F (boundedGhostJointDecode n t B s) else 0) = _ rw [← hr, bounded_ghost_joint_row_events_factorized] have hout (e : CoupledGhostEvent t B (fun g => (s g).2)) : globalBirthJointRawCutoff B F (boundedGhostJointDecode n t B (boundedGhostJointTarget n t B s e)) = if productTotalMemory (coupledGhostJointEventTarget t B (fun g => (s g).2) e) ≤ B then F (boundedGhostJointDecode n t B (boundedGhostJointTarget n t B s e)) else 0 := rfl simp only [Function.comp_apply, hout] unfold coupledGhostJointEventWeight by_cases hi : productTotalMemory (fun g => (s g).2) ≤ B · rw [if_pos hi] apply sum_congr rfl intro e _ by_cases ho : productTotalMemory (coupledGhostJointEventTarget t B (fun g => (s g).2) e) ≤ B · have hb : productTotalMemory (fun g => (s g).2) ≤ B ∧ productTotalMemory (coupledGhostJointEventTarget t B (fun g => (s g).2) e) ≤ B := ⟨hi, ho⟩ rw [if_pos ho, if_pos hb] · have hb : ¬ (productTotalMemory (fun g => (s g).2) ≤ B ∧ productTotalMemory (coupledGhostJointEventTarget t B (fun g => (s g).2) e) ≤ B) := fun h => ho h.2 rw [if_neg ho, if_neg hb] simp only [mul_zero, Complex.ofReal_zero, zero_mul] · rw [if_neg hi] symm apply sum_eq_zero intro e _ have hb : ¬ (productTotalMemory (fun g => (s g).2) ≤ B ∧ productTotalMemory (coupledGhostJointEventTarget t B (fun g => (s g).2) e) ≤ B) := fun h => hi h.1 rw [if_neg hb] simp only [Complex.ofReal_zero, zero_mul] end Joint end section open Finset open scoped Classical section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V ρ : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) (cap : ℕ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] end ResiduePath end section open scoped BigOperators Classical theorem bounded_primitive_contains {q Q : ℕ} (hq : 0 < q) (hqQ : q ≤ Q) (χ : DirichletCharacter ℂ q) (hχ : χ.IsPrimitive) : ∃ t : BoundedPrimitiveCharacter Q, boundedPrimitiveModulus t = q ∧ ∀ n : ℕ, boundedPrimitiveValue t (n : ZMod (boundedPrimitiveModulus t)) = χ (n : ZMod q) := by cases q with | zero => omega | succ k => refine ⟨⟨⟨⟨k, by omega⟩, χ⟩, hχ⟩, rfl, ?_⟩ intro n rfl theorem bounded_primitive_inducing {q Q : ℕ} (hq : 0 < q) (hqQ : q ≤ Q) (χ : DirichletCharacter ℂ q) : ∃ t : BoundedPrimitiveCharacter Q, boundedPrimitiveModulus t ≤ q ∧ ∀ n : ℕ, n.Coprime q → boundedPrimitiveValue t (n : ZMod (boundedPrimitiveModulus t)) = χ (n : ZMod q) := by let : NeZero q := ⟨Nat.ne_of_gt hq⟩ have hc : 0 < χ.conductor := Nat.pos_of_ne_zero χ.conductor_ne_zero have hcq : χ.conductor ≤ q := Nat.le_of_dvd hq χ.conductor_dvd_level obtain ⟨t, ht, heval⟩ := bounded_primitive_contains hc (hcq.trans hqQ) χ.primitiveCharacter χ.primitiveCharacter_isPrimitive refine ⟨t, ht ▸ hcq, ?_⟩ intro n hn rw [heval] simpa only [Int.cast_natCast] using χ.primitiveCharacter_apply_of_isCoprime (Nat.isCoprime_iff_coprime.mpr hn) end section open scoped BigOperators Classical ComplexConjugate noncomputable def finiteCharacterCoefficient {G : Type*} [AddCommGroup G] [Fintype G] (f : G → ℂ) (χ : AddChar G ℂ) : ℂ := (Fintype.card G : ℂ)⁻¹ * ∑ x, (starRingEnd ℂ) (χ x) * f x theorem finite_character_dual_pair_sum {G : Type*} [AddCommGroup G] [Fintype G] [DecidableEq G] (x y : G) : (∑ χ : AddChar G ℂ, (starRingEnd ℂ) (χ x) * χ y) = if x = y then (Fintype.card G : ℂ) else 0 := by have ht (χ : AddChar G ℂ) : (starRingEnd ℂ) (χ x) * χ y = χ (y - x) := by rw [χ.map_sub_eq_div, div_eq_mul_inv, mul_comm] rw [← χ.inv_apply_eq_conj] simp_rw [ht] rw [AddChar.sum_apply_eq_ite] simp only [sub_eq_zero, eq_comm] theorem finite_character_expansion {G : Type*} [AddCommGroup G] [Fintype G] [DecidableEq G] (f : G → ℂ) (y : G) : (∑ χ : AddChar G ℂ, finiteCharacterCoefficient f χ * χ y) = f y := by have hN : (Fintype.card G : ℂ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero calc _ = (Fintype.card G : ℂ)⁻¹ * ∑ x, f x * ∑ χ : AddChar G ℂ, (starRingEnd ℂ) (χ x) * χ y := by simp only [finiteCharacterCoefficient, Finset.mul_sum, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro χ _ ring _ = f y := by simp_rw [finite_character_dual_pair_sum] simp [hN, mul_ite, mul_left_comm] theorem finite_character_coefficient_as_inner {G : Type*} [AddCommGroup G] [Fintype G] (f : G → ℂ) (χ : AddChar G ℂ) : finiteCharacterCoefficient f χ = inner ℂ (finiteMeasureVector (fun _ : G => (Fintype.card G : ℝ)⁻¹) χ) (finiteMeasureVector (fun _ : G => (Fintype.card G : ℝ)⁻¹) f) := by rw [finite_measure_vector_inner _ (fun _ => by positivity)] simp only [finiteCharacterCoefficient, Complex.ofReal_inv, Complex.ofReal_natCast, Finset.mul_sum, mul_assoc] theorem finite_character_weighted_inner {G : Type*} [AddCommGroup G] [Fintype G] (χ ψ : AddChar G ℂ) : inner ℂ (finiteMeasureVector (fun _ : G => (Fintype.card G : ℝ)⁻¹) χ) (finiteMeasureVector (fun _ : G => (Fintype.card G : ℝ)⁻¹) ψ) = if χ = ψ then 1 else 0 := by rw [finite_measure_vector_inner _ (fun _ => by positivity)] have h := AddChar.wInner_cWeight_eq_boole χ ψ simpa only [RCLike.wInner_cWeight_eq_expect, Fintype.expect_eq_sum_div_card, RCLike.inner_apply, div_eq_mul_inv, Finset.sum_mul, Finset.mul_sum, mul_comm, mul_left_comm, mul_assoc, Complex.ofReal_inv, Complex.ofReal_natCast] using h theorem finite_character_coefficient_energy {G : Type*} [AddCommGroup G] [Fintype G] (f : G → ℂ) : (∑ χ : AddChar G ℂ, ‖finiteCharacterCoefficient f χ‖ ^ 2) ≤ (Fintype.card G : ℝ)⁻¹ * ∑ x, ‖f x‖ ^ 2 := by have hrow (χ : AddChar G ℂ) : (∑ ψ : AddChar G ℂ, ‖inner ℂ (finiteMeasureVector (fun _ : G => (Fintype.card G : ℝ)⁻¹) χ) (finiteMeasureVector (fun _ : G => (Fintype.card G : ℝ)⁻¹) ψ)‖) ≤ 1 := by simp only [finite_character_weighted_inner, apply_ite, norm_one, norm_zero] simp have he := finite_gram_row_analysis_sq _ (by norm_num : (0 : ℝ) ≤ 1) hrow (finiteMeasureVector (fun _ : G => (Fintype.card G : ℝ)⁻¹) f) have hμ : ∀ _x : G, 0 ≤ (Fintype.card G : ℝ)⁻¹ := fun _ => by positivity rw [finite_measure_vector_norm_sq _ hμ] at he simpa only [← finite_character_coefficient_as_inner, one_mul, Finset.mul_sum] using he theorem finite_character_coefficient_l1 {G : Type*} [AddCommGroup G] [Fintype G] (f : G → ℂ) (hf : ∀ x, ‖f x‖ ≤ 1) : (∑ χ : AddChar G ℂ, ‖finiteCharacterCoefficient f χ‖) ≤ Real.sqrt (Fintype.card G : ℝ) := by have hN : (Fintype.card G : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero have he : (∑ χ : AddChar G ℂ, ‖finiteCharacterCoefficient f χ‖ ^ 2) ≤ 1 := by apply (finite_character_coefficient_energy f).trans calc _ ≤ (Fintype.card G : ℝ)⁻¹ * ∑ _x : G, (1 : ℝ) := by gcongr with x exact (pow_le_pow_left₀ (norm_nonneg _) (hf x) 2).trans_eq (one_pow 2) _ = 1 := by simp [hN] have hcs := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (fun χ : AddChar G ℂ => ‖finiteCharacterCoefficient f χ‖) (fun _ => (1 : ℝ)) simp only [mul_one, one_pow, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one, AddChar.card_eq] at hcs have hb : (∑ χ : AddChar G ℂ, ‖finiteCharacterCoefficient f χ‖) ^ 2 ≤ (Fintype.card G : ℝ) := hcs.trans (by simpa only [one_mul] using mul_le_mul_of_nonneg_right he (Nat.cast_nonneg (Fintype.card G) : (0 : ℝ) ≤ _)) exact (Real.le_sqrt (Finset.sum_nonneg (fun _ _ => norm_nonneg _)) (Nat.cast_nonneg _)).mpr hb end section open Finset open scoped Classical noncomputable def finiteTwoKernelAverage {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (x : X) (y : Y) (F : X → Y → ℂ) : ℂ := ∑ d, ∑ e, ((μ d : ℂ) * KA d x) * ((ν e : ℂ) * KB e y) * F d e theorem finite_two_kernel_average_separable {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (x : X) (y : Y) (f : X → ℂ) (g : Y → ℂ) : finiteTwoKernelAverage μ ν KA KB x y (fun d e => f d * g e) = (∑ d, (μ d : ℂ) * KA d x * f d) * (∑ e, (ν e : ℂ) * KB e y * g e) := by simp only [finiteTwoKernelAverage, sum_mul, mul_sum] rw [sum_comm] apply sum_congr rfl intro d _ apply sum_congr rfl intro e _ ring theorem finite_two_kernel_average_sum {I X Y : Type*} [Fintype X] [Fintype Y] (s : Finset I) (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (x : X) (y : Y) (F : I → X → Y → ℂ) : finiteTwoKernelAverage μ ν KA KB x y (∑ i ∈ s, F i) = ∑ i ∈ s, finiteTwoKernelAverage μ ν KA KB x y (F i) := by simp only [finiteTwoKernelAverage, Finset.sum_apply, mul_sum] simp_rw [sum_comm (s := (univ : Finset Y))] rw [sum_comm] section variable {X Y : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (x : X) (y : Y) include X Y sharedInstance1 sharedInstance2 μ ν KA KB x y theorem finite_two_kernel_average_mul (c : ℂ) (F : X → Y → ℂ) : finiteTwoKernelAverage μ ν KA KB x y (fun d e => c * F d e) = c * finiteTwoKernelAverage μ ν KA KB x y F := by simp only [finiteTwoKernelAverage, mul_sum] apply sum_congr rfl intro d _ apply sum_congr rfl intro e _ ring theorem finite_two_kernel_average_sub (F H : X → Y → ℂ) : finiteTwoKernelAverage μ ν KA KB x y (F - H) = finiteTwoKernelAverage μ ν KA KB x y F - finiteTwoKernelAverage μ ν KA KB x y H := by simp only [finiteTwoKernelAverage, Pi.sub_apply, mul_sub, sum_sub_distrib] end theorem complex_product_reproduction_error (a b u v : ℂ) (εA εB : ℝ) (hεA : 0 ≤ εA) (hεB : 0 ≤ εB) (ha : ‖a‖ ≤ 1) (hb : ‖b‖ ≤ 1) (hu : ‖u - a‖ ≤ εA) (hv : ‖v - b‖ ≤ εB) : ‖u * v - a * b‖ ≤ εA + εB + εA * εB := by have hvnorm : ‖v‖ ≤ εB + 1 := by calc _ = ‖(v - b) + b‖ := by congr 1; ring _ ≤ ‖v - b‖ + ‖b‖ := norm_add_le _ _ _ ≤ εB + 1 := add_le_add hv hb calc _ = ‖(u - a) * v + a * (v - b)‖ := by congr 1; ring _ ≤ ‖(u - a) * v‖ + ‖a * (v - b)‖ := norm_add_le _ _ _ = ‖u - a‖ * ‖v‖ + ‖a‖ * ‖v - b‖ := by rw [norm_mul, norm_mul] _ ≤ εA * (εB + 1) + 1 * εB := add_le_add (mul_le_mul hu hvnorm (norm_nonneg _) hεA) ((mul_le_mul_of_nonneg_left hv (norm_nonneg _)).trans (mul_le_mul_of_nonneg_right ha hεB)) _ = _ := by ring theorem finite_two_kernel_character_error {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (x : X) (y : Y) (χA : X → ℂ) (χB : Y → ℂ) (εA εB : ℝ) (hεA : 0 ≤ εA) (hεB : 0 ≤ εB) (hχA : ‖χA x‖ ≤ 1) (hχB : ‖χB y‖ ≤ 1) (hA : ‖(∑ d, (μ d : ℂ) * KA d x * χA d) - χA x‖ ≤ εA) (hB : ‖(∑ e, (ν e : ℂ) * KB e y * χB e) - χB y‖ ≤ εB) : ‖finiteTwoKernelAverage μ ν KA KB x y (fun d e => χA d * χB e) - χA x * χB y‖ ≤ εA + εB + εA * εB := by rw [finite_two_kernel_average_separable] exact complex_product_reproduction_error _ _ _ _ εA εB hεA hεB hχA hχB hA hB theorem finite_two_kernel_expansion_error {I X Y : Type*} [Fintype X] [Fintype Y] (s : Finset I) (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (x : X) (y : Y) (c : I → ℂ) (χA : I → X → ℂ) (χB : I → Y → ℂ) (εA εB H : ℝ) (hεA : 0 ≤ εA) (hεB : 0 ≤ εB) (hc : ∑ i ∈ s, ‖c i‖ ≤ H) (hχA : ∀ i ∈ s, ‖χA i x‖ ≤ 1) (hχB : ∀ i ∈ s, ‖χB i y‖ ≤ 1) (hA : ∀ i ∈ s, ‖(∑ d, (μ d : ℂ) * KA d x * χA i d) - χA i x‖ ≤ εA) (hB : ∀ i ∈ s, ‖(∑ e, (ν e : ℂ) * KB e y * χB i e) - χB i y‖ ≤ εB) : ‖finiteTwoKernelAverage μ ν KA KB x y (fun d e => ∑ i ∈ s, c i * (χA i d * χB i e)) - ∑ i ∈ s, c i * (χA i x * χB i y)‖ ≤ H * (εA + εB + εA * εB) := by have hrewrite : finiteTwoKernelAverage μ ν KA KB x y (fun d e => ∑ i ∈ s, c i * (χA i d * χB i e)) = ∑ i ∈ s, c i * finiteTwoKernelAverage μ ν KA KB x y (fun d e => χA i d * χB i e) := by have hfun : (fun d e => ∑ i ∈ s, c i * (χA i d * χB i e)) = ∑ i ∈ s, fun d e => c i * (χA i d * χB i e) := by funext d e simp only [Finset.sum_apply] rw [hfun, finite_two_kernel_average_sum] simp_rw [finite_two_kernel_average_mul] rw [hrewrite, ← sum_sub_distrib] calc _ ≤ ∑ i ∈ s, ‖c i * finiteTwoKernelAverage μ ν KA KB x y (fun d e => χA i d * χB i e) - c i * (χA i x * χB i y)‖ := norm_sum_le _ _ _ ≤ ∑ i ∈ s, ‖c i‖ * (εA + εB + εA * εB) := by apply sum_le_sum intro i hi rw [← mul_sub, norm_mul] exact mul_le_mul_of_nonneg_left (finite_two_kernel_character_error μ ν KA KB x y (χA i) (χB i) εA εB hεA hεB (hχA i hi) (hχB i hi) (hA i hi) (hB i hi)) (norm_nonneg _) _ = (∑ i ∈ s, ‖c i‖) * (εA + εB + εA * εB) := (sum_mul _ _ _).symm _ ≤ _ := mul_le_mul_of_nonneg_right hc (by positivity) section variable {X Y : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (x : X) (y : Y) include X Y sharedInstance1 sharedInstance2 μ ν KA KB x y theorem finite_two_kernel_average_norm_le (F : X → Y → ℂ) (L RA RB : ℝ) (hμ : ∀ d, 0 ≤ μ d) (hν : ∀ e, 0 ≤ ν e) (hL : 0 ≤ L) (hA : ∑ d, μ d * ‖KA d x‖ ≤ RA) (hB : ∑ e, ν e * ‖KB e y‖ ≤ RB) (hF : ∀ d e, KA d x * KB e y ≠ 0 → ‖F d e‖ ≤ L) : ‖finiteTwoKernelAverage μ ν KA KB x y F‖ ≤ L * RA * RB := by have hRA : 0 ≤ RA := (sum_nonneg fun d _ => mul_nonneg (hμ d) (norm_nonneg _)).trans hA have hRBsum : 0 ≤ ∑ e, ν e * ‖KB e y‖ := sum_nonneg fun e _ => mul_nonneg (hν e) (norm_nonneg _) have hterm (d : X) (e : Y) : ‖((μ d : ℂ) * KA d x) * ((ν e : ℂ) * KB e y) * F d e‖ ≤ L * (μ d * ‖KA d x‖) * (ν e * ‖KB e y‖) := by by_cases hz : KA d x * KB e y = 0 · rcases mul_eq_zero.mp hz with hz | hz <;> simp [hz] · simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hμ d), abs_of_nonneg (hν e)] calc _ ≤ (μ d * ‖KA d x‖ * (ν e * ‖KB e y‖)) * L := mul_le_mul_of_nonneg_left (hF d e hz) (mul_nonneg (mul_nonneg (hμ d) (norm_nonneg _)) (mul_nonneg (hν e) (norm_nonneg _))) _ = _ := by ring calc _ ≤ ∑ d, ∑ e, ‖((μ d : ℂ) * KA d x) * ((ν e : ℂ) * KB e y) * F d e‖ := (norm_sum_le _ _).trans (sum_le_sum fun d _ => norm_sum_le _ _) _ ≤ ∑ d, ∑ e, L * (μ d * ‖KA d x‖) * (ν e * ‖KB e y‖) := sum_le_sum fun d _ => sum_le_sum fun e _ => hterm d e _ = L * (∑ d, μ d * ‖KA d x‖) * (∑ e, ν e * ‖KB e y‖) := by simp only [mul_sum, sum_mul] rw [sum_comm] _ ≤ L * RA * RB := mul_le_mul (mul_le_mul_of_nonneg_left hA hL) hB hRBsum (mul_nonneg hL hRA) theorem finite_two_kernel_multiplier_replacement (M phase : X → Y → ℂ) (L RA RB : ℝ) (hμ : ∀ d, 0 ≤ μ d) (hν : ∀ e, 0 ≤ ν e) (hL : 0 ≤ L) (hA : ∑ d, μ d * ‖KA d x‖ ≤ RA) (hB : ∑ e, ν e * ‖KB e y‖ ≤ RB) (hphase : ∀ d e, ‖phase d e‖ ≤ 1) (hM : ∀ d e, KA d x * KB e y ≠ 0 → ‖M d e - M x y‖ ≤ L) : ‖finiteTwoKernelAverage μ ν KA KB x y (fun d e => M d e * phase d e) - M x y * finiteTwoKernelAverage μ ν KA KB x y phase‖ ≤ L * RA * RB := by rw [← finite_two_kernel_average_mul, ← finite_two_kernel_average_sub] apply finite_two_kernel_average_norm_le μ ν KA KB x y _ L RA RB hμ hν hL hA hB intro d e hde change ‖M d e * phase d e - M x y * phase d e‖ ≤ L rw [← sub_mul, norm_mul] calc _ ≤ L * 1 := mul_le_mul (hM d e hde) (hphase d e) (norm_nonneg _) hL _ = L := mul_one _ end end section open Finset open scoped Classical noncomputable def cleanNonemptySubsets {I : Type*} [DecidableEq I] (U : Finset I) : Finset (Finset I) := U.powerset.erase ∅ theorem clean_mem_nonempty_subsets {I : Type*} [DecidableEq I] (U A : Finset I) : A ∈ cleanNonemptySubsets U ↔ A ≠ ∅ ∧ A ⊆ U := by simp [cleanNonemptySubsets] theorem clean_nonempty_subsets_mono {I : Type*} [DecidableEq I] {U V : Finset I} (hUV : U ⊆ V) : cleanNonemptySubsets U ⊆ cleanNonemptySubsets V := by intro A hA rw [clean_mem_nonempty_subsets] at hA ⊢ exact ⟨hA.1, hA.2.trans hUV⟩ theorem clean_nonempty_subset_sign_sum {I : Type*} [DecidableEq I] (U : Finset I) : (∑ A ∈ cleanNonemptySubsets U, (-1 : ℂ) ^ A.card) = if U = ∅ then 0 else -1 := by by_cases hU : U = ∅ · simp [hU, cleanNonemptySubsets] · rw [if_neg hU] have h : (∑ A ∈ U.powerset, (-1 : ℂ) ^ A.card) = 0 := by exact_mod_cast (sum_powerset_neg_one_pow_card_of_nonempty (nonempty_iff_ne_empty.mpr hU)) have he := sum_erase_add U.powerset (fun A : Finset I => (-1 : ℂ) ^ A.card) (show (∅ : Finset I) ∈ U.powerset by simp) change (∑ A ∈ U.powerset.erase ∅, (-1 : ℂ) ^ A.card) = -1 simpa only [card_empty, pow_zero, h, zero_sub] using eq_sub_of_add_eq he theorem clean_double_subset_sign_sum {I J : Type*} [DecidableEq I] [DecidableEq J] (U : Finset I) (V : Finset J) : (∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card)) = if U = ∅ ∨ V = ∅ then 0 else 1 := by simp only [pow_add, ← mul_sum, ← sum_mul, clean_nonempty_subset_sign_sum] split_ifs <;> simp_all theorem clean_signed_component_cancellation {I J : Type*} [DecidableEq I] [DecidableEq J] (U : Finset I) (V : Finset J) (r : ℂ) (q : Finset I → Finset J → ℂ) : r - (∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card) * q A B) = (if U = ∅ ∨ V = ∅ then r else 0) - ∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card) * (q A B - r) := by simp only [mul_sub, sum_sub_distrib, ← sum_mul, clean_double_subset_sign_sum] split_ifs <;> ring noncomputable def cleanSignedComponentBlock {I J : Type*} [DecidableEq I] [DecidableEq J] (U : Finset I) (V : Finset J) (r : Finset I → Finset J → ℂ) (q : Finset I → Finset J → Finset I → Finset J → ℂ) : ℂ := ∑ S ∈ U.powerset, ∑ T ∈ V.powerset, (r S T - ∑ A ∈ cleanNonemptySubsets (U \ S), ∑ B ∈ cleanNonemptySubsets (V \ T), (-1 : ℂ) ^ (A.card + B.card) * q S T A B) noncomputable def cleanSignedComponentError {I J : Type*} [DecidableEq I] [DecidableEq J] (U : Finset I) (V : Finset J) (r : Finset I → Finset J → ℂ) (q : Finset I → Finset J → Finset I → Finset J → ℂ) : ℂ := ∑ S ∈ U.powerset, ∑ T ∈ V.powerset, ∑ A ∈ cleanNonemptySubsets (U \ S), ∑ B ∈ cleanNonemptySubsets (V \ T), (-1 : ℂ) ^ (A.card + B.card) * (q S T A B - r S T) theorem clean_exceptional_component_sum {I J : Type*} [DecidableEq I] [DecidableEq J] (U : Finset I) (V : Finset J) (r : Finset I → Finset J → ℂ) : (∑ S ∈ U.powerset, ∑ T ∈ V.powerset, if U \ S = ∅ ∨ V \ T = ∅ then r S T else 0) = (∑ T ∈ V.powerset, r U T) + ∑ S ∈ U.powerset.erase U, r S V := by rw [← sum_erase_add U.powerset _ (show U ∈ U.powerset by simp)] have hfull : (∑ T ∈ V.powerset, if U \ U = ∅ ∨ V \ T = ∅ then r U T else 0) = ∑ T ∈ V.powerset, r U T := by simp rw [hfull, add_comm] congr 1 apply sum_congr rfl intro S hS have hSU : S ⊆ U := mem_powerset.mp (mem_erase.mp hS).2 have hne : U \ S ≠ ∅ := by intro h exact (mem_erase.mp hS).1 ((sdiff_eq_empty_iff_subset.mp h).antisymm hSU).symm calc (∑ T ∈ V.powerset, if U \ S = ∅ ∨ V \ T = ∅ then r S T else 0) = ∑ T ∈ V.powerset, if T = V then r S T else 0 := by apply sum_congr rfl intro T hT have hTV := mem_powerset.mp hT have he : V \ T = ∅ ↔ T = V := by constructor · intro h; exact hTV.antisymm (sdiff_eq_empty_iff_subset.mp h) · rintro rfl; simp simp only [hne, false_or, he] _ = r S V := by simp theorem clean_signed_block_cancellation {I J : Type*} [DecidableEq I] [DecidableEq J] (U : Finset I) (V : Finset J) (r : Finset I → Finset J → ℂ) (q : Finset I → Finset J → Finset I → Finset J → ℂ) : cleanSignedComponentBlock U V r q = ((∑ T ∈ V.powerset, r U T) + ∑ S ∈ U.powerset.erase U, r S V) - cleanSignedComponentError U V r q := by unfold cleanSignedComponentBlock cleanSignedComponentError calc _ = ∑ S ∈ U.powerset, ∑ T ∈ V.powerset, ((if U \ S = ∅ ∨ V \ T = ∅ then r S T else 0) - ∑ A ∈ cleanNonemptySubsets (U \ S), ∑ B ∈ cleanNonemptySubsets (V \ T), (-1 : ℂ) ^ (A.card + B.card) * (q S T A B - r S T)) := by apply sum_congr rfl intro S _ apply sum_congr rfl intro T _ exact clean_signed_component_cancellation _ _ _ _ _ = _ := by simp only [sum_sub_distrib]; rw [clean_exceptional_component_sum] /- Each probe is indicated, missing but not freed, or freed. -/ theorem clean_admissible_subset_count {I : Type*} [DecidableEq I] (U : Finset I) : (∑ S ∈ U.powerset, (cleanNonemptySubsets (U \ S)).card) ≤ 3 ^ U.card := by calc _ ≤ ∑ S ∈ U.powerset, 2 ^ (U \ S).card := by apply sum_le_sum intro S _ exact (card_erase_le).trans_eq (card_powerset _) _ = 3 ^ U.card := by have h := prod_add (fun _ : I => (1 : ℕ)) (fun _ : I => (2 : ℕ)) U simpa only [prod_const, one_pow, one_mul, show (1 : ℕ) + 2 = 3 by rfl] using h.symm theorem clean_signed_component_error_bound {I J : Type*} [DecidableEq I] [DecidableEq J] (U : Finset I) (V : Finset J) (r : Finset I → Finset J → ℂ) (q : Finset I → Finset J → Finset I → Finset J → ℂ) (ε : ℝ) (hε : 0 ≤ ε) (herr : ∀ S ∈ U.powerset, ∀ T ∈ V.powerset, ∀ A ∈ cleanNonemptySubsets (U \ S), ∀ B ∈ cleanNonemptySubsets (V \ T), ‖q S T A B - r S T‖ ≤ ε) : ‖cleanSignedComponentError U V r q‖ ≤ (3 : ℝ) ^ (U.card + V.card) * ε := by have hU : (∑ S ∈ U.powerset, ((cleanNonemptySubsets (U \ S)).card : ℝ)) ≤ 3 ^ U.card := by exact_mod_cast clean_admissible_subset_count U have hV : (∑ T ∈ V.powerset, ((cleanNonemptySubsets (V \ T)).card : ℝ)) ≤ 3 ^ V.card := by exact_mod_cast clean_admissible_subset_count V calc _ ≤ ∑ S ∈ U.powerset, ∑ T ∈ V.powerset, ∑ A ∈ cleanNonemptySubsets (U \ S), ∑ B ∈ cleanNonemptySubsets (V \ T), ‖(-1 : ℂ) ^ (A.card + B.card) * (q S T A B - r S T)‖ := by unfold cleanSignedComponentError exact (norm_sum_le _ _).trans (sum_le_sum fun S _ => (norm_sum_le _ _).trans (sum_le_sum fun T _ => (norm_sum_le _ _).trans (sum_le_sum fun A _ => norm_sum_le _ _))) _ ≤ ∑ S ∈ U.powerset, ∑ T ∈ V.powerset, ∑ A ∈ cleanNonemptySubsets (U \ S), ∑ B ∈ cleanNonemptySubsets (V \ T), ε := by apply sum_le_sum intro S hS apply sum_le_sum intro T hT apply sum_le_sum intro A hA apply sum_le_sum intro B hB simpa only [norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul] using herr S hS T hT A hA B hB _ = (∑ S ∈ U.powerset, ((cleanNonemptySubsets (U \ S)).card : ℝ)) * (∑ T ∈ V.powerset, ((cleanNonemptySubsets (V \ T)).card : ℝ)) * ε := by simp only [sum_const, nsmul_eq_mul] simp_rw [← mul_sum] rw [← sum_mul, ← sum_mul] ring _ ≤ (3 : ℝ) ^ U.card * 3 ^ V.card * ε := by apply mul_le_mul_of_nonneg_right _ hε exact mul_le_mul hU hV (sum_nonneg fun _ _ => Nat.cast_nonneg _) (by positivity) _ = _ := by rw [pow_add] end section open Finset open scoped Classical section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] {X : I → Type*} [sharedInstance4 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ y, μ i y = 1) include I sharedInstance1 sharedInstance2 X sharedInstance4 μ hμ hmass theorem finite_probe_component_norm_le (U S : Finset I) (hS : S ⊆ U) (f : (∀ i, X i) → ℂ) : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ S U.toList f)) ≤ Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) f) := by apply Real.sqrt_le_sqrt exact finite_coordinate_component_energy_le μ hμ hmass U.toList (nodup_toList U) S (by simpa using hS) f theorem finite_probe_comparison_error_uniform (U V S T : Finset I) (hS : S ⊆ U) (hT : T ⊆ V) (f g : (∀ i, X i) → ℂ) (ε : ℝ) (hε : 0 ≤ ε) (e : ℂ) (he : ‖e‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ S U.toList f)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ T V.toList g))) : ‖e‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) g) := by exact he.trans (mul_le_mul (mul_le_mul_of_nonneg_left (finite_probe_component_norm_le μ hμ hmass U S hS f) hε) (finite_probe_component_norm_le μ hμ hmass V T hT g) (Real.sqrt_nonneg _) (mul_nonneg hε (Real.sqrt_nonneg _))) end end section open Finset open scoped Classical theorem finite_coordinate_average_of_independent {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i : I) (hmass : ∑ y, μ i y = 1) (h : (∀ j, X j) → ℂ) (hi : ∀ x y, h (Function.update x i y) = h x) : finiteCoordinateAverage μ i h = h := by funext x rw [finite_coordinate_average_update] simp_rw [hi] rw [← sum_mul] have hm : (∑ y, (μ i y : ℂ)) = 1 := by exact_mod_cast hmass rw [hm, one_mul] section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] {X : I → Type*} [sharedInstance4 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ y, μ i y = 1) (U S : Finset I) (hS : S ⊆ U) (i : I) (hiS : i ∈ S) (f h : (∀ j, X j) → ℂ) (hi : ∀ x y, h (Function.update x i y) = h x) include I sharedInstance1 sharedInstance2 X sharedInstance4 μ hmass U S hS i hiS f h hi theorem finite_probe_component_pairing_zero_left : (∑ x, (finiteProductWeight μ x : ℂ) * ((starRingEnd ℂ) (finiteCoordinateComponent μ S U.toList f x) * h x)) = 0 := by have he := finite_coordinate_average_selfadjoint μ i (finiteCoordinateComponent μ S U.toList f) h rw [finite_coordinate_component_average μ hmass S U.toList i (by simpa using hS hiS), if_pos hiS, finite_coordinate_average_of_independent μ i (hmass i) h hi] at he simpa only [Pi.zero_apply, map_zero, zero_mul, mul_zero, sum_const_zero] using he.symm theorem finite_probe_component_pairing_zero_right : (∑ x, (finiteProductWeight μ x : ℂ) * ((starRingEnd ℂ) (h x) * finiteCoordinateComponent μ S U.toList f x)) = 0 := by have he := finite_coordinate_average_selfadjoint μ i h (finiteCoordinateComponent μ S U.toList f) rw [finite_coordinate_average_of_independent μ i (hmass i) h hi, finite_coordinate_component_average μ hmass S U.toList i (by simpa using hS hiS), if_pos hiS] at he simpa only [Pi.zero_apply, mul_zero, sum_const_zero] using he end end section open Finset open scoped Classical noncomputable def cleanRawPairing {X : Type*} [Fintype X] (w : X → ℝ) (k f g : X → ℂ) : ℂ := ∑ x, (w x : ℂ) * (starRingEnd ℂ) (f x) * g x * k x noncomputable def cleanKernelPairing {X Y : Type*} [Fintype X] [Fintype Y] (w : X → ℝ) (K : X → Y → ℂ) (f : X → ℂ) (g : Y → ℂ) : ℂ := ∑ x, ∑ y, (w x : ℂ) * (starRingEnd ℂ) (f x) * K x y * g y theorem clean_raw_pairing_sum_left {A X : Type*} [Fintype X] (s : Finset A) (w : X → ℝ) (k : X → ℂ) (F : A → X → ℂ) (g : X → ℂ) : cleanRawPairing w k (∑ a ∈ s, F a) g = ∑ a ∈ s, cleanRawPairing w k (F a) g := by simp only [cleanRawPairing, Finset.sum_apply, map_sum, mul_sum, sum_mul] rw [sum_comm] theorem clean_raw_pairing_sum_right {A X : Type*} [Fintype X] (s : Finset A) (w : X → ℝ) (k f : X → ℂ) (H : A → X → ℂ) : cleanRawPairing w k f (∑ a ∈ s, H a) = ∑ a ∈ s, cleanRawPairing w k f (H a) := by simp only [cleanRawPairing, Finset.sum_apply, mul_sum, sum_mul] rw [sum_comm] section variable {A X Y : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] (s : Finset A) (w : X → ℝ) include A X Y sharedInstance1 sharedInstance2 s w theorem clean_kernel_pairing_sum_left (K : X → Y → ℂ) (F : A → X → ℂ) (g : Y → ℂ) : cleanKernelPairing w K (∑ a ∈ s, F a) g = ∑ a ∈ s, cleanKernelPairing w K (F a) g := by simp only [cleanKernelPairing, Finset.sum_apply, map_sum, mul_sum, sum_mul] simp_rw [sum_comm (s := (univ : Finset Y))] rw [sum_comm] theorem clean_kernel_pairing_sum_right (K : X → Y → ℂ) (f : X → ℂ) (H : A → Y → ℂ) : cleanKernelPairing w K f (∑ a ∈ s, H a) = ∑ a ∈ s, cleanKernelPairing w K f (H a) := by simp only [cleanKernelPairing, Finset.sum_apply, mul_sum] simp_rw [sum_comm (s := (univ : Finset Y))] rw [sum_comm] theorem clean_kernel_pairing_sum_kernel (K : A → X → Y → ℂ) (f : X → ℂ) (g : Y → ℂ) : cleanKernelPairing w (∑ a ∈ s, K a) f g = ∑ a ∈ s, cleanKernelPairing w (K a) f g := by simp only [cleanKernelPairing, Finset.sum_apply, mul_sum, sum_mul] simp_rw [sum_comm (s := (univ : Finset Y))] rw [sum_comm] end theorem clean_kernel_pairing_smul_kernel {X Y : Type*} [Fintype X] [Fintype Y] (w : X → ℝ) (K : X → Y → ℂ) (f : X → ℂ) (g : Y → ℂ) (a : ℂ) : cleanKernelPairing w (a • K) f g = a * cleanKernelPairing w K f g := by simp only [cleanKernelPairing, Pi.smul_apply, smul_eq_mul, mul_sum] apply sum_congr rfl intro x _ apply sum_congr rfl intro y _ ring section variable {I : Type*} [sharedInstance1 : DecidableEq I] {X : I → Type*} [sharedInstance3 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (U : Finset I) (f : (∀ i, X i) → ℂ) include I sharedInstance1 X sharedInstance3 μ U f theorem clean_component_sum : (∑ S ∈ U.powerset, finiteCoordinateComponent μ S U.toList f) = f := by simpa using finite_coordinate_component_sum μ U.toList U.nodup_toList f theorem clean_component_erase_sum : (∑ S ∈ U.powerset.erase U, finiteCoordinateComponent μ S U.toList f) = f - finiteCoordinateComponent μ U U.toList f := by apply eq_sub_iff_add_eq.mpr rw [sum_erase_add _ _ (show U ∈ U.powerset by simp), clean_component_sum] end section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] {X : I → Type*} [sharedInstance4 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (U V : Finset I) (w : (∀ i, X i) → ℝ) include I sharedInstance1 sharedInstance2 X sharedInstance4 μ U V w theorem clean_raw_component_pairing_sum (k f g : (∀ i, X i) → ℂ) : (∑ S ∈ U.powerset, ∑ T ∈ V.powerset, cleanRawPairing w k (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g)) = cleanRawPairing w k f g := by simp_rw [← clean_raw_pairing_sum_right, clean_component_sum] rw [← clean_raw_pairing_sum_left, clean_component_sum] theorem clean_kernel_component_pairing_sum (K : (∀ i, X i) → (∀ i, X i) → ℂ) (f g : (∀ i, X i) → ℂ) : (∑ S ∈ U.powerset, ∑ T ∈ V.powerset, cleanKernelPairing w K (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g)) = cleanKernelPairing w K f g := by simp_rw [← clean_kernel_pairing_sum_right, clean_component_sum] rw [← clean_kernel_pairing_sum_left, clean_component_sum] theorem clean_raw_component_exceptional_pairing (k f g : (∀ i, X i) → ℂ) : (∑ T ∈ V.powerset, cleanRawPairing w k (finiteCoordinateComponent μ U U.toList f) (finiteCoordinateComponent μ T V.toList g)) + (∑ S ∈ U.powerset.erase U, cleanRawPairing w k (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ V V.toList g)) = cleanRawPairing w k (finiteCoordinateComponent μ U U.toList f) g + cleanRawPairing w k (f - finiteCoordinateComponent μ U U.toList f) (finiteCoordinateComponent μ V V.toList g) := by rw [← clean_raw_pairing_sum_right, clean_component_sum, ← clean_raw_pairing_sum_left, clean_component_erase_sum] end end section open Finset Classical universe uJ uK uG uP uA section variable {J : Type uJ} {K : Type uK} {G : Type uG} {P : G → Type uP} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) (Δ D : ∀ k c, A k c → G → ℤ) def FullPermutationMixedEvent : Option (J ⊕ K) → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → Type _ | none, _ => ULift.{max uA uP} (FullActiveSlotPermutations M) | some k, s => FullMixedMemoryEvent n S B A Δ D k s noncomputable abbrev fullPermutationMixedEventFintype [Fintype G] [DecidableEq G] [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] (k : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : Fintype (FullPermutationMixedEvent n S B A Δ D k s) := by cases k with | none => dsimp [FullPermutationMixedEvent]; infer_instance | some k => exact fullMixedMemoryEventFintype n S B A Δ D k s noncomputable def fullPermutationMixedEventTarget (k : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FullPermutationMixedEvent n S B A Δ D k s → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B := match k with | none => fun e => fullActivePermutation e.down s | some k => fullMixedMemoryEventTarget n S B A Δ D k s noncomputable def fullPermutationMixedEventWeight [Fintype G] [DecidableEq G] (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) (k : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FullPermutationMixedEvent n S B A Δ D k s → ℝ := match k with | none => fun e => fullActivePermutationWeight M e.down | some k => fullMixedMemoryEventWeight n S B A Δ D ω μ q ρ V k s end end section open Finset Classical end section open Finset Classical theorem norm_div_real_bound_le_one {z : ℂ} {c : ℝ} (hc : 0 ≤ c) (hz : ‖z‖ ≤ c) : ‖z / (c : ℂ)‖ ≤ 1 := by by_cases hzero : c = 0 · simp [hzero] · rw [norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hc] exact (div_le_one (lt_of_le_of_ne hc (Ne.symm hzero))).mpr hz theorem real_bound_mul_div_eq {z : ℂ} {c : ℝ} (hz : ‖z‖ ≤ c) : (c : ℂ) * (z / (c : ℂ)) = z := by by_cases hzero : c = 0 · have hz0 : z = 0 := norm_eq_zero.mp (le_antisymm (hzero ▸ hz) (norm_nonneg _)) simp [hzero, hz0] · have hc : (c : ℂ) ≠ 0 := by exact_mod_cast hzero exact mul_div_cancel₀ z hc section variable {K X : Type*} (E : K → X → Type*) [sharedInstance2 : ∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (ks : List K) (phase : ∀ x, FiniteEventPath E target ks x → ℂ) include K X E sharedInstance2 target w ks phase theorem finite_event_path_phase_mul (c : ℂ) (f : X → ℂ) (x : X) : finiteEventPathAction E target w ks (fun y p => c * phase y p) f x = c * finiteEventPathAction E target w ks phase f x := by simp only [finiteEventPathAction, mul_sum] apply sum_congr rfl intro p _ ring theorem finite_event_path_phase_normalize (c : ℝ) (hphase : ∀ x p, ‖phase x p‖ ≤ c) (f : X → ℂ) (x : X) : finiteEventPathAction E target w ks phase f x = (c : ℂ) * finiteEventPathAction E target w ks (fun y p => phase y p / (c : ℂ)) f x := by rw [← finite_event_path_phase_mul] congr 1 funext y p exact (real_bound_mul_div_eq (hphase y p)).symm end end section open Finset Classical theorem fullActiveAverage_absorb_input_permutation {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z M B → ℂ) (τ : FullActiveSlotPermutations M) : fullActiveAverage (fun x => f (fullActivePermutation τ x)) = fullActiveAverage f := by funext x simp only [fullActiveAverage, fullActivePermutation_mul, fullActivePermutationWeight] exact Equiv.sum_comp (Equiv.mulRight τ) (fun σ => (((Fintype.card (FullActiveSlotPermutations M) : ℝ)⁻¹ : ℝ) : ℂ) * f (fullActivePermutation σ x)) end section open Finset def finitePartitionEquiv {I J : Type*} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] (S : Finset I) (T : Finset J) (left : S ≃ T) (right : ↥(Sᶜ) ≃ ↥(Tᶜ)) : I ≃ J where toFun x := if hx : x ∈ S then (left ⟨x, hx⟩).val else (right ⟨x, mem_compl.mpr hx⟩).val invFun y := if hy : y ∈ T then (left.symm ⟨y, hy⟩).val else (right.symm ⟨y, mem_compl.mpr hy⟩).val left_inv x := by by_cases hx : x ∈ S · simp only [dif_pos hx] have hy := (left ⟨x, hx⟩).property rw [dif_pos hy] exact congrArg Subtype.val (left.symm_apply_apply ⟨x, hx⟩) · simp only [dif_neg hx] have hy := mem_compl.mp (right ⟨x, mem_compl.mpr hx⟩).property rw [dif_neg hy] exact congrArg Subtype.val (right.symm_apply_apply ⟨x, mem_compl.mpr hx⟩) right_inv y := by by_cases hy : y ∈ T · simp only [dif_pos hy] have hx := (left.symm ⟨y, hy⟩).property rw [dif_pos hx] exact congrArg Subtype.val (left.apply_symm_apply ⟨y, hy⟩) · simp only [dif_neg hy] have hx := mem_compl.mp (right.symm ⟨y, mem_compl.mpr hy⟩).property rw [dif_neg hx] exact congrArg Subtype.val (right.apply_symm_apply ⟨y, mem_compl.mpr hy⟩) section variable {I J : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : Fintype J] [sharedInstance3 : DecidableEq I] [sharedInstance4 : DecidableEq J] (S : Finset I) (T : Finset J) (left : S ≃ T) (right : ↥(Sᶜ) ≃ ↥(Tᶜ)) include I J sharedInstance1 sharedInstance2 sharedInstance3 sharedInstance4 S T left right theorem finite_partition_equiv_left (i : S) : finitePartitionEquiv S T left right i.val = (left i).val := by simp only [finitePartitionEquiv, Equiv.coe_fn_mk, dif_pos i.property] theorem finite_partition_equiv_right (i : ↥(Sᶜ)) : finitePartitionEquiv S T left right i.val = (right i).val := by simp only [finitePartitionEquiv, Equiv.coe_fn_mk, dif_neg (mem_compl.mp i.property)] theorem finite_partition_equiv_mem_iff (x : I) : finitePartitionEquiv S T left right x ∈ T ↔ x ∈ S := by by_cases hx : x ∈ S · have he := finite_partition_equiv_left S T left right ⟨x, hx⟩ rw [he] exact iff_of_true (left ⟨x, hx⟩).property hx · have he := finite_partition_equiv_right S T left right ⟨x, mem_compl.mpr hx⟩ rw [he] exact iff_of_false (mem_compl.mp (right ⟨x, mem_compl.mpr hx⟩).property) hx end end section open Finset open scoped Classical def activeEmbeddingSizeCast {P : Type*} {t u : ℕ} (h : t = u) (source : Fin t ↪ P) : Fin u ↪ P := h ▸ source theorem active_embedding_size_cast_apply {P : Type*} {t u : ℕ} (h : t = u) (source : Fin t ↪ P) (i : Fin u) : activeEmbeddingSizeCast h source i = source (finCongr h.symm i) := by subst u rfl theorem global_birth_bounded_edge_events_size_cast {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) {t u : ℕ} (h : t = u) (B : ℕ) (source target : Fin t ↪ P) (hsource : ∀ i, ¬ (n (source i) : ℤ) ∣ D) (htarget : ∀ i, ¬ (n (target i) : ℤ) ∣ D) (H : Finset P) (q : BoundedOrderedTuple (UnrestrictedResidueParticle n) B) (β : P → ℝ) (ρ V : ℝ) (F : Finset P → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) : globalBirthEdgeRawRow source target (fun p => (Δ : ZMod (n p))) H q.2 (globalBirthRawHitIndices (fun p => (Δ : ZMod (n p))) (boundedOrderedTupleToFinite q)) β ρ V B F = ∑ e : UnrestrictedBoundedEvent n Δ D u B (activeEmbeddingSizeCast h source, q), (unrestrictedBoundedEventWeight n Δ D (fun p => β p / V) ρ V u B (activeEmbeddingSizeCast h source, q) e : ℂ) * globalBirthBoundedEdgePhase n Δ D u B (activeEmbeddingSizeCast h target) H (activeEmbeddingSizeCast h source, q) e.1 e.2.1 e.2.2.1 e.2.2.2 * F (H ∪ univ.image (unrestrictedBoundedEventTarget n Δ D u B (activeEmbeddingSizeCast h source, q) e).1) (boundedOrderedTupleToFinite (unrestrictedBoundedEventTarget n Δ D u B (activeEmbeddingSizeCast h source, q) e).2) := by subst u exact global_birth_edge_raw_row_bounded_events n Δ D t B source target hsource htarget H q β ρ V F end section open Finset Classical end section open Finset Classical noncomputable def fullMemoryVacuum {G : Type*} {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z M B) : ℂ := if ∀ g, (x g).2.1.val = 0 then 1 else 0 theorem fullMemoryVacuum_symmetric {G : Type*} [DecidableEq G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} : ProductMemorySymmetric (fullMemoryVacuum (P := P) (Z := Z) (M := M) (B := B)) := by intro x g τ have hlen (i : G) : (productMemoryPermuteAt x g τ i).2.1.val = (x i).2.1.val := by by_cases hi : i = g · subst i simp [productMemoryPermuteAt] · simp [productMemoryPermuteAt, hi] simp only [fullMemoryVacuum, hlen] theorem fullMemoryVacuum_norm_sq {G : Type*} [Fintype G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z M B) : ‖fullMemoryVacuum x‖ ^ 2 = ∏ g, (if (x g).2.1.val = 0 then (1 : ℝ) else 0) := by rw [Fintype.prod_ite_zero] by_cases h : ∀ g, (x g).2.1.val = 0 · simp only [fullMemoryVacuum, if_pos h, norm_one, one_pow, prod_const_one] · simp only [fullMemoryVacuum, if_neg h, norm_zero] norm_num theorem bounded_empty_memory_mass {Z : Type*} [Fintype Z] (ν : Z → ℝ) (B : ℕ) : (∑ q : BoundedOrderedTuple Z B, boundedOrderedMemoryWeight ν q * (if q.1.val = 0 then 1 else 0)) = 1 := by rw [Fintype.sum_sigma, sum_eq_single (0 : Fin (B + 1))] · change (∑ y : Fin 0 → Z, ((∏ j, ν (y j)) / (Nat.factorial 0 : ℝ)) * (if 0 = 0 then 1 else 0)) = 1 simp · intro N _ hN have hval : N.val ≠ 0 := fun h => hN (Fin.ext h) simp [hval] · simp theorem bounded_empty_state_mass {P Z : Type*} [Fintype P] [Fintype Z] (μ : P → ℝ) (ν : Z → ℝ) (M B : ℕ) : (∑ s : BoundedOrderedState P Z M B, boundedOrderedStateWeight μ ν s * (if s.2.1.val = 0 then 1 else 0)) = (∑ p, μ p) ^ M := by rw [Fintype.sum_prod_type] simp only [boundedOrderedStateWeight, mul_assoc, ← mul_sum, bounded_empty_memory_mass, mul_one] exact (Fintype.sum_pow μ M).symm theorem fullMemoryVacuum_energy {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (M : G → ℕ) (B : ℕ) : finiteWeightedEnergy (productMemoryWeight μ ν) (fullMemoryVacuum (M := M) (B := B)) = ∏ g, (∑ p, μ g p) ^ M g := by unfold finiteWeightedEnergy productMemoryWeight simp only [fullMemoryVacuum_norm_sq, ← prod_mul_distrib] rw [← Fintype.prod_sum (fun g (s : BoundedOrderedState (P g) (Z g) (M g) B) => boundedOrderedStateWeight (μ g) (ν g) s * (if s.2.1.val = 0 then (1 : ℝ) else 0))] apply prod_congr rfl intro g _ exact bounded_empty_state_mass (μ g) (ν g) (M g) B end section open Filter theorem prime_kernel_log_factor_le (Q : ℕ) (a : ℝ) (hQ : 0 < Q) (ha : 1 ≤ Real.log a) : 1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a ≤ 2 * (Q : ℝ) ^ 2 := by have hQone : (1 : ℝ) ≤ Q := by exact_mod_cast hQ have hQsq : (1 : ℝ) ≤ (Q : ℝ) ^ 2 := by nlinarith have hQcast : ((Q * Q : ℕ) : ℝ) = (Q : ℝ) ^ 2 := by push_cast; ring rw [hQcast] have hlog0 : 0 ≤ Real.log ((Q : ℝ) ^ 2) := Real.log_nonneg hQsq have hlog : Real.log ((Q : ℝ) ^ 2) ≤ (Q : ℝ) ^ 2 := Real.log_le_self (by positivity) have hdiv : Real.log ((Q : ℝ) ^ 2) / Real.log a ≤ Real.log ((Q : ℝ) ^ 2) := by apply (div_le_iff₀ (by linarith : 0 < Real.log a)).mpr exact le_mul_of_one_le_right hlog0 ha linarith /- The logarithmic factor is bounded crudely by another `Q²`, leaving a uniform exponential-times-power majorant. The exponent bounds may be any reals. -/ theorem prime_kernel_reproduction_error_majorant (c C q v x L : ℝ) (hc : 0 < c) (hC : 0 < C) (hL : 1 < L) (Q : ℕ) (V ξ a : ℝ) (hQ : 0 < Q) (hQbound : (Q : ℝ) ≤ L ^ q) (hV : L ^ (-v) ≤ V) (hξ : L ^ (-x) ≤ ξ) (ha : Real.exp (L ^ c) ≤ a) : ((Q * Q : ℕ) : ℝ) * (((C / V) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a)) / ξ) ≤ (2 * C) * Real.exp (-(1 / 32 : ℝ) * L ^ c) * L ^ (4 * q + v + x) := by have hL0 : 0 < L := by linarith have hV0 : 0 < V := (Real.rpow_pos_of_pos hL0 (-v)).trans_le hV have hξ0 : 0 < ξ := (Real.rpow_pos_of_pos hL0 (-x)).trans_le hξ have ha0 : 0 < a := (Real.exp_pos _).trans_le ha have halog : 1 ≤ Real.log a := by have hh := Real.log_le_log (Real.exp_pos (L ^ c)) ha rw [Real.log_exp] at hh exact (Real.one_le_rpow hL.le hc.le).trans hh have hVinv : 1 / V ≤ L ^ v := by calc _ ≤ 1 / L ^ (-v) := one_div_le_one_div_of_le (Real.rpow_pos_of_pos hL0 (-v)) hV _ = _ := by rw [Real.rpow_neg hL0.le]; simp have hξinv : 1 / ξ ≤ L ^ x := by calc _ ≤ 1 / L ^ (-x) := one_div_le_one_div_of_le (Real.rpow_pos_of_pos hL0 (-x)) hξ _ = _ := by rw [Real.rpow_neg hL0.le]; simp have hadecay : a ^ (-(1 : ℝ) / 32) ≤ Real.exp (-(1 / 32 : ℝ) * L ^ c) := by calc _ ≤ (Real.exp (L ^ c)) ^ (-(1 : ℝ) / 32) := Real.rpow_le_rpow_of_nonpos (Real.exp_pos _) ha (by norm_num) _ = _ := by rw [← Real.exp_mul]; congr 1; ring have hQsq : (Q : ℝ) ^ 2 ≤ (L ^ q) ^ 2 := pow_le_pow_left₀ (Nat.cast_nonneg Q) hQbound 2 have hlogbound : 1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a ≤ 2 * (L ^ q) ^ 2 := (prime_kernel_log_factor_le Q a hQ halog).trans (by linarith) have hlog0 : 0 ≤ 1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a := by have hQQ : (1 : ℝ) ≤ ((Q * Q : ℕ) : ℝ) := by exact_mod_cast (show 1 ≤ Q * Q by nlinarith) have hh := Real.log_nonneg hQQ positivity calc _ = (Q : ℝ) ^ 2 * C * (1 / V) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a) * (1 / ξ) := by push_cast ring _ ≤ (L ^ q) ^ 2 * C * L ^ v * Real.exp (-(1 / 32 : ℝ) * L ^ c) * (2 * (L ^ q) ^ 2) * L ^ x := by gcongr _ = _ := by rw [show 4 * q + v + x = q + q + v + q + q + x by ring] simp only [Real.rpow_add hL0] ring /- One threshold in `L` works for every allowed modulus bound, mass, cell width, and prime-band starting point. -/ theorem eventually_prime_kernel_reproduction_error_small (c C q v x D : ℝ) (hc : 0 < c) (hC : 0 < C) : ∀ᶠ L : ℝ in atTop, ∀ (Q : ℕ) (V ξ a : ℝ), 0 < Q → (Q : ℝ) ≤ L ^ q → L ^ (-v) ≤ V → L ^ (-x) ≤ ξ → Real.exp (L ^ c) ≤ a → ((Q * Q : ℕ) : ℝ) * (((C / V) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a)) / ξ) ≤ L ^ (-D) := by filter_upwards [eventually_exp_neg_rpow_mul_rpow_le hc (by norm_num : (0 : ℝ) < 1 / 32) (4 * q + v + x + 1) D, eventually_gt_atTop (1 : ℝ), eventually_ge_atTop (2 * C)] with L hdecay hL hCL intro Q V ξ a hQ hQbound hV hξ ha have hL0 : 0 < L := by linarith calc _ ≤ (2 * C) * Real.exp (-(1 / 32 : ℝ) * L ^ c) * L ^ (4 * q + v + x) := prime_kernel_reproduction_error_majorant c C q v x L hc hC hL Q V ξ a hQ hQbound hV hξ ha _ ≤ L * Real.exp (-(1 / 32 : ℝ) * L ^ c) * L ^ (4 * q + v + x) := by gcongr _ = Real.exp (-(1 / 32 : ℝ) * L ^ c) * L ^ (4 * q + v + x + 1) := by rw [Real.rpow_add hL0 (4 * q + v + x) 1, Real.rpow_one] ring _ ≤ L ^ (-D) := hdecay end section open scoped BigOperators Classical theorem finite_subtype_sum_eq_of_zero_off {X M : Type*} [Fintype X] [AddCommMonoid M] (S : X → Prop) [DecidablePred S] (F : X → M) (hF : ∀ x, ¬ S x → F x = 0) : (∑ x : {x // S x}, F x.val) = ∑ x, F x := by exact (Finset.sum_congr_set {x | S x} F (fun x => F x.val) (fun _ _ => rfl) hF).symm theorem finite_subtype_sum_le_of_nonneg {X : Type*} [Fintype X] (S : X → Prop) [DecidablePred S] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) : (∑ x : {x // S x}, w x.val) ≤ ∑ x, w x := by rw [← Finset.sum_subtype (Finset.univ.filter S) (by simp)] exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) (fun x _ _ => hw x) theorem finite_subtype_fiber_mass_le {X : Type*} [Fintype X] (S : X → Prop) [DecidablePred S] (π : X → ℕ) (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (m : ℕ) : (∑ x ∈ Finset.univ.filter (fun x : {x // S x} => π x.val = m), μ x.val) ≤ ∑ x ∈ Finset.univ.filter (fun x => π x = m), μ x := by simp only [Finset.sum_filter] exact finite_subtype_sum_le_of_nonneg S (fun x => if π x = m then μ x else 0) (fun x => by split_ifs; exact hμ x; exact le_rfl) theorem finite_test_support_energy {X : Type*} [Fintype X] (μ : X → ℝ) (f : X → ℂ) : (∑ x : {x // f x ≠ 0}, μ x.val * ‖f x.val‖ ^ 2) = ∑ x, μ x * ‖f x‖ ^ 2 := by apply finite_subtype_sum_eq_of_zero_off (fun x => f x ≠ 0) (fun x => μ x * ‖f x‖ ^ 2) intro x hx have hf : f x = 0 := not_not.mp hx simp [hf] theorem finite_test_support_bilinear {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (f : X → ℂ) (g : Y → ℂ) (K : X → Y → ℂ) : (∑ x : {x // f x ≠ 0}, ∑ y : {y // g y ≠ 0}, ((μ x.val : ℂ) * f x.val) * ((ν y.val : ℂ) * g y.val) * K x.val y.val) = ∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * K x y := by calc _ = ∑ x : {x // f x ≠ 0}, ∑ y, ((μ x.val : ℂ) * f x.val) * ((ν y : ℂ) * g y) * K x.val y := by apply Finset.sum_congr rfl intro x _ apply finite_subtype_sum_eq_of_zero_off (fun y => g y ≠ 0) (fun y => ((μ x.val : ℂ) * f x.val) * ((ν y : ℂ) * g y) * K x.val y) intro y hy have hg : g y = 0 := not_not.mp hy simp [hg] _ = _ := by apply finite_subtype_sum_eq_of_zero_off (fun x => f x ≠ 0) (fun x => ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * K x y) intro x hx have hf : f x = 0 := not_not.mp hx simp [hf] end section theorem positive_log_distance_le_factor_two {p q : ℝ} (hp : 0 < p) (hq : 0 < q) (hlog : |Real.log p - Real.log q| ≤ Real.log 2) : q / 2 ≤ p ∧ p ≤ 2 * q := by have hh := abs_le.mp hlog have hq2 : 0 < 2 * q := mul_pos (by norm_num) hq have hp2 : 0 < 2 * p := mul_pos (by norm_num) hp have hupper : Real.log p ≤ Real.log (2 * q) := by rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) hq.ne'] linarith have hlower : Real.log q ≤ Real.log (2 * p) := by rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) hp.ne'] linarith have hu := (Real.log_le_log_iff hp hq2).mp hupper have hl := (Real.log_le_log_iff hq hp2).mp hlower constructor <;> linarith end section open Finset open scoped Classical theorem finite_coordinate_component_append {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (A : Finset I) (is js : List I) (f : (∀ i, X i) → ℂ) : finiteCoordinateComponent μ A (is ++ js) f = finiteCoordinateComponent μ A is (finiteCoordinateComponent μ A js f) := by induction is with | nil => rfl | cons i is ih => simp only [List.cons_append, finiteCoordinateComponent, ih] /- Probing all slots in A after averaging disjoint tail slots B is exactly the single component used by the quantitative probe bound. -/ theorem finite_probe_after_tail_component {I : Type*} [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (A B : Finset I) (hAB : Disjoint A B) (f : (∀ i, X i) → ℂ) : finiteCoordinateComponent μ A A.toList (finiteCoordinateComponent μ ∅ B.toList f) = finiteCoordinateComponent μ A (A ∪ B).toList f := by have hinner : finiteCoordinateComponent μ A B.toList f = finiteCoordinateComponent μ ∅ B.toList f := by apply finite_coordinate_component_congr intro i hi have hiB : i ∈ B := mem_toList.mp hi have hiA : i ∉ A := fun hiA => disjoint_left.mp hAB hiA hiB simp [hiA] rw [← hinner, ← finite_coordinate_component_append] apply finite_coordinate_component_perm have hdis : List.Disjoint A.toList B.toList := by intro i hiA hiB exact disjoint_left.mp hAB (mem_toList.mp hiA) (mem_toList.mp hiB) have hn : (A.toList ++ B.toList).Nodup := A.nodup_toList.append B.nodup_toList hdis apply List.perm_of_nodup_nodup_toFinset_eq hn (A ∪ B).nodup_toList simp theorem finite_symmetric_probe_tensor_tail_energy {G : Type*} [Fintype G] [DecidableEq G] {I X : G → Type*} [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)] [∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (hμ : ∀ g x, 0 ≤ μ g x) (hmass : ∀ g, ∑ x, μ g x = 1) (A B : ∀ g, Finset (I g)) (hAB : ∀ g, Disjoint (A g) (B g)) (m ell : ℕ) (hm : 0 < m) (hA : ∀ g, (A g).card = m) (hB : ∀ g, (B g).card = ell) (s t : Finset G) (f : (∀ g, I g → X g) → ℂ) (hf : ∀ g, finiteGroupSlotSymmetric g f) : finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) (finiteCoordinateFinsetAction (fun g v => finiteCoordinateComponent (fun _ : I g => μ g) ∅ (B g).toList v) t (finiteCoordinateFinsetAction (fun g v => finiteCoordinateComponent (fun _ : I g => μ g) (A g) (A g ∪ B g).toList v) s f)) ≤ (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ s.card) * finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f := by exact (finite_tensor_averaging_energy_le μ hμ hmass B t _).trans (finite_symmetric_probe_tensor_uniform μ hμ hmass A B hAB m ell hm hA hB s f hf) end section open Finset theorem dvd_twice_add_one_iff_zmod (d u : ℕ) : d ∣ 2 * u + 1 ↔ (-2 : ZMod d) * (u : ZMod d) = 1 := by rw [← ZMod.natCast_eq_zero_iff] push_cast constructor <;> intro h <;> linear_combination -h noncomputable def typeICharacterSum {Ω : Type*} (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) {d : ℕ} (χ : DirichletCharacter ℂ d) : ℂ := ∑ t ∈ T, μ t * χ (value t : ZMod d) noncomputable def typeINonprincipalRemainder {Ω : Type*} (d : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : ℂ := by classical exact ∑ χ ∈ (univ : Finset (DirichletCharacter ℂ d)).erase 1, χ (-2 : ZMod d) * typeICharacterSum T μ value χ noncomputable def typeINonprincipalNormSum {Ω : Type*} (d : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : ℝ := by classical exact ∑ χ ∈ (univ : Finset (DirichletCharacter ℂ d)).erase 1, ‖typeICharacterSum T μ value χ‖ theorem typeI_character_expansion {Ω : Type*} (d : ℕ) [NeZero d] (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : (d.totient : ℂ) * (∑ t ∈ T.filter (fun t => d ∣ 2 * value t + 1), μ t) = ∑ χ : DirichletCharacter ℂ d, χ (-2 : ZMod d) * typeICharacterSum T μ value χ := by classical symm calc _ = ∑ t ∈ T, μ t * ∑ χ : DirichletCharacter ℂ d, χ ((-2 : ZMod d) * (value t : ZMod d)) := by simp only [typeICharacterSum, mul_sum, map_mul] rw [sum_comm] apply sum_congr rfl intro t _ apply sum_congr rfl intro χ _ ring _ = ∑ t ∈ T, μ t * (if d ∣ 2 * value t + 1 then (d.totient : ℂ) else 0) := by apply sum_congr rfl intro t _ rw [DirichletCharacter.sum_characters_eq] simp only [← dvd_twice_add_one_iff_zmod] _ = _ := by rw [sum_filter, mul_sum]; apply sum_congr rfl; intro t _; split_ifs <;> ring theorem typeI_principal_character_sum {Ω : Type*} (d : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : typeICharacterSum T μ value (1 : DirichletCharacter ℂ d) = ∑ t ∈ T.filter (fun t => (value t).Coprime d), μ t := by classical rw [typeICharacterSum, sum_filter] apply sum_congr rfl intro t _ by_cases hcop : (value t).Coprime d · rw [if_pos hcop, MulChar.one_apply ((ZMod.isUnit_iff_coprime _ _).mpr hcop), mul_one] · rw [if_neg hcop, MulChar.map_nonunit _ (by simpa only [ZMod.isUnit_iff_coprime] using hcop), mul_zero] theorem typeI_principal_factor (d : ℕ) (hd : Odd d) : (1 : DirichletCharacter ℂ d) (-2 : ZMod d) = 1 := by apply MulChar.one_apply exact (show IsUnit (2 : ZMod d) from (ZMod.isUnit_iff_coprime 2 d).mpr hd.coprime_two_left).neg theorem typeI_character_decomposition {Ω : Type*} (d : ℕ) [NeZero d] (hd : Odd d) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : (d.totient : ℂ) * (∑ t ∈ T.filter (fun t => d ∣ 2 * value t + 1), μ t) = (∑ t ∈ T.filter (fun t => (value t).Coprime d), μ t) + typeINonprincipalRemainder d T μ value := by classical have hsum := sum_erase_add univ (fun χ : DirichletCharacter ℂ d => χ (-2 : ZMod d) * typeICharacterSum T μ value χ) (mem_univ (1 : DirichletCharacter ℂ d)) have hrem : (∑ χ ∈ (univ : Finset (DirichletCharacter ℂ d)).erase 1, χ (-2 : ZMod d) * typeICharacterSum T μ value χ) = typeINonprincipalRemainder d T μ value := by unfold typeINonprincipalRemainder apply sum_congr · ext χ simp only [mem_erase, mem_univ, and_true] · intro χ _ rfl rw [typeI_character_expansion, ← hsum, typeI_principal_factor d hd, one_mul, typeI_principal_character_sum, hrem] exact add_comm (typeINonprincipalRemainder d T μ value) (∑ t ∈ T.filter (fun t => (value t).Coprime d), μ t) theorem typeI_nonprincipal_remainder_norm_le {Ω : Type*} (d : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : ‖typeINonprincipalRemainder d T μ value‖ ≤ typeINonprincipalNormSum d T μ value := by classical apply (norm_sum_le _ _).trans apply sum_le_sum intro χ _ rw [norm_mul] exact mul_le_of_le_one_left (norm_nonneg _) (χ.norm_le_one _) theorem typeI_deviation_le {Ω : Type*} (d : ℕ) [NeZero d] (hd : Odd d) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : ‖(∑ t ∈ T.filter (fun t => d ∣ 2 * value t + 1), μ t) - (∑ t ∈ T.filter (fun t => (value t).Coprime d), μ t) / (d.totient : ℂ)‖ ≤ typeINonprincipalNormSum d T μ value / (d.totient : ℝ) := by have hφ : (d.totient : ℂ) ≠ 0 := by exact_mod_cast (Nat.totient_pos.mpr (Nat.pos_of_ne_zero (NeZero.ne d))).ne' have heq : (∑ t ∈ T.filter (fun t => d ∣ 2 * value t + 1), μ t) - (∑ t ∈ T.filter (fun t => (value t).Coprime d), μ t) / (d.totient : ℂ) = typeINonprincipalRemainder d T μ value / (d.totient : ℂ) := by apply (eq_div_iff hφ).mpr have h := typeI_character_decomposition d hd T μ value field_simp linear_combination h rw [heq, norm_div, Complex.norm_natCast] exact div_le_div_of_nonneg_right (typeI_nonprincipal_remainder_norm_le d T μ value) (Nat.cast_nonneg _) theorem typeI_real_deviation_le {Ω : Type*} (d : ℕ) [NeZero d] (hd : Odd d) (T : Finset Ω) (μ : Ω → ℝ) (value : Ω → ℕ) : |(∑ t ∈ T.filter (fun t => d ∣ 2 * value t + 1), μ t) - (∑ t ∈ T.filter (fun t => (value t).Coprime d), μ t) / (d.totient : ℝ)| ≤ typeINonprincipalNormSum d T (fun t => (μ t : ℂ)) value / (d.totient : ℝ) := by have h := typeI_deviation_le d hd T (fun t => (μ t : ℂ)) value have hcast : (((∑ t ∈ T.filter (fun t => d ∣ 2 * value t + 1), μ t) - (∑ t ∈ T.filter (fun t => (value t).Coprime d), μ t) / (d.totient : ℝ) : ℝ) : ℂ) = (∑ t ∈ T.filter (fun t => d ∣ 2 * value t + 1), (μ t : ℂ)) - (∑ t ∈ T.filter (fun t => (value t).Coprime d), (μ t : ℂ)) / (d.totient : ℂ) := by push_cast rfl rw [← hcast] at h simpa only [Complex.norm_real, Real.norm_eq_abs] using h end section open Finset theorem nonprincipal_conductor_one_lt {d : ℕ} [NeZero d] (χ : DirichletCharacter ℂ d) (hχ : χ ≠ 1) : 1 < χ.conductor := by have h0 := χ.conductor_ne_zero have h1 : χ.conductor ≠ 1 := fun h => hχ (χ.eq_one_iff_conductor_eq_one.mpr h) omega theorem nonprincipal_primitiveCharacter_ne_one {d : ℕ} (χ : DirichletCharacter ℂ d) (hχ : χ ≠ 1) : χ.primitiveCharacter ≠ 1 := by intro h apply hχ rw [← χ.changeLevel_primitiveCharacter, h, map_one] theorem character_conductor_mul_complement {d : ℕ} (χ : DirichletCharacter ℂ d) : χ.conductor * (d / χ.conductor) = d := Nat.mul_div_cancel' χ.conductor_dvd_level theorem character_apply_eq_primitive_mul_coprime {d : ℕ} (χ : DirichletCharacter ℂ d) (n : ℕ) : χ (n : ZMod d) = χ.primitiveCharacter (n : ZMod χ.conductor) * (if n.Coprime (d / χ.conductor) then (1 : ℂ) else 0) := by by_cases hnd : n.Coprime d · have hnh := hnd.of_dvd_right (Nat.div_dvd_of_dvd χ.conductor_dvd_level) rw [if_pos hnh, mul_one] have h := χ.primitiveCharacter_apply_of_isCoprime (Nat.isCoprime_iff_coprime.mpr hnd) simpa only [Int.cast_natCast] using h.symm · have hzero : χ (n : ZMod d) = 0 := by have h := (χ.apply_eq_zero_iff (n : ℤ)).mpr (by simpa only [Nat.isCoprime_iff_coprime] using hnd) simpa only [Int.cast_natCast] using h rw [hzero] by_cases hnh : n.Coprime (d / χ.conductor) · have hnf : ¬ n.Coprime χ.conductor := by intro hnf apply hnd have h := hnf.mul_right hnh rwa [character_conductor_mul_complement] at h have hz : χ.primitiveCharacter (n : ZMod χ.conductor) = 0 := by have h := (χ.primitiveCharacter.apply_eq_zero_iff (n : ℤ)).mpr (by simpa only [Nat.isCoprime_iff_coprime] using hnf) simpa only [Int.cast_natCast] using h rw [hz, zero_mul] · rw [if_neg hnh, mul_zero] theorem character_weighted_sum_eq_primitive_filtered {Ω : Type*} {d : ℕ} (χ : DirichletCharacter ℂ d) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : (∑ t ∈ T, μ t * χ (value t : ZMod d)) = ∑ t ∈ T.filter (fun t => (value t).Coprime (d / χ.conductor)), μ t * χ.primitiveCharacter (value t : ZMod χ.conductor) := by rw [sum_filter] apply sum_congr rfl intro t _ rw [character_apply_eq_primitive_mul_coprime] split_ifs <;> simp end section open Finset theorem finite_euler_correction_product_lower (S : Finset ℕ) (hS : ∀ n ∈ S, 2 ≤ n) : (1 / 2 : ℝ) ≤ ∏ n ∈ S, (1 - 1 / (n : ℝ)^2) := by have hnonneg : 0 ≤ ∏ n ∈ S, (1 - 1 / (n : ℝ)^2) := by apply prod_nonneg intro n hn have hn2 : (2 : ℝ) ≤ n := by exact_mod_cast hS n hn apply sub_nonneg.mpr apply (div_le_one (by nlinarith : (0 : ℝ) < (n : ℝ)^2)).mpr nlinarith have hid : (∏ n ∈ S, (1 - 1 / (n : ℝ)^2)) * (∏ n ∈ S, (1 + 1 / ((n : ℝ)^2 - 1))) = 1 := by rw [← prod_mul_distrib] apply prod_eq_one intro n hn have hn2 : (2 : ℝ) ≤ n := by exact_mod_cast hS n hn have h0 : (n : ℝ)^2 ≠ 0 := by nlinarith have h1 : (n : ℝ)^2 - 1 ≠ 0 := by nlinarith field_simp ring have hmul := mul_le_mul_of_nonneg_left (euler_correction_product_le_two S hS) hnonneg rw [hid] at hmul linarith section variable (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) include P hP theorem finite_prime_avoidance_product_pos : 0 < ∏ p ∈ P, (1 - 1 / (p : ℝ)) := by apply prod_pos intro p hp have hp1 : (1 : ℝ) < p := by exact_mod_cast (hP p hp).one_lt apply sub_pos.mpr exact (div_lt_one (by linarith)).mpr hp1 theorem finite_prime_avoidance_product_lower {z : ℝ} (hz : 1 ≤ z) (hbound : ∀ p ∈ P, (p : ℝ) ≤ z) : 1 / ((2 * primeEulerProductUpperConstant) * Real.log (2 * z)) ≤ ∏ p ∈ P, (1 - 1 / (p : ℝ)) := by have hpos := finite_prime_avoidance_product_pos P hP have hden : 0 < (2 * primeEulerProductUpperConstant) * Real.log (2 * z) := by apply mul_pos (mul_pos (by norm_num) primeEulerProductUpperConstant_pos) exact Real.log_pos (by linarith) have hid : (∏ p ∈ P, (1 - 1 / (p : ℝ))) * (∏ p ∈ P, (1 + 1 / ((p : ℝ) - 1))) = 1 := by rw [← prod_mul_distrib] apply prod_eq_one intro p hp have hp1 : (1 : ℝ) < p := by exact_mod_cast (hP p hp).one_lt have h0 : (p : ℝ) ≠ 0 := by linarith have h1 : (p : ℝ) - 1 ≠ 0 := by linarith field_simp ring have hm := mul_le_mul_of_nonneg_left (finite_inverse_prime_euler_product_le_log P hP hz hbound) hpos.le rw [hid] at hm exact (div_le_iff₀ hden).mpr hm theorem finite_odd_prime_correction_product_lower (hodd : ∀ p ∈ P, p ≠ 2) : (1 / 2 : ℝ) ≤ ∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1)^2) := by have hp3 : ∀ p ∈ P, 3 ≤ p := by intro p hp have := (hP p hp).two_le have := hodd p hp omega have hpred : ∀ n ∈ P.image (fun p : ℕ => (p - 1 : ℕ)), 2 ≤ n := by intro n hn obtain ⟨p, hp, rfl⟩ := mem_image.mp hn have := hp3 p hp omega have hinj : Set.InjOn (fun p : ℕ => (p - 1 : ℕ)) P := by intro p hp q hq heq change p - 1 = q - 1 at heq have := hp3 p hp have := hp3 q hq omega have heq : (∏ n ∈ P.image (fun p : ℕ => (p - 1 : ℕ)), (1 - 1 / (n : ℝ)^2)) = ∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1)^2) := by rw [prod_image hinj] apply prod_congr rfl intro p hp rw [Nat.cast_sub (hP p hp).one_le, Nat.cast_one] rw [← heq] exact finite_euler_correction_product_lower _ hpred theorem finite_odd_prime_predecessor_avoidance_product_lower (hodd : ∀ p ∈ P, p ≠ 2) {z : ℝ} (hz : 1 ≤ z) (hbound : ∀ p ∈ P, (p : ℝ) ≤ z) : 1 / ((4 * primeEulerProductUpperConstant) * Real.log (2 * z)) ≤ ∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1)) := by have hfactor : (∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1))) = (∏ p ∈ P, (1 - 1 / (p : ℝ))) * (∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1)^2)) := by rw [← prod_mul_distrib] apply prod_congr rfl intro p hp have hp1 : (1 : ℝ) < p := by exact_mod_cast (hP p hp).one_lt have h0 : (p : ℝ) ≠ 0 := by linarith have h1 : (p : ℝ) - 1 ≠ 0 := by linarith field_simp ring have hlog : 0 < Real.log (2 * z) := Real.log_pos (by linarith) calc _ = (1 / ((2 * primeEulerProductUpperConstant) * Real.log (2 * z))) * (1/2) := by ring _ ≤ (∏ p ∈ P, (1 - 1 / (p : ℝ))) * (∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1)^2)) := mul_le_mul (finite_prime_avoidance_product_lower P hP hz hbound) (finite_odd_prime_correction_product_lower P hP hodd) (by norm_num) (finite_prime_avoidance_product_pos P hP).le _ = _ := hfactor.symm theorem finite_odd_prime_predecessor_avoidance_product_pos (hodd : ∀ p ∈ P, p ≠ 2) : 0 < ∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1)) := by apply prod_pos intro p hp have hp3 : 3 ≤ p := by have := (hP p hp).two_le have := hodd p hp omega have hp3R : (3 : ℝ) ≤ p := by exact_mod_cast hp3 apply sub_pos.mpr exact (div_lt_one (by linarith)).mpr (by linarith) end end section open Finset noncomputable def shiftedTotientSieveRemainder (T : Finset ℕ) (μ : ℕ → ℝ) (d : ℕ) : ℝ := (∑ u ∈ T.filter (fun u => d ∣ 2*u + 1), μ u) - (∑ u ∈ T, μ u) / (Nat.totient d : ℝ) theorem shifted_totient_intersection_moment (T S : Finset ℕ) (μ : ℕ → ℝ) (hS : ∀ p ∈ S, p.Prime) : (∑ u ∈ T.filter (fun u => ∀ p ∈ S, p ∣ 2*u + 1), μ u) = (∑ u ∈ T, μ u) * (∏ p ∈ S, 1 / ((p : ℝ) - 1)) + shiftedTotientSieveRemainder T μ (∏ p ∈ S, p) := by have hf : T.filter (fun u => ∀ p ∈ S, p ∣ 2*u + 1) = T.filter (fun u => (∏ p ∈ S, p) ∣ 2*u + 1) := by apply filter_congr intro u _ exact (prime_subset_product_dvd_iff S hS (2*u + 1)).symm rw [hf, ← totient_sieve_prime_product_reciprocal S hS] unfold shiftedTotientSieveRemainder ring theorem exists_shifted_totient_prime_sieve : ∃ K : ℝ, 0 < K ∧ ∀ (P T : Finset ℕ) (μ : ℕ → ℝ) {z : ℝ} {h : ℕ}, 1 < z → 1 ≤ h → Even h → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, p ≠ 2) → (∀ p ∈ P, (p : ℝ) ≤ z) → (∀ u ∈ T, 0 ≤ μ u) → |(∑ u ∈ T.filter (fun u => ∀ p ∈ P, ¬p ∣ 2*u + 1), μ u) - (∑ u ∈ T, μ u) * (∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1)))| ≤ (∑ u ∈ T, μ u) * (∏ p ∈ P, (1 - 1 / ((p : ℝ) - 1))) * K * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli P (z^(4 * (h : ℝ) + 2)), |shiftedTotientSieveRemainder T μ d| := by obtain ⟨K, hK, hsieve⟩ := exists_odd_prime_reciprocal_sieve_events refine ⟨K, hK, ?_⟩ intro P T μ z h hz hh heven hP hodd hPz hμ apply hsieve P T μ (fun u p => p ∣ 2*u + 1) (shiftedTotientSieveRemainder T μ) hz (sum_nonneg hμ) hh heven hP hodd hPz hμ intro S hS exact shifted_totient_intersection_moment T S μ (fun p hp => hP p ((mem_powerset.mp hS) hp)) noncomputable def shiftedRoughSet (T : Finset ℕ) (z : ℝ) : Finset ℕ := by classical exact T.filter (fun u : ℕ => ∀ p : ℕ, p ∈ (2*u + 1).primeFactors → z < (p : ℝ)) theorem mem_shifted_rough_set_iff (T : Finset ℕ) (z : ℝ) (u : ℕ) : u ∈ shiftedRoughSet T z ↔ u ∈ T ∧ ∀ p ∈ (2*u + 1).primeFactors, z < (p : ℝ) := by classical simp only [shiftedRoughSet, mem_filter] theorem exists_shifted_totient_rough_sieve : ∃ K : ℝ, 0 < K ∧ ∀ (T : Finset ℕ) (μ : ℕ → ℝ) {z : ℝ} {h : ℕ}, 1 < z → 1 ≤ h → Even h → (∀ u ∈ T, 0 ≤ μ u) → |(∑ u ∈ shiftedRoughSet T z, μ u) - (∑ u ∈ T, μ u) * (∏ p ∈ (primeBand 0 z).erase 2, (1 - 1 / ((p : ℝ) - 1)))| ≤ (∑ u ∈ T, μ u) * (∏ p ∈ (primeBand 0 z).erase 2, (1 - 1 / ((p : ℝ) - 1))) * K * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli ((primeBand 0 z).erase 2) (z^(4 * (h : ℝ) + 2)), |shiftedTotientSieveRemainder T μ d| := by classical obtain ⟨K, hK, hsieve⟩ := exists_shifted_totient_prime_sieve refine ⟨K, hK, ?_⟩ intro T μ z h hz hh heven hμ have hz0 : 0 ≤ z := le_trans (by norm_num) hz.le have hb := hsieve ((primeBand 0 z).erase 2) T μ hz hh heven (fun p hp => small_prime_pool_prime (mem_of_mem_erase hp)) (fun p hp => (mem_erase.mp hp).1) (fun p hp => small_prime_pool_le hz0 (mem_of_mem_erase hp)) hμ have hf : T.filter (fun u => ∀ p ∈ (primeBand 0 z).erase 2, ¬p ∣ 2*u + 1) = shiftedRoughSet T z := by ext u simp only [mem_filter, mem_shifted_rough_set_iff] exact and_congr_right (fun _ => two_mul_add_one_odd_prime_avoidance_iff_rough u hz0) rw [hf] at hb exact hb end section open Finset theorem sieve_modulus_mem_factoredNumbers (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {D : ℝ} {d : ℕ} (hd : d ∈ blockSieveModuli P D) : d ∈ Nat.factoredNumbers P := by exact Nat.mem_factoredNumbers_of_primeFactors_subset (Nat.ne_of_gt (block_sieve_modulus_properties P hP D hd).1) (block_sieve_modulus_primeFactors_subset P hP D hd) theorem external_prime_coprime_sieve_modulus (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) {p d : ℕ} {D : ℝ} (hp : p.Prime) (hout : p ∉ P) (hd : d ∈ blockSieveModuli P D) : Nat.Coprime p d := by apply hp.coprime_iff_not_dvd.mpr intro hdiv apply hout apply block_sieve_modulus_primeFactors_subset P hP D hd exact hp.mem_primeFactors hdiv (Nat.ne_of_gt (block_sieve_modulus_properties P hP D hd).1) theorem separated_prime_sieve_product_injective (P Q : Finset ℕ) (D : ℝ) (hP : ∀ p ∈ P, p.Prime) (hQ : ∀ p ∈ Q, p.Prime) (hout : ∀ p ∈ Q, p ∉ P) : Set.InjOn (fun x : ℕ × ℕ => x.1 * x.2) (Q.product (blockSieveModuli P D)) := by intro x hx y hy hxy obtain ⟨hxp, hxd⟩ := mem_product.mp hx obtain ⟨hyp, hyd⟩ := mem_product.mp hy have hxfree : Disjoint x.1.primeFactors P := by rw [(hQ x.1 hxp).primeFactors] exact disjoint_singleton_left.mpr (hout x.1 hxp) have hyfree : Disjoint y.1.primeFactors P := by rw [(hQ y.1 hyp).primeFactors] exact disjoint_singleton_left.mpr (hout y.1 hyp) obtain ⟨hd, hp⟩ := supported_free_product_unique (sieve_modulus_mem_factoredNumbers P hP hxd) (hQ x.1 hxp).ne_zero hxfree (sieve_modulus_mem_factoredNumbers P hP hyd) (hQ y.1 hyp).ne_zero hyfree (by simpa only [mul_comm] using hxy) exact Prod.ext hp hd end section open scoped BigOperators Classical theorem finite_probability_pairing_bound {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (hμmass : ∑ x, μ x = 1) (hνmass : ∑ y, ν y = 1) (K : X → Y → ℂ) {M : ℝ} (hM : 0 ≤ M) (hK : ∀ x y, ‖K x y‖ ≤ M) (f : X → ℂ) (g : Y → ℂ) : ‖∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * (K x y * f x * g y)‖ ≤ M * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by rcases eq_or_lt_of_le hM with hM0 | hMp · have hz (x : X) (y : Y) : K x y = 0 := norm_le_zero_iff.mp (by simpa [← hM0] using hK x y) simp [hz, ← hM0] have hMc : (M : ℂ) ≠ 0 := by exact_mod_cast hMp.ne' let K' := fun x y => K x y / (M : ℂ) have hK' (x : X) (y : Y) : ‖K' x y‖ ≤ 1 := by dsimp only [K'] rw [norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hMp] exact (div_le_one hMp).mpr (hK x y) have h := finite_pair_event_pairing_le μ ν hμ hν (fun _ _ => True) K' hK' f g have hmass : finitePairEventMass μ ν (fun _ _ => True) = 1 := by simp only [finitePairEventMass, if_true, ← Finset.mul_sum, hνmass, mul_one, hμmass] rw [hmass, Real.sqrt_one, one_mul] at h simp only [if_true] at h have he : (∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * (K x y * f x * g y)) = (M : ℂ) * ∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * (K' x y * f x * g y) := by simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ dsimp only [K'] field_simp rw [he, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hMp] exact mul_le_mul_of_nonneg_left h hM theorem finite_retained_comparison_pairing {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (hμmass : ∑ x, μ x = 1) (hνmass : ∑ y, ν y = 1) (E : X → Y → Prop) (raw comparison : X → Y → ℂ) (hraw : ∀ x y, ‖raw x y‖ ≤ 1) (hzero : ∀ x y, E x y → comparison x y = 0) {ε : ℝ} (hε : 0 ≤ ε) (hclose : ∀ x y, ¬E x y → ‖raw x y - comparison x y‖ ≤ ε) (f : X → ℂ) (g : Y → ℂ) : ‖∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * ((raw x y - comparison x y) * f x * g y)‖ ≤ (Real.sqrt (finitePairEventMass μ ν E) + ε) * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by let keep := fun x y => if E x y then (0 : ℂ) else raw x y - comparison x y have hk (x : X) (y : Y) : ‖keep x y‖ ≤ ε := by dsimp only [keep] split_ifs with h · simpa only [norm_zero] using hε · exact hclose x y h have hr := finite_pair_event_pairing_le μ ν hμ hν E raw hraw f g have hc := finite_probability_pairing_bound μ ν hμ hν hμmass hνmass keep hε hk f g have he : (∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * ((raw x y - comparison x y) * f x * g y)) = (∑ x, ∑ y, if E x y then ((μ x * ν y : ℝ) : ℂ) * (raw x y * f x * g y) else 0) + ∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * (keep x y * f x * g y) := by simp only [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ by_cases h : E x y <;> simp [keep, h, hzero x y] rw [he] exact (norm_add_le _ _).trans ((add_le_add hr hc).trans_eq (by ring)) theorem finite_retained_comparison_pairing_supported {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (hμmass : ∑ x, μ x = 1) (hνmass : ∑ y, ν y = 1) (E : X → Y → Prop) (raw comparison : X → Y → ℂ) (hraw : ∀ x y, ‖raw x y‖ ≤ 1) (hzero : ∀ x y, E x y → comparison x y = 0) (f : X → ℂ) (g : Y → ℂ) {ε : ℝ} (hε : 0 ≤ ε) (hclose : ∀ x y, f x ≠ 0 → g y ≠ 0 → ¬E x y → ‖raw x y - comparison x y‖ ≤ ε) : ‖∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * ((raw x y - comparison x y) * f x * g y)‖ ≤ (Real.sqrt (finitePairEventMass μ ν E) + ε) * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by let cut := fun x y => f x ≠ 0 ∧ g y ≠ 0 let raw' := fun x y => if cut x y then raw x y else 0 let comparison' := fun x y => if cut x y then comparison x y else 0 have hr (x : X) (y : Y) : ‖raw' x y‖ ≤ 1 := by dsimp only [raw'] split_ifs · exact hraw x y · simp have hz (x : X) (y : Y) (he : E x y) : comparison' x y = 0 := by simp only [comparison', hzero x y he, ite_self] have hc (x : X) (y : Y) (he : ¬E x y) : ‖raw' x y - comparison' x y‖ ≤ ε := by dsimp only [raw', comparison'] split_ifs with hcut · exact hclose x y hcut.1 hcut.2 he · simpa only [sub_self, norm_zero] using hε have he (x : X) (y : Y) : (raw' x y - comparison' x y) * f x * g y = (raw x y - comparison x y) * f x * g y := by by_cases hx : f x = 0 · simp [hx] by_cases hy : g y = 0 · simp [hy] simp [raw', comparison', cut, hx, hy] simpa only [he] using finite_retained_comparison_pairing μ ν hμ hν hμmass hνmass E raw' comparison' hr hz hε hc f g end section open Finset open scoped Classical noncomputable def jointRawTensorCutoff {N : ℕ} {P : Fin N → Type*} {R : (g : Fin N) → P g → Type*} (B : ℕ) (row : (g : Fin N) → (GlobalBirthHistoryState (R g) → ℂ) → GlobalBirthHistoryState (R g) → ℂ) (F : GlobalBirthJointState R → ℂ) (s : GlobalBirthJointState R) : ℂ := globalBirthJointRawCutoff B (finTensorRow N row (globalBirthJointRawCutoff B F)) s section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) (Δ D : Fin N → ℤ) (t : Fin N → ℕ) (B : ℕ) (source target : (g : Fin N) → Fin (t g) → P g) (H : (g : Fin N) → Finset (P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (n g)) B) noncomputable def jointStateEdgeRawTarget (e : UnrestrictedJointEvent n Δ D t B (fun g => (source g, q g))) : GlobalBirthJointState (fun g p => ZMod (n g p)) := fun g => let u := unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B (source g, q g) (e g) (H g ∪ univ.image u.1, boundedOrderedTupleToFinite u.2) noncomputable def jointStateEdgePhase (e : UnrestrictedJointEvent n Δ D t B (fun g => (source g, q g))) : ℂ := ∏ g, globalBirthBoundedEdgePhase (n g) (Δ g) (D g) (t g) B (target g) (H g) (source g, q g) (e g).1 (e g).2.1 (e g).2.2.1 (e g).2.2.2 theorem joint_raw_tensor_cutoff_edge_events (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (row : (g : Fin N) → (GlobalBirthHistoryState (fun p => ZMod (n g p)) → ℂ) → GlobalBirthHistoryState (fun p => ZMod (n g p)) → ℂ) (hrows : ∀ g (K : GlobalBirthHistoryState (fun p => ZMod (n g p)) → ℂ), row g K (H g, boundedOrderedTupleToFinite (q g)) = ∑ e : UnrestrictedBoundedEvent (n g) (Δ g) (D g) (t g) B (source g, q g), (unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (fun p => β g p / V g) ρ (V g) (t g) B (source g, q g) e : ℂ) * globalBirthBoundedEdgePhase (n g) (Δ g) (D g) (t g) B (target g) (H g) (source g, q g) e.1 e.2.1 e.2.2.1 e.2.2.2 * K (H g ∪ univ.image (unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B (source g, q g) e).1, boundedOrderedTupleToFinite (unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B (source g, q g) e).2)) (F : GlobalBirthJointState (fun g p => ZMod (n g p)) → ℂ) : jointRawTensorCutoff B row F (fun g => (H g, boundedOrderedTupleToFinite (q g))) = ∑ e : UnrestrictedJointEvent n Δ D t B (fun g => (source g, q g)), (unrestrictedJointCutoffEventWeight n Δ D (fun g p => β g p / V g) ρ V t B (fun g => (source g, q g)) e : ℂ) * jointStateEdgePhase n Δ D t B source target H q e * F (jointStateEdgeRawTarget n Δ D t B source H q e) := by have hr := fin_tensor_row_events_at N row (fun g => (H g, boundedOrderedTupleToFinite (q g))) (fun g => UnrestrictedBoundedEvent (n g) (Δ g) (D g) (t g) B (source g, q g)) (fun g e => (H g ∪ univ.image (unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B (source g, q g) e).1, boundedOrderedTupleToFinite (unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B (source g, q g) e).2)) (fun g e => (unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (fun p => β g p / V g) ρ (V g) (t g) B (source g, q g) e : ℂ) * globalBirthBoundedEdgePhase (n g) (Δ g) (D g) (t g) B (target g) (H g) (source g, q g) e.1 e.2.1 e.2.2.1 e.2.2.2) hrows (globalBirthJointRawCutoff B F) simp only [prod_mul_distrib, ← Complex.ofReal_prod] at hr change finTensorRow N row (globalBirthJointRawCutoff B F) (fun g => (H g, boundedOrderedTupleToFinite (q g))) = ∑ e : UnrestrictedJointEvent n Δ D t B (fun g => (source g, q g)), ((∏ g, unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (fun p => β g p / V g) ρ (V g) (t g) B (source g, q g) (e g) : ℝ) : ℂ) * jointStateEdgePhase n Δ D t B source target H q e * globalBirthJointRawCutoff B F (jointStateEdgeRawTarget n Δ D t B source H q e) at hr unfold jointRawTensorCutoff change (if productTotalMemory (fun g => (source g, q g)) ≤ B then finTensorRow N row (globalBirthJointRawCutoff B F) (fun g => (H g, boundedOrderedTupleToFinite (q g))) else 0) = _ rw [hr] have hout (e : UnrestrictedJointEvent n Δ D t B (fun g => (source g, q g))) : globalBirthJointRawCutoff B F (jointStateEdgeRawTarget n Δ D t B source H q e) = if productTotalMemory (unrestrictedJointEventTarget n Δ D t B (fun g => (source g, q g)) e) ≤ B then F (jointStateEdgeRawTarget n Δ D t B source H q e) else 0 := rfl simp only [hout] unfold unrestrictedJointCutoffEventWeight by_cases hi : productTotalMemory (fun g => (source g, q g)) ≤ B · rw [if_pos hi] apply sum_congr rfl intro e _ by_cases ho : productTotalMemory (unrestrictedJointEventTarget n Δ D t B (fun g => (source g, q g)) e) ≤ B · have hb : productTotalMemory (fun g => (source g, q g)) ≤ B ∧ productTotalMemory (unrestrictedJointEventTarget n Δ D t B (fun g => (source g, q g)) e) ≤ B := ⟨hi, ho⟩ rw [if_pos ho, if_pos hb] · have hb : ¬ (productTotalMemory (fun g => (source g, q g)) ≤ B ∧ productTotalMemory (unrestrictedJointEventTarget n Δ D t B (fun g => (source g, q g)) e) ≤ B) := fun h => ho h.2 rw [if_neg ho, if_neg hb] simp only [mul_zero, Complex.ofReal_zero, zero_mul] · rw [if_neg hi] symm apply sum_eq_zero intro e _ have hb : ¬ (productTotalMemory (fun g => (source g, q g)) ≤ B ∧ productTotalMemory (unrestrictedJointEventTarget n Δ D t B (fun g => (source g, q g)) e) ≤ B) := fun h => hi h.1 rw [if_neg hb] simp only [Complex.ofReal_zero, zero_mul] end Joint end section open Finset open scoped Classical section Full variable {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → Fin N → ℤ) (H : (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) noncomputable def fullEdgeLedgerUpdate (e : FullActiveEdgeEvent n S B A Δ D x) : (g : Fin N) → Finset (P g) := fun g => H g ∪ univ.image ((productActiveMemorySplit S B (fullActiveEdgeEventTarget n S B A Δ D x e)).2 g).1 noncomputable def fullEdgeLedgerRawTarget (e : FullActiveEdgeEvent n S B A Δ D x) : GlobalBirthJointState (fun g p => ZMod (n g p)) := fun g => (fullEdgeLedgerUpdate n S B A Δ D H x e g, boundedOrderedTupleToFinite (fullActiveEdgeEventTarget n S B A Δ D x e g).2) theorem full_edge_ledger_raw_target_eq (e : FullActiveEdgeEvent n S B A Δ D x) : fullEdgeLedgerRawTarget n S B A Δ D H x e = fun g => let u := unrestrictedBoundedEventTarget (n g) (Δ (productActiveMemorySplit S B x).1 e.1 g) (D (productActiveMemorySplit S B x).1 e.1 g) (S g)ᶜ.card B ((productActiveMemorySplit S B x).2 g) (e.2 g) (H g ∪ univ.image u.1, boundedOrderedTupleToFinite u.2) := by unfold fullEdgeLedgerRawTarget fullEdgeLedgerUpdate fullActiveEdgeEventTarget simp only [Equiv.apply_symm_apply] rfl end Full end section open scoped BigOperators Classical noncomputable def unitAddCharDirichlet {r : ℕ} (ψ : AddChar (Additive (ZMod r)ˣ) ℂ) : DirichletCharacter ℂ r := dirichletOfUnitCharacter (addCharOfMulToMonoidHom ψ) theorem unit_add_char_dirichlet_apply {r : ℕ} (ψ : AddChar (Additive (ZMod r)ˣ) ℂ) (v : (ZMod r)ˣ) : unitAddCharDirichlet ψ (v : ZMod r) = ψ (Additive.ofMul v) := by exact dirichletOfUnitCharacter_apply _ v theorem finite_unit_character_expansion {r Q : ℕ} (hr : 0 < r) (hrQ : r ≤ Q) (F : ZMod r → ℂ) (hF : ∀ v : (ZMod r)ˣ, ‖F v‖ ≤ 1) : ∃ c : AddChar (Additive (ZMod r)ˣ) ℂ → ℂ, (∑ ψ, ‖c ψ‖) ≤ Real.sqrt (Q : ℝ) ∧ ∀ n : ℕ, n.Coprime r → (∑ ψ, c ψ * unitAddCharDirichlet ψ (n : ZMod r)) = F (n : ZMod r) := by let : NeZero r := ⟨Nat.ne_of_gt hr⟩ let f : Additive (ZMod r)ˣ → ℂ := fun v => F (v.toMul : ZMod r) refine ⟨finiteCharacterCoefficient f, ?_, ?_⟩ · apply (finite_character_coefficient_l1 f (fun v => hF v.toMul)).trans apply Real.sqrt_le_sqrt have hc : Fintype.card (Additive (ZMod r)ˣ) = r.totient := by rw [Fintype.card_additive, ZMod.card_units_eq_totient] rw [hc] exact_mod_cast (Nat.totient_le r).trans hrQ · intro n hn have he := finite_character_expansion f (Additive.ofMul (ZMod.unitOfCoprime n hn)) simpa only [← unit_add_char_dirichlet_apply, ZMod.coe_unitOfCoprime, f, toMul_ofMul] using he end section open scoped BigOperators Classical theorem prime_product_ideal_dirichlet_reproduction (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → p.Prime ∧ Q < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h ξ : ℝ, 0 < h → 0 < ξ → ∀ kept : Finset ℤ, (∀ d ∈ kept, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) → ∀ q : ℕ, 0 < q → q ≤ Q → ∀ (χ : DirichletCharacter ℂ q) (y : ∀ j, P j), upperLogCell h (Real.log (∏ j, (y j).val : ℕ)) ∈ kept → ‖(∑ x, (finiteProductWeight (physicalLabelLaw V) x : ℂ) * primeProductIdealKernel P V Q h kept x y * χ ((∏ j, (x j).val : ℕ) : ZMod q)) - χ ((∏ j, (y j).val : ℕ) : ZMod q)‖ ≤ (Q * Q : ℕ) * (((C / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) := by obtain ⟨C, hC, hbnd⟩ := prime_product_ideal_character_reproduction hZ refine ⟨C, hC, ?_⟩ intro Q hQ I _ _ P V i hV hp hmass a b hPi ha hb h ξ hh hξ kept hkept q hq hqQ χ y hy obtain ⟨t, _, ht⟩ := bounded_primitive_inducing hq hqQ χ have heval (x : ∀ j, P j) : boundedPrimitiveValue t ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus t)) = χ ((∏ j, (x j).val : ℕ) : ZMod q) := by apply ht exact Nat.coprime_prod_left_iff.mpr (fun j _ => prime_above_modulus_coprime (hp j (x j).val (x j).property).1 hq hqQ (hp j (x j).val (x j).property).2) simpa only [heval] using hbnd Q hQ P V i hV hp hmass a b hPi ha hb h ξ hh hξ kept hkept t y hy end section open Finset open scoped Classical noncomputable def cleanSignedPatternBlock {I J : Type*} [DecidableEq I] [DecidableEq J] (U : Finset I) (V : Finset J) (r : Finset I → Finset J → ℂ) (q : Finset I → Finset J → Finset I → Finset J → ℂ) : ℂ := (∑ S ∈ U.powerset, ∑ T ∈ V.powerset, r S T) - ∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card) * (∑ S ∈ U.powerset, ∑ T ∈ V.powerset, q S T A B) theorem clean_comparison_sum_restrict {I J : Type*} [DecidableEq I] [DecidableEq J] (U : Finset I) (V : Finset J) (q : Finset I → Finset J → ℂ) (S : Finset I) (T : Finset J) (hzero : ∀ A ∈ cleanNonemptySubsets U, ∀ B ∈ cleanNonemptySubsets V, ¬(A ⊆ U \ S ∧ B ⊆ V \ T) → q A B = 0) : (∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card) * q A B) = ∑ A ∈ cleanNonemptySubsets (U \ S), ∑ B ∈ cleanNonemptySubsets (V \ T), (-1 : ℂ) ^ (A.card + B.card) * q A B := by have hA := clean_nonempty_subsets_mono (sdiff_subset (s := U) (t := S)) have hB := clean_nonempty_subsets_mono (sdiff_subset (s := V) (t := T)) calc _ = ∑ A ∈ cleanNonemptySubsets (U \ S), ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card) * q A B := by symm apply sum_subset hA intro A ha hn apply sum_eq_zero intro B hb rw [hzero A ha B hb, mul_zero] intro h exact hn ((clean_mem_nonempty_subsets _ _).mpr ⟨((clean_mem_nonempty_subsets _ _).mp ha).1, h.1⟩) _ = _ := by apply sum_congr rfl intro A ha symm apply sum_subset hB intro B hb hn rw [hzero A (hA ha) B hb, mul_zero] intro h exact hn ((clean_mem_nonempty_subsets _ _).mpr ⟨((clean_mem_nonempty_subsets _ _).mp hb).1, h.2⟩) theorem clean_pattern_component_sum_comm {I J : Type*} [DecidableEq I] [DecidableEq J] (U : Finset I) (V : Finset J) (q : Finset I → Finset J → Finset I → Finset J → ℂ) : (∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, ∑ S ∈ U.powerset, ∑ T ∈ V.powerset, (-1 : ℂ) ^ (A.card + B.card) * q S T A B) = ∑ S ∈ U.powerset, ∑ T ∈ V.powerset, ∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card) * q S T A B := by calc _ = ∑ A ∈ cleanNonemptySubsets U, ∑ S ∈ U.powerset, ∑ B ∈ cleanNonemptySubsets V, ∑ T ∈ V.powerset, (-1 : ℂ) ^ (A.card + B.card) * q S T A B := by apply sum_congr rfl; intro A _; exact sum_comm _ = ∑ S ∈ U.powerset, ∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, ∑ T ∈ V.powerset, (-1 : ℂ) ^ (A.card + B.card) * q S T A B := sum_comm _ = _ := by apply sum_congr rfl intro S _ calc _ = ∑ A ∈ cleanNonemptySubsets U, ∑ T ∈ V.powerset, ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card) * q S T A B := by apply sum_congr rfl; intro A _; exact sum_comm _ = _ := sum_comm section variable {I J : Type*} [sharedInstance1 : DecidableEq I] [sharedInstance2 : DecidableEq J] (U : Finset I) (V : Finset J) (r : Finset I → Finset J → ℂ) (q : Finset I → Finset J → Finset I → Finset J → ℂ) (hzero : ∀ S ∈ U.powerset, ∀ T ∈ V.powerset, ∀ A ∈ cleanNonemptySubsets U, ∀ B ∈ cleanNonemptySubsets V, ¬(A ⊆ U \ S ∧ B ⊆ V \ T) → q S T A B = 0) include I J sharedInstance1 sharedInstance2 U V r q hzero theorem clean_pattern_block_eq_component_block : cleanSignedPatternBlock U V r q = cleanSignedComponentBlock U V r q := by unfold cleanSignedPatternBlock cleanSignedComponentBlock simp only [mul_sum, sum_sub_distrib] rw [clean_pattern_component_sum_comm] apply congrArg (fun z : ℂ => (∑ S ∈ U.powerset, ∑ T ∈ V.powerset, r S T) - z) apply sum_congr rfl intro S hS apply sum_congr rfl intro T hT exact clean_comparison_sum_restrict U V (q S T) S T (hzero S hS T hT) theorem clean_signed_pattern_block_bound (ε : ℝ) (hε : 0 ≤ ε) (herr : ∀ S ∈ U.powerset, ∀ T ∈ V.powerset, ∀ A ∈ cleanNonemptySubsets (U \ S), ∀ B ∈ cleanNonemptySubsets (V \ T), ‖q S T A B - r S T‖ ≤ ε) : ‖cleanSignedPatternBlock U V r q‖ ≤ ‖(∑ T ∈ V.powerset, r U T) + ∑ S ∈ U.powerset.erase U, r S V‖ + (3 : ℝ) ^ (U.card + V.card) * ε := by rw [clean_pattern_block_eq_component_block U V r q hzero, clean_signed_block_cancellation] exact (norm_sub_le _ _).trans (add_le_add le_rfl (clean_signed_component_error_bound U V r q ε hε herr)) end end section open Finset Classical section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) abbrev FullPermutationMixedPath (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) := FiniteEventPath (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps s noncomputable def fullPermutationMixedPathAction (steps : List (Option (J ⊕ K))) (phase : ∀ s, FullPermutationMixedPath n S B A Δ D steps s → ℂ) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) := let _ : ∀ (k : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D k s) := fullPermutationMixedEventFintype n S B A Δ D finiteEventPathAction (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps phase f end end section open Finset Classical end section open Finset open scoped Classical def physicalFullSharedIndices {J ell : ℕ} (C : Finset (Fin J)) : Finset (Fin (J + ell)) := univ.map (Fin.castLEEmb ((Nat.sub_le J C.card).trans (Nat.le_add_right J ell))) theorem physical_full_shared_indices_card {J ell : ℕ} (C : Finset (Fin J)) : (physicalFullSharedIndices (ell := ell) C).card = J - C.card := by simp only [physicalFullSharedIndices, card_map, card_univ, Fintype.card_fin] theorem physical_full_unshared_indices_card {J ell : ℕ} (C : Finset (Fin J)) : (physicalFullSharedIndices (ell := ell) C)ᶜ.card = ell + C.card := by rw [card_compl, Fintype.card_fin, physical_full_shared_indices_card] have hc : C.card ≤ J := by simpa only [Fintype.card_fin] using card_le_univ C omega noncomputable def physicalFullSharedEquiv {J ell : ℕ} (C : Finset (Fin J)) : ↥(physicalFullSharedIndices (ell := ell) C) ≃ ↥(physicalSharedSlots (ell := ell) C) := (physicalFullSharedIndices C).equivFin.trans ((finCongr ((physical_full_shared_indices_card C).trans (physical_shared_slots_card C).symm)).trans (physicalSharedSlots C).equivFin.symm) noncomputable def physicalFullUnsharedEquiv {J ell : ℕ} (C : Finset (Fin J)) : ↥((physicalFullSharedIndices (ell := ell) C)ᶜ) ≃ ↥(physicalUnsharedSlots (ell := ell) C) := (physicalFullSharedIndices C)ᶜ.equivFin.trans ((finCongr (physical_full_unshared_indices_card C)).trans (physicalGroupUnsharedIndex C)) noncomputable def physicalFullSlotIndex {J ell : ℕ} (C : Finset (Fin J)) : Fin (J + ell) ≃ PhysicalSlots J ell := finitePartitionEquiv (physicalFullSharedIndices C) (physicalSharedSlots C) (physicalFullSharedEquiv C) (physicalFullUnsharedEquiv C) theorem physical_full_slot_index_shared_iff {J ell : ℕ} (C : Finset (Fin J)) (i : Fin (J + ell)) : physicalFullSlotIndex C i ∈ physicalSharedSlots C ↔ i ∈ physicalFullSharedIndices C := finite_partition_equiv_mem_iff _ _ _ _ i theorem physical_full_slot_index_unshared {J ell : ℕ} (C : Finset (Fin J)) (i : Fin (physicalFullSharedIndices (ell := ell) C)ᶜ.card) : physicalFullSlotIndex C ((physicalFullSharedIndices C)ᶜ.equivFin.symm i).val = (physicalGroupUnsharedIndex C (finCongr (physical_full_unshared_indices_card C) i)).val := by have h := finite_partition_equiv_right (physicalFullSharedIndices C) (physicalSharedSlots C) (physicalFullSharedEquiv C) (physicalFullUnsharedEquiv C) ((physicalFullSharedIndices C)ᶜ.equivFin.symm i) refine h.trans ?_ change (physicalGroupUnsharedIndex C (finCongr (physical_full_unshared_indices_card C) ((physicalFullSharedIndices C)ᶜ.equivFin ((physicalFullSharedIndices C)ᶜ.equivFin.symm i)))).val = _ exact congrArg (fun j => (physicalGroupUnsharedIndex C (finCongr (physical_full_unshared_indices_card C) j)).val) ((physicalFullSharedIndices C)ᶜ.equivFin.apply_symm_apply i) end section open Finset Classical end section open scoped Classical theorem supported_weighted_product_rational_bilinear_bound {X Y : Type*} [Fintype X] [Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (a N : ℕ) (A : ℤ) (V : ℕ) (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (f : X → ℂ) (g : Y → ℂ) (hπrange : ∀ x, f x ≠ 0 → a ≤ π x ∧ π x < a + N) (hτrange : ∀ y, g y ≠ 0 → A ≤ (τ y : ℤ) ∧ (τ y : ℤ) ≤ A + (V : ℤ)) {C D P Q : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hP : 0 < P) (hQ : 0 < Q) (hπ : ∀ x, f x ≠ 0 → P ≤ (π x : ℝ)) (hτ : ∀ y, g y ≠ 0 → Q ≤ (τ y : ℝ)) (hμatom : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => π x = m), μ x) ≤ C / (m : ℝ)) (hνatom : ∀ m : ℕ, (∑ y ∈ Finset.univ.filter (fun y => τ y = m), ν y) ≤ D / (m : ℝ)) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) : ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * (Complex.exp (Complex.I * (2 * Real.pi * (((u : ℝ) / r + β) * τ y) : ℝ))) ^ (π x)‖ ^ 2 ≤ ((1 + 3 * (V : ℝ) / r) * (2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r))) * ((C / P) * ∑ x, μ x * ‖f x‖ ^ 2) * ((D / Q) * ∑ y, ν y * ‖g y‖ ^ 2) := by let SX := {x : X // f x ≠ 0} let SY := {y : Y // g y ≠ 0} have hμatomS (m : ℕ) : (∑ x ∈ Finset.univ.filter (fun x : SX => π x.val = m), μ x.val) ≤ C / (m : ℝ) := (finite_subtype_fiber_mass_le (fun x => f x ≠ 0) π μ hμ m).trans (hμatom m) have hνatomS (m : ℕ) : (∑ y ∈ Finset.univ.filter (fun y : SY => τ y.val = m), ν y.val) ≤ D / (m : ℝ) := (finite_subtype_fiber_mass_le (fun y => g y ≠ 0) τ ν hν m).trans (hνatom m) have hb := weighted_product_rational_bilinear_bound (fun x : SX => π x.val) (fun y : SY => τ y.val) a N A V (fun x => hπrange x.val x.property) (fun y => hτrange y.val y.property) (fun x => μ x.val) (fun y => ν y.val) (fun x => hμ x.val) (fun y => hν y.val) (fun x => f x.val) (fun y => g y.val) hC hD hP hQ (fun x => hπ x.val x.property) (fun y => hτ y.val y.property) hμatomS hνatomS hr hcop hβ have he := finite_test_support_bilinear μ ν f g (fun x y => (Complex.exp (Complex.I * (2 * Real.pi * (((u : ℝ) / r + β) * τ y) : ℝ))) ^ (π x)) rw [he] at hb simpa only [SX, SY, finite_test_support_energy] using hb end section open scoped BigOperators Classical theorem finite_kernel_transform_nonzero_term {D X : Type*} [Fintype X] (μ : X → ℝ) (K : D → X → ℂ) (f : X → ℂ) (d : D) (hd : (∑ x, (μ x : ℂ) * K d x * f x) ≠ 0) : ∃ x, μ x ≠ 0 ∧ K d x ≠ 0 ∧ f x ≠ 0 := by obtain ⟨x, _, hx⟩ := Finset.exists_ne_zero_of_sum_ne_zero hd refine ⟨x, ?_, ?_, ?_⟩ · intro he simp [he] at hx · intro he simp [he] at hx · intro he simp [he] at hx section variable {D X : Type*} [sharedInstance1 : Fintype X] (π : D → ℝ) (τ : X → ℝ) (μ : X → ℝ) (K : D → X → ℂ) (f : X → ℂ) (hK : ∀ d x, K d x ≠ 0 → 0 < π d ∧ 0 < τ x ∧ |Real.log (π d) - Real.log (τ x)| ≤ Real.log 2) include D X sharedInstance1 π τ μ K f hK theorem log_localized_kernel_transform_range {a b : ℝ} (hf : ∀ x, f x ≠ 0 → a ≤ τ x ∧ τ x ≤ b) (d : D) (hd : (∑ x, (μ x : ℂ) * K d x * f x) ≠ 0) : a / 2 ≤ π d ∧ π d ≤ 2 * b := by obtain ⟨x, _, hxK, hxf⟩ := finite_kernel_transform_nonzero_term μ K f d hd obtain ⟨hp, hq, hlog⟩ := hK d x hxK have hc := positive_log_distance_le_factor_two hp hq hlog have hs := hf x hxf constructor <;> linarith theorem log_localized_kernel_transform_dyadic_support {U : ℝ} (hf : ∀ x, f x ≠ 0 → U ≤ τ x ∧ τ x ≤ 2 * U) (d : D) (hd : (∑ x, (μ x : ℂ) * K d x * f x) ≠ 0) : U / 2 ≤ π d ∧ π d ≤ 4 * U := by have h := log_localized_kernel_transform_range π τ μ K f hK hf d hd constructor <;> linarith end end section open scoped BigOperators Classical theorem unit_test_modulation_ne_zero_iff {X : Type*} (χ f : X → ℂ) (hχ : ∀ x, ‖χ x‖ = 1) (x : X) : χ x * f x ≠ 0 ↔ f x ≠ 0 := by have hx : χ x ≠ 0 := by intro he have hn := hχ x simp [he] at hn simp only [ne_eq, mul_eq_zero, hx, false_or] theorem unit_test_modulation_energy {X : Type*} [Fintype X] (μ : X → ℝ) (χ f : X → ℂ) (hχ : ∀ x, ‖χ x‖ = 1) : (∑ x, μ x * ‖χ x * f x‖ ^ 2) = ∑ x, μ x * ‖f x‖ ^ 2 := by simp only [norm_mul, hχ, one_mul] theorem real_mellin_factor_norm (ζ p : ℝ) : ‖Complex.exp ((ζ * Real.log p : ℝ) * Complex.I)‖ = 1 := by rw [Complex.norm_exp] simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, zero_mul, sub_self, Real.exp_zero] end section open Finset open scoped Classical section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] {X : I → Type*} [sharedInstance4 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ y, μ i y = 1) (U : Finset I) (f : (∀ i, X i) → ℂ) include I sharedInstance1 sharedInstance2 X sharedInstance4 μ hμ hmass U f theorem finite_probe_complement_energy_add : finiteWeightedEnergy (finiteProductWeight μ) (f - finiteCoordinateComponent μ U U.toList f) + finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ U U.toList f) = finiteWeightedEnergy (finiteProductWeight μ) f := by have he := finite_weighted_orthogonal_energy (U.powerset.erase U) (finiteProductWeight μ) (fun x => prod_nonneg (fun i _ => hμ i (x i))) (fun S => finiteCoordinateComponent μ S U.toList f) (fun S hS T hT hST => finite_coordinate_components_orthogonal μ hmass U.toList S T (by simpa using mem_powerset.mp (mem_erase.mp hS).2) (by simpa using mem_powerset.mp (mem_erase.mp hT).2) hST f f) rw [clean_component_erase_sum] at he rw [he, sum_erase_add _ _ (show U ∈ U.powerset by simp)] simpa using finite_coordinate_component_energy_sum μ hμ hmass U.toList U.nodup_toList f theorem finite_probe_complement_energy_le : finiteWeightedEnergy (finiteProductWeight μ) (f - finiteCoordinateComponent μ U U.toList f) ≤ finiteWeightedEnergy (finiteProductWeight μ) f := by have he := finite_probe_complement_energy_add μ hμ hmass U f have hn : 0 ≤ finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ U U.toList f) := sum_nonneg fun x _ => mul_nonneg (prod_nonneg fun i _ => hμ i (x i)) (sq_nonneg _) linarith theorem finite_probe_complement_norm_le : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (f - finiteCoordinateComponent μ U U.toList f)) ≤ Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) f) := Real.sqrt_le_sqrt (finite_probe_complement_energy_le μ hμ hmass U f) end end section open Finset open scoped Classical InnerProductSpace section variable {X : Type*} [sharedInstance1 : Fintype X] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) include X sharedInstance1 w hw theorem finite_measure_vector_norm_energy (f : X → ℂ) : ‖finiteMeasureVector w f‖ = Real.sqrt (finiteWeightedEnergy w f) := by unfold finiteWeightedEnergy rw [← finite_measure_vector_norm_sq w hw, Real.sqrt_sq (norm_nonneg _)] theorem finite_unit_multiplier_energy_le (k : X → ℂ) (hk : ∀ x, ‖k x‖ ≤ 1) (f : X → ℂ) : finiteWeightedEnergy w (fun x => f x * k x) ≤ finiteWeightedEnergy w f := by apply sum_le_sum intro x _ apply mul_le_mul_of_nonneg_left _ (hw x) rw [norm_mul, mul_pow] have h : ‖k x‖ ^ 2 ≤ 1 := by nlinarith [norm_nonneg (k x), hk x] simpa only [mul_one] using mul_le_mul_of_nonneg_left h (sq_nonneg ‖f x‖) theorem clean_raw_pairing_norm_le (k : X → ℂ) (hk : ∀ x, ‖k x‖ ≤ 1) (f g : X → ℂ) : ‖cleanRawPairing w k f g‖ ≤ Real.sqrt (finiteWeightedEnergy w f) * Real.sqrt (finiteWeightedEnergy w g) := by have he : cleanRawPairing w k f g = inner ℂ (finiteMeasureVector w f) (finiteMeasureVector w (fun x => g x * k x)) := by rw [finite_measure_vector_inner w hw] unfold cleanRawPairing apply sum_congr rfl intro x _ ring rw [he] calc _ ≤ ‖finiteMeasureVector w f‖ * ‖finiteMeasureVector w (fun x => g x * k x)‖ := norm_inner_le_norm _ _ _ = Real.sqrt (finiteWeightedEnergy w f) * Real.sqrt (finiteWeightedEnergy w (fun x => g x * k x)) := by rw [finite_measure_vector_norm_energy w hw, finite_measure_vector_norm_energy w hw] _ ≤ _ := mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt (finite_unit_multiplier_energy_le w hw k hk g)) (Real.sqrt_nonneg _) end end section open Finset theorem character_conductor_pair_injective (d : ℕ) : Function.Injective (fun χ : DirichletCharacter ℂ d => (⟨χ.conductor, χ.primitiveCharacter⟩ : (f : ℕ) × DirichletCharacter ℂ f)) := by intro χ ψ h have hh := congrArg (fun t : (f : ℕ) × DirichletCharacter ℂ f => if ht : t.1 ∣ d then DirichletCharacter.changeLevel ht t.2 else 1) h simpa only [dif_pos χ.conductor_dvd_level, dif_pos ψ.conductor_dvd_level, DirichletCharacter.changeLevel_primitiveCharacter] using hh noncomputable def typeIPrimitiveConductorNormSum {Ω : Type*} (d : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : ℝ := by classical exact ∑ f ∈ d.divisors.filter (fun f => 1 < f), ∑ ψ ∈ (univ : Finset (DirichletCharacter ℂ f)).filter (fun ψ => ψ.IsPrimitive ∧ ψ ≠ 1), ‖∑ t ∈ T.filter (fun t => (value t).Coprime (d / f)), μ t * ψ (value t : ZMod f)‖ theorem character_conductor_norm_sum_le {Ω : Type*} (d : ℕ) [NeZero d] (C : Finset (DirichletCharacter ℂ d)) (hC : ∀ χ ∈ C, χ ≠ 1) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : (∑ χ ∈ C, ‖typeICharacterSum T μ value χ‖) ≤ typeIPrimitiveConductorNormSum d T μ value := by classical let pair := fun χ : DirichletCharacter ℂ d => (⟨χ.conductor, χ.primitiveCharacter⟩ : (f : ℕ) × DirichletCharacter ℂ f) let D : Finset ((f : ℕ) × DirichletCharacter ℂ f) := (d.divisors.filter (fun f => 1 < f)).sigma (fun f => (univ : Finset (DirichletCharacter ℂ f)).filter (fun ψ => ψ.IsPrimitive ∧ ψ ≠ 1)) let w : ((f : ℕ) × DirichletCharacter ℂ f) → ℝ := fun x => ‖∑ t ∈ T.filter (fun t => (value t).Coprime (d / x.1)), μ t * x.2 (value t : ZMod x.1)‖ have hinj : Set.InjOn pair C := (character_conductor_pair_injective d).injOn have hsub : C.image pair ⊆ D := by intro x hx obtain ⟨χ, hχ, rfl⟩ := mem_image.mp hx apply mem_sigma.mpr constructor · exact mem_filter.mpr ⟨Nat.mem_divisors.mpr ⟨χ.conductor_dvd_level, NeZero.ne d⟩, nonprincipal_conductor_one_lt χ (hC χ hχ)⟩ · exact mem_filter.mpr ⟨mem_univ _, χ.primitiveCharacter_isPrimitive, nonprincipal_primitiveCharacter_ne_one χ (hC χ hχ)⟩ calc _ = ∑ x ∈ C.image pair, w x := by rw [sum_image hinj] apply sum_congr rfl intro χ _ change ‖∑ t ∈ T, μ t * χ (value t : ZMod d)‖ = _ rw [character_weighted_sum_eq_primitive_filtered] _ ≤ ∑ x ∈ D, w x := sum_le_sum_of_subset_of_nonneg hsub (fun x _ _ => norm_nonneg _) _ = typeIPrimitiveConductorNormSum d T μ value := by rw [show D = (d.divisors.filter (fun f => 1 < f)).sigma (fun f => (univ : Finset (DirichletCharacter ℂ f)).filter (fun ψ => ψ.IsPrimitive ∧ ψ ≠ 1)) from rfl, sum_sigma] rfl theorem typeI_nonprincipal_norm_sum_le_conductors {Ω : Type*} (d : ℕ) [NeZero d] (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : typeINonprincipalNormSum d T μ value ≤ typeIPrimitiveConductorNormSum d T μ value := by classical unfold typeINonprincipalNormSum apply character_conductor_norm_sum_le intro χ hχ simpa only [mem_erase, mem_univ, and_true] using hχ end section open Finset theorem fixed_prime_shifted_intersection_moment (T S : Finset ℕ) (μ : ℕ → ℝ) {p : ℕ} (hp : p.Prime) (hpS : p ∉ S) (hS : ∀ q ∈ S, q.Prime) : (∑ u ∈ (T.filter (fun u => p ∣ 2*u + 1)).filter (fun u => ∀ q ∈ S, q ∣ 2*u + 1), μ u) = ((∑ u ∈ T, μ u) / ((p : ℝ) - 1)) * (∏ q ∈ S, 1 / ((q : ℝ) - 1)) + shiftedTotientSieveRemainder T μ (p * ∏ q ∈ S, q) := by have hfilter : (T.filter (fun u => p ∣ 2*u + 1)).filter (fun u => ∀ q ∈ S, q ∣ 2*u + 1) = T.filter (fun u => ∀ q ∈ insert p S, q ∣ 2*u + 1) := by ext u simp only [mem_filter, mem_insert, forall_eq_or_imp] tauto rw [hfilter] have hpr : ∀ q ∈ insert p S, q.Prime := by intro q hq rcases mem_insert.mp hq with rfl | hq · exact hp · exact hS q hq have hm := shifted_totient_intersection_moment T (insert p S) μ hpr rw [prod_insert hpS, prod_insert hpS] at hm convert hm using 1 ring theorem exists_fixed_prime_shifted_sieve : ∃ K : ℝ, 0 < K ∧ ∀ (P T : Finset ℕ) (μ : ℕ → ℝ) (p : ℕ) {z : ℝ} {h : ℕ}, 1 < z → 1 ≤ h → Even h → p.Prime → p ∉ P → (∀ q ∈ P, q.Prime) → (∀ q ∈ P, q ≠ 2) → (∀ q ∈ P, (q : ℝ) ≤ z) → (∀ u ∈ T, 0 ≤ μ u) → |(∑ u ∈ T.filter (fun u => p ∣ 2*u + 1 ∧ ∀ q ∈ P, ¬q ∣ 2*u + 1), μ u) - ((∑ u ∈ T, μ u) / ((p : ℝ) - 1)) * (∏ q ∈ P, (1 - 1 / ((q : ℝ) - 1)))| ≤ ((∑ u ∈ T, μ u) / ((p : ℝ) - 1)) * (∏ q ∈ P, (1 - 1 / ((q : ℝ) - 1))) * K * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli P (z^(4 * (h : ℝ) + 2)), |shiftedTotientSieveRemainder T μ (p*d)| := by obtain ⟨K, hK, hsieve⟩ := exists_odd_prime_reciprocal_sieve_events refine ⟨K, hK, ?_⟩ intro P T μ p z h hz hh heven hp hpP hP hodd hPz hμ have hden : 0 < (p : ℝ) - 1 := by have hp1 : (1 : ℝ) < p := by exact_mod_cast hp.one_lt linarith have hm : ∀ S ∈ P.powerset, (∑ u ∈ (T.filter (fun u => p ∣ 2*u + 1)).filter (fun u => ∀ q ∈ S, q ∣ 2*u + 1), μ u) = ((∑ u ∈ T, μ u) / ((p : ℝ) - 1)) * (∏ q ∈ S, 1 / ((q : ℝ) - 1)) + shiftedTotientSieveRemainder T μ (p * ∏ q ∈ S, q) := by intro S hS have hSP := mem_powerset.mp hS exact fixed_prime_shifted_intersection_moment T S μ hp (fun hpS => hpP (hSP hpS)) (fun q hq => hP q (hSP hq)) have hb := hsieve P (T.filter (fun u => p ∣ 2*u + 1)) μ (fun u q => q ∣ 2*u + 1) (fun d => shiftedTotientSieveRemainder T μ (p*d)) hz (div_nonneg (sum_nonneg hμ) hden.le) hh heven hP hodd hPz (fun u hu => hμ u (mem_filter.mp hu).1) hm simpa only [filter_filter] using hb end section open Finset Filter open scoped Topology noncomputable def oddSquarefreeModuli (N : ℕ) : Finset ℕ := (Icc 1 N).filter (fun d => Squarefree d ∧ Odd d) theorem typeI_shifted_remainder_bound (T M : Finset ℕ) (μ : ℕ → ℝ) (hM : ∀ d ∈ M, 0 < d ∧ Odd d) : (∑ d ∈ M, |shiftedTotientSieveRemainder T μ d|) ≤ (∑ d ∈ M, typeINonprincipalNormSum d T (fun u => (μ u : ℂ)) (fun u => u) / (d.totient : ℝ)) + ∑ d ∈ M, |(∑ u ∈ T.filter (fun u => Nat.Coprime d u), μ u) / (d.totient : ℝ) - (∑ u ∈ T, μ u) / (d.totient : ℝ)| := by rw [← sum_add_distrib] apply sum_le_sum intro d hd have hdecomp := @typeI_real_deviation_le ℕ d ⟨Nat.ne_of_gt (hM d hd).1⟩ (hM d hd).2 T μ (fun u => u) have hfilter : T.filter (fun u => Nat.Coprime u d) = T.filter (fun u => Nat.Coprime d u) := by apply filter_congr intro u _ exact Nat.coprime_comm rw [hfilter] at hdecomp unfold shiftedTotientSieveRemainder exact (abs_sub_le _ ((∑ u ∈ T.filter (fun u => Nat.Coprime d u), μ u) / (d.totient : ℝ)) _).trans (add_le_add hdecomp le_rfl) noncomputable def candidateNonprincipalTypeIMass (c L q : ℝ) (r jStar N : ℕ) : ℝ := ∑ d ∈ oddSquarefreeModuli N, typeINonprincipalNormSum d (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u) / (d.totient : ℝ) theorem eventually_candidate_typeI_remainder_bound {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ q : ℝ, 0 ≤ q → ∀ r jStar N : ℕ, (N : ℝ) ≤ Real.exp L → (∑ d ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d|) ≤ candidateNonprincipalTypeIMass c L q r jStar N + candidateCoefficientWindowMass c L q r jStar * ((16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := by filter_upwards [eventually_candidate_principal_coprime_loss hc] with L hprincipal intro q hq r jStar N hN have hM : ∀ d ∈ oddSquarefreeModuli N, 0 < d ∧ Odd d := by intro d hd exact ⟨(mem_Icc.mp (mem_filter.mp hd).1).1, (mem_filter.mp hd).2.2⟩ apply (typeI_shifted_remainder_bound (arithmeticProductWindow 1 (Real.exp L)) (oddSquarefreeModuli N) (candidateCoefficient c L q r jStar) hM).trans apply add_le_add le_rfl apply le_trans _ (hprincipal q hq r jStar N hN) apply sum_le_sum_of_subset_of_nonneg · intro d hd exact mem_filter.mpr ⟨(mem_filter.mp hd).1, (mem_filter.mp hd).2.1⟩ · intro d _ _ exact abs_nonneg _ end section open Finset Classical universe uJ uK uP uA section variable {J : Type uJ} {K : Type uK} {N : ℕ} {P : Fin N → Type uP} (n : ∀ g, P g → ℕ) {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) (Δ D : ∀ k c, A k c → Fin N → ℤ) noncomputable def fullMixedGhostLedgerTarget [∀ g, DecidableEq (P g)] (j : J) (s : BoundedGhostJointLedgerState n M B) (e : FullMixedMemoryEvent n S B A Δ D (.inl j) (fun g => (s g).2)) : BoundedGhostJointLedgerState n M B := boundedGhostJointTarget n M B s e.down noncomputable def fullMixedGhostFreshnessPhase (j : J) (s : BoundedGhostJointLedgerState n M B) (e : FullMixedMemoryEvent n S B A Δ D (.inl j) (fun g => (s g).2)) : ℂ := if boundedGhostJointFresh n M B s e.down then 1 else 0 theorem full_mixed_ghost_freshness_phase_norm (j : J) (s : BoundedGhostJointLedgerState n M B) (e : FullMixedMemoryEvent n S B A Δ D (.inl j) (fun g => (s g).2)) : ‖fullMixedGhostFreshnessPhase n S B A Δ D j s e‖ ≤ 1 := by unfold fullMixedGhostFreshnessPhase split_ifs <;> simp theorem full_mixed_ghost_sum_ulift [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] (j : J) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (F : CoupledGhostEvent M B s → ℂ) : let _ : ∀ (k : J ⊕ K) x, Fintype (FullMixedMemoryEvent n S B A Δ D k x) := fullMixedMemoryEventFintype n S B A Δ D (∑ e : FullMixedMemoryEvent n S B A Δ D (.inl j) s, F e.down) = ∑ e : CoupledGhostEvent M B s, F e := by let _ : ∀ (k : J ⊕ K) x, Fintype (FullMixedMemoryEvent n S B A Δ D k x) := fullMixedMemoryEventFintype n S B A Δ D refine Eq.trans ?_ (Equiv.sum_comp (Equiv.ulift : ULift.{uA} (CoupledGhostEvent M B s) ≃ CoupledGhostEvent M B s) F) apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ rfl theorem full_mixed_ghost_ledger_event_sum [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (j : J) (F : GlobalBirthJointState (fun g p => ZMod (n g p)) → ℂ) (s : BoundedGhostJointLedgerState n M B) : let _ : ∀ (k : J ⊕ K) x, Fintype (FullMixedMemoryEvent n S B A Δ D k x) := fullMixedMemoryEventFintype n S B A Δ D (∑ e : FullMixedMemoryEvent n S B A Δ D (.inl j) (fun g => (s g).2), (fullMixedMemoryEventWeight n S B A Δ D ω μ q ρ V (.inl j) (fun g => (s g).2) e : ℂ) * fullMixedGhostFreshnessPhase n S B A Δ D j s e * F (boundedGhostJointDecode n M B (fullMixedGhostLedgerTarget n S B A Δ D j s e))) = ∑ e : CoupledGhostEvent M B (fun g => (s g).2), (coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (q j) ρ) (fun g => physicalGhostTermination (n g) (q j) ρ) (fun g => physicalGhostBirth (n g) (q j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B (fun g => (s g).2) e : ℂ) * (if boundedGhostJointFresh n M B s e then 1 else 0) * F (boundedGhostJointDecode n M B (boundedGhostJointTarget n M B s e)) := by let _ : ∀ (k : J ⊕ K) x, Fintype (FullMixedMemoryEvent n S B A Δ D k x) := fullMixedMemoryEventFintype n S B A Δ D dsimp only simpa only [fullMixedMemoryEventWeight, fullMixedGhostFreshnessPhase, fullMixedGhostLedgerTarget] using full_mixed_ghost_sum_ulift n S B A Δ D j (fun g => (s g).2) (fun e => (coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (q j) ρ) (fun g => physicalGhostTermination (n g) (q j) ρ) (fun g => physicalGhostBirth (n g) (q j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B (fun g => (s g).2) e : ℂ) * (if boundedGhostJointFresh n M B s e then 1 else 0) * F (boundedGhostJointDecode n M B (boundedGhostJointTarget n M B s e))) theorem full_mixed_ghost_raw_visit_events [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] (ω : ∀ k c, A k c → ℝ) (β : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (j : J) (a : ∀ g, P g → Bool) (hV : ∀ g, V g ≠ 0) (F : GlobalBirthJointState (fun g p => ZMod (n g p)) → ℂ) (s : BoundedGhostJointLedgerState n M B) : let _ : ∀ (k : J ⊕ K) x, Fintype (FullMixedMemoryEvent n S B A Δ D k x) := fullMixedMemoryEventFintype n S B A Δ D globalBirthJointCutRawRow (fun g => GlobalBirthRawStep.visit (a := a g) (fun _ => 0) (β g) (1 - q j) (V g) ρ (hV g) B) B B F (boundedGhostJointDecode n M B s) = ∑ e : FullMixedMemoryEvent n S B A Δ D (.inl j) (fun g => (s g).2), (fullMixedMemoryEventWeight n S B A Δ D ω (fun g p => β g p / V g) q ρ V (.inl j) (fun g => (s g).2) e : ℂ) * fullMixedGhostFreshnessPhase n S B A Δ D j s e * F (boundedGhostJointDecode n M B (fullMixedGhostLedgerTarget n S B A Δ D j s e)) := by let _ : ∀ (k : J ⊕ K) x, Fintype (FullMixedMemoryEvent n S B A Δ D k x) := fullMixedMemoryEventFintype n S B A Δ D dsimp only refine Eq.trans ?_ (full_mixed_ghost_ledger_event_sum n S B A Δ D ω (fun g p => β g p / V g) q ρ V j F s).symm simpa only [sub_sub_cancel] using global_birth_joint_visit_bounded_events n β (fun _ => 1 - q j) V (fun _ => ρ) M B a hV F s end end section open scoped BigOperators Classical theorem prime_ideal_kernel_zero_of_right_discarded {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (Q : ℕ) (h : ℝ) (kept : Finset ℤ) (x y : ∀ i, P i) (hy : upperLogCell h (Real.log (∏ i, (y i).val : ℕ)) ∉ kept) : primeProductIdealKernel P V Q h kept x y = 0 := by unfold primeProductIdealKernel finiteCellFrameKernel split_ifs with hxy · have he : upperLogCell h (Real.log (∏ i, (x i).val : ℕ)) = upperLogCell h (Real.log (∏ i, (y i).val : ℕ)) := hxy.1 have hm : upperLogCell h (Real.log (∏ i, (x i).val : ℕ)) ∈ kept := hxy.2 rw [he] at hm exact (hy hm).elim · rfl section variable {X Y : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (x : X) (y : Y) (F : X → Y → ℂ) include X Y sharedInstance1 sharedInstance2 μ ν KA KB x y F theorem finite_two_kernel_average_zero_left (hzero : ∀ d, KA d x = 0) : finiteTwoKernelAverage μ ν KA KB x y F = 0 := by simp only [finiteTwoKernelAverage, hzero, mul_zero, zero_mul, Finset.sum_const_zero] theorem finite_two_kernel_average_zero_right (hzero : ∀ e, KB e y = 0) : finiteTwoKernelAverage μ ν KA KB x y F = 0 := by simp only [finiteTwoKernelAverage, hzero, mul_zero, zero_mul, Finset.sum_const_zero] end end section open scoped BigOperators Classical noncomputable def finiteKernelTestTransform {X : Type*} [Fintype X] (μ : X → ℝ) (K : X → X → ℂ) (f : X → ℂ) (d : X) : ℂ := ∑ x, (μ x : ℂ) * K d x * f x theorem finite_sum_four_swap {A B C D M : Type*} [Fintype A] [Fintype B] [Fintype C] [Fintype D] [AddCommMonoid M] (F : A → B → C → D → M) : (∑ a, ∑ b, ∑ c, ∑ d, F a b c d) = ∑ c, ∑ d, ∑ a, ∑ b, F a b c d := by calc _ = ∑ ab : A × B, ∑ cd : C × D, F ab.1 ab.2 cd.1 cd.2 := by simp only [Fintype.sum_prod_type] _ = ∑ cd : C × D, ∑ ab : A × B, F ab.1 ab.2 cd.1 cd.2 := Finset.sum_comm _ = _ := by simp only [Fintype.sum_prod_type] section variable {X Y : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) include X Y sharedInstance1 sharedInstance2 μ ν KA KB theorem finite_two_kernel_pairing_fubini (f : X → ℂ) (g : Y → ℂ) (F : X → Y → ℂ) : (∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * finiteTwoKernelAverage μ ν KA KB x y F) = ∑ d, ∑ e, ((μ d : ℂ) * finiteKernelTestTransform μ KA f d) * ((ν e : ℂ) * finiteKernelTestTransform ν KB g e) * F d e := by simp only [finiteTwoKernelAverage, finiteKernelTestTransform, Finset.mul_sum, Finset.sum_mul] rw [finite_sum_four_swap] apply Finset.sum_congr rfl intro d _ apply Finset.sum_congr rfl intro e _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ ring theorem finite_two_kernel_pairing_modulated (f χ : X → ℂ) (g ψ : Y → ℂ) (F : X → Y → ℂ) : (∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * finiteTwoKernelAverage μ ν KA KB x y (fun d e => χ d * ψ e * F d e)) = ∑ d, ∑ e, ((μ d : ℂ) * (χ d * finiteKernelTestTransform μ KA f d)) * ((ν e : ℂ) * (ψ e * finiteKernelTestTransform ν KB g e)) * F d e := by rw [finite_two_kernel_pairing_fubini] apply Finset.sum_congr rfl intro d _ apply Finset.sum_congr rfl intro e _ ring end end section open Finset open scoped Classical section Full variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → Fin N → ℤ) (target : (g : Fin N) → Fin (S g)ᶜ.card → P g) (H : (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) noncomputable def fullEdgeLedgerPhase (e : FullActiveEdgeEvent n S B A Δ D x) : ℂ := ∏ g, globalBirthBoundedEdgePhase (n g) (Δ (productActiveMemorySplit S B x).1 e.1 g) (D (productActiveMemorySplit S B x).1 e.1 g) (S g)ᶜ.card B (target g) (H g) ((productActiveMemorySplit S B x).2 g) (e.2 g).1 (e.2 g).2.1 (e.2 g).2.2.1 (e.2 g).2.2.2 omit [∀ g, Fintype (P g)] [∀ c, Fintype (A c)] in theorem full_edge_ledger_phase_norm_le (e : FullActiveEdgeEvent n S B A Δ D x) : ‖fullEdgeLedgerPhase n S B A Δ D target H x e‖ ≤ 1 := by unfold fullEdgeLedgerPhase rw [norm_prod] apply prod_le_one₀ · intro g _ exact norm_nonneg _ · intro g _ exact global_birth_bounded_edge_phase_norm_le _ _ _ _ _ _ _ _ _ _ _ _ end Full end section open scoped BigOperators Classical theorem rational_phase_zmod {r : ℕ} [NeZero r] (u : ℤ) (n : ℕ) : (AddChar.zmod r (u : ZMod r) (n : ZMod r) : ℂ) = Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * n) : ℝ)) := by have ht := congrArg (fun z : Circle => (z : ℂ)) (AddChar.zmod_intCast r u (n : ℤ)) simp only [Int.cast_natCast, Circle.coe_exp] at ht rw [ht] congr 1 push_cast ring theorem rational_unit_character_expansion {r Q : ℕ} (hr : 0 < r) (hrQ : r ≤ Q) (u : ℤ) : ∃ c : AddChar (Additive (ZMod r)ˣ) ℂ → ℂ, (∑ ψ, ‖c ψ‖) ≤ Real.sqrt (Q : ℝ) ∧ ∀ n : ℕ, n.Coprime r → (∑ ψ, c ψ * unitAddCharDirichlet ψ (n : ZMod r)) = Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * n) : ℝ)) := by let : NeZero r := ⟨Nat.ne_of_gt hr⟩ obtain ⟨c, hc, he⟩ := finite_unit_character_expansion hr hrQ (fun z => (AddChar.zmod r (u : ZMod r) z : ℂ)) (fun v => (Circle.norm_coe _).le) exact ⟨c, hc, fun n hn => (he n hn).trans (rational_phase_zmod u n)⟩ theorem rational_bilinear_character_expansion {r Q : ℕ} (hr : 0 < r) (hrQ : r ≤ Q) (u : ℤ) : ∃ c : AddChar (Additive (ZMod r)ˣ) ℂ → ℂ, (∑ ψ, ‖c ψ‖) ≤ Real.sqrt (Q : ℝ) ∧ ∀ m n : ℕ, m.Coprime r → n.Coprime r → (∑ ψ, c ψ * unitAddCharDirichlet ψ (m : ZMod r) * unitAddCharDirichlet ψ (n : ZMod r)) = Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (m * n)) : ℝ)) := by obtain ⟨c, hc, he⟩ := rational_unit_character_expansion hr hrQ u refine ⟨c, hc, ?_⟩ intro m n hm hn simpa only [Nat.cast_mul, map_mul, mul_assoc] using he (m * n) (hm.mul_left hn) end section open Finset open scoped Classical /- The full signed comparison block cancels every nonexceptional component. The two exceptional raw pairings are combined before taking an absolute value. Only comparison errors incur the three-state count. -/ theorem finite_probe_signed_cancellation_bound {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ y, μ i y = 1) (U V : Finset I) (k : (∀ i, X i) → ℂ) (K : Finset I → Finset I → (∀ i, X i) → (∀ i, X i) → ℂ) (f g : (∀ i, X i) → ℂ) (hzero : ∀ S ∈ U.powerset, ∀ T ∈ V.powerset, ∀ A ∈ cleanNonemptySubsets U, ∀ B ∈ cleanNonemptySubsets V, ¬(A ⊆ U \ S ∧ B ⊆ V \ T) → cleanKernelPairing (finiteProductWeight μ) (K A B) (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g) = 0) (ε : ℝ) (hε : 0 ≤ ε) (herr : ∀ S ∈ U.powerset, ∀ T ∈ V.powerset, ∀ A ∈ cleanNonemptySubsets (U \ S), ∀ B ∈ cleanNonemptySubsets (V \ T), ‖cleanKernelPairing (finiteProductWeight μ) (K A B) (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g) - cleanRawPairing (finiteProductWeight μ) k (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g)‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ S U.toList f)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ T V.toList g))) : ‖cleanRawPairing (finiteProductWeight μ) k f g - ∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight μ) (K A B) f g‖ ≤ ‖cleanRawPairing (finiteProductWeight μ) k (finiteCoordinateComponent μ U U.toList f) g + cleanRawPairing (finiteProductWeight μ) k (f - finiteCoordinateComponent μ U U.toList f) (finiteCoordinateComponent μ V V.toList g)‖ + (3 : ℝ) ^ (U.card + V.card) * ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) g) := by let r S T := cleanRawPairing (finiteProductWeight μ) k (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g) let q S T A B := cleanKernelPairing (finiteProductWeight μ) (K A B) (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g) have h := clean_signed_pattern_block_bound U V r q hzero (ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) g)) (mul_nonneg (mul_nonneg hε (Real.sqrt_nonneg _)) (Real.sqrt_nonneg _)) (fun S hS T hT A hA B hB => finite_probe_comparison_error_uniform μ hμ hmass U V S T (mem_powerset.mp hS) (mem_powerset.mp hT) f g ε hε _ (herr S hS T hT A hA B hB)) unfold cleanSignedPatternBlock at h dsimp only [r, q] at h rw [clean_raw_component_pairing_sum] at h simp_rw [clean_kernel_component_pairing_sum] at h rw [clean_raw_component_exceptional_pairing] at h simpa only [mul_assoc] using h end section open Finset Classical end section open Finset open scoped Classical noncomputable def physicalFullMemoryState {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B := fun g => (fun i => L g (physicalFullSlotIndex (C g) i), q g) theorem physical_full_memory_state_unshared {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) (g : G) : ((productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C L q)).2 g).1 = (physicalGroupUnsharedEmbedding C L g) ∘ finCongr (physical_full_unshared_indices_card (ell := ell) (C g)) := by funext i change L g (physicalFullSlotIndex (C g) ((physicalFullSharedIndices (C g))ᶜ.equivFin.symm i).val) = _ rw [physical_full_slot_index_unshared] rfl theorem physical_full_memory_state_total {G : Type*} [Fintype G] {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) : productTotalMemory (physicalFullMemoryState C L q) = ∑ g, (q g).1.val := rfl theorem physical_full_memory_state_shared {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (hshared : physicalSharedCompatible C L R) (q r : ∀ g, BoundedOrderedTuple (Z g) B) : (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C L q)).1 = (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C R r)).1 := by funext g i let j := ((physicalFullSharedIndices (ell := ell) (C g)).equivFin.symm i).val change L g (physicalFullSlotIndex (C g) j) = R g (physicalFullSlotIndex (C g) j) have hj : physicalFullSlotIndex (C g) j ∈ physicalSharedSlots (C g) := (physical_full_slot_index_shared_iff (C g) j).mpr ((physicalFullSharedIndices (ell := ell) (C g)).equivFin.symm i).property obtain ⟨s, hs, he⟩ := (physical_mem_shared_slots_iff (C g) _).mp hj rw [he] exact hshared g s hs theorem physical_full_memory_state_weight {G : Type*} [Fintype G] {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) (μ : ∀ g, ↥(P g) → ℝ) (ν : ∀ g, Z g → ℝ) : productMemoryWeight μ ν (physicalFullMemoryState C L q) = ∏ g, (∏ i : PhysicalSlots J ell, μ g (L g i)) * boundedOrderedMemoryWeight (ν g) (q g) := by apply prod_congr rfl intro g _ change (∏ i, μ g (L g (physicalFullSlotIndex (C g) i))) * _ = _ rw [(physicalFullSlotIndex (C g)).prod_comp (fun i => μ g (L g i))] rfl end section open scoped BigOperators Classical theorem rational_dyad_coefficient_le {U V r L : ℝ} (hU : 0 < U) (hV : 0 < V) (hr : 0 < r) (hL : 1 ≤ L) : ((1 + 3 * V / r) * (2 * U + 2 * r * L)) / (U * V) ≤ 6 * L * (1 / r + 1 / U + 1 / V + r / (U * V)) := by apply (div_le_iff₀ (mul_pos hU hV)).mpr have he : 6 * L * (1 / r + 1 / U + 1 / V + r / (U * V)) * (U * V) = (3 * (1 + V / r)) * (2 * L * (U + r)) := by field_simp ring rw [he] apply mul_le_mul · have heq : 1 + 3 * V / r = 3 * (1 + V / r) - 2 := by ring rw [heq] linarith · nlinarith [mul_nonneg hU.le (sub_nonneg.mpr hL)] · positivity · positivity section variable {X Y : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (U V : ℕ) (hU : 0 < U) (hV : 0 < V) (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (f : X → ℂ) (g : Y → ℂ) (hπrange : ∀ x, f x ≠ 0 → U ≤ π x ∧ π x < 2 * U) (hτrange : ∀ y, g y ≠ 0 → V ≤ τ y ∧ τ y < 2 * V) {C D : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hμatom : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => π x = m), μ x) ≤ C / (m : ℝ)) (hνatom : ∀ m : ℕ, (∑ y ∈ Finset.univ.filter (fun y => τ y = m), ν y) ≤ D / (m : ℝ)) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) include X Y sharedInstance1 sharedInstance2 π τ U V hU hV μ ν hμ hν f g hπrange hτrange C D hC hD hμatom hνatom u r hr hcop β hβ theorem supported_weighted_product_dyadic_bound : ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * (Complex.exp (Complex.I * (2 * Real.pi * (((u : ℝ) / r + β) * τ y) : ℝ))) ^ (π x)‖ ^ 2 ≤ ((1 + 3 * (V : ℝ) / r) * (2 * (U : ℝ) + 2 * (r : ℝ) * (1 + Real.log r))) * ((C / U) * ∑ x, μ x * ‖f x‖ ^ 2) * ((D / V) * ∑ y, ν y * ‖g y‖ ^ 2) := by apply supported_weighted_product_rational_bilinear_bound π τ U U (V : ℤ) V μ ν hμ hν f g · intro x hx have hp := hπrange x hx omega · intro y hy obtain ⟨hlo, hhi⟩ := hτrange y hy constructor · exact_mod_cast hlo · have hbound : τ y ≤ V + V := by omega exact_mod_cast hbound · exact hC · exact hD · exact_mod_cast hU · exact_mod_cast hV · intro x hx exact_mod_cast (hπrange x hx).1 · intro y hy exact_mod_cast (hτrange y hy).1 · exact hμatom · exact hνatom · exact hr · exact hcop · exact hβ theorem supported_weighted_product_dyadic_clean_bound : ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * (Complex.exp (Complex.I * (2 * Real.pi * (((u : ℝ) / r + β) * τ y) : ℝ))) ^ (π x)‖ ^ 2 ≤ 6 * C * D * (1 + Real.log r) * (1 / (r : ℝ) + 1 / (U : ℝ) + 1 / (V : ℝ) + (r : ℝ) / ((U : ℝ) * V)) * (∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2 := by have hUR : (0 : ℝ) < U := by exact_mod_cast hU have hVR : (0 : ℝ) < V := by exact_mod_cast hV have hrR : (0 : ℝ) < r := by exact_mod_cast hr have hL : 1 ≤ 1 + Real.log (r : ℝ) := by have hl := Real.log_nonneg (by exact_mod_cast hr : (1 : ℝ) ≤ r) linarith have hc := rational_dyad_coefficient_le hUR hVR hrR hL have hEx : 0 ≤ ∑ x, μ x * ‖f x‖ ^ 2 := Finset.sum_nonneg (fun x _ => mul_nonneg (hμ x) (sq_nonneg _)) have hEy : 0 ≤ ∑ y, ν y * ‖g y‖ ^ 2 := Finset.sum_nonneg (fun y _ => mul_nonneg (hν y) (sq_nonneg _)) have hm := mul_le_mul_of_nonneg_right hc (mul_nonneg (mul_nonneg (mul_nonneg hC hD) hEx) hEy) have hb := supported_weighted_product_dyadic_bound π τ U V hU hV μ ν hμ hν f g hπrange hτrange hC hD hμatom hνatom hr hcop hβ apply hb.trans convert hm using 1 <;> ring end end section open Finset open scoped Classical /- Envelope bounds retain the norms of the original symmetric tests after additional averaging has changed the vectors used in the raw pairing. -/ theorem finite_exceptional_pairing_envelope {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ y, μ i y = 1) (U V : Finset I) (k : (∀ i, X i) → ℂ) (hk : ∀ x, ‖k x‖ ≤ 1) (f g : (∀ i, X i) → ℂ) (a b θA θB : ℝ) (hf : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) f) ≤ a) (hg : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) g) ≤ b) (hA : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ U U.toList f)) ≤ θA * a) (hB : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ V V.toList g)) ≤ θB * b) : ‖cleanRawPairing (finiteProductWeight μ) k (finiteCoordinateComponent μ U U.toList f) g + cleanRawPairing (finiteProductWeight μ) k (f - finiteCoordinateComponent μ U U.toList f) (finiteCoordinateComponent μ V V.toList g)‖ ≤ (θA + θB) * a * b := by have hw : ∀ x, 0 ≤ finiteProductWeight μ x := fun x => prod_nonneg (fun i _ => hμ i (x i)) have ha : 0 ≤ a := (Real.sqrt_nonneg _).trans hf have hθa : 0 ≤ θA * a := (Real.sqrt_nonneg _).trans hA calc _ ≤ ‖cleanRawPairing (finiteProductWeight μ) k (finiteCoordinateComponent μ U U.toList f) g‖ + ‖cleanRawPairing (finiteProductWeight μ) k (f - finiteCoordinateComponent μ U U.toList f) (finiteCoordinateComponent μ V V.toList g)‖ := norm_add_le _ _ _ ≤ Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ U U.toList f)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) g) + Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (f - finiteCoordinateComponent μ U U.toList f)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ V V.toList g)) := add_le_add (clean_raw_pairing_norm_le _ hw k hk _ _) (clean_raw_pairing_norm_le _ hw k hk _ _) _ ≤ (θA * a) * b + a * (θB * b) := by apply add_le_add · exact mul_le_mul hA hg (Real.sqrt_nonneg _) hθa · exact mul_le_mul ((finite_probe_complement_norm_le μ hμ hmass U f).trans hf) hB (Real.sqrt_nonneg _) ha _ = _ := by ring end section open Finset end section open Finset Filter open scoped Topology theorem odd_sieve_moduli_subset (P : Finset ℕ) (D : ℝ) (N : ℕ) (hP : ∀ p ∈ P, p.Prime) (hodd : ∀ p ∈ P, p ≠ 2) (hDN : D ≤ (N : ℝ)) : blockSieveModuli P D ⊆ oddSquarefreeModuli N := by have hprod : Odd (∏ p ∈ P, p) := by apply prod_induction (fun p : ℕ => p) Odd · intro a b ha hb exact ha.mul hb · decide · intro p hp exact (hP p hp).odd_of_ne_two (hodd p hp) intro d hd obtain ⟨hd0, hdD, hdsq, hdvd⟩ := block_sieve_modulus_properties P hP D hd apply mem_filter.mpr refine ⟨mem_Icc.mpr ⟨hd0, Nat.cast_le.mp (hdD.trans hDN)⟩, hdsq, ?_⟩ exact hprod.of_dvd_nat hdvd end section open Finset Filter open scoped Topology noncomputable def candidatePrimitiveTypeIMass (c L q : ℝ) (r jStar N : ℕ) : ℝ := ∑ d ∈ oddSquarefreeModuli N, typeIPrimitiveConductorNormSum d (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u) / (d.totient : ℝ) theorem candidate_nonprincipal_typeI_mass_le_primitive (c L q : ℝ) (r jStar N : ℕ) : candidateNonprincipalTypeIMass c L q r jStar N ≤ candidatePrimitiveTypeIMass c L q r jStar N := by apply sum_le_sum intro d hd have hd0 : 0 < d := (mem_Icc.mp (mem_filter.mp hd).1).1 exact div_le_div_of_nonneg_right (@typeI_nonprincipal_norm_sum_le_conductors ℕ d ⟨hd0.ne'⟩ (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u)) (Nat.cast_nonneg _) theorem eventually_candidate_typeI_remainder_le_primitive {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ q : ℝ, 0 ≤ q → ∀ r jStar N : ℕ, (N : ℝ) ≤ Real.exp L → (∑ d ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d|) ≤ candidatePrimitiveTypeIMass c L q r jStar N + candidateCoefficientWindowMass c L q r jStar * ((16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := by filter_upwards [eventually_candidate_typeI_remainder_bound hc] with L hL intro q hq r jStar N hN exact (hL q hq r jStar N hN).trans (add_le_add (candidate_nonprincipal_typeI_mass_le_primitive c L q r jStar N) le_rfl) end section noncomputable def primeKernelError (C : ℝ) (Q : ℕ) (V a ξ : ℝ) : ℝ := (Q * Q : ℕ) * (((C / V) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) theorem prime_kernel_error_nonneg {C V a ξ : ℝ} {Q : ℕ} (hC : 0 ≤ C) (hV : 0 ≤ V) (ha : 2 ≤ a) (hξ : 0 ≤ ξ) (hQ : 0 < Q) : 0 ≤ primeKernelError C Q V a ξ := by have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hq : (1 : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast Nat.mul_pos hQ hQ have hlogq := Real.log_nonneg hq unfold primeKernelError positivity end section open Finset Classical universe uK uA section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V ρ : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) (cap : ℕ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] variable {K : Type uK} {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (A : ∀ k, SharedActiveLabels (fun g => ↥(P g)) (S k) → Type uA) [∀ k c, Fintype (A k c)] (ΔE DE : ∀ k c, A k c → Fin N → ℤ) end ResiduePath end section open scoped BigOperators Classical theorem two_kernel_supported_rational_bound {X Y : Type*} [Fintype X] [Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (a N : ℕ) (A : ℤ) (V : ℕ) (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (f : X → ℂ) (g : Y → ℂ) (χ : X → ℂ) (ψ : Y → ℂ) (hχ : ∀ x, ‖χ x‖ = 1) (hψ : ∀ y, ‖ψ y‖ = 1) (hπrange : ∀ x, finiteKernelTestTransform μ KA f x ≠ 0 → a ≤ π x ∧ π x < a + N) (hτrange : ∀ y, finiteKernelTestTransform ν KB g y ≠ 0 → A ≤ (τ y : ℤ) ∧ (τ y : ℤ) ≤ A + (V : ℤ)) {C D P Q BA BB : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hP : 0 < P) (hQ : 0 < Q) (hπ : ∀ x, finiteKernelTestTransform μ KA f x ≠ 0 → P ≤ (π x : ℝ)) (hτ : ∀ y, finiteKernelTestTransform ν KB g y ≠ 0 → Q ≤ (τ y : ℝ)) (hEA : (∑ x, μ x * ‖finiteKernelTestTransform μ KA f x‖ ^ 2) ≤ BA * ∑ x, μ x * ‖f x‖ ^ 2) (hEB : (∑ y, ν y * ‖finiteKernelTestTransform ν KB g y‖ ^ 2) ≤ BB * ∑ y, ν y * ‖g y‖ ^ 2) (hμatom : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => π x = m), μ x) ≤ C / (m : ℝ)) (hνatom : ∀ m : ℕ, (∑ y ∈ Finset.univ.filter (fun y => τ y = m), ν y) ≤ D / (m : ℝ)) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) : ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * finiteTwoKernelAverage μ ν KA KB x y (fun d e => χ d * ψ e * (Complex.exp (Complex.I * (2 * Real.pi * (((u : ℝ) / r + β) * τ e) : ℝ))) ^ (π d))‖ ^ 2 ≤ ((1 + 3 * (V : ℝ) / r) * (2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r))) * ((C / P) * BA * ∑ x, μ x * ‖f x‖ ^ 2) * ((D / Q) * BB * ∑ y, ν y * ‖g y‖ ^ 2) := by rw [finite_two_kernel_pairing_modulated] have hb := supported_weighted_product_rational_bilinear_bound π τ a N A V μ ν hμ hν (fun x => χ x * finiteKernelTestTransform μ KA f x) (fun y => ψ y * finiteKernelTestTransform ν KB g y) (fun x hx => hπrange x ((unit_test_modulation_ne_zero_iff χ _ hχ x).mp hx)) (fun y hy => hτrange y ((unit_test_modulation_ne_zero_iff ψ _ hψ y).mp hy)) hC hD hP hQ (fun x hx => hπ x ((unit_test_modulation_ne_zero_iff χ _ hχ x).mp hx)) (fun y hy => hτ y ((unit_test_modulation_ne_zero_iff ψ _ hψ y).mp hy)) hμatom hνatom hr hcop hβ rw [unit_test_modulation_energy μ χ _ hχ, unit_test_modulation_energy ν ψ _ hψ] at hb have hR : 0 ≤ (1 + 3 * (V : ℝ) / r) * (2 * (N : ℝ) + 2 * (r : ℝ) * (1 + Real.log r)) := by have hl := Real.log_nonneg (by exact_mod_cast hr : (1 : ℝ) ≤ r) positivity have hCP : 0 ≤ C / P := div_nonneg hC hP.le have hDQ : 0 ≤ D / Q := div_nonneg hD hQ.le have hTA : 0 ≤ ∑ x, μ x * ‖finiteKernelTestTransform μ KA f x‖ ^ 2 := Finset.sum_nonneg (fun x _ => mul_nonneg (hμ x) (sq_nonneg _)) have hTB : 0 ≤ ∑ y, ν y * ‖finiteKernelTestTransform ν KB g y‖ ^ 2 := Finset.sum_nonneg (fun y _ => mul_nonneg (hν y) (sq_nonneg _)) have hCA := mul_le_mul_of_nonneg_left hEA hCP have hCB := mul_le_mul_of_nonneg_left hEB hDQ have hbound := mul_le_mul (mul_le_mul_of_nonneg_left hCA hR) hCB (mul_nonneg hDQ hTB) (mul_nonneg hR ((mul_nonneg hCP hTA).trans hCA)) exact hb.trans (by simpa only [mul_assoc] using hbound) end section open Finset open scoped Classical theorem bounded_edge_ledger_target_of_nonzero {P : Type*} [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (target : Fin t → P) (H : Finset P) (μ : P → ℝ) (ρ V : ℝ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) (hw : unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e ≠ 0) (hphase : globalBirthBoundedEdgePhase n Δ D t B target H s e.1 e.2.1 e.2.2.1 e.2.2.2 ≠ 0) : (unrestrictedBoundedEventTarget n Δ D t B s e).1 = target := by have hout : (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) e.1 e.2.1 e.2.2.1).1 ≤ B := by by_contra h apply hw simp only [unrestrictedBoundedEventWeight, h, and_false, if_false] have ht : unrestrictedEdgeTarget s.2.2 Sigma.fst e.2.1 e.2.2.1 e.2.2.2 = target ∧ (∀ i, e.2.2.2 i ∉ H) := by by_contra h apply hphase simp only [globalBirthBoundedEdgePhase, h, if_false] simpa only [unrestrictedBoundedEventTarget, dif_pos hout] using ht.1 section Full variable {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → Fin N → ℤ) (target : (g : Fin N) → Fin (S g)ᶜ.card → P g) (H : (g : Fin N) → Finset (P g)) (ω : ∀ c, A c → ℝ) (μ : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) omit [∀ g, DecidableEq (P g)] in theorem full_edge_ledger_local_weight_ne_zero (hw : fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e ≠ 0) (g : Fin N) : unrestrictedBoundedEventWeight (n g) (Δ (productActiveMemorySplit S B x).1 e.1 g) (D (productActiveMemorySplit S B x).1 e.1 g) (μ g) ρ (V g) (S g)ᶜ.card B ((productActiveMemorySplit S B x).2 g) (e.2 g) ≠ 0 := by intro hz apply hw rw [fullActiveEdgeEventWeight_full_caps] split_ifs · rw [prod_eq_zero (mem_univ g) hz, mul_zero] · rfl theorem full_edge_ledger_target_of_nonzero (hw : fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e ≠ 0) (hphase : fullEdgeLedgerPhase n S B A Δ D target H x e ≠ 0) (g : Fin N) : ((productActiveMemorySplit S B (fullActiveEdgeEventTarget n S B A Δ D x e)).2 g).1 = target g := by have hp : globalBirthBoundedEdgePhase (n g) (Δ (productActiveMemorySplit S B x).1 e.1 g) (D (productActiveMemorySplit S B x).1 e.1 g) (S g)ᶜ.card B (target g) (H g) ((productActiveMemorySplit S B x).2 g) (e.2 g).1 (e.2 g).2.1 (e.2 g).2.2.1 (e.2 g).2.2.2 ≠ 0 := by intro hz apply hphase exact prod_eq_zero (mem_univ g) hz unfold fullActiveEdgeEventTarget rw [Equiv.apply_symm_apply] exact bounded_edge_ledger_target_of_nonzero _ _ _ _ _ _ _ _ _ _ _ _ (full_edge_ledger_local_weight_ne_zero n S B A Δ D ω μ ρ V x e hw g) hp end Full end section open Finset Classical section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end end section open Finset open scoped Classical theorem physical_full_shared_label_product {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) (g : G) : (∏ i, ((productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C L q)).1 g i).val) = ∏ j ∈ univ \ C g, (L g (Sum.inl j)).val := by let S := physicalFullSharedIndices (ell := ell) (C g) let T := physicalSharedSlots (ell := ell) (C g) change (∏ i : Fin S.card, (L g (physicalFullSlotIndex (C g) (S.equivFin.symm i).val)).val) = _ calc _ = ∏ i : Fin S.card, (L g (physicalFullSharedEquiv (C g) (S.equivFin.symm i)).val).val := by apply prod_congr rfl intro i _ exact congrArg (fun s => (L g s).val) (finite_partition_equiv_left S T (physicalFullSharedEquiv (C g)) (physicalFullUnsharedEquiv (C g)) (S.equivFin.symm i)) _ = ∏ i : T, (L g i.val).val := (S.equivFin.symm.trans (physicalFullSharedEquiv (C g))).prod_comp (fun i => (L g i.val).val) _ = ∏ i ∈ T, (L g i).val := prod_coe_sort T (fun i => (L g i).val) _ = _ := by simp only [T, physicalSharedSlots, prod_map, Function.Embedding.inl_apply] noncomputable def physicalFullSharedD {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) : ℕ := ∏ g, (∏ i, (c g i).val) * ∏ j : C g, (aux g j).val theorem physical_full_shared_D_eq {G : Type*} [Fintype G] {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) (aux : PhysicalAuxLabels P C) : physicalFullSharedD C (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C L q)).1 aux = physicalD C L aux := by unfold physicalFullSharedD physicalD physicalGroupD apply prod_congr rfl intro g _ rw [physical_full_shared_label_product] end section open Finset open scoped Classical end section open Finset open scoped Classical theorem physical_full_split_state_eq {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) (g : G) : (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C L q)).2 g = ((activeEmbeddingSizeCast (physical_full_unshared_indices_card (ell := ell) (C g)).symm (physicalGroupUnsharedEmbedding C L g) : Fin (physicalFullSharedIndices (C g))ᶜ.card → ↥(P g)), q g) := by apply Prod.ext · rw [physical_full_memory_state_unshared] funext i symm exact active_embedding_size_cast_apply _ _ i · rfl theorem physical_full_split_edge_bounded_events {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell B : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (hlist : physicalListAdmissible C aux L R) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (a b k : ℤ) (hstep : b = a + k * (physicalD C L aux : ℤ)) (q : ∀ g, BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (g : G) (H : Finset ↥(P g)) (β : ↥(P g) → ℝ) (ρ V : ℝ) (F : Finset ↥(P g) → FiniteOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) → ℂ) : let np := fun p : ↥(P g) => p.val let D : ℤ := physicalD C L aux let Δ := -k * D let S := fun g => physicalFullSharedIndices (ell := ell) (C g) let x := (productActiveMemorySplit S B (physicalFullMemoryState C L q)).2 g let y := (productActiveMemorySplit S B (physicalFullMemoryState C R q)).2 g globalBirthEdgeRawRow (physicalGroupUnsharedEmbedding C L g) (physicalGroupUnsharedEmbedding C R g) (physicalGroupPhaseDelta a b g) H (q g).2 (globalBirthRawHitIndices (physicalGroupPhaseDelta a b g) (boundedOrderedTupleToFinite (q g))) β ρ V B F = ∑ e : UnrestrictedBoundedEvent np Δ D (S g)ᶜ.card B x, (unrestrictedBoundedEventWeight np Δ D (fun p => β p / V) ρ V (S g)ᶜ.card B x e : ℂ) * globalBirthBoundedEdgePhase np Δ D (S g)ᶜ.card B y.1 H x e.1 e.2.1 e.2.2.1 e.2.2.2 * F (H ∪ univ.image (unrestrictedBoundedEventTarget np Δ D (S g)ᶜ.card B x e).1) (boundedOrderedTupleToFinite (unrestrictedBoundedEventTarget np Δ D (S g)ᶜ.card B x e).2) := by dsimp only rw [physical_full_split_state_eq C L q g, physical_full_split_state_eq C R q g] have hδ := physical_group_phase_delta_as_integer_step (P := P) a b k (physicalD C L aux : ℤ) hstep g simpa only [hδ] using global_birth_bounded_edge_events_size_cast (fun p : ↥(P g) => p.val) (-k * (physicalD C L aux : ℤ)) (physicalD C L aux : ℤ) (physical_full_unshared_indices_card (ell := ell) (C g)).symm B (physicalGroupUnsharedEmbedding C L g) (physicalGroupUnsharedEmbedding C R g) (physical_group_unshared_source_not_dvd C L aux hP hdis hlist.2.1 g) (physical_group_unshared_target_not_dvd C L R aux hlist hP hdis g) H (q g) β ρ V F end section open Finset open scoped Classical /- The same bound measured against the original vectors before tail averaging. -/ theorem finite_signed_ideal_block_envelope {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ y, μ i y = 1) (U V : Finset I) (k : (∀ i, X i) → ℂ) (hk : ∀ x, ‖k x‖ ≤ 1) (K : Finset I → Finset I → (∀ i, X i) → (∀ i, X i) → ℂ) (f g : (∀ i, X i) → ℂ) (a b θA θB : ℝ) (hf : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) f) ≤ a) (hg : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) g) ≤ b) (hA : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ U U.toList f)) ≤ θA * a) (hB : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ V V.toList g)) ≤ θB * b) (hzero : ∀ S ∈ U.powerset, ∀ T ∈ V.powerset, ∀ A ∈ cleanNonemptySubsets U, ∀ B ∈ cleanNonemptySubsets V, ¬(A ⊆ U \ S ∧ B ⊆ V \ T) → cleanKernelPairing (finiteProductWeight μ) (K A B) (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g) = 0) (ε : ℝ) (hε : 0 ≤ ε) (herr : ∀ S ∈ U.powerset, ∀ T ∈ V.powerset, ∀ A ∈ cleanNonemptySubsets (U \ S), ∀ B ∈ cleanNonemptySubsets (V \ T), ‖cleanKernelPairing (finiteProductWeight μ) (K A B) (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g) - cleanRawPairing (finiteProductWeight μ) k (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g)‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ S U.toList f)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ T V.toList g))) : ‖cleanRawPairing (finiteProductWeight μ) k f g - ∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight μ) (K A B) f g‖ ≤ (θA + θB + (3 : ℝ) ^ (U.card + V.card) * ε) * a * b := by have hc := finite_probe_signed_cancellation_bound μ hμ hmass U V k K f g hzero ε hε herr have he := finite_exceptional_pairing_envelope μ hμ hmass U V k hk f g a b θA θB hf hg hA hB have ha : 0 ≤ a := (Real.sqrt_nonneg _).trans hf have hab := mul_le_mul hf hg (Real.sqrt_nonneg _) ha have hscale : (3 : ℝ) ^ (U.card + V.card) * ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) g) ≤ (3 : ℝ) ^ (U.card + V.card) * ε * a * b := by have hn : 0 ≤ (3 : ℝ) ^ (U.card + V.card) * ε := mul_nonneg (by positivity) hε simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hab hn calc _ ≤ _ := hc _ ≤ (θA + θB) * a * b + (3 : ℝ) ^ (U.card + V.card) * ε * a * b := add_le_add he hscale _ = _ := by ring end section open scoped BigOperators Classical theorem rational_kernel_reproduction {X Y : Type*} [Fintype X] [Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (x : X) (y : Y) {r Q : ℕ} (hr : 0 < r) (hrQ : r ≤ Q) (u : ℤ) (hπ : ∀ d, (π d).Coprime r) (hτ : ∀ e, (τ e).Coprime r) {εA εB : ℝ} (hεA : 0 ≤ εA) (hεB : 0 ≤ εB) (hA : ∀ χ : DirichletCharacter ℂ r, ‖(∑ d, (μ d : ℂ) * KA d x * χ (π d : ZMod r)) - χ (π x : ZMod r)‖ ≤ εA) (hB : ∀ χ : DirichletCharacter ℂ r, ‖(∑ e, (ν e : ℂ) * KB e y * χ (τ e : ZMod r)) - χ (τ y : ZMod r)‖ ≤ εB) : ‖finiteTwoKernelAverage μ ν KA KB x y (fun d e => Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (π d * τ e)) : ℝ))) - Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (π x * τ y)) : ℝ))‖ ≤ Real.sqrt (Q : ℝ) * (εA + εB + εA * εB) := by obtain ⟨c, hc, he⟩ := rational_bilinear_character_expansion hr hrQ u let χA := fun (ψ : AddChar (Additive (ZMod r)ˣ) ℂ) (d : X) => unitAddCharDirichlet ψ (π d : ZMod r) let χB := fun (ψ : AddChar (Additive (ZMod r)ˣ) ℂ) (e : Y) => unitAddCharDirichlet ψ (τ e : ZMod r) have hphase (d : X) (e : Y) : (∑ ψ, c ψ * (χA ψ d * χB ψ e)) = Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (π d * τ e)) : ℝ)) := by simpa only [χA, χB, mul_assoc] using he (π d) (τ e) (hπ d) (hτ e) have hb := finite_two_kernel_expansion_error Finset.univ μ ν KA KB x y c χA χB εA εB (Real.sqrt (Q : ℝ)) hεA hεB hc (fun ψ _ => (unitAddCharDirichlet ψ).norm_le_one _) (fun ψ _ => (unitAddCharDirichlet ψ).norm_le_one _) (fun ψ _ => hA (unitAddCharDirichlet ψ)) (fun ψ _ => hB (unitAddCharDirichlet ψ)) simpa only [hphase] using hb end section open Finset Classical section variable {J K G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (hpositive : ∀ g (p : P g), 0 < p.val) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hbaseline : ∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels (fun g => P g) (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (q : J → ℝ) include hMass hbaseline end end section open Finset Classical end section open scoped BigOperators Classical theorem rational_kernel_multiplier_comparison {X Y : Type*} [Fintype X] [Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (μ : X → ℝ) (ν : Y → ℝ) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (x : X) (y : Y) {r Q : ℕ} (hr : 0 < r) (hrQ : r ≤ Q) (u : ℤ) (hπ : ∀ d, (π d).Coprime r) (hτ : ∀ e, (τ e).Coprime r) {εA εB δ RA RB : ℝ} (hεA : 0 ≤ εA) (hεB : 0 ≤ εB) (hA : ∀ χ : DirichletCharacter ℂ r, ‖(∑ d, (μ d : ℂ) * KA d x * χ (π d : ZMod r)) - χ (π x : ZMod r)‖ ≤ εA) (hB : ∀ χ : DirichletCharacter ℂ r, ‖(∑ e, (ν e : ℂ) * KB e y * χ (τ e : ZMod r)) - χ (τ y : ZMod r)‖ ≤ εB) (hμ : ∀ d, 0 ≤ μ d) (hν : ∀ e, 0 ≤ ν e) (hδ : 0 ≤ δ) (hRA : ∑ d, μ d * ‖KA d x‖ ≤ RA) (hRB : ∑ e, ν e * ‖KB e y‖ ≤ RB) (M : X → Y → ℂ) (hMnorm : ‖M x y‖ ≤ 1) (hM : ∀ d e, KA d x * KB e y ≠ 0 → ‖M d e - M x y‖ ≤ δ) : ‖finiteTwoKernelAverage μ ν KA KB x y (fun d e => M d e * Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (π d * τ e)) : ℝ))) - M x y * Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (π x * τ y)) : ℝ))‖ ≤ δ * RA * RB + Real.sqrt (Q : ℝ) * (εA + εB + εA * εB) := by let phase := fun d e => Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (π d * τ e)) : ℝ)) have hp (d : X) (e : Y) : ‖phase d e‖ ≤ 1 := by simp only [phase, Complex.norm_exp, Complex.mul_re, Complex.I_re, zero_mul, Complex.ofReal_im, mul_zero, sub_self, Real.exp_zero, le_refl] have hrep := rational_kernel_reproduction π τ μ ν KA KB x y hr hrQ u hπ hτ hεA hεB hA hB have hchange := finite_two_kernel_multiplier_replacement μ ν KA KB x y M phase δ RA RB hμ hν hδ hRA hRB hp hM change ‖finiteTwoKernelAverage μ ν KA KB x y (fun d e => M d e * phase d e) - M x y * phase x y‖ ≤ _ calc _ = ‖(finiteTwoKernelAverage μ ν KA KB x y (fun d e => M d e * phase d e) - M x y * finiteTwoKernelAverage μ ν KA KB x y phase) + M x y * (finiteTwoKernelAverage μ ν KA KB x y phase - phase x y)‖ := by congr 1 ring _ ≤ ‖finiteTwoKernelAverage μ ν KA KB x y (fun d e => M d e * phase d e) - M x y * finiteTwoKernelAverage μ ν KA KB x y phase‖ + ‖M x y * (finiteTwoKernelAverage μ ν KA KB x y phase - phase x y)‖ := norm_add_le _ _ _ ≤ δ * RA * RB + Real.sqrt (Q : ℝ) * (εA + εB + εA * εB) := by apply add_le_add hchange rw [norm_mul] exact (mul_le_mul_of_nonneg_right hMnorm (norm_nonneg _)).trans (by simpa only [one_mul] using hrep) theorem major_arc_rational_phase_factor (ζ β : ℝ) {r : ℕ} (u : ℤ) {n : ℝ} (hn : 0 < n) : majorArcMultiplier ζ β (Real.log n) * Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * n) : ℝ)) = Complex.exp (Complex.I * (ζ * Real.log n + 2 * Real.pi * (((u : ℝ) / r + β) * n) : ℝ)) := by rw [majorArcMultiplier, Real.exp_log hn, ← Complex.exp_add] congr 1 push_cast ring end section open Finset abbrev PhysicalFullBoundedState {N : ℕ} (P : Fin N → Finset ℕ) (J ell B : ℕ) := ProductBoundedOrderedState (fun g => ↥(P g)) (fun g => UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) (fun _ => J + ell) B noncomputable def physicalFullEdgeD {N J ell : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) (_g : Fin N) : ℤ := physicalFullSharedD C c aux noncomputable def physicalFullEdgeDelta {N J ell : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) (g : Fin N) : ℤ := -k * physicalFullEdgeD C c aux g abbrev PhysicalFullEdgeEvent {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (x : PhysicalFullBoundedState P J ell B) := FullActiveEdgeEvent (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x theorem physical_full_edge_D_at_state {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (aux : PhysicalAuxLabels P C) (g : Fin N) : physicalFullEdgeD C (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C L q)).1 aux g = (physicalD C L aux : ℤ) := by unfold physicalFullEdgeD rw [physical_full_shared_D_eq] theorem physical_full_edge_delta_at_state {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L : PhysicalMarkLists P J ell) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (aux : PhysicalAuxLabels P C) (g : Fin N) : physicalFullEdgeDelta C k (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C L q)).1 aux g = -k * (physicalD C L aux : ℤ) := by unfold physicalFullEdgeDelta rw [physical_full_edge_D_at_state] end section open Finset Classical section variable {I J K G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (hpositive : ∀ g (p : P g), 0 < p.val) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hbaseline : ∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) {M : G → ℕ} (S : I → K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ i k, SharedActiveLabels (fun g => P g) (S i k) → Type*) [∀ i k c, Fintype (A i k c)] (Δ D : ∀ i k c, A i k c → G → ℤ) (ω : ∀ i k c, A i k c → ℝ) (q : I → J → ℝ) include hMass hbaseline end end section open scoped BigOperators Classical theorem prime_major_arc_comparison (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I J : Type u} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I) (R : J → Finset ℕ) (W : J → ℝ) (j : J), (∀ k, 0 < V k) → (∀ k, 0 < W k) → (∀ k p, p ∈ P k → p.Prime ∧ Q < p) → (∀ k p, p ∈ R k → p.Prime ∧ Q < p) → (∀ k, ∑ p ∈ P k, 1 / (p : ℝ) = V k) → (∀ k, ∑ p ∈ R k, 1 / (p : ℝ) = W k) → ∀ a b a' b' : ℝ, P i = primeBand a b → R j = primeBand a' b' → 2 ≤ a → 0 ≤ b → 2 ≤ a' → 0 ≤ b' → ∀ h ξ : ℝ, 0 < h → 0 < ξ → ∀ keptP keptR : Finset ℤ, (∀ d ∈ keptP, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ k, (x k).val : ℕ))) d) → (∀ d ∈ keptR, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := R) W)) (fun y => upperLogCell h (Real.log (∏ k, (y k).val : ℕ))) d) → ∀ (x : ∀ k, P k) (y : ∀ k, R k), upperLogCell h (Real.log (∏ k, (x k).val : ℕ)) ∈ keptP → upperLogCell h (Real.log (∏ k, (y k).val : ℕ)) ∈ keptR → ∀ r : ℕ, 0 < r → r ≤ Q → ∀ u : ℤ, ∀ ζ β B : ℝ, 0 ≤ B → ((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ) ≤ B → (∀ d e, primeProductIdealKernel P V Q h keptP d x * primeProductIdealKernel R W Q h keptR e y ≠ 0 → ((∏ k, (d k).val : ℕ) : ℝ) * (∏ k, (e k).val : ℕ) ≤ B) → ‖finiteTwoKernelAverage (finiteProductWeight (physicalLabelLaw V)) (finiteProductWeight (physicalLabelLaw W)) (primeProductIdealKernel P V Q h keptP) (primeProductIdealKernel R W Q h keptR) x y (fun d e => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (d k).val : ℕ) : ℝ) * (∏ k, (e k).val : ℕ)) + 2 * Real.pi * (((u : ℝ) / r + β) * (((∏ k, (d k).val : ℕ) : ℝ) * (∏ k, (e k).val : ℕ))) : ℝ))) - Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ)) + 2 * Real.pi * (((u : ℝ) / r + β) * (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ))) : ℝ))‖ ≤ (2 * h * (|ζ| + 2 * Real.pi * |β| * B)) * (Q * Q : ℕ) * (Q * Q : ℕ) + Real.sqrt (Q : ℝ) * (primeKernelError C Q (V i) a ξ + primeKernelError C Q (W j) a' ξ + primeKernelError C Q (V i) a ξ * primeKernelError C Q (W j) a' ξ) := by obtain ⟨C, hC, hrep⟩ := prime_product_ideal_dirichlet_reproduction hZ refine ⟨C, hC, ?_⟩ intro Q hQ I J _ _ _ _ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hξ keptP keptR hkeptP hkeptR x y hx hy r hr hrQ u ζ β B hB hxy hsupport let π : (∀ k, P k) → ℕ := fun d => ∏ k, (d k).val let τ : (∀ k, R k) → ℕ := fun e => ∏ k, (e k).val have hπpos (d : ∀ k, P k) : (0 : ℝ) < π d := by exact_mod_cast Finset.prod_pos (fun k _ => (hP k (d k).val (d k).property).1.pos) have hτpos (e : ∀ k, R k) : (0 : ℝ) < τ e := by exact_mod_cast Finset.prod_pos (fun k _ => (hR k (e k).val (e k).property).1.pos) have hπ (d : ∀ k, P k) : (π d).Coprime r := Nat.coprime_prod_left_iff.mpr (fun k _ => prime_above_modulus_coprime (hP k (d k).val (d k).property).1 hr hrQ (hP k (d k).val (d k).property).2) have hτ (e : ∀ k, R k) : (τ e).Coprime r := Nat.coprime_prod_left_iff.mpr (fun k _ => prime_above_modulus_coprime (hR k (e k).val (e k).property).1 hr hrQ (hR k (e k).val (e k).property).2) have hμ (d : ∀ k, P k) : 0 ≤ finiteProductWeight (physicalLabelLaw V) d := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg V (fun k => (hV k).le) k (d k)) have hν (e : ∀ k, R k) : 0 ≤ finiteProductWeight (physicalLabelLaw W) e := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg W (fun k => (hW k).le) k (e k)) let M := fun d e => majorArcMultiplier ζ β (Real.log ((π d : ℝ) * τ e)) have hm (d : ∀ k, P k) (e : ∀ k, R k) (hne : primeProductIdealKernel P V Q h keptP d x * primeProductIdealKernel R W Q h keptR e y ≠ 0) : ‖M d e - M x y‖ ≤ 2 * h * (|ζ| + 2 * Real.pi * |β| * B) := by exact major_arc_multiplier_log_products ζ β _ _ _ _ B h (hπpos d) (hτpos e) (hπpos x) (hτpos y) (prime_ideal_kernel_log_localized P V Q hh keptP d x (mul_ne_zero_iff.mp hne).1).le (prime_ideal_kernel_log_localized R W Q hh keptR e y (mul_ne_zero_iff.mp hne).2).le (hsupport d e hne) hxy have hmain := rational_kernel_multiplier_comparison π τ (finiteProductWeight (physicalLabelLaw V)) (finiteProductWeight (physicalLabelLaw W)) (primeProductIdealKernel P V Q h keptP) (primeProductIdealKernel R W Q h keptR) x y hr hrQ u hπ hτ (prime_kernel_error_nonneg hC.le (hV i).le ha hξ.le hQ) (prime_kernel_error_nonneg hC.le (hW j).le ha' hξ.le hQ) (fun χ => hrep Q hQ P V i hV hP hVP a b hPi ha hb h ξ hh hξ keptP hkeptP r hr hrQ χ x hx) (fun χ => hrep Q hQ R W j hW hR hWR a' b' hRj ha' hb' h ξ hh hξ keptR hkeptR r hr hrQ χ y hy) hμ hν (by positivity) (prime_ideal_kernel_abs_column_le P V (fun k => (hV k).le) Q h keptP (fun d hd => hξ.trans_le (hkeptP d hd)) x) (prime_ideal_kernel_abs_column_le R W (fun k => (hW k).le) Q h keptR (fun d hd => hξ.trans_le (hkeptR d hd)) y) M (by exact (major_arc_multiplier_norm ζ β _).le) hm have hphase (d : ∀ k, P k) (e : ∀ k, R k) : M d e * Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (π d * τ e)) : ℝ)) = Complex.exp (Complex.I * (ζ * Real.log ((π d : ℝ) * τ e) + 2 * Real.pi * (((u : ℝ) / r + β) * ((π d : ℝ) * τ e)) : ℝ)) := by simpa only [Nat.cast_mul] using major_arc_rational_phase_factor ζ β u (mul_pos (hπpos d) (hτpos e)) simpa only [hphase, π, τ] using hmain end section open Finset open scoped Classical section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L R : PhysicalMarkLists P J ell) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def physicalFullEdgeRawRow (aux : PhysicalAuxLabels P C) (g : Fin N) (K : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val) → ℂ) (u : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val)) : ℂ := globalBirthEdgeRawRow (physicalGroupUnsharedEmbedding C L g) (physicalGroupUnsharedEmbedding C R g) (fun p : ↥(P g) => ((-k * (physicalD C L aux : ℤ) : ℤ) : ZMod p.val)) u.1 u.2.2 (globalBirthRawHitIndices (fun p : ↥(P g) => ((-k * (physicalD C L aux : ℤ) : ℤ) : ZMod p.val)) u.2) (β g) ρ (V g) B (fun H q => K (H, q)) theorem physical_full_edge_local_row (aux : PhysicalAuxLabels P C) (hlist : physicalListAdmissible C aux L R) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (g : Fin N) (K : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val) → ℂ) : let S := fun g => physicalFullSharedIndices (ell := ell) (C g) let x := physicalFullMemoryState C L q let y := physicalFullMemoryState C R q let c := (productActiveMemorySplit S B x).1 let s := (productActiveMemorySplit S B x).2 g let target := ((productActiveMemorySplit S B y).2 g).1 let Δ := physicalFullEdgeDelta C k c aux g let D := physicalFullEdgeD C c aux g physicalFullEdgeRawRow (B := B) C k L R β ρ V aux g K (H g, boundedOrderedTupleToFinite (q g)) = ∑ e : UnrestrictedBoundedEvent (fun p : ↥(P g) => p.val) Δ D (S g)ᶜ.card B s, (unrestrictedBoundedEventWeight (fun p : ↥(P g) => p.val) Δ D (fun p => β g p / V g) ρ (V g) (S g)ᶜ.card B s e : ℂ) * globalBirthBoundedEdgePhase (fun p : ↥(P g) => p.val) Δ D (S g)ᶜ.card B target (H g) s e.1 e.2.1 e.2.2.1 e.2.2.2 * K (H g ∪ univ.image (unrestrictedBoundedEventTarget (fun p : ↥(P g) => p.val) Δ D (S g)ᶜ.card B s e).1, boundedOrderedTupleToFinite (unrestrictedBoundedEventTarget (fun p : ↥(P g) => p.val) Δ D (S g)ᶜ.card B s e).2) := by dsimp only rw [physical_full_edge_delta_at_state C k L q aux g, physical_full_edge_D_at_state C L q aux g] have h := physical_full_split_edge_bounded_events C L R aux hlist hP hdis 0 (k * (physicalD C L aux : ℤ)) k (by simp only [zero_add]) q g (H g) (β g) ρ (V g) (fun H q => K (H, q)) have hδ := physical_group_phase_delta_as_integer_step (P := P) 0 (k * (physicalD C L aux : ℤ)) k (physicalD C L aux : ℤ) (by simp only [zero_add]) g simp only [hδ] at h convert h using 1 rfl end Physical section Full variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L R : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) noncomputable def physicalFullEdgePhase (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) : ℂ := if physicalListAdmissible C e.1 L R then fullEdgeLedgerPhase (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) (fun g => ((productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C R q)).2 g).1) H (physicalFullMemoryState C L q) e else 0 theorem physical_full_edge_phase_norm_le (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) : ‖physicalFullEdgePhase C k L R H q e‖ ≤ 1 := by unfold physicalFullEdgePhase split_ifs · exact full_edge_ledger_phase_norm_le _ _ _ _ _ _ _ _ _ _ · simp only [norm_zero, zero_le_one] end Full end section open Finset Classical section variable {I J K G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (hpositive : ∀ g (p : P g), 0 < p.val) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hbaseline : ∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) {M : G → ℕ} (S : I → K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ i k, SharedActiveLabels (fun g => P g) (S i k) → Type*) [∀ i k c, Fintype (A i k c)] (Δ D : ∀ i k c, A i k c → G → ℤ) (ω : ∀ i k c, A i k c → ℝ) (q : I → J → ℝ) include hMass hbaseline end end section open Finset open scoped Classical section Full variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L R : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (ω : ∀ _c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) theorem physical_full_edge_target_of_nonzero (hw : fullActiveEdgeEventWeight (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e ≠ 0) (hp : physicalFullEdgePhase C k L R H q e ≠ 0) : let y := fullActiveEdgeEventTarget (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) (physicalFullMemoryState C L q) e y = physicalFullMemoryState C R (fun g => (y g).2) := by have hlist : physicalListAdmissible C e.1 L R := by by_contra h apply hp simp only [physicalFullEdgePhase, h, if_false] have hphase : fullEdgeLedgerPhase (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) (fun g => ((productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C R q)).2 g).1) H (physicalFullMemoryState C L q) e ≠ 0 := by simpa only [physicalFullEdgePhase, if_pos hlist] using hp dsimp only apply (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B).injective apply Prod.ext · rw [fullActiveEdgeEventTarget_shared] exact physical_full_memory_state_shared C L R hlist.1 q _ · funext g apply Prod.ext · exact full_edge_ledger_target_of_nonzero _ _ _ _ _ _ _ _ ω μ ρ V _ e hw hphase g · rfl end Full end section open Finset section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) end ResiduePath end section open Finset Classical end section open Finset Classical def fullDoubledGhostV {J K G : Type*} (V : G → ℝ) : Option (J ⊕ K) → G → ℝ | some (Sum.inl _), g => 2 * V g | _, g => V g section variable {J K G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → G → ℤ) end end section open Finset Classical noncomputable def countTailPhase (a : ℝ) (r c : ℕ) (z : ℂ) : ℂ := if r ≤ c then ((a ^ r / a ^ c : ℝ) : ℂ) * z else 0 theorem countTailPhase_norm_le_one {a : ℝ} (ha : 1 ≤ a) (r c : ℕ) {z : ℂ} (hz : ‖z‖ ≤ 1) : ‖countTailPhase a r c z‖ ≤ 1 := by have ha0 : 0 < a := zero_lt_one.trans_le ha by_cases hrc : r ≤ c · simp only [countTailPhase, if_pos hrc, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (div_nonneg (pow_nonneg ha0.le _) (pow_nonneg ha0.le _))] calc _ ≤ (a ^ r / a ^ c) * 1 := mul_le_mul_of_nonneg_left hz (by positivity) _ ≤ 1 := by rw [mul_one] exact (div_le_one (pow_pos ha0 _)).mpr (pow_le_pow_right₀ ha hrc) · simp [countTailPhase, hrc] theorem count_tail_weight_identity {a : ℝ} (ha : 0 < a) (r c : ℕ) (w : ℝ) (z : ℂ) : (w : ℂ) * (if r ≤ c then z else 0) = (((a ^ r)⁻¹ : ℝ) : ℂ) * ((a ^ c * w : ℝ) : ℂ) * countTailPhase a r c z := by by_cases hrc : r ≤ c · have har : ((a ^ r : ℝ) : ℂ) ≠ 0 := by exact_mod_cast (pow_ne_zero r (ne_of_gt ha)) have hac : ((a ^ c : ℝ) : ℂ) ≠ 0 := by exact_mod_cast (pow_ne_zero c (ne_of_gt ha)) simp only [countTailPhase, if_pos hrc, Complex.ofReal_inv, Complex.ofReal_mul, Complex.ofReal_div] field_simp · simp [countTailPhase, hrc] theorem finite_event_path_counted_tail_eq {K X : Type*} (E : K → X → Type*) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (w w' : ∀ k x, E k x → ℝ) (steps : List K) (count : ∀ x, FiniteEventPath E target steps x → ℕ) {a : ℝ} (ha : 0 < a) (hw : ∀ x p, finiteEventPathWeight E target w' steps x p = a ^ count x p * finiteEventPathWeight E target w steps x p) (r : ℕ) (phase : ∀ x, FiniteEventPath E target steps x → ℂ) (f : X → ℂ) (x : X) : finiteEventPathAction E target w steps (fun x p => if r ≤ count x p then phase x p else 0) f x = (((a ^ r)⁻¹ : ℝ) : ℂ) * finiteEventPathAction E target w' steps (fun x p => countTailPhase a r (count x p) (phase x p)) f x := by simp only [finiteEventPathAction, mul_sum] apply sum_congr rfl intro p _ rw [hw] have h := count_tail_weight_identity ha r (count x p) (finiteEventPathWeight E target w steps x p) (phase x p) simpa only [mul_assoc] using congrArg (fun z => z * f (finiteEventPathTerminal E target steps x p)) h theorem finiteWeightedEnergy_const_mul {X : Type*} [Fintype X] (μ : X → ℝ) (c : ℂ) (f : X → ℂ) : finiteWeightedEnergy μ (fun x => c * f x) = ‖c‖ ^ 2 * finiteWeightedEnergy μ f := by simp only [finiteWeightedEnergy, norm_mul, mul_pow, mul_sum] apply sum_congr rfl intro x _ ring end section open scoped BigOperators Classical theorem prime_ideal_kernel_factor_two {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (Q : ℕ) (hp : ∀ i p, p ∈ P i → 0 < p) {h : ℝ} (hh : 0 < h) (hh2 : h ≤ Real.log 2) (kept : Finset ℤ) (d x : ∀ i, P i) (hne : primeProductIdealKernel P V Q h kept d x ≠ 0) : ((∏ i, (x i).val : ℕ) : ℝ) / 2 ≤ ((∏ i, (d i).val : ℕ) : ℝ) ∧ ((∏ i, (d i).val : ℕ) : ℝ) ≤ 2 * ((∏ i, (x i).val : ℕ) : ℝ) := by have hd : (0 : ℝ) < (∏ i, (d i).val : ℕ) := by exact_mod_cast Finset.prod_pos (fun i _ => hp i (d i).val (d i).property) have hx : (0 : ℝ) < (∏ i, (x i).val : ℕ) := by exact_mod_cast Finset.prod_pos (fun i _ => hp i (x i).val (x i).property) exact positive_log_distance_le_factor_two hd hx ((prime_ideal_kernel_log_localized P V Q hh kept d x hne).le.trans hh2) theorem prime_kernel_pair_dyadic_cap {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] (P : I → Finset ℕ) (V : I → ℝ) (R : J → Finset ℕ) (W : J → ℝ) (Q : ℕ) (hP : ∀ i p, p ∈ P i → 0 < p) (hR : ∀ j p, p ∈ R j → 0 < p) {h : ℝ} (hh : 0 < h) (hh2 : h ≤ Real.log 2) (keptP keptR : Finset ℤ) {U T : ℝ} (hU : 0 ≤ U) (hT : 0 ≤ T) (x : ∀ i, P i) (y : ∀ j, R j) (hx : ((∏ i, (x i).val : ℕ) : ℝ) ≤ 2 * U) (hy : ((∏ j, (y j).val : ℕ) : ℝ) ≤ 2 * T) : ((∏ i, (x i).val : ℕ) : ℝ) * ((∏ j, (y j).val : ℕ) : ℝ) ≤ 16 * U * T ∧ ∀ (d : ∀ i, P i) (e : ∀ j, R j), primeProductIdealKernel P V Q h keptP d x * primeProductIdealKernel R W Q h keptR e y ≠ 0 → ((∏ i, (d i).val : ℕ) : ℝ) * ((∏ j, (e j).val : ℕ) : ℝ) ≤ 16 * U * T := by have hcap {p q : ℝ} (hp : 0 ≤ p) (hq : 0 ≤ q) (hpU : p ≤ 4 * U) (hqT : q ≤ 4 * T) : p * q ≤ 16 * U * T := by have hm := mul_le_mul hpU hqT hq (by positivity : 0 ≤ 4 * U) nlinarith constructor · exact hcap (Nat.cast_nonneg _) (Nat.cast_nonneg _) (by linarith) (by linarith) · intro d e hde have hd := (prime_ideal_kernel_factor_two P V Q hP hh hh2 keptP d x (mul_ne_zero_iff.mp hde).1).2 have he := (prime_ideal_kernel_factor_two R W Q hR hh hh2 keptR e y (mul_ne_zero_iff.mp hde).2).2 exact hcap (Nat.cast_nonneg _) (Nat.cast_nonneg _) (by linarith) (by linarith) end section open scoped Classical def finiteGroupFlattenEquiv {G : Type*} {I X : G → Type*} : (∀ g, I g → X g) ≃ (∀ a : Sigma I, X a.1) := (Equiv.piCurry (fun (g : G) (_ : I g) => X g)).symm theorem finite_group_unflatten_apply {G : Type*} {I X : G → Type*} (x : ∀ a : Sigma I, X a.1) (g : G) (i : I g) : finiteGroupFlattenEquiv.symm x g i = x ⟨g, i⟩ := rfl def finiteGroupFlattenFunction {G E : Type*} {I X : G → Type*} (f : (∀ g, I g → X g) → E) : (∀ a : Sigma I, X a.1) → E := fun x => f (finiteGroupFlattenEquiv.symm x) section variable {G : Type*} [sharedInstance1 : Fintype G] {I X : G → Type*} [sharedInstance3 : ∀ g, Fintype (I g)] include G sharedInstance1 I X sharedInstance3 theorem finite_product_weight_flatten (μ : ∀ g, X g → ℝ) (x : ∀ g, I g → X g) : finiteProductWeight (fun a : Sigma I => μ a.1) (finiteGroupFlattenEquiv x) = finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g)) x := by unfold finiteProductWeight exact Fintype.prod_sigma (fun a : Sigma I => μ a.1 (x a.1 a.2)) theorem finite_product_weight_unflatten (μ : ∀ g, X g → ℝ) (x : ∀ a : Sigma I, X a.1) : finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g)) (finiteGroupFlattenEquiv.symm x) = finiteProductWeight (fun a : Sigma I => μ a.1) x := by simpa only [Equiv.apply_symm_apply] using (finite_product_weight_flatten μ (finiteGroupFlattenEquiv.symm x)).symm theorem finite_group_flatten_energy [∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (f : (∀ g, I g → X g) → ℂ) : finiteWeightedEnergy (finiteProductWeight (fun a : Sigma I => μ a.1)) (finiteGroupFlattenFunction f) = finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f := by have h := (finiteGroupFlattenEquiv (I := I) (X := X)).symm.sum_comp (fun x => finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g)) x * ‖f x‖ ^ 2) simpa only [finiteWeightedEnergy, finiteGroupFlattenFunction, finite_product_weight_unflatten] using h end end section open Finset theorem finite_sigma_toList_perm {G : Type*} [DecidableEq G] {I : G → Type*} [∀ g, DecidableEq (I g)] (s : Finset G) (B : ∀ g, Finset (I g)) : (s.toList.sigma (fun g => (B g).toList)).Perm (s.sigma B).toList := by apply List.perm_of_nodup_nodup_toFinset_eq (s.nodup_toList.sigma (fun g => (B g).nodup_toList)) (s.sigma B).nodup_toList ext a rcases a with ⟨g, i⟩ simp section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {I : G → Type*} [sharedInstance4 : ∀ g, DecidableEq (I g)] (s : Finset G) (A B : ∀ g, Finset (I g)) include G sharedInstance1 sharedInstance2 I sharedInstance4 s A B theorem finite_sigma_outside_inside_disjoint : Disjoint ((sᶜ).sigma B) (s.sigma (fun g => A g ∪ B g)) := by apply disjoint_left.mpr intro a ha hb exact (mem_compl.mp (mem_sigma.mp ha).1) (mem_sigma.mp hb).1 theorem finite_sigma_outside_inside_union : (sᶜ).sigma B ∪ s.sigma (fun g => A g ∪ B g) = s.sigma A ∪ univ.sigma B := by ext a by_cases h : a.1 ∈ s <;> simp [h] end theorem finite_sigma_disjoint_of_fiber_disjoint {G : Type*} [DecidableEq G] {I : G → Type*} [∀ g, DecidableEq (I g)] (s t : Finset G) (A B : ∀ g, Finset (I g)) (hAB : ∀ g, Disjoint (A g) (B g)) : Disjoint (s.sigma A) (t.sigma B) := by apply disjoint_left.mpr intro a ha hb exact disjoint_left.mp (hAB a.1) (mem_sigma.mp ha).2 (mem_sigma.mp hb).2 theorem finite_sigma_probe_tail_disjoint {G : Type*} [Fintype G] [DecidableEq G] {I : G → Type*} [∀ g, DecidableEq (I g)] (s : Finset G) (A B : ∀ g, Finset (I g)) (hAB : ∀ g, Disjoint (A g) (B g)) : Disjoint (s.sigma A) (univ.sigma B) := finite_sigma_disjoint_of_fiber_disjoint s univ A B hAB theorem finite_disjoint_toList_append_perm {I : Type*} [DecidableEq I] (A B : Finset I) (hAB : Disjoint A B) : (A.toList ++ B.toList).Perm (A ∪ B).toList := by have hdis : List.Disjoint A.toList B.toList := by intro i hiA hiB exact disjoint_left.mp hAB (mem_toList.mp hiA) (mem_toList.mp hiB) apply List.perm_of_nodup_nodup_toFinset_eq (A.nodup_toList.append B.nodup_toList hdis) (A ∪ B).nodup_toList simp end section open Finset universe u v w section Phase variable {K : Type u} {X : Type v} (E : K → X → Type w) (target : ∀ k x, E k x → X) (phase : ∀ k x, E k x → ℂ) def finiteEventLocalPhase : ∀ ks x, FiniteEventPath E target ks x → ℂ | [], _, _ => 1 | k :: ks, x, ⟨e, p⟩ => phase k x e * finiteEventLocalPhase ks (target k x e) p variable [∀ k x, Fintype (E k x)] (weight : ∀ k x, E k x → ℝ) noncomputable def finiteLocalPhasedRow (k : K) (F : X → ℂ) (x : X) : ℂ := ∑ e : E k x, (weight k x e : ℂ) * phase k x e * F (target k x e) theorem finite_event_local_phase_cons (k : K) (ks : List K) (F : X → ℂ) (x : X) : finiteEventPathAction E target weight (k :: ks) (finiteEventLocalPhase E target phase (k :: ks)) F x = finiteLocalPhasedRow E target phase weight k (finiteEventPathAction E target weight ks (finiteEventLocalPhase E target phase ks) F) x := by classical let _ : ∀ e : E k x, Fintype (FiniteEventPath E target ks (target k x e)) := fun e => finiteEventPathFintype E target ks (target k x e) change (∑ p : (Σ e : E k x, FiniteEventPath E target ks (target k x e)), ((weight k x p.1 * finiteEventPathWeight E target weight ks _ p.2 : ℝ) : ℂ) * (phase k x p.1 * finiteEventLocalPhase E target phase ks _ p.2) * F (finiteEventPathTerminal E target ks _ p.2)) = _ rw [Fintype.sum_sigma] unfold finiteLocalPhasedRow finiteEventPathAction simp only [mul_sum, Complex.ofReal_mul] apply sum_congr rfl intro e _ apply sum_congr rfl intro p _ ring theorem finite_phased_rows_eq_event_paths (ks : List K) (F : X → ℂ) : finiteOperatorListAction (finiteLocalPhasedRow E target phase weight) ks F = finiteEventPathAction E target weight ks (finiteEventLocalPhase E target phase ks) F := by induction ks with | nil => funext x change F x = ∑ _p : PUnit.{w + 1}, (1 : ℂ) * 1 * F x simp | cons k ks ih => funext x rw [finite_event_local_phase_cons] change finiteLocalPhasedRow E target phase weight k (finiteOperatorListAction (finiteLocalPhasedRow E target phase weight) ks F) x = _ rw [ih] end Phase end section open Finset universe uJ uK uP uA section Full variable {J : Type uJ} {K : Type uK} {N : ℕ} {P : Fin N → Type uP} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) (Δ D : ∀ k c, A k c → Fin N → ℤ) abbrev FullMixedLedgerState := ((g : Fin N) → Finset (P g)) × ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B def fullMixedLedgerDecode (s : FullMixedLedgerState n (M := M) B) : GlobalBirthJointState (fun g p => ZMod (n g p)) := fun g => (s.1 g, boundedOrderedTupleToFinite (s.2 g).2) noncomputable def fullMixedLedgerUpdate : (i : Option (J ⊕ K)) → ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullPermutationMixedEvent n S B A Δ D i x → (g : Fin N) → Finset (P g) | none, H, _, _ => H | some (.inl j), H, x, e => fun g => (fullMixedGhostLedgerTarget n S B A Δ D j (fun g => (H g, x g)) e g).1 | some (.inr k), H, x, e => fullEdgeLedgerUpdate n (S k) B (A k) (Δ k) (D k) H x e noncomputable def fullMixedLedgerTarget (i : Option (J ⊕ K)) (s : FullMixedLedgerState n (M := M) B) (e : FullPermutationMixedEvent n S B A Δ D i s.2) : FullMixedLedgerState n (M := M) B := finiteLedgerEventTarget (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedLedgerUpdate n S B A Δ D) i s e end Full end section open Finset def FullActiveInjective {G : Type*} {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z M B) : Prop := ∀ g, Function.Injective (x g).1 section Physical variable {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) noncomputable def physicalFullStateLabels (x : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) (hx : FullActiveInjective x) : PhysicalMarkLists P J ell := fun g => ⟨(x g).1 ∘ (physicalFullSlotIndex (C g)).symm, (hx g).comp (physicalFullSlotIndex (C g)).symm.injective⟩ theorem physical_full_state_injective (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) : FullActiveInjective (physicalFullMemoryState C L q) := fun g => (L g).injective.comp (physicalFullSlotIndex (C g)).injective theorem physical_full_state_labels_encode (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) : physicalFullStateLabels C (physicalFullMemoryState C L q) (physical_full_state_injective C L q) = L := by funext g apply Function.Embedding.ext intro i change L g (physicalFullSlotIndex (C g) ((physicalFullSlotIndex (C g)).symm i)) = L g i rw [Equiv.apply_symm_apply] theorem physical_full_state_encode_labels (x : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) (hx : FullActiveInjective x) : physicalFullMemoryState C (physicalFullStateLabels C x hx) (fun g => (x g).2) = x := by funext g apply Prod.ext · funext i change (x g).1 ((physicalFullSlotIndex (C g)).symm (physicalFullSlotIndex (C g) i)) = (x g).1 i rw [Equiv.symm_apply_apply] · rfl noncomputable def physicalFullStateEquiv : (PhysicalMarkLists P J ell × ((g : G) → BoundedOrderedTuple (Z g) B)) ≃ {x : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B // FullActiveInjective x} where toFun s := ⟨physicalFullMemoryState C s.1 s.2, physical_full_state_injective C s.1 s.2⟩ invFun x := (physicalFullStateLabels C x.val x.property, fun g => (x.val g).2) left_inv s := by apply Prod.ext · exact physical_full_state_labels_encode C s.1 s.2 · rfl right_inv x := by apply Subtype.ext exact physical_full_state_encode_labels C x.val x.property end Physical end section open scoped BigOperators Classical noncomputable def finiteDyadicTest {X : Type*} (π : X → ℕ) (j : ℕ) (f : X → ℂ) (x : X) : ℂ := if Nat.log 2 (π x) = j then f x else 0 noncomputable def finiteDyadicIndices {X : Type*} [Fintype X] (π : X → ℕ) : Finset ℕ := Finset.univ.image (fun x => Nat.log 2 (π x)) theorem finite_dyadic_test_sum {X : Type*} [Fintype X] (π : X → ℕ) (f : X → ℂ) (x : X) : (∑ j ∈ finiteDyadicIndices π, finiteDyadicTest π j f x) = f x := by have hm : Nat.log 2 (π x) ∈ finiteDyadicIndices π := Finset.mem_image.mpr ⟨x, Finset.mem_univ _, rfl⟩ simp [finiteDyadicTest, hm] theorem finite_dyadic_test_range {X : Type*} (π : X → ℕ) (f : X → ℂ) (hπ : ∀ x, f x ≠ 0 → 0 < π x) (j : ℕ) (x : X) (hx : finiteDyadicTest π j f x ≠ 0) : 2 ^ j ≤ π x ∧ π x < 2 * 2 ^ j := by have hj : Nat.log 2 (π x) = j := by by_contra h exact hx (if_neg h) have hfx : f x ≠ 0 := by simpa [finiteDyadicTest, hj] using hx rw [← hj] exact ⟨Nat.pow_log_le_self 2 (hπ x hfx).ne', by simpa only [pow_succ, mul_comm] using Nat.lt_pow_succ_log_self (by norm_num : 1 < (2 : ℕ)) (π x)⟩ theorem finite_dyadic_test_energy_le {X : Type*} [Fintype X] (π : X → ℕ) (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (f : X → ℂ) (j : ℕ) : (∑ x, μ x * ‖finiteDyadicTest π j f x‖ ^ 2) ≤ ∑ x, μ x * ‖f x‖ ^ 2 := by apply Finset.sum_le_sum intro x _ unfold finiteDyadicTest split_ifs · exact le_rfl · simp only [norm_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, mul_zero] exact mul_nonneg (hμ x) (sq_nonneg _) theorem nat_log_two_le_real_log {n : ℕ} (hn : 0 < n) : (Nat.log 2 n : ℝ) ≤ Real.log n / Real.log 2 := by have h2 : (0 : ℝ) < Real.log 2 := Real.log_pos (by norm_num) apply (le_div_iff₀ h2).mpr have hpow : (2 : ℝ) ^ Nat.log 2 n ≤ n := by exact_mod_cast Nat.pow_log_le_self 2 hn.ne' have hl := Real.log_le_log (by positivity : (0 : ℝ) < 2 ^ Nat.log 2 n) hpow simpa only [Real.log_pow] using hl theorem finite_dyadic_indices_card_le {X : Type*} [Fintype X] (π : X → ℕ) (hπ : ∀ x, 0 < π x) {H : ℝ} (hH : 0 ≤ H) (hlog : ∀ x, Real.log (π x) ≤ H) : ((finiteDyadicIndices π).card : ℝ) ≤ H / Real.log 2 + 1 := by have h2 : (0 : ℝ) < Real.log 2 := Real.log_pos (by norm_num) have hsub : finiteDyadicIndices π ⊆ Finset.range (⌊H / Real.log 2⌋₊ + 1) := by intro j hj obtain ⟨x, _, rfl⟩ := Finset.mem_image.mp hj have hb : (Nat.log 2 (π x) : ℝ) ≤ H / Real.log 2 := (nat_log_two_le_real_log (hπ x)).trans (div_le_div_of_nonneg_right (hlog x) h2.le) have := (Nat.le_floor_iff (div_nonneg hH h2.le)).mpr hb exact Finset.mem_range.mpr (by omega) have hc : (finiteDyadicIndices π).card ≤ ⌊H / Real.log 2⌋₊ + 1 := (Finset.card_le_card hsub).trans_eq (Finset.card_range _) have hf : (⌊H / Real.log 2⌋₊ : ℝ) ≤ H / Real.log 2 := Nat.floor_le (div_nonneg hH h2.le) exact (by exact_mod_cast hc : ((finiteDyadicIndices π).card : ℝ) ≤ (⌊H / Real.log 2⌋₊ : ℝ) + 1).trans (by linarith) end section open Filter theorem minor_arc_dyad_coefficient_small {L C D U V r κ t q B : ℝ} (hL : 48 ≤ L) (_hC : 0 ≤ C) (hD : 0 ≤ D) (ht : 0 ≤ t) (hq : 0 ≤ q) (hparam : 2 * κ + t + 2 * B + 1 ≤ q) (hCU : C ≤ L ^ κ) (hDU : D ≤ L ^ κ) (hU : L ^ q ≤ U) (hV : L ^ q ≤ V) (hr : L ^ q ≤ r) (hrUV : r / (U * V) ≤ L ^ (-q)) (hlog : Real.log r ≤ L ^ t) : 6 * C * D * (1 + Real.log r) * (1 / r + 1 / U + 1 / V + r / (U * V)) ≤ L ^ (-2 * B) := by have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hpowq : 0 < L ^ q := Real.rpow_pos_of_pos hL0 q have hU0 : 0 < U := hpowq.trans_le hU have hV0 : 0 < V := hpowq.trans_le hV have hr0 : 0 < r := hpowq.trans_le hr have hpq : (1 : ℝ) ≤ L ^ q := Real.one_le_rpow hL1 hq have hpt : (1 : ℝ) ≤ L ^ t := Real.one_le_rpow hL1 ht have hlog0 : 0 ≤ Real.log r := Real.log_nonneg (hpq.trans hr) have hinv {z : ℝ} (hz : L ^ q ≤ z) : 1 / z ≤ L ^ (-q) := by rw [Real.rpow_neg hL0.le, ← one_div] exact one_div_le_one_div_of_le hpowq hz have hs : 1 / r + 1 / U + 1 / V + r / (U * V) ≤ 4 * L ^ (-q) := by linarith [hinv hr, hinv hU, hinv hV] have hproduct : 6 * C * D * (1 + Real.log r) * (1 / r + 1 / U + 1 / V + r / (U * V)) ≤ 48 * L ^ (2 * κ + t - q) := by calc _ ≤ 6 * L ^ κ * L ^ κ * (2 * L ^ t) * (4 * L ^ (-q)) := by apply mul_le_mul · apply mul_le_mul · exact mul_le_mul (mul_le_mul_of_nonneg_left hCU (by norm_num)) hDU hD (by positivity) · linarith · linarith · positivity · exact hs · positivity · positivity _ = 48 * L ^ (2 * κ + t - q) := by rw [show 2 * κ + t - q = κ + κ + t + -q by ring] rw [Real.rpow_add hL0, Real.rpow_add hL0, Real.rpow_add hL0] ring calc _ ≤ 48 * L ^ (2 * κ + t - q) := hproduct _ ≤ L * L ^ (-2 * B - 1) := by apply mul_le_mul hL · exact Real.rpow_le_rpow_of_exponent_le hL1 (by linarith) · positivity · positivity _ = L ^ (-2 * B) := by calc _ = L ^ (1 + (-2 * B - 1)) := by rw [Real.rpow_add hL0, Real.rpow_one] _ = _ := by congr 1; ring end section theorem major_arc_coefficient_small {L Q N ξ h Z W εA εB q n x w z s d B : ℝ} (hL : 512 ≤ L) (hQ : 0 ≤ Q) (_hN : 0 ≤ N) (hξ : 0 ≤ ξ) (_hh : 0 ≤ h) (hZ : 0 ≤ Z) (hW : 0 ≤ W) (hεA : 0 ≤ εA) (hεB : 0 ≤ εB) (hq : 0 ≤ q) (hd : 0 ≤ d) (hQb : Q ≤ L ^ q) (hNb : N ≤ L ^ n) (hξb : ξ ≤ L ^ (-x)) (hhb : h ≤ L ^ (-w)) (hZb : Z ≤ L ^ z) (hWb : W ≤ L ^ s) (hεAb : εA ≤ L ^ (-d)) (hεBb : εB ≤ L ^ (-d)) (hxp : n + 2 * B + 2 ≤ x) (hwp : 4 * q + max z s + B + 2 ≤ w) (hdp : q + B + 2 ≤ d) : Real.sqrt (N * ξ) + 2 * h * (Z + 32 * Real.pi * W) * Q ^ 4 + Real.sqrt Q * (εA + εB + εA * εB) ≤ L ^ (-B) := by have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hpow (a b : ℝ) (hab : a ≤ b) : L ^ a ≤ L ^ b := Real.rpow_le_rpow_of_exponent_le hL1 hab have hshift (a : ℝ) : L * L ^ (a - 1) = L ^ a := by calc _ = L ^ (1 + (a - 1)) := by rw [Real.rpow_add hL0, Real.rpow_one] _ = _ := by congr 1; ring have hdiscard : Real.sqrt (N * ξ) ≤ L ^ (-B - 1) := by have hp : N * ξ ≤ (L ^ (-B - 1)) ^ 2 := by calc _ ≤ L ^ n * L ^ (-x) := mul_le_mul hNb hξb hξ (by positivity) _ = L ^ (n - x) := by rw [sub_eq_add_neg, Real.rpow_add hL0] _ ≤ L ^ ((-B - 1) + (-B - 1)) := hpow _ _ (by linarith) _ = _ := by rw [Real.rpow_add hL0]; ring simpa only [Real.sqrt_sq (by positivity : 0 ≤ L ^ (-B - 1))] using Real.sqrt_le_sqrt hp have hphase : 2 * h * (Z + 32 * Real.pi * W) * Q ^ 4 ≤ L ^ (-B - 1) := by have hz : Z ≤ L ^ max z s := hZb.trans (hpow _ _ (le_max_left _ _)) have hw : W ≤ L ^ max z s := hWb.trans (hpow _ _ (le_max_right _ _)) have hp : Z + 32 * Real.pi * W ≤ 129 * L ^ max z s := by have hpw : 32 * Real.pi * W ≤ 128 * L ^ max z s := by exact mul_le_mul (by nlinarith [Real.pi_lt_four]) hw hW (by positivity) linarith calc _ ≤ 2 * L ^ (-w) * (129 * L ^ max z s) * (L ^ q) ^ 4 := by gcongr _ = 258 * L ^ (-w + max z s + 4 * q) := by rw [show -w + max z s + 4 * q = -w + max z s + q + q + q + q by ring] simp only [Real.rpow_add hL0] ring _ ≤ 258 * L ^ (-B - 2) := mul_le_mul_of_nonneg_left (hpow _ _ (by linarith)) (by norm_num) _ ≤ L * L ^ (-B - 2) := by gcongr; linarith _ = L ^ (-B - 1) := by rw [show -B - 2 = (-B - 1) - 1 by ring, hshift] have heps : Real.sqrt Q * (εA + εB + εA * εB) ≤ L ^ (-B - 1) := by have hs : Real.sqrt Q ≤ L ^ q := (Real.sqrt_le_sqrt hQb).trans (Real.sqrt_le_self_iff.mpr (Or.inr (Real.one_le_rpow hL1 hq))) have hsmall : L ^ (-d) ≤ 1 := by simpa only [Real.rpow_zero] using hpow (-d) 0 (by linarith) have hprod : εA * εB ≤ L ^ (-d) := by calc _ ≤ L ^ (-d) * L ^ (-d) := mul_le_mul hεAb hεBb hεB (by positivity) _ ≤ L ^ (-d) * 1 := mul_le_mul_of_nonneg_left hsmall (by positivity) _ = _ := mul_one _ calc _ ≤ L ^ q * (3 * L ^ (-d)) := by apply mul_le_mul hs (by linarith) · positivity · positivity _ = 3 * L ^ (q - d) := by rw [sub_eq_add_neg, Real.rpow_add hL0]; ring _ ≤ 3 * L ^ (-B - 2) := mul_le_mul_of_nonneg_left (hpow _ _ (by linarith)) (by norm_num) _ ≤ L * L ^ (-B - 2) := by gcongr; linarith _ = L ^ (-B - 1) := by rw [show -B - 2 = (-B - 1) - 1 by ring, hshift] calc _ ≤ 3 * L ^ (-B - 1) := by linarith _ ≤ L * L ^ (-B - 1) := by gcongr; linarith _ = L ^ (-B) := hshift (-B) end section open Finset theorem squarefree_conductor_quotient_totient (d f : ℕ) (hd : Squarefree d) (hf : f ∣ d) : Nat.totient d = Nat.totient f * Nat.totient (d / f) := by have hc : Nat.Coprime f (d / f) := by apply Nat.coprime_of_squarefree_mul rwa [Nat.mul_div_cancel' hf] rw [← Nat.totient_mul hc, Nat.mul_div_cancel' hf] theorem conductor_weighted_totient_mass_le (N f : ℕ) (hf : 0 < f) (F : ℕ → ℝ) (hF : ∀ h ∈ (Icc 1 N).filter Squarefree, 0 ≤ F h) : (∑ d ∈ (Icc 1 N).filter (fun d => Squarefree d ∧ f ∣ d), F (d / f) / (Nat.totient d : ℝ)) ≤ (1 / (Nat.totient f : ℝ)) * ∑ h ∈ (Icc 1 N).filter Squarefree, F h / (Nat.totient h : ℝ) := by let M := (Icc 1 N).filter (fun d => Squarefree d ∧ f ∣ d) have hinj : Set.InjOn (fun d => d / f) M := by intro d hd e he hde change d / f = e / f at hde have hfd := (mem_filter.mp hd).2.2 have hfe := (mem_filter.mp he).2.2 calc d = f * (d / f) := (Nat.mul_div_cancel' hfd).symm _ = f * (e / f) := by rw [hde] _ = e := Nat.mul_div_cancel' hfe have hsub : M.image (fun d => d / f) ⊆ (Icc 1 N).filter Squarefree := by intro h hh obtain ⟨d, hd, rfl⟩ := mem_image.mp hh obtain ⟨hdrange, hdsq, hfd⟩ := mem_filter.mp hd obtain ⟨hd0, hdN⟩ := mem_Icc.mp hdrange apply mem_filter.mpr exact ⟨mem_Icc.mpr ⟨Nat.div_pos (Nat.le_of_dvd hd0 hfd) hf, (Nat.div_le_self d f).trans hdN⟩, hdsq.squarefree_of_dvd (Nat.div_dvd_of_dvd hfd)⟩ calc _ = (1 / (Nat.totient f : ℝ)) * ∑ d ∈ M, F (d / f) / (Nat.totient (d / f) : ℝ) := by rw [mul_sum] apply sum_congr rfl intro d hd rw [squarefree_conductor_quotient_totient d f (mem_filter.mp hd).2.1 (mem_filter.mp hd).2.2, Nat.cast_mul] simp only [div_eq_mul_inv, mul_inv_rev, one_mul] ring _ = (1 / (Nat.totient f : ℝ)) * ∑ h ∈ M.image (fun d => d / f), F h / (Nat.totient h : ℝ) := by rw [sum_image hinj] _ ≤ _ := by apply mul_le_mul_of_nonneg_left _ (by positivity) exact sum_le_sum_of_subset_of_nonneg hsub (fun h hh _ => div_nonneg (hF h hh) (Nat.cast_nonneg _)) theorem conductor_totient_mass_le_log (N f : ℕ) (hf : 0 < f) {D : ℝ} (hD : 1 ≤ D) (hND : (N : ℝ) ≤ D) : (∑ d ∈ (Icc 1 N).filter (fun d => Squarefree d ∧ f ∣ d), 1 / (Nat.totient d : ℝ)) ≤ (1 / (Nat.totient f : ℝ)) * ((2 * primeEulerProductUpperConstant) * Real.log (2 * D)) := by have h := conductor_weighted_totient_mass_le N f hf (fun _ => 1) (by intros; norm_num) exact h.trans (mul_le_mul_of_nonneg_left (totient_sieve_squarefree_mass_le_log N hD hND) (by positivity)) end section open Finset theorem norm_sum_Ioc_smul_le_of_monotone (f : ℕ → ℝ) (g : ℕ → ℂ) {m n : ℕ} (hmn : m < n) {B : ℝ} (hf : ∀ i ∈ Icc (m + 1) n, 0 ≤ f i) (hmono : MonotoneOn f (Set.Icc (m + 1) n)) (hprefix : ∀ i ∈ Icc m n, ‖∑ j ∈ range (i + 1), g j‖ ≤ B) : ‖∑ i ∈ Ioc m n, f i • g i‖ ≤ 2 * f n * B := by have hm1 : m + 1 ≤ n := by omega have hm1mem : m + 1 ∈ Icc (m + 1) n := mem_Icc.mpr ⟨le_rfl, hm1⟩ have hnmem : n ∈ Icc (m + 1) n := mem_Icc.mpr ⟨hm1, le_rfl⟩ have hsum : ∀ i ∈ Ioc m (n - 1), ‖(f (i + 1) - f i) • (∑ j ∈ range (i + 1), g j)‖ ≤ (f (i + 1) - f i) * B := by intro i hi obtain ⟨hmi, hin⟩ := mem_Ioc.mp hi have hdiff : f i ≤ f (i + 1) := hmono ⟨by omega, by omega⟩ ⟨by omega, by omega⟩ (by omega) rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (sub_nonneg.mpr hdiff)] exact mul_le_mul_of_nonneg_left (hprefix i (mem_Icc.mpr ⟨by omega, by omega⟩)) (sub_nonneg.mpr hdiff) have htel : (∑ i ∈ Ioc m (n - 1), (f (i + 1) - f i)) = f n - f (m + 1) := by rw [← Ico_add_one_add_one_eq_Ioc, Nat.sub_add_cancel (by omega : 1 ≤ n)] exact sum_Ico_sub f hm1 rw [sum_Ioc_by_parts f g hmn] calc _ ≤ ‖f n • (∑ j ∈ range (n + 1), g j)‖ + ‖f (m + 1) • (∑ j ∈ range (m + 1), g j)‖ + ‖∑ i ∈ Ioc m (n - 1), (f (i + 1) - f i) • (∑ j ∈ range (i + 1), g j)‖ := (norm_sub_le _ _).trans (add_le_add (norm_sub_le _ _) le_rfl) _ ≤ f n * B + f (m + 1) * B + ∑ i ∈ Ioc m (n - 1), (f (i + 1) - f i) * B := by gcongr · rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (hf n hnmem)] exact mul_le_mul_of_nonneg_left (hprefix n (mem_Icc.mpr ⟨hmn.le, le_rfl⟩)) (hf n hnmem) · rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (hf (m + 1) hm1mem)] exact mul_le_mul_of_nonneg_left (hprefix m (mem_Icc.mpr ⟨le_rfl, hmn.le⟩)) (hf (m + 1) hm1mem) · exact (norm_sum_le _ _).trans (sum_le_sum hsum) _ = 2 * f n * B := by rw [← sum_mul, htel]; ring theorem ordinary_sum_le_of_reciprocal_prefix (S : Finset ℕ) (F : ℕ → ℂ) {b B : ℝ} (hb : 0 ≤ b) (hB : 0 ≤ B) (hpos : ∀ p ∈ S, 0 < p) (hupper : ∀ p ∈ S, (p : ℝ) ≤ b) (hprefix : ∀ k : ℕ, ‖∑ p ∈ S.filter (fun p => p ≤ k), (1 / (p : ℝ)) • F p‖ ≤ B) : ‖∑ p ∈ S, F p‖ ≤ 2 * b * B := by classical let N := ⌊b⌋₊ have hsub : S ⊆ Ioc 0 N := by intro p hp exact mem_Ioc.mpr ⟨hpos p hp, Nat.le_floor (hupper p hp)⟩ by_cases hN : 0 < N · let g : ℕ → ℂ := fun p => if p ∈ S then (1 / (p : ℝ)) • F p else 0 have hpref (k : ℕ) : (∑ j ∈ range (k + 1), g j) = ∑ p ∈ S.filter (fun p => p ≤ k), (1 / (p : ℝ)) • F p := by dsimp only [g] rw [← sum_filter] apply sum_congr · ext p simp only [mem_filter, mem_range, Nat.lt_succ_iff, and_comm] · intro p _ rfl have hsum : (∑ p ∈ Ioc 0 N, (p : ℝ) • g p) = ∑ p ∈ S, F p := by calc _ = ∑ p ∈ Ioc 0 N, if p ∈ S then F p else 0 := by apply sum_congr rfl intro p _ dsimp only [g] by_cases hp : p ∈ S · rw [if_pos hp, if_pos hp, smul_smul] have hp0 : (p : ℝ) ≠ 0 := by exact_mod_cast (hpos p hp).ne' simp [hp0] · simp [hp] _ = ∑ p ∈ (Ioc 0 N).filter (fun p => p ∈ S), F p := (sum_filter _ _).symm _ = ∑ p ∈ S, F p := by congr 1 ext p simp only [mem_filter] exact ⟨fun h => h.2, fun hp => ⟨hsub hp, hp⟩⟩ have h := norm_sum_Ioc_smul_le_of_monotone (fun n => (n : ℝ)) g hN (fun n _ => Nat.cast_nonneg n) (fun _ _ _ _ h => Nat.cast_le.mpr h) (fun k _ => by rw [hpref]; exact hprefix k) rw [hsum] at h exact h.trans (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (Nat.floor_le hb) (by norm_num)) hB) · have hN0 : N = 0 := by omega have hS : S = ∅ := by apply eq_empty_iff_forall_notMem.mpr intro p hp have h := mem_Ioc.mp (hsub hp) omega rw [hS, sum_empty, norm_zero] positivity theorem primeBand_product_filter_prefix {a b c U V : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (k : ℕ) : ((primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V)).filter (fun p => p ≤ k) = (primeBand a (min b (k : ℝ))).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V) := by ext p simp only [mem_filter, mem_primeBand_iff ha hb, mem_primeBand_iff ha (le_min hb (Nat.cast_nonneg k)), le_min_iff, Nat.cast_le] tauto theorem ordinary_prime_band_product_interval_bound (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ a b c U V : ℝ, 2 ≤ a → 0 ≤ b → 0 < c → 0 ≤ U → 0 ≤ V → ‖∑ p ∈ (primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V), χ (p : ZMod q)‖ ≤ 2 * b * C * a ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log a) := by obtain ⟨C, hC, hbound⟩ := reciprocal_prime_band_product_interval_bound hZ refine ⟨C, hC, ?_⟩ intro q hq χ hχ a b c U V ha hb hc hU hV have haq : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg (by exact_mod_cast hq) have haa : 0 < Real.log a := Real.log_pos (by linarith) have ha0 : 0 ≤ a := by linarith have hB : 0 ≤ C * a ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log a) := by positivity have h := ordinary_sum_le_of_reciprocal_prefix ((primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V)) (fun p => χ (p : ZMod q)) hb hB (fun p hp => ((mem_primeBand_iff ha0 hb p).mp (mem_filter.mp hp).1).1.pos) (fun p hp => ((mem_primeBand_iff ha0 hb p).mp (mem_filter.mp hp).1).2.2) (fun k => by rw [primeBand_product_filter_prefix ha0 hb] exact hbound q hq χ hχ a (min b (k : ℝ)) c U V ha (le_min hb (Nat.cast_nonneg k)) hc hU hV) convert h using 1 ring end section open Set MeasureTheory open scoped BigOperators theorem endpoint_le_average_add_integral {f B : ℝ → ℝ} {a b : ℝ} (hab : a < b) (hfc : ContinuousOn f (Icc a b)) (hfd : DifferentiableOn ℝ f (Ioo a b)) (hB : ∀ x ∈ Icc a b, 0 ≤ B x) (hfB : ∀ x ∈ Ioo a b, ‖deriv f x‖ ≤ B x) (hBi : IntervalIntegrable B volume a b) : f a ≤ (b - a)⁻¹ * (∫ x in a..b, f x) + ∫ x in a..b, B x := by have hfI : IntervalIntegrable f volume a b := hfc.intervalIntegrable_of_Icc hab.le have hpoint (y : ℝ) (hy : y ∈ Icc a b) : f a ≤ f y + ∫ x in a..b, B x := by have hsub : Icc a y ⊆ Icc a b := Icc_subset_Icc le_rfl hy.2 have hspeed := norm_sub_le_integral_of_norm_deriv_le_of_le hy.1 (hfc.mono hsub) (hfd.mono (Ioo_subset_Ioo le_rfl hy.2)) (Filter.Eventually.of_forall (fun x hx => hfB x ⟨hx.1, hx.2.trans_le hy.2⟩)) (hBi.mono_set (by simpa only [uIcc_of_le hy.1, uIcc_of_le hab.le] using hsub)) have hmono : (∫ x in a..y, B x) ≤ ∫ x in a..b, B x := intervalIntegral.integral_mono_interval le_rfl hy.1 hy.2 ((ae_restrict_iff' measurableSet_Ioc).mpr (Filter.Eventually.of_forall (fun x hx => hB x ⟨hx.1.le, hx.2⟩))) hBi have hdiff : f a - f y ≤ ‖f y - f a‖ := by rw [Real.norm_eq_abs, abs_sub_comm] exact le_abs_self _ linarith have hint := intervalIntegral.integral_mono_on hab.le (intervalIntegrable_const : IntervalIntegrable (fun _ : ℝ => f a) volume a b) (hfI.add intervalIntegrable_const) hpoint rw [intervalIntegral.integral_add hfI intervalIntegrable_const, intervalIntegral.integral_const, intervalIntegral.integral_const] at hint simp only [smul_eq_mul] at hint have hlen : 0 < b - a := sub_pos.mpr hab apply (mul_le_mul_iff_right₀ hlen).mp calc (b - a) * f a ≤ (∫ x in a..b, f x) + (b - a) * ∫ x in a..b, B x := hint _ = (b - a) * ((b - a)⁻¹ * (∫ x in a..b, f x) + ∫ x in a..b, B x) := by field_simp theorem sum_disjoint_interval_integrals_le {ι : Type*} (s : Finset ι) (l r : ι → ℝ) {a b : ℝ} (hab : a ≤ b) (hlr : ∀ i ∈ s, l i ≤ r i) (hal : ∀ i ∈ s, a ≤ l i) (hrb : ∀ i ∈ s, r i ≤ b) (hdisj : Set.Pairwise (↑s) (Function.onFun Disjoint (fun i => Ioc (l i) (r i)))) {f : ℝ → ℝ} (hfc : ContinuousOn f (Icc a b)) (hf0 : ∀ x ∈ Icc a b, 0 ≤ f x) : (∑ i ∈ s, ∫ x in l i..r i, f x) ≤ ∫ x in a..b, f x := by have hfI : IntervalIntegrable f volume a b := hfc.intervalIntegrable_of_Icc hab have hlocal (i : ι) (hi : i ∈ s) : IntegrableOn f (Ioc (l i) (r i)) := hfI.1.mono_set (Ioc_subset_Ioc (hal i hi) (hrb i hi)) have hsum : (∑ i ∈ s, ∫ x in l i..r i, f x) = ∑ i ∈ s, ∫ x in Ioc (l i) (r i), f x := Finset.sum_congr rfl (fun i hi => intervalIntegral.integral_of_le (hlr i hi)) rw [hsum] rw [← integral_biUnion_finset s (fun _ _ => measurableSet_Ioc) hdisj hlocal, intervalIntegral.integral_of_le hab] apply setIntegral_mono_set hfI.1 · exact (ae_restrict_iff' measurableSet_Ioc).mpr (Filter.Eventually.of_forall (fun x hx => hf0 x ⟨hx.1.le, hx.2⟩)) · apply Filter.Eventually.of_forall intro x hx obtain ⟨i, hi, hxi⟩ := mem_iUnion₂.mp hx exact ⟨(hal i hi).trans_lt hxi.1, hxi.2.trans (hrb i hi)⟩ theorem separated_right_intervals_disjoint {ι : Type*} (s : Finset ι) (x : ι → ℝ) {δ : ℝ} (hsep : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → δ ≤ |x i - x j|) : Set.Pairwise (↑s) (Function.onFun Disjoint (fun i => Ioc (x i) (x i + δ))) := by intro i hi j hj hij apply Set.disjoint_left.mpr intro y hyi hyj have hd := hsep i hi j hj hij rcases le_total (x i) (x j) with h | h · rw [abs_of_nonpos (sub_nonpos.mpr h)] at hd linarith [hyi.2, hyj.1] · rw [abs_of_nonneg (sub_nonneg.mpr h)] at hd linarith [hyj.2, hyi.1] theorem separated_samples_le_integrals {ι : Type*} (s : Finset ι) (x : ι → ℝ) {δ a b : ℝ} (hδ : 0 < δ) (hab : a ≤ b) (hleft : ∀ i ∈ s, a ≤ x i) (hright : ∀ i ∈ s, x i + δ ≤ b) (hsep : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → δ ≤ |x i - x j|) {f B : ℝ → ℝ} (hfc : ContinuousOn f (Icc a b)) (hfd : DifferentiableOn ℝ f (Ioo a b)) (hf0 : ∀ y ∈ Icc a b, 0 ≤ f y) (hBc : ContinuousOn B (Icc a b)) (hB0 : ∀ y ∈ Icc a b, 0 ≤ B y) (hfB : ∀ y ∈ Ioo a b, ‖deriv f y‖ ≤ B y) : (∑ i ∈ s, f (x i)) ≤ δ⁻¹ * (∫ y in a..b, f y) + ∫ y in a..b, B y := by have horder (i : ι) (hi : i ∈ s) : x i ≤ x i + δ := le_add_of_nonneg_right hδ.le have hdisj := separated_right_intervals_disjoint s x hsep have hpoint (i : ι) (hi : i ∈ s) : f (x i) ≤ δ⁻¹ * (∫ y in x i..x i + δ, f y) + ∫ y in x i..x i + δ, B y := by have hcsub : Icc (x i) (x i + δ) ⊆ Icc a b := Icc_subset_Icc (hleft i hi) (hright i hi) have hosub : Ioo (x i) (x i + δ) ⊆ Ioo a b := Ioo_subset_Ioo (hleft i hi) (hright i hi) simpa only [add_sub_cancel_left] using endpoint_le_average_add_integral (lt_add_of_pos_right (x i) hδ) (hfc.mono hcsub) (hfd.mono hosub) (fun y hy => hB0 y (hcsub hy)) (fun y hy => hfB y (hosub hy)) ((hBc.mono hcsub).intervalIntegrable_of_Icc (horder i hi)) calc (∑ i ∈ s, f (x i)) ≤ ∑ i ∈ s, (δ⁻¹ * (∫ y in x i..x i + δ, f y) + ∫ y in x i..x i + δ, B y) := Finset.sum_le_sum hpoint _ = δ⁻¹ * (∑ i ∈ s, ∫ y in x i..x i + δ, f y) + ∑ i ∈ s, ∫ y in x i..x i + δ, B y := by rw [Finset.sum_add_distrib, Finset.mul_sum] _ ≤ δ⁻¹ * (∫ y in a..b, f y) + ∫ y in a..b, B y := add_le_add (mul_le_mul_of_nonneg_left (sum_disjoint_interval_integrals_le s x (fun i => x i + δ) hab horder hleft hright hdisj hfc hf0) (inv_nonneg.mpr hδ.le)) (sum_disjoint_interval_integrals_le s x (fun i => x i + δ) hab horder hleft hright hdisj hBc hB0) theorem separated_samples_norm_sq_le {ι E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (s : Finset ι) (x : ι → ℝ) {δ a b : ℝ} (hδ : 0 < δ) (hab : a ≤ b) (hleft : ∀ i ∈ s, a ≤ x i) (hright : ∀ i ∈ s, x i + δ ≤ b) (hsep : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → δ ≤ |x i - x j|) (F F' : ℝ → E) (hF : ∀ y, HasDerivAt F (F' y) y) (hF' : Continuous F') : (∑ i ∈ s, ‖F (x i)‖ ^ 2) ≤ δ⁻¹ * (∫ y in a..b, ‖F y‖ ^ 2) + 2 * ∫ y in a..b, ‖F y‖ * ‖F' y‖ := by have hFc : Continuous F := continuous_iff_continuousAt.mpr (fun y => (hF y).continuousAt) have hbound (y : ℝ) : ‖deriv (fun y => ‖F y‖ ^ 2) y‖ ≤ 2 * (‖F y‖ * ‖F' y‖) := by rw [(hF y).norm_sq.deriv, norm_mul, Real.norm_eq_abs, abs_of_pos (by norm_num : (0:ℝ) < 2)] exact mul_le_mul_of_nonneg_left (abs_real_inner_le_norm (F y) (F' y)) (by norm_num) have h := separated_samples_le_integrals s x hδ hab hleft hright hsep (hFc.norm.pow 2).continuousOn (fun y _ => (hF y).norm_sq.differentiableAt.differentiableWithinAt) (fun y _ => sq_nonneg ‖F y‖) ((hFc.norm.mul hF'.norm).const_mul 2).continuousOn (fun y _ => by dsimp; positivity) (fun y _ => hbound y) simpa only [Pi.pow_apply, Pi.mul_apply, intervalIntegral.integral_const_mul] using h theorem separated_samples_norm_sq_le_energy {ι E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (s : Finset ι) (x : ι → ℝ) {δ a b K Q : ℝ} (hδ : 0 < δ) (hab : a ≤ b) (hleft : ∀ i ∈ s, a ≤ x i) (hright : ∀ i ∈ s, x i + δ ≤ b) (hsep : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → δ ≤ |x i - x j|) (F F' : ℝ → E) (hF : ∀ y, HasDerivAt F (F' y) y) (hF' : Continuous F') (hK : 0 < K) (henergy : (∫ y in a..b, ‖F y‖ ^ 2) ≤ Q) (hderiv : (∫ y in a..b, ‖F' y‖ ^ 2) ≤ K ^ 2 * Q) : (∑ i ∈ s, ‖F (x i)‖ ^ 2) ≤ (δ⁻¹ + 2 * K) * Q := by have hFc : Continuous F := continuous_iff_continuousAt.mpr (fun y => (hF y).continuousAt) have hFI : IntervalIntegrable (fun y => ‖F y‖ ^ 2) volume a b := (hFc.norm.pow 2).intervalIntegrable _ _ have hF'I : IntervalIntegrable (fun y => ‖F' y‖ ^ 2) volume a b := (hF'.norm.pow 2).intervalIntegrable _ _ have hprodI : IntervalIntegrable (fun y => ‖F y‖ * ‖F' y‖) volume a b := (hFc.norm.mul hF'.norm).intervalIntegrable _ _ have hyoung := intervalIntegral.integral_mono_on hab (hprodI.const_mul (2 * K)) ((hFI.const_mul (K ^ 2)).add hF'I) (fun y _ => show 2 * K * (‖F y‖ * ‖F' y‖) ≤ K ^ 2 * ‖F y‖ ^ 2 + ‖F' y‖ ^ 2 by nlinarith [sq_nonneg (K * ‖F y‖ - ‖F' y‖)]) rw [intervalIntegral.integral_add (hFI.const_mul (K ^ 2)) hF'I, intervalIntegral.integral_const_mul, intervalIntegral.integral_const_mul] at hyoung have hscaled := mul_le_mul_of_nonneg_left henergy (sq_nonneg K) have hcross : 2 * (∫ y in a..b, ‖F y‖ * ‖F' y‖) ≤ 2 * K * Q := by apply (mul_le_mul_iff_right₀ hK).mp nlinarith only [hyoung, hderiv, hscaled] calc (∑ i ∈ s, ‖F (x i)‖ ^ 2) ≤ δ⁻¹ * (∫ y in a..b, ‖F y‖ ^ 2) + 2 * ∫ y in a..b, ‖F y‖ * ‖F' y‖ := separated_samples_norm_sq_le s x hδ hab hleft hright hsep F F' hF hF' _ ≤ δ⁻¹ * Q + 2 * K * Q := add_le_add (mul_le_mul_of_nonneg_left henergy (inv_nonneg.mpr hδ.le)) hcross _ = (δ⁻¹ + 2 * K) * Q := by ring end section theorem reduced_nat_cross_mul_injective {a b c d : ℕ} (hb : 0 < b) (hd : 0 < d) (hab : a.Coprime b) (hcd : c.Coprime d) (hcross : a * d = c * b) : a = c ∧ b = d := by have hbd : b ∣ d := hab.symm.dvd_of_dvd_mul_left (by rw [hcross]; exact dvd_mul_left b c) have hdb : d ∣ b := hcd.symm.dvd_of_dvd_mul_left (by rw [← hcross]; exact dvd_mul_left d a) have heq : b = d := Nat.dvd_antisymm hbd hdb subst d exact ⟨Nat.eq_of_mul_eq_mul_right hb hcross, rfl⟩ theorem nat_fraction_separation {a b c d : ℕ} (hb : 0 < b) (hd : 0 < d) (hcross : a * d ≠ c * b) : 1 / ((b : ℝ) * d) ≤ |(a : ℝ) / b - (c : ℝ) / d| := by have hbR : (0 : ℝ) < b := by exact_mod_cast hb have hdR : (0 : ℝ) < d := by exact_mod_cast hd have hgap : (1 : ℝ) ≤ |(a : ℝ) * d - (c : ℝ) * b| := by rcases lt_or_gt_of_ne hcross with h | h · have hh : (a : ℝ) * d + 1 ≤ (c : ℝ) * b := by exact_mod_cast Nat.succ_le_of_lt h rw [abs_of_nonpos (by linarith)] linarith · have hh : (c : ℝ) * b + 1 ≤ (a : ℝ) * d := by exact_mod_cast Nat.succ_le_of_lt h rw [abs_of_nonneg (by linarith)] linarith rw [div_sub_div _ _ hbR.ne' hdR.ne', abs_div, abs_of_pos (mul_pos hbR hdR)] simpa only [mul_comm (b : ℝ) (c : ℝ)] using div_le_div_of_nonneg_right hgap (mul_pos hbR hdR).le theorem bounded_reduced_fraction_separation {a b c d : ℕ} {R : ℝ} (hb : 0 < b) (hd : 0 < d) (hab : a.Coprime b) (hcd : c.Coprime d) (hneq : (a, b) ≠ (c, d)) (hbR : (b : ℝ) ≤ R) (hdR : (d : ℝ) ≤ R) : 1 / R ^ 2 ≤ |(a : ℝ) / b - (c : ℝ) / d| := by have hb0 : (0 : ℝ) < b := by exact_mod_cast hb have hd0 : (0 : ℝ) < d := by exact_mod_cast hd have hR : 0 < R := hb0.trans_le hbR have hcross : a * d ≠ c * b := by intro heq obtain ⟨h1, h2⟩ := reduced_nat_cross_mul_injective hb hd hab hcd heq exact hneq (Prod.ext h1 h2) have hbdR : (b : ℝ) * d ≤ R ^ 2 := by simpa only [pow_two] using mul_le_mul hbR hdR hd0.le hR.le exact (one_div_le_one_div_of_le (mul_pos hb0 hd0) hbdR).trans (nat_fraction_separation hb hd hcross) theorem reduced_fraction_samples_data (s : Finset (ℕ × ℕ)) {R : ℝ} (hs : ∀ v ∈ s, 0 < v.2 ∧ v.1 < v.2 ∧ v.1.Coprime v.2 ∧ (v.2 : ℝ) ≤ R) : (∀ v ∈ s, (0 : ℝ) ≤ (v.1 : ℝ) / v.2 ∧ (v.1 : ℝ) / v.2 < 1) ∧ (∀ v ∈ s, ∀ w ∈ s, v ≠ w → 1 / R ^ 2 ≤ |(v.1 : ℝ) / v.2 - (w.1 : ℝ) / w.2|) := by constructor · intro v hv obtain ⟨hd, ha, _, _⟩ := hs v hv refine ⟨by positivity, (div_lt_one (by exact_mod_cast hd)).mpr ?_⟩ exact_mod_cast ha · intro v hv w hw hneq obtain ⟨hb, _, hab, hbR⟩ := hs v hv obtain ⟨hd, _, hcd, hdR⟩ := hs w hw exact bounded_reduced_fraction_separation hb hd hab hcd (by simpa using hneq) hbR hdR end section open Finset MeasureTheory open scoped ComplexConjugate Real noncomputable def finiteFourierSum (s : Finset ℤ) (a : ℤ → ℂ) (x : ℝ) : ℂ := ∑ n ∈ s, a n * fourier n (x : AddCircle (1 : ℝ)) noncomputable def finiteFourierDerivative (s : Finset ℤ) (a : ℤ → ℂ) : ℝ → ℂ := finiteFourierSum s (fun n => a n * (2 * Real.pi * Complex.I * n)) theorem continuous_fourier_real (n : ℤ) : Continuous (fun x : ℝ => fourier n (x : AddCircle (1 : ℝ))) := continuous_iff_continuousAt.mpr (fun x => (hasDerivAt_fourier 1 n x).continuousAt) section variable (s : Finset ℤ) (a : ℤ → ℂ) include s a theorem continuous_finiteFourierSum : Continuous (finiteFourierSum s a) := by apply continuous_finsetSum intro n _ exact continuous_const.mul (continuous_fourier_real n) theorem continuous_finiteFourierDerivative : Continuous (finiteFourierDerivative s a) := continuous_finiteFourierSum s _ theorem hasDerivAt_finiteFourierSum (x : ℝ) : HasDerivAt (finiteFourierSum s a) (finiteFourierDerivative s a x) x := by have h := HasDerivAt.sum (u := s) (fun n _ => (hasDerivAt_fourier 1 n x).const_mul (a n)) have hf : (∑ n ∈ s, fun y : ℝ => a n * fourier n (y : AddCircle (1 : ℝ))) = finiteFourierSum s a := by funext y simp only [Finset.sum_apply, finiteFourierSum] rw [hf] at h have hd : (∑ n ∈ s, a n * (2 * Real.pi * Complex.I * n / (1 : ℂ) * fourier n (x : AddCircle (1 : ℝ)))) = finiteFourierDerivative s a x := by simp only [finiteFourierDerivative, finiteFourierSum, div_one, mul_assoc] exact hd ▸ h theorem finiteFourierSum_periodic : Function.Periodic (finiteFourierSum s a) 1 := by intro x simp only [finiteFourierSum, AddCircle.coe_add_period] end theorem integral_fourier_cross (m n : ℤ) : (∫ x in (0 : ℝ)..1, conj (fourier m (x : AddCircle (1 : ℝ))) * fourier n (x : AddCircle (1 : ℝ))) = if m = n then 1 else 0 := by have h := congrFun (fourierCoeff_fourier (T := (1 : ℝ)) n) m rw [fourierCoeff_eq_intervalIntegral (fourier n) m 0] at h simpa only [one_div_one, one_smul, zero_add, fourier_neg, smul_eq_mul, Pi.single_apply, eq_comm] using h theorem finiteFourierSum_energy_one (s : Finset ℤ) (a : ℤ → ℂ) : (∫ x in (0 : ℝ)..1, ‖finiteFourierSum s a x‖^2) = ∑ n ∈ s, ‖a n‖^2 := by have hcont (m n : ℤ) : Continuous (fun x : ℝ => (conj (a m) * a n) * (conj (fourier m (x : AddCircle (1 : ℝ))) * fourier n (x : AddCircle (1 : ℝ)))) := by exact continuous_const.mul ((continuous_fourier_real m).star.mul (continuous_fourier_real n)) have hpoint (x : ℝ) : conj (finiteFourierSum s a x) * finiteFourierSum s a x = ∑ m ∈ s, ∑ n ∈ s, (conj (a m) * a n) * (conj (fourier m (x : AddCircle (1 : ℝ))) * fourier n (x : AddCircle (1 : ℝ))) := by simp only [finiteFourierSum, map_sum, map_mul, sum_mul, mul_sum] rw [sum_comm] apply sum_congr rfl intro m _ apply sum_congr rfl intro n _ ring have hc : (∫ x in (0 : ℝ)..1, conj (finiteFourierSum s a x) * finiteFourierSum s a x) = ∑ n ∈ s, conj (a n) * a n := by simp_rw [hpoint] rw [intervalIntegral.integral_finsetSum (fun m _ => (continuous_finsetSum s (fun n _ => hcont m n)).intervalIntegrable _ _)] apply sum_congr rfl intro m hm rw [intervalIntegral.integral_finsetSum (fun n _ => (hcont m n).intervalIntegrable _ _)] simp_rw [intervalIntegral.integral_const_mul, integral_fourier_cross] simp [hm] have hnorm (z : ℂ) : conj z * z = ((‖z‖^2 : ℝ) : ℂ) := by rw [← Complex.normSq_eq_conj_mul_self, Complex.normSq_eq_norm_sq] simp_rw [hnorm] at hc rw [intervalIntegral.integral_ofReal] at hc exact_mod_cast hc theorem finiteFourierSum_energy_two (s : Finset ℤ) (a : ℤ → ℂ) : (∫ x in (0 : ℝ)..2, ‖finiteFourierSum s a x‖^2) = 2 * ∑ n ∈ s, ‖a n‖^2 := by have hp : Function.Periodic (fun x => ‖finiteFourierSum s a x‖^2) 1 := (finiteFourierSum_periodic s a).comp (fun z : ℂ => ‖z‖^2) have h := hp.intervalIntegral_add_zsmul_eq (2 : ℤ) 0 (fun u v => ((continuous_finiteFourierSum s a).norm.pow 2).intervalIntegrable u v) norm_num only [zero_add, zsmul_eq_mul, Int.cast_ofNat, mul_one] at h rw [h, finiteFourierSum_energy_one] private theorem finiteFourierDerivative_coefficient_bound (s : Finset ℤ) (a : ℤ → ℂ) {N : ℝ} (_hN : 0 ≤ N) (hfreq : ∀ n ∈ s, |(n : ℝ)| ≤ N) : (∑ n ∈ s, ‖a n * (2 * Real.pi * Complex.I * n)‖^2) ≤ (2 * Real.pi * N)^2 * ∑ n ∈ s, ‖a n‖^2 := by rw [mul_sum] apply sum_le_sum intro n hn have hcoeff : ‖(2 * Real.pi * Complex.I * n : ℂ)‖ = 2 * Real.pi * |(n : ℝ)| := by simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos Real.pi_pos, Complex.norm_I, mul_one, Complex.norm_intCast] norm_num rw [norm_mul, hcoeff, mul_pow] have hmono : (2 * Real.pi * |(n : ℝ)|)^2 ≤ (2 * Real.pi * N)^2 := pow_le_pow_left₀ (by positivity) (mul_le_mul_of_nonneg_left (hfreq n hn) (by positivity)) 2 nlinarith [mul_le_mul_of_nonneg_left hmono (sq_nonneg ‖a n‖)] theorem finiteFourierDerivative_energy_two_le (s : Finset ℤ) (a : ℤ → ℂ) {N : ℝ} (hN : 0 ≤ N) (hfreq : ∀ n ∈ s, |(n : ℝ)| ≤ N) : (∫ x in (0 : ℝ)..2, ‖finiteFourierDerivative s a x‖^2) ≤ (2 * Real.pi * N)^2 * (2 * ∑ n ∈ s, ‖a n‖^2) := by rw [finiteFourierDerivative, finiteFourierSum_energy_two] have h := mul_le_mul_of_nonneg_left (finiteFourierDerivative_coefficient_bound s a hN hfreq) (by norm_num : (0 : ℝ) ≤ 2) nlinarith end section open Finset ZMod theorem primitive_gaussSum_mul_star {q : ℕ} [NeZero q] {χ : DirichletCharacter ℂ q} (hχ : χ.IsPrimitive) : gaussSum χ ZMod.stdAddChar * star (gaussSum χ ZMod.stdAddChar) = (q : ℂ) := by have hs : (∑ a : ZMod q, ZMod.stdAddChar a * χ⁻¹ (-a)) = gaussSum χ⁻¹ (ZMod.stdAddChar)⁻¹ := by rw [gaussSum] apply Fintype.sum_equiv (Equiv.neg (ZMod q)) intro a simp only [Equiv.neg_apply, AddChar.inv_apply, neg_neg, mul_comm] have hh := congrFun (ZMod.dft_dft (χ : ZMod q → ℂ)) (-1) rw [ZMod.dft_apply] at hh simp only [hχ.fourierTransform_eq_inv_mul_gaussSum, mul_neg_one, neg_neg, smul_eq_mul, map_one] at hh simp_rw [← mul_assoc] at hh rw [← sum_mul, hs, ← star_gaussSum_eq] at hh simpa only [mul_comm, mul_one] using hh theorem primitive_gaussSum_norm_sq {q : ℕ} [NeZero q] {χ : DirichletCharacter ℂ q} (hχ : χ.IsPrimitive) : ‖gaussSum χ ZMod.stdAddChar‖ ^ 2 = (q : ℝ) := by have h := congrArg Complex.re (primitive_gaussSum_mul_star hχ) simpa only [Complex.star_def, Complex.mul_conj, Complex.ofReal_re, Complex.natCast_re, Complex.sq_norm] using h end section open scoped BigOperators Classical noncomputable def minorProductPhase (ζ α : ℝ) (p q : ℕ) : ℂ := Complex.exp (Complex.I * (ζ * Real.log ((p : ℝ) * q) + 2 * Real.pi * (α * ((p : ℝ) * q)) : ℝ)) theorem minor_product_phase_factor (ζ α : ℝ) {p q : ℕ} (hp : 0 < p) (hq : 0 < q) : minorProductPhase ζ α p q = Complex.exp ((ζ * Real.log (p : ℝ) : ℝ) * Complex.I) * Complex.exp ((ζ * Real.log (q : ℝ) : ℝ) * Complex.I) * (Complex.exp (Complex.I * (2 * Real.pi * (α * q) : ℝ))) ^ p := by unfold minorProductPhase rw [← Complex.exp_nat_mul, ← Complex.exp_add, ← Complex.exp_add, Real.log_mul (by exact_mod_cast Nat.ne_of_gt hp) (by exact_mod_cast Nat.ne_of_gt hq)] congr 1 push_cast ring theorem minor_product_phase_dyadic_bound {X Y : Type*} [Fintype X] [Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (hπ : ∀ x, 0 < π x) (hτ : ∀ y, 0 < τ y) (U V : ℕ) (hU : 0 < U) (hV : 0 < V) (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (f : X → ℂ) (g : Y → ℂ) (hf : ∀ x, f x ≠ 0 → U ≤ π x ∧ π x < 2 * U) (hg : ∀ y, g y ≠ 0 → V ≤ τ y ∧ τ y < 2 * V) {C D : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hμatom : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => π x = m), μ x) ≤ C / (m : ℝ)) (hνatom : ∀ m : ℕ, (∑ y ∈ Finset.univ.filter (fun y => τ y = m), ν y) ≤ D / (m : ℝ)) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) (ζ : ℝ) : ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * minorProductPhase ζ ((u : ℝ) / r + β) (π x) (τ y)‖ ^ 2 ≤ 6 * C * D * (1 + Real.log r) * (1 / (r : ℝ) + 1 / (U : ℝ) + 1 / (V : ℝ) + (r : ℝ) / ((U : ℝ) * V)) * (∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2 := by let χ := fun x => Complex.exp ((ζ * Real.log (π x : ℝ) : ℝ) * Complex.I) let ψ := fun y => Complex.exp ((ζ * Real.log (τ y : ℝ) : ℝ) * Complex.I) have hχ : ∀ x, ‖χ x‖ = 1 := fun x => real_mellin_factor_norm ζ (π x) have hψ : ∀ y, ‖ψ y‖ = 1 := fun y => real_mellin_factor_norm ζ (τ y) have hb := supported_weighted_product_dyadic_clean_bound π τ U V hU hV μ ν hμ hν (fun x => χ x * f x) (fun y => ψ y * g y) (fun x hx => hf x ((unit_test_modulation_ne_zero_iff χ f hχ x).mp hx)) (fun y hy => hg y ((unit_test_modulation_ne_zero_iff ψ g hψ y).mp hy)) hC hD hμatom hνatom hr hcop hβ rw [unit_test_modulation_energy μ χ f hχ, unit_test_modulation_energy ν ψ g hψ] at hb convert hb using 2 congr 1 apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ rw [minor_product_phase_factor ζ _ (hπ x) (hτ y)] dsimp only [χ, ψ] ring end section theorem rational_enlarged_dyad_coefficient_le {U V r L : ℝ} (hU : 0 < U) (hV : 0 < V) (hr : 0 < r) (hL : 1 ≤ L) : ((1 + 12 * V / r) * (8 * U + 2 * r * L)) / (U * V) ≤ 96 * L * (1 / r + 1 / U + 1 / V + r / (U * V)) := by apply (div_le_iff₀ (mul_pos hU hV)).mpr have he : 96 * L * (1 / r + 1 / U + 1 / V + r / (U * V)) * (U * V) = (12 * (1 + V / r)) * (8 * L * (U + r)) := by field_simp ring rw [he] apply mul_le_mul · have heq : 1 + 12 * V / r = 12 * (1 + V / r) - 11 := by ring rw [heq] linarith · nlinarith [mul_nonneg hU.le (sub_nonneg.mpr hL), mul_pos hr (lt_of_lt_of_le zero_lt_one hL)] · positivity · positivity theorem rational_enlarged_dyad_energy_le {U V r L C D E F : ℝ} (hU : 0 < U) (hV : 0 < V) (hr : 0 < r) (hL : 1 ≤ L) (hC : 0 ≤ C) (hD : 0 ≤ D) (hE : 0 ≤ E) (hF : 0 ≤ F) : ((1 + 12 * V / r) * (8 * U + 2 * r * L)) * ((C / (U / 2)) * 4 * E) * ((D / (V / 2)) * 4 * F) ≤ 1024 * (6 * C * D * L * (1 / r + 1 / U + 1 / V + r / (U * V)) * E * F) := by have hm := mul_le_mul_of_nonneg_right (rational_enlarged_dyad_coefficient_le hU hV hr hL) (show 0 ≤ 64 * C * D * E * F by positivity) convert hm using 1 <;> first | rfl | (field_simp; ring) theorem norm_sub_le_thirty_three_sqrt {a b : ℂ} {H : ℝ} (hH : 0 ≤ H) (ha : ‖a‖ ^ 2 ≤ H) (hb : ‖b‖ ^ 2 ≤ 1024 * H) : ‖a - b‖ ≤ 33 * Real.sqrt H := by have hs := Real.sq_sqrt hH have hp := Real.sqrt_nonneg H have ha' : ‖a‖ ≤ Real.sqrt H := by nlinarith [norm_nonneg a] have hb' : ‖b‖ ≤ 32 * Real.sqrt H := by nlinarith [norm_nonneg b] exact (norm_sub_le a b).trans (by linarith) end section theorem polynomial_dirichlet_dichotomy (α L q U V : ℝ) (hL : 1 ≤ L) (hq : 0 ≤ q) (hU : L ^ q ≤ U) (hV : L ^ q ≤ V) : ∃ (u : ℤ) (r : ℕ) (β : ℝ), 0 < r ∧ (r : ℤ).gcd u = 1 ∧ α = (u : ℝ) / r + β ∧ |β| ≤ 1 / (r : ℝ) ^ 2 ∧ |β| * (U * V) ≤ L ^ q ∧ (r : ℝ) / (U * V) ≤ L ^ (-q) ∧ (r ≤ ⌊L ^ q⌋₊ ∨ L ^ q < (r : ℝ)) := by have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL have hp : 0 < L ^ q := Real.rpow_pos_of_pos hL0 q have hp1 : 1 ≤ L ^ q := Real.one_le_rpow hL hq have hU0 : 0 < U := hp.trans_le hU have hV1 : 1 ≤ V := hp1.trans hV have hV0 : 0 < V := lt_of_lt_of_le zero_lt_one hV1 have hprod : L ^ q ≤ U * V := hU.trans (le_mul_of_one_le_right hU0.le hV1) obtain ⟨u, r, β, hr, hrb, hcop, heq, hβ, hscale⟩ := dirichlet_scaled_decomposition α (U * V) (L ^ q) (mul_pos hU0 hV0) hp ((one_le_div hp).mpr hprod) have hr1 : (1 : ℝ) ≤ r := by exact_mod_cast hr refine ⟨u, r, β, hr, hcop, heq, hβ, hscale.trans ?_, ?_, ?_⟩ · exact div_le_self hp.le hr1 · rw [Real.rpow_neg hL0.le, ← one_div] apply (div_le_iff₀ (mul_pos hU0 hV0)).mpr calc (r : ℝ) ≤ U * V / L ^ q := hrb _ = 1 / L ^ q * (U * V) := by ring · by_cases h : r ≤ ⌊L ^ q⌋₊ · exact Or.inl h · exact Or.inr ((Nat.floor_lt hp.le).mp (Nat.lt_of_not_ge h)) theorem minor_arc_factor_absorption {L H B : ℝ} (hL : 33 ≤ L) (hH : H ≤ L ^ (-2 * B - 2)) : 33 * Real.sqrt H ≤ L ^ (-B) := by have hL0 : 0 < L := by linarith have hs : Real.sqrt H ≤ L ^ (-B - 1) := by apply (Real.sqrt_le_left (by positivity)).mpr calc H ≤ L ^ (-2 * B - 2) := hH _ = (L ^ (-B - 1)) ^ 2 := by rw [show -2 * B - 2 = (-B - 1) + (-B - 1) by ring, Real.rpow_add hL0] ring calc _ ≤ L * L ^ (-B - 1) := mul_le_mul hL hs (Real.sqrt_nonneg _) (by positivity) _ = L ^ (-B) := by calc _ = L ^ (1 + (-B - 1)) := by rw [Real.rpow_add hL0, Real.rpow_one] _ = _ := by congr 1; ring end section open Filter theorem prime_kernel_gram_error_le {C V a ξ : ℝ} {Q : ℕ} (hC : 0 ≤ C) (hV : 0 ≤ V) (ha : 2 ≤ a) (hξ : 0 ≤ ξ) (hQ : 0 < Q) : (Q * Q - 1 : ℕ) * (((C / V) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ primeKernelError C Q V a ξ := by have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hq : (1 : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast Nat.mul_pos hQ hQ have hlogq := Real.log_nonneg hq unfold primeKernelError apply mul_le_mul_of_nonneg_right · exact_mod_cast Nat.sub_le (Q * Q) 1 · positivity theorem eventually_prime_kernel_error_and_energy_small (c C q v x D : ℝ) (hc : 0 < c) (hC : 0 < C) (hD : 0 ≤ D) : ∀ᶠ L : ℝ in atTop, ∀ (Q : ℕ) (V ξ a : ℝ), 0 < Q → (Q : ℝ) ≤ L ^ q → L ^ (-v) ≤ V → L ^ (-x) ≤ ξ → Real.exp (L ^ c) ≤ a → primeKernelError C Q V a ξ ≤ L ^ (-D) ∧ (Q * Q - 1 : ℕ) * (((C / V) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 := by filter_upwards [eventually_prime_kernel_reproduction_error_small c C q v x D hc hC, eventually_ge_atTop (1 : ℝ)] with L herror hL have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL intro Q V ξ a hQ hQb hV hξ ha have herr : primeKernelError C Q V a ξ ≤ L ^ (-D) := herror Q V ξ a hQ hQb hV hξ ha have ha2 : 2 ≤ a := by calc 2 ≤ Real.exp 1 := by linarith [Real.add_one_le_exp (1 : ℝ)] _ ≤ Real.exp (L ^ c) := Real.exp_le_exp.mpr (Real.one_le_rpow hL hc.le) _ ≤ a := ha refine ⟨herr, (prime_kernel_gram_error_le hC.le ?_ ha2 ?_ hQ).trans (herr.trans ?_)⟩ · exact (Real.rpow_pos_of_pos hL0 (-v)).le.trans hV · exact (Real.rpow_pos_of_pos hL0 (-x)).le.trans hξ · simpa only [Real.rpow_zero] using Real.rpow_le_rpow_of_exponent_le hL (show -D ≤ 0 by linarith) end section open Finset Classical noncomputable def fullDoubledGhostStepEnergy {J K : Type*} (ρ v vmin vmax : ℝ) (T groups : ℕ) : Option (J ⊕ K) → ℝ | none => 1 | some (Sum.inl _) => physicalGhostUniformEnergyBound ρ (2 * vmax) v ^ groups | some (Sum.inr _) => unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ groups section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end end section open Finset Classical universe u v w def finiteEventPathCount {K : Type u} {X : Type v} (E : K → X → Type w) (target : ∀ k x, E k x → X) (count : ∀ k x, E k x → ℕ) : ∀ steps x, FiniteEventPath E target steps x → ℕ | [], _, _ => 0 | k :: steps, x, ⟨e, p⟩ => count k x e + finiteEventPathCount E target count steps (target k x e) p theorem finite_event_path_weight_eq_pow_mul {K : Type u} {X : Type v} (E : K → X → Type w) (target : ∀ k x, E k x → X) (weight marked : ∀ k x, E k x → ℝ) (count : ∀ k x, E k x → ℕ) (a : ℝ) (h : ∀ k x e, marked k x e = a ^ count k x e * weight k x e) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) : finiteEventPathWeight E target marked steps x p = a ^ finiteEventPathCount E target count steps x p * finiteEventPathWeight E target weight steps x p := by induction steps generalizing x with | nil => simp only [finiteEventPathWeight, finiteEventPathCount, pow_zero, one_mul] | cons k steps ih => rcases p with ⟨e, p⟩ simp only [finiteEventPathWeight, finiteEventPathCount, h, ih, pow_add] ring theorem boundedGhostEventWeight_birth_scale {P Z : Type*} (A D C ν : Z → ℝ) (a : ℝ) (t B : ℕ) (s : BoundedOrderedState P Z t B) (e : BoundedGhostEvent t B s) : boundedGhostEventWeight A D (fun z => a * C z) ν t B s e = a ^ e.1.val * boundedGhostEventWeight A D C ν t B s e := by unfold boundedGhostEventWeight split_ifs · simp only [mul_assoc, prod_mul_distrib, prod_const, card_univ, Fintype.card_fin] ring · exact (mul_zero _).symm theorem coupledGhostJointEventWeight_birth_scale {G : Type*} [Fintype G] {P Z : G → Type*} (A D C ν : ∀ g, Z g → ℝ) (a : ℝ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (e : CoupledGhostEvent t B s) : coupledGhostJointEventWeight A D (fun g z => a * C g z) ν t B s e = a ^ (∑ g, (e g).1.val) * coupledGhostJointEventWeight A D C ν t B s e := by unfold coupledGhostJointEventWeight split_ifs · simp_rw [boundedGhostEventWeight_birth_scale] rw [prod_mul_distrib, prod_pow_eq_pow_sum] · exact (mul_zero _).symm theorem physicalGhostBirth_scale {P : Type*} (n : P → ℕ) (q ρ V a : ℝ) (z : UnrestrictedResidueParticle n) : physicalGhostBirth n q ρ (a * V) z = a * physicalGhostBirth n q ρ V z := by unfold physicalGhostBirth split_ifs <;> ring section Full variable {J K G : Type*} [Fintype G] {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → G → ℤ) end Full end section open scoped BigOperators Classical theorem prime_major_arc_dyadic_pairing (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I J : Type u} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I) (R : J → Finset ℕ) (W : J → ℝ) (j : J), (∀ k, 0 < V k) → (∀ k, 0 < W k) → (∀ k p, p ∈ P k → p.Prime ∧ Q < p) → (∀ k p, p ∈ R k → p.Prime ∧ Q < p) → (∀ k, ∑ p ∈ P k, 1 / (p : ℝ) = V k) → (∀ k, ∑ p ∈ R k, 1 / (p : ℝ) = W k) → ∀ a b a' b' : ℝ, P i = primeBand a b → R j = primeBand a' b' → 2 ≤ a → 0 ≤ b → 2 ≤ a' → 0 ≤ b' → ∀ h ξ : ℝ, 0 < h → h ≤ Real.log 2 → 0 < ξ → ∀ U T : ℝ, 0 ≤ U → 0 ≤ T → ∀ (f : (∀ k, P k) → ℂ) (g : (∀ k, R k) → ℂ), (∀ x, f x ≠ 0 → U ≤ ((∏ k, (x k).val : ℕ) : ℝ) ∧ ((∏ k, (x k).val : ℕ) : ℝ) ≤ 2 * U) → (∀ y, g y ≠ 0 → T ≤ ((∏ k, (y k).val : ℕ) : ℝ) ∧ ((∏ k, (y k).val : ℕ) : ℝ) ≤ 2 * T) → ∀ r : ℕ, 0 < r → r ≤ Q → ∀ u : ℤ, ∀ ζ β : ℝ, let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let cellP := fun x : (∀ k, P k) => upperLogCell h (Real.log (∏ k, (x k).val : ℕ)) let cellR := fun y : (∀ k, R k) => upperLogCell h (Real.log (∏ k, (y k).val : ℕ)) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) let phase := fun (x : ∀ k, P k) (y : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ)) + 2 * Real.pi * (((u : ℝ) / r + β) * (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ))) : ℝ)) ‖∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * ((phase x y - finiteTwoKernelAverage μ ν KA KB x y phase) * f x * g y)‖ ≤ (Real.sqrt (((finiteOccupiedCells cellP).card + (finiteOccupiedCells cellR).card : ℝ) * ξ) + (2 * h * (|ζ| + 2 * Real.pi * |β| * (16 * U * T))) * (Q * Q : ℕ) * (Q * Q : ℕ) + Real.sqrt (Q : ℝ) * (primeKernelError C Q (V i) a ξ + primeKernelError C Q (W j) a' ξ + primeKernelError C Q (V i) a ξ * primeKernelError C Q (W j) a' ξ)) * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by obtain ⟨C, hC, hpoint⟩ := prime_major_arc_comparison.{u} hZ refine ⟨C, hC, ?_⟩ intro Q hQ I J _ _ _ _ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hh2 hξ U T hU hT f g hf hg r hr hrQ u ζ β let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let cellP := fun x : (∀ k, P k) => upperLogCell h (Real.log (∏ k, (x k).val : ℕ)) let cellR := fun y : (∀ k, R k) => upperLogCell h (Real.log (∏ k, (y k).val : ℕ)) let keptP := primeProductRetainedCells P V h ξ let keptR := primeProductRetainedCells R W h ξ let KA := primeProductIdealKernel P V Q h keptP let KB := primeProductIdealKernel R W Q h keptR let phase := fun (x : ∀ k, P k) (y : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ)) + 2 * Real.pi * (((u : ℝ) / r + β) * (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ))) : ℝ)) let comparison := fun x y => finiteTwoKernelAverage μ ν KA KB x y phase let E := fun x y => cellP x ∉ keptP ∨ cellR y ∉ keptR let ε := (2 * h * (|ζ| + 2 * Real.pi * |β| * (16 * U * T))) * (Q * Q : ℕ) * (Q * Q : ℕ) + Real.sqrt (Q : ℝ) * (primeKernelError C Q (V i) a ξ + primeKernelError C Q (W j) a' ξ + primeKernelError C Q (V i) a ξ * primeKernelError C Q (W j) a' ξ) have hμ (x : ∀ k, P k) : 0 ≤ μ x := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg V (fun k => (hV k).le) k (x k)) have hν (y : ∀ k, R k) : 0 ≤ ν y := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg W (fun k => (hW k).le) k (y k)) have hμmass : ∑ x, μ x = 1 := finite_product_weight_sum_one _ (fun k => physical_label_law_sum V k (hV k) (hVP k)) have hνmass : ∑ y, ν y = 1 := finite_product_weight_sum_one _ (fun k => physical_label_law_sum W k (hW k) (hWR k)) have hraw (x : ∀ k, P k) (y : ∀ k, R k) : ‖phase x y‖ ≤ 1 := by have hn (t : ℝ) : ‖Complex.exp (Complex.I * (t : ℂ))‖ = 1 := by rw [Complex.norm_exp] simp exact (hn _).le have hzero (x : ∀ k, P k) (y : ∀ k, R k) (he : E x y) : comparison x y = 0 := by rcases he with hx | hy · apply finite_two_kernel_average_zero_left intro d exact prime_ideal_kernel_zero_of_right_discarded P V Q h keptP d x hx · apply finite_two_kernel_average_zero_right intro e exact prime_ideal_kernel_zero_of_right_discarded R W Q h keptR e y hy have hε : 0 ≤ ε := by have hεA := prime_kernel_error_nonneg hC.le (hV i).le ha hξ.le hQ have hεB := prime_kernel_error_nonneg hC.le (hW j).le ha' hξ.le hQ dsimp only [ε] positivity have hclose (x : ∀ k, P k) (y : ∀ k, R k) (hfx : f x ≠ 0) (hgy : g y ≠ 0) (he : ¬ E x y) : ‖phase x y - comparison x y‖ ≤ ε := by have hx : cellP x ∈ keptP := not_not.mp (not_or.mp he).1 have hy : cellR y ∈ keptR := not_not.mp (not_or.mp he).2 have hc := prime_kernel_pair_dyadic_cap P V R W Q (fun k p hp => (hP k p hp).1.pos) (fun k p hp => (hR k p hp).1.pos) hh hh2 keptP keptR hU hT x y (hf x hfx).2 (hg y hgy).2 have hp := hpoint Q hQ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hξ keptP keptR (fun d hd => prime_product_retained_cell_mass P V h ξ hd) (fun e he => prime_product_retained_cell_mass R W h ξ he) x y hx hy r hr hrQ u ζ β (16 * U * T) (by positivity) hc.1 hc.2 rw [norm_sub_rev] exact hp have hpair := finite_retained_comparison_pairing_supported μ ν hμ hν hμmass hνmass E phase comparison hraw hzero f g hε hclose have hmass : finitePairEventMass μ ν E ≤ ((finiteOccupiedCells cellP).card + (finiteOccupiedCells cellR).card : ℝ) * ξ := finite_pair_discarded_mass_le μ ν hμ hν hμmass hνmass cellP cellR hξ.le have heps : Real.sqrt (finitePairEventMass μ ν E) + ε ≤ Real.sqrt (((finiteOccupiedCells cellP).card + (finiteOccupiedCells cellR).card : ℝ) * ξ) + ε := add_le_add (Real.sqrt_le_sqrt hmass) le_rfl have hbound := hpair.trans (mul_le_mul_of_nonneg_right heps (Real.sqrt_nonneg _)) simpa only [ε, add_assoc] using hbound end section open Finset open scoped Classical theorem finite_coordinate_lift_identity {G : Type*} [DecidableEq G] {Y : G → Type*} (g : G) (f : (∀ h, Y h) → ℂ) : finiteCoordinateLift g (fun v => v) f = f := by funext x simp only [finite_coordinate_lift_eq_update, Function.update_eq_self] theorem finite_coordinate_lift_composition {G : Type*} [DecidableEq G] {Y : G → Type*} (g : G) (P Q : (Y g → ℂ) → Y g → ℂ) (f : (∀ h, Y h) → ℂ) : finiteCoordinateLift g P (finiteCoordinateLift g Q f) = finiteCoordinateLift g (fun v => P (Q v)) f := by funext x simp only [finite_coordinate_lift_eq_update, Function.update_self, Function.update_idem] theorem finite_group_unflatten_update {G : Type*} [DecidableEq G] {I X : G → Type*} [∀ g, DecidableEq (I g)] (x : ∀ a : Sigma I, X a.1) (g : G) (i : I g) (v : X g) : finiteGroupFlattenEquiv.symm (Function.update x ⟨g, i⟩ v) = Function.update (finiteGroupFlattenEquiv.symm x) g (Function.update (finiteGroupFlattenEquiv.symm x g) i v) := by funext h j by_cases hh : h = g · subst h by_cases hj : j = i · subst j simp only [finite_group_unflatten_apply, Function.update_self] · have hs : (⟨g, j⟩ : Sigma I) ≠ ⟨g, i⟩ := by simpa using hj simp only [finite_group_unflatten_apply, Function.update_of_ne hs, Function.update_self, Function.update_of_ne hj] · have hs : (⟨h, j⟩ : Sigma I) ≠ ⟨g, i⟩ := fun he => hh (congrArg Sigma.fst he) simp only [finite_group_unflatten_apply, Function.update_of_ne hs, Function.update_of_ne hh] section variable {G : Type*} [sharedInstance1 : DecidableEq G] {I X : G → Type*} [sharedInstance3 : ∀ g, DecidableEq (I g)] [sharedInstance4 : ∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (g : G) include G sharedInstance1 I X sharedInstance3 sharedInstance4 μ g theorem finite_group_flatten_average (i : I g) (f : (∀ g, I g → X g) → ℂ) : finiteCoordinateAverage (fun a : Sigma I => μ a.1) ⟨g, i⟩ (finiteGroupFlattenFunction f) = finiteGroupFlattenFunction (finiteCoordinateLift g (finiteCoordinateAverage (fun _ : I g => μ g) i) f) := by funext x rw [finite_coordinate_average_update] change (∑ y, (μ g y : ℂ) * f (finiteGroupFlattenEquiv.symm (Function.update x ⟨g, i⟩ y))) = _ simp only [finite_group_unflatten_update] change _ = finiteCoordinateLift g (finiteCoordinateAverage (fun _ : I g => μ g) i) f (finiteGroupFlattenEquiv.symm x) rw [finite_coordinate_lift_eq_update, finite_coordinate_average_update] theorem finite_group_flatten_choice (i : I g) (S : Finset (Sigma I)) (A : Finset (I g)) (hi : (⟨g, i⟩ : Sigma I) ∈ S ↔ i ∈ A) (f : (∀ g, I g → X g) → ℂ) : finiteCoordinateChoice (fun a : Sigma I => μ a.1) ⟨g, i⟩ S (finiteGroupFlattenFunction f) = finiteGroupFlattenFunction (finiteCoordinateLift g (finiteCoordinateChoice (fun _ : I g => μ g) i A) f) := by have hav := finite_group_flatten_average μ g i f by_cases hA : i ∈ A · have hS := hi.mpr hA unfold finiteCoordinateChoice simp only [if_pos hS, if_pos hA] rw [hav] funext x simp only [Pi.sub_apply, finiteGroupFlattenFunction, finite_coordinate_lift_eq_update, Function.update_eq_self] · have hS : (⟨g, i⟩ : Sigma I) ∉ S := fun h => hA (hi.mp h) unfold finiteCoordinateChoice simp only [if_neg hS, if_neg hA] exact hav theorem finite_group_flatten_component (S : Finset (Sigma I)) (A : Finset (I g)) (is : List (I g)) (hS : ∀ i ∈ is, (⟨g, i⟩ : Sigma I) ∈ S ↔ i ∈ A) (f : (∀ g, I g → X g) → ℂ) : finiteCoordinateComponent (fun a : Sigma I => μ a.1) S (is.map (Sigma.mk g)) (finiteGroupFlattenFunction f) = finiteGroupFlattenFunction (finiteCoordinateLift g (finiteCoordinateComponent (fun _ : I g => μ g) A is) f) := by induction is with | nil => simp only [List.map_nil, finiteCoordinateComponent, finite_coordinate_lift_identity] | cons i is ih => simp only [List.map_cons, finiteCoordinateComponent] rw [ih (fun j hj => hS j (List.mem_cons_of_mem _ hj)), finite_group_flatten_choice μ g i S A (hS i (List.mem_cons_self)), finite_coordinate_lift_composition] end end section open scoped BigOperators Classical section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {I X : G → Type*} [sharedInstance4 : ∀ g, Fintype (I g)] [sharedInstance5 : ∀ g, DecidableEq (I g)] [sharedInstance6 : ∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (hμ : ∀ g x, 0 ≤ μ g x) (hmass : ∀ g, ∑ x, μ g x = 1) (B : ∀ g, Finset (I g)) (f : (∀ g, I g → X g) → ℂ) include G sharedInstance1 sharedInstance2 I X sharedInstance4 sharedInstance5 sharedInstance6 μ hμ hmass B f theorem finite_flatten_tail_energy_le : finiteWeightedEnergy (finiteProductWeight (fun a : Sigma I => μ a.1)) (finiteCoordinateComponent (fun a : Sigma I => μ a.1) ∅ (Finset.univ.sigma B).toList (finiteGroupFlattenFunction f)) ≤ finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f := by have h := finite_coordinate_averaging_energy_le (fun a : Sigma I => μ a.1) (fun a x => hμ a.1 x) (fun a => hmass a.1) (Finset.univ.sigma B) (finiteGroupFlattenFunction f) have heq : finiteWeightedEnergy (finiteProductWeight (fun a : Sigma I => μ a.1)) (finiteGroupFlattenFunction f) = finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f := by convert finite_group_flatten_energy μ f using 1 <;> congr 1 <;> exact Subsingleton.elim _ _ exact h.trans_eq heq theorem finite_flatten_tail_norm_le : Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun a : Sigma I => μ a.1)) (finiteCoordinateComponent (fun a : Sigma I => μ a.1) ∅ (Finset.univ.sigma B).toList (finiteGroupFlattenFunction f))) ≤ Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f) := Real.sqrt_le_sqrt (finite_flatten_tail_energy_le μ hμ hmass B f) end end section section Ledger variable {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) (ks : List K) (initial : X → L) def finiteInitialLedgerPhase (phase : ∀ s : L × X, FiniteEventPath (fun k s => E k s.2) (finiteLedgerEventTarget E target update) ks s → ℂ) (x : X) (p : FiniteEventPath E target ks x) : ℂ := phase (initial x, x) ((finiteLedgerEventPathEquiv E target update ks (initial x) x).symm p) variable [∀ k x, Fintype (E k x)] (weight : ∀ k x, E k x → ℝ) theorem finite_initial_ledger_path_action (phase : ∀ s : L × X, FiniteEventPath (fun k s => E k s.2) (finiteLedgerEventTarget E target update) ks s → ℂ) (F : X → ℂ) : (fun x => finiteEventPathAction (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) (fun k s => weight k s.2) ks phase (fun s => F s.2) (initial x, x)) = finiteEventPathAction E target weight ks (finiteInitialLedgerPhase E target update ks initial phase) F := by funext x exact finite_ledger_event_path_action_memory E target update weight ks phase F (initial x) x end Ledger end section universe uJ uK uP uA section Full variable {J : Type uJ} {K : Type uK} {N : ℕ} {P : Fin N → Type uP} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) noncomputable def fullMixedLedgerPhase : (i : Option (J ⊕ K)) → (s : FullMixedLedgerState n (M := M) B) → FullPermutationMixedEvent n S B A Δ D i s.2 → ℂ | none, _, _ => 1 | some (.inl j), s, e => fullMixedGhostFreshnessPhase n S B A Δ D j (fun g => (s.1 g, s.2 g)) e | some (.inr k), s, e => edgePhase k s.1 s.2 e omit [∀ g, DecidableEq (P g)] in theorem full_mixed_ledger_phase_norm_le (hphase : ∀ k H x e, ‖edgePhase k H x e‖ ≤ 1) (i : Option (J ⊕ K)) (s : FullMixedLedgerState n (M := M) B) (e : FullPermutationMixedEvent n S B A Δ D i s.2) : ‖fullMixedLedgerPhase n S B A Δ D edgePhase i s e‖ ≤ 1 := by cases i with | none => simp only [fullMixedLedgerPhase, norm_one, le_refl] | some i => cases i with | inl j => exact full_mixed_ghost_freshness_phase_norm n S B A Δ D j (fun g => (s.1 g, s.2 g)) e | inr k => exact hphase k s.1 s.2 e variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def fullMixedLedgerRow : Option (J ⊕ K) → (FullMixedLedgerState n (M := M) B → ℂ) → FullMixedLedgerState n (M := M) B → ℂ := let _ : ∀ (i : Option (J ⊕ K)) x, Fintype (FullPermutationMixedEvent n S B A Δ D i x) := fullPermutationMixedEventFintype n S B A Δ D finiteLocalPhasedRow (fun i (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D i s.2) (fullMixedLedgerTarget n S B A Δ D) (fullMixedLedgerPhase n S B A Δ D edgePhase) (fun i s => fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V i s.2) end Full end section open Finset open scoped Classical section Physical variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {Z : G → Type*} [∀ g, Fintype (Z g)] {J ell B : ℕ} (C : G → Finset (Fin J)) end Physical end section open Finset noncomputable def fullActiveInitialLedger {G : Type*} {P Z : G → Type*} [∀ g, DecidableEq (P g)] {M : G → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z M B) : (g : G) → Finset (P g) := fun g => univ.image (x g).1 def fullEmptyBoundedMemory (Z : Type*) (B : ℕ) : BoundedOrderedTuple Z B := ⟨⟨0, Nat.zero_lt_succ B⟩, Fin.elim0⟩ theorem physical_full_initial_ledger {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : (g : G) → BoundedOrderedTuple (Z g) B) : fullActiveInitialLedger (physicalFullMemoryState C L q) = fun g => ghostPhaseActivitySupport (physicalGroupPhaseActivity L g) := by funext g rw [physical_group_phase_activity_support_eq_image] ext p change p ∈ univ.image (fun i => L g (physicalFullSlotIndex (C g) i)) ↔ p ∈ univ.image (L g) simp only [mem_image, mem_univ, true_and] constructor · rintro ⟨i, hi⟩ exact ⟨physicalFullSlotIndex (C g) i, hi⟩ · rintro ⟨i, hi⟩ exact ⟨(physicalFullSlotIndex (C g)).symm i, by simpa only [Equiv.apply_symm_apply] using hi⟩ end section open Finset open scoped Classical theorem physical_full_state_labels_of_eq {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (q r : (g : G) → BoundedOrderedTuple (Z g) B) (h : physicalFullMemoryState C L q = physicalFullMemoryState C R r) : L = R := by have he : physicalFullStateEquiv C (L, q) = physicalFullStateEquiv C (R, r) := Subtype.ext h exact congrArg Prod.fst ((physicalFullStateEquiv C).injective he) section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (ω : ∀ _c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) theorem physical_full_edge_endpoint_unique (hw : fullActiveEdgeEventWeight (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e ≠ 0) (R T : PhysicalMarkLists P J ell) (hR : physicalFullEdgePhase C k L R H q e ≠ 0) (hT : physicalFullEdgePhase C k L T H q e ≠ 0) : R = T := by have hr := physical_full_edge_target_of_nonzero C k L R H q ω μ ρ V e hw hR have ht := physical_full_edge_target_of_nonzero C k L T H q ω μ ρ V e hw hT exact physical_full_state_labels_of_eq C R T _ _ (hr.symm.trans ht) theorem physical_full_edge_endpoint_sum_norm_le (hw : fullActiveEdgeEventWeight (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e ≠ 0) : ‖∑ R : PhysicalMarkLists P J ell, physicalFullEdgePhase C k L R H q e‖ ≤ 1 := by by_cases hz : ∀ R : PhysicalMarkLists P J ell, physicalFullEdgePhase C k L R H q e = 0 · simp only [hz, sum_const_zero, norm_zero, zero_le_one] · obtain ⟨R, hR⟩ := not_forall.mp hz rw [sum_eq_single R] · exact physical_full_edge_phase_norm_le C k L R H q e · intro T _ hT by_contra hn exact hT (physical_full_edge_endpoint_unique C k L H q ω μ ρ V e hw T R hn hR) · simp only [mem_univ, not_true_eq_false, false_implies] noncomputable def physicalFullEndpointPhase : ℂ := if fullActiveEdgeEventWeight (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e = 0 then 0 else ∑ R : PhysicalMarkLists P J ell, physicalFullEdgePhase C k L R H q e theorem physical_full_endpoint_phase_norm_le : ‖physicalFullEndpointPhase C k L H q ω μ ρ V e‖ ≤ 1 := by unfold physicalFullEndpointPhase split_ifs with hw · simp only [norm_zero, zero_le_one] · exact physical_full_edge_endpoint_sum_norm_le C k L H q ω μ ρ V e hw theorem physical_full_endpoint_phase_weighted : let w := fullActiveEdgeEventWeight (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e (w : ℂ) * physicalFullEndpointPhase C k L H q ω μ ρ V e = ∑ R : PhysicalMarkLists P J ell, (w : ℂ) * physicalFullEdgePhase C k L R H q e := by dsimp only unfold physicalFullEndpointPhase split_ifs with hw · simp only [hw, Complex.ofReal_zero, zero_mul, sum_const_zero] · exact mul_sum _ _ _ end Physical end section open scoped BigOperators Classical theorem finite_set_sum_four_swap {A B X Y M : Type*} [AddCommMonoid M] (s : Finset A) (t : Finset B) (u : Finset X) (v : Finset Y) (F : A → B → X → Y → M) : (∑ a ∈ s, ∑ b ∈ t, ∑ x ∈ u, ∑ y ∈ v, F a b x y) = ∑ x ∈ u, ∑ y ∈ v, ∑ a ∈ s, ∑ b ∈ t, F a b x y := by have h : (∑ ab ∈ s ×ˢ t, ∑ xy ∈ u ×ˢ v, F ab.1 ab.2 xy.1 xy.2) = ∑ xy ∈ u ×ˢ v, ∑ ab ∈ s ×ˢ t, F ab.1 ab.2 xy.1 xy.2 := Finset.sum_comm simpa only [Finset.sum_product] using h theorem finite_dyadic_pairing_sum {X Y : Type*} [Fintype X] [Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (μ : X → ℝ) (ν : Y → ℝ) (f : X → ℂ) (g : Y → ℂ) (K : X → Y → ℂ) : (∑ i ∈ finiteDyadicIndices π, ∑ j ∈ finiteDyadicIndices τ, ∑ x, ∑ y, ((μ x : ℂ) * finiteDyadicTest π i f x) * ((ν y : ℂ) * finiteDyadicTest τ j g y) * K x y) = ∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * K x y := by rw [finite_set_sum_four_swap] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ simp only [← Finset.mul_sum, ← Finset.sum_mul, finite_dyadic_test_sum] section variable {X Y : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (f : X → ℂ) (g : Y → ℂ) (K : X → Y → ℂ) include X Y sharedInstance1 sharedInstance2 π τ μ ν hμ hν f g K theorem finite_dyadic_pairing_bound {ε : ℝ} (hε : 0 ≤ ε) (hdyad : ∀ i ∈ finiteDyadicIndices π, ∀ j ∈ finiteDyadicIndices τ, ‖∑ x, ∑ y, ((μ x : ℂ) * finiteDyadicTest π i f x) * ((ν y : ℂ) * finiteDyadicTest τ j g y) * K x y‖ ≤ ε * Real.sqrt ((∑ x, μ x * ‖finiteDyadicTest π i f x‖ ^ 2) * ∑ y, ν y * ‖finiteDyadicTest τ j g y‖ ^ 2)) : ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * K x y‖ ≤ ((finiteDyadicIndices π).card : ℝ) * (finiteDyadicIndices τ).card * ε * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by have he (i j : ℕ) : Real.sqrt ((∑ x, μ x * ‖finiteDyadicTest π i f x‖ ^ 2) * ∑ y, ν y * ‖finiteDyadicTest τ j g y‖ ^ 2) ≤ Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by apply Real.sqrt_le_sqrt apply mul_le_mul (finite_dyadic_test_energy_le π μ hμ f i) (finite_dyadic_test_energy_le τ ν hν g j) · exact Finset.sum_nonneg (fun y _ => mul_nonneg (hν y) (sq_nonneg _)) · exact Finset.sum_nonneg (fun x _ => mul_nonneg (hμ x) (sq_nonneg _)) rw [← finite_dyadic_pairing_sum π τ μ ν f g K] calc _ ≤ ∑ i ∈ finiteDyadicIndices π, ∑ j ∈ finiteDyadicIndices τ, ‖∑ x, ∑ y, ((μ x : ℂ) * finiteDyadicTest π i f x) * ((ν y : ℂ) * finiteDyadicTest τ j g y) * K x y‖ := by exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun i _ => norm_sum_le _ _)) _ ≤ ∑ _i ∈ finiteDyadicIndices π, ∑ _j ∈ finiteDyadicIndices τ, ε * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by apply Finset.sum_le_sum intro i hi apply Finset.sum_le_sum intro j hj exact (hdyad i hi j hj).trans (mul_le_mul_of_nonneg_left (he i j) hε) _ = _ := by simp only [Finset.sum_const, nsmul_eq_mul]; ring theorem finite_dyadic_pairing_polynomial_bound {L a b B : ℝ} (hL : 0 < L) (hπ : ((finiteDyadicIndices π).card : ℝ) ≤ L ^ a) (hτ : ((finiteDyadicIndices τ).card : ℝ) ≤ L ^ b) (hdyad : ∀ i ∈ finiteDyadicIndices π, ∀ j ∈ finiteDyadicIndices τ, ‖∑ x, ∑ y, ((μ x : ℂ) * finiteDyadicTest π i f x) * ((ν y : ℂ) * finiteDyadicTest τ j g y) * K x y‖ ≤ L ^ (-B - a - b) * Real.sqrt ((∑ x, μ x * ‖finiteDyadicTest π i f x‖ ^ 2) * ∑ y, ν y * ‖finiteDyadicTest τ j g y‖ ^ 2)) : ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * K x y‖ ≤ L ^ (-B) * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by refine (finite_dyadic_pairing_bound π τ μ ν hμ hν f g K (by positivity) hdyad).trans ?_ calc _ ≤ L ^ a * L ^ b * L ^ (-B - a - b) * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by gcongr _ = _ := by rw [← Real.rpow_add hL, ← Real.rpow_add hL] congr 2 ring end end section open Finset theorem conductor_divisors_filter_eq (d R : ℕ) (hd : d ≠ 0) : d.divisors.filter (fun f => 1 < f ∧ f ≤ R) = (Icc 2 R).filter (fun f => f ∣ d) := by ext f simp only [mem_filter, Nat.mem_divisors, mem_Icc] omega theorem conductor_sum_reindex (N R : ℕ) (F : ℕ → ℕ → ℝ) : (∑ d ∈ (Icc 1 N).filter Squarefree, ∑ f ∈ d.divisors.filter (fun f => 1 < f ∧ f ≤ R), F d f) = ∑ f ∈ Icc 2 R, ∑ d ∈ (Icc 1 N).filter (fun d => Squarefree d ∧ f ∣ d), F d f := by classical calc _ = ∑ d ∈ (Icc 1 N).filter Squarefree, ∑ f ∈ Icc 2 R, if f ∣ d then F d f else 0 := by apply sum_congr rfl intro d hd rw [conductor_divisors_filter_eq d R (by have := (mem_Icc.mp (mem_filter.mp hd).1).1 omega), sum_filter] _ = ∑ f ∈ Icc 2 R, ∑ d ∈ (Icc 1 N).filter Squarefree, if f ∣ d then F d f else 0 := sum_comm _ = _ := by apply sum_congr rfl intro f _ rw [← sum_filter, filter_filter] theorem small_conductor_totient_mass_le (N R : ℕ) (B : ℕ → ℝ) (hB : ∀ f ∈ Icc 2 R, 0 ≤ B f) {D : ℝ} (hD : 1 ≤ D) (hND : (N : ℝ) ≤ D) : (∑ d ∈ (Icc 1 N).filter Squarefree, ∑ f ∈ d.divisors.filter (fun f => 1 < f ∧ f ≤ R), (Nat.totient f : ℝ) * B f / (Nat.totient d : ℝ)) ≤ ((2 * primeEulerProductUpperConstant) * Real.log (2 * D)) * ∑ f ∈ Icc 2 R, B f := by rw [conductor_sum_reindex, mul_sum] apply sum_le_sum intro f hf have hfpos : 0 < f := by have := (mem_Icc.mp hf).1; omega have hphi : (0 : ℝ) < Nat.totient f := by exact_mod_cast Nat.totient_pos.mpr hfpos calc _ = ((Nat.totient f : ℝ) * B f) * ∑ d ∈ (Icc 1 N).filter (fun d => Squarefree d ∧ f ∣ d), 1 / (Nat.totient d : ℝ) := by rw [mul_sum] apply sum_congr rfl intro d _ ring _ ≤ ((Nat.totient f : ℝ) * B f) * ((1 / (Nat.totient f : ℝ)) * ((2 * primeEulerProductUpperConstant) * Real.log (2 * D))) := mul_le_mul_of_nonneg_left (conductor_totient_mass_le_log N f hfpos hD hND) (mul_nonneg hphi.le (hB f hf)) _ = _ := by field_simp theorem primitive_character_sum_le_card (f : ℕ) (hf : 0 < f) [DecidablePred (fun ψ : DirichletCharacter ℂ f => ψ.IsPrimitive ∧ ψ ≠ 1)] (F : DirichletCharacter ℂ f → ℝ) {B : ℝ} (hB : 0 ≤ B) (hF : ∀ ψ : DirichletCharacter ℂ f, ψ.IsPrimitive → ψ ≠ 1 → F ψ ≤ B) : (∑ ψ ∈ (univ : Finset (DirichletCharacter ℂ f)).filter (fun ψ => ψ.IsPrimitive ∧ ψ ≠ 1), F ψ) ≤ (Nat.totient f : ℝ) * B := by classical have hcard : Fintype.card (DirichletCharacter ℂ f) = Nat.totient f := by rw [← Nat.card_eq_fintype_card] exact @DirichletCharacter.card_eq_totient_of_hasEnoughRootsOfUnity ℂ _ f ⟨hf.ne'⟩ _ calc _ ≤ ∑ _ψ ∈ (univ : Finset (DirichletCharacter ℂ f)).filter (fun ψ => ψ.IsPrimitive ∧ ψ ≠ 1), B := by apply sum_le_sum intro ψ hψ exact hF ψ (mem_filter.mp hψ).2.1 (mem_filter.mp hψ).2.2 _ ≤ ∑ _ψ : DirichletCharacter ℂ f, B := sum_le_sum_of_subset_of_nonneg (filter_subset _ _) (by intros; exact hB) _ = _ := by simp [hcard] theorem small_primitive_conductor_mass_le {Ω : Type*} (N R : ℕ) [∀ f : ℕ, DecidablePred (fun ψ : DirichletCharacter ℂ f => ψ.IsPrimitive ∧ ψ ≠ 1)] (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) (B : ℕ → ℝ) (hB : ∀ f ∈ Icc 2 R, 0 ≤ B f) {D : ℝ} (hD : 1 ≤ D) (hND : (N : ℝ) ≤ D) (hbound : ∀ d ∈ (Icc 1 N).filter Squarefree, ∀ f ∈ d.divisors.filter (fun f => 1 < f ∧ f ≤ R), ∀ ψ : DirichletCharacter ℂ f, ψ.IsPrimitive → ψ ≠ 1 → ‖∑ t ∈ T.filter (fun t => (value t).Coprime (d / f)), μ t * ψ (value t : ZMod f)‖ ≤ B f) : (∑ d ∈ (Icc 1 N).filter Squarefree, (∑ f ∈ d.divisors.filter (fun f => 1 < f ∧ f ≤ R), ∑ ψ ∈ (univ : Finset (DirichletCharacter ℂ f)).filter (fun ψ => ψ.IsPrimitive ∧ ψ ≠ 1), ‖∑ t ∈ T.filter (fun t => (value t).Coprime (d / f)), μ t * ψ (value t : ZMod f)‖) / (Nat.totient d : ℝ)) ≤ ((2 * primeEulerProductUpperConstant) * Real.log (2 * D)) * ∑ f ∈ Icc 2 R, B f := by classical apply le_trans _ (small_conductor_totient_mass_le N R B hB hD hND) apply sum_le_sum intro d hd rw [sum_div] apply sum_le_sum intro f hf have hfR : f ∈ Icc 2 R := by obtain ⟨_, h1, hR⟩ := mem_filter.mp hf exact mem_Icc.mpr ⟨by omega, hR⟩ apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg _) exact primitive_character_sum_le_card f (by have := (mem_Icc.mp hfR).1; omega) _ (hB f hfR) (hbound d hd f hf) end section open Finset theorem primeBand_product_clip_upper {a b c U V : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 < c) (hU : 0 ≤ U) (hV : 0 ≤ V) : (primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V) = (primeBand a (min b (V / c))).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V) := by rw [primeBand_product_interval ha hb hc hU hV, primeBand_product_interval ha (le_min hb (div_nonneg hV hc.le)) hc hU hV, min_assoc, min_self] theorem ordinary_prime_band_product_relative_bound (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ a b c U V : ℝ, 2 ≤ a → 0 ≤ b → 0 < c → 0 ≤ U → 0 ≤ V → ‖∑ p ∈ (primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V), χ (p : ZMod q)‖ ≤ 2 * (V / c) * C * a ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log a) := by obtain ⟨C, hC, hbound⟩ := ordinary_prime_band_product_interval_bound hZ refine ⟨C, hC, ?_⟩ intro q hq χ hχ a b c U V ha hb hc hU hV have hqlog : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg (by exact_mod_cast hq) have halog : 0 < Real.log a := Real.log_pos (by linarith) rw [primeBand_product_clip_upper (by linarith) hb hc hU hV] apply (hbound q hq χ hχ a (min b (V / c)) c U V ha (le_min hb (div_nonneg hV hc.le)) hc hU hV).trans gcongr exact min_le_right _ _ theorem prime_sum_filter_coprime_relative_error (S : Finset ℕ) (hS : ∀ p ∈ S, p.Prime) (F : ℕ → ℂ) (hF : ∀ p ∈ S, ‖F p‖ ≤ 1) {a B : ℝ} (ha : 0 < a) (hB : 0 ≤ B) (hlower : ∀ p ∈ S, a ≤ (p : ℝ)) (hupper : ∀ p ∈ S, (p : ℝ) ≤ B) {m : ℕ} (hm : m ≠ 0) : ‖∑ p ∈ S.filter (fun p => p.Coprime m), F p‖ ≤ ‖∑ p ∈ S, F p‖ + (B / a) * (m.primeFactors.card : ℝ) := by classical let E := S.filter (fun p => ¬ p.Coprime m) have hE : E ⊆ m.primeFactors := by intro p hp obtain ⟨hpS, hpc⟩ := mem_filter.mp hp apply (hS p hpS).mem_primeFactors _ hm simpa only [(hS p hpS).coprime_iff_not_dvd, not_not] using hpc have herr : ‖∑ p ∈ E, F p‖ ≤ (B / a) * (m.primeFactors.card : ℝ) := by calc _ ≤ ∑ p ∈ E, ‖F p‖ := norm_sum_le _ _ _ ≤ ∑ _p ∈ E, B / a := by apply sum_le_sum intro p hp have hpS := (mem_filter.mp hp).1 apply (hF p hpS).trans exact (one_le_div ha).mpr ((hlower p hpS).trans (hupper p hpS)) _ = (B / a) * (E.card : ℝ) := by simp [mul_comm] _ ≤ (B / a) * (m.primeFactors.card : ℝ) := mul_le_mul_of_nonneg_left (Nat.cast_le.mpr (card_le_card hE)) (div_nonneg hB ha.le) have hsplit : (∑ p ∈ S.filter (fun p => p.Coprime m), F p) = (∑ p ∈ S, F p) - ∑ p ∈ E, F p := by apply eq_sub_iff_add_eq.mpr rw [show E = S.filter (fun p => ¬ p.Coprime m) from rfl, sum_filter, sum_filter, ← sum_add_distrib] apply sum_congr rfl intro p _ by_cases h : p.Coprime m <;> simp [h] rw [hsplit] exact (norm_sub_le _ _).trans (add_le_add le_rfl herr) theorem ordinary_prime_band_product_coprime_relative_bound (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ a b c U V : ℝ, 2 ≤ a → 0 ≤ b → 0 < c → 0 ≤ U → 0 ≤ V → ∀ m : ℕ, m ≠ 0 → ‖∑ p ∈ ((primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V)).filter (fun p => p.Coprime m), χ (p : ZMod q)‖ ≤ (V / c) * (2 * C * a ^ (-(1 : ℝ) / 32) * (1 + Real.log q / Real.log a) + (m.primeFactors.card : ℝ) / a) := by obtain ⟨C, hC, hbound⟩ := ordinary_prime_band_product_relative_bound hZ refine ⟨C, hC, ?_⟩ intro q hq χ hχ a b c U V ha hb hc hU hV m hm let S := (primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V) have hS (p : ℕ) (hp : p ∈ S) : p.Prime ∧ a < (p : ℝ) ∧ (p : ℝ) ≤ b := (mem_primeBand_iff (by linarith) hb p).mp (mem_filter.mp hp).1 have hupper (p : ℕ) (hp : p ∈ S) : (p : ℝ) ≤ V / c := by apply (le_div_iff₀ hc).mpr simpa only [mul_comm] using (mem_filter.mp hp).2.2 have herr := prime_sum_filter_coprime_relative_error S (fun p hp => (hS p hp).1) (fun p => χ (p : ZMod q)) (fun p _ => χ.norm_le_one _) (by linarith : 0 < a) (div_nonneg hV hc.le) (fun p hp => (hS p hp).2.1.le) hupper hm apply herr.trans apply le_trans (add_le_add (hbound q hq χ hχ a b c U V ha hb hc hU hV) le_rfl) exact le_of_eq (by ring) end section open scoped BigOperators theorem finiteFourierSum_separated_bound {ι : Type*} (samples : Finset ι) (x : ι → ℝ) {δ N : ℝ} (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hx : ∀ i ∈ samples, 0 ≤ x i ∧ x i ≤ 1) (hsep : ∀ i ∈ samples, ∀ j ∈ samples, i ≠ j → δ ≤ |x i - x j|) (freq : Finset ℤ) (a : ℤ → ℂ) (hN : 0 ≤ N) (hfreq : ∀ n ∈ freq, |(n : ℝ)| ≤ N) : (∑ i ∈ samples, ‖finiteFourierSum freq a (x i)‖ ^ 2) ≤ 2 * (δ⁻¹ + 2 + 4 * Real.pi * N) * ∑ n ∈ freq, ‖a n‖ ^ 2 := by have henergy : 0 ≤ 2 * ∑ n ∈ freq, ‖a n‖ ^ 2 := by positivity have hK : 0 < 1 + 2 * Real.pi * N := by positivity have hK2 : (2 * Real.pi * N) ^ 2 ≤ (1 + 2 * Real.pi * N) ^ 2 := by nlinarith [mul_nonneg (by positivity : 0 ≤ 2 * Real.pi) hN] have hderiv : (∫ y in (0 : ℝ)..2, ‖finiteFourierDerivative freq a y‖ ^ 2) ≤ (1 + 2 * Real.pi * N) ^ 2 * (2 * ∑ n ∈ freq, ‖a n‖ ^ 2) := (finiteFourierDerivative_energy_two_le freq a hN hfreq).trans (mul_le_mul_of_nonneg_right hK2 henergy) have h := separated_samples_norm_sq_le_energy samples x hδ (by norm_num : (0 : ℝ) ≤ 2) (fun i hi => (hx i hi).1) (fun i hi => by linarith [(hx i hi).2]) hsep (finiteFourierSum freq a) (finiteFourierDerivative freq a) (hasDerivAt_finiteFourierSum freq a) (continuous_finiteFourierDerivative freq a) hK (finiteFourierSum_energy_two freq a).le hderiv convert h using 1; ring section variable (samples : Finset (ℕ × ℕ)) {R N : ℝ} (hR : 1 ≤ R) (hsamples : ∀ v ∈ samples, 0 < v.2 ∧ v.1 < v.2 ∧ v.1.Coprime v.2 ∧ (v.2 : ℝ) ≤ R) (freq : Finset ℤ) (a : ℤ → ℂ) (hN : 0 ≤ N) (hfreq : ∀ n ∈ freq, |(n : ℝ)| ≤ N) include samples R N hR hsamples freq a hN hfreq theorem additive_large_sieve_reduced_fractions : (∑ v ∈ samples, ‖finiteFourierSum freq a ((v.1 : ℝ) / v.2)‖ ^ 2) ≤ 2 * (R ^ 2 + 2 + 4 * Real.pi * N) * ∑ n ∈ freq, ‖a n‖ ^ 2 := by have hR0 : 0 < R := lt_of_lt_of_le zero_lt_one hR have hδ : 0 < 1 / R ^ 2 := by positivity have hδ1 : 1 / R ^ 2 ≤ 1 := (div_le_one (sq_pos_of_pos hR0)).mpr (one_le_pow₀ hR) obtain ⟨hrange, hsep⟩ := reduced_fraction_samples_data samples hsamples have h := finiteFourierSum_separated_bound samples (fun v => (v.1 : ℝ) / v.2) hδ hδ1 (fun v hv => ⟨(hrange v hv).1, (hrange v hv).2.le⟩) hsep freq a hN hfreq simpa only [one_div, inv_inv] using h theorem additive_large_sieve_reduced_fractions_coarse : (∑ v ∈ samples, ‖finiteFourierSum freq a ((v.1 : ℝ) / v.2)‖ ^ 2) ≤ (6 + 8 * Real.pi) * (N + R ^ 2) * ∑ n ∈ freq, ‖a n‖ ^ 2 := by apply (additive_large_sieve_reduced_fractions samples hR hsamples freq a hN hfreq).trans apply mul_le_mul_of_nonneg_right _ (by positivity) have hR2 : 1 ≤ R ^ 2 := one_le_pow₀ hR nlinarith [mul_nonneg (by positivity : 0 ≤ Real.pi) hN, mul_nonneg (by positivity : 0 ≤ Real.pi) (sq_nonneg R)] end end section open scoped BigOperators Classical section variable {X Y : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (hπ : ∀ x, 0 < π x) (hτ : ∀ y, 0 < τ y) (U V : ℕ) (hU : 0 < U) (hV : 0 < V) (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (KA : X → X → ℂ) (KB : Y → Y → ℂ) (f : X → ℂ) (g : Y → ℂ) include X Y sharedInstance1 sharedInstance2 π τ hπ hτ U V hU hV μ ν hμ hν KA KB f g theorem two_kernel_full_phase_enlarged_dyadic_bound (hf : ∀ x, finiteKernelTestTransform μ KA f x ≠ 0 → (U : ℝ) / 2 ≤ π x ∧ (π x : ℝ) ≤ 4 * U) (hg : ∀ y, finiteKernelTestTransform ν KB g y ≠ 0 → (V : ℝ) / 2 ≤ τ y ∧ (τ y : ℝ) ≤ 4 * V) (hEA : (∑ x, μ x * ‖finiteKernelTestTransform μ KA f x‖ ^ 2) ≤ 4 * ∑ x, μ x * ‖f x‖ ^ 2) (hEB : (∑ y, ν y * ‖finiteKernelTestTransform ν KB g y‖ ^ 2) ≤ 4 * ∑ y, ν y * ‖g y‖ ^ 2) {C D : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hμatom : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => π x = m), μ x) ≤ C / (m : ℝ)) (hνatom : ∀ m : ℕ, (∑ y ∈ Finset.univ.filter (fun y => τ y = m), ν y) ≤ D / (m : ℝ)) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) (ζ : ℝ) : ‖∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * finiteTwoKernelAverage μ ν KA KB x y (fun d e => minorProductPhase ζ ((u : ℝ) / r + β) (π d) (τ e))‖ ^ 2 ≤ 1024 * (6 * C * D * (1 + Real.log r) * (1 / (r : ℝ) + 1 / (U : ℝ) + 1 / (V : ℝ) + (r : ℝ) / ((U : ℝ) * V)) * (∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by have hUR : (0 : ℝ) < U := by exact_mod_cast hU have hVR : (0 : ℝ) < V := by exact_mod_cast hV have hrR : (0 : ℝ) < r := by exact_mod_cast hr have hpr : ∀ x, finiteKernelTestTransform μ KA f x ≠ 0 → 1 ≤ π x ∧ π x < 1 + 4 * U := by intro x hx have hu : π x ≤ 4 * U := by exact_mod_cast (hf x hx).2 exact ⟨hπ x, by omega⟩ have htr : ∀ y, finiteKernelTestTransform ν KB g y ≠ 0 → (0 : ℤ) ≤ τ y ∧ (τ y : ℤ) ≤ 0 + (4 * V : ℕ) := by intro y hy have hv : τ y ≤ 4 * V := by exact_mod_cast (hg y hy).2 constructor · positivity · exact_mod_cast (show τ y ≤ 0 + 4 * V by omega) have hb := two_kernel_supported_rational_bound π τ 1 (4 * U) 0 (4 * V) μ ν hμ hν KA KB f g (fun x => Complex.exp ((ζ * Real.log (π x : ℝ) : ℝ) * Complex.I)) (fun y => Complex.exp ((ζ * Real.log (τ y : ℝ) : ℝ) * Complex.I)) (fun x => real_mellin_factor_norm ζ (π x)) (fun y => real_mellin_factor_norm ζ (τ y)) hpr htr hC hD (show 0 < (U : ℝ) / 2 by positivity) (show 0 < (V : ℝ) / 2 by positivity) (fun x hx => (hf x hx).1) (fun y hy => (hg y hy).1) hEA hEB hμatom hνatom hr hcop hβ have heq : (fun d e => minorProductPhase ζ ((u : ℝ) / r + β) (π d) (τ e)) = (fun d e => Complex.exp ((ζ * Real.log (π d : ℝ) : ℝ) * Complex.I) * Complex.exp ((ζ * Real.log (τ e : ℝ) : ℝ) * Complex.I) * (Complex.exp (Complex.I * (2 * Real.pi * (((u : ℝ) / r + β) * τ e) : ℝ))) ^ π d) := by funext d e exact minor_product_phase_factor ζ _ (hπ d) (hτ e) rw [heq] apply hb.trans have hL : 1 ≤ 1 + Real.log (r : ℝ) := by have := Real.log_nonneg (by exact_mod_cast hr : (1 : ℝ) ≤ r) linarith have hEf : 0 ≤ ∑ x, μ x * ‖f x‖ ^ 2 := Finset.sum_nonneg (fun x _ => mul_nonneg (hμ x) (sq_nonneg _)) have hEg : 0 ≤ ∑ y, ν y * ‖g y‖ ^ 2 := Finset.sum_nonneg (fun y _ => mul_nonneg (hν y) (sq_nonneg _)) convert rational_enlarged_dyad_energy_le hUR hVR hrR hL hC hD hEf hEg using 1 <;> first | rfl | (push_cast; ring) theorem kernel_full_phase_dyadic_comparison (hf : ∀ x, f x ≠ 0 → U ≤ π x ∧ π x < 2 * U) (hg : ∀ y, g y ≠ 0 → V ≤ τ y ∧ τ y < 2 * V) (hTf : ∀ x, finiteKernelTestTransform μ KA f x ≠ 0 → (U : ℝ) / 2 ≤ π x ∧ (π x : ℝ) ≤ 4 * U) (hTg : ∀ y, finiteKernelTestTransform ν KB g y ≠ 0 → (V : ℝ) / 2 ≤ τ y ∧ (τ y : ℝ) ≤ 4 * V) (hEA : (∑ x, μ x * ‖finiteKernelTestTransform μ KA f x‖ ^ 2) ≤ 4 * ∑ x, μ x * ‖f x‖ ^ 2) (hEB : (∑ y, ν y * ‖finiteKernelTestTransform ν KB g y‖ ^ 2) ≤ 4 * ∑ y, ν y * ‖g y‖ ^ 2) {C D : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hμatom : ∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x => π x = m), μ x) ≤ C / (m : ℝ)) (hνatom : ∀ m : ℕ, (∑ y ∈ Finset.univ.filter (fun y => τ y = m), ν y) ≤ D / (m : ℝ)) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) (ζ : ℝ) : let phase := fun x y => minorProductPhase ζ ((u : ℝ) / r + β) (π x) (τ y) ‖∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * ((phase x y - finiteTwoKernelAverage μ ν KA KB x y phase) * f x * g y)‖ ≤ 33 * Real.sqrt (6 * C * D * (1 + Real.log r) * (1 / (r : ℝ) + 1 / (U : ℝ) + 1 / (V : ℝ) + (r : ℝ) / ((U : ℝ) * V))) * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by intro phase have hraw := minor_product_phase_dyadic_bound π τ hπ hτ U V hU hV μ ν hμ hν f g hf hg hC hD hμatom hνatom hr hcop hβ ζ have havg := two_kernel_full_phase_enlarged_dyadic_bound π τ hπ hτ U V hU hV μ ν hμ hν KA KB f g hTf hTg hEA hEB hC hD hμatom hνatom hr hcop hβ ζ let H := 6 * C * D * (1 + Real.log r) * (1 / (r : ℝ) + 1 / (U : ℝ) + 1 / (V : ℝ) + (r : ℝ) / ((U : ℝ) * V)) have hH : 0 ≤ H := by have hl := Real.log_nonneg (by exact_mod_cast hr : (1 : ℝ) ≤ r) dsimp only [H] positivity have hEf : 0 ≤ ∑ x, μ x * ‖f x‖ ^ 2 := Finset.sum_nonneg (fun x _ => mul_nonneg (hμ x) (sq_nonneg _)) have hEg : 0 ≤ ∑ y, ν y * ‖g y‖ ^ 2 := Finset.sum_nonneg (fun y _ => mul_nonneg (hν y) (sq_nonneg _)) have hp := norm_sub_le_thirty_three_sqrt (mul_nonneg (mul_nonneg hH hEf) hEg) hraw havg have he : (∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * ((phase x y - finiteTwoKernelAverage μ ν KA KB x y phase) * f x * g y)) = (∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * phase x y) - (∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * finiteTwoKernelAverage μ ν KA KB x y phase) := by simp_rw [← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ push_cast ring rw [he] convert hp using 1 rw [mul_assoc H, Real.sqrt_mul hH] ring end end section open Finset Classical section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end end section open Finset Classical universe u v w def finiteEventPathMaximum {K : Type u} {X : Type v} (E : K → X → Type w) (target : ∀ k x, E k x → X) (height : X → ℕ) : ∀ steps x, FiniteEventPath E target steps x → ℕ | [], x, _ => height x | _ :: steps, x, ⟨_, p⟩ => max (height x) (finiteEventPathMaximum E target height steps _ p) theorem boundedGhostEventTarget_memory_le {P Z : Type*} (t B : ℕ) (s : BoundedOrderedState P Z t B) (e : BoundedGhostEvent t B s) : (boundedGhostEventTarget t B s e).2.1.val ≤ s.2.1.val + e.1.val := by unfold boundedGhostEventTarget dsimp only split_ifs · change e.2.1.card + e.1.val ≤ s.2.1.val + e.1.val exact Nat.add_le_add_right (by simpa only [Fintype.card_fin] using card_le_univ e.2.1) _ · exact Nat.le_add_right _ _ theorem coupledGhostJointEventTarget_memory_le {G : Type*} [Fintype G] {P Z : G → Type*} (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (e : CoupledGhostEvent t B s) : productTotalMemory (coupledGhostJointEventTarget t B s e) ≤ productTotalMemory s + ∑ g, (e g).1.val := by rw [productTotalMemory, productTotalMemory, ← sum_add_distrib] exact sum_le_sum fun g _ => boundedGhostEventTarget_memory_le (t g) B (s g) (e g) theorem unrestrictedBoundedEventTarget_memory_le {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) : (unrestrictedBoundedEventTarget n Δ D t B s e).2.1.val ≤ s.2.1.val + t := by unfold unrestrictedBoundedEventTarget dsimp only split_ifs · change (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) e.1 e.2.1 e.2.2.1).1 ≤ _ simp only [unrestrictedEdgeOutput, unrestrictedEdgeMemory_length] have hstore : e.1.card ≤ t := by simpa only [Fintype.card_fin] using card_le_univ e.1 omega · exact Nat.le_add_right _ _ theorem unrestrictedJointEventTarget_memory_le {G : Type*} [Fintype G] {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (e : UnrestrictedJointEvent n Δ D t B s) : productTotalMemory (unrestrictedJointEventTarget n Δ D t B s e) ≤ productTotalMemory s + ∑ g, t g := by rw [productTotalMemory, productTotalMemory, ← sum_add_distrib] exact sum_le_sum fun g _ => unrestrictedBoundedEventTarget_memory_le (n g) (Δ g) (D g) (t g) B (s g) (e g) def fullMemoryEdgeIndicator {J K : Type*} : Option (J ⊕ K) → ℕ | some (.inr _) => 1 | _ => 0 def fullMemoryEdgeCount {J K : Type*} (steps : List (Option (J ⊕ K))) : ℕ := (steps.map fullMemoryEdgeIndicator).sum section Full variable {J K G : Type*} [Fintype G] {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → G → ℤ) theorem fullActiveEdgeEventTarget_memory_le (k : K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) s) : productTotalMemory (fullActiveEdgeEventTarget n (S k) B (A k) (Δ k) (D k) s e) ≤ productTotalMemory s + ∑ g, (S k g)ᶜ.card := by rw [fullActiveEdgeEventTarget_total] have h := unrestrictedJointEventTarget_memory_le n (Δ k (productActiveMemorySplit (S k) B s).1 e.1) (D k (productActiveMemorySplit (S k) B s).1 e.1) (fun g => (S k g)ᶜ.card) B (productActiveMemorySplit (S k) B s).2 e.2 rw [productActiveMemorySplit_total_memory] at h exact h end Full end section open Finset open scoped Classical section variable {G : Type*} [sharedInstance1 : DecidableEq G] {I X : G → Type*} [sharedInstance3 : ∀ g, DecidableEq (I g)] [sharedInstance4 : ∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (S : Finset (Sigma I)) include G sharedInstance1 I X sharedInstance3 sharedInstance4 μ S theorem finite_group_flatten_components (A : ∀ g, Finset (I g)) (is : ∀ g, List (I g)) (gs : List G) (hS : ∀ g ∈ gs, ∀ i ∈ is g, (⟨g, i⟩ : Sigma I) ∈ S ↔ i ∈ A g) (f : (∀ g, I g → X g) → ℂ) : finiteCoordinateComponent (fun a : Sigma I => μ a.1) S (gs.sigma is) (finiteGroupFlattenFunction f) = finiteGroupFlattenFunction (finiteCoordinateCompose (fun g (v : (I g → X g) → ℂ) => finiteCoordinateComponent (fun _ : I g => μ g) (A g) (is g) v) gs f) := by induction gs with | nil => rfl | cons g gs ih => change finiteCoordinateComponent _ S ((is g).map (Sigma.mk g) ++ gs.sigma is) _ = _ rw [finite_coordinate_component_append, ih (fun h hh => hS h (List.mem_cons_of_mem _ hh)), finite_group_flatten_component μ g S (A g) (is g) (hS g (List.mem_cons_self))] rfl theorem finite_group_flatten_finset_action (A B : ∀ g, Finset (I g)) (s : Finset G) (hS : ∀ g ∈ s, ∀ i ∈ B g, (⟨g, i⟩ : Sigma I) ∈ S ↔ i ∈ A g) (f : (∀ g, I g → X g) → ℂ) : finiteCoordinateComponent (fun a : Sigma I => μ a.1) S (s.sigma B).toList (finiteGroupFlattenFunction f) = finiteGroupFlattenFunction (finiteCoordinateFinsetAction (fun g (v : (I g → X g) → ℂ) => finiteCoordinateComponent (fun _ : I g => μ g) (A g) (B g).toList v) s f) := by rw [← finite_coordinate_component_perm (fun a : Sigma I => μ a.1) S (finite_sigma_toList_perm s B) (finiteGroupFlattenFunction f)] exact finite_group_flatten_components μ S A (fun g => (B g).toList) s.toList (fun g hg i hi => hS g (mem_toList.mp hg) i (mem_toList.mp hi)) f end end section universe uJ uK uP uA section Full variable {J : Type uJ} {K : Type uK} {N : ℕ} {P : Fin N → Type uP} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) (Δ D : ∀ k c, A k c → Fin N → ℤ) abbrev FullMixedLedgerPath (steps : List (Option (J ⊕ K))) (s : FullMixedLedgerState n (M := M) B) := FiniteEventPath (fun i (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D i s.2) (fullMixedLedgerTarget n S B A Δ D) steps s noncomputable def fullMixedLedgerInducedPhase (steps : List (Option (J ⊕ K))) (initial : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → (g : Fin N) → Finset (P g)) (phase : ∀ s, FullMixedLedgerPath n S B A Δ D steps s → ℂ) : ∀ x, FullPermutationMixedPath n S B A Δ D steps x → ℂ := finiteInitialLedgerPhase (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedLedgerUpdate n S B A Δ D) steps initial phase variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def fullMixedLedgerPathAction (steps : List (Option (J ⊕ K))) (phase : ∀ s, FullMixedLedgerPath n S B A Δ D steps s → ℂ) (F : FullMixedLedgerState n (M := M) B → ℂ) : FullMixedLedgerState n (M := M) B → ℂ := let _ : ∀ (i : Option (J ⊕ K)) x, Fintype (FullPermutationMixedEvent n S B A Δ D i x) := fullPermutationMixedEventFintype n S B A Δ D finiteEventPathAction (fun i (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D i s.2) (fullMixedLedgerTarget n S B A Δ D) (fun i s => fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V i s.2) steps phase F theorem full_mixed_ledger_path_action_eq (steps : List (Option (J ⊕ K))) (initial : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → (g : Fin N) → Finset (P g)) (phase : ∀ s, FullMixedLedgerPath n S B A Δ D steps s → ℂ) (F : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) : (fun x => fullMixedLedgerPathAction n S B A Δ D ω μ q ρ V steps phase (fun s => F s.2) (initial x, x)) = fullPermutationMixedPathAction n S B A Δ D ω μ q ρ V steps (fullMixedLedgerInducedPhase n S B A Δ D steps initial phase) F := by let _ : ∀ (i : Option (J ⊕ K)) x, Fintype (FullPermutationMixedEvent n S B A Δ D i x) := fullPermutationMixedEventFintype n S B A Δ D exact finite_initial_ledger_path_action (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedLedgerUpdate n S B A Δ D) steps initial (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) phase F end Full end section open Finset universe uJ uK uP uA section Full variable {J : Type uJ} {K : Type uK} {N : ℕ} {P : Fin N → Type uP} [∀ g, DecidableEq (P g)] [∀ g, Fintype (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem full_mixed_ledger_raw_visit_row (β : (g : Fin N) → P g → ℝ) (a : (g : Fin N) → P g → Bool) (hV : ∀ g, V g ≠ 0) (j : J) (F : GlobalBirthJointState (fun g p => ZMod (n g p)) → ℂ) (s : FullMixedLedgerState n (M := M) B) : globalBirthJointCutRawRow (fun g => GlobalBirthRawStep.visit (a := a g) (fun _ => 0) (β g) (1 - q j) (V g) ρ (hV g) B) B B F (fullMixedLedgerDecode n B s) = fullMixedLedgerRow n S B A Δ D edgePhase ω (fun g p => β g p / V g) q ρ V (some (.inl j)) (F ∘ fullMixedLedgerDecode n B) s := by have h := full_mixed_ghost_raw_visit_events n S B A Δ D ω β q ρ V j a hV F (fun g => (s.1 g, s.2 g)) refine h.trans ?_ unfold fullMixedLedgerRow finiteLocalPhasedRow apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ rfl end Full end section open Finset Filter open scoped Topology theorem eventually_linear_exponential_profile_le_rpow {c d : ℝ} (hc : 0 < c) (hd : 0 < d) (C D s : ℝ) : ∀ᶠ L : ℝ in atTop, C * Real.exp (-c * L) + D * L * Real.exp (-d * L) ≤ L ^ (-s) := by have ht1 := (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero s c hc).const_mul C have ht2 := (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero (s + 1) d hd).const_mul D have ht := ht1.add ht2 have he : ∀ᶠ L : ℝ in atTop, C * (L ^ s * Real.exp (-c * L)) + D * (L ^ (s + 1) * Real.exp (-d * L)) ≤ 1 := ht.eventually_le_const (by simp) filter_upwards [he, eventually_gt_atTop (0 : ℝ)] with L hL hL0 rw [Real.rpow_add hL0, Real.rpow_one] at hL rw [Real.rpow_neg hL0.le, ← one_div] apply (le_div_iff₀ (Real.rpow_pos_of_pos hL0 s)).mpr nlinarith only [hL] theorem prime_coprime_relative_profile_bound {c L C : ℝ} (hc : 0 < c) (hL : 0 < L) (hC : 0 ≤ C) {f m : ℕ} (hf : 0 < f) (hfL : (f : ℝ) ≤ Real.exp L) (hm : m ≠ 0) (hmL : (m : ℝ) ≤ Real.exp L) : 2 * C * (Real.exp (c * L)) ^ (-(1 : ℝ) / 32) * (1 + Real.log (f : ℝ) / Real.log (Real.exp (c * L))) + (m.primeFactors.card : ℝ) / Real.exp (c * L) ≤ (2 * C * (1 + 1 / c)) * Real.exp (-(c / 32) * L) + (1 / Real.log 2) * L * Real.exp (-c * L) := by have hf0 : (0 : ℝ) < f := by exact_mod_cast hf have hm0 : (0 : ℝ) < m := by exact_mod_cast Nat.pos_of_ne_zero hm have hflog : Real.log (f : ℝ) ≤ L := by simpa only [Real.log_exp] using Real.log_le_log hf0 hfL have hmlog : Real.log (m : ℝ) ≤ L := by simpa only [Real.log_exp] using Real.log_le_log hm0 hmL have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) have hcard : (m.primeFactors.card : ℝ) ≤ L / Real.log 2 := (primeFactors_card_le_log_div_log_two (Nat.pos_of_ne_zero hm)).trans (div_le_div_of_nonneg_right hmlog hlog2.le) have hquot : Real.log (f : ℝ) / (c * L) ≤ 1 / c := by apply (div_le_iff₀ (mul_pos hc hL)).mpr calc Real.log (f : ℝ) ≤ L := hflog _ = (1 / c) * (c * L) := by field_simp rw [Real.log_exp, ← Real.exp_mul] have hexp : c * L * (-(1 : ℝ) / 32) = -(c / 32) * L := by ring rw [hexp] calc _ ≤ 2 * C * Real.exp (-(c / 32) * L) * (1 + 1 / c) + (L / Real.log 2) / Real.exp (c * L) := by apply add_le_add · exact mul_le_mul_of_nonneg_left (add_le_add le_rfl hquot) (by positivity) · exact div_le_div_of_nonneg_right hcard (Real.exp_nonneg _) _ = _ := by simp only [neg_mul, Real.exp_neg]; ring theorem eventually_prime_band_coprime_relative_power_bound (hZ : PrimitiveZeroFreeHalfPlane) {c : ℝ} (hc : 0 < c) (B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ b t U V : ℝ, 0 ≤ b → 0 < t → 0 ≤ U → 0 ≤ V → ∀ m : ℕ, m ≠ 0 → (m : ℝ) ≤ Real.exp L → ‖∑ p ∈ ((primeBand (Real.exp (c * L)) b).filter (fun p : ℕ => U < t * (p : ℝ) ∧ t * (p : ℝ) ≤ V)).filter (fun p => p.Coprime m), χ (p : ZMod f)‖ ≤ (V / t) * L ^ (-B) := by obtain ⟨C, hC, hbound⟩ := ordinary_prime_band_product_coprime_relative_bound hZ have hlarge : ∀ᶠ L : ℝ in atTop, (2 : ℝ) ≤ Real.exp (c * L) := (Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hc)).eventually_ge_atTop 2 filter_upwards [eventually_linear_exponential_profile_le_rpow (div_pos hc (by norm_num : (0 : ℝ) < 32)) hc (2 * C * (1 + 1 / c)) (1 / Real.log 2) B, hlarge, eventually_gt_atTop (0 : ℝ)] with L hdecay hlarge hL intro f hf hfL χ hχ b t U V hb ht hU hV m hm hmL apply (hbound f hf χ hχ (Real.exp (c * L)) b t U V hlarge hb ht hU hV m hm).trans apply mul_le_mul_of_nonneg_left _ (div_nonneg hV ht.le) exact (prime_coprime_relative_profile_bound hc hL hC.le hf hfL hm hmL).trans hdecay end section open scoped BigOperators theorem stdAddChar_mul_eq_fourier {q : ℕ} [NeZero q] (n : ℤ) (k : ZMod q) : ZMod.stdAddChar ((n : ZMod q) * k) = fourier n (((k.val : ℝ) / q : ℝ) : AddCircle (1 : ℝ)) := by have hcast : (n : ZMod q) * k = ((n * (k.val : ℤ) : ℤ) : ZMod q) := by simp only [Int.cast_mul, Int.cast_natCast, ZMod.natCast_zmod_val] rw [hcast, ZMod.stdAddChar_coe, fourier_coe_apply] push_cast congr 1 ring theorem sum_stdAddChar_mul_eq_finiteFourierSum {q : ℕ} [NeZero q] (freq : Finset ℤ) (a : ℤ → ℂ) (k : ZMod q) : (∑ n ∈ freq, a n * ZMod.stdAddChar ((n : ZMod q) * k)) = finiteFourierSum freq a ((k.val : ℝ) / q) := by simp only [stdAddChar_mul_eq_fourier, finiteFourierSum] def reducedResidues (q : ℕ) : Finset ℕ := (Finset.range q).filter (fun a => a.Coprime q) theorem reducedResidues_eq_unit_val_image (q : ℕ) [NeZero q] : reducedResidues q = (Finset.univ.filter (fun k : ZMod q => IsUnit k)).image ZMod.val := by classical ext a simp only [reducedResidues, Finset.mem_filter, Finset.mem_range, Finset.mem_image, Finset.mem_univ, true_and] constructor · rintro ⟨ha, hacop⟩ exact ⟨(a : ZMod q), (ZMod.isUnit_iff_coprime a q).mpr hacop, ZMod.val_natCast_of_lt ha⟩ · rintro ⟨k, hk, rfl⟩ refine ⟨ZMod.val_lt k, ?_⟩ apply (ZMod.isUnit_iff_coprime k.val q).mp simpa only [ZMod.natCast_zmod_val] using hk theorem sum_unit_stdAddChar_energy_eq_reducedResidues {q : ℕ} [NeZero q] (freq : Finset ℤ) (a : ℤ → ℂ) : (∑ k ∈ Finset.univ.filter (fun k : ZMod q => IsUnit k), ‖∑ n ∈ freq, a n * ZMod.stdAddChar ((n : ZMod q) * k)‖ ^ 2) = ∑ k ∈ reducedResidues q, ‖finiteFourierSum freq a ((k : ℝ) / q)‖ ^ 2 := by classical rw [reducedResidues_eq_unit_val_image, Finset.sum_image] · apply Finset.sum_congr rfl intro k _ rw [sum_stdAddChar_mul_eq_finiteFourierSum] · intro k _ l _ hkl exact ZMod.val_injective q hkl def reducedFractionSamples (Q : Finset ℕ) : Finset (ℕ × ℕ) := (Q.sigma reducedResidues).image (fun v => (v.2, v.1)) theorem mem_reducedFractionSamples {Q : Finset ℕ} {a q : ℕ} : (a, q) ∈ reducedFractionSamples Q ↔ q ∈ Q ∧ a ∈ reducedResidues q := by simp [reducedFractionSamples, Finset.mem_sigma, Prod.ext_iff] theorem sum_reducedFractionSamples (Q : Finset ℕ) (F : ℕ × ℕ → ℝ) : (∑ v ∈ reducedFractionSamples Q, F v) = ∑ q ∈ Q, ∑ a ∈ reducedResidues q, F (a, q) := by rw [reducedFractionSamples, Finset.sum_image] · rw [Finset.sum_sigma] · rintro ⟨q, a⟩ _ ⟨r, b⟩ _ h simp only [Prod.mk.injEq] at h rcases h with ⟨rfl, rfl⟩ rfl theorem additive_large_sieve_moduli (Q : Finset ℕ) {R N : ℝ} (hR : 1 ≤ R) (hQ0 : ∀ q ∈ Q, 0 < q) (hQR : ∀ q ∈ Q, (q : ℝ) ≤ R) (freq : Finset ℤ) (a : ℤ → ℂ) (hN : 0 ≤ N) (hfreq : ∀ n ∈ freq, |(n : ℝ)| ≤ N) : (∑ q ∈ Q, ∑ k ∈ reducedResidues q, ‖finiteFourierSum freq a ((k : ℝ) / q)‖ ^ 2) ≤ (6 + 8 * Real.pi) * (N + R ^ 2) * ∑ n ∈ freq, ‖a n‖ ^ 2 := by rw [← sum_reducedFractionSamples Q (fun v => ‖finiteFourierSum freq a ((v.1 : ℝ) / v.2)‖ ^ 2)] apply additive_large_sieve_reduced_fractions_coarse _ hR _ freq a hN hfreq intro v hv obtain ⟨hq, hk⟩ := mem_reducedFractionSamples.mp hv have hk' : v.1 < v.2 ∧ v.1.Coprime v.2 := by simpa only [reducedResidues, Finset.mem_filter, Finset.mem_range] using hk exact ⟨hQ0 _ hq, hk'.1, hk'.2, hQR _ hq⟩ end section open scoped BigOperators Classical theorem prime_kernel_transform_dyadic_support {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (Q : ℕ) (hp : ∀ i p, p ∈ P i → 0 < p) {h : ℝ} (hh : 0 < h) (hh2 : h ≤ Real.log 2) (kept : Finset ℤ) {U : ℕ} (f : (∀ i, P i) → ℂ) (hf : ∀ x, f x ≠ 0 → U ≤ (∏ i, (x i).val : ℕ) ∧ (∏ i, (x i).val : ℕ) < 2 * U) (d : ∀ i, P i) (hd : finiteKernelTestTransform (finiteProductWeight (physicalLabelLaw V)) (primeProductIdealKernel P V Q h kept) f d ≠ 0) : (U : ℝ) / 2 ≤ (∏ i, (d i).val : ℕ) ∧ ((∏ i, (d i).val : ℕ) : ℝ) ≤ 4 * U := by have hpos (x : ∀ i, P i) : (0 : ℝ) < (∏ i, (x i).val : ℕ) := by exact_mod_cast Finset.prod_pos (fun i _ => hp i (x i).val (x i).property) apply log_localized_kernel_transform_dyadic_support (fun x : ∀ i, P i => ((∏ i, (x i).val : ℕ) : ℝ)) (fun x : ∀ i, P i => ((∏ i, (x i).val : ℕ) : ℝ)) (finiteProductWeight (physicalLabelLaw V)) (primeProductIdealKernel P V Q h kept) f (fun d x hx => ⟨hpos d, hpos x, (prime_ideal_kernel_log_localized P V Q hh kept d x hx).le.trans hh2⟩) _ d hd intro x hx exact ⟨by exact_mod_cast (hf x hx).1, by exact_mod_cast (hf x hx).2.le⟩ theorem prime_minor_arc_dyadic_pairing (hZ : PrimitiveZeroFreeHalfPlane) : ∃ C₀ : ℝ, 0 < C₀ ∧ ∀ Q : ℕ, 0 < Q → ∀ {I J : Type u} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I) (R : J → Finset ℕ) (W : J → ℝ) (j : J), (∀ k, 0 < V k) → (∀ k, 0 < W k) → (∀ k p, p ∈ P k → p.Prime ∧ Q < p) → (∀ k p, p ∈ R k → p.Prime ∧ Q < p) → (∀ k, ∑ p ∈ P k, 1 / (p : ℝ) = V k) → (∀ k, ∑ p ∈ R k, 1 / (p : ℝ) = W k) → ∀ a b a' b' : ℝ, P i = primeBand a b → R j = primeBand a' b' → 2 ≤ a → 0 ≤ b → 2 ≤ a' → 0 ≤ b' → ∀ h ξ : ℝ, 0 < h → h ≤ Real.log 2 → 0 < ξ → (Q * Q - 1 : ℕ) * (((C₀ / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 → (Q * Q - 1 : ℕ) * (((C₀ / W j) * a' ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a')) / ξ) ≤ 1 → ∀ U T : ℕ, 0 < U → 0 < T → ∀ (f : (∀ k, P k) → ℂ) (g : (∀ k, R k) → ℂ), (∀ x, f x ≠ 0 → U ≤ (∏ k, (x k).val : ℕ) ∧ (∏ k, (x k).val : ℕ) < 2 * U) → (∀ y, g y ≠ 0 → T ≤ (∏ k, (y k).val : ℕ) ∧ (∏ k, (y k).val : ℕ) < 2 * T) → ∀ C D : ℝ, 0 ≤ C → 0 ≤ D → (∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x : (∀ k, P k) => (∏ k, (x k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw V) x) ≤ C / (m : ℝ)) → (∀ m : ℕ, (∑ y ∈ Finset.univ.filter (fun y : (∀ k, R k) => (∏ k, (y k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw W) y) ≤ D / (m : ℝ)) → ∀ r : ℕ, 0 < r → ∀ u : ℤ, (r : ℤ).gcd u = 1 → ∀ β : ℝ, |β| ≤ 1 / (r : ℝ) ^ 2 → ∀ ζ : ℝ, let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) let phase := fun (x : ∀ k, P k) (y : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ)) + 2 * Real.pi * (((u : ℝ) / r + β) * (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ))) : ℝ)) ‖∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * ((phase x y - finiteTwoKernelAverage μ ν KA KB x y phase) * f x * g y)‖ ≤ 33 * Real.sqrt (6 * C * D * (1 + Real.log r) * (1 / (r : ℝ) + 1 / (U : ℝ) + 1 / (T : ℝ) + (r : ℝ) / ((U : ℝ) * T))) * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by obtain ⟨C₀, hC₀, henergy⟩ := prime_product_ideal_kernel_energy.{u} hZ refine ⟨C₀, hC₀, ?_⟩ intro Q hQ I J _ _ _ _ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hh2 hξ hsmallP hsmallR U T hU hT f g hf hg C D hC hD hμatom hνatom r hr u hcop β hβ ζ let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) have hμ (x : ∀ k, P k) : 0 ≤ μ x := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg V (fun k => (hV k).le) k (x k)) have hν (y : ∀ k, R k) : 0 ≤ ν y := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg W (fun k => (hW k).le) k (y k)) have hπ (x : ∀ k, P k) : 0 < (∏ k, (x k).val : ℕ) := Finset.prod_pos (fun k _ => (hP k (x k).val (x k).property).1.pos) have hτ (y : ∀ k, R k) : 0 < (∏ k, (y k).val : ℕ) := Finset.prod_pos (fun k _ => (hR k (y k).val (y k).property).1.pos) have hEA := henergy Q hQ P V i hV hP hVP a b hPi ha hb h ξ hh hξ (primeProductRetainedCells P V h ξ) (fun d hd => prime_product_retained_cell_mass P V h ξ hd) hsmallP f have hEB := henergy Q hQ R W j hW hR hWR a' b' hRj ha' hb' h ξ hh hξ (primeProductRetainedCells R W h ξ) (fun d hd => prime_product_retained_cell_mass R W h ξ hd) hsmallR g have hTf := prime_kernel_transform_dyadic_support P V Q (fun k p hp => (hP k p hp).1.pos) hh hh2 (primeProductRetainedCells P V h ξ) f hf have hTg := prime_kernel_transform_dyadic_support R W Q (fun k p hp => (hR k p hp).1.pos) hh hh2 (primeProductRetainedCells R W h ξ) g hg exact kernel_full_phase_dyadic_comparison (fun x : ∀ k, P k => ∏ k, (x k).val) (fun y : ∀ k, R k => ∏ k, (y k).val) hπ hτ U T hU hT μ ν hμ hν KA KB f g hf hg hTf hTg hEA hEB hC hD hμatom hνatom hr hcop hβ ζ end section open Finset Classical section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (V : G → ℝ) end end section open Finset Classical section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end end section open Finset open scoped Classical theorem finite_group_flatten_probe_tail {G : Type*} [Fintype G] [DecidableEq G] {I X : G → Type*} [∀ g, DecidableEq (I g)] [∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (A B : ∀ g, Finset (I g)) (hAB : ∀ g, Disjoint (A g) (B g)) (s : Finset G) (f : (∀ g, I g → X g) → ℂ) : finiteGroupFlattenFunction (finiteCoordinateFinsetAction (fun g (v : (I g → X g) → ℂ) => finiteCoordinateComponent (fun _ : I g => μ g) ∅ (B g).toList v) sᶜ (finiteCoordinateFinsetAction (fun g (v : (I g → X g) → ℂ) => finiteCoordinateComponent (fun _ : I g => μ g) (A g) (A g ∪ B g).toList v) s f)) = finiteCoordinateComponent (fun a : Sigma I => μ a.1) (s.sigma A) (s.sigma A).toList (finiteCoordinateComponent (fun a : Sigma I => μ a.1) ∅ (univ.sigma B).toList (finiteGroupFlattenFunction f)) := by have hin := finite_group_flatten_finset_action μ (s.sigma A) A (fun g => A g ∪ B g) s (fun g hg i _ => by simp only [mem_sigma, hg, true_and]) f have hout := finite_group_flatten_finset_action μ ∅ (fun g => (∅ : Finset (I g))) B sᶜ (fun g _ i _ => by simp) (finiteCoordinateFinsetAction (fun g (v : (I g → X g) → ℂ) => finiteCoordinateComponent (fun _ : I g => μ g) (A g) (A g ∪ B g).toList v) s f) rw [← hout, ← hin] have houter (v : (∀ a : Sigma I, X a.1) → ℂ) : finiteCoordinateComponent (fun a : Sigma I => μ a.1) ∅ (sᶜ.sigma B).toList v = finiteCoordinateComponent (fun a : Sigma I => μ a.1) (s.sigma A) (sᶜ.sigma B).toList v := by apply finite_coordinate_component_congr intro a ha have hnot : a ∉ s.sigma A := by intro h exact (mem_compl.mp (mem_sigma.mp (mem_toList.mp ha)).1) (mem_sigma.mp h).1 simp [hnot] rw [houter, ← finite_coordinate_component_append] rw [finite_coordinate_component_perm (fun a : Sigma I => μ a.1) (s.sigma A) (finite_disjoint_toList_append_perm (sᶜ.sigma B) (s.sigma (fun g => A g ∪ B g)) (finite_sigma_outside_inside_disjoint s A B))] rw [finite_sigma_outside_inside_union] exact (finite_probe_after_tail_component (fun a : Sigma I => μ a.1) (s.sigma A) (univ.sigma B) (finite_sigma_probe_tail_disjoint s A B hAB) (finiteGroupFlattenFunction f)).symm end section section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Full end section open Finset Classical section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end end section open Finset open scoped Classical section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {I X : G → Type*} [sharedInstance4 : ∀ g, Fintype (I g)] [sharedInstance5 : ∀ g, DecidableEq (I g)] [sharedInstance6 : ∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (hμ : ∀ g x, 0 ≤ μ g x) (hmass : ∀ g, ∑ x, μ g x = 1) (A B : ∀ g, Finset (I g)) (hAB : ∀ g, Disjoint (A g) (B g)) (m ell : ℕ) (hm : 0 < m) (hA : ∀ g, (A g).card = m) (hB : ∀ g, (B g).card = ell) (s : Finset G) (f : (∀ g, I g → X g) → ℂ) (hf : ∀ g, finiteGroupSlotSymmetric g f) include G sharedInstance1 sharedInstance2 I X sharedInstance4 sharedInstance5 sharedInstance6 μ hμ hmass A B hAB m ell hm hA hB s f hf theorem finite_flatten_probe_tail_energy : finiteWeightedEnergy (finiteProductWeight (fun a : Sigma I => μ a.1)) (finiteCoordinateComponent (fun a : Sigma I => μ a.1) (s.sigma A) (s.sigma A).toList (finiteCoordinateComponent (fun a : Sigma I => μ a.1) ∅ (univ.sigma B).toList (finiteGroupFlattenFunction f))) ≤ (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ s.card) * finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f := by have heq (v : (∀ g, I g → X g) → ℂ) : finiteWeightedEnergy (finiteProductWeight (fun a : Sigma I => μ a.1)) (finiteGroupFlattenFunction v) = finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) v := by convert finite_group_flatten_energy μ v using 1 <;> congr 1 <;> exact Subsingleton.elim _ _ rw [← finite_group_flatten_probe_tail μ A B hAB s f, heq] exact finite_symmetric_probe_tensor_tail_energy μ hμ hmass A B hAB m ell hm hA hB s sᶜ f hf theorem finite_flatten_probe_tail_norm : Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun a : Sigma I => μ a.1)) (finiteCoordinateComponent (fun a : Sigma I => μ a.1) (s.sigma A) (s.sigma A).toList (finiteCoordinateComponent (fun a : Sigma I => μ a.1) ∅ (univ.sigma B).toList (finiteGroupFlattenFunction f)))) ≤ Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ s.card) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => μ g))) f) := by have h := Real.sqrt_le_sqrt (finite_flatten_probe_tail_energy μ hμ hmass A B hAB m ell hm hA hB s f hf) rw [Real.sqrt_mul (by positivity)] at h exact h end end end Bounty /- Additional validated development components. -/ section /- Finite character Parseval and the primitive multiplicative-to-additive transfer. -/ open Finset ZMod open scoped ComplexConjugate namespace Bounty theorem character_conj_apply_unit {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) {b : ZMod q} (hb : IsUnit b) : conj (χ b) = χ b⁻¹ := by rw [← Complex.star_def, MulChar.star_apply', MulChar.inv_apply] rcases hb with ⟨u, rfl⟩ rw [Ring.inverse_unit, ZMod.inv_coe_unit] theorem character_parseval {q : ℕ} [NeZero q] (S : Finset (ZMod q)) (hS : ∀ k ∈ S, IsUnit k) (F : ZMod q → ℂ) : (∑ χ : DirichletCharacter ℂ q, ‖∑ k ∈ S, F k * χ k‖ ^ 2) = (q.totient : ℝ) * ∑ k ∈ S, ‖F k‖ ^ 2 := by classical have hnorm (z : ℂ) : conj z * z = ((‖z‖ ^ 2 : ℝ) : ℂ) := by rw [← Complex.normSq_eq_conj_mul_self, Complex.normSq_eq_norm_sq] have hexpand (χ : DirichletCharacter ℂ q) : conj (∑ k ∈ S, F k * χ k) * (∑ k ∈ S, F k * χ k) = ∑ k ∈ S, ∑ l ∈ S, (conj (F k) * F l) * (χ k⁻¹ * χ l) := by simp only [map_sum, map_mul, sum_mul, mul_sum] rw [sum_comm] apply sum_congr rfl intro k hk apply sum_congr rfl intro l hl rw [character_conj_apply_unit χ (hS k hk)] ring have hc : (∑ χ : DirichletCharacter ℂ q, conj (∑ k ∈ S, F k * χ k) * (∑ k ∈ S, F k * χ k)) = (q.totient : ℂ) * ∑ k ∈ S, conj (F k) * F k := by simp_rw [hexpand] rw [sum_comm] rw [mul_sum] apply sum_congr rfl intro k hk rw [sum_comm] simp_rw [← mul_sum, DirichletCharacter.sum_char_inv_mul_char_eq ℂ (hS k hk)] simp [hk, mul_comm] simp_rw [hnorm] at hc exact_mod_cast hc theorem character_inverse_parseval {q : ℕ} [NeZero q] (S : Finset (ZMod q)) (hS : ∀ k ∈ S, IsUnit k) (F : ZMod q → ℂ) : (∑ χ : DirichletCharacter ℂ q, ‖∑ k ∈ S, F k * χ⁻¹ k‖ ^ 2) = (q.totient : ℝ) * ∑ k ∈ S, ‖F k‖ ^ 2 := by rw [← character_parseval S hS F] exact Fintype.sum_bijective _ inv_involutive.bijective _ _ (fun _ => rfl) theorem character_transform_additive_sum {q : ℕ} [NeZero q] {ι : Type*} (T : Finset ι) (a : ι → ℂ) (v : ι → ZMod q) {χ : DirichletCharacter ℂ q} (hχ : χ.IsPrimitive) : (∑ k ∈ univ.filter IsUnit, (∑ t ∈ T, a t * stdAddChar (v t * k)) * χ k) = gaussSum χ stdAddChar * ∑ t ∈ T, a t * χ⁻¹ (v t) := by classical have hfull : (∑ k ∈ univ.filter IsUnit, (∑ t ∈ T, a t * stdAddChar (v t * k)) * χ k) = ∑ k : ZMod q, (∑ t ∈ T, a t * stdAddChar (v t * k)) * χ k := by apply sum_subset (filter_subset _ _) intro k _ hk have hk' : ¬IsUnit k := by simpa only [mem_filter, mem_univ, true_and] using hk rw [MulChar.map_nonunit χ hk', mul_zero] rw [hfull] simp_rw [sum_mul] rw [sum_comm, mul_sum] apply sum_congr rfl intro t ht have hg := gaussSum_mulShift_of_isPrimitive stdAddChar hχ (v t) simp only [gaussSum, AddChar.mulShift_apply] at hg calc (∑ k : ZMod q, a t * stdAddChar (v t * k) * χ k) = a t * ∑ k : ZMod q, χ k * stdAddChar (v t * k) := by rw [mul_sum] apply sum_congr rfl intro k _ ring _ = gaussSum χ stdAddChar * (a t * χ⁻¹ (v t)) := by rw [hg] simp only [gaussSum] ring noncomputable def primitiveCharacters (q : ℕ) : Finset (DirichletCharacter ℂ q) := by classical exact univ.filter (fun χ => χ.IsPrimitive) theorem primitive_character_sum_sq_le_additive {q : ℕ} [NeZero q] {ι : Type*} (T : Finset ι) (a : ι → ℂ) (v : ι → ZMod q) : (q : ℝ) / q.totient * (∑ χ ∈ primitiveCharacters q, ‖∑ t ∈ T, a t * χ (v t)‖ ^ 2) ≤ ∑ k ∈ univ.filter IsUnit, ‖∑ t ∈ T, a t * stdAddChar (v t * k)‖ ^ 2 := by classical unfold primitiveCharacters let F : ZMod q → ℂ := fun k => ∑ t ∈ T, a t * stdAddChar (v t * k) have hid (χ : DirichletCharacter ℂ q) (hχ : χ.IsPrimitive) : ‖∑ k ∈ univ.filter IsUnit, F k * χ⁻¹ k‖ ^ 2 = (q : ℝ) * ‖∑ t ∈ T, a t * χ (v t)‖ ^ 2 := by have hi : χ⁻¹.IsPrimitive := by simpa only [DirichletCharacter.isPrimitive_def, DirichletCharacter.conductor_inv] using hχ have ht := character_transform_additive_sum T a v hi simp only [inv_inv] at ht change ‖∑ k ∈ univ.filter IsUnit, (∑ t ∈ T, a t * stdAddChar (v t * k)) * χ⁻¹ k‖ ^ 2 = _ rw [ht, norm_mul, mul_pow, primitive_gaussSum_norm_sq hi] have hle : (∑ χ ∈ univ.filter (fun χ : DirichletCharacter ℂ q => χ.IsPrimitive), ‖∑ k ∈ univ.filter IsUnit, F k * χ⁻¹ k‖ ^ 2) ≤ ∑ χ : DirichletCharacter ℂ q, ‖∑ k ∈ univ.filter IsUnit, F k * χ⁻¹ k‖ ^ 2 := sum_le_sum_of_subset_of_nonneg (filter_subset _ _) (fun χ _ _ => sq_nonneg _) rw [character_inverse_parseval _ (fun k hk => (mem_filter.mp hk).2) F] at hle have heq : (∑ χ ∈ univ.filter (fun χ : DirichletCharacter ℂ q => χ.IsPrimitive), ‖∑ k ∈ univ.filter IsUnit, F k * χ⁻¹ k‖ ^ 2) = (q : ℝ) * ∑ χ ∈ univ.filter (fun χ : DirichletCharacter ℂ q => χ.IsPrimitive), ‖∑ t ∈ T, a t * χ (v t)‖ ^ 2 := by rw [mul_sum] apply sum_congr rfl intro χ hχ exact hid χ (mem_filter.mp hχ).2 rw [heq] at hle have hφ : (0 : ℝ) < q.totient := by exact_mod_cast Nat.totient_pos.mpr (NeZero.pos q) rw [div_mul_eq_mul_div, div_le_iff₀ hφ] simpa only [F, mul_comm] using hle end Bounty end section /- Exact small and large conductor decomposition of the candidate Type I mass. -/ open Finset namespace Bounty noncomputable def primitiveConductorNormTerm {Ω : Type*} (d f : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : ℝ := by classical exact ∑ ψ ∈ (univ : Finset (DirichletCharacter ℂ f)).filter (fun ψ => ψ.IsPrimitive ∧ ψ ≠ 1), ‖∑ t ∈ T.filter (fun t => (value t).Coprime (d / f)), μ t * ψ (value t : ZMod f)‖ noncomputable def smallPrimitiveConductorNormSum {Ω : Type*} (d R : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : ℝ := ∑ f ∈ d.divisors.filter (fun f => 1 < f ∧ f ≤ R), primitiveConductorNormTerm d f T μ value noncomputable def largePrimitiveConductorNormSum {Ω : Type*} (d R : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : ℝ := ∑ f ∈ d.divisors.filter (fun f => 1 < f ∧ R < f), primitiveConductorNormTerm d f T μ value section variable {Ω : Type*} (d R : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) include Ω d R T μ value theorem primitive_conductor_norm_split : typeIPrimitiveConductorNormSum d T μ value = smallPrimitiveConductorNormSum d R T μ value + largePrimitiveConductorNormSum d R T μ value := by classical have h := sum_filter_add_sum_filter_not (d.divisors.filter (fun f => 1 < f)) (fun f => f ≤ R) (fun f => primitiveConductorNormTerm d f T μ value) simpa only [typeIPrimitiveConductorNormSum, smallPrimitiveConductorNormSum, largePrimitiveConductorNormSum, filter_filter, not_le, primitiveConductorNormTerm] using h.symm theorem small_primitive_conductor_norm_nonneg : 0 ≤ smallPrimitiveConductorNormSum d R T μ value := by unfold smallPrimitiveConductorNormSum primitiveConductorNormTerm positivity theorem large_primitive_conductor_norm_nonneg : 0 ≤ largePrimitiveConductorNormSum d R T μ value := by unfold largePrimitiveConductorNormSum primitiveConductorNormTerm positivity end noncomputable def candidateSmallPrimitiveTypeIMass (c L q : ℝ) (r jStar N R : ℕ) : ℝ := ∑ d ∈ oddSquarefreeModuli N, smallPrimitiveConductorNormSum d R (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u) / (d.totient : ℝ) noncomputable def candidateLargePrimitiveTypeIMass (c L q : ℝ) (r jStar N R : ℕ) : ℝ := ∑ d ∈ oddSquarefreeModuli N, largePrimitiveConductorNormSum d R (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u) / (d.totient : ℝ) theorem candidate_primitive_typeI_mass_split (c L q : ℝ) (r jStar N R : ℕ) : candidatePrimitiveTypeIMass c L q r jStar N = candidateSmallPrimitiveTypeIMass c L q r jStar N R + candidateLargePrimitiveTypeIMass c L q r jStar N R := by unfold candidatePrimitiveTypeIMass candidateSmallPrimitiveTypeIMass candidateLargePrimitiveTypeIMass simp_rw [primitive_conductor_norm_split (R := R), add_div] exact sum_add_distrib theorem candidate_small_primitive_mass_le (c L q : ℝ) (r jStar N R : ℕ) (B : ℕ → ℝ) (hB : ∀ f ∈ Icc 2 R, 0 ≤ B f) {D : ℝ} (hD : 1 ≤ D) (hND : (N : ℝ) ≤ D) (hbound : ∀ d ∈ (Icc 1 N).filter Squarefree, ∀ f ∈ d.divisors.filter (fun f => 1 < f ∧ f ≤ R), ∀ ψ : DirichletCharacter ℂ f, ψ.IsPrimitive → ψ ≠ 1 → ‖∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime (d / f)), (candidateCoefficient c L q r jStar u : ℂ) * ψ (u : ZMod f)‖ ≤ B f) : candidateSmallPrimitiveTypeIMass c L q r jStar N R ≤ ((2 * primeEulerProductUpperConstant) * Real.log (2 * D)) * ∑ f ∈ Icc 2 R, B f := by classical have h := small_primitive_conductor_mass_le N R (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u) B hB hD hND hbound apply le_trans _ h change (∑ d ∈ oddSquarefreeModuli N, _) ≤ _ apply sum_le_sum_of_subset_of_nonneg · intro d hd exact mem_filter.mpr ⟨(mem_filter.mp hd).1, (mem_filter.mp hd).2.1⟩ · intro d _ _ apply div_nonneg _ (Nat.cast_nonneg _) exact small_primitive_conductor_norm_nonneg d R _ _ _ end Bounty end section /- Explicit disjoint rectangle layers for finite dyadic prefixes. -/ open Finset namespace Bounty def shiftPrefixRectangle {α : Type*} (L : ℕ) (r : Finset α × Finset ℕ) : Finset α × Finset ℕ := (r.1, r.2.image (fun n => n + L)) noncomputable def dyadicPrefixLayer {α : Type*} (K d : ℕ) (M : Finset α) (κ : α → ℕ) : List (Finset α × Finset ℕ) := by classical exact match K, d with | 0, 0 => [(M.filter (fun m => 0 < κ m), {0})] | 0, _ + 1 => [] | K + 1, 0 => [(M.filter (fun m => 2 ^ K ≤ κ m), range (2 ^ K))] | K + 1, d + 1 => dyadicPrefixLayer K d (M.filter (fun m => κ m < 2 ^ K)) κ ++ (dyadicPrefixLayer K d (M.filter (fun m => 2 ^ K ≤ κ m)) (fun m => κ m - 2 ^ K)).map (shiftPrefixRectangle (2 ^ K)) theorem dyadicPrefixLayer_bounds {α : Type*} (K d : ℕ) (M : Finset α) (κ : α → ℕ) : ∀ r ∈ dyadicPrefixLayer K d M κ, r.1 ⊆ M ∧ r.2 ⊆ range (2 ^ K) := by classical induction K generalizing d M κ with | zero => cases d with | zero => simp [dyadicPrefixLayer] | succ d => simp [dyadicPrefixLayer] | succ K ih => cases d with | zero => intro r hr simp only [dyadicPrefixLayer, List.mem_singleton] at hr subst r exact ⟨filter_subset _ _, range_mono (by simp only [pow_succ]; omega)⟩ | succ d => intro r hr simp only [dyadicPrefixLayer, List.mem_append, List.mem_map] at hr rcases hr with hl | ⟨r', hr', rfl⟩ · obtain ⟨hm, hn⟩ := ih d _ κ r hl exact ⟨hm.trans (filter_subset _ _), hn.trans (range_mono (by simp only [pow_succ]; omega))⟩ · obtain ⟨hm, hn⟩ := ih d _ (fun m => κ m - 2 ^ K) r' hr' refine ⟨hm.trans (filter_subset _ _), ?_⟩ intro n hn' obtain ⟨k, hk, rfl⟩ := mem_image.mp hn' have hk' := mem_range.mp (hn hk) simp only [mem_range, pow_succ] omega theorem dyadicPrefixLayer_pairwise {α : Type*} (K d : ℕ) (M : Finset α) (κ : α → ℕ) : (dyadicPrefixLayer K d M κ).Pairwise (fun r s => Disjoint r.1 s.1 ∧ Disjoint r.2 s.2) := by classical induction K generalizing d M κ with | zero => cases d <;> simp [dyadicPrefixLayer] | succ K ih => cases d with | zero => simp [dyadicPrefixLayer] | succ d => rw [dyadicPrefixLayer, List.pairwise_append] refine ⟨ih d _ _, ?_, ?_⟩ · rw [List.pairwise_map] apply (ih d _ _).imp intro r s hrs exact ⟨hrs.1, (Finset.disjoint_image (fun a b h => Nat.add_right_cancel h)).mpr hrs.2⟩ · intro r hr s hs obtain ⟨s', hs', rfl⟩ := List.mem_map.mp hs obtain ⟨hrM, hrN⟩ := dyadicPrefixLayer_bounds K d _ κ r hr obtain ⟨hsM, hsN⟩ := dyadicPrefixLayer_bounds K d _ (fun m => κ m - 2 ^ K) s' hs' constructor · apply disjoint_left.mpr intro m hm hm' have h₁ := (mem_filter.mp (hrM hm)).2 have h₂ := (mem_filter.mp (hsM hm')).2 omega · apply disjoint_left.mpr intro n hn hn' have h₁ := mem_range.mp (hrN hn) obtain ⟨k, hk, hkn⟩ := mem_image.mp hn' omega def prefixRectangleSum {α E : Type*} [AddCommMonoid E] (w : α → ℕ → E) (r : Finset α × Finset ℕ) : E := ∑ m ∈ r.1, ∑ n ∈ r.2, w m n def prefixLayerSum {α E : Type*} [AddCommMonoid E] (w : α → ℕ → E) (L : List (Finset α × Finset ℕ)) : E := (L.map (prefixRectangleSum w)).sum section variable {α E : Type*} [sharedInstance1 : AddCommMonoid E] (w : α → ℕ → E) include α E sharedInstance1 w theorem prefixRectangleSum_shift (L : ℕ) (r : Finset α × Finset ℕ) : prefixRectangleSum w (shiftPrefixRectangle L r) = prefixRectangleSum (fun m n => w m (n + L)) r := by unfold prefixRectangleSum shiftPrefixRectangle apply sum_congr rfl intro m hm exact sum_image (fun a _ b _ h => Nat.add_right_cancel h) theorem prefixLayerSum_append (L R : List (Finset α × Finset ℕ)) : prefixLayerSum w (L ++ R) = prefixLayerSum w L + prefixLayerSum w R := by simp only [prefixLayerSum, List.map_append, List.sum_append] theorem prefixLayerSum_shift (N : ℕ) (L : List (Finset α × Finset ℕ)) : prefixLayerSum w (L.map (shiftPrefixRectangle N)) = prefixLayerSum (fun m n => w m (n + N)) L := by simp only [prefixLayerSum, List.map_map, Function.comp_def, prefixRectangleSum_shift] end private theorem prefix_sum_split {α E : Type*} [AddCommMonoid E] (M : Finset α) (κ : α → ℕ) (L : ℕ) (w : α → ℕ → E) : (∑ m ∈ M, ∑ n ∈ range (κ m), w m n) = prefixRectangleSum w (M.filter (fun m => L ≤ κ m), range L) + (∑ m ∈ M.filter (fun m => κ m < L), ∑ n ∈ range (κ m), w m n) + (∑ m ∈ M.filter (fun m => L ≤ κ m), ∑ n ∈ range (κ m - L), w m (n + L)) := by classical have hpart := sum_filter_add_sum_filter_not M (fun m => κ m < L) (fun m => ∑ n ∈ range (κ m), w m n) simp only [not_lt] at hpart rw [← hpart] have hright : (∑ m ∈ M.filter (fun m => L ≤ κ m), ∑ n ∈ range (κ m), w m n) = prefixRectangleSum w (M.filter (fun m => L ≤ κ m), range L) + ∑ m ∈ M.filter (fun m => L ≤ κ m), ∑ n ∈ range (κ m - L), w m (n + L) := by rw [prefixRectangleSum, ← sum_add_distrib] apply sum_congr rfl intro m hm have hLm := (mem_filter.mp hm).2 nth_rw 1 [← Nat.add_sub_of_le hLm] rw [sum_range_add] simp only [Nat.add_comm] rw [hright] ac_rfl theorem dyadicPrefixLayer_weighted_sum {α E : Type*} [AddCommMonoid E] (K : ℕ) (M : Finset α) (κ : α → ℕ) (hκ : ∀ m ∈ M, κ m ≤ 2 ^ K) (w : α → ℕ → E) : (∑ m ∈ M, ∑ n ∈ range (κ m), w m n) = ∑ d ∈ range (K + 1), prefixLayerSum w (dyadicPrefixLayer K d M κ) := by classical induction K generalizing M κ w with | zero => simp only [zero_add, sum_range_one, dyadicPrefixLayer, prefixLayerSum, List.map_singleton, List.sum_singleton, prefixRectangleSum, sum_singleton] rw [sum_filter] apply sum_congr rfl intro m hm have h := hκ m hm simp only [pow_zero] at h by_cases hm' : 0 < κ m · have hk : κ m = 1 := by omega simp [hk] · have hk : κ m = 0 := by omega simp [hk] | succ K ih => have hleft : ∀ m ∈ M.filter (fun m => κ m < 2 ^ K), κ m ≤ 2 ^ K := by intro m hm exact Nat.le_of_lt (mem_filter.mp hm).2 have hright : ∀ m ∈ M.filter (fun m => 2 ^ K ≤ κ m), κ m - 2 ^ K ≤ 2 ^ K := by intro m hm have h := hκ m (mem_filter.mp hm).1 simp only [pow_succ] at h omega rw [prefix_sum_split M κ (2 ^ K) w] rw [ih _ _ hleft w, ih _ _ hright (fun m n => w m (n + 2 ^ K))] conv_rhs => rw [sum_range_succ'] simp only [dyadicPrefixLayer, prefixLayerSum_append, prefixLayerSum_shift] simp only [prefixLayerSum, List.map_singleton, List.sum_singleton] rw [sum_add_distrib] ac_rfl theorem dyadicPrefixLayer_eq_nil {α : Type*} (K d : ℕ) (M : Finset α) (κ : α → ℕ) (hd : K < d) : dyadicPrefixLayer K d M κ = [] := by classical induction K generalizing d M κ with | zero => cases d <;> simp_all [dyadicPrefixLayer] | succ K ih => cases d with | zero => omega | succ d => simp only [dyadicPrefixLayer, ih d _ _ (by omega), List.map_nil, List.append_nil] end Bounty end section /- Exponential individual-character savings for a fixed positive prime-band exponent. -/ open Finset Filter namespace Bounty theorem eventually_prime_profile_exponential {c : ℝ} (hc : 0 < c) (C D : ℝ) : ∀ᶠ L : ℝ in atTop, C * Real.exp (-(c / 32) * L) + D * L * Real.exp (-c * L) ≤ Real.exp (-(c / 64) * L) := by have hsmall : 0 < c / 64 := div_pos hc (by norm_num) have hlarge : 0 < 63 * c / 64 := by positivity filter_upwards [eventually_linear_exponential_profile_le_rpow hsmall hlarge C D 0] with L hL simp only [neg_zero, Real.rpow_zero] at hL have hx : Real.exp (-(c / 64) * L) * Real.exp (-(c / 64) * L) = Real.exp (-(c / 32) * L) := by rw [← Real.exp_add]; congr 1; ring have hy : Real.exp (-(63 * c / 64) * L) * Real.exp (-(c / 64) * L) = Real.exp (-c * L) := by rw [← Real.exp_add]; congr 1; ring calc _ = (C * Real.exp (-(c / 64) * L) + D * L * Real.exp (-(63 * c / 64) * L)) * Real.exp (-(c / 64) * L) := by rw [add_mul, mul_assoc C, mul_assoc (D * L), hx, hy] _ ≤ 1 * Real.exp (-(c / 64) * L) := mul_le_mul_of_nonneg_right hL (Real.exp_nonneg _) _ = _ := one_mul _ theorem eventually_prime_band_coprime_relative_exponential_bound (hZ : PrimitiveZeroFreeHalfPlane) {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ b t U V : ℝ, 0 ≤ b → 0 < t → 0 ≤ U → 0 ≤ V → ∀ m : ℕ, m ≠ 0 → (m : ℝ) ≤ Real.exp L → ‖∑ p ∈ ((primeBand (Real.exp (c * L)) b).filter (fun p : ℕ => U < t * (p : ℝ) ∧ t * (p : ℝ) ≤ V)).filter (fun p => p.Coprime m), χ (p : ZMod f)‖ ≤ (V / t) * Real.exp (-(c / 64) * L) := by obtain ⟨C, hC, hbound⟩ := ordinary_prime_band_product_coprime_relative_bound hZ have hlarge : ∀ᶠ L : ℝ in atTop, (2 : ℝ) ≤ Real.exp (c * L) := (Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hc)).eventually_ge_atTop 2 filter_upwards [eventually_prime_profile_exponential hc (2 * C * (1 + 1 / c)) (1 / Real.log 2), hlarge, eventually_gt_atTop (0 : ℝ)] with L hdecay hlarge hL intro f hf hfL χ hχ b t U V hb ht hU hV m hm hmL apply (hbound f hf χ hχ (Real.exp (c * L)) b t U V hlarge hb ht hU hV m hm).trans apply mul_le_mul_of_nonneg_left _ (div_nonneg hV ht.le) exact (prime_coprime_relative_profile_bound hc hL hC.le hf hfL hm hmL).trans hdecay end Bounty end section /- Exact supported/free convolution with arbitrary complex tests on the product. -/ open Finset namespace Bounty theorem supported_free_window_complex_test_eq (P S : Finset ℕ) (a b W : ℕ → ℝ) (F : ℕ → ℂ) (X : ℝ) (hS : ∀ p ∈ S, p ∈ Nat.factoredNumbers P) (hb : ∀ n, b n ≠ 0 → n ≠ 0 ∧ Disjoint n.primeFactors P) (hprod : ∀ p ∈ S, ∀ n, b n ≠ 0 → W (p*n) = a p*b n) (hcovered : ∀ u ∈ arithmeticProductWindow 1 X, W u ≠ 0 → ∃ p ∈ S, ∃ n ∈ arithmeticProductWindow p X, b n ≠ 0 ∧ p*n = u) : (∑ p ∈ S, (a p : ℂ) * ∑ n ∈ arithmeticProductWindow p X, (b n : ℂ)*F (p*n)) = ∑ u ∈ arithmeticProductWindow 1 X, (W u : ℂ)*F u := by classical let T : Finset (Σ _p : ℕ, ℕ) := S.sigma (fun p => (arithmeticProductWindow p X).filter (fun n => b n ≠ 0)) let f : (Σ _p : ℕ, ℕ) → ℕ := fun z => z.1*z.2 have hinj : Set.InjOn f T := by intro x hx y hy hxy have hx' := mem_sigma.mp hx have hy' := mem_sigma.mp hy have hbx := hb x.2 (mem_filter.mp hx'.2).2 have hby := hb y.2 (mem_filter.mp hy'.2).2 obtain ⟨hp, hn⟩ := supported_free_product_unique (hS x.1 hx'.1) hbx.1 hbx.2 (hS y.1 hy'.1) hby.1 hby.2 hxy exact Sigma.ext hp (heq_of_eq hn) have hsubset : T.image f ⊆ arithmeticProductWindow 1 X := by intro u hu obtain ⟨z, hz, rfl⟩ := mem_image.mp hu have hz' := mem_sigma.mp hz have hwindow := (mem_filter.mp hz'.2).1 have hp0 := Nat.ne_zero_of_mem_factoredNumbers (hS z.1 hz'.1) have hrange := (mem_arithmeticProductWindow_iff hp0 X).mp hwindow apply (mem_arithmeticProductWindow_iff one_ne_zero X).mpr simpa only [one_mul, f] using hrange calc _ = ∑ z ∈ T, (W (f z) : ℂ)*F (f z) := by dsimp only [T, f] rw [sum_sigma] apply sum_congr rfl intro p hp rw [mul_sum, sum_filter] apply sum_congr rfl intro n _ by_cases hbn : b n = 0 · simp only [hbn, Complex.ofReal_zero, zero_mul, mul_zero, ne_eq, not_true_eq_false, if_false] · rw [if_pos hbn, hprod p hp n hbn, Complex.ofReal_mul] ring _ = ∑ u ∈ T.image f, (W u : ℂ)*F u := (sum_image (f := fun u => (W u : ℂ)*F u) hinj).symm _ = _ := by apply sum_subset hsubset intro u hu hnot have hWu : W u = 0 := by by_contra hWu obtain ⟨p, hp, n, hn, hbn, hpn⟩ := hcovered u hu hWu exact hnot (mem_image.mpr ⟨⟨p, n⟩, mem_sigma.mpr ⟨hp, mem_filter.mpr ⟨hn, hbn⟩⟩, hpn⟩) simp only [hWu, Complex.ofReal_zero, zero_mul] end Bounty end section /- Complex tests of ordered slot weights and exact extraction of one slot. -/ open Finset namespace Bounty section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] (choices : I → Finset ℕ) include I sharedInstance1 sharedInstance2 choices theorem ordered_slot_complex_window_sum (normalization : ℝ) (S : Finset ℕ) (F : ℕ → ℂ) : (∑ n ∈ S, (orderedSlotWeight choices normalization n : ℂ) * F n) = ∑ x : ∀ i, choices i, if orderedSlotProduct choices x ∈ S then (1 / (normalization : ℂ)) * F (orderedSlotProduct choices x) else 0 := by classical simp only [orderedSlotWeight, Complex.ofReal_sum, apply_ite, Complex.ofReal_div, Complex.ofReal_one, Complex.ofReal_zero, sum_mul] rw [sum_comm] apply sum_congr · ext x simp · intro x _ simp only [ite_mul, zero_mul] simp theorem ordered_slot_complex_test_split (i : I) (F : ℕ → ℂ) : (∑ x : ∀ j, choices j, F (orderedSlotProduct choices x)) = ∑ p : choices i, ∑ y : ∀ j : {j : I // j ≠ i}, choices j.val, F (p.val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y) := by classical let f : choices i × (∀ j : {j : I // j ≠ i}, choices j.val) → ℂ := fun z => F (z.1.val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) z.2) calc _ = ∑ z, f z := by apply Fintype.sum_equiv (Equiv.piSplitAt i (fun j => choices j)) intro x simp only [f, Equiv.piSplitAt_apply] rw [ordered_slot_product_split choices i x] _ = _ := Fintype.sum_prod_type f theorem ordered_slot_complex_window_split (i : I) (normalization : ℝ) (S : Finset ℕ) (F : ℕ → ℂ) : (∑ n ∈ S, (orderedSlotWeight choices normalization n : ℂ) * F n) = ∑ p : choices i, ∑ y : ∀ j : {j : I // j ≠ i}, choices j.val, if p.val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y ∈ S then (1 / (normalization : ℂ)) * F (p.val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y) else 0 := by rw [ordered_slot_complex_window_sum] exact ordered_slot_complex_test_split choices i (fun n => if n ∈ S then (1 / (normalization : ℂ)) * F n else 0) end end Bounty end section /- Harmonic summation of relative bounds for finite prime-character sums. -/ open Finset namespace Bounty end Bounty end section /- Actual kernel pairings vanish when a probe meets an omitted coordinate. -/ open Finset open scoped Classical namespace Bounty section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] {X : I → Type*} [sharedInstance4 : ∀ i, Fintype (X i)] {Y : Type*} [sharedInstance6 : Fintype Y] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ v, μ i v = 1) include I sharedInstance1 sharedInstance2 X sharedInstance4 Y sharedInstance6 μ hmass theorem clean_kernel_component_zero_left (U S : Finset I) (hS : S ⊆ U) (i : I) (hiS : i ∈ S) (K : (∀ i, X i) → Y → ℂ) (f : (∀ i, X i) → ℂ) (g : Y → ℂ) (hK : ∀ x y v, K (Function.update x i v) y = K x y) : cleanKernelPairing (finiteProductWeight μ) K (finiteCoordinateComponent μ S U.toList f) g = 0 := by have hzero := finite_probe_component_pairing_zero_left μ hmass U S hS i hiS f (fun x => ∑ y, K x y * g y) (by intro x v apply sum_congr rfl intro y _ rw [hK]) simpa only [cleanKernelPairing, mul_sum, mul_assoc] using hzero theorem clean_kernel_component_zero_right (V T : Finset I) (hT : T ⊆ V) (i : I) (hiT : i ∈ T) (w : Y → ℝ) (H : Y → (∀ i, X i) → ℂ) (f : Y → ℂ) (g : (∀ i, X i) → ℂ) (hH : ∀ x y v, H x (Function.update y i v) = H x y) : cleanKernelPairing w (fun x y => (finiteProductWeight μ y : ℂ) * H x y) f (finiteCoordinateComponent μ T V.toList g) = 0 := by unfold cleanKernelPairing apply sum_eq_zero intro x _ have hzero : (∑ y, (finiteProductWeight μ y : ℂ) * (H x y * finiteCoordinateComponent μ T V.toList g y)) = 0 := by simpa using finite_probe_component_pairing_zero_right μ hmass V T hT i hiT g (fun y => (starRingEnd ℂ) (H x y)) (by intro y v rw [hH]) calc _ = ((w x : ℂ) * (starRingEnd ℂ) (f x)) * ∑ y, (finiteProductWeight μ y : ℂ) * (H x y * finiteCoordinateComponent μ T V.toList g y) := by rw [mul_sum] apply sum_congr rfl intro y _ ring _ = 0 := by rw [hzero, mul_zero] end theorem clean_kernel_components_zero_of_not_admissible {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ v, μ i v = 1) (U V S T A B : Finset I) (hS : S ⊆ U) (hT : T ⊆ V) (hA : A ⊆ U) (hB : B ⊆ V) (H : (∀ i, X i) → (∀ i, X i) → ℂ) (f g : (∀ i, X i) → ℂ) (hleft : ∀ i ∈ A, ∀ x y v, H (Function.update x i v) y = H x y) (hright : ∀ i ∈ B, ∀ x y v, H x (Function.update y i v) = H x y) (hnot : ¬(A ⊆ U \ S ∧ B ⊆ V \ T)) : cleanKernelPairing (finiteProductWeight μ) (fun x y => (finiteProductWeight μ y : ℂ) * H x y) (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g) = 0 := by by_cases hAS : A ⊆ U \ S · have hBT : ¬ B ⊆ V \ T := fun h => hnot ⟨hAS, h⟩ obtain ⟨i, hiB, hi⟩ := not_subset.mp hBT have hiT : i ∈ T := by simpa [mem_sdiff, hB hiB] using hi exact clean_kernel_component_zero_right μ hmass V T hT i hiT (finiteProductWeight μ) H (finiteCoordinateComponent μ S U.toList f) g (hright i hiB) · obtain ⟨i, hiA, hi⟩ := not_subset.mp hAS have hiS : i ∈ S := by simpa [mem_sdiff, hA hiA] using hi apply clean_kernel_component_zero_left μ hmass U S hS i hiS (fun x y => (finiteProductWeight μ y : ℂ) * H x y) f (finiteCoordinateComponent μ T V.toList g) intro x y v rw [hleft i hiA] end Bounty end section /- The literal fresh-coordinate transition and its exact product-law density. -/ namespace Bounty open Finset open scoped Classical def finiteCoordinateRestrict {I : Type*} {X : I → Type*} (s : Finset I) (x : ∀ i, X i) : ∀ i : s, X i.val := fun i => x i.val theorem finite_coordinate_restrict_update {I : Type*} [DecidableEq I] {X : I → Type*} (s : Finset I) (i : I) (hi : i ∉ s) (x : ∀ i, X i) (v : X i) : finiteCoordinateRestrict s (Function.update x i v) = finiteCoordinateRestrict s x := by funext j have hj : j.val ≠ i := fun he => hi (he ▸ j.property) exact Function.update_of_ne hj _ _ def finiteSharedCompatible {I : Type*} {X : I → Type*} (s : Finset I) (x y : ∀ i, X i) : Prop := ∀ i ∈ s, x i = y i noncomputable def finiteSharedDensity {I : Type*} {X : I → Type*} (μ : ∀ i, X i → ℝ) (s : Finset I) (x y : ∀ i, X i) : ℝ := ∏ i ∈ s, if x i = y i then (μ i (y i))⁻¹ else 0 noncomputable def finiteFreshMass {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (μ : ∀ i, X i → ℝ) (s : Finset I) (y : ∀ i, X i) : ℝ := ∏ i ∈ sᶜ, μ i (y i) theorem finite_shared_density_of_compatible {I : Type*} {X : I → Type*} (μ : ∀ i, X i → ℝ) (s : Finset I) (x y : ∀ i, X i) (hxy : finiteSharedCompatible s x y) : finiteSharedDensity μ s x y = (∏ i ∈ s, μ i (y i))⁻¹ := by unfold finiteSharedDensity simp only [← Finset.prod_inv_distrib] apply prod_congr rfl intro i hi rw [if_pos (hxy i hi)] theorem finite_shared_density_of_not_compatible {I : Type*} {X : I → Type*} (μ : ∀ i, X i → ℝ) (s : Finset I) (x y : ∀ i, X i) (hxy : ¬ finiteSharedCompatible s x y) : finiteSharedDensity μ s x y = 0 := by classical obtain ⟨i, hi, hne⟩ : ∃ i ∈ s, x i ≠ y i := by simpa only [finiteSharedCompatible, not_forall, exists_prop] using hxy exact prod_eq_zero hi (if_neg hne) theorem finite_product_weight_mul_shared_density {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (μ : ∀ i, X i → ℝ) (s : Finset I) (hμ : ∀ i ∈ s, ∀ v, μ i v ≠ 0) (x y : ∀ i, X i) : finiteProductWeight μ y * finiteSharedDensity μ s x y = if finiteSharedCompatible s x y then finiteFreshMass μ s y else 0 := by by_cases hxy : finiteSharedCompatible s x y · rw [if_pos hxy, finite_shared_density_of_compatible μ s x y hxy] have hp : (∏ i ∈ s, μ i (y i)) ≠ 0 := prod_ne_zero_iff.mpr (fun i hi => hμ i hi _) have he := prod_mul_prod_compl s (fun i => μ i (y i)) change (∏ i, μ i (y i)) * (∏ i ∈ s, μ i (y i))⁻¹ = ∏ i ∈ sᶜ, μ i (y i) rw [← he] field_simp · rw [if_neg hxy, finite_shared_density_of_not_compatible μ s x y hxy, mul_zero] noncomputable def finiteAsymmetricKernel {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (μ : ∀ i, X i → ℝ) (shared A B : Finset I) (F : (∀ i : shared, X i.val) → (∀ i : A, X i.val) → (∀ i : B, X i.val) → ℂ) (x y : ∀ i, X i) : ℂ := if finiteSharedCompatible shared x y then (finiteFreshMass μ shared y : ℂ) * F (finiteCoordinateRestrict shared x) (finiteCoordinateRestrict A y) (finiteCoordinateRestrict B x) else 0 noncomputable def finiteAsymmetricDensity {I : Type*} {X : I → Type*} (μ : ∀ i, X i → ℝ) (shared A B : Finset I) (F : (∀ i : shared, X i.val) → (∀ i : A, X i.val) → (∀ i : B, X i.val) → ℂ) (x y : ∀ i, X i) : ℂ := (finiteSharedDensity μ shared x y : ℂ) * F (finiteCoordinateRestrict shared x) (finiteCoordinateRestrict A y) (finiteCoordinateRestrict B x) theorem finite_asymmetric_kernel_eq_density {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (μ : ∀ i, X i → ℝ) (shared A B : Finset I) (hμ : ∀ i ∈ shared, ∀ v, μ i v ≠ 0) (F : (∀ i : shared, X i.val) → (∀ i : A, X i.val) → (∀ i : B, X i.val) → ℂ) (x y : ∀ i, X i) : finiteAsymmetricKernel μ shared A B F x y = (finiteProductWeight μ y : ℂ) * finiteAsymmetricDensity μ shared A B F x y := by unfold finiteAsymmetricKernel finiteAsymmetricDensity rw [← mul_assoc, ← Complex.ofReal_mul, finite_product_weight_mul_shared_density μ shared hμ x y] split_ifs <;> simp only [Complex.ofReal_zero, zero_mul] end Bounty end section /- The actual asymmetric prime value. The A tuple is taken from the target endpoint, and the B tuple from the source endpoint; the shared tuple is fixed. -/ open scoped BigOperators Classical namespace Bounty noncomputable def primeTuplePhase (ζ Θ : ℝ) (N : ℕ) : ℂ := physicalPhase ζ N * physicalReturnPhase Θ (N : ℤ) theorem prime_tuple_phase_eq_exp (ζ Θ : ℝ) (N : ℕ) : primeTuplePhase ζ Θ N = Complex.exp (Complex.I * (ζ * Real.log (N : ℝ) + 2 * Real.pi * Θ * N : ℝ)) := by unfold primeTuplePhase physicalPhase physicalReturnPhase rw [← Complex.exp_add] congr 1 push_cast ring theorem prime_tuple_phase_norm (ζ Θ : ℝ) (N : ℕ) : ‖primeTuplePhase ζ Θ N‖ = 1 := by rw [prime_tuple_phase_eq_exp, Complex.norm_exp] simp only [Complex.mul_re, Complex.I_re, Complex.I_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, mul_zero, sub_zero, Real.exp_zero] theorem prime_tuple_phase_shared_mul (ζ Θ : ℝ) (C N : ℕ) (hC : 0 < C) (hN : 0 < N) : primeTuplePhase ζ Θ (C * N) = physicalPhase ζ C * primeTuplePhase ζ (Θ * C) N := by rw [prime_tuple_phase_eq_exp, prime_tuple_phase_eq_exp, physicalPhase, ← Complex.exp_add] have hCr : (C : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hC) have hNr : (N : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hN) simp only [Nat.cast_mul, Real.log_mul hCr hNr] congr 1 push_cast ring noncomputable def primeAsymmetricValue {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (shared A B : Finset I) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (ζ Θ : ℝ) (c : ∀ i : shared, P i.1) (a : ∀ i : A, P i.1) (b : ∀ i : B, P i.1) : ℂ := finiteTwoKernelAverage (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.1) (fun i => V i.1))) (finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.1) (fun i => V i.1))) (primeProductIdealKernel (fun i : A => P i.1) (fun i => V i.1) Q h keptA) (primeProductIdealKernel (fun i : B => P i.1) (fun i => V i.1) Q h keptB) a b (fun d e => primeTuplePhase ζ Θ ((∏ i : shared, (c i).val) * (∏ i : A, (d i).val) * (∏ i : B, (e i).val))) theorem prime_asymmetric_value_eq_sum {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (shared A B : Finset I) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (ζ Θ : ℝ) (c : ∀ i : shared, P i.1) (a : ∀ i : A, P i.1) (b : ∀ i : B, P i.1) : primeAsymmetricValue P V shared A B Q h keptA keptB ζ Θ c a b = ∑ d : ∀ i : A, P i.1, ∑ e : ∀ i : B, P i.1, ((finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.1) (fun i => V i.1)) d : ℂ) * primeProductIdealKernel (fun i : A => P i.1) (fun i => V i.1) Q h keptA d a) * ((finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.1) (fun i => V i.1)) e : ℂ) * primeProductIdealKernel (fun i : B => P i.1) (fun i => V i.1) Q h keptB e b) * primeTuplePhase ζ Θ ((∏ i : shared, (c i).val) * (∏ i : A, (d i).val) * (∏ i : B, (e i).val)) := rfl end Bounty end section /- A full-state continuation can be read on raw memory with fixed active labels. The zero extension agrees exactly on every decoded bounded state. -/ open scoped Classical namespace Bounty section Fixed variable {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (B : ℕ) (active : (g : Fin N) → Fin (M g) → P g) noncomputable def fixedActiveRawExtension (F : FullMixedLedgerState n (M := M) B → ℂ) (s : GlobalBirthJointState (fun g p => ZMod (n g p))) : ℂ := if h : ∀ g, (s g).2.1 ≤ B then F (fun g => (s g).1, fun g => (active g, ⟨⟨(s g).2.1, Nat.lt_succ_of_le (h g)⟩, (s g).2.2⟩)) else 0 theorem fixed_active_raw_extension_decode (F : FullMixedLedgerState n (M := M) B → ℂ) (s : FullMixedLedgerState n (M := M) B) : fixedActiveRawExtension n B active F (fullMixedLedgerDecode n B s) = F (s.1, fun g => (active g, (s.2 g).2)) := by unfold fixedActiveRawExtension fullMixedLedgerDecode rw [dif_pos (fun g => boundedOrderedTupleToFinite_length_le (s.2 g).2)] rfl theorem fixed_active_raw_extension_self (F : FullMixedLedgerState n (M := M) B → ℂ) (s : FullMixedLedgerState n (M := M) B) (hactive : ∀ g, (s.2 g).1 = active g) : fixedActiveRawExtension n B active F (fullMixedLedgerDecode n B s) = F s := by rw [fixed_active_raw_extension_decode] congr 1 apply Prod.ext · rfl · funext g exact Prod.ext (hactive g).symm rfl end Fixed end Bounty end section /- Extend the physical endpoint phase to every full active state. On an injective state its physical list is uniquely decoded; elsewhere the phase vanishes. No change is made to the full event type or weight. -/ open scoped Classical namespace Bounty section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (H : (g : Fin N) → Finset ↥(P g)) (ω : ∀ _c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def physicalFullGlobalEdgePhase (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullEdgeEvent C k x) : ℂ := if hx : FullActiveInjective x then physicalFullEndpointPhase C k (physicalFullStateLabels C x hx) H (fun g => (x g).2) ω μ ρ V (Eq.mpr (congrArg (PhysicalFullEdgeEvent C k) (physical_full_state_encode_labels C x hx)) e) else 0 theorem physical_full_global_edge_phase_norm_le (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullEdgeEvent C k x) : ‖physicalFullGlobalEdgePhase C k H ω μ ρ V x e‖ ≤ 1 := by unfold physicalFullGlobalEdgePhase split_ifs · exact physical_full_endpoint_phase_norm_le _ _ _ _ _ _ _ _ _ _ · simp only [norm_zero, zero_le_one] theorem physical_full_global_edge_phase_encode (L : PhysicalMarkLists P J ell) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) : physicalFullGlobalEdgePhase C k H ω μ ρ V (physicalFullMemoryState C L q) e = physicalFullEndpointPhase C k L H q ω μ ρ V e := by unfold physicalFullGlobalEdgePhase rw [dif_pos (physical_full_state_injective C L q)] have ht (L' : PhysicalMarkLists P J ell) (hL : L' = L) (he : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L' q) = PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) : physicalFullEndpointPhase C k L' H q ω μ ρ V (Eq.mpr he e) = physicalFullEndpointPhase C k L H q ω μ ρ V e := by subst L' rfl exact ht _ (physical_full_state_labels_encode C L q) _ end Physical end Bounty end section /- Changing the chosen slot enumeration between vertices is incorporated into the permutation bijection. Normalization and the complete dependence on the original permutation are retained together. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalTransitionPermutationEquiv {G : Type*} {J ell : ℕ} (C D : G → Finset (Fin J)) : PhysicalPermutations G J ell ≃ FullActiveSlotPermutations (fun _ : G => J + ell) where toFun σ g := ((physicalFullSlotIndex (D g)).trans (σ g)).trans (physicalFullSlotIndex (C g)).symm invFun τ g := ((physicalFullSlotIndex (D g)).symm.trans (τ g)).trans (physicalFullSlotIndex (C g)) left_inv σ := by funext g apply Equiv.ext intro i simp only [Equiv.trans_apply, Equiv.apply_symm_apply] right_inv τ := by funext g apply Equiv.ext intro i simp only [Equiv.trans_apply, Equiv.symm_apply_apply] theorem physical_full_memory_transition_permute {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C D : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) (σ : PhysicalPermutations G J ell) : physicalFullMemoryState D (physicalPermuteLabels σ L) q = fullActivePermutation (physicalTransitionPermutationEquiv C D σ) (physicalFullMemoryState C L q) := by funext g apply Prod.ext · funext i change L g (σ g (physicalFullSlotIndex (D g) i)) = L g (physicalFullSlotIndex (C g) ((physicalFullSlotIndex (C g)).symm (σ g (physicalFullSlotIndex (D g) i)))) rw [Equiv.apply_symm_apply] · rfl theorem physical_full_transition_permutation_weight {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (C D : G → Finset (Fin J)) (σ : PhysicalPermutations G J ell) : (Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹ = fullActivePermutationWeight (fun _ : G => J + ell) (physicalTransitionPermutationEquiv C D σ) := by unfold fullActivePermutationWeight rw [Fintype.card_congr (physicalTransitionPermutationEquiv C D)] theorem physical_full_transition_phase_reindex {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C D : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) (F : PhysicalPermutations G J ell → ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ : G => J + ell) B → ℂ) : (∑ σ : PhysicalPermutations G J ell, ((Fintype.card (PhysicalPermutations G J ell) : ℝ)⁻¹ : ℂ) * F σ (physicalFullMemoryState D (physicalPermuteLabels σ L) q)) = ∑ τ : FullActiveSlotPermutations (fun _ : G => J + ell), (fullActivePermutationWeight (fun _ : G => J + ell) τ : ℂ) * F ((physicalTransitionPermutationEquiv C D).symm τ) (fullActivePermutation τ (physicalFullMemoryState C L q)) := by calc _ = ∑ σ : PhysicalPermutations G J ell, (fullActivePermutationWeight (fun _ : G => J + ell) (physicalTransitionPermutationEquiv C D σ) : ℂ) * F σ (fullActivePermutation (physicalTransitionPermutationEquiv C D σ) (physicalFullMemoryState C L q)) := by apply sum_congr rfl intro σ _ rw [physical_full_memory_transition_permute C D L q σ] have hw := congrArg Complex.ofReal (physical_full_transition_permutation_weight C D σ) simpa only [Complex.ofReal_inv] using congrArg (fun z : ℂ => z * F σ (fullActivePermutation (physicalTransitionPermutationEquiv C D σ) (physicalFullMemoryState C L q))) hw _ = _ := by simpa only [Equiv.symm_apply_apply] using (physicalTransitionPermutationEquiv C D).sum_comp (fun τ => (fullActivePermutationWeight (fun _ : G => J + ell) τ : ℂ) * F ((physicalTransitionPermutationEquiv C D).symm τ) (fullActivePermutation τ (physicalFullMemoryState C L q))) end Bounty end section /- A finite chronological schedule of named rows is the corresponding operator list, with every occurrence and its order preserved. -/ namespace Bounty end Bounty end section /- Physical ordered lists carry exactly the restriction of full-state energy to injective active coordinates. Nonnegative weights allow this restriction to be bounded without introducing a cardinality factor. -/ open Finset open scoped Classical namespace Bounty section Physical variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {Z : G → Type*} [∀ g, Fintype (Z g)] {J ell B : ℕ} (C : G → Finset (Fin J)) theorem physical_full_state_sum_real (F : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B → ℝ) : (∑ L : PhysicalMarkLists P J ell, ∑ q : (g : G) → BoundedOrderedTuple (Z g) B, F (physicalFullMemoryState C L q)) = ∑ x : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B, if FullActiveInjective x then F x else 0 := by rw [← Fintype.sum_prod_type (f := fun s : PhysicalMarkLists P J ell × ((g : G) → BoundedOrderedTuple (Z g) B) => F (physicalFullMemoryState C s.1 s.2))] refine (Equiv.sum_comp (physicalFullStateEquiv (Z := Z) (B := B) C) (fun x => F x.val)).trans ?_ rw [← Finset.sum_subtype (univ.filter FullActiveInjective) (by simp) F] exact sum_filter _ _ noncomputable def physicalMarkMemoryEnergy (μ : (g : G) → ↥(P g) → ℝ) (ν : (g : G) → Z g → ℝ) (F : PhysicalMarkLists P J ell → ((g : G) → BoundedOrderedTuple (Z g) B) → ℂ) : ℝ := ∑ L, ∑ q, (∏ g, (∏ i : PhysicalSlots J ell, μ g (L g i)) * boundedOrderedMemoryWeight (ν g) (q g)) * ‖F L q‖ ^ 2 theorem physical_full_state_energy_eq (μ : (g : G) → ↥(P g) → ℝ) (ν : (g : G) → Z g → ℝ) (F : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B → ℂ) : physicalMarkMemoryEnergy μ ν (fun L q => F (physicalFullMemoryState C L q)) = ∑ x : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B, if FullActiveInjective x then productMemoryWeight μ ν x * ‖F x‖ ^ 2 else 0 := by have h := physical_full_state_sum_real C (fun x => productMemoryWeight μ ν x * ‖F x‖ ^ 2) simpa only [physicalMarkMemoryEnergy, physical_full_memory_state_weight] using h theorem physical_full_state_energy_le (μ : (g : G) → ↥(P g) → ℝ) (ν : (g : G) → Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (F : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B → ℂ) : physicalMarkMemoryEnergy μ ν (fun L q => F (physicalFullMemoryState C L q)) ≤ finiteWeightedEnergy (productMemoryWeight μ ν) F := by rw [physical_full_state_energy_eq C] unfold finiteWeightedEnergy apply sum_le_sum intro x _ split_ifs · exact le_rfl · exact mul_nonneg (productMemoryWeight_nonneg μ ν hμ hν x) (sq_nonneg _) end Physical end Bounty end section /- The minor coefficient is small using only a bound on the product of dyad endpoints. -/ namespace Bounty theorem minor_arc_uniform_factor_le {L C D U V r κ t q B : ℝ} (hL : 512 ≤ L) (hC : 0 ≤ C) (hD : 0 ≤ D) (ht : 0 ≤ t) (hq : 0 ≤ q) (hparam : 2 * κ + t + 2 * B + 3 ≤ q) (hCb : C ≤ L ^ κ) (hDb : D ≤ L ^ κ) (hU : L ^ q ≤ U) (hV : L ^ q ≤ V) (hr : L ^ q ≤ r) (hrUV : r / (U * V) ≤ L ^ (-q)) (hlog : Real.log (U * V) ≤ L ^ t) : 33 * Real.sqrt (6 * C * D * (1 + Real.log r) * (1 / r + 1 / U + 1 / V + r / (U * V))) ≤ L ^ (-B) := by have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hp : 0 < L ^ q := Real.rpow_pos_of_pos hL0 q have hU0 := hp.trans_le hU have hV0 := hp.trans_le hV have hr0 := hp.trans_le hr have hsmall : L ^ (-q) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hL1 (by linarith) have hrprod : r ≤ U * V := by have hb := (div_le_iff₀ (mul_pos hU0 hV0)).mp hrUV exact hb.trans (by simpa only [one_mul] using mul_le_mul_of_nonneg_right hsmall (mul_pos hU0 hV0).le) have hlogr : Real.log r ≤ L ^ t := (Real.log_le_log hr0 hrprod).trans hlog apply minor_arc_factor_absorption (by linarith) have hb := minor_arc_dyad_coefficient_small (B := B + 1) (by linarith : 48 ≤ L) hC hD ht hq (by linarith) hCb hDb hU hV hr hrUV hlogr convert hb using 1 congr 1 ring end Bounty end section /- A single marked prime band supplies the lower scale for all product dyads. -/ open Filter open scoped BigOperators Classical namespace Bounty theorem prime_band_product_lower {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (i : I) (hp : ∀ j p, p ∈ P j → 0 < p) {a b : ℝ} (hPi : P i = primeBand a b) (ha : 0 ≤ a) (hb : 0 ≤ b) (x : ∀ j, P j) : a < ((∏ j, (x j).val : ℕ) : ℝ) := by have hmem : (x i).val ∈ primeBand a b := hPi ▸ (x i).property have hband := (mem_primeBand_iff ha hb (x i).val).mp hmem have hle : (x i).val ≤ ∏ j, (x j).val := Finset.single_le_prod' (f := fun j => (x j).val) (fun j _ => hp j (x j).val (x j).property) (Finset.mem_univ i) exact hband.2.1.trans_le (by exact_mod_cast hle) theorem eventually_prime_band_product_scale {c : ℝ} (hc : 0 < c) (q : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (i : I), (∀ j p, p ∈ P j → 0 < p) → ∀ a b : ℝ, P i = primeBand a b → Real.exp (L ^ c) ≤ a → 0 ≤ b → ∀ x : (∀ j, P j), 2 * L ^ q ≤ ((∏ j, (x j).val : ℕ) : ℝ) := by filter_upwards [eventually_mul_rpow_le_exp_rpow q 2 hc] with L hL intro I _ _ P i hp a b hPi ha hb x exact hL.trans ((ha.trans_lt (prime_band_product_lower P i hp hPi ((Real.exp_pos _).le.trans ha) hb x)).le) end Bounty end section /- Canonical inclusions between memory caps preserve literal lengths, ordered coordinates, active labels, and the factorial product measures. -/ open Finset namespace Bounty def boundedMemoryCapEmbed {Z : Type*} {b B : ℕ} (h : b ≤ B) (q : BoundedOrderedTuple Z b) : BoundedOrderedTuple Z B := ⟨⟨q.1.val, lt_of_lt_of_le q.1.isLt (Nat.add_le_add_right h 1)⟩, q.2⟩ def boundedStateCapEmbed {P Z : Type*} {t b B : ℕ} (h : b ≤ B) (s : BoundedOrderedState P Z t b) : BoundedOrderedState P Z t B := (s.1, boundedMemoryCapEmbed h s.2) def productStateCapEmbed {G : Type*} {P Z : G → Type*} {M : G → ℕ} {b B : ℕ} (h : b ≤ B) (x : ProductBoundedOrderedState P Z M b) : ProductBoundedOrderedState P Z M B := fun g => boundedStateCapEmbed h (x g) theorem boundedMemoryCapEmbed_injective {Z : Type*} {b B : ℕ} (h : b ≤ B) : Function.Injective (boundedMemoryCapEmbed (Z := Z) h) := by intro x y hxy rcases x with ⟨⟨k, hk⟩, x⟩ rcases y with ⟨⟨l, hl⟩, y⟩ have hkl : k = l := congrArg (fun q => q.1.val) hxy subst l have hvals : x = y := eq_of_heq (Sigma.mk.inj hxy).2 subst y rfl theorem boundedStateCapEmbed_injective {P Z : Type*} {t b B : ℕ} (h : b ≤ B) : Function.Injective (boundedStateCapEmbed (P := P) (Z := Z) (t := t) h) := by intro x y hxy apply Prod.ext · exact congrArg (fun s : BoundedOrderedState P Z t B => s.1) hxy · apply boundedMemoryCapEmbed_injective h exact congrArg (fun s : BoundedOrderedState P Z t B => s.2) hxy theorem productStateCapEmbed_injective {G : Type*} {P Z : G → Type*} {M : G → ℕ} {b B : ℕ} (h : b ≤ B) : Function.Injective (productStateCapEmbed (P := P) (Z := Z) (M := M) h) := by intro x y hxy funext g exact boundedStateCapEmbed_injective h (congrFun hxy g) theorem productStateCapEmbed_totalMemory {G : Type*} [Fintype G] {P Z : G → Type*} {M : G → ℕ} {b B : ℕ} (h : b ≤ B) (x : ProductBoundedOrderedState P Z M b) : productTotalMemory (productStateCapEmbed h x) = productTotalMemory x := rfl end Bounty end section /- Every ghost target retains the full source active tuples, including invalid local events whose target falls back to the source. Consequently the target is reconstructed exactly from source active labels and target pending memory. No event-validity or nonzero-weight premise is needed. -/ namespace Bounty theorem boundedGhostEventTarget_active {P Z : Type*} (t B : ℕ) (s : BoundedOrderedState P Z t B) (e : BoundedGhostEvent t B s) : (boundedGhostEventTarget t B s e).1 = s.1 := by unfold boundedGhostEventTarget dsimp only split_ifs <;> rfl theorem coupledGhostJointEventTarget_active {G : Type*} {P Z : G → Type*} (M : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z M B) (e : CoupledGhostEvent M B s) (g : G) : (coupledGhostJointEventTarget M B s e g).1 = (s g).1 := boundedGhostEventTarget_active (M g) B (s g) (e g) universe uJ uK uG uP uA section variable {J : Type uJ} {K : Type uK} {G : Type uG} {P : G → Type uP} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) (Δ D : ∀ k c, A k c → G → ℤ) theorem fullMixedMemoryEventTarget_ghost_active (j : J) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullMixedMemoryEvent n S B A Δ D (.inl j) s) (g : G) : (fullMixedMemoryEventTarget n S B A Δ D (.inl j) s e g).1 = (s g).1 := coupledGhostJointEventTarget_active M B s e.down g theorem fullPermutationMixedEventTarget_ghost_active (j : J) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s) (g : G) : (fullPermutationMixedEventTarget n S B A Δ D (some (.inl j)) s e g).1 = (s g).1 := fullMixedMemoryEventTarget_ghost_active n S B A Δ D j s e g end end Bounty end section /- Exact transport of dependent event paths through a state map and event bijections. The phase is transported with every event identity intact. -/ open Finset Classical namespace Bounty universe uK uX uY uE uF def finiteEventPathEquiv {K : Type uK} {X : Type uX} {Y : Type uY} (E : K → X → Type uE) (F : K → Y → Type uF) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (e : X → Y) (δ : ∀ k x, E k x ≃ F k (e x)) (ht : ∀ k x a, e (t k x a) = u k (e x) (δ k x a)) : ∀ ks x, FiniteEventPath E t ks x ≃ FiniteEventPath F u ks (e x) | [], _ => Equiv.punitEquivPUnit | k :: ks, x => Equiv.sigmaCongr (δ k x) (fun a => (finiteEventPathEquiv E F t u e δ ht ks (t k x a)).trans (Equiv.cast (congrArg (FiniteEventPath F u ks) (ht k x a)))) theorem finite_event_path_terminal_cast {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (ks : List K) {x y : X} (h : x = y) (p : FiniteEventPath E t ks x) : finiteEventPathTerminal E t ks y (cast (congrArg (FiniteEventPath E t ks) h) p) = finiteEventPathTerminal E t ks x p := by cases h rfl theorem finite_event_path_weight_cast {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (ks : List K) {x y : X} (h : x = y) (p : FiniteEventPath E t ks x) : finiteEventPathWeight E t w ks y (cast (congrArg (FiniteEventPath E t ks) h) p) = finiteEventPathWeight E t w ks x p := by cases h rfl section variable {K : Type uK} {X : Type uX} {Y : Type uY} (E : K → X → Type uE) (F : K → Y → Type uF) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (e : X → Y) (δ : ∀ k x, E k x ≃ F k (e x)) (ht : ∀ k x a, e (t k x a) = u k (e x) (δ k x a)) include K X Y E F t u e δ ht theorem finite_event_path_equiv_terminal (ks : List K) (x : X) (p : FiniteEventPath E t ks x) : finiteEventPathTerminal F u ks (e x) (finiteEventPathEquiv E F t u e δ ht ks x p) = e (finiteEventPathTerminal E t ks x p) := by induction ks generalizing x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ change finiteEventPathTerminal F u ks _ (cast (congrArg (FiniteEventPath F u ks) (ht k x a)) (finiteEventPathEquiv E F t u e δ ht ks (t k x a) p)) = _ rw [finite_event_path_terminal_cast F u ks (ht k x a)] exact ih _ p theorem finite_event_path_equiv_weight (w : ∀ k x, E k x → ℝ) (v : ∀ k y, F k y → ℝ) (hw : ∀ k x a, v k (e x) (δ k x a) = w k x a) (ks : List K) (x : X) (p : FiniteEventPath E t ks x) : finiteEventPathWeight F u v ks (e x) (finiteEventPathEquiv E F t u e δ ht ks x p) = finiteEventPathWeight E t w ks x p := by induction ks generalizing x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ change v k (e x) (δ k x a) * finiteEventPathWeight F u v ks _ (cast (congrArg (FiniteEventPath F u ks) (ht k x a)) (finiteEventPathEquiv E F t u e δ ht ks (t k x a) p)) = _ rw [hw, finite_event_path_weight_cast F u v ks (ht k x a), ih] rfl end end Bounty end section /- Deterministic observation records do not add event multiplicity. Each source-state/event observation is appended in chronological order. Arbitrary terminal dependence on that record becomes a whole-path observable on the original state space; no measure or symmetry on records is required. -/ open Finset namespace Bounty section variable {K X O : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (observe : ∀ k x, E k x → O) def finiteObservationLedgerUpdate (k : K) (record : List O) (x : X) (e : E k x) : List O := record ++ [observe k x e] def finiteEventPathObservations : ∀ ks x, FiniteEventPath E target ks x → List O | [], _, _ => [] | k :: ks, x, ⟨e, p⟩ => observe k x e :: finiteEventPathObservations ks (target k x e) p theorem finite_event_path_observations_length (ks : List K) (x : X) (p : FiniteEventPath E target ks x) : (finiteEventPathObservations E target observe ks x p).length = ks.length := by induction ks generalizing x with | nil => rfl | cons k ks ih => rcases p with ⟨e, p⟩ exact congrArg Nat.succ (ih (target k x e) p) variable [∀ k x, Fintype (E k x)] end end Bounty end section /- Dyadic endpoint, cardinality, and occupied-cell bounds from polynomial logarithmic scales. -/ open scoped BigOperators Classical namespace Bounty theorem finite_dyadic_test_ne_zero {X : Type*} (π : X → ℕ) (f : X → ℂ) {j : ℕ} {x : X} (hx : finiteDyadicTest π j f x ≠ 0) : f x ≠ 0 := by unfold finiteDyadicTest at hx split_ifs at hx · exact hx · exact (hx rfl).elim theorem finite_dyadic_endpoint_scales {X : Type*} (π : X → ℕ) (f : X → ℂ) (hπ : ∀ x, 0 < π x) {M H : ℝ} (hmin : ∀ x, f x ≠ 0 → 2 * M ≤ (π x : ℝ)) (hmax : ∀ x, Real.log (π x) ≤ H) {j : ℕ} (hj : ∃ x, finiteDyadicTest π j f x ≠ 0) : M ≤ (2 ^ j : ℕ) ∧ Real.log (2 ^ j : ℕ) ≤ H := by obtain ⟨x, hx⟩ := hj have hfx := finite_dyadic_test_ne_zero π f hx have hb := finite_dyadic_test_range π f (fun x _ => hπ x) j x hx constructor · have hu : (π x : ℝ) < 2 * (2 ^ j : ℕ) := by exact_mod_cast hb.2 linarith [hmin x hfx] · exact (Real.log_le_log (by positivity) (by exact_mod_cast hb.1)).trans (hmax x) theorem finite_dyadic_card_polynomial {X : Type*} [Fintype X] (π : X → ℕ) (hπ : ∀ x, 0 < π x) {L s : ℝ} (hL : 4 ≤ L) (hs : 0 ≤ s) (hmax : ∀ x, Real.log (π x) ≤ L ^ s) : ((finiteDyadicIndices π).card : ℝ) ≤ L ^ (s + 1) := by have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hp1 : 1 ≤ L ^ s := Real.one_le_rpow hL1 hs have hlog2 : (1 : ℝ) / 2 ≤ Real.log 2 := by linarith [Real.log_two_gt_d9] have hbound := finite_dyadic_indices_card_le π hπ (Real.rpow_pos_of_pos hL0 s).le hmax have hdiv : L ^ s / Real.log 2 ≤ 2 * L ^ s := by apply (div_le_iff₀ (Real.log_pos (by norm_num : (1 : ℝ) < 2))).mpr nlinarith [mul_nonneg (Real.rpow_pos_of_pos hL0 s).le (sub_nonneg.mpr hlog2)] calc _ ≤ L ^ s / Real.log 2 + 1 := hbound _ ≤ 3 * L ^ s := by linarith _ ≤ L * L ^ s := mul_le_mul_of_nonneg_right (by linarith) (by positivity) _ = L ^ (s + 1) := by rw [Real.rpow_add hL0, Real.rpow_one]; ring theorem dyadic_log_product_polynomial {U V L s : ℝ} (hU : 0 < U) (hV : 0 < V) (hL : 2 ≤ L) (hlogU : Real.log U ≤ L ^ s) (hlogV : Real.log V ≤ L ^ s) : Real.log (U * V) ≤ L ^ (s + 1) := by have hL0 : 0 < L := by linarith rw [Real.log_mul hU.ne' hV.ne', Real.rpow_add hL0, Real.rpow_one] have hm := mul_le_mul_of_nonneg_right hL (Real.rpow_pos_of_pos hL0 s).le nlinarith theorem polynomial_width_le_log_two {L w : ℝ} (hL : 4 ≤ L) (hw : 1 ≤ w) : L ^ (-w) ≤ Real.log 2 := by have hL0 : 0 < L := by linarith calc _ ≤ L ^ (-(1 : ℝ)) := Real.rpow_le_rpow_of_exponent_le (by linarith) (by linarith) _ = 1 / L := by rw [Real.rpow_neg_one, one_div] _ ≤ (1 : ℝ) / 4 := one_div_le_one_div_of_le (by norm_num) hL _ ≤ Real.log 2 := by linarith [Real.log_two_gt_d9] theorem two_upper_log_cell_cards_polynomial {X Y : Type*} [Fintype X] [Fintype Y] (p : X → ℝ) (q : Y → ℝ) {L s w : ℝ} (hL : 4 ≤ L) (hs : 0 ≤ s) (hw : 0 ≤ w) (hp : ∀ x, 0 ≤ p x ∧ p x ≤ L ^ s) (hq : ∀ y, 0 ≤ q y ∧ q y ≤ L ^ s) : (((finiteOccupiedCells (fun x => upperLogCell (L ^ (-w)) (p x))).card + (finiteOccupiedCells (fun y => upperLogCell (L ^ (-w)) (q y))).card : ℕ) : ℝ) ≤ L ^ (s + w + 2) := by have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hh : 0 < L ^ (-w) := Real.rpow_pos_of_pos hL0 _ have hP := upper_log_occupied_cells_card_real_le p hh (by positivity : 0 ≤ L ^ s) hp have hQ := upper_log_occupied_cells_card_real_le q hh (by positivity : 0 ≤ L ^ s) hq have he : (L ^ s - 0) / L ^ (-w) = L ^ (s + w) := by rw [sub_zero, ← Real.rpow_sub hL0] congr 1 ring rw [he] at hP hQ have hp1 : 1 ≤ L ^ (s + w) := Real.one_le_rpow hL1 (by linarith) have hsq : (6 : ℝ) ≤ L ^ (2 : ℕ) := by nlinarith have hm := mul_le_mul_of_nonneg_right hsq (Real.rpow_pos_of_pos hL0 (s + w)).le push_cast calc _ ≤ 2 * L ^ (s + w) + 4 := by linarith _ ≤ 6 * L ^ (s + w) := by linarith _ ≤ L ^ (2 : ℕ) * L ^ (s + w) := hm _ = L ^ (s + w) * L ^ (2 : ℝ) := by rw [Real.rpow_two]; ring _ = L ^ (s + w + 2) := (Real.rpow_add hL0 _ _).symm theorem finite_weighted_pairing_reorder {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (f : X → ℂ) (g : Y → ℂ) (K : X → Y → ℂ) : (∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * (K x y * f x * g y)) = ∑ x, ∑ y, ((μ x : ℂ) * f x) * ((ν y : ℂ) * g y) * K x y := by apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ push_cast ring end Bounty end section /- Exact finite dyadic partitions of positive natural-number supports. -/ open Finset Filter namespace Bounty def dyadicNatBucket (S : Finset ℕ) (k : ℕ) : Finset ℕ := S.filter (fun n => n.log2 = k) def dyadicNatIndices (S : Finset ℕ) : Finset ℕ := S.image Nat.log2 theorem mem_dyadicNatBucket (S : Finset ℕ) (k n : ℕ) : n ∈ dyadicNatBucket S k ↔ n ∈ S ∧ n.log2 = k := by exact mem_filter theorem dyadicNatBucket_subset (S : Finset ℕ) (k : ℕ) : dyadicNatBucket S k ⊆ S := filter_subset _ _ section variable (S : Finset ℕ) (hS : ∀ n ∈ S, 0 < n) {k n : ℕ} (hn : n ∈ dyadicNatBucket S k) include S hS k n hn theorem dyadicNatBucket_bounds : 2 ^ k ≤ n ∧ n < 2 ^ (k + 1) := by obtain ⟨hnS, hnk⟩ := (mem_dyadicNatBucket S k n).mp hn exact (Nat.log2_eq_iff (hS n hnS).ne').mp hnk theorem dyadicNatBucket_upper_scale : n ≤ 2 ^ (k + 1) ∧ 2 ^ (k + 1) ≤ 2 * n := by obtain ⟨hlow, hupp⟩ := dyadicNatBucket_bounds S hS hn constructor · exact hupp.le · rw [pow_succ] omega theorem dyadicNatBucket_upper_scale_real : (n : ℝ) ≤ (2 : ℝ) ^ (k + 1) ∧ (2 : ℝ) ^ (k + 1) ≤ 2 * (n : ℝ) := by exact_mod_cast dyadicNatBucket_upper_scale S hS hn end theorem dyadicNatBucket_eq_filter_interval (S : Finset ℕ) (hS : ∀ n ∈ S, 0 < n) (k : ℕ) : dyadicNatBucket S k = S.filter (fun n => 2 ^ k ≤ n ∧ n < 2 ^ (k + 1)) := by ext n simp only [mem_dyadicNatBucket, mem_filter] exact and_congr_right (fun hn => Nat.log2_eq_iff (hS n hn).ne') theorem dyadicNatBucket_nonempty_iff (S : Finset ℕ) (k : ℕ) : (dyadicNatBucket S k).Nonempty ↔ k ∈ dyadicNatIndices S := by simp only [Finset.Nonempty, mem_dyadicNatBucket, dyadicNatIndices, mem_image] theorem sum_dyadicNatBuckets {E : Type*} [AddCommMonoid E] (S : Finset ℕ) (w : ℕ → E) : (∑ k ∈ dyadicNatIndices S, ∑ n ∈ dyadicNatBucket S k, w n) = ∑ n ∈ S, w n := by exact sum_fiberwise_of_maps_to (fun n hn => mem_image_of_mem Nat.log2 hn) w theorem dyadicNatIndices_subset_range (S : Finset ℕ) (N : ℕ) (hN : ∀ n ∈ S, n ≤ N) : dyadicNatIndices S ⊆ range (N.log2 + 1) := by intro k hk obtain ⟨n, hn, rfl⟩ := mem_image.mp hk apply mem_range.mpr have h := Nat.log_mono_right (b := 2) (hN n hn) simpa only [← Nat.log2_eq_log_two] using Nat.lt_succ_of_le h theorem dyadicNatIndices_card_le (S : Finset ℕ) (N : ℕ) (hN : ∀ n ∈ S, n ≤ N) : (dyadicNatIndices S).card ≤ N.log2 + 1 := by simpa only [card_range] using card_le_card (dyadicNatIndices_subset_range S N hN) theorem dyadic_log_count_le_log (N : ℕ) : (N.log2 + 1 : ℝ) ≤ Real.log N / Real.log 2 + 1 := by have h := Real.log2_le_logb N simp only [Real.logb] at h linarith theorem dyadicNatIndices_card_le_log (S : Finset ℕ) (N : ℕ) (hN : ∀ n ∈ S, n ≤ N) : ((dyadicNatIndices S).card : ℝ) ≤ Real.log N / Real.log 2 + 1 := by have h : ((dyadicNatIndices S).card : ℝ) ≤ N.log2 + 1 := by exact_mod_cast dyadicNatIndices_card_le S N hN exact h.trans (dyadic_log_count_le_log N) theorem sum_dyadicNatBuckets_bilinear {E : Type*} [AddCommMonoid E] (S T : Finset ℕ) (w : ℕ → ℕ → E) : (∑ i ∈ dyadicNatIndices S, ∑ j ∈ dyadicNatIndices T, ∑ m ∈ dyadicNatBucket S i, ∑ n ∈ dyadicNatBucket T j, w m n) = ∑ m ∈ S, ∑ n ∈ T, w m n := by rw [← sum_dyadicNatBuckets S (fun m => ∑ n ∈ T, w m n)] apply sum_congr rfl intro i hi rw [sum_comm] apply sum_congr rfl intro m hm exact sum_dyadicNatBuckets T (w m) theorem dyadic_log_count_le_linear_of_le_exp {L : ℝ} (hL : 1 ≤ L) (h16 : Real.log 16 ≤ L) (N : ℕ) (hN : (N : ℝ) ≤ 16 * Real.exp L) : (N.log2 + 1 : ℝ) ≤ (2 / Real.log 2 + 1) * L := by have hlog : Real.log N ≤ 2 * L := by by_cases hn : N = 0 · simp only [hn, Nat.cast_zero, Real.log_zero] linarith · have h := Real.log_le_log (show (0 : ℝ) < N from Nat.cast_pos.mpr (Nat.pos_of_ne_zero hn)) hN rw [Real.log_mul (by norm_num) (Real.exp_pos L).ne', Real.log_exp] at h linarith have htwo : 0 < Real.log 2 := Real.log_pos (by norm_num) calc (N.log2 + 1 : ℝ) ≤ Real.log N / Real.log 2 + 1 := dyadic_log_count_le_log N _ ≤ 2 * L / Real.log 2 + 1 := add_le_add (div_le_div_of_nonneg_right hlog htwo.le) le_rfl _ ≤ 2 * L / Real.log 2 + L := add_le_add le_rfl hL _ = _ := by ring theorem eventually_dyadic_log_count_le_linear : ∀ᶠ L : ℝ in atTop, ∀ N : ℕ, (N : ℝ) ≤ 16 * Real.exp L → (N.log2 + 1 : ℝ) ≤ (2 / Real.log 2 + 1) * L := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (Real.log 16)] with L hL h16 exact dyadic_log_count_le_linear_of_le_exp hL h16 theorem eventually_dyadicNatIndices_card_le_linear : ∀ᶠ L : ℝ in atTop, ∀ (N : ℕ) (S : Finset ℕ), (N : ℝ) ≤ 16 * Real.exp L → (∀ n ∈ S, n ≤ N) → ((dyadicNatIndices S).card : ℝ) ≤ (2 / Real.log 2 + 1) * L := by filter_upwards [eventually_dyadic_log_count_le_linear] with L hL intro N S hN hS have hcard : ((dyadicNatIndices S).card : ℝ) ≤ N.log2 + 1 := by exact_mod_cast dyadicNatIndices_card_le S N hS exact hcard.trans (hL N hN) end Bounty end section /- Removing a prime outside a finite pool commutes with extracting the pool-free part. -/ namespace Bounty theorem prime_not_dvd_primePoolPart {P : Finset ℕ} {p u : ℕ} (hp : p.Prime) (hpP : p ∉ P) : ¬ p ∣ primePoolPart P u := by intro h exact hpP (Nat.primeFactors_subset_of_mem_factoredNumbers (primePoolPart_mem_factoredNumbers P u) (hp.mem_primeFactors h (primePoolPart_ne_zero P u))) theorem prime_dvd_primePoolFreePart_iff {P : Finset ℕ} {p u : ℕ} (hp : p.Prime) (hpP : p ∉ P) : p ∣ primePoolFreePart P u ↔ p ∣ u := by conv_rhs => rw [← primePoolPart_mul_primePoolFreePart P u] rw [hp.dvd_mul] exact (or_iff_right (prime_not_dvd_primePoolPart hp hpP)).symm theorem primePoolPart_prime_of_not_mem {P : Finset ℕ} {p : ℕ} (hp : p.Prime) (hpP : p ∉ P) : primePoolPart P p = 1 := by apply primePoolPart_eq_one_of_disjoint (Q := {p}) · simpa using hpP · apply Nat.mem_factoredNumbers_of_primeFactors_subset hp.ne_zero rw [hp.primeFactors] theorem primePoolPart_div_prime_of_not_mem {P : Finset ℕ} {p u : ℕ} (hp : p.Prime) (hpP : p ∉ P) (hu : u ≠ 0) (hpu : p ∣ u) : primePoolPart P (u / p) = primePoolPart P u := by have hmul : p * (u / p) = u := Nat.mul_div_cancel' hpu have hquot : u / p ≠ 0 := by intro h rw [h, mul_zero] at hmul exact hu hmul.symm calc primePoolPart P (u / p) = primePoolPart P p * primePoolPart P (u / p) := by rw [primePoolPart_prime_of_not_mem hp hpP, one_mul] _ = primePoolPart P (p * (u / p)) := (primePoolPart_mul P hp.ne_zero hquot).symm _ = primePoolPart P u := congrArg (primePoolPart P) hmul theorem primePoolFreePart_div_prime_of_not_mem {P : Finset ℕ} {p u : ℕ} (hp : p.Prime) (hpP : p ∉ P) (hu : u ≠ 0) (hpu : p ∣ u) : primePoolFreePart P (u / p) = primePoolFreePart P u / p := by unfold primePoolFreePart rw [primePoolPart_div_prime_of_not_mem hp hpP hu hpu] exact Nat.div_right_comm u p (primePoolPart P u) end Bounty end section /- The actual normalized remainder after extracting the distinguished Q-zero prime. -/ open Finset Filter namespace Bounty theorem ordered_slot_rest_weight_le {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (i : I) (p : choices i) {Z : ℝ} (hZ : 0 ≤ Z) (n : ℕ) : orderedSlotWeight (fun j : {j : I // j ≠ i} => choices j.val) Z n ≤ orderedSlotWeight choices Z (p.val * n) := by classical rw [ordered_slot_weight_split choices i] apply le_trans _ (single_le_sum (f := fun q : choices i => ∑ y : ∀ j : {j : I // j ≠ i}, choices j.val, if q.val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y = p.val * n then 1 / Z else 0) (fun _ _ => sum_nonneg (fun _ _ => by split_ifs <;> positivity)) (mem_univ p)) unfold orderedSlotWeight trans ∑ y : ∀ j : {j : I // j ≠ i}, choices j.val, if orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y = n then 1 / Z else 0 · apply le_of_eq apply sum_congr · ext y; simp · intro y _; rfl · apply sum_le_sum intro y _ split_ifs with hy hmul hmul · exact le_rfl · exact False.elim (hmul (congrArg (fun k => p.val * k) hy)) · positivity · exact le_rfl theorem ordered_slot_weight_divisor_split {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (i : I) (Z : ℝ) (hp0 : ∀ p ∈ choices i, p ≠ 0) (n : ℕ) : orderedSlotWeight choices Z n = ∑ p ∈ choices i, if p ∣ n then orderedSlotWeight (fun j : {j : I // j ≠ i} => choices j.val) Z (n / p) else 0 := by classical rw [ordered_slot_weight_split choices i, ← sum_coe_sort (choices i)] apply sum_congr rfl intro p _ by_cases hd : p.val ∣ n · rw [if_pos hd] unfold orderedSlotWeight apply sum_congr · ext y; simp · intro y _ have heq : p.val * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y = n ↔ orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y = n / p.val := by constructor · intro h apply Nat.eq_of_mul_eq_mul_left (Nat.pos_of_ne_zero (hp0 p.val p.property)) exact h.trans (Nat.mul_div_cancel' hd).symm · intro h rw [h, Nat.mul_div_cancel' hd] simp only [heq] · rw [if_neg hd] apply sum_eq_zero intro y _ apply if_neg intro h exact hd ⟨_, h.symm⟩ noncomputable def candidateQRestWeight (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (n : ℕ) : ℝ := orderedSlotWeight (candidateQRestChoices c L r jStar hr) ((r.factorial : ℝ) ^ (candidateQIndices c L).card) n theorem candidate_Q_rest_weight_nonneg (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (n : ℕ) : 0 ≤ candidateQRestWeight c L r jStar hr n := ordered_slot_weight_nonneg _ (by positivity) n theorem candidate_Q_rest_weight_le_full (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) {p : ℕ} (hp : p ∈ candidateQBand (c * L) 0) (n : ℕ) : candidateQRestWeight c L r jStar hr n ≤ candidateQWeight c L r jStar (p * n) := by have hp' : p ∈ candidateQSlotChoices c L r jStar (candidateFreeSlot c L r hr) := by rwa [candidate_Q_free_choice c L r jStar hr hj] exact ordered_slot_rest_weight_le (candidateQSlotChoices c L r jStar) (candidateFreeSlot c L r hr) ⟨p, hp'⟩ (by positivity) n theorem candidate_Q_weight_rest_divisor_split (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) (n : ℕ) : candidateQWeight c L r jStar n = ∑ p ∈ candidateQBand (c * L) 0, if p ∣ n then candidateQRestWeight c L r jStar hr (n / p) else 0 := by have h := ordered_slot_weight_divisor_split (candidateQSlotChoices c L r jStar) (candidateFreeSlot c L r hr) ((r.factorial : ℝ) ^ (candidateQIndices c L).card) (fun p hp => candidate_Q_slot_nonzero c L r jStar _ hp) n rw [candidate_Q_free_choice c L r jStar hr hj] at h exact h theorem eventually_candidate_Q_rest_weight_le_exp_sqrt {c : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, 0 < jStar → ∀ n : ℕ, (n : ℝ) ≤ 16 * Real.exp L → candidateQRestWeight c L r jStar hr n ≤ Real.exp ((((6/5 : ℝ) * c + 2) * Real.log 2) * Real.sqrt L) := by filter_upwards [eventually_candidateQBand_nonempty hc, eventually_candidate_Q_weight_le_roughDivisors hc hr, eventually_ge_atTop (Real.log 16), eventually_gt_atTop (0 : ℝ)] with L hband hQ hlarge hL intro jStar hj n hn obtain ⟨p, hp⟩ := hband 0 (by simp [candidateQIndices]) have hpdata := (mem_dyadicPrimeBand_iff (c * L) 1 (6/5) 0 p).mp hp have hle := candidate_Q_rest_weight_le_full c L r jStar hr hj hp n by_cases hn0 : n = 0 · subst n simp only [mul_zero, candidate_Q_weight_zero_at_zero] at hle exact hle.trans (Real.exp_pos ((((6/5 : ℝ) * c + 2) * Real.log 2) * Real.sqrt L)).le · have hpbound : (p : ℝ) ≤ Real.exp (((6/5 : ℝ) * c) * L) := by simpa only [pow_zero, div_one, mul_assoc] using hpdata.2.2 have hsize : ((p * n : ℕ) : ℝ) ≤ Real.exp (((6/5 : ℝ) * c + 2) * L) := by calc ((p * n : ℕ) : ℝ) = (p : ℝ) * n := Nat.cast_mul p n _ ≤ Real.exp (((6/5 : ℝ) * c) * L) * Real.exp (2 * L) := mul_le_mul hpbound (wide_window_nat_le_exp_twice hlarge hn) (Nat.cast_nonneg n) (Real.exp_pos _).le _ = _ := by rw [← Real.exp_add]; congr 1; ring exact hle.trans ((hQ jStar (p * n)).trans (roughDivisors_card_le_exp_sqrt hL (Nat.mul_ne_zero hpdata.1.ne_zero hn0) hsize)) noncomputable def candidateRemainderCoefficient (c L q : ℝ) (r jStar : ℕ) (hr : 0 < r) (u : ℕ) : ℝ := candidateQRestWeight c L r jStar hr (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c * L))) u) * markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ p ∈ candidatePBand (c * L) j, 1 / (p : ℝ)) (fun _ => 1) (u : ℤ) theorem candidate_remainder_coefficient_nonneg (c L : ℝ) {q : ℝ} (hq : 0 ≤ q) (r jStar : ℕ) (hr : 0 < r) (u : ℕ) : 0 ≤ candidateRemainderCoefficient c L q r jStar hr u := by apply mul_nonneg (candidate_Q_rest_weight_nonneg _ _ _ _ _ _) exact marked_divisor_weight_nonneg _ _ hq _ _ (fun _ _ => sum_nonneg (fun _ _ => by positivity)) _ theorem eventually_candidate_remainder_coefficient_le_exp_sqrt {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, 0 < jStar → ∀ u : ℕ, (u : ℝ) ≤ 16 * Real.exp L → candidateRemainderCoefficient c L q r jStar hr u ≤ Real.exp (((((6/5 : ℝ) * c + 2) * Real.log 2) + 1) * Real.sqrt L) := by filter_upwards [eventually_candidate_Q_rest_weight_le_exp_sqrt hc hr, eventually_candidate_marked_multiplier_bound hc hq0 hq1 (((6/5 : ℝ) * c + 2) * Real.log 2)] with L hrest hmarked intro jStar hj u hu have hfree : (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c * L))) u : ℝ) ≤ 16 * Real.exp L := (Nat.cast_le.mpr (Nat.div_le_self _ _)).trans hu exact hmarked (u : ℤ) _ (candidate_Q_rest_weight_nonneg _ _ _ _ _ _) (hrest jStar hj _ hfree) end Bounty end section /- Elementary numerical bounds for bilinear large-sieve errors. -/ namespace Bounty theorem sqrt_add_square_le {P R : ℝ} (hP : 0 ≤ P) (hR : 0 ≤ R) : Real.sqrt (P + R ^ 2) ≤ Real.sqrt P + R := by apply Real.sqrt_le_iff.mpr constructor · positivity · nlinarith [Real.sq_sqrt hP, mul_nonneg (Real.sqrt_nonneg P) hR] theorem large_sieve_sqrt_expand {P U R : ℝ} (hP : 0 ≤ P) (hU : 0 ≤ U) (hR : 0 ≤ R) : Real.sqrt ((P + R ^ 2) * (U + R ^ 2) * P * U) ≤ P * U + R * P * Real.sqrt U + R * U * Real.sqrt P + R ^ 2 * Real.sqrt (P * U) := by have hP' : 0 ≤ P + R ^ 2 := by positivity have hU' : 0 ≤ U + R ^ 2 := by positivity have heq : (P + R ^ 2) * (U + R ^ 2) * P * U = ((P + R ^ 2) * P) * ((U + R ^ 2) * U) := by ring rw [heq, Real.sqrt_mul (mul_nonneg hP' hP), Real.sqrt_mul hP', Real.sqrt_mul hU'] calc _ ≤ ((Real.sqrt P + R) * Real.sqrt P) * ((Real.sqrt U + R) * Real.sqrt U) := by exact mul_le_mul (mul_le_mul_of_nonneg_right (sqrt_add_square_le hP hR) (Real.sqrt_nonneg P)) (mul_le_mul_of_nonneg_right (sqrt_add_square_le hU hR) (Real.sqrt_nonneg U)) (by positivity) (by positivity) _ = _ := by rw [Real.sqrt_mul hP] simp only [add_mul, Real.mul_self_sqrt hP, Real.mul_self_sqrt hU] ring theorem large_sieve_sqrt_div_expand {P U R : ℝ} (hP : 0 ≤ P) (hU : 0 ≤ U) (hR : 0 < R) : Real.sqrt ((P + R ^ 2) * (U + R ^ 2) * P * U) / R ≤ P * U / R + P * Real.sqrt U + U * Real.sqrt P + R * Real.sqrt (P * U) := by apply (div_le_div_of_nonneg_right (large_sieve_sqrt_expand hP hU hR.le) hR.le).trans exact le_of_eq (by field_simp) theorem large_sieve_energy_factor {P U R E F W : ℝ} (hP : 0 ≤ P) (hU : 0 ≤ U) (hF : 0 ≤ F) (hW : 0 ≤ W) (hEP : E ≤ P * W) (hFU : F ≤ U * W) : Real.sqrt ((P + R ^ 2) * (U + R ^ 2) * E * F) ≤ W * Real.sqrt ((P + R ^ 2) * (U + R ^ 2) * P * U) := by have hfactor : 0 ≤ (P + R ^ 2) * (U + R ^ 2) := by positivity have hEF : E * F ≤ (P * W) * (U * W) := mul_le_mul hEP hFU hF (mul_nonneg hP hW) have h := Real.sqrt_le_sqrt (mul_le_mul_of_nonneg_left hEF hfactor) have heq : ((P + R ^ 2) * (U + R ^ 2)) * ((P * W) * (U * W)) = W ^ 2 * ((P + R ^ 2) * (U + R ^ 2) * P * U) := by ring rw [heq, Real.sqrt_mul (sq_nonneg W), Real.sqrt_sq hW] at h simpa only [mul_assoc] using h theorem sqrt_exp_half (x : ℝ) : Real.sqrt (Real.exp x) = Real.exp (x / 2) := by apply (Real.sqrt_eq_iff_mul_self_eq (Real.exp_nonneg _) (Real.exp_nonneg _)).mpr rw [← Real.exp_add] congr 1 ring theorem large_sieve_exponential_ranges {P U R L a eta theta C : ℝ} (hC : 0 ≤ C) (hP : Real.exp (a * L) ≤ P) (hU : Real.exp (a * L) ≤ U) (hPU : P * U ≤ C * Real.exp L) (hRlo : Real.exp (eta * L) ≤ R) (hRhi : R ≤ Real.exp (theta * L)) : Real.sqrt ((P + R ^ 2) * (U + R ^ 2) * P * U) / R ≤ C * Real.exp ((1 - eta) * L) + 2 * C * Real.exp ((1 - a / 2) * L) + Real.sqrt C * Real.exp ((theta + 1 / 2) * L) := by have hP0 : 0 < P := (Real.exp_pos _).trans_le hP have hU0 : 0 < U := (Real.exp_pos _).trans_le hU have hR0 : 0 < R := (Real.exp_pos _).trans_le hRlo have hsP : Real.exp ((a / 2) * L) ≤ Real.sqrt P := by have h := Real.sqrt_le_sqrt hP rw [sqrt_exp_half] at h convert h using 1 congr 1 ring have hsU : Real.exp ((a / 2) * L) ≤ Real.sqrt U := by have h := Real.sqrt_le_sqrt hU rw [sqrt_exp_half] at h convert h using 1 congr 1 ring have hfirst : P * U / R ≤ C * Real.exp ((1 - eta) * L) := by calc _ ≤ (C * Real.exp L) / R := div_le_div_of_nonneg_right hPU hR0.le _ ≤ (C * Real.exp L) / Real.exp (eta * L) := div_le_div_of_nonneg_left (mul_nonneg hC (Real.exp_nonneg _)) (Real.exp_pos _) hRlo _ = _ := by rw [mul_div_assoc, ← Real.exp_sub]; congr 2; ring have hsecond : P * Real.sqrt U ≤ C * Real.exp ((1 - a / 2) * L) := by calc _ = P * U / Real.sqrt U := by rw [mul_div_assoc, Real.div_sqrt] _ ≤ (C * Real.exp L) / Real.sqrt U := div_le_div_of_nonneg_right hPU (Real.sqrt_nonneg _) _ ≤ (C * Real.exp L) / Real.exp ((a / 2) * L) := div_le_div_of_nonneg_left (mul_nonneg hC (Real.exp_nonneg _)) (Real.exp_pos _) hsU _ = _ := by rw [mul_div_assoc, ← Real.exp_sub]; congr 2; ring have hthird : U * Real.sqrt P ≤ C * Real.exp ((1 - a / 2) * L) := by calc _ = P * U / Real.sqrt P := by rw [mul_comm P U, mul_div_assoc, Real.div_sqrt] _ ≤ (C * Real.exp L) / Real.sqrt P := div_le_div_of_nonneg_right hPU (Real.sqrt_nonneg _) _ ≤ (C * Real.exp L) / Real.exp ((a / 2) * L) := div_le_div_of_nonneg_left (mul_nonneg hC (Real.exp_nonneg _)) (Real.exp_pos _) hsP _ = _ := by rw [mul_div_assoc, ← Real.exp_sub]; congr 2; ring have hfourth : R * Real.sqrt (P * U) ≤ Real.sqrt C * Real.exp ((theta + 1 / 2) * L) := by calc _ ≤ Real.exp (theta * L) * Real.sqrt (C * Real.exp L) := mul_le_mul hRhi (Real.sqrt_le_sqrt hPU) (Real.sqrt_nonneg _) (Real.exp_nonneg _) _ = _ := by rw [Real.sqrt_mul hC, sqrt_exp_half, mul_left_comm, ← Real.exp_add] congr 2 ring exact (large_sieve_sqrt_div_expand hP0.le hU0.le hR0).trans (by linarith) end Bounty end section /- Finite coefficient energies from pointwise bounds on positive integer supports. -/ open Finset namespace Bounty theorem positive_nat_finset_card_le_real (S : Finset ℕ) {P : ℝ} (hP : 0 ≤ P) (hpos : ∀ n ∈ S, 0 < n) (hbound : ∀ n ∈ S, (n : ℝ) ≤ P) : (S.card : ℝ) ≤ P := by have hsub : S ⊆ Icc 1 ⌊P⌋₊ := by intro n hn exact mem_Icc.mpr ⟨hpos n hn, Nat.le_floor (hbound n hn)⟩ calc _ ≤ ((Icc 1 ⌊P⌋₊).card : ℝ) := Nat.cast_le.mpr (card_le_card hsub) _ = (⌊P⌋₊ : ℝ) := by simp _ ≤ P := Nat.floor_le hP theorem positive_nat_finset_energy_le (S : Finset ℕ) (a : ℕ → ℂ) {P M : ℝ} (hP : 0 ≤ P) (hpos : ∀ n ∈ S, 0 < n) (hbound : ∀ n ∈ S, (n : ℝ) ≤ P) (ha : ∀ n ∈ S, ‖a n‖ ≤ M) : (∑ n ∈ S, ‖a n‖ ^ 2) ≤ P * M ^ 2 := by calc _ ≤ ∑ _n ∈ S, M ^ 2 := by apply sum_le_sum intro n hn exact pow_le_pow_left₀ (norm_nonneg _) (ha n hn) 2 _ = (S.card : ℝ) * M ^ 2 := by simp _ ≤ P * M ^ 2 := mul_le_mul_of_nonneg_right (positive_nat_finset_card_le_real S hP hpos hbound) (sq_nonneg M) theorem positive_nat_finset_exponential_energy_le (S : Finset ℕ) (a : ℕ → ℂ) {P H L : ℝ} (hP : 0 ≤ P) (hpos : ∀ n ∈ S, 0 < n) (hbound : ∀ n ∈ S, (n : ℝ) ≤ P) (ha : ∀ n ∈ S, ‖a n‖ ≤ Real.exp (H * Real.sqrt L)) : (∑ n ∈ S, ‖a n‖ ^ 2) ≤ P * Real.exp ((2 * H) * Real.sqrt L) := by apply (positive_nat_finset_energy_le S a hP hpos hbound ha).trans_eq rw [pow_two, ← Real.exp_add] congr 2 ring end Bounty end section /- Growth margins and complementary-modulus mass for the final large-sieve summation. -/ open Filter Finset namespace Bounty theorem eventually_const_mul_exp_le_exp {a b : ℝ} (hab : a < b) (C : ℝ) : ∀ᶠ L : ℝ in atTop, C * Real.exp (a * L) ≤ Real.exp (b * L) := by have ht := Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop (sub_pos.mpr hab)) filter_upwards [ht.eventually_ge_atTop C] with L hL calc _ ≤ Real.exp ((b - a) * L) * Real.exp (a * L) := mul_le_mul_of_nonneg_right hL (Real.exp_nonneg _) _ = _ := by rw [← Real.exp_add]; congr 1; ring end Bounty end section /- The raw continuation may observe the auxiliary draw. The exact full event retains that draw, in addition to the original weight, phase and caps. -/ open Finset open scoped Classical namespace Bounty section Full variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → Fin N → ℤ) (target : (g : Fin N) → Fin (S g)ᶜ.card → P g) (H : (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) theorem full_edge_ledger_observed_rows (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ω : ∀ c, A c → ℝ) (m : A (productActiveMemorySplit S B x).1 → Prop) (row : A (productActiveMemorySplit S B x).1 → (g : Fin N) → (GlobalBirthHistoryState (fun p => ZMod (n g p)) → ℂ) → GlobalBirthHistoryState (fun p => ZMod (n g p)) → ℂ) (hrows : ∀ a, m a → ∀ g (K : GlobalBirthHistoryState (fun p => ZMod (n g p)) → ℂ), row a g K (H g, boundedOrderedTupleToFinite (x g).2) = ∑ e : UnrestrictedBoundedEvent (n g) (Δ (productActiveMemorySplit S B x).1 a g) (D (productActiveMemorySplit S B x).1 a g) (S g)ᶜ.card B ((productActiveMemorySplit S B x).2 g), (unrestrictedBoundedEventWeight (n g) (Δ (productActiveMemorySplit S B x).1 a g) (D (productActiveMemorySplit S B x).1 a g) (fun p => β g p / V g) ρ (V g) (S g)ᶜ.card B ((productActiveMemorySplit S B x).2 g) e : ℂ) * globalBirthBoundedEdgePhase (n g) (Δ (productActiveMemorySplit S B x).1 a g) (D (productActiveMemorySplit S B x).1 a g) (S g)ᶜ.card B (target g) (H g) ((productActiveMemorySplit S B x).2 g) e.1 e.2.1 e.2.2.1 e.2.2.2 * K (H g ∪ univ.image (unrestrictedBoundedEventTarget (n g) (Δ (productActiveMemorySplit S B x).1 a g) (D (productActiveMemorySplit S B x).1 a g) (S g)ᶜ.card B ((productActiveMemorySplit S B x).2 g) e).1, boundedOrderedTupleToFinite (unrestrictedBoundedEventTarget (n g) (Δ (productActiveMemorySplit S B x).1 a g) (D (productActiveMemorySplit S B x).1 a g) (S g)ᶜ.card B ((productActiveMemorySplit S B x).2 g) e).2)) (F : A (productActiveMemorySplit S B x).1 → GlobalBirthJointState (fun g p => ZMod (n g p)) → ℂ) : (∑ a : A (productActiveMemorySplit S B x).1, (ω (productActiveMemorySplit S B x).1 a : ℂ) * if m a then jointRawTensorCutoff B (row a) (F a) (fun g => (H g, boundedOrderedTupleToFinite (x g).2)) else 0) = ∑ e : FullActiveEdgeEvent n S B A Δ D x, (fullActiveEdgeEventWeight n S B A Δ D ω (fun g p => β g p / V g) ρ V x e : ℂ) * (if m e.1 then fullEdgeLedgerPhase n S B A Δ D target H x e else 0) * F e.1 (fullEdgeLedgerRawTarget n S B A Δ D H x e) := by rw [Fintype.sum_sigma] apply sum_congr rfl intro a _ by_cases ha : m a · simp only [ha, if_true] rw [joint_raw_tensor_cutoff_edge_events n (Δ (productActiveMemorySplit S B x).1 a) (D (productActiveMemorySplit S B x).1 a) (fun g => (S g)ᶜ.card) B (fun g => ((productActiveMemorySplit S B x).2 g).1) target H (fun g => (x g).2) β ρ V (row a) (hrows a ha)] rw [mul_sum] apply sum_congr rfl intro e _ rw [full_edge_ledger_raw_target_eq] simp only [fullActiveEdgeEventWeight, Complex.ofReal_mul, fullEdgeLedgerPhase, jointStateEdgePhase, mul_assoc] rfl · simp only [ha, if_false, mul_zero, zero_mul, sum_const_zero] end Full end Bounty end section /- A full ledger row may expose an observation of its actual event to its continuation. The event, signed weight and local phase are unchanged. -/ open Finset open scoped Classical namespace Bounty section Full variable {I K O : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def fullMixedObservedRow (observe : (i : Option (I ⊕ K)) → (s : FullMixedLedgerState n (M := M) B) → FullPermutationMixedEvent n S B A Δ D i s.2 → O) (i : Option (I ⊕ K)) (F : O → FullMixedLedgerState n (M := M) B → ℂ) (s : FullMixedLedgerState n (M := M) B) : ℂ := let _ : ∀ (i : Option (I ⊕ K)) x, Fintype (FullPermutationMixedEvent n S B A Δ D i x) := fullPermutationMixedEventFintype n S B A Δ D ∑ e : FullPermutationMixedEvent n S B A Δ D i s.2, (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V i s.2 e : ℂ) * fullMixedLedgerPhase n S B A Δ D edgePhase i s e * F (observe i s e) (fullMixedLedgerTarget n S B A Δ D i s e) end Full end Bounty end section /- Exact observation-aware row identities remain exact after recording any deterministic history update. The update may inspect both source and target states as well as the exposed observation. -/ namespace Bounty end Bounty end section /- Relabeling a finite schedule preserves every dependent event, endpoint and signed weight. Arbitrary whole-path phases are transported through the path equivalence, including their dependence on positions in the schedule. -/ open Finset namespace Bounty section Map variable {I K X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (tag : I → K) def finiteEventPathMapEquiv : ∀ ks x, FiniteEventPath (fun i => E (tag i)) (fun i => target (tag i)) ks x ≃ FiniteEventPath E target (ks.map tag) x | [], _ => Equiv.refl _ | i :: ks, x => Equiv.sigmaCongrRight (fun e : E (tag i) x => finiteEventPathMapEquiv ks (target (tag i) x e)) theorem finite_event_path_map_terminal (ks : List I) (x : X) (p : FiniteEventPath (fun i => E (tag i)) (fun i => target (tag i)) ks x) : finiteEventPathTerminal (fun i => E (tag i)) (fun i => target (tag i)) ks x p = finiteEventPathTerminal E target (ks.map tag) x (finiteEventPathMapEquiv E target tag ks x p) := by induction ks generalizing x with | nil => rfl | cons i ks ih => rcases p with ⟨e, p⟩ exact ih (target (tag i) x e) p theorem finite_event_path_map_weight (w : ∀ k x, E k x → ℝ) (ks : List I) (x : X) (p : FiniteEventPath (fun i => E (tag i)) (fun i => target (tag i)) ks x) : finiteEventPathWeight (fun i => E (tag i)) (fun i => target (tag i)) (fun i => w (tag i)) ks x p = finiteEventPathWeight E target w (ks.map tag) x (finiteEventPathMapEquiv E target tag ks x p) := by induction ks generalizing x with | nil => rfl | cons i ks ih => rcases p with ⟨e, p⟩ exact congrArg (w (tag i) x e * ·) (ih (target (tag i) x e) p) variable [∀ k x, Fintype (E k x)] theorem finite_event_path_action_map (w : ∀ k x, E k x → ℝ) (ks : List I) (phase : ∀ x, FiniteEventPath (fun i => E (tag i)) (fun i => target (tag i)) ks x → ℂ) (F : X → ℂ) : finiteEventPathAction (fun i => E (tag i)) (fun i => target (tag i)) (fun i => w (tag i)) ks phase F = finiteEventPathAction E target w (ks.map tag) (fun x p => phase x ((finiteEventPathMapEquiv E target tag ks x).symm p)) F := by classical funext x let _ := finiteEventPathFintype (fun i => E (tag i)) (fun i => target (tag i)) ks x let _ := finiteEventPathFintype E target (ks.map tag) x unfold finiteEventPathAction rw [← (finiteEventPathMapEquiv E target tag ks x).symm.sum_comp] apply sum_congr rfl intro p _ rw [finite_event_path_map_weight, finite_event_path_map_terminal] simp only [Equiv.apply_symm_apply] end Map end Bounty end section /- Finite label pools bound coherent physical memory. Every phase snapshot has at most one pending state per label, so sufficiently large finite caps can be erased exactly. No bound on unrestricted repeated-label tuples is asserted. -/ open Finset namespace Bounty section Joint variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} variable [∀ g p, AddGroup (R g p)] [∀ g p, Fintype (R g p)] [∀ g p, DecidableEq (R g p)] end Joint end Bounty end section /- A full-path phase matters only on paths with nonzero weight. -/ open Finset Classical namespace Bounty universe uK uX uE end Bounty end section /- Polynomial upper bounds whose eventual threshold is independent of the rough-slot band. -/ open Finset Filter namespace Bounty end Bounty end section /- A uniform logarithmic-conductor bound inside the zero-free half-plane. -/ namespace Bounty open Complex Metric Set OAI.Ostmann /- The zero-free half-plane controls the logarithmic derivative with a fixed interior margin. The conductor enters only through a logarithm. -/ def PrimitiveZeroFreeRightOf (b : ℝ) : Prop := ∀ χ : PrimitiveComplexCharacter, ∀ s : ℂ, b < s.re → χ.L s ≠ 0 theorem character_logDeriv_bound_right_of (b : ℝ) (hb : 7 / 8 ≤ b) (hb1 : b ≤ 1) (hZ : PrimitiveZeroFreeRightOf b) (χ : PrimitiveComplexCharacter) {ε : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) (s : ℂ) (hs : b + ε ≤ s.re) (hs2 : s.re ≤ 2) : ‖logDeriv χ.L s‖ ≤ (36 / ε ^ 2) * Real.log (24 * (χ.modulus : ℝ) * (|s.im| + 2)) := by let c : ℂ := 2 + (s.im : ℂ) * I let R : ℝ := 2 - b - ε / 2 let g : ℂ → ℂ := fun z => χ.L (z + c) let A : ℝ := Real.log (24 * (χ.modulus : ℝ) * (|s.im| + 2)) have hc : c.re = 2 := by simp [c] have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive have hq0 : (0 : ℝ) < χ.modulus := by linarith have hR : 0 < R := by dsimp [R]; linarith have hR2 : R < 2 := by dsimp [R]; linarith have hA : 0 < A := by apply Real.log_pos nlinarith [abs_nonneg s.im] have hg : AnalyticOnNhd ℂ g (ball 0 R) := by intro z hz exact (χ.L_analytic (z + c)).comp (f := fun w : ℂ => w + c) (x := z) (by fun_prop) have hre (z : ℂ) (hz : z ∈ ball 0 R) : b < (z + c).re := by have hn : ‖z‖ < R := by simpa only [mem_ball, dist_zero_right] using hz have hr := (abs_le.mp (abs_re_le_norm z)).1 simp only [add_re, hc] dsimp [R] at hn linarith have hne : ∀ z ∈ ball 0 R, g z ≠ 0 := fun z hz => hZ χ (z + c) (hre z hz) have hcnorm : ‖c‖ ≤ 2 + |s.im| := by calc ‖c‖ ≤ ‖(2 : ℂ)‖ + ‖(s.im : ℂ) * I‖ := norm_add_le _ _ _ = _ := by simp have hnorm (z : ℂ) (hz : z ∈ ball 0 R) : ‖g z‖ ≤ 8 * (χ.modulus : ℝ) * (|s.im| + 2) := by have hn : ‖z‖ < R := by simpa only [mem_ball, dist_zero_right] using hz have hzn : ‖z + c‖ ≤ 2 * (|s.im| + 2) := by have hh := norm_add_le z c linarith [abs_nonneg s.im] have hzr : 1 / 2 ≤ (z + c).re := by linarith [hre z hz] calc ‖g z‖ ≤ ‖z + c‖ * ((χ.modulus : ℝ) + 1) / (z + c).re := χ.L_norm_bound_positive (z + c) (by linarith) _ ≤ (2 * (|s.im| + 2)) * (2 * (χ.modulus : ℝ)) / (1 / 2) := by apply div_le_div₀ (by positivity) _ (by norm_num) hzr exact mul_le_mul hzn (by linarith) (by positivity) (by positivity) _ = _ := by ring have hlog : ∀ z ∈ ball 0 R, Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A := by intro z hz have h0 : 1 / 3 ≤ ‖g 0‖ := by simpa [g] using χ.L_lower_re_two c hc have h0pos : 0 < ‖g 0‖ := by linarith have hzpos : 0 < ‖g z‖ := norm_pos_iff.mpr (hne z hz) rw [← Real.log_div (ne_of_gt hzpos) (ne_of_gt h0pos)] apply Real.log_le_log (div_pos hzpos h0pos) apply (div_le_iff₀ h0pos).mpr have hh := mul_le_mul_of_nonneg_left h0 (show 0 ≤ 24 * (χ.modulus : ℝ) * (|s.im| + 2) by positivity) nlinarith [hnorm z hz] have hw : ‖s - c‖ ≤ R - ε / 2 := by have heq : s - c = ((s.re - 2 : ℝ) : ℂ) := by apply Complex.ext <;> simp [c] rw [heq, norm_real, Real.norm_eq_abs, abs_of_nonpos (by linarith)] dsimp [R] linarith have hb := logDeriv_norm_le_margin_disk g R A (ε / 2) hR hA (by positivity) hg hne hlog (s - c) hw have hcomp : logDeriv g (s - c) = logDeriv χ.L s := by have hh := logDeriv_comp (f := χ.L) (g := fun z : ℂ => z + c) (x := s - c) (χ.L_analytic ((s - c) + c)).differentiableAt (show DifferentiableAt ℂ (fun z : ℂ => z + c) (s - c) by fun_prop) simpa [g, Function.comp_def] using hh rw [hcomp] at hb calc _ ≤ 8 * A * R / (ε / 2) ^ 2 := hb _ ≤ 8 * A * (9 / 8) / (ε / 2) ^ 2 := by apply div_le_div_of_nonneg_right _ (sq_nonneg _) gcongr dsimp [R] linarith _ = _ := by dsimp [A]; field_simp; ring end Bounty end section /- A uniform parametric finite-unsmoothing estimate. -/ namespace Bounty open OAI.Ostmann theorem power_three_scale_le_of_exponent {θ : ℝ} (hθ0 : 0 ≤ θ) (hθ1 : θ ≤ 1) {x y : ℝ} (hx : 0 < x) (hy : 0 ≤ y) (hyx : y ≤ 3 * x) : y ^ θ ≤ 3 * x ^ θ := by have hthree : (3 : ℝ) ^ θ ≤ 3 := by calc _ ≤ (3 : ℝ) ^ (1 : ℝ) := Real.rpow_le_rpow_of_exponent_le (by norm_num) hθ1 _ = _ := Real.rpow_one _ calc _ ≤ (3 * x) ^ θ := Real.rpow_le_rpow hy hyx hθ0 _ = (3 : ℝ) ^ θ * x ^ θ := Real.mul_rpow (by norm_num) hx.le _ ≤ _ := mul_le_mul_of_nonneg_right hthree (Real.rpow_nonneg hx.le _) /- A triangular bound at exponent θ gives a sharp bound at (1+θ)/2. -/ theorem twistedPsi_bound_of_smoothed_exponent {θ : ℝ} (hθ0 : 0 ≤ θ) (hθ1 : θ ≤ 1) {q : ℕ} (χ : DirichletCharacter ℂ q) (hq : 0 < q) {C : ℝ} (hC : 0 < C) (hbound : ∀ y : ℝ, 2 ≤ y → ‖smoothedTwistedPsi χ y‖ ≤ C * y ^ θ * Real.log ((q : ℝ) * y)) {x : ℝ} (hx : 2 ≤ x) : ‖twistedPsi χ x‖ ≤ (28 * C + 6) * x ^ ((1 + θ) / 2) * Real.log ((q : ℝ) * x) := by let p : ℝ := x ^ ((1 + θ) / 2) let m : ℕ := ⌈p⌉₊ let L : ℝ := Real.log ((q : ℝ) * x) have hx0 : 0 < x := by linarith have hq1 : (1 : ℝ) ≤ q := by exact_mod_cast hq have hq0 : (0 : ℝ) < q := by exact_mod_cast hq have hL : 0 ≤ L := Real.log_nonneg (by nlinarith) have hp1 : 1 ≤ p := Real.one_le_rpow (by linarith) (by linarith) have hp0 : 0 < p := by linarith have hpx : p ≤ x := by calc _ ≤ x ^ (1 : ℝ) := Real.rpow_le_rpow_of_exponent_le (by linarith) (by linarith) _ = x := Real.rpow_one _ have hmp : p ≤ (m : ℝ) := Nat.le_ceil p have hm2p : (m : ℝ) ≤ 2 * p := by have hh := Nat.ceil_lt_add_one hp0.le dsimp [m] linarith have hm : 0 < m := Nat.ceil_pos.mpr hp0 have hm0 : 0 < (m : ℝ) := by exact_mod_cast hm have hym : x + (m : ℝ) ≤ 3 * x := by linarith have hy2 : 2 ≤ x + (m : ℝ) := by linarith have hpow := power_three_scale_le_of_exponent hθ0 hθ1 hx0 (by positivity : 0 ≤ x + (m : ℝ)) hym have hlog := log_three_scale_le hq1 hx (by positivity : 0 < x + (m : ℝ)) hym have hlog0 : 0 ≤ Real.log ((q : ℝ) * (x + (m : ℝ))) := Real.log_nonneg (by nlinarith) have hsmy : ‖smoothedTwistedPsi χ (x + m)‖ ≤ 9 * C * x ^ θ * L := by calc _ ≤ C * (x + m) ^ θ * Real.log ((q : ℝ) * (x + m)) := hbound _ hy2 _ ≤ C * (3 * x ^ θ) * (3 * L) := by gcongr _ = _ := by ring have hsmx : ‖smoothedTwistedPsi χ x‖ ≤ C * x ^ θ * L := hbound x hx have hp2 : x * x ^ θ = p ^ 2 := by dsimp [p] calc _ = x ^ (1 : ℝ) * x ^ θ := by rw [Real.rpow_one] _ = x ^ ((1 : ℝ) + θ) := (Real.rpow_add hx0 _ _).symm _ = x ^ (((1 + θ) / 2) * 2) := by congr 1; ring _ = _ := by rw [Real.rpow_mul hx0.le, Real.rpow_two] have hpair : (x + m) * ‖smoothedTwistedPsi χ (x + m)‖ + x * ‖smoothedTwistedPsi χ x‖ ≤ 28 * C * p ^ 2 * L := by calc _ ≤ (3 * x) * (9 * C * x ^ θ * L) + x * (C * x ^ θ * L) := by gcongr _ = 28 * C * (x * x ^ θ) * L := by ring _ = _ := by rw [hp2] have hlogy : Real.log (x + (m : ℝ)) ≤ 3 * L := by apply le_trans _ hlog apply Real.log_le_log (by positivity) nlinarith have hpp : p ^ 2 ≤ p * m := by nlinarith have hmp2 : (m : ℝ) ^ 2 ≤ 2 * p * m := by nlinarith calc _ ≤ ((x + m) * ‖smoothedTwistedPsi χ (x + m)‖ + x * ‖smoothedTwistedPsi χ x‖ + (m : ℝ) ^ 2 * Real.log (x + m)) / m := riesz_unsmoothing_bound χ hx0 hm _ ≤ (28 * C + 6) * p * L := by apply (div_le_iff₀ hm0).mpr calc _ ≤ 28 * C * p ^ 2 * L + (m : ℝ) ^ 2 * (3 * L) := by gcongr _ = 28 * C * p ^ 2 * L + 3 * (m : ℝ) ^ 2 * L := by ring _ ≤ 28 * C * (p * m) * L + 3 * (2 * p * m) * L := by gcongr _ = _ := by ring end Bounty end section /- Actual Hoeffding components omit their missing probes and all averaged tails. -/ namespace Bounty open Finset open scoped Classical section variable {I : Type*} [sharedInstance1 : DecidableEq I] {X : I → Type*} [sharedInstance3 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) include I sharedInstance1 X sharedInstance3 μ theorem finite_coordinate_average_component_commute (i : I) (S : Finset I) (is : List I) (f : (∀ j, X j) → ℂ) : finiteCoordinateAverage μ i (finiteCoordinateComponent μ S is f) = finiteCoordinateComponent μ S is (finiteCoordinateAverage μ i f) := by induction is with | nil => rfl | cons j js ih => simp only [finiteCoordinateComponent, finite_coordinate_average_choice, ih] theorem finite_average_fixed_invariant (i : I) (f : (∀ j, X j) → ℂ) (hf : finiteCoordinateAverage μ i f = f) (x : ∀ j, X j) (v : X i) : f (Function.update x i v) = f x := by rw [← hf] exact finite_coordinate_average_invariant μ i f x v theorem finite_component_missing_invariant (hmass : ∀ i, ∑ v, μ i v = 1) (U S : Finset I) (i : I) (hi : i ∈ U \ S) (f : (∀ j, X j) → ℂ) (x : ∀ j, X j) (v : X i) : finiteCoordinateComponent μ S U.toList f (Function.update x i v) = finiteCoordinateComponent μ S U.toList f x := by apply finite_average_fixed_invariant μ i rw [finite_coordinate_component_average μ hmass S U.toList i (mem_toList.mpr (mem_sdiff.mp hi).1), if_neg (mem_sdiff.mp hi).2] theorem finite_component_tail_invariant (hmass : ∀ i, ∑ v, μ i v = 1) (U S tail : Finset I) (i : I) (hi : i ∈ tail) (f : (∀ j, X j) → ℂ) (x : ∀ j, X j) (v : X i) : finiteCoordinateComponent μ S U.toList (finiteCoordinateComponent μ ∅ tail.toList f) (Function.update x i v) = finiteCoordinateComponent μ S U.toList (finiteCoordinateComponent μ ∅ tail.toList f) x := by apply finite_average_fixed_invariant μ i rw [finite_coordinate_average_component_commute, finite_coordinate_component_average μ hmass ∅ tail.toList i (mem_toList.mpr hi)] simp end theorem finite_function_eq_of_coordinate_invariance {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} {Y : Type*} (kept : Finset I) (f : (∀ i, X i) → Y) (hf : ∀ i ∉ kept, ∀ x v, f (Function.update x i v) = f x) (x y : ∀ i, X i) (hxy : ∀ i ∈ kept, x i = y i) : f x = f y := by have hmain (s : Finset I) : ∀ x y : ∀ i, X i, (∀ i ∈ kept, x i = y i) → (∀ i ∉ s, x i = y i) → f x = f y := by induction s using Finset.induction with | empty => intro x y _ hout have he : x = y := funext (fun i => hout i (by simp)) rw [he] | @insert i s hi ih => intro x y hkeep hout have hfi : f (Function.update x i (y i)) = f x := by by_cases hik : i ∈ kept · rw [← hkeep i hik, Function.update_eq_self] · exact hf i hik x (y i) rw [← hfi] apply ih · intro j hj by_cases hji : j = i · subst j exact Function.update_self _ _ _ · rw [Function.update_of_ne hji] exact hkeep j hj · intro j hjs by_cases hji : j = i · subst j exact Function.update_self _ _ _ · rw [Function.update_of_ne hji] exact hout j (by simp [hji, hjs]) exact hmain univ x y hxy (by simp) end Bounty end section /- Normalized independent tails leave energies and pairings unchanged. -/ open Finset open scoped Classical namespace Bounty def finiteFourPackEquiv {C A B T : Type*} : (C × A × B × T) ≃ ((C × A × B) × T) where toFun p := ((p.1, p.2.1, p.2.2.1), p.2.2.2) invFun p := (p.1.1, p.1.2.1, p.1.2.2, p.2) left_inv := by rintro ⟨c, a, b, t⟩; rfl right_inv := by rintro ⟨⟨c, a, b⟩, t⟩; rfl theorem finite_independent_tail_energy {X T : Type*} [Fintype X] [Fintype T] (w : X → ℝ) (ν : T → ℝ) (hν : ∑ t, ν t = 1) (f : X → ℂ) : finiteWeightedEnergy (fun p : X × T => w p.1 * ν p.2) (fun p => f p.1) = finiteWeightedEnergy w f := by simp only [finiteWeightedEnergy, Fintype.sum_prod_type] apply sum_congr rfl intro x _ calc _ = (w x * ‖f x‖ ^ 2) * ∑ t, ν t := by rw [mul_sum] apply sum_congr rfl intro t _ ring _ = _ := by rw [hν, mul_one] theorem finite_independent_tail_raw_pairing {X T : Type*} [Fintype X] [Fintype T] (w : X → ℝ) (ν : T → ℝ) (hν : ∑ t, ν t = 1) (k f g : X → ℂ) : cleanRawPairing (fun p : X × T => w p.1 * ν p.2) (fun p => k p.1) (fun p => f p.1) (fun p => g p.1) = cleanRawPairing w k f g := by have hνc : (∑ t, (ν t : ℂ)) = 1 := by exact_mod_cast hν simp only [cleanRawPairing, Fintype.sum_prod_type] apply sum_congr rfl intro x _ calc _ = ((w x : ℂ) * (starRingEnd ℂ) (f x) * g x * k x) * ∑ t, (ν t : ℂ) := by rw [mul_sum] apply sum_congr rfl intro t _ push_cast ring _ = _ := by rw [hνc, mul_one] theorem finite_independent_tail_kernel_pairing {X T : Type*} [Fintype X] [Fintype T] (w : X → ℝ) (ν : T → ℝ) (hν : ∑ t, ν t = 1) (K : X → X → ℂ) (f g : X → ℂ) : cleanKernelPairing (fun p : X × T => w p.1 * ν p.2) (fun (p q : X × T) => (ν q.2 : ℂ) * K p.1 q.1) (fun p => f p.1) (fun p => g p.1) = cleanKernelPairing w K f g := by have hνc : (∑ t, (ν t : ℂ)) = 1 := by exact_mod_cast hν have hin (x y : X) (t : T) : (∑ u, ((w x * ν t : ℝ) : ℂ) * (starRingEnd ℂ) (f x) * ((ν u : ℂ) * K x y) * g y) = (ν t : ℂ) * ((w x : ℂ) * (starRingEnd ℂ) (f x) * K x y * g y) := by calc _ = ((ν t : ℂ) * ((w x : ℂ) * (starRingEnd ℂ) (f x) * K x y * g y)) * ∑ u, (ν u : ℂ) := by rw [mul_sum] apply sum_congr rfl intro u _ push_cast ring _ = _ := by rw [hνc, mul_one] simp only [cleanKernelPairing, Fintype.sum_prod_type] simp_rw [hin, ← mul_sum, ← sum_mul, hνc, one_mul] end Bounty end section /- Averaging actual shared-label slice errors with their conditional energies. -/ namespace Bounty open Finset open scoped Classical section variable {C : Type*} [sharedInstance1 : Fintype C] (ρ A B : C → ℝ) (hρ : ∀ c, 0 ≤ ρ c) (hA : ∀ c, 0 ≤ A c) (hB : ∀ c, 0 ≤ B c) include C sharedInstance1 ρ A B hρ hA hB theorem finite_weighted_slice_sqrt_cauchy : (∑ c, ρ c * Real.sqrt (A c) * Real.sqrt (B c)) ≤ Real.sqrt (∑ c, ρ c * A c) * Real.sqrt (∑ c, ρ c * B c) := by have h := Real.sum_sqrt_mul_sqrt_le (univ : Finset C) (fun c => mul_nonneg (hρ c) (hA c)) (fun c => mul_nonneg (hρ c) (hB c)) have he (c : C) : Real.sqrt (ρ c * A c) * Real.sqrt (ρ c * B c) = ρ c * Real.sqrt (A c) * Real.sqrt (B c) := by rw [Real.sqrt_mul (hρ c), Real.sqrt_mul (hρ c)] calc _ = (Real.sqrt (ρ c) * Real.sqrt (ρ c)) * Real.sqrt (A c) * Real.sqrt (B c) := by ring _ = _ := by rw [Real.mul_self_sqrt (hρ c)] simpa only [he] using h theorem finite_weighted_slice_error_bound (err : C → ℂ) (ε : ℝ) (hε : 0 ≤ ε) (herr : ∀ c, ‖err c‖ ≤ ε * Real.sqrt (A c) * Real.sqrt (B c)) : ‖∑ c, (ρ c : ℂ) * err c‖ ≤ ε * Real.sqrt (∑ c, ρ c * A c) * Real.sqrt (∑ c, ρ c * B c) := by calc _ ≤ ∑ c, ‖(ρ c : ℂ) * err c‖ := norm_sum_le _ _ _ = ∑ c, ρ c * ‖err c‖ := by apply sum_congr rfl intro c _ rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hρ c)] _ ≤ ∑ c, ρ c * (ε * Real.sqrt (A c) * Real.sqrt (B c)) := sum_le_sum (fun c _ => mul_le_mul_of_nonneg_left (herr c) (hρ c)) _ = ε * (∑ c, ρ c * Real.sqrt (A c) * Real.sqrt (B c)) := by rw [mul_sum] apply sum_congr rfl intro c _ ring _ ≤ _ := by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (finite_weighted_slice_sqrt_cauchy ρ A B hρ hA hB) hε end noncomputable def finiteTwoKernelPairingError {A B : Type*} [Fintype A] [Fintype B] (μ : A → ℝ) (ν : B → ℝ) (KA : A → A → ℂ) (KB : B → B → ℂ) (phase : A → B → ℂ) (f : A → ℂ) (g : B → ℂ) : ℂ := ∑ a, ∑ b, ((μ a * ν b : ℝ) : ℂ) * ((phase a b - finiteTwoKernelAverage μ ν KA KB a b phase) * f a * g b) theorem finite_shared_two_kernel_error_bound {C A B : Type*} [Fintype C] [Fintype A] [Fintype B] (ρ : C → ℝ) (μ : A → ℝ) (ν : B → ℝ) (hρ : ∀ c, 0 ≤ ρ c) (hμ : ∀ a, 0 ≤ μ a) (hν : ∀ b, 0 ≤ ν b) (KA : A → A → ℂ) (KB : B → B → ℂ) (phase : C → A → B → ℂ) (f : C → A → ℂ) (g : C → B → ℂ) (ε : ℝ) (hε : 0 ≤ ε) (herr : ∀ c, ‖finiteTwoKernelPairingError μ ν KA KB (phase c) (f c) (g c)‖ ≤ ε * Real.sqrt (finiteWeightedEnergy μ (f c)) * Real.sqrt (finiteWeightedEnergy ν (g c))) : ‖∑ c, (ρ c : ℂ) * finiteTwoKernelPairingError μ ν KA KB (phase c) (f c) (g c)‖ ≤ ε * Real.sqrt (∑ c, ρ c * finiteWeightedEnergy μ (f c)) * Real.sqrt (∑ c, ρ c * finiteWeightedEnergy ν (g c)) := by exact finite_weighted_slice_error_bound ρ (fun c => finiteWeightedEnergy μ (f c)) (fun c => finiteWeightedEnergy ν (g c)) hρ (fun c => sum_nonneg (fun a _ => mul_nonneg (hμ a) (sq_nonneg _))) (fun c => sum_nonneg (fun b _ => mul_nonneg (hν b) (sq_nonneg _))) _ ε hε herr end Bounty end section /- Exact finite pairing and energy transport along a state equivalence. -/ namespace Bounty open Finset section variable {X Y : Type*} [sharedInstance1 : Fintype X] [sharedInstance2 : Fintype Y] (E : X ≃ Y) (w : X → ℝ) include X Y sharedInstance1 sharedInstance2 E w theorem clean_raw_pairing_equiv (k f g : X → ℂ) : cleanRawPairing w k f g = cleanRawPairing (fun y => w (E.symm y)) (fun y => k (E.symm y)) (fun y => f (E.symm y)) (fun y => g (E.symm y)) := by exact (E.symm.sum_comp (fun x => (w x : ℂ) * (starRingEnd ℂ) (f x) * g x * k x)).symm theorem clean_kernel_pairing_equiv (K : X → X → ℂ) (f g : X → ℂ) : cleanKernelPairing w K f g = cleanKernelPairing (fun y => w (E.symm y)) (fun y z => K (E.symm y) (E.symm z)) (fun y => f (E.symm y)) (fun y => g (E.symm y)) := by unfold cleanKernelPairing rw [← E.symm.sum_comp] apply sum_congr rfl intro y _ exact (E.symm.sum_comp (fun x => (w (E.symm y) : ℂ) * (starRingEnd ℂ) (f (E.symm y)) * K (E.symm y) x * g x)).symm theorem finite_weighted_energy_equiv (f : X → ℂ) : finiteWeightedEnergy w f = finiteWeightedEnergy (fun y => w (E.symm y)) (fun y => f (E.symm y)) := by exact (E.symm.sum_comp (fun x => w x * ‖f x‖ ^ 2)).symm end end Bounty end section /- Uniform ordinary prime-character cancellation on the wider interval (y/4,5y], under the same explicit primitive zero-free hypothesis. -/ open Finset Filter open scoped Topology namespace Bounty theorem eventually_wide_ambient_prime_cancellation (hZ : PrimitiveZeroFreeHalfPlane) {δ σ : ℝ} (hδ : 0 < δ) (hσ : 0 < σ) : ∀ᶠ y : ℝ in atTop, ∀ L : ℕ, 0 < L → Real.log (L : ℝ) ≤ y ^ δ * Real.log (5 * y) → ∀ χ : DirichletCharacter ℂ L, χ ≠ 1 → ‖∑ p ∈ primeBand (y / 4) (5 * y), χ (p : ZMod L)‖ ≤ y ^ ((31 : ℝ) / 32 + 2 * δ + σ) := by obtain ⟨C, hC, hbound⟩ := ordinary_prime_band_product_interval_bound hZ let A : ℝ := 20 * C / (4 : ℝ) ^ (-(1 : ℝ) / 32) filter_upwards [eventually_log_natLog_le_rpow δ hδ, eventually_const_le_mul_rpow hσ (show (0 : ℝ) < 1 by norm_num) A, eventually_ge_atTop (4 * Real.exp 1), eventually_ge_atTop (8 : ℝ)] with y hlog hA hyexp hy8 have hy0 : 0 < y := by linarith have hy1 : 1 ≤ y := by linarith have ha2 : 2 ≤ y / 4 := by linarith have ha0 : 0 < y / 4 := by positivity have hb0 : 0 ≤ 5 * y := by positivity have hden : 1 ≤ Real.log (y / 4) := by calc 1 = Real.log (Real.exp 1) := (Real.log_exp 1).symm _ ≤ Real.log (y / 4) := Real.log_le_log (Real.exp_pos _) (by linarith) have hden0 : 0 < Real.log (y / 4) := by linarith have hpow : 1 ≤ y ^ (2 * δ) := Real.one_le_rpow hy1 (by linarith) intro L hL hLlog χ hχ have hL0 : 0 ≤ Real.log (L : ℝ) := Real.log_nonneg (by exact_mod_cast hL) have hLpow : Real.log (L : ℝ) ≤ y ^ (2 * δ) := by simpa only [two_mul] using (hlog L hLlog).1 have hfrac : Real.log (L : ℝ) / Real.log (y / 4) ≤ y ^ (2 * δ) := by apply le_trans _ hLpow apply (div_le_iff₀ hden0).mpr exact le_mul_of_one_le_right hL0 hden have hfactor : 1 + Real.log (L : ℝ) / Real.log (y / 4) ≤ 2 * y ^ (2 * δ) := by linarith have hfilter : (primeBand (y / 4) (5 * y)).filter (fun p : ℕ => (0 : ℝ) < 1 * (p : ℝ) ∧ 1 * (p : ℝ) ≤ 5 * y) = primeBand (y / 4) (5 * y) := by apply filter_eq_self.mpr intro p hp have hp' := (mem_primeBand_iff ha0.le hb0 p).mp hp simpa only [one_mul] using And.intro (show (0 : ℝ) < p by exact_mod_cast hp'.1.pos) hp'.2.2 have hbasic := hbound L hL χ hχ (y / 4) (5 * y) 1 0 (5 * y) ha2 hb0 (by norm_num) (by norm_num) hb0 rw [hfilter] at hbasic calc _ ≤ 2 * (5 * y) * C * (y / 4) ^ (-(1 : ℝ) / 32) * (1 + Real.log (L : ℝ) / Real.log (y / 4)) := hbasic _ ≤ 2 * (5 * y) * C * (y / 4) ^ (-(1 : ℝ) / 32) * (2 * y ^ (2 * δ)) := mul_le_mul_of_nonneg_left hfactor (by positivity) _ = A * y ^ ((31 : ℝ) / 32 + 2 * δ) := by rw [Real.div_rpow hy0.le (by norm_num)] have h31 : y ^ ((31 : ℝ) / 32) = y * y ^ (-(1 : ℝ) / 32) := by rw [show (31 : ℝ) / 32 = 1 + (-(1 : ℝ) / 32) by norm_num, Real.rpow_add hy0, Real.rpow_one] rw [Real.rpow_add hy0, h31] dsimp only [A] ring _ ≤ y ^ σ * y ^ ((31 : ℝ) / 32 + 2 * δ) := mul_le_mul_of_nonneg_right (by simpa only [one_mul] using hA) (by positivity) _ = y ^ ((31 : ℝ) / 32 + 2 * δ + σ) := by rw [← Real.rpow_add hy0] congr 1 ring end Bounty end section /- An explicit even sieve order with sublinear logarithmic level. -/ open Filter namespace Bounty noncomputable def roughCellSieveOrder (L : ℝ) : ℕ := 2 * ⌈L^(1/8 : ℝ)⌉₊ theorem rough_cell_sieve_order_even (L : ℝ) : Even (roughCellSieveOrder L) := by exact ⟨⌈L^(1/8 : ℝ)⌉₊, by simp only [roughCellSieveOrder, two_mul]⟩ theorem rough_cell_sieve_order_bounds {L : ℝ} (hL : 1 ≤ L) : 1 ≤ roughCellSieveOrder L ∧ L^(1/8 : ℝ) ≤ (roughCellSieveOrder L : ℝ) ∧ (roughCellSieveOrder L : ℝ) ≤ 4*L^(1/8 : ℝ) := by have hp : 1 ≤ L^(1/8 : ℝ) := Real.one_le_rpow hL (by norm_num) have hceil : 1 ≤ ⌈L^(1/8 : ℝ)⌉₊ := Nat.one_le_ceil_iff.mpr (zero_lt_one.trans_le hp) have hlower := Nat.le_ceil (L^(1/8 : ℝ)) have hupper := Nat.ceil_lt_add_one (zero_le_one.trans hp) constructor · unfold roughCellSieveOrder omega · simp only [roughCellSieveOrder, Nat.cast_mul, Nat.cast_ofNat] constructor <;> linarith theorem rough_cell_sieve_order_exponential_le {L : ℝ} (hL : 1 ≤ L) : Real.exp (-(roughCellSieveOrder L : ℝ)) ≤ Real.exp (-L^(1/8 : ℝ)) := by exact Real.exp_le_exp.mpr (neg_le_neg (rough_cell_sieve_order_bounds hL).2.1) theorem eventually_rough_cell_sieve_level_le {a : ℝ} (ha : 0 < a) : ∀ᶠ L : ℝ in atTop, (Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ) + 2) ≤ Real.exp ((a/2)*L) := by have hlevel := eventually_mul_rpow_log_add_le_rpow (by norm_num : (0 : ℝ) < 1) (by norm_num : (5/8 : ℝ) < 1) (half_pos ha) 18 0 filter_upwards [hlevel, eventually_ge_atTop (1 : ℝ), Real.tendsto_log_atTop.eventually (eventually_ge_atTop (1 : ℝ))] with L hlevelL hL hlog have hL0 : 0 < L := zero_lt_one.trans_le hL have hp : 1 ≤ L^(1/8 : ℝ) := Real.one_le_rpow hL (by norm_num) have horder := (rough_cell_sieve_order_bounds hL).2.2 have horder' : 4*(roughCellSieveOrder L : ℝ) + 2 ≤ 18*L^(1/8 : ℝ) := by linarith have hpow : Real.sqrt L * L^(1/8 : ℝ) = L^(5/8 : ℝ) := by rw [Real.sqrt_eq_rpow, ← Real.rpow_add hL0] norm_num have hsmall : 18*L^(5/8 : ℝ) ≤ (a/2)*L := by have hm := le_mul_of_one_le_right (show 0 ≤ 18*L^(5/8 : ℝ) by positivity) hlog simp only [add_zero, Real.rpow_one] at hlevelL exact hm.trans hlevelL rw [← Real.exp_mul] apply Real.exp_le_exp.mpr calc Real.sqrt L * (4*(roughCellSieveOrder L : ℝ) + 2) ≤ Real.sqrt L * (18*L^(1/8 : ℝ)) := mul_le_mul_of_nonneg_left horder' (Real.sqrt_nonneg L) _ = 18*L^(5/8 : ℝ) := by rw [mul_left_comm, hpow] _ ≤ (a/2)*L := hsmall theorem eventually_rough_cell_sieve_parameters {a : ℝ} (ha : 0 < a) : ∀ᶠ L : ℝ in atTop, 1 ≤ roughCellSieveOrder L ∧ Even (roughCellSieveOrder L) ∧ 1 < Real.exp (Real.sqrt L) ∧ (Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ) + 2) ≤ Real.exp ((a/2)*L) ∧ Real.exp (-(roughCellSieveOrder L : ℝ)) ≤ Real.exp (-L^(1/8 : ℝ)) := by filter_upwards [eventually_rough_cell_sieve_level_le ha, eventually_ge_atTop (1 : ℝ)] with L hlevel hL exact ⟨(rough_cell_sieve_order_bounds hL).1, rough_cell_sieve_order_even L, Real.one_lt_exp_iff.mpr (Real.sqrt_pos.mpr (zero_lt_one.trans_le hL)), hlevel, rough_cell_sieve_order_exponential_le hL⟩ end Bounty end section /- A two-sided rough-integer count with real endpoints and a uniform error. -/ open Finset namespace Bounty theorem floor_interval_length_error_le_one {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) : |((⌊b⌋₊ : ℝ) - ⌊a⌋₊) - (b - a)| ≤ 1 := by have hfa := Nat.floor_le ha have hfb := Nat.floor_le hb have hla := Nat.lt_floor_add_one a have hlb := Nat.lt_floor_add_one b apply abs_le.mpr constructor <;> linarith theorem finite_prime_avoidance_product_le_one (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) : (∏ p ∈ P, (1 - 1 / (p : ℝ))) ≤ 1 := by apply prod_le_one₀ · intro p hp have hp1 : (1 : ℝ) ≤ p := by exact_mod_cast (hP p hp).one_le exact sub_nonneg.mpr ((div_le_one (by linarith)).mpr hp1) · intro p hp have hp0 : (0 : ℝ) ≤ p := Nat.cast_nonneg p have := div_nonneg (by norm_num : (0 : ℝ) ≤ 1) hp0 linarith theorem exists_real_rough_integer_interval_count : ∃ K : ℝ, 0 < K ∧ ∀ {a b z : ℝ} {h : ℕ}, 0 ≤ a → a ≤ b → 1 < z → 1 ≤ h → Even h → |((roughBand a b z).card : ℝ) - (b - a) * (∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ)))| ≤ K * ((b - a) * (∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ))) * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2)) := by obtain ⟨K, hK, hcount⟩ := exists_rough_integer_interval_count refine ⟨K + 2, by linarith, ?_⟩ intro a b z h ha hab hz hh heven have hbase := hcount ⌊a⌋₊ ⌊b⌋₊ hz (Nat.floor_mono hab) hh heven let V := ∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ)) let D := z^(4 * (h : ℝ) + 2) have hV0 : 0 ≤ V := (finite_prime_avoidance_product_pos _ (fun _ hp => small_prime_pool_prime hp)).le have hV1 : V ≤ 1 := finite_prime_avoidance_product_le_one _ (fun _ hp => small_prime_pool_prime hp) have hD : 1 ≤ D := Real.one_le_rpow hz.le (by positivity) have he0 : 0 ≤ Real.exp (-(h : ℝ)) := Real.exp_nonneg _ have he1 : Real.exp (-(h : ℝ)) ≤ 1 := Real.exp_le_one_iff.mpr (neg_nonpos.mpr (Nat.cast_nonneg h)) have hlen := floor_interval_length_le (a := a) (ha.trans hab) have herr := floor_interval_length_error_le_one ha (ha.trans hab) have hchange : |(((⌊b⌋₊ : ℝ) - ⌊a⌋₊) - (b - a)) * V| ≤ 1 := by rw [abs_mul, abs_of_nonneg hV0] exact (mul_le_mul_of_nonneg_right herr hV0).trans (by simpa using hV1) change |((roughBand a b z).card : ℝ) - ((⌊b⌋₊ : ℝ) - ⌊a⌋₊) * V| ≤ ((⌊b⌋₊ : ℝ) - ⌊a⌋₊) * V * K * Real.exp (-(h : ℝ)) + D at hbase have htriangle := abs_add_le (((roughBand a b z).card : ℝ) - ((⌊b⌋₊ : ℝ) - ⌊a⌋₊) * V) ((((⌊b⌋₊ : ℝ) - ⌊a⌋₊) - (b - a)) * V) have hid : (((roughBand a b z).card : ℝ) - ((⌊b⌋₊ : ℝ) - ⌊a⌋₊) * V) + ((((⌊b⌋₊ : ℝ) - ⌊a⌋₊) - (b - a)) * V) = ((roughBand a b z).card : ℝ) - (b - a) * V := by ring rw [hid] at htriangle have hmain0 : 0 ≤ (b - a) * V * Real.exp (-(h : ℝ)) := by positivity have hVe : V * Real.exp (-(h : ℝ)) ≤ 1 := (mul_le_mul hV1 he1 he0 (by norm_num)).trans (by norm_num) have hlength := mul_le_mul_of_nonneg_right hlen (show 0 ≤ V * K * Real.exp (-(h : ℝ)) by positivity) have hsmall := mul_le_mul_of_nonneg_left hVe hK.le have hKD := mul_le_mul_of_nonneg_left hD hK.le change |((roughBand a b z).card : ℝ) - (b - a) * V| ≤ (K + 2) * ((b - a) * V * Real.exp (-(h : ℝ)) + D) nlinarith end Bounty end section /- Exponential sieve levels fit below an integer cutoff with a fixed exponent gap. -/ open Filter namespace Bounty theorem eventually_exp_le_floor_exp {a theta : ℝ} (ha : 0 ≤ a) (hat : a < theta) : ∀ᶠ L : ℝ in atTop, Real.exp (a * L) ≤ (⌊Real.exp (theta * L)⌋₊ : ℝ) := by have hgap : 0 < theta - a := sub_pos.mpr hat filter_upwards [eventually_ge_atTop (0 : ℝ), eventually_ge_atTop (Real.log 2 / (theta - a))] with L hL hLgap have hA : 1 ≤ Real.exp (a * L) := Real.one_le_exp (mul_nonneg ha hL) have hB : 2 ≤ Real.exp ((theta - a) * L) := by calc _ = Real.exp (Real.log 2) := (Real.exp_log (by norm_num)).symm _ ≤ _ := Real.exp_le_exp.mpr (by have h := (div_le_iff₀ hgap).mp hLgap nlinarith only [h]) have hexp : Real.exp (theta * L) = Real.exp (a * L) * Real.exp ((theta - a) * L) := by rw [← Real.exp_add] congr 1 ring have hsize : Real.exp (a * L) + 1 ≤ Real.exp (theta * L) := by rw [hexp] have h := mul_le_mul_of_nonneg_left hB (Real.exp_pos (a * L)).le nlinarith only [h, hA] have hfloor := Nat.sub_one_lt_floor (Real.exp (theta * L)) linarith only [hsize, hfloor] theorem floor_exp_mul_le_exp {theta L : ℝ} (htheta : theta ≤ 1) (hL : 0 ≤ L) : (⌊Real.exp (theta * L)⌋₊ : ℝ) ≤ Real.exp L := by apply (Nat.floor_le (Real.exp_pos _).le).trans apply Real.exp_le_exp.mpr nlinarith only [htheta, hL] theorem eventually_candidate_sieve_scale {b theta : ℝ} (hb : 0 < b) (h : ℕ) (hlevel : b * (4 * (h : ℝ) + 2) < theta) (htheta : theta ≤ 1) : ∀ᶠ L : ℝ in atTop, 1 < Real.exp (b * L) ∧ (Real.exp (b * L)) ^ (4 * (h : ℝ) + 2) ≤ (⌊Real.exp (theta * L)⌋₊ : ℝ) ∧ (⌊Real.exp (theta * L)⌋₊ : ℝ) ≤ Real.exp L := by have ha : 0 ≤ b * (4 * (h : ℝ) + 2) := by positivity filter_upwards [eventually_exp_le_floor_exp ha hlevel, eventually_gt_atTop (0 : ℝ)] with L hcut hL refine ⟨Real.one_lt_exp_iff.mpr (mul_pos hb hL), ?_, floor_exp_mul_le_exp htheta hL.le⟩ calc _ = Real.exp ((b * (4 * (h : ℝ) + 2)) * L) := by rw [← Real.exp_mul] congr 1 ring _ ≤ _ := hcut theorem eventually_candidate_midpoint_sieve_scale {b : ℝ} (hb : 0 < b) (h : ℕ) (hlevel : b * (4 * (h : ℝ) + 2) < 1/2) : ∀ᶠ L : ℝ in atTop, 1 < Real.exp (b * L) ∧ (Real.exp (b * L)) ^ (4 * (h : ℝ) + 2) ≤ (⌊Real.exp (((b * (4 * (h : ℝ) + 2) + 1/2) / 2) * L)⌋₊ : ℝ) ∧ (⌊Real.exp (((b * (4 * (h : ℝ) + 2) + 1/2) / 2) * L)⌋₊ : ℝ) ≤ Real.exp L := by apply eventually_candidate_sieve_scale hb h · linarith only [hlevel] · linarith only [hlevel] end Bounty end section /- The exact predecessor avoidance product and absorption of the principal distribution error. -/ open Finset Filter namespace Bounty noncomputable def shiftedPrimeAvoidanceProduct (z : ℝ) : ℝ := ∏ p ∈ (primeBand 0 z).erase 2, (1 - 1 / ((p : ℝ) - 1)) theorem shifted_prime_avoidance_product_pos (z : ℝ) : 0 < shiftedPrimeAvoidanceProduct z := by apply finite_odd_prime_predecessor_avoidance_product_pos · intro p hp exact small_prime_pool_prime (mem_of_mem_erase hp) · intro p hp exact (mem_erase.mp hp).1 theorem shifted_prime_avoidance_product_lower {z : ℝ} (hz : 1 ≤ z) : 1 / ((4 * primeEulerProductUpperConstant) * Real.log (2 * z)) ≤ shiftedPrimeAvoidanceProduct z := by apply finite_odd_prime_predecessor_avoidance_product_lower · intro p hp exact small_prime_pool_prime (mem_of_mem_erase hp) · intro p hp exact (mem_erase.mp hp).1 · exact hz · intro p hp exact small_prime_pool_le (zero_le_one.trans hz) (mem_of_mem_erase hp) theorem eventually_shifted_avoidance_absorbs_power {b : ℝ} (hb : 0 < b) (A : ℝ) (hA : 0 ≤ A) : ∀ᶠ L : ℝ in atTop, A * L^(-18 : ℝ) ≤ shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * L^(-16 : ℝ) := by let T : ℝ := (4 * primeEulerProductUpperConstant) * (1 + b) have hT : 0 < T := by dsimp [T]; positivity [primeEulerProductUpperConstant_pos] filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (Real.log 2), eventually_ge_atTop (T * A)] with L hL1 hLlog hLA have hL : 0 < L := zero_lt_one.trans_le hL1 have hz : 1 ≤ Real.exp (b * L) := Real.one_le_exp (by positivity) have hprod := shifted_prime_avoidance_product_lower hz have hprod0 := (shifted_prime_avoidance_product_pos (Real.exp (b * L))).le have hden : 0 < (4 * primeEulerProductUpperConstant) * Real.log (2 * Real.exp (b * L)) := by apply mul_pos (by positivity [primeEulerProductUpperConstant_pos]) exact Real.log_pos (by nlinarith) have hlog : Real.log (2 * Real.exp (b * L)) ≤ (1 + b) * L := by rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) (Real.exp_ne_zero _), Real.log_exp] nlinarith only [hLlog] have hdenle : (4 * primeEulerProductUpperConstant) * Real.log (2 * Real.exp (b * L)) ≤ T * L := by calc _ ≤ (4 * primeEulerProductUpperConstant) * ((1 + b) * L) := mul_le_mul_of_nonneg_left hlog (by positivity [primeEulerProductUpperConstant_pos]) _ = _ := by dsimp [T]; ring have hone : 1 ≤ shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * (T * L) := ((div_le_iff₀ hden).mp hprod).trans (mul_le_mul_of_nonneg_left hdenle hprod0) have hAprod : A ≤ shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * L^2 := by have h1 := mul_le_mul_of_nonneg_left hone hA have h2 := mul_le_mul_of_nonneg_left hLA (mul_nonneg hprod0 hL.le) nlinarith only [h1, h2] have hpow : L^2 * L^(-18 : ℝ) = L^(-16 : ℝ) := by rw [← Real.rpow_two, ← Real.rpow_add hL] norm_num calc _ ≤ (shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * L^2) * L^(-18 : ℝ) := mul_le_mul_of_nonneg_right hAprod (Real.rpow_nonneg hL.le _) _ = _ := by rw [mul_assoc, hpow] end Bounty end section /- Exact normalization of the omitted-prime sieve density in a unit class. -/ open Finset namespace Bounty theorem totient_eq_real_prime_avoidance (r : ℕ) : (r.totient : ℝ) = (r : ℝ) * ∏ p ∈ r.primeFactors, (1 - 1 / (p : ℝ)) := by have h := Nat.totient_eq_mul_prod_factors r have h' := congrArg (fun x : ℚ => (x : ℝ)) h push_cast at h' simpa only [one_div] using h' theorem omitted_prime_avoidance_density (P : Finset ℕ) (r : ℕ) (hP : ∀ p ∈ P, p.Prime) (hr : 0 < r) (hpf : r.primeFactors ⊆ P) : (∏ p ∈ P.filter (fun p => ¬p ∣ r), (1 - 1 / (p : ℝ))) / (r : ℝ) = (∏ p ∈ P, (1 - 1 / (p : ℝ))) / (r.totient : ℝ) := by have hfilter : P.filter (fun p => p ∣ r) = r.primeFactors := by ext p simp only [mem_filter] constructor · intro hp exact Nat.mem_primeFactors.mpr ⟨hP p hp.1, hp.2, hr.ne'⟩ · intro hp exact ⟨hpf hp, Nat.dvd_of_mem_primeFactors hp⟩ have hsplit := prod_filter_mul_prod_filter_not (s := P) (p := fun p : ℕ => p ∣ r) (f := fun p : ℕ => (1 - 1 / (p : ℝ))) rw [hfilter] at hsplit have hr0 : (r : ℝ) ≠ 0 := by exact_mod_cast hr.ne' have hphi0 : (r.totient : ℝ) ≠ 0 := by exact_mod_cast (Nat.totient_pos.mpr hr).ne' apply (div_eq_div_iff hr0 hphi0).mpr rw [totient_eq_real_prime_avoidance, ← hsplit] ring theorem small_prime_avoidance_unit_density {z : ℝ} (hz : 0 ≤ z) (r : ℕ) (hr : 0 < r) (hpf : ∀ p ∈ r.primeFactors, (p : ℝ) ≤ z) : (∏ p ∈ (primeBand 0 z).filter (fun p => ¬p ∣ r), (1 - 1 / (p : ℝ))) / (r : ℝ) = (∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ))) / (r.totient : ℝ) := by apply omitted_prime_avoidance_density _ r (fun _ hp => small_prime_pool_prime hp) hr intro p hp exact (mem_small_prime_pool_iff hz p).mpr ⟨Nat.prime_of_mem_primeFactors hp, hpf p hp⟩ end Bounty end section /- Exact residue-class interval counts and their unit discrepancy. -/ open Finset namespace Bounty theorem nat_mod_eq_iff_dvd_shift (r u n : ℕ) (hr : 0 < r) : n % r = u % r ↔ r ∣ n + (r - u % r) := by have hu : u % r ≤ r := (Nat.mod_lt u hr).le have heq : u % r + (r - u % r) = r := Nat.add_sub_of_le hu constructor · intro hn apply Nat.dvd_of_mod_eq_zero calc (n + (r - u % r)) % r = (u % r + (r - u % r)) % r := by simp only [Nat.add_mod, hn, Nat.mod_mod] _ = 0 := by rw [heq, Nat.mod_self] · intro hd have hmod : Nat.ModEq r (n + (r - u % r)) (u % r + (r - u % r)) := by show (n + (r - u % r)) % r = (u % r + (r - u % r)) % r rw [Nat.mod_eq_zero_of_dvd hd, heq, Nat.mod_self] have hn := Nat.ModEq.add_right_cancel (Nat.ModEq.refl (r - u % r)) hmod simpa only [Nat.ModEq, Nat.mod_mod] using hn theorem interval_residue_shift_image (A B r u : ℕ) (hr : 0 < r) : ((Ioc A B).filter (fun n => n % r = u % r)).image (fun n => n + (r - u % r)) = (Ioc (A + (r - u % r)) (B + (r - u % r))).filter (fun n => r ∣ n) := by ext m constructor · intro hm obtain ⟨n, hn, rfl⟩ := mem_image.mp hm obtain ⟨hnI, hnR⟩ := mem_filter.mp hn obtain ⟨ha, hb⟩ := mem_Ioc.mp hnI apply mem_filter.mpr exact ⟨mem_Ioc.mpr ⟨by omega, by omega⟩, (nat_mod_eq_iff_dvd_shift r u n hr).mp hnR⟩ · intro hm obtain ⟨hmI, hmR⟩ := mem_filter.mp hm obtain ⟨ha, hb⟩ := mem_Ioc.mp hmI have hshift : m - (r - u % r) + (r - u % r) = m := by omega apply mem_image.mpr refine ⟨m - (r - u % r), mem_filter.mpr ⟨?_, ?_⟩, hshift⟩ · exact mem_Ioc.mpr ⟨by omega, by omega⟩ · apply (nat_mod_eq_iff_dvd_shift r u _ hr).mpr rwa [hshift] theorem interval_residue_error_le_one (A B r u : ℕ) (hAB : A ≤ B) (hr : 0 < r) : |(((Ioc A B).filter (fun n => n % r = u % r)).card : ℝ) - ((B : ℝ) - A) / r| ≤ 1 := by have hcard := congrArg Finset.card (interval_residue_shift_image A B r u hr) rw [card_image_of_injective _ (fun _ _ h => Nat.add_right_cancel h)] at hcard rw [hcard] have he := interval_multiples_error_le_one (A + (r - u % r)) (B + (r - u % r)) r (by omega) hr simpa only [Nat.cast_add, add_sub_add_right_eq_sub] using he theorem exists_residue_divisibility_crt (r d u : ℕ) (hr : 0 < r) (hd : 0 < d) (hcop : r.Coprime d) : ∃ v : ℕ, v < r * d ∧ ∀ n : ℕ, (n % r = u % r ∧ d ∣ n) ↔ n % (r * d) = v := by let v := Nat.chineseRemainder hcop u 0 have hv : (v : ℕ) < r * d := Nat.chineseRemainder_lt_mul hcop u 0 hr.ne' hd.ne' refine ⟨v, hv, ?_⟩ intro n constructor · rintro ⟨hnr, hnd⟩ have h := Nat.chineseRemainder_modEq_unique hcop (show Nat.ModEq r n u from hnr) (Nat.modEq_zero_iff_dvd.mpr hnd) change Nat.ModEq (r * d) n v at h simpa only [Nat.ModEq, Nat.mod_eq_of_lt hv] using h · intro hn have h : Nat.ModEq (r * d) n v := by show n % (r * d) = (v : ℕ) % (r * d) rwa [Nat.mod_eq_of_lt hv] exact ⟨(h.of_dvd (dvd_mul_right r d)).trans v.property.1, Nat.modEq_zero_iff_dvd.mp ((h.of_dvd (dvd_mul_left d r)).trans v.property.2)⟩ theorem interval_residue_divisibility_error_le_one (A B r u d : ℕ) (hAB : A ≤ B) (hr : 0 < r) (hd : 0 < d) (hcop : r.Coprime d) : |(((Ioc A B).filter (fun n => n % r = u % r ∧ d ∣ n)).card : ℝ) - ((B : ℝ) - A) / (r * d : ℕ)| ≤ 1 := by obtain ⟨v, hv, hiff⟩ := exists_residue_divisibility_crt r d u hr hd hcop have hset : (Ioc A B).filter (fun n => n % r = u % r ∧ d ∣ n) = (Ioc A B).filter (fun n => n % (r * d) = v % (r * d)) := by apply filter_congr intro n hn rw [Nat.mod_eq_of_lt hv] exact hiff n rw [hset] exact interval_residue_error_le_one A B (r * d) v hAB (Nat.mul_pos hr hd) end Bounty end section /- Exact least-prime-factor extraction, including repeated prime factors. -/ open Finset namespace Bounty theorem buchstab_cofactor_prime_factors (n : ℕ) : ∀ p ∈ (n/n.minFac).primeFactors, n.minFac ≤ p := by intro p hp apply Nat.minFac_le_of_dvd (Nat.prime_of_mem_primeFactors hp).two_le exact (Nat.dvd_of_mem_primeFactors hp).trans (Nat.div_dvd_of_dvd (Nat.minFac_dvd n)) theorem buchstab_minFac_mul {p m : ℕ} (hp : p.Prime) (hm : m ≠ 0) (hrough : ∀ q ∈ m.primeFactors, p ≤ q) : (p*m).minFac = p := by have hpm1 : p*m ≠ 1 := by intro h; exact hp.ne_one (Nat.eq_one_of_mul_eq_one_right h) have hprime := Nat.minFac_prime hpm1 apply le_antisymm (Nat.minFac_le_of_dvd hp.two_le (dvd_mul_right p m)) rcases hprime.dvd_mul.mp (Nat.minFac_dvd (p*m)) with hdiv | hdiv · exact ((Nat.prime_dvd_prime_iff_eq hprime hp).mp hdiv).symm.le · exact hrough _ (Nat.mem_primeFactors.mpr ⟨hprime, hdiv, hm⟩) noncomputable def buchstabCompositeCofactors (S : Finset ℕ) (N p : ℕ) : Finset ℕ := by classical exact (Icc p N).filter (fun m => p*m ∈ S ∧ ∀ q ∈ m.primeFactors, p ≤ q) theorem buchstab_minFac_fiber_image (S : Finset ℕ) {N p : ℕ} (hp : p.Prime) (hSlo : ∀ n ∈ S, 2 ≤ n) (hShi : ∀ n ∈ S, n ≤ N) : S.filter (fun n => ¬n.Prime ∧ n.minFac = p) = (buchstabCompositeCofactors S N p).image (fun m => p*m) := by classical ext n constructor · intro hn obtain ⟨hnS, hnprime, hnfac⟩ := mem_filter.mp hn have hn0 : 0 < n := lt_of_lt_of_le (by norm_num : 0 < 2) (hSlo n hnS) have hdvd : p ∣ n := hnfac ▸ Nat.minFac_dvd n have hmul : p*(n/p) = n := Nat.mul_div_cancel' hdvd apply mem_image.mpr refine ⟨n/p, mem_filter.mpr ⟨mem_Icc.mpr ⟨?_, ?_⟩, (by rwa [hmul]), ?_⟩, hmul⟩ · simpa only [hnfac] using Nat.minFac_le_div hn0 hnprime · exact (Nat.div_le_self n p).trans (hShi n hnS) · simpa only [hnfac] using buchstab_cofactor_prime_factors n · intro hn obtain ⟨m, hm, rfl⟩ := mem_image.mp hn obtain ⟨hmI, hmS, hmrough⟩ := mem_filter.mp hm have hpm : p ≤ m := (mem_Icc.mp hmI).1 have hm0 : m ≠ 0 := ne_of_gt (hp.pos.trans_le hpm) refine mem_filter.mpr ⟨hmS, Nat.not_prime_mul hp.ne_one ?_, buchstab_minFac_mul hp hm0 hmrough⟩ exact ne_of_gt (hp.one_lt.trans_le hpm) end Bounty end section /- Common smooth moduli with an independently specified ambient lower bound. -/ namespace Bounty /- The ambient primes need only exceed the smoothness bound; their lower endpoint need not be twice the scale. -/ theorem exists_real_smooth_prime_modulus_above_smoothness {y δ : ℝ} (hy : 1 ≤ y) (P S : Finset ℕ) (hsub : P ⊆ S) (hprime : ∀ p ∈ S, p.Prime) (hbound : ∀ p ∈ S, (p : ℝ) ≤ 5 * y) (hlarge : ∀ p ∈ S, y ^ δ < (p : ℝ)) (hsmooth : ∀ p ∈ P, ∀ q : ℕ, q.Prime → q ∣ p - 1 → (q : ℝ) ≤ y ^ δ) : ∃ (L : ℕ) (g : ℕ → (ZMod L)ˣ), 0 < L ∧ (∀ p ∈ P, p - 1 ∣ L) ∧ (∀ q ∈ L.primeFactors, (q : ℝ) ≤ y ^ δ) ∧ Real.log (L : ℝ) ≤ y ^ δ * Real.log (5 * y) ∧ Nat.card (ZMod L)ˣ ≤ L ∧ ∀ p ∈ S, (g p : ZMod L) = p := by have hypos : 0 < y := lt_of_lt_of_le zero_lt_one hy have hP : ∀ p ∈ P, p.Prime := fun p hp => hprime p (hsub hp) have hLpos : 0 < primePredecessorLCM P := primePredecessorLCM_pos hP have hsmooth' : ∀ p ∈ P, ∀ q : ℕ, q.Prime → q ∣ p - 1 → q ≤ ⌊y ^ δ⌋₊ := by intro p hp q hq hdiv exact Nat.le_floor (hsmooth p hp q hq hdiv) have hLsmooth : ∀ q ∈ (primePredecessorLCM P).primeFactors, (q : ℝ) ≤ y ^ δ := by intro q hq have hsmall : (q : ℝ) ≤ (⌊y ^ δ⌋₊ : ℝ) := by exact_mod_cast primePredecessorLCM_smooth hP hsmooth' hq exact hsmall.trans (Nat.floor_le (Real.rpow_nonneg hypos.le _)) have hcoprime : ∀ p ∈ S, p.Coprime (primePredecessorLCM P) := by intro p hp apply prime_coprime_of_primeFactors_lt (hprime p hp) hLpos intro q hq exact_mod_cast (hLsmooth q hq).trans_lt (hlarge p hp) let g : ℕ → (ZMod (primePredecessorLCM P))ˣ := fun p => if hp : p ∈ S then ZMod.unitOfCoprime p (hcoprime p hp) else 1 refine ⟨primePredecessorLCM P, g, hLpos, ?_, hLsmooth, log_primePredecessorLCM_le_real hy hP (fun p hp => hbound p (hsub hp)) hsmooth, card_zmod_units_le hLpos, ?_⟩ · intro p hp exact predecessor_dvd_primePredecessorLCM hp · intro p hp simp only [g, dif_pos hp, ZMod.coe_unitOfCoprime] end Bounty end section /- Exact grouping of consecutive operators and variable-state rows. No additivity, positivity, or norm assumptions are required. -/ namespace Bounty def finiteRowSegment {S : ℕ → Type*} {V : Type*} (row : ∀ i, (S (i + 1) → V) → S i → V) (a : ℕ) : ∀ len, (S (a + len) → V) → S a → V | 0, F => F | len + 1, F => finiteRowSegment row a len (row (a + len) F) theorem finite_row_composition_segment {S : ℕ → Type*} {V : Type*} (row : ∀ i, (S (i + 1) → V) → S i → V) (a len : ℕ) (F : S (a + len) → V) : finiteRowComposition row (a + len) F = finiteRowComposition row a (finiteRowSegment row a len F) := by induction len with | zero => rfl | succ len ih => change finiteRowComposition row (a + len) (row (a + len) F) = _ exact ih (row (a + len) F) def finiteRowBlockCut (length : ℕ → ℕ) : ℕ → ℕ | 0 => 0 | n + 1 => finiteRowBlockCut length n + length n def finiteRowGrouped {S : ℕ → Type*} {V : Type*} (row : ∀ i, (S (i + 1) → V) → S i → V) (length : ℕ → ℕ) (i : ℕ) : (S (finiteRowBlockCut length (i + 1)) → V) → S (finiteRowBlockCut length i) → V := finiteRowSegment row (finiteRowBlockCut length i) (length i) theorem finite_row_grouped_composition {S : ℕ → Type*} {V : Type*} (row : ∀ i, (S (i + 1) → V) → S i → V) (length : ℕ → ℕ) (n : ℕ) (F : S (finiteRowBlockCut length n) → V) : finiteRowComposition (S := fun i => S (finiteRowBlockCut length i)) (finiteRowGrouped row length) n F = finiteRowComposition row (finiteRowBlockCut length n) F := by induction n with | zero => rfl | succ n ih => change finiteRowComposition (S := fun i => S (finiteRowBlockCut length i)) (finiteRowGrouped row length) n (finiteRowSegment row (finiteRowBlockCut length n) (length n) F) = _ rw [ih] exact (finite_row_composition_segment row (finiteRowBlockCut length n) (length n) F).symm def visitThreeBlockLength (i : ℕ) : ℕ := if i % 2 = 0 then 1 else 3 theorem visit_three_block_cut (i : ℕ) : finiteRowBlockCut visitThreeBlockLength i = 2 * i - i % 2 := by induction i with | zero => rfl | succ i ih => simp only [finiteRowBlockCut, ih, visitThreeBlockLength] split_ifs <;> omega theorem visit_three_block_cut_even (n : ℕ) : finiteRowBlockCut visitThreeBlockLength (2 * n) = 4 * n := by rw [visit_three_block_cut] omega theorem visit_three_block_cut_odd (n : ℕ) : finiteRowBlockCut visitThreeBlockLength (2 * n + 1) = 4 * n + 1 := by rw [visit_three_block_cut] omega section variable {S : ℕ → Type*} {V : Type*} (row : ∀ i, (S (i + 1) → V) → S i → V) include S V row theorem finite_row_composition_terminal_cast {m n : ℕ} (h : m = n) (F : S n → V) : finiteRowComposition row m (fun s => F (cast (congrArg S h) s)) = finiteRowComposition row n F := by cases h rfl theorem finite_row_visit_three_grouping (n : ℕ) (F : S (4 * n + 1) → V) : finiteRowComposition (S := fun i => S (finiteRowBlockCut visitThreeBlockLength i)) (finiteRowGrouped row visitThreeBlockLength) (2 * n + 1) (fun s => F (cast (congrArg S (visit_three_block_cut_odd n)) s)) = finiteRowComposition row (4 * n + 1) F := by rw [finite_row_grouped_composition] exact finite_row_composition_terminal_cast row (visit_three_block_cut_odd n) F theorem finite_row_segment_one (a : ℕ) (F : S (a + 1) → V) : finiteRowSegment row a 1 F = row a F := rfl theorem finite_row_segment_three (a : ℕ) (F : S (a + 3) → V) : finiteRowSegment row a 3 F = row a (row (a + 1) (row (a + 2) F)) := rfl end theorem visit_three_block_length_even (n : ℕ) : visitThreeBlockLength (2 * n) = 1 := by simp [visitThreeBlockLength] theorem visit_three_block_length_odd (n : ℕ) : visitThreeBlockLength (2 * n + 1) = 3 := by simp [visitThreeBlockLength] end Bounty end section /- Multiplicative constants pass through finite tensor rows whenever they pass through each coordinate row. This retains the complete joint test. -/ namespace Bounty theorem fin_tensor_row_mul_left (N : ℕ) {S T : Fin N → Type*} (row : (g : Fin N) → (T g → ℂ) → S g → ℂ) (hrow : ∀ g c F s, row g (fun t => c * F t) s = c * row g F s) (c : ℂ) (F : ((g : Fin N) → T g) → ℂ) (s : (g : Fin N) → S g) : finTensorRow N row (fun t => c * F t) s = c * finTensorRow N row F s := by induction N with | zero => rfl | succ N ih => simp only [finTensorRow] have ht : (fun t => finTensorRow N (fun g => row g.succ) (fun u => c * F (Fin.cons t u)) (Fin.tail s)) = (fun t => c * finTensorRow N (fun g => row g.succ) (fun u => F (Fin.cons t u)) (Fin.tail s)) := by funext t exact ih _ (fun g => hrow g.succ) _ _ rw [ht, hrow] end Bounty end section /- The target permutation in a labeled physical edge is undone by the corresponding inverse permutation in the chronological row schedule. -/ namespace Bounty def physicalInversePermutations {G : Type*} {J ell : ℕ} (σ : PhysicalPermutations G J ell) : PhysicalPermutations G J ell := fun g => (σ g).symm theorem physical_permute_inverse {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations G J ell) (L : PhysicalMarkLists P J ell) : physicalPermuteLabels (physicalInversePermutations σ) (physicalPermuteLabels σ L) = L := by funext g apply Function.Embedding.ext intro i exact (σ g).apply_symm_apply i |> congrArg (L g) end Bounty end section /- Exact local residue counts for the two-variable upper-bound sieve. -/ open Finset namespace Bounty theorem finite_mul_one_pair_card {R : Type*} [CommMonoid R] [Fintype R] [DecidableEq R] : ((univ : Finset (R × R)).filter (fun v => v.1 * v.2 = 1)).card = Fintype.card Rˣ := by classical let e : Rˣ ≃ {v : R × R // v.1 * v.2 = 1} := { toFun := fun u => ⟨(u, ↑u⁻¹), by simp⟩ invFun := fun v => ⟨v.1.1, v.1.2, v.2, by simpa only [mul_comm] using v.2⟩ left_inv := fun u => by apply Units.ext; rfl right_inv := fun v => by apply Subtype.ext; rfl } simpa only [Fintype.card_subtype] using (Fintype.card_congr e).symm theorem finite_mul_zero_pair_card {R : Type*} [Semiring R] [NoZeroDivisors R] [Fintype R] [DecidableEq R] : ((univ : Finset (R × R)).filter (fun v => v.1 * v.2 = 0)).card + 1 = 2 * Fintype.card R := by classical let S : Finset (R × R) := Finset.product ({0} : Finset R) univ let T : Finset (R × R) := Finset.product (univ : Finset R) {0} have hzero : (univ : Finset (R × R)).filter (fun v => v.1 * v.2 = 0) = S ∪ T := by ext v simp only [S, T, Finset.product_eq_sprod, mem_filter, mem_univ, true_and, mem_union, Finset.mem_product, mem_singleton, and_true, mul_eq_zero] have hinter : S ∩ T = {(0, 0)} := by ext v simp only [S, T, Finset.product_eq_sprod, mem_inter, Finset.mem_product, mem_singleton, mem_univ, and_true, true_and] constructor · rintro ⟨h1, h2⟩ exact Prod.ext h1 h2 · intro hv cases hv exact ⟨rfl, rfl⟩ have h := card_union_add_card_inter S T rw [hinter] at h simpa only [hzero, S, T, Finset.product_eq_sprod, Finset.card_product, card_singleton, card_univ, one_mul, mul_one, two_mul] using h theorem prime_mul_zero_pair_card (p : ℕ) [Fact p.Prime] : ((univ : Finset (ZMod p × ZMod p)).filter (fun v => v.1 * v.2 = 0)).card = 2*p - 1 := by have h := finite_mul_zero_pair_card (R := ZMod p) rw [ZMod.card] at h omega theorem prime_mul_one_pair_card (p : ℕ) [Fact p.Prime] : ((univ : Finset (ZMod p × ZMod p)).filter (fun v => v.1 * v.2 = 1)).card = p - 1 := by rw [finite_mul_one_pair_card, ZMod.card_units] theorem prime_zero_or_one_pair_card (p : ℕ) [Fact p.Prime] : ((univ : Finset (ZMod p × ZMod p)).filter (fun v => v.1 * v.2 = 0 ∨ v.1 * v.2 = 1)).card = 3*p - 2 := by have hdisj : Disjoint ((univ : Finset (ZMod p × ZMod p)).filter (fun v => v.1 * v.2 = 0)) ((univ : Finset (ZMod p × ZMod p)).filter (fun v => v.1 * v.2 = 1)) := by apply disjoint_left.mpr intro v h0 h1 have hzero := (mem_filter.mp h0).2 have hone := (mem_filter.mp h1).2 exact zero_ne_one (hzero.symm.trans hone) rw [filter_or, card_union_of_disjoint hdisj, prime_mul_zero_pair_card, prime_mul_one_pair_card] have hp := (Fact.out : p.Prime).two_le omega end Bounty end section /- Disjoint prime pools give uniform polynomial atom bounds for arbitrary subsets of grouped coordinates, with a factorial cost only within each group. -/ open Finset open scoped Classical namespace Bounty theorem group_fiber_fin_product {G X M : Type*} [Fintype G] [Fintype X] [DecidableEq G] [CommMonoid M] (j : X → G) (f : X → M) : (∏ g, ∏ i : Fin (Fintype.card {x : X // j x = g}), f (((Fintype.equivFin {x : X // j x = g}).symm i).val)) = ∏ x, f x := by calc _ = ∏ g, ∏ x : {x : X // j x = g}, f x.val := by apply prod_congr rfl intro g _ exact (Fintype.equivFin {x : X // j x = g}).symm.prod_comp (fun x => f x.val) _ = _ := Fintype.prod_fiberwise j f theorem prime_group_index_physical_atom_rpow {G X : Type*} [Fintype G] [Fintype X] [DecidableEq G] [DecidableEq X] (j : X → G) (P : G → Finset ℕ) (V : G → ℝ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (m : ℕ) {v L D : ℝ} (hv : 0 < v) (hL : 0 < L) (hV : ∀ g, v ≤ V g) (hk : ∀ g, Fintype.card {x : X // j x = g} ≤ m) (hcard : (Fintype.card G : ℝ) ≤ D * Real.log L) (n : ℕ) : (∑ a ∈ univ.filter (fun a : (∀ x : X, P (j x)) => (∏ x, (a x).val : ℕ) = n), finiteProductWeight (physicalLabelLaw (P := fun x : X => P (j x)) (fun x => V (j x))) a) ≤ L ^ (D * Real.log (primeFiberFactorBound v m)) / (n : ℝ) := by let k := fun g => Fintype.card {x : X // j x = g} let pick := fun g (i : Fin (k g)) => ((Fintype.equivFin {x : X // j x = g}).symm i).val have hpick (g : G) (i : Fin (k g)) : j (pick g i) = g := ((Fintype.equivFin {x : X // j x = g}).symm i).property let x := fun (a : ∀ i : X, P (j i)) g (i : Fin (k g)) => (a (pick g i)).val have hxinj : Function.Injective x := by intro a b hab funext i apply Subtype.ext have hi := congrFun (congrFun hab (j i)) ((Fintype.equivFin {x : X // j x = j i}) ⟨i, rfl⟩) have he : pick (j i) ((Fintype.equivFin {x : X // j x = j i}) ⟨i, rfl⟩) = i := by exact congrArg Subtype.val ((Fintype.equivFin {x : X // j x = j i}).symm_apply_apply ⟨i, rfl⟩) change (a (pick (j i) _)).val = (b (pick (j i) _)).val at hi exact he ▸ hi have hx (a : ∀ i : X, P (j i)) (g : G) (i : Fin (k g)) : x a g i ∈ P g := by have hi := (a (pick g i)).property simpa only [hpick] using hi have hprod (a : ∀ i : X, P (j i)) : (∏ g, ∏ i, x a g i) = ∏ i, (a i).val := group_fiber_fin_product j (fun i => (a i).val) have hweight (a : ∀ i : X, P (j i)) : (∏ g, ∏ i, (1 / (x a g i : ℝ)) / V g) = finiteProductWeight (physicalLabelLaw (P := fun i : X => P (j i)) (fun i => V (j i))) a := by calc _ = ∏ g, ∏ i : Fin (k g), (1 / ((a (pick g i)).val : ℝ)) / V (j (pick g i)) := by simp only [hpick, x] _ = ∏ i, (1 / ((a i).val : ℝ)) / V (j i) := group_fiber_fin_product j (fun i => (1 / ((a i).val : ℝ)) / V (j i)) _ = _ := by unfold finiteProductWeight physicalLabelLaw apply prod_congr rfl intro i _ rw [div_div, mul_comm] have hb := prime_group_slot_harmonic_atom_rpow P k hprime hdisj x hxinj hx V m hv hL hV hk hcard n simpa only [sum_filter, hprod, hweight] using hb theorem prime_subset_group_fiber_card {G : Type*} [DecidableEq G] {I : G → Type*} [∀ g, DecidableEq (I g)] (r : Finset G) (probes : ∀ g, Finset (I g)) (U : Finset (Sigma I)) (hU : U ⊆ r.sigma probes) (g : G) : Fintype.card {i : U // i.val.fst = g} ≤ (probes g).card := by let f : {i : U // i.val.fst = g} → probes g := by rintro ⟨⟨⟨g', i⟩, hi⟩, hg⟩ dsimp at hg subst g' exact ⟨i, (mem_sigma.mp (hU hi)).2⟩ have hf : Function.Injective f := by rintro ⟨⟨⟨g₁, i₁⟩, hi₁⟩, hg₁⟩ ⟨⟨⟨g₂, i₂⟩, hi₂⟩, hg₂⟩ he dsimp at hg₁ hg₂ subst g₁ subst g₂ have he' : i₁ = i₂ := congrArg Subtype.val he subst i₂ rfl simpa only [Fintype.card_coe] using Fintype.card_le_of_injective f hf theorem prime_subset_physical_atom_rpow {G : Type*} [Fintype G] [DecidableEq G] {I : G → Type*} [∀ g, DecidableEq (I g)] (P : G → Finset ℕ) (V : G → ℝ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (r : Finset G) (probes : ∀ g, Finset (I g)) (m : ℕ) {v L D : ℝ} (hv : 0 < v) (hL : 0 < L) (hV : ∀ g, v ≤ V g) (hm : ∀ g, (probes g).card ≤ m) (hcard : (Fintype.card G : ℝ) ≤ D * Real.log L) (U : Finset (Sigma I)) (hU : U ⊆ r.sigma probes) (n : ℕ) : (∑ a ∈ univ.filter (fun a : (∀ i : U, P i.val.fst) => (∏ i, (a i).val : ℕ) = n), finiteProductWeight (physicalLabelLaw (P := fun i : U => P i.val.fst) (fun i => V i.val.fst)) a) ≤ L ^ (D * Real.log (primeFiberFactorBound v m)) / (n : ℝ) := by exact prime_group_index_physical_atom_rpow (fun i : U => i.val.fst) P V hprime hdisj m hv hL hV (fun g => (prime_subset_group_fiber_card r probes U hU g).trans (hm g)) hcard n end Bounty end section /- Scalar factors in finite chronological row compositions with varying state types. Only multiplicative homogeneity of the unweighted rows is used. -/ open Finset namespace Bounty theorem finite_row_composition_mul {S : ℕ → Type*} {V : Type*} [CommMonoid V] (row : (i : ℕ) → (S (i + 1) → V) → S i → V) (n : ℕ) (hrow : ∀ i, i < n → ∀ c F s, row i (fun t => c * F t) s = c * row i F s) (c : V) (F : S n → V) : finiteRowComposition row n (fun t => c * F t) = fun s => c * finiteRowComposition row n F s := by induction n with | zero => rfl | succ n ih => have he : row n (fun t => c * F t) = fun s => c * row n F s := funext (hrow n (Nat.lt_succ_self n) c F) rw [finite_row_composition_succ, he] exact ih (fun i hi => hrow i (Nat.lt_trans hi (Nat.lt_succ_self n))) (row n F) theorem finite_row_composition_scalar_rows {S : ℕ → Type*} {V : Type*} [CommMonoid V] (row weighted : (i : ℕ) → (S (i + 1) → V) → S i → V) (c : ℕ → V) (n : ℕ) (hrow : ∀ i, i < n → ∀ d F s, row i (fun t => d * F t) s = d * row i F s) (hweighted : ∀ i, i < n → ∀ F s, weighted i F s = c i * row i F s) (F : S n → V) : finiteRowComposition weighted n F = fun s => (∏ i ∈ range n, c i) * finiteRowComposition row n F s := by induction n with | zero => simp only [finite_row_composition_zero, range_zero, prod_empty, one_mul] | succ n ih => have hr := fun i hi => hrow i (Nat.lt_trans hi (Nat.lt_succ_self n)) have hw := fun i hi => hweighted i (Nat.lt_trans hi (Nat.lt_succ_self n)) have he : weighted n F = fun s => c n * row n F s := funext (hweighted n (Nat.lt_succ_self n) F) rw [finite_row_composition_succ, he, ih hr hw, finite_row_composition_mul row n hr (c n) (row n F)] simp only [prod_range_succ, finite_row_composition_succ, mul_assoc] theorem finite_row_composition_weighted {S : ℕ → Type*} {V : Type*} [CommMonoid V] (row : (i : ℕ) → (S (i + 1) → V) → S i → V) (c : ℕ → V) (n : ℕ) (hrow : ∀ i, i < n → ∀ d F s, row i (fun t => d * F t) s = d * row i F s) (F : S n → V) : finiteRowComposition (fun i F s => c i * row i F s) n F = fun s => (∏ i ∈ range n, c i) * finiteRowComposition row n F s := finite_row_composition_scalar_rows row (fun i F s => c i * row i F s) c n hrow (fun _ _ _ _ => rfl) F end Bounty end section /- Shared labels in the physical full-state encoding are independent of memory. -/ namespace Bounty noncomputable def physicalSharedMarkLabels {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g)) := fun g i => L g (physicalFullSlotIndex (C g) (((physicalFullSharedIndices (ell := ell) (C g)).equivFin.symm i).val)) theorem physical_full_memory_state_shared_labels {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) : (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C L q)).1 = physicalSharedMarkLabels C L := rfl end Bounty end section /- Function maps such as zero extension intertwine finite row compositions. -/ namespace Bounty theorem finite_row_composition_test_maps {S T : Nat → Type*} {V : Type*} (rowS : (i : Nat) → (S (i + 1) → V) → S i → V) (rowT : (i : Nat) → (T (i + 1) → V) → T i → V) (map : (i : Nat) → (T i → V) → S i → V) (n : Nat) (hrow : ∀ i, i < n → ∀ F, map i (rowT i F) = rowS i (map (i + 1) F)) (F : T n → V) : map 0 (finiteRowComposition rowT n F) = finiteRowComposition rowS n (map n F) := by induction n with | zero => rfl | succ n ih => rw [finite_row_composition_succ, finite_row_composition_succ, ← hrow n (Nat.lt_succ_self n)] exact ih (fun i hi => hrow i (Nat.lt_trans hi (Nat.lt_succ_self n))) (rowT n F) end Bounty end section /- Exact products along a four-phase schedule ending with its final visit. -/ namespace Bounty end Bounty end section /- At most one selected phase contributes to a disjoint finite sum. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Summing a uniquely selected source evaluates its initial weight exactly. -/ open Finset open scoped Classical namespace Bounty theorem finite_selected_source_pairing {D M : Type*} [Fintype M] (S : Finset D) (a : M → ℂ) (w H : D → ℂ) (source : D → M) (F : D → M → ℂ) (hF : ∀ d ∈ S, ∀ m, F d m = if m = source d then H d else 0) : (∑ m, a m * ∑ d ∈ S, w d * F d m) = ∑ d ∈ S, a (source d) * (w d * H d) := by simp only [mul_sum] rw [sum_comm] apply sum_congr rfl intro d hd simp_rw [hF d hd] simp only [mul_ite, mul_zero] simp end Bounty end section /- Exact compatibility support of the original finite residue vertex product. -/ open Finset open scoped Classical namespace Bounty section Compatibility variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} noncomputable def physicalResiduePathCompatible (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (r : PhysicalResidues P) : Prop := ∀ j ∈ visits, ∀ p ∈ physicalMarkedPrimes (labels j), r p = -(offset j : ZMod p.2.val) theorem physical_residue_translated_marks_valid_iff (r : PhysicalResidues P) (L : PhysicalMarkLists P J ell) (a : ℤ) : physicalResidueMarksValid (physicalTranslateResidues r a) L ↔ ∀ p ∈ physicalMarkedPrimes L, r p = -(a : ZMod p.2.val) := by rw [physical_residue_marks_valid_iff_marked] simp only [physicalTranslateResidues, add_eq_zero_iff_eq_neg] theorem physical_residue_path_compatible_iff (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (r : PhysicalResidues P) : physicalResiduePathCompatible labels visits offset r ↔ ∀ j ∈ visits, physicalResidueMarksValid (physicalTranslateResidues r (offset j)) (labels j) := by simp only [physicalResiduePathCompatible, physical_residue_translated_marks_valid_iff] theorem physical_residue_path_compatible_range_iff (labels : ℕ → PhysicalMarkLists P J ell) (n : ℕ) (offset : ℕ → ℤ) (r : PhysicalResidues P) : physicalResiduePathCompatible labels (range n) offset r ↔ ∀ j : Fin n, ∀ p ∈ physicalMarkedPrimes (labels j.val), r p = -(offset j.val : ZMod p.2.val) := by constructor · intro h j exact h j.val (mem_range.mpr j.isLt) · intro h j hj exact h ⟨j, mem_range.mp hj⟩ theorem physical_residue_vertex_product_zero_of_incompatible (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (q : ℕ → ℝ) (r : PhysicalResidues P) (h : ¬ physicalResiduePathCompatible labels visits offset r) : (∏ j ∈ visits, physicalResidueVertexWeight (labels j) (q j) (physicalTranslateResidues r (offset j))) = 0 := by rw [physical_residue_path_compatible_iff] at h push Not at h obtain ⟨j, hj, hinvalid⟩ := h exact prod_eq_zero hj (physical_residue_vertex_weight_zero_of_invalid (labels j) (q j) (physicalTranslateResidues r (offset j)) hinvalid) end Compatibility end Bounty end section /- The actual ordered Q slots in the microscopic bands and their harmonic mass. -/ open Finset namespace Bounty noncomputable def candidateMicroQIndices (c L : ℝ) (J : ℕ) : Finset ℕ := (candidateQIndices c L).filter (fun j => J ≤ j) noncomputable def candidateMicroQSlotChoices (c L : ℝ) (r jStar J : ℕ) (slot : (candidateMicroQIndices c L J) × Fin r) : Finset ℕ := if slot.1.val = jStar ∧ slot.2.val = 0 then candidateRoughBand c L jStar else candidateQBand (c*L) slot.1.val noncomputable def candidateMicroQWeight (c L : ℝ) (r jStar J n : ℕ) : ℝ := orderedSlotWeight (candidateMicroQSlotChoices c L r jStar J) ((r.factorial : ℝ)^(candidateMicroQIndices c L J).card) n noncomputable def candidateMicroQHarmonicMass (c L : ℝ) (r jStar J : ℕ) : ℝ := ∑' n : ℕ, candidateMicroQWeight c L r jStar J n / (n : ℝ) noncomputable def candidateQBandHarmonicFactor (c L : ℝ) (r jStar j : ℕ) : ℝ := (∏ k : Fin r, ∑ p ∈ (if j = jStar ∧ k.val = 0 then candidateRoughBand c L jStar else candidateQBand (c*L) j), 1/(p : ℝ)) / (r.factorial : ℝ) theorem candidate_micro_Q_weight_nonneg (c L : ℝ) (r jStar J n : ℕ) : 0 ≤ candidateMicroQWeight c L r jStar J n := ordered_slot_weight_nonneg _ (by positivity) n theorem candidate_micro_Q_harmonic_nonneg (c L : ℝ) (r jStar J : ℕ) : 0 ≤ candidateMicroQHarmonicMass c L r jStar J := tsum_nonneg (fun n => div_nonneg (candidate_micro_Q_weight_nonneg c L r jStar J n) (Nat.cast_nonneg n)) theorem candidate_Q_harmonic_eq_band_factors (c L : ℝ) (r jStar : ℕ) : candidateQHarmonicMass c L r jStar = ∏ j ∈ candidateQIndices c L, candidateQBandHarmonicFactor c L r jStar j := by rw [candidate_Q_harmonic_eq_group_product] exact prod_coe_sort _ (candidateQBandHarmonicFactor c L r jStar) theorem candidate_micro_Q_harmonic_eq_band_factors (c L : ℝ) (r jStar J : ℕ) : candidateMicroQHarmonicMass c L r jStar J = ∏ j ∈ candidateMicroQIndices c L J, candidateQBandHarmonicFactor c L r jStar j := by classical unfold candidateMicroQHarmonicMass candidateMicroQWeight rw [ordered_slot_harmonic_sum, Fintype.prod_prod_type] have he := prod_coe_sort (candidateMicroQIndices c L J) (candidateQBandHarmonicFactor c L r jStar) convert he using 1 simp only [candidateQBandHarmonicFactor, candidateMicroQSlotChoices, prod_div_distrib, prod_const, card_univ, Fintype.card_coe] theorem candidate_Q_band_factor_pure (c L : ℝ) (r jStar j : ℕ) (hne : j ≠ jStar) : candidateQBandHarmonicFactor c L r jStar j = (∑ p ∈ candidateQBand (c*L) j, 1/(p : ℝ))^r / (r.factorial : ℝ) := by simp [candidateQBandHarmonicFactor, hne] theorem candidate_Q_harmonic_split_micro (c L : ℝ) (r jStar J : ℕ) : candidateQHarmonicMass c L r jStar = (∏ j ∈ (candidateQIndices c L).filter (fun j => j < J), candidateQBandHarmonicFactor c L r jStar j) * candidateMicroQHarmonicMass c L r jStar J := by rw [candidate_Q_harmonic_eq_band_factors, candidate_micro_Q_harmonic_eq_band_factors] symm simpa only [candidateMicroQIndices, Nat.not_lt] using prod_filter_mul_prod_filter_not (candidateQIndices c L) (fun j => j < J) (candidateQBandHarmonicFactor c L r jStar) end Bounty end section /- Read an owning source and its full dependent event from an existing path. -/ namespace Bounty universe u v w def finiteEventPathOccurrence {K : Type u} {X : Type v} (E : K → X → Type w) (target : ∀ k x, E k x → X) : ∀ (steps : List K) (x : X), FiniteEventPath E target steps x → (i : Fin steps.length) → Σ y, E (steps.get i) y | [], _, _, i => Fin.elim0 i | k :: steps, x, ⟨e, p⟩, i => Fin.cases ⟨x, e⟩ (fun j => finiteEventPathOccurrence E target steps (target k x e) p j) i end Bounty end section /- Fixed potential birth slots depend on schedule occurrences, not the path. -/ namespace Bounty section Addresses variable {J K : Type*} {N : ℕ} {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) def fullMixedBirthCapacity : Option (J ⊕ K) → Fin N → ℕ | none, _ => 0 | some (.inl _), _ => B | some (.inr k), g => (S k g)ᶜ.card abbrev FullMixedLocalBirthAddress (tag : Option (J ⊕ K)) := (g : Fin N) × Fin (fullMixedBirthCapacity S B tag g) abbrev FullMixedBirthAddress (steps : List (Option (J ⊕ K))) := (i : Fin steps.length) × FullMixedLocalBirthAddress S B (steps.get i) def fullMixedBirthOwner (steps : List (Option (J ⊕ K))) (a : FullMixedBirthAddress S B steps) : Fin steps.length := a.1 end Addresses end Bounty end section /- An operation multiplier reads only the birth data of its own addresses. -/ namespace Bounty theorem birth_forest_operation_multiplier_congr_on_owner {m : ℕ} {Op : Type*} (code : BirthForestCode m) (owner : Fin m → Op) (θ : (Fin m × Fin m) → ℝ) (performed performed' : Fin m → Prop) (label label' : Fin m → ℤ) (o : Op) (hp : ∀ j, owner j = o → (performed j ↔ performed' j)) (hl : ∀ j, owner j = o → label j = label' j) : birthForestOperationMultiplier code owner θ performed label o = birthForestOperationMultiplier code owner θ performed' label' o := by classical unfold birthForestOperationMultiplier apply Finset.prod_congr rfl intro j hj have ho : owner j = o := (Finset.mem_filter.mp hj).2 have hpred : (j ∈ birthForestTouched code → performed j) = (j ∈ birthForestTouched code → performed' j) := propext ⟨fun h ht => (hp j ho).mp (h ht), fun h ht => (hp j ho).mpr (h ht)⟩ simp only [hpred, hl j ho] end Bounty end section /- Recover a projected weighted norm from pairings against symmetric tests. The operator is arbitrary; no linearity or prior operator norm is assumed. -/ open Finset open scoped Classical namespace Bounty theorem clean_weighted_self_pairing_norm {X : Type*} [Fintype X] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (u : X → ℂ) : ‖∑ x, (w x : ℂ) * (starRingEnd ℂ) (u x) * u x‖ = cleanActiveNorm w u ^ 2 := by have he : (∑ x, (w x : ℂ) * (starRingEnd ℂ) (u x) * u x) = ((∑ x, w x * ‖u x‖ ^ 2 : ℝ) : ℂ) := by rw [Complex.ofReal_sum] apply sum_congr rfl intro x hx rw [mul_assoc, Complex.conj_mul', Complex.ofReal_mul, Complex.ofReal_pow] rw [he, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (sum_nonneg (fun x _ => mul_nonneg (hw x) (sq_nonneg _))), clean_active_norm_sq w hw] theorem clean_active_norm_le_of_self_pairing {X : Type*} [Fintype X] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (u : X → ℂ) {C : ℝ} (hC : 0 ≤ C) (hpair : ‖∑ x, (w x : ℂ) * (starRingEnd ℂ) (u x) * u x‖ ≤ C * cleanActiveNorm w u) : cleanActiveNorm w u ≤ C := by rw [clean_weighted_self_pairing_norm w hw u, pow_two] at hpair by_cases hzero : cleanActiveNorm w u = 0 · simpa only [hzero] using hC · have hn : 0 ≤ cleanActiveNorm w u := Real.sqrt_nonneg _ have hp : 0 < cleanActiveNorm w u := lt_of_le_of_ne hn (Ne.symm hzero) exact (mul_le_mul_iff_left₀ hp).mp hpair section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} include G sharedInstance1 sharedInstance2 P J ell theorem repeated_big_symmetric_pairing_symmetrize (w : RepeatedBigLists P J ell → ℝ) (hw : ∀ (σ : PhysicalPermutations G J ell) L, w (repeatedBigPermutationEquiv σ L) = w L) (f u : RepeatedBigLists P J ell → ℂ) (hf : f ∈ repeatedBigSymmetricSubspace) : (∑ L, (w L : ℂ) * (starRingEnd ℂ) (f L) * repeatedBigSymmetrizeLinear u L) = ∑ L, (w L : ℂ) * (starRingEnd ℂ) (f L) * u L := by have hσ (σ : PhysicalPermutations G J ell) : (∑ L, (w L : ℂ) * (starRingEnd ℂ) (f L) * u (repeatedBigPermutationEquiv σ L)) = ∑ L, (w L : ℂ) * (starRingEnd ℂ) (f L) * u L := by have he := (repeatedBigPermutationEquiv (P := P) σ).sum_comp (fun L => (w L : ℂ) * (starRingEnd ℂ) (f L) * u L) simpa only [hw, show ∀ σ L, f (repeatedBigPermutationEquiv σ L) = f L from hf] using he change (∑ L, (w L : ℂ) * (starRingEnd ℂ) (f L) * ((Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * ∑ σ : PhysicalPermutations G J ell, u (repeatedBigPermutationEquiv σ L))) = _ calc _ = (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * ∑ σ : PhysicalPermutations G J ell, ∑ L, (w L : ℂ) * (starRingEnd ℂ) (f L) * u (repeatedBigPermutationEquiv σ L) := by rw [sum_comm] simp_rw [mul_sum] apply sum_congr rfl intro L hL apply sum_congr rfl intro σ hσ ring _ = _ := by simp_rw [hσ] rw [sum_const, card_univ, nsmul_eq_mul, ← mul_assoc, inv_mul_cancel₀, one_mul] exact_mod_cast Fintype.card_ne_zero theorem repeated_big_projected_norm_le_of_pairing (w : RepeatedBigLists P J ell → ℝ) (hw0 : ∀ L, 0 ≤ w L) (hw : ∀ (σ : PhysicalPermutations G J ell) L, w (repeatedBigPermutationEquiv σ L) = w L) (u : RepeatedBigLists P J ell → ℂ) {C : ℝ} (hC : 0 ≤ C) (hpair : ∀ f : RepeatedBigLists P J ell → ℂ, f ∈ repeatedBigSymmetricSubspace → ‖∑ L, (w L : ℂ) * (starRingEnd ℂ) (f L) * u L‖ ≤ C * cleanActiveNorm w f) : cleanActiveNorm w (repeatedBigSymmetrizeLinear u) ≤ C := by apply clean_active_norm_le_of_self_pairing w hw0 _ hC rw [repeated_big_symmetric_pairing_symmetrize w hw _ u (repeated_big_symmetrize_mem u)] exact hpair _ (repeated_big_symmetrize_mem u) theorem repeated_big_operator_norm_le_of_symmetric_pairing (w : RepeatedBigLists P J ell → ℝ) (hw0 : ∀ L, 0 ≤ w L) (hw : ∀ (σ : PhysicalPermutations G J ell) L, w (repeatedBigPermutationEquiv σ L) = w L) (A : (RepeatedBigLists P J ell → ℂ) → RepeatedBigLists P J ell → ℂ) {M : ℝ} (hM : 0 ≤ M) (hpair : ∀ f v : RepeatedBigLists P J ell → ℂ, f ∈ repeatedBigSymmetricSubspace → v ∈ repeatedBigSymmetricSubspace → ‖∑ L, (w L : ℂ) * (starRingEnd ℂ) (f L) * A v L‖ ≤ M * cleanActiveNorm w f * cleanActiveNorm w v) (v : RepeatedBigLists P J ell → ℂ) (hv : v ∈ repeatedBigSymmetricSubspace) : cleanActiveNorm w (repeatedBigSymmetrizeLinear (A v)) ≤ M * cleanActiveNorm w v := by apply repeated_big_projected_norm_le_of_pairing w hw0 hw (A v) (C := M * cleanActiveNorm w v) (mul_nonneg hM (Real.sqrt_nonneg _)) intro f hf simpa only [mul_right_comm] using hpair f v hf hv theorem repeated_big_untilted_operator_norm_le_of_symmetric_pairing (V : G → ℝ) (hV : ∀ g, 0 ≤ V g) (A : (RepeatedBigLists P J ell → ℂ) → RepeatedBigLists P J ell → ℂ) {M : ℝ} (hM : 0 ≤ M) (hpair : ∀ f v : RepeatedBigLists P J ell → ℂ, f ∈ repeatedBigSymmetricSubspace → v ∈ repeatedBigSymmetricSubspace → ‖∑ L, (repeatedBigActiveMass V (fun _ _ => 1) L : ℂ) * (starRingEnd ℂ) (f L) * A v L‖ ≤ M * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) v) (v : RepeatedBigLists P J ell → ℂ) (hv : v ∈ repeatedBigSymmetricSubspace) : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigSymmetrizeLinear (A v)) ≤ M * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) v := repeated_big_operator_norm_le_of_symmetric_pairing _ (repeated_big_untilted_active_mass_nonneg V hV) (repeated_big_active_mass_permutation V (fun _ _ => 1)) A hM hpair v hv end end Bounty end section /- The finite images of optional prefix draws and optional fresh slots. -/ open scoped Classical namespace Bounty theorem optional_prefix_birth_image {P : Type*} [DecidableEq P] (B b : ℕ) (hb : b ≤ B) (f : Fin b → P) : (Finset.univ.biUnion (fun i : Fin B => (if h : i.val < b then some (f ⟨i.val, h⟩) else none).toFinset)) = Finset.univ.image f := by classical ext p simp only [Finset.mem_biUnion, Finset.mem_univ, true_and, Finset.mem_image] constructor · rintro ⟨i, hi⟩ by_cases h : i.val < b · simp only [dif_pos h, Option.toFinset_some, Finset.mem_singleton] at hi exact ⟨⟨i.val, h⟩, hi.symm⟩ · simp [h] at hi · rintro ⟨i, hi⟩ refine ⟨⟨i.val, i.isLt.trans_le hb⟩, ?_⟩ simp only [dif_pos i.isLt, Option.toFinset_some, Finset.mem_singleton] exact hi.symm theorem optional_fresh_birth_image {I P : Type*} [Fintype I] [DecidableEq I] [DecidableEq P] (promotions : Finset I) (f : {i : I // i ∉ promotions} → P) : (Finset.univ.biUnion (fun i : I => (if h : i ∈ promotions then none else some (f ⟨i, h⟩)).toFinset)) = Finset.univ.image f := by classical ext p simp only [Finset.mem_biUnion, Finset.mem_univ, true_and, Finset.mem_image] constructor · rintro ⟨i, hi⟩ by_cases h : i ∈ promotions · simp [h] at hi · simp only [dif_neg h, Option.toFinset_some, Finset.mem_singleton] at hi exact ⟨⟨i, h⟩, hi.symm⟩ · rintro ⟨i, hi⟩ refine ⟨i.val, ?_⟩ simp only [dif_neg i.property, Option.toFinset_some, Finset.mem_singleton] exact hi.symm end Bounty end section /- Remove unit visit factors from an alternating finite product. -/ open Finset namespace Bounty theorem alternating_even_one_product {M : Type*} [CommMonoid M] (f : ℕ → M) (n : ℕ) (h : ∀ j ≤ n, f (2 * j) = 1) : (∏ i ∈ range (2 * n + 1), f i) = ∏ j ∈ range n, f (2 * j + 1) := by induction n with | zero => simpa using h 0 (by omega) | succ n ih => have hn : 2 * (n + 1) + 1 = (2 * n + 1) + 1 + 1 := by omega rw [hn, prod_range_succ, prod_range_succ, ih (fun j hj => h j (by omega)), show 2 * n + 1 + 1 = 2 * (n + 1) by omega, h (n + 1) le_rfl, mul_one, prod_range_succ] end Bounty end section /- Scale finite complex weighted sums without changing their index set. -/ open Finset namespace Bounty end Bounty end section /- On valid edge outputs, promoted labels already in the ledger add no births. -/ open Finset open scoped Classical namespace Bounty theorem unrestricted_target_ledger_union {P Z : Type*} [DecidableEq P] {t N : ℕ} (H : Finset P) (old : Fin N → Z) (label : Z → P) (promotions : Finset (Fin t)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (fresh : UnrestrictedFreshLabels P promotions) (hold : ∀ j, label (old j) ∈ H) : H ∪ univ.image (unrestrictedEdgeTarget old label promotions e fresh) = H ∪ univ.image fresh := by ext p simp only [mem_union, mem_image, mem_univ, true_and] constructor · rintro (hp | ⟨i, rfl⟩) · exact Or.inl hp · by_cases hi : i ∈ promotions · left simpa only [unrestrictedEdgeTarget, unrestrictedTargetLabels, dif_pos hi] using hold (e ⟨i, hi⟩).val · right exact ⟨⟨i, hi⟩, by simp only [unrestrictedEdgeTarget, unrestrictedTargetLabels, dif_neg hi]⟩ · rintro (hp | ⟨i, rfl⟩) · exact Or.inl hp · right exact ⟨i.val, by simp only [unrestrictedEdgeTarget, unrestrictedTargetLabels, dif_neg i.property]⟩ theorem bounded_edge_ledger_union_of_output_le {P : Type*} [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (H : Finset P) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) (hold : ∀ i, (s.2.2 i).1 ∈ H) (hout : (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) e.1 e.2.1 e.2.2.1).1 ≤ B) : H ∪ univ.image (unrestrictedBoundedEventTarget n Δ D t B s e).1 = H ∪ univ.image e.2.2.2 := by simp only [unrestrictedBoundedEventTarget, dif_pos hout] exact unrestricted_target_ledger_union H s.2.2 Sigma.fst e.2.1 e.2.2.1 e.2.2.2 hold theorem bounded_edge_ledger_union_of_nonzero {P : Type*} [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (H : Finset P) (μ : P → ℝ) (ρ V : ℝ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) (hold : ∀ i, (s.2.2 i).1 ∈ H) (hw : unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e ≠ 0) : H ∪ univ.image (unrestrictedBoundedEventTarget n Δ D t B s e).1 = H ∪ univ.image e.2.2.2 := by apply bounded_edge_ledger_union_of_output_le n Δ D t B H s e hold by_contra h apply hw simp only [unrestrictedBoundedEventWeight, h, and_false, if_false] end Bounty end section /- The exact baseline for the endpoint damping schedule in a physical root path. -/ open Finset namespace Bounty noncomputable def physicalEndpointBaseline (q : ℝ) (edges p : ℕ) : ℝ := 1 - (∑ j ∈ range (edges + 1), (1 - physicalEndpointSchedule q edges j)) / (p : ℝ) section variable {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) include q hq0 hq1 theorem physical_endpoint_damping_sum_nonneg (edges : ℕ) : 0 ≤ ∑ j ∈ range (edges + 1), (1 - physicalEndpointSchedule q edges j) := by apply sum_nonneg intro j hj exact sub_nonneg.mpr (physical_endpoint_schedule_unit hq0 hq1 edges j).2 theorem physical_endpoint_damping_sum_le (edges : ℕ) : (∑ j ∈ range (edges + 1), (1 - physicalEndpointSchedule q edges j)) ≤ edges + 1 := by calc _ ≤ ∑ _j ∈ range (edges + 1), (1 : ℝ) := by apply sum_le_sum intro j hj linarith [(physical_endpoint_schedule_unit hq0 hq1 edges j).1] _ = _ := by simp theorem physical_endpoint_baseline_bounds (edges p : ℕ) (hp : 0 < p) (hsize : 2 * (edges + 1) ≤ p) : 1 / 2 ≤ physicalEndpointBaseline q edges p ∧ physicalEndpointBaseline q edges p ≤ 1 := by apply memory_baseline_bounds (physical_endpoint_damping_sum_nonneg hq0 hq1 edges) (by exact_mod_cast hp) have hsize' : (2 : ℝ) * (edges + 1) ≤ p := by exact_mod_cast hsize linarith [physical_endpoint_damping_sum_le hq0 hq1 edges] theorem physical_endpoint_baseline_pos (edges p : ℕ) (hp : 0 < p) (hsize : 2 * (edges + 1) ≤ p) : 0 < physicalEndpointBaseline q edges p := by linarith [(physical_endpoint_baseline_bounds hq0 hq1 edges p hp hsize).1] end end Bounty end section /- Injective encoding preserves equality and distinctness of present optional labels. -/ namespace Bounty theorem optional_encoded_eq_iff {α : Type*} (encode : α → ℤ) (hencode : Function.Injective encode) (a b : Option α) (ha : a.isSome = true) (hb : b.isSome = true) : (a.map encode).getD 0 = (b.map encode).getD 0 ↔ a = b := by cases a with | none => cases ha | some a => cases b with | none => cases hb | some b => simpa only [Option.map_some, Option.getD_some, Option.some.injEq] using hencode.eq_iff theorem birth_values_distinct_option_equiv_iff {ι α : Type*} {m : ℕ} (e : Fin m ≃ ι) (label : ι → Option α) (performed : ι → Prop) (hperformed : ∀ a, performed a ↔ (label a).isSome = true) (encode : α → ℤ) (hencode : Function.Injective encode) : birthValuesDistinct (fun i => performed (e i)) (fun i => ((label (e i)).map encode).getD 0) ↔ Set.InjOn label {a | performed a} := by constructor · intro h a ha b hb hab have hai : performed (e (e.symm a)) := by simpa only [e.apply_symm_apply] using (show performed a from ha) have hbi : performed (e (e.symm b)) := by simpa only [e.apply_symm_apply] using (show performed b from hb) have hi := h hai hbi (show ((label (e (e.symm a))).map encode).getD 0 = ((label (e (e.symm b))).map encode).getD 0 from by simp only [e.apply_symm_apply, hab]) exact e.symm.injective hi · intro h i hi j hj hij apply e.injective apply h hi hj exact (optional_encoded_eq_iff encode hencode _ _ ((hperformed _).mp hi) ((hperformed _).mp hj)).mp hij end Bounty namespace Bounty theorem optional_label_injOn_iff_same_some {ι α : Type*} (label : ι → Option α) (performed : ι → Prop) (hperformed : ∀ a, performed a ↔ (label a).isSome = true) : Set.InjOn label {a | performed a} ↔ ∀ a b z, label a = some z → label b = some z → a = b := by constructor · intro h a b z ha hb apply h · apply (hperformed a).mpr simp only [ha, Option.isSome_some] · apply (hperformed b).mpr simp only [hb, Option.isSome_some] · exact ha.trans hb.symm · intro h a ha b _ hab cases hl : label a with | none => have hp := (hperformed a).mp ha simp only [hl, Option.isSome_none, Bool.false_eq_true] at hp | some z => exact h a b z hl (hab.symm.trans hl) end Bounty end section /- The original scheduled finite vertex expectation has its exact baseline and phase history. -/ open Finset open scoped Classical namespace Bounty section Phase variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] {patterns : Finset I} (C : I → Fin N → Finset (Fin J)) (q : ℝ) (k : ℕ → I → ℤ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (b : PhysicalPrime P → ℝ) (hb : ∀ a, b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a, b a ≠ 0) include hb hb0 end Phase end Bounty end section /- Numerical bounds for fixed probe sizes and logarithmically many prime groups. The density-loss parameter is allowed polynomial growth in the path length. -/ open Filter namespace Bounty /- A positive proportion of logarithmically many groups turns a fixed probe loss into a power saving. -/ theorem repeated_big_sqrt_probe_le {L theta beta E : ℝ} {n : ℕ} (hL : 1 ≤ L) (htheta : 0 < theta) (htheta1 : theta ≤ 1) (hn : beta * Real.log L ≤ (n : ℝ)) (hgap : beta * Real.log theta / 2 ≤ -E) : Real.sqrt (theta ^ n) ≤ L ^ (-E) := by have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL have hlog : Real.log theta ≤ 0 := Real.log_nonpos htheta.le htheta1 have hpow : theta ^ n ≤ L ^ (-2 * E) := by rw [← Real.exp_log htheta, ← Real.exp_nat_mul, Real.rpow_def_of_pos hL0] apply Real.exp_le_exp.mpr have hh := mul_le_mul_of_nonpos_right hn hlog have hg := mul_le_mul_of_nonneg_right hgap (Real.log_nonneg hL) nlinarith calc Real.sqrt (theta ^ n) ≤ Real.sqrt (L ^ (-2 * E)) := Real.sqrt_le_sqrt hpow _ = L ^ (-E) := by rw [Real.sqrt_eq_rpow, ← Real.rpow_mul hL0.le] congr 1 ring /- An exponential in a logarithmic group count has an explicit polynomial bound. The natural exponent can count any fixed number of probes per group. -/ theorem repeated_big_log_count_pow_le {L a b : ℝ} (m s : ℕ) (hL : 0 < L) (hb : 1 ≤ b) (hs : (s : ℝ) ≤ a * Real.log L) : b ^ (m * s) ≤ L ^ ((m : ℝ) * a * Real.log b) := by have hb0 : 0 < b := lt_of_lt_of_le zero_lt_one hb rw [← Real.exp_log hb0, ← Real.exp_nat_mul, Real.rpow_def_of_pos hL] apply Real.exp_le_exp.mpr have hh := mul_le_mul_of_nonneg_left hs (mul_nonneg (Nat.cast_nonneg m) (Real.log_nonneg hb)) rw [Real.log_exp] push_cast nlinarith /- Concrete scalar error budget after the finite pattern count. -/ noncomputable def repeatedBigNumericError (s m J ell Q : ℕ) (xi T P v : ℝ) : ℝ := (1 + (2 : ℝ) ^ (m * s) * (((Q * Q : ℕ) : ℝ) / xi) ^ 2) * ((((2 * s * (ell + m) : ℕ) : ℝ) * T / P) + (s : ℝ) * ((m : ℝ) * (2 * ((J + ell : ℕ) : ℝ))) / (v * P)) /- Fixed constants in the density and collision errors. -/ noncomputable def repeatedBigNumericErrorConstant (m J ell : ℕ) (a v : ℝ) : ℝ := 2 * (2 * a * ((ell + m : ℕ) : ℝ) + a * ((m : ℝ) * (2 * ((J + ell : ℕ) : ℝ))) / v) /- All factors in the actual finite pattern error are bounded explicitly; no estimate for that error is assumed as a premise. -/ theorem repeated_big_numeric_error_le {L a q x tau v T P xi : ℝ} (s m J ell Q : ℕ) (hL : 1 ≤ L) (ha : 0 ≤ a) (hq : 0 ≤ q) (hx : 0 ≤ x) (htau : 0 ≤ tau) (hv : 0 < v) (hP : 0 < P) (hs : (s : ℝ) ≤ a * Real.log L) (hQ : (Q : ℝ) ≤ L ^ q) (hxi : L ^ (-x) ≤ xi) (hT0 : 0 ≤ T) (hT : T ≤ L ^ tau) : repeatedBigNumericError s m J ell Q xi T P v ≤ repeatedBigNumericErrorConstant m J ell a v * L ^ ((m : ℝ) * a * Real.log 2 + 4 * q + 2 * x + tau + 1) / P := by have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL have hxi0 : 0 < xi := lt_of_lt_of_le (Real.rpow_pos_of_pos hL0 _) hxi have hsL : (s : ℝ) ≤ a * L := hs.trans (mul_le_mul_of_nonneg_left (Real.log_le_self hL0.le) ha) have htwo := repeated_big_log_count_pow_le (L := L) (a := a) (b := 2) m s hL0 (by norm_num) hs have hQ2 : ((Q * Q : ℕ) : ℝ) ≤ L ^ (2 * q) := by push_cast calc (Q : ℝ) * Q ≤ L ^ q * L ^ q := mul_le_mul hQ hQ (Nat.cast_nonneg _) (by positivity) _ = L ^ (2 * q) := by rw [← Real.rpow_add hL0]; congr 1; ring have hratio : ((Q * Q : ℕ) : ℝ) / xi ≤ L ^ (2 * q + x) := by calc _ ≤ L ^ (2 * q) / L ^ (-x) := div_le_div₀ (by positivity) hQ2 (Real.rpow_pos_of_pos hL0 _) hxi _ = _ := by rw [← Real.rpow_sub hL0]; congr 1; ring have hB : (((Q * Q : ℕ) : ℝ) / xi) ^ 2 ≤ L ^ (4 * q + 2 * x) := by calc _ ≤ (L ^ (2 * q + x)) ^ (2 : ℕ) := pow_le_pow_left₀ (by positivity) hratio 2 _ = _ := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL0.le]; congr 1; ring have hgamma : 0 ≤ (m : ℝ) * a * Real.log 2 + 4 * q + 2 * x := by have hl : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num) positivity have hcoeff : 1 + (2 : ℝ) ^ (m * s) * (((Q * Q : ℕ) : ℝ) / xi) ^ 2 ≤ 2 * L ^ ((m : ℝ) * a * Real.log 2 + 4 * q + 2 * x) := by have hp := mul_le_mul htwo hB (sq_nonneg _) (Real.rpow_nonneg hL0.le _) rw [← Real.rpow_add hL0, ← add_assoc] at hp have hone := Real.one_le_rpow hL hgamma nlinarith have hLtau : L ≤ L ^ (tau + 1) := by simpa only [Real.rpow_one] using Real.rpow_le_rpow_of_exponent_le hL (show (1 : ℝ) ≤ tau + 1 by linarith) have hdensity : (((2 * s * (ell + m) : ℕ) : ℝ) * T) ≤ (2 * a * ((ell + m : ℕ) : ℝ)) * L ^ (tau + 1) := by have hh := mul_le_mul hsL hT hT0 (by positivity : 0 ≤ a * L) have hh' := mul_le_mul_of_nonneg_left hh (show 0 ≤ 2 * ((ell + m : ℕ) : ℝ) by positivity) rw [Real.rpow_add hL0, Real.rpow_one] push_cast at hh' ⊢ ring_nf at hh' ⊢ exact hh' have hcollision : (s : ℝ) * ((m : ℝ) * (2 * ((J + ell : ℕ) : ℝ))) / v ≤ (a * ((m : ℝ) * (2 * ((J + ell : ℕ) : ℝ))) / v) * L ^ (tau + 1) := by have hh := hsL.trans (mul_le_mul_of_nonneg_left hLtau ha) have hh' := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hh (by positivity : 0 ≤ (m : ℝ) * (2 * ((J + ell : ℕ) : ℝ)))) hv.le ring_nf at hh' ⊢ exact hh' unfold repeatedBigNumericError repeatedBigNumericErrorConstant have hsum : (((2 * s * (ell + m) : ℕ) : ℝ) * T / P) + (s : ℝ) * ((m : ℝ) * (2 * ((J + ell : ℕ) : ℝ))) / (v * P) ≤ (2 * a * ((ell + m : ℕ) : ℝ) + a * ((m : ℝ) * (2 * ((J + ell : ℕ) : ℝ))) / v) * L ^ (tau + 1) / P := by have hh := div_le_div_of_nonneg_right (add_le_add hdensity hcollision) hP.le ring_nf at hh ⊢ exact hh calc _ ≤ (2 * L ^ ((m : ℝ) * a * Real.log 2 + 4 * q + 2 * x)) * ((2 * a * ((ell + m : ℕ) : ℝ) + a * ((m : ℝ) * (2 * ((J + ell : ℕ) : ℝ))) / v) * L ^ (tau + 1) / P) := mul_le_mul hcoeff hsum (by positivity) (by positivity) _ = _ := by rw [show L ^ ((m : ℝ) * a * Real.log 2 + 4 * q + 2 * x + tau + 1) = L ^ ((m : ℝ) * a * Real.log 2 + 4 * q + 2 * x) * L ^ (tau + 1) by rw [← Real.rpow_add hL0]; congr 1; ring] ring /- Uniform power saving for the literal density-plus-collision budget. The cutoff, density loss, group count, and smallest prime remain quantified inside the eventual statement. -/ theorem eventually_repeated_big_numeric_error_small (m J ell : ℕ) {a q x tau v c : ℝ} (ha : 0 ≤ a) (hq : 0 ≤ q) (hx : 0 ≤ x) (htau : 0 ≤ tau) (hv : 0 < v) (hc : 0 < c) (E : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (s Q : ℕ) (xi T P : ℝ), (s : ℝ) ≤ a * Real.log L → (Q : ℝ) ≤ L ^ q → L ^ (-x) ≤ xi → 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ P → repeatedBigNumericError s m J ell Q xi T P v ≤ L ^ (-E) := by let K := repeatedBigNumericErrorConstant m J ell a v let d := (m : ℝ) * a * Real.log 2 + 4 * q + 2 * x + tau + 1 filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop K, eventually_exp_neg_rpow_mul_rpow_le hc (show (0 : ℝ) < 1 by norm_num) (d + 1) E] with L hL hKL hdecay intro s Q xi T P hs hQ hxi hT0 hT hP have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL have hP0 : 0 < P := lt_of_lt_of_le (Real.exp_pos _) hP have hbase := repeated_big_numeric_error_le s m J ell Q hL ha hq hx htau hv hP0 hs hQ hxi hT0 hT change repeatedBigNumericError s m J ell Q xi T P v ≤ K * L ^ d / P at hbase calc _ ≤ K * L ^ d / P := hbase _ ≤ L * L ^ d / Real.exp (L ^ c) := div_le_div₀ (mul_nonneg hL0.le (Real.rpow_nonneg hL0.le _)) (mul_le_mul_of_nonneg_right hKL (Real.rpow_nonneg hL0.le _)) (Real.exp_pos _) hP _ = Real.exp (-1 * L ^ c) * L ^ (d + 1) := by rw [show L ^ (d + 1) = L ^ d * L by rw [Real.rpow_add hL0, Real.rpow_one]] simp only [neg_mul, one_mul, Real.exp_neg] ring _ ≤ _ := hdecay /- The two block losses and the complete finite probe sum fit the desired power bound with one power of slack in the parameter choices. -/ theorem repeated_big_positive_block_bound {L theta beta a D E : ℝ} (m s r t n : ℕ) (hL : 3 ≤ L) (htheta : 0 < theta) (htheta1 : theta ≤ 1) (hr : beta * Real.log L ≤ (r : ℝ)) (ht : beta * Real.log L ≤ (t : ℝ)) (hs : (s : ℝ) ≤ a * Real.log L) (hn : n ≤ m * s) (hgap : beta * Real.log theta / 2 ≤ -(E + 1)) (hD : (m : ℝ) * a * Real.log 3 + E + 1 ≤ D) : Real.sqrt (theta ^ r) + Real.sqrt (theta ^ t) + (3 : ℝ) ^ n * L ^ (-D) ≤ L ^ (-E) := by have hL1 : 1 ≤ L := by linarith have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL1 have hr' := repeated_big_sqrt_probe_le hL1 htheta htheta1 hr hgap have ht' := repeated_big_sqrt_probe_le hL1 htheta htheta1 ht hgap have hn' : (3 : ℝ) ^ n * L ^ (-D) ≤ L ^ (-(E + 1)) := by calc _ ≤ (3 : ℝ) ^ (m * s) * L ^ (-D) := mul_le_mul_of_nonneg_right (pow_le_pow_right₀ (by norm_num) hn) (Real.rpow_nonneg hL0.le _) _ ≤ L ^ ((m : ℝ) * a * Real.log 3) * L ^ (-D) := mul_le_mul_of_nonneg_right (repeated_big_log_count_pow_le m s hL0 (by norm_num) hs) (Real.rpow_nonneg hL0.le _) _ = L ^ ((m : ℝ) * a * Real.log 3 - D) := by rw [← Real.rpow_add hL0]; rfl _ ≤ _ := Real.rpow_le_rpow_of_exponent_le hL1 (by linarith) have hlast : 3 * L ^ (-(E + 1)) ≤ L ^ (-E) := by rw [show -(E + 1) = -E - 1 by ring, Real.rpow_sub hL0, Real.rpow_one, ← mul_div_assoc] apply (div_le_iff₀ hL0).mpr nlinarith [Real.rpow_pos_of_pos hL0 (-E)] linarith end Bounty end section /- Exact damping factorization for the complete clean pattern action. The ordered memory occurrences stay in the residue fiber. Both adjacent active projections remain in their original order. -/ open Finset open scoped Classical namespace Bounty noncomputable def cleanResidueWeightMap {X R : Type*} (w : R → ℝ) (f : X → R → ℂ) (x : X) (r : R) : ℂ := (w r : ℂ) * f x r theorem clean_active_map_residue_weight {X R : Type*} (Proj : (X → ℂ) →ₗ[ℂ] (X → ℂ)) (w : R → ℝ) (f : X → R → ℂ) : cleanActiveMap Proj (cleanResidueWeightMap w f) = cleanResidueWeightMap w (cleanActiveMap Proj f) := by funext x r change Proj ((w r : ℂ) • fun y => f y r) x = _ rw [map_smul] rfl noncomputable def cleanHybridPatternDampedAction {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell : ℕ} {N : G → ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (B : G → ℕ) (p : FixedOrderedMemoryLabels Pb N) (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : RepeatedBigLists Pb J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ) (source : RepeatedBigLists Pb J ell) (r : PhysicalResidues Ps × FixedOrderedResidues p) : ℂ := ∑ i, ∑ aux, ∑ target, (cleanHybridBetweenKernel Vb b (C i) ζ θ ρ k B p r.2 (K i) d aux source target * physicalPhase ζ (physicalSharedProduct d)) * f target (physicalTranslateResidues r.1 (cleanHybridStep k (C i) source aux d), fixedOrderedResidueTranslate p r.2 (cleanHybridStep k (C i) source aux d)) section variable {I S G : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : Fintype S] [sharedInstance3 : Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell : ℕ} {N : G → ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (B : G → ℕ) (p : FixedOrderedMemoryLabels Pb N) (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) include I S G sharedInstance1 sharedInstance2 sharedInstance3 Ps Pb J ell N Vb b C ζ θ ρ k B p K d theorem clean_hybrid_pattern_damped_factorization (f : RepeatedBigLists Pb J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ) : cleanHybridPatternDampedAction Vb b C ζ θ ρ k B p K d f = cleanResidueWeightMap (fun r => cleanMemoryInputWeight ρ p r.2) (cleanHybridPatternCoreAction Vb b C ζ θ k p K d (cleanResidueWeightMap (fun r => cleanMemoryOutputWeight ρ B p r.2) f)) := by funext source r simp only [cleanHybridPatternDampedAction, cleanHybridPatternCoreAction, cleanHybridCoreAction, cleanResidueWeightMap, mul_sum] apply sum_congr rfl intro i _ apply sum_congr rfl intro aux _ apply sum_congr rfl intro target _ simp only [cleanHybridBetweenKernel, cleanHybridCoreCoefficient, clean_hybrid_memory_factor_split, Complex.ofReal_mul] ring theorem clean_hybrid_projected_damped_factorization (Proj : (RepeatedBigLists Pb J ell → ℂ) →ₗ[ℂ] (RepeatedBigLists Pb J ell → ℂ)) (f : RepeatedBigLists Pb J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ) : cleanActiveMap Proj (cleanHybridPatternDampedAction Vb b C ζ θ ρ k B p K d (cleanActiveMap Proj f)) = cleanResidueWeightMap (fun r => cleanMemoryInputWeight ρ p r.2) (cleanActiveMap Proj (cleanHybridPatternCoreAction Vb b C ζ θ k p K d (cleanActiveMap Proj (cleanResidueWeightMap (fun r => cleanMemoryOutputWeight ρ B p r.2) f)))) := by rw [clean_hybrid_pattern_damped_factorization, clean_active_map_residue_weight, clean_active_map_residue_weight] end theorem clean_residue_weight_norm_le {X R : Type*} [Fintype X] [Fintype R] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (w : R → ℝ) (hw0 : ∀ r, 0 ≤ w r) (hw1 : ∀ r, w r ≤ 1) (f : X → R → ℂ) : cleanWeightedNorm μ (cleanResidueWeightMap w f) ≤ cleanWeightedNorm μ f := by apply Real.sqrt_le_sqrt apply sum_le_sum intro x _ apply mul_le_mul_of_nonneg_left _ (hμ x) apply sum_le_sum intro r _ apply pow_le_pow_left₀ (norm_nonneg _) calc ‖cleanResidueWeightMap w f x r‖ = w r * ‖f x r‖ := by simp only [cleanResidueWeightMap, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hw0 r)] _ ≤ 1 * ‖f x r‖ := mul_le_mul_of_nonneg_right (hw1 r) (norm_nonneg _) _ = _ := one_mul _ theorem clean_hybrid_projected_damped_norm_le {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell : ℕ} {N : G → ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) (k : ℤ) (B : G → ℕ) (p : FixedOrderedMemoryLabels Pb N) [∀ q : PhysicalPrime Ps, NeZero q.2.val] [∀ g j, NeZero (p g j).val] (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (Proj : (RepeatedBigLists Pb J ell → ℂ) →ₗ[ℂ] (RepeatedBigLists Pb J ell → ℂ)) (w : RepeatedBigLists Pb J ell → ℝ) (hw : ∀ x, 0 ≤ w x) (M : ℝ) (hM : 0 ≤ M) (hcore : ∀ f, cleanWeightedNorm w (cleanActiveMap Proj (cleanHybridPatternCoreAction Vb b C ζ θ k p K d (cleanActiveMap Proj f))) ≤ M * cleanWeightedNorm w f) (f : RepeatedBigLists Pb J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ) : cleanWeightedNorm w (cleanActiveMap Proj (cleanHybridPatternDampedAction Vb b C ζ θ ρ k B p K d (cleanActiveMap Proj f))) ≤ M * cleanWeightedNorm w f := by rw [clean_hybrid_projected_damped_factorization] exact (clean_residue_weight_norm_le w hw (fun r : PhysicalResidues Ps × FixedOrderedResidues p => cleanMemoryInputWeight ρ p r.2) (fun r => clean_memory_input_weight_nonneg hρ0 p r.2) (fun r => clean_memory_input_weight_le_one hρ0 hρ1 p r.2) _).trans ((hcore _).trans (mul_le_mul_of_nonneg_left (clean_residue_weight_norm_le w hw (fun r : PhysicalResidues Ps × FixedOrderedResidues p => cleanMemoryOutputWeight ρ B p r.2) (fun r => clean_memory_output_weight_nonneg hρ0 B p r.2) (fun r => clean_memory_output_weight_le_one hρ0 hρ1 B p r.2) f) hM)) end Bounty end section /- Exact coordinates for the full bounded product memory. Every ordered occurrence keeps its own prime label and residue, including repeated labels. The active slots are the literal first and tail blocks of the clean kernel. -/ open Finset open scoped Classical namespace Bounty abbrev CleanFullMemoryState {G : Type*} (P : G → Finset ℕ) (J ell B : ℕ) := ProductBoundedOrderedState (fun g => ↥(P g)) (fun g => UnrestrictedResidueParticle (fun p : P g => p.val)) (fun _ => J + ell) B abbrev CleanFullMemoryCoordinates {G : Type*} (P : G → Finset ℕ) (J ell B : ℕ) := Σ N : G → Fin (B + 1), Σ p : FixedOrderedMemoryLabels P (fun g => (N g).val), RepeatedBigLists P J ell × FixedOrderedResidues p def cleanFullMemoryState {G : Type*} {P : G → Finset ℕ} {J ell B : ℕ} (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) : CleanFullMemoryState P J ell B := fun g => (fun j => source g (finSumFinEquiv.symm j), ⟨N g, fun j => ⟨p g j, r g j⟩⟩) def cleanFullMemoryEquiv {G : Type*} (P : G → Finset ℕ) (J ell B : ℕ) : CleanFullMemoryState P J ell B ≃ CleanFullMemoryCoordinates P J ell B where toFun x := ⟨fun g => (x g).2.1, fun g j => ((x g).2.2 j).1, (fun g j => (x g).1 (finSumFinEquiv j)), fun g j => ((x g).2.2 j).2⟩ invFun x := cleanFullMemoryState x.1 x.2.1 x.2.2.1 x.2.2.2 left_inv x := by funext g apply Prod.ext · funext j simp only [cleanFullMemoryState, Equiv.apply_symm_apply] · rfl right_inv x := by rcases x with ⟨N, p, source, r⟩ simp only [cleanFullMemoryState, Equiv.symm_apply_apply] theorem cleanFullMemoryEquiv_symm_apply {G : Type*} (P : G → Finset ℕ) (J ell B : ℕ) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) : (cleanFullMemoryEquiv P J ell B).symm ⟨N, p, source, r⟩ = cleanFullMemoryState N p source r := rfl theorem cleanFullMemoryState_total_memory {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell B : ℕ} (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) : productTotalMemory (cleanFullMemoryState N p source r) = ∑ g, (N g).val := rfl noncomputable def cleanMemoryLabelWeight {G : Type*} [Fintype G] {P : G → Finset ℕ} {B : ℕ} (ν : ∀ g, P g → ℝ) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) : ℝ := ∏ g, (∏ j, ν g (p g j)) / ((N g).val.factorial : ℝ) theorem cleanFullMemoryState_weight {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell B : ℕ} (μ ν : ∀ g, P g → ℝ) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) : productMemoryWeight μ (fun g z => ν g z.1) (cleanFullMemoryState N p source r) = (∏ g, ∏ s, μ g (source g s)) * cleanMemoryLabelWeight ν N p := by unfold productMemoryWeight boundedOrderedStateWeight boundedOrderedMemoryWeight cleanFullMemoryState cleanMemoryLabelWeight rw [← prod_mul_distrib] apply prod_congr rfl intro g _ congr 1 exact Equiv.prod_comp finSumFinEquiv.symm (fun s => μ g (source g s)) theorem clean_full_memory_sum {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (μ ν : ∀ g, P g → ℝ) (F : CleanFullMemoryState P J ell B → ℝ) : (∑ x : CleanFullMemoryState P J ell B, productMemoryWeight μ (fun g z => ν g z.1) x * F x) = ∑ N : G → Fin (B + 1), ∑ p : FixedOrderedMemoryLabels P (fun g => (N g).val), cleanMemoryLabelWeight ν N p * ∑ source : RepeatedBigLists P J ell, (∏ g, ∏ s, μ g (source g s)) * ∑ r : FixedOrderedResidues p, F (cleanFullMemoryState N p source r) := by rw [← (cleanFullMemoryEquiv P J ell B).symm.sum_comp (fun x => productMemoryWeight μ (fun g z => ν g z.1) x * F x)] rw [Fintype.sum_sigma] apply sum_congr rfl intro N _ rw [Fintype.sum_sigma] apply sum_congr rfl intro p _ rw [Fintype.sum_prod_type, mul_sum] apply sum_congr rfl intro source _ rw [mul_sum, mul_sum] apply sum_congr rfl intro r _ rw [cleanFullMemoryEquiv_symm_apply, cleanFullMemoryState_weight] ring theorem cleanMemoryLabelWeight_nonneg {G : Type*} [Fintype G] {P : G → Finset ℕ} {B : ℕ} (ν : ∀ g, P g → ℝ) (hν : ∀ g p, 0 ≤ ν g p) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) : 0 ≤ cleanMemoryLabelWeight ν N p := prod_nonneg fun g _ => div_nonneg (prod_nonneg fun j _ => hν g (p g j)) (Nat.cast_nonneg _) theorem clean_full_memory_tilted_residue_energy {G R : Type*} [Fintype G] [DecidableEq G] [Fintype R] {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (V : G → ℝ) (b : ∀ g, P g → ℝ) (ν : ∀ g, P g → ℝ) (f : CleanFullMemoryState P J ell B → R → ℂ) : (∑ x : CleanFullMemoryState P J ell B, productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1) x * ∑ r : R, ‖f x r‖ ^ 2) = ∑ N : G → Fin (B + 1), ∑ p : FixedOrderedMemoryLabels P (fun g => (N g).val), cleanMemoryLabelWeight ν N p * ∑ source : RepeatedBigLists P J ell, repeatedBigActiveMass V b source * ∑ r : R × FixedOrderedResidues p, ‖f (cleanFullMemoryState N p source r.2) r.1‖ ^ 2 := by rw [clean_full_memory_sum] apply sum_congr rfl intro N _ apply sum_congr rfl intro p _ congr 1 apply sum_congr rfl intro source _ congr 1 rw [Fintype.sum_prod_type, sum_comm] end Bounty end section /- Exact reindexing and binary partition of finite ordered product lists. -/ open Finset namespace Bounty section variable {I J : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : Fintype J] [sharedInstance3 : DecidableEq I] [sharedInstance4 : DecidableEq J] include I J sharedInstance1 sharedInstance2 sharedInstance3 sharedInstance4 theorem ordered_slot_sum_test_equiv (choices : J → Finset ℕ) (e : I ≃ J) (F : ℕ → ℝ) : (∑ x : ∀ j, choices j, F (orderedSlotProduct choices x)) = ∑ y : ∀ i, choices (e i), F (orderedSlotProduct (fun i => choices (e i)) y) := by classical apply Fintype.sum_equiv (Equiv.piCongrLeft (fun j => choices j) e).symm intro x congr 1 exact (e.prod_comp (fun j => (x j).val)).symm theorem ordered_slot_weight_equiv (choices : J → Finset ℕ) (e : I ≃ J) (normalization : ℝ) (n : ℕ) : orderedSlotWeight choices normalization n = orderedSlotWeight (fun i => choices (e i)) normalization n := by classical unfold orderedSlotWeight convert ordered_slot_sum_test_equiv choices e (fun d => if d = n then 1/normalization else 0) using 1 all_goals apply Finset.sum_congr (by ext; simp); intro x _; rfl theorem ordered_slot_sum_test_sum (A : I → Finset ℕ) (B : J → Finset ℕ) (F : ℕ → ℝ) : (∑ x : ∀ i : I ⊕ J, ↥(Sum.elim A B i), F (orderedSlotProduct (Sum.elim A B) x)) = ∑ a : ∀ i, A i, ∑ b : ∀ j, B j, F (orderedSlotProduct A a * orderedSlotProduct B b) := by classical let f : (∀ i, A i) × (∀ j, B j) → ℝ := fun y => F (orderedSlotProduct A y.1 * orderedSlotProduct B y.2) calc _ = ∑ y, f y := by apply Fintype.sum_equiv (Equiv.sumPiEquivProdPi (fun i : I ⊕ J => ↥(Sum.elim A B i))) intro x congr 1 exact Fintype.prod_sum_type (fun i => (x i).val) _ = _ := Fintype.sum_prod_type f theorem ordered_slot_weight_sum_split (A : I → Finset ℕ) (B : J → Finset ℕ) (normalization : ℝ) (n : ℕ) : orderedSlotWeight (Sum.elim A B) normalization n = ∑ a : ∀ i, A i, ∑ b : ∀ j, B j, if orderedSlotProduct A a * orderedSlotProduct B b = n then 1/normalization else 0 := by classical unfold orderedSlotWeight convert ordered_slot_sum_test_sum A B (fun d => if d = n then 1/normalization else 0) using 1 apply Finset.sum_congr (by ext; simp) intro x _ rfl end end Bounty end section /- Exact one-mark expansions, including the endpoint q = 0. -/ open Finset namespace Bounty theorem one_marked_factor_choice_sum {G : Type*} (P : G → Finset ℕ) (g : G) (q V : ℝ) (n : ℤ) : markedDivisorFactor q V (physicalOmega P g n) 1 = ∑ p : P g, if (p.val : ℤ) ∣ n then q^(physicalOmega P g n - 1)/V else 0 := by classical rw [sum_coe_sort (P g) (fun p : ℕ => if (p : ℤ) ∣ n then q^(physicalOmega P g n - 1)/V else 0)] rw [← sum_filter] simp only [sum_const, nsmul_eq_mul] unfold markedDivisorFactor physicalOmega physicalDivisorPool simp only [Nat.descFactorial_one, pow_one] ring theorem one_marked_weight_choice_sum {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (n : ℤ) : markedDivisorWeight groups P q V (fun _ => 1) n = ∑ x : ∀ g : groups, P g.val, ∏ g : groups, if ((x g).val : ℤ) ∣ n then q^(physicalOmega P g.val n - 1)/V g.val else 0 := by classical unfold markedDivisorWeight rw [← prod_coe_sort groups] simp_rw [one_marked_factor_choice_sum] exact Fintype.prod_sum _ end Bounty end section /- Exact isolation of one independent sample; the remaining factor cannot read it. -/ open Finset Classical namespace Bounty end Bounty namespace Bounty open Finset Classical end Bounty end section /- Fixed count, retention, storage and promotion factors in the original event laws. -/ open Finset Classical namespace Bounty noncomputable def boundedGhostSkeletonAbsMass {P Z : Type*} (A D : Z → ℝ) (t B : ℕ) (s : BoundedOrderedState P Z t B) (b : Fin (B + 1)) (retained : Finset (Fin s.2.1.val)) : ℝ := if retained.card + b.val ≤ B then |((∏ j ∈ retained, A (s.2.2 j)) * (∏ j ∈ univ \ retained, D (s.2.2 j))) / (b.val.factorial : ℝ)| else 0 theorem bounded_ghost_skeleton_abs_mass_nonneg {P Z : Type*} (A D : Z → ℝ) (t B : ℕ) (s : BoundedOrderedState P Z t B) (b : Fin (B + 1)) (retained : Finset (Fin s.2.1.val)) : 0 ≤ boundedGhostSkeletonAbsMass A D t B s b retained := by unfold boundedGhostSkeletonAbsMass split_ifs · exact abs_nonneg _ · exact le_rfl theorem bounded_ghost_event_abs_factor {P Z : Type*} (A D C ν : Z → ℝ) (hν : ∀ z, 0 ≤ ν z) (t B : ℕ) (s : BoundedOrderedState P Z t B) (b : Fin (B + 1)) (retained : Finset (Fin s.2.1.val)) (births : Fin b.val → Z) : |boundedGhostEventWeight A D C ν t B s ⟨b, retained, births⟩| = boundedGhostSkeletonAbsMass A D t B s b retained * ∏ j, |C (births j)| * ν (births j) := by have hp : |∏ j, C (births j) * ν (births j)| = ∏ j, |C (births j)| * ν (births j) := by rw [abs_prod] apply prod_congr rfl intro j _ rw [abs_mul, abs_of_nonneg (hν _)] unfold boundedGhostEventWeight boundedGhostSkeletonAbsMass dsimp only split_ifs · rw [abs_div, abs_mul, hp, abs_div] ring · simp only [abs_zero, zero_mul] noncomputable def unrestrictedBoundedSkeletonMass {P : Type*} (n : P → ℕ) (Δ D : ℤ) (ρ V : ℝ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (stores promotions : Finset (Fin t)) (e : promotions ↪ ↥(unrestrictedResidueEligible n Δ D s.2.2)) : ℝ := if unrestrictedResidueStorageAllowed n D s.1 stores ∧ (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) stores promotions e).1 ≤ B then (ρ ^ orderedPredicateCount ⟨s.2.1.val, s.2.2⟩ unrestrictedResidueHit * ρ ^ orderedPredicateCount (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) stores promotions e) unrestrictedResidueHit) / V ^ promotions.card else 0 theorem unrestricted_bounded_skeleton_mass_nonneg {P : Type*} (n : P → ℕ) (Δ D : ℤ) (ρ V : ℝ) (hρ : 0 ≤ ρ) (hV : 0 ≤ V) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (stores promotions : Finset (Fin t)) (e : promotions ↪ ↥(unrestrictedResidueEligible n Δ D s.2.2)) : 0 ≤ unrestrictedBoundedSkeletonMass n Δ D ρ V t B s stores promotions e := by unfold unrestrictedBoundedSkeletonMass split_ifs · exact div_nonneg (mul_nonneg (pow_nonneg hρ _) (pow_nonneg hρ _)) (pow_nonneg hV _) · exact le_rfl theorem unrestricted_bounded_event_fresh_factor {P : Type*} (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (stores promotions : Finset (Fin t)) (e : promotions ↪ ↥(unrestrictedResidueEligible n Δ D s.2.2)) (fresh : UnrestrictedFreshLabels P promotions) : unrestrictedBoundedEventWeight n Δ D μ ρ V t B s ⟨stores, promotions, e, fresh⟩ = unrestrictedBoundedSkeletonMass n Δ D ρ V t B s stores promotions e * unrestrictedFreshWeight μ promotions fresh := by unfold unrestrictedBoundedEventWeight unrestrictedEdgeEventMass unrestrictedBoundedSkeletonMass dsimp only split_ifs · rfl · exact (zero_mul _).symm end Bounty end section /- Separating cumulative ledger avoidance leaves the exact original local edge factor. -/ open Finset open scoped Classical namespace Bounty theorem global_birth_bounded_edge_phase_factor {P : Type*} [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (target : Fin t → P) (H : Finset P) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) : globalBirthBoundedEdgePhase n Δ D t B target H s e.1 e.2.1 e.2.2.1 e.2.2.2 = (if ∀ i, e.2.2.2 i ∉ H then 1 else 0) * globalBirthBoundedEdgePhase n Δ D t B target ∅ s e.1 e.2.1 e.2.2.1 e.2.2.2 := by simp only [globalBirthBoundedEdgePhase, notMem_empty] split_ifs <;> simp_all theorem unrestricted_fresh_injective_of_target {P Z : Type*} {N t : ℕ} (old : Fin N → Z) (label : Z → P) (promotions : Finset (Fin t)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (fresh : UnrestrictedFreshLabels P promotions) (target : Fin t → P) (hinj : Function.Injective target) (htarget : unrestrictedEdgeTarget old label promotions e fresh = target) : Function.Injective fresh := by intro i j hij apply Subtype.ext apply hinj have hi : unrestrictedEdgeTarget old label promotions e fresh i.val = fresh i := by simp only [unrestrictedEdgeTarget, unrestrictedTargetLabels, dif_neg i.property] have hj : unrestrictedEdgeTarget old label promotions e fresh j.val = fresh j := by simp only [unrestrictedEdgeTarget, unrestrictedTargetLabels, dif_neg j.property] rw [htarget] at hi hj exact hi.trans (hij.trans hj.symm) section Full variable {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → Fin N → ℤ) (target : (g : Fin N) → Fin (S g)ᶜ.card → P g) (H : (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) theorem full_edge_ledger_phase_factor : fullEdgeLedgerPhase n S B A Δ D target H x e = (if ∀ g i, (e.2 g).2.2.2 i ∉ H g then 1 else 0) * fullEdgeLedgerPhase n S B A Δ D target (fun _ => ∅) x e := by unfold fullEdgeLedgerPhase trans (∏ g, if ∀ i, (e.2 g).2.2.2 i ∉ H g then (1 : ℂ) else 0) * (∏ g, globalBirthBoundedEdgePhase (n g) (Δ (productActiveMemorySplit S B x).1 e.1 g) (D (productActiveMemorySplit S B x).1 e.1 g) (S g)ᶜ.card B (target g) ∅ ((productActiveMemorySplit S B x).2 g) (e.2 g).1 (e.2 g).2.1 (e.2 g).2.2.1 (e.2 g).2.2.2) · rw [← prod_mul_distrib] apply prod_congr rfl intro g _ exact global_birth_bounded_edge_phase_factor _ _ _ _ _ _ _ _ (e.2 g) congr 1 by_cases h : ∀ g i, (e.2 g).2.2.2 i ∉ H g · rw [if_pos h] calc _ = ∏ _g : Fin N, (1 : ℂ) := prod_congr rfl (fun g _ => if_pos (h g)) _ = 1 := prod_const_one · rw [if_neg h] obtain ⟨g, hg⟩ := not_forall.mp h exact prod_eq_zero (mem_univ g) (if_neg hg) theorem full_edge_ledger_phase_target_of_nonzero (hphase : fullEdgeLedgerPhase n S B A Δ D target H x e ≠ 0) (g : Fin N) : unrestrictedEdgeTarget ((productActiveMemorySplit S B x).2 g).2.2 Sigma.fst (e.2 g).2.1 (e.2 g).2.2.1 (e.2 g).2.2.2 = target g := by by_contra h apply hphase apply prod_eq_zero (mem_univ g) simp only [globalBirthBoundedEdgePhase, h, false_and, if_false] theorem full_edge_ledger_phase_fresh_injective (hphase : fullEdgeLedgerPhase n S B A Δ D target H x e ≠ 0) (htarget : ∀ g, Function.Injective (target g)) (g : Fin N) : Function.Injective (e.2 g).2.2.2 := unrestricted_fresh_injective_of_target _ _ _ _ _ _ (htarget g) (full_edge_ledger_phase_target_of_nonzero n S B A Δ D target H x e hphase g) end Full end Bounty end section /- A finite path action only reads its initial value and the kernels in its prefix. -/ open Finset namespace Bounty theorem finite_path_action_prefix_congr {X R : Type*} [Fintype X] [Semiring R] (K H : ℕ → X → X → R) (f g : X → R) (n : ℕ) (hK : ∀ j < n, ∀ x y, K j x y = H j x y) (hf : ∀ x, f x = g x) (x : X) : finitePathAction K f n x = finitePathAction H g n x := by induction n generalizing x with | zero => exact hf x | succ n ih => simp only [finitePathAction] apply sum_congr rfl intro y hy rw [hK n (by omega) x y, ih (fun j hj => hK j (by omega)) y] end Bounty end section /- Multipliers depending only on active labels preserve the independent permutation symmetry of every pending memory tuple. -/ namespace Bounty theorem productMemoryPermuteAt_active {G : Type*} [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z t B) (g : G) (τ : Equiv.Perm (Fin (x g).2.1.val)) : (fun h => (productMemoryPermuteAt x g τ h).1) = (fun h => (x h).1) := by funext h by_cases hh : h = g · subst h simp only [productMemoryPermuteAt, Function.update_self] · simp only [productMemoryPermuteAt, Function.update_of_ne hh] theorem productMemorySymmetric_mul_active {G : Type*} [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} {K : Type*} [Mul K] (a : (∀ g, Fin (t g) → P g) → K) (f : ProductBoundedOrderedState P Z t B → K) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (fun x => a (fun g => (x g).1) * f x) := by intro x g τ change a (fun h => (productMemoryPermuteAt x g τ h).1) * f (productMemoryPermuteAt x g τ) = a (fun h => (x h).1) * f x rw [productMemoryPermuteAt_active, hf x g τ] end Bounty end section /- Exact clean-event extraction on bounded ordered memory states. The continuation remains symmetric in memory; target labels may repeat. -/ open Finset open scoped Classical namespace Bounty def unrestrictedBoundedCleanTarget {P : Type*} (n : P → ℕ) (Δ : ℤ) {t B : ℕ} (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (target : Fin t → P) : BoundedOrderedState P (UnrestrictedResidueParticle n) t B := (target, ⟨s.2.1, unrestrictedResidueTransport n Δ ∘ s.2.2⟩) section variable {P : Type*} [sharedInstance1 : Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (θ : (Fin t → P) → ℂ) (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) (hf : BoundedOrderedSymmetric f) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) include P sharedInstance1 n Δ D μ ρ V t B θ f hf s theorem unrestricted_bounded_operator_clean : unrestrictedBoundedOperator n Δ D μ ρ V t B (fun s stores promotions e fresh => if stores = ∅ ∧ promotions = ∅ then θ (unrestrictedEdgeTarget s.2.2 Sigma.fst promotions e fresh) else 0) f s = ((ρ ^ orderedPredicateCount (boundedOrderedTupleToFinite s.2) unrestrictedResidueHit * ρ ^ orderedPredicateCount (boundedOrderedTupleToFinite (unrestrictedBoundedCleanTarget n Δ s s.1).2) unrestrictedResidueHit : ℝ) : ℂ) * ∑ target : Fin t → P, ((∏ j, μ (target j) : ℝ) : ℂ) * θ target * f (unrestrictedBoundedCleanTarget n Δ s target) := by unfold unrestrictedBoundedOperator unrestrictedBoundedAction rw [unrestricted_residue_edge_action_clean n Δ D s.1 s.2.2 μ ρ V B θ (boundedOrderedZeroExtension f) ((boundedOrderedZeroExtension_symmetric_iff f).mpr hf)] rw [if_pos (Nat.le_of_lt_succ s.2.1.isLt)] congr 1 apply sum_congr rfl intro target ht congr 1 exact boundedOrderedZeroExtension_apply f (unrestrictedBoundedCleanTarget n Δ s target) theorem unrestricted_bounded_clean_event_sum : (∑ e : UnrestrictedBoundedEvent n Δ D t B s, (unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e : ℂ) * (if e.1 = ∅ ∧ e.2.1 = ∅ then θ (unrestrictedEdgeTarget s.2.2 Sigma.fst e.2.1 e.2.2.1 e.2.2.2) else 0) * f (unrestrictedBoundedEventTarget n Δ D t B s e)) = ((ρ ^ orderedPredicateCount (boundedOrderedTupleToFinite s.2) unrestrictedResidueHit * ρ ^ orderedPredicateCount (boundedOrderedTupleToFinite (unrestrictedBoundedCleanTarget n Δ s s.1).2) unrestrictedResidueHit : ℝ) : ℂ) * ∑ target : Fin t → P, ((∏ j, μ (target j) : ℝ) : ℂ) * θ target * f (unrestrictedBoundedCleanTarget n Δ s target) := by exact (unrestricted_bounded_operator_eq_event_sum n Δ D μ ρ V t B (fun s stores promotions e fresh => if stores = ∅ ∧ promotions = ∅ then θ (unrestrictedEdgeTarget s.2.2 Sigma.fst promotions e fresh) else 0) f s).symm.trans (unrestricted_bounded_operator_clean n Δ D μ ρ V t B θ f hf s) end theorem unrestricted_bounded_clean_target_fixed_memory {G : Type*} {P : G → Finset ℕ} {t B : ℕ} (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (r : FixedOrderedResidues p) (g : G) (Δ : ℤ) (source target : Fin t → P g) : unrestrictedBoundedCleanTarget (fun q : P g => q.val) (-Δ) (source, ⟨N g, fun j => ⟨p g j, r g j⟩⟩) target = (target, ⟨N g, fun j => ⟨p g j, fixedOrderedResidueTranslate p r Δ g j⟩⟩) := by apply congrArg (fun q : Fin (N g).val → UnrestrictedResidueParticle (fun q : P g => q.val) => (target, (⟨N g, q⟩ : BoundedOrderedTuple _ B))) funext j exact (fixed_ordered_residue_memory_transport_apply p r Δ g j).symm end Bounty end section /- One fixed damping choice controls every endpoint and interior visit. -/ namespace Bounty end Bounty end section /- Exact skeleton and sampled-coordinate decompositions of the existing full events. -/ open Classical namespace Bounty abbrev CoupledGhostSkeleton {G : Type*} {P Z : G → Type*} (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) := ∀ g, Fin (B + 1) × Finset (Fin (s g).2.1.val) abbrev CoupledGhostSampleIndex {G : Type*} {P Z : G → Type*} (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (sk : CoupledGhostSkeleton t B s) := (g : G) × Fin (sk g).1.val abbrev CoupledGhostSamples {G : Type*} {P Z : G → Type*} (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (sk : CoupledGhostSkeleton t B s) := (i : CoupledGhostSampleIndex t B s sk) → Z i.1 noncomputable def coupledGhostSkeletonEquiv {G : Type*} {P Z : G → Type*} (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) : CoupledGhostEvent t B s ≃ (sk : CoupledGhostSkeleton t B s) × CoupledGhostSamples t B s sk where toFun e := ⟨fun g => ⟨(e g).1, (e g).2.1⟩, fun i => (e i.1).2.2 i.2⟩ invFun v g := ⟨(v.1 g).1, (v.1 g).2, fun i => v.2 ⟨g, i⟩⟩ left_inv _ := rfl right_inv _ := rfl abbrev UnrestrictedLocalEdgeSkeleton {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) := (_stores : Finset (Fin t)) × (promotions : Finset (Fin t)) × (promotions ↪ ↥(unrestrictedResidueEligible n Δ D s.2.2)) abbrev FullActiveEdgeSkeleton {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) := (a : A (productActiveMemorySplit S B s).1) × ∀ g, UnrestrictedLocalEdgeSkeleton (n g) (Δ (productActiveMemorySplit S B s).1 a g) (D (productActiveMemorySplit S B s).1 a g) (S g)ᶜ.card B ((productActiveMemorySplit S B s).2 g) abbrev FullActiveEdgeSampleIndex {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n S B A Δ D s) := (g : G) × {i : Fin (S g)ᶜ.card // i ∉ (sk.2 g).2.1} abbrev FullActiveEdgeSamples {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n S B A Δ D s) := (i : FullActiveEdgeSampleIndex n S B A Δ D s sk) → P i.1 noncomputable def fullActiveEdgeSkeletonEquiv {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FullActiveEdgeEvent n S B A Δ D s ≃ (sk : FullActiveEdgeSkeleton n S B A Δ D s) × FullActiveEdgeSamples n S B A Δ D s sk where toFun e := by refine ⟨⟨e.1, ?_⟩, ?_⟩ · intro g exact ⟨(e.2 g).1, (e.2 g).2.1, (e.2 g).2.2.1⟩ · intro i exact (e.2 i.1).2.2.2 i.2 invFun v := by rcases v with ⟨⟨a, sk⟩, fresh⟩ exact ⟨a, fun g => ⟨(sk g).1, (sk g).2.1, (sk g).2.2, fun i => fresh ⟨g, i⟩⟩⟩ left_inv e := by rcases e with ⟨a, e⟩ rfl right_inv v := by rcases v with ⟨⟨a, sk⟩, fresh⟩ rfl end Bounty end section /- Splitting one sample retains a continuation at the fully reconstructed assignment. -/ open Finset Classical namespace Bounty end Bounty end section /- Birth-slot factors preserve memory symmetry while all old-particle retrievals are summed. -/ open Finset Classical namespace Bounty end Bounty end section /- Retention indices may be reindexed without changing any ordered birth address. -/ open Finset Classical namespace Bounty abbrev boundedGhostMemoryPermute {P Z : Type*} {t B : ℕ} (s : BoundedOrderedState P Z t B) (τ : Equiv.Perm (Fin s.2.1.val)) : BoundedOrderedState P Z t B := (s.1, ⟨s.2.1, s.2.2 ∘ τ⟩) noncomputable def boundedGhostEventPermEquiv {P Z : Type*} {t B : ℕ} (s : BoundedOrderedState P Z t B) (τ : Equiv.Perm (Fin s.2.1.val)) : BoundedGhostEvent t B s ≃ BoundedGhostEvent t B (boundedGhostMemoryPermute s τ) := Equiv.sigmaCongrRight fun _ => Equiv.prodCongr (Equiv.finsetCongr τ.symm) (Equiv.refl _) theorem boundedGhostEventPermEquiv_apply {P Z : Type*} {t B : ℕ} (s : BoundedOrderedState P Z t B) (τ : Equiv.Perm (Fin s.2.1.val)) (e : BoundedGhostEvent t B s) : boundedGhostEventPermEquiv s τ e = ⟨e.1, e.2.1.map τ.symm.toEmbedding, e.2.2⟩ := rfl theorem bounded_ghost_event_perm_weight {P Z : Type*} {t B : ℕ} (A D C ν : Z → ℝ) (s : BoundedOrderedState P Z t B) (τ : Equiv.Perm (Fin s.2.1.val)) (e : BoundedGhostEvent t B s) : boundedGhostEventWeight A D C ν t B (boundedGhostMemoryPermute s τ) (boundedGhostEventPermEquiv s τ e) = boundedGhostEventWeight A D C ν t B s e := by rcases e with ⟨b, retained, births⟩ rw [boundedGhostEventPermEquiv_apply] have hcomp : univ \ retained.map τ.symm.toEmbedding = (univ \ retained).map τ.symm.toEmbedding := by rw [Finset.map_sdiff] simp simp only [boundedGhostEventWeight, boundedGhostMemoryPermute, card_map, hcomp, prod_map, Function.comp_apply, Equiv.coe_toEmbedding, Equiv.apply_symm_apply] theorem bounded_ghost_event_perm_test {P Z : Type*} [Fintype Z] [DecidableEq Z] {t B : ℕ} (s : BoundedOrderedState P Z t B) (τ : Equiv.Perm (Fin s.2.1.val)) (e : BoundedGhostEvent t B s) (f : BoundedOrderedState P Z t B → ℂ) (hf : BoundedOrderedSymmetric f) : f (boundedGhostEventTarget t B (boundedGhostMemoryPermute s τ) (boundedGhostEventPermEquiv s τ e)) = f (boundedGhostEventTarget t B s e) := by rw [boundedGhostEventPermEquiv_apply] rcases e with ⟨b, retained, births⟩ have hocc : orderedTupleOccupancy (retainedBirthTuple (s.2.2 ∘ τ) (retained.map τ.symm.toEmbedding) births) = orderedTupleOccupancy (retainedBirthTuple s.2.2 retained births) := by simp only [retained_birth_tuple_occupancy, retainedTupleOccupancy, sum_map, Function.comp_apply, Equiv.coe_toEmbedding, Equiv.apply_symm_apply] have hext := symmetric_tuple_equal_on_occupancy (boundedOrderedZeroExtension f s.1) ((boundedOrderedZeroExtension_symmetric_iff f).mpr hf s.1) _ _ hocc by_cases h : retained.card + b.val ≤ B · simpa [boundedGhostEventTarget, boundedGhostMemoryPermute, boundedOrderedZeroExtension, retainedBirthTuple, h] using hext · simpa [boundedGhostEventTarget, boundedGhostMemoryPermute, retainedBirthTuple, h] using hf s.1 s.2.1 s.2.2 τ end Bounty end section /- Exact causal integration on the original dependent paths, including arbitrary path observables. -/ open Finset Classical namespace Bounty universe u v w z section Integral variable {K : Type u} {X : Type v} (E : K → X → Type w) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (weight : ∀ k x, E k x → ℝ) noncomputable def finiteEventPathIntegral (steps : List K) (x : X) (F : FiniteEventPath E target steps x → ℝ) : ℝ := let _ := finiteEventPathFintype E target steps x ∑ p, finiteEventPathWeight E target weight steps x p * F p theorem finite_event_path_integral_nil (x : X) (F : FiniteEventPath E target [] x → ℝ) : finiteEventPathIntegral E target weight [] x F = F PUnit.unit := by change (∑ p : PUnit.{w + 1}, 1 * F p) = F PUnit.unit simpa only [one_mul] using Fintype.sum_subsingleton (fun p : PUnit.{w + 1} => 1 * F p) PUnit.unit theorem finite_event_path_integral_cons (k : K) (steps : List K) (x : X) (F : FiniteEventPath E target (k :: steps) x → ℝ) : finiteEventPathIntegral E target weight (k :: steps) x F = ∑ e : E k x, weight k x e * finiteEventPathIntegral E target weight steps (target k x e) (fun p => F ⟨e, p⟩) := by let _ : ∀ e : E k x, Fintype (FiniteEventPath E target steps (target k x e)) := fun e => finiteEventPathFintype E target steps (target k x e) change (∑ p : (e : E k x) × FiniteEventPath E target steps (target k x e), (weight k x p.1 * finiteEventPathWeight E target weight steps _ p.2) * F p) = _ rw [Fintype.sum_sigma] simp only [finiteEventPathIntegral, mul_sum, mul_assoc] end Integral end Bounty end section /- The actual bounded edge row has the existing uniform length-weighted row bound. -/ open Finset Classical namespace Bounty theorem unrestricted_bounded_length_row_le_raw {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V v : ℝ) (hρ : 0 ≤ ρ) (hV : 0 ≤ V) (hv : 0 ≤ v) (hμ : ∀ p, 0 ≤ μ p) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : (∑ e : UnrestrictedBoundedEvent n Δ D t B s, |unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e| * v ^ (unrestrictedBoundedEventTarget n Δ D t B s e).2.1.val) ≤ unrestrictedEdgeRowMass s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ ρ V v (unrestrictedResidueEligible n Δ D s.2.2) := by simp only [Fintype.sum_sigma, Fintype.sum_prod_type, unrestrictedEdgeRowMass, unrestrictedEdgeChoiceRowMass] apply sum_le_sum intro stores _ apply sum_le_sum intro promotions _ apply sum_le_sum intro e _ apply sum_le_sum intro fresh _ rw [abs_of_nonneg (unrestrictedBoundedEventWeight_nonneg n Δ D μ hρ hV hμ t B s _)] by_cases h : unrestrictedResidueStorageAllowed n D s.1 stores ∧ (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) stores promotions e).1 ≤ B · simp [unrestrictedBoundedEventWeight, unrestrictedBoundedEventTarget, h.1, h.2] · simp only [unrestrictedBoundedEventWeight, h, if_false, zero_mul] exact mul_nonneg (unrestrictedEdgeEventMass_nonneg _ _ _ _ _ μ hρ hV hμ _ _ _ _) (pow_nonneg hv _) theorem unrestricted_bounded_length_row_le {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) {ρ V v vmin : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : vmin ≤ V) (hμ : ∀ p, 0 ≤ μ p) (hmass : ∑ p, μ p ≤ 2) (t B T : ℕ) (ht : t ≤ T) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : (∑ e : UnrestrictedBoundedEvent n Δ D t B s, |unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e| * v ^ (unrestrictedBoundedEventTarget n Δ D t B s e).2.1.val) ≤ v ^ s.2.1.val * unrestrictedEdgeRowBound ρ v vmin T := by exact (unrestricted_bounded_length_row_le_raw n Δ D μ ρ V v hρ0.le (hvmin.trans_le hV).le (zero_lt_one.trans hv).le hμ t B s).trans (unrestricted_edge_row_mass_le s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ hρ0 hρ1 hv hvmin hV hμ hmass (unrestrictedResidueEligible n Δ D s.2.2) (unrestrictedResidueEligible_translated_hit n Δ D s.2.2) T ht) end Bounty end section /- Scalar domination of nonnegative pair weights. -/ open Finset namespace Bounty theorem sum_nonneg_pair_coefficient_bound {ι : Type*} (F : Finset ι) (A f g : ι → ℝ) {K : ℝ} (hK : 0 ≤ K) (hA : ∀ v ∈ F, 0 ≤ A v) (hf : ∀ v ∈ F, f v ≤ K) (hg0 : ∀ v ∈ F, 0 ≤ g v) (hg : ∀ v ∈ F, g v ≤ K) : (∑ v ∈ F, A v*f v*g v) ≤ K^2*(∑ v ∈ F, A v) := by calc _ ≤ ∑ v ∈ F, A v*K^2 := by apply sum_le_sum intro v hv have hfg : f v*g v ≤ K*K := mul_le_mul (hf v hv) (hg v hv) (hg0 v hv) hK simpa only [pow_two, mul_assoc] using mul_le_mul_of_nonneg_left hfg (hA v hv) _ = _ := by rw [← sum_mul]; ring end Bounty end section /- Forbidden-label mass bounds for reciprocal-prime and tilted laws. The finite forbidden set and its cardinality remain explicit. -/ open Finset namespace Bounty end Bounty end section /- Exact normalized product marginals and finite forbidden-label union bounds. -/ open Finset open scoped Classical namespace Bounty theorem finite_forbidden_hits_mass_le {A P : Type*} [Fintype A] [DecidableEq A] [Fintype P] (μ : P → ℝ) (hμ0 : ∀ p, 0 ≤ μ p) (hμ : ∑ p, μ p = 1) (F : Finset P) (a0 : ℝ) (hatom : ∀ p, μ p ≤ a0) : (∑ f : A → P, cleanAuxiliaryWeight μ f * (if ∃ a, f a ∈ F then 1 else 0)) ≤ (Fintype.card A : ℝ) * F.card * a0 := by classical have he (f : A → P) : (∃ a, f a ∈ F) ↔ ∃ a, ∃ p : F, f a = p.val := by constructor · rintro ⟨a, ha⟩ exact ⟨a, ⟨f a, ha⟩, rfl⟩ · rintro ⟨a, p, hp⟩ exact ⟨a, hp ▸ p.property⟩ simp_rw [he] simpa only [Fintype.card_coe] using clean_auxiliary_hits_mass_le (A := A) μ hμ0 hμ (fun p : F => p.val) a0 hatom theorem finite_normalized_product_marginal {G : Type*} [Fintype G] [DecidableEq G] {X : G → Type*} [∀ g, Fintype (X g)] (w : ∀ g, X g → ℝ) (hw : ∀ g, ∑ x, w g x = 1) (g : G) (F : X g → ℝ) : (∑ x : ∀ g, X g, (∏ i, w i (x i)) * F (x g)) = ∑ x : X g, w g x * F x := by let factors (i : G) (x : X i) : ℝ := w i x * (if h : i = g then F (h ▸ x) else 1) have hprod (x : ∀ g, X g) : (∏ i, w i (x i)) * F (x g) = ∏ i, factors i (x i) := by simp only [factors, prod_mul_distrib] congr 1 rw [prod_eq_single g] · simp · intro i _ hig simp only [dif_neg hig] · simp simp_rw [hprod] rw [← Fintype.prod_sum factors, prod_eq_single g] · simp only [factors, ↓reduceDIte] · intro i _ hig simpa only [factors, dif_neg hig, mul_one] using hw i · simp theorem finite_product_forbidden_hits_mass_le {G : Type*} [Fintype G] [DecidableEq G] {A P : G → Type*} [∀ g, Fintype (A g)] [∀ g, DecidableEq (A g)] [∀ g, Fintype (P g)] (μ : ∀ g, P g → ℝ) (hμ0 : ∀ g p, 0 ≤ μ g p) (hμ : ∀ g, ∑ p, μ g p = 1) (F : ∀ g, Finset (P g)) (a0 : G → ℝ) (hatom : ∀ g p, μ g p ≤ a0 g) : (∑ f : ∀ g, A g → P g, (∏ g, ∏ a, μ g (f g a)) * (if ∃ g a, f g a ∈ F g then 1 else 0)) ≤ ∑ g, (Fintype.card (A g) : ℝ) * (F g).card * a0 g := by classical have hgroup (g : G) : (∑ f : A g → P g, ∏ a, μ g (f a)) = 1 := by rw [← Fintype.prod_sum] simp only [hμ, prod_const_one] calc _ ≤ ∑ g, ∑ f : ∀ g, A g → P g, (∏ g, ∏ a, μ g (f g a)) * (if ∃ a, f g a ∈ F g then 1 else 0) := by rw [sum_comm] apply sum_le_sum intro f _ have hn : 0 ≤ ∏ g, ∏ a, μ g (f g a) := prod_nonneg (fun g _ => prod_nonneg (fun a _ => hμ0 g (f g a))) have hnn : ∀ i ∈ (univ : Finset G), 0 ≤ (∏ g, ∏ a, μ g (f g a)) * (if ∃ a, f i a ∈ F i then 1 else 0) := by intro i _ exact mul_nonneg hn (by split_ifs <;> norm_num) by_cases he : ∃ g a, f g a ∈ F g · obtain ⟨g, a, ha⟩ := he rw [if_pos ⟨g, a, ha⟩, mul_one] have hs := single_le_sum hnn (mem_univ g) rw [if_pos ⟨a, ha⟩, mul_one] at hs exact hs · rw [if_neg he, mul_zero] exact sum_nonneg hnn _ = ∑ g, ∑ f : A g → P g, (∏ a, μ g (f a)) * (if ∃ a, f a ∈ F g then 1 else 0) := by apply sum_congr rfl intro g _ have hm := finite_normalized_product_marginal (X := fun g => A g → P g) (fun g f => ∏ a, μ g (f a)) hgroup g (fun f => if ∃ a, f a ∈ F g then 1 else 0) convert hm using 1 _ ≤ _ := by apply sum_le_sum intro g _ have hh := finite_forbidden_hits_mass_le (A := A g) (μ g) (hμ0 g) (hμ g) (F g) (a0 g) (hatom g) convert hh using 1 <;> rfl end Bounty end section /- One-sided rare target events give a square-root Schur gain. All rows keep their shared fiber. The banned-kernel estimates preserve the original auxiliary endpoint collision bans; no auxiliary initial-ledger mask is added. -/ open Finset open scoped Classical namespace Bounty theorem repeated_big_compatible_mass_balance {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (x y : RepeatedBigLists P J ell) : repeatedBigActiveMass V (fun _ _ => 1) x * (if repeatedBigSharedCompatible C x y then repeatedBigTargetMass V (fun _ _ => 1) C y else 0) = repeatedBigActiveMass V (fun _ _ => 1) y * (if repeatedBigSharedCompatible C y x then repeatedBigTargetMass V (fun _ _ => 1) C x else 0) := by by_cases h : repeatedBigSharedCompatible C x y · rw [if_pos h, if_pos (repeated_big_shared_compatible_symm C h)] exact repeated_big_active_target_mass_balance V (fun _ _ => 1) C h · have hr : ¬repeatedBigSharedCompatible C y x := fun hh => h (repeated_big_shared_compatible_symm C hh) simp only [if_neg h, if_neg hr, mul_zero] theorem repeated_big_rare_transition_norm {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (E : RepeatedBigLists P J ell → RepeatedBigLists P J ell → ℂ) (B : ℝ) (hB : 0 ≤ B) (hE : ∀ x y, ‖E x y‖ ≤ B * (if repeatedBigSharedCompatible C x y then repeatedBigTargetMass V (fun _ _ => 1) C y else 0)) (Q : RepeatedBigLists P J ell → Prop) (δ : ℝ) (hδ : 0 ≤ δ) (hQ : ∀ x, (∑ y, (if repeatedBigSharedCompatible C x y then repeatedBigTargetMass V (fun _ _ => 1) C y else 0) * (if Q y then 1 else 0)) ≤ δ) (f : RepeatedBigLists P J ell → ℂ) : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (fun x => ∑ y, (if Q y then E x y else 0) * f y) ≤ (B * Real.sqrt δ) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f := by let m := fun x y : RepeatedBigLists P J ell => if repeatedBigSharedCompatible C x y then repeatedBigTargetMass V (fun _ _ => 1) C y else 0 let w : RepeatedBigLists P J ell → ℝ := repeatedBigActiveMass V (fun _ _ => 1) have hw (x) : 0 ≤ w x := repeated_big_untilted_active_mass_nonneg V (fun g => (hV g).le) x have hm (x y) : 0 ≤ m x y := by dsimp only [m] split_ifs · exact repeated_big_untilted_target_mass_nonneg V (fun g => (hV g).le) C y · exact le_rfl have hb (x y) : ‖if Q y then E x y else 0‖ ≤ B * m x y := by split_ifs · exact hE x y · simpa only [norm_zero] using mul_nonneg hB (hm x y) have hr (x) : ∑ y, ‖if Q y then E x y else 0‖ ≤ B * δ := by calc _ ≤ ∑ y, B * (m x y * (if Q y then 1 else 0)) := by apply sum_le_sum intro y _ by_cases h : Q y · simpa only [if_pos h, mul_one] using hE x y · simp only [if_neg h, norm_zero, mul_zero, le_refl] _ = B * ∑ y, m x y * (if Q y then 1 else 0) := (mul_sum _ _ _).symm _ ≤ B * δ := mul_le_mul_of_nonneg_left (hQ x) hB have hc (y) : ∑ x, w x * ‖if Q y then E x y else 0‖ ≤ B * w y := by calc _ ≤ ∑ x, w x * (B * m x y) := sum_le_sum fun x _ => mul_le_mul_of_nonneg_left (hb x y) (hw x) _ = ∑ x, B * (w y * m y x) := by apply sum_congr rfl intro x _ calc _ = B * (w x * m x y) := by ring _ = _ := congrArg (fun z : ℝ => B * z) (repeated_big_compatible_mass_balance V C x y) _ = B * w y := by simp only [← mul_assoc, ← mul_sum, m, repeated_big_untilted_compatible_target_mass_sum V C hV hMass y, mul_one] have h := finite_weighted_schur_transition_norm univ w (fun _ => 1) (fun x y => if Q y then E x y else 0) (fun x _ => hw x) (fun _ _ => zero_lt_one) (mul_nonneg hB hδ) hB (fun x _ => by simpa only [mul_one] using hr x) (fun y _ => by simpa only [mul_one] using hc y) f have hs : Real.sqrt (B * δ * B) = B * Real.sqrt δ := by rw [show B * δ * B = B ^ 2 * δ by ring, Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq hB] simpa only [hs, cleanActiveNorm, w] using h theorem repeated_big_unbanned_transition_norm_le {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (_hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) (x y : RepeatedBigLists P J ell) : ‖∑ a, repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K a x y‖ ≤ B * (if repeatedBigSharedCompatible C x y then repeatedBigTargetMass V (fun _ _ => 1) C y else 0) := by by_cases h : repeatedBigSharedCompatible C x y · rw [if_pos h] calc _ ≤ ∑ a, ‖repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K a x y‖ := norm_sum_le _ _ _ ≤ ∑ a, physicalAuxMass V C a * B * repeatedBigTargetMass V (fun _ _ => 1) C y := by apply sum_le_sum intro a _ have ha := physical_aux_mass_nonneg V C (fun g => (hV g).le) a have ht := repeated_big_untilted_target_mass_nonneg V (fun g => (hV g).le) C y simp only [repeatedBigUnbannedKernel, if_pos h, norm_mul, physical_phase_norm, mul_one, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg ha, abs_of_nonneg ht] calc _ ≤ (physicalAuxMass V C a * repeatedBigTargetMass V (fun _ _ => 1) C y) * B := mul_le_mul_of_nonneg_left (hK x y a) (mul_nonneg ha ht) _ = _ := by ring _ = _ := by rw [← sum_mul, ← sum_mul, physical_aux_mass_sum V C hV hMass, one_mul] · simp only [repeatedBigUnbannedKernel, if_neg h, sum_const_zero, norm_zero, mul_zero, le_refl] theorem repeated_big_unbanned_target_mask_norm {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) (Q : RepeatedBigLists P J ell → Prop) (δ : ℝ) (hδ : 0 ≤ δ) (hQ : ∀ x, (∑ y, (if repeatedBigSharedCompatible C x y then repeatedBigTargetMass V (fun _ _ => 1) C y else 0) * (if Q y then 1 else 0)) ≤ δ) (f : RepeatedBigLists P J ell → ℂ) : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigUnbannedRowAction V C ζ (fun x y a => if Q y then K x y a else 0) f) ≤ (B * Real.sqrt δ) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f := by have h := repeated_big_rare_transition_norm V C hV hMass (fun x y => ∑ a, repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K a x y) B hB (repeated_big_unbanned_transition_norm_le V C hV hMass ζ K B hB hK) Q δ hδ hQ f have he : repeatedBigUnbannedRowAction V C ζ (fun x y a => if Q y then K x y a else 0) f = (fun x => ∑ y, (if Q y then ∑ a, repeatedBigUnbannedKernel V (fun _ _ => 1) C ζ K a x y else 0) * f y) := by funext x apply sum_congr rfl intro y _ by_cases hy : Q y <;> simp [repeatedBigUnbannedKernel, hy] rw [he] exact h end Bounty end section /- Positive group masses make the bare and memory path coefficients vanish together. -/ open Finset namespace Bounty theorem physical_memory_walk_scalar_zero_iff {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) : physicalMemoryWalkScalar V patterns C ζ K a L edges = 0 ↔ physicalBareWalkScalar V patterns C ζ K a L edges = 0 := by rw [physical_memory_walk_scalar_factor] have hn : (∏ j ∈ range edges, physicalCompletionMass V (C (a j).2.2.1.val) ell : ℝ) ≠ 0 := ne_of_gt (prod_pos (fun j _ => physical_completion_mass_pos V _ ell hV)) have hn' : ((∏ j ∈ range edges, physicalCompletionMass V (C (a j).2.2.1.val) ell : ℝ) : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hn exact (mul_eq_zero_iff_left hn').symm end Bounty end section /- Finite complex summation by parts with interval prefix sums. -/ open Finset namespace Bounty theorem complex_sum_Ioc_interval_by_parts (f g : ℕ → ℂ) {m n : ℕ} (hmn : m < n) : (∑ i ∈ Ioc m n, f i*g i) = f n*(∑ j ∈ Ioc m n, g j)- ∑ i ∈ Ioc m (n-1), (f (i+1)-f i)*(∑ j ∈ Ioc m i, g j) := by let h := fun j => if m < j then g j else 0 have hpref (k : ℕ) : (∑ j ∈ range (k+1), h j) = ∑ j ∈ Ioc m k, g j := by dsimp only [h] rw [← sum_filter] apply sum_congr · ext j simp only [mem_filter, mem_range, Nat.lt_succ_iff, mem_Ioc, and_comm] · intro j _ rfl have hh := sum_Ioc_by_parts f h hmn simp only [smul_eq_mul, hpref, Ioc_self, sum_empty, mul_zero, sub_zero] at hh convert hh using 1 apply sum_congr rfl intro i hi simp only [h, if_pos (mem_Ioc.mp hi).1] theorem norm_complex_sum_Ioc_le_of_interval_prefix (f g : ℕ → ℂ) {m n : ℕ} (hmn : m < n) {B : ℝ} (hprefix : ∀ i ∈ Icc m n, ‖∑ j ∈ Ioc m i, g j‖ ≤ B) : ‖∑ i ∈ Ioc m n, f i*g i‖ ≤ (‖f n‖+∑ i ∈ Ioc m (n-1), ‖f (i+1)-f i‖)*B := by rw [complex_sum_Ioc_interval_by_parts f g hmn] calc _ ≤ ‖f n*(∑ j ∈ Ioc m n, g j)‖+ ‖∑ i ∈ Ioc m (n-1), (f (i+1)-f i)*(∑ j ∈ Ioc m i, g j)‖ := norm_sub_le _ _ _ ≤ ‖f n‖*B+∑ i ∈ Ioc m (n-1), ‖f (i+1)-f i‖*B := by apply add_le_add · rw [norm_mul] exact mul_le_mul_of_nonneg_left (hprefix n (mem_Icc.mpr ⟨hmn.le, le_rfl⟩)) (norm_nonneg _) · apply (norm_sum_le _ _).trans apply sum_le_sum intro i hi rw [norm_mul] exact mul_le_mul_of_nonneg_left (hprefix i (mem_Icc.mpr ⟨(mem_Ioc.mp hi).1.le, (mem_Ioc.mp hi).2.trans (Nat.sub_le _ _)⟩)) (norm_nonneg _) _ = _ := by rw [← sum_mul, add_mul] end Bounty end section /- Elementary norm and variation estimates for the harmonic Mellin weight. -/ namespace Bounty noncomputable def harmonicMellinWeight (v t : ℝ) : ℂ := Complex.exp (Complex.I * ((v*Real.log t : ℝ) : ℂ)) / (t : ℂ) theorem norm_exp_imaginary_difference (x y : ℝ) : ‖Complex.exp (Complex.I*(x : ℂ))-Complex.exp (Complex.I*(y : ℂ))‖ ≤ |x-y| := by have heq : Complex.exp (Complex.I*(x : ℂ))-Complex.exp (Complex.I*(y : ℂ)) = Complex.exp (Complex.I*(y : ℂ))*(Complex.exp (Complex.I*((x-y : ℝ) : ℂ))-1) := by rw [mul_sub, mul_one, ← Complex.exp_add] congr 2 push_cast ring rw [heq, norm_mul, Complex.norm_exp_I_mul_ofReal, one_mul] exact Real.norm_exp_I_mul_ofReal_sub_one_le theorem norm_harmonic_mellin_weight (v : ℝ) {t : ℝ} (ht : 0 < t) : ‖harmonicMellinWeight v t‖ = 1/t := by simp only [harmonicMellinWeight, norm_div, Complex.norm_exp_I_mul_ofReal, Complex.norm_real, Real.norm_eq_abs, abs_of_pos ht] theorem harmonic_mellin_weight_variation {v s t : ℝ} (hs : 0 < s) (hst : s ≤ t) : ‖harmonicMellinWeight v t-harmonicMellinWeight v s‖ ≤ (1+|v|)*(t-s)/(s*t) := by have ht : 0 < t := hs.trans_le hst have hlog0 : 0 ≤ Real.log t-Real.log s := sub_nonneg.mpr (Real.log_le_log hs hst) have hlog : Real.log t-Real.log s ≤ (t-s)/s := by have h := Real.log_le_sub_one_of_pos (div_pos ht hs) rw [Real.log_div ht.ne' hs.ne'] at h convert h using 1 field_simp let et := Complex.exp (Complex.I*((v*Real.log t : ℝ) : ℂ)) let es := Complex.exp (Complex.I*((v*Real.log s : ℝ) : ℂ)) have hphase : ‖et-es‖ ≤ |v| *(Real.log t-Real.log s) := by have h := norm_exp_imaginary_difference (v*Real.log t) (v*Real.log s) rw [← mul_sub, abs_mul, abs_of_nonneg hlog0] at h exact h have heq : harmonicMellinWeight v t-harmonicMellinWeight v s = (et-es)/(t : ℂ)+es*((1/t-1/s : ℝ) : ℂ) := by dsimp [harmonicMellinWeight, et, es] push_cast ring have hinv : |1/t-1/s| = (t-s)/(s*t) := by rw [abs_of_nonpos (sub_nonpos.mpr (one_div_le_one_div_of_le hs hst))] field_simp ring calc _ ≤ ‖(et-es)/(t : ℂ)‖+‖es*((1/t-1/s : ℝ) : ℂ)‖ := by rw [heq] exact norm_add_le _ _ _ = ‖et-es‖/t+(t-s)/(s*t) := by rw [norm_div, norm_mul] simp only [es, Complex.norm_exp_I_mul_ofReal, Complex.norm_real, Real.norm_eq_abs, abs_of_pos ht, one_mul, hinv] _ ≤ (|v| *((t-s)/s))/t+(t-s)/(s*t) := by exact add_le_add (div_le_div_of_nonneg_right (hphase.trans (mul_le_mul_of_nonneg_left hlog (abs_nonneg v))) ht.le) le_rfl _ = _ := by ring theorem harmonic_mellin_weight_variation_lower_scale {v s t Y : ℝ} (hY : 0 < Y) (hYs : Y ≤ s) (hst : s ≤ t) : ‖harmonicMellinWeight v t-harmonicMellinWeight v s‖ ≤ (1+|v|)*(t-s)/Y^2 := by have hs : 0 < s := hY.trans_le hYs apply (harmonic_mellin_weight_variation hs hst).trans apply div_le_div_of_nonneg_left (by positivity) (by positivity) calc Y^2 = Y*Y := pow_two Y _ ≤ s*t := mul_le_mul hYs (hYs.trans hst) hY.le hs.le end Bounty end section /- Exact cancellation against constants controls variation-weighted finite sums. -/ open Finset namespace Bounty end Bounty end section /- The existing chronological forest bound with separate root and atom costs at every address. -/ open Finset Classical namespace Bounty theorem birthForestCausalMass_le_coordinate_costs {n : ℕ} {α : Type*} [Fintype α] (code : BirthForestCode n) (w : BirthForestCausalWeights n α) (M ε : Fin n → ℝ) (hM : ∀ i, 0 ≤ M i) (hε : ∀ i, 0 ≤ ε i) (hw : ∀ i h a, 0 ≤ w i h a) (hsum : ∀ i h, ∑ a, w i h a ≤ M i) (hatom : ∀ i h a, w i h a ≤ ε i) : birthForestCausalMass code w ≤ ∏ i, match code i with | none => M i | some _ => ε i := by induction n with | zero => simp [birthForestCausalMass, birthForestCausalAssignmentMass, birthForestAssignmentMass] | succ n ih => have hprev := ih (birthForestCodeInit code) (fun i => w i.castSucc) (fun i => M i.castSucc) (fun i => ε i.castSucc) (fun i => hM i.castSucc) (fun i => hε i.castSucc) (fun i h a => hw i.castSucc h a) (fun i h => hsum i.castSucc h) (fun i h a => hatom i.castSucc h a) rw [birthForestCausalMass_last, Fin.prod_univ_castSucc] cases hc : code (Fin.last n) with | none => calc _ ≤ ∑ f : Fin n → α, birthForestCausalAssignmentMass (birthForestCodeInit code) (fun i => w i.castSucc) f * M (Fin.last n) := by apply sum_le_sum intro f _ exact mul_le_mul_of_nonneg_left (hsum _ _) (birthForestCausalAssignmentMass_nonneg _ _ (fun i h a => hw i.castSucc h a) f) _ = birthForestCausalMass (birthForestCodeInit code) (fun i => w i.castSucc) * M (Fin.last n) := (sum_mul _ _ _).symm _ ≤ _ := by apply le_trans (mul_le_mul_of_nonneg_right hprev (hM (Fin.last n))) apply le_of_eq congr 1 apply prod_congr rfl intro i _ unfold birthForestCodeInit cases code i.castSucc <;> rfl | some p => calc _ ≤ ∑ f : Fin n → α, birthForestCausalAssignmentMass (birthForestCodeInit code) (fun i => w i.castSucc) f * ε (Fin.last n) := by apply sum_le_sum intro f _ exact mul_le_mul_of_nonneg_left (hatom _ _ _) (birthForestCausalAssignmentMass_nonneg _ _ (fun i h a => hw i.castSucc h a) f) _ = birthForestCausalMass (birthForestCodeInit code) (fun i => w i.castSucc) * ε (Fin.last n) := (sum_mul _ _ _).symm _ ≤ _ := by apply le_trans (mul_le_mul_of_nonneg_right hprev (hε (Fin.last n))) apply le_of_eq congr 1 apply prod_congr rfl intro i _ unfold birthForestCodeInit cases code i.castSucc <;> rfl end Bounty end section /- External finite coordinates may be permuted separately on each retained parameter and auxiliary fiber. The auxiliary average is taken after the permutation, so no number-of-residues loss is incurred. -/ open Finset open scoped Classical namespace Bounty noncomputable def finiteExternalFiberAverage {C R Y : Type*} {A : C → Type*} [∀ c, Fintype (A c)] (ω : ∀ c, A c → ℝ) (T : ∀ c, A c → (Y → ℂ) → Y → ℂ) (τ : ∀ c, A c → R ≃ R) (f : C → Y → R → ℂ) (c : C) (y : Y) (r : R) : ℂ := ∑ a, (ω c a : ℂ) * T c a (fun z => f c z (τ c a r)) y theorem finite_external_fiber_average_energy_le {C R Y : Type*} [Fintype R] [Fintype Y] {A : C → Type*} [∀ c, Fintype (A c)] (μ : Y → ℝ) (hμ : ∀ y, 0 ≤ μ y) (ω : ∀ c, A c → ℝ) (hω : ∀ c a, 0 ≤ ω c a) (hωmass : ∀ c, ∑ a, ω c a ≤ 1) (T : ∀ c, A c → (Y → ℂ) → Y → ℂ) (τ : ∀ c, A c → R ≃ R) (f : C → Y → R → ℂ) {L : ℝ} (hL : 0 ≤ L) (hT : ∀ c a r, finiteWeightedEnergy μ (T c a (fun z => f c z r)) ≤ L * finiteWeightedEnergy μ (fun z => f c z r)) (c : C) : (∑ r, finiteWeightedEnergy μ (fun y => finiteExternalFiberAverage ω T τ f c y r)) ≤ L * ∑ r, finiteWeightedEnergy μ (fun y => f c y r) := by calc _ ≤ ∑ r, ∑ a, ω c a * finiteWeightedEnergy μ (T c a (fun z => f c z (τ c a r))) := by apply sum_le_sum intro r _ exact finite_subprobability_average_energy_le (ω c) μ (hω c) (hωmass c) hμ _ _ ≤ ∑ r, ∑ a, ω c a * (L * finiteWeightedEnergy μ (fun z => f c z (τ c a r))) := by apply sum_le_sum intro r _ exact sum_le_sum fun a _ => mul_le_mul_of_nonneg_left (hT c a (τ c a r)) (hω c a) _ = (∑ a, ω c a) * (L * ∑ r, finiteWeightedEnergy μ (fun y => f c y r)) := by rw [sum_comm] simp only [← mul_sum] rw [sum_mul] apply sum_congr rfl intro a _ rw [Equiv.sum_comp (τ c a) (fun r => finiteWeightedEnergy μ (fun z => f c z r))] _ ≤ 1 * (L * ∑ r, finiteWeightedEnergy μ (fun y => f c y r)) := by apply mul_le_mul_of_nonneg_right (hωmass c) exact mul_nonneg hL (sum_nonneg fun r _ => sum_nonneg fun y _ => mul_nonneg (hμ y) (sq_nonneg _)) _ = _ := one_mul _ noncomputable def equivExternalFiberAverage {X C Y R : Type*} {A : C → Type*} [∀ c, Fintype (A c)] (e : X ≃ C × Y) (ω : ∀ c, A c → ℝ) (T : ∀ c, A c → (Y → ℂ) → Y → ℂ) (τ : ∀ c, A c → R ≃ R) (f : X → R → ℂ) (x : X) (r : R) : ℂ := finiteExternalFiberAverage ω T τ (fun c y r => f (e.symm (c, y)) r) (e x).1 (e x).2 r theorem equiv_external_fiber_average_energy_le {X C Y R : Type*} [Fintype X] [Fintype C] [Fintype Y] [Fintype R] {A : C → Type*} [∀ c, Fintype (A c)] (e : X ≃ C × Y) (W : X → ℝ) (κ : C → ℝ) (μ : Y → ℝ) (hW : ∀ c y, W (e.symm (c, y)) = κ c * μ y) (hκ : ∀ c, 0 ≤ κ c) (hμ : ∀ y, 0 ≤ μ y) (ω : ∀ c, A c → ℝ) (hω : ∀ c a, 0 ≤ ω c a) (hωmass : ∀ c, ∑ a, ω c a ≤ 1) (T : ∀ c, A c → (Y → ℂ) → Y → ℂ) (τ : ∀ c, A c → R ≃ R) (f : X → R → ℂ) {L : ℝ} (hL : 0 ≤ L) (hT : ∀ c a r, finiteWeightedEnergy μ (T c a (fun y => f (e.symm (c, y)) r)) ≤ L * finiteWeightedEnergy μ (fun y => f (e.symm (c, y)) r)) : (∑ r, finiteWeightedEnergy W (fun x => equivExternalFiberAverage e ω T τ f x r)) ≤ L * ∑ r, finiteWeightedEnergy W (fun x => f x r) := by simp_rw [finite_energy_equiv_fibers e W κ μ hW] unfold finiteFiberEnergy equivFiberSlice dsimp only [equivExternalFiberAverage] simp only [Equiv.apply_symm_apply] rw [sum_comm, sum_comm (f := fun r c => κ c * finiteWeightedEnergy μ (fun y => f (e.symm (c,y)) r))] simp only [← mul_sum] rw [mul_sum] apply sum_le_sum intro c _ calc _ ≤ κ c * (L * ∑ r, finiteWeightedEnergy μ (fun y => f (e.symm (c,y)) r)) := mul_le_mul_of_nonneg_left (finite_external_fiber_average_energy_le μ hμ ω hω hωmass T τ _ hL hT c) (hκ c) _ = _ := by ring end Bounty end section /- Full edge event sums with arbitrary bounded complex coefficients. Every storage, retrieval and fresh draw remains summed, with both total memory caps in the event weight. No symmetry of the coefficient is required. -/ open Finset Classical namespace Bounty theorem finite_weighted_energy_of_scaled_norm {X : Type*} [Fintype X] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (H : ℝ) (hH : 0 ≤ H) (K : ℝ) (f output majorant : X → ℂ) (hdom : ∀ x, ‖output x‖ ≤ ‖(H : ℂ) * majorant x‖) (hbase : finiteWeightedEnergy w majorant ≤ K * finiteWeightedEnergy w f) : finiteWeightedEnergy w output ≤ H ^ 2 * K * finiteWeightedEnergy w f := by calc _ ≤ finiteWeightedEnergy w (fun x => (H : ℂ) * majorant x) := finiteWeightedEnergy_le_of_norm_le w hw _ _ hdom _ = H ^ 2 * finiteWeightedEnergy w majorant := by rw [finiteWeightedEnergy_const_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hH] _ ≤ _ := (mul_le_mul_of_nonneg_left hbase (sq_nonneg H)).trans_eq (by ring) section variable {G : Type*} [Fintype G] [dG : DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) end end Bounty end section /- Chronological low-rank propagation directly on finite weighted function norms. The invariant predicate records the admissible suffixes, for example symmetry under pending-memory permutations. Local bounds and preservation are separate hypotheses: neither follows merely from a phase having norm one. No operator-ring structure or linearity is required. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations G J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) noncomputable def physicalGroupAdjacentFiniteStep (i : ℕ) : GlobalBirthRawStep (R := fun p : ↥(P g) => ZMod p.val) (physicalGroupBareAtomicActivity L g i) (physicalGroupBareAtomicActivity L g (i + 1)) := physicalGroupBareFiniteStep C aux k L a σ τ hlist hP hdis hcompat g hk β η V ρ hV cap i theorem physical_group_adjacent_finite_visit_row (j : Fin (n + 1)) (F : Finset ↥(P g) → FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val) → ℂ) (H : Finset ↥(P g)) (q : FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val)) : globalBirthRawStepRow (physicalGroupAdjacentFiniteStep C aux k L a σ τ hcompat hlist hP hdis g hk β η V ρ hV cap (2 * j.val)) F H q = globalBirthGhostVisitRawRow (fun _ => 0) β (η j) V ρ cap H q.2 F := physical_group_bare_finite_visit_row C aux k L a σ τ hlist hP hdis hcompat g hk β η V ρ hV cap j F H q /- The moving displacement is exactly the difference between adjacent offsets of the same residue path. Both endpoint permutations are retained. -/ include hstep in theorem physical_group_adjacent_finite_edge_row (j : Fin n) (F : Finset ↥(P g) → FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val) → ℂ) (H : Finset ↥(P g)) (q : FiniteOrderedTuple (Σ p : ↥(P g), ZMod p.val)) : globalBirthRawStepRow (physicalGroupAdjacentFiniteStep C aux k L a σ τ hcompat hlist hP hdis g hk β η V ρ hV cap (2 * j.val + 1)) F H q = globalBirthEdgeRawRow (physicalGroupUnsharedEmbedding (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) g) (physicalGroupUnsharedEmbedding (C j) (physicalPermuteLabels (τ j) (L j.succ)) g) (physicalGroupPhaseDelta (a j.castSucc) (a j.succ) g) H q.2 (globalBirthRawHitIndices (physicalGroupPhaseDelta (a j.castSucc) (a j.succ) g) q) β ρ V cap F := by unfold physicalGroupAdjacentFiniteStep rw [physical_group_bare_finite_edge_row, physical_group_permuted_bare_raw_edge_row, ← hstep j] variable [∀ p : ↥(P g), NeZero p.val] /- The normalized exact trace requires only adjacent common-mark compatibility. -/ end ResiduePath end Bounty end section /- A fresh-or-promoted target cannot reuse a currently active prime. -/ open Finset open scoped Classical namespace Bounty theorem global_birth_target_avoids_active {P : Type*} [DecidableEq P] {R : P → Type*} {m t : ℕ} (active H : Finset P) (old : Fin m → Σ p, R p) (target : Fin t → P) (hborn : active ⊆ H) (hinactive : ∀ j, (old j).1 ∉ active) (eligible : Finset (Fin m)) (promotions : Finset (Fin t)) (e : promotions ↪ eligible) (fresh : UnrestrictedFreshLabels P promotions) (hv : unrestrictedEdgeTarget old Sigma.fst promotions e fresh = target ∧ ∀ s, fresh s ∉ H) : ∀ s, target s ∉ active := by intro s hs have he := congrFun hv.1 s by_cases hp : s ∈ promotions · have ho : (old (e ⟨s, hp⟩).val).1 = target s := by simpa only [unrestrictedEdgeTarget, unrestrictedTargetLabels, dif_pos hp] using he exact hinactive _ (ho ▸ hs) · have hf : fresh ⟨s, hp⟩ = target s := by simpa only [unrestrictedEdgeTarget, unrestrictedTargetLabels, dif_neg hp] using he exact hv.2 ⟨s, hp⟩ (hborn (hf ▸ hs)) theorem global_birth_edge_raw_zero_of_active_target {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] {m t : ℕ} (source target : Fin t ↪ P) (delta : (p : P) → R p) (active H : Finset P) (old : Fin m → Σ p, R p) (hborn : active ⊆ H) (hinactive : ∀ j, (old j).1 ∉ active) (htarget : ∃ s, target s ∈ active) (eligible : Finset (Fin m)) (β : P → ℝ) (ρ V : ℝ) (cap : ℕ) (G : Finset P → FiniteOrderedTuple (Σ p, R p) → ℂ) : globalBirthEdgeRawRow source target delta H old eligible β ρ V cap G = 0 := by unfold globalBirthEdgeRawRow unrestrictedEdgeAction apply sum_eq_zero intro stores _ apply sum_eq_zero intro promotions _ apply sum_eq_zero intro e _ apply sum_eq_zero intro fresh _ have hn : ¬ (unrestrictedEdgeTarget old Sigma.fst promotions e fresh = target ∧ ∀ s, fresh s ∉ H) := by intro hv obtain ⟨s, hs⟩ := htarget exact global_birth_target_avoids_active active H old target hborn hinactive eligible promotions e fresh hv s hs simp only [if_neg hn, mul_zero, zero_mul] end Bounty end section /- Exact zero propagation through supported finite rows. -/ namespace Bounty theorem fin_tensor_row_zero_at (n : ℕ) {S T : Fin n → Type*} (row : (g : Fin n) → (T g → ℂ) → S g → ℂ) (s : (g : Fin n) → S g) (hzero : ∀ g, row g (fun _ => 0) (s g) = 0) (g : Fin n) (hkill : ∀ F, row g F (s g) = 0) (F : ((g : Fin n) → T g) → ℂ) : finTensorRow n row F s = 0 := by induction n with | zero => exact Fin.elim0 g | succ n ih => refine Fin.cases ?_ (fun j => ?_) g hkill · intro hk exact hk _ · intro hk change row 0 (fun t => finTensorRow n (fun j => row j.succ) (fun u => F (Fin.cons t u)) (Fin.tail s)) (s 0) = 0 have hz (t : T 0) : finTensorRow n (fun j => row j.succ) (fun u => F (Fin.cons t u)) (Fin.tail s) = 0 := ih _ _ (fun j => hzero j.succ) j hk _ simp only [hz] exact hzero 0 section variable {S : ℕ → Type*} (row : (i : ℕ) → (S (i + 1) → ℂ) → S i → ℂ) (Q : (i : ℕ) → S i → Prop) (n : ℕ) (hrow : ∀ i < n, ∀ F G, (∀ t, Q (i + 1) t → F t = G t) → ∀ s, Q i s → row i F s = row i G s) include S row Q n hrow theorem finite_row_composition_supported_congr (F G : S n → ℂ) (hFG : ∀ t, Q n t → F t = G t) (s : S 0) (hs : Q 0 s) : finiteRowComposition row n F s = finiteRowComposition row n G s := by induction n with | zero => exact hFG s hs | succ n ih => exact ih (fun i hi => hrow i (Nat.lt_trans hi (Nat.lt_succ_self n))) _ _ (hrow n (Nat.lt_succ_self n) F G hFG) theorem finite_row_composition_supported_zero (hzero : ∀ i < n, ∀ s, Q i s → row i (fun _ => 0) s = 0) (s : S 0) (hs : Q 0 s) : finiteRowComposition row n (fun _ => 0) s = 0 := by induction n with | zero => rfl | succ n ih => change finiteRowComposition row n (row n (fun _ => 0)) s = 0 rw [finite_row_composition_supported_congr row Q n (fun i hi => hrow i (Nat.lt_trans hi (Nat.lt_succ_self n))) _ (fun _ => 0) (hzero n (Nat.lt_succ_self n)) s hs] exact ih (fun i hi => hrow i (Nat.lt_trans hi (Nat.lt_succ_self n))) (fun i hi => hzero i (Nat.lt_trans hi (Nat.lt_succ_self n))) theorem finite_row_composition_supported_zero_at (hzero : ∀ i < n, ∀ s, Q i s → row i (fun _ => 0) s = 0) (i : ℕ) (hi : i < n) (hkill : ∀ F s, Q i s → row i F s = 0) (F : S n → ℂ) (s : S 0) (hs : Q 0 s) : finiteRowComposition row n F s = 0 := by induction n with | zero => omega | succ n ih => by_cases hin : i < n · exact ih (fun j hj => hrow j (Nat.lt_trans hj (Nat.lt_succ_self n))) (fun j hj => hzero j (Nat.lt_trans hj (Nat.lt_succ_self n))) hin (row n F) · have he : i = n := by omega subst i change finiteRowComposition row n (row n F) s = 0 rw [finite_row_composition_supported_congr row Q n (fun j hj => hrow j (Nat.lt_trans hj (Nat.lt_succ_self n))) _ (fun _ => 0) (hkill F) s hs] exact finite_row_composition_supported_zero row Q n (fun j hj => hrow j (Nat.lt_trans hj (Nat.lt_succ_self n))) (fun j hj => hzero j (Nat.lt_trans hj (Nat.lt_succ_self n))) s hs end end Bounty end section /- Coherent continuation substitution for the original simultaneous rows. -/ namespace Bounty theorem global_birth_joint_cut_raw_row_congr {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, Fintype (R g p)] [∀ g p, DecidableEq (R g p)] {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (inputCap outputCap : ℕ) (F G : GlobalBirthJointState R → ℂ) (hFG : ∀ s, GlobalBirthJointCoherent b s → F s = G s) (s : GlobalBirthJointState R) (hs : GlobalBirthJointCoherent a s) : globalBirthJointCutRawRow step inputCap outputCap F s = globalBirthJointCutRawRow step inputCap outputCap G s := by unfold globalBirthJointCutRawRow globalBirthJointRawCutoff split_ifs · unfold globalBirthJointRawRow apply fin_tensor_row_intertwines_on N _ _ (fun _ x => x) (fun _ x => x) (fun g t => GlobalBirthMemoryCoherent (ghostPhaseActivitySupport (a g)) t.1 t.2) (fun g t => GlobalBirthMemoryCoherent (ghostPhaseActivitySupport (b g)) t.1 t.2) · intro g t ht K L hKL exact global_birth_raw_step_row_congr (step g) t.1 t.2 ht _ _ (fun H q hq _ => hKL (H, q) hq) · intro t ht unfold globalBirthJointRawCutoff split_ifs · exact hFG t ht · rfl · exact hs · rfl end Bounty end section /- An inconsistent pair of consecutive active hits annihilates the whole capped history. -/ open Finset open scoped Classical namespace Bounty theorem ghost_phase_active_edge_zero {R : Type*} [Fintype R] [DecidableEq R] (hTarget hSource : R) (β : ℝ) (hne : hSource ≠ hTarget) (z w : GhostPhaseState R) : ghostPhaseEdge true true hTarget hSource β z w = 0 := by cases z with | none => cases w with | none => rw [ghost_phase_edge_active_active, if_neg hne] | some w => simp [ghostPhaseEdge, ghostPhaseScatter] | some z => simp [ghostPhaseEdge, ghostPhaseGather] theorem finite_alternating_pairing_zero_of_edge {X : Type*} [Fintype X] (G E : ℕ → X → X → ℝ) (f q : X → ℝ) (n j : ℕ) (hj : j < n) (hE : ∀ z w, E j z w = 0) : finiteAlternatingPairing G E f q n = 0 := by unfold finiteAlternatingPairing rw [← finite_chronological_trace_expansion] apply sum_eq_zero intro x _ have hz : (∏ i : Fin (2 * n + 1), finiteAlternatingKernel G E i.val (x i.succ) (x i.castSucc)) = 0 := by apply prod_eq_zero (i := (⟨2 * j + 1, by omega⟩ : Fin (2 * n + 1))) (mem_univ _) exact (congrFun (congrFun (finite_alternating_kernel_odd G E j) _) _).trans (hE _ _) simp only [finiteChronologicalPrefix, hz, mul_zero] theorem ghost_phase_capped_history_zero_of_adjacent_hits {I : Type*} [Fintype I] [DecidableEq I] {R : I → Type*} [∀ p, Fintype (R p)] [∀ p, DecidableEq (R p)] (a : I → ℕ → Bool) (h : (p : I) → ℕ → R p) (η : I → ℕ → ℝ) (β V : I → ℝ) (visitCap edgeCap : ℕ → ℕ) (n : ℕ) (j : ℕ) (hj : j < n) (p : I) (ha : a p j = true) (hb : a p (j + 1) = true) (hne : h p j ≠ h p (j + 1)) : ghostPhaseCappedHistory a h η β V visitCap edgeCap n = 0 := by apply finite_alternating_pairing_zero_of_edge _ _ _ _ n j hj intro z w unfold ghostPhaseCappedEdge split_ifs · apply prod_eq_zero (i := p) (mem_univ p) dsimp only simp only [ha, hb, ghost_phase_active_edge_zero _ _ _ hne, mul_zero] · rfl end Bounty end section /- Elementary Mertens estimates, adapted from AlexKontorovich/PrimeNumberTheoremAnd, PrimeNumberTheoremAnd/IEANTN/Mertens.lean, Apache-2.0, commit c39a751132c88b6e8080b74c74023fd95b3d8be0. This port retains an unspecified positive Euler-product limit constant; the same constant suffices on both sides of the Buchstab subtraction argument. No identification with the Euler--Mascheroni constant is needed. -/ namespace Bounty.Mertens open Real Finset Filter Asymptotics Topology open ArithmeticFunction hiding log lemma sum_Ioc_one_eq_sum_Ioc_zero {f : ℕ → ℝ} {x : ℕ} (hx : 1 ≤ x) (hf : f 1 = 0) : ∑ n ∈ Ioc 1 x, f n = ∑ n ∈ Ioc 0 x, f n := by rw [(by rfl : Ioc 0 x = Icc 1 x), ← add_sum_Ioc_eq_sum_Icc hx] simpa theorem sum_log_le {x : ℝ} (hx : 1 ≤ x) : ∑ n ∈ Ioc 0 ⌊ x ⌋₊, log n ≤ x * log x := by calc _ ≤ ∑ n ∈ Ioc 0 ⌊ x ⌋₊, log x := by refine sum_le_sum fun n hn ↦ ?_ simp only [mem_Ioc] at hn exact log_le_log (by exact_mod_cast hn.1) (Nat.le_floor_iff (by linarith)|>.mp hn.2) _ = ⌊x⌋₊ * log x := by simp _ ≤ _ := by gcongr · exact log_nonneg hx · exact Nat.floor_le (by linarith) lemma integral_log_le {a b : ℝ} (ha : 1 ≤ a) (hab : a ≤ b) : ∫ t in a..b, log t ≤ log b * (b - a) := by apply le_of_abs_le have : ∀ t ∈ Set.uIoc a b, ‖log t‖ ≤ log b := by intro t ht rw [Set.uIoc_of_le hab, Set.mem_Ioc] at ht rw [norm_of_nonneg <| log_nonneg (by linarith)] gcongr <;> linarith grw [← norm_eq_abs, intervalIntegral.norm_integral_le_of_norm_le_const this, abs_of_nonneg (by linarith)] theorem sum_log_ge {x : ℝ} (hx : 1 ≤ x) : ∑ n ∈ Ioc 0 ⌊ x ⌋₊, log n ≥ x * log x - 2 * x := by have one_le_floor : 1 ≤ ⌊x⌋₊ := by simpa calc _ = ∑ n ∈ Icc 1 ⌊ x ⌋₊, log n := by rfl _ = ∑ n ∈ Ico (1 + 1) (⌊ x ⌋₊ + 1), log n := by rw [← add_sum_Ioc_eq_sum_Icc one_le_floor] simp rfl _ = ∑ n ∈ Ico 1 ⌊ x ⌋₊, log ((n + 1 : ℕ)) := by rw [← Finset.sum_Ico_add'] _ ≥ ∫ t in 1..⌊x⌋₊, log t := by convert MonotoneOn.integral_le_sum_Ico one_le_floor ?_|>.ge · norm_cast · exact StrictMonoOn.monotoneOn (strictMonoOn_log.mono fun y hy ↦ (by simp_all; linarith)) _ = (∫ t in 1..x, log t) - ∫ t in ⌊x⌋₊..x, log t := by nth_rw 3 [intervalIntegral.integral_symm] rw [sub_neg_eq_add, intervalIntegral.integral_add_adjacent_intervals] <;> exact intervalIntegral.intervalIntegrable_log' _ ≥ (∫ t in 1..x, log t) - log x := by gcongr grw [integral_log_le (by simpa) (Nat.floor_le (by linarith))] nth_rw 2 [← mul_one (log x)] gcongr · exact log_nonneg hx · linarith [Nat.lt_floor_add_one x] _ ≥ x * log x - x - log x := by simp only [integral_log, log_one, mul_zero, sub_zero, ge_iff_le, tsub_le_iff_right, sub_add_cancel, le_add_iff_nonneg_right, zero_le_one] _ ≥ _ := by linarith [log_le_self (by linarith : 0 ≤ x)] theorem sum_log_eq_sum_mangoldt {x : ℝ} : ∑ n ∈ Ioc 0 ⌊x⌋₊, log n = ∑ d ∈ Ioc 0 ⌊x⌋₊, Λ d * ⌊x / d⌋₊ := by have : ∀ n : ℕ, log n = (Λ * zeta) n := by simp [vonMangoldt_mul_zeta] simp_rw [this, sum_Ioc_mul_zeta_eq_sum, ← Nat.floor_div_natCast] noncomputable abbrev E₁Λ (x : ℝ) : ℝ := ∑ d ∈ Ioc 0 ⌊ x ⌋₊, (Λ d) / d - log x theorem E₁Λ.ge {x : ℝ} (hx : 1 ≤ x) : E₁Λ x ≥ -2 := by unfold E₁Λ suffices x * ∑ d ∈ Ioc 0 ⌊x⌋₊, Λ d / d ≥ x * (log x - 2) by linarith [le_of_mul_le_mul_left this (by linarith)] calc _ = ∑ d ∈ Ioc 0 ⌊x⌋₊, Λ d * (x / d) := by rw [Finset.mul_sum] ring_nf _ ≥ ∑ d ∈ Ioc 0 ⌊x⌋₊, Λ d * ⌊x / d⌋₊ := by gcongr exact Nat.floor_le <| div_nonneg (by linarith) (by linarith) _ ≥ x * log x - 2 * x := sum_log_eq_sum_mangoldt ▸ sum_log_ge hx _ = _ := by ring theorem E₁Λ.le {x : ℝ} (hx : 1 ≤ x) : E₁Λ x ≤ log 4 + 4 := by unfold E₁Λ suffices x * ∑ d ∈ Ioc 0 ⌊x⌋₊, Λ d / d ≤ x * (log x + log 4 + 4) by linarith [le_of_mul_le_mul_left this (by linarith)] calc _ = ∑ d ∈ Ioc 0 ⌊x⌋₊, Λ d * (x / d) := by rw [Finset.mul_sum] ring_nf _ ≤ ∑ d ∈ Ioc 0 ⌊x⌋₊, Λ d * (⌊x / d⌋₊ + 1) := by gcongr exact Nat.lt_floor_add_one _|>.le _ = (∑ d ∈ Ioc 0 ⌊x⌋₊, log d) + ∑ d ∈ Ioc 0 ⌊x⌋₊, Λ d := by simp_rw [mul_add, mul_one] rw [Finset.sum_add_distrib, sum_log_eq_sum_mangoldt] _ ≤ x * log x + (log 4 + 4) * x := by gcongr · exact sum_log_le hx · exact Chebyshev.psi_le_const_mul_self (by linarith) _ = _ := by ring theorem sum_mangoldt_div_eq_log {x : ℝ} (hx : 1 ≤ x) : |∑ d ∈ Ioc 0 ⌊ x ⌋₊, (Λ d) / d - log x| ≤ log 4 + 4 := by grind [E₁Λ.le hx, E₁Λ.ge hx, log_nonneg] theorem E₁Λ.bounded : E₁Λ =O[atTop] (fun _ ↦ (1:ℝ)) := by simp only [isBigO_iff, norm_eq_abs, norm_one, mul_one, eventually_atTop] exact ⟨log 4 + 4, 1, fun _ hx ↦ sum_mangoldt_div_eq_log hx⟩ noncomputable abbrev E₁p (x : ℝ) : ℝ := ∑ p ∈ Ioc 0 ⌊ x ⌋₊ with p.Prime, (log p) / p - log x theorem sum_log_prime_div_eq (x : ℝ) : ∑ p ∈ Ioc 0 ⌊ x ⌋₊ with p.Prime, (log p) / p = log x + E₁p x := by grind theorem E₁p.le_E₁Λ (x : ℝ) : E₁p x ≤ E₁Λ x := by unfold E₁p E₁Λ; rw [sum_filter] gcongr with p _ split_ifs with hp · simp [vonMangoldt_apply_prime hp] have : 0 ≤ Λ p := vonMangoldt_nonneg positivity theorem E₁p.le {x : ℝ} (hx : 1 ≤ x) : E₁p x ≤ log 4 + 4 := by linarith [E₁Λ.le hx, E₁p.le_E₁Λ x] noncomputable abbrev E₁ : ℝ := ∑' p : ℕ, if p.Prime then (log p) / (p*(p-1)) else 0 lemma E₁.summand_nonneg (p : ℕ) : 0 ≤ if p.Prime then (log p) / (p*(p-1)) else 0 := by split_ifs with h · refine div_nonneg (log_natCast_nonneg _) (mul_nonneg (Nat.cast_nonneg _) ?_) suffices 1 ≤ (p : ℝ) by linarith exact_mod_cast h.one_le · rfl theorem E₁.summable : Summable (fun p : ℕ ↦ if p.Prime then (log p) / (p*(p-1)) else 0) := by refine (Real.summable_one_div_nat_rpow.mpr (by norm_num: 1 < (3 : ℝ) / 2)|>.const_div 4).of_nonneg_of_le E₁.summand_nonneg fun n ↦ ?_ split_ifs with h · grw [Real.log_le_rpow_div (Nat.cast_nonneg _) (by norm_num : 0 < (1 : ℝ) / 2)] · have denom : (n : ℝ) * ((n : ℝ) - 1) ≥ n ^ 2/ 2 := by rw [sq, mul_div_assoc] gcongr suffices (n : ℝ) ≥ 2 by linarith exact_mod_cast h.two_le grw [denom] · apply le_of_eq rw [← Real.rpow_natCast] field_simp rw [mul_div_assoc, ← Real.rpow_sub (mod_cast h.pos)] norm_num rw [Real.rpow_neg (Nat.cast_nonneg _)] field · exact div_pos (pow_pos (mod_cast h.pos) _) (by norm_num) · apply mul_nonneg (Nat.cast_nonneg _) suffices 1 ≤ (n : ℝ) by linarith exact_mod_cast h.one_le · positivity theorem E₁.nonneg : E₁ ≥ 0 := tsum_nonneg E₁.summand_nonneg theorem E₁Λ.le_E₁p_add_E₁ {x : ℝ} (hx : 1 ≤ x) : E₁Λ x ≤ E₁p x + E₁ := by unfold E₁Λ E₁p suffices ∑ d ∈ Ioc 0 ⌊x⌋₊, Λ d / d ≤ ∑ p ∈ Ioc 0 ⌊x⌋₊ with Nat.Prime p, log p / p + E₁ by linarith simp_rw [vonMangoldt_apply, ite_div, zero_div, ← sum_filter, Chebyshev.sum_PrimePow_eq_sum_sum _ (by linarith)] calc _ = ∑ k ∈ Icc 1 ⌊log x / log 2⌋₊, ∑ p ∈ Ioc 0 ⌊x ^ (1 / (k : ℝ))⌋₊ with Nat.Prime p, log p / (p ^ k : ℕ) := by refine sum_congr rfl fun k hk ↦ sum_congr rfl fun p hp ↦ ?_ rw [Nat.Prime.pow_minFac (by simp_all) (by simp_all; linarith)] _ ≤ ∑ k ∈ Icc 1 ⌊log x / log 2⌋₊, ∑ p ∈ Ioc 0 ⌊x⌋₊ with Nat.Prime p, log p / (p ^ k : ℕ) := by gcongr with k hk apply rpow_le_self_of_one_le hx simp only [mem_Icc] at hk exact div_le_one₀ (by norm_cast; linarith)|>.mpr (mod_cast hk.1) _ ≤ ∑ k ∈ Icc 1 (max 1 ⌊log x / log 2⌋₊), ∑ p ∈ Ioc 0 ⌊x⌋₊ with Nat.Prime p, log p / (p ^ k : ℕ) := by apply sum_le_sum_of_subset_of_nonneg · gcongr exact le_max_right .. · exact fun _ _ _ ↦ sum_nonneg fun _ _ ↦ (by positivity) _ = ∑ p ∈ Ioc 0 ⌊x⌋₊ with Nat.Prime p, (log p / p) + ∑ k ∈ Ioc 1 (max 1 ⌊log x / log 2⌋₊), ∑ p ∈ Ioc 0 ⌊x⌋₊ with Nat.Prime p, log p / (p ^ k : ℕ) := by rw [← add_sum_Ioc_eq_sum_Icc (le_max_left ..)] simp _ ≤ _ := by gcongr rw [sum_comm] conv => lhs; arg 2; ext p; arg 2; ext k; rw [← mul_one_div, Nat.cast_pow, ← one_div_pow] simp_rw [← mul_sum] calc _ ≤ ∑ p ∈ Ioc 0 ⌊x⌋₊ with Nat.Prime p, log p / (p * (p - 1)) := by gcongr with p hp simp only [mem_filter, mem_Ioc] at hp conv => rhs; rw [← mul_one_div] gcongr rw [(by rfl : Ioc 1 (max 1 ⌊log x / log 2⌋₊) = Ico 2 (max 1 ⌊log x / log 2⌋₊ + 1))] grw [geom_sum_Ico_le_of_lt_one (by simp)] · apply le_of_eq have : (p : ℝ) ≠ 0 := by exact_mod_cast hp.1.1.ne.symm field · simpa using inv_lt_one_of_one_lt₀ (mod_cast hp.2.one_lt) _ ≤ _ := by rw [sum_filter] exact E₁.summable.sum_le_tsum _ fun p hp ↦ E₁.summand_nonneg p theorem E₁p.ge {x : ℝ} (hx : 1 ≤ x) : E₁p x ≥ -2 - E₁ := by linarith [E₁Λ.le_E₁p_add_E₁ hx, E₁Λ.ge hx] theorem E₁p.bounded : ∃ c > 0, ∀ x ≥ 1, |E₁p x| ≤ c := by refine ⟨log 4 + 6 + E₁, ?_, ?_⟩ · have hlog : 0 ≤ log (4 : ℝ) := log_nonneg (by norm_num) linarith [E₁.nonneg] · intro x hx rw [abs_le] constructor · have hlog : 0 ≤ log (4 : ℝ) := log_nonneg (by norm_num) linarith [E₁p.ge hx] · linarith [E₁p.le hx, E₁.nonneg] lemma sum_Ioc_one_eq_sum_Icc_zero {f : ℕ → ℝ} {x : ℕ} (hx : 1 ≤ x) (hf1 : f 1 = 0) (hf0 : f 0 = 0) : ∑ n ∈ Ioc 1 x, f n = ∑ n ∈ Icc 0 x, f n := by rw [sum_Ioc_one_eq_sum_Ioc_zero hx hf1, ← add_sum_Ioc_eq_sum_Icc (by linarith)] simpa private theorem sum_div_log_eq {x : ℝ} (hx : 2 ≤ x) (f : ℕ → ℝ) : ∑ n ∈ Ioc 1 ⌊ x ⌋₊, f n / log n = (∑ n ∈ Ioc 1 ⌊ x ⌋₊, f n) / log x + ∫ t in 2..x, (∑ n ∈ Ioc 1 ⌊ t ⌋₊, f n) / (t * log t^2) := by let g : ℕ → ℝ := (fun n ↦ if n < 2 then 0 else f n) trans ∑ n ∈ Icc 0 ⌊ x ⌋₊, (log n)⁻¹ * g n · rw [← sum_Ioc_one_eq_sum_Icc_zero (Nat.le_floor (by grind)) (by simp) (by simp)] refine sum_congr rfl fun n hn ↦ ?_ have : ¬(n ≤ 1) := by simp_all simp [g, this] field rw [sum_mul_eq_sub_integral_mul₁ g (f := (fun n ↦ (log n)⁻¹)) (by simp [g]) (by simp [g])] · rw [intervalIntegral.integral_of_le hx, mul_comm, ← div_eq_mul_inv, ← sub_neg_eq_add] simp_rw [deriv_inv_log] congr 1 · rw [← sum_Ioc_one_eq_sum_Icc_zero (Nat.le_floor (by grind)) (by simp [g]) (by simp [g])] congr 1 refine sum_congr rfl fun n hn ↦ ?_ simp only [mem_Ioc] at hn have : ¬(n ≤ 1) := by linarith simp [g, this] · rw [← MeasureTheory.integral_neg] refine MeasureTheory.setIntegral_congr_fun (by measurability) fun t ht ↦ ?_ simp only [Set.mem_Ioc] at ht rw [← sum_Ioc_one_eq_sum_Icc_zero (Nat.le_floor (by grind)) (by simp [g]) (by simp [g])] field_simp congr 2 refine sum_congr rfl fun n hn ↦ ?_ simp only [mem_Ioc] at hn have : ¬(n ≤ 1) := by linarith simp [g, this] · intro t ht simp only [Set.mem_Icc] at ht have : log t ≠ 0 := by simp; grind fun_prop (disch := grind) · refine ContinuousOn.integrableOn_Icc fun t ht ↦ ContinuousAt.continuousWithinAt ?_ simp only [Set.mem_Icc] at ht conv => arg 1; ext x; rw [deriv_inv_log] have : log t ^2 ≠ 0 := by simp; grind fun_prop (disch := grind) private theorem integrable_const_div_mul_log_sq {x : ℝ} (c : ℝ) (hx : 2 ≤ x) : MeasureTheory.IntegrableOn (fun x ↦ c / (x * log x ^ 2)) (Set.Ioi x) MeasureTheory.volume := by conv => arg 1; ext t; rw [← mul_one_div] apply MeasureTheory.Integrable.const_mul refine MeasureTheory.integrableOn_Ioi_deriv_of_nonneg' ?_ ?_ tendsto_log_atTop.inv_tendsto_atTop.neg · intro t ht simp only [Set.mem_Ici] at ht have : log t ≠ 0 := by simp; grind have : DifferentiableAt ℝ (fun t ↦ -(log t)⁻¹) t := by fun_prop (disch := grind) convert! this.hasDerivAt using 1 simp [deriv_inv_log] field · intro t ht simp only [Set.mem_Ioi] at ht exact one_div_nonneg.mpr <| mul_nonneg (by linarith) (sq_nonneg _) private theorem integrable_E₁p_div_mul_log_sq {x : ℝ} (hx : 2 ≤ x) : MeasureTheory.IntegrableOn (fun x ↦ E₁p x / (x * log x ^ 2)) (Set.Ioi x) MeasureTheory.volume := by obtain ⟨c, hc1, hc2⟩ := E₁p.bounded apply MeasureTheory.Integrable.mono (integrable_const_div_mul_log_sq c hx) · exact Measurable.aestronglyMeasurable (by fun_prop) · filter_upwards [MeasureTheory.ae_restrict_mem (by measurability)] with t ht simp only [Set.mem_Ioi] at ht simp only [norm_div, norm_eq_abs, norm_mul, norm_pow, sq_abs, abs_of_pos hc1] gcongr exact hc2 t (by linarith) lemma deriv_log_log {x : ℝ} (hx : 1 < x) : deriv (fun t ↦ log (log t)) x = 1 / (x * log x) := by rw [deriv.log (differentiableAt_log (by linarith)) (by simp; grind), deriv_log] field lemma integral_one_div_mul_log {x : ℝ} (hx : 2 ≤ x) : ∫ t in 2..x, 1 / (t * log t) = log (log x) - log (log 2) := by rw [← intervalIntegral.integral_deriv_eq_sub (f := fun t ↦ log (log t))] · refine intervalIntegral.integral_congr fun t ht ↦ ?_ rw [deriv_log_log] rw [Set.uIcc_of_le hx, Set.mem_Icc] at ht linarith · intro t ht rw [Set.uIcc_of_le hx, Set.mem_Icc] at ht have : log t ≠ 0 := by simp; grind fun_prop (disch := grind) · refine ContinuousOn.intervalIntegrable ?_ apply ContinuousOn.congr (f := (fun t ↦ 1 / (t * log t))) · refine fun t ht ↦ ContinuousAt.continuousWithinAt ?_ rw [Set.uIcc_of_le hx, Set.mem_Icc] at ht have : log t ≠ 0 := by simp; grind fun_prop (disch := grind) · intro t ht rw [Set.uIcc_of_le hx, Set.mem_Icc] at ht exact deriv_log_log (by linarith) lemma intervalIntegrable_one_div_mul_log {x : ℝ} (hx : 2 ≤ x) : IntervalIntegrable (fun t ↦ 1 / (t * log t)) MeasureTheory.volume 2 x := by refine ContinuousOn.intervalIntegrable fun t ht ↦ ContinuousAt.continuousWithinAt ?_ rw [Set.uIcc_of_le hx, Set.mem_Icc] at ht have : log t ≠ 0 := by simp; grind fun_prop (disch := grind) private theorem integ_div_mul_log_sq {x : ℝ} (c : ℝ) (hx : 2 ≤ x) : ∫ t in Set.Ioi x, c / (t * log t^2) = c / log x := by convert! MeasureTheory.integral_Ioi_of_hasDerivAt_of_tendsto' (m := 0) (f := fun x ↦ - c / log x) ?_ (integrable_const_div_mul_log_sq c hx) ?_ using 1 · grind · intro t ht; simp at ht convert! HasDerivAt.fun_div (hasDerivAt_const _ (-c)) (hasDerivAt_log (by linarith)) ?_ using 1 · grind simp; grind convert! tendsto_log_atTop.inv_tendsto_atTop.const_mul (-c) using 1 simp noncomputable def M : ℝ := (∫ t in Set.Ioi 2, E₁p t / (t * log t^2)) + 1 - log (log 2) noncomputable abbrev E₂p (x : ℝ) : ℝ := ∑ p ∈ Ioc 0 ⌊ x ⌋₊ with p.Prime, (1:ℝ) / p - log (log x) - M theorem E₂p.eq {x : ℝ} (hx : 2 ≤ x) : E₂p x = E₁p x / log x - ∫ t in Set.Ioi x, E₁p t / (t * log t^2) := by unfold E₂p rw [sum_filter, ← sum_Ioc_one_eq_sum_Ioc_zero (Nat.le_floor (by grind)) (by simp [Nat.not_prime_one])] have (n : ℕ) : (if Nat.Prime n then (1 : ℝ) / n else 0) = (if Nat.Prime n then log n / n else 0) / log n := by split_ifs with h · have : log n ≠ 0 := by simp; grind [h.two_le] field · simp simp_rw [this] rw [sum_div_log_eq hx, sum_Ioc_one_eq_sum_Ioc_zero (Nat.le_floor (by grind)) (by simp), ← sum_filter] rw [sum_log_prime_div_eq] have : ∫ t in 2..x, (∑ n ∈ Ioc 1 ⌊t⌋₊, if Nat.Prime n then log ↑n / ↑n else 0) / (t * log t ^ 2) = ∫ t in 2..x, (1 / (t * log t) + E₁p t / (t * log t ^2)) := by refine intervalIntegral.integral_congr fun t ht ↦ ?_ rw [Set.uIcc_of_le hx, Set.mem_Icc] at ht rw [sum_Ioc_one_eq_sum_Ioc_zero (Nat.le_floor (by grind)) (by simp), ← sum_filter, sum_log_prime_div_eq] field rw [this, intervalIntegral.integral_add] · rw [integral_one_div_mul_log hx, add_div, div_self (by simp; grind)] unfold M calc _ = E₁p x / log x + (∫ (x : ℝ) in 2..x, E₁p x / (x * log x ^ 2)) - ((∫ (t : ℝ) in Set.Ioi 2, E₁p t / (t * log t ^ 2))) := by ring _ = _ := by rw [← intervalIntegral.integral_interval_add_Ioi (integrable_E₁p_div_mul_log_sq (by rfl)) (integrable_E₁p_div_mul_log_sq hx)] ring · exact intervalIntegrable_one_div_mul_log hx · rw [intervalIntegrable_iff, Set.uIoc_of_le hx] exact integrable_E₁p_div_mul_log_sq (x := 2) (by rfl)|>.mono (by grind) (by rfl) theorem E₂p.abs_le {x : ℝ} (hx : 2 ≤ x) : |E₂p x| ≤ (log 4 + 6 + E₁) / log x := by have : 0 < log x := by apply log_pos; linarith rw [E₂p.eq hx, abs_le'] constructor · grw [E₁p.le (by linarith)] have : ∫ t in Set.Ioi x, E₁p t / (t * log t^2) ≥ (- 2 - E₁) / log x := calc _ ≥ ∫ t in Set.Ioi x, (-2 - E₁) / (t * log t^2) := by apply MeasureTheory.setIntegral_mono_on (integrable_const_div_mul_log_sq (-2 - E₁) hx) (integrable_E₁p_div_mul_log_sq hx) (by measurability) intro y hy; simp at hy have : 1 < y := by linarith have : 0 < log y := log_pos this gcongr; exact E₁p.ge (by linarith) _ = _ := integ_div_mul_log_sq (-2 - E₁) hx grw [this] grind grw [E₁p.ge (by linarith)] have : ∫ t in Set.Ioi x, E₁p t / (t * log t^2) ≤ (log 4 + 4) / log x := calc _ ≤ ∫ t in Set.Ioi x, (log 4 + 4) / (t * log t^2) := by apply MeasureTheory.setIntegral_mono_on (integrable_E₁p_div_mul_log_sq hx) (integrable_const_div_mul_log_sq (log 4 + 4) hx) (by measurability) intro y hy; simp at hy have : 1 < y := by linarith have : 0 < log y := log_pos this gcongr; exact E₁p.le (by linarith) _ = _ := integ_div_mul_log_sq (log 4 + 4) hx grw [this] grind theorem E₂p.bound : E₂p =O[atTop] (fun x ↦ 1 / log x) := by simp only [one_div, isBigO_iff, norm_eq_abs, norm_inv, eventually_atTop] use log 4 + 6 + E₁, 2 intro x hx convert E₂p.abs_le hx using 1 have : 0 < log x := by apply log_pos; linarith grind [abs_of_pos this] theorem inv_log_eq_o_one : (fun x ↦ 1 / log x) =o[atTop] (fun _ ↦ (1:ℝ)) := by rw [isLittleO_one_iff] convert tendsto_log_atTop.inv_tendsto_atTop using 1 ext simp theorem E₂p.bound' : E₂p =o[atTop] (fun _ ↦ (1:ℝ)) := E₂p.bound.trans_isLittleO inv_log_eq_o_one noncomputable abbrev primeLogCorrection (p : ℕ) := if p.Prime then log (1 - 1 / p) + 1 / p else 0 lemma prime_log_correction_bound (n : ℕ) : |primeLogCorrection n| ≤ 2 / n ^ 2 := by unfold primeLogCorrection split_ifs with h · trans 1 / n ^ 2 / (1 - 1 / n) · convert abs_log_sub_add_sum_range_le (x := 1 / n) _ 1 using 1 · rw [add_comm] simp · rw [abs_of_nonneg (by simp)] ring · simpa using inv_lt_one_of_one_lt₀ (mod_cast h.one_lt) rw [(by ring : (2 : ℝ) / n ^ 2 = 1 / n ^ 2 / (1 / 2))] gcongr suffices (1 : ℝ) / n ≤ 1 / 2 by linarith gcongr exact_mod_cast h.two_le · rw [abs_zero] positivity lemma prime_log_correction_summable : Summable primeLogCorrection := by apply Summable.of_abs exact Summable.of_nonneg_of_le (by simp) prime_log_correction_bound (Summable.const_div (by simp) _) theorem prime_log_correction_zero : primeLogCorrection 0 = 0 := by simp [primeLogCorrection] theorem prime_log_correction_tendsto : Tendsto (fun x : ℝ => ∑ n ∈ Ioc 0 ⌊x⌋₊, primeLogCorrection n) atTop (nhds (∑' n, primeLogCorrection n)) := by have h := prime_log_correction_summable.hasSum.tendsto_sum_nat.comp ((tendsto_add_atTop_nat 1).comp (tendsto_nat_floor_atTop (α := ℝ))) convert h using 1 ext x simp only [Function.comp_apply] rw [Nat.range_succ_eq_Icc_zero, ← add_sum_Ioc_eq_sum_Icc (Nat.zero_le _), prime_log_correction_zero, zero_add] noncomputable def primeProductLimitConstant : ℝ := exp ((∑' n, primeLogCorrection n) - M) theorem prime_product_limit_constant_pos : 0 < primeProductLimitConstant := exp_pos _ theorem logarithmic_prime_product_eq_exp {x : ℝ} (hx : 1 < x) : log x * (∏ p ∈ (Ioc 0 ⌊x⌋₊).filter Nat.Prime, (1 - 1 / (p : ℝ))) = exp ((∑ n ∈ Ioc 0 ⌊x⌋₊, primeLogCorrection n) - M - E₂p x) := by have hcorr : (∑ n ∈ Ioc 0 ⌊x⌋₊, primeLogCorrection n) = (∑ p ∈ (Ioc 0 ⌊x⌋₊).filter Nat.Prime, log (1 - 1 / (p : ℝ))) + ∑ p ∈ (Ioc 0 ⌊x⌋₊).filter Nat.Prime, 1 / (p : ℝ) := by rw [← sum_add_distrib, sum_filter] have he : ((∑ n ∈ Ioc 0 ⌊x⌋₊, primeLogCorrection n) - M - E₂p x) = (∑ p ∈ (Ioc 0 ⌊x⌋₊).filter Nat.Prime, log (1 - 1 / (p : ℝ))) + log (log x) := by rw [hcorr] unfold E₂p ring rw [he, exp_add, exp_sum, exp_log (log_pos hx)] have hp : (∏ p ∈ (Ioc 0 ⌊x⌋₊).filter Nat.Prime, exp (log (1 - 1 / (p : ℝ)))) = ∏ p ∈ (Ioc 0 ⌊x⌋₊).filter Nat.Prime, (1 - 1 / (p : ℝ)) := by apply prod_congr rfl intro p hp apply exp_log have hp1 : (1 : ℝ) < p := by exact_mod_cast (mem_filter.mp hp).2.one_lt exact sub_pos.mpr ((div_lt_one (by linarith)).mpr hp1) rw [hp, mul_comm] theorem logarithmic_prime_product_tendsto : Tendsto (fun x : ℝ => log x * ∏ p ∈ (Ioc 0 ⌊x⌋₊).filter Nat.Prime, (1 - 1 / (p : ℝ))) atTop (nhds primeProductLimitConstant) := by have hE : Tendsto E₂p atTop (nhds 0) := (isLittleO_one_iff ℝ).mp E₂p.bound' have h := ((prime_log_correction_tendsto.sub_const M).sub hE).rexp simp only [sub_zero] at h apply h.congr' filter_upwards [eventually_gt_atTop (1 : ℝ)] with x hx exact (logarithmic_prime_product_eq_exp hx).symm theorem prime_reciprocal_error_tendsto : Tendsto (fun x : ℝ => (∑ p ∈ (Ioc 0 ⌊x⌋₊).filter Nat.Prime, 1 / (p : ℝ)) - log (log x)) atTop (nhds M) := by have h : Tendsto E₂p atTop (nhds 0) := (isLittleO_one_iff ℝ).mp E₂p.bound' have ht := h.add_const M simpa only [E₂p, sub_add_cancel, zero_add] using ht end Bounty.Mertens namespace Bounty open Real Finset Filter open scoped Topology theorem logarithmic_prime_avoidance_product_tendsto : Tendsto (fun x : ℝ => log x * ∏ p ∈ primeBand 0 x, (1 - 1 / (p : ℝ))) atTop (nhds Mertens.primeProductLimitConstant) := by simpa only [primeBand, Nat.floor_zero] using Mertens.logarithmic_prime_product_tendsto theorem exponential_prime_avoidance_product_tendsto {b : ℝ} (hb : 0 < b) : Tendsto (fun L : ℝ => L * ∏ p ∈ primeBand 0 (exp (b*L)), (1 - 1 / (p : ℝ))) atTop (nhds (Mertens.primeProductLimitConstant / b)) := by have he : Tendsto (fun L : ℝ => exp (b*L)) atTop atTop := tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hb) have h := (logarithmic_prime_avoidance_product_tendsto.comp he).div_const b convert h using 1 ext L simp only [Function.comp_apply, log_exp] field_simp theorem prime_band_harmonic_eq_prefix_sub {A B : ℝ} (hA : 0 ≤ A) (hAB : A ≤ B) : primeBandHarmonic A B = primeBandHarmonic 0 B - primeBandHarmonic 0 A := by classical have hB := hA.trans hAB have hs : primeBand 0 A ⊆ primeBand 0 B := by intro p hp obtain ⟨hp, h0, hpa⟩ := (mem_primeBand_iff (by norm_num) hA p).mp hp exact (mem_primeBand_iff (by norm_num) hB p).mpr ⟨hp, h0, hpa.trans hAB⟩ have hd : primeBand 0 B \ primeBand 0 A = primeBand A B := by apply Finset.ext intro p rw [Finset.mem_sdiff] simp only [ mem_primeBand_iff (by norm_num : (0:ℝ) ≤ 0) hB, mem_primeBand_iff (by norm_num : (0:ℝ) ≤ 0) hA, mem_primeBand_iff hA hB] constructor · rintro ⟨⟨hp, h0, hpB⟩, hn⟩ exact ⟨hp, lt_of_not_ge (fun hle => hn ⟨hp, h0, hle⟩), hpB⟩ · rintro ⟨hp, hpA, hpB⟩ exact ⟨⟨hp, hA.trans_lt hpA, hpB⟩, fun hn => (not_le_of_gt hpA) hn.2.2⟩ unfold primeBandHarmonic rw [← hd] exact (eq_sub_iff_add_eq).mpr (sum_sdiff hs) theorem exponential_prime_band_harmonic_tendsto {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : Tendsto (fun L : ℝ => primeBandHarmonic (exp (a*L)) (exp (b*L))) atTop (nhds (log (b/a))) := by have hb := ha.trans_le hab have hexp (c : ℝ) (hc : 0 < c) : Tendsto (fun L : ℝ => exp (c*L)) atTop atTop := tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hc) have hA := Mertens.prime_reciprocal_error_tendsto.comp (hexp a ha) have hB := Mertens.prime_reciprocal_error_tendsto.comp (hexp b hb) have h := (hB.sub hA).add_const (log (b/a)) simp only [sub_self, zero_add] at h apply h.congr' filter_upwards [eventually_gt_atTop (0 : ℝ)] with L hL simp only [Function.comp_apply] rw [prime_band_harmonic_eq_prefix_sub (exp_pos _).le (exp_le_exp.mpr (mul_le_mul_of_nonneg_right hab hL.le))] simp only [primeBandHarmonic, primeBand, Nat.floor_zero, log_exp, log_mul hb.ne' hL.ne', log_mul ha.ne' hL.ne', log_div hb.ne' ha.ne'] ring theorem prime_band_predecessor_reciprocal_error {A B : ℝ} (hA : 2 ≤ A) (hAB : A ≤ B) : 0 ≤ (∑ p ∈ primeBand A B, 1 / ((p : ℝ)-1)) - primeBandHarmonic A B ∧ (∑ p ∈ primeBand A B, 1 / ((p : ℝ)-1)) - primeBandHarmonic A B ≤ (2/A) * primeBandHarmonic A B := by have hA0 : 0 < A := by linarith have hB0 : 0 ≤ B := hA0.le.trans hAB have hpwise : ∀ p ∈ primeBand A B, 0 ≤ 1/((p : ℝ)-1)-1/(p : ℝ) ∧ 1/((p : ℝ)-1)-1/(p : ℝ) ≤ (2/A)*(1/(p : ℝ)) := by intro p hp obtain ⟨_, hAp, _⟩ := (mem_primeBand_iff hA0.le hB0 p).mp hp have hp0 : (0 : ℝ) < p := hA0.trans hAp have hp1 : (0 : ℝ) < (p : ℝ)-1 := by linarith have he : 1/((p : ℝ)-1)-1/(p : ℝ) = (1/((p : ℝ)-1))*(1/(p : ℝ)) := by field_simp ring have hrec : 1/((p : ℝ)-1) ≤ 2/A := by apply (div_le_div_iff₀ hp1 hA0).mpr linarith rw [he] exact ⟨mul_nonneg (by positivity) (by positivity), mul_le_mul_of_nonneg_right hrec (by positivity)⟩ unfold primeBandHarmonic rw [← sum_sub_distrib] constructor · exact sum_nonneg (fun p hp => (hpwise p hp).1) · calc _ ≤ ∑ p ∈ primeBand A B, (2/A)*(1/(p : ℝ)) := sum_le_sum (fun p hp => (hpwise p hp).2) _ = _ := (mul_sum ..).symm theorem exponential_prime_predecessor_reciprocal_tendsto {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : Tendsto (fun L : ℝ => ∑ p ∈ primeBand (exp (a*L)) (exp (b*L)), 1 / ((p : ℝ)-1)) atTop (nhds (log (b/a))) := by have he : Tendsto (fun L : ℝ => exp (a*L)) atTop atTop := tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop ha) have hi : Tendsto (fun L : ℝ => 2/exp (a*L)) atTop (nhds 0) := by simpa only [div_eq_mul_inv, mul_zero, Function.comp_apply] using (tendsto_inv_atTop_zero.comp he).const_mul 2 have hH := exponential_prime_band_harmonic_tendsto ha hab have hupper : Tendsto (fun L : ℝ => (2/exp (a*L))* primeBandHarmonic (exp (a*L)) (exp (b*L))) atTop (nhds 0) := by simpa only [zero_mul] using hi.mul hH have hbounds : ∀ᶠ L : ℝ in atTop, 0 ≤ (∑ p ∈ primeBand (exp (a*L)) (exp (b*L)), 1 / ((p : ℝ)-1)) - primeBandHarmonic (exp (a*L)) (exp (b*L)) ∧ (∑ p ∈ primeBand (exp (a*L)) (exp (b*L)), 1 / ((p : ℝ)-1)) - primeBandHarmonic (exp (a*L)) (exp (b*L)) ≤ (2/exp (a*L))*primeBandHarmonic (exp (a*L)) (exp (b*L)) := by filter_upwards [he.eventually (eventually_ge_atTop (2 : ℝ)), eventually_ge_atTop (0 : ℝ)] with L h2 hL exact prime_band_predecessor_reciprocal_error h2 (exp_le_exp.mpr (mul_le_mul_of_nonneg_right hab hL)) have hzero := squeeze_zero' (hbounds.mono (fun _ h => h.1)) (hbounds.mono (fun _ h => h.2)) hupper simpa only [sub_add_cancel, zero_add] using hzero.add hH end Bounty end section /- Elementary bounds for repeated prime factors in a rough interval. -/ open Finset Filter namespace Bounty theorem large_square_divisor_card_le {N : ℕ} {z : ℝ} (hz : 0 < z) (F : Finset ℕ) (hF : F ⊆ Ioc 0 N) (hsquare : ∀ n ∈ F, ∃ p : ℕ, z < (p : ℝ) ∧ p ^ 2 ∣ n) : (F.card : ℝ) ≤ 2 * (N : ℝ) / z := by classical let P := Ioo ⌊z⌋₊ (N + 1) let M := fun p : ℕ => (Ioc 0 N).filter (fun n => p ^ 2 ∣ n) have hsub : F ⊆ P.biUnion M := by intro n hn obtain ⟨p, hpz, hpn⟩ := hsquare n hn have hnI := mem_Ioc.mp (hF hn) have hpN : p ≤ N := (Nat.le_self_pow (by norm_num) p).trans ((Nat.le_of_dvd hnI.1 hpn).trans hnI.2) exact mem_biUnion.mpr ⟨p, mem_Ioo.mpr ⟨(Nat.floor_lt hz.le).mpr hpz, by omega⟩, mem_filter.mpr ⟨hF hn, hpn⟩⟩ calc (F.card : ℝ) ≤ ((P.biUnion M).card : ℝ) := by exact_mod_cast card_le_card hsub _ ≤ ∑ p ∈ P, ((M p).card : ℝ) := by exact_mod_cast card_biUnion_le _ ≤ ∑ p ∈ P, (N : ℝ) / (p : ℝ) ^ 2 := by apply sum_le_sum intro p hp dsimp only [M] rw [Nat.Ioc_filter_dvd_card_eq_div] simpa only [Nat.cast_pow] using (Nat.cast_div_le (m := N) (n := p ^ 2) : ((N / p ^ 2 : ℕ) : ℝ) ≤ (N : ℝ) / (p ^ 2 : ℕ)) _ = (N : ℝ) * ∑ p ∈ P, ((p : ℝ) ^ 2)⁻¹ := by simp only [div_eq_mul_inv, mul_sum] _ ≤ (N : ℝ) * (2 / ((⌊z⌋₊ : ℝ) + 1)) := by exact mul_le_mul_of_nonneg_left (sum_Ioo_inv_sq_le ⌊z⌋₊ (N + 1)) (Nat.cast_nonneg _) _ ≤ 2 * (N : ℝ) / z := by have hdiv : 2 / ((⌊z⌋₊ : ℝ) + 1) ≤ 2 / z := div_le_div_of_nonneg_left (by norm_num) hz (Nat.lt_floor_add_one z).le have hmul := mul_le_mul_of_nonneg_left hdiv (Nat.cast_nonneg N) calc _ ≤ (N : ℝ) * (2 / z) := hmul _ = 2 * (N : ℝ) / z := by ring theorem rough_band_nonsquarefree_card_le {A B z : ℝ} (hB : 0 ≤ B) (hz : 0 < z) : (((roughBand A B z).filter (fun n => ¬ Squarefree n)).card : ℝ) ≤ 2 * B / z := by classical let F := (roughBand A B z).filter (fun n => ¬ Squarefree n) have hF : F ⊆ Ioc 0 ⌊B⌋₊ := by intro n hn have hnR := (mem_filter.mp hn).1 have hnI := mem_Icc.mp (roughBand_subset_Icc A B z hnR) exact mem_Ioc.mpr ⟨hnI.1, hnI.2⟩ have hsquare : ∀ n ∈ F, ∃ p : ℕ, z < (p : ℝ) ∧ p ^ 2 ∣ n := by intro n hn obtain ⟨hnR, hnsq⟩ := mem_filter.mp hn rw [Nat.squarefree_iff_prime_squarefree] at hnsq push Not at hnsq obtain ⟨p, hp, hpn⟩ := hnsq have hpn' : p ∣ n := dvd_trans (dvd_mul_right p p) hpn have hpF := hp.mem_primeFactors hpn' (roughBand_pos hnR).ne' have hpz := (mem_filter.mp hnR).2 p hpF exact ⟨p, hpz, by simpa only [pow_two] using hpn⟩ apply (large_square_divisor_card_le hz F hF hsquare).trans exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left (Nat.floor_le hB) (by norm_num)) hz.le theorem rough_logarithmic_cell_nonsquarefree_card_le {γ L S Y : ℝ} (hL : 1 ≤ L) (hS : 0 ≤ S) (hY : 0 ≤ Y) : (((roughBand Y (Real.exp (L ^ (-S)) * Y) (Real.exp (γ * L))).filter (fun n => ¬ Squarefree n)).card : ℝ) ≤ 6 * Y * Real.exp (-γ * L) := by have hδ : L ^ (-S) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hL (neg_nonpos.mpr hS) have he : Real.exp (L ^ (-S)) ≤ 3 := (Real.exp_le_exp.mpr hδ).trans (by linarith [Real.exp_one_lt_d9]) have hb := rough_band_nonsquarefree_card_le (A := Y) (B := Real.exp (L ^ (-S)) * Y) (mul_nonneg (Real.exp_nonneg _) hY) (Real.exp_pos (γ * L)) apply hb.trans have hb' : 2 * (Real.exp (L ^ (-S)) * Y) ≤ 6 * Y := by nlinarith have hdiv := div_le_div_of_nonneg_right hb' (Real.exp_nonneg (γ * L)) simpa only [neg_mul, Real.exp_neg, div_eq_mul_inv] using hdiv theorem eventually_rough_logarithmic_cell_nonsquarefree_power_bound {γ₀ : ℝ} (hγ₀ : 0 < γ₀) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ γ : ℝ, γ₀ ≤ γ → ∀ S : ℝ, 0 ≤ S → ∀ Y : ℝ, 0 ≤ Y → (((roughBand Y (Real.exp (L ^ (-S)) * Y) (Real.exp (γ * L))).filter (fun n => ¬ Squarefree n)).card : ℝ) ≤ L ^ (-Bsave) * Y := by filter_upwards [eventually_linear_exponential_profile_le_rpow hγ₀ hγ₀ 6 0 Bsave, eventually_ge_atTop (1 : ℝ)] with L hdecay hL intro γ hγ S hS Y hY have hmono : Real.exp (-γ * L) ≤ Real.exp (-γ₀ * L) := by apply Real.exp_le_exp.mpr nlinarith calc _ ≤ 6 * Y * Real.exp (-γ * L) := rough_logarithmic_cell_nonsquarefree_card_le hL hS hY _ ≤ 6 * Y * Real.exp (-γ₀ * L) := mul_le_mul_of_nonneg_left hmono (by positivity) _ = (6 * Real.exp (-γ₀ * L)) * Y := by ring _ ≤ L ^ (-Bsave) * Y := by apply mul_le_mul_of_nonneg_right _ hY simpa only [zero_mul, zero_add, add_zero] using hdecay theorem rough_band_squarefree_count_error (A B z : ℝ) : |((roughBand A B z).card : ℝ) - (((roughBand A B z).filter Squarefree).card : ℝ)| = (((roughBand A B z).filter (fun n => ¬ Squarefree n)).card : ℝ) := by classical have hcard : (((roughBand A B z).filter Squarefree).card : ℝ) + (((roughBand A B z).filter (fun n => ¬ Squarefree n)).card : ℝ) = ((roughBand A B z).card : ℝ) := by exact_mod_cast (card_filter_add_card_filter_not (s := roughBand A B z) Squarefree) rw [← hcard, add_sub_cancel_left, abs_of_nonneg (Nat.cast_nonneg _)] theorem eventually_rough_logarithmic_cell_squarefree_count_error {γ₀ S : ℝ} (hγ₀ : 0 < γ₀) (hS : 0 ≤ S) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ γ : ℝ, γ₀ ≤ γ → ∀ Y : ℝ, 0 ≤ Y → |((roughBand Y (Real.exp (L ^ (-S)) * Y) (Real.exp (γ * L))).card : ℝ) - (((roughBand Y (Real.exp (L ^ (-S)) * Y) (Real.exp (γ * L))).filter Squarefree).card : ℝ)| ≤ L ^ (-Bsave) * ((Real.exp (L ^ (-S)) * Y - Y) / L) := by filter_upwards [eventually_rough_logarithmic_cell_nonsquarefree_power_bound hγ₀ (Bsave + S + 1), eventually_gt_atTop (0 : ℝ)] with L hcount hL intro γ hγ Y hY rw [rough_band_squarefree_count_error] calc _ ≤ L ^ (-(Bsave + S + 1)) * Y := hcount γ hγ S hS Y hY _ = L ^ (-Bsave) * (L ^ (-S) * Y / L) := by rw [show -(Bsave + S + 1) = (-Bsave + -S) - 1 by ring, Real.rpow_sub hL, Real.rpow_add hL, Real.rpow_one] ring _ ≤ L ^ (-Bsave) * ((Real.exp (L ^ (-S)) * Y - Y) / L) := by apply mul_le_mul_of_nonneg_left _ (Real.rpow_nonneg hL.le _) apply div_le_div_of_nonneg_right _ hL.le have he := Real.add_one_le_exp (L ^ (-S)) nlinarith end Bounty end section /- The original ledger rows form a full projected edge without altering the ledger update. -/ open Finset namespace Bounty universe uJ uK uP uA section Full variable {J : Type uJ} {K : Type uK} {N : ℕ} {P : Fin N → Type uP} [∀ g, DecidableEq (P g)] [∀ g, Fintype (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Full end Bounty end section /- The empty-memory sector is an exact positive part of the full finite ordered-memory measure. This also applies to one active residue label. -/ open Finset Classical namespace Bounty end Bounty end section /- The actual candidate prime ranges discharge the arithmetic hypotheses for uniform small-group omission averaging. Source lists remain injective, and no shared small-group product is conditioned on before the average. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem eventually_candidate_omission_bounds {s : ℝ} (hs : 0 < s) (ell : ℕ) (C₂ : ℝ) : ∀ᶠ L : ℝ in atTop, (Real.exp (L ^ (1/5 : ℝ))) ^ (ell * (candidateSmallPIndices s L).card) < Real.exp (L ^ (3/10 : ℝ)) ∧ L ^ C₂ < Real.exp (L ^ (3/10 : ℝ)) ∧ (∀ j ∈ candidateSmallPIndices s L, ∀ p ∈ candidatePBand (s * L) j, (p : ℝ) ≤ Real.exp (L ^ (1/5 : ℝ))) ∧ (∀ j ∈ candidateBigPIndices s L, ∀ p ∈ candidatePBand (s * L) j, Nat.Prime p ∧ Real.exp (L ^ (3/10 : ℝ)) < (p : ℝ)) ∧ (∀ j ∈ candidatePIndices s L, ∀ p ∈ candidatePBand (s * L) j, Nat.Prime p) ∧ Pairwise (fun i j : ℕ => Disjoint (candidatePBand (s * L) i) (candidatePBand (s * L) j)) := by obtain ⟨vs, Vs, _, _, hsmall⟩ := eventually_candidate_P_groups (α := (1/10 : ℝ)) (β := (1/5 : ℝ)) hs (by norm_num) (by norm_num) (by norm_num) obtain ⟨vb, Vb, _, _, hbig⟩ := eventually_candidate_P_groups (α := (3/10 : ℝ)) (β := (2/5 : ℝ)) hs (by norm_num) (by norm_num) (by norm_num) filter_upwards [hsmall, hbig, eventually_small_omission_power_lt (show (1/5 : ℝ) < 3/10 by norm_num) ell (1 / (5 * Real.log 2)), eventually_log_times_rpow_lt (show (0 : ℝ) < 3/10 by norm_num) C₂, eventually_gt_atTop (0 : ℝ)] with L hsL hbL hpower hstep hL have hcard : ((candidateSmallPIndices s L).card : ℝ) ≤ (1 / (5 * Real.log 2)) * Real.log L := by have hc := hsL.2.1 change ((candidateSmallPIndices s L).card : ℝ) ≤ _ at hc rw [show 2 * ((1/5 : ℝ) - 1/10) / Real.log 2 = 1 / (5 * Real.log 2) by ring] at hc exact hc refine ⟨hpower _ hcard, ?_, ?_, ?_, ?_, hsL.2.2.1⟩ · rw [Real.rpow_def_of_pos hL] apply Real.exp_lt_exp.mpr simpa only [Real.rpow_zero, mul_one, mul_comm] using hstep · intro j hj p hp exact ((hsL.2.2.2 j hj).2.2 p hp).2.2 · intro j hj p hp exact ⟨((hbL.2.2.2 j hj).2.2 p hp).1, ((hbL.2.2.2 j hj).2.2 p hp).2.1⟩ · intro j hj p hp rcases mem_union.mp hj with hj | hj · exact ((hsL.2.2.2 j hj).2.2 p hp).1 · exact ((hbL.2.2.2 j hj).2.2 p hp).1 theorem eventually_candidate_small_big_indices_disjoint {s : ℝ} (hs : 0 < s) : ∀ᶠ L : ℝ in atTop, Disjoint (candidateSmallPIndices s L) (candidateBigPIndices s L) := by obtain ⟨vb, Vb, hvb, _, hbig⟩ := eventually_candidate_P_groups (α := (3/10 : ℝ)) (β := (2/5 : ℝ)) hs (by norm_num) (by norm_num) (by norm_num) filter_upwards [hbig, eventually_candidate_omission_bounds hs 0 0, eventually_ge_atTop (1 : ℝ)] with L hb hL hOne apply disjoint_left.mpr intro j hjs hjb have hne : (candidatePBand (s * L) j).Nonempty := by apply nonempty_iff_ne_empty.mpr intro he have hv := (hb.2.2.2 j hjb).1 rw [he, sum_empty] at hv exact (not_le_of_gt hvb) hv obtain ⟨p, hp⟩ := hne have hsUpper := hL.2.2.1 j hjs p hp have hbLower := (hL.2.2.2.1 j hjb p hp).2 have horder : Real.exp (L ^ (1/5 : ℝ)) ≤ Real.exp (L ^ (3/10 : ℝ)) := Real.exp_le_exp.mpr (Real.rpow_le_rpow_of_exponent_le hOne (by norm_num)) exact (not_lt_of_ge (hsUpper.trans horder)) hbLower end Bounty end section /- Literal promotion events require an eligible old memory index. This support statement retains all event weights and both total-memory cutoffs. It can be combined with small-source omission rarity before averaging those source permutations; no fixed-displacement rarity is asserted. -/ open Finset open scoped Classical namespace Bounty theorem unrestricted_promoting_event_eligible {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) (hp : e.2.1 ≠ ∅) : (unrestrictedResidueEligible n Δ D s.2.2).Nonempty := by obtain ⟨i, hi⟩ := Finset.nonempty_iff_ne_empty.mpr hp exact ⟨(e.2.2.1 ⟨i, hi⟩).val, (e.2.2.1 ⟨i, hi⟩).property⟩ /- Match the minus-displacement convention to the congruence in the physical small-omission counting theorem. Repeated indices remain distinct. -/ theorem unrestricted_eligible_physical_congruence {P : Type*} {N : ℕ} (n : P → ℕ) (k : ℤ) (D : ℕ) (old : Fin N → UnrestrictedResidueParticle n) : (unrestrictedResidueEligible n (-(k * (D : ℤ))) D old).Nonempty ↔ ∃ j : Fin N, ¬ n (old j).1 ∣ D ∧ (old j).2 + (k : ZMod (n (old j).1)) * (D : ZMod (n (old j).1)) = 0 := by simp only [Finset.Nonempty, mem_unrestrictedResidueEligible, Int.cast_neg, Int.cast_mul, Int.cast_natCast, Int.natCast_dvd_natCast, eq_neg_iff_add_eq_zero] exact exists_congr fun _ => and_comm end Bounty end section /- A source-dependent sparse support improves an average of already bounded operations. The support restriction is used before the energy integral; no row-independent exceptional set is assumed. -/ open Finset open scoped Classical namespace Bounty theorem finite_sparse_average_sq_le {A : Type*} [Fintype A] (π : A → ℝ) (hπ : ∀ a, 0 ≤ π a) (bad : A → Prop) (F : A → ℂ) (hzero : ∀ a, ¬ bad a → F a = 0) {δ : ℝ} (hδ : 0 ≤ δ) (hmass : (∑ a, if bad a then π a else 0) ≤ δ) : ‖∑ a, (π a : ℂ) * F a‖ ^ 2 ≤ δ * ∑ a, π a * ‖F a‖ ^ 2 := by let q : A → ℝ := fun a => if bad a then π a else 0 have hq : ∀ a, 0 ≤ q a := by intro a dsimp only [q] split_ifs · exact hπ a · exact le_rfl have he : (∑ a, (π a : ℂ) * F a) = ∑ a, (q a : ℂ) * F a := by apply sum_congr rfl intro a _ by_cases ha : bad a · simp only [q, if_pos ha] · simp only [q, if_neg ha, hzero a ha, mul_zero] rw [he] apply (finite_weighted_sum_cauchy univ q (fun a _ => hq a) F).trans apply mul_le_mul hmass _ _ hδ · apply sum_le_sum intro a _ apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) dsimp only [q] split_ifs · exact le_rfl · exact hπ a · exact sum_nonneg fun a _ => mul_nonneg (hq a) (sq_nonneg _) theorem finite_sparse_average_energy_le {A X : Type*} [Fintype A] [Fintype X] (π : A → ℝ) (hπ : ∀ a, 0 ≤ π a) (hπmass : ∑ a, π a ≤ 1) (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (bad : A → X → Prop) (F : A → X → ℂ) (hzero : ∀ a x, ¬ bad a x → F a x = 0) {δ K : ℝ} (hδ : 0 ≤ δ) (hK : 0 ≤ K) (hmass : ∀ x, (∑ a, if bad a x then π a else 0) ≤ δ) (f : X → ℂ) (hF : ∀ a, finiteWeightedEnergy w (F a) ≤ K * finiteWeightedEnergy w f) : finiteWeightedEnergy w (fun x => ∑ a, (π a : ℂ) * F a x) ≤ δ * K * finiteWeightedEnergy w f := by have hE : 0 ≤ finiteWeightedEnergy w f := sum_nonneg fun x _ => mul_nonneg (hw x) (sq_nonneg _) calc _ ≤ ∑ x, w x * (δ * ∑ a, π a * ‖F a x‖ ^ 2) := sum_le_sum fun x _ => mul_le_mul_of_nonneg_left (finite_sparse_average_sq_le π hπ (fun a => bad a x) (fun a => F a x) (fun a => hzero a x) hδ (hmass x)) (hw x) _ = δ * ∑ a, π a * finiteWeightedEnergy w (F a) := by simp only [finiteWeightedEnergy, mul_sum] rw [sum_comm] apply sum_congr rfl intro a _ apply sum_congr rfl intro x _ ring _ ≤ δ * ∑ a, π a * (K * finiteWeightedEnergy w f) := mul_le_mul_of_nonneg_left (sum_le_sum fun a _ => mul_le_mul_of_nonneg_left (hF a) (hπ a)) hδ _ = δ * ((∑ a, π a) * (K * finiteWeightedEnergy w f)) := by rw [sum_mul] _ ≤ δ * (1 * (K * finiteWeightedEnergy w f)) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hπmass (mul_nonneg hK hE)) hδ _ = _ := by ring end Bounty end section /- Exact transfer masks in the factorial-measure adjoint. A storage mask becomes a promotion mask after reversal. Both endpoint caps are retained, and the reverse promotion/storage normalization is explicit. -/ open Finset Classical namespace Bounty section variable {P : Type*} [sharedInstance1 : Fintype P] (n : P → ℕ) [sharedInstance3 : ∀ p, NeZero (n p)] (μ : P → ℝ) (Δ D : ℤ) (ρ : ℝ) {V : ℝ} (hV : V ≠ 0) (t Bsrc Btgt : ℕ) (w : Finset (Fin t) → Finset (Fin t) → ℂ) (F H : (Fin t → P) → FiniteOrderedTuple (UnrestrictedResidueParticle n) → ℂ) (hF : ∀ source, OrderedTupleSymmetric (F source)) (hH : ∀ target, OrderedTupleSymmetric (H target)) include P sharedInstance1 n sharedInstance3 μ Δ D ρ V hV t Bsrc Btgt w F H hF hH /- Arbitrary coefficients depending only on the two active slot subsets are transported by interchanging the subsets. -/ theorem unrestricted_weighted_bounded_action_pairing_reverse : (∑ N ∈ range (Bsrc + 1), unrestrictedWeightedActionLevelPairing n μ Δ D ρ V t N Btgt w F H) = ∑ M ∈ range (Btgt + 1), unrestrictedWeightedActionLevelPairing n μ (-Δ) D ρ V t M Bsrc (fun S T => ((V ^ T.card / V ^ S.card : ℝ) : ℂ) * w T S) H F := by simp_rw [unrestricted_weighted_action_level_pairing_slots] rw [unrestricted_three_sum_rotate, unrestricted_three_sum_rotate] conv_rhs => rw [sum_comm] apply sum_congr rfl intro S hS apply sum_congr rfl intro T hT conv_lhs => rw [← mul_sum] conv_rhs => rw [← mul_sum] have hc : (((V ^ S.card / V ^ T.card : ℝ) : ℂ) * w S T) * ((1 / V ^ S.card : ℝ) : ℂ) = w S T * ((1 / V ^ T.card : ℝ) : ℂ) := by have hr : ((V ^ S.card / V ^ T.card : ℝ) : ℂ) * ((1 / V ^ S.card : ℝ) : ℂ) = ((1 / V ^ T.card : ℝ) : ℂ) := by rw [← Complex.ofReal_mul] congr 1 field_simp calc _ = w S T * (((V ^ S.card / V ^ T.card : ℝ) : ℂ) * ((1 / V ^ S.card : ℝ) : ℂ)) := by ring _ = _ := by rw [hr] conv_rhs => rw [hc] apply congrArg (fun z : ℂ => (w S T * ((1 / V ^ T.card : ℝ) : ℂ)) * z) have hr := unrestricted_fixed_slot_bounded_reverse n μ Δ D t Bsrc Btgt S T (unrestrictedDampedPair n ρ F H) (unrestricted_damped_pair_source_symmetric n ρ F H hF) (unrestricted_damped_pair_target_symmetric n ρ F H hH) refine hr.trans ?_ apply sum_congr rfl intro M hM apply congrArg (unrestrictedFixedSlotPairing n μ (-Δ) D t M T S) funext target source Y X split_ifs · unfold unrestrictedDampedPair push_cast ring · rfl /- Literal bounded-state masked adjoint, with independently chosen source and target caps. No positivity or normalization of the label law is needed. -/ theorem unrestricted_bounded_masked_pairing_reverse : (∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t Bsrc, (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * F s.1 (boundedOrderedTupleToFinite s.2) * unrestrictedResidueEdgeAction n Δ D s.1 s.2.2 μ ρ V Btgt (fun S T _ _ => w S T) H) = ∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t Btgt, (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * unrestrictedResidueEdgeAction n (-Δ) D s.1 s.2.2 μ ρ V Bsrc (fun S T _ _ => ((V ^ T.card / V ^ S.card : ℝ) : ℂ) * w T S) F * H s.1 (boundedOrderedTupleToFinite s.2) := by let A (source : Fin t → P) (q : FiniteOrderedTuple (UnrestrictedResidueParticle n)) : ℂ := unrestrictedResidueEdgeAction n Δ D source q.2 μ ρ V Btgt (fun S T _ _ => w S T) H let R (source : Fin t → P) (q : FiniteOrderedTuple (UnrestrictedResidueParticle n)) : ℂ := unrestrictedResidueEdgeAction n (-Δ) D source q.2 μ ρ V Bsrc (fun S T _ _ => ((V ^ T.card / V ^ S.card : ℝ) : ℂ) * w T S) F have hl := bounded_ordered_pairing_levels μ (unrestrictedResidueWeight μ) t Bsrc F A have hr := bounded_ordered_pairing_levels μ (unrestrictedResidueWeight μ) t Btgt H R calc _ = ∑ N ∈ range (Bsrc + 1), unrestrictedWeightedActionLevelPairing n μ Δ D ρ V t N Btgt w F H := hl _ = ∑ M ∈ range (Btgt + 1), unrestrictedWeightedActionLevelPairing n μ (-Δ) D ρ V t M Bsrc (fun S T => ((V ^ T.card / V ^ S.card : ℝ) : ℂ) * w T S) H F := unrestricted_weighted_bounded_action_pairing_reverse n μ Δ D ρ hV t Bsrc Btgt w F H hF hH _ = ∑ s : BoundedOrderedState P (UnrestrictedResidueParticle n) t Btgt, (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * H s.1 (boundedOrderedTupleToFinite s.2) * R s.1 (boundedOrderedTupleToFinite s.2) := hr.symm _ = _ := by apply sum_congr rfl intro s hs change (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * H s.1 (boundedOrderedTupleToFinite s.2) * R s.1 (boundedOrderedTupleToFinite s.2) = (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * R s.1 (boundedOrderedTupleToFinite s.2) * H s.1 (boundedOrderedTupleToFinite s.2) ring end /- The finite operator with a source-independent active-subset coefficient. -/ noncomputable def unrestrictedSlotOperator {P : Type*} [Fintype P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (w : Finset (Fin t) → Finset (Fin t) → ℂ) := unrestrictedBoundedOperator n Δ D μ ρ V t B (fun _ S T _ _ => w S T) theorem unrestricted_slot_operator_symmetric {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (w : Finset (Fin t) → Finset (Fin t) → ℂ) (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) (hf : BoundedOrderedSymmetric f) : BoundedOrderedSymmetric (unrestrictedSlotOperator n Δ D μ ρ V t B w f) := by intro active N old τ unfold unrestrictedSlotOperator unrestrictedBoundedOperator unrestrictedBoundedAction unrestrictedResidueEdgeAction dsimp only rw [unrestricted_residue_eligible_perm] apply unrestricted_edge_action_perm · intros; rfl · exact (boundedOrderedZeroExtension_symmetric_iff f).mpr hf /- The finite operator version of masked duality. The tests need only be symmetric on the bounded state space. -/ theorem unrestricted_slot_operator_pairing_reverse {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) (μ : P → ℝ) (ρ : ℝ) {V : ℝ} (hV : V ≠ 0) (t B : ℕ) (w : Finset (Fin t) → Finset (Fin t) → ℂ) (f g : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℂ) (hf : BoundedOrderedSymmetric f) (hg : BoundedOrderedSymmetric g) : (∑ s, (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * f s * unrestrictedSlotOperator n Δ D μ ρ V t B w g s) = ∑ s, (boundedOrderedStateWeight μ (unrestrictedResidueWeight μ) s : ℂ) * unrestrictedSlotOperator n (-Δ) D μ ρ V t B (fun S T => ((V ^ T.card / V ^ S.card : ℝ) : ℂ) * w T S) f s * g s := by have h := unrestricted_bounded_masked_pairing_reverse n μ Δ D ρ hV t B B w (boundedOrderedZeroExtension f) (boundedOrderedZeroExtension g) ((boundedOrderedZeroExtension_symmetric_iff f).mpr hf) ((boundedOrderedZeroExtension_symmetric_iff g).mpr hg) simpa only [boundedOrderedZeroExtension_apply, unrestrictedSlotOperator, unrestrictedBoundedOperator, unrestrictedBoundedAction] using h end Bounty end section /- Exact insertion of the average over a selected set of active groups. This keeps the selected source permutations inside an arbitrary intervening operator. Groups outside the selected set and all pending memories stay fixed. No injectivity of active label lists or covariance of the operator is required. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Exact spectator factorization for the mixed model with injective small mark lists and unrestricted big-group pending memory. These identities do not identify that model with the unrestricted all-group memory model. At each fixed small prefix and auxiliary draw, event coefficients and big-state targets are independent of the small completion being summed. The small target residue may be chosen separately for each auxiliary draw. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_condition_weighted_sum {G E : Type*} [Fintype G] [DecidableEq G] [Fintype E] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (q : ℝ) (r : PhysicalResidues P) (d : PhysicalSharedLists P J) (a : E → ℂ) (f : E → PhysicalMarkLists P J ell → ℂ) : physicalSmallCondition V q r d (fun L => ∑ e, a e * f e L) = ∑ e, a e * physicalSmallCondition V q r d (f e) := by simp only [physical_small_condition_eq_vertex_sum, mul_sum] rw [sum_comm] apply sum_congr rfl intro L _ by_cases h : physicalSharedPrefix L = d · simp only [if_pos h, mul_sum] apply sum_congr rfl intro e _ ring · simp only [if_neg h, mul_zero, sum_const_zero] /- The existing physical small-group bilinear factorization with a finite big-event continuation kept explicit. The index type may depend on the retained small prefix; its weights may also depend on the translated small residue. This is applied separately for each fixed auxiliary draw. -/ theorem physical_small_bilinear_events_with_prefix {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (q ζ : ℝ) (k : ℤ) (r : PhysicalResidues P) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → Type*) [∀ d, Fintype (E d)] (a : ∀ d, PhysicalResidues P → E d → ℂ) (f : PhysicalMarkLists P J ell → ℂ) (g : ∀ d, E d → PhysicalResidues P → PhysicalMarkLists P J ell → ℂ) : let tr := fun d : PhysicalSharedLists P J => physicalTranslateResidues r (k * (physicalSharedProduct d : ℕ)) (∑ L, ∑ R, (physicalStateMass V J ell : ℂ) * (starRingEnd ℂ) (f L) * physicalBarePatternScalar V (fun _ => (∅ : Finset (Fin J))) ζ (fun L _ _ => κ (physicalSharedPrefix L)) aux L R * ((physicalResidueVertexWeight L (Real.sqrt q) r * physicalResidueVertexWeight R (Real.sqrt q) (tr (physicalSharedPrefix L)) : ℝ) : ℂ) * (∑ e : E (physicalSharedPrefix L), a (physicalSharedPrefix L) (tr (physicalSharedPrefix L)) e * g (physicalSharedPrefix L) e (tr (physicalSharedPrefix L)) R)) = ∑ d, (starRingEnd ℂ) (physicalSmallCondition V q r d f) * (κ d * physicalPhase ζ (physicalSharedProduct d)) * (∑ e : E d, a d (tr d) e * physicalSmallCondition V q (tr d) d (g d e (tr d))) := by intro tr rw [physical_small_bilinear_factorization_with_prefix V hV q ζ k r aux κ f (fun d s R => ∑ e : E d, a d s e * g d e s R)] apply sum_congr rfl intro d _ rw [physical_small_condition_weighted_sum] /- The full big-active-slot projection also commutes with the small conditioning map. This retains the adjacent active averages in the mixed operator factorization. -/ theorem physical_small_condition_full_active_average {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {J ell : ℕ} (Vs : S → ℝ) (q : ℝ) (r : PhysicalResidues Ps) (d : PhysicalSharedLists Ps J) {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z M B → PhysicalMarkLists Ps J ell → ℂ) (x : ProductBoundedOrderedState P Z M B) : physicalSmallCondition Vs q r d (fun L => fullActiveAverage (fun y => f y L) x) = fullActiveAverage (fun y => physicalSmallCondition Vs q r d (f y)) x := by unfold fullActiveAverage exact physical_small_condition_weighted_sum Vs q r d (fun τ => (fullActivePermutationWeight M τ : ℂ)) (fun τ => f (fullActivePermutation τ x)) end Bounty end section /- Uniform small-source permutation rarity with an arbitrary fixed big factor. Only the small source lists are injective; the big factor may come from repeated active labels, and pending particle indices may repeat values. -/ open Finset open scoped Classical namespace Bounty def smallSourcePrimeOmissions {S : Type*} {P : S → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (A : GroupedOmissionSubsets S (PhysicalSlots J ell) ell) : PrimeOmissionChoices (physicalGroupMarks labels) ell := fun g => ⟨(A g).val.map (physicalGroupMarkEmbedding labels g), mem_powersetCard.mpr ⟨map_subset_map.mpr (mem_powersetCard.mp (A g).property).1, by simpa only [card_map] using (mem_powersetCard.mp (A g).property).2⟩⟩ theorem small_source_prime_omissions_injective {S : Type*} {P : S → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) : Function.Injective (smallSourcePrimeOmissions labels) := by intro A B h funext g apply Subtype.ext apply map_injective (physicalGroupMarkEmbedding labels g) exact congrArg Subtype.val (congrFun h g) noncomputable def smallSourcePermutationDilation {S : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (D_B : ℕ) (σ : S → Equiv.Perm (PhysicalSlots J ell)) : ℕ := D_B * ∏ g, ∏ j : Fin J, (labels g (σ g (Sum.inl j))).val theorem small_source_permutation_dilation_eq {S : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (D_B : ℕ) (σ : S → Equiv.Perm (PhysicalSlots J ell)) : smallSourcePermutationDilation labels D_B σ = primeOmissionDilation (physicalGroupMarks labels) ell D_B (smallSourcePrimeOmissions labels (groupedPermutedOmissions (physicalOmissionSlots J ell) (physical_omission_slots_card J ell) σ)) := by unfold smallSourcePermutationDilation primeOmissionDilation primeRetainedProduct congr 1 apply prod_congr rfl intro g _ have he : (smallSourcePrimeOmissions labels (groupedPermutedOmissions (physicalOmissionSlots J ell) (physical_omission_slots_card J ell) σ) g).val = physicalLastMarks (physicalPermuteLabels σ labels) g := by simp only [smallSourcePrimeOmissions, groupedPermutedOmissions, permutedOmissionSubset, physicalOmissionSlots, physicalLastMarks, map_map] congr 1 rw [he, ← physical_group_marks_permute σ labels g, physical_group_marks_sdiff_last] simp only [physicalFirstMarks, prod_map, Function.Embedding.trans_apply, Function.Embedding.inl_apply, physicalGroupMarkEmbedding, physicalPermuteLabels] rfl theorem small_source_permutation_eligible_fraction_le {S Particle : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (labels : PhysicalMarkLists P J ell) (hP : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (D_B : ℕ) (pending : Finset Particle) (p : Particle → ℕ) (hp : ∀ z, (p z).Prime) (r : ∀ z, ZMod (p z)) (k : ℤ) (hk : ∀ z ∈ pending, ¬ (p z : ℤ) ∣ k) (hlt : ∀ z ∈ pending, ∀ A : PrimeOmissionChoices (physicalGroupMarks labels) ell, primeOmissionProduct (physicalGroupMarks labels) ell A < p z) : letI : DecidableEq S := Classical.decEq _ letI : DecidableEq (PhysicalSlots J ell) := Classical.decEq _ ((univ.filter (fun σ : S → Equiv.Perm (PhysicalSlots J ell) => ∃ z ∈ pending, ¬ p z ∣ smallSourcePermutationDilation labels D_B σ ∧ r z + (k : ZMod (p z)) * (smallSourcePermutationDilation labels D_B σ : ZMod (p z)) = 0)).card : ℝ) / (Fintype.card (S → Equiv.Perm (PhysicalSlots J ell)) : ℝ) ≤ (pending.card : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ) := by let _ : DecidableEq S := Classical.decEq _ let _ : DecidableEq (PhysicalSlots J ell) := Classical.decEq _ let U := fun A : GroupedOmissionSubsets S (PhysicalSlots J ell) ell => primeOmissionProduct (physicalGroupMarks labels) ell (smallSourcePrimeOmissions labels A) let D := fun A : GroupedOmissionSubsets S (PhysicalSlots J ell) ell => primeOmissionDilation (physicalGroupMarks labels) ell D_B (smallSourcePrimeOmissions labels A) let bad := rareOmissionChoices univ pending (fun z A => ¬ p z ∣ D A ∧ r z + (k : ZMod (p z)) * (D A : ZMod (p z)) = 0) have hU : Function.Injective U := (prime_omission_product_injective (physicalGroupMarks labels) ell (fun g q hq => hP g q (physical_group_marks_subset labels g hq)) (fun g h hne => (hdis hne).mono (physical_group_marks_subset labels g) (physical_group_marks_subset labels h))).comp (small_source_prime_omissions_injective labels) have hbad : bad.card ≤ pending.card := modular_eligible_omission_card_le univ pending U hU p hp (fun _ => D) (fun _ => D_B * primeFullProduct (physicalGroupMarks labels)) (fun _ A => prime_omission_mul_dilation_eq (physicalGroupMarks labels) ell D_B (smallSourcePrimeOmissions labels A)) r k hk (fun z hz A => hlt z hz (smallSourcePrimeOmissions labels A)) have hevent (σ : S → Equiv.Perm (PhysicalSlots J ell)) : groupedPermutedOmissions (physicalOmissionSlots J ell) (physical_omission_slots_card J ell) σ ∈ bad ↔ ∃ z ∈ pending, ¬ p z ∣ smallSourcePermutationDilation labels D_B σ ∧ r z + (k : ZMod (p z)) * (smallSourcePermutationDilation labels D_B σ : ZMod (p z)) = 0 := by simp only [bad, rareOmissionChoices, mem_filter, mem_univ, true_and, D, ← small_source_permutation_dilation_eq] have h := grouped_uniform_bad_omission_fraction_le (physicalOmissionSlots J ell) (physical_omission_slots_card J ell) bad pending.card hbad have hslots : Fintype.card (PhysicalSlots J ell) = J + ell := by simp only [PhysicalSlots, Fintype.card_sum, Fintype.card_fin] rw [hslots] at h simpa only [hevent] using h end Bounty end section /- Exact bilinear transposition under the product factorial memory law. Coordinate transposes reverse composition order, while independent local event sums do not depend on the order of distinct coordinates. -/ open Finset Classical namespace Bounty theorem finite_coordinate_compose_append {I : Type*} [DecidableEq I] {X : I → Type*} (A : ∀ i, (X i → ℂ) → X i → ℂ) (is js : List I) (f : (∀ i, X i) → ℂ) : finiteCoordinateCompose A (is ++ js) f = finiteCoordinateCompose A is (finiteCoordinateCompose A js f) := by induction is with | nil => rfl | cons i is ih => simp only [List.cons_append, finiteCoordinateCompose, ih] theorem finite_product_bilinear_split {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (i : I) (f g : (∀ i, X i) → ℂ) : (∑ x, (finiteProductWeight μ x : ℂ) * f x * g x) = ∑ z : (∀ j : {j : I // j ≠ i}, X j.val), ((∏ j, μ j.val (z j) : ℝ) : ℂ) * ∑ y : X i, (μ i y : ℂ) * f ((Equiv.piSplitAt i X).symm (y, z)) * g ((Equiv.piSplitAt i X).symm (y, z)) := by let E := Equiv.piSplitAt i X rw [← E.symm.sum_comp, Fintype.sum_prod_type, sum_comm] apply sum_congr rfl intro z hz rw [mul_sum] apply sum_congr rfl intro y hy rw [finite_product_weight_split μ i] have hE := E.apply_symm_apply (y, z) have hfirst : E.symm (y, z) i = y := congrArg Prod.fst hE have hrest : (fun j : {j : I // j ≠ i} => E.symm (y, z) j.val) = z := congrArg Prod.snd hE have hprod : (∏ j : {j : I // j ≠ i}, μ j.val (E.symm (y, z) j.val)) = ∏ j, μ j.val (z j) := congrArg (fun q => ∏ j, μ j.val (q j)) hrest rw [hfirst, hprod, Complex.ofReal_mul] ring theorem product_memory_pi_slice_symmetric {G : Type*} [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (i : G) (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) (z : ∀ j : {j : G // j ≠ i}, BoundedOrderedState (P j.val) (Z j.val) (t j.val) B) : BoundedOrderedSymmetric (fun y => f ((Equiv.piSplitAt i (fun j => BoundedOrderedState (P j) (Z j) (t j) B)).symm (y, z))) := by intro active N q τ let E := Equiv.piSplitAt i (fun j => BoundedOrderedState (P j) (Z j) (t j) B) let x := E.symm ((active, ⟨N, q⟩), z) have hx : x i = (active, ⟨N, q⟩) := congrArg Prod.fst (E.apply_symm_apply _) have hp : BoundedMemoryPermutationRelation (x i) (active, ⟨N, q ∘ τ⟩) := by rw [hx] exact ⟨τ, rfl⟩ have h := (product_memory_symmetric_iff_coordinate f).mp hf i x _ hp have he : Function.update x i (active, ⟨N, q ∘ τ⟩) = E.symm ((active, ⟨N, q ∘ τ⟩), z) := by rw [← finite_split_replace_eq_update] simp only [x, E, Equiv.apply_symm_apply] rw [he] at h exact h theorem product_memory_coordinate_pairing {G : Type*} [Fintype G] [dG : DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {t : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (i : G) (A R : (BoundedOrderedState (P i) (Z i) (t i) B → ℂ) → BoundedOrderedState (P i) (Z i) (t i) B → ℂ) (hpair : ∀ f g, BoundedOrderedSymmetric f → BoundedOrderedSymmetric g → (∑ x, (boundedOrderedStateWeight (μ i) (ν i) x : ℂ) * f x * A g x) = ∑ x, (boundedOrderedStateWeight (μ i) (ν i) x : ℂ) * R f x * g x) (f g : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) (hg : ProductMemorySymmetric g) : (∑ x, (productMemoryWeight μ ν x : ℂ) * f x * finiteCoordinateLift i A g x) = ∑ x, (productMemoryWeight μ ν x : ℂ) * finiteCoordinateLift i R f x * g x := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) change (∑ x, (finiteProductWeight (fun j => boundedOrderedStateWeight (μ j) (ν j)) x : ℂ) * f x * finiteCoordinateLift i A g x) = ∑ x, (finiteProductWeight (fun j => boundedOrderedStateWeight (μ j) (ν j)) x : ℂ) * finiteCoordinateLift i R f x * g x rw [finite_product_bilinear_split (fun j => boundedOrderedStateWeight (μ j) (ν j)) i, finite_product_bilinear_split (fun j => boundedOrderedStateWeight (μ j) (ν j)) i] apply sum_congr rfl intro z hz congr 1 simp only [finite_coordinate_lift_split] have hp := hpair _ _ (product_memory_pi_slice_symmetric i f hf z) (product_memory_pi_slice_symmetric i g hg z) refine Eq.trans ?_ (Eq.trans hp ?_) all_goals apply sum_congr · exact congrArg (fun inst : Fintype _ => @Finset.univ _ inst) (Subsingleton.elim _ _) · intro x hx; rfl theorem product_memory_compose_pairing_reverse {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {t : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (A R : ∀ i, (BoundedOrderedState (P i) (Z i) (t i) B → ℂ) → BoundedOrderedState (P i) (Z i) (t i) B → ℂ) (hA : ∀ i f, BoundedOrderedSymmetric f → BoundedOrderedSymmetric (A i f)) (hR : ∀ i f, BoundedOrderedSymmetric f → BoundedOrderedSymmetric (R i f)) (hpair : ∀ i f g, BoundedOrderedSymmetric f → BoundedOrderedSymmetric g → (∑ x, (boundedOrderedStateWeight (μ i) (ν i) x : ℂ) * f x * A i g x) = ∑ x, (boundedOrderedStateWeight (μ i) (ν i) x : ℂ) * R i f x * g x) (is : List G) (f g : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) (hg : ProductMemorySymmetric g) : (∑ x, (productMemoryWeight μ ν x : ℂ) * f x * finiteCoordinateCompose A is g x) = ∑ x, (productMemoryWeight μ ν x : ℂ) * finiteCoordinateCompose R is.reverse f x * g x := by induction is generalizing f with | nil => rfl | cons i is ih => change (∑ x, (productMemoryWeight μ ν x : ℂ) * f x * finiteCoordinateLift i (A i) (finiteCoordinateCompose A is g) x) = _ rw [product_memory_coordinate_pairing μ ν i (A i) (R i) (hpair i) f (finiteCoordinateCompose A is g) hf (product_memory_compose_symmetric A hA is g hg)] have hf' : ProductMemorySymmetric (finiteCoordinateLift i (R i) f) := product_memory_compose_symmetric R hR [i] f hf rw [ih _ hf'] simp only [List.reverse_cons, finite_coordinate_compose_append, finiteCoordinateCompose] /- Reversing a list of distinct independent local event actions does not alter its operator, including for signed event weights. -/ theorem finite_local_event_compose_reverse {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (E : ∀ i, X i → Type*) [∀ i x, Fintype (E i x)] (weight : ∀ i x, E i x → ℝ) (target : ∀ i x, E i x → X i) (is : List I) (his : is.Nodup) (f : (∀ i, X i) → ℂ) : finiteCoordinateCompose (finiteLocalEventAction E weight target) is.reverse f = finiteCoordinateCompose (finiteLocalEventAction E weight target) is f := by have hf : f = fun z => ∑ y : (∀ i, X i), f y * ∏ i, (if z i = y i then (1 : ℂ) else 0) := funext (finite_product_delta_expansion f) rw [hf] funext x simp only [finite_local_event_compose_sum, finite_local_event_compose_const_mul] apply sum_congr rfl intro y hy rw [finite_local_event_compose_prod E weight target is.reverse (List.nodup_reverse.mpr his) (fun i a => if a = y i then (1 : ℂ) else 0) x, finite_local_event_compose_prod E weight target is his (fun i a => if a = y i then (1 : ℂ) else 0) x] simp only [List.mem_reverse] end Bounty end section /- A fixed shared-coordinate and auxiliary fiber has the same coefficient on both sides of a bilinear transpose. Reassembly introduces no factor for the number of fibers or auxiliary choices. -/ open Finset Classical namespace Bounty end Bounty end section /- Exact prime products over a selected set of physical groups. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalPrimeGroups {G : Type*} [Fintype G] (P : G → Finset ℕ) (groups : Finset G) : Finset (PhysicalPrime P) := univ.filter (fun a => a.1 ∈ groups) section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} include G sharedInstance1 sharedInstance2 P theorem physical_prime_groups_prod (groups : Finset G) (f : PhysicalPrime P → ℝ) : (∏ a ∈ physicalPrimeGroups P groups, f a) = ∏ g ∈ groups, ∏ p : ↥(P g), f ⟨g, p⟩ := by classical simp only [physicalPrimeGroups, prod_filter] rw [Fintype.prod_sigma] calc _ = ∏ g, if g ∈ groups then ∏ p : ↥(P g), f ⟨g, p⟩ else 1 := by apply prod_congr rfl intro g hg by_cases h : g ∈ groups <;> simp [h] _ = _ := by rw [← prod_filter]; simp theorem physical_prime_groups_split (groups : Finset G) (f : PhysicalPrime P → ℝ) : (∏ a : PhysicalPrime P, f a) = (∏ a ∈ physicalPrimeGroups P groups, f a) * (∏ a ∈ physicalPrimeGroups P groupsᶜ, f a) := by classical rw [physical_prime_groups_prod, physical_prime_groups_prod, Fintype.prod_sigma] exact (prod_mul_prod_compl groups _).symm theorem physical_selected_group_run_weights {J ell : ℕ} (groups : Finset G) (V : G → ℝ) (L : ℕ → PhysicalMarkLists P J ell) (C : ℕ → G → Finset (Fin J)) (n : ℕ) (hnew : ∀ j < n, ∀ g ∈ groups, (physicalGroupMarks (L (j + 1)) g \ physicalGroupMarks (L j) g).card = ell + (C j g).card) : (∏ a ∈ physicalPrimeGroups P groups, (V a.1)⁻¹ ^ ghostPhaseRunCount (fun j => decide (a ∈ physicalMarkedPrimes (L j))) n) = ∏ g ∈ groups, (1 / V g) ^ ((J + ell) + ∑ j ∈ range n, (ell + (C j g).card)) := by classical rw [physical_prime_groups_prod] apply prod_congr rfl intro g hg simp only [physical_phase_run_count] rw [show (∏ p : ↥(P g), (V g)⁻¹ ^ activeRunCount (fun j => physicalGroupMarks (L j) g) n p.val) = ∏ p ∈ P g, (V g)⁻¹ ^ activeRunCount (fun j => physicalGroupMarks (L j) g) n p from prod_coe_sort (P g) (fun p => (V g)⁻¹ ^ activeRunCount (fun j => physicalGroupMarks (L j) g) n p)] simp only [← one_div] rw [prod_pow_eq_pow_sum, physical_group_run_count L C n g (fun j hj => hnew j hj g hg)] end end Bounty end section /- Exact group restrictions of the original marks, auxiliary draws, and permutations. -/ open scoped Classical namespace Bounty section Groups variable {G : Type*} (small : G → Prop) (P : G → Finset ℕ) (J ell : ℕ) noncomputable def physicalMarkGroupSplit : PhysicalMarkLists P J ell ≃ PhysicalMarkLists (fun g : {g // small g} => P g.val) J ell × PhysicalMarkLists (fun g : {g // ¬small g} => P g.val) J ell := Equiv.piEquivPiSubtypeProd small (fun g => PhysicalSlots J ell ↪ ↥(P g)) noncomputable def physicalAuxGroupSplit (C : G → Finset (Fin J)) : PhysicalAuxLabels P C ≃ PhysicalAuxLabels (fun g : {g // small g} => P g.val) (fun g => C g.val) × PhysicalAuxLabels (fun g : {g // ¬small g} => P g.val) (fun g => C g.val) := Equiv.piEquivPiSubtypeProd small (fun g => ↥(C g) → ↥(P g)) noncomputable def physicalPermutationGroupSplit : PhysicalPermutations G J ell ≃ PhysicalPermutations {g // small g} J ell × PhysicalPermutations {g // ¬small g} J ell := Equiv.piEquivPiSubtypeProd small (fun _ => Equiv.Perm (PhysicalSlots J ell)) theorem physical_mark_group_merge_restrict (L : PhysicalMarkLists P J ell) : (physicalMarkGroupSplit small P J ell).symm ((fun g => L g.val), (fun g => L g.val)) = L := (physicalMarkGroupSplit small P J ell).symm_apply_apply L theorem physical_aux_group_merge_restrict (C : G → Finset (Fin J)) (a : PhysicalAuxLabels P C) : (physicalAuxGroupSplit small P J C).symm ((fun g => a g.val), (fun g => a g.val)) = a := (physicalAuxGroupSplit small P J C).symm_apply_apply a theorem physical_permute_group_restrict (σ : PhysicalPermutations G J ell) (L : PhysicalMarkLists P J ell) : (fun g : {g // small g} => physicalPermuteLabels σ L g.val) = physicalPermuteLabels (fun g : {g // small g} => σ g.val) (fun g => L g.val) := rfl end Groups section Cardinal variable {G : Type*} [Fintype G] (small : G → Prop) (J ell : ℕ) theorem physical_permutation_group_card : Fintype.card (PhysicalPermutations G J ell) = Fintype.card (PhysicalPermutations {g // small g} J ell) * Fintype.card (PhysicalPermutations {g // ¬small g} J ell) := by rw [Fintype.card_congr (physicalPermutationGroupSplit small J ell), Fintype.card_prod] theorem physical_permutation_group_normalization : (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ = ((Fintype.card (PhysicalPermutations {g // small g} J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations {g // small g} J ell) : ℂ)⁻¹) * ((Fintype.card (PhysicalPermutations {g // ¬small g} J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations {g // ¬small g} J ell) : ℂ)⁻¹) := by rw [physical_permutation_group_card small J ell, Nat.cast_mul, mul_inv_rev] ring end Cardinal end Bounty end section /- Reindex the same physical groups, without changing labels, slots or auxiliary draws. -/ namespace Bounty section Reindex variable {G H : Type*} (e : G ≃ H) (P : G → Finset ℕ) (J ell : ℕ) def physicalMarkGroupReindex : PhysicalMarkLists P J ell ≃ PhysicalMarkLists (fun h => P (e.symm h)) J ell := Equiv.piCongrLeft' (fun g => PhysicalSlots J ell ↪ ↥(P g)) e def physicalAuxGroupReindex (C : G → Finset (Fin J)) : PhysicalAuxLabels P C ≃ PhysicalAuxLabels (fun h => P (e.symm h)) (fun h => C (e.symm h)) := Equiv.piCongrLeft' (fun g => ↥(C g) → ↥(P g)) e def physicalPermutationGroupReindex : PhysicalPermutations G J ell ≃ PhysicalPermutations H J ell := Equiv.piCongrLeft' (fun _ => Equiv.Perm (PhysicalSlots J ell)) e theorem physical_permute_group_reindex (σ : PhysicalPermutations G J ell) (L : PhysicalMarkLists P J ell) : physicalMarkGroupReindex e P J ell (physicalPermuteLabels σ L) = physicalPermuteLabels (physicalPermutationGroupReindex e J ell σ) (physicalMarkGroupReindex e P J ell L) := rfl end Reindex end Bounty end section /- Port from PrimeNumberTheoremAnd/Auxiliary.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ namespace Complex end Complex lemma DifferentiableAt.comp_ofReal {e : ℂ → ℂ} {z : ℝ} (hf : DifferentiableAt ℂ e z) : DifferentiableAt ℝ (fun x : ℝ ↦ e x) z := hf.hasDerivAt.comp_ofReal.differentiableAt lemma deriv.comp_ofReal {e : ℂ → ℂ} {z : ℝ} (hf : DifferentiableAt ℂ e z) : deriv (fun x : ℝ ↦ e x) z = deriv e z := hf.hasDerivAt.comp_ofReal.deriv lemma Differentiable.comp_ofReal {e : ℂ → ℂ} (h : Differentiable ℂ e) : Differentiable ℝ (fun x : ℝ ↦ e x) := fun _ ↦ h.differentiableAt.comp_ofReal lemma DifferentiableAt.ofReal_comp {z : ℝ} {f : ℝ → ℝ} (hf : DifferentiableAt ℝ f z) : DifferentiableAt ℝ (fun (y : ℝ) ↦ (f y : ℂ)) z := hf.hasDerivAt.ofReal_comp.differentiableAt lemma Differentiable.ofReal_comp {f : ℝ → ℝ} (hf : Differentiable ℝ f) : Differentiable ℝ (fun (y : ℝ) ↦ (f y : ℂ)) := fun _ ↦ hf.differentiableAt.ofReal_comp open Complex ContinuousLinearMap in lemma HasDerivAt.of_hasDerivAt_ofReal_comp {z : ℝ} {f : ℝ → ℝ} {u : ℂ} (hf : HasDerivAt (fun y ↦ (f y : ℂ)) u z) : ∃ u' : ℝ, u = u' ∧ HasDerivAt f u' z := by lift u to ℝ · have H := (imCLM.hasFDerivAt.comp z hf.hasFDerivAt).hasDerivAt.deriv simp only [Function.comp_def, imCLM_apply, ofReal_im, deriv_const] at H rwa [eq_comm, comp_apply, imCLM_apply, toSpanSingleton_apply_one] at H refine ⟨u, rfl, ?_⟩ convert! (reCLM.hasFDerivAt.comp z hf.hasFDerivAt).hasDerivAt rw [comp_apply, toSpanSingleton_apply_one, reCLM_apply, ofReal_re] lemma DifferentiableAt.ofReal_comp_iff {z : ℝ} {f : ℝ → ℝ} : DifferentiableAt ℝ (fun (y : ℝ) ↦ (f y : ℂ)) z ↔ DifferentiableAt ℝ f z := by refine ⟨fun H ↦ ?_, ofReal_comp⟩ obtain ⟨u, _, hu₂⟩ := H.hasDerivAt.of_hasDerivAt_ofReal_comp exact HasDerivAt.differentiableAt hu₂ lemma Differentiable.ofReal_comp_iff {f : ℝ → ℝ} : Differentiable ℝ (fun (y : ℝ) ↦ (f y : ℂ)) ↔ Differentiable ℝ f := forall_congr' fun _ ↦ DifferentiableAt.ofReal_comp_iff lemma deriv.ofReal_comp {z : ℝ} {f : ℝ → ℝ} : deriv (fun (y : ℝ) ↦ (f y : ℂ)) z = deriv f z := by by_cases hf : DifferentiableAt ℝ f z · exact hf.hasDerivAt.ofReal_comp.deriv · have hf' := mt DifferentiableAt.ofReal_comp_iff.mp hf rw [deriv_zero_of_not_differentiableAt hf, deriv_zero_of_not_differentiableAt hf', Complex.ofReal_zero] end section /- Port from PrimeNumberTheoremAnd/Mathlib/Analysis/SpecialFunctions/Log/Basic.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ open Filter Real end section /- Port from PrimeNumberTheoremAnd/Mathlib/Algebra/Notation/Support.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ namespace Function variable {α : Type*} [Zero α] end Function end section /- Port from PrimeNumberTheoremAnd/ZetaConj.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ open scoped Complex ComplexConjugate end section /- Port from PrimeNumberTheoremAnd/Rectangle.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ open Complex Set Topology open scoped Interval variable {z w : ℂ} {c : ℝ} namespace Rectangle lemma symm : Rectangle z w = Rectangle w z := by simp [Rectangle, uIcc_comm] end Rectangle def RectangleBorder (z w : ℂ) : Set ℂ := [[z.re, w.re]] ×ℂ {z.im} ∪ {z.re} ×ℂ [[z.im, w.im]] ∪ [[z.re, w.re]] ×ℂ {w.im} ∪ {w.re} ×ℂ [[z.im, w.im]] lemma rectangleBorder_disjoint_singleton {z w p : ℂ} (h : p.re ≠ z.re ∧ p.re ≠ w.re ∧ p.im ≠ z.im ∧ p.im ≠ w.im) : Disjoint (RectangleBorder z w) {p} := by refine disjoint_singleton_right.mpr ?_ simp_rw [RectangleBorder, Set.mem_union, not_or] exact ⟨⟨⟨fun hc ↦ h.2.2.1 hc.2, fun hc ↦ h.1 hc.1⟩, fun hc ↦ h.2.2.2 hc.2⟩, fun hc ↦ h.2.1 hc.1⟩ end section /- Port from PrimeNumberTheoremAnd/EulerMaclaurin.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ open Finset Interval MeasureTheory variable {𝕜 : Type*} [RCLike 𝕜] {f : ℝ → 𝕜} {a b : ℝ} noncomputable def B1 (x : ℝ) : ℝ := x - ⌊x⌋₊ - 1 / 2 lemma aestronglyMeasurable_B1 : AEStronglyMeasurable B1 := by unfold B1 fun_prop lemma abs_B1_le_half {x : ℝ} (hx : 0 ≤ x) : |B1 x| ≤ 1 / 2 := by unfold B1 refine abs_le.mpr ⟨?_, ?_⟩ · grind [Nat.floor_le hx] · grind [Nat.lt_succ_floor x] lemma integral_deriv_mul_add_const (c : 𝕜) (hab : a ≤ b) (h_int : IntervalIntegrable (deriv f) volume a b) (hf_diff : ∀ t ∈ Set.Icc a b, DifferentiableAt ℝ f t) : ∫ t in a..b, (t + c) * deriv f t = (b + c) * f b - (a + c) * f a - ∫ t in a..b, f t := by rw [← Set.uIcc_of_le hab] at hf_diff have : ∀ t ∈ [[a, b]], HasDerivAt (fun (t : ℝ) ↦ t + c) 1 t := by intro t ht simp only [hasDerivAt_add_const_iff] convert! ContinuousLinearMap.hasDerivAt (RCLike.ofRealCLM (K := 𝕜)) using 1 simp replace hf_diff := fun t ht ↦ (hf_diff t ht).hasDerivAt rw [intervalIntegral.integral_mul_deriv_eq_deriv_mul this hf_diff (by simp) h_int] simp lemma intervalIntegrable_deriv_mul_B1 (ha : 0 ≤ a) (hab : a ≤ b) (h_cont : ContinuousOn (deriv f) [[a, b]]) : IntervalIntegrable (fun t ↦ deriv f t * B1 t) volume a b := by refine IntervalIntegrable.continuousOn_mul ?_ h_cont rw [intervalIntegrable_iff'] apply MeasureTheory.Measure.integrableOn_of_bounded (by simp) (by exact (RCLike.ofRealCLM (K := 𝕜)).continuous.comp_aestronglyMeasurable aestronglyMeasurable_B1) (M := 1 / 2) filter_upwards [self_mem_ae_restrict (by measurability)] with x hx rw [Set.uIcc_of_le hab, Set.mem_Icc] at hx norm_cast exact abs_B1_le_half (by linarith) lemma integral_deriv_mul_floor_add_one (ha : 0 ≤ a) (hab : a ≤ b) (hf_diff : ∀ t ∈ Set.Icc a b, DifferentiableAt ℝ f t) (h_cont : ContinuousOn (deriv f) [[a, b]]) : ∫ t in a..b, deriv f t * (⌊t⌋₊ + 1) = (b + 1 / 2) * f b - (a + 1 / 2) * f a - (∫ t in a..b, f t) - ∫ t in a..b, deriv f t * B1 t := by calc _ = ∫ t in a..b, (deriv f t * (t + 1 / 2) -deriv f t * B1 t) := by congr ext simp only [B1] push_cast ring _ = (∫ t in a..b, deriv f t * (t + 1 / 2)) - ∫ t in a..b, deriv f t * B1 t := by exact intervalIntegral.integral_sub (ContinuousOn.intervalIntegrable (by fun_prop)) (intervalIntegrable_deriv_mul_B1 ha hab h_cont) _ = _ := by conv => lhs; arg 1; arg 1; ext; rw [mul_comm] rw [integral_deriv_mul_add_const _ hab h_cont.intervalIntegrable hf_diff] theorem sum_eq_integral_add_integral_deriv (ha : 0 ≤ a) (hab : a ≤ b) (hf_diff : ∀ t ∈ Set.Icc a b, DifferentiableAt ℝ f t) (h_cont : ContinuousOn (deriv f) [[a, b]]) : ∑ k ∈ Ioc ⌊a⌋₊ ⌊b⌋₊, f k = f a * B1 a - f b * B1 b + (∫ t in a..b, f t) + ∫ t in a..b, deriv f t * B1 t := by have := sum_mul_eq_sub_sub_integral_mul (fun _ ↦ 1) ha hab hf_diff (Set.uIcc_of_le hab ▸ h_cont).integrableOn_Icc simp only [mul_one, sum_const, Nat.card_Icc, tsub_zero, nsmul_eq_mul, Nat.cast_add, Nat.cast_one] at this rw [this, ← intervalIntegral.integral_of_le hab] rw [integral_deriv_mul_floor_add_one ha hab hf_diff h_cont] unfold B1 push_cast ring end section /- A stretched exponential in log x is smaller than every inverse log power. -/ open Filter Asymptotics namespace Bounty end Bounty end section /- Exact ordered-prime product fibers, and factorial normalization with or without repetitions. -/ open Finset namespace Bounty end Bounty end section /- Finite-depth Buchstab densities and their stable integral recursion. -/ open Filter open scoped Topology namespace Bounty noncomputable def buchstabDepthDensity : ℕ → ℝ → ℝ → ℝ | 0, _, w => 1/w | n+1, γ, w => 1/w + ∫ α in γ..max γ (w/2), buchstabDepthDensity n α (w-α)/α theorem buchstab_depth_density_step_eq {γ w : ℝ} (hγ : 0 < γ) (n : ℕ) (hw : w ≤ ((n : ℝ)+2)*γ) : buchstabDepthDensity (n+1) γ w = buchstabDepthDensity n γ w := by induction n generalizing γ w with | zero => have hhalf : w/2 ≤ γ := by norm_num at hw; linarith simp only [buchstabDepthDensity, max_eq_left hhalf, intervalIntegral.integral_same, add_zero] | succ n ih => by_cases hhalf : w/2 ≤ γ · simp only [buchstabDepthDensity, max_eq_left hhalf, intervalIntegral.integral_same, add_zero] · have hhalf' : γ ≤ w/2 := le_of_lt (lt_of_not_ge hhalf) simp only [buchstabDepthDensity, max_eq_right hhalf'] congr 1 apply intervalIntegral.integral_congr intro α hα have hαg : γ ≤ α := (Set.mem_Icc.mp (by simpa only [Set.uIcc_of_le hhalf'] using hα)).1 have hα0 : 0 < α := hγ.trans_le hαg have hwa : w-α ≤ ((n : ℝ)+2)*α := by have hm := mul_le_mul_of_nonneg_left hαg (show 0 ≤ (n : ℝ)+3 by positivity) push_cast at hw nlinarith change buchstabDepthDensity (n+1) α (w-α)/α = buchstabDepthDensity n α (w-α)/α rw [ih hα0 hwa] theorem buchstab_depth_density_add_eq {γ w : ℝ} (hγ : 0 < γ) (n k : ℕ) (hw : w ≤ ((n : ℝ)+2)*γ) : buchstabDepthDensity (n+k) γ w = buchstabDepthDensity n γ w := by induction k with | zero => simp only [Nat.add_zero] | succ k ih => rw [Nat.add_succ, buchstab_depth_density_step_eq hγ (n+k), ih] push_cast nlinarith theorem buchstab_depth_density_stable {γ w : ℝ} (hγ : 0 < γ) (m n : ℕ) (hm : w ≤ ((m : ℝ)+2)*γ) (hn : w ≤ ((n : ℝ)+2)*γ) : buchstabDepthDensity m γ w = buchstabDepthDensity n γ w := by by_cases hmn : m ≤ n · obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le hmn exact (buchstab_depth_density_add_eq hγ m k hm).symm · obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le (Nat.le_of_not_ge hmn) exact buchstab_depth_density_add_eq hγ n k hn noncomputable def buchstabDensity (γ w : ℝ) : ℝ := buchstabDepthDensity ⌊w/γ⌋₊ γ w theorem buchstab_density_depth_bound {γ w : ℝ} (hγ : 0 < γ) : w ≤ ((⌊w/γ⌋₊ : ℝ)+2)*γ := by have hf := Nat.lt_floor_add_one (w/γ) have hh := (div_lt_iff₀ hγ).mp hf nlinarith theorem buchstab_depth_density_eq_density {γ w : ℝ} (hγ : 0 < γ) (n : ℕ) (hw : w ≤ ((n : ℝ)+2)*γ) : buchstabDepthDensity n γ w = buchstabDensity γ w := buchstab_depth_density_stable hγ n ⌊w/γ⌋₊ hw (buchstab_density_depth_bound hγ) theorem buchstab_density_integral_recursion {γ w : ℝ} (hγ : 0 < γ) : buchstabDensity γ w = 1/w + ∫ α in γ..max γ (w/2), buchstabDensity α (w-α)/α := by let n := ⌊w/γ⌋₊ have hw : w ≤ ((n : ℝ)+2)*γ := buchstab_density_depth_bound hγ have hs := buchstab_depth_density_step_eq hγ n hw change buchstabDepthDensity n γ w = _ rw [← hs, buchstabDepthDensity] congr 1 by_cases hhalf : w/2 ≤ γ · simp only [max_eq_left hhalf, intervalIntegral.integral_same] · have hhalf' : γ ≤ w/2 := le_of_lt (lt_of_not_ge hhalf) rw [max_eq_right hhalf'] apply intervalIntegral.integral_congr intro α hα have hαg : γ ≤ α := (Set.mem_Icc.mp (by simpa only [Set.uIcc_of_le hhalf'] using hα)).1 have hα0 : 0 < α := hγ.trans_le hαg have hwa : w-α ≤ ((n : ℝ)+2)*α := by have hm := mul_le_mul_of_nonneg_left hαg (show 0 ≤ (n : ℝ)+2 by positivity) linarith change buchstabDepthDensity n α (w-α)/α = buchstabDensity α (w-α)/α rw [buchstab_depth_density_eq_density hα0 n hwa] theorem buchstab_density_integral_identity {b : ℝ} (hb : 0 < b) (hbhalf : b ≤ 1/2) : (∫ α in b..(1/2 : ℝ), buchstabDensity α (1-α)/α) = buchstabDensity b 1-1 := by have h := buchstab_density_integral_recursion (w := 1) hb rw [max_eq_right hbhalf] at h norm_num at h linarith end Bounty end section /- Actual candidate omission counts suppress every fixed polynomial cost at the manuscript cap ceil(L^2), after choosing J once and before L grows. -/ open Finset Filter open scoped Topology namespace Bounty theorem binomial_omission_power_lower (J ell n : ℕ) (c L : ℝ) (hL : 0 < L) (hn : c * Real.log L ≤ (n : ℝ)) : L ^ (c * Real.log (((J + ell).choose ell : ℕ) : ℝ)) ≤ (((J + ell).choose ell : ℕ) : ℝ) ^ n := by have hq : 0 < (J + ell).choose ell := Nat.choose_pos (by omega) have hqR : 0 < (((J + ell).choose ell : ℕ) : ℝ) := by exact_mod_cast hq have hq1 : 1 ≤ (((J + ell).choose ell : ℕ) : ℝ) := by exact_mod_cast hq calc _ = (((J + ell).choose ell : ℕ) : ℝ) ^ (c * Real.log L) := by rw [Real.rpow_def_of_pos hL, Real.rpow_def_of_pos hqR] congr 1 ring _ ≤ (((J + ell).choose ell : ℕ) : ℝ) ^ (n : ℝ) := Real.rpow_le_rpow_of_exponent_le hq1 hn _ = _ := Real.rpow_natCast _ _ theorem ceil_square_omission_sqrt_le (J ell n : ℕ) (c L : ℝ) (hL : 1 ≤ L) (hn : c * Real.log L ≤ (n : ℝ)) : Real.sqrt ((⌈L ^ 2⌉₊ : ℝ) / (((J + ell).choose ell) ^ n : ℕ)) ≤ 2 * L ^ (1 - (c / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ)) := by have hL0 : 0 < L := by linarith have hB : (⌈L ^ 2⌉₊ : ℝ) ≤ 4 * L ^ 2 := by have hceil := Nat.ceil_lt_add_one (sq_nonneg L) nlinarith have hden := binomial_omission_power_lower J ell n c L hL0 hn have hq : 0 < (((J + ell).choose ell : ℕ) : ℝ) := by exact_mod_cast (Nat.choose_pos (show ell ≤ J + ell by omega)) have hsquare : (2 * L ^ (1 - (c / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ))) ^ 2 = 4 * L ^ 2 / L ^ (c * Real.log (((J + ell).choose ell : ℕ) : ℝ)) := by calc _ = 4 * (L ^ (1 - (c / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ)) * L ^ (1 - (c / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ))) := by ring _ = 4 * L ^ ((2 : ℝ) - c * Real.log (((J + ell).choose ell : ℕ) : ℝ)) := by rw [← Real.rpow_add hL0] congr 1 congr 1 ring _ = _ := by rw [Real.rpow_sub hL0, Real.rpow_two]; ring apply Real.sqrt_le_iff.mpr refine ⟨by positivity, ?_⟩ rw [hsquare, Nat.cast_pow] calc _ ≤ (4 * L ^ 2) / ((((J + ell).choose ell : ℕ) : ℝ) ^ n) := div_le_div_of_nonneg_right hB (pow_nonneg hq.le _) _ ≤ _ := div_le_div_of_nonneg_left (by positivity) (Real.rpow_pos_of_pos hL0 _) hden theorem four_mul_rpow_le_half_of_gap (a b L : ℝ) (hgap : a + 2 ≤ b) (hL : 4 ≤ L) : 4 * L ^ a ≤ (1 / 2 : ℝ) * L ^ b := by have hL0 : 0 < L := by linarith have hcoeff : (4 : ℝ) ≤ L ^ 2 / 2 := by nlinarith calc _ ≤ (L ^ 2 / 2) * L ^ a := mul_le_mul_of_nonneg_right hcoeff (Real.rpow_nonneg hL0.le _) _ = (1 / 2 : ℝ) * L ^ (a + 2) := by rw [Real.rpow_add hL0, Real.rpow_two] ring _ ≤ _ := mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le (by linarith) hgap) (by norm_num) theorem eventually_candidate_rare_transfer_decay {s : ℝ} (hs : 0 < s) (ell : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (J : ℕ) (A E : ℝ), ((1 / (20 * Real.log 2)) / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ) > A + E + 3 → 2 * L ^ A * Real.sqrt ((⌈L ^ 2⌉₊ : ℝ) / (((J + ell).choose ell) ^ (candidateSmallPIndices s L).card : ℕ)) ≤ (1 / 2 : ℝ) * L ^ (-E) := by obtain ⟨v, V, _, _, hpool⟩ := exists_candidate_P_pool_bounds hs filter_upwards [hpool, eventually_ge_atTop (4 : ℝ)] with L hp hL intro J A E hgain have hL0 : 0 < L := by linarith have hr := ceil_square_omission_sqrt_le J ell (candidateSmallPIndices s L).card (1 / (20 * Real.log 2)) L (by linarith) hp.2.1 calc _ ≤ 2 * L ^ A * (2 * L ^ (1 - ((1 / (20 * Real.log 2)) / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ))) := mul_le_mul_of_nonneg_left hr (by positivity) _ = 4 * L ^ (A + 1 - ((1 / (20 * Real.log 2)) / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ)) := by rw [show A + 1 - ((1 / (20 * Real.log 2)) / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ) = A + (1 - ((1 / (20 * Real.log 2)) / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ)) by ring, Real.rpow_add hL0] ring _ ≤ _ := four_mul_rpow_le_half_of_gap _ _ L (by linarith) hL theorem exists_candidate_rare_transfer_parameter {s : ℝ} (hs : 0 < s) (ell : ℕ) (hell : 0 < ell) (J₀ : ℕ) (A E : ℝ) : ∃ J : ℕ, J₀ ≤ J ∧ ((1 / (20 * Real.log 2)) / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ) > A + E + 3 ∧ ∀ᶠ L : ℝ in atTop, 2 * L ^ A * Real.sqrt ((⌈L ^ 2⌉₊ : ℝ) / (((J + ell).choose ell) ^ (candidateSmallPIndices s L).card : ℕ)) ≤ (1 / 2 : ℝ) * L ^ (-E) := by have hc : 0 < (1 / (20 * Real.log 2) : ℝ) / 2 := by have hlog : 0 < Real.log (2 : ℝ) := Real.log_pos (by norm_num) positivity obtain ⟨J, hJ, hlog⟩ := exists_log_choose_add_gt_ge ell hell ((A + E + 3) / ((1 / (20 * Real.log 2)) / 2)) J₀ have hgain : ((1 / (20 * Real.log 2)) / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ) > A + E + 3 := by simpa only [mul_comm] using (div_lt_iff₀ hc).mp hlog refine ⟨J, hJ, hgain, ?_⟩ filter_upwards [eventually_candidate_rare_transfer_decay hs ell] with L hL exact hL J A E hgain end Bounty end section /- Forest compatibility split by original owners, using exact optional prime-label presence. -/ open Finset Classical namespace Bounty def birthForestStageCondition {N L : ℕ} {α : Type*} (owner : Fin N → Fin L) (u : Fin L) (values : Fin N → Option α) (code : BirthForestCode N) : Prop := ∀ i, owner i = u → match code i with | none => True | some p => (values (birthForestParentEmbedding i p)).isSome = true ∧ (values i).isSome = true ∧ values (birthForestParentEmbedding i p) = values i theorem birth_forest_compatible_iff_stages {N L : ℕ} {α : Type*} (owner : Fin N → Fin L) (values : Fin N → Option α) (code : BirthForestCode N) : birthForestCompatible (fun i => (values i).isSome = true) values code ↔ ∀ u, birthForestStageCondition owner u values code := by constructor · intro h u i _ exact h i · intro h i exact h (owner i) i rfl theorem birth_forest_stage_congr {N L : ℕ} {α : Type*} (owner : Fin N → Fin L) (hmono : Monotone owner) (u : Fin L) (values other : Fin N → Option α) (code : BirthForestCode N) (hvalues : ∀ i, owner i ≤ u → values i = other i) : birthForestStageCondition owner u values code ↔ birthForestStageCondition owner u other code := by have hi : ∀ i (_hu : owner i = u), (match code i with | none => True | some p => (values (birthForestParentEmbedding i p)).isSome = true ∧ (values i).isSome = true ∧ values (birthForestParentEmbedding i p) = values i) ↔ (match code i with | none => True | some p => (other (birthForestParentEmbedding i p)).isSome = true ∧ (other i).isSome = true ∧ other (birthForestParentEmbedding i p) = other i) := by intro i hu cases hc : code i with | none => exact Iff.rfl | some p => have hp : owner (birthForestParentEmbedding i p) ≤ u := (hmono (show birthForestParentEmbedding i p ≤ i from Nat.le_of_lt p.isLt)).trans hu.le dsimp only rw [hvalues i hu.le, hvalues _ hp] constructor <;> intro h i hu · exact (hi i hu).mp (h i hu) · exact (hi i hu).mpr (h i hu) theorem prod_condition_indicators {I : Type*} [Fintype I] (C : I → Prop) [DecidablePred C] : (∏ i, if C i then (1 : ℝ) else 0) = if ∀ i, C i then 1 else 0 := by by_cases h : ∀ i, C i · simp only [if_pos h, if_pos (h _), prod_const_one] · rw [if_neg h] obtain ⟨i, hi⟩ := not_forall.mp h exact prod_eq_zero (mem_univ i) (if_neg hi) end Bounty end section /- Converting ordinary theta increments to prime counts in finite intervals. -/ open Finset namespace Bounty theorem ordinary_prime_band_log_sum {A B : ℝ} (hAB : A ≤ B) : (∑ p ∈ primeBand A B, Real.log (p : ℝ)) = Chebyshev.theta B - Chebyshev.theta A := by have hfloor := Nat.floor_le_floor hAB have hset : Ioc ⌊A⌋₊ ⌊B⌋₊ = Ico (⌊A⌋₊ + 1) (⌊B⌋₊ + 1) := by ext n simp only [mem_Ioc, mem_Ico] omega have hsum := sum_Ico_eq_sub (fun n : ℕ => if n.Prime then Real.log (n : ℝ) else 0) (Nat.add_le_add_right hfloor 1) rw [← hset] at hsum simpa only [primeBand, Chebyshev.theta_eq_sum_Icc, sum_filter, Nat.range_succ_eq_Icc_zero] using hsum theorem ordinary_prime_band_card_log_bounds {A B : ℝ} (hA : 1 < A) (hAB : A ≤ B) : (primeBand A B).card * Real.log A ≤ Chebyshev.theta B - Chebyshev.theta A ∧ Chebyshev.theta B - Chebyshev.theta A ≤ (primeBand A B).card * Real.log B := by rw [← ordinary_prime_band_log_sum hAB] constructor · calc _ = ∑ p ∈ primeBand A B, Real.log A := by simp _ ≤ _ := sum_le_sum fun p hp => by have hm := (mem_primeBand_iff (by linarith) (by linarith) p).mp hp exact Real.log_le_log (by linarith) hm.2.1.le · calc _ ≤ ∑ p ∈ primeBand A B, Real.log B := sum_le_sum fun p hp => by have hm := (mem_primeBand_iff (by linarith) (by linarith) p).mp hp exact Real.log_le_log (by linarith) hm.2.2 _ = _ := by simp theorem ordinary_prime_band_relative_error {A B ε : ℝ} (hA : 1 < A) (hAB : A ≤ B) (hε : 0 ≤ ε) (hθ : |(Chebyshev.theta B - Chebyshev.theta A) - (B-A)| ≤ ε*(B-A)) (hlog : Real.log B ≤ (1+ε)*Real.log A) : |(primeBand A B).card - (B-A)/Real.log A| ≤ 2*ε*((B-A)/Real.log A) := by have hL : 0 < Real.log A := Real.log_pos hA have hH : 0 ≤ B-A := sub_nonneg.mpr hAB have hN : (0 : ℝ) ≤ (primeBand A B).card := Nat.cast_nonneg _ have hb := ordinary_prime_band_card_log_bounds hA hAB have he := abs_le.mp hθ have hupper : (primeBand A B).card * Real.log A ≤ (1+ε)*(B-A) := by linarith have hfactor : (1-ε)*(B-A) ≤ (1+ε)*((primeBand A B).card * Real.log A) := by have hh := mul_le_mul_of_nonneg_left hlog hN nlinarith have hden : 0 < 1+ε := by linarith have hlo : (1-2*ε)*(B-A) ≤ (primeBand A B).card * Real.log A := by calc _ ≤ (1-ε)*(B-A)/(1+ε) := (le_div_iff₀ hden).mpr (by nlinarith [mul_nonneg (sq_nonneg ε) hH]) _ ≤ _ := (div_le_iff₀ hden).mpr (by nlinarith [hfactor]) have hlo' : (1-2*ε)*((B-A)/Real.log A) ≤ (primeBand A B).card := by rw [← mul_div_assoc] exact (div_le_iff₀ hL).mpr hlo have hup' : (primeBand A B).card ≤ (1+ε)*((B-A)/Real.log A) := by rw [← mul_div_assoc] exact (le_div_iff₀ hL).mpr hupper have hM : 0 ≤ (B-A)/Real.log A := div_nonneg hH hL.le apply abs_le.mpr constructor <;> nlinarith [mul_nonneg hε hM] end Bounty end section open Finset namespace Bounty theorem separated_odd_prime_sieve_remainders_le (P Q : Finset ℕ) (D : ℝ) (N : ℕ) (r : ℕ → ℝ) (hP : ∀ p ∈ P, p.Prime) (hQ : ∀ p ∈ Q, p.Prime) (hPodd : ∀ p ∈ P, p ≠ 2) (hQodd : ∀ p ∈ Q, p ≠ 2) (hout : ∀ p ∈ Q, p ∉ P) (hlevel : ∀ p ∈ Q, ∀ d ∈ blockSieveModuli P D, p * d ≤ N) : (∑ p ∈ Q, ∑ d ∈ blockSieveModuli P D, |r (p * d)|) ≤ ∑ m ∈ oddSquarefreeModuli N, |r m| := by classical let f : ℕ × ℕ → ℕ := fun x => x.1 * x.2 have hsubset : (Q ×ˢ blockSieveModuli P D).image f ⊆ oddSquarefreeModuli N := by intro m hm obtain ⟨⟨p, d⟩, hpd, rfl⟩ := mem_image.mp hm obtain ⟨hp, hd⟩ := mem_product.mp hpd have hdprop := block_sieve_modulus_properties P hP D hd apply mem_filter.mpr refine ⟨mem_Icc.mpr ⟨Nat.mul_pos (hQ p hp).pos hdprop.1, hlevel p hp d hd⟩, ?_⟩ refine ⟨Nat.squarefree_mul_iff.mpr ⟨external_prime_coprime_sieve_modulus P hP (hQ p hp) (hout p hp) hd, (hQ p hp).squarefree, hdprop.2.2.1⟩, ?_⟩ have hprod : Odd (∏ q ∈ P, q) := by apply prod_induction (fun q : ℕ => q) Odd · intro a b ha hb exact ha.mul hb · decide · intro q hq exact (hP q hq).odd_of_ne_two (hPodd q hq) exact ((hQ p hp).odd_of_ne_two (hQodd p hp)).mul (hprod.of_dvd_nat hdprop.2.2.2) calc _ = ∑ x ∈ Q ×ˢ blockSieveModuli P D, |r (f x)| := (sum_product _ _ _).symm _ = ∑ m ∈ (Q ×ˢ blockSieveModuli P D).image f, |r m| := (sum_image (f := fun m => |r m|) (separated_prime_sieve_product_injective P Q D hP hQ hout)).symm _ ≤ _ := sum_le_sum_of_subset_of_nonneg hsubset (fun m _ _ => abs_nonneg (r m)) theorem exists_summed_external_odd_prime_shifted_sieve : ∃ K : ℝ, 0 < K ∧ ∀ (P Q T : Finset ℕ) (μ : ℕ → ℝ) (N : ℕ) {z : ℝ} {h : ℕ}, 1 < z → 1 ≤ h → Even h → (∀ q ∈ P, q.Prime) → (∀ q ∈ P, q ≠ 2) → (∀ q ∈ P, (q : ℝ) ≤ z) → (∀ p ∈ Q, p.Prime) → (∀ p ∈ Q, p ≠ 2) → (∀ p ∈ Q, p ∉ P) → (∀ u ∈ T, 0 ≤ μ u) → (∀ p ∈ Q, ∀ d ∈ blockSieveModuli P (z^(4 * (h : ℝ) + 2)), p*d ≤ N) → |(∑ p ∈ Q, ∑ u ∈ T.filter (fun u => p ∣ 2*u + 1 ∧ ∀ q ∈ P, ¬q ∣ 2*u + 1), μ u) - (∑ u ∈ T, μ u) * (∏ q ∈ P, (1 - 1 / ((q : ℝ) - 1))) * (∑ p ∈ Q, 1 / ((p : ℝ) - 1))| ≤ (∑ u ∈ T, μ u) * (∏ q ∈ P, (1 - 1 / ((q : ℝ) - 1))) * (∑ p ∈ Q, 1 / ((p : ℝ) - 1)) * K * Real.exp (-(h : ℝ)) + ∑ m ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder T μ m| := by obtain ⟨K, hK, hsieve⟩ := exists_fixed_prime_shifted_sieve refine ⟨K, hK, ?_⟩ intro P Q T μ N z h hz hh heven hP hodd hPz hQ hQodd hout hμ hlevel let X : ℝ := ∑ u ∈ T, μ u let A : ℝ := ∏ q ∈ P, (1 - 1 / ((q : ℝ) - 1)) let H : ℝ := ∑ p ∈ Q, 1 / ((p : ℝ) - 1) let D : ℝ := z^(4 * (h : ℝ) + 2) let r : ℕ → ℝ := shiftedTotientSieveRemainder T μ let F : ℕ → ℝ := fun p => ∑ u ∈ T.filter (fun u => p ∣ 2*u + 1 ∧ ∀ q ∈ P, ¬q ∣ 2*u + 1), μ u have hfixed : ∀ p ∈ Q, |F p - (X / ((p : ℝ) - 1)) * A| ≤ (X / ((p : ℝ) - 1)) * A * K * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli P D, |r (p*d)| := by intro p hp exact hsieve P T μ p hz hh heven (hQ p hp) (hout p hp) hP hodd hPz hμ have hmain : (∑ p ∈ Q, (X / ((p : ℝ) - 1)) * A) = X*A*H := by dsimp only [H] rw [mul_sum] apply sum_congr rfl intro p _ ring change |(∑ p ∈ Q, F p) - X*A*H| ≤ X*A*H*K*Real.exp (-(h : ℝ)) + ∑ m ∈ oddSquarefreeModuli N, |r m| calc _ = |∑ p ∈ Q, (F p - (X / ((p : ℝ) - 1)) * A)| := by rw [sum_sub_distrib, hmain] _ ≤ ∑ p ∈ Q, |F p - (X / ((p : ℝ) - 1)) * A| := abs_sum_le_sum_abs _ _ _ ≤ ∑ p ∈ Q, ((X / ((p : ℝ) - 1)) * A * K * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli P D, |r (p*d)|) := sum_le_sum hfixed _ = X*A*H*K*Real.exp (-(h : ℝ)) + ∑ p ∈ Q, ∑ d ∈ blockSieveModuli P D, |r (p*d)| := by rw [sum_add_distrib, ← sum_mul, ← sum_mul, hmain] _ ≤ _ := add_le_add le_rfl (separated_odd_prime_sieve_remainders_le P Q D N r hP hQ hodd hQodd hout hlevel) end Bounty end section /- Disintegrate the literal full event at its original auxiliary draw. -/ open Finset open scoped Classical namespace Bounty section Fixed variable {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) {A : Type*} (Δ D : SharedActiveLabels P S → A → G → ℤ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) def fullActiveFixedAuxEvent (a : A) (e : FullActiveEdgeEvent n S B (fun _ => Unit) (fun c _ => Δ c a) (fun c _ => D c a) x) : FullActiveEdgeEvent n S B (fun _ => A) Δ D x := ⟨a, e.2⟩ end Fixed end Bounty end section /- Position-dependent vectors with the exact normalization used by physical states. -/ open scoped BigOperators InnerProductSpace namespace Bounty noncomputable def finitePositionVector {X : Type*} (position : X → ℤ) (mass : ℝ) (f : ℤ → ℂ) : EuclideanSpace ℂ X := WithLp.toLp 2 (fun x => (Real.sqrt mass : ℂ) * f (position x)) theorem finite_position_vector_fiber_sum {X : Type*} [Fintype X] (position : X → ℤ) (mass : ℝ) (f : ℤ → ℂ) (S : Finset ℤ) (hf : ∀ x, position x ∉ S → f (position x) = 0) : finitePositionVector position mass f = ∑ n ∈ S, f n • finiteFiberVector position mass n := by classical ext x by_cases hx : position x ∈ S · simp [finitePositionVector, finiteFiberVector, finiteFiberIndicator, mul_ite, hx, eq_comm, mul_comm] · simp [finitePositionVector, finiteFiberVector, finiteFiberIndicator, mul_ite, hx, hf x hx, eq_comm] theorem finite_position_vector_norm_sq {X : Type*} [Fintype X] (position : X → ℤ) {mass : ℝ} (hmass : 0 ≤ mass) (f : ℤ → ℂ) : ‖finitePositionVector position mass f‖ ^ 2 = mass * ∑ x, ‖f (position x)‖ ^ 2 := by rw [EuclideanSpace.norm_sq_eq, Finset.mul_sum] apply Finset.sum_congr rfl intro x _ change ‖(Real.sqrt mass : ℂ) * f (position x)‖ ^ 2 = _ rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg mass), mul_pow, Real.sq_sqrt hmass] theorem finite_position_vector_kernel_pairing {X : Type*} [Fintype X] (position : X → ℤ) {mass : ℝ} (hmass : 0 ≤ mass) (K : X → X → ℂ) (f g : ℤ → ℂ) : inner ℂ (finitePositionVector position mass f) (finiteKernelOperator K (finitePositionVector position mass g)) = (mass : ℂ) * ∑ x, ∑ y, (starRingEnd ℂ) (f (position x)) * K x y * g (position y) := by rw [PiLp.inner_apply, Finset.mul_sum] apply Finset.sum_congr rfl intro x _ rw [finite_kernel_operator_apply] change (∑ y, K x y * ((Real.sqrt mass : ℂ) * g (position y))) * (starRingEnd ℂ) ((Real.sqrt mass : ℂ) * f (position x)) = _ rw [Finset.sum_mul, Finset.mul_sum, map_mul, Complex.conj_ofReal] apply Finset.sum_congr rfl intro y _ have hs : (Real.sqrt mass : ℂ) * (Real.sqrt mass : ℂ) = (mass : ℂ) := by rw [← Complex.ofReal_mul, Real.mul_self_sqrt hmass] calc _ = ((Real.sqrt mass : ℂ) * (Real.sqrt mass : ℂ)) * ((starRingEnd ℂ) (f (position x)) * K x y * g (position y)) := by ring _ = _ := by rw [hs] end Bounty end section /- Exact signed determinant identities for two shifted product equations. -/ namespace Bounty theorem typeII_determinant_identities {m m' n e h h' : ℤ} (ha : m * n = 2 * e * h + 1) (hb : m' * n = 2 * e * h' + 1) : m' - m = 2 * e * (m * h' - m' * h) ∧ h' - h = (m * h' - m' * h) * n := by constructor · linear_combination m * hb - m' * ha · linear_combination h * hb - h' * ha theorem typeII_determinant_unique {m m' n e h h' : ℤ} (ha : m * n = 2 * e * h + 1) (hb : m' * n = 2 * e * h' + 1) (hne : m ≠ m') : ∃! k : ℤ, k ≠ 0 ∧ m' - m = 2 * e * k ∧ h' - h = k * n ∧ m * h' - m' * h = k := by obtain ⟨hm, hh⟩ := typeII_determinant_identities ha hb refine ⟨m * h' - m' * h, ⟨?_, hm, hh, rfl⟩, ?_⟩ · intro hz rw [hz, mul_zero] at hm exact hne (sub_eq_zero.mp hm).symm · intro k hk exact hk.2.2.2.symm theorem typeII_determinant_reconstruction_identity {m m' e h h' k : ℤ} (hd : m * h' - m' * h = k) (he : m' - m = 2 * e * k) : m * (h' - h) = k * (2 * e * h + 1) := by linear_combination hd + h * he theorem typeII_determinant_reconstruct {m m' e h h' k : ℤ} (hm : m ≠ 0) (hc : IsCoprime m k) (hd : m * h' - m' * h = k) (he : m' - m = 2 * e * k) : ∃! n : ℤ, m * n = 2 * e * h + 1 ∧ m' * n = 2 * e * h' + 1 ∧ h' - h = k * n := by have hi := typeII_determinant_reconstruction_identity hd he have hdiv : m ∣ 2 * e * h + 1 := hc.dvd_of_dvd_mul_left ⟨h' - h, hi.symm⟩ obtain ⟨n, hn⟩ := hdiv have hstep : h' - h = k * n := by apply mul_left_cancel₀ hm rw [hi, hn] ring have hn' : m' * n = 2 * e * h' + 1 := by linear_combination -hn + n * he - 2 * e * hstep refine ⟨n, ⟨hn.symm, hn', hstep⟩, ?_⟩ intro n' hn' exact mul_left_cancel₀ hm (hn'.1.trans hn) theorem typeII_determinant_reconstruct_positive {m m' e h h' k : ℤ} (hm : 0 < m) (hepos : 0 < e) (hh : 0 ≤ h) (hc : IsCoprime m k) (hd : m * h' - m' * h = k) (he : m' - m = 2 * e * k) : ∃! n : ℤ, 0 < n ∧ m * n = 2 * e * h + 1 ∧ m' * n = 2 * e * h' + 1 ∧ h' - h = k * n := by obtain ⟨n, hn, huniq⟩ := typeII_determinant_reconstruct hm.ne' hc hd he have hnpos : 0 < n := by have hprod : 0 < m * n := by rw [hn.1]; positivity exact (mul_pos_iff_of_pos_left hm).mp hprod exact ⟨n, ⟨hnpos, hn⟩, fun n' hn' => huniq n' hn'.2⟩ end Bounty end section /- The literal three-factor endpoint convolution and its divisor majorant. -/ open scoped BigOperators namespace Bounty noncomputable def endpointTripleConvolution (α β γ : ℕ → ℂ) (n : ℕ) : ℂ := ∑ m ∈ n.divisors, ∑ p ∈ (n / m).divisors, α m * β p * γ (n / m / p) theorem endpoint_triple_convolution_norm_le (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (n : ℕ) : ‖endpointTripleConvolution α β γ n‖ ≤ A * B * C * (n.divisors.card : ℝ) ^ 2 := by classical have hABC : 0 ≤ A * B * C := mul_nonneg (mul_nonneg hA hB) hC calc _ ≤ ∑ m ∈ n.divisors, ∑ p ∈ (n / m).divisors, ‖α m * β p * γ (n / m / p)‖ := by exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun m _ => norm_sum_le _ _)) _ ≤ ∑ m ∈ n.divisors, ∑ _p ∈ (n / m).divisors, A * B * C := by apply Finset.sum_le_sum intro m _ apply Finset.sum_le_sum intro p _ rw [norm_mul, norm_mul] exact mul_le_mul (mul_le_mul (hα m) (hβ p) (norm_nonneg _) hA) (hγ _) (norm_nonneg _) (mul_nonneg hA hB) _ ≤ ∑ _m ∈ n.divisors, (n.divisors.card : ℝ) * (A * B * C) := by apply Finset.sum_le_sum intro m hm simp only [Finset.sum_const, nsmul_eq_mul] apply mul_le_mul_of_nonneg_right _ hABC exact_mod_cast Finset.card_le_card (Nat.divisors_subset_of_dvd (Nat.ne_zero_of_mem_divisors hm) (Nat.div_dvd_of_dvd (Nat.dvd_of_mem_divisors hm))) _ = _ := by simp only [Finset.sum_const, nsmul_eq_mul]; ring noncomputable def invariantTripleEndpoint (P : Finset ℕ) (α β γ : ℕ → ℂ) (n : ℕ) : ℂ := endpointTripleConvolution α β γ (primePoolFreePart P n) theorem invariant_triple_endpoint_norm_le (P : Finset ℕ) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (n : ℕ) : ‖invariantTripleEndpoint P α β γ n‖ ≤ A * B * C * ((primePoolFreePart P n).divisors.card : ℝ) ^ 2 := endpoint_triple_convolution_norm_le α β γ hA hB hC hα hβ hγ _ end Bounty end section /- A sixteenth Dirichlet convolution majorizes the fourth divisor moment. -/ open Finset ArithmeticFunction namespace Bounty theorem divisor_zeta_power_prime_pow (r a : ℕ) {p : ℕ} (hp : p.Prime) : (ArithmeticFunction.zeta ^ (r + 1)) (p ^ a) = (a + r).choose r := by induction r generalizing a with | zero => simp [ArithmeticFunction.zeta_apply_ne (pow_ne_zero _ hp.ne_zero)] | succ r ih => rw [pow_succ, ArithmeticFunction.mul_zeta_apply, Nat.sum_divisors_prime_pow hp] simp_rw [ih] simpa only [Nat.add_assoc] using Nat.sum_range_add_choose a r theorem fourth_power_le_choose_fifteen (a : ℕ) : (a + 1) ^ 4 ≤ (a + 15).choose 15 := by induction a with | zero => norm_num | succ a ih => have hr := Nat.choose_mul_succ_eq (a + 15) 15 have hs : a + 15 + 1 - 15 = a + 1 := by omega rw [hs] at hr have hpoly : (a + 2) ^ 4 ≤ (a + 16) * (a + 1) ^ 3 := by nlinarith [Nat.zero_le (a ^ 3)] have hmul := Nat.mul_le_mul_right (a + 1) hpoly have hih := Nat.mul_le_mul_left (a + 16) ih have hfinal : (a + 1) * (a + 2) ^ 4 ≤ (a + 1) * (a + 16).choose 15 := by calc _ ≤ (a + 16) * (a + 1) ^ 4 := by nlinarith only [hmul] _ ≤ (a + 16) * (a + 15).choose 15 := hih _ = _ := by nlinarith only [hr] have hres : (a + 2) ^ 4 ≤ (a + 16).choose 15 := by nlinarith only [hfinal] simpa only [Nat.succ_eq_add_one, Nat.add_assoc] using hres theorem divisor_fourth_power_le_zeta_sixteen (n : ℕ) : n.divisors.card ^ 4 ≤ (ArithmeticFunction.zeta ^ 16) n := by by_cases hn : n = 0 · simp [hn] rw [Nat.card_divisors hn, (ArithmeticFunction.isMultiplicative_zeta.pow (k := 16)).multiplicative_factorization _ hn] simp only [Finsupp.prod, ← Finset.prod_pow] apply Finset.prod_le_prod' intro p hp have hp' : p.Prime := Nat.prime_of_mem_primeFactors hp rw [show 16 = 15 + 1 by omega, divisor_zeta_power_prime_pow 15 _ hp'] exact fourth_power_le_choose_fifteen _ end Bounty end section /- Scalar arithmetic for a positive candidate mass after proxy subtraction. -/ open Filter namespace Bounty theorem candidate_proxy_gap_arithmetic {d L X C κ Rpre Rmesh A U B : ℝ} (_hd : 0 < d) (hL : 0 < L) (hX : 0 ≤ X) (hC : C / L ≤ d / 12) (hgap : d / 2 < Rpre - Rmesh - C * κ) (hA : (Rpre - d / 24) * X / L ≤ A) (hU : U ≤ (Rmesh + d / 24) * X / L) (hB : B ≤ C * (κ + 1 / L) * X / L) : (d / 3) * X / L ≤ A - U - B := by have hscalar : d / 3 ≤ (Rpre - d / 24) - (Rmesh + d / 24) - C * (κ + 1 / L) := by have hsplit : C * (κ + 1 / L) = C * κ + C / L := by ring rw [hsplit] linarith have hscale : 0 ≤ X / L := div_nonneg hX hL.le calc (d / 3) * X / L = (d / 3) * (X / L) := by ring _ ≤ ((Rpre - d / 24) - (Rmesh + d / 24) - C * (κ + 1 / L)) * (X / L) := mul_le_mul_of_nonneg_right hscalar hscale _ = (Rpre - d / 24) * X / L - (Rmesh + d / 24) * X / L - C * (κ + 1 / L) * X / L := by ring _ ≤ A - U - B := by linarith theorem eventually_proxy_gap_reciprocal_bound {d C : ℝ} (hd : 0 < d) : ∀ᶠ L : ℝ in atTop, 0 < L ∧ C / L ≤ d / 12 := by filter_upwards [eventually_ge_atTop (max 1 (12 * C / d))] with L hbound have hLone : 1 ≤ L := (le_max_left _ _).trans hbound have hL : 0 < L := by linarith refine ⟨hL, ?_⟩ have hCL : 12 * C / d ≤ L := (le_max_right _ _).trans hbound have hCL' : 12 * C ≤ L * d := (div_le_iff₀ hd).mp hCL apply (div_le_iff₀ hL).mpr nlinarith end Bounty end section /- A fixed positive mass fraction absorbs two powers of the logarithmic parameter. -/ open Filter namespace Bounty theorem eventually_polynomial_mass_absorption (C : ℝ) {σ : ℝ} (hσ : 0 < σ) : ∀ᶠ L : ℝ in atTop, Real.exp L * L ^ (-(C + 2)) ≤ σ * (Real.exp L * L ^ (-C)) / L := by filter_upwards [eventually_ge_atTop (max 1 (1 / σ))] with L hbound have hLone : 1 ≤ L := (le_max_left _ _).trans hbound have hL : 0 < L := by linarith have hσL : 1 ≤ σ * L := by have hrecip : 1 / σ ≤ L := (le_max_right _ _).trans hbound have := (div_le_iff₀ hσ).mp hrecip nlinarith have hp : L ^ (-(C + 2)) = L ^ (-C) / (L * L) := by rw [show -(C + 2) = -C - 2 by ring, Real.rpow_sub hL] norm_num [pow_two] have hK : 0 ≤ Real.exp L * L ^ (-C) := by positivity rw [hp, ← mul_div_assoc] apply (div_le_iff₀ (mul_pos hL hL)).mpr have hid : (σ * (Real.exp L * L ^ (-C)) / L) * (L * L) = (σ * L) * (Real.exp L * L ^ (-C)) := by field_simp rw [hid] simpa only [one_mul] using mul_le_mul_of_nonneg_right hσL hK theorem eventually_polynomial_mass_lower_transfer (C : ℝ) {σ : ℝ} (hσ : 0 < σ) {X m : ℝ → ℝ} (hX : ∀ᶠ L : ℝ in atTop, Real.exp L * L ^ (-C) ≤ X L) (hm : ∀ᶠ L : ℝ in atTop, σ * X L / L ≤ m L) : ∀ᶠ L : ℝ in atTop, Real.exp L * L ^ (-(C + 2)) ≤ m L := by filter_upwards [eventually_polynomial_mass_absorption C hσ, hX, hm, eventually_gt_atTop (0 : ℝ)] with L habsorb hmass htarget hL apply habsorb.trans apply le_trans _ htarget exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hmass hσ.le) hL.le end Bounty end section /- The product of the actual physical marks is a supported squarefree divisor. -/ open Finset namespace Bounty noncomputable def physicalMarkProduct {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) : ℕ := ∏ p ∈ physicalMarkedPrimes L, p.2.val theorem physical_mark_product_inverse {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) : 1 / (physicalMarkProduct L : ℝ) = ∏ g, ∏ s, 1 / ((L g s).val : ℝ) := by rw [← physical_marked_probability_product L] simp only [physicalMarkProduct, Nat.cast_prod, prod_div_distrib, prod_const_one] theorem physical_mark_product_dvd_iff {G : Type*} [Fintype G] {P : G → Finset ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) {J ell : ℕ} (L : PhysicalMarkLists P J ell) (n : ℤ) : physicalMarkProduct L ∣ n.natAbs ↔ ∀ g s, ((L g s).val : ℤ) ∣ n := by rw [← physical_marked_divisibility_iff L n] constructor · intro hn p hp apply Int.natCast_dvd.mpr exact (dvd_prod_of_mem (fun p : PhysicalPrime P => p.2.val) hp).trans hn · intro hn apply prod_dvd_of_isRelPrime · intro p _ q _ hpq exact Nat.coprime_iff_isRelPrime.mp (physical_prime_pool_coprime hP hprime hpq) · intro p hp exact Int.natCast_dvd.mp (hn p hp) theorem physical_mark_product_supported {G : Type*} [Fintype G] {P : G → Finset ℕ} (hprime : ∀ g p, p ∈ P g → p.Prime) (Q : Finset ℕ) (hQ : ∀ g, P g ⊆ Q) {J ell : ℕ} (L : PhysicalMarkLists P J ell) : physicalMarkProduct L ∈ Nat.factoredNumbers Q := by unfold physicalMarkProduct apply prod_induction · exact fun _ _ => Nat.mul_mem_factoredNumbers · exact Nat.mem_factoredNumbers_of_primeFactors_subset (by decide) (by simp) · intro p _ apply Nat.mem_factoredNumbers_of_primeFactors_subset (hprime p.1 p.2.val p.2.property).ne_zero rw [(hprime p.1 p.2.val p.2.property).primeFactors] exact singleton_subset_iff.mpr (hQ p.1 p.2.property) end Bounty end section /- Exact separated Fourier phases for ordered smooth slot allocation. -/ open Finset namespace Bounty noncomputable def orderedSlotResidual {N : ℕ} (R : ℝ) (δ v : Fin N → ℝ) (i : Fin N) : ℝ := R-∑ j∈univ.filter (fun j => j < i), δ j*v j noncomputable def orderedSlotFrequency {N : ℕ} (δ a : Fin N → ℝ) (j : Fin N) : ℝ := -a j-δ j*(∑ i∈univ.filter (fun i => j < i), a i) theorem ordered_slot_phase_separation {N : ℕ} (R : ℝ) (δ v a : Fin N → ℝ) : (∑ i, a i*(orderedSlotResidual R δ v i-v i)) = R*(∑ i, a i)+∑ j, v j*orderedSlotFrequency δ a j := by have hswap : (∑ i, a i*(∑ j∈univ.filter (fun j => j < i), δ j*v j)) = ∑ j, v j*δ j*(∑ i∈univ.filter (fun i => j < i), a i) := by simp only [mul_sum, sum_filter] rw [sum_comm] apply sum_congr rfl intro j hj apply sum_congr rfl intro i hi by_cases h : j < i <;> simp only [h, if_true, if_false, mul_zero] ring have hmul : (∑ i, a i*v i) = ∑ i, v i*a i := by apply sum_congr rfl intro i hi ring simp only [orderedSlotResidual, orderedSlotFrequency, mul_sub, mul_neg, sum_sub_distrib, sum_neg_distrib, ← mul_assoc] rw [hswap, hmul] simp only [sum_mul, mul_comm R] ring theorem ordered_slot_exponential_separation {N : ℕ} (R : ℝ) (δ v a : Fin N → ℝ) : Complex.exp (Complex.I*((∑ i, a i*(orderedSlotResidual R δ v i-v i) : ℝ) : ℂ)) = Complex.exp (Complex.I*((R*(∑ i, a i) : ℝ) : ℂ))* ∏ j, Complex.exp (Complex.I*((v j*orderedSlotFrequency δ a j : ℝ) : ℂ)) := by rw [ordered_slot_phase_separation] simp only [Complex.ofReal_add, mul_add, Complex.exp_add, Complex.ofReal_sum, mul_sum, Complex.exp_sum] theorem ordered_slot_prime_power_separation {N : ℕ} (R : ℝ) (δ p a : Fin N → ℝ) (hp : ∀ i, 0 < p i) : Complex.exp (Complex.I*((∑ i, a i* (orderedSlotResidual R δ (fun j => Real.log (p j)) i-Real.log (p i)) : ℝ) : ℂ)) = Complex.exp (Complex.I*((R*(∑ i, a i) : ℝ) : ℂ))* ∏ j, (p j : ℂ)^((orderedSlotFrequency δ a j : ℂ)*Complex.I) := by rw [ordered_slot_exponential_separation] congr 1 apply prod_congr rfl intro j hj rw [Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr (hp j).ne'), ← Complex.ofReal_log (hp j).le] congr 1 push_cast ring end Bounty end section /- Concrete smooth take/skip allocation of ordered logarithmic slot values. -/ open Finset Real namespace Bounty noncomputable def smoothSlotTakeProbability (v s R : ℝ) (active : Bool) : ℝ := if active then smoothTransition ((R-v)/s) else 0 noncomputable def smoothSlotTransition (v s R : ℝ) (active take : Bool) : ℝ := if take then smoothSlotTakeProbability v s R active else 1-smoothSlotTakeProbability v s R active noncomputable def smoothAllocationWeight : (n : ℕ) → (Fin n → ℝ) → (Fin n → ℝ) → (Fin n → Bool) → ℝ → (Fin n → Bool) → ℝ | 0, _, _, _, _, _ => 1 | n+1, v, s, active, R, take => smoothSlotTransition (v 0) (s 0) R (active 0) (take 0) * smoothAllocationWeight n (Fin.tail v) (Fin.tail s) (Fin.tail active) (R-if take 0 then v 0 else 0) (Fin.tail take) theorem smooth_slot_take_bounds (v s R : ℝ) (active : Bool) : 0 ≤ smoothSlotTakeProbability v s R active ∧ smoothSlotTakeProbability v s R active ≤ 1 := by cases active <;> simp only [smoothSlotTakeProbability, Bool.false_eq_true, if_false, if_true] · norm_num · exact ⟨smoothTransition.nonneg _,smoothTransition.le_one _⟩ theorem smooth_slot_transition_nonneg (v s R : ℝ) (active take : Bool) : 0 ≤ smoothSlotTransition v s R active take := by obtain ⟨h0,h1⟩ := smooth_slot_take_bounds v s R active cases take <;> simp only [smoothSlotTransition, Bool.false_eq_true, if_false, if_true] · linarith · exact h0 theorem smooth_slot_transition_sum (v s R : ℝ) (active : Bool) : (∑ take : Bool, smoothSlotTransition v s R active take) = 1 := by rw [Fintype.sum_bool] simp only [smoothSlotTransition, Bool.false_eq_true, if_true, if_false] ring theorem smooth_allocation_weight_nonneg (n : ℕ) (v s : Fin n → ℝ) (active : Fin n → Bool) (R : ℝ) (take : Fin n → Bool) : 0 ≤ smoothAllocationWeight n v s active R take := by induction n generalizing R with | zero => exact zero_le_one | succ n ih => exact mul_nonneg (smooth_slot_transition_nonneg _ _ _ _ _) (ih _ _ _ _ _) theorem smooth_allocation_total_mass (n : ℕ) (v s : Fin n → ℝ) (active : Fin n → Bool) (R : ℝ) : (∑ take : Fin n → Bool, smoothAllocationWeight n v s active R take) = 1 := by induction n generalizing R with | zero => simp [smoothAllocationWeight] | succ n ih => have he := Fintype.sum_equiv (Fin.consEquiv (fun _ : Fin (n+1) => Bool)) (fun t => smoothAllocationWeight (n+1) v s active R (Fin.cons t.1 t.2)) (fun take => smoothAllocationWeight (n+1) v s active R take) (fun _ => rfl) rw [← he, Fintype.sum_prod_type] simp only [smoothAllocationWeight, Fin.cons_zero, Fin.tail_cons, ← mul_sum, ih, mul_one] exact smooth_slot_transition_sum _ _ _ _ theorem smooth_allocation_positive_factors {n : ℕ} {v s : Fin (n+1) → ℝ} {active : Fin (n+1) → Bool} {R : ℝ} {take : Fin (n+1) → Bool} (h : 0 < smoothAllocationWeight (n+1) v s active R take) : 0 < smoothSlotTransition (v 0) (s 0) R (active 0) (take 0) ∧ 0 < smoothAllocationWeight n (Fin.tail v) (Fin.tail s) (Fin.tail active) (R-if take 0 then v 0 else 0) (Fin.tail take) := by have ht := smooth_slot_transition_nonneg (v 0) (s 0) R (active 0) (take 0) have hr := smooth_allocation_weight_nonneg n (Fin.tail v) (Fin.tail s) (Fin.tail active) (R-if take 0 then v 0 else 0) (Fin.tail take) change 0 < _*_ at h constructor <;> nlinarith theorem smooth_allocation_inactive_not_taken (n : ℕ) (v s : Fin n → ℝ) (active : Fin n → Bool) (R : ℝ) (take : Fin n → Bool) (h : 0 < smoothAllocationWeight n v s active R take) : ∀ i, active i = false → take i = false := by induction n generalizing R with | zero => exact fun i => Fin.elim0 i | succ n ih => obtain ⟨hh,ht⟩ := smooth_allocation_positive_factors h intro i refine Fin.cases ?_ (fun j => ?_) i · intro ha cases hb : take 0 · rfl · simp only [smoothSlotTransition, smoothSlotTakeProbability, ha, hb, Bool.false_eq_true, if_false, if_true] at hh linarith · exact ih (Fin.tail v) (Fin.tail s) (Fin.tail active) _ (Fin.tail take) ht j theorem smooth_slot_take_requires_room {v s R : ℝ} (hs : 0 < s) {active : Bool} (h : 0 < smoothSlotTransition v s R active true) : v < R := by cases active · simp [smoothSlotTransition,smoothSlotTakeProbability] at h · have hn : smoothTransition ((R-v)/s) ≠ 0 := ne_of_gt h have hp : 0 < (R-v)/s := lt_of_not_ge (fun hz => hn (smoothTransition.zero_of_nonpos hz)) have hh := (div_pos_iff_of_pos_right hs).mp hp linarith theorem smooth_slot_skip_requires_room {v s R : ℝ} (hs : 0 < s) (h : 0 < smoothSlotTransition v s R true false) : R < v+s := by have hn : smoothTransition ((R-v)/s) ≠ 1 := by change 0 < 1-smoothTransition ((R-v)/s) at h linarith have hp : (R-v)/s < 1 := lt_of_not_ge (fun hz => hn (smoothTransition.one_of_one_le hz)) have hh := (div_lt_one hs).mp hp linarith end Bounty end section /- An exact mass-one refinement preserves the original ordered-slot normalization. -/ open Finset namespace Bounty end Bounty end section /- The powers of the interval length cancel in the localized Gram estimate. -/ namespace Bounty theorem block_gram_scaling_bound {R : ℕ} (hR : 1 ≤ R) {X U T : ℝ} (hX : 0 < X) (hU : 1 ≤ U) (hT : 0 ≤ T) : (3 * (X * U ^ 2)) ^ (1 / 2 : ℝ) * (X * U ^ 2) ^ ((1 - 1 / (R : ℝ)) / 2) * (X * T ^ (2 * R)) ^ (1 / (2 * (R : ℝ))) ≤ Real.sqrt 3 * X * U ^ 2 * T := by have hR0 : (0 : ℝ) < R := by exact_mod_cast (by omega : 0 < R) have hU0 : 0 < U := lt_of_lt_of_le zero_lt_one hU have hXU : 0 < X * U ^ 2 := mul_pos hX (sq_pos_of_pos hU0) have he : (1 / 2 : ℝ) + (1 - 1 / (R : ℝ)) / 2 = 1 - 1 / (2 * (R : ℝ)) := by ring have ht : (T ^ (2 * R)) ^ (1 / (2 * (R : ℝ))) = T := by rw [← Real.rpow_natCast_mul hT] have he' : ((2 * R : ℕ) : ℝ) * (1 / (2 * (R : ℝ))) = 1 := by push_cast field_simp rw [he', Real.rpow_one] have hu : (U ^ 2) ^ (1 - 1 / (2 * (R : ℝ))) = U ^ (2 - 1 / (R : ℝ)) := by rw [← Real.rpow_natCast_mul hU0.le] congr 1 norm_num ring have hcomb : (X * U ^ 2) ^ (1 - 1 / (2 * (R : ℝ))) * (X * T ^ (2 * R)) ^ (1 / (2 * (R : ℝ))) = X * U ^ (2 - 1 / (R : ℝ)) * T := by rw [Real.mul_rpow hX.le (sq_nonneg U), Real.mul_rpow hX.le (pow_nonneg hT _), ht, hu] calc _ = (X ^ (1 - 1 / (2 * (R : ℝ))) * X ^ (1 / (2 * (R : ℝ)))) * U ^ (2 - 1 / (R : ℝ)) * T := by ring _ = _ := by rw [← Real.rpow_add hX]; simp calc _ = (3 : ℝ) ^ (1 / 2 : ℝ) * ((X * U ^ 2) ^ (1 - 1 / (2 * (R : ℝ))) * (X * T ^ (2 * R)) ^ (1 / (2 * (R : ℝ)))) := by rw [Real.mul_rpow (by norm_num : (0 : ℝ) ≤ 3) hXU.le, ← mul_assoc, mul_assoc ((3 : ℝ) ^ (1 / 2 : ℝ)), ← Real.rpow_add hXU, he] _ = Real.sqrt 3 * X * U ^ (2 - 1 / (R : ℝ)) * T := by rw [hcomb, Real.sqrt_eq_rpow] ring _ ≤ _ := by apply mul_le_mul_of_nonneg_right _ hT apply mul_le_mul_of_nonneg_left _ (mul_nonneg (Real.sqrt_nonneg _) hX.le) have h := Real.rpow_le_rpow_of_exponent_le hU (show 2 - 1 / (R : ℝ) ≤ 2 by linarith [one_div_pos.mpr hR0]) simpa only [Real.rpow_two] using h theorem block_gram_of_energy_bounds {R : ℕ} (hR : 1 ≤ R) {Q F G Z B X U T : ℝ} (hF0 : 0 ≤ F) (hG0 : 0 ≤ G) (hZ0 : 0 ≤ Z) (hB : 0 ≤ B) (hX : 0 < X) (hU : 1 ≤ U) (hT : 0 ≤ T) (hblock : Q ^ (1 / (2 * (R : ℝ))) ≤ B) (hF : F ≤ X * U ^ 2) (hG : G ≤ X * U ^ 2) (hZ : Z ≤ X * T ^ (2 * R)) : Q ^ (1 / (2 * (R : ℝ))) * (3 * G) ^ (1 / 2 : ℝ) * F ^ ((1 - 1 / (R : ℝ)) / 2) * Z ^ (1 / (2 * (R : ℝ))) ≤ B * Real.sqrt 3 * X * U ^ 2 * T := by have hR1 : (1 : ℝ) ≤ R := by exact_mod_cast hR have hR0 : (0 : ℝ) < R := lt_of_lt_of_le zero_lt_one hR1 have htheta : 0 ≤ (1 - 1 / (R : ℝ)) / 2 := by have hh : 1 / (R : ℝ) ≤ 1 := (div_le_one hR0).mpr hR1 linarith calc _ ≤ B * (3 * (X * U ^ 2)) ^ (1 / 2 : ℝ) * (X * U ^ 2) ^ ((1 - 1 / (R : ℝ)) / 2) * (X * T ^ (2 * R)) ^ (1 / (2 * (R : ℝ))) := by gcongr _ = B * ((3 * (X * U ^ 2)) ^ (1 / 2 : ℝ) * (X * U ^ 2) ^ ((1 - 1 / (R : ℝ)) / 2) * (X * T ^ (2 * R)) ^ (1 / (2 * (R : ℝ)))) := by ring _ ≤ B * (Real.sqrt 3 * X * U ^ 2 * T) := mul_le_mul_of_nonneg_left (block_gram_scaling_bound hR hX hU hT) hB _ = _ := by ring end Bounty end section /- Explicit exponential rank tails retain the required saving in the whole path length. -/ namespace Bounty theorem geometric_rank_tail_le_exp {A a b c E : ℝ} (r : ℕ) (hAc : A ≤ Real.exp c) (ha : 0 ≤ a) (ha2 : a ≤ 1 / 2) (hab : a ≤ Real.exp (-b)) (hmargin : c + E + Real.log 2 ≤ b * r) : A * a ^ r / (1 - a) ≤ Real.exp (-E) := by have hden : 0 < 1 - a := by linarith have hp : a ^ r ≤ Real.exp (-b * r) := by calc _ ≤ Real.exp (-b) ^ r := pow_le_pow_left₀ ha hab r _ = _ := by rw [← Real.exp_nat_mul]; congr 1; ring have hnum : A * a ^ r ≤ Real.exp (-E) / 2 := by calc _ ≤ Real.exp c * Real.exp (-b * r) := mul_le_mul hAc hp (pow_nonneg ha _) (Real.exp_pos c).le _ = Real.exp (c - b * r) := by rw [← Real.exp_add]; congr 1; ring _ ≤ Real.exp (-E - Real.log 2) := Real.exp_le_exp.mpr (by linarith) _ = _ := by rw [Real.exp_sub, Real.exp_log (by norm_num : (0 : ℝ) < 2)] apply (div_le_iff₀ hden).mpr calc _ ≤ Real.exp (-E) / 2 := hnum _ ≤ Real.exp (-E) * (1 - a) := by nlinarith [Real.exp_pos (-E)] theorem forest_rank_cutoff_tail {L C E b A a : ℝ} (N : ℕ) (hL : 2 ≤ L) (hC : 0 ≤ C) (hb : Real.log 2 ≤ b) (hN : 1 ≤ N) (hAb : A ≤ L ^ (C * ((N : ℝ) + 1))) (ha : 0 ≤ a) (hab : a ≤ Real.exp (-b)) : A * a ^ (Nat.ceil (((2 * C + E + 1) * N * Real.log L) / b)) / (1 - a) ≤ L ^ (-(E * N)) := by have hL0 : 0 < L := lt_of_lt_of_le (by norm_num) hL have hlog : 0 < Real.log L := Real.log_pos (by linarith) have hb0 : 0 < b := (Real.log_pos (by norm_num : (1 : ℝ) < 2)).trans_le hb have hN1 : (1 : ℝ) ≤ N := by exact_mod_cast hN have hceil := Nat.le_ceil (((2 * C + E + 1) * N * Real.log L) / b) have hprod : (2 * C + E + 1) * N * Real.log L ≤ b * (Nat.ceil (((2 * C + E + 1) * N * Real.log L) / b) : ℝ) := by have h := (div_le_iff₀ hb0).mp hceil nlinarith have hlog2 : Real.log 2 ≤ Real.log L := Real.log_le_log (by norm_num) hL have hmargin : C * ((N : ℝ) + 1) * Real.log L + (E * N) * Real.log L + Real.log 2 ≤ b * (Nat.ceil (((2 * C + E + 1) * N * Real.log L) / b) : ℝ) := by have hcN : 0 ≤ C * ((N : ℝ) - 1) * Real.log L := by positivity have hnlog : Real.log 2 ≤ (N : ℝ) * Real.log L := by nlinarith nlinarith have ha2 : a ≤ 1 / 2 := by calc a ≤ Real.exp (-b) := hab _ ≤ Real.exp (-Real.log 2) := Real.exp_le_exp.mpr (by linarith) _ = 1 / 2 := by rw [Real.exp_neg, Real.exp_log (by norm_num : (0 : ℝ) < 2)]; norm_num have hAc : A ≤ Real.exp (C * ((N : ℝ) + 1) * Real.log L) := by simpa only [Real.rpow_def_of_pos hL0, mul_comm (Real.log L)] using hAb have h := geometric_rank_tail_le_exp (Nat.ceil (((2 * C + E + 1) * N * Real.log L) / b)) hAc ha ha2 hab hmargin simpa only [Real.rpow_def_of_pos hL0, neg_mul, mul_neg, mul_comm (Real.log L)] using h end Bounty end section /- Explicit compact smooth Type-II transitions and their Schwartz Fourier transforms. -/ open MeasureTheory open scoped FourierTransform ContDiff namespace Bounty noncomputable def typeIISmoothRho (A t : ℝ) : ℝ := Real.smoothTransition (t + A + 1) * Real.smoothTransition (A + 1 - t) noncomputable def typeIISmoothCutoff (A : ℝ) (active : Bool) (t : ℝ) : ℝ := typeIISmoothRho A t * (if active then Real.smoothTransition t else 1 - Real.smoothTransition t) theorem typeII_smooth_rho_bounds (A t : ℝ) : 0 ≤ typeIISmoothRho A t ∧ typeIISmoothRho A t ≤ 1 := by constructor · exact mul_nonneg (Real.smoothTransition.nonneg _) (Real.smoothTransition.nonneg _) · calc _ ≤ 1 * Real.smoothTransition (A + 1 - t) := mul_le_mul_of_nonneg_right (Real.smoothTransition.le_one _) (Real.smoothTransition.nonneg _) _ ≤ 1 := by simpa using Real.smoothTransition.le_one (A + 1 - t) theorem typeII_smooth_rho_eq_one {A t : ℝ} (ht : t ∈ Set.Icc (-A) A) : typeIISmoothRho A t = 1 := by unfold typeIISmoothRho rw [Real.smoothTransition.one_of_one_le (by linarith [ht.1]), Real.smoothTransition.one_of_one_le (by linarith [ht.2]), mul_one] theorem typeII_smooth_rho_eq_zero {A t : ℝ} (ht : t ∉ Set.Icc (-A - 1) (A + 1)) : typeIISmoothRho A t = 0 := by unfold typeIISmoothRho by_cases hlo : t < -A - 1 · rw [Real.smoothTransition.zero_of_nonpos (by linarith), zero_mul] · have hhi : A + 1 < t := lt_of_not_ge (fun h => ht ⟨le_of_not_gt hlo, h⟩) rw [Real.smoothTransition.zero_of_nonpos (by linarith : A + 1 - t ≤ 0), mul_zero] theorem typeII_smooth_rho_contDiff (A : ℝ) : ContDiff ℝ ∞ (typeIISmoothRho A) := by unfold typeIISmoothRho fun_prop theorem typeII_smooth_rho_hasCompactSupport (A : ℝ) : HasCompactSupport (typeIISmoothRho A) := HasCompactSupport.intro isCompact_Icc (fun _ ht => typeII_smooth_rho_eq_zero ht) theorem typeII_smooth_cutoff_contDiff (A : ℝ) (active : Bool) : ContDiff ℝ ∞ (typeIISmoothCutoff A active) := by cases active <;> unfold typeIISmoothCutoff <;> simp only [Bool.false_eq_true, if_false, if_true] · exact (typeII_smooth_rho_contDiff A).mul (contDiff_const.sub Real.smoothTransition.contDiff) · exact (typeII_smooth_rho_contDiff A).mul Real.smoothTransition.contDiff theorem typeII_smooth_cutoff_hasCompactSupport (A : ℝ) (active : Bool) : HasCompactSupport (typeIISmoothCutoff A active) := (typeII_smooth_rho_hasCompactSupport A).mul_right theorem typeII_smooth_cutoff_bounds (A t : ℝ) (active : Bool) : 0 ≤ typeIISmoothCutoff A active t ∧ typeIISmoothCutoff A active t ≤ 1 := by have hr := typeII_smooth_rho_bounds A t have ht0 := Real.smoothTransition.nonneg t have ht1 := Real.smoothTransition.le_one t cases active <;> simp only [typeIISmoothCutoff, Bool.false_eq_true, if_false, if_true] · constructor · exact mul_nonneg hr.1 (by linarith) · calc _ ≤ typeIISmoothRho A t * 1 := mul_le_mul_of_nonneg_left (by linarith) hr.1 _ ≤ 1 := by simpa using hr.2 · constructor · exact mul_nonneg hr.1 ht0 · calc _ ≤ typeIISmoothRho A t * 1 := mul_le_mul_of_nonneg_left ht1 hr.1 _ ≤ 1 := by simpa using hr.2 theorem typeII_smooth_cutoff_eq_transition {A t : ℝ} (active : Bool) (ht : t ∈ Set.Icc (-A) A) : typeIISmoothCutoff A active t = (if active then Real.smoothTransition t else 1 - Real.smoothTransition t) := by rw [typeIISmoothCutoff, typeII_smooth_rho_eq_one ht, one_mul] theorem typeII_complex_cutoff_contDiff (A : ℝ) (active : Bool) : ContDiff ℝ ∞ (fun t => (typeIISmoothCutoff A active t : ℂ)) := Complex.ofRealCLM.contDiff.comp (typeII_smooth_cutoff_contDiff A active) theorem typeII_complex_cutoff_hasCompactSupport (A : ℝ) (active : Bool) : HasCompactSupport (fun t => (typeIISmoothCutoff A active t : ℂ)) := (typeII_smooth_cutoff_hasCompactSupport A active).comp_left (g := fun x : ℝ => (x : ℂ)) (by simp) noncomputable def typeIICutoffSchwartz (A : ℝ) (active : Bool) : SchwartzMap ℝ ℂ := (typeII_complex_cutoff_hasCompactSupport A active).toSchwartzMap (typeII_complex_cutoff_contDiff A active) noncomputable def typeIICutoffFourier (A : ℝ) (active : Bool) : SchwartzMap ℝ ℂ := 𝓕 (typeIICutoffSchwartz A active) theorem typeII_cutoff_fourier_integrable (A : ℝ) (active : Bool) : Integrable (typeIICutoffFourier A active) := (typeIICutoffFourier A active).integrable theorem typeII_cutoff_fourier_inversion (A t : ℝ) (active : Bool) : (typeIISmoothCutoff A active t : ℂ) = ∫ ξ : ℝ, Complex.exp ((2 * Real.pi * ξ * t : ℝ) * Complex.I) * typeIICutoffFourier A active ξ := by have hi := congrArg (fun f : SchwartzMap ℝ ℂ => f t) (FourierPair.fourierInv_fourier_eq (E := SchwartzMap ℝ ℂ) (F := SchwartzMap ℝ ℂ) (typeIICutoffSchwartz A active)) rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq'] at hi change (∫ ξ : ℝ, Complex.exp ((2 * Real.pi * inner ℝ ξ t : ℝ) * Complex.I) • typeIICutoffFourier A active ξ) = (typeIISmoothCutoff A active t : ℂ) at hi rw [← hi] apply integral_congr_ae filter_upwards [] with ξ simp only [RCLike.inner_apply, starRingEnd_apply, star_trivial, smul_eq_mul] congr 2 push_cast ring end Bounty end section /- Quantitative tails obtained from actual integrable Schwartz moments. -/ open MeasureTheory namespace Bounty theorem schwartz_norm_tail_le_moment (g : SchwartzMap ℝ ℂ) (M : ℕ) {R : ℝ} (hR : 0 < R) : (∫ x in {x : ℝ | R < ‖x‖}, ‖g x‖) ≤ (∫ x : ℝ, ‖x‖ ^ M * ‖g x‖) / R ^ M := by have hs : MeasurableSet {x : ℝ | R < ‖x‖} := (isOpen_lt continuous_const continuous_norm).measurableSet have hw := g.integrable_pow_mul volume M have hcomp : (∫ x in {x : ℝ | R < ‖x‖}, R ^ M * ‖g x‖) ≤ ∫ x in {x : ℝ | R < ‖x‖}, ‖x‖ ^ M * ‖g x‖ := by apply setIntegral_mono_on (g.integrable.norm.const_mul (R ^ M)).integrableOn hw.integrableOn hs intro x hx exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hR.le hx.le M) (norm_nonneg _) rw [integral_const_mul] at hcomp have hwhole : (∫ x in {x : ℝ | R < ‖x‖}, ‖x‖ ^ M * ‖g x‖) ≤ ∫ x : ℝ, ‖x‖ ^ M * ‖g x‖ := by exact setIntegral_le_integral hw (Filter.Eventually.of_forall (fun x => mul_nonneg (pow_nonneg (norm_nonneg x) M) (norm_nonneg (g x)))) apply (le_div_iff₀ (pow_pos hR M)).2 calc _ = R ^ M * (∫ x in {x : ℝ | R < ‖x‖}, ‖g x‖) := mul_comm _ _ _ ≤ _ := hcomp.trans hwhole theorem schwartz_norm_rapid_tail (g : SchwartzMap ℝ ℂ) (M : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ R : ℝ, 1 ≤ R → (∫ x in {x : ℝ | R < ‖x‖}, ‖g x‖) ≤ C * R ^ (-(M : ℝ)) := by let I : ℝ := ∫ x : ℝ, ‖x‖ ^ M * ‖g x‖ have hI : 0 ≤ I := integral_nonneg (fun x => mul_nonneg (pow_nonneg (norm_nonneg x) M) (norm_nonneg (g x))) refine ⟨I + 1, by linarith, ?_⟩ intro R hR have hRpos : 0 < R := lt_of_lt_of_le zero_lt_one hR calc _ ≤ I / R ^ M := schwartz_norm_tail_le_moment g M hRpos _ ≤ (I + 1) / R ^ M := div_le_div_of_nonneg_right (by linarith) (pow_nonneg hRpos.le M) _ = (I + 1) * R ^ (-(M : ℝ)) := by rw [Real.rpow_neg hRpos.le, Real.rpow_natCast, div_eq_mul_inv] end Bounty end section open Finset namespace Bounty theorem complex_finset_product_error {ι : Type*} (s : Finset ι) (f g : ι → ℂ) {C ε : ℝ} (hC : 0 ≤ C) (hε : 0 ≤ ε) (hf : ∀ i ∈ s, ‖f i‖ ≤ C) (hg : ∀ i ∈ s, ‖g i‖ ≤ C) (he : ∀ i ∈ s, ‖f i - g i‖ ≤ ε) : ‖(∏ i ∈ s, f i) - ∏ i ∈ s, g i‖ ≤ s.card * ε * C ^ (s.card - 1) := by classical induction s using Finset.induction_on with | empty => simp | @insert a s ha ih => have hfs : ∀ i ∈ s, ‖f i‖ ≤ C := fun i hi => hf i (mem_insert_of_mem hi) have hgs : ∀ i ∈ s, ‖g i‖ ≤ C := fun i hi => hg i (mem_insert_of_mem hi) have hes : ∀ i ∈ s, ‖f i - g i‖ ≤ ε := fun i hi => he i (mem_insert_of_mem hi) have hp : ‖∏ i ∈ s, g i‖ ≤ C ^ s.card := by rw [norm_prod] calc _ ≤ ∏ _i ∈ s, C := prod_le_prod₀ (fun i _ => norm_nonneg (g i)) hgs _ = _ := by simp rw [prod_insert ha, prod_insert ha] have hid : f a * (∏ i ∈ s, f i) - g a * (∏ i ∈ s, g i) = f a * ((∏ i ∈ s, f i) - ∏ i ∈ s, g i) + (f a - g a) * ∏ i ∈ s, g i := by ring rw [hid] apply (norm_add_le _ _).trans rw [norm_mul, norm_mul] have hb := add_le_add (mul_le_mul (hf a (mem_insert_self a s)) (ih hfs hgs hes) (norm_nonneg _) hC) (mul_le_mul (he a (mem_insert_self a s)) hp (norm_nonneg _) hε) apply hb.trans rw [card_insert_of_notMem ha] cases hn : s.card with | zero => simp | succ n => simp only [Nat.succ_sub_one, Nat.cast_succ, pow_succ] ring_nf exact le_rfl end Bounty end section /- Every finite supported P-tail is bounded by the actual marked harmonic tail. -/ open Finset Real namespace Bounty theorem candidate_P_harmonic_term_nonneg (c L : ℝ) {q : ℝ} (hq : 0 ≤ q) (n : ℕ) : 0 ≤ candidatePHarmonicTerm c L q n := by apply div_nonneg · exact marked_divisor_weight_nonneg _ _ hq _ _ (fun _ _ => sum_nonneg (fun _ _ => by positivity)) _ · exact Nat.cast_nonneg _ theorem candidate_finite_P_tail_le {c L q : ℝ} (hcL : 0 ≤ c*L) (hq : 0 ≤ q) (X : ℝ) (S : Finset ℕ) (hsupport : ∀ p ∈ S, p ∈ Nat.factoredNumbers ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) (hcut : ∀ p ∈ S, X ≤ (p : ℝ)) : (∑ p ∈ S, candidatePWeight c L q p / (p : ℝ)) ≤ candidateMarkedSmoothTail c L q 1 X := by classical let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let T : Finset (Nat.factoredNumbers P) := S.subtype (fun p => p ∈ Nat.factoredNumbers P) have hbig : Summable (fun p : Nat.factoredNumbers P => if X ≤ (p.val : ℝ) then candidatePHarmonicTerm c L q p.val else 0) := by simpa only [Set.indicator, Set.mem_ofPred_eq] using! (candidate_P_harmonic_summable hcL q).indicator {p | X ≤ (p.val : ℝ)} calc _ = ∑ p ∈ S, candidatePHarmonicTerm c L q p := by apply sum_congr rfl intro p hp exact candidate_P_weight_harmonic c L q (Nat.ne_zero_of_mem_factoredNumbers (hsupport p hp)) _ = ∑ p ∈ T, candidatePHarmonicTerm c L q p.val := by symm exact sum_subtype_of_mem _ hsupport _ = ∑ p ∈ T, if X ≤ (p.val : ℝ) then candidatePHarmonicTerm c L q p.val else 0 := by apply sum_congr rfl intro p hp exact (if_pos (hcut p.val (mem_subtype.mp hp))).symm _ ≤ ∑' p : Nat.factoredNumbers P, if X ≤ (p.val : ℝ) then candidatePHarmonicTerm c L q p.val else 0 := by apply hbig.sum_le_tsum intro p hp split_ifs · exact candidate_P_harmonic_term_nonneg c L hq p.val · rfl _ = candidateMarkedSmoothTail c L q 1 X := rfl theorem candidate_Q_window_le_harmonic (c L : ℝ) (r jStar : ℕ) {p : ℕ} (hp : p ≠ 0) : (∑ n ∈ arithmeticProductWindow p (exp L), candidateQWeight c L r jStar n) ≤ (16*exp L/(p : ℝ))*candidateQHarmonicMass c L r jStar := by have hp0 : (0 : ℝ) < p := Nat.cast_pos.mpr (Nat.pos_of_ne_zero hp) calc _ ≤ ∑ n ∈ arithmeticProductWindow p (exp L), (16*exp L/(p : ℝ))*(candidateQWeight c L r jStar n/(n : ℝ)) := by apply sum_le_sum intro n hn have hwin := (mem_arithmeticProductWindow_iff hp (exp L)).mp hn have hn0 : (0 : ℝ) < n := by have hh : 0 < (p : ℝ)*(n : ℝ) := by simpa only [Nat.cast_mul] using (exp_pos L).trans hwin.1 exact (mul_pos_iff_of_pos_left hp0).mp hh have hnle : (n : ℝ) ≤ 16*exp L/(p : ℝ) := by apply (le_div_iff₀ hp0).mpr simpa only [Nat.cast_mul, mul_comm] using hwin.2 calc _ = (n : ℝ)*(candidateQWeight c L r jStar n/(n : ℝ)) := by field_simp _ ≤ _ := mul_le_mul_of_nonneg_right hnle (div_nonneg (candidate_Q_weight_nonneg c L r jStar n) hn0.le) _ = (16*exp L/(p : ℝ))*∑ n ∈ arithmeticProductWindow p (exp L), candidateQWeight c L r jStar n/(n : ℝ) := (mul_sum _ _ _).symm _ ≤ _ := mul_le_mul_of_nonneg_left ((candidate_Q_harmonic_summable c L r jStar).sum_le_tsum _ (fun n _ => div_nonneg (candidate_Q_weight_nonneg c L r jStar n) (Nat.cast_nonneg n))) (by positivity) end Bounty end section /- Complex weighted product fibers for labelled prime slots in disjoint pools. -/ open Finset namespace Bounty section variable {I G Ω : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : Fintype G] [sharedInstance3 : DecidableEq G] [sharedInstance4 : Fintype Ω] (group : I → G) (P : G → Finset ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : Ω → I → ℕ) (hxinj : Function.Injective x) (hx : ∀ a i, x a i ∈ P (group i)) include I G Ω sharedInstance1 sharedInstance2 sharedInstance3 sharedInstance4 group P hprime hdisj x hxinj hx /- Labelled slots may have arbitrary finite index types and arbitrary finite restrictions. The factorial cost is determined separately in each disjoint prime pool. -/ theorem card_labelled_prime_product_fiber (n : ℕ) : Nat.card {a : Ω // (∏ i, x a i) = n} ≤ ∏ g, (Fintype.card {i : I // group i = g}).factorial := by classical let K (g : G) := {i : I // group i = g} let e (g : G) : Fin (Fintype.card (K g)) ≃ K g := (Fintype.equivFin (K g)).symm let y (a : Ω) (g : G) (j : Fin (Fintype.card (K g))) : ℕ := x a (e g j).val have hyinj : Function.Injective y := by intro a b hab apply hxinj funext i have hi := congrFun (congrFun hab (group i)) ((e (group i)).symm ⟨i, rfl⟩) simpa only [y, Equiv.apply_symm_apply] using hi have hy : ∀ a g j, y a g j ∈ P g := by intro a g j dsimp only [y] simpa only [(e g j).property] using hx a (e g j).val have hyprod (a : Ω) : (∏ g, ∏ j, y a g j) = ∏ i, x a i := by calc _ = ∏ g, ∏ i : K g, x a i.val := by apply prod_congr rfl intro g _ exact Fintype.prod_equiv (e g) _ _ (fun _ => rfl) _ = _ := Fintype.prod_fiberwise group (x a) have h := card_prime_group_product_fiber P (fun g => Fintype.card (K g)) hprime hdisj y hyinj hy n simpa only [hyprod, K] using h /- Unit-bounded complex weights preserve the unweighted factorial fiber bound. -/ theorem norm_labelled_prime_product_fiber_sum_le (w : Ω → ℂ) (hw : ∀ a, ‖w a‖ ≤ 1) (n : ℕ) : ‖∑ a : Ω, if (∏ i, x a i) = n then w a else 0‖ ≤ ∏ g, ((Fintype.card {i : I // group i = g}).factorial : ℝ) := by classical calc _ ≤ ∑ a : Ω, ‖if (∏ i, x a i) = n then w a else 0‖ := norm_sum_le _ _ _ ≤ ∑ a : Ω, if (∏ i, x a i) = n then (1 : ℝ) else 0 := by apply sum_le_sum intro a _ split_ifs with ha · exact hw a · simp _ = (Nat.card {a : Ω // (∏ i, x a i) = n} : ℝ) := by simp [Nat.card_eq_fintype_card, Fintype.card_subtype] _ ≤ _ := by exact_mod_cast card_labelled_prime_product_fiber group P hprime hdisj x hxinj hx n end end Bounty end section /- The full Q-slot factorial normalization has fixed polynomial growth. -/ open Finset Filter namespace Bounty theorem eventually_candidate_factorial_normalization_le_rpow {c : ℝ} (hc : 0 < c) (r : ℕ) : ∀ᶠ L : ℝ in atTop, (r.factorial : ℝ) ^ (candidateQIndices c L).card ≤ L ^ ((1 / Real.log 2 + 1) * Real.log (r.factorial : ℝ)) := by have hfac : (1 : ℝ) ≤ r.factorial := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Nat.factorial_ne_zero r) filter_upwards [eventually_candidateQIndices_geometry hc, eventually_gt_atTop (0 : ℝ)] with L hgeom hL simpa only [prod_const] using group_product_bound_of_log_card (candidateQIndices c L) (fun _ => (r.factorial : ℝ)) hfac hL (fun _ _ => Nat.cast_nonneg _) (fun _ _ => le_rfl) hgeom.1 theorem exists_candidate_factorial_normalization_polynomial_bound {c : ℝ} (hc : 0 < c) (r : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ L : ℝ in atTop, (r.factorial : ℝ) ^ (candidateQIndices c L).card ≤ L ^ C := by have hfac : (1 : ℝ) ≤ r.factorial := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Nat.factorial_ne_zero r) refine ⟨(1 / Real.log 2 + 1) * Real.log (r.factorial : ℝ), ?_, eventually_candidate_factorial_normalization_le_rpow hc r⟩ exact mul_nonneg (by positivity) (Real.log_nonneg hfac) end Bounty end section /- Uniform polynomial derivative bounds on fixed compact support control all Schwartz seminorms. -/ open Finset MeasureTheory open scoped FourierTransform namespace Bounty section variable {I : Type*} (f : I → SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ) (w : I → ℝ) (hw : ∀ p, 1 ≤ w p) include I f w hw theorem schwartz_seminorm_polynomial_of_fixed_support (R : ℝ) (hR : 0 ≤ R) (hsupport : ∀ p, tsupport (f p) ⊆ Metric.closedBall 0 R) (hderiv : ∀ n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p x, ‖iteratedFDeriv ℝ n (f p) x‖ ≤ C*(w p)^d) : ∀ k n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, SchwartzMap.seminorm ℂ k n (f p) ≤ C*(w p)^d := by intro k n obtain ⟨d,C,hC,hbound⟩ := hderiv n refine ⟨d,R^k*C,mul_nonneg (pow_nonneg hR _) hC,?_⟩ intro p have hwp : 0 ≤ w p := zero_le_one.trans (hw p) apply SchwartzMap.seminorm_le_bound ℂ k n (f p) (by positivity) intro x by_cases hz : iteratedFDeriv ℝ n (f p) x = 0 · rw [hz, norm_zero, mul_zero] positivity · have hx : x ∈ tsupport (f p) := (support_iteratedFDeriv_subset n) hz have hxR : ‖x‖ ≤ R := by simpa only [Metric.mem_closedBall, dist_zero_right] using hsupport p hx calc _ ≤ R^k*(C*(w p)^d) := mul_le_mul (pow_le_pow_left₀ (norm_nonneg _) hxR _) (hbound p x) (norm_nonneg _) (pow_nonneg hR _) _ = _ := by ring theorem continuous_schwartz_seminorm_polynomial (hsemi : ∀ k n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, SchwartzMap.seminorm ℂ k n (f p) ≤ C*(w p)^d) (q : Seminorm ℂ (SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ)) (hq : Continuous q) : ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, q (f p) ≤ C*(w p)^d := by classical choose d C hC hbound using hsemi obtain ⟨s,K,hK,hqK⟩ := Seminorm.bound_of_continuous (schwartz_withSeminorms ℂ (EuclideanSpace ℝ (Fin 3)) ℂ) q hq let D := s.sup (fun kn => d kn.1 kn.2) let M := ∑ kn ∈ s, C kn.1 kn.2 have hM : 0 ≤ M := sum_nonneg (fun kn _ => hC kn.1 kn.2) refine ⟨D,(K : ℝ)*M,mul_nonneg K.coe_nonneg hM,?_⟩ intro p have hwp : 0 ≤ w p := zero_le_one.trans (hw p) have hs : s.sup (schwartzSeminormFamily ℂ (EuclideanSpace ℝ (Fin 3)) ℂ) (f p) ≤ M*(w p)^D := by apply Seminorm.finset_sup_apply_le (by positivity) intro kn hkn have hCM : C kn.1 kn.2 ≤ M := single_le_sum (fun kn _ => hC kn.1 kn.2) hkn have hdD : d kn.1 kn.2 ≤ D := Finset.le_sup (f := fun kn => d kn.1 kn.2) hkn exact (hbound kn.1 kn.2 p).trans (mul_le_mul hCM (pow_le_pow_right₀ (hw p) hdD) (pow_nonneg (zero_le_one.trans (hw p)) _) hM) calc _ ≤ (K : ℝ)*s.sup (schwartzSeminormFamily ℂ (EuclideanSpace ℝ (Fin 3)) ℂ) (f p) := hqK (f p) _ ≤ (K : ℝ)*(M*(w p)^D) := mul_le_mul_of_nonneg_left hs K.coe_nonneg _ = _ := by ring end end Bounty end section open scoped ContDiff namespace Bounty theorem norm_iteratedFDeriv_slice_le {P E F : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] {G : P × E → F} (hG : ContDiff ℝ ∞ G) (p : P) (x : E) (n : ℕ) : ‖iteratedFDeriv ℝ n (fun x => G (p, x)) x‖ ≤ ‖iteratedFDeriv ℝ n G (p, x)‖ := by let j : E →L[ℝ] P × E := ContinuousLinearMap.inr ℝ P E let H : P × E → F := fun y => G (y + (p, 0)) have hH : ContDiff ℝ ∞ H := hG.comp (contDiff_id.add contDiff_const) have heq : (fun x => G (p, x)) = H ∘ j := by funext y simp [H, j] rw [heq, j.iteratedFDeriv_comp_right hH x (i := n) (by exact WithTop.coe_le_coe.mpr le_top)] apply (ContinuousMultilinearMap.norm_compContinuousLinearMap_le _ _).trans have hj : ‖j‖ ≤ 1 := ContinuousLinearMap.norm_inr_le_one ℝ P E have hprod : (∏ _i : Fin n, ‖j‖) ≤ 1 := Finset.prod_le_one₀ (fun _ _ => norm_nonneg j) (fun _ _ => hj) calc _ ≤ ‖iteratedFDeriv ℝ n H (j x)‖ * 1 := mul_le_mul_of_nonneg_left hprod (norm_nonneg _) _ = _ := by simp only [mul_one, H, iteratedFDeriv_comp_add_right] simp [j] end Bounty end section /- Quantitative tails obtained from actual integrable Schwartz moments. -/ open MeasureTheory namespace Bounty theorem euclidean_schwartz_norm_tail_le_moment {N : ℕ} (g : SchwartzMap (EuclideanSpace ℝ (Fin N)) ℂ) (M : ℕ) {R : ℝ} (hR : 0 < R) : (∫ x in {x : EuclideanSpace ℝ (Fin N) | R < ‖x‖}, ‖g x‖) ≤ (∫ x : EuclideanSpace ℝ (Fin N), ‖x‖ ^ M * ‖g x‖) / R ^ M := by have hs : MeasurableSet {x : EuclideanSpace ℝ (Fin N) | R < ‖x‖} := (isOpen_lt continuous_const continuous_norm).measurableSet have hw := g.integrable_pow_mul volume M have hcomp : (∫ x in {x : EuclideanSpace ℝ (Fin N) | R < ‖x‖}, R ^ M * ‖g x‖) ≤ ∫ x in {x : EuclideanSpace ℝ (Fin N) | R < ‖x‖}, ‖x‖ ^ M * ‖g x‖ := by apply setIntegral_mono_on (g.integrable.norm.const_mul (R ^ M)).integrableOn hw.integrableOn hs intro x hx exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hR.le hx.le M) (norm_nonneg _) rw [integral_const_mul] at hcomp have hwhole : (∫ x in {x : EuclideanSpace ℝ (Fin N) | R < ‖x‖}, ‖x‖ ^ M * ‖g x‖) ≤ ∫ x : EuclideanSpace ℝ (Fin N), ‖x‖ ^ M * ‖g x‖ := by exact setIntegral_le_integral hw (Filter.Eventually.of_forall (fun x => mul_nonneg (pow_nonneg (norm_nonneg x) M) (norm_nonneg (g x)))) apply (le_div_iff₀ (pow_pos hR M)).2 calc _ = R ^ M * (∫ x in {x : EuclideanSpace ℝ (Fin N) | R < ‖x‖}, ‖g x‖) := mul_comm _ _ _ ≤ _ := hcomp.trans hwhole end Bounty end section /- Scalar costs for the actual candidate allocation slots. The truncation constant may depend on its chosen order; the order threshold does not depend on that constant or on the allocation target and initial scale. -/ open Finset Filter namespace Bounty noncomputable def candidateSlotCostExponent (r : ℕ) (C : ℝ) : ℝ := (1 / Real.log 2 + 1) * (r : ℝ) * Real.log C theorem candidate_slot_cost_exponent_nonneg (r : ℕ) {C : ℝ} (hC : 1 ≤ C) : 0 ≤ candidateSlotCostExponent r C := by unfold candidateSlotCostExponent exact mul_nonneg (mul_nonneg (by positivity) (Nat.cast_nonneg _)) (Real.log_nonneg hC) theorem eventually_candidate_slot_power_le_rpow {c C : ℝ} (hc : 0 < c) (hC : 1 ≤ C) (r : ℕ) : ∀ᶠ L : ℝ in atTop, C ^ ((candidateQIndices c L).card * r) ≤ L ^ candidateSlotCostExponent r C := by filter_upwards [eventually_candidateQIndices_geometry hc, eventually_gt_atTop (0 : ℝ)] with L hgeom hL have hp := group_product_bound_of_log_card (candidateQIndices c L) (fun _ => C ^ r) (one_le_pow₀ hC) hL (fun _ _ => pow_nonneg (by linarith) _) (fun _ _ => le_rfl) hgeom.1 simpa only [prod_const, ← pow_mul, Nat.mul_comm r, Real.log_pow, candidateSlotCostExponent, mul_assoc] using hp theorem all_pattern_truncation_cost_le (N : ℕ) {C D : ℝ} (hC : 1 ≤ C) (hD : 0 ≤ D) : (2 : ℝ) ^ N * N * D * C ^ (N - 1) ≤ D * (4 * C) ^ N := by have hN : (N : ℝ) ≤ (2 : ℝ) ^ N := by exact_mod_cast (Nat.lt_two_pow_self (n := N)).le have hC0 : 0 ≤ C := zero_le_one.trans hC have hp : C ^ (N - 1) ≤ C ^ N := pow_le_pow_right₀ hC (Nat.sub_le _ _) calc _ = D * ((2 : ℝ) ^ N * ((N : ℝ) * C ^ (N - 1))) := by ring _ ≤ D * ((2 : ℝ) ^ N * ((2 : ℝ) ^ N * C ^ N)) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (mul_le_mul hN hp (pow_nonneg hC0 _) (by positivity)) (by positivity)) hD _ = _ := by rw [mul_pow, show (4 : ℝ) = 2 * 2 by norm_num, mul_pow]; ring theorem eventually_candidate_truncation_cost_le {c C D B : ℝ} (hc : 0 < c) (hC : 1 ≤ C) (hD : 0 ≤ D) (r M : ℕ) (hM : candidateSlotCostExponent r (4 * C) + B + 1 ≤ (M : ℝ)) : ∀ᶠ L : ℝ in atTop, (2 : ℝ) ^ ((candidateQIndices c L).card * r) * ((candidateQIndices c L).card * r : ℕ) * D * C ^ ((candidateQIndices c L).card * r - 1) * L ^ (-(M : ℝ)) ≤ L ^ (-B) := by have h4C : 1 ≤ 4 * C := by linarith filter_upwards [eventually_candidate_slot_power_le_rpow hc h4C r, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop D] with L hp hL hDL have hL0 : 0 < L := zero_lt_one.trans_le hL calc _ ≤ (D * (4 * C) ^ ((candidateQIndices c L).card * r)) * L ^ (-(M : ℝ)) := mul_le_mul_of_nonneg_right (all_pattern_truncation_cost_le _ hC hD) (Real.rpow_nonneg hL0.le _) _ ≤ (L * L ^ candidateSlotCostExponent r (4 * C)) * L ^ (-(M : ℝ)) := mul_le_mul_of_nonneg_right (mul_le_mul hDL hp (by positivity) hL0.le) (Real.rpow_nonneg hL0.le _) _ = L ^ (1 + candidateSlotCostExponent r (4 * C) - (M : ℝ)) := by rw [sub_eq_add_neg, Real.rpow_add hL0, Real.rpow_add hL0, Real.rpow_one] _ ≤ L ^ (-B) := Real.rpow_le_rpow_of_exponent_le hL (by linarith) theorem exists_candidate_truncation_order {c C : ℝ} (hc : 0 < c) (hC : 1 ≤ C) (r : ℕ) (B : ℝ) : ∃ M₀ : ℕ, ∀ M : ℕ, M₀ ≤ M → ∀ D : ℝ, 0 ≤ D → ∀ᶠ L : ℝ in atTop, (2 : ℝ) ^ ((candidateQIndices c L).card * r) * ((candidateQIndices c L).card * r : ℕ) * D * C ^ ((candidateQIndices c L).card * r - 1) * L ^ (-(M : ℝ)) ≤ L ^ (-B) := by obtain ⟨M₀, hM₀⟩ := exists_nat_ge (candidateSlotCostExponent r (4 * C) + B + 1) refine ⟨M₀, fun M hM D hD => eventually_candidate_truncation_cost_le hc hC hD r M ?_⟩ exact hM₀.trans (by exact_mod_cast hM) end Bounty end section /- Finite perturbations supported on a boundary set, with arbitrary complex inner sums. -/ open Finset namespace Bounty theorem finite_boundary_perturbation_norm_le (T S : Finset ℕ) (μ : ℕ → ℝ) (ε G : ℕ → ℂ) (hμ : ∀ u, 0 ≤ μ u) (hsupport : ∀ u ∈ T, u ∉ S → ε u = 0) (hε : ∀ u ∈ T ∩ S, ‖ε u‖ ≤ 1) : ‖∑ u ∈ T, (μ u : ℂ) * ε u * G u‖ ≤ ∑ u ∈ S, μ u * ‖G u‖ := by classical have hrestrict : (∑ u ∈ T, (μ u : ℂ) * ε u * G u) = ∑ u ∈ T ∩ S, (μ u : ℂ) * ε u * G u := by symm apply sum_subset inter_subset_left intro u hu hnot have huS : u ∉ S := fun hs => hnot (mem_inter.mpr ⟨hu, hs⟩) rw [hsupport u hu huS, mul_zero, zero_mul] rw [hrestrict] calc _ ≤ ∑ u ∈ T ∩ S, ‖(μ u : ℂ) * ε u * G u‖ := norm_sum_le _ _ _ ≤ ∑ u ∈ T ∩ S, μ u * ‖G u‖ := by apply sum_le_sum intro u hu rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hμ u)] simpa only [mul_one] using mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hε u hu) (hμ u)) (norm_nonneg (G u)) _ ≤ _ := sum_le_sum_of_subset_of_nonneg inter_subset_right (fun u _ _ => mul_nonneg (hμ u) (norm_nonneg (G u))) /- Both sharp and smoothed terms use the same outer finite domain. -/ theorem finite_sharp_smoothed_difference_eq (T W : Finset ℕ) (μ ψ : ℕ → ℝ) (G : ℕ → ℂ) : (∑ u ∈ T ∩ W, (μ u : ℂ) * G u) - (∑ u ∈ T, (μ u : ℂ) * (ψ u : ℂ) * G u) = ∑ u ∈ T, (μ u : ℂ) * (((if u ∈ W then 1 else 0 : ℝ) - ψ u : ℝ) : ℂ) * G u := by classical rw [← filter_mem_eq_inter, sum_filter, ← sum_sub_distrib] apply sum_congr rfl intro u _ by_cases hu : u ∈ W <;> simp only [hu, if_true, if_false, Complex.ofReal_sub, Complex.ofReal_one, Complex.ofReal_zero] <;> ring theorem finite_sharp_smoothed_difference_norm_le (T S W : Finset ℕ) (μ ψ : ℕ → ℝ) (G : ℕ → ℂ) (hμ : ∀ u, 0 ≤ μ u) (hψ : ∀ u ∈ T, 0 ≤ ψ u ∧ ψ u ≤ 1) (hmatch : ∀ u ∈ T, u ∉ S → ψ u = if u ∈ W then 1 else 0) : ‖(∑ u ∈ T ∩ W, (μ u : ℂ) * G u) - (∑ u ∈ T, (μ u : ℂ) * (ψ u : ℂ) * G u)‖ ≤ ∑ u ∈ S, μ u * ‖G u‖ := by rw [finite_sharp_smoothed_difference_eq] apply finite_boundary_perturbation_norm_le T S μ _ G hμ · intro u hu hnot rw [hmatch u hu hnot, sub_self, Complex.ofReal_zero] · intro u hu obtain ⟨hψ0, hψ1⟩ := hψ u (mem_inter.mp hu).1 rw [Complex.norm_real, Real.norm_eq_abs, abs_le] by_cases huW : u ∈ W · simp only [if_pos huW] constructor <;> linarith · simp only [if_neg huW] constructor <;> linarith theorem finite_divisor_sharp_smoothed_difference_norm_le (T S W : Finset ℕ) (μ ψ : ℕ → ℝ) (F : ℕ → ℕ → ℂ) (hμ : ∀ u, 0 ≤ μ u) (hψ : ∀ u ∈ T, 0 ≤ ψ u ∧ ψ u ≤ 1) (hmatch : ∀ u ∈ T, u ∉ S → ψ u = if u ∈ W then 1 else 0) : ‖(∑ u ∈ T ∩ W, (μ u : ℂ) * (∑ m ∈ (2 * u + 1).divisors, F u m)) - (∑ u ∈ T, (μ u : ℂ) * (ψ u : ℂ) * (∑ m ∈ (2 * u + 1).divisors, F u m))‖ ≤ ∑ u ∈ S, μ u * (∑ m ∈ (2 * u + 1).divisors, ‖F u m‖) := by apply (finite_sharp_smoothed_difference_norm_le T S W μ ψ (fun u => ∑ m ∈ (2 * u + 1).divisors, F u m) hμ hψ hmatch).trans apply sum_le_sum intro u _ exact mul_le_mul_of_nonneg_left (norm_sum_le _ _) (hμ u) end Bounty end section /- Include the initial active labels in the same distinctness condition as every later birth. -/ open Classical namespace Bounty def initialAndBirthLabels {I J α : Type*} (initial : I → α) (birth : J → Option α) : I ⊕ J → Option α := Sum.elim (fun i => some (initial i)) birth theorem initial_birth_distinctness_iff {I J α : Type*} (initial : I → α) (birth : J → Option α) : (∀ a b z, initialAndBirthLabels initial birth a = some z → initialAndBirthLabels initial birth b = some z → a = b) ↔ Function.Injective initial ∧ (∀ a b z, birth a = some z → birth b = some z → a = b) ∧ (∀ i j, birth j ≠ some (initial i)) := by constructor · intro h refine ⟨?_, ?_, ?_⟩ · intro i j hij exact Sum.inl.inj (h (.inl i) (.inl j) (initial i) rfl (by change some (initial j) = some (initial i) rw [hij])) · intro a b z ha hb exact Sum.inr.inj (h (.inr a) (.inr b) z ha hb) · intro i j hj have hbad := h (.inl i) (.inr j) (initial i) rfl hj cases hbad · rintro ⟨hinj, hbirth, havoid⟩ a b z ha hb cases a with | inl i => cases b with | inl j => exact congrArg Sum.inl (hinj (Option.some.inj (ha.trans hb.symm))) | inr j => exact False.elim (havoid i j (hb.trans ha.symm)) | inr i => cases b with | inl j => exact False.elim (havoid j i (ha.trans hb.symm)) | inr j => exact congrArg Sum.inr (hbirth i j z ha hb) end Bounty end section /- Dilation enters the original full event through divisibility tests only. Equal tests give an exact event bijection, including fallback targets and caps. -/ open Finset open scoped Classical namespace Bounty section Dilation variable {P : Type*} (n : P → ℕ) (Δ D D' : ℤ) (hD : ∀ p, ((n p : ℤ) ∣ D ↔ (n p : ℤ) ∣ D')) include hD in theorem unrestricted_residue_storage_dilation_congr {t : ℕ} (source : Fin t → P) (stores : Finset (Fin t)) : unrestrictedResidueStorageAllowed n D source stores ↔ unrestrictedResidueStorageAllowed n D' source stores := by simp only [unrestrictedResidueStorageAllowed, hD] def unrestrictedDilationEventMap {t B : ℕ} (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) : UnrestrictedBoundedEvent n Δ D' t B s := ⟨e.1, e.2.1, ⟨{ toFun := fun i => ⟨(e.2.2.1 i).val, by have h := (mem_unrestrictedResidueEligible n Δ D s.2.2 (e.2.2.1 i).val).mp (e.2.2.1 i).property exact (mem_unrestrictedResidueEligible n Δ D' s.2.2 (e.2.2.1 i).val).mpr ⟨h.1, fun hd => h.2 ((hD _).mpr hd)⟩⟩ inj' := by intro i j hij apply e.2.2.1.injective exact Subtype.ext (congrArg (fun z : ↥(unrestrictedResidueEligible n Δ D' s.2.2) => z.val) hij) }, e.2.2.2⟩⟩ def unrestrictedDilationEventEquiv {t B : ℕ} (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : UnrestrictedBoundedEvent n Δ D t B s ≃ UnrestrictedBoundedEvent n Δ D' t B s where toFun := unrestrictedDilationEventMap n Δ D D' hD s invFun := unrestrictedDilationEventMap n Δ D' D (fun p => (hD p).symm) s left_inv e := by rcases e with ⟨stores, promotions, e, fresh⟩; rfl right_inv e := by rcases e with ⟨stores, promotions, e, fresh⟩; rfl theorem unrestricted_dilation_event_target {t B : ℕ} (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) : unrestrictedBoundedEventTarget n Δ D' t B s (unrestrictedDilationEventEquiv n Δ D D' hD s e) = unrestrictedBoundedEventTarget n Δ D t B s e := by rfl theorem unrestricted_dilation_event_weight (μ : P → ℝ) (ρ V : ℝ) {t B : ℕ} (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) : unrestrictedBoundedEventWeight n Δ D' μ ρ V t B s (unrestrictedDilationEventEquiv n Δ D D' hD s e) = unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e := by let out := unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) e.1 e.2.1 e.2.2.1 let mass := unrestrictedEdgeEventMass s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) unrestrictedResidueHit μ ρ V e.1 e.2.1 e.2.2.1 e.2.2.2 change (if unrestrictedResidueStorageAllowed n D' s.1 e.1 ∧ out.1 ≤ B then mass else 0) = (if unrestrictedResidueStorageAllowed n D s.1 e.1 ∧ out.1 ≤ B then mass else 0) by_cases hd : unrestrictedResidueStorageAllowed n D s.1 e.1 · have hd' := (unrestricted_residue_storage_dilation_congr n D D' hD s.1 e.1).mp hd simp only [hd, hd', true_and] · have hd' : ¬ unrestrictedResidueStorageAllowed n D' s.1 e.1 := fun h => hd ((unrestricted_residue_storage_dilation_congr n D D' hD s.1 e.1).mpr h) simp only [hd, hd', false_and, ite_false] end Dilation end Bounty end section /- Uniform polynomial derivative bounds on fixed compact support control all Schwartz seminorms. -/ open Finset MeasureTheory open scoped FourierTransform namespace Bounty variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] theorem schwartz_domain_seminorm_polynomial_of_fixed_support {I : Type*} (f : I → SchwartzMap E ℂ) (w : I → ℝ) (hw : ∀ p, 1 ≤ w p) (R : ℝ) (hR : 0 ≤ R) (hsupport : ∀ p, tsupport (f p) ⊆ Metric.closedBall 0 R) (hderiv : ∀ n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p x, ‖iteratedFDeriv ℝ n (f p) x‖ ≤ C*(w p)^d) : ∀ k n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, SchwartzMap.seminorm ℂ k n (f p) ≤ C*(w p)^d := by intro k n obtain ⟨d,C,hC,hbound⟩ := hderiv n refine ⟨d,R^k*C,mul_nonneg (pow_nonneg hR _) hC,?_⟩ intro p have hwp : 0 ≤ w p := zero_le_one.trans (hw p) apply SchwartzMap.seminorm_le_bound ℂ k n (f p) (by positivity) intro x by_cases hz : iteratedFDeriv ℝ n (f p) x = 0 · rw [hz, norm_zero, mul_zero] positivity · have hx : x ∈ tsupport (f p) := (support_iteratedFDeriv_subset n) hz have hxR : ‖x‖ ≤ R := by simpa only [Metric.mem_closedBall, dist_zero_right] using hsupport p hx calc _ ≤ R^k*(C*(w p)^d) := mul_le_mul (pow_le_pow_left₀ (norm_nonneg _) hxR _) (hbound p x) (norm_nonneg _) (pow_nonneg hR _) _ = _ := by ring theorem continuous_schwartz_domain_seminorm_polynomial {I : Type*} (f : I → SchwartzMap E ℂ) (w : I → ℝ) (hw : ∀ p, 1 ≤ w p) (hsemi : ∀ k n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, SchwartzMap.seminorm ℂ k n (f p) ≤ C*(w p)^d) (q : Seminorm ℂ (SchwartzMap E ℂ)) (hq : Continuous q) : ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, q (f p) ≤ C*(w p)^d := by classical choose d C hC hbound using hsemi obtain ⟨s,K,hK,hqK⟩ := Seminorm.bound_of_continuous (schwartz_withSeminorms ℂ E ℂ) q hq let D := s.sup (fun kn => d kn.1 kn.2) let M := ∑ kn ∈ s, C kn.1 kn.2 have hM : 0 ≤ M := sum_nonneg (fun kn _ => hC kn.1 kn.2) refine ⟨D,(K : ℝ)*M,mul_nonneg K.coe_nonneg hM,?_⟩ intro p have hwp : 0 ≤ w p := zero_le_one.trans (hw p) have hs : s.sup (schwartzSeminormFamily ℂ E ℂ) (f p) ≤ M*(w p)^D := by apply Seminorm.finset_sup_apply_le (by positivity) intro kn hkn have hCM : C kn.1 kn.2 ≤ M := single_le_sum (fun kn _ => hC kn.1 kn.2) hkn have hdD : d kn.1 kn.2 ≤ D := Finset.le_sup (f := fun kn => d kn.1 kn.2) hkn exact (hbound kn.1 kn.2 p).trans (mul_le_mul hCM (pow_le_pow_right₀ (hw p) hdD) (pow_nonneg (zero_le_one.trans (hw p)) _) hM) calc _ ≤ (K : ℝ)*s.sup (schwartzSeminormFamily ℂ E ℂ) (f p) := hqK (f p) _ ≤ (K : ℝ)*(M*(w p)^D) := mul_le_mul_of_nonneg_left hs K.coe_nonneg _ = _ := by ring end Bounty end section /- Removing a simple prime factor deletes exactly that prime from its divisor pool. -/ open Finset namespace Bounty theorem physical_divisor_pool_div_simple_prime {G : Type*} (P : G → Finset ℕ) (g : G) (hP : ∀ r ∈ P g, r.Prime) {n p : ℕ} (hp : p ∈ P g) (hpn : p ∣ n) (hpp : ¬ p ^ 2 ∣ n) : physicalDivisorPool P g ((n / p : ℕ) : ℤ) = (physicalDivisorPool P g (n : ℤ)).erase p := by classical have hpprime := hP p hp have hmul : n / p * p = n := Nat.div_mul_cancel hpn have hpnot : ¬ p ∣ n / p := by intro h apply hpp have hd := Nat.mul_dvd_mul_right h p simpa only [← pow_two, hmul] using hd ext r simp only [physicalDivisorPool, mem_filter, mem_erase, Int.natCast_dvd_natCast] constructor · rintro ⟨hr, hrn⟩ refine ⟨?_, hr, dvd_trans hrn (Nat.div_dvd_of_dvd hpn)⟩ intro he subst r exact hpnot hrn · rintro ⟨hrp, hr, hrn⟩ refine ⟨hr, ?_⟩ rw [← hmul] at hrn rcases (hP r hr).dvd_mul.mp hrn with hq | hpdiv · exact hq · rcases (Nat.dvd_prime hpprime).mp hpdiv with hone | heq · exact False.elim ((hP r hr).ne_one hone) · exact False.elim (hrp heq) theorem physical_omega_div_simple_prime {G : Type*} (P : G → Finset ℕ) (g : G) (hP : ∀ r ∈ P g, r.Prime) {n p : ℕ} (hp : p ∈ P g) (hpn : p ∣ n) (hpp : ¬ p ^ 2 ∣ n) : physicalOmega P g ((n / p : ℕ) : ℤ) = physicalOmega P g (n : ℤ) - 1 := by unfold physicalOmega rw [physical_divisor_pool_div_simple_prime P g hP hp hpn hpp, card_erase_of_mem] exact mem_filter.mpr ⟨hp, by exact_mod_cast hpn⟩ theorem physical_divisor_pool_div_other_prime {G : Type*} (P : G → Finset ℕ) (g : G) (hP : ∀ r ∈ P g, r.Prime) {n p : ℕ} (hp : p.Prime) (hpout : p ∉ P g) (hpn : p ∣ n) : physicalDivisorPool P g ((n / p : ℕ) : ℤ) = physicalDivisorPool P g (n : ℤ) := by classical have hmul : n / p * p = n := Nat.div_mul_cancel hpn ext r simp only [physicalDivisorPool, mem_filter, Int.natCast_dvd_natCast] constructor · rintro ⟨hr, hrn⟩ exact ⟨hr, dvd_trans hrn (Nat.div_dvd_of_dvd hpn)⟩ · rintro ⟨hr, hrn⟩ refine ⟨hr, ?_⟩ rw [← hmul] at hrn rcases (hP r hr).dvd_mul.mp hrn with hq | hpdiv · exact hq · rcases (Nat.dvd_prime hp).mp hpdiv with hone | heq · exact False.elim ((hP r hr).ne_one hone) · exact False.elim (hpout (heq ▸ hr)) end Bounty end section /- Extending a birth label by none creates no performed births or collisions outside its embedded addresses. -/ open Classical namespace Bounty noncomputable def optionalBirthExtension {A B Z : Type*} (e : A ↪ B) (label : A → Option Z) : B → Option Z := Function.extend e label (fun _ => none) section variable {A B Z : Type*} (e : A ↪ B) (label : A → Option Z) include A B Z e label theorem optional_birth_extension_apply (a : A) : optionalBirthExtension e label (e a) = label a := e.injective.extend_apply label (fun _ => none) a theorem optional_birth_extension_none (b : B) (hb : ¬∃ a, e a = b) : optionalBirthExtension e label b = none := Function.extend_apply' label (fun _ => none) b hb theorem optional_birth_extension_some_iff (b : B) (z : Z) : optionalBirthExtension e label b = some z ↔ ∃ a, e a = b ∧ label a = some z := by constructor · intro h by_cases hb : ∃ a, e a = b · obtain ⟨a, rfl⟩ := hb exact ⟨a, rfl, (optional_birth_extension_apply e label a).symm.trans h⟩ · rw [optional_birth_extension_none e label b hb] at h cases h · rintro ⟨a, rfl, h⟩ exact (optional_birth_extension_apply e label a).trans h theorem optional_birth_extension_distinct_iff : (∀ a b z, optionalBirthExtension e label a = some z → optionalBirthExtension e label b = some z → a = b) ↔ (∀ a b z, label a = some z → label b = some z → a = b) := by constructor · intro h a b z ha hb apply e.injective exact h (e a) (e b) z ((optional_birth_extension_apply e label a).trans ha) ((optional_birth_extension_apply e label b).trans hb) · intro h a b z ha hb obtain ⟨a', rfl, ha'⟩ := (optional_birth_extension_some_iff e label a z).mp ha obtain ⟨b', rfl, hb'⟩ := (optional_birth_extension_some_iff e label b z).mp hb exact congrArg e (h a' b' z ha' hb') theorem optional_birth_extension_all_iff (Q : Z → Prop) : (∀ b z, optionalBirthExtension e label b = some z → Q z) ↔ (∀ a z, label a = some z → Q z) := by constructor · intro h a z ha exact h (e a) z ((optional_birth_extension_apply e label a).trans ha) · intro h b z hb obtain ⟨a, _, ha⟩ := (optional_birth_extension_some_iff e label b z).mp hb exact h a z ha end theorem optional_birth_extension_map {A B Z Y : Type*} (e : A ↪ B) (label : A → Option Z) (f : Z → Y) (b : B) : (optionalBirthExtension e label b).map f = optionalBirthExtension e (fun a => (label a).map f) b := by by_cases hb : ∃ a, e a = b · obtain ⟨a, rfl⟩ := hb rw [optional_birth_extension_apply, optional_birth_extension_apply] · rw [optional_birth_extension_none e label b hb, optional_birth_extension_none e (fun a => (label a).map f) b hb] rfl end Bounty end section /- Quantitative additive/logarithmic kernel comparison on positive dyadic centers. -/ open scoped NNReal namespace Bounty theorem abs_log_one_add_sub_self_le {x : ℝ} (hx : |x| ≤ 1 / 2) : |Real.log (1 + x) - x| ≤ 2 * x ^ 2 := by have hh := Real.abs_log_sub_add_sum_range_le (x := -x) (by simpa only [abs_neg] using (lt_of_le_of_lt hx (by norm_num : (1 : ℝ) / 2 < 1))) 1 simp only [Finset.sum_range_one, Nat.cast_zero, zero_add, pow_one, div_one, sub_neg_eq_add, abs_neg] at hh have hden : 0 < 1 - |x| := by linarith have hb : |x| ^ 2 / (1 - |x|) ≤ 2 * x ^ 2 := by apply (div_le_iff₀ hden).mpr rw [sq_abs] nlinarith [sq_nonneg x, mul_nonneg (sq_nonneg x) (show 0 ≤ 1 - 2 * |x| by linarith)] have hh' : |Real.log (1 + x) - x| ≤ |x|^2 / (1-|x|) := by simpa only [neg_add_eq_sub] using hh exact hh'.trans hb theorem additive_log_displacement_bound {w v : ℝ} (hv : 0 < v) (hclose : |w - v| ≤ v / 2) : |(w - v) - v * Real.log (w / v)| ≤ 2 * (w - v) ^ 2 / v := by have hx : |(w - v) / v| ≤ 1 / 2 := by rw [abs_div, abs_of_pos hv] exact (div_le_iff₀ hv).mpr (by linarith) have ht := abs_log_one_add_sub_self_le hx have harg : 1 + (w - v) / v = w / v := by field_simp; ring rw [harg] at ht calc _ = |v * (Real.log (w / v) - (w - v) / v)| := by rw [abs_sub_comm] congr 1 field_simp _ = v * |Real.log (w / v) - (w - v) / v| := by rw [abs_mul, abs_of_pos hv] _ ≤ v * (2 * ((w - v) / v) ^ 2) := mul_le_mul_of_nonneg_left ht hv.le _ = _ := by field_simp theorem normalized_additive_log_displacement_bound {w v H : ℝ} (hv : 0 < v) (hH : 0 < H) (hclose : |w - v| ≤ v / 2) : |(w - v) / H - v * Real.log (w / v) / H| ≤ 2 * (w - v) ^ 2 / (v * H) := by rw [← sub_div, abs_div, abs_of_pos hH] exact (div_le_div_of_nonneg_right (additive_log_displacement_bound hv hclose) hH.le).trans_eq (by ring) theorem normalized_log_displacement_dyadic_bound {w v H Y R : ℝ} (hY : 0 < Y) (hH : 0 < H) (_hR : 0 ≤ R) (hv : Y / 2 ≤ v) (hsmall : R * H ≤ Y / 4) (hclose : |w - v| ≤ R * H) : |(w - v) / H - v * Real.log (w / v) / H| ≤ 4 * R ^ 2 * H / Y := by have hv0 : 0 < v := by linarith have hc : |w-v| ≤ v/2 := by linarith apply (normalized_additive_log_displacement_bound hv0 hH hc).trans apply (div_le_div_iff₀ (mul_pos hv0 hH) hY).mpr have hs : (w-v)^2 ≤ (R*H)^2 := by simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg (w-v)) hclose 2 have hmul : R^2*H^2*Y ≤ 2*R^2*H^2*v := by nlinarith [mul_nonneg (sq_nonneg R) (sq_nonneg H), mul_nonneg (mul_nonneg (sq_nonneg R) (sq_nonneg H)) (show 0≤2*v-Y by linarith)] nlinarith [mul_le_mul_of_nonneg_right hs hY.le] theorem lipschitz_log_kernel_comparison {K : ℝ → ℂ} {C : ℝ≥0} (hK : LipschitzWith C K) {w v H Y R : ℝ} (hY : 0 < Y) (hH : 0 < H) (hR : 0 ≤ R) (hv : Y / 2 ≤ v) (hsmall : R * H ≤ Y / 4) (hclose : |w - v| ≤ R * H) : ‖K ((w-v)/H) - K (v*Real.log (w/v)/H)‖ ≤ (C : ℝ) * (4*R^2*H/Y) := by exact (hK.norm_sub_le _ _).trans (mul_le_mul_of_nonneg_left (by simpa only [Real.norm_eq_abs] using normalized_log_displacement_dyadic_bound hY hH hR hv hsmall hclose) C.coe_nonneg) end Bounty end section /- Variable-length ordered mark lists and their exact divisor-pool fibers. -/ open Finset namespace Bounty abbrev GroupMarkedLists {G : Type*} (P : G → Finset ℕ) (t : G → ℕ) := ∀ g, Fin (t g) ↪ ↥(P g) abbrev GroupMarkedListsAt {G : Type*} (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) := {L : GroupMarkedLists P t // ∀ g s, ((L g s).val : ℤ) ∣ n} def groupMarkedListsAtEquiv {G : Type*} (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) : GroupMarkedListsAt P t n ≃ (∀ g, Fin (t g) ↪ ↥(physicalDivisorPool P g n)) where toFun L g := { toFun := fun s => ⟨(L.val g s).val, mem_filter.mpr ⟨(L.val g s).property, L.property g s⟩⟩ inj' := by intro i j h apply (L.val g).injective exact Subtype.ext (congrArg (fun p : ↥(physicalDivisorPool P g n) => p.val) h) } invFun L := ⟨fun g => { toFun := fun s => ⟨(L g s).val, (mem_filter.mp (L g s).property).1⟩ inj' := by intro i j h apply (L g).injective exact Subtype.ext (congrArg (fun p : ↥(P g) => p.val) h) }, fun g s => (mem_filter.mp (L g s).property).2⟩ left_inv L := by apply Subtype.ext funext g apply Function.Embedding.ext intro s rfl right_inv L := by funext g apply Function.Embedding.ext intro s rfl theorem group_marked_lists_at_card {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) : Nat.card (GroupMarkedListsAt P t n) = ∏ g, (physicalOmega P g n).descFactorial (t g) := by classical rw [Nat.card_congr (groupMarkedListsAtEquiv P t n), Nat.card_eq_fintype_card, Fintype.card_pi] apply prod_congr rfl intro g _ rw [Fintype.card_embedding_eq] simp only [Fintype.card_coe, Fintype.card_fin, physicalOmega] theorem marked_divisor_weight_eq_fiber_mass {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (n : ℤ) : markedDivisorWeight univ P q V t n = (∏ g, q ^ (physicalOmega P g n - t g) / V g ^ t g) * (Nat.card (GroupMarkedListsAt P t n) : ℝ) := by classical rw [group_marked_lists_at_card, Nat.cast_prod, ← prod_mul_distrib] unfold markedDivisorWeight markedDivisorFactor apply prod_congr rfl intro g _ ring end Bounty end section /- The full big-active projection is self-adjoint for the original product memory measure. This identity does not move any small-tail endpoint gate. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P Z : G → Type*} include G sharedInstance1 sharedInstance2 P Z theorem fullActiveAverage_pairing [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {M : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (f h : ProductBoundedOrderedState P Z M B → ℂ) : (∑ x, (productMemoryWeight μ ν x : ℂ) * f x * fullActiveAverage h x) = ∑ x, (productMemoryWeight μ ν x : ℂ) * fullActiveAverage f x * h x := by simp only [fullActiveAverage, mul_sum, sum_mul] rw [sum_comm] conv_rhs => rw [sum_comm] let inv : FullActiveSlotPermutations M ≃ FullActiveSlotPermutations M := Equiv.piCongrRight (fun _ => Equiv.inv _) have hi := inv.sum_comp (fun τ : FullActiveSlotPermutations M => ∑ x, (productMemoryWeight μ ν x : ℂ) * ((fullActivePermutationWeight M τ : ℂ) * f (fullActivePermutation τ x)) * h x) rw [← hi] apply sum_congr rfl intro τ _ have hx := (fullActivePermutation τ).sum_comp (fun x => (productMemoryWeight μ ν x : ℂ) * ((fullActivePermutationWeight M (inv τ) : ℂ) * f ((fullActivePermutation τ).symm x)) * h x) have he : fullActivePermutation (P := P) (Z := Z) (B := B) (inv τ) = (fullActivePermutation τ).symm := by apply Equiv.ext intro x rfl simp only [fullActivePermutation_weight, Equiv.symm_apply_apply] at hx rw [he] calc _ = ∑ x, (productMemoryWeight μ ν x : ℂ) * ((fullActivePermutationWeight M (inv τ) : ℂ) * f x) * h (fullActivePermutation τ x) := by apply sum_congr rfl intro x _ unfold fullActivePermutationWeight ring _ = _ := hx theorem fullActiveAverage_conj {M : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z M B → ℂ) (x) : fullActiveAverage (fun y => (starRingEnd ℂ) (f y)) x = (starRingEnd ℂ) (fullActiveAverage f x) := by simp only [fullActiveAverage, map_sum, map_mul, Complex.conj_ofReal] theorem fullActiveAverage_self_adjoint [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {M : G → ℕ} {B : ℕ} (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (f h : ProductBoundedOrderedState P Z M B → ℂ) : (∑ x, (productMemoryWeight μ ν x : ℂ) * (starRingEnd ℂ) (f x) * fullActiveAverage h x) = ∑ x, (productMemoryWeight μ ν x : ℂ) * (starRingEnd ℂ) (fullActiveAverage f x) * h x := by simpa only [fullActiveAverage_conj] using fullActiveAverage_pairing μ ν (fun x => (starRingEnd ℂ) (f x)) h end end Bounty end section /- Uniform integrable Fourier envelopes for compact families with two controlled derivatives. -/ open MeasureTheory Set Real open scoped FourierTransform namespace Bounty theorem compact_integral_norm_bound (f : ℝ → ℂ) (R C : ℝ) (hs : ∀ x, x ∉ Icc (-R) R → f x = 0) (hb : ∀ x, ‖f x‖ ≤ C) : (∫ x, ‖f x‖) ≤ C * volume.real (Icc (-R) R) := by rw [← setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx => by rw [hs x hx, norm_zero])] calc _ ≤ ‖∫ x in Icc (-R) R, ‖f x‖‖ := le_abs_self _ _ ≤ _ := norm_setIntegral_le_of_norm_le_const (measure_Icc_lt_top) (fun x _ => by simpa only [norm_norm] using hb x) theorem schwartz_fourier_deriv_formula (f : SchwartzMap ℝ ℂ) (s : ℝ) : 𝓕 (SchwartzMap.derivCLM ℂ ℂ f) s = (2 * (Real.pi : ℂ) * Complex.I * (s : ℂ)) * 𝓕 f s := by rw [SchwartzMap.fourier_coe] change 𝓕 (deriv f) s = _ rw [Real.fourier_deriv f.integrable f.differentiable (SchwartzMap.derivCLM ℂ ℂ f).integrable] rfl theorem compact_schwartz_fourier_envelope {ι : Type*} (f : ι → SchwartzMap ℝ ℂ) (R C₀ C₂ : ℝ) (hC₀ : 0 ≤ C₀) (hC₂ : 0 ≤ C₂) (hs : ∀ i x, x ∉ Icc (-R) R → f i x = 0) (hs₂ : ∀ i x, x ∉ Icc (-R) R → SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ (f i)) x = 0) (h₀ : ∀ i x, ‖f i x‖ ≤ C₀) (h₂ : ∀ i x, ‖SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ (f i)) x‖ ≤ C₂) : ∃ C : ℝ, 0 ≤ C ∧ Integrable (fun s : ℝ => C/(1+s^2)) ∧ ∀ i s, ‖𝓕 (f i) s‖ ≤ C/(1+s^2) := by let V := volume.real (Icc (-R) R) refine ⟨(C₀+C₂)*V, mul_nonneg (add_nonneg hC₀ hC₂) (ENNReal.toReal_nonneg), ?_, ?_⟩ · simpa only [div_eq_mul_inv] using integrable_inv_one_add_sq.const_mul ((C₀+C₂)*V) intro i s have hf : ‖𝓕 (f i) s‖ ≤ C₀*V := by apply (VectorFourier.norm_fourierIntegral_le_integral_norm _ _ _ _ _).trans exact compact_integral_norm_bound (f i) R C₀ (hs i) (h₀ i) have hd : ‖𝓕 (SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ (f i))) s‖ ≤ C₂*V := by apply (VectorFourier.norm_fourierIntegral_le_integral_norm _ _ _ _ _).trans exact compact_integral_norm_bound _ R C₂ (hs₂ i) (h₂ i) rw [schwartz_fourier_deriv_formula, schwartz_fourier_deriv_formula] at hd simp only [norm_mul, Complex.norm_ofNat, Complex.norm_real, Real.norm_eq_abs, abs_of_pos pi_pos, Complex.norm_I, mul_one] at hd have hp : 1 ≤ (2*Real.pi)^2 := by nlinarith [two_le_pi] have hn : 0 ≤ s^2*‖𝓕 (f i) s‖ := mul_nonneg (sq_nonneg _) (norm_nonneg _) have hd' : s^2*‖𝓕 (f i) s‖ ≤ C₂*V := by calc _ ≤ (2*Real.pi)^2*(s^2*‖𝓕 (f i) s‖) := by simpa only [one_mul] using mul_le_mul_of_nonneg_right hp hn _ = 2*Real.pi* |s| *(2*Real.pi* |s| *‖𝓕 (f i) s‖) := by rw [← sq_abs s]; ring _ ≤ _ := hd apply (le_div_iff₀ (by positivity : 0 < 1+s^2)).mpr nlinarith end Bounty end section /- Schwartz decay controls polynomial weights uniformly over scales bounded away from zero. -/ open Real namespace Bounty theorem schwartz_scaled_polynomial_weight_bound (f : SchwartzMap ℝ ℂ) (j k : ℕ) {a : ℝ} (ha : 0 < a) : ∃ C : ℝ, 0 ≤ C ∧ ∀ t : ℝ, a ≤ t → ∀ v : ℝ, (1+v^2)^((j : ℝ)/4) * |t*v|^k * ‖f (t*v)‖ ≤ C := by let Q : ℝ := 1+a⁻¹ have hQ : 1 ≤ Q := by dsimp [Q]; exact le_add_of_nonneg_right (inv_nonneg.mpr ha.le) let B : ℝ := 2^(2*j+k) * (Finset.Iic (2*j+k,0)).sup (fun m : ℕ × ℕ => SchwartzMap.seminorm ℂ m.1 m.2) f have hB : 0 ≤ B := by dsimp [B]; positivity refine ⟨Q^(2*j)*B, mul_nonneg (pow_nonneg (by linarith) _) hB, ?_⟩ intro t ht v have ht0 : 0 < t := ha.trans_le ht have hx : |v| ≤ Q*|t*v| := by rw [abs_mul, abs_of_pos ht0] have hqt : 1 ≤ Q*t := by have hat : a⁻¹*a ≤ a⁻¹*t := mul_le_mul_of_nonneg_left ht (inv_nonneg.mpr ha.le) rw [inv_mul_cancel₀ ha.ne'] at hat dsimp [Q] nlinarith nlinarith [abs_nonneg v] have hbase : 1+v^2 ≤ Q^2*(1+|t*v|)^2 := by have hlin : 1+|v| ≤ Q*(1+|t*v|) := by nlinarith have hp := pow_le_pow_left₀ (show 0 ≤ 1+|v| by positivity) hlin 2 rw [mul_pow] at hp nlinarith [sq_abs v, abs_nonneg v] have hweight : (1+v^2)^((j : ℝ)/4) ≤ Q^(2*j)*(1+|t*v|)^(2*j) := by calc _ ≤ (1+v^2)^(j : ℝ) := rpow_le_rpow_of_exponent_le (by nlinarith [sq_nonneg v]) (by have hj : (0 : ℝ) ≤ j := Nat.cast_nonneg _; linarith) _ = (1+v^2)^j := rpow_natCast _ _ _ ≤ (Q^2*(1+|t*v|)^2)^j := pow_le_pow_left₀ (by positivity) hbase _ _ = _ := by rw [mul_pow, ← pow_mul, ← pow_mul] have hdecay : (1+|t*v|)^(2*j+k)*‖f (t*v)‖ ≤ B := by simpa only [norm_iteratedFDeriv_zero, Real.norm_eq_abs] using (SchwartzMap.one_add_le_sup_seminorm_apply (𝕜 := ℂ) (m := (2*j+k,0)) (k := 2*j+k) (n := 0) le_rfl le_rfl f (t*v)) calc _ ≤ (Q^(2*j)*(1+|t*v|)^(2*j)) * (1+|t*v|)^k * ‖f (t*v)‖ := by gcongr exact le_add_of_nonneg_left zero_le_one _ = Q^(2*j)*((1+|t*v|)^(2*j+k)*‖f (t*v)‖) := by rw [pow_add]; ring _ ≤ Q^(2*j)*B := mul_le_mul_of_nonneg_left hdecay (pow_nonneg (by linarith) _) end Bounty end section /- Two explicit derivatives of a Schwartz profile at an exponential scale. -/ namespace Bounty noncomputable def exponentialProfileArgument (v u : ℝ) : ℝ := Real.exp (-u)*v/(2*Real.pi) noncomputable def exponentialProfile (g f : SchwartzMap ℝ ℂ) (v u : ℝ) : ℂ := g u * f (exponentialProfileArgument v u) noncomputable def exponentialProfileFirst (g f : SchwartzMap ℝ ℂ) (v u : ℝ) : ℂ := deriv g u * f (exponentialProfileArgument v u) - g u * (exponentialProfileArgument v u : ℂ) * deriv f (exponentialProfileArgument v u) noncomputable def exponentialProfileSecond (g f : SchwartzMap ℝ ℂ) (v u : ℝ) : ℂ := deriv (deriv g) u * f (exponentialProfileArgument v u) + (g u - 2*deriv g u) * (exponentialProfileArgument v u : ℂ) * deriv f (exponentialProfileArgument v u) + g u * (exponentialProfileArgument v u : ℂ)^2 * deriv (deriv f) (exponentialProfileArgument v u) theorem exponential_profile_argument_hasDerivAt (v u : ℝ) : HasDerivAt (exponentialProfileArgument v) (-exponentialProfileArgument v u) u := by have h : HasDerivAt (fun z : ℝ => Real.exp (-z)*v/(2*Real.pi)) (Real.exp (-u)*(-1)*v/(2*Real.pi)) u := (((Real.hasDerivAt_exp (-u)).comp u (hasDerivAt_neg u)).mul_const v).div_const (2*Real.pi) have he : -exponentialProfileArgument v u = Real.exp (-u)*(-1)*v/(2*Real.pi) := by unfold exponentialProfileArgument ring rw [he] exact h theorem exponential_profile_hasDerivAt (g f : SchwartzMap ℝ ℂ) (v u : ℝ) : HasDerivAt (exponentialProfile g f v) (exponentialProfileFirst g f v u) u := by have hx := exponential_profile_argument_hasDerivAt v u have hf := (f.hasDerivAt (exponentialProfileArgument v u)).scomp u hx have he : exponentialProfileFirst g f v u = deriv g u*f (exponentialProfileArgument v u) + g u*((-exponentialProfileArgument v u) • deriv f (exponentialProfileArgument v u)) := by simp only [exponentialProfileFirst,Complex.real_smul,Complex.ofReal_neg] ring rw [he] exact (g.hasDerivAt u).mul hf theorem exponential_profile_first_hasDerivAt (g f : SchwartzMap ℝ ℂ) (v u : ℝ) : HasDerivAt (exponentialProfileFirst g f v) (exponentialProfileSecond g f v u) u := by let x := exponentialProfileArgument v u have hx := exponential_profile_argument_hasDerivAt v u have hxC := hx.ofReal_comp have hg := g.hasDerivAt u have hg' : HasDerivAt (deriv g) (deriv (deriv g) u) u := (SchwartzMap.derivCLM ℂ ℂ g).hasDerivAt u have hf := (f.hasDerivAt (exponentialProfileArgument v u)).scomp u hx have hf' : HasDerivAt (fun z => deriv f (exponentialProfileArgument v z)) ((-x) • deriv (deriv f) x) u := ((SchwartzMap.derivCLM ℂ ℂ f).hasDerivAt (exponentialProfileArgument v u)).scomp u hx have he : exponentialProfileSecond g f v u = (deriv (deriv g) u*f x+deriv g u*((-x) • deriv f x)) - ((deriv g u*(x : ℂ)+g u*((-x : ℝ) : ℂ))*deriv f x+ (g u*(x : ℂ))*((-x) • deriv (deriv f) x)) := by simp only [exponentialProfileSecond,Complex.real_smul,Complex.ofReal_neg] dsimp only [x] ring rw [he] exact (hg'.mul hf).sub ((hg.mul hxC).mul hf') end Bounty end section open MeasureTheory namespace Bounty section variable {K : ℝ → ℝ} {f : ℝ → ℂ} (hK : Continuous K) (hKi : Integrable K) (hK0 : ∀ t, 0 ≤ K t) include K f hK hKi hK0 theorem translated_kernel_square_integrable (hf : Continuous f) (hf2 : Integrable (fun t => ‖f t‖^2)) : Integrable (fun p : ℝ × ℝ => K (p.1-p.2) * ‖f p.1‖^2) (volume.prod volume) := by have hc : Continuous (fun p : ℝ × ℝ => K (p.1-p.2) * ‖f p.1‖^2) := by fun_prop apply (integrable_prod_iff hc.aestronglyMeasurable).mpr constructor · filter_upwards [] with t exact (hKi.comp_sub_left t).mul_const _ · have heq : (fun t => ∫ r : ℝ, ‖K (t-r) * ‖f t‖^2‖) = (fun t => (∫ r : ℝ, K r) * ‖f t‖^2) := by funext t simp_rw [Real.norm_of_nonneg (mul_nonneg (hK0 _) (sq_nonneg _))] rw [integral_mul_const, integral_sub_left_eq_self] rw [heq] exact hf2.const_mul _ theorem translated_kernel_square_integral (hf : Continuous f) (hf2 : Integrable (fun t => ‖f t‖^2)) : (∫ p : ℝ × ℝ, K (p.1-p.2) * ‖f p.1‖^2 ∂(volume.prod volume)) = (∫ t : ℝ, K t) * ∫ t : ℝ, ‖f t‖^2 := by rw [integral_prod _ (translated_kernel_square_integrable hK hKi hK0 hf hf2)] simp_rw [integral_mul_const, integral_sub_left_eq_self] exact integral_const_mul _ _ theorem schur_quadratic_bound (hKe : ∀ t, K (-t) = K t) (hf : Continuous f) (hf2 : Integrable (fun t => ‖f t‖^2)) : Integrable (fun p : ℝ × ℝ => K (p.1-p.2) * ‖f p.1‖ * ‖f p.2‖) (volume.prod volume) ∧ (∫ p : ℝ × ℝ, K (p.1-p.2) * ‖f p.1‖ * ‖f p.2‖ ∂(volume.prod volume)) ≤ (∫ t : ℝ, K t) * ∫ t : ℝ, ‖f t‖^2 := by have hleft := translated_kernel_square_integrable hK hKi hK0 hf hf2 have hright : Integrable (fun p : ℝ × ℝ => K (p.1-p.2) * ‖f p.2‖^2) (volume.prod volume) := by have heq : (fun p : ℝ × ℝ => K (p.1-p.2) * ‖f p.2‖^2) = (fun p : ℝ × ℝ => K (p.1-p.2) * ‖f p.1‖^2) ∘ Prod.swap := by funext p dsimp rw [← neg_sub p.1 p.2, hKe] rw [heq] exact hleft.swap have hmaj := (hleft.add hright).div_const 2 have hpoint (p : ℝ × ℝ) : K (p.1-p.2) * ‖f p.1‖ * ‖f p.2‖ ≤ (K (p.1-p.2) * ‖f p.1‖^2 + K (p.1-p.2) * ‖f p.2‖^2) / 2 := by nlinarith [mul_nonneg (hK0 (p.1-p.2)) (sq_nonneg (‖f p.1‖-‖f p.2‖))] have hcross : Integrable (fun p : ℝ × ℝ => K (p.1-p.2) * ‖f p.1‖ * ‖f p.2‖) (volume.prod volume) := by apply hmaj.mono' (by fun_prop) filter_upwards [] with p rw [Real.norm_of_nonneg (mul_nonneg (mul_nonneg (hK0 _) (norm_nonneg _)) (norm_nonneg _))] exact hpoint p refine ⟨hcross, (integral_mono hcross hmaj hpoint).trans_eq ?_⟩ change (∫ p : ℝ × ℝ, (K (p.1-p.2) * ‖f p.1‖^2 + K (p.1-p.2) * ‖f p.2‖^2) / 2 ∂(volume.prod volume)) = _ rw [integral_div, integral_add hleft hright] have hr : (∫ p : ℝ × ℝ, K (p.1-p.2) * ‖f p.2‖^2 ∂(volume.prod volume)) = ∫ p : ℝ × ℝ, K (p.1-p.2) * ‖f p.1‖^2 ∂(volume.prod volume) := by rw [← MeasureTheory.integral_prod_swap] apply integral_congr_ae filter_upwards [] with p dsimp rw [← neg_sub p.1 p.2, hKe] rw [hr, translated_kernel_square_integral hK hKi hK0 hf hf2] ring end end Bounty end section open scoped BigOperators ComplexConjugate open MeasureTheory namespace Bounty theorem complex_finite_norm_sq {ι : Type*} (s : Finset ι) (z : ι → ℂ) : ‖∑ i ∈ s, z i‖ ^ 2 = ∑ i ∈ s, ∑ j ∈ s, (z i * conj (z j)).re := by have h := congrArg Complex.re (Complex.mul_conj' (∑ i ∈ s, z i)) simp only [map_sum, Finset.sum_mul, Finset.mul_sum, Complex.re_sum, ← Complex.ofReal_pow, Complex.ofReal_re] at h exact h.symm.trans (Finset.sum_comm) theorem interval_finite_gram_energy {ι : Type*} (s : Finset ι) (u : ι → ℝ → ℂ) (c : ι → ℂ) (a b : ℝ) (hu : ∀ i ∈ s, Continuous (u i)) : (∫ t in a..b, ‖∑ i ∈ s, c i * u i t‖ ^ 2) = ∑ i ∈ s, ∑ j ∈ s, (c i * conj (c j) * (∫ t in a..b, u i t * conj (u j t))).re := by simp_rw [complex_finite_norm_sq] rw [intervalIntegral.integral_finsetSum] · apply Finset.sum_congr rfl intro i hi rw [intervalIntegral.integral_finsetSum] · apply Finset.sum_congr rfl intro j hj have he : (fun t => (c i * u i t * conj (c j * u j t)).re) = (fun t => (c i * conj (c j) * (u i t * conj (u j t))).re) := by funext t congr 1 simp only [map_mul] ring rw [he] have hij : IntervalIntegrable (fun t => c i * conj (c j) * (u i t * conj (u j t))) volume a b := (continuous_const.mul ((hu i hi).mul (hu j hj).star)).intervalIntegrable a b change (∫ t in a..b, RCLike.re (c i * conj (c j) * (u i t * conj (u j t)))) = _ rw [intervalIntegral.intervalIntegral_re hij, intervalIntegral.integral_const_mul] rfl · intro j hj have hui := hu i hi have huj := hu j hj apply Continuous.intervalIntegrable fun_prop · intro i hi apply Continuous.intervalIntegrable apply continuous_finsetSum intro j hj have hui := hu i hi have huj := hu j hj fun_prop end Bounty end section open scoped BigOperators ComplexConjugate open MeasureTheory namespace Bounty theorem oscillatory_interval_norm_le {a b w : ℝ} (hw : w ≠ 0) : ‖∫ t in a..b, Complex.exp ((w * t : ℝ) * Complex.I)‖ ≤ 2 / |w| := by have he : (fun t : ℝ => Complex.exp ((w * t : ℝ) * Complex.I)) = (fun t : ℝ => Complex.exp (((w : ℂ) * Complex.I) * t)) := by funext t congr 1 push_cast ring rw [he, integral_exp_mul_complex (mul_ne_zero (by exact_mod_cast hw) Complex.I_ne_zero), norm_div, norm_mul, Complex.norm_I, mul_one, Complex.norm_real, Real.norm_eq_abs] apply div_le_div_of_nonneg_right _ (abs_nonneg w) calc ‖Complex.exp (↑w * Complex.I * ↑b) - Complex.exp (↑w * Complex.I * ↑a)‖ ≤ ‖Complex.exp (↑w * Complex.I * ↑b)‖ + ‖Complex.exp (↑w * Complex.I * ↑a)‖ := norm_sub_le _ _ _ = 2 := by have h (t : ℝ) : ‖Complex.exp (↑w * Complex.I * ↑t)‖ = 1 := by have he : (w : ℂ) * Complex.I * (t : ℂ) = ((w * t : ℝ) : ℂ) * Complex.I := by push_cast ring rw [he] exact Complex.norm_exp_ofReal_mul_I (w * t) rw [h, h] norm_num theorem logarithmic_gap_lower {x y N : ℝ} (hx : 0 < x) (hxy : x < y) (hyN : y ≤ N) : (y - x) / N ≤ Real.log y - Real.log x := by have hy : 0 < y := hx.trans hxy have h := Real.one_sub_inv_le_log_of_pos (div_pos hy hx) rw [Real.log_div hy.ne' hx.ne', inv_div] at h calc (y - x) / N ≤ (y - x) / y := div_le_div_of_nonneg_left (sub_nonneg.mpr hxy.le) hy hyN _ = 1 - x / y := by field_simp _ ≤ _ := h end Bounty end section open scoped BigOperators namespace Bounty theorem sum_inverse_lower_distances_le (s : Finset ℕ) (n N : ℕ) (hn : n ≤ N) : (∑ m ∈ s.filter (· < n), ((n - m : ℕ) : ℝ)⁻¹) ≤ 1 + Real.log N := by classical have hinj : Set.InjOn (fun m => n - m) (s.filter (· < n)) := by intro x hx y hy he dsimp only at he have hx' := (Finset.mem_filter.mp hx).2 have hy' := (Finset.mem_filter.mp hy).2 omega have hsub : (s.filter (· < n)).image (fun m => n - m) ⊆ Finset.Icc 1 N := by intro k hk obtain ⟨m, hm, rfl⟩ := Finset.mem_image.mp hk simp only [Finset.mem_filter] at hm simp only [Finset.mem_Icc] omega calc _ = ∑ k ∈ (s.filter (· < n)).image (fun m => n - m), (k : ℝ)⁻¹ := (Finset.sum_image hinj).symm _ ≤ ∑ k ∈ Finset.Icc 1 N, (k : ℝ)⁻¹ := Finset.sum_le_sum_of_subset_of_nonneg hsub (by intros; positivity) _ = (harmonic N : ℝ) := by simp only [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast] _ ≤ _ := harmonic_le_one_add_log N theorem sum_inverse_upper_distances_le (s : Finset ℕ) (n N : ℕ) (hs : ∀ m ∈ s, m ≤ N) : (∑ m ∈ s.filter (n < ·), ((m - n : ℕ) : ℝ)⁻¹) ≤ 1 + Real.log N := by classical have hinj : Set.InjOn (fun m => m - n) (s.filter (n < ·)) := by intro x hx y hy he dsimp only at he have hx' := (Finset.mem_filter.mp hx).2 have hy' := (Finset.mem_filter.mp hy).2 omega have hsub : (s.filter (n < ·)).image (fun m => m - n) ⊆ Finset.Icc 1 N := by intro k hk obtain ⟨m, hm, rfl⟩ := Finset.mem_image.mp hk have hm' := Finset.mem_filter.mp hm have hN := hs m hm'.1 simp only [Finset.mem_Icc] omega calc _ = ∑ k ∈ (s.filter (n < ·)).image (fun m => m - n), (k : ℝ)⁻¹ := (Finset.sum_image hinj).symm _ ≤ ∑ k ∈ Finset.Icc 1 N, (k : ℝ)⁻¹ := Finset.sum_le_sum_of_subset_of_nonneg hsub (by intros; positivity) _ = (harmonic N : ℝ) := by simp only [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast] _ ≤ _ := harmonic_le_one_add_log N theorem sum_inverse_abs_distances_le (s : Finset ℕ) (n N : ℕ) (hn : n ≤ N) (hs : ∀ m ∈ s, m ≤ N) : (∑ m ∈ s, if m = n then 0 else |(n : ℝ) - m|⁻¹) ≤ 2 * (1 + Real.log N) := by have he : (∑ m ∈ s, if m = n then 0 else |(n : ℝ) - m|⁻¹) = (∑ m ∈ s.filter (· < n), ((n - m : ℕ) : ℝ)⁻¹) + (∑ m ∈ s.filter (n < ·), ((m - n : ℕ) : ℝ)⁻¹) := by rw [Finset.sum_filter, Finset.sum_filter, ← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro m _ rcases lt_trichotomy m n with h | rfl | h · have hc : (m : ℝ) ≤ n := by exact_mod_cast h.le simp [h, h.ne, not_lt.mpr h.le, Nat.cast_sub h.le, abs_of_nonneg (sub_nonneg.mpr hc)] · simp · have hc : (n : ℝ) ≤ m := by exact_mod_cast h.le simp [h, h.ne', not_lt.mpr h.le, Nat.cast_sub h.le, abs_of_nonpos (sub_nonpos.mpr hc), neg_sub] rw [he] linarith [sum_inverse_lower_distances_le s n N hn, sum_inverse_upper_distances_le s n N hs] end Bounty end section /- Exact error propagation through normalized character averages and finite outer sums. -/ open Finset namespace Bounty theorem signed_interval_nonzero_card (N : ℕ) : ((Icc (-(N:ℤ)) (N:ℤ)).filter (fun k => k ≠ 0)).card = 2*N := by classical have hfilter : (Icc (-(N:ℤ)) (N:ℤ)).filter (fun k => k ≠ 0) = (Icc (-(N:ℤ)) (N:ℤ)).erase 0 := by ext k simp only [mem_filter, mem_erase] tauto have hmem : (0:ℤ) ∈ Icc (-(N:ℤ)) (N:ℤ) := by simp rw [hfilter, card_erase_of_mem hmem, Int.card_Icc] omega end Bounty end section open Finset open scoped ComplexConjugate namespace Bounty theorem finite_complex_sum_norm_sq {ι : Type*} (S : Finset ι) (f : ι → ℂ) : ‖∑ n ∈ S, f n‖^2 = ∑ m ∈ S, ∑ n ∈ S, (f m * conj (f n)).re := by calc _ = ((∑ n ∈ S, f n) * conj (∑ n ∈ S, f n)).re := by rw [Complex.mul_conj, Complex.ofReal_re, Complex.normSq_eq_norm_sq] _ = _ := by simp only [map_sum, mul_sum, sum_mul, Complex.re_sum] rw [sum_comm] theorem finite_sum_norm_square_le_card {ι : Type*} (S : Finset ι) (f : ι → ℂ) : ‖∑ n ∈ S, f n‖^2 ≤ (S.card : ℝ) * ∑ n ∈ S, ‖f n‖^2 := by have hn := norm_sum_le S f have hc := sum_mul_sq_le_sq_mul_sq S (fun _ => (1:ℝ)) (fun n => ‖f n‖) simp only [one_mul, one_pow, sum_const, nsmul_eq_mul, mul_one] at hc exact (pow_le_pow_left₀ (norm_nonneg _) hn 2).trans hc theorem finite_translate_sum_eq (S X : Finset ℤ) (f : ℤ → ℂ) (h : ℤ) (hsupport : ∀ n, n ∉ S → f n = 0) (hcover : ∀ n ∈ S, n-h ∈ X) : (∑ x ∈ X, f (x+h)) = ∑ n ∈ S, f n := by classical have hsub : S.image (fun n => n-h) ⊆ X := by intro x hx obtain ⟨n, hn, rfl⟩ := mem_image.mp hx exact hcover n hn have hz (x : ℤ) (hx : x ∈ X) (hxnot : x ∉ S.image (fun n => n-h)) : f (x+h) = 0 := by apply hsupport intro hxS apply hxnot apply mem_image.mpr exact ⟨x+h, hxS, by omega⟩ rw [← sum_subset hsub hz, sum_image] · simp only [sub_add_cancel] · intro a ha b hb hab change a-h = b-h at hab exact sub_left_inj.mp hab theorem finite_translate_average_identity (S H X : Finset ℤ) (f : ℤ → ℂ) (hsupport : ∀ n, n ∉ S → f n = 0) (hcover : ∀ n ∈ S, ∀ h ∈ H, n-h ∈ X) : (∑ x ∈ X, ∑ h ∈ H, f (x+h)) = (H.card : ℂ) * ∑ n ∈ S, f n := by rw [sum_comm] have he : (∑ h ∈ H, ∑ x ∈ X, f (x+h)) = ∑ _h ∈ H, ∑ n ∈ S, f n := by apply sum_congr rfl intro h hh exact finite_translate_sum_eq S X f h hsupport (fun n hn => hcover n hn h hh) rw [he, sum_const, nsmul_eq_mul] theorem finite_translate_cauchy_gram (S H X : Finset ℤ) (f : ℤ → ℂ) (hsupport : ∀ n, n ∉ S → f n = 0) (hcover : ∀ n ∈ S, ∀ h ∈ H, n-h ∈ X) : (H.card : ℝ)^2 * ‖∑ n ∈ S, f n‖^2 ≤ (X.card : ℝ) * ∑ h ∈ H, ∑ k ∈ H, (∑ x ∈ X, f (x+h) * conj (f (x+k))).re := by have hc := finite_sum_norm_square_le_card X (fun x => ∑ h ∈ H, f (x+h)) rw [finite_translate_average_identity S H X f hsupport hcover, norm_mul, Complex.norm_natCast, mul_pow] at hc apply hc.trans_eq congr 1 simp_rw [finite_complex_sum_norm_sq] rw [sum_comm] apply sum_congr rfl intro h hh rw [sum_comm] apply sum_congr rfl intro k hk simp only [Complex.re_sum] end Bounty end section /- A finite summation identity for reciprocals of phase increments. -/ open Finset namespace Bounty theorem sum_phase_weighted_difference (u w : ℕ → ℂ) (N : ℕ) : (∑ n ∈ range N, w n * (u n-u (n+1))) = w 0*u 0-w N*u N + ∑ n ∈ range N, (w (n+1)-w n)*u (n+1) := by induction N with | zero => simp | succ N hN => rw [sum_range_succ, sum_range_succ, hN] ring section variable (u w : ℕ → ℂ) (N : ℕ) (hw : ∀ n < N, w n*(u n-u (n+1)) = u n) include u w N hw theorem sum_phase_reciprocal_identity : (∑ n ∈ range N, u n) = w 0*u 0-w N*u N + ∑ n ∈ range N, (w (n+1)-w n)*u (n+1) := by rw [← sum_phase_weighted_difference] apply sum_congr rfl intro n hn exact (hw n (mem_range.mp hn)).symm theorem sum_phase_reciprocal_norm_le (hu : ∀ n ≤ N, ‖u n‖ ≤ 1) : ‖∑ n ∈ range N, u n‖ ≤ ‖w 0‖+‖w N‖ + ∑ n ∈ range N, ‖w (n+1)-w n‖ := by rw [sum_phase_reciprocal_identity u w N hw] calc _ ≤ ‖w 0*u 0‖+‖w N*u N‖ + ∑ n ∈ range N, ‖(w (n+1)-w n)*u (n+1)‖ := (norm_add_le _ _).trans (add_le_add (norm_sub_le _ _) (norm_sum_le _ _)) _ ≤ _ := by apply add_le_add · apply add_le_add · rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (hu 0 (Nat.zero_le N)) · rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (hu N le_rfl) · apply sum_le_sum intro n hn rw [norm_mul] exact mul_le_of_le_one_right (norm_nonneg _) (hu (n+1) (by have := mem_range.mp hn; omega)) end end Bounty end section /- The explicit reciprocal of a nontrivial unit-circle phase increment. -/ open Real namespace Bounty noncomputable def phaseReciprocalKernel (θ : ℝ) : ℂ := ⟨1/2, cos (θ/2)/(2*sin (θ/2))⟩ theorem phase_reciprocal_kernel_re (θ : ℝ) : (phaseReciprocalKernel θ).re = 1/2 := rfl theorem phase_reciprocal_kernel_im (θ : ℝ) : (phaseReciprocalKernel θ).im = cos (θ/2)/(2*sin (θ/2)) := rfl theorem phase_reciprocal_kernel_mul {θ : ℝ} (hθ : sin (θ/2) ≠ 0) : phaseReciprocalKernel θ * (1-Complex.exp ((θ : ℂ)*Complex.I)) = 1 := by have hc : cos θ = 2*(cos (θ/2))^2-1 := by simpa only [mul_div_cancel₀ _ (by norm_num : (2 : ℝ) ≠ 0)] using cos_two_mul (θ/2) have hs : sin θ = 2*sin (θ/2)*cos (θ/2) := by simpa only [mul_div_cancel₀ _ (by norm_num : (2 : ℝ) ≠ 0)] using sin_two_mul (θ/2) have hunit := sin_sq_add_cos_sq (θ/2) have hunitc := congrArg (fun x : ℝ => x*cos (θ/2)) hunit apply Complex.ext · simp only [Complex.mul_re, phase_reciprocal_kernel_re, phase_reciprocal_kernel_im, Complex.sub_re, Complex.sub_im, Complex.one_re, Complex.one_im, Complex.exp_ofReal_mul_I_re, Complex.exp_ofReal_mul_I_im] rw [hc,hs] field_simp <;> ring · simp only [Complex.mul_im, phase_reciprocal_kernel_re, phase_reciprocal_kernel_im, Complex.sub_re, Complex.sub_im, Complex.one_re, Complex.one_im, Complex.exp_ofReal_mul_I_re, Complex.exp_ofReal_mul_I_im] rw [hc,hs] field_simp nlinarith only [hunitc] end Bounty end section /- Explicit sine and cotangent bounds on a fractional phase band. -/ open Real Set namespace Bounty theorem sine_pi_lower_on_unit_band {δ x : ℝ} (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (hx : δ ≤ x ∧ x ≤ 1-δ) : 2*δ ≤ sin (Real.pi*x) := by have hpi : 0 < Real.pi := pi_pos have half_bound {y : ℝ} (hy0 : 0 ≤ y) (hy1 : y ≤ 1/2) : 2*y ≤ sin (Real.pi*y) := by have hh := mul_le_sin (show 0 ≤ Real.pi*y by positivity) (show Real.pi*y ≤ Real.pi/2 by nlinarith) have he : 2/Real.pi*(Real.pi*y) = 2*y := by field_simp rwa [he] at hh by_cases hxhalf : x ≤ 1/2 · exact (by linarith : 2*δ ≤ 2*x).trans (half_bound (by linarith) hxhalf) · have hh := half_bound (y := 1-x) (by linarith) (by linarith) have he : Real.pi*(1-x) = Real.pi-Real.pi*x := by ring rw [he, sin_pi_sub] at hh exact (by linarith : 2*δ ≤ 2*(1-x)).trans hh theorem strictAntiOn_unit_cotangent : StrictAntiOn (fun x : ℝ => cos (Real.pi*x)/sin (Real.pi*x)) (Ioo 0 1) := by intro x hx y hy hxy have hsx : 0 < sin (Real.pi*x) := sin_pos_of_pos_of_lt_pi (mul_pos pi_pos hx.1) (by nlinarith [mul_lt_mul_of_pos_left hx.2 pi_pos]) have hsy : 0 < sin (Real.pi*y) := sin_pos_of_pos_of_lt_pi (mul_pos pi_pos hy.1) (by nlinarith [mul_lt_mul_of_pos_left hy.2 pi_pos]) apply (div_lt_div_iff₀ hsy hsx).mpr have hsin : 0 < sin (Real.pi*y-Real.pi*x) := sin_pos_of_pos_of_lt_pi (by nlinarith [mul_lt_mul_of_pos_left hxy pi_pos]) (by nlinarith [mul_lt_mul_of_pos_left (show y-x < 1 by linarith [hx.1,hy.2]) pi_pos]) rw [sin_sub] at hsin nlinarith end Bounty end section /- Unit-period additive phases and exact removal of integer increments. -/ namespace Bounty noncomputable def realUnitPhase (x : ℝ) : ℂ := Complex.exp (((2*Real.pi*x : ℝ) : ℂ)*Complex.I) theorem real_unit_phase_norm (x : ℝ) : ‖realUnitPhase x‖ = 1 := Complex.norm_exp_ofReal_mul_I _ theorem real_unit_phase_add (x y : ℝ) : realUnitPhase (x+y) = realUnitPhase x*realUnitPhase y := by unfold realUnitPhase rw [← Complex.exp_add] congr 1 push_cast ring theorem real_unit_phase_int (k : ℤ) : realUnitPhase (k : ℝ) = 1 := by unfold realUnitPhase have he : (((2*Real.pi*(k : ℝ) : ℝ) : ℂ)*Complex.I) = (k : ℂ)*(2*(Real.pi : ℂ)*Complex.I) := by push_cast; ring rw [he,Complex.exp_int_mul_two_pi_mul_I] theorem real_unit_phase_sub_int (x : ℝ) (k : ℤ) : realUnitPhase (x-k) = realUnitPhase x := by rw [sub_eq_add_neg, real_unit_phase_add] have he : realUnitPhase (-(k : ℝ)) = 1 := by simpa only [Int.cast_neg] using real_unit_phase_int (-k) rw [he,mul_one] theorem real_unit_phase_increment (x y : ℝ) (k : ℤ) : realUnitPhase y = realUnitPhase x*realUnitPhase (y-x-k) := by rw [real_unit_phase_sub_int,← real_unit_phase_add] congr 1 ring end Bounty end section /- Unit increments inherit bounds and monotonicity from the first derivative. -/ namespace Bounty theorem first_derivative_unit_increment_bounds {f f' : ℝ → ℝ} {a b c C : ℝ} (hf : ∀ x ∈ Set.Icc a (b+1), HasDerivAt f (f' x) x) (hb : ∀ x ∈ Set.Icc a (b+1), c ≤ f' x ∧ f' x ≤ C) {x : ℝ} (hx : x ∈ Set.Icc a b) : c ≤ f (x+1)-f x ∧ f (x+1)-f x ≤ C := by have hs : Set.Icc x (x+1) ⊆ Set.Icc a (b+1) := by intro y hy exact ⟨hx.1.trans hy.1, hy.2.trans (by linarith [hx.2])⟩ obtain ⟨y,hy,he⟩ := exists_hasDerivAt_eq_slope f f' (show x < x+1 by linarith) (fun t ht => (hf t (hs ht)).continuousAt.continuousWithinAt) (fun t ht => hf t (hs ⟨ht.1.le,ht.2.le⟩)) have hbound := hb y (hs ⟨hy.1.le,hy.2.le⟩) rw [he] at hbound simpa only [add_sub_cancel_left,div_one] using hbound theorem hasDerivAt_unit_increment {f f' : ℝ → ℝ} {a b x : ℝ} (hf : ∀ t ∈ Set.Icc a (b+1), HasDerivAt f (f' t) t) (hx : x ∈ Set.Icc a b) : HasDerivAt (fun t => f (t+1)-f t) (f' (x+1)-f' x) x := by have h0 : x ∈ Set.Icc a (b+1) := ⟨hx.1,by linarith [hx.2]⟩ have h1 : x+1 ∈ Set.Icc a (b+1) := ⟨by linarith [hx.1],by linarith [hx.2]⟩ simpa only [mul_one,Function.comp_def,id_eq,Pi.sub_apply] using ((hf (x+1) h1).comp x ((hasDerivAt_id x).add_const 1)).fun_sub (hf x h0) theorem monotoneOn_unit_increment {f f' : ℝ → ℝ} {a b : ℝ} (hf : ∀ x ∈ Set.Icc a (b+1), HasDerivAt f (f' x) x) (hm : MonotoneOn f' (Set.Icc a (b+1))) : MonotoneOn (fun x => f (x+1)-f x) (Set.Icc a b) := by have hd := fun x hx => hasDerivAt_unit_increment hf (x := x) hx apply monotoneOn_of_deriv_nonneg (convex_Icc a b) (fun x hx => (hd x hx).continuousAt.continuousWithinAt) (fun x hx => (hd x (interior_subset hx)).differentiableAt.differentiableWithinAt) intro x hx have hx' := interior_subset hx rw [(hd x hx').deriv] exact sub_nonneg.mpr (hm ⟨hx'.1,by linarith [hx'.2]⟩ ⟨by linarith [hx'.1],by linarith [hx'.2]⟩ (by linarith)) theorem antitoneOn_unit_increment {f f' : ℝ → ℝ} {a b : ℝ} (hf : ∀ x ∈ Set.Icc a (b+1), HasDerivAt f (f' x) x) (hm : AntitoneOn f' (Set.Icc a (b+1))) : AntitoneOn (fun x => f (x+1)-f x) (Set.Icc a b) := by have hd := fun x hx => hasDerivAt_unit_increment hf (x := x) hx apply antitoneOn_of_deriv_nonpos (convex_Icc a b) (fun x hx => (hd x hx).continuousAt.continuousWithinAt) (fun x hx => (hd x (interior_subset hx)).differentiableAt.differentiableWithinAt) intro x hx have hx' := interior_subset hx rw [(hd x hx').deriv] exact sub_nonpos.mpr (hm ⟨hx'.1,by linarith [hx'.2]⟩ ⟨by linarith [hx'.1],by linarith [hx'.2]⟩ (by linarith)) end Bounty end section /- Finite geometry of monotone phase increments, independent of cancellation estimates. -/ open Finset namespace Bounty noncomputable def discreteSlopeBand (a b : ℕ) (d : ℕ → ℝ) (x y : ℝ) : Finset ℕ := (Icc a b).filter (fun n => x ≤ d n ∧ d n ≤ y) theorem discrete_slope_band_interval {a b : ℕ} {d : ℕ → ℝ} {x y : ℝ} (hmono : MonotoneOn d (Set.Icc a b)) (hne : (discreteSlopeBand a b d x y).Nonempty) : discreteSlopeBand a b d x y = Icc ((discreteSlopeBand a b d x y).min' hne) ((discreteSlopeBand a b d x y).max' hne) := by classical let S := discreteSlopeBand a b d x y have hlo := mem_filter.mp (S.min'_mem hne) have hhi := mem_filter.mp (S.max'_mem hne) ext n constructor · intro hn exact mem_Icc.mpr ⟨S.min'_le n hn,S.le_max' n hn⟩ · intro hn obtain ⟨hl,hr⟩ := mem_Icc.mp hn have hnab : n ∈ Set.Icc a b := ⟨(mem_Icc.mp hlo.1).1.trans hl,hr.trans (mem_Icc.mp hhi.1).2⟩ exact mem_filter.mpr ⟨mem_Icc.mpr hnab, ⟨hlo.2.1.trans (hmono (mem_Icc.mp hlo.1) hnab hl), (hmono hnab (mem_Icc.mp hhi.1) hr).trans hhi.2.2⟩⟩ theorem separated_slope_card_bound (S : Finset ℕ) (d : ℕ → ℝ) {lam x y : ℝ} (hlam : 0 < lam) (hxy : x ≤ y) (hS : ∀ n ∈ S, x ≤ d n ∧ d n ≤ y) (hsep : ∀ i ∈ S, ∀ j ∈ S, i ≤ j → lam*((j : ℝ)-i) ≤ d j-d i) : (S.card : ℝ) ≤ (y-x)/lam+1 := by classical by_cases hne : S.Nonempty · let lo := S.min' hne let hi := S.max' hne have hlo : lo ∈ S := S.min'_mem hne have hhi : hi ∈ S := S.max'_mem hne have hle : lo ≤ hi := S.min'_le_max' hne have hcard : S.card ≤ hi+1-lo := by simpa only [Nat.card_Icc] using card_le_card (show S ⊆ Icc lo hi from fun n hn => mem_Icc.mpr ⟨S.min'_le n hn,S.le_max' n hn⟩) have hcardR : (S.card : ℝ) ≤ (hi : ℝ)+1-lo := by have hc := (Nat.cast_le (α := ℝ)).mpr hcard simpa only [Nat.cast_sub (show lo ≤ hi+1 by omega),Nat.cast_add,Nat.cast_one] using hc have hgap := hsep lo hlo hi hhi hle have hx := (hS lo hlo).1 have hy := (hS hi hhi).2 have hquot : lam*((y-x)/lam)=y-x := by field_simp nlinarith · rw [not_nonempty_iff_eq_empty.mp hne] simp only [card_empty,Nat.cast_zero] positivity theorem discrete_slope_band_card_bound {a b : ℕ} {d : ℕ → ℝ} {lam x y : ℝ} (hlam : 0 < lam) (hxy : x ≤ y) (hsep : ∀ i ∈ Icc a b, ∀ j ∈ Icc a b, i ≤ j → lam*((j : ℝ)-i) ≤ d j-d i) : ((discreteSlopeBand a b d x y).card : ℝ) ≤ (y-x)/lam+1 := by apply separated_slope_card_bound _ d hlam hxy · intro n hn exact (mem_filter.mp hn).2 · intro i hi j hj hij exact hsep i (mem_filter.mp hi).1 j (mem_filter.mp hj).1 hij theorem floor_slope_range_card {a b : ℕ} {d : ℕ → ℝ} (hab : a ≤ b) (hmono : MonotoneOn d (Set.Icc a b)) : ((Icc ⌊d a⌋ ⌊d b⌋).card : ℝ) ≤ d b-d a+2 := by have hle := Int.floor_mono (hmono ⟨le_rfl,hab⟩ ⟨hab,le_rfl⟩ hab) have hc := Int.card_Icc_of_le ⌊d a⌋ ⌊d b⌋ (show ⌊d a⌋ ≤ ⌊d b⌋+1 by omega) have hcR : ((Icc ⌊d a⌋ ⌊d b⌋).card : ℝ) = (⌊d b⌋ : ℝ)+1-⌊d a⌋ := by exact_mod_cast hc rw [hcR] have ha := Int.lt_floor_add_one (d a) have hb := Int.floor_le (d b) linarith end Bounty end section /- Second derivative bounds imply the separated phase increments used by finite slope partitioning. -/ namespace Bounty theorem interval_secant_bounds {f f' : ℝ → ℝ} {a b c C : ℝ} (hf : ∀ x ∈ Set.Icc a b, HasDerivAt f (f' x) x) (hb : ∀ x ∈ Set.Icc a b, c ≤ f' x ∧ f' x ≤ C) {x y : ℝ} (hx : x ∈ Set.Icc a b) (hy : y ∈ Set.Icc a b) (hxy : x ≤ y) : c*(y-x) ≤ f y-f x ∧ f y-f x ≤ C*(y-x) := by have hc : ContinuousOn f (Set.Icc a b) := fun t ht => (hf t ht).continuousAt.continuousWithinAt have hd : DifferentiableOn ℝ f (interior (Set.Icc a b)) := fun t ht => (hf t (interior_subset ht)).differentiableAt.differentiableWithinAt constructor · apply (convex_Icc a b).mul_sub_le_image_sub_of_le_deriv hc hd _ x hx y hy hxy intro t ht rw [(hf t (interior_subset ht)).deriv] exact (hb t (interior_subset ht)).1 · apply (convex_Icc a b).image_sub_le_mul_sub_of_deriv_le hc hd _ x hx y hy hxy intro t ht rw [(hf t (interior_subset ht)).deriv] exact (hb t (interior_subset ht)).2 theorem second_derivative_increment_bounds {f f' f'' : ℝ → ℝ} {a b lam B : ℝ} (hf : ∀ x ∈ Set.Icc a (b+1), HasDerivAt f (f' x) x) (hf' : ∀ x ∈ Set.Icc a (b+1), HasDerivAt f' (f'' x) x) (hb : ∀ x ∈ Set.Icc a (b+1), lam ≤ f'' x ∧ f'' x ≤ B) {x y : ℝ} (hx : x ∈ Set.Icc a b) (hy : y ∈ Set.Icc a b) (hxy : x ≤ y) : lam*(y-x) ≤ (f (y+1)-f y)-(f (x+1)-f x) ∧ (f (y+1)-f y)-(f (x+1)-f x) ≤ B*(y-x) := by have hd (t : ℝ) (ht : t ∈ Set.Icc a b) : HasDerivAt (fun t => f (t+1)-f t) (f' (t+1)-f' t) t := by have ht0 : t ∈ Set.Icc a (b+1) := ⟨ht.1,by linarith [ht.2]⟩ have ht1 : t+1 ∈ Set.Icc a (b+1) := ⟨by linarith [ht.1],by linarith [ht.2]⟩ simpa only [mul_one,Function.comp_def,id_eq,Pi.sub_apply] using ((hf (t+1) ht1).comp t ((hasDerivAt_id t).add_const 1)).fun_sub (hf t ht0) have hbound (t : ℝ) (ht : t ∈ Set.Icc a b) : lam ≤ f' (t+1)-f' t ∧ f' (t+1)-f' t ≤ B := by have ht0 : t ∈ Set.Icc a (b+1) := ⟨ht.1,by linarith [ht.2]⟩ have ht1 : t+1 ∈ Set.Icc a (b+1) := ⟨by linarith [ht.1],by linarith [ht.2]⟩ simpa only [add_sub_cancel_left,mul_one] using interval_secant_bounds hf' hb ht0 ht1 (show t ≤ t+1 by linarith) exact interval_secant_bounds hd hbound hx hy hxy end Bounty end section /- Exact conversion between nonnegative integer intervals and natural intervals. -/ open Finset namespace Bounty theorem nat_sum_eq_integer_interval_sum (g : ℤ → ℂ) (a b : ℕ) : ∑ n ∈ Icc a b, g (n : ℤ) = ∑ n ∈ Icc (a : ℤ) (b : ℤ), g n := by apply sum_bij (fun (n : ℕ) _ => (n : ℤ)) · intro n hn obtain ⟨hl,hr⟩ := mem_Icc.mp hn exact mem_Icc.mpr ⟨by exact_mod_cast hl,by exact_mod_cast hr⟩ · intro n hn m hm he exact_mod_cast he · intro z hz obtain ⟨hl,hr⟩ := mem_Icc.mp hz refine ⟨z.toNat, mem_Icc.mpr ⟨?_, ?_⟩, ?_⟩ <;> omega · intro n hn rfl end Bounty end section /- Cardinality controls logarithmic sums at small frequencies. -/ open Finset namespace Bounty theorem norm_nat_log_phase_le_card (a b : ℕ) (t : ℝ) : ‖∑ n ∈ Icc a b, Complex.exp ((t*Real.log (n : ℝ) : ℝ)*Complex.I)‖ ≤ ((Icc a b).card : ℝ) := by calc _ ≤ ∑ n ∈ Icc a b, ‖Complex.exp ((t*Real.log (n : ℝ) : ℝ)*Complex.I)‖ := norm_sum_le _ _ _ = _ := by simp only [Complex.norm_exp_ofReal_mul_I,sum_const,nsmul_eq_mul,mul_one] theorem norm_nat_log_phase_small (a b : ℕ) (U t : ℝ) (hU : 1 ≤ U) (ha : U ≤ (a : ℝ)) (hb : (b : ℝ) ≤ 2*U) (ht : |t| ≤ 1) : ‖∑ n ∈ Icc a b, Complex.exp ((t*Real.log (n : ℝ) : ℝ)*Complex.I)‖ ≤ 4*U/(1+|t|) := by have hc : ((Icc a b).card : ℝ) ≤ 2*U := by rw [Nat.card_Icc] by_cases hab : a ≤ b+1 · rw [Nat.cast_sub hab,Nat.cast_add,Nat.cast_one] linarith · rw [Nat.sub_eq_zero_of_le (by omega),Nat.cast_zero] linarith calc _ ≤ ((Icc a b).card : ℝ) := norm_nat_log_phase_le_card a b t _ ≤ 2*U := hc _ ≤ 4*U/(1+|t|) := by apply (le_div_iff₀ (by positivity : 0 < 1+|t|)).mpr nlinarith end Bounty end section /- Product fibers of ordered prime tuples, allowing repeated primes. -/ namespace Bounty open Finset def primeTupleProduct (P : Finset ℕ) (j : ℕ) (a : Fin j → P) : ℕ := ∏ r, (a r).val theorem prime_tuple_product_eq_iff_perm (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (j : ℕ) (a b : Fin j → P) : primeTupleProduct P j a = primeTupleProduct P j b ↔ (List.ofFn (fun r => (a r).val)).Perm (List.ofFn (fun r => (b r).val)) := by constructor · intro hab apply perm_of_prod_eq_prod · simpa only [List.prod_ofFn, primeTupleProduct] using hab · intro p hp obtain ⟨i, rfl⟩ := List.mem_ofFn.mp hp exact Nat.prime_iff.mp (hP _ (a i).property) · intro p hp obtain ⟨i, rfl⟩ := List.mem_ofFn.mp hp exact Nat.prime_iff.mp (hP _ (b i).property) · intro hab simpa only [List.prod_ofFn, primeTupleProduct] using hab.prod_eq theorem prime_tuple_product_fiber_card_le_factorial (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (j n : ℕ) : ((Finset.univ : Finset (Fin j → P)).filter (fun a => primeTupleProduct P j a = n)).card ≤ j.factorial := by classical let fiber := (Finset.univ : Finset (Fin j → P)).filter (fun a => primeTupleProduct P j a = n) change fiber.card ≤ j.factorial by_cases hf : fiber.Nonempty · obtain ⟨a₀, ha₀⟩ := hf let L : (Fin j → P) → List ℕ := fun a => List.ofFn (fun r => (a r).val) have hL : Function.Injective L := by intro a b hab have hv := List.ofFn_injective hab funext i exact Subtype.ext (congrFun hv i) have hsub : fiber.image L ⊆ (L a₀).permutations.toFinset := by intro l hl obtain ⟨a, ha, rfl⟩ := Finset.mem_image.mp hl apply List.mem_toFinset.mpr apply List.mem_permutations.mpr apply (prime_tuple_product_eq_iff_perm P hP j a a₀).mp exact (Finset.mem_filter.mp ha).2.trans (Finset.mem_filter.mp ha₀).2.symm calc fiber.card = (fiber.image L).card := (Finset.card_image_of_injective fiber hL).symm _ ≤ (L a₀).permutations.toFinset.card := Finset.card_le_card hsub _ ≤ (L a₀).permutations.length := List.toFinset_card_le _ _ = j.factorial := by simp [List.length_permutations, L] · have he : fiber = ∅ := Finset.not_nonempty_iff_eq_empty.mp hf simp [he] end Bounty end section /- Regrouping finite complex sums and their squared norms by fibers. The cardinal bound is used only in the intermediate estimate; prime-product fibers will supply it in the arithmetic specialization. -/ open Finset open scoped Classical namespace Bounty theorem finite_complex_sum_norm_sq_le_card {X : Type*} (s : Finset X) (a : X → ℂ) : ‖∑ x ∈ s, a x‖ ^ 2 ≤ (s.card : ℝ) * ∑ x ∈ s, ‖a x‖ ^ 2 := by exact ((sq_le_sq₀ (norm_nonneg _) (sum_nonneg fun x _ => norm_nonneg (a x))).mpr (norm_sum_le s a)).trans (sq_sum_le_card_mul_sum_sq) theorem finite_fiber_sum_mul {X Y : Type*} [Fintype X] [DecidableEq Y] (f : X → Y) (a : X → ℂ) (b : Y → ℂ) : (∑ y ∈ univ.image f, (∑ x ∈ univ.filter (fun x => f x = y), a x) * b y) = ∑ x, a x * b (f x) := by calc _ = ∑ y ∈ univ.image f, ∑ x ∈ univ.filter (fun x => f x = y), a x * b (f x) := by apply sum_congr rfl intro y _ rw [sum_mul] apply sum_congr rfl intro x hx rw [(mem_filter.mp hx).2] _ = _ := sum_fiberwise_of_maps_to (fun x hx => mem_image_of_mem f hx) _ theorem finite_fiber_sum_norm_sq_le {X Y : Type*} [Fintype X] [DecidableEq Y] (f : X → Y) (a : X → ℂ) (M : ℕ) (hM : ∀ y ∈ univ.image f, (univ.filter (fun x => f x = y)).card ≤ M) : (∑ y ∈ univ.image f, ‖∑ x ∈ univ.filter (fun x => f x = y), a x‖ ^ 2) ≤ (M : ℝ) * ∑ x, ‖a x‖ ^ 2 := by calc _ ≤ ∑ y ∈ univ.image f, (M : ℝ) * ∑ x ∈ univ.filter (fun x => f x = y), ‖a x‖ ^ 2 := by apply sum_le_sum intro y hy exact (finite_complex_sum_norm_sq_le_card _ a).trans (mul_le_mul_of_nonneg_right (Nat.cast_le.mpr (hM y hy)) (sum_nonneg fun x _ => sq_nonneg _)) _ = _ := by rw [← mul_sum, sum_fiberwise_of_maps_to (fun x hx => mem_image_of_mem f hx)] end Bounty end section /- Occupied unit intervals give a finite, explicit exceptional set. One witness from each occupied interval is separated after splitting the integer indices into three residue classes. The resulting count uses the genuine Sobolev sampling inequality, with one unit of room to the right. -/ open Finset Set MeasureTheory open scoped BigOperators Classical namespace Bounty noncomputable def occupiedUnitIntervals (indices : Finset ℤ) (E : Set ℝ) : Finset ℤ := indices.filter (fun j => ∃ t ∈ Set.Icc (j : ℝ) ((j : ℝ) + 1), t ∈ E) theorem mem_occupiedUnitIntervals (indices : Finset ℤ) (E : Set ℝ) (j : ℤ) : j ∈ occupiedUnitIntervals indices E ↔ j ∈ indices ∧ ∃ t ∈ Set.Icc (j : ℝ) ((j : ℝ) + 1), t ∈ E := by simp only [occupiedUnitIntervals, Finset.mem_filter] noncomputable def occupiedUnitIntervalPoint (E : Set ℝ) (j : ℤ) : ℝ := if h : ∃ t ∈ Set.Icc (j : ℝ) ((j : ℝ) + 1), t ∈ E then h.choose else (j : ℝ) theorem occupiedUnitIntervalPoint_spec (indices : Finset ℤ) (E : Set ℝ) (j : ℤ) (hj : j ∈ occupiedUnitIntervals indices E) : occupiedUnitIntervalPoint E j ∈ Set.Icc (j : ℝ) ((j : ℝ) + 1) ∧ occupiedUnitIntervalPoint E j ∈ E := by have h := ((mem_occupiedUnitIntervals indices E j).mp hj).2 rw [occupiedUnitIntervalPoint, dif_pos h] exact h.choose_spec def unitIntervalResidue (j : ℤ) : Fin 3 := ⟨(j % 3).toNat, by have h0 := Int.emod_nonneg j (by norm_num : (3 : ℤ) ≠ 0) have h3 := Int.emod_lt_of_pos j (by norm_num : (0 : ℤ) < 3) omega⟩ theorem unit_interval_residue_separated {i j : ℤ} {x y : ℝ} (hx : x ∈ Set.Icc (i : ℝ) ((i : ℝ) + 1)) (hy : y ∈ Set.Icc (j : ℝ) ((j : ℝ) + 1)) (hres : unitIntervalResidue i = unitIntervalResidue j) (hne : i ≠ j) : 1 ≤ |x - y| := by have he := congrArg Fin.val hres dsimp only [unitIntervalResidue] at he have hi0 := Int.emod_nonneg i (by norm_num : (3 : ℤ) ≠ 0) have hj0 := Int.emod_nonneg j (by norm_num : (3 : ℤ) ≠ 0) rcases lt_or_gt_of_ne hne with hij | hji · have hgap : i + 3 ≤ j := by omega have hgapR : (i : ℝ) + 3 ≤ (j : ℝ) := by exact_mod_cast hgap have habs : y - x ≤ |x - y| := by simpa only [abs_sub_comm] using le_abs_self (y - x) linarith [hx.2, hy.1] · have hgap : j + 3 ≤ i := by omega have hgapR : (j : ℝ) + 3 ≤ (i : ℝ) := by exact_mod_cast hgap have habs := le_abs_self (x - y) linarith [hy.2, hx.1] theorem unit_interval_residue_card_sum (indices : Finset ℤ) : (∑ r : Fin 3, (indices.filter (fun j => unitIntervalResidue j = r)).card) = indices.card := by exact (Finset.card_eq_sum_card_fiberwise (s := indices) (t := Finset.univ) (f := unitIntervalResidue) (fun _ _ => Finset.mem_univ _)).symm theorem occupied_unit_intervals_card_energy_le {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] (indices : Finset ℤ) (E : Set ℝ) (F F' : ℝ → H) {a b η K Q : ℝ} (hab : a ≤ b) (hleft : ∀ j ∈ indices, a ≤ (j : ℝ)) (hright : ∀ j ∈ indices, (j : ℝ) + 2 ≤ b) (hη : 0 < η) (hE : ∀ t ∈ E, η ≤ ‖F t‖) (hF : ∀ t, HasDerivAt F (F' t) t) (hF' : Continuous F') (hK : 0 < K) (henergy : (∫ t in a..b, ‖F t‖ ^ 2) ≤ Q) (hderiv : (∫ t in a..b, ‖F' t‖ ^ 2) ≤ K ^ 2 * Q) : ((occupiedUnitIntervals indices E).card : ℝ) * η ^ 2 ≤ 3 * (1 + 2 * K) * Q := by let occupied := occupiedUnitIntervals indices E let point := occupiedUnitIntervalPoint E have hpoint : ∀ j ∈ occupied, point j ∈ Set.Icc (j : ℝ) ((j : ℝ) + 1) ∧ point j ∈ E := fun j hj => occupiedUnitIntervalPoint_spec indices E j hj have hclass (r : Fin 3) : ((occupied.filter (fun j => unitIntervalResidue j = r)).card : ℝ) * η ^ 2 ≤ (1 + 2 * K) * Q := by let cls := occupied.filter (fun j => unitIntervalResidue j = r) have hoc : ∀ j ∈ cls, j ∈ occupied := fun j hj => (Finset.mem_filter.mp hj).1 have hidx : ∀ j ∈ cls, j ∈ indices := fun j hj => ((mem_occupiedUnitIntervals indices E j).mp (hoc j hj)).1 have hsamp := separated_samples_norm_sq_le_energy cls point (δ := 1) (by norm_num) hab (fun j hj => (hleft j (hidx j hj)).trans (hpoint j (hoc j hj)).1.1) (fun j hj => by linarith [(hpoint j (hoc j hj)).1.2, hright j (hidx j hj)]) (fun i hi j hj hij => unit_interval_residue_separated (hpoint i (hoc i hi)).1 (hpoint j (hoc j hj)).1 ((Finset.mem_filter.mp hi).2.trans (Finset.mem_filter.mp hj).2.symm) hij) F F' hF hF' hK henergy hderiv have hlow : (cls.card : ℝ) * η ^ 2 ≤ ∑ j ∈ cls, ‖F (point j)‖ ^ 2 := by calc (cls.card : ℝ) * η ^ 2 = ∑ _j ∈ cls, η ^ 2 := by simp _ ≤ _ := Finset.sum_le_sum (fun j hj => pow_le_pow_left₀ hη.le (hE (point j) (hpoint j (hoc j hj)).2) 2) exact hlow.trans (by simpa only [inv_one] using hsamp) have hsum := Finset.sum_le_sum (fun r (_ : r ∈ (Finset.univ : Finset (Fin 3))) => hclass r) have hcard : (∑ r : Fin 3, ((occupied.filter (fun j => unitIntervalResidue j = r)).card : ℝ)) = (occupied.card : ℝ) := by exact_mod_cast unit_interval_residue_card_sum occupied rw [← Finset.sum_mul, hcard] at hsum simpa only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, Nat.cast_ofNat, mul_assoc] using hsum end Bounty end section /- The growing degree and the exact factorial budget used for prime moments. -/ namespace Bounty noncomputable def primeMomentDegree (Y P : ℝ) : ℕ := ⌊Real.log Y / Real.log (2 * P)⌋₊ theorem prime_moment_degree_log_bounds {Y P : ℝ} (hY : 1 ≤ Y) (hP : 1 < 2 * P) : (primeMomentDegree Y P : ℝ) * Real.log (2 * P) ≤ Real.log Y ∧ Real.log Y < (primeMomentDegree Y P + 1 : ℝ) * Real.log (2 * P) := by have hd : 0 < Real.log (2 * P) := Real.log_pos hP have hn : 0 ≤ Real.log Y / Real.log (2 * P) := div_nonneg (Real.log_nonneg hY) hd.le exact ⟨(le_div_iff₀ hd).mp (Nat.floor_le hn), (div_lt_iff₀ hd).mp (Nat.lt_floor_add_one _)⟩ theorem prime_moment_degree_power_bounds {Y P : ℝ} (hY : 1 ≤ Y) (hP : 1 < 2 * P) : (2 * P) ^ primeMomentDegree Y P ≤ Y ∧ Y < (2 * P) ^ (primeMomentDegree Y P + 1) := by have hy : 0 < Y := zero_lt_one.trans_le hY have hp : 0 < 2 * P := zero_lt_one.trans hP obtain ⟨hlo, hhi⟩ := prime_moment_degree_log_bounds hY hP constructor · apply (Real.log_le_log_iff (pow_pos hp _) hy).mp simpa only [Real.log_pow] using hlo · apply (Real.log_lt_log_iff hy (pow_pos hp _)).mp simpa only [Real.log_pow, Nat.cast_add, Nat.cast_one] using hhi theorem prime_moment_degree_le {Y P L a c : ℝ} (hL : 0 < L) (hY : 1 ≤ Y) (hlogY : Real.log Y ≤ c * L) (hP : Real.exp (L ^ a) / 2 ≤ P) : (primeMomentDegree Y P : ℝ) ≤ c * L ^ (1 - a) := by have hLa : 0 < L ^ a := Real.rpow_pos_of_pos hL a have hP2 : Real.exp (L ^ a) ≤ 2 * P := by linarith have hP1 : 1 < 2 * P := (Real.one_lt_exp_iff.mpr hLa).trans_le hP2 have hlogP : L ^ a ≤ Real.log (2 * P) := (Real.le_log_iff_exp_le (zero_lt_one.trans hP1)).mpr hP2 have hj := (prime_moment_degree_log_bounds hY hP1).1 have hprod : (primeMomentDegree Y P : ℝ) * L ^ a ≤ c * L := (mul_le_mul_of_nonneg_left hlogP (Nat.cast_nonneg _)).trans (hj.trans hlogY) calc (primeMomentDegree Y P : ℝ) ≤ c * L / L ^ a := (le_div_iff₀ hLa).mpr hprod _ = c * L ^ (1 - a) := by rw [Real.rpow_sub hL, Real.rpow_one]; ring theorem prime_moment_factorial_le (j : ℕ) : (j.factorial : ℝ) ≤ (max 1 (j : ℝ)) ^ j := by have h : (j.factorial : ℝ) ≤ (j : ℝ) ^ j := by exact_mod_cast Nat.factorial_le_pow j exact h.trans (pow_le_pow_left₀ (Nat.cast_nonneg _) (le_max_right _ _) _) theorem prime_moment_scalar_budget {Y P B T : ℝ} (hY : 1 ≤ Y) (hP : 1 < 2 * P) (hB : 0 ≤ B) (hT : 0 ≤ T) : B * Y * (primeMomentDegree Y P).factorial * (T / P) ^ primeMomentDegree Y P ≤ B * (2 * P) * (2 * T * max 1 (primeMomentDegree Y P : ℝ)) ^ primeMomentDegree Y P := by let j := primeMomentDegree Y P have hp : 0 < P := by linarith have hy := (prime_moment_degree_power_bounds hY hP).2.le have hj := prime_moment_factorial_le j calc B * Y * (j.factorial : ℝ) * (T / P) ^ j ≤ B * (2 * P) ^ (j + 1) * (max 1 (j : ℝ)) ^ j * (T / P) ^ j := by gcongr _ = B * (2 * P) * (2 * T * max 1 (j : ℝ)) ^ j := by have he : (2 * P) * max 1 (j : ℝ) * (T / P) = 2 * T * max 1 (j : ℝ) := by field_simp calc _ = B * (2 * P) * ((2 * P) * max 1 (j : ℝ) * (T / P)) ^ j := by simp only [mul_pow, pow_succ] ring _ = _ := by rw [he] end Bounty end section /- An explicit scalar budget for the unit-interval sampling and mean-square factors. The estimate is uniform in the moment order and prime set. -/ namespace Bounty theorem prime_moment_sampling_overhead_le (Y R : ℝ) (hY : 1 ≤ Y) (hR : 0 ≤ R) (hRY : R ≤ Y) : 3 * (1 + 2 * (1 + Real.log (⌈Y⌉₊ : ℝ))) * ((2 * (⌈R⌉₊ : ℝ) + 3) + 4 * (⌈Y⌉₊ : ℝ) * (1 + Real.log (⌈Y⌉₊ : ℝ))) ≤ 512 * Y * (1 + Real.log Y) ^ 2 := by have hYpos : 0 < Y := by linarith have hNY : Y ≤ (⌈Y⌉₊ : ℝ) := Nat.le_ceil Y have hNpos : (0 : ℝ) < (⌈Y⌉₊ : ℝ) := hYpos.trans_le hNY have hN : (⌈Y⌉₊ : ℝ) ≤ 2 * Y := by have := Nat.ceil_lt_add_one hYpos.le linarith have hRc : (⌈R⌉₊ : ℝ) ≤ Y + 1 := by have := Nat.ceil_lt_add_one hR linarith have hlogY : 0 ≤ Real.log Y := Real.log_nonneg hY have hlogN : 0 ≤ Real.log (⌈Y⌉₊ : ℝ) := Real.log_nonneg (hY.trans hNY) have hlog2 : Real.log (2 : ℝ) ≤ 1 := by have hh := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 2) linarith have hlog : Real.log (⌈Y⌉₊ : ℝ) ≤ 1 + Real.log Y := by have hh := Real.log_le_log hNpos hN rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) (ne_of_gt hYpos)] at hh linarith let L := 1 + Real.log Y let Z := 1 + Real.log (⌈Y⌉₊ : ℝ) have hL : 1 ≤ L := by dsimp only [L]; linarith have hZ0 : 0 ≤ Z := by dsimp only [Z]; linarith have hZ : Z ≤ 2 * L := by dsimp only [Z, L]; linarith have hsamp : 3 * (1 + 2 * Z) ≤ 18 * L := by linarith have hYL : Y ≤ Y * L := by nlinarith have hNZ : (⌈Y⌉₊ : ℝ) * Z ≤ (2 * Y) * (2 * L) := mul_le_mul hN hZ hZ0 (by positivity) have hmoment : (2 * (⌈R⌉₊ : ℝ) + 3) + 4 * (⌈Y⌉₊ : ℝ) * Z ≤ 23 * Y * L := by nlinarith change 3 * (1 + 2 * Z) * ((2 * (⌈R⌉₊ : ℝ) + 3) + 4 * (⌈Y⌉₊ : ℝ) * Z) ≤ 512 * Y * L ^ 2 calc _ ≤ (18 * L) * (23 * Y * L) := mul_le_mul hsamp hmoment (by positivity) (by positivity) _ = 414 * Y * L ^ 2 := by ring _ ≤ 512 * Y * L ^ 2 := by nlinarith [sq_nonneg L] end Bounty end section /- The exceptional prime-moment exponential is a subpower of any scale whose logarithm is bounded below by a fixed positive multiple of L. -/ open Filter open scoped Topology namespace Bounty theorem eventually_prime_moment_exp_le_rpow {a beta K d ε : ℝ} (ha : 0 < a) (hbeta : beta < 1) (hK : 0 ≤ K) (hd : 0 < d) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, 0 < Y → d * L ≤ Real.log Y → Real.exp (K * (L ^ beta + L ^ (1 - a) * Real.log L)) ≤ Y ^ ε := by have hbudget : 0 < ε * d / 2 := by positivity filter_upwards [ eventually_mul_rpow_log_add_le_rpow (a := beta) (b := 1) zero_lt_one hbeta hbudget K 0, eventually_mul_rpow_log_add_le_rpow (a := 1 - a) (b := 1) zero_lt_one (by linarith : 1 - a < 1) hbudget K 0, Real.tendsto_log_atTop.eventually_ge_atTop 1, eventually_gt_atTop (0 : ℝ)] with L hfirst hsecond hlogL hL intro Y hY hscale simp only [add_zero, Real.rpow_one] at hfirst hsecond have hfirst' : K * L ^ beta ≤ K * L ^ beta * Real.log L := le_mul_of_one_le_right (mul_nonneg hK (Real.rpow_nonneg hL.le beta)) hlogL have hexponent : K * (L ^ beta + L ^ (1 - a) * Real.log L) ≤ ε * (d * L) := by nlinarith only [hfirst'.trans hfirst, hsecond] calc _ ≤ Real.exp (ε * Real.log Y) := Real.exp_le_exp.mpr (hexponent.trans (mul_le_mul_of_nonneg_left hscale hε.le)) _ = Y ^ ε := by rw [Real.rpow_def_of_pos hY]; congr 1; ring end Bounty end section /- Finite separated sampling estimates for exponential polynomials. -/ open scoped BigOperators namespace Bounty theorem separated_floor_injective {ι : Type*} (s : Finset ι) (d : ι → ℝ) (h0 : ∀ i ∈ s, 0 ≤ d i) (hsep : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → 1 ≤ |d i - d j|) : Set.InjOn (fun i => Nat.floor (d i)) s := by intro i hi j hj he dsimp only at he by_contra hij have h := hsep i hi j hj hij have hi0 := Nat.floor_le (h0 i hi) have hj0 := Nat.floor_le (h0 j hj) have hi1 := Nat.lt_floor_add_one (d i) have hj1 := Nat.lt_floor_add_one (d j) rw [he] at hi0 hi1 have habs : |d i - d j| < 1 := abs_lt.mpr ⟨by linarith, by linarith⟩ linarith theorem separated_positive_reciprocal_sum {ι : Type*} (s : Finset ι) (d : ι → ℝ) (N : ℕ) (h1 : ∀ i ∈ s, 1 ≤ d i) (hN : ∀ i ∈ s, d i ≤ N) (hsep : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → 1 ≤ |d i - d j|) : (∑ i ∈ s, (1 + d i)⁻¹) ≤ 1 + Real.log N := by classical have hinj := separated_floor_injective s d (fun i hi => le_trans (by norm_num) (h1 i hi)) hsep have hsub : s.image (fun i => Nat.floor (d i)) ⊆ Finset.Icc 1 N := by intro k hk obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hk exact Finset.mem_Icc.mpr ⟨(Nat.one_le_floor_iff (d i)).mpr (h1 i hi), Nat.floor_le_of_le (hN i hi)⟩ calc _ ≤ ∑ i ∈ s, ((Nat.floor (d i) : ℕ) : ℝ)⁻¹ := by apply Finset.sum_le_sum intro i hi have hfloor : (1 : ℝ) ≤ Nat.floor (d i) := by exact_mod_cast (Nat.one_le_floor_iff (d i)).mpr (h1 i hi) exact inv_anti₀ (lt_of_lt_of_le (by norm_num) hfloor) (le_trans (Nat.floor_le (le_trans (by norm_num) (h1 i hi))) (by linarith)) _ = ∑ k ∈ s.image (fun i => Nat.floor (d i)), (k : ℝ)⁻¹ := by rw [Finset.sum_image hinj] _ ≤ ∑ k ∈ Finset.Icc 1 N, (k : ℝ)⁻¹ := Finset.sum_le_sum_of_subset_of_nonneg hsub (by intros; positivity) _ = (harmonic N : ℝ) := by simp only [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast] _ ≤ _ := harmonic_le_one_add_log N end Bounty end section /- Finite separated sampling estimates for exponential polynomials. -/ open scoped BigOperators ComplexConjugate InnerProductSpace namespace Bounty theorem finite_row_gram_energy_le {I X : Type*} [Fintype I] [Fintype X] (K : I → X → ℂ) (c : X → ℂ) {B : ℝ} (hB : 0 ≤ B) (hrow : ∀ i, (∑ j, ‖∑ n, K i n * conj (K j n)‖) ≤ B) : (∑ i, ‖∑ n, K i n * c n‖ ^ 2) ≤ B * ∑ n, ‖c n‖ ^ 2 := by let u : I → EuclideanSpace ℂ X := fun i => finiteMeasureVector (fun _ => 1) (fun n => conj (K i n)) have h := finite_gram_row_analysis_sq u hB (fun i => by simpa only [u, finite_measure_vector_inner _ (fun _ => zero_le_one), Complex.ofReal_one, one_mul, starRingEnd_self_apply] using hrow i) (finiteMeasureVector (fun _ => 1) c) simpa only [u, finite_measure_vector_inner _ (fun _ => zero_le_one), finite_measure_vector_norm_sq _ (fun _ => zero_le_one), Complex.ofReal_one, one_mul, starRingEnd_self_apply] using h end Bounty end section /- Continuous squared norms attain their supremum on each closed unit interval. -/ open Set namespace Bounty noncomputable def unitIntervalEnergySup (f : ℝ → ℂ) (j : ℤ) : ℝ := sSup ((fun t => ‖f t‖ ^ 2) '' Icc (j : ℝ) ((j : ℝ) + 1)) theorem exists_unit_interval_energy_max (f : ℝ → ℂ) (hf : Continuous f) (j : ℤ) : ∃ t ∈ Icc (j : ℝ) ((j : ℝ) + 1), unitIntervalEnergySup f j = ‖f t‖ ^ 2 := by obtain ⟨t, ht, hmax⟩ := isCompact_Icc.exists_isMaxOn (nonempty_Icc.mpr (by linarith : (j : ℝ) ≤ (j : ℝ) + 1)) (hf.norm.pow 2).continuousOn refine ⟨t, ht, ?_⟩ apply IsGreatest.csSup_eq refine ⟨mem_image_of_mem _ ht, ?_⟩ rintro y ⟨v, hv, rfl⟩ exact hmax hv theorem unit_interval_energy_sup_nonneg (f : ℝ → ℂ) (hf : Continuous f) (j : ℤ) : 0 ≤ unitIntervalEnergySup f j := by obtain ⟨t, _, ht⟩ := exists_unit_interval_energy_max f hf j rw [ht] positivity end Bounty end section open Set namespace Bounty def mixedForwardDifference : List ℝ → (ℝ → ℝ) → ℝ → ℝ | [], f, x => f x | h :: hs, f, x => mixedForwardDifference hs f (x+h) - mixedForwardDifference hs f x theorem mixed_forward_difference_const_mul (hs : List ℝ) (f : ℝ → ℝ) (a x : ℝ) : mixedForwardDifference hs (fun y => a * f y) x = a * mixedForwardDifference hs f x := by induction hs generalizing x with | nil => rfl | cons h hs ih => simp only [mixedForwardDifference, ih]; ring theorem mixed_forward_difference_hasDerivAt (hs : List ℝ) (f g : ℝ → ℝ) (c : ℝ) (hhs : ∀ h ∈ hs, 0 ≤ h) (hfg : ∀ x, c < x → HasDerivAt f (g x) x) (x : ℝ) (hx : c < x) : HasDerivAt (mixedForwardDifference hs f) (mixedForwardDifference hs g x) x := by induction hs generalizing x with | nil => exact hfg x hx | cons h hs ih => have hh : 0 ≤ h := hhs h (by simp) have htail : ∀ a ∈ hs, 0 ≤ a := fun a ha => hhs a (by simp [ha]) have hp := (ih htail (x+h) (by linarith)).comp x ((hasDerivAt_id x).add_const h) simpa only [mixedForwardDifference, one_mul, mul_one, Function.comp_def, id_eq, Pi.sub_apply, Pi.sub_def] using hp.sub (ih htail x hx) theorem mixed_forward_difference_mean_value (hs : List ℝ) (F : ℕ → ℝ → ℝ) (c : ℝ) (hhs : ∀ h ∈ hs, 0 ≤ h) (hF : ∀ k x, c < x → HasDerivAt (F k) (F (k+1) x) x) (k : ℕ) (x : ℝ) (hx : c < x) : ∃ y ∈ Icc x (x+hs.sum), mixedForwardDifference hs (F k) x = hs.prod * F (k+hs.length) y := by induction hs generalizing k x with | nil => exact ⟨x, by simp, by simp [mixedForwardDifference]⟩ | cons h hs ih => have hh : 0 ≤ h := hhs h (by simp) have htail : ∀ a ∈ hs, 0 ≤ a := fun a ha => hhs a (by simp [ha]) have hsum : 0 ≤ hs.sum := List.sum_nonneg htail by_cases hzero : h = 0 · subst h exact ⟨x, by simpa using hsum, by simp [mixedForwardDifference]⟩ have hhpos : 0 < h := lt_of_le_of_ne hh (Ne.symm hzero) have hder : ∀ y, c < y → HasDerivAt (mixedForwardDifference hs (F k)) (mixedForwardDifference hs (F (k+1)) y) y := fun y hy => mixed_forward_difference_hasDerivAt hs (F k) (F (k+1)) c htail (hF k) y hy obtain ⟨y, hy, hyeq⟩ := exists_hasDerivAt_eq_slope (mixedForwardDifference hs (F k)) (mixedForwardDifference hs (F (k+1))) (show x < x+h by linarith) (fun y hy => (hder y (by linarith [hy.1])).continuousAt.continuousWithinAt) (fun y hy => hder y (by linarith [hy.1])) obtain ⟨z, hz, hzeq⟩ := ih htail (k+1) y (by linarith [hy.1]) refine ⟨z, ?_, ?_⟩ · simp only [List.sum_cons, mem_Icc] constructor <;> linarith [hy.1, hy.2, hz.1, hz.2] · have heq : mixedForwardDifference (h::hs) (F k) x = h * mixedForwardDifference hs (F (k+1)) y := by dsimp only [mixedForwardDifference] have hd : x+h-x = h := by ring rw [hd] at hyeq exact (eq_div_iff hzero).mp hyeq |>.symm.trans (mul_comm _ _) rw [heq, hzeq] simp only [List.prod_cons, List.length_cons] have hk : k+1+hs.length = k+(hs.length+1) := by omega rw [hk] ring end Bounty end section namespace Bounty noncomputable def vanDerCorputScalarBound (H B : ℝ) : ℕ → ℝ | 0 => B | m+1 => Real.sqrt (2/H+4*vanDerCorputScalarBound H B m) theorem van_der_corput_scalar_bound_nonneg (H B : ℝ) (hB : 0 ≤ B) (m : ℕ) : 0 ≤ vanDerCorputScalarBound H B m := by cases m with | zero => exact hB | succ m => exact Real.sqrt_nonneg _ end Bounty end section /- Iterated square roots record the exponent loss in repeated differencing. -/ namespace Bounty noncomputable def repeatedSquareRoot : ℕ → ℝ → ℝ | 0, x => x | n+1, x => Real.sqrt (repeatedSquareRoot n x) theorem repeated_square_root_nonneg (n : ℕ) {x : ℝ} (hx : 0 ≤ x) : 0 ≤ repeatedSquareRoot n x := by cases n with | zero => exact hx | succ n => exact Real.sqrt_nonneg _ theorem repeated_square_root_le_one (n : ℕ) {x : ℝ} (hx : x ≤ 1) : repeatedSquareRoot n x ≤ 1 := by induction n with | zero => exact hx | succ n ih => exact Real.sqrt_le_one.mpr ih theorem le_repeated_square_root (n : ℕ) {x : ℝ} (hx : x ≤ 1) : x ≤ repeatedSquareRoot n x := by induction n with | zero => exact le_rfl | succ n ih => exact ih.trans (Real.le_sqrt_self_iff.mpr (repeated_square_root_le_one n hx)) theorem repeated_square_root_eq_rpow (n : ℕ) {x : ℝ} (hx : 0 ≤ x) : repeatedSquareRoot n x = x^((2:ℝ)^n)⁻¹ := by induction n with | zero => simp [repeatedSquareRoot] | succ n ih => change Real.sqrt (repeatedSquareRoot n x) = _ rw [ih,Real.sqrt_eq_rpow,← Real.rpow_mul hx] congr 1 rw [pow_succ] field_simp end Bounty end section /- A finite family of overlapping derivative ranges covers all relevant frequencies. -/ namespace Bounty theorem exists_derivative_order_interval (K : ℕ) (v ε : ℝ) (hε : 0 < ε) (hεhalf : ε ≤ 1/2) (hv : 1 ≤ v) (hvK : v ≤ K-ε) : ∃ k : ℕ, 2 ≤ k ∧ k ≤ K ∧ (k : ℝ)-2+ε ≤ v ∧ v ≤ (k : ℝ)-ε := by refine ⟨Nat.ceil (v+ε), ?_, ?_, ?_, ?_⟩ · have h : 1+1 ≤ Nat.ceil (v+ε) := Nat.add_one_le_ceil_iff.mpr (by norm_num; linarith) exact h · apply Nat.ceil_le.mpr linarith · have h := Nat.ceil_lt_add_one (show 0 ≤ v+ε by linarith) linarith · have h := Nat.le_ceil (v+ε) linarith theorem exists_derivative_order_power_band (K : ℕ) (N u ε : ℝ) (hN : 1 < N) (hε : 0 < ε) (hεhalf : ε ≤ 1/2) (hu : N ≤ u) (huK : u ≤ N^((K : ℝ)-ε)) : ∃ k : ℕ, 2 ≤ k ∧ k ≤ K ∧ N^((k : ℝ)-2+ε) ≤ u ∧ u ≤ N^((k : ℝ)-ε) := by have hup : 0 < u := lt_of_lt_of_le (by linarith) hu have hv : 1 ≤ Real.logb N u := (Real.le_logb_iff_rpow_le hN hup).mpr (by simpa using hu) have hvK : Real.logb N u ≤ (K : ℝ)-ε := (Real.logb_le_iff_le_rpow hN hup).mpr huK obtain ⟨k,hk2,hkK,hlo,hhi⟩ := exists_derivative_order_interval K (Real.logb N u) ε hε hεhalf hv hvK exact ⟨k,hk2,hkK,(Real.le_logb_iff_rpow_le hN hup).mp hlo, (Real.logb_le_iff_le_rpow hN hup).mp hhi⟩ end Bounty end section /- Uniform comparison of the decay exponents for finitely many derivative orders. -/ namespace Bounty theorem derivative_decay_exponent_eq (ε : ℝ) (k : ℕ) (hk : 2 ≤ k) : (ε/(2*(k : ℝ)))/(2:ℝ)^(k-2) = ε/((k : ℝ)*(2:ℝ)^(k-1)) := by have he : k-1 = k-2+1 := by omega rw [he,pow_succ,div_div] congr 1 ring theorem derivative_decay_exponent_antitone {ε : ℝ} (hε : 0 ≤ ε) {k K : ℕ} (hk : 2 ≤ k) (hkK : k ≤ K) : ε/((K : ℝ)*(2:ℝ)^(K-1)) ≤ ε/((k : ℝ)*(2:ℝ)^(k-1)) := by have hkR : (0 : ℝ) < k := by exact_mod_cast (show 0 < k by omega) apply div_le_div_of_nonneg_left hε (mul_pos hkR (by positivity)) apply mul_le_mul · exact_mod_cast hkK · exact pow_le_pow_right₀ (by norm_num) (Nat.sub_le_sub_right hkK 1) · positivity · positivity end Bounty end section /- Exact removal of a prescribed marked subset, retaining its overlap damping. -/ open Finset open scoped Classical namespace Bounty noncomputable def finiteMarkedVertex {T : Type*} [Fintype T] (marked : Finset T) (hit : T → Prop) (q : ℝ) : ℝ := ∏ p, if p ∈ marked then (if hit p then 1 else 0) else if hit p then q else 1 theorem finite_marked_vertex_factor {T : Type*} [Fintype T] (marked : Finset T) (hit : T → Prop) (q : ℝ) : finiteMarkedVertex marked hit q = (∏ p ∈ marked, if hit p then (1 : ℝ) else 0) * q ^ ((univ \ marked).filter hit).card := by classical rw [← unmarked_damping_product] have hi : (∏ p ∈ marked, if hit p then (1 : ℝ) else 0) = ∏ p, if p ∈ marked then (if hit p then (1 : ℝ) else 0) else 1 := by simpa only [filter_mem_eq_inter, univ_inter] using (prod_filter (s := (univ : Finset T)) (fun p => p ∈ marked) (fun p => if hit p then (1 : ℝ) else 0)) rw [hi, ← prod_mul_distrib] apply prod_congr rfl intro p _ by_cases hm : p ∈ marked <;> by_cases hh : hit p <;> simp [hm, hh] theorem finite_shared_vertex_removal {T : Type*} [Fintype T] (marked shared : Finset T) (hit fullHit : T → Prop) (q : ℝ) (hsub : shared ⊆ marked) (hfull : ∀ p, fullHit p ↔ p ∈ shared ∨ hit p) : finiteMarkedVertex marked fullHit q * (∏ p ∈ shared, if hit p then q else 1) = finiteMarkedVertex (marked \ shared) hit q := by classical have hs : (∏ p ∈ shared, if hit p then q else 1) = ∏ p, if p ∈ shared then (if hit p then q else 1) else 1 := by simpa only [filter_mem_eq_inter, univ_inter] using (prod_filter (s := (univ : Finset T)) (fun p => p ∈ shared) (fun p => if hit p then q else 1)) rw [hs, finiteMarkedVertex, finiteMarkedVertex, ← prod_mul_distrib] apply prod_congr rfl intro p _ by_cases hs : p ∈ shared · have hm := hsub hs have hf := (hfull p).mpr (Or.inl hs) by_cases hh : hit p <;> simp [hs, hm, hf, hh] · have hf : fullHit p ↔ hit p := by simpa only [hs, false_or] using hfull p by_cases hm : p ∈ marked <;> by_cases hh : hit p <;> simp [hs, hm, hf, hh] theorem physical_vertex_weight_as_finite {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (q : ℝ) (n : ℤ) : physicalVertexWeight L q n = finiteMarkedVertex (physicalMarkedPrimes L) (fun p : PhysicalPrime P => (p.2.val : ℤ) ∣ n) q := by rw [physical_vertex_weight_factor, finite_marked_vertex_factor] congr 1 · apply prod_congr rfl intro p _ split_ifs <;> rfl · congr 2 ext p simp only [mem_filter, mem_sdiff] end Bounty end section /- Bounds for forbidden values and repeated coordinates in the shared draw itself. -/ open Finset open scoped Classical namespace Bounty theorem clean_auxiliary_forbidden_mass_le {A P : Type*} [Fintype A] [DecidableEq A] [Fintype P] (μ : P → ℝ) (hμ0 : ∀ p, 0 ≤ μ p) (hμ : ∑ p, μ p = 1) (T : Finset P) (a₀ : ℝ) (hatom : ∀ p, μ p ≤ a₀) : (∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if ∃ a, aux a ∈ T then 1 else 0)) ≤ (Fintype.card A : ℝ) * T.card * a₀ := by have he (aux : A → P) : (∃ a, aux a ∈ T) ↔ ∃ a, ∃ p : T, aux a = p.val := by constructor · rintro ⟨a, ha⟩ exact ⟨a, ⟨aux a, ha⟩, rfl⟩ · rintro ⟨a, p, hp⟩ exact ⟨a, hp ▸ p.property⟩ simp_rw [he] simpa only [Fintype.card_coe] using clean_auxiliary_hits_mass_le (A := A) μ hμ0 hμ (fun p : T => p.val) a₀ hatom theorem clean_auxiliary_two_coordinate_mass {A P : Type*} [Fintype A] [DecidableEq A] [Fintype P] (μ : P → ℝ) (hμ : ∑ p, μ p = 1) (a b : A) (hab : a ≠ b) (f g : P → ℝ) : (∑ aux : A → P, cleanAuxiliaryWeight μ aux * f (aux a) * g (aux b)) = (∑ p, μ p * f p) * ∑ p, μ p * g p := by let factors (i : A) (p : P) := μ p * (if i = a then f p else if i = b then g p else 1) have hp (aux : A → P) : cleanAuxiliaryWeight μ aux * f (aux a) * g (aux b) = ∏ i, factors i (aux i) := by simp only [factors, prod_mul_distrib, cleanAuxiliaryWeight] rw [mul_assoc] congr 1 rw [prod_eq_mul_of_mem a b (mem_univ _) (mem_univ _) hab] · simp only [ite_true, if_neg (Ne.symm hab)] · rintro i _ ⟨hia, hib⟩ simp [hia, hib] simp_rw [hp] rw [← Fintype.prod_sum factors, prod_eq_mul_of_mem a b (mem_univ _) (mem_univ _) hab] · simp [factors, Ne.symm hab] · rintro i _ ⟨hia, hib⟩ simpa only [factors, if_neg hia, if_neg hib, mul_one] using hμ theorem clean_auxiliary_pair_collision_mass_le {A P : Type*} [Fintype A] [DecidableEq A] [Fintype P] (μ : P → ℝ) (hμ0 : ∀ p, 0 ≤ μ p) (hμ : ∑ p, μ p = 1) (a b : A) (hab : a ≠ b) (a₀ : ℝ) (hatom : ∀ p, μ p ≤ a₀) : (∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if aux a = aux b then 1 else 0)) ≤ a₀ := by have he (aux : A → P) : (if aux a = aux b then (1 : ℝ) else 0) = ∑ p, (if aux a = p then (1 : ℝ) else 0) * (if aux b = p then 1 else 0) := by simp [eq_comm] simp_rw [he, mul_sum, ← mul_assoc] rw [sum_comm] calc _ = ∑ p, μ p * μ p := by apply sum_congr rfl intro p _ rw [clean_auxiliary_two_coordinate_mass μ hμ a b hab (fun z => if z = p then 1 else 0) (fun z => if z = p then 1 else 0)] simp _ ≤ ∑ p, μ p * a₀ := sum_le_sum (fun p _ => mul_le_mul_of_nonneg_left (hatom p) (hμ0 p)) _ = a₀ := by rw [← sum_mul, hμ, one_mul] theorem clean_auxiliary_repeated_mass_le {A P : Type*} [Fintype A] [DecidableEq A] [Fintype P] (μ : P → ℝ) (hμ0 : ∀ p, 0 ≤ μ p) (hμ : ∑ p, μ p = 1) (a₀ : ℝ) (ha₀ : 0 ≤ a₀) (hatom : ∀ p, μ p ≤ a₀) : (∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if ¬Function.Injective aux then 1 else 0)) ≤ (Fintype.card A : ℝ)^2 * a₀ := by have he (aux : A → P) : ¬Function.Injective aux ↔ ∃ z : A × A, z.1 ≠ z.2 ∧ aux z.1 = aux z.2 := by constructor · intro h by_contra hn apply h intro a b hab by_contra hne exact hn ⟨⟨a, b⟩, hne, hab⟩ · rintro ⟨⟨a, b⟩, hne, he⟩ hi exact hne (hi he) have hu := clean_weighted_exists_le_sum (Ω := A → P) (J := A × A) (fun aux => cleanAuxiliaryWeight μ aux) (fun aux => prod_nonneg (fun i _ => hμ0 (aux i))) (fun z aux => z.1 ≠ z.2 ∧ aux z.1 = aux z.2) calc _ ≤ ∑ z : A × A, ∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if z.1 ≠ z.2 ∧ aux z.1 = aux z.2 then 1 else 0) := by convert hu using 1 · apply sum_congr rfl intro aux _ congr 1 by_cases hi : ¬Function.Injective aux · rw [if_pos hi, if_pos ((he aux).mp hi)] · rw [if_neg hi, if_neg (fun h => hi ((he aux).mpr h))] · apply sum_congr rfl intro z _ apply sum_congr rfl intro aux _ congr 1 split_ifs <;> rfl _ ≤ ∑ _z : A × A, a₀ := by apply sum_le_sum intro z _ by_cases hz : z.1 = z.2 · simpa only [hz, ne_eq, not_true_eq_false, false_and, if_false, mul_zero, sum_const_zero] using ha₀ · have heq : (∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if z.1 ≠ z.2 ∧ aux z.1 = aux z.2 then 1 else 0)) = ∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if aux z.1 = aux z.2 then 1 else 0) := by apply sum_congr rfl intro aux _ by_cases he : aux z.1 = aux z.2 <;> simp [hz, he] rw [heq] exact clean_auxiliary_pair_collision_mass_le μ hμ0 hμ z.1 z.2 hz a₀ hatom _ = _ := by simp [Fintype.card_prod, pow_two, mul_assoc] theorem clean_auxiliary_forbidden_or_repeated_mass_le {A P : Type*} [Fintype A] [DecidableEq A] [Fintype P] (μ : P → ℝ) (hμ0 : ∀ p, 0 ≤ μ p) (hμ : ∑ p, μ p = 1) (T : Finset P) (a₀ : ℝ) (ha₀ : 0 ≤ a₀) (hatom : ∀ p, μ p ≤ a₀) : (∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if (∃ a, aux a ∈ T) ∨ ¬Function.Injective aux then 1 else 0)) ≤ (Fintype.card A : ℝ) * (T.card + Fintype.card A) * a₀ := by calc _ ≤ (∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if ∃ a, aux a ∈ T then 1 else 0)) + ∑ aux : A → P, cleanAuxiliaryWeight μ aux * (if ¬Function.Injective aux then 1 else 0) := by rw [← sum_add_distrib] apply sum_le_sum intro aux _ have hn : 0 ≤ cleanAuxiliaryWeight μ aux := prod_nonneg (fun i _ => hμ0 (aux i)) by_cases hh : ∃ a, aux a ∈ T <;> by_cases hi : Function.Injective aux <;> simp [hh, hi, hn] _ ≤ (Fintype.card A : ℝ) * T.card * a₀ + (Fintype.card A : ℝ)^2 * a₀ := add_le_add (clean_auxiliary_forbidden_mass_le μ hμ0 hμ T a₀ hatom) (clean_auxiliary_repeated_mass_le μ hμ0 hμ a₀ ha₀ hatom) _ = _ := by ring end Bounty end section /- Exact loss from restricting a normalized finite draw when its coefficient is independent of that draw. -/ open Finset open scoped Classical namespace Bounty theorem finite_constant_restriction_error {S : Type*} [Fintype S] (μ : S → ℝ) (hμ0 : ∀ s, 0 ≤ μ s) (hμ : ∑ s, μ s = 1) (good : S → Prop) [DecidablePred good] (c : ℂ) : ‖(∑ s, if good s then (μ s : ℂ) * c else 0) - c‖ = (∑ s, μ s * (if ¬good s then 1 else 0)) * ‖c‖ := by let a : ℝ := ∑ s, μ s * (if good s then 1 else 0) let b : ℝ := ∑ s, μ s * (if ¬good s then 1 else 0) have hab : a + b = 1 := by rw [← hμ] dsimp only [a, b] rw [← sum_add_distrib] apply sum_congr rfl intro s _ by_cases hs : good s <;> simp [hs] have hb : 0 ≤ b := sum_nonneg (fun s _ => mul_nonneg (hμ0 s) (by split_ifs <;> norm_num)) have he : (∑ s, if good s then (μ s : ℂ) * c else 0) = (a : ℂ) * c := by dsimp only [a] rw [Complex.ofReal_sum, sum_mul] apply sum_congr rfl intro s _ by_cases hs : good s <;> simp [hs] have hd : (a : ℂ) * c - c = ((a : ℂ) - 1) * c := by ring rw [he, hd] have hh : (a : ℂ) - 1 = -(b : ℂ) := by exact_mod_cast (show a - 1 = -b by linarith) rw [hh, norm_mul, norm_neg, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hb] end Bounty end section /- Quantitative square-root consequences of polynomial curvature bounds. -/ namespace Bounty theorem sqrt_scaled_rpow {N c : ℝ} (hN : 0 < N) (hc : 0 ≤ c) (p : ℝ) : Real.sqrt (c*N^p) = Real.sqrt c*N^(p/2) := by rw [Real.sqrt_mul hc,Real.sqrt_eq_rpow (N^p),← Real.rpow_mul hN.le] congr 1 ring theorem curvature_sqrt_power_bounds {N eps c C lam : ℝ} (hN : 1 ≤ N) (heps : 0 ≤ eps) (hc : 0 < c) (hC : 0 ≤ C) (hlo : c*N^(-2+eps) ≤ lam) (hhi : lam ≤ C*N^(-eps/2)) : Real.sqrt lam ≤ Real.sqrt C*N^(-eps/4) ∧ 1/Real.sqrt lam ≤ (N/Real.sqrt c)*N^(-eps/4) := by have hN0 : 0 < N := by linarith have hsc : 0 < Real.sqrt c := Real.sqrt_pos.mpr hc have hp : 0 < N^(-1+eps/2) := Real.rpow_pos_of_pos hN0 _ have hlo' := Real.sqrt_le_sqrt hlo have hhi' := Real.sqrt_le_sqrt hhi rw [sqrt_scaled_rpow hN0 hc.le] at hlo' rw [sqrt_scaled_rpow hN0 hC] at hhi' have he1 : (-2+eps)/2 = -1+eps/2 := by ring have he2 : (-eps/2)/2 = -eps/4 := by ring rw [he1] at hlo' rw [he2] at hhi' refine ⟨hhi',?_⟩ have hinv := one_div_le_one_div_of_le (mul_pos hsc hp) hlo' have hpow : N^(-1+eps/2)*N*N^(-eps/2) = 1 := by calc _ = N^((-1+eps/2)+1+(-eps/2)) := by rw [Real.rpow_add hN0 ((-1+eps/2)+1) (-eps/2), Real.rpow_add hN0 (-1+eps/2) 1,Real.rpow_one] _ = 1 := by have he : (-1+eps/2)+1+(-eps/2) = 0 := by ring rw [he,Real.rpow_zero] have hid : 1/(Real.sqrt c*N^(-1+eps/2)) = (N/Real.sqrt c)*N^(-eps/2) := by apply (div_eq_iff (ne_of_gt (mul_pos hsc hp))).mpr calc 1 = (Real.sqrt c/Real.sqrt c)*(N^(-1+eps/2)*N*N^(-eps/2)) := by rw [div_self hsc.ne',hpow,one_mul] _ = _ := by ring rw [hid] at hinv exact hinv.trans (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le hN (by linarith : -eps/2 ≤ -eps/4)) (by positivity)) theorem curvature_test_power_saving {N eps c C lam A D M : ℝ} (hN : 1 ≤ N) (heps : 0 ≤ eps) (hc : 0 < c) (hC : 0 ≤ C) (hA : 0 ≤ A) (hD : 0 ≤ D) (hM : 0 ≤ M) (hlen : M ≤ D*N) (hlo : c*N^(-2+eps) ≤ lam) (hhi : lam ≤ C*N^(-eps/2)) : 6*(A*M*Real.sqrt lam+2/Real.sqrt lam) ≤ (6*(A*D*Real.sqrt C+2/Real.sqrt c))*N*N^(-eps/4) := by obtain ⟨hroot,hinv⟩ := curvature_sqrt_power_bounds hN heps hc hC hlo hhi have ht1 : A*M*Real.sqrt lam ≤ A*(D*N)*(Real.sqrt C*N^(-eps/4)) := mul_le_mul (mul_le_mul_of_nonneg_left hlen hA) hroot (Real.sqrt_nonneg _) (by positivity) have ht2 : 2/Real.sqrt lam ≤ 2*((N/Real.sqrt c)*N^(-eps/4)) := by have h := mul_le_mul_of_nonneg_left hinv (show (0 : ℝ) ≤ 2 by norm_num) simpa only [mul_one_div] using h calc _ ≤ 6*(A*(D*N)*(Real.sqrt C*N^(-eps/4))+2*((N/Real.sqrt c)*N^(-eps/4))) := by linarith _ = _ := by ring end Bounty end section namespace Bounty noncomputable def logarithmicAmbientLeft (N c : ℝ) : ℤ := Int.ceil (N-c) noncomputable def logarithmicAmbientRight (N C c : ℝ) : ℤ := logarithmicAmbientLeft N c + (Nat.ceil (C*N):ℤ) theorem logarithmic_ambient_interval_contains (N C c : ℝ) (a b : ℤ) (hN : 1 ≤ N) (hC : 1 ≤ C) (ha : N ≤ (a:ℝ)+c) (hb : (b:ℝ)+1+c ≤ C*N) : logarithmicAmbientLeft N c ≤ a ∧ b ≤ logarithmicAmbientRight N C c := by constructor · apply Int.ceil_le.mpr linarith · have hleft := Int.le_ceil (N-c) have hright := Nat.le_ceil (C*N) have hh : (b:ℝ) ≤ (logarithmicAmbientRight N C c : ℝ) := by simp only [logarithmicAmbientRight, logarithmicAmbientLeft, Int.cast_add, Int.cast_natCast] linarith exact_mod_cast hh theorem logarithmic_ambient_length_bounds (N C c : ℝ) (hN : 1 ≤ N) (hC : 1 ≤ C) : N ≤ ((logarithmicAmbientRight N C c-logarithmicAmbientLeft N c+1:ℤ):ℝ) ∧ ((logarithmicAmbientRight N C c-logarithmicAmbientLeft N c+1:ℤ):ℝ) ≤ (C+2)*N := by have hCN : 0 ≤ C*N := by positivity have hlo := Nat.le_ceil (C*N) have hhi := Nat.ceil_lt_add_one hCN simp only [logarithmicAmbientRight, add_sub_cancel_left, Int.cast_add, Int.cast_natCast, Int.cast_one] constructor <;> nlinarith theorem logarithmic_ambient_order (N C c : ℝ) : logarithmicAmbientLeft N c ≤ logarithmicAmbientRight N C c := by dsimp only [logarithmicAmbientRight] omega theorem logarithmic_ambient_box (N C c s x : ℝ) (hN : 1 ≤ N) (hC : 1 ≤ C) (hs : s ≤ N) (hx : x ∈ Set.Icc (logarithmicAmbientLeft N c:ℝ) ((logarithmicAmbientRight N C c:ℝ)+1)) : N ≤ x+c ∧ x+c+s ≤ (C+5)*N := by have hl := Int.le_ceil (N-c) have hu := Int.ceil_lt_add_one (N-c) have hv := Nat.ceil_lt_add_one (show 0 ≤ C*N by positivity) simp only [logarithmicAmbientRight, logarithmicAmbientLeft, Int.cast_add, Int.cast_natCast] at hx constructor <;> nlinarith [hx.1,hx.2] end Bounty end section namespace Bounty theorem logarithmic_shift_power_le_sqrt (N ε : ℝ) (k : ℕ) (hN : 1 ≤ N) (hε : ε ≤ 1) (hk : 2 ≤ k) : N^(ε/(2*(k:ℝ))) ≤ Real.sqrt N := by have hkR : (2:ℝ) ≤ k := by exact_mod_cast hk rw [Real.sqrt_eq_rpow] apply Real.rpow_le_rpow_of_exponent_le hN apply (div_le_iff₀ (show 0 < 2*(k:ℝ) by positivity)).mpr linarith theorem logarithmic_shift_sum_le_scale (N ε : ℝ) (k : ℕ) (hs : List ℤ) (hN : 1 ≤ N) (hε : ε ≤ 1) (hk : 2 ≤ k) (hkN : (k:ℝ)^2 ≤ N) (hlen : hs.length = k-2) (hshifts : ∀ h ∈ hs, h ≤ (Nat.floor (N^(ε/(2*(k:ℝ)))):ℤ)) : (hs.map (fun h : ℤ => (h:ℝ))).sum ≤ N := by have hN0 : 0 ≤ N := by linarith have hpow := logarithmic_shift_power_le_sqrt N ε k hN hε hk have hfloor := Nat.floor_le (Real.rpow_nonneg hN0 (ε/(2*(k:ℝ)))) have hpoint : ∀ h ∈ hs.map (fun h : ℤ => (h:ℝ)), h ≤ Real.sqrt N := by intro h hh obtain ⟨z,hz,rfl⟩ := List.mem_map.mp hh have hz' : (z:ℝ) ≤ (Nat.floor (N^(ε/(2*(k:ℝ)))):ℝ) := by exact_mod_cast hshifts z hz exact hz'.trans (hfloor.trans hpow) have hsum := List.sum_le_card_nsmul (hs.map (fun h : ℤ => (h:ℝ))) (Real.sqrt N) hpoint have hlenR : (hs.length:ℝ) ≤ k := by exact_mod_cast (show hs.length ≤ k by omega) calc _ ≤ (hs.length:ℝ)*Real.sqrt N := by simpa only [List.length_map, nsmul_eq_mul] using hsum _ ≤ (k:ℝ)*Real.sqrt N := mul_le_mul_of_nonneg_right hlenR (Real.sqrt_nonneg _) _ ≤ N := by have hsqr := Real.sq_sqrt hN0 have hkR : (0:ℝ) ≤ k := Nat.cast_nonneg _ have hkle : (k:ℝ) ≤ Real.sqrt N := by nlinarith [Real.sqrt_nonneg N] nlinarith [Real.sqrt_nonneg N] theorem logarithmic_floor_shift_bounds (N ε : ℝ) (k : ℕ) (hN : 1 ≤ N) (hε : ε ≤ 1) (hk : 2 ≤ k) (hpow2 : 2 ≤ N^(ε/(2*(k:ℝ)))) : 1 ≤ (Nat.floor (N^(ε/(2*(k:ℝ)))):ℤ) ∧ (Nat.floor (N^(ε/(2*(k:ℝ)))):ℝ) ≤ N := by have hN0 : 0 ≤ N := by linarith have hf := Nat.lt_floor_add_one (N^(ε/(2*(k:ℝ)))) have hfloor := Nat.floor_le (Real.rpow_nonneg hN0 (ε/(2*(k:ℝ)))) constructor · have hpos : (0:ℝ) < (Nat.floor (N^(ε/(2*(k:ℝ)))):ℝ) := by linarith exact_mod_cast (show 1 ≤ Nat.floor (N^(ε/(2*(k:ℝ)))) by exact_mod_cast hpos) · have hp := logarithmic_shift_power_le_sqrt N ε k hN hε hk have hsqrtN : Real.sqrt N ≤ N := by nlinarith [Real.sq_sqrt hN0, Real.sqrt_nonneg N] exact hfloor.trans (hp.trans hsqrtN) end Bounty end section /- Exact divisor-majorant rearrangement and norm bounds for oscillatory tests. -/ open Finset namespace Bounty theorem interval_divisor_sum_rearrange (a b : ℕ) (lam : ℕ → ℂ) (F : ℕ → ℂ) : (∑ n ∈ Ioc a b, (∑ d ∈ n.divisors, lam d)*F n) = ∑ d ∈ Icc 1 b, lam d*(∑ n ∈ (Ioc a b).filter (fun n => d ∣ n), F n) := by classical have hdiv (n : ℕ) (hn : n ∈ Ioc a b) : n.divisors = (Icc 1 b).filter (fun d => d ∣ n) := by have hn' := mem_Ioc.mp hn have hnp : 0 < n := lt_of_le_of_lt (Nat.zero_le _) hn'.1 ext d simp only [Nat.mem_divisors,mem_filter,mem_Icc] constructor · rintro ⟨hd,hn0⟩ exact ⟨⟨Nat.pos_of_dvd_of_pos hd hnp,(Nat.le_of_dvd hnp hd).trans hn'.2⟩,hd⟩ · rintro ⟨hd,hdn⟩ exact ⟨hdn,hnp.ne'⟩ calc _ = ∑ n ∈ Ioc a b, ∑ d ∈ Icc 1 b, if d ∣ n then lam d*F n else 0 := by apply sum_congr rfl intro n hn rw [hdiv n hn,sum_mul,sum_filter] _ = ∑ d ∈ Icc 1 b, ∑ n ∈ Ioc a b, if d ∣ n then lam d*F n else 0 := sum_comm _ = _ := by apply sum_congr rfl intro d hd rw [mul_sum,sum_filter] theorem interval_divisor_sum_norm_bound (a b : ℕ) (lam : ℕ → ℂ) (F : ℕ → ℂ) (R : ℕ → ℝ) (hR : ∀ d ∈ Icc 1 b, lam d ≠ 0 → ‖∑ n ∈ (Ioc a b).filter (fun n => d ∣ n), F n‖ ≤ R d) : ‖∑ n ∈ Ioc a b, (∑ d ∈ n.divisors, lam d)*F n‖ ≤ ∑ d ∈ Icc 1 b, ‖lam d‖*R d := by rw [interval_divisor_sum_rearrange] apply (norm_sum_le _ _).trans apply sum_le_sum intro d hd by_cases hz : lam d = 0 · simp [hz] · rw [norm_mul] exact mul_le_mul_of_nonneg_left (hR d hd hz) (norm_nonneg _) end Bounty end section /- Exact interval reindexing of the multiples of a positive integer. -/ open Finset namespace Bounty theorem sum_interval_multiples (a b d : ℕ) (hd : 0 < d) (F : ℕ → ℂ) : ∑ n ∈ (Ioc a b).filter (fun n => d ∣ n), F n = ∑ m ∈ Ioc (a/d) (b/d), F (m*d) := by classical symm apply sum_bij (fun (m : ℕ) _ => m*d) · intro m hm obtain ⟨hl,hr⟩ := mem_Ioc.mp hm exact mem_filter.mpr ⟨mem_Ioc.mpr ⟨(Nat.div_lt_iff_lt_mul hd).mp hl, (Nat.le_div_iff_mul_le hd).mp hr⟩,dvd_mul_left d m⟩ · intro m hm n hn he exact Nat.eq_of_mul_eq_mul_right hd he · intro n hn obtain ⟨hn,hdn⟩ := mem_filter.mp hn obtain ⟨hl,hr⟩ := mem_Ioc.mp hn have he : n/d*d=n := Nat.div_mul_cancel hdn refine ⟨n/d, mem_Ioc.mpr ⟨?_, ?_⟩, he⟩ · apply (Nat.div_lt_iff_lt_mul hd).mpr rwa [he] · exact Nat.div_le_div_right hr · intro m hm rfl end Bounty end section /- Any Dirichlet character can be bounded using its individual residue-class phase sums. -/ open Finset namespace Bounty theorem character_sum_le_residue_phase_bounds {q : ℕ} [NeZero q] (S : Finset ℕ) (χ : DirichletCharacter ℂ q) (F : ℕ → ℂ) {E : ℝ} (hE : 0 ≤ E) (hclass : ∀ a : ZMod q, IsUnit a → ‖∑ n ∈ S.filter (fun n : ℕ => (n : ZMod q) = a), F n‖ ≤ E) : ‖∑ n ∈ S, χ (n : ZMod q)*F n‖ ≤ (q : ℝ)*E := by classical rw [← sum_fiberwise S (fun n : ℕ => (n : ZMod q)) (fun n => χ (n : ZMod q)*F n)] have he (a : ZMod q) : (∑ n ∈ S.filter (fun n : ℕ => (n : ZMod q) = a), χ (n : ZMod q)*F n) = χ a*(∑ n ∈ S.filter (fun n : ℕ => (n : ZMod q) = a), F n) := by rw [mul_sum] apply sum_congr rfl intro n hn rw [(mem_filter.mp hn).2] simp_rw [he] calc _ ≤ ∑ a : ZMod q, ‖χ a*(∑ n ∈ S.filter (fun n : ℕ => (n : ZMod q) = a), F n)‖ := norm_sum_le _ _ _ ≤ ∑ _a : ZMod q, E := by apply sum_le_sum intro a ha by_cases hau : IsUnit a · rw [norm_mul] exact (mul_le_mul_of_nonneg_right (χ.norm_le_one a) (norm_nonneg _)).trans (by simpa only [one_mul] using hclass a hau) · rw [MulChar.map_nonunit χ hau,zero_mul,norm_zero] exact hE _ = (q : ℝ)*E := by simp [ZMod.card] end Bounty end section /- Divisors in the complementary prime pool, with multiplicities retained. -/ open Finset namespace Bounty theorem primePoolFreePart_mul (P : Finset ℕ) {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) : primePoolFreePart P (a * b) = primePoolFreePart P a * primePoolFreePart P b := by apply Nat.eq_of_mul_eq_mul_left (Nat.mul_pos (Nat.pos_of_ne_zero (primePoolPart_ne_zero P a)) (Nat.pos_of_ne_zero (primePoolPart_ne_zero P b))) calc (primePoolPart P a * primePoolPart P b) * primePoolFreePart P (a * b) = primePoolPart P (a * b) * primePoolFreePart P (a * b) := by rw [primePoolPart_mul P ha hb] _ = a * b := primePoolPart_mul_primePoolFreePart P (a * b) _ = (primePoolPart P a * primePoolFreePart P a) * (primePoolPart P b * primePoolFreePart P b) := by rw [primePoolPart_mul_primePoolFreePart, primePoolPart_mul_primePoolFreePart] _ = _ := by ring theorem primePoolFreePart_eq_self_of_disjoint (P : Finset ℕ) {n : ℕ} (hn : n ≠ 0) (hfree : Disjoint n.primeFactors P) : primePoolFreePart P n = n := by have hp := primePoolPart_eq_one_of_disjoint hfree.symm (Nat.mem_factoredNumbers_of_primeFactors_subset hn (fun _ h => h)) rw [primePoolFreePart, hp, Nat.div_one] theorem dvd_primePoolFreePart_iff (P : Finset ℕ) {d n : ℕ} (hn : n ≠ 0) : d ∣ primePoolFreePart P n ↔ d ∣ n ∧ Disjoint d.primeFactors P := by constructor · intro hd refine ⟨dvd_trans hd (Nat.div_dvd_of_dvd (primePoolPart_dvd P n)), ?_⟩ exact (primePoolFreePart_primeFactors_disjoint P n).mono_left (Nat.primeFactors_mono hd (primePoolFreePart_ne_zero P hn)) · rintro ⟨hd, hfree⟩ obtain ⟨k, rfl⟩ := hd have hd0 : d ≠ 0 := by intro h; apply hn; simp [h] have hk0 : k ≠ 0 := by intro h; apply hn; simp [h] rw [primePoolFreePart_mul P hd0 hk0, primePoolFreePart_eq_self_of_disjoint P hd0 hfree] exact dvd_mul_right d _ theorem divisors_primePoolFreePart (P : Finset ℕ) {n : ℕ} (hn : n ≠ 0) : (primePoolFreePart P n).divisors = n.divisors.filter (fun d => Disjoint d.primeFactors P) := by classical ext d constructor · intro hd have h := (dvd_primePoolFreePart_iff P hn).mp (Nat.mem_divisors.mp hd).1 exact mem_filter.mpr ⟨Nat.mem_divisors.mpr ⟨h.1, hn⟩, h.2⟩ · intro hd obtain ⟨hd, hfree⟩ := mem_filter.mp hd exact Nat.mem_divisors.mpr ⟨(dvd_primePoolFreePart_iff P hn).mpr ⟨(Nat.mem_divisors.mp hd).1, hfree⟩, primePoolFreePart_ne_zero P hn⟩ end Bounty end section /- A three-region integral estimate on a bounded real interval. The low-region cost uses only the length of its enclosing interval, so no disjointness or overlap multiplicity is hidden in the conclusion. -/ open MeasureTheory Set namespace Bounty theorem three_regime_integral_le (R l A B C : ℝ) (f g h : ℝ → ℝ) (hf : Continuous f) (hg : Continuous g) (hh : Continuous h) (hl : 0 ≤ l) (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (E : Set ℝ) (hE : MeasurableSet E) (hED : E ⊆ Icc (-R) R) (hg0 : ∀ t ∈ Icc (-R) R, 0 ≤ g t) (hh0 : ∀ t ∈ Icc (-R) R, 0 ≤ h t) (hsmall : ∀ t ∈ Icc (-R) R, t ∉ E → f t ≤ A * g t) (hhigh : ∀ t ∈ E, l < |t| → f t ≤ B * h t) (hlow : ∀ t ∈ E, |t| ≤ l → f t ≤ C) : (∫ t in Icc (-R) R, f t) ≤ A * (∫ t in Icc (-R) R, g t) + B * (∫ t in E, h t) + 2 * l * C := by classical let D := Icc (-R) R let L := Icc (-l) l have hfD : IntegrableOn f D := hf.continuousOn.integrableOn_Icc have hgD : IntegrableOn g D := hg.continuousOn.integrableOn_Icc have hhD : IntegrableOn h D := hh.continuousOn.integrableOn_Icc have hcD : IntegrableOn (fun _ : ℝ => C) D := continuous_const.continuousOn.integrableOn_Icc have hcL : IntegrableOn (fun _ : ℝ => C) L := continuous_const.continuousOn.integrableOn_Icc have hLi : MeasurableSet L := measurableSet_Icc have hEi := hhD.indicator hE have hCi := hcD.indicator hLi have hpoint : ∀ t ∈ D, f t ≤ A * g t + B * E.indicator h t + L.indicator (fun _ => C) t := by intro t ht have hag : 0 ≤ A * g t := mul_nonneg hA (hg0 t ht) have hbh : 0 ≤ B * h t := mul_nonneg hB (hh0 t ht) by_cases he : t ∈ E · by_cases htl : |t| ≤ l · have htL : t ∈ L := abs_le.mp htl simpa only [indicator_of_mem he, indicator_of_mem htL] using (hlow t he htl).trans (by linarith : C ≤ A * g t + B * h t + C) · have htL : t ∉ L := fun hmem => htl (abs_le.mpr hmem) simpa only [indicator_of_mem he, indicator_of_notMem htL, add_zero] using (hhigh t he (lt_of_not_ge htl)).trans (by linarith : B * h t ≤ A * g t + B * h t) · by_cases htL : t ∈ L · simpa only [indicator_of_notMem he, indicator_of_mem htL, mul_zero, add_zero] using (hsmall t ht he).trans (by linarith : A * g t ≤ A * g t + C) · simpa only [indicator_of_notMem he, indicator_of_notMem htL, mul_zero, add_zero] using hsmall t ht he have hmajor := setIntegral_mono_on hfD (((hgD.const_mul A).add (hEi.const_mul B)).add hCi) measurableSet_Icc hpoint have hlowIntegral : (∫ t in D, L.indicator (fun _ => C) t) ≤ 2 * l * C := by rw [setIntegral_indicator hLi] calc (∫ t in D ∩ L, C) ≤ ∫ t in L, C := setIntegral_mono_set hcL (Filter.Eventually.of_forall fun _ => hC) (Filter.Eventually.of_forall fun _ ht => ht.2) _ = 2 * l * C := by rw [setIntegral_const, Real.volume_real_Icc_of_le (by linarith : -l ≤ l)] simp only [smul_eq_mul] ring have hDE : D ∩ E = E := inter_eq_right.mpr hED simp only [Pi.add_apply] at hmajor have hsplit₁ := integral_add ((hgD.const_mul A).add (hEi.const_mul B)) hCi have hsplit₂ := integral_add (hgD.const_mul A) (hEi.const_mul B) simp only [Pi.add_apply] at hsplit₁ hsplit₂ rw [hsplit₁, hsplit₂, integral_const_mul, integral_const_mul, setIntegral_indicator hE, hDE] at hmajor exact hmajor.trans (by linarith [hlowIntegral]) theorem three_regime_integral_bound (R l η Bs Bq Hq Lm Bt : ℝ) (S Q M T : ℝ → ℂ) (hS : Continuous S) (hQ : Continuous Q) (hM : Continuous M) (hT : Continuous T) (hl : 0 ≤ l) (hη : 0 ≤ η) (hBs : 0 ≤ Bs) (_hBq : 0 ≤ Bq) (hHq : 0 ≤ Hq) (_hLm : 0 ≤ Lm) (_hBt : 0 ≤ Bt) (hSbound : ∀ t ∈ Icc (-R) R, ‖S t‖ ≤ Bs) (hQbound : ∀ t ∈ Icc (-R) R, ‖Q t‖ ≤ Bq) (hTbound : ∀ t ∈ Icc (-R) R, ‖T t‖ ≤ Bt) (hhigh : ∀ t ∈ Icc (-R) R, η < ‖S t‖ → l < |t| → ‖Q t‖ ≤ Hq) (hlow : ∀ t ∈ Icc (-R) R, |t| ≤ l → ‖M t‖ ≤ Lm) : (∫ t in Icc (-R) R, ‖S t * Q t * M t * T t‖ ^ 2) ≤ η ^ 2 * (∫ t in Icc (-R) R, ‖Q t * M t * T t‖ ^ 2) + Bs ^ 2 * Hq ^ 2 * (∫ t in {t ∈ Icc (-R) R | η < ‖S t‖}, ‖M t * T t‖ ^ 2) + 2 * l * Bs ^ 2 * Bq ^ 2 * Lm ^ 2 * Bt ^ 2 := by have hsquare : ∀ t ∈ Icc (-R) R, ‖S t‖ ^ 2 ≤ Bs ^ 2 := fun t ht => (sq_le_sq₀ (norm_nonneg _) hBs).mpr (hSbound t ht) have h := three_regime_integral_le R l (η ^ 2) (Bs ^ 2 * Hq ^ 2) (Bs ^ 2 * Bq ^ 2 * Lm ^ 2 * Bt ^ 2) (fun t => ‖S t * Q t * M t * T t‖ ^ 2) (fun t => ‖Q t * M t * T t‖ ^ 2) (fun t => ‖M t * T t‖ ^ 2) (by fun_prop) (by fun_prop) (by fun_prop) hl (sq_nonneg _) (mul_nonneg (sq_nonneg _) (sq_nonneg _)) (by positivity) {t ∈ Icc (-R) R | η < ‖S t‖} (measurableSet_Icc.inter (isOpen_lt continuous_const hS.norm).measurableSet) (fun _ ht => ht.1) (fun _ _ => sq_nonneg _) (fun _ _ => sq_nonneg _) (by intro t ht he have hs : ‖S t‖ ≤ η := le_of_not_gt (fun hh => he ⟨ht, hh⟩) have hs2 := (sq_le_sq₀ (norm_nonneg _) hη).mpr hs simpa only [norm_mul, mul_pow, mul_assoc] using mul_le_mul_of_nonneg_right hs2 (sq_nonneg ‖Q t * M t * T t‖)) (by intro t ht htl have hq2 := (sq_le_sq₀ (norm_nonneg _) hHq).mpr (hhigh t ht.1 ht.2 htl) have hsq := mul_le_mul (hsquare t ht.1) hq2 (sq_nonneg _) (sq_nonneg _) simpa only [norm_mul, mul_pow, mul_assoc] using mul_le_mul_of_nonneg_right hsq (sq_nonneg ‖M t * T t‖)) (by intro t ht htl simp only [norm_mul, mul_pow] gcongr · exact hSbound t ht.1 · exact hQbound t ht.1 · exact hlow t ht.1 htl · exact hTbound t ht.1) convert h using 1 ring end Bounty end section /- Scalar decay and parameter order for the three frequency regimes. -/ namespace Bounty theorem three_regime_rpow_sq {L : ℝ} (hL : 0 < L) (a : ℝ) : (L ^ a) ^ (2 : ℕ) = L ^ (2 * a) := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL.le] congr 1 ring theorem three_regime_power_budget {L A Cmean Csparse s q t As H B B0 : ℝ} (hL : 4 ≤ L) (hAs : A + Cmean + 1 ≤ 2 * As) (hH : A + 2 * s + Csparse + 1 ≤ 2 * H) (hB : A + B0 + 2 * s + 2 * q + 2 * t + 1 ≤ 2 * B) : (L ^ (-As)) ^ (2 : ℕ) * L ^ Cmean + (L ^ s) ^ (2 : ℕ) * (L ^ (-H)) ^ (2 : ℕ) * L ^ Csparse + 2 * L ^ B0 * (L ^ s) ^ (2 : ℕ) * (L ^ q) ^ (2 : ℕ) * (L ^ (-B)) ^ (2 : ℕ) * (L ^ t) ^ (2 : ℕ) ≤ L ^ (-A) := by have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hout : (L ^ (-As)) ^ (2 : ℕ) * L ^ Cmean ≤ L ^ (-A - 1) := by rw [three_regime_rpow_sq hL0, ← Real.rpow_add hL0] apply Real.rpow_le_rpow_of_exponent_le hL1 linarith have hhigh : (L ^ s) ^ (2 : ℕ) * (L ^ (-H)) ^ (2 : ℕ) * L ^ Csparse ≤ L ^ (-A - 1) := by rw [three_regime_rpow_sq hL0, three_regime_rpow_sq hL0, ← Real.rpow_add hL0, ← Real.rpow_add hL0] apply Real.rpow_le_rpow_of_exponent_le hL1 linarith have hlow : 2 * L ^ B0 * (L ^ s) ^ (2 : ℕ) * (L ^ q) ^ (2 : ℕ) * (L ^ (-B)) ^ (2 : ℕ) * (L ^ t) ^ (2 : ℕ) ≤ 2 * L ^ (-A - 1) := by calc _ = 2 * (L ^ B0 * (L ^ s) ^ (2 : ℕ) * (L ^ q) ^ (2 : ℕ) * (L ^ (-B)) ^ (2 : ℕ) * (L ^ t) ^ (2 : ℕ)) := by ring _ ≤ _ := by apply mul_le_mul_of_nonneg_left _ (by norm_num : (0 : ℝ) ≤ 2) rw [three_regime_rpow_sq hL0, three_regime_rpow_sq hL0, three_regime_rpow_sq hL0, three_regime_rpow_sq hL0, ← Real.rpow_add hL0, ← Real.rpow_add hL0, ← Real.rpow_add hL0, ← Real.rpow_add hL0] apply Real.rpow_le_rpow_of_exponent_le hL1 linarith have hfinal : 4 * L ^ (-A - 1) ≤ L ^ (-A) := by rw [Real.rpow_sub hL0, Real.rpow_one, ← mul_div_assoc] apply (div_le_iff₀ hL0).mpr nlinarith [Real.rpow_nonneg hL0.le (-A)] linarith end Bounty end section /- A uniform log-power budget for the explicit sparse sampling prefactor. -/ open Filter namespace Bounty theorem sparse_logarithmic_prefactor_le_square {c L Y : ℝ} {N : ℕ} (_hc : 0 ≤ c) (hL : 1 ≤ L) (hlarge : 72 * Real.pi * (3 + 2 * Real.log 4 + 2 * c) + 1 ≤ L) (hY : 0 < Y) (hN : 1 ≤ N) (hNY : (N : ℝ) ≤ 4 * Y) (hlog : Real.log Y ≤ c * L) : 72 * Real.pi * (1 + 2 * (1 + Real.log N)) + 1 ≤ L ^ (2 : ℕ) := by have hN0 : 0 < (N : ℝ) := by exact_mod_cast (zero_lt_one.trans_le hN) have hlogN : Real.log N ≤ Real.log 4 + c * L := by calc _ ≤ Real.log (4 * Y) := Real.log_le_log hN0 hNY _ = Real.log 4 + Real.log Y := Real.log_mul (by norm_num) hY.ne' _ ≤ Real.log 4 + c * L := by linarith have hlog4 : 0 ≤ Real.log 4 := Real.log_nonneg (by norm_num) have hpi := Real.pi_pos have hbase : 3 + 2 * Real.log 4 + 2 * c * L ≤ (3 + 2 * Real.log 4 + 2 * c) * L := by nlinarith have hinner : 1 + 2 * (1 + Real.log N) ≤ (3 + 2 * Real.log 4 + 2 * c) * L := by linarith have hm := mul_le_mul_of_nonneg_left hinner (by positivity : 0 ≤ 72 * Real.pi) have hlast := mul_le_mul_of_nonneg_right hlarge (by linarith : 0 ≤ L) nlinarith theorem eventually_sparse_logarithmic_prefactor_le_square {c : ℝ} (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ (Y : ℝ) (N : ℕ), 0 < Y → 1 ≤ N → (N : ℝ) ≤ 4 * Y → Real.log Y ≤ c * L → 72 * Real.pi * (1 + 2 * (1 + Real.log N)) + 1 ≤ L ^ (2 : ℕ) := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (72 * Real.pi * (3 + 2 * Real.log 4 + 2 * c) + 1)] with L hL hlarge intro Y N hY hN hNY hlog exact sparse_logarithmic_prefactor_le_square hc hL hlarge hY hN hNY hlog end Bounty end section /- Exact residue-class interval sums as integer arithmetic progressions. -/ open Finset namespace Bounty theorem integer_residue_interval_sum (A B : ℤ) {q : ℕ} [NeZero q] (r : ZMod q) (F : ℤ → ℂ) : ∑ n ∈ (Ioc A B).filter (fun n : ℤ => (n : ZMod q) = r), F n = ∑ y ∈ Icc ((A-(r.val : ℤ))/(q : ℤ)+1) ((B-(r.val : ℤ))/(q : ℤ)), F (y*(q : ℤ)+r.val) := by classical have hq : 0 < (q : ℤ) := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) symm apply sum_bij (fun (y : ℤ) _ => y*(q : ℤ)+r.val) · intro y hy obtain ⟨hlo,hhi⟩ := mem_Icc.mp hy have hl := (Int.ediv_lt_iff_lt_mul hq).mp (show (A-(r.val : ℤ))/(q : ℤ) < y by omega) have hr := (Int.le_ediv_iff_mul_le hq).mp hhi apply mem_filter.mpr refine ⟨mem_Ioc.mpr ⟨by linarith,by linarith⟩,?_⟩ apply (ZMod.intCast_eq_iff q _ r).mpr exact ⟨y,by ring⟩ · intro y hy z hz he exact mul_right_cancel₀ hq.ne' (by linarith) · intro n hn obtain ⟨hn,hr⟩ := mem_filter.mp hn obtain ⟨hl,hu⟩ := mem_Ioc.mp hn obtain ⟨y,hy⟩ := (ZMod.intCast_eq_iff q n r).mp hr refine ⟨y,mem_Icc.mpr ⟨?_,?_⟩,by linarith [hy]⟩ · have hh : (A-(r.val : ℤ))/(q : ℤ) < y := (Int.ediv_lt_iff_lt_mul hq).mpr (by nlinarith [hy]) omega · exact (Int.le_ediv_iff_mul_le hq).mpr (by nlinarith [hy]) · intro y hy rfl end Bounty end section /- Division endpoints retain the original dyadic scale after passing to a residue progression. -/ namespace Bounty theorem progression_multiple_endpoints (a b d q r : ℤ) (hd : 0 < d) (hq : 0 < q) : a < (((a/d-r)/q+1)*q+r)*d ∧ (((b/d-r)/q+1)*q+r)*d ≤ b+d*q := by constructor · apply (Int.ediv_lt_iff_lt_mul hd).mp have h := (Int.ediv_lt_iff_lt_mul hq).mp (show (a/d-r)/q < (a/d-r)/q+1 by omega) linarith · have hq0 := (Int.le_ediv_iff_mul_le hq).mp (show (b/d-r)/q ≤ (b/d-r)/q by rfl) have hd0 := (Int.le_ediv_iff_mul_le hd).mp (show b/d ≤ b/d by rfl) have hm := mul_le_mul_of_nonneg_right hq0 hd.le nlinarith theorem progression_real_scale (a b d q r : ℤ) {Y : ℝ} (hd : 0 < d) (hq : 0 < q) (hYa : Y ≤ (a : ℝ)+1) (hbY : (b : ℝ) ≤ 2*Y) (hdq : (d : ℝ)*(q : ℝ) ≤ Y) : Y/((d : ℝ)*(q : ℝ)) ≤ (((a/d-r)/q+1 : ℤ) : ℝ)+(r : ℝ)/(q : ℝ) ∧ (((b/d-r)/q : ℤ) : ℝ)+1+(r : ℝ)/(q : ℝ) ≤ 3*(Y/((d : ℝ)*(q : ℝ))) := by have hdR : 0 < (d : ℝ) := by exact_mod_cast hd have hqR : 0 < (q : ℝ) := by exact_mod_cast hq have hprod : 0 < (d : ℝ)*(q : ℝ) := mul_pos hdR hqR obtain ⟨hlo,hhi⟩ := progression_multiple_endpoints a b d q r hd hq have hloR : (a : ℝ)+1 ≤ ((((a/d-r)/q+1)*q+r)*d : ℤ) := by exact_mod_cast (show a+1 ≤ (((a/d-r)/q+1)*q+r)*d by omega) have hhiR : (((((b/d-r)/q+1)*q+r)*d : ℤ) : ℝ) ≤ (b : ℝ)+(d : ℝ)*(q : ℝ) := by exact_mod_cast hhi have he (x : ℤ) : ((x : ℝ)+(r : ℝ)/(q : ℝ))*((d : ℝ)*(q : ℝ)) = ((x*q+r)*d : ℤ) := by push_cast field_simp constructor · apply (div_le_iff₀ hprod).mpr rw [he] exact hYa.trans hloR · have hx : (((b/d-r)/q : ℤ) : ℝ)+1+(r : ℝ)/(q : ℝ) = (((b/d-r)/q+1 : ℤ) : ℝ)+(r : ℝ)/(q : ℝ) := by push_cast; ring have hh : ((((b/d-r)/q : ℤ) : ℝ)+1+(r : ℝ)/(q : ℝ))*((d : ℝ)*(q : ℝ)) ≤ 3*Y := by rw [hx,he] linarith have hh' := (le_div_iff₀ hprod).mpr hh calc _ ≤ (3*Y)/((d : ℝ)*(q : ℝ)) := hh' _ = 3*(Y/((d : ℝ)*(q : ℝ))) := by ring end Bounty end section /- All four unit factors use the same complete character expansion. -/ open scoped BigOperators Classical namespace Bounty theorem rational_four_factor_unit_expansion {r Q : ℕ} (hr : 0 < r) (hrQ : r ≤ Q) (u : ℤ) : ∃ c : AddChar (Additive (ZMod r)ˣ) ℂ → ℂ, (∑ ψ, ‖c ψ‖) ≤ Real.sqrt (Q : ℝ) ∧ ∀ m a p v : ℕ, m.Coprime r → a.Coprime r → p.Coprime r → v.Coprime r → (∑ ψ, c ψ * unitAddCharDirichlet ψ (m : ZMod r) * unitAddCharDirichlet ψ (a : ZMod r) * unitAddCharDirichlet ψ (p : ZMod r) * unitAddCharDirichlet ψ (v : ZMod r)) = Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (m * a * p * v)) : ℝ)) := by obtain ⟨c, hc, he⟩ := rational_unit_character_expansion hr hrQ u refine ⟨c, hc, ?_⟩ intro m a p v hm ha hp hv simpa only [Nat.cast_mul, map_mul, mul_assoc] using he (m * a * p * v) (((hm.mul_left ha).mul_left hp).mul_left hv) theorem rational_four_factor_phase_cancel {d q r v n : ℕ} (hd : 0 < d) (hq : 0 < q) (hr : d * q = r) (hn : d * v = n) (u : ℤ) (m a p : ℕ) : Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (m * a * p * n)) : ℝ)) = Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / q * (m * a * p * v)) : ℝ)) := by have hd0 : (d : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.ne_of_gt hd) have hq0 : (q : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.ne_of_gt hq) have hrd : (d : ℝ) * q = r := by exact_mod_cast hr have hnd : (d : ℝ) * v = n := by exact_mod_cast hn have he : (u : ℝ) / r * (m * a * p * n) = (u : ℝ) / q * (m * a * p * v) := by rw [← hrd, ← hnd] field_simp rw [he] end Bounty end section /- The fixed sixteenth-divisor-moment loss fits a fixed power of L. -/ namespace Bounty theorem four_convolution_log_budget {c L U : ℝ} (_hc : 0 ≤ c) (hL : 1 ≤ L) (hlarge : 3 * (1 + Real.log 3 + c) ^ (15 : ℕ) ≤ L) (hU : 1 ≤ U) (hlog : Real.log U ≤ c * L) : 3 * (1 + Real.log ⌈2 * U⌉₊) ^ (15 : ℕ) ≤ L ^ (16 : ℕ) := by have hU0 : 0 < U := zero_lt_one.trans_le hU have hN0 : 0 < (⌈2 * U⌉₊ : ℝ) := lt_of_lt_of_le (by linarith) (Nat.le_ceil (2 * U)) have hN : (⌈2 * U⌉₊ : ℝ) ≤ 3 * U := by have hh := Nat.ceil_lt_add_one (by linarith : 0 ≤ 2 * U) linarith have hlogN : Real.log ⌈2 * U⌉₊ ≤ Real.log 3 + c * L := by calc _ ≤ Real.log (3 * U) := Real.log_le_log hN0 hN _ = Real.log 3 + Real.log U := Real.log_mul (by norm_num) hU0.ne' _ ≤ Real.log 3 + c * L := by linarith have hlog3 : 0 ≤ Real.log 3 := Real.log_nonneg (by norm_num) have hlinear : 1 + Real.log ⌈2 * U⌉₊ ≤ (1 + Real.log 3 + c) * L := by nlinarith have hbase : 0 ≤ 1 + Real.log ⌈2 * U⌉₊ := by linarith [Real.log_natCast_nonneg ⌈2 * U⌉₊] calc _ ≤ 3 * ((1 + Real.log 3 + c) * L) ^ (15 : ℕ) := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hbase hlinear 15) (by norm_num) _ = (3 * (1 + Real.log 3 + c) ^ (15 : ℕ)) * L ^ (15 : ℕ) := by ring _ ≤ L * L ^ (15 : ℕ) := mul_le_mul_of_nonneg_right hlarge (by positivity) _ = L ^ (16 : ℕ) := by ring end Bounty end section /- The two scale comparisons required by the ordinary and sparse energies. -/ open Filter namespace Bounty theorem eventually_four_factor_residual_scale {beta d eta C : ℝ} (hbeta : beta < 1) (_hd : 0 < d) (heta : eta < (2 / 5 : ℝ) * d) (hC : 0 < C) : ∀ᶠ L : ℝ in atTop, ∀ Y P P' U : ℝ, 0 < Y → 0 < P → 0 < P' → d * L ≤ Real.log Y → P ≤ Real.exp (L ^ beta) → P' ≤ Real.exp (eta * L) → Y / (C * P * P') ≤ U → Y ^ (3 / 5 : ℝ) ≤ U := by have hgap : 0 < (2 / 5 : ℝ) * d - eta := by linarith filter_upwards [eventually_mul_rpow_log_add_le_rpow zero_lt_one hbeta hgap 1 (Real.log C), Real.tendsto_log_atTop.eventually_ge_atTop 1, eventually_gt_atTop (0 : ℝ)] with L hbudget hlogL hL intro Y P P' U hY hP hP' hlogY hsmall hlarge hU simp only [one_mul, Real.rpow_one] at hbudget have hpow : L ^ beta ≤ L ^ beta * Real.log L := le_mul_of_one_le_right (Real.rpow_nonneg hL.le beta) hlogL have hden : C * P * P' ≤ Y ^ (2 / 5 : ℝ) := by calc _ ≤ C * Real.exp (L ^ beta) * Real.exp (eta * L) := by gcongr _ = Real.exp (Real.log C + L ^ beta + eta * L) := by rw [Real.exp_add, Real.exp_add, Real.exp_log hC] _ ≤ Real.exp ((2 / 5 : ℝ) * (d * L)) := Real.exp_le_exp.mpr (by nlinarith) _ ≤ Real.exp ((2 / 5 : ℝ) * Real.log Y) := Real.exp_le_exp.mpr (by linarith) _ = Y ^ (2 / 5 : ℝ) := by rw [Real.rpow_def_of_pos hY]; congr 1; ring calc Y ^ (3 / 5 : ℝ) = Y / Y ^ (2 / 5 : ℝ) := by rw [show (3 / 5 : ℝ) = 1 - 2 / 5 by norm_num, Real.rpow_sub hY, Real.rpow_one] _ ≤ Y / (C * P * P') := div_le_div_of_nonneg_left hY.le (by positivity) hden _ ≤ U := hU end Bounty end section /- Finite support turns a literal divisor convolution into an exact product box. -/ open Finset namespace Bounty section variable (A B : Finset ℕ) (α β : ℕ → ℂ) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (n : ℕ) include A B α β hA hB hα hβ n theorem finite_divisor_convolution_box : (∑ d ∈ n.divisors, α d*β (n/d)) = ∑ a ∈ A, ∑ b ∈ B, if a*b = n then α a*β b else 0 := by classical rw [← Nat.sum_divisorsAntidiagonal (fun a b => α a*β b)] rw [← sum_product A B (fun ab : ℕ × ℕ => if ab.1*ab.2 = n then α ab.1*β ab.2 else 0)] apply sum_bij_ne_zero (fun ab _ _ => ab) · intro ab hab hne apply mem_product.mpr constructor · by_contra hn exact hne (by rw [hα _ hn,zero_mul]) · by_contra hn exact hne (by rw [hβ _ hn,mul_zero]) · intro ab hab hne cd hcd hne' he exact he · intro ab hab hne have he : ab.1*ab.2 = n := by by_contra hh exact hne (if_neg hh) have hn : n ≠ 0 := by rw [← he] exact Nat.ne_of_gt (Nat.mul_pos (hA _ (mem_product.mp hab).1) (hB _ (mem_product.mp hab).2)) exact ⟨ab,Nat.mem_divisorsAntidiagonal.mpr ⟨he,hn⟩, (by simpa only [if_pos he] using hne),rfl⟩ · intro ab hab hne exact (if_pos (Nat.mem_divisorsAntidiagonal.mp hab).1).symm theorem finite_divisor_convolution_support (hn : n ∉ (A ×ˢ B).image (fun ab => ab.1*ab.2)) : (∑ d ∈ n.divisors, α d*β (n/d)) = 0 := by classical rw [finite_divisor_convolution_box A B α β hA hB hα hβ n] apply sum_eq_zero intro a ha apply sum_eq_zero intro b hb apply if_neg intro he exact hn (mem_image.mpr ⟨(a,b),mem_product.mpr ⟨ha,hb⟩,he⟩) end theorem finite_divisor_convolution_transform (S A B : Finset ℕ) (α β F : ℕ → ℂ) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (hS : ∀ a ∈ A, ∀ b ∈ B, a*b ∈ S) : (∑ n ∈ S, (∑ d ∈ n.divisors, α d*β (n/d))*F n) = ∑ a ∈ A, ∑ b ∈ B, α a*β b*F (a*b) := by classical simp_rw [finite_divisor_convolution_box A B α β hA hB hα hβ] simp only [sum_mul,ite_mul,zero_mul] rw [sum_comm] apply sum_congr rfl intro a ha rw [sum_comm] apply sum_congr rfl intro b hb rw [sum_eq_single (a*b)] · simp only [ite_true] · intro n hn hne exact if_neg (Ne.symm hne) · intro hn exact (hn (hS a ha b hb)).elim end Bounty end section /- An exact finite dyadic partition of a real-endpoint integer interval. -/ open Finset namespace Bounty theorem sum_finite_dyadic_intervals (U : ℝ) (hU : 0 ≤ U) (K : ℕ) (F : ℕ → ℂ) : (∑ j ∈ range K, ∑ n ∈ Ioc ⌊(2 : ℝ)^j*U⌋₊ ⌊(2 : ℝ)^(j+1)*U⌋₊, F n) = ∑ n ∈ Ioc ⌊U⌋₊ ⌊(2 : ℝ)^K*U⌋₊, F n := by induction K with | zero => simp only [range_zero,sum_empty,pow_zero,one_mul,Ioc_self] | succ K ih => rw [sum_range_succ,ih] apply sum_Ioc_consecutive F · apply Nat.floor_le_floor exact le_mul_of_one_le_left hU (one_le_pow₀ (by norm_num)) · apply Nat.floor_le_floor rw [pow_succ] nlinarith [mul_nonneg (pow_nonneg (by norm_num : (0 : ℝ) ≤ 2) K) hU] theorem sum_finite_dyadic_closed_intervals (U : ℝ) (hU : 0 ≤ U) (K : ℕ) (F : ℕ → ℂ) : (∑ j : Fin K, ∑ n ∈ Icc (⌊(2 : ℝ)^j.val*U⌋₊+1) ⌊(2 : ℝ)^(j.val+1)*U⌋₊, F n) = ∑ n ∈ Ioc ⌊U⌋₊ ⌊(2 : ℝ)^K*U⌋₊, F n := by simp_rw [Icc_add_one_left_eq_Ioc] rw [Fin.sum_univ_eq_sum_range (fun j : ℕ => ∑ n ∈ Ioc ⌊(2 : ℝ)^j*U⌋₊ ⌊(2 : ℝ)^(j+1)*U⌋₊, F n) K] exact sum_finite_dyadic_intervals U hU K F theorem finite_dyadic_interval_geometry {U : ℝ} (hU : 0 ≤ U) (j : ℕ) : (2 : ℝ)^j*U ≤ (⌊(2 : ℝ)^j*U⌋₊+1 : ℕ) ∧ (⌊(2 : ℝ)^(j+1)*U⌋₊ : ℝ) ≤ 2*((2 : ℝ)^j*U) := by constructor · simpa only [Nat.cast_add,Nat.cast_one] using (Nat.lt_floor_add_one ((2 : ℝ)^j*U)).le · calc _ ≤ (2 : ℝ)^(j+1)*U := Nat.floor_le (by positivity) _ = _ := by rw [pow_succ]; ring end Bounty end section /- Exact clipping and long-scale bounds for an original candidate rough band. -/ open Finset Filter namespace Bounty theorem mem_roughBand_real_iff {A B W : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (n : ℕ) : n ∈ roughBand A B W ↔ A < (n : ℝ) ∧ (n : ℝ) ≤ B ∧ ∀ p ∈ n.primeFactors, W < (p : ℝ) := by classical simp only [roughBand,mem_filter,mem_Ioc,Nat.floor_lt hA,Nat.le_floor_iff hB] tauto theorem roughBand_filter_real_interval {A B U V W : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (_hU : 0 ≤ U) (hV : 0 ≤ V) : (roughBand A B W).filter (fun n : ℕ => U < (n : ℝ) ∧ (n : ℝ) ≤ V) = roughBand (max A U) (min B V) W := by classical ext n simp only [mem_filter,mem_roughBand_real_iff hA hB, mem_roughBand_real_iff (le_max_of_le_left hA) (le_min hB hV),max_lt_iff,le_min_iff] tauto theorem eventually_candidate_rough_dyadic_scales {c aLong eta : ℝ} (hc : 0 < c) (Jlo Jhi : ℕ) (hLong : aLong < c/2^Jhi) (hShort : (6/5 : ℝ)*(c/2^Jlo) ≤ eta) : ∀ᶠ L : ℝ in atTop, ∀ j : ℕ, Jlo ≤ j → j ≤ Jhi → ∀ U : ℝ, 0 < U → ((candidateRoughBand c L j).filter (fun n : ℕ => U < (n : ℝ) ∧ (n : ℝ) ≤ 2*U)).Nonempty → Real.exp (aLong*L) ≤ U ∧ U ≤ Real.exp (eta*L) ∧ U ≤ max (Real.exp (c*L/2^j)) U ∧ max (Real.exp (c*L/2^j)) U ≤ min (Real.exp ((6/5 : ℝ)*c*L/2^j)) (2*U) ∧ min (Real.exp ((6/5 : ℝ)*c*L/2^j)) (2*U) ≤ 2*U ∧ (candidateRoughBand c L j).filter (fun n : ℕ => U < (n : ℝ) ∧ (n : ℝ) ≤ 2*U) = roughBand (max (Real.exp (c*L/2^j)) U) (min (Real.exp ((6/5 : ℝ)*c*L/2^j)) (2*U)) (Real.exp (Real.sqrt L)) := by classical have hgap : 0 < c/2^Jhi-aLong := sub_pos.mpr hLong filter_upwards [eventually_ge_atTop (Real.log 2/(c/2^Jhi-aLong)), eventually_ge_atTop (0 : ℝ)] with L hLgap hL intro j hjlo hjhi U hU hne obtain ⟨n,hn⟩ := hne obtain ⟨hnrough,hnlo,hnhi⟩ := mem_filter.mp hn have hnrange := roughBand_value_bounds (Real.exp_pos _).le (Real.exp_pos _).le hnrough have hjlower : c/2^Jhi ≤ c/2^j := by apply div_le_div_of_nonneg_left hc.le (by positivity) exact pow_le_pow_right₀ (by norm_num) hjhi have hjupper : c/2^j ≤ c/2^Jlo := by apply div_le_div_of_nonneg_left hc.le (by positivity) exact pow_le_pow_right₀ (by norm_num) hjlo have hlower : (c/2^Jhi)*L ≤ c*L/2^j := by calc _ ≤ (c/2^j)*L := mul_le_mul_of_nonneg_right hjlower hL _ = _ := by ring have hupper : (6/5 : ℝ)*c*L/2^j ≤ eta*L := by have hh : (6/5 : ℝ)*(c/2^j) ≤ eta := (mul_le_mul_of_nonneg_left hjupper (by norm_num)).trans hShort calc _ = ((6/5 : ℝ)*(c/2^j))*L := by ring _ ≤ _ := mul_le_mul_of_nonneg_right hh hL have hgapL : Real.log 2 ≤ (c/2^Jhi-aLong)*L := by have hh := (div_le_iff₀ hgap).mp hLgap nlinarith only [hh] have hexp : 2*Real.exp (aLong*L) ≤ Real.exp ((c/2^Jhi)*L) := by calc _ = Real.exp (Real.log 2+aLong*L) := by rw [Real.exp_add,Real.exp_log (by norm_num : (0 : ℝ) < 2)] _ ≤ _ := Real.exp_le_exp.mpr (by nlinarith only [hgapL]) have hnlarge : 2*Real.exp (aLong*L) < (n : ℝ) := (hexp.trans (Real.exp_le_exp.mpr hlower)).trans_lt hnrange.1 refine ⟨by linarith,hnlo.le.trans (hnrange.2.trans (Real.exp_le_exp.mpr hupper)), le_max_right _ _,?_,min_le_right _ _,?_⟩ · exact (max_lt hnrange.1 hnlo).le.trans (le_min hnrange.2 hnhi) · exact roughBand_filter_real_interval (Real.exp_pos _).le (Real.exp_pos _).le hU.le (by positivity) end Bounty end section /- A logarithmic saving chosen before the slot controls the required relative mass error. -/ open Filter namespace Bounty theorem exists_candidate_error_mass_exponent {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) : ∃ D : ℝ, 0 ≤ D ∧ ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, ∀ e : ℝ, |e| ≤ Real.exp L * L^(-D) → |e| ≤ candidateCoefficientWindowMass c L q r jStar * L^(-2 : ℝ) := by obtain ⟨C, hC, J, hmass⟩ := exists_candidate_coefficient_mass_polynomial_lower hc hr hq0 hq1 hcenter refine ⟨C+2, by linarith, J, ?_⟩ intro jStar hj filter_upwards [hmass jStar hj,eventually_gt_atTop (0 : ℝ)] with L hmass hL intro e he apply he.trans calc _ = (Real.exp L * L^(-C))*L^(-2 : ℝ) := by rw [mul_assoc,← Real.rpow_add hL] congr 2 ring _ ≤ _ := mul_le_mul_of_nonneg_right hmass (by positivity) end Bounty end section /- Summation of pointwise pair errors against their actual weighted endpoint energies. The original finite set and weight are retained. -/ open Finset namespace Bounty theorem finite_weighted_pair_error {I : Type*} (s : Finset I) (μ W0 W1 : I → ℝ) (f g e : I → ℂ) {ε : ℝ} (hμ : ∀ i ∈ s, 0 ≤ μ i) (hε : 0 ≤ ε) (he : ∀ i ∈ s, ‖e i‖ ≤ W0 i * W1 i * ε) : ‖∑ i ∈ s, (μ i : ℂ) * (starRingEnd ℂ) (f i) * g i * e i‖ ≤ ε * Real.sqrt (∑ i ∈ s, μ i * (W0 i * ‖f i‖)^2) * Real.sqrt (∑ i ∈ s, μ i * (W1 i * ‖g i‖)^2) := by have hc := Real.sum_mul_le_sqrt_mul_sqrt s (fun i => Real.sqrt (μ i) * (W0 i * ‖f i‖)) (fun i => Real.sqrt (μ i) * (W1 i * ‖g i‖)) have hs0 : (∑ i ∈ s, (Real.sqrt (μ i) * (W0 i * ‖f i‖))^2) = ∑ i ∈ s, μ i * (W0 i * ‖f i‖)^2 := by apply sum_congr rfl intro i hi rw [mul_pow, Real.sq_sqrt (hμ i hi)] have hs1 : (∑ i ∈ s, (Real.sqrt (μ i) * (W1 i * ‖g i‖))^2) = ∑ i ∈ s, μ i * (W1 i * ‖g i‖)^2 := by apply sum_congr rfl intro i hi rw [mul_pow, Real.sq_sqrt (hμ i hi)] rw [hs0, hs1] at hc calc _ ≤ ∑ i ∈ s, ‖(μ i : ℂ) * (starRingEnd ℂ) (f i) * g i * e i‖ := norm_sum_le _ _ _ ≤ ε * ∑ i ∈ s, (Real.sqrt (μ i) * (W0 i * ‖f i‖)) * (Real.sqrt (μ i) * (W1 i * ‖g i‖)) := by rw [mul_sum] apply sum_le_sum intro i hi rw [norm_mul, norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hμ i hi), Complex.norm_conj] calc _ ≤ μ i * ‖f i‖ * ‖g i‖ * (W0 i * W1 i * ε) := mul_le_mul_of_nonneg_left (he i hi) (mul_nonneg (mul_nonneg (hμ i hi) (norm_nonneg _)) (norm_nonneg _)) _ = (Real.sqrt (μ i))^2 * ‖f i‖ * ‖g i‖ * (W0 i * W1 i * ε) := by rw [Real.sq_sqrt (hμ i hi)] _ = _ := by ring _ ≤ _ := by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hc hε end Bounty end section /- A local phase with a deterministic auxiliary state is a phase on the original event path. Its state updates add no path multiplicity. -/ namespace Bounty section Phase variable {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) (phase : ∀ k, L → (x : X) → E k x → ℂ) def deterministicLedgerPhase : ∀ ks, L → (x : X) → FiniteEventPath E target ks x → ℂ | [], _, _, _ => 1 | k :: ks, l, x, ⟨e, p⟩ => phase k l x e * deterministicLedgerPhase ks (update k l x e) (target k x e) p theorem deterministic_ledger_phase_eq_lifted (ks : List K) (l : L) (x : X) (p : FiniteEventPath E target ks x) : deterministicLedgerPhase E target update phase ks l x p = finiteEventLocalPhase (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) (fun k s => phase k s.1 s.2) ks (l, x) ((finiteLedgerEventPathEquiv E target update ks l x).symm p) := by induction ks generalizing l x with | nil => rfl | cons k ks ih => rcases p with ⟨e, p⟩ exact congrArg (phase k l x e * ·) (ih (update k l x e) (target k x e) p) end Phase end Bounty end section /- The memory scalar is independent of presentations of the same finite type. -/ namespace Bounty theorem physical_memory_labeled_scalar_instances {G I : Type*} (f₁ f₂ : Fintype G) (d₁ d₂ : DecidableEq G) {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) : @physicalMemoryLabeledScalar G I f₁ d₁ P J ell V patterns C ζ K a L R = @physicalMemoryLabeledScalar G I f₂ d₂ P J ell V patterns C ζ K a L R := by cases Subsingleton.elim f₁ f₂ cases Subsingleton.elim d₁ d₂ rfl theorem physical_aux_mass_instances {G : Type*} (f₁ f₂ : Fintype G) {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (a : PhysicalAuxLabels P C) : @physicalAuxMass G f₁ P J V C a = @physicalAuxMass G f₂ P J V C a := by cases Subsingleton.elim f₁ f₂ rfl end Bounty end section /- An exact separated expansion of the retained cell kernel. -/ open Finset open scoped Classical namespace Bounty theorem finite_cell_kernel_expansion {X D I : Type*} [Fintype X] [Fintype I] [DecidableEq D] (μ : X → ℝ) (cell : X → D) (kept : Finset D) (ψ : I → X → ℂ) (x y : X) : finiteCellFrameKernel μ cell kept ψ x y = ∑ d ∈ kept, ∑ i, ((1 / finiteCellMass μ cell d : ℝ) : ℂ) * (if cell x = d then ψ i x else 0) * (if cell y = d then (starRingEnd ℂ) (ψ i y) else 0) := by by_cases hxy : cell x = cell y · by_cases hx : cell x ∈ kept · rw [finiteCellFrameKernel, if_pos ⟨hxy, hx⟩, sum_eq_single (cell x)] · simp only [← hxy, ite_true, finiteMeasureFrameKernel, mul_sum, mul_assoc] · intro d _ hd simp only [if_neg (Ne.symm hd), mul_zero, zero_mul, sum_const_zero] · exact fun h => (h hx).elim · rw [finiteCellFrameKernel, if_neg (by simp only [hx, and_false, not_false_eq_true])] symm apply sum_eq_zero intro d hd have hxd : cell x ≠ d := by intro he; exact hx (he.symm ▸ hd) simp only [if_neg hxd, mul_zero, zero_mul, sum_const_zero] · rw [finiteCellFrameKernel, if_neg (by simp only [hxy, false_and, not_false_eq_true])] symm apply sum_eq_zero intro d _ by_cases hx : cell x = d · have hy : cell y ≠ d := by intro he; exact hxy (hx.trans he.symm) simp only [if_neg hy, mul_zero, sum_const_zero] · simp only [if_neg hx, mul_zero, zero_mul, sum_const_zero] end Bounty end section /- Exact Fourier identities for finitely supported integer correlations. -/ open Finset MeasureTheory open scoped ComplexConjugate namespace Bounty theorem integral_shifted_fourier_cross (m n δ : ℤ) : (∫ x in (0 : ℝ)..1, conj (fourier m (x : AddCircle (1 : ℝ))) * fourier n (x : AddCircle (1 : ℝ)) * fourier (-δ) (x : AddCircle (1 : ℝ))) = if n = m+δ then 1 else 0 := by simp_rw [mul_assoc, ← fourier_add] rw [integral_fourier_cross] simp only [show (m = n + -δ) ↔ n = m+δ by omega] theorem finite_fourier_shift_correlation (S T : Finset ℤ) (f g : ℤ → ℂ) (δ : ℤ) : (∫ x in (0 : ℝ)..1, conj (finiteFourierSum S f x) * finiteFourierSum T g x * fourier (-δ) (x : AddCircle (1 : ℝ))) = ∑ n ∈ S, if n+δ ∈ T then conj (f n) * g (n+δ) else 0 := by have hcont (m n : ℤ) : Continuous (fun x : ℝ => (conj (f m)*g n) * (conj (fourier m (x : AddCircle (1 : ℝ))) * fourier n (x : AddCircle (1 : ℝ)) * fourier (-δ) (x : AddCircle (1 : ℝ)))) := continuous_const.mul (((continuous_fourier_real m).star.mul (continuous_fourier_real n)).mul (continuous_fourier_real (-δ))) have hpoint (x : ℝ) : conj (finiteFourierSum S f x) * finiteFourierSum T g x * fourier (-δ) (x : AddCircle (1 : ℝ)) = ∑ m ∈ S, ∑ n ∈ T, (conj (f m)*g n) * (conj (fourier m (x : AddCircle (1 : ℝ))) * fourier n (x : AddCircle (1 : ℝ)) * fourier (-δ) (x : AddCircle (1 : ℝ))) := by simp only [finiteFourierSum, map_sum, map_mul, sum_mul, mul_sum] rw [sum_comm] apply sum_congr rfl intro m _ apply sum_congr rfl intro n _ ring simp_rw [hpoint] rw [intervalIntegral.integral_finsetSum (fun m _ => (continuous_finsetSum T (fun n _ => hcont m n)).intervalIntegrable _ _)] apply sum_congr rfl intro m _ rw [intervalIntegral.integral_finsetSum (fun n _ => (hcont m n).intervalIntegrable _ _)] simp_rw [intervalIntegral.integral_const_mul, integral_shifted_fourier_cross] simp end Bounty end section /- Square-energy estimates for complex pairings with explicit measures. -/ open MeasureTheory open scoped ComplexConjugate namespace Bounty theorem integral_pairing_energy {X : Type*} [MeasurableSpace X] (μ : Measure X) (f g : X → ℂ) (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) : ‖∫ x, conj (f x)*g x ∂μ‖ ≤ Real.sqrt (∫ x, ‖f x‖^2 ∂μ)*Real.sqrt (∫ x, ‖g x‖^2 ∂μ) := by calc _ ≤ ∫ x, ‖conj (f x)*g x‖ ∂μ := norm_integral_le_integral_norm _ _ = ∫ x, ‖f x‖*‖g x‖ ∂μ := by simp only [norm_mul, RCLike.norm_conj] _ ≤ _ := by have h := integral_mul_norm_le_Lp_mul_Lq Real.HolderConjugate.two_two (by simpa using hf) (by simpa using hg) simpa only [Real.rpow_two, Real.sqrt_eq_rpow] using h end Bounty end section /- Fixed scalar losses for the common harmonic endpoint window. -/ namespace Bounty theorem harmonic_common_window_ceiling_bounds {Y : ℝ} (hY : 1 ≤ Y) : (⌈4 * Real.exp 2 * Y⌉₊ : ℝ) ≤ 5 * Real.exp 2 * Y ∧ (⌈4 * Real.exp 2 * Y⌉₊ : ℝ) / (Y / 8) ≤ 40 * Real.exp 2 ∧ Real.log (⌈4 * Real.exp 2 * Y⌉₊ : ℝ) ≤ Real.log 5 + 2 + Real.log Y := by have hY0 : 0 < Y := zero_lt_one.trans_le hY have hE : 1 ≤ Real.exp (2 : ℝ) := Real.one_le_exp (by norm_num) have hEY : 1 ≤ Real.exp 2 * Y := by simpa only [one_mul] using mul_le_mul hE hY (by norm_num : (0 : ℝ) ≤ 1) (Real.exp_pos _).le have hceil := Nat.ceil_lt_add_one (by positivity : 0 ≤ 4 * Real.exp 2 * Y) have hbound : (⌈4 * Real.exp 2 * Y⌉₊ : ℝ) ≤ 5 * Real.exp 2 * Y := by nlinarith have hN : 0 < (⌈4 * Real.exp 2 * Y⌉₊ : ℝ) := lt_of_lt_of_le (by positivity) (Nat.le_ceil _) refine ⟨hbound, ?_, ?_⟩ · apply (div_le_iff₀ (by positivity : 0 < Y / 8)).mpr nlinarith · calc Real.log (⌈4 * Real.exp 2 * Y⌉₊ : ℝ) ≤ Real.log (5 * Real.exp 2 * Y) := Real.log_le_log hN hbound _ = Real.log 5 + 2 + Real.log Y := by rw [Real.log_mul (by positivity) hY0.ne', Real.log_mul (by norm_num) (Real.exp_pos _).ne', Real.log_exp] end Bounty end section /- Integration over a finite cover without assuming disjointness. -/ open Finset MeasureTheory namespace Bounty theorem finite_cover_integral_le {X I : Type*} [MeasurableSpace X] (μ : Measure X) (s : Finset I) (B : Set X) (C : I → Set X) (f : X → ℝ) (hB : MeasurableSet B) (hC : ∀ i ∈ s, MeasurableSet (C i)) (hf : ∀ x, 0 ≤ f x) (hIB : IntegrableOn f B μ) (hIC : ∀ i ∈ s, IntegrableOn f (C i) μ) (hcover : ∀ x ∈ B, ∃ i ∈ s, x ∈ C i) : (∫ x in B, f x ∂μ) ≤ ∑ i ∈ s, ∫ x in C i, f x ∂μ := by classical have hint (i : I) (hi : i ∈ s) : Integrable ((C i).indicator f) μ := (hIC i hi).integrable_indicator (hC i hi) have hpos (i : I) (x : X) : 0 ≤ (C i).indicator f x := by by_cases hx : x ∈ C i · simpa only [Set.indicator_of_mem hx] using hf x · simp only [Set.indicator_of_notMem hx, le_refl] calc _ = ∫ x, B.indicator f x ∂μ := (integral_indicator hB).symm _ ≤ ∫ x, ∑ i ∈ s, (C i).indicator f x ∂μ := by apply integral_mono (hIB.integrable_indicator hB) (integrable_finsetSum s hint) intro x dsimp only by_cases hx : x ∈ B · obtain ⟨i, hi, hxi⟩ := hcover x hx rw [Set.indicator_of_mem hx] have h := single_le_sum (fun j _ => hpos j x) hi simpa only [Set.indicator_of_mem hxi] using h · rw [Set.indicator_of_notMem hx] exact sum_nonneg (fun i _ => hpos i x) _ = _ := by rw [integral_finsetSum s hint] apply sum_congr rfl intro i hi exact integral_indicator (hC i hi) end Bounty end section open MeasureTheory namespace Bounty noncomputable def dyadicAbsShell (R : ℝ) (n : ℕ) : Set ℝ := {t | (2:ℝ)^n*R ≤ |t| ∧ |t| < (2:ℝ)^(n+1)*R} theorem dyadic_abs_shell_measurable (R : ℝ) (n : ℕ) : MeasurableSet (dyadicAbsShell R n) := by unfold dyadicAbsShell exact (isClosed_le continuous_const continuous_abs).measurableSet.inter (isOpen_lt continuous_abs continuous_const).measurableSet theorem dyadic_abs_shell_disjoint {R : ℝ} (hR : 0 < R) : Pairwise (fun i j => Disjoint (dyadicAbsShell R i) (dyadicAbsShell R j)) := by intro i j hij apply Set.disjoint_left.2 intro t hi hj rcases lt_or_gt_of_ne hij with h | h · have hp : (2:ℝ)^(i+1) ≤ (2:ℝ)^j := pow_le_pow_right₀ (by norm_num) h exact (not_lt_of_ge (mul_le_mul_of_nonneg_right hp hR.le |>.trans hj.1)) hi.2 · have hp : (2:ℝ)^(j+1) ≤ (2:ℝ)^i := pow_le_pow_right₀ (by norm_num) h exact (not_lt_of_ge (mul_le_mul_of_nonneg_right hp hR.le |>.trans hi.1)) hj.2 theorem dyadic_abs_shell_union {R : ℝ} (hR : 0 < R) : (⋃ n : ℕ, dyadicAbsShell R n) = {t : ℝ | R ≤ |t|} := by ext t constructor · intro ht obtain ⟨n, hn⟩ := Set.mem_iUnion.1 ht exact (le_mul_of_one_le_left hR.le (one_le_pow₀ (by norm_num))).trans hn.1 · intro ht obtain ⟨n, hn, hn'⟩ := exists_nat_pow_near ((le_div_iff₀ hR).2 (by simpa using ht)) (show (1:ℝ)<2 by norm_num) exact Set.mem_iUnion.2 ⟨n, (le_div_iff₀ hR).1 hn, (div_lt_iff₀ hR).1 hn'⟩ theorem integral_dyadic_abs_shells {R : ℝ} (hR : 0 < R) {f : ℝ → ℝ} (hf : Integrable f) : (∫ t in {t : ℝ | R ≤ |t|}, f t) = ∑' n : ℕ, ∫ t in dyadicAbsShell R n, f t := by rw [← dyadic_abs_shell_union hR] exact integral_iUnion (dyadic_abs_shell_measurable R) (dyadic_abs_shell_disjoint hR) hf.integrableOn end Bounty end section open Filter namespace Bounty theorem local_scale_exp_ratio {b L Y H : ℝ} (hY : Real.exp (b*L) ≤ Y) (hH : H ≤ Real.exp ((b/2)*L)) : H/Y ≤ Real.exp (-(b/2)*L) := by have hYp : 0 < Y := (Real.exp_pos _).trans_le hY calc H/Y ≤ Real.exp ((b/2)*L)/Y := div_le_div_of_nonneg_right hH hYp.le _ ≤ Real.exp ((b/2)*L)/Real.exp (b*L) := div_le_div_of_nonneg_left (Real.exp_pos _).le (Real.exp_pos _) hY _ = _ := by rw [← Real.exp_sub]; congr 1; ring theorem eventually_local_scale_error {b C : ℝ} (hb : 0 < b) (hC : 0 ≤ C) (A B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y H E : ℝ, Real.exp (b*L) ≤ Y → 1 ≤ H → H ≤ Real.exp ((b/2)*L) → E ≤ Y*L^B → H ≤ Y/64 ∧ C*(H/Y)^2*E ≤ Y*L^(-A)/2 := by have hs : Tendsto (fun L : ℝ => Real.exp (-(b/2)*L)) atTop (nhds 0) := by simpa only [Real.rpow_zero, one_mul] using tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero 0 (b/2) (by positivity) have he : Tendsto (fun L : ℝ => C*(L^(A+B)*Real.exp (-b*L))) atTop (nhds 0) := by simpa only [mul_zero] using (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero (A+B) b hb).const_mul C filter_upwards [hs.eventually_le_const (by norm_num : (0:ℝ)<1/64), he.eventually_le_const (by norm_num : (0:ℝ)<1/2), eventually_gt_atTop (0:ℝ)] with L hs he hL intro Y H E hY hH hHu hE have hYp : 0 < Y := (Real.exp_pos _).trans_le hY have hHp : 0 < H := lt_of_lt_of_le zero_lt_one hH have hr := local_scale_exp_ratio hY hHu have hsmall : H ≤ Y/64 := by have hh := (div_le_iff₀ hYp).1 (hr.trans hs) linarith refine ⟨hsmall, ?_⟩ have hr2 : (H/Y)^2 ≤ Real.exp (-b*L) := by calc (H/Y)^2 ≤ (Real.exp (-(b/2)*L))^2 := pow_le_pow_left₀ (by positivity) hr 2 _ = _ := by rw [← Real.exp_nat_mul]; congr 1; norm_num; ring have hbound : C*Real.exp (-b*L)*L^B ≤ L^(-A)/2 := by have he' := mul_le_mul_of_nonneg_right he (Real.rpow_pos_of_pos hL (-A)).le have hpow : L^(A+B)*L^(-A) = L^B := by rw [← Real.rpow_add hL] congr 1 ring calc _ = (C*(L^(A+B)*Real.exp (-b*L)))*L^(-A) := by rw [← hpow]; ring _ ≤ (1/2)*L^(-A) := he' _ = _ := by ring calc C*(H/Y)^2*E ≤ C*(H/Y)^2*(Y*L^B) := mul_le_mul_of_nonneg_left hE (by positivity) _ ≤ C*Real.exp (-b*L)*(Y*L^B) := by gcongr _ = Y*(C*Real.exp (-b*L)*L^B) := by ring _ ≤ Y*(L^(-A)/2) := mul_le_mul_of_nonneg_left hbound hYp.le _ = _ := by ring end Bounty end section /- Equal schedules preserve full-path terminal states, signed weights and local phases. -/ namespace Bounty section Schedule variable {K X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) theorem finite_event_phase_schedule_cast (phase : ∀ k x, E k x → ℂ) {ks ks' : List K} (h : ks = ks') (x : X) (p : FiniteEventPath E target ks x) : finiteEventLocalPhase E target phase ks' x (cast (congrArg (fun steps => FiniteEventPath E target steps x) h) p) = finiteEventLocalPhase E target phase ks x p := by cases h rfl end Schedule end Bounty end section /- Weighted Cauchy bounds with all integrability supplied by a uniform bound. -/ open MeasureTheory namespace Bounty theorem bounded_weighted_integral_square {μ : Measure ℝ} {κ F : ℝ → ℂ} {M : ℝ} (hκ : Integrable κ μ) (hF : AEStronglyMeasurable F μ) (hM : 0 ≤ M) (hFM : ∀ u, ‖F u‖ ≤ M) : Integrable (fun u => κ u * F u) μ ∧ ‖∫ u, κ u * F u ∂μ‖^2 ≤ (∫ u, ‖κ u‖ ∂μ) * ∫ u, ‖κ u‖ * ‖F u‖^2 ∂μ := by have hnorm : Integrable (fun u => ‖κ u‖ * ‖F u‖) μ := by apply (hκ.norm.mul_const M).mono' (hκ.aestronglyMeasurable.norm.mul hF.norm) filter_upwards [] with u change ‖‖κ u‖ * ‖F u‖‖ ≤ ‖κ u‖ * M rw [Real.norm_of_nonneg (mul_nonneg (norm_nonneg _) (norm_nonneg _))] exact mul_le_mul_of_nonneg_left (hFM u) (norm_nonneg _) have hsq : Integrable (fun u => ‖κ u‖ * ‖F u‖^2) μ := by apply (hκ.norm.mul_const (M^2)).mono' (hκ.aestronglyMeasurable.norm.mul (hF.norm.pow 2)) filter_upwards [] with u change ‖‖κ u‖ * ‖F u‖^2‖ ≤ ‖κ u‖ * M^2 rw [Real.norm_of_nonneg (mul_nonneg (norm_nonneg _) (sq_nonneg _))] apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) simpa only [pow_two] using mul_le_mul (hFM u) (hFM u) (norm_nonneg _) hM have hint : Integrable (fun u => κ u * F u) μ := by apply hnorm.mono' (hκ.aestronglyMeasurable.mul hF) filter_upwards [] with u change ‖κ u * F u‖ ≤ ‖κ u‖ * ‖F u‖ exact (norm_mul _ _).le refine ⟨hint, ?_⟩ let A := ∫ u, ‖κ u‖ ∂μ let B := ∫ u, ‖κ u‖ * ‖F u‖ ∂μ let C := ∫ u, ‖κ u‖ * ‖F u‖^2 ∂μ have hA : 0 ≤ A := integral_nonneg (fun u => norm_nonneg _) have hB : 0 ≤ B := integral_nonneg (fun u => mul_nonneg (norm_nonneg _) (norm_nonneg _)) have hbound : ‖∫ u, κ u * F u ∂μ‖ ≤ B := by simpa only [B, norm_mul] using norm_integral_le_integral_norm (fun u => κ u * F u) have hquad (x : ℝ) : 0 ≤ C - 2*x*B + x^2*A := by have hq : 0 ≤ ∫ u, ‖κ u‖ * (‖F u‖ - x)^2 ∂μ := integral_nonneg (fun u => mul_nonneg (norm_nonneg (κ u)) (sq_nonneg (‖F u‖ - x))) have heq : (fun u => ‖κ u‖ * (‖F u‖ - x)^2) = (fun u => (‖κ u‖*‖F u‖^2 - (2*x)*(‖κ u‖*‖F u‖)) + x^2*‖κ u‖) := by funext u ring have hlin : Integrable (fun u => (2*x)*(‖κ u‖*‖F u‖)) μ := hnorm.const_mul _ have hcon : Integrable (fun u => x^2*‖κ u‖) μ := hκ.norm.const_mul _ have hsub : Integrable (fun u => ‖κ u‖*‖F u‖^2 - (2*x)*(‖κ u‖*‖F u‖)) μ := hsq.sub hlin rw [heq, integral_add hsub hcon, integral_sub hsq hlin, integral_const_mul, integral_const_mul] at hq exact hq have hBC : B^2 ≤ A*C := by by_cases hAz : A = 0 · have hBM : B ≤ M*A := by calc B ≤ ∫ u, ‖κ u‖*M ∂μ := integral_mono hnorm (hκ.norm.mul_const M) (fun u => mul_le_mul_of_nonneg_left (hFM u) (norm_nonneg _)) _ = M*A := by rw [integral_mul_const]; ring have hBz : B = 0 := by rw [hAz, mul_zero] at hBM; exact le_antisymm hBM hB rw [hBz,hAz] simp · have hq := mul_nonneg hA (hquad (B/A)) have heq : A * (C - 2*(B/A)*B + (B/A)^2*A) = A*C - B^2 := by field_simp ring rw [heq] at hq nlinarith exact (pow_le_pow_left₀ (norm_nonneg _) hbound 2).trans hBC end Bounty end section /- Polynomial bounds for the number and denominators of the actual rational arcs. -/ open Finset namespace Bounty theorem rational_major_arc_polynomial_count {L q K : ℝ} {k : ℤ} (hL : 5 ≤ L) (hq : 0 ≤ q) (hK : 0 ≤ K) (hk : (k.natAbs : ℝ) ≤ L^K) : (⌊L^q⌋₊ : ℝ)*(2*((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℝ)+1) ≤ L^(2*q+K+1) := by have hLp : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hq1 : 1 ≤ L^q := Real.one_le_rpow hL1 hq have hK1 : 1 ≤ L^K := Real.one_le_rpow hL1 hK have hf : (⌊L^q⌋₊ : ℝ) ≤ L^q := Nat.floor_le (by positivity) have hh : 1 ≤ L^q*L^K := by simpa using mul_le_mul hq1 hK1 zero_le_one (by positivity : 0 ≤ L^q) push_cast calc (⌊L^q⌋₊ : ℝ)*(2*((⌊L^q⌋₊ : ℝ)*((k.natAbs : ℝ)+1))+1) ≤ L^q*(2*(L^q*(2*L^K))+1) := by gcongr; linarith _ ≤ 5*(L^q*L^q*L^K) := by nlinarith [Real.rpow_pos_of_pos hLp q] _ ≤ L*(L^q*L^q*L^K) := mul_le_mul_of_nonneg_right hL (by positivity) _ = L^(2*q+K+1) := by calc _ = L*L^(q+q+K) := by rw [Real.rpow_add hLp (q+q) K, Real.rpow_add hLp q q] _ = L^(1+(q+q+K)) := by rw [Real.rpow_add hLp 1 (q+q+K), Real.rpow_one] _ = _ := by congr 1; ring theorem rational_major_arc_denominator {L q K : ℝ} {k : ℤ} (hL : 0 < L) (hk : k ≠ 0) (hkB : (k.natAbs : ℝ) ≤ L^K) {r : ℕ} (hr : r ∈ Icc 1 ⌊L^q⌋₊) : 0 < k.natAbs*r ∧ ((k.natAbs*r : ℕ) : ℝ) ≤ L^(K+q) := by have hrp : 0 < r := (mem_Icc.mp hr).1 have hkp : 0 < k.natAbs := Int.natAbs_pos.mpr hk refine ⟨Nat.mul_pos hkp hrp, ?_⟩ have hrf : (r : ℝ) ≤ (⌊L^q⌋₊ : ℝ) := by exact_mod_cast (mem_Icc.mp hr).2 have hrB : (r : ℝ) ≤ L^q := hrf.trans (Nat.floor_le (by positivity)) push_cast rw [Real.rpow_add hL] exact mul_le_mul hkB hrB (by positivity) (by positivity) end Bounty end section /- Square-energy transfer from an approximation and its error. -/ open MeasureTheory namespace Bounty theorem integral_square_le_twice_error_add_approximation (μ : Measure ℝ) (f g : ℝ → ℂ) (hf : Integrable (fun t => ‖f t‖^2) μ) (he : Integrable (fun t => ‖f t - g t‖^2) μ) (hg : Integrable (fun t => ‖g t‖^2) μ) : (∫ t, ‖f t‖^2 ∂μ) ≤ 2*(∫ t, ‖f t - g t‖^2 ∂μ) + 2*(∫ t, ‖g t‖^2 ∂μ) := by calc _ ≤ ∫ t, 2*‖f t - g t‖^2 + 2*‖g t‖^2 ∂μ := by apply integral_mono hf ((he.const_mul 2).add (hg.const_mul 2)) intro t change ‖f t‖^2 ≤ 2*‖f t - g t‖^2 + 2*‖g t‖^2 have ht : ‖f t‖ ≤ ‖f t - g t‖ + ‖g t‖ := by simpa only [sub_add_cancel] using norm_add_le (f t - g t) (g t) have hs := pow_le_pow_left₀ (norm_nonneg (f t)) ht 2 nlinarith only [hs, sq_nonneg (‖f t - g t‖ - ‖g t‖)] _ = _ := by rw [integral_add (he.const_mul 2) (hg.const_mul 2), integral_const_mul, integral_const_mul] end Bounty end section /- Integrated weighted Cauchy bounds for finite and dependent finite families. -/ open Finset MeasureTheory namespace Bounty theorem finite_weighted_family_energy_integrable {ι : Type*} (S : Finset ι) (c : ι → ℂ) (P : ι → ℝ → ℂ) (a b : ℝ) (hP : ∀ i ∈ S, ContinuousOn (P i) (Set.Icc a b)) : IntegrableOn (fun t => ‖∑ i ∈ S, c i * P i t‖^2) (Set.Icc a b) := by have hc : ContinuousOn (fun t => ∑ i ∈ S, c i * P i t) (Set.Icc a b) := by apply continuousOn_finsetSum intro i hi exact continuousOn_const.mul (hP i hi) exact (hc.norm.pow 2).integrableOn_Icc theorem finite_weighted_family_energy_le {ι : Type*} (S : Finset ι) (c : ι → ℂ) (P : ι → ℝ → ℂ) (a b B : ℝ) (hP : ∀ i ∈ S, ContinuousOn (P i) (Set.Icc a b)) (henergy : ∀ i ∈ S, (∫ t in Set.Icc a b, ‖P i t‖^2) ≤ B) : (∫ t in Set.Icc a b, ‖∑ i ∈ S, c i * P i t‖^2) ≤ (∑ i ∈ S, ‖c i‖)^2 * B := by have hi : ∀ i ∈ S, IntegrableOn (fun t => ‖c i‖ * ‖P i t‖^2) (Set.Icc a b) := by intro i hi exact ((hP i hi).norm.pow 2).integrableOn_Icc.const_mul _ have hsum : IntegrableOn (fun t => ∑ i ∈ S, ‖c i‖ * ‖P i t‖^2) (Set.Icc a b) := integrable_finsetSum S hi have hpoint (t : ℝ) : ‖∑ i ∈ S, c i * P i t‖^2 ≤ (∑ i ∈ S, ‖c i‖) * ∑ i ∈ S, ‖c i‖ * ‖P i t‖^2 := by simpa only [mul_one, div_one] using complex_row_weighted_cauchy S c (fun i => P i t) (fun _ => 1) (by intros; norm_num) calc _ ≤ ∫ t in Set.Icc a b, (∑ i ∈ S, ‖c i‖) * ∑ i ∈ S, ‖c i‖ * ‖P i t‖^2 := integral_mono (finite_weighted_family_energy_integrable S c P a b hP) (hsum.const_mul _) hpoint _ = (∑ i ∈ S, ‖c i‖) * ∑ i ∈ S, ‖c i‖ * ∫ t in Set.Icc a b, ‖P i t‖^2 := by rw [integral_const_mul, integral_finsetSum S hi] simp only [integral_const_mul] _ ≤ (∑ i ∈ S, ‖c i‖) * ∑ i ∈ S, ‖c i‖ * B := by apply mul_le_mul_of_nonneg_left _ (sum_nonneg (by intros; positivity)) exact sum_le_sum (fun i hi => mul_le_mul_of_nonneg_left (henergy i hi) (norm_nonneg _)) _ = _ := by rw [← sum_mul]; ring theorem dependent_weighted_family_energy_le {ι : Type*} {κ : ι → Type*} [∀ i, Fintype (κ i)] (S : Finset ι) (c : (i : ι) → κ i → ℂ) (P : (i : ι) → κ i → ℝ → ℂ) (a b B : ℝ) (hP : ∀ i ∈ S, ∀ j, ContinuousOn (P i j) (Set.Icc a b)) (henergy : ∀ i ∈ S, ∀ j, (∫ t in Set.Icc a b, ‖P i j t‖^2) ≤ B) : (∫ t in Set.Icc a b, ‖∑ i ∈ S, ∑ j, c i j * P i j t‖^2) ≤ (∑ i ∈ S, ∑ j, ‖c i j‖)^2 * B := by classical have h := finite_weighted_family_energy_le (S.sigma fun _ => univ) (fun q => c q.1 q.2) (fun q => P q.1 q.2) a b B (fun q hq => hP q.1 (mem_sigma.mp hq).1 q.2) (fun q hq => henergy q.1 (mem_sigma.mp hq).1 q.2) simpa only [sum_sigma] using h end Bounty end section /- The gap between the actual small- and big-prime exponents absorbs any fixed polynomial and the retained-box mean-scale constant. -/ open Filter namespace Bounty theorem eventually_small_prime_scale_le_big (q : ℝ) : ∀ᶠ L : ℝ in atTop, 4096 * Real.exp (L^(1/5 : ℝ)) * L^q ≤ Real.exp (L^(3/10 : ℝ)-1) := by filter_upwards [eventually_mul_rpow_le_exp_rpow q (4096*Real.exp 1) (c := (1/5 : ℝ)) (by norm_num), eventually_mul_rpow_log_add_le_rpow (a := (1/5 : ℝ)) (b := (3/10 : ℝ)) (c := 1) (by norm_num) (by norm_num) (by norm_num) 2 0, eventually_ge_atTop (Real.exp 1)] with L hpoly hscale hL have hL0 : 0 < L := (Real.exp_pos 1).trans_le hL have hlog : 1 ≤ Real.log L := by simpa only [Real.log_exp] using Real.log_le_log (Real.exp_pos 1) hL have hpower : 2*L^(1/5 : ℝ) ≤ L^(3/10 : ℝ) := by have hh := mul_le_mul_of_nonneg_left hlog (show 0 ≤ 2*L^(1/5 : ℝ) by positivity) simp only [mul_one, add_zero, one_mul] at hh hscale exact hh.trans hscale apply le_of_mul_le_mul_left (a := Real.exp 1) · calc Real.exp 1 * (4096*Real.exp (L^(1/5 : ℝ))*L^q) = (4096*Real.exp 1*L^q)*Real.exp (L^(1/5 : ℝ)) := by ring _ ≤ Real.exp (L^(1/5 : ℝ))*Real.exp (L^(1/5 : ℝ)) := mul_le_mul_of_nonneg_right hpoly (Real.exp_pos _).le _ = Real.exp (2*L^(1/5 : ℝ)) := by rw [← Real.exp_add]; congr 1; ring _ ≤ Real.exp (L^(3/10 : ℝ)) := Real.exp_le_exp.mpr hpower _ = Real.exp 1 * Real.exp (L^(3/10 : ℝ)-1) := by rw [← Real.exp_add] congr 1 ring · exact Real.exp_pos 1 end Bounty end section /- Two finite coefficient expansions preserve a uniform bound with the product L1 cost. -/ open Finset open scoped Classical namespace Bounty theorem finite_two_cell_expansion_norm {X Y : Type*} [Fintype X] [Fintype Y] (S T : Finset ℤ) (a b : ℤ → ℂ) (F : ℤ → X → ℤ → Y → ℂ) {A B E : ℝ} (hA : 0 ≤ A) (hE : 0 ≤ E) (ha : (∑ d ∈ S, ∑ _x : X, ‖a d‖) ≤ A) (hb : (∑ e ∈ T, ∑ _y : Y, ‖b e‖) ≤ B) (hF : ∀ d ∈ S, ∀ x, ∀ e ∈ T, ∀ y, ‖F d x e y‖ ≤ E) : ‖∑ d ∈ S, ∑ x : X, ∑ e ∈ T, ∑ y : Y, a d * b e * F d x e y‖ ≤ A*B*E := by calc _ ≤ ∑ d ∈ S, ∑ x : X, ∑ e ∈ T, ∑ y : Y, ‖a d‖ * ‖b e‖ * E := by apply (norm_sum_le _ _).trans apply sum_le_sum intro d hd apply (norm_sum_le _ _).trans apply sum_le_sum intro x _ apply (norm_sum_le _ _).trans apply sum_le_sum intro e he apply (norm_sum_le _ _).trans apply sum_le_sum intro y _ simpa only [norm_mul] using mul_le_mul_of_nonneg_left (hF d hd x e he y) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) _ = (∑ d ∈ S, ∑ _x : X, ‖a d‖) * (∑ e ∈ T, ∑ _y : Y, ‖b e‖) * E := by simp only [sum_mul] simp_rw [mul_sum, sum_mul] _ ≤ A*B*E := mul_le_mul_of_nonneg_right (mul_le_mul ha hb (sum_nonneg (fun _ _ => sum_nonneg (fun _ _ => norm_nonneg _))) hA) hE end Bounty end section /- The multiplicative large sieve for finite families of primitive Dirichlet characters. -/ open scoped BigOperators namespace Bounty theorem multiplicative_large_sieve (Q : Finset ℕ) {R N : ℝ} (hR : 1 ≤ R) (hQ0 : ∀ q ∈ Q, 0 < q) (hQR : ∀ q ∈ Q, (q : ℝ) ≤ R) (freq : Finset ℤ) (a : ℤ → ℂ) (hN : 0 ≤ N) (hfreq : ∀ n ∈ freq, |(n : ℝ)| ≤ N) : (∑ q ∈ Q, (q : ℝ) / q.totient * ∑ χ ∈ primitiveCharacters q, ‖∑ n ∈ freq, a n * χ (n : ZMod q)‖ ^ 2) ≤ (6 + 8 * Real.pi) * (N + R ^ 2) * ∑ n ∈ freq, ‖a n‖ ^ 2 := by calc _ ≤ ∑ q ∈ Q, ∑ k ∈ reducedResidues q, ‖finiteFourierSum freq a ((k : ℝ) / q)‖ ^ 2 := by apply Finset.sum_le_sum intro q hq have h := @primitive_character_sum_sq_le_additive q ⟨(hQ0 q hq).ne'⟩ ℤ freq a (fun n => (n : ZMod q)) exact h.trans_eq (@sum_unit_stdAddChar_energy_eq_reducedResidues q ⟨(hQ0 q hq).ne'⟩ freq a) _ ≤ _ := additive_large_sieve_moduli Q hR hQ0 hQR freq a hN hfreq end Bounty end section /- Regrouping large conductors by the complementary squarefree modulus. -/ open Finset namespace Bounty theorem large_conductor_mass_le_complementary (N R : ℕ) (F : ℕ → ℕ → ℝ) (hF : ∀ f h, 0 ≤ F f h) : (∑ d ∈ (Icc 1 N).filter Squarefree, ∑ f ∈ d.divisors.filter (fun f => 1 < f ∧ R < f), F f (d / f) / (d.totient : ℝ)) ≤ ∑ h ∈ (Icc 1 N).filter Squarefree, (1 / (h.totient : ℝ)) * ∑ f ∈ Icc (max 2 (R + 1)) (N / h), F f h / (f.totient : ℝ) := by classical let A := ((Icc 1 N).filter Squarefree).sigma (fun d => d.divisors.filter (fun f => 1 < f ∧ R < f)) let B := ((Icc 1 N).filter Squarefree).sigma (fun h => Icc (max 2 (R + 1)) (N / h)) let τ : (Σ _ : ℕ, ℕ) → (Σ _ : ℕ, ℕ) := fun v => ⟨v.1 / v.2, v.2⟩ let G : (Σ _ : ℕ, ℕ) → ℝ := fun v => (1 / (v.1.totient : ℝ)) * (F v.2 v.1 / (v.2.totient : ℝ)) have hmem (v : Σ _ : ℕ, ℕ) (hv : v ∈ A) : 1 ≤ v.1 ∧ v.1 ≤ N ∧ Squarefree v.1 ∧ v.2 ∣ v.1 ∧ 1 < v.2 ∧ R < v.2 := by obtain ⟨hd, hf⟩ := mem_sigma.mp hv obtain ⟨hdrange, hdsq⟩ := mem_filter.mp hd obtain ⟨hdiv, hf1, hfR⟩ := mem_filter.mp hf exact ⟨(mem_Icc.mp hdrange).1, (mem_Icc.mp hdrange).2, hdsq, (Nat.mem_divisors.mp hdiv).1, hf1, hfR⟩ have hinj : Set.InjOn τ A := by intro v hv w hw heq have hquot : v.1 / v.2 = w.1 / w.2 := congrArg Sigma.fst heq have hf : v.2 = w.2 := by simpa only [τ] using congrArg (fun z : Σ _ : ℕ, ℕ => z.2) heq have hd : v.1 = w.1 := by calc v.1 = v.2 * (v.1 / v.2) := (Nat.mul_div_cancel' (hmem v hv).2.2.2.1).symm _ = w.2 * (w.1 / w.2) := by rw [hquot, hf] _ = w.1 := Nat.mul_div_cancel' (hmem w hw).2.2.2.1 rcases v with ⟨d, f⟩ rcases w with ⟨e, g⟩ dsimp at hd hf subst e subst g rfl have hsub : A.image τ ⊆ B := by intro w hw obtain ⟨v, hv, rfl⟩ := mem_image.mp hw obtain ⟨hd0, hdN, hdsq, hfd, hf1, hfR⟩ := hmem v hv have hf0 : 0 < v.2 := by omega have hh0 : 0 < v.1 / v.2 := Nat.div_pos (Nat.le_of_dvd hd0 hfd) hf0 apply mem_sigma.mpr constructor · apply mem_filter.mpr exact ⟨mem_Icc.mpr ⟨hh0, (Nat.div_le_self _ _).trans hdN⟩, hdsq.squarefree_of_dvd (Nat.div_dvd_of_dvd hfd)⟩ · apply mem_Icc.mpr constructor · change max 2 (R + 1) ≤ v.2 omega · change v.2 ≤ N / (v.1 / v.2) apply (Nat.le_div_iff_mul_le hh0).mpr rwa [Nat.mul_div_cancel' hfd] calc _ = ∑ v ∈ A, F v.2 (v.1 / v.2) / (v.1.totient : ℝ) := by simp only [A, sum_sigma] _ = ∑ v ∈ A, G (τ v) := by apply sum_congr rfl intro v hv obtain ⟨_, _, hdsq, hfd, _, _⟩ := hmem v hv dsimp [G, τ] rw [squarefree_conductor_quotient_totient _ _ hdsq hfd, Nat.cast_mul] simp only [div_eq_mul_inv, mul_inv_rev, one_mul] ring _ = ∑ v ∈ A.image τ, G v := (sum_image hinj).symm _ ≤ ∑ v ∈ B, G v := sum_le_sum_of_subset_of_nonneg hsub (fun v _ _ => mul_nonneg (by positivity) (div_nonneg (hF _ _) (by positivity))) _ = _ := by simp only [B, sum_sigma] apply sum_congr rfl intro h _ dsimp only [G] rw [mul_sum] noncomputable def complementaryConductorNormTerm {Ω : Type*} (f h : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : ℝ := by classical exact ∑ ψ ∈ (univ : Finset (DirichletCharacter ℂ f)).filter (fun ψ => ψ.IsPrimitive ∧ ψ ≠ 1), ‖∑ t ∈ T.filter (fun t => (value t).Coprime h), μ t * ψ (value t : ZMod f)‖ theorem complementary_conductor_norm_nonneg {Ω : Type*} (f h : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : 0 ≤ complementaryConductorNormTerm f h T μ value := by unfold complementaryConductorNormTerm positivity theorem primitive_conductor_norm_eq_complementary {Ω : Type*} (d f : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : primitiveConductorNormTerm d f T μ value = complementaryConductorNormTerm f (d / f) T μ value := rfl theorem large_primitive_conductor_mass_le_complementary {Ω : Type*} (N R : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) : (∑ d ∈ (Icc 1 N).filter Squarefree, largePrimitiveConductorNormSum d R T μ value / (d.totient : ℝ)) ≤ ∑ h ∈ (Icc 1 N).filter Squarefree, (1 / (h.totient : ℝ)) * ∑ f ∈ Icc (max 2 (R + 1)) (N / h), complementaryConductorNormTerm f h T μ value / (f.totient : ℝ) := by have h := large_conductor_mass_le_complementary N R (fun f h => complementaryConductorNormTerm f h T μ value) (fun f h => complementary_conductor_norm_nonneg f h T μ value) simpa only [largePrimitiveConductorNormSum, sum_div, primitive_conductor_norm_eq_complementary] using h theorem candidate_large_primitive_mass_le_complementary (c L q : ℝ) (r jStar N R : ℕ) : candidateLargePrimitiveTypeIMass c L q r jStar N R ≤ ∑ h ∈ (Icc 1 N).filter Squarefree, (1 / (h.totient : ℝ)) * ∑ f ∈ Icc (max 2 (R + 1)) (N / h), complementaryConductorNormTerm f h (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u) / (f.totient : ℝ) := by apply le_trans _ (large_primitive_conductor_mass_le_complementary N R (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u)) unfold candidateLargePrimitiveTypeIMass apply sum_le_sum_of_subset_of_nonneg · intro d hd exact mem_filter.mpr ⟨(mem_filter.mp hd).1, (mem_filter.mp hd).2.1⟩ · intro d _ _ exact div_nonneg (large_primitive_conductor_norm_nonneg d R _ _ _) (Nat.cast_nonneg _) end Bounty end section /- Disjoint rectangle layers preserve the square-root energy bound. -/ open Finset namespace Bounty theorem disjoint_list_mass_le {α : Type*} (L : List (Finset α)) (M : Finset α) (w : α → ℝ) (hw : ∀ x, 0 ≤ w x) (hpair : L.Pairwise Disjoint) (hsub : ∀ A ∈ L, A ⊆ M) : (L.map (fun A => ∑ x ∈ A, w x)).sum ≤ ∑ x ∈ M, w x := by classical induction L generalizing M with | nil => simpa using sum_nonneg (fun x _ => hw x) | cons A L ih => obtain ⟨hAL, hLL⟩ := List.pairwise_cons.mp hpair have hAM : A ⊆ M := hsub A List.mem_cons_self have hLM : ∀ B ∈ L, B ⊆ M \ A := by intro B hB x hx apply mem_sdiff.mpr refine ⟨hsub B (List.mem_cons_of_mem A hB) hx, ?_⟩ intro hxA exact disjoint_left.mp (hAL B hB) hxA hx calc (List.map (fun A => ∑ x ∈ A, w x) (A :: L)).sum = (∑ x ∈ A, w x) + (L.map (fun B => ∑ x ∈ B, w x)).sum := rfl _ ≤ (∑ x ∈ A, w x) + ∑ x ∈ M \ A, w x := add_le_add le_rfl (ih _ hLL hLM) _ = ∑ x ∈ M, w x := by rw [add_comm, sum_sdiff hAM] section variable {α β : Type*} (L : List (Finset α × Finset β)) (M : Finset α) (N : Finset β) (a : α → ℝ) (b : β → ℝ) (ha : ∀ m, 0 ≤ a m) (hb : ∀ n, 0 ≤ b n) (hpair : L.Pairwise (fun r s => Disjoint r.1 s.1 ∧ Disjoint r.2 s.2)) (hsub : ∀ r ∈ L, r.1 ⊆ M ∧ r.2 ⊆ N) include α β L M N a b ha hb hpair hsub theorem disjoint_rectangle_layer_sqrt_le : (L.map (fun r => Real.sqrt ((∑ m ∈ r.1, a m) * ∑ n ∈ r.2, b n))).sum ≤ Real.sqrt ((∑ m ∈ M, a m) * ∑ n ∈ N, b n) := by classical have hrow : (L.map (fun r => ∑ m ∈ r.1, a m)).sum ≤ ∑ m ∈ M, a m := by simpa only [List.map_map, Function.comp_def] using disjoint_list_mass_le (L.map Prod.fst) M a ha (List.pairwise_map.mpr (hpair.imp (fun h => h.1))) (by intro A hA; obtain ⟨r, hr, rfl⟩ := List.mem_map.mp hA; exact (hsub r hr).1) have hcol : (L.map (fun r => ∑ n ∈ r.2, b n)).sum ≤ ∑ n ∈ N, b n := by simpa only [List.map_map, Function.comp_def] using disjoint_list_mass_le (L.map Prod.snd) N b hb (List.pairwise_map.mpr (hpair.imp (fun h => h.2))) (by intro A hA; obtain ⟨r, hr, rfl⟩ := List.mem_map.mp hA; exact (hsub r hr).2) have hcs := Real.sum_sqrt_mul_sqrt_le (univ : Finset (Fin L.length)) (f := fun i => ∑ m ∈ L[i.val].1, a m) (g := fun i => ∑ n ∈ L[i.val].2, b n) (fun _ => sum_nonneg (fun m _ => ha m)) (fun _ => sum_nonneg (fun n _ => hb n)) have hcs' : (L.map (fun r => Real.sqrt (∑ m ∈ r.1, a m) * Real.sqrt (∑ n ∈ r.2, b n))).sum ≤ Real.sqrt ((L.map (fun r => ∑ m ∈ r.1, a m)).sum) * Real.sqrt ((L.map (fun r => ∑ n ∈ r.2, b n)).sum) := by have hconv (f : Finset α × Finset β → ℝ) : (∑ i : Fin L.length, f L[i.val]) = (L.map f).sum := by rw [← List.sum_ofFn] exact congrArg List.sum (List.ofFn_getElem_eq_map L f) rw [← hconv, ← hconv, ← hconv] exact hcs calc _ = (L.map (fun r => Real.sqrt (∑ m ∈ r.1, a m) * Real.sqrt (∑ n ∈ r.2, b n))).sum := by congr 1 apply List.map_congr_left intro r hr exact Real.sqrt_mul (sum_nonneg (fun m _ => ha m)) _ _ ≤ Real.sqrt ((L.map (fun r => ∑ m ∈ r.1, a m)).sum) * Real.sqrt ((L.map (fun r => ∑ n ∈ r.2, b n)).sum) := hcs' _ ≤ Real.sqrt (∑ m ∈ M, a m) * Real.sqrt (∑ n ∈ N, b n) := mul_le_mul (Real.sqrt_le_sqrt hrow) (Real.sqrt_le_sqrt hcol) (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) _ = _ := (Real.sqrt_mul (sum_nonneg (fun m _ => ha m)) _).symm theorem disjoint_rectangle_layer_bound (f : Finset α × Finset β → ℝ) {C : ℝ} (hC : 0 ≤ C) (hf : ∀ r ∈ L, f r ≤ C * Real.sqrt ((∑ m ∈ r.1, a m) * ∑ n ∈ r.2, b n)) : (L.map f).sum ≤ C * Real.sqrt ((∑ m ∈ M, a m) * ∑ n ∈ N, b n) := by calc _ ≤ (L.map (fun r => C * Real.sqrt ((∑ m ∈ r.1, a m) * ∑ n ∈ r.2, b n))).sum := List.sum_le_sum hf _ = C * (L.map (fun r => Real.sqrt ((∑ m ∈ r.1, a m) * ∑ n ∈ r.2, b n))).sum := List.sum_map_mul_left _ _ _ _ ≤ _ := mul_le_mul_of_nonneg_left (disjoint_rectangle_layer_sqrt_le L M N a b ha hb hpair hsub) hC end theorem subadditive_list_sum_le {E : Type*} [AddCommMonoid E] (p : E → ℝ) (hp0 : p 0 = 0) (hpadd : ∀ x y, p (x + y) ≤ p x + p y) (L : List E) : p L.sum ≤ (L.map p).sum := by induction L with | nil => simp [hp0] | cons x L ih => simpa only [List.sum_cons, List.map_cons] using (hpadd x L.sum).trans (add_le_add le_rfl ih) theorem subadditive_finset_sum_le {α E : Type*} [AddCommMonoid E] (p : E → ℝ) (hp0 : p 0 = 0) (hpadd : ∀ x y, p (x + y) ≤ p x + p y) (S : Finset α) (f : α → E) : p (∑ x ∈ S, f x) ≤ ∑ x ∈ S, p (f x) := by classical induction S using Finset.induction_on with | empty => simp [hp0] | @insert x S hx ih => simp only [sum_insert hx] exact (hpadd _ _).trans (add_le_add le_rfl ih) theorem dyadic_prefix_subadditive_bound {α E : Type*} [AddCommMonoid E] (K : ℕ) (M : Finset α) (κ : α → ℕ) (hκ : ∀ m ∈ M, κ m ≤ 2 ^ K) (a : α → ℝ) (b : ℕ → ℝ) (ha : ∀ m, 0 ≤ a m) (hb : ∀ n, 0 ≤ b n) (F : α → ℕ → E) (p : E → ℝ) (hp0 : p 0 = 0) (hpadd : ∀ x y, p (x + y) ≤ p x + p y) {C : ℝ} (hC : 0 ≤ C) (hrect : ∀ A ⊆ M, ∀ B ⊆ range (2 ^ K), p (∑ m ∈ A, ∑ n ∈ B, F m n) ≤ C * Real.sqrt ((∑ m ∈ A, a m) * ∑ n ∈ B, b n)) : p (∑ m ∈ M, ∑ n ∈ range (κ m), F m n) ≤ (K + 1 : ℝ) * C * Real.sqrt ((∑ m ∈ M, a m) * ∑ n ∈ range (2 ^ K), b n) := by classical rw [dyadicPrefixLayer_weighted_sum K M κ hκ F] calc _ ≤ ∑ d ∈ range (K + 1), p (prefixLayerSum F (dyadicPrefixLayer K d M κ)) := subadditive_finset_sum_le p hp0 hpadd _ _ _ ≤ ∑ d ∈ range (K + 1), C * Real.sqrt ((∑ m ∈ M, a m) * ∑ n ∈ range (2 ^ K), b n) := by apply sum_le_sum intro d hd have htri := subadditive_list_sum_le p hp0 hpadd ((dyadicPrefixLayer K d M κ).map (prefixRectangleSum F)) simp only [List.map_map, Function.comp_def] at htri apply htri.trans apply disjoint_rectangle_layer_bound _ M (range (2 ^ K)) a b ha hb (dyadicPrefixLayer_pairwise K d M κ) (dyadicPrefixLayer_bounds K d M κ) _ hC intro r hr obtain ⟨hrM, hrN⟩ := dyadicPrefixLayer_bounds K d M κ r hr exact hrect r.1 hrM r.2 hrN _ = _ := by simp [sum_const, nsmul_eq_mul]; ring end Bounty end section /- The actual candidate coefficient tested against arbitrary complex functions. -/ open Finset Filter open scoped Topology namespace Bounty theorem candidate_coefficient_complex_test_of_free (c L q : ℝ) (r jStar : ℕ) (F : ℕ → ℂ) (hfree : ∀ n, candidateQWeight c L r jStar n ≠ 0 → n ≠ 0 ∧ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c * L)))) : (∑ u ∈ arithmeticProductWindow 1 (Real.exp L), (candidateCoefficient c L q r jStar u : ℂ) * F u) = ∑ p ∈ candidateSmallPSet c L (16 * Real.exp L + 1), (candidatePWeight c L q p : ℂ) * ∑ n ∈ arithmeticProductWindow p (Real.exp L), (candidateQWeight c L r jStar n : ℂ) * F (p*n) := by symm apply supported_free_window_complex_test_eq ((candidatePIndices c L).biUnion (candidatePBand (c * L))) (candidateSmallPSet c L (16 * Real.exp L + 1)) (candidatePWeight c L q) (candidateQWeight c L r jStar) (candidateCoefficient c L q r jStar) F (Real.exp L) · intro p hp exact ((mem_candidateSmallPSet_iff c L _ p).mp hp).2 · exact hfree · intro p hp n hn exact candidate_coefficient_mul_of_free c L q r jStar ((mem_candidateSmallPSet_iff c L _ p).mp hp).2 (hfree n hn).1 (hfree n hn).2 · intro u hu hWu let P := (candidatePIndices c L).biUnion (candidatePBand (c * L)) let p := primePoolPart P u let n := primePoolFreePart P u have hurange : Real.exp L < (u : ℝ) ∧ (u : ℝ) ≤ 16 * Real.exp L := by simpa only [one_mul] using (mem_arithmeticProductWindow_iff one_ne_zero (Real.exp L)).mp hu have hu0 : u ≠ 0 := by have hpos : (0 : ℝ) < u := (Real.exp_pos L).trans hurange.1 exact_mod_cast ne_of_gt hpos have hpu : p ≤ u := Nat.le_of_dvd (Nat.pos_of_ne_zero hu0) (primePoolPart_dvd P u) have hpSupport : p ∈ Nat.factoredNumbers P := primePoolPart_mem_factoredNumbers P u have hpn : p * n = u := primePoolPart_mul_primePoolFreePart P u have hp : p ∈ candidateSmallPSet c L (16 * Real.exp L + 1) := by apply (mem_candidateSmallPSet_iff c L _ p).mpr refine ⟨?_, hpSupport⟩ have hpuR : (p : ℝ) ≤ u := Nat.cast_le.mpr hpu linarith [hurange.2] have hn : n ∈ arithmeticProductWindow p (Real.exp L) := by apply (mem_arithmeticProductWindow_iff (primePoolPart_ne_zero P u) (Real.exp L)).mpr change Real.exp L < (p * n : ℕ) ∧ (p * n : ℕ) ≤ 16 * Real.exp L simpa only [hpn] using hurange exact ⟨p, hp, n, hn, left_ne_zero_of_mul hWu, hpn⟩ /- The threshold is uniform over the test function and all auxiliary parameters. -/ theorem eventually_candidate_coefficient_complex_test {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (F : ℕ → ℂ), (∑ u ∈ arithmeticProductWindow 1 (Real.exp L), (candidateCoefficient c L q r jStar u : ℂ) * F u) = ∑ p ∈ candidateSmallPSet c L (16 * Real.exp L + 1), (candidatePWeight c L q p : ℂ) * ∑ n ∈ arithmeticProductWindow p (Real.exp L), (candidateQWeight c L r jStar n : ℂ) * F (p*n) := by filter_upwards [eventually_candidate_P_pool_below_rough_cutoff hc, eventually_ge_atTop (0 : ℝ)] with L hpool hL intro q r jStar F apply candidate_coefficient_complex_test_of_free intro n hn obtain ⟨x, hx⟩ := ordered_slot_weight_ne_zero_support _ _ hn refine ⟨?_, ?_⟩ · rw [← hx] exact prod_ne_zero_iff.mpr (fun slot _ => candidate_Q_slot_nonzero c L r jStar slot (x slot).property) · rw [← hx] exact candidate_Q_tuple_primeFactors_disjoint (mul_nonneg hc.le hL) hpool x end Bounty end section /- A natural-prime index for complex one-slot extraction. -/ open Finset namespace Bounty theorem ordered_slot_complex_window_split_finset {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (i : I) (normalization : ℝ) (S : Finset ℕ) (F : ℕ → ℂ) : (∑ n ∈ S, (orderedSlotWeight choices normalization n : ℂ) * F n) = ∑ p ∈ choices i, ∑ y : ∀ j : {j : I // j ≠ i}, choices j.val, if p * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y ∈ S then (1 / (normalization : ℂ)) * F (p * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y) else 0 := by rw [ordered_slot_complex_window_split choices i normalization S F] exact Finset.sum_coe_sort (choices i) (fun p => ∑ y : ∀ j : {j : I // j ≠ i}, choices j.val, if p * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y ∈ S then (1 / (normalization : ℂ)) * F (p * orderedSlotProduct (fun j : {j : I // j ≠ i} => choices j.val) y) else 0) end Bounty end section /- Exact coordinate omission for the asymmetric fresh-label comparison. -/ namespace Bounty open Finset open scoped Classical section variable {I : Type*} [sharedInstance1 : DecidableEq I] {X : I → Type*} (μ : ∀ i, X i → ℝ) include I sharedInstance1 X μ theorem finite_shared_density_update_left (s : Finset I) (i : I) (hi : i ∉ s) (x y : ∀ i, X i) (v : X i) : finiteSharedDensity μ s (Function.update x i v) y = finiteSharedDensity μ s x y := by unfold finiteSharedDensity apply prod_congr rfl intro j hj have hji : j ≠ i := fun he => hi (he ▸ hj) rw [Function.update_of_ne hji] theorem finite_shared_density_update_right (s : Finset I) (i : I) (hi : i ∉ s) (x y : ∀ i, X i) (v : X i) : finiteSharedDensity μ s x (Function.update y i v) = finiteSharedDensity μ s x y := by unfold finiteSharedDensity apply prod_congr rfl intro j hj have hji : j ≠ i := fun he => hi (he ▸ hj) rw [Function.update_of_ne hji] theorem finite_asymmetric_density_update_left (shared A B : Finset I) (F : (∀ i : shared, X i.val) → (∀ i : A, X i.val) → (∀ i : B, X i.val) → ℂ) (i : I) (his : i ∉ shared) (hiB : i ∉ B) (x y : ∀ i, X i) (v : X i) : finiteAsymmetricDensity μ shared A B F (Function.update x i v) y = finiteAsymmetricDensity μ shared A B F x y := by simp only [finiteAsymmetricDensity, finite_shared_density_update_left μ shared i his, finite_coordinate_restrict_update shared i his, finite_coordinate_restrict_update B i hiB] theorem finite_asymmetric_density_update_right (shared A B : Finset I) (F : (∀ i : shared, X i.val) → (∀ i : A, X i.val) → (∀ i : B, X i.val) → ℂ) (i : I) (his : i ∉ shared) (hiA : i ∉ A) (x y : ∀ i, X i) (v : X i) : finiteAsymmetricDensity μ shared A B F x (Function.update y i v) = finiteAsymmetricDensity μ shared A B F x y := by simp only [finiteAsymmetricDensity, finite_shared_density_update_right μ shared i his, finite_coordinate_restrict_update A i hiA] end theorem finite_asymmetric_components_zero {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ v, μ i v = 1) (shared U V S T A B : Finset I) (hS : S ⊆ U) (hT : T ⊆ V) (hA : A ⊆ U) (hB : B ⊆ V) (hAB : Disjoint A B) (hsA : Disjoint shared A) (hsB : Disjoint shared B) (hμ : ∀ i ∈ shared, ∀ v, μ i v ≠ 0) (F : (∀ i : shared, X i.val) → (∀ i : A, X i.val) → (∀ i : B, X i.val) → ℂ) (f g : (∀ i, X i) → ℂ) (hnot : ¬(A ⊆ U \ S ∧ B ⊆ V \ T)) : cleanKernelPairing (finiteProductWeight μ) (finiteAsymmetricKernel μ shared A B F) (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g) = 0 := by have heq : finiteAsymmetricKernel μ shared A B F = fun x y => (finiteProductWeight μ y : ℂ) * finiteAsymmetricDensity μ shared A B F x y := by funext x y exact finite_asymmetric_kernel_eq_density μ shared A B hμ F x y rw [heq] apply clean_kernel_components_zero_of_not_admissible μ hmass U V S T A B hS hT hA hB (finiteAsymmetricDensity μ shared A B F) f g · intro i hi x y v exact finite_asymmetric_density_update_left μ shared A B F i (fun hs => disjoint_left.mp hsA hs hi) (fun hb => disjoint_left.mp hAB hi hb) x y v · intro i hi x y v exact finite_asymmetric_density_update_right μ shared A B F i (fun hs => disjoint_left.mp hsB hs hi) (fun ha => disjoint_left.mp hAB ha hi) x y v · exact hnot noncomputable def finiteAsymmetricComparisonKernel {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (μ : ∀ i, X i → ℝ) (active : Finset I) (F : ∀ A B : Finset I, (∀ i : ↥(active \ (A ∪ B)), X i.val) → (∀ i : A, X i.val) → (∀ i : B, X i.val) → ℂ) (A B : Finset I) : (∀ i, X i) → (∀ i, X i) → ℂ := finiteAsymmetricKernel μ (active \ (A ∪ B)) A B (F A B) theorem finite_asymmetric_comparison_components_zero {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ v, μ i v = 1) (hμ : ∀ i v, μ i v ≠ 0) (active U V S T A B : Finset I) (hUV : Disjoint U V) (hS : S ⊆ U) (hT : T ⊆ V) (hA : A ⊆ U) (hB : B ⊆ V) (F : ∀ A B : Finset I, (∀ i : ↥(active \ (A ∪ B)), X i.val) → (∀ i : A, X i.val) → (∀ i : B, X i.val) → ℂ) (f g : (∀ i, X i) → ℂ) (hnot : ¬(A ⊆ U \ S ∧ B ⊆ V \ T)) : cleanKernelPairing (finiteProductWeight μ) (finiteAsymmetricComparisonKernel μ active F A B) (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g) = 0 := by apply finite_asymmetric_components_zero μ hmass (active \ (A ∪ B)) U V S T A B hS hT hA hB · exact hUV.mono hA hB · apply disjoint_left.mpr intro i hs hi exact (mem_sdiff.mp hs).2 (mem_union_left B hi) · apply disjoint_left.mpr intro i hs hi exact (mem_sdiff.mp hs).2 (mem_union_right A hi) · intro i _ v exact hμ i v · exact hnot end Bounty end section /- Full continuations at a fixed physical target list are recovered from raw ledger/memory, and coincide with the true full target on contributing edge events. -/ open scoped Classical namespace Bounty section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (R : PhysicalMarkLists P J ell) noncomputable def physicalFullContinuation (F : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) := fixedActiveRawExtension (fun g (p : ↥(P g)) => p.val) B (fun g i => R g (physicalFullSlotIndex (C g) i)) F theorem physical_full_continuation_decode (F : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) (H : (g : Fin N) → Finset ↥(P g)) (x : PhysicalFullBoundedState P J ell B) : physicalFullContinuation C R F (fullMixedLedgerDecode (fun g (p : ↥(P g)) => p.val) B (H, x)) = F (H, physicalFullMemoryState C R (fun g => (x g).2)) := fixed_active_raw_extension_decode _ _ _ F (H, x) end Physical section Edge variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L R : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (ω : ∀ _c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) theorem physical_full_edge_continuation_of_nonzero (hw : fullActiveEdgeEventWeight (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e ≠ 0) (hp : physicalFullEdgePhase C k L R H q e ≠ 0) (F : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) : let n := fun g (p : ↥(P g)) => p.val let S := fun g => physicalFullSharedIndices (ell := ell) (C g) let A := fun _ : SharedActiveLabels (fun g => ↥(P g)) S => PhysicalAuxLabels P C let x := physicalFullMemoryState C L q physicalFullContinuation C R F (fullEdgeLedgerRawTarget n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) H x e) = F (fullEdgeLedgerUpdate n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) H x e, fullActiveEdgeEventTarget n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x e) := by dsimp only rw [show fullEdgeLedgerRawTarget (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) H (physicalFullMemoryState C L q) e = fullMixedLedgerDecode (fun g (p : ↥(P g)) => p.val) B (fullEdgeLedgerUpdate (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) H (physicalFullMemoryState C L q) e, fullActiveEdgeEventTarget (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) (physicalFullMemoryState C L q) e) from rfl] rw [physical_full_continuation_decode] rw [← physical_full_edge_target_of_nonzero C k L R H q ω μ ρ V e hw hp] theorem physical_full_edge_continuation_weighted (F : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) : let n := fun g (p : ↥(P g)) => p.val let S := fun g => physicalFullSharedIndices (ell := ell) (C g) let A := fun _ : SharedActiveLabels (fun g => ↥(P g)) S => PhysicalAuxLabels P C let x := physicalFullMemoryState C L q let w := fullActiveEdgeEventWeight n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V x e (w : ℂ) * physicalFullEdgePhase C k L R H q e * physicalFullContinuation C R F (fullEdgeLedgerRawTarget n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) H x e) = (w : ℂ) * physicalFullEdgePhase C k L R H q e * F (fullEdgeLedgerUpdate n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) H x e, fullActiveEdgeEventTarget n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x e) := by dsimp only by_cases hw : fullActiveEdgeEventWeight (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e = 0 · simp only [hw, Complex.ofReal_zero, zero_mul] · by_cases hp : physicalFullEdgePhase C k L R H q e = 0 · simp only [hp, mul_zero, zero_mul] · rw [physical_full_edge_continuation_of_nonzero C k L R H q ω μ ρ V e hw hp F] end Edge end Bounty end section /- A ghost row carries a full-state continuation exactly through raw memory: the active tuple is unchanged, even for invalid fallback events. -/ open Finset namespace Bounty section Full variable {I K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) theorem full_mixed_ghost_continuation_target (j : I) (F : FullMixedLedgerState n (M := M) B → ℂ) (s : FullMixedLedgerState n (M := M) B) (e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s.2) : fixedActiveRawExtension n B (fun g => (s.2 g).1) F (fullMixedLedgerDecode n B (fullMixedLedgerTarget n S B A Δ D (some (.inl j)) s e)) = F (fullMixedLedgerTarget n S B A Δ D (some (.inl j)) s e) := by apply fixed_active_raw_extension_self intro g exact fullPermutationMixedEventTarget_ghost_active n S B A Δ D j s.2 e g variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (β : (g : Fin N) → P g → ℝ) (q : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem full_mixed_raw_ghost_continuation (a : (g : Fin N) → P g → Bool) (hV : ∀ g, V g ≠ 0) (j : I) (F : FullMixedLedgerState n (M := M) B → ℂ) (s : FullMixedLedgerState n (M := M) B) : globalBirthJointCutRawRow (fun g => GlobalBirthRawStep.visit (a := a g) (fun _ => 0) (β g) (1 - q j) (V g) ρ (hV g) B) B B (fixedActiveRawExtension n B (fun g => (s.2 g).1) F) (fullMixedLedgerDecode n B s) = fullMixedLedgerRow n S B A Δ D edgePhase ω (fun g p => β g p / V g) q ρ V (some (.inl j)) F s := by refine (full_mixed_ledger_raw_visit_row n S B A Δ D edgePhase ω q ρ V β a hV j (fixedActiveRawExtension n B (fun g => (s.2 g).1) F) s).trans ?_ unfold fullMixedLedgerRow finiteLocalPhasedRow apply sum_congr rfl intro e _ dsimp only [Function.comp_apply] rw [full_mixed_ghost_continuation_target] end Full end Bounty end section /- Uniform additive-frequency comparison from the actual major and minor arc estimates. -/ open scoped BigOperators Classical universe u namespace Bounty theorem prime_all_frequency_dyadic_pairing (hZ : PrimitiveZeroFreeHalfPlane) : ∃ CM CE : ℝ, 0 < CM ∧ 0 < CE ∧ ∀ L q κ t n x w z d B : ℝ, 512 ≤ L → 0 ≤ q → 0 ≤ t → 0 ≤ d → 2 * κ + t + 2 * B + 3 ≤ q → n + 2 * B + 2 ≤ x → 4 * q + max z q + B + 2 ≤ w → q + B + 2 ≤ d → ∀ Q : ℕ, Q = ⌊L ^ q⌋₊ → 0 < Q → ∀ {I J : Type u} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I) (R : J → Finset ℕ) (W : J → ℝ) (j : J), (∀ k, 0 < V k) → (∀ k, 0 < W k) → (∀ k p, p ∈ P k → p.Prime ∧ Q < p) → (∀ k p, p ∈ R k → p.Prime ∧ Q < p) → (∀ k, ∑ p ∈ P k, 1 / (p : ℝ) = V k) → (∀ k, ∑ p ∈ R k, 1 / (p : ℝ) = W k) → ∀ a b a' b' : ℝ, P i = primeBand a b → R j = primeBand a' b' → 2 ≤ a → 0 ≤ b → 2 ≤ a' → 0 ≤ b' → ∀ h ξ : ℝ, 0 < h → h ≤ Real.log 2 → 0 < ξ → h ≤ L ^ (-w) → ξ ≤ L ^ (-x) → (Q * Q - 1 : ℕ) * (((CE / V i) * a ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 → (Q * Q - 1 : ℕ) * (((CE / W j) * a' ^ (-(1 : ℝ) / 32) * (1 + Real.log (Q * Q : ℕ) / Real.log a')) / ξ) ≤ 1 → primeKernelError CM Q (V i) a ξ ≤ L ^ (-d) → primeKernelError CM Q (W j) a' ξ ≤ L ^ (-d) → (((finiteOccupiedCells (fun v : (∀ k, P k) => upperLogCell h (Real.log (∏ k, (v k).val : ℕ)))).card + (finiteOccupiedCells (fun v : (∀ k, R k) => upperLogCell h (Real.log (∏ k, (v k).val : ℕ)))).card : ℕ) : ℝ) ≤ L ^ n → ∀ U T : ℕ, L ^ q ≤ (U : ℝ) → L ^ q ≤ (T : ℝ) → Real.log ((U : ℝ) * T) ≤ L ^ t → ∀ (f : (∀ k, P k) → ℂ) (g : (∀ k, R k) → ℂ), (∀ v, f v ≠ 0 → U ≤ (∏ k, (v k).val : ℕ) ∧ (∏ k, (v k).val : ℕ) < 2 * U) → (∀ v, g v ≠ 0 → T ≤ (∏ k, (v k).val : ℕ) ∧ (∏ k, (v k).val : ℕ) < 2 * T) → ∀ C D : ℝ, 0 ≤ C → 0 ≤ D → C ≤ L ^ κ → D ≤ L ^ κ → (∀ m : ℕ, (∑ v ∈ Finset.univ.filter (fun v : (∀ k, P k) => (∏ k, (v k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw V) v) ≤ C / (m : ℝ)) → (∀ m : ℕ, (∑ v ∈ Finset.univ.filter (fun v : (∀ k, R k) => (∏ k, (v k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw W) v) ≤ D / (m : ℝ)) → ∀ α ζ : ℝ, |ζ| ≤ L ^ z → let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) let phase := fun (v : ∀ k, P k) (s : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (v k).val : ℕ) : ℝ) * (∏ k, (s k).val : ℕ)) + 2 * Real.pi * (α * (((∏ k, (v k).val : ℕ) : ℝ) * (∏ k, (s k).val : ℕ))) : ℝ)) ‖∑ v, ∑ s, ((μ v * ν s : ℝ) : ℂ) * ((phase v s - finiteTwoKernelAverage μ ν KA KB v s phase) * f v * g s)‖ ≤ L ^ (-B) * Real.sqrt ((∑ v, μ v * ‖f v‖ ^ 2) * ∑ s, ν s * ‖g s‖ ^ 2) := by obtain ⟨CM, hCM, hmajor⟩ := prime_major_arc_dyadic_pairing.{u} hZ obtain ⟨CE, hCE, hminor⟩ := prime_minor_arc_dyadic_pairing.{u} hZ refine ⟨CM, CE, hCM, hCE, ?_⟩ intro L q κ t n x w z d B hL hq ht hd hparam hxp hwp hdp Q hQfloor hQ I J _ _ _ _ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hh2 hξ hhb hξb hsmallP hsmallR hεP hεR hcells U T hUb hTb hlog f g hf hg C D hC hD hCb hDb hμatom hνatom α ζ hζ have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hU0 : (0 : ℝ) < U := (Real.rpow_pos_of_pos hL0 q).trans_le hUb have hT0 : (0 : ℝ) < T := (Real.rpow_pos_of_pos hL0 q).trans_le hTb have hU : 0 < U := by exact_mod_cast hU0 have hT : 0 < T := by exact_mod_cast hT0 obtain ⟨u, r, β, hr, hcop, hα, hβ, hscale, hratio, hcase⟩ := polynomial_dirichlet_dichotomy α L q U T hL1 hq hUb hTb rw [hα] rcases hcase with hmajorr | hminorr · have hrQ : r ≤ Q := by simpa only [hQfloor] using hmajorr have hpair := hmajor Q hQ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hh2 hξ U T hU0.le hT0.le f g (fun v hv => ⟨by exact_mod_cast (hf v hv).1, by exact_mod_cast (hf v hv).2.le⟩) (fun v hv => ⟨by exact_mod_cast (hg v hv).1, by exact_mod_cast (hg v hv).2.le⟩) r hr hrQ u ζ β apply hpair.trans apply mul_le_mul_of_nonneg_right _ (Real.sqrt_nonneg _) have hQb : (Q : ℝ) ≤ L ^ q := by rw [hQfloor] exact Nat.floor_le (Real.rpow_pos_of_pos hL0 q).le have hnum := major_arc_coefficient_small hL (Nat.cast_nonneg Q) (by positivity) hξ.le hh.le (abs_nonneg ζ) (mul_nonneg (abs_nonneg β) (mul_pos hU0 hT0).le) (prime_kernel_error_nonneg hCM.le (hV i).le ha hξ.le hQ) (prime_kernel_error_nonneg hCM.le (hW j).le ha' hξ.le hQ) hq hd hQb hcells hξb hhb hζ hscale hεP hεR hxp hwp hdp convert hnum using 1 <;> first | rfl | (push_cast; ring) · have hpair := hminor Q hQ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hh2 hξ hsmallP hsmallR U T hU hT f g hf hg C D hC hD hμatom hνatom r hr u hcop β hβ ζ apply hpair.trans apply mul_le_mul_of_nonneg_right _ (Real.sqrt_nonneg _) exact minor_arc_uniform_factor_le hL hC hD ht hq hparam hCb hDb hUb hTb hminorr.le hratio hlog end Bounty end section /- Increasing a memory cap commutes with the full/reduced active-state split, its reassembly, and permutations of active or pending coordinates. -/ namespace Bounty end Bounty end section /- Exact signed ghost-event transport between two memory caps. Only supported events are used for target compatibility; invalid raw outputs carry zero weight even when their fallback target has small memory. -/ open Finset Classical namespace Bounty section variable {P Z : Type*} {t b B : ℕ} (h : b ≤ B) def boundedGhostEventCapEmbed (s : BoundedOrderedState P Z t b) (e : BoundedGhostEvent t b s) : BoundedGhostEvent t B (boundedStateCapEmbed h s) := ⟨⟨e.1.val, lt_of_lt_of_le e.1.isLt (Nat.add_le_add_right h 1)⟩, e.2⟩ theorem boundedGhostEventCapEmbed_injective (s : BoundedOrderedState P Z t b) : Function.Injective (boundedGhostEventCapEmbed h s) := by intro e f hef rcases e with ⟨⟨k, hk⟩, e⟩ rcases f with ⟨⟨l, hl⟩, f⟩ have hkl : k = l := congrArg (fun x => x.1.val) hef subst l have hef' : e = f := by exact eq_of_heq (Sigma.mk.inj_iff.mp hef).2 subst f rfl theorem boundedGhostEventCapEmbed_target (s : BoundedOrderedState P Z t b) (e : BoundedGhostEvent t b s) (he : e.2.1.card + e.1.val ≤ b) : boundedGhostEventTarget t B (boundedStateCapEmbed h s) (boundedGhostEventCapEmbed h s e) = boundedStateCapEmbed h (boundedGhostEventTarget t b s e) := by have heB := he.trans h unfold boundedGhostEventTarget rw [dif_pos (show (retainedBirthTuple (boundedStateCapEmbed h s).2.2 (boundedGhostEventCapEmbed h s e).2.1 (boundedGhostEventCapEmbed h s e).2.2).1 ≤ B from heB)] rw [dif_pos (show (retainedBirthTuple s.2.2 e.2.1 e.2.2).1 ≤ b from he)] rfl theorem boundedGhostEventWeight_valid (A D C ν : Z → ℝ) (s : BoundedOrderedState P Z t b) (e : BoundedGhostEvent t b s) (he : boundedGhostEventWeight A D C ν t b s e ≠ 0) : e.2.1.card + e.1.val ≤ b := by by_contra hbad exact he (by simp [boundedGhostEventWeight, hbad]) theorem boundedGhostEventCapEmbed_target_of_ne_zero (A D C ν : Z → ℝ) (s : BoundedOrderedState P Z t b) (e : BoundedGhostEvent t b s) (he : boundedGhostEventWeight A D C ν t b s e ≠ 0) : boundedGhostEventTarget t B (boundedStateCapEmbed h s) (boundedGhostEventCapEmbed h s e) = boundedStateCapEmbed h (boundedGhostEventTarget t b s e) := by exact boundedGhostEventCapEmbed_target h s e (boundedGhostEventWeight_valid A D C ν s e he) theorem boundedGhostEventCapEmbed_weight (A D C ν : Z → ℝ) (s : BoundedOrderedState P Z t b) (e : BoundedGhostEvent t b s) : boundedGhostEventWeight A D C ν t b s e = if (boundedGhostEventTarget t B (boundedStateCapEmbed h s) (boundedGhostEventCapEmbed h s e)).2.1.val ≤ b then boundedGhostEventWeight A D C ν t B (boundedStateCapEmbed h s) (boundedGhostEventCapEmbed h s e) else 0 := by by_cases he : e.2.1.card + e.1.val ≤ b · have heB := he.trans h simp [boundedGhostEventWeight, boundedGhostEventTarget, retainedBirthTuple, boundedGhostEventCapEmbed, boundedStateCapEmbed, boundedMemoryCapEmbed, he, heB] rfl · by_cases heB : e.2.1.card + e.1.val ≤ B · simp [boundedGhostEventWeight, boundedGhostEventTarget, retainedBirthTuple, boundedGhostEventCapEmbed, boundedStateCapEmbed, boundedMemoryCapEmbed, he, heB] · simp only [boundedGhostEventWeight, boundedGhostEventCapEmbed, boundedStateCapEmbed, boundedMemoryCapEmbed, he, heB, ite_false, ite_self] theorem boundedGhostEventCapEmbed_surjective_of_ne_zero (A D C ν : Z → ℝ) (s : BoundedOrderedState P Z t b) (e : BoundedGhostEvent t B (boundedStateCapEmbed h s)) (hw : boundedGhostEventWeight A D C ν t B (boundedStateCapEmbed h s) e ≠ 0) (ht : (boundedGhostEventTarget t B (boundedStateCapEmbed h s) e).2.1.val ≤ b) : ∃ d : BoundedGhostEvent t b s, boundedGhostEventCapEmbed h s d = e := by have hv := boundedGhostEventWeight_valid A D C ν (boundedStateCapEmbed h s) e hw have ht' : e.2.1.card + e.1.val ≤ b := by unfold boundedGhostEventTarget at ht rw [dif_pos (show (retainedBirthTuple (boundedStateCapEmbed h s).2.2 e.2.1 e.2.2).1 ≤ B from hv)] at ht exact ht have hb : e.1.val < b + 1 := by omega exact ⟨⟨⟨e.1.val, hb⟩, e.2⟩, rfl⟩ theorem boundedGhostEventCapEmbed_support (A D C ν : Z → ℝ) (s : BoundedOrderedState P Z t b) (e : BoundedGhostEvent t b s) : boundedGhostEventWeight A D C ν t b s e ≠ 0 ↔ boundedGhostEventWeight A D C ν t B (boundedStateCapEmbed h s) (boundedGhostEventCapEmbed h s e) ≠ 0 ∧ (boundedGhostEventTarget t B (boundedStateCapEmbed h s) (boundedGhostEventCapEmbed h s e)).2.1.val ≤ b := by rw [boundedGhostEventCapEmbed_weight h A D C ν s e] split_ifs <;> simp_all theorem boundedGhostEventCapEmbed_weight_of_ne_zero (A D C ν : Z → ℝ) (s : BoundedOrderedState P Z t b) (e : BoundedGhostEvent t b s) (he : boundedGhostEventWeight A D C ν t b s e ≠ 0) : boundedGhostEventWeight A D C ν t B (boundedStateCapEmbed h s) (boundedGhostEventCapEmbed h s e) = boundedGhostEventWeight A D C ν t b s e := by have ht := ((boundedGhostEventCapEmbed_support h A D C ν s e).mp he).2 exact ((boundedGhostEventCapEmbed_weight h A D C ν s e).trans (if_pos ht)).symm end end Bounty end section /- Exact transport of bounded edge events between memory capacities. The choices do not depend on the cap. Targets commute on supported small events; invalid large targets are handled through their zero coefficient. -/ open Finset Classical namespace Bounty def unrestrictedBoundedEventCapEquiv {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t : ℕ) {b B : ℕ} (h : b ≤ B) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t b) : UnrestrictedBoundedEvent n Δ D t b s ≃ UnrestrictedBoundedEvent n Δ D t B (boundedStateCapEmbed h s) := Equiv.refl _ section variable {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t : ℕ) {b B : ℕ} (h : b ≤ B) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t b) (e : UnrestrictedBoundedEvent n Δ D t b s) include P n Δ D t b B h s e theorem unrestrictedBoundedEventCapEquiv_apply : unrestrictedBoundedEventCapEquiv n Δ D t h s e = e := rfl theorem unrestrictedBoundedEventTarget_cap_of_output_le (hout : (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) e.1 e.2.1 e.2.2.1).1 ≤ b) : boundedStateCapEmbed h (unrestrictedBoundedEventTarget n Δ D t b s e) = unrestrictedBoundedEventTarget n Δ D t B (boundedStateCapEmbed h s) (unrestrictedBoundedEventCapEquiv n Δ D t h s e) := by rw [unrestrictedBoundedEventCapEquiv_apply] dsimp only [unrestrictedBoundedEventTarget, boundedStateCapEmbed, boundedMemoryCapEmbed] rw [dif_pos hout, dif_pos (hout.trans h)] end section variable {P : Type*} (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t : ℕ) {b B : ℕ} (h : b ≤ B) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t b) (e : UnrestrictedBoundedEvent n Δ D t b s) include P n Δ D μ ρ V t b B h s e theorem unrestrictedBoundedEventTarget_cap_of_weight_ne_zero (hw : unrestrictedBoundedEventWeight n Δ D μ ρ V t b s e ≠ 0) : boundedStateCapEmbed h (unrestrictedBoundedEventTarget n Δ D t b s e) = unrestrictedBoundedEventTarget n Δ D t B (boundedStateCapEmbed h s) (unrestrictedBoundedEventCapEquiv n Δ D t h s e) := by apply unrestrictedBoundedEventTarget_cap_of_output_le n Δ D t h s e by_contra hout exact hw (by simp only [unrestrictedBoundedEventWeight, hout, and_false, if_false]) theorem unrestrictedBoundedEventWeight_cap : unrestrictedBoundedEventWeight n Δ D μ ρ V t b s e = if (unrestrictedBoundedEventTarget n Δ D t B (boundedStateCapEmbed h s) (unrestrictedBoundedEventCapEquiv n Δ D t h s e)).2.1.val ≤ b then unrestrictedBoundedEventWeight n Δ D μ ρ V t B (boundedStateCapEmbed h s) (unrestrictedBoundedEventCapEquiv n Δ D t h s e) else 0 := by simp only [unrestrictedBoundedEventCapEquiv_apply] dsimp only [unrestrictedBoundedEventWeight, unrestrictedBoundedEventTarget, boundedStateCapEmbed, boundedMemoryCapEmbed] by_cases hb : (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) e.1 e.2.1 e.2.2.1).1 ≤ b · have hB := hb.trans h simp only [hb, hB, and_true, dif_pos, if_pos] · by_cases hB : (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) e.1 e.2.1 e.2.2.1).1 ≤ B · simp only [hb, hB, and_false, and_true, dif_pos, if_false] · simp only [hb, hB, and_false, if_false, ite_self] end end Bounty end section /- Zero-weight events can be removed before transporting paths. This keeps arbitrary event-dependent phases while avoiding constraints on fallback targets. -/ open Finset Classical namespace Bounty universe uK uX uE abbrev FiniteNonzeroEvent {K : Type uK} {X : Type uX} (E : K → X → Type uE) (w : ∀ k x, E k x → ℝ) (k : K) (x : X) := {a : E k x // w k x a ≠ 0} def finiteNonzeroTarget {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (k : K) (x : X) (a : FiniteNonzeroEvent E w k x) : X := t k x a.val def finiteNonzeroPathForget {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) : ∀ ks x, FiniteEventPath (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) ks x → FiniteEventPath E t ks x | [], _, _ => PUnit.unit | _ :: ks, _, ⟨a, p⟩ => ⟨a.val, finiteNonzeroPathForget E t w ks _ p⟩ def finiteNonzeroPathLift {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) : ∀ ks x (p : FiniteEventPath E t ks x), finiteEventPathWeight E t w ks x p ≠ 0 → FiniteEventPath (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) ks x | [], _, _, _ => PUnit.unit | k :: ks, x, ⟨a, p⟩, h => ⟨⟨a, (mul_ne_zero_iff.mp h).1⟩, finiteNonzeroPathLift E t w ks (t k x a) p (mul_ne_zero_iff.mp h).2⟩ section variable {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (ks : List K) (x : X) include K X E t w ks x theorem finite_nonzero_path_forget_lift (p : FiniteEventPath E t ks x) (h : finiteEventPathWeight E t w ks x p ≠ 0) : finiteNonzeroPathForget E t w ks x (finiteNonzeroPathLift E t w ks x p h) = p := by induction ks generalizing x with | nil => cases p; rfl | cons k ks ih => rcases p with ⟨a, p⟩ change (⟨a, finiteNonzeroPathForget E t w ks _ (finiteNonzeroPathLift E t w ks _ p _)⟩ : FiniteEventPath E t (k :: ks) x) = ⟨a, p⟩ rw [ih] theorem finite_nonzero_path_weight (p : FiniteEventPath (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) ks x) : finiteEventPathWeight E t w ks x (finiteNonzeroPathForget E t w ks x p) = finiteEventPathWeight (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) (fun k x a => w k x a.val) ks x p := by induction ks generalizing x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ exact congrArg (w k x a.val * ·) (ih _ p) theorem finite_nonzero_path_weight_ne_zero (p : FiniteEventPath (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) ks x) : finiteEventPathWeight E t w ks x (finiteNonzeroPathForget E t w ks x p) ≠ 0 := by induction ks generalizing x with | nil => exact one_ne_zero | cons k ks ih => rcases p with ⟨a, p⟩ exact mul_ne_zero a.property (ih _ p) theorem finite_nonzero_path_terminal (p : FiniteEventPath (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) ks x) : finiteEventPathTerminal E t ks x (finiteNonzeroPathForget E t w ks x p) = finiteEventPathTerminal (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) ks x p := by induction ks generalizing x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ exact ih _ p theorem finite_nonzero_path_lift_forget (p : FiniteEventPath (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) ks x) : finiteNonzeroPathLift E t w ks x (finiteNonzeroPathForget E t w ks x p) (finite_nonzero_path_weight_ne_zero E t w ks x p) = p := by induction ks generalizing x with | nil => cases p; rfl | cons k ks ih => rcases p with ⟨a, p⟩ change (⟨a, finiteNonzeroPathLift E t w ks _ (finiteNonzeroPathForget E t w ks _ p) _⟩ : FiniteEventPath (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) (k :: ks) x) = ⟨a, p⟩ rw [ih] end def finiteNonzeroPathEquiv {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (ks : List K) (x : X) : FiniteEventPath (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) ks x ≃ {p : FiniteEventPath E t ks x // finiteEventPathWeight E t w ks x p ≠ 0} where toFun p := ⟨finiteNonzeroPathForget E t w ks x p, finite_nonzero_path_weight_ne_zero E t w ks x p⟩ invFun p := finiteNonzeroPathLift E t w ks x p.val p.property left_inv := finite_nonzero_path_lift_forget E t w ks x right_inv p := Subtype.ext (finite_nonzero_path_forget_lift E t w ks x p.val p.property) end Bounty end section /- Path transport needs event equivalences only on an invariant set of states. -/ open Finset Classical namespace Bounty universe uK uX uY uE uF def finiteInvariantPathEquiv {K : Type uK} {X : Type uX} {Y : Type uY} (E : K → X → Type uE) (F : K → Y → Type uF) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (e : X → Y) (P : X → Prop) (closed : ∀ k x, P x → ∀ a, P (t k x a)) (δ : ∀ k x, P x → E k x ≃ F k (e x)) (ht : ∀ k x (hx : P x) a, e (t k x a) = u k (e x) (δ k x hx a)) : ∀ ks x, P x → FiniteEventPath E t ks x ≃ FiniteEventPath F u ks (e x) | [], _, _ => Equiv.punitEquivPUnit | k :: ks, x, hx => Equiv.sigmaCongr (δ k x hx) (fun a => (finiteInvariantPathEquiv E F t u e P closed δ ht ks (t k x a) (closed k x hx a)).trans (Equiv.cast (congrArg (FiniteEventPath F u ks) (ht k x hx a)))) section variable {K : Type uK} {X : Type uX} {Y : Type uY} (E : K → X → Type uE) (F : K → Y → Type uF) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (e : X → Y) (P : X → Prop) (closed : ∀ k x, P x → ∀ a, P (t k x a)) (δ : ∀ k x, P x → E k x ≃ F k (e x)) (ht : ∀ k x (hx : P x) a, e (t k x a) = u k (e x) (δ k x hx a)) include K X Y E F t u e P closed δ ht theorem finite_invariant_path_equiv_terminal (ks : List K) (x : X) (hx : P x) (p : FiniteEventPath E t ks x) : finiteEventPathTerminal F u ks (e x) (finiteInvariantPathEquiv E F t u e P closed δ ht ks x hx p) = e (finiteEventPathTerminal E t ks x p) := by induction ks generalizing x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ change finiteEventPathTerminal F u ks _ (cast (congrArg (FiniteEventPath F u ks) (ht k x hx a)) (finiteInvariantPathEquiv E F t u e P closed δ ht ks (t k x a) (closed k x hx a) p)) = _ rw [finite_event_path_terminal_cast F u ks (ht k x hx a)] exact ih _ (closed k x hx a) p theorem finite_invariant_path_equiv_weight (w : ∀ k x, E k x → ℝ) (v : ∀ k y, F k y → ℝ) (hw : ∀ k x (hx : P x) a, v k (e x) (δ k x hx a) = w k x a) (ks : List K) (x : X) (hx : P x) (p : FiniteEventPath E t ks x) : finiteEventPathWeight F u v ks (e x) (finiteInvariantPathEquiv E F t u e P closed δ ht ks x hx p) = finiteEventPathWeight E t w ks x p := by induction ks generalizing x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ change v k (e x) (δ k x hx a) * finiteEventPathWeight F u v ks _ (cast (congrArg (FiniteEventPath F u ks) (ht k x hx a)) (finiteInvariantPathEquiv E F t u e P closed δ ht ks (t k x a) (closed k x hx a) p)) = _ rw [hw, finite_event_path_weight_cast F u v ks (ht k x hx a), ih] rfl end theorem finite_invariant_path_action_equiv {K : Type uK} {X : Type uX} {Y : Type uY} (E : K → X → Type uE) (F : K → Y → Type uF) [∀ k x, Fintype (E k x)] [∀ k y, Fintype (F k y)] (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (e : X → Y) (P : X → Prop) (closed : ∀ k x, P x → ∀ a, P (t k x a)) (δ : ∀ k x, P x → E k x ≃ F k (e x)) (ht : ∀ k x (hx : P x) a, e (t k x a) = u k (e x) (δ k x hx a)) (w : ∀ k x, E k x → ℝ) (v : ∀ k y, F k y → ℝ) (hw : ∀ k x (hx : P x) a, v k (e x) (δ k x hx a) = w k x a) (ks : List K) (phase : ∀ y, FiniteEventPath F u ks y → ℂ) (f : Y → ℂ) (x : X) (hx : P x) : finiteEventPathAction E t w ks (fun x p => if hx : P x then phase (e x) (finiteInvariantPathEquiv E F t u e P closed δ ht ks x hx p) else 0) (fun x => f (e x)) x = finiteEventPathAction F u v ks phase f (e x) := by let _ := finiteEventPathFintype E t ks x let _ := finiteEventPathFintype F u ks (e x) have h := Equiv.sum_comp (finiteInvariantPathEquiv E F t u e P closed δ ht ks x hx) (fun p => (finiteEventPathWeight F u v ks (e x) p : ℂ) * phase (e x) p * f (finiteEventPathTerminal F u ks (e x) p)) simpa only [finiteEventPathAction, dif_pos hx, finite_invariant_path_equiv_weight E F t u e P closed δ ht w v hw, finite_invariant_path_equiv_terminal E F t u e P closed δ ht] using h end Bounty end section /- Exact selection of event paths by an arbitrary predicate on each event. -/ open Finset Classical namespace Bounty universe uK uX uE abbrev FiniteSelectedEvent {K : Type uK} {X : Type uX} (E : K → X → Type uE) (Q : ∀ k x, E k x → Prop) (k : K) (x : X) := {a : E k x // Q k x a} def finiteSelectedTarget {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (Q : ∀ k x, E k x → Prop) (k : K) (x : X) (a : FiniteSelectedEvent E Q k x) : X := t k x a.val def FiniteEventPathSelected {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (Q : ∀ k x, E k x → Prop) : ∀ ks x, FiniteEventPath E t ks x → Prop | [], _, _ => True | k :: ks, x, ⟨a, p⟩ => Q k x a ∧ FiniteEventPathSelected E t Q ks (t k x a) p def finiteSelectedPathForget {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (Q : ∀ k x, E k x → Prop) : ∀ ks x, FiniteEventPath (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x → FiniteEventPath E t ks x | [], _, _ => PUnit.unit | _ :: ks, _, ⟨a, p⟩ => ⟨a.val, finiteSelectedPathForget E t Q ks _ p⟩ def finiteSelectedPathLift {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (Q : ∀ k x, E k x → Prop) : ∀ ks x (p : FiniteEventPath E t ks x), FiniteEventPathSelected E t Q ks x p → FiniteEventPath (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x | [], _, _, _ => PUnit.unit | k :: ks, x, ⟨a, p⟩, h => ⟨⟨a, h.1⟩, finiteSelectedPathLift E t Q ks (t k x a) p h.2⟩ section variable {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (Q : ∀ k x, E k x → Prop) include K X E t Q theorem finite_selected_path_forget_lift (ks : List K) (x : X) (p : FiniteEventPath E t ks x) (h : FiniteEventPathSelected E t Q ks x p) : finiteSelectedPathForget E t Q ks x (finiteSelectedPathLift E t Q ks x p h) = p := by induction ks generalizing x with | nil => cases p; rfl | cons k ks ih => rcases p with ⟨a, p⟩ change (⟨a, finiteSelectedPathForget E t Q ks _ (finiteSelectedPathLift E t Q ks _ p _)⟩ : FiniteEventPath E t (k :: ks) x) = ⟨a, p⟩ rw [ih] theorem finite_selected_path_weight (w : ∀ k x, E k x → ℝ) (ks : List K) (x : X) (p : FiniteEventPath (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x) : finiteEventPathWeight E t w ks x (finiteSelectedPathForget E t Q ks x p) = finiteEventPathWeight (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) (fun k x a => w k x a.val) ks x p := by induction ks generalizing x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ exact congrArg (w k x a.val * ·) (ih _ p) theorem finite_selected_path_selected (ks : List K) (x : X) (p : FiniteEventPath (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x) : FiniteEventPathSelected E t Q ks x (finiteSelectedPathForget E t Q ks x p) := by induction ks generalizing x with | nil => trivial | cons k ks ih => rcases p with ⟨a, p⟩ exact ⟨a.property, ih _ p⟩ theorem finite_selected_path_terminal (ks : List K) (x : X) (p : FiniteEventPath (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x) : finiteEventPathTerminal E t ks x (finiteSelectedPathForget E t Q ks x p) = finiteEventPathTerminal (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x p := by induction ks generalizing x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ exact ih _ p theorem finite_selected_path_lift_forget (ks : List K) (x : X) (p : FiniteEventPath (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x) : finiteSelectedPathLift E t Q ks x (finiteSelectedPathForget E t Q ks x p) (finite_selected_path_selected E t Q ks x p) = p := by induction ks generalizing x with | nil => cases p; rfl | cons k ks ih => rcases p with ⟨a, p⟩ change (⟨a, finiteSelectedPathLift E t Q ks _ (finiteSelectedPathForget E t Q ks _ p) _⟩ : FiniteEventPath (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) (k :: ks) x) = ⟨a, p⟩ rw [ih] end def finiteSelectedPathEquiv {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (Q : ∀ k x, E k x → Prop) (ks : List K) (x : X) : FiniteEventPath (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x ≃ {p : FiniteEventPath E t ks x // FiniteEventPathSelected E t Q ks x p} where toFun p := ⟨finiteSelectedPathForget E t Q ks x p, finite_selected_path_selected E t Q ks x p⟩ invFun p := finiteSelectedPathLift E t Q ks x p.val p.property left_inv := finite_selected_path_lift_forget E t Q ks x right_inv p := Subtype.ext (finite_selected_path_forget_lift E t Q ks x p.val p.property) end Bounty end section /- Increasing the per-group memory cap embeds the old finite measure without changing any mass. Pullback decreases energy, and extension by zero outside the image preserves it exactly. -/ open Finset Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {M : G → ℕ} {b B : ℕ} (h : b ≤ B) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) end end Bounty end section /- Exact prime convolution of the candidate coefficient with its normalized Q-zero remainder. -/ open Finset Filter namespace Bounty theorem candidate_Q_zero_prime_outside_pool {c L : ℝ} (hcL : 0 ≤ c * L) {p : ℕ} (hp : p ∈ candidateQBand (c * L) 0) : p.Prime ∧ p ∉ (candidatePIndices c L).biUnion (candidatePBand (c * L)) := by refine ⟨((mem_dyadicPrimeBand_iff (c * L) 1 (6/5) 0 p).mp hp).1, ?_⟩ intro hP obtain ⟨j, _, hpj⟩ := mem_biUnion.mp hP exact disjoint_left.mp (disjoint_candidatePBand_candidateQBand hcL j 0) hpj hp theorem candidate_marked_weight_div_Q_zero {c L : ℝ} (hcL : 0 ≤ c * L) (q : ℝ) {p u : ℕ} (hp : p ∈ candidateQBand (c * L) 0) (hpu : p ∣ u) : markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ a ∈ candidatePBand (c * L) j, 1 / (a : ℝ)) (fun _ => 1) ((u / p : ℕ) : ℤ) = markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ a ∈ candidatePBand (c * L) j, 1 / (a : ℝ)) (fun _ => 1) (u : ℤ) := by obtain ⟨hpp, hpP⟩ := candidate_Q_zero_prime_outside_pool hcL hp have hfree : Disjoint p.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c * L))) := by simpa only [hpp.primeFactors, disjoint_singleton_left] using hpP have h := candidate_marked_weight_mul_of_free c L q hpp.ne_zero hfree (u / p) rw [Nat.div_mul_cancel hpu] at h exact h.symm theorem candidate_coefficient_remainder_convolution {c L : ℝ} (hcL : 0 ≤ c * L) (q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) {u : ℕ} (hu : u ≠ 0) : candidateCoefficient c L q r jStar u = ∑ p ∈ (candidateQBand (c * L) 0).filter (fun p => p ∣ u), candidateRemainderCoefficient c L q r jStar hr (u / p) := by classical unfold candidateCoefficient rw [candidate_Q_weight_rest_divisor_split c L r jStar hr hj, sum_mul, sum_filter] apply sum_congr rfl intro p hp obtain ⟨hpp, hpP⟩ := candidate_Q_zero_prime_outside_pool hcL hp have hdiv := @prime_dvd_primePoolFreePart_iff ((candidatePIndices c L).biUnion (candidatePBand (c * L))) p u hpp hpP by_cases hpu : p ∣ u · rw [if_pos (hdiv.mpr hpu), if_pos hpu] unfold candidateRemainderCoefficient rw [primePoolFreePart_div_prime_of_not_mem hpp hpP hu hpu, candidate_marked_weight_div_Q_zero hcL q hp hpu] · rw [if_neg (fun h => hpu (hdiv.mp h)), if_neg hpu, zero_mul] theorem candidate_Q_rest_weight_zero_at_zero (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) : candidateQRestWeight c L r jStar hr 0 = 0 := by classical unfold candidateQRestWeight orderedSlotWeight apply sum_eq_zero intro x _ apply if_neg change (∏ slot, (x slot).val) ≠ 0 apply prod_ne_zero_iff.mpr intro slot _ exact candidate_Q_slot_nonzero c L r jStar slot.val (x slot).property theorem candidate_remainder_coefficient_zero_at_zero (c L q : ℝ) (r jStar : ℕ) (hr : 0 < r) : candidateRemainderCoefficient c L q r jStar hr 0 = 0 := by unfold candidateRemainderCoefficient primePoolFreePart rw [Nat.zero_div, candidate_Q_rest_weight_zero_at_zero, zero_mul] theorem candidate_coefficient_remainder_convolution_all {c L : ℝ} (hcL : 0 ≤ c * L) (q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) (u : ℕ) : candidateCoefficient c L q r jStar u = ∑ p ∈ (candidateQBand (c * L) 0).filter (fun p => p ∣ u), candidateRemainderCoefficient c L q r jStar hr (u / p) := by by_cases hu : u = 0 · subst u have hz : candidateCoefficient c L q r jStar 0 = 0 := by unfold candidateCoefficient primePoolFreePart rw [Nat.zero_div, candidate_Q_weight_zero_at_zero, zero_mul] rw [hz] symm exact sum_eq_zero (fun p _ => by rw [Nat.zero_div, candidate_remainder_coefficient_zero_at_zero]) · exact candidate_coefficient_remainder_convolution hcL q r jStar hr hj hu end Bounty end section /- Fixed distribution levels below one half absorb subexponential coefficient losses. -/ open Filter namespace Bounty section variable {a eta theta K C : ℝ} (ha : 0 < a) (heta : 0 < eta) (htheta : theta < 1 / 2) (hK : 0 ≤ K) (hC : 0 ≤ C) (D B : ℝ) include a eta theta K C ha heta htheta hK hC D B theorem eventually_large_sieve_profile_decay : ∀ᶠ L : ℝ in atTop, (L ^ D * Real.exp (K * Real.sqrt L)) * (C * Real.exp ((1 - eta) * L) + 2 * C * Real.exp ((1 - a / 2) * L) + Real.sqrt C * Real.exp ((theta + 1 / 2) * L)) ≤ Real.exp L * L ^ (-B) := by have h1 := eventually_exp_neg_rpow_mul_rpow_mul_exp_sqrt_le (by norm_num : (1/2 : ℝ) < 1) heta hK D (B + 1) have h2 := eventually_exp_neg_rpow_mul_rpow_mul_exp_sqrt_le (by norm_num : (1/2 : ℝ) < 1) (half_pos ha) hK D (B + 1) have h3 := eventually_exp_neg_rpow_mul_rpow_mul_exp_sqrt_le (by norm_num : (1/2 : ℝ) < 1) (sub_pos.mpr htheta) hK D (B + 1) filter_upwards [h1, h2, h3, eventually_ge_atTop (3 * C + Real.sqrt C), eventually_gt_atTop (0 : ℝ)] with L h1 h2 h3 hCL hL simp only [Real.rpow_one] at h1 h2 h3 have he (d : ℝ) : Real.exp ((1 - d) * L) = Real.exp L * Real.exp (-d * L) := by rw [← Real.exp_add] congr 1 ring have hsum := add_le_add (add_le_add (mul_le_mul_of_nonneg_left h1 hC) (mul_le_mul_of_nonneg_left h2 (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) hC))) (mul_le_mul_of_nonneg_left h3 (Real.sqrt_nonneg C)) have hcoeff : (3 * C + Real.sqrt C) * L ^ (-(B + 1)) ≤ L ^ (-B) := by calc _ ≤ L * L ^ (-(B + 1)) := mul_le_mul_of_nonneg_right hCL (Real.rpow_nonneg hL.le _) _ = _ := by nth_rw 1 [← Real.rpow_one L] rw [← Real.rpow_add hL] congr 1 ring calc _ = Real.exp L * (C * ((Real.exp (-eta * L) * L ^ D) * Real.exp (K * Real.sqrt L)) + (2 * C) * ((Real.exp (-(a / 2) * L) * L ^ D) * Real.exp (K * Real.sqrt L)) + Real.sqrt C * ((Real.exp (-(1 / 2 - theta) * L) * L ^ D) * Real.exp (K * Real.sqrt L))) := by rw [he eta, he (a / 2), show theta + 1 / 2 = 1 - (1 / 2 - theta) by ring, he (1 / 2 - theta)] ring _ ≤ Real.exp L * ((3 * C + Real.sqrt C) * L ^ (-(B + 1))) := by apply mul_le_mul_of_nonneg_left _ (Real.exp_nonneg L) convert hsum using 1; ring _ ≤ _ := mul_le_mul_of_nonneg_left hcoeff (Real.exp_nonneg L) theorem eventually_large_sieve_subexponential_energy_bound : ∀ᶠ L : ℝ in atTop, ∀ P U R E F : ℝ, Real.exp (a * L) ≤ P → Real.exp (a * L) ≤ U → P * U ≤ C * Real.exp L → Real.exp (eta * L) ≤ R → R ≤ Real.exp (theta * L) → 0 ≤ F → E ≤ P * Real.exp (K * Real.sqrt L) → F ≤ U * Real.exp (K * Real.sqrt L) → (L ^ D / R) * Real.sqrt ((P + R ^ 2) * (U + R ^ 2) * E * F) ≤ Real.exp L * L ^ (-B) := by filter_upwards [eventually_large_sieve_profile_decay ha heta htheta hK hC D B, eventually_gt_atTop (0 : ℝ)] with L hdecay hL intro P U R E F hP hU hPU hRlo hRhi hF hEP hFU have hP0 : 0 ≤ P := (Real.exp_pos _).le.trans hP have hU0 : 0 ≤ U := (Real.exp_pos _).le.trans hU have hR0 : 0 < R := (Real.exp_pos _).trans_le hRlo calc _ ≤ (L ^ D / R) * (Real.exp (K * Real.sqrt L) * Real.sqrt ((P + R ^ 2) * (U + R ^ 2) * P * U)) := mul_le_mul_of_nonneg_left (large_sieve_energy_factor hP0 hU0 hF (Real.exp_nonneg _) hEP hFU) (div_nonneg (Real.rpow_nonneg hL.le _) hR0.le) _ = (L ^ D * Real.exp (K * Real.sqrt L)) * (Real.sqrt ((P + R ^ 2) * (U + R ^ 2) * P * U) / R) := by ring _ ≤ (L ^ D * Real.exp (K * Real.sqrt L)) * (C * Real.exp ((1 - eta) * L) + 2 * C * Real.exp ((1 - a / 2) * L) + Real.sqrt C * Real.exp ((theta + 1 / 2) * L)) := mul_le_mul_of_nonneg_left (large_sieve_exponential_ranges hC hP hU hPU hRlo hRhi) (by positivity) _ ≤ _ := hdecay end end Bounty end section /- A finite dyadic prefix covers each positive support with logarithmic cost. -/ open Finset Filter namespace Bounty theorem finite_nat_dyadic_prefix {U : ℝ} (hU : 1 ≤ U) (T : Finset ℕ) (hT : ∀ n ∈ T, (n : ℝ) ≤ U) : T ⊆ range (2 ^ (⌊U⌋₊.log2 + 1)) ∧ ∀ n ∈ range (2 ^ (⌊U⌋₊.log2 + 1)), (n : ℝ) ≤ 2*U := by have hfloor : 0 < ⌊U⌋₊ := Nat.floor_pos.mpr hU obtain ⟨hlower, hupper⟩ := (Nat.log2_eq_iff hfloor.ne').mp (rfl : ⌊U⌋₊.log2 = ⌊U⌋₊.log2) have hpow : 2 ^ (⌊U⌋₊.log2 + 1) ≤ 2*⌊U⌋₊ := by rw [pow_succ] omega constructor · intro n hn apply mem_range.mpr exact (Nat.le_floor (hT n hn)).trans_lt hupper · intro n hn have hnle : n ≤ 2*⌊U⌋₊ := (mem_range.mp hn).le.trans hpow have hcast : (n : ℝ) ≤ 2*(⌊U⌋₊ : ℝ) := by exact_mod_cast hnle exact hcast.trans (mul_le_mul_of_nonneg_left (Nat.floor_le (zero_le_one.trans hU)) (by norm_num)) theorem eventually_window_dyadic_prefix_cost : ∀ᶠ L : ℝ in atTop, ∀ U : ℝ, 1 ≤ U → U ≤ 32*Real.exp L → (⌊U⌋₊.log2 + 1 + 1 : ℝ) ≤ L^2 := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (Real.log 32), eventually_ge_atTop (2/Real.log 2 + 2)] with L hL h32 hcost intro U hU hUL have hfloor : 0 < (⌊U⌋₊ : ℝ) := by exact_mod_cast (Nat.floor_pos.mpr hU) have hfl : (⌊U⌋₊ : ℝ) ≤ 32*Real.exp L := (Nat.floor_le (zero_le_one.trans hU)).trans hUL have hlog : Real.log (⌊U⌋₊ : ℝ) ≤ 2*L := by have h := Real.log_le_log hfloor hfl rw [Real.log_mul (by norm_num : (32 : ℝ) ≠ 0) (Real.exp_ne_zero L), Real.log_exp] at h linarith have htwo : 0 < Real.log 2 := Real.log_pos (by norm_num) calc _ ≤ Real.log (⌊U⌋₊ : ℝ)/Real.log 2 + 2 := by have h := dyadic_log_count_le_log ⌊U⌋₊ linarith _ ≤ 2*L/Real.log 2 + 2 := by exact add_le_add (div_le_div_of_nonneg_right hlog htwo.le) le_rfl _ ≤ 2*L/Real.log 2 + 2*L := by linarith _ = (2/Real.log 2 + 2)*L := by ring _ ≤ L^2 := by nlinarith theorem window_dyadic_prefactor_le {L R : ℝ} (K : ℕ) (hR : 0 < R) (hK : (K + 1 : ℝ) ≤ L^2) (hL : 4*(6 + 8*Real.pi) ≤ L) : 2*(K + 1 : ℝ)*((6 + 8*Real.pi)/(R/2)) ≤ L^3/R := by have hpi : 0 ≤ 4*(6 + 8*Real.pi) := by positivity calc _ = (4*(6 + 8*Real.pi)*(K + 1 : ℝ))/R := by ring _ ≤ (4*(6 + 8*Real.pi)*L^2)/R := by exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hK hpi) hR.le _ ≤ (L*L^2)/R := by exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hL (sq_nonneg L)) hR.le _ = _ := by ring end Bounty end section /- Original physical permutation and auxiliary choices remain observable inside the full event model, including changes of slot coordinates. -/ namespace Bounty abbrev PhysicalMarkObservation {K : Type*} {N J : ℕ} (P : Fin N → Finset ℕ) (ell : ℕ) (C : K → Fin N → Finset (Fin J)) := PhysicalPermutations (Fin N) J ell ⊕ Option (Σ j : K, PhysicalAuxLabels P (C j)) noncomputable def physicalFullEventObservation {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (before after : Fin N → Finset (Fin J)) : (tag : Option (I ⊕ K)) → (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) → FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) tag s.2 → PhysicalMarkObservation P ell C | none, _, e => .inl ((physicalTransitionPermutationEquiv before after).symm e.down) | some (.inl _), _, _ => .inr none | some (.inr j), _, e => .inr (some ⟨j, e.1⟩) end Bounty end section /- Recorded rows with local complex phases are original event paths with one whole-path phase. Terminal conditions may inspect the complete record. -/ namespace Bounty section Recorded variable {K X O : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (phase : ∀ k x, E k x → ℂ) (observe : ∀ k x, E k x → O) noncomputable def finiteRecordedPathPhase (ks : List K) (initial : X → List O) (F : List O → X → ℂ) (x : X) (p : FiniteEventPath E target ks x) : ℂ := finiteEventLocalPhase (fun k (s : List O × X) => E k s.2) (finiteLedgerEventTarget E target (finiteObservationLedgerUpdate E observe)) (fun k s => phase k s.2) ks (initial x, x) ((finiteLedgerEventPathEquiv E target (finiteObservationLedgerUpdate E observe) ks (initial x) x).symm p) * F (initial x ++ finiteEventPathObservations E target observe ks x p) (finiteEventPathTerminal E target ks x p) variable [∀ k x, Fintype (E k x)] (weight : ∀ k x, E k x → ℝ) end Recorded end Bounty end section /- Auxiliary-dependent raw continuations retain the original auxiliary choice when physical rows are lifted to full edge events. -/ open Finset open scoped Classical namespace Bounty section Full variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L R : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) theorem physical_full_edge_auxiliary_observed_rows (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ω : ∀ _c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (F : PhysicalAuxLabels P C → GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) : let S := fun g => physicalFullSharedIndices (ell := ell) (C g) let x := physicalFullMemoryState C L q let c := (productActiveMemorySplit S B x).1 (∑ aux : PhysicalAuxLabels P C, (ω c aux : ℂ) * if physicalListAdmissible C aux L R then jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) C k L R β ρ V aux) (F aux) (fun g => (H g, boundedOrderedTupleToFinite (q g))) else 0) = ∑ e : PhysicalFullEdgeEvent C k x, (fullActiveEdgeEventWeight (fun g (p : ↥(P g)) => p.val) S B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω (fun g p => β g p / V g) ρ V x e : ℂ) * physicalFullEdgePhase C k L R H q e * F e.1 (fullEdgeLedgerRawTarget (fun g (p : ↥(P g)) => p.val) S B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) H x e) := by exact full_edge_ledger_observed_rows (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) (fun g => ((productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C R q)).2 g).1) H (physicalFullMemoryState C L q) β ρ V ω (fun aux => physicalListAdmissible C aux L R) (physicalFullEdgeRawRow (B := B) C k L R β ρ V) (fun aux ha g K => physical_full_edge_local_row C k L R β ρ V aux ha hP hdis H q g K) F end Full end Bounty end section /- The empty-memory boundary vector is unchanged by increasing the cap. All larger-cap vacuum states already occur in the smaller-cap image, so weighted vacuum pairings agree exactly for arbitrary signed weights. -/ open Finset Classical namespace Bounty section variable {G : Type*} {P Z : G → Type*} {M : G → ℕ} {b B : ℕ} (h : b ≤ B) end end Bounty end section /- Dyadic conductor ranges above an exponential cutoff. -/ open Finset Filter namespace Bounty theorem dyadicConductorRange_scale_bounds (c L : ℝ) (N h k : ℕ) (hk : k ∈ dyadicNatIndices (Icc (max 2 (⌊Real.exp (c * L / 512)⌋₊ + 1)) (N / h))) : Real.exp (c * L / 512) < (2 : ℝ) ^ (k + 1) ∧ (2 : ℝ) ^ (k + 1) ≤ 2 * (N : ℝ) ∧ 1 ≤ (2 : ℝ) ^ (k + 1) := by obtain ⟨f, hf⟩ := (dyadicNatBucket_nonempty_iff _ k).mpr hk have hfmem := (mem_dyadicNatBucket _ k f).mp hf have hfI := mem_Icc.mp hfmem.1 have hf2 : 2 ≤ f := (le_max_left _ _).trans hfI.1 have hfloor : ⌊Real.exp (c * L / 512)⌋₊ < f := by have := (le_max_right _ _).trans hfI.1 omega have hexpf : Real.exp (c * L / 512) < (f : ℝ) := (Nat.floor_lt (Real.exp_pos _).le).mp hfloor have hsc := dyadicNatBucket_upper_scale_real _ (fun n hn => by have := (le_max_left _ _).trans (mem_Icc.mp hn).1; omega) hf have hfN : f ≤ N := hfI.2.trans (Nat.div_le_self _ _) have hfNreal : (f : ℝ) ≤ N := by exact_mod_cast hfN have hf2real : (2 : ℝ) ≤ f := by exact_mod_cast hf2 exact ⟨hexpf.trans_le hsc.1, hsc.2.trans (by linarith), by linarith [hsc.1]⟩ theorem eventually_two_mul_exp_le_exp {a b : ℝ} (hab : a < b) : ∀ᶠ L : ℝ in atTop, 2 * Real.exp (a * L) ≤ Real.exp (b * L) := by filter_upwards [eventually_ge_atTop (Real.log 2 / (b - a))] with L hL have hlog : Real.log 2 ≤ L * (b - a) := (div_le_iff₀ (sub_pos.mpr hab)).mp hL calc 2 * Real.exp (a * L) = Real.exp (Real.log 2 + a * L) := by rw [Real.exp_add, Real.exp_log (by norm_num : (0 : ℝ) < 2)] _ ≤ Real.exp (b * L) := Real.exp_le_exp.mpr (by nlinarith) theorem eventually_dyadicConductorRange_scale_bounds (c : ℝ) {θ : ℝ} (hθ : θ < 1 / 2) : ∀ᶠ L : ℝ in atTop, ∀ (N h k : ℕ), (N : ℝ) ≤ Real.exp (θ * L) → k ∈ dyadicNatIndices (Icc (max 2 (⌊Real.exp (c * L / 512)⌋₊ + 1)) (N / h)) → Real.exp (c * L / 512) ≤ (2 : ℝ) ^ (k + 1) ∧ (2 : ℝ) ^ (k + 1) ≤ Real.exp (((θ + 1 / 2) / 2) * L) ∧ 1 ≤ (2 : ℝ) ^ (k + 1) := by have hmid : θ < (θ + 1 / 2) / 2 := by linarith filter_upwards [eventually_two_mul_exp_le_exp hmid] with L hL intro N h k hN hk obtain ⟨hlow, hupp, hone⟩ := dyadicConductorRange_scale_bounds c L N h k hk exact ⟨hlow.le, hupp.trans ((mul_le_mul_of_nonneg_left hN (by norm_num)).trans hL), hone⟩ theorem eventually_dyadicConductorRange_card_le_linear (c : ℝ) {θ : ℝ} (hθ : θ < 1 / 2) : ∀ᶠ L : ℝ in atTop, ∀ (N h : ℕ), (N : ℝ) ≤ Real.exp (θ * L) → ((dyadicNatIndices (Icc (max 2 (⌊Real.exp (c * L / 512)⌋₊ + 1)) (N / h))).card : ℝ) ≤ (2 / Real.log 2 + 1) * L := by filter_upwards [eventually_dyadicNatIndices_card_le_linear, eventually_ge_atTop (0 : ℝ)] with L hcount hL intro N h hN apply hcount N · calc (N : ℝ) ≤ Real.exp (θ * L) := hN _ ≤ Real.exp L := Real.exp_le_exp.mpr (by nlinarith) _ ≤ 16 * Real.exp L := by nlinarith [Real.exp_pos L] · intro n hn exact (mem_Icc.mp hn).2.trans (Nat.div_le_self _ _) theorem three_dyadic_counts_totient_factor_le_pow_five {L x y z : ℝ} (hL : 1 ≤ L) (hlog : Real.log 2 ≤ L) (hlarge : 4 * primeEulerProductUpperConstant * (2 / Real.log 2 + 1) ^ 3 ≤ L) (hx0 : 0 ≤ x) (hy0 : 0 ≤ y) (hz0 : 0 ≤ z) (hx : x ≤ (2 / Real.log 2 + 1) * L) (hy : y ≤ (2 / Real.log 2 + 1) * L) (hz : z ≤ (2 / Real.log 2 + 1) * L) : (2 * primeEulerProductUpperConstant * Real.log (2 * Real.exp L)) * x * y * z ≤ L ^ 5 := by have hL0 : 0 ≤ L := by linarith have hC := primeEulerProductUpperConstant_pos have htwo : 0 < Real.log 2 := Real.log_pos (by norm_num) have hxyz : x * y * z ≤ ((2 / Real.log 2 + 1) * L) * ((2 / Real.log 2 + 1) * L) * ((2 / Real.log 2 + 1) * L) := by gcongr have hfactor : 2 * primeEulerProductUpperConstant * Real.log (2 * Real.exp L) ≤ 4 * primeEulerProductUpperConstant * L := by rw [Real.log_mul (by norm_num) (Real.exp_pos L).ne', Real.log_exp] nlinarith calc _ = (2 * primeEulerProductUpperConstant * Real.log (2 * Real.exp L)) * (x * y * z) := by ring _ ≤ (4 * primeEulerProductUpperConstant * L) * (((2 / Real.log 2 + 1) * L) * ((2 / Real.log 2 + 1) * L) * ((2 / Real.log 2 + 1) * L)) := mul_le_mul hfactor hxyz (mul_nonneg (mul_nonneg hx0 hy0) hz0) (by positivity) _ = (4 * primeEulerProductUpperConstant * (2 / Real.log 2 + 1) ^ 3) * L ^ 4 := by ring _ ≤ L * L ^ 4 := mul_le_mul_of_nonneg_right hlarge (pow_nonneg hL0 _) _ = L ^ 5 := by ring theorem eventually_three_dyadic_counts_totient_factor_le_pow_five : ∀ᶠ L : ℝ in atTop, 0 < L ∧ ∀ x y z : ℝ, 0 ≤ x → 0 ≤ y → 0 ≤ z → x ≤ (2 / Real.log 2 + 1) * L → y ≤ (2 / Real.log 2 + 1) * L → z ≤ (2 / Real.log 2 + 1) * L → (2 * primeEulerProductUpperConstant * Real.log (2 * Real.exp L)) * x * y * z ≤ L ^ 5 := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (Real.log 2), eventually_ge_atTop (4 * primeEulerProductUpperConstant * (2 / Real.log 2 + 1) ^ 3)] with L hL hlog hlarge exact ⟨by linarith, fun _ _ _ hx0 hy0 hz0 hx hy hz => three_dyadic_counts_totient_factor_le_pow_five hL hlog hlarge hx0 hy0 hz0 hx hy hz⟩ end Bounty end section /- A power saving for the triangular Mangoldt sum from the zero-free input. -/ namespace Bounty open OAI.Ostmann Complex Set /- The finite contour argument gives a uniform smoothed estimate, with only logarithmic dependence on the conductor. It assumes only the zero-free input. -/ theorem character_riesz_bound_right_of (b σ : ℝ) (hb : 7 / 8 ≤ b) (hbσ : b < σ) (hσ1 : σ < 1) (hZ : PrimitiveZeroFreeRightOf b) : ∃ D : ℝ, 0 < D ∧ ∀ (χ : PrimitiveComplexCharacter) (x : ℝ), 2 ≤ x → ‖characterRieszMean χ x‖ ≤ D * x ^ σ * (1 + Real.log (24 * (χ.modulus : ℝ) * (x ^ 2 + 2))) := by obtain ⟨K, C, hK, hC, hrect⟩ := characterRieszMean_rectangle_bound refine ⟨(K + 5 + 2 * C) * (36 / (σ - b) ^ 2), by positivity, ?_⟩ intro χ x hx let L : ℝ := 1 + Real.log (24 * (χ.modulus : ℝ) * (x ^ 2 + 2)) let M : ℝ := (36 / (σ - b) ^ 2) * L have hx0 : 0 < x := by linarith have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive have hq0 : (0 : ℝ) < χ.modulus := by linarith have hx2 : 1 ≤ x ^ 2 := by nlinarith have hL : 1 ≤ L := by have hh : 1 ≤ 24 * (χ.modulus : ℝ) * (x ^ 2 + 2) := by nlinarith have hl := Real.log_nonneg hh dsimp [L] linarith have hmargin : 0 < σ - b := sub_pos.mpr hbσ have hmargin1 : σ - b ≤ 1 := by linarith have hfactor : 1 ≤ 36 / (σ - b) ^ 2 := by apply (le_div_iff₀ (sq_pos_of_pos hmargin)).mpr nlinarith have hM : 1 ≤ M := by dsimp [M]; nlinarith have hzre (z : ℂ) (hz : z ∈ uIcc σ 2 ×ℂ uIcc (-x ^ 2) (x ^ 2)) : σ ≤ z.re ∧ z.re ≤ 2 ∧ |z.im| ≤ x ^ 2 := by have hz' : z.re ∈ Icc σ 2 ∧ z.im ∈ Icc (-x ^ 2) (x ^ 2) := by simpa only [mem_reProdIm, uIcc_of_le (by linarith : σ ≤ 2), uIcc_of_le (by nlinarith : -x ^ 2 ≤ x ^ 2)] using hz exact ⟨hz'.1.1, hz'.1.2, abs_le.mpr hz'.2⟩ have hne : ∀ z ∈ uIcc σ 2 ×ℂ uIcc (-x ^ 2) (x ^ 2), χ.L z ≠ 0 := by intro z hz apply hZ χ z linarith [(hzre z hz).1] have hbound : ∀ z ∈ uIcc σ 2 ×ℂ uIcc (-x ^ 2) (x ^ 2), ‖logDeriv χ.L z‖ ≤ M := by intro z hz obtain ⟨hzlo, hzhi, hzim⟩ := hzre z hz have hh := character_logDeriv_bound_right_of b hb (by linarith) hZ χ (ε := σ - b) hmargin hmargin1 z (by linarith) hzhi have hl : Real.log (24 * (χ.modulus : ℝ) * (|z.im| + 2)) ≤ L := by have hhlog : Real.log (24 * (χ.modulus : ℝ) * (|z.im| + 2)) ≤ Real.log (24 * (χ.modulus : ℝ) * (x ^ 2 + 2)) := by apply Real.log_le_log (by positivity) gcongr dsimp [L] linarith dsimp [M] exact hh.trans (mul_le_mul_of_nonneg_left hl (by positivity)) have hraw := hrect χ x σ 2 (x ^ 2) M (by linarith) (by linarith) (by linarith) (by norm_num) le_rfl (by positivity) (by linarith) hne hbound rw [Real.rpow_two] at hraw have hx24 : x ^ 2 ≤ (x ^ 2) ^ 2 := by nlinarith [sq_nonneg (x ^ 2 - 1)] have hquot : M * x ^ 2 / (x ^ 2) ^ 2 ≤ M := by apply (div_le_iff₀ (by positivity : 0 < (x ^ 2) ^ 2)).mpr exact mul_le_mul_of_nonneg_left hx24 (by linarith) have hquot0 : 0 ≤ M * x ^ 2 / (x ^ 2) ^ 2 := by positivity have herr : 2 * (M * x ^ 2 / (x ^ 2) ^ 2) * (2 - σ) ≤ 3 * M := by nlinarith have htail : 2 * (1 / (2 - 1) + C) * x ^ 2 / x ^ 2 = 2 * (1 + C) := by field_simp ring rw [htail] at hraw have hp : 1 ≤ x ^ σ := Real.one_le_rpow (by linarith) (by linarith) have hscale : M ≤ M * x ^ σ := by nlinarith have hone : 1 ≤ M * x ^ σ := by nlinarith calc _ ≤ K * M * x ^ σ + 3 * M + 2 * (1 + C) := by linarith _ ≤ K * M * x ^ σ + 3 * (M * x ^ σ) + 2 * (1 + C) * (M * x ^ σ) := by apply add_le_add · exact add_le_add le_rfl (mul_le_mul_of_nonneg_left hscale (show (0 : ℝ) ≤ 3 by norm_num)) · simpa only [mul_one] using mul_le_mul_of_nonneg_left hone (show 0 ≤ 2 * (1 + C) by positivity) _ = _ := by dsimp [M, L]; ring end Bounty end section /- Exact subset and complement disintegration of dependent finite products. -/ open scoped BigOperators Classical namespace Bounty end Bounty end section /- Exact four-way disintegration into specified disjoint coordinate sets. -/ open Finset open scoped BigOperators Classical namespace Bounty variable {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} theorem finite_active_four_partition (active A B : Finset I) (hA : A ⊆ active) (hB : B ⊆ active) (hAB : Disjoint A B) : Disjoint (active \ (A ∪ B)) A ∧ Disjoint (active \ (A ∪ B)) B ∧ Disjoint (active \ (A ∪ B)) activeᶜ ∧ Disjoint A B ∧ Disjoint A activeᶜ ∧ Disjoint B activeᶜ ∧ (active \ (A ∪ B)) ∪ A ∪ B ∪ activeᶜ = univ := by refine ⟨?_, ?_, ?_, hAB, ?_, ?_, ?_⟩ · exact disjoint_left.mpr (fun i hi ha => (mem_sdiff.mp hi).2 (mem_union_left B ha)) · exact disjoint_left.mpr (fun i hi hb => (mem_sdiff.mp hi).2 (mem_union_right A hb)) · exact disjoint_left.mpr (fun i hi ht => (mem_compl.mp ht) (mem_sdiff.mp hi).1) · exact disjoint_left.mpr (fun i hi ht => (mem_compl.mp ht) (hA hi)) · exact disjoint_left.mpr (fun i hi ht => (mem_compl.mp ht) (hB hi)) · ext i by_cases hi : i ∈ active <;> by_cases hiA : i ∈ A <;> by_cases hiB : i ∈ B <;> simp [hi, hiA, hiB] def finiteFourPartitionFill (S A B T : Finset I) (hcover : S ∪ A ∪ B ∪ T = univ) (s : ∀ i : S, X i.1) (a : ∀ i : A, X i.1) (b : ∀ i : B, X i.1) (t : ∀ i : T, X i.1) (i : I) : X i := if hiS : i ∈ S then s ⟨i, hiS⟩ else if hiA : i ∈ A then a ⟨i, hiA⟩ else if hiB : i ∈ B then b ⟨i, hiB⟩ else t ⟨i, by have hi : i ∈ S ∪ A ∪ B ∪ T := by rw [hcover]; exact mem_univ i simpa only [mem_union, hiS, hiA, hiB, false_or] using hi⟩ theorem finite_four_partition_fill_s (S A B T : Finset I) (hcover : S ∪ A ∪ B ∪ T = univ) (s : ∀ i : S, X i.1) (a : ∀ i : A, X i.1) (b : ∀ i : B, X i.1) (t : ∀ i : T, X i.1) : finiteCoordinateRestrict S (finiteFourPartitionFill S A B T hcover s a b t) = s := by funext i simp only [finiteCoordinateRestrict, finiteFourPartitionFill, dif_pos i.property] theorem finite_four_partition_fill_a (S A B T : Finset I) (hcover : S ∪ A ∪ B ∪ T = univ) (hSA : Disjoint S A) (s : ∀ i : S, X i.1) (a : ∀ i : A, X i.1) (b : ∀ i : B, X i.1) (t : ∀ i : T, X i.1) : finiteCoordinateRestrict A (finiteFourPartitionFill S A B T hcover s a b t) = a := by funext i have hiS : i.1 ∉ S := fun hi => disjoint_left.mp hSA hi i.property simp only [finiteCoordinateRestrict, finiteFourPartitionFill, dif_neg hiS, dif_pos i.property] theorem finite_four_partition_fill_b (S A B T : Finset I) (hcover : S ∪ A ∪ B ∪ T = univ) (hSB : Disjoint S B) (hAB : Disjoint A B) (s : ∀ i : S, X i.1) (a : ∀ i : A, X i.1) (b : ∀ i : B, X i.1) (t : ∀ i : T, X i.1) : finiteCoordinateRestrict B (finiteFourPartitionFill S A B T hcover s a b t) = b := by funext i have hiS : i.1 ∉ S := fun hi => disjoint_left.mp hSB hi i.property have hiA : i.1 ∉ A := fun hi => disjoint_left.mp hAB hi i.property simp only [finiteCoordinateRestrict, finiteFourPartitionFill, dif_neg hiS, dif_neg hiA, dif_pos i.property] theorem finite_four_partition_fill_t (S A B T : Finset I) (hcover : S ∪ A ∪ B ∪ T = univ) (hST : Disjoint S T) (hAT : Disjoint A T) (hBT : Disjoint B T) (s : ∀ i : S, X i.1) (a : ∀ i : A, X i.1) (b : ∀ i : B, X i.1) (t : ∀ i : T, X i.1) : finiteCoordinateRestrict T (finiteFourPartitionFill S A B T hcover s a b t) = t := by funext i have hiS : i.1 ∉ S := fun hi => disjoint_left.mp hST hi i.property have hiA : i.1 ∉ A := fun hi => disjoint_left.mp hAT hi i.property have hiB : i.1 ∉ B := fun hi => disjoint_left.mp hBT hi i.property simp only [finiteCoordinateRestrict, finiteFourPartitionFill, dif_neg hiS, dif_neg hiA, dif_neg hiB] def finiteFourPartitionEquiv (S A B T : Finset I) (hSA : Disjoint S A) (hSB : Disjoint S B) (hST : Disjoint S T) (hAB : Disjoint A B) (hAT : Disjoint A T) (hBT : Disjoint B T) (hcover : S ∪ A ∪ B ∪ T = univ) : (∀ i, X i) ≃ ((∀ i : S, X i.1) × (∀ i : A, X i.1) × (∀ i : B, X i.1) × (∀ i : T, X i.1)) where toFun x := (finiteCoordinateRestrict S x, finiteCoordinateRestrict A x, finiteCoordinateRestrict B x, finiteCoordinateRestrict T x) invFun q := finiteFourPartitionFill S A B T hcover q.1 q.2.1 q.2.2.1 q.2.2.2 left_inv x := by funext i unfold finiteFourPartitionFill dsimp only split_ifs <;> rfl right_inv q := by rcases q with ⟨s, a, b, t⟩ simp only [finite_four_partition_fill_s, finite_four_partition_fill_a S A B T hcover hSA, finite_four_partition_fill_b S A B T hcover hSB hAB, finite_four_partition_fill_t S A B T hcover hST hAT hBT] theorem finite_product_value_four_partition {M : Type*} [CommMonoid M] (v : ∀ i, X i → M) (S A B T : Finset I) (hSA : Disjoint S A) (hSB : Disjoint S B) (hST : Disjoint S T) (hAB : Disjoint A B) (hAT : Disjoint A T) (hBT : Disjoint B T) (hcover : S ∪ A ∪ B ∪ T = univ) (x : ∀ i, X i) : (∏ i, v i (x i)) = (∏ i : S, v i.1 (x i.1)) * (∏ i : A, v i.1 (x i.1)) * (∏ i : B, v i.1 (x i.1)) * ∏ i : T, v i.1 (x i.1) := by rw [prod_coe_sort S (fun i => v i (x i)), prod_coe_sort A (fun i => v i (x i)), prod_coe_sort B (fun i => v i (x i)), prod_coe_sort T (fun i => v i (x i))] rw [← hcover, prod_union (disjoint_union_left.mpr ⟨disjoint_union_left.mpr ⟨hST, hAT⟩, hBT⟩), prod_union (disjoint_union_left.mpr ⟨hSB, hAB⟩), prod_union hSA] theorem finite_product_weight_four_partition (μ : ∀ i, X i → ℝ) (S A B T : Finset I) (hSA : Disjoint S A) (hSB : Disjoint S B) (hST : Disjoint S T) (hAB : Disjoint A B) (hAT : Disjoint A T) (hBT : Disjoint B T) (hcover : S ∪ A ∪ B ∪ T = univ) (x : ∀ i, X i) : finiteProductWeight μ x = finiteProductWeight (fun i : S => μ i.1) (finiteCoordinateRestrict S x) * finiteProductWeight (fun i : A => μ i.1) (finiteCoordinateRestrict A x) * finiteProductWeight (fun i : B => μ i.1) (finiteCoordinateRestrict B x) * finiteProductWeight (fun i : T => μ i.1) (finiteCoordinateRestrict T x) := finite_product_value_four_partition μ S A B T hSA hSB hST hAB hAT hBT hcover x theorem finite_product_weight_four_fill (μ : ∀ i, X i → ℝ) (S A B T : Finset I) (hSA : Disjoint S A) (hSB : Disjoint S B) (hST : Disjoint S T) (hAB : Disjoint A B) (hAT : Disjoint A T) (hBT : Disjoint B T) (hcover : S ∪ A ∪ B ∪ T = univ) (s : ∀ i : S, X i.1) (a : ∀ i : A, X i.1) (b : ∀ i : B, X i.1) (t : ∀ i : T, X i.1) : finiteProductWeight μ (finiteFourPartitionFill S A B T hcover s a b t) = finiteProductWeight (fun i : S => μ i.1) s * finiteProductWeight (fun i : A => μ i.1) a * finiteProductWeight (fun i : B => μ i.1) b * finiteProductWeight (fun i : T => μ i.1) t := by rw [finite_product_weight_four_partition μ S A B T hSA hSB hST hAB hAT hBT hcover, finite_four_partition_fill_s, finite_four_partition_fill_a S A B T hcover hSA, finite_four_partition_fill_b S A B T hcover hSB hAB, finite_four_partition_fill_t S A B T hcover hST hAT hBT] variable [∀ i, Fintype (X i)] end Bounty end section /- The literal asymmetric transition conditioned on its shared coordinates. -/ namespace Bounty open Finset open scoped Classical noncomputable def finiteThreeWayKernel {C A B : Type*} [DecidableEq C] (μ : A → ℝ) (ν : B → ℝ) (H : C → A → B → ℂ) (x y : C × A × B) : ℂ := if x.1 = y.1 then ((μ y.2.1 * ν y.2.2 : ℝ) : ℂ) * H x.1 y.2.1 x.2.2 else 0 theorem finite_three_way_kernel_row {C A B : Type*} [Fintype C] [DecidableEq C] [Fintype A] [Fintype B] (μ : A → ℝ) (ν : B → ℝ) (hν : ∑ b, ν b = 1) (H : C → A → B → ℂ) (G : C → A → ℂ) (x : C × A × B) : (∑ y, finiteThreeWayKernel μ ν H x y * G y.1 y.2.1) = ∑ a, (μ a : ℂ) * H x.1 a x.2.2 * G x.1 a := by simp only [Fintype.sum_prod_type] rw [sum_eq_single x.1] · apply sum_congr rfl intro a _ simp only [finiteThreeWayKernel, if_true, Complex.ofReal_mul] have hn : (∑ b, (ν b : ℂ)) = 1 := by exact_mod_cast hν calc _ = ((μ a : ℂ) * H x.1 a x.2.2 * G x.1 a) * ∑ b, (ν b : ℂ) := by rw [mul_sum] apply sum_congr rfl intro b _ ring _ = _ := by rw [hn, mul_one] · intro c _ hcx simp only [finiteThreeWayKernel, Ne.symm hcx, if_false, zero_mul, sum_const_zero] · simp theorem finite_three_way_kernel_pairing {C A B : Type*} [Fintype C] [DecidableEq C] [Fintype A] [Fintype B] (ρ : C → ℝ) (μ : A → ℝ) (ν : B → ℝ) (hμ : ∑ a, μ a = 1) (hν : ∑ b, ν b = 1) (H : C → A → B → ℂ) (F : C → B → ℂ) (G : C → A → ℂ) : cleanKernelPairing (fun x : C × A × B => ρ x.1 * μ x.2.1 * ν x.2.2) (finiteThreeWayKernel μ ν H) (fun x => F x.1 x.2.2) (fun x => G x.1 x.2.1) = ∑ c, (ρ c : ℂ) * ∑ a, ∑ b, ((μ a * ν b : ℝ) : ℂ) * ((starRingEnd ℂ) (F c b) * G c a * H c a b) := by have hr (x : C × A × B) : (∑ y, ((ρ x.1 * μ x.2.1 * ν x.2.2 : ℝ) : ℂ) * (starRingEnd ℂ) (F x.1 x.2.2) * finiteThreeWayKernel μ ν H x y * G y.1 y.2.1) = (((ρ x.1 * μ x.2.1 * ν x.2.2 : ℝ) : ℂ) * (starRingEnd ℂ) (F x.1 x.2.2)) * ∑ a, (μ a : ℂ) * H x.1 a x.2.2 * G x.1 a := by rw [← finite_three_way_kernel_row μ ν hν H G x, mul_sum] apply sum_congr rfl intro y _ ring unfold cleanKernelPairing simp_rw [hr] simp only [Fintype.sum_prod_type] apply sum_congr rfl intro c _ rw [sum_comm] have hm : (∑ a, (μ a : ℂ)) = 1 := by exact_mod_cast hμ have hu (b : B) : (∑ a, (((ρ c * μ a * ν b : ℝ) : ℂ) * (starRingEnd ℂ) (F c b)) * ∑ a', (μ a' : ℂ) * H c a' b * G c a') = ((ρ c * ν b : ℝ) : ℂ) * (starRingEnd ℂ) (F c b) * ∑ a', (μ a' : ℂ) * H c a' b * G c a' := by calc _ = (∑ a, (μ a : ℂ)) * (((ρ c * ν b : ℝ) : ℂ) * (starRingEnd ℂ) (F c b) * ∑ a', (μ a' : ℂ) * H c a' b * G c a') := by rw [sum_mul] apply sum_congr rfl intro a _ push_cast ring _ = _ := by rw [hm, one_mul] simp_rw [hu, mul_sum] rw [sum_comm] apply sum_congr rfl intro a _ apply sum_congr rfl intro b _ push_cast ring theorem finite_three_way_raw_pairing {C A B : Type*} [Fintype C] [Fintype A] [Fintype B] (ρ : C → ℝ) (μ : A → ℝ) (ν : B → ℝ) (phase : C → A → B → ℂ) (F : C → B → ℂ) (G : C → A → ℂ) : cleanRawPairing (fun x : C × A × B => ρ x.1 * μ x.2.1 * ν x.2.2) (fun x => phase x.1 x.2.1 x.2.2) (fun x => F x.1 x.2.2) (fun x => G x.1 x.2.1) = ∑ c, (ρ c : ℂ) * ∑ a, ∑ b, ((μ a * ν b : ℝ) : ℂ) * ((starRingEnd ℂ) (F c b) * G c a * phase c a b) := by simp only [cleanRawPairing, Fintype.sum_prod_type, mul_sum] apply sum_congr rfl intro c _ apply sum_congr rfl intro a _ apply sum_congr rfl intro b _ push_cast ring end Bounty end section /- The fixed shared product only contributes a unit scalar and shifts additive frequency. -/ namespace Bounty open Finset open scoped Classical section variable {A B : Type*} [sharedInstance1 : Fintype A] [sharedInstance2 : Fintype B] (μ : A → ℝ) (ν : B → ℝ) (KA : A → A → ℂ) (KB : B → B → ℂ) include A B sharedInstance1 sharedInstance2 μ ν KA KB theorem finite_two_kernel_pairing_error_mul (phase : A → B → ℂ) (f : A → ℂ) (g : B → ℂ) (z : ℂ) : finiteTwoKernelPairingError μ ν KA KB (fun a b => z * phase a b) f g = z * finiteTwoKernelPairingError μ ν KA KB phase f g := by simp only [finiteTwoKernelPairingError, finite_two_kernel_average_mul, mul_sum] apply sum_congr rfl intro a _ apply sum_congr rfl intro b _ ring theorem prime_shared_phase_error_norm (π : A → ℕ) (τ : B → ℕ) (hπ : ∀ a, 0 < π a) (hτ : ∀ b, 0 < τ b) (ζ Θ : ℝ) (C : ℕ) (hC : 0 < C) (f : A → ℂ) (g : B → ℂ) : ‖finiteTwoKernelPairingError μ ν KA KB (fun a b => primeTuplePhase ζ Θ (C * π a * τ b)) f g‖ = ‖finiteTwoKernelPairingError μ ν KA KB (fun a b => Complex.exp (Complex.I * (ζ * Real.log ((π a : ℝ) * τ b) + 2 * Real.pi * ((Θ * C) * ((π a : ℝ) * τ b)) : ℝ))) f g‖ := by have he : (fun a b => primeTuplePhase ζ Θ (C * π a * τ b)) = fun a b => physicalPhase ζ C * primeTuplePhase ζ (Θ * C) (π a * τ b) := by funext a b rw [Nat.mul_assoc, prime_tuple_phase_shared_mul ζ Θ C (π a * τ b) hC (Nat.mul_pos (hπ a) (hτ b))] rw [he, finite_two_kernel_pairing_error_mul, norm_mul, physical_phase_norm, one_mul] congr 2 funext a b rw [prime_tuple_phase_eq_exp] congr 1 push_cast ring end end Bounty end section /- Arbitrary power saving for the explicit rough-cell sieve error profile. -/ open Filter namespace Bounty theorem eventually_rough_cell_error_profile_le {a K : ℝ} (ha : 0 < a) (hK : 0 ≤ K) (S B : ℝ) : ∀ᶠ L : ℝ in atTop, K*(Real.exp (-L^(1/8 : ℝ)) + L^(S+1)*Real.exp (-(a/2)*L)) ≤ L^(-B) := by have hfirst := eventually_exp_neg_rpow_mul_rpow_le (by norm_num : (0 : ℝ) < 1/8) (by norm_num : (0 : ℝ) < 1) 0 (B+1) have hsecond := eventually_exp_neg_rpow_mul_rpow_le (by norm_num : (0 : ℝ) < 1) (half_pos ha) (S+1) (B+1) filter_upwards [hfirst, hsecond, eventually_ge_atTop (2*K), eventually_gt_atTop (0 : ℝ)] with L hfirstL hsecondL hconst hL simp only [neg_one_mul, Real.rpow_zero, mul_one] at hfirstL simp only [Real.rpow_one] at hsecondL calc _ ≤ K*(L^(-(B+1)) + L^(-(B+1))) := by apply mul_le_mul_of_nonneg_left _ hK exact add_le_add hfirstL (by simpa only [mul_comm] using hsecondL) _ = (2*K)*L^(-(B+1)) := by ring _ ≤ L*L^(-(B+1)) := mul_le_mul_of_nonneg_right hconst (Real.rpow_nonneg hL.le _) _ = L^(-B) := by nth_rw 1 [← Real.rpow_one L] rw [← Real.rpow_add hL] congr 1 ring theorem eventually_rough_cell_order_error_le {a K : ℝ} (ha : 0 < a) (hK : 0 ≤ K) (S B : ℝ) : ∀ᶠ L : ℝ in atTop, K*(Real.exp (-(roughCellSieveOrder L : ℝ)) + L^(S+1)*Real.exp (-(a/2)*L)) ≤ L^(-B) := by filter_upwards [eventually_rough_cell_error_profile_le ha hK S B, eventually_ge_atTop (1 : ℝ)] with L hprofile hL apply le_trans _ hprofile apply mul_le_mul_of_nonneg_left _ hK exact add_le_add (rough_cell_sieve_order_exponential_le hL) le_rfl end Bounty end section /- A quantitative positive main term in a short logarithmic rough-integer cell. -/ open Finset namespace Bounty theorem rough_sqrt_avoidance_product_lower {L : ℝ} (hL : 1 ≤ L) (hlog : Real.log 2 ≤ L) : 1 / ((4 * primeEulerProductUpperConstant) * L) ≤ ∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1 - 1 / (p : ℝ)) := by have hL0 : 0 < L := zero_lt_one.trans_le hL have hC := primeEulerProductUpperConstant_pos have hsqrt : Real.sqrt L ≤ L := Real.sqrt_le_self_iff.mpr (Or.inr hL) have hbound := finite_prime_avoidance_product_lower (primeBand 0 (Real.exp (Real.sqrt L))) (fun _ hp => small_prime_pool_prime hp) (Real.one_le_exp_iff.mpr (Real.sqrt_nonneg L)) (fun _ hp => small_prime_pool_le (Real.exp_nonneg _) hp) rw [Real.log_mul (by norm_num) (Real.exp_ne_zero _), Real.log_exp] at hbound apply le_trans _ hbound apply one_div_le_one_div_of_le · have hlog0 : 0 < Real.log 2 := Real.log_pos (by norm_num) positivity · nlinarith theorem logarithmic_cell_length_lower {L Y : ℝ} (hY : 0 ≤ Y) (S : ℝ) : Y * L^(-S) ≤ Real.exp (L^(-S)) * Y - Y := by have h := mul_le_mul_of_nonneg_right (Real.add_one_le_exp (L^(-S))) hY nlinarith theorem rough_logarithmic_cell_main_term_lower {L Y : ℝ} (hL : 1 ≤ L) (hlog : Real.log 2 ≤ L) (hY : 0 ≤ Y) (S : ℝ) : Y / ((4 * primeEulerProductUpperConstant) * L^(S + 1)) ≤ (Real.exp (L^(-S)) * Y - Y) * (∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1 - 1 / (p : ℝ))) := by have hL0 : 0 < L := zero_lt_one.trans_le hL have hC := primeEulerProductUpperConstant_pos have hlen := logarithmic_cell_length_lower (L := L) hY S have hV := rough_sqrt_avoidance_product_lower hL hlog have hV0 := (finite_prime_avoidance_product_pos (primeBand 0 (Real.exp (Real.sqrt L))) (fun _ hp => small_prime_pool_prime hp)).le have hlen0 : 0 ≤ Real.exp (L^(-S)) * Y - Y := (mul_nonneg hY (Real.rpow_nonneg hL0.le _)).trans hlen have hmain := mul_le_mul hlen hV (by positivity) hlen0 apply le_trans _ hmain apply le_of_eq rw [Real.rpow_add hL0, Real.rpow_one, Real.rpow_neg hL0.le] field_simp end Bounty end section /- Exact prime-divisibility moments within a residue class and their aggregate error. -/ open Finset namespace Bounty noncomputable def intervalResidueDivisibilityRemainder (A B r u d : ℕ) : ℝ := (((Ioc A B).filter (fun n => n % r = u % r ∧ d ∣ n)).card : ℝ) - ((B : ℝ) - A) / (r * d : ℕ) theorem coprime_prime_pool_product (P : Finset ℕ) (r : ℕ) (hP : ∀ p ∈ P, p.Prime) (hPr : ∀ p ∈ P, ¬p ∣ r) : r.Coprime (∏ p ∈ P, p) := by apply Nat.Coprime.prod_right intro p hp exact ((hP p hp).coprime_iff_not_dvd.mpr (hPr p hp)).symm theorem interval_residue_prime_intersection_moment (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (A B r u : ℕ) (S : Finset ℕ) (hS : S ⊆ P) : (∑ _n ∈ ((Ioc A B).filter (fun n => n % r = u % r)).filter (fun n => ∀ p ∈ S, p ∣ n), (1 : ℝ)) = (((B : ℝ) - A) / r) * (∏ p ∈ S, 1 / (p : ℝ)) + intervalResidueDivisibilityRemainder A B r u (∏ p ∈ S, p) := by have hfilter : ((Ioc A B).filter (fun n => n % r = u % r)).filter (fun n => ∀ p ∈ S, p ∣ n) = (Ioc A B).filter (fun n => n % r = u % r ∧ (∏ p ∈ S, p) ∣ n) := by rw [filter_filter] apply filter_congr intro n _ rw [prime_subset_product_dvd_iff S (fun p hp => hP p (hS hp)) n] have hrecip : (∏ p ∈ S, 1 / (p : ℝ)) = 1 / ((∏ p ∈ S, p : ℕ) : ℝ) := by simp only [one_div, prod_inv_distrib, Nat.cast_prod] rw [hfilter, hrecip] simp only [sum_const, nsmul_eq_mul, mul_one, intervalResidueDivisibilityRemainder, Nat.cast_mul, div_mul_eq_div_mul_one_div] ring theorem interval_residue_divisibility_remainder_abs_le_one (A B r u d : ℕ) (hAB : A ≤ B) (hr : 0 < r) (hd : 0 < d) (hcop : r.Coprime d) : |intervalResidueDivisibilityRemainder A B r u d| ≤ 1 := interval_residue_divisibility_error_le_one A B r u d hAB hr hd hcop theorem interval_residue_divisibility_remainder_sum_le (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (r : ℕ) (hPr : ∀ p ∈ P, ¬p ∣ r) (A B u : ℕ) (hAB : A ≤ B) (hr : 0 < r) (D : ℝ) (hD : 0 ≤ D) : (∑ d ∈ blockSieveModuli P D, |intervalResidueDivisibilityRemainder A B r u d|) ≤ D := by have hcop := coprime_prime_pool_product P r hP hPr calc _ ≤ ∑ _d ∈ blockSieveModuli P D, (1 : ℝ) := by apply sum_le_sum intro d hd have hprop := block_sieve_modulus_properties P hP D hd exact interval_residue_divisibility_remainder_abs_le_one A B r u d hAB hr hprop.1 (hcop.of_dvd_right hprop.2.2.2) _ = ((blockSieveModuli P D).card : ℝ) := by simp _ ≤ ((Icc 1 ⌊D⌋₊).card : ℝ) := by exact_mod_cast card_le_card (filter_subset (fun d => d ∣ ∏ p ∈ P, p) (Icc 1 ⌊D⌋₊)) _ = (⌊D⌋₊ : ℝ) := by simp _ ≤ D := Nat.floor_le hD end Bounty end section /- Rescaling the wide candidate interval to the Carmichael counting scale. -/ open Filter namespace Bounty /- The prime supply produced by the product window `(X,16X]` after the shift `u ↦ 2u+1`. This is an input contract until the construction is closed. -/ def WideSmoothShiftedPrimeSupply : Prop := ∀ δ : ℝ, 0 < δ → δ < 1 / 4 → ∀ σ : ℝ, 0 < σ → ∀ᶠ x : ℝ in atTop, ∃ P : Finset ℕ, P ⊆ primeBand (2 * x) (33 * x) ∧ x ^ (1 - σ) ≤ (P.card : ℝ) ∧ ∀ p ∈ P, ∀ q : ℕ, q.Prime → q ∣ p - 1 → (q : ℝ) ≤ x ^ δ theorem eventually_rescaled_rpow_lower {k σ : ℝ} (hk : 0 < k) (hσ : 0 < σ) (a : ℝ) : ∀ᶠ y : ℝ in atTop, y ^ (a - σ) ≤ (y / k) ^ (a - σ / 2) := by filter_upwards [eventually_const_le_mul_rpow (by linarith : 0 < σ / 2) (by norm_num : (0 : ℝ) < 1) (k ^ (a - σ / 2)), eventually_gt_atTop (0 : ℝ)] with y hy hy0 have hmul := mul_le_mul_of_nonneg_left hy (Real.rpow_nonneg hy0.le (a - σ)) rw [one_mul] at hmul have heq : y ^ (a - σ) * y ^ (σ / 2) = y ^ (a - σ / 2) := by rw [← Real.rpow_add hy0] congr 1 ring rw [heq] at hmul rw [Real.div_rpow hy0.le hk.le] exact (le_div_iff₀ (Real.rpow_pos_of_pos hk _)).mpr hmul theorem eventually_rpow_le_quarter {δ : ℝ} (hδ : δ < 1) : ∀ᶠ y : ℝ in atTop, y ^ δ ≤ y / 4 := by filter_upwards [eventually_const_le_mul_rpow (by linarith : 0 < 1 - δ) (by norm_num : (0 : ℝ) < 1) 4, eventually_gt_atTop (0 : ℝ)] with y hy hy0 have hmul := mul_le_mul_of_nonneg_left hy (Real.rpow_nonneg hy0.le δ) rw [one_mul] at hmul have heq : y ^ δ * y ^ (1 - δ) = y := by rw [← Real.rpow_add hy0] have hexp : δ + (1 - δ) = 1 := by ring rw [hexp, Real.rpow_one] rw [heq] at hmul linarith /- The loss from rescaling is absorbed by half the freely chosen power loss. -/ theorem wide_smooth_supply_rescaled (hS : WideSmoothShiftedPrimeSupply) {δ σ : ℝ} (hδ : 0 < δ) (hδsmall : δ < 1 / 4) (hσ : 0 < σ) : ∀ᶠ y : ℝ in atTop, ∃ P : Finset ℕ, P ⊆ primeBand (y / 4) (5 * y) ∧ y ^ (1 - σ) ≤ (P.card : ℝ) ∧ ∀ p ∈ P, ∀ q : ℕ, q.Prime → q ∣ p - 1 → (q : ℝ) ≤ y ^ δ := by have ht : Tendsto (fun y : ℝ => y / 8) atTop atTop := Filter.Tendsto.atTop_div_const (by norm_num) tendsto_id filter_upwards [ht.eventually (hS δ hδ hδsmall (σ / 2) (by linarith)), eventually_rescaled_rpow_lower (by norm_num : (0 : ℝ) < 8) hσ 1, eventually_ge_atTop (1 : ℝ)] with y hSy hcard hy obtain ⟨P, hP, hN, hsmooth⟩ := hSy have hy0 : 0 ≤ y := by linarith refine ⟨P, ?_, hcard.trans hN, ?_⟩ · intro p hp obtain ⟨hpp, hlo, hhi⟩ := (mem_primeBand_iff (by positivity) (by positivity) p).mp (hP hp) exact (mem_primeBand_iff (by positivity) (by positivity) p).mpr ⟨hpp, by linarith, by linarith⟩ · intro p hp q hq hdiv exact (hsmooth p hp q hq hdiv).trans (Real.rpow_le_rpow (by positivity) (by linarith : y / 8 ≤ y) hδ.le) /- Ambient cancellation on the wide interval used after rescaling. -/ def WideAmbientPrimeCancellationAt (β : ℝ) : Prop := ∀ δ : ℝ, 0 < δ → δ < 1 / 16 → ∀ σ : ℝ, 0 < σ → ∀ᶠ y : ℝ in atTop, ∀ L : ℕ, 0 < L → Real.log (L : ℝ) ≤ y ^ δ * Real.log (5 * y) → ∀ χ : DirichletCharacter ℂ L, χ ≠ 1 → ‖∑ p ∈ primeBand (y / 4) (5 * y), χ (p : ZMod L)‖ ≤ y ^ (β + 2 * δ + σ) /- A wide smooth supply gives the same reservoir contract as the original narrow supply. The final counting theorem therefore needs no modification. -/ theorem powerPrimeReservoir_of_wide_analytic_inputs_at {β : ℝ} (hS : WideSmoothShiftedPrimeSupply) (hC : WideAmbientPrimeCancellationAt β) {δ σ : ℝ} (hδ : 0 < δ) (hδsmall : δ < 1 / 16) (hσ : 0 < σ) : ∀ᶠ y : ℝ in atTop, PowerPrimeReservoirAt β δ σ y := by filter_upwards [wide_smooth_supply_rescaled hS hδ (by linarith) hσ, hC δ hδ hδsmall σ hσ, eventually_unitGroup_log_natLog_le_rpow δ hσ, eventually_rpow_le_quarter (by linarith : δ < 1), eventually_ge_atTop (1 : ℝ)] with y hSy hCy hGy hquarter hy obtain ⟨P, hPS, hPcard, hPsmooth⟩ := hSy have hy0 : 0 ≤ y := by linarith have hprime : ∀ p ∈ primeBand (y / 4) (5 * y), p.Prime := by intro p hp exact ((mem_primeBand_iff (by positivity) (by positivity) p).mp hp).1 have hinterval : ∀ p ∈ primeBand (y / 4) (5 * y), y / 4 < (p : ℝ) ∧ (p : ℝ) ≤ 5 * y := by intro p hp exact ((mem_primeBand_iff (by positivity) (by positivity) p).mp hp).2 obtain ⟨L, g, hL, hdiv, _, hlog, _, hcompat⟩ := exists_real_smooth_prime_modulus_above_smoothness hy P (primeBand (y / 4) (5 * y)) hPS hprime (fun p hp => (hinterval p hp).2) (fun p hp => hquarter.trans_lt (hinterval p hp).1) hPsmooth obtain ⟨hGlog, hGnatlog⟩ := hGy L hL hlog refine ⟨L, primeBand (y / 4) (5 * y), P, g, hL, hPS, hprime, (fun p hp => (hinterval p hp).2), hdiv, (fun p hp => hcompat p (hPS hp)), hPcard, hGlog, hGnatlog, ?_⟩ intro ξ hξ exact unitCharacter_sum_bound_of_dirichlet (primeBand (y / 4) (5 * y)) g hcompat (hCy L hL hlog) ξ hξ theorem target_of_wide_smooth_supply_and_cancellation {β : ℝ} (hβ : β < 1) (hS : WideSmoothShiftedPrimeSupply) (hC : WideAmbientPrimeCancellationAt β) : fcTypeOfName% "Erdos1057.erdos_1057" := by apply target_of_power_prime_reservoirs_at hβ intro δ hδ hδsmall σ hσ exact powerPrimeReservoir_of_wide_analytic_inputs_at hS hC hδ hδsmall hσ end Bounty end section /- The original signed raw rows preserve multiplication of their entire continuation by a complex scalar, including every cutoff. -/ open Finset namespace Bounty theorem global_birth_raw_step_row_mul {P : Type*} [Fintype P] [DecidableEq P] {R : P → Type*} [∀ p, AddGroup (R p)] [∀ p, DecidableEq (R p)] {a b : P → Bool} (step : GlobalBirthRawStep (R := R) a b) (c : ℂ) (F : GlobalBirthHistoryState R → ℂ) (s : GlobalBirthHistoryState R) : globalBirthRawStepRow step (fun H q => c * F (H, q)) s.1 s.2 = c * globalBirthRawStepRow step (fun H q => F (H, q)) s.1 s.2 := by rw [global_birth_raw_step_event_sum step s (fun t => c * F t), global_birth_raw_step_event_sum step s F, mul_sum] apply sum_congr rfl intro e _ ring theorem global_birth_joint_raw_cutoff_mul {N : ℕ} {P : Fin N → Type*} {R : (g : Fin N) → P g → Type*} (B : ℕ) (c : ℂ) (F : GlobalBirthJointState R → ℂ) : globalBirthJointRawCutoff B (fun s => c * F s) = fun s => c * globalBirthJointRawCutoff B F s := by funext s unfold globalBirthJointRawCutoff split_ifs <;> simp only [mul_zero] section variable {N : ℕ} {P : Fin N → Type*} {R : (g : Fin N) → P g → Type*} (B : ℕ) (row : (g : Fin N) → (GlobalBirthHistoryState (R g) → ℂ) → GlobalBirthHistoryState (R g) → ℂ) (hrow : ∀ g c F s, row g (fun t => c * F t) s = c * row g F s) include N P R B row hrow theorem joint_raw_tensor_cutoff_mul (c : ℂ) (F : GlobalBirthJointState R → ℂ) (s : GlobalBirthJointState R) : jointRawTensorCutoff B row (fun t => c * F t) s = c * jointRawTensorCutoff B row F s := by unfold jointRawTensorCutoff rw [global_birth_joint_raw_cutoff_mul] have he : finTensorRow N row (fun u => c * globalBirthJointRawCutoff B F u) = (fun t => c * finTensorRow N row (globalBirthJointRawCutoff B F) t) := by funext t exact fin_tensor_row_mul_left N row hrow c _ t rw [he, global_birth_joint_raw_cutoff_mul] theorem joint_raw_tensor_cutoff_zero (s : GlobalBirthJointState R) : jointRawTensorCutoff B row (fun _ => 0) s = 0 := by simpa only [zero_mul] using joint_raw_tensor_cutoff_mul B row hrow 0 (fun _ => 0) s end end Bounty end section /- Exact finite Buchstab decomposition with repeated prime factors retained. -/ open Finset namespace Bounty theorem weighted_buchstab_identity {M : Type*} [AddCommMonoid M] (S : Finset ℕ) (N : ℕ) (w : ℕ → M) {z : ℝ} (hz : 0 ≤ z) (hSlo : ∀ n ∈ S, 2 ≤ n) (hShi : ∀ n ∈ S, n ≤ N) (hrough : ∀ n ∈ S, ∀ p ∈ n.primeFactors, z < (p : ℝ)) : (∑ n ∈ S, w n) = (∑ n ∈ S.filter Nat.Prime, w n) + ∑ p ∈ primeBand z (N : ℝ), ∑ m ∈ buchstabCompositeCofactors S N p, w (p*m) := by classical let C := S.filter (fun n => ¬n.Prime) have hmap : ∀ n ∈ C, n.minFac ∈ primeBand z (N : ℝ) := by intro n hn have hnS := (mem_filter.mp hn).1 have hnlo := hSlo n hnS have hn0 : n ≠ 0 := by omega have hn1 : n ≠ 1 := by omega have hp := Nat.minFac_prime hn1 apply (mem_primeBand_iff hz (Nat.cast_nonneg N) _).mpr refine ⟨hp, hrough n hnS n.minFac ?_, ?_⟩ · exact Nat.mem_primeFactors.mpr ⟨hp, Nat.minFac_dvd n, hn0⟩ · exact_mod_cast (Nat.minFac_le (by omega : 0 < n)).trans (hShi n hnS) have hfib := sum_fiberwise_of_maps_to (s := C) (t := primeBand z (N : ℝ)) (g := Nat.minFac) hmap w have hcomposite : (∑ n ∈ C, w n) = ∑ p ∈ primeBand z (N : ℝ), ∑ m ∈ buchstabCompositeCofactors S N p, w (p*m) := by rw [← hfib] apply sum_congr rfl intro p hp have hpprime := ((mem_primeBand_iff hz (Nat.cast_nonneg N) p).mp hp).1 have hfilter : C.filter (fun n => n.minFac = p) = S.filter (fun n => ¬n.Prime ∧ n.minFac = p) := by simp only [C, filter_filter] rw [hfilter, buchstab_minFac_fiber_image S hpprime hSlo hShi, sum_image] intro a _ b _ hab exact Nat.eq_of_mul_eq_mul_left hpprime.pos hab have hsplit := sum_filter_add_sum_filter_not S Nat.Prime w change (∑ n ∈ S.filter Nat.Prime, w n) + (∑ n ∈ C, w n) = ∑ n ∈ S, w n at hsplit rw [hcomposite] at hsplit exact hsplit.symm end Bounty end section /- The two-variable sieve densities and their elementary Euler-factor bounds. -/ namespace Bounty noncomputable def pairSieveBadResidues (p : ℕ) [NeZero p] (rough banned : Bool) : Finset (ZMod p × ZMod p) := by classical exact Finset.univ.filter (fun v => (rough = true ∧ v.1*v.2 = 0) ∨ (banned = true ∧ v.1*v.2 = 1)) noncomputable def pairSieveDensity (p : ℕ) (rough banned : Bool) : ℝ := ((if rough then 2*(p : ℝ)-1 else 0) + (if banned then (p : ℝ)-1 else 0)) / (p : ℝ)^2 theorem pair_sieve_density_eq_card (p : ℕ) [Fact p.Prime] (rough banned : Bool) : ((pairSieveBadResidues p rough banned).card : ℝ) / (p : ℝ)^2 = pairSieveDensity p rough banned := by have hp : 2 ≤ p := (Fact.out : p.Prime).two_le have hp1 : 1 ≤ p := by omega have hp2 : 1 ≤ 2*p := by omega have hp3 : 2 ≤ 3*p := by omega have h00 : pairSieveBadResidues p false false = ∅ := by ext v simp [pairSieveBadResidues] have h01 : pairSieveBadResidues p false true = (Finset.univ : Finset (ZMod p × ZMod p)).filter (fun v => v.1*v.2 = 1) := by ext v simp [pairSieveBadResidues] have h10 : pairSieveBadResidues p true false = (Finset.univ : Finset (ZMod p × ZMod p)).filter (fun v => v.1*v.2 = 0) := by ext v simp [pairSieveBadResidues] have h11 : pairSieveBadResidues p true true = (Finset.univ : Finset (ZMod p × ZMod p)).filter (fun v => v.1*v.2 = 0 ∨ v.1*v.2 = 1) := by ext v simp [pairSieveBadResidues] cases rough <;> cases banned · simp [h00, pairSieveDensity] · rw [h01, prime_mul_one_pair_card] simp [pairSieveDensity, Nat.cast_sub hp1] · rw [h10, prime_mul_zero_pair_card] simp [pairSieveDensity, Nat.cast_sub hp2] · rw [h11, prime_zero_or_one_pair_card] simp [pairSieveDensity, Nat.cast_sub hp3] ring theorem pair_sieve_density_bounds {p : ℕ} (hp : 3 ≤ p) (rough banned : Bool) : 0 ≤ pairSieveDensity p rough banned ∧ pairSieveDensity p rough banned ≤ 7/9 ∧ pairSieveDensity p rough banned ≤ 3/(p : ℝ) := by have hpR : (3 : ℝ) ≤ p := by exact_mod_cast hp have hp0 : (0 : ℝ) < p := by linarith have hp2 : (0 : ℝ) < (p : ℝ)^2 := sq_pos_of_pos hp0 have hq : 0 ≤ ((p : ℝ)-3) * (7*(p : ℝ)-6) := mul_nonneg (by linarith) (by linarith) cases rough <;> cases banned <;> dsimp [pairSieveDensity] <;> refine ⟨?_, ?_, ?_⟩ all_goals first | exact div_nonneg (by linarith) hp2.le | apply (div_le_iff₀ hp2).mpr; nlinarith | apply (div_le_div_iff₀ hp2 hp0).mpr; nlinarith theorem pair_sieve_unbanned_rough_factor (p : ℕ) (hp : p ≠ 0) : 1 - pairSieveDensity p true false = (1 - 1/(p : ℝ))^2 := by have hpR : (p : ℝ) ≠ 0 := by exact_mod_cast hp dsimp [pairSieveDensity] field_simp ring theorem pair_sieve_banned_rough_factor_le {p : ℕ} (hp : 3 ≤ p) : 1 - pairSieveDensity p true true ≤ (1 - 1/(p : ℝ))^3 := by have hpR : (3 : ℝ) ≤ p := by exact_mod_cast hp have hp0 : (0 : ℝ) < p := by linarith have ht : 0 ≤ 1 - 1/(p : ℝ) := sub_nonneg.mpr ((div_le_one hp0).mpr (by linarith)) have hid : (1 - 1/(p : ℝ))^3 - (1 - pairSieveDensity p true true) = (1/(p : ℝ))^2 * (1 - 1/(p : ℝ)) := by dsimp [pairSieveDensity] field_simp ring have hnn := mul_nonneg (sq_nonneg (1/(p : ℝ))) ht linarith theorem pair_sieve_banned_factor_le {p : ℕ} (hp : 3 ≤ p) : 1 - pairSieveDensity p false true ≤ (1 - 1/(p : ℝ)) * (1 + 2/(p : ℝ)^2) := by have hpR : (3 : ℝ) ≤ p := by exact_mod_cast hp have hp0 : (0 : ℝ) < p := by linarith have ht : 0 ≤ 1 - 2/(p : ℝ) := sub_nonneg.mpr ((div_le_one hp0).mpr (by linarith)) have hid : (1 - 1/(p : ℝ)) * (1 + 2/(p : ℝ)^2) - (1 - pairSieveDensity p false true) = (1/(p : ℝ))^2 * (1 - 2/(p : ℝ)) := by dsimp [pairSieveDensity] field_simp ring have hnn := mul_nonneg (sq_nonneg (1/(p : ℝ))) ht linarith end Bounty end section /- A uniform lattice error for one residue pair in a rectangular interval. -/ open Finset namespace Bounty theorem product_count_error_le {a b x y : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (ha : |a-x| ≤ 1) (hb : |b-y| ≤ 1) : |a*b-x*y| ≤ 1+x+y := by have hid : a*b-x*y = ((a-x)*(b-y)+x*(b-y))+y*(a-x) := by ring have htriangle := (abs_add_le ((a-x)*(b-y)+x*(b-y)) (y*(a-x))).trans (add_le_add (abs_add_le ((a-x)*(b-y)) (x*(b-y))) le_rfl) rw [← hid] at htriangle simp only [abs_mul, abs_of_nonneg hx, abs_of_nonneg hy] at htriangle have h1 := mul_le_mul ha hb (abs_nonneg (b-y)) (by norm_num : (0 : ℝ) ≤ 1) have h2 := mul_le_mul_of_nonneg_left hb hx have h3 := mul_le_mul_of_nonneg_left ha hy nlinarith theorem interval_residue_pair_count_error (A B C D r u v : ℕ) (hAB : A ≤ B) (hCD : C ≤ D) (hr : 0 < r) : |(((Finset.product (Ioc A B) (Ioc C D)).filter (fun n : ℕ × ℕ => n.1 % r = u % r ∧ n.2 % r = v % r)).card : ℝ) - (((B : ℝ)-A)/r) * (((D : ℝ)-C)/r)| ≤ 1 + ((B : ℝ)-A)/r + ((D : ℝ)-C)/r := by have hset : (Finset.product (Ioc A B) (Ioc C D)).filter (fun n : ℕ × ℕ => n.1 % r = u % r ∧ n.2 % r = v % r) = Finset.product ((Ioc A B).filter (fun n : ℕ => n % r = u % r)) ((Ioc C D).filter (fun n : ℕ => n % r = v % r)) := by ext n simp only [Finset.product_eq_sprod, mem_filter, mem_product] tauto rw [hset, Finset.product_eq_sprod, card_product, Nat.cast_mul] exact product_count_error_le (div_nonneg (sub_nonneg.mpr (Nat.cast_le.mpr hAB)) (Nat.cast_nonneg r)) (div_nonneg (sub_nonneg.mpr (Nat.cast_le.mpr hCD)) (Nat.cast_nonneg r)) (interval_residue_error_le_one A B r u hAB hr) (interval_residue_error_le_one C D r v hCD hr) end Bounty end section /- Uniform logarithmic product bounds for subsets of bounded group probes. -/ open Finset Filter open scoped Classical namespace Bounty theorem grouped_probe_subset_card_le {G : Type*} [Fintype G] [DecidableEq G] {I : G → Type*} [∀ g, DecidableEq (I g)] (r : Finset G) (probes : ∀ g, Finset (I g)) (m : ℕ) (hm : ∀ g, (probes g).card ≤ m) (U : Finset (Sigma I)) (hU : U ⊆ r.sigma probes) : U.card ≤ Fintype.card G * m := by calc U.card ≤ (univ.sigma probes).card := card_le_card (hU.trans (sigma_mono (subset_univ _) (fun _ => Subset.rfl))) _ = ∑ g, (probes g).card := card_sigma _ _ _ ≤ ∑ _g : G, m := sum_le_sum (fun g _ => hm g) _ = _ := by simp theorem prime_subset_product_log_le {G : Type*} [Fintype G] [DecidableEq G] {I : G → Type*} [∀ g, DecidableEq (I g)] (P : G → Finset ℕ) (r : Finset G) (probes : ∀ g, Finset (I g)) (m : ℕ) (hm : ∀ g, (probes g).card ≤ m) {B D L : ℝ} (hB : 0 ≤ B) (hpos : ∀ g p, p ∈ P g → 0 < p) (hlog : ∀ g p, p ∈ P g → Real.log p ≤ B) (hcard : (Fintype.card G : ℝ) ≤ D * Real.log L) (U : Finset (Sigma I)) (hU : U ⊆ r.sigma probes) (a : ∀ i : U, P i.val.fst) : Real.log (∏ i : U, (a i).val : ℕ) ≤ (D * (m : ℝ)) * B * Real.log L := by have hp : ∀ i ∈ (univ : Finset U), ((a i).val : ℝ) ≠ 0 := by intro i _ exact_mod_cast (hpos i.val.fst (a i).val (a i).property).ne' have hc : (U.card : ℝ) ≤ (Fintype.card G : ℝ) * (m : ℝ) := by exact_mod_cast grouped_probe_subset_card_le r probes m hm U hU calc _ = ∑ i : U, Real.log ((a i).val : ℝ) := by rw [Nat.cast_prod, Real.log_prod hp] _ ≤ ∑ _i : U, B := sum_le_sum (fun i _ => hlog i.val.fst (a i).val (a i).property) _ = (U.card : ℝ) * B := by simp _ ≤ ((Fintype.card G : ℝ) * (m : ℝ)) * B := mul_le_mul_of_nonneg_right hc hB _ ≤ ((D * Real.log L) * (m : ℝ)) * B := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hcard (Nat.cast_nonneg m)) hB _ = _ := by ring theorem eventually_prime_subset_product_log_rpow (D s ε : ℝ) (m : ℕ) (hs : 0 ≤ s) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ {G : Type*} [Fintype G] [DecidableEq G] {I : G → Type*} [∀ g, DecidableEq (I g)] (P : G → Finset ℕ) (r : Finset G) (probes : ∀ g, Finset (I g)), (∀ g, (probes g).card ≤ m) → (∀ g p, p ∈ P g → 0 < p) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ D * Real.log L → ∀ (U : Finset (Sigma I)), U ⊆ r.sigma probes → ∀ a : (∀ i : U, P i.val.fst), Real.log (∏ i : U, (a i).val : ℕ) ≤ L ^ (s + ε) := by filter_upwards [eventually_mul_rpow_log_add_le_rpow (a := s) (b := s + ε) (c := 1) (by linarith) (by linarith) (by norm_num) (D * (m : ℝ)) 0, eventually_gt_atTop (0 : ℝ)] with L hbound hL intro G _ _ I _ P r probes hm hpos hlog hcard U hU a exact (prime_subset_product_log_le P r probes m hm (Real.rpow_nonneg hL.le s) hpos hlog hcard U hU a).trans (by simpa only [add_zero, one_mul] using hbound) end Bounty end section /- Exact Chinese-remainder factorization for arbitrary allowed residue-pair sets. -/ open Finset namespace Bounty end Bounty end section /- Equality of finite row compositions uses only rows actually traversed. For a constant state space, visit/three-row grouping needs no terminal casts. -/ namespace Bounty theorem finite_row_composition_congr_before {S : ℕ → Type*} {V : Type*} (row other : ∀ i, (S (i + 1) → V) → S i → V) (n : ℕ) (hrow : ∀ i, i < n → ∀ F, row i F = other i F) (F : S n → V) : finiteRowComposition row n F = finiteRowComposition other n F := by induction n with | zero => rfl | succ n ih => rw [finite_row_composition_succ, hrow n (Nat.lt_succ_self n), finite_row_composition_succ] exact ih (fun i hi => hrow i (Nat.lt_trans hi (Nat.lt_succ_self n))) (other n F) theorem finite_row_visit_three_grouping_constant {X V : Type*} (row : ℕ → (X → V) → X → V) (n : ℕ) (F : X → V) : finiteRowComposition (S := fun _ => X) (finiteRowGrouped (S := fun _ => X) row visitThreeBlockLength) (2 * n + 1) F = finiteRowComposition (S := fun _ => X) row (4 * n + 1) F := by have h := finite_row_visit_three_grouping (S := fun _ => X) row n F simpa only [cast_eq] using h end Bounty end section /- Finite sums of terminal tests commute with sum-preserving chronological, recorded, and tensor rows. -/ open Finset namespace Bounty end Bounty end section /- Exact physical vacuum pairing and its unrestricted initial-mass bound. -/ open Finset open scoped Classical namespace Bounty section Physical variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {Z : G → Type*} [∀ g, Fintype (Z g)] {J ell B : ℕ} noncomputable def physicalMarkMass (μ : (g : G) → ↥(P g) → ℝ) : ℝ := ∑ L : PhysicalMarkLists P J ell, ∏ g, ∏ i : PhysicalSlots J ell, μ g (L g i) theorem physical_mark_mass_nonneg (μ : (g : G) → ↥(P g) → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) : 0 ≤ physicalMarkMass (J := J) (ell := ell) μ := by exact sum_nonneg fun L _ => prod_nonneg fun g _ => prod_nonneg fun i _ => hμ g (L g i) theorem physical_mark_mass_le (μ : (g : G) → ↥(P g) → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) : physicalMarkMass (J := J) (ell := ell) μ ≤ ∏ g, (∑ p, μ g p) ^ (J + ell) := by let embed : PhysicalMarkLists P J ell → ((g : G) → PhysicalSlots J ell → ↥(P g)) := fun L g => L g have he : Function.Injective embed := by intro L R h funext g apply Function.Embedding.coe_injective exact congrFun h g let weight := fun L : ((g : G) → PhysicalSlots J ell → ↥(P g)) => ∏ g, ∏ i, μ g (L g i) have hw (L) : 0 ≤ weight L := prod_nonneg fun g _ => prod_nonneg fun i _ => hμ g (L g i) calc physicalMarkMass μ = ∑ L ∈ univ.image embed, weight L := by rw [sum_image (fun _ _ _ _ h => he h)] rfl _ ≤ ∑ L, weight L := sum_le_sum_of_subset_of_nonneg (subset_univ _) (fun L _ _ => hw L) _ = ∏ g, (∑ p, μ g p) ^ (J + ell) := by dsimp [weight] rw [← Fintype.prod_sum (fun g (f : PhysicalSlots J ell → ↥(P g)) => ∏ i, μ g (f i))] apply prod_congr rfl intro g _ rw [← Fintype.prod_sum (fun (_ : PhysicalSlots J ell) (p : ↥(P g)) => μ g p)] simp [PhysicalSlots] theorem physical_mark_vacuum_energy_le (μ : (g : G) → ↥(P g) → ℝ) (ν : (g : G) → Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (qempty : (g : G) → BoundedOrderedTuple (Z g) B) (hq : ∀ g, (qempty g).1.val = 0) (F : PhysicalMarkLists P J ell → ((g : G) → BoundedOrderedTuple (Z g) B) → ℂ) : (∑ L, (∏ g, ∏ i : PhysicalSlots J ell, μ g (L g i)) * ‖F L qempty‖ ^ 2) ≤ physicalMarkMemoryEnergy μ ν F := by have hweight (g : G) : boundedOrderedMemoryWeight (ν g) (qempty g) = 1 := by have hp : (∏ j, ν g ((qempty g).2 j)) = 1 := by apply prod_eq_one intro i _ have hi := i.isLt have hz := hq g omega simp [boundedOrderedMemoryWeight, hp, hq] apply sum_le_sum intro L _ have h := single_le_sum (f := fun q : (g : G) → BoundedOrderedTuple (Z g) B => (∏ g, (∏ i : PhysicalSlots J ell, μ g (L g i)) * boundedOrderedMemoryWeight (ν g) (q g)) * ‖F L q‖ ^ 2) (fun q _ => mul_nonneg (prod_nonneg fun g _ => mul_nonneg (prod_nonneg fun i _ => hμ g (L g i)) (boundedOrderedMemoryWeight_nonneg (ν g) (hν g) (q g))) (sq_nonneg _)) (mem_univ qempty) simpa only [hweight, mul_one] using h theorem physical_mark_vacuum_pairing_energy_le (μ : (g : G) → ↥(P g) → ℝ) (ν : (g : G) → Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (qempty : (g : G) → BoundedOrderedTuple (Z g) B) (hq : ∀ g, (qempty g).1.val = 0) (F : PhysicalMarkLists P J ell → ((g : G) → BoundedOrderedTuple (Z g) B) → ℂ) : ‖∑ L, ((∏ g, ∏ i : PhysicalSlots J ell, μ g (L g i) : ℝ) : ℂ) * F L qempty‖ ^ 2 ≤ physicalMarkMass (J := J) (ell := ell) μ * physicalMarkMemoryEnergy μ ν F := by exact (finite_weighted_sum_cauchy univ (fun L : PhysicalMarkLists P J ell => ∏ g, ∏ i, μ g (L g i)) (fun L _ => prod_nonneg fun g _ => prod_nonneg fun i _ => hμ g (L g i)) (fun L => F L qempty)).trans (mul_le_mul_of_nonneg_left (physical_mark_vacuum_energy_le μ ν hμ hν qempty hq F) (physical_mark_mass_nonneg μ hμ)) end Physical end Bounty end section /- Independent-residue averaging restricted exactly to compatible marked visits. -/ open Finset open scoped Classical namespace Bounty section Expectation variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} theorem physical_residue_vertex_expectation_zero_of_incompatible (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (q : ℕ → ℝ) (h : ¬ ∃ r : PhysicalResidues P, physicalResiduePathCompatible labels visits offset r) : poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) univ visits (fun p => visits.filter (fun j => p ∈ physicalMarkedPrimes (labels j))) (fun p j => -(offset j : ZMod p.2.val)) (fun j => 1 - q j) = 0 := by rw [← physical_residue_vertex_expectation hP hprime] apply sum_eq_zero intro r _ rw [physical_residue_vertex_product_zero_of_incompatible labels visits offset q r (fun hr => h ⟨r, hr⟩), mul_zero] end Expectation end Bounty end section /- The actual finite residue path sum is supported on the residue assignments prescribed by every visited mark, with the original offsets. -/ open Finset open scoped Classical namespace Bounty section FinitePath variable {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} {patterns : Finset I} noncomputable def physicalFinitePathResidueCompatible (C : I → G → Finset (Fin J)) (k : ℕ → I → ℤ) (N : ℕ) (r : PhysicalResidues P) (L₀ : PhysicalMarkLists P J ell) (p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : Prop := physicalResiduePathCompatible (finitePathMarks L₀ p) (range (N + 2)) (physicalBareOffset C k (finitePathLabels p) (finitePathMarks L₀ p) (N + 1)) r omit [DecidableEq G] in theorem physical_finite_path_residue_compatible_iff (C : I → G → Finset (Fin J)) (k : ℕ → I → ℤ) (N : ℕ) (r : PhysicalResidues P) (L₀ : PhysicalMarkLists P J ell) (p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : physicalFinitePathResidueCompatible C k N r L₀ p ↔ ∀ j : Fin (N + 2), ∀ a ∈ physicalMarkedPrimes (finitePathMarks L₀ p j.val), r a = -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L₀ p) (N + 1) j.val : ZMod a.2.val) := by exact physical_residue_path_compatible_range_iff _ _ _ _ variable (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (N : ℕ) (r : PhysicalResidues P) (L₀ : PhysicalMarkLists P J ell) include hP hprime hq end FinitePath end Bounty end section /- Repeated physical lists in the flat group-slot coordinates of the asymmetric kernel. The shared set contains precisely the first-block slots outside the cut; all remaining coordinates retain their actual label law. -/ open Finset Classical namespace Bounty abbrev RepeatedBigFlatIndex (G : Type*) (J ell : ℕ) := Sigma (fun _ : G => PhysicalSlots J ell) def repeatedBigFlatEquiv {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) : RepeatedBigLists P J ell ≃ (∀ i : RepeatedBigFlatIndex G J ell, P i.1) := finiteGroupFlattenEquiv def repeatedBigFlatActive {G : Type*} [Fintype G] (J ell : ℕ) : Finset (RepeatedBigFlatIndex G J ell) := univ.sigma (fun _ => (univ : Finset (Fin J)).map Function.Embedding.inl) def repeatedBigFlatShared {G : Type*} [Fintype G] {J ell : ℕ} (C : G → Finset (Fin J)) : Finset (RepeatedBigFlatIndex G J ell) := univ.sigma (fun g => physicalSharedSlots (ell := ell) (C g)) theorem repeatedBigFlatActive_mem_inl {G : Type*} [Fintype G] (J ell : ℕ) (g : G) (j : Fin J) : (⟨g, Sum.inl j⟩ : RepeatedBigFlatIndex G J ell) ∈ repeatedBigFlatActive J ell := by simp [repeatedBigFlatActive] theorem repeatedBigFlatActive_not_mem_inr {G : Type*} [Fintype G] (J ell : ℕ) (g : G) (j : Fin ell) : (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ repeatedBigFlatActive J ell := by simp [repeatedBigFlatActive] section variable {G : Type*} [sharedInstance1 : Fintype G] {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) include G sharedInstance1 J ell C g theorem repeatedBigFlatShared_mem_iff (s : PhysicalSlots J ell) : (⟨g, s⟩ : RepeatedBigFlatIndex G J ell) ∈ repeatedBigFlatShared C ↔ ¬ repeatedBigUnshared C g s := by cases s <;> simp [repeatedBigFlatShared, physicalSharedSlots, repeatedBigUnshared] theorem repeatedBigFlatShared_mem_inl (j : Fin J) : (⟨g, Sum.inl j⟩ : RepeatedBigFlatIndex G J ell) ∈ repeatedBigFlatShared C ↔ j ∉ C g := by simp only [repeatedBigFlatShared_mem_iff, repeatedBigUnshared] theorem repeatedBigFlatShared_not_mem_inr (j : Fin ell) : (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ repeatedBigFlatShared C := by simp only [repeatedBigFlatShared_mem_iff, repeatedBigUnshared, not_true_eq_false, not_false_eq_true] end section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} include G sharedInstance1 P J ell theorem repeated_big_shared_compatible_flat (C : G → Finset (Fin J)) (source target : RepeatedBigLists P J ell) : repeatedBigSharedCompatible C source target ↔ finiteSharedCompatible (repeatedBigFlatShared C) (repeatedBigFlatEquiv P J ell source) (repeatedBigFlatEquiv P J ell target) := by constructor · intro h i hi rcases i with ⟨g, j | j⟩ · exact h g j ((repeatedBigFlatShared_mem_inl C g j).mp hi) · exact False.elim (repeatedBigFlatShared_not_mem_inr C g j hi) · intro h g j hj exact h ⟨g, Sum.inl j⟩ ((repeatedBigFlatShared_mem_inl C g j).mpr hj) theorem repeated_big_active_mass_flat_tilted (V : G → ℝ) (b : ∀ g, P g → ℝ) (source : RepeatedBigLists P J ell) : repeatedBigActiveMass V b source = finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => tiltedPhysicalBirthLaw V i.1 (b i.1)) (repeatedBigFlatEquiv P J ell source) := by exact (finite_product_weight_flatten (fun g => tiltedPhysicalBirthLaw V g (b g)) source).symm theorem repeated_big_active_mass_flat (V : G → ℝ) (source : RepeatedBigLists P J ell) : repeatedBigActiveMass V (fun _ _ => 1) source = finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1) (repeatedBigFlatEquiv P J ell source) := by have hlaw : (fun i : RepeatedBigFlatIndex G J ell => tiltedPhysicalBirthLaw (P := P) V i.1 (fun _ => 1)) = (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw (P := P) V i.1) := by funext i p exact div_one _ simpa only [hlaw] using repeated_big_active_mass_flat_tilted V (fun _ _ => 1) source end theorem repeated_big_target_mass_flat_tilted {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (target : RepeatedBigLists P J ell) : repeatedBigTargetMass V b C target = finiteFreshMass (fun i : RepeatedBigFlatIndex G J ell => tiltedPhysicalBirthLaw V i.1 (b i.1)) (repeatedBigFlatShared C) (repeatedBigFlatEquiv P J ell target) := by symm unfold finiteFreshMass have hset : (repeatedBigFlatShared (ell := ell) C)ᶜ = univ.sigma (fun g => univ.filter (repeatedBigUnshared (ell := ell) C g)) := by ext ⟨g, s⟩ simp [repeatedBigFlatShared_mem_iff] rw [hset, prod_sigma] unfold repeatedBigTargetMass apply prod_congr rfl intro g _ exact prod_subtype (univ.filter (repeatedBigUnshared C g)) (fun s => by simp) (fun s => tiltedPhysicalBirthLaw V g (b g) (target g s)) theorem repeated_big_target_mass_flat {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (target : RepeatedBigLists P J ell) : repeatedBigTargetMass V (fun _ _ => 1) C target = finiteFreshMass (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1) (repeatedBigFlatShared C) (repeatedBigFlatEquiv P J ell target) := by have hlaw : (fun i : RepeatedBigFlatIndex G J ell => tiltedPhysicalBirthLaw (P := P) V i.1 (fun _ => 1)) = (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw (P := P) V i.1) := by funext i p exact div_one _ simpa only [hlaw] using repeated_big_target_mass_flat_tilted V (fun _ _ => 1) C target theorem repeated_big_flat_shared_prod {G H : Type*} [Fintype G] [CommMonoid H] {J ell : ℕ} (C : G → Finset (Fin J)) (F : G → PhysicalSlots J ell → H) : (∏ g, ∏ j ∈ univ \ C g, F g (Sum.inl j)) = ∏ i : repeatedBigFlatShared (ell := ell) C, F i.val.1 i.val.2 := by refine Eq.trans ?_ (prod_coe_sort (repeatedBigFlatShared (ell := ell) C) (fun i : RepeatedBigFlatIndex G J ell => F i.1 i.2)).symm rw [repeatedBigFlatShared, prod_sigma] apply prod_congr rfl intro g _ exact (prod_map _ Function.Embedding.inl (F g)).symm theorem repeated_big_shared_label_product_flat {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (source : RepeatedBigLists P J ell) : (∏ g, ∏ j ∈ univ \ C g, (source g (Sum.inl j)).val) = ∏ i : repeatedBigFlatShared (ell := ell) C, (repeatedBigFlatEquiv P J ell source i.val).val := repeated_big_flat_shared_prod C (fun g s => (source g s).val) end Bounty end section /- Omitting a fixed prefix of pure Q bands costs only a fixed harmonic factor. -/ open Finset Filter open scoped Topology namespace Bounty theorem exists_candidate_micro_Q_harmonic_comparison {c : ℝ} (hc : 0 < c) (r J : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J ≤ jStar → candidateMicroQHarmonicMass c L r jStar J ≤ C * candidateQHarmonicMass c L r jStar := by obtain ⟨v, V, hv, _, hbands⟩ := exists_candidateQBands_bounds hc let u := min 1 (v^r / (r.factorial : ℝ)) have hu0 : 0 < u := lt_min (by norm_num) (by positivity) have hu1 : u ≤ 1 := min_le_left _ _ refine ⟨1/u^J, by positivity, ?_⟩ filter_upwards [hbands] with L hL intro jStar hjStar let S := (candidateQIndices c L).filter (fun j => j < J) have hcard : S.card ≤ J := by have hsub : S ⊆ range J := fun j hj => mem_range.mpr (mem_filter.mp hj).2 simpa only [card_range] using card_le_card hsub have hlocal : ∀ j ∈ S, u ≤ candidateQBandHarmonicFactor c L r jStar j := by intro j hj have hjs := (mem_filter.mp hj).2 have hjQ := (mem_filter.mp hj).1 rw [candidate_Q_band_factor_pure c L r jStar j (by omega)] apply (min_le_right _ _).trans exact div_le_div_of_nonneg_right (pow_le_pow_left₀ hv.le (hL.2.2 j hjQ).2.2.1 r) (Nat.cast_nonneg _) have hprefix : u^J ≤ ∏ j ∈ S, candidateQBandHarmonicFactor c L r jStar j := by calc _ ≤ u^S.card := pow_le_pow_of_le_one hu0.le hu1 hcard _ = ∏ _j ∈ S, u := (prod_const u).symm _ ≤ _ := Finset.prod_le_prod₀ (fun _ _ => hu0.le) hlocal have hmass := mul_le_mul_of_nonneg_right hprefix (candidate_micro_Q_harmonic_nonneg c L r jStar J) rw [show (∏ j ∈ S, candidateQBandHarmonicFactor c L r jStar j) * candidateMicroQHarmonicMass c L r jStar J = candidateQHarmonicMass c L r jStar from (candidate_Q_harmonic_split_micro c L r jStar J).symm] at hmass calc _ ≤ candidateQHarmonicMass c L r jStar / u^J := (le_div_iff₀ (pow_pos hu0 _)).mpr (by simpa only [mul_comm] using hmass) _ = _ := by ring end Bounty end section /- Actual microscopic Q-slot and P-mark assignments with full normalization. -/ open Finset Filter open scoped Topology namespace Bounty noncomputable def candidateMicroAssignmentChoices (c L : ℝ) (r jStar J : ℕ) : ((candidateMicroQIndices c L J) × Fin r) ⊕ (candidatePIndices c L) → Finset ℕ := Sum.elim (candidateMicroQSlotChoices c L r jStar J) (fun g => candidatePBand (c*L) g.val) noncomputable def candidateMicroAssignmentNormalization (c L : ℝ) (r J : ℕ) : ℝ := (r.factorial : ℝ)^(candidateMicroQIndices c L J).card * ∏ g ∈ candidatePIndices c L, ∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ) noncomputable def candidateMicroAssignmentWeight (c L : ℝ) (r jStar J n : ℕ) : ℝ := orderedSlotWeight (candidateMicroAssignmentChoices c L r jStar J) (candidateMicroAssignmentNormalization c L r J) n section variable (c L : ℝ) (r jStar J : ℕ) (hP : ∀ g ∈ candidatePIndices c L, (∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) ≠ 0) include c L r jStar J hP theorem candidate_micro_assignment_harmonic_eq : (∑' n : ℕ, candidateMicroAssignmentWeight c L r jStar J n / (n : ℝ)) = candidateMicroQHarmonicMass c L r jStar J := by classical have hprod : (∏ g ∈ candidatePIndices c L, ∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) ≠ 0 := prod_ne_zero_iff.mpr hP unfold candidateMicroAssignmentWeight candidateMicroQHarmonicMass candidateMicroQWeight rw [ordered_slot_harmonic_sum, ordered_slot_harmonic_sum, Fintype.prod_sum_type] simp only [candidateMicroAssignmentChoices, Sum.elim_inl, Sum.elim_inr, candidateMicroAssignmentNormalization] have hPprod : (∏ g : candidatePIndices c L, ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) = ∏ g ∈ candidatePIndices c L, ∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ) := prod_coe_sort (candidatePIndices c L) (fun g : ℕ => ∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) rw [hPprod] field_simp theorem candidate_micro_assignment_reciprocal_sum : (∑ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, (1 / candidateMicroAssignmentNormalization c L r J) / (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ)) = candidateMicroQHarmonicMass c L r jStar J := by classical rw [← candidate_micro_assignment_harmonic_eq c L r jStar J hP] unfold candidateMicroAssignmentWeight orderedSlotWeight simp only [Finset.sum_div] rw [Summable.tsum_finsetSum] · apply Finset.sum_congr (by ext; simp) intro x _ simp_rw [ite_div, zero_div] rw [tsum_ite_eq'] · intro x _ apply (hasSum_single (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x) ?_).summable intro n hn simp [Ne.symm hn] end theorem eventually_candidate_micro_assignment_normalization {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ r jStar J : ℕ, 0 < candidateMicroAssignmentNormalization c L r J ∧ (∑ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, (1 / candidateMicroAssignmentNormalization c L r J) / (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ)) = candidateMicroQHarmonicMass c L r jStar J := by obtain ⟨v, V, hv, _, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool] with L hL rcases hL with ⟨_, _, _, _, _, hdata⟩ have hP : ∀ g ∈ candidatePIndices c L, 0 < ∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ) := fun g hg => hv.trans_le (hdata g hg).1 intro r jStar J refine ⟨?_, candidate_micro_assignment_reciprocal_sum c L r jStar J (fun g hg => (hP g hg).ne')⟩ unfold candidateMicroAssignmentNormalization exact mul_pos (by positivity) (prod_pos hP) end Bounty end section /- Local birth data retain ghost residues and distinguish fresh edge labels. -/ open scoped Classical namespace Bounty abbrev FullMixedBornData {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) := ((g : Fin N) × UnrestrictedResidueParticle (n g)) ⊕ ((g : Fin N) × P g) def fullMixedBornPrime {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) : FullMixedBornData n → ((g : Fin N) × P g) | .inl d => ⟨d.1, d.2.1⟩ | .inr d => d section Events variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) noncomputable def fullMixedEventBornData : (tag : Option (J ⊕ K)) → (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullPermutationMixedEvent n S B A Δ D tag s → FullMixedLocalBirthAddress S B tag → Option (FullMixedBornData n) | none, _, _, a => Fin.elim0 a.2 | some (.inl _), _, e, ⟨g, i⟩ => if h : i.val < (e.down g).1.val then some (.inl ⟨g, (e.down g).2.2 ⟨i.val, h⟩⟩) else none | some (.inr _), _, e, ⟨g, i⟩ => if h : i ∈ (e.2 g).2.1 then none else some (.inr ⟨g, (e.2 g).2.2.2 ⟨i, h⟩⟩) noncomputable def fullMixedEventBirthLabel (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) (a : FullMixedLocalBirthAddress S B tag) : Option ((g : Fin N) × P g) := (fullMixedEventBornData n S B A Δ D tag s e a).map (fullMixedBornPrime n) noncomputable def fullMixedEventBirthPerformed (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) (a : FullMixedLocalBirthAddress S B tag) : Prop := (fullMixedEventBornData n S B A Δ D tag s e a).isSome = true theorem full_mixed_ghost_born_data (j : J) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s) (g : Fin N) (i : Fin B) (hi : i.val < (e.down g).1.val) : fullMixedEventBornData n S B A Δ D (some (.inl j)) s e ⟨g, i⟩ = some (.inl ⟨g, (e.down g).2.2 ⟨i.val, hi⟩⟩) := by simp only [fullMixedEventBornData, dif_pos hi] theorem full_mixed_ghost_birth_performed_iff (j : J) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s) (g : Fin N) (i : Fin B) : fullMixedEventBirthPerformed n S B A Δ D (some (.inl j)) s e ⟨g, i⟩ ↔ i.val < (e.down g).1.val := by simp only [fullMixedEventBirthPerformed, fullMixedEventBornData] split_ifs <;> simp_all theorem full_mixed_edge_born_data (k : K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent (J := J) n S B A Δ D (some (.inr k)) s) (g : Fin N) (i : Fin (S k g)ᶜ.card) (hi : i ∉ (e.2 g).2.1) : fullMixedEventBornData n S B A Δ D (some (.inr k)) s e ⟨g, i⟩ = some (.inr ⟨g, (e.2 g).2.2.2 ⟨i, hi⟩⟩) := by simp only [fullMixedEventBornData] split_ifs with h · exact (hi h).elim · rfl theorem full_mixed_edge_birth_performed_iff (k : K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent (J := J) n S B A Δ D (some (.inr k)) s) (g : Fin N) (i : Fin (S k g)ᶜ.card) : fullMixedEventBirthPerformed n S B A Δ D (some (.inr k)) s e ⟨g, i⟩ ↔ i ∉ (e.2 g).2.1 := by simp only [fullMixedEventBirthPerformed, fullMixedEventBornData] split_ifs with h · constructor · intro hf cases hf · intro hn exact (hn h).elim · constructor · intro _ exact h · intro _ rfl end Events end Bounty end section /- Removing the deterministic ledger preserves every owning full event. -/ namespace Bounty theorem finite_ledger_event_path_occurrence {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) (steps : List K) (l : L) (x : X) (p : FiniteEventPath (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) steps (l, x)) (i : Fin steps.length) : (let e := finiteEventPathOccurrence (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) steps (l, x) p i (⟨e.1.2, e.2⟩ : Σ y, E (steps.get i) y)) = finiteEventPathOccurrence E target steps x (finiteLedgerEventPathEquiv E target update steps l x p) i := by induction steps generalizing l x with | nil => exact Fin.elim0 i | cons k steps ih => rcases p with ⟨e, p⟩ refine Fin.cases ?_ (fun j => ?_) i · rfl · exact ih (update k l x e) (target k x e) p j end Bounty end section /- Kernel pairings give the projected norm of the literal finite row action. -/ open Finset open scoped Classical namespace Bounty theorem clean_kernel_pairing_sub_kernel {X Y : Type*} [Fintype X] [Fintype Y] (w : X → ℝ) (K H : X → Y → ℂ) (f : X → ℂ) (g : Y → ℂ) : cleanKernelPairing w (K - H) f g = cleanKernelPairing w K f g - cleanKernelPairing w H f g := by simp only [cleanKernelPairing, Pi.sub_apply, mul_sub, sub_mul, sum_sub_distrib] theorem clean_kernel_pairing_row_action {X Y : Type*} [Fintype X] [Fintype Y] (w : X → ℝ) (K : X → Y → ℂ) (f : X → ℂ) (g : Y → ℂ) : cleanKernelPairing w K f g = ∑ x, (w x : ℂ) * (starRingEnd ℂ) (f x) * (∑ y, K x y * g y) := by simp only [cleanKernelPairing, mul_sum, mul_assoc] theorem repeated_big_kernel_norm_le_of_bilinear {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 ≤ V g) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → ℂ) {M : ℝ} (hM : 0 ≤ M) (hpair : ∀ f v : RepeatedBigLists P J ell → ℂ, f ∈ repeatedBigSymmetricSubspace → v ∈ repeatedBigSymmetricSubspace → ‖cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) K f v‖ ≤ M * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) v) (v : RepeatedBigLists P J ell → ℂ) (hv : v ∈ repeatedBigSymmetricSubspace) : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigSymmetrizeLinear (fun x => ∑ y, K x y * v y)) ≤ M * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) v := by apply repeated_big_untilted_operator_norm_le_of_symmetric_pairing V hV _ hM _ v hv intro f g hf hg rw [← clean_kernel_pairing_row_action] exact hpair f g hf hg end Bounty end section /- A chronological finite enumeration of the existing potential birth addresses. -/ namespace Bounty variable {J K : Type*} {N : ℕ} {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (steps : List (Option (J ⊕ K))) abbrev FullMixedBirthLexAddress := Lex ((i : Fin steps.length) × Lex ((g : Fin N) × Fin (fullMixedBirthCapacity S B (steps.get i) g))) def fullMixedBirthLexEquiv : FullMixedBirthLexAddress S B steps ≃ FullMixedBirthAddress S B steps where toFun a := ⟨(ofLex a).1, ofLex (ofLex a).2⟩ invFun a := toLex ⟨a.1, toLex a.2⟩ left_inv _ := rfl right_inv _ := rfl noncomputable def fullMixedBirthOrder : Fin (Fintype.card (FullMixedBirthAddress S B steps)) ≃ FullMixedBirthAddress S B steps := (Fintype.orderIsoFinOfCardEq (FullMixedBirthLexAddress S B steps) (Fintype.card_congr (fullMixedBirthLexEquiv S B steps))).toEquiv.trans (fullMixedBirthLexEquiv S B steps) end Bounty end section /- Exact cumulative ledger unions along the existing finite dependent paths. -/ open Finset namespace Bounty section Paths variable {K X Q : Type*} [DecidableEq Q] (E : K → X → Type*) (target : ∀ k x, E k x → X) (ledger : X → Finset Q) (birth : ∀ k x, E k x → Finset Q) noncomputable def finiteEventPathPriorBirths (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (cut : ℕ) : Finset Q := Finset.univ.biUnion fun i : Fin steps.length => if i.val < cut then let e := finiteEventPathOccurrence E target steps x p i birth (steps.get i) e.1 e.2 else ∅ theorem mem_finite_event_path_prior_births (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (cut : ℕ) (q : Q) : q ∈ finiteEventPathPriorBirths E target birth steps x p cut ↔ ∃ i : Fin steps.length, i.val < cut ∧ q ∈ birth (steps.get i) (finiteEventPathOccurrence E target steps x p i).1 (finiteEventPathOccurrence E target steps x p i).2 := by classical simp only [finiteEventPathPriorBirths, mem_biUnion, mem_univ, true_and] apply exists_congr intro i split_ifs <;> simp_all theorem finite_event_path_ledger_mem_before (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (hstep : ∀ i : Fin steps.length, let e := finiteEventPathOccurrence E target steps x p i ledger (target (steps.get i) e.1 e.2) = ledger e.1 ∪ birth (steps.get i) e.1 e.2) (i : Fin steps.length) (q : Q) : q ∈ ledger (finiteEventPathOccurrence E target steps x p i).1 ↔ q ∈ ledger x ∨ ∃ j : Fin steps.length, j.val < i.val ∧ q ∈ birth (steps.get j) (finiteEventPathOccurrence E target steps x p j).1 (finiteEventPathOccurrence E target steps x p j).2 := by induction steps generalizing x with | nil => exact Fin.elim0 i | cons k steps ih => rcases p with ⟨e, p⟩ refine Fin.cases ?_ (fun j => ?_) i · change q ∈ ledger x ↔ _ simp only [Fin.val_zero, not_lt_zero, false_and, exists_false, or_false] · have hs : ∀ r : Fin steps.length, let e' := finiteEventPathOccurrence E target steps (target k x e) p r ledger (target (steps.get r) e'.1 e'.2) = ledger e'.1 ∪ birth (steps.get r) e'.1 e'.2 := fun r => hstep r.succ have h0 : ledger (target k x e) = ledger x ∪ birth k x e := hstep 0 change q ∈ ledger (finiteEventPathOccurrence E target steps (target k x e) p j).1 ↔ _ rw [ih _ p hs j, h0, mem_union] constructor · rintro ((hx | hb) | ⟨r, hr, hb⟩) · exact Or.inl hx · exact Or.inr ⟨0, Nat.zero_lt_succ _, hb⟩ · exact Or.inr ⟨r.succ, Nat.succ_lt_succ hr, hb⟩ · rintro (hx | ⟨r, hr, hb⟩) · exact Or.inl (Or.inl hx) · revert hr hb refine Fin.cases ?_ (fun r => ?_) r · intro _ hb exact Or.inl (Or.inr hb) · intro hr hb exact Or.inr ⟨r, Nat.lt_of_succ_lt_succ hr, hb⟩ theorem finite_event_path_ledger_union_before (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (hstep : ∀ i : Fin steps.length, let e := finiteEventPathOccurrence E target steps x p i ledger (target (steps.get i) e.1 e.2) = ledger e.1 ∪ birth (steps.get i) e.1 e.2) (i : Fin steps.length) : ledger (finiteEventPathOccurrence E target steps x p i).1 = ledger x ∪ finiteEventPathPriorBirths E target birth steps x p i.val := by ext q rw [mem_union, mem_finite_event_path_prior_births] exact finite_event_path_ledger_mem_before E target ledger birth steps x p hstep i q end Paths end Bounty end section /- Active labels and pending particles remain covered by the deterministic ledger. -/ open Finset open scoped Classical namespace Bounty def BoundedResidueLedgerCovers {P : Type*} (n : P → ℕ) {t B : ℕ} (H : Finset P) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : Prop := (∀ i, s.1 i ∈ H) ∧ ∀ i, (s.2.2 i).1 ∈ H theorem retained_birth_tuple_all {Z : Type*} {N b : ℕ} (Q : Z → Prop) (old : Fin N → Z) (retained : Finset (Fin N)) (fresh : Fin b → Z) (hold : ∀ i, Q (old i)) (hfresh : ∀ i, Q (fresh i)) : ∀ i, Q ((retainedBirthTuple old retained fresh).2 i) := by dsimp only [retainedBirthTuple] intro i refine Fin.addCases ?_ ?_ i · intro j rw [Fin.addCases_left] exact hold (retained.equivFin.symm j).val · intro j rw [Fin.addCases_right] exact hfresh j theorem unrestricted_residue_output_labels_mem {P : Type*} {N t : ℕ} (n : P → ℕ) (H : Finset P) (source : Fin t → P) (old : Fin N → UnrestrictedResidueParticle n) (Δ : ℤ) (stores promotions : Finset (Fin t)) {eligible : Finset (Fin N)} (e : promotions ↪ ↥eligible) (hsource : ∀ i, source i ∈ H) (hold : ∀ i, (old i).1 ∈ H) : ∀ i, ((unrestrictedEdgeOutput source old (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) stores promotions e).2 i).1 ∈ H := by apply retained_birth_tuple_all (fun z : UnrestrictedResidueParticle n => z.1 ∈ H) · intro i exact hold i · intro i exact hsource (stores.equivFin.symm i).val theorem bounded_ghost_ledger_target_covers {P : Type*} [DecidableEq P] (n : P → ℕ) (t B : ℕ) (H : Finset P) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : BoundedGhostEvent t B s) (hs : BoundedResidueLedgerCovers n H s) : BoundedResidueLedgerCovers n (boundedGhostLedgerTarget n t B (H, s) e).1 (boundedGhostLedgerTarget n t B (H, s) e).2 := by change BoundedResidueLedgerCovers n (H ∪ univ.image (fun j => (e.2.2 j).1)) (boundedGhostEventTarget t B s e) unfold boundedGhostEventTarget dsimp only split_ifs · constructor · intro i exact mem_union_left _ (hs.1 i) · apply retained_birth_tuple_all (fun z : UnrestrictedResidueParticle n => z.1 ∈ H ∪ univ.image (fun j => (e.2.2 j).1)) · intro i exact mem_union_left _ (hs.2 i) · intro i exact mem_union_right _ (mem_image_of_mem _ (mem_univ i)) · constructor · intro i exact mem_union_left _ (hs.1 i) · intro i exact mem_union_left _ (hs.2 i) theorem bounded_edge_ledger_target_covers {P : Type*} [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (H : Finset P) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) (hs : BoundedResidueLedgerCovers n H s) : BoundedResidueLedgerCovers n (H ∪ univ.image (unrestrictedBoundedEventTarget n Δ D t B s e).1) (unrestrictedBoundedEventTarget n Δ D t B s e) := by unfold unrestrictedBoundedEventTarget dsimp only split_ifs · constructor · intro i exact mem_union_right _ (mem_image_of_mem _ (mem_univ i)) · intro i apply mem_union_left exact unrestricted_residue_output_labels_mem n H s.1 s.2.2 Δ e.1 e.2.1 e.2.2.1 hs.1 hs.2 i · constructor · intro i exact mem_union_left _ (hs.1 i) · intro i exact mem_union_left _ (hs.2 i) end Bounty end section /- A nonzero original path coefficient has nonzero coefficient at every occurrence. -/ namespace Bounty theorem finite_event_path_occurrence_weight_ne_zero {K X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (hp : finiteEventPathWeight E target w steps x p ≠ 0) (i : Fin steps.length) : w (steps.get i) (finiteEventPathOccurrence E target steps x p i).1 (finiteEventPathOccurrence E target steps x p i).2 ≠ 0 := by induction steps generalizing x with | nil => exact Fin.elim0 i | cons k steps ih => rcases p with ⟨e, p⟩ have h : w k x e ≠ 0 ∧ finiteEventPathWeight E target w steps (target k x e) p ≠ 0 := mul_ne_zero_iff.mp hp refine Fin.cases ?_ (fun j => ?_) i · exact h.1 · exact ih (target k x e) p h.2 j end Bounty end section /- The exact endpoint baseline gives a positive tilted law of mass at most two. -/ open Finset namespace Bounty section Law variable {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (q : ℝ) (edges : ℕ) theorem physical_endpoint_beta_law (g : G) (p : P g) : ((p.val : ℝ) * physicalEndpointBaseline q edges p.val)⁻¹ / V g = tiltedPhysicalBirthLaw V g (fun p => physicalEndpointBaseline q edges p.val) p := by unfold tiltedPhysicalBirthLaw physicalLabelLaw simp only [div_eq_mul_inv, mul_inv_rev] ring theorem physical_endpoint_beta_pos (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (g : G) (hV : 0 < V g) (p : P g) (hp : 0 < p.val) (hsize : 2 * (edges + 1) ≤ p.val) : 0 < ((p.val : ℝ) * physicalEndpointBaseline q edges p.val)⁻¹ / V g := by exact div_pos (inv_pos.mpr (mul_pos (by exact_mod_cast hp) (physical_endpoint_baseline_pos hq0 hq1 edges p.val hp hsize))) hV theorem physical_endpoint_beta_mass_bounds (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (g : G) (hV : 0 < V g) (hMass : ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hp : ∀ p : P g, 0 < p.val) (hsize : ∀ p : P g, 2 * (edges + 1) ≤ p.val) : 1 ≤ ∑ p : P g, ((p.val : ℝ) * physicalEndpointBaseline q edges p.val)⁻¹ / V g ∧ (∑ p : P g, ((p.val : ℝ) * physicalEndpointBaseline q edges p.val)⁻¹ / V g) ≤ 2 := by simp_rw [physical_endpoint_beta_law] exact tiltedPhysicalBirthLaw_sum_bounds V g _ hV hMass (fun p => physical_endpoint_baseline_bounds hq0 hq1 edges p.val (hp p) (hsize p)) end Law end Bounty end section /- Fixed probe-size choices for the positive-block local estimate. The probe size is selected before the accuracy and active-slot parameters. -/ open Filter namespace Bounty /- Any positive logarithmic block density permits a fixed probe size with an arbitrarily large power saving, provided the tail length is positive. -/ theorem exists_repeated_big_probe_parameter (ell : ℕ) (hell : 1 ≤ ell) {beta E : ℝ} (hbeta : 0 < beta) (hE : 0 ≤ E) : ∃ m : ℕ, ell ≤ m ∧ 0 < (ell : ℝ) ^ ell / (m : ℝ) ^ ell ∧ (ell : ℝ) ^ ell / (m : ℝ) ^ ell ≤ 1 ∧ beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 1) := by let delta := Real.exp (-(2 * (E + 1) / beta)) have hd0 : 0 < delta := Real.exp_pos _ have hd1 : delta ≤ 1 := Real.exp_le_one_iff.mpr (by apply neg_nonpos.mpr; positivity) obtain ⟨m, hm⟩ := exists_nat_gt ((ell : ℝ) / delta) have he1 : (1 : ℝ) ≤ ell := by exact_mod_cast hell have he0 : (0 : ℝ) < ell := lt_of_lt_of_le zero_lt_one he1 have hem : (ell : ℝ) ≤ m := by apply le_trans _ hm.le exact (le_div_iff₀ hd0).mpr (by nlinarith) have hm0 : (0 : ℝ) < m := he0.trans_le hem have hr0 : 0 < (ell : ℝ) / m := div_pos he0 hm0 have hr1 : (ell : ℝ) / m ≤ delta := by apply (div_le_iff₀ hm0).mpr have hh := (div_lt_iff₀ hd0).mp hm nlinarith have hr2 : (ell : ℝ) / m ≤ 1 := hr1.trans hd1 have hlog : Real.log ((ell : ℝ) / m) ≤ -(2 * (E + 1) / beta) := by have hh := Real.log_le_log hr0 hr1 simpa only [delta, Real.log_exp] using hh have hlog0 : Real.log ((ell : ℝ) / m) ≤ 0 := Real.log_nonpos hr0.le hr2 refine ⟨m, by exact_mod_cast hem, by positivity, ?_, ?_⟩ · rw [← div_pow] exact pow_le_one₀ hr0.le hr2 · rw [← div_pow, Real.log_pow] have hh : (ell : ℝ) * Real.log ((ell : ℝ) / m) ≤ Real.log ((ell : ℝ) / m) := by nlinarith have hb := mul_le_mul_of_nonneg_left (hh.trans hlog) hbeta.le have heq : beta * (-(2 * (E + 1) / beta)) = -2 * (E + 1) := by field_simp rw [heq] at hb linarith /- The density deficit is at most one per visit. In particular the manuscript path length `2 * ceil (L ^ (13/25))` gives a density loss at most `L` eventually. -/ theorem eventually_repeated_big_visit_density_le {alpha tau : ℝ} (htau : 0 < tau) (hgap : alpha < tau) : ∀ᶠ L : ℝ in atTop, ∀ T : ℝ, T ≤ 2 * (⌈L ^ alpha⌉₊ : ℝ) + 1 → T ≤ L ^ tau := by filter_upwards [eventually_mul_rpow_add_le_mul_rpow htau hgap (show (0 : ℝ) < 1 by norm_num) 2 3, eventually_gt_atTop (0 : ℝ)] with L h hL intro T hT have hceil := Nat.ceil_lt_add_one (Real.rpow_nonneg hL.le alpha) nlinarith end Bounty end section /- Full active-slot averaging is exactly the existing repeated-list projection in every ordered memory fiber. No memory labels are averaged away or conditioned out by this identity. -/ open Finset open scoped Classical namespace Bounty def cleanFullSlotPermutationEquiv {G : Type*} (J ell : ℕ) : PhysicalPermutations G J ell ≃ FullActiveSlotPermutations (fun _ : G => J + ell) := Equiv.piCongrRight (fun _ => Equiv.permCongr finSumFinEquiv) theorem clean_full_memory_permutation {G : Type*} {P : G → Finset ℕ} {J ell B : ℕ} (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) (σ : PhysicalPermutations G J ell) : fullActivePermutation (cleanFullSlotPermutationEquiv J ell σ) (cleanFullMemoryState N p source r) = cleanFullMemoryState N p (repeatedBigPermutationEquiv σ source) r := by funext g apply Prod.ext · funext j simp only [fullActivePermutation, Equiv.coe_fn_mk, cleanFullMemoryState, Function.comp_apply, cleanFullSlotPermutationEquiv, Equiv.piCongrRight_apply, Pi.map, Equiv.permCongr_apply, Equiv.symm_apply_apply, repeatedBigPermutationEquiv] · rfl theorem clean_full_memory_active_average {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell B : ℕ} (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (f : CleanFullMemoryState P J ell B → ℂ) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) : fullActiveAverage f (cleanFullMemoryState N p source r) = repeatedBigSymmetrizeLinear (fun target => f (cleanFullMemoryState N p target r)) source := by have hs := (cleanFullSlotPermutationEquiv (G := G) J ell).sum_comp (fun τ => (fullActivePermutationWeight (fun _ : G => J + ell) τ : ℂ) * f (fullActivePermutation τ (cleanFullMemoryState N p source r))) unfold fullActiveAverage rw [← hs] simp only [clean_full_memory_permutation, fullActivePermutationWeight, Complex.ofReal_inv, Complex.ofReal_natCast] rw [← mul_sum] change _ = (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * _ rw [Fintype.card_congr (cleanFullSlotPermutationEquiv (G := G) J ell)] end Bounty end section /- Exact separation of the full Q-list into retained and omitted bands. -/ open Finset namespace Bounty noncomputable def candidateMacroQIndices (c L : ℝ) (J : ℕ) : Finset ℕ := (candidateQIndices c L).filter (fun j => j < J) noncomputable def candidateQIndexSplit (c L : ℝ) (J : ℕ) : (candidateMicroQIndices c L J) ⊕ (candidateMacroQIndices c L J) ≃ candidateQIndices c L := by unfold candidateMicroQIndices candidateMacroQIndices apply Equiv.ofBijective (Sum.elim (fun j => ⟨j.val, (mem_filter.mp j.property).1⟩) (fun j => ⟨j.val, (mem_filter.mp j.property).1⟩)) constructor · intro a b hab have hv := congrArg Subtype.val hab cases a with | inl a => cases b with | inl b => exact congrArg Sum.inl (Subtype.ext hv) | inr b => have ha := (mem_filter.mp a.property).2 have hb := (mem_filter.mp b.property).2 change a.val = b.val at hv omega | inr a => cases b with | inl b => have ha := (mem_filter.mp a.property).2 have hb := (mem_filter.mp b.property).2 change a.val = b.val at hv omega | inr b => exact congrArg Sum.inr (Subtype.ext hv) · intro j by_cases h : J ≤ j.val · exact ⟨Sum.inl ⟨j.val, mem_filter.mpr ⟨j.property, h⟩⟩, rfl⟩ · exact ⟨Sum.inr ⟨j.val, mem_filter.mpr ⟨j.property, Nat.lt_of_not_ge h⟩⟩, rfl⟩ noncomputable def candidateQSlotSplit (c L : ℝ) (r J : ℕ) : ((candidateMicroQIndices c L J) × Fin r) ⊕ ((candidateMacroQIndices c L J) × Fin r) ≃ (candidateQIndices c L) × Fin r := (Equiv.sumProdDistrib _ _ _).symm.trans (Equiv.prodCongr (candidateQIndexSplit c L J) (Equiv.refl _)) theorem candidate_Q_choices_split (c L : ℝ) (r jStar J : ℕ) (hJ : J ≤ jStar) : (fun i => candidateQSlotChoices c L r jStar (candidateQSlotSplit c L r J i)) = Sum.elim (candidateMicroQSlotChoices c L r jStar J) (fun i : (candidateMacroQIndices c L J) × Fin r => candidateQBand (c*L) i.1.val) := by funext i cases i with | inl i => rfl | inr i => have hlt := (mem_filter.mp i.1.property).2 have hne : i.1.val ≠ jStar := by omega change (if i.1.val = jStar ∧ i.2.val = 0 then _ else _) = _ rw [if_neg (fun h => hne h.1)] rfl theorem candidate_Q_normalization_split (c L : ℝ) (r J : ℕ) : (r.factorial : ℝ)^(candidateQIndices c L).card = (r.factorial : ℝ)^(candidateMicroQIndices c L J).card * (r.factorial : ℝ)^(candidateMacroQIndices c L J).card := by have hcard := Fintype.card_congr (candidateQIndexSplit c L J) simp only [Fintype.card_sum, Fintype.card_coe] at hcard rw [← pow_add, hcard] end Bounty end section /- Dropping a normalized product fiber while retaining forced conditions. -/ open Finset namespace Bounty theorem ordered_slot_left_product_sum {I : Type*} [Fintype I] [DecidableEq I] (B : I → Finset ℕ) (α β : ℝ) {d : ℕ} (hd : 0 < d) (n : ℕ) : (∑ y : ∀ i, B i, if d * orderedSlotProduct B y = n then 1/(α*β) else 0) = if d ∣ n then (1/α) * orderedSlotWeight B β (n/d) else 0 := by classical by_cases hdn : d ∣ n · rw [if_pos hdn, orderedSlotWeight, mul_sum] apply sum_congr (by ext; simp) intro y _ have hi : d * orderedSlotProduct B y = n ↔ orderedSlotProduct B y = n/d := by constructor · intro h rw [← h, Nat.mul_div_cancel_left _ hd] · intro h rw [h, Nat.mul_div_cancel' hdn] by_cases h : d * orderedSlotProduct B y = n · rw [if_pos h, if_pos (hi.mp h), one_div_mul_one_div] · rw [if_neg h, if_neg (fun he => h (hi.mpr he)), mul_zero] · rw [if_neg hdn] apply sum_eq_zero intro y _ exact if_neg (fun h => hdn ⟨orderedSlotProduct B y, h.symm⟩) theorem ordered_slot_split_majorant {I J : Type*} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] (A : I → Finset ℕ) (B : J → Finset ℕ) {α β : ℝ} (hα : 0 ≤ α) (hA : ∀ x : ∀ i, A i, 0 < orderedSlotProduct A x) (hB : ∀ n, orderedSlotWeight B β n ≤ 1) (n : ℕ) (R : (∀ i, A i) → Prop) [DecidablePred R] (hR : ∀ x y, orderedSlotProduct A x * orderedSlotProduct B y = n → R x) : orderedSlotWeight (Sum.elim A B) (α*β) n ≤ ∑ x : ∀ i, A i, if orderedSlotProduct A x ∣ n ∧ R x then 1/α else 0 := by classical rw [ordered_slot_weight_sum_split] apply sum_le_sum intro x _ by_cases hx : orderedSlotProduct A x ∣ n ∧ R x · rw [if_pos hx, ordered_slot_left_product_sum B α β (hA x), if_pos hx.1] exact (mul_le_mul_of_nonneg_left (hB _) (by positivity)).trans_eq (mul_one _) · rw [if_neg hx] apply le_of_eq apply sum_eq_zero intro y _ apply if_neg intro h exact hx ⟨⟨orderedSlotProduct B y, h.symm⟩, hR x y h⟩ end Bounty end section /- Distinct chosen marks leave exactly the unmarked prime-divisor exponent. -/ open Finset namespace Bounty noncomputable def chosenMarkSet {G : Type*} [Fintype G] (P : G → Finset ℕ) (x : ∀ g, P g) : Finset ℕ := univ.image (fun g => (x g).val) noncomputable def unmarkedDivisorSet {G : Type*} [Fintype G] (P : G → Finset ℕ) (x : ∀ g, P g) (u : ℕ) : Finset ℕ := ((univ.biUnion P).filter (fun p => p ∣ u)) \ chosenMarkSet P x section variable {G : Type*} [sharedInstance1 : Fintype G] (P : G → Finset ℕ) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : ∀ g, P g) include G sharedInstance1 P hdisj x theorem chosen_mark_injective : Function.Injective (fun g => (x g).val) := by intro g h heq change (x g).val = (x h).val at heq by_contra hne exact disjoint_left.mp (hdisj hne) (x g).property (by rw [heq]; exact (x h).property) theorem chosen_mark_card : (chosenMarkSet P x).card = Fintype.card G := by rw [chosenMarkSet, card_image_of_injective _ (chosen_mark_injective P hdisj x), card_univ] theorem unmarked_divisor_card (u : ℕ) (hx : ∀ g, (x g).val ∣ u) : (unmarkedDivisorSet P x u).card = ∑ g, (((P g).filter (fun p => p ∣ u)).card - 1) := by classical have hsub : chosenMarkSet P x ⊆ (univ.biUnion P).filter (fun p => p ∣ u) := by intro p hp obtain ⟨g, _, rfl⟩ := mem_image.mp hp exact mem_filter.mpr ⟨mem_biUnion.mpr ⟨g, mem_univ _, (x g).property⟩, hx g⟩ have hcard : ((univ.biUnion P).filter (fun p => p ∣ u)).card = ∑ g, ((P g).filter (fun p => p ∣ u)).card := by rw [filter_biUnion] apply card_biUnion intro g _ h _ hne exact (hdisj hne).mono (filter_subset _ _) (filter_subset _ _) rw [unmarkedDivisorSet, card_sdiff_of_subset hsub, hcard, chosen_mark_card P hdisj x] have hone : ∀ g ∈ (univ : Finset G), 1 ≤ ((P g).filter (fun p => p ∣ u)).card := by intro g _ exact card_pos.mpr ⟨(x g).val, mem_filter.mpr ⟨(x g).property, hx g⟩⟩ rw [sum_tsub_distrib univ hone] simp only [sum_const, card_univ, smul_eq_mul, mul_one] theorem one_mark_choice_product (q : ℝ) (V : G → ℝ) (u : ℕ) : (∏ g, if (x g).val ∣ u then q^(((P g).filter (fun p => p ∣ u)).card - 1)/V g else 0) = if ∀ g, (x g).val ∣ u then q^(unmarkedDivisorSet P x u).card / (∏ g, V g) else 0 := by classical by_cases hx : ∀ g, (x g).val ∣ u · rw [if_pos hx] simp_rw [if_pos (hx _)] rw [prod_div_distrib, prod_pow_eq_pow_sum, unmarked_divisor_card P hdisj x u hx] · rw [if_neg hx] obtain ⟨g, hg⟩ := not_forall.mp hx exact prod_eq_zero (mem_univ g) (if_neg hg) end theorem one_marked_weight_unmarked_sum {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (hdisj : Pairwise (fun g h : groups => Disjoint (P g.val) (P h.val))) (u : ℕ) : markedDivisorWeight groups P q V (fun _ => 1) (u : ℤ) = ∑ x : ∀ g : groups, P g.val, if ∀ g, (x g).val ∣ u then q^(unmarkedDivisorSet (fun g : groups => P g.val) x u).card / (∏ g ∈ groups, V g) else 0 := by classical rw [one_marked_weight_choice_sum] apply sum_congr (by ext; simp) intro x _ have hOmega (g : G) : physicalOmega P g (u : ℤ) = ((P g).filter (fun p => p ∣ u)).card := by simp only [physicalOmega, physicalDivisorPool, Int.natCast_dvd_natCast] simp_rw [hOmega, Int.natCast_dvd_natCast] rw [one_mark_choice_product (fun g : groups => P g.val) hdisj x q (fun g => V g.val) u] rw [prod_coe_sort groups V] end Bounty end section /- The actual ghost birth factor selects one residue per prime and retains its V factor. -/ open Finset Classical namespace Bounty noncomputable def physicalGhostBirthAtom {P : Type*} (n : P → ℕ) (μ : P → ℝ) (q ρ V : ℝ) (z : UnrestrictedResidueParticle n) : ℝ := |physicalGhostBirth n q ρ V z| * unrestrictedResidueWeight μ z theorem physical_ghost_birth_atom_nonneg {P : Type*} (n : P → ℕ) (μ : P → ℝ) (q ρ V : ℝ) (hμ : ∀ p, 0 ≤ μ p) (z : UnrestrictedResidueParticle n) : 0 ≤ physicalGhostBirthAtom n μ q ρ V z := mul_nonneg (abs_nonneg _) (hμ z.1) theorem physical_ghost_birth_atom_residue_sum {P : Type*} (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (q ρ V : ℝ) (p : P) : (∑ r : ZMod (n p), physicalGhostBirthAtom n μ q ρ V ⟨p, r⟩) = |(1 - q) * V / ρ| * μ p := by rw [sum_eq_single (0 : ZMod (n p))] · simp [physicalGhostBirthAtom, physicalGhostBirth, unrestrictedResidueHit, unrestrictedResidueWeight] · intro r _ hr simp [physicalGhostBirthAtom, physicalGhostBirth, unrestrictedResidueHit, hr] · simp theorem physical_ghost_birth_atom_prime_sum {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (q ρ V : ℝ) (p : P) : (∑ z : UnrestrictedResidueParticle n, if z.1 = p then physicalGhostBirthAtom n μ q ρ V z else 0) = |(1 - q) * V / ρ| * μ p := by rw [Fintype.sum_sigma, sum_eq_single p] · simp only [ite_true] exact physical_ghost_birth_atom_residue_sum n μ q ρ V p · intro a _ ha simp only [ha, if_false, sum_const_zero] · simp theorem physical_ghost_birth_atom_total {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (q ρ V : ℝ) : (∑ z : UnrestrictedResidueParticle n, physicalGhostBirthAtom n μ q ρ V z) = |(1 - q) * V / ρ| * ∑ p, μ p := by rw [Fintype.sum_sigma] simp_rw [physical_ghost_birth_atom_residue_sum] exact (mul_sum _ _ _).symm theorem physical_ghost_birth_atom_tagged_sum {G : Type*} {P : G → Type*} (g : G) [Fintype (P g)] (n : P g → ℕ) [∀ p, NeZero (n p)] (μ : P g → ℝ) (q ρ V : ℝ) (p : P g) : (∑ z : UnrestrictedResidueParticle n, if (⟨g, z.1⟩ : Sigma P) = ⟨g, p⟩ then physicalGhostBirthAtom n μ q ρ V z else 0) = |(1 - q) * V / ρ| * μ p := by simpa only [Sigma.mk.inj_iff, heq_eq_eq, true_and] using physical_ghost_birth_atom_prime_sum n μ q ρ V p end Bounty end section /- The physical edge retains its exact admissibility mask after ledger separation. -/ open scoped Classical namespace Bounty section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L R : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) theorem physical_full_edge_phase_avoidance_factor : physicalFullEdgePhase C k L R H q e = (if ∀ g i, (e.2 g).2.2.2 i ∉ H g then 1 else 0) * physicalFullEdgePhase C k L R (fun _ => ∅) q e := by unfold physicalFullEdgePhase by_cases h : physicalListAdmissible C e.1 L R · rw [if_pos h, if_pos h] exact full_edge_ledger_phase_factor _ _ _ _ _ _ _ _ _ _ · rw [if_neg h, if_neg h, mul_zero] theorem physical_full_edge_phase_fresh_injective (hphase : physicalFullEdgePhase C k L R H q e ≠ 0) (g : Fin N) : Function.Injective (e.2 g).2.2.2 := by have ha : physicalListAdmissible C e.1 L R := by by_contra h exact hphase (by simp only [physicalFullEdgePhase, if_neg h]) have hp := hphase rw [physicalFullEdgePhase, if_pos ha] at hp apply full_edge_ledger_phase_fresh_injective _ _ _ _ _ _ _ _ _ _ hp intro h rw [physical_full_split_state_eq] exact Function.Embedding.injective _ theorem physical_full_edge_phase_birth_factor : physicalFullEdgePhase C k L R H q e = (if (∀ g i, (e.2 g).2.2.2 i ∉ H g) ∧ (∀ g, Function.Injective (e.2 g).2.2.2) then 1 else 0) * physicalFullEdgePhase C k L R (fun _ => ∅) q e := by rw [physical_full_edge_phase_avoidance_factor C k L R H q e] by_cases hz : physicalFullEdgePhase C k L R (fun _ => ∅) q e = 0 · simp only [hz, mul_zero] · have hd := physical_full_edge_phase_fresh_injective C k L R (fun _ => ∅) q e hz simp only [hd, forall_true_iff, and_true] end Physical end Bounty end section /- A run-normalized phase history depends only on visits through its final index. -/ open Finset namespace Bounty theorem ghost_phase_run_history_congr {R : Type*} [Fintype R] [DecidableEq R] (a a' : ℕ → Bool) (h h' : ℕ → R) (η η' : ℕ → ℝ) (β V : ℝ) (n : ℕ) (ha : ∀ j ≤ n, a j = a' j) (hh : ∀ j ≤ n, h j = h' j) (hη : ∀ j ≤ n, η j = η' j) : ghostPhaseRunHistory a h η β V n = ghostPhaseRunHistory a' h' η' β V n := by unfold ghostPhaseRunHistory rw [ha n le_rfl] apply sum_congr rfl intro x hx congr 1 apply finite_path_action_prefix_congr · intro j hj u v simp only [ha j (by omega), ha (j + 1) (by omega), hh j (by omega), hh (j + 1) (by omega), hη (j + 1) (by omega)] · intro u simp only [ha 0 (by omega), hh 0 (by omega), hη 0 (by omega)] end Bounty end section /- Canonical full-slot coordinates for a clean pattern. The full active tuple uses `finSumFinEquiv`, and its reduced slots enumerate exactly the repeated fresh-label coordinates. Pending labels and residues are unchanged. -/ open Finset open scoped Classical namespace Bounty def cleanFullSharedSlots {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) : Finset (Fin (J + ell)) := (physicalSharedSlots (ell := ell) (C g)).map finSumFinEquiv.toEmbedding theorem cleanFullSharedSlots_mem {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) (s : PhysicalSlots J ell) : finSumFinEquiv s ∈ cleanFullSharedSlots C g ↔ ¬ repeatedBigUnshared C g s := by cases s <;> simp [cleanFullSharedSlots, physicalSharedSlots, repeatedBigUnshared] def cleanFullUnsharedSlotEquiv {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) : ↥((cleanFullSharedSlots (ell := ell) C g)ᶜ) ≃ {s : PhysicalSlots J ell // repeatedBigUnshared C g s} where toFun i := ⟨finSumFinEquiv.symm i.val, by have hi : i.val ∉ cleanFullSharedSlots C g := mem_compl.mp i.property have hh := cleanFullSharedSlots_mem C g (finSumFinEquiv.symm i.val) rw [Equiv.apply_symm_apply] at hh exact not_not.mp (mt hh.mpr hi)⟩ invFun s := ⟨finSumFinEquiv s.val, mem_compl.mpr (by rw [cleanFullSharedSlots_mem] exact not_not.mpr s.property)⟩ left_inv i := Subtype.ext (Equiv.apply_symm_apply finSumFinEquiv i.val) right_inv s := Subtype.ext (Equiv.symm_apply_apply finSumFinEquiv s.val) noncomputable def cleanFullUnsharedIndex {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) : Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card ≃ {s : PhysicalSlots J ell // repeatedBigUnshared C g s} := (cleanFullSharedSlots C g)ᶜ.equivFin.symm.trans (cleanFullUnsharedSlotEquiv C g) noncomputable def cleanFullFreshEquiv {G : Type*} (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) : (∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) ≃ RepeatedBigFresh P C ell := Equiv.piCongrRight (fun g => Equiv.arrowCongr (cleanFullUnsharedIndex C g) (Equiv.refl (P g))) theorem cleanFullFreshEquiv_apply_index {G : Type*} (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) (g : G) (i : Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card) : cleanFullFreshEquiv P C fresh g (cleanFullUnsharedIndex C g i) = fresh g i := by change fresh g ((cleanFullUnsharedIndex C g).symm (cleanFullUnsharedIndex C g i)) = _ rw [Equiv.symm_apply_apply] theorem cleanFullFreshEquiv_weight {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (μ : ∀ g, P g → ℝ) (fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) : (∏ g, ∏ s, μ g (cleanFullFreshEquiv P C fresh g s)) = ∏ g, ∏ i, μ g (fresh g i) := by apply prod_congr rfl intro g _ exact Equiv.prod_comp (cleanFullUnsharedIndex C g).symm (fun i => μ g (fresh g i)) section variable {G : Type*} {P : G → Finset ℕ} {J ell B : ℕ} (C : G → Finset (Fin J)) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) (fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) include G P J ell B C N p source r fresh /- Split a filled target using the exact source shared coordinates. -/ theorem cleanFullMemoryState_split_fill : productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) r) = ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).1, fun g => (fresh g, ⟨N g, fun j => ⟨p g j, r g j⟩⟩)) := by apply Prod.ext · funext g i change repeatedBigFill C source (cleanFullFreshEquiv P C fresh) g (finSumFinEquiv.symm (((cleanFullSharedSlots C g).equivFin.symm i).val)) = _ have hs := ((cleanFullSharedSlots (ell := ell) C g).equivFin.symm i).property have hh := cleanFullSharedSlots_mem C g (finSumFinEquiv.symm (((cleanFullSharedSlots C g).equivFin.symm i).val)) rw [Equiv.apply_symm_apply] at hh simp only [repeatedBigFill, dif_neg (hh.mp hs)] rfl · funext g apply Prod.ext · funext i change repeatedBigFill C source (cleanFullFreshEquiv P C fresh) g (cleanFullUnsharedIndex C g i).val = fresh g i rw [repeated_big_fill_unshared, cleanFullFreshEquiv_apply_index] · rfl /- Reassemble a reduced target while preserving every pending occurrence. -/ theorem cleanFullMemoryState_reassemble_fill : (productActiveMemorySplit (cleanFullSharedSlots C) B).symm ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).1, fun g => (fresh g, ⟨N g, fun j => ⟨p g j, r g j⟩⟩)) = cleanFullMemoryState N p (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) r := by rw [← cleanFullMemoryState_split_fill C N p source r fresh, Equiv.symm_apply_apply] end /- The reduced fresh integration has exactly the physical fresh mass. -/ theorem clean_full_fresh_weighted_sum {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (F : RepeatedBigFresh P C ell → ℂ) : (∑ fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g, ((∏ g, ∏ i, tiltedPhysicalBirthLaw V g (b g) (fresh g i) : ℝ) : ℂ) * F (cleanFullFreshEquiv P C fresh)) = ∑ fresh : RepeatedBigFresh P C ell, (repeatedBigFreshMass V b C fresh : ℂ) * F fresh := by have h := (cleanFullFreshEquiv P C).sum_comp (fun fresh => (repeatedBigFreshMass V b C fresh : ℂ) * F fresh) simpa only [repeatedBigFreshMass, cleanFullFreshEquiv_weight] using h end Bounty end section /- Clean events preserve the literal total-memory size. The joint cutoff therefore reduces to its source test, without changing the event weight. -/ open Finset open scoped Classical namespace Bounty theorem unrestricted_bounded_clean_event_length {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) (he : e.1 = ∅ ∧ e.2.1 = ∅) : (unrestrictedBoundedEventTarget n Δ D t B s e).2.1.val = s.2.1.val := by rcases e with ⟨stores, promotions, select, fresh⟩ rcases he with ⟨hs, hp⟩ dsimp only at hs hp subst stores subst promotions have hs := unrestricted_clean_promotion_unique (unrestrictedResidueEligible n Δ D s.2.2) select subst select have hlen := unrestricted_clean_output_length s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) (unrestrictedResidueEligible n Δ D s.2.2) have hb : (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) ∅ ∅ (unrestrictedCleanPromotion t (unrestrictedResidueEligible n Δ D s.2.2))).1 ≤ B := by rw [hlen] exact Nat.le_of_lt_succ s.2.1.isLt unfold unrestrictedBoundedEventTarget rw [dif_pos hb] exact hlen theorem unrestricted_joint_clean_event_total_memory {G : Type*} [Fintype G] {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (e : UnrestrictedJointEvent n Δ D t B s) (he : ∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅) : productTotalMemory (unrestrictedJointEventTarget n Δ D t B s e) = productTotalMemory s := by apply sum_congr rfl intro g hg exact unrestricted_bounded_clean_event_length (n g) (Δ g) (D g) (t g) B (s g) (e g) (he g) theorem unrestricted_joint_clean_event_weight {G : Type*} [Fintype G] {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (e : UnrestrictedJointEvent n Δ D t B s) (he : ∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅) : unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B s e = if productTotalMemory s ≤ B then ∏ g, unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (s g) (e g) else 0 := by unfold unrestrictedJointCutoffEventWeight rw [unrestricted_joint_clean_event_total_memory n Δ D t B s e he] simp only [and_self] end Bounty end section /- Products of original local phases retain their full event-path dependence. -/ open Finset open scoped Classical namespace Bounty section Paths variable {K X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) theorem finite_event_local_phase_occurrences (phase : ∀ k x, E k x → ℂ) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) : finiteEventLocalPhase E target phase steps x p = ∏ i : Fin steps.length, phase (steps.get i) (finiteEventPathOccurrence E target steps x p i).1 (finiteEventPathOccurrence E target steps x p i).2 := by induction steps generalizing x with | nil => simp only [finiteEventLocalPhase, List.length_nil, Fin.prod_univ_zero] | cons k steps ih => calc _ = phase k x p.1 * finiteEventLocalPhase E target phase steps (target k x p.1) p.2 := rfl _ = phase k x p.1 * ∏ i : Fin steps.length, phase (steps.get i) (finiteEventPathOccurrence E target steps (target k x p.1) p.2 i).1 (finiteEventPathOccurrence E target steps (target k x p.1) p.2 i).2 := congrArg (phase k x p.1 * ·) (ih (target k x p.1) p.2) _ = _ := (Fin.prod_univ_succ (fun i : Fin (steps.length + 1) => phase ((k :: steps).get i) (finiteEventPathOccurrence E target (k :: steps) x p i).1 (finiteEventPathOccurrence E target (k :: steps) x p i).2)).symm theorem finite_event_local_phase_indicator_factor (phase residual : ∀ k x, E k x → ℂ) (condition : ∀ k x, E k x → Prop) (hphase : ∀ k x e, phase k x e = (if condition k x e then 1 else 0) * residual k x e) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) : finiteEventLocalPhase E target phase steps x p = (if ∀ i : Fin steps.length, condition (steps.get i) (finiteEventPathOccurrence E target steps x p i).1 (finiteEventPathOccurrence E target steps x p i).2 then 1 else 0) * finiteEventLocalPhase E target residual steps x p := by rw [finite_event_local_phase_occurrences, finite_event_local_phase_occurrences] simp_rw [hphase] rw [prod_mul_distrib] congr 1 by_cases h : ∀ i : Fin steps.length, condition (steps.get i) (finiteEventPathOccurrence E target steps x p i).1 (finiteEventPathOccurrence E target steps x p i).2 · rw [if_pos h] calc _ = ∏ _i : Fin steps.length, (1 : ℂ) := prod_congr rfl (fun i _ => if_pos (h i)) _ = 1 := prod_const_one · rw [if_neg h] obtain ⟨i, hi⟩ := not_forall.mp h exact prod_eq_zero (mem_univ i) (if_neg hi) end Paths theorem complex_indicator_and_of_iff (C A D : Prop) (dC : Decidable C) (dA : Decidable A) (dD : Decidable D) (h : C ↔ A ∧ D) : @ite ℂ C dC 1 0 = @ite ℂ A dA 1 0 * @ite ℂ D dD 1 0 := by let : Decidable C := dC let : Decidable A := dA let : Decidable D := dD by_cases hc : C · rcases h.mp hc with ⟨ha, hd⟩ simp only [if_pos hc, if_pos ha, if_pos hd, one_mul] · by_cases ha : A · have hd : ¬ D := fun hd => hc (h.mpr ⟨ha, hd⟩) simp only [if_neg hc, if_pos ha, if_neg hd, mul_zero] · simp only [if_neg hc, if_neg ha, zero_mul] section Ledger variable {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) theorem finite_ledger_event_local_phase (phase : ∀ k x, E k x → ℂ) (steps : List K) (l : L) (x : X) (p : FiniteEventPath (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) steps (l, x)) : finiteEventLocalPhase (fun k (s : L × X) => E k s.2) (finiteLedgerEventTarget E target update) (fun k s => phase k s.2) steps (l, x) p = finiteEventLocalPhase E target phase steps x (finiteLedgerEventPathEquiv E target update steps l x p) := by induction steps generalizing l x with | nil => rfl | cons k steps ih => rcases p with ⟨e, p⟩ exact congrArg (phase k x e * ·) (ih (update k l x e) (target k x e) p) end Ledger end Bounty end section /- Reindex the complete original event row without changing its target continuation. -/ open Finset Classical namespace Bounty end Bounty end section /- Joint memory cutoffs depend on each fixed event skeleton, not its sampled birth labels. -/ open Finset Classical namespace Bounty def boundedGhostSkeletonOutputCount {P Z : Type*} (t B : ℕ) (s : BoundedOrderedState P Z t B) (b : Fin (B + 1)) (retained : Finset (Fin s.2.1.val)) : ℕ := if retained.card + b.val ≤ B then retained.card + b.val else s.2.1.val theorem bounded_ghost_target_count {P Z : Type*} (t B : ℕ) (s : BoundedOrderedState P Z t B) (b : Fin (B + 1)) (retained : Finset (Fin s.2.1.val)) (births : Fin b.val → Z) : (boundedGhostEventTarget t B s ⟨b, retained, births⟩).2.1.val = boundedGhostSkeletonOutputCount t B s b retained := by unfold boundedGhostEventTarget retainedBirthTuple boundedGhostSkeletonOutputCount dsimp only split_ifs <;> rfl theorem coupled_ghost_skeleton_target_memory {G : Type*} [Fintype G] {P Z : G → Type*} (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (sk : CoupledGhostSkeleton t B s) (births : CoupledGhostSamples t B s sk) : productTotalMemory (coupledGhostJointEventTarget t B s ((coupledGhostSkeletonEquiv t B s).symm ⟨sk, births⟩)) = ∑ g, boundedGhostSkeletonOutputCount (t g) B (s g) (sk g).1 (sk g).2 := by apply sum_congr rfl intro g _ exact bounded_ghost_target_count (t g) B (s g) (sk g).1 (sk g).2 _ noncomputable def unrestrictedSkeletonOutputCount {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (sk : UnrestrictedLocalEdgeSkeleton n Δ D t B s) : ℕ := let size := (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) sk.1 sk.2.1 sk.2.2).1 if size ≤ B then size else s.2.1.val theorem unrestricted_bounded_skeleton_target_count {P : Type*} (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (sk : UnrestrictedLocalEdgeSkeleton n Δ D t B s) (fresh : UnrestrictedFreshLabels P sk.2.1) : (unrestrictedBoundedEventTarget n Δ D t B s ⟨sk.1, sk.2.1, sk.2.2, fresh⟩).2.1.val = unrestrictedSkeletonOutputCount n Δ D t B s sk := by unfold unrestrictedBoundedEventTarget unrestrictedSkeletonOutputCount dsimp only split_ifs <;> rfl end Bounty end section /- Pinning a numbered retained particle can destroy symmetry even on constant continuation. -/ namespace Bounty end Bounty end section /- Dyadic index counts sensitive to the width of a logarithmic window. -/ open Finset namespace Bounty theorem nat_finset_card_le_real_span (S : Finset ℕ) {a b : ℝ} (hab : a ≤ b) (hS : ∀ n ∈ S, a ≤ (n : ℝ) ∧ (n : ℝ) ≤ b) : (S.card : ℝ) ≤ b-a+1 := by classical by_cases hs : S.Nonempty · let lo := S.min' hs let hi := S.max' hs have hlh : lo ≤ hi := S.min'_le_max' hs have hsub : S ⊆ Icc lo hi := by intro n hn exact mem_Icc.mpr ⟨S.min'_le n hn, S.le_max' n hn⟩ have hc : S.card ≤ hi-lo+1 := by have h := card_le_card hsub rw [Nat.card_Icc] at h omega have hcR := Nat.cast_le (α := ℝ).mpr hc rw [Nat.cast_add, Nat.cast_sub hlh, Nat.cast_one] at hcR have hlo := (hS lo (S.min'_mem hs)).1 have hhi := (hS hi (S.max'_mem hs)).2 linarith · rw [not_nonempty_iff_eq_empty.mp hs, card_empty, Nat.cast_zero] linarith theorem dyadic_log2_real_bounds {n : ℕ} (hn : 0 < n) : Real.log (n : ℝ)/Real.log 2 - 1 < (n.log2 : ℝ) ∧ (n.log2 : ℝ) ≤ Real.log (n : ℝ)/Real.log 2 := by have htwo : 0 < Real.log 2 := Real.log_pos (by norm_num) have hpow := (Nat.log2_eq_iff hn.ne').mp (rfl : n.log2 = n.log2) have hupper : (n : ℝ) < (2 : ℝ)^(n.log2+1) := by exact_mod_cast hpow.2 have hlog := Real.log_lt_log (Nat.cast_pos.mpr hn) hupper rw [Real.log_pow] at hlog constructor · rw [div_sub_one htwo.ne', div_lt_iff₀ htwo] push_cast at hlog nlinarith · exact Real.log2_le_logb n theorem dyadic_indices_card_window (S : Finset ℕ) {a b : ℝ} (hab : a ≤ b) (hS : ∀ n ∈ S, 0 < n ∧ Real.exp a ≤ (n : ℝ) ∧ (n : ℝ) ≤ Real.exp b) : ((dyadicNatIndices S).card : ℝ) ≤ (b-a)/Real.log 2 + 2 := by have htwo : 0 < Real.log 2 := Real.log_pos (by norm_num) have hspan : a/Real.log 2-1 ≤ b/Real.log 2 := by have := div_le_div_of_nonneg_right hab htwo.le linarith have hbound : ∀ k ∈ dyadicNatIndices S, a/Real.log 2-1 ≤ (k : ℝ) ∧ (k : ℝ) ≤ b/Real.log 2 := by intro k hk obtain ⟨n, hn, rfl⟩ := mem_image.mp hk obtain ⟨hn0, hnlo, hnhi⟩ := hS n hn have hb := dyadic_log2_real_bounds hn0 have hlo : a ≤ Real.log (n : ℝ) := by simpa only [Real.log_exp] using Real.log_le_log (Real.exp_pos a) hnlo have hhi : Real.log (n : ℝ) ≤ b := by simpa only [Real.log_exp] using Real.log_le_log (Nat.cast_pos.mpr hn0) hnhi constructor · have := div_le_div_of_nonneg_right hlo htwo.le linarith · exact hb.2.trans (div_le_div_of_nonneg_right hhi htwo.le) have h := nat_finset_card_le_real_span (dyadicNatIndices S) hspan hbound convert h using 1; ring end Bounty end section /- Scalar retention and birth sums for length-weighted original ghost events. -/ open Finset Classical namespace Bounty theorem ghost_retention_length_sum {Z : Type*} {d : ℕ} (old : Fin d → Z) (A D : Z → ℝ) (v : ℝ) : (∑ r : Finset (Fin d), ((∏ i ∈ r, A (old i)) * (∏ i ∈ univ \ r, |D (old i)|)) * v ^ r.card) = ∏ i, (A (old i) * v + |D (old i)|) := by rw [Finset.prod_add, powerset_univ] apply sum_congr rfl intro r _ rw [prod_mul_distrib, prod_const] ring theorem ghost_uncut_length_sum {P Z : Type*} [Fintype Z] (A D C ν : Z → ℝ) (v : ℝ) (t B : ℕ) (s : BoundedOrderedState P Z t B) : (∑ b : Fin (B + 1), ∑ r : Finset (Fin s.2.1.val), ∑ births : Fin b.val → Z, (((∏ i ∈ r, A (s.2.2 i)) * (∏ i ∈ univ \ r, |D (s.2.2 i)|)) * (∏ i, |C (births i)| * ν (births i)) / (b.val.factorial : ℝ)) * v ^ (r.card + b.val)) = (∏ i, (A (s.2.2 i) * v + |D (s.2.2 i)|)) * ∑ b ∈ range (B + 1), ((∑ z, |C z| * ν z) * v) ^ b / (b.factorial : ℝ) := by have hb (b : Fin (B + 1)) (r : Finset (Fin s.2.1.val)) : (∑ births : Fin b.val → Z, (((∏ i ∈ r, A (s.2.2 i)) * (∏ i ∈ univ \ r, |D (s.2.2 i)|)) * (∏ i, |C (births i)| * ν (births i)) / (b.val.factorial : ℝ)) * v ^ (r.card + b.val)) = (((∏ i ∈ r, A (s.2.2 i)) * (∏ i ∈ univ \ r, |D (s.2.2 i)|)) * v ^ r.card) * (((∑ z, |C z| * ν z) * v) ^ b.val / (b.val.factorial : ℝ)) := by calc _ = (((∏ i ∈ r, A (s.2.2 i)) * (∏ i ∈ univ \ r, |D (s.2.2 i)|)) * v ^ r.card) * (v ^ b.val / (b.val.factorial : ℝ)) * ∑ births : Fin b.val → Z, ∏ i, |C (births i)| * ν (births i) := by rw [mul_sum] apply sum_congr rfl intro births _ rw [pow_add] ring _ = _ := by rw [← Fintype.prod_sum (fun (_ : Fin b.val) (z : Z) => |C z| * ν z), Fin.prod_const, mul_pow] ring simp_rw [hb] rw [sum_comm] simp_rw [← mul_sum] rw [← sum_mul, ghost_retention_length_sum, Fin.sum_univ_eq_sum_range (fun b => ((∑ z, |C z| * ν z) * v) ^ b / (b.factorial : ℝ)) (B + 1)] end Bounty end section /- Iteration of genuine weighted row bounds on the original dependent paths. -/ open Finset Classical namespace Bounty universe u v w end Bounty end section /- The static initial-ledger exclusion costs a square-root rare-target error. Its complete finite-family budget still has arbitrary power decay. -/ open Filter namespace Bounty noncomputable def repeatedBigInitialError (s m J ell Q : ℕ) (xi P v : ℝ) : ℝ := (1 + (2 : ℝ) ^ (m * s) * (((Q * Q : ℕ) : ℝ) / xi) ^ 2) * Real.sqrt ((s : ℝ) * (((ell + m : ℕ) : ℝ) * ((J + ell : ℕ) : ℝ)) / (v * P)) theorem repeated_big_initial_error_sq_le (s m J ell Q : ℕ) (xi P v : ℝ) (hP : 0 < P) (hv : 0 < v) (hell : ell ≤ m) : (repeatedBigInitialError s m J ell Q xi P v) ^ 2 ≤ 2 * repeatedBigNumericError s (2 * m) J ell (Q * Q) (xi ^ 2) 0 P v := by let u := (2 : ℝ) ^ (m * s) * (((Q * Q : ℕ) : ℝ) / xi) ^ 2 let delta := (s : ℝ) * (((ell + m : ℕ) : ℝ) * ((J + ell : ℕ) : ℝ)) / (v * P) let d := (s : ℝ) * (((2 * m : ℕ) : ℝ) * (2 * ((J + ell : ℕ) : ℝ))) / (v * P) have hd : 0 ≤ delta := by dsimp [delta]; positivity have hdelta : delta ≤ d := by dsimp [delta, d] apply div_le_div_of_nonneg_right _ (mul_pos hv hP).le apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg s) have hm : ((ell + m : ℕ) : ℝ) ≤ 2 * ((2 * m : ℕ) : ℝ) := by exact_mod_cast (show ell + m ≤ 2 * (2 * m) by omega) have hh := mul_le_mul_of_nonneg_right hm (Nat.cast_nonneg (J + ell)) nlinarith have hcoef : (1 + u) ^ 2 ≤ 2 * (1 + u ^ 2) := by nlinarith [sq_nonneg (u - 1)] have hpow : ((2 : ℝ) ^ (m * s)) ^ 2 = (2 : ℝ) ^ ((2 * m) * s) := by rw [← pow_mul] congr 1 ring have hratio : ((((Q * Q : ℕ) : ℝ) / xi) ^ 2) = (((Q * Q) * (Q * Q) : ℕ) : ℝ) / (xi ^ 2) := by rw [div_pow] simp only [pow_two, Nat.cast_mul] have hu : u ^ 2 = (2 : ℝ) ^ ((2 * m) * s) * ((((Q * Q) * (Q * Q) : ℕ) : ℝ) / (xi ^ 2)) ^ 2 := by dsimp [u] rw [mul_pow, hpow, hratio] have hleft : (repeatedBigInitialError s m J ell Q xi P v) ^ 2 = (1 + u) ^ 2 * delta := by unfold repeatedBigInitialError rw [mul_pow, Real.sq_sqrt hd] have hright : repeatedBigNumericError s (2 * m) J ell (Q * Q) (xi ^ 2) 0 P v = (1 + u ^ 2) * d := by rw [hu] simp only [repeatedBigNumericError, mul_zero, zero_div, zero_add, d] rw [hleft, hright] have hc := mul_le_mul hcoef hdelta hd (by positivity : 0 ≤ 2 * (1 + u ^ 2)) nlinarith theorem eventually_repeated_big_initial_error_small (m J ell : ℕ) {a q x v c : ℝ} (ha : 0 ≤ a) (hq : 0 ≤ q) (hx : 0 ≤ x) (hv : 0 < v) (hc : 0 < c) (hell : ell ≤ m) (E : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (s Q : ℕ) (xi P : ℝ), (s : ℝ) ≤ a * Real.log L → (Q : ℝ) ≤ L ^ q → L ^ (-x) ≤ xi → Real.exp (L ^ c) ≤ P → repeatedBigInitialError s m J ell Q xi P v ≤ L ^ (-E) := by filter_upwards [eventually_repeated_big_numeric_error_small (2 * m) J ell ha (show 0 ≤ 2 * q by positivity) (show 0 ≤ 2 * x by positivity) (show (0 : ℝ) ≤ 0 by norm_num) hv hc (2 * E + 2), eventually_ge_atTop (2 : ℝ)] with L herr hL intro s Q xi P hs hQ hxi hP have hL0 : 0 < L := by linarith have hP0 : 0 < P := (Real.exp_pos _).trans_le hP have hQ' : ((Q * Q : ℕ) : ℝ) ≤ L ^ (2 * q) := by calc _ = (Q : ℝ) ^ 2 := by simp [pow_two] _ ≤ (L ^ q) ^ 2 := pow_le_pow_left₀ (Nat.cast_nonneg _) hQ 2 _ = _ := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL0.le]; congr 1; ring have hxi' : L ^ (-(2 * x)) ≤ xi ^ 2 := by calc _ = (L ^ (-x)) ^ (2 : ℕ) := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL0.le] congr 1 ring _ ≤ _ := pow_le_pow_left₀ (Real.rpow_nonneg hL0.le _) hxi 2 have hn := herr s (Q * Q) (xi ^ 2) 0 P hs hQ' hxi' le_rfl (by positivity) hP have hsquare := (repeated_big_initial_error_sq_le s m J ell Q xi P v hP0 hv hell).trans (mul_le_mul_of_nonneg_left hn (by norm_num)) have hpower : 2 * L ^ (-(2 * E + 2)) ≤ (L ^ (-E)) ^ 2 := by have hden : 2 ≤ L ^ (2 : ℕ) := by nlinarith rw [show -(2 * E + 2) = (-E) * 2 - 2 by ring, Real.rpow_sub hL0, Real.rpow_mul hL0.le, ← mul_div_assoc] simp only [Real.rpow_two] apply (div_le_iff₀ (sq_pos_of_pos hL0)).mpr nlinarith [sq_nonneg (L ^ (-E))] have hfinal := hsquare.trans hpower nlinarith [Real.rpow_pos_of_pos hL0 (-E)] end Bounty end section /- A uniform harmonic Mellin loss for interval character sums in a dyad. -/ open Finset namespace Bounty theorem harmonic_mellin_interval_variation {v Y : ℝ} {m n : ℕ} (hY : 0 < Y) (hmn : m < n) (hYm : Y ≤ (m+1 : ℕ)) (hn : (n : ℝ) ≤ 2*Y) : ‖harmonicMellinWeight v n‖+ (∑ i ∈ Ioc m (n-1), ‖harmonicMellinWeight v (i+1)-harmonicMellinWeight v i‖) ≤ (3+2*|v|)/Y := by have hn0 : 0 < (n : ℝ) := Nat.cast_pos.mpr (lt_of_le_of_lt (Nat.zero_le _) hmn) have hYn : Y ≤ (n : ℝ) := hYm.trans (Nat.cast_le.mpr hmn) have hstep : ∀ i ∈ Ioc m (n-1), ‖harmonicMellinWeight v (i+1)-harmonicMellinWeight v i‖ ≤ (1+|v|)/Y^2 := by intro i hi have hYi : Y ≤ (i : ℝ) := hYm.trans (Nat.cast_le.mpr (mem_Ioc.mp hi).1) simpa only [add_sub_cancel_left, mul_one] using harmonic_mellin_weight_variation_lower_scale (v := v) hY hYi (show (i : ℝ) ≤ i+1 by linarith) have hcard : ((Ioc m (n-1)).card : ℝ) ≤ 2*Y := by apply le_trans _ hn rw [Nat.card_Ioc] exact_mod_cast ((Nat.sub_le (n-1) m).trans (Nat.sub_le n 1)) calc _ ≤ 1/Y+∑ _i ∈ Ioc m (n-1), (1+|v|)/Y^2 := by apply add_le_add · rw [norm_harmonic_mellin_weight v hn0] exact one_div_le_one_div_of_le hY hYn · exact sum_le_sum hstep _ = 1/Y+((Ioc m (n-1)).card : ℝ)*((1+|v|)/Y^2) := by simp only [sum_const, nsmul_eq_mul] _ ≤ 1/Y+(2*Y)*((1+|v|)/Y^2) := by gcongr _ = _ := by field_simp; ring theorem norm_harmonic_mellin_interval_sum_le {v Y B : ℝ} {m n : ℕ} (g : ℕ → ℂ) (hY : 0 < Y) (hmn : m < n) (hYm : Y ≤ (m+1 : ℕ)) (hn : (n : ℝ) ≤ 2*Y) (hB : 0 ≤ B) (hprefix : ∀ i ∈ Icc m n, ‖∑ j ∈ Ioc m i, g j‖ ≤ B) : ‖∑ i ∈ Ioc m n, harmonicMellinWeight v i*g i‖ ≤ ((3+2*|v|)/Y)*B := by apply (norm_complex_sum_Ioc_le_of_interval_prefix (fun i => harmonicMellinWeight v i) g hmn hprefix).trans simpa only [Nat.cast_add, Nat.cast_one] using mul_le_mul_of_nonneg_right (harmonic_mellin_interval_variation (v := v) hY hmn hYm hn) hB end Bounty end section /- Forest constraints on projected labels of the original independent sample coordinates. -/ open Finset Classical namespace Bounty noncomputable def finiteLabelMass {Z α : Type*} [Fintype Z] [DecidableEq α] (label : Z → α) (w : Z → ℝ) (a : α) : ℝ := ∑ z, if label z = a then w z else 0 theorem finiteLabelMass_nonneg {Z α : Type*} [Fintype Z] [DecidableEq α] (label : Z → α) (w : Z → ℝ) (hw : ∀ z, 0 ≤ w z) (a : α) : 0 ≤ finiteLabelMass label w a := by exact sum_nonneg fun z _ => by split_ifs <;> simp_all theorem finiteLabelMass_total {Z α : Type*} [Fintype Z] [Fintype α] [DecidableEq α] (label : Z → α) (w : Z → ℝ) : ∑ a, finiteLabelMass label w a = ∑ z, w z := by unfold finiteLabelMass rw [sum_comm] simp theorem labeled_product_sum {I : Type*} [Fintype I] [DecidableEq I] (Z : I → Type*) [∀ i, Fintype (Z i)] {α : Type*} [Fintype α] [DecidableEq α] (label : ∀ i, Z i → α) (w : ∀ i, Z i → ℝ) (F : (I → α) → ℝ) : (∑ f : ∀ i, Z i, (∏ i, w i (f i)) * F (fun i => label i (f i))) = ∑ a : I → α, (∏ i, finiteLabelMass (label i) (w i) (a i)) * F a := by symm unfold finiteLabelMass simp_rw [Fintype.prod_sum (fun i z => if label i z = _ then w i z else 0), sum_mul] rw [sum_comm] apply sum_congr rfl intro f _ simp only [prod_ite_zero, mem_univ, forall_const] have he (a : I → α) : (∀ i, label i (f i) = a i) ↔ (fun i => label i (f i)) = a := ⟨fun h => funext h, fun h i => congrFun h i⟩ simp_rw [he, ite_mul, zero_mul] exact Fintype.sum_ite_eq _ _ theorem labeled_birth_forest_sum_le {n : ℕ} (Z : Fin n → Type*) [∀ i, Fintype (Z i)] {α : Type*} [Fintype α] [DecidableEq α] (label : ∀ i, Z i → α) (w : ∀ i, Z i → ℝ) (code : BirthForestCode n) (M ε : Fin n → ℝ) (hM : ∀ i, 0 ≤ M i) (hε : ∀ i, 0 ≤ ε i) (hw : ∀ i z, 0 ≤ w i z) (hsum : ∀ i, ∑ z, w i z ≤ M i) (hatom : ∀ i a, finiteLabelMass (label i) (w i) a ≤ ε i) : (∑ f : ∀ i, Z i, if birthForestEqualValues code (fun i => label i (f i)) then ∏ i, w i (f i) else 0) ≤ ∏ i, match code i with | none => M i | some _ => ε i := by have he := labeled_product_sum Z label w (fun a => if birthForestEqualValues code a then 1 else 0) simp only [mul_ite, mul_one, mul_zero] at he rw [he] have hb := birthForestCausalMass_le_coordinate_costs code (fun i _ a => finiteLabelMass (label i) (w i) a) M ε hM hε (fun i _ a => finiteLabelMass_nonneg _ _ (hw i) a) (fun i _ => (finiteLabelMass_total (label i) (w i)).le.trans (hsum i)) (fun i _ a => hatom i a) apply le_trans ?_ hb apply le_of_eq unfold birthForestCausalMass birthForestCausalAssignmentMass apply sum_congr rfl intro f _ rw [birthForestAssignmentMass_eq] end Bounty end section /- Reindex actual bounded edge events without changing their birth slots. -/ open Finset Classical namespace Bounty noncomputable def residueEligibleReindex {P : Type*} (n : P → ℕ) (Δ D : ℤ) {N : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (τ : Equiv.Perm (Fin N)) : unrestrictedResidueEligible n Δ D old ≃ unrestrictedResidueEligible n Δ D (old ∘ τ) where toFun j := ⟨τ.symm j, by rw [unrestricted_residue_eligible_perm, mem_unrestrictedPermutedEligible, Equiv.apply_symm_apply] exact j.property⟩ invFun := fun ⟨j, hj⟩ => ⟨τ j, by rwa [unrestricted_residue_eligible_perm, mem_unrestrictedPermutedEligible] at hj⟩ left_inv j := by ext; simp right_inv j := by ext; simp noncomputable def residuePromotionReindex {P I : Type*} (n : P → ℕ) (Δ D : ℤ) {N : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (τ : Equiv.Perm (Fin N)) : (I ↪ ↥(unrestrictedResidueEligible n Δ D old)) ≃ (I ↪ ↥(unrestrictedResidueEligible n Δ D (old ∘ τ))) := Equiv.embeddingCongr (Equiv.refl I) (residueEligibleReindex n Δ D old τ) theorem residuePromotionReindex_val {P I : Type*} (n : P → ℕ) (Δ D : ℤ) {N : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (τ : Equiv.Perm (Fin N)) (e : I ↪ ↥(unrestrictedResidueEligible n Δ D old)) (i : I) : (residuePromotionReindex n Δ D old τ e i).val = τ.symm (e i).val := rfl noncomputable def boundedEdgeMemoryReindex {P : Type*} (n : P → ℕ) (Δ D : ℤ) {t B : ℕ} (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (τ : Equiv.Perm (Fin s.2.1.val)) : UnrestrictedBoundedEvent n Δ D t B s ≃ UnrestrictedBoundedEvent n Δ D t B (boundedGhostMemoryPermute s τ) := Equiv.sigmaCongrRight fun _ => Equiv.sigmaCongrRight fun _ => Equiv.prodCongr (residuePromotionReindex n Δ D s.2.2 τ) (Equiv.refl _) theorem boundedEdgeMemoryReindex_apply {P : Type*} (n : P → ℕ) (Δ D : ℤ) {t B : ℕ} (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (τ : Equiv.Perm (Fin s.2.1.val)) (e : UnrestrictedBoundedEvent n Δ D t B s) : boundedEdgeMemoryReindex n Δ D s τ e = ⟨e.1, e.2.1, residuePromotionReindex n Δ D s.2.2 τ e.2.2.1, e.2.2.2⟩ := rfl theorem residue_promotion_reindex_survivors {P I : Type*} [Fintype I] (n : P → ℕ) (Δ D : ℤ) {N : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (τ : Equiv.Perm (Fin N)) (e : I ↪ ↥(unrestrictedResidueEligible n Δ D old)) : unrestrictedEdgeSurvivors (residuePromotionReindex n Δ D old τ e) = (unrestrictedEdgeSurvivors e).map τ.symm.toEmbedding := by have hs : promotionSelectedIndices (residuePromotionReindex n Δ D old τ e) = (promotionSelectedIndices e).map τ.symm.toEmbedding := by simp only [promotionSelectedIndices, map_map] rfl rw [unrestrictedEdgeSurvivors, hs] simp [unrestrictedEdgeSurvivors, Finset.map_sdiff] theorem residue_promotion_reindex_memory {P I : Type*} [Fintype I] (n : P → ℕ) (Δ D : ℤ) {N b : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (τ : Equiv.Perm (Fin N)) (e : I ↪ ↥(unrestrictedResidueEligible n Δ D old)) (stored : Fin b → UnrestrictedResidueParticle n) : orderedTupleOccupancy (unrestrictedEdgeMemory (old ∘ τ) (unrestrictedResidueTransport n Δ) stored (residuePromotionReindex n Δ D old τ e)) = orderedTupleOccupancy (unrestrictedEdgeMemory old (unrestrictedResidueTransport n Δ) stored e) := by simp only [unrestrictedEdgeMemory, retained_birth_tuple_occupancy] rw [residue_promotion_reindex_survivors] congr 1 simp [retainedTupleOccupancy, sum_map, Function.comp_apply] theorem residue_promotion_reindex_target {P : Type*} (n : P → ℕ) (Δ D : ℤ) {N t : ℕ} (old : Fin N → UnrestrictedResidueParticle n) (τ : Equiv.Perm (Fin N)) (promotions : Finset (Fin t)) (e : promotions ↪ ↥(unrestrictedResidueEligible n Δ D old)) (fresh : UnrestrictedFreshLabels P promotions) : unrestrictedEdgeTarget (old ∘ τ) Sigma.fst promotions (residuePromotionReindex n Δ D old τ e) fresh = unrestrictedEdgeTarget old Sigma.fst promotions e fresh := by unfold unrestrictedEdgeTarget congr 1 funext i simp [Function.comp_apply, residuePromotionReindex_val] end Bounty end section /- Local symmetric-test equality implies equality for a joint symmetric continuation. -/ open Finset Classical namespace Bounty theorem product_memory_test_congr {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) (x y : ProductBoundedOrderedState P Z t B) (hxy : ∀ g (h : BoundedOrderedState (P g) (Z g) (t g) B → ℂ), BoundedOrderedSymmetric h → h (y g) = h (x g)) : f y = f x := by let z (s : Finset G) : ProductBoundedOrderedState P Z t B := fun g => if g ∈ s then y g else x g have hc := (product_memory_symmetric_iff_coordinate f).mp hf have hs (s : Finset G) : f (z s) = f x := by induction s using Finset.induction_on with | empty => simp only [z, notMem_empty, if_false] | @insert g s hg ih => have hz : z (insert g s) = Function.update (z s) g (y g) := by funext j by_cases hj : j = g · subst j simp [z] · simp [z, hj] rw [hz] have hl := hxy g (fun a => f (Function.update (z s) g a)) ((finite_local_memory_invariant_iff _).mp (finite_coordinate_invariant_slice g _ f (hc g) (z s))) rw [hl] have he : Function.update (z s) g (x g) = z s := by have hval : z s g = x g := by simp only [z, hg, if_false] rw [← hval, Function.update_eq_self] rw [he, ih] simpa only [z, mem_univ, if_true] using hs univ abbrev productMemoryReindex {G : Type*} {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z t B) (τ : ∀ g, Equiv.Perm (Fin (x g).2.1.val)) : ProductBoundedOrderedState P Z t B := fun g => boundedGhostMemoryPermute (x g) (τ g) theorem product_memory_reindex_at {G : Type*} [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z t B) (g : G) (τ : Equiv.Perm (Fin (x g).2.1.val)) : productMemoryReindex x (Function.update (fun h => Equiv.refl (Fin (x h).2.1.val)) g τ) = productMemoryPermuteAt x g τ := by funext h by_cases hh : h = g · subst h simp only [productMemoryReindex, Function.update_self, productMemoryPermuteAt] · simp only [productMemoryReindex, Function.update_of_ne hh, boundedGhostMemoryPermute, Equiv.refl_apply, Function.comp_def, productMemoryPermuteAt] end Bounty end section /- The original full physical edge, under the actual tilted prime law, with a bounded event coefficient and fixed initial fresh-birth exclusions. All auxiliary, storage, retrieval and fresh choices remain in the row. -/ open Finset Classical namespace Bounty end Bounty end section /- Full signed edge coefficients with an auxiliary-dependent permutation of an external finite coordinate. The external permutation is applied before the auxiliary average. No dimension factor for the external space is used. -/ open Finset Classical namespace Bounty theorem finite_external_energy_of_scaled_norm {X R : Type*} [Fintype X] [Fintype R] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (H : ℝ) (hH : 0 ≤ H) (K : ℝ) (f output majorant : X → R → ℂ) (hdom : ∀ x r, ‖output x r‖ ≤ ‖(H : ℂ) * majorant x r‖) (hbase : (∑ r, finiteWeightedEnergy w (fun x => majorant x r)) ≤ K * ∑ r, finiteWeightedEnergy w (fun x => f x r)) : (∑ r, finiteWeightedEnergy w (fun x => output x r)) ≤ H ^ 2 * K * ∑ r, finiteWeightedEnergy w (fun x => f x r) := by calc _ ≤ ∑ r, H ^ 2 * finiteWeightedEnergy w (fun x => majorant x r) := by apply sum_le_sum intro r _ simpa only [mul_one] using finite_weighted_energy_of_scaled_norm w hw H hH 1 (fun x => majorant x r) (fun x => output x r) (fun x => majorant x r) (fun x => hdom x r) (by simp only [one_mul, le_refl]) _ = H ^ 2 * ∑ r, finiteWeightedEnergy w (fun x => majorant x r) := (mul_sum ..).symm _ ≤ _ := (mul_le_mul_of_nonneg_left hbase (sq_nonneg H)).trans_eq (by ring) section variable {G : Type*} [Fintype G] [dG : DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) {R : Type*} (τ : ∀ c, A c → R ≃ R) noncomputable def fullActiveExternalCoefficientAction (Ψ : ∀ x, R → FullActiveEdgeEvent n S B A Δ D x → ℂ) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (r : R) : ℂ := ∑ e : FullActiveEdgeEvent n S B A Δ D x, (fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e : ℂ) * Ψ x r e * f (fullActiveEdgeEventTarget n S B A Δ D x e) (τ (productActiveMemorySplit S B x).1 e.1 r) noncomputable def fullActiveExternalPositiveAction (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) := equivExternalFiberAverage (productActiveMemorySplit S B) ω (fun c a => unrestrictedCoupledCutoffProductOperator n (Δ c a) (D c a) μ ρ V (fun g => (S g)ᶜ.card) B (fun _ _ => 1)) τ f omit [∀ g p, NeZero (n g p)] in theorem full_active_external_positive_eq_sum (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (r : R) : fullActiveExternalPositiveAction n S B A Δ D ω μ ρ V τ f x r = fullActiveExternalCoefficientAction n S B A Δ D ω μ ρ V τ (fun _ _ _ => 1) f x r := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold fullActiveExternalPositiveAction equivExternalFiberAverage finiteExternalFiberAverage fullActiveExternalCoefficientAction rw [Fintype.sum_sigma] apply sum_congr rfl intro a _ dsimp only rw [unrestricted_coupled_cutoff_eq_joint_event_sum] simp only [mul_sum, fullActiveEdgeEventWeight, fullActiveEdgeEventTarget, Complex.ofReal_mul, mul_one, mul_assoc] apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _; rfl omit [∀ g p, NeZero (n g p)] in theorem full_active_external_coefficient_norm_le (hω : ∀ c a, 0 ≤ ω c a) (hμ : ∀ g p, 0 ≤ μ g p) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ V g) (Ψ : ∀ x, R → FullActiveEdgeEvent n S B A Δ D x → ℂ) (H : ℝ) (hH : 0 ≤ H) (hΨ : ∀ x r e, ‖Ψ x r e‖ ≤ H) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (r : R) : ‖fullActiveExternalCoefficientAction n S B A Δ D ω μ ρ V τ Ψ f x r‖ ≤ ‖(H : ℂ) * fullActiveExternalPositiveAction n S B A Δ D ω μ ρ V τ (fun y s => (‖f y s‖ : ℂ)) x r‖ := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) have hw (e : FullActiveEdgeEvent n S B A Δ D x) := fullActiveEdgeEventWeight_nonneg n S B A Δ D ω μ ρ V hω hμ hρ hV x e have he : fullActiveExternalPositiveAction n S B A Δ D ω μ ρ V τ (fun y s => (‖f y s‖ : ℂ)) x r = ((∑ e : FullActiveEdgeEvent n S B A Δ D x, fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e * ‖f (fullActiveEdgeEventTarget n S B A Δ D x e) (τ (productActiveMemorySplit S B x).1 e.1 r)‖ : ℝ) : ℂ) := by rw [full_active_external_positive_eq_sum] simp only [fullActiveExternalCoefficientAction, mul_one, Complex.ofReal_sum, Complex.ofReal_mul] rw [he, norm_mul] simp only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hH] rw [abs_of_nonneg (sum_nonneg fun e _ => mul_nonneg (hw e) (norm_nonneg _))] unfold fullActiveExternalCoefficientAction calc _ ≤ ∑ e : FullActiveEdgeEvent n S B A Δ D x, ‖(fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e : ℂ) * Ψ x r e * f (fullActiveEdgeEventTarget n S B A Δ D x e) (τ (productActiveMemorySplit S B x).1 e.1 r)‖ := norm_sum_le _ _ _ ≤ ∑ e : FullActiveEdgeEvent n S B A Δ D x, fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e * H * ‖f (fullActiveEdgeEventTarget n S B A Δ D x e) (τ (productActiveMemorySplit S B x).1 e.1 r)‖ := by apply sum_le_sum intro e _ rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hw e)] exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hΨ x r e) (hw e)) (norm_nonneg _) _ = _ := by rw [mul_sum] apply sum_congr rfl intro e _ ring variable [Fintype R] theorem full_active_external_positive_energy_le (hω : ∀ c a, 0 ≤ ω c a) (hωmass : ∀ c, ∑ a, ω c a ≤ 1) {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, (S g)ᶜ.card ≤ T) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) : (∑ r, finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun x => fullActiveExternalPositiveAction n S B A Δ D ω μ ρ V τ f x r)) ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * ∑ r, finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun x => f x r) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) apply equiv_external_fiber_average_energy_le (productActiveMemorySplit S B) (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (sharedActiveWeight S μ) (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productActiveMemorySplit_weight_symm S B μ _) (sharedActiveWeight_nonneg S μ hμ) (productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1)) ω hω hωmass _ τ f (pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _) intro c a r exact unrestricted_coupled_cutoff_product_energy_le n (Δ c a) (D c a) μ ρ V (fun g => (S g)ᶜ.card) B hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht (fun _ _ => 1) (by intros; simp only [norm_one, le_refl]) _ (productActiveMemorySlice_symmetric S B (fun x => f x r) (hf r) c) theorem full_active_external_coefficient_energy_le (hω : ∀ c a, 0 ≤ ω c a) (hωmass : ∀ c, ∑ a, ω c a ≤ 1) {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, (S g)ᶜ.card ≤ T) (Ψ : ∀ x, R → FullActiveEdgeEvent n S B A Δ D x → ℂ) (H : ℝ) (hH : 0 ≤ H) (hΨ : ∀ x r e, ‖Ψ x r e‖ ≤ H) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) : (∑ r, finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun x => fullActiveExternalCoefficientAction n S B A Δ D ω μ ρ V τ Ψ f x r)) ≤ H ^ 2 * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * ∑ r, finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun x => f x r) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) have hp := full_active_external_positive_energy_le n S B A Δ D ω μ ρ V τ hω hωmass hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht (fun x r => (‖f x r‖ : ℂ)) (fun r => complexNormEnvelope_memory_symmetric (fun x => f x r) (hf r)) have he : (∑ r, finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun x => (‖f x r‖ : ℂ))) = ∑ r, finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun x => f x r) := by apply sum_congr rfl intro r _ exact complexNormEnvelope_energy _ (fun x => f x r) rw [he] at hp exact finite_external_energy_of_scaled_norm (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1)) H hH (unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) f (fullActiveExternalCoefficientAction n S B A Δ D ω μ ρ V τ Ψ f) (fullActiveExternalPositiveAction n S B A Δ D ω μ ρ V τ (fun x r => (‖f x r‖ : ℂ))) (full_active_external_coefficient_norm_le n S B A Δ D ω μ ρ V τ hω hμ hρ0.le (fun g => (hvmin.trans_le (hVlo g)).le) Ψ H hH hΨ f) hp end end Bounty end section /- Polynomial costs for the complete finite signed pattern family at an exceptional operation. The local physical energy constant remains explicit; no cancellation or small-norm premise is assumed. -/ namespace Bounty noncomputable def repeatedBigFamilyEnvelope (s m Q : ℕ) (xi : ℝ) : ℝ := 1 + (2 : ℝ) ^ (m * s) * (((Q * Q : ℕ) : ℝ) / xi) ^ 2 theorem repeated_big_family_envelope_nonneg (s m Q : ℕ) (xi : ℝ) : 0 ≤ repeatedBigFamilyEnvelope s m Q xi := by unfold repeatedBigFamilyEnvelope positivity theorem repeated_big_family_envelope_le {L a q x xi : ℝ} (s m Q : ℕ) (hL : 1 ≤ L) (ha : 0 ≤ a) (hq : 0 ≤ q) (hx : 0 ≤ x) (hs : (s : ℝ) ≤ a * Real.log L) (hQ : (Q : ℝ) ≤ L ^ q) (hxi : L ^ (-x) ≤ xi) : repeatedBigFamilyEnvelope s m Q xi ≤ 2 * L ^ ((m : ℝ) * a * Real.log 2 + 4 * q + 2 * x) := by have hL0 : 0 < L := zero_lt_one.trans_le hL have hxi0 : 0 < xi := (Real.rpow_pos_of_pos hL0 _).trans_le hxi have htwo := repeated_big_log_count_pow_le (L := L) (a := a) (b := 2) m s hL0 (by norm_num) hs have hQ2 : ((Q * Q : ℕ) : ℝ) ≤ L ^ (2 * q) := by push_cast calc (Q : ℝ) * Q ≤ L ^ q * L ^ q := mul_le_mul hQ hQ (Nat.cast_nonneg _) (Real.rpow_nonneg hL0.le _) _ = L ^ (2 * q) := by rw [← Real.rpow_add hL0]; congr 1; ring have hratio : ((Q * Q : ℕ) : ℝ) / xi ≤ L ^ (2 * q + x) := by calc _ ≤ L ^ (2 * q) / L ^ (-x) := div_le_div₀ (by positivity) hQ2 (Real.rpow_pos_of_pos hL0 _) hxi _ = _ := by rw [← Real.rpow_sub hL0]; congr 1; ring have hB : (((Q * Q : ℕ) : ℝ) / xi) ^ 2 ≤ L ^ (4 * q + 2 * x) := by calc _ ≤ (L ^ (2 * q + x)) ^ (2 : ℕ) := pow_le_pow_left₀ (by positivity) hratio 2 _ = _ := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL0.le]; congr 1; ring have hgamma : 0 ≤ (m : ℝ) * a * Real.log 2 + 4 * q + 2 * x := by have hl : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num) positivity have hp := mul_le_mul htwo hB (sq_nonneg _) (Real.rpow_nonneg hL0.le _) rw [← Real.rpow_add hL0, ← add_assoc] at hp have hone := Real.one_le_rpow hL hgamma unfold repeatedBigFamilyEnvelope linarith theorem repeated_big_group_energy_cost_le {L a K : ℝ} (s : ℕ) (hL : 0 < L) (hK : 0 ≤ K) (hs : (s : ℝ) ≤ a * Real.log L) : K ^ s ≤ L ^ (a * Real.log (max 1 K)) := by calc K ^ s ≤ (max 1 K) ^ s := pow_le_pow_left₀ hK (le_max_right 1 K) s _ ≤ _ := by simpa only [one_mul, Nat.cast_one] using repeated_big_log_count_pow_le (L := L) (a := a) (b := max 1 K) 1 s hL (le_max_left 1 K) hs end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset namespace Bounty section ResiduePath variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations G J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hk : ∀ j : Fin n, ∀ s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : ↥(P g) → ℝ) (η : Fin (n + 1) → ℝ) (V ρ : ℝ) (hV : V ≠ 0) (cap : ℕ) noncomputable def physicalAdjacentFiniteEdge (j : Fin n) : GlobalBirthRawStep (R := fun p : ↥(P g) => ZMod p.val) (physicalGroupBareFiniteActivity L g j.castSucc) (physicalGroupBareFiniteActivity L g j.succ) := physicalGroupBareFiniteEdge C aux k L a σ τ hlist hP hdis hcompat g hk β V ρ cap j variable [∀ p : ↥(P g), NeZero p.val] include hstep in theorem physical_adjacent_edge_kernel_to_real (j : Fin n) (z w : (p : ↥(P g)) → GhostPhaseState (ZMod p.val)) : globalBirthRawStepKernel (physicalAdjacentFiniteEdge C aux k L a σ τ hcompat hlist hP hdis g hk β V ρ cap j) z w = (physicalResidueCappedMovingEdgeKernel L a g β V ρ cap j.val z w : ℂ) := by unfold physicalResidueCappedMovingEdgeKernel rw [show globalBirthFiniteActivity (physicalGroupBareFiniteActivity L g) (j.val + 1) = physicalGroupBareFiniteActivity L g j.succ from global_birth_finite_activity_at _ j.succ] rw [show globalBirthFiniteActivity (physicalGroupBareFiniteActivity L g) j.val = physicalGroupBareFiniteActivity L g j.castSucc from global_birth_finite_activity_at _ j.castSucc] simp_rw [physical_residue_absolute_hit_step a g j] refine (physical_group_permuted_bare_raw_edge_kernel (C j) (aux j) (k j) (L j.castSucc) (L j.succ) (a j.castSucc) (σ j) (τ j) (hlist j) hP hdis (hcompat j) g (hk j) β ρ V cap z w).trans ?_ simp only [physicalGroupBareRawEdge, global_birth_raw_step_kernel_edge, ← hstep j, physical_group_phase_activity_permute] unfold ghostPhaseCappedDampedMovingEdge split_ifs <;> rfl /- The finite atomic physical kernels are exactly the real capped kernels, after their canonical complex embedding. Only used time indices are compared. -/ include hstep in theorem physical_adjacent_atomic_kernel_to_real (i : ℕ) (hi : i < 2 * n + 1) (z w : (p : ↥(P g)) → GhostPhaseState (ZMod p.val)) : globalBirthRawStepKernel (physicalGroupAdjacentFiniteStep C aux k L a σ τ hcompat hlist hP hdis g hk β η V ρ hV cap i) z w = ((finiteAlternatingKernel (physicalResidueCappedVisitKernel L g β η ρ cap) (physicalResidueCappedMovingEdgeKernel L a g β V ρ cap) i z w : ℝ) : ℂ) := by by_cases hp : i % 2 = 0 · let j : Fin (n + 1) := ⟨i / 2, by omega⟩ have hi' : i = 2 * j.val := by dsimp [j]; omega rw [hi', finite_alternating_kernel_even] exact (global_birth_finite_alternating_kernel_even (physicalGroupBareFiniteActivity L g) (physicalGroupBareFiniteVisit L g β η V ρ hV cap) (physicalAdjacentFiniteEdge C aux k L a σ τ hcompat hlist hP hdis g hk β V ρ cap) j z w).trans (physical_residue_visit_kernel_to_real L g β η V ρ hV cap j z w) · let j : Fin n := ⟨i / 2, by omega⟩ have hi' : i = 2 * j.val + 1 := by dsimp [j]; omega rw [hi', finite_alternating_kernel_odd] exact (global_birth_finite_alternating_kernel_odd (physicalGroupBareFiniteActivity L g) (physicalGroupBareFiniteVisit L g β η V ρ hV cap) (physicalAdjacentFiniteEdge C aux k L a σ τ hcompat hlist hP hdis g hk β V ρ cap) j z w).trans (physical_adjacent_edge_kernel_to_real C aux k L a σ τ hstep hcompat hlist hP hdis g hk β V ρ cap j z w) end ResiduePath end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V ρ : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) (cap : ℕ) noncomputable def physicalJointAdjacentStep (i : ℕ) (g : Fin N) : GlobalBirthRawStep (R := fun p : ↥(P g) => ZMod p.val) (physicalGroupBareAtomicActivity L g i) (physicalGroupBareAtomicActivity L g (i + 1)) := physicalGroupAdjacentFiniteStep C aux k L a σ τ hcompat hlist hP hdis g (fun j => hk j g) (β g) (η g) (V g) (ρ g) (hV g) cap i variable [∀ g, ∀ p : ↥(P g), NeZero p.val] /- All groups move simultaneously, with the total cutoff applied once to all input memories and once to all output memories at each atomic step. -/ noncomputable def physicalJointAdjacentRawHistory : ℂ := globalBirthJointRawHistory (fun i g => physicalGroupBareAtomicActivity L g i) (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V ρ hV cap) (fun _ => cap) (2 * n + 1) (fun s => if ∀ g, (s g).2.1 = 0 then 1 else 0) (globalBirthJointInitial (fun g => physicalGroupBareAtomicActivity L g 0)) /- Exact normalized physical residue trace across all groups. The total memory cap and every local row cap remain in the literal joint kernels. -/ theorem physical_joint_adjacent_normalized_history_trace : ((∏ g, ∏ s : PhysicalSlots J ell, β g (L 0 g s) / V g : ℝ) : ℂ) * physicalJointAdjacentRawHistory C aux k L a σ τ hcompat hlist hP hdis hk β η V ρ hV cap = ∑ z : Fin (2 * n + 2) → (g : Fin N) → (p : ↥(P g)) → GhostPhaseState (ZMod p.val), ((∏ g, ∏ p, ghostPhaseTerminal (physicalGroupPhaseActivity (L (Fin.last n)) g p) (z (Fin.last (2 * n + 1)) g p) : ℝ) : ℂ) * (((∏ g, ∏ p, ghostPhaseRunInitial (physicalGroupPhaseActivity (L 0) g p) (β g p) (V g) (z 0 g p) : ℝ) : ℂ) * ∏ j : Fin (2 * n + 1), globalBirthJointHistoryKernel (fun i g => physicalGroupBareAtomicActivity L g i) (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V ρ hV cap) (fun _ => cap) j.val (z j.succ) (z j.castSucc)) := by have h := global_birth_joint_weighted_empty_history_product (fun i g => physicalGroupBareAtomicActivity L g i) (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V ρ hV cap) (fun _ => cap) (fun g p => β g p / V g) (2 * n + 1) simpa only [physicalJointAdjacentRawHistory, physical_group_bare_atomic_activity_initial, physical_group_bare_atomic_activity_terminal, physical_group_initial_tilt_eq_active, ghost_phase_run_initial_eq_tilted] using h end ResiduePath end Bounty end section /- Exact product separation for the actual harmonic Mellin weight. -/ namespace Bounty theorem harmonic_mellin_weight_mul (v : ℝ) {s t : ℝ} (hs : 0 < s) (ht : 0 < t) : harmonicMellinWeight v (s*t) = harmonicMellinWeight v s*harmonicMellinWeight v t := by have he : Complex.I*((v*Real.log (s*t) : ℝ) : ℂ) = Complex.I*((v*Real.log s : ℝ) : ℂ)+Complex.I*((v*Real.log t : ℝ) : ℂ) := by rw [Real.log_mul hs.ne' ht.ne'] push_cast ring unfold harmonicMellinWeight rw [he, Complex.exp_add] simp only [Complex.ofReal_mul] ring end Bounty end section /- A locally incompatible physical edge has zero raw row on coherent memory. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (L R : PhysicalMarkLists P J ell) (hlist : physicalListAdmissible C aux L R) (g : G) (s t : PhysicalSlots J ell) (he : (L g s).val = (R g t).val) (hbad : ¬ ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) include G sharedInstance1 P J ell C aux k L R hlist g s t he hbad theorem physical_bad_common_mark_unshared : t ∈ physicalUnsharedSlots (ell := ell) (C g) := by rw [physicalUnsharedSlots, mem_compl] intro ht obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff (C g) t).mp ht have hs : L g s = L g (Sum.inl j) := (Subtype.ext he).trans (hlist.1 g j hj).symm have hd : ((L g (Sum.inl j)).val : ℤ) ∣ (physicalD C L aux : ℤ) := by exact_mod_cast physical_shared_label_dvd_D C L aux g j hj apply hbad rw [hs] exact dvd_mul_of_dvd_right hd k theorem physical_bad_common_mark_target_active : ∃ i, physicalGroupUnsharedEmbedding C R g i ∈ ghostPhaseActivitySupport (physicalGroupPhaseActivity L g) := by let t' : physicalUnsharedSlots (ell := ell) (C g) := ⟨t, physical_bad_common_mark_unshared C aux k L R hlist g s t he hbad⟩ refine ⟨(physicalGroupUnsharedIndex (ell := ell) (C g)).symm t', ?_⟩ change R g ((physicalGroupUnsharedIndex (ell := ell) (C g)) ((physicalGroupUnsharedIndex (ell := ell) (C g)).symm t')).val ∈ _ rw [Equiv.apply_symm_apply, physical_group_phase_activity_support_mem] exact (mem_physical_group_marks L g _).mpr ⟨s, he⟩ end theorem physical_full_edge_raw_zero_of_bad_common_mark {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (L R : PhysicalMarkLists P J ell) (hlist : physicalListAdmissible C aux L R) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (g : Fin N) (s t : PhysicalSlots J ell) (he : (L g s).val = (R g t).val) (hbad : ¬ ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) (u : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val)) (hu : GlobalBirthMemoryCoherent (ghostPhaseActivitySupport (physicalGroupPhaseActivity L g)) u.1 u.2) (F : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val) → ℂ) : physicalFullEdgeRawRow (B := B) C k L R β ρ V aux g F u = 0 := by apply global_birth_edge_raw_zero_of_active_target (active := ghostPhaseActivitySupport (physicalGroupPhaseActivity L g)) · exact hu.active_born · intro j hj exact disjoint_left.mp hu.labels_inactive (mem_image.mpr ⟨j, mem_univ j, rfl⟩) hj · exact physical_bad_common_mark_target_active C aux k L R hlist g s t he hbad end Bounty end section /- A locally incompatible physical displacement has zero normalized capped history. -/ open Finset open scoped Classical namespace Bounty theorem physical_capped_history_zero_of_bad {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hbad : ¬ ∀ j g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (η : PhysicalPrime P → ℕ → ℝ) (β : PhysicalPrime P → ℝ) (V : PhysicalPrime P → ℝ) (visitCap edgeCap : ℕ → ℕ) : ghostPhaseCappedHistory (fun p : PhysicalPrime P => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity L p.1) j p.2) (fun p => physicalResidueAbsoluteHit a p.1 p.2) η β V visitCap edgeCap n = 0 := by push Not at hbad obtain ⟨j, g, s, t, he, hn⟩ := hbad let p : ↥(P g) := (physicalPermuteLabels (σ j) (L j.castSucc)) g s have ha : physicalGroupPhaseActivity (L j.castSucc) g p = true := by rw [← physical_group_phase_activity_permute (σ j) (L j.castSucc) g] exact (physical_group_phase_activity_iff _ _ _).mpr ((mem_physical_group_marks _ _ _).mpr ⟨s, rfl⟩) have hb : physicalGroupPhaseActivity (L j.succ) g p = true := by rw [← physical_group_phase_activity_permute (τ j) (L j.succ) g] exact (physical_group_phase_activity_iff _ _ _).mpr ((mem_physical_group_marks _ _ _).mpr ⟨t, he.symm⟩) have hh : physicalResidueAbsoluteHit a g p j.val ≠ physicalResidueAbsoluteHit a g p (j.val + 1) := by intro hh unfold physicalResidueAbsoluteHit at hh rw [show globalBirthFiniteIndex n j.val = j.castSucc from global_birth_finite_index_at j.castSucc, show globalBirthFiniteIndex n (j.val + 1) = j.succ from global_birth_finite_index_at j.succ] at hh have hd := (ZMod.intCast_eq_intCast_iff_dvd_sub (a j.castSucc) (a j.succ) p.val).mp (neg_injective hh) apply hn simpa only [hstep j, add_sub_cancel_left] using hd apply ghost_phase_capped_history_zero_of_adjacent_hits _ _ _ _ _ _ _ n j.val j.isLt ⟨g, p⟩ · change globalBirthFiniteActivity (physicalGroupBareFiniteActivity L g) j.castSucc.val p = true rw [global_birth_finite_activity_at] exact ha · change globalBirthFiniteActivity (physicalGroupBareFiniteActivity L g) j.succ.val p = true rw [global_birth_finite_activity_at] exact hb · exact hh end Bounty end section /- A common positive limiting ratio for the shifted and ordinary sieve products. -/ open Finset Filter open scoped Topology namespace Bounty noncomputable def oddPrimeCorrectionProduct (z : ℝ) : ℝ := ∏ p ∈ (primeBand 0 z).erase 2, (1 - 1 / ((p : ℝ) - 1)^2) theorem odd_prime_correction_product_bounds (z : ℝ) : 1/2 ≤ oddPrimeCorrectionProduct z ∧ oddPrimeCorrectionProduct z ≤ 1 := by have hp : ∀ p ∈ (primeBand 0 z).erase 2, p.Prime := fun _ hp => small_prime_pool_prime (mem_of_mem_erase hp) have ho : ∀ p ∈ (primeBand 0 z).erase 2, p ≠ 2 := fun _ hp => (mem_erase.mp hp).1 refine ⟨finite_odd_prime_correction_product_lower _ hp ho, ?_⟩ apply prod_le_one₀ · intro p hmem have hp3 : (3 : ℝ) ≤ p := by exact_mod_cast (show 3 ≤ p by have := (hp p hmem).two_le; have := ho p hmem; omega) have hden : (1 : ℝ) ≤ ((p : ℝ)-1)^2 := by nlinarith exact sub_nonneg.mpr ((div_le_one (by positivity : (0 : ℝ) < ((p : ℝ)-1)^2)).mpr hden) · intro p _ exact sub_le_self _ (by positivity) theorem odd_prime_correction_product_antitone : Antitone oddPrimeCorrectionProduct := by intro x y hxy have hsub : (primeBand 0 x).erase 2 ⊆ (primeBand 0 y).erase 2 := by intro p hp obtain ⟨hp2, hp⟩ := mem_erase.mp hp obtain ⟨hpI, hprime⟩ := mem_filter.mp hp exact mem_erase.mpr ⟨hp2, mem_filter.mpr ⟨mem_Ioc.mpr ⟨(mem_Ioc.mp hpI).1, (mem_Ioc.mp hpI).2.trans (Nat.floor_mono hxy)⟩, hprime⟩⟩ apply prod_le_prod_of_subset_of_le_one₀ hsub · intro p hp have hp3 : (3 : ℝ) ≤ p := by have hprime := small_prime_pool_prime (mem_of_mem_erase hp) have hp2 := (mem_erase.mp hp).1 exact_mod_cast (show 3 ≤ p by have := hprime.two_le; omega) apply sub_nonneg.mpr apply (div_le_one (by nlinarith : (0 : ℝ) < ((p : ℝ)-1)^2)).mpr nlinarith · intro p _ _ exact sub_le_self _ (by positivity) noncomputable def shiftedSieveRatioConstant : ℝ := 2 * ⨅ z : ℝ, oddPrimeCorrectionProduct z theorem shifted_sieve_ratio_constant_bounds : 1 ≤ shiftedSieveRatioConstant ∧ shiftedSieveRatioConstant ≤ 2 := by have hlo : (1/2 : ℝ) ≤ ⨅ z : ℝ, oddPrimeCorrectionProduct z := le_ciInf (fun z => (odd_prime_correction_product_bounds z).1) have hbdd : BddBelow (Set.range oddPrimeCorrectionProduct) := ⟨1/2, by rintro _ ⟨z, rfl⟩; exact (odd_prime_correction_product_bounds z).1⟩ have hhi : (⨅ z : ℝ, oddPrimeCorrectionProduct z) ≤ 1 := (ciInf_le hbdd 0).trans (odd_prime_correction_product_bounds 0).2 unfold shiftedSieveRatioConstant constructor <;> linarith theorem odd_prime_correction_product_tendsto : Tendsto (fun z : ℝ => 2 * oddPrimeCorrectionProduct z) atTop (𝓝 shiftedSieveRatioConstant) := by have hbdd : BddBelow (Set.range oddPrimeCorrectionProduct) := ⟨1/2, by rintro _ ⟨z, rfl⟩; exact (odd_prime_correction_product_bounds z).1⟩ exact (tendsto_atTop_ciInf odd_prime_correction_product_antitone hbdd).const_mul 2 theorem shifted_prime_avoidance_product_factorization {z : ℝ} (hz : 2 ≤ z) : shiftedPrimeAvoidanceProduct z = 2 * (∏ p ∈ primeBand 0 z, (1-1/(p : ℝ))) * oddPrimeCorrectionProduct z := by have htwo : 2 ∈ primeBand 0 z := (mem_primeBand_iff (by norm_num) (by linarith) 2).mpr ⟨Nat.prime_two, by norm_num, hz⟩ have hprod : (∏ p ∈ primeBand 0 z, (1-1/(p : ℝ))) = (1/2 : ℝ) * ∏ p ∈ (primeBand 0 z).erase 2, (1-1/(p : ℝ)) := by rw [← mul_prod_erase (primeBand 0 z) (fun p : ℕ => (1-1/(p : ℝ))) htwo] norm_num calc shiftedPrimeAvoidanceProduct z = (∏ p ∈ (primeBand 0 z).erase 2, (1-1/(p : ℝ))) * oddPrimeCorrectionProduct z := by unfold shiftedPrimeAvoidanceProduct oddPrimeCorrectionProduct rw [← prod_mul_distrib] apply prod_congr rfl intro p hp have hp1 : (1 : ℝ) < p := by exact_mod_cast (small_prime_pool_prime (mem_of_mem_erase hp)).one_lt have hp0 : (p : ℝ) ≠ 0 := by linarith have hpred : (p : ℝ)-1 ≠ 0 := by linarith field_simp ring _ = _ := by rw [hprod]; ring end Bounty end section /- Ordinary rough-integer density upper bounds with the common Mertens constant. -/ open Finset Filter open scoped Topology namespace Bounty end Bounty end section /- Original full event rows with local phases, and their exact projected edge. -/ open Finset namespace Bounty universe uJ uK uP uA section Full variable {J : Type uJ} {K : Type uK} {N : ℕ} {P : Fin N → Type uP} [∀ g, Fintype (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (phase : ∀ tag (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), FullPermutationMixedEvent n S B A Δ D tag x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Full end Bounty end section /- A one-storage obstruction to prime-size smallness of the positive dirty remainder. Residues carry counting measure. Storing an active label transfers its existing label weight to memory, and does not supply an additional small atom. This does not assert anything about cancellation in a signed family. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- A literal average of promotion-containing, globally capped event operators gains its source-wise eligibility probability. The only rarity input is a scalar count; every individual operator bound is derived from the unrestricted event weights. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Sparse averaging can be performed before summing an external finite coordinate. The per-choice estimate is required only after that sum, so choice-dependent permutations of the external coordinate cost nothing. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- A reverse energy estimate transfers through a bilinear identity on a conjugation-stable class. This is useful for ordered-memory operators whose adjoint identity is valid on symmetric tests rather than all ordered tests. -/ open Finset Classical namespace Bounty theorem finite_weighted_bilinear_cauchy {X : Type*} [Fintype X] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (f g : X → ℂ) : ‖∑ x, (μ x : ℂ) * f x * g x‖ ≤ Real.sqrt (finiteWeightedEnergy μ f) * Real.sqrt (finiteWeightedEnergy μ g) := by have h := clean_raw_pairing_norm_le μ hμ (fun _ => 1) (by intro x; simp) (fun x => (starRingEnd ℂ) (f x)) g simpa only [cleanRawPairing, map_star, star_star, Complex.conj_conj, mul_one, finiteWeightedEnergy, Complex.norm_conj] using h /- The forward operator must preserve the test class, while the reverse operator only needs an energy estimate on that class. No matrix identity or linearity is assumed, and zero measure atoms are allowed. -/ theorem finite_symmetric_transpose_energy_le {X : Type*} [Fintype X] (μ : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) (S : (X → ℂ) → Prop) (A R : (X → ℂ) → X → ℂ) (hconj : ∀ f, S f → S (fun x => (starRingEnd ℂ) (f x))) (hA : ∀ f, S f → S (A f)) (hpair : ∀ f g, S f → S g → (∑ x, (μ x : ℂ) * f x * A g x) = ∑ x, (μ x : ℂ) * R f x * g x) {K : ℝ} (hK : 0 ≤ K) (hR : ∀ f, S f → finiteWeightedEnergy μ (R f) ≤ K * finiteWeightedEnergy μ f) (f : X → ℂ) (hf : S f) : finiteWeightedEnergy μ (A f) ≤ K * finiteWeightedEnergy μ f := by let g : X → ℂ := fun x => (starRingEnd ℂ) (A f x) have hg : S g := hconj (A f) (hA f hf) have hgn : finiteWeightedEnergy μ g = finiteWeightedEnergy μ (A f) := by simp only [g, finiteWeightedEnergy, Complex.norm_conj] have hn : cleanActiveNorm μ (A f) ≤ Real.sqrt K * cleanActiveNorm μ f := by apply clean_active_norm_le_of_self_pairing μ hμ (A f) (mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)) change ‖∑ x, (μ x : ℂ) * g x * A f x‖ ≤ _ rw [hpair g f hg hf] have hc := finite_weighted_bilinear_cauchy μ hμ (R g) f have hb := Real.sqrt_le_sqrt (hR g hg) rw [hgn, Real.sqrt_mul hK] at hb calc _ ≤ Real.sqrt (finiteWeightedEnergy μ (R g)) * Real.sqrt (finiteWeightedEnergy μ f) := hc _ ≤ (Real.sqrt K * Real.sqrt (finiteWeightedEnergy μ (A f))) * Real.sqrt (finiteWeightedEnergy μ f) := mul_le_mul_of_nonneg_right hb (Real.sqrt_nonneg _) _ = _ := by change _ = Real.sqrt K * Real.sqrt (finiteWeightedEnergy μ f) * Real.sqrt (finiteWeightedEnergy μ (A f)); ring have hnonneg : 0 ≤ finiteWeightedEnergy μ f := sum_nonneg fun x _ => mul_nonneg (hμ x) (sq_nonneg _) have hs := (sq_le_sq₀ (Real.sqrt_nonneg (finiteWeightedEnergy μ (A f))) (mul_nonneg (Real.sqrt_nonneg K) (Real.sqrt_nonneg (finiteWeightedEnergy μ f)))).mpr hn have hAnonneg : 0 ≤ finiteWeightedEnergy μ (A f) := sum_nonneg fun x _ => mul_nonneg (hμ x) (sq_nonneg _) rw [mul_pow, Real.sq_sqrt hK, Real.sq_sqrt hnonneg, Real.sq_sqrt hAnonneg] at hs exact hs end Bounty end section /- Exact small-source permutation insertion in the full active average. The conjugation works on arbitrary ordered labels, including repeated big labels. It changes no pending memory and fixes every group outside `small`. No equivariance of the intervening physical operator is required. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Actual old-index promotion eligibility under independent small-group source permutations. The pending memory and active big labels may repeat. The sign is the moving-frame convention Δ = -kD. -/ open Finset Filter open scoped Classical Topology namespace Bounty abbrev PromotionOldIndex {G : Type*} {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (state : ProductBoundedOrderedState P Z t B) := Σ g, Fin (state g).2.1.val theorem promotion_old_index_card {G : Type*} [Fintype G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (state : ProductBoundedOrderedState P Z t B) : Fintype.card (PromotionOldIndex state) = productTotalMemory state := by simp only [PromotionOldIndex, Fintype.card_sigma, Fintype.card_fin, productTotalMemory] theorem small_source_pending_eligible_fraction_le {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Type*} {J ell B : ℕ} {t : G → ℕ} (labels : PhysicalMarkLists Ps J ell) (hP : ∀ g p, p ∈ Ps g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (Ps g) (Ps h))) (n : ∀ g, P g → ℕ) (state : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (D_B : ℕ) (k : ℤ) (hp : ∀ g j, (n g ((state g).2.2 j).1).Prime) (hk : ∀ g j, ¬ (n g ((state g).2.2 j).1 : ℤ) ∣ k) (hlt : ∀ g j, ∀ A : PrimeOmissionChoices (physicalGroupMarks labels) ell, primeOmissionProduct (physicalGroupMarks labels) ell A < n g ((state g).2.2 j).1) : letI : DecidableEq S := Classical.decEq _ letI : DecidableEq (PhysicalSlots J ell) := Classical.decEq _ ((univ.filter (fun σ : S → Equiv.Perm (PhysicalSlots J ell) => ∃ g, (unrestrictedResidueEligible (n g) (-(k * (smallSourcePermutationDilation labels D_B σ : ℤ))) (smallSourcePermutationDilation labels D_B σ) (state g).2.2).Nonempty)).card : ℝ) / (Fintype.card (S → Equiv.Perm (PhysicalSlots J ell)) : ℝ) ≤ (productTotalMemory state : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ) := by let _ : DecidableEq S := Classical.decEq _ let _ : DecidableEq (PhysicalSlots J ell) := Classical.decEq _ let p : PromotionOldIndex state → ℕ := fun z => n z.1 ((state z.1).2.2 z.2).1 let r : ∀ z : PromotionOldIndex state, ZMod (p z) := fun z => ((state z.1).2.2 z.2).2 have h := small_source_permutation_eligible_fraction_le labels hP hdis D_B (univ : Finset (PromotionOldIndex state)) p (fun z => hp z.1 z.2) r k (fun z _ => hk z.1 z.2) (fun z _ A => hlt z.1 z.2 A) have he (σ : S → Equiv.Perm (PhysicalSlots J ell)) : (∃ z ∈ (univ : Finset (PromotionOldIndex state)), ¬ p z ∣ smallSourcePermutationDilation labels D_B σ ∧ r z + (k : ZMod (p z)) * (smallSourcePermutationDilation labels D_B σ : ZMod (p z)) = 0) ↔ ∃ g, (unrestrictedResidueEligible (n g) (-(k * (smallSourcePermutationDilation labels D_B σ : ℤ))) (smallSourcePermutationDilation labels D_B σ) (state g).2.2).Nonempty := by simp only [mem_univ, true_and, PromotionOldIndex, Sigma.exists, unrestricted_eligible_physical_congruence, p, r] simp only [he, card_univ, promotion_old_index_card] at h exact h theorem uniform_indicator_probability_eq {A : Type*} [Fintype A] (R : A → Prop) : (∑ a, if R a then 1 / (Fintype.card A : ℝ) else 0) = ((univ.filter R).card : ℝ) / (Fintype.card A : ℝ) := by calc _ = (∑ a, if R a then (1 : ℝ) else 0) / (Fintype.card A : ℝ) := by rw [sum_div] apply sum_congr rfl intro a _ split_ifs <;> simp _ = _ := by rw [sum_boole] end Bounty end section /- Exact product adjoints of real active-subset masks. The reverse has the same product memory law and the mandatory local volume ratio. Both endpoint total-memory cutoffs are retained. -/ open Finset Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) noncomputable def unrestrictedRealSlotLocals (w : ∀ g, Finset (Fin (t g)) → Finset (Fin (t g)) → ℝ) := fun g => unrestrictedSlotOperator (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (fun S T => (w g S T : ℂ)) noncomputable def unrestrictedRealSlotProduct (w : ∀ g, Finset (Fin (t g)) → Finset (Fin (t g)) → ℝ) := finiteCoordinateFinsetAction (unrestrictedRealSlotLocals n Δ D μ ρ V t B w) univ omit [Fintype G] [DecidableEq G] [∀ g p, NeZero (n g p)] in theorem unrestricted_real_slot_locals_event (w : ∀ g, Finset (Fin (t g)) → Finset (Fin (t g)) → ℝ) : unrestrictedRealSlotLocals n Δ D μ ρ V t B w = finiteLocalEventAction (fun g => UnrestrictedBoundedEvent (n g) (Δ g) (D g) (t g) B) (fun g s e => unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B s e * w g e.1 e.2.1) (fun g => unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B) := by funext g f s unfold unrestrictedRealSlotLocals unrestrictedSlotOperator rw [unrestricted_bounded_operator_eq_event_sum] simp only [finiteLocalEventAction, Complex.ofReal_mul] theorem unrestricted_real_slot_product_eq_coupled (w : ∀ g, Finset (Fin (t g)) → Finset (Fin (t g)) → ℝ) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) : unrestrictedRealSlotProduct n Δ D μ ρ V t B w f = unrestrictedCoupledProductOperator n Δ D μ ρ V t B (fun _ e => ((∏ g, w g (e g).1 (e g).2.1 : ℝ) : ℂ)) f := by unfold unrestrictedRealSlotProduct rw [unrestricted_real_slot_locals_event] rw [← finite_product_event_eq_coordinate_action] funext s simp only [finiteProductEventAction, unrestrictedCoupledProductOperator, prod_mul_distrib, Complex.ofReal_mul, mul_one] theorem unrestricted_real_slot_product_symmetric (w : ∀ g, Finset (Fin (t g)) → Finset (Fin (t g)) → ℝ) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (unrestrictedRealSlotProduct n Δ D μ ρ V t B w f) := by exact product_memory_finset_symmetric _ (fun i q hq => unrestricted_slot_operator_symmetric (n i) (Δ i) (D i) (μ i) ρ (V i) (t i) B (fun S T => (w i S T : ℂ)) q hq) univ f hf /- All group transposes are taken against the actual product factorial law. -/ theorem unrestricted_real_slot_product_pairing (hV : ∀ g, V g ≠ 0) (w : ∀ g, Finset (Fin (t g)) → Finset (Fin (t g)) → ℝ) (f g : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) (hg : ProductMemorySymmetric g) : (∑ s, (productMemoryWeight μ (fun j => unrestrictedResidueWeight (μ j)) s : ℂ) * f s * unrestrictedRealSlotProduct n Δ D μ ρ V t B w g s) = ∑ s, (productMemoryWeight μ (fun j => unrestrictedResidueWeight (μ j)) s : ℂ) * unrestrictedRealSlotProduct n (fun j => -Δ j) D μ ρ V t B (fun j S T => V j ^ T.card / V j ^ S.card * w j T S) f s * g s := by let A := unrestrictedRealSlotLocals n Δ D μ ρ V t B w let R := unrestrictedRealSlotLocals n (fun j => -Δ j) D μ ρ V t B (fun j S T => V j ^ T.card / V j ^ S.card * w j T S) have hA : ∀ i q, BoundedOrderedSymmetric q → BoundedOrderedSymmetric (A i q) := by intro i q hq exact unrestricted_slot_operator_symmetric (n i) (Δ i) (D i) (μ i) ρ (V i) (t i) B _ q hq have hR : ∀ i q, BoundedOrderedSymmetric q → BoundedOrderedSymmetric (R i q) := by intro i q hq exact unrestricted_slot_operator_symmetric (n i) (-Δ i) (D i) (μ i) ρ (V i) (t i) B _ q hq have hp : ∀ i q r, BoundedOrderedSymmetric q → BoundedOrderedSymmetric r → (∑ s, (boundedOrderedStateWeight (μ i) (unrestrictedResidueWeight (μ i)) s : ℂ) * q s * A i r s) = ∑ s, (boundedOrderedStateWeight (μ i) (unrestrictedResidueWeight (μ i)) s : ℂ) * R i q s * r s := by intro i q r hq hr simpa only [A, R, unrestrictedRealSlotLocals, Complex.ofReal_mul] using unrestricted_slot_operator_pairing_reverse (n i) (Δ i) (D i) (μ i) ρ (hV i) (t i) B (fun S T => (w i S T : ℂ)) q r hq hr have he := product_memory_compose_pairing_reverse μ (fun j => unrestrictedResidueWeight (μ j)) A R hA hR hp (univ : Finset G).toList f g hf hg have horder : finiteCoordinateCompose R (univ : Finset G).toList.reverse f = finiteCoordinateCompose R (univ : Finset G).toList f := by unfold R rw [unrestricted_real_slot_locals_event] exact finite_local_event_compose_reverse _ _ _ _ (univ : Finset G).nodup_toList f rw [horder] at he exact he /- Total cutoffs multiply the two paired tests; transposition keeps both. -/ theorem unrestricted_real_slot_cutoff_pairing (hV : ∀ g, V g ≠ 0) (w : ∀ g, Finset (Fin (t g)) → Finset (Fin (t g)) → ℝ) (f g : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) (hg : ProductMemorySymmetric g) : (∑ s, (productMemoryWeight μ (fun j => unrestrictedResidueWeight (μ j)) s : ℂ) * f s * productMemoryCutoff (unrestrictedRealSlotProduct n Δ D μ ρ V t B w (productMemoryCutoff g)) s) = ∑ s, (productMemoryWeight μ (fun j => unrestrictedResidueWeight (μ j)) s : ℂ) * productMemoryCutoff (unrestrictedRealSlotProduct n (fun j => -Δ j) D μ ρ V t B (fun j S T => V j ^ T.card / V j ^ S.card * w j T S) (productMemoryCutoff f)) s * g s := by have he := unrestricted_real_slot_product_pairing n Δ D μ ρ V t B hV w (productMemoryCutoff f) (productMemoryCutoff g) (productMemoryCutoff_symmetric f hf) (productMemoryCutoff_symmetric g hg) convert he using 1 <;> apply sum_congr rfl <;> intro s hs <;> unfold productMemoryCutoff <;> split_ifs <;> simp end end Bounty end section /- The exact small-active injectivity projection. It changes no pending memory and imposes no empty-memory condition on any group. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Sparse averaging over actual full-state events, auxiliary draws and source permutations. Shared labels are integrated in the full-state norm. The source gate makes any injectivity restriction explicit, and the rarity hypothesis is a scalar probability on literal eligible old positions. -/ open Finset open scoped Classical namespace Bounty section variable {G A : Type*} [Fintype G] [dG : DecidableEq G] [Fintype A] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : SharedActiveLabels P S → A → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) end end Bounty end section /- A mixed finite-event edge: small groups retain their original injective mark lists and residue coordinate, while `X` is an independent big-memory state. Only the big factor is expanded into memory events. This construction does not assert an invariant zero-small-memory sector of another model. -/ open Finset open scoped Classical namespace Bounty abbrev PhysicalSmallBigState {G : Type*} (P : G → Finset ℕ) (J ell : ℕ) (X : Type*) := PhysicalBareResidueState P J ell × X abbrev PhysicalSmallBigEvent {G X : Type*} {P : G → Finset ℕ} {J ell : ℕ} (E : PhysicalSharedLists P J → X → Type*) (s : PhysicalSmallBigState P J ell X) := PhysicalMarkLists P J ell × E (physicalSharedPrefix s.1.2) s.2 noncomputable def physicalSmallBigTarget {G X : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (E : PhysicalSharedLists P J → X → Type*) (target : ∀ d x, E d x → X) (k : X → ℤ) (s : PhysicalSmallBigState P J ell X) (e : PhysicalSmallBigEvent E s) : PhysicalSmallBigState P J ell X := ((physicalTranslateResidues s.1.1 (k s.2 * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ)), e.1), target (physicalSharedPrefix s.1.2) s.2 e.2) noncomputable def physicalSmallBigEventWeight {G X : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (q ζ : ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → X → Type*) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (s : PhysicalSmallBigState P J ell X) (e : PhysicalSmallBigEvent E s) : ℂ := physicalBarePatternScalar V (fun _ => (∅ : Finset (Fin J))) ζ (fun L _ _ => κ (physicalSharedPrefix L)) aux s.1.2 e.1 * ((physicalResidueVertexWeight s.1.2 (Real.sqrt q) s.1.1 * physicalResidueVertexWeight e.1 (Real.sqrt q) (physicalTranslateResidues s.1.1 (k s.2 * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ))) : ℝ) : ℂ) * a s.1.1 (physicalSharedPrefix s.1.2) s.2 e.2 noncomputable def physicalSmallBigAction {G X : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (q ζ : ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (f : PhysicalSmallBigState P J ell X → ℂ) (s : PhysicalSmallBigState P J ell X) : ℂ := ∑ e : PhysicalSmallBigEvent E s, physicalSmallBigEventWeight V q ζ aux κ E a k s e * f (physicalSmallBigTarget E target k s e) /- The mixed row has exactly the original small conditioning normalization; its remaining sum is only over big events at the retained small prefix. -/ theorem physical_small_big_action_bilinear {G X : Type*} [Fintype G] [dG : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (q ζ : ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (f : PhysicalMarkLists P J ell → ℂ) (F : PhysicalSmallBigState P J ell X → ℂ) (r : PhysicalResidues P) (x : X) : let tr := fun d : PhysicalSharedLists P J => physicalTranslateResidues r (k x * (physicalSharedProduct d : ℕ)) (∑ L, (physicalStateMass V J ell : ℂ) * (starRingEnd ℂ) (f L) * physicalSmallBigAction V q ζ aux κ E target a k F ((r, L), x)) = ∑ d, (starRingEnd ℂ) (physicalSmallCondition V q r d f) * (κ d * physicalPhase ζ (physicalSharedProduct d)) * (∑ e : E d x, a r d x e * physicalSmallCondition V q (tr d) d (fun R => F ((tr d, R), target d x e))) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro tr have h := physical_small_bilinear_events_with_prefix V hV q ζ (k x) r aux κ (fun d => E d x) (fun d _ e => a r d x e) f (fun d e s R => F ((s, R), target d x e)) change _ = _ at h erw [← h] apply sum_congr rfl intro L _ simp only [physicalSmallBigAction, Fintype.sum_prod_type, physicalSmallBigEventWeight, physicalSmallBigTarget, mul_sum] apply sum_congr rfl intro R _ apply sum_congr rfl intro e _ ring end Bounty end section /- Residues supported only on a selected set of physical prime groups. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalPrimeGroupEquiv {G : Type*} [Fintype G] (P : G → Finset ℕ) (groups : Finset G) : PhysicalPrime (fun g : ↥groups => P g.val) ≃ ↥(physicalPrimeGroups P groups) where toFun p := ⟨⟨p.1.val, p.2⟩, by simp [physicalPrimeGroups, p.1.property]⟩ invFun p := ⟨⟨p.val.1, (mem_filter.mp p.property).2⟩, p.val.2⟩ left_inv p := by cases p; rfl right_inv p := by cases p; rfl abbrev PhysicalGroupResidues {G : Type*} [Fintype G] (P : G → Finset ℕ) (groups : Finset G) := ∀ a : ↥(physicalPrimeGroups P groups), ZMod a.val.2.val noncomputable def physicalGroupResidueVector {G : Type*} [Fintype G] {P : G → Finset ℕ} {groups : Finset G} (r : PhysicalGroupResidues P groups) : PhysicalResidues (fun g : ↥groups => P g.val) := fun p => r (physicalPrimeGroupEquiv P groups p) theorem physical_group_marked_primes {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (groups : Finset G) (L : PhysicalMarkLists P J ell) (p : PhysicalPrime (fun g : ↥groups => P g.val)) : p ∈ physicalMarkedPrimes (fun g : ↥groups => L g.val) ↔ (⟨p.1.val, p.2⟩ : PhysicalPrime P) ∈ physicalMarkedPrimes L := by rw [mem_physical_marked_primes, mem_physical_marked_primes] rfl theorem physical_group_residue_path_factorization {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (groups : Finset G) (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (q : ℕ → ℝ) (r : PhysicalGroupResidues P groups) : (∏ a : ↥(physicalPrimeGroups P groups), activeResidueWeight visits (visits.filter (fun j => a.val ∈ physicalMarkedPrimes (labels j))) (fun j => -(offset j : ZMod a.val.2.val)) (fun j => 1 - q j) (r a)) = ∏ j ∈ visits, physicalResidueVertexWeight (fun g : ↥groups => labels j g.val) (q j) (physicalTranslateResidues (physicalGroupResidueVector r) (offset j)) := by classical rw [physical_residue_vertex_path_factorization (fun g h hgh => hP (fun hval => hgh (Subtype.ext hval))) (fun g => hprime g.val)] rw [← (physicalPrimeGroupEquiv P groups).prod_comp] apply prod_congr rfl intro p _ simp only [physicalGroupResidueVector, physicalPrimeGroupEquiv, Equiv.coe_fn_mk, physical_group_marked_primes] rfl end Bounty end section /- State and completion masses restricted to a chosen group set. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalGroupPathMass {G : Type*} {J : ℕ} (V : G → ℝ) (groups : Finset G) (C : ℕ → G → Finset (Fin J)) (ell n : ℕ) : ℝ := ∏ g ∈ groups, (1 / V g) ^ ((J + ell) + ∑ j ∈ range n, (ell + (C j g).card)) theorem physical_group_path_mass_factors {G : Type*} {J : ℕ} (V : G → ℝ) (groups : Finset G) (C : ℕ → G → Finset (Fin J)) (ell n : ℕ) : physicalGroupPathMass V groups C ell n = (∏ g ∈ groups, 1 / (V g) ^ (J + ell)) * ∏ j ∈ range n, ∏ g ∈ groups, 1 / (V g) ^ (ell + (C j g).card) := by classical unfold physicalGroupPathMass rw [prod_comm (s := range n) (t := groups), ← prod_mul_distrib] apply prod_congr rfl intro g hg simp only [one_div, ← inv_pow] rw [prod_pow_eq_pow_sum, ← pow_add] theorem physical_group_path_mass_split {G : Type*} [Fintype G] [DecidableEq G] {J : ℕ} (V : G → ℝ) (groups : Finset G) (C : ℕ → G → Finset (Fin J)) (ell n : ℕ) : physicalStateMass V J ell * (∏ j ∈ range n, physicalCompletionMass V (C j) ell) = physicalGroupPathMass V groups C ell n * physicalGroupPathMass V groupsᶜ C ell n := by classical rw [physical_path_mass_grouped] exact (prod_mul_prod_compl groups _).symm end Bounty end section /- Structural edge constraints and all normalized scalar products split exactly by groups. -/ open Finset open scoped Classical namespace Bounty section Groups variable {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (small : G → Prop) (C : G → Finset (Fin J)) (a : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) theorem physical_list_admissible_group_split : physicalListAdmissible C a L R ↔ physicalListAdmissible (fun g : {g // small g} => C g.val) (fun g => a g.val) (fun g => L g.val) (fun g => R g.val) ∧ physicalListAdmissible (fun g : {g // ¬small g} => C g.val) (fun g => a g.val) (fun g => L g.val) (fun g => R g.val) := by constructor · rintro ⟨hshared, hsource, htarget⟩ exact ⟨⟨(fun g => hshared g.val), (fun g => hsource g.val), (fun g => htarget g.val)⟩, ⟨(fun g => hshared g.val), (fun g => hsource g.val), (fun g => htarget g.val)⟩⟩ · rintro ⟨⟨hs, hLs, hRs⟩, ⟨hb, hLb, hRb⟩⟩ refine ⟨?_, ?_, ?_⟩ · intro g by_cases hg : small g · exact hs ⟨g, hg⟩ · exact hb ⟨g, hg⟩ · intro g by_cases hg : small g · exact hLs ⟨g, hg⟩ · exact hLb ⟨g, hg⟩ · intro g by_cases hg : small g · exact hRs ⟨g, hg⟩ · exact hRb ⟨g, hg⟩ variable [Fintype G] theorem physical_D_group_split : physicalD C L a = physicalD (fun g : {g // small g} => C g.val) (fun g => L g.val) (fun g => a g.val) * physicalD (fun g : {g // ¬small g} => C g.val) (fun g => L g.val) (fun g => a g.val) := (Fintype.prod_subtype_mul_prod_subtype small (physicalGroupD C L a)).symm theorem physical_aux_mass_group_split (V : G → ℝ) : physicalAuxMass V C a = physicalAuxMass (fun g : {g // small g} => V g.val) (fun g => C g.val) (fun g => a g.val) * physicalAuxMass (fun g : {g // ¬small g} => V g.val) (fun g => C g.val) (fun g => a g.val) := (Fintype.prod_subtype_mul_prod_subtype small (fun g => ∏ j : C g, physicalLabelLaw V g (a g j))).symm end Groups end Bounty end section /- Every original structural condition and scalar product is invariant under group reindexing. -/ open Finset open scoped Classical namespace Bounty section Reindex variable {G H : Type*} (e : G ≃ H) {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (a : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) theorem physical_list_admissible_group_reindex : physicalListAdmissible (fun h => C (e.symm h)) (physicalAuxGroupReindex e P J C a) (physicalMarkGroupReindex e P J ell L) (physicalMarkGroupReindex e P J ell R) ↔ physicalListAdmissible C a L R := by constructor · rintro ⟨hs, hL, hR⟩ refine ⟨?_, ?_, ?_⟩ · intro g obtain ⟨h, rfl⟩ := e.symm.surjective g exact hs h · intro g obtain ⟨h, rfl⟩ := e.symm.surjective g exact hL h · intro g obtain ⟨h, rfl⟩ := e.symm.surjective g exact hR h · rintro ⟨hs, hL, hR⟩ exact ⟨(fun h => hs (e.symm h)), (fun h => hL (e.symm h)), (fun h => hR (e.symm h))⟩ variable [Fintype G] [Fintype H] theorem physical_D_group_reindex : physicalD (fun h => C (e.symm h)) (physicalMarkGroupReindex e P J ell L) (physicalAuxGroupReindex e P J C a) = physicalD C L a := Equiv.prod_comp e.symm (physicalGroupD C L a) theorem physical_aux_mass_group_reindex (V : G → ℝ) : physicalAuxMass (fun h => V (e.symm h)) (fun h => C (e.symm h)) (physicalAuxGroupReindex e P J C a) = physicalAuxMass V C a := Equiv.prod_comp e.symm (fun g => ∏ j : C g, physicalLabelLaw V g (a g j)) theorem physical_completion_mass_group_reindex (V : G → ℝ) : physicalCompletionMass (fun h => V (e.symm h)) (fun h => C (e.symm h)) ell = physicalCompletionMass V C ell := Equiv.prod_comp e.symm (fun g => 1 / (V g) ^ (ell + (C g).card)) theorem physical_state_mass_group_reindex (V : G → ℝ) : physicalStateMass (fun h => V (e.symm h)) J ell = physicalStateMass V J ell := Equiv.prod_comp e.symm (fun g => 1 / (V g) ^ (J + ell)) include e in theorem physical_permutation_group_reindex_card : Fintype.card (PhysicalPermutations H J ell) = Fintype.card (PhysicalPermutations G J ell) := Fintype.card_congr (physicalPermutationGroupReindex e J ell).symm end Reindex end Bounty end section /- Port from PrimeNumberTheoremAnd/SmoothExistence.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ open MeasureTheory Set Real open scoped ContDiff lemma smooth_urysohn_support_Ioo {a b c d : ℝ} (h1 : a < b) (h3 : c < d) : ∃ Ψ : ℝ → ℝ, (ContDiff ℝ ∞ Ψ) ∧ (HasCompactSupport Ψ) ∧ Set.indicator (Set.Icc b c) 1 ≤ Ψ ∧ Ψ ≤ Set.indicator (Set.Ioo a d) 1 ∧ (Function.support Ψ = Set.Ioo a d) := by have := exists_contMDiff_zero_iff_one_iff_of_isClosed (n := ⊤) (modelWithCornersSelf ℝ ℝ) (s := Set.Iic a ∪ Set.Ici d) (t := Set.Icc b c) (IsClosed.union isClosed_Iic isClosed_Ici) isClosed_Icc (by simp_rw [Set.disjoint_union_left, Set.disjoint_iff, Set.subset_def, Set.mem_inter_iff, Set.mem_Iic, Set.mem_Icc, Set.mem_empty_iff_false, and_imp, imp_false, not_le, Set.mem_Ici] constructor <;> intros <;> linarith) obtain ⟨Ψ, hΨSmooth, hΨrange, hΨ0, hΨ1⟩ := this simp only [Set.mem_union, Set.mem_Iic, Set.mem_Ici, Set.mem_Icc] at * use Ψ simp only [range_subset_iff, mem_Icc] at hΨrange refine ⟨ContMDiff.contDiff hΨSmooth, ?_, ?_, ?_, ?_⟩ · apply HasCompactSupport.of_support_subset_isCompact (K := Set.Icc a d) isCompact_Icc simp only [Function.support_subset_iff, ne_eq, mem_Icc, ← hΨ0, not_or] bound · apply Set.indicator_le' · intro x hx rw [hΨ1 x |>.mp, Pi.one_apply] simpa using hx · exact fun x _ ↦ (hΨrange x).1 · intro x apply Set.le_indicator_apply · exact fun _ ↦ (hΨrange x).2 · intro hx rw [← hΨ0 x |>.mp] simpa [-not_and, mem_Ioo, not_and_or, not_lt] using hx · ext x simp only [Function.mem_support, ne_eq, mem_Ioo, ← hΨ0, not_or, not_le] end section /- Port from PrimeNumberTheoremAnd/MellinCalculus.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ open scoped ContDiff open Complex Topology Filter Real MeasureTheory Set variable {𝕂 : Type*} [RCLike 𝕂] theorem Complex.ofReal_rpow {x : ℝ} (h : x > 0) (y : ℝ) : (((x : ℝ) ^ (y : ℝ)) : ℝ) = (x : ℂ) ^ (y : ℂ) := by rw [rpow_def_of_pos h, ofReal_exp, ofReal_mul, Complex.ofReal_log h.le, Complex.cpow_def_of_ne_zero] simp only [ne_eq, ofReal_eq_zero, ne_of_gt h, not_false_eq_true] lemma Function.support_mul_subset_of_subset {s : Set ℝ} {f g : ℝ → 𝕂} (fSupp : f.support ⊆ s) : (f * g).support ⊆ s := by simp_rw [support_mul', inter_subset, subset_union_of_subset_right fSupp] lemma Function.support_deriv_subset_Icc {a b : ℝ} {f : ℝ → 𝕂} (fSupp : f.support ⊆ Set.Icc a b) : (deriv f).support ⊆ Set.Icc a b := by have := support_deriv_subset (f := fun x ↦ f x) dsimp [tsupport] at this have := subset_trans this <| closure_mono fSupp rwa [closure_Icc] at this lemma Filter.TendstoAtZero_of_support_in_Icc {a b : ℝ} (f : ℝ → 𝕂) (ha : 0 < a) (fSupp : f.support ⊆ Set.Icc a b) : Tendsto f (𝓝[>]0) (𝓝 0) := by apply Tendsto.comp (tendsto_nhds_of_eventually_eq ?_) tendsto_id filter_upwards [Ioo_mem_nhdsGT ha] with c hc; replace hc := (mem_Ioo.mp hc).2 have h : c ∉ Icc a b := fun h ↦ by linarith [mem_Icc.mp h] convert mt (Function.support_subset_iff.mp fSupp c) h; simp lemma Filter.TendstoAtTop_of_support_in_Icc {a b : ℝ} (f : ℝ → 𝕂) (fSupp : f.support ⊆ Set.Icc a b) : Tendsto f atTop (𝓝 0) := by apply Tendsto.comp (tendsto_nhds_of_eventually_eq ?_) tendsto_id filter_upwards [Ioi_mem_atTop b] with c hc; rw [mem_Ioi] at hc have h : c ∉ Icc a b := fun h ↦ by linarith [mem_Icc.mp h] convert mt (Function.support_subset_iff.mp fSupp c) h; simp lemma deriv.ofReal_comp' {f : ℝ → ℝ} : deriv (fun x : ℝ ↦ (f x : ℂ)) = (fun x ↦ ((deriv f) x : ℂ)) := funext fun _ ↦ deriv.ofReal_comp lemma PartialIntegration (f g : ℝ → ℂ) (fDiff : DifferentiableOn ℝ f (Ioi 0)) (gDiff : DifferentiableOn ℝ g (Ioi 0)) (fDerivgInt : IntegrableOn (f * deriv g) (Ioi 0)) (gDerivfInt : IntegrableOn (deriv f * g) (Ioi 0)) (lim_at_zero : Tendsto (f * g) (𝓝[>] 0) (𝓝 0)) (lim_at_inf : Tendsto (f * g) atTop (𝓝 0)) : ∫ x in Ioi 0, f x * deriv g x = -∫ x in Ioi 0, deriv f x * g x := by simpa using integral_Ioi_mul_deriv_eq_deriv_mul (fun x hx ↦ fDiff.hasDerivAt (Ioi_mem_nhds hx)) (fun x hx ↦ gDiff.hasDerivAt (Ioi_mem_nhds hx)) fDerivgInt gDerivfInt lim_at_zero lim_at_inf lemma PartialIntegration_of_support_in_Icc {a b : ℝ} (f g : ℝ → ℂ) (ha : 0 < a) (h : a ≤ b) (fSupp : f.support ⊆ Set.Icc a b) (fDiff : DifferentiableOn ℝ f (Ioi 0)) (gDiff : DifferentiableOn ℝ g (Ioi 0)) (fderivCont : ContinuousOn (deriv f) (Ioi 0)) (gderivCont : ContinuousOn (deriv g) (Ioi 0)) : ∫ x in Ioi 0, f x * deriv g x = -∫ x in Ioi 0, deriv f x * g x := by have Icc_sub : Icc a b ⊆ Ioi 0 := (Icc_subset_Ioi_iff h).mpr ha have fderivSupp := Function.support_deriv_subset_Icc fSupp have fgSupp : (f * g).support ⊆ Icc a b := Function.support_mul_subset_of_subset fSupp have fDerivgInt : IntegrableOn (f * deriv g) (Ioi 0) := by apply (integrableOn_iff_integrable_of_support_subset <| Function.support_mul_subset_of_subset fSupp).mp exact fDiff.continuousOn.mono Icc_sub |>.mul (gderivCont.mono Icc_sub) |>.integrableOn_Icc have gDerivfInt : IntegrableOn (deriv f * g) (Ioi 0) := by apply (integrableOn_iff_integrable_of_support_subset <| Function.support_mul_subset_of_subset fderivSupp).mp exact fderivCont.mono Icc_sub |>.mul (gDiff.continuousOn.mono Icc_sub) |>.integrableOn_Icc have lim_at_zero : Tendsto (f * g) (𝓝[>]0) (𝓝 0) := TendstoAtZero_of_support_in_Icc (f * g) ha fgSupp have lim_at_inf : Tendsto (f * g) atTop (𝓝 0) := TendstoAtTop_of_support_in_Icc (f * g) fgSupp apply PartialIntegration f g fDiff gDiff fDerivgInt gDerivfInt lim_at_zero lim_at_inf noncomputable def MellinConvolution (f g : ℝ → 𝕂) (x : ℝ) : 𝕂 := ∫ y in Ioi 0, f y * g (x / y) / y open Pointwise in lemma support_MellinConvolution_subsets {f g : ℝ → 𝕂} {A B : Set ℝ} (hf : f.support ⊆ A) (hg : g.support ⊆ B) : (MellinConvolution f g).support ⊆ A * B := by rw [Function.support_subset_iff'] at hf hg ⊢ intro x hx unfold MellinConvolution simp only [Set.mem_mul, not_exists, not_and] at hx apply MeasureTheory.integral_eq_zero_of_ae filter_upwards [ae_restrict_mem (by measurability)] intro y hy simp only [mem_Ioi] at hy simp only [Pi.zero_apply, div_eq_zero_iff, mul_eq_zero, map_eq_zero] left by_cases hyA : y ∈ A · right apply hg intro hxyB apply hx _ hyA _ hxyB field_simp · left apply hf _ hyA lemma MellinOfPsi_aux {ν : ℝ → ℝ} (diffν : ContDiff ℝ 1 ν) (suppν : ν.support ⊆ Set.Icc (1 / 2) 2) {s : ℂ} (hs : s ≠ 0) : ∫ (x : ℝ) in Ioi 0, (ν x) * (x : ℂ) ^ (s - 1) = - (1 / s) * ∫ (x : ℝ) in Ioi 0, (deriv ν x) * (x : ℂ) ^ s := by let g (s : ℂ) := fun (x : ℝ) ↦ x ^ s / s have gderiv {s : ℂ} (hs : s ≠ 0) {x: ℝ} (hx : x ∈ Ioi 0) : deriv (g s) x = x ^ (s - 1) := by have := HasDerivAt.cpow_const (c := s) (hasDerivAt_id (x : ℂ)) (Or.inl hx) simp_rw [mul_one, id_eq] at this rw [deriv_div_const, deriv.comp_ofReal (e := fun x ↦ x ^ s)] · rw [this.deriv, mul_div_right_comm, div_self hs, one_mul] · apply hasDerivAt_deriv_iff.mp simp only [this.deriv, this] calc _ = ∫ (x : ℝ) in Ioi 0, ↑(ν x) * deriv (@g s) x := ?_ _ = -∫ (x : ℝ) in Ioi 0, deriv (fun x ↦ ↑(ν x)) x * @g s x := ?_ _ = -∫ (x : ℝ) in Ioi 0, deriv ν x * @g s x := ?_ _ = -∫ (x : ℝ) in Ioi 0, deriv ν x * x ^ s / s := by simp only [mul_div, g] _ = _ := ?_ · rw [setIntegral_congr_fun (by simp)] intro _ hx simp only [gderiv hs hx] · apply PartialIntegration_of_support_in_Icc (ν ·) (g s) (a := 1 / 2) (b := 2) (by norm_num) (by norm_num) · simpa only [Function.support_subset_iff, ne_eq, ofReal_eq_zero] · exact (Differentiable.ofReal_comp_iff.mpr (diffν.differentiable (by norm_num))).differentiableOn · refine DifferentiableOn.div_const ?_ s intro a ha refine DifferentiableAt.comp_ofReal (e := fun x ↦ x ^ s) ?_ |>.differentiableWithinAt apply differentiableAt_fun_id.cpow (differentiableAt_const s) <| by exact Or.inl ha · simp only [deriv.ofReal_comp'] exact continuous_ofReal.comp (diffν.continuous_deriv (by norm_num)) |>.continuousOn · apply ContinuousOn.congr (f := fun (x : ℝ) ↦ (x : ℂ) ^ (s - 1)) ?_ fun x hx ↦ gderiv hs hx exact Continuous.continuousOn (by continuity) |>.cpow continuousOn_const (by simp) · congr; funext; congr apply (hasDerivAt_deriv_iff.mpr ?_).ofReal_comp.deriv exact diffν.contDiffAt.differentiableAt (by norm_num) · simp only [neg_mul, neg_inj] conv => lhs; rhs; intro; rw [← mul_one_div, mul_comm] rw [integral_const_mul] noncomputable def DeltaSpike (ν : ℝ → ℝ) (ε : ℝ) : ℝ → ℝ := fun x ↦ ν (x ^ (1 / ε)) / ε noncomputable def Smooth1 (ν : ℝ → ℝ) (ε : ℝ) : ℝ → ℝ := MellinConvolution (fun x ↦ if 0 < x ∧ x ≤ 1 then 1 else 0) (DeltaSpike ν ε) end section /- Port from PrimeNumberTheoremAnd/ResidueCalcOnRectangles.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ open Complex BigOperators Nat Classical Real Topology Filter open Set MeasureTheory intervalIntegral Asymptotics open scoped Interval variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] {f g : ℂ → E} {z w p c A : ℂ} {x x₁ x₂ y y₁ y₂ σ : ℝ} noncomputable def HIntegral (f : ℂ → E) (x₁ x₂ y : ℝ) : E := ∫ x in x₁..x₂, f (x + y * I) noncomputable def VIntegral (f : ℂ → E) (x y₁ y₂ : ℝ) : E := I • ∫ y in y₁..y₂, f (x + y * I) noncomputable def RectangleIntegral (f : ℂ → E) (z w : ℂ) : E := HIntegral f z.re w.re z.im - HIntegral f z.re w.re w.im + VIntegral f w.re z.im w.im - VIntegral f z.re z.im w.im abbrev HolomorphicOn (f : ℂ → E) (s : Set ℂ) : Prop := DifferentiableOn ℂ f s theorem rectangleIntegral_symm (f : ℂ → E) (z w : ℂ) : RectangleIntegral f z w = RectangleIntegral f w z := by simp_rw [RectangleIntegral, HIntegral, VIntegral, intervalIntegral.integral_symm w.re, intervalIntegral.integral_symm w.im, sub_neg_eq_add, smul_neg, sub_neg_eq_add, ← sub_eq_add_neg, neg_add_eq_sub, sub_add_eq_add_sub] def RectangleBorderIntegrable (f : ℂ → E) (z w : ℂ) : Prop := IntervalIntegrable (fun x => f (x + z.im * I)) volume z.re w.re ∧ IntervalIntegrable (fun x => f (x + w.im * I)) volume z.re w.re ∧ IntervalIntegrable (fun y => f (w.re + y * I)) volume z.im w.im ∧ IntervalIntegrable (fun y => f (z.re + y * I)) volume z.im w.im theorem RectangleBorderIntegrable.add {f g : ℂ → E} (hf : RectangleBorderIntegrable f z w) (hg : RectangleBorderIntegrable g z w) : RectangleIntegral (f + g) z w = RectangleIntegral f z w + RectangleIntegral g z w := by dsimp [RectangleIntegral, HIntegral, VIntegral] have h₁ := intervalIntegral.integral_add hf.1 hg.1 have h₂ := intervalIntegral.integral_add hf.2.1 hg.2.1 have h₃ := intervalIntegral.integral_add hf.2.2.1 hg.2.2.1 have h₄ := intervalIntegral.integral_add hf.2.2.2 hg.2.2.2 rw [h₁, h₂, h₃, h₄] simp only [smul_add] abel theorem RectangleIntegral.const_smul (f : ℂ → E) (z w c : ℂ) : RectangleIntegral (fun s => c • f s) z w = c • RectangleIntegral f z w := by simp [RectangleIntegral, HIntegral, VIntegral, smul_add, smul_sub, smul_smul, mul_comm] lemma integral_const_div_sq_add_sq (hy : y ≠ 0) : ∫ x in x₁..x₂, y / (x ^ 2 + y ^ 2) = Real.arctan (x₂ / y) - Real.arctan (x₁ / y) := by nth_rewrite 1 [← div_mul_cancel₀ x₁ hy, ← div_mul_cancel₀ x₂ hy] simp_rw [← mul_integral_comp_mul_right, ← intervalIntegral.integral_const_mul, ← integral_one_div_one_add_sq] exact integral_congr fun x _ => by field_simp ring def HasSimplePolesOn (f : ℂ → ℂ) (s : Set ℂ) : Prop := ∀ z ∈ s, (-1 : ℤ) ≤ meromorphicOrderAt f z lemma HasSimplePolesOn.mono {f : ℂ → ℂ} {s t : Set ℂ} (h : HasSimplePolesOn f t) (hst : s ⊆ t) : HasSimplePolesOn f s := by intro z hz exact h z (hst hz) end section /- # Continuous reciprocal-prime test functions The fixed-interval reciprocal-prime limit from `MertensPositiveConstant` extends here to every continuous real test function on a compact interval in `(0, ∞)`. The proof uses uniform finite partitions and explicit sup-norm error bounds. No prime number theorem, logarithmic product constant identification, or extra analytic hypothesis is needed. -/ namespace Bounty open Finset Filter Real MeasureTheory open scoped Topology theorem prime_band_sum_add_adjacent {M : Type*} [AddCommMonoid M] (w : ℕ → M) {A B C : ℝ} (hAB : A ≤ B) (hBC : B ≤ C) : (∑ p ∈ primeBand A B, w p) + ∑ p ∈ primeBand B C, w p = ∑ p ∈ primeBand A C, w p := by classical have hu : primeBand A B ∪ primeBand B C = primeBand A C := by unfold primeBand rw [← filter_union, Ioc_union_Ioc_eq_Ioc (Nat.floor_mono hAB) (Nat.floor_mono hBC)] have hd : Disjoint (primeBand A B) (primeBand B C) := by exact (Ioc_disjoint_Ioc_of_le (a := ⌊A⌋₊) (d := ⌊C⌋₊) le_rfl).mono (filter_subset _ _) (filter_subset _ _) rw [← hu, sum_union hd] theorem sum_prime_bands_adjacent {M : Type*} [AddCommMonoid M] (w : ℕ → M) (t : ℕ → ℝ) (ht : Monotone t) (N : ℕ) : (∑ i ∈ range N, ∑ p ∈ primeBand (t i) (t (i+1)), w p) = ∑ p ∈ primeBand (t 0) (t N), w p := by induction N with | zero => simp [primeBand] | succ N ih => rw [sum_range_succ, ih] exact prime_band_sum_add_adjacent w (ht (Nat.zero_le N)) (ht (Nat.le_succ N)) theorem prime_log_coordinate_mem {a b L : ℝ} (hL : 0 < L) {p : ℕ} (hp : p ∈ primeBand (exp (a*L)) (exp (b*L))) : a < log (p : ℝ)/L ∧ log (p : ℝ)/L ≤ b := by obtain ⟨hprime, hlo, hhi⟩ := (mem_primeBand_iff (exp_pos _).le (exp_pos _).le p).mp hp have hp0 : (0 : ℝ) < p := by exact_mod_cast hprime.pos constructor · apply (lt_div_iff₀ hL).mpr have h := log_lt_log (exp_pos _) hlo simpa only [log_exp] using h · apply (div_le_iff₀ hL).mpr have h := log_le_log hp0 hhi simpa only [log_exp] using h theorem prime_band_weighted_sample_error (f : ℝ → ℝ) {a b L c η : ℝ} (hL : 0 < L) (hosc : ∀ t ∈ Set.Icc a b, |f t-c| ≤ η) : |(∑ p ∈ primeBand (exp (a*L)) (exp (b*L)), f (log (p : ℝ)/L)/(p : ℝ)) - c * primeBandHarmonic (exp (a*L)) (exp (b*L))| ≤ η * primeBandHarmonic (exp (a*L)) (exp (b*L)) := by unfold primeBandHarmonic rw [mul_sum, ← sum_sub_distrib] calc _ ≤ ∑ p ∈ primeBand (exp (a*L)) (exp (b*L)), |f (log (p : ℝ)/L)/(p : ℝ)-c*(1/(p : ℝ))| := abs_sum_le_sum_abs _ _ _ ≤ ∑ p ∈ primeBand (exp (a*L)) (exp (b*L)), η*(1/(p : ℝ)) := by apply sum_le_sum intro p hp have hcoord := prime_log_coordinate_mem hL hp have h := hosc _ ⟨hcoord.1.le, hcoord.2⟩ rw [show f (log (p : ℝ)/L)/(p : ℝ)-c*(1/(p : ℝ)) = (f (log (p : ℝ)/L)-c)*(1/(p : ℝ)) by ring, abs_mul, abs_of_nonneg (by positivity : 0 ≤ 1/(p : ℝ))] exact mul_le_mul_of_nonneg_right h (by positivity) _ = _ := (mul_sum ..).symm noncomputable def reciprocalGrid (a b : ℝ) (N i : ℕ) : ℝ := a + (b-a)*(i : ℝ)/(N : ℝ) theorem reciprocal_grid_zero (a b : ℝ) (N : ℕ) : reciprocalGrid a b N 0 = a := by simp [reciprocalGrid] theorem reciprocal_grid_end (a b : ℝ) {N : ℕ} (hN : 0 < N) : reciprocalGrid a b N N = b := by have hNr : (N : ℝ) ≠ 0 := by exact_mod_cast hN.ne' simp [reciprocalGrid, hNr] theorem reciprocal_grid_monotone {a b : ℝ} (hab : a ≤ b) (N : ℕ) : Monotone (reciprocalGrid a b N) := by intro i j hij unfold reciprocalGrid exact add_le_add le_rfl (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left (Nat.cast_le.mpr hij) (sub_nonneg.mpr hab)) (Nat.cast_nonneg N)) theorem reciprocal_grid_step (a b : ℝ) (N i : ℕ) : reciprocalGrid a b N (i+1)-reciprocalGrid a b N i = (b-a)/(N : ℝ) := by unfold reciprocalGrid push_cast ring theorem reciprocal_grid_mem {a b : ℝ} (hab : a ≤ b) {N i : ℕ} (hN : 0 < N) (hi : i ≤ N) : reciprocalGrid a b N i ∈ Set.Icc a b := by have hm := reciprocal_grid_monotone hab N constructor · simpa only [reciprocal_grid_zero] using hm (Nat.zero_le i) · simpa only [reciprocal_grid_end a b hN] using hm hi theorem reciprocal_weight_interval_integrable (f : ℝ → ℝ) {u v : ℝ} (hu : 0 < u) (huv : u ≤ v) (hf : ContinuousOn f (Set.Icc u v)) : IntervalIntegrable (fun t => f t/t) volume u v := by apply ContinuousOn.intervalIntegrable rw [Set.uIcc_of_le huv] exact hf.div continuousOn_id (fun t ht => ne_of_gt (hu.trans_le ht.1)) theorem reciprocal_integral_sample_error (f : ℝ → ℝ) {a u v c η : ℝ} (ha : 0 < a) (hau : a ≤ u) (huv : u ≤ v) (hη : 0 ≤ η) (hf : ContinuousOn f (Set.Icc u v)) (hosc : ∀ t ∈ Set.Icc u v, |f t-c| ≤ η) : |(∫ t in u..v, f t/t) - c*log (v/u)| ≤ (η/a)*(v-u) := by have hu : 0 < u := ha.trans_le hau have hv : 0 < v := hu.trans_le huv have hfint := reciprocal_weight_interval_integrable f hu huv hf have hcint := reciprocal_weight_interval_integrable (fun _ => c) hu huv continuousOn_const have hcval : (∫ t in u..v, c/t) = c*log (v/u) := by simp only [div_eq_mul_inv] rw [intervalIntegral.integral_const_mul, integral_inv_of_pos hu hv] simp only [div_eq_mul_inv] rw [← hcval, ← intervalIntegral.integral_sub hfint hcint] have hnorm := intervalIntegral.norm_integral_le_of_norm_le_const (a := u) (b := v) (C := η/a) (f := fun t => f t/t-c/t) (by intro t ht rw [Set.uIoc_of_le huv] at ht have ht0 : 0 < t := hu.trans ht.1 rw [Real.norm_eq_abs, ← sub_div, abs_div, abs_of_pos ht0] exact (div_le_div_of_nonneg_right (hosc t ⟨ht.1.le, ht.2⟩) ht0.le).trans (div_le_div_of_nonneg_left hη ha (hau.trans ht.1.le))) simpa only [Real.norm_eq_abs, abs_of_nonneg (sub_nonneg.mpr huv)] using hnorm theorem reciprocal_grid_prime_approximation (f : ℝ → ℝ) {a b L η : ℝ} (hab : a ≤ b) (hL : 0 < L) {N : ℕ} (hN : 0 < N) (hosc : ∀ i : ℕ, i < N → ∀ x ∈ Set.Icc (reciprocalGrid a b N i) (reciprocalGrid a b N (i+1)), |f x-f (reciprocalGrid a b N i)| ≤ η) : |(∑ p ∈ primeBand (exp (a*L)) (exp (b*L)), f (log (p : ℝ)/L)/(p : ℝ)) - ∑ i ∈ range N, f (reciprocalGrid a b N i) * primeBandHarmonic (exp (reciprocalGrid a b N i*L)) (exp (reciprocalGrid a b N (i+1)*L))| ≤ η * primeBandHarmonic (exp (a*L)) (exp (b*L)) := by have hm : Monotone (fun i => exp (reciprocalGrid a b N i*L)) := by intro i j hij exact exp_le_exp.mpr (mul_le_mul_of_nonneg_right (reciprocal_grid_monotone hab N hij) hL.le) have hsplit (w : ℕ → ℝ) : (∑ i ∈ range N, ∑ p ∈ primeBand (exp (reciprocalGrid a b N i*L)) (exp (reciprocalGrid a b N (i+1)*L)), w p) = ∑ p ∈ primeBand (exp (a*L)) (exp (b*L)), w p := by simpa only [reciprocal_grid_zero, reciprocal_grid_end a b hN] using sum_prime_bands_adjacent w _ hm N rw [← hsplit (fun p => f (log (p : ℝ)/L)/(p : ℝ)), ← sum_sub_distrib] calc _ ≤ ∑ i ∈ range N, |(∑ p ∈ primeBand (exp (reciprocalGrid a b N i*L)) (exp (reciprocalGrid a b N (i+1)*L)), f (log (p : ℝ)/L)/(p : ℝ)) - f (reciprocalGrid a b N i) * primeBandHarmonic (exp (reciprocalGrid a b N i*L)) (exp (reciprocalGrid a b N (i+1)*L))| := abs_sum_le_sum_abs _ _ _ ≤ ∑ i ∈ range N, η * primeBandHarmonic (exp (reciprocalGrid a b N i*L)) (exp (reciprocalGrid a b N (i+1)*L)) := by apply sum_le_sum intro i hi exact prime_band_weighted_sample_error f hL (hosc i (mem_range.mp hi)) _ = _ := by rw [← mul_sum] congr 1 exact hsplit (fun p => 1/(p : ℝ)) theorem sum_range_adjacent_real_difference (t : ℕ → ℝ) (N : ℕ) : (∑ i ∈ range N, (t (i+1)-t i)) = t N-t 0 := by induction N with | zero => simp | succ N ih => rw [sum_range_succ, ih]; ring theorem reciprocal_grid_integral_approximation (f : ℝ → ℝ) {a b η : ℝ} (ha : 0 < a) (hab : a ≤ b) (hη : 0 ≤ η) (hf : ContinuousOn f (Set.Icc a b)) {N : ℕ} (hN : 0 < N) (hosc : ∀ i : ℕ, i < N → ∀ x ∈ Set.Icc (reciprocalGrid a b N i) (reciprocalGrid a b N (i+1)), |f x-f (reciprocalGrid a b N i)| ≤ η) : |(∫ t in a..b, f t/t) - ∑ i ∈ range N, f (reciprocalGrid a b N i) * log (reciprocalGrid a b N (i+1)/reciprocalGrid a b N i)| ≤ (η/a)*(b-a) := by have hm := reciprocal_grid_monotone hab N have hcell (i : ℕ) (hi : i < N) : ContinuousOn f (Set.Icc (reciprocalGrid a b N i) (reciprocalGrid a b N (i+1))) := by apply hf.mono intro x hx exact ⟨(reciprocal_grid_mem hab hN hi.le).1.trans hx.1, hx.2.trans (reciprocal_grid_mem hab hN (Nat.succ_le_of_lt hi)).2⟩ have hint (i : ℕ) (hi : i < N) : IntervalIntegrable (fun t => f t/t) volume (reciprocalGrid a b N i) (reciprocalGrid a b N (i+1)) := by exact reciprocal_weight_interval_integrable f (ha.trans_le (reciprocal_grid_mem hab hN hi.le).1) (hm (Nat.le_succ i)) (hcell i hi) have hsplit : (∑ i ∈ range N, ∫ t in reciprocalGrid a b N i.. reciprocalGrid a b N (i+1), f t/t) = ∫ t in a..b, f t/t := by simpa only [reciprocal_grid_zero, reciprocal_grid_end a b hN] using intervalIntegral.sum_integral_adjacent_intervals hint rw [← hsplit, ← sum_sub_distrib] calc _ ≤ ∑ i ∈ range N, |(∫ t in reciprocalGrid a b N i.. reciprocalGrid a b N (i+1), f t/t) - f (reciprocalGrid a b N i) * log (reciprocalGrid a b N (i+1)/reciprocalGrid a b N i)| := abs_sum_le_sum_abs _ _ _ ≤ ∑ i ∈ range N, (η/a)*(reciprocalGrid a b N (i+1)-reciprocalGrid a b N i) := by apply sum_le_sum intro i hi exact reciprocal_integral_sample_error f ha (reciprocal_grid_mem hab hN (mem_range.mp hi).le).1 (hm (Nat.le_succ i)) hη (hcell i (mem_range.mp hi)) (hosc i (mem_range.mp hi)) _ = _ := by rw [← mul_sum, sum_range_adjacent_real_difference, reciprocal_grid_zero, reciprocal_grid_end a b hN] end Bounty /- Public declaration closure audit. -/ end section /- Joint continuity of finite-depth and stable Buchstab densities. -/ open Filter open scoped Topology namespace Bounty theorem buchstab_depth_density_continuous (n : ℕ) : ContinuousOn (fun p : ℝ × ℝ => buchstabDepthDensity n p.1 p.2) {p | 0 < p.1 ∧ 0 < p.2} := by let P := {p : ℝ × ℝ // 0 < p.1 ∧ 0 < p.2} suffices h : Continuous (fun p : P => buchstabDepthDensity n p.val.1 p.val.2) from continuousOn_iff_continuous_domRestrict.mpr h induction n with | zero => exact continuous_const.div (continuous_subtype_val.snd) (fun p => p.property.2.ne') | succ n ih => let f : P → ℝ → ℝ := fun p t => buchstabDepthDensity n (max p.val.1 t) (max (p.val.2/2) (p.val.2-t)) / max p.val.1 t let g : P × ℝ → P := fun q => ⟨(max q.1.val.1 q.2, max (q.1.val.2/2) (q.1.val.2-q.2)), lt_of_lt_of_le q.1.property.1 (le_max_left _ _), lt_of_lt_of_le (half_pos q.1.property.2) (le_max_left _ _)⟩ have hg : Continuous g := by dsimp only [g, P]; fun_prop have hnum := ih.comp hg have hf : Continuous f.uncurry := by exact hnum.div (by dsimp only [P]; fun_prop) (fun q => (lt_of_lt_of_le q.1.property.1 (le_max_left _ _)).ne') have hhi : Continuous (fun p : P => ∫ t in (0 : ℝ)..max p.val.1 (p.val.2/2), f p t) := intervalIntegral.continuous_parametric_intervalIntegral_of_continuous hf (by fun_prop) have hlo : Continuous (fun p : P => ∫ t in (0 : ℝ)..p.val.1, f p t) := intervalIntegral.continuous_parametric_intervalIntegral_of_continuous hf (by fun_prop) have hrecip : Continuous (fun p : P => 1/p.val.2) := continuous_const.div (continuous_subtype_val.snd) (fun p : P => p.property.2.ne') have hall := hrecip.add (hhi.sub hlo) apply hall.congr intro p dsimp only [Pi.add_apply, Pi.sub_apply] rw [intervalIntegral.integral_interval_sub_left ((hf.uncurry_left p).intervalIntegrable _ _) ((hf.uncurry_left p).intervalIntegrable _ _)] change 1/p.val.2 + (∫ t in p.val.1..max p.val.1 (p.val.2/2), f p t) = 1/p.val.2 + (∫ t in p.val.1..max p.val.1 (p.val.2/2), buchstabDepthDensity n t (p.val.2-t)/t) congr 1 by_cases hhalf : p.val.2/2 ≤ p.val.1 · simp only [max_eq_left hhalf, intervalIntegral.integral_same] · have hhalf' : p.val.1 ≤ p.val.2/2 := (lt_of_not_ge hhalf).le rw [max_eq_right hhalf'] apply intervalIntegral.integral_congr intro t ht have htb := Set.mem_Icc.mp (by simpa only [Set.uIcc_of_le hhalf'] using ht) have htlast : p.val.2/2 ≤ p.val.2-t := by linarith [htb.2] simp only [f, max_eq_right htb.1, max_eq_right htlast] theorem buchstab_density_continuous : ContinuousOn (fun p : ℝ × ℝ => buchstabDensity p.1 p.2) {p | 0 < p.1 ∧ 0 < p.2} := by have hU : IsOpen {p : ℝ × ℝ | 0 < p.1 ∧ 0 < p.2} := (isOpen_lt continuous_const continuous_fst).inter (isOpen_lt continuous_const continuous_snd) apply hU.continuousOn_iff.mpr intro p hp let n := ⌊p.2/p.1⌋₊+1 have hn : p.2 < ((n : ℝ)+2)*p.1 := by have hb := buchstab_density_depth_bound (w := p.2) hp.1 dsimp [n] push_cast nlinarith [hp.1] have hV : IsOpen {q : ℝ × ℝ | 0 < q.1 ∧ q.2 < ((n : ℝ)+2)*q.1} := (isOpen_lt continuous_const continuous_fst).inter (isOpen_lt continuous_snd (continuous_const.mul continuous_fst)) have hloc : ∀ᶠ q : ℝ × ℝ in 𝓝 p, 0 < q.1 ∧ q.2 < ((n : ℝ)+2)*q.1 := hV.mem_nhds ⟨hp.1, hn⟩ have hc := (buchstab_depth_density_continuous n).continuousAt (hU.mem_nhds hp) apply hc.congr filter_upwards [hloc] with q hq exact buchstab_depth_density_eq_density hq.1 n hq.2.le end Bounty end section /- Pointwise domination keeps an arbitrary event mask while removing a bounded complex coefficient. Nonnegative event weights are retained. -/ open Finset open scoped Classical namespace Bounty theorem finite_masked_event_norm_le_positive_re {E : Type*} [Fintype E] (w : E → ℝ) (hw : ∀ e, 0 ≤ w e) (mask : E → Prop) (phase f : E → ℂ) (hphase : ∀ e, ‖phase e‖ ≤ 1) : ‖∑ e, (w e : ℂ) * (if mask e then phase e else 0) * f e‖ ≤ (∑ e, (w e : ℂ) * (if mask e then 1 else 0) * (‖f e‖ : ℂ)).re := by have he : (∑ e, (w e : ℂ) * (if mask e then 1 else 0) * (‖f e‖ : ℂ)).re = ∑ e, if mask e then w e * ‖f e‖ else 0 := by rw [Complex.re_sum] apply sum_congr rfl intro e _ split_ifs <;> simp rw [he] apply (norm_sum_le _ _).trans apply sum_le_sum intro e _ by_cases hm : mask e · simp only [if_pos hm, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hw e)] exact (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hphase e) (hw e)) (norm_nonneg (f e))).trans_eq (by rw [mul_one]) · simp only [if_neg hm, mul_zero, zero_mul, norm_zero, le_refl] theorem finite_weighted_energy_add_le_two {X : Type*} [Fintype X] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (f g : X → ℂ) : finiteWeightedEnergy w (fun x => f x + g x) ≤ 2 * (finiteWeightedEnergy w f + finiteWeightedEnergy w g) := by calc _ ≤ ∑ x, w x * (2 * (‖f x‖ ^ 2 + ‖g x‖ ^ 2)) := by apply sum_le_sum intro x _ apply mul_le_mul_of_nonneg_left _ (hw x) have hnorm := (sq_le_sq₀ (norm_nonneg (f x + g x)) (add_nonneg (norm_nonneg (f x)) (norm_nonneg (g x)))).mpr (norm_add_le (f x) (g x)) nlinarith [sq_nonneg (‖f x‖ - ‖g x‖)] _ = _ := by simp only [finiteWeightedEnergy, mul_add, mul_sum] rw [← sum_add_distrib] apply sum_congr rfl intro x _ ring end Bounty end section /- Read-only history observables on the existing dependent paths, without enlarging their state space. -/ namespace Bounty universe u v w z section History variable {K : Type u} {X : Type v} {H : Type z} (E : K → X → Type w) (target : ∀ k x, E k x → X) (update : ∀ (_t : ℕ) k x, E k x → H → H) def finiteEventPathHistoryAt : ∀ (_t : ℕ) (steps : List K) (x : X), FiniteEventPath E target steps x → H → ℕ → H | _, _, _, _, h, 0 => h | _, [], _, _, h, _ + 1 => h | t, k :: ks, x, ⟨e, p⟩, h, i + 1 => finiteEventPathHistoryAt (t + 1) ks (target k x e) p (update t k x e h) i theorem finite_event_path_history_at_zero (t : ℕ) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (h : H) : finiteEventPathHistoryAt E target update t steps x p h 0 = h := rfl theorem finite_event_path_history_at_succ (t : ℕ) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (h : H) (i : Fin steps.length) : finiteEventPathHistoryAt E target update t steps x p h (i.val + 1) = let e := finiteEventPathOccurrence E target steps x p i update (t + i.val) (steps.get i) e.1 e.2 (finiteEventPathHistoryAt E target update t steps x p h i.val) := by induction steps generalizing t x h with | nil => exact Fin.elim0 i | cons k ks ih => rcases p with ⟨e, p⟩ refine Fin.cases ?_ (fun j => ?_) i · rfl · change finiteEventPathHistoryAt E target update (t + 1) ks (target k x e) p (update t k x e h) (j.val + 1) = update (t + (j.val + 1)) (ks.get j) (finiteEventPathOccurrence E target ks (target k x e) p j).1 (finiteEventPathOccurrence E target ks (target k x e) p j).2 (finiteEventPathHistoryAt E target update (t + 1) ks (target k x e) p (update t k x e h) j.val) simpa only [Nat.add_assoc, Nat.add_left_comm, Nat.add_comm] using ih (t + 1) (target k x e) p (update t k x e h) j end History end Bounty end section /- Cartesian selected data split by physical groups; the cut sequence stays fixed. -/ open scoped Classical namespace Bounty abbrev PhysicalGroupSelectedData {G : Type*} {J n : ℕ} (P : G → Finset ℕ) (ell : ℕ) (C : Fin n → G → Finset (Fin J)) := (∀ j, PhysicalAuxLabels P (C j)) × (Fin (n + 1) → PhysicalMarkLists P J ell) × (Fin n → PhysicalPermutations G J ell) × (Fin n → PhysicalPermutations G J ell) def pairedSequenceEquiv {A : Type*} {B C : A → Type*} : (∀ a, B a × C a) ≃ (∀ a, B a) × (∀ a, C a) where toFun f := (fun a => (f a).1, fun a => (f a).2) invFun f a := (f.1 a, f.2 a) left_inv f := by funext a; exact Prod.eta (f a) right_inv f := rfl noncomputable def physicalGroupSelectedSplit {G : Type*} {P : G → Finset ℕ} {J ell n : ℕ} (small : G → Prop) (C : Fin n → G → Finset (Fin J)) : PhysicalGroupSelectedData P ell C ≃ PhysicalGroupSelectedData (fun g : {g // small g} => P g.val) ell (fun j g => C j g.val) × PhysicalGroupSelectedData (fun g : {g // ¬small g} => P g.val) ell (fun j g => C j g.val) := (Equiv.prodCongr ((Equiv.piCongrRight fun j => physicalAuxGroupSplit small P J (C j)).trans pairedSequenceEquiv) (Equiv.prodCongr ((Equiv.piCongrRight fun _ : Fin (n + 1) => physicalMarkGroupSplit small P J ell).trans pairedSequenceEquiv) (Equiv.prodCongr ((Equiv.piCongrRight fun _ : Fin n => physicalPermutationGroupSplit small J ell).trans pairedSequenceEquiv) ((Equiv.piCongrRight fun _ : Fin n => physicalPermutationGroupSplit small J ell).trans pairedSequenceEquiv)))).trans { toFun := fun x => ((x.1.1, x.2.1.1, x.2.2.1.1, x.2.2.2.1), (x.1.2, x.2.1.2, x.2.2.1.2, x.2.2.2.2)) invFun := fun x => ((x.1.1, x.2.1), (x.1.2.1, x.2.2.1), (x.1.2.2.1, x.2.2.2.1), (x.1.2.2.2, x.2.2.2.2)) left_inv := by rintro ⟨⟨_, _⟩, ⟨_, _⟩, ⟨_, _⟩, ⟨_, _⟩⟩; rfl right_inv := by rintro ⟨⟨_, _, _, _⟩, ⟨_, _, _, _⟩⟩; rfl } section variable {G : Type*} {P : G → Finset ℕ} {J ell n : ℕ} (small : G → Prop) (C : Fin n → G → Finset (Fin J)) (d : PhysicalGroupSelectedData P ell C) include G P J ell n small C d theorem physical_group_selected_split_small : (physicalGroupSelectedSplit small C d).1 = ((fun j (g : {g : G // small g}) => d.1 j g.val), (fun j (g : {g : G // small g}) => d.2.1 j g.val), (fun j (g : {g : G // small g}) => d.2.2.1 j g.val), (fun j (g : {g : G // small g}) => d.2.2.2 j g.val)) := rfl theorem physical_group_selected_split_big : (physicalGroupSelectedSplit small C d).2 = ((fun j (g : {g : G // ¬small g}) => d.1 j g.val), (fun j (g : {g : G // ¬small g}) => d.2.1 j g.val), (fun j (g : {g : G // ¬small g}) => d.2.2.1 j g.val), (fun j (g : {g : G // ¬small g}) => d.2.2.2 j g.val)) := rfl end end Bounty end section /- Exact endpoint energy in the original physical counting measure. -/ open scoped BigOperators InnerProductSpace namespace Bounty theorem physical_damping_square {G : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) {q : ℝ} (hq : 0 ≤ q) (n : ℤ) : physicalDamping P J ell q n ^ 2 = ∏ g, q ^ (physicalOmega P g n - (J + ell)) := by unfold physicalDamping rw [← Finset.prod_pow] apply Finset.prod_congr rfl intro g _ rw [← Real.rpow_natCast q (physicalOmega P g n - (J + ell)), ← Real.rpow_natCast _ 2, ← Real.rpow_mul hq] congr 1 norm_num noncomputable def physicalEndpointVector {G : Type*} [Fintype G] (P : G → Finset ℕ) (V : G → ℝ) (J ell : ℕ) (q : ℝ) (positions : Finset ℤ) (f : ℤ → ℂ) : EuclideanSpace ℂ (physicalCutoff P J ell positions) := finitePositionVector (fun x : physicalCutoff P J ell positions => x.val.1) (physicalStateMass V J ell) (fun n => f n * (physicalDamping P J ell q n : ℂ)) end Bounty end section /- Mark-independent endpoint tests remove the two slot averages exactly. -/ open scoped BigOperators InnerProductSpace namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] (P : G → Finset ℕ) include G sharedInstance1 sharedInstance2 P theorem physical_symmetrize_position_sum (J ell : ℕ) (positions : Finset ℤ) (f : ℤ → ℂ) (h : PhysicalState P J ell → ℂ) : (∑ x ∈ physicalCutoff P J ell positions, f x.1 * physicalSymmetrize h x) = ∑ x ∈ physicalCutoff P J ell positions, f x.1 * h x := by classical let N : ℂ := Fintype.card (PhysicalPermutations G J ell) have hN : N ≠ 0 := by dsimp [N]; exact_mod_cast Fintype.card_ne_zero calc _ = N⁻¹ * ∑ σ : PhysicalPermutations G J ell, ∑ x ∈ physicalCutoff P J ell positions, f x.1 * h (physicalPermutationEquiv σ x) := by unfold physicalSymmetrize change (∑ x ∈ physicalCutoff P J ell positions, f x.1 * (N⁻¹ * ∑ σ : PhysicalPermutations G J ell, h (physicalPermutationEquiv σ x))) = _ simp only [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro σ _ apply Finset.sum_congr rfl intro x _ ring _ = N⁻¹ * ∑ _σ : PhysicalPermutations G J ell, ∑ x ∈ physicalCutoff P J ell positions, f x.1 * h x := by congr 1 apply Finset.sum_congr rfl intro σ _ exact physical_permutation_sum P J ell positions σ (fun x => f x.1 * h x) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] change N⁻¹ * (N * _) = _ rw [← mul_assoc, inv_mul_cancel₀ hN, one_mul] theorem physical_position_symmetric_pairing (J ell : ℕ) (positions : Finset ℤ) (K : PhysicalState P J ell → PhysicalState P J ell → ℂ) (f g : ℤ → ℂ) : (∑ x ∈ physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, f x.1 * physicalSymmetricKernel K x y * g y.1) = ∑ x ∈ physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, f x.1 * K x y * g y.1 := by classical rw [Finset.sum_comm] calc _ = ∑ y ∈ physicalCutoff P J ell positions, (∑ x ∈ physicalCutoff P J ell positions, f x.1 * physicalSymmetrize (K x) y) * g y.1 := by apply Finset.sum_congr rfl intro y _ rw [← Finset.sum_mul] congr 1 exact physical_symmetrize_position_sum P J ell positions f (fun x => physicalSymmetrize (K x) y) _ = ∑ x ∈ physicalCutoff P J ell positions, f x.1 * ∑ y ∈ physicalCutoff P J ell positions, g y.1 * physicalSymmetrize (K x) y := by simp only [Finset.sum_mul, Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ ring _ = ∑ x ∈ physicalCutoff P J ell positions, f x.1 * ∑ y ∈ physicalCutoff P J ell positions, g y.1 * K x y := by simp only [physical_symmetrize_position_sum] _ = _ := by simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ ring theorem physical_position_kernel_pairing (V : G → ℝ) (hV : ∀ g, 0 < V g) (J ell : ℕ) (positions : Finset ℤ) (K : PhysicalState P J ell → PhysicalState P J ell → ℂ) (f g : ℤ → ℂ) : inner ℂ (finitePositionVector (fun x : physicalCutoff P J ell positions => x.val.1) (physicalStateMass V J ell) f) (finiteKernelOperator (fun x y : physicalCutoff P J ell positions => physicalSymmetricKernel K x.val y.val) (finitePositionVector (fun x : physicalCutoff P J ell positions => x.val.1) (physicalStateMass V J ell) g)) = (physicalStateMass V J ell : ℂ) * ∑ x ∈ physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, (starRingEnd ℂ) (f x.1) * K x y * g y.1 := by rw [finite_position_vector_kernel_pairing _ (physical_state_mass_pos V hV J ell).le] congr 1 calc _ = ∑ x : physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, (starRingEnd ℂ) (f x.val.1) * physicalSymmetricKernel K x.val y * g y.1 := by apply Finset.sum_congr rfl intro x _ exact Finset.sum_coe_sort (physicalCutoff P J ell positions) (fun y : PhysicalState P J ell => (starRingEnd ℂ) (f x.val.1) * physicalSymmetricKernel K x.val y * g y.1) _ = ∑ x ∈ physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, (starRingEnd ℂ) (f x.1) * physicalSymmetricKernel K x y * g y.1 := Finset.sum_coe_sort (physicalCutoff P J ell positions) (fun x : PhysicalState P J ell => ∑ y ∈ physicalCutoff P J ell positions, (starRingEnd ℂ) (f x.1) * physicalSymmetricKernel K x y * g y.1) _ = _ := physical_position_symmetric_pairing P J ell positions K (fun n => (starRingEnd ℂ) (f n)) g end end Bounty end section /- Congruence, signed quotient reconstruction, and uniqueness of both variables. -/ namespace Bounty theorem typeII_signed_modulus_dvd (k a : ℤ) : 2 * |k| ∣ a ↔ 2 * k ∣ a := by have habs : |2 * k| = 2 * |k| := by rw [abs_mul]; norm_num rw [← habs, abs_dvd] theorem typeII_determinant_congruence {m m' e k : ℤ} (he : m' - m = 2 * e * k) : Int.ModEq (2 * |k|) m m' := by apply Int.modEq_iff_dvd.mpr apply (typeII_signed_modulus_dvd k _).mpr exact ⟨e, by linear_combination he⟩ theorem typeII_determinant_e_quotient {m m' e k : ℤ} (hk : k ≠ 0) (he : m' - m = 2 * e * k) : (m' - m) / (2 * k) = e := by rw [he, show 2 * e * k = e * (2 * k) by ring] exact Int.mul_ediv_cancel e (mul_ne_zero (by norm_num) hk) theorem typeII_determinant_n_quotient {m e h n : ℤ} (hm : m ≠ 0) (hn : m * n = 2 * e * h + 1) : (2 * e * h + 1) / m = n := by rw [← hn] exact Int.mul_ediv_cancel_left n hm theorem typeII_determinant_from_congruence {m m' h h' k : ℤ} (hm : 0 < m) (hh : 0 ≤ h) (hk : k ≠ 0) (hc : IsCoprime m k) (hd : m * h' - m' * h = k) (hmod : Int.ModEq (2 * |k|) m m') (hpos : 0 < (m' - m) / (2 * k)) : ∃! en : ℤ × ℤ, 0 < en.1 ∧ 0 < en.2 ∧ m * en.2 = 2 * en.1 * h + 1 ∧ m' * en.2 = 2 * en.1 * h' + 1 ∧ m' - m = 2 * en.1 * k ∧ h' - h = k * en.2 := by let e := (m' - m) / (2 * k) have hdiv : 2 * k ∣ m' - m := (typeII_signed_modulus_dvd k _).mp (Int.modEq_iff_dvd.mp hmod) have he : m' - m = 2 * e * k := by have heq := Int.ediv_mul_cancel hdiv dsimp only [e] linear_combination -heq obtain ⟨n, hn, huniq⟩ := typeII_determinant_reconstruct_positive hm hpos hh hc hd he refine ⟨(e, n), ⟨hpos, hn.1, hn.2.1, hn.2.2.1, he, hn.2.2.2⟩, ?_⟩ rintro ⟨e', n'⟩ hp have he' : e' = e := (typeII_determinant_e_quotient hk hp.2.2.2.2.1).symm have hn' : n' = n := by apply huniq simpa only [he'] using And.intro hp.2.1 (And.intro hp.2.2.1 (And.intro hp.2.2.2.1 hp.2.2.2.2.2)) exact Prod.ext he' hn' end Bounty end section /- Multiplying by group-prime factors preserves the literal invariant endpoint. -/ namespace Bounty theorem prime_pool_free_part_mul_supported {P : Finset ℕ} {a : ℕ} (ha : a ∈ Nat.factoredNumbers P) (n : ℕ) : primePoolFreePart P (a * n) = primePoolFreePart P n := by by_cases hn : n = 0 · subst n simp only [mul_zero] · have he : a * n = (a * primePoolPart P n) * primePoolFreePart P n := by rw [mul_assoc, primePoolPart_mul_primePoolFreePart] rw [he, primePoolFreePart_mul_of_free (Nat.mul_mem_factoredNumbers ha (primePoolPart_mem_factoredNumbers P n)) (primePoolFreePart_ne_zero P hn) (primePoolFreePart_primeFactors_disjoint P n)] theorem invariant_triple_endpoint_mul_supported {P : Finset ℕ} {a : ℕ} (ha : a ∈ Nat.factoredNumbers P) (α β γ : ℕ → ℂ) (n : ℕ) : invariantTripleEndpoint P α β γ (a * n) = invariantTripleEndpoint P α β γ n := by unfold invariantTripleEndpoint rw [prime_pool_free_part_mul_supported ha] end Bounty end section /- Rough support gives a subexponential pointwise bound even for an unrestricted residual factor. -/ open Finset namespace Bounty theorem endpoint_triple_convolution_rough_sum (W : ℝ) (α β γ : ℕ → ℂ) (hα : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → W ≤ (p : ℝ)) → α m = 0) (hβ : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → W ≤ (p : ℝ)) → β m = 0) (n : ℕ) : endpointTripleConvolution α β γ n = ∑ m ∈ roughDivisors W n, ∑ p ∈ roughDivisors W (n / m), α m * β p * γ (n / m / p) := by classical unfold endpointTripleConvolution roughDivisors rw [sum_filter] apply sum_congr rfl intro m _ by_cases hm : ∀ p : ℕ, p ∈ m.primeFactors → W ≤ (p : ℝ) · rw [if_pos hm, sum_filter] apply sum_congr rfl intro p _ by_cases hp : ∀ r : ℕ, r ∈ p.primeFactors → W ≤ (r : ℝ) · rw [if_pos hp] · rw [if_neg hp, hβ p hp, mul_zero, zero_mul] · rw [if_neg hm, hα m hm] simp only [zero_mul, sum_const_zero] theorem endpoint_triple_convolution_rough_norm (W : ℝ) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (hαrough : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → W ≤ (p : ℝ)) → α m = 0) (hβrough : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → W ≤ (p : ℝ)) → β m = 0) (n : ℕ) : ‖endpointTripleConvolution α β γ n‖ ≤ A * B * C * ((roughDivisors W n).card : ℝ) ^ 2 := by classical rw [endpoint_triple_convolution_rough_sum W α β γ hαrough hβrough] have hABC : 0 ≤ A * B * C := mul_nonneg (mul_nonneg hA hB) hC calc _ ≤ ∑ m ∈ roughDivisors W n, ∑ p ∈ roughDivisors W (n / m), ‖α m * β p * γ (n / m / p)‖ := (norm_sum_le _ _).trans (sum_le_sum (fun m _ => norm_sum_le _ _)) _ ≤ ∑ m ∈ roughDivisors W n, ∑ _p ∈ roughDivisors W (n / m), A * B * C := by apply sum_le_sum intro m _ apply sum_le_sum intro p _ rw [norm_mul, norm_mul] exact mul_le_mul (mul_le_mul (hα m) (hβ p) (norm_nonneg _) hA) (hγ _) (norm_nonneg _) (mul_nonneg hA hB) _ ≤ ∑ _m ∈ roughDivisors W n, ((roughDivisors W n).card : ℝ) * (A * B * C) := by apply sum_le_sum intro m hm simp only [sum_const, nsmul_eq_mul] apply mul_le_mul_of_nonneg_right _ hABC have hm' := (mem_filter.mp hm).1 have hsub : roughDivisors W (n / m) ⊆ roughDivisors W n := by intro p hp exact mem_filter.mpr ⟨Nat.divisors_subset_of_dvd (Nat.ne_zero_of_mem_divisors hm') (Nat.div_dvd_of_dvd (Nat.dvd_of_mem_divisors hm')) (mem_filter.mp hp).1, (mem_filter.mp hp).2⟩ exact_mod_cast card_le_card hsub _ = _ := by simp only [sum_const, nsmul_eq_mul]; ring theorem endpoint_triple_convolution_rough_exp {W : ℝ} (hW : 1 < W) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (hαrough : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → W ≤ (p : ℝ)) → α m = 0) (hβrough : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → W ≤ (p : ℝ)) → β m = 0) {n : ℕ} (hn : n ≠ 0) : ‖endpointTripleConvolution α β γ n‖ ≤ A * B * C * Real.exp (2 * (Real.log 2 * Real.log n / Real.log W)) := by have hb := endpoint_triple_convolution_rough_norm W α β γ hA hB hC hα hβ hγ hαrough hβrough n have hc := roughDivisors_card_le_exp_log hW hn calc _ ≤ A * B * C * ((roughDivisors W n).card : ℝ) ^ 2 := hb _ ≤ A * B * C * (Real.exp (Real.log 2 * Real.log n / Real.log W)) ^ 2 := by gcongr _ = _ := by rw [← Real.exp_nat_mul]; norm_num end Bounty end section /- Elementary harmonic bounds for fixed Dirichlet powers of the zeta sequence. -/ open Finset ArithmeticFunction namespace Bounty noncomputable def divisorHarmonic (N : ℕ) : ℝ := ∑ n ∈ Ioc 0 N, (n : ℝ)⁻¹ theorem divisor_harmonic_nonneg (N : ℕ) : 0 ≤ divisorHarmonic N := by unfold divisorHarmonic positivity theorem divisor_harmonic_mono {M N : ℕ} (hMN : M ≤ N) : divisorHarmonic M ≤ divisorHarmonic N := by unfold divisorHarmonic apply sum_le_sum_of_subset_of_nonneg · exact Ioc_subset_Ioc le_rfl hMN · intro n _ _ positivity theorem divisor_harmonic_log_bound (N : ℕ) : divisorHarmonic N ≤ 1 + Real.log N := by have hs : Ioc 0 N = Icc 1 N := by ext n; simp only [mem_Ioc, mem_Icc]; omega have heq : divisorHarmonic N = (harmonic N : ℝ) := by simp only [divisorHarmonic, harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast, hs] rw [heq] exact harmonic_le_one_add_log N theorem divisor_zeta_sum_step (r N : ℕ) : (∑ n ∈ Ioc 0 N, ((ArithmeticFunction.zeta ^ (r + 2)) n : ℝ)) = ∑ d ∈ Ioc 0 N, ∑ n ∈ Ioc 0 (N / d), ((ArithmeticFunction.zeta ^ (r + 1)) n : ℝ) := by have heq := ArithmeticFunction.sum_Ioc_mul_eq_sum_sum ArithmeticFunction.zeta (ArithmeticFunction.zeta ^ (r + 1)) N rw [← pow_succ'] at heq have heq' := congrArg (fun n : ℕ => (n : ℝ)) heq simp only [Nat.cast_sum, Nat.cast_mul] at heq' rw [heq'] apply sum_congr rfl intro d hd rw [ArithmeticFunction.zeta_apply_ne (Nat.ne_of_gt (mem_Ioc.mp hd).1), Nat.cast_one, one_mul] theorem divisor_zeta_summatory_bound (r N : ℕ) : (∑ n ∈ Ioc 0 N, ((ArithmeticFunction.zeta ^ (r + 1)) n : ℝ)) ≤ (N : ℝ) * divisorHarmonic N ^ r := by induction r generalizing N with | zero => simp only [zero_add, pow_one, pow_zero, mul_one, ← Nat.cast_sum, ArithmeticFunction.sum_Ioc_zeta, le_refl] | succ r ih => rw [show r + 1 + 1 = r + 2 by omega, divisor_zeta_sum_step] calc _ ≤ ∑ d ∈ Ioc 0 N, (N / d : ℕ) * divisorHarmonic (N / d) ^ r := sum_le_sum (fun d _ => ih (N / d)) _ ≤ ∑ d ∈ Ioc 0 N, ((N : ℝ) / d) * divisorHarmonic N ^ r := by apply sum_le_sum intro d hd apply mul_le_mul · exact Nat.cast_div_le · exact pow_le_pow_left₀ (divisor_harmonic_nonneg _) (divisor_harmonic_mono (Nat.div_le_self _ _)) _ · exact pow_nonneg (divisor_harmonic_nonneg _) _ · positivity _ = (N : ℝ) * divisorHarmonic N ^ (r + 1) := by simp only [div_eq_mul_inv, ← sum_mul, ← mul_sum, divisorHarmonic, pow_succ] ring end Bounty end section /- Actual candidate Q-slot allocation in increasing band order, preserving its factorial normalization. -/ open Finset Real namespace Bounty noncomputable def candidateAllocationOrder (c L : ℝ) (r : ℕ) : Fin ((candidateQIndices c L).card*r) ≃ (candidateQIndices c L) × Fin r := finProdFinEquiv.symm.trans (Equiv.prodCongr ((candidateQIndices c L).orderIsoOfFin rfl).toEquiv (Equiv.refl _)) noncomputable def candidateAllocationValue (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (i : Fin ((candidateQIndices c L).card*r)) : ℕ := (x (candidateAllocationOrder c L r i)).val noncomputable def candidateAllocationActive (c L : ℝ) (r jStar : ℕ) (i : Fin ((candidateQIndices c L).card*r)) : Bool := decide (¬((candidateAllocationOrder c L r i).1.val=jStar ∧ (candidateAllocationOrder c L r i).2.val=0)) noncomputable def candidateAllocationWeight (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (R : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) : ℝ := smoothAllocationWeight _ (fun i => log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) R take noncomputable def candidateAllocatedFactor (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (take : Fin ((candidateQIndices c L).card*r) → Bool) : ℕ := ∏ i, if take i then candidateAllocationValue c L r jStar x i else 1 noncomputable def candidateRetainedFactor (c L : ℝ) (r jStar P : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (take : Fin ((candidateQIndices c L).card*r) → Bool) : ℕ := P * ∏ i, if take i then 1 else candidateAllocationValue c L r jStar x i section variable (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) include c L r jStar x theorem candidate_allocation_total_mass (R : ℝ) : (∑ take, candidateAllocationWeight c L r jStar x R take) = 1 := smooth_allocation_total_mass _ _ _ _ _ theorem candidate_allocation_weight_nonneg (R : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) : 0 ≤ candidateAllocationWeight c L r jStar x R take := smooth_allocation_weight_nonneg _ _ _ _ _ _ theorem candidate_allocation_value_pos (i : Fin ((candidateQIndices c L).card*r)) : 0 < candidateAllocationValue c L r jStar x i := Nat.pos_of_ne_zero (candidate_Q_slot_nonzero c L r jStar _ (x _).property) theorem candidate_allocation_product : (∏ i, candidateAllocationValue c L r jStar x i) = orderedSlotProduct (candidateQSlotChoices c L r jStar) x := by exact Fintype.prod_equiv (candidateAllocationOrder c L r) _ _ (fun _ => rfl) end theorem candidate_allocation_factorization (c L : ℝ) (r jStar P : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (take : Fin ((candidateQIndices c L).card*r) → Bool) : candidateAllocatedFactor c L r jStar x take*candidateRetainedFactor c L r jStar P x take = P*orderedSlotProduct (candidateQSlotChoices c L r jStar) x := by unfold candidateAllocatedFactor candidateRetainedFactor rw [mul_left_comm, ← prod_mul_distrib] congr 1 rw [← candidate_allocation_product c L r jStar x] apply prod_congr rfl intro i hi cases take i <;> simp end Bounty end section /- Deterministic residual bounds on positive smooth allocation branches. -/ open Finset Real namespace Bounty noncomputable def smoothAllocationInventory (n : ℕ) (v : Fin n → ℝ) (active : Fin n → Bool) : ℝ := ∑ i, if active i then v i else 0 noncomputable def smoothAllocationResidual (n : ℕ) (v : Fin n → ℝ) (R : ℝ) (take : Fin n → Bool) : ℝ := R-∑ i, if take i then v i else 0 def SmoothAllocationRoom : (n : ℕ) → (Fin n → ℝ) → (Fin n → ℝ) → (Fin n → Bool) → ℝ → Prop | 0, _, _, _, _ => True | n+1, v, s, active, A => (active 0 = true → v 0+s 0 ≤ smoothAllocationInventory n (Fin.tail v) (Fin.tail active)+A) ∧ SmoothAllocationRoom n (Fin.tail v) (Fin.tail s) (Fin.tail active) A theorem smooth_allocation_residual_step (n : ℕ) (v : Fin (n+1) → ℝ) (R : ℝ) (take : Fin (n+1) → Bool) : smoothAllocationResidual (n+1) v R take = smoothAllocationResidual n (Fin.tail v) (R-if take 0 then v 0 else 0) (Fin.tail take) := by rw [Fin.tail_def, Fin.tail_def] unfold smoothAllocationResidual rw [Fin.sum_univ_succ, sub_sub] theorem smooth_allocation_terminal_residual (n : ℕ) (v s : Fin n → ℝ) (active : Fin n → Bool) (R A : ℝ) (take : Fin n → Bool) (hs : ∀ i, 0 < s i) (hR : 0 ≤ R) (hcap : R ≤ smoothAllocationInventory n v active+A) (hroom : SmoothAllocationRoom n v s active A) (hweight : 0 < smoothAllocationWeight n v s active R take) : 0 ≤ smoothAllocationResidual n v R take ∧ smoothAllocationResidual n v R take ≤ A := by induction n generalizing R with | zero => simpa [smoothAllocationResidual,smoothAllocationInventory] using And.intro hR hcap | succ n ih => obtain ⟨hhead,htail⟩ := smooth_allocation_positive_factors hweight have hnext : 0 ≤ R-(if take 0 then v 0 else 0) ∧ R-(if take 0 then v 0 else 0) ≤ smoothAllocationInventory n (Fin.tail v) (Fin.tail active)+A := by cases ha : active 0 <;> cases ht : take 0 · have hh : R ≤ smoothAllocationInventory n (Fin.tail v) (Fin.tail active)+A := by rw [Fin.tail_def, Fin.tail_def] unfold smoothAllocationInventory at * simpa only [Fin.sum_univ_succ, ha, Bool.false_eq_true, if_false, zero_add] using hcap simpa only [ht, Bool.false_eq_true, if_false, sub_zero] using And.intro hR hh · simp only [smoothSlotTransition, smoothSlotTakeProbability, ha, ht, Bool.false_eq_true, if_false, if_true] at hhead linarith · have hh := smooth_slot_skip_requires_room (hs 0) (by simpa only [ha,ht] using hhead) have hr := hroom.1 ha simp only [Bool.false_eq_true, if_false, sub_zero] exact ⟨hR, (le_of_lt hh).trans hr⟩ · have hh := smooth_slot_take_requires_room (hs 0) (by simpa only [ht] using hhead) have hc : R ≤ v 0+smoothAllocationInventory n (Fin.tail v) (Fin.tail active)+A := by rw [Fin.tail_def, Fin.tail_def] unfold smoothAllocationInventory at * simpa only [Fin.sum_univ_succ, ha, if_true] using hcap simp only [if_true] constructor <;> linarith rw [smooth_allocation_residual_step] exact ih (Fin.tail v) (Fin.tail s) (Fin.tail active) _ (Fin.tail take) (fun i => hs i.succ) hnext.1 hnext.2 hroom.2 htail noncomputable def allocationNaturalProduct {n : ℕ} (p : Fin n → ℕ) (take : Fin n → Bool) : ℕ := ∏ i, if take i then p i else 1 theorem allocation_natural_product_exp_log {n : ℕ} (p : Fin n → ℕ) (hp : ∀ i, 0 < p i) (take : Fin n → Bool) : exp (∑ i, if take i then log (p i : ℝ) else 0) = (allocationNaturalProduct p take : ℝ) := by rw [exp_sum] unfold allocationNaturalProduct push_cast apply prod_congr rfl intro i hi cases take i <;> simp [exp_log (Nat.cast_pos.mpr (hp i))] theorem smooth_allocation_product_range {n : ℕ} (p : Fin n → ℕ) (hp : ∀ i, 0 < p i) (s : Fin n → ℝ) (active : Fin n → Bool) (R A : ℝ) (take : Fin n → Bool) (hs : ∀ i, 0 < s i) (hR : 0 ≤ R) (hcap : R ≤ smoothAllocationInventory n (fun i => log (p i : ℝ)) active+A) (hroom : SmoothAllocationRoom n (fun i => log (p i : ℝ)) s active A) (hweight : 0 < smoothAllocationWeight n (fun i => log (p i : ℝ)) s active R take) : exp (R-A) ≤ (allocationNaturalProduct p take : ℝ) ∧ (allocationNaturalProduct p take : ℝ) ≤ exp R := by obtain ⟨hlo,hhi⟩ := smooth_allocation_terminal_residual n (fun i => log (p i : ℝ)) s active R A take hs hR hcap hroom hweight unfold smoothAllocationResidual at hlo hhi rw [← allocation_natural_product_exp_log p hp take] constructor <;> apply exp_le_exp.mpr <;> linarith end Bounty end section /- Exact decomposition and overlap energy for position-dependent vectors. -/ open scoped BigOperators InnerProductSpace namespace Bounty theorem position_block_vector_sum {X : Type*} [Fintype X] (position : X → ℤ) (mass : ℝ) (S : Finset ℤ) (H : ℤ) (f : ℤ → ℂ) (hf : ∀ x, position x ∉ S → f (position x) = 0) : (∑ j ∈ S.image (fun n => n / H), finitePositionVector position mass (integerBlockMask id H j f)) = finitePositionVector position mass f := by classical ext x simp only [WithLp.ofLp_sum, Finset.sum_apply] change (∑ j ∈ S.image (fun n => n / H), (Real.sqrt mass : ℂ) * integerBlockMask id H j f (position x)) = (Real.sqrt mass : ℂ) * f (position x) rw [← Finset.mul_sum] by_cases hx : position x ∈ S · congr 1 simpa only [id_eq] using sum_integerBlockMask_eq S id H f hx · simp [integerBlockMask, hf x hx] theorem position_block_energy_sum {X : Type*} [Fintype X] (position : X → ℤ) {mass : ℝ} (hmass : 0 ≤ mass) (S : Finset ℤ) (H : ℤ) (f : ℤ → ℂ) (hf : ∀ x, position x ∉ S → f (position x) = 0) : (∑ j ∈ S.image (fun n => n / H), ‖finitePositionVector position mass (integerBlockMask id H j f)‖ ^ 2) = ‖finitePositionVector position mass f‖ ^ 2 := by classical simp only [finite_position_vector_norm_sq position hmass, ← Finset.mul_sum] congr 1 rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x _ by_cases hx : position x ∈ S · have ht := sum_integerBlockMask_eq S id H (fun n => ‖f n‖ ^ 2) hx convert ht using 1 apply Finset.sum_congr rfl intro j _ by_cases hj : position x / H = j <;> simp [integerBlockMask, hj] · simp [integerBlockMask, hf x hx] theorem position_near_block_energy_sum {X : Type*} [Fintype X] (position : X → ℤ) {mass : ℝ} (hmass : 0 ≤ mass) (J : Finset ℤ) (H : ℤ) (g : ℤ → ℂ) : (∑ j ∈ J, ‖finitePositionVector position mass (integerBlockNearMask id H j g)‖ ^ 2) ≤ 3 * ‖finitePositionVector position mass g‖ ^ 2 := by classical simp only [finite_position_vector_norm_sq position hmass] have h := sum_integerBlockNear_sq_norm_le Finset.univ J position H (fun _ => mass) (fun x => g (position x)) (fun _ _ => hmass) simpa only [Finset.mul_sum, integerBlockNearMask, id_eq] using h end Bounty end section /- The same cutoff consumes a vanishing fraction of a polynomially long path. -/ open Filter namespace Bounty theorem forest_rank_cutoff_ratio_le {K L b : ℝ} (hK : 0 ≤ K) (hL : 1 ≤ L) (hb : 0 < b) (N : ℕ) (hN : 0 < N) : (Nat.ceil (K * N * Real.log L / b) : ℝ) / N ≤ K * Real.log L / b + 1 / N := by have hNr : (0 : ℝ) < N := by exact_mod_cast hN have hlog : 0 ≤ Real.log L := Real.log_nonneg hL have hceil := (Nat.ceil_lt_add_one (show 0 ≤ K * N * Real.log L / b by positivity)).le calc _ ≤ (K * N * Real.log L / b + 1) / N := div_le_div_of_nonneg_right hceil hNr.le _ = _ := by field_simp theorem eventually_forest_rank_cutoff_small {a c ε K : ℝ} (ha : 0 < a) (hc : 0 < c) (hε : 0 < ε) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ N : ℕ, L ^ a ≤ (N : ℝ) → ∀ b : ℝ, L ^ c ≤ b → (Nat.ceil (K * N * Real.log L / b) : ℝ) / N ≤ ε := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_mul_rpow_log_add_le_rpow (a := 0) hc hc (half_pos hε) K 0, eventually_mul_rpow_log_add_le_rpow (a := 0) ha ha (half_pos hε) 0 1] with L hL hlog hunit simp only [Real.rpow_zero, mul_one, add_zero, zero_mul, zero_add] at hlog hunit have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL intro N hN b hb have hNr : (0 : ℝ) < N := (Real.rpow_pos_of_pos hL0 a).trans_le hN have hb0 : 0 < b := (Real.rpow_pos_of_pos hL0 c).trans_le hb have hr := forest_rank_cutoff_ratio_le hK hL hb0 N (by exact_mod_cast hNr) have hp : K * Real.log L / b ≤ ε / 2 := by apply (div_le_iff₀ hb0).mpr exact hlog.trans (mul_le_mul_of_nonneg_left hb (half_pos hε).le) have hn : 1 / (N : ℝ) ≤ ε / 2 := by apply (div_le_iff₀ hNr).mpr exact hunit.trans (mul_le_mul_of_nonneg_left hN (half_pos hε).le) linarith end Bounty end section /- L1 bounds and uniform rapid Fourier truncation for the explicit cutoff pair. -/ open MeasureTheory namespace Bounty theorem typeII_cutoff_fourier_l1_bound (A : ℝ) : ∃ C : ℝ, 1 ≤ C ∧ ∀ active : Bool, (∫ ξ : ℝ, ‖typeIICutoffFourier A active ξ‖) ≤ C := by let I₀ : ℝ := ∫ ξ : ℝ, ‖typeIICutoffFourier A false ξ‖ let I₁ : ℝ := ∫ ξ : ℝ, ‖typeIICutoffFourier A true ξ‖ have h₀ : 0 ≤ I₀ := integral_nonneg (fun _ => norm_nonneg _) have h₁ : 0 ≤ I₁ := integral_nonneg (fun _ => norm_nonneg _) refine ⟨1 + I₀ + I₁, by linarith, ?_⟩ intro active cases active · change I₀ ≤ 1 + I₀ + I₁ linarith · change I₁ ≤ 1 + I₀ + I₁ linarith theorem typeII_cutoff_fourier_rapid_tail (A : ℝ) (M : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ active : Bool, ∀ R : ℝ, 1 ≤ R → (∫ ξ in {ξ : ℝ | R < ‖ξ‖}, ‖typeIICutoffFourier A active ξ‖) ≤ C * R ^ (-(M : ℝ)) := by obtain ⟨C₀, h₀, hb₀⟩ := schwartz_norm_rapid_tail (typeIICutoffFourier A false) M obtain ⟨C₁, h₁, hb₁⟩ := schwartz_norm_rapid_tail (typeIICutoffFourier A true) M refine ⟨C₀ + C₁, add_pos h₀ h₁, ?_⟩ intro active R hR have hp : 0 ≤ R ^ (-(M : ℝ)) := Real.rpow_nonneg (by linarith) _ cases active · exact (hb₀ R hR).trans (mul_le_mul_of_nonneg_right (by linarith) hp) · exact (hb₁ R hR).trans (mul_le_mul_of_nonneg_right (by linarith) hp) noncomputable def typeIICutoffFourierIntegrand (A : ℝ) (active : Bool) (t ξ : ℝ) : ℂ := Complex.exp ((2 * Real.pi * ξ * t : ℝ) * Complex.I) * typeIICutoffFourier A active ξ theorem typeII_cutoff_fourier_integrand_norm (A t ξ : ℝ) (active : Bool) : ‖typeIICutoffFourierIntegrand A active t ξ‖ = ‖typeIICutoffFourier A active ξ‖ := by rw [typeIICutoffFourierIntegrand, norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul] theorem typeII_cutoff_fourier_integrand_integrable (A t : ℝ) (active : Bool) : Integrable (typeIICutoffFourierIntegrand A active t) := by have hc : Continuous (typeIICutoffFourierIntegrand A active t) := by unfold typeIICutoffFourierIntegrand apply Continuous.mul · fun_prop · exact (typeIICutoffFourier A active).continuous apply (typeII_cutoff_fourier_integrable A active).norm.mono' hc.aestronglyMeasurable exact Filter.Eventually.of_forall (fun ξ => (typeII_cutoff_fourier_integrand_norm A t ξ active).le) theorem typeII_cutoff_fourier_truncation_le_tail (A t R : ℝ) (active : Bool) : ‖(typeIISmoothCutoff A active t : ℂ) - ∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ R}, typeIICutoffFourierIntegrand A active t ξ‖ ≤ ∫ ξ in {ξ : ℝ | R < ‖ξ‖}, ‖typeIICutoffFourier A active ξ‖ := by have hs : MeasurableSet {ξ : ℝ | ‖ξ‖ ≤ R} := (isClosed_le continuous_norm continuous_const).measurableSet have heq : {ξ : ℝ | ‖ξ‖ ≤ R}ᶜ = {ξ : ℝ | R < ‖ξ‖} := by ext ξ simp rw [typeII_cutoff_fourier_inversion] change ‖(∫ ξ : ℝ, typeIICutoffFourierIntegrand A active t ξ) - _‖ ≤ _ rw [← setIntegral_compl hs (typeII_cutoff_fourier_integrand_integrable A t active), heq] apply (norm_integral_le_integral_norm _).trans apply le_of_eq exact integral_congr_ae (Filter.Eventually.of_forall (fun ξ => typeII_cutoff_fourier_integrand_norm A t ξ active)) theorem typeII_cutoff_fourier_rapid_truncation (A : ℝ) (M : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ active : Bool, ∀ R : ℝ, 1 ≤ R → ∀ t : ℝ, ‖(typeIISmoothCutoff A active t : ℂ) - ∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ R}, typeIICutoffFourierIntegrand A active t ξ‖ ≤ C * R ^ (-(M : ℝ)) := by obtain ⟨C, hC, hb⟩ := typeII_cutoff_fourier_rapid_tail A M exact ⟨C, hC, fun active R hR t => (typeII_cutoff_fourier_truncation_le_tail A t R active).trans (hb active R hR)⟩ end Bounty end section /- Exact separation of labelled, independently twisted slots. -/ open Finset namespace Bounty noncomputable def orderedSlotComplexWeight {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (twist : I → ℕ → ℂ) (n : ℕ) : ℂ := ∑ x : ∀ i, choices i, if orderedSlotProduct choices x = n then ∏ i, twist i (x i).val else 0 noncomputable def orderedSlotProductSupport {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) : Finset ℕ := univ.image (orderedSlotProduct choices) theorem ordered_slot_complex_weight_support {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (twist : I → ℕ → ℂ) {n : ℕ} (hn : n ∉ orderedSlotProductSupport choices) : orderedSlotComplexWeight choices twist n = 0 := by classical apply sum_eq_zero intro x _ exact if_neg (fun h => hn (mem_image.mpr ⟨x, mem_univ _, h⟩)) theorem ordered_slot_complex_fiber_test {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (twist : I → ℕ → ℂ) (F : ℕ → ℂ) : (∑ n ∈ orderedSlotProductSupport choices, orderedSlotComplexWeight choices twist n * F n) = ∑ x : ∀ i, choices i, (∏ i, twist i (x i).val) * F (orderedSlotProduct choices x) := by classical simp only [orderedSlotComplexWeight, sum_mul] rw [sum_comm] apply sum_congr rfl intro x _ have hx : orderedSlotProduct choices x ∈ orderedSlotProductSupport choices := mem_image.mpr ⟨x, mem_univ _, rfl⟩ simp only [ite_mul, zero_mul] simp [hx] theorem ordered_slot_twisted_single_split {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (twist : I → ℕ → ℂ) (i : I) (F : ℕ → ℂ) : (∑ x : ∀ j, choices j, (∏ j, twist j (x j).val) * F (orderedSlotProduct choices x)) = ∑ p : choices i, ∑ q ∈ orderedSlotProductSupport (fun j : {j : I // j ≠ i} => choices j.val), twist i p.val * orderedSlotComplexWeight (fun j : {j : I // j ≠ i} => choices j.val) (fun j => twist j.val) q * F (p.val*q) := by classical let f : choices i × (∀ j : {j : I // j ≠ i}, choices j.val) → ℂ := fun z => twist i z.1.val * (∏ j, twist j.val (z.2 j).val) * F (z.1.val * orderedSlotProduct _ z.2) calc _ = ∑ z, f z := by apply Fintype.sum_equiv (Equiv.piSplitAt i (fun j => choices j)) intro x simp only [f, Equiv.piSplitAt_apply] rw [ordered_slot_product_split choices i x, Fintype.prod_eq_mul_prod_subtype_ne (fun j => twist j (x j).val) i] _ = ∑ p : choices i, ∑ y : ∀ j : {j : I // j ≠ i}, choices j.val, twist i p.val * (∏ j, twist j.val (y j).val) * F (p.val * orderedSlotProduct _ y) := Fintype.sum_prod_type f _ = _ := by apply sum_congr rfl intro p _ simp_rw [mul_assoc] rw [← mul_sum, ← mul_sum, ordered_slot_complex_fiber_test] theorem ordered_slot_complex_single_convolution {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (twist : I → ℕ → ℂ) (i : I) (n : ℕ) : orderedSlotComplexWeight choices twist n = ∑ p : choices i, ∑ q ∈ orderedSlotProductSupport (fun j : {j : I // j ≠ i} => choices j.val), if p.val*q=n then twist i p.val * orderedSlotComplexWeight (fun j : {j : I // j ≠ i} => choices j.val) (fun j => twist j.val) q else 0 := by have h := ordered_slot_twisted_single_split choices twist i (fun t => if t=n then 1 else 0) simpa only [orderedSlotComplexWeight, mul_ite, mul_one, mul_zero] using h end Bounty end section /- Pure candidate Q-slot subsets retain the original factorial normalization. -/ open Finset namespace Bounty theorem candidate_Q_subset_group_card_le {I : Type*} [Fintype I] {c L : ℝ} {r : ℕ} (emb : I → (candidateQIndices c L) × Fin r) (hemb : Function.Injective emb) (j : candidateQIndices c L) : Fintype.card {i : I // (emb i).1 = j} ≤ r := by let f : {i : I // (emb i).1 = j} → Fin r := fun i => (emb i.val).2 have hf : Function.Injective f := by intro i k hik apply Subtype.ext apply hemb exact Prod.ext (i.property.trans k.property.symm) hik simpa only [Fintype.card_fin] using Fintype.card_le_of_injective f hf theorem candidate_Q_subset_factorial_product_le {I : Type*} [Fintype I] {c L : ℝ} {r : ℕ} (emb : I → (candidateQIndices c L) × Fin r) (hemb : Function.Injective emb) : (∏ j : candidateQIndices c L, ((Fintype.card {i : I // (emb i).1 = j}).factorial : ℝ)) ≤ (r.factorial : ℝ) ^ (candidateQIndices c L).card := by calc _ ≤ ∏ _j : candidateQIndices c L, (r.factorial : ℝ) := by apply prod_le_prod₀ · intro j _ positivity · intro j _ exact_mod_cast Nat.factorial_le (candidate_Q_subset_group_card_le emb hemb j) _ = _ := by simp section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] {c L : ℝ} {r jStar : ℕ} (hcL : 0 ≤ c * L) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (emb : I → (candidateQIndices c L) × Fin r) include I sharedInstance1 sharedInstance2 c L r jStar hcL hr hj emb theorem norm_candidate_Q_pure_subset_fiber_le (hpure : ∀ i, emb i ≠ candidateRoughSlot c L r jStar hr hj) (twist : I → ℕ → ℂ) (htwist : ∀ i p, p ∈ candidateQSlotChoices c L r jStar (emb i) → ‖twist i p‖ ≤ 1) (n : ℕ) : ‖∑ a : ∀ i, candidateQSlotChoices c L r jStar (emb i), if orderedSlotProduct (fun i => candidateQSlotChoices c L r jStar (emb i)) a = n then ∏ i, twist i (a i).val else 0‖ ≤ ∏ j : candidateQIndices c L, ((Fintype.card {i : I // (emb i).1 = j}).factorial : ℝ) := by classical let choices := fun i => candidateQSlotChoices c L r jStar (emb i) let x (a : ∀ i, choices i) (i : I) : ℕ := (a i).val have hxinj : Function.Injective x := by intro a b hab funext i exact Subtype.ext (congrFun hab i) have hx : ∀ (a : ∀ i, choices i) i, x a i ∈ candidateQBand (c * L) (emb i).1.val := by intro a i have ha : x a i ∈ choices i := (a i).property dsimp only [choices] at ha rw [candidate_Q_choices_eq_single_rough c L r jStar hr hj] at ha simpa only [if_neg (hpure i)] using ha have hw : ∀ a : ∀ i, choices i, ‖∏ i, twist i (a i).val‖ ≤ 1 := by intro a rw [norm_prod] exact prod_le_one₀ (fun i _ => norm_nonneg _) (fun i _ => htwist i _ (a i).property) exact norm_labelled_prime_product_fiber_sum_le (fun i => (emb i).1) (fun j => candidateQBand (c * L) j.val) (fun _ _ hp => (mem_filter.mp hp).2) (candidate_Q_group_disjoint hcL) x hxinj hx (fun a => ∏ i, twist i (a i).val) hw n theorem norm_candidate_Q_pure_subset_fiber_le_factorial_pow (hemb : Function.Injective emb) (hpure : ∀ i, emb i ≠ candidateRoughSlot c L r jStar hr hj) (twist : I → ℕ → ℂ) (htwist : ∀ i p, p ∈ candidateQSlotChoices c L r jStar (emb i) → ‖twist i p‖ ≤ 1) (n : ℕ) : ‖∑ a : ∀ i, candidateQSlotChoices c L r jStar (emb i), if orderedSlotProduct (fun i => candidateQSlotChoices c L r jStar (emb i)) a = n then ∏ i, twist i (a i).val else 0‖ ≤ (r.factorial : ℝ) ^ (candidateQIndices c L).card := (norm_candidate_Q_pure_subset_fiber_le hcL hr hj emb hpure twist htwist n).trans (candidate_Q_subset_factorial_product_le emb hemb) theorem norm_candidate_Q_pure_subset_fiber_normalized_le_one (hemb : Function.Injective emb) (hpure : ∀ i, emb i ≠ candidateRoughSlot c L r jStar hr hj) (twist : I → ℕ → ℂ) (htwist : ∀ i p, p ∈ candidateQSlotChoices c L r jStar (emb i) → ‖twist i p‖ ≤ 1) (n : ℕ) : ‖(∑ a : ∀ i, candidateQSlotChoices c L r jStar (emb i), if orderedSlotProduct (fun i => candidateQSlotChoices c L r jStar (emb i)) a = n then ∏ i, twist i (a i).val else 0) / (((r.factorial : ℝ) ^ (candidateQIndices c L).card : ℝ) : ℂ)‖ ≤ 1 := by have hpos : 0 < (r.factorial : ℝ) ^ (candidateQIndices c L).card := by positivity rw [norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hpos] exact (div_le_one hpos).mpr (norm_candidate_Q_pure_subset_fiber_le_factorial_pow hcL hr hj emb hemb hpure twist htwist n) end end Bounty end section /- Polynomial Schwartz bounds transfer to polynomial Fourier L1 moments. -/ open Finset MeasureTheory open scoped FourierTransform namespace Bounty theorem fourier_seminorm_polynomial {I : Type*} (f : I → SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ) (w : I → ℝ) (hw : ∀ p, 1 ≤ w p) (hsemi : ∀ k n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, SchwartzMap.seminorm ℂ k n (f p) ≤ C*(w p)^d) : ∀ k n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, SchwartzMap.seminorm ℂ k n (𝓕 (f p)) ≤ C*(w p)^d := by intro k n let T := FourierTransform.fourierCLM ℂ (SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ) let q := (SchwartzMap.seminorm ℂ k n).comp T.toLinearMap have hq : Continuous q := ((schwartz_withSeminorms ℂ (EuclideanSpace ℝ (Fin 3)) ℂ).continuous_seminorm (k,n)).comp T.continuous exact continuous_schwartz_seminorm_polynomial f w hw hsemi q hq theorem fourier_moment_polynomial_of_seminorm_bounds {I : Type*} (f : I → SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ) (w : I → ℝ) (hw : ∀ p, 1 ≤ w p) (hsemi : ∀ k n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, SchwartzMap.seminorm ℂ k n (f p) ≤ C*(w p)^d) (M : ℕ) : ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, (∫ ξ : EuclideanSpace ℝ (Fin 3), ‖ξ‖^M*‖𝓕 (f p) ξ‖) ≤ C*(w p)^d := by let N := (volume : Measure (EuclideanSpace ℝ (Fin 3))).integrablePower let B : ℝ := 2^N*(∫ ξ : EuclideanSpace ℝ (Fin 3), (1+‖ξ‖)^(-(N : ℝ))) have hB : 0 ≤ B := by apply mul_nonneg (by positivity) exact integral_nonneg (fun ξ => Real.rpow_nonneg (by positivity) _) obtain ⟨d0,C0,hC0,h0⟩ := fourier_seminorm_polynomial f w hw hsemi 0 0 obtain ⟨d1,C1,hC1,h1⟩ := fourier_seminorm_polynomial f w hw hsemi (M+N) 0 refine ⟨d0+d1,B*(C0+C1),mul_nonneg hB (add_nonneg hC0 hC1),?_⟩ intro p have h0' : SchwartzMap.seminorm ℂ 0 0 (𝓕 (f p)) ≤ C0*(w p)^(d0+d1) := (h0 p).trans (mul_le_mul_of_nonneg_left (pow_le_pow_right₀ (hw p) (Nat.le_add_right d0 d1)) hC0) have h1' : SchwartzMap.seminorm ℂ (M+N) 0 (𝓕 (f p)) ≤ C1*(w p)^(d0+d1) := (h1 p).trans (mul_le_mul_of_nonneg_left (pow_le_pow_right₀ (hw p) (Nat.le_add_left d1 d0)) hC1) have hi := (𝓕 (f p)).integral_pow_mul_iteratedFDeriv_le ℂ volume M 0 simp only [norm_iteratedFDeriv_zero] at hi calc _ ≤ B*(SchwartzMap.seminorm ℂ 0 0 (𝓕 (f p)) + SchwartzMap.seminorm ℂ (M+N) 0 (𝓕 (f p))) := hi _ ≤ B*(C0*(w p)^(d0+d1)+C1*(w p)^(d0+d1)) := mul_le_mul_of_nonneg_left (add_le_add h0' h1') hB _ = _ := by ring theorem fourier_moment_polynomial_of_fixed_support {I : Type*} (f : I → SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ) (w : I → ℝ) (hw : ∀ p, 1 ≤ w p) (R : ℝ) (hR : 0 ≤ R) (hsupport : ∀ p, tsupport (f p) ⊆ Metric.closedBall 0 R) (hderiv : ∀ n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p x, ‖iteratedFDeriv ℝ n (f p) x‖ ≤ C*(w p)^d) (M : ℕ) : ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, (∫ ξ : EuclideanSpace ℝ (Fin 3), ‖ξ‖^M*‖𝓕 (f p) ξ‖) ≤ C*(w p)^d := fourier_moment_polynomial_of_seminorm_bounds f w hw (schwartz_seminorm_polynomial_of_fixed_support f w hw R hR hsupport hderiv) M end Bounty end section /- Unit Mellin phases and exact separation at the two product endpoints. -/ open scoped ComplexConjugate namespace Bounty noncomputable def typeIIPhase (t : ℝ) (n : ℕ) : ℂ := Complex.exp (Complex.I * ((t * Real.log (n : ℝ) : ℝ) : ℂ)) theorem typeIIPhase_zero (n : ℕ) : typeIIPhase 0 n = 1 := by simp [typeIIPhase] theorem typeIIPhase_add (s t : ℝ) (n : ℕ) : typeIIPhase (s + t) n = typeIIPhase s n * typeIIPhase t n := by unfold typeIIPhase rw [← Complex.exp_add] congr 1 push_cast ring theorem typeIIPhase_conj (t : ℝ) (n : ℕ) : conj (typeIIPhase t n) = typeIIPhase (-t) n := by unfold typeIIPhase rw [← Complex.exp_conj, map_mul, Complex.conj_I, Complex.conj_ofReal] congr 1 push_cast ring theorem typeIIPhase_norm (t : ℝ) (n : ℕ) : ‖typeIIPhase t n‖ = 1 := Complex.norm_exp_I_mul_ofReal _ theorem typeIIPhase_eq_cpow (t : ℝ) {n : ℕ} (hn : 0 < n) : typeIIPhase t n = (n : ℂ) ^ ((t : ℂ) * Complex.I) := by have hnC : (n : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr hn.ne' rw [Complex.cpow_def_of_ne_zero hnC] have hlog : Complex.log (n : ℂ) = (Real.log (n : ℝ) : ℂ) := by exact (Complex.ofReal_log (Nat.cast_nonneg n)).symm rw [hlog] unfold typeIIPhase congr 1 push_cast ring /- With endpoints `m' * h` and `m * h'`, the residual phase separates exactly. -/ theorem typeIIPhase_endpoint_factorization (ξ₁ ξ₂ ξ₃ ρ : ℝ) {m m' h h' : ℕ} (hm : 0 < m) (hm' : 0 < m') (hh : 0 < h) (hh' : 0 < h') : typeIIPhase ξ₁ m * typeIIPhase ξ₂ m' * typeIIPhase ξ₃ (m' * h) * typeIIPhase ρ h * conj (typeIIPhase ρ h') = typeIIPhase (ρ + ξ₃) (m' * h) * typeIIPhase (-ρ) (m * h') * conj (typeIIPhase (ρ - ξ₂) m') * typeIIPhase (ξ₁ + ρ) m := by rw [typeIIPhase_conj, typeIIPhase_conj] simp only [typeIIPhase, Nat.cast_mul, Real.log_mul (Nat.cast_ne_zero.mpr hm'.ne') (Nat.cast_ne_zero.mpr hh.ne'), Real.log_mul (Nat.cast_ne_zero.mpr hm.ne') (Nat.cast_ne_zero.mpr hh'.ne'), ← Complex.exp_add] congr 1 push_cast ring theorem typeIIPhase_endpoint_factorization_of_eq (ξ₁ ξ₂ ξ₃ ρ : ℝ) {m m' h h' z w : ℕ} (hm : 0 < m) (hm' : 0 < m') (hh : 0 < h) (hh' : 0 < h') (hz : z = m' * h) (hw : w = m * h') : typeIIPhase ξ₁ m * typeIIPhase ξ₂ m' * typeIIPhase ξ₃ z * typeIIPhase ρ h * conj (typeIIPhase ρ h') = typeIIPhase (ρ + ξ₃) z * typeIIPhase (-ρ) w * conj (typeIIPhase (ρ - ξ₂) m') * typeIIPhase (ξ₁ + ρ) m := by subst z w exact typeIIPhase_endpoint_factorization ξ₁ ξ₂ ξ₃ ρ hm hm' hh hh' end Bounty end section /- Exact finite support masks for the divisor-based three-factor endpoint. -/ open Finset namespace Bounty theorem finite_triple_sum_eq_endpointTripleConvolution (M R C : Finset ℕ) (f g c : ℕ → ℂ) {n : ℕ} (hn : 0 < n) : (∑ m ∈ M, ∑ p ∈ R, ∑ r ∈ C, if m * p * r = n then f m * g p * c r else 0) = endpointTripleConvolution (fun m => if m ∈ M then f m else 0) (fun p => if p ∈ R then g p else 0) (fun r => if r ∈ C then c r else 0) n := by classical unfold endpointTripleConvolution apply sum_congr_of_eq_on_inter · intro m _ hm apply sum_eq_zero intro p _ apply sum_eq_zero intro r _ apply if_neg intro heq apply hm exact Nat.mem_divisors.mpr ⟨⟨p * r, by simpa only [mul_assoc] using heq.symm⟩, hn.ne'⟩ · intro m _ hm simp only [if_neg hm, zero_mul, sum_const_zero] · intro m hmM hmD have hmpos : 0 < m := Nat.pos_of_mem_divisors hmD have hmdvd : m ∣ n := Nat.dvd_of_mem_divisors hmD have hmprod : m * (n / m) = n := Nat.mul_div_cancel' hmdvd have hnmpos : 0 < n / m := by apply Nat.pos_of_ne_zero intro hz rw [hz, mul_zero] at hmprod exact hn.ne' hmprod.symm simp only [if_pos hmM] apply sum_congr_of_eq_on_inter · intro p _ hp apply sum_eq_zero intro r _ apply if_neg intro heq apply hp have hquot : n / m = p * r := Nat.div_eq_of_eq_mul_right hmpos (by simpa only [mul_assoc] using heq.symm) exact Nat.mem_divisors.mpr ⟨⟨r, hquot⟩, hnmpos.ne'⟩ · intro p _ hp simp only [if_neg hp, mul_zero, zero_mul] · intro p hpR hpD have hppos : 0 < p := Nat.pos_of_mem_divisors hpD have hpdvd : p ∣ n / m := Nat.dvd_of_mem_divisors hpD have hpprod : p * (n / m / p) = n / m := Nat.mul_div_cancel' hpdvd have heq (r : ℕ) : m * p * r = n ↔ r = n / m / p := by constructor · intro h have hquot : n / m = p * r := Nat.div_eq_of_eq_mul_right hmpos (by simpa only [mul_assoc] using h.symm) exact (Nat.div_eq_of_eq_mul_right hppos hquot).symm · intro h rw [h, mul_assoc, hpprod, hmprod] simp only [heq, if_pos hpR] rw [sum_ite_eq'] split_ifs <;> simp end Bounty end section /- A common forest expansion absorbs root-dependent initial avoidance into initial birth addresses. -/ open Finset Classical namespace Bounty def initialBirthIndexedPerformed {I J α : Type*} {m : ℕ} (e : Fin m ≃ I ⊕ J) (initial : I → α) (birth : J → Option α) (i : Fin m) : Prop := (initialAndBirthLabels initial birth (e i)).isSome = true def initialBirthIndexedValue {I J α : Type*} {m : ℕ} (e : Fin m ≃ I ⊕ J) (encode : α → ℤ) (initial : I → α) (birth : J → Option α) (i : Fin m) : ℤ := ((initialAndBirthLabels initial birth (e i)).map encode).getD 0 theorem initial_birth_indexed_distinct_iff {I J α : Type*} {m : ℕ} (e : Fin m ≃ I ⊕ J) (encode : α → ℤ) (hencode : Function.Injective encode) (initial : I → α) (birth : J → Option α) : birthValuesDistinct (initialBirthIndexedPerformed e initial birth) (initialBirthIndexedValue e encode initial birth) ↔ Function.Injective initial ∧ (∀ a b z, birth a = some z → birth b = some z → a = b) ∧ (∀ i j, birth j ≠ some (initial i)) := by change birthValuesDistinct (fun i => (initialAndBirthLabels initial birth (e i)).isSome = true) (fun i => ((initialAndBirthLabels initial birth (e i)).map encode).getD 0) ↔ _ rw [birth_values_distinct_option_equiv_iff e _ _ (fun _ => Iff.rfl) encode hencode, optional_label_injOn_iff_same_some _ _ (fun _ => Iff.rfl)] exact initial_birth_distinctness_iff initial birth theorem initial_birth_path_forest_expansion {Ω I J α : Type*} {m : ℕ} (paths : Finset Ω) (e : Fin m ≃ I ⊕ J) (encode : α → ℤ) (hencode : Function.Injective encode) (initial : Ω → I → α) (birth : Ω → J → Option α) (w : Ω → ℂ) (hinitial : ∀ ω ∈ paths, Function.Injective (initial ω)) : (∑ ω ∈ paths, (if ∀ i j, birth ω j ≠ some (initial ω i) then (1 : ℂ) else 0) * (if ∀ a b z, birth ω a = some z → birth ω b = some z → a = b then (1 : ℂ) else 0) * w ω) = ∑ code : BirthForestCode m, (-1 : ℂ) ^ birthForestRank code * birthForestPathSum paths w (fun ω => initialBirthIndexedPerformed e (initial ω) (birth ω)) (fun ω => initialBirthIndexedValue e encode (initial ω) (birth ω)) code := by rw [← distinct_birth_path_expansion] unfold distinctBirthPathSum apply sum_congr rfl intro ω hω rw [initial_birth_indexed_distinct_iff e encode hencode] by_cases hd : ∀ a b z, birth ω a = some z → birth ω b = some z → a = b <;> by_cases ha : ∀ i j, birth ω j ≠ some (initial ω i) <;> simp [hinitial ω hω, hd, ha] end Bounty end section /- Joint and full-state dilation congruence preserves both joint caps. -/ open Finset namespace Bounty section Joint variable {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D D' : G → ℤ) (hD : ∀ g p, ((n g p : ℤ) ∣ D g ↔ (n g p : ℤ) ∣ D' g)) (t : G → ℕ) (B : ℕ) def unrestrictedJointDilationEventEquiv (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : UnrestrictedJointEvent n Δ D t B s ≃ UnrestrictedJointEvent n Δ D' t B s := Equiv.piCongrRight (fun g => unrestrictedDilationEventEquiv (n g) (Δ g) (D g) (D' g) (hD g) (s g)) theorem unrestricted_joint_dilation_target (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (e : UnrestrictedJointEvent n Δ D t B s) : unrestrictedJointEventTarget n Δ D' t B s (unrestrictedJointDilationEventEquiv n Δ D D' hD t B s e) = unrestrictedJointEventTarget n Δ D t B s e := by funext g exact unrestricted_dilation_event_target (n g) (Δ g) (D g) (D' g) (hD g) (s g) (e g) theorem unrestricted_joint_dilation_weight [Fintype G] (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (e : UnrestrictedJointEvent n Δ D t B s) : unrestrictedJointCutoffEventWeight n Δ D' μ ρ V t B s (unrestrictedJointDilationEventEquiv n Δ D D' hD t B s e) = unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B s e := by unfold unrestrictedJointCutoffEventWeight rw [unrestricted_joint_dilation_target] split_ifs · apply prod_congr rfl intro g _ exact unrestricted_dilation_event_weight (n g) (Δ g) (D g) (D' g) (hD g) (μ g) ρ (V g) (s g) (e g) · rfl end Joint end Bounty end section /- Polynomial Schwartz bounds transfer to polynomial Fourier L1 moments. -/ open Finset MeasureTheory open scoped FourierTransform namespace Bounty variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] theorem fourier_domain_seminorm_polynomial {I : Type*} (f : I → SchwartzMap E ℂ) (w : I → ℝ) (hw : ∀ p, 1 ≤ w p) (hsemi : ∀ k n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, SchwartzMap.seminorm ℂ k n (f p) ≤ C*(w p)^d) : ∀ k n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, SchwartzMap.seminorm ℂ k n (𝓕 (f p)) ≤ C*(w p)^d := by intro k n let T := FourierTransform.fourierCLM ℂ (SchwartzMap E ℂ) let q := (SchwartzMap.seminorm ℂ k n).comp T.toLinearMap have hq : Continuous q := ((schwartz_withSeminorms ℂ E ℂ).continuous_seminorm (k,n)).comp T.continuous exact continuous_schwartz_domain_seminorm_polynomial f w hw hsemi q hq theorem fourier_domain_moment_polynomial_of_seminorm_bounds {I : Type*} (f : I → SchwartzMap E ℂ) (w : I → ℝ) (hw : ∀ p, 1 ≤ w p) (hsemi : ∀ k n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, SchwartzMap.seminorm ℂ k n (f p) ≤ C*(w p)^d) (M : ℕ) : ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, (∫ ξ : E, ‖ξ‖^M*‖𝓕 (f p) ξ‖) ≤ C*(w p)^d := by let N := (volume : Measure E).integrablePower let B : ℝ := 2^N*(∫ ξ : E, (1+‖ξ‖)^(-(N : ℝ))) have hB : 0 ≤ B := by apply mul_nonneg (by positivity) exact integral_nonneg (fun ξ => Real.rpow_nonneg (by positivity) _) obtain ⟨d0,C0,hC0,h0⟩ := fourier_domain_seminorm_polynomial f w hw hsemi 0 0 obtain ⟨d1,C1,hC1,h1⟩ := fourier_domain_seminorm_polynomial f w hw hsemi (M+N) 0 refine ⟨d0+d1,B*(C0+C1),mul_nonneg hB (add_nonneg hC0 hC1),?_⟩ intro p have h0' : SchwartzMap.seminorm ℂ 0 0 (𝓕 (f p)) ≤ C0*(w p)^(d0+d1) := (h0 p).trans (mul_le_mul_of_nonneg_left (pow_le_pow_right₀ (hw p) (Nat.le_add_right d0 d1)) hC0) have h1' : SchwartzMap.seminorm ℂ (M+N) 0 (𝓕 (f p)) ≤ C1*(w p)^(d0+d1) := (h1 p).trans (mul_le_mul_of_nonneg_left (pow_le_pow_right₀ (hw p) (Nat.le_add_left d1 d0)) hC1) have hi := (𝓕 (f p)).integral_pow_mul_iteratedFDeriv_le ℂ volume M 0 simp only [norm_iteratedFDeriv_zero] at hi calc _ ≤ B*(SchwartzMap.seminorm ℂ 0 0 (𝓕 (f p)) + SchwartzMap.seminorm ℂ (M+N) 0 (𝓕 (f p))) := hi _ ≤ B*(C0*(w p)^(d0+d1)+C1*(w p)^(d0+d1)) := mul_le_mul_of_nonneg_left (add_le_add h0' h1') hB _ = _ := by ring theorem fourier_domain_moment_polynomial_of_fixed_support {I : Type*} (f : I → SchwartzMap E ℂ) (w : I → ℝ) (hw : ∀ p, 1 ≤ w p) (R : ℝ) (hR : 0 ≤ R) (hsupport : ∀ p, tsupport (f p) ⊆ Metric.closedBall 0 R) (hderiv : ∀ n : ℕ, ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p x, ‖iteratedFDeriv ℝ n (f p) x‖ ≤ C*(w p)^d) (M : ℕ) : ∃ d : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ p, (∫ ξ : E, ‖ξ‖^M*‖𝓕 (f p) ξ‖) ≤ C*(w p)^d := fourier_domain_moment_polynomial_of_seminorm_bounds f w hw (schwartz_domain_seminorm_polynomial_of_fixed_support f w hw R hR hsupport hderiv) M end Bounty end section /- Exact removal of a designated ordered mark, with no additional factorial or damping factor. -/ open Finset namespace Bounty theorem marked_divisor_factor_peel (q V : ℝ) (omega t : ℕ) : markedDivisorFactor q V omega (t + 1) = (omega : ℝ) / V * markedDivisorFactor q V (omega - 1) t := by cases omega with | zero => simp [markedDivisorFactor] | succ omega => simp only [markedDivisorFactor, Nat.succ_descFactorial_succ, Nat.add_sub_add_right, Nat.add_sub_cancel_right, Nat.cast_mul, pow_succ, div_eq_mul_inv, mul_inv_rev] ring theorem marked_divisor_factor_remove_prime {G : Type*} (P : G → Finset ℕ) (g : G) (hP : ∀ p ∈ P g, p.Prime) (q V : ℝ) (n t : ℕ) (hsq : ∀ p ∈ P g, ¬ p ^ 2 ∣ n) : markedDivisorFactor q V (physicalOmega P g (n : ℤ)) (t + 1) = (1 / V) * ∑ p ∈ P g, if p ∣ n then markedDivisorFactor q V (physicalOmega P g ((n / p : ℕ) : ℤ)) t else 0 := by classical rw [← sum_filter] have heq : ∑ p ∈ (P g).filter (fun p => p ∣ n), markedDivisorFactor q V (physicalOmega P g ((n / p : ℕ) : ℤ)) t = (physicalOmega P g (n : ℤ) : ℝ) * markedDivisorFactor q V (physicalOmega P g (n : ℤ) - 1) t := by calc _ = ∑ _p ∈ (P g).filter (fun p => p ∣ n), markedDivisorFactor q V (physicalOmega P g (n : ℤ) - 1) t := by apply sum_congr rfl intro p hp rw [physical_omega_div_simple_prime P g hP (mem_filter.mp hp).1 (mem_filter.mp hp).2 (hsq p (mem_filter.mp hp).1)] _ = _ := by simp [physicalOmega, physicalDivisorPool, Int.natCast_dvd_natCast] rw [heq, marked_divisor_factor_peel] ring end Bounty end section /- A common initial-and-event birth allocation independent of every shared-slot pattern. -/ namespace Bounty section Common variable {J K : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) def fullMixedCommonCapacity : Option (J ⊕ K) → Fin N → ℕ | none, _ => 0 | some (.inl _), _ => B | some (.inr _), g => M g abbrev FullMixedCommonInitialAddress := (g : Fin N) × Fin (M g) abbrev FullMixedCommonLocalAddress (tag : Option (J ⊕ K)) := (g : Fin N) × Fin (fullMixedCommonCapacity M B tag g) abbrev FullMixedCommonStepAddress (steps : List (Option (J ⊕ K))) := (i : Fin steps.length) × FullMixedCommonLocalAddress M B (steps.get i) abbrev FullMixedCommonBirthAddress (steps : List (Option (J ⊕ K))) := FullMixedCommonInitialAddress M ⊕ FullMixedCommonStepAddress M B steps def fullMixedCommonOwner (steps : List (Option (J ⊕ K))) : FullMixedCommonBirthAddress M B steps → Option (Fin steps.length) | .inl _ => none | .inr a => some a.1 theorem full_mixed_common_birth_card (steps : List (Option (J ⊕ K))) : Fintype.card (FullMixedCommonBirthAddress M B steps) = (∑ g, M g) + ∑ i : Fin steps.length, ∑ g, fullMixedCommonCapacity M B (steps.get i) g := by simp only [FullMixedCommonBirthAddress, FullMixedCommonInitialAddress, FullMixedCommonStepAddress, FullMixedCommonLocalAddress, Fintype.card_sum, Fintype.card_sigma, Fintype.card_fin] theorem full_mixed_common_capacity_le (T : ℕ) (hM : ∀ g, M g ≤ T) (tag : Option (J ⊕ K)) (g : Fin N) : fullMixedCommonCapacity M B tag g ≤ max B T := by cases tag with | none => exact Nat.zero_le _ | some tag => cases tag with | inl j => exact le_max_left _ _ | inr k => exact (hM g).trans (le_max_right _ _) theorem full_mixed_common_birth_card_le (T : ℕ) (hM : ∀ g, M g ≤ T) (steps : List (Option (J ⊕ K))) : Fintype.card (FullMixedCommonBirthAddress M B steps) ≤ N * T + steps.length * (N * max B T) := by rw [full_mixed_common_birth_card] apply add_le_add · calc (∑ g, M g) ≤ ∑ _g : Fin N, T := Finset.sum_le_sum (fun g _ => hM g) _ = N * T := by simp · calc (∑ i : Fin steps.length, ∑ g, fullMixedCommonCapacity M B (steps.get i) g) ≤ ∑ _i : Fin steps.length, ∑ _g : Fin N, max B T := by exact Finset.sum_le_sum (fun i _ => Finset.sum_le_sum (fun g _ => full_mixed_common_capacity_le M B T hM (steps.get i) g)) _ = steps.length * (N * max B T) := by simp end Common end Bounty end section /- Optional-label extension commutes with owner-indexed sums and preserves performed status. -/ open Classical namespace Bounty theorem optional_birth_extension_performed_iff {A B Z : Type*} (e : A ↪ B) (label : A → Option Z) (b : B) : (optionalBirthExtension e label b).isSome = true ↔ ∃ a, e a = b ∧ (label a).isSome = true := by constructor · intro h by_cases hb : ∃ a, e a = b · obtain ⟨a, rfl⟩ := hb exact ⟨a, rfl, by simpa only [optional_birth_extension_apply] using h⟩ · rw [optional_birth_extension_none e label b hb] at h cases h · rintro ⟨a, rfl, ha⟩ simpa only [optional_birth_extension_apply] using ha theorem optional_birth_extension_sigma {I Z : Type*} {A B : I → Type*} (e : ∀ i, A i ↪ B i) (label : (i : I) × A i → Option Z) (i : I) (b : B i) : optionalBirthExtension (Function.Embedding.sigmaMap (Function.Embedding.refl I) e) label ⟨i, b⟩ = optionalBirthExtension (e i) (fun a => label ⟨i, a⟩) b := by by_cases hb : ∃ a, e i a = b · obtain ⟨a, rfl⟩ := hb exact (optional_birth_extension_apply (Function.Embedding.sigmaMap (Function.Embedding.refl I) e) label ⟨i, a⟩).trans (optional_birth_extension_apply (e i) (fun a => label ⟨i, a⟩) a).symm · have hg : ¬∃ a, Function.Embedding.sigmaMap (Function.Embedding.refl I) e a = ⟨i, b⟩ := by rintro ⟨⟨j, a⟩, ha⟩ have hj : j = i := congrArg Sigma.fst ha subst j change (⟨i, e i a⟩ : (j : I) × B j) = ⟨i, b⟩ at ha apply hb exact ⟨a, by simpa using ha⟩ rw [optional_birth_extension_none _ _ _ hg, optional_birth_extension_none _ _ _ hb] end Bounty end section /- An actual nonnegative normalized smooth kernel for local Fourier energy. -/ open MeasureTheory Set open scoped ContDiff FourierTransform NNReal namespace Bounty noncomputable def localMellinKernelBase (x : ℝ) : ℝ := typeIISmoothRho 1 ((16 * Real.pi + 1) * x) theorem local_mellin_kernel_base_contDiff : ContDiff ℝ ∞ localMellinKernelBase := by have h := typeII_smooth_rho_contDiff 1 unfold localMellinKernelBase fun_prop theorem local_mellin_kernel_base_support {x : ℝ} (hx : 2 / (16 * Real.pi + 1) < |x|) : localMellinKernelBase x = 0 := by apply typeII_smooth_rho_eq_zero intro hx' have ha : |(16 * Real.pi + 1) * x| ≤ 2 := by exact abs_le.mpr ⟨by linarith [hx'.1], by linarith [hx'.2]⟩ rw [abs_mul, abs_of_pos (by positivity : 0 < 16 * Real.pi + 1)] at ha have hb := (div_lt_iff₀ (by positivity : 0 < 16 * Real.pi + 1)).mp hx nlinarith theorem local_mellin_kernel_base_compact : HasCompactSupport localMellinKernelBase := by apply HasCompactSupport.intro (isCompact_Icc : IsCompact (Icc (-(2 / (16 * Real.pi + 1))) (2 / (16 * Real.pi + 1)))) intro x hx apply local_mellin_kernel_base_support exact lt_of_not_ge (fun h => hx (abs_le.mp h)) theorem local_mellin_kernel_base_nonneg (x : ℝ) : 0 ≤ localMellinKernelBase x := (typeII_smooth_rho_bounds _ _).1 theorem local_mellin_kernel_base_zero : localMellinKernelBase 0 = 1 := by apply typeII_smooth_rho_eq_one simp theorem local_mellin_kernel_base_integral_pos : 0 < ∫ x, localMellinKernelBase x := local_mellin_kernel_base_contDiff.continuous.integral_pos_of_hasCompactSupport_nonneg_nonzero local_mellin_kernel_base_compact local_mellin_kernel_base_nonneg (by rw [local_mellin_kernel_base_zero]; norm_num) noncomputable def localMellinKernel (x : ℝ) : ℝ := localMellinKernelBase x / ∫ y, localMellinKernelBase y theorem local_mellin_kernel_contDiff : ContDiff ℝ ∞ localMellinKernel := local_mellin_kernel_base_contDiff.div_const _ theorem local_mellin_kernel_compact : HasCompactSupport localMellinKernel := by unfold localMellinKernel simp only [div_eq_mul_inv] exact local_mellin_kernel_base_compact.mul_right theorem local_mellin_kernel_nonneg (x : ℝ) : 0 ≤ localMellinKernel x := div_nonneg (local_mellin_kernel_base_nonneg x) local_mellin_kernel_base_integral_pos.le theorem local_mellin_kernel_integral : (∫ x, localMellinKernel x) = 1 := by unfold localMellinKernel simp only [div_eq_mul_inv] rw [integral_mul_const, mul_inv_cancel₀ local_mellin_kernel_base_integral_pos.ne'] theorem local_mellin_kernel_support {x : ℝ} (hx : 2 / (16 * Real.pi + 1) < |x|) : localMellinKernel x = 0 := by rw [localMellinKernel, local_mellin_kernel_base_support hx, zero_div] noncomputable def localMellinKernelSchwartz : SchwartzMap ℝ ℂ := (local_mellin_kernel_compact.comp_left (g := fun x : ℝ => (x : ℂ)) (by simp)).toSchwartzMap (Complex.ofRealCLM.contDiff.comp local_mellin_kernel_contDiff) theorem local_mellin_kernel_lipschitz : ∃ C : ℝ≥0, LipschitzWith C localMellinKernelSchwartz := ContDiff.lipschitzWith_of_hasCompactSupport (local_mellin_kernel_compact.comp_left (g := fun x : ℝ => (x : ℂ)) (by simp)) (Complex.ofRealCLM.contDiff.comp local_mellin_kernel_contDiff) (by simp) end Bounty end section /- Weighted marked sums are exactly the unweighted mass times their conditional list average. -/ open Finset namespace Bounty noncomputable def groupMarkedAverage {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) (b : GroupMarkedLists P t → ℂ) : ℂ := by classical exact (Fintype.card (GroupMarkedListsAt P t n) : ℂ)⁻¹ * ∑ L : GroupMarkedListsAt P t n, b L.val noncomputable def weightedGroupMarkedSum {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (n : ℤ) (b : GroupMarkedLists P t → ℂ) : ℂ := by classical exact ((∏ g, q ^ (physicalOmega P g n - t g) / V g ^ t g : ℝ) : ℂ) * ∑ L : GroupMarkedListsAt P t n, b L.val theorem weighted_group_marked_sum_eq_average {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (n : ℤ) (b : GroupMarkedLists P t → ℂ) : weightedGroupMarkedSum P q V t n b = (markedDivisorWeight univ P q V t n : ℂ) * groupMarkedAverage P t n b := by classical rw [marked_divisor_weight_eq_fiber_mass, Nat.card_eq_fintype_card] unfold weightedGroupMarkedSum groupMarkedAverage by_cases hzero : Fintype.card (GroupMarkedListsAt P t n) = 0 · let : IsEmpty (GroupMarkedListsAt P t n) := Fintype.card_eq_zero_iff.mp hzero simp only [Fintype.sum_empty, mul_zero] · have hne : (Fintype.card (GroupMarkedListsAt P t n) : ℂ) ≠ 0 := by exact_mod_cast hzero push_cast field_simp theorem group_marked_average_norm_le {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) (b : GroupMarkedLists P t → ℂ) {H : ℝ} (hH : 0 ≤ H) (hb : ∀ L : GroupMarkedListsAt P t n, ‖b L.val‖ ≤ H) : ‖groupMarkedAverage P t n b‖ ≤ H := by classical by_cases hz : Fintype.card (GroupMarkedListsAt P t n) = 0 · simp only [groupMarkedAverage, hz, Nat.cast_zero, inv_zero, zero_mul, norm_zero] exact hH · have hne : (Fintype.card (GroupMarkedListsAt P t n) : ℝ) ≠ 0 := by exact_mod_cast hz unfold groupMarkedAverage rw [norm_mul, norm_inv, Complex.norm_natCast] calc _ ≤ (Fintype.card (GroupMarkedListsAt P t n) : ℝ)⁻¹ * ∑ _L : GroupMarkedListsAt P t n, H := by apply mul_le_mul_of_nonneg_left _ (by positivity) exact (norm_sum_le _ _).trans (sum_le_sum (fun L _ => hb L)) _ = H := by rw [sum_const, card_univ, nsmul_eq_mul, ← mul_assoc, inv_mul_cancel₀ hne, one_mul] end Bounty end section /- Uniform weighted bounds through two derivatives on a fixed logarithmic interval. -/ open Real namespace Bounty theorem exponential_profile_weighted_bounds (g f : SchwartzMap ℝ ℂ) (j : ℕ) (R : ℝ) : ∃ C₀ C₁ C₂ : ℝ, 0 ≤ C₀ ∧ 0 ≤ C₁ ∧ 0 ≤ C₂ ∧ ∀ v u : ℝ, u ∈ Set.Icc (-R) R → (1+v^2)^((j : ℝ)/4)*‖exponentialProfile g f v u‖ ≤ C₀ ∧ (1+v^2)^((j : ℝ)/4)*‖exponentialProfileFirst g f v u‖ ≤ C₁ ∧ (1+v^2)^((j : ℝ)/4)*‖exponentialProfileSecond g f v u‖ ≤ C₂ := by let a := exp (-R)/(2*Real.pi) have ha : 0 < a := by dsimp [a]; positivity obtain ⟨B₀,hB₀,hf₀⟩ := schwartz_scaled_polynomial_weight_bound f j 0 ha obtain ⟨B₁,hB₁,hf₁⟩ := schwartz_scaled_polynomial_weight_bound (SchwartzMap.derivCLM ℂ ℂ f) j 1 ha obtain ⟨B₂,hB₂,hf₂⟩ := schwartz_scaled_polynomial_weight_bound (SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ f)) j 2 ha let G₀ := SchwartzMap.seminorm ℂ 0 0 g let G₁ := SchwartzMap.seminorm ℂ 0 0 (SchwartzMap.derivCLM ℂ ℂ g) let G₂ := SchwartzMap.seminorm ℂ 0 0 (SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ g)) have hG₀ : 0 ≤ G₀ := by dsimp [G₀]; positivity have hG₁ : 0 ≤ G₁ := by dsimp [G₁]; positivity have hG₂ : 0 ≤ G₂ := by dsimp [G₂]; positivity refine ⟨G₀*B₀,G₁*B₀+G₀*B₁,G₂*B₀+(G₀+2*G₁)*B₁+G₀*B₂, by positivity,by positivity,by positivity,?_⟩ intro v u hu let W := (1+v^2)^((j : ℝ)/4) let x := exponentialProfileArgument v u have hW : 0 ≤ W := by dsimp [W]; positivity have ht : a ≤ exp (-u)/(2*Real.pi) := div_le_div_of_nonneg_right (exp_le_exp.mpr (neg_le_neg hu.2)) (by positivity) have hx : exp (-u)/(2*Real.pi)*v = x := by dsimp [x,exponentialProfileArgument]; ring have hb₀ : W*‖f x‖ ≤ B₀ := by simpa only [hx,pow_zero,mul_one] using hf₀ _ ht v have hb₁ : W* |x| *‖deriv f x‖ ≤ B₁ := by simpa only [hx,pow_one,SchwartzMap.derivCLM_apply] using hf₁ _ ht v have hb₂ : W* |x|^2*‖deriv (deriv f) x‖ ≤ B₂ := by have hh := hf₂ _ ht v rw [hx] at hh exact hh have hg₀ : ‖g u‖ ≤ G₀ := SchwartzMap.norm_le_seminorm ℂ g u have hg₁ : ‖deriv g u‖ ≤ G₁ := SchwartzMap.norm_le_seminorm ℂ (SchwartzMap.derivCLM ℂ ℂ g) u have hg₂ : ‖deriv (deriv g) u‖ ≤ G₂ := SchwartzMap.norm_le_seminorm ℂ (SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ g)) u have hgc : ‖g u-2*deriv g u‖ ≤ G₀+2*G₁ := by calc _ ≤ ‖g u‖+‖(2 : ℂ)*deriv g u‖ := norm_sub_le _ _ _ ≤ _ := by rw [norm_mul]; norm_num only [Complex.norm_ofNat]; gcongr refine ⟨?_,?_,?_⟩ · change W*‖g u*f x‖ ≤ _ rw [norm_mul] calc _ = ‖g u‖*(W*‖f x‖) := by ring _ ≤ _ := mul_le_mul hg₀ hb₀ (by positivity) hG₀ · change W*‖deriv g u*f x-g u*(x : ℂ)*deriv f x‖ ≤ _ calc _ ≤ W*(‖deriv g u*f x‖+‖g u*(x : ℂ)*deriv f x‖) := mul_le_mul_of_nonneg_left (norm_sub_le _ _) hW _ = ‖deriv g u‖*(W*‖f x‖)+‖g u‖*(W* |x| *‖deriv f x‖) := by simp only [norm_mul,Complex.norm_real,Real.norm_eq_abs]; ring _ ≤ _ := add_le_add (mul_le_mul hg₁ hb₀ (by positivity) hG₁) (mul_le_mul hg₀ hb₁ (by positivity) hG₀) · change W*‖deriv (deriv g) u*f x+(g u-2*deriv g u)*(x : ℂ)*deriv f x+ g u*(x : ℂ)^2*deriv (deriv f) x‖ ≤ _ calc _ ≤ W*(‖deriv (deriv g) u*f x‖+‖(g u-2*deriv g u)*(x : ℂ)*deriv f x‖+ ‖g u*(x : ℂ)^2*deriv (deriv f) x‖) := mul_le_mul_of_nonneg_left ((norm_add_le _ _).trans (add_le_add (norm_add_le _ _) le_rfl)) hW _ = ‖deriv (deriv g) u‖*(W*‖f x‖)+‖g u-2*deriv g u‖*(W* |x| *‖deriv f x‖)+ ‖g u‖*(W* |x|^2*‖deriv (deriv f) x‖) := by simp only [norm_mul,norm_pow,Complex.norm_real,Real.norm_eq_abs]; ring _ ≤ _ := add_le_add (add_le_add (mul_le_mul hg₂ hb₀ (by positivity) hG₂) (mul_le_mul hgc hb₁ (by positivity) (by positivity))) (mul_le_mul hg₀ hb₂ (by positivity) hG₀) end Bounty end section open MeasureTheory open scoped ComplexConjugate namespace Bounty theorem squared_integral_eq_product_integral {f : ℝ → ℂ} (hf : Integrable f) : ‖∫ t : ℝ, f t‖^2 = ∫ p : ℝ × ℝ, (f p.1 * conj (f p.2)).re ∂(volume.prod volume) := by have hfc : Integrable (fun t => conj (f t)) := by apply hf.norm.mono' · exact Complex.continuous_conj.comp_aestronglyMeasurable hf.aestronglyMeasurable · filter_upwards [] with t simp only [Complex.norm_conj, le_refl] have hr := integral_re (hf.mul_prod hfc) change (∫ p : ℝ × ℝ, (f p.1 * conj (f p.2)).re ∂(volume.prod volume)) = _ at hr rw [hr, integral_prod_mul f (fun t => conj (f t)), integral_conj] change ‖∫ t : ℝ, f t‖^2 = ((∫ t : ℝ, f t) * conj (∫ t : ℝ, f t)).re rw [Complex.mul_conj, Complex.ofReal_re, Complex.normSq_eq_norm_sq] theorem bounded_amplitude_integrable_slice {A : ℝ → ℝ → ℂ} {f : ℝ → ℂ} {M : ℝ} (hA : Continuous (Function.uncurry A)) (hf : Continuous f) (hfi : Integrable f) (hAb : ∀ u t, ‖A u t‖ ≤ M) (u : ℝ) : Integrable (fun t : ℝ => A u t * f t) := by apply (hfi.norm.const_mul M).mono' (by fun_prop) filter_upwards [] with t rw [norm_mul] exact mul_le_mul_of_nonneg_right (hAb u t) (norm_nonneg _) theorem bounded_amplitude_energy_integrable (μ : Measure ℝ) [IsFiniteMeasure μ] {A : ℝ → ℝ → ℂ} {f : ℝ → ℂ} {M : ℝ} (hA : Continuous (Function.uncurry A)) (hf : Continuous f) (hfi : Integrable f) (hM : 0 ≤ M) (hAb : ∀ u t, ‖A u t‖ ≤ M) : Integrable (fun u : ℝ => ‖∫ t : ℝ, A u t * f t‖^2) μ := by have hc : Continuous (fun p : ℝ × ℝ => A p.1 p.2 * f p.2) := by fun_prop have hm : StronglyMeasurable (fun u : ℝ => ∫ t : ℝ, A u t * f t) := hc.stronglyMeasurable.integral_prod_right' apply (integrable_const ((M * ∫ t : ℝ, ‖f t‖)^2)).mono' · exact (hm.norm.pow 2).aestronglyMeasurable · filter_upwards [] with u rw [Real.norm_of_nonneg (sq_nonneg _)] have hn : ‖∫ t : ℝ, A u t * f t‖ ≤ M * ∫ t : ℝ, ‖f t‖ := by rw [← integral_const_mul] apply norm_integral_le_of_norm_le (hfi.norm.const_mul M) filter_upwards [] with t rw [norm_mul] exact mul_le_mul_of_nonneg_right (hAb u t) (norm_nonneg _) exact pow_le_pow_left₀ (norm_nonneg _) hn 2 theorem bounded_amplitude_gram_energy (μ : Measure ℝ) [IsFiniteMeasure μ] {A : ℝ → ℝ → ℂ} {f : ℝ → ℂ} {M : ℝ} (hA : Continuous (Function.uncurry A)) (hf : Continuous f) (hfi : Integrable f) (hM : 0 ≤ M) (hAb : ∀ u t, ‖A u t‖ ≤ M) : Integrable (fun p : ℝ × ℝ => ((∫ u : ℝ, A u p.1 * conj (A u p.2) ∂μ) * (f p.1 * conj (f p.2))).re) (volume.prod volume) ∧ (∫ u : ℝ, ‖∫ t : ℝ, A u t * f t‖^2 ∂μ) = ∫ p : ℝ × ℝ, ((∫ u : ℝ, A u p.1 * conj (A u p.2) ∂μ) * (f p.1 * conj (f p.2))).re ∂(volume.prod volume) := by let B : ℝ → (ℝ × ℝ) → ℂ := fun u p => (A u p.1 * conj (A u p.2)) * (f p.1 * conj (f p.2)) have hBc : Continuous (Function.uncurry B) := by dsimp [B] fun_prop have hBb (u : ℝ) (p : ℝ × ℝ) : ‖B u p‖ ≤ M^2 * (‖f p.1‖ * ‖f p.2‖) := by dsimp [B] simp only [norm_mul, Complex.norm_conj] have hprod := mul_le_mul (hAb u p.1) (hAb u p.2) (norm_nonneg _) hM calc _ ≤ (M*M) * (‖f p.1‖ * ‖f p.2‖) := mul_le_mul_of_nonneg_right hprod (mul_nonneg (norm_nonneg _) (norm_nonneg _)) _ = _ := by ring have hBi : Integrable (Function.uncurry B) (μ.prod (volume.prod volume)) := by apply (((hfi.norm.mul_prod hfi.norm).const_mul (M^2)).comp_snd μ).mono' hBc.aestronglyMeasurable filter_upwards [] with p exact hBb p.1 p.2 have hBui (p : ℝ × ℝ) : Integrable (fun u : ℝ => B u p) μ := by apply (integrable_const (M^2 * (‖f p.1‖ * ‖f p.2‖))).mono' (by fun_prop) filter_upwards [] with u exact hBb u p have hstart (u : ℝ) : ‖∫ t : ℝ, A u t * f t‖^2 = ∫ p : ℝ × ℝ, (B u p).re ∂(volume.prod volume) := by rw [squared_integral_eq_product_integral (bounded_amplitude_integrable_slice hA hf hfi hAb u)] apply integral_congr_ae filter_upwards [] with p dsimp [B] congr 1 simp only [map_mul] ring have hfinish (p : ℝ × ℝ) : (∫ u : ℝ, (B u p).re ∂μ) = ((∫ u : ℝ, A u p.1 * conj (A u p.2) ∂μ) * (f p.1 * conj (f p.2))).re := by have hr := integral_re (hBui p) change (∫ u : ℝ, (B u p).re ∂μ) = _ at hr rw [hr] dsimp [B] rw [integral_mul_const] refine ⟨?_, ?_⟩ · exact hBi.re.integral_prod_right.congr (Filter.Eventually.of_forall hfinish) calc _ = ∫ u : ℝ, ∫ p : ℝ × ℝ, (B u p).re ∂(volume.prod volume) ∂μ := by apply integral_congr_ae filter_upwards [] with u exact hstart u _ = ∫ p : ℝ × ℝ, ∫ u : ℝ, (B u p).re ∂μ ∂(volume.prod volume) := integral_integral_swap hBi.re _ = _ := by apply integral_congr_ae filter_upwards [] with p exact hfinish p theorem bounded_amplitude_energy_le_of_gram (μ : Measure ℝ) [IsFiniteMeasure μ] {A : ℝ → ℝ → ℂ} {f : ℝ → ℂ} {M : ℝ} {K : ℝ → ℝ} (hA : Continuous (Function.uncurry A)) (hf : Continuous f) (hfi : Integrable f) (hf2 : Integrable (fun t => ‖f t‖^2)) (hM : 0 ≤ M) (hAb : ∀ u t, ‖A u t‖ ≤ M) (hK : Continuous K) (hKi : Integrable K) (hK0 : ∀ t, 0 ≤ K t) (hKe : ∀ t, K (-t) = K t) (hGram : ∀ t r, ‖∫ u : ℝ, A u t * conj (A u r) ∂μ‖ ≤ K (t-r)) : (∫ u : ℝ, ‖∫ t : ℝ, A u t * f t‖^2 ∂μ) ≤ (∫ t : ℝ, K t) * ∫ t : ℝ, ‖f t‖^2 := by obtain ⟨hGramInt, hEq⟩ := bounded_amplitude_gram_energy μ hA hf hfi hM hAb rw [hEq] obtain ⟨hcross, hbound⟩ := schur_quadratic_bound hK hKi hK0 hKe hf hf2 apply le_trans ?_ hbound apply integral_mono hGramInt hcross intro p calc _ ≤ ‖(∫ u : ℝ, A u p.1 * conj (A u p.2) ∂μ) * (f p.1 * conj (f p.2))‖ := Complex.re_le_norm _ _ ≤ _ := by simp only [norm_mul, Complex.norm_conj] have := mul_le_mul_of_nonneg_right (hGram p.1 p.2) (mul_nonneg (norm_nonneg (f p.1)) (norm_nonneg (f p.2))) simpa only [mul_assoc] using this end Bounty end section /- A forest compatible with an injective initial prefix has no selected child in that prefix. -/ namespace Bounty theorem birth_forest_no_child_in_injective_prefix {m : ℕ} {α : Type*} (code : BirthForestCode m) (performed initial : Fin m → Prop) (label : Fin m → α) (hdown : ∀ i j, i < j → initial j → initial i) (hinj : Set.InjOn label {i | initial i}) (hcompat : birthForestCompatible performed label code) : ∀ j, initial j → code j = none := by intro j hj cases hc : code j with | none => rfl | some i => have h := hcompat j rw [hc] at h have hlt : birthForestParentEmbedding j i < j := i.isLt have he := hinj (hdown _ _ hlt hj) hj h.2.2 exact False.elim ((ne_of_lt hlt) he) theorem birth_forest_initial_stage_trivial {m L : ℕ} {α : Type*} (owner : Fin m → Fin (L + 1)) (code : BirthForestCode m) (hcode : ∀ i, owner i = 0 → code i = none) (values : Fin m → Option α) : birthForestStageCondition owner 0 values code := by intro i hi rw [hcode i hi] trivial end Bounty end section open scoped BigOperators ComplexConjugate open MeasureTheory namespace Bounty theorem interval_gram_norm_symm (u v : ℝ → ℂ) (a b : ℝ) : ‖∫ t in a..b, u t * conj (v t)‖ = ‖∫ t in a..b, v t * conj (u t)‖ := by rw [← Complex.norm_conj (∫ t in a..b, v t * conj (u t)), ← intervalIntegral.intervalIntegral_conj] congr 1 apply intervalIntegral.integral_congr intro t _ simp only [map_mul, starRingEnd_self_apply] ring theorem interval_finite_gram_row_bound {ι : Type*} (s : Finset ι) (u : ι → ℝ → ℂ) (c : ι → ℂ) (a b B : ℝ) (hu : ∀ i ∈ s, Continuous (u i)) (hrow : ∀ i ∈ s, (∑ j ∈ s, ‖∫ t in a..b, u i t * conj (u j t)‖) ≤ B) : (∫ t in a..b, ‖∑ i ∈ s, c i * u i t‖ ^ 2) ≤ B * ∑ i ∈ s, ‖c i‖ ^ 2 := by let K (i j : ι) : ℂ := ∫ t in a..b, u i t * conj (u j t) have hterm (i j : ι) : 2 * (c i * conj (c j) * K i j).re ≤ ‖c i‖ ^ 2 * ‖K i j‖ + ‖c j‖ ^ 2 * ‖K i j‖ := by have hre := Complex.re_le_norm (c i * conj (c j) * K i j) simp only [norm_mul, Complex.norm_conj] at hre nlinarith [mul_nonneg (sq_nonneg (‖c i‖ - ‖c j‖)) (norm_nonneg (K i j))] have hs := Finset.sum_le_sum (fun i (_ : i ∈ s) => Finset.sum_le_sum (fun j (_ : j ∈ s) => hterm i j)) have hswap : (∑ i ∈ s, ∑ j ∈ s, ‖c j‖ ^ 2 * ‖K i j‖) = ∑ i ∈ s, ‖c i‖ ^ 2 * ∑ j ∈ s, ‖K i j‖ := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ rw [show ‖K j i‖ = ‖K i j‖ from interval_gram_norm_symm (u j) (u i) a b] simp only [Finset.sum_add_distrib] at hs simp_rw [← Finset.mul_sum] at hs rw [hswap] at hs have hm : (∑ i ∈ s, ∑ j ∈ s, (c i * conj (c j) * K i j).re) ≤ ∑ i ∈ s, ‖c i‖ ^ 2 * ∑ j ∈ s, ‖K i j‖ := by linarith rw [interval_finite_gram_energy s u c a b hu] calc _ ≤ ∑ i ∈ s, ‖c i‖ ^ 2 * ∑ j ∈ s, ‖K i j‖ := hm _ ≤ ∑ i ∈ s, ‖c i‖ ^ 2 * B := Finset.sum_le_sum (fun i hi => mul_le_mul_of_nonneg_left (hrow i hi) (sq_nonneg _)) _ = _ := by rw [← Finset.sum_mul, mul_comm] end Bounty end section open scoped BigOperators ComplexConjugate open MeasureTheory namespace Bounty theorem exponential_phase_gram (v w t : ℝ) : Complex.exp ((v * t : ℝ) * Complex.I) * conj (Complex.exp ((w * t : ℝ) * Complex.I)) = Complex.exp (((v - w) * t : ℝ) * Complex.I) := by rw [← Complex.exp_conj, ← Complex.exp_add] congr 1 simp only [map_mul, Complex.conj_ofReal, Complex.conj_I] push_cast ring theorem logarithmic_gram_off_diagonal {m n N : ℕ} (hm : 0 < m) (hn : m < n) (hnN : n ≤ N) (a b : ℝ) : ‖∫ t in a..b, Complex.exp ((Real.log (m : ℝ) * t : ℝ) * Complex.I) * conj (Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I))‖ ≤ 2 * (N : ℝ) * ((n - m : ℕ) : ℝ)⁻¹ := by have hm0 : (0 : ℝ) < m := by exact_mod_cast hm have hmn : (m : ℝ) < n := by exact_mod_cast hn have hn0 : (0 : ℝ) < n := hm0.trans hmn have hN0 : (0 : ℝ) < N := hn0.trans_le (by exact_mod_cast hnN) have hlog : Real.log (m : ℝ) < Real.log (n : ℝ) := Real.strictMonoOn_log hm0 hn0 hmn have hgap := logarithmic_gap_lower hm0 hmn (show (n : ℝ) ≤ N by exact_mod_cast hnN) simp_rw [exponential_phase_gram] apply (oscillatory_interval_norm_le (sub_ne_zero.mpr hlog.ne)).trans rw [abs_of_neg (sub_neg.mpr hlog), neg_sub] have hdiff : (0 : ℝ) < n - m := sub_pos.mpr hmn calc 2 / (Real.log (n : ℝ) - Real.log (m : ℝ)) ≤ 2 / (((n : ℝ) - m) / N) := div_le_div_of_nonneg_left (by norm_num) (div_pos hdiff hN0) hgap _ = 2 * (N : ℝ) * ((n - m : ℕ) : ℝ)⁻¹ := by rw [Nat.cast_sub hn.le] field_simp end Bounty end section open Finset open scoped ComplexConjugate namespace Bounty noncomputable def finiteShiftCorrelation (S : Finset ℤ) (f : ℤ → ℂ) (h : ℤ) : ℂ := ∑ n ∈ S, f (n+h) * conj (f n) theorem finite_shift_correlation_gram (S X : Finset ℤ) (f : ℤ → ℂ) (h k : ℤ) (hsupport : ∀ n, n ∉ S → f n = 0) (hcover : ∀ n ∈ S, n-k ∈ X) : (∑ x ∈ X, f (x+h) * conj (f (x+k))) = finiteShiftCorrelation S f (h-k) := by let g : ℤ → ℂ := fun n => f (n+(h-k)) * conj (f n) have hg : ∀ n, n ∉ S → g n = 0 := by intro n hn dsimp [g] rw [hsupport n hn, map_zero, mul_zero] have he := finite_translate_sum_eq S X g k hg hcover calc _ = ∑ x ∈ X, g (x+k) := by apply sum_congr rfl intro x hx dsimp [g] rw [show x+k+(h-k) = x+h by omega] _ = _ := he theorem finite_shift_correlation_conj (S : Finset ℤ) (f : ℤ → ℂ) (h : ℤ) (hsupport : ∀ n, n ∉ S → f n = 0) : conj (finiteShiftCorrelation S f h) = finiteShiftCorrelation S f (-h) := by classical let X := S ∪ S.image (fun n => n-h) let g : ℤ → ℂ := fun n => f (n-h) * conj (f n) have hg : ∀ n, n ∉ S → g n = 0 := by intro n hn dsimp [g] rw [hsupport n hn, map_zero, mul_zero] have hcover (n : ℤ) (hn : n ∈ S) : n-h ∈ X := mem_union_right S (mem_image.mpr ⟨n, hn, rfl⟩) have he := finite_translate_sum_eq S X g h hg hcover calc _ = ∑ n ∈ S, f n * conj (f (n+h)) := by simp only [finiteShiftCorrelation, map_sum, map_mul, starRingEnd_self_apply] apply sum_congr rfl intro n hn ring _ = ∑ n ∈ X, f n * conj (f (n+h)) := by apply sum_subset (subset_union_left : S ⊆ X) intro n hn hnS rw [hsupport n hnS, zero_mul] _ = ∑ n ∈ X, g (n+h) := by apply sum_congr rfl intro n hn dsimp [g] rw [add_sub_cancel_right] _ = ∑ n ∈ S, g n := he _ = _ := by simp only [g, finiteShiftCorrelation, sub_eq_add_neg] theorem finite_shift_correlation_norm_neg (S : Finset ℤ) (f : ℤ → ℂ) (h : ℤ) (hsupport : ∀ n, n ∉ S → f n = 0) : ‖finiteShiftCorrelation S f (-h)‖ = ‖finiteShiftCorrelation S f h‖ := by rw [← finite_shift_correlation_conj S f h hsupport, Complex.norm_conj] theorem finite_translate_cauchy_correlation (S H X : Finset ℤ) (f : ℤ → ℂ) (hsupport : ∀ n, n ∉ S → f n = 0) (hcover : ∀ n ∈ S, ∀ h ∈ H, n-h ∈ X) : (H.card : ℝ)^2 * ‖∑ n ∈ S, f n‖^2 ≤ (X.card : ℝ) * ∑ h ∈ H, ∑ k ∈ H, (finiteShiftCorrelation S f (h-k)).re := by apply (finite_translate_cauchy_gram S H X f hsupport hcover).trans_eq congr 1 apply sum_congr rfl intro h hh apply sum_congr rfl intro k hk rw [finite_shift_correlation_gram S X f h k hsupport (fun n hn => hcover n hn k hk)] end Bounty end section open Finset namespace Bounty theorem symmetric_integer_interval_sum (G : ℤ → ℝ) (T : ℤ) (hT : 0 ≤ T) (hG : ∀ d, G (-d) = G d) : (∑ d ∈ Icc (-T) T, G d) = G 0 + 2 * ∑ d ∈ Icc 1 T, G d := by classical let P := Icc (1:ℤ) T have he : Icc (-T) T = insert 0 (P ∪ P.image (fun n => -n)) := by ext n simp only [mem_Icc, mem_insert, mem_union, mem_image, P] constructor · intro hn by_cases hn0 : n = 0 · exact Or.inl hn0 · right by_cases hnpos : 0 < n · left; omega · right; exact ⟨-n, by omega, by omega⟩ · rintro (rfl | hn | hn) · omega · omega · obtain ⟨d, hd, rfl⟩ := hn omega have hz : (0:ℤ) ∉ P ∪ P.image (fun n => -n) := by simp only [mem_union, mem_image, mem_Icc, P] omega have hd : Disjoint P (P.image (fun n => -n)) := by apply disjoint_left.mpr intro n hn hn' obtain ⟨d, hd, he⟩ := mem_image.mp hn' have hn1 := (mem_Icc.mp hn).1 have hd1 := (mem_Icc.mp hd).1 omega rw [he, sum_insert hz, sum_union hd, sum_image] · simp_rw [hG] dsimp [P] ring · intro a ha b hb hab exact neg_injective hab theorem toeplitz_integer_interval_sum_bound (G : ℤ → ℝ) (T : ℤ) (hT : 0 ≤ T) (hG0 : ∀ d, 0 ≤ G d) (hGneg : ∀ d, G (-d) = G d) : (∑ h ∈ Icc (0:ℤ) T, ∑ k ∈ Icc (0:ℤ) T, G (h-k)) ≤ ((T+1:ℤ):ℝ) * (G 0 + 2 * ∑ d ∈ Icc (1:ℤ) T, G d) := by classical have hrow (h : ℤ) (hh : h ∈ Icc (0:ℤ) T) : (∑ k ∈ Icc (0:ℤ) T, G (h-k)) ≤ ∑ d ∈ Icc (-T) T, G d := by have him : (Icc (0:ℤ) T).image (fun k => h-k) ⊆ Icc (-T) T := by intro d hd obtain ⟨k, hk, rfl⟩ := mem_image.mp hd have hh' := mem_Icc.mp hh have hk' := mem_Icc.mp hk apply mem_Icc.mpr omega calc _ = ∑ d ∈ (Icc (0:ℤ) T).image (fun k => h-k), G d := by rw [sum_image] intro a ha b hb hab exact sub_right_inj.mp hab _ ≤ _ := sum_le_sum_of_subset_of_nonneg him (fun d hd hdnot => hG0 d) calc _ ≤ ∑ _h ∈ Icc (0:ℤ) T, ∑ d ∈ Icc (-T) T, G d := sum_le_sum hrow _ = ((T+1:ℤ):ℝ) * ∑ d ∈ Icc (-T) T, G d := by rw [sum_const, nsmul_eq_mul] congr 1 have hc := Int.card_Icc_of_le (a := 0) (b := T) (by omega) simp only [sub_zero] at hc exact_mod_cast hc _ = _ := by rw [symmetric_integer_interval_sum G T hT hGneg] end Bounty end section /- Constant-real-part reciprocal weights have telescoping variation. -/ open Finset namespace Bounty theorem norm_complex_sub_of_re_eq {z w : ℂ} (h : z.re = w.re) : ‖z-w‖ = |z.im-w.im| := by have he : z-w = ((z.im-w.im : ℝ) : ℂ)*Complex.I := by apply Complex.ext <;> simp [h] rw [he, norm_mul, Complex.norm_real, Real.norm_eq_abs, Complex.norm_I, mul_one] theorem monotone_phase_weight_variation (w : ℕ → ℂ) (N : ℕ) (hre : ∀ n ≤ N, (w n).re = (w 0).re) (him : ∀ n < N, (w n).im ≤ (w (n+1)).im) : (∑ n ∈ range N, ‖w (n+1)-w n‖) = (w N).im-(w 0).im := by calc _ = ∑ n ∈ range N, ((w (n+1)).im-(w n).im) := by apply sum_congr rfl intro n hn have hn' := mem_range.mp hn rw [norm_complex_sub_of_re_eq ((hre (n+1) (by omega)).trans (hre n (by omega)).symm), abs_of_nonneg (sub_nonneg.mpr (him n hn'))] _ = _ := sum_range_sub (fun n => (w n).im) N theorem antitone_phase_weight_variation (w : ℕ → ℂ) (N : ℕ) (hre : ∀ n ≤ N, (w n).re = (w 0).re) (him : ∀ n < N, (w (n+1)).im ≤ (w n).im) : (∑ n ∈ range N, ‖w (n+1)-w n‖) = (w 0).im-(w N).im := by have hh := monotone_phase_weight_variation (fun n => -w n) N (fun n hn => by simpa only [Complex.neg_re] using congrArg Neg.neg (hre n hn)) (fun n hn => by simpa only [Complex.neg_im, neg_le_neg_iff] using him n hn) simpa only [neg_sub_neg, norm_sub_rev, Complex.neg_im, neg_sub_neg] using hh theorem monotone_reciprocal_sum_bound (u w : ℕ → ℂ) (N : ℕ) (hw : ∀ n < N, w n*(u n-u (n+1)) = u n) (hu : ∀ n ≤ N, ‖u n‖ ≤ 1) (hre : ∀ n ≤ N, (w n).re = (w 0).re) (him : (∀ n < N, (w n).im ≤ (w (n+1)).im) ∨ (∀ n < N, (w (n+1)).im ≤ (w n).im)) : ‖∑ n ∈ range N, u n‖ ≤ 2*(‖w 0‖+‖w N‖) := by have hh := sum_phase_reciprocal_norm_le u w N hw hu rcases him with hi | hi · rw [monotone_phase_weight_variation w N hre hi] at hh have hN := Complex.im_le_norm (w N) have h0 : -(w 0).im ≤ ‖w 0‖ := (neg_le_abs _).trans (Complex.abs_im_le_norm _) linarith · rw [antitone_phase_weight_variation w N hre hi] at hh have hN : -(w N).im ≤ ‖w N‖ := (neg_le_abs _).trans (Complex.abs_im_le_norm _) have h0 := Complex.im_le_norm (w 0) linarith end Bounty end section /- Quantitative and monotone control of the phase reciprocal on one unit band. -/ open Real Set namespace Bounty theorem norm_phase_reciprocal_unit_band {δ x : ℝ} (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (hx : δ ≤ x ∧ x ≤ 1-δ) : ‖phaseReciprocalKernel (2*Real.pi*x)‖ ≤ 1/(2*δ) := by have hs := sine_pi_lower_on_unit_band hδ hδhalf hx have hsp : 0 < sin (Real.pi*x) := by linarith have hhalf : (2*Real.pi*x)/2 = Real.pi*x := by ring have hr : |cos (Real.pi*x)/(2*sin (Real.pi*x))| ≤ 1/(4*δ) := by rw [abs_div, abs_of_pos (by positivity : 0 < 2*sin (Real.pi*x))] calc _ ≤ 1/(2*sin (Real.pi*x)) := div_le_div_of_nonneg_right (abs_cos_le_one _) (by positivity) _ ≤ 1/(4*δ) := one_div_le_one_div_of_le (by positivity) (by linarith) have hc : (1/2 : ℝ) ≤ 1/(4*δ) := (le_div_iff₀ (by positivity)).mpr (by linarith) calc _ ≤ |(phaseReciprocalKernel (2*Real.pi*x)).re| + |(phaseReciprocalKernel (2*Real.pi*x)).im| := Complex.norm_le_abs_re_add_abs_im _ _ = 1/2 + |cos (Real.pi*x)/(2*sin (Real.pi*x))| := by rw [phase_reciprocal_kernel_re, phase_reciprocal_kernel_im, hhalf] norm_num _ ≤ 1/(4*δ)+1/(4*δ) := add_le_add hc hr _ = 1/(2*δ) := by field_simp; ring theorem antitoneOn_unit_phase_reciprocal_im : AntitoneOn (fun x : ℝ => (phaseReciprocalKernel (2*Real.pi*x)).im) (Ioo 0 1) := by intro x hx y hy hxy dsimp only have hh := strictAntiOn_unit_cotangent.antitoneOn hx hy hxy rw [phase_reciprocal_kernel_im, phase_reciprocal_kernel_im, show (2*Real.pi*y)/2 = Real.pi*y by ring, show (2*Real.pi*x)/2 = Real.pi*x by ring] have he (t : ℝ) : cos (Real.pi*t)/(2*sin (Real.pi*t)) = (cos (Real.pi*t)/sin (Real.pi*t))/2 := by ring rw [he,he] exact div_le_div_of_nonneg_right hh (by norm_num) theorem phase_reciprocal_unit_mul {x : ℝ} (hx : x ∈ Ioo 0 1) : phaseReciprocalKernel (2*Real.pi*x) * (1-Complex.exp (((2*Real.pi*x : ℝ) : ℂ)*Complex.I)) = 1 := by apply phase_reciprocal_kernel_mul rw [show (2*Real.pi*x)/2 = Real.pi*x by ring] exact (sin_pos_of_pos_of_lt_pi (mul_pos pi_pos hx.1) (by nlinarith [mul_lt_mul_of_pos_left hx.2 pi_pos])).ne' end Bounty end section /- Reversing the sign of a real exponential phase preserves the sum norm. -/ open Finset namespace Bounty theorem norm_sum_exp_phase_neg {ι : Type*} (S : Finset ι) (f : ι → ℝ) : ‖∑ n ∈ S, Complex.exp (((-f n : ℝ) : ℂ)*Complex.I)‖ = ‖∑ n ∈ S, Complex.exp (((f n : ℝ) : ℂ)*Complex.I)‖ := by have he (n : ι) : Complex.exp (((-f n : ℝ) : ℂ)*Complex.I) = (starRingEnd ℂ) (Complex.exp (((f n : ℝ) : ℂ)*Complex.I)) := by rw [← Complex.exp_conj] congr 1 simp only [map_mul, Complex.conj_ofReal, Complex.conj_I] push_cast ring simp_rw [he] rw [← map_sum] exact Complex.norm_conj _ end Bounty end section /- Reduction of a separated monotone slope sum to its first-derivative interval bounds. -/ open Finset namespace Bounty theorem discrete_slope_band_sum_bound {a b : ℕ} {d : ℕ → ℝ} {z : ℕ → ℂ} {δ C : ℝ} (hδ : 0 < δ) (hC : 0 ≤ C) (hmono : MonotoneOn d (Set.Icc a b)) (hfirst : ∀ l r : ℕ, ∀ k : ℤ, a ≤ l → r ≤ b → l ≤ r → (∀ n ∈ Icc l r, (k : ℝ)+δ ≤ d n ∧ d n ≤ k+1-δ) → ‖∑ n ∈ Icc l r, z n‖ ≤ C/δ) (k : ℤ) : ‖∑ n ∈ discreteSlopeBand a b d (k+δ) (k+1-δ), z n‖ ≤ C/δ := by classical let S := discreteSlopeBand a b d (k+δ) (k+1-δ) by_cases hne : S.Nonempty · have heq := discrete_slope_band_interval hmono hne have hlo := mem_filter.mp (S.min'_mem hne) have hhi := mem_filter.mp (S.max'_mem hne) rw [heq] apply hfirst _ _ k (mem_Icc.mp hlo.1).1 (mem_Icc.mp hhi.1).2 (S.min'_le_max' hne) intro n hn have hnS : n ∈ discreteSlopeBand a b d (k+δ) (k+1-δ) := heq.symm ▸ hn exact (mem_filter.mp hnS).2 · have he : S = ∅ := not_nonempty_iff_eq_empty.mp hne change ‖∑ n ∈ S, z n‖ ≤ C/δ rw [he,sum_empty,norm_zero] positivity theorem discrete_slope_fiber_sum_bound {a b : ℕ} {d : ℕ → ℝ} {z : ℕ → ℂ} {lam δ C : ℝ} (hlam : 0 < lam) (hδ : 0 < δ) (hC : 0 ≤ C) (hmono : MonotoneOn d (Set.Icc a b)) (hsep : ∀ i ∈ Icc a b, ∀ j ∈ Icc a b, i ≤ j → lam*((j : ℝ)-i) ≤ d j-d i) (hz : ∀ n ∈ Icc a b, ‖z n‖ ≤ 1) (hfirst : ∀ l r : ℕ, ∀ k : ℤ, a ≤ l → r ≤ b → l ≤ r → (∀ n ∈ Icc l r, (k : ℝ)+δ ≤ d n ∧ d n ≤ k+1-δ) → ‖∑ n ∈ Icc l r, z n‖ ≤ C/δ) (k : ℤ) : ‖∑ n ∈ (Icc a b).filter (fun n => ⌊d n⌋ = k), z n‖ ≤ C/δ+2*(δ/lam+1) := by classical let S := (Icc a b).filter (fun n => ⌊d n⌋ = k) let G := fun n => (k : ℝ)+δ ≤ d n ∧ d n ≤ k+1-δ have hg : S.filter G = discreteSlopeBand a b d (k+δ) (k+1-δ) := by ext n simp only [S,G,discreteSlopeBand,mem_filter] constructor · rintro ⟨⟨hn,hfloor⟩,hg⟩ exact ⟨hn,hg⟩ · rintro ⟨hn,hg⟩ exact ⟨⟨hn,Int.floor_eq_iff.mpr ⟨by linarith [hg.1],by linarith [hg.2]⟩⟩,hg⟩ have hbad : S.filter (fun n => ¬G n) ⊆ discreteSlopeBand a b d k (k+δ) ∪ discreteSlopeBand a b d (k+1-δ) (k+1) := by intro n hn obtain ⟨hn,hnot⟩ := mem_filter.mp hn obtain ⟨hn,hfloor⟩ := mem_filter.mp hn have hf := Int.floor_eq_iff.mp hfloor apply mem_union.mpr by_cases hlo : (k : ℝ)+δ ≤ d n · right exact mem_filter.mpr ⟨hn,⟨by simp only [G,not_and] at hnot; exact le_of_lt (lt_of_not_ge (hnot hlo)),hf.2.le⟩⟩ · left exact mem_filter.mpr ⟨hn,⟨hf.1,le_of_lt (lt_of_not_ge hlo)⟩⟩ have hbcard : ((S.filter (fun n => ¬G n)).card : ℝ) ≤ 2*(δ/lam+1) := by have hc := (card_le_card hbad).trans (card_union_le _ _) have hcR : ((S.filter (fun n => ¬G n)).card : ℝ) ≤ ((discreteSlopeBand a b d k (k+δ)).card : ℝ)+ ((discreteSlopeBand a b d (k+1-δ) (k+1)).card : ℝ) := by exact_mod_cast hc have hl := discrete_slope_band_card_bound hlam (show (k : ℝ) ≤ k+δ by linarith) hsep have hr := discrete_slope_band_card_bound hlam (show (k : ℝ)+1-δ ≤ k+1 by linarith) hsep have hl' : ((discreteSlopeBand a b d k (k+δ)).card : ℝ) ≤ δ/lam+1 := by simpa only [add_sub_cancel_left] using hl have hr' : ((discreteSlopeBand a b d (k+1-δ) (k+1)).card : ℝ) ≤ δ/lam+1 := by convert hr using 1 <;> ring linarith have hbnorm : ‖∑ n ∈ S.filter (fun n => ¬G n), z n‖ ≤ 2*(δ/lam+1) := by calc _ ≤ ∑ n ∈ S.filter (fun n => ¬G n), ‖z n‖ := norm_sum_le _ _ _ ≤ ∑ n ∈ S.filter (fun n => ¬G n), (1 : ℝ) := sum_le_sum (fun n hn => hz n (mem_filter.mp (mem_filter.mp hn).1).1) _ = ((S.filter (fun n => ¬G n)).card : ℝ) := by simp _ ≤ _ := hbcard change ‖∑ n ∈ S, z n‖ ≤ _ rw [← sum_filter_add_sum_filter_not S G z] exact (norm_add_le _ _).trans (add_le_add (by rw [hg]; exact discrete_slope_band_sum_bound hδ hC hmono hfirst k) hbnorm) theorem discrete_slope_partition_bound {a b : ℕ} {d : ℕ → ℝ} {z : ℕ → ℂ} {lam δ C : ℝ} (hab : a ≤ b) (hlam : 0 < lam) (hδ : 0 < δ) (hC : 0 ≤ C) (hmono : MonotoneOn d (Set.Icc a b)) (hsep : ∀ i ∈ Icc a b, ∀ j ∈ Icc a b, i ≤ j → lam*((j : ℝ)-i) ≤ d j-d i) (hz : ∀ n ∈ Icc a b, ‖z n‖ ≤ 1) (hfirst : ∀ l r : ℕ, ∀ k : ℤ, a ≤ l → r ≤ b → l ≤ r → (∀ n ∈ Icc l r, (k : ℝ)+δ ≤ d n ∧ d n ≤ k+1-δ) → ‖∑ n ∈ Icc l r, z n‖ ≤ C/δ) : ‖∑ n ∈ Icc a b, z n‖ ≤ (d b-d a+2)*(C/δ+2*(δ/lam+1)) := by classical have hmap : ∀ n ∈ Icc a b, ⌊d n⌋ ∈ Icc ⌊d a⌋ ⌊d b⌋ := by intro n hn obtain ⟨han,hnb⟩ := mem_Icc.mp hn exact mem_Icc.mpr ⟨Int.floor_mono (hmono ⟨le_rfl,hab⟩ ⟨han,hnb⟩ han), Int.floor_mono (hmono ⟨han,hnb⟩ ⟨hab,le_rfl⟩ hnb)⟩ rw [← sum_fiberwise_of_maps_to hmap z] calc _ ≤ ∑ k ∈ Icc ⌊d a⌋ ⌊d b⌋, ‖∑ n ∈ (Icc a b).filter (fun n => ⌊d n⌋=k), z n‖ := norm_sum_le _ _ _ ≤ ∑ k ∈ Icc ⌊d a⌋ ⌊d b⌋, (C/δ+2*(δ/lam+1)) := sum_le_sum (fun k _ => discrete_slope_fiber_sum_bound hlam hδ hC hmono hsep hz hfirst k) _ = ((Icc ⌊d a⌋ ⌊d b⌋).card : ℝ)*(C/δ+2*(δ/lam+1)) := by simp only [sum_const,nsmul_eq_mul] _ ≤ _ := mul_le_mul_of_nonneg_right (floor_slope_range_card hab hmono) (by positivity) end Bounty end section /- Coefficients of a power of a finite prime polynomial, grouped by the integer product of an ordered tuple. Repeated prime entries are allowed. The squared coefficient sum has the factorial bound from unique factorization. -/ open Finset open scoped Classical namespace Bounty noncomputable def primePolynomialSupport (P : Finset ℕ) (j : ℕ) : Finset ℕ := univ.image (primeTupleProduct P j) noncomputable def primePolynomialCoefficient (P : Finset ℕ) (w : P → ℂ) (j n : ℕ) : ℂ := ∑ a ∈ univ.filter (fun a : Fin j → P => primeTupleProduct P j a = n), ∏ r, w (a r) theorem prime_polynomial_support_pos (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (j n : ℕ) (hn : n ∈ primePolynomialSupport P j) : 0 < n := by obtain ⟨a, _, rfl⟩ := mem_image.mp hn exact prod_pos fun r _ => (hP (a r).val (a r).property).pos theorem prime_polynomial_coefficients_sum_mul (P : Finset ℕ) (w : P → ℂ) (j : ℕ) (χ : ℕ → ℂ) : (∑ n ∈ primePolynomialSupport P j, primePolynomialCoefficient P w j n * χ n) = ∑ a : Fin j → P, (∏ r, w (a r)) * χ (primeTupleProduct P j a) := finite_fiber_sum_mul (primeTupleProduct P j) (fun a => ∏ r, w (a r)) χ theorem prime_tuple_weight_sq_sum (P : Finset ℕ) (w : P → ℂ) (j : ℕ) : (∑ a : Fin j → P, ‖∏ r, w (a r)‖ ^ 2) = (∑ p : P, ‖w p‖ ^ 2) ^ j := by simp only [norm_prod, ← prod_pow] exact (Fintype.sum_pow (fun p : P => ‖w p‖ ^ 2) j).symm theorem prime_polynomial_coefficients_sq_le_factorial (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (w : P → ℂ) (j : ℕ) : (∑ n ∈ primePolynomialSupport P j, ‖primePolynomialCoefficient P w j n‖ ^ 2) ≤ (j.factorial : ℝ) * (∑ p : P, ‖w p‖ ^ 2) ^ j := by have hh := finite_fiber_sum_norm_sq_le (primeTupleProduct P j) (fun a => ∏ r, w (a r)) j.factorial (fun n _ => prime_tuple_product_fiber_card_le_factorial P hP j n) exact hh.trans_eq (congrArg (fun x : ℝ => (j.factorial : ℝ) * x) (prime_tuple_weight_sq_sum P w j)) end Bounty end section /- An explicit exponential bound for the factorial prime-moment budget. The constant depends only on the fixed coefficient and polynomial-growth parameters; the upper prime-scale exponent remains arbitrary. -/ namespace Bounty noncomputable def primeMomentExceptionalExponent (c C d : ℝ) : ℝ := 1 + Real.log (2 * C) + d + c * (Real.log (2 * C * (c + 1)) + d + 1) theorem prime_moment_exceptional_exponent_one_le {c C d : ℝ} (hc : 0 ≤ c) (hC : 1 ≤ C) (hd : 0 ≤ d) : 1 ≤ primeMomentExceptionalExponent c C d := by have hlog : 0 ≤ Real.log (2 * C) := Real.log_nonneg (by linarith) have hbase : 1 ≤ 2 * C * (c + 1) := by nlinarith have hlog' : 0 ≤ Real.log (2 * C * (c + 1)) := Real.log_nonneg hbase have hh := mul_nonneg hc (add_nonneg (add_nonneg hlog' hd) zero_le_one) unfold primeMomentExceptionalExponent linarith only [hlog, hd, hh] theorem prime_moment_exceptional_budget_le_exp {N L Y P a b c C d : ℝ} (ha0 : 0 ≤ a) (ha1 : a ≤ 1) (hc : 0 ≤ c) (hC : 1 ≤ C) (hd : 0 ≤ d) (hL : Real.exp 1 ≤ L) (hY : 1 ≤ Y) (hlogY : Real.log Y ≤ c * L) (hPlo : Real.exp (L ^ a) / 2 ≤ P) (hPhi : P ≤ Real.exp (L ^ b)) (hN : N ≤ (C * L ^ d) * Y * (primeMomentDegree Y P).factorial * ((C * L ^ d) / P) ^ primeMomentDegree Y P) : N ≤ Real.exp (primeMomentExceptionalExponent c C d * (L ^ b + L ^ (1 - a) * Real.log L)) := by have hL0 : 0 < L := (Real.exp_pos 1).trans_le hL have hL1 : 1 ≤ L := (Real.one_le_exp (by norm_num : (0 : ℝ) ≤ 1)).trans hL have hlogL : 1 ≤ Real.log L := (Real.le_log_iff_exp_le hL0).mpr hL have hC0 : 0 < C := zero_lt_one.trans_le hC have hP0 : 0 < P := (div_pos (Real.exp_pos _) (by norm_num : (0 : ℝ) < 2)).trans_le hPlo have hP1 : 1 < 2 * P := by have he := Real.one_lt_exp_iff.mpr (Real.rpow_pos_of_pos hL0 a) linarith let j := primeMomentDegree Y P let R := L ^ (1 - a) have hR1 : 1 ≤ R := Real.one_le_rpow hL1 (by linarith) have hRL : R ≤ L := by simpa only [Real.rpow_one] using (Real.rpow_le_rpow_of_exponent_le hL1 (show 1 - a ≤ 1 by linarith)) have hj : (j : ℝ) ≤ c * R := prime_moment_degree_le hL0 hY hlogY hPlo have hjmax : max 1 (j : ℝ) ≤ (c + 1) * L := by apply max_le · nlinarith only [hL1, mul_nonneg hc hL0.le] · have hh := mul_le_mul_of_nonneg_left hRL hc linarith only [hj, hh, hL0] have hLd : 0 < L ^ d := Real.rpow_pos_of_pos hL0 d have hB : 0 < C * L ^ d := mul_pos hC0 hLd have hmax : 0 < max 1 (j : ℝ) := zero_lt_one.trans_le (le_max_left _ _) have hbase : 0 < 2 * (C * L ^ d) * max 1 (j : ℝ) := by positivity have hbudget : N ≤ (C * L ^ d) * (2 * P) * (2 * (C * L ^ d) * max 1 (j : ℝ)) ^ j := hN.trans (prime_moment_scalar_budget hY hP1 hB.le hB.le) have htotal : 0 < (C * L ^ d) * (2 * P) * (2 * (C * L ^ d) * max 1 (j : ℝ)) ^ j := by positivity apply hbudget.trans apply (Real.log_le_iff_le_exp htotal).mp have hlogP : Real.log P ≤ L ^ b := (Real.log_le_iff_le_exp hP0).mpr hPhi have htwoC : 0 < 2 * C := by positivity have hcc : 0 < 2 * C * (c + 1) := by positivity have hpref : Real.log ((C * L ^ d) * (2 * P)) ≤ Real.log (2 * C) + d * Real.log L + L ^ b := by rw [show (C * L ^ d) * (2 * P) = ((2 * C) * L ^ d) * P by ring, Real.log_mul (mul_pos htwoC hLd).ne' hP0.ne', Real.log_mul htwoC.ne' hLd.ne', Real.log_rpow hL0] linarith have hbnd : 2 * (C * L ^ d) * max 1 (j : ℝ) ≤ (2 * C * (c + 1)) * L ^ (d + 1) := by calc _ ≤ 2 * (C * L ^ d) * ((c + 1) * L) := mul_le_mul_of_nonneg_left hjmax (by positivity) _ = _ := by rw [Real.rpow_add hL0, Real.rpow_one]; ring have hlogBase : Real.log (2 * (C * L ^ d) * max 1 (j : ℝ)) ≤ Real.log (2 * C * (c + 1)) + (d + 1) * Real.log L := by have hh := Real.log_le_log hbase hbnd rwa [Real.log_mul hcc.ne' (Real.rpow_pos_of_pos hL0 _).ne', Real.log_rpow hL0] at hh have hlog2C : 0 ≤ Real.log (2 * C) := Real.log_nonneg (by linarith) have hlogCC : 0 ≤ Real.log (2 * C * (c + 1)) := Real.log_nonneg (by nlinarith) have hlogBound0 : 0 ≤ Real.log (2 * C * (c + 1)) + (d + 1) * Real.log L := by positivity have hpowered : (j : ℝ) * Real.log (2 * (C * L ^ d) * max 1 (j : ℝ)) ≤ c * R * (Real.log (2 * C * (c + 1)) + (d + 1) * Real.log L) := (mul_le_mul_of_nonneg_left hlogBase (Nat.cast_nonneg j)).trans (mul_le_mul_of_nonneg_right hj hlogBound0) rw [Real.log_mul (mul_pos hB (by positivity)).ne' (pow_pos hbase j).ne', Real.log_pow] have hfirst : Real.log (2 * C) + d * Real.log L ≤ (Real.log (2 * C) + d) * (R * Real.log L) := by have hRlog : 1 ≤ R * Real.log L := one_le_mul_of_one_le_of_one_le hR1 hlogL have h1 := mul_le_mul_of_nonneg_left hRlog hlog2C have h2 := mul_le_mul_of_nonneg_right hR1 (mul_nonneg hd (by linarith : 0 ≤ Real.log L)) nlinarith only [h1, h2] have hsecond : c * R * (Real.log (2 * C * (c + 1)) + (d + 1) * Real.log L) ≤ (c * (Real.log (2 * C * (c + 1)) + d + 1)) * (R * Real.log L) := by have hh := mul_le_mul_of_nonneg_left hlogL hlogCC have hh' := mul_le_mul_of_nonneg_left hh (mul_nonneg hc (by linarith : 0 ≤ R)) nlinarith only [hh'] have hsum : Real.log ((C * L ^ d) * (2 * P)) + (j : ℝ) * Real.log (2 * (C * L ^ d) * max 1 (j : ℝ)) ≤ (Real.log (2 * C) + d + c * (Real.log (2 * C * (c + 1)) + d + 1)) * (R * Real.log L) + L ^ b := by linarith only [add_le_add hpref hpowered, add_le_add hfirst hsecond] refine hsum.trans ?_ have hcoeff : 0 ≤ Real.log (2 * C) + d + c * (Real.log (2 * C * (c + 1)) + d + 1) := by positivity have hpos := mul_nonneg hcoeff (Real.rpow_nonneg hL0.le b) have hRlog0 : 0 ≤ R * Real.log L := by positivity dsimp only [primeMomentExceptionalExponent] change _ ≤ (1 + Real.log (2 * C) + d + c * (Real.log (2 * C * (c + 1)) + d + 1)) * (L ^ b + R * Real.log L) nlinarith only [hpos, hRlog0] end Bounty end section /- Removing a positive exceptional-value threshold from a moment count. -/ namespace Bounty theorem prime_moment_remove_threshold {X B D η : ℝ} (j : ℕ) (hη : 0 < η) (h : X * (η ^ j) ^ 2 ≤ B * D ^ j) : X ≤ B * (D / η ^ 2) ^ j := by have he : (η ^ j) ^ 2 = (η ^ 2) ^ j := by rw [← pow_mul, ← pow_mul, Nat.mul_comm j 2] rw [he] at h calc X ≤ (B * D ^ j) / (η ^ 2) ^ j := (le_div_iff₀ (pow_pos (sq_pos_of_pos hη) j)).mpr h _ = B * (D / η ^ 2) ^ j := by rw [div_pow]; ring theorem prime_moment_rpow_threshold_ratio (P A : ℝ) {L : ℝ} (hL : 0 < L) : (2 / P) / (L ^ (-A)) ^ 2 = 2 * L ^ (2 * A) / P := by rw [Real.rpow_neg hL.le, inv_pow, div_inv_eq_mul] have he : (L ^ A) ^ (2 : ℕ) = L ^ (2 * A) := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL.le] congr 1 ring rw [he] ring end Bounty end section /- Finite separated sampling estimates for exponential polynomials. -/ open scoped BigOperators namespace Bounty theorem separated_reciprocal_row_bound {ι : Type*} (s : Finset ι) (x : ι → ℝ) (N : ℕ) (i : ι) (hi : i ∈ s) (hsep : ∀ j ∈ s, ∀ k ∈ s, j ≠ k → 1 ≤ |x j - x k|) (hspan : ∀ j ∈ s, |x i - x j| ≤ N) : (∑ j ∈ s, (1 + |x i - x j|)⁻¹) ≤ 1 + 2 * (1 + Real.log N) := by classical have hl := separated_positive_reciprocal_sum (s.filter (fun j => x j < x i)) (fun j => x i - x j) N (fun j hj => by have hj' := Finset.mem_filter.mp hj have hji : i ≠ j := by intro h; subst j; exact (lt_irrefl _ hj'.2) simpa only [abs_of_nonneg (sub_nonneg.mpr hj'.2.le)] using hsep i hi j hj'.1 hji) (fun j hj => by have hj' := Finset.mem_filter.mp hj simpa only [abs_of_nonneg (sub_nonneg.mpr hj'.2.le)] using hspan j hj'.1) (fun j hj k hk hjk => by have h := hsep k (Finset.mem_filter.mp hk).1 j (Finset.mem_filter.mp hj).1 hjk.symm convert h using 1 congr 1 ring) have hr := separated_positive_reciprocal_sum (s.filter (fun j => x i < x j)) (fun j => x j - x i) N (fun j hj => by have hj' := Finset.mem_filter.mp hj have hji : j ≠ i := by intro h; subst j; exact (lt_irrefl _ hj'.2) simpa only [abs_of_nonneg (sub_nonneg.mpr hj'.2.le)] using hsep j hj'.1 i hi hji) (fun j hj => by have hj' := Finset.mem_filter.mp hj simpa only [abs_of_nonpos (sub_nonpos.mpr hj'.2.le), neg_sub] using hspan j hj'.1) (fun j hj k hk hjk => by simpa only [sub_sub_sub_cancel_right] using hsep j (Finset.mem_filter.mp hj).1 k (Finset.mem_filter.mp hk).1 hjk) have he : (∑ j ∈ s, (1 + |x i - x j|)⁻¹) = 1 + (∑ j ∈ s.filter (fun j => x j < x i), (1 + (x i - x j))⁻¹) + (∑ j ∈ s.filter (fun j => x i < x j), (1 + (x j - x i))⁻¹) := by have hp (j : ι) (hj : j ∈ s) : (1 + |x i - x j|)⁻¹ = (if j = i then 1 else 0) + (if x j < x i then (1 + (x i - x j))⁻¹ else 0) + (if x i < x j then (1 + (x j - x i))⁻¹ else 0) := by by_cases hji : j = i · subst j simp · have hne : x j ≠ x i := by intro h have h := hsep j hj i hi hji norm_num [‹x j = x i›] at h rcases lt_or_gt_of_ne hne with h | h · simp [hji, h, not_lt.mpr h.le, abs_of_nonneg (sub_nonneg.mpr h.le)] · simp [hji, h, not_lt.mpr h.le, abs_of_nonpos (sub_nonpos.mpr h.le), neg_sub] rw [Finset.sum_congr rfl hp] simp only [Finset.sum_add_distrib, Finset.sum_filter] simp [hi] rw [he] linarith end Bounty end section namespace Bounty noncomputable def logarithmicDerivativeChain (u c : ℝ) : ℕ → ℝ → ℝ | 0, x => u * Real.log (x+c) | k+1, x => u * (-1:ℝ)^k * (k.factorial:ℝ) / (x+c)^(k+1) theorem logarithmic_derivative_chain_hasDerivAt (u c : ℝ) (k : ℕ) (x : ℝ) (hx : 0 < x+c) : HasDerivAt (logarithmicDerivativeChain u c k) (logarithmicDerivativeChain u c (k+1) x) x := by cases k with | zero => have hf : logarithmicDerivativeChain u c 0 = (fun y => u * Real.log (y+c)) := by funext y; rfl rw [hf] have h := (((hasDerivAt_id x).add_const c).log (ne_of_gt hx)).const_mul u simpa only [logarithmicDerivativeChain, id_eq, one_div, div_eq_mul_inv, pow_zero, pow_one, Nat.factorial_zero, Nat.cast_one, mul_one, one_mul, Nat.zero_add] using h | succ k => change HasDerivAt (fun y => u * (-1:ℝ)^k * (k.factorial:ℝ) / (y+c)^(k+1)) (u * (-1:ℝ)^(k+1) * ((k+1).factorial:ℝ) / (x+c)^(k+1+1)) x have h := (hasDerivAt_const x (u * (-1:ℝ)^k * (k.factorial:ℝ))).div (((hasDerivAt_id x).add_const c).pow (k+1)) (pow_ne_zero _ (ne_of_gt hx)) simp only [Pi.pow_apply, id_eq] at h convert h using 1 <;> try rfl all_goals try simp only [Nat.factorial_succ, Nat.cast_mul, Nat.cast_add, Nat.cast_one, Nat.add_sub_cancel, mul_one, zero_mul, zero_sub, pow_succ] all_goals field_simp section variable (hs : List ℝ) (u c : ℝ) (k : ℕ) (x : ℝ) (hhs : ∀ h ∈ hs, 0 ≤ h) (hx : 0 < x+c) include hs u c k x hhs hx theorem mixed_logarithmic_difference_mean_value : ∃ y ∈ Set.Icc x (x+hs.sum), mixedForwardDifference hs (logarithmicDerivativeChain u c k) x = hs.prod * logarithmicDerivativeChain u c (k+hs.length) y := by apply mixed_forward_difference_mean_value hs (logarithmicDerivativeChain u c) (-c) hhs · intro k y hy exact logarithmic_derivative_chain_hasDerivAt u c k y (by linarith) · linarith theorem mixed_logarithmic_difference_hasDerivAt : HasDerivAt (mixedForwardDifference hs (logarithmicDerivativeChain u c k)) (mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x) x := by apply mixed_forward_difference_hasDerivAt hs _ _ (-c) hhs · intro y hy exact logarithmic_derivative_chain_hasDerivAt u c k y (by linarith) · linarith end end Bounty end section namespace Bounty theorem mixed_forward_difference_append (hs ts : List ℝ) (f : ℝ → ℝ) (x : ℝ) : mixedForwardDifference (hs++ts) f x = mixedForwardDifference hs (mixedForwardDifference ts f) x := by induction hs generalizing x with | nil => rfl | cons h hs ih => simp only [List.cons_append, mixedForwardDifference, ih] end Bounty end section /- Quantitative decay survives every finite iteration of the vdC recurrence. -/ namespace Bounty section variable (H B C η : ℝ) (m : ℕ) (hη : 0 ≤ η) (hη1 : η ≤ 1) (hC : 1 ≤ C) (hH : 2/H ≤ C*η) (hB : B ≤ C*η) include H B C η m hη hη1 hC hH hB theorem van_der_corput_scalar_le_roots : vanDerCorputScalarBound H B m ≤ 5^m*C*repeatedSquareRoot m η := by induction m with | zero => simpa only [vanDerCorputScalarBound,repeatedSquareRoot,pow_zero,one_mul] using hB | succ m ih => have hr := repeated_square_root_nonneg m hη have hηr := le_repeated_square_root m hη1 have hp : (1 : ℝ) ≤ 5^m := one_le_pow₀ (by norm_num) have hc : 1 ≤ 5^m*C := by nlinarith have hCm : C ≤ 5^m*C := by nlinarith have hCη : C*η ≤ C*repeatedSquareRoot m η := mul_le_mul_of_nonneg_left hηr (by linarith) have hCr := mul_le_mul_of_nonneg_right hCm hr have hsum : 2/H+4*vanDerCorputScalarBound H B m ≤ (5*(5^m*C))*repeatedSquareRoot m η := by nlinarith have hcoef : 5*(5^m*C) ≤ (5*(5^m*C))^2 := by nlinarith have hmul := mul_le_mul_of_nonneg_right hcoef hr have hsqrt := Real.sq_sqrt hr change Real.sqrt (2/H+4*vanDerCorputScalarBound H B m) ≤ _ apply Real.sqrt_le_iff.mpr constructor · change 0 ≤ 5^(m+1)*C*Real.sqrt (repeatedSquareRoot m η) positivity · change 2/H+4*vanDerCorputScalarBound H B m ≤ (5^(m+1)*C*Real.sqrt (repeatedSquareRoot m η))^2 calc _ ≤ (5*(5^m*C))^2*repeatedSquareRoot m η := hsum.trans hmul _ = _ := by have hpow : 5^(m+1)*C = 5*(5^m*C) := by rw [pow_succ]; ring rw [hpow] symm rw [mul_pow,hsqrt] theorem van_der_corput_scalar_le_rpow : vanDerCorputScalarBound H B m ≤ 5^m*C*η^((2:ℝ)^m)⁻¹ := by simpa only [repeated_square_root_eq_rpow m hη] using van_der_corput_scalar_le_roots H B C η m hη hη1 hC hH hB end end Bounty end section /- A scale lower bound bounds the number of derivative orders needed. -/ namespace Bounty theorem long_frequency_upper_power (K : ℕ) (x N τ ε : ℝ) (hx : 1 ≤ x) (hτ : 0 < τ) (hε : ε ≤ 1) (hscale : x^(τ/2) ≤ N) (hK : 4/τ+1 ≤ (K : ℝ)) : x^2 ≤ N^((K : ℝ)-ε) := by have hxp : 0 < x := lt_of_lt_of_le (by norm_num) hx have hquot : 0 < 4/τ := div_pos (by norm_num) hτ have hexp : 0 ≤ (K : ℝ)-ε := by linarith have hmul : 4 ≤ ((K : ℝ)-1)*τ := (div_le_iff₀ hτ).mp (by linarith) have he : 2 ≤ (τ/2)*((K : ℝ)-ε) := by nlinarith calc x^2 = x^(2 : ℝ) := by norm_num _ ≤ x^((τ/2)*((K : ℝ)-ε)) := Real.rpow_le_rpow_of_exponent_le hx he _ = (x^(τ/2))^((K : ℝ)-ε) := Real.rpow_mul hxp.le _ _ _ ≤ N^((K : ℝ)-ε) := Real.rpow_le_rpow (Real.rpow_nonneg hxp.le _) hscale hexp end Bounty end section /- A fixed indicator convention for transporting the shared bad-event weight. -/ open Finset open scoped Classical namespace Bounty noncomputable def cleanAuxiliaryBadWeight {A P : Type*} [Fintype A] [DecidableEq A] (μ : P → ℝ) (T : Finset P) (s : A → P) : ℝ := cleanAuxiliaryWeight μ s * (if (∃ a, s a ∈ T) ∨ ¬Function.Injective s then 1 else 0) theorem clean_auxiliary_bad_weight_le {A P : Type*} [Fintype A] [DecidableEq A] [Fintype P] (μ : P → ℝ) (hμ0 : ∀ p, 0 ≤ μ p) (hμ : ∑ p, μ p = 1) (T : Finset P) (a₀ : ℝ) (ha₀ : 0 ≤ a₀) (hatom : ∀ p, μ p ≤ a₀) : (∑ s : A → P, cleanAuxiliaryBadWeight μ T s) ≤ (Fintype.card A : ℝ) * (T.card + Fintype.card A) * a₀ := by exact clean_auxiliary_forbidden_or_repeated_mass_le μ hμ0 hμ T a₀ ha₀ hatom end Bounty end section /- Shared draws avoid endpoint prime divisors, free labels, and one another with an explicit reciprocal-prime probability bound. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSharedForbidden {G : Type*} {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (g : G) (w z : ℕ) : Finset (P g) := univ.filter (fun p => p.val ∈ w.primeFactors ∪ z.primeFactors ∨ ∃ j, aux g j = p) theorem physical_shared_forbidden_card {G : Type*} {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (g : G) (w z : ℕ) : (physicalSharedForbidden C aux g w z).card ≤ w.primeFactors.card + z.primeFactors.card + (C g).card := by have he : (physicalSharedForbidden C aux g w z).image Subtype.val ⊆ (w.primeFactors ∪ z.primeFactors) ∪ univ.image (fun j : C g => (aux g j).val) := by intro p hp obtain ⟨a, ha, rfl⟩ := mem_image.mp hp rcases (mem_filter.mp ha).2 with h | ⟨j, hj⟩ · exact mem_union_left _ h · exact mem_union_right _ (mem_image.mpr ⟨j, mem_univ _, congrArg Subtype.val hj⟩) calc _ = ((physicalSharedForbidden C aux g w z).image Subtype.val).card := (card_image_of_injective _ Subtype.val_injective).symm _ ≤ ((w.primeFactors ∪ z.primeFactors) ∪ univ.image (fun j : C g => (aux g j).val)).card := card_le_card he _ ≤ (w.primeFactors ∪ z.primeFactors).card + (univ.image (fun j : C g => (aux g j).val)).card := card_union_le _ _ _ ≤ _ := add_le_add (card_union_le _ _) ((card_image_le).trans_eq (by simp)) theorem physical_shared_forbidden_log_card {G : Type*} {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (g : G) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) : ((physicalSharedForbidden C aux g w z).card : ℝ) ≤ Real.log w / Real.log 2 + Real.log z / Real.log 2 + (C g).card := by calc _ ≤ (w.primeFactors.card : ℝ) + z.primeFactors.card + (C g).card := by exact_mod_cast physical_shared_forbidden_card C aux g w z _ ≤ _ := add_le_add (add_le_add (primeFactors_card_le_log_div_log_two hw) (primeFactors_card_le_log_div_log_two hz)) le_rfl theorem physical_mem_shared_forbidden_iff {G : Type*} {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (g : G) (hprime : ∀ p ∈ P g, p.Prime) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) (p : P g) : p ∈ physicalSharedForbidden C aux g w z ↔ p.val ∣ w ∨ p.val ∣ z ∨ ∃ j, aux g j = p := by simp only [physicalSharedForbidden, mem_filter, mem_univ, true_and, mem_union] constructor · rintro ((h | h) | h) · exact Or.inl (Nat.dvd_of_mem_primeFactors h) · exact Or.inr (Or.inl (Nat.dvd_of_mem_primeFactors h)) · exact Or.inr (Or.inr h) · rintro (h | h | h) · exact Or.inl (Or.inl ((hprime _ p.property).mem_primeFactors h (by omega))) · exact Or.inl (Or.inr ((hprime _ p.property).mem_primeFactors h (by omega))) · exact Or.inr h end Bounty end section /- Actual finite shift products and frequency ranges imply the terminal curvature powers. -/ namespace Bounty theorem terminal_shift_product_bounds (hs : List ℝ) {N eps : ℝ} {k : ℕ} (hN : 1 ≤ N) (heps : 0 ≤ eps) (hk : 2 ≤ k) (hlen : hs.length = k-2) (hhs : ∀ h ∈ hs, 1 ≤ h ∧ h ≤ (⌊N^(eps/(2*(k : ℝ)))⌋₊ : ℝ)) : 1 ≤ hs.prod ∧ hs.prod ≤ N^(eps/2) := by have hN0 : 0 < N := by linarith have hk0 : (k : ℝ) ≠ 0 := by exact_mod_cast (show k ≠ 0 by omega) have he : 0 ≤ eps/(2*(k : ℝ)) := by positivity have hbase : 1 ≤ N^(eps/(2*(k : ℝ))) := Real.one_le_rpow hN he have hfloor : (⌊N^(eps/(2*(k : ℝ)))⌋₊ : ℝ) ≤ N^(eps/(2*(k : ℝ))) := Nat.floor_le (by positivity) refine ⟨List.one_le_prod (fun h hh => (hhs h hh).1),?_⟩ have hp : hs.prod ≤ (N^(eps/(2*(k : ℝ))))^hs.length := by have h := List.prod_map_le_prod_map₀ (s := hs) (fun x : ℝ => x) (fun _ : ℝ => N^(eps/(2*(k : ℝ)))) (fun h hh => (show 0 ≤ h by linarith [(hhs h hh).1])) (fun h hh => ((hhs h hh).2).trans hfloor) simpa only [List.map_id',List.map_const',List.prod_replicate] using h calc hs.prod ≤ (N^(eps/(2*(k : ℝ))))^hs.length := hp _ ≤ (N^(eps/(2*(k : ℝ))))^k := pow_le_pow_right₀ hbase (by omega) _ = N^(eps/2) := by rw [← Real.rpow_mul_natCast hN0.le] congr 1 field_simp theorem scaled_curvature_power_bounds {N eps K P T : ℝ} {k : ℕ} (hN : 1 ≤ N) (hK : 0 ≤ K) (hPlo : 1 ≤ P) (hPhi : P ≤ N^(eps/2)) (hTlo : N^((k : ℝ)-2+eps) ≤ T) (hThi : T ≤ N^((k : ℝ)-eps)) : K*N^(-2+eps) ≤ K*P*T/N^k ∧ K*P*T/N^k ≤ K*N^(-eps/2) := by have hN0 : 0 < N := by linarith have hT0 : 0 ≤ T := (Real.rpow_pos_of_pos hN0 _).le.trans hTlo have hp : N^((k : ℝ)-2+eps) ≤ P*T := by have h := mul_le_mul_of_nonneg_right hPlo hT0 simp only [one_mul] at h exact hTlo.trans h have hq : P*T ≤ N^((k : ℝ)-eps/2) := by have h := mul_le_mul hPhi hThi hT0 (Real.rpow_nonneg hN0.le _) rw [← Real.rpow_add hN0] at h have he : eps/2+((k : ℝ)-eps) = (k : ℝ)-eps/2 := by ring rwa [he] at h have hquot (x : ℝ) : N^x/N^k = N^(x-(k : ℝ)) := by rw [Real.rpow_sub hN0,Real.rpow_natCast] constructor · calc K*N^(-2+eps) = K*N^((k : ℝ)-2+eps)/N^k := by rw [mul_div_assoc,hquot] congr 1 congr 1 ring _ ≤ K*(P*T)/N^k := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hp hK) (by positivity) _ = _ := by ring · calc K*P*T/N^k ≤ K*N^((k : ℝ)-eps/2)/N^k := div_le_div_of_nonneg_right (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hq hK) (by positivity) _ = K*N^(-eps/2) := by rw [mul_div_assoc,hquot] congr 1 congr 1 ring end Bounty end section /- Literal progression sums transfer cancellation through a rough-integer divisor majorant. -/ open Finset namespace Bounty theorem rough_interval_oscillation_of_divisor_sums (a b : ℕ) (lam : ℕ → ℝ) (F : ℕ → ℂ) {z Y Q M E : ℝ} (hY : 0 ≤ Y) (hQ : 0 ≤ Q) (hpoint : ∀ n : ℕ, n ≠ 0 → (if ∀ p ∈ n.primeFactors, z < (p : ℝ) then (1 : ℝ) else 0) ≤ ∑ d ∈ n.divisors, lam d) (hF : ∀ n ∈ Ioc a b, ‖F n‖ ≤ 1) (hover : (∑ n ∈ Ioc a b, ∑ d ∈ n.divisors, lam d)- (((Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ))).card : ℝ) ≤ E) (hmass : (∑ d ∈ Icc 1 b, |lam d|/(d : ℝ)) ≤ M) (hdiv : ∀ d ∈ Icc 1 b, lam d ≠ 0 → ‖∑ n ∈ (Ioc a b).filter (fun n => d ∣ n), F n‖ ≤ Y*Q/(d : ℝ)) : ‖∑ n ∈ (Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ)), F n‖ ≤ E+Y*Q*M := by have hd := rough_divisor_majorant_complex_error lam a b F (by norm_num : (0 : ℝ) ≤ 1) hpoint hF hover rw [one_mul] at hd have hm := interval_divisor_sum_norm_bound a b (fun d => (lam d : ℂ)) F (fun d => Y*Q/(d : ℝ)) (by intro d hd hne apply hdiv d hd intro hz exact hne (by simp [hz])) have hcoeff : (∑ d ∈ Icc 1 b, ‖(lam d : ℂ)‖*(Y*Q/(d : ℝ))) ≤ Y*Q*M := by calc _ = Y*Q*(∑ d ∈ Icc 1 b, |lam d|/(d : ℝ)) := by rw [mul_sum] apply sum_congr rfl intro d hd rw [Complex.norm_real,Real.norm_eq_abs] ring _ ≤ _ := mul_le_mul_of_nonneg_left hmass (mul_nonneg hY hQ) have hm' : ‖∑ n ∈ Ioc a b, ((∑ d ∈ n.divisors, lam d : ℝ) : ℂ)*F n‖ ≤ Y*Q*M := by push_cast exact hm.trans hcoeff have ht := norm_sub_norm_le (∑ n ∈ (Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ)), F n) (∑ n ∈ Ioc a b, ((∑ d ∈ n.divisors, lam d : ℝ) : ℂ)*F n) linarith end Bounty end section /- Quotients by a pool-free divisor commute with removal of the pool part. -/ namespace Bounty theorem primePoolFreePart_div_of_free (P : Finset ℕ) {d n : ℕ} (hn : n ≠ 0) (hd : d ∣ n) (hfree : Disjoint d.primeFactors P) : primePoolFreePart P (n / d) = primePoolFreePart P n / d := by have he : d * (n / d) = n := Nat.mul_div_cancel' hd have hd0 : d ≠ 0 := by intro h; apply hn; rw [← he, h, zero_mul] have hq0 : n / d ≠ 0 := by intro h; apply hn; rw [← he, h, mul_zero] have hf := congrArg (primePoolFreePart P) he rw [primePoolFreePart_mul P hd0 hq0, primePoolFreePart_eq_self_of_disjoint P hd0 hfree] at hf rw [← hf] exact (Nat.mul_div_cancel_left _ (Nat.pos_of_ne_zero hd0)).symm theorem invariant_pool_free_divisor_weight (P : Finset ℕ) (W : ℕ → ℂ) (hW : ∀ a b : ℕ, b ≠ 0 → Disjoint b.primeFactors P → W (a * b) = W a) {d n : ℕ} (hn : n ≠ 0) (hd : d ∣ n) (hfree : Disjoint d.primeFactors P) : W n = W (n / d) := by have hd0 : d ≠ 0 := by intro h rw [h] at hd simp only [zero_dvd_iff] at hd exact hn hd simpa only [Nat.div_mul_cancel hd] using hW (n / d) d hd0 hfree end Bounty end section /- Assemble explicit analytic inputs with the ordered scalar saving budget. -/ open MeasureTheory Set namespace Bounty theorem three_regime_integral_decay (R : ℝ) (S Q M T : ℝ → ℂ) (hS : Continuous S) (hQ : Continuous Q) (hM : Continuous M) (hT : Continuous T) {L A Cmean Csparse s q t As H B B0 : ℝ} (hL : 4 ≤ L) (hAs : A + Cmean + 1 ≤ 2 * As) (hH : A + 2 * s + Csparse + 1 ≤ 2 * H) (hB : A + B0 + 2 * s + 2 * q + 2 * t + 1 ≤ 2 * B) (hSbound : ∀ u ∈ Icc (-R) R, ‖S u‖ ≤ L ^ s) (hQbound : ∀ u ∈ Icc (-R) R, ‖Q u‖ ≤ L ^ q) (hTbound : ∀ u ∈ Icc (-R) R, ‖T u‖ ≤ L ^ t) (hhigh : ∀ u ∈ Icc (-R) R, L ^ (-As) < ‖S u‖ → L ^ B0 < |u| → ‖Q u‖ ≤ L ^ (-H)) (hlow : ∀ u ∈ Icc (-R) R, |u| ≤ L ^ B0 → ‖M u‖ ≤ L ^ (-B)) (hmean : (∫ u in Icc (-R) R, ‖Q u * M u * T u‖ ^ 2) ≤ L ^ Cmean) (hsparse : (∫ u in {u ∈ Icc (-R) R | L ^ (-As) < ‖S u‖}, ‖M u * T u‖ ^ 2) ≤ L ^ Csparse) : (∫ u in Icc (-R) R, ‖S u * Q u * M u * T u‖ ^ 2) ≤ L ^ (-A) := by have hL0 : 0 < L := by linarith have hn (z : ℝ) : 0 ≤ L ^ z := Real.rpow_nonneg hL0.le z calc _ ≤ (L ^ (-As)) ^ (2 : ℕ) * (∫ u in Icc (-R) R, ‖Q u * M u * T u‖ ^ 2) + (L ^ s) ^ (2 : ℕ) * (L ^ (-H)) ^ (2 : ℕ) * (∫ u in {u ∈ Icc (-R) R | L ^ (-As) < ‖S u‖}, ‖M u * T u‖ ^ 2) + 2 * L ^ B0 * (L ^ s) ^ (2 : ℕ) * (L ^ q) ^ (2 : ℕ) * (L ^ (-B)) ^ (2 : ℕ) * (L ^ t) ^ (2 : ℕ) := three_regime_integral_bound R (L ^ B0) (L ^ (-As)) (L ^ s) (L ^ q) (L ^ (-H)) (L ^ (-B)) (L ^ t) S Q M T hS hQ hM hT (hn _) (hn _) (hn _) (hn _) (hn _) (hn _) (hn _) hSbound hQbound hTbound hhigh hlow _ ≤ (L ^ (-As)) ^ (2 : ℕ) * L ^ Cmean + (L ^ s) ^ (2 : ℕ) * (L ^ (-H)) ^ (2 : ℕ) * L ^ Csparse + 2 * L ^ B0 * (L ^ s) ^ (2 : ℕ) * (L ^ q) ^ (2 : ℕ) * (L ^ (-B)) ^ (2 : ℕ) * (L ^ t) ^ (2 : ℕ) := by gcongr _ ≤ _ := three_regime_power_budget hL hAs hH hB end Bounty end section /- A finite cover by unit intervals controls the integral over a measurable exceptional set by the actual continuous squared-norm suprema. Overlap is allowed; no disjointness or choice of sample points is required. -/ open Finset Set MeasureTheory open scoped Classical namespace Bounty theorem unit_interval_energy_le_sup (F : ℝ → ℂ) (hF : Continuous F) (j : ℤ) {t : ℝ} (ht : t ∈ Icc (j : ℝ) ((j : ℝ) + 1)) : ‖F t‖ ^ 2 ≤ unitIntervalEnergySup F j := by apply le_csSup ((isCompact_Icc.image (hF.norm.pow 2)).bddAbove) exact mem_image_of_mem _ ht theorem unit_interval_cover_energy (indices : Finset ℤ) (E : Set ℝ) (hE : MeasurableSet E) (F : ℝ → ℂ) (hF : Continuous F) (hcover : ∀ t ∈ E, ∃ j ∈ indices, t ∈ Icc (j : ℝ) ((j : ℝ) + 1)) : IntegrableOn (fun t => ‖F t‖ ^ 2) E ∧ (∫ t in E, ‖F t‖ ^ 2) ≤ ∑ j ∈ indices, unitIntervalEnergySup F j := by let g (j : ℤ) : ℝ → ℝ := (Icc (j : ℝ) ((j : ℝ) + 1)).indicator (fun _ => unitIntervalEnergySup F j) have hg0 (j : ℤ) (t : ℝ) : 0 ≤ g j t := by exact indicator_nonneg (fun _ _ => unit_interval_energy_sup_nonneg F hF j) t have hgi (j : ℤ) : Integrable (g j) := by apply (integrable_indicator_iff measurableSet_Icc).mpr exact integrableOn_const isCompact_Icc.measure_ne_top have hsum : Integrable (fun t => ∑ j ∈ indices, g j t) := by exact integrable_finsetSum indices (fun j _ => hgi j) have hdom (t : ℝ) : E.indicator (fun t => ‖F t‖ ^ 2) t ≤ ∑ j ∈ indices, g j t := by by_cases ht : t ∈ E · rw [indicator_of_mem ht] obtain ⟨j, hj, htj⟩ := hcover t ht calc ‖F t‖ ^ 2 ≤ unitIntervalEnergySup F j := unit_interval_energy_le_sup F hF j htj _ = g j t := by simp only [g, indicator_of_mem htj] _ ≤ ∑ j ∈ indices, g j t := Finset.single_le_sum (fun k _ => hg0 k t) hj · rw [indicator_of_notMem ht] exact Finset.sum_nonneg (fun j _ => hg0 j t) have hfi : Integrable (E.indicator (fun t => ‖F t‖ ^ 2)) := by apply hsum.mono' ((hF.norm.pow 2).aestronglyMeasurable.indicator hE) apply Filter.Eventually.of_forall intro t change |E.indicator (fun t => ‖F t‖ ^ 2) t| ≤ _ rw [abs_of_nonneg (indicator_nonneg (fun t _ => sq_nonneg ‖F t‖) t)] exact hdom t refine ⟨(integrable_indicator_iff hE).mp hfi, ?_⟩ calc (∫ t in E, ‖F t‖ ^ 2) = ∫ t, E.indicator (fun t => ‖F t‖ ^ 2) t := (integral_indicator hE).symm _ ≤ ∫ t, ∑ j ∈ indices, g j t := integral_mono hfi hsum hdom _ = ∑ j ∈ indices, ∫ t, g j t := integral_finsetSum indices (fun j _ => hgi j) _ = ∑ j ∈ indices, unitIntervalEnergySup F j := by apply Finset.sum_congr rfl intro j _ simp only [g, integral_indicator_const _ measurableSet_Icc, Real.volume_real_Icc, add_sub_cancel_left, smul_eq_mul] norm_num theorem exceptional_integral_le_unit_suprema (indices : Finset ℤ) (E : Set ℝ) (hE : MeasurableSet E) (F : ℝ → ℂ) (hF : Continuous F) (hcover : ∀ t ∈ E, ∃ j ∈ indices, t ∈ Icc (j : ℝ) ((j : ℝ) + 1)) : (∫ t in E, ‖F t‖ ^ 2) ≤ ∑ j ∈ indices, unitIntervalEnergySup F j := (unit_interval_cover_energy indices E hE F hF hcover).2 end Bounty end section /- Energy assembly for a finite dyadic decomposition, allowing overlaps. -/ open Finset Set MeasureTheory namespace Bounty theorem finite_sum_integral_norm_sq_le_card {ι : Type*} (s : Finset ι) (F : ι → ℝ → ℂ) (hF : ∀ j, Continuous (F j)) {E : Set ℝ} {R : ℝ} (hE : MeasurableSet E) (hER : E ⊆ Icc (-R) R) : (∫ t in E, ‖∑ j ∈ s, F j t‖ ^ 2) ≤ (s.card : ℝ) * ∑ j ∈ s, ∫ t in E, ‖F j t‖ ^ 2 := by have hi (j : ι) : IntegrableOn (fun t => ‖F j t‖ ^ 2) E := (((hF j).norm.pow 2).continuousOn.integrableOn_Icc).mono_set hER have hscont : Continuous (fun t => ‖∑ j ∈ s, F j t‖ ^ 2) := by fun_prop have hsi : IntegrableOn (fun t => ‖∑ j ∈ s, F j t‖ ^ 2) E := hscont.continuousOn.integrableOn_Icc.mono_set hER have hr : IntegrableOn (fun t => (s.card : ℝ) * ∑ j ∈ s, ‖F j t‖ ^ 2) E := (integrable_finsetSum s (fun j _ => hi j)).const_mul _ calc _ ≤ ∫ t in E, (s.card : ℝ) * ∑ j ∈ s, ‖F j t‖ ^ 2 := setIntegral_mono_on hsi hr hE (fun t _ => finite_complex_sum_norm_sq_le_card s (fun j => F j t)) _ = _ := by rw [integral_const_mul, integral_finsetSum s (fun j _ => hi j)] theorem finite_sum_integral_energy_power {ι : Type*} (s : Finset ι) (F : ι → ℝ → ℂ) (hF : ∀ j, Continuous (F j)) {E : Set ℝ} {R L C k : ℝ} (hE : MeasurableSet E) (hER : E ⊆ Icc (-R) R) (hL : 0 < L) (hcard : (s.card : ℝ) ≤ L ^ k) (henergy : ∀ j ∈ s, (∫ t in E, ‖F j t‖ ^ 2) ≤ L ^ C) : (∫ t in E, ‖∑ j ∈ s, F j t‖ ^ 2) ≤ L ^ (C + 2 * k) := by calc _ ≤ (s.card : ℝ) * ∑ j ∈ s, ∫ t in E, ‖F j t‖ ^ 2 := finite_sum_integral_norm_sq_le_card s F hF hE hER _ ≤ (s.card : ℝ) * ∑ _j ∈ s, L ^ C := mul_le_mul_of_nonneg_left (Finset.sum_le_sum henergy) (Nat.cast_nonneg _) _ = (s.card : ℝ) * ((s.card : ℝ) * L ^ C) := by simp _ ≤ L ^ k * (L ^ k * L ^ C) := by gcongr _ = L ^ (C + 2 * k) := by rw [← Real.rpow_add hL, ← Real.rpow_add hL]; congr 1; ring end Bounty end section /- Natural residue intervals embed exactly into integer progression intervals. -/ open Finset namespace Bounty theorem natural_residue_interval_cast (a b : ℕ) {q : ℕ} [NeZero q] (r : ZMod q) (F : ℤ → ℂ) : ∑ n ∈ (Ioc a b).filter (fun n : ℕ => (n : ZMod q) = r), F (n : ℤ) = ∑ z ∈ (Ioc (a : ℤ) (b : ℤ)).filter (fun z : ℤ => (z : ZMod q) = r), F z := by classical apply sum_bij (fun (n : ℕ) _ => (n : ℤ)) · intro n hn obtain ⟨hn,hr⟩ := mem_filter.mp hn obtain ⟨hl,hu⟩ := mem_Ioc.mp hn exact mem_filter.mpr ⟨mem_Ioc.mpr ⟨by exact_mod_cast hl,by exact_mod_cast hu⟩, by simpa only [Int.cast_natCast] using hr⟩ · intro n hn m hm he exact_mod_cast he · intro z hz obtain ⟨hz,hr⟩ := mem_filter.mp hz obtain ⟨hl,hu⟩ := mem_Ioc.mp hz have hz0 : 0 ≤ z := by omega have he : (z.toNat : ℤ) = z := Int.toNat_of_nonneg hz0 refine ⟨z.toNat,mem_filter.mpr ⟨mem_Ioc.mpr ⟨by omega,by omega⟩,?_⟩,he⟩ have hc := congrArg (fun t : ℤ => (t : ZMod q)) he simpa only [Int.cast_natCast] using hc.trans hr · intro n hn rfl theorem natural_residue_interval_sum (a b : ℕ) {q : ℕ} [NeZero q] (r : ZMod q) (F : ℤ → ℂ) : ∑ n ∈ (Ioc a b).filter (fun n : ℕ => (n : ZMod q) = r), F (n : ℤ) = ∑ y ∈ Icc (((a : ℤ)-(r.val : ℤ))/(q : ℤ)+1) (((b : ℤ)-(r.val : ℤ))/(q : ℤ)), F (y*(q : ℤ)+r.val) := by rw [natural_residue_interval_cast,integer_residue_interval_sum] end Bounty end section /- The explicit sieve level leaves exponentially long progressions for polynomial moduli. -/ open Filter namespace Bounty theorem eventually_long_rough_sieve_scales {a : ℝ} (ha : 0 < a) (T N0 : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y q : ℝ, Real.exp (a*L) ≤ Y → 0 < q → q ≤ L^T → let Z := (Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ)+2) N0 ≤ Y/(Z*q) ∧ (Real.exp L)^(a/2) ≤ Y/(Z*q) ∧ Z/Y ≤ Real.exp (-(a/2)*L) ∧ Real.log (2*Real.exp (Real.sqrt L)) ≤ 2*L := by have hmod := eventually_exp_neg_rpow_mul_rpow_le (by norm_num : (0 : ℝ) < 1) (show 0 < a/4 by positivity) T 0 have hthreshold := (Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop (half_pos ha))).eventually_ge_atTop N0 filter_upwards [eventually_rough_cell_sieve_level_le (show 0 < a/2 by positivity), hmod,hthreshold,eventually_ge_atTop (1 : ℝ)] with L hlevel hmodL hthresholdL hL intro Y q hY hq hqT dsimp only have hL0 : 0 < L := zero_lt_one.trans_le hL have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY let Z := (Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ)+2) have hZ0 : 0 < Z := by dsimp [Z]; positivity have hZ : Z ≤ Real.exp ((a/4)*L) := by have he : a/2/2 = a/4 := by ring simpa only [he] using hlevel have hmod' : L^T ≤ Real.exp ((a/4)*L) := by simp only [Real.rpow_one,neg_zero,Real.rpow_zero] at hmodL have hm := mul_le_mul_of_nonneg_left hmodL (Real.exp_pos ((a/4)*L)).le have he : Real.exp ((a/4)*L)*Real.exp (-(a/4)*L) = 1 := by rw [← Real.exp_add] have he' : (a/4)*L + -(a/4)*L = 0 := by ring rw [he',Real.exp_zero] simpa only [← mul_assoc,he,one_mul,mul_one] using hm have hprod : Z*q ≤ Real.exp ((a/2)*L) := by calc _ ≤ Real.exp ((a/4)*L)*Real.exp ((a/4)*L) := mul_le_mul hZ (hqT.trans hmod') hq.le (Real.exp_pos _).le _ = _ := by rw [← Real.exp_add]; congr 1; ring have hN : Real.exp ((a/2)*L) ≤ Y/(Z*q) := by apply (le_div_iff₀ (mul_pos hZ0 hq)).mpr calc _ ≤ Real.exp ((a/2)*L)*Real.exp ((a/2)*L) := mul_le_mul_of_nonneg_left hprod (Real.exp_pos _).le _ = Real.exp (a*L) := by rw [← Real.exp_add]; congr 1; ring _ ≤ Y := hY refine ⟨hthresholdL.trans hN,?_,?_,?_⟩ · change (Real.exp L)^(a/2) ≤ Y/(Z*q) simpa only [← Real.exp_mul,mul_comm L] using hN · apply (div_le_iff₀ hY0).mpr calc Z ≤ Real.exp ((a/4)*L) := hZ _ ≤ Real.exp ((a/2)*L) := Real.exp_le_exp.mpr (by nlinarith) _ = Real.exp (-(a/2)*L)*Real.exp (a*L) := by rw [← Real.exp_add]; congr 1; ring _ ≤ _ := mul_le_mul_of_nonneg_left hY (Real.exp_pos _).le · rw [Real.log_mul (by norm_num) (Real.exp_ne_zero _),Real.log_exp] have hs : Real.sqrt L ≤ L := by apply (Real.sqrt_le_iff).mpr exact ⟨hL0.le,by nlinarith⟩ have ht := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 2) linarith end Bounty end section /- The residual gcd selects the quotient modulus without losing any characters. -/ open scoped BigOperators Classical namespace Bounty end Bounty end section /- The literal nested divisor expression has the expected finite three-factor transform. -/ open Finset namespace Bounty theorem finite_natural_product_pos (A B : Finset ℕ) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) : ∀ n ∈ (A ×ˢ B).image (fun ab => ab.1*ab.2), 0 < n := by intro n hn obtain ⟨ab,hab,rfl⟩ := mem_image.mp hn exact Nat.mul_pos (hA _ (mem_product.mp hab).1) (hB _ (mem_product.mp hab).2) theorem endpoint_triple_finite_support (A B C : Finset ℕ) (α β γ : ℕ → ℂ) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (hγ : ∀ c, c ∉ C → γ c = 0) (n : ℕ) (hn : n ∉ (A ×ˢ ((B ×ˢ C).image (fun bc => bc.1*bc.2))).image (fun ar => ar.1*ar.2)) : endpointTripleConvolution α β γ n = 0 := by have hh := finite_divisor_convolution_support A ((B ×ˢ C).image (fun bc => bc.1*bc.2)) α (fun r => ∑ b ∈ r.divisors, β b*γ (r/b)) hA (finite_natural_product_pos B C hB hC) hα (finite_divisor_convolution_support B C β γ hB hC hβ hγ) n hn simpa only [endpointTripleConvolution,mul_sum,mul_assoc] using hh theorem endpoint_triple_finite_transform (S A B C : Finset ℕ) (α β γ F : ℕ → ℂ) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (hγ : ∀ c, c ∉ C → γ c = 0) (hS : ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, a*b*c ∈ S) : (∑ n ∈ S, endpointTripleConvolution α β γ n*F n) = ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, α a*β b*γ c*F (a*b*c) := by classical let U := (B ×ˢ C).image (fun bc => bc.1*bc.2) let f : ℕ → ℂ := fun r => ∑ b ∈ r.divisors, β b*γ (r/b) have hU : ∀ r ∈ U, 0 < r := finite_natural_product_pos B C hB hC have hf : ∀ r, r ∉ U → f r = 0 := finite_divisor_convolution_support B C β γ hB hC hβ hγ have hout := finite_divisor_convolution_transform S A U α f F hA hU hα hf (by intro a ha r hr obtain ⟨bc,hbc,rfl⟩ := mem_image.mp hr simpa only [Nat.mul_assoc] using hS a ha bc.1 (mem_product.mp hbc).1 bc.2 (mem_product.mp hbc).2) calc _ = ∑ a ∈ A, ∑ r ∈ U, α a*f r*F (a*r) := by simpa only [endpointTripleConvolution,f,mul_sum,mul_assoc] using hout _ = _ := by apply sum_congr rfl intro a ha have hi := finite_divisor_convolution_transform U B C β γ (fun r => F (a*r)) hB hC hβ hγ (fun b hb c hc => mem_image.mpr ⟨(b,c),mem_product.mpr ⟨hb,hc⟩,rfl⟩) calc _ = α a*(∑ r ∈ U, f r*F (a*r)) := by rw [mul_sum] apply sum_congr rfl intro r hr ring _ = α a*(∑ b ∈ B, ∑ c ∈ C, β b*γ c*F (a*(b*c))) := congrArg (fun z => α a*z) hi _ = _ := by simp only [mul_sum,mul_assoc] end Bounty end section /- Actual coefficient functions, with support restrictions retained, give exact dyadic polynomials. -/ open Finset namespace Bounty theorem finite_polynomial_dyadic_representation (S : Finset ℕ) (w : ℕ → ℂ) (U : ℝ) (hU : 0 ≤ U) (K : ℕ) (hsupport : ∀ n ∈ S, w n ≠ 0 → U < (n : ℝ) ∧ (n : ℝ) ≤ (2 : ℝ)^K*U) (t : ℝ) : (∑ n ∈ S, w n*Complex.exp (((Real.log (n : ℝ)*t : ℝ) : ℂ)*Complex.I)) = ∑ j : Fin K, ∑ n ∈ Icc (⌊(2 : ℝ)^j.val*U⌋₊+1) ⌊(2 : ℝ)^(j.val+1)*U⌋₊, (if n ∈ S then w n else 0)*Complex.exp (((Real.log (n : ℝ)*t : ℝ) : ℂ)*Complex.I) := by classical rw [sum_finite_dyadic_closed_intervals U hU K] apply sum_bij_ne_zero (fun n _ _ => n) · intro n hn hne have hw : w n ≠ 0 := by intro hz; exact hne (by rw [hz,zero_mul]) have hh := hsupport n hn hw exact mem_Ioc.mpr ⟨(Nat.floor_lt hU).mpr hh.1,Nat.le_floor hh.2⟩ · intro n hn hne m hm hme he exact he · intro n hn hne have hs : n ∈ S := by by_contra hh exact hne (by rw [if_neg hh,zero_mul]) refine ⟨n,hs,?_,rfl⟩ simpa only [if_pos hs] using hne · intro n hn hne rw [if_pos hn] theorem harmonic_mellin_coefficient_phase (c : ℂ) (t : ℝ) (n : ℕ) : c*harmonicMellinWeight t n = (c/(n : ℂ))*Complex.exp (((Real.log (n : ℝ)*t : ℝ) : ℂ)*Complex.I) := by unfold harmonicMellinWeight have he : Complex.I*((t*Real.log (n : ℝ) : ℝ) : ℂ) = ((Real.log (n : ℝ)*t : ℝ) : ℂ)*Complex.I := by push_cast; ring rw [he] push_cast ring theorem finite_mellin_dyadic_representation (S : Finset ℕ) (w : ℕ → ℂ) (U : ℝ) (hU : 0 ≤ U) (K : ℕ) (hsupport : ∀ n ∈ S, w n ≠ 0 → U < (n : ℝ) ∧ (n : ℝ) ≤ (2 : ℝ)^K*U) (t : ℝ) : (∑ n ∈ S, w n*harmonicMellinWeight t n) = ∑ j : Fin K, ∑ n ∈ Icc (⌊(2 : ℝ)^j.val*U⌋₊+1) ⌊(2 : ℝ)^(j.val+1)*U⌋₊, (if n ∈ S then w n/(n : ℂ) else 0)* Complex.exp (((Real.log (n : ℝ)*t : ℝ) : ℂ)*Complex.I) := by simp_rw [harmonic_mellin_coefficient_phase] apply finite_polynomial_dyadic_representation S (fun n => w n/(n : ℂ)) U hU K intro n hn hne apply hsupport n hn intro hz exact hne (by rw [hz,zero_div]) end Bounty end section /- Literal products of characters and Mellin phases, including nonunit inputs. -/ open Filter namespace Bounty theorem product_level_characters_int_apply {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (a : ℤ) : (χ.changeLevel (Nat.dvd_mul_right q r)*ψ.changeLevel (Nat.dvd_mul_left r q)) (a : ZMod (q*r)) = χ (a : ZMod q)*ψ (a : ZMod r) := by rw [MulChar.mul_apply] by_cases ha : IsCoprime a ((q*r : ℕ) : ℤ) · rw [DirichletCharacter.changeLevel_eq_cast_of_dvd' χ _ ha, DirichletCharacter.changeLevel_eq_cast_of_dvd' ψ _ ha] · rw [(χ.changeLevel (Nat.dvd_mul_right q r)).apply_eq_zero_iff a |>.mpr ha, zero_mul] have hh : ¬ (IsCoprime a (q : ℤ) ∧ IsCoprime a (r : ℤ)) := by simpa only [Nat.cast_mul, IsCoprime.mul_right_iff] using ha rcases not_and_or.mp hh with hqa | hra · rw [(χ.apply_eq_zero_iff a).mpr hqa, zero_mul] · rw [(ψ.apply_eq_zero_iff a).mpr hra, mul_zero] theorem product_level_characters_nat_apply {q r : ℕ} (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r) (n : ℕ) : (χ.changeLevel (Nat.dvd_mul_right q r)*ψ.changeLevel (Nat.dvd_mul_left r q)) (n : ZMod (q*r)) = χ (n : ZMod q)*ψ (n : ZMod r) := by simpa only [Int.cast_natCast] using product_level_characters_int_apply χ ψ (n : ℤ) theorem product_modulus_power_bound {L A B : ℝ} (hL : 0 < L) {q r : ℕ} (hq : (q : ℝ) ≤ L^A) (hr : (r : ℝ) ≤ L^B) : ((q*r : ℕ) : ℝ) ≤ L^(A+B) := by rw [Nat.cast_mul, Real.rpow_add hL] exact mul_le_mul hq hr (Nat.cast_nonneg _) (Real.rpow_nonneg hL.le A) theorem harmonic_mellin_weight_cpow_shift (u σ : ℝ) {x : ℝ} (hx : 0 < x) : harmonicMellinWeight u x*(x : ℂ)^((σ : ℂ)*Complex.I) = harmonicMellinWeight (u+σ) x := by rw [Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr hx.ne'), ← Complex.ofReal_log hx.le] unfold harmonicMellinWeight rw [div_mul_eq_mul_div, ← Complex.exp_add] congr 2 push_cast ring theorem eventually_add_frequency_power_bound (A B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ σ τ : ℝ, |σ| ≤ L^A → |τ| ≤ L^B → |σ+τ| ≤ L^(max A B+1) := by filter_upwards [eventually_ge_atTop (2 : ℝ)] with L hL have hL1 : 1 ≤ L := by linarith have hLpos : 0 < L := by linarith intro σ τ hσ hτ have ha := Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left A B) have hb := Real.rpow_le_rpow_of_exponent_le hL1 (le_max_right A B) calc |σ+τ| ≤ |σ|+|τ| := abs_add_le _ _ _ ≤ 2*L^(max A B) := by linarith _ ≤ L*L^(max A B) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hLpos.le _) _ = _ := by rw [Real.rpow_add hLpos, Real.rpow_one]; ring end Bounty end section /- The five actual product dyads retain all scale hypotheses from their base scale. -/ namespace Bounty theorem five_dyad_scale_bounds {V : ℝ} (hV : 0 ≤ V) (j : Fin 5) : V/2 ≤ (2 : ℝ)^j.val*(V/2) ∧ (2 : ℝ)^j.val*(V/2) ≤ 8*V := by constructor · exact le_mul_of_one_le_left (by positivity) (one_le_pow₀ (by norm_num)) · have hp : (2 : ℝ)^j.val ≤ 2^(4 : ℕ) := pow_le_pow_right₀ (by norm_num) (by omega) calc _ ≤ (2 : ℝ)^(4 : ℕ)*(V/2) := mul_le_mul_of_nonneg_right hp (by positivity) _ = _ := by norm_num; ring theorem five_dyad_full_geometry {V c L : ℝ} (hV : 1 ≤ V/2) (hlog : Real.log (8*V) ≤ c*L) (j : Fin 5) : V/2 ≤ (2 : ℝ)^j.val*(V/2) ∧ 1 ≤ (2 : ℝ)^j.val*(V/2) ∧ Real.log ((2 : ℝ)^j.val*(V/2)) ≤ c*L ∧ (2 : ℝ)^j.val*(V/2) ≤ (⌊(2 : ℝ)^j.val*(V/2)⌋₊+1 : ℕ) ∧ (⌊(2 : ℝ)^(j.val+1)*(V/2)⌋₊ : ℝ) ≤ 2*((2 : ℝ)^j.val*(V/2)) := by have hV0 : 0 ≤ V := by linarith obtain ⟨hlo,hhi⟩ := five_dyad_scale_bounds hV0 j have hpos : 0 < (2 : ℝ)^j.val*(V/2) := zero_lt_one.trans_le (hV.trans hlo) exact ⟨hlo,hV.trans hlo,(Real.log_le_log hpos hhi).trans hlog, finite_dyadic_interval_geometry (by positivity : 0 ≤ V/2) j.val⟩ end Bounty end section /- Original product and time inequalities imply the scales used by the literal integral. -/ open Filter namespace Bounty end Bounty end section /- The original quantifier order fixes the rough slot before L tends to infinity. -/ open Finset Filter namespace Bounty theorem exists_candidate_rough_scale_parameters {c eta : ℝ} (hc : 0 < c) (heta : 0 < eta) : ∃ J : ℕ, ∀ j : ℕ, J < j → ∃ aLong : ℝ, 0 < aLong ∧ aLong < c/2^j ∧ (6/5 : ℝ)*(c/2^j) ≤ eta := by obtain ⟨J,hJ⟩ := exists_nat_gt ((6/5 : ℝ)*c/eta) refine ⟨J,?_⟩ intro j hj have hJj : (J : ℝ) ≤ (j : ℝ) := by exact_mod_cast hj.le have hjpow : (j : ℝ) ≤ (2 : ℝ)^j := by exact_mod_cast j.lt_two_pow_self.le have hscale := (div_le_iff₀ heta).mp (hJ.le.trans (hJj.trans hjpow)) have hcj : 0 < c/(2 : ℝ)^j := by positivity refine ⟨(c/2^j)/2,by positivity,by linarith,?_⟩ rw [← mul_div_assoc] apply (div_le_iff₀ (by positivity : (0 : ℝ) < 2^j)).mpr nlinarith only [hscale] theorem exists_candidate_long_rough_dyadic_window {c eta : ℝ} (hc : 0 < c) (heta : 0 < eta) : ∃ J : ℕ, ∀ j : ℕ, J < j → ∃ aLong : ℝ, 0 < aLong ∧ ∀ᶠ L : ℝ in atTop, ∀ U : ℝ, 0 < U → ((candidateRoughBand c L j).filter (fun n : ℕ => U < (n : ℝ) ∧ (n : ℝ) ≤ 2*U)).Nonempty → Real.exp (aLong*L) ≤ U ∧ U ≤ Real.exp (eta*L) ∧ U ≤ max (Real.exp (c*L/2^j)) U ∧ max (Real.exp (c*L/2^j)) U ≤ min (Real.exp ((6/5 : ℝ)*c*L/2^j)) (2*U) ∧ min (Real.exp ((6/5 : ℝ)*c*L/2^j)) (2*U) ≤ 2*U ∧ (candidateRoughBand c L j).filter (fun n : ℕ => U < (n : ℝ) ∧ (n : ℝ) ≤ 2*U) = roughBand (max (Real.exp (c*L/2^j)) U) (min (Real.exp ((6/5 : ℝ)*c*L/2^j)) (2*U)) (Real.exp (Real.sqrt L)) := by obtain ⟨J,hJ⟩ := exists_candidate_rough_scale_parameters hc heta refine ⟨J,?_⟩ intro j hj obtain ⟨aLong,ha,hlo,hhi⟩ := hJ j hj refine ⟨aLong,ha,?_⟩ filter_upwards [eventually_candidate_rough_dyadic_scales hc j j hlo hhi] with L hL exact hL j le_rfl le_rfl end Bounty end section /- An injective marked list leaves exactly the unmarked divisor count in its vertex weight. -/ open Finset open scoped Classical namespace Bounty theorem finite_marked_vertex_as_indicator {T : Type*} [Fintype T] (marked : Finset T) (hit : T → Prop) (q : ℝ) : finiteMarkedVertex marked hit q = if ∀ p ∈ marked, hit p then q ^ ((univ.filter hit).card - marked.card) else 0 := by rw [finite_marked_vertex_factor, finite_divisibility_indicator_product] by_cases h : ∀ p ∈ marked, hit p · simp only [if_pos h, one_mul] have he : ((univ \ marked).filter hit) = (univ.filter hit) \ marked := by ext p simp only [mem_filter, mem_sdiff, mem_univ, true_and] tauto have hsub : marked ⊆ univ.filter hit := fun p hp => mem_filter.mpr ⟨mem_univ _,h p hp⟩ rw [he, card_sdiff_of_subset hsub] · simp only [if_neg h, zero_mul] theorem finite_marked_embedding_indicator {I T : Type*} [Fintype I] [Fintype T] [DecidableEq T] (e : I ↪ T) (hit : T → Prop) (q : ℝ) : finiteMarkedVertex (univ.image e) hit q = if ∀ i, hit (e i) then q ^ ((univ.filter hit).card - Fintype.card I) else 0 := by rw [finite_marked_vertex_as_indicator, card_image_of_injective _ e.injective, card_univ] simp only [forall_mem_image, mem_univ, forall_const] end Bounty end section /- Exact integer dyadic blocks in the open-left interval convention of roughBand. -/ open Finset namespace Bounty noncomputable def originalDyadicBase (k : ℕ) : ℝ := (2 : ℝ)^k-1/2 theorem originalDyadicBase_pos (k : ℕ) : 0 < originalDyadicBase k := by have h : (1 : ℝ) ≤ 2^k := one_le_pow₀ (by norm_num) unfold originalDyadicBase linarith theorem dyadicNatBucket_eq_Ioc_filter (S : Finset ℕ) (hS : ∀ n ∈ S, 0 < n) (k : ℕ) : dyadicNatBucket S k = S.filter (fun n => n ∈ Ioc ((2 : ℕ)^k-1) ((2 : ℕ)^(k+1)-1)) := by rw [dyadicNatBucket_eq_filter_interval S hS] ext n simp only [mem_filter,mem_Ioc] have hpow : 1 ≤ (2 : ℕ)^k := Nat.one_le_pow k 2 (by norm_num) have hpow' : 1 ≤ (2 : ℕ)^(k+1) := Nat.one_le_pow (k+1) 2 (by norm_num) apply and_congr_right intro _ constructor · rintro ⟨hlo,hhi⟩ exact ⟨(Nat.sub_lt (by positivity : 0 < (2 : ℕ)^k) (by norm_num : 0 < 1)).trans_le hlo, Nat.le_sub_one_of_lt hhi⟩ · rintro ⟨hlo,hhi⟩ constructor · have h := Nat.succ_le_of_lt hlo simpa only [Nat.succ_eq_add_one,Nat.sub_add_cancel hpow] using h · exact hhi.trans_lt (Nat.sub_lt (by positivity : 0 < (2 : ℕ)^(k+1)) (by norm_num : 0 < 1)) theorem dyadicNatBucket_eq_real_interval (S : Finset ℕ) (hS : ∀ n ∈ S, 0 < n) (k : ℕ) : dyadicNatBucket S k = S.filter (fun n : ℕ => originalDyadicBase k < (n : ℝ) ∧ (n : ℝ) ≤ 2*originalDyadicBase k) := by rw [dyadicNatBucket_eq_filter_interval S hS] ext n simp only [mem_filter] apply and_congr_right intro _ have hpow : 1 ≤ (2 : ℕ)^k := Nat.one_le_pow k 2 (by norm_num) have hpow' : 1 ≤ (2 : ℕ)^(k+1) := Nat.one_le_pow (k+1) 2 (by norm_num) have he : (2 : ℝ)^(k+1) = 2*(2 : ℝ)^k := by rw [pow_succ]; ring unfold originalDyadicBase constructor · rintro ⟨hlo,hhi⟩ have hlo' : (2 : ℝ)^k ≤ (n : ℝ) := by exact_mod_cast hlo have hhiNat : n+1 ≤ (2 : ℕ)^(k+1) := hhi have hhi' : (n : ℝ)+1 ≤ (2 : ℝ)^(k+1) := by exact_mod_cast hhiNat constructor <;> linarith · rintro ⟨hlo,hhi⟩ constructor · by_contra hnot have hn : n+1 ≤ (2 : ℕ)^k := by omega have hn' : (n : ℝ)+1 ≤ (2 : ℝ)^k := by exact_mod_cast hn linarith · have hn' : (n : ℝ) < (2 : ℝ)^(k+1) := by linarith exact_mod_cast hn' theorem dyadicNatBucket_Icc_eq_Ioc (N k : ℕ) : dyadicNatBucket (Icc 1 N) k = Ioc ((2 : ℕ)^k-1) (min N ((2 : ℕ)^(k+1)-1)) := by rw [dyadicNatBucket_eq_Ioc_filter (Icc 1 N) (fun n hn => (mem_Icc.mp hn).1)] ext n simp only [mem_filter,mem_Icc,mem_Ioc,le_min_iff] have hpow : 1 ≤ (2 : ℕ)^k := Nat.one_le_pow k 2 (by norm_num) omega end Bounty end section /- A harmonic pairing changes by the two actual endpoint square errors. The finite support and lower endpoint are not enlarged. -/ open Finset namespace Bounty theorem finite_harmonic_pairing_cauchy (S : Finset ℤ) (θ f g : ℤ → ℂ) {Y K : ℝ} (hY : 0 < Y) (hK : 0 ≤ K) (hYlow : ∀ n ∈ S, Y ≤ (n : ℝ)) (hθ : ∀ n ∈ S, ‖θ n‖ ≤ K) : ‖∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (f n) * g n‖ ≤ (K/Y) * Real.sqrt (∑ n ∈ S, ‖f n‖^2) * Real.sqrt (∑ n ∈ S, ‖g n‖^2) := by have hw (n : ℤ) (hn : n ∈ S) : ‖θ n / (n : ℂ)‖ ≤ K/Y := by have hn0 : (0 : ℝ) < n := hY.trans_le (hYlow n hn) have hnC : ‖(n : ℂ)‖ = (n : ℝ) := by rw [← Complex.ofReal_intCast, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hn0] rw [norm_div, hnC] exact div_le_div₀ hK (hθ n hn) hY (hYlow n hn) have h := finite_weighted_pair_error S (fun _ => 1) (fun _ => 1) (fun _ => 1) f g (fun n => θ n / (n : ℂ)) (fun _ _ => by norm_num) (div_nonneg hK hY.le) (fun n hn => by simpa only [one_mul] using hw n hn) simpa only [Complex.ofReal_one, one_mul, mul_one, mul_comm, mul_left_comm, mul_assoc] using h theorem finite_harmonic_endpoint_replacement (S : Finset ℤ) (θ f g f' g' : ℤ → ℂ) {Y K : ℝ} (hY : 0 < Y) (hK : 0 ≤ K) (hYlow : ∀ n ∈ S, Y ≤ (n : ℝ)) (hθ : ∀ n ∈ S, ‖θ n‖ ≤ K) : ‖(∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (f n) * g n) - (∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (f' n) * g' n)‖ ≤ (K/Y) * (Real.sqrt (∑ n ∈ S, ‖f n-f' n‖^2) * Real.sqrt (∑ n ∈ S, ‖g n‖^2) + Real.sqrt (∑ n ∈ S, ‖f' n‖^2) * Real.sqrt (∑ n ∈ S, ‖g n-g' n‖^2)) := by have heq : (∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (f n) * g n) - (∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (f' n) * g' n) = (∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (f n-f' n) * g n) + (∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (f' n) * (g n-g' n)) := by rw [← sum_sub_distrib, ← sum_add_distrib] apply sum_congr rfl intro n _ rw [map_sub] ring rw [heq] apply (norm_add_le _ _).trans have h1 := finite_harmonic_pairing_cauchy S θ (fun n => f n-f' n) g hY hK hYlow hθ have h2 := finite_harmonic_pairing_cauchy S θ f' (fun n => g n-g' n) hY hK hYlow hθ exact (add_le_add h1 h2).trans_eq (by ring) end Bounty end section /- Deterministic history phases commute with exact event-path transports. -/ namespace Bounty theorem deterministic_ledger_phase_cast {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) (phase : ∀ k, L → (x : X) → E k x → ℂ) (ks : List K) (l : L) {x y : X} (h : x = y) (p : FiniteEventPath E target ks x) : deterministicLedgerPhase E target update phase ks l y (cast (congrArg (FiniteEventPath E target ks) h) p) = deterministicLedgerPhase E target update phase ks l x p := by cases h rfl theorem deterministic_ledger_phase_equiv {K L X Y : Type*} (E : K → X → Type*) (F : K → Y → Type*) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (e : X → Y) (δ : ∀ k x, E k x ≃ F k (e x)) (ht : ∀ k x a, e (t k x a) = u k (e x) (δ k x a)) (v : ∀ k, L → (x : X) → E k x → L) (w : ∀ k, L → (y : Y) → F k y → L) (hv : ∀ k l x a, w k l (e x) (δ k x a) = v k l x a) (phase : ∀ k, L → (x : X) → E k x → ℂ) (phase' : ∀ k, L → (y : Y) → F k y → ℂ) (hp : ∀ k l x a, phase' k l (e x) (δ k x a) = phase k l x a) (ks : List K) (l : L) (x : X) (p : FiniteEventPath E t ks x) : deterministicLedgerPhase F u w phase' ks l (e x) (finiteEventPathEquiv E F t u e δ ht ks x p) = deterministicLedgerPhase E t v phase ks l x p := by induction ks generalizing l x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ change phase' k l (e x) (δ k x a) * deterministicLedgerPhase F u w phase' ks (w k l (e x) (δ k x a)) _ (cast (congrArg (FiniteEventPath F u ks) (ht k x a)) (finiteEventPathEquiv E F t u e δ ht ks (t k x a) p)) = _ rw [hp, hv, deterministic_ledger_phase_cast F u w phase' ks _ (ht k x a), ih] rfl end Bounty end section /- The character in a retained logarithmic cell has norm at most one. -/ open Finset open scoped Classical namespace Bounty noncomputable def primeProductCellCharacter {I : Type*} [Fintype I] (P : I → Finset ℕ) (h : ℝ) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (x : ∀ i, P i) : ℂ := if upperLogCell h (Real.log (∏ i, (x i).val : ℕ)) = d then boundedPrimitiveValue χ ((∏ i, (x i).val : ℕ) : ZMod (boundedPrimitiveModulus χ)) else 0 theorem prime_product_cell_character_norm {I : Type*} [Fintype I] (P : I → Finset ℕ) (h : ℝ) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (x : ∀ i, P i) : ‖primeProductCellCharacter P h d χ x‖ ≤ 1 := by unfold primeProductCellCharacter split_ifs · exact (boundedPrimitiveValue χ).norm_le_one _ · simp only [norm_zero, zero_le_one] theorem prime_ideal_kernel_cell_expansion {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (Q : ℕ) (h : ℝ) (kept : Finset ℤ) (x y : ∀ i, P i) : primeProductIdealKernel P V Q h kept x y = ∑ d ∈ kept, ∑ χ : BoundedPrimitiveCharacter Q, ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell h (Real.log (∏ i, (z i).val : ℕ))) d : ℝ) : ℂ) * (starRingEnd ℂ) (primeProductCellCharacter P h d χ x) * primeProductCellCharacter P h d χ y := by unfold primeProductIdealKernel rw [finite_cell_kernel_expansion] apply sum_congr rfl intro d _ apply sum_congr rfl intro χ _ unfold primeProductCellCharacter split_ifs <;> simp_all end Bounty end section /- A deterministic phase can ignore an independent bookkeeping ledger, while retaining its own history on the original events. -/ namespace Bounty theorem deterministic_ledger_phase_forget {K H L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (history : ∀ k, H → (x : X) → E k x → H) (update : ∀ k, L → (x : X) → E k x → L) (phase : ∀ k, L → (x : X) → E k x → ℂ) (ks : List K) (h : H) (l : L) (x : X) (p : FiniteEventPath (fun k (s : H × X) => E k s.2) (finiteLedgerEventTarget E target history) ks (h, x)) : deterministicLedgerPhase (fun k (s : H × X) => E k s.2) (finiteLedgerEventTarget E target history) (fun k l s e => update k l s.2 e) (fun k l s e => phase k l s.2 e) ks l (h, x) p = deterministicLedgerPhase E target update phase ks l x (finiteLedgerEventPathEquiv E target history ks h x p) := by induction ks generalizing h l x with | nil => rfl | cons k ks ih => rcases p with ⟨e, p⟩ exact congrArg (phase k l x e * ·) (ih (history k h x e) (update k l x e) (target k x e) p) end Bounty end section /- A finite weighted shift average is exactly a Fourier multiplier. -/ open Finset MeasureTheory open scoped ComplexConjugate namespace Bounty theorem finite_averaged_shift_fourier {I : Type*} (A : Finset I) (c : I → ℂ) (δ : I → ℤ) (S T : Finset ℤ) (f g : ℤ → ℂ) : (∑ a ∈ A, c a * ∑ n ∈ S, if n+δ a ∈ T then conj (f n)*g (n+δ a) else 0) = ∫ x in (0 : ℝ)..1, conj (finiteFourierSum S f x) * finiteFourierSum T g x * (∑ a ∈ A, c a * fourier (-δ a) (x : AddCircle (1 : ℝ))) := by have hcont (a : I) : Continuous (fun x : ℝ => conj (finiteFourierSum S f x) * finiteFourierSum T g x * fourier (-δ a) (x : AddCircle (1 : ℝ))) := ((continuous_finiteFourierSum S f).star.mul (continuous_finiteFourierSum T g)).mul (continuous_fourier_real (-δ a)) simp_rw [← finite_fourier_shift_correlation S T f g] simp_rw [← intervalIntegral.integral_const_mul] have hint (a : I) : IntervalIntegrable (fun x : ℝ => c a * (conj (finiteFourierSum S f x) * finiteFourierSum T g x * fourier (-δ a) (x : AddCircle (1 : ℝ)))) volume 0 1 := (continuous_const.mul (hcont a)).intervalIntegrable _ _ rw [← intervalIntegral.integral_finsetSum (fun a _ => hint a)] apply intervalIntegral.integral_congr intro x _ dsimp only rw [mul_sum] apply sum_congr rfl intro a _ ring end Bounty end section /- The supported product estimate in the Fourier convention used for integer shifted correlations. -/ open Finset open scoped Classical namespace Bounty theorem fourier_product_phase (k : ℤ) (m n : ℕ) (x : ℝ) : fourier (-(k * (m*n : ℕ))) (x : AddCircle (1 : ℝ)) = (Complex.exp (Complex.I * (2 * Real.pi * (((-k : ℝ)*x)*n) : ℝ))) ^ m := by rw [fourier_coe_apply, ← Complex.exp_nat_mul] congr 1 push_cast ring theorem supported_product_fourier_dyadic_bound {X Y : Type*} [Fintype X] [Fintype Y] (π : X → ℕ) (τ : Y → ℕ) (U V : ℕ) (hU : 0 < U) (hV : 0 < V) (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (f : X → ℂ) (g : Y → ℂ) (hπrange : ∀ x, f x ≠ 0 → U ≤ π x ∧ π x < 2 * U) (hτrange : ∀ y, g y ≠ 0 → V ≤ τ y ∧ τ y < 2 * V) {C D : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hμatom : ∀ m : ℕ, (∑ x ∈ univ.filter (fun x => π x = m), μ x) ≤ C / (m : ℝ)) (hνatom : ∀ m : ℕ, (∑ y ∈ univ.filter (fun y => τ y = m), ν y) ≤ D / (m : ℝ)) (k : ℤ) (θ : ℝ) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1 / (r : ℝ) ^ 2) (hθ : (-k : ℝ)*θ = u/r+β) : ‖∑ x, ∑ y, ((μ x : ℂ)*f x)*((ν y : ℂ)*g y)* fourier (-(k * (π x * τ y : ℕ))) (θ : AddCircle (1 : ℝ))‖ ^ 2 ≤ 6*C*D*(1+Real.log r)* (1/(r : ℝ)+1/(U : ℝ)+1/(V : ℝ)+(r : ℝ)/((U : ℝ)*V))* (∑ x, μ x*‖f x‖^2)*∑ y, ν y*‖g y‖^2 := by simp_rw [fourier_product_phase, hθ] exact supported_weighted_product_dyadic_clean_bound π τ U V hU hV μ ν hμ hν f g hπrange hτrange hC hD hμatom hνatom hr hcop hβ end Bounty end section /- A multiplier small off a measurable major set is controlled by the first endpoint's energy on that set and the total endpoint energies. -/ open MeasureTheory open scoped ComplexConjugate namespace Bounty theorem multiplier_square_energy_bound {X : Type*} [MeasurableSpace X] (μ : Measure X) (f m : X → ℂ) (B : Set X) (hB : MeasurableSet B) {ε : ℝ} (hε : 0 ≤ ε) (hm : ∀ x, ‖m x‖ ≤ 1) (hminor : ∀ x, x ∉ B → ‖m x‖ ≤ ε) (hf : Integrable (fun x => ‖f x‖^2) μ) (hfm : Integrable (fun x => ‖f x‖^2 * ‖m x‖^2) μ) : (∫ x, ‖f x‖^2 * ‖m x‖^2 ∂μ) ≤ ε^2*(∫ x, ‖f x‖^2 ∂μ) + ∫ x in B, ‖f x‖^2 ∂μ := by classical have hb : Integrable (B.indicator (fun x => ‖f x‖^2)) μ := hf.indicator hB calc _ ≤ ∫ x, ε^2*‖f x‖^2 + B.indicator (fun x => ‖f x‖^2) x ∂μ := by apply integral_mono hfm ((hf.const_mul _).add hb) intro x dsimp only [Pi.add_apply] by_cases hx : x ∈ B · rw [Set.indicator_of_mem hx] have hn : ‖m x‖^2 ≤ 1 := by nlinarith [norm_nonneg (m x), hm x] have hp := mul_le_mul_of_nonneg_left hn (sq_nonneg ‖f x‖) nlinarith [sq_nonneg ε, sq_nonneg ‖f x‖] · rw [Set.indicator_of_notMem hx, add_zero] have hn : ‖m x‖^2 ≤ ε^2 := by nlinarith [norm_nonneg (m x), hminor x hx] simpa only [mul_comm] using mul_le_mul_of_nonneg_left hn (sq_nonneg ‖f x‖) _ = _ := by rw [integral_add (hf.const_mul _) hb, integral_const_mul, integral_indicator hB] theorem multiplier_pairing_major_energy {X : Type*} [MeasurableSpace X] (μ : Measure X) (f g m : X → ℂ) (B : Set X) (hB : MeasurableSet B) {ε : ℝ} (hε : 0 ≤ ε) (hm : ∀ x, ‖m x‖ ≤ 1) (hminor : ∀ x, x ∉ B → ‖m x‖ ≤ ε) (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) (hfm : MemLp (fun x => conj (m x)*f x) 2 μ) : ‖∫ x, conj (f x)*g x*m x ∂μ‖ ≤ Real.sqrt (ε^2*(∫ x, ‖f x‖^2 ∂μ) + ∫ x in B, ‖f x‖^2 ∂μ) * Real.sqrt (∫ x, ‖g x‖^2 ∂μ) := by have hfe := (memLp_two_iff_integrable_sq_norm hf.aestronglyMeasurable).mp hf have hfme := (memLp_two_iff_integrable_sq_norm hfm.aestronglyMeasurable).mp hfm have hnorm (x : X) : ‖conj (m x)*f x‖^2 = ‖f x‖^2*‖m x‖^2 := by simp only [norm_mul, RCLike.norm_conj, mul_pow] ring simp_rw [hnorm] at hfme have he := multiplier_square_energy_bound μ f m B hB hε hm hminor hfe hfme have hp := integral_pairing_energy μ (fun x => conj (m x)*f x) g hfm hg have heq (x : X) : conj (conj (m x)*f x)*g x = conj (f x)*g x*m x := by simp only [map_mul, starRingEnd_apply, star_star] ring simp_rw [heq, hnorm] at hp exact hp.trans (mul_le_mul_of_nonneg_right (Real.sqrt_le_sqrt he) (Real.sqrt_nonneg _)) end Bounty end section /- A uniform polynomial bound for the fixed common-window harmonic energy cost. -/ open Filter Real namespace Bounty theorem eventually_harmonic_common_energy_polynomial : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, 1 ≤ Y → log Y ≤ 6*L → let N := ⌈4*exp 2*Y⌉₊ 2*((N : ℝ)/(Y/8))*(1+log (N : ℝ))^15 ≤ L^(31 : ℝ) := by filter_upwards [eventually_ge_atTop (max (1 : ℝ) (max (log 5+3) (80*exp 2*7^15)))] with L hthreshold intro Y hY hlogY dsimp only have hL : 1 ≤ L := (le_max_left _ _).trans hthreshold have hL0 : 0 < L := zero_lt_one.trans_le hL have hlogL : log 5+3 ≤ L := ((le_max_left _ _).trans (le_max_right _ _)).trans hthreshold have hcost : 80*exp 2*7^15 ≤ L := ((le_max_right _ _).trans (le_max_right _ _)).trans hthreshold obtain ⟨_,hratio,hlog⟩ := harmonic_common_window_ceiling_bounds hY have hE : 1 ≤ exp (2 : ℝ) := one_le_exp (by norm_num) have hEY : 1 ≤ exp 2*Y := by simpa only [one_mul] using mul_le_mul hE hY (by norm_num : (0 : ℝ) ≤ 1) (exp_pos _).le have hN : 1 ≤ (⌈4*exp 2*Y⌉₊ : ℝ) := (show (1 : ℝ) ≤ 4*exp 2*Y by nlinarith).trans (Nat.le_ceil _) have hnonneg : 0 ≤ 1+log (⌈4*exp 2*Y⌉₊ : ℝ) := add_nonneg zero_le_one (log_nonneg hN) have hsum : 1+log (⌈4*exp 2*Y⌉₊ : ℝ) ≤ 7*L := by linarith calc _ ≤ (80*exp 2)*(1+log (⌈4*exp 2*Y⌉₊ : ℝ))^15 := mul_le_mul_of_nonneg_right (by linarith) (pow_nonneg hnonneg _) _ ≤ (80*exp 2)*(7*L)^15 := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hnonneg hsum 15) (by positivity) _ = (80*exp 2*7^15)*L^15 := by rw [mul_pow]; ring _ ≤ L*L^15 := mul_le_mul_of_nonneg_right hcost (pow_nonneg hL0.le _) _ = L^(16 : ℝ) := by norm_num [rpow_ofNat]; ring _ ≤ L^(31 : ℝ) := rpow_le_rpow_of_exponent_le hL (by norm_num) end Bounty end section /- Reindexing an equal schedule preserves the deterministic phase. -/ namespace Bounty theorem deterministic_ledger_phase_schedule_cast {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) (phase : ∀ k, L → (x : X) → E k x → ℂ) {ks ks' : List K} (h : ks = ks') (l : L) (x : X) (p : FiniteEventPath E target ks x) : deterministicLedgerPhase E target update phase ks' l x (cast (congrArg (fun steps => FiniteEventPath E target steps x) h) p) = deterministicLedgerPhase E target update phase ks l x p := by cases h rfl end Bounty end section /- Four coordinate dyadic partitions preserve arbitrary product-coupled summands. -/ open Finset namespace Bounty theorem sum_four_dyadicNatBuckets {E : Type*} [AddCommMonoid E] (D A B C : Finset ℕ) (F : ℕ → ℕ → ℕ → ℕ → E) : (∑ i ∈ dyadicNatIndices D, ∑ j ∈ dyadicNatIndices A, ∑ k ∈ dyadicNatIndices B, ∑ l ∈ dyadicNatIndices C, ∑ d ∈ dyadicNatBucket D i, ∑ a ∈ dyadicNatBucket A j, ∑ b ∈ dyadicNatBucket B k, ∑ c ∈ dyadicNatBucket C l, F d a b c) = ∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, F d a b c := by rw [← sum_dyadicNatBuckets_bilinear D A (fun d a => ∑ b ∈ B, ∑ c ∈ C, F d a b c)] apply sum_congr rfl intro i _ apply sum_congr rfl intro j _ simp_rw [sum_comm (s := dyadicNatIndices C) (t := dyadicNatBucket D i), sum_comm (s := dyadicNatIndices C) (t := dyadicNatBucket A j)] rw [sum_comm] apply sum_congr rfl intro d _ rw [sum_comm] apply sum_congr rfl intro a _ exact sum_dyadicNatBuckets_bilinear B C (F d a) end Bounty end section /- A measurable major set for the frequency -k*theta and the actual product scale. The minor estimate uses the exact rational approximation dichotomy. -/ open MeasureTheory namespace Bounty def productMajorArcSet (k : ℤ) (L q U V : ℝ) : Set ℝ := {θ | ∃ (u : ℤ) (r : ℕ), 0 < r ∧ r ≤ ⌊L^q⌋₊ ∧ |(-k : ℝ)*θ-(u : ℝ)/r| * (U*V) ≤ L^q} theorem product_major_arc_set_measurable (k : ℤ) (L q U V : ℝ) : MeasurableSet (productMajorArcSet k L q U V) := by have hsingle (u : ℤ) (r : ℕ) : MeasurableSet {θ : ℝ | 0 < r ∧ r ≤ ⌊L^q⌋₊ ∧ |(-k : ℝ)*θ-(u : ℝ)/r| * (U*V) ≤ L^q} := by by_cases hr : 0 < r · by_cases hb : r ≤ ⌊L^q⌋₊ · simp only [hr, hb, true_and] exact measurableSet_le (by fun_prop) measurable_const · simp only [hb, and_false, false_and, Set.ofPred_false, MeasurableSet.empty] · simp only [hr, false_and, Set.ofPred_false, MeasurableSet.empty] simpa only [productMajorArcSet, Set.ofPred_exists] using MeasurableSet.iUnion (fun u => MeasurableSet.iUnion (fun r => hsingle u r)) theorem product_minor_arc_norm_bound {L C D U V κ t q B : ℝ} (hL : 512 ≤ L) (hC : 0 ≤ C) (hD : 0 ≤ D) (ht : 0 ≤ t) (hq : 0 ≤ q) (hparam : 2*κ+t+2*B+3 ≤ q) (hCb : C ≤ L^κ) (hDb : D ≤ L^κ) (hU : L^q ≤ U) (hV : L^q ≤ V) (hlog : Real.log (U*V) ≤ L^t) (k : ℤ) (θ : ℝ) (z : ℂ) (hbound : ∀ (u : ℤ) (r : ℕ) (β : ℝ), 0 < r → (r : ℤ).gcd u = 1 → |β| ≤ 1/(r : ℝ)^2 → (-k : ℝ)*θ = u/r+β → ‖z‖^2 ≤ 6*C*D*(1+Real.log r)* (1/(r : ℝ)+1/U+1/V+(r : ℝ)/(U*V))) (hminor : θ ∉ productMajorArcSet k L q U V) : ‖z‖ ≤ L^(-B) := by obtain ⟨u, r, β, hr, hcop, heq, hβ, hscale, hratio, hcase⟩ := polynomial_dirichlet_dichotomy ((-k : ℝ)*θ) L q U V (by linarith) hq hU hV have hrlarge : L^q < (r : ℝ) := by rcases hcase with hs | hs · exact False.elim (hminor ⟨u, r, hr, hs, by simpa only [heq, add_sub_cancel_left] using hscale⟩) · exact hs have hs := minor_arc_uniform_factor_le hL hC hD ht hq hparam hCb hDb hU hV hrlarge.le hratio hlog have hb := hbound u r β hr hcop hβ heq have hz : ‖z‖ ≤ Real.sqrt (6*C*D*(1+Real.log r)* (1/(r : ℝ)+1/U+1/V+(r : ℝ)/(U*V))) := by exact Real.le_sqrt_of_sq_le hb nlinarith [Real.sqrt_nonneg (6*C*D*(1+Real.log r)* (1/(r : ℝ)+1/U+1/V+(r : ℝ)/(U*V)))] end Bounty end section namespace Bounty theorem dyadic_decay_weight_le {L h t : ℝ} (hL : 1 ≤ L) (hh : 0 < h) (n M : ℕ) (ht : t ∈ dyadicAbsShell (L/h) n) : (1+|h*t|)^(-((M+2:ℕ):ℝ)) ≤ L^(-(M:ℝ)) * (1/4:ℝ)^n := by have hLp : 0 < L := lt_of_lt_of_le zero_lt_one hL have hb : 0 < 1+|h*t| := by positivity have hn : 1 ≤ (2:ℝ)^n := one_le_pow₀ (by norm_num) have hht : (2:ℝ)^n*L ≤ |h*t| := by rw [abs_mul, abs_of_pos hh] have ht' := mul_le_mul_of_nonneg_left ht.1 hh.le calc (2:ℝ)^n*L = h*((2:ℝ)^n*(L/h)) := by field_simp _ ≤ h*|t| := ht' have hbaseL : L ≤ 1+|h*t| := by nlinarith have hbase2 : (2:ℝ)^n ≤ 1+|h*t| := by nlinarith rw [Real.rpow_neg hb.le, Real.rpow_natCast, Real.rpow_neg hLp.le, Real.rpow_natCast, pow_add, mul_inv_rev, mul_comm] have hp := inv_le_inv₀ (pow_pos hb M) (pow_pos hLp M) |>.2 (pow_le_pow_left₀ hLp.le hbaseL M) have hq := inv_le_inv₀ (pow_pos hb 2) (pow_pos (pow_pos (by norm_num : (0:ℝ)<2) n) 2) |>.2 (pow_le_pow_left₀ (by positivity) hbase2 2) have heq : (((2:ℝ)^n)^2)⁻¹ = (1/4:ℝ)^n := by rw [← pow_mul, Nat.mul_comm n 2, pow_mul, ← inv_pow] norm_num rw [heq] at hq exact mul_le_mul hp hq (by positivity) (by positivity) end Bounty end section /- Absolute harmonic masses on finite dyadic blocks, uniformly in Mellin frequency. -/ open Finset Real namespace Bounty end Bounty end section /- A phase independent of the auxiliary ledger is the original local path phase. -/ namespace Bounty theorem deterministic_ledger_local_phase {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) (phase : ∀ k x, E k x → ℂ) (ks : List K) (l : L) (x : X) (p : FiniteEventPath E target ks x) : deterministicLedgerPhase E target update (fun k _ x e => phase k x e) ks l x p = finiteEventLocalPhase E target phase ks x p := by induction ks generalizing l x with | nil => rfl | cons k ks ih => rcases p with ⟨e, p⟩ exact congrArg (phase k x e * ·) (ih (update k l x e) (target k x e) p) end Bounty end section /- Ceiling and logarithm bounds for the exact common-support natural cutoff. -/ open Filter namespace Bounty theorem harmonic_common_ceiling_le_sixtyfour {Y : ℝ} (hY : 1 ≤ Y) : (⌈4*Real.exp 2*Y⌉₊ : ℝ) ≤ 64*Y := by have he : Real.exp (2:ℝ) = Real.exp 1*Real.exp 1 := by rw [← Real.exp_add] norm_num have he9 : Real.exp (2:ℝ) ≤ 9 := by rw [he] nlinarith [Real.exp_one_lt_three,Real.exp_pos 1] have hb := (harmonic_common_window_ceiling_bounds hY).1 have hY0 : 0 ≤ Y := by linarith have hc := mul_le_mul_of_nonneg_right he9 hY0 nlinarith theorem eventually_harmonic_common_cutoff_geometry : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, 1 ≤ Y → Real.log Y ≤ 6*L → (⌈4*Real.exp 2*Y⌉₊ : ℝ) ≤ 64*Y ∧ Real.log (⌈4*Real.exp 2*Y⌉₊ : ℝ) ≤ 64*L := by filter_upwards [eventually_ge_atTop (1:ℝ), eventually_ge_atTop (Real.log 5+2)] with L hL hLc intro Y hY hlog refine ⟨harmonic_common_ceiling_le_sixtyfour hY,?_⟩ have hb := (harmonic_common_window_ceiling_bounds hY).2.2 linarith end Bounty end section /- Integration of translated averages using shifted square-energy bounds. -/ open MeasureTheory namespace Bounty theorem integrated_translate_average_square (μ ν : Measure ℝ) [IsFiniteMeasure μ] [SFinite ν] {κ P : ℝ → ℂ} {M B : ℝ} (c : ℝ) (hκc : Continuous κ) (hκi : Integrable κ ν) (hP : Continuous P) (hM : 0 ≤ M) (hPM : ∀ s, ‖P s‖ ≤ M) (hB : ∀ u, (∫ s, ‖P (s+c*u)‖^2 ∂μ) ≤ B) : Integrable (fun s => ‖∫ u, κ u * P (s+c*u) ∂ν‖^2) μ ∧ (∫ s, ‖∫ u, κ u * P (s+c*u) ∂ν‖^2 ∂μ) ≤ (∫ u, ‖κ u‖ ∂ν)^2 * B := by let A := ∫ u, ‖κ u‖ ∂ν have hA : 0 ≤ A := integral_nonneg (fun u => norm_nonneg _) have hc : Continuous (fun p : ℝ × ℝ => κ p.2 * P (p.1+c*p.2)) := by fun_prop have hm : StronglyMeasurable (fun s => ∫ u, κ u * P (s+c*u) ∂ν) := hc.stronglyMeasurable.integral_prod_right' have hEb (s : ℝ) : ‖∫ u, κ u * P (s+c*u) ∂ν‖ ≤ A*M := by change _ ≤ (∫ u, ‖κ u‖ ∂ν)*M rw [← integral_mul_const] apply norm_integral_le_of_norm_le (hκi.norm.mul_const M) filter_upwards [] with u rw [norm_mul] exact mul_le_mul_of_nonneg_left (hPM _) (norm_nonneg _) have hEi : Integrable (fun s => ‖∫ u, κ u * P (s+c*u) ∂ν‖^2) μ := by apply (integrable_const ((A*M)^2)).mono' (hm.norm.pow 2).aestronglyMeasurable filter_upwards [] with s change ‖‖∫ u, κ u * P (s+c*u) ∂ν‖^2‖ ≤ (A*M)^2 rw [Real.norm_of_nonneg (sq_nonneg _)] exact pow_le_pow_left₀ (norm_nonneg _) (hEb s) 2 have hQc : Continuous (fun p : ℝ × ℝ => ‖κ p.2‖ * ‖P (p.1+c*p.2)‖^2) := by fun_prop have hQi : Integrable (fun p : ℝ × ℝ => ‖κ p.2‖ * ‖P (p.1+c*p.2)‖^2) (μ.prod ν) := by apply ((hκi.norm.mul_const (M^2)).comp_snd μ).mono' hQc.aestronglyMeasurable filter_upwards [] with p rw [Real.norm_of_nonneg (mul_nonneg (norm_nonneg _) (sq_nonneg _))] exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) (hPM _) 2) (norm_nonneg _) have hpoint (s : ℝ) : ‖∫ u, κ u * P (s+c*u) ∂ν‖^2 ≤ A * ∫ u, ‖κ u‖ * ‖P (s+c*u)‖^2 ∂ν := (bounded_weighted_integral_square hκi (by fun_prop) hM (fun u => hPM _)).2 refine ⟨hEi, ?_⟩ calc _ ≤ ∫ s, A * (∫ u, ‖κ u‖ * ‖P (s+c*u)‖^2 ∂ν) ∂μ := integral_mono hEi (hQi.integral_prod_left.const_mul A) hpoint _ = A * ∫ u, (∫ s, ‖κ u‖ * ‖P (s+c*u)‖^2 ∂μ) ∂ν := by rw [integral_const_mul, integral_integral_swap hQi] _ ≤ A * ∫ u, ‖κ u‖ * B ∂ν := by apply mul_le_mul_of_nonneg_left _ hA apply integral_mono hQi.integral_prod_right (hκi.norm.mul_const B) intro u change (∫ s, ‖κ u‖ * ‖P (s+c*u)‖^2 ∂μ) ≤ ‖κ u‖ * B rw [integral_const_mul] exact mul_le_mul_of_nonneg_left (hB u) (norm_nonneg _) _ = _ := by rw [integral_mul_const]; dsimp [A]; ring end Bounty end section /- Uniform polynomial absorption of the retained-box mean-square scale. -/ open Filter Real namespace Bounty theorem eventually_harmonic_box_mean_square_scalar {c E : ℝ} (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ Y T W : ℝ, 1 ≤ Y → log Y ≤ c*L → 0 ≤ T → T ≤ L*Y → 0 ≤ W → W ≤ L^E → let N := ⌈64*exp 2*Y⌉₊ (2*T + 4*(N : ℝ)*(1 + log N)) * (W^2 * ((N : ℝ)*(1 + log N)^15) / (Y/128)^2) ≤ L^(2*E+17) := by let K : ℝ := 80*exp 2 let B : ℝ := c+1 let C : ℝ := (2+4*K*B)*K*B^15*128^2 filter_upwards [eventually_ge_atTop (max (1 : ℝ) (max (log 5+log 16+3) C))] with L hthreshold intro Y T W hY hlogY hT hTY hW hWL dsimp only let N := ⌈64*exp 2*Y⌉₊ have hL : 1 ≤ L := (le_max_left _ _).trans hthreshold have hL0 : 0 < L := zero_lt_one.trans_le hL have hY0 : 0 < Y := zero_lt_one.trans_le hY have hK : 0 < K := by dsimp only [K]; positivity have hB : 0 < B := by dsimp only [B]; linarith have hClog : log 5+log 16+3 ≤ L := ((le_max_left _ _).trans (le_max_right _ _)).trans hthreshold have hC : C ≤ L := ((le_max_right _ _).trans (le_max_right _ _)).trans hthreshold have hscaled := harmonic_common_window_ceiling_bounds (show 1 ≤ 16*Y by linarith) rw [show 4*exp 2*(16*Y) = 64*exp 2*Y by ring] at hscaled have hN : (N : ℝ) ≤ K*Y := by dsimp only [N, K] linarith [hscaled.1] have hlogN : 1 + log (N : ℝ) ≤ B*L := by have hlog := hscaled.2.2 rw [log_mul (by norm_num : (16 : ℝ) ≠ 0) hY0.ne'] at hlog dsimp only [N, B] linarith have hlog0 : 0 ≤ 1 + log (N : ℝ) := by have hn := log_natCast_nonneg N linarith have hmean : 2*T + 4*(N : ℝ)*(1 + log N) ≤ (2+4*K*B)*L*Y := by calc _ ≤ 2*(L*Y) + 4*(K*Y)*(B*L) := by gcongr _ = _ := by ring have henergy : W^2 * ((N : ℝ)*(1 + log N)^15) / (Y/128)^2 ≤ (L^E)^2 * ((K*Y)*(B*L)^15) / (Y/128)^2 := by gcongr have hpower : (L^E)^2 * L^16 = L^(2*E+16) := by rw [← rpow_mul_natCast hL0.le, ← rpow_natCast, ← rpow_add hL0] congr 1 norm_num ring change (2*T + 4*(N : ℝ)*(1 + log N)) * (W^2 * ((N : ℝ)*(1 + log N)^15) / (Y/128)^2) ≤ _ calc _ ≤ ((2+4*K*B)*L*Y) * ((L^E)^2 * ((K*Y)*(B*L)^15) / (Y/128)^2) := by apply mul_le_mul hmean henergy · positivity · positivity _ = C * ((L^E)^2 * L^16) := by dsimp only [C] field_simp _ = C * L^(2*E+16) := by rw [hpower] _ ≤ L * L^(2*E+16) := mul_le_mul_of_nonneg_right hC (rpow_nonneg hL0.le _) _ = L^(2*E+17) := by rw [show 2*E+17 = (2*E+16)+1 by ring, rpow_add_one hL0.ne' (2*E+16)] ring end Bounty end section /- Integrating the finite Cauchy bound without changing any summand. -/ open Finset MeasureTheory namespace Bounty theorem finite_integrated_energy_le_card_sq {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (S : Finset ι) (f : ι → Ω → ℂ) (E : ℝ) (hf : ∀ i ∈ S, Integrable (fun s => ‖f i s‖ ^ 2) μ) (hE : ∀ i ∈ S, (∫ s, ‖f i s‖ ^ 2 ∂μ) ≤ E) : (∫ s, ‖∑ i ∈ S, f i s‖ ^ 2 ∂μ) ≤ (S.card : ℝ) ^ 2 * E := by have hi : Integrable (fun s => (S.card : ℝ) * ∑ i ∈ S, ‖f i s‖ ^ 2) μ := (integrable_finsetSum S hf).const_mul _ calc _ ≤ ∫ s, (S.card : ℝ) * ∑ i ∈ S, ‖f i s‖ ^ 2 ∂μ := integral_mono_of_nonneg (Filter.Eventually.of_forall (fun s => sq_nonneg _)) hi (Filter.Eventually.of_forall (fun s => finite_sum_norm_square_le_card S (fun i => f i s))) _ = (S.card : ℝ) * ∑ i ∈ S, ∫ s, ‖f i s‖ ^ 2 ∂μ := by rw [integral_const_mul, integral_finsetSum S hf] _ ≤ (S.card : ℝ) * ∑ _i ∈ S, E := mul_le_mul_of_nonneg_left (sum_le_sum hE) (Nat.cast_nonneg _) _ = _ := by simp only [sum_const, nsmul_eq_mul]; ring theorem four_integrated_energy_le_card_eight {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (S : Finset ι) (f : ι → ι → ι → ι → Ω → ℂ) (E : ℝ) (hf : ∀ i ∈ S, ∀ j ∈ S, ∀ k ∈ S, ∀ l ∈ S, Integrable (fun s => ‖f i j k l s‖ ^ 2) μ) (hE : ∀ i ∈ S, ∀ j ∈ S, ∀ k ∈ S, ∀ l ∈ S, (∫ s, ‖f i j k l s‖ ^ 2 ∂μ) ≤ E) : (∫ s, ‖∑ i ∈ S, ∑ j ∈ S, ∑ k ∈ S, ∑ l ∈ S, f i j k l s‖ ^ 2 ∂μ) ≤ (S.card : ℝ) ^ 8 * E := by have h := finite_integrated_energy_le_card_sq μ ((S ×ˢ S) ×ˢ (S ×ˢ S)) (fun p s => f p.1.1 p.1.2 p.2.1 p.2.2 s) E (fun p hp => hf _ (mem_product.mp (mem_product.mp hp).1).1 _ (mem_product.mp (mem_product.mp hp).1).2 _ (mem_product.mp (mem_product.mp hp).2).1 _ (mem_product.mp (mem_product.mp hp).2).2) (fun p hp => hE _ (mem_product.mp (mem_product.mp hp).1).1 _ (mem_product.mp (mem_product.mp hp).1).2 _ (mem_product.mp (mem_product.mp hp).2).1 _ (mem_product.mp (mem_product.mp hp).2).2) simp only [sum_product, card_product, Nat.cast_mul] at h convert h using 1 ring end Bounty end section /- A fixed logarithmic loss for four-coordinate dyadic energy assembly. -/ open Finset Filter namespace Bounty theorem eventually_dyadic_eighth_card_le (C : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ N : ℕ, Real.log N ≤ C * L → ((dyadicNatIndices (Icc 1 N)).card : ℝ) ^ 8 ≤ L ^ 9 := by let K : ℝ := C / Real.log 2 + 1 filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (K ^ 8)] with L hL hK intro N hlog have htwo : 0 < Real.log 2 := Real.log_pos (by norm_num) have hc : ((dyadicNatIndices (Icc 1 N)).card : ℝ) ≤ K * L := by calc _ ≤ Real.log N / Real.log 2 + 1 := dyadicNatIndices_card_le_log (Icc 1 N) N (fun n hn => (mem_Icc.mp hn).2) _ ≤ C * L / Real.log 2 + L := _root_.add_le_add (div_le_div_of_nonneg_right hlog htwo.le) hL _ = K * L := by dsimp [K]; ring calc _ ≤ (K * L) ^ 8 := pow_le_pow_left₀ (Nat.cast_nonneg _) hc 8 _ = K ^ 8 * L ^ 8 := mul_pow _ _ _ _ ≤ L * L ^ 8 := mul_le_mul_of_nonneg_right hK (by positivity) _ = L ^ 9 := by ring end Bounty end section /- Bilinear consequences of the multiplicative large sieve for two independent finite sums. -/ open scoped BigOperators namespace Bounty theorem primitive_character_weighted_cauchy (Q : Finset ℕ) (w : ℕ → ℝ) (hw : ∀ q ∈ Q, 0 ≤ w q) (A B : (q : ℕ) → DirichletCharacter ℂ q → ℝ) : (∑ q ∈ Q, w q * ∑ χ ∈ primitiveCharacters q, A q χ * B q χ) ^ 2 ≤ (∑ q ∈ Q, w q * ∑ χ ∈ primitiveCharacters q, A q χ ^ 2) * ∑ q ∈ Q, w q * ∑ χ ∈ primitiveCharacters q, B q χ ^ 2 := by classical have h := Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul (Q.sigma primitiveCharacters) (r := fun v => w v.1 * (A v.1 v.2 * B v.1 v.2)) (f := fun v => w v.1 * A v.1 v.2 ^ 2) (g := fun v => w v.1 * B v.1 v.2 ^ 2) (fun v hv => mul_nonneg (hw v.1 (Finset.mem_sigma.mp hv).1) (sq_nonneg _)) (fun v hv => mul_nonneg (hw v.1 (Finset.mem_sigma.mp hv).1) (sq_nonneg _)) (fun v _ => le_of_eq (by ring)) simpa only [Finset.sum_sigma, ← Finset.mul_sum] using h section variable (Q : Finset ℕ) {R N M : ℝ} (hR : 1 ≤ R) (hQ0 : ∀ q ∈ Q, 0 < q) (hQR : ∀ q ∈ Q, (q : ℝ) ≤ R) (S T : Finset ℤ) (a b : ℤ → ℂ) (hN : 0 ≤ N) (hM : 0 ≤ M) (hS : ∀ n ∈ S, |(n : ℝ)| ≤ N) (hT : ∀ n ∈ T, |(n : ℝ)| ≤ M) include Q R N M hR hQ0 hQR S T a b hN hM hS hT theorem multiplicative_large_sieve_bilinear_sq : (∑ q ∈ Q, (q : ℝ) / q.totient * ∑ χ ∈ primitiveCharacters q, ‖∑ n ∈ S, a n * χ (n : ZMod q)‖ * ‖∑ n ∈ T, b n * χ (n : ZMod q)‖) ^ 2 ≤ (6 + 8 * Real.pi) ^ 2 * (N + R ^ 2) * (M + R ^ 2) * (∑ n ∈ S, ‖a n‖ ^ 2) * ∑ n ∈ T, ‖b n‖ ^ 2 := by have hA := multiplicative_large_sieve Q hR hQ0 hQR S a hN hS have hB := multiplicative_large_sieve Q hR hQ0 hQR T b hM hT have hcs := primitive_character_weighted_cauchy Q (fun q => (q : ℝ) / q.totient) (fun q _ => by positivity) (fun q χ => ‖∑ n ∈ S, a n * χ (n : ZMod q)‖) (fun q χ => ‖∑ n ∈ T, b n * χ (n : ZMod q)‖) apply hcs.trans calc _ ≤ ((6 + 8 * Real.pi) * (N + R ^ 2) * ∑ n ∈ S, ‖a n‖ ^ 2) * ((6 + 8 * Real.pi) * (M + R ^ 2) * ∑ n ∈ T, ‖b n‖ ^ 2) := mul_le_mul hA hB (by positivity) (by positivity) _ = _ := by ring theorem multiplicative_large_sieve_bilinear : (∑ q ∈ Q, (q : ℝ) / q.totient * ∑ χ ∈ primitiveCharacters q, ‖∑ n ∈ S, a n * χ (n : ZMod q)‖ * ‖∑ n ∈ T, b n * χ (n : ZMod q)‖) ≤ (6 + 8 * Real.pi) * Real.sqrt ((N + R ^ 2) * (M + R ^ 2) * (∑ n ∈ S, ‖a n‖ ^ 2) * ∑ n ∈ T, ‖b n‖ ^ 2) := by have h := Real.le_sqrt_of_sq_le (multiplicative_large_sieve_bilinear_sq Q hR hQ0 hQR S T a b hN hM hS hT) have heq : (6 + 8 * Real.pi) ^ 2 * (N + R ^ 2) * (M + R ^ 2) * (∑ n ∈ S, ‖a n‖ ^ 2) * (∑ n ∈ T, ‖b n‖ ^ 2) = (6 + 8 * Real.pi) ^ 2 * ((N + R ^ 2) * (M + R ^ 2) * (∑ n ∈ S, ‖a n‖ ^ 2) * ∑ n ∈ T, ‖b n‖ ^ 2) := by ring rw [heq, Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq (by positivity : 0 ≤ 6 + 8 * Real.pi)] at h exact h end theorem multiplicative_large_sieve_bilinear_conductors (Q : Finset ℕ) {D R N M : ℝ} (hD : 0 < D) (hR : 1 ≤ R) (hQD : ∀ q ∈ Q, D ≤ (q : ℝ)) (hQR : ∀ q ∈ Q, (q : ℝ) ≤ R) (S T : Finset ℤ) (a b : ℤ → ℂ) (hN : 0 ≤ N) (hM : 0 ≤ M) (hS : ∀ n ∈ S, |(n : ℝ)| ≤ N) (hT : ∀ n ∈ T, |(n : ℝ)| ≤ M) : (∑ q ∈ Q, 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖∑ n ∈ S, a n * χ (n : ZMod q)‖ * ‖∑ n ∈ T, b n * χ (n : ZMod q)‖) ≤ ((6 + 8 * Real.pi) / D) * Real.sqrt ((N + R ^ 2) * (M + R ^ 2) * (∑ n ∈ S, ‖a n‖ ^ 2) * ∑ n ∈ T, ‖b n‖ ^ 2) := by have hQ0 (q : ℕ) (hq : q ∈ Q) : 0 < q := by exact_mod_cast hD.trans_le (hQD q hq) have hweight (q : ℕ) (hq : q ∈ Q) : 1 / (q.totient : ℝ) ≤ ((q : ℝ) / q.totient) / D := by apply (le_div_iff₀ hD).mpr simpa only [div_eq_mul_inv, one_mul, mul_one, mul_comm] using mul_le_mul_of_nonneg_right (hQD q hq) (inv_nonneg.mpr (Nat.cast_nonneg q.totient)) calc _ ≤ ∑ q ∈ Q, D⁻¹ * ((q : ℝ) / q.totient * ∑ χ ∈ primitiveCharacters q, ‖∑ n ∈ S, a n * χ (n : ZMod q)‖ * ‖∑ n ∈ T, b n * χ (n : ZMod q)‖) := by apply Finset.sum_le_sum intro q hq have h := mul_le_mul_of_nonneg_right (hweight q hq) (show 0 ≤ ∑ χ ∈ primitiveCharacters q, ‖∑ n ∈ S, a n * χ (n : ZMod q)‖ * ‖∑ n ∈ T, b n * χ (n : ZMod q)‖ by positivity) convert h using 1; ring _ = D⁻¹ * (∑ q ∈ Q, (q : ℝ) / q.totient * ∑ χ ∈ primitiveCharacters q, ‖∑ n ∈ S, a n * χ (n : ZMod q)‖ * ‖∑ n ∈ T, b n * χ (n : ZMod q)‖) := (Finset.mul_sum ..).symm _ ≤ D⁻¹ * ((6 + 8 * Real.pi) * Real.sqrt ((N + R ^ 2) * (M + R ^ 2) * (∑ n ∈ S, ‖a n‖ ^ 2) * ∑ n ∈ T, ‖b n‖ ^ 2)) := mul_le_mul_of_nonneg_left (multiplicative_large_sieve_bilinear Q hR hQ0 hQR S T a b hN hM hS hT) (inv_nonneg.mpr hD.le) _ = _ := by ring end Bounty end section /- Character and coprimality factors in the actual candidate convolution. -/ open Finset Filter namespace Bounty theorem complex_character_coprime_convolution (S : Finset ℕ) (V : ℕ → Finset ℕ) (a b : ℕ → ℝ) (G : ℕ → ℂ) {d : ℕ} (χ : DirichletCharacter ℂ d) (h : ℕ) : (∑ p ∈ S, (a p : ℂ) * ∑ n ∈ V p, (b n : ℂ) * (if (p*n).Coprime h then χ (p*n : ZMod d) * G (p*n) else 0)) = ∑ p ∈ S.filter (fun p => p.Coprime h), (a p : ℂ) * χ (p : ZMod d) * ∑ n ∈ (V p).filter (fun n => n.Coprime h), (b n : ℂ) * χ (n : ZMod d) * G (p*n) := by classical rw [sum_filter] apply sum_congr rfl intro p _ by_cases hp : p.Coprime h · rw [if_pos hp] rw [sum_filter, mul_sum, mul_sum] apply sum_congr rfl intro n _ by_cases hn : n.Coprime h · have hpn : (p*n).Coprime h := Nat.coprime_mul_iff_left.mpr ⟨hp, hn⟩ rw [if_pos hpn, if_pos hn, map_mul] ring · have hpn : ¬(p*n).Coprime h := fun hpn => hn (Nat.coprime_mul_iff_left.mp hpn).2 simp only [if_neg hpn, if_neg hn, mul_zero] · simp only [Nat.coprime_mul_iff_left, hp, false_and, if_false, mul_zero, sum_const_zero] theorem eventually_candidate_character_coprime_convolution {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar d h : ℕ) (χ : DirichletCharacter ℂ d) (G : ℕ → ℂ), (∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime h), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod d) * G u) = ∑ p ∈ (candidateSmallPSet c L (16 * Real.exp L + 1)).filter (fun p => p.Coprime h), (candidatePWeight c L q p : ℂ) * χ (p : ZMod d) * ∑ n ∈ (arithmeticProductWindow p (Real.exp L)).filter (fun n => n.Coprime h), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod d) * G (p*n) := by filter_upwards [eventually_candidate_coefficient_complex_test hc] with L hL intro q r jStar d h χ G calc _ = ∑ u ∈ arithmeticProductWindow 1 (Real.exp L), (candidateCoefficient c L q r jStar u : ℂ) * (if u.Coprime h then χ (u : ZMod d) * G u else 0) := by rw [sum_filter] apply sum_congr rfl intro u _ split_ifs <;> simp [mul_assoc] _ = ∑ p ∈ candidateSmallPSet c L (16 * Real.exp L + 1), (candidatePWeight c L q p : ℂ) * ∑ n ∈ arithmeticProductWindow p (Real.exp L), (candidateQWeight c L r jStar n : ℂ) * (if (p*n).Coprime h then χ (p*n : ZMod d) * G (p*n) else 0) := by simpa only [Nat.cast_mul] using hL q r jStar (fun u => if u.Coprime h then χ (u : ZMod d) * G u else 0) _ = _ := complex_character_coprime_convolution _ _ _ _ G χ h end Bounty end section /- Exact complex-tested extraction of an actual Q-zero prime slot. -/ open Finset Filter namespace Bounty theorem candidate_Q_zero_complex_window_split (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) (S : Finset ℕ) (F : ℕ → ℂ) : (∑ n ∈ S, (candidateQWeight c L r jStar n : ℂ) * F n) = ∑ p ∈ candidateQBand (c*L) 0, ∑ y : ∀ slot, candidateQRestChoices c L r jStar hr slot, if p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y ∈ S then (1 / (((r.factorial : ℝ)^(candidateQIndices c L).card) : ℂ)) * F (p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y) else 0 := by classical unfold candidateQWeight rw [ordered_slot_complex_window_split_finset _ (candidateFreeSlot c L r hr), candidate_Q_free_choice c L r jStar hr hj] apply sum_congr rfl intro p _ apply sum_congr · rfl · intro y _ have hp : orderedSlotProduct (fun j : {slot : (candidateQIndices c L) × Fin r // slot ≠ candidateFreeSlot c L r hr} => candidateQSlotChoices c L r jStar j.val) y = orderedSlotProduct (candidateQRestChoices c L r jStar hr) y := rfl rw [hp] simp only [Complex.ofReal_pow] end Bounty end section /- All structural vanishing is discharged for the literal asymmetric comparison family. -/ namespace Bounty open Finset open scoped Classical theorem finite_asymmetric_signed_block_envelope {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ y, μ i y = 1) (active U V : Finset I) (hUV : Disjoint U V) (hμnz : ∀ i v, μ i v ≠ 0) (k : (∀ i, X i) → ℂ) (hk : ∀ x, ‖k x‖ ≤ 1) (F : ∀ A B : Finset I, (∀ i : ↥(active \ (A ∪ B)), X i.val) → (∀ i : A, X i.val) → (∀ i : B, X i.val) → ℂ) (f g : (∀ i, X i) → ℂ) (a b θA θB : ℝ) (hf : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) f) ≤ a) (hg : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) g) ≤ b) (hA : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ U U.toList f)) ≤ θA * a) (hB : Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ V V.toList g)) ≤ θB * b) (ε : ℝ) (hε : 0 ≤ ε) (herr : ∀ S ∈ U.powerset, ∀ T ∈ V.powerset, ∀ A ∈ cleanNonemptySubsets (U \ S), ∀ B ∈ cleanNonemptySubsets (V \ T), ‖cleanKernelPairing (finiteProductWeight μ) (finiteAsymmetricComparisonKernel μ active F A B) (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g) - cleanRawPairing (finiteProductWeight μ) k (finiteCoordinateComponent μ S U.toList f) (finiteCoordinateComponent μ T V.toList g)‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ S U.toList f)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ T V.toList g))) : ‖cleanRawPairing (finiteProductWeight μ) k f g - ∑ A ∈ cleanNonemptySubsets U, ∑ B ∈ cleanNonemptySubsets V, (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight μ) (finiteAsymmetricComparisonKernel μ active F A B) f g‖ ≤ (θA + θB + (3 : ℝ) ^ (U.card + V.card) * ε) * a * b := by apply finite_signed_ideal_block_envelope μ hμ hmass U V k hk (finiteAsymmetricComparisonKernel μ active F) f g a b θA θB hf hg hA hB · intro S hS T hT A hA B hB hnot exact finite_asymmetric_comparison_components_zero μ hmass hμnz active U V S T A B hUV (mem_powerset.mp hS) (mem_powerset.mp hT) ((clean_mem_nonempty_subsets U A).mp hA).2 ((clean_mem_nonempty_subsets V B).mp hB).2 F f g hnot · exact hε · exact herr end Bounty end section /- The actual prime comparison kernel inherits exact coordinate annihilation. -/ open scoped BigOperators Classical namespace Bounty noncomputable def primeAsymmetricComparisonKernel {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (active : Finset I) (Q : ℕ) (h : ℝ) (keptA keptB : Finset I → Finset ℤ) (ζ Θ : ℝ) (A B : Finset I) : (∀ i, P i) → (∀ i, P i) → ℂ := finiteAsymmetricComparisonKernel (physicalLabelLaw V) active (fun A B => primeAsymmetricValue P V (active \ (A ∪ B)) A B Q h (keptA A) (keptB B) ζ Θ) A B end Bounty end section /- The actual fixed-target raw edge evaluates the continuation on its full ledger target. Summing every physical target list then gives one bounded endpoint phase, with the continuation unchanged. -/ open Finset open scoped Classical namespace Bounty section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ω : ∀ _c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (F : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) include hP hdis end Physical end Bounty end section /- Supported joint ghost events transport between total-memory caps. The comparison preserves signed coefficients and arbitrary event observables. -/ open Finset Classical namespace Bounty section variable {G : Type*} {P Z : G → Type*} {t : G → ℕ} {b B : ℕ} (h : b ≤ B) def coupledGhostEventCapEmbed (s : ProductBoundedOrderedState P Z t b) (e : CoupledGhostEvent t b s) : CoupledGhostEvent t B (productStateCapEmbed h s) := fun g => boundedGhostEventCapEmbed h (s g) (e g) theorem coupledGhostEventCapEmbed_injective (s : ProductBoundedOrderedState P Z t b) : Function.Injective (coupledGhostEventCapEmbed h s) := by intro e f hef funext g exact boundedGhostEventCapEmbed_injective h (s g) (congrFun hef g) theorem coupledGhostJointEventWeight_support [Fintype G] (A D C ν : ∀ g, Z g → ℝ) (s : ProductBoundedOrderedState P Z t b) (e : CoupledGhostEvent t b s) (hw : coupledGhostJointEventWeight A D C ν t b s e ≠ 0) : (productTotalMemory s ≤ b ∧ productTotalMemory (coupledGhostJointEventTarget t b s e) ≤ b) ∧ ∀ g, boundedGhostEventWeight (A g) (D g) (C g) (ν g) (t g) b (s g) (e g) ≠ 0 := by unfold coupledGhostJointEventWeight at hw split_ifs at hw with hc · exact ⟨hc, fun g => (prod_ne_zero_iff.mp hw) g (mem_univ g)⟩ · exact False.elim (hw rfl) theorem coupledGhostEventCapEmbed_target_of_local_ne_zero (A D C ν : ∀ g, Z g → ℝ) (s : ProductBoundedOrderedState P Z t b) (e : CoupledGhostEvent t b s) (hw : ∀ g, boundedGhostEventWeight (A g) (D g) (C g) (ν g) (t g) b (s g) (e g) ≠ 0) : coupledGhostJointEventTarget t B (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e) = productStateCapEmbed h (coupledGhostJointEventTarget t b s e) := by funext g exact boundedGhostEventCapEmbed_target_of_ne_zero h (A g) (D g) (C g) (ν g) (s g) (e g) (hw g) theorem coupledGhostEventCapEmbed_target_of_ne_zero [Fintype G] (A D C ν : ∀ g, Z g → ℝ) (s : ProductBoundedOrderedState P Z t b) (e : CoupledGhostEvent t b s) (hw : coupledGhostJointEventWeight A D C ν t b s e ≠ 0) : coupledGhostJointEventTarget t B (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e) = productStateCapEmbed h (coupledGhostJointEventTarget t b s e) := by exact coupledGhostEventCapEmbed_target_of_local_ne_zero h A D C ν s e (coupledGhostJointEventWeight_support A D C ν s e hw).2 theorem coupledGhostEventCapEmbed_weight_of_ne_zero [Fintype G] (A D C ν : ∀ g, Z g → ℝ) (s : ProductBoundedOrderedState P Z t b) (e : CoupledGhostEvent t b s) (hw : coupledGhostJointEventWeight A D C ν t b s e ≠ 0) : coupledGhostJointEventWeight A D C ν t B (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e) = coupledGhostJointEventWeight A D C ν t b s e := by obtain ⟨hc, hl⟩ := coupledGhostJointEventWeight_support A D C ν s e hw have ht := coupledGhostEventCapEmbed_target_of_ne_zero h A D C ν s e hw unfold coupledGhostJointEventWeight rw [ht, productStateCapEmbed_totalMemory, productStateCapEmbed_totalMemory, if_pos ⟨hc.1.trans h, hc.2.trans h⟩, if_pos hc] apply prod_congr rfl intro g _ exact boundedGhostEventCapEmbed_weight_of_ne_zero h (A g) (D g) (C g) (ν g) (s g) (e g) (hl g) theorem coupledGhostEventCapEmbed_small_weight_of_large_ne_zero [Fintype G] (A D C ν : ∀ g, Z g → ℝ) (s : ProductBoundedOrderedState P Z t b) (hs : productTotalMemory s ≤ b) (e : CoupledGhostEvent t b s) (hw : coupledGhostJointEventWeight A D C ν t B (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e) ≠ 0) (ht : productTotalMemory (coupledGhostJointEventTarget t B (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e)) ≤ b) : coupledGhostJointEventWeight A D C ν t b s e = coupledGhostJointEventWeight A D C ν t B (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e) := by obtain ⟨hc, hl⟩ := coupledGhostJointEventWeight_support A D C ν (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e) hw have htlocal : ∀ g, (boundedGhostEventTarget (t g) B (boundedStateCapEmbed h (s g)) (boundedGhostEventCapEmbed h (s g) (e g))).2.1.val ≤ b := by intro g exact (single_le_sum (fun j _ => Nat.zero_le _) (mem_univ g)).trans ht have hsmall : ∀ g, boundedGhostEventWeight (A g) (D g) (C g) (ν g) (t g) b (s g) (e g) ≠ 0 := by intro g exact (boundedGhostEventCapEmbed_support h (A g) (D g) (C g) (ν g) (s g) (e g)).mpr ⟨hl g, htlocal g⟩ have htarget := coupledGhostEventCapEmbed_target_of_local_ne_zero h A D C ν s e hsmall have htsmall : productTotalMemory (coupledGhostJointEventTarget t b s e) ≤ b := by rw [htarget, productStateCapEmbed_totalMemory] at ht exact ht unfold coupledGhostJointEventWeight rw [if_pos ⟨hs, htsmall⟩, if_pos hc] apply prod_congr rfl intro g _ exact (boundedGhostEventCapEmbed_weight_of_ne_zero h (A g) (D g) (C g) (ν g) (s g) (e g) (hsmall g)).symm theorem coupledGhostEventCapEmbed_surjective_of_ne_zero [Fintype G] (A D C ν : ∀ g, Z g → ℝ) (s : ProductBoundedOrderedState P Z t b) (e : CoupledGhostEvent t B (productStateCapEmbed h s)) (hw : coupledGhostJointEventWeight A D C ν t B (productStateCapEmbed h s) e ≠ 0) (ht : productTotalMemory (coupledGhostJointEventTarget t B (productStateCapEmbed h s) e) ≤ b) : ∃ d : CoupledGhostEvent t b s, coupledGhostEventCapEmbed h s d = e := by have hl := (coupledGhostJointEventWeight_support A D C ν (productStateCapEmbed h s) e hw).2 have hd : ∀ g, ∃ d : BoundedGhostEvent (t g) b (s g), boundedGhostEventCapEmbed h (s g) d = e g := by intro g apply boundedGhostEventCapEmbed_surjective_of_ne_zero h (A g) (D g) (C g) (ν g) (s g) (e g) (hl g) exact (single_le_sum (fun j _ => Nat.zero_le _) (mem_univ g)).trans ht choose d hd using hd exact ⟨d, funext hd⟩ theorem coupledGhostEventCapEmbed_weight [Fintype G] (A D C ν : ∀ g, Z g → ℝ) (s : ProductBoundedOrderedState P Z t b) (hs : productTotalMemory s ≤ b) (e : CoupledGhostEvent t b s) : coupledGhostJointEventWeight A D C ν t b s e = if productTotalMemory (coupledGhostJointEventTarget t B (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e)) ≤ b then coupledGhostJointEventWeight A D C ν t B (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e) else 0 := by by_cases ht : productTotalMemory (coupledGhostJointEventTarget t B (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e)) ≤ b · rw [if_pos ht] by_cases hw : coupledGhostJointEventWeight A D C ν t B (productStateCapEmbed h s) (coupledGhostEventCapEmbed h s e) = 0 · rw [hw] by_contra hwsmall exact hwsmall ((coupledGhostEventCapEmbed_weight_of_ne_zero h A D C ν s e hwsmall).symm.trans hw) · exact coupledGhostEventCapEmbed_small_weight_of_large_ne_zero h A D C ν s hs e hw ht · rw [if_neg ht] by_contra hwsmall have htarget := coupledGhostEventCapEmbed_target_of_ne_zero h A D C ν s e hwsmall apply ht rw [htarget, productStateCapEmbed_totalMemory] exact (coupledGhostJointEventWeight_support A D C ν s e hwsmall).1.2 end end Bounty end section /- Simultaneous edge transport across memory caps. The source total cap is explicit. The smaller coefficient is the larger one restricted by the larger event's output total, with no condition on signs or positivity. -/ open Finset Classical namespace Bounty def unrestrictedJointEventCapEquiv {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (t : G → ℕ) {b B : ℕ} (h : b ≤ B) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t b) : UnrestrictedJointEvent n Δ D t b s ≃ UnrestrictedJointEvent n Δ D t B (productStateCapEmbed h s) := Equiv.refl _ theorem unrestrictedJointEventTarget_cap_of_local_weights {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) {b B : ℕ} (h : b ≤ B) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t b) (e : UnrestrictedJointEvent n Δ D t b s) (hw : ∀ g, unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) b (s g) (e g) ≠ 0) : productStateCapEmbed h (unrestrictedJointEventTarget n Δ D t b s e) = unrestrictedJointEventTarget n Δ D t B (productStateCapEmbed h s) (unrestrictedJointEventCapEquiv n Δ D t h s e) := by funext g exact unrestrictedBoundedEventTarget_cap_of_weight_ne_zero (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) h (s g) (e g) (hw g) section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Type*} (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) {b B : ℕ} (h : b ≤ B) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t b) include G sharedInstance1 P n Δ D μ ρ V t b B h s theorem unrestrictedJointEventTarget_cap_of_weight_ne_zero (e : UnrestrictedJointEvent n Δ D t b s) (hw : unrestrictedJointCutoffEventWeight n Δ D μ ρ V t b s e ≠ 0) : productStateCapEmbed h (unrestrictedJointEventTarget n Δ D t b s e) = unrestrictedJointEventTarget n Δ D t B (productStateCapEmbed h s) (unrestrictedJointEventCapEquiv n Δ D t h s e) := by apply unrestrictedJointEventTarget_cap_of_local_weights n Δ D μ ρ V t h s e have hp : (∏ g, unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) b (s g) (e g)) ≠ 0 := by intro hz exact hw (by simp only [unrestrictedJointCutoffEventWeight, hz, ite_self]) intro g exact (prod_ne_zero_iff.mp hp) g (mem_univ g) theorem unrestrictedJointCutoffEventWeight_cap (hs : productTotalMemory s ≤ b) (e : UnrestrictedJointEvent n Δ D t b s) : unrestrictedJointCutoffEventWeight n Δ D μ ρ V t b s e = if productTotalMemory (unrestrictedJointEventTarget n Δ D t B (productStateCapEmbed h s) (unrestrictedJointEventCapEquiv n Δ D t h s e)) ≤ b then unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B (productStateCapEmbed h s) (unrestrictedJointEventCapEquiv n Δ D t h s e) else 0 := by have hsB : productTotalMemory (productStateCapEmbed h s) ≤ B := hs.trans h by_cases ht : productTotalMemory (unrestrictedJointEventTarget n Δ D t B (productStateCapEmbed h s) (unrestrictedJointEventCapEquiv n Δ D t h s e)) ≤ b · rw [if_pos ht] have hw (g : G) : unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) b (s g) (e g) = unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (boundedStateCapEmbed h (s g)) (unrestrictedBoundedEventCapEquiv (n g) (Δ g) (D g) (t g) h (s g) (e g)) := by rw [unrestrictedBoundedEventWeight_cap (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) h (s g) (e g)] apply if_pos apply le_trans _ ht exact single_le_sum (f := fun j => (unrestrictedJointEventTarget n Δ D t B (productStateCapEmbed h s) (unrestrictedJointEventCapEquiv n Δ D t h s e) j).2.1.val) (fun _ _ => Nat.zero_le _) (mem_univ g) have hp := prod_congr (s₁ := (univ : Finset G)) rfl (fun g _ => hw g) by_cases hz : (∏ g, unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) b (s g) (e g)) = 0 · have hzB : (∏ g, unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (productStateCapEmbed h s g) (unrestrictedJointEventCapEquiv n Δ D t h s e g)) = 0 := hp.symm.trans hz simp only [unrestrictedJointCutoffEventWeight, hz, hzB, ite_self] · have htarget := unrestrictedJointEventTarget_cap_of_local_weights n Δ D μ ρ V t h s e (fun g => (prod_ne_zero_iff.mp hz) g (mem_univ g)) have hsmall : productTotalMemory (unrestrictedJointEventTarget n Δ D t b s e) ≤ b := by have he := congrArg productTotalMemory htarget exact he.trans_le ht have htB := ht.trans h simp only [unrestrictedJointCutoffEventWeight, hs, hsB, hsmall, htB, and_self, if_true] exact hp · rw [if_neg ht] by_contra hw have he := unrestrictedJointEventTarget_cap_of_weight_ne_zero n Δ D μ ρ V t h s e hw have hsmall : productTotalMemory (unrestrictedJointEventTarget n Δ D t b s e) ≤ b := by by_contra hn exact hw (by simp only [unrestrictedJointCutoffEventWeight, hn, and_false, if_false]) apply ht rw [← he, productStateCapEmbed_totalMemory] exact hsmall end end Bounty end section /- Exact removal of zero-weight event paths in arbitrary phased sums. -/ open Finset Classical namespace Bounty universe uK uX uE noncomputable abbrev finiteNonzeroEventFintype {K : Type uK} {X : Type uX} (E : K → X → Type uE) [∀ k x, Fintype (E k x)] (w : ∀ k x, E k x → ℝ) (k : K) (x : X) : Fintype (FiniteNonzeroEvent E w k x) := inferInstance theorem finite_nonzero_path_forget_injective {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (ks : List K) (x : X) : Function.Injective (finiteNonzeroPathForget E t w ks x) := by intro p q hpq apply (finiteNonzeroPathEquiv E t w ks x).injective exact Subtype.ext hpq theorem finite_event_path_action_nonzero {K : Type uK} {X : Type uX} (E : K → X → Type uE) [∀ k x, Fintype (E k x)] (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (ks : List K) (phase : ∀ x, FiniteEventPath E t ks x → ℂ) (f : X → ℂ) (x : X) : let _ : ∀ k x, Fintype (FiniteNonzeroEvent E w k x) := finiteNonzeroEventFintype E w finiteEventPathAction E t w ks phase f x = finiteEventPathAction (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) (fun k x a => w k x a.val) ks (fun x p => phase x (finiteNonzeroPathForget E t w ks x p)) f x := by let _ : ∀ k x, Fintype (FiniteNonzeroEvent E w k x) := finiteNonzeroEventFintype E w let _ := finiteEventPathFintype E t ks x let _ := finiteEventPathFintype (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) ks x have h := Fintype.sum_of_injective (finiteNonzeroPathForget E t w ks x) (finite_nonzero_path_forget_injective E t w ks x) (fun p => (finiteEventPathWeight (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) (fun k x a => w k x a.val) ks x p : ℂ) * phase x (finiteNonzeroPathForget E t w ks x p) * f (finiteEventPathTerminal (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) ks x p)) (fun p => (finiteEventPathWeight E t w ks x p : ℂ) * phase x p * f (finiteEventPathTerminal E t ks x p)) (by intro p hp have hw : finiteEventPathWeight E t w ks x p = 0 := by by_contra hne exact hp ⟨finiteNonzeroPathLift E t w ks x p hne, finite_nonzero_path_forget_lift E t w ks x p hne⟩ simp only [hw, Complex.ofReal_zero, zero_mul]) (by intro p rw [finite_nonzero_path_weight, finite_nonzero_path_terminal]) exact h.symm end Bounty end section /- Exact restriction of arbitrary phased sums to selected events. -/ open Finset Classical namespace Bounty universe uK uX uE noncomputable abbrev finiteSelectedEventFintype {K : Type uK} {X : Type uX} (E : K → X → Type uE) [∀ k x, Fintype (E k x)] (Q : ∀ k x, E k x → Prop) (k : K) (x : X) : Fintype (FiniteSelectedEvent E Q k x) := inferInstance theorem finite_selected_path_forget_injective {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (Q : ∀ k x, E k x → Prop) (ks : List K) (x : X) : Function.Injective (finiteSelectedPathForget E t Q ks x) := by intro p q hpq apply (finiteSelectedPathEquiv E t Q ks x).injective exact Subtype.ext hpq theorem finite_event_path_action_selected {K : Type uK} {X : Type uX} (E : K → X → Type uE) [∀ k x, Fintype (E k x)] (t : ∀ k x, E k x → X) (Q : ∀ k x, E k x → Prop) (w : ∀ k x, E k x → ℝ) (ks : List K) (phase : ∀ x, FiniteEventPath E t ks x → ℂ) (f : X → ℂ) (x : X) : let _ : ∀ k x, Fintype (FiniteSelectedEvent E Q k x) := finiteSelectedEventFintype E Q finiteEventPathAction E t w ks (fun x p => if FiniteEventPathSelected E t Q ks x p then phase x p else 0) f x = finiteEventPathAction (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) (fun k x a => w k x a.val) ks (fun x p => phase x (finiteSelectedPathForget E t Q ks x p)) f x := by let _ : ∀ k x, Fintype (FiniteSelectedEvent E Q k x) := finiteSelectedEventFintype E Q let _ := finiteEventPathFintype E t ks x let _ := finiteEventPathFintype (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x have h := Fintype.sum_of_injective (finiteSelectedPathForget E t Q ks x) (finite_selected_path_forget_injective E t Q ks x) (fun p => (finiteEventPathWeight (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) (fun k x a => w k x a.val) ks x p : ℂ) * phase x (finiteSelectedPathForget E t Q ks x p) * f (finiteEventPathTerminal (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x p)) (fun p => (finiteEventPathWeight E t w ks x p : ℂ) * (if FiniteEventPathSelected E t Q ks x p then phase x p else 0) * f (finiteEventPathTerminal E t ks x p)) (by intro p hp have hn : ¬ FiniteEventPathSelected E t Q ks x p := by intro hsel exact hp ⟨finiteSelectedPathLift E t Q ks x p hsel, finite_selected_path_forget_lift E t Q ks x p hsel⟩ simp only [if_neg hn, mul_zero, zero_mul]) (by intro p rw [if_pos (finite_selected_path_selected E t Q ks x p), finite_selected_path_weight, finite_selected_path_terminal]) exact h.symm end Bounty end section /- Eventual arbitrary-test comparison with actual retained prime-product kernels. -/ open Filter open scoped BigOperators Classical universe u namespace Bounty theorem eventually_prime_arbitrary_test_comparison (hZ : PrimitiveZeroFreeHalfPlane) (c κ s z v B : ℝ) (hc : 0 < c) (hκ : 0 ≤ κ) (hs : 0 ≤ s) (hz : 0 ≤ z) (hB : 0 ≤ B) : let A := B + 2 * (s + 1) let q := 2 * κ + (s + 1) + 2 * A + 3 let w := 4 * q + max z q + A + 2 let x := (s + w + 2) + 2 * A + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {I J : Type u} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I) (R : J → Finset ℕ) (W : J → ℝ) (j : J), (∀ k, 0 < V k) → (∀ k, 0 < W k) → (∀ k p, p ∈ P k → p.Prime ∧ Q < p) → (∀ k p, p ∈ R k → p.Prime ∧ Q < p) → (∀ k, ∑ p ∈ P k, 1 / (p : ℝ) = V k) → (∀ k, ∑ p ∈ R k, 1 / (p : ℝ) = W k) → L ^ (-v) ≤ V i → L ^ (-v) ≤ W j → ∀ a b a' b' : ℝ, P i = primeBand a b → R j = primeBand a' b' → Real.exp (L ^ c) ≤ a → 0 ≤ b → Real.exp (L ^ c) ≤ a' → 0 ≤ b' → (∀ t : (∀ k, P k), Real.log (∏ k, (t k).val : ℕ) ≤ L ^ s) → (∀ t : (∀ k, R k), Real.log (∏ k, (t k).val : ℕ) ≤ L ^ s) → (∀ m : ℕ, (∑ t ∈ Finset.univ.filter (fun t : (∀ k, P k) => (∏ k, (t k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw V) t) ≤ L ^ κ / (m : ℝ)) → (∀ m : ℕ, (∑ t ∈ Finset.univ.filter (fun t : (∀ k, R k) => (∏ k, (t k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw W) t) ≤ L ^ κ / (m : ℝ)) → ∀ (f : (∀ k, P k) → ℂ) (g : (∀ k, R k) → ℂ), ∀ α ζ : ℝ, |ζ| ≤ L ^ z → let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) let phase := fun (t : ∀ k, P k) (r : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (t k).val : ℕ) : ℝ) * (∏ k, (r k).val : ℕ)) + 2 * Real.pi * (α * (((∏ k, (t k).val : ℕ) : ℝ) * (∏ k, (r k).val : ℕ))) : ℝ)) ‖∑ t, ∑ r, ((μ t * ν r : ℝ) : ℂ) * ((phase t r - finiteTwoKernelAverage μ ν KA KB t r phase) * f t * g r)‖ ≤ L ^ (-B) * Real.sqrt ((∑ t, μ t * ‖f t‖ ^ 2) * ∑ r, ν r * ‖g r‖ ^ 2) := by intro A q w x let n := s + w + 2 let d := q + A + 2 have hA : 0 ≤ A := by dsimp only [A]; positivity have hq : 0 ≤ q := by dsimp only [q]; positivity have hw : 1 ≤ w := by have hmax : 0 ≤ max z q := hz.trans (le_max_left _ _) dsimp only [w] linarith have hd : 0 ≤ d := by dsimp only [d]; positivity obtain ⟨CM, CE, hCM, hCE, hbound⟩ := prime_all_frequency_dyadic_pairing.{u} hZ filter_upwards [eventually_ge_atTop (512 : ℝ), eventually_prime_kernel_error_and_energy_small c CM q v x d hc hCM hd, eventually_prime_kernel_error_and_energy_small c CE q v x d hc hCE hd, eventually_prime_band_product_scale.{u} hc q] with L hL hM hE hprod intro Q h ξ I J _ _ _ _ P V i R W j hV hW hP hR hVP hWR hVi hWj a b a' b' hPi hRj ha hb ha' hb' hmaxP hmaxR hμatom hνatom f g α ζ hζ let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let π := fun t : ∀ k, P k => (∏ k, (t k).val : ℕ) let τ := fun t : ∀ k, R k => (∏ k, (t k).val : ℕ) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) let phase := fun (t : ∀ k, P k) (r : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log ((π t : ℝ) * τ r) + 2 * Real.pi * (α * ((π t : ℝ) * τ r)) : ℝ)) let K := fun t r => phase t r - finiteTwoKernelAverage μ ν KA KB t r phase have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hQ : 0 < Q := Nat.floor_pos.mpr (Real.one_le_rpow hL1 hq) have hQb : (Q : ℝ) ≤ L ^ q := Nat.floor_le (Real.rpow_pos_of_pos hL0 q).le have hh : 0 < h := Real.rpow_pos_of_pos hL0 _ have hξ : 0 < ξ := Real.rpow_pos_of_pos hL0 _ have hh2 : h ≤ Real.log 2 := polynomial_width_le_log_two (by linarith) hw have ha2 : 2 ≤ a := by have he : 2 ≤ Real.exp (L ^ c) := by calc 2 ≤ Real.exp 1 := by linarith [Real.add_one_le_exp (1 : ℝ)] _ ≤ Real.exp (L ^ c) := Real.exp_le_exp.mpr (Real.one_le_rpow hL1 hc.le) exact he.trans ha have ha2' : 2 ≤ a' := by have he : 2 ≤ Real.exp (L ^ c) := by calc 2 ≤ Real.exp 1 := by linarith [Real.add_one_le_exp (1 : ℝ)] _ ≤ Real.exp (L ^ c) := Real.exp_le_exp.mpr (Real.one_le_rpow hL1 hc.le) exact he.trans ha' have hμ (t : ∀ k, P k) : 0 ≤ μ t := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg V (fun k => (hV k).le) k (t k)) have hν (t : ∀ k, R k) : 0 ≤ ν t := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg W (fun k => (hW k).le) k (t k)) have hπ (t : ∀ k, P k) : 0 < π t := Finset.prod_pos (fun k _ => (hP k (t k).val (t k).property).1.pos) have hτ (t : ∀ k, R k) : 0 < τ t := Finset.prod_pos (fun k _ => (hR k (t k).val (t k).property).1.pos) have hlogP (t : ∀ k, P k) : 0 ≤ Real.log (π t) ∧ Real.log (π t) ≤ L ^ s := ⟨Real.log_nonneg (by exact_mod_cast hπ t), hmaxP t⟩ have hlogR (t : ∀ k, R k) : 0 ≤ Real.log (τ t) ∧ Real.log (τ t) ≤ L ^ s := ⟨Real.log_nonneg (by exact_mod_cast hτ t), hmaxR t⟩ have hcells := two_upper_log_cell_cards_polynomial (fun t => Real.log (π t)) (fun t => Real.log (τ t)) (by linarith : 4 ≤ L) hs (show 0 ≤ w by linarith) hlogP hlogR have hminP := hprod P i (fun k p hp => (hP k p hp).1.pos) a b hPi ha hb have hminR := hprod R j (fun k p hp => (hR k p hp).1.pos) a' b' hRj ha' hb' have hMP := (hM Q (V i) ξ a hQ hQb hVi le_rfl ha).1 have hMR := (hM Q (W j) ξ a' hQ hQb hWj le_rfl ha').1 have hEP := (hE Q (V i) ξ a hQ hQb hVi le_rfl ha).2 have hER := (hE Q (W j) ξ a' hQ hQb hWj le_rfl ha').2 change ‖∑ t, ∑ r, ((μ t * ν r : ℝ) : ℂ) * (K t r * f t * g r)‖ ≤ _ rw [finite_weighted_pairing_reorder] apply finite_dyadic_pairing_polynomial_bound π τ μ ν hμ hν f g K hL0 (finite_dyadic_card_polynomial π hπ (by linarith) hs hmaxP) (finite_dyadic_card_polynomial τ hτ (by linarith) hs hmaxR) intro k _ l _ by_cases hfk : ∃ t, finiteDyadicTest π k f t ≠ 0 · by_cases hgl : ∃ r, finiteDyadicTest τ l g r ≠ 0 · have hU := finite_dyadic_endpoint_scales π f hπ (fun t _ => hminP t) hmaxP hfk have hT := finite_dyadic_endpoint_scales τ g hτ (fun t _ => hminR t) hmaxR hgl have hlog := dyadic_log_product_polynomial (show (0 : ℝ) < (2 ^ k : ℕ) by positivity) (show (0 : ℝ) < (2 ^ l : ℕ) by positivity) (by linarith : 2 ≤ L) hU.2 hT.2 have hp := hbound L q κ (s + 1) n x w z d A hL hq (by positivity) hd (by dsimp only [q]; linarith) (by dsimp only [x, n]; linarith) (by dsimp only [w]; linarith) (by dsimp only [d]; linarith) Q rfl hQ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha2 hb ha2' hb' h ξ hh hh2 hξ le_rfl le_rfl hEP hER hMP hMR hcells (2 ^ k) (2 ^ l) hU.1 hT.1 hlog (finiteDyadicTest π k f) (finiteDyadicTest τ l g) (finite_dyadic_test_range π f (fun t _ => hπ t) k) (finite_dyadic_test_range τ g (fun r _ => hτ r) l) (L ^ κ) (L ^ κ) (by positivity) (by positivity) le_rfl le_rfl hμatom hνatom α ζ hζ have he : -B - (s + 1) - (s + 1) = -A := by dsimp only [A]; ring rw [he, ← finite_weighted_pairing_reorder] exact hp · have hg0 : ∀ r, finiteDyadicTest τ l g r = 0 := by intro r by_contra hn exact hgl ⟨r, hn⟩ simp [hg0] · have hf0 : ∀ t, finiteDyadicTest π k f t = 0 := by intro t by_contra hn exact hfk ⟨t, hn⟩ simp [hf0] end Bounty end section /- Position-dependent observation records are transported through a named finite schedule. Both the schedule position and its original event choices remain available to the arbitrary terminal record condition. -/ namespace Bounty section Schedule variable {K X O : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (phase : ∀ k x, E k x → ℂ) (tag : ℕ → K) (observe : ∀ i x, E (tag i) x → O) noncomputable def finiteRecordedSchedulePhase (steps : ℕ) (initial : X → List O) (F : List O → X → ℂ) (x : X) (p : FiniteEventPath E target ((List.range steps).map tag) x) : ℂ := finiteRecordedPathPhase (fun i => E (tag i)) (fun i => target (tag i)) (fun i => phase (tag i)) observe (List.range steps) initial F x ((finiteEventPathMapEquiv E target tag (List.range steps) x).symm p) variable [∀ k x, Fintype (E k x)] (weight : ∀ k x, E k x → ℝ) end Schedule end Bounty end section /- A predicate tested against each chronological observation is exactly a local event filter. Fixed recorded trajectories can therefore be selected without introducing a norm or measure on the record space. -/ open Finset Classical namespace Bounty section variable {K X O : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (observe : ∀ k x, E k x → O) theorem finite_event_path_observations_forall₂ (test : K → O → Prop) (ks : List K) (x : X) (p : FiniteEventPath E target ks x) : List.Forall₂ test ks (finiteEventPathObservations E target observe ks x p) ↔ finiteEventPathAllowed E target (fun k x e => test k (observe k x e)) ks x p := by induction ks generalizing x with | nil => simp [finiteEventPathObservations, finiteEventPathAllowed] | cons k ks ih => rcases p with ⟨e, p⟩ simpa only [finiteEventPathObservations, List.forall₂_cons, finiteEventPathAllowed] using and_congr Iff.rfl (ih (target k x e) p) omit observe in theorem finite_event_local_phase_filter (phase : ∀ k x, E k x → ℂ) (allowed : ∀ k x, E k x → Prop) (ks : List K) (x : X) (p : FiniteEventPath E target ks x) : finiteEventLocalPhase E target (fun k x e => if allowed k x e then phase k x e else 0) ks x p = if finiteEventPathAllowed E target allowed ks x p then finiteEventLocalPhase E target phase ks x p else 0 := by induction ks generalizing x with | nil => simp [finiteEventLocalPhase, finiteEventPathAllowed] | cons k ks ih => rcases p with ⟨e, p⟩ simp only [finiteEventLocalPhase, finiteEventPathAllowed, ih] split_ifs <;> simp_all variable [∀ k x, Fintype (E k x)] end end Bounty end section /- Conditional prime-sum estimates with an explicit zero-free boundary. -/ namespace Bounty open OAI.Ostmann theorem primitive_smoothed_estimate_right_of (b σ : ℝ) (hb : 7 / 8 ≤ b) (hbσ : b < σ) (hσ1 : σ < 1) (hZ : PrimitiveZeroFreeRightOf b) : ∃ C : ℝ, 0 < C ∧ ∀ (χ : PrimitiveComplexCharacter) (x : ℝ), 2 ≤ x → ‖smoothedTwistedPsi χ.character x‖ ≤ C * x ^ σ * Real.log ((χ.modulus : ℝ) * x) := by obtain ⟨D, hD, hbound⟩ := character_riesz_bound_right_of b σ hb hbσ hσ1 hZ refine ⟨12 * D, by positivity, ?_⟩ intro χ x hx rw [smoothedTwistedPsi_eq_riesz χ (by linarith)] have hl := riesz_conductor_log_bound (q := (χ.modulus : ℝ)) (by exact_mod_cast χ.positive) hx calc _ ≤ D * x ^ σ * (1 + Real.log (24 * (χ.modulus : ℝ) * (x ^ 2 + 2))) := hbound χ x hx _ ≤ D * x ^ σ * (12 * Real.log ((χ.modulus : ℝ) * x)) := by gcongr _ = _ := by ring theorem primitive_twistedPsi_power_saving_right_of (b : ℝ) (hb : 7 / 8 ≤ b) (hb1 : b < 1) (hZ : PrimitiveZeroFreeRightOf b) : ∃ C : ℝ, 0 < C ∧ ∀ (χ : PrimitiveComplexCharacter) (x : ℝ), 2 ≤ x → ‖twistedPsi χ.character x‖ ≤ C * x ^ ((3 + b) / 4) * Real.log ((χ.modulus : ℝ) * x) := by obtain ⟨C, hC, hbound⟩ := primitive_smoothed_estimate_right_of b ((1 + b) / 2) hb (by linarith) (by linarith) hZ refine ⟨28 * C + 6, by positivity, ?_⟩ intro χ x hx have heq : (1 + (1 + b) / 2) / 2 = (3 + b) / 4 := by ring have h := twistedPsi_bound_of_smoothed_exponent (θ := (1 + b) / 2) (by linarith) (by linarith) χ.character χ.positive hC (hbound χ) hx simpa only [heq] using h theorem primitive_twistedPsi_power_saving_23_24 (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (χ : PrimitiveComplexCharacter) (x : ℝ), 2 ≤ x → ‖twistedPsi χ.character x‖ ≤ C * x ^ ((95 : ℝ) / 96) * Real.log ((χ.modulus : ℝ) * x) := by have h := primitive_twistedPsi_power_saving_right_of (23 / 24) (by norm_num) (by norm_num) hZ norm_num only at h ⊢ exact h end Bounty end section /- Actual averaged components factor through the coordinates they retain. -/ open Finset open scoped BigOperators Classical namespace Bounty variable {I : Type*} {X : I → Type*} theorem finite_product_nonempty_of_mass_one [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ v, μ i v = 1) : Nonempty (∀ i, X i) := by have hx (i : I) : Nonempty (X i) := by by_contra h let _ : IsEmpty (X i) := not_nonempty_iff.mp h have hm := hmass i simp at hm exact ⟨fun i => Classical.choice (hx i)⟩ variable [Fintype I] [DecidableEq I] theorem finite_four_function_factors_shared_b {Y : Type*} (shared A B tail : Finset I) (hsA : Disjoint shared A) (hsB : Disjoint shared B) (hsT : Disjoint shared tail) (hAB : Disjoint A B) (hAT : Disjoint A tail) (hBT : Disjoint B tail) (hcover : shared ∪ A ∪ B ∪ tail = univ) (f : (∀ i, X i) → Y) (x0 : ∀ i, X i) (hf : ∀ i ∈ A ∪ tail, ∀ x v, f (Function.update x i v) = f x) : ∃ F : (∀ i : shared, X i.1) → (∀ i : B, X i.1) → Y, ∀ x, f x = F (finiteCoordinateRestrict shared x) (finiteCoordinateRestrict B x) := by let E := finiteFourPartitionEquiv (X := X) shared A B tail hsA hsB hsT hAB hAT hBT hcover refine ⟨fun s b => f (E.symm (s, finiteCoordinateRestrict A x0, b, finiteCoordinateRestrict tail x0)), ?_⟩ intro x apply finite_function_eq_of_coordinate_invariance (shared ∪ B) f · intro i hi y v have hall : i ∈ shared ∪ A ∪ B ∪ tail := by rw [hcover]; exact mem_univ i have hsi : i ∉ shared := fun hs => hi (mem_union_left B hs) have hbi : i ∉ B := fun hb => hi (mem_union_right shared hb) have hait : i ∈ A ∪ tail := by simpa [hsi, hbi] using hall exact hf i hait y v · intro i hi have he := E.apply_symm_apply (finiteCoordinateRestrict shared x, finiteCoordinateRestrict A x0, finiteCoordinateRestrict B x, finiteCoordinateRestrict tail x0) rcases mem_union.mp hi with hs | hb · exact (congrFun (congrArg Prod.fst he) ⟨i, hs⟩).symm · exact (congrFun (congrArg (fun q => q.2.2.1) he) ⟨i, hb⟩).symm theorem finite_four_function_factors_shared_a {Y : Type*} (shared A B tail : Finset I) (hsA : Disjoint shared A) (hsB : Disjoint shared B) (hsT : Disjoint shared tail) (hAB : Disjoint A B) (hAT : Disjoint A tail) (hBT : Disjoint B tail) (hcover : shared ∪ A ∪ B ∪ tail = univ) (f : (∀ i, X i) → Y) (x0 : ∀ i, X i) (hf : ∀ i ∈ B ∪ tail, ∀ x v, f (Function.update x i v) = f x) : ∃ F : (∀ i : shared, X i.1) → (∀ i : A, X i.1) → Y, ∀ x, f x = F (finiteCoordinateRestrict shared x) (finiteCoordinateRestrict A x) := by let E := finiteFourPartitionEquiv (X := X) shared A B tail hsA hsB hsT hAB hAT hBT hcover refine ⟨fun s a => f (E.symm (s, a, finiteCoordinateRestrict B x0, finiteCoordinateRestrict tail x0)), ?_⟩ intro x apply finite_function_eq_of_coordinate_invariance (shared ∪ A) f · intro i hi y v have hall : i ∈ shared ∪ A ∪ B ∪ tail := by rw [hcover]; exact mem_univ i have hsi : i ∉ shared := fun hs => hi (mem_union_left A hs) have hai : i ∉ A := fun ha => hi (mem_union_right shared ha) have hbit : i ∈ B ∪ tail := by simpa [hsi, hai] using hall exact hf i hbit y v · intro i hi have he := E.apply_symm_apply (finiteCoordinateRestrict shared x, finiteCoordinateRestrict A x, finiteCoordinateRestrict B x0, finiteCoordinateRestrict tail x0) rcases mem_union.mp hi with hs | ha · exact (congrFun (congrArg Prod.fst he) ⟨i, hs⟩).symm · exact (congrFun (congrArg (fun q => q.2.1) he) ⟨i, ha⟩).symm theorem finite_four_component_factors_shared_b [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ v, μ i v = 1) (shared A B tail : Finset I) (hsA : Disjoint shared A) (hsB : Disjoint shared B) (hsT : Disjoint shared tail) (hAB : Disjoint A B) (hAT : Disjoint A tail) (hBT : Disjoint B tail) (hcover : shared ∪ A ∪ B ∪ tail = univ) (U S0 : Finset I) (hA : A ⊆ U \ S0) (f : (∀ i, X i) → ℂ) : ∃ F : (∀ i : shared, X i.1) → (∀ i : B, X i.1) → ℂ, ∀ x, finiteCoordinateComponent μ S0 U.toList (finiteCoordinateComponent μ ∅ tail.toList f) x = F (finiteCoordinateRestrict shared x) (finiteCoordinateRestrict B x) := by obtain ⟨x0⟩ := finite_product_nonempty_of_mass_one μ hmass apply finite_four_function_factors_shared_b shared A B tail hsA hsB hsT hAB hAT hBT hcover (finiteCoordinateComponent μ S0 U.toList (finiteCoordinateComponent μ ∅ tail.toList f)) x0 intro i hi x v rcases mem_union.mp hi with hiA | hiT · exact finite_component_missing_invariant μ hmass U S0 i (hA hiA) (finiteCoordinateComponent μ ∅ tail.toList f) x v · exact finite_component_tail_invariant μ hmass U S0 tail i hiT f x v theorem finite_four_component_factors_shared_a [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ v, μ i v = 1) (shared A B tail : Finset I) (hsA : Disjoint shared A) (hsB : Disjoint shared B) (hsT : Disjoint shared tail) (hAB : Disjoint A B) (hAT : Disjoint A tail) (hBT : Disjoint B tail) (hcover : shared ∪ A ∪ B ∪ tail = univ) (V T0 : Finset I) (hB : B ⊆ V \ T0) (f : (∀ i, X i) → ℂ) : ∃ F : (∀ i : shared, X i.1) → (∀ i : A, X i.1) → ℂ, ∀ x, finiteCoordinateComponent μ T0 V.toList (finiteCoordinateComponent μ ∅ tail.toList f) x = F (finiteCoordinateRestrict shared x) (finiteCoordinateRestrict A x) := by obtain ⟨x0⟩ := finite_product_nonempty_of_mass_one μ hmass apply finite_four_function_factors_shared_a shared A B tail hsA hsB hsT hAB hAT hBT hcover (finiteCoordinateComponent μ T0 V.toList (finiteCoordinateComponent μ ∅ tail.toList f)) x0 intro i hi x v rcases mem_union.mp hi with hiB | hiT · exact finite_component_missing_invariant μ hmass V T0 i (hB hiB) (finiteCoordinateComponent μ ∅ tail.toList f) x v · exact finite_component_tail_invariant μ hmass V T0 tail i hiT f x v end Bounty end section /- Shared-label averaging recovers the original norms in the asymmetric pairing. -/ namespace Bounty open Finset open scoped Classical theorem finite_three_way_source_energy {C A B : Type*} [Fintype C] [Fintype A] [Fintype B] (ρ : C → ℝ) (μ : A → ℝ) (ν : B → ℝ) (hμ : ∑ a, μ a = 1) (F : C → B → ℂ) : finiteWeightedEnergy (fun x : C × A × B => ρ x.1 * μ x.2.1 * ν x.2.2) (fun x => F x.1 x.2.2) = ∑ c, ρ c * finiteWeightedEnergy ν (F c) := by simp only [finiteWeightedEnergy, Fintype.sum_prod_type] apply sum_congr rfl intro c _ rw [sum_comm, mul_sum] apply sum_congr rfl intro b _ calc _ = (∑ a, μ a) * (ρ c * (ν b * ‖F c b‖ ^ 2)) := by rw [sum_mul] apply sum_congr rfl intro a _ ring _ = _ := by rw [hμ, one_mul] theorem finite_three_way_target_energy {C A B : Type*} [Fintype C] [Fintype A] [Fintype B] (ρ : C → ℝ) (μ : A → ℝ) (ν : B → ℝ) (hν : ∑ b, ν b = 1) (G : C → A → ℂ) : finiteWeightedEnergy (fun x : C × A × B => ρ x.1 * μ x.2.1 * ν x.2.2) (fun x => G x.1 x.2.1) = ∑ c, ρ c * finiteWeightedEnergy μ (G c) := by simp only [finiteWeightedEnergy, Fintype.sum_prod_type] apply sum_congr rfl intro c _ rw [mul_sum] apply sum_congr rfl intro a _ calc _ = (∑ b, ν b) * (ρ c * (μ a * ‖G c a‖ ^ 2)) := by rw [sum_mul] apply sum_congr rfl intro b _ ring _ = _ := by rw [hν, one_mul] theorem finite_three_way_pairing_error_identity {C A B : Type*} [Fintype C] [DecidableEq C] [Fintype A] [Fintype B] (ρ : C → ℝ) (μ : A → ℝ) (ν : B → ℝ) (hμ : ∑ a, μ a = 1) (hν : ∑ b, ν b = 1) (KA : A → A → ℂ) (KB : B → B → ℂ) (phase : C → A → B → ℂ) (F : C → B → ℂ) (G : C → A → ℂ) : cleanRawPairing (fun x : C × A × B => ρ x.1 * μ x.2.1 * ν x.2.2) (fun x => phase x.1 x.2.1 x.2.2) (fun x => F x.1 x.2.2) (fun x => G x.1 x.2.1) - cleanKernelPairing (fun x : C × A × B => ρ x.1 * μ x.2.1 * ν x.2.2) (finiteThreeWayKernel μ ν (fun c a b => finiteTwoKernelAverage μ ν KA KB a b (phase c))) (fun x => F x.1 x.2.2) (fun x => G x.1 x.2.1) = ∑ c, (ρ c : ℂ) * finiteTwoKernelPairingError μ ν KA KB (phase c) (G c) (fun b => (starRingEnd ℂ) (F c b)) := by rw [finite_three_way_raw_pairing, finite_three_way_kernel_pairing ρ μ ν hμ hν, ← sum_sub_distrib] apply sum_congr rfl intro c _ rw [← mul_sub] congr 1 rw [← sum_sub_distrib] unfold finiteTwoKernelPairingError apply sum_congr rfl intro a _ rw [← sum_sub_distrib] apply sum_congr rfl intro b _ ring theorem finite_three_way_pairing_error_le {C A B : Type*} [Fintype C] [DecidableEq C] [Fintype A] [Fintype B] (ρ : C → ℝ) (μ : A → ℝ) (ν : B → ℝ) (hρ : ∀ c, 0 ≤ ρ c) (hμ : ∀ a, 0 ≤ μ a) (hν : ∀ b, 0 ≤ ν b) (hmμ : ∑ a, μ a = 1) (hmν : ∑ b, ν b = 1) (KA : A → A → ℂ) (KB : B → B → ℂ) (phase : C → A → B → ℂ) (F : C → B → ℂ) (G : C → A → ℂ) (ε : ℝ) (hε : 0 ≤ ε) (herr : ∀ c, ‖finiteTwoKernelPairingError μ ν KA KB (phase c) (G c) (fun b => (starRingEnd ℂ) (F c b))‖ ≤ ε * Real.sqrt (finiteWeightedEnergy μ (G c)) * Real.sqrt (finiteWeightedEnergy ν (F c))) : ‖cleanRawPairing (fun x : C × A × B => ρ x.1 * μ x.2.1 * ν x.2.2) (fun x => phase x.1 x.2.1 x.2.2) (fun x => F x.1 x.2.2) (fun x => G x.1 x.2.1) - cleanKernelPairing (fun x : C × A × B => ρ x.1 * μ x.2.1 * ν x.2.2) (finiteThreeWayKernel μ ν (fun c a b => finiteTwoKernelAverage μ ν KA KB a b (phase c))) (fun x => F x.1 x.2.2) (fun x => G x.1 x.2.1)‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (fun x : C × A × B => ρ x.1 * μ x.2.1 * ν x.2.2) (fun x => F x.1 x.2.2)) * Real.sqrt (finiteWeightedEnergy (fun x : C × A × B => ρ x.1 * μ x.2.1 * ν x.2.2) (fun x => G x.1 x.2.1)) := by rw [finite_three_way_pairing_error_identity ρ μ ν hmμ hmν, finite_three_way_source_energy ρ μ ν hmμ, finite_three_way_target_energy ρ μ ν hmν] have hb := finite_shared_two_kernel_error_bound ρ μ ν hρ hμ hν KA KB phase G (fun c b => (starRingEnd ℂ) (F c b)) ε hε (by simpa only [finiteWeightedEnergy, Complex.norm_conj] using herr) simpa only [finiteWeightedEnergy, Complex.norm_conj, mul_assoc, mul_comm, mul_left_comm] using hb end Bounty end section /- Exact transport of the literal asymmetric row to shared/free/tail coordinates. -/ namespace Bounty open Finset open scoped Classical theorem finite_four_partition_compl_shared {I : Type*} [Fintype I] [DecidableEq I] (S A B T : Finset I) (hSA : Disjoint S A) (hSB : Disjoint S B) (hST : Disjoint S T) (hcover : S ∪ A ∪ B ∪ T = univ) : Sᶜ = A ∪ B ∪ T := by ext i constructor · intro hi have hc : i ∈ S ∪ A ∪ B ∪ T := by rw [hcover]; exact mem_univ i simpa only [mem_union, mem_compl.mp hi, false_or] using hc · intro hi apply mem_compl.mpr intro hs rcases mem_union.mp hi with hab | ht · rcases mem_union.mp hab with ha | hb · exact disjoint_left.mp hSA hs ha · exact disjoint_left.mp hSB hs hb · exact disjoint_left.mp hST hs ht theorem finite_fresh_mass_four_partition {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (μ : ∀ i, X i → ℝ) (S A B T : Finset I) (hSA : Disjoint S A) (hSB : Disjoint S B) (hST : Disjoint S T) (hAB : Disjoint A B) (hAT : Disjoint A T) (hBT : Disjoint B T) (hcover : S ∪ A ∪ B ∪ T = univ) (x : ∀ i, X i) : finiteFreshMass μ S x = finiteProductWeight (fun i : A => μ i.1) (finiteCoordinateRestrict A x) * finiteProductWeight (fun i : B => μ i.1) (finiteCoordinateRestrict B x) * finiteProductWeight (fun i : T => μ i.1) (finiteCoordinateRestrict T x) := by unfold finiteFreshMass finiteProductWeight finiteCoordinateRestrict rw [finite_four_partition_compl_shared S A B T hSA hSB hST hcover, prod_union (disjoint_union_left.mpr ⟨hAT, hBT⟩), prod_union hAB] rw [prod_coe_sort A (fun i => μ i (x i)), prod_coe_sort B (fun i => μ i (x i)), prod_coe_sort T (fun i => μ i (x i))] theorem finite_shared_compatible_iff_restrict {I : Type*} {X : I → Type*} (S : Finset I) (x y : ∀ i, X i) : finiteSharedCompatible S x y ↔ finiteCoordinateRestrict S x = finiteCoordinateRestrict S y := by constructor · intro h funext i exact h i.val i.property · intro h i hi exact congrFun h ⟨i, hi⟩ theorem finite_asymmetric_kernel_four_fill {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} (μ : ∀ i, X i → ℝ) (S A B T : Finset I) (hSA : Disjoint S A) (hSB : Disjoint S B) (hST : Disjoint S T) (hAB : Disjoint A B) (hAT : Disjoint A T) (hBT : Disjoint B T) (hcover : S ∪ A ∪ B ∪ T = univ) (H : (∀ i : S, X i.1) → (∀ i : A, X i.1) → (∀ i : B, X i.1) → ℂ) (s s' : ∀ i : S, X i.1) (a a' : ∀ i : A, X i.1) (b b' : ∀ i : B, X i.1) (t t' : ∀ i : T, X i.1) : finiteAsymmetricKernel μ S A B H (finiteFourPartitionFill S A B T hcover s a b t) (finiteFourPartitionFill S A B T hcover s' a' b' t') = finiteThreeWayKernel (finiteProductWeight (fun i : A => μ i.1)) (fun bt => finiteProductWeight (fun i : B => μ i.1) bt.1 * finiteProductWeight (fun i : T => μ i.1) bt.2) (fun s a bt => H s a bt.1) (s, a, b, t) (s', a', b', t') := by unfold finiteAsymmetricKernel finiteThreeWayKernel rw [finite_shared_compatible_iff_restrict, finite_four_partition_fill_s, finite_four_partition_fill_s] split_ifs · rw [finite_fresh_mass_four_partition μ S A B T hSA hSB hST hAB hAT hBT hcover] simp only [finite_four_partition_fill_a S A B T hcover hSA, finite_four_partition_fill_b S A B T hcover hSB hAB, finite_four_partition_fill_t S A B T hcover hST hAT hBT, mul_assoc] · rfl end Bounty end section /- Uniform asymptotic counting in the actual logarithmic rough-integer cells. -/ open Finset Filter namespace Bounty noncomputable def roughLogarithmicCellMainTerm (L S Y : ℝ) : ℝ := (Real.exp (L^(-S)) * Y - Y) * (∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1 - 1 / (p : ℝ))) theorem eventually_rough_logarithmic_cell_count {a : ℝ} (ha : 0 < a) (S B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a * L) ≤ Y → |((roughBand Y (Real.exp (L^(-S)) * Y) (Real.exp (Real.sqrt L))).card : ℝ) - roughLogarithmicCellMainTerm L S Y| ≤ roughLogarithmicCellMainTerm L S Y * L^(-B) := by obtain ⟨K, hK, hcount⟩ := exists_real_rough_integer_interval_count let C : ℝ := 4 * primeEulerProductUpperConstant have hC : 0 < C := mul_pos (by norm_num) primeEulerProductUpperConstant_pos have hKC : 0 ≤ K * (C + 1) := by positivity filter_upwards [eventually_rough_cell_sieve_parameters ha, eventually_rough_cell_error_profile_le ha hKC S B, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (Real.log 2)] with L hpar hprofile hL hlog intro Y hY have hL0 : 0 < L := zero_lt_one.trans_le hL have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY let M := roughLogarithmicCellMainTerm L S Y let E := Real.exp (-L^(1/8 : ℝ)) let T := L^(S + 1) * Real.exp (-(a/2)*L) have hMlo : Y / (C * L^(S + 1)) ≤ M := rough_logarithmic_cell_main_term_lower hL hlog hY0.le S have hden : 0 < C * L^(S + 1) := by positivity have hM0 : 0 ≤ M := (div_pos hY0 hden).le.trans hMlo have hMexp : Real.exp (a*L) / (C * L^(S + 1)) ≤ M := (div_le_div_of_nonneg_right hY hden.le).trans hMlo have hT0 : 0 ≤ T := by dsimp [T]; positivity have hE0 : 0 ≤ E := Real.exp_nonneg _ have hlevel : (Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ) + 2) ≤ M * (C*T) := by apply hpar.2.2.2.1.trans have hm := mul_le_mul_of_nonneg_right hMexp (mul_nonneg hC.le hT0) have hid : (Real.exp (a*L) / (C * L^(S + 1))) * (C*T) = Real.exp ((a/2)*L) := by dsimp [T] calc _ = Real.exp (a*L) * Real.exp (-(a/2)*L) := by field_simp _ = _ := by rw [← Real.exp_add]; congr 1; ring rwa [hid] at hm have hlength : Y ≤ Real.exp (L^(-S)) * Y := by have h := logarithmic_cell_length_lower (L := L) hY0.le S have hp : 0 ≤ Y * L^(-S) := by positivity linarith have hbase := hcount hY0.le hlength hpar.2.2.1 hpar.1 hpar.2.1 change |((roughBand Y (Real.exp (L^(-S)) * Y) (Real.exp (Real.sqrt L))).card : ℝ) - M| ≤ K * (M * Real.exp (-(roughCellSieveOrder L : ℝ)) + (Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ) + 2)) at hbase have he : Real.exp (-(roughCellSieveOrder L : ℝ)) ≤ E := hpar.2.2.2.2 have hsmall : E + C*T ≤ (C + 1) * (E + T) := by nlinarith calc _ ≤ K * (M * Real.exp (-(roughCellSieveOrder L : ℝ)) + (Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ) + 2)) := hbase _ ≤ K * (M*E + M*(C*T)) := mul_le_mul_of_nonneg_left (add_le_add (mul_le_mul_of_nonneg_left he hM0) hlevel) hK.le _ = M * (K * (E + C*T)) := by ring _ ≤ M * (K * ((C+1)*(E+T))) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hsmall hK.le) hM0 _ = M * ((K*(C+1))*(E+T)) := by ring _ ≤ M * L^(-B) := mul_le_mul_of_nonneg_left hprofile hM0 end Bounty end section /- Uniform rough-integer counts in unit residue classes, with exact totient density. -/ open Finset namespace Bounty theorem exists_residue_prime_avoidance_count : ∃ K : ℝ, 0 < K ∧ ∀ (P : Finset ℕ) (A B r u : ℕ) {z : ℝ} {h : ℕ}, 1 < z → A ≤ B → 0 < r → 1 ≤ h → Even h → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, (p : ℝ) ≤ z) → (∀ p ∈ P, ¬p ∣ r) → |((((Ioc A B).filter (fun n => n % r = u % r)).filter (fun n => ∀ p ∈ P, ¬p ∣ n)).card : ℝ) - (((B : ℝ) - A) / r) * (∏ p ∈ P, (1 - 1 / (p : ℝ)))| ≤ (((B : ℝ) - A) / r) * (∏ p ∈ P, (1 - 1 / (p : ℝ))) * K * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2) := by obtain ⟨K, hK, hsieve⟩ := exists_reciprocal_prime_sieve_events refine ⟨K, hK, ?_⟩ intro P A B r u z h hz hAB hr hh heven hP hPz hPr have hX : 0 ≤ ((B : ℝ) - A) / r := div_nonneg (sub_nonneg.mpr (Nat.cast_le.mpr hAB)) (Nat.cast_nonneg r) have hcount := hsieve P ((Ioc A B).filter (fun n => n % r = u % r)) (fun _ => 1) (fun n p => p ∣ n) (intervalResidueDivisibilityRemainder A B r u) hz hX hh heven hP hPz (by intros; norm_num) (fun S hS => interval_residue_prime_intersection_moment P hP A B r u S (mem_powerset.mp hS)) have hrem := interval_residue_divisibility_remainder_sum_le P hP r hPr A B u hAB hr (z^(4 * (h : ℝ) + 2)) (Real.rpow_nonneg (zero_lt_one.trans hz).le _) have hresult := hcount.trans (add_le_add le_rfl hrem) simpa only [sum_const, nsmul_eq_mul, mul_one] using hresult theorem unit_residue_avoids_modulus_primes (r u n p : ℕ) (hu : u.Coprime r) (hn : n % r = u % r) (hp : p.Prime) (hpr : p ∣ r) : ¬p ∣ n := by intro hpn have hpmod : p ∣ u % r := hn ▸ Nat.dvd_mod_iff hpr |>.mpr hpn have hpu : p ∣ u := (Nat.dvd_mod_iff hpr).mp hpmod have hg := Nat.dvd_gcd hpu hpr rw [hu.gcd_eq_one] at hg exact hp.not_dvd_one hg theorem unit_residue_small_prime_avoidance (r u n : ℕ) {z : ℝ} (hz : 0 ≤ z) (hu : u.Coprime r) (hn : n % r = u % r) (hn0 : n ≠ 0) : (∀ p ∈ (primeBand 0 z).filter (fun p => ¬p ∣ r), ¬p ∣ n) ↔ ∀ p ∈ n.primeFactors, z < (p : ℝ) := by rw [← small_prime_avoidance_iff_rough hz hn0] constructor · intro h p hp by_cases hpr : p ∣ r · exact unit_residue_avoids_modulus_primes r u n p hu hn (small_prime_pool_prime hp) hpr · exact h p (mem_filter.mpr ⟨hp, hpr⟩) · intro h p hp exact h p (mem_filter.mp hp).1 theorem exists_unit_residue_rough_count : ∃ K : ℝ, 0 < K ∧ ∀ (A B r u : ℕ) {z : ℝ} {h : ℕ}, 1 < z → A ≤ B → 0 < r → u.Coprime r → (∀ p ∈ r.primeFactors, (p : ℝ) ≤ z) → 1 ≤ h → Even h → |(((Ioc A B).filter (fun n => n % r = u % r ∧ ∀ p ∈ n.primeFactors, z < (p : ℝ))).card : ℝ) - (((B : ℝ) - A) / r.totient) * (∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ)))| ≤ (((B : ℝ) - A) / r.totient) * (∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ))) * K * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2) := by obtain ⟨K, hK, hcount⟩ := exists_residue_prime_avoidance_count refine ⟨K, hK, ?_⟩ intro A B r u z h hz hAB hr hu hpf hh heven have hz0 : 0 ≤ z := (zero_lt_one.trans hz).le have h := hcount ((primeBand 0 z).filter (fun p => ¬p ∣ r)) A B r u hz hAB hr hh heven (fun _ hp => small_prime_pool_prime (mem_filter.mp hp).1) (fun _ hp => small_prime_pool_le hz0 (mem_filter.mp hp).1) (fun _ hp => (mem_filter.mp hp).2) have hset : ((Ioc A B).filter (fun n => n % r = u % r)).filter (fun n => ∀ p ∈ (primeBand 0 z).filter (fun p => ¬p ∣ r), ¬p ∣ n) = (Ioc A B).filter (fun n => n % r = u % r ∧ ∀ p ∈ n.primeFactors, z < (p : ℝ)) := by rw [filter_filter] apply filter_congr intro n hn have hn0 : n ≠ 0 := ne_of_gt (lt_of_le_of_lt (Nat.zero_le A) (mem_Ioc.mp hn).1) exact and_congr_right (fun hnr => unit_residue_small_prime_avoidance r u n hz0 hu hnr hn0) rw [hset] at h have heuler := small_prime_avoidance_unit_density hz0 r hr hpf have hmain : (((B : ℝ) - A) / r) * (∏ p ∈ (primeBand 0 z).filter (fun p => ¬p ∣ r), (1 - 1 / (p : ℝ))) = (((B : ℝ) - A) / r.totient) * (∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ))) := by calc _ = ((B : ℝ) - A) * ((∏ p ∈ (primeBand 0 z).filter (fun p => ¬p ∣ r), (1 - 1 / (p : ℝ))) / r) := by ring _ = _ := by rw [heuler]; ring simpa only [hmain] using h end Bounty end section /- The exact target from the actual wide smooth-prime supply and zero-free input. -/ namespace Bounty theorem wideAmbientPrimeCancellation_of_zero_free (hZ : PrimitiveZeroFreeHalfPlane) : WideAmbientPrimeCancellationAt (31 / 32) := by intro δ hδ _ σ hσ exact eventually_wide_ambient_prime_cancellation hZ hδ hσ theorem target_of_wide_smooth_primes_and_zero_free (hS : WideSmoothShiftedPrimeSupply) (hZ : PrimitiveZeroFreeHalfPlane) : fcTypeOfName% "Erdos1057.erdos_1057" := by exact target_of_wide_smooth_supply_and_cancellation (by norm_num : (31 : ℝ) / 32 < 1) hS (wideAmbientPrimeCancellation_of_zero_free hZ) end Bounty end section /- Literal physical edge rows retain their complex scalar factors through all raw event sums and the joint input/output cutoff. -/ open Finset namespace Bounty section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L R : PhysicalMarkLists P J ell) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (aux : PhysicalAuxLabels P C) theorem physical_full_edge_raw_row_mul (g : Fin N) (c : ℂ) (F : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val) → ℂ) (s : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val)) : physicalFullEdgeRawRow (B := B) C k L R β ρ V aux g (fun t => c * F t) s = c * physicalFullEdgeRawRow (B := B) C k L R β ρ V aux g F s := by unfold physicalFullEdgeRawRow globalBirthEdgeRawRow unrestrictedEdgeAction simp_rw [mul_sum] apply sum_congr rfl intro stores _ apply sum_congr rfl intro promotions _ apply sum_congr rfl intro e _ apply sum_congr rfl intro fresh _ split_ifs <;> ring theorem physical_full_edge_tensor_zero (s : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) : jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) C k L R β ρ V aux) (fun _ => 0) s = 0 := joint_raw_tensor_cutoff_zero B _ (fun g c F s => physical_full_edge_raw_row_mul C k L R β ρ V aux g c F s) s end Physical end Bounty end section /- Uniform control of the convergent correction factors in the pair sieve. -/ open Finset namespace Bounty theorem finite_pair_euler_correction_le_four (S : Finset ℕ) (hS : ∀ n ∈ S, 2 ≤ n) : (∏ n ∈ S, (1 + 2/(n : ℝ)^2)) ≤ 4 := by have hlocal : ∀ n ∈ S, 1 + 2/(n : ℝ)^2 ≤ (1 + 1/((n : ℝ)^2 - 1))^2 := by intro n hn have hn2 : (2 : ℝ) ≤ n := by exact_mod_cast hS n hn have hden : 0 < (n : ℝ)^2 - 1 := by nlinarith have hrec := one_div_le_one_div_of_le hden (by linarith : (n : ℝ)^2 - 1 ≤ (n : ℝ)^2) simp only [div_eq_mul_inv, one_mul] at hrec ⊢ nlinarith [sq_nonneg (((n : ℝ)^2 - 1)⁻¹)] have hupper := euler_correction_product_le_two S hS have hnonneg : 0 ≤ ∏ n ∈ S, (1 + 1/((n : ℝ)^2 - 1)) := by apply prod_nonneg intro n hn have hn2 : (2 : ℝ) ≤ n := by exact_mod_cast hS n hn have hden : 0 < (n : ℝ)^2 - 1 := by nlinarith positivity calc _ ≤ ∏ n ∈ S, (1 + 1/((n : ℝ)^2 - 1))^2 := prod_le_prod₀ (fun n _ => by positivity) hlocal _ = (∏ n ∈ S, (1 + 1/((n : ℝ)^2 - 1)))^2 := by rw [prod_pow] _ ≤ 4 := by nlinarith theorem finite_inverse_avoidance_le_exp (S : Finset ℕ) (hS : ∀ n ∈ S, 2 ≤ n) : (∏ n ∈ S, (1 - 1/(n : ℝ))⁻¹) ≤ Real.exp (2 * ∑ n ∈ S, 1/(n : ℝ)) := by have hlocal : ∀ n ∈ S, (1 - 1/(n : ℝ))⁻¹ ≤ Real.exp (2/(n : ℝ)) := by intro n hn have hn2 : (2 : ℝ) ≤ n := by exact_mod_cast hS n hn have hn0 : (0 : ℝ) < n := by linarith have hn1 : 0 < (n : ℝ)-1 := by linarith have hrec : 1/((n : ℝ)-1) ≤ 2/(n : ℝ) := by apply (div_le_div_iff₀ hn1 hn0).mpr linarith have hid : (1 - 1/(n : ℝ))⁻¹ = 1 + 1/((n : ℝ)-1) := by field_simp ring have he := Real.add_one_le_exp (2/(n : ℝ)) rw [hid] linarith calc _ ≤ ∏ n ∈ S, Real.exp (2/(n : ℝ)) := by apply prod_le_prod₀ _ hlocal intro n hn have hn2 : (2 : ℝ) ≤ n := by exact_mod_cast hS n hn have hn0 : (0 : ℝ) < n := by linarith apply inv_nonneg.mpr exact sub_nonneg.mpr ((div_le_one hn0).mpr (by linarith)) _ = Real.exp (∑ n ∈ S, 2/(n : ℝ)) := by rw [Real.exp_sum] _ = Real.exp (2 * ∑ n ∈ S, 1/(n : ℝ)) := by congr 1 rw [mul_sum] apply sum_congr rfl intro n _ ring end Bounty end section /- The original joint raw rows and histories preserve scalar multiplication, with independent input and output caps and arbitrary signed raw steps. -/ open Finset namespace Bounty variable {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {R : (g : Fin N) → P g → Type*} [∀ g p, AddGroup (R g p)] [∀ g p, DecidableEq (R g p)] theorem global_birth_joint_raw_row_mul {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (cap : ℕ) (c : ℂ) (F : GlobalBirthJointState R → ℂ) (s : GlobalBirthJointState R) : globalBirthJointRawRow step cap (fun t => c * F t) s = c * globalBirthJointRawRow step cap F s := by unfold globalBirthJointRawRow rw [global_birth_joint_raw_cutoff_mul] exact fin_tensor_row_mul_left N _ (fun g d K t => global_birth_raw_step_row_mul (step g) d K t) c (globalBirthJointRawCutoff cap F) s theorem global_birth_joint_cut_raw_row_mul {a b : (g : Fin N) → P g → Bool} (step : (g : Fin N) → GlobalBirthRawStep (R := R g) (a g) (b g)) (inputCap outputCap : ℕ) (c : ℂ) (F : GlobalBirthJointState R → ℂ) (s : GlobalBirthJointState R) : globalBirthJointCutRawRow step inputCap outputCap (fun t => c * F t) s = c * globalBirthJointCutRawRow step inputCap outputCap F s := by unfold globalBirthJointCutRawRow have he : globalBirthJointRawRow step outputCap (fun t => c * F t) = fun t => c * globalBirthJointRawRow step outputCap F t := funext (global_birth_joint_raw_row_mul step outputCap c F) rw [he, global_birth_joint_raw_cutoff_mul] variable (a : ℕ → (g : Fin N) → P g → Bool) (steps : (i : ℕ) → (g : Fin N) → GlobalBirthRawStep (R := R g) (a i g) (a (i + 1) g)) (cap : ℕ → ℕ) theorem global_birth_joint_raw_history_weighted (c : ℕ → ℂ) (n : ℕ) (F : GlobalBirthJointState R → ℂ) : finiteRowComposition (S := fun _ => GlobalBirthJointState R) (fun i K s => c i * globalBirthJointCutRawRow (steps i) (cap i) (cap (i + 1)) K s) n F = fun s => (∏ i ∈ range n, c i) * globalBirthJointRawHistory a steps cap n F s := finite_row_composition_weighted (S := fun _ => GlobalBirthJointState R) (fun i => globalBirthJointCutRawRow (steps i) (cap i) (cap (i + 1))) c n (fun i _ d K s => global_birth_joint_cut_raw_row_mul (steps i) (cap i) (cap (i + 1)) d K s) F end Bounty end section /- Summing the lattice discrepancy over any finite set of residue pairs. -/ open Finset namespace Bounty end Bounty end section /- Chinese-remainder counting in natural residue representatives. -/ open Finset namespace Bounty theorem nat_residue_pair_crt_card (m n : ℕ) (hm : 0 < m) (hn : 0 < n) (hcop : m.Coprime n) (S T : Finset (ℕ × ℕ)) (hS : ∀ v ∈ S, v.1 < m ∧ v.2 < m) (hT : ∀ v ∈ T, v.1 < n ∧ v.2 < n) : (((Finset.product (range (m*n)) (range (m*n))).filter (fun v : ℕ × ℕ => (v.1 % m, v.2 % m) ∈ S ∧ (v.1 % n, v.2 % n) ∈ T)).card) = S.card * T.card := by classical have hinj (a b : ℕ) (ha : a < m*n) (hb : b < m*n) (habm : a % m = b % m) (habn : a % n = b % n) : a = b := by have h := (Nat.modEq_and_modEq_iff_modEq_mul hcop).mp ⟨habm, habn⟩ simpa only [Nat.ModEq, Nat.mod_eq_of_lt ha, Nat.mod_eq_of_lt hb] using h rw [← Finset.card_product S T] apply card_bij (fun v _ => ((v.1 % m, v.2 % m), (v.1 % n, v.2 % n))) · intro v hv exact mem_product.mpr (mem_filter.mp hv).2 · intro v hv w hw h have hv' := (mem_filter.mp hv).1 have hw' := (mem_filter.mp hw).1 rw [Finset.product_eq_sprod, mem_product] at hv' hw' simp only [mem_range] at hv' hw' have h1 := congrArg (fun a : (ℕ × ℕ) × (ℕ × ℕ) => a.1.1) h have h2 := congrArg (fun a : (ℕ × ℕ) × (ℕ × ℕ) => a.1.2) h have h3 := congrArg (fun a : (ℕ × ℕ) × (ℕ × ℕ) => a.2.1) h have h4 := congrArg (fun a : (ℕ × ℕ) × (ℕ × ℕ) => a.2.2) h exact Prod.ext (hinj _ _ hv'.1 hw'.1 h1 h3) (hinj _ _ hv'.2 hw'.2 h2 h4) · intro v hv obtain ⟨hvS, hvT⟩ := mem_product.mp hv obtain ⟨hS1, hS2⟩ := hS v.1 hvS obtain ⟨hT1, hT2⟩ := hT v.2 hvT let x := Nat.chineseRemainder hcop v.1.1 v.2.1 let y := Nat.chineseRemainder hcop v.1.2 v.2.2 have hx : (x : ℕ) < m*n := Nat.chineseRemainder_lt_mul hcop _ _ hm.ne' hn.ne' have hy : (y : ℕ) < m*n := Nat.chineseRemainder_lt_mul hcop _ _ hm.ne' hn.ne' have hxm : (x : ℕ) % m = v.1.1 := by simpa only [Nat.ModEq, Nat.mod_eq_of_lt hS1] using x.property.1 have hxn : (x : ℕ) % n = v.2.1 := by simpa only [Nat.ModEq, Nat.mod_eq_of_lt hT1] using x.property.2 have hym : (y : ℕ) % m = v.1.2 := by simpa only [Nat.ModEq, Nat.mod_eq_of_lt hS2] using y.property.1 have hyn : (y : ℕ) % n = v.2.2 := by simpa only [Nat.ModEq, Nat.mod_eq_of_lt hT2] using y.property.2 refine ⟨(x, y), ?_, ?_⟩ · apply mem_filter.mpr constructor · rw [Finset.product_eq_sprod, mem_product] exact ⟨mem_range.mpr hx, mem_range.mpr hy⟩ · simpa only [hxm, hym, hxn, hyn, Prod.mk.eta] using And.intro hvS hvT · simp only [hxm, hym, hxn, hyn, Prod.mk.eta] end Bounty end section /- Finite-sum preservation for the literal raw rows, with all cutoffs retained. -/ open Finset namespace Bounty section variable {A : Type*} {N : ℕ} {P : Fin N → Type*} {R : (g : Fin N) → P g → Type*} (B : ℕ) include A N P R B end end Bounty end section /- The actual root residue model may be summed only over paths admitting all marked residues. -/ open Finset open scoped Classical namespace Bounty section Root variable {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} {patterns : Finset I} (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (C : I → G → Finset (Fin J)) (q : ℝ) (k : ℕ → I → ℤ) (N : ℕ) (L : PhysicalMarkLists P J ell) include hP hprime theorem physical_finite_vertex_expectation_zero_of_incompatible (p : Fin (N + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (h : ¬ ∃ r : PhysicalResidues P, physicalFinitePathResidueCompatible C k N r L p) : physicalFiniteVertexExpectation C q k N L p = 0 := by exact physical_residue_vertex_expectation_zero_of_incompatible hP hprime (finitePathMarks L p) (range (N + 2)) (physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (N + 1)) (physicalEndpointSchedule q (N + 1)) h end Root end Bounty end section /- Exact splitting of physical auxiliary draws into disjoint flat slot sets. The identities retain repeated labels and require no analytic hypotheses. -/ open Finset open scoped Classical namespace Bounty noncomputable def repeatedBigAuxCut {G : Type*} [DecidableEq G] {J ell : ℕ} (A B : Finset (Σ _ : G, PhysicalSlots J ell)) (g : G) : Finset (Fin J) := univ.filter (fun j => ⟨g, Sum.inl j⟩ ∈ A ∪ B) theorem mem_repeatedBigAuxCut {G : Type*} [DecidableEq G] {J ell : ℕ} (A B : Finset (Σ _ : G, PhysicalSlots J ell)) (g : G) (j : Fin J) : j ∈ repeatedBigAuxCut A B g ↔ ⟨g, Sum.inl j⟩ ∈ A ∪ B := by simp only [repeatedBigAuxCut, mem_filter, mem_univ, true_and] noncomputable def repeatedBigAuxIndexEquiv {G : Type*} [DecidableEq G] {J ell : ℕ} (A B : Finset (Σ _ : G, PhysicalSlots J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : Σ _ : G, PhysicalSlots J ell) ∉ A ∪ B) : (Σ g, ↥(repeatedBigAuxCut A B g)) ≃ ↥(A ∪ B) where toFun i := ⟨⟨i.1, Sum.inl i.2.val⟩, (mem_repeatedBigAuxCut A B i.1 i.2.val).mp i.2.property⟩ invFun i := by rcases i with ⟨⟨g, s⟩, hi⟩ cases s with | inl j => exact ⟨g, ⟨j, (mem_repeatedBigAuxCut A B g j).mpr hi⟩⟩ | inr j => exact False.elim (hU g j hi) left_inv i := by rcases i with ⟨g, j, hj⟩; rfl right_inv i := by rcases i with ⟨⟨g, s⟩, hi⟩ cases s with | inl j => rfl | inr j => exact False.elim (hU g j hi) noncomputable def repeatedBigAuxUnionEquiv {G : Type*} [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (A B : Finset (Σ _ : G, PhysicalSlots J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : Σ _ : G, PhysicalSlots J ell) ∉ A ∪ B) : PhysicalAuxLabels P (repeatedBigAuxCut A B) ≃ (∀ i : ↥(A ∪ B), P i.val.1) where toFun aux i := by rcases i with ⟨⟨g, s⟩, hi⟩ cases s with | inl j => exact aux g ⟨j, (mem_repeatedBigAuxCut A B g j).mpr hi⟩ | inr j => exact False.elim (hU g j hi) invFun f g j := f ⟨⟨g, Sum.inl j.val⟩, (mem_repeatedBigAuxCut A B g j.val).mp j.property⟩ left_inv aux := by funext g j; rfl right_inv f := by funext i rcases i with ⟨⟨g, s⟩, hi⟩ cases s with | inl j => rfl | inr j => exact False.elim (hU g j hi) noncomputable def repeatedBigAuxSplitEquiv {G : Type*} [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (A B : Finset (Σ _ : G, PhysicalSlots J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : Σ _ : G, PhysicalSlots J ell) ∉ A ∪ B) (hAB : Disjoint A B) : PhysicalAuxLabels P (repeatedBigAuxCut A B) ≃ ((∀ i : A, P i.val.1) × (∀ i : B, P i.val.1)) := (repeatedBigAuxUnionEquiv P A B hU).trans (Equiv.piFinsetUnion (fun i : Σ _ : G, PhysicalSlots J ell => P i.1) hAB).symm section variable {G : Type*} [sharedInstance1 : DecidableEq G] [sharedInstance2 : Fintype G] {J ell : ℕ} (P : G → Finset ℕ) (A B : Finset (Σ _ : G, PhysicalSlots J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : Σ _ : G, PhysicalSlots J ell) ∉ A ∪ B) include G sharedInstance1 sharedInstance2 J ell P A B hU theorem repeatedBigAuxUnionEquiv_prod {M : Type*} [CommMonoid M] (F : ∀ g, P g → M) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : (∏ g, ∏ j : repeatedBigAuxCut A B g, F g (aux g j)) = ∏ i : ↥(A ∪ B), F i.val.1 (repeatedBigAuxUnionEquiv P A B hU aux i) := by have h := Fintype.prod_equiv (repeatedBigAuxIndexEquiv A B hU) (fun i => F i.1 (aux i.1 i.2)) (fun i => F i.val.1 (repeatedBigAuxUnionEquiv P A B hU aux i)) (fun _ => rfl) simpa only [Fintype.prod_sigma] using h theorem repeatedBigAuxSplitEquiv_symm_prod (hAB : Disjoint A B) {M : Type*} [CommMonoid M] (F : ∀ g, P g → M) (a : ∀ i : A, P i.val.1) (b : ∀ i : B, P i.val.1) : (∏ g, ∏ j : repeatedBigAuxCut A B g, F g ((repeatedBigAuxSplitEquiv P A B hU hAB).symm (a, b) g j)) = (∏ i : A, F i.val.1 (a i)) * (∏ i : B, F i.val.1 (b i)) := by rw [repeatedBigAuxUnionEquiv_prod P A B hU F] simp only [repeatedBigAuxSplitEquiv, Equiv.symm_trans_apply, Equiv.symm_symm, Equiv.apply_symm_apply] let e := Equiv.Finset.union A B hAB let f := Equiv.piFinsetUnion (fun i : Σ _ : G, PhysicalSlots J ell => P i.1) hAB (a, b) calc (∏ i : ↥(A ∪ B), F i.val.1 (f i)) = ∏ i : A ⊕ B, F (e i).val.1 (f (e i)) := (e.prod_comp _).symm _ = _ := by rw [Fintype.prod_sum_type] congr 1 · apply prod_congr rfl intro i _ change F i.val.1 (f ⟨i.val, mem_union_left B i.property⟩) = F i.val.1 (a i) dsimp only [f] rw [Equiv.piFinsetUnion_left] · apply prod_congr rfl intro i _ change F i.val.1 (f ⟨i.val, mem_union_right A i.property⟩) = F i.val.1 (b i) dsimp only [f] rw [Equiv.piFinsetUnion_right] end theorem repeatedBigAuxSplitEquiv_symm_mass {G : Type*} [DecidableEq G] [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (a : ∀ i : A, P i.val.1) (b : ∀ i : B, P i.val.1) : physicalAuxMass V (repeatedBigAuxCut A B) ((repeatedBigAuxSplitEquiv P A B hU hAB).symm (a, b)) = finiteProductWeight (fun i : A => physicalLabelLaw V i.val.1) a * finiteProductWeight (fun i : B => physicalLabelLaw V i.val.1) b := repeatedBigAuxSplitEquiv_symm_prod P A B hU hAB (physicalLabelLaw V) a b section variable {G : Type*} [sharedInstance1 : DecidableEq G] [sharedInstance2 : Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) include G sharedInstance1 sharedInstance2 P J ell A B hU hAB theorem repeatedBigAuxSplitEquiv_symm_label_prod (a : ∀ i : A, P i.val.1) (b : ∀ i : B, P i.val.1) : (∏ g, ∏ j : repeatedBigAuxCut A B g, (((repeatedBigAuxSplitEquiv P A B hU hAB).symm (a, b)) g j).val) = (∏ i : A, (a i).val) * (∏ i : B, (b i).val) := repeatedBigAuxSplitEquiv_symm_prod P A B hU hAB (fun _ p => p.val) a b theorem repeated_big_aux_split_sum {M : Type*} [AddCommMonoid M] (F : PhysicalAuxLabels P (repeatedBigAuxCut A B) → M) : (∑ aux, F aux) = ∑ a, ∑ b, F ((repeatedBigAuxSplitEquiv P A B hU hAB).symm (a, b)) := by rw [← (repeatedBigAuxSplitEquiv P A B hU hAB).symm.sum_comp F] exact Fintype.sum_prod_type _ end theorem repeatedBigAuxCut_shared {G : Type*} [DecidableEq G] [Fintype G] {J ell : ℕ} (A B : Finset (RepeatedBigFlatIndex G J ell)) : repeatedBigFlatShared (ell := ell) (repeatedBigAuxCut A B) = repeatedBigFlatActive J ell \ (A ∪ B) := by ext ⟨g, j | j⟩ · simp only [repeatedBigFlatShared_mem_inl, mem_repeatedBigAuxCut, mem_sdiff, repeatedBigFlatActive_mem_inl, true_and] · simp only [repeatedBigFlatShared_not_mem_inr, mem_sdiff, repeatedBigFlatActive_not_mem_inr, false_and] end Bounty end section /- Exact raw and kernel pairing transport from repeated physical lists to flat group-slot arrays under the untilted active law. Full independent slot-permutation symmetry is equivalent to symmetry in each group. -/ open Finset Classical namespace Bounty theorem repeated_big_clean_kernel_pairing_flat {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → ℂ) (f g : RepeatedBigLists P J ell → ℂ) : cleanKernelPairing (finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1)) (fun x y => K ((repeatedBigFlatEquiv P J ell).symm x) ((repeatedBigFlatEquiv P J ell).symm y)) (fun x => f ((repeatedBigFlatEquiv P J ell).symm x)) (fun x => g ((repeatedBigFlatEquiv P J ell).symm x)) = cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) K f g := by have hw : (fun x => repeatedBigActiveMass V (fun _ _ => 1) ((repeatedBigFlatEquiv P J ell).symm x)) = finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1) := by funext x simpa only [Equiv.apply_symm_apply] using repeated_big_active_mass_flat V ((repeatedBigFlatEquiv P J ell).symm x) have h := clean_kernel_pairing_equiv (repeatedBigFlatEquiv P J ell) (repeatedBigActiveMass V (fun _ _ => 1)) K f g rw [hw] at h exact h.symm theorem repeated_big_symmetric_iff_group_slot_symmetric {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (f : RepeatedBigLists P J ell → ℂ) : f ∈ repeatedBigSymmetricSubspace ↔ ∀ g, finiteGroupSlotSymmetric g f := by constructor · intro hf g σ L let τ : PhysicalPermutations G J ell := Function.update (fun _ => Equiv.refl _) g σ have hτ : repeatedBigPermutationEquiv τ L = Function.update L g (finiteSlotRelabel σ (L g)) := by funext h by_cases hh : h = g · subst h simp only [repeatedBigPermutationEquiv, Equiv.coe_fn_mk, τ, Function.update_self, finiteSlotRelabel] · simp only [repeatedBigPermutationEquiv, Equiv.coe_fn_mk, τ, Function.update_of_ne hh, Equiv.refl_apply] exact hτ ▸ hf τ L · intro hf change ∀ σ L, f (repeatedBigPermutationEquiv σ L) = f L intro σ L have hpartial (s : Finset G) : f (fun g => if g ∈ s then finiteSlotRelabel (σ g) (L g) else L g) = f L := by induction s using Finset.induction with | empty => simp | @insert a s ha ih => let y : RepeatedBigLists P J ell := fun g => if g ∈ s then finiteSlotRelabel (σ g) (L g) else L g have hy : (fun g => if g ∈ insert a s then finiteSlotRelabel (σ g) (L g) else L g) = Function.update y a (finiteSlotRelabel (σ a) (y a)) := by funext g by_cases hg : g = a · subst g simp only [mem_insert_self, if_true, Function.update_self, y, if_neg ha] · simp only [mem_insert, hg, false_or, Function.update_of_ne hg, y] rw [hy, hf a (σ a)] exact ih simpa only [mem_univ, if_true, finiteSlotRelabel, repeatedBigPermutationEquiv, Equiv.coe_fn_mk] using hpartial univ end Bounty end section /- Birth data on the existing paths are projections of the owning full event. -/ namespace Bounty section Paths variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedPathBornData (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) (a : FullMixedBirthAddress S B steps) : Option (FullMixedBornData n) := let e := finiteEventPathOccurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x p a.1 fullMixedEventBornData n S B A Δ D (steps.get a.1) e.1 e.2 a.2 noncomputable def fullMixedPathBirthLabel (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) (a : FullMixedBirthAddress S B steps) : Option ((g : Fin N) × P g) := (fullMixedPathBornData n S B A Δ D steps x p a).map (fullMixedBornPrime n) variable [∀ g, DecidableEq (P g)] noncomputable def fullMixedLedgerPathBornData (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (a : FullMixedBirthAddress S B steps) : Option (FullMixedBornData n) := let e := finiteEventPathOccurrence (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) steps x p a.1 fullMixedEventBornData n S B A Δ D (steps.get a.1) e.1.2 e.2 a.2 end Paths end Bounty end section /- Quantitative product-size bounds for the actual microscopic Q lists. -/ open Finset namespace Bounty theorem finite_dyadic_tail_le (S : Finset ℕ) (J : ℕ) (hS : ∀ j ∈ S, J ≤ j) : (∑ j ∈ S, (1 : ℝ)/2^j) ≤ 2/(2 : ℝ)^J := by have hsub : S ⊆ Ico J (S.sup id + 1) := by intro j hj exact mem_Ico.mpr ⟨hS j hj, Nat.lt_succ_of_le (le_sup (f := id) hj)⟩ calc _ ≤ ∑ j ∈ Ico J (S.sup id + 1), (1 : ℝ)/2^j := sum_le_sum_of_subset_of_nonneg hsub (fun _ _ _ => by positivity) _ = ∑ j ∈ Ico J (S.sup id + 1), (1/(2 : ℝ))^j := by simp only [one_div_pow] _ ≤ (1/(2 : ℝ))^J / (1-1/2) := geom_sum_Ico_le_of_lt_one (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/(2 : ℝ)) < 1) _ = _ := by rw [one_div_pow]; ring theorem candidate_micro_Q_slot_upper (c L : ℝ) (r jStar J : ℕ) (slot : (candidateMicroQIndices c L J) × Fin r) {n : ℕ} (hn : n ∈ candidateMicroQSlotChoices c L r jStar J slot) : (n : ℝ) ≤ Real.exp ((6/5 : ℝ)*(c*L)/(2 : ℝ)^slot.1.val) := by unfold candidateMicroQSlotChoices at hn split_ifs at hn with hrough · have hnup := (Nat.cast_le.mpr (mem_Ioc.mp (mem_filter.mp hn).1).2).trans (Nat.floor_le (Real.exp_pos _).le) simpa only [candidateRoughBand, roughBand, hrough.1, mul_assoc] using hnup · exact ((mem_dyadicPrimeBand_iff (c*L) 1 (6/5) slot.1.val n).mp hn).2.2 theorem candidate_micro_Q_product_upper {c L : ℝ} (hcL : 0 ≤ c*L) (r jStar J : ℕ) (x : ∀ i, candidateMicroQSlotChoices c L r jStar J i) : (orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) x : ℝ) ≤ Real.exp (((12/5 : ℝ)*(r : ℝ)*c/(2 : ℝ)^J)*L) := by have htail := finite_dyadic_tail_le (candidateMicroQIndices c L J) J (fun j hj => (mem_filter.mp hj).2) have hcoef : 0 ≤ (r : ℝ)*((6/5 : ℝ)*(c*L)) := by positivity have hsum : (∑ slot : (candidateMicroQIndices c L J) × Fin r, (6/5 : ℝ)*(c*L)/(2 : ℝ)^slot.1.val) ≤ ((12/5 : ℝ)*(r : ℝ)*c/(2 : ℝ)^J)*L := by rw [Fintype.sum_prod_type] simp only [sum_const, card_univ, Fintype.card_fin, nsmul_eq_mul] have he : (∑ j : candidateMicroQIndices c L J, (r : ℝ)*((6/5 : ℝ)*(c*L)/(2 : ℝ)^j.val)) = (r : ℝ)*((6/5 : ℝ)*(c*L)) * (∑ j ∈ candidateMicroQIndices c L J, (1 : ℝ)/2^j) := by rw [sum_coe_sort (candidateMicroQIndices c L J) (fun j : ℕ => (r : ℝ)*((6/5 : ℝ)*(c*L)/(2 : ℝ)^j)), mul_sum] apply sum_congr rfl intro j _ ring rw [he] exact (mul_le_mul_of_nonneg_left htail hcoef).trans_eq (by ring) calc _ = ∏ i, ((x i).val : ℝ) := by simp only [orderedSlotProduct, Nat.cast_prod] _ ≤ ∏ i : (candidateMicroQIndices c L J) × Fin r, Real.exp ((6/5 : ℝ)*(c*L)/(2 : ℝ)^i.1.val) := prod_le_prod₀ (fun _ _ => Nat.cast_nonneg _) (fun i _ => candidate_micro_Q_slot_upper c L r jStar J i (x i).property) _ = Real.exp (∑ i : (candidateMicroQIndices c L J) × Fin r, (6/5 : ℝ)*(c*L)/(2 : ℝ)^i.1.val) := (Real.exp_sum _ _).symm _ ≤ _ := Real.exp_le_exp.mpr hsum end Bounty end section /- The actual asymmetric comparison pairing only sees the tail averages of both tests when its three coordinate sets lie in the active set. This is an exact finite identity, with no positivity or norm assumptions. -/ open Finset Classical namespace Bounty theorem finite_asymmetric_comparison_pairing_tail_projection {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ v, μ i v = 1) (active A B : Finset I) (hA : A ⊆ active) (hB : B ⊆ active) (hμ : ∀ i ∈ active \ (A ∪ B), ∀ v, μ i v ≠ 0) (F : ∀ A B : Finset I, (∀ i : ↥(active \ (A ∪ B)), X i.val) → (∀ i : A, X i.val) → (∀ i : B, X i.val) → ℂ) (f g : (∀ i, X i) → ℂ) : cleanKernelPairing (finiteProductWeight μ) (finiteAsymmetricComparisonKernel μ active F A B) f g = cleanKernelPairing (finiteProductWeight μ) (finiteAsymmetricComparisonKernel μ active F A B) (finiteCoordinateComponent μ ∅ activeᶜ.toList f) (finiteCoordinateComponent μ ∅ activeᶜ.toList g) := by let H := finiteAsymmetricDensity μ (active \ (A ∪ B)) A B (F A B) have hkernel : finiteAsymmetricComparisonKernel μ active F A B = fun x y => (finiteProductWeight μ y : ℂ) * H x y := by funext x y exact finite_asymmetric_kernel_eq_density μ (active \ (A ∪ B)) A B hμ (F A B) x y have hleft (i : I) (hi : i ∈ activeᶜ) (x y : ∀ i, X i) (v : X i) : H (Function.update x i v) y = H x y := by have hia : i ∉ active := mem_compl.mp hi exact finite_asymmetric_density_update_left μ (active \ (A ∪ B)) A B (F A B) i (fun hs => hia (mem_sdiff.mp hs).1) (fun hb => hia (hB hb)) x y v have hright (i : I) (hi : i ∈ activeᶜ) (x y : ∀ i, X i) (v : X i) : H x (Function.update y i v) = H x y := by have hia : i ∉ active := mem_compl.mp hi exact finite_asymmetric_density_update_right μ (active \ (A ∪ B)) A B (F A B) i (fun hs => hia (mem_sdiff.mp hs).1) (fun ha => hia (hA ha)) x y v rw [← clean_kernel_component_pairing_sum μ activeᶜ activeᶜ (finiteProductWeight μ) (finiteAsymmetricComparisonKernel μ active F A B) f g] rw [sum_eq_single ∅] · rw [sum_eq_single ∅] · intro T hT hTne obtain ⟨i, hi⟩ := Finset.nonempty_iff_ne_empty.mpr hTne rw [hkernel] exact clean_kernel_component_zero_right μ hmass activeᶜ T (mem_powerset.mp hT) i hi (finiteProductWeight μ) H (finiteCoordinateComponent μ ∅ activeᶜ.toList f) g (hright i ((mem_powerset.mp hT) hi)) · simp · intro S hS hSne obtain ⟨i, hi⟩ := Finset.nonempty_iff_ne_empty.mpr hSne apply sum_eq_zero intro T _ rw [hkernel] apply clean_kernel_component_zero_left μ hmass activeᶜ S (mem_powerset.mp hS) i hi (fun x y => (finiteProductWeight μ y : ℂ) * H x y) f (finiteCoordinateComponent μ T activeᶜ.toList g) intro x y v rw [hleft i ((mem_powerset.mp hS) hi)] · simp end Bounty end section /- The image of present birth addresses is the exact original birth-label batch. -/ open scoped Classical namespace Bounty section Images variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) noncomputable def fullMixedEventGroupBirthImage (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) (g : Fin N) : Finset ((g : Fin N) × P g) := Finset.univ.biUnion (fun i : Fin (fullMixedBirthCapacity S B tag g) => (fullMixedEventBirthLabel n S B A Δ D tag s e ⟨g, i⟩).toFinset) theorem full_mixed_ghost_group_birth_image (j : J) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s) (g : Fin N) : fullMixedEventGroupBirthImage n S B A Δ D (some (.inl j)) s e g = Finset.univ.image (fun i : Fin (e.down g).1.val => (⟨g, ((e.down g).2.2 i).1⟩ : (g : Fin N) × P g)) := by have hf : (fun i : Fin B => fullMixedEventBirthLabel n S B A Δ D (some (.inl j)) s e ⟨g, i⟩) = (fun i : Fin B => if h : i.val < (e.down g).1.val then some (⟨g, ((e.down g).2.2 ⟨i.val, h⟩).1⟩ : (g : Fin N) × P g) else none) := by funext i simp only [fullMixedEventBirthLabel, fullMixedEventBornData] split_ifs <;> rfl unfold fullMixedEventGroupBirthImage change (Finset.univ.biUnion (fun i : Fin B => (fullMixedEventBirthLabel n S B A Δ D (some (.inl j)) s e ⟨g, i⟩).toFinset)) = _ simp_rw [congrFun hf] exact optional_prefix_birth_image B (e.down g).1.val (Nat.le_of_lt_succ (e.down g).1.isLt) (fun i : Fin (e.down g).1.val => (⟨g, ((e.down g).2.2 i).1⟩ : (g : Fin N) × P g)) theorem full_mixed_edge_group_birth_image (k : K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent (J := J) n S B A Δ D (some (.inr k)) s) (g : Fin N) : fullMixedEventGroupBirthImage n S B A Δ D (some (.inr k)) s e g = Finset.univ.image (fun i : {i : Fin (S k g)ᶜ.card // i ∉ (e.2 g).2.1} => (⟨g, (e.2 g).2.2.2 i⟩ : (g : Fin N) × P g)) := by have hf : (fun i : Fin (S k g)ᶜ.card => fullMixedEventBirthLabel n S B A Δ D (some (.inr k)) s e ⟨g, i⟩) = (fun i : Fin (S k g)ᶜ.card => if h : i ∈ (e.2 g).2.1 then none else some (⟨g, (e.2 g).2.2.2 ⟨i, h⟩⟩ : (g : Fin N) × P g)) := by funext i simp only [fullMixedEventBirthLabel, fullMixedEventBornData] split_ifs with h h' h' <;> try rfl · exact (h' h).elim · exact (h h').elim unfold fullMixedEventGroupBirthImage change (Finset.univ.biUnion (fun i : Fin (S k g)ᶜ.card => (fullMixedEventBirthLabel n S B A Δ D (some (.inr k)) s e ⟨g, i⟩).toFinset)) = _ simp_rw [congrFun hf] exact optional_fresh_birth_image (e.2 g).2.1 (fun i : {i : Fin (S k g)ᶜ.card // i ∉ (e.2 g).2.1} => (⟨g, (e.2 g).2.2.2 i⟩ : (g : Fin N) × P g)) end Images end Bounty end section /- The original deterministic mixed ledger covers every currently carried label. -/ open Finset open scoped Classical namespace Bounty theorem active_memory_split_covers {P : Type*} (n : P → ℕ) {M B : ℕ} (S : Finset (Fin M)) (H : Finset P) (x : BoundedOrderedState P (UnrestrictedResidueParticle n) M B) (hx : BoundedResidueLedgerCovers n H x) : BoundedResidueLedgerCovers n H (activeMemorySplit S B x).2 := ⟨fun i => hx.1 (Sᶜ.equivFin.symm i).val, hx.2⟩ theorem active_memory_reassemble_covers {P : Type*} (n : P → ℕ) {M B : ℕ} (S : Finset (Fin M)) (H : Finset P) (c : Fin S.card → P) (x : BoundedOrderedState P (UnrestrictedResidueParticle n) Sᶜ.card B) (hc : ∀ i, c i ∈ H) (hx : BoundedResidueLedgerCovers n H x) : BoundedResidueLedgerCovers n H ((activeMemorySplit S B).symm (c, x)) := by constructor · intro i change (if h : i ∈ S then c (S.equivFin ⟨i, h⟩) else x.1 (Sᶜ.equivFin ⟨i, mem_compl.mpr h⟩)) ∈ H split_ifs · exact hc _ · exact hx.1 _ · exact hx.2 section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) def FullMixedLedgerCovers (s : FullMixedLedgerState n (M := M) B) : Prop := ∀ g, BoundedResidueLedgerCovers (n g) (s.1 g) (s.2 g) theorem full_mixed_ledger_target_covers (tag : Option (J ⊕ K)) (s : FullMixedLedgerState n (M := M) B) (e : FullPermutationMixedEvent n S B A Δ D tag s.2) (hs : FullMixedLedgerCovers n B s) : FullMixedLedgerCovers n B (fullMixedLedgerTarget n S B A Δ D tag s e) := by cases tag with | none => intro g exact ⟨fun i => (hs g).1 (e.down g i), (hs g).2⟩ | some tag => cases tag with | inl j => intro g exact bounded_ghost_ledger_target_covers (n g) (M g) B (s.1 g) (s.2 g) (e.down g) (hs g) | inr k => intro g let u := unrestrictedBoundedEventTarget (n g) (Δ k (productActiveMemorySplit (S k) B s.2).1 e.1 g) (D k (productActiveMemorySplit (S k) B s.2).1 e.1 g) (S k g)ᶜ.card B ((productActiveMemorySplit (S k) B s.2).2 g) (e.2 g) have hledger : (fullMixedLedgerTarget n S B A Δ D (some (.inr k)) s e).1 g = s.1 g ∪ univ.image u.1 := by change fullEdgeLedgerUpdate n (S k) B (A k) (Δ k) (D k) s.1 s.2 e g = _ unfold fullEdgeLedgerUpdate fullActiveEdgeEventTarget simp only [Equiv.apply_symm_apply] rfl rw [show BoundedResidueLedgerCovers (n g) ((fullMixedLedgerTarget n S B A Δ D (some (.inr k)) s e).1 g) ((fullMixedLedgerTarget n S B A Δ D (some (.inr k)) s e).2 g) = BoundedResidueLedgerCovers (n g) (s.1 g ∪ univ.image u.1) ((fullMixedLedgerTarget n S B A Δ D (some (.inr k)) s e).2 g) from congrArg (fun H => BoundedResidueLedgerCovers (n g) H ((fullMixedLedgerTarget n S B A Δ D (some (.inr k)) s e).2 g)) hledger] apply active_memory_reassemble_covers · intro i exact mem_union_left _ ((hs g).1 ((S k g).equivFin.symm i).val) · exact bounded_edge_ledger_target_covers (n g) _ _ _ B (s.1 g) ((productActiveMemorySplit (S k) B s.2).2 g) (e.2 g) (active_memory_split_covers (n g) (S k g) (s.1 g) (s.2 g) (hs g)) end Full theorem finite_event_path_occurrence_invariant {K X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (Q : X → Prop) (hstep : ∀ k x e, Q x → Q (target k x e)) : ∀ (steps : List K) (x : X) (p : FiniteEventPath E target steps x), Q x → ∀ i, Q (finiteEventPathOccurrence E target steps x p i).1 := by intro steps induction steps with | nil => intro x p hx i; exact Fin.elim0 i | cons k steps ih => intro x p hx i refine Fin.cases ?_ (fun j => ?_) i · exact hx · exact ih (target k x p.1) p.2 (hstep k x p.1 hx) j end Bounty end section /- Ledger freshness and within-event distinctness give exact global distinctness. -/ namespace Bounty theorem birth_ledger_freshness_iff {T Q : Type*} [DecidableEq Q] (owner : T → ℕ) (label : T → Option Q) (initial : Finset Q) (ledger : T → Finset Q) (hledger : ∀ a z, z ∈ ledger a ↔ z ∈ initial ∨ ∃ b, owner b < owner a ∧ label b = some z) : ((∀ a z, label a = some z → z ∉ ledger a) ∧ (∀ a b z, owner a = owner b → label a = some z → label b = some z → a = b)) ↔ ((∀ a z, label a = some z → z ∉ initial) ∧ (∀ a b z, label a = some z → label b = some z → a = b)) := by constructor · rintro ⟨hfresh, hbatch⟩ constructor · intro a z haz hz exact hfresh a z haz ((hledger a z).mpr (Or.inl hz)) · intro a b z haz hbz rcases lt_trichotomy (owner a) (owner b) with hab | hab | hab · exact False.elim (hfresh b z hbz ((hledger b z).mpr (Or.inr ⟨a, hab, haz⟩))) · exact hbatch a b z hab haz hbz · exact False.elim (hfresh a z haz ((hledger a z).mpr (Or.inr ⟨b, hab, hbz⟩))) · rintro ⟨havoid, hinj⟩ constructor · intro a z haz hz rcases (hledger a z).mp hz with hz | ⟨b, hba, hbz⟩ · exact havoid a z haz hz · have hab := hinj a b z haz hbz subst b exact Nat.lt_irrefl _ hba · intro a b z _ haz hbz exact hinj a b z haz hbz end Bounty end section /- Both initial and terminal physical mark masses stay close to one under the actual endpoint tilt. -/ open Finset namespace Bounty section Mass variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} (V : G → ℝ) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (edges : ℕ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) {P₀ : ℝ} (hP₀ : 0 < P₀) (hsize : 2 * (edges + 1 : ℝ) ≤ P₀) (hp : ∀ g (p : P g), P₀ ≤ (p.val : ℝ)) include hq0 hq1 hV hMass hP₀ hsize hp end Mass end Bounty end section /- Fixed parameter choices satisfying the two numerical gaps in the actual clean prime-row power bound. These choices precede all kernel exponents. -/ namespace Bounty /- A fixed positive tail length and positive block density permit the exact probe and accuracy margins required by the clean power theorem. -/ theorem exists_repeated_big_clean_parameters (ell : ℕ) (hell : 1 ≤ ell) (a E : ℝ) {beta : ℝ} (hbeta : 0 < beta) : ∃ (m : ℕ) (D : ℝ), ell ≤ m ∧ 0 ≤ D ∧ beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2) ∧ (m : ℝ) * a * Real.log 3 + E + 2 ≤ D := by have hE : 0 ≤ max E 0 + 1 := by have := le_max_right E 0; linarith obtain ⟨m, hm, _, _, hgap⟩ := exists_repeated_big_probe_parameter ell hell hbeta hE refine ⟨m, max 0 ((m : ℝ) * a * Real.log 3 + E + 2), hm, le_max_left _ _, ?_, le_max_right _ _⟩ have hE' : E ≤ max E 0 := le_max_left _ _ linarith end Bounty end section /- The clean action lifted to all bounded ordered memory sectors. The exact identities retain both adjacent full active-slot averages and all occurrence residues; the displacement may depend on every big active label and free auxiliary label as in the original clean action. -/ open Finset open scoped Classical namespace Bounty noncomputable def cleanFullMemorySlice {G R : Type*} {P : G → Finset ℕ} {J ell B : ℕ} (f : CleanFullMemoryState P J ell B → R → ℂ) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : R × FixedOrderedResidues p) : ℂ := f (cleanFullMemoryState N p source r.2) r.1 noncomputable def cleanFullMemoryLift {G R : Type*} {P : G → Finset ℕ} {J ell B : ℕ} (A : ∀ (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)), (RepeatedBigLists P J ell → (R × FixedOrderedResidues p) → ℂ) → RepeatedBigLists P J ell → (R × FixedOrderedResidues p) → ℂ) (f : CleanFullMemoryState P J ell B → R → ℂ) (x : CleanFullMemoryState P J ell B) (r : R) : ℂ := let c := cleanFullMemoryEquiv P J ell B x A c.1 c.2.1 (cleanFullMemorySlice f c.1 c.2.1) c.2.2.1 (r, c.2.2.2) theorem clean_full_memory_lift_slice {G R : Type*} {P : G → Finset ℕ} {J ell B : ℕ} (A : ∀ (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)), (RepeatedBigLists P J ell → (R × FixedOrderedResidues p) → ℂ) → RepeatedBigLists P J ell → (R × FixedOrderedResidues p) → ℂ) (f : CleanFullMemoryState P J ell B → R → ℂ) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) : cleanFullMemorySlice (cleanFullMemoryLift A f) N p = A N p (cleanFullMemorySlice f N p) := by funext source r have hc : cleanFullMemoryEquiv P J ell B (cleanFullMemoryState N p source r.2) = ⟨N, p, source, r.2⟩ := (cleanFullMemoryEquiv P J ell B).apply_symm_apply ⟨N, p, source, r.2⟩ unfold cleanFullMemorySlice cleanFullMemoryLift rw [hc] rfl theorem clean_full_memory_slice_ext {G R : Type*} {P : G → Finset ℕ} {J ell B : ℕ} {f g : CleanFullMemoryState P J ell B → R → ℂ} (h : ∀ (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun j => (N j).val)), cleanFullMemorySlice f N p = cleanFullMemorySlice g N p) : f = g := by funext x r let c := cleanFullMemoryEquiv P J ell B x have he := congrFun (congrFun (h c.1 c.2.1) c.2.2.1) (r, c.2.2.2) change f ((cleanFullMemoryEquiv P J ell B).symm c) r = g ((cleanFullMemoryEquiv P J ell B).symm c) r at he simpa only [c, Equiv.symm_apply_apply] using he noncomputable def cleanFullMemoryActiveMap {G R : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell B : ℕ} (f : CleanFullMemoryState P J ell B → R → ℂ) (x : CleanFullMemoryState P J ell B) (r : R) : ℂ := fullActiveAverage (fun y => f y r) x theorem clean_full_memory_active_map_slice {G R : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell B : ℕ} (f : CleanFullMemoryState P J ell B → R → ℂ) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) : cleanFullMemorySlice (cleanFullMemoryActiveMap f) N p = cleanActiveMap repeatedBigSymmetrizeLinear (cleanFullMemorySlice f N p) := by funext source r exact clean_full_memory_active_average N p (fun x => f x r.1) source r.2 noncomputable def cleanFullMemoryPatternDampedAction {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell B : ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) : (CleanFullMemoryState Pb J ell B → PhysicalResidues Ps → ℂ) → CleanFullMemoryState Pb J ell B → PhysicalResidues Ps → ℂ := cleanFullMemoryLift (fun _ p => cleanHybridPatternDampedAction Vb b C ζ θ ρ k (fun _ => B) p K d) theorem clean_full_memory_pattern_damped_apply {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell B : ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState Pb J ell B → PhysicalResidues Ps → ℂ) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels Pb (fun g => (N g).val)) (source : RepeatedBigLists Pb J ell) (rs : PhysicalResidues Ps) (rm : FixedOrderedResidues p) : cleanFullMemoryPatternDampedAction Vb b C ζ θ ρ k K d f (cleanFullMemoryState N p source rm) rs = ∑ i, ∑ aux, ∑ target, (cleanHybridBetweenKernel Vb b (C i) ζ θ ρ k (fun _ => B) p rm (K i) d aux source target * physicalPhase ζ (physicalSharedProduct d)) * f (cleanFullMemoryState N p target (fixedOrderedResidueTranslate p rm (cleanHybridStep k (C i) source aux d))) (physicalTranslateResidues rs (cleanHybridStep k (C i) source aux d)) := by exact congrFun (congrFun (clean_full_memory_lift_slice (fun _ p => cleanHybridPatternDampedAction Vb b C ζ θ ρ k (fun _ => B) p K d) f N p) source) (rs, rm) theorem clean_full_memory_projected_damped_lift {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell B : ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState Pb J ell B → PhysicalResidues Ps → ℂ) : cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction Vb b C ζ θ ρ k K d (cleanFullMemoryActiveMap f)) = cleanFullMemoryLift (fun _ p v => cleanActiveMap repeatedBigSymmetrizeLinear (cleanHybridPatternDampedAction Vb b C ζ θ ρ k (fun _ => B) p K d (cleanActiveMap repeatedBigSymmetrizeLinear v))) f := by apply clean_full_memory_slice_ext intro N p rw [clean_full_memory_active_map_slice, cleanFullMemoryPatternDampedAction, clean_full_memory_lift_slice, clean_full_memory_active_map_slice, clean_full_memory_lift_slice] end Bounty end section /- The omitted Q bands have factorial-normalized product weight at most one. -/ open Finset namespace Bounty theorem candidate_macro_Q_weight_le_one {c L : ℝ} (hcL : 0 ≤ c*L) (r J n : ℕ) : orderedSlotWeight (fun i : (candidateMacroQIndices c L J) × Fin r => candidateQBand (c*L) i.1.val) ((r.factorial : ℝ)^(candidateMacroQIndices c L J).card) n ≤ 1 := by have hdisj : Pairwise (fun i j : candidateMacroQIndices c L J => Disjoint (candidateQBand (c*L) i.val) (candidateQBand (c*L) j.val)) := by intro i j hij exact pairwise_disjoint_dyadicPrimeBand hcL (by norm_num) (by norm_num) (fun h => hij (Subtype.ext h)) simpa only [Fintype.card_coe] using grouped_prime_slot_weight_le_one (fun j : candidateMacroQIndices c L J => candidateQBand (c*L) j.val) r (fun _ _ hp => (mem_filter.mp hp).2) hdisj n theorem candidate_micro_Q_product_pos (c L : ℝ) (r jStar J : ℕ) (x : ∀ i, candidateMicroQSlotChoices c L r jStar J i) : 0 < orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) x := by apply Nat.pos_of_ne_zero apply prod_ne_zero_iff.mpr intro slot _ exact candidate_Q_slot_nonzero c L r jStar (⟨slot.1.val, (mem_filter.mp slot.1.property).1⟩, slot.2) (x slot).property theorem candidate_macro_Q_no_small_prime {c L z : ℝ} {r J : ℕ} (hz : ∀ j ∈ candidateMacroQIndices c L J, ∀ p ∈ candidateQBand (c*L) j, z < (p : ℝ)) (y : ∀ i : (candidateMacroQIndices c L J) × Fin r, candidateQBand (c*L) i.1.val) {p : ℕ} (hp : p.Prime) (hpz : (p : ℝ) ≤ z) : ¬ p ∣ orderedSlotProduct (fun i : (candidateMacroQIndices c L J) × Fin r => candidateQBand (c*L) i.1.val) y := by intro hdiv obtain ⟨i, _, hi⟩ := ((Nat.prime_iff.mp hp).dvd_finsetProd_iff (fun i => (y i).val)).mp hdiv have hyprime : (y i).val.Prime := (mem_filter.mp (y i).property).2 have heq : p = (y i).val := ((Nat.dvd_prime hyprime).mp hi).resolve_left hp.ne_one have hlarge := hz i.1.val i.1.property (y i).val (y i).property exact (not_lt_of_ge hpz) (heq.symm ▸ hlarge) end Bounty end section /- Prime marks are distinct and their product divides every marked integer. -/ open Finset namespace Bounty theorem chosen_mark_set_prime {G : Type*} [Fintype G] (P : G → Finset ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (x : ∀ g, P g) : ∀ p ∈ chosenMarkSet P x, p.Prime := by intro p hp obtain ⟨g, _, rfl⟩ := mem_image.mp hp exact hprime g _ (x g).property theorem chosen_mark_product {G : Type*} [Fintype G] (P : G → Finset ℕ) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : ∀ g, P g) : (∏ p ∈ chosenMarkSet P x, p) = orderedSlotProduct P x := by unfold chosenMarkSet orderedSlotProduct rw [prod_image] intro a _ b _ hab exact chosen_mark_injective P hdisj x hab section variable {G : Type*} [sharedInstance1 : Fintype G] (P : G → Finset ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) include G sharedInstance1 P hprime theorem chosen_mark_product_primeFactors (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : ∀ g, P g) : (orderedSlotProduct P x).primeFactors = chosenMarkSet P x := by rw [← chosen_mark_product P hdisj x, Nat.primeFactors_prod (chosen_mark_set_prime P hprime x)] theorem chosen_mark_product_dvd (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : ∀ g, P g) (u : ℕ) (hx : ∀ g, (x g).val ∣ u) : orderedSlotProduct P x ∣ u := by rw [← chosen_mark_product P hdisj x] apply prod_primes_dvd u · intro p hp exact Nat.prime_iff.mp (chosen_mark_set_prime P hprime x p hp) · intro p hp obtain ⟨g, _, rfl⟩ := mem_image.mp hp exact hx g theorem chosen_mark_product_ne_zero (x : ∀ g, P g) : orderedSlotProduct P x ≠ 0 := by exact prod_ne_zero_iff.mpr (fun g _ => (hprime g _ (x g).property).ne_zero) theorem chosen_mark_product_support (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : ∀ g, P g) : (orderedSlotProduct P x).primeFactors ⊆ univ.biUnion P := by rw [chosen_mark_product_primeFactors P hprime hdisj x] intro p hp obtain ⟨g, _, rfl⟩ := mem_image.mp hp exact mem_biUnion.mpr ⟨g, mem_univ _, (x g).property⟩ end end Bounty end section /- A pinned original birth slot costs its actual atom, with the other samples left free. -/ open Finset Classical namespace Bounty section Edge variable {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (stores promotions : Finset (Fin t)) (e : promotions ↪ ↥(unrestrictedResidueEligible n Δ D s.2.2)) (i : {j : Fin t // j ∉ promotions}) (p : P) (F : ({j : {j : Fin t // j ∉ promotions} // j ≠ i} → P) → ℝ) end Edge section Ghost variable {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (q ρ V : ℝ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (b : Fin (B + 1)) (retained : Finset (Fin s.2.1.val)) (i : Fin b.val) (p : P) (F : ({j : Fin b.val // j ≠ i} → UnrestrictedResidueParticle n) → ℝ) end Ghost end Bounty end section /- Freshness and distinctness predicates on the actual local optional birth labels. -/ namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) def FullMixedLocalBirthAvoids (H : (g : Fin N) → Finset (P g)) (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) : Prop := ∀ a z, fullMixedEventBirthLabel n S B A Δ D tag s e a = some z → z.2 ∉ H z.1 def FullMixedLocalBirthDistinct (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) : Prop := ∀ a b z, fullMixedEventBirthLabel n S B A Δ D tag s e a = some z → fullMixedEventBirthLabel n S B A Δ D tag s e b = some z → a = b theorem full_mixed_ghost_local_label (j : J) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s) (g : Fin N) (i : Fin B) (hi : i.val < (e.down g).1.val) : fullMixedEventBirthLabel n S B A Δ D (some (.inl j)) s e ⟨g, i⟩ = some ⟨g, ((e.down g).2.2 ⟨i.val, hi⟩).1⟩ := by unfold fullMixedEventBirthLabel rw [full_mixed_ghost_born_data n S B A Δ D j s e g i hi] rfl theorem full_mixed_ghost_local_label_some (j : J) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s) (g : Fin N) (i : Fin B) (z : (g : Fin N) × P g) (hz : fullMixedEventBirthLabel n S B A Δ D (some (.inl j)) s e ⟨g, i⟩ = some z) : ∃ hi : i.val < (e.down g).1.val, z = ⟨g, ((e.down g).2.2 ⟨i.val, hi⟩).1⟩ := by by_cases hi : i.val < (e.down g).1.val · rw [full_mixed_ghost_local_label n S B A Δ D j s e g i hi] at hz exact ⟨hi, (Option.some.inj hz).symm⟩ · simp only [fullMixedEventBirthLabel, fullMixedEventBornData, dif_neg hi, Option.map_none] at hz cases hz theorem full_mixed_edge_local_label (k : K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent (J := J) n S B A Δ D (some (.inr k)) s) (g : Fin N) (i : Fin (S k g)ᶜ.card) (hi : i ∉ (e.2 g).2.1) : fullMixedEventBirthLabel n S B A Δ D (some (.inr k)) s e ⟨g, i⟩ = some ⟨g, (e.2 g).2.2.2 ⟨i, hi⟩⟩ := by unfold fullMixedEventBirthLabel rw [full_mixed_edge_born_data n S B A Δ D k s e g i hi] rfl theorem full_mixed_edge_local_label_some (k : K) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent (J := J) n S B A Δ D (some (.inr k)) s) (g : Fin N) (i : Fin (S k g)ᶜ.card) (z : (g : Fin N) × P g) (hz : fullMixedEventBirthLabel n S B A Δ D (some (.inr k)) s e ⟨g, i⟩ = some z) : ∃ hi : i ∉ (e.2 g).2.1, z = ⟨g, (e.2 g).2.2.2 ⟨i, hi⟩⟩ := by by_cases hi : i ∈ (e.2 g).2.1 · simp only [fullMixedEventBirthLabel, fullMixedEventBornData] at hz split_ifs at hz with h · cases hz · exact (h hi).elim · rw [full_mixed_edge_local_label n S B A Δ D k s e g i hi] at hz exact ⟨hi, (Option.some.inj hz).symm⟩ end Full end Bounty end section /- Exact clean joint-event extraction, with the total memory cutoff retained. -/ open Finset open scoped Classical namespace Bounty theorem product_memory_coordinate_actions_eq {G : Type*} [DecidableEq G] {P Z : G → Type*} {t : G → ℕ} {B : ℕ} (A C : ∀ g, (BoundedOrderedState (P g) (Z g) (t g) B → ℂ) → BoundedOrderedState (P g) (Z g) (t g) B → ℂ) (hAC : ∀ g f, BoundedOrderedSymmetric f → A g f = C g f) (groups : Finset G) (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) : finiteCoordinateFinsetAction A groups f = finiteCoordinateFinsetAction C groups f := by rw [← product_memory_projected_finset_eq A groups f hf, ← product_memory_projected_finset_eq C groups f hf] have he : (fun g h => A g (boundedMemorySymmetrize h)) = (fun g h => C g (boundedMemorySymmetrize h)) := by funext g h exact hAC g _ (boundedMemorySymmetrize_symmetric h) rw [he] noncomputable def unrestrictedBoundedCleanFactor {P : Type*} (n : P → ℕ) (Δ : ℤ) (ρ : ℝ) {t B : ℕ} (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : ℝ := ρ ^ orderedPredicateCount (boundedOrderedTupleToFinite s.2) unrestrictedResidueHit * ρ ^ orderedPredicateCount (boundedOrderedTupleToFinite (unrestrictedBoundedCleanTarget n Δ s s.1).2) unrestrictedResidueHit theorem unrestricted_product_clean_event_sum {G : Type*} [Fintype G] [dG : DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : (∑ e : UnrestrictedJointEvent n Δ D t B s, (∏ g, (if (e g).1 = ∅ ∧ (e g).2.1 = ∅ then unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (s g) (e g) else 0 : ℝ) : ℂ) * f (unrestrictedJointEventTarget n Δ D t B s e)) = (∏ g, (unrestrictedBoundedCleanFactor (n g) (Δ g) ρ (s g) : ℂ)) * ∑ target : (∀ g, Fin (t g) → P g), (∏ g, (∏ j, μ g (target g j) : ℝ) : ℂ) * f (fun g => unrestrictedBoundedCleanTarget (n g) (Δ g) (s g) (target g)) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) let E := fun g => UnrestrictedBoundedEvent (n g) (Δ g) (D g) (t g) B let w := fun g x (e : E g x) => if e.1 = ∅ ∧ e.2.1 = ∅ then unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B x e else 0 let z := fun g => unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B let E' := fun g (_ : BoundedOrderedState (P g) (UnrestrictedResidueParticle (n g)) (t g) B) => Fin (t g) → P g let w' := fun g x (target : E' g x) => unrestrictedBoundedCleanFactor (n g) (Δ g) ρ x * ∏ j, μ g (target j) let z' := fun g x (target : E' g x) => unrestrictedBoundedCleanTarget (n g) (Δ g) x target have hlocal : ∀ g h, BoundedOrderedSymmetric h → finiteLocalEventAction E w z g h = finiteLocalEventAction E' w' z' g h := by intro g h hh funext x have he := unrestricted_bounded_clean_event_sum (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (fun _ => 1) h hh x change (∑ e : E g x, (w g x e : ℂ) * h (z g x e)) = _ calc _ = ∑ e : UnrestrictedBoundedEvent (n g) (Δ g) (D g) (t g) B x, (unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B x e : ℂ) * (if e.1 = ∅ ∧ e.2.1 = ∅ then 1 else 0) * h (z g x e) := by apply sum_congr rfl intro e _ dsimp only [w] split_ifs <;> simp _ = _ := by rw [he] simp only [finiteLocalEventAction, w', z', unrestrictedBoundedCleanFactor, Complex.ofReal_mul, mul_one, mul_sum, mul_assoc] apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro a _ rfl have he := congrFun ((finite_product_event_eq_coordinate_action E w z f).trans ((product_memory_coordinate_actions_eq (finiteLocalEventAction E w z) (finiteLocalEventAction E' w' z') hlocal univ f hf).trans (finite_product_event_eq_coordinate_action E' w' z' f).symm)) s simp only [finiteProductEventAction, mul_one, w, z, E, E', w', z', Complex.ofReal_prod, Complex.ofReal_mul, prod_mul_distrib, mul_sum, mul_assoc] at he ⊢ refine Eq.trans ?_ (he.trans ?_) all_goals apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro a _ rfl end Bounty end section /- The displacement read from canonical shared-coordinate fibers is exactly the physical displacement in the clean kernel. No source-dependent step is postulated: all of its big shared factors are recovered from the fiber. -/ open Finset open scoped Classical namespace Bounty noncomputable def cleanFullSharedD {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (c : SharedActiveLabels (fun g => P g) (cleanFullSharedSlots (ell := ell) C)) (aux : PhysicalAuxLabels P C) : ℕ := ∏ g, ((∏ j, (c g j).val) * ∏ j : C g, (aux g j).val) noncomputable def cleanFullSharedStep {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell : ℕ} (k : ℤ) (C : G → Finset (Fin J)) (c : SharedActiveLabels (fun g => P g) (cleanFullSharedSlots (ell := ell) C)) (aux : PhysicalAuxLabels P C) (d : PhysicalSharedLists Ps J) : ℤ := (k * (cleanFullSharedD C c aux : ℤ)) * (physicalSharedProduct d : ℤ) theorem cleanFullShared_label_product {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (source : RepeatedBigLists P J ell) (g : G) : (∏ j : Fin (cleanFullSharedSlots (ell := ell) C g).card, (source g (finSumFinEquiv.symm (((cleanFullSharedSlots C g).equivFin.symm j).val))).val) = ∏ j ∈ univ \ C g, (source g (Sum.inl j)).val := by calc _ = ∏ j : cleanFullSharedSlots (ell := ell) C g, (source g (finSumFinEquiv.symm j.val)).val := Equiv.prod_comp (cleanFullSharedSlots C g).equivFin.symm (fun j => (source g (finSumFinEquiv.symm j.val)).val) _ = ∏ j ∈ cleanFullSharedSlots (ell := ell) C g, (source g (finSumFinEquiv.symm j)).val := prod_coe_sort (cleanFullSharedSlots (ell := ell) C g) (fun j => (source g (finSumFinEquiv.symm j)).val) _ = _ := by simp only [cleanFullSharedSlots, physicalSharedSlots, prod_map, Equiv.toEmbedding_apply, Equiv.symm_apply_apply, Function.Embedding.inl_apply] theorem cleanFullSharedD_split {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell B : ℕ} (C : G → Finset (Fin J)) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) (aux : PhysicalAuxLabels P C) : cleanFullSharedD C (productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).1 aux = repeatedBigD C source aux := by unfold cleanFullSharedD repeatedBigD apply prod_congr rfl intro g _ congr 1 exact cleanFullShared_label_product C source g theorem cleanFullSharedStep_split {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} (k : ℤ) (C : G → Finset (Fin J)) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) (aux : PhysicalAuxLabels P C) (d : PhysicalSharedLists Ps J) : cleanFullSharedStep k C (productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).1 aux d = cleanHybridStep k C source aux d := by rw [cleanFullSharedStep, cleanFullSharedD_split, cleanHybridStep] end Bounty end section /- The full coupled ghost coefficient factors over the reconstructed birth coordinates. -/ open Finset Classical namespace Bounty noncomputable def coupledGhostSkeletonAbsMass {G : Type*} [Fintype G] {P Z : G → Type*} (A D : ∀ g, Z g → ℝ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (sk : CoupledGhostSkeleton t B s) : ℝ := if productTotalMemory s ≤ B ∧ (∑ g, boundedGhostSkeletonOutputCount (t g) B (s g) (sk g).1 (sk g).2) ≤ B then ∏ g, boundedGhostSkeletonAbsMass (A g) (D g) (t g) B (s g) (sk g).1 (sk g).2 else 0 theorem coupled_ghost_skeleton_abs_mass_nonneg {G : Type*} [Fintype G] {P Z : G → Type*} (A D : ∀ g, Z g → ℝ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (sk : CoupledGhostSkeleton t B s) : 0 ≤ coupledGhostSkeletonAbsMass A D t B s sk := by unfold coupledGhostSkeletonAbsMass split_ifs · exact prod_nonneg fun g _ => bounded_ghost_skeleton_abs_mass_nonneg _ _ _ _ _ _ _ · exact le_rfl theorem coupled_ghost_skeleton_weight_factor {G : Type*} [Fintype G] {P Z : G → Type*} (A D C ν : ∀ g, Z g → ℝ) (hν : ∀ g z, 0 ≤ ν g z) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (sk : CoupledGhostSkeleton t B s) (births : CoupledGhostSamples t B s sk) : |coupledGhostJointEventWeight A D C ν t B s ((coupledGhostSkeletonEquiv t B s).symm ⟨sk, births⟩)| = coupledGhostSkeletonAbsMass A D t B s sk * ∏ i : CoupledGhostSampleIndex t B s sk, |C i.1 (births i)| * ν i.1 (births i) := by unfold coupledGhostJointEventWeight coupledGhostSkeletonAbsMass rw [coupled_ghost_skeleton_target_memory] split_ifs · rw [abs_prod, Fintype.prod_sigma] change (∏ g, |boundedGhostEventWeight (A g) (D g) (C g) (ν g) (t g) B (s g) ⟨(sk g).1, (sk g).2, fun j => births ⟨g, j⟩⟩|) = _ simp_rw [bounded_ghost_event_abs_factor _ _ _ _ (hν _)] exact prod_mul_distrib · simp only [abs_zero, zero_mul] end Bounty end section /- The full edge coefficient retains its auxiliary draw, both caps and all fresh coordinates. -/ open Finset Classical namespace Bounty section Full variable {G : Type*} [Fintype G] {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (ρ : ℝ) (V : G → ℝ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n S B A Δ D s) noncomputable def fullActiveEdgeSkeletonAbsMass : ℝ := let c := (productActiveMemorySplit S B s).1 let r := (productActiveMemorySplit S B s).2 |ω c sk.1| * (if productTotalMemory r ≤ B ∧ (∑ g, unrestrictedSkeletonOutputCount (n g) (Δ c sk.1 g) (D c sk.1 g) (S g)ᶜ.card B (r g) (sk.2 g)) ≤ B then ∏ g, |unrestrictedBoundedSkeletonMass (n g) (Δ c sk.1 g) (D c sk.1 g) ρ (V g) (S g)ᶜ.card B (r g) (sk.2 g).1 (sk.2 g).2.1 (sk.2 g).2.2| else 0) theorem full_active_edge_skeleton_abs_mass_nonneg : 0 ≤ fullActiveEdgeSkeletonAbsMass n S B A Δ D ω ρ V s sk := by unfold fullActiveEdgeSkeletonAbsMass apply mul_nonneg (abs_nonneg _) split_ifs · exact prod_nonneg fun g _ => abs_nonneg _ · exact le_rfl theorem full_active_edge_skeleton_target_memory (fresh : FullActiveEdgeSamples n S B A Δ D s sk) : productTotalMemory (unrestrictedJointEventTarget n (Δ (productActiveMemorySplit S B s).1 sk.1) (D (productActiveMemorySplit S B s).1 sk.1) (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B s).2 ((fullActiveEdgeSkeletonEquiv n S B A Δ D s).symm ⟨sk, fresh⟩).2) = ∑ g, unrestrictedSkeletonOutputCount (n g) (Δ (productActiveMemorySplit S B s).1 sk.1 g) (D (productActiveMemorySplit S B s).1 sk.1 g) (S g)ᶜ.card B ((productActiveMemorySplit S B s).2 g) (sk.2 g) := by apply sum_congr rfl intro g _ exact unrestricted_bounded_skeleton_target_count _ _ _ _ _ _ _ _ theorem full_active_edge_skeleton_weight_factor (μ : ∀ g, P g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (fresh : FullActiveEdgeSamples n S B A Δ D s sk) : |fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V s ((fullActiveEdgeSkeletonEquiv n S B A Δ D s).symm ⟨sk, fresh⟩)| = fullActiveEdgeSkeletonAbsMass n S B A Δ D ω ρ V s sk * ∏ i : FullActiveEdgeSampleIndex n S B A Δ D s sk, μ i.1 (fresh i) := by unfold fullActiveEdgeEventWeight unrestrictedJointCutoffEventWeight change |ω (productActiveMemorySplit S B s).1 sk.1 * (if productTotalMemory (productActiveMemorySplit S B s).2 ≤ B ∧ productTotalMemory (unrestrictedJointEventTarget n (Δ (productActiveMemorySplit S B s).1 sk.1) (D (productActiveMemorySplit S B s).1 sk.1) (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B s).2 ((fullActiveEdgeSkeletonEquiv n S B A Δ D s).symm ⟨sk, fresh⟩).2) ≤ B then _ else 0)| = _ rw [full_active_edge_skeleton_target_memory] unfold fullActiveEdgeSkeletonAbsMass dsimp only rw [abs_mul] split_ifs · rw [abs_prod, Fintype.prod_sigma] change |ω (productActiveMemorySplit S B s).1 sk.1| * (∏ g, |unrestrictedBoundedEventWeight (n g) (Δ (productActiveMemorySplit S B s).1 sk.1 g) (D (productActiveMemorySplit S B s).1 sk.1 g) (μ g) ρ (V g) (S g)ᶜ.card B ((productActiveMemorySplit S B s).2 g) ⟨(sk.2 g).1, (sk.2 g).2.1, (sk.2 g).2.2, fun j => fresh ⟨g, j⟩⟩|) = _ simp_rw [unrestricted_bounded_event_fresh_factor] simp_rw [abs_mul, abs_of_nonneg (unrestrictedFreshWeight_nonneg _ _ (hμ _) _)] rw [prod_mul_distrib, mul_assoc] rfl · simp only [abs_zero, mul_zero, zero_mul] end Full end Bounty end section /- The skeleton equivalences reconstruct exactly the original mixed events and their targets. -/ namespace Bounty section Mixed variable {J K G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → G → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) noncomputable def fullPermutationGhostBirthEquiv (j : J) : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s ≃ (sk : CoupledGhostSkeleton M B s) × CoupledGhostSamples M B s sk := Equiv.ulift.trans (coupledGhostSkeletonEquiv M B s) noncomputable def fullPermutationEdgeBirthEquiv (k : K) : FullPermutationMixedEvent (J := J) n S B A Δ D (some (.inr k)) s ≃ (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) × FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk := fullActiveEdgeSkeletonEquiv n (S k) B (A k) (Δ k) (D k) s theorem full_permutation_ghost_skeleton_target (j : J) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) : fullPermutationMixedEventTarget n S B A Δ D (some (.inl j)) s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩) = coupledGhostJointEventTarget M B s ((coupledGhostSkeletonEquiv M B s).symm ⟨sk, births⟩) := rfl theorem full_permutation_edge_skeleton_target (k : K) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) : fullPermutationMixedEventTarget (J := J) n S B A Δ D (some (.inr k)) s ((fullPermutationEdgeBirthEquiv (J := J) n S B A Δ D s k).symm ⟨sk, fresh⟩) = fullActiveEdgeEventTarget n (S k) B (A k) (Δ k) (D k) s ((fullActiveEdgeSkeletonEquiv n (S k) B (A k) (Δ k) (D k) s).symm ⟨sk, fresh⟩) := rfl theorem full_permutation_ghost_skeleton_weight [Fintype G] [DecidableEq G] (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) (j : J) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) : fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V (some (.inl j)) s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩) = coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (q j) ρ) (fun g => physicalGhostTermination (n g) (q j) ρ) (fun g => physicalGhostBirth (n g) (q j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B s ((coupledGhostSkeletonEquiv M B s).symm ⟨sk, births⟩) := rfl theorem full_permutation_edge_skeleton_weight [Fintype G] [DecidableEq G] (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) (k : K) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) : fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V (some (.inr k)) s ((fullPermutationEdgeBirthEquiv (J := J) n S B A Δ D s k).symm ⟨sk, fresh⟩) = fullActiveEdgeEventWeight n (S k) B (A k) (Δ k) (D k) (ω k) μ ρ V s ((fullActiveEdgeSkeletonEquiv n (S k) B (A k) (Δ k) (D k) s).symm ⟨sk, fresh⟩) := rfl end Mixed end Bounty end section /- Explicit conversion between canonical first/tail coordinates and the physical pattern-dependent slot enumeration. The permutation depends only on the cut, and every ordered pending-memory coordinate is untouched. -/ open Finset open scoped Classical namespace Bounty noncomputable def cleanPhysicalSlotChange {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) : FullActiveSlotPermutations (fun _ : G => J + ell) := fun g => (physicalFullSlotIndex (C g)).trans finSumFinEquiv theorem clean_physical_slot_change_shared {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) (i : Fin (J + ell)) : cleanPhysicalSlotChange C g i ∈ cleanFullSharedSlots C g ↔ i ∈ physicalFullSharedIndices (C g) := by change finSumFinEquiv (physicalFullSlotIndex (C g) i) ∈ cleanFullSharedSlots C g ↔ _ simpa only [cleanFullSharedSlots, mem_map_equiv, Equiv.symm_apply_apply] using physical_full_slot_index_shared_iff (C g) i theorem clean_physical_repeated_encoding {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (source : RepeatedBigLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) : fullActivePermutation (cleanPhysicalSlotChange C) (fun g => (fun j => source g (finSumFinEquiv.symm j), q g)) = (fun g => (fun j => source g (physicalFullSlotIndex (C g) j), q g)) := by funext g apply Prod.ext · funext j change source g (finSumFinEquiv.symm (finSumFinEquiv (physicalFullSlotIndex (C g) j))) = _ rw [Equiv.symm_apply_apply] · rfl theorem clean_full_memory_physical_encoding {G : Type*} {P : G → Finset ℕ} {J ell B : ℕ} (C : G → Finset (Fin J)) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) : fullActivePermutation (cleanPhysicalSlotChange C) (cleanFullMemoryState N p source r) = (fun g => (fun j => source g (physicalFullSlotIndex (C g) j), (⟨N g, fun j => ⟨p g j, r g j⟩⟩ : BoundedOrderedTuple (UnrestrictedResidueParticle (fun q : P g => q.val)) B))) := clean_physical_repeated_encoding C source _ end Bounty end section /- The unchanged endpoint sum and source-injectivity extension preserve the birth factor. -/ open Finset open scoped Classical namespace Bounty section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (H : (g : Fin N) → Finset ↥(P g)) (ω : ∀ _c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_full_endpoint_birth_factor (L : PhysicalMarkLists P J ell) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) : physicalFullEndpointPhase C k L H q ω μ ρ V e = (if (∀ g i, (e.2 g).2.2.2 i ∉ H g) ∧ (∀ g, Function.Injective (e.2 g).2.2.2) then 1 else 0) * physicalFullEndpointPhase C k L (fun _ => ∅) q ω μ ρ V e := by unfold physicalFullEndpointPhase by_cases hw : fullActiveEdgeEventWeight (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e = 0 · simp only [if_pos hw, mul_zero] · simp only [if_neg hw] calc _ = ∑ R : PhysicalMarkLists P J ell, (if (∀ g i, (e.2 g).2.2.2 i ∉ H g) ∧ (∀ g, Function.Injective (e.2 g).2.2.2) then (1 : ℂ) else 0) * physicalFullEdgePhase C k L R (fun _ => ∅) q e := sum_congr rfl (fun R _ => physical_full_edge_phase_birth_factor C k L R H q e) _ = _ := (mul_sum _ _ _).symm theorem physical_full_global_birth_factor (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullEdgeEvent C k x) : physicalFullGlobalEdgePhase C k H ω μ ρ V x e = (if (∀ g i, (e.2 g).2.2.2 i ∉ H g) ∧ (∀ g, Function.Injective (e.2 g).2.2.2) then 1 else 0) * physicalFullGlobalEdgePhase C k (fun _ => ∅) ω μ ρ V x e := by have hencoded (L : PhysicalMarkLists P J ell) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) : physicalFullGlobalEdgePhase C k H ω μ ρ V (physicalFullMemoryState C L q) e = (if (∀ g i, (e.2 g).2.2.2 i ∉ H g) ∧ (∀ g, Function.Injective (e.2 g).2.2.2) then 1 else 0) * physicalFullGlobalEdgePhase C k (fun _ => ∅) ω μ ρ V (physicalFullMemoryState C L q) e := by rw [physical_full_global_edge_phase_encode, physical_full_global_edge_phase_encode] exact physical_full_endpoint_birth_factor C k H ω μ ρ V L q e by_cases hx : FullActiveInjective x · have h := hencoded (physicalFullStateLabels C x hx) (fun g => (x g).2) rw [physical_full_state_encode_labels C x hx] at h exact h e · simp only [physicalFullGlobalEdgePhase, dif_neg hx, mul_zero] end Physical end Bounty end section /- Converting microscopic harmonic masses into the actual candidate window mass. -/ open Filter namespace Bounty theorem harmonic_mass_normalization {P Q H A C K T : ℝ} (hP : 1 ≤ P) (hH : 0 ≤ H) (hC : 0 ≤ C) (hK : 0 < K) (hT : 0 < T) (hmicro : H ≤ C*Q) (hmass : K*T*P*Q ≤ A) : P*H ≤ (C/(K*T))*A ∧ H ≤ (C/(K*T))*A := by have hprod : P*Q ≤ A/(K*T) := by apply (le_div_iff₀ (mul_pos hK hT)).mpr nlinarith only [hmass] have hmain : P*H ≤ (C/(K*T))*A := by calc P*H ≤ P*(C*Q) := mul_le_mul_of_nonneg_left hmicro (by linarith) _ = C*(P*Q) := by ring _ ≤ C*(A/(K*T)) := mul_le_mul_of_nonneg_left hprod hC _ = _ := by ring exact ⟨hmain, (le_mul_of_one_le_left hH hP).trans hmain⟩ theorem exists_candidate_micro_mass_normalization {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) (J : ℕ) : ∃ C : ℝ, 0 < C ∧ ∃ J0 : ℕ, J ≤ J0 ∧ ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J0 < jStar → candidateOneMarkedHarmonicMass c L q * candidateMicroQHarmonicMass c L r jStar J ≤ C*(L/Real.exp L)*candidateCoefficientWindowMass c L q r jStar ∧ candidateMicroQHarmonicMass c L r jStar J ≤ C*(L/Real.exp L)*candidateCoefficientWindowMass c L q r jStar := by obtain ⟨Cm, hCm, hmicro⟩ := exists_candidate_micro_Q_harmonic_comparison hc r J obtain ⟨Klo, Khi, hKlo, _, Jlo, hmass⟩ := exists_candidate_coefficient_window_mass_comparison hc hr hq0 hq1 hcenter refine ⟨Cm/Klo, div_pos hCm hKlo, max J Jlo, le_max_left _ _, ?_⟩ filter_upwards [hmicro, hmass, eventually_candidate_one_marked_mass_ge_one hc hq0 hq1.le, eventually_gt_atTop (0 : ℝ)] with L hm hmassL hP hL intro jStar hj have hjJ : J ≤ jStar := le_trans (le_max_left _ _) (Nat.le_of_lt hj) have hjlo : Jlo < jStar := lt_of_le_of_lt (le_max_right _ _) hj have h := harmonic_mass_normalization hP (candidate_micro_Q_harmonic_nonneg c L r jStar J) hCm.le hKlo (div_pos (Real.exp_pos _) hL) (hm jStar hjJ) (hmassL jStar hjlo).1 have heq : Cm/(Klo*(Real.exp L/L)) = (Cm/Klo)*(L/Real.exp L) := by field_simp simpa only [heq] using h end Bounty end section /- Compatible dyadic pairs occupy only a bounded number of second-coordinate indices. -/ open Finset namespace Bounty def dyadicPairIndices (S : Finset (ℕ × ℕ)) : Finset (ℕ × ℕ) := S.image (fun v => (v.1.log2, v.2.log2)) def dyadicPairBucket (S : Finset (ℕ × ℕ)) (k : ℕ × ℕ) : Finset (ℕ × ℕ) := S.filter (fun v => (v.1.log2, v.2.log2) = k) theorem sum_dyadic_pair_buckets (S : Finset (ℕ × ℕ)) (w : ℕ × ℕ → ℝ) : (∑ k ∈ dyadicPairIndices S, ∑ v ∈ dyadicPairBucket S k, w v) = ∑ v ∈ S, w v := by exact sum_fiberwise_of_maps_to (fun v hv => mem_image_of_mem _ hv) w theorem dyadic_pair_index_log_bounds {L : ℝ} {v : ℕ × ℕ} (hm : 0 < v.1) (hn : 0 < v.2) (hlo : Real.exp L ≤ ((v.1*v.2 : ℕ) : ℝ)) (hhi : ((v.1*v.2 : ℕ) : ℝ) ≤ 33*Real.exp L) : L/Real.log 2-2 < (v.1.log2 : ℝ)+(v.2.log2 : ℝ) ∧ (v.1.log2 : ℝ)+(v.2.log2 : ℝ) ≤ (L+Real.log 33)/Real.log 2 := by have h2 : 0 < Real.log 2 := Real.log_pos (by norm_num) have hmR : (0 : ℝ) < v.1 := Nat.cast_pos.mpr hm have hnR : (0 : ℝ) < v.2 := Nat.cast_pos.mpr hn have hmB := dyadic_log2_real_bounds hm have hnB := dyadic_log2_real_bounds hn have hloglo := Real.log_le_log (Real.exp_pos L) hlo have hloghi := Real.log_le_log (by positivity : (0 : ℝ) < ((v.1*v.2 : ℕ) : ℝ)) hhi simp only [Real.log_exp, Nat.cast_mul, Real.log_mul hmR.ne' hnR.ne'] at hloglo hloghi rw [Real.log_mul (by norm_num : (33 : ℝ) ≠ 0) (Real.exp_pos L).ne', Real.log_exp] at hloghi have hl := div_le_div_of_nonneg_right hloglo h2.le have hu := div_le_div_of_nonneg_right hloghi h2.le simp only [add_div] at hl hu ⊢ constructor <;> linarith theorem dyadic_pair_second_diameter (S : Finset (ℕ × ℕ)) {L : ℝ} (hS : ∀ v ∈ S, 0 < v.1 ∧ 0 < v.2 ∧ Real.exp L ≤ ((v.1*v.2 : ℕ) : ℝ) ∧ ((v.1*v.2 : ℕ) : ℝ) ≤ 33*Real.exp L) {k l : ℕ × ℕ} (hk : k ∈ dyadicPairIndices S) (hl : l ∈ dyadicPairIndices S) (hfirst : k.1 = l.1) : k.2 ≤ l.2+8 := by obtain ⟨v, hv, rfl⟩ := mem_image.mp hk obtain ⟨w, hw, rfl⟩ := mem_image.mp hl obtain ⟨hv1, hv2, hvlo, hvhi⟩ := hS v hv obtain ⟨hw1, hw2, hwlo, hwhi⟩ := hS w hw have hV := dyadic_pair_index_log_bounds hv1 hv2 hvlo hvhi have hW := dyadic_pair_index_log_bounds hw1 hw2 hwlo hwhi have hlog33 : Real.log 33 < 6*Real.log 2 := by have h := Real.log_lt_log (by norm_num : (0 : ℝ) < 33) (by norm_num : (33 : ℝ) < 2^6) rw [Real.log_pow] at h norm_num at h ⊢ exact h have h2 : 0 < Real.log 2 := Real.log_pos (by norm_num) have hquot : Real.log 33/Real.log 2 < 6 := (div_lt_iff₀ h2).mpr hlog33 simp only [add_div] at hV hW change v.1.log2 = w.1.log2 at hfirst rw [hfirst] at hV have hR : (v.2.log2 : ℝ) ≤ (w.2.log2 : ℝ)+8 := by linarith exact_mod_cast hR end Bounty end section /- A genuine weighted row bound for the original bounded ghost event sum. -/ open Finset Classical namespace Bounty theorem bounded_ghost_length_row_le {P Z : Type*} [Fintype Z] (A D C ν : Z → ℝ) (v : ℝ) (hA : ∀ z, 0 ≤ A z) (hν : ∀ z, 0 ≤ ν z) (hv : 0 ≤ v) (hdamp : ∀ z, A z * v + |D z| ≤ v) (t B : ℕ) (s : BoundedOrderedState P Z t B) : (∑ e : BoundedGhostEvent t B s, |boundedGhostEventWeight A D C ν t B s e| * v ^ (boundedGhostEventTarget t B s e).2.1.val) ≤ Real.exp ((∑ z, |C z| * ν z) * v) * v ^ s.2.1.val := by have hmass : 0 ≤ ∑ z, |C z| * ν z := sum_nonneg fun z _ => mul_nonneg (abs_nonneg _) (hν z) calc _ ≤ ∑ b : Fin (B + 1), ∑ r : Finset (Fin s.2.1.val), ∑ births : Fin b.val → Z, (((∏ i ∈ r, A (s.2.2 i)) * (∏ i ∈ univ \ r, |D (s.2.2 i)|)) * (∏ i, |C (births i)| * ν (births i)) / (b.val.factorial : ℝ)) * v ^ (r.card + b.val) := by simp only [Fintype.sum_sigma, Fintype.sum_prod_type] apply sum_le_sum intro b _ apply sum_le_sum intro r _ apply sum_le_sum intro births _ rw [boundedGhostEventWeight_abs A D C ν hA hν] by_cases h : r.card + b.val ≤ B · simp only [boundedGhostEventWeight, h, if_true, bounded_ghost_target_count, boundedGhostSkeletonOutputCount] exact le_rfl · simp only [boundedGhostEventWeight, h, if_false, zero_mul] exact mul_nonneg (div_nonneg (mul_nonneg (mul_nonneg (prod_nonneg fun i _ => hA _) (prod_nonneg fun i _ => abs_nonneg _)) (prod_nonneg fun i _ => mul_nonneg (abs_nonneg _) (hν _))) (Nat.cast_nonneg _)) (pow_nonneg hv _) _ = (∏ i, (A (s.2.2 i) * v + |D (s.2.2 i)|)) * ∑ b ∈ range (B + 1), ((∑ z, |C z| * ν z) * v) ^ b / (b.factorial : ℝ) := ghost_uncut_length_sum A D C ν v t B s _ ≤ (∏ i, (A (s.2.2 i) * v + |D (s.2.2 i)|)) * Real.exp ((∑ z, |C z| * ν z) * v) := mul_le_mul_of_nonneg_left (Real.sum_le_exp_of_nonneg (mul_nonneg hmass hv) _) (prod_nonneg fun i _ => add_nonneg (mul_nonneg (hA _) hv) (abs_nonneg _)) _ ≤ v ^ s.2.1.val * Real.exp ((∑ z, |C z| * ν z) * v) := by apply mul_le_mul_of_nonneg_right _ (Real.exp_pos _).le rw [← Fin.prod_const] exact prod_le_prod₀ (fun i _ => add_nonneg (mul_nonneg (hA _) hv) (abs_nonneg _)) (fun i _ => hdamp _) _ = _ := mul_comm _ _ end Bounty end section /- Supported original occurrences have adjacent states and their original observations. -/ namespace Bounty section Paths variable {K X O : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) theorem finite_event_local_phase_supported_invariant (phase : ∀ k x, E k x → ℂ) (Q : X → Prop) (hstep : ∀ k x e, Q x → phase k x e ≠ 0 → Q (target k x e)) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (hx : Q x) (hp : finiteEventLocalPhase E target phase steps x p ≠ 0) (i : Fin steps.length) : Q (finiteEventPathOccurrence E target steps x p i).1 ∧ Q (target (steps.get i) (finiteEventPathOccurrence E target steps x p i).1 (finiteEventPathOccurrence E target steps x p i).2) := by induction steps generalizing x with | nil => exact Fin.elim0 i | cons k steps ih => rcases p with ⟨e, p⟩ have hboth := mul_ne_zero_iff.mp hp have hnext := hstep k x e hx hboth.1 refine Fin.cases ?_ (fun j => ?_) i · exact ⟨hx, hnext⟩ · exact ih (target k x e) p hnext hboth.2 j theorem finite_event_occurrence_source_after (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (i : ℕ) (hi : i + 1 < steps.length) : (finiteEventPathOccurrence E target steps x p ⟨i + 1, hi⟩).1 = target (steps.get ⟨i, by omega⟩) (finiteEventPathOccurrence E target steps x p ⟨i, by omega⟩).1 (finiteEventPathOccurrence E target steps x p ⟨i, by omega⟩).2 := by induction steps generalizing x i with | nil => simp only [List.length_nil] at hi; omega | cons k steps ih => rcases p with ⟨e, p⟩ cases i with | zero => cases steps with | nil => simp only [List.length_cons, List.length_nil] at hi; omega | cons l steps => rfl | succ i => exact ih (target k x e) p i (by simp only [List.length_cons] at hi; omega) theorem finite_event_observations_get (observe : ∀ k x, E k x → O) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (i : ℕ) (hi : i < steps.length) : (finiteEventPathObservations E target observe steps x p).get ⟨i, by rw [finite_event_path_observations_length]; exact hi⟩ = observe (steps.get ⟨i, hi⟩) (finiteEventPathOccurrence E target steps x p ⟨i, hi⟩).1 (finiteEventPathOccurrence E target steps x p ⟨i, hi⟩).2 := by induction steps generalizing x i with | nil => simp only [List.length_nil] at hi; omega | cons k steps ih => rcases p with ⟨e, p⟩ cases i with | zero => rfl | succ i => exact ih (target k x e) p i (by simp only [List.length_cons] at hi; omega) end Paths end Bounty end section /- A fixed initial ledger excludes fresh active births. Retained shared slots and auxiliary draws are not births and are not tested by this mask. -/ open Finset open scoped Classical namespace Bounty def cleanInitialBirthAllowed {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (F : ∀ g, Finset (P g)) (C : G → Finset (Fin J)) (target : RepeatedBigLists P J ell) : Prop := ∀ g (s : PhysicalSlots J ell), repeatedBigUnshared C g s → target g s ∉ F g noncomputable def cleanInitialBirthKernel {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (F : ∀ g, Finset (P g)) (C : G → Finset (Fin J)) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (source target : RepeatedBigLists P J ell) (aux : PhysicalAuxLabels P C) : ℂ := if cleanInitialBirthAllowed F C target then K source target aux else 0 theorem clean_initial_birth_allowed_fill {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (F : ∀ g, Finset (P g)) (C : G → Finset (Fin J)) (source : RepeatedBigLists P J ell) (fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) : cleanInitialBirthAllowed F C (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) ↔ ∀ g i, fresh g i ∉ F g := by constructor · intro h g i have hi := h g (cleanFullUnsharedIndex C g i).val (cleanFullUnsharedIndex C g i).property simpa only [repeated_big_fill_unshared, cleanFullFreshEquiv_apply_index] using hi · intro h g s hs simp only [repeatedBigFill, dif_pos hs] obtain ⟨i, hi⟩ := (cleanFullUnsharedIndex C g).surjective ⟨s, hs⟩ rw [← hi, cleanFullFreshEquiv_apply_index] exact h g i end Bounty end section /- Earlier-operation parent labels are fixed anchors; within-operation parents retain chronological order. -/ open Finset Classical namespace Bounty abbrev birthLabelsAnchored {n : ℕ} {α : Type*} (anchor : Fin n → Option α) (a : Fin n → α) : Prop := ∀ i p, anchor i = some p → a i = p theorem labeled_anchored_birth_forest_sum_le {n : ℕ} (Z : Fin n → Type*) [∀ i, Fintype (Z i)] {α : Type*} [Fintype α] [DecidableEq α] (label : ∀ i, Z i → α) (w : ∀ i, Z i → ℝ) (code : BirthForestCode n) (anchor : Fin n → Option α) (M ε : Fin n → ℝ) (hM : ∀ i, 0 ≤ M i) (hε : ∀ i, 0 ≤ ε i) (hw : ∀ i z, 0 ≤ w i z) (hsum : ∀ i, ∑ z, w i z ≤ M i) (hatom : ∀ i a, finiteLabelMass (label i) (w i) a ≤ ε i) : (∑ f : ∀ i, Z i, if birthForestEqualValues code (fun i => label i (f i)) ∧ birthLabelsAnchored anchor (fun i => label i (f i)) then ∏ i, w i (f i) else 0) ≤ ∏ i, match code i with | some _ => ε i | none => match anchor i with | none => M i | some _ => ε i := by let wa : ∀ i, Z i → ℝ := fun i z => if ∀ p, anchor i = some p → label i z = p then w i z else 0 let Ma : Fin n → ℝ := fun i => match anchor i with | none => M i | some _ => ε i have hwa : ∀ i z, 0 ≤ wa i z := by intro i z dsimp [wa] split_ifs <;> simp_all have hMa : ∀ i, 0 ≤ Ma i := by intro i dsimp [Ma] cases anchor i <;> simp only [hM, hε] have hsa : ∀ i, ∑ z, wa i z ≤ Ma i := by intro i cases ha : anchor i with | none => simpa [wa, Ma, ha] using hsum i | some p => simpa only [wa, Ma, ha, Option.some.injEq, forall_eq', finiteLabelMass] using hatom i p have haa : ∀ i a, finiteLabelMass (label i) (wa i) a ≤ ε i := by intro i a apply le_trans _ (hatom i a) apply sum_le_sum intro z _ dsimp [wa] split_ifs <;> simp_all have hb := labeled_birth_forest_sum_le Z label wa code Ma ε hMa hε hwa hsa haa have he (f : ∀ i, Z i) : (if birthForestEqualValues code (fun i => label i (f i)) then ∏ i, wa i (f i) else 0) = if birthForestEqualValues code (fun i => label i (f i)) ∧ birthLabelsAnchored anchor (fun i => label i (f i)) then ∏ i, w i (f i) else 0 := by have hp : (∏ i, wa i (f i)) = if birthLabelsAnchored anchor (fun i => label i (f i)) then ∏ i, w i (f i) else 0 := by dsimp only [wa] rw [prod_ite_zero] simp only [mem_univ, forall_const, birthLabelsAnchored] rw [hp] split_ifs <;> simp_all simp_rw [he] at hb apply le_trans hb apply le_of_eq apply prod_congr rfl intro i _ cases code i <;> rfl end Bounty end section /- Atom bounds retain group tags and integrate the full ghost residue data. -/ open Finset Classical namespace Bounty theorem finiteLabelMass_tagged_prime_le {G : Type*} {P : G → Type*} [DecidableEq (Sigma P)] (g : G) [Fintype (P g)] (μ : P g → ℝ) {η : ℝ} (hη : 0 ≤ η) (hμ : ∀ p, μ p ≤ η) (a : Sigma P) : finiteLabelMass (fun p : P g => (⟨g, p⟩ : Sigma P)) μ a ≤ η := by rcases a with ⟨h, p⟩ by_cases he : g = h · subst h unfold finiteLabelMass simpa only [Sigma.mk.inj_iff, heq_eq_eq, true_and, sum_ite_eq', mem_univ, ite_true] using hμ p · have hn (q : P g) : (⟨g, q⟩ : Sigma P) ≠ ⟨h, p⟩ := by intro hq exact he (congrArg Sigma.fst hq) simpa only [finiteLabelMass, hn, if_false, sum_const_zero] using hη theorem finiteLabelMass_tagged_ghost_le {G : Type*} {P : G → Type*} [DecidableEq (Sigma P)] (g : G) [Fintype (P g)] (n : P g → ℕ) [∀ p, NeZero (n p)] (μ : P g → ℝ) (q ρ V : ℝ) {η : ℝ} (hη : 0 ≤ η) (hμ : ∀ p, μ p ≤ η) (a : Sigma P) : finiteLabelMass (fun z : UnrestrictedResidueParticle n => (⟨g, z.1⟩ : Sigma P)) (physicalGhostBirthAtom n μ q ρ V) a ≤ |(1 - q) * V / ρ| * η := by rcases a with ⟨h, p⟩ by_cases he : g = h · subst h unfold finiteLabelMass have heq : (∑ z : UnrestrictedResidueParticle n, if (⟨g, z.1⟩ : Sigma P) = ⟨g, p⟩ then physicalGhostBirthAtom n μ q ρ V z else 0) = ∑ z : UnrestrictedResidueParticle n, if z.1 = p then physicalGhostBirthAtom n μ q ρ V z else 0 := by apply sum_congr rfl intro z _ simp only [Sigma.mk.inj_iff, heq_eq_eq, true_and] rw [heq, physical_ghost_birth_atom_prime_sum] exact mul_le_mul_of_nonneg_left (hμ p) (abs_nonneg _) · have hn (z : UnrestrictedResidueParticle n) : (⟨g, z.1⟩ : Sigma P) ≠ ⟨h, p⟩ := by intro hz exact he (congrArg Sigma.fst hz) simpa only [finiteLabelMass, hn, if_false, sum_const_zero] using mul_nonneg (abs_nonneg ((1 - q) * V / ρ)) hη end Bounty end section /- Exact coefficients and targets under an old-memory permutation. -/ open Finset Classical namespace Bounty section Edge variable {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (Δ D : ℤ) {t B : ℕ} (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (τ : Equiv.Perm (Fin s.2.1.val)) (e : UnrestrictedBoundedEvent n Δ D t B s) theorem bounded_edge_reindex_test {K : Type*} [Zero K] (f : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → K) (hf : BoundedOrderedSymmetric f) : f (unrestrictedBoundedEventTarget n Δ D t B (boundedGhostMemoryPermute s τ) (boundedEdgeMemoryReindex n Δ D s τ e)) = f (unrestrictedBoundedEventTarget n Δ D t B s e) := by let out := unrestrictedEdgeMemory s.2.2 (unrestrictedResidueTransport n Δ) (unrestrictedStoredTuple s.1 (unrestrictedResidueSeed n) e.1) e.2.2.1 let out' := unrestrictedEdgeMemory (s.2.2 ∘ τ) (unrestrictedResidueTransport n Δ) (unrestrictedStoredTuple s.1 (unrestrictedResidueSeed n) e.1) (residuePromotionReindex n Δ D s.2.2 τ e.2.2.1) have hl : out'.1 = out.1 := by simp only [out, out', unrestrictedEdgeMemory_length] have hext := symmetric_tuple_equal_on_occupancy (boundedOrderedZeroExtension f (unrestrictedEdgeTarget s.2.2 Sigma.fst e.2.1 e.2.2.1 e.2.2.2)) ((boundedOrderedZeroExtension_symmetric_iff f).mpr hf _) out' out (residue_promotion_reindex_memory n Δ D s.2.2 τ e.2.2.1 _) rw [boundedEdgeMemoryReindex_apply] change f (if h : out'.1 ≤ B then (unrestrictedEdgeTarget (s.2.2 ∘ τ) Sigma.fst e.2.1 (residuePromotionReindex n Δ D s.2.2 τ e.2.2.1) e.2.2.2, ⟨⟨out'.1, Nat.lt_succ_of_le h⟩, out'.2⟩) else boundedGhostMemoryPermute s τ) = f (if h : out.1 ≤ B then (unrestrictedEdgeTarget s.2.2 Sigma.fst e.2.1 e.2.2.1 e.2.2.2, ⟨⟨out.1, Nat.lt_succ_of_le h⟩, out.2⟩) else s) rw [residue_promotion_reindex_target] by_cases h : out.1 ≤ B · simpa only [boundedOrderedZeroExtension, hl, h, dif_pos] using hext · simp only [hl, h] exact hf s.1 s.2.1 s.2.2 τ theorem bounded_edge_reindex_length : (unrestrictedBoundedEventTarget n Δ D t B (boundedGhostMemoryPermute s τ) (boundedEdgeMemoryReindex n Δ D s τ e)).2.1 = (unrestrictedBoundedEventTarget n Δ D t B s e).2.1 := by apply Fin.ext exact bounded_edge_reindex_test n Δ D s τ e (fun x => x.2.1.val) (by intro active N q σ; rfl) theorem bounded_edge_reindex_active : (unrestrictedBoundedEventTarget n Δ D t B (boundedGhostMemoryPermute s τ) (boundedEdgeMemoryReindex n Δ D s τ e)).1 = (unrestrictedBoundedEventTarget n Δ D t B s e).1 := by have h := bounded_edge_reindex_test n Δ D s τ e (fun x => if x.1 = (unrestrictedBoundedEventTarget n Δ D t B s e).1 then (1 : ℂ) else 0) (by intro active N q σ; rfl) by_contra hne simp only [hne, if_false, if_true, zero_ne_one] at h theorem bounded_edge_reindex_weight (μ : P → ℝ) (ρ V : ℝ) : unrestrictedBoundedEventWeight n Δ D μ ρ V t B (boundedGhostMemoryPermute s τ) (boundedEdgeMemoryReindex n Δ D s τ e) = unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e := by have hc : orderedPredicateCount (unrestrictedEdgeMemory (s.2.2 ∘ τ) (unrestrictedResidueTransport n Δ) (unrestrictedStoredTuple s.1 (unrestrictedResidueSeed n) e.1) (residuePromotionReindex n Δ D s.2.2 τ e.2.2.1)) unrestrictedResidueHit = orderedPredicateCount (unrestrictedEdgeMemory s.2.2 (unrestrictedResidueTransport n Δ) (unrestrictedStoredTuple s.1 (unrestrictedResidueSeed n) e.1) e.2.2.1) unrestrictedResidueHit := by apply symmetric_tuple_equal_on_occupancy (fun q : FiniteOrderedTuple (UnrestrictedResidueParticle n) => orderedPredicateCount q unrestrictedResidueHit) (fun _ q σ => orderedPredicateCount_permutation q unrestrictedResidueHit σ) exact residue_promotion_reindex_memory n Δ D s.2.2 τ e.2.2.1 _ rw [boundedEdgeMemoryReindex_apply] simp only [unrestrictedBoundedEventWeight, boundedGhostMemoryPermute, unrestrictedEdgeOutput, unrestrictedEdgeMemory_length] split_ifs · simp only [unrestrictedEdgeEventMass, unrestrictedEdgeOutput, orderedPredicateCount_permutation, hc] · rfl end Edge end Bounty end section /- Joint signed ghost events preserve their ordered birth batches under memory reindexing. -/ open Finset Classical namespace Bounty theorem bounded_ghost_reindex_length {P Z : Type*} {t B : ℕ} (s : BoundedOrderedState P Z t B) (τ : Equiv.Perm (Fin s.2.1.val)) (e : BoundedGhostEvent t B s) : (boundedGhostEventTarget t B (boundedGhostMemoryPermute s τ) (boundedGhostEventPermEquiv s τ e)).2.1 = (boundedGhostEventTarget t B s e).2.1 := by rw [boundedGhostEventPermEquiv_apply] by_cases h : e.2.1.card + e.1.val ≤ B · simp [boundedGhostEventTarget, boundedGhostMemoryPermute, retainedBirthTuple, h] · simp [boundedGhostEventTarget, boundedGhostMemoryPermute, retainedBirthTuple, h] section Joint variable {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (Z g)] [∀ g, DecidableEq (Z g)] (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P Z t B) (τ : ∀ g, Equiv.Perm (Fin (s g).2.1.val)) noncomputable def jointGhostMemoryReindex : CoupledGhostEvent t B s ≃ CoupledGhostEvent t B (productMemoryReindex s τ) := Equiv.piCongrRight fun g => boundedGhostEventPermEquiv (s g) (τ g) theorem joint_ghost_reindex_test (e : CoupledGhostEvent t B s) (f : ProductBoundedOrderedState P Z t B → ℂ) (hf : ProductMemorySymmetric f) : f (coupledGhostJointEventTarget t B (productMemoryReindex s τ) (jointGhostMemoryReindex t B s τ e)) = f (coupledGhostJointEventTarget t B s e) := by apply product_memory_test_congr f hf intro g h hh exact bounded_ghost_event_perm_test (s g) (τ g) (e g) h hh omit [DecidableEq G] [∀ g, Fintype (Z g)] [∀ g, DecidableEq (Z g)] in theorem joint_ghost_reindex_total (e : CoupledGhostEvent t B s) : productTotalMemory (coupledGhostJointEventTarget t B (productMemoryReindex s τ) (jointGhostMemoryReindex t B s τ e)) = productTotalMemory (coupledGhostJointEventTarget t B s e) := by apply sum_congr rfl intro g _ exact congrArg Fin.val (bounded_ghost_reindex_length (s g) (τ g) (e g)) omit [DecidableEq G] [∀ g, Fintype (Z g)] [∀ g, DecidableEq (Z g)] in theorem joint_ghost_reindex_weight (A D C ν : ∀ g, Z g → ℝ) (e : CoupledGhostEvent t B s) : coupledGhostJointEventWeight A D C ν t B (productMemoryReindex s τ) (jointGhostMemoryReindex t B s τ e) = coupledGhostJointEventWeight A D C ν t B s e := by unfold coupledGhostJointEventWeight rw [joint_ghost_reindex_total] have hs : productTotalMemory (productMemoryReindex s τ) = productTotalMemory s := rfl rw [hs] split_ifs · apply prod_congr rfl intro g _ exact bounded_ghost_event_perm_weight (A g) (D g) (C g) (ν g) (s g) (τ g) (e g) · rfl end Joint end Bounty end section /- Original physical full-edge coefficients with an external finite residue coordinate translated separately for each auxiliary draw. The initial forbidden set applies only to raw fresh births. -/ open Finset Classical namespace Bounty theorem clean_weighted_norm_eq_external_energy {X R : Type*} [Fintype X] [Fintype R] (w : X → ℝ) (f : X → R → ℂ) : cleanWeightedNorm w f = Real.sqrt (∑ r, finiteWeightedEnergy w (fun x => f x r)) := by unfold cleanWeightedNorm finiteWeightedEnergy congr 1 simp only [mul_sum] exact sum_comm end Bounty end section /- Exact separation of full edge events into empty storage/promotion and its complement. Both pieces retain the original capped event weights. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) end end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V ρ : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) (cap : ℕ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] /- The actual total-cutoff joint kernel is exactly the flattened real capped tensor kernel, for every atomic index used by the finite path. -/ include hstep in theorem physical_joint_adjacent_kernel_to_real (i : ℕ) (hi : i < 2 * n + 1) (z w : (g : Fin N) → (p : ↥(P g)) → GhostPhaseState (ZMod p.val)) : globalBirthJointKernel (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V ρ hV cap i) cap z w = ((finiteAlternatingKernel (physicalJointCappedVisitKernel L β η ρ cap) (physicalJointCappedMovingEdgeKernel L a β V ρ cap) i (globalBirthFlattenPhase z) (globalBirthFlattenPhase w) : ℝ) : ℂ) := by have hg (g : Fin N) := physical_adjacent_atomic_kernel_to_real C aux k L a σ τ hstep hcompat hlist hP hdis g (fun j => hk j g) (β g) (η g) (V g) (ρ g) (hV g) cap i hi (z g) (w g) calc _ = ((if (∑ g, (ghostPhasePendingSupport (z g)).card) ≤ cap then ∏ g, finiteAlternatingKernel (physicalResidueCappedVisitKernel L g (β g) (η g) (ρ g) cap) (physicalResidueCappedMovingEdgeKernel L a g (β g) (V g) (ρ g) cap) i (z g) (w g) else 0 : ℝ) : ℂ) := by unfold globalBirthJointKernel change (if _ then ∏ g, globalBirthRawStepKernel (physicalGroupAdjacentFiniteStep C aux k L a σ τ hcompat hlist hP hdis g (fun j => hk j g) (β g) (η g) (V g) (ρ g) (hV g) cap i) (z g) (w g) else 0) = _ simp_rw [hg] simp only [globalBirthJointPending] split_ifs <;> simp only [Complex.ofReal_prod, Complex.ofReal_zero] _ = _ := by apply congrArg (fun r : ℝ => (r : ℂ)) by_cases he : i % 2 = 0 · simp only [finiteAlternatingKernel, he, ite_true] exact ghost_phase_grouped_capped_visit _ _ _ _ _ cap z w · simp only [finiteAlternatingKernel, he, ite_false] exact ghost_phase_grouped_capped_moving_edge _ _ _ _ _ _ _ cap z w end ResiduePath end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) include hstep in theorem physical_joint_adjacent_edge_literal_tensor (j : Fin n) (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (s : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) : globalBirthJointCutRawRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V (fun _ => ρ) hV B (2 * j.val + 1)) B B F s = jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) (C j) (k j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ)) β ρ V (aux j)) F s := by have hr : (fun g (K : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val) → ℂ) (u : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val)) => globalBirthRawStepRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V (fun _ => ρ) hV B (2 * j.val + 1) g) (fun H q => K (H, q)) u.1 u.2) = physicalFullEdgeRawRow (B := B) (C j) (k j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ)) β ρ V (aux j) := by funext g K u exact (by have h := physical_group_adjacent_finite_edge_row C aux k L a σ τ hstep hcompat hlist hP hdis g (fun j => hk j g) (β g) (η g) (V g) ρ (hV g) B j (fun H q => K (H, q)) u.1 u.2 have hδ := physical_group_phase_delta_as_integer_step (P := P) (a j.castSucc) (a j.succ) (k j) (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ) (hstep j) g simp only [hδ] at h convert h using 1 <;> rfl ) unfold globalBirthJointCutRawRow globalBirthJointRawRow jointRawTensorCutoff rw [hr] end ResiduePath end Bounty end section /- Sort an actual finite sample set by its embedding into the original chronological addresses. -/ open Classical namespace Bounty noncomputable def finiteEmbeddedOrder {I : Type*} [Fintype I] {N : ℕ} (f : I ↪ Fin N) : Fin (Fintype.card I) ≃ I := (Fintype.orderIsoFinOfCardEq (Set.range f) (Fintype.card_congr (Equiv.ofInjective f f.injective).symm)).toEquiv.trans (Equiv.ofInjective f f.injective).symm theorem finite_embedded_order_strictMono {I : Type*} [Fintype I] {N : ℕ} (f : I ↪ Fin N) : StrictMono (fun j => f (finiteEmbeddedOrder f j)) := by let e := Equiv.ofInjective f f.injective have he (x : Set.range f) : f (e.symm x) = x.val := by exact congrArg Subtype.val (e.apply_symm_apply x) intro i j hij dsimp [finiteEmbeddedOrder] rw [he, he] exact (Fintype.orderIsoFinOfCardEq (Set.range f) (Fintype.card_congr e.symm)).strictMono hij end Bounty end section /- A cofactor-first form of the least-prime-factor decomposition, including repeated primes. -/ open Finset namespace Bounty theorem buchstab_cofactors_as_rough_band {U V z : ℝ} (hU : 1 ≤ U) (hV : 0 ≤ V) {p : ℕ} (hp : p.Prime) (hpz : z < (p : ℝ)) : buchstabCompositeCofactors (roughBand U V z) ⌊V⌋₊ p = (roughBand 1 V z).filter (fun m => p ≤ m.minFac ∧ U < ((p*m : ℕ) : ℝ) ∧ ((p*m : ℕ) : ℝ) ≤ V) := by classical ext m constructor · intro hm obtain ⟨hmI, hmS, hmorder⟩ := mem_filter.mp hm have hpm : p ≤ m := (mem_Icc.mp hmI).1 have hm0 : m ≠ 0 := (hp.pos.trans_le hpm).ne' have hm1 : m ≠ 1 := by have := hp.two_le.trans hpm; omega have hmrough : ∀ q ∈ m.primeFactors, z < (q : ℝ) := by intro q hq apply (mem_filter.mp hmS).2 q exact Nat.mem_primeFactors.mpr ⟨Nat.prime_of_mem_primeFactors hq, (Nat.dvd_of_mem_primeFactors hq).trans (dvd_mul_left m p), Nat.mul_ne_zero hp.ne_zero hm0⟩ have hmR : m ∈ roughBand 1 V z := mem_filter.mpr ⟨mem_Ioc.mpr ⟨by simpa only [Nat.floor_one] using (show 1 < m by have := hp.two_le.trans hpm; omega), (mem_Icc.mp hmI).2⟩, hmrough⟩ have hmin : p ≤ m.minFac := hmorder m.minFac (Nat.mem_primeFactors.mpr ⟨Nat.minFac_prime hm1, Nat.minFac_dvd m, hm0⟩) exact mem_filter.mpr ⟨hmR, hmin, Nat.lt_of_floor_lt (mem_Ioc.mp (mem_filter.mp hmS).1).1, (Nat.cast_le.mpr (mem_Ioc.mp (mem_filter.mp hmS).1).2).trans (Nat.floor_le hV)⟩ · intro hm obtain ⟨hmR, hmin, hprodlo, hprodhi⟩ := mem_filter.mp hm have hm0 : m ≠ 0 := (roughBand_pos hmR).ne' have hmrough := (mem_filter.mp hmR).2 have hpm : p ≤ m := hmin.trans (Nat.minFac_le (roughBand_pos hmR)) have hprodrough : ∀ q ∈ (p*m).primeFactors, z < (q : ℝ) := by intro q hq rw [Nat.primeFactors_mul hp.ne_zero hm0, hp.primeFactors] at hq rcases mem_union.mp hq with hqp | hqm · simpa only [mem_singleton.mp hqp] using hpz · exact hmrough q hqm have hprod : p*m ∈ roughBand U V z := mem_filter.mpr ⟨mem_Ioc.mpr ⟨(Nat.floor_lt (by linarith : 0 ≤ U)).mpr hprodlo, Nat.le_floor hprodhi⟩, hprodrough⟩ apply mem_filter.mpr refine ⟨mem_Icc.mpr ⟨hpm, (mem_Ioc.mp (mem_filter.mp hmR).1).2⟩, hprod, ?_⟩ intro q hq exact hmin.trans (Nat.minFac_le_of_dvd (Nat.prime_of_mem_primeFactors hq).two_le (Nat.dvd_of_mem_primeFactors hq)) theorem prime_part_of_rough_band {U V z : ℝ} (hU : 0 ≤ U) (hV : 0 ≤ V) : (roughBand U V z).filter Nat.Prime = primeBand (max U z) V := by classical ext p simp only [mem_filter, roughBand, mem_Ioc, Nat.floor_lt hU, Nat.le_floor_iff hV, mem_primeBand_iff (hU.trans (le_max_left _ _)) hV, max_lt_iff] constructor · rintro ⟨⟨⟨hUp, hpV⟩, hrough⟩, hp⟩ have hpz : z < (p : ℝ) := hrough p (by rw [hp.primeFactors]; exact mem_singleton_self _) exact ⟨hp, ⟨hUp, hpz⟩, hpV⟩ · rintro ⟨hp, ⟨hUp, hpz⟩, hpV⟩ refine ⟨⟨⟨hUp, hpV⟩, ?_⟩, hp⟩ intro q hq rw [hp.primeFactors] at hq simpa only [mem_singleton.mp hq] using hpz end Bounty end section /- Position-dependent local phases expand along the original, unaugmented event paths. -/ open Finset Classical namespace Bounty section Indexed variable {K X : Type*} (E : K → X → Type*) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (weight : ∀ k x, E k x → ℝ) end Indexed end Bounty end section /- The actual bounded edge skeleton has the existing damping and length cost before fresh masses are inserted. -/ open Finset Classical namespace Bounty theorem unrestricted_bounded_skeleton_length_cost {P : Type*} (n : P → ℕ) (Δ D : ℤ) (ρ V v : ℝ) (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) (hV : 0 ≤ V) (hv : 0 < v) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (sk : UnrestrictedLocalEdgeSkeleton n Δ D t B s) : |unrestrictedBoundedSkeletonMass n Δ D ρ V t B s sk.1 sk.2.1 sk.2.2| * v ^ unrestrictedSkeletonOutputCount n Δ D t B s sk ≤ (ρ ^ ((unrestrictedResidueEligible n Δ D s.2.2).card - sk.2.1.card) / V ^ sk.2.1.card) * (v ^ s.2.1.val * (v ^ sk.1.card / v ^ sk.2.1.card)) := by have hout : v ^ (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) sk.1 sk.2.1 sk.2.2).1 = v ^ s.2.1.val * (v ^ sk.1.card / v ^ sk.2.1.card) := by simpa only [unrestrictedEdgeOutput, Fintype.card_coe] using unrestrictedEdgeMemory_weight s.2.2 (unrestrictedResidueTransport n Δ) (unrestrictedStoredTuple s.1 (unrestrictedResidueSeed n) sk.1) sk.2.2 hv.ne' have hdamp : ρ ^ orderedPredicateCount ⟨s.2.1.val, s.2.2⟩ unrestrictedResidueHit * ρ ^ orderedPredicateCount (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) sk.1 sk.2.1 sk.2.2) unrestrictedResidueHit ≤ ρ ^ ((unrestrictedResidueEligible n Δ D s.2.2).card - sk.2.1.card) := by simpa only [unrestrictedEdgeOutput, Fintype.card_coe] using unrestrictedEdgeMemory_two_damping_le s.2.2 (unrestrictedResidueTransport n Δ) (unrestrictedStoredTuple s.1 (unrestrictedResidueSeed n) sk.1) unrestrictedResidueHit sk.2.2 (unrestrictedResidueEligible_translated_hit n Δ D s.2.2) hρ0 hρ1 rw [abs_of_nonneg (unrestricted_bounded_skeleton_mass_nonneg n Δ D ρ V hρ0 hV t B s sk.1 sk.2.1 sk.2.2)] by_cases hc : unrestrictedResidueStorageAllowed n D s.1 sk.1 ∧ (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) sk.1 sk.2.1 sk.2.2).1 ≤ B · simp only [unrestrictedBoundedSkeletonMass, hc, if_true, unrestrictedSkeletonOutputCount] rw [hout] exact mul_le_mul_of_nonneg_right (div_le_div_of_nonneg_right hdamp (pow_nonneg hV _)) (mul_nonneg (pow_nonneg hv.le _) (div_nonneg (pow_nonneg hv.le _) (pow_nonneg hv.le _))) · simp only [unrestrictedBoundedSkeletonMass, hc, if_false, zero_mul] exact mul_nonneg (div_nonneg (pow_nonneg hρ0 _) (pow_nonneg hV _)) (mul_nonneg (pow_nonneg hv.le _) (div_nonneg (pow_nonneg hv.le _) (pow_nonneg hv.le _))) end Bounty end section /- The shifted and ordinary sieve densities share the same positive Mertens constant. -/ open Finset Filter open scoped Topology namespace Bounty theorem logarithmic_shifted_prime_avoidance_product_tendsto : Tendsto (fun z : ℝ => Real.log z * shiftedPrimeAvoidanceProduct z) atTop (𝓝 (shiftedSieveRatioConstant * Mertens.primeProductLimitConstant)) := by have ht := odd_prime_correction_product_tendsto.mul logarithmic_prime_avoidance_product_tendsto apply ht.congr' filter_upwards [eventually_ge_atTop (2 : ℝ)] with z hz rw [shifted_prime_avoidance_product_factorization hz] ring theorem exponential_shifted_prime_avoidance_product_tendsto {b : ℝ} (hb : 0 < b) : Tendsto (fun L : ℝ => L * shiftedPrimeAvoidanceProduct (Real.exp (b*L))) atTop (𝓝 (shiftedSieveRatioConstant * Mertens.primeProductLimitConstant/b)) := by have he : Tendsto (fun L : ℝ => Real.exp (b*L)) atTop atTop := Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hb) have h := (logarithmic_shifted_prime_avoidance_product_tendsto.comp he).div_const b convert h using 1 ext L simp only [Function.comp_apply, Real.log_exp] field_simp end Bounty end section /- Averaged literal promotion operators with choice-dependent external residue translations. The external coordinate is summed before comparing per-choice energies, so its cardinality introduces no loss. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- The normalized reverse slot operator has the same energy constant as its forward transpose. No additional square of the reversal coefficient bound is lost when passing to reverse promotion events. -/ open Finset Classical namespace Bounty end Bounty end section /- The storage-only part of the full dirty edge is a difference of two positive tensor restrictions. Its transpose is the reverse edge with some promotion and no storage. The event formulas retain both total cutoffs. -/ open Finset Classical namespace Bounty theorem finite_transfer_mask_difference {G : Type*} [Fintype G] (p q : G → Prop) [DecidablePred p] [DecidablePred q] : (∏ g, if p g then (1 : ℝ) else 0) - (∏ g, if p g ∧ q g then (1 : ℝ) else 0) = if (∀ g, p g) ∧ (∃ g, ¬ q g) then 1 else 0 := by simp only [Fintype.prod_ite_zero, prod_const_one] have hh : (∀ g, p g ∧ q g) ↔ (∀ g, p g) ∧ (∀ g, q g) := forall_and simp only [hh] by_cases hp : ∀ g, p g · by_cases hq : ∀ g, q g · simp [hp, hq] · have hq' : ∃ g, ¬ q g := not_forall.mp hq simp [hp, hq, hq'] · simp [hp] section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) noncomputable def unrestrictedStorageOnlyProduct := unrestrictedCoupledCutoffProductOperator n Δ D μ ρ V t B (fun _ e => if (∀ g, (e g).2.1 = ∅) ∧ (∃ g, (e g).1 ≠ ∅) then 1 else 0) noncomputable def unrestrictedReversePromotionOnlyProduct := unrestrictedCoupledCutoffProductOperator n (fun g => -Δ g) D μ ρ V t B (fun _ e => ((∏ g, V g ^ (e g).2.1.card / V g ^ (e g).1.card : ℝ) : ℂ) * (if (∀ g, (e g).1 = ∅) ∧ (∃ g, (e g).2.1 ≠ ∅) then 1 else 0)) /- Two tensor restrictions differ exactly by the nonempty-storage gate. -/ theorem unrestricted_storage_only_product_difference (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) : unrestrictedStorageOnlyProduct n Δ D μ ρ V t B f = fun s => productMemoryCutoff (unrestrictedRealSlotProduct n Δ D μ ρ V t B (fun _ _ T => if T = ∅ then 1 else 0) (productMemoryCutoff f)) s - productMemoryCutoff (unrestrictedRealSlotProduct n Δ D μ ρ V t B (fun _ S T => if T = ∅ ∧ S = ∅ then 1 else 0) (productMemoryCutoff f)) s := by rw [unrestricted_real_slot_product_eq_coupled, unrestricted_real_slot_product_eq_coupled] funext s unfold unrestrictedStorageOnlyProduct unrestrictedCoupledCutoffProductOperator productMemoryCutoff split_ifs with hcap · simp only [unrestrictedCoupledProductOperator, finiteProductEventAction] rw [← sum_sub_distrib] apply sum_congr rfl intro e he have hm := finite_transfer_mask_difference (fun g => (e g).2.1 = ∅) (fun g => (e g).1 = ∅) have hc := congrArg (fun r : ℝ => (r : ℂ)) hm have hcast (p : Prop) [Decidable p] : Complex.ofReal (if p then (1 : ℝ) else 0) = if p then (1 : ℂ) else 0 := by split_ifs <;> rfl simp only [Complex.ofReal_sub, hcast] at hc rw [← sub_mul, ← mul_sub, hc] · simp only [sub_self] theorem unrestricted_reverse_promotion_only_product_difference (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) : unrestrictedReversePromotionOnlyProduct n Δ D μ ρ V t B f = fun s => productMemoryCutoff (unrestrictedRealSlotProduct n (fun g => -Δ g) D μ ρ V t B (fun g S T => V g ^ T.card / V g ^ S.card * (if S = ∅ then 1 else 0)) (productMemoryCutoff f)) s - productMemoryCutoff (unrestrictedRealSlotProduct n (fun g => -Δ g) D μ ρ V t B (fun g S T => V g ^ T.card / V g ^ S.card * (if S = ∅ ∧ T = ∅ then 1 else 0)) (productMemoryCutoff f)) s := by rw [unrestricted_real_slot_product_eq_coupled, unrestricted_real_slot_product_eq_coupled] funext s unfold unrestrictedReversePromotionOnlyProduct unrestrictedCoupledCutoffProductOperator productMemoryCutoff split_ifs with hcap · simp only [unrestrictedCoupledProductOperator, finiteProductEventAction] rw [← sum_sub_distrib] apply sum_congr rfl intro e he have hm := finite_transfer_mask_difference (fun g => (e g).1 = ∅) (fun g => (e g).2.1 = ∅) have hc := congrArg (fun r : ℝ => (r : ℂ)) hm have hcast (p : Prop) [Decidable p] : Complex.ofReal (if p then (1 : ℝ) else 0) = if p then (1 : ℂ) else 0 := by split_ifs <;> rfl simp only [Complex.ofReal_sub, hcast] at hc simp only [prod_mul_distrib, Complex.ofReal_mul] rw [← sub_mul, ← mul_sub, ← mul_sub, hc] · simp only [sub_self] theorem unrestricted_storage_only_product_symmetric (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (unrestrictedStorageOnlyProduct n Δ D μ ρ V t B f) := by rw [unrestricted_storage_only_product_difference] have ha := productMemoryCutoff_symmetric _ (unrestricted_real_slot_product_symmetric n Δ D μ ρ V t B (fun _ _ T => if T = ∅ then 1 else 0) (productMemoryCutoff f) (productMemoryCutoff_symmetric f hf)) have hb := productMemoryCutoff_symmetric _ (unrestricted_real_slot_product_symmetric n Δ D μ ρ V t B (fun _ S T => if T = ∅ ∧ S = ∅ then 1 else 0) (productMemoryCutoff f) (productMemoryCutoff_symmetric f hf)) intro x j τ dsimp only rw [ha x j τ, hb x j τ] theorem unrestricted_reverse_promotion_only_product_symmetric (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (unrestrictedReversePromotionOnlyProduct n Δ D μ ρ V t B f) := by rw [unrestricted_reverse_promotion_only_product_difference] have ha := productMemoryCutoff_symmetric _ (unrestricted_real_slot_product_symmetric n (fun j => -Δ j) D μ ρ V t B (fun j S T => V j ^ T.card / V j ^ S.card * (if S = ∅ then 1 else 0)) (productMemoryCutoff f) (productMemoryCutoff_symmetric f hf)) have hb := productMemoryCutoff_symmetric _ (unrestricted_real_slot_product_symmetric n (fun j => -Δ j) D μ ρ V t B (fun j S T => V j ^ T.card / V j ^ S.card * (if S = ∅ ∧ T = ∅ then 1 else 0)) (productMemoryCutoff f) (productMemoryCutoff_symmetric f hf)) intro x j τ dsimp only rw [ha x j τ, hb x j τ] /- Full product/factorial-measure storage adjoint with the exact reverse volume ratio, all group sums, and both total caps. -/ theorem unrestricted_storage_only_product_pairing (hV : ∀ g, V g ≠ 0) (f g : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) (hg : ProductMemorySymmetric g) : (∑ s, (productMemoryWeight μ (fun j => unrestrictedResidueWeight (μ j)) s : ℂ) * f s * unrestrictedStorageOnlyProduct n Δ D μ ρ V t B g s) = ∑ s, (productMemoryWeight μ (fun j => unrestrictedResidueWeight (μ j)) s : ℂ) * unrestrictedReversePromotionOnlyProduct n Δ D μ ρ V t B f s * g s := by rw [unrestricted_storage_only_product_difference, unrestricted_reverse_promotion_only_product_difference] simp only [mul_sub, sub_mul, sum_sub_distrib] rw [unrestricted_real_slot_cutoff_pairing n Δ D μ ρ V t B hV (fun _ _ T => if T = ∅ then 1 else 0) f g hf hg, unrestricted_real_slot_cutoff_pairing n Δ D μ ρ V t B hV (fun _ S T => if T = ∅ ∧ S = ∅ then 1 else 0) f g hf hg] end end Bounty end section /- Bilinear transposition of a finite external permutation uses its inverse. The external counting measure is preserved exactly, with no cardinality factor. -/ open Finset Classical namespace Bounty theorem finite_external_bilinear_transpose {X R : Type*} [Fintype X] [Fintype R] (μ : X → ℝ) (A T : (X → ℂ) → X → ℂ) (τ : R ≃ R) (f g : X → R → ℂ) (hpair : ∀ r q, (∑ x, (μ x : ℂ) * f x r * A (fun y => g y q) x) = ∑ x, (μ x : ℂ) * T (fun y => f y r) x * g x q) : (∑ r, ∑ x, (μ x : ℂ) * f x r * A (fun y => g y (τ r)) x) = ∑ r, ∑ x, (μ x : ℂ) * T (fun y => f y (τ.symm r)) x * g x r := by calc _ = ∑ r, ∑ x, (μ x : ℂ) * T (fun y => f y r) x * g x (τ r) := by apply sum_congr rfl intro r hr exact hpair r (τ r) _ = _ := by simpa only [Equiv.symm_apply_apply] using τ.sum_comp (fun r => ∑ x, (μ x : ℂ) * T (fun y => f y (τ.symm r)) x * g x r) theorem finite_external_fiber_average_pairing {C X R : Type*} [Fintype X] [Fintype R] {A : C → Type*} [∀ c, Fintype (A c)] (μ : X → ℝ) (ω : ∀ c, A c → ℝ) (T U : ∀ c, A c → (X → ℂ) → X → ℂ) (τ : ∀ c, A c → R ≃ R) (f g : C → X → R → ℂ) (c : C) (hpair : ∀ a r q, (∑ x, (μ x : ℂ) * f c x r * T c a (fun y => g c y q) x) = ∑ x, (μ x : ℂ) * U c a (fun y => f c y r) x * g c x q) : (∑ r, ∑ x, (μ x : ℂ) * f c x r * finiteExternalFiberAverage ω T τ g c x r) = ∑ r, ∑ x, (μ x : ℂ) * finiteExternalFiberAverage ω U (fun c a => (τ c a).symm) f c x r * g c x r := by unfold finiteExternalFiberAverage simp only [mul_sum, sum_mul] have hrotate (H : R → X → A c → ℂ) : (∑ r, ∑ x, ∑ a, H r x a) = ∑ a, ∑ r, ∑ x, H r x a := by calc _ = ∑ r, ∑ a, ∑ x, H r x a := by apply sum_congr rfl intro r hr exact sum_comm _ = _ := sum_comm rw [hrotate, hrotate] apply sum_congr rfl intro a ha have h := congrArg (fun z : ℂ => (ω c a : ℂ) * z) (finite_external_bilinear_transpose μ (T c a) (U c a) (τ c a) (f c) (g c) (hpair a)) simpa only [mul_sum, mul_assoc, mul_comm, mul_left_comm] using h /- Shared-coordinate reassembly and the auxiliary sum preserve the inverse external permutation in the exact full-space transpose. -/ theorem equiv_external_fiber_average_pairing {X C Y R : Type*} [Fintype X] [Fintype C] [Fintype Y] [Fintype R] {A : C → Type*} [∀ c, Fintype (A c)] (e : X ≃ C × Y) (W : X → ℝ) (κ : C → ℝ) (μ : Y → ℝ) (hW : ∀ c y, W (e.symm (c, y)) = κ c * μ y) (ω : ∀ c, A c → ℝ) (T U : ∀ c, A c → (Y → ℂ) → Y → ℂ) (τ : ∀ c, A c → R ≃ R) (f g : X → R → ℂ) (hpair : ∀ c a r q, (∑ y, (μ y : ℂ) * f (e.symm (c, y)) r * T c a (fun z => g (e.symm (c, z)) q) y) = ∑ y, (μ y : ℂ) * U c a (fun z => f (e.symm (c, z)) r) y * g (e.symm (c, y)) q) : (∑ r, ∑ x, (W x : ℂ) * f x r * equivExternalFiberAverage e ω T τ g x r) = ∑ r, ∑ x, (W x : ℂ) * equivExternalFiberAverage e ω U (fun c a => (τ c a).symm) f x r * g x r := by have hs (u v : X → R → ℂ) : (∑ r, ∑ x, (W x : ℂ) * u x r * v x r) = ∑ c, (κ c : ℂ) * ∑ r, ∑ y, (μ y : ℂ) * u (e.symm (c, y)) r * v (e.symm (c, y)) r := by simp_rw [← e.symm.sum_comp] simp only [Fintype.sum_prod_type, hW, Complex.ofReal_mul] rw [sum_comm] apply sum_congr rfl intro c hc simp only [mul_sum, mul_assoc] rw [hs, hs] apply sum_congr rfl intro c hc congr 1 have h := finite_external_fiber_average_pairing μ ω T U τ (fun c y r => f (e.symm (c, y)) r) (fun c y r => g (e.symm (c, y)) r) c (hpair c) simpa only [equivExternalFiberAverage, Equiv.apply_symm_apply] using h end Bounty end section /- Exact disintegration of the full event sum into its chosen auxiliary draws. The law here is independent of retained labels, as in the physical auxiliary law; no positivity, symmetry or norm bound is needed. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- The literal capped promotion average gains the omission probability. The individual operator bound is derived from the actual event weights; there is no assumed operator estimate or scalar rarity premise. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Exact uniform averaging over the small residue vector alone. -/ open Finset open scoped Classical namespace Bounty theorem physical_group_residue_vertex_expectation {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (groups : Finset G) [∀ a : ↥(physicalPrimeGroups P groups), NeZero a.val.2.val] (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (q : ℕ → ℝ) : (∑ r : PhysicalGroupResidues P groups, (∏ a : ↥(physicalPrimeGroups P groups), 1 / (a.val.2.val : ℝ)) * ∏ j ∈ visits, physicalResidueVertexWeight (fun g : ↥groups => labels j g.val) (q j) (physicalTranslateResidues (physicalGroupResidueVector r) (offset j))) = ∏ a : ↥(physicalPrimeGroups P groups), (∑ z : ZMod a.val.2.val, activeResidueWeight visits (visits.filter (fun j => a.val ∈ physicalMarkedPrimes (labels j))) (fun j => -(offset j : ZMod a.val.2.val)) (fun j => 1 - q j) z) / (a.val.2.val : ℝ) := by classical simp only [← physical_group_residue_path_factorization hP hprime] let f := fun (a : ↥(physicalPrimeGroups P groups)) (z : ZMod a.val.2.val) => activeResidueWeight visits (visits.filter (fun j => a.val ∈ physicalMarkedPrimes (labels j))) (fun j => -(offset j : ZMod a.val.2.val)) (fun j => 1 - q j) z change (∑ r : PhysicalGroupResidues P groups, (∏ a : ↥(physicalPrimeGroups P groups), 1 / (a.val.2.val : ℝ)) * ∏ a, f a (r a)) = ∏ a, (∑ z, f a z) / (a.val.2.val : ℝ) have he : ∀ r : PhysicalGroupResidues P groups, (∏ a : ↥(physicalPrimeGroups P groups), 1 / (a.val.2.val : ℝ)) * ∏ a, f a (r a) = ∏ a, f a (r a) / (a.val.2.val : ℝ) := by intro r rw [← prod_mul_distrib] apply prod_congr rfl intro a _ ring simp only [he] simpa only [← sum_div] using (Fintype.prod_sum (fun (a : ↥(physicalPrimeGroups P groups)) (z : ZMod a.val.2.val) => f a z / (a.val.2.val : ℝ))).symm theorem physical_group_residue_vertex_pool_expectation {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] {J ell : ℕ} (groups : Finset G) (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (labels : ℕ → PhysicalMarkLists P J ell) (visits : Finset ℕ) (offset : ℕ → ℤ) (q : ℕ → ℝ) : (∑ r : PhysicalGroupResidues P groups, (∏ a : ↥(physicalPrimeGroups P groups), 1 / (a.val.2.val : ℝ)) * ∏ j ∈ visits, physicalResidueVertexWeight (fun g : ↥groups => labels j g.val) (q j) (physicalTranslateResidues (physicalGroupResidueVector r) (offset j))) = poolPathResidueExpectation (fun a : PhysicalPrime P => a.2.val) (physicalPrimeGroups P groups) visits (fun a => visits.filter (fun j => a ∈ physicalMarkedPrimes (labels j))) (fun a j => -(offset j : ZMod a.2.val)) (fun j => 1 - q j) := by rw [physical_group_residue_vertex_expectation groups hP hprime] exact prod_coe_sort (physicalPrimeGroups P groups) (fun a => (∑ z : ZMod a.2.val, activeResidueWeight visits (visits.filter (fun j => a ∈ physicalMarkedPrimes (labels j))) (fun j => -(offset j : ZMod a.2.val)) (fun j => 1 - q j) z) / (a.2.val : ℝ)) end Bounty end section /- Only selected groups receive a baseline and a pending-memory run history. -/ open Finset open scoped Classical namespace Bounty theorem physical_group_residue_run_normalization {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] {J ell : ℕ} (groups : Finset G) (V : G → ℝ) (L : ℕ → PhysicalMarkLists P J ell) (C : ℕ → G → Finset (Fin J)) (n : ℕ) (h : (a : PhysicalPrime P) → ℕ → ZMod a.2.val) (η : ℕ → ℝ) (b : PhysicalPrime P → ℝ) (hnew : ∀ j < n, ∀ g ∈ groups, (physicalGroupMarks (L (j + 1)) g \ physicalGroupMarks (L j) g).card = ell + (C j g).card) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a = 1 - (∑ j ∈ range (n + 1), η j) / a.2.val) (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a ≠ 0) : physicalGroupPathMass V groups C ell n * poolPathResidueExpectation (fun a : PhysicalPrime P => a.2.val) (physicalPrimeGroups P groups) (range (n + 1)) (fun a => (range (n + 1)).filter (fun j => a ∈ physicalMarkedPrimes (L j))) h η = (∏ a ∈ physicalPrimeGroups P groups, b a) * ∏ a ∈ physicalPrimeGroups P groups, ghostPhaseRunHistory (fun j => decide (a ∈ physicalMarkedPrimes (L j))) (h a) η ((a.2.val : ℝ) * b a)⁻¹ (V a.1) n := by classical rw [show physicalGroupPathMass V groups C ell n = ∏ a ∈ physicalPrimeGroups P groups, (V a.1)⁻¹ ^ ghostPhaseRunCount (fun j => decide (a ∈ physicalMarkedPrimes (L j))) n from (physical_selected_group_run_weights groups V L C n hnew).symm] unfold poolPathResidueExpectation rw [← prod_mul_distrib, ← prod_mul_distrib] apply prod_congr rfl intro a ha have hag : a.1 ∈ groups := by simpa [physicalPrimeGroups] using ha symm simpa only [ZMod.card, decide_eq_true_eq] using ghost_phase_run_history_residue_identity (fun j => decide (a ∈ physicalMarkedPrimes (L j))) (h a) η (V a.1) n (b a) (by simpa only [ZMod.card] using hb a hag) (hb0 a hag) end Bounty end section /- Split a bare edge while retaining an arbitrary coupled coefficient and the full phase. -/ open scoped Classical namespace Bounty theorem physical_phase_zero_frequency (D : ℕ) : physicalPhase 0 D = 1 := by simp only [physicalPhase, zero_mul, Complex.ofReal_zero, Complex.exp_zero] section Groups variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (small : G → Prop) (C : G → Finset (Fin J)) (ζ : ℝ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) noncomputable def physicalCoupledBigCoefficient (Ls Rs : PhysicalMarkLists (fun g : {g // small g} => P g.val) J ell) (as : PhysicalAuxLabels (fun g : {g // small g} => P g.val) (fun g => C g.val)) (Lb Rb : PhysicalMarkLists (fun g : {g // ¬small g} => P g.val) J ell) (ab : PhysicalAuxLabels (fun g : {g // ¬small g} => P g.val) (fun g => C g.val)) : ℂ := K ((physicalMarkGroupSplit small P J ell).symm (Ls, Lb)) ((physicalMarkGroupSplit small P J ell).symm (Rs, Rb)) ((physicalAuxGroupSplit small P J C).symm (as, ab)) * physicalPhase ζ (physicalD (fun g : {g // small g} => C g.val) Ls as * physicalD (fun g : {g // ¬small g} => C g.val) Lb ab) theorem physical_coupled_big_coefficient_restrict (a : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) : physicalCoupledBigCoefficient small C ζ K (fun g => L g.val) (fun g => R g.val) (fun g => a g.val) (fun g => L g.val) (fun g => R g.val) (fun g => a g.val) = K L R a * physicalPhase ζ (physicalD (fun g : {g // small g} => C g.val) (fun g => L g.val) (fun g => a g.val) * physicalD (fun g : {g // ¬small g} => C g.val) (fun g => L g.val) (fun g => a g.val)) := by simp only [physicalCoupledBigCoefficient, physical_mark_group_merge_restrict, physical_aux_group_merge_restrict] end Groups end Bounty end section /- Restricted path masses are the literal physical masses on the subtype of groups. -/ open Finset open scoped Classical namespace Bounty theorem physical_group_path_mass_restriction {G : Type*} [DecidableEq G] {J : ℕ} (V : G → ℝ) (groups : Finset G) (C : ℕ → G → Finset (Fin J)) (ell n : ℕ) : physicalGroupPathMass V groups C ell n = physicalStateMass (fun g : ↥groups => V g.val) J ell * ∏ j ∈ range n, physicalCompletionMass (fun g : ↥groups => V g.val) (fun g : ↥groups => C j g.val) ell := by rw [physical_group_path_mass_factors] unfold physicalStateMass physicalCompletionMass congr 1 · exact (prod_coe_sort groups (fun g => 1 / (V g) ^ (J + ell))).symm · apply prod_congr rfl intro j hj exact (prod_coe_sort groups (fun g => 1 / (V g) ^ (ell + (C j g).card))).symm end Bounty end section /- Reindex an arbitrary coupled bare coefficient together with all original edge factors. -/ open Finset open scoped Classical namespace Bounty section Reindex variable {G H : Type*} (e : G ≃ H) {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) noncomputable def physicalGroupReindexedCoefficient (L R : PhysicalMarkLists (fun h => P (e.symm h)) J ell) (a : PhysicalAuxLabels (fun h => P (e.symm h)) (fun h => C (e.symm h))) : ℂ := K ((physicalMarkGroupReindex e P J ell).symm L) ((physicalMarkGroupReindex e P J ell).symm R) ((physicalAuxGroupReindex e P J C).symm a) theorem physical_group_reindexed_coefficient_apply (a : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) : physicalGroupReindexedCoefficient e C K (physicalMarkGroupReindex e P J ell L) (physicalMarkGroupReindex e P J ell R) (physicalAuxGroupReindex e P J C a) = K L R a := by simp only [physicalGroupReindexedCoefficient, Equiv.symm_apply_apply] variable [Fintype G] [Fintype H] theorem physical_bare_pattern_group_reindex (V : G → ℝ) (ζ : ℝ) (a : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) : physicalBarePatternScalar (fun h => V (e.symm h)) (fun h => C (e.symm h)) ζ (physicalGroupReindexedCoefficient e C K) (physicalAuxGroupReindex e P J C a) (physicalMarkGroupReindex e P J ell L) (physicalMarkGroupReindex e P J ell R) = physicalBarePatternScalar V C ζ K a L R := by simp only [physicalBarePatternScalar, physical_list_admissible_group_reindex, physical_aux_mass_group_reindex, physical_completion_mass_group_reindex, physical_D_group_reindex, physical_group_reindexed_coefficient_apply] end Reindex end Bounty end section /- Port from PrimeNumberTheoremAnd/ZetaBounds.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ open Complex Topology Filter Interval Set Asymptotics lemma div_cpow_eq_cpow_neg (a x s : ℂ) : a / x ^ s = a * x ^ (-s) := by rw [div_eq_mul_inv, cpow_neg] lemma div_rpow_eq_rpow_neg (a x s : ℝ) (hx : 0 ≤ x) : a / x ^ s = a * x ^ (-s) := by rw [div_eq_mul_inv, Real.rpow_neg hx] theorem analyticAt_riemannZeta {s : ℂ} (s_ne_one : s ≠ 1) : AnalyticAt ℂ riemannZeta s := by apply Complex.analyticAt_iff_eventually_differentiableAt.mpr filter_upwards [eventually_ne_nhds s_ne_one] with z hz using differentiableAt_riemannZeta hz noncomputable def riemannZeta0 (N : ℕ) (s : ℂ) : ℂ := (∑ n ∈ Finset.range (N + 1), 1 / (n : ℂ) ^ s) + (- N ^ (1 - s)) / (1 - s) + (- N ^ (-s)) / 2 + s * ∫ x in Ioi (N : ℝ), (⌊x⌋ + 1 / 2 - x) / (x : ℂ) ^ (s + 1) lemma riemannZeta0_apply (N : ℕ) (s : ℂ) : riemannZeta0 N s = (∑ n ∈ Finset.range (N + 1), 1 / (n : ℂ) ^ s) + ((- N ^ (1 - s)) / (1 - s) + (- N ^ (-s)) / 2 + s * ∫ x in Ioi (N : ℝ), (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (-(s + 1))) := by simp_rw [riemannZeta0, div_cpow_eq_cpow_neg]; ring lemma Real.differentiableAt_cpow_const_of_ne (s : ℂ) {x : ℝ} (xpos : 0 < x) : DifferentiableAt ℝ (fun (x : ℝ) ↦ (x : ℂ) ^ s) x := by apply DifferentiableAt.comp_ofReal (e := fun z ↦ z ^ s) apply DifferentiableAt.cpow (by simp) (by simp) (by simp [xpos]) lemma Complex.one_div_cpow_eq {s : ℂ} {x : ℝ} (x_ne : x ≠ 0) : 1 / (x : ℂ) ^ s = (x : ℂ) ^ (-s) := by refine (eq_one_div_of_mul_eq_one_left ?_).symm rw [← cpow_add _ _ <| mod_cast x_ne, neg_add_cancel, cpow_zero] lemma sum_eq_int_deriv {φ : ℝ → ℂ} {a b : ℝ} (apos : 0 ≤ a) (a_lt_b : a < b) (φDiff : ∀ x ∈ [[a, b]], HasDerivAt φ (deriv φ x) x) (derivφCont : ContinuousOn (deriv φ) [[a, b]]) : ∑ n ∈ Finset.Ioc ⌊a⌋₊ ⌊b⌋₊, φ n = (∫ x in a..b, φ x) + (⌊b⌋₊ + 1 / 2 - b) * φ b - (⌊a⌋₊ + 1 / 2 - a) * φ a - ∫ x in a..b, (⌊x⌋ + 1 / 2 - x) * deriv φ x := by rw [uIcc_of_le a_lt_b.le] at φDiff convert sum_eq_integral_add_integral_deriv apos a_lt_b.le (fun t ht ↦ (φDiff t ht).differentiableAt) derivφCont using 1 unfold B1 push_cast suffices ∫ (x : ℝ) in a..b, (↑⌊x⌋ + 1 / 2 - ↑x) * deriv φ x = -∫ (t : ℝ) in a..b, deriv φ t * (↑t - ↑⌊t⌋₊ - 1 / 2) by rw [this] ring_nf! rw [← intervalIntegral.integral_neg] refine intervalIntegral.integral_congr fun x hx ↦ ?_ rw [uIcc_of_le a_lt_b.le, mem_Icc] at hx rw [← Int.natCast_floor_eq_floor (by linarith)] norm_cast push_cast ring lemma xpos_of_uIcc {a b : ℕ} (ha : a ∈ Ioo 0 b) {x : ℝ} (x_in : x ∈ [[(a : ℝ), b]]) : 0 < x := by rw [uIcc_of_le (by exact_mod_cast ha.2.le), mem_Icc] at x_in linarith [(by exact_mod_cast ha.1 : (0 : ℝ) < a)] lemma ZetaSum_aux1₁ {a b : ℕ} {s : ℂ} (s_ne_one : s ≠ 1) (ha : a ∈ Ioo 0 b) : (∫ (x : ℝ) in a..b, 1 / (x : ℂ) ^ s) = (b ^ (1 - s) - a ^ (1 - s)) / (1 - s) := by convert integral_cpow (a := a) (b := b) (r := -s) ?_ using 1 · refine intervalIntegral.integral_congr fun x hx ↦ one_div_cpow_eq ?_ exact (xpos_of_uIcc ha hx).ne' · norm_cast; ring_nf · right; refine ⟨(by grind), ?_⟩ exact fun hx ↦ (lt_self_iff_false 0).mp <| xpos_of_uIcc ha hx lemma ZetaSum_aux1φDiff {s : ℂ} {x : ℝ} (xpos : 0 < x) : HasDerivAt (fun (t : ℝ) ↦ 1 / (t : ℂ) ^ s) (deriv (fun (t : ℝ) ↦ 1 / (t : ℂ) ^ s) x) x := by exact hasDerivAt_deriv_iff.mpr <| DifferentiableAt.div (differentiableAt_const _) (Real.differentiableAt_cpow_const_of_ne s xpos) (by simp [cpow_eq_zero_iff, xpos.ne']) lemma ZetaSum_aux1φderiv {s : ℂ} (s_ne_zero : s ≠ 0) {x : ℝ} (xpos : 0 < x) : deriv (fun (t : ℝ) ↦ 1 / (t : ℂ) ^ s) x = (fun (x : ℝ) ↦ -s * (x : ℂ) ^ (-(s + 1))) x := by let r := -s - 1 have r_add1_ne_zero : r + 1 ≠ 0 := fun hr ↦ by simp [neg_ne_zero.mpr s_ne_zero, r] at hr have r_ne_neg1 : r ≠ -1 := fun hr ↦ (hr ▸ r_add1_ne_zero) <| by norm_num have hasDeriv := hasDerivAt_ofReal_cpow_const' xpos.ne' r_ne_neg1 have := hasDeriv.deriv ▸ deriv_const_mul (-s) (hasDeriv).differentiableAt convert! this using 2 · ext y by_cases y_zero : (y : ℂ) = 0 · simp only [y_zero, ne_eq, s_ne_zero, not_false_eq_true, zero_cpow, div_zero, r_add1_ne_zero, zero_div, mul_zero] · have : (y : ℂ) ^ s ≠ 0 := fun hy ↦ y_zero ((cpow_eq_zero_iff _ _).mp hy).1 simp only [one_div, sub_add_cancel, cpow_neg, neg_mul, r] field_simp · simp only [r] ring_nf lemma ZetaSum_aux1derivφCont {s : ℂ} (s_ne_zero : s ≠ 0) {a b : ℕ} (ha : a ∈ Ioo 0 b) : ContinuousOn (deriv (fun (t : ℝ) ↦ 1 / (t : ℂ) ^ s)) [[a, b]] := by have : EqOn _ (fun (t : ℝ) ↦ -s * (t : ℂ) ^ (-(s + 1))) [[a, b]] := fun x hx ↦ ZetaSum_aux1φderiv s_ne_zero <| xpos_of_uIcc ha hx refine continuous_ofReal.continuousOn.cpow_const ?_ |>.const_smul (c := -s) |>.congr this exact fun x hx ↦ ofReal_mem_slitPlane.mpr <| xpos_of_uIcc ha hx lemma ZetaSum_aux1 {a b : ℕ} {s : ℂ} (s_ne_one : s ≠ 1) (s_ne_zero : s ≠ 0) (ha : a ∈ Ioo 0 b) : ∑ n ∈ Finset.Ioc a b, 1 / (n : ℂ) ^ s = (b ^ (1 - s) - a ^ (1 - s)) / (1 - s) + 1 / 2 * (1 / b ^ (s)) - 1 / 2 * (1 / a ^ s) + s * ∫ x in a..b, (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (-(s + 1)) := by let φ := fun (x : ℝ) ↦ 1 / (x : ℂ) ^ s let φ' := fun (x : ℝ) ↦ -s * (x : ℂ) ^ (-(s + 1)) have xpos : ∀ x ∈ [[(a : ℝ), b]], 0 < x := fun x hx ↦ xpos_of_uIcc ha hx have φDiff : ∀ x ∈ [[(a : ℝ), b]], HasDerivAt φ (deriv φ x) x := fun x hx ↦ ZetaSum_aux1φDiff (xpos x hx) have φderiv : ∀ x ∈ [[(a : ℝ), b]], deriv φ x = φ' x := by exact fun x hx ↦ ZetaSum_aux1φderiv s_ne_zero (xpos x hx) have derivφCont : ContinuousOn (deriv φ) [[a, b]] := ZetaSum_aux1derivφCont s_ne_zero ha convert sum_eq_int_deriv (by linarith) (by exact_mod_cast ha.2) φDiff derivφCont using 1 · congr <;> simp only [Nat.floor_natCast] · rw [Nat.floor_natCast, Nat.floor_natCast, ← intervalIntegral.integral_const_mul] simp_rw [mul_div, ← mul_div, φ, ZetaSum_aux1₁ s_ne_one ha] conv => rhs; rw [sub_eq_add_neg] congr; any_goals norm_cast; simp only [one_div, add_sub_cancel_left] rw [← intervalIntegral.integral_neg, intervalIntegral.integral_congr] simp only [φ, one_div] at φderiv intro x hx; simp_rw [φderiv x hx, φ']; ring_nf lemma ZetaSum_aux1_1' {a b x : ℝ} (apos : 0 < a) (hx : x ∈ Icc a b) : 0 < x := lt_of_lt_of_le apos hx.1 lemma ZetaSum_aux1_1 {a b x : ℝ} (apos : 0 < a) (a_lt_b : a < b) (hx : x ∈ [[a, b]]) : 0 < x := lt_of_lt_of_le apos (uIcc_of_le a_lt_b.le ▸ hx).1 lemma ZetaSum_aux1_2 {a b : ℝ} {c : ℝ} (apos : 0 < a) (a_lt_b : a < b) (h : c ≠ 0 ∧ 0 ∉ [[a, b]]) : ∫ (x : ℝ) in a..b, 1 / x ^ (c+1) = (a ^ (-c) - b ^ (-c)) / c := by rw [(by ring : (a ^ (-c) - b ^ (-c)) / c = (b ^ (-c) - a ^ (-c)) / (-c))] have := integral_rpow (a := a) (b := b) (r := -c-1) (Or.inr ⟨by simp [h.1], h.2⟩) simp only [sub_add_cancel] at this rw [← this] apply intervalIntegral.integral_congr intro x hx have : 0 ≤ x := (ZetaSum_aux1_1 apos a_lt_b hx).le simp [div_rpow_eq_rpow_neg _ _ _ this, sub_eq_add_neg, add_comm] lemma ZetaSum_aux1_3 (x : ℝ) : ‖(⌊x⌋ + 1/2 - x)‖ ≤ 1/2 := abs_le.mpr ⟨(by linarith [Int.lt_floor_add_one x]), (by linarith [Int.floor_le x])⟩ lemma ZetaSum_aux1_4' (x : ℝ) (hx : 0 < x) (s : ℂ) : ‖(⌊x⌋ + 1 / 2 - (x : ℝ)) / (x : ℂ) ^ (s + 1)‖ = ‖⌊x⌋ + 1 / 2 - x‖ / x ^ ((s + 1).re) := by simp_rw [norm_div, Complex.norm_cpow_eq_rpow_re_of_pos hx, ← norm_real] simp lemma ZetaSum_aux1_4 {a b : ℝ} (apos : 0 < a) (a_lt_b : a < b) {s : ℂ} : ∫ (x : ℝ) in a..b, ‖(↑⌊x⌋ + (1 : ℝ) / 2 - ↑x) / (x : ℂ) ^ (s + 1)‖ = ∫ (x : ℝ) in a..b, |⌊x⌋ + 1 / 2 - x| / x ^ (s + 1).re := by apply intervalIntegral.integral_congr exact fun x hx ↦ ZetaSum_aux1_4' x (ZetaSum_aux1_1 apos a_lt_b hx) s lemma ZetaSum_aux1_5a {a b : ℝ} (apos : 0 < a) {s : ℂ} (x : ℝ) (h : x ∈ Icc a b) : |↑⌊x⌋ + 1 / 2 - x| / x ^ (s.re + 1) ≤ 1 / x ^ (s.re + 1) := by apply div_le_div_of_nonneg_right _ _ · exact le_trans (ZetaSum_aux1_3 x) (by norm_num) · apply Real.rpow_nonneg <| le_of_lt (ZetaSum_aux1_1' apos h) lemma ZetaSum_aux1_5b {a b : ℝ} (apos : 0 < a) (a_lt_b : a < b) {s : ℂ} (σpos : 0 < s.re) : IntervalIntegrable (fun u ↦ 1 / u ^ (s.re + 1)) MeasureTheory.volume a b := by refine continuousOn_const.div ?_ ?_ |>.intervalIntegrable_of_Icc (le_of_lt a_lt_b) · exact continuousOn_id.rpow_const fun x hx ↦ Or.inl (ne_of_gt <| ZetaSum_aux1_1' apos hx) · exact fun x hx h ↦ by rw [Real.rpow_eq_zero] at h <;> linarith [ZetaSum_aux1_1' apos hx] open MeasureTheory in lemma measurable_floor_add_half_sub : Measurable fun (u : ℝ) ↦ ↑⌊u⌋ + 1 / 2 - u := by refine Measurable.add ?_ measurable_const |>.sub measurable_id exact Measurable.comp (by exact fun _ _ ↦ trivial) Int.measurable_floor open MeasureTheory in lemma ZetaSum_aux1_5c {a b : ℝ} {s : ℂ} : let g : ℝ → ℝ := fun u ↦ |↑⌊u⌋ + 1 / 2 - u| / u ^ (s.re + 1); AEStronglyMeasurable g (Measure.restrict volume (Ι a b)) := by intro refine (Measurable.div ?_ <| measurable_id.pow_const _).aestronglyMeasurable exact _root_.continuous_abs.measurable.comp measurable_floor_add_half_sub lemma ZetaSum_aux1_5d {a b : ℝ} (apos : 0 < a) (a_lt_b : a < b) {s : ℂ} (σpos : 0 < s.re) : IntervalIntegrable (fun u ↦ |↑⌊u⌋ + 1 / 2 - u| / u ^ (s.re + 1)) MeasureTheory.volume a b := by set g : ℝ → ℝ := (fun u ↦ |↑⌊u⌋ + 1 / 2 - u| / u ^ (s.re + 1)) apply ZetaSum_aux1_5b apos a_lt_b σpos |>.mono_fun ZetaSum_aux1_5c ?_ filter_upwards with x simp only [Real.norm_eq_abs, one_div, norm_inv, abs_div, _root_.abs_abs] conv => rw [div_eq_mul_inv, ← one_div]; rhs; rw [← one_mul |x ^ (s.re + 1)|⁻¹] refine mul_le_mul ?_ (le_refl _) (by simp) <| by norm_num exact le_trans (ZetaSum_aux1_3 x) <| by norm_num lemma ZetaSum_aux1_5 {a b : ℝ} (apos : 0 < a) (a_lt_b : a < b) {s : ℂ} (σpos : 0 < s.re) : ∫ (x : ℝ) in a..b, |⌊x⌋ + 1 / 2 - x| / x ^ (s.re + 1) ≤ ∫ (x : ℝ) in a..b, 1 / x ^ (s.re + 1) := by apply intervalIntegral.integral_mono_on (le_of_lt a_lt_b) ?_ ?_ · exact ZetaSum_aux1_5a apos · exact ZetaSum_aux1_5d apos a_lt_b σpos · exact ZetaSum_aux1_5b apos a_lt_b σpos lemma ZetaBnd_aux1a {a b : ℝ} (apos : 0 < a) (a_lt_b : a < b) {s : ℂ} (σpos : 0 < s.re) : ∫ x in a..b, ‖(⌊x⌋ + 1 / 2 - x) / (x : ℂ) ^ (s + 1)‖ ≤ (a ^ (-s.re) - b ^ (-s.re)) / s.re := by calc _ = ∫ x in a..b, |(⌊x⌋ + 1 / 2 - x)| / x ^ (s+1).re := ZetaSum_aux1_4 apos a_lt_b _ ≤ ∫ x in a..b, 1 / x ^ (s.re + 1) := ZetaSum_aux1_5 apos a_lt_b σpos _ = (a ^ (-s.re) - b ^ (-s.re)) / s.re := ?_ refine ZetaSum_aux1_2 (c := s.re) apos a_lt_b ⟨ne_of_gt σpos, ?_⟩ exact fun h ↦ (lt_self_iff_false 0).mp <| ZetaSum_aux1_1 apos a_lt_b h lemma Finset.Ioc_eq_Ico (M N : ℕ) : Finset.Ioc N M = Finset.Ico (N + 1) (M + 1) := by ext a; simp only [Finset.mem_Ioc, Finset.mem_Ico]; constructor <;> intro ⟨h₁, h₂⟩ <;> omega lemma finsetSum_tendsto_tsum {N : ℕ} {f : ℕ → ℂ} (hf : Summable f) : Tendsto (fun (k : ℕ) ↦ ∑ n ∈ Finset.Ico N k, f n) atTop (𝓝 (∑' (n : ℕ), f (n + N))) := by have := Summable.hasSum_iff_tendsto_nat hf (m := ∑' (n : ℕ), f n) |>.mp hf.hasSum have const := tendsto_const_nhds (α := ℕ) (x := ∑ i ∈ Finset.range N, f i) (f := atTop) have := Filter.Tendsto.sub this const rw [← hf.sum_add_tsum_nat_add N, add_comm, add_sub_cancel_right] at this apply this.congr' filter_upwards [Filter.mem_atTop (N + 1)] intro M hM rw [Finset.sum_Ico_eq_sub] linarith lemma Complex.cpow_tendsto {s : ℂ} (s_re_gt : 1 < s.re) : Tendsto (fun (x : ℕ) ↦ (x : ℂ) ^ (1 - s)) atTop (𝓝 0) := by have one_sub_s_re_ne : (1 - s).re ≠ 0 := by simp only [sub_re, one_re]; linarith rw [tendsto_zero_iff_norm_tendsto_zero] simp_rw [Complex.norm_natCast_cpow_of_re_ne_zero _ (one_sub_s_re_ne)] rw [(by simp only [sub_re, one_re, neg_sub] : (1 - s).re = - (s - 1).re)] apply (tendsto_rpow_neg_atTop _).comp tendsto_natCast_atTop_atTop; simp [s_re_gt] lemma Complex.cpow_inv_tendsto {s : ℂ} (hs : 0 < s.re) : Tendsto (fun (x : ℕ) ↦ ((x : ℂ) ^ s)⁻¹) atTop (𝓝 0) := by rw [tendsto_zero_iff_norm_tendsto_zero] simp_rw [norm_inv, Complex.norm_natCast_cpow_of_re_ne_zero _ <| ne_of_gt hs] apply Filter.Tendsto.inv_tendsto_atTop exact (tendsto_rpow_atTop hs).comp tendsto_natCast_atTop_atTop lemma ZetaSum_aux2a : ∃ C, ∀ (x : ℝ), ‖⌊x⌋ + 1 / 2 - x‖ ≤ C := by use 1 / 2; exact ZetaSum_aux1_3 lemma ZetaSum_aux3 {N : ℕ} {s : ℂ} (s_re_gt : 1 < s.re) : Tendsto (fun k ↦ ∑ n ∈ Finset.Ioc N k, 1 / (n : ℂ) ^ s) atTop (𝓝 (∑' (n : ℕ), 1 / (n + N + 1 : ℂ) ^ s)) := by let f := fun (n : ℕ) ↦ 1 / (n : ℂ) ^ s have hf := summable_one_div_nat_cpow.mpr s_re_gt simp_rw [Finset.Ioc_eq_Ico] convert finsetSum_tendsto_tsum (f := fun n ↦ f (n + 1)) (N := N) ?_ using 1 · ext k rw [Finset.sum_Ico_add'] · congr; ext n; simp only [one_div, Nat.cast_add, Nat.cast_one, f] · rwa [summable_nat_add_iff (k := 1)] lemma integrableOn_of_Zeta0_fun {N : ℕ} (N_pos : 0 < N) {s : ℂ} (s_re_gt : 0 < s.re) : MeasureTheory.IntegrableOn (fun (x : ℝ) ↦ (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (-(s + 1))) (Ioi N) MeasureTheory.volume := by obtain ⟨c, hc⟩ := ZetaSum_aux2a apply MeasureTheory.Integrable.bdd_mul (c := c) ?_ ?_ · apply MeasureTheory.ae_of_all convert hc; simp only [← Complex.norm_real]; simp · apply integrableOn_Ioi_cpow_iff (by positivity) |>.mpr (by simp [s_re_gt]) · refine Measurable.add ?_ measurable_const |>.sub (by fun_prop) |>.aestronglyMeasurable exact Measurable.comp (by exact fun _ _ ↦ trivial) Int.measurable_floor lemma ZetaSum_aux2 {N : ℕ} (N_pos : 0 < N) {s : ℂ} (s_re_gt : 1 < s.re) : ∑' (n : ℕ), 1 / (n + N + 1 : ℂ) ^ s = (- N ^ (1 - s)) / (1 - s) - N ^ (-s) / 2 + s * ∫ x in Ioi (N : ℝ), (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (-(s + 1)) := by have s_ne_zero : s ≠ 0 := fun hs ↦ by linarith [zero_re ▸ hs ▸ s_re_gt] have s_ne_one : s ≠ 1 := fun hs ↦ (lt_self_iff_false _).mp <| one_re ▸ hs ▸ s_re_gt apply tendsto_nhds_unique (X := ℂ) (Y := ℕ) (l := atTop) (f := fun k ↦ ((k : ℂ) ^ (1 - s) - (N : ℂ) ^ (1 - s)) / (1 - s) + 1 / 2 * (1 / ↑k ^ s) - 1 / 2 * (1 / ↑N ^ s) + s * ∫ (x : ℝ) in (N : ℝ)..k, (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (-(s + 1))) (b := (- N ^ (1 - s)) / (1 - s) - N ^ (-s) / 2 + s * ∫ x in Ioi (N : ℝ), (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (-(s + 1))) · apply Filter.Tendsto.congr' (f₁ := fun (k : ℕ) ↦ ∑ n ∈ Finset.Ioc N k, 1 / (n : ℂ) ^ s) (l₁ := atTop) · apply Filter.eventually_atTop.mpr use N + 1 intro k hk exact ZetaSum_aux1 (a := N) (b := k) s_ne_one s_ne_zero ⟨N_pos, hk⟩ · exact ZetaSum_aux3 s_re_gt · apply (Tendsto.sub ?_ ?_).add (Tendsto.const_mul _ ?_) · rw [(by ring : -↑N ^ (1 - s) / (1 - s) = (0 - ↑N ^ (1 - s)) / (1 - s) + 0)] apply cpow_tendsto s_re_gt |>.sub_const _ |>.div_const _ |>.add simp_rw [mul_comm_div, one_mul, one_div, (by congr; ring : 𝓝 (0 : ℂ) = 𝓝 ((0 : ℂ) / 2))] apply Tendsto.div_const <| cpow_inv_tendsto (by positivity) · simp_rw [mul_comm_div, one_mul, one_div, cpow_neg]; exact tendsto_const_nhds · exact MeasureTheory.intervalIntegral_tendsto_integral_Ioi (a := N) (b := (fun (n : ℕ) ↦ (n : ℝ))) (integrableOn_of_Zeta0_fun N_pos <| by positivity) tendsto_natCast_atTop_atTop open MeasureTheory in lemma ZetaBnd_aux1b (N : ℕ) (Npos : 1 ≤ N) {σ t : ℝ} (σpos : 0 < σ) : ‖∫ x in Ioi (N : ℝ), (⌊x⌋ + 1 / 2 - x) / (x : ℂ) ^ ((σ + t * I) + 1)‖ ≤ N ^ (-σ) / σ := by apply le_trans (by apply norm_integral_le_integral_norm) apply le_of_tendsto (x := atTop (α := ℝ)) (f := fun (t : ℝ) ↦ ∫ (x : ℝ) in N..t, ‖(⌊x⌋ + 1 / 2 - x) / (x : ℂ) ^ (σ + t * I + 1)‖) ?_ ?_ · apply intervalIntegral_tendsto_integral_Ioi (μ := volume) (l := atTop) (b := id) (f := fun (x : ℝ) ↦ ‖(⌊x⌋ + 1 / 2 - x) / (x : ℂ) ^ (σ + t * I + 1)‖) N ?_ ?_ |>.congr' ?_ · filter_upwards [Filter.mem_atTop ((N : ℝ))] intro u hu simp only [id_eq, intervalIntegral.integral_of_le hu, norm_div] apply setIntegral_congr_fun (by simp) intro x hx; beta_reduce iterate 2 (rw [norm_cpow_eq_rpow_re_of_pos (by linarith [hx.1])]) simp · apply IntegrableOn.integrable ?_ |>.norm convert! integrableOn_of_Zeta0_fun (s := σ + t * I) Npos (by simp [σpos]) using 1 simp_rw [div_eq_mul_inv, cpow_neg] · exact fun ⦃_⦄ a ↦ a · filter_upwards [mem_atTop (N + 1 : ℝ)] with t ht have : (N ^ (-σ) - t ^ (-σ)) / σ ≤ N ^ (-σ) / σ := div_le_div_iff_of_pos_right σpos |>.mpr (by simp [Real.rpow_nonneg (by linarith)]) apply le_trans ?_ this convert! ZetaBnd_aux1a (a := N) (b := t) (by positivity) (by linarith) ?_ <;> simp [σpos] lemma isOpen_aux : IsOpen {z : ℂ | z ≠ 1 ∧ 0 < z.re} := by refine IsOpen.inter isOpen_ne ?_ exact isOpen_lt (g := fun (z : ℂ) ↦ z.re) (by continuity) (by continuity) open MeasureTheory in lemma integrable_log_over_pow {r : ℝ} (rneg : r < 0) {N : ℕ} (Npos : 0 < N) : IntegrableOn (fun (x : ℝ) ↦ ‖x ^ (r - 1)‖ * ‖Real.log x‖) <| Ioi N := by apply IntegrableOn.mono_set (hst := Set.Ioi_subset_Ici <| le_refl (N : ℝ)) apply LocallyIntegrableOn.integrableOn_of_isBigO_atTop (g := fun x ↦ x ^ (r / 2 - 1)) · apply ContinuousOn.abs ?_ |>.mul ?_ |>.locallyIntegrableOn (by simp) · apply ContinuousOn.rpow (by fun_prop) (by fun_prop) intro x hx; left; contrapose! Npos with h; exact_mod_cast h ▸ mem_Ici.mp hx · apply continuous_id.continuousOn.log ?_ |>.abs intro x hx; simp only [id_eq]; contrapose! Npos with h; exact_mod_cast h ▸ mem_Ici.mp hx · have := isLittleO_log_rpow_atTop (r := -r / 2) (by linarith) |>.isBigO rw [Asymptotics.isBigO_iff_eventually, Filter.eventually_atTop] at this obtain ⟨C, hC⟩ := this have hh := hC C (by simp) rw [Asymptotics.isBigO_atTop_iff_eventually_exists] have := Filter.eventually_atTop.mp hh obtain ⟨x₀, hx₀ ⟩ := this filter_upwards [hh, Filter.mem_atTop x₀, Filter.mem_atTop 1] intro x hx x_gt x_pos use C intro y hy simp only [norm_mul, Real.norm_eq_abs, _root_.abs_abs] simp only [Real.norm_eq_abs] at hx have y_pos : 0 < y := by linarith have : y ^ (r / 2 - 1) = y ^ (r - 1) * y ^ (-r / 2) := by rw [← Real.rpow_add y_pos]; ring_nf rw [this, abs_mul] have y_gt : y ≥ x₀ := by linarith have := hx₀ y y_gt simp only [Real.norm_eq_abs] at this rw [← mul_assoc, mul_comm C, mul_assoc] exact mul_le_mul_of_nonneg_left (hbc := this) (a := |y ^ (r - 1)|) (ha := by simp) · have := integrableOn_Ioi_rpow_iff (s := r / 2 - 1) (t := N) (by simp [Npos]) |>.mpr (by linarith [rneg]) exact integrableOn_Ioi_iff_integrableAtFilter_atTop_nhdsWithin.mp this |>.1 open MeasureTheory in lemma integrableOn_of_Zeta0_fun_log {N : ℕ} (Npos : 0 < N) {s : ℂ} (s_re_gt : 0 < s.re) : IntegrableOn (fun (x : ℝ) ↦ (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (-(s + 1)) * (-Real.log x)) (Ioi N) volume := by simp_rw [mul_assoc] obtain ⟨c, hc⟩ := ZetaSum_aux2a apply Integrable.bdd_mul (c := c) ?_ ?_ ?_ · simp only [neg_add_rev, mul_neg, add_comm, ← sub_eq_add_neg] apply integrable_norm_iff ?_ |>.mp ?_ |>.neg · apply ContinuousOn.mul ?_ ?_ |>.aestronglyMeasurable (by simp) · intro x hx apply ContinuousWithinAt.cpow ?_ continuous_const.continuousWithinAt ?_ · exact RCLike.continuous_ofReal.continuousWithinAt · simp only [ofReal_mem_slitPlane]; linarith [mem_Ioi.mp hx] · apply RCLike.continuous_ofReal.continuousOn.comp ?_ (mapsTo_image _ _) refine continuous_id.continuousOn.log ?_ intro x hx; simp only [id_eq]; linarith [mem_Ioi.mp hx] · simp only [norm_mul, norm_real] have := integrable_log_over_pow (r := -s.re) (by linarith) Npos apply IntegrableOn.congr_fun this ?_ (by simp) intro x hx simp only [mul_eq_mul_right_iff, norm_eq_zero, Real.log_eq_zero] left have xpos : 0 < x := by linarith [mem_Ioi.mp hx] simp [norm_cpow_eq_rpow_re_of_pos xpos, Real.abs_rpow_of_nonneg xpos.le, abs_eq_self.mpr xpos.le] · apply Measurable.add ?_ measurable_const |>.sub (by fun_prop) |>.aestronglyMeasurable exact Measurable.comp (fun _ _ ↦ trivial) Int.measurable_floor · apply MeasureTheory.ae_of_all convert hc with _ x; simp only [← Complex.norm_real]; simp open MeasureTheory in lemma hasDerivAt_Zeta0Integral {N : ℕ} (Npos : 0 < N) {s : ℂ} (hs : s ∈ {s | 0 < s.re}) : HasDerivAt (fun z ↦ ∫ x in Ioi (N : ℝ), (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (-z - 1)) (∫ x in Ioi (N : ℝ), (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (- s - 1) * (- Real.log x)) s := by simp only [mem_ofPred_eq] at hs set f : ℝ → ℂ := fun x ↦ (⌊x⌋ : ℂ) + 1 / 2 - x set F : ℂ → ℝ → ℂ := fun s x ↦ (x : ℂ) ^ (- s - 1) * f x set F' : ℂ → ℝ → ℂ := fun s x ↦ (x : ℂ) ^ (- s - 1) * (- Real.log x) * f x set ε := s.re / 2 have ε_pos : 0 < ε := by aesop set bound : ℝ → ℝ := fun x ↦ |x ^ (- s.re / 2 - 1)| * |Real.log x| let μ : Measure ℝ := volume.restrict (Ioi (N : ℝ)) have hF_meas : ∀ᶠ (z : ℂ) in 𝓝 s, AEStronglyMeasurable (F z) μ := by have : {z : ℂ | 0 < z.re} ∈ 𝓝 s := by rw [mem_nhds_iff] refine ⟨{z | 0 < z.re}, fun ⦃a⦄ a ↦ a, isOpen_lt continuous_const Complex.continuous_re, hs⟩ filter_upwards [this] with z hz convert! integrableOn_of_Zeta0_fun Npos hz |>.aestronglyMeasurable using 1 simp only [F, f]; ext x; ring_nf have hF_int : Integrable (F s) μ := by convert! integrableOn_of_Zeta0_fun Npos hs |>.integrable using 1 simp only [F, f]; ext x; ring_nf have hF'_meas : AEStronglyMeasurable (F' s) μ := by convert! integrableOn_of_Zeta0_fun_log Npos hs |>.aestronglyMeasurable using 1 simp only [F', f]; ext x; ring_nf have IoiSubIoi1 : (Ioi (N : ℝ)) ⊆ {x | 1 < x} := fun x hx ↦ lt_of_le_of_lt (by simp only [Nat.one_le_cast]; omega) <| mem_Ioi.mp hx have measSetIoi1 : MeasurableSet {x : ℝ | 1 < x} := (isOpen_lt' 1).measurableSet have h_bound1 : ∀ᵐ (x : ℝ) ∂volume.restrict {x | 1 < x}, ∀ z ∈ Metric.ball s ε, ‖F' z x‖ ≤ bound x := by filter_upwards [self_mem_ae_restrict measSetIoi1] with x hx intro z hz simp only [F', f, bound] calc _ = ‖(x : ℂ) ^ (-z - 1)‖ * ‖-(Real.log x)‖ * ‖(⌊x⌋ + 1 / 2 - x)‖ := by simp only [mul_neg, one_div, neg_mul, norm_neg, norm_mul, norm_real, Real.norm_eq_abs, ← (by simp : (((⌊x⌋ + 2⁻¹ - x) : ℝ) : ℂ) = (⌊x⌋ : ℂ) + 2⁻¹ - ↑x), Complex.norm_real] _ = ‖x ^ (-z.re - 1)‖ * ‖-(Real.log x)‖ * ‖(⌊x⌋ + 1 / 2 - x)‖ := ?_ _ = |x ^ (-z.re - 1)| * |(Real.log x)| * |(⌊x⌋ + 1 / 2 - x)| := by simp _ ≤ _ := ?_ · congr! 2 simp only [Real.norm_eq_abs, norm_cpow_eq_rpow_re_of_pos (by linarith), sub_re, neg_re, one_re] apply abs_eq_self.mpr ?_ |>.symm positivity · rw [mul_comm, ← mul_assoc] apply mul_le_mul_of_nonneg_right ?_ <| abs_nonneg _ simp only [Metric.mem_ball, ε, Complex.dist_eq] at hz apply le_trans (b := 1 * |x ^ (-z.re - 1)|) · apply mul_le_mul_of_nonneg_right (le_trans (ZetaSum_aux1_3 _) (by norm_num)) <| abs_nonneg _ · simp_rw [one_mul, Real.abs_rpow_of_nonneg (by linarith : 0 ≤ x)] apply Real.rpow_le_rpow_of_exponent_le <| le_abs.mpr (by left; exact hx.le) have := abs_le.mp <| le_trans (abs_re_le_norm (z-s)) hz.le simp only [sub_re, neg_le_sub_iff_le_add, tsub_le_iff_right] at this linarith [this.1] have h_bound : ∀ᵐ x ∂μ, ∀ z ∈ Metric.ball s ε, ‖F' z x‖ ≤ bound x := by apply ae_restrict_of_ae_restrict_of_subset IoiSubIoi1 exact h_bound1 have bound_integrable : Integrable bound μ := by simp only [bound] convert! integrable_log_over_pow (r := -s.re / 2) (by linarith) Npos using 0 have h_diff : ∀ᵐ x ∂μ, ∀ z ∈ Metric.ball s ε, HasDerivAt (fun w ↦ F w x) (F' z x) z := by simp only [F, F', f] apply ae_restrict_of_ae_restrict_of_subset IoiSubIoi1 filter_upwards [h_bound1, self_mem_ae_restrict measSetIoi1] with x _ one_lt_x intro z hz convert! HasDerivAt.mul_const (c := fun (w : ℂ) ↦ (x : ℂ) ^ (-w-1)) (c' := (x : ℂ) ^ (-z-1) * -Real.log x) (d := (⌊x⌋ : ℝ) + 1 / 2 - x) ?_ using 1 convert! HasDerivAt.comp (h := fun w ↦ -w-1) (h' := -1) (h₂ := fun w ↦ x ^ w) (h₂' := x ^ (-z-1) * Real.log x) (x := z) ?_ ?_ using 0 · simp only [mul_neg, mul_one]; congr! 2 · convert! HasDerivAt.const_cpow (c := (x : ℂ)) (f := fun w ↦ w) (f' := 1) (x := -z-1) (hasDerivAt_id _) ?_ using 1 · simp only [mul_one, mul_eq_mul_left_iff, cpow_eq_zero_iff, ofReal_eq_zero, ne_eq] left rw [Complex.ofReal_log] linarith · right intro h simp only [Metric.mem_ball, ε, Complex.dist_eq, neg_eq_iff_eq_neg.mp <| sub_eq_zero.mp h] at hz have := (abs_le.mp <| le_trans (abs_re_le_norm (-1-s)) hz.le).1 simp only [sub_re, neg_re, one_re, neg_le_sub_iff_le_add, le_neg_add_iff_add_le] at this linarith · apply hasDerivAt_id _ |>.neg |>.sub_const convert! (hasDerivAt_integral_of_dominated_loc_of_deriv_le (F := F) (F' := F') (x₀ := s) (s := Metric.ball s ε) (bound := bound) (μ := μ) (Metric.ball_mem_nhds s ε_pos) hF_meas hF_int hF'_meas h_bound bound_integrable h_diff).2 using 3 · ext a; simp only [one_div, F, f]; ring_nf · simp only [one_div, mul_neg, neg_mul, neg_inj, F', f]; ring_nf noncomputable def ζ₀' (N : ℕ) (s : ℂ) : ℂ := ∑ n ∈ Finset.range (N + 1), -1 / (n : ℂ) ^ s * Real.log n + (-N ^ (1 - s) / (1 - s) ^ 2 + Real.log N * N ^ (1 - s) / (1 - s)) + Real.log N * N ^ (-s) / 2 + (1 * (∫ x in Ioi (N : ℝ), (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (- s - 1)) + s * ∫ x in Ioi (N : ℝ), (⌊x⌋ + 1 / 2 - x) * (x : ℂ) ^ (- s - 1) * (- Real.log x)) lemma HasDerivAt_neg_cpow_over2 {N : ℕ} (Npos : 0 < N) (s : ℂ) : HasDerivAt (fun x : ℂ ↦ -(N : ℂ) ^ (-x) / 2) (-((- Real.log N) * (N : ℂ) ^ (-s)) / 2) s := by convert! hasDerivAt_neg' s |>.const_cpow (c := N) (by aesop) |>.neg |>.div_const _ using 1 simp [mul_comm] lemma HasDerivAt_cpow_over_var (N : ℕ) {z : ℂ} (z_ne_zero : z ≠ 0) : HasDerivAt (fun z ↦ -(N : ℂ) ^ z / z) (((N : ℂ) ^ z / z ^ 2) - (Real.log N * N ^ z / z)) z := by simp_rw [div_eq_mul_inv] convert! HasDerivAt.mul (c := fun z ↦ - (N : ℂ) ^ z) (d := fun z ↦ z⁻¹) (c' := - (N : ℂ) ^ z * Real.log N) (d' := - (z ^ 2)⁻¹) ?_ ?_ using 1 · simp only [natCast_log, neg_mul, mul_neg, neg_neg] ring_nf · simp only [natCast_log, neg_mul] apply HasDerivAt.neg convert! HasDerivAt.const_cpow (c := (N : ℂ)) (f := id) (f' := 1) (x := z) (hasDerivAt_id z) (by simp [z_ne_zero]) using 1 simp only [id_eq, mul_one] · exact hasDerivAt_inv z_ne_zero lemma HasDerivAtZeta0 {N : ℕ} (Npos : 0 < N) {s : ℂ} (reS_pos : 0 < s.re) (s_ne_one : s ≠ 1) : HasDerivAt (riemannZeta0 N) (ζ₀' N s) s := by unfold riemannZeta0 ζ₀' apply HasDerivAt.fun_sum ?_ |>.add ?_ |>.add ?_ |>.add ?_ · intro n _ convert! hasDerivAt_neg' s |>.const_cpow (c := n) (by aesop) using 1 all_goals (ring_nf; simp [cpow_neg]) · convert! HasDerivAt.comp (h₂ := fun z ↦ -(N : ℂ) ^ z / z) (h := fun z ↦ 1 - z) (h' := -1) (h₂' := ((N : ℂ) ^ (1 - s) / (1 - s) ^ 2 - Real.log (N : ℝ) * (N : ℂ) ^ (1 - s) / (1 - s))) (x := s) ?_ ?_ using 1 · ring_nf · exact HasDerivAt_cpow_over_var N (by rw [sub_ne_zero]; exact s_ne_one.symm) · convert! hasDerivAt_const s _ |>.sub (hasDerivAt_id _) using 1; simp · convert! HasDerivAt_neg_cpow_over2 Npos s using 1; simp only [natCast_log, neg_mul, neg_neg] · simp_rw [div_cpow_eq_cpow_neg, neg_add, ← sub_eq_add_neg] convert! hasDerivAt_id s |>.mul <| hasDerivAt_Zeta0Integral Npos reS_pos using 1 lemma HolomorphicOn_riemannZeta0 {N : ℕ} (N_pos : 0 < N) : HolomorphicOn (riemannZeta0 N) {s : ℂ | s ≠ 1 ∧ 0 < s.re} := fun _ ⟨hs₁, hs₂⟩ ↦ (HasDerivAtZeta0 N_pos hs₂ hs₁).differentiableAt.differentiableWithinAt lemma HolomorphicOn_riemannZeta : HolomorphicOn riemannZeta {s : ℂ | s ≠ 1} := by intro z hz simp only [mem_ofPred_eq] at hz exact (differentiableAt_riemannZeta hz).differentiableWithinAt lemma isPathConnected_aux : IsPathConnected {z : ℂ | z ≠ 1 ∧ 0 < z.re} := by use (2 : ℂ) constructor · simp intro w hw; simp only [ne_eq, mem_ofPred_eq] at hw by_cases w_im : w.im = 0 · apply JoinedIn.trans (y := 1 + I) · let f : ℝ → ℂ := fun t ↦ (1 + I) * t + 2 * (1 - t) have cont : Continuous f := by continuity apply JoinedIn.ofLine cont.continuousOn (by simp [f]) (by simp [f]) simp only [unitInterval, ne_eq, image_subset_iff, preimage_ofPred_eq, add_re, mul_re, one_re, I_re, add_zero, ofReal_re, one_mul, add_im, one_im, I_im, zero_add, ofReal_im, mul_zero, sub_zero, re_ofNat, sub_re, im_ofNat, sub_im, sub_self, f] intro x hx; simp only [mem_Icc] at hx refine ⟨?_, by linarith⟩ intro h rw [Complex.ext_iff] at h; simp [(by apply And.right; simpa [w_im] using h : x = 0)] at h · let f : ℝ → ℂ := fun t ↦ w * t + (1 + I) * (1 - t) have cont : Continuous f := by continuity apply JoinedIn.ofLine cont.continuousOn (by simp [f]) (by simp [f]) simp only [unitInterval, ne_eq, image_subset_iff, preimage_ofPred_eq, add_re, mul_re, ofReal_re, ofReal_im, mul_zero, sub_zero, one_re, I_re, add_zero, sub_re, one_mul, add_im, one_im, I_im, zero_add, sub_im, sub_self, f] intro x hx; simp only [mem_Icc] at hx simp only [mem_ofPred_eq] constructor · intro h refine hw.1 ?_ rw [Complex.ext_iff] at h have : x = 1 := by linarith [(by apply And.right; simpa [w_im] using h : 1 - x = 0)] rw [Complex.ext_iff, one_re, one_im]; exact ⟨by simpa [this, w_im] using h, w_im⟩ · by_cases hxx : x = 0 · simp only [hxx]; linarith · have : 0 < x := lt_of_le_of_ne hx.1 (Ne.symm hxx) have : 0 ≤ 1 - x := by linarith have := hw.2 positivity · let f : ℝ → ℂ := fun t ↦ w * t + 2 * (1 - t) have cont : Continuous f := by continuity apply JoinedIn.ofLine cont.continuousOn (by simp [f]) (by simp [f]) simp only [unitInterval, ne_eq, image_subset_iff, preimage_ofPred_eq, add_re, mul_re, ofReal_re, ofReal_im, mul_zero, sub_zero, re_ofNat, sub_re, one_re, im_ofNat, sub_im, one_im, sub_self, f] intro x hx; simp only [mem_Icc] at hx constructor · intro h rw [Complex.ext_iff] at h; simp [(by apply And.right; simpa [w_im] using h : x = 0)] at h · by_cases hxx : x = 0 · simp only [hxx]; linarith · have : 0 < x := lt_of_le_of_ne hx.1 (Ne.symm hxx) have : 0 ≤ 1 - x := by linarith have := hw.2 positivity lemma Zeta0EqZeta {N : ℕ} (N_pos : 0 < N) {s : ℂ} (reS_pos : 0 < s.re) (s_ne_one : s ≠ 1) : riemannZeta0 N s = riemannZeta s := by let f := riemannZeta let g := riemannZeta0 N let U := {z : ℂ | z ≠ 1 ∧ 0 < z.re} have f_an : AnalyticOnNhd ℂ f U := by apply (HolomorphicOn_riemannZeta.analyticOnNhd isOpen_ne).mono simp only [ne_eq, ofPred_subset_ofPred, and_imp, U] exact fun a ha _ ↦ ha have g_an : AnalyticOnNhd ℂ g U := (HolomorphicOn_riemannZeta0 N_pos).analyticOnNhd isOpen_aux have preconU : IsPreconnected U := by apply IsConnected.isPreconnected apply (IsOpen.isConnected_iff_isPathConnected isOpen_aux).mpr isPathConnected_aux have h2 : (2 : ℂ) ∈ U := by simp [U] have s_mem : s ∈ U := by simp [U, reS_pos, s_ne_one] convert (AnalyticOnNhd.eqOn_of_preconnected_of_eventuallyEq f_an g_an preconU h2 ?_ s_mem).symm have u_mem : {z : ℂ | 1 < z.re} ∈ 𝓝 (2 : ℂ) := by apply mem_nhds_iff.mpr use {z : ℂ | 1 < z.re} simp only [ofPred_subset_ofPred, imp_self, forall_const, mem_ofPred_eq, re_ofNat, Nat.one_lt_ofNat, and_true, true_and] exact isOpen_lt (by continuity) (by continuity) filter_upwards [u_mem] intro z hz simp only [f,g, zeta_eq_tsum_one_div_nat_cpow hz, riemannZeta0_apply] nth_rewrite 2 [neg_div] rw [← sub_eq_add_neg, ← ZetaSum_aux2 N_pos hz, ← (summable_one_div_nat_cpow.mpr hz).sum_add_tsum_nat_add (N + 1)] norm_cast lemma DerivUpperBnd_aux7_1 {x σ t : ℝ} (hx : 1 ≤ x) : let s := ↑σ + ↑t * I; ‖(↑⌊x⌋ + 1 / 2 - ↑x) * (x : ℂ) ^ (-s - 1) * -↑x.log‖ = |(↑⌊x⌋ + 1 / 2 - x)| * x ^ (-σ - 1) * x.log := by have xpos : 0 < x := lt_of_lt_of_le (by norm_num) hx have : ‖(x.log : ℂ)‖ = x.log := Complex.norm_of_nonneg <| Real.log_nonneg hx simp [← norm_real, this, Complex.norm_cpow_eq_rpow_re_of_pos xpos, ← Real.norm_eq_abs, ← ofReal_ofNat, ← ofReal_inv, ← ofReal_add, ← ofReal_sub, ← ofReal_intCast, one_div] theorem summable_complex_then_summable_real_part (f : ℕ → ℂ) (h : Summable f) : Summable (fun n ↦ (f n).re) := by rcases h with ⟨s, hs⟩ exact ⟨s.re, hasSum_re hs⟩ open ArithmeticFunction (vonMangoldt) open scoped ComplexOrder in theorem dlog_riemannZeta_bdd_on_vertical_lines_generalized (σ₀ σ₁ t : ℝ) (σ₀_gt_one : 1 < σ₀) (σ₀_lt_σ₁ : σ₀ ≤ σ₁) : ‖(- (deriv riemannZeta) (σ₁ + t * I) / riemannZeta (σ₁ + t * I))‖ ≤ ‖(deriv riemannZeta) σ₀ / riemannZeta σ₀‖ := by let s₁ := σ₁ + t * I have s₁_re_eq_sigma : s₁.re = σ₁ := by rw [add_re, ofReal_re, mul_I_re, ofReal_im] ring have s₀_re_eq_sigma : (↑σ₀ : ℂ).re = σ₀ := by rw [ofReal_re] let s₀ := σ₀ have σ₁_gt_one : 1 < σ₁ := by exact lt_of_le_of_lt' σ₀_lt_σ₁ σ₀_gt_one have s₀_gt_one : 1 < (↑σ₀ : ℂ).re := by exact σ₀_gt_one have s₁_re_geq_one : 1 < s₁.re := by exact lt_of_lt_of_eq σ₁_gt_one (id (Eq.symm s₁_re_eq_sigma)) rw [← (ArithmeticFunction.LSeries_vonMangoldt_eq_deriv_riemannZeta_div s₁_re_geq_one)] unfold LSeries have summable_von_mangoldt_at_σ₀ : Summable (fun i ↦ LSeries.term (fun n ↦ ↑(ArithmeticFunction.vonMangoldt n)) σ₀ i) := by exact ArithmeticFunction.LSeriesSummable_vonMangoldt σ₀_gt_one have summable_re_von_mangoldt_at_σ₀ : Summable (fun i ↦ (LSeries.term (fun n ↦ ↑(ArithmeticFunction.vonMangoldt n)) σ₀ i).re) := by exact summable_complex_then_summable_real_part (LSeries.term (fun n ↦ ↑(ArithmeticFunction.vonMangoldt n)) σ₀) summable_von_mangoldt_at_σ₀ have summable_abs_value : Summable (fun i ↦ ‖LSeries.term (fun n ↦ ↑(ArithmeticFunction.vonMangoldt n)) s₁ i‖) := by rw [summable_norm_iff] exact ArithmeticFunction.LSeriesSummable_vonMangoldt s₁_re_geq_one apply le_trans <| norm_tsum_le_tsum_norm summable_abs_value rw [← norm_neg, ← neg_div, ← ArithmeticFunction.LSeries_vonMangoldt_eq_deriv_riemannZeta_div s₀_gt_one] unfold LSeries rw [← re_eq_norm.mpr, re_tsum summable_von_mangoldt_at_σ₀] · apply Summable.tsum_mono summable_abs_value summable_re_von_mangoldt_at_σ₀ intro n beta_reduce apply le_trans <| LSeries.norm_term_le_of_re_le_re (s := σ₀) _ _ _ · rw [re_eq_norm.mpr] apply LSeries.term_nonneg exact_mod_cast ArithmeticFunction.vonMangoldt_nonneg · rwa [s₁_re_eq_sigma, s₀_re_eq_sigma] · apply tsum_nonneg intro n apply LSeries.term_nonneg exact_mod_cast ArithmeticFunction.vonMangoldt_nonneg end section /- Uniform continuous reciprocal-prime test functions, including variable endpoints. A single Mertens remainder threshold controls all exponential prime bands whose left logarithmic endpoint is bounded below by a positive constant. On a compact rectangle, uniform continuity and boundedness then give convergence uniformly in the test-function parameter and both endpoints. The number of equal grid cells is fixed across all intervals; the endpoints of the cells may vary. Only `PrimeReciprocalMeasure` and its already checked dependencies are used. No additional analytic hypothesis is introduced. -/ namespace Bounty open Finset Filter Real MeasureTheory open scoped Topology theorem exponential_prime_band_harmonic_uniform_error {a ε : ℝ} (ha : 0 < a) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ u v : ℝ, a ≤ u → u ≤ v → |primeBandHarmonic (exp (u*L)) (exp (v*L))-log (v/u)| < ε := by have hr := Metric.tendsto_nhds.mp Mertens.prime_reciprocal_error_tendsto (ε/2) (by positivity) obtain ⟨X, hX⟩ := eventually_atTop.mp hr have he : Tendsto (fun L : ℝ => exp (a*L)) atTop atTop := tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop ha) filter_upwards [eventually_gt_atTop (0 : ℝ), he.eventually_ge_atTop X] with L hL hLX intro u v hau huv have hu := ha.trans_le hau have hv := hu.trans_le huv have hxu := hLX.trans (exp_le_exp.mpr (mul_le_mul_of_nonneg_right hau hL.le)) have hxv := hxu.trans (exp_le_exp.mpr (mul_le_mul_of_nonneg_right huv hL.le)) have hU := hX (exp (u*L)) hxu have hV := hX (exp (v*L)) hxv rw [Real.dist_eq] at hU hV rw [prime_band_harmonic_eq_prefix_sub (exp_pos _).le (exp_le_exp.mpr (mul_le_mul_of_nonneg_right huv hL.le))] have heq : primeBandHarmonic 0 (exp (v*L)) - primeBandHarmonic 0 (exp (u*L)) - log (v/u) = ((∑ p ∈ (Ioc 0 ⌊exp (v*L)⌋₊).filter Nat.Prime, 1/(p:ℝ)) - log (log (exp (v*L))) - Mertens.M) - ((∑ p ∈ (Ioc 0 ⌊exp (u*L)⌋₊).filter Nat.Prime, 1/(p:ℝ)) - log (log (exp (u*L))) - Mertens.M) := by simp only [primeBandHarmonic, primeBand, Nat.floor_zero, log_exp, log_mul hv.ne' hL.ne', log_mul hu.ne' hL.ne', log_div hv.ne' hu.ne'] ring rw [heq] exact (abs_sub _ _).trans_lt (by linarith) theorem exists_uniform_reciprocal_grid_oscillation {a b c d : ℝ} (hab : a < b) (F : ℝ × ℝ → ℝ) (hF : ContinuousOn F ((Set.Icc c d) ×ˢ (Set.Icc a b))) {η : ℝ} (hη : 0 < η) : ∃ N : ℕ, 0 < N ∧ ∀ w ∈ Set.Icc c d, ∀ u v : ℝ, a ≤ u → u ≤ v → v ≤ b → ∀ i : ℕ, i < N → ∀ x ∈ Set.Icc (reciprocalGrid u v N i) (reciprocalGrid u v N (i+1)), |F (w,x)-F (w,reciprocalGrid u v N i)| ≤ η := by have hu := (isCompact_Icc.prod isCompact_Icc).uniformContinuousOn_of_continuous hF obtain ⟨δ, hδ, hclose⟩ := Metric.uniformContinuousOn_iff_le.mp hu η hη obtain ⟨N, hN⟩ := exists_nat_gt ((b-a)/δ) have hN0 : 0 < N := by have hpos : (0 : ℝ) < N := (div_pos (sub_pos.mpr hab) hδ).trans hN exact_mod_cast hpos have hNr : (0 : ℝ) < N := by exact_mod_cast hN0 have hstep : (b-a)/(N : ℝ) ≤ δ := by apply (div_le_iff₀ hNr).mpr have h := (div_lt_iff₀ hδ).mp hN nlinarith refine ⟨N, hN0, ?_⟩ intro w hw u v hau huv hvb i hi x hx have hiN := reciprocal_grid_mem huv hN0 hi.le have hi1N := reciprocal_grid_mem huv hN0 (Nat.succ_le_of_lt hi) have hleft : reciprocalGrid u v N i ∈ Set.Icc a b := ⟨hau.trans hiN.1, hiN.2.trans hvb⟩ have hxmem : x ∈ Set.Icc a b := ⟨hleft.1.trans hx.1, hx.2.trans (hi1N.2.trans hvb)⟩ have hd : dist (w,x) (w,reciprocalGrid u v N i) ≤ δ := by simp only [Prod.dist_eq, dist_self, max_eq_right (dist_nonneg)] rw [Real.dist_eq, abs_of_nonneg (sub_nonneg.mpr hx.1)] calc _ ≤ reciprocalGrid u v N (i+1)-reciprocalGrid u v N i := sub_le_sub_right hx.2 _ _ = (v-u)/(N : ℝ) := reciprocal_grid_step u v N i _ ≤ (b-a)/(N : ℝ) := div_le_div_of_nonneg_right (by linarith) hNr.le _ ≤ δ := hstep simpa only [Real.dist_eq] using hclose (w,x) ⟨hw,hxmem⟩ (w,reciprocalGrid u v N i) ⟨hw,hleft⟩ hd theorem exponential_prime_band_harmonic_mono {a b u v L : ℝ} (hL : 0 ≤ L) (hau : a ≤ u) (hvb : v ≤ b) : primeBandHarmonic (exp (u*L)) (exp (v*L)) ≤ primeBandHarmonic (exp (a*L)) (exp (b*L)) := by apply sum_le_sum_of_subset_of_nonneg · intro p hp obtain ⟨hp, hpu, hpv⟩ := (mem_primeBand_iff (exp_pos _).le (exp_pos _).le p).mp hp exact (mem_primeBand_iff (exp_pos _).le (exp_pos _).le p).mpr ⟨hp, (exp_le_exp.mpr (mul_le_mul_of_nonneg_right hau hL)).trans_lt hpu, hpv.trans (exp_le_exp.mpr (mul_le_mul_of_nonneg_right hvb hL))⟩ · intro p hp hpn positivity theorem reciprocal_grid_sample_uniform_error (f : ℝ → ℝ) {a u v L C δ : ℝ} (hau : a ≤ u) (huv : u ≤ v) (hC : 0 ≤ C) {N : ℕ} (hN : 0 < N) (hbound : ∀ t ∈ Set.Icc u v, |f t| ≤ C) (herr : ∀ x y : ℝ, a ≤ x → x ≤ y → |primeBandHarmonic (exp (x*L)) (exp (y*L))-log (y/x)| ≤ δ) : |(∑ i ∈ range N, f (reciprocalGrid u v N i) * primeBandHarmonic (exp (reciprocalGrid u v N i*L)) (exp (reciprocalGrid u v N (i+1)*L))) - (∑ i ∈ range N, f (reciprocalGrid u v N i) * log (reciprocalGrid u v N (i+1)/reciprocalGrid u v N i))| ≤ (N : ℝ)*C*δ := by rw [← sum_sub_distrib] calc _ ≤ ∑ i ∈ range N, |f (reciprocalGrid u v N i) * primeBandHarmonic (exp (reciprocalGrid u v N i*L)) (exp (reciprocalGrid u v N (i+1)*L)) - f (reciprocalGrid u v N i)* log (reciprocalGrid u v N (i+1)/reciprocalGrid u v N i)| := abs_sum_le_sum_abs _ _ _ ≤ ∑ i ∈ range N, C*δ := by apply sum_le_sum intro i hi rw [← mul_sub, abs_mul] exact mul_le_mul (hbound _ (reciprocal_grid_mem huv hN (mem_range.mp hi).le)) (herr _ _ (hau.trans (reciprocal_grid_mem huv hN (mem_range.mp hi).le).1) (reciprocal_grid_monotone huv N (Nat.le_succ i))) (abs_nonneg _) hC _ = _ := by simp [mul_assoc] theorem exponential_prime_weighted_reciprocal_uniform_error {a b c d : ℝ} (ha : 0 < a) (hab : a < b) (F : ℝ × ℝ → ℝ) (hF : ContinuousOn F ((Set.Icc c d) ×ˢ (Set.Icc a b))) {ε : ℝ} (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ w ∈ Set.Icc c d, ∀ u v : ℝ, a ≤ u → u ≤ v → v ≤ b → |(∑ p ∈ primeBand (exp (u*L)) (exp (v*L)), F (w,log (p : ℝ)/L)/(p : ℝ)) - (∫ t in u..v, F (w,t)/t)| < ε := by obtain ⟨C₀, hC₀⟩ := (isCompact_Icc.prod isCompact_Icc).exists_bound_of_continuousOn hF let C : ℝ := |C₀|+1 have hC : 0 < C := by dsimp [C]; positivity have hbound : ∀ w ∈ Set.Icc c d, ∀ t ∈ Set.Icc a b, |F (w,t)| ≤ C := by intro w hw t ht have h := hC₀ (w,t) ⟨hw,ht⟩ rw [Real.norm_eq_abs] at h exact h.trans (by dsimp [C]; linarith [le_abs_self C₀]) let B : ℝ := (|log (b/a)|+1)+(b-a)/a+1 have hB : 0 < B := by dsimp [B]; positivity let η : ℝ := ε/(4*B) have hη : 0 < η := by dsimp [η]; positivity obtain ⟨N, hN, hosc⟩ := exists_uniform_reciprocal_grid_oscillation hab F hF hη have hNr : (0 : ℝ) < N := by exact_mod_cast hN let δ : ℝ := ε/(4*(N : ℝ)*C) have hδ : 0 < δ := by dsimp [δ]; positivity have hsample_budget : (N : ℝ)*C*δ = ε/4 := by dsimp [δ]; field_simp have happrox_budget : η*(|log (b/a)|+1)+(η/a)*(b-a) ≤ ε/4 := by have heq : η*B = ε/4 := by dsimp [η]; field_simp calc _ = η*(B-1) := by dsimp [B]; ring _ ≤ η*B := mul_le_mul_of_nonneg_left (by linarith) hη.le _ = ε/4 := heq have hmass := (exponential_prime_band_harmonic_tendsto ha hab.le).eventually_lt_const (show log (b/a) < |log (b/a)|+1 by linarith [le_abs_self (log (b/a))]) filter_upwards [eventually_gt_atTop (0 : ℝ), hmass, exponential_prime_band_harmonic_uniform_error ha hδ] with L hL hm herr intro w hw u v hau huv hvb have hu := ha.trans_le hau let f : ℝ → ℝ := fun t => F (w,t) have hf : ContinuousOn f (Set.Icc u v) := by exact hF.comp (continuousOn_const.prodMk continuousOn_id) (by intro t ht exact ⟨hw, hau.trans ht.1, ht.2.trans hvb⟩) have hoscu := hosc w hw u v hau huv hvb let A : ℝ := ∑ i ∈ range N, f (reciprocalGrid u v N i) * primeBandHarmonic (exp (reciprocalGrid u v N i*L)) (exp (reciprocalGrid u v N (i+1)*L)) let J : ℝ := ∑ i ∈ range N, f (reciprocalGrid u v N i) * log (reciprocalGrid u v N (i+1)/reciprocalGrid u v N i) have hp : |(∑ p ∈ primeBand (exp (u*L)) (exp (v*L)), f (log (p : ℝ)/L)/(p : ℝ))-A| ≤ η*(|log (b/a)|+1) := by exact (reciprocal_grid_prime_approximation f huv hL hN hoscu).trans (mul_le_mul_of_nonneg_left ((exponential_prime_band_harmonic_mono hL.le hau hvb).trans hm.le) hη.le) have hs : |A-J| ≤ ε/4 := by rw [← hsample_budget] exact reciprocal_grid_sample_uniform_error f hau huv hC.le hN (fun t ht => hbound w hw t ⟨hau.trans ht.1, ht.2.trans hvb⟩) (fun x y hax hxy => (herr x y hax hxy).le) have hint : |(∫ t in u..v, f t/t)-J| ≤ (η/a)*(b-a) := by exact (reciprocal_grid_integral_approximation f hu huv hη.le hf hN hoscu).trans (mul_le_mul (div_le_div_of_nonneg_left hη.le ha hau) (by linarith) (sub_nonneg.mpr huv) (div_nonneg hη.le ha.le)) have hi : |J-(∫ t in u..v, f t/t)| ≤ (η/a)*(b-a) := by simpa only [abs_sub_comm] using hint have htri := abs_sub_le (∑ p ∈ primeBand (exp (u*L)) (exp (v*L)), f (log (p : ℝ)/L)/(p : ℝ)) A (∫ t in u..v, f t/t) have htri' := abs_sub_le A J (∫ t in u..v, f t/t) change |(∑ p ∈ primeBand (exp (u*L)) (exp (v*L)), f (log (p : ℝ)/L)/(p : ℝ))-(∫ t in u..v, f t/t)| < ε linarith end Bounty /- Public declaration closure audit. -/ end section /- Positivity, integrability, and compact bounds for Buchstab densities and their recursion kernel. -/ open Filter MeasureTheory open scoped Topology namespace Bounty theorem buchstab_depth_density_ge_prime_term (n : ℕ) {γ w : ℝ} (hγ : 0 < γ) (hw : 0 < w) : 1 / w ≤ buchstabDepthDensity n γ w := by induction n generalizing γ w with | zero => exact le_refl _ | succ n ih => change 1 / w ≤ 1 / w + ∫ α in γ..max γ (w / 2), buchstabDepthDensity n α (w - α) / α apply le_add_of_nonneg_right by_cases hhalf : w / 2 ≤ γ · simp only [max_eq_left hhalf, intervalIntegral.integral_same, le_refl] · have hγhalf : γ ≤ w / 2 := (lt_of_not_ge hhalf).le rw [max_eq_right hγhalf] apply intervalIntegral.integral_nonneg hγhalf intro α hα have hα0 : 0 < α := hγ.trans_le hα.1 have hwα : 0 < w - α := by linarith [hα.2] exact div_nonneg ((one_div_pos.mpr hwα).le.trans (ih hα0 hwα)) hα0.le theorem buchstab_depth_density_pos (n : ℕ) {γ w : ℝ} (hγ : 0 < γ) (hw : 0 < w) : 0 < buchstabDepthDensity n γ w := (one_div_pos.mpr hw).trans_le (buchstab_depth_density_ge_prime_term n hγ hw) theorem buchstab_density_pos {γ w : ℝ} (hγ : 0 < γ) (hw : 0 < w) : 0 < buchstabDensity γ w := buchstab_depth_density_pos ⌊w / γ⌋₊ hγ hw theorem buchstab_density_nonneg {γ w : ℝ} (hγ : 0 < γ) (hw : 0 < w) : 0 ≤ buchstabDensity γ w := (buchstab_density_pos hγ hw).le theorem buchstab_density_kernel_continuous : ContinuousOn (fun p : ℝ × ℝ => buchstabDensity p.2 (p.1 - p.2) / p.2) {p | 0 < p.2 ∧ p.2 < p.1} := by have hc : ContinuousOn (fun p : ℝ × ℝ => (p.2, p.1 - p.2)) {p | 0 < p.2 ∧ p.2 < p.1} := by fun_prop have hnum := buchstab_density_continuous.comp hc (fun p hp => ⟨hp.1, sub_pos.mpr hp.2⟩) exact hnum.div (by fun_prop) (fun p hp => hp.1.ne') theorem buchstab_density_kernel_continuousOn_interval {γ w : ℝ} (hγ : 0 < γ) (hγhalf : γ ≤ w / 2) : ContinuousOn (fun α : ℝ => buchstabDensity α (w - α) / α) (Set.Icc γ (w / 2)) := by have hw : 0 < w := by linarith apply buchstab_density_kernel_continuous.comp (show ContinuousOn (fun α : ℝ => (w, α)) (Set.Icc γ (w / 2)) by fun_prop) intro α hα exact ⟨hγ.trans_le hα.1, by linarith [hα.2]⟩ theorem buchstab_density_kernel_intervalIntegrable {γ w : ℝ} (hγ : 0 < γ) (hγhalf : γ ≤ w / 2) : IntervalIntegrable (fun α : ℝ => buchstabDensity α (w - α) / α) volume γ (w / 2) := by apply ContinuousOn.intervalIntegrable rw [Set.uIcc_of_le hγhalf] exact buchstab_density_kernel_continuousOn_interval hγ hγhalf theorem buchstab_density_compact_bound {K : Set (ℝ × ℝ)} (hK : IsCompact K) (hKpos : ∀ p ∈ K, 0 < p.1 ∧ 0 < p.2) : ∃ C : ℝ, 0 < C ∧ ∀ p ∈ K, 0 ≤ buchstabDensity p.1 p.2 ∧ buchstabDensity p.1 p.2 ≤ C := by obtain ⟨C, hC⟩ := hK.bddAbove_image (buchstab_density_continuous.mono hKpos) refine ⟨|C| + 1, by positivity, ?_⟩ intro p hp refine ⟨buchstab_density_nonneg (hKpos p hp).1 (hKpos p hp).2, ?_⟩ have hh := hC (Set.mem_image_of_mem (fun p : ℝ × ℝ => buchstabDensity p.1 p.2) hp) exact hh.trans ((le_abs_self C).trans (le_add_of_nonneg_right (by norm_num))) theorem buchstab_density_rectangle_bound {γ₀ γ₁ w₀ w₁ : ℝ} (hγ₀ : 0 < γ₀) (hw₀ : 0 < w₀) : ∃ C : ℝ, 0 < C ∧ ∀ γ w : ℝ, γ₀ ≤ γ → γ ≤ γ₁ → w₀ ≤ w → w ≤ w₁ → 0 ≤ buchstabDensity γ w ∧ buchstabDensity γ w ≤ C := by obtain ⟨C, hC, hbound⟩ := buchstab_density_compact_bound (K := Set.Icc γ₀ γ₁ ×ˢ Set.Icc w₀ w₁) (isCompact_Icc.prod isCompact_Icc) (fun p hp => ⟨hγ₀.trans_le hp.1.1, hw₀.trans_le hp.2.1⟩) exact ⟨C, hC, fun γ w hγlo hγhi hwlo hwhi => hbound (γ, w) ⟨⟨hγlo, hγhi⟩, ⟨hwlo, hwhi⟩⟩⟩ end Bounty end section /- An output specified by testing against a conditioned function inherits an energy estimate from the conditioning map and the intermediate vector. No linearity, symmetry, or positivity of the maps is required. -/ open Finset Classical namespace Bounty theorem finite_conditioned_energy_le {X Y : Type*} [Fintype X] [Fintype Y] (μ : X → ℝ) (ν : Y → ℝ) (hμ : ∀ x, 0 ≤ μ x) (hν : ∀ y, 0 ≤ ν y) (C : (X → ℂ) → Y → ℂ) {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : ∀ u, finiteWeightedEnergy ν (C u) ≤ A * finiteWeightedEnergy μ u) (f output : X → ℂ) (v : Y → ℂ) (hv : finiteWeightedEnergy ν v ≤ B * finiteWeightedEnergy μ f) (hpair : ∀ u, (∑ x, (μ x : ℂ) * (starRingEnd ℂ) (u x) * output x) = ∑ y, (ν y : ℂ) * (starRingEnd ℂ) (C u y) * v y) : finiteWeightedEnergy μ output ≤ A * B * finiteWeightedEnergy μ f := by have hf0 : 0 ≤ finiteWeightedEnergy μ f := sum_nonneg fun x _ => mul_nonneg (hμ x) (sq_nonneg _) have ho0 : 0 ≤ finiteWeightedEnergy μ output := sum_nonneg fun x _ => mul_nonneg (hμ x) (sq_nonneg _) have hn : cleanActiveNorm μ output ≤ (Real.sqrt A * Real.sqrt B) * Real.sqrt (finiteWeightedEnergy μ f) := by apply clean_active_norm_le_of_self_pairing μ hμ output (mul_nonneg (mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)) (Real.sqrt_nonneg _)) rw [hpair output] have hc := finite_weighted_bilinear_cauchy ν hν (fun y => (starRingEnd ℂ) (C output y)) v simp only [finiteWeightedEnergy, Complex.norm_conj] at hc have hc' := Real.sqrt_le_sqrt (hC output) have hv' := Real.sqrt_le_sqrt hv rw [Real.sqrt_mul hA] at hc' rw [Real.sqrt_mul hB] at hv' calc _ ≤ Real.sqrt (finiteWeightedEnergy ν (C output)) * Real.sqrt (finiteWeightedEnergy ν v) := hc _ ≤ (Real.sqrt A * Real.sqrt (finiteWeightedEnergy μ output)) * (Real.sqrt B * Real.sqrt (finiteWeightedEnergy μ f)) := mul_le_mul hc' hv' (Real.sqrt_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)) _ = _ := by change _ = (Real.sqrt A * Real.sqrt B) * Real.sqrt (finiteWeightedEnergy μ f) * Real.sqrt (finiteWeightedEnergy μ output); ring have hs := (sq_le_sq₀ (Real.sqrt_nonneg (finiteWeightedEnergy μ output)) (mul_nonneg (mul_nonneg (Real.sqrt_nonneg A) (Real.sqrt_nonneg B)) (Real.sqrt_nonneg _))).mpr hn rw [mul_pow, mul_pow, Real.sq_sqrt hA, Real.sq_sqrt hB, Real.sq_sqrt hf0, Real.sq_sqrt ho0] at hs exact hs end Bounty end section /- The norm conversion for the mixed model. The small measure is counting on residue-valid injective lists, multiplied by the original constant state mass. It is not replaced by a product law on repeated small labels. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSmallBigEnergy {S X : Type*} [Fintype S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (f : PhysicalSmallBigState P J ell X → ℂ) : ℝ := ∑ x, W x * ∑ r : PhysicalResidues P, ∑ L : PhysicalResidueMarksAt P J ell r, physicalStateMass V J ell * ‖f ((r, L.val), x)‖ ^ 2 noncomputable def physicalSmallBigCondition {S X : Type*} [Fintype S] [DecidableEq S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (q : ℝ) (f : PhysicalSmallBigState P J ell X → ℂ) (d : PhysicalSharedLists P J) (x : X) (r : PhysicalResidues P) : ℂ := physicalSmallCondition V q r d (fun L => f ((r, L), x)) noncomputable def physicalSmallBigConditionEnergy {S X : Type*} [Fintype S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J : ℕ} (W : X → ℝ) (F : PhysicalSharedLists P J → X → PhysicalResidues P → ℂ) : ℝ := ∑ d, ∑ r, finiteWeightedEnergy W (fun x => F d x r) theorem physical_small_big_condition_energy_reindex {S X : Type*} [Fintype S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J : ℕ} (W : X → ℝ) (F : PhysicalSharedLists P J → X → PhysicalResidues P → ℂ) : physicalSmallBigConditionEnergy W F = ∑ x, W x * ∑ r, ∑ d, ‖F d x r‖ ^ 2 := by unfold physicalSmallBigConditionEnergy finiteWeightedEnergy simp only [mul_sum] rw [sum_comm] calc (∑ r, ∑ d, ∑ x, W x * ‖F d x r‖ ^ 2) = ∑ r, ∑ x, ∑ d, W x * ‖F d x r‖ ^ 2 := by apply sum_congr rfl intro r _ exact sum_comm _ = _ := sum_comm theorem exists_physical_small_big_condition_energy_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S X : Type) [Fintype S] [DecidableEq S] [Fintype X] (P : S → Finset ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] (J : ℕ) (V : S → ℝ), (∀ s, v ≤ V s) → ∀ (W : X → ℝ), (∀ x, 0 ≤ W x) → ∀ f : PhysicalSmallBigState P J ell X → ℂ, physicalSmallBigConditionEnergy W (physicalSmallBigCondition V q f) ≤ A ^ Fintype.card S * physicalSmallBigEnergy V W f := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_conditioning_energy_bound hq0 hq1 hv ell refine ⟨A, hA, ?_⟩ intro S X _ dS _ cases Subsingleton.elim dS (Classical.typeDecidableEq S) intro P _ J V hV W hW f rw [physical_small_big_condition_energy_reindex] calc _ ≤ ∑ x, W x * ∑ r : PhysicalResidues P, A ^ Fintype.card S * ∑ L : PhysicalResidueMarksAt P J ell r, physicalStateMass V J ell * ‖f ((r, L.val), x)‖ ^ 2 := by apply sum_le_sum intro x _ apply mul_le_mul_of_nonneg_left _ (hW x) apply sum_le_sum intro r _ exact hbound S P J V hV r (fun L => f ((r, L), x)) _ = _ := by simp only [← mul_sum, physicalSmallBigEnergy] rw [mul_sum] apply sum_congr rfl intro x _ ring noncomputable def physicalSmallBigMeasure {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (s : PhysicalSmallBigState P J ell X) : ℝ := if physicalResidueMarksValid s.1.1 s.1.2 then physicalStateMass V J ell * W s.2 else 0 theorem physical_small_big_measure_nonneg {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (W : X → ℝ) (hW : ∀ x, 0 ≤ W x) (s : PhysicalSmallBigState P J ell X) : 0 ≤ physicalSmallBigMeasure V W s := by unfold physicalSmallBigMeasure split_ifs · exact mul_nonneg (physical_state_mass_pos V hV J ell).le (hW s.2) · exact le_rfl theorem physical_small_big_energy_eq {S X : Type*} [Fintype S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (f : PhysicalSmallBigState P J ell X → ℂ) : finiteWeightedEnergy (physicalSmallBigMeasure V W) f = physicalSmallBigEnergy V W f := by unfold finiteWeightedEnergy physicalSmallBigEnergy rw [Fintype.sum_prod_type, sum_comm] apply sum_congr rfl intro x _ rw [Fintype.sum_prod_type, mul_sum] apply sum_congr rfl intro r _ have hs := Finset.sum_subtype (p := physicalResidueMarksValid r) (F := inferInstance) (univ.filter (physicalResidueMarksValid r)) (by intro L; simp only [mem_filter, mem_univ, true_and]) (fun L => physicalStateMass V J ell * ‖f ((r, L), x)‖ ^ 2) rw [← hs, sum_filter, mul_sum] apply sum_congr rfl intro L _ unfold physicalSmallBigMeasure split_ifs <;> ring end Bounty end section /- Positive mixed event weights and arbitrary endpoint-dependent phases. The extra multiplier may see both small lists and every big event choice; no spectator factorization of that multiplier is asserted. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSmallBigPositiveWeight {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (q : ℝ) (E : PhysicalSharedLists P J → X → Type*) (a : PhysicalResidues P → ∀ d x, E d x → ℝ) (k : X → ℤ) (s : PhysicalSmallBigState P J ell X) (e : PhysicalSmallBigEvent E s) : ℝ := if physicalSharedPrefix s.1.2 = physicalSharedPrefix e.1 then physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell * (physicalResidueVertexWeight s.1.2 (Real.sqrt q) s.1.1 * physicalResidueVertexWeight e.1 (Real.sqrt q) (physicalTranslateResidues s.1.1 (k s.2 * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ)))) * a s.1.1 (physicalSharedPrefix s.1.2) s.2 e.2 else 0 noncomputable def physicalSmallBigPhasedAction {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (q : ℝ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℝ) (k : X → ℤ) (Φ : ∀ s : PhysicalSmallBigState P J ell X, PhysicalSmallBigEvent E s → ℂ) (F : PhysicalSmallBigState P J ell X → ℂ) (s : PhysicalSmallBigState P J ell X) : ℂ := ∑ e : PhysicalSmallBigEvent E s, (physicalSmallBigPositiveWeight V q E a k s e : ℂ) * Φ s e * F (physicalSmallBigTarget E target k s e) section variable {S X : Type*} [sharedInstance1 : Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) include S X sharedInstance1 P J ell V theorem physical_small_big_positive_weight_nonneg (hV : ∀ s, 0 < V s) (q : ℝ) (E : PhysicalSharedLists P J → X → Type*) (a : PhysicalResidues P → ∀ d x, E d x → ℝ) (ha : ∀ r d x e, 0 ≤ a r d x e) (k : X → ℤ) (s : PhysicalSmallBigState P J ell X) (e : PhysicalSmallBigEvent E s) : 0 ≤ physicalSmallBigPositiveWeight V q E a k s e := by unfold physicalSmallBigPositiveWeight split_ifs · exact mul_nonneg (mul_nonneg (physical_completion_mass_pos V _ ell hV).le (mul_nonneg (physical_residue_vertex_weight_nonneg _ (Real.sqrt_nonneg q) _) (physical_residue_vertex_weight_nonneg _ (Real.sqrt_nonneg q) _))) (ha _ _ _ _) · exact le_rfl theorem physical_small_big_event_weight_phase (q ζ : ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → X → Type*) (a : PhysicalResidues P → ∀ d x, E d x → ℝ) (Ψ : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (s : PhysicalSmallBigState P J ell X) (e : PhysicalSmallBigEvent E s) : physicalSmallBigEventWeight V q ζ aux κ E (fun r d x e => (a r d x e : ℂ) * Ψ r d x e) k s e = (physicalSmallBigPositiveWeight V q E a k s e : ℂ) * (κ (physicalSharedPrefix s.1.2) * physicalPhase ζ (physicalSharedProduct (physicalSharedPrefix s.1.2)) * Ψ s.1.1 (physicalSharedPrefix s.1.2) s.2 e.2) := by unfold physicalSmallBigEventWeight physicalSmallBigPositiveWeight rw [physical_bare_empty_prefix] split_ifs <;> push_cast <;> ring theorem physical_small_big_action_eq_phased (q ζ : ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℝ) (Ψ : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (F : PhysicalSmallBigState P J ell X → ℂ) : physicalSmallBigAction V q ζ aux κ E target (fun r d x e => (a r d x e : ℂ) * Ψ r d x e) k F = physicalSmallBigPhasedAction V q E target a k (fun s e => κ (physicalSharedPrefix s.1.2) * physicalPhase ζ (physicalSharedProduct (physicalSharedPrefix s.1.2)) * Ψ s.1.1 (physicalSharedPrefix s.1.2) s.2 e.2) F := by funext s simp only [physicalSmallBigAction, physicalSmallBigPhasedAction, physical_small_big_event_weight_phase] theorem physical_small_big_phase_norm_le (hV : ∀ s, 0 < V s) (q : ℝ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℝ) (ha : ∀ r d x e, 0 ≤ a r d x e) (k : X → ℤ) (Φ : ∀ s : PhysicalSmallBigState P J ell X, PhysicalSmallBigEvent E s → ℂ) (H : ℝ) (hΦ : ∀ s e, ‖Φ s e‖ ≤ H) (F : PhysicalSmallBigState P J ell X → ℂ) (s : PhysicalSmallBigState P J ell X) : ‖physicalSmallBigPhasedAction V q E target a k Φ F s‖ ≤ H * (∑ e : PhysicalSmallBigEvent E s, physicalSmallBigPositiveWeight V q E a k s e * ‖F (physicalSmallBigTarget E target k s e)‖) := by unfold physicalSmallBigPhasedAction calc _ ≤ ∑ e : PhysicalSmallBigEvent E s, ‖(physicalSmallBigPositiveWeight V q E a k s e : ℂ) * Φ s e * F (physicalSmallBigTarget E target k s e)‖ := norm_sum_le _ _ _ ≤ ∑ e : PhysicalSmallBigEvent E s, H * (physicalSmallBigPositiveWeight V q E a k s e * ‖F (physicalSmallBigTarget E target k s e)‖) := by apply sum_le_sum intro e _ rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (physical_small_big_positive_weight_nonneg V hV q E a ha k s e)] nlinarith [mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hΦ s e) (physical_small_big_positive_weight_nonneg V hV q E a ha k s e)) (norm_nonneg (F (physicalSmallBigTarget E target k s e)))] _ = _ := (mul_sum ..).symm theorem physical_small_big_positive_norm (hV : ∀ s, 0 < V s) (q : ℝ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℝ) (ha : ∀ r d x e, 0 ≤ a r d x e) (k : X → ℤ) (F : PhysicalSmallBigState P J ell X → ℂ) (s : PhysicalSmallBigState P J ell X) : ‖physicalSmallBigPhasedAction V q E target a k (fun _ _ => 1) (fun y => (‖F y‖ : ℂ)) s‖ = ∑ e : PhysicalSmallBigEvent E s, physicalSmallBigPositiveWeight V q E a k s e * ‖F (physicalSmallBigTarget E target k s e)‖ := by simp only [physicalSmallBigPhasedAction, mul_one, ← Complex.ofReal_mul, ← Complex.ofReal_sum, Complex.norm_real, Real.norm_eq_abs] exact abs_of_nonneg (sum_nonneg fun e _ => mul_nonneg (physical_small_big_positive_weight_nonneg V hV q E a ha k s e) (norm_nonneg _)) end end Bounty end section /- Positive history-dependent row estimates iterate on the original dependent paths. -/ open Finset Classical namespace Bounty universe u v w z section Rows variable {K : Type u} {X : Type v} {H : Type z} (E : K → X → Type w) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (weight : ∀ k x, E k x → ℝ) (update : ∀ (_t : ℕ) k x, E k x → H → H) (gain : ∀ (_t : ℕ) k x, E k x → H → ℝ) def finiteEventHistoryFactor : ∀ (_t : ℕ) (steps : List K) (x : X), FiniteEventPath E target steps x → H → ℝ | _, [], _, _, _ => 1 | t, k :: ks, x, ⟨e, p⟩, h => gain t k x e h * finiteEventHistoryFactor (t + 1) ks (target k x e) p (update t k x e h) omit [∀ k x, Fintype (E k x)] in theorem finite_event_history_factor_eq_prod (t : ℕ) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (history : H) : finiteEventHistoryFactor E target update gain t steps x p history = ∏ i : Fin steps.length, let e := finiteEventPathOccurrence E target steps x p i gain (t + i.val) (steps.get i) e.1 e.2 (finiteEventPathHistoryAt E target update t steps x p history i.val) := by induction steps generalizing t x history with | nil => simp only [finiteEventHistoryFactor, List.length_nil, Finset.univ_eq_empty, prod_empty] | cons k ks ih => rcases p with ⟨e, p⟩ erw [Fin.prod_univ_succ] change gain t k x e history * finiteEventHistoryFactor E target update gain (t + 1) ks (target k x e) p (update t k x e history) = gain t k x e history * ∏ i : Fin ks.length, gain (t + (i.val + 1)) (ks.get i) (finiteEventPathOccurrence E target ks (target k x e) p i).1 (finiteEventPathOccurrence E target ks (target k x e) p i).2 (finiteEventPathHistoryAt E target update (t + 1) ks (target k x e) p (update t k x e history) i.val) rw [ih] congr 1 apply prod_congr rfl intro i _ rw [show t + 1 + i.val = t + (i.val + 1) by omega] def finiteEventIndexedProduct (C : ℕ → K → ℝ) : ℕ → List K → ℝ | _, [] => 1 | t, k :: ks => C t k * finiteEventIndexedProduct C (t + 1) ks theorem finite_event_indexed_product_eq_prod (C : ℕ → K → ℝ) (t : ℕ) (steps : List K) : finiteEventIndexedProduct C t steps = ∏ i : Fin steps.length, C (t + i.val) (steps.get i) := by induction steps generalizing t with | nil => simp only [finiteEventIndexedProduct, List.length_nil, univ_eq_empty, prod_empty] | cons k ks ih => erw [Fin.prod_univ_succ] change C t k * finiteEventIndexedProduct C (t + 1) ks = C t k * ∏ i : Fin ks.length, C (t + (i.val + 1)) (ks.get i) rw [ih] congr 1 apply prod_congr rfl intro i _ rw [show t + 1 + i.val = t + (i.val + 1) by omega] theorem finite_event_indexed_product_nonneg (C : ℕ → K → ℝ) (hC : ∀ t k, 0 ≤ C t k) (t : ℕ) (steps : List K) : 0 ≤ finiteEventIndexedProduct C t steps := by induction steps generalizing t with | nil => exact zero_le_one | cons k ks ih => exact mul_nonneg (hC t k) (ih (t + 1)) theorem finite_event_path_integral_const_mul (steps : List K) (x : X) (F : FiniteEventPath E target steps x → ℝ) (c : ℝ) : finiteEventPathIntegral E target weight steps x (fun p => c * F p) = c * finiteEventPathIntegral E target weight steps x F := by unfold finiteEventPathIntegral rw [mul_sum] apply sum_congr rfl intro p _ ring theorem finite_event_history_integral_le_rows (hw : ∀ k x e, 0 ≤ weight k x e) (hgain : ∀ t k x e h, 0 ≤ gain t k x e h) (potential : X → ℝ) (C : ℕ → K → ℝ) (hC : ∀ t k, 0 ≤ C t k) (hrow : ∀ t k x h, (∑ e : E k x, weight k x e * gain t k x e h * potential (target k x e)) ≤ C t k * potential x) (t : ℕ) (steps : List K) (x : X) (history : H) (F : FiniteEventPath E target steps x → ℝ) {L : ℝ} (hL : 0 ≤ L) (hF : ∀ p, F p ≤ L * potential (finiteEventPathTerminal E target steps x p)) : finiteEventPathIntegral E target weight steps x (fun p => finiteEventHistoryFactor E target update gain t steps x p history * F p) ≤ finiteEventIndexedProduct C t steps * (L * potential x) := by induction steps generalizing t x history with | nil => simpa only [finite_event_path_integral_nil, finiteEventHistoryFactor, finiteEventIndexedProduct, one_mul, finiteEventPathTerminal] using hF PUnit.unit | cons k ks ih => rw [finite_event_path_integral_cons] have hp := finite_event_indexed_product_nonneg C hC (t + 1) ks calc _ = ∑ e : E k x, weight k x e * gain t k x e history * finiteEventPathIntegral E target weight ks (target k x e) (fun p => finiteEventHistoryFactor E target update gain (t + 1) ks (target k x e) p (update t k x e history) * F ⟨e, p⟩) := by apply sum_congr rfl intro e _ simp only [finiteEventHistoryFactor, mul_assoc, finite_event_path_integral_const_mul] _ ≤ ∑ e : E k x, weight k x e * gain t k x e history * (finiteEventIndexedProduct C (t + 1) ks * (L * potential (target k x e))) := by apply sum_le_sum intro e _ exact mul_le_mul_of_nonneg_left (ih (t + 1) (target k x e) (update t k x e history) (fun p => F ⟨e, p⟩) (fun p => hF ⟨e, p⟩)) (mul_nonneg (hw k x e) (hgain t k x e history)) _ = (finiteEventIndexedProduct C (t + 1) ks * L) * ∑ e : E k x, weight k x e * gain t k x e history * potential (target k x e) := by rw [mul_sum] apply sum_congr rfl intro e _ ring _ ≤ (finiteEventIndexedProduct C (t + 1) ks * L) * (C t k * potential x) := mul_le_mul_of_nonneg_left (hrow t k x history) (mul_nonneg hp hL) _ = finiteEventIndexedProduct C t (k :: ks) * (L * potential x) := by simp only [finiteEventIndexedProduct] ring end Rows end Bounty end section /- Exact finite partition of weighted pairs by adjacent exponential prime intervals. -/ open Finset Real namespace Bounty noncomputable def primeGridPairBin (b q : ℝ) (N : ℕ) (L : ℝ) (F : Finset (ℕ × ℕ)) (i : ℕ) : Finset (ℕ × ℕ) := by classical exact F.filter (fun v => v.1 ∈ primeBand (exp (reciprocalGrid b q N i*L)) (exp (reciprocalGrid b q N (i+1)*L))) theorem mem_prime_grid_pair_bin {b q L : ℝ} {N i : ℕ} {F : Finset (ℕ × ℕ)} {v : ℕ × ℕ} : v ∈ primeGridPairBin b q N L F i ↔ v ∈ F ∧ v.1 ∈ primeBand (exp (reciprocalGrid b q N i*L)) (exp (reciprocalGrid b q N (i+1)*L)) := by classical exact mem_filter theorem sum_pairs_eq_sum_prime_grid_bins_range {M : Type*} [AddCommMonoid M] {b q L : ℝ} (hbq : b ≤ q) (hL : 0 ≤ L) {N : ℕ} (hN : 0 < N) (F : Finset (ℕ × ℕ)) (f : ℕ × ℕ → M) (hF : ∀ v ∈ F, v.1 ∈ primeBand (exp (b*L)) (exp (q*L))) : (∑ v ∈ F, f v) = ∑ i ∈ range N, ∑ v ∈ primeGridPairBin b q N L F i, f v := by classical have ht : Monotone (fun i => exp (reciprocalGrid b q N i*L)) := by intro i j hij exact exp_le_exp.mpr (mul_le_mul_of_nonneg_right (reciprocal_grid_monotone hbq N hij) hL) have hadj := sum_prime_bands_adjacent (fun p => ∑ v ∈ F.filter (fun v => v.1 = p), f v) (fun i => exp (reciprocalGrid b q N i*L)) ht N simp only [reciprocal_grid_zero, reciprocal_grid_end b q hN] at hadj calc _ = ∑ p ∈ primeBand (exp (b*L)) (exp (q*L)), ∑ v ∈ F.filter (fun v => v.1 = p), f v := (sum_fiberwise_of_maps_to hF f).symm _ = ∑ i ∈ range N, ∑ p ∈ primeBand (exp (reciprocalGrid b q N i*L)) (exp (reciprocalGrid b q N (i+1)*L)), ∑ v ∈ F.filter (fun v => v.1 = p), f v := hadj.symm _ = _ := by apply sum_congr rfl intro i hi exact sum_fiberwise_eq_sum_filter F _ Prod.fst f theorem sum_pairs_eq_sum_prime_grid_bins {M : Type*} [AddCommMonoid M] {b q L : ℝ} (hbq : b ≤ q) (hL : 0 ≤ L) {N : ℕ} (hN : 0 < N) (F : Finset (ℕ × ℕ)) (f : ℕ × ℕ → M) (hF : ∀ v ∈ F, v.1 ∈ primeBand (exp (b*L)) (exp (q*L))) : (∑ v ∈ F, f v) = ∑ i : Fin N, ∑ v ∈ primeGridPairBin b q N L F i, f v := by exact (sum_pairs_eq_sum_prime_grid_bins_range hbq hL hN F f hF).trans (Finset.sum_range (fun i : ℕ => ∑ v ∈ primeGridPairBin b q N L F i, f v)) end Bounty end section /- Exact shifted-value Buchstab decomposition into ordered least-prime factor pairs. -/ open Finset namespace Bounty noncomputable def shiftedBuchstabPair (u : ℕ) : ℕ × ℕ := ((2*u+1).minFac, (2*u+1)/(2*u+1).minFac) def shiftedPairIndex (v : ℕ × ℕ) : ℕ := (v.1*v.2-1)/2 noncomputable def shiftedBuchstabPairs (T : Finset ℕ) (z : ℝ) : Finset (ℕ × ℕ) := by classical exact ((shiftedRoughSet T z).filter (fun u => ¬(2*u+1).Prime)).image shiftedBuchstabPair theorem shifted_buchstab_pair_product (u : ℕ) : (shiftedBuchstabPair u).1*(shiftedBuchstabPair u).2=2*u+1 := Nat.mul_div_cancel' (Nat.minFac_dvd (2*u+1)) theorem shifted_buchstab_pair_index (u : ℕ) : shiftedPairIndex (shiftedBuchstabPair u)=u := by unfold shiftedPairIndex rw [shifted_buchstab_pair_product] omega theorem shifted_buchstab_pair_injective : Function.Injective shiftedBuchstabPair := by intro u v huv have := congrArg shiftedPairIndex huv simpa only [shifted_buchstab_pair_index] using this theorem weighted_shifted_buchstab_pair_identity {M : Type*} [AddCommMonoid M] (T : Finset ℕ) (z : ℝ) (μ : ℕ → M) : (∑ u ∈ shiftedRoughSet T z, μ u) = (∑ u ∈ (shiftedRoughSet T z).filter (fun u => (2*u+1).Prime), μ u)+ ∑ v ∈ shiftedBuchstabPairs T z, μ (shiftedPairIndex v) := by classical unfold shiftedBuchstabPairs rw [sum_image (fun u _ v _ huv => shifted_buchstab_pair_injective huv)] simp only [shifted_buchstab_pair_index] exact (sum_filter_add_sum_filter_not (shiftedRoughSet T z) (fun u => (2*u+1).Prime) μ).symm theorem shifted_buchstab_pair_properties (T : Finset ℕ) (z : ℝ) (hT : ∀ u ∈ T, 0 < u) {v : ℕ × ℕ} (hv : v ∈ shiftedBuchstabPairs T z) : v.1.Prime ∧ v.1 ≤ v.2 ∧ shiftedPairIndex v ∈ T ∧ v.1*v.2=2*shiftedPairIndex v+1 ∧ z < (v.1 : ℝ) ∧ ∀ p ∈ v.2.primeFactors, v.1 ≤ p := by classical obtain ⟨u, hu, rfl⟩ := mem_image.mp hv obtain ⟨huR, huNP⟩ := mem_filter.mp hu obtain ⟨huT, huRough⟩ := (mem_shifted_rough_set_iff T z u).mp huR have hu0 := hT u huT have hn0 : 0 < 2*u+1 := by omega have hn1 : 2*u+1 ≠ 1 := by omega have hp := Nat.minFac_prime hn1 rw [shifted_buchstab_pair_index] refine ⟨hp, Nat.minFac_le_div hn0 huNP, huT, shifted_buchstab_pair_product u, ?_, ?_⟩ · exact huRough _ (Nat.mem_primeFactors.mpr ⟨hp,Nat.minFac_dvd _,hn0.ne'⟩) · exact buchstab_cofactor_prime_factors (2*u+1) end Bounty end section /- Exact physical lift with the endpoint damping combined with the edge damping. -/ open scoped BigOperators InnerProductSpace namespace Bounty theorem physical_damping_square_vertex {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (x : PhysicalState P J ell) {q : ℝ} (hq : 0 ≤ q) : physicalDamping P J ell q x.1 ^ 2 = physicalVertexWeight x.2.val q x.1 := by rw [physicalVertexWeight, if_pos x.2.property, physical_damping_square P J ell hq] theorem physical_damped_edge_pairing {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (x y : PhysicalState P J ell) (f g : ℤ → ℂ) : (starRingEnd ℂ) (f x.1 * (physicalDamping P J ell q x.1 : ℂ)) * physicalEdgeCoeff V C q ζ k K aux x y * (g y.1 * (physicalDamping P J ell q y.1 : ℂ)) = if y.1 = x.1 + k * (physicalD C x.2.val aux : ℕ) then (starRingEnd ℂ) (f x.1) * physicalBarePatternScalar V C ζ K aux x.2.val y.2.val * g y.1 * ((physicalVertexWeight x.2.val q x.1 * physicalVertexWeight y.2.val q y.1 : ℝ) : ℂ) else 0 := by classical rw [physical_edge_scalar_factor] split_ifs · rw [map_mul, Complex.conj_ofReal, ← physical_damping_square_vertex x hq, ← physical_damping_square_vertex y hq] push_cast ring · simp only [mul_zero, zero_mul] theorem physical_endpoint_pairing_eq_bare {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (f g : ℤ → ℂ) : inner ℂ (physicalEndpointVector P V J ell q positions f) (physicalHilbertOperator V patterns C q ζ k K positions (physicalEndpointVector P V J ell q positions g)) = (physicalStateMass V J ell : ℂ) * ∑ x ∈ physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, ∑ i ∈ patterns, ∑ aux : PhysicalAuxLabels P (C i), if y.1 = x.1 + k i * (physicalD (C i) x.2.val aux : ℕ) then (starRingEnd ℂ) (f x.1) * physicalBarePatternScalar V (C i) (ζ i) (K i) aux x.2.val y.2.val * g y.1 * ((physicalVertexWeight x.2.val q x.1 * physicalVertexWeight y.2.val q y.1 : ℝ) : ℂ) else 0 := by classical rw [physicalEndpointVector, physicalEndpointVector, physicalHilbertOperator, physical_position_kernel_pairing P V hV J ell positions] congr 1 apply Finset.sum_congr rfl intro x _ apply Finset.sum_congr rfl intro y _ simp only [physicalPatternKernel, Finset.mul_sum, Finset.sum_mul] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro aux _ exact physical_damped_edge_pairing V (C i) hq (ζ i) (k i) (K i) aux x y f g end Bounty end section /- A concrete endpoint pairing is controlled by the original alternating root moment. -/ open scoped BigOperators InnerProductSpace namespace Bounty end Bounty end section /- Per-list divisor estimates give endpoint energy without a loss growing with the mark count. -/ open scoped BigOperators namespace Bounty theorem physical_endpoint_energy_of_list_bounds {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (J ell : ℕ) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (positions : Finset ℤ) (f : ℤ → ℂ) {A : ℝ} (hA : 0 ≤ A) (hlist : ∀ L : PhysicalMarkLists P J ell, (∑ n ∈ positions, if ∀ g s, ((L g s).val : ℤ) ∣ n then ‖f n‖ ^ 2 else 0) ≤ A * ∏ g, ∏ s, 1 / ((L g s).val : ℝ)) : ‖physicalEndpointVector P V J ell q positions f‖ ^ 2 ≤ A := by classical have hm := (physical_state_mass_pos V hV J ell).le rw [physicalEndpointVector, finite_position_vector_norm_sq _ hm] calc _ ≤ physicalStateMass V J ell * ∑ x : physicalCutoff P J ell positions, ‖f x.val.1‖ ^ 2 := by apply mul_le_mul_of_nonneg_left _ hm apply Finset.sum_le_sum intro x _ have hd := physical_damping_unit P J ell hq0 hq1 x.val.1 rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hd.1, mul_pow] have hsq : physicalDamping P J ell q x.val.1 ^ 2 ≤ 1 := by nlinarith [hd.1, hd.2] simpa using mul_le_mul_of_nonneg_left hsq (sq_nonneg ‖f x.val.1‖) _ = physicalStateMass V J ell * ∑ n ∈ positions, ∑ L : PhysicalMarksAt P J ell n, ‖f n‖ ^ 2 := by rw [Finset.sum_coe_sort (physicalCutoff P J ell positions) (fun x : PhysicalState P J ell => ‖f x.1‖ ^ 2), physical_cutoff_sum] _ = physicalStateMass V J ell * ∑ L : PhysicalMarkLists P J ell, ∑ n ∈ positions, if ∀ g s, ((L g s).val : ℤ) ∣ n then ‖f n‖ ^ 2 else 0 := by congr 1 rw [Finset.sum_comm] apply Finset.sum_congr rfl intro n _ have h := physical_marks_sum_all P J ell n (fun L => if ∀ g s, ((L g s).val : ℤ) ∣ n then ‖f n‖ ^ 2 else 0) (fun L hL => if_neg hL) calc _ = ∑ L : PhysicalMarksAt P J ell n, if ∀ g s, ((L.val g s).val : ℤ) ∣ n then ‖f n‖ ^ 2 else 0 := by apply Finset.sum_congr rfl intro L _ exact (if_pos L.property).symm _ = _ := h _ ≤ physicalStateMass V J ell * ∑ L : PhysicalMarkLists P J ell, A * ∏ g, ∏ s, 1 / ((L g s).val : ℝ) := by exact mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun L _ => hlist L)) hm _ = A * ∑ L : PhysicalMarkLists P J ell, physicalMarkPriorMass V L := by simp only [physical_mark_prior_factor, Finset.mul_sum] apply Finset.sum_congr rfl intro L _ ring _ ≤ A * 1 := mul_le_mul_of_nonneg_left (physical_mark_prior_total_mass V hV hMass) hA _ = A := mul_one A end Bounty end section /- Positive-natural solutions retain signed determinants and exact parity. -/ namespace Bounty theorem typeII_determinant_unique_nat {m m' n e h h' : ℕ} (ha : m * n = 2 * e * h + 1) (hb : m' * n = 2 * e * h' + 1) (hne : m ≠ m') : ∃! k : ℤ, k ≠ 0 ∧ (m' : ℤ) - m = 2 * e * k ∧ (h' : ℤ) - h = k * n ∧ (m : ℤ) * h' - m' * h = k := by apply typeII_determinant_unique · exact_mod_cast ha · exact_mod_cast hb · exact_mod_cast hne end Bounty end section /- The exact solution fiber equivalence, with all arithmetic conditions retained. -/ namespace Bounty end Bounty end section /- Absolute fourth divisor moments and their transport along injective indices. -/ open Finset namespace Bounty theorem divisor_fourth_moment_Ioc (N : ℕ) : (∑ n ∈ Ioc 0 N, (n.divisors.card : ℝ) ^ 4) ≤ (N : ℝ) * (1 + Real.log N) ^ 15 := by calc _ ≤ ∑ n ∈ Ioc 0 N, ((ArithmeticFunction.zeta ^ 16) n : ℝ) := by apply sum_le_sum intro n _ exact_mod_cast divisor_fourth_power_le_zeta_sixteen n _ ≤ (N : ℝ) * divisorHarmonic N ^ 15 := by simpa only [Nat.reduceAdd] using divisor_zeta_summatory_bound 15 N _ ≤ _ := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (divisor_harmonic_nonneg N) (divisor_harmonic_log_bound N) 15) (Nat.cast_nonneg N) theorem divisor_fourth_moment (N : ℕ) : (∑ n ∈ Icc 1 N, (n.divisors.card : ℝ) ^ 4) ≤ (N : ℝ) * (1 + Real.log N) ^ 15 := by have hs : Icc 1 N = Ioc 0 N := by ext n; simp only [mem_Icc, mem_Ioc]; omega rw [hs] exact divisor_fourth_moment_Ioc N theorem divisor_fourth_moment_Iic (N : ℕ) : (∑ n ∈ Iic N, (n.divisors.card : ℝ) ^ 4) ≤ (N : ℝ) * (1 + Real.log N) ^ 15 := by have hs : Iic N = insert 0 (Ioc 0 N) := by ext n simp only [mem_Iic, mem_insert, mem_Ioc] omega rw [hs, sum_insert (by simp)] simpa using divisor_fourth_moment_Ioc N theorem divisor_fourth_moment_injective {α : Type*} [DecidableEq α] (S : Finset α) (f : α → ℕ) (N : ℕ) (hf : Set.InjOn f S) (hN : ∀ x ∈ S, f x ≤ N) : (∑ x ∈ S, ((f x).divisors.card : ℝ) ^ 4) ≤ (N : ℝ) * (1 + Real.log N) ^ 15 := by classical have hs : S.image f ⊆ Iic N := by intro n hn obtain ⟨x, hx, rfl⟩ := mem_image.mp hn exact mem_Iic.mpr (hN x hx) calc _ = ∑ n ∈ S.image f, (n.divisors.card : ℝ) ^ 4 := by rw [sum_image] intro x hx y hy hxy exact hf hx hy hxy _ ≤ ∑ n ∈ Iic N, (n.divisors.card : ℝ) ^ 4 := sum_le_sum_of_subset_of_nonneg hs (fun n _ _ => by positivity) _ ≤ _ := divisor_fourth_moment_Iic N end Bounty end section /- Passing uniform local interval estimates to arbitrary positive intervals. -/ open Finset namespace Bounty theorem dyadicNatBucket_Ioc_eq (m n k : ℕ) : dyadicNatBucket (Ioc m n) k = Ioc (max m (2 ^ k - 1)) (min n (2 ^ (k + 1) - 1)) := by ext i rw [mem_dyadicNatBucket] simp only [mem_Ioc, max_lt_iff, le_min_iff] have hpow : 0 < (2 : ℕ) ^ k := by positivity constructor · rintro ⟨⟨hmi, hin⟩, hik⟩ have hi : i ≠ 0 := by omega obtain ⟨hlo, hhi⟩ := (Nat.log2_eq_iff hi).mp hik omega · rintro ⟨⟨hmi, hlo⟩, hin, hhi⟩ refine ⟨⟨hmi, hin⟩, (Nat.log2_eq_iff (by omega : i ≠ 0)).mpr ?_⟩ omega theorem norm_Ioc_sum_le_dyadic_card (g : ℕ → ℂ) (m n : ℕ) {A U E : ℝ} (hA : 0 < A) (hE : 0 ≤ E) (hm : A ≤ ((m + 1 : ℕ) : ℝ)) (hn : (n : ℝ) ≤ U) (hlocal : ∀ Y : ℝ, A / 2 ≤ Y → Y ≤ U → ∀ lo hi : ℕ, lo ≤ hi → Y ≤ ((lo + 1 : ℕ) : ℝ) → (hi : ℝ) ≤ 2 * Y → ‖∑ i ∈ Ioc lo hi, g i‖ ≤ E) : ‖∑ i ∈ Ioc m n, g i‖ ≤ ((dyadicNatIndices (Ioc m n)).card : ℝ) * E := by have hbucket : ∀ k ∈ dyadicNatIndices (Ioc m n), ‖∑ i ∈ dyadicNatBucket (Ioc m n) k, g i‖ ≤ E := by intro k hk obtain ⟨i, hi, hik⟩ := mem_image.mp hk have hmi : m < i := (mem_Ioc.mp hi).1 have hin : i ≤ n := (mem_Ioc.mp hi).2 obtain ⟨hlo, hhi⟩ := (Nat.log2_eq_iff (by omega : i ≠ 0)).mp hik have hpow : 0 < (2 : ℕ) ^ k := by positivity have hpow' : 0 < (2 : ℕ) ^ (k + 1) := by positivity have hloR : (2 : ℝ) ^ k ≤ (i : ℝ) := by exact_mod_cast hlo have hhiR : (i : ℝ) < (2 : ℝ) ^ (k + 1) := by exact_mod_cast hhi have hmiR : ((m + 1 : ℕ) : ℝ) ≤ (i : ℝ) := by exact_mod_cast hmi have hinR : (i : ℝ) ≤ (n : ℝ) := by exact_mod_cast hin have hYA : A / 2 ≤ (2 : ℝ) ^ k := by rw [pow_succ] at hhiR linarith have hYU : (2 : ℝ) ^ k ≤ U := hloR.trans (hinR.trans hn) have hends : max m (2 ^ k - 1) ≤ min n (2 ^ (k + 1) - 1) := by omega have hleft : (2 : ℝ) ^ k ≤ ((max m (2 ^ k - 1) + 1 : ℕ) : ℝ) := by exact_mod_cast (show (2 : ℕ) ^ k ≤ max m (2 ^ k - 1) + 1 by omega) have hright : ((min n (2 ^ (k + 1) - 1) : ℕ) : ℝ) ≤ 2 * (2 : ℝ) ^ k := by have hnat : min n (2 ^ (k + 1) - 1) ≤ (2 : ℕ) ^ (k + 1) := by omega have hreal : ((min n (2 ^ (k + 1) - 1) : ℕ) : ℝ) ≤ (2 : ℝ) ^ (k + 1) := by exact_mod_cast hnat simpa only [pow_succ, mul_comm] using hreal rw [dyadicNatBucket_Ioc_eq] exact hlocal ((2 : ℝ) ^ k) hYA hYU _ _ hends hleft hright calc ‖∑ i ∈ Ioc m n, g i‖ = ‖∑ k ∈ dyadicNatIndices (Ioc m n), ∑ i ∈ dyadicNatBucket (Ioc m n) k, g i‖ := by rw [sum_dyadicNatBuckets] _ ≤ ∑ k ∈ dyadicNatIndices (Ioc m n), ‖∑ i ∈ dyadicNatBucket (Ioc m n) k, g i‖ := norm_sum_le _ _ _ ≤ ∑ _k ∈ dyadicNatIndices (Ioc m n), E := sum_le_sum hbucket _ = _ := by simp theorem dyadicNatIndices_Ioc_card_le_exp_window {L : ℝ} (hL : 0 ≤ L) (m n : ℕ) (hn : (n : ℝ) ≤ Real.exp (2 * L)) : ((dyadicNatIndices (Ioc m n)).card : ℝ) ≤ 2 * L / Real.log 2 + 2 := by have h := dyadic_indices_card_window (Ioc m n) (a := 0) (b := 2 * L) (by linarith) (by intro i hi obtain ⟨hmi, hin⟩ := mem_Ioc.mp hi have hi0 : 0 < i := by omega refine ⟨hi0, ?_, ?_⟩ · simpa only [Real.exp_zero] using (show (1 : ℝ) ≤ (i : ℝ) by exact_mod_cast hi0) · exact (Nat.cast_le.mpr hin).trans hn) simpa only [sub_zero] using h end Bounty end section /- A suffix-sum criterion for the deterministic allocation invariant. -/ open Finset Real namespace Bounty noncomputable def smoothAllocationFuture (n : ℕ) (v : Fin n → ℝ) (active : Fin n → Bool) (i : Fin n) : ℝ := ∑ j, if i < j ∧ active j = true then v j else 0 theorem smooth_allocation_future_zero (n : ℕ) (v : Fin (n+1) → ℝ) (active : Fin (n+1) → Bool) : smoothAllocationFuture (n+1) v active 0 = smoothAllocationInventory n (Fin.tail v) (Fin.tail active) := by rw [Fin.tail_def, Fin.tail_def] unfold smoothAllocationFuture smoothAllocationInventory rw [Fin.sum_univ_succ] simp only [lt_self_iff_false, false_and, if_false, Fin.succ_pos, true_and, zero_add] theorem smooth_allocation_future_succ (n : ℕ) (v : Fin (n+1) → ℝ) (active : Fin (n+1) → Bool) (i : Fin n) : smoothAllocationFuture (n+1) v active i.succ = smoothAllocationFuture n (Fin.tail v) (Fin.tail active) i := by rw [Fin.tail_def, Fin.tail_def] unfold smoothAllocationFuture rw [Fin.sum_univ_succ] simp only [Fin.not_lt_zero, false_and, if_false, Fin.succ_lt_succ_iff, zero_add] theorem smooth_allocation_room_of_future_bound (n : ℕ) (v s : Fin n → ℝ) (active : Fin n → Bool) (A : ℝ) (h : ∀ i, active i = true → v i+s i ≤ smoothAllocationFuture n v active i+A) : SmoothAllocationRoom n v s active A := by induction n with | zero => trivial | succ n ih => constructor · intro ha simpa only [smooth_allocation_future_zero] using h 0 ha · apply ih (Fin.tail v) (Fin.tail s) (Fin.tail active) intro i ha have hh := h i.succ ha rw [smooth_allocation_future_succ] at hh simpa only [Fin.tail_def] using hh end Bounty end section /- The actual allocation processes lower-indexed bands first. -/ open Finset Real namespace Bounty theorem candidate_allocation_band_strict {c L : ℝ} {r : ℕ} {i j : Fin ((candidateQIndices c L).card*r)} (h : (candidateAllocationOrder c L r i).1.val < (candidateAllocationOrder c L r j).1.val) : i < j := by have hh : i.divNat < j.divNat := by apply ((candidateQIndices c L).orderIsoOfFin rfl).lt_iff_lt.mp exact h change i.val / r < j.val / r at hh change i.val < j.val by_contra hn exact (not_lt_of_ge (Nat.div_le_div_right (Nat.le_of_not_gt hn))) hh theorem candidate_last_band_scale_lt {c L : ℝ} (hc : 0 < c) (hL : 0 < L) (hlog : 0 < log L) : c*L/2^⌊log (c*L/(20*log L))/log 2⌋₊ < 40*log L := by let J := ⌊log (c*L/(20*log L))/log 2⌋₊ have hd : 0 < (20*log L) := by positivity have hz : 0 < c*L/(20*log L) := by positivity have hl2 : 0 < log (2 : ℝ) := by positivity have hf : log (c*L/(20*log L))/log 2 < (J : ℝ)+1 := Nat.lt_floor_add_one _ have hp : c*L/(20*log L) < (2 : ℝ)^(J+1) := by apply (log_lt_log_iff hz (by positivity)).mp rw [log_pow] norm_cast have hh := (div_lt_iff₀ hl2).mp hf simpa only [Nat.cast_add, Nat.cast_one] using hh have hm := (div_lt_iff₀ hd).mp hp rw [pow_succ] at hm apply (div_lt_iff₀ (by positivity : (0 : ℝ) < 2^J)).mpr nlinarith end Bounty end section /- The initial allocatable inventory is the full product after removing exactly the group and rough factors. -/ open Finset Real namespace Bounty theorem candidate_allocation_active_iff (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (i : Fin ((candidateQIndices c L).card*r)) : candidateAllocationActive c L r jStar i = true ↔ candidateAllocationOrder c L r i ≠ candidateRoughSlot c L r jStar hr hj := by have he : ((candidateAllocationOrder c L r i).1.val = jStar ∧ (candidateAllocationOrder c L r i).2.val = 0) ↔ candidateAllocationOrder c L r i = candidateRoughSlot c L r jStar hr hj := by constructor · intro h exact Prod.ext (Subtype.ext h.1) (Fin.ext h.2) · intro h rw [h] exact ⟨rfl,rfl⟩ simp only [candidateAllocationActive, he, decide_eq_true_eq] theorem candidate_initially_retained_factor (c L : ℝ) (r jStar P : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) : candidateRetainedFactor c L r jStar P x (candidateAllocationActive c L r jStar) = P*(x (candidateRoughSlot c L r jStar hr hj)).val := by classical let i := (candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj) have he : candidateAllocationOrder c L r i = candidateRoughSlot c L r jStar hr hj := Equiv.apply_symm_apply _ _ have ha : candidateAllocationActive c L r jStar i = false := by simp only [candidateAllocationActive, he, candidateRoughSlot, and_self, not_true_eq_false, decide_false] unfold candidateRetainedFactor congr 1 rw [prod_eq_single i] · rw [ha] simp only [Bool.false_eq_true, if_false, candidateAllocationValue] exact congrArg (fun slot => (x slot).val) he · intro j hj' hji have hjact : candidateAllocationActive c L r jStar j = true := by apply (candidate_allocation_active_iff c L r jStar hr hj j).mpr intro hh have heq : j = i := (candidateAllocationOrder c L r).injective (hh.trans he.symm) exact hji heq rw [hjact] rfl · intro hn exact (hn (mem_univ i)).elim theorem candidate_allocation_inventory_exp (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) : exp (smoothAllocationInventory _ (fun i => log (candidateAllocationValue c L r jStar x i)) (candidateAllocationActive c L r jStar)) = (candidateAllocatedFactor c L r jStar x (candidateAllocationActive c L r jStar) : ℝ) := allocation_natural_product_exp_log _ (candidate_allocation_value_pos c L r jStar x) _ theorem candidate_allocation_inventory_of_product_bounds (c L : ℝ) (r jStar P : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (B H : ℝ) (htotal : exp B ≤ (P*orderedSlotProduct (candidateQSlotChoices c L r jStar) x : ℕ)) (hretained : (P*(x (candidateRoughSlot c L r jStar hr hj)).val : ℕ) ≤ exp H) : B-H ≤ smoothAllocationInventory _ (fun i => log (candidateAllocationValue c L r jStar x i)) (candidateAllocationActive c L r jStar) := by have hfac := candidate_allocation_factorization c L r jStar P x (candidateAllocationActive c L r jStar) rw [candidate_initially_retained_factor c L r jStar P hr hj x] at hfac have hreal := congrArg (fun n : ℕ => (n : ℝ)) hfac push_cast at hreal rw [← candidate_allocation_inventory_exp] at hreal have hh : exp B ≤ exp (smoothAllocationInventory _ (fun i => log (candidateAllocationValue c L r jStar x i)) (candidateAllocationActive c L r jStar)+H) := by rw [exp_add] have ht : exp B ≤ exp (smoothAllocationInventory _ (fun i => log (candidateAllocationValue c L r jStar x i)) (candidateAllocationActive c L r jStar)) * (P*(x (candidateRoughSlot c L r jStar hr hj)).val : ℕ) := by simpa only [Nat.cast_mul, hreal] using htotal exact ht.trans (mul_le_mul_of_nonneg_left hretained (exp_pos _).le) have he := exp_le_exp.mp hh linarith end Bounty end section /- A finite displacement kernel pairs each source block with only its three neighboring blocks. -/ open scoped BigOperators InnerProductSpace namespace Bounty theorem position_block_kernel_localization {X : Type*} [Fintype X] (position : X → ℤ) {mass : ℝ} (hmass : 0 ≤ mass) (K : X → X → ℂ) {H : ℤ} (hH : 0 < H) (j : ℤ) (f g : ℤ → ℂ) (hK : ∀ x y, H < |position x - position y| → K x y = 0) : inner ℂ (finitePositionVector position mass (integerBlockMask id H j f)) (finiteKernelOperator K (finitePositionVector position mass g)) = inner ℂ (finitePositionVector position mass (integerBlockMask id H j f)) (finiteKernelOperator K (finitePositionVector position mass (integerBlockNearMask id H j g))) := by classical rw [finite_position_vector_kernel_pairing position hmass, finite_position_vector_kernel_pairing position hmass] congr 1 have h := integerBlock_kernel_localization Finset.univ position hH j K (fun x => f (position x)) (fun x => g (position x)) (fun x _ y _ => hK x y) simpa only [starRingEnd_apply, Finset.mul_sum, mul_assoc, integerBlockMask, integerBlockNearMask, id_eq] using h theorem position_block_kernel_pairing {X : Type*} [Fintype X] (position : X → ℤ) {mass : ℝ} (hmass : 0 ≤ mass) (K : X → X → ℂ) (S : Finset ℤ) {H : ℤ} (hH : 0 < H) (f g : ℤ → ℂ) (hf : ∀ x, position x ∉ S → f (position x) = 0) (hK : ∀ x y, H < |position x - position y| → K x y = 0) : inner ℂ (finitePositionVector position mass f) (finiteKernelOperator K (finitePositionVector position mass g)) = ∑ j ∈ S.image (fun n => n / H), inner ℂ (finitePositionVector position mass (integerBlockMask id H j f)) (finiteKernelOperator K (finitePositionVector position mass (integerBlockNearMask id H j g))) := by rw [← position_block_vector_sum position mass S H f hf, sum_inner] apply Finset.sum_congr rfl intro j _ exact position_block_kernel_localization position hmass K hH j f g hK end Bounty end section /- Localized fibers recover a source block and partition its full Gram trace exactly. -/ open scoped BigOperators InnerProductSpace namespace Bounty noncomputable def positionBlockFiber {X : Type*} (position : X → ℤ) (mass : ℝ) (H j n : ℤ) : EuclideanSpace ℂ X := if n / H = j then finiteFiberVector position mass n else 0 theorem position_block_coefficients_bound (S : Finset ℤ) {H : ℤ} (hH : 0 < H) (j : ℤ) (f : ℤ → ℂ) {M : ℝ} (hM : 0 ≤ M) (hf : ∀ n ∈ S, ‖f n‖ ≤ M) : (∑ n : S, ‖integerBlockMask id H j f n.val‖ ^ 2) ≤ (H.toNat : ℝ) * M ^ 2 := by classical rw [Finset.sum_coe_sort S (fun n : ℤ => ‖integerBlockMask id H j f n‖ ^ 2)] have h := integerBlock_sq_norm_le_card_mul S hH j f hM hf have ht (n : ℤ) : ‖integerBlockMask id H j f n‖ ^ 2 = if n / H = j then ‖f n‖ ^ 2 else 0 := by by_cases hn : n / H = j <;> simp [integerBlockMask, hn] simpa only [ht, Finset.sum_filter] using h theorem position_block_fiber_sum {X : Type*} [Fintype X] (position : X → ℤ) (mass : ℝ) (S : Finset ℤ) (H j : ℤ) (f : ℤ → ℂ) (hf : ∀ x, position x ∉ S → f (position x) = 0) : finitePositionVector position mass (integerBlockMask id H j f) = ∑ n : S, integerBlockMask id H j f n.val • positionBlockFiber position mass H j n.val := by classical rw [finite_position_vector_fiber_sum position mass (integerBlockMask id H j f) S (by intro x hx; simp [integerBlockMask, hf x hx]), Finset.sum_coe_sort S (fun n : ℤ => integerBlockMask id H j f n • positionBlockFiber position mass H j n)] apply Finset.sum_congr rfl intro n _ by_cases hn : n / H = j <;> simp [positionBlockFiber, integerBlockMask, hn] theorem position_block_fiber_trace {X : Type*} [Fintype X] (position : X → ℤ) (mass : ℝ) (S : Finset ℤ) (H : ℤ) (T : EuclideanSpace ℂ X →ₗ[ℂ] EuclideanSpace ℂ X) : (∑ j : S.image (fun n => n / H), ∑ n : S, (inner ℂ (positionBlockFiber position mass H j.val n.val) (T (positionBlockFiber position mass H j.val n.val))).re) = ∑ n ∈ S, (inner ℂ (finiteFiberVector position mass n) (T (finiteFiberVector position mass n))).re := by classical have ht (j n : ℤ) : (inner ℂ (positionBlockFiber position mass H j n) (T (positionBlockFiber position mass H j n))).re = if n / H = j then (inner ℂ (finiteFiberVector position mass n) (T (finiteFiberVector position mass n))).re else 0 := by by_cases hn : n / H = j <;> simp [positionBlockFiber, hn] simp_rw [ht] rw [Finset.sum_comm, Finset.sum_coe_sort S (fun n : ℤ => ∑ j : S.image (fun n => n / H), if n / H = j.val then (inner ℂ (finiteFiberVector position mass n) (T (finiteFiberVector position mass n))).re else 0)] apply Finset.sum_congr rfl intro n hn rw [Finset.sum_coe_sort (S.image (fun n => n / H)) (fun j : ℤ => if n / H = j then (inner ℂ (finiteFiberVector position mass n) (T (finiteFiberVector position mass n))).re else 0), Finset.sum_eq_single (n / H)] · simp · intro j _ hj simp [Ne.symm hj] · intro h exact (h (Finset.mem_image_of_mem (fun n => n / H) hn)).elim end Bounty end section /- A single explicit cutoff controls the high-rank tail and loses only a small fraction of edges. -/ open Filter namespace Bounty theorem eventually_forest_rank_split_parameters {a c ε C E : ℝ} (ha : 0 < a) (hc : 0 < c) (hε : 0 < ε) (hC : 0 ≤ C) (hE : 0 ≤ E) : ∀ᶠ L : ℝ in atTop, ∀ N : ℕ, L ^ a ≤ (N : ℝ) → ∀ b A z : ℝ, L ^ c ≤ b → A ≤ L ^ (C * ((N : ℝ) + 1)) → 0 ≤ z → z ≤ Real.exp (-b) → let r := Nat.ceil (((2 * C + E + 1) * N * Real.log L) / b) A * z ^ r / (1 - z) ≤ L ^ (-(E * N)) ∧ (r : ℝ) / N ≤ ε := by have hK : 0 ≤ 2 * C + E + 1 := by positivity filter_upwards [eventually_ge_atTop (2 : ℝ), (tendsto_rpow_atTop hc).eventually_ge_atTop (Real.log 2), eventually_forest_rank_cutoff_small ha hc hε hK] with L hL hb hsmall intro N hN b A z hbc hA hz hzb have hL0 : 0 < L := lt_of_lt_of_le (by norm_num) hL have hNpos : (0 : ℝ) < N := (Real.rpow_pos_of_pos hL0 a).trans_le hN have hN1 : 1 ≤ N := by have hp : 0 < N := by exact_mod_cast hNpos omega exact ⟨forest_rank_cutoff_tail N hL hC (hb.trans hbc) hN1 hA hz hzb, hsmall N hN b hbc⟩ end Bounty end section /- Exact shared/free dilation factors and removal of supported endpoint factors. -/ open Finset namespace Bounty abbrev PhysicalSharedIndex {G : Type*} {J : ℕ} (C : G → Finset (Fin J)) := Σ g, ↥(univ \ C g) noncomputable def physicalSharedFactor {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) : ℕ := ∏ a : PhysicalSharedIndex C, (L a.1 (Sum.inl a.2.val)).val noncomputable def physicalFreeFactor {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) : ℕ := ∏ g, ∏ j : C g, (aux g j).val section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) include G sharedInstance1 P J ell C L theorem physical_D_shared_free (aux : PhysicalAuxLabels P C) : physicalD C L aux = physicalSharedFactor C L * physicalFreeFactor C aux := by classical simp only [physicalD, physicalGroupD, prod_mul_distrib, physicalSharedFactor, physicalFreeFactor, Fintype.prod_sigma] congr 1 apply prod_congr rfl intro g _ exact (prod_coe_sort (univ \ C g) (fun j => (L g (Sum.inl j)).val)).symm theorem physical_shared_factor_pos (hprime : ∀ g p, p ∈ P g → p.Prime) : 0 < physicalSharedFactor C L := by classical exact prod_pos (fun a _ => (hprime a.1 _ (L a.1 (Sum.inl a.2.val)).property).pos) theorem physical_shared_factor_dvd (n : ℤ) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (hmarks : ∀ g s, ((L g s).val : ℤ) ∣ n) : (physicalSharedFactor C L : ℤ) ∣ n := by classical unfold physicalSharedFactor rw [Nat.cast_prod] apply prod_dvd_of_coprime _ (fun a _ => hmarks a.1 (Sum.inl a.2.val)) intro a _ b _ hab change IsCoprime (((L a.1 (Sum.inl a.2.val)).val : ℕ) : ℤ) (((L b.1 (Sum.inl b.2.val)).val : ℕ) : ℤ) apply (physical_prime_pool_coprime hdis hprime (i := ⟨a.1, L a.1 (Sum.inl a.2.val)⟩) (j := ⟨b.1, L b.1 (Sum.inl b.2.val)⟩) ?_).isCoprime intro he have hg : a.1 = b.1 := congrArg (fun p : PhysicalPrime P => p.1) he rcases a with ⟨g, a⟩ rcases b with ⟨h, b⟩ dsimp only at hg subst h have hp := eq_of_heq (Sigma.mk.inj_iff.mp he).2 have hj : a.val = b.val := Sum.inl.inj ((L g).injective hp) exact hab (by congr; exact Subtype.ext hj) end theorem physical_shared_factor_supported {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (hprime : ∀ g p, p ∈ P g → p.Prime) : physicalSharedFactor C L ∈ Nat.factoredNumbers (univ.biUnion P) := by classical have hp : ∀ a : PhysicalSharedIndex C, (L a.1 (Sum.inl a.2.val)).val ∈ Nat.factoredNumbers (univ.biUnion P) := by intro a apply Nat.mem_factoredNumbers_of_primeFactors_subset (hprime a.1 _ (L a.1 (Sum.inl a.2.val)).property).ne_zero rw [(hprime a.1 _ (L a.1 (Sum.inl a.2.val)).property).primeFactors] exact singleton_subset_iff.mpr (mem_biUnion.mpr ⟨a.1, mem_univ _, (L a.1 (Sum.inl a.2.val)).property⟩) unfold physicalSharedFactor induction (univ : Finset (PhysicalSharedIndex C)) using Finset.induction_on with | empty => rw [prod_empty] exact Nat.mem_factoredNumbers_of_primeFactors_subset (by decide) (by simp) | @insert a s ha ih => rw [prod_insert ha] exact Nat.mul_mem_factoredNumbers (hp a) ih end Bounty end section open MeasureTheory Finset namespace Bounty end Bounty end section /- Actual large group-prime-part coefficient mass as a supported/free convolution. -/ open Finset Filter Real namespace Bounty noncomputable def candidateLargePWindowMass (c L q : ℝ) (r jStar : ℕ) (X : ℝ) : ℝ := ∑ u ∈ (arithmeticProductWindow 1 (exp L)).filter (fun u => X < (primePoolPart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u : ℝ)), candidateCoefficient c L q r jStar u theorem candidate_coefficient_real_test_of_free (c L q : ℝ) (r jStar : ℕ) (F : ℕ → ℝ) (hfree : ∀ n, candidateQWeight c L r jStar n ≠ 0 → n ≠ 0 ∧ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) : (∑ u ∈ arithmeticProductWindow 1 (exp L), candidateCoefficient c L q r jStar u*F u) = ∑ p ∈ candidateSmallPSet c L (16*exp L+1), candidatePWeight c L q p * ∑ n ∈ arithmeticProductWindow p (exp L), candidateQWeight c L r jStar n*F (p*n) := by have h := candidate_coefficient_complex_test_of_free c L q r jStar (fun n => (F n : ℂ)) hfree have hh := congrArg Complex.re h simpa using hh theorem candidate_large_P_window_convolution (c L q : ℝ) (r jStar : ℕ) (X : ℝ) (hfree : ∀ n, candidateQWeight c L r jStar n ≠ 0 → n ≠ 0 ∧ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) : candidateLargePWindowMass c L q r jStar X = ∑ p ∈ (candidateSmallPSet c L (16*exp L+1)).filter (fun p : ℕ => X < (p : ℝ)), candidatePWeight c L q p * ∑ n ∈ arithmeticProductWindow p (exp L), candidateQWeight c L r jStar n := by classical have hh := candidate_coefficient_real_test_of_free c L q r jStar (fun u => if X < (primePoolPart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u : ℝ) then 1 else 0) hfree unfold candidateLargePWindowMass rw [sum_filter] simp only [mul_ite, mul_one, mul_zero] at hh rw [hh, sum_filter] apply sum_congr rfl intro p hp have hsupport := ((mem_candidateSmallPSet_iff c L _ p).mp hp).2 have hin : (∑ n ∈ arithmeticProductWindow p (exp L), if X < (primePoolPart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) (p*n) : ℝ) then candidateQWeight c L r jStar n else 0) = ∑ n ∈ arithmeticProductWindow p (exp L), if X < (p : ℝ) then candidateQWeight c L r jStar n else 0 := by apply sum_congr rfl intro n hn by_cases hz : candidateQWeight c L r jStar n = 0 · simp only [hz, ite_self] · rw [primePoolPart_mul_of_free hsupport (hfree n hz).1 (hfree n hz).2] rw [hin] by_cases hX : X < (p : ℝ) <;> simp only [hX, if_true, if_false, sum_const_zero, mul_zero] theorem candidate_large_P_window_le_tail {c L q : ℝ} (hcL : 0 ≤ c*L) (hq : 0 ≤ q) (r jStar : ℕ) (X : ℝ) (hfree : ∀ n, candidateQWeight c L r jStar n ≠ 0 → n ≠ 0 ∧ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) : candidateLargePWindowMass c L q r jStar X ≤ 16*exp L*candidateMarkedSmoothTail c L q 1 X*candidateQHarmonicMass c L r jStar := by classical rw [candidate_large_P_window_convolution c L q r jStar X hfree] let S := (candidateSmallPSet c L (16*exp L+1)).filter (fun p : ℕ => X < (p : ℝ)) have hQ : 0 ≤ candidateQHarmonicMass c L r jStar := tsum_nonneg (fun n => div_nonneg (candidate_Q_weight_nonneg c L r jStar n) (Nat.cast_nonneg n)) calc _ ≤ ∑ p ∈ S, candidatePWeight c L q p * ((16*exp L/(p : ℝ))*candidateQHarmonicMass c L r jStar) := by apply sum_le_sum intro p hp exact mul_le_mul_of_nonneg_left (candidate_Q_window_le_harmonic c L r jStar (candidate_small_P_set_nonzero (mem_filter.mp hp).1)) (candidate_P_weight_nonneg c L hq p) _ = 16*exp L*(∑ p ∈ S, candidatePWeight c L q p/(p : ℝ))* candidateQHarmonicMass c L r jStar := by rw [mul_sum, sum_mul] apply sum_congr rfl intro p hp ring _ ≤ _ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (candidate_finite_P_tail_le hcL hq X S (fun p hp => ((mem_candidateSmallPSet_iff c L _ p).mp (mem_filter.mp hp).1).2) (fun p hp => (mem_filter.mp hp).2.le)) (by positivity)) hQ end Bounty end section /- Fixed allocation patterns separate the actual labelled Q slots, with the full original normalization. -/ open Finset namespace Bounty abbrev CandidateTakenSlot (c L : ℝ) (r : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) := {slot : (candidateQIndices c L) × Fin r // take ((candidateAllocationOrder c L r).symm slot) = true} abbrev CandidateRemainingSlot (c L : ℝ) (r : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) := {slot : (candidateQIndices c L) × Fin r // ¬take ((candidateAllocationOrder c L r).symm slot) = true} noncomputable def candidateTakenComplexCoefficient (c L : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (e : ℕ) : ℂ := orderedSlotComplexWeight (fun slot : CandidateTakenSlot c L r take => candidateQSlotChoices c L r jStar slot.val) (fun slot => twist slot.val) e noncomputable def candidateRemainingComplexCoefficient (c L : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (h : ℕ) : ℂ := orderedSlotComplexWeight (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val) (fun slot => twist slot.val) h / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ) noncomputable def candidateRemainingRoughSlot (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) : CandidateRemainingSlot c L r take := ⟨candidateRoughSlot c L r jStar hr hj, by simp only [hkeep, Bool.false_eq_true, not_false_eq_true]⟩ noncomputable def candidateResidualPrimeCoefficient (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (q : ℕ) : ℂ := orderedSlotComplexWeight (fun slot : {slot : CandidateRemainingSlot c L r take // slot ≠ candidateRemainingRoughSlot c L r jStar hr hj take hkeep} => candidateQSlotChoices c L r jStar slot.val.val) (fun slot => twist slot.val.val) q / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ) theorem candidate_remaining_rough_convolution (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (h : ℕ) : candidateRemainingComplexCoefficient c L r jStar take twist h = ∑ p : candidateRoughBand c L jStar, ∑ q ∈ orderedSlotProductSupport (fun slot : {slot : CandidateRemainingSlot c L r take // slot ≠ candidateRemainingRoughSlot c L r jStar hr hj take hkeep} => candidateQSlotChoices c L r jStar slot.val.val), if p.val*q=h then twist (candidateRoughSlot c L r jStar hr hj) p.val * candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist q else 0 := by unfold candidateRemainingComplexCoefficient rw [ordered_slot_complex_single_convolution _ _ (candidateRemainingRoughSlot c L r jStar hr hj take hkeep)] have hchoice : candidateQSlotChoices c L r jStar (candidateRemainingRoughSlot c L r jStar hr hj take hkeep).val = candidateRoughBand c L jStar := by simp only [candidateRemainingRoughSlot, candidateQSlotChoices, candidateRoughSlot, and_self, if_true] simp only [sum_div, ite_div, zero_div, candidateResidualPrimeCoefficient, mul_div_assoc] rw [hchoice] rfl theorem candidate_allocated_factor_eq_taken_product (c L : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) : candidateAllocatedFactor c L r jStar x take = orderedSlotProduct (fun slot : CandidateTakenSlot c L r take => candidateQSlotChoices c L r jStar slot.val) (fun slot => x slot.val) := by classical unfold candidateAllocatedFactor orderedSlotProduct calc _ = ∏ slot : (candidateQIndices c L) × Fin r, if take ((candidateAllocationOrder c L r).symm slot) = true then (x slot).val else 1 := by apply Fintype.prod_equiv (candidateAllocationOrder c L r) intro i simp only [Equiv.symm_apply_apply, candidateAllocationValue] _ = ∏ slot ∈ univ.filter (fun slot => take ((candidateAllocationOrder c L r).symm slot) = true), (x slot).val := by rw [prod_filter] _ = _ := prod_subtype _ (by simp) (fun slot => (x slot).val) theorem candidate_retained_factor_eq_remaining_product (c L : ℝ) (r jStar P : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) : candidateRetainedFactor c L r jStar P x take = P * orderedSlotProduct (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val) (fun slot => x slot.val) := by classical unfold candidateRetainedFactor orderedSlotProduct congr 1 calc _ = ∏ slot : (candidateQIndices c L) × Fin r, if ¬take ((candidateAllocationOrder c L r).symm slot) = true then (x slot).val else 1 := by apply Fintype.prod_equiv (candidateAllocationOrder c L r) intro i simp only [Equiv.symm_apply_apply, candidateAllocationValue] cases take i <;> rfl _ = ∏ slot ∈ univ.filter (fun slot => ¬take ((candidateAllocationOrder c L r).symm slot) = true), (x slot).val := by rw [prod_filter] _ = _ := prod_subtype _ (by simp) (fun slot => (x slot).val) end Bounty end section /- Each Fourier L1 moment is controlled by finitely many spatial Schwartz seminorms. -/ open Finset MeasureTheory open scoped FourierTransform namespace Bounty end Bounty end section open MeasureTheory Finset open scoped ContDiff FourierTransform namespace Bounty noncomputable def typeIIEMajorant (q t : ℝ) : ℝ := Real.smoothTransition (2 * q * t - 1) * Real.smoothTransition (2 - t) noncomputable def typeIINMajorant (t : ℝ) : ℝ := Real.smoothTransition (2 * t - 1) * Real.smoothTransition (3 - t) noncomputable def typeIIThreeLocalizer (A : ℝ) (t : EuclideanSpace ℝ (Fin 3)) : ℝ := ∏ i, typeIISmoothRho A (t i) noncomputable def typeIIPulledE (a : ℝ) (t : EuclideanSpace ℝ (Fin 3)) : ℝ := a * (Real.exp (t 1) - Real.exp (t 0)) noncomputable def typeIIPulledN (b c : ℝ) (t : EuclideanSpace ℝ (Fin 3)) : ℝ := b * (Real.exp (t 2 - t 0) - Real.exp (t 2 - t 1)) + c * Real.exp (-t 0) noncomputable def typeIIPulledCutoff (A q a b c : ℝ) (t : EuclideanSpace ℝ (Fin 3)) : ℝ := typeIIThreeLocalizer A t * typeIIEMajorant q (typeIIPulledE a t) * typeIINMajorant (typeIIPulledN b c t) theorem typeII_transition_product_bounds (u v : ℝ) : 0 ≤ Real.smoothTransition u * Real.smoothTransition v ∧ Real.smoothTransition u * Real.smoothTransition v ≤ 1 := by constructor · exact mul_nonneg (Real.smoothTransition.nonneg _) (Real.smoothTransition.nonneg _) · exact (mul_le_mul_of_nonneg_right (Real.smoothTransition.le_one _) (Real.smoothTransition.nonneg _)).trans (by simpa using Real.smoothTransition.le_one v) theorem typeII_e_majorant_bounds (q t : ℝ) : 0 ≤ typeIIEMajorant q t ∧ typeIIEMajorant q t ≤ 1 := typeII_transition_product_bounds _ _ theorem typeII_n_majorant_bounds (t : ℝ) : 0 ≤ typeIINMajorant t ∧ typeIINMajorant t ≤ 1 := typeII_transition_product_bounds _ _ theorem typeII_e_majorant_eq_one {q t : ℝ} (hq : 1 ≤ q * t) (ht : t ≤ 1) : typeIIEMajorant q t = 1 := by unfold typeIIEMajorant rw [Real.smoothTransition.one_of_one_le (by linarith), Real.smoothTransition.one_of_one_le (by linarith), mul_one] theorem typeII_n_majorant_eq_one {t : ℝ} (ht : t ∈ Set.Icc 1 2) : typeIINMajorant t = 1 := by unfold typeIINMajorant rw [Real.smoothTransition.one_of_one_le (by linarith [ht.1]), Real.smoothTransition.one_of_one_le (by linarith [ht.2]), mul_one] theorem typeII_e_majorant_eq_zero {q t : ℝ} (ht : 2 * q * t ≤ 1 ∨ 2 ≤ t) : typeIIEMajorant q t = 0 := by rcases ht with ht | ht · simp only [typeIIEMajorant, Real.smoothTransition.zero_of_nonpos (by linarith : 2*q*t-1≤0), zero_mul] · simp only [typeIIEMajorant, Real.smoothTransition.zero_of_nonpos (by linarith : 2-t≤0), mul_zero] theorem typeII_n_majorant_eq_zero {t : ℝ} (ht : 2 * t ≤ 1 ∨ 3 ≤ t) : typeIINMajorant t = 0 := by rcases ht with ht | ht · simp only [typeIINMajorant, Real.smoothTransition.zero_of_nonpos (by linarith : 2*t-1≤0), zero_mul] · simp only [typeIINMajorant, Real.smoothTransition.zero_of_nonpos (by linarith : 3-t≤0), mul_zero] theorem typeII_three_localizer_eq_one {A : ℝ} {t : EuclideanSpace ℝ (Fin 3)} (ht : ∀ i, t i ∈ Set.Icc (-A) A) : typeIIThreeLocalizer A t = 1 := by apply prod_eq_one intro i hi exact typeII_smooth_rho_eq_one (ht i) theorem typeII_three_localizer_hasCompactSupport (A : ℝ) : HasCompactSupport (typeIIThreeLocalizer A) := by let K : Set (Fin 3 → ℝ) := {t | ∀ i, t i ∈ Set.Icc (-A-1) (A+1)} have hK : IsCompact K := isCompact_pi_infinite (fun _ => isCompact_Icc) apply HasCompactSupport.intro ((PiLp.homeomorph 2 (fun _ : Fin 3 => ℝ)).isCompact_preimage.mpr hK) intro t ht have hn : ¬ ∀ i, t i ∈ Set.Icc (-A-1) (A+1) := ht push Not at hn obtain ⟨i, hi⟩ := hn exact prod_eq_zero (mem_univ i) (typeII_smooth_rho_eq_zero hi) theorem typeII_three_localizer_contDiff (A : ℝ) : ContDiff ℝ ∞ (typeIIThreeLocalizer A) := by apply contDiff_prod intro i hi exact (typeII_smooth_rho_contDiff A).comp (PiLp.proj (𝕜 := ℝ) 2 (fun _ : Fin 3 => ℝ) i).contDiff theorem typeII_pulled_cutoff_contDiff (A q a b c : ℝ) : ContDiff ℝ ∞ (typeIIPulledCutoff A q a b c) := by have hp (i : Fin 3) : ContDiff ℝ ∞ (fun t : EuclideanSpace ℝ (Fin 3) => t i) := (PiLp.proj (𝕜 := ℝ) 2 (fun _ : Fin 3 => ℝ) i).contDiff unfold typeIIPulledCutoff typeIIEMajorant typeIINMajorant typeIIPulledE typeIIPulledN apply ContDiff.mul · exact (typeII_three_localizer_contDiff A).mul (by fun_prop) · fun_prop theorem typeII_pulled_cutoff_hasCompactSupport (A q a b c : ℝ) : HasCompactSupport (typeIIPulledCutoff A q a b c) := (typeII_three_localizer_hasCompactSupport A).mul_right.mul_right noncomputable def typeIIPulledSchwartz (A q a b c : ℝ) : SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ := ((typeII_pulled_cutoff_hasCompactSupport A q a b c).comp_left (g := fun x : ℝ => (x : ℂ)) (by simp)).toSchwartzMap (Complex.ofRealCLM.contDiff.comp (typeII_pulled_cutoff_contDiff A q a b c)) noncomputable def typeIIPulledFourier (A q a b c : ℝ) : SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ := 𝓕 (typeIIPulledSchwartz A q a b c) theorem typeII_pulled_fourier_integrable (A q a b c : ℝ) : Integrable (typeIIPulledFourier A q a b c) := (typeIIPulledFourier A q a b c).integrable theorem typeII_pulled_fourier_inversion (A q a b c : ℝ) (t : EuclideanSpace ℝ (Fin 3)) : (typeIIPulledCutoff A q a b c t : ℂ) = ∫ ξ : EuclideanSpace ℝ (Fin 3), Complex.exp (((2 * Real.pi * inner ℝ ξ t : ℝ) : ℂ) * Complex.I) * typeIIPulledFourier A q a b c ξ := by have hi := congrArg (fun f : SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ => f t) (FourierPair.fourierInv_fourier_eq (E := SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ) (F := SchwartzMap (EuclideanSpace ℝ (Fin 3)) ℂ) (typeIIPulledSchwartz A q a b c)) rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq'] at hi change (∫ ξ : EuclideanSpace ℝ (Fin 3), Complex.exp (((2 * Real.pi * inner ℝ ξ t : ℝ) : ℂ) * Complex.I) • typeIIPulledFourier A q a b c ξ) = (typeIIPulledCutoff A q a b c t : ℂ) at hi simpa only [smul_eq_mul] using hi.symm end Bounty end section open Filter open scoped ContDiff Topology namespace Bounty theorem smoothTransition_fderiv_hasCompactSupport : HasCompactSupport (fderiv ℝ Real.smoothTransition) := by apply HasCompactSupport.intro (isCompact_Icc : IsCompact (Set.Icc (0 : ℝ) 1)) intro x hx by_cases hlo : x < 0 · have heq : Real.smoothTransition =ᶠ[𝓝 x] (fun _ => (0 : ℝ)) := by filter_upwards [eventually_lt_nhds hlo] with y hy exact Real.smoothTransition.zero_of_nonpos hy.le rw [heq.fderiv_eq] simp · have hhi : 1 < x := lt_of_not_ge (fun h => hx ⟨le_of_not_gt hlo, h⟩) have heq : Real.smoothTransition =ᶠ[𝓝 x] (fun _ => (1 : ℝ)) := by filter_upwards [eventually_gt_nhds hhi] with y hy exact Real.smoothTransition.one_of_one_le hy.le rw [heq.fderiv_eq] simp theorem smoothTransition_hasTemperateGrowth : Function.HasTemperateGrowth Real.smoothTransition := by have hcd : ContDiff ℝ ∞ Real.smoothTransition := Real.smoothTransition.contDiff apply Function.HasTemperateGrowth.of_fderiv (smoothTransition_fderiv_hasCompactSupport.hasTemperateGrowth ?_) (hcd.differentiable (by simp)) (k := 0) (C := 1) · intro x simpa only [pow_zero, mul_one, Real.norm_eq_abs, abs_of_nonneg (Real.smoothTransition.nonneg x)] using Real.smoothTransition.le_one x · exact hcd.fderiv_right (by simp) end Bounty end section /- Exact finite cross-pair coefficient factorization, before removing any support mask. -/ open Finset open scoped ComplexConjugate namespace Bounty noncomputable def typeIISeparatedH (W : ℕ → ℝ) (H : ℕ → ℂ) (ρ : ℝ) (h : ℕ) : ℂ := typeIIPhase ρ h * (W h : ℂ) * H h noncomputable def typeIIDirectEndpoint (M H : Finset ℕ) (A B : ℕ → ℂ) (t : ℝ) (v : ℕ) : ℂ := ∑ m ∈ M, ∑ h ∈ H, if m*h=v then A m * typeIIPhase t m * conj (B h) else 0 noncomputable def typeIICrossPairCoefficient (M H : Finset ℕ) (A : ℕ → ℂ) (W : ℕ → ℝ) (B : ℕ → ℂ) (ρ ξ₁ ξ₂ ξ₃ : ℝ) (z w : ℕ) : ℂ := ∑ m ∈ M, ∑ h' ∈ H, ∑ m' ∈ M, ∑ h ∈ H, if m'*h=z ∧ m*h'=w then A m * conj (A m') * typeIISeparatedH W B ρ h * conj (typeIISeparatedH W B ρ h') * typeIIPhase ξ₁ m * typeIIPhase ξ₂ m' * typeIIPhase ξ₃ z else 0 theorem typeII_cross_pair_coefficient_factorization (M H : Finset ℕ) (A : ℕ → ℂ) (W : ℕ → ℝ) (B : ℕ → ℂ) (ρ ξ₁ ξ₂ ξ₃ : ℝ) (z w : ℕ) (hM : ∀ m ∈ M, 0 < m) (hH : ∀ h ∈ H, 0 < h) (hW : ∀ m ∈ M, ∀ h ∈ H, W (m*h)=W h) : typeIICrossPairCoefficient M H A W B ρ ξ₁ ξ₂ ξ₃ z w = typeIIPhase (ρ+ξ₃) z * typeIIPhase (-ρ) w * conj (typeIIDirectEndpoint M H A B (ρ-ξ₂) z) * typeIIDirectEndpoint M H A B (ξ₁+ρ) w * (W z : ℂ) * (W w : ℂ) := by classical have hconj (b : Prop) [Decidable b] (x y : ℂ) : conj (if b then x else y) = if b then conj x else conj y := by split_ifs <;> rfl unfold typeIICrossPairCoefficient typeIIDirectEndpoint typeIISeparatedH simp only [map_sum, hconj, map_mul, map_zero, Complex.conj_ofReal, starRingEnd_self_apply, mul_sum, sum_mul] apply sum_congr rfl intro m hm apply sum_congr rfl intro h' hh' apply sum_congr rfl intro m' hm' apply sum_congr rfl intro h hh by_cases hz : m'*h=z · by_cases hw : m*h'=w · simp only [hz, hw, and_self, if_true] have hWz : W h=W z := by rw [← hz, hW m' hm' h hh] have hWw : W h'=W w := by rw [← hw, hW m hm h' hh'] rw [hWz, hWw] have hp := typeIIPhase_endpoint_factorization_of_eq ξ₁ ξ₂ ξ₃ ρ (hM m hm) (hM m' hm') (hH h hh) (hH h' hh') hz.symm hw.symm linear_combination (A m * conj (A m') * B h * conj (B h') * (W z : ℂ) * (W w : ℂ)) * hp · simp only [hz, hw, and_false, if_false, if_true, mul_zero, zero_mul] · simp only [hz, false_and, if_false, mul_zero, zero_mul] theorem prime_pool_part_mul_free_left {P : Finset ℕ} {m h : ℕ} (hm : m ≠ 0) (hh : h ≠ 0) (hfree : Disjoint m.primeFactors P) : primePoolPart P (m*h) = primePoolPart P h := by rw [primePoolPart_mul P hm hh, primePoolPart_eq_one_of_disjoint hfree.symm (Nat.mem_factoredNumbers_of_primeFactors_subset hm (subset_refl _)), one_mul] theorem prime_pool_free_part_mul_free_left {P : Finset ℕ} {m h : ℕ} (hm : m ≠ 0) (hh : h ≠ 0) (hfree : Disjoint m.primeFactors P) : primePoolFreePart P (m*h) = m*primePoolFreePart P h := by unfold primePoolFreePart rw [prime_pool_part_mul_free_left hm hh hfree, Nat.mul_div_assoc m (primePoolPart_dvd P h)] theorem prime_factors_disjoint_of_rough {P : Finset ℕ} {m : ℕ} {W : ℝ} (hP : ∀ p ∈ P, (p : ℝ) ≤ W) (hm : ∀ p ∈ m.primeFactors, W < (p : ℝ)) : Disjoint m.primeFactors P := by apply disjoint_left.mpr intro p hp hpP exact (hm p hp).not_ge (hP p hpP) end Bounty end section /- Exact finite collars around the two endpoints of the product window. -/ open Finset namespace Bounty noncomputable def typeIIBoundaryWindow (x δ : ℝ) : Finset ℕ := Icc ⌈(1 - δ) * x⌉₊ ⌊(1 + δ) * x⌋₊ ∪ Icc ⌈(16 - δ) * x⌉₊ ⌊(16 + δ) * x⌋₊ theorem mem_typeII_boundary_window_iff {x δ : ℝ} {u : ℕ} (hx : 0 ≤ x) (hδ0 : 0 ≤ δ) : u ∈ typeIIBoundaryWindow x δ ↔ ((1 - δ) * x ≤ (u : ℝ) ∧ (u : ℝ) ≤ (1 + δ) * x) ∨ ((16 - δ) * x ≤ (u : ℝ) ∧ (u : ℝ) ≤ (16 + δ) * x) := by have hupper1 : 0 ≤ (1 + δ) * x := mul_nonneg (by linarith) hx have hupper16 : 0 ≤ (16 + δ) * x := mul_nonneg (by linarith) hx simp only [typeIIBoundaryWindow, mem_union, mem_Icc, Nat.ceil_le, Nat.le_floor_iff hupper1, Nat.le_floor_iff hupper16] private theorem boundary_interval_card_le {a b : ℝ} (ha : 0 ≤ a) (hab : a ≤ b) : ((Icc ⌈a⌉₊ ⌊b⌋₊).card : ℝ) ≤ b - a + 1 := by apply nat_finset_card_le_real_span _ hab intro n hn obtain ⟨hlo, hhi⟩ := mem_Icc.mp hn exact ⟨(Nat.le_ceil a).trans (Nat.cast_le.mpr hlo), (Nat.cast_le.mpr hhi).trans (Nat.floor_le (ha.trans hab))⟩ theorem typeII_boundary_window_card_le {x δ : ℝ} (hx : 1 ≤ x) (hδ0 : 0 ≤ δ) (hδhalf : δ ≤ 1 / 2) : ((typeIIBoundaryWindow x δ).card : ℝ) ≤ 4 * δ * x + 2 := by have hx0 : 0 ≤ x := zero_le_one.trans hx have hspan1 : (1 - δ) * x ≤ (1 + δ) * x := mul_le_mul_of_nonneg_right (by linarith) hx0 have hspan16 : (16 - δ) * x ≤ (16 + δ) * x := mul_le_mul_of_nonneg_right (by linarith) hx0 have h1 := boundary_interval_card_le (mul_nonneg (by linarith : 0 ≤ 1 - δ) hx0) hspan1 have h16 := boundary_interval_card_le (mul_nonneg (by linarith : 0 ≤ 16 - δ) hx0) hspan16 have hcard := Nat.cast_le (α := ℝ).mpr (card_union_le (Icc ⌈(1 - δ) * x⌉₊ ⌊(1 + δ) * x⌋₊) (Icc ⌈(16 - δ) * x⌉₊ ⌊(16 + δ) * x⌋₊)) rw [Nat.cast_add] at hcard change ((typeIIBoundaryWindow x δ).card : ℝ) ≤ _ at hcard linarith theorem mem_typeII_boundary_window_bounds {x δ : ℝ} {u : ℕ} (hx : 1 ≤ x) (hδ0 : 0 ≤ δ) (hδhalf : δ ≤ 1 / 2) (hu : u ∈ typeIIBoundaryWindow x δ) : 0 < u ∧ (u : ℝ) ≤ 17 * x := by have hx0 : 0 ≤ x := zero_le_one.trans hx have hxpos : 0 < x := zero_lt_one.trans_le hx have hlower1 : 0 < (1 - δ) * x := mul_pos (by linarith) hxpos have hlower16 : 0 < (16 - δ) * x := mul_pos (by linarith) hxpos have hupper1 : (1 + δ) * x ≤ 17 * x := mul_le_mul_of_nonneg_right (by linarith) hx0 have hupper16 : (16 + δ) * x ≤ 17 * x := mul_le_mul_of_nonneg_right (by linarith) hx0 rcases (mem_typeII_boundary_window_iff hx0 hδ0).mp hu with hu1 | hu16 · exact ⟨Nat.cast_pos.mp (hlower1.trans_le hu1.1), hu1.2.trans hupper1⟩ · exact ⟨Nat.cast_pos.mp (hlower16.trans_le hu16.1), hu16.2.trans hupper16⟩ end Bounty end section /- The original auxiliary draw and complete full state are preserved by dilation congruence. -/ open Finset open scoped Classical namespace Bounty section Full variable {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D D' : ∀ c, A c → G → ℤ) (hD : ∀ c a g p, ((n g p : ℤ) ∣ D c a g ↔ (n g p : ℤ) ∣ D' c a g)) noncomputable def fullActiveDilationEventEquiv (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FullActiveEdgeEvent n S B A Δ D x ≃ FullActiveEdgeEvent n S B A Δ D' x := Equiv.sigmaCongrRight (fun a => unrestrictedJointDilationEventEquiv n (Δ (productActiveMemorySplit S B x).1 a) (D (productActiveMemorySplit S B x).1 a) (D' (productActiveMemorySplit S B x).1 a) (hD (productActiveMemorySplit S B x).1 a) (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B x).2) theorem full_active_dilation_target (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) : fullActiveEdgeEventTarget n S B A Δ D' x (fullActiveDilationEventEquiv n S B A Δ D D' hD x e) = fullActiveEdgeEventTarget n S B A Δ D x e := by exact congrArg (fun y => (productActiveMemorySplit S B).symm ((productActiveMemorySplit S B x).1, y)) (unrestricted_joint_dilation_target n (Δ (productActiveMemorySplit S B x).1 e.1) (D (productActiveMemorySplit S B x).1 e.1) (D' (productActiveMemorySplit S B x).1 e.1) (hD (productActiveMemorySplit S B x).1 e.1) (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B x).2 e.2) theorem full_active_dilation_weight [Fintype G] (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) : fullActiveEdgeEventWeight n S B A Δ D' ω μ ρ V x (fullActiveDilationEventEquiv n S B A Δ D D' hD x e) = fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e := by unfold fullActiveEdgeEventWeight apply congrArg (ω (productActiveMemorySplit S B x).1 e.1 * ·) exact unrestricted_joint_dilation_weight n _ _ _ (hD _ e.1) _ B μ ρ V _ e.2 end Full end Bounty end section /- Removing one small-group mark preserves every other group's marked weight. -/ open Finset namespace Bounty theorem marked_divisor_weight_remove_prime {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (hprime : ∀ g ∈ groups, ∀ p ∈ P g, p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hg : g ∈ groups) (k : ℕ) (ht : t g = k + 1) (n : ℕ) (hsq : ∀ p ∈ P g, ¬ p ^ 2 ∣ n) : markedDivisorWeight groups P q V t (n : ℤ) = (1 / V g) * ∑ p ∈ P g, if p ∣ n then markedDivisorWeight groups P q V (Function.update t g k) ((n / p : ℕ) : ℤ) else 0 := by classical let R := fun m : ℕ => ∏ h ∈ groups.erase g, markedDivisorFactor q (V h) (physicalOmega P h (m : ℤ)) (t h) have hR (p : ℕ) (hp : p ∈ P g) (hpn : p ∣ n) : R (n / p) = R n := by apply prod_congr rfl intro h hh have hne : h ≠ g := (mem_erase.mp hh).1 have hpout : p ∉ P h := by intro hph exact disjoint_left.mp (hdis hne.symm) hp hph have he := physical_divisor_pool_div_other_prime P h (hprime h (mem_of_mem_erase hh)) (hprime g hg p hp) hpout hpn rw [show physicalOmega P h ((n / p : ℕ) : ℤ) = physicalOmega P h (n : ℤ) from congrArg Finset.card he] have hsplit (m : ℕ) : markedDivisorWeight groups P q V (Function.update t g k) (m : ℤ) = markedDivisorFactor q (V g) (physicalOmega P g (m : ℤ)) k * R m := by unfold markedDivisorWeight rw [← mul_prod_erase groups _ hg, Function.update_self] congr 1 apply prod_congr rfl intro h hh rw [Function.update_of_ne (mem_erase.mp hh).1] calc _ = markedDivisorFactor q (V g) (physicalOmega P g (n : ℤ)) (k + 1) * R n := by unfold markedDivisorWeight rw [← mul_prod_erase groups _ hg, ht] _ = ((1 / V g) * ∑ p ∈ P g, if p ∣ n then markedDivisorFactor q (V g) (physicalOmega P g ((n / p : ℕ) : ℤ)) k else 0) * R n := by rw [marked_divisor_factor_remove_prime P g (hprime g hg) q (V g) n k hsq] _ = (1 / V g) * ∑ p ∈ P g, if p ∣ n then markedDivisorFactor q (V g) (physicalOmega P g ((n / p : ℕ) : ℤ)) k * R (n / p) else 0 := by rw [mul_assoc, sum_mul] congr 1 apply sum_congr rfl intro p hp by_cases hpn : p ∣ n · simp only [if_pos hpn, hR p hp hpn] · simp only [if_neg hpn, zero_mul] _ = _ := by simp_rw [← hsplit] end Bounty end section /- Embed each original complement-indexed birth into its actual full target slot. -/ open Finset Classical namespace Bounty section Embedding variable {J K : Type*} {N : ℕ} {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) noncomputable def fullMixedCommonSlotEmbedding : (tag : Option (J ⊕ K)) → (g : Fin N) → Fin (fullMixedBirthCapacity S B tag g) ↪ Fin (fullMixedCommonCapacity M B tag g) | none, _ => Function.Embedding.refl _ | some (.inl _), _ => Function.Embedding.refl _ | some (.inr k), g => ((S k g)ᶜ.equivFin.symm.toEmbedding).trans (Function.Embedding.subtype _) noncomputable def fullMixedCommonLocalEmbedding (tag : Option (J ⊕ K)) : FullMixedLocalBirthAddress S B tag ↪ FullMixedCommonLocalAddress M B tag := Function.Embedding.sigmaMap (Function.Embedding.refl _) (fullMixedCommonSlotEmbedding S B tag) noncomputable def fullMixedCommonStepEmbedding (steps : List (Option (J ⊕ K))) : FullMixedBirthAddress S B steps ↪ FullMixedCommonStepAddress M B steps := Function.Embedding.sigmaMap (Function.Embedding.refl _) (fun i => fullMixedCommonLocalEmbedding S B (steps.get i)) end Embedding end Bounty end section /- Initial common addresses retain group tags and exactly enumerate the original active ledger. -/ open Finset Classical namespace Bounty section Initial variable {N : ℕ} {P Z : Fin N → Type*} {M : Fin N → ℕ} {B : ℕ} (x : ProductBoundedOrderedState P Z M B) def fullMixedCommonInitialPrime (a : FullMixedCommonInitialAddress M) : (g : Fin N) × P g := ⟨a.1, (x a.1).1 a.2⟩ theorem full_mixed_common_initial_injective (hx : FullActiveInjective x) : Function.Injective (fullMixedCommonInitialPrime x) := (Function.Embedding.sigmaMap (Function.Embedding.refl (Fin N)) (fun g => ⟨(x g).1, hx g⟩)).injective variable [∀ g, DecidableEq (P g)] theorem full_mixed_common_initial_range (z : (g : Fin N) × P g) : z.2 ∈ fullActiveInitialLedger x z.1 ↔ ∃ a, fullMixedCommonInitialPrime x a = z := by constructor · intro hz obtain ⟨i, _, hi⟩ := mem_image.mp hz refine ⟨⟨z.1, i⟩, ?_⟩ exact congrArg (Sigma.mk z.1) hi · rintro ⟨a, rfl⟩ exact mem_image.mpr ⟨a.2, mem_univ _, rfl⟩ theorem full_mixed_common_initial_avoids_iff {A : Type*} (birth : A → Option ((g : Fin N) × P g)) : (∀ i a, birth a ≠ some (fullMixedCommonInitialPrime x i)) ↔ (∀ a z, birth a = some z → z.2 ∉ fullActiveInitialLedger x z.1) := by constructor · intro h a z hz hmem obtain ⟨i, hi⟩ := (full_mixed_common_initial_range x z).mp hmem exact h i a (hz.trans (congrArg some hi.symm)) · intro h i a ha exact h a (fullMixedCommonInitialPrime x i) ha ((full_mixed_common_initial_range x _).mpr ⟨i, rfl⟩) end Initial end Bounty end section /- One chronological enumeration, independent of the shared-slot pattern, places all initial slots before all event slots. -/ namespace Bounty variable {J K : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) abbrev FullMixedCommonLexAddress := Lex ((Lex ((g : Fin N) × Fin (M g))) ⊕ (Lex ((i : Fin steps.length) × Lex ((g : Fin N) × Fin (fullMixedCommonCapacity M B (steps.get i) g))))) def fullMixedCommonLexEquiv : FullMixedCommonLexAddress M B steps ≃ FullMixedCommonBirthAddress M B steps where toFun a := match ofLex a with | .inl b => .inl (ofLex b) | .inr b => .inr ⟨(ofLex b).1, ofLex (ofLex b).2⟩ invFun a := toLex (match a with | .inl b => .inl (toLex b) | .inr b => .inr (toLex ⟨b.1, toLex b.2⟩)) left_inv a := by cases a <;> rfl right_inv a := by cases a <;> rfl noncomputable def fullMixedCommonBirthOrder : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) ≃ FullMixedCommonBirthAddress M B steps := (Fintype.orderIsoFinOfCardEq (FullMixedCommonLexAddress M B steps) (Fintype.card_congr (fullMixedCommonLexEquiv M B steps))).toEquiv.trans (fullMixedCommonLexEquiv M B steps) def fullMixedCommonBirthStage : FullMixedCommonBirthAddress M B steps → ℕ | .inl _ => 0 | .inr a => a.1.val + 1 theorem full_mixed_common_lex_stage_monotone : Monotone (fun a => fullMixedCommonBirthStage M B steps (fullMixedCommonLexEquiv M B steps a)) := by intro a b h cases h with | inl h => exact le_rfl | sep a b => exact Nat.zero_le _ | inr h => rcases Sigma.Lex.le_def.mp h with hlt | ⟨heq, _⟩ · exact Nat.add_le_add_right (Fin.le_iff_val_le_val.mp hlt.le) 1 · exact Nat.add_le_add_right (Fin.le_iff_val_le_val.mp heq.le) 1 theorem full_mixed_common_order_stage_monotone : Monotone (fun i => fullMixedCommonBirthStage M B steps (fullMixedCommonBirthOrder M B steps i)) := (full_mixed_common_lex_stage_monotone M B steps).comp (Fintype.orderIsoFinOfCardEq (FullMixedCommonLexAddress M B steps) (Fintype.card_congr (fullMixedCommonLexEquiv M B steps))).monotone end Bounty end section /- The explicit local kernel has a Fourier transform bounded below on the unit interval. -/ open MeasureTheory open scoped FourierTransform namespace Bounty theorem local_mellin_kernel_fourier_formula (ξ : ℝ) : 𝓕 localMellinKernelSchwartz ξ = ∫ x : ℝ, Complex.exp (((-2 * Real.pi * x * ξ : ℝ) : ℂ) * Complex.I) * (localMellinKernel x : ℂ) := by rw [SchwartzMap.fourier_coe, Real.fourier_eq'] apply integral_congr_ae filter_upwards [] with x simp only [RCLike.inner_apply, starRingEnd_apply, star_trivial, smul_eq_mul] congr 2 push_cast ring theorem local_mellin_kernel_fourier_deviation (ξ : ℝ) : ‖𝓕 localMellinKernelSchwartz ξ - 1‖ ≤ (4 * Real.pi / (16 * Real.pi + 1)) * |ξ| := by let phase : ℝ → ℂ := fun x => Complex.exp (((-2 * Real.pi * x * ξ : ℝ) : ℂ) * Complex.I) have hiR : Integrable localMellinKernel := local_mellin_kernel_contDiff.continuous.integrable_of_hasCompactSupport local_mellin_kernel_compact have hi : Integrable (fun x => (localMellinKernel x : ℂ)) := hiR.ofReal have hphase : ∀ x, ‖phase x‖ = 1 := fun x => Complex.norm_exp_ofReal_mul_I _ have hfi : Integrable (fun x => phase x * (localMellinKernel x : ℂ)) := by apply hi.norm.mono' · have hc : Continuous (fun x => phase x * (localMellinKernel x : ℂ)) := by dsimp only [phase] apply Continuous.mul · fun_prop · exact Complex.continuous_ofReal.comp local_mellin_kernel_contDiff.continuous exact hc.aestronglyMeasurable · filter_upwards [] with x rw [norm_mul, hphase, one_mul] have hone : (∫ x : ℝ, (localMellinKernel x : ℂ)) = 1 := by rw [integral_complex_ofReal, local_mellin_kernel_integral] norm_num have hp (x : ℝ) : ‖phase x - 1‖ ≤ 2 * Real.pi * |x| * |ξ| := by have h := Real.norm_exp_I_mul_ofReal_sub_one_le (x := -2 * Real.pi * x * ξ) rw [mul_comm Complex.I] at h dsimp only [phase] calc _ ≤ ‖-2 * Real.pi * x * ξ‖ := h _ = _ := by simp [Real.norm_eq_abs, abs_of_pos Real.pi_pos] have hbound (x : ℝ) : ‖phase x * (localMellinKernel x : ℂ) - (localMellinKernel x : ℂ)‖ ≤ ((4 * Real.pi / (16 * Real.pi + 1)) * |ξ|) * localMellinKernel x := by by_cases hz : localMellinKernel x = 0 · simp [hz] · have hx : |x| ≤ 2 / (16 * Real.pi + 1) := le_of_not_gt (fun h => hz (local_mellin_kernel_support h)) rw [← sub_one_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (local_mellin_kernel_nonneg x)] apply mul_le_mul_of_nonneg_right _ (local_mellin_kernel_nonneg x) apply (hp x).trans have hh := mul_le_mul_of_nonneg_left hx (show 0 ≤ 2 * Real.pi * |ξ| by positivity) convert hh using 1 <;> ring rw [local_mellin_kernel_fourier_formula] change ‖(∫ x, phase x * (localMellinKernel x : ℂ)) - 1‖ ≤ _ rw [← hone, ← integral_sub hfi hi] apply (norm_integral_le_integral_norm _).trans calc _ ≤ ∫ x, ((4 * Real.pi / (16 * Real.pi + 1)) * |ξ|) * localMellinKernel x := by apply integral_mono_of_nonneg (Filter.Eventually.of_forall (fun x => norm_nonneg _)) (hiR.const_mul _) exact Filter.Eventually.of_forall hbound _ = _ := by rw [integral_const_mul, local_mellin_kernel_integral, mul_one] theorem local_mellin_kernel_fourier_lower {ξ : ℝ} (hξ : |ξ| ≤ 1) : 1 / 2 ≤ ‖𝓕 localMellinKernelSchwartz ξ‖ := by have hd := local_mellin_kernel_fourier_deviation ξ have hc : 0 ≤ 4 * Real.pi / (16 * Real.pi + 1) := by positivity have hcoef : 4 * Real.pi / (16 * Real.pi + 1) ≤ 1 / 2 := by apply (div_le_iff₀ (by positivity : 0 < 16 * Real.pi + 1)).mpr linarith [Real.pi_pos] have hh := mul_le_mul_of_nonneg_left hξ hc have hn := norm_sub_norm_le (1 : ℂ) (𝓕 localMellinKernelSchwartz ξ) rw [norm_one, norm_sub_rev] at hn nlinarith end Bounty end section /- The union of additive and logarithmic kernel supports remains in a short interval. -/ open Finset open scoped NNReal namespace Bounty section variable {K : ℝ → ℂ} (hK : ∀ t, 1 < |t| → K t = 0) {w v H : ℝ} (hw : 0 < w) (hv : 0 < v) (hH : 0 < H) (hHv : H ≤ v) include K hK w v H hw hv hH hHv theorem logarithmic_kernel_support_close (hnz : K (v * Real.log (w/v) / H) ≠ 0) : |w-v| ≤ 2*H := by have hb : |v * Real.log (w/v) / H| ≤ 1 := le_of_not_gt (fun h => hnz (hK _ h)) rw [abs_div, abs_mul, abs_of_pos hv, abs_of_pos hH] at hb have hmul : v * |Real.log (w/v)| ≤ H := (div_le_one hH).mp hb have hlog : |Real.log (w/v)| ≤ 1 := by nlinarith have he := Real.abs_exp_sub_one_le hlog rw [Real.exp_log (div_pos hw hv)] at he have heq : |w-v| = v * |w/v-1| := by calc _ = |v * (w/v-1)| := by congr 1; field_simp _ = _ := by rw [abs_mul, abs_of_pos hv] rw [heq] nlinarith [mul_le_mul_of_nonneg_left he hv.le] theorem additive_log_kernel_difference_support (hnz : K ((w-v)/H) - K (v*Real.log (w/v)/H) ≠ 0) : |w-v| ≤ 2*H := by by_cases ha : K ((w-v)/H) = 0 · have hb : K (v*Real.log (w/v)/H) ≠ 0 := by intro h; simp [ha,h] at hnz exact logarithmic_kernel_support_close hK hw hv hH hHv hb · have hb : |(w-v)/H| ≤ 1 := le_of_not_gt (fun h => ha (hK _ h)) rw [abs_div, abs_of_pos hH] at hb have hc : |w-v| ≤ H := (div_le_one hH).mp hb linarith end theorem short_nat_interval_card (S : Finset ℕ) {v H : ℝ} (hH : 0 ≤ H) : ((S.filter (fun (n : ℕ) => |(n:ℝ)-v| ≤ 2*H)).card : ℝ) ≤ 4*H+1 := by have hc := nat_finset_card_le_real_span (S.filter (fun (n : ℕ) => |(n:ℝ)-v| ≤ 2*H)) (a := v-2*H) (b := v+2*H) (by linarith) (fun n hn => by have hb := abs_le.mp (mem_filter.mp hn).2 constructor <;> linarith) linarith theorem finite_complex_kernel_error_bound {ι : Type*} (S : Finset ι) (a b : ι → ℂ) {C : ℝ} (_hC : 0 ≤ C) (hb : ∀ n ∈ S, ‖b n‖ ≤ C) : ‖∑ n ∈ S, a n*b n‖^2 ≤ (S.card : ℝ)*C^2*(∑ n ∈ S, ‖a n‖^2) := by have ht : ‖∑ n ∈ S, a n*b n‖ ≤ C * ∑ n ∈ S, ‖a n‖ := by apply (norm_sum_le _ _).trans rw [mul_sum] apply sum_le_sum intro n hn rw [norm_mul, mul_comm C] exact mul_le_mul_of_nonneg_left (hb n hn) (norm_nonneg _) have hc := sum_mul_sq_le_sq_mul_sq S (fun _ => (1 : ℝ)) (fun n => ‖a n‖) simp only [one_mul, one_pow, sum_const, nsmul_eq_mul, mul_one] at hc have hs := pow_le_pow_left₀ (norm_nonneg _) ht 2 rw [mul_pow] at hs nlinarith [mul_le_mul_of_nonneg_left hc (sq_nonneg C)] end Bounty end section /- The restricted list sum equals the original all-label sum with its divisibility gate. -/ open Finset open scoped Classical namespace Bounty theorem group_marked_sum_eq_indicator {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) (b : GroupMarkedLists P t → ℂ) : (∑ L : GroupMarkedListsAt P t n, b L.val) = ∑ L : GroupMarkedLists P t, if ∀ g s, ((L g s).val : ℤ) ∣ n then b L else 0 := by classical rw [← sum_filter] exact (sum_subtype _ (by simp) b).symm theorem weighted_group_marked_indicator_eq_average {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (n : ℤ) (b : GroupMarkedLists P t → ℂ) : ((∏ g, q ^ (physicalOmega P g n - t g) / V g ^ t g : ℝ) : ℂ) * (∑ L : GroupMarkedLists P t, if ∀ g s, ((L g s).val : ℤ) ∣ n then b L else 0) = (markedDivisorWeight univ P q V t n : ℂ) * groupMarkedAverage P t n b := by rw [← group_marked_sum_eq_indicator] exact weighted_group_marked_sum_eq_average P q V t n b end Bounty end section open MeasureTheory open scoped ComplexConjugate namespace Bounty theorem oscillatory_cauchy_kernel_integrable (C : ℝ) : Integrable (fun x : ℝ => C / (1+(x/(2*Real.pi))^2)) := by have hi := integrable_inv_one_add_sq.comp_mul_left' (inv_ne_zero (ne_of_gt (mul_pos (by norm_num : (0:ℝ)<2) Real.pi_pos))) simpa only [div_eq_mul_inv, mul_comm] using hi.const_mul C theorem oscillatory_cauchy_kernel_integral (C : ℝ) : (∫ x : ℝ, C / (1+(x/(2*Real.pi))^2)) = C * (2*Real.pi^2) := by simp_rw [div_eq_mul_inv C] rw [integral_const_mul, Measure.integral_comp_div (fun x : ℝ => (1+x^2)⁻¹) (2*Real.pi)] rw [abs_of_pos (mul_pos (by norm_num : (0:ℝ)<2) Real.pi_pos), smul_eq_mul, integral_univ_inv_one_add_sq] ring theorem oscillatory_gram_phase (a : ℝ → ℝ → ℂ) (h t r u : ℝ) : (Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * a (h*t) u) * conj (Complex.exp (((-r*u:ℝ):ℂ)*Complex.I) * a (h*r) u) = Complex.exp (((-2*Real.pi*((t-r)/(2*Real.pi))*u:ℝ):ℂ)*Complex.I) * a (h*t) u * conj (a (h*r) u) := by have hpi : (2:ℝ)*Real.pi ≠ 0 := ne_of_gt (mul_pos (by norm_num) Real.pi_pos) simp only [map_mul, ← Complex.exp_conj, Complex.conj_ofReal, Complex.conj_I] calc _ = (Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * Complex.exp (((-r*u:ℝ):ℂ)*(-Complex.I))) * (a (h*t) u * conj (a (h*r) u)) := by ring _ = _ := by rw [← Complex.exp_add] have he : (((-t*u:ℝ):ℂ)*Complex.I) + (((-r*u:ℝ):ℂ)*(-Complex.I)) = (((-2*Real.pi*((t-r)/(2*Real.pi))*u:ℝ):ℂ)*Complex.I) := by have hr : -t*u - (-r*u) = -2*Real.pi*((t-r)/(2*Real.pi))*u := by field_simp; ring rw [← hr] push_cast ring rw [he] ring theorem oscillatory_schur_energy_integrable {a : ℝ → ℝ → ℂ} {f : ℝ → ℂ} {M : ℝ} (ha : Continuous (Function.uncurry a)) (hM : 0 ≤ M) (hab : ∀ v u, ‖a v u‖ ≤ M) (has : ∀ v u, u ∉ Set.Icc (-3:ℝ) 3 → a v u = 0) (hf : Continuous f) (hfi : Integrable f) (h : ℝ) : Integrable (fun u : ℝ => ‖∫ t : ℝ, Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * a (h*t) u * f t‖^2) := by classical let A : ℝ → ℝ → ℂ := fun u t => Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * a (h*t) u have hAc : Continuous (Function.uncurry A) := by dsimp [A]; fun_prop have hAb (u t : ℝ) : ‖A u t‖ ≤ M := by dsimp [A] rw [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul] exact hab (h*t) u have hi := bounded_amplitude_energy_integrable (volume.restrict (Set.Icc (-3:ℝ) 3)) hAc hf hfi hM hAb have he : (Set.Icc (-3:ℝ) 3).indicator (fun u : ℝ => ‖∫ t : ℝ, A u t * f t‖^2) = (fun u : ℝ => ‖∫ t : ℝ, A u t * f t‖^2) := by funext u by_cases hu : u ∈ Set.Icc (-3:ℝ) 3 · exact Set.indicator_of_mem hu _ · rw [Set.indicator_of_notMem hu] have hz : (fun t => A u t * f t) = fun _ => (0:ℂ) := by funext t dsimp [A] rw [has (h*t) u hu, mul_zero, zero_mul] rw [hz, integral_zero, norm_zero, zero_pow (by decide : 2 ≠ 0)] have hii := IntegrableOn.integrable_indicator hi measurableSet_Icc rw [he] at hii exact hii theorem oscillatory_schur_energy_bound {a : ℝ → ℝ → ℂ} {f : ℝ → ℂ} {M C : ℝ} (ha : Continuous (Function.uncurry a)) (hM : 0 ≤ M) (hab : ∀ v u, ‖a v u‖ ≤ M) (has : ∀ v u, u ∉ Set.Icc (-3:ℝ) 3 → a v u = 0) (hC : 0 ≤ C) (hFourier : ∀ v w ξ : ℝ, ‖∫ u : ℝ, Complex.exp (((-2*Real.pi*ξ*u:ℝ):ℂ)*Complex.I) * a v u * conj (a w u)‖ ≤ C/(1+ξ^2)) (hf : Continuous f) (hfi : Integrable f) (hf2 : Integrable (fun t => ‖f t‖^2)) (h : ℝ) : (∫ u : ℝ, ‖∫ t : ℝ, Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * a (h*t) u * f t‖^2) ≤ C*(2*Real.pi^2) * ∫ t : ℝ, ‖f t‖^2 := by let A : ℝ → ℝ → ℂ := fun u t => Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * a (h*t) u let K : ℝ → ℝ := fun x => C/(1+(x/(2*Real.pi))^2) have hAc : Continuous (Function.uncurry A) := by dsimp [A]; fun_prop have hAb (u t : ℝ) : ‖A u t‖ ≤ M := by dsimp [A] rw [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul] exact hab (h*t) u have hKc : Continuous K := by dsimp [K] apply Continuous.div continuous_const (by fun_prop) intro x positivity have hK0 (x : ℝ) : 0 ≤ K x := div_nonneg hC (by positivity) have hKe (x : ℝ) : K (-x) = K x := by dsimp [K]; congr 2; ring have hGram (t r : ℝ) : ‖∫ u in Set.Icc (-3:ℝ) 3, A u t * conj (A u r)‖ ≤ K (t-r) := by rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun u hu => ?_)] · have heq : (fun u => A u t * conj (A u r)) = (fun u => Complex.exp (((-2*Real.pi*((t-r)/(2*Real.pi))*u:ℝ):ℂ)*Complex.I) * a (h*t) u * conj (a (h*r) u)) := funext (oscillatory_gram_phase a h t r) rw [heq] exact hFourier (h*t) (h*r) ((t-r)/(2*Real.pi)) · dsimp [A] rw [has (h*t) u hu, mul_zero, zero_mul] have hb := bounded_amplitude_energy_le_of_gram (volume.restrict (Set.Icc (-3:ℝ) 3)) hAc hf hfi hf2 hM hAb hKc (oscillatory_cauchy_kernel_integrable C) hK0 hKe hGram rw [oscillatory_cauchy_kernel_integral C] at hb have he : (∫ u in Set.Icc (-3:ℝ) 3, ‖∫ t : ℝ, A u t * f t‖^2) = ∫ u : ℝ, ‖∫ t : ℝ, A u t * f t‖^2 := by apply setIntegral_eq_integral_of_forall_compl_eq_zero intro u hu have hz : (fun t => A u t * f t) = fun _ => (0:ℂ) := by funext t dsimp [A] rw [has (h*t) u hu, mul_zero, zero_mul] rw [hz, integral_zero, norm_zero, zero_pow (by decide : 2 ≠ 0)] rw [he] at hb exact hb end Bounty end section /- Once the initial prefix has no selected children, forest constraints are exactly the subsequent stage constraints. -/ namespace Bounty theorem birth_forest_compatible_iff_event_stages {m L : ℕ} {α : Type*} (owner : Fin m → Fin (L + 1)) (code : BirthForestCode m) (hcode : ∀ i, owner i = 0 → code i = none) (values : Fin m → Option α) : birthForestCompatible (fun i => (values i).isSome = true) values code ↔ ∀ u : Fin L, birthForestStageCondition owner u.succ values code := by rw [birth_forest_compatible_iff_stages owner] constructor · intro h u exact h u.succ · intro h u exact Fin.cases (birth_forest_initial_stage_trivial owner code hcode values) h u end Bounty end section open scoped BigOperators ComplexConjugate open MeasureTheory namespace Bounty theorem logarithmic_gram_row (s : Finset ℕ) (N n : ℕ) (a b : ℝ) (hab : a ≤ b) (hn : n ∈ s) (hs : ∀ m ∈ s, 1 ≤ m ∧ m ≤ N) : (∑ m ∈ s, ‖∫ t in a..b, Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I) * conj (Complex.exp ((Real.log (m : ℝ) * t : ℝ) * Complex.I))‖) ≤ (b - a) + 4 * (N : ℝ) * (1 + Real.log N) := by have hn0 : 0 < n := (hs n hn).1 have hnN : n ≤ N := (hs n hn).2 have hp (m : ℕ) (hm : m ∈ s) : ‖∫ t in a..b, Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I) * conj (Complex.exp ((Real.log (m : ℝ) * t : ℝ) * Complex.I))‖ ≤ (if m = n then b - a else 0) + 2 * (N : ℝ) * (if m = n then 0 else |(n : ℝ) - m|⁻¹) := by rcases lt_trichotomy m n with h | rfl | h · have hc : (m : ℝ) ≤ n := by exact_mod_cast h.le rw [if_neg h.ne, if_neg h.ne, zero_add, interval_gram_norm_symm] simpa only [Nat.cast_sub h.le, abs_of_nonneg (sub_nonneg.mpr hc)] using logarithmic_gram_off_diagonal (hs m hm).1 h hnN a b · simp only [exponential_phase_gram, sub_self, zero_mul, Complex.ofReal_zero, Complex.exp_zero, if_true, mul_zero, add_zero, intervalIntegral.integral_const, norm_smul, norm_one, mul_one, Real.norm_eq_abs, abs_of_nonneg (sub_nonneg.mpr hab), le_refl] · have hc : (n : ℝ) ≤ m := by exact_mod_cast h.le rw [if_neg h.ne', if_neg h.ne', zero_add] simpa only [Nat.cast_sub h.le, abs_of_nonpos (sub_nonpos.mpr hc), neg_sub] using logarithmic_gram_off_diagonal hn0 h (hs m hm).2 a b calc _ ≤ ∑ m ∈ s, ((if m = n then b - a else 0) + 2 * (N : ℝ) * (if m = n then 0 else |(n : ℝ) - m|⁻¹)) := Finset.sum_le_sum hp _ = (b - a) + 2 * (N : ℝ) * ∑ m ∈ s, (if m = n then 0 else |(n : ℝ) - m|⁻¹) := by rw [Finset.sum_add_distrib, ← Finset.mul_sum] simp [hn] _ ≤ (b - a) + 2 * (N : ℝ) * (2 * (1 + Real.log N)) := by gcongr exact sum_inverse_abs_distances_le s n N hnN (fun m hm => (hs m hm).2) _ = _ := by ring theorem dirichlet_polynomial_mean_square (s : Finset ℕ) (c : ℕ → ℂ) (N : ℕ) (a b : ℝ) (hab : a ≤ b) (hs : ∀ n ∈ s, 1 ≤ n ∧ n ≤ N) : (∫ t in a..b, ‖∑ n ∈ s, c n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)‖ ^ 2) ≤ ((b - a) + 4 * (N : ℝ) * (1 + Real.log N)) * ∑ n ∈ s, ‖c n‖ ^ 2 := by apply interval_finite_gram_row_bound · intro n _ fun_prop · intro n hn exact logarithmic_gram_row s N n a b hab hn hs end Bounty end section open Finset open scoped ComplexConjugate namespace Bounty theorem finite_shift_correlation_zero_norm (S : Finset ℤ) (f : ℤ → ℂ) : ‖finiteShiftCorrelation S f 0‖ = ∑ n ∈ S, ‖f n‖^2 := by simp only [finiteShiftCorrelation, add_zero, Complex.mul_conj, Complex.normSq_eq_norm_sq, ← Complex.ofReal_sum] rw [Complex.norm_real, Real.norm_of_nonneg (sum_nonneg (fun n hn => sq_nonneg _))] theorem integer_interval_van_der_corput (a b H : ℤ) (f : ℤ → ℂ) (hab : a ≤ b) (hH : 1 ≤ H) (hsupport : ∀ n, n ∉ Icc a b → f n = 0) : (H:ℝ) * ‖∑ n ∈ Icc a b, f n‖^2 ≤ ((b-a+H:ℤ):ℝ) * ((∑ n ∈ Icc a b, ‖f n‖^2) + 2 * ∑ d ∈ Icc (1:ℤ) (H-1), ‖finiteShiftCorrelation (Icc a b) f d‖) := by let S := Icc a b let V := Icc (0:ℤ) (H-1) let X := Icc (a-H+1) b have hcover (n : ℤ) (hn : n ∈ S) (h : ℤ) (hh : h ∈ V) : n-h ∈ X := by have hn' := mem_Icc.mp hn have hh' := mem_Icc.mp hh apply mem_Icc.mpr omega have hc := finite_translate_cauchy_correlation S V X f hsupport hcover have hcardV : (V.card:ℝ) = (H:ℝ) := by have hv := Int.card_Icc_of_le (a := 0) (b := H-1) (by omega) simp only [sub_add_cancel, sub_zero] at hv exact_mod_cast hv have hcardX : (X.card:ℝ) = ((b-a+H:ℤ):ℝ) := by have hx := Int.card_Icc_of_le (a := a-H+1) (b := b) (by omega) have hr : b+1-(a-H+1) = b-a+H := by ring rw [hr] at hx exact_mod_cast hx rw [hcardV, hcardX] at hc have hr : (∑ h ∈ V, ∑ k ∈ V, (finiteShiftCorrelation S f (h-k)).re) ≤ ∑ h ∈ V, ∑ k ∈ V, ‖finiteShiftCorrelation S f (h-k)‖ := by apply sum_le_sum intro h hh apply sum_le_sum intro k hk exact Complex.re_le_norm _ have ht := toeplitz_integer_interval_sum_bound (fun d => ‖finiteShiftCorrelation S f d‖) (H-1) (by omega) (fun d => norm_nonneg _) (fun d => finite_shift_correlation_norm_neg S f d hsupport) simp only [sub_add_cancel, finite_shift_correlation_zero_norm] at ht have hX0 : (0:ℝ) ≤ ((b-a+H:ℤ):ℝ) := by exact_mod_cast (by omega : 0 ≤ b-a+H) have hall := hc.trans (mul_le_mul_of_nonneg_left (hr.trans ht) hX0) have hH0 : (0:ℝ) < (H:ℝ) := by exact_mod_cast (by omega : 0 < H) apply (mul_le_mul_iff_right₀ hH0).mp dsimp only [S] at hall nlinarith only [hall] theorem integer_interval_van_der_corput_unit (a b H : ℤ) (f : ℤ → ℂ) (hab : a ≤ b) (hH : 1 ≤ H) (hHN : H ≤ b-a+1) (hsupport : ∀ n, n ∉ Icc a b → f n = 0) (hf : ∀ n ∈ Icc a b, ‖f n‖ ≤ 1) : ‖∑ n ∈ Icc a b, f n‖^2 ≤ 2*((b-a+1:ℤ):ℝ)^2/(H:ℝ) + (4*((b-a+1:ℤ):ℝ)/(H:ℝ)) * ∑ d ∈ Icc (1:ℤ) (H-1), ‖finiteShiftCorrelation (Icc a b) f d‖ := by have hv := integer_interval_van_der_corput a b H f hab hH hsupport have he : (∑ n ∈ Icc a b, ‖f n‖^2) ≤ ((b-a+1:ℤ):ℝ) := by calc _ ≤ ∑ _n ∈ Icc a b, (1:ℝ) := by apply sum_le_sum intro n hn nlinarith [norm_nonneg (f n), hf n hn] _ = _ := by rw [sum_const, nsmul_eq_mul, mul_one] have hc := Int.card_Icc_of_le (a := a) (b := b) (by omega) have hh : b+1-a = b-a+1 := by ring rw [hh] at hc exact_mod_cast hc have hN : (0:ℝ) ≤ ((b-a+1:ℤ):ℝ) := by exact_mod_cast (by omega : 0 ≤ b-a+1) have hX : (0:ℝ) ≤ ((b-a+H:ℤ):ℝ) := by exact_mod_cast (by omega : 0 ≤ b-a+H) have hXle : ((b-a+H:ℤ):ℝ) ≤ 2*((b-a+1:ℤ):ℝ) := by exact_mod_cast (by omega : b-a+H ≤ 2*(b-a+1)) have hs : 0 ≤ ∑ d ∈ Icc (1:ℤ) (H-1), ‖finiteShiftCorrelation (Icc a b) f d‖ := sum_nonneg (fun d hd => norm_nonneg _) have hb := hv.trans (mul_le_mul hXle (add_le_add he le_rfl) (by positivity) (by positivity)) have hH0 : (0:ℝ) < (H:ℝ) := by exact_mod_cast (by omega : 0 < H) rw [div_mul_eq_mul_div, ← add_div] apply (le_div_iff₀ hH0).mpr nlinarith only [hb] end Bounty end section /- A finite Kusmin-Landau bound for monotone increments in a single unit band. -/ open Finset namespace Bounty theorem discrete_unit_phase_sum_bound (u : ℕ → ℂ) (φ : ℕ → ℝ) (N : ℕ) {δ : ℝ} (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (hu : ∀ n ≤ N, ‖u n‖ ≤ 1) (hstep : ∀ n < N, u (n+1) = u n * Complex.exp (((2*Real.pi*φ n : ℝ) : ℂ)*Complex.I)) (hφ : ∀ n < N, δ ≤ φ n ∧ φ n ≤ 1-δ) (hmono : MonotoneOn φ (Set.Iio N) ∨ AntitoneOn φ (Set.Iio N)) : ‖∑ n ∈ range N, u n‖ ≤ 2/δ := by by_cases hN : N = 0 · subst N simp only [range_zero, sum_empty, norm_zero] positivity have hNp : 0 < N := Nat.pos_of_ne_zero hN let clamp : ℕ → ℕ := fun n => min n (N-1) let w : ℕ → ℂ := fun n => phaseReciprocalKernel (2*Real.pi*φ (clamp n)) have hclamp (n : ℕ) : clamp n < N := by have := Nat.min_le_right n (N-1) dsimp [clamp] omega have hc_eq (n : ℕ) (hn : n < N) : clamp n = n := by dsimp [clamp] exact min_eq_left (by omega) have hφmem (n : ℕ) : φ (clamp n) ∈ Set.Ioo (0 : ℝ) 1 := by have hh := hφ (clamp n) (hclamp n) constructor <;> linarith have hw : ∀ n < N, w n*(u n-u (n+1)) = u n := by intro n hn dsimp only [w] rw [hc_eq n hn,hstep n hn] calc _ = (phaseReciprocalKernel (2*Real.pi*φ n) * (1-Complex.exp (((2*Real.pi*φ n : ℝ) : ℂ)*Complex.I))) * u n := by ring _ = u n := by rw [phase_reciprocal_unit_mul (by simpa only [hc_eq n hn] using hφmem n),one_mul] have hre : ∀ n ≤ N, (w n).re = (w 0).re := by intro n hn simp only [w,phase_reciprocal_kernel_re] have hcm (n : ℕ) : clamp n ≤ clamp (n+1) := min_le_min_right _ (Nat.le_succ n) have him : (∀ n < N, (w n).im ≤ (w (n+1)).im) ∨ (∀ n < N, (w (n+1)).im ≤ (w n).im) := by rcases hmono with hm | hm · right intro n hn exact antitoneOn_unit_phase_reciprocal_im (hφmem n) (hφmem (n+1)) (hm (hclamp n) (hclamp (n+1)) (hcm n)) · left intro n hn exact antitoneOn_unit_phase_reciprocal_im (hφmem (n+1)) (hφmem n) (hm (hclamp n) (hclamp (n+1)) (hcm n)) have hn (n : ℕ) : ‖w n‖ ≤ 1/(2*δ) := norm_phase_reciprocal_unit_band hδ hδhalf (hφ (clamp n) (hclamp n)) calc _ ≤ 2*(‖w 0‖+‖w N‖) := monotone_reciprocal_sum_bound u w N hw hu hre him _ ≤ 2*(1/(2*δ)+1/(2*δ)) := mul_le_mul_of_nonneg_left (add_le_add (hn 0) (hn N)) (by norm_num) _ = 2/δ := by ring end Bounty end section /- Square-root optimization of the finite slope partition. -/ open Finset namespace Bounty theorem discrete_second_derivative_from_first {a b : ℕ} {d : ℕ → ℝ} {z : ℕ → ℂ} {lam A C : ℝ} (hab : a ≤ b) (hlam : 0 < lam) (hA : 1 ≤ A) (hC : 0 ≤ C) (hsep : ∀ i ∈ Icc a b, ∀ j ∈ Icc a b, i ≤ j → lam*((j : ℝ)-i) ≤ d j-d i ∧ d j-d i ≤ A*lam*((j : ℝ)-i)) (hz : ∀ n ∈ Icc a b, ‖z n‖ ≤ 1) (hfirst : ∀ δ : ℝ, 0 < δ → δ ≤ 1/2 → ∀ l r : ℕ, ∀ k : ℤ, a ≤ l → r ≤ b → l ≤ r → (∀ n ∈ Icc l r, (k : ℝ)+δ ≤ d n ∧ d n ≤ k+1-δ) → ‖∑ n ∈ Icc l r, z n‖ ≤ C/δ) : ‖∑ n ∈ Icc a b, z n‖ ≤ (C+4)*(A*((b : ℝ)-a+1)*Real.sqrt lam+2/Real.sqrt lam) := by have hs : 0 < Real.sqrt lam := Real.sqrt_pos.mpr hlam have hsq : (Real.sqrt lam)^2 = lam := Real.sq_sqrt hlam.le have habR : (a : ℝ) ≤ b := by exact_mod_cast hab have hN : 0 ≤ (b : ℝ)-a+1 := by linarith have hA0 : 0 ≤ A := by linarith have hmono : MonotoneOn d (Set.Icc a b) := by intro i hi j hj hij have h := (hsep i (mem_Icc.mpr hi) j (mem_Icc.mpr hj) hij).1 have hijR : (i : ℝ) ≤ j := by exact_mod_cast hij nlinarith by_cases hsmall : lam ≤ 1/4 · have hsHalf : Real.sqrt lam ≤ 1/2 := by nlinarith have hsOne : Real.sqrt lam ≤ 1 := by linarith have he := discrete_slope_partition_bound hab hlam hs hC hmono (fun i hi j hj hij => (hsep i hi j hj hij).1) hz (hfirst (Real.sqrt lam) hs hsHalf) have hdiv : Real.sqrt lam/lam = 1/Real.sqrt lam := by apply (div_eq_div_iff (ne_of_gt hlam) (ne_of_gt hs)).mpr nlinarith have hone : (1 : ℝ) ≤ 1/Real.sqrt lam := (le_div_iff₀ hs).mpr (by linarith) have hcost : C/Real.sqrt lam+2*(Real.sqrt lam/lam+1) ≤ (C+4)/Real.sqrt lam := by rw [hdiv] calc _ ≤ C/Real.sqrt lam+2*(1/Real.sqrt lam+1/Real.sqrt lam) := by linarith _ = _ := by ring have hrange : d b-d a+2 ≤ A*lam*((b : ℝ)-a+1)+2 := by have h := (hsep a (mem_Icc.mpr ⟨le_rfl,hab⟩) b (mem_Icc.mpr ⟨hab,le_rfl⟩) hab).2 nlinarith have heq : (A*lam*((b : ℝ)-a+1)+2)*((C+4)/Real.sqrt lam) = (C+4)*(A*((b : ℝ)-a+1)*Real.sqrt lam+2/Real.sqrt lam) := by field_simp rw [hsq] ring exact he.trans ((mul_le_mul hrange hcost (by positivity) (by positivity)).trans_eq heq) · have hsHalf : 1/2 ≤ Real.sqrt lam := by nlinarith have hcard : ((Icc a b).card : ℝ) = (b : ℝ)-a+1 := by rw [Nat.card_Icc,Nat.cast_sub (show a ≤ b+1 by omega)] push_cast ring have hsum : ‖∑ n ∈ Icc a b, z n‖ ≤ (b : ℝ)-a+1 := by calc _ ≤ ∑ n ∈ Icc a b, ‖z n‖ := norm_sum_le _ _ _ ≤ ∑ n ∈ Icc a b, (1 : ℝ) := sum_le_sum hz _ = _ := by simpa using hcard have hmain : (b : ℝ)-a+1 ≤ (C+4)*(A*((b : ℝ)-a+1)*Real.sqrt lam) := by have h1 : (b : ℝ)-a+1 ≤ A*((b : ℝ)-a+1) := by nlinarith have h2 : A*((b : ℝ)-a+1)/2 ≤ A*((b : ℝ)-a+1)*Real.sqrt lam := by nlinarith have h3 : 0 ≤ A*((b : ℝ)-a+1)*Real.sqrt lam := by positivity nlinarith have htail : 0 ≤ (C+4)*(2/Real.sqrt lam) := by positivity nlinarith end Bounty end section /- Exact expansion into the grouped integer coefficients for the logarithmic exponentials used in the Dirichlet mean-square integral. -/ open Finset open scoped Classical namespace Bounty theorem prime_tuple_log_product (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (j : ℕ) (a : Fin j → P) : Real.log (primeTupleProduct P j a : ℝ) = ∑ r, Real.log ((a r).val : ℝ) := by unfold primeTupleProduct rw [Nat.cast_prod] exact Real.log_prod (fun r _ => Nat.cast_ne_zero.mpr (hP (a r).val (a r).property).pos.ne') theorem prime_tuple_exp_log_product (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (j : ℕ) (a : Fin j → P) (t : ℝ) : Complex.exp (((Real.log (primeTupleProduct P j a : ℝ) * t : ℝ) : ℂ) * Complex.I) = ∏ r, Complex.exp (((Real.log ((a r).val : ℝ) * t : ℝ) : ℂ) * Complex.I) := by rw [prime_tuple_log_product P hP j a] simp only [sum_mul, Complex.ofReal_sum, Complex.exp_sum] theorem prime_polynomial_power_exp_log (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (w : P → ℂ) (j : ℕ) (t : ℝ) : (∑ p : P, w p * Complex.exp (((Real.log (p.val : ℝ) * t : ℝ) : ℂ) * Complex.I)) ^ j = ∑ n ∈ primePolynomialSupport P j, primePolynomialCoefficient P w j n * Complex.exp (((Real.log (n : ℝ) * t : ℝ) : ℂ) * Complex.I) := by rw [Fintype.sum_pow, prime_polynomial_coefficients_sum_mul] apply sum_congr rfl intro a _ rw [prod_mul_distrib, prime_tuple_exp_log_product P hP j a t] end Bounty end section /- Elementary coefficient energy in a dyadic integer interval. No prime-counting estimate is used; repeated entries remain permitted in the tuple bound. -/ namespace Bounty open Finset theorem nat_dyadic_card_le (s : Finset ℕ) (P : ℝ) (hP : 1 ≤ P) (hband : ∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) : (s.card : ℝ) ≤ 2 * P := by have hs : s ⊆ Finset.Icc 1 ⌊2 * P⌋₊ := by intro p hp apply Finset.mem_Icc.mpr constructor · exact_mod_cast hP.trans (hband p hp).1 · exact Nat.le_floor (hband p hp).2 have hc : s.card ≤ ⌊2 * P⌋₊ := by simpa using Finset.card_le_card hs exact (Nat.cast_le.mpr hc).trans (Nat.floor_le (by linarith)) theorem prime_dyadic_coefficient_energy_le (s : Finset ℕ) (P B : ℝ) (b : ℕ → ℂ) (hP : 1 ≤ P) (hB : 0 ≤ B) (hband : ∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) (hb : ∀ p ∈ s, ‖b p‖ ≤ B) : (∑ p ∈ s, ‖b p / (p : ℂ)‖ ^ 2) ≤ 2 * B ^ 2 / P := by have hPpos : 0 < P := by linarith have hterm : ∀ p ∈ s, ‖b p / (p : ℂ)‖ ^ 2 ≤ (B / P) ^ 2 := by intro p hp have hnorm : ‖b p / (p : ℂ)‖ ≤ B / P := by rw [norm_div, Complex.norm_natCast] exact div_le_div₀ hB (hb p hp) hPpos (hband p hp).1 exact (sq_le_sq₀ (norm_nonneg _) (div_nonneg hB hPpos.le)).mpr hnorm calc (∑ p ∈ s, ‖b p / (p : ℂ)‖ ^ 2) ≤ ∑ _p ∈ s, (B / P) ^ 2 := Finset.sum_le_sum hterm _ = (s.card : ℝ) * (B / P) ^ 2 := by simp _ ≤ (2 * P) * (B / P) ^ 2 := mul_le_mul_of_nonneg_right (nat_dyadic_card_le s P hP hband) (sq_nonneg _) _ = 2 * B ^ 2 / P := by field_simp theorem prime_dyadic_reciprocal_energy_le (s : Finset ℕ) (P B : ℝ) (b : s → ℂ) (hP : 1 ≤ P) (hB : 0 ≤ B) (hband : ∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) (hb : ∀ p : s, ‖b p‖ ≤ B) : (∑ p : s, ‖b p‖ ^ 2 / (p.val : ℝ) ^ 2) ≤ 2 * B ^ 2 / P := by classical let b' : ℕ → ℂ := fun p => if hp : p ∈ s then b ⟨p, hp⟩ else 0 have hb' : ∀ p ∈ s, ‖b' p‖ ≤ B := by intro p hp simpa only [b', dif_pos hp] using hb ⟨p, hp⟩ have h := prime_dyadic_coefficient_energy_le s P B b' hP hB hband hb' rw [← Finset.sum_coe_sort] at h simpa [norm_div, Complex.norm_natCast, div_pow, b'] using h theorem prime_tuple_product_real_le (s : Finset ℕ) (U : ℝ) (hbound : ∀ p ∈ s, (p : ℝ) ≤ U) (j : ℕ) (a : Fin j → s) : (primeTupleProduct s j a : ℝ) ≤ U ^ j := by calc (primeTupleProduct s j a : ℝ) = ∏ r, ((a r).val : ℝ) := by simp only [primeTupleProduct, Nat.cast_prod] _ ≤ ∏ _r : Fin j, U := Finset.prod_le_prod₀ (fun _ _ => Nat.cast_nonneg _) (fun r _ => hbound _ (a r).property) _ = U ^ j := by simp theorem prime_polynomial_support_real_le (s : Finset ℕ) (U : ℝ) (hbound : ∀ p ∈ s, (p : ℝ) ≤ U) (j n : ℕ) (hn : n ∈ primePolynomialSupport s j) : (n : ℝ) ≤ U ^ j := by obtain ⟨a, _, rfl⟩ := Finset.mem_image.mp hn exact prime_tuple_product_real_le s U hbound j a end Bounty end section /- The explicit Sobolev-sampling prefactor and threshold loss fit the fixed-parameter prime-moment exponential estimate. -/ namespace Bounty noncomputable def primeMomentActualExponent (c A : ℝ) : ℝ := primeMomentExceptionalExponent c (512 * (c + 1) ^ 2) (max 2 (2 * A)) theorem prime_moment_actual_exponent_one_le {c A : ℝ} (hc : 0 ≤ c) (hA : 0 ≤ A) : 1 ≤ primeMomentActualExponent c A := by apply prime_moment_exceptional_exponent_one_le hc · nlinarith [sq_nonneg c] · exact (mul_nonneg (by norm_num) hA).trans (le_max_right _ _) theorem prime_moment_actual_budget_le_exp {N L Y P a b c A : ℝ} (ha0 : 0 ≤ a) (ha1 : a ≤ 1) (hc : 0 ≤ c) (hA : 0 ≤ A) (hL : Real.exp 1 ≤ L) (hY : 1 ≤ Y) (hlogY : Real.log Y ≤ c * L) (hPlo : Real.exp (L ^ a) / 2 ≤ P) (hPhi : P ≤ Real.exp (L ^ b)) (hN : N ≤ 512 * Y * (1 + Real.log Y) ^ 2 * (primeMomentDegree Y P).factorial * (2 * L ^ (2 * A) / P) ^ primeMomentDegree Y P) : N ≤ Real.exp (primeMomentActualExponent c A * (L ^ b + L ^ (1 - a) * Real.log L)) := by let C : ℝ := 512 * (c + 1) ^ 2 let d : ℝ := max 2 (2 * A) have hC : 1 ≤ C := by dsimp only [C]; nlinarith [sq_nonneg c] have hC2 : 2 ≤ C := by dsimp only [C]; nlinarith [sq_nonneg c] have hC0 : 0 ≤ C := zero_le_one.trans hC have hd : 0 ≤ d := (mul_nonneg (by norm_num) hA).trans (le_max_right _ _) have hL0 : 0 < L := (Real.exp_pos 1).trans_le hL have hL1 : 1 ≤ L := (Real.one_le_exp (by norm_num : (0 : ℝ) ≤ 1)).trans hL have hP0 : 0 < P := (div_pos (Real.exp_pos _) (by norm_num : (0 : ℝ) < 2)).trans_le hPlo have hY0 : 0 ≤ Y := zero_le_one.trans hY have hlog0 : 0 ≤ Real.log Y := Real.log_nonneg hY have hlog : 1 + Real.log Y ≤ (c + 1) * L := by nlinarith only [hlogY, hL1] have hsq := pow_le_pow_left₀ (by linarith : 0 ≤ 1 + Real.log Y) hlog 2 have hpref : 512 * (1 + Real.log Y) ^ 2 ≤ C * L ^ d := by calc _ ≤ 512 * ((c + 1) * L) ^ 2 := mul_le_mul_of_nonneg_left hsq (by norm_num) _ = C * L ^ (2 : ℝ) := by rw [Real.rpow_two]; dsimp only [C]; ring _ ≤ C * L ^ d := mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left _ _)) hC0 have hthreshold : 2 * L ^ (2 * A) ≤ C * L ^ d := mul_le_mul hC2 (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_right _ _)) (Real.rpow_nonneg hL0.le _) hC0 have hratio : 2 * L ^ (2 * A) / P ≤ C * L ^ d / P := div_le_div_of_nonneg_right hthreshold hP0.le have hraw : 512 * Y * (1 + Real.log Y) ^ 2 * (primeMomentDegree Y P).factorial * (2 * L ^ (2 * A) / P) ^ primeMomentDegree Y P ≤ (C * L ^ d) * Y * (primeMomentDegree Y P).factorial * ((C * L ^ d) / P) ^ primeMomentDegree Y P := by calc _ = (512 * (1 + Real.log Y) ^ 2) * Y * (primeMomentDegree Y P).factorial * (2 * L ^ (2 * A) / P) ^ primeMomentDegree Y P := by ring _ ≤ _ := by gcongr exact prime_moment_exceptional_budget_le_exp ha0 ha1 hc hC hd hL hY hlogY hPlo hPhi (hN.trans hraw) end Bounty end section /- Finite separated sampling estimates for exponential polynomials. -/ open scoped BigOperators ComplexConjugate namespace Bounty theorem sparse_exponential_polynomial_energy {I X : Type*} [Fintype I] [Fintype X] (x : I → ℝ) (w : X → ℝ) (c : X → ℂ) (N : ℕ) {U E : ℝ} (hU : 0 ≤ U) (hE : 0 ≤ E) (hsep : ∀ i j, i ≠ j → 1 ≤ |x i - x j|) (hspan : ∀ i j, |x i - x j| ≤ N) (hkernel : ∀ z : ℝ, |z| ≤ N → ‖∑ n, Complex.exp ((w n * z : ℝ) * Complex.I)‖ ≤ U / (1 + |z|) + E) : (∑ i, ‖∑ n, c n * Complex.exp ((w n * x i : ℝ) * Complex.I)‖ ^ 2) ≤ (U * (1 + 2 * (1 + Real.log N)) + (Fintype.card I : ℝ) * E) * ∑ n, ‖c n‖ ^ 2 := by have hB : 0 ≤ U * (1 + 2 * (1 + Real.log N)) + (Fintype.card I : ℝ) * E := by have := Real.log_natCast_nonneg N positivity have hphase (i j : I) (n : X) : Complex.exp ((w n * x i : ℝ) * Complex.I) * conj (Complex.exp ((w n * x j : ℝ) * Complex.I)) = Complex.exp ((w n * (x i - x j) : ℝ) * Complex.I) := by simpa only [mul_comm] using exponential_phase_gram (x i) (x j) (w n) have hrow (i : I) : (∑ j, ‖∑ n, Complex.exp ((w n * x i : ℝ) * Complex.I) * conj (Complex.exp ((w n * x j : ℝ) * Complex.I))‖) ≤ U * (1 + 2 * (1 + Real.log N)) + (Fintype.card I : ℝ) * E := by simp_rw [hphase] calc _ ≤ ∑ j, (U / (1 + |x i - x j|) + E) := Finset.sum_le_sum (fun j _ => hkernel (x i - x j) (hspan i j)) _ = U * (∑ j, (1 + |x i - x j|)⁻¹) + (Fintype.card I : ℝ) * E := by simp only [div_eq_mul_inv, Finset.sum_add_distrib, ← Finset.mul_sum, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] _ ≤ _ := by exact add_le_add (mul_le_mul_of_nonneg_left (separated_reciprocal_row_bound Finset.univ x N i (Finset.mem_univ i) (fun j _ k _ hjk => hsep j k hjk) (fun j _ => hspan i j)) hU) le_rfl simpa only [mul_comm] using finite_row_gram_energy_le (fun i n => Complex.exp ((w n * x i : ℝ) * Complex.I)) c hB hrow end Bounty end section open Set namespace Bounty theorem mixed_logarithmic_difference_successor_formula (hs : List ℝ) (u c : ℝ) (k : ℕ) (x : ℝ) (hhs : ∀ h ∈ hs, 0 ≤ h) (hx : 0 < x+c) : ∃ y ∈ Icc x (x+hs.sum), mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x = (hs.prod * (u * (-1:ℝ)^(k+hs.length)) * ((k+hs.length).factorial:ℝ)) / (y+c)^(k+hs.length+1) := by obtain ⟨y, hy, hyeq⟩ := mixed_logarithmic_difference_mean_value hs u c (k+1) x hhs hx refine ⟨y, hy, ?_⟩ have hk : k+1+hs.length = (k+hs.length)+1 := by omega rw [hyeq, hk, logarithmicDerivativeChain] ring theorem mixed_logarithmic_difference_abs_bounds (hs : List ℝ) (u c : ℝ) (k : ℕ) (x : ℝ) (hhs : ∀ h ∈ hs, 0 ≤ h) (hx : 0 < x+c) : (hs.prod * |u| * ((k+hs.length).factorial:ℝ)) / (x+c+hs.sum)^(k+hs.length+1) ≤ |mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x| ∧ |mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x| ≤ (hs.prod * |u| * ((k+hs.length).factorial:ℝ)) / (x+c)^(k+hs.length+1) := by obtain ⟨y, hy, hyeq⟩ := mixed_logarithmic_difference_successor_formula hs u c k x hhs hx have hypos : 0 < y+c := by linarith [hy.1] have hprod : 0 ≤ hs.prod := List.prod_nonneg hhs have habs : |mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x| = (hs.prod * |u| * ((k+hs.length).factorial:ℝ)) / (y+c)^(k+hs.length+1) := by rw [hyeq] simp [abs_div, abs_mul, abs_pow, abs_of_nonneg hprod, abs_of_pos hypos] rw [habs] have hn : 0 ≤ hs.prod * |u| * ((k+hs.length).factorial:ℝ) := by positivity constructor · apply div_le_div_of_nonneg_left hn (by positivity) apply pow_le_pow_left₀ (le_of_lt hypos) linarith [hy.2] · apply div_le_div_of_nonneg_left hn (by positivity) apply pow_le_pow_left₀ (le_of_lt hx) linarith [hy.1] theorem mixed_logarithmic_difference_nonneg (hs : List ℝ) (u c : ℝ) (k : ℕ) (x : ℝ) (hhs : ∀ h ∈ hs, 0 ≤ h) (hx : 0 < x+c) (hsign : 0 ≤ u * (-1:ℝ)^(k+hs.length)) : 0 ≤ mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x := by obtain ⟨y, hy, hyeq⟩ := mixed_logarithmic_difference_successor_formula hs u c k x hhs hx rw [hyeq] have hypos : 0 < y+c := by linarith [hy.1] have hprod : 0 ≤ hs.prod := List.prod_nonneg hhs positivity theorem mixed_logarithmic_difference_nonpos (hs : List ℝ) (u c : ℝ) (k : ℕ) (x : ℝ) (hhs : ∀ h ∈ hs, 0 ≤ h) (hx : 0 < x+c) (hsign : u * (-1:ℝ)^(k+hs.length) ≤ 0) : mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x ≤ 0 := by obtain ⟨y, hy, hyeq⟩ := mixed_logarithmic_difference_successor_formula hs u c k x hhs hx rw [hyeq] have hypos : 0 < y+c := by linarith [hy.1] have hprod : 0 ≤ hs.prod := List.prod_nonneg hhs apply div_nonpos_of_nonpos_of_nonneg · exact mul_nonpos_of_nonpos_of_nonneg (mul_nonpos_of_nonneg_of_nonpos hprod hsign) (Nat.cast_nonneg _) · positivity end Bounty end section /- Explicit power savings after the scalar differencing iteration. -/ namespace Bounty theorem van_der_corput_scalar_power_saving (H B C N θ : ℝ) (m : ℕ) (hN : 1 ≤ N) (hθ : 0 ≤ θ) (hC : 1 ≤ C) (hH : 2/H ≤ C*N^(-θ)) (hB : B ≤ C*N^(-θ)) : vanDerCorputScalarBound H B m ≤ 5^m*C*N^(-(θ/(2:ℝ)^m)) := by have hNp : 0 < N := lt_of_lt_of_le (by norm_num) hN have hη0 : 0 ≤ N^(-θ) := Real.rpow_nonneg hNp.le _ have hη1 : N^(-θ) ≤ 1 := by have hh := Real.rpow_le_rpow_of_exponent_le hN (show -θ ≤ 0 by linarith) simpa only [Real.rpow_zero] using hh have h := van_der_corput_scalar_le_rpow H B C (N^(-θ)) m hη0 hη1 hC hH hB rw [← Real.rpow_mul hNp.le] at h convert h using 1 <;> congr 2 <;> ring theorem inverse_floor_power_le (N θ : ℝ) (hN : 0 < N) (hpow : 2 ≤ N^θ) : 2/(Nat.floor (N^θ) : ℝ) ≤ 4*N^(-θ) := by have hf := Nat.lt_floor_add_one (N^θ) have hfp : 0 < (Nat.floor (N^θ) : ℝ) := by linarith rw [Real.rpow_neg hN.le] change 2/(Nat.floor (N^θ) : ℝ) ≤ 4/(N^θ) apply (div_le_div_iff₀ hfp (Real.rpow_pos_of_pos hN _)).mpr linarith theorem van_der_corput_floor_power_saving (B C N θ : ℝ) (m : ℕ) (hN : 1 ≤ N) (hθ : 0 ≤ θ) (hC : 4 ≤ C) (hpow : 2 ≤ N^θ) (hB : B ≤ C*N^(-θ)) : vanDerCorputScalarBound (Nat.floor (N^θ) : ℝ) B m ≤ 5^m*C*N^(-(θ/(2:ℝ)^m)) := by apply van_der_corput_scalar_power_saving _ _ _ _ _ _ hN hθ (by linarith) _ hB exact (inverse_floor_power_le N θ (by linarith) hpow).trans (mul_le_mul_of_nonneg_right hC (Real.rpow_nonneg (by linarith) _)) end Bounty end section /- Quantitative removal of shared-draw restrictions for a coefficient independent of every shared coordinate. -/ open Finset open scoped Classical namespace Bounty def physicalSharedDrawGood {G : Type*} {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (T : ∀ g, Finset (P g)) (s : PhysicalAuxLabels P (fun g => univ \ C g)) : Prop := ∀ g, (∀ j, s g j ∉ T g) ∧ Function.Injective (s g) theorem physical_shared_group_bad_mass {G : Type*} {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (g : G) (hV : 0 < V g) (hMass : ∑ p ∈ P g, 1 / (p : ℝ) = V g) (T : Finset (P g)) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ p : P g, Pmin ≤ (p.val : ℝ)) : (∑ s : (univ \ C g : Finset (Fin J)) → P g, cleanAuxiliaryWeight (physicalLabelLaw V g) s * (if (∃ j, s j ∈ T) ∨ ¬Function.Injective s then 1 else 0)) ≤ (J - (C g).card : ℕ) * (T.card + (J - (C g).card : ℕ)) / (V g * Pmin) := by calc _ = ∑ s : (univ \ C g : Finset (Fin J)) → P g, cleanAuxiliaryBadWeight (physicalLabelLaw V g) T s := by apply sum_congr rfl intro s _ unfold cleanAuxiliaryBadWeight by_cases hb : (∃ j, s j ∈ T) ∨ ¬Function.Injective s · simp only [if_pos hb] · simp only [if_neg hb] _ ≤ (Fintype.card ↥(univ \ C g) : ℝ) * (T.card + Fintype.card ↥(univ \ C g)) * (1 / (V g * Pmin)) := clean_auxiliary_bad_weight_le (physicalLabelLaw V g) (fun p => div_nonneg zero_le_one (mul_nonneg hV.le (Nat.cast_nonneg p.val))) (physical_label_law_sum V g hV hMass) T (1 / (V g * Pmin)) (div_nonneg zero_le_one (mul_pos hV hPmin).le) (fun p => physical_label_law_atom_le V g hV hPmin p (hp p)) _ = _ := by simp only [Fintype.card_coe, card_sdiff_of_subset (subset_univ _), card_univ, Fintype.card_fin] ring theorem physical_shared_draw_bad_mass {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (T : ∀ g, Finset (P g)) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) : (∑ s : PhysicalAuxLabels P (fun g => univ \ C g), physicalAuxMass V (fun g => univ \ C g) s * (if ¬physicalSharedDrawGood C T s then 1 else 0)) ≤ ∑ g, (J - (C g).card : ℕ) * ((T g).card + (J - (C g).card : ℕ)) / (V g * Pmin) := by have he (s : PhysicalAuxLabels P (fun g => univ \ C g)) : ¬physicalSharedDrawGood C T s ↔ ∃ g, (∃ j, s g j ∈ T g) ∨ ¬Function.Injective (s g) := by simp only [physicalSharedDrawGood, not_forall, not_and_or, not_not] simp_rw [he] calc _ ≤ ∑ g, ∑ s : PhysicalAuxLabels P (fun g => univ \ C g), physicalAuxMass V (fun g => univ \ C g) s * (if (∃ j, s g j ∈ T g) ∨ ¬Function.Injective (s g) then 1 else 0) := by rw [sum_comm] apply sum_le_sum intro s _ have hn := physical_aux_mass_nonneg V (fun g => univ \ C g) (fun g => (hV g).le) s by_cases hb : ∃ g, (∃ j, s g j ∈ T g) ∨ ¬Function.Injective (s g) · obtain ⟨g, hg⟩ := hb rw [if_pos ⟨g, hg⟩, mul_one] calc _ = physicalAuxMass V (fun g => univ \ C g) s * (if (∃ j, s g j ∈ T g) ∨ ¬Function.Injective (s g) then 1 else 0) := by rw [if_pos hg, mul_one] _ ≤ _ := by have hnn : ∀ i ∈ (univ : Finset G), 0 ≤ physicalAuxMass V (fun g => univ \ C g) s * (if (∃ j, s i j ∈ T i) ∨ ¬Function.Injective (s i) then 1 else 0) := by intro i _ exact mul_nonneg hn (by split_ifs <;> norm_num) exact single_le_sum hnn (mem_univ g) · rw [if_neg hb, mul_zero] apply sum_nonneg intro g _ exact mul_nonneg hn (by split_ifs <;> norm_num) _ = ∑ g, ∑ s : (univ \ C g : Finset (Fin J)) → P g, cleanAuxiliaryWeight (physicalLabelLaw V g) s * (if (∃ j, s j ∈ T g) ∨ ¬Function.Injective s then 1 else 0) := by apply sum_congr rfl intro g _ exact physical_auxiliary_group_marginal V (fun g => univ \ C g) hV hMass g (fun s => if (∃ j, s j ∈ T g) ∨ ¬Function.Injective s then 1 else 0) _ ≤ _ := by apply sum_le_sum intro g _ exact physical_shared_group_bad_mass V C g (hV g) (hMass g) (T g) hPmin (hp g) theorem physical_shared_draw_endpoint_bad_mass {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (aux : PhysicalAuxLabels P C) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) : (∑ s : PhysicalAuxLabels P (fun g => univ \ C g), physicalAuxMass V (fun g => univ \ C g) s * (if ¬physicalSharedDrawGood C (fun g => physicalSharedForbidden C aux g w z) s then 1 else 0)) ≤ ∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin) := by refine (physical_shared_draw_bad_mass V C hV hMass _ hPmin hp).trans ?_ apply sum_le_sum intro g _ apply div_le_div_of_nonneg_right _ (mul_pos (hV g) hPmin).le apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) have hc : (C g).card ≤ J := (card_le_card (subset_univ _)).trans_eq (by simp) have he : ((C g).card : ℝ) + (J - (C g).card : ℕ) = J := by have hn : (C g).card + (J - (C g).card) = J := by omega exact_mod_cast hn linarith [physical_shared_forbidden_log_card C aux g hw hz] end Bounty end section /- Pool-invariant weights can be moved entirely to the residual convolution factor. -/ open Finset namespace Bounty theorem weighted_free_divisor_convolution (P : Finset ℕ) (W α γ : ℕ → ℂ) (hW : ∀ a b : ℕ, b ≠ 0 → Disjoint b.primeFactors P → W (a * b) = W a) (hα : ∀ d : ℕ, ¬ Disjoint d.primeFactors P → α d = 0) {n : ℕ} (hn : n ≠ 0) : W n * (∑ d ∈ (primePoolFreePart P n).divisors, α d * γ (primePoolFreePart P n / d)) = ∑ d ∈ n.divisors, α d * (W (n / d) * γ (primePoolFreePart P (n / d))) := by classical calc _ = ∑ d ∈ (primePoolFreePart P n).divisors, α d * (W (n / d) * γ (primePoolFreePart P (n / d))) := by rw [mul_sum] apply sum_congr rfl intro d hd obtain ⟨hdn, hfree⟩ := (dvd_primePoolFreePart_iff P hn).mp (Nat.mem_divisors.mp hd).1 rw [invariant_pool_free_divisor_weight P W hW hn hdn hfree, primePoolFreePart_div_of_free P hn hdn hfree] ring _ = ∑ d ∈ n.divisors.filter (fun d => Disjoint d.primeFactors P), α d * (W (n / d) * γ (primePoolFreePart P (n / d))) := by rw [divisors_primePoolFreePart P hn] _ = _ := by rw [sum_filter] apply sum_congr rfl intro d _ by_cases hd : Disjoint d.primeFactors P · rw [if_pos hd] · rw [if_neg hd, hα d hd, zero_mul] theorem weighted_invariant_triple_convolution (P : Finset ℕ) (W α β γ : ℕ → ℂ) (hW : ∀ a b : ℕ, b ≠ 0 → Disjoint b.primeFactors P → W (a * b) = W a) (hα : ∀ d : ℕ, ¬ Disjoint d.primeFactors P → α d = 0) (hβ : ∀ d : ℕ, ¬ Disjoint d.primeFactors P → β d = 0) {n : ℕ} (hn : n ≠ 0) : W n * invariantTripleEndpoint P α β γ n = endpointTripleConvolution α β (fun r => W r * γ (primePoolFreePart P r)) n := by have hfirst := weighted_free_divisor_convolution P W α (fun k => ∑ d ∈ k.divisors, β d * γ (k / d)) hW hα hn have hlocal (m : ℕ) (hm : m ∈ n.divisors) := weighted_free_divisor_convolution P W β γ hW hβ (show n / m ≠ 0 by intro h have he := Nat.mul_div_cancel' (Nat.mem_divisors.mp hm).1 rw [h, mul_zero] at he exact hn he.symm) calc _ = W n * (∑ m ∈ (primePoolFreePart P n).divisors, α m * (∑ d ∈ (primePoolFreePart P n / m).divisors, β d * γ (primePoolFreePart P n / m / d))) := by simp only [invariantTripleEndpoint, endpointTripleConvolution, mul_sum, mul_assoc] _ = ∑ m ∈ n.divisors, α m * (W (n / m) * (∑ d ∈ (primePoolFreePart P (n / m)).divisors, β d * γ (primePoolFreePart P (n / m) / d))) := hfirst _ = _ := by unfold endpointTripleConvolution apply sum_congr rfl intro m hm rw [hlocal m hm, mul_sum] apply sum_congr rfl intro d _ ring end Bounty end section /- The square of the fourfold divisor count is bounded by a sixteenfold divisor count. -/ open Finset namespace Bounty theorem square_bound_of_scaled_recurrences {a b c d x y z : ℕ} (hx : 0 < x) (hy : y ^ 2 ≤ z * x) (hab : a * y = b * x) (hcd : c * z = d * x) (hac : a ^ 2 ≤ c) : b ^ 2 ≤ d := by have hh : x ^ 2 * b ^ 2 ≤ x ^ 2 * d := by calc _ = a ^ 2 * y ^ 2 := by nlinarith only [congrArg (fun n : ℕ => n ^ 2) hab] _ ≤ a ^ 2 * (z * x) := Nat.mul_le_mul_left _ hy _ ≤ c * (z * x) := Nat.mul_le_mul_right _ hac _ = _ := by nlinarith only [congrArg (fun n : ℕ => n * x) hcd] exact Nat.le_of_mul_le_mul_left hh (Nat.pow_pos hx) theorem choose_three_square_le_choose_fifteen (a : ℕ) : (a + 3).choose 3 ^ 2 ≤ (a + 15).choose 15 := by induction a with | zero => norm_num | succ a ih => have h3 := Nat.choose_mul_succ_eq (a + 3) 3 have h15 := Nat.choose_mul_succ_eq (a + 15) 15 rw [show a + 3 + 1 - 3 = a + 1 by omega] at h3 rw [show a + 15 + 1 - 15 = a + 1 by omega] at h15 have h3' : (a + 3).choose 3 * (a + 4) = (a + 4).choose 3 * (a + 1) := by simpa only [Nat.add_assoc, Nat.reduceAdd] using h3 have h15' : (a + 15).choose 15 * (a + 16) = (a + 16).choose 15 * (a + 1) := by simpa only [Nat.add_assoc, Nat.reduceAdd] using h15 have hp : (a + 4) ^ 2 ≤ (a + 16) * (a + 1) := by nlinarith have hres := square_bound_of_scaled_recurrences (by omega : 0 < a + 1) hp h3' h15' ih simpa only [Nat.succ_eq_add_one, Nat.add_assoc] using hres theorem zeta_four_square_le_zeta_sixteen (n : ℕ) : ((ArithmeticFunction.zeta ^ 4) n) ^ 2 ≤ (ArithmeticFunction.zeta ^ 16) n := by by_cases hn : n = 0 · simp [hn] rw [(ArithmeticFunction.isMultiplicative_zeta.pow (k := 4)).multiplicative_factorization _ hn, (ArithmeticFunction.isMultiplicative_zeta.pow (k := 16)).multiplicative_factorization _ hn] simp only [Finsupp.prod, ← Finset.prod_pow] apply Finset.prod_le_prod' intro p hp have hp' := Nat.prime_of_mem_primeFactors hp rw [show 4 = 3 + 1 by omega, show 16 = 15 + 1 by omega, divisor_zeta_power_prime_pow 3 _ hp', divisor_zeta_power_prime_pow 15 _ hp'] exact choose_three_square_le_choose_fifteen _ theorem zeta_four_square_summatory (N : ℕ) : (∑ n ∈ Ioc 0 N, (((ArithmeticFunction.zeta ^ 4) n : ℕ) : ℝ) ^ 2) ≤ (N : ℝ) * (1 + Real.log N) ^ 15 := by calc _ ≤ ∑ n ∈ Ioc 0 N, ((ArithmeticFunction.zeta ^ 16) n : ℝ) := by apply sum_le_sum intro n _ exact_mod_cast zeta_four_square_le_zeta_sixteen n _ ≤ (N : ℝ) * divisorHarmonic N ^ 15 := by simpa only [Nat.reduceAdd] using divisor_zeta_summatory_bound 15 N _ ≤ _ := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (divisor_harmonic_nonneg N) (divisor_harmonic_log_bound N) 15) (Nat.cast_nonneg N) end Bounty end section /- The coefficient family is uniform over every residual in the same gcd slice. -/ open scoped BigOperators Classical namespace Bounty theorem rational_four_factor_gcd_slice_expansion {r Q d : ℕ} (hr : 0 < r) (hrQ : r ≤ Q) (hd : 0 < d) (hdr : d ∣ r) (u : ℤ) : ∃ c : AddChar (Additive (ZMod (r / d))ˣ) ℂ → ℂ, (∑ ψ, ‖c ψ‖) ≤ Real.sqrt (Q : ℝ) ∧ ∀ m a p n : ℕ, m.Coprime r → a.Coprime r → p.Coprime r → n.gcd r = d → (∑ ψ, c ψ * unitAddCharDirichlet ψ (m : ZMod (r / d)) * unitAddCharDirichlet ψ (a : ZMod (r / d)) * unitAddCharDirichlet ψ (p : ZMod (r / d)) * unitAddCharDirichlet ψ ((n / d : ℕ) : ZMod (r / d))) = Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (m * a * p * n)) : ℝ)) := by have hq : 0 < r / d := Nat.div_pos (Nat.le_of_dvd hr hdr) hd have hqr : r / d ∣ r := Nat.div_dvd_of_dvd hdr obtain ⟨c, hc, he⟩ := rational_four_factor_unit_expansion hq ((Nat.div_le_self _ _).trans hrQ) u refine ⟨c, hc, ?_⟩ intro m a p n hm ha hp hnd have hv : (n / d).Coprime (r / d) := by rw [← hnd] exact Nat.coprime_div_gcd_div_gcd (hnd.symm ▸ hd) have hdn : d ∣ n := hnd ▸ Nat.gcd_dvd_left n r rw [he m a p (n / d) (hm.of_dvd_right hqr) (ha.of_dvd_right hqr) (hp.of_dvd_right hqr) hv] exact (rational_four_factor_phase_cancel hd hq (Nat.mul_div_cancel' hdr) (Nat.mul_div_cancel' hdn) u m a p).symm end Bounty end section /- The normalized Mellin polynomial of a finite four-factor box separates exactly. -/ open Finset namespace Bounty theorem harmonic_mellin_weight_four_factors (t : ℝ) {m a p n : ℕ} (hm : 0 < m) (ha : 0 < a) (hp : 0 < p) (hn : 0 < n) : harmonicMellinWeight t ((m * a * p * n : ℕ) : ℝ) = harmonicMellinWeight t m * harmonicMellinWeight t a * harmonicMellinWeight t p * harmonicMellinWeight t n := by simp only [Nat.cast_mul] rw [harmonic_mellin_weight_mul t (by positivity) (by positivity), harmonic_mellin_weight_mul t (by positivity) (by positivity), harmonic_mellin_weight_mul t (by positivity) (by positivity)] theorem harmonic_mellin_four_factor_box (M A P N : Finset ℕ) (hM : ∀ m ∈ M, 0 < m) (hA : ∀ a ∈ A, 0 < a) (hP : ∀ p ∈ P, 0 < p) (hN : ∀ n ∈ N, 0 < n) (α δ β γ : ℕ → ℂ) (t : ℝ) : (∑ m ∈ M, ∑ a ∈ A, ∑ p ∈ P, ∑ n ∈ N, (α m * δ a * β p * γ n) * harmonicMellinWeight t ((m * a * p * n : ℕ) : ℝ)) = (∑ m ∈ M, α m * harmonicMellinWeight t m) * (∑ a ∈ A, δ a * harmonicMellinWeight t a) * (∑ p ∈ P, β p * harmonicMellinWeight t p) * (∑ n ∈ N, γ n * harmonicMellinWeight t n) := by calc _ = ∑ m ∈ M, ∑ a ∈ A, ∑ p ∈ P, ∑ n ∈ N, (α m * harmonicMellinWeight t m) * (δ a * harmonicMellinWeight t a) * (β p * harmonicMellinWeight t p) * (γ n * harmonicMellinWeight t n) := by apply sum_congr rfl intro m hm apply sum_congr rfl intro a ha apply sum_congr rfl intro p hp apply sum_congr rfl intro n hn rw [harmonic_mellin_weight_four_factors t (hM m hm) (hA a ha) (hP p hp) (hN n hn)] ring _ = _ := by simp only [← mul_sum, ← sum_mul] end Bounty end section /- Exact Mellin factorization for the two subproducts used in mean-square bounds. -/ open Finset namespace Bounty theorem divisor_pair_finite_mellin (S A B : Finset ℕ) (α β : ℕ → ℂ) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (hS : ∀ a ∈ A, ∀ b ∈ B, a*b ∈ S) (t : ℝ) : (∑ n ∈ S, (∑ d ∈ n.divisors, α d*β (n/d))*harmonicMellinWeight t n) = (∑ a ∈ A, α a*harmonicMellinWeight t a)*(∑ b ∈ B, β b*harmonicMellinWeight t b) := by rw [finite_divisor_convolution_transform S A B α β _ hA hB hα hβ hS] calc _ = ∑ a ∈ A, ∑ b ∈ B, (α a*harmonicMellinWeight t a)*(β b*harmonicMellinWeight t b) := by apply sum_congr rfl intro a ha apply sum_congr rfl intro b hb rw [Nat.cast_mul,harmonic_mellin_weight_mul t (by exact_mod_cast hA a ha) (by exact_mod_cast hB b hb)] ring _ = _ := by simp only [← mul_sum,← sum_mul] theorem endpoint_triple_finite_mellin (S A B C : Finset ℕ) (α β γ : ℕ → ℂ) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (hγ : ∀ c, c ∉ C → γ c = 0) (hS : ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, a*b*c ∈ S) (t : ℝ) : (∑ n ∈ S, endpointTripleConvolution α β γ n*harmonicMellinWeight t n) = (∑ a ∈ A, α a*harmonicMellinWeight t a)* (∑ b ∈ B, β b*harmonicMellinWeight t b)*(∑ c ∈ C, γ c*harmonicMellinWeight t c) := by rw [endpoint_triple_finite_transform S A B C α β γ _ hA hB hC hα hβ hγ hS] calc _ = ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, (α a*harmonicMellinWeight t a)*(β b*harmonicMellinWeight t b)*(γ c*harmonicMellinWeight t c) := by apply sum_congr rfl intro a ha apply sum_congr rfl intro b hb apply sum_congr rfl intro c hc have ha0 : 0 < (a : ℝ) := by exact_mod_cast hA a ha have hb0 : 0 < (b : ℝ) := by exact_mod_cast hB b hb have hc0 : 0 < (c : ℝ) := by exact_mod_cast hC c hc simp only [Nat.cast_mul] rw [harmonic_mellin_weight_mul t (mul_pos ha0 hb0) hc0,harmonic_mellin_weight_mul t ha0 hb0] ring _ = _ := by simp only [← mul_sum,← sum_mul] end Bounty end section /- Uniform-in-frequency bounds for finite harmonic Mellin polynomials. -/ open Finset namespace Bounty theorem finite_mellin_norm_le_mass (S : Finset ℕ) (f : ℕ → ℂ) (u U : ℝ) (hU : 0 < U) (hS : ∀ n ∈ S, U ≤ (n : ℝ)) : ‖∑ n ∈ S, harmonicMellinWeight u n * f n‖ ≤ (∑ n ∈ S, ‖f n‖) / U := by calc _ ≤ ∑ n ∈ S, ‖harmonicMellinWeight u n * f n‖ := norm_sum_le _ _ _ ≤ ∑ n ∈ S, (1 / U) * ‖f n‖ := by apply sum_le_sum intro n hn rw [norm_mul, norm_harmonic_mellin_weight u (hU.trans_le (hS n hn))] exact mul_le_mul_of_nonneg_right (one_div_le_one_div_of_le hU (hS n hn)) (norm_nonneg _) _ = _ := by rw [← mul_sum]; ring theorem divisor_harmonic_floor_le_log {X : ℝ} (hX : 1 ≤ X) : divisorHarmonic ⌊X⌋₊ ≤ 1 + Real.log X := by have hs : Ioc 0 ⌊X⌋₊ = Icc 1 ⌊X⌋₊ := by ext n; simp only [mem_Ioc, mem_Icc]; omega have he : divisorHarmonic ⌊X⌋₊ = (harmonic ⌊X⌋₊ : ℝ) := by simp only [divisorHarmonic, harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast, hs] rw [he] exact harmonic_floor_le_one_add_log X hX theorem finite_dyadic_mellin_zeta_norm (S : Finset ℕ) (f : ℕ → ℂ) (u U B : ℝ) (k : ℕ) (hU : 1 ≤ U) (hB : 0 ≤ B) (hS : ∀ n ∈ S, U ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*U) (hf : ∀ n ∈ S, ‖f n‖ ≤ B * ((ArithmeticFunction.zeta^(k+1)) n : ℝ)) : ‖∑ n ∈ S, harmonicMellinWeight u n * f n‖ ≤ 2*B*(1+Real.log (2*U))^k := by have hUpos : 0 < U := by linarith have hsub : S ⊆ Ioc 0 ⌊2*U⌋₊ := by intro n hn exact mem_Ioc.mpr ⟨by exact_mod_cast hUpos.trans_le (hS n hn).1, Nat.le_floor (hS n hn).2⟩ have hmass : (∑ n ∈ S, ‖f n‖) ≤ B*(2*U)*(1+Real.log (2*U))^k := by calc _ ≤ ∑ n ∈ S, B*((ArithmeticFunction.zeta^(k+1)) n : ℝ) := sum_le_sum hf _ = B*(∑ n ∈ S, ((ArithmeticFunction.zeta^(k+1)) n : ℝ)) := (mul_sum _ _ _).symm _ ≤ B*(∑ n ∈ Ioc 0 ⌊2*U⌋₊, ((ArithmeticFunction.zeta^(k+1)) n : ℝ)) := by apply mul_le_mul_of_nonneg_left _ hB exact sum_le_sum_of_subset_of_nonneg hsub (by intros; positivity) _ ≤ B*((⌊2*U⌋₊ : ℝ)*divisorHarmonic ⌊2*U⌋₊^k) := mul_le_mul_of_nonneg_left (divisor_zeta_summatory_bound k _) hB _ ≤ B*((2*U)*(1+Real.log (2*U))^k) := by apply mul_le_mul_of_nonneg_left _ hB exact mul_le_mul (Nat.floor_le (by linarith)) (pow_le_pow_left₀ (divisor_harmonic_nonneg _) (divisor_harmonic_floor_le_log (by linarith : 1 ≤ 2*U)) k) (pow_nonneg (divisor_harmonic_nonneg _) k) (by linarith) _ = _ := by ring calc _ ≤ (∑ n ∈ S, ‖f n‖)/U := finite_mellin_norm_le_mass S f u U hUpos (fun n hn => (hS n hn).1) _ ≤ (B*(2*U)*(1+Real.log (2*U))^k)/U := div_le_div_of_nonneg_right hmass hUpos.le _ = _ := by field_simp end Bounty end section /- Uniform numerical bounds for the shared-draw error and the half-density overlap loss, without assumptions on the individual cut. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] {J : ℕ} (C : G → Finset (Fin J)) include G sharedInstance1 J C theorem physical_shared_count_le : (∑ g : G, (J - (C g).card)) ≤ J * Fintype.card G := by calc _ ≤ ∑ _g : G, J := sum_le_sum (fun _ _ => Nat.sub_le _ _) _ = _ := by simp only [sum_const, card_univ, smul_eq_mul, mul_comm] theorem physical_shared_error_uniform_bound (V : G → ℝ) {v Pmin T : ℝ} (hv : 0 < v) (hPmin : 0 < Pmin) (hT : 0 ≤ T) (hV : ∀ g, v ≤ V g) : (∑ g : G, (J - (C g).card : ℕ) * T / (V g * Pmin)) ≤ (Fintype.card G : ℝ) * J * T / (v * Pmin) := by calc _ ≤ ∑ _g : G, (J : ℝ) * T / (v * Pmin) := by apply sum_le_sum intro g _ apply div_le_div₀ (mul_nonneg (Nat.cast_nonneg _) hT) (mul_le_mul_of_nonneg_right (by exact_mod_cast Nat.sub_le J (C g).card) hT) (mul_pos hv hPmin) (mul_le_mul_of_nonneg_right (hV g) hPmin.le) _ = _ := by simp only [sum_const, card_univ, nsmul_eq_mul]; ring theorem physical_shared_half_overlap_bound {H : ℝ} (hH : 0 ≤ H) : H + H / (1 / 2 : ℝ) ^ (2 * ∑ g : G, (J - (C g).card)) ≤ 2 * H * (4 : ℝ) ^ (J * Fintype.card G) := by have hp : (4 : ℝ) ^ (∑ g : G, (J - (C g).card)) ≤ 4 ^ (J * Fintype.card G) := pow_le_pow_right₀ (by norm_num) (physical_shared_count_le C) have h1 : (1 : ℝ) ≤ 4 ^ (J * Fintype.card G) := one_le_pow₀ (by norm_num) have he : H / (1 / 2 : ℝ) ^ (2 * ∑ g : G, (J - (C g).card)) = H * 4 ^ (∑ g : G, (J - (C g).card)) := by simp only [one_div, inv_pow, div_inv_eq_mul, pow_mul] norm_num rw [he] nlinarith [mul_le_mul_of_nonneg_left hp hH, mul_le_mul_of_nonneg_left h1 hH] end end Bounty end section /- Explicit energy budgets control the replacement of a harmonic endpoint pair. -/ open Finset namespace Bounty theorem finite_replacement_energy {ι : Type*} (S : Finset ι) (f f' : ι → ℂ) : (∑ n ∈ S, ‖f' n‖ ^ 2) ≤ 2 * ((∑ n ∈ S, ‖f n‖ ^ 2) + ∑ n ∈ S, ‖f n - f' n‖ ^ 2) := by calc _ ≤ ∑ n ∈ S, 2 * (‖f n‖ ^ 2 + ‖f n - f' n‖ ^ 2) := by apply sum_le_sum intro n _ have hn : ‖f' n‖ ≤ ‖f n‖ + ‖f n - f' n‖ := by calc _ = ‖f n - (f n - f' n)‖ := by congr 1; ring _ ≤ _ := norm_sub_le _ _ have hs := pow_le_pow_left₀ (norm_nonneg _) hn 2 nlinarith [sq_nonneg (‖f n‖ - ‖f n - f' n‖)] _ = _ := by rw [← mul_sum, sum_add_distrib] theorem finite_harmonic_replacement_energy_bound (S : Finset ℤ) (θ f g f' g' : ℤ → ℂ) {Y K E D : ℝ} (hY : 0 < Y) (hK : 0 ≤ K) (hYlow : ∀ n ∈ S, Y ≤ (n : ℝ)) (hθ : ∀ n ∈ S, ‖θ n‖ ≤ K) (hf : (∑ n ∈ S, ‖f n‖ ^ 2) ≤ E) (hg : (∑ n ∈ S, ‖g n‖ ^ 2) ≤ E) (hff : (∑ n ∈ S, ‖f n - f' n‖ ^ 2) ≤ D) (hgg : (∑ n ∈ S, ‖g n - g' n‖ ^ 2) ≤ D) : ‖(∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (f n) * g n) - (∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (f' n) * g' n)‖ ≤ (K/Y) * (Real.sqrt D * Real.sqrt E + Real.sqrt (2*(E+D)) * Real.sqrt D) := by apply (finite_harmonic_endpoint_replacement S θ f g f' g' hY hK hYlow hθ).trans apply mul_le_mul_of_nonneg_left _ (div_nonneg hK hY.le) apply add_le_add · exact mul_le_mul (Real.sqrt_le_sqrt hff) (Real.sqrt_le_sqrt hg) (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) · have hf' := (finite_replacement_energy S f f').trans (mul_le_mul_of_nonneg_left (add_le_add hf hff) (by norm_num : (0 : ℝ) ≤ 2)) exact mul_le_mul (Real.sqrt_le_sqrt hf') (Real.sqrt_le_sqrt hgg) (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) end Bounty end section /- A prescribed ledger sequence with the actual event updates gives the exact local phase product on the original dependent path. -/ open Finset namespace Bounty section Product variable {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) (phase : ∀ k, L → (x : X) → E k x → ℂ) theorem deterministic_ledger_phase_eq_product (ks : List K) (x : X) (p : FiniteEventPath E target ks x) (l : Fin (ks.length + 1) → L) (hstep : ∀ i : Fin ks.length, update (ks.get i) (l i.castSucc) (finiteEventPathOccurrence E target ks x p i).1 (finiteEventPathOccurrence E target ks x p i).2 = l i.succ) : deterministicLedgerPhase E target update phase ks (l 0) x p = ∏ i : Fin ks.length, phase (ks.get i) (l i.castSucc) (finiteEventPathOccurrence E target ks x p i).1 (finiteEventPathOccurrence E target ks x p i).2 := by induction ks generalizing x with | nil => simp only [deterministicLedgerPhase, List.length_nil, Fin.prod_univ_zero] | cons k ks ih => rcases p with ⟨e, p⟩ have h0 : update k (l 0) x e = l (Fin.succ 0) := hstep 0 have ht := ih (target k x e) p (fun i => l i.succ) (fun i => hstep i.succ) calc _ = phase k (l 0) x e * deterministicLedgerPhase E target update phase ks (l (Fin.succ 0)) (target k x e) p := by rw [deterministicLedgerPhase, h0] _ = phase k (l 0) x e * ∏ i : Fin ks.length, phase (ks.get i) (l i.castSucc.succ) (finiteEventPathOccurrence E target ks (target k x e) p i).1 (finiteEventPathOccurrence E target ks (target k x e) p i).2 := congrArg (phase k (l 0) x e * ·) ht _ = _ := (Fin.prod_univ_succ (fun i : Fin (ks.length + 1) => phase ((k :: ks).get i) (l i.castSucc) (finiteEventPathOccurrence E target (k :: ks) x ⟨e, p⟩ i).1 (finiteEventPathOccurrence E target (k :: ks) x ⟨e, p⟩ i).2)).symm end Product end Bounty end section /- Explicit coefficient cost and support of the finite cell expansion. -/ open Finset open scoped Classical namespace Bounty theorem prime_cell_coefficient_norm {I : Type*} [Fintype I] (P : I → Finset ℕ) (V : I → ℝ) (h : ℝ) (d : ℤ) {ξ : ℝ} (hξ : 0 < ξ) (hd : ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell h (Real.log (∏ i, (z i).val : ℕ))) d) : ‖((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell h (Real.log (∏ i, (z i).val : ℕ))) d : ℝ) : ℂ)‖ ≤ 1/ξ := by rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (one_div_pos.mpr (hξ.trans_le hd))] exact one_div_le_one_div_of_le hξ hd theorem prime_cell_expansion_cost {I : Type*} [Fintype I] (P : I → Finset ℕ) (V : I → ℝ) (Q : ℕ) (h : ℝ) (kept : Finset ℤ) {ξ : ℝ} (hξ : 0 < ξ) (hkept : ∀ d ∈ kept, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell h (Real.log (∏ i, (z i).val : ℕ))) d) : (∑ d ∈ kept, ∑ _χ : BoundedPrimitiveCharacter Q, ‖((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell h (Real.log (∏ i, (z i).val : ℕ))) d : ℝ) : ℂ)‖) ≤ (kept.card : ℝ) * (Q * Q : ℕ) / ξ := by calc _ ≤ ∑ _d ∈ kept, ∑ _χ : BoundedPrimitiveCharacter Q, 1/ξ := by apply sum_le_sum intro d hd exact sum_le_sum (fun _ _ => prime_cell_coefficient_norm P V h d hξ (hkept d hd)) _ = (kept.card : ℝ) * (Fintype.card (BoundedPrimitiveCharacter Q) : ℝ) / ξ := by simp only [sum_const, card_univ, nsmul_eq_mul] ring _ ≤ _ := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left (Nat.cast_le.mpr (bounded_primitive_character_card_le Q)) (Nat.cast_nonneg _)) hξ.le theorem prime_cell_character_mem {I : Type*} [Fintype I] (P : I → Finset ℕ) (h : ℝ) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (x : ∀ i, P i) (hx : primeProductCellCharacter P h d χ x ≠ 0) : upperLogCell h (Real.log (∏ i, (x i).val : ℕ)) = d := by by_contra he exact hx (by simp only [primeProductCellCharacter, if_neg he]) end Bounty end section /- Each term separates both free-product variables from the two endpoints. -/ open Finset open scoped Classical namespace Bounty theorem prime_ideal_kernel_pair_cell_expansion {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] (P : I → Finset ℕ) (V : I → ℝ) (R : J → Finset ℕ) (W : J → ℝ) (Q : ℕ) (h : ℝ) (keptP keptR : Finset ℤ) (x u : ∀ i, P i) (y v : ∀ j, R j) : let a := fun d => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell h (Real.log (∏ i, (z i).val : ℕ))) d : ℝ) : ℂ) let b := fun e => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := R) W)) (fun z => upperLogCell h (Real.log (∏ j, (z j).val : ℕ))) e : ℝ) : ℂ) primeProductIdealKernel P V Q h keptP x u * primeProductIdealKernel R W Q h keptR y v = ∑ d ∈ keptP, ∑ χ : BoundedPrimitiveCharacter Q, ∑ e ∈ keptR, ∑ ψ : BoundedPrimitiveCharacter Q, (a d*b e) * ((starRingEnd ℂ) (primeProductCellCharacter P h d χ x) * (starRingEnd ℂ) (primeProductCellCharacter R h e ψ y)) * (primeProductCellCharacter R h e ψ v * primeProductCellCharacter P h d χ u) := by dsimp only rw [prime_ideal_kernel_cell_expansion, prime_ideal_kernel_cell_expansion] simp only [sum_mul] simp only [mul_sum] apply sum_congr rfl intro d _ apply sum_congr rfl intro χ _ apply sum_congr rfl intro e _ apply sum_congr rfl intro ψ _ ring end Bounty end section /- Two deterministic phases agree when their local updates agree on the states supported by the original nonzero path phase. -/ namespace Bounty theorem deterministic_ledger_phase_eq_on_support {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (supportPhase : ∀ k x, E k x → ℂ) (Q : X → Prop) (hQ : ∀ k x e, Q x → supportPhase k x e ≠ 0 → Q (target k x e)) (u v : ∀ k, L → (x : X) → E k x → L) (hu : ∀ k l x e, Q x → supportPhase k x e ≠ 0 → u k l x e = v k l x e) (f g : ∀ k, L → (x : X) → E k x → ℂ) (hf : ∀ k l x e, Q x → supportPhase k x e ≠ 0 → f k l x e = g k l x e) (ks : List K) (l : L) (x : X) (p : FiniteEventPath E target ks x) (hx : Q x) (hp : finiteEventLocalPhase E target supportPhase ks x p ≠ 0) : deterministicLedgerPhase E target u f ks l x p = deterministicLedgerPhase E target v g ks l x p := by induction ks generalizing l x with | nil => rfl | cons k ks ih => rcases p with ⟨e, p⟩ change supportPhase k x e * finiteEventLocalPhase E target supportPhase ks (target k x e) p ≠ 0 at hp obtain ⟨he, hp⟩ := mul_ne_zero_iff.mp hp change f k l x e * deterministicLedgerPhase E target u f ks (u k l x e) (target k x e) p = g k l x e * deterministicLedgerPhase E target v g ks (v k l x e) (target k x e) p rw [hf k l x e hx he, hu k l x e hx he, ih _ _ _ (hQ k x e hx he) hp] end Bounty end section /- Parseval turns the total energy terms into exact coefficient sums. Only the first endpoint needs a major-arc energy estimate. -/ open Finset MeasureTheory open scoped ComplexConjugate namespace Bounty theorem finite_fourier_major_energy (S T : Finset ℤ) (f g : ℤ → ℂ) (m : ℝ → ℂ) (hmcont : Continuous m) (B : Set ℝ) (hB : MeasurableSet B) {ε : ℝ} (hε : 0 ≤ ε) (hm : ∀ x, ‖m x‖ ≤ 1) (hminor : ∀ x, x ∉ B → ‖m x‖ ≤ ε) : ‖∫ x in (0 : ℝ)..1, conj (finiteFourierSum S f x)*finiteFourierSum T g x*m x‖ ≤ Real.sqrt (ε^2*(∑ n ∈ S, ‖f n‖^2) + ∫ x in B ∩ Set.Ioc 0 1, ‖finiteFourierSum S f x‖^2) * Real.sqrt (∑ n ∈ T, ‖g n‖^2) := by have hmem (u : ℝ → ℂ) (hu : Continuous u) : MemLp u 2 (volume.restrict (Set.Ioc (0 : ℝ) 1)) := by apply (memLp_two_iff_integrable_sq_norm hu.aestronglyMeasurable).mpr exact (hu.norm.pow 2).integrableOn_Ioc have hf := continuous_finiteFourierSum S f have hg := continuous_finiteFourierSum T g have hp := multiplier_pairing_major_energy (volume.restrict (Set.Ioc (0 : ℝ) 1)) (finiteFourierSum S f) (finiteFourierSum T g) m B hB hε hm hminor (hmem _ hf) (hmem _ hg) (hmem _ (hmcont.star.mul hf)) have heF : (∫ x in Set.Ioc (0 : ℝ) 1, ‖finiteFourierSum S f x‖^2) = ∑ n ∈ S, ‖f n‖^2 := by rw [← intervalIntegral.integral_of_le zero_le_one, finiteFourierSum_energy_one] have heG : (∫ x in Set.Ioc (0 : ℝ) 1, ‖finiteFourierSum T g x‖^2) = ∑ n ∈ T, ‖g n‖^2 := by rw [← intervalIntegral.integral_of_le zero_le_one, finiteFourierSum_energy_one] rw [Measure.restrict_restrict hB, heF, heG] at hp simpa only [intervalIntegral.integral_of_le zero_le_one] using hp end Bounty end section /- Major arcs for -k*theta have rational centers and a common width; their numerators are bounded on the unit interval. -/ namespace Bounty section variable {k : ℤ} {L q U V θ : ℝ} (hk : k ≠ 0) (hU : 0 < U) (hV : 0 < V) (hscale : L^q ≤ U*V) (hθ : θ ∈ Set.Icc (0 : ℝ) 1) (hmajor : θ ∈ productMajorArcSet k L q U V) include k L q U V θ hk hU hV hscale hθ hmajor theorem product_major_arc_geometry : ∃ (u : ℤ) (r : ℕ), 0 < r ∧ r ≤ ⌊L^q⌋₊ ∧ |(u : ℝ)| ≤ (r : ℝ)*(|(k : ℝ)|+1) ∧ |θ - (-(u : ℝ)/((k : ℝ)*r))| ≤ L^q/(|(k : ℝ)| * (U*V)) := by obtain ⟨u, r, hr, hrb, hclose⟩ := hmajor have hr0 : (0 : ℝ) < r := by exact_mod_cast hr have hk0 : (k : ℝ) ≠ 0 := by exact_mod_cast hk have hUV := mul_pos hU hV have he : |(-k : ℝ)*θ-(u : ℝ)/r| ≤ 1 := by apply le_of_mul_le_mul_right _ hUV simpa only [one_mul] using hclose.trans hscale have hθabs : |θ| ≤ 1 := by rw [abs_of_nonneg hθ.1]; exact hθ.2 have hn : |(u : ℝ)/r| ≤ |(k : ℝ)|+1 := by calc _ = |(-k : ℝ)*θ - ((-k : ℝ)*θ-(u : ℝ)/r)| := by congr 1; ring _ ≤ |(-k : ℝ)*θ| + |(-k : ℝ)*θ-(u : ℝ)/r| := abs_sub _ _ _ ≤ |(k : ℝ)| * 1+1 := by rw [abs_mul, abs_neg] exact add_le_add (mul_le_mul_of_nonneg_left hθabs (abs_nonneg _)) he _ = _ := by ring refine ⟨u, r, hr, hrb, ?_, ?_⟩ · rw [abs_div, abs_of_pos hr0] at hn have hz := (div_le_iff₀ hr0).mp hn nlinarith · have heq : (-k : ℝ)*θ-(u : ℝ)/r = (-k : ℝ)*(θ - (-(u : ℝ)/((k : ℝ)*r))) := by field_simp ring rw [heq, abs_mul, abs_neg] at hclose apply (le_div_iff₀ (mul_pos (abs_pos.mpr hk0) hUV)).mpr nlinarith theorem product_major_arc_finite_cover : ∃ (r : ℕ) (u : ℤ), r ∈ Finset.Icc 1 ⌊L^q⌋₊ ∧ u ∈ Finset.Icc (-((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℤ)) ((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℤ) ∧ |θ - (-(u : ℝ)/((k : ℝ)*r))| ≤ L^q/(|(k : ℝ)| * (U*V)) := by obtain ⟨u, r, hr, hrb, hu, hclose⟩ := product_major_arc_geometry hk hU hV hscale hθ hmajor have hrR : (r : ℝ) ≤ (⌊L^q⌋₊ : ℝ) := by exact_mod_cast hrb have hkabs : (k.natAbs : ℝ) = |(k : ℝ)| := by calc (k.natAbs : ℝ) = ((k.natAbs : ℤ) : ℝ) := by simp only [Int.cast_natCast] _ = ((|k| : ℤ) : ℝ) := congrArg (fun z : ℤ => (z : ℝ)) (Int.natCast_natAbs k) _ = |(k : ℝ)| := Int.cast_abs have huR : |(u : ℝ)| ≤ (⌊L^q⌋₊*(k.natAbs+1) : ℕ) := by calc _ ≤ (r : ℝ)*(|(k : ℝ)|+1) := hu _ ≤ (⌊L^q⌋₊ : ℝ)*(|(k : ℝ)|+1) := mul_le_mul_of_nonneg_right hrR (by positivity) _ = _ := by push_cast; rw [hkabs] refine ⟨r, u, Finset.mem_Icc.mpr ⟨hr, hrb⟩, Finset.mem_Icc.mpr ⟨?_, ?_⟩, hclose⟩ · exact_mod_cast (abs_le.mp huR).1 · apply (Int.cast_le (R := ℝ)).mp simpa only [Int.cast_natCast] using (abs_le.mp huR).2 end end Bounty end section /- A retained four-dimensional dyadic box has comparable product size at every point, even beyond the original output-support boundary. -/ open Finset namespace Bounty theorem four_dyadic_product_bounds (D A B C : Finset ℕ) (hD : ∀ n ∈ D, 0 < n) (hA : ∀ n ∈ A, 0 < n) (hB : ∀ n ∈ B, 0 < n) (hC : ∀ n ∈ C, 0 < n) {i j k l d a b c : ℕ} (hd : d ∈ dyadicNatBucket D i) (ha : a ∈ dyadicNatBucket A j) (hb : b ∈ dyadicNatBucket B k) (hc : c ∈ dyadicNatBucket C l) : let X := (2 : ℝ)^i * 2^j * 2^k * 2^l X ≤ (d*a*b*c : ℕ) ∧ ((d*a*b*c : ℕ) : ℝ) ≤ 16*X := by obtain ⟨hdl, hdu⟩ := dyadicNatBucket_bounds D hD hd obtain ⟨hal, hau⟩ := dyadicNatBucket_bounds A hA ha obtain ⟨hbl, hbu⟩ := dyadicNatBucket_bounds B hB hb obtain ⟨hcl, hcu⟩ := dyadicNatBucket_bounds C hC hc have hlo : 2^i*2^j*2^k*2^l ≤ d*a*b*c := Nat.mul_le_mul (Nat.mul_le_mul (Nat.mul_le_mul hdl hal) hbl) hcl have hhi : d*a*b*c ≤ 16*(2^i*2^j*2^k*2^l) := by calc _ ≤ 2^(i+1)*2^(j+1)*2^(k+1)*2^(l+1) := Nat.mul_le_mul (Nat.mul_le_mul (Nat.mul_le_mul hdu.le hau.le) hbu.le) hcu.le _ = _ := by simp only [pow_succ]; ring constructor · exact_mod_cast hlo · exact_mod_cast hhi section variable (S D A B C : Finset ℕ) (hD : ∀ n ∈ D, 0 < n) (hA : ∀ n ∈ A, 0 < n) (hB : ∀ n ∈ B, 0 < n) (hC : ∀ n ∈ C, 0 < n) {U V : ℝ} (hS : ∀ n ∈ S, U ≤ (n : ℝ) ∧ (n : ℝ) ≤ V) {i j k l : ℕ} (hbox : ∃ d ∈ dyadicNatBucket D i, ∃ a ∈ dyadicNatBucket A j, ∃ b ∈ dyadicNatBucket B k, ∃ c ∈ dyadicNatBucket C l, d*a*b*c ∈ S) include S D A B C hD hA hB hC U V hS i j k l hbox theorem retained_four_dyadic_scale : let X := (2 : ℝ)^i * 2^j * 2^k * 2^l U/16 ≤ X ∧ X ≤ V := by obtain ⟨d,hd,a,ha,b,hb,c,hc,hm⟩ := hbox have hp := four_dyadic_product_bounds D A B C hD hA hB hC hd ha hb hc have hs := hS _ hm dsimp only at hp ⊢ constructor <;> linarith [hp.1, hp.2, hs.1, hs.2] theorem retained_four_dyadic_product_bounds {d a b c : ℕ} (hd : d ∈ dyadicNatBucket D i) (ha : a ∈ dyadicNatBucket A j) (hb : b ∈ dyadicNatBucket B k) (hc : c ∈ dyadicNatBucket C l) : U/16 ≤ ((d*a*b*c : ℕ) : ℝ) ∧ ((d*a*b*c : ℕ) : ℝ) ≤ 16*V := by have hs := retained_four_dyadic_scale S D A B C hD hA hB hC hS hbox have hp := four_dyadic_product_bounds D A B C hD hA hB hC hd ha hb hc dsimp only at hs hp constructor <;> linarith [hs.1, hs.2, hp.1, hp.2] end end Bounty end section open MeasureTheory namespace Bounty theorem weighted_mean_tail_bound (F : ℝ → ℝ) (hF : Continuous F) (hF0 : ∀ t, 0 ≤ F t) {L h A B : ℝ} (hL : 1 ≤ L) (hh : 0 < h) (hB : 0 ≤ B) (M : ℕ) (hwi : Integrable (fun t : ℝ => (1+|h*t|)^(-((M+2:ℕ):ℝ))*F t)) (hmean : ∀ T : ℝ, 0 < T → (∫ t in Set.Icc (-T) T, F t) ≤ A*T+B) : (∫ t in {t : ℝ | L/h < |t|}, (1+|h*t|)^(-((M+2:ℕ):ℝ))*F t) ≤ (4*A*(L/h)+2*B)*L^(-(M:ℝ)) := by let f : ℝ → ℝ := fun t => (1+|h*t|)^(-((M+2:ℕ):ℝ))*F t have hLp : 0 < L := lt_of_lt_of_le zero_lt_one hL have hR : 0 < L/h := div_pos hLp hh have hf0 : ∀ t, 0 ≤ f t := fun t => mul_nonneg (Real.rpow_nonneg (by positivity) _) (hF0 t) have hsumm : Summable (fun n : ℕ => ∫ t in dyadicAbsShell (L/h) n, f t) := (hasSum_integral_iUnion (dyadic_abs_shell_measurable (L/h)) (dyadic_abs_shell_disjoint hR) hwi.integrableOn).summable have hgeo : HasSum (fun n : ℕ => (1/2:ℝ)^n) 2 := by have hg := hasSum_geometric_of_norm_lt_one (by norm_num : ‖(1/2:ℝ)‖<1) norm_num at hg exact hg have hbound (n : ℕ) : (∫ t in dyadicAbsShell (L/h) n, f t) ≤ (L^(-(M:ℝ))*(2*A*(L/h)+B))*(1/2:ℝ)^n := by let T : ℝ := (2:ℝ)^(n+1)*(L/h) have hT : 0 < T := by dsimp [T]; positivity have hsub : dyadicAbsShell (L/h) n ⊆ Set.Icc (-T) T := by intro t ht exact abs_le.1 ht.2.le have hFi : IntegrableOn F (Set.Icc (-T) T) := hF.integrableOn_Icc have hbase : (∫ t in dyadicAbsShell (L/h) n, f t) ≤ (L^(-(M:ℝ))*(1/4:ℝ)^n)*(A*T+B) := by calc _ ≤ ∫ t in dyadicAbsShell (L/h) n, (L^(-(M:ℝ))*(1/4:ℝ)^n)*F t := by apply setIntegral_mono_on hwi.integrableOn ((hFi.mono_set hsub).const_mul _) (dyadic_abs_shell_measurable (L/h) n) intro t ht exact mul_le_mul_of_nonneg_right (dyadic_decay_weight_le hL hh n M ht) (hF0 t) _ = (L^(-(M:ℝ))*(1/4:ℝ)^n)*(∫ t in dyadicAbsShell (L/h) n, F t) := integral_const_mul _ _ _ ≤ (L^(-(M:ℝ))*(1/4:ℝ)^n)*(∫ t in Set.Icc (-T) T, F t) := by apply mul_le_mul_of_nonneg_left _ (by positivity) exact setIntegral_mono_set hFi (Filter.Eventually.of_forall hF0) (Filter.Eventually.of_forall hsub) _ ≤ _ := mul_le_mul_of_nonneg_left (hmean T hT) (by positivity) have heq : (1/4:ℝ)^n*(2:ℝ)^(n+1) = 2*(1/2:ℝ)^n := by rw [pow_succ] calc _ = ((1/4:ℝ)*2)^n*2 := by rw [mul_pow]; ring _ = _ := by norm_num; ring have hquarter : (1/4:ℝ)^n ≤ (1/2:ℝ)^n := pow_le_pow_left₀ (by norm_num) (by norm_num) n calc _ ≤ (L^(-(M:ℝ))*(1/4:ℝ)^n)*(A*T+B) := hbase _ = L^(-(M:ℝ))*(2*A*(L/h)*(1/2:ℝ)^n+B*(1/4:ℝ)^n) := by dsimp [T] calc _ = L^(-(M:ℝ))*(A*(L/h)*((1/4:ℝ)^n*2^(n+1))+B*(1/4:ℝ)^n) := by ring _ = _ := by rw [heq]; ring _ ≤ L^(-(M:ℝ))*(2*A*(L/h)*(1/2:ℝ)^n+B*(1/2:ℝ)^n) := by gcongr _ = _ := by ring calc _ ≤ ∫ t in {t : ℝ | L/h ≤ |t|}, f t := by exact setIntegral_mono_set hwi.integrableOn (Filter.Eventually.of_forall hf0) (Filter.Eventually.of_forall (fun t (ht : L/h < |t|) => ht.le)) _ = ∑' n : ℕ, ∫ t in dyadicAbsShell (L/h) n, f t := integral_dyadic_abs_shells hR hwi _ ≤ ∑' n : ℕ, (L^(-(M:ℝ))*(2*A*(L/h)+B))*(1/2:ℝ)^n := hsumm.tsum_le_tsum hbound (hgeo.summable.mul_left _) _ = _ := by rw [tsum_mul_left, hgeo.tsum_eq]; ring end Bounty end section /- A single rational major region contains all active product dyad regions. -/ open MeasureTheory namespace Bounty theorem product_major_arc_cell_subset {L q U V HA HB : ℝ} (hL : 4 ≤ L) (hscale : HA*HB ≤ 4*(U*V)) (k : ℤ) : productMajorArcSet k L q U V ⊆ productMajorArcSet k L (q+1) HA HB := by intro θ hθ obtain ⟨u,r,hr,hrq,hθ⟩ := hθ have hL0 : 0 < L := by linarith have hpow : L^q ≤ L^(q+1) := Real.rpow_le_rpow_of_exponent_le (by linarith) (by linarith) refine ⟨u,r,hr,hrq.trans (Nat.floor_mono hpow), ?_⟩ calc _ ≤ |(-k : ℝ)*θ-(u : ℝ)/r| * (4*(U*V)) := mul_le_mul_of_nonneg_left hscale (abs_nonneg _) _ = 4*(|(-k : ℝ)*θ-(u : ℝ)/r| *(U*V)) := by ring _ ≤ 4*L^q := mul_le_mul_of_nonneg_left hθ (by norm_num) _ ≤ L*L^q := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le q) _ = L^(q+1) := by rw [Real.rpow_add hL0, Real.rpow_one]; ring end Bounty end section /- Integration of translated averages with almost-everywhere shifted energy bounds. -/ open MeasureTheory namespace Bounty theorem integrated_translate_average_square_ae (μ ν : Measure ℝ) [IsFiniteMeasure μ] [SFinite ν] {κ P : ℝ → ℂ} {M B : ℝ} (c : ℝ) (hκc : Continuous κ) (hκi : Integrable κ ν) (hP : Continuous P) (hM : 0 ≤ M) (hPM : ∀ s, ‖P s‖ ≤ M) (hB : ∀ᵐ u ∂ν, (∫ s, ‖P (s+c*u)‖^2 ∂μ) ≤ B) : Integrable (fun s => ‖∫ u, κ u * P (s+c*u) ∂ν‖^2) μ ∧ (∫ s, ‖∫ u, κ u * P (s+c*u) ∂ν‖^2 ∂μ) ≤ (∫ u, ‖κ u‖ ∂ν)^2 * B := by let A := ∫ u, ‖κ u‖ ∂ν have hA : 0 ≤ A := integral_nonneg (fun u => norm_nonneg _) have hc : Continuous (fun p : ℝ × ℝ => κ p.2 * P (p.1+c*p.2)) := by fun_prop have hm : StronglyMeasurable (fun s => ∫ u, κ u * P (s+c*u) ∂ν) := hc.stronglyMeasurable.integral_prod_right' have hEb (s : ℝ) : ‖∫ u, κ u * P (s+c*u) ∂ν‖ ≤ A*M := by change _ ≤ (∫ u, ‖κ u‖ ∂ν)*M rw [← integral_mul_const] apply norm_integral_le_of_norm_le (hκi.norm.mul_const M) filter_upwards [] with u rw [norm_mul] exact mul_le_mul_of_nonneg_left (hPM _) (norm_nonneg _) have hEi : Integrable (fun s => ‖∫ u, κ u * P (s+c*u) ∂ν‖^2) μ := by apply (integrable_const ((A*M)^2)).mono' (hm.norm.pow 2).aestronglyMeasurable filter_upwards [] with s change ‖‖∫ u, κ u * P (s+c*u) ∂ν‖^2‖ ≤ (A*M)^2 rw [Real.norm_of_nonneg (sq_nonneg _)] exact pow_le_pow_left₀ (norm_nonneg _) (hEb s) 2 have hQc : Continuous (fun p : ℝ × ℝ => ‖κ p.2‖ * ‖P (p.1+c*p.2)‖^2) := by fun_prop have hQi : Integrable (fun p : ℝ × ℝ => ‖κ p.2‖ * ‖P (p.1+c*p.2)‖^2) (μ.prod ν) := by apply ((hκi.norm.mul_const (M^2)).comp_snd μ).mono' hQc.aestronglyMeasurable filter_upwards [] with p rw [Real.norm_of_nonneg (mul_nonneg (norm_nonneg _) (sq_nonneg _))] exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) (hPM _) 2) (norm_nonneg _) have hpoint (s : ℝ) : ‖∫ u, κ u * P (s+c*u) ∂ν‖^2 ≤ A * ∫ u, ‖κ u‖ * ‖P (s+c*u)‖^2 ∂ν := (bounded_weighted_integral_square hκi (by fun_prop) hM (fun u => hPM _)).2 refine ⟨hEi, ?_⟩ calc _ ≤ ∫ s, A * (∫ u, ‖κ u‖ * ‖P (s+c*u)‖^2 ∂ν) ∂μ := integral_mono hEi (hQi.integral_prod_left.const_mul A) hpoint _ = A * ∫ u, (∫ s, ‖κ u‖ * ‖P (s+c*u)‖^2 ∂μ) ∂ν := by rw [integral_const_mul, integral_integral_swap hQi] _ ≤ A * ∫ u, ‖κ u‖ * B ∂ν := by apply mul_le_mul_of_nonneg_left _ hA apply integral_mono_ae hQi.integral_prod_right (hκi.norm.mul_const B) filter_upwards [hB] with u hu change (∫ s, ‖κ u‖ * ‖P (s+c*u)‖^2 ∂μ) ≤ ‖κ u‖ * B rw [integral_const_mul] exact mul_le_mul_of_nonneg_left hu (norm_nonneg _) _ = _ := by rw [integral_mul_const]; dsimp [A]; ring end Bounty end section /- The actual Q-zero prime character factor, with the product window retained. -/ open Finset Filter namespace Bounty theorem candidate_Q_zero_character_window_split (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) (S : Finset ℕ) {d : ℕ} (χ : DirichletCharacter ℂ d) (h : ℕ) (G : ℕ → ℂ) : (∑ n ∈ S.filter (fun n => n.Coprime h), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod d) * G n) = (1 / (((r.factorial : ℝ)^(candidateQIndices c L).card) : ℂ)) * ∑ y : ∀ slot, candidateQRestChoices c L r jStar hr slot, if (orderedSlotProduct (candidateQRestChoices c L r jStar hr) y).Coprime h then χ (orderedSlotProduct (candidateQRestChoices c L r jStar hr) y : ZMod d) * ∑ p ∈ ((candidateQBand (c*L) 0).filter (fun p => p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y ∈ S)).filter (fun p => p.Coprime h), χ (p : ZMod d) * G (p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y) else 0 := by classical rw [show (∑ n ∈ S.filter (fun n => n.Coprime h), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod d) * G n) = ∑ n ∈ S.filter (fun n => n.Coprime h), (candidateQWeight c L r jStar n : ℂ) * (χ (n : ZMod d) * G n) by apply sum_congr rfl; intro n _; ring] rw [candidate_Q_zero_complex_window_split c L r jStar hr hj] rw [sum_comm, mul_sum] apply sum_congr rfl intro y _ by_cases hR : (orderedSlotProduct (candidateQRestChoices c L r jStar hr) y).Coprime h · rw [if_pos hR] simp only [sum_filter, mul_sum] apply sum_congr rfl intro p _ by_cases hp : p.Coprime h · by_cases hS : p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y ∈ S · have hm : p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y ∈ S.filter (fun n => n.Coprime h) := mem_filter.mpr ⟨hS, Nat.coprime_mul_iff_left.mpr ⟨hp, hR⟩⟩ rw [if_pos hm, if_pos hp, if_pos hS] simp only [Nat.cast_mul, map_mul] ring · have hm : p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y ∉ S.filter (fun n => n.Coprime h) := fun hm => hS (mem_filter.mp hm).1 rw [if_neg hm, if_neg hS] simp · have hm : p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y ∉ S.filter (fun n => n.Coprime h) := fun hm => hp (Nat.coprime_mul_iff_left.mp (mem_filter.mp hm).2).1 rw [if_neg hm, if_neg hp] simp · rw [if_neg hR, mul_zero] apply sum_eq_zero intro p _ have hm : p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y ∉ S.filter (fun n => n.Coprime h) := fun hm => hR (Nat.coprime_mul_iff_left.mp (mem_filter.mp hm).2).2 exact if_neg hm end Bounty end section /- Signed asymmetric comparison bounds for the actual averaged, coupled group tests. -/ namespace Bounty open Finset open scoped Classical noncomputable def finiteGroupedTailTest {G : Type*} [Fintype G] [DecidableEq G] {I X : G → Type*} [∀ g, DecidableEq (I g)] [∀ g, Fintype (X g)] (μ : ∀ g, X g → ℝ) (tails : ∀ g, Finset (I g)) (f : (∀ g, I g → X g) → ℂ) : (∀ a : Sigma I, X a.1) → ℂ := finiteCoordinateComponent (fun a : Sigma I => μ a.1) ∅ (univ.sigma tails).toList (finiteGroupFlattenFunction f) end Bounty end section /- The physical edge with every target list and auxiliary draw is one unified full-state row. Its globally extended phase is bounded everywhere. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def physicalFullLedgerRow : Option (I ⊕ K) → (FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) → FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ := fullMixedLedgerRow (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) (fun j H x e => physicalFullGlobalEdgePhase (C j) (k j) H (ω j) (fun g p => β g p / V g) ρ V x e) ω (fun g p => β g p / V g) retention ρ V end Physical end Bounty end section /- The full active edge has the same auxiliary draw and ordered event choices at both memory caps. Its exact weighted transport keeps arbitrary event-dependent tests and both total-memory restrictions. -/ open Finset Classical namespace Bounty section variable {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) {b B : ℕ} (h : b ≤ B) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b) def fullActiveEdgeEventCapEquiv : FullActiveEdgeEvent n S b A Δ D s ≃ FullActiveEdgeEvent n S B A Δ D (productStateCapEmbed h s) := Equiv.refl _ theorem fullActiveEdgeEventTarget_cap_of_weight_ne_zero [Fintype G] (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (e : FullActiveEdgeEvent n S b A Δ D s) (hw : fullActiveEdgeEventWeight n S b A Δ D ω μ ρ V s e ≠ 0) : productStateCapEmbed h (fullActiveEdgeEventTarget n S b A Δ D s e) = fullActiveEdgeEventTarget n S B A Δ D (productStateCapEmbed h s) (fullActiveEdgeEventCapEquiv n S A Δ D h s e) := by unfold fullActiveEdgeEventWeight at hw have he := unrestrictedJointEventTarget_cap_of_weight_ne_zero n (Δ (productActiveMemorySplit S b s).1 e.1) (D (productActiveMemorySplit S b s).1 e.1) μ ρ V (fun g => (S g)ᶜ.card) h (productActiveMemorySplit S b s).2 e.2 (mul_ne_zero_iff.mp hw).2 exact congrArg (fun y => (productActiveMemorySplit S B).symm ((productActiveMemorySplit S b s).1, y)) he theorem fullActiveEdgeEventWeight_cap [Fintype G] (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (hs : productTotalMemory s ≤ b) (e : FullActiveEdgeEvent n S b A Δ D s) : fullActiveEdgeEventWeight n S b A Δ D ω μ ρ V s e = if productTotalMemory (fullActiveEdgeEventTarget n S B A Δ D (productStateCapEmbed h s) (fullActiveEdgeEventCapEquiv n S A Δ D h s e)) ≤ b then fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V (productStateCapEmbed h s) (fullActiveEdgeEventCapEquiv n S A Δ D h s e) else 0 := by have hs' : productTotalMemory (productActiveMemorySplit S b s).2 ≤ b := by rwa [productActiveMemorySplit_total_memory] have hw := unrestrictedJointCutoffEventWeight_cap n (Δ (productActiveMemorySplit S b s).1 e.1) (D (productActiveMemorySplit S b s).1 e.1) μ ρ V (fun g => (S g)ᶜ.card) h (productActiveMemorySplit S b s).2 hs' e.2 have hm := congrArg (fun z : ℝ => ω (productActiveMemorySplit S b s).1 e.1 * z) hw rw [fullActiveEdgeEventTarget_total] simp only [mul_ite, mul_zero] at hm exact hm end end Bounty end section /- Exact phased path transport from nonzero source events to selected target events, requiring the event bijections only on a preserved source invariant. -/ open Finset Classical namespace Bounty universe uK uX uY uE uF noncomputable def finiteSupportedPathPhase {K : Type uK} {X : Type uX} {Y : Type uY} (E : K → X → Type uE) (F : K → Y → Type uF) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (w : ∀ k x, E k x → ℝ) (Q : ∀ k y, F k y → Prop) (e : X → Y) (P : X → Prop) (closed : ∀ k x, P x → ∀ a : FiniteNonzeroEvent E w k x, P (t k x a.val)) (δ : ∀ k x, P x → FiniteNonzeroEvent E w k x ≃ FiniteSelectedEvent F Q k (e x)) (ht : ∀ k x (hx : P x) a, e (t k x a.val) = u k (e x) (δ k x hx a).val) (ks : List K) (phase : ∀ y, FiniteEventPath F u ks y → ℂ) (x : X) (p : FiniteEventPath E t ks x) : ℂ := if hx : P x then if hp : finiteEventPathWeight E t w ks x p ≠ 0 then phase (e x) (finiteSelectedPathForget F u Q ks (e x) (finiteInvariantPathEquiv (FiniteNonzeroEvent E w) (FiniteSelectedEvent F Q) (finiteNonzeroTarget E t w) (finiteSelectedTarget F u Q) e P closed δ ht ks x hx (finiteNonzeroPathLift E t w ks x p hp))) else 0 else 0 theorem finite_supported_path_action_transport {K : Type uK} {X : Type uX} {Y : Type uY} (E : K → X → Type uE) (F : K → Y → Type uF) [∀ k x, Fintype (E k x)] [∀ k y, Fintype (F k y)] (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (w : ∀ k x, E k x → ℝ) (v : ∀ k y, F k y → ℝ) (Q : ∀ k y, F k y → Prop) (e : X → Y) (P : X → Prop) (closed : ∀ k x, P x → ∀ a : FiniteNonzeroEvent E w k x, P (t k x a.val)) (δ : ∀ k x, P x → FiniteNonzeroEvent E w k x ≃ FiniteSelectedEvent F Q k (e x)) (ht : ∀ k x (hx : P x) a, e (t k x a.val) = u k (e x) (δ k x hx a).val) (hw : ∀ k x (hx : P x) a, v k (e x) (δ k x hx a).val = w k x a.val) (ks : List K) (phase : ∀ y, FiniteEventPath F u ks y → ℂ) (f : Y → ℂ) (x : X) (hx : P x) : finiteEventPathAction E t w ks (finiteSupportedPathPhase E F t u w Q e P closed δ ht ks phase) (fun x => f (e x)) x = finiteEventPathAction F u v ks (fun y p => if FiniteEventPathSelected F u Q ks y p then phase y p else 0) f (e x) := by let _ : ∀ k x, Fintype (FiniteNonzeroEvent E w k x) := finiteNonzeroEventFintype E w let _ : ∀ k y, Fintype (FiniteSelectedEvent F Q k y) := finiteSelectedEventFintype F Q rw [finite_event_path_action_nonzero, finite_event_path_action_selected] have h := finite_invariant_path_action_equiv (FiniteNonzeroEvent E w) (FiniteSelectedEvent F Q) (finiteNonzeroTarget E t w) (finiteSelectedTarget F u Q) e P closed δ ht (fun k x a => w k x a.val) (fun k y a => v k y a.val) hw ks (fun y p => phase y (finiteSelectedPathForget F u Q ks y p)) f x hx convert h using 1 unfold finiteEventPathAction apply Finset.sum_congr rfl intro p _ simp only [finiteSupportedPathPhase, dif_pos hx, dif_pos (finite_nonzero_path_weight_ne_zero E t w ks x p), finite_nonzero_path_lift_forget] end Bounty end section /- An exact local-event representation of a path-maximum mask. Selecting nonzero event weights removes only zero summands, so arbitrary signed real weights and arbitrary complex phases are allowed. The initial state is assumed to satisfy the same height bound as subsequent states. -/ open Finset Classical namespace Bounty universe uK uX uE def finiteSafeEventPredicate {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (height : X → ℕ) (b : ℕ) (k : K) (x : X) (a : E k x) : Prop := w k x a ≠ 0 ∧ height (t k x a) ≤ b section variable {K : Type uK} {X : Type uX} (E : K → X → Type uE) include K X E theorem finite_event_path_initial_le_maximum (t : ∀ k x, E k x → X) (height : X → ℕ) (ks : List K) (x : X) (p : FiniteEventPath E t ks x) : height x ≤ finiteEventPathMaximum E t height ks x p := by cases ks with | nil => exact le_rfl | cons k ks => rcases p with ⟨a, p⟩ exact le_max_left _ _ theorem finite_safe_path_selected_iff (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (height : X → ℕ) (b : ℕ) (ks : List K) (x : X) (hx : height x ≤ b) (p : FiniteEventPath E t ks x) : FiniteEventPathSelected E t (finiteSafeEventPredicate E t w height b) ks x p ↔ finiteEventPathWeight E t w ks x p ≠ 0 ∧ finiteEventPathMaximum E t height ks x p ≤ b := by induction ks generalizing x with | nil => simp only [FiniteEventPathSelected, finiteEventPathWeight, finiteEventPathMaximum, ne_eq, one_ne_zero, not_false_eq_true, true_and, hx] | cons k ks ih => rcases p with ⟨a, p⟩ change ((w k x a ≠ 0 ∧ height (t k x a) ≤ b) ∧ FiniteEventPathSelected E t (finiteSafeEventPredicate E t w height b) ks (t k x a) p) ↔ w k x a * finiteEventPathWeight E t w ks (t k x a) p ≠ 0 ∧ max (height x) (finiteEventPathMaximum E t height ks (t k x a) p) ≤ b constructor · rintro ⟨⟨ha, hy⟩, hp⟩ obtain ⟨hw, hm⟩ := (ih (t k x a) hy p).mp hp exact ⟨mul_ne_zero ha hw, max_le hx hm⟩ · rintro ⟨hw, hm⟩ have htail := (max_le_iff.mp hm).2 have hy := (finite_event_path_initial_le_maximum E t height ks (t k x a) p).trans htail exact ⟨⟨(mul_ne_zero_iff.mp hw).1, hy⟩, (ih (t k x a) hy p).mpr ⟨(mul_ne_zero_iff.mp hw).2, htail⟩⟩ /- Masking by the full path maximum is exactly the action over events whose weight is nonzero and whose target height remains at most b. -/ theorem finite_event_path_action_safe [∀ k x, Fintype (E k x)] (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (height : X → ℕ) (b : ℕ) (ks : List K) (phase : ∀ x, FiniteEventPath E t ks x → ℂ) (f : X → ℂ) (x : X) (hx : height x ≤ b) : let Q := finiteSafeEventPredicate E t w height b let _ : ∀ k x, Fintype (FiniteSelectedEvent E Q k x) := finiteSelectedEventFintype E Q finiteEventPathAction E t w ks (fun x p => if finiteEventPathMaximum E t height ks x p ≤ b then phase x p else 0) f x = finiteEventPathAction (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) (fun k x a => w k x a.val) ks (fun x p => phase x (finiteSelectedPathForget E t Q ks x p)) f x := by let Q := finiteSafeEventPredicate E t w height b let _ : ∀ k x, Fintype (FiniteSelectedEvent E Q k x) := finiteSelectedEventFintype E Q refine Eq.trans ?_ (finite_event_path_action_selected E t Q w ks phase f x) unfold finiteEventPathAction apply sum_congr rfl intro p _ change (finiteEventPathWeight E t w ks x p : ℂ) * (if finiteEventPathMaximum E t height ks x p ≤ b then phase x p else 0) * f (finiteEventPathTerminal E t ks x p) = (finiteEventPathWeight E t w ks x p : ℂ) * (if FiniteEventPathSelected E t (finiteSafeEventPredicate E t w height b) ks x p then phase x p else 0) * f (finiteEventPathTerminal E t ks x p) rw [finite_safe_path_selected_iff E t w height b ks x hx p] by_cases hw : finiteEventPathWeight E t w ks x p = 0 · simp only [hw, Complex.ofReal_zero, zero_mul] · simp only [hw, ne_eq, not_false_eq_true, true_and] end end Bounty end section /- The primitive bilinear large sieve with an arbitrary finite dyadic prefix cutoff. -/ open Finset namespace Bounty theorem sum_nat_image_intCast {E : Type*} [AddCommMonoid E] (S : Finset ℕ) (f : ℤ → E) : (∑ z ∈ S.image (fun n : ℕ => (n : ℤ)), f z) = ∑ n ∈ S, f (n : ℤ) := sum_image (fun _ _ _ _ h => Int.ofNat.inj h) theorem multiplicative_large_sieve_bilinear_nat (Q : Finset ℕ) {D R N M : ℝ} (hD : 0 < D) (hR : 1 ≤ R) (hQD : ∀ q ∈ Q, D ≤ (q : ℝ)) (hQR : ∀ q ∈ Q, (q : ℝ) ≤ R) (S T : Finset ℕ) (a b : ℕ → ℂ) (hN : 0 ≤ N) (hM : 0 ≤ M) (hS : ∀ n ∈ S, (n : ℝ) ≤ N) (hT : ∀ n ∈ T, (n : ℝ) ≤ M) : (∑ q ∈ Q, 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖∑ n ∈ S, a n * χ (n : ZMod q)‖ * ‖∑ n ∈ T, b n * χ (n : ZMod q)‖) ≤ ((6 + 8 * Real.pi) / D) * Real.sqrt ((N + R ^ 2) * (M + R ^ 2) * (∑ n ∈ S, ‖a n‖ ^ 2) * ∑ n ∈ T, ‖b n‖ ^ 2) := by have hS' : ∀ z ∈ S.image (fun n : ℕ => (n : ℤ)), |(z : ℝ)| ≤ N := by intro z hz obtain ⟨n, hn, rfl⟩ := mem_image.mp hz simpa only [Int.cast_natCast, abs_of_nonneg (show (0 : ℝ) ≤ n from Nat.cast_nonneg n)] using hS n hn have hT' : ∀ z ∈ T.image (fun n : ℕ => (n : ℤ)), |(z : ℝ)| ≤ M := by intro z hz obtain ⟨n, hn, rfl⟩ := mem_image.mp hz simpa only [Int.cast_natCast, abs_of_nonneg (show (0 : ℝ) ≤ n from Nat.cast_nonneg n)] using hT n hn have h := multiplicative_large_sieve_bilinear_conductors Q hD hR hQD hQR (S.image (fun n : ℕ => (n : ℤ))) (T.image (fun n : ℕ => (n : ℤ))) (fun z => a z.toNat) (fun z => b z.toNat) hN hM hS' hT' simpa only [sum_nat_image_intCast, Int.toNat_natCast, Int.cast_natCast] using h noncomputable def primitiveCharacterBlockNorm (Q : Finset ℕ) (F : (q : ℕ) → DirichletCharacter ℂ q → ℂ) : ℝ := ∑ q ∈ Q, 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖F q χ‖ theorem primitiveCharacterBlockNorm_zero (Q : Finset ℕ) : primitiveCharacterBlockNorm Q 0 = 0 := by simp [primitiveCharacterBlockNorm] theorem primitiveCharacterBlockNorm_add_le (Q : Finset ℕ) (F G : (q : ℕ) → DirichletCharacter ℂ q → ℂ) : primitiveCharacterBlockNorm Q (F + G) ≤ primitiveCharacterBlockNorm Q F + primitiveCharacterBlockNorm Q G := by unfold primitiveCharacterBlockNorm rw [← sum_add_distrib] apply sum_le_sum intro q hq rw [← mul_add, ← sum_add_distrib] apply mul_le_mul_of_nonneg_left _ (by positivity) apply sum_le_sum intro χ hχ exact norm_add_le (F q χ) (G q χ) theorem character_rectangle_factor (A B : Finset ℕ) (a b : ℕ → ℂ) (q : ℕ) (χ : DirichletCharacter ℂ q) : (∑ m ∈ A, ∑ n ∈ B, a m * b n * χ ((m * n : ℕ) : ZMod q)) = (∑ m ∈ A, a m * χ (m : ZMod q)) * ∑ n ∈ B, b n * χ (n : ZMod q) := by rw [sum_mul] apply sum_congr rfl intro m hm rw [mul_sum] apply sum_congr rfl intro n hn rw [Nat.cast_mul, map_mul] ring theorem multiplicative_large_sieve_dyadic_prefix (Q : Finset ℕ) {D R N V : ℝ} (hD : 0 < D) (hR : 1 ≤ R) (hQD : ∀ q ∈ Q, D ≤ (q : ℝ)) (hQR : ∀ q ∈ Q, (q : ℝ) ≤ R) (K : ℕ) (S : Finset ℕ) (κ : ℕ → ℕ) (hκ : ∀ m ∈ S, κ m ≤ 2 ^ K) (a b : ℕ → ℂ) (hN : 0 ≤ N) (hV : 0 ≤ V) (hS : ∀ m ∈ S, (m : ℝ) ≤ N) (hcol : ∀ n ∈ range (2 ^ K), (n : ℝ) ≤ V) : (∑ q ∈ Q, 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖∑ m ∈ S, ∑ n ∈ range (κ m), a m * b n * χ ((m * n : ℕ) : ZMod q)‖) ≤ (K + 1 : ℝ) * ((6 + 8 * Real.pi) / D) * Real.sqrt ((N + R ^ 2) * (V + R ^ 2) * (∑ m ∈ S, ‖a m‖ ^ 2) * ∑ n ∈ range (2 ^ K), ‖b n‖ ^ 2) := by let F : ℕ → ℕ → (q : ℕ) → DirichletCharacter ℂ q → ℂ := fun m n q χ => a m * b n * χ ((m * n : ℕ) : ZMod q) have hfactor : 0 ≤ (N + R ^ 2) * (V + R ^ 2) := by positivity have hrect : ∀ A ⊆ S, ∀ B ⊆ range (2 ^ K), primitiveCharacterBlockNorm Q (∑ m ∈ A, ∑ n ∈ B, F m n) ≤ (((6 + 8 * Real.pi) / D) * Real.sqrt ((N + R ^ 2) * (V + R ^ 2))) * Real.sqrt ((∑ m ∈ A, ‖a m‖ ^ 2) * ∑ n ∈ B, ‖b n‖ ^ 2) := by intro A hA B hB have h := multiplicative_large_sieve_bilinear_nat Q hD hR hQD hQR A B a b hN hV (fun m hm => hS m (hA hm)) (fun n hn => hcol n (hB hn)) have heq : (N + R ^ 2) * (V + R ^ 2) * (∑ m ∈ A, ‖a m‖ ^ 2) * (∑ n ∈ B, ‖b n‖ ^ 2) = ((N + R ^ 2) * (V + R ^ 2)) * ((∑ m ∈ A, ‖a m‖ ^ 2) * ∑ n ∈ B, ‖b n‖ ^ 2) := by ring rw [heq, Real.sqrt_mul hfactor] at h simp only [primitiveCharacterBlockNorm, Finset.sum_apply, F] simp_rw [character_rectangle_factor, norm_mul] simpa only [mul_assoc] using h have h := dyadic_prefix_subadditive_bound K S κ hκ (fun m => ‖a m‖ ^ 2) (fun n => ‖b n‖ ^ 2) (fun m => sq_nonneg _) (fun n => sq_nonneg _) F (primitiveCharacterBlockNorm Q) (primitiveCharacterBlockNorm_zero Q) (primitiveCharacterBlockNorm_add_le Q) (by positivity) hrect have heq : (N + R ^ 2) * (V + R ^ 2) * (∑ m ∈ S, ‖a m‖ ^ 2) * (∑ n ∈ range (2 ^ K), ‖b n‖ ^ 2) = ((N + R ^ 2) * (V + R ^ 2)) * ((∑ m ∈ S, ‖a m‖ ^ 2) * ∑ n ∈ range (2 ^ K), ‖b n‖ ^ 2) := by ring rw [heq, Real.sqrt_mul hfactor] simpa only [primitiveCharacterBlockNorm, Finset.sum_apply, F, mul_assoc] using h end Bounty end section /- The exact candidate prime-remainder convolution in the original product window. -/ open Finset Filter namespace Bounty theorem arithmetic_product_window_mul_image {p : ℕ} (hp : p ≠ 0) (X : ℝ) : (arithmeticProductWindow p X).image (fun n => p * n) = (arithmeticProductWindow 1 X).filter (fun u => p ∣ u) := by classical ext u constructor · intro hu obtain ⟨n, hn, rfl⟩ := mem_image.mp hu apply mem_filter.mpr refine ⟨?_, dvd_mul_right p n⟩ apply (mem_arithmeticProductWindow_iff one_ne_zero X).mpr simpa only [one_mul] using (mem_arithmeticProductWindow_iff hp X).mp hn · intro hu obtain ⟨hu, hpu⟩ := mem_filter.mp hu refine mem_image.mpr ⟨u / p, ?_, Nat.mul_div_cancel' hpu⟩ apply (mem_arithmeticProductWindow_iff hp X).mpr rw [Nat.mul_div_cancel' hpu] simpa only [one_mul] using (mem_arithmeticProductWindow_iff one_ne_zero X).mp hu theorem arithmetic_product_window_divisor_test {p : ℕ} (hp : p ≠ 0) (X : ℝ) (b G : ℕ → ℂ) : (∑ u ∈ (arithmeticProductWindow 1 X).filter (fun u => p ∣ u), b (u / p) * G u) = ∑ n ∈ arithmeticProductWindow p X, b n * G (p * n) := by classical rw [← arithmetic_product_window_mul_image hp X, sum_image] · apply sum_congr rfl intro n _ rw [Nat.mul_div_cancel_left n (Nat.pos_of_ne_zero hp)] · intro n _ m _ hnm exact Nat.eq_of_mul_eq_mul_left (Nat.pos_of_ne_zero hp) hnm theorem finite_divisor_convolution_window_test (P : Finset ℕ) (A b : ℕ → ℝ) (X : ℝ) (hp : ∀ p ∈ P, p ≠ 0) (hA : ∀ u ∈ arithmeticProductWindow 1 X, A u = ∑ p ∈ P.filter (fun p => p ∣ u), b (u / p)) (G : ℕ → ℂ) : (∑ u ∈ arithmeticProductWindow 1 X, (A u : ℂ) * G u) = ∑ p ∈ P, ∑ n ∈ arithmeticProductWindow p X, (b n : ℂ) * G (p * n) := by classical calc _ = ∑ u ∈ arithmeticProductWindow 1 X, ∑ p ∈ P, if p ∣ u then (b (u / p) : ℂ) * G u else 0 := by apply sum_congr rfl intro u hu rw [hA u hu, Complex.ofReal_sum, sum_mul, sum_filter] _ = ∑ p ∈ P, ∑ u ∈ arithmeticProductWindow 1 X, if p ∣ u then (b (u / p) : ℂ) * G u else 0 := sum_comm _ = _ := by apply sum_congr rfl intro p hpP rw [← sum_filter] exact arithmetic_product_window_divisor_test (hp p hpP) X (fun n => (b n : ℂ)) G theorem candidate_prime_remainder_complex_window {c L : ℝ} (hcL : 0 ≤ c * L) (q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) (G : ℕ → ℂ) : (∑ u ∈ arithmeticProductWindow 1 (Real.exp L), (candidateCoefficient c L q r jStar u : ℂ) * G u) = ∑ p ∈ candidateQBand (c * L) 0, ∑ n ∈ arithmeticProductWindow p (Real.exp L), (candidateRemainderCoefficient c L q r jStar hr n : ℂ) * G (p * n) := by apply finite_divisor_convolution_window_test · intro p hp exact (candidate_Q_zero_prime_outside_pool hcL hp).1.ne_zero · intro u _ exact candidate_coefficient_remainder_convolution_all hcL q r jStar hr hj u theorem candidate_prime_remainder_character_window {c L : ℝ} (hcL : 0 ≤ c * L) (q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) {d : ℕ} (χ : DirichletCharacter ℂ d) (h : ℕ) (G : ℕ → ℂ) : (∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime h), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod d) * G u) = ∑ p ∈ (candidateQBand (c * L) 0).filter (fun p => p.Coprime h), ∑ n ∈ (arithmeticProductWindow p (Real.exp L)).filter (fun n => n.Coprime h), (candidateRemainderCoefficient c L q r jStar hr n : ℂ) * χ (p : ZMod d) * χ (n : ZMod d) * G (p * n) := by classical calc _ = ∑ u ∈ arithmeticProductWindow 1 (Real.exp L), (candidateCoefficient c L q r jStar u : ℂ) * (if u.Coprime h then χ (u : ZMod d) * G u else 0) := by rw [sum_filter] apply sum_congr rfl intro u _ split_ifs <;> simp [mul_assoc] _ = ∑ p ∈ candidateQBand (c * L) 0, (1 : ℂ) * ∑ n ∈ arithmeticProductWindow p (Real.exp L), (candidateRemainderCoefficient c L q r jStar hr n : ℂ) * (if (p*n).Coprime h then χ (p*n : ZMod d) * G (p*n) else 0) := by simpa only [one_mul, Nat.cast_mul] using candidate_prime_remainder_complex_window hcL q r jStar hr hj (fun u => if u.Coprime h then χ (u : ZMod d) * G u else 0) _ = ∑ p ∈ (candidateQBand (c * L) 0).filter (fun p => p.Coprime h), (1 : ℂ) * χ (p : ZMod d) * ∑ n ∈ (arithmeticProductWindow p (Real.exp L)).filter (fun n => n.Coprime h), (candidateRemainderCoefficient c L q r jStar hr n : ℂ) * χ (n : ZMod d) * G (p*n) := by simpa only [Complex.ofReal_one] using complex_character_coprime_convolution (candidateQBand (c * L) 0) (fun p => arithmeticProductWindow p (Real.exp L)) (fun _ => 1) (candidateRemainderCoefficient c L q r jStar hr) G χ h _ = _ := by apply sum_congr rfl intro p _ rw [one_mul, mul_sum] apply sum_congr rfl intro n _ ring section variable {c L : ℝ} (hcL : 0 ≤ c * L) (q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) {d : ℕ} (χ : DirichletCharacter ℂ d) (h : ℕ) include c L hcL q r jStar hr hj d χ h theorem candidate_prime_remainder_character_cutoff (G : ℕ → ℂ) : (∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime h), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod d) * G u) = ∑ p ∈ (candidateQBand (c * L) 0).filter (fun p => p.Coprime h), ∑ n ∈ (Iic ⌊16 * Real.exp L⌋₊).filter (fun n => n.Coprime h), if Real.exp L < (p * n : ℕ) ∧ (p * n : ℕ) ≤ 16 * Real.exp L then (candidateRemainderCoefficient c L q r jStar hr n : ℂ) * χ (p : ZMod d) * χ (n : ZMod d) * G (p * n) else 0 := by classical rw [candidate_prime_remainder_character_window hcL q r jStar hr hj χ h G] apply sum_congr rfl intro p _ simp only [arithmeticProductWindow] rw [← sum_filter, filter_comm] theorem candidate_prime_remainder_character_cutoff_sum : (∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime h), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod d)) = ∑ p ∈ (candidateQBand (c * L) 0).filter (fun p => p.Coprime h), ∑ n ∈ (Iic ⌊16 * Real.exp L⌋₊).filter (fun n => n.Coprime h), if Real.exp L < (p * n : ℕ) ∧ (p * n : ℕ) ≤ 16 * Real.exp L then (candidateRemainderCoefficient c L q r jStar hr n : ℂ) * χ (p : ZMod d) * χ (n : ZMod d) else 0 := by simpa only [mul_one] using candidate_prime_remainder_character_cutoff hcL q r jStar hr hj χ h (fun _ => 1) theorem candidate_prime_remainder_character_masked : (∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime h), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod d)) = ∑ p ∈ candidateQBand (c * L) 0, ∑ n ∈ Iic ⌊16 * Real.exp L⌋₊, if Real.exp L < (p * n : ℕ) ∧ (p * n : ℕ) ≤ 16 * Real.exp L then (if p.Coprime h then (1 : ℂ) else 0) * (if n.Coprime h then (candidateRemainderCoefficient c L q r jStar hr n : ℂ) else 0) * χ ((p * n : ℕ) : ZMod d) else 0 := by classical rw [candidate_prime_remainder_character_cutoff_sum hcL q r jStar hr hj χ h] simp only [sum_filter] apply sum_congr rfl intro p _ by_cases hp : p.Coprime h · simp only [if_pos hp, one_mul] apply sum_congr rfl intro n _ split_ifs <;> simp_all [Nat.cast_mul, map_mul, mul_assoc] · simp only [if_neg hp, zero_mul, ite_self, sum_const_zero] theorem candidate_prime_remainder_character_positive_cutoff : (∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime h), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod d)) = ∑ p ∈ candidateQBand (c * L) 0, ∑ n ∈ Icc 1 ⌊16 * Real.exp L⌋₊, if Real.exp L < (p * n : ℕ) ∧ (p * n : ℕ) ≤ 16 * Real.exp L then (if p.Coprime h then (1 : ℂ) else 0) * (if n.Coprime h then (candidateRemainderCoefficient c L q r jStar hr n : ℂ) else 0) * χ ((p * n : ℕ) : ZMod d) else 0 := by classical rw [candidate_prime_remainder_character_masked hcL q r jStar hr hj χ h] apply sum_congr rfl intro p _ symm apply sum_subset · intro n hn exact mem_Iic.mpr (mem_Icc.mp hn).2 · intro n hn hnnot have hnzero : n = 0 := by simp only [mem_Iic, mem_Icc, not_and] at hn hnnot omega subst n simp only [Nat.mul_zero, Nat.cast_zero, not_lt.mpr (Real.exp_nonneg L), false_and, if_false] end end Bounty end section /- Auxiliary observations survive both the exact full-target continuation transport and the sum over every physical target list. -/ open Finset open scoped Classical namespace Bounty section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ω : ∀ _c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (F : PhysicalAuxLabels P C → FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) include hP hdis theorem physical_full_fixed_edge_observed_continuation (R : PhysicalMarkLists P J ell) : let n := fun g (p : ↥(P g)) => p.val let S := fun g => physicalFullSharedIndices (ell := ell) (C g) let A := fun _ : SharedActiveLabels (fun g => ↥(P g)) S => PhysicalAuxLabels P C let x := physicalFullMemoryState C L q let c := (productActiveMemorySplit S B x).1 (∑ aux : PhysicalAuxLabels P C, (ω c aux : ℂ) * if physicalListAdmissible C aux L R then jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) C k L R β ρ V aux) (physicalFullContinuation C R (F aux)) (fun g => (H g, boundedOrderedTupleToFinite (q g))) else 0) = ∑ e : PhysicalFullEdgeEvent C k x, (fullActiveEdgeEventWeight n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω (fun g p => β g p / V g) ρ V x e : ℂ) * physicalFullEdgePhase C k L R H q e * F e.1 (fullEdgeLedgerUpdate n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) H x e, fullActiveEdgeEventTarget n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x e) := by have h := physical_full_edge_auxiliary_observed_rows C k L R H q hP hdis β ρ V ω (fun aux => physicalFullContinuation C R (F aux)) refine h.trans ?_ apply sum_congr rfl intro e _ exact physical_full_edge_continuation_weighted C k L R H q ω (fun g p => β g p / V g) ρ V e (F e.1) theorem physical_full_all_endpoints_edge_observed_continuation : let n := fun g (p : ↥(P g)) => p.val let S := fun g => physicalFullSharedIndices (ell := ell) (C g) let A := fun _ : SharedActiveLabels (fun g => ↥(P g)) S => PhysicalAuxLabels P C let x := physicalFullMemoryState C L q let c := (productActiveMemorySplit S B x).1 (∑ R : PhysicalMarkLists P J ell, ∑ aux : PhysicalAuxLabels P C, (ω c aux : ℂ) * if physicalListAdmissible C aux L R then jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) C k L R β ρ V aux) (physicalFullContinuation C R (F aux)) (fun g => (H g, boundedOrderedTupleToFinite (q g))) else 0) = ∑ e : PhysicalFullEdgeEvent C k x, (fullActiveEdgeEventWeight n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω (fun g p => β g p / V g) ρ V x e : ℂ) * physicalFullEndpointPhase C k L H q ω (fun g p => β g p / V g) ρ V e * F e.1 (fullEdgeLedgerUpdate n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) H x e, fullActiveEdgeEventTarget n S B A (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x e) := by dsimp only simp_rw [physical_full_fixed_edge_observed_continuation C k L H q hP hdis β ρ V ω F] rw [sum_comm] apply sum_congr rfl intro e _ rw [← sum_mul, ← physical_full_endpoint_phase_weighted] end Physical end Bounty end section /- Exact reduction of the asymmetric full-coordinate pairing to its shared slices. -/ namespace Bounty open Finset open scoped Classical theorem finite_four_asymmetric_pairing_error_le {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ x, μ i x = 1) (S A B T : Finset I) (hSA : Disjoint S A) (hSB : Disjoint S B) (hST : Disjoint S T) (hAB : Disjoint A B) (hAT : Disjoint A T) (hBT : Disjoint B T) (hcover : S ∪ A ∪ B ∪ T = univ) (KA : (∀ i : A, X i.1) → (∀ i : A, X i.1) → ℂ) (KB : (∀ i : B, X i.1) → (∀ i : B, X i.1) → ℂ) (phase : (∀ i : S, X i.1) → (∀ i : A, X i.1) → (∀ i : B, X i.1) → ℂ) (f g : (∀ i, X i) → ℂ) (F : (∀ i : S, X i.1) → (∀ i : B, X i.1) → ℂ) (G : (∀ i : S, X i.1) → (∀ i : A, X i.1) → ℂ) (hf : ∀ x, f x = F (finiteCoordinateRestrict S x) (finiteCoordinateRestrict B x)) (hg : ∀ x, g x = G (finiteCoordinateRestrict S x) (finiteCoordinateRestrict A x)) (ε : ℝ) (hε : 0 ≤ ε) (herr : ∀ c, ‖finiteTwoKernelPairingError (finiteProductWeight (fun i : A => μ i.1)) (finiteProductWeight (fun i : B => μ i.1)) KA KB (phase c) (G c) (fun b => (starRingEnd ℂ) (F c b))‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun i : A => μ i.1)) (G c)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun i : B => μ i.1)) (F c))) : ‖cleanRawPairing (finiteProductWeight μ) (fun x => phase (finiteCoordinateRestrict S x) (finiteCoordinateRestrict A x) (finiteCoordinateRestrict B x)) f g - cleanKernelPairing (finiteProductWeight μ) (finiteAsymmetricKernel μ S A B (fun c a b => finiteTwoKernelAverage (finiteProductWeight (fun i : A => μ i.1)) (finiteProductWeight (fun i : B => μ i.1)) KA KB a b (phase c))) f g‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) g) := by let Y := (∀ i : S, X i.1) × (∀ i : A, X i.1) × (∀ i : B, X i.1) let Z := ∀ i : T, X i.1 let E : (∀ i, X i) ≃ Y × Z := (finiteFourPartitionEquiv S A B T hSA hSB hST hAB hAT hBT hcover).trans finiteFourPackEquiv let ρ := finiteProductWeight (fun i : S => μ i.1) let μA := finiteProductWeight (fun i : A => μ i.1) let μB := finiteProductWeight (fun i : B => μ i.1) let μT := finiteProductWeight (fun i : T => μ i.1) let w : Y → ℝ := fun x => ρ x.1 * μA x.2.1 * μB x.2.2 let f0 : Y → ℂ := fun x => F x.1 x.2.2 let g0 : Y → ℂ := fun x => G x.1 x.2.1 let k0 : Y → ℂ := fun x => phase x.1 x.2.1 x.2.2 let H := fun c a b => finiteTwoKernelAverage μA μB KA KB a b (phase c) let K0 := finiteThreeWayKernel μA μB H have hmA : ∑ a, μA a = 1 := finite_product_weight_sum_one _ (fun i => hmass i.1) have hmB : ∑ b, μB b = 1 := finite_product_weight_sum_one _ (fun i => hmass i.1) have hmT : ∑ t, μT t = 1 := finite_product_weight_sum_one _ (fun i => hmass i.1) have hw (p : Y × Z) : finiteProductWeight μ (E.symm p) = w p.1 * μT p.2 := by change finiteProductWeight μ (finiteFourPartitionFill S A B T hcover p.1.1 p.1.2.1 p.1.2.2 p.2) = _ rw [finite_product_weight_four_fill μ S A B T hSA hSB hST hAB hAT hBT hcover] have hfill (p : Y × Z) : E.symm p = finiteFourPartitionFill S A B T hcover p.1.1 p.1.2.1 p.1.2.2 p.2 := rfl have hsf (p : Y × Z) : f (E.symm p) = f0 p.1 := by rw [hf, hfill, finite_four_partition_fill_s, finite_four_partition_fill_b S A B T hcover hSB hAB] have hsg (p : Y × Z) : g (E.symm p) = g0 p.1 := by rw [hg, hfill, finite_four_partition_fill_s, finite_four_partition_fill_a S A B T hcover hSA] have hsk (p : Y × Z) : phase (finiteCoordinateRestrict S (E.symm p)) (finiteCoordinateRestrict A (E.symm p)) (finiteCoordinateRestrict B (E.symm p)) = k0 p.1 := by rw [hfill, finite_four_partition_fill_s, finite_four_partition_fill_a S A B T hcover hSA, finite_four_partition_fill_b S A B T hcover hSB hAB] have hsK (p q : Y × Z) : finiteAsymmetricKernel μ S A B H (E.symm p) (E.symm q) = (μT q.2 : ℂ) * K0 p.1 q.1 := by change finiteAsymmetricKernel μ S A B H (finiteFourPartitionFill S A B T hcover p.1.1 p.1.2.1 p.1.2.2 p.2) (finiteFourPartitionFill S A B T hcover q.1.1 q.1.2.1 q.1.2.2 q.2) = _ rw [finite_asymmetric_kernel_four_fill μ S A B T hSA hSB hST hAB hAT hBT hcover] dsimp only [K0, μA, μB, μT] unfold finiteThreeWayKernel split_ifs <;> push_cast <;> ring have hr : cleanRawPairing (finiteProductWeight μ) (fun x => phase (finiteCoordinateRestrict S x) (finiteCoordinateRestrict A x) (finiteCoordinateRestrict B x)) f g = cleanRawPairing w k0 f0 g0 := by rw [clean_raw_pairing_equiv E] simp only [hw, hsf, hsg, hsk] exact finite_independent_tail_raw_pairing w μT hmT k0 f0 g0 have hc : cleanKernelPairing (finiteProductWeight μ) (finiteAsymmetricKernel μ S A B H) f g = cleanKernelPairing w K0 f0 g0 := by rw [clean_kernel_pairing_equiv E] simp only [hw, hsf, hsg, hsK] exact finite_independent_tail_kernel_pairing w μT hmT K0 f0 g0 have hef : finiteWeightedEnergy (finiteProductWeight μ) f = finiteWeightedEnergy w f0 := by rw [finite_weighted_energy_equiv E] simp only [hw, hsf] exact finite_independent_tail_energy w μT hmT f0 have heg : finiteWeightedEnergy (finiteProductWeight μ) g = finiteWeightedEnergy w g0 := by rw [finite_weighted_energy_equiv E] simp only [hw, hsg] exact finite_independent_tail_energy w μT hmT g0 rw [hr, hc, hef, heg] exact finite_three_way_pairing_error_le ρ μA μB (fun x => prod_nonneg (fun i _ => hμ i.1 (x i))) (fun x => prod_nonneg (fun i _ => hμ i.1 (x i))) (fun x => prod_nonneg (fun i _ => hμ i.1 (x i))) hmA hmB KA KB phase F G ε hε herr end Bounty end section /- Positive rough-cell denominators and exact finite count-matched proxies. -/ open Finset Filter namespace Bounty theorem eventually_rough_logarithmic_cell_count_pos {a : ℝ} (ha : 0 < a) (S : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a * L) ≤ Y → 0 < (roughBand Y (Real.exp (L^(-S)) * Y) (Real.exp (Real.sqrt L))).card ∧ roughLogarithmicCellMainTerm L S Y / 2 ≤ ((roughBand Y (Real.exp (L^(-S)) * Y) (Real.exp (Real.sqrt L))).card : ℝ) ∧ ((roughBand Y (Real.exp (L^(-S)) * Y) (Real.exp (Real.sqrt L))).card : ℝ) ≤ (3/2 : ℝ) * roughLogarithmicCellMainTerm L S Y := by filter_upwards [eventually_rough_logarithmic_cell_count ha S 1, eventually_ge_atTop (2 : ℝ), eventually_ge_atTop (Real.log 2)] with L hcount hL hlog intro Y hY have hL0 : 0 < L := by linarith have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hC := primeEulerProductUpperConstant_pos have hM : 0 < roughLogarithmicCellMainTerm L S Y := (div_pos hY0 (by positivity)).trans_le (rough_logarithmic_cell_main_term_lower (by linarith) hlog hY0.le S) have hpow : L^(-(1 : ℝ)) ≤ (1/2 : ℝ) := by rw [Real.rpow_neg_one] simpa only [one_div] using one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 2) hL have h := (hcount Y hY).trans (mul_le_mul_of_nonneg_left hpow hM.le) have hb := abs_le.mp h have hpos : (0 : ℝ) < ((roughBand Y (Real.exp (L^(-S)) * Y) (Real.exp (Real.sqrt L))).card : ℝ) := by linarith refine ⟨by exact_mod_cast hpos, ?_, ?_⟩ <;> linarith theorem finite_cell_count_proxy {ι : Type*} (R I : Finset ι) (hI : I ⊆ R) (hR : 0 < R.card) : 0 ≤ (I.card : ℝ) / R.card ∧ (I.card : ℝ) / R.card ≤ 1 ∧ (∑ _n ∈ R, (I.card : ℝ) / R.card) = (I.card : ℝ) := by have hR0 : (0 : ℝ) < R.card := by exact_mod_cast hR have hcard : (I.card : ℝ) ≤ R.card := by exact_mod_cast card_le_card hI refine ⟨by positivity, (div_le_one hR0).mpr hcard, ?_⟩ simp only [sum_const, nsmul_eq_mul] field_simp end Bounty end section /- Converting polynomial losses at logarithmic scale to the wide prime supply. -/ open Filter namespace Bounty /- Every sufficiently large logarithmic scale covers every sufficiently large real scale after exponentiation. -/ theorem wide_smooth_supply_of_exponential_scale (hS : ∀ δ : ℝ, 0 < δ → δ < 1 / 4 → ∀ σ : ℝ, 0 < σ → ∀ᶠ L : ℝ in atTop, ∃ P : Finset ℕ, P ⊆ primeBand (2 * Real.exp L) (33 * Real.exp L) ∧ Real.exp ((1 - σ) * L) ≤ (P.card : ℝ) ∧ ∀ p ∈ P, ∀ q : ℕ, q.Prime → q ∣ p - 1 → (q : ℝ) ≤ Real.exp (δ * L)) : WideSmoothShiftedPrimeSupply := by intro δ hδ hδsmall σ hσ filter_upwards [Real.tendsto_log_atTop.eventually (hS δ hδ hδsmall σ hσ), eventually_gt_atTop (0 : ℝ)] with x hPx hx obtain ⟨P, hP, hcard, hsmooth⟩ := hPx rw [Real.exp_log hx] at hP refine ⟨P, hP, ?_, ?_⟩ · calc x ^ (1 - σ) = Real.exp ((1 - σ) * Real.log x) := by rw [Real.rpow_def_of_pos hx, mul_comm] _ ≤ (P.card : ℝ) := hcard · intro p hp q hq hdiv calc (q : ℝ) ≤ Real.exp (δ * Real.log x) := hsmooth p hp q hq hdiv _ = x ^ δ := by rw [Real.rpow_def_of_pos hx, mul_comm] end Bounty end section /- Nonprincipal character cancellation from the actual rough residue-class counts. -/ open Finset namespace Bounty theorem nonprincipal_character_sum_le_class_errors {r : ℕ} [NeZero r] (S : Finset ℕ) (χ : DirichletCharacter ℂ r) (hχ : χ ≠ 1) {M E : ℝ} (hE : 0 ≤ E) (hclass : ∀ a : ZMod r, IsUnit a → |((S.filter (fun n : ℕ => (n : ZMod r) = a)).card : ℝ) - M| ≤ E) : ‖∑ n ∈ S, χ (n : ZMod r)‖ ≤ (r : ℝ) * E := by classical let C : ZMod r → ℝ := fun a => ((S.filter (fun n : ℕ => (n : ZMod r) = a)).card : ℝ) have hfiber : (∑ n ∈ S, χ (n : ZMod r)) = ∑ a : ZMod r, (C a : ℂ) * χ a := by simpa only [C, sum_const, nsmul_eq_mul, Complex.ofReal_natCast] using (sum_fiberwise' S (fun n : ℕ => (n : ZMod r)) χ).symm have hzero : (∑ a : ZMod r, χ a) = 0 := MulChar.sum_eq_zero_of_ne_one hχ have hrepr : (∑ n ∈ S, χ (n : ZMod r)) = ∑ a : ZMod r, ((C a - M : ℝ) : ℂ) * χ a := by rw [hfiber] simp only [Complex.ofReal_sub, sub_mul, sum_sub_distrib, ← mul_sum, hzero, mul_zero, sub_zero] rw [hrepr] calc _ ≤ ∑ a : ZMod r, ‖((C a - M : ℝ) : ℂ) * χ a‖ := norm_sum_le _ _ _ ≤ ∑ _a : ZMod r, E := by apply sum_le_sum intro a _ by_cases ha : IsUnit a · rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] exact (mul_le_mul_of_nonneg_left (χ.norm_le_one a) (abs_nonneg _)).trans (by simpa only [mul_one] using hclass a ha) · rw [MulChar.map_nonunit χ ha, mul_zero, norm_zero] exact hE _ = (r : ℝ) * E := by simp [ZMod.card] theorem exists_rough_interval_character_bound : ∃ K : ℝ, 0 < K ∧ ∀ (A B r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), χ ≠ 1 → ∀ {z : ℝ} {h : ℕ}, 1 < z → A ≤ B → (∀ p ∈ r.primeFactors, (p : ℝ) ≤ z) → 1 ≤ h → Even h → ‖∑ n ∈ (Ioc A B).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ)), χ (n : ZMod r)‖ ≤ (r : ℝ) * ((((B : ℝ) - A) / r.totient) * (∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ))) * K * Real.exp (-(h : ℝ)) + z^(4 * (h : ℝ) + 2)) := by obtain ⟨K, hK, hcount⟩ := exists_unit_residue_rough_count refine ⟨K, hK, ?_⟩ intro A B r hr χ hχ z h hz hAB hpf hh heven have hrpos : 0 < r := Nat.pos_of_ne_zero (NeZero.ne r) have hV : 0 ≤ ∏ p ∈ primeBand 0 z, (1 - 1 / (p : ℝ)) := (finite_prime_avoidance_product_pos _ (fun _ hp => small_prime_pool_prime hp)).le apply nonprincipal_character_sum_le_class_errors _ χ hχ · have hlen : 0 ≤ (B : ℝ) - A := sub_nonneg.mpr (Nat.cast_le.mpr hAB) positivity · intro a ha have hu : a.val.Coprime r := (ZMod.isUnit_iff_coprime a.val r).mp (by simpa using ha) have hbound := hcount A B r a.val hz hAB hrpos hu hpf hh heven have hset : ((Ioc A B).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ))).filter (fun n : ℕ => (n : ZMod r) = a) = (Ioc A B).filter (fun n : ℕ => n % r = a.val % r ∧ ∀ p ∈ n.primeFactors, z < (p : ℝ)) := by rw [filter_filter] apply filter_congr intro n _ have hres : (n : ZMod r) = a ↔ n % r = a.val % r := by conv_lhs => rhs; rw [← ZMod.natCast_zmod_val a] exact ZMod.natCast_eq_natCast_iff' n a.val r rw [hres, and_comm] simpa only [hset] using hbound end Bounty end section /- Finite-prime Chinese remainder counting with an arbitrary base modulus. -/ open Finset namespace Bounty noncomputable def natPairSieveResidues (m : ℕ) (A : Finset (ℕ × ℕ)) (P : Finset ℕ) (B : ℕ → Finset (ℕ × ℕ)) : Finset (ℕ × ℕ) := by classical exact (Finset.product (range (m * ∏ p ∈ P, p)) (range (m * ∏ p ∈ P, p))).filter (fun v => (v.1 % m, v.2 % m) ∈ A ∧ ∀ p ∈ P, (v.1 % p, v.2 % p) ∈ B p) theorem nat_pair_sieve_residues_bounds (m : ℕ) (A : Finset (ℕ × ℕ)) (P : Finset ℕ) (B : ℕ → Finset (ℕ × ℕ)) {v : ℕ × ℕ} (hv : v ∈ natPairSieveResidues m A P B) : v.1 < m * ∏ p ∈ P, p ∧ v.2 < m * ∏ p ∈ P, p := by have h := (mem_filter.mp hv).1 simpa only [Finset.product_eq_sprod, mem_product, mem_range] using h theorem nat_pair_sieve_residues_mod (m : ℕ) (A : Finset (ℕ × ℕ)) (P : Finset ℕ) (B : ℕ → Finset (ℕ × ℕ)) (hN : 0 < m * ∏ p ∈ P, p) (v : ℕ × ℕ) : (v.1 % (m * ∏ p ∈ P, p), v.2 % (m * ∏ p ∈ P, p)) ∈ natPairSieveResidues m A P B ↔ (v.1 % m, v.2 % m) ∈ A ∧ ∀ p ∈ P, (v.1 % p, v.2 % p) ∈ B p := by classical have hm : m ∣ m * ∏ p ∈ P, p := dvd_mul_right _ _ have hp : ∀ p ∈ P, p ∣ m * ∏ q ∈ P, q := by intro p hp exact (dvd_prod_of_mem (fun q : ℕ => q) hp).trans (dvd_mul_left _ _) simp only [natPairSieveResidues, mem_filter, Finset.product_eq_sprod, mem_product, mem_range, Nat.mod_lt _ hN, and_self, true_and, Nat.mod_mod_of_dvd _ hm] apply and_congr_right intro _ apply forall_congr' intro p apply imp_congr_right intro hpP rw [Nat.mod_mod_of_dvd _ (hp p hpP), Nat.mod_mod_of_dvd _ (hp p hpP)] theorem nat_pair_sieve_residues_card (m : ℕ) (hm : 0 < m) (A : Finset (ℕ × ℕ)) (hA : ∀ v ∈ A, v.1 < m ∧ v.2 < m) (P : Finset ℕ) (B : ℕ → Finset (ℕ × ℕ)) (hP : ∀ p ∈ P, p.Prime) (hPm : ∀ p ∈ P, ¬p ∣ m) (hB : ∀ p ∈ P, ∀ v ∈ B p, v.1 < p ∧ v.2 < p) : (natPairSieveResidues m A P B).card = A.card * ∏ p ∈ P, (B p).card := by classical induction P using Finset.induction_on with | empty => have heq : natPairSieveResidues m A ∅ B = A := by ext v simp only [natPairSieveResidues, prod_empty, mul_one, mem_filter, Finset.product_eq_sprod, mem_product, mem_range, notMem_empty, false_implies, forall_const, and_true] constructor · rintro ⟨⟨hv1, hv2⟩, hv⟩ simpa only [Nat.mod_eq_of_lt hv1, Nat.mod_eq_of_lt hv2, Prod.mk.eta] using hv · intro hv obtain ⟨hv1, hv2⟩ := hA v hv exact ⟨⟨hv1, hv2⟩, by simpa only [Nat.mod_eq_of_lt hv1, Nat.mod_eq_of_lt hv2, Prod.mk.eta] using hv⟩ simp only [heq, prod_empty, mul_one] | @insert p P hpnot ih => have hp := hP p (mem_insert_self _ _) have hP' : ∀ q ∈ P, q.Prime := fun q hq => hP q (mem_insert_of_mem hq) have hPm' : ∀ q ∈ P, ¬q ∣ m := fun q hq => hPm q (mem_insert_of_mem hq) have hB' : ∀ q ∈ P, ∀ v ∈ B q, v.1 < q ∧ v.2 < q := fun q hq => hB q (mem_insert_of_mem hq) have hN : 0 < m * ∏ q ∈ P, q := mul_pos hm (prod_pos (fun q hq => (hP' q hq).pos)) have hmp : m.Coprime p := (hp.coprime_iff_not_dvd.mpr (hPm p (mem_insert_self _ _))).symm have hprod : (∏ q ∈ P, q).Coprime p := by apply Nat.Coprime.prod_left intro q hq apply (Nat.coprime_primes (hP' q hq) hp).mpr intro heq exact hpnot (heq ▸ hq) have hcop : (m * ∏ q ∈ P, q).Coprime p := hmp.mul_left hprod have hcard := nat_residue_pair_crt_card (m * ∏ q ∈ P, q) p hN hp.pos hcop (natPairSieveResidues m A P B) (B p) (fun _ hv => nat_pair_sieve_residues_bounds m A P B hv) (hB p (mem_insert_self _ _)) have hperiod : m * ∏ q ∈ insert p P, q = (m * ∏ q ∈ P, q) * p := by rw [prod_insert hpnot] ring have heq : natPairSieveResidues m A (insert p P) B = (Finset.product (range ((m * ∏ q ∈ P, q)*p)) (range ((m * ∏ q ∈ P, q)*p))).filter (fun v : ℕ × ℕ => (v.1 % (m * ∏ q ∈ P, q), v.2 % (m * ∏ q ∈ P, q)) ∈ natPairSieveResidues m A P B ∧ (v.1 % p, v.2 % p) ∈ B p) := by conv_lhs => unfold natPairSieveResidues rw [hperiod] apply filter_congr intro v _ rw [nat_pair_sieve_residues_mod m A P B hN v] simp only [mem_insert, forall_eq_or_imp] tauto rw [heq, hcard, ih hP' hPm' hB', prod_insert hpnot] ring end Bounty end section /- A uniform Euler-product bound for the pair sieve with arbitrary local flags. -/ open Finset namespace Bounty theorem pair_sieve_local_factor_le {p : ℕ} (hp : 3 ≤ p) (rough banned : Bool) : 1 - pairSieveDensity p rough banned ≤ (if rough then (1 - 1/(p : ℝ))^2 else 1) * (if banned then (1 - 1/(p : ℝ)) else 1) * (1 + 2/(p : ℝ)^2) := by have hpR : (3 : ℝ) ≤ p := Nat.cast_le.mpr hp have hp0 : (0 : ℝ) < p := by linarith have ha : 0 ≤ 1 - 1/(p : ℝ) := sub_nonneg.mpr ((div_le_one hp0).mpr (by linarith)) have hc : (1 : ℝ) ≤ 1 + 2/(p : ℝ)^2 := le_add_of_nonneg_right (by positivity) cases rough <;> cases banned · simpa [pairSieveDensity] using hc · simpa using pair_sieve_banned_factor_le hp · rw [pair_sieve_unbanned_rough_factor p (by omega)] simpa using mul_le_mul_of_nonneg_left hc (sq_nonneg (1 - 1/(p : ℝ))) · calc _ ≤ (1 - 1/(p : ℝ))^3 := pair_sieve_banned_rough_factor_le hp _ = (1 - 1/(p : ℝ))^2 * (1 - 1/(p : ℝ)) := by ring _ ≤ _ := by simpa using mul_le_mul_of_nonneg_left hc (mul_nonneg (sq_nonneg _) ha) theorem pair_sieve_euler_product_le (P : Finset ℕ) (hP : ∀ p ∈ P, 3 ≤ p) (rough banned : ℕ → Bool) : (∏ p ∈ P, (1 - pairSieveDensity p (rough p) (banned p))) ≤ 4 * (∏ p ∈ P.filter (fun p => rough p = true), (1 - 1/(p : ℝ)))^2 * (∏ p ∈ P.filter (fun p => banned p = true), (1 - 1/(p : ℝ))) := by let a := fun p : ℕ => 1 - 1/(p : ℝ) have ha : ∀ p ∈ P, 0 ≤ a p := by intro p hp have hpR : (3 : ℝ) ≤ p := Nat.cast_le.mpr (hP p hp) exact sub_nonneg.mpr ((div_le_one (by linarith)).mpr (by linarith)) have hbound : (∏ p ∈ P, (1 - pairSieveDensity p (rough p) (banned p))) ≤ (∏ p ∈ P, (if rough p then (a p)^2 else 1) * (if banned p then a p else 1) * (1 + 2/(p : ℝ)^2)) := by apply prod_le_prod₀ · intro p hp have hb := (pair_sieve_density_bounds (hP p hp) (rough p) (banned p)).2.1 linarith · intro p hp exact pair_sieve_local_factor_le (hP p hp) (rough p) (banned p) have hr : (∏ p ∈ P, (if rough p then (a p)^2 else 1)) = (∏ p ∈ P.filter (fun p => rough p = true), a p)^2 := by rw [← prod_pow, prod_filter] have hb : (∏ p ∈ P, (if banned p then a p else 1)) = ∏ p ∈ P.filter (fun p => banned p = true), a p := by rw [prod_filter] rw [prod_mul_distrib, prod_mul_distrib, hr, hb] at hbound have hnonneg : 0 ≤ (∏ p ∈ P.filter (fun p => rough p = true), a p)^2 * ∏ p ∈ P.filter (fun p => banned p = true), a p := mul_nonneg (sq_nonneg _) (prod_nonneg (fun p hp => ha p (mem_filter.mp hp).1)) have hc := finite_pair_euler_correction_le_four P (fun p hp => (by decide : 2 ≤ 3).trans (hP p hp)) exact hbound.trans ((mul_le_mul_of_nonneg_left hc hnonneg).trans_eq (by ring)) end Bounty end section /- Explicit correction products for primes omitted from the pair sieve. -/ open Finset namespace Bounty theorem avoidance_factor_bounds {p : ℕ} (hp : 2 ≤ p) : 0 < 1 - 1/(p : ℝ) ∧ 1 - 1/(p : ℝ) ≤ 1 := by have hpR : (2 : ℝ) ≤ p := Nat.cast_le.mpr hp have hp0 : (0 : ℝ) < p := by linarith constructor · exact sub_pos.mpr ((div_lt_one hp0).mpr (by linarith)) · exact sub_le_self _ (by positivity) theorem inverse_avoidance_union_le (P Q : Finset ℕ) (hP : ∀ p ∈ P, 2 ≤ p) (hQ : ∀ p ∈ Q, 2 ≤ p) : (∏ p ∈ P ∪ Q, (1 - 1/(p : ℝ))⁻¹) ≤ (∏ p ∈ P, (1 - 1/(p : ℝ))⁻¹) * (∏ p ∈ Q, (1 - 1/(p : ℝ))⁻¹) := by have h0 : 0 ≤ ∏ p ∈ P ∪ Q, (1 - 1/(p : ℝ))⁻¹ := by apply prod_nonneg intro p hp have hp2 := (mem_union.mp hp).elim (hP p) (hQ p) exact inv_nonneg.mpr (avoidance_factor_bounds hp2).1.le have h1 : 1 ≤ ∏ p ∈ P ∩ Q, (1 - 1/(p : ℝ))⁻¹ := by apply one_le_prod₀ intro p hp have hb := avoidance_factor_bounds (hP p (mem_inter.mp hp).1) exact (one_le_inv₀ hb.1).mpr hb.2 calc _ = (∏ p ∈ P ∪ Q, (1 - 1/(p : ℝ))⁻¹) * 1 := by ring _ ≤ (∏ p ∈ P ∪ Q, (1 - 1/(p : ℝ))⁻¹) * (∏ p ∈ P ∩ Q, (1 - 1/(p : ℝ))⁻¹) := mul_le_mul_of_nonneg_left h1 h0 _ = _ := prod_union_inter theorem inverse_avoidance_insert_two_le (P : Finset ℕ) (hP : ∀ p ∈ P, 2 ≤ p) : (∏ p ∈ insert 2 P, (1 - 1/(p : ℝ))⁻¹) ≤ 2 * (∏ p ∈ P, (1 - 1/(p : ℝ))⁻¹) := by have h := inverse_avoidance_union_le {2} P (by simp) hP norm_num at h simpa only [one_div, prod_inv_distrib] using h theorem finite_avoidance_omission_bound (P Q E : Finset ℕ) (hP : ∀ p ∈ P, 2 ≤ p) (hQ : ∀ p ∈ Q, 2 ≤ p) (hE : ∀ p ∈ E, 2 ≤ p) (hcover : Q \ E ⊆ P) : (∏ p ∈ P, (1 - 1/(p : ℝ))) ≤ (∏ p ∈ Q, (1 - 1/(p : ℝ))) * (∏ p ∈ E, (1 - 1/(p : ℝ))⁻¹) := by let a := fun p : ℕ => 1 - 1/(p : ℝ) have hfirst : (∏ p ∈ P, a p) ≤ ∏ p ∈ Q \ E, a p := prod_le_prod_of_subset_of_le_one₀ hcover (fun p hp => (avoidance_factor_bounds (hP p hp)).1.le) (fun p hp _ => (avoidance_factor_bounds (hP p hp)).2) have hpart : (∏ p ∈ Q \ E, a p) * (∏ p ∈ Q ∩ E, a p) = ∏ p ∈ Q, a p := by have hset : Q \ (Q ∩ E) = Q \ E := by ext p; simp rw [← hset] exact prod_sdiff inter_subset_left have hnz : (∏ p ∈ Q ∩ E, a p) ≠ 0 := by exact ne_of_gt (prod_pos (fun p hp => (avoidance_factor_bounds (hQ p (mem_inter.mp hp).1)).1)) have heq : (∏ p ∈ Q \ E, a p) = (∏ p ∈ Q, a p) * (∏ p ∈ Q ∩ E, (a p)⁻¹) := by rw [prod_inv_distrib, ← hpart, mul_assoc, mul_inv_cancel₀ hnz, mul_one] have hlast : (∏ p ∈ Q ∩ E, (a p)⁻¹) ≤ ∏ p ∈ E, (a p)⁻¹ := by apply prod_le_prod_of_subset_of_one_le₀ inter_subset_right · intro p hp exact inv_nonneg.mpr (avoidance_factor_bounds (hE p (mem_inter.mp hp).2)).1.le · intro p hp _ have hb := avoidance_factor_bounds (hE p hp) exact (one_le_inv₀ hb.1).mpr hb.2 rw [heq] at hfirst exact hfirst.trans (mul_le_mul_of_nonneg_left hlast (prod_nonneg (fun p hp => (avoidance_factor_bounds (hQ p hp)).1.le))) end Bounty end section /- Exact auxiliary-draw expansion of the signed prime comparison kernel. The target fresh law occurs once, while the A and B ideal factors use their original target and source arguments respectively. -/ open Finset open scoped Classical namespace Bounty theorem prime_asymmetric_comparison_kernel_eq_aux_sum {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (active : Finset I) (Q : ℕ) (h : ℝ) (keptA keptB : Finset I → Finset ℤ) (ζ Θ : ℝ) (A B : Finset I) (x y : ∀ i, P i) : primeAsymmetricComparisonKernel P V active Q h keptA keptB ζ Θ A B x y = if finiteSharedCompatible (active \ (A ∪ B)) x y then ∑ d : ∀ i : A, P i.val, ∑ e : ∀ i : B, P i.val, ((finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.val) (fun i => V i.val)) d * finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.val) (fun i => V i.val)) e * finiteFreshMass (physicalLabelLaw V) (active \ (A ∪ B)) y : ℝ) : ℂ) * (primeProductIdealKernel (fun i : A => P i.val) (fun i => V i.val) Q h (keptA A) d (finiteCoordinateRestrict A y) * primeProductIdealKernel (fun i : B => P i.val) (fun i => V i.val) Q h (keptB B) e (finiteCoordinateRestrict B x)) * physicalPhase ζ ((∏ i : ↥(active \ (A ∪ B)), (x i.val).val) * (∏ i : A, (d i).val) * (∏ i : B, (e i).val)) * physicalReturnPhase Θ (((∏ i : ↥(active \ (A ∪ B)), (x i.val).val) * (∏ i : A, (d i).val) * (∏ i : B, (e i).val) : ℕ) : ℤ) else 0 := by unfold primeAsymmetricComparisonKernel finiteAsymmetricComparisonKernel finiteAsymmetricKernel split_ifs · dsimp only rw [prime_asymmetric_value_eq_sum] simp only [mul_sum] apply sum_congr rfl intro d _ apply sum_congr rfl intro e _ simp only [primeTuplePhase, finiteCoordinateRestrict, Complex.ofReal_mul] ring · rfl end Bounty end section /- The literal list coefficient for one asymmetric prime-comparison pattern. Both original auxiliary tuples and the target/source orientation are retained. -/ open Finset open scoped Classical namespace Bounty noncomputable def repeatedBigPrimeCoefficient {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (source target : RepeatedBigLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : ℂ := primeProductIdealKernel (fun i : A => P i.val.1) (fun i => V i.val.1) Q h keptA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 (finiteCoordinateRestrict A (repeatedBigFlatEquiv P J ell target)) * primeProductIdealKernel (fun i : B => P i.val.1) (fun i => V i.val.1) Q h keptB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 (finiteCoordinateRestrict B (repeatedBigFlatEquiv P J ell source)) section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) include G sharedInstance1 sharedInstance2 J ell P V A B hU hAB Q h keptA keptB theorem repeated_big_prime_coefficient_split (source target : RepeatedBigLists P J ell) (a : ∀ i : A, P i.val.1) (b : ∀ i : B, P i.val.1) : repeatedBigPrimeCoefficient P V A B hU hAB Q h keptA keptB source target ((repeatedBigAuxSplitEquiv P A B hU hAB).symm (a, b)) = primeProductIdealKernel (fun i : A => P i.val.1) (fun i => V i.val.1) Q h keptA a (finiteCoordinateRestrict A (repeatedBigFlatEquiv P J ell target)) * primeProductIdealKernel (fun i : B => P i.val.1) (fun i => V i.val.1) Q h keptB b (finiteCoordinateRestrict B (repeatedBigFlatEquiv P J ell source)) := by simp only [repeatedBigPrimeCoefficient, Equiv.apply_symm_apply] theorem repeated_big_prime_coefficient_norm_le {ξ : ℝ} (hξ : 0 < ξ) (hkeptA : ∀ d ∈ keptA, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i : A, (x i).val : ℕ))) d) (hkeptB : ∀ d ∈ keptB, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i : B, (x i).val : ℕ))) d) (source target : RepeatedBigLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : ‖repeatedBigPrimeCoefficient P V A B hU hAB Q h keptA keptB source target aux‖ ≤ ((Q * Q : ℕ) / ξ) ^ 2 := by unfold repeatedBigPrimeCoefficient rw [norm_mul, pow_two] apply mul_le_mul (prime_ideal_kernel_norm_le _ _ Q h keptA hξ hkeptA _ _) (prime_ideal_kernel_norm_le _ _ Q h keptB hξ hkeptB _ _) (norm_nonneg _) positivity end end Bounty end section /- The existing ledger-forgetting equivalence preserves every birth payload. -/ namespace Bounty theorem full_mixed_ledger_birth_projection {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (H : (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullMixedLedgerPath n S B A Δ D steps (H, x)) (a : FullMixedBirthAddress S B steps) : fullMixedLedgerPathBornData n S B A Δ D steps (H, x) p a = fullMixedPathBornData n S B A Δ D steps x (finiteLedgerEventPathEquiv (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedLedgerUpdate n S B A Δ D) steps H x p) a := by have h := finite_ledger_event_path_occurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedLedgerUpdate n S B A Δ D) steps H x p a.1 exact congrArg (fun e => fullMixedEventBornData n S B A Δ D (steps.get a.1) e.1 e.2 a.2) h end Bounty end section /- The actual path's forest factor at one operation reads only its own event. -/ namespace Bounty end Bounty end section /- Actual microscopic assignment products have the small size required by the pair sieve. -/ open Finset Filter open scoped Topology namespace Bounty theorem eventually_candidate_P_mark_product_small {c η : ℝ} (hc : 0 < c) (hη : 0 < η) : ∀ᶠ L : ℝ in atTop, ∀ x : ∀ g : candidatePIndices c L, candidatePBand (c*L) g.val, (∏ g, ((x g).val : ℝ)) ≤ Real.exp (η*L) := by obtain ⟨v, V, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool, eventually_mul_rpow_log_add_le_rpow (a := (2/5 : ℝ)) (b := 1) (by norm_num) (by norm_num) hη (2/(5*Real.log 2)) 0] with L hL hsmall have hL0 : 0 ≤ L := zero_le_one.trans hL.1 intro x have hpoint : ∀ g : candidatePIndices c L, ((x g).val : ℝ) ≤ Real.exp (L^(2/5 : ℝ)) := fun g => ((hL.2.2.2.2.2 g.val g.property).2.2 (x g).val (x g).property).2.2 have hexp : ((candidatePIndices c L).card : ℝ) * L^(2/5 : ℝ) ≤ η*L := by have h := mul_le_mul_of_nonneg_right hL.2.2.2.1 (Real.rpow_nonneg hL0 (2/5 : ℝ)) norm_num only [add_zero, Real.rpow_one] at hsmall nlinarith only [h, hsmall] calc _ ≤ ∏ _g : candidatePIndices c L, Real.exp (L^(2/5 : ℝ)) := Finset.prod_le_prod₀ (fun _ _ => Nat.cast_nonneg _) (fun g _ => hpoint g) _ = Real.exp (((candidatePIndices c L).card : ℝ) * L^(2/5 : ℝ)) := by rw [← Real.exp_sum] simp _ ≤ _ := Real.exp_le_exp.mpr hexp theorem eventually_candidate_micro_assignment_product_bound {c η : ℝ} (hc : 0 < c) (hη : 0 < η) (r J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, ∀ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ) ≤ Real.exp ((((12/5 : ℝ)*(r : ℝ)*c/(2 : ℝ)^J)+η)*L) := by filter_upwards [eventually_candidate_P_mark_product_small hc hη, eventually_ge_atTop (0 : ℝ)] with L hP hL intro jStar x let xQ : ∀ i, candidateMicroQSlotChoices c L r jStar J i := fun i => x (Sum.inl i) let xP : ∀ g : candidatePIndices c L, candidatePBand (c*L) g.val := fun g => x (Sum.inr g) have hQ := candidate_micro_Q_product_upper (mul_nonneg hc.le hL) r jStar J xQ have hp := hP xP have hsplit : (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ) = (orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) xQ : ℝ) * (∏ g, ((xP g).val : ℝ)) := by simp only [orderedSlotProduct, Fintype.prod_sum_type, Nat.cast_mul, Nat.cast_prod, xQ, xP] rw [hsplit] calc _ ≤ Real.exp (((12/5 : ℝ)*(r : ℝ)*c/(2 : ℝ)^J)*L) * Real.exp (η*L) := mul_le_mul hQ hp (prod_nonneg (fun _ _ => Nat.cast_nonneg _)) (Real.exp_pos _).le _ = _ := by rw [← Real.exp_add]; congr 1; ring theorem eventually_candidate_micro_assignment_size {c : ℝ} (hc : 0 < c) (r J : ℕ) (hJ : (12/5 : ℝ)*(r : ℝ)*c/(2 : ℝ)^J ≤ 1/25) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, ∀ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ) ≤ Real.exp ((1/20 : ℝ)*L) := by filter_upwards [eventually_candidate_micro_assignment_product_bound hc (by norm_num : (0 : ℝ)<1/100) r J, eventually_ge_atTop (0 : ℝ)] with L hL hpos intro jStar x apply (hL jStar x).trans apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonneg_right (by linarith) hpos end Bounty end section /- A shared-coordinate raw row integrates its normalized fresh coordinates exactly, and becomes a diagonal pairing after tail averaging. -/ open Finset open scoped Classical namespace Bounty section variable {I : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : DecidableEq I] {X : I → Type*} [sharedInstance4 : ∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hmass : ∀ i, ∑ v, μ i v = 1) (active : Finset I) include I sharedInstance1 sharedInstance2 X sharedInstance4 μ hmass active theorem finite_shared_fresh_mass_sum (x : ∀ i, X i) : (∑ y, if finiteSharedCompatible active x y then finiteFreshMass μ active y else 0) = 1 := by let a := fun i (v : X i) => if i ∈ active then (if x i = v then (1 : ℝ) else 0) else μ i v have he (y : ∀ i, X i) : (if finiteSharedCompatible active x y then finiteFreshMass μ active y else 0) = ∏ i, a i (y i) := by by_cases hxy : finiteSharedCompatible active x y · rw [if_pos hxy, ← prod_mul_prod_compl active] have ha : (∏ i ∈ active, a i (y i)) = 1 := by apply prod_eq_one intro i hi simp only [a, if_pos hi, if_pos (hxy i hi)] rw [ha, one_mul] apply prod_congr rfl intro i hi simp only [a, if_neg (mem_compl.mp hi)] · rw [if_neg hxy] symm obtain ⟨i, hi, hne⟩ : ∃ i ∈ active, x i ≠ y i := by simpa only [finiteSharedCompatible, not_forall, exists_prop] using hxy apply prod_eq_zero (mem_univ i) simp only [a, if_pos hi, if_neg hne] simp_rw [he] rw [← Fintype.prod_sum] apply prod_eq_one intro i _ by_cases hi : i ∈ active · simp [a, hi] · simpa only [a, if_neg hi] using hmass i theorem finite_shared_raw_pairing_of_invariant (k f g : (∀ i, X i) → ℂ) (hg : ∀ i ∉ active, ∀ x v, g (Function.update x i v) = g x) : cleanKernelPairing (finiteProductWeight μ) (fun x y => if finiteSharedCompatible active x y then (finiteFreshMass μ active y : ℂ) * k x else 0) f g = cleanRawPairing (finiteProductWeight μ) k f g := by unfold cleanKernelPairing cleanRawPairing apply sum_congr rfl intro x _ have hrow := finite_shared_fresh_mass_sum μ hmass active x have hrowc : (∑ y, if finiteSharedCompatible active x y then (finiteFreshMass μ active y : ℂ) else 0) = 1 := by simpa only [Complex.ofReal_sum, apply_ite, Complex.ofReal_zero, Complex.ofReal_one] using congrArg Complex.ofReal hrow calc _ = ((finiteProductWeight μ x : ℂ) * starRingEnd ℂ (f x) * g x * k x) * ∑ y, if finiteSharedCompatible active x y then (finiteFreshMass μ active y : ℂ) else 0 := by rw [mul_sum] apply sum_congr rfl intro y _ dsimp only by_cases hxy : finiteSharedCompatible active x y · have hgy : g y = g x := finite_function_eq_of_coordinate_invariance active g hg y x (fun i hi => (hxy i hi).symm) simp only [if_pos hxy, hgy] ring · simp only [if_neg hxy, mul_zero, zero_mul] _ = _ := by rw [hrowc, mul_one] theorem finite_shared_raw_pairing_tail_average (k f g : (∀ i, X i) → ℂ) : cleanKernelPairing (finiteProductWeight μ) (fun x y => if finiteSharedCompatible active x y then (finiteFreshMass μ active y : ℂ) * k x else 0) (finiteCoordinateComponent μ ∅ activeᶜ.toList f) (finiteCoordinateComponent μ ∅ activeᶜ.toList g) = cleanRawPairing (finiteProductWeight μ) k (finiteCoordinateComponent μ ∅ activeᶜ.toList f) (finiteCoordinateComponent μ ∅ activeᶜ.toList g) := by apply finite_shared_raw_pairing_of_invariant μ hmass intro i hi x v exact finite_component_missing_invariant μ hmass activeᶜ ∅ i (by simp only [sdiff_empty, mem_compl]; exact hi) g x v end end Bounty end section /- The original full paths, indexed by the chronological birth-address equivalence. -/ namespace Bounty variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedIndexedBirthOwner (i : Fin (Fintype.card (FullMixedBirthAddress S B steps))) : Fin steps.length := fullMixedBirthOwner S B steps (fullMixedBirthOrder S B steps i) end Bounty namespace Bounty end Bounty end section /- Exact support restriction retaining both the original return coefficient and marked-residue compatibility. -/ open Finset open scoped Classical namespace Bounty section Support variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) noncomputable def physicalRootNormalizablePath (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : Prop := physicalFiniteReturnScalar V patterns C ζ k K n L p ≠ 0 ∧ ∃ r : PhysicalResidues P, physicalFinitePathResidueCompatible C k n r L p theorem physical_root_normalizable_return_eq_walk (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (hp : physicalRootNormalizablePath V patterns C ζ k K L p) : physicalFiniteReturnScalar V patterns C ζ k K n L p = physicalBareWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L p) (n + 1) := by have hn := hp.1 unfold physicalFiniteReturnScalar physicalBareReturnScalar at hn ⊢ split_ifs at hn ⊢ with h · rfl · exact (hn rfl).elim variable [∀ a : PhysicalPrime P, NeZero a.2.val] (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) include hP hdis end Support end Bounty end section /- Uniform clean residue-fiber norms lift with no loss to the full bounded product memory law. The factorial and prime-label weights remain in the outer sum; every ordered residue occurrence is integrated. -/ open Finset open scoped Classical namespace Bounty theorem clean_full_memory_lift_norm_le {G R : Type*} [Fintype G] [DecidableEq G] [Fintype R] {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (V : G → ℝ) (b : ∀ g, P g → ℝ) (ν : ∀ g, P g → ℝ) (hV : ∀ g, 0 ≤ V g) (hb : ∀ g p, 0 ≤ b g p) (hν : ∀ g p, 0 ≤ ν g p) (A : ∀ (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)), (RepeatedBigLists P J ell → (R × FixedOrderedResidues p) → ℂ) → RepeatedBigLists P J ell → (R × FixedOrderedResidues p) → ℂ) (M : ℝ) (hM : 0 ≤ M) (hA : ∀ N p v, cleanWeightedNorm (repeatedBigActiveMass V b) (A N p v) ≤ M * cleanWeightedNorm (repeatedBigActiveMass V b) v) (f : CleanFullMemoryState P J ell B → R → ℂ) : cleanWeightedNorm (productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1)) (cleanFullMemoryLift A f) ≤ M * cleanWeightedNorm (productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1)) f := by have hw (source : RepeatedBigLists P J ell) : 0 ≤ repeatedBigActiveMass V b source := prod_nonneg fun g _ => prod_nonneg fun j _ => tiltedPhysicalBirthLaw_nonneg V g (b g) (hV g) (hb g) (source g j) have he (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (v : RepeatedBigLists P J ell → (R × FixedOrderedResidues p) → ℂ) : 0 ≤ ∑ source, repeatedBigActiveMass V b source * ∑ r, ‖v source r‖ ^ 2 := sum_nonneg fun source _ => mul_nonneg (hw source) (sum_nonneg fun r _ => sq_nonneg _) have hfiber (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) : (∑ source, repeatedBigActiveMass V b source * ∑ r, ‖A N p (cleanFullMemorySlice f N p) source r‖ ^ 2) ≤ M ^ 2 * ∑ source, repeatedBigActiveMass V b source * ∑ r, ‖cleanFullMemorySlice f N p source r‖ ^ 2 := by have h := pow_le_pow_left₀ (Real.sqrt_nonneg _) (hA N p (cleanFullMemorySlice f N p)) 2 simpa only [mul_pow, cleanWeightedNorm, Real.sq_sqrt (he N p _)] using h have hfull : (∑ x : CleanFullMemoryState P J ell B, productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1) x * ∑ r, ‖cleanFullMemoryLift A f x r‖ ^ 2) ≤ M ^ 2 * ∑ x : CleanFullMemoryState P J ell B, productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1) x * ∑ r, ‖f x r‖ ^ 2 := by rw [clean_full_memory_tilted_residue_energy, clean_full_memory_tilted_residue_energy] change (∑ N : G → Fin (B + 1), ∑ p : FixedOrderedMemoryLabels P (fun g => (N g).val), cleanMemoryLabelWeight ν N p * ∑ source : RepeatedBigLists P J ell, repeatedBigActiveMass V b source * ∑ r : R × FixedOrderedResidues p, ‖cleanFullMemorySlice (cleanFullMemoryLift A f) N p source r‖ ^ 2) ≤ M ^ 2 * ∑ N : G → Fin (B + 1), ∑ p : FixedOrderedMemoryLabels P (fun g => (N g).val), cleanMemoryLabelWeight ν N p * ∑ source : RepeatedBigLists P J ell, repeatedBigActiveMass V b source * ∑ r : R × FixedOrderedResidues p, ‖cleanFullMemorySlice f N p source r‖ ^ 2 simp only [clean_full_memory_lift_slice] calc _ ≤ ∑ N : G → Fin (B + 1), ∑ p : FixedOrderedMemoryLabels P (fun g => (N g).val), cleanMemoryLabelWeight ν N p * (M ^ 2 * ∑ source, repeatedBigActiveMass V b source * ∑ r, ‖cleanFullMemorySlice f N p source r‖ ^ 2) := by apply sum_le_sum intro N _ apply sum_le_sum intro p _ exact mul_le_mul_of_nonneg_left (hfiber N p) (cleanMemoryLabelWeight_nonneg ν hν N p) _ = _ := by simp only [mul_sum, mul_left_comm] have h := Real.sqrt_le_sqrt hfull simpa only [cleanWeightedNorm, Real.sqrt_mul (sq_nonneg M), Real.sqrt_sq hM] using h theorem clean_full_memory_projected_damped_norm_le {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell B : ℕ} [∀ q : PhysicalPrime Ps, NeZero q.2.val] [∀ g (p : Pb g), NeZero p.val] (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (ν : ∀ g, Pb g → ℝ) (hV : ∀ g, 0 ≤ Vb g) (hb : ∀ g p, 0 ≤ b g p) (hν : ∀ g p, 0 ≤ ν g p) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) (k : ℤ) (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (M : ℝ) (hM : 0 ≤ M) (hcore : ∀ (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels Pb (fun g => (N g).val)) (f : RepeatedBigLists Pb J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ), cleanWeightedNorm (repeatedBigActiveMass Vb b) (cleanActiveMap repeatedBigSymmetrizeLinear (cleanHybridPatternCoreAction Vb b C ζ θ k p K d (cleanActiveMap repeatedBigSymmetrizeLinear f))) ≤ M * cleanWeightedNorm (repeatedBigActiveMass Vb b) f) (f : CleanFullMemoryState Pb J ell B → PhysicalResidues Ps → ℂ) : cleanWeightedNorm (productMemoryWeight (fun g => tiltedPhysicalBirthLaw Vb g (b g)) (fun g z => ν g z.1)) (cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction Vb b C ζ θ ρ k K d (cleanFullMemoryActiveMap f))) ≤ M * cleanWeightedNorm (productMemoryWeight (fun g => tiltedPhysicalBirthLaw Vb g (b g)) (fun g z => ν g z.1)) f := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) rw [clean_full_memory_projected_damped_lift] apply clean_full_memory_lift_norm_le (R := PhysicalResidues Ps) Vb b ν hV hb hν (fun (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels Pb (fun g => (N g).val)) v => cleanActiveMap repeatedBigSymmetrizeLinear (cleanHybridPatternDampedAction Vb b C ζ θ ρ k (fun _ => B) p K d (cleanActiveMap repeatedBigSymmetrizeLinear v))) M hM _ f intro N p v have hw (source : RepeatedBigLists Pb J ell) : 0 ≤ repeatedBigActiveMass Vb b source := prod_nonneg fun g _ => prod_nonneg fun j _ => tiltedPhysicalBirthLaw_nonneg Vb g (b g) (hV g) (hb g) (source g j) exact clean_hybrid_projected_damped_norm_le Vb b C ζ θ ρ hρ0 hρ1 k (fun _ => B) p K d repeatedBigSymmetrizeLinear (repeatedBigActiveMass Vb b) hw M hM (hcore N p) v end Bounty end section /- Actual Q-list majorants retain every small-prime exclusion forced by the omitted bands. -/ open Finset namespace Bounty def smallPrimeDivisorsSupported (z : ℝ) (n d : ℕ) : Prop := ∀ p : ℕ, p.Prime → (p : ℝ) ≤ z → p ∣ n → p ∣ d noncomputable def candidateMicroQMajorant (c L : ℝ) (r jStar J : ℕ) (z : ℝ) (n : ℕ) : ℝ := by classical exact ∑ x : ∀ i, candidateMicroQSlotChoices c L r jStar J i, if orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) x ∣ n ∧ smallPrimeDivisorsSupported z n (orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) x) then 1/(r.factorial : ℝ)^(candidateMicroQIndices c L J).card else 0 theorem candidate_Q_weight_le_micro_majorant {c L z : ℝ} (hcL : 0 ≤ c*L) (r jStar J : ℕ) (hJ : J ≤ jStar) (hz : ∀ j ∈ candidateMacroQIndices c L J, ∀ p ∈ candidateQBand (c*L) j, z < (p : ℝ)) (n : ℕ) : candidateQWeight c L r jStar n ≤ candidateMicroQMajorant c L r jStar J z n := by classical rw [candidateQWeight, ordered_slot_weight_equiv _ (candidateQSlotSplit c L r J), candidate_Q_choices_split c L r jStar J hJ, candidate_Q_normalization_split] unfold candidateMicroQMajorant apply ordered_slot_split_majorant _ _ (by positivity) (candidate_micro_Q_product_pos c L r jStar J) (candidate_macro_Q_weight_le_one hcL r J) intro x y hxy p hp hpz hpn rw [← hxy] at hpn exact (hp.dvd_mul.mp hpn).resolve_right (candidate_macro_Q_no_small_prime hz y hp hpz) noncomputable def candidateMicroQFreeMajorant (c L : ℝ) (r jStar J : ℕ) (z : ℝ) (P : Finset ℕ) (u : ℕ) : ℝ := by classical exact ∑ x : ∀ i, candidateMicroQSlotChoices c L r jStar J i, if orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) x ∣ u ∧ (∀ p : ℕ, p.Prime → (p : ℝ) ≤ z → p ∉ P → p ∣ u → p ∣ orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) x) then 1/(r.factorial : ℝ)^(candidateMicroQIndices c L J).card else 0 theorem candidate_Q_free_weight_le_micro_majorant {c L z : ℝ} (hcL : 0 ≤ c*L) (r jStar J : ℕ) (hJ : J ≤ jStar) (hz : ∀ j ∈ candidateMacroQIndices c L J, ∀ p ∈ candidateQBand (c*L) j, z < (p : ℝ)) (P : Finset ℕ) (u : ℕ) : candidateQWeight c L r jStar (primePoolFreePart P u) ≤ candidateMicroQFreeMajorant c L r jStar J z P u := by classical refine (candidate_Q_weight_le_micro_majorant hcL r jStar J hJ hz _).trans ?_ unfold candidateMicroQMajorant candidateMicroQFreeMajorant apply sum_le_sum intro x _ split_ifs with h h' · exact le_rfl · exfalso apply h' refine ⟨h.1.trans (Nat.div_dvd_of_dvd (primePoolPart_dvd P u)), ?_⟩ intro p hp hpz hpP hpu exact h.2 p hp hpz ((prime_dvd_primePoolFreePart_iff hp hpP).mpr hpu) · positivity · exact le_rfl end Bounty end section /- The retained cutoff leaves every omitted Q prime above the sieve level. -/ open Finset namespace Bounty theorem candidate_macro_Q_band_above {c L θ : ℝ} (hc : 0 ≤ c) (hL : 0 < L) (J : ℕ) (hθ : θ < 2*c/(2 : ℝ)^J) : ∀ j ∈ candidateMacroQIndices c L J, ∀ p ∈ candidateQBand (c*L) j, Real.exp (θ*L) < (p : ℝ) := by intro j hj p hp have hjJ : j < J := (mem_filter.mp hj).2 have hpL := ((mem_dyadicPrimeBand_iff (c*L) 1 (6/5) j p).mp hp).2.1 have hpow : (2 : ℝ)^(j+1) ≤ 2^J := pow_le_pow_right₀ (by norm_num) (Nat.succ_le_of_lt hjJ) have hdiv : 2*c/(2 : ℝ)^J ≤ c/(2 : ℝ)^j := by calc _ ≤ 2*c/(2 : ℝ)^(j+1) := div_le_div_of_nonneg_left (by positivity) (by positivity) hpow _ = _ := by rw [pow_succ]; field_simp have hexp : θ*L < (c*L)/(2 : ℝ)^j := by calc θ*L < (c/(2 : ℝ)^j)*L := mul_lt_mul_of_pos_right (hθ.trans_le hdiv) hL _ = _ := by ring apply lt_trans (Real.exp_lt_exp.mpr hexp) simpa only [one_mul] using hpL end Bounty end section /- Combining a pool-free divisor with its distinct marked primes. -/ open Finset namespace Bounty def primeAssignmentCondition (P : Finset ℕ) (z : ℝ) (u d : ℕ) : Prop := d ∣ u ∧ ∀ p : ℕ, p.Prime → (p : ℝ) ≤ z → p ∉ P → p ∣ u → p ∣ d noncomputable def primeAssignmentTerm (P : Finset ℕ) (q z normalization : ℝ) (u d : ℕ) : ℝ := by classical exact if primeAssignmentCondition P z u d then q^(((P \ d.primeFactors).filter (fun p => p ∣ u)).card) / normalization else 0 theorem prime_assignment_term_nonneg (P : Finset ℕ) {q : ℝ} (hq : 0 ≤ q) (z : ℝ) {normalization : ℝ} (hN : 0 ≤ normalization) (u d : ℕ) : 0 ≤ primeAssignmentTerm P q z normalization u d := by unfold primeAssignmentTerm split_ifs <;> positivity theorem free_mark_unmarked_set {G : Type*} [Fintype G] (P : G → Finset ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : ∀ g, P g) {d : ℕ} (hd : d ≠ 0) (hfree : Disjoint d.primeFactors (univ.biUnion P)) (u : ℕ) : (((univ.biUnion P) \ (d * orderedSlotProduct P x).primeFactors).filter (fun p => p ∣ u)) = unmarkedDivisorSet P x u := by classical rw [Nat.primeFactors_mul hd (chosen_mark_product_ne_zero P hprime x), chosen_mark_product_primeFactors P hprime hdisj x] ext p simp only [mem_filter, mem_sdiff, mem_union, unmarkedDivisorSet] have hf : p ∈ univ.biUnion P → p ∉ d.primeFactors := fun hp hd => disjoint_left.mp hfree hd hp tauto theorem free_mark_assignment_term {G : Type*} [Fintype G] (P : G → Finset ℕ) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdisj : Pairwise (fun g h => Disjoint (P g) (P h))) (x : ∀ g, P g) {d : ℕ} (hd : d ≠ 0) (hfree : Disjoint d.primeFactors (univ.biUnion P)) {q α β : ℝ} (hq : 0 ≤ q) (hα : 0 ≤ α) (hβ : 0 ≤ β) (z : ℝ) (u : ℕ) [Decidable (primeAssignmentCondition (univ.biUnion P) z u d)] : (if primeAssignmentCondition (univ.biUnion P) z u d then 1/α else 0) * (if ∀ g, (x g).val ∣ u then q^(unmarkedDivisorSet P x u).card / β else 0) ≤ primeAssignmentTerm (univ.biUnion P) q z (α*β) u (d * orderedSlotProduct P x) := by classical by_cases hc : primeAssignmentCondition (univ.biUnion P) z u d · rw [if_pos hc] by_cases hx : ∀ g, (x g).val ∣ u · rw [if_pos hx] have hcop : d.Coprime (orderedSlotProduct P x) := (Nat.disjoint_primeFactors hd (chosen_mark_product_ne_zero P hprime x)).mp (hfree.mono (subset_refl _) (chosen_mark_product_support P hprime hdisj x)) have hcond : primeAssignmentCondition (univ.biUnion P) z u (d * orderedSlotProduct P x) := by refine ⟨hcop.mul_dvd_of_dvd_of_dvd hc.1 (chosen_mark_product_dvd P hprime hdisj x u hx), ?_⟩ intro p hp hpz hpP hpu exact (hc.2 p hp hpz hpP hpu).trans (dvd_mul_right _ _) rw [primeAssignmentTerm, if_pos hcond, free_mark_unmarked_set P hprime hdisj x hd hfree u] apply le_of_eq ring · rw [if_neg hx, mul_zero] exact prime_assignment_term_nonneg _ hq z (mul_nonneg hα hβ) u _ · rw [if_neg hc, zero_mul] exact prime_assignment_term_nonneg _ hq z (mul_nonneg hα hβ) u _ end Bounty end section /- Concrete tilted prime-atom costs for the original local ghost and edge events. -/ open Finset Classical namespace Bounty section Tilted variable {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (g : G) (baseline : P g → ℝ) {P₀ : ℝ} (p : P g) (ρ : ℝ) (t B : ℕ) (s : BoundedOrderedState (P g) (UnrestrictedResidueParticle (fun p : P g => p.val)) t B) end Tilted end Bounty end section /- The original ghost freshness mask is exactly local birth avoidance and distinctness. -/ open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (j : J) (H : (g : Fin N) → Finset (P g)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s) theorem full_mixed_ghost_birth_avoids_iff : FullMixedLocalBirthAvoids n S B A Δ D H (some (.inl j)) s e ↔ ∀ g i, ((e.down g).2.2 i).1 ∉ H g := by constructor · intro h g i let a : Fin B := ⟨i.val, lt_of_lt_of_le i.isLt (Nat.le_of_lt_succ (e.down g).1.isLt)⟩ exact h ⟨g, a⟩ ⟨g, ((e.down g).2.2 i).1⟩ (full_mixed_ghost_local_label n S B A Δ D j s e g a i.isLt) · rintro h ⟨g, i⟩ z hz obtain ⟨hi, rfl⟩ := full_mixed_ghost_local_label_some n S B A Δ D j s e g i z hz exact h g ⟨i.val, hi⟩ theorem full_mixed_ghost_birth_distinct_iff : FullMixedLocalBirthDistinct n S B A Δ D (some (.inl j)) s e ↔ ∀ g, Function.Injective (fun i => ((e.down g).2.2 i).1) := by constructor · intro h g i k hik let a : Fin B := ⟨i.val, lt_of_lt_of_le i.isLt (Nat.le_of_lt_succ (e.down g).1.isLt)⟩ let b : Fin B := ⟨k.val, lt_of_lt_of_le k.isLt (Nat.le_of_lt_succ (e.down g).1.isLt)⟩ have ha := full_mixed_ghost_local_label n S B A Δ D j s e g a i.isLt have hb := full_mixed_ghost_local_label n S B A Δ D j s e g b k.isLt have hab := h ⟨g, a⟩ ⟨g, b⟩ ⟨g, ((e.down g).2.2 i).1⟩ ha (by simpa only [hik] using hb) exact Fin.ext (congrArg (fun c => c.2.val) hab) · rintro h ⟨g, i⟩ ⟨k, l⟩ z hi hl obtain ⟨hi', rfl⟩ := full_mixed_ghost_local_label_some n S B A Δ D j s e g i z hi obtain ⟨hl', hz⟩ := full_mixed_ghost_local_label_some n S B A Δ D j s e k l _ hl have hgk : g = k := congrArg Sigma.fst hz subst k have hp : ((e.down g).2.2 ⟨i.val, hi'⟩).1 = ((e.down g).2.2 ⟨l.val, hl'⟩).1 := by simpa only [Sigma.mk.inj_iff, heq_eq_eq, true_and] using hz have heq : i.val = l.val := congrArg (fun u : Fin (e.down g).1.val => u.val) (h g hp) have hil : i = l := Fin.ext heq subst l rfl theorem bounded_ghost_joint_fresh_birth_iff : boundedGhostJointFresh n M B (fun g => (H g, s g)) e.down ↔ FullMixedLocalBirthAvoids n S B A Δ D H (some (.inl j)) s e ∧ FullMixedLocalBirthDistinct n S B A Δ D (some (.inl j)) s e := by rw [full_mixed_ghost_birth_avoids_iff, full_mixed_ghost_birth_distinct_iff] change (∀ g, Function.Injective (fun i => ((e.down g).2.2 i).1) ∧ ∀ i, ((e.down g).2.2 i).1 ∉ H g) ↔ _ constructor · exact fun h => ⟨fun g => (h g).2, fun g => (h g).1⟩ · exact fun h g => ⟨h.2 g, h.1 g⟩ theorem full_mixed_ghost_freshness_phase_birth_mask : fullMixedGhostFreshnessPhase n S B A Δ D j (fun g => (H g, s g)) e = if FullMixedLocalBirthAvoids n S B A Δ D H (some (.inl j)) s e ∧ FullMixedLocalBirthDistinct n S B A Δ D (some (.inl j)) s e then 1 else 0 := by unfold fullMixedGhostFreshnessPhase rw [bounded_ghost_joint_fresh_birth_iff n S B A Δ D j H s e] split_ifs <;> rfl end Full end Bounty end section /- The fresh unpromoted edge draws are exactly its local performed birth labels. -/ open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (k : K) (H : (g : Fin N) → Finset (P g)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent (J := J) n S B A Δ D (some (.inr k)) s) theorem full_mixed_edge_birth_avoids_iff : FullMixedLocalBirthAvoids n S B A Δ D H (some (.inr k)) s e ↔ ∀ g i, (e.2 g).2.2.2 i ∉ H g := by constructor · intro h g i exact h ⟨g, i.val⟩ ⟨g, (e.2 g).2.2.2 i⟩ (full_mixed_edge_local_label n S B A Δ D k s e g i.val i.property) · rintro h ⟨g, i⟩ z hz obtain ⟨hi, rfl⟩ := full_mixed_edge_local_label_some n S B A Δ D k s e g i z hz exact h g ⟨i, hi⟩ theorem full_mixed_edge_birth_distinct_iff : FullMixedLocalBirthDistinct n S B A Δ D (some (.inr k)) s e ↔ ∀ g, Function.Injective (e.2 g).2.2.2 := by constructor · intro h g i l hil have hi := full_mixed_edge_local_label n S B A Δ D k s e g i.val i.property have hl := full_mixed_edge_local_label n S B A Δ D k s e g l.val l.property have he := h ⟨g, i.val⟩ ⟨g, l.val⟩ ⟨g, (e.2 g).2.2.2 i⟩ hi (by simpa only [hil] using hl) exact Subtype.ext (Fin.ext (congrArg (fun c => c.2.val) he)) · rintro h ⟨g, i⟩ ⟨l, m⟩ z hi hm obtain ⟨hi', rfl⟩ := full_mixed_edge_local_label_some n S B A Δ D k s e g i z hi obtain ⟨hm', hz⟩ := full_mixed_edge_local_label_some n S B A Δ D k s e l m _ hm have hgl : g = l := congrArg Sigma.fst hz subst l have hp : (e.2 g).2.2.2 ⟨i, hi'⟩ = (e.2 g).2.2.2 ⟨m, hm'⟩ := by simpa only [Sigma.mk.inj_iff, heq_eq_eq, true_and] using hz have him : i = m := congrArg Subtype.val (h g hp) subst m rfl end Full end Bounty end section /- The literal joint clean event sum retains the common total-memory cap. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Type*} [sharedInstance4 : ∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [sharedInstance6 : ∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) include G sharedInstance1 sharedInstance2 P sharedInstance4 n sharedInstance6 Δ D μ ρ V t B theorem unrestricted_joint_clean_event_sum (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : (∑ e : UnrestrictedJointEvent n Δ D t B s, (unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B s e : ℂ) * (if ∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅ then 1 else 0) * f (unrestrictedJointEventTarget n Δ D t B s e)) = if productTotalMemory s ≤ B then (∏ g, (unrestrictedBoundedCleanFactor (n g) (Δ g) ρ (s g) : ℂ)) * ∑ target : (∀ g, Fin (t g) → P g), (∏ g, (∏ j, μ g (target g j) : ℝ) : ℂ) * f (fun g => unrestrictedBoundedCleanTarget (n g) (Δ g) (s g) (target g)) else 0 := by have h := unrestricted_product_clean_event_sum n Δ D μ ρ V t B f hf s calc _ = if productTotalMemory s ≤ B then (∑ e : UnrestrictedJointEvent n Δ D t B s, (∏ g, (if (e g).1 = ∅ ∧ (e g).2.1 = ∅ then unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (s g) (e g) else 0 : ℝ) : ℂ) * f (unrestrictedJointEventTarget n Δ D t B s e)) else 0 := by by_cases hs : productTotalMemory s ≤ B · rw [if_pos hs] apply sum_congr rfl intro e _ rw [← Complex.ofReal_prod, Fintype.prod_ite_zero] by_cases he : ∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅ · rw [if_pos he, if_pos he, unrestricted_joint_clean_event_weight n Δ D μ ρ V t B s e he, if_pos hs] simp only [mul_one, Complex.ofReal_prod] · rw [if_neg he, if_neg he] simp · rw [if_neg hs] apply sum_eq_zero intro e _ simp [unrestrictedJointCutoffEventWeight, hs] _ = _ := by rw [h] theorem unrestricted_joint_clean_event_phase_sum (θ : (∀ g, Fin (t g) → P g) → ℂ) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : (∑ e : UnrestrictedJointEvent n Δ D t B s, (unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B s e : ℂ) * (if ∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅ then θ (fun g => (unrestrictedJointEventTarget n Δ D t B s e g).1) else 0) * f (unrestrictedJointEventTarget n Δ D t B s e)) = if productTotalMemory s ≤ B then (∏ g, (unrestrictedBoundedCleanFactor (n g) (Δ g) ρ (s g) : ℂ)) * ∑ target : (∀ g, Fin (t g) → P g), (∏ g, (∏ j, μ g (target g j) : ℝ) : ℂ) * θ target * f (fun g => unrestrictedBoundedCleanTarget (n g) (Δ g) (s g) (target g)) else 0 := by have h := unrestricted_joint_clean_event_sum n Δ D μ ρ V t B (fun y => θ (fun g => (y g).1) * f y) (productMemorySymmetric_mul_active θ f hf) s calc _ = ∑ e : UnrestrictedJointEvent n Δ D t B s, (unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B s e : ℂ) * (if ∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅ then 1 else 0) * (θ (fun g => (unrestrictedJointEventTarget n Δ D t B s e g).1) * f (unrestrictedJointEventTarget n Δ D t B s e)) := by apply sum_congr rfl intro e _ split_ifs <;> simp [mul_assoc] _ = _ := by simp only [mul_assoc] at h ⊢ refine h.trans ?_ split_ifs · congr 1 · rfl end end Bounty end section /- Exact identification of canonical clean fresh integration with the repeated-list kernel. Every ordered pending occurrence is retained, and unrestricted transport by `-Δ` is fixed-sector transport by `+Δ`. -/ open Finset open scoped Classical namespace Bounty theorem cleanFullMemoryState_reassemble_clean_target {G : Type*} {P : G → Finset ℕ} {J ell B : ℕ} (C : G → Finset (Fin J)) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) (Δ : ℤ) (fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) : (productActiveMemorySplit (cleanFullSharedSlots C) B).symm ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).1, fun g => unrestrictedBoundedCleanTarget (fun q : P g => q.val) (-Δ) ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).2 g) (fresh g)) = cleanFullMemoryState N p (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) (fixedOrderedResidueTranslate p r Δ) := by have htarget : (fun g => unrestrictedBoundedCleanTarget (fun q : P g => q.val) (-Δ) ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).2 g) (fresh g)) = (fun g => (fresh g, (⟨N g, fun j => ⟨p g j, fixedOrderedResidueTranslate p r Δ g j⟩⟩ : BoundedOrderedTuple (UnrestrictedResidueParticle (fun q : P g => q.val)) B))) := by funext g exact unrestricted_bounded_clean_target_fixed_memory N p r g Δ _ _ rw [htarget] exact cleanFullMemoryState_reassemble_fill C N p source (fixedOrderedResidueTranslate p r Δ) fresh theorem cleanFullMemoryState_clean_factor {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell B : ℕ} (C : G → Finset (Fin J)) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (r : FixedOrderedResidues p) (Δ : ℤ) (ρ : ℝ) : (∏ g, unrestrictedBoundedCleanFactor (fun q : P g => q.val) (-Δ) ρ ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).2 g)) = cleanHybridMemoryFactor ρ (fun _ => B) p r Δ := by unfold cleanHybridMemoryFactor apply prod_congr rfl intro g _ rw [if_pos (Nat.le_of_lt_succ (N g).isLt)] unfold unrestrictedBoundedCleanFactor have htarget := unrestricted_bounded_clean_target_fixed_memory N p r g Δ ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).2 g).1 ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).2 g).1 change unrestrictedBoundedCleanTarget (fun q : P g => q.val) (-Δ) ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).2 g) ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).2 g).1 = _ at htarget rw [htarget] rfl /- The physical phases and both auxiliary-label bans are retained exactly. -/ theorem clean_full_memory_fresh_kernel_row {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (r : FixedOrderedResidues p) (d : PhysicalSharedLists Ps J) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (source : RepeatedBigLists P J ell) (f : CleanFullMemoryState P J ell B → ℂ) : let Δ := cleanHybridStep k C source aux d (physicalAuxMass V C aux : ℂ) * (∏ g, (unrestrictedBoundedCleanFactor (fun q : P g => q.val) (-Δ) ρ ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).2 g) : ℂ)) * (∑ fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g, ((∏ g, ∏ i, tiltedPhysicalBirthLaw V g (b g) (fresh g i) : ℝ) : ℂ) * (if repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) then K source (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) aux * physicalPhase ζ (repeatedBigD C source aux) * physicalReturnPhase θ Δ * physicalPhase ζ (physicalSharedProduct d) else 0) * f ((productActiveMemorySplit (cleanFullSharedSlots C) B).symm ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).1, fun g => unrestrictedBoundedCleanTarget (fun q : P g => q.val) (-Δ) ((productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).2 g) (fresh g)))) = ∑ target : RepeatedBigLists P J ell, (cleanHybridBetweenKernel V b C ζ θ ρ k (fun _ => B) p r K d aux source target * physicalPhase ζ (physicalSharedProduct d)) * f (cleanFullMemoryState N p target (fixedOrderedResidueTranslate p r Δ)) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Δ simp_rw [cleanFullMemoryState_reassemble_clean_target] rw [← Complex.ofReal_prod, cleanFullMemoryState_clean_factor] let F : RepeatedBigFresh P C ell → ℂ := fun fresh => (if repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux (repeatedBigFill C source fresh) then K source (repeatedBigFill C source fresh) aux * physicalPhase ζ (repeatedBigD C source aux) * physicalReturnPhase θ Δ * physicalPhase ζ (physicalSharedProduct d) else 0) * f (cleanFullMemoryState N p (repeatedBigFill C source fresh) (fixedOrderedResidueTranslate p r Δ)) have hfresh := clean_full_fresh_weighted_sum V b C F simp only [F, ← mul_assoc] at hfresh erw [hfresh] have hrow := repeated_big_kernel_row V b C ζ K aux source (fun target => physicalReturnPhase θ Δ * (cleanHybridMemoryFactor ρ (fun _ => B) p r Δ : ℂ) * physicalPhase ζ (physicalSharedProduct d) * f (cleanFullMemoryState N p target (fixedOrderedResidueTranslate p r Δ))) calc _ = ∑ fresh : RepeatedBigFresh P C ell, if repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux (repeatedBigFill C source fresh) then ((physicalAuxMass V C aux * repeatedBigFreshMass V b C fresh : ℝ) : ℂ) * K source (repeatedBigFill C source fresh) aux * physicalPhase ζ (repeatedBigD C source aux) * (physicalReturnPhase θ Δ * (cleanHybridMemoryFactor ρ (fun _ => B) p r Δ : ℂ) * physicalPhase ζ (physicalSharedProduct d) * f (cleanFullMemoryState N p (repeatedBigFill C source fresh) (fixedOrderedResidueTranslate p r Δ))) else 0 := by rw [mul_sum] apply sum_congr rfl intro fresh _ split_ifs <;> simp only [Complex.ofReal_mul, mul_zero, zero_mul] ring _ = _ := hrow _ = _ := by apply sum_congr rfl intro target _ dsimp only [cleanHybridBetweenKernel, Δ] ring end Bounty end section /- Selected birth kernels retain arbitrary nonnegative continuation at the actual target. -/ open Finset Classical namespace Bounty section Edge variable {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (μ : P → ℝ) (ρ V : ℝ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (stores promotions : Finset (Fin t)) (e : promotions ↪ ↥(unrestrictedResidueEligible n Δ D s.2.2)) (i : {j : Fin t // j ∉ promotions}) (p : P) (F : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℝ) end Edge section Ghost variable {P : Type*} [Fintype P] [DecidableEq P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (q ρ V : ℝ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (b : Fin (B + 1)) (retained : Finset (Fin s.2.1.val)) (i : Fin b.val) (p : P) (F : BoundedOrderedState P (UnrestrictedResidueParticle n) t B → ℝ) end Ghost end Bounty end section /- Pinned-prime kernels for a complete original full edge, with the exact target continuation. -/ open Finset Classical namespace Bounty section Edge variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n S B A Δ D s) (i : FullActiveEdgeSampleIndex n S B A Δ D s sk) (p : P i.1) (F : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℝ) end Edge end Bounty end section /- Exact clean fresh-tuple transport from the original physical slot order to the canonical first/tail order. Shared source labels are retained, and replacement pending memories are unrestricted and unchanged. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalCleanUnsharedEquiv {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) : ↥((physicalFullSharedIndices (ell := ell) (C g))ᶜ) ≃ ↥((cleanFullSharedSlots (ell := ell) C g)ᶜ) where toFun i := ⟨cleanPhysicalSlotChange C g i.val, mem_compl.mpr (by rw [clean_physical_slot_change_shared] exact mem_compl.mp i.property)⟩ invFun j := ⟨(cleanPhysicalSlotChange C g).symm j.val, mem_compl.mpr (by have h := clean_physical_slot_change_shared C g ((cleanPhysicalSlotChange C g).symm j.val) rw [Equiv.apply_symm_apply] at h exact mt h.mpr (mem_compl.mp j.property))⟩ left_inv i := Subtype.ext ((cleanPhysicalSlotChange C g).symm_apply_apply i.val) right_inv j := Subtype.ext ((cleanPhysicalSlotChange C g).apply_symm_apply j.val) noncomputable def physicalCleanFreshIndex {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) : Fin ((physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) ≃ Fin ((cleanFullSharedSlots (ell := ell) C g)ᶜ.card) := ((physicalFullSharedIndices (ell := ell) (C g))ᶜ.equivFin.symm.trans (physicalCleanUnsharedEquiv C g)).trans (cleanFullSharedSlots C g)ᶜ.equivFin noncomputable def physicalCleanFreshEquiv {G : Type*} (P : G → Type*) {J ell : ℕ} (C : G → Finset (Fin J)) : (∀ g, Fin ((physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) → P g) ≃ (∀ g, Fin ((cleanFullSharedSlots (ell := ell) C g)ᶜ.card) → P g) := Equiv.piCongrRight (fun g => Equiv.arrowCongr (physicalCleanFreshIndex C g) (Equiv.refl (P g))) section variable {G : Type*} (P : G → Type*) {J ell : ℕ} (C : G → Finset (Fin J)) (fresh : ∀ g, Fin ((physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) → P g) (g : G) include G P J ell C fresh g theorem physicalCleanFreshEquiv_apply_index (i : Fin ((physicalFullSharedIndices (ell := ell) (C g))ᶜ.card)) : physicalCleanFreshEquiv P C fresh g (physicalCleanFreshIndex C g i) = fresh g i := by change fresh g ((physicalCleanFreshIndex C g).symm (physicalCleanFreshIndex C g i)) = _ rw [Equiv.symm_apply_apply] theorem physicalCleanFreshEquiv_apply_subtype (i : ↥((physicalFullSharedIndices (ell := ell) (C g))ᶜ)) : physicalCleanFreshEquiv P C fresh g ((cleanFullSharedSlots C g)ᶜ.equivFin (physicalCleanUnsharedEquiv C g i)) = fresh g ((physicalFullSharedIndices (C g))ᶜ.equivFin i) := by have h := physicalCleanFreshEquiv_apply_index P C fresh g ((physicalFullSharedIndices (C g))ᶜ.equivFin i) simpa only [physicalCleanFreshIndex, Equiv.trans_apply, Equiv.symm_apply_apply] using h end theorem physicalCleanFreshEquiv_weight {G : Type*} [Fintype G] (P : G → Type*) {J ell : ℕ} (C : G → Finset (Fin J)) (μ : ∀ g, P g → ℝ) (fresh : ∀ g, Fin ((physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) → P g) : (∏ g, ∏ j, μ g (physicalCleanFreshEquiv P C fresh g j)) = ∏ g, ∏ i, μ g (fresh g i) := by apply prod_congr rfl intro g _ exact Equiv.prod_comp (physicalCleanFreshIndex C g).symm (fun i => μ g (fresh g i)) /- Reassembly commutes with the explicit encoding permutation. Arbitrary replacement memories include translated residues and do not need symmetry. -/ theorem physical_clean_reassemble_fresh {G : Type*} {P Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (x : ProductBoundedOrderedState P Z (fun _ => J + ell) B) (q : ∀ g, BoundedOrderedTuple (Z g) B) (fresh : ∀ g, Fin ((physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) → P g) : (productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B).symm ((productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fullActivePermutation (cleanPhysicalSlotChange C) x)).1, fun g => (fresh g, q g)) = fullActivePermutation (cleanPhysicalSlotChange C) ((productActiveMemorySplit (cleanFullSharedSlots C) B).symm ((productActiveMemorySplit (cleanFullSharedSlots C) B x).1, fun g => (physicalCleanFreshEquiv P C fresh g, q g))) := by funext g apply Prod.ext · funext i change (if hi : i ∈ physicalFullSharedIndices (ell := ell) (C g) then (x g).1 (cleanPhysicalSlotChange C g (((physicalFullSharedIndices (C g)).equivFin.symm ((physicalFullSharedIndices (C g)).equivFin ⟨i, hi⟩)).val)) else fresh g ((physicalFullSharedIndices (C g))ᶜ.equivFin ⟨i, mem_compl.mpr hi⟩)) = (if hc : cleanPhysicalSlotChange C g i ∈ cleanFullSharedSlots C g then (x g).1 (((cleanFullSharedSlots C g).equivFin.symm ((cleanFullSharedSlots C g).equivFin ⟨cleanPhysicalSlotChange C g i, hc⟩)).val) else physicalCleanFreshEquiv P C fresh g ((cleanFullSharedSlots C g)ᶜ.equivFin ⟨cleanPhysicalSlotChange C g i, mem_compl.mpr hc⟩)) have hshared := clean_physical_slot_change_shared C g i by_cases hi : i ∈ physicalFullSharedIndices (ell := ell) (C g) · have hc := hshared.mpr hi simp only [dif_pos hi, dif_pos hc, Equiv.symm_apply_apply] · have hc : cleanPhysicalSlotChange C g i ∉ cleanFullSharedSlots C g := mt hshared.mp hi rw [dif_neg hi, dif_neg hc] exact (physicalCleanFreshEquiv_apply_subtype P C fresh g ⟨i, mem_compl.mpr hi⟩).symm · rfl /- Weighted finite fresh integration is unchanged by the reindexing. -/ theorem physical_clean_fresh_weighted_sum {G : Type*} [Fintype G] [DecidableEq G] (P : G → Type*) [∀ g, Fintype (P g)] {J ell : ℕ} (C : G → Finset (Fin J)) (μ : ∀ g, P g → ℝ) (F : (∀ g, Fin ((cleanFullSharedSlots (ell := ell) C g)ᶜ.card) → P g) → ℂ) : (∑ fresh : ∀ g, Fin ((physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) → P g, ((∏ g, ∏ i, μ g (fresh g i) : ℝ) : ℂ) * F (physicalCleanFreshEquiv P C fresh)) = ∑ fresh : ∀ g, Fin ((cleanFullSharedSlots (ell := ell) C g)ᶜ.card) → P g, ((∏ g, ∏ j, μ g (fresh g j) : ℝ) : ℂ) * F fresh := by have h := (physicalCleanFreshEquiv P C).sum_comp (fun fresh => ((∏ g, ∏ j, μ g (fresh g j) : ℝ) : ℂ) * F fresh) simpa only [physicalCleanFreshEquiv_weight] using h end Bounty end section /- The shared dilation is preserved by the explicit physical slot encoding, on arbitrary repeated-label full states and arbitrary pending memories. -/ open Finset open scoped Classical namespace Bounty theorem clean_physical_shared_D_reencode {G : Type*} [Fintype G] {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (x : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) (aux : PhysicalAuxLabels P C) : physicalFullSharedD C (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (fullActivePermutation (cleanPhysicalSlotChange C) x)).1 aux = cleanFullSharedD C (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 aux := by unfold physicalFullSharedD cleanFullSharedD apply prod_congr rfl intro g _ congr 1 let S := physicalFullSharedIndices (ell := ell) (C g) let T := cleanFullSharedSlots (ell := ell) C g let τ := cleanPhysicalSlotChange (ell := ell) C g let e : ↥S ≃ ↥T := { toFun := fun i => ⟨τ i.val, (clean_physical_slot_change_shared C g i.val).mpr i.property⟩ invFun := fun j => ⟨τ.symm j.val, by apply (clean_physical_slot_change_shared C g (τ.symm j.val)).mp change τ (τ.symm j.val) ∈ T rw [Equiv.apply_symm_apply] exact j.property⟩ left_inv := fun i => Subtype.ext (Equiv.symm_apply_apply τ i.val) right_inv := fun j => Subtype.ext (Equiv.apply_symm_apply τ j.val) } change (∏ i : Fin S.card, ((x g).1 (τ (S.equivFin.symm i).val)).val) = ∏ j : Fin T.card, ((x g).1 (T.equivFin.symm j).val).val calc _ = ∏ i : S, ((x g).1 (τ i.val)).val := Equiv.prod_comp S.equivFin.symm (fun i => ((x g).1 (τ i.val)).val) _ = ∏ j : T, ((x g).1 j.val).val := Equiv.prod_comp e (fun j => ((x g).1 j.val).val) _ = _ := (Equiv.prod_comp T.equivFin.symm (fun j => ((x g).1 j.val).val)).symm end Bounty end section /- Exactly the performed original sample slots, with no auxiliary draws counted as births. -/ open Classical namespace Bounty section Coordinates variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : ∀ g, P g → ℕ) {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) def FullMixedEventBirthCoordinate : (tag : Option (J ⊕ K)) → (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullPermutationMixedEvent n S B A Δ D tag s → Type _ | none, _, _ => PEmpty | some (.inl _), _, e => (g : Fin N) × Fin (e.down g).1.val | some (.inr k), _, e => (g : Fin N) × {i : Fin (S k g)ᶜ.card // i ∉ (e.2 g).2.1} noncomputable def fullMixedBirthCoordinateEquiv (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) : FullMixedEventBirthCoordinate n S B A Δ D tag s e ≃ {a : FullMixedLocalBirthAddress S B tag // fullMixedEventBirthPerformed n S B A Δ D tag s e a} := by cases tag with | none => exact { toFun := fun i => PEmpty.elim i invFun := fun a => Fin.elim0 a.val.2 left_inv := fun i => PEmpty.elim i right_inv := fun a => Fin.elim0 a.val.2 } | some tag => cases tag with | inl j => refine { toFun := fun i => ⟨⟨i.1, ⟨i.2.val, lt_of_lt_of_le i.2.isLt (Nat.le_of_lt_succ (e.down i.1).1.isLt)⟩⟩, (full_mixed_ghost_birth_performed_iff n S B A Δ D j s e _ _).mpr i.2.isLt⟩ invFun := fun a => ⟨a.val.1, ⟨a.val.2.val, (full_mixed_ghost_birth_performed_iff n S B A Δ D j s e _ _).mp a.property⟩⟩ left_inv := ?_ right_inv := ?_ } · intro i; rfl · intro a; rfl | inr k => refine { toFun := fun i => ⟨⟨i.1, i.2.val⟩, (full_mixed_edge_birth_performed_iff (J := J) n S B A Δ D k s e _ _).mpr i.2.property⟩ invFun := fun a => ⟨a.val.1, ⟨a.val.2, (full_mixed_edge_birth_performed_iff (J := J) n S B A Δ D k s e _ _).mp a.property⟩⟩ left_inv := ?_ right_inv := ?_ } · intro i; rfl · intro a; rfl noncomputable def fullMixedBirthCoordinateData : (tag : Option (J ⊕ K)) → (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → (e : FullPermutationMixedEvent n S B A Δ D tag s) → FullMixedEventBirthCoordinate n S B A Δ D tag s e → FullMixedBornData n | none, _, _, i => PEmpty.elim i | some (.inl _), _, e, i => .inl ⟨i.1, (e.down i.1).2.2 i.2⟩ | some (.inr _), _, e, i => .inr ⟨i.1, (e.2 i.1).2.2.2 i.2⟩ theorem full_mixed_birth_coordinate_data (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) (i : FullMixedEventBirthCoordinate n S B A Δ D tag s e) : fullMixedEventBornData n S B A Δ D tag s e (fullMixedBirthCoordinateEquiv n S B A Δ D tag s e i).val = some (fullMixedBirthCoordinateData n S B A Δ D tag s e i) := by cases tag with | none => exact PEmpty.elim i | some tag => cases tag with | inl j => exact full_mixed_ghost_born_data n S B A Δ D j s e _ _ i.2.isLt | inr k => exact full_mixed_edge_born_data n S B A Δ D k s e _ _ i.2.property end Coordinates end Bounty end section /- The actual initial physical state has no pending labels outside its active ledger. -/ open Finset namespace Bounty theorem physical_full_empty_initial_ledger_covers {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (L : PhysicalMarkLists P J ell) : let x := physicalFullMemoryState C L (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) FullMixedLedgerCovers (fun g (p : ↥(P g)) => p.val) B (fullActiveInitialLedger x, x) := by intro x g constructor · intro i exact mem_image_of_mem _ (mem_univ i) · intro i exact Fin.elim0 i end Bounty end section /- Original recorded phases split into the local product and unchanged record observable. -/ namespace Bounty section Paths variable {I K X O : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (phase : ∀ k x, E k x → ℂ) theorem finite_event_path_map_local_phase (tag : I → K) (steps : List I) (x : X) (p : FiniteEventPath (fun i => E (tag i)) (fun i => target (tag i)) steps x) : finiteEventLocalPhase (fun i => E (tag i)) (fun i => target (tag i)) (fun i => phase (tag i)) steps x p = finiteEventLocalPhase E target phase (steps.map tag) x (finiteEventPathMapEquiv E target tag steps x p) := by induction steps generalizing x with | nil => rfl | cons i steps ih => rcases p with ⟨e, p⟩ exact congrArg (phase (tag i) x e * ·) (ih (target (tag i) x e) p) theorem finite_recorded_path_phase_factor (observe : ∀ k x, E k x → O) (steps : List K) (initial : X → List O) (F : List O → X → ℂ) (x : X) (p : FiniteEventPath E target steps x) : finiteRecordedPathPhase E target phase observe steps initial F x p = finiteEventLocalPhase E target phase steps x p * F (initial x ++ finiteEventPathObservations E target observe steps x p) (finiteEventPathTerminal E target steps x p) := by unfold finiteRecordedPathPhase rw [finite_ledger_event_local_phase] rw [Equiv.apply_symm_apply] theorem finite_recorded_schedule_phase_factor (tag : ℕ → K) (observe : ∀ i x, E (tag i) x → O) (steps : ℕ) (initial : X → List O) (F : List O → X → ℂ) (x : X) (p : FiniteEventPath E target ((List.range steps).map tag) x) : finiteRecordedSchedulePhase E target phase tag observe steps initial F x p = finiteEventLocalPhase E target phase ((List.range steps).map tag) x p * F (initial x ++ finiteEventPathObservations (fun i => E (tag i)) (fun i => target (tag i)) observe (List.range steps) x ((finiteEventPathMapEquiv E target tag (List.range steps) x).symm p)) (finiteEventPathTerminal E target ((List.range steps).map tag) x p) := by unfold finiteRecordedSchedulePhase rw [finite_recorded_path_phase_factor, finite_event_path_map_local_phase, finite_event_path_map_terminal, Equiv.apply_symm_apply] end Paths end Bounty end section /- A linear bound for the number of compatible balanced dyadic rectangles. -/ open Finset namespace Bounty theorem nat_finset_card_le_diameter (S : Finset ℕ) (N : ℕ) (hS : ∀ i ∈ S, ∀ j ∈ S, i ≤ j+N) : S.card ≤ N+1 := by classical by_cases hs : S.Nonempty · let lo := S.min' hs have hsub : S ⊆ Icc lo (lo+N) := by intro i hi exact mem_Icc.mpr ⟨S.min'_le i hi, hS i hi lo (S.min'_mem hs)⟩ have h := card_le_card hsub rw [Nat.card_Icc] at h omega · simp only [not_nonempty_iff_eq_empty.mp hs, card_empty] omega section variable (S : Finset (ℕ × ℕ)) {L : ℝ} (hS : ∀ v ∈ S, 0 < v.1 ∧ 0 < v.2 ∧ Real.exp L ≤ ((v.1*v.2 : ℕ) : ℝ) ∧ ((v.1*v.2 : ℕ) : ℝ) ≤ 33*Real.exp L) include S L hS theorem dyadic_pair_fiber_card_le (i : ℕ) : ((dyadicPairIndices S).filter (fun k => k.1 = i)).card ≤ 9 := by let T := (dyadicPairIndices S).filter (fun k => k.1 = i) have hinj : Set.InjOn Prod.snd (↑T : Set (ℕ × ℕ)) := by intro k hk l hl he have hk1 := (mem_filter.mp hk).2 have hl1 := (mem_filter.mp hl).2 exact Prod.ext (hk1.trans hl1.symm) he have hcard : (T.image Prod.snd).card = T.card := card_image_of_injOn hinj rw [← hcard] apply nat_finset_card_le_diameter _ 8 intro k hk l hl obtain ⟨p, hp, rfl⟩ := mem_image.mp hk obtain ⟨q, hq, rfl⟩ := mem_image.mp hl obtain ⟨hpS, hp1⟩ := mem_filter.mp hp obtain ⟨hqS, hq1⟩ := mem_filter.mp hq exact dyadic_pair_second_diameter S hS hpS hqS (hp1.trans hq1.symm) theorem dyadic_pair_indices_card_le : (dyadicPairIndices S).card ≤ 9 * (dyadicNatIndices (S.image Prod.fst)).card := by have hImage : (dyadicPairIndices S).image Prod.fst = dyadicNatIndices (S.image Prod.fst) := by simp only [dyadicPairIndices, dyadicNatIndices, Finset.image_image, Function.comp_def] calc _ = ∑ i ∈ (dyadicPairIndices S).image Prod.fst, ((dyadicPairIndices S).filter (fun k => k.1 = i)).card := card_eq_sum_card_image _ _ _ ≤ ∑ _i ∈ (dyadicPairIndices S).image Prod.fst, 9 := sum_le_sum (fun i _ => dyadic_pair_fiber_card_le S hS i) _ = _ := by simp only [sum_const, smul_eq_mul, hImage]; omega end theorem dyadic_balanced_pair_count (S : Finset (ℕ × ℕ)) {κ L : ℝ} (hκ : 0 ≤ κ) (hL : 0 ≤ L) (hS : ∀ v ∈ S, 0 < v.1 ∧ 0 < v.2 ∧ Real.exp (((1/2 : ℝ)-2*κ)*L) ≤ (v.1 : ℝ) ∧ (v.1 : ℝ) ≤ Real.exp (((1/2 : ℝ)+2*κ)*L) ∧ Real.exp L ≤ ((v.1*v.2 : ℕ) : ℝ) ∧ ((v.1*v.2 : ℕ) : ℝ) ≤ 33*Real.exp L) : ((dyadicPairIndices S).card : ℝ) ≤ (36/Real.log 2+18)*(κ*L+1) := by have hc := dyadic_pair_indices_card_le S (fun v hv => ⟨(hS v hv).1, (hS v hv).2.1, (hS v hv).2.2.2.2⟩) have hspan : ((1/2 : ℝ)-2*κ)*L ≤ ((1/2 : ℝ)+2*κ)*L := by nlinarith have hfirst := dyadic_indices_card_window (S.image Prod.fst) hspan (by intro n hn obtain ⟨v, hv, rfl⟩ := mem_image.mp hn exact ⟨(hS v hv).1, (hS v hv).2.2.1, (hS v hv).2.2.2.1⟩) have hcR : ((dyadicPairIndices S).card : ℝ) ≤ 9*((dyadicNatIndices (S.image Prod.fst)).card : ℝ) := by exact_mod_cast hc have h2 : 0 < Real.log 2 := Real.log_pos (by norm_num) have he : 9*((((1/2 : ℝ)+2*κ)*L-((1/2 : ℝ)-2*κ)*L)/Real.log 2+2) = (36/Real.log 2)*(κ*L)+18 := by ring have hfinal : (36/Real.log 2)*(κ*L)+18 ≤ (36/Real.log 2+18)*(κ*L+1) := by have : 0 ≤ 36/Real.log 2 := by positivity nlinarith exact (hcR.trans (mul_le_mul_of_nonneg_left hfirst (by norm_num))).trans ((le_of_eq he).trans hfinal) end Bounty end section /- Exact natural endpoints and side lengths for the half-open dyadic buckets. -/ open Finset namespace Bounty theorem dyadic_index_interval {n k : ℕ} (hn : 0 < n) (hk : n.log2 = k) : n ∈ Ioc (2^k-1) (2^(k+1)-1) := by have h := (Nat.log2_eq_iff hn.ne').mp hk have hp : 0 < 2^k := by positivity apply mem_Ioc.mpr omega theorem dyadic_index_side_length (k : ℕ) : ((2^(k+1)-1 : ℕ) : ℝ) - ((2^k-1 : ℕ) : ℝ) = (2 : ℝ)^k := by have h1 : 1 ≤ (2 : ℕ)^k := Nat.succ_le_of_lt (by positivity) have h2 : 1 ≤ (2 : ℕ)^(k+1) := Nat.succ_le_of_lt (by positivity) rw [Nat.cast_sub h1, Nat.cast_sub h2] push_cast rw [pow_succ] ring theorem dyadic_pair_bucket_rectangle (S : Finset (ℕ × ℕ)) (hS : ∀ v ∈ S, 0 < v.1 ∧ 0 < v.2) (k : ℕ × ℕ) {v : ℕ × ℕ} (hv : v ∈ dyadicPairBucket S k) : v.1 ∈ Ioc (2^k.1-1) (2^(k.1+1)-1) ∧ v.2 ∈ Ioc (2^k.2-1) (2^(k.2+1)-1) := by obtain ⟨hvS, hk⟩ := mem_filter.mp hv exact ⟨dyadic_index_interval (hS v hvS).1 (congrArg Prod.fst hk), dyadic_index_interval (hS v hvS).2 (congrArg Prod.snd hk)⟩ theorem dyadic_pair_bucket_scales (S : Finset (ℕ × ℕ)) (hS : ∀ v ∈ S, 0 < v.1 ∧ 0 < v.2) {k : ℕ × ℕ} (hk : k ∈ dyadicPairIndices S) : ∃ v ∈ S, (2 : ℝ)^k.1 ≤ (v.1 : ℝ) ∧ (2 : ℝ)^k.2 ≤ (v.2 : ℝ) ∧ (2 : ℝ)^k.1 * (2 : ℝ)^k.2 ≤ ((v.1*v.2 : ℕ) : ℝ) := by obtain ⟨v, hv, rfl⟩ := mem_image.mp hk have hm := ((Nat.log2_eq_iff (hS v hv).1.ne').mp rfl).1 have hn := ((Nat.log2_eq_iff (hS v hv).2.ne').mp rfl).1 have hmR : (2 : ℝ)^v.1.log2 ≤ v.1 := by exact_mod_cast hm have hnR : (2 : ℝ)^v.2.log2 ≤ v.2 := by exact_mod_cast hn refine ⟨v, hv, hmR, hnR, ?_⟩ rw [Nat.cast_mul] exact mul_le_mul hmR hnR (by positivity) (by positivity) end Bounty end section /- A positive potential depending only on the original pending-memory lengths. -/ open Finset Classical namespace Bounty noncomputable def productLengthLyapunov {G : Type*} [Fintype G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (v : ℝ) (s : ProductBoundedOrderedState P Z M B) : ℝ := ∏ g, v ^ (s g).2.1.val theorem productLengthLyapunov_nonneg {G : Type*} [Fintype G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} {v : ℝ} (hv : 0 ≤ v) (s : ProductBoundedOrderedState P Z M B) : 0 ≤ productLengthLyapunov v s := prod_nonneg fun _ _ => pow_nonneg hv _ section variable {G : Type*} [sharedInstance1 : Fintype G] {P Z : G → Type*} {M : G → ℕ} include G sharedInstance1 P Z M theorem productLengthLyapunov_eq_total {B : ℕ} (v : ℝ) (s : ProductBoundedOrderedState P Z M B) : productLengthLyapunov v s = v ^ productTotalMemory s := prod_pow_eq_pow_sum univ (fun g => (s g).2.1.val) v theorem productLengthLyapunov_split (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (v : ℝ) (s : ProductBoundedOrderedState P Z M B) : productLengthLyapunov v ((productActiveMemorySplit S B s).2) = productLengthLyapunov v s := rfl theorem productLengthLyapunov_reassemble (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (v : ℝ) (c : SharedActiveLabels P S) (s : ProductBoundedOrderedState P Z (fun g => (S g)ᶜ.card) B) : productLengthLyapunov v ((productActiveMemorySplit S B).symm (c, s)) = productLengthLyapunov v s := rfl end theorem finite_product_gated_row_le {G : Type*} [Fintype G] [DecidableEq G] {E : G → Type*} [∀ g, Fintype (E g)] (w L : ∀ g, E g → ℝ) (hL : ∀ g e, 0 ≤ L g e) (R : G → ℝ) (hrow : ∀ g, ∑ e, |w g e| * L g e ≤ R g) (allowed : (∀ g, E g) → Prop) [DecidablePred allowed] : (∑ e : ∀ g, E g, |if allowed e then ∏ g, w g (e g) else 0| * ∏ g, L g (e g)) ≤ ∏ g, R g := by calc _ ≤ ∑ e : ∀ g, E g, ∏ g, |w g (e g)| * L g (e g) := by apply sum_le_sum intro e _ by_cases h : allowed e · simp only [if_pos h, abs_prod, prod_mul_distrib, le_refl] · simp only [if_neg h, abs_zero, zero_mul] exact prod_nonneg fun g _ => mul_nonneg (abs_nonneg _) (hL g _) _ = ∏ g, ∑ e, |w g e| * L g e := (Fintype.prod_sum (fun g e => |w g e| * L g e)).symm _ ≤ _ := prod_le_prod₀ (fun g _ => sum_nonneg fun e _ => mul_nonneg (abs_nonneg _) (hL g e)) (fun g _ => hrow g) end Bounty end section /- Read positions of an original range-indexed path without adding events or states. -/ namespace Bounty section Schedule variable {X O : Type*} (E : ℕ → X → Type*) (target : ∀ i x, E i x → X) theorem event_sigma_transport_fst {i j : ℕ} (h : i = j) (u : Σ y, E i y) : (cast (congrArg (fun z => Σ y, E z y) h) u).1 = u.1 := by subst j rfl theorem event_sigma_transport_apply {Y : Type*} (F : ∀ i x, E i x → Y) {i j : ℕ} (h : i = j) (u : Σ y, E i y) : F j (cast (congrArg (fun z => Σ y, E z y) h) u).1 (cast (congrArg (fun z => Σ y, E z y) h) u).2 = F i u.1 u.2 := by subst j rfl def finiteScheduleOccurrence (m : ℕ) (x : X) (p : FiniteEventPath E target (List.range m) x) (i : Fin m) : Σ y, E i.val y := let a : Fin (List.range m).length := ⟨i.val, by simpa only [List.length_range] using i.isLt⟩ cast (congrArg (fun z => Σ y, E z y) (show (List.range m).get a = i.val by simp only [List.get_eq_getElem, List.getElem_range, a])) (finiteEventPathOccurrence E target (List.range m) x p a) theorem finite_schedule_occurrence_fst (m : ℕ) (x : X) (p : FiniteEventPath E target (List.range m) x) (i : Fin m) : (finiteScheduleOccurrence E target m x p i).1 = (finiteEventPathOccurrence E target (List.range m) x p ⟨i.val, by simpa only [List.length_range] using i.isLt⟩).1 := event_sigma_transport_fst E (by simp only [List.get_eq_getElem, List.getElem_range]) _ theorem finite_schedule_occurrence_apply {Y : Type*} (F : ∀ i x, E i x → Y) (m : ℕ) (x : X) (p : FiniteEventPath E target (List.range m) x) (i : Fin m) : F i.val (finiteScheduleOccurrence E target m x p i).1 (finiteScheduleOccurrence E target m x p i).2 = F ((List.range m).get ⟨i.val, by simpa only [List.length_range] using i.isLt⟩) (finiteEventPathOccurrence E target (List.range m) x p ⟨i.val, by simpa only [List.length_range] using i.isLt⟩).1 (finiteEventPathOccurrence E target (List.range m) x p ⟨i.val, by simpa only [List.length_range] using i.isLt⟩).2 := event_sigma_transport_apply E F (by simp only [List.get_eq_getElem, List.getElem_range]) _ theorem finite_schedule_supported_invariant (phase : ∀ i x, E i x → ℂ) (Q : X → Prop) (hstep : ∀ i x e, Q x → phase i x e ≠ 0 → Q (target i x e)) (m : ℕ) (x : X) (p : FiniteEventPath E target (List.range m) x) (hx : Q x) (hp : finiteEventLocalPhase E target phase (List.range m) x p ≠ 0) (i : Fin m) : Q (finiteScheduleOccurrence E target m x p i).1 ∧ Q (target i.val (finiteScheduleOccurrence E target m x p i).1 (finiteScheduleOccurrence E target m x p i).2) := by have h := finite_event_local_phase_supported_invariant E target phase Q hstep (List.range m) x p hx hp ⟨i.val, by simpa only [List.length_range] using i.isLt⟩ constructor · exact (congrArg Q (finite_schedule_occurrence_fst E target m x p i)).mpr h.1 · exact (congrArg Q (finite_schedule_occurrence_apply E target target m x p i)).mpr h.2 theorem finite_schedule_source_after (m : ℕ) (x : X) (p : FiniteEventPath E target (List.range m) x) (i : ℕ) (hi : i + 1 < m) : (finiteScheduleOccurrence E target m x p ⟨i + 1, hi⟩).1 = target i (finiteScheduleOccurrence E target m x p ⟨i, by omega⟩).1 (finiteScheduleOccurrence E target m x p ⟨i, by omega⟩).2 := by have h := finite_event_occurrence_source_after E target (List.range m) x p i (by simpa only [List.length_range] using hi) exact (finite_schedule_occurrence_fst E target m x p ⟨i + 1, hi⟩).trans (h.trans (finite_schedule_occurrence_apply E target target m x p ⟨i, by omega⟩).symm) theorem finite_schedule_observations_get (observe : ∀ i x, E i x → O) (m : ℕ) (x : X) (p : FiniteEventPath E target (List.range m) x) (i : Fin m) : (finiteEventPathObservations E target observe (List.range m) x p).get ⟨i.val, by rw [finite_event_path_observations_length, List.length_range]; exact i.isLt⟩ = observe i.val (finiteScheduleOccurrence E target m x p i).1 (finiteScheduleOccurrence E target m x p i).2 := by have h := finite_event_observations_get E target observe (List.range m) x p i.val (by simpa only [List.length_range] using i.isLt) exact h.trans (finite_schedule_occurrence_apply E target observe m x p i).symm end Schedule end Bounty end section /- On a clean event, the tested births are exactly the raw fresh draws. The equivalence retains the actual bounded event target and its fallback. -/ open Finset open scoped Classical namespace Bounty theorem unrestricted_clean_fresh_allowed {P : Type*} (F : Finset P) (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) (he : e.1 = ∅ ∧ e.2.1 = ∅) : (∀ i, (unrestrictedBoundedEventTarget n Δ D t B s e).1 i ∉ F) ↔ ∀ i, e.2.2.2 i ∉ F := by rcases e with ⟨stores, promotions, select, fresh⟩ rcases he with ⟨hs, hp⟩ dsimp only at hs hp subst stores subst promotions have hs := unrestricted_clean_promotion_unique (unrestrictedResidueEligible n Δ D s.2.2) select subst select have hlen := unrestricted_clean_output_length s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) (unrestrictedResidueEligible n Δ D s.2.2) have hb : (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) ∅ ∅ (unrestrictedCleanPromotion t (unrestrictedResidueEligible n Δ D s.2.2))).1 ≤ B := by rw [hlen] exact Nat.le_of_lt_succ s.2.1.isLt unfold unrestrictedBoundedEventTarget rw [dif_pos hb] simp only [unrestrictedEdgeTarget, unrestrictedTargetLabels, Finset.notMem_empty, dite_false] constructor · intro h i exact h i.val · intro h i exact h ⟨i, Finset.notMem_empty i⟩ theorem clean_initial_birth_allowed_event_target {G : Type*} {P : G → Finset ℕ} {J ell B : ℕ} (F : ∀ g, Finset (P g)) (C : G → Finset (Fin J)) (Δ D : G → ℤ) (source : RepeatedBigLists P J ell) (s : ProductBoundedOrderedState (fun g => ↥(P g)) (fun g => UnrestrictedResidueParticle (fun q : P g => q.val)) (fun g => (cleanFullSharedSlots (ell := ell) C g)ᶜ.card) B) (e : UnrestrictedJointEvent (fun g (q : P g) => q.val) Δ D (fun g => (cleanFullSharedSlots (ell := ell) C g)ᶜ.card) B s) (he : ∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅) : cleanInitialBirthAllowed F C (repeatedBigFill C source (cleanFullFreshEquiv P C (fun g => (unrestrictedJointEventTarget (fun g (q : P g) => q.val) Δ D (fun g => (cleanFullSharedSlots (ell := ell) C g)ᶜ.card) B s e g).1))) ↔ ∀ g i, (e g).2.2.2 i ∉ F g := by rw [clean_initial_birth_allowed_fill] exact forall_congr' fun g => unrestricted_clean_fresh_allowed (F g) (fun q : P g => q.val) (Δ g) (D g) _ B (s g) (e g) (he g) end Bounty end section /- Initial-ledger exclusions apply to fresh active target slots only. Their mass is bounded under the exact normalized reciprocal-prime law; shared labels and auxiliary labels are not excluded here. -/ open Finset open scoped Classical namespace Bounty def repeatedBigFreshHits {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (F : ∀ g, Finset (P g)) (C : G → Finset (Fin J)) (target : RepeatedBigLists P J ell) : Prop := ∃ g, ∃ s : {s : PhysicalSlots J ell // repeatedBigUnshared C g s}, target g s.val ∈ F g noncomputable def repeatedBigInitialForbiddenProbability {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (F : ∀ g, Finset (P g)) (Pmin : ℝ) : ℝ := ∑ g, ((ell + (C g).card : ℕ) : ℝ) * (F g).card / (V g * Pmin) theorem repeatedBigInitialForbiddenProbability_nonneg {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (F : ∀ g, Finset (P g)) {Pmin : ℝ} (hV : ∀ g, 0 ≤ V g) (hPmin : 0 ≤ Pmin) : 0 ≤ repeatedBigInitialForbiddenProbability (ell := ell) V C F Pmin := by unfold repeatedBigInitialForbiddenProbability exact sum_nonneg fun g _ => div_nonneg (by positivity) (mul_nonneg (hV g) hPmin) section variable {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (F : ∀ g, Finset (P g)) (C : G → Finset (Fin J)) include G P J ell F C theorem repeated_big_fresh_hits_iff_not_allowed (target : RepeatedBigLists P J ell) : repeatedBigFreshHits F C target ↔ ¬ cleanInitialBirthAllowed F C target := by constructor · rintro ⟨g, s, hs⟩ h exact h g s.val s.property hs · intro h by_contra hn apply h intro g s hs hf exact hn ⟨g, ⟨s, hs⟩, hf⟩ theorem repeated_big_fresh_hits_fill (source : RepeatedBigLists P J ell) (fresh : RepeatedBigFresh P C ell) : repeatedBigFreshHits F C (repeatedBigFill C source fresh) ↔ ∃ g s, fresh g s ∈ F g := by simp only [repeatedBigFreshHits, repeated_big_fill_unshared] end theorem repeated_big_unshared_type_card {G : Type*} {J ell : ℕ} (C : G → Finset (Fin J)) (g : G) : Fintype.card {s : PhysicalSlots J ell // repeatedBigUnshared C g s} = ell + (C g).card := by have he : {s : PhysicalSlots J ell // repeatedBigUnshared C g s} ≃ ↥(physicalUnsharedSlots (ell := ell) (C g)) := Equiv.subtypeEquivRight (repeated_big_unshared_iff_physical C g) rw [Fintype.card_congr he, Fintype.card_coe, physical_unshared_slots_card] section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (F : ∀ g, Finset (P g)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) include G sharedInstance1 P J ell V C F hV hMass Pmin hPmin hp /- The initial forbidden set is tested only at newly drawn target slots. -/ theorem repeated_big_initial_forbidden_fresh_mass_le : (∑ fresh : RepeatedBigFresh P C ell, repeatedBigFreshMass V (fun _ _ => 1) C fresh * (if ∃ g s, fresh g s ∈ F g then 1 else 0)) ≤ ∑ g, ((ell + (C g).card : ℕ) : ℝ) * (F g).card / (V g * Pmin) := by have h := finite_product_forbidden_hits_mass_le (A := fun g => {s : PhysicalSlots J ell // repeatedBigUnshared C g s}) (fun g => physicalLabelLaw V g) (physical_label_law_nonneg V (fun g => (hV g).le)) (fun g => physical_label_law_sum V g (hV g) (hMass g)) F (fun g => 1 / (V g * Pmin)) (fun g p => physical_label_law_atom_le V g (hV g) hPmin p (hp g p)) simp only [repeated_big_unshared_type_card, mul_one_div] at h simp only [repeatedBigFreshMass, tiltedPhysicalBirthLaw, div_one] convert h using 1 apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro f _ split_ifs <;> rfl /- Exact compatible-target row bound. Shared target coordinates contribute no loss, even when the source or target labels repeat. -/ theorem repeated_big_initial_forbidden_target_mass_le (source : RepeatedBigLists P J ell) : (∑ target : RepeatedBigLists P J ell, if repeatedBigSharedCompatible C source target then repeatedBigTargetMass V (fun _ _ => 1) C target * (if repeatedBigFreshHits F C target then 1 else 0) else 0) ≤ ∑ g, ((ell + (C g).card : ℕ) : ℝ) * (F g).card / (V g * Pmin) := by rw [← repeated_big_target_sum C source] simp_rw [repeated_big_fill_mass, repeated_big_fresh_hits_fill] exact repeated_big_initial_forbidden_fresh_mass_le V C F hV hMass hPmin hp end /- Uniform finite budget when both the probe and initial-ledger sizes are bounded. -/ theorem repeated_big_initial_forbidden_probability_le {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell m : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (F : ∀ g, Finset (P g)) {v Pmin : ℝ} (hv : 0 < v) (hPmin : 0 < Pmin) (hV : ∀ g, v ≤ V g) (hC : ∀ g, (C g).card ≤ m) (hF : ∀ g, (F g).card ≤ J + ell) : repeatedBigInitialForbiddenProbability (ell := ell) V C F Pmin ≤ (Fintype.card G : ℝ) * ((ell + m : ℕ) : ℝ) * ((J + ell : ℕ) : ℝ) / (v * Pmin) := by unfold repeatedBigInitialForbiddenProbability calc _ ≤ ∑ _g : G, ((ell + m : ℕ) : ℝ) * ((J + ell : ℕ) : ℝ) / (v * Pmin) := by apply sum_le_sum intro g _ apply div_le_div₀ (by positivity) · apply mul_le_mul · exact_mod_cast Nat.add_le_add_left (hC g) ell · exact_mod_cast hF g · positivity · positivity · exact mul_pos hv hPmin · exact mul_le_mul_of_nonneg_right (hV g) hPmin.le _ = _ := by simp only [sum_const, card_univ, nsmul_eq_mul]; ring end Bounty end section /- Forest estimates for the actual dependent sample coordinates of an original event. -/ open Finset Classical namespace Bounty theorem labeled_anchored_forest_sum_le_equiv {I : Type*} [Fintype I] [DecidableEq I] (Z : I → Type*) [∀ i, Fintype (Z i)] {α : Type*} [Fintype α] [DecidableEq α] {n : ℕ} (e : Fin n ≃ I) (label : ∀ i, Z i → α) (w : ∀ i, Z i → ℝ) (code : BirthForestCode n) (anchor : Fin n → Option α) (M ε : I → ℝ) (hM : ∀ i, 0 ≤ M i) (hε : ∀ i, 0 ≤ ε i) (hw : ∀ i z, 0 ≤ w i z) (hsum : ∀ i, ∑ z, w i z ≤ M i) (hatom : ∀ i a, finiteLabelMass (label i) (w i) a ≤ ε i) : (∑ f : ∀ i, Z i, if birthForestEqualValues code (fun j => label (e j) (f (e j))) ∧ birthLabelsAnchored anchor (fun j => label (e j) (f (e j))) then ∏ i, w i (f i) else 0) ≤ ∏ j, match code j with | some _ => ε (e j) | none => match anchor j with | none => M (e j) | some _ => ε (e j) := by rw [← (Equiv.piCongrLeft Z e).sum_comp] have hp (f : ∀ j, Z (e j)) : (∏ i, w i ((Equiv.piCongrLeft Z e) f i)) = ∏ j, w (e j) (f j) := by rw [← e.prod_comp] simp only [Equiv.piCongrLeft_apply_apply] simp_rw [Equiv.piCongrLeft_apply_apply, hp] exact labeled_anchored_birth_forest_sum_le (fun j => Z (e j)) (fun j => label (e j)) (fun j => w (e j)) code anchor (M ∘ e) (ε ∘ e) (fun j => hM (e j)) (fun j => hε (e j)) (fun j => hw (e j)) (fun j => hsum (e j)) (fun j => hatom (e j)) theorem labeled_anchored_forest_continuation_le {I : Type*} [Fintype I] [DecidableEq I] (Z : I → Type*) [∀ i, Fintype (Z i)] {α : Type*} [Fintype α] [DecidableEq α] {n : ℕ} (e : Fin n ≃ I) (label : ∀ i, Z i → α) (w : ∀ i, Z i → ℝ) (code : BirthForestCode n) (anchor : Fin n → Option α) (M ε : I → ℝ) (hM : ∀ i, 0 ≤ M i) (hε : ∀ i, 0 ≤ ε i) (hw : ∀ i z, 0 ≤ w i z) (hsum : ∀ i, ∑ z, w i z ≤ M i) (hatom : ∀ i a, finiteLabelMass (label i) (w i) a ≤ ε i) (F : (∀ i, Z i) → ℝ) (K H : ℝ) (hK : 0 ≤ K) (hH : 0 ≤ H) (hF : ∀ f, F f ≤ H) : (∑ f : ∀ i, Z i, if birthForestEqualValues code (fun j => label (e j) (f (e j))) ∧ birthLabelsAnchored anchor (fun j => label (e j) (f (e j))) then (K * ∏ i, w i (f i)) * F f else 0) ≤ K * H * ∏ j, match code j with | some _ => ε (e j) | none => match anchor j with | none => M (e j) | some _ => ε (e j) := by calc _ ≤ K * H * (∑ f : ∀ i, Z i, if birthForestEqualValues code (fun j => label (e j) (f (e j))) ∧ birthLabelsAnchored anchor (fun j => label (e j) (f (e j))) then ∏ i, w i (f i) else 0) := by rw [mul_sum] apply sum_le_sum intro f _ split_ifs · calc _ ≤ (K * ∏ i, w i (f i)) * H := mul_le_mul_of_nonneg_left (hF f) (mul_nonneg hK (prod_nonneg fun i _ => hw i (f i))) _ = _ := by ring · simp _ ≤ _ := mul_le_mul_of_nonneg_left (labeled_anchored_forest_sum_le_equiv Z e label w code anchor M ε hM hε hw hsum hatom) (mul_nonneg hK hH) end Bounty end section /- Restrict an existing chronological forest to an ordered block of sampled coordinates. -/ open Classical namespace Bounty noncomputable def restrictedBirthCode {N m : ℕ} (embed : Fin m → Fin N) (code : BirthForestCode N) : BirthForestCode m := fun j => match code (embed j) with | none => none | some p => if h : ∃ k : Fin j.val, embed (birthForestParentEmbedding j k) = birthForestParentEmbedding (embed j) p then some (Classical.choose h) else none noncomputable def restrictedBirthAnchors {N m : ℕ} {α : Type*} (embed : Fin m → Fin N) (code : BirthForestCode N) (values : Fin N → α) : Fin m → Option α := fun j => match code (embed j) with | none => none | some p => if ∃ k : Fin j.val, embed (birthForestParentEmbedding j k) = birthForestParentEmbedding (embed j) p then none else some (values (birthForestParentEmbedding (embed j) p)) theorem restricted_birth_parent_not_in_range {N m : ℕ} (embed : Fin m → Fin N) (hmono : StrictMono embed) (j : Fin m) (p : Fin (embed j).val) (h : ¬ ∃ k : Fin j.val, embed (birthForestParentEmbedding j k) = birthForestParentEmbedding (embed j) p) : birthForestParentEmbedding (embed j) p ∉ Set.range embed := by rintro ⟨k, hk⟩ have hkj : k < j := hmono.lt_iff_lt.mp (by rw [hk]; exact p.isLt) exact h ⟨⟨k.val, hkj⟩, hk⟩ theorem restricted_birth_forest_iff {N m : ℕ} {α : Type*} (embed : Fin m → Fin N) (code : BirthForestCode N) (values : Fin N → α) : (∀ j p, code (embed j) = some p → values (embed j) = values (birthForestParentEmbedding (embed j) p)) ↔ birthForestEqualValues (restrictedBirthCode embed code) (values ∘ embed) ∧ birthLabelsAnchored (restrictedBirthAnchors embed code values) (values ∘ embed) := by constructor · intro h constructor · intro j k hk cases hc : code (embed j) with | none => simp [restrictedBirthCode, hc] at hk | some p => by_cases he : ∃ r : Fin j.val, embed (birthForestParentEmbedding j r) = birthForestParentEmbedding (embed j) p · have hk' : Classical.choose he = k := by simpa only [restrictedBirthCode, hc, dif_pos he, Option.some.injEq] using hk change values (embed j) = values (embed (birthForestParentEmbedding j k)) rw [← hk', Classical.choose_spec he] exact h j p hc · simp only [restrictedBirthCode, hc, dif_neg he] at hk cases hk · intro j a ha cases hc : code (embed j) with | none => simp [restrictedBirthAnchors, hc] at ha | some p => by_cases he : ∃ r : Fin j.val, embed (birthForestParentEmbedding j r) = birthForestParentEmbedding (embed j) p · simp only [restrictedBirthAnchors, hc, if_pos he] at ha cases ha · have ha' : values (birthForestParentEmbedding (embed j) p) = a := by simpa only [restrictedBirthAnchors, hc, if_neg he, Option.some.injEq] using ha exact (h j p hc).trans ha' · rintro ⟨hi, ha⟩ j p hp by_cases he : ∃ r : Fin j.val, embed (birthForestParentEmbedding j r) = birthForestParentEmbedding (embed j) p · have hk : restrictedBirthCode embed code j = some (Classical.choose he) := by simp only [restrictedBirthCode, hp, dif_pos he] have hv := hi j (Classical.choose he) hk change values (embed j) = values (embed (birthForestParentEmbedding j (Classical.choose he))) at hv rwa [Classical.choose_spec he] at hv · apply ha j (values (birthForestParentEmbedding (embed j) p)) simp only [restrictedBirthAnchors, hp, if_neg he] end Bounty end section /- Reindex all pending memories inside the complete coupled edge sum. -/ open Finset Classical namespace Bounty section Joint variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (τ : ∀ g, Equiv.Perm (Fin (s g).2.1.val)) noncomputable def jointEdgeMemoryReindex : UnrestrictedJointEvent n Δ D t B s ≃ UnrestrictedJointEvent n Δ D t B (productMemoryReindex s τ) := Equiv.piCongrRight fun g => boundedEdgeMemoryReindex (n g) (Δ g) (D g) (s g) (τ g) theorem joint_edge_reindex_test (e : UnrestrictedJointEvent n Δ D t B s) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : f (unrestrictedJointEventTarget n Δ D t B (productMemoryReindex s τ) (jointEdgeMemoryReindex n Δ D t B s τ e)) = f (unrestrictedJointEventTarget n Δ D t B s e) := by apply product_memory_test_congr f hf intro g h hh exact bounded_edge_reindex_test (n g) (Δ g) (D g) (s g) (τ g) (e g) h hh omit [Fintype G] [DecidableEq G] in theorem joint_edge_reindex_active (e : UnrestrictedJointEvent n Δ D t B s) (g : G) : (unrestrictedJointEventTarget n Δ D t B (productMemoryReindex s τ) (jointEdgeMemoryReindex n Δ D t B s τ e) g).1 = (unrestrictedJointEventTarget n Δ D t B s e g).1 := bounded_edge_reindex_active (n g) (Δ g) (D g) (s g) (τ g) (e g) omit [DecidableEq G] in theorem joint_edge_reindex_total (e : UnrestrictedJointEvent n Δ D t B s) : productTotalMemory (unrestrictedJointEventTarget n Δ D t B (productMemoryReindex s τ) (jointEdgeMemoryReindex n Δ D t B s τ e)) = productTotalMemory (unrestrictedJointEventTarget n Δ D t B s e) := by apply sum_congr rfl intro g _ exact congrArg Fin.val (bounded_edge_reindex_length (n g) (Δ g) (D g) (s g) (τ g) (e g)) omit [DecidableEq G] in theorem joint_edge_reindex_weight (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (e : UnrestrictedJointEvent n Δ D t B s) : unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B (productMemoryReindex s τ) (jointEdgeMemoryReindex n Δ D t B s τ e) = unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B s e := by unfold unrestrictedJointCutoffEventWeight rw [joint_edge_reindex_total] have hs : productTotalMemory (productMemoryReindex s τ) = productTotalMemory s := rfl rw [hs] split_ifs · apply prod_congr rfl intro g _ exact bounded_edge_reindex_weight (n g) (Δ g) (D g) (s g) (τ g) (e g) (μ g) ρ (V g) · rfl end Joint end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) variable (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V ρ : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) (cap : ℕ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] /- The normalized actual joint residue history equals a single real capped moving history on the tagged prime pool, with every total output cap retained. -/ include hstep in theorem physical_joint_adjacent_normalized_eq_capped_moving : ((∏ g, ∏ s : PhysicalSlots J ell, β g (L 0 g s) / V g : ℝ) : ℂ) * physicalJointAdjacentRawHistory C aux k L a σ τ hcompat hlist hP hdis hk β η V ρ hV cap = (ghostPhaseCappedMovingDampedHistory (fun p : PhysicalPrime P => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity L p.1) j p.2) (fun p => physicalResidueAbsoluteHit a p.1 p.2) (fun p j => η p.1 (globalBirthFiniteIndex n j)) (fun p => β p.1 p.2) (fun p => V p.1) (fun p _ => ρ p.1) (fun _ => cap) (fun _ => cap) n : ℂ) := by rw [physical_joint_adjacent_normalized_history_trace] simp only [ghost_phase_run_initial_eq_tilted] have hc := global_birth_joint_initial_trace_output_only (fun i g => physicalGroupBareAtomicActivity L g i) (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V ρ hV cap) (fun _ => cap) (fun g p => β g p / V g) (fun z => ((∏ g, ∏ p, ghostPhaseTerminal (physicalGroupPhaseActivity (L (Fin.last n)) g p) (z g p) : ℝ) : ℂ)) (2 * n + 1) simp only [physical_group_bare_atomic_activity_initial, finiteChronologicalPrefix] at hc rw [hc] let f := fun z : (p : PhysicalPrime P) → GhostPhaseState (ZMod p.2.val) => ∏ p, ghostPhaseRunInitial (physicalGroupPhaseActivity (L 0) p.1 p.2) (β p.1 p.2) (V p.1) (z p) let q := fun z : (p : PhysicalPrime P) → GhostPhaseState (ZMod p.2.val) => ∏ p, ghostPhaseTerminal (physicalGroupPhaseActivity (L (Fin.last n)) p.1 p.2) (z p) have he := complex_trace_eq_real_alternating_equiv (globalBirthFlattenEquiv (P := fun g : Fin N => ↥(P g)) (R := fun g p => ZMod p.val)) (physicalJointCappedVisitKernel L β η ρ cap) (physicalJointCappedMovingEdgeKernel L a β V ρ cap) (fun i => globalBirthJointKernel (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V ρ hV cap i) cap) f q n (fun i hi z w => physical_joint_adjacent_kernel_to_real C aux k L a σ τ hstep hcompat hlist hP hdis hk β η V ρ hV cap i hi z w) have h0 (g : Fin N) : globalBirthFiniteActivity (physicalGroupBareFiniteActivity L g) 0 = physicalGroupPhaseActivity (L 0) g := global_birth_finite_activity_at (physicalGroupBareFiniteActivity L g) (0 : Fin (n + 1)) have hn (g : Fin N) : globalBirthFiniteActivity (physicalGroupBareFiniteActivity L g) n = physicalGroupPhaseActivity (L (Fin.last n)) g := global_birth_finite_activity_at (physicalGroupBareFiniteActivity L g) (Fin.last n) calc _ = (finiteAlternatingPairing (physicalJointCappedVisitKernel L β η ρ cap) (physicalJointCappedMovingEdgeKernel L a β V ρ cap) f q n : ℂ) := by simpa only [f, q, Fintype.prod_sigma, globalBirthFlattenEquiv, Equiv.coe_fn_mk, ghost_phase_run_initial_eq_tilted] using he _ = _ := by congr 1 unfold ghostPhaseCappedMovingDampedHistory change finiteAlternatingPairing (physicalJointCappedVisitKernel L β η ρ cap) (physicalJointCappedMovingEdgeKernel L a β V ρ cap) _ _ n = finiteAlternatingPairing (physicalJointCappedVisitKernel L β η ρ cap) (physicalJointCappedMovingEdgeKernel L a β V ρ cap) _ _ n dsimp only [f, q] simp only [h0, hn] /- Nonzero group damping parameters disappear from the actual joint trace. This equality retains the intended total pending-memory cutoff. -/ include hstep in theorem physical_joint_adjacent_normalized_eq_capped_absolute (hρ : ∀ g, ρ g ≠ 0) : ((∏ g, ∏ s : PhysicalSlots J ell, β g (L 0 g s) / V g : ℝ) : ℂ) * physicalJointAdjacentRawHistory C aux k L a σ τ hcompat hlist hP hdis hk β η V ρ hV cap = (ghostPhaseCappedHistory (fun p : PhysicalPrime P => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity L p.1) j p.2) (fun p => physicalResidueAbsoluteHit a p.1 p.2) (fun p j => η p.1 (globalBirthFiniteIndex n j)) (fun p => β p.1 p.2) (fun p => V p.1) (fun _ => cap) (fun _ => cap) n : ℂ) := by rw [physical_joint_adjacent_normalized_eq_capped_moving C aux k L a σ τ hstep hcompat hlist hP hdis hk β η V ρ hV cap] exact congrArg (fun r : ℝ => (r : ℂ)) (ghost_phase_capped_moving_history_eq_undamped (fun p : PhysicalPrime P => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity L p.1) j p.2) (fun p => physicalResidueAbsoluteHit a p.1 p.2) (fun p j => η p.1 (globalBirthFiniteIndex n j)) (fun p => β p.1 p.2) (fun p => V p.1) (fun p _ => ρ p.1) (fun _ => cap) (fun _ => cap) (fun p _ => hρ p.1) n) end ResiduePath end Bounty end section /- The exact cofactor-first prime-interval sum for rough integers. -/ open Finset namespace Bounty theorem weighted_rough_band_cofactor_identity {M : Type*} [AddCommMonoid M] {U V z : ℝ} (hU : 1 ≤ U) (hV : 0 ≤ V) (hz : 0 ≤ z) (w : ℕ → M) : (∑ n ∈ roughBand U V z, w n) = (∑ p ∈ primeBand (max U z) V, w p)+ ∑ m ∈ roughBand 1 V z, ∑ p ∈ (primeBand z (m.minFac : ℝ)).filter (fun p : ℕ => U < (m : ℝ)*(p : ℝ) ∧ (m : ℝ)*(p : ℝ) ≤ V), w (p*m) := by classical have hU0 : 0 ≤ U := by linarith have hSlo : ∀ n ∈ roughBand U V z, 2 ≤ n := by intro n hn have hlo := Nat.lt_of_floor_lt (mem_Ioc.mp (mem_filter.mp hn).1).1 have hn1 : (1 : ℝ) < n := hU.trans_lt hlo exact_mod_cast hn1 have hShi : ∀ n ∈ roughBand U V z, n ≤ ⌊V⌋₊ := fun n hn => (mem_Ioc.mp (mem_filter.mp hn).1).2 have hrough : ∀ n ∈ roughBand U V z, ∀ p ∈ n.primeFactors, z < (p : ℝ) := fun n hn => (mem_filter.mp hn).2 have h := weighted_buchstab_identity (roughBand U V z) ⌊V⌋₊ w hz hSlo hShi hrough have hP : primeBand z (⌊V⌋₊ : ℝ) = primeBand z V := by simp only [primeBand, Nat.floor_natCast] rw [prime_part_of_rough_band hU0 hV, hP] at h rw [h] congr 1 calc _ = ∑ p ∈ primeBand z V, ∑ m ∈ roughBand 1 V z, if p ≤ m.minFac ∧ U < ((p*m : ℕ) : ℝ) ∧ ((p*m : ℕ) : ℝ) ≤ V then w (p*m) else 0 := by apply sum_congr rfl intro p hp obtain ⟨hpp, hpz, _⟩ := (mem_primeBand_iff hz hV p).mp hp rw [buchstab_cofactors_as_rough_band hU hV hpp hpz, sum_filter] _ = ∑ m ∈ roughBand 1 V z, ∑ p ∈ primeBand z V, if p ≤ m.minFac ∧ U < ((p*m : ℕ) : ℝ) ∧ ((p*m : ℕ) : ℝ) ≤ V then w (p*m) else 0 := sum_comm _ = _ := by apply sum_congr rfl intro m hm have hmV : (m : ℝ) ≤ V := (Nat.cast_le.mpr (mem_Ioc.mp (mem_filter.mp hm).1).2).trans (Nat.floor_le hV) have hfacV : (m.minFac : ℝ) ≤ V := (Nat.cast_le.mpr (Nat.minFac_le (roughBand_pos hm))).trans hmV have hset : (primeBand z V).filter (fun p : ℕ => p ≤ m.minFac ∧ U < ((p*m : ℕ) : ℝ) ∧ ((p*m : ℕ) : ℝ) ≤ V) = ((primeBand z V).filter (fun p : ℕ => U < (m : ℝ)*(p : ℝ) ∧ (m : ℝ)*(p : ℝ) ≤ V)).filter (fun p => p ≤ m.minFac) := by ext p simp only [mem_filter, Nat.cast_mul, mul_comm (p : ℝ) (m : ℝ)] tauto rw [← sum_filter, hset, primeBand_product_filter_prefix hz hV m.minFac, min_eq_right hfacV] end Bounty end section /- Fixed marked birth positions shift the existing ghost factorial series without any counting factor. -/ open Finset Classical namespace Bounty theorem marked_ghost_series_term_le (ℓ ε v : ℝ) (hℓ : 0 ≤ ℓ) (hε : 0 ≤ ε) (hv : 0 ≤ v) (b d : ℕ) (hd : d ≤ b) : ε ^ d * ℓ ^ (b - d) * v ^ b / (b.factorial : ℝ) ≤ (ε * v) ^ d * ((ℓ * v) ^ (b - d) / ((b - d).factorial : ℝ)) := by have hvpow : v ^ b = v ^ d * v ^ (b - d) := by rw [← pow_add, Nat.add_sub_of_le hd] have hfac : ((b - d).factorial : ℝ) ≤ (b.factorial : ℝ) := by exact_mod_cast Nat.factorial_le (Nat.sub_le b d) calc _ = (ε * v) ^ d * ((ℓ * v) ^ (b - d) / (b.factorial : ℝ)) := by rw [hvpow, mul_pow, mul_pow] ring _ ≤ _ := mul_le_mul_of_nonneg_left (div_le_div_of_nonneg_left (pow_nonneg (mul_nonneg hℓ hv) _) (by positivity) hfac) (pow_nonneg (mul_nonneg hε hv) _) theorem marked_ghost_series_le (ℓ ε v : ℝ) (hℓ : 0 ≤ ℓ) (hε : 0 ≤ ε) (hv : 0 ≤ v) (B d : ℕ) : (∑ b ∈ range (B + 1), if d ≤ b then ε ^ d * ℓ ^ (b - d) * v ^ b / (b.factorial : ℝ) else 0) ≤ (ε * v) ^ d * Real.exp (ℓ * v) := by have hs : (range (B + 1)).filter (fun b => d ≤ b) = Ico d (B + 1) := by ext b simp only [mem_filter, mem_range, mem_Ico] tauto calc _ ≤ ∑ b ∈ range (B + 1), if d ≤ b then (ε * v) ^ d * ((ℓ * v) ^ (b - d) / ((b - d).factorial : ℝ)) else 0 := by apply sum_le_sum intro b _ split_ifs with h · exact marked_ghost_series_term_le ℓ ε v hℓ hε hv b d h · exact le_rfl _ = (ε * v) ^ d * ∑ b ∈ Ico d (B + 1), (ℓ * v) ^ (b - d) / ((b - d).factorial : ℝ) := by rw [← sum_filter, hs, mul_sum] _ = (ε * v) ^ d * ∑ b ∈ range (B + 1 - d), (ℓ * v) ^ b / (b.factorial : ℝ) := by rw [sum_Ico_eq_sum_range] simp only [Nat.add_sub_cancel_left] _ ≤ _ := mul_le_mul_of_nonneg_left (Real.sum_le_exp_of_nonneg (mul_nonneg hℓ hv) _) (pow_nonneg (mul_nonneg hε hv) _) end Bounty end section /- Marked fresh edge slots retain an explicit atom cost through the original skeleton row. -/ open Finset Classical namespace Bounty theorem unrestricted_marked_choice_row_le {P : Type*} (n : P → ℕ) (Δ D : ℤ) (ρ V v ℓ ε : ℝ) (hρ0 : 0 ≤ ρ) (hρ1 : ρ ≤ 1) (hV : 0 ≤ V) (hv : 0 < v) (hℓ : 0 ≤ ℓ) (hℓ2 : ℓ ≤ 2) (hε : 0 ≤ ε) (t B d : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (stores promotions : Finset (Fin t)) : (∑ e : promotions ↪ ↥(unrestrictedResidueEligible n Δ D s.2.2), if d ≤ t - promotions.card then |unrestrictedBoundedSkeletonMass n Δ D ρ V t B s stores promotions e| * v ^ unrestrictedSkeletonOutputCount n Δ D t B s ⟨stores, promotions, e⟩ * ε ^ d * ℓ ^ (t - promotions.card - d) else 0) ≤ ε ^ d * v ^ s.2.1.val * unrestrictedEdgeChoiceCost ρ v V 2 (unrestrictedResidueEligible n Δ D s.2.2).card t promotions.card stores.card := by have hcost := unrestrictedEdgeChoiceCost_nonneg hρ0 hv.le hV (by norm_num : (0 : ℝ) ≤ 2) (unrestrictedResidueEligible n Δ D s.2.2).card t promotions.card stores.card by_cases hd : d ≤ t - promotions.card · simp only [hd, if_true] have hpow : ℓ ^ (t - promotions.card - d) ≤ (2 : ℝ) ^ (t - promotions.card) := (pow_le_pow_left₀ hℓ hℓ2 _).trans (pow_le_pow_right₀ (by norm_num) (Nat.sub_le _ _)) calc _ ≤ ∑ _e : promotions ↪ ↥(unrestrictedResidueEligible n Δ D s.2.2), ((ρ ^ ((unrestrictedResidueEligible n Δ D s.2.2).card - promotions.card) / V ^ promotions.card) * (v ^ s.2.1.val * (v ^ stores.card / v ^ promotions.card))) * ε ^ d * (2 : ℝ) ^ (t - promotions.card) := by apply sum_le_sum intro e _ apply mul_le_mul · exact mul_le_mul_of_nonneg_right (unrestricted_bounded_skeleton_length_cost n Δ D ρ V v hρ0 hρ1 hV hv t B s ⟨stores, promotions, e⟩) (pow_nonneg hε _) · exact hpow · exact pow_nonneg hℓ _ · positivity _ = _ := by simp only [sum_const, card_univ, nsmul_eq_mul, promotionChoice_card, Fintype.card_coe] unfold unrestrictedEdgeChoiceCost ring · simp only [hd, if_false, sum_const_zero] exact mul_nonneg (mul_nonneg (pow_nonneg hε _) (pow_nonneg hv.le _)) hcost theorem unrestricted_bounded_marked_length_row_le {P : Type*} (n : P → ℕ) (Δ D : ℤ) (ρ V v vmin ℓ ε : ℝ) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : vmin ≤ V) (hℓ : 0 ≤ ℓ) (hℓ2 : ℓ ≤ 2) (hε : 0 ≤ ε) (t B T d : ℕ) (ht : t ≤ T) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : (∑ sk : UnrestrictedLocalEdgeSkeleton n Δ D t B s, if d ≤ t - sk.2.1.card then |unrestrictedBoundedSkeletonMass n Δ D ρ V t B s sk.1 sk.2.1 sk.2.2| * v ^ unrestrictedSkeletonOutputCount n Δ D t B s sk * ε ^ d * ℓ ^ (t - sk.2.1.card - d) else 0) ≤ ε ^ d * v ^ s.2.1.val * unrestrictedEdgeRowBound ρ v vmin T := by calc _ ≤ ε ^ d * v ^ s.2.1.val * unrestrictedEdgeRowCost ρ v V 2 t (fun _ _ => (unrestrictedResidueEligible n Δ D s.2.2).card) := by simp only [Fintype.sum_sigma, unrestrictedEdgeRowCost, mul_sum] apply sum_le_sum intro stores _ apply sum_le_sum intro promotions _ exact unrestricted_marked_choice_row_le n Δ D ρ V v ℓ ε hρ0.le hρ1.le (hvmin.trans_le hV).le (zero_lt_one.trans hv) hℓ hℓ2 hε t B d s stores promotions _ ≤ _ := mul_le_mul_of_nonneg_left (unrestricted_edge_row_cost_le hρ0 hρ1 hv hvmin hV (by norm_num : (0 : ℝ) ≤ 2) le_rfl T t ht (fun _ _ => (unrestrictedResidueEligible n Δ D s.2.2).card)) (mul_nonneg (pow_nonneg hε _) (pow_nonneg (zero_lt_one.trans hv).le _)) end Bounty end section /- Convert the local forest product into its exact number of constrained births in each group. -/ open Finset Classical namespace Bounty theorem finite_product_two_values {I : Type*} [Fintype I] (selected : I → Prop) [DecidablePred selected] (root atom : ℝ) : (∏ i, if selected i then atom else root) = atom ^ (univ.filter selected).card * root ^ (Fintype.card I - (univ.filter selected).card) := by rw [prod_ite, prod_const, prod_const] have hc := univ.card_filter_add_card_filter_not selected simp only [card_univ] at hc have hn : (univ.filter (fun i => ¬ selected i)).card = Fintype.card I - (univ.filter selected).card := by omega rw [hn] theorem grouped_forest_cost_eq {G : Type*} [Fintype G] [DecidableEq G] (I : G → Type*) [∀ g, Fintype (I g)] {m : ℕ} {α : Type*} (ord : Fin m ≃ Sigma I) (code : BirthForestCode m) (anchor : Fin m → Option α) (root atom : G → ℝ) (d : G → ℕ) (hd : ∀ g, (univ.filter (fun i : I g => code (ord.symm ⟨g, i⟩) ≠ none ∨ anchor (ord.symm ⟨g, i⟩) ≠ none)).card = d g) : (∏ j, match code j with | some _ => atom (ord j).1 | none => match anchor j with | none => root (ord j).1 | some _ => atom (ord j).1) = ∏ g, atom g ^ d g * root g ^ (Fintype.card (I g) - d g) := by rw [← ord.symm.prod_comp] calc _ = ∏ i : Sigma I, if code (ord.symm i) ≠ none ∨ anchor (ord.symm i) ≠ none then atom i.1 else root i.1 := by apply prod_congr rfl intro i _ simp only [Equiv.apply_symm_apply] cases code (ord.symm i) <;> cases anchor (ord.symm i) <;> simp _ = _ := by rw [Fintype.prod_sigma] apply prod_congr rfl intro g _ have hh := finite_product_two_values (fun y : I g => code (ord.symm ⟨g, y⟩) ≠ none ∨ anchor (ord.symm ⟨g, y⟩) ≠ none) (root g) (atom g) rw [hd g] at hh exact hh end Bounty end section /- Original physical edge rows preserve coherent continuation tests, including bad edges. -/ open Finset open scoped Classical namespace Bounty section Edge variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) (L R : PhysicalMarkLists P J ell) (hlist : physicalListAdmissible C aux L R) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ g s, ¬ ((L g s).val : ℤ) ∣ k) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def physicalJointBareEdgeStep (hcompat : ∀ g s t, (L g s).val = (R g t).val → ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) (g : Fin N) : GlobalBirthRawStep (R := fun p : ↥(P g) => ZMod p.val) (physicalGroupPhaseActivity L g) (physicalGroupPhaseActivity R g) := physicalGroupBareRawEdge C aux k L R 0 hlist hP hdis hcompat g (hk g) (β g) ρ (V g) B theorem physical_raw_tensor_eq_bare_step (hcompat : ∀ g s t, (L g s).val = (R g t).val → ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (s : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) : jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) C k L R β ρ V aux) F s = globalBirthJointCutRawRow (physicalJointBareEdgeStep (B := B) C aux k L R hlist hP hdis hk β ρ V hcompat) B B F s := by have hr : (fun g (K : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val) → ℂ) (u : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val)) => globalBirthRawStepRow (physicalJointBareEdgeStep (B := B) C aux k L R hlist hP hdis hk β ρ V hcompat g) (fun H q => K (H, q)) u.1 u.2) = physicalFullEdgeRawRow (B := B) C k L R β ρ V aux := by funext g K u unfold physicalJointBareEdgeStep rw [physical_group_bare_raw_edge_row] have hd := physical_group_phase_delta_as_integer_step (P := P) 0 (0 + k * (physicalD C L aux : ℤ)) k (physicalD C L aux : ℤ) rfl g rw [hd] rfl unfold jointRawTensorCutoff globalBirthJointCutRawRow globalBirthJointRawRow rw [hr] include hlist in theorem physical_raw_tensor_zero_of_bad_edge (hbad : ¬ ∀ g s t, (L g s).val = (R g t).val → ((L g s).val : ℤ) ∣ k * (physicalD C L aux : ℤ)) (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (s : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) (hs : GlobalBirthJointCoherent (fun g => physicalGroupPhaseActivity L g) s) : jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) C k L R β ρ V aux) F s = 0 := by push Not at hbad obtain ⟨g, i, j, he, hn⟩ := hbad unfold jointRawTensorCutoff globalBirthJointRawCutoff split_ifs · refine fin_tensor_row_zero_at N _ s ?_ g ?_ _ · intro h simpa only [zero_mul] using physical_full_edge_raw_row_mul (B := B) C k L R β ρ V aux h 0 (fun _ => 0) (s h) · intro K exact physical_full_edge_raw_zero_of_bad_common_mark C aux k L R hlist β ρ V g i j he hn (s g) (hs g) K · rfl include hlist hP hdis hk in theorem physical_raw_tensor_coherent_congr [∀ g, ∀ p : ↥(P g), NeZero p.val] (F G : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (hFG : ∀ t, GlobalBirthJointCoherent (fun g => physicalGroupPhaseActivity R g) t → F t = G t) (s : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) (hs : GlobalBirthJointCoherent (fun g => physicalGroupPhaseActivity L g) s) : jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) C k L R β ρ V aux) F s = jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) C k L R β ρ V aux) G s := by by_cases hc : ∀ g i j, (L g i).val = (R g j).val → ((L g i).val : ℤ) ∣ k * (physicalD C L aux : ℤ) · rw [physical_raw_tensor_eq_bare_step C aux k L R hlist hP hdis hk β ρ V hc, physical_raw_tensor_eq_bare_step C aux k L R hlist hP hdis hk β ρ V hc] exact global_birth_joint_cut_raw_row_congr _ B B F G hFG s hs · rw [physical_raw_tensor_zero_of_bad_edge C aux k L R hlist β ρ V hc F s hs, physical_raw_tensor_zero_of_bad_edge C aux k L R hlist β ρ V hc G s hs] end Edge end Bounty end section /- Uniformly bounded factor multiplicity and the prime-only base case for rough integers. -/ open Finset namespace Bounty theorem rough_band_prime_of_upper_le_cutoff_sq {A B z : ℝ} (hA : 1 ≤ A) (hB : 0 ≤ B) (hz : 0 ≤ z) (hBz : B ≤ z ^ 2) {n : ℕ} (hn : n ∈ roughBand A B z) : n.Prime := by classical have hn0 := roughBand_pos hn have hAn : A < (n : ℝ) := Nat.lt_of_floor_lt (mem_Ioc.mp (mem_filter.mp hn).1).1 have hn1 : n ≠ 1 := by intro he subst n norm_num at hAn linarith have hnB : (n : ℝ) ≤ B := (Nat.cast_le.mpr (mem_Ioc.mp (mem_filter.mp hn).1).2).trans (Nat.floor_le hB) have hmin : z < (n.minFac : ℝ) := (mem_filter.mp hn).2 n.minFac (Nat.mem_primeFactors.mpr ⟨Nat.minFac_prime hn1, Nat.minFac_dvd n, hn0.ne'⟩) by_contra hprime have hsq : (n.minFac : ℝ) ^ 2 ≤ n := by exact_mod_cast Nat.minFac_sq_le_self hn0 hprime nlinarith theorem rough_band_eq_prime_band_of_upper_le_cutoff_sq {A B z : ℝ} (hA : 1 ≤ A) (hz : 0 ≤ z) (hBz : B ≤ z ^ 2) : roughBand A B z = primeBand (max A z) B := by classical by_cases hB : 0 ≤ B · rw [← prime_part_of_rough_band (by linarith : 0 ≤ A) hB] exact (filter_true_of_mem (fun n hn => rough_band_prime_of_upper_le_cutoff_sq hA hB hz hBz hn)).symm · have hB0 : ⌊B⌋₊ = 0 := Nat.floor_of_nonpos (le_of_not_ge hB) have hzero (m : ℕ) : Ioc m 0 = ∅ := Ioc_eq_empty_of_le (Nat.zero_le m) simp only [roughBand, primeBand, hB0, hzero, filter_empty] end Bounty end section /- The storage-only transpose on the full active space. Shared labels and auxiliary choices are retained on both sides; the local action includes both total-memory caps. Auxiliary weights may be signed for this exact identity. -/ open Finset Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) {A : SharedActiveLabels P S → Type*} [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) end end Bounty end section /- Both members of the storage/reverse-promotion transpose pair satisfy the same proved unrestricted product energy constant. This prepares the reverse promotion operator for the sparse omitted-label average. -/ open Finset Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) theorem unrestricted_storage_only_product_energy_le {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, t g ≤ T) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (unrestrictedStorageOnlyProduct n Δ D μ ρ V t B f) ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by exact unrestricted_coupled_cutoff_product_energy_le n Δ D μ ρ V t B hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht _ (by intros; split_ifs <;> norm_num) f hf theorem unrestricted_reverse_promotion_only_product_energy_le {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, t g ≤ T) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℂ) (hf : ProductMemorySymmetric f) : finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (unrestrictedReversePromotionOnlyProduct n Δ D μ ρ V t B f) ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by apply finite_symmetric_transpose_energy_le (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productMemoryWeight_nonneg μ (fun g => unrestrictedResidueWeight (μ g)) hμ (fun g z => hμ g z.1)) ProductMemorySymmetric (unrestrictedReversePromotionOnlyProduct n Δ D μ ρ V t B) (unrestrictedStorageOnlyProduct n Δ D μ ρ V t B) · intro q hq x i τ dsimp only rw [hq x i τ] · exact unrestricted_reverse_promotion_only_product_symmetric n Δ D μ ρ V t B · intro q r hq hr have hp := unrestricted_storage_only_product_pairing n Δ D μ ρ V t B (fun g => (hvmin.trans_le (hVlo g)).ne') r q hr hq simpa only [mul_assoc, mul_comm, mul_left_comm] using hp.symm · exact pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _ · exact unrestricted_storage_only_product_energy_le n Δ D μ ρ V t B hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht · exact hf end end Bounty end section /- Promotion rarity and the actual capped operator energy bound for the candidate prime pools. All prime-separation and short-step nondivisibility conditions are derived; pending and active big labels remain unrestricted. -/ open Finset Filter open scoped Classical Topology namespace Bounty abbrev CandidateBigGroup (s L : ℝ) := ↥(candidateBigPIndices s L) end Bounty end section /- Exact partial normalization: the complementary groups retain their residue expectation. -/ open Finset open scoped Classical namespace Bounty theorem physical_partial_memory_walk_normalization {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] {J ell : ℕ} (groups : Finset G) (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (n : ℕ) (h : (p : PhysicalPrime P) → ℕ → ZMod p.2.val) (η : ℕ → ℝ) (b : PhysicalPrime P → ℝ) (hnew : ∀ j < n, ∀ g ∈ groups, (physicalGroupMarks (L (j + 1)) g \ physicalGroupMarks (L j) g).card = ell + (C (a j).2.2.1.val g).card) (hb : ∀ p : PhysicalPrime P, p.1 ∈ groups → b p = 1 - (∑ j ∈ range (n + 1), η j) / p.2.val) (hb0 : ∀ p : PhysicalPrime P, p.1 ∈ groups → b p ≠ 0) : (physicalStateMass V J ell : ℂ) * physicalBareWalkScalar V patterns C ζ K a L n * (poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) univ (range (n + 1)) (fun p => (range (n + 1)).filter (fun j => p ∈ physicalMarkedPrimes (L j))) h η : ℝ) = (physicalGroupPathMass V groupsᶜ (fun j => C (a j).2.2.1.val) ell n : ℂ) * physicalMemoryWalkScalar V patterns C ζ K a L n * (poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) (physicalPrimeGroups P groupsᶜ) (range (n + 1)) (fun p => (range (n + 1)).filter (fun j => p ∈ physicalMarkedPrimes (L j))) h η : ℝ) * (∏ p ∈ physicalPrimeGroups P groups, b p : ℝ) * (∏ p ∈ physicalPrimeGroups P groups, ghostPhaseRunHistory (fun j => decide (p ∈ physicalMarkedPrimes (L j))) (h p) η ((p.2.val : ℝ) * b p)⁻¹ (V p.1) n : ℝ) := by classical have hp := physical_prime_groups_split groups (fun p : PhysicalPrime P => (∑ r, activeResidueWeight (range (n + 1)) ((range (n + 1)).filter (fun j => p ∈ physicalMarkedPrimes (L j))) (h p) η r) / (p.2.val : ℝ)) have hm := physical_group_path_mass_split V groups (fun j => C (a j).2.2.1.val) ell n have hr := physical_group_residue_run_normalization groups V L (fun j => C (a j).2.2.1.val) n h η b hnew hb hb0 rw [physical_memory_walk_scalar_factor] change _ * _ * (poolPathResidueExpectation _ _ _ _ _ _ : ℂ) = _ have hp' : poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) univ (range (n + 1)) (fun p => (range (n + 1)).filter (fun j => p ∈ physicalMarkedPrimes (L j))) h η = poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) (physicalPrimeGroups P groups) (range (n + 1)) (fun p => (range (n + 1)).filter (fun j => p ∈ physicalMarkedPrimes (L j))) h η * poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) (physicalPrimeGroups P groupsᶜ) (range (n + 1)) (fun p => (range (n + 1)).filter (fun j => p ∈ physicalMarkedPrimes (L j))) h η := hp rw [hp'] have hm' := congrArg (fun x : ℝ => (x : ℂ)) hm have hr' := congrArg (fun x : ℝ => (x : ℂ)) hr push_cast at hm' hr' ⊢ linear_combination physicalMemoryWalkScalar V patterns C ζ K a L n * (poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) (physicalPrimeGroups P groups) (range (n + 1)) (fun p => (range (n + 1)).filter (fun j => p ∈ physicalMarkedPrimes (L j))) h η : ℝ) * (poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) (physicalPrimeGroups P groupsᶜ) (range (n + 1)) (fun p => (range (n + 1)).filter (fun j => p ∈ physicalMarkedPrimes (L j))) h η : ℝ) * hm' + (physicalGroupPathMass V groupsᶜ (fun j => C (a j).2.2.1.val) ell n : ℝ) * physicalMemoryWalkScalar V patterns C ζ K a L n * (poolPathResidueExpectation (fun p : PhysicalPrime P => p.2.val) (physicalPrimeGroups P groupsᶜ) (range (n + 1)) (fun p => (range (n + 1)).filter (fun j => p ∈ physicalMarkedPrimes (L j))) h η : ℝ) * hr' end Bounty end section /- Empty small cuts reduce only the small factor; the big coefficient remains fully coupled. -/ open Finset open scoped Classical namespace Bounty section Empty variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hC : ∀ g, C g = ∅) (a : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) include hC in theorem physical_bare_neutral_empty_cut : physicalBarePatternScalar V C 0 (fun _ _ _ => 1) a L R = if physicalSharedPrefix L = physicalSharedPrefix R then ((∏ g, 1 / (V g) ^ ell : ℝ) : ℂ) else 0 := by have hCe : C = fun _ => ∅ := funext hC subst C simpa only [physicalCompletionMass, card_empty, Nat.add_zero, mul_one, physical_phase_zero_frequency] using (physical_bare_empty_prefix V 0 a (fun _ => 1) L R) include hC in theorem physical_D_empty_cut : physicalD C L a = physicalSharedProduct (physicalSharedPrefix L) := by have hCe : C = fun _ => ∅ := funext hC subst C exact physical_D_empty a L end Empty section Groups variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (small : G → Prop) (C : G → Finset (Fin J)) (hC : ∀ g, small g → C g = ∅) (ζ : ℝ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) end Groups end Bounty end section /- The original pattern index, both permutations and each auxiliary draw survive group reindexing. -/ open scoped Classical namespace Bounty section Reindex variable {G H I : Type*} (e : G ≃ H) (P : G → Finset ℕ) (J ell : ℕ) (patterns : Finset I) (C : I → G → Finset (Fin J)) def physicalEdgeGroupReindex : PhysicalEdgeLabels P J ell patterns C ≃ PhysicalEdgeLabels (fun h => P (e.symm h)) J ell patterns (fun i h => C i (e.symm h)) := Equiv.prodCongr (physicalPermutationGroupReindex e J ell) (Equiv.prodCongr (physicalPermutationGroupReindex e J ell) (Equiv.sigmaCongrRight (fun i : patterns => physicalAuxGroupReindex e P J (C i.val)))) variable [Fintype G] [Fintype H] theorem physical_bare_step_group_reindex (k : I → ℤ) (a : PhysicalEdgeLabels P J ell patterns C) (L : PhysicalMarkLists P J ell) : physicalBareStep (fun i h => C i (e.symm h)) k (physicalEdgeGroupReindex e P J ell patterns C a) (physicalMarkGroupReindex e P J ell L) = physicalBareStep C k a L := by change k a.2.2.1.val * (physicalD (fun h => C a.2.2.1.val (e.symm h)) (physicalPermuteLabels (physicalPermutationGroupReindex e J ell a.1) (physicalMarkGroupReindex e P J ell L)) (physicalAuxGroupReindex e P J (C a.2.2.1.val) a.2.2.2) : ℕ) = _ rw [← physical_permute_group_reindex, physical_D_group_reindex] rfl theorem physical_bare_labeled_group_reindex [DecidableEq G] [DecidableEq H] (V : G → ℝ) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) : physicalBareLabeledScalar (fun h => V (e.symm h)) patterns (fun i h => C i (e.symm h)) ζ (fun i => physicalGroupReindexedCoefficient e (C i) (K i)) (physicalEdgeGroupReindex e P J ell patterns C a) (physicalMarkGroupReindex e P J ell L) (physicalMarkGroupReindex e P J ell R) = physicalBareLabeledScalar V patterns C ζ K a L R := by unfold physicalBareLabeledScalar change (Fintype.card (PhysicalPermutations H J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations H J ell) : ℂ)⁻¹ * physicalBarePatternScalar (fun h => V (e.symm h)) (fun h => C a.2.2.1.val (e.symm h)) (ζ a.2.2.1.val) (physicalGroupReindexedCoefficient e (C a.2.2.1.val) (K a.2.2.1.val)) (physicalAuxGroupReindex e P J (C a.2.2.1.val) a.2.2.2) (physicalPermuteLabels (physicalPermutationGroupReindex e J ell a.1) (physicalMarkGroupReindex e P J ell L)) (physicalPermuteLabels (physicalPermutationGroupReindex e J ell a.2.1) (physicalMarkGroupReindex e P J ell R)) = _ rw [← physical_permute_group_reindex, ← physical_permute_group_reindex, physical_bare_pattern_group_reindex] have hc := physical_permutation_group_reindex_card (J := J) (ell := ell) e simp only [← Nat.card_eq_fintype_card] at hc ⊢ rw [hc] end Reindex end Bounty end section /- Port from PrimeNumberTheoremAnd/MediumPNT.lean at c39a751132c88b6e8080b74c74023fd95b3d8be0 (PrimeNumberTheoremAnd project). Original code licensed under Apache-2.0; see LICENSE.source in this directory. Adapted to Lean 4.33.1: project annotations and options removed; unused Fourier/Sobolev imports omitted. Mathematical statements are unchanged unless documented below. Original Auxiliary module copyright (c) 2024 Michael Stoll. -/ open Set Function Filter Complex Real open ArithmeticFunction (vonMangoldt) open scoped Chebyshev namespace Chebyshev end Chebyshev noncomputable abbrev SmoothedChebyshevIntegrand (SmoothingF : ℝ → ℝ) (ε : ℝ) (X : ℝ) : ℂ → ℂ := fun s ↦ (- deriv riemannZeta s) / riemannZeta s * mellin (fun x ↦ (Smooth1 SmoothingF ε x : ℂ)) s * (X : ℂ) ^ s open ComplexConjugate open MeasureTheory noncomputable def I₁ (SmoothingF : ℝ → ℝ) (ε X T : ℝ) : ℂ := (1 / (2 * π * I)) * (I * (∫ t : ℝ in Iic (-T), SmoothedChebyshevIntegrand SmoothingF ε X ((1 + (Real.log X)⁻¹) + t * I))) open Filter Topology end section /- The strict Buchstab recursion, with its repeated-least-prime error retained explicitly. -/ open Finset namespace Bounty noncomputable def strictBuchstabComposites (A B z : ℝ) : Finset ℕ := by classical exact (roughBand A B z).filter (fun n => ¬ n.Prime ∧ ¬ n.minFac ∣ n / n.minFac) noncomputable def strictBuchstabRemainder (A B z : ℝ) : Finset ℕ := by classical exact (roughBand A B z).filter (fun n => ¬ n.Prime ∧ n.minFac ∣ n / n.minFac) theorem strict_buchstab_fiber_image {A B z : ℝ} (hA : 1 ≤ A) (hB : 0 ≤ B) {p : ℕ} (hp : p.Prime) (hpz : z < (p : ℝ)) : (strictBuchstabComposites A B z).filter (fun n => n.minFac = p) = (roughBand (max 1 (A / (p : ℝ))) (B / (p : ℝ)) (p : ℝ)).image (fun m => p * m) := by classical have hpR : (0 : ℝ) < p := Nat.cast_pos.mpr hp.pos have hA0 : 0 ≤ A := by linarith have hmax : 0 ≤ max 1 (A / (p : ℝ)) := le_trans (by norm_num) (le_max_left _ _) have hBp : 0 ≤ B / (p : ℝ) := div_nonneg hB hpR.le ext n constructor · intro hn obtain ⟨hnC, hnp⟩ := mem_filter.mp hn obtain ⟨hnR, hnprime, hndiv⟩ := mem_filter.mp hnC have hn0 := roughBand_pos hnR have hpdiv : p ∣ n := hnp ▸ Nat.minFac_dvd n have hmul : p * (n / p) = n := Nat.mul_div_cancel' hpdiv have hmlo : 2 ≤ n / p := hp.two_le.trans (by simpa only [hnp] using Nat.minFac_le_div hn0 hnprime) have hnA : A < (n : ℝ) := Nat.lt_of_floor_lt (mem_Ioc.mp (mem_filter.mp hnR).1).1 have hnB : (n : ℝ) ≤ B := (Nat.cast_le.mpr (mem_Ioc.mp (mem_filter.mp hnR).1).2).trans (Nat.floor_le hB) have hmulR : (p : ℝ) * (n / p : ℕ) = n := by exact_mod_cast hmul apply mem_image.mpr refine ⟨n / p, mem_filter.mpr ⟨mem_Ioc.mpr ⟨?_, ?_⟩, ?_⟩, hmul⟩ · apply (Nat.floor_lt hmax).mpr apply max_lt_iff.mpr constructor · exact_mod_cast hmlo · apply (div_lt_iff₀ hpR).mpr nlinarith · apply Nat.le_floor apply (le_div_iff₀ hpR).mpr nlinarith · intro q hq have hpq : p ≤ q := by simpa only [hnp] using buchstab_cofactor_prime_factors n q (by simpa only [hnp] using hq) have hpne : p ≠ q := by intro he apply hndiv simpa only [hnp, he] using Nat.dvd_of_mem_primeFactors hq exact_mod_cast lt_of_le_of_ne hpq hpne · intro hn obtain ⟨m, hm, rfl⟩ := mem_image.mp hn have hm0 := roughBand_pos hm have hmlo : max 1 (A / (p : ℝ)) < (m : ℝ) := Nat.lt_of_floor_lt (mem_Ioc.mp (mem_filter.mp hm).1).1 have hm1 : m ≠ 1 := by have hh := (le_max_left 1 (A / (p : ℝ))).trans_lt hmlo intro he simp only [he, Nat.cast_one, lt_self_iff_false] at hh have hmB : (m : ℝ) ≤ B / (p : ℝ) := (Nat.cast_le.mpr (mem_Ioc.mp (mem_filter.mp hm).1).2).trans (Nat.floor_le hBp) have hrough := (mem_filter.mp hm).2 have hmin : (p * m).minFac = p := buchstab_minFac_mul hp hm0.ne' (fun q hq => by exact_mod_cast (hrough q hq).le) have hpndiv : ¬ p ∣ m := by intro hdiv have hh := hrough p (hp.mem_primeFactors hdiv hm0.ne') exact lt_irrefl _ hh have hquot : p * m / p = m := Nat.mul_div_cancel_left m hp.pos apply mem_filter.mpr refine ⟨mem_filter.mpr ⟨?_, Nat.not_prime_mul hp.ne_one hm1, ?_⟩, hmin⟩ · apply mem_filter.mpr refine ⟨mem_Ioc.mpr ⟨?_, ?_⟩, ?_⟩ · apply (Nat.floor_lt hA0).mpr have hh := (div_lt_iff₀ hpR).mp ((le_max_right 1 (A / (p : ℝ))).trans_lt hmlo) simpa only [Nat.cast_mul, mul_comm] using hh · apply Nat.le_floor have hh := (le_div_iff₀ hpR).mp hmB simpa only [Nat.cast_mul, mul_comm] using hh · intro q hq rw [Nat.primeFactors_mul hp.ne_zero hm0.ne', hp.primeFactors] at hq rcases mem_union.mp hq with hqp | hqm · simpa only [mem_singleton.mp hqp] using hpz · exact hpz.trans (hrough q hqm) · simpa only [hmin, hquot] using hpndiv theorem strict_buchstab_composites_count {A B z : ℝ} (hA : 1 ≤ A) (hB : 0 ≤ B) (hz : 0 ≤ z) : (strictBuchstabComposites A B z).card = ∑ p ∈ primeBand z (Real.sqrt B), (roughBand (max 1 (A / (p : ℝ))) (B / (p : ℝ)) (p : ℝ)).card := by classical have hmap : ∀ n ∈ strictBuchstabComposites A B z, n.minFac ∈ primeBand z (Real.sqrt B) := by intro n hn obtain ⟨hnR, hnprime, _⟩ := mem_filter.mp hn have hn0 := roughBand_pos hnR have hnA : A < (n : ℝ) := Nat.lt_of_floor_lt (mem_Ioc.mp (mem_filter.mp hnR).1).1 have hn1 : n ≠ 1 := by intro he simp only [he, Nat.cast_one] at hnA linarith have hp := Nat.minFac_prime hn1 have hnB : (n : ℝ) ≤ B := (Nat.cast_le.mpr (mem_Ioc.mp (mem_filter.mp hnR).1).2).trans (Nat.floor_le hB) apply (mem_primeBand_iff hz (Real.sqrt_nonneg _) _).mpr refine ⟨hp, (mem_filter.mp hnR).2 n.minFac (Nat.mem_primeFactors.mpr ⟨hp, Nat.minFac_dvd n, hn0.ne'⟩), ?_⟩ apply Real.le_sqrt_of_sq_le have hsq : (n.minFac : ℝ) ^ 2 ≤ n := by exact_mod_cast Nat.minFac_sq_le_self hn0 hnprime exact hsq.trans hnB rw [card_eq_sum_card_fiberwise hmap] apply sum_congr rfl intro p hp obtain ⟨hpp, hpz, _⟩ := (mem_primeBand_iff hz (Real.sqrt_nonneg _) p).mp hp rw [strict_buchstab_fiber_image hA hB hpp hpz] exact card_image_of_injective _ (fun a b hab => Nat.eq_of_mul_eq_mul_left hpp.pos hab) theorem strict_buchstab_count_with_remainder {A B z : ℝ} (hA : 1 ≤ A) (hB : 0 ≤ B) (hz : 0 ≤ z) : (roughBand A B z).card = (primeBand (max A z) B).card + (∑ p ∈ primeBand z (Real.sqrt B), (roughBand (max 1 (A / (p : ℝ))) (B / (p : ℝ)) (p : ℝ)).card) + (strictBuchstabRemainder A B z).card := by classical have hprime := card_filter_add_card_filter_not (s := roughBand A B z) Nat.Prime have hcomp := card_filter_add_card_filter_not (s := (roughBand A B z).filter (fun n => ¬ n.Prime)) (fun n => ¬ n.minFac ∣ n / n.minFac) have hgood : ((roughBand A B z).filter (fun n => ¬ n.Prime)).filter (fun n => ¬ n.minFac ∣ n / n.minFac) = strictBuchstabComposites A B z := by simp only [filter_filter, strictBuchstabComposites] have hbad : ((roughBand A B z).filter (fun n => ¬ n.Prime)).filter (fun n => ¬ ¬ n.minFac ∣ n / n.minFac) = strictBuchstabRemainder A B z := by simp only [not_not, filter_filter, strictBuchstabRemainder] rw [hgood, hbad, strict_buchstab_composites_count hA hB hz] at hcomp rw [prime_part_of_rough_band (by linarith : 0 ≤ A) hB] at hprime omega theorem strict_buchstab_remainder_subset_nonsquarefree {A B z : ℝ} (hA : 1 ≤ A) : strictBuchstabRemainder A B z ⊆ (roughBand A B z).filter (fun n => ¬ Squarefree n) := by classical intro n hn obtain ⟨hnR, _, hdiv⟩ := mem_filter.mp hn have hnA : A < (n : ℝ) := Nat.lt_of_floor_lt (mem_Ioc.mp (mem_filter.mp hnR).1).1 have hn1 : n ≠ 1 := by intro he simp only [he, Nat.cast_one] at hnA linarith refine mem_filter.mpr ⟨hnR, ?_⟩ intro hsq exact (Nat.squarefree_iff_prime_squarefree.mp hsq) n.minFac (Nat.minFac_prime hn1) (Nat.mul_dvd_of_dvd_div (Nat.minFac_dvd n) hdiv) end Bounty end section /- Conditioning the original small residue labels does not alter the independent permutation symmetry of the big pending-memory coordinates. -/ namespace Bounty theorem physical_small_big_condition_memory_symmetric {S G : Type*} [Fintype S] [DecidableEq S] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} (V : S → ℝ) (q : ℝ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) (d : PhysicalSharedLists Ps J) (r : PhysicalResidues Ps) : ProductMemorySymmetric (fun x => physicalSmallBigCondition V q F d x r) := by intro x g τ unfold physicalSmallBigCondition apply congrArg (physicalSmallCondition V q r d) funext L exact hF (r, L) x g τ end Bounty end section /- Choose the clean parameters before the polynomial cost, and the fixed omission parameter afterwards. This is a scalar budget, not an operator decomposition or a physical-state identification. -/ open Filter open scoped Topology namespace Bounty theorem rpow_next_saving_le_half (E L : ℝ) (hL : 2 ≤ L) : L ^ (-(E + 1)) ≤ (1 / 2 : ℝ) * L ^ (-E) := by have hL0 : 0 < L := by linarith rw [show -(E + 1) = -E - 1 by ring, Real.rpow_sub hL0, Real.rpow_one] apply (div_le_iff₀ hL0).mpr have h := mul_le_mul_of_nonneg_left hL (Real.rpow_nonneg hL0.le (-E)) nlinarith end Bounty end section /- The literal mixed event row factors between the two actual small conditioning maps. This is an equality for the genuine residue-valid small measure, with all big event coefficients and targets retained. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSmallBigPrefixAction {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J : ℕ} (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (F : PhysicalSharedLists P J → X → PhysicalResidues P → ℂ) (d : PhysicalSharedLists P J) (x : X) (r : PhysicalResidues P) : ℂ := ∑ e : E d x, a r d x e * F d (target d x e) (physicalTranslateResidues r (k x * (physicalSharedProduct d : ℕ))) theorem physical_small_big_action_invalid {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (q ζ : ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (F : PhysicalSmallBigState P J ell X → ℂ) (s : PhysicalSmallBigState P J ell X) (h : ¬physicalResidueMarksValid s.1.1 s.1.2) : physicalSmallBigAction V q ζ aux κ E target a k F s = 0 := by simp only [physicalSmallBigAction, physicalSmallBigEventWeight, physicalResidueVertexWeight, if_neg h, zero_mul, Complex.ofReal_zero, mul_zero, sum_const_zero] theorem physical_small_big_pairing {S X : Type*} [Fintype S] [dS : DecidableEq S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (q ζ : ℝ) (W : X → ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (u F : PhysicalSmallBigState P J ell X → ℂ) : (∑ s, (physicalSmallBigMeasure V W s : ℂ) * (starRingEnd ℂ) (u s) * physicalSmallBigAction V q ζ aux κ E target a k F s) = ∑ d, ∑ r, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition V q u d x r) * (κ d * physicalPhase ζ (physicalSharedProduct d) * physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F) d x r) := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) rw [Fintype.sum_prod_type, sum_comm] have hx : (∑ x, ∑ s : PhysicalBareResidueState P J ell, (physicalSmallBigMeasure V W (s, x) : ℂ) * (starRingEnd ℂ) (u (s, x)) * physicalSmallBigAction V q ζ aux κ E target a k F (s, x)) = ∑ x, ∑ r, ∑ d, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition V q u d x r) * (κ d * physicalPhase ζ (physicalSharedProduct d) * physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F) d x r) := by apply sum_congr rfl intro x _ rw [Fintype.sum_prod_type] apply sum_congr rfl intro r _ have h := physical_small_big_action_bilinear V hV q ζ aux κ E target a k (fun L => u ((r, L), x)) F r x change _ = _ at h have hleft : (∑ L, (physicalSmallBigMeasure V W ((r, L), x) : ℂ) * (starRingEnd ℂ) (u ((r, L), x)) * physicalSmallBigAction V q ζ aux κ E target a k F ((r, L), x)) = (W x : ℂ) * ∑ L, (physicalStateMass V J ell : ℂ) * (starRingEnd ℂ) (u ((r, L), x)) * physicalSmallBigAction V q ζ aux κ E target a k F ((r, L), x) := by rw [mul_sum] apply sum_congr rfl intro L _ by_cases hv : physicalResidueMarksValid r L · simp only [physicalSmallBigMeasure, if_pos hv, Complex.ofReal_mul] ring · rw [physical_small_big_action_invalid V q ζ aux κ E target a k F ((r, L), x) hv] simp only [mul_zero] rw [hleft] erw [h] simp only [mul_sum, physicalSmallBigCondition, physicalSmallBigPrefixAction] apply sum_congr rfl intro d _ ring_nf erw [hx] calc (∑ x, ∑ r, ∑ d, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition V q u d x r) * (κ d * physicalPhase ζ (physicalSharedProduct d) * physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F) d x r)) = ∑ x, ∑ d, ∑ r, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition V q u d x r) * (κ d * physicalPhase ζ (physicalSharedProduct d) * physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F) d x r) := by apply sum_congr rfl intro x _ exact sum_comm _ = _ := by rw [sum_comm] apply sum_congr rfl intro d _ exact sum_comm end Bounty end section /- Small-slot permutations preserve the actual mixed measure: the big state and small residues stay fixed, and only the injective small mark list is reordered. This is the isometry used before omission averaging. -/ open Finset open scoped Classical namespace Bounty theorem physical_residue_marks_valid_permute {S : Type*} {P : S → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations S J ell) (r : PhysicalResidues P) (L : PhysicalMarkLists P J ell) : physicalResidueMarksValid r (physicalPermuteLabels σ L) ↔ physicalResidueMarksValid r L := by constructor · intro h g s obtain ⟨t, rfl⟩ := (σ g).surjective s exact h g t · intro h g s exact h g (σ g s) def physicalSmallBigPermutation {S X : Type*} {P : S → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations S J ell) : PhysicalSmallBigState P J ell X ≃ PhysicalSmallBigState P J ell X where toFun s := ((s.1.1, physicalPermuteLabels σ s.1.2), s.2) invFun s := ((s.1.1, physicalPermuteLabels (fun g => (σ g).symm) s.1.2), s.2) left_inv s := by apply Prod.ext · apply Prod.ext · rfl · funext g apply Function.Embedding.ext intro i change s.1.2 g (σ g ((σ g).symm i)) = s.1.2 g i rw [Equiv.apply_symm_apply] · rfl right_inv s := by apply Prod.ext · apply Prod.ext · rfl · funext g apply Function.Embedding.ext intro i change s.1.2 g ((σ g).symm (σ g i)) = s.1.2 g i rw [Equiv.symm_apply_apply] · rfl theorem physical_small_vertex_permutation {S : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (σ : PhysicalPermutations S J ell) (r : PhysicalResidues P) (L : PhysicalMarkLists P J ell) (q : ℝ) : physicalResidueVertexWeight (physicalPermuteLabels σ L) q r = physicalResidueVertexWeight L q r := by simp only [physicalResidueVertexWeight, physical_residue_marks_valid_permute] theorem physical_small_big_permutation_measure {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (σ : PhysicalPermutations S J ell) (s : PhysicalSmallBigState P J ell X) : physicalSmallBigMeasure V W (physicalSmallBigPermutation σ s) = physicalSmallBigMeasure V W s := by change (if physicalResidueMarksValid s.1.1 (physicalPermuteLabels σ s.1.2) then physicalStateMass V J ell * W s.2 else 0) = _ rw [physical_residue_marks_valid_permute] rfl theorem physical_small_big_permutation_energy {S X : Type*} [Fintype S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (σ : PhysicalPermutations S J ell) (f : PhysicalSmallBigState P J ell X → ℂ) : physicalSmallBigEnergy V W (fun s => f (physicalSmallBigPermutation σ s)) = physicalSmallBigEnergy V W f := by rw [← physical_small_big_energy_eq, ← physical_small_big_energy_eq] have h := (physicalSmallBigPermutation (P := P) (X := X) σ).sum_comp (fun s => physicalSmallBigMeasure V W s * ‖f s‖ ^ 2) simpa only [finiteWeightedEnergy, physical_small_big_permutation_measure] using h end Bounty end section /- Uniform prime-weighted Buchstab kernels and finite-depth induction geometry. -/ namespace Bounty open Finset Filter Real MeasureTheory open scoped Topology noncomputable def buchstabDepthExtendedKernel (n : ℕ) (w α : ℝ) : ℝ := buchstabDepthDensity n α (max (w/2) (w-α)) theorem buchstab_depth_extended_kernel_continuous (n : ℕ) : ContinuousOn (fun p : ℝ × ℝ => buchstabDepthExtendedKernel n p.1 p.2) {p | 0 < p.1 ∧ 0 < p.2} := by apply (buchstab_depth_density_continuous n).comp (show ContinuousOn (fun p : ℝ × ℝ => (p.2, max (p.1/2) (p.1-p.2))) {p | 0 < p.1 ∧ 0 < p.2} by fun_prop) intro p hp exact ⟨hp.2, (half_pos hp.1).trans_le (le_max_left _ _)⟩ theorem buchstab_depth_extended_kernel_eq (n : ℕ) {w α : ℝ} (hα : α ≤ w/2) : buchstabDepthExtendedKernel n w α = buchstabDepthDensity n α (w-α) := by unfold buchstabDepthExtendedKernel rw [max_eq_right (by linarith)] theorem buchstab_depth_extended_integral (n : ℕ) (γ w : ℝ) : (∫ α in γ..max γ (w/2), buchstabDepthExtendedKernel n w α/α) = buchstabDepthDensity (n+1) γ w-1/w := by rw [buchstabDepthDensity, add_sub_cancel_left] by_cases hhalf : w/2 ≤ γ · simp only [max_eq_left hhalf, intervalIntegral.integral_same] · have hhalf' : γ ≤ w/2 := (lt_of_not_ge hhalf).le rw [max_eq_right hhalf'] apply intervalIntegral.integral_congr intro α hα have hα' : α ≤ w/2 := (show α ∈ Set.Icc γ (w/2) by simpa only [Set.uIcc_of_le hhalf'] using hα).2 change buchstabDepthExtendedKernel n w α/α = buchstabDepthDensity n α (w-α)/α rw [buchstab_depth_extended_kernel_eq n hα'] theorem buchstab_depth_prime_kernel_uniform_error (n : ℕ) {a b γ₀ : ℝ} (ha : 0 < a) (hγ₀ : 0 < γ₀) (hγb : γ₀ < b) {ε : ℝ} (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ w γ : ℝ, a ≤ w → w ≤ b → γ₀ ≤ γ → γ ≤ w → |(∑ p ∈ primeBand (exp (γ*L)) (exp (max γ (w/2)*L)), buchstabDepthExtendedKernel n w (log (p : ℝ)/L)/(p : ℝ)) - (buchstabDepthDensity (n+1) γ w-1/w)| < ε := by have hc : ContinuousOn (fun p : ℝ × ℝ => buchstabDepthExtendedKernel n p.1 p.2) ((Set.Icc a b) ×ˢ (Set.Icc γ₀ b)) := by apply (buchstab_depth_extended_kernel_continuous n).mono intro p hp exact ⟨ha.trans_le hp.1.1, hγ₀.trans_le hp.2.1⟩ filter_upwards [exponential_prime_weighted_reciprocal_uniform_error hγ₀ hγb (fun p : ℝ × ℝ => buchstabDepthExtendedKernel n p.1 p.2) hc hε] with L hL intro w γ haw hwb hγ hγw have hmax : max γ (w/2) ≤ b := max_le (hγw.trans hwb) (by linarith) have hh := hL w ⟨haw,hwb⟩ γ (max γ (w/2)) hγ (le_max_left _ _) hmax rw [buchstab_depth_extended_integral] at hh exact hh theorem buchstab_good_cofactor_domain (n : ℕ) {a b γ₀ γ w α η δ : ℝ} (hη : 0 ≤ η) (haw : a ≤ w) (hwb : w ≤ b) (hγ₀ : γ₀ ≤ γ) (hγα : γ ≤ α) (hα : α ≤ w/2-η) (htop : w+δ ≤ ((n : ℝ)+3)*γ) : a/2 ≤ w-α ∧ w-α ≤ b-γ₀ ∧ γ₀ ≤ α ∧ 2*η ≤ (w-α)-α ∧ w-α+δ ≤ ((n : ℝ)+2)*α := by have hn : 0 ≤ (n : ℝ)+3 := by positivity have hm := mul_le_mul_of_nonneg_left hγα hn constructor · linarith constructor · linarith constructor · exact hγ₀.trans hγα constructor <;> linarith theorem exponential_prime_band_short_interval_bound {a η ε : ℝ} (ha : 0 < a) (hη : 0 ≤ η) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ u v : ℝ, a ≤ u → u ≤ v → v-u ≤ η → primeBandHarmonic (exp (u*L)) (exp (v*L)) ≤ η/a+ε := by filter_upwards [exponential_prime_band_harmonic_uniform_error ha hε] with L hL intro u v hau huv hwidth have hu := ha.trans_le hau have hv := hu.trans_le huv have hlog : log (v/u) ≤ (v-u)/u := by have h := log_le_sub_one_of_pos (div_pos hv hu) convert h using 1; field_simp have hr : (v-u)/u ≤ η/a := by exact (div_le_div_of_nonneg_right hwidth hu.le).trans (div_le_div_of_nonneg_left hη ha hau) have he := (abs_lt.mp (hL u v hau huv)).2 linarith theorem exponential_prime_log_coordinate {L p : ℝ} (hL : L ≠ 0) (hp : 0 < p) : exp ((log p/L)*L) = p := by rw [div_mul_cancel₀ _ hL, exp_log hp] theorem exponential_cofactor_log_coordinate (w : ℝ) {L p : ℝ} (hL : L ≠ 0) (hp : 0 < p) : exp (w*L)/p = exp ((w-log p/L)*L) := by rw [sub_mul, exp_sub, exponential_prime_log_coordinate hL hp] end Bounty /- Public declaration closure audit. -/ end section /- Finite upper meshes for the continuous Buchstab density, with logarithmic bin weights. -/ open Finset Filter MeasureTheory open scoped Topology namespace Bounty theorem reciprocal_grid_strict_step {a b : ℝ} (hab : a < b) {N : ℕ} (hN : 0 < N) (i : ℕ) : reciprocalGrid a b N (i : ℕ) < reciprocalGrid a b N ((i : ℕ) + 1) := by have hstep := reciprocal_grid_step a b N (i : ℕ) have hp : 0 < (b - a) / (N : ℝ) := div_pos (sub_pos.mpr hab) (Nat.cast_pos.mpr hN) linarith theorem reciprocal_grid_log_weight_sum {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) {N : ℕ} (hN : 0 < N) : (∑ i ∈ range N, Real.log (reciprocalGrid a b N ((i : ℕ) + 1) / reciprocalGrid a b N (i : ℕ))) = Real.log (b / a) := by have hlog : ∀ i ∈ range N, Real.log (reciprocalGrid a b N ((i : ℕ) + 1) / reciprocalGrid a b N (i : ℕ)) = Real.log (reciprocalGrid a b N ((i : ℕ) + 1)) - Real.log (reciprocalGrid a b N (i : ℕ)) := by intro i hi have hleft := ha.trans_le (reciprocal_grid_mem hab hN (mem_range.mp hi).le).1 have hright := ha.trans_le (reciprocal_grid_mem hab hN (Nat.succ_le_of_lt (mem_range.mp hi))).1 exact Real.log_div hright.ne' hleft.ne' rw [sum_congr rfl hlog, sum_range_adjacent_real_difference (fun i => Real.log (reciprocalGrid a b N (i : ℕ))) N, reciprocal_grid_zero, reciprocal_grid_end a b hN, Real.log_div (ha.trans_le hab).ne' ha.ne'] theorem exists_square_reciprocal_grid_oscillation {a b : ℝ} (hab : a < b) (F : ℝ × ℝ → ℝ) (hF : ContinuousOn F (Set.Icc a b ×ˢ Set.Icc a b)) {η : ℝ} (hη : 0 < η) : ∃ N : ℕ, 0 < N ∧ ∀ i : ℕ, i < N → ∀ x ∈ Set.Icc (reciprocalGrid a b N (i : ℕ)) (reciprocalGrid a b N ((i : ℕ) + 1)), |F (reciprocalGrid a b N (i : ℕ), x) - F (reciprocalGrid a b N (i : ℕ), reciprocalGrid a b N (i : ℕ))| ≤ η ∧ |F (x, x) - F (reciprocalGrid a b N (i : ℕ), reciprocalGrid a b N (i : ℕ))| ≤ η := by have hu := (isCompact_Icc.prod isCompact_Icc).uniformContinuousOn_of_continuous hF obtain ⟨δ, hδ, hclose⟩ := Metric.uniformContinuousOn_iff_le.mp hu η hη obtain ⟨N, hN⟩ := exists_nat_gt ((b - a) / δ) have hN0 : 0 < N := by have hh : (0 : ℝ) < N := (div_pos (sub_pos.mpr hab) hδ).trans hN exact_mod_cast hh have hstep : (b - a) / (N : ℝ) ≤ δ := by apply (div_le_iff₀ (Nat.cast_pos.mpr hN0)).mpr have hh := (div_lt_iff₀ hδ).mp hN nlinarith refine ⟨N, hN0, ?_⟩ intro i hi x hx have hleft := reciprocal_grid_mem hab.le hN0 hi.le have hright := reciprocal_grid_mem hab.le hN0 (Nat.succ_le_of_lt hi) have hxmem : x ∈ Set.Icc a b := ⟨hleft.1.trans hx.1, hx.2.trans hright.2⟩ have hd : dist x (reciprocalGrid a b N (i : ℕ)) ≤ δ := by rw [Real.dist_eq, abs_of_nonneg (sub_nonneg.mpr hx.1)] calc _ ≤ reciprocalGrid a b N ((i : ℕ) + 1) - reciprocalGrid a b N (i : ℕ) := sub_le_sub_right hx.2 _ _ = (b - a) / (N : ℝ) := reciprocal_grid_step a b N (i : ℕ) _ ≤ δ := hstep constructor · have hh := hclose (reciprocalGrid a b N (i : ℕ), x) ⟨hleft, hxmem⟩ (reciprocalGrid a b N (i : ℕ), reciprocalGrid a b N (i : ℕ)) ⟨hleft, hleft⟩ (by simpa only [Prod.dist_eq, dist_self, max_eq_right (dist_nonneg)] using hd) simpa only [Real.dist_eq] using hh · have hh := hclose (x, x) ⟨hxmem, hxmem⟩ (reciprocalGrid a b N (i : ℕ), reciprocalGrid a b N (i : ℕ)) ⟨hleft, hleft⟩ (by simpa only [Prod.dist_eq, max_self] using hd) simpa only [Real.dist_eq] using hh theorem buchstab_bin_density_continuous {b q : ℝ} (hb : 0 < b) (hq : q ≤ 1 / 2) : ContinuousOn (fun p : ℝ × ℝ => buchstabDensity p.1 (1 - p.2)) (Set.Icc b q ×ˢ Set.Icc b q) := by apply buchstab_density_continuous.comp (show ContinuousOn (fun p : ℝ × ℝ => (p.1, 1 - p.2)) (Set.Icc b q ×ˢ Set.Icc b q) by fun_prop) intro p hp exact ⟨hb.trans_le hp.1.1, by linarith [hp.2.2]⟩ theorem reciprocal_grid_added_sample_bound (f : ℝ → ℝ) {b q η : ℝ} (hb : 0 < b) (hbq : b ≤ q) (hη : 0 ≤ η) (hf : ContinuousOn f (Set.Icc b q)) {N : ℕ} (hN : 0 < N) (hosc : ∀ i : ℕ, i < N → ∀ α ∈ Set.Icc (reciprocalGrid b q N i) (reciprocalGrid b q N (i + 1)), |f α - f (reciprocalGrid b q N i)| ≤ η) : (∑ i ∈ range N, (f (reciprocalGrid b q N i) + η) * Real.log (reciprocalGrid b q N (i + 1) / reciprocalGrid b q N i)) ≤ (∫ α in b..q, f α / α) + (η / b) * (q - b) + η * Real.log (q / b) := by have happ := reciprocal_grid_integral_approximation f hb hbq hη hf hN hosc simp only [add_mul, sum_add_distrib] rw [← mul_sum, reciprocal_grid_log_weight_sum hb hbq hN] have hh := (abs_le.mp happ).1 linarith theorem reciprocal_mesh_error_budget {b q ε : ℝ} (hb : 0 < b) (hbq : b < q) (hε : 0 < ε) : let η := ε / ((q - b) / b + |Real.log (q / b)| + 1) 0 < η ∧ (η / b) * (q - b) + η * Real.log (q / b) ≤ ε := by let C := (q - b) / b + |Real.log (q / b)| + 1 have hC : 0 < C := by dsimp [C]; positivity let η := ε / C have hη : 0 < η := div_pos hε hC refine ⟨hη, ?_⟩ change (η / b) * (q - b) + η * Real.log (q / b) ≤ ε have heq : η * C = ε := by dsimp [η]; field_simp calc _ ≤ η * C := by have hh := mul_le_mul_of_nonneg_left (le_abs_self (Real.log (q / b))) hη.le dsimp [C] calc _ = η * ((q - b) / b) + η * Real.log (q / b) := by ring _ ≤ η * ((q - b) / b) + η * |Real.log (q / b)| := add_le_add le_rfl hh _ ≤ η * ((q - b) / b + |Real.log (q / b)| + 1) := by nlinarith _ = ε := heq theorem exists_buchstab_upper_mesh {b q ε : ℝ} (hb : 0 < b) (hbq : b < q) (hq : q ≤ 1 / 2) (hε : 0 < ε) : ∃ N : ℕ, 0 < N ∧ ∃ M : Fin N → ℝ, (∀ i : Fin N, reciprocalGrid b q N (i : ℕ) < reciprocalGrid b q N ((i : ℕ) + 1) ∧ 0 < M i ∧ ∀ α ∈ Set.Icc (reciprocalGrid b q N (i : ℕ)) (reciprocalGrid b q N ((i : ℕ) + 1)), buchstabDensity (reciprocalGrid b q N (i : ℕ)) (1 - α) ≤ M i) ∧ (∑ i : Fin N, M i * Real.log (reciprocalGrid b q N ((i : ℕ) + 1) / reciprocalGrid b q N (i : ℕ))) ≤ (∫ α in b..q, buchstabDensity α (1 - α) / α) + ε := by let F : ℝ × ℝ → ℝ := fun p => buchstabDensity p.1 (1 - p.2) let f : ℝ → ℝ := fun α => buchstabDensity α (1 - α) have hF : ContinuousOn F (Set.Icc b q ×ˢ Set.Icc b q) := buchstab_bin_density_continuous hb hq have hf : ContinuousOn f (Set.Icc b q) := hF.comp (f := fun α : ℝ => (α, α)) (continuousOn_id.prodMk continuousOn_id) (fun α hα => ⟨hα, hα⟩) let η : ℝ := ε / ((q - b) / b + |Real.log (q / b)| + 1) have hbudget : 0 < η ∧ (η / b) * (q - b) + η * Real.log (q / b) ≤ ε := reciprocal_mesh_error_budget hb hbq hε obtain ⟨N, hN, hosc⟩ := exists_square_reciprocal_grid_oscillation hbq F hF hbudget.1 let M : Fin N → ℝ := fun i => f (reciprocalGrid b q N (i : ℕ)) + η refine ⟨N, hN, M, ?_, ?_⟩ · intro i have hi := reciprocal_grid_mem hbq.le hN i.isLt.le have hleft0 : 0 < reciprocalGrid b q N (i : ℕ) := hb.trans_le hi.1 have hlast0 : 0 < 1 - reciprocalGrid b q N (i : ℕ) := by linarith [hi.2] refine ⟨reciprocal_grid_strict_step hbq hN (i : ℕ), ?_, ?_⟩ · change 0 < buchstabDensity (reciprocalGrid b q N (i : ℕ)) (1 - reciprocalGrid b q N (i : ℕ)) + η exact add_pos (buchstab_density_pos hleft0 hlast0) hbudget.1 · intro α hα have hh := (abs_le.mp (hosc (i : ℕ) i.isLt α hα).1).2 change buchstabDensity (reciprocalGrid b q N (i : ℕ)) (1 - α) ≤ buchstabDensity (reciprocalGrid b q N (i : ℕ)) (1 - reciprocalGrid b q N (i : ℕ)) + η change buchstabDensity (reciprocalGrid b q N (i : ℕ)) (1 - α) - buchstabDensity (reciprocalGrid b q N (i : ℕ)) (1 - reciprocalGrid b q N (i : ℕ)) ≤ η at hh linarith only [hh] · have hh := reciprocal_grid_added_sample_bound f hb hbq.le hbudget.1.le hf hN (fun i hi α hα => (hosc i hi α hα).2) change (∑ i : Fin N, (f (reciprocalGrid b q N (i : ℕ)) + η) * Real.log (reciprocalGrid b q N ((i : ℕ) + 1) / reciprocalGrid b q N (i : ℕ))) ≤ (∫ α in b..q, f α / α) + ε rw [Fin.sum_univ_eq_sum_range (fun i : ℕ => (f (reciprocalGrid b q N i) + η) * Real.log (reciprocalGrid b q N (i + 1) / reciprocalGrid b q N i)) N] linarith [hbudget.2] theorem buchstab_partial_kernel_integral_le {b q : ℝ} (hb : 0 < b) (hbq : b ≤ q) (hq : q ≤ 1 / 2) : (∫ α in b..q, buchstabDensity α (1 - α) / α) ≤ buchstabDensity b 1 - 1 := by have hnonneg : ∀ᵐ α ∂volume.restrict (Set.Ioc b (1 / 2 : ℝ)), 0 ≤ buchstabDensity α (1 - α) / α := by apply (ae_restrict_iff' measurableSet_Ioc).mpr apply Filter.Eventually.of_forall intro α hα have hα0 : 0 < α := hb.trans hα.1 have hlast : 0 < 1 - α := by linarith [hα.2] exact div_nonneg (buchstab_density_nonneg hα0 hlast) hα0.le have hmono := intervalIntegral.integral_mono_interval (a := b) (b := q) (c := b) (d := (1 / 2 : ℝ)) le_rfl hbq hq hnonneg (buchstab_density_kernel_intervalIntegrable (w := 1) hb (hbq.trans hq)) rw [buchstab_density_integral_identity hb (hbq.trans hq)] at hmono exact hmono theorem exists_buchstab_upper_mesh_density_bound {b q ε : ℝ} (hb : 0 < b) (hbq : b < q) (hq : q ≤ 1 / 2) (hε : 0 < ε) : ∃ N : ℕ, 0 < N ∧ ∃ M : Fin N → ℝ, (∀ i : Fin N, reciprocalGrid b q N (i : ℕ) < reciprocalGrid b q N ((i : ℕ) + 1) ∧ 0 < M i ∧ ∀ α ∈ Set.Icc (reciprocalGrid b q N (i : ℕ)) (reciprocalGrid b q N ((i : ℕ) + 1)), buchstabDensity (reciprocalGrid b q N (i : ℕ)) (1 - α) ≤ M i) ∧ (∑ i : Fin N, M i * Real.log (reciprocalGrid b q N ((i : ℕ) + 1) / reciprocalGrid b q N (i : ℕ))) ≤ buchstabDensity b 1 - 1 + ε := by obtain ⟨N, hN, M, hbins, hsum⟩ := exists_buchstab_upper_mesh hb hbq hq hε refine ⟨N, hN, M, hbins, ?_⟩ exact hsum.trans (add_le_add (buchstab_partial_kernel_integral_le hb hbq.le hq) le_rfl) end Bounty end section /- Norm consequences in the genuine mixed measure. Promotion and storage estimates combine without replacing the small-state measure. -/ open Finset open scoped Classical namespace Bounty section variable {S X : Type*} [Fintype S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) theorem physical_small_big_sqrt_energy_eq_norm (F : PhysicalSmallBigState P J ell X → ℂ) : Real.sqrt (physicalSmallBigEnergy V W F) = cleanActiveNorm (physicalSmallBigMeasure V W) F := by rw [← physical_small_big_energy_eq] rfl theorem physical_small_big_norm_le_of_energy (H K : ℝ) (hH : 0 ≤ H) (hK : 0 ≤ K) (F output : PhysicalSmallBigState P J ell X → ℂ) (h : physicalSmallBigEnergy V W output ≤ H ^ 2 * K * physicalSmallBigEnergy V W F) : cleanActiveNorm (physicalSmallBigMeasure V W) output ≤ H * Real.sqrt K * cleanActiveNorm (physicalSmallBigMeasure V W) F := by have hs := Real.sqrt_le_sqrt h rwa [Real.sqrt_mul (mul_nonneg (sq_nonneg H) hK), Real.sqrt_mul (sq_nonneg H), Real.sqrt_sq hH, physical_small_big_sqrt_energy_eq_norm, physical_small_big_sqrt_energy_eq_norm] at hs theorem physical_small_big_dirty_energy_of_components (hV : ∀ s, 0 < V s) (hW : ∀ x, 0 ≤ W x) (F output promotion storage : PhysicalSmallBigState P J ell X → ℂ) (δ K : ℝ) (hdom : ∀ s, ‖output s‖ ≤ ‖promotion s + storage s‖) (hprom : physicalSmallBigEnergy V W promotion ≤ δ * K * physicalSmallBigEnergy V W F) (hstore : physicalSmallBigEnergy V W storage ≤ δ * K * physicalSmallBigEnergy V W F) : physicalSmallBigEnergy V W output ≤ 4 * δ * K * physicalSmallBigEnergy V W F := by have h := (finiteWeightedEnergy_le_of_norm_le (physicalSmallBigMeasure V W) (physical_small_big_measure_nonneg V hV W hW) output (fun s => promotion s + storage s) hdom).trans (finite_weighted_energy_add_le_two (physicalSmallBigMeasure V W) (physical_small_big_measure_nonneg V hV W hW) promotion storage) simp only [physical_small_big_energy_eq] at h nlinarith theorem physical_small_big_clean_rare_norm_le (hV : ∀ s, 0 < V s) (hW : ∀ x, 0 ≤ W x) (F output clean dirty : PhysicalSmallBigState P J ell X → ℂ) (hdecomp : output = clean + dirty) (εclean εdirty : ℝ) (hc : cleanActiveNorm (physicalSmallBigMeasure V W) clean ≤ εclean * cleanActiveNorm (physicalSmallBigMeasure V W) F) (hd : cleanActiveNorm (physicalSmallBigMeasure V W) dirty ≤ εdirty * cleanActiveNorm (physicalSmallBigMeasure V W) F) : cleanActiveNorm (physicalSmallBigMeasure V W) output ≤ (εclean + εdirty) * cleanActiveNorm (physicalSmallBigMeasure V W) F := by rw [hdecomp] exact (clean_active_norm_add_le (physicalSmallBigMeasure V W) (physical_small_big_measure_nonneg V hV W hW) clean dirty).trans ((add_le_add hc hd).trans_eq (by ring)) end end Bounty end section /- Averaging fixed auxiliary draws on the genuine mixed measure. The auxiliary law is a subprobability independent of the state being integrated. -/ open Finset open scoped Classical namespace Bounty section variable {S X Q : Type*} [sharedInstance1 : Fintype S] [sharedInstance2 : Fintype X] [sharedInstance3 : Fintype Q] {P : S → Finset ℕ} [sharedInstance5 : ∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (W : X → ℝ) (hW : ∀ x, 0 ≤ W x) (π : Q → ℝ) (hπ : ∀ a, 0 ≤ π a) (hmass : ∑ a, π a ≤ 1) (output : Q → PhysicalSmallBigState P J ell X → ℂ) include S X Q sharedInstance1 sharedInstance2 sharedInstance3 P sharedInstance5 J ell V hV W hW π hπ hmass output theorem physical_small_big_subprobability_energy_le : physicalSmallBigEnergy V W (fun s => ∑ a, (π a : ℂ) * output a s) ≤ ∑ a, π a * physicalSmallBigEnergy V W (output a) := by simpa only [physical_small_big_energy_eq] using finite_subprobability_average_energy_le π (physicalSmallBigMeasure V W) hπ hmass (physical_small_big_measure_nonneg V hV W hW) output theorem physical_small_big_auxiliary_energy_bound (F : PhysicalSmallBigState P J ell X → ℂ) (K : ℝ) (hK : 0 ≤ K) (hbound : ∀ a, physicalSmallBigEnergy V W (output a) ≤ K * physicalSmallBigEnergy V W F) : physicalSmallBigEnergy V W (fun s => ∑ a, (π a : ℂ) * output a s) ≤ K * physicalSmallBigEnergy V W F := by have hEF : 0 ≤ physicalSmallBigEnergy V W F := by rw [← physical_small_big_energy_eq] exact sum_nonneg fun s _ => mul_nonneg (physical_small_big_measure_nonneg V hV W hW s) (sq_nonneg ‖F s‖) calc _ ≤ ∑ a, π a * physicalSmallBigEnergy V W (output a) := physical_small_big_subprobability_energy_le V hV W hW π hπ hmass output _ ≤ ∑ a, π a * (K * physicalSmallBigEnergy V W F) := sum_le_sum fun a _ => mul_le_mul_of_nonneg_left (hbound a) (hπ a) _ = (∑ a, π a) * (K * physicalSmallBigEnergy V W F) := (sum_mul ..).symm _ ≤ 1 * (K * physicalSmallBigEnergy V W F) := mul_le_mul_of_nonneg_right hmass (mul_nonneg hK hEF) _ = _ := one_mul _ end end Bounty end section /- Fixed cross moments retain absolute logarithmic exponents. -/ open Finset namespace Bounty theorem divisor_square_cross_moment {α : Type*} [DecidableEq α] (S : Finset α) (f g : α → ℕ) (M N : ℕ) (hf : Set.InjOn f S) (hg : Set.InjOn g S) (hM : ∀ x ∈ S, f x ≤ M) (hN : ∀ x ∈ S, g x ≤ N) : (∑ x ∈ S, ((f x).divisors.card : ℝ) ^ 2 * ((g x).divisors.card : ℝ) ^ 2) ≤ Real.sqrt ((M : ℝ) * (1 + Real.log M) ^ 15) * Real.sqrt ((N : ℝ) * (1 + Real.log N) ^ 15) := by have h := Real.sum_mul_le_sqrt_mul_sqrt S (fun x => ((f x).divisors.card : ℝ) ^ 2) (fun x => ((g x).divisors.card : ℝ) ^ 2) simp only [← pow_mul, show 2 * 2 = 4 by omega] at h apply h.trans apply mul_le_mul · exact Real.sqrt_le_sqrt (divisor_fourth_moment_injective S f M hf hM) · exact Real.sqrt_le_sqrt (divisor_fourth_moment_injective S g N hg hN) · positivity · positivity theorem nonnegative_one_three_le_fourths {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) : a * b ^ 3 ≤ a ^ 4 + b ^ 4 := by rcases le_total a b with hab | hba · calc _ ≤ b * b ^ 3 := mul_le_mul_of_nonneg_right hab (pow_nonneg hb _) _ = b ^ 4 := by ring _ ≤ _ := le_add_of_nonneg_left (pow_nonneg ha _) · calc _ ≤ a * a ^ 3 := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hb hba _) ha _ = a ^ 4 := by ring _ ≤ _ := le_add_of_nonneg_right (pow_nonneg hb _) theorem divisor_adjacent_cross_moment (N : ℕ) : (∑ n ∈ Icc 1 N, (n.divisors.card : ℝ) * ((n - 1).divisors.card : ℝ) ^ 3) ≤ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 := by have hshift := divisor_fourth_moment_injective (Icc 1 N) (fun n => n - 1) N (by intro a ha b hb hab simp only [mem_coe, mem_Icc] at ha hb change a - 1 = b - 1 at hab omega) (by intro n hn; exact (Nat.sub_le n 1).trans (mem_Icc.mp hn).2) calc _ ≤ ∑ n ∈ Icc 1 N, ((n.divisors.card : ℝ) ^ 4 + ((n - 1).divisors.card : ℝ) ^ 4) := by apply sum_le_sum intro n _ exact nonnegative_one_three_le_fourths (by positivity) (by positivity) _ = (∑ n ∈ Icc 1 N, (n.divisors.card : ℝ) ^ 4) + ∑ n ∈ Icc 1 N, ((n - 1).divisors.card : ℝ) ^ 4 := sum_add_distrib _ ≤ (N : ℝ) * (1 + Real.log N) ^ 15 + (N : ℝ) * (1 + Real.log N) ^ 15 := add_le_add (divisor_fourth_moment N) hshift _ = _ := by ring end Bounty end section /- Full shifted-product pair domains, with no primality or roughness restriction. -/ open Finset namespace Bounty noncomputable def shiftedFactorPairs (T : Finset ℕ) : Finset (ℕ × ℕ) := by classical exact T.biUnion (fun u => (2*u+1).divisors.image (fun d => (d,(2*u+1)/d))) theorem mem_shifted_factor_pairs_iff (T : Finset ℕ) (v : ℕ × ℕ) : v ∈ shiftedFactorPairs T ↔ ∃ u ∈ T, v.1*v.2=2*u+1 := by classical constructor · intro hv obtain ⟨u,hu,hv'⟩ := mem_biUnion.mp hv obtain ⟨d,hd,rfl⟩ := mem_image.mp hv' refine ⟨u,hu,?_⟩ exact Nat.mul_div_cancel' (Nat.mem_divisors.mp hd).1 · rintro ⟨u,hu,hprod⟩ apply mem_biUnion.mpr refine ⟨u,hu,mem_image.mpr ⟨v.1,?_,?_⟩⟩ · exact Nat.mem_divisors.mpr ⟨hprod ▸ dvd_mul_right v.1 v.2,by omega⟩ · have hp : 0 < v.1 := by nlinarith only [hprod] apply Prod.ext · rfl · change (2*u+1)/v.1=v.2 rw [← hprod, Nat.mul_div_right _ hp] theorem shifted_factor_pair_properties (T : Finset ℕ) {v : ℕ × ℕ} (hv : v ∈ shiftedFactorPairs T) : 0 < v.1 ∧ 0 < v.2 ∧ shiftedPairIndex v ∈ T ∧ v.1*v.2=2*shiftedPairIndex v+1 := by obtain ⟨u,hu,hprod⟩ := (mem_shifted_factor_pairs_iff T v).mp hv have hindex : shiftedPairIndex v=u := by unfold shiftedPairIndex; rw [hprod]; omega rw [hindex] exact ⟨by nlinarith only [hprod],by nlinarith only [hprod],hu,hprod⟩ theorem shifted_buchstab_pairs_subset_factor_pairs (T : Finset ℕ) (z : ℝ) (hT : ∀ u ∈ T, 0 < u) : shiftedBuchstabPairs T z ⊆ shiftedFactorPairs T := by intro v hv have h := shifted_buchstab_pair_properties T z hT hv exact (mem_shifted_factor_pairs_iff T v).mpr ⟨shiftedPairIndex v,h.2.2.1,h.2.2.2.1⟩ end Bounty end section /- Actual masked complex path sums are dominated by their genuine positive path integrals. -/ open Finset Classical namespace Bounty section Norm variable {K X : Type*} (E : K → X → Type*) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (steps : List K) (Q : ∀ x, FiniteEventPath E target steps x → Prop) (phase : ∀ x, FiniteEventPath E target steps x → ℂ) (hphase : ∀ x p, ‖phase x p‖ ≤ 1) (f : X → ℂ) (x : X) include hphase end Norm end Bounty end section /- The fourth divisor moment controls an invariant endpoint on every divisibility fibre. -/ open Finset namespace Bounty theorem natural_log_mono {a b : ℕ} (hab : a ≤ b) : Real.log a ≤ Real.log b := by by_cases ha : a = 0 · simpa [ha] using Real.log_natCast_nonneg b · exact Real.log_le_log (by exact_mod_cast Nat.pos_of_ne_zero ha) (by exact_mod_cast hab) theorem divisor_fourth_moment_quotient (S : Finset ℕ) (d N : ℕ) (hdiv : ∀ n ∈ S, d ∣ n) (hN : ∀ n ∈ S, n ≤ N) : (∑ n ∈ S, ((n / d).divisors.card : ℝ) ^ 4) ≤ ((N : ℝ) / d) * (1 + Real.log N) ^ 15 := by by_cases hd : d = 0 · simp [hd] have hmoment := divisor_fourth_moment_injective S (fun n => n / d) (N / d) (by intro a ha b hb hab have hae := Nat.mul_div_cancel' (hdiv a ha) have hbe := Nat.mul_div_cancel' (hdiv b hb) dsimp at hab rw [hab, hbe] at hae exact hae.symm) (by intro n hn; exact Nat.div_le_div_right (hN n hn)) apply hmoment.trans apply mul_le_mul · exact Nat.cast_div_le · exact pow_le_pow_left₀ (by positivity) (by linarith [natural_log_mono (Nat.div_le_self N d)]) 15 · positivity · positivity theorem prime_pool_free_part_divisors_le (P : Finset ℕ) (n : ℕ) : (primePoolFreePart P n).divisors.card ≤ n.divisors.card := by by_cases hn : n = 0 · simp [hn, primePoolFreePart] · apply card_le_card exact Nat.divisors_subset_of_dvd hn (Nat.div_dvd_of_dvd (primePoolPart_dvd P n)) section variable (P : Finset ℕ) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) include P α β γ A B C hA hB hC hα hβ hγ theorem invariant_triple_endpoint_norm_divisors (n : ℕ) : ‖invariantTripleEndpoint P α β γ n‖ ≤ A * B * C * (n.divisors.card : ℝ) ^ 2 := by apply (invariant_triple_endpoint_norm_le P α β γ hA hB hC hα hβ hγ n).trans apply mul_le_mul_of_nonneg_left _ (by positivity) exact pow_le_pow_left₀ (by positivity) (by exact_mod_cast prime_pool_free_part_divisors_le P n) 2 theorem invariant_triple_endpoint_divisible_energy (S : Finset ℕ) (d N : ℕ) (hd : d ∈ Nat.factoredNumbers P) (hdiv : ∀ n ∈ S, d ∣ n) (hN : ∀ n ∈ S, n ≤ N) : (∑ n ∈ S, ‖invariantTripleEndpoint P α β γ n‖ ^ 2) ≤ (A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 / d := by have hnorm (n : ℕ) (hn : n ∈ S) : ‖invariantTripleEndpoint P α β γ n‖ ^ 2 ≤ (A * B * C) ^ 2 * ((n / d).divisors.card : ℝ) ^ 4 := by have he := invariant_triple_endpoint_mul_supported hd α β γ (n / d) rw [Nat.mul_div_cancel' (hdiv n hn)] at he rw [he] have hb := invariant_triple_endpoint_norm_divisors P α β γ hA hB hC hα hβ hγ (n / d) calc _ ≤ (A * B * C * ((n / d).divisors.card : ℝ) ^ 2) ^ 2 := pow_le_pow_left₀ (norm_nonneg _) hb 2 _ = _ := by ring calc _ ≤ ∑ n ∈ S, (A * B * C) ^ 2 * ((n / d).divisors.card : ℝ) ^ 4 := sum_le_sum hnorm _ = (A * B * C) ^ 2 * ∑ n ∈ S, ((n / d).divisors.card : ℝ) ^ 4 := (mul_sum ..).symm _ ≤ (A * B * C) ^ 2 * (((N : ℝ) / d) * (1 + Real.log N) ^ 15) := mul_le_mul_of_nonneg_left (divisor_fourth_moment_quotient S d N hdiv hN) (sq_nonneg _) _ = _ := by ring end end Bounty end section /- Exact disintegration over the unchanged small state. The original residue-valid injective-list measure is retained in every fiber. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_energy_by_small {S X : Type*} [Fintype S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (F : PhysicalSmallBigState P J ell X → ℂ) : physicalSmallBigEnergy V W F = ∑ s : PhysicalBareResidueState P J ell, (if physicalResidueMarksValid s.1 s.2 then physicalStateMass V J ell else 0) * finiteWeightedEnergy W (fun x => F (s, x)) := by rw [← physical_small_big_energy_eq] unfold finiteWeightedEnergy rw [Fintype.sum_prod_type] apply sum_congr rfl intro s _ rw [mul_sum] apply sum_congr rfl intro x _ unfold physicalSmallBigMeasure split_ifs <;> ring theorem physical_small_big_fiber_energy_le {S X : Type*} [Fintype S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (W : X → ℝ) (F output : PhysicalSmallBigState P J ell X → ℂ) (K : ℝ) (hbound : ∀ s, finiteWeightedEnergy W (fun x => output (s, x)) ≤ K * finiteWeightedEnergy W (fun x => F (s, x))) : physicalSmallBigEnergy V W output ≤ K * physicalSmallBigEnergy V W F := by rw [physical_small_big_energy_by_small, physical_small_big_energy_by_small, mul_sum] apply sum_le_sum intro s _ have hs : 0 ≤ if physicalResidueMarksValid s.1 s.2 then physicalStateMass V J ell else 0 := by split_ifs · exact (physical_state_mass_pos V hV J ell).le · exact le_rfl exact (mul_le_mul_of_nonneg_left (hbound s) hs).trans_eq (by ring) end Bounty end section /- The candidate's next band supplies five active slots. The terminal loss is at most 88 log L. -/ open Finset Real namespace Bounty theorem finite_sum_le_of_injective_nonneg {I J : Type*} [Fintype I] [Fintype J] [DecidableEq J] (f : I → J) (hf : Function.Injective f) (g : J → ℝ) (hg : ∀ j, 0 ≤ g j) : (∑ i, g (f i)) ≤ ∑ j, g j := by rw [← sum_image (fun i _ j _ h => hf h)] exact sum_le_sum_of_subset_of_nonneg (subset_univ _) (fun j _ _ => hg j) theorem candidate_allocation_room {c L : ℝ} (hc : 0 < c) (hL : 0 < L) (hlog : 0 < log L) {r jStar : ℕ} (hr : 6 ≤ r) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) : SmoothAllocationRoom ((candidateQIndices c L).card*r) (fun i => log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) (88*log L) := by classical have hval (i : Fin ((candidateQIndices c L).card*r)) := candidate_Q_slot_log_bounds c L r jStar (candidateAllocationOrder c L r i) (x _).property have hv0 (i : Fin ((candidateQIndices c L).card*r)) : 0 ≤ log (candidateAllocationValue c L r jStar x i) := by exact (by positivity : (0 : ℝ) ≤ c*L/2^(candidateAllocationOrder c L r i).1.val).trans (hval i).1.le have hfuture0 (i : Fin ((candidateQIndices c L).card*r)) : 0 ≤ smoothAllocationFuture _ (fun k => log (candidateAllocationValue c L r jStar x k)) (candidateAllocationActive c L r jStar) i := by apply sum_nonneg intro k hk split_ifs · exact hv0 k · rfl apply smooth_allocation_room_of_future_bound intro i hai let j := (candidateAllocationOrder c L r i).1.val let J := ⌊log (c*L/(20*log L))/log 2⌋₊ have hj : j ≤ J := (mem_Icc.mp (candidateAllocationOrder c L r i).1.property).2 have hs : 0 < c*L/2^j := by positivity have hv : log (candidateAllocationValue c L r jStar x i) ≤ (6/5 : ℝ)*(c*L/2^j) := by simpa only [candidateAllocationValue, j, mul_div_assoc] using (hval i).2 by_cases hjlt : j < J · let next : candidateQIndices c L := ⟨j+1, mem_Icc.mpr ⟨Nat.zero_le _, hjlt⟩⟩ let f : Fin 5 → Fin ((candidateQIndices c L).card*r) := fun k => (candidateAllocationOrder c L r).symm (next, ⟨k.val+1, by have hk := k.isLt; omega⟩) have hf : Function.Injective f := by intro k k' h have hh := congrArg (candidateAllocationOrder c L r) h simp only [f, Equiv.apply_symm_apply] at hh have he := congrArg (fun z : (candidateQIndices c L) × Fin r => z.2.val) hh apply Fin.ext dsimp at he omega have hfi (k : Fin 5) : i < f k := by apply candidate_allocation_band_strict simp only [f, Equiv.apply_symm_apply, next] exact Nat.lt_succ_self j have hfa (k : Fin 5) : candidateAllocationActive c L r jStar (f k) = true := by simp [candidateAllocationActive, f] let g : Fin ((candidateQIndices c L).card*r) → ℝ := fun k => if i < k ∧ candidateAllocationActive c L r jStar k = true then log (candidateAllocationValue c L r jStar x k) else 0 have hg (k) : 0 ≤ g k := by dsimp [g] split_ifs · exact hv0 k · rfl have hlow (k : Fin 5) : c*L/2^(j+1) ≤ g (f k) := by dsimp only [g] rw [if_pos ⟨hfi k,hfa k⟩] have hh := (hval (f k)).1.le simpa only [candidateAllocationValue, f, Equiv.apply_symm_apply, next] using hh have hsum : 5*(c*L/2^(j+1)) ≤ smoothAllocationFuture _ (fun k => log (candidateAllocationValue c L r jStar x k)) (candidateAllocationActive c L r jStar) i := by have hh := (sum_le_sum (fun k (_ : k ∈ (univ : Finset (Fin 5))) => hlow k)).trans (finite_sum_le_of_injective_nonneg f hf g hg) simpa only [smoothAllocationFuture, g, sum_const, card_univ, Fintype.card_fin, nsmul_eq_mul, Nat.cast_ofNat] using hh have he : c*L/2^(j+1) = (c*L/2^j)/2 := by rw [pow_succ, div_mul_eq_div_div] rw [he] at hsum change log (candidateAllocationValue c L r jStar x i)+c*L/2^j ≤ _ nlinarith · have hjEq : j = J := Nat.le_antisymm hj (Nat.le_of_not_gt hjlt) have hlast := candidate_last_band_scale_lt hc hL hlog change c*L/2^J < 40*log L at hlast rw [← hjEq] at hlast have hnonneg := hfuture0 i change log (candidateAllocationValue c L r jStar x i)+c*L/2^j ≤ _ nlinarith end Bounty end section /- Rough factors are coprime to a smaller nonzero signed determinant. -/ namespace Bounty section variable {m : ℕ} {k : ℤ} {W : ℝ} (hm : 0 < m) (hk : k ≠ 0) (hrough : ∀ p ∈ m.primeFactors, W < (p : ℝ)) include m k W hm hk hrough theorem typeII_rough_coprime_natAbs (hsmall : (k.natAbs : ℝ) ≤ W) : Nat.Coprime m k.natAbs := by apply Nat.coprime_of_dvd intro p hp hpm hpk have hlarge := hrough p (Nat.mem_primeFactors.mpr ⟨hp, hpm, hm.ne'⟩) have hle : p ≤ k.natAbs := Nat.le_of_dvd (Int.natAbs_pos.mpr hk) hpk have hle' : (p : ℝ) ≤ k.natAbs := by exact_mod_cast hle linarith theorem typeII_rough_coprime_determinant (hsmall : |(k : ℝ)| ≤ W) : IsCoprime (m : ℤ) k := by rw [Int.isCoprime_iff_nat_coprime, Int.natAbs_natCast] apply typeII_rough_coprime_natAbs hm hk hrough have habs : (k.natAbs : ℝ) = |(k : ℝ)| := by simpa only [Int.cast_abs, Int.cast_natCast] using congrArg (fun z : ℤ => (z : ℝ)) (Int.natCast_natAbs k) rwa [habs] end theorem typeII_determinant_abs_le_of_difference {m m' e : ℕ} {k : ℤ} {E D : ℝ} (hE : 0 < E) (he : E ≤ (e : ℝ)) (hdiff : |(m' : ℝ) - m| ≤ D) (hdet : (m' : ℤ) - m = 2 * e * k) : |(k : ℝ)| ≤ D / (2 * E) := by have hid : (m' : ℝ) - m = 2 * (e : ℝ) * (k : ℝ) := by exact_mod_cast hdet have he0 : 0 ≤ (e : ℝ) := Nat.cast_nonneg e have hh : |(m' : ℝ) - m| = 2 * (e : ℝ) * |(k : ℝ)| := by rw [hid, abs_mul, abs_of_nonneg (by positivity : 0 ≤ 2 * (e : ℝ))] apply (le_div_iff₀ (by positivity : (0 : ℝ) < 2 * E)).mpr rw [hh] at hdiff nlinarith [abs_nonneg (k : ℝ)] end Bounty end section /- The actual short-block Gram estimate, with no factor from the total number of positions. -/ open scoped BigOperators InnerProductSpace namespace Bounty theorem finite_position_block_gram_bound {X : Type*} [Fintype X] (position : X → ℤ) {mass : ℝ} (hmass : 0 ≤ mass) (K : X → X → ℂ) (S : Finset ℤ) {H : ℤ} (hH : 0 < H) (f g : ℤ → ℂ) (hf : ∀ x, position x ∉ S → f (position x) = 0) (hK : ∀ x y, H < |position x - position y| → K x y = 0) {M : ℝ} (hM : 0 ≤ M) (hfM : ∀ n ∈ S, ‖f n‖ ≤ M) {R : ℕ} (hR : 2 ≤ R) : ‖inner ℂ (finitePositionVector position mass f) (finiteKernelOperator K (finitePositionVector position mass g))‖ ≤ ((H.toNat : ℝ) * M ^ 2) ^ (1 / (2 * (R : ℝ))) * (3 * ‖finitePositionVector position mass g‖ ^ 2) ^ (1 / 2 : ℝ) * (‖finitePositionVector position mass f‖ ^ 2) ^ ((1 - 1 / (R : ℝ)) / 2) * (∑ n ∈ S, (inner ℂ (finiteFiberVector position mass n) (((finiteKernelOperator K * (finiteKernelOperator K).adjoint) ^ R) (finiteFiberVector position mass n))).re) ^ (1 / (2 * (R : ℝ))) := by classical let J := S.image (fun n => n / H) let F : J → EuclideanSpace ℂ X := fun j => finitePositionVector position mass (integerBlockMask id H j.val f) let G : J → EuclideanSpace ℂ X := fun j => finitePositionVector position mass (integerBlockNearMask id H j.val g) let A := finiteKernelOperator K have hbound := finite_endpoint_block_bound A F G (fun j (n : S) => integerBlockMask id H j.val f n.val) (fun j (n : S) => positionBlockFiber position mass H j.val n.val) (fun j => position_block_fiber_sum position mass S H j.val f hf) (fun j => position_block_coefficients_bound S hH j.val f hM hfM) hR have hfe : (∑ j, ‖F j‖ ^ 2) = ‖finitePositionVector position mass f‖ ^ 2 := by rw [Finset.sum_coe_sort J (fun j : ℤ => ‖finitePositionVector position mass (integerBlockMask id H j f)‖ ^ 2)] exact position_block_energy_sum position hmass S H f hf have hge : (∑ j, ‖G j‖ ^ 2) ≤ 3 * ‖finitePositionVector position mass g‖ ^ 2 := by rw [Finset.sum_coe_sort J (fun j : ℤ => ‖finitePositionVector position mass (integerBlockNearMask id H j g)‖ ^ 2)] exact position_near_block_energy_sum position hmass J H g have htrace := position_block_fiber_trace position mass S H ((A * A.adjoint) ^ R) rw [hfe, htrace] at hbound have htrace0 : 0 ≤ ∑ n ∈ S, (inner ℂ (finiteFiberVector position mass n) (((A * A.adjoint) ^ R) (finiteFiberVector position mass n))).re := by apply Finset.sum_nonneg intro n _ apply positive_spectral_moment_nonneg (A * A.adjoint) (LinearMap.isSymmetric_self_comp_adjoint A) intro v rw [Module.End.mul_apply, ← LinearMap.adjoint_inner_left] exact inner_self_nonneg (𝕜 := ℂ) (x := A.adjoint v) have hpair : ‖inner ℂ (finitePositionVector position mass f) (A (finitePositionVector position mass g))‖ ≤ ∑ j, ‖inner ℂ (F j) (A (G j))‖ := by rw [position_block_kernel_pairing position hmass K S hH f g hf hK, Finset.sum_coe_sort J (fun j : ℤ => ‖inner ℂ (finitePositionVector position mass (integerBlockMask id H j f)) (A (finitePositionVector position mass (integerBlockNearMask id H j g)))‖)] exact norm_sum_le _ _ apply hpair.trans (hbound.trans ?_) dsimp only [A] have hpow := Real.rpow_le_rpow (Finset.sum_nonneg (fun j _ => sq_nonneg ‖G j‖)) hge (by norm_num : (0 : ℝ) ≤ 1 / 2) apply mul_le_mul_of_nonneg_right _ (Real.rpow_nonneg htrace0 _) apply mul_le_mul_of_nonneg_right _ (by positivity) exact mul_le_mul_of_nonneg_left hpow (by positivity) end Bounty end section /- The actual lifted edge pairing as an arithmetic shifted divisor sum. -/ open Finset namespace Bounty end Bounty end section /- The two literal invariant endpoints survive removal of the shared dilation. -/ open Finset namespace Bounty theorem physical_free_factor_empty {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) : physicalFreeFactor (fun _ => ∅) aux = 1 := by classical simp only [physicalFreeFactor, Finset.univ_eq_empty, prod_empty, prod_const_one] end Bounty end section /- Exact cancellation of the shared factor in the manuscript's three phases. -/ namespace Bounty theorem physical_phase_add (a b : ℝ) (n : ℕ) : physicalPhase (a + b) n = physicalPhase a n * physicalPhase b n := by simp only [physicalPhase, add_mul, Complex.ofReal_add, Complex.exp_add] theorem physical_shared_phase_cancel (a b : ℝ) {s w z d : ℕ} (hs : 0 < s) (hw : 0 < w) (hz : 0 < z) (hd : 0 < d) : physicalPhase a (s * w) * physicalPhase b (s * z) * physicalPhase (-(a + b)) (s * d) = physicalPhase a w * physicalPhase b z * physicalPhase (-(a + b)) d := by rw [physical_phase_mul a hs hw, physical_phase_mul b hs hz, physical_phase_mul (-(a + b)) hs hd] have he : physicalPhase a s * physicalPhase b s * physicalPhase (-(a + b)) s = 1 := by rw [← physical_phase_add, ← physical_phase_add, add_neg_cancel] simp only [physicalPhase, zero_mul, Complex.ofReal_zero, Complex.exp_zero] calc _ = (physicalPhase a s * physicalPhase b s * physicalPhase (-(a + b)) s) * (physicalPhase a w * physicalPhase b z * physicalPhase (-(a + b)) d) := by ring _ = _ := by rw [he, one_mul] theorem physical_shared_scaled_position {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (hprime : ∀ g p, p ∈ P g → p.Prime) (n : ℤ) (Z : ℝ) (hdiv : (physicalSharedFactor C L : ℤ) ∣ n) : (n : ℝ) / (Z * physicalD C L aux) = ((n / physicalSharedFactor C L : ℤ) : ℝ) / (Z * physicalFreeFactor C aux) := by have hn : (n : ℝ) = (physicalSharedFactor C L : ℝ) * ((n / physicalSharedFactor C L : ℤ) : ℝ) := by exact_mod_cast (Int.mul_ediv_cancel' hdiv).symm have hs : (physicalSharedFactor C L : ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt (physical_shared_factor_pos C L hprime)) calc _ = ((physicalSharedFactor C L : ℝ) * ((n / physicalSharedFactor C L : ℤ) : ℝ)) / ((physicalSharedFactor C L : ℝ) * (Z * physicalFreeFactor C aux)) := by rw [← hn, physical_D_shared_free, Nat.cast_mul] congr 1 ring _ = _ := mul_div_mul_left _ _ hs end Bounty end section open MeasureTheory Finset namespace Bounty theorem typeII_cutoff_fourier_truncated_norm_le (A C R t : ℝ) (active : Bool) (hC : (∫ ξ : ℝ, ‖typeIICutoffFourier A active ξ‖) ≤ C) : ‖∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ R}, typeIICutoffFourierIntegrand A active t ξ‖ ≤ C := by apply (norm_integral_le_integral_norm _).trans have heq : (∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ R}, ‖typeIICutoffFourierIntegrand A active t ξ‖) = ∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ R}, ‖typeIICutoffFourier A active ξ‖ := by exact integral_congr_ae (Filter.Eventually.of_forall (fun ξ => typeII_cutoff_fourier_integrand_norm A t ξ active)) rw [heq] exact (setIntegral_le_integral (typeII_cutoff_fourier_integrable A active).norm (Filter.Eventually.of_forall (fun _ => norm_nonneg _))).trans hC end Bounty end section open MeasureTheory Finset namespace Bounty end Bounty end section /- The actual large P-part contribution, including all rough shifted divisors. -/ open Finset Filter Real namespace Bounty noncomputable def candidateLargePRoughDivisorMass (c L q : ℝ) (r jStar : ℕ) (X : ℝ) : ℝ := ∑ u ∈ (arithmeticProductWindow 1 (exp L)).filter (fun u => X < (primePoolPart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u : ℝ)), candidateCoefficient c L q r jStar u * ((roughDivisors (exp (sqrt L)) (2*u+1)).card : ℝ) theorem arithmetic_window_rough_divisors_bound {L : ℝ} (hL : log 33 ≤ L) {u : ℕ} (hu : u ∈ arithmeticProductWindow 1 (exp L)) : ((roughDivisors (exp (sqrt L)) (2*u+1)).card : ℝ) ≤ exp ((2*log 2)*sqrt L) := by have hL0 : 0 < L := (log_pos (by norm_num : (1 : ℝ) < 33)).trans_le hL have hE : (33 : ℝ) ≤ exp L := (log_le_iff_le_exp (by norm_num)).mp hL have huhi : (u : ℝ) ≤ 16*exp L := by simpa only [one_mul] using ((mem_arithmeticProductWindow_iff one_ne_zero (exp L)).mp hu).2 apply roughDivisors_card_le_exp_sqrt hL0 (by omega : 2*u+1 ≠ 0) calc ((2*u+1 : ℕ) : ℝ) = 2*(u : ℝ)+1 := by norm_cast _ ≤ 33*exp L := by linarith _ ≤ exp L*exp L := mul_le_mul_of_nonneg_right hE (exp_pos _).le _ = exp (2*L) := by rw [← exp_add]; congr 1; ring theorem candidate_large_P_rough_mass_le {c L q : ℝ} (hq : 0 ≤ q) (hL : log 33 ≤ L) (r jStar : ℕ) (X : ℝ) : candidateLargePRoughDivisorMass c L q r jStar X ≤ candidateLargePWindowMass c L q r jStar X * exp ((2*log 2)*sqrt L) := by unfold candidateLargePRoughDivisorMass candidateLargePWindowMass rw [sum_mul] apply sum_le_sum intro u hu exact mul_le_mul_of_nonneg_left (arithmetic_window_rough_divisors_bound hL (mem_filter.mp hu).1) (candidate_coefficient_nonneg c L hq r jStar u) theorem exists_candidate_large_P_rough_exp_bound {c q : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (r : ℕ) (κ : ℝ) : ∃ C : ℝ, ∀ jStar : ℕ, ∀ᶠ L : ℝ in atTop, candidateLargePRoughDivisorMass c L q r jStar (exp (κ*L)) ≤ 16*exp L*exp (-κ*L^(3/5 : ℝ))*L^C*exp ((2*log 2)*sqrt L) := by obtain ⟨CP, hP⟩ := exists_candidate_marked_smooth_tail_exp_bound (κ := κ) hc hq0 hq1 1 obtain ⟨CQ, hCQ, hQ⟩ := exists_candidate_Q_harmonic_polynomial_bounds hc r refine ⟨CP+CQ, ?_⟩ intro jStar filter_upwards [hP, hQ jStar, eventually_candidate_Q_weight_free_support hc r, eventually_ge_atTop (log 33)] with L hp hq hfree hL have hL0 : 0 < L := (log_pos (by norm_num : (1 : ℝ) < 33)).trans_le hL have htail := candidate_large_P_window_le_tail (mul_nonneg hc.le hL0.le) hq0 r jStar (exp (κ*L)) (hfree jStar) have hQ0 : 0 ≤ candidateQHarmonicMass c L r jStar := tsum_nonneg (fun n => div_nonneg (candidate_Q_weight_nonneg c L r jStar n) (Nat.cast_nonneg n)) calc _ ≤ (16*exp L*candidateMarkedSmoothTail c L q 1 (exp (κ*L))* candidateQHarmonicMass c L r jStar)*exp ((2*log 2)*sqrt L) := (candidate_large_P_rough_mass_le hq0 hL r jStar _).trans (mul_le_mul_of_nonneg_right htail (exp_pos _).le) _ ≤ (16*exp L*(exp (-κ*L^(3/5 : ℝ))*L^CP)*L^CQ)*exp ((2*log 2)*sqrt L) := by apply mul_le_mul_of_nonneg_right _ (exp_pos _).le exact mul_le_mul (mul_le_mul_of_nonneg_left hp (by positivity)) hq.2 hQ0 (by positivity) _ = _ := by rw [rpow_add hL0]; ring theorem eventually_candidate_large_P_rough_power_saving {c q κ : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hκ : 0 < κ) (r jStar : ℕ) (D : ℝ) : ∀ᶠ L : ℝ in atTop, candidateLargePRoughDivisorMass c L q r jStar (exp (κ*L)) ≤ exp L*L^(-D) := by obtain ⟨C, hC⟩ := exists_candidate_large_P_rough_exp_bound hc hq0 hq1 r κ have hK : 0 ≤ (2 : ℝ)*log 2 := by positivity filter_upwards [hC jStar, eventually_exp_neg_rpow_mul_rpow_mul_exp_sqrt_le (by norm_num : (1/2 : ℝ) < 3/5) hκ hK C (D+1), eventually_ge_atTop (16 : ℝ)] with L hmass hdecay hL have hL0 : 0 < L := by linarith calc _ ≤ 16*exp L*((exp (-κ*L^(3/5 : ℝ))*L^C)*exp ((2*log 2)*sqrt L)) := by convert hmass using 1 ring _ ≤ 16*exp L*L^(-(D+1)) := mul_le_mul_of_nonneg_left hdecay (by positivity) _ = (16/L)*(exp L*L^(-D)) := by rw [show -(D+1) = -D+(-1) by ring, rpow_add hL0, rpow_neg_one] ring _ ≤ exp L*L^(-D) := by have hh : 16/L ≤ 1 := (div_le_one hL0).mpr hL exact mul_le_of_le_one_left (by positivity) hh end Bounty end section /- Actual separated candidate coefficients satisfy factorial bounds independently of the allocation target. -/ open Finset namespace Bounty section variable (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) include c L r jStar hr hj take hkeep theorem candidate_taken_slot_is_pure (slot : CandidateTakenSlot c L r take) : slot.val ≠ candidateRoughSlot c L r jStar hr hj := by intro heq have hs := slot.property rw [heq, hkeep] at hs exact Bool.false_ne_true hs theorem candidate_residual_slot_is_pure (slot : {slot : CandidateRemainingSlot c L r take // slot ≠ candidateRemainingRoughSlot c L r jStar hr hj take hkeep}) : slot.val.val ≠ candidateRoughSlot c L r jStar hr hj := by intro heq exact slot.property (Subtype.ext heq) end section variable {c L : ℝ} {r jStar : ℕ} (hcL : 0 ≤ c*L) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (htwist : ∀ slot p, p ∈ candidateQSlotChoices c L r jStar slot → ‖twist slot p‖ ≤ 1) include c L r jStar hcL hr hj take hkeep twist htwist theorem norm_candidate_taken_coefficient_le_factorial_pow (e : ℕ) : ‖candidateTakenComplexCoefficient c L r jStar take twist e‖ ≤ (r.factorial : ℝ)^(candidateQIndices c L).card := by exact norm_candidate_Q_pure_subset_fiber_le_factorial_pow hcL hr hj Subtype.val Subtype.val_injective (candidate_taken_slot_is_pure c L r jStar hr hj take hkeep) (fun slot => twist slot.val) (fun slot p hp => htwist slot.val p hp) e theorem norm_candidate_residual_prime_coefficient_le_one (q : ℕ) : ‖candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist q‖ ≤ 1 := by let I := {slot : CandidateRemainingSlot c L r take // slot ≠ candidateRemainingRoughSlot c L r jStar hr hj take hkeep} let emb : I → (candidateQIndices c L) × Fin r := fun slot => slot.val.val have hemb : Function.Injective emb := by intro a b hab exact Subtype.ext (Subtype.ext hab) unfold candidateResidualPrimeCoefficient orderedSlotComplexWeight exact norm_candidate_Q_pure_subset_fiber_normalized_le_one (I := I) hcL hr hj emb hemb (candidate_residual_slot_is_pure c L r jStar hr hj take hkeep) (fun slot => twist slot.val.val) (fun slot p hp => htwist slot.val.val p hp) q end theorem norm_sum_product_eq_le_indicator (S : Finset ℕ) (w : ℕ → ℂ) (z : ℂ) (hw : ∀ q ∈ S, ‖w q‖ ≤ 1) (hz : ‖z‖ ≤ 1) {p : ℕ} (hp : 0 < p) (n : ℕ) : ‖∑ q ∈ S, if p*q=n then z*w q else 0‖ ≤ if p ∣ n then (1 : ℝ) else 0 := by classical by_cases hpn : p ∣ n · rw [if_pos hpn] have heq (q : ℕ) : p*q=n ↔ q=n/p := by constructor · intro h exact (Nat.div_eq_of_eq_mul_right hp h.symm).symm · intro h rw [h, Nat.mul_div_cancel' hpn] simp only [heq] rw [sum_ite_eq'] by_cases hq : n/p ∈ S · rw [if_pos hq, norm_mul] exact (mul_le_mul hz (hw _ hq) (norm_nonneg _) (by norm_num)).trans_eq (mul_one 1) · rw [if_neg hq, norm_zero] norm_num · rw [if_neg hpn] have hzero : ∀ q ∈ S, ¬p*q=n := by intro q _ h exact hpn ⟨q, h.symm⟩ simp only [sum_eq_zero (fun q hq => if_neg (hzero q hq)), norm_zero, le_refl] theorem norm_candidate_remaining_coefficient_le_rough_divisors {c L : ℝ} {r jStar : ℕ} (hcL : 0 ≤ c*L) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (htwist : ∀ slot p, p ∈ candidateQSlotChoices c L r jStar slot → ‖twist slot p‖ ≤ 1) (h : ℕ) : ‖candidateRemainingComplexCoefficient c L r jStar take twist h‖ ≤ (((candidateRoughBand c L jStar).filter (fun p => p ∣ h)).card : ℝ) := by classical rw [candidate_remaining_rough_convolution c L r jStar hr hj take hkeep] apply (norm_sum_le _ _).trans calc _ ≤ ∑ p : candidateRoughBand c L jStar, if p.val ∣ h then (1 : ℝ) else 0 := by apply sum_le_sum intro p _ apply norm_sum_product_eq_le_indicator · intro q _ exact norm_candidate_residual_prime_coefficient_le_one hcL hr hj take hkeep twist htwist q · apply htwist simpa only [candidateQSlotChoices, candidateRoughSlot, and_self, if_true] using p.property · exact roughBand_pos p.property _ = _ := by rw [sum_coe_sort (candidateRoughBand c L jStar) (fun p => if p ∣ h then (1 : ℝ) else 0)] simp only [sum_boole] end Bounty end section /- Finite low-rank bounds retain the saving on the unaffected operations. -/ open Finset Classical namespace Bounty theorem birthForest_low_rank_power_bound {m : ℕ} (F : BirthForestCode m → ℂ) (r₀ : ℕ) {L H B D M : ℝ} (hL : 1 ≤ L) (hH : 0 ≤ H) (hDM : 0 ≤ D + M) (hm : (m : ℝ) ≤ L ^ M) (hF : ∀ code, birthForestRank code < r₀ → ‖F code‖ ≤ H * L ^ (B + 2 * birthForestRank code * D)) : ‖∑ code ∈ (univ : Finset (BirthForestCode m)).filter (fun code => birthForestRank code < r₀), (-1 : ℂ) ^ birthForestRank code * F code‖ ≤ ((m : ℝ) + 1) * H * L ^ (B + 2 * r₀ * (D + M)) := by have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL have heq : (univ : Finset (BirthForestCode m)).filter (fun code => birthForestRank code < r₀) = univ.filter (fun code => birthForestRank code < min r₀ (m + 1)) := by ext code have hr := birthForestRank_le_addresses code simp only [mem_filter, mem_univ, true_and, lt_min_iff] omega rw [heq] apply (birthForest_rank_head_norm_le F (min r₀ (m + 1)) (fun r => H * L ^ (B + 2 * r * D)) (fun r _ => mul_nonneg hH (Real.rpow_pos_of_pos hL0 _).le) (fun code hc => hF code (lt_of_lt_of_le hc (min_le_left _ _)))).trans have hone : 0 ≤ H * L ^ (B + 2 * r₀ * (D + M)) := by positivity calc _ ≤ ∑ _r ∈ range (min r₀ (m + 1)), H * L ^ (B + 2 * r₀ * (D + M)) := by apply sum_le_sum intro r hr have hrr : (r : ℝ) ≤ r₀ := by exact_mod_cast (Nat.le_of_lt (lt_of_lt_of_le (mem_range.mp hr) (min_le_left _ _))) have hp : (m : ℝ) ^ (2 * r) ≤ L ^ (2 * r * M) := by calc _ ≤ (L ^ M) ^ (2 * r) := pow_le_pow_left₀ (Nat.cast_nonneg _) hm _ _ = L ^ (2 * r * M) := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL0.le] congr 1 push_cast ring calc (m : ℝ) ^ (2 * r) * (H * L ^ (B + 2 * r * D)) ≤ L ^ (2 * r * M) * (H * L ^ (B + 2 * r * D)) := mul_le_mul_of_nonneg_right hp (by positivity) _ = H * L ^ (B + 2 * r * (D + M)) := by rw [mul_left_comm, ← Real.rpow_add hL0] congr 1 congr 1 ring _ ≤ H * L ^ (B + 2 * r₀ * (D + M)) := by apply mul_le_mul_of_nonneg_left _ hH apply Real.rpow_le_rpow_of_exponent_le hL nlinarith _ = (min r₀ (m + 1) : ℕ) * (H * L ^ (B + 2 * r₀ * (D + M))) := by simp _ ≤ ((m : ℝ) + 1) * (H * L ^ (B + 2 * r₀ * (D + M))) := by apply mul_le_mul_of_nonneg_right _ hone exact_mod_cast min_le_right r₀ (m + 1) _ = _ := by ring end Bounty end section /- Memory-cap embeddings retain the genuine small residue and injective-list coordinate. The mixed measure is preserved exactly on the embedded states. -/ open Finset open scoped Classical namespace Bounty def physicalSmallBigCapEmbed {S G : Type*} {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell b B : ℕ} {M : G → ℕ} (h : b ≤ B) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M b)) : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) := (s.1, productStateCapEmbed h s.2) theorem physicalSmallBigCapEmbed_injective {S G : Type*} {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell b B : ℕ} {M : G → ℕ} (h : b ≤ B) : Function.Injective (physicalSmallBigCapEmbed (Ps := Ps) (P := P) (Z := Z) (J := J) (ell := ell) (M := M) h) := by intro s t he change (s.1, productStateCapEmbed h s.2) = (t.1, productStateCapEmbed h t.2) at he have hs : s.1 = t.1 := congrArg (fun u : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) => u.1) he have ht : s.2 = t.2 := productStateCapEmbed_injective h (congrArg (fun u : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) => u.2) he) exact Prod.ext hs ht theorem physical_small_big_cap_pullback_energy_le {S G : Type*} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {J ell b B : ℕ} {M : G → ℕ} (h : b ≤ B) (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) : physicalSmallBigEnergy Vs (productMemoryWeight μ ν) (fun s => F (physicalSmallBigCapEmbed h s)) ≤ physicalSmallBigEnergy Vs (productMemoryWeight μ ν) F := by rw [← physical_small_big_energy_eq, ← physical_small_big_energy_eq] unfold finiteWeightedEnergy let embed := physicalSmallBigCapEmbed (Ps := Ps) (P := P) (Z := Z) (J := J) (ell := ell) (M := M) h let weight := fun s => physicalSmallBigMeasure Vs (productMemoryWeight μ ν) s * ‖F s‖ ^ 2 calc _ = ∑ s ∈ (univ : Finset (PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M b))).image embed, weight s := by rw [sum_image (physicalSmallBigCapEmbed_injective h).injOn] rfl _ ≤ ∑ s, weight s := sum_le_sum_of_subset_of_nonneg (subset_univ _) (by intro s _ _ exact mul_nonneg (physical_small_big_measure_nonneg Vs hVs _ (productMemoryWeight_nonneg μ ν hμ hν) s) (sq_nonneg _)) end Bounty end section /- Every intermediate residual on a positive allocation branch satisfies the inventory invariant. -/ open Finset Real namespace Bounty noncomputable def allocationPrefixResidual {n : ℕ} (v : Fin n → ℝ) (R : ℝ) (take : Fin n → Bool) (i : Fin n) : ℝ := R-∑ j, if j < i then (if take j then v j else 0) else 0 noncomputable def allocationSuffixInventory {n : ℕ} (v : Fin n → ℝ) (active : Fin n → Bool) (i : Fin n) : ℝ := ∑ j, if i ≤ j ∧ active j = true then v j else 0 theorem allocation_prefix_eq_ordered_residual {n : ℕ} (v : Fin n → ℝ) (R : ℝ) (take : Fin n → Bool) (i : Fin n) : allocationPrefixResidual v R take i = orderedSlotResidual R (fun j => if take j then 1 else 0) v i := by simp only [allocationPrefixResidual, orderedSlotResidual, sum_filter, ite_mul, one_mul, zero_mul] section variable {n : ℕ} (v : Fin (n+1) → ℝ) include n v theorem allocation_prefix_zero (R : ℝ) (take : Fin (n+1) → Bool) : allocationPrefixResidual v R take 0 = R := by simp [allocationPrefixResidual] theorem allocation_suffix_zero (active : Fin (n+1) → Bool) : allocationSuffixInventory v active 0 = smoothAllocationInventory (n+1) v active := by simp [allocationSuffixInventory, smoothAllocationInventory] theorem allocation_prefix_succ (R : ℝ) (take : Fin (n+1) → Bool) (i : Fin n) : allocationPrefixResidual v R take i.succ = allocationPrefixResidual (Fin.tail v) (R-if take 0 then v 0 else 0) (Fin.tail take) i := by rw [Fin.tail_def, Fin.tail_def] unfold allocationPrefixResidual rw [Fin.sum_univ_succ, sub_sub] simp only [Fin.succ_pos, if_true, Fin.succ_lt_succ_iff] theorem allocation_suffix_succ (active : Fin (n+1) → Bool) (i : Fin n) : allocationSuffixInventory v active i.succ = allocationSuffixInventory (Fin.tail v) (Fin.tail active) i := by rw [Fin.tail_def, Fin.tail_def] unfold allocationSuffixInventory rw [Fin.sum_univ_succ] have hzero : ¬i.succ ≤ 0 := not_le_of_gt (Fin.succ_pos i) simp only [hzero, false_and, if_false, Fin.succ_le_succ_iff, zero_add] end theorem smooth_allocation_next_residual_bound {n : ℕ} (v s : Fin (n+1) → ℝ) (active : Fin (n+1) → Bool) (R A : ℝ) (take : Fin (n+1) → Bool) (hs : 0 < s 0) (hR : 0 ≤ R) (hcap : R ≤ smoothAllocationInventory (n+1) v active+A) (hroom : SmoothAllocationRoom (n+1) v s active A) (hhead : 0 < smoothSlotTransition (v 0) (s 0) R (active 0) (take 0)) : 0 ≤ R-(if take 0 then v 0 else 0) ∧ R-(if take 0 then v 0 else 0) ≤ smoothAllocationInventory n (Fin.tail v) (Fin.tail active)+A := by cases ha : active 0 <;> cases ht : take 0 · have hh : R ≤ smoothAllocationInventory n (Fin.tail v) (Fin.tail active)+A := by rw [Fin.tail_def, Fin.tail_def] unfold smoothAllocationInventory at * simpa only [Fin.sum_univ_succ, ha, Bool.false_eq_true, if_false, zero_add] using hcap simpa only [Bool.false_eq_true, if_false, sub_zero] using And.intro hR hh · simp only [smoothSlotTransition, smoothSlotTakeProbability, ha, ht, Bool.false_eq_true, if_false, if_true] at hhead linarith · have hh := smooth_slot_skip_requires_room hs (by simpa only [ha,ht] using hhead) have hr := hroom.1 ha simp only [Bool.false_eq_true, if_false, sub_zero] exact ⟨hR,(le_of_lt hh).trans hr⟩ · have hh := smooth_slot_take_requires_room hs (by simpa only [ht] using hhead) have hc : R ≤ v 0+smoothAllocationInventory n (Fin.tail v) (Fin.tail active)+A := by rw [Fin.tail_def, Fin.tail_def] unfold smoothAllocationInventory at * simpa only [Fin.sum_univ_succ, ha, if_true] using hcap simp only [if_true] constructor <;> linarith theorem smooth_allocation_prefix_invariant (n : ℕ) (v s : Fin n → ℝ) (active : Fin n → Bool) (R A : ℝ) (take : Fin n → Bool) (hs : ∀ i, 0 < s i) (hR : 0 ≤ R) (hcap : R ≤ smoothAllocationInventory n v active+A) (hroom : SmoothAllocationRoom n v s active A) (hweight : 0 < smoothAllocationWeight n v s active R take) (i : Fin n) : 0 ≤ allocationPrefixResidual v R take i ∧ allocationPrefixResidual v R take i ≤ allocationSuffixInventory v active i+A := by induction n generalizing R with | zero => exact Fin.elim0 i | succ n ih => obtain ⟨hhead,htail⟩ := smooth_allocation_positive_factors hweight have hn := smooth_allocation_next_residual_bound v s active R A take (hs 0) hR hcap hroom hhead refine Fin.cases ?_ (fun j => ?_) i · simpa only [allocation_prefix_zero, allocation_suffix_zero] using And.intro hR hcap · rw [allocation_prefix_succ, allocation_suffix_succ] exact ih (Fin.tail v) (Fin.tail s) (Fin.tail active) _ (Fin.tail take) (fun j => hs j.succ) hn.1 hn.2 hroom.2 htail j end Bounty end section open scoped ContDiff namespace Bounty noncomputable def typeIITameExp (A x : ℝ) : ℝ := typeIISmoothRho (2 * (A + 1)) x * Real.exp x noncomputable def typeIIPulledJoint (A : ℝ) (y : (Fin 4 → ℝ) × EuclideanSpace ℝ (Fin 3)) : ℝ := typeIIThreeLocalizer A y.2 * typeIIEMajorant (y.1 0) (y.1 1 * (typeIITameExp A (y.2 1) - typeIITameExp A (y.2 0))) * typeIINMajorant (y.1 2 * (typeIITameExp A (y.2 2 - y.2 0) - typeIITameExp A (y.2 2 - y.2 1)) + y.1 3 * typeIITameExp A (-y.2 0)) theorem typeII_tame_exp_hasTemperateGrowth (A : ℝ) : Function.HasTemperateGrowth (typeIITameExp A) := (typeII_smooth_rho_hasCompactSupport (2 * (A + 1))).mul_right.hasTemperateGrowth ((typeII_smooth_rho_contDiff (2 * (A + 1))).mul Real.contDiff_exp) theorem typeII_tame_exp_eq {A x : ℝ} (hx : |x| ≤ 2 * (A + 1)) : typeIITameExp A x = Real.exp x := by rw [typeIITameExp, typeII_smooth_rho_eq_one (abs_le.mp hx), one_mul] theorem typeII_pulled_joint_hasTemperateGrowth (A : ℝ) : Function.HasTemperateGrowth (typeIIPulledJoint A) := by have hp (i : Fin 4) : Function.HasTemperateGrowth (fun y : (Fin 4 → ℝ) × EuclideanSpace ℝ (Fin 3) => y.1 i) := (ContinuousLinearMap.proj i : (Fin 4 → ℝ) →L[ℝ] ℝ).hasTemperateGrowth.comp (ContinuousLinearMap.fst ℝ (Fin 4 → ℝ) (EuclideanSpace ℝ (Fin 3))).hasTemperateGrowth have ht (i : Fin 3) : Function.HasTemperateGrowth (fun y : (Fin 4 → ℝ) × EuclideanSpace ℝ (Fin 3) => y.2 i) := (PiLp.proj (𝕜 := ℝ) 2 (fun _ : Fin 3 => ℝ) i).hasTemperateGrowth.comp (ContinuousLinearMap.snd ℝ (Fin 4 → ℝ) (EuclideanSpace ℝ (Fin 3))).hasTemperateGrowth have hloc : Function.HasTemperateGrowth (fun y : (Fin 4 → ℝ) × EuclideanSpace ℝ (Fin 3) => typeIIThreeLocalizer A y.2) := ((typeII_three_localizer_hasCompactSupport A).hasTemperateGrowth (typeII_three_localizer_contDiff A)).comp (ContinuousLinearMap.snd ℝ (Fin 4 → ℝ) (EuclideanSpace ℝ (Fin 3))).hasTemperateGrowth have hexp := typeII_tame_exp_hasTemperateGrowth A have hγ := smoothTransition_hasTemperateGrowth unfold typeIIPulledJoint typeIIEMajorant typeIINMajorant fun_prop theorem typeII_pulled_joint_eq {A : ℝ} (hA : 0 ≤ A) (p : Fin 4 → ℝ) (t : EuclideanSpace ℝ (Fin 3)) : typeIIPulledJoint A (p, t) = typeIIPulledCutoff A (p 0) (p 1) (p 2) (p 3) t := by by_cases hl : typeIIThreeLocalizer A t = 0 · simp only [typeIIPulledJoint, typeIIPulledCutoff, hl, zero_mul] have ht (i : Fin 3) : t i ∈ Set.Icc (-A - 1) (A + 1) := by by_contra hi apply hl exact Finset.prod_eq_zero (Finset.mem_univ i) (typeII_smooth_rho_eq_zero hi) have h0 := ht 0 have h1 := ht 1 have h2 := ht 2 have hb0 : |t 0| ≤ 2 * (A + 1) := abs_le.mpr ⟨by linarith [h0.1], by linarith [h0.2]⟩ have hb1 : |t 1| ≤ 2 * (A + 1) := abs_le.mpr ⟨by linarith [h1.1], by linarith [h1.2]⟩ have hb20 : |t 2 - t 0| ≤ 2 * (A + 1) := abs_le.mpr ⟨by linarith [h2.1, h0.2], by linarith [h2.2, h0.1]⟩ have hb21 : |t 2 - t 1| ≤ 2 * (A + 1) := abs_le.mpr ⟨by linarith [h2.1, h1.2], by linarith [h2.2, h1.1]⟩ have hbn0 : |-t 0| ≤ 2 * (A + 1) := by simpa using hb0 simp only [typeIIPulledJoint, typeIIPulledCutoff, typeIIPulledE, typeIIPulledN, typeII_tame_exp_eq hb0, typeII_tame_exp_eq hb1, typeII_tame_exp_eq hb20, typeII_tame_exp_eq hb21, typeII_tame_exp_eq hbn0] end Bounty end section open Finset MeasureTheory namespace Bounty noncomputable def typeIILogCoordinates (x s : Fin 3 → ℝ) : EuclideanSpace ℝ (Fin 3) := WithLp.toLp 2 (fun i => Real.log (x i / s i)) theorem typeII_euclidean_fourier_phase_eq_prod (ξ t : EuclideanSpace ℝ (Fin 3)) : Complex.exp (((2 * Real.pi * inner ℝ ξ t : ℝ) : ℂ) * Complex.I) = ∏ i, Complex.exp (((2 * Real.pi * ξ i * t i : ℝ) : ℂ) * Complex.I) := by rw [← Complex.exp_sum, PiLp.inner_apply] congr 1 simp only [RCLike.inner_apply, starRingEnd_apply, star_trivial, mul_sum, Complex.ofReal_sum, sum_mul] apply sum_congr rfl intro i hi push_cast ring theorem typeII_log_ratio_fourier_phase (x s ξ : ℝ) (hx : 0 < x) (hs : 0 < s) : Complex.exp (((2 * Real.pi * ξ * Real.log (x / s) : ℝ) : ℂ) * Complex.I) = (s : ℂ) ^ (-((2 * Real.pi * ξ : ℝ) : ℂ) * Complex.I) * (x : ℂ) ^ (((2 * Real.pi * ξ : ℝ) : ℂ) * Complex.I) := by rw [Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr hs.ne'), Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr hx.ne'), ← Complex.ofReal_log hs.le, ← Complex.ofReal_log hx.le, ← Complex.exp_add, Real.log_div hx.ne' hs.ne'] congr 1 push_cast ring theorem typeII_pulled_logarithmic_phase_separation (x s : Fin 3 → ℝ) (hx : ∀ i, 0 < x i) (hs : ∀ i, 0 < s i) (ξ : EuclideanSpace ℝ (Fin 3)) : Complex.exp (((2 * Real.pi * inner ℝ ξ (typeIILogCoordinates x s) : ℝ) : ℂ) * Complex.I) = (∏ i, (s i : ℂ) ^ (-((2 * Real.pi * ξ i : ℝ) : ℂ) * Complex.I)) * ∏ i, (x i : ℂ) ^ (((2 * Real.pi * ξ i : ℝ) : ℂ) * Complex.I) := by rw [typeII_euclidean_fourier_phase_eq_prod, ← prod_mul_distrib] apply prod_congr rfl intro i hi exact typeII_log_ratio_fourier_phase (x i) (s i) (ξ i) (hx i) (hs i) end Bounty end section /- Group-free multiplication preserves the actual marked divisor weight. -/ open Finset namespace Bounty theorem reconstructed_factor_mem_Icc {v m B : ℕ} (hv : 0 < v) (hm : m ∣ v) (hB : v ≤ B) : v/m ∈ Icc 1 B := by have hmpos : 0 < m := Nat.pos_of_dvd_of_pos hm hv apply mem_Icc.mpr constructor · exact Nat.div_pos (Nat.le_of_dvd hv hm) hmpos · exact (Nat.div_le_self v m).trans hB end Bounty end section /- Rough convolution endpoints with the retained-factor support mask kept explicit. -/ open Finset open scoped ComplexConjugate namespace Bounty noncomputable def typeIIRoughConvolution (R C : Finset ℕ) (σ : ℝ) (c : ℕ → ℂ) (n : ℕ) : ℂ := ∑ p ∈ R, ∑ r ∈ C, if p * r = n then typeIIPhase σ p * c r else 0 noncomputable def typeIIMaskedTripleEndpoint (P M H R C : Finset ℕ) (A c : ℕ → ℂ) (t σ : ℝ) (v : ℕ) : ℂ := ∑ m ∈ M, ∑ p ∈ R, ∑ r ∈ C, if (m ∣ v ∧ v / m ∈ H) ∧ m * p * r = primePoolFreePart P v then A m * typeIIPhase t m * typeIIPhase (-σ) p * conj (c r) else 0 theorem typeII_direct_endpoint_eq_divisor_mask (M H : Finset ℕ) (A B : ℕ → ℂ) (t : ℝ) (v : ℕ) (hM : ∀ m ∈ M, 0 < m) : typeIIDirectEndpoint M H A B t v = ∑ m ∈ M, if m ∣ v ∧ v / m ∈ H then A m * typeIIPhase t m * conj (B (v / m)) else 0 := by classical unfold typeIIDirectEndpoint apply sum_congr rfl intro m hm by_cases hd : m ∣ v · have heq (h : ℕ) : m * h = v ↔ h = v / m := by constructor · intro hprod exact (Nat.div_eq_of_eq_mul_right (hM m hm) hprod.symm).symm · intro hquot rw [hquot, Nat.mul_div_cancel' hd] simp only [heq, hd, true_and] rw [sum_ite_eq'] · have hne (h : ℕ) : ¬m * h = v := fun hprod => hd ⟨h, hprod.symm⟩ simp only [hd, false_and, if_false, hne, sum_const_zero] theorem typeII_direct_rough_endpoint_eq_masked_triple (P M H R C : Finset ℕ) (A c : ℕ → ℂ) (t σ : ℝ) {v : ℕ} (hv : 0 < v) (hM : ∀ m ∈ M, 0 < m) (hfree : ∀ m ∈ M, Disjoint m.primeFactors P) : typeIIDirectEndpoint M H A (fun h => typeIIRoughConvolution R C σ c (primePoolFreePart P h)) t v = typeIIMaskedTripleEndpoint P M H R C A c t σ v := by classical rw [typeII_direct_endpoint_eq_divisor_mask M H A _ t v hM] unfold typeIIMaskedTripleEndpoint apply sum_congr rfl intro m hm by_cases hmask : m ∣ v ∧ v / m ∈ H · have hmprod : m * (v / m) = v := Nat.mul_div_cancel' hmask.1 have hquot : v / m ≠ 0 := by intro hz rw [hz, mul_zero] at hmprod exact hv.ne' hmprod.symm have hpart : primePoolFreePart P v = m * primePoolFreePart P (v / m) := by calc _ = primePoolFreePart P (m * (v / m)) := congrArg (primePoolFreePart P) hmprod.symm _ = _ := prime_pool_free_part_mul_free_left (hM m hm).ne' hquot (hfree m hm) have heq (p r : ℕ) : m * p * r = primePoolFreePart P v ↔ p * r = primePoolFreePart P (v / m) := by rw [hpart, mul_assoc] constructor · exact Nat.eq_of_mul_eq_mul_left (hM m hm) · intro h rw [h] have hconj (b : Prop) [Decidable b] (x y : ℂ) : conj (if b then x else y) = if b then conj x else conj y := by split_ifs <;> rfl simp only [hmask, true_and, if_true, heq] simp only [typeIIRoughConvolution, map_sum, hconj, map_mul, map_zero, typeIIPhase_conj, mul_sum, mul_ite, mul_zero, mul_assoc] · simp only [hmask, false_and, if_false, sum_const_zero] theorem typeII_masked_triple_eq_invariant (P M H R C : Finset ℕ) (A c : ℕ → ℂ) (t σ : ℝ) {v : ℕ} (hv : 0 < v) : typeIIMaskedTripleEndpoint P M H R C A c t σ v = invariantTripleEndpoint P (fun m => if m ∈ M ∧ m ∣ v ∧ v / m ∈ H then A m * typeIIPhase t m else 0) (fun p => if p ∈ R then typeIIPhase (-σ) p else 0) (fun r => if r ∈ C then conj (c r) else 0) v := by classical have hpos : 0 < primePoolFreePart P v := Nat.pos_of_ne_zero (primePoolFreePart_ne_zero P hv.ne') calc _ = ∑ m ∈ M, ∑ p ∈ R, ∑ r ∈ C, if m * p * r = primePoolFreePart P v then (if m ∣ v ∧ v / m ∈ H then A m * typeIIPhase t m else 0) * typeIIPhase (-σ) p * conj (c r) else 0 := by unfold typeIIMaskedTripleEndpoint apply sum_congr rfl intro m _ apply sum_congr rfl intro p _ apply sum_congr rfl intro r _ by_cases hm : m ∣ v ∧ v / m ∈ H <;> by_cases heq : m * p * r = primePoolFreePart P v <;> simp [hm, heq] _ = endpointTripleConvolution (fun m => if m ∈ M then (if m ∣ v ∧ v / m ∈ H then A m * typeIIPhase t m else 0) else 0) (fun p => if p ∈ R then typeIIPhase (-σ) p else 0) (fun r => if r ∈ C then conj (c r) else 0) (primePoolFreePart P v) := finite_triple_sum_eq_endpointTripleConvolution M R C _ _ _ hpos _ = _ := by unfold invariantTripleEndpoint congr 1 funext m by_cases hm : m ∈ M <;> by_cases hd : m ∣ v <;> by_cases hh : v / m ∈ H <;> simp [hm, hd, hh] theorem typeII_masked_triple_eq_invariant_of_complete (P M H R C : Finset ℕ) (A c : ℕ → ℂ) (t σ : ℝ) {v : ℕ} (hv : 0 < v) (hHcomplete : ∀ m ∈ M, m ∣ v → v / m ∈ H) : typeIIMaskedTripleEndpoint P M H R C A c t σ v = invariantTripleEndpoint P (fun m => if m ∈ M then A m * typeIIPhase t m else 0) (fun p => if p ∈ R then typeIIPhase (-σ) p else 0) (fun r => if r ∈ C then conj (c r) else 0) v := by classical rw [typeII_masked_triple_eq_invariant P M H R C A c t σ hv] unfold invariantTripleEndpoint endpointTripleConvolution apply sum_congr rfl intro m hm have hfdvd : primePoolFreePart P v ∣ v := by refine ⟨primePoolPart P v, ?_⟩ rw [mul_comm] exact (primePoolPart_mul_primePoolFreePart P v).symm have hmdvd : m ∣ v := (Nat.dvd_of_mem_divisors hm).trans hfdvd by_cases hmM : m ∈ M · simp only [hmM, hmdvd, hHcomplete m hmM hmdvd, and_self, if_true] · simp only [hmM, false_and, if_false, zero_mul, sum_const_zero] theorem typeII_direct_rough_endpoint_eq_invariant_of_complete (P M H R C : Finset ℕ) (A c : ℕ → ℂ) (t σ : ℝ) {v : ℕ} (hv : 0 < v) (hM : ∀ m ∈ M, 0 < m) (hfree : ∀ m ∈ M, Disjoint m.primeFactors P) (hHcomplete : ∀ m ∈ M, m ∣ v → v / m ∈ H) : typeIIDirectEndpoint M H A (fun h => typeIIRoughConvolution R C σ c (primePoolFreePart P h)) t v = invariantTripleEndpoint P (fun m => if m ∈ M then A m * typeIIPhase t m else 0) (fun p => if p ∈ R then typeIIPhase (-σ) p else 0) (fun r => if r ∈ C then conj (c r) else 0) v := (typeII_direct_rough_endpoint_eq_masked_triple P M H R C A c t σ hv hM hfree).trans (typeII_masked_triple_eq_invariant_of_complete P M H R C A c t σ hv hHcomplete) end Bounty end section /- Exact labelled-slot separation for tests of both factors separately. -/ open Finset namespace Bounty theorem ordered_slot_twisted_split_bivariate_test {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (take : I → Prop) [DecidablePred take] (twist : I → ℕ → ℂ) (F : ℕ → ℕ → ℂ) : (∑ x : ∀ i, choices i, (∏ i, twist i (x i).val) * F (orderedSlotProduct (fun i : {i // take i} => choices i.val) (fun i => x i.val)) (orderedSlotProduct (fun i : {i // ¬take i} => choices i.val) (fun i => x i.val))) = ∑ e ∈ orderedSlotProductSupport (fun i : {i // take i} => choices i.val), ∑ h ∈ orderedSlotProductSupport (fun i : {i // ¬take i} => choices i.val), orderedSlotComplexWeight (fun i : {i // take i} => choices i.val) (fun i => twist i.val) e * orderedSlotComplexWeight (fun i : {i // ¬take i} => choices i.val) (fun i => twist i.val) h * F e h := by classical have htuple : (∑ x : ∀ i, choices i, (∏ i, twist i (x i).val) * F (orderedSlotProduct (fun i : {i // take i} => choices i.val) (fun i => x i.val)) (orderedSlotProduct (fun i : {i // ¬take i} => choices i.val) (fun i => x i.val))) = ∑ x : ∀ i : {i // take i}, choices i.val, ∑ y : ∀ i : {i // ¬take i}, choices i.val, (∏ i, twist i.val (x i).val) * (∏ i, twist i.val (y i).val) * F (orderedSlotProduct _ x) (orderedSlotProduct _ y) := by let f : (∀ i : {i // take i}, choices i.val) × (∀ i : {i // ¬take i}, choices i.val) → ℂ := fun z => (∏ i, twist i.val (z.1 i).val) * (∏ i, twist i.val (z.2 i).val) * F (orderedSlotProduct _ z.1) (orderedSlotProduct _ z.2) calc _ = ∑ z, f z := by apply Fintype.sum_equiv (Equiv.piEquivPiSubtypeProd take (fun i => choices i)) intro x simp only [f, Equiv.piEquivPiSubtypeProd_apply] rw [Fintype.prod_subtype_mul_prod_subtype take (fun i => twist i (x i).val)] _ = _ := Fintype.sum_prod_type f rw [htuple] symm calc _ = ∑ e ∈ orderedSlotProductSupport (fun i : {i // take i} => choices i.val), orderedSlotComplexWeight (fun i : {i // take i} => choices i.val) (fun i => twist i.val) e * ∑ y : ∀ i : {i // ¬take i}, choices i.val, (∏ i, twist i.val (y i).val) * F e (orderedSlotProduct _ y) := by apply sum_congr rfl intro e _ simp_rw [mul_assoc] rw [← mul_sum, ordered_slot_complex_fiber_test] _ = _ := by rw [ordered_slot_complex_fiber_test] apply sum_congr rfl intro x _ rw [mul_sum] apply sum_congr rfl intro y _ ring theorem candidate_slot_twisted_split_bivariate_test (c L : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (F : ℕ → ℕ → ℂ) : (∑ x : ∀ slot, candidateQSlotChoices c L r jStar slot, (∏ slot, twist slot (x slot).val) * F (candidateAllocatedFactor c L r jStar x take) (candidateRetainedFactor c L r jStar 1 x take)) / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ) = ∑ e ∈ orderedSlotProductSupport (fun slot : CandidateTakenSlot c L r take => candidateQSlotChoices c L r jStar slot.val), ∑ h ∈ orderedSlotProductSupport (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val), candidateTakenComplexCoefficient c L r jStar take twist e * candidateRemainingComplexCoefficient c L r jStar take twist h * F e h := by simp only [candidate_allocated_factor_eq_taken_product, candidate_retained_factor_eq_remaining_product, one_mul] rw [ordered_slot_twisted_split_bivariate_test _ (fun slot => take ((candidateAllocationOrder c L r).symm slot) = true)] simp only [sum_div, candidateTakenComplexCoefficient, candidateRemainingComplexCoefficient] apply sum_congr rfl intro e _ apply sum_congr rfl intro h _ ring end Bounty end section /- Every retained partial Q-product is nonzero and free of the original group primes. -/ open Finset Filter namespace Bounty theorem ordered_slot_product_support_free {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) (P : Finset ℕ) (hnonzero : ∀ i n, n ∈ choices i → n ≠ 0) (hfree : ∀ i n, n ∈ choices i → Disjoint n.primeFactors P) {n : ℕ} (hn : n ∈ orderedSlotProductSupport choices) : n ≠ 0 ∧ Disjoint n.primeFactors P := by classical obtain ⟨x, hx, rfl⟩ := mem_image.mp hn constructor · exact prod_ne_zero_iff.mpr (fun i _ => hnonzero i (x i).val (x i).property) · apply disjoint_left.mpr intro p hp hP obtain ⟨hpp, hpdvd, _⟩ := Nat.mem_primeFactors.mp hp obtain ⟨i, hi, hpi⟩ := ((Nat.prime_iff.mp hpp).dvd_finsetProd_iff (fun i => (x i).val)).mp hpdvd have hmem : p ∈ (x i).val.primeFactors := Nat.mem_primeFactors.mpr ⟨hpp, hpi, hnonzero i _ (x i).property⟩ exact disjoint_left.mp (hfree i _ (x i).property) hmem hP theorem eventually_candidate_remaining_support_free {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card * r) → Bool) (n : ℕ), n ∈ orderedSlotProductSupport (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val) → n ≠ 0 ∧ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c * L))) := by filter_upwards [eventually_candidate_P_pool_below_rough_cutoff hc, eventually_ge_atTop (0 : ℝ)] with L hpool hL intro r jStar take n hn apply ordered_slot_product_support_free _ _ _ _ hn · intro slot m hm exact candidate_Q_slot_nonzero c L r jStar slot.val hm · intro slot m hm exact candidate_Q_slot_primeFactors_disjoint (mul_nonneg hc.le hL) hpool slot.val hm end Bounty end section /- Exact full-event transport when displacements agree and dilation has the same prime divisors. -/ open Finset open scoped Classical namespace Bounty section Full variable {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ Δ' D D' : ∀ c, A c → G → ℤ) (hΔ : Δ = Δ') (hD : ∀ c a g p, ((n g p : ℤ) ∣ D c a g ↔ (n g p : ℤ) ∣ D' c a g)) noncomputable def fullActiveParameterEventEquiv (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FullActiveEdgeEvent n S B A Δ D x ≃ FullActiveEdgeEvent n S B A Δ' D' x := by subst Δ' exact fullActiveDilationEventEquiv n S B A Δ D D' hD x theorem full_active_parameter_auxiliary (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) : (fullActiveParameterEventEquiv n S B A Δ Δ' D D' hΔ hD x e).1 = e.1 := by subst Δ' rfl theorem full_active_parameter_target (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) : fullActiveEdgeEventTarget n S B A Δ' D' x (fullActiveParameterEventEquiv n S B A Δ Δ' D D' hΔ hD x e) = fullActiveEdgeEventTarget n S B A Δ D x e := by subst Δ' exact full_active_dilation_target n S B A Δ D D' hD x e theorem full_active_parameter_weight [Fintype G] (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) : fullActiveEdgeEventWeight n S B A Δ' D' ω μ ρ V x (fullActiveParameterEventEquiv n S B A Δ Δ' D D' hΔ hD x e) = fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e := by subst Δ' exact full_active_dilation_weight n S B A Δ D D' hD ω μ ρ V x e end Full end Bounty end section /- An inward smooth product window, with exact agreement off the endpoint collars. -/ open Set open scoped ContDiff namespace Bounty noncomputable def typeIIWindowSmooth (δ t : ℝ) : ℝ := Real.smoothTransition ((t - 1) / δ) * Real.smoothTransition ((16 - t) / δ) noncomputable def typeIISharpWindow (t : ℝ) : ℝ := if 1 < t ∧ t ≤ 16 then 1 else 0 def typeIIWindowCollar (δ : ℝ) : Set ℝ := Icc (1 - δ) (1 + δ) ∪ Icc (16 - δ) (16 + δ) theorem typeII_window_smooth_bounds (δ t : ℝ) : 0 ≤ typeIIWindowSmooth δ t ∧ typeIIWindowSmooth δ t ≤ 1 := typeII_transition_product_bounds _ _ theorem typeII_window_smooth_eq_zero {δ t : ℝ} (hδ : 0 < δ) (ht : t ≤ 1 ∨ 16 ≤ t) : typeIIWindowSmooth δ t = 0 := by rcases ht with ht | ht · rw [typeIIWindowSmooth, Real.smoothTransition.zero_of_nonpos (show (t - 1) / δ ≤ 0 from div_nonpos_of_nonpos_of_nonneg (by linarith) hδ.le), zero_mul] · rw [typeIIWindowSmooth, Real.smoothTransition.zero_of_nonpos (show (16 - t) / δ ≤ 0 from div_nonpos_of_nonpos_of_nonneg (by linarith) hδ.le), mul_zero] theorem typeII_window_smooth_eq_one {δ t : ℝ} (hδ : 0 < δ) (ht : t ∈ Icc (1 + δ) (16 - δ)) : typeIIWindowSmooth δ t = 1 := by have h1 : 1 ≤ (t - 1) / δ := (le_div_iff₀ hδ).mpr (by linarith [ht.1]) have h2 : 1 ≤ (16 - t) / δ := (le_div_iff₀ hδ).mpr (by linarith [ht.2]) rw [typeIIWindowSmooth, Real.smoothTransition.one_of_one_le h1, Real.smoothTransition.one_of_one_le h2, mul_one] theorem typeII_window_smooth_support {δ t : ℝ} (hδ : 0 < δ) (ht : typeIIWindowSmooth δ t ≠ 0) : t ∈ Ioo 1 16 := by exact ⟨lt_of_not_ge (fun h => ht (typeII_window_smooth_eq_zero hδ (Or.inl h))), lt_of_not_ge (fun h => ht (typeII_window_smooth_eq_zero hδ (Or.inr h)))⟩ theorem typeII_window_smooth_eq_sharp_off_collar {δ t : ℝ} (hδ : 0 < δ) (ht : t ∉ typeIIWindowCollar δ) : typeIIWindowSmooth δ t = typeIISharpWindow t := by by_cases hw : 1 < t ∧ t ≤ 16 · have hlo : 1 + δ ≤ t := by by_contra h apply ht exact Or.inl ⟨by linarith [hw.1], by linarith⟩ have hhi : t ≤ 16 - δ := by by_contra h apply ht exact Or.inr ⟨by linarith, by linarith [hw.2]⟩ rw [typeII_window_smooth_eq_one hδ ⟨hlo, hhi⟩, typeIISharpWindow, if_pos hw] · have hout : t ≤ 1 ∨ 16 ≤ t := by by_cases h1 : t ≤ 1 · exact Or.inl h1 · exact Or.inr (le_of_lt (lt_of_not_ge (fun h => hw ⟨lt_of_not_ge h1, h⟩))) rw [typeII_window_smooth_eq_zero hδ hout, typeIISharpWindow, if_neg hw] theorem typeII_window_ratio_sharp {x : ℝ} (hx : 0 < x) (u : ℕ) : typeIISharpWindow ((u : ℝ) / x) = if u ∈ arithmeticProductWindow 1 x then 1 else 0 := by have heq : (1 < (u : ℝ) / x ∧ (u : ℝ) / x ≤ 16) ↔ u ∈ arithmeticProductWindow 1 x := by rw [mem_arithmeticProductWindow_iff one_ne_zero] simp only [one_mul, lt_div_iff₀ hx, div_le_iff₀ hx] simp only [typeIISharpWindow, heq] theorem typeII_window_smooth_ratio_eq_off_boundary {x δ : ℝ} (hx : 0 < x) (hδ : 0 < δ) {u : ℕ} (hu : u ∉ typeIIBoundaryWindow x δ) : typeIIWindowSmooth δ ((u : ℝ) / x) = if u ∈ arithmeticProductWindow 1 x then 1 else 0 := by rw [← typeII_window_ratio_sharp hx u] apply typeII_window_smooth_eq_sharp_off_collar hδ intro ht apply hu apply (mem_typeII_boundary_window_iff hx.le hδ.le).mpr rcases ht with ht | ht · exact Or.inl ⟨(le_div_iff₀ hx).mp ht.1, (div_le_iff₀ hx).mp ht.2⟩ · exact Or.inr ⟨(le_div_iff₀ hx).mp ht.1, (div_le_iff₀ hx).mp ht.2⟩ end Bounty end section /- Uniform control of the small-prime extraction, including its exceptional set. -/ open Finset namespace Bounty theorem physical_omega_le_two_log {G : Type*} (P : G → Finset ℕ) (g : G) (hP : ∀ p ∈ P g, p.Prime) {n : ℕ} (hn : 0 < n) : (physicalOmega P g (n : ℤ) : ℝ) ≤ 2 * Real.log n := by apply le_trans _ (primeFactors_card_le_two_log hn) apply Nat.cast_le.mpr apply card_le_card intro p hp obtain ⟨hp, hpn⟩ := mem_filter.mp hp exact (hP p hp).mem_primeFactors (Int.natCast_dvd_natCast.mp hpn) hn.ne' noncomputable def markedPrimePeel {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (g : G) (k : ℕ) (f : ℕ → ℂ) (n : ℕ) : ℂ := (1 / (V g : ℂ)) * ∑ p ∈ P g, if p ∣ n then (markedDivisorWeight groups P q V (Function.update t g k) ((n / p : ℕ) : ℤ) : ℂ) * f (n / p) else 0 theorem marked_prime_peel_exact {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (hprime : ∀ g ∈ groups, ∀ p ∈ P g, p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hg : g ∈ groups) (k : ℕ) (ht : t g = k + 1) (n : ℕ) (hsq : ∀ p ∈ P g, ¬ p ^ 2 ∣ n) (f : ℕ → ℂ) (hf : ∀ p ∈ P g, p ∣ n → f (n / p) = f n) : (markedDivisorWeight groups P q V t (n : ℤ) : ℂ) * f n = markedPrimePeel groups P q V t g k f n := by rw [marked_divisor_weight_remove_prime groups P q V t hprime hdis g hg k ht n hsq] unfold markedPrimePeel push_cast rw [mul_assoc, sum_mul] congr 1 apply sum_congr rfl intro p hp by_cases hpn : p ∣ n · simp only [if_pos hpn, hf p hp hpn] · simp only [if_neg hpn, Complex.ofReal_zero, zero_mul] section variable {G : Type*} [sharedInstance1 : DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (V : G → ℝ) (t : G → ℕ) (T : ℕ) (hV : ∀ g ∈ groups, v ≤ V g) (ht : ∀ g ∈ groups, t g ≤ T) (g : G) (hg : g ∈ groups) (k : ℕ) (hk : k ≤ t g) include G sharedInstance1 groups P q v hq0 hq1 hv V t T hV ht g hg k hk theorem marked_prime_peel_norm_le (f : ℕ → ℂ) (n : ℕ) (hf : ∀ p ∈ P g, p ∣ n → f (n / p) = f n) : ‖markedPrimePeel groups P q V t g k f n‖ ≤ ((physicalOmega P g (n : ℤ) : ℝ) / v) * (markedDivisorBound q v T) ^ groups.card * ‖f n‖ := by classical have ht' : ∀ h ∈ groups, Function.update t g k h ≤ T := by intro h hh by_cases he : h = g · subst h simpa only [Function.update_self] using hk.trans (ht g hg) · simpa only [Function.update_of_ne he] using ht h hh have hV0 : ∀ h ∈ groups, 0 ≤ V h := fun h hh => hv.le.trans (hV h hh) have hVg : 0 < V g := hv.trans_le (hV g hg) have hnorm (p : ℕ) : ‖(markedDivisorWeight groups P q V (Function.update t g k) ((n / p : ℕ) : ℤ) : ℂ)‖ ≤ (markedDivisorBound q v T) ^ groups.card := by rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (marked_divisor_weight_nonneg groups P hq0 V _ hV0 _)] exact marked_divisor_weight_le_pow groups P hq0 hq1 hv V _ T hV ht' _ have hc : (((P g).filter (fun p => p ∣ n)).card : ℝ) = (physicalOmega P g (n : ℤ) : ℝ) := by simp only [physicalOmega, physicalDivisorPool, Int.natCast_dvd_natCast] unfold markedPrimePeel rw [← sum_filter, norm_mul, norm_div, norm_one, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hVg] calc _ ≤ (1 / V g) * ∑ p ∈ (P g).filter (fun p => p ∣ n), ‖(markedDivisorWeight groups P q V (Function.update t g k) ((n / p : ℕ) : ℤ) : ℂ) * f (n / p)‖ := mul_le_mul_of_nonneg_left (norm_sum_le _ _) (by positivity) _ ≤ (1 / V g) * ∑ _p ∈ (P g).filter (fun p => p ∣ n), (markedDivisorBound q v T) ^ groups.card * ‖f n‖ := by apply mul_le_mul_of_nonneg_left _ (by positivity) apply sum_le_sum intro p hp rw [norm_mul, hf p (mem_filter.mp hp).1 (mem_filter.mp hp).2] exact mul_le_mul_of_nonneg_right (hnorm p) (norm_nonneg _) _ = (1 / V g) * ((physicalOmega P g (n : ℤ) : ℝ) * ((markedDivisorBound q v T) ^ groups.card * ‖f n‖)) := by rw [sum_const, nsmul_eq_mul, hc] _ ≤ (1 / v) * ((physicalOmega P g (n : ℤ) : ℝ) * ((markedDivisorBound q v T) ^ groups.card * ‖f n‖)) := by apply mul_le_mul_of_nonneg_right (one_div_le_one_div_of_le hv (hV g hg)) exact mul_nonneg (by positivity) (mul_nonneg (pow_nonneg (zero_le_one.trans (one_le_markedDivisorBound q v T)) _) (norm_nonneg _)) _ = _ := by ring theorem marked_prime_peel_error_norm_le (hP : ∀ p ∈ P g, p.Prime) (f : ℕ → ℂ) (n N : ℕ) (hn : 0 < n) (hN : n ≤ N) (hf : ∀ p ∈ P g, p ∣ n → f (n / p) = f n) : ‖(markedDivisorWeight groups P q V t (n : ℤ) : ℂ) * f n - markedPrimePeel groups P q V t g k f n‖ ≤ ((markedDivisorBound q v T) ^ groups.card * (1 + 2 * Real.log N / v)) * ‖f n‖ := by have hV0 : ∀ h ∈ groups, 0 ≤ V h := fun h hh => hv.le.trans (hV h hh) have hw : ‖(markedDivisorWeight groups P q V t (n : ℤ) : ℂ)‖ ≤ (markedDivisorBound q v T) ^ groups.card := by rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (marked_divisor_weight_nonneg groups P hq0 V t hV0 _)] exact marked_divisor_weight_le_pow groups P hq0 hq1 hv V t T hV ht _ have homega := physical_omega_le_two_log P g hP hn have hlog := Real.log_le_log (Nat.cast_pos.mpr hn) (Nat.cast_le.mpr hN) have hsize : (physicalOmega P g (n : ℤ) : ℝ) / v ≤ 2 * Real.log N / v := div_le_div_of_nonneg_right (homega.trans (by linarith)) hv.le calc _ ≤ ‖(markedDivisorWeight groups P q V t (n : ℤ) : ℂ) * f n‖ + ‖markedPrimePeel groups P q V t g k f n‖ := norm_sub_le _ _ _ ≤ (markedDivisorBound q v T) ^ groups.card * ‖f n‖ + (((physicalOmega P g (n : ℤ) : ℝ) / v) * (markedDivisorBound q v T) ^ groups.card * ‖f n‖) := by apply add_le_add · rw [norm_mul] exact mul_le_mul_of_nonneg_right hw (norm_nonneg _) · exact marked_prime_peel_norm_le groups P hq0 hq1 hv V t T hV ht g hg k hk f n hf _ ≤ (markedDivisorBound q v T) ^ groups.card * ‖f n‖ + ((2 * Real.log N / v) * (markedDivisorBound q v T) ^ groups.card * ‖f n‖) := by apply add_le_add le_rfl apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) exact mul_le_mul_of_nonneg_right hsize (pow_nonneg (zero_le_one.trans (one_le_markedDivisorBound q v T)) _) _ = _ := by ring end end Bounty end section /- The partial residue/run factorization is valid before any new-mark count is imposed. -/ open Finset open scoped Classical namespace Bounty section Factor variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] {J ell : ℕ} (groups : Finset G) (V : G → ℝ) (L : ℕ → PhysicalMarkLists P J ell) (n : ℕ) (h : (a : PhysicalPrime P) → ℕ → ZMod a.2.val) (η : ℕ → ℝ) (b : PhysicalPrime P → ℝ) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a = 1 - (∑ j ∈ range (n + 1), η j) / a.2.val) (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a ≠ 0) include hb hb0 in theorem physical_group_run_residue_factor : (∏ a ∈ physicalPrimeGroups P groups, b a) * (∏ a ∈ physicalPrimeGroups P groups, ghostPhaseRunHistory (fun j => decide (a ∈ physicalMarkedPrimes (L j))) (h a) η ((a.2.val : ℝ) * b a)⁻¹ (V a.1) n) = (∏ a ∈ physicalPrimeGroups P groups, (V a.1)⁻¹ ^ ghostPhaseRunCount (fun j => decide (a ∈ physicalMarkedPrimes (L j))) n) * poolPathResidueExpectation (fun a : PhysicalPrime P => a.2.val) (physicalPrimeGroups P groups) (range (n + 1)) (fun a => (range (n + 1)).filter (fun j => a ∈ physicalMarkedPrimes (L j))) h η := by unfold poolPathResidueExpectation rw [← prod_mul_distrib, ← prod_mul_distrib] apply prod_congr rfl intro a ha have hag : a.1 ∈ groups := by simpa [physicalPrimeGroups] using ha simpa only [ZMod.card, decide_eq_true_eq] using ghost_phase_run_history_residue_identity (fun j => decide (a ∈ physicalMarkedPrimes (L j))) (h a) η (V a.1) n (b a) (by simpa only [ZMod.card] using hb a hag) (hb0 a hag) include hb hb0 in theorem physical_partial_run_residue_factor : (∏ a ∈ physicalPrimeGroups P groups, b a) * (poolPathResidueExpectation (fun a : PhysicalPrime P => a.2.val) (physicalPrimeGroups P groupsᶜ) (range (n + 1)) (fun a => (range (n + 1)).filter (fun j => a ∈ physicalMarkedPrimes (L j))) h η * ∏ a ∈ physicalPrimeGroups P groups, ghostPhaseRunHistory (fun j => decide (a ∈ physicalMarkedPrimes (L j))) (h a) η ((a.2.val : ℝ) * b a)⁻¹ (V a.1) n) = (∏ a ∈ physicalPrimeGroups P groups, (V a.1)⁻¹ ^ ghostPhaseRunCount (fun j => decide (a ∈ physicalMarkedPrimes (L j))) n) * poolPathResidueExpectation (fun a : PhysicalPrime P => a.2.val) univ (range (n + 1)) (fun a => (range (n + 1)).filter (fun j => a ∈ physicalMarkedPrimes (L j))) h η := by have hs := physical_prime_groups_split groups (fun a : PhysicalPrime P => (∑ r, activeResidueWeight (range (n + 1)) ((range (n + 1)).filter (fun j => a ∈ physicalMarkedPrimes (L j))) (h a) η r) / (a.2.val : ℝ)) change poolPathResidueExpectation _ univ _ _ _ _ = poolPathResidueExpectation _ (physicalPrimeGroups P groups) _ _ _ _ * poolPathResidueExpectation _ (physicalPrimeGroups P groupsᶜ) _ _ _ _ at hs rw [hs] have hr := physical_group_run_residue_factor groups V L n h η b hb hb0 linear_combination poolPathResidueExpectation (fun a : PhysicalPrime P => a.2.val) (physicalPrimeGroups P groupsᶜ) (range (n + 1)) (fun a => (range (n + 1)).filter (fun j => a ∈ physicalMarkedPrimes (L j))) h η * hr include hb hb0 in theorem physical_partial_run_residue_zero (hz : poolPathResidueExpectation (fun a : PhysicalPrime P => a.2.val) univ (range (n + 1)) (fun a => (range (n + 1)).filter (fun j => a ∈ physicalMarkedPrimes (L j))) h η = 0) : poolPathResidueExpectation (fun a : PhysicalPrime P => a.2.val) (physicalPrimeGroups P groupsᶜ) (range (n + 1)) (fun a => (range (n + 1)).filter (fun j => a ∈ physicalMarkedPrimes (L j))) h η * (∏ a ∈ physicalPrimeGroups P groups, ghostPhaseRunHistory (fun j => decide (a ∈ physicalMarkedPrimes (L j))) (h a) η ((a.2.val : ℝ) * b a)⁻¹ (V a.1) n) = 0 := by have he := physical_partial_run_residue_factor groups V L n h η b hb hb0 rw [hz, mul_zero] at he exact (mul_eq_zero.mp he).resolve_left (prod_ne_zero_iff.mpr (fun a ha => hb0 a (by simpa [physicalPrimeGroups] using ha))) end Factor end Bounty end section /- Common full-slot birth data are the exact original event data extended by none. -/ open Classical namespace Bounty section Event variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) noncomputable def fullMixedCommonEventBornData : FullMixedCommonLocalAddress M B tag → Option (FullMixedBornData n) := optionalBirthExtension (fullMixedCommonLocalEmbedding S B tag) (fullMixedEventBornData n S B A Δ D tag s e) noncomputable def fullMixedCommonEventBirthLabel (a : FullMixedCommonLocalAddress M B tag) : Option ((g : Fin N) × P g) := (fullMixedCommonEventBornData n S B A Δ D tag s e a).map (fullMixedBornPrime n) noncomputable def fullMixedCommonEventBirthPerformed (a : FullMixedCommonLocalAddress M B tag) : Prop := (fullMixedCommonEventBornData n S B A Δ D tag s e a).isSome = true theorem full_mixed_common_event_data_embed (a : FullMixedLocalBirthAddress S B tag) : fullMixedCommonEventBornData n S B A Δ D tag s e (fullMixedCommonLocalEmbedding S B tag a) = fullMixedEventBornData n S B A Δ D tag s e a := optional_birth_extension_apply _ _ _ theorem full_mixed_common_event_label_embed (a : FullMixedLocalBirthAddress S B tag) : fullMixedCommonEventBirthLabel n S B A Δ D tag s e (fullMixedCommonLocalEmbedding S B tag a) = fullMixedEventBirthLabel n S B A Δ D tag s e a := by unfold fullMixedCommonEventBirthLabel fullMixedEventBirthLabel rw [full_mixed_common_event_data_embed] theorem full_mixed_common_event_performed_iff (a : FullMixedCommonLocalAddress M B tag) : fullMixedCommonEventBirthPerformed n S B A Δ D tag s e a ↔ ∃ b, fullMixedCommonLocalEmbedding S B tag b = a ∧ fullMixedEventBirthPerformed n S B A Δ D tag s e b := optional_birth_extension_performed_iff _ _ _ theorem full_mixed_common_event_label_extension (a : FullMixedCommonLocalAddress M B tag) : fullMixedCommonEventBirthLabel n S B A Δ D tag s e a = optionalBirthExtension (fullMixedCommonLocalEmbedding S B tag) (fullMixedEventBirthLabel n S B A Δ D tag s e) a := optional_birth_extension_map _ _ _ _ theorem full_mixed_common_event_label_present (a : FullMixedCommonLocalAddress M B tag) : fullMixedCommonEventBirthPerformed n S B A Δ D tag s e a ↔ (fullMixedCommonEventBirthLabel n S B A Δ D tag s e a).isSome = true := by simp only [fullMixedCommonEventBirthPerformed, fullMixedCommonEventBirthLabel, Option.isSome_map] end Event end Bounty end section /- Finite endpoint-energy control of the additive/logarithmic kernel replacement. -/ open Finset MeasureTheory open scoped NNReal namespace Bounty section variable (S : Finset ℕ) (a : ℕ → ℂ) {K : ℝ → ℂ} {C : ℝ≥0} (hK : LipschitzWith C K) (hsupp : ∀ t, 1 < |t| → K t = 0) (hS : ∀ n ∈ S, 0 < n) include S a K C hK hsupp hS theorem finite_local_kernel_error_pointwise {Y H v : ℝ} (hY : 0 < Y) (hH : 0 < H) (hsmall : H ≤ Y/8) (hv : Y/2 ≤ v) : ‖∑ n ∈ S, a n * (K (((n:ℝ)-v)/H) - K (v*Real.log ((n:ℝ)/v)/H))‖^2 ≤ (4*H+1) * ((C:ℝ)* (16*H/Y))^2 * ∑ n ∈ S.filter (fun (n : ℕ) => |(n:ℝ)-v| ≤ 2*H), ‖a n‖^2 := by classical let T := S.filter (fun (n : ℕ) => |(n:ℝ)-v| ≤ 2*H) let b : ℕ → ℂ := fun n => K (((n:ℝ)-v)/H) - K (v*Real.log ((n:ℝ)/v)/H) have hv0 : 0 < v := by linarith have hHv : H ≤ v := by linarith have heq : (∑ n ∈ S, a n*b n) = ∑ n ∈ T, a n*b n := by symm apply sum_subset (filter_subset _ _) intro n hn hnt have hz : b n = 0 := by by_contra hne apply hnt exact mem_filter.mpr ⟨hn, additive_log_kernel_difference_support hsupp (by exact_mod_cast hS n hn) hv0 hH hHv hne⟩ rw [hz, mul_zero] change ‖∑ n ∈ S, a n*b n‖^2 ≤ _ rw [heq] have hb : ∀ n ∈ T, ‖b n‖ ≤ (C:ℝ)*(16*H/Y) := by intro n hn have hp := lipschitz_log_kernel_comparison hK hY hH (by norm_num : 0 ≤ (2:ℝ)) hv (by linarith : 2*H≤Y/4) (mem_filter.mp hn).2 convert hp using 1; ring have hcf : 0 ≤ (C:ℝ)*(16*H/Y) := by positivity have he := finite_complex_kernel_error_bound T a b hcf hb apply he.trans have hc := short_nat_interval_card S hH.le (v := v) exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hc (sq_nonneg _)) (sum_nonneg (fun n _ => sq_nonneg _)) theorem finite_local_kernel_error_integral {Y H : ℝ} (hY : 0 < Y) (hH : 0 < H) (hsmall : H ≤ Y/8) : (∫ v in Set.Icc (Y/2) (3*Y), ‖∑ n ∈ S, a n * (K (((n:ℝ)-v)/H) - K (v*Real.log ((n:ℝ)/v)/H))‖^2) ≤ (4*H+1) * ((C:ℝ)*(16*H/Y))^2 * (4*H) * (∑ n ∈ S, ‖a n‖^2) := by classical let b : ℕ → ℝ → ℝ := fun n => (Set.Icc ((n:ℝ)-2*H) ((n:ℝ)+2*H)).indicator (fun _ => ‖a n‖^2) have hi (n : ℕ) : Integrable (b n) := by exact (continuous_const.integrableOn_Icc).integrable_indicator measurableSet_Icc have hn (n : ℕ) (v : ℝ) : 0 ≤ b n v := by dsimp only [b] exact Set.indicator_nonneg (fun _ _ => sq_nonneg _) _ have hb (v : ℝ) : (∑ n ∈ S.filter (fun (n : ℕ) => |(n:ℝ)-v| ≤ 2*H), ‖a n‖^2) = ∑ n ∈ S, b n v := by rw [sum_filter] apply sum_congr rfl intro n hn have he : |(n:ℝ)-v| ≤ 2*H ↔ v ∈ Set.Icc ((n:ℝ)-2*H) ((n:ℝ)+2*H) := by rw [abs_le, Set.mem_Icc] constructor <;> intro h <;> constructor <;> linarith [h.1,h.2] simp only [b, Set.indicator_apply, he] have hsum : Integrable (fun v => ∑ n ∈ S, b n v) := integrable_finsetSum S (fun n _ => hi n) have hint : (∫ v : ℝ, ∑ n ∈ S, b n v) = 4*H*(∑ n ∈ S, ‖a n‖^2) := by rw [integral_finsetSum S (fun n _ => hi n), mul_sum] apply sum_congr rfl intro n hn dsimp only [b] rw [integral_indicator_const _ measurableSet_Icc, Real.volume_real_Icc_of_le (by linarith : (n:ℝ)-2*H≤(n:ℝ)+2*H), smul_eq_mul] ring have hcoef : 0 ≤ (4*H+1)*((C:ℝ)*(16*H/Y))^2 := by positivity calc _ ≤ ∫ v in Set.Icc (Y/2) (3*Y), (4*H+1)*((C:ℝ)*(16*H/Y))^2*(∑ n ∈ S, b n v) := by apply integral_mono_of_nonneg (Filter.Eventually.of_forall (fun v => sq_nonneg _)) ((hsum.const_mul _).integrableOn) filter_upwards [ae_restrict_mem measurableSet_Icc] with v hv rw [← hb] exact finite_local_kernel_error_pointwise S a hK hsupp hS hY hH hsmall hv.1 _ = (4*H+1)*((C:ℝ)*(16*H/Y))^2 * (∫ v in Set.Icc (Y/2) (3*Y), ∑ n ∈ S, b n v) := integral_const_mul _ _ _ ≤ (4*H+1)*((C:ℝ)*(16*H/Y))^2 * (∫ v : ℝ, ∑ n ∈ S, b n v) := by apply mul_le_mul_of_nonneg_left _ hcoef exact setIntegral_le_integral hsum (Filter.Eventually.of_forall (fun v => sum_nonneg (fun n _ => hn n v))) _ = _ := by rw [hint]; ring end end Bounty end section /- Exact Mellin representation of the variable-scale logarithmic convolution. -/ open Finset MeasureTheory open scoped FourierTransform namespace Bounty noncomputable def localMellinPolynomial (S : Finset ℕ) (a : ℕ → ℂ) (t : ℝ) : ℂ := ∑ n ∈ S, a n * Complex.exp (((t * Real.log n : ℝ) : ℂ) * Complex.I) noncomputable def localLogConvolution (S : Finset ℕ) (a : ℕ → ℂ) (H v : ℝ) : ℂ := ∑ n ∈ S, a n * localMellinKernelSchwartz (v * Real.log ((n:ℝ)/v) / H) theorem local_kernel_fourier_inversion (x : ℝ) : localMellinKernelSchwartz x = ∫ ξ : ℝ, Complex.exp (((2*Real.pi*ξ*x:ℝ):ℂ)*Complex.I) * 𝓕 localMellinKernelSchwartz ξ := by have hi := congrArg (fun f : SchwartzMap ℝ ℂ => f x) (FourierPair.fourierInv_fourier_eq (E := SchwartzMap ℝ ℂ) (F := SchwartzMap ℝ ℂ) localMellinKernelSchwartz) rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq'] at hi change (∫ ξ : ℝ, Complex.exp (((2*Real.pi*inner ℝ ξ x:ℝ):ℂ)*Complex.I) • 𝓕 localMellinKernelSchwartz ξ) = localMellinKernelSchwartz x at hi rw [← hi] apply integral_congr_ae filter_upwards [] with ξ simp only [RCLike.inner_apply, starRingEnd_apply, star_trivial, smul_eq_mul] congr 2 push_cast ring theorem local_kernel_scaled_fourier_inversion (x : ℝ) {c : ℝ} (hc : 0 < c) : localMellinKernelSchwartz x = (c:ℂ) * ∫ t : ℝ, Complex.exp (((2*Real.pi*(c*t)*x:ℝ):ℂ)*Complex.I) * 𝓕 localMellinKernelSchwartz (c*t) := by have hs := Measure.integral_comp_mul_left (fun ξ : ℝ => Complex.exp (((2*Real.pi*ξ*x:ℝ):ℂ)*Complex.I) * 𝓕 localMellinKernelSchwartz ξ) c rw [abs_of_pos (inv_pos.mpr hc), ← local_kernel_fourier_inversion, Complex.real_smul] at hs rw [hs] push_cast field_simp [Complex.ofReal_ne_zero.mpr hc.ne'] theorem local_kernel_logarithmic_inversion {w v H : ℝ} (hw : 0 < w) (hv : 0 < v) (hH : 0 < H) : localMellinKernelSchwartz (v*Real.log (w/v)/H) = ((H/(2*Real.pi*v):ℝ):ℂ) * ∫ t : ℝ, Complex.exp (((-t*Real.log v:ℝ):ℂ)*Complex.I) * Complex.exp (((t*Real.log w:ℝ):ℂ)*Complex.I) * 𝓕 localMellinKernelSchwartz ((H/(2*Real.pi*v))*t) := by rw [local_kernel_scaled_fourier_inversion _ (show 0 < H/(2*Real.pi*v) by positivity)] congr 1 apply integral_congr_ae filter_upwards [] with t rw [← Complex.exp_add, Real.log_div hw.ne' hv.ne'] congr 2 push_cast field_simp [Complex.ofReal_ne_zero.mpr hH.ne', Complex.ofReal_ne_zero.mpr hv.ne'] ring theorem local_mellin_representation (S : Finset ℕ) (a : ℕ → ℂ) (hS : ∀ n ∈ S, 0 < n) {v H : ℝ} (hv : 0 < v) (hH : 0 < H) : localLogConvolution S a H v = ((H/(2*Real.pi*v):ℝ):ℂ) * ∫ t : ℝ, Complex.exp (((-t*Real.log v:ℝ):ℂ)*Complex.I) * localMellinPolynomial S a t * 𝓕 localMellinKernelSchwartz ((H/(2*Real.pi*v))*t) := by let c : ℝ := H/(2*Real.pi*v) have hc : 0 < c := by dsimp [c]; positivity have hint := (𝓕 localMellinKernelSchwartz).integrable.comp_mul_left' hc.ne' have hi (n : ℕ) : Integrable (fun t : ℝ => a n * (Complex.exp (((-t*Real.log v:ℝ):ℂ)*Complex.I) * Complex.exp (((t*Real.log n:ℝ):ℂ)*Complex.I) * 𝓕 localMellinKernelSchwartz (c*t))) := by apply (hint.norm.const_mul ‖a n‖).mono' · have hh : Continuous (fun t : ℝ => a n * (Complex.exp (((-t*Real.log v:ℝ):ℂ)*Complex.I) * Complex.exp (((t*Real.log n:ℝ):ℂ)*Complex.I) * 𝓕 localMellinKernelSchwartz (c*t))) := by fun_prop exact hh.aestronglyMeasurable · filter_upwards [] with t simp only [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul] exact le_rfl unfold localLogConvolution calc _ = (c:ℂ) * ∑ n ∈ S, a n * ∫ t : ℝ, Complex.exp (((-t*Real.log v:ℝ):ℂ)*Complex.I) * Complex.exp (((t*Real.log n:ℝ):ℂ)*Complex.I) * 𝓕 localMellinKernelSchwartz (c*t) := by rw [mul_sum] apply sum_congr rfl intro n hn rw [local_kernel_logarithmic_inversion (by exact_mod_cast hS n hn) hv hH] dsimp [c] ring _ = (c:ℂ) * ∫ t : ℝ, ∑ n ∈ S, a n * (Complex.exp (((-t*Real.log v:ℝ):ℂ)*Complex.I) * Complex.exp (((t*Real.log n:ℝ):ℂ)*Complex.I) * 𝓕 localMellinKernelSchwartz (c*t)) := by rw [integral_finsetSum S (fun n _ => hi n)] simp only [integral_const_mul] _ = _ := by congr 1 apply integral_congr_ae filter_upwards [] with t simp only [localMellinPolynomial, mul_sum, sum_mul] apply sum_congr rfl intro n hn ring end Bounty end section /- Coefficients on designated groups retain exactly their own conditional average. -/ open Finset open scoped Classical namespace Bounty noncomputable def groupMarkedListsAtSplit {G : Type*} (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) (S : Finset G) : GroupMarkedListsAt P t n ≃ GroupMarkedListsAt (fun g : S => P g.val) (fun g : S => t g.val) n × GroupMarkedListsAt (fun g : {g // g ∉ S} => P g.val) (fun g : {g // g ∉ S} => t g.val) n := by classical exact (groupMarkedListsAtEquiv P t n).trans ((Equiv.piEquivPiSubtypeProd (fun g => g ∈ S) (fun g => Fin (t g) ↪ ↥(physicalDivisorPool P g n))).trans (Equiv.prodCongr (groupMarkedListsAtEquiv (fun g : S => P g.val) (fun g : S => t g.val) n).symm (groupMarkedListsAtEquiv (fun g : {g // g ∉ S} => P g.val) (fun g : {g // g ∉ S} => t g.val) n).symm)) theorem group_marked_selected_sum {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) (S : Finset G) (b : GroupMarkedLists (fun g : S => P g.val) (fun g : S => t g.val) → ℂ) : (∑ L : GroupMarkedListsAt P t n, b (fun g : S => L.val g.val)) = ∑ x : GroupMarkedListsAt (fun g : S => P g.val) (fun g : S => t g.val) n × GroupMarkedListsAt (fun g : {g // g ∉ S} => P g.val) (fun g : {g // g ∉ S} => t g.val) n, b x.1.val := by classical exact Fintype.sum_equiv (groupMarkedListsAtSplit P t n S) _ _ (fun _ => rfl) theorem group_marked_selected_card {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) (S : Finset G) : Nat.card (GroupMarkedListsAt P t n) = Nat.card (GroupMarkedListsAt (fun g : S => P g.val) (fun g : S => t g.val) n) * Nat.card (GroupMarkedListsAt (fun g : {g // g ∉ S} => P g.val) (fun g : {g // g ∉ S} => t g.val) n) := by classical rw [Nat.card_congr (groupMarkedListsAtSplit P t n S), Nat.card_prod] theorem weighted_group_marked_sum_selected_average {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (n : ℤ) (S : Finset G) (b : GroupMarkedLists (fun g : S => P g.val) (fun g : S => t g.val) → ℂ) : weightedGroupMarkedSum P q V t n (fun L => b (fun g : S => L g.val)) = (markedDivisorWeight univ P q V t n : ℂ) * groupMarkedAverage (fun g : S => P g.val) (fun g : S => t g.val) n b := by classical rw [weightedGroupMarkedSum, group_marked_selected_sum, marked_divisor_weight_eq_fiber_mass, group_marked_selected_card P t n S] simp only [Complex.ofReal_mul, Complex.ofReal_natCast, Nat.cast_mul, Nat.card_eq_fintype_card, groupMarkedAverage] by_cases hz : Fintype.card (GroupMarkedListsAt (fun g : S => P g.val) (fun g : S => t g.val) n) = 0 · let : IsEmpty (GroupMarkedListsAt (fun g : S => P g.val) (fun g : S => t g.val) n) := Fintype.card_eq_zero_iff.mp hz simp only [Fintype.sum_empty, mul_zero] · have hne : (Fintype.card (GroupMarkedListsAt (fun g : S => P g.val) (fun g : S => t g.val) n) : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr hz rw [Fintype.sum_prod_type] simp only [sum_const, card_univ, nsmul_eq_mul, ← mul_sum] simp only [← Nat.card_eq_fintype_card] at hne ⊢ field_simp [hne] congr 2 ext L simp only [mem_univ] end Bounty end section /- The actual normalized list average uses only its groups' divisor pools. -/ open Finset namespace Bounty theorem group_marked_average_congr_divisor_pools {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n m : ℤ) (b : GroupMarkedLists P t → ℂ) (hpool : ∀ g, physicalDivisorPool P g n = physicalDivisorPool P g m) : groupMarkedAverage P t n b = groupMarkedAverage P t m b := by classical have hc : Nat.card (GroupMarkedListsAt P t n) = Nat.card (GroupMarkedListsAt P t m) := by rw [group_marked_lists_at_card, group_marked_lists_at_card] apply prod_congr rfl intro g _ simp only [physicalOmega, hpool g] have hp (L : GroupMarkedLists P t) : (∀ g s, ((L g s).val : ℤ) ∣ n) ↔ (∀ g s, ((L g s).val : ℤ) ∣ m) := by constructor · intro h g s have hm : (L g s).val ∈ physicalDivisorPool P g n := mem_filter.mpr ⟨(L g s).property, h g s⟩ rw [hpool g] at hm exact (mem_filter.mp hm).2 · intro h g s have hm : (L g s).val ∈ physicalDivisorPool P g m := mem_filter.mpr ⟨(L g s).property, h g s⟩ rw [← hpool g] at hm exact (mem_filter.mp hm).2 unfold groupMarkedAverage simp only [← Nat.card_eq_fintype_card, hc] congr 1 rw [group_marked_sum_eq_indicator, group_marked_sum_eq_indicator] apply sum_congr rfl intro L _ simp only [hp L] theorem group_marked_selected_average_div_prime {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (t : G → ℕ) (S : Finset G) (hprime : ∀ g ∈ S, ∀ p ∈ P g, p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hg : g ∉ S) {p n : ℕ} (hp : p ∈ P g) (hpr : p.Prime) (hpn : p ∣ n) (b : GroupMarkedLists (fun h : S => P h.val) (fun h : S => t h.val) → ℂ) : groupMarkedAverage (fun h : S => P h.val) (fun h : S => t h.val) ((n / p : ℕ) : ℤ) b = groupMarkedAverage (fun h : S => P h.val) (fun h : S => t h.val) (n : ℤ) b := by apply group_marked_average_congr_divisor_pools intro h have hne : g ≠ h.val := by intro he; exact hg (he.symm ▸ h.property) exact physical_divisor_pool_div_other_prime P h.val (hprime h.val h.property) hpr (fun hph => disjoint_left.mp (hdis hne) hp hph) hpn end Bounty end section /- The actual compactly localized Mellin amplitude, with the library Fourier convention. -/ open MeasureTheory open scoped FourierTransform ContDiff namespace Bounty noncomputable def localMellinAmplitude (j : ℕ) (v u : ℝ) : ℂ := ((typeIISmoothRho 2 u * Real.exp (-u) : ℝ) : ℂ) * 𝓕 localMellinKernelSchwartz (Real.exp (-u)*v/(2*Real.pi)) * (((1+v^2)^((j : ℝ)/4) : ℝ) : ℂ) theorem local_mellin_amplitude_contDiff (j : ℕ) (v : ℝ) : ContDiff ℝ ∞ (localMellinAmplitude j v) := by have hρ := typeII_smooth_rho_contDiff 2 have hf := (𝓕 localMellinKernelSchwartz).smooth ⊤ have hc : ContDiff ℝ ∞ (fun x : ℝ => (x : ℂ)) := Complex.ofRealCLM.contDiff unfold localMellinAmplitude fun_prop theorem local_mellin_amplitude_zero (j : ℕ) (v u : ℝ) (hu : u ∉ Set.Icc (-3) 3) : localMellinAmplitude j v u = 0 := by have hρ : typeIISmoothRho 2 u = 0 := by apply typeII_smooth_rho_eq_zero intro h apply hu constructor <;> linarith [h.1,h.2] simp only [localMellinAmplitude, hρ, zero_mul, Complex.ofReal_zero] theorem local_mellin_amplitude_compact (j : ℕ) (v : ℝ) : HasCompactSupport (localMellinAmplitude j v) := HasCompactSupport.intro isCompact_Icc (fun u hu => local_mellin_amplitude_zero j v u hu) noncomputable def localMellinAmplitudeSchwartz (j : ℕ) (v : ℝ) : SchwartzMap ℝ ℂ := (local_mellin_amplitude_compact j v).toSchwartzMap (local_mellin_amplitude_contDiff j v) end Bounty end section /- A finite stage index reserves stage zero for the initial boundary and the successor stages for actual original events. -/ namespace Bounty variable {J K : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedCommonIndexStage (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : Fin (steps.length + 1) := match fullMixedCommonBirthOrder M B steps i with | .inl _ => 0 | .inr a => a.1.succ theorem full_mixed_common_index_stage_val (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : (fullMixedCommonIndexStage M B steps i).val = fullMixedCommonBirthStage M B steps (fullMixedCommonBirthOrder M B steps i) := by unfold fullMixedCommonIndexStage cases fullMixedCommonBirthOrder M B steps i <;> rfl theorem full_mixed_common_index_stage_monotone : Monotone (fullMixedCommonIndexStage M B steps) := by intro i j hij apply Fin.le_iff_val_le_val.mpr simp only [full_mixed_common_index_stage_val] exact full_mixed_common_order_stage_monotone M B steps hij theorem full_mixed_common_index_stage_zero_iff (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : fullMixedCommonIndexStage M B steps i = 0 ↔ ∃ a, fullMixedCommonBirthOrder M B steps i = Sum.inl a := by unfold fullMixedCommonIndexStage cases h : fullMixedCommonBirthOrder M B steps i with | inl a => simp | inr a => simp end Bounty end section open scoped BigOperators ComplexConjugate open MeasureTheory namespace Bounty theorem dirichlet_polynomial_hasDerivAt (s : Finset ℕ) (c : ℕ → ℂ) (t : ℝ) : HasDerivAt (fun t => ∑ n ∈ s, c n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)) (∑ n ∈ s, (c n * ((Real.log (n : ℝ) : ℂ) * Complex.I)) * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)) t := by apply HasDerivAt.fun_sum intro n _ have hd : HasDerivAt (fun y : ℝ => ((Real.log (n : ℝ) : ℂ) * Complex.I) * y) ((Real.log (n : ℝ) : ℂ) * Complex.I) t := by simpa only [mul_one, id_eq] using! ((hasDerivAt_id (t : ℂ)).const_mul ((Real.log (n : ℝ) : ℂ) * Complex.I)).comp_ofReal have he := ((Complex.hasDerivAt_exp _).comp t hd).const_mul (c n) simpa only [Complex.ofReal_mul, mul_comm, mul_left_comm, mul_assoc, Function.comp_apply] using! he theorem dirichlet_derivative_coefficient_energy (s : Finset ℕ) (c : ℕ → ℂ) (N : ℕ) (hs : ∀ n ∈ s, 1 ≤ n ∧ n ≤ N) : (∑ n ∈ s, ‖c n * ((Real.log (n : ℝ) : ℂ) * Complex.I)‖ ^ 2) ≤ (Real.log N) ^ 2 * ∑ n ∈ s, ‖c n‖ ^ 2 := by rw [Finset.mul_sum] apply Finset.sum_le_sum intro n hn have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast (hs n hn).1 have hn0 : (0 : ℝ) < n := zero_lt_one.trans_le hn1 have hlog0 := Real.log_nonneg hn1 have hlog := Real.log_le_log hn0 (show (n : ℝ) ≤ N by exact_mod_cast (hs n hn).2) simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hlog0, Complex.norm_I, mul_one, mul_pow] have hsq := (sq_le_sq₀ hlog0 (hlog0.trans hlog)).mpr hlog nlinarith [mul_le_mul_of_nonneg_left hsq (sq_nonneg ‖c n‖)] end Bounty end section open Finset open scoped ComplexConjugate namespace Bounty noncomputable def integerIntervalPhase (a b : ℤ) (φ : ℝ → ℝ) (n : ℤ) : ℂ := if n ∈ Icc a b then Complex.exp ((φ (n:ℝ):ℂ)*Complex.I) else 0 theorem integer_interval_phase_support (a b : ℤ) (φ : ℝ → ℝ) (n : ℤ) (hn : n ∉ Icc a b) : integerIntervalPhase a b φ n = 0 := by simp only [integerIntervalPhase, if_neg hn] theorem integer_interval_phase_norm (a b : ℤ) (φ : ℝ → ℝ) (n : ℤ) : ‖integerIntervalPhase a b φ n‖ ≤ 1 := by unfold integerIntervalPhase split_ifs · rw [Complex.norm_exp_ofReal_mul_I] · simp only [norm_zero, zero_le_one] theorem integer_interval_phase_sum (a b : ℤ) (φ : ℝ → ℝ) : (∑ n ∈ Icc a b, integerIntervalPhase a b φ n) = ∑ n ∈ Icc a b, Complex.exp ((φ (n:ℝ):ℂ)*Complex.I) := by apply sum_congr rfl intro n hn simp only [integerIntervalPhase, if_pos hn] theorem integer_interval_phase_correlation (a b h : ℤ) (φ : ℝ → ℝ) (hh : 0 ≤ h) : finiteShiftCorrelation (Icc a b) (integerIntervalPhase a b φ) h = ∑ n ∈ Icc a (b-h), Complex.exp (((φ ((n:ℝ)+(h:ℝ))-φ (n:ℝ)):ℂ)*Complex.I) := by classical have hsub : Icc a (b-h) ⊆ Icc a b := by intro n hn have hn' := mem_Icc.mp hn apply mem_Icc.mpr omega unfold finiteShiftCorrelation rw [← sum_subset hsub (fun n hn hnnot => ?_)] · apply sum_congr rfl intro n hn have hn' := mem_Icc.mp hn have hns : n ∈ Icc a b := hsub hn have hnh : n+h ∈ Icc a b := by apply mem_Icc.mpr; omega simp only [integerIntervalPhase, if_pos hns, if_pos hnh, ← Complex.exp_conj, map_mul, Complex.conj_ofReal, Complex.conj_I] rw [← Complex.exp_add] congr 1 push_cast ring · have hnh : n+h ∉ Icc a b := by intro hnh apply hnnot have hn' := mem_Icc.mp hn have hnh' := mem_Icc.mp hnh apply mem_Icc.mpr omega rw [integer_interval_phase_support a b φ (n+h) hnh, zero_mul] theorem integer_phase_van_der_corput_subinterval (A B a b H : ℤ) (φ : ℝ → ℝ) (hAB : A ≤ B) (hAa : A ≤ a) (hbB : b ≤ B) (hH : 1 ≤ H) (hHN : H ≤ B-A+1) : ‖∑ n ∈ Icc a b, Complex.exp ((φ (n:ℝ):ℂ)*Complex.I)‖^2 ≤ 2*((B-A+1:ℤ):ℝ)^2/(H:ℝ) + (4*((B-A+1:ℤ):ℝ)/(H:ℝ)) * ∑ h ∈ Icc (1:ℤ) (H-1), ‖∑ n ∈ Icc a (b-h), Complex.exp (((φ ((n:ℝ)+(h:ℝ))-φ (n:ℝ)):ℂ)*Complex.I)‖ := by let f := integerIntervalPhase a b φ have hsub : Icc a b ⊆ Icc A B := by intro n hn have hn' := mem_Icc.mp hn apply mem_Icc.mpr omega have hsupp (n : ℤ) (hn : n ∉ Icc A B) : f n = 0 := integer_interval_phase_support a b φ n (fun h => hn (hsub h)) have hsum : (∑ n ∈ Icc A B, f n) = ∑ n ∈ Icc a b, Complex.exp ((φ (n:ℝ):ℂ)*Complex.I) := by rw [← sum_subset hsub (fun n hn hnnot => integer_interval_phase_support a b φ n hnnot)] exact integer_interval_phase_sum a b φ have hcorr (h : ℤ) : finiteShiftCorrelation (Icc A B) f h = finiteShiftCorrelation (Icc a b) f h := by unfold finiteShiftCorrelation symm apply sum_subset hsub intro n hn hnnot have hz : f n = 0 := integer_interval_phase_support a b φ n hnnot rw [hz, map_zero, mul_zero] have hv := integer_interval_van_der_corput_unit A B H f hAB hH hHN hsupp (fun n hn => integer_interval_phase_norm a b φ n) rw [hsum] at hv apply hv.trans_eq congr 2 apply sum_congr rfl intro h hh rw [hcorr, integer_interval_phase_correlation a b h φ (by have := (mem_Icc.mp hh).1; omega)] end Bounty end section /- First-derivative exponential-sum test on a finite natural range. -/ open Finset namespace Bounty theorem first_derivative_range_sum_bound (f : ℕ → ℝ) (N : ℕ) (k : ℤ) {δ : ℝ} (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (hband : ∀ n < N, (k : ℝ)+δ ≤ f (n+1)-f n ∧ f (n+1)-f n ≤ (k : ℝ)+1-δ) (hmono : MonotoneOn (fun n => f (n+1)-f n) (Set.Iio N) ∨ AntitoneOn (fun n => f (n+1)-f n) (Set.Iio N)) : ‖∑ n ∈ range N, realUnitPhase (f n)‖ ≤ 2/δ := by apply discrete_unit_phase_sum_bound (fun n => realUnitPhase (f n)) (fun n => f (n+1)-f n-k) N hδ hδhalf · intro n hn exact (real_unit_phase_norm _).le · intro n hn exact real_unit_phase_increment (f n) (f (n+1)) k · intro n hn have hb := hband n hn constructor <;> linarith · rcases hmono with hm | hm · left intro a ha b hb hab exact sub_le_sub_right (hm ha hb hab) _ · right intro a ha b hb hab exact sub_le_sub_right (hm ha hb hab) _ end Bounty end section /- Natural interval adapter for the proved discrete Kusmin-Landau estimate. -/ open Finset namespace Bounty theorem nat_first_derivative_sum_bound (f : ℕ → ℝ) (a b : ℕ) (k : ℤ) {δ : ℝ} (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (hband : ∀ n ∈ Icc a b, (k : ℝ)+δ ≤ f (n+1)-f n ∧ f (n+1)-f n ≤ k+1-δ) (hmono : MonotoneOn (fun n => f (n+1)-f n) (Set.Icc a b)) : ‖∑ n ∈ Icc a b, realUnitPhase (f n)‖ ≤ 2/δ := by have he := discrete_unit_phase_sum_bound (fun n => realUnitPhase (f (a+n))) (fun n => f (a+n+1)-f (a+n)-k) (b+1-a) hδ hδhalf (fun n _ => (real_unit_phase_norm _).le) (fun n _ => by simpa only [Nat.add_assoc,realUnitPhase] using real_unit_phase_increment (f (a+n)) (f (a+n+1)) k) (fun n hn => by have h := hband (a+n) (mem_Icc.mpr ⟨by omega,by omega⟩) constructor <;> linarith) (Or.inl (by intro i hi j hj hij change i < b+1-a at hi change j < b+1-a at hj have h := hmono (a := a+i) (b := a+j) ⟨by omega,by omega⟩ ⟨by omega,by omega⟩ (by omega) exact sub_le_sub_right h k)) have hset : Icc a b = Ico a (b+1) := by ext n simp only [mem_Icc,mem_Ico] omega rw [hset,sum_Ico_eq_sum_range] exact he end Bounty end section /- The literal reciprocal prime polynomial and all unit intervals meeting its exceptional-time set in a bounded time window. -/ open Finset Set open scoped Classical namespace Bounty noncomputable def primeReciprocalPolynomial (P : Finset ℕ) (b : P → ℂ) (t : ℝ) : ℂ := ∑ p : P, (b p / (p.val : ℂ)) * Complex.exp (((Real.log (p.val : ℝ) * t : ℝ) : ℂ) * Complex.I) def primeExceptionalTimes (P : Finset ℕ) (b : P → ℂ) (η R : ℝ) : Set ℝ := {t | |t| ≤ R ∧ η < ‖primeReciprocalPolynomial P b t‖} noncomputable def primeExceptionalIntervals (P : Finset ℕ) (b : P → ℂ) (η R : ℝ) : Finset ℤ := occupiedUnitIntervals (Finset.Icc (-(⌈R⌉₊ : ℤ) - 1) (⌈R⌉₊ : ℤ)) (primeExceptionalTimes P b η R) theorem mem_primeExceptionalIntervals (P : Finset ℕ) (b : P → ℂ) (η R : ℝ) (i : ℤ) : i ∈ primeExceptionalIntervals P b η R ↔ ∃ t ∈ Set.Icc (i : ℝ) ((i : ℝ) + 1), |t| ≤ R ∧ η < ‖primeReciprocalPolynomial P b t‖ := by rw [primeExceptionalIntervals, mem_occupiedUnitIntervals] constructor · exact fun h => h.2 · intro h refine ⟨?_, h⟩ obtain ⟨t, ht, hR, _⟩ := h have hc : R ≤ (⌈R⌉₊ : ℝ) := Nat.le_ceil R have htl : -R ≤ t := (abs_le.mp hR).1 have htr : t ≤ R := (abs_le.mp hR).2 apply Finset.mem_Icc.mpr constructor · have hl : -(⌈R⌉₊ : ℝ) - 1 ≤ (i : ℝ) := by linarith [ht.2] exact_mod_cast hl · have hr : (i : ℝ) ≤ (⌈R⌉₊ : ℝ) := by linarith [ht.1] exact_mod_cast hr theorem prime_exceptional_window_bounds (R : ℝ) (i : ℤ) (hi : i ∈ Finset.Icc (-(⌈R⌉₊ : ℤ) - 1) (⌈R⌉₊ : ℤ)) : -(⌈R⌉₊ : ℝ) - 1 ≤ (i : ℝ) ∧ (i : ℝ) + 2 ≤ (⌈R⌉₊ : ℝ) + 2 := by obtain ⟨hl, hr⟩ := Finset.mem_Icc.mp hi constructor · exact_mod_cast hl · have h : (i : ℝ) ≤ (⌈R⌉₊ : ℝ) := by exact_mod_cast hr linarith end Bounty end section /- Sparse Dirichlet energy for finite integer supports, from a logarithmic kernel bound. -/ open scoped BigOperators namespace Bounty theorem sparse_dirichlet_polynomial_energy {ι : Type*} (indices : Finset ι) (x : ι → ℝ) (support : Finset ℕ) (c : ℕ → ℂ) (N : ℕ) {U E : ℝ} (hU : 0 ≤ U) (hE : 0 ≤ E) (hsep : ∀ i ∈ indices, ∀ j ∈ indices, i ≠ j → 1 ≤ |x i - x j|) (hspan : ∀ i ∈ indices, ∀ j ∈ indices, |x i - x j| ≤ N) (hkernel : ∀ z : ℝ, |z| ≤ N → ‖∑ n ∈ support, Complex.exp ((Real.log (n : ℝ) * z : ℝ) * Complex.I)‖ ≤ U / (1 + |z|) + E) : (∑ i ∈ indices, ‖∑ n ∈ support, c n * Complex.exp ((Real.log (n : ℝ) * x i : ℝ) * Complex.I)‖ ^ 2) ≤ (U * (1 + 2 * (1 + Real.log N)) + (indices.card : ℝ) * E) * ∑ n ∈ support, ‖c n‖ ^ 2 := by have hcs (f : ℕ → ℂ) : (∑ n : ↥support, f n) = ∑ n ∈ support, f n := Finset.sum_coe_sort support f have hrs (f : ℕ → ℝ) : (∑ n : ↥support, f n) = ∑ n ∈ support, f n := Finset.sum_coe_sort support f have his (f : ι → ℝ) : (∑ i : ↥indices, f i) = ∑ i ∈ indices, f i := Finset.sum_coe_sort indices f have h := sparse_exponential_polynomial_energy (I := ↥indices) (X := ↥support) (fun i => x i) (fun n => Real.log (n.val : ℝ)) (fun n => c n) N hU hE (fun i j hij => hsep i i.property j j.property (fun he => hij (Subtype.ext he))) (fun i j => hspan i i.property j j.property) (fun z hz => by rw [hcs (fun n => Complex.exp ((Real.log (n : ℝ) * z : ℝ) * Complex.I))] exact hkernel z hz) have hp (i : ι) : (∑ n : ↥support, c n * Complex.exp ((Real.log (n.val : ℝ) * x i : ℝ) * Complex.I)) = ∑ n ∈ support, c n * Complex.exp ((Real.log (n : ℝ) * x i : ℝ) * Complex.I) := hcs (fun n => c n * Complex.exp ((Real.log (n : ℝ) * x i : ℝ) * Complex.I)) simp_rw [hp] at h rw [hrs (fun n => ‖c n‖ ^ 2)] at h rw [his (fun i => ‖∑ n ∈ support, c n * Complex.exp ((Real.log (n : ℝ) * x i : ℝ) * Complex.I)‖ ^ 2)] at h simpa only [Fintype.card_coe] using h end Bounty end section namespace Bounty section variable (hs : List ℝ) (u c : ℝ) (k : ℕ) (x lo hi : ℝ) (hhs : ∀ h ∈ hs, 0 ≤ h) (hlo : 0 < lo) (hxlo : lo ≤ x+c) (hxhi : x+c+hs.sum ≤ hi) include hs u c k x lo hi hhs hlo hxlo hxhi theorem mixed_logarithmic_difference_abs_bounds_on_box : (hs.prod * |u| * ((k+hs.length).factorial:ℝ)) / hi^(k+hs.length+1) ≤ |mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x| ∧ |mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x| ≤ (hs.prod * |u| * ((k+hs.length).factorial:ℝ)) / lo^(k+hs.length+1) := by have hx : 0 < x+c := lt_of_lt_of_le hlo hxlo have hsum : 0 ≤ hs.sum := List.sum_nonneg hhs have htop : 0 < x+c+hs.sum := by linarith have hprod : 0 ≤ hs.prod := List.prod_nonneg hhs have hn : 0 ≤ hs.prod * |u| * ((k+hs.length).factorial:ℝ) := by positivity obtain ⟨hl, hu⟩ := mixed_logarithmic_difference_abs_bounds hs u c k x hhs hx constructor · refine le_trans ?_ hl exact div_le_div_of_nonneg_left hn (by positivity) (pow_le_pow_left₀ (le_of_lt htop) hxhi _) · refine le_trans hu ?_ exact div_le_div_of_nonneg_left hn (by positivity) (pow_le_pow_left₀ (le_of_lt hlo) hxlo _) theorem mixed_logarithmic_difference_positive_bounds_on_box (hsign : 0 ≤ u * (-1:ℝ)^(k+hs.length)) : (hs.prod * |u| * ((k+hs.length).factorial:ℝ)) / hi^(k+hs.length+1) ≤ mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x ∧ mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x ≤ (hs.prod * |u| * ((k+hs.length).factorial:ℝ)) / lo^(k+hs.length+1) := by have hh := mixed_logarithmic_difference_abs_bounds_on_box hs u c k x lo hi hhs hlo hxlo hxhi rwa [abs_of_nonneg (mixed_logarithmic_difference_nonneg hs u c k x hhs (lt_of_lt_of_le hlo hxlo) hsign)] at hh theorem mixed_logarithmic_difference_negative_bounds_on_box (hsign : u * (-1:ℝ)^(k+hs.length) ≤ 0) : -((hs.prod * |u| * ((k+hs.length).factorial:ℝ)) / lo^(k+hs.length+1)) ≤ mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x ∧ mixedForwardDifference hs (logarithmicDerivativeChain u c (k+1)) x ≤ -((hs.prod * |u| * ((k+hs.length).factorial:ℝ)) / hi^(k+hs.length+1)) := by have hh := mixed_logarithmic_difference_abs_bounds_on_box hs u c k x lo hi hhs hlo hxlo hxhi rw [abs_of_nonpos (mixed_logarithmic_difference_nonpos hs u c k x hhs (lt_of_lt_of_le hlo hxlo) hsign)] at hh constructor <;> linarith [hh.1, hh.2] end end Bounty end section /- The derivative-order parameter yields an explicit fixed power saving. -/ namespace Bounty theorem derivative_order_scalar_power_saving (B C N ε : ℝ) (k : ℕ) (hN : 1 ≤ N) (hε : 0 < ε) (hk : 2 ≤ k) (hC : 4 ≤ C) (hpow : 2 ≤ N^(ε/(2*(k : ℝ)))) (hB : B ≤ C*N^(-(ε/4))) : vanDerCorputScalarBound (Nat.floor (N^(ε/(2*(k : ℝ)))) : ℝ) B (k-2) ≤ 5^(k-2)*C*N^(-((ε/(2*(k : ℝ)))/(2:ℝ)^(k-2))) := by have hkR : (2 : ℝ) ≤ k := by exact_mod_cast hk have hθ : 0 ≤ ε/(2*(k : ℝ)) := by positivity have hle : ε/(2*(k : ℝ)) ≤ ε/4 := div_le_div_of_nonneg_left hε.le (by norm_num) (by linarith) apply van_der_corput_floor_power_saving B C N (ε/(2*(k : ℝ))) (k-2) hN hθ hC hpow exact hB.trans (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le hN (neg_le_neg hle)) (by linarith)) end Bounty end section /- Exact conversion of shared normalization into independent harmonic draws. -/ open Finset namespace Bounty noncomputable def physicalSharedAux {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) : PhysicalAuxLabels P (fun g => univ \ C g) := fun g j => L g (Sum.inl j.val) theorem physical_state_mass_shared_split {G : Type*} [Fintype G] {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) : physicalStateMass V J ell = (∏ g, 1 / V g ^ (J - (C g).card)) * physicalCompletionMass V C ell := by classical rw [physicalStateMass, physicalCompletionMass, ← prod_mul_distrib] apply prod_congr rfl intro g _ have hc : (C g).card ≤ J := (card_le_card (subset_univ _)).trans_eq (by simp) rw [one_div_mul_one_div, ← pow_add] congr 2 omega section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) include G sharedInstance1 P J ell V C L theorem physical_shared_aux_mass : physicalAuxMass V (fun g => univ \ C g) (physicalSharedAux C L) = (∏ g, 1 / V g ^ (J - (C g).card)) / (physicalSharedFactor C L : ℝ) := by classical simp only [physicalAuxMass, physicalSharedAux, physicalLabelLaw, physicalSharedFactor, Nat.cast_prod, Fintype.prod_sigma, mul_inv, prod_mul_distrib, prod_const, Fintype.card_coe, card_sdiff_of_subset (subset_univ _), card_univ, Fintype.card_fin, div_eq_mul_inv, inv_pow, prod_inv_distrib, one_mul] theorem physical_shared_joint_normalization : physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) = physicalAuxMass V (fun g => univ \ C g) (physicalSharedAux C L) * physicalCompletionMass V C ell ^ 2 := by rw [physical_state_mass_shared_split V C, physical_shared_aux_mass] ring end theorem physical_shared_aux_eq_of_compatible {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) {L R : PhysicalMarkLists P J ell} (h : physicalSharedCompatible C L R) : physicalSharedAux C L = physicalSharedAux C R := by funext g j exact h g j.val (mem_sdiff.mp j.property).2 end Bounty end section /- The shared-draw exclusion error for a genuinely shared-independent coefficient. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Ordinary mean square on a dyad, normalized by its coefficient energy. -/ open Finset Set MeasureTheory Filter namespace Bounty theorem dyadic_polynomial_mean_square_le (s : Finset ℕ) (w : ℕ → ℂ) {U R V : ℝ} (hU : 1 ≤ U) (hR : 0 ≤ R) (hRU : R ≤ U) (hband : ∀ n ∈ s, U ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2 * U) (henergy : (∑ n ∈ s, ‖w n‖ ^ 2) ≤ V / U) : (∫ t in Set.Icc (-R) R, ‖∑ n ∈ s, w n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)‖ ^ 2) ≤ (72 * Real.pi * (1 + 2 * (1 + Real.log ⌈2 * U⌉₊)) + 1) * V := by have hU0 : 0 < U := zero_lt_one.trans_le hU have hN : (⌈2 * U⌉₊ : ℝ) ≤ 3 * U := by have hh := Nat.ceil_lt_add_one (by linarith : 0 ≤ 2 * U) linarith have hs : ∀ n ∈ s, 1 ≤ n ∧ n ≤ ⌈2 * U⌉₊ := by intro n hn constructor · exact_mod_cast hU.trans (hband n hn).1 · exact_mod_cast (hband n hn).2.trans (Nat.le_ceil (2 * U)) have hraw := dirichlet_polynomial_mean_square s w ⌈2 * U⌉₊ (-R) R (by linarith) hs rw [intervalIntegral.integral_of_le (by linarith : -R ≤ R), ← integral_Icc_eq_integral_Ioc] at hraw have hlog := Real.log_natCast_nonneg ⌈2 * U⌉₊ have hcoef : (R - -R) + 4 * (⌈2 * U⌉₊ : ℝ) * (1 + Real.log ⌈2 * U⌉₊) ≤ (2 + 12 * (1 + Real.log ⌈2 * U⌉₊)) * U := by have hh := mul_le_mul_of_nonneg_right hN (by linarith : 0 ≤ 1 + Real.log ⌈2 * U⌉₊) nlinarith have hpref : 2 + 12 * (1 + Real.log ⌈2 * U⌉₊) ≤ 72 * Real.pi * (1 + 2 * (1 + Real.log ⌈2 * U⌉₊)) + 1 := by have hpi := Real.pi_gt_three have hh := mul_nonneg (by linarith : 0 ≤ 144 * Real.pi - 12) hlog nlinarith have hV : 0 ≤ V := by have hh : 0 ≤ V / U := (Finset.sum_nonneg (fun _ _ => sq_nonneg _)).trans henergy simpa only [zero_mul] using (le_div_iff₀ hU0).mp hh calc _ ≤ ((R - -R) + 4 * (⌈2 * U⌉₊ : ℝ) * (1 + Real.log ⌈2 * U⌉₊)) * ∑ n ∈ s, ‖w n‖ ^ 2 := hraw _ ≤ ((2 + 12 * (1 + Real.log ⌈2 * U⌉₊)) * U) * (V / U) := mul_le_mul hcoef henergy (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) (by positivity) _ = (2 + 12 * (1 + Real.log ⌈2 * U⌉₊)) * V := by field_simp _ ≤ _ := mul_le_mul_of_nonneg_right hpref hV theorem eventually_dyadic_polynomial_mean_square_power {c C : ℝ} (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ) (w : ℕ → ℂ) (U R : ℝ), 1 ≤ U → 0 ≤ R → R ≤ U → Real.log U ≤ c * L → (∀ n ∈ s, U ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2 * U) → (∑ n ∈ s, ‖w n‖ ^ 2) ≤ L ^ C / U → (∫ t in Set.Icc (-R) R, ‖∑ n ∈ s, w n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)‖ ^ 2) ≤ L ^ (C + 2) := by filter_upwards [eventually_sparse_logarithmic_prefactor_le_square hc, eventually_gt_atTop (0 : ℝ)] with L hbudget hL intro s w U R hU hR hRU hlog hband henergy have hU0 : 0 < U := zero_lt_one.trans_le hU have hNpos : 0 < ⌈2 * U⌉₊ := Nat.ceil_pos.mpr (by linarith) have hNU : (⌈2 * U⌉₊ : ℝ) ≤ 4 * U := by have hh := Nat.ceil_lt_add_one (by linarith : 0 ≤ 2 * U) linarith have hpref := hbudget U ⌈2 * U⌉₊ hU0 hNpos hNU hlog calc _ ≤ (72 * Real.pi * (1 + 2 * (1 + Real.log ⌈2 * U⌉₊)) + 1) * L ^ C := dyadic_polynomial_mean_square_le s w hU hR hRU hband henergy _ ≤ L ^ (2 : ℕ) * L ^ C := mul_le_mul_of_nonneg_right hpref (Real.rpow_nonneg hL.le C) _ = L ^ (C + 2) := by rw [← Real.rpow_two, ← Real.rpow_add hL]; congr 1; ring end Bounty end section /- On a fixed residual gcd slice the rational phase separates in a finite four-factor box. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Fixed divisor losses in global Mellin bounds fit explicit powers of L. -/ open Filter Finset namespace Bounty end Bounty end section /- The actual long rough factor has a global constant bound at all frequencies. -/ open Finset Filter namespace Bounty theorem finite_dyadic_mellin_bounded_norm (S : Finset ℕ) (f : ℕ → ℂ) (u U B : ℝ) (hU : 1 ≤ U) (hB : 0 ≤ B) (hS : ∀ n ∈ S, U ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*U) (hf : ∀ n ∈ S, ‖f n‖ ≤ B) : ‖∑ n ∈ S, harmonicMellinWeight u n*f n‖ ≤ 2*B := by have hh := finite_dyadic_mellin_zeta_norm S f u U B 0 hU hB hS (by intro n hn have hnpos : 0 < n := by exact_mod_cast (zero_lt_one.trans_le hU).trans_le (hS n hn).1 simpa only [zero_add, pow_one, ArithmeticFunction.zeta_apply_ne hnpos.ne', Nat.cast_one, mul_one] using hf n hn) simpa only [pow_zero, mul_one] using hh theorem roughBand_mellin_global_norm (U A B W u : ℝ) (hU : 1 ≤ U) (hUA : U ≤ A) (hAB : A ≤ B) (hBU : B ≤ 2*U) (q : ℕ) (χ : DirichletCharacter ℂ q) : ‖∑ n ∈ roughBand A B W, harmonicMellinWeight u n*χ (n : ZMod q)‖ ≤ 2 := by have hA : 0 ≤ A := le_trans (by linarith) hUA have hB : 0 ≤ B := hA.trans hAB have hh := finite_dyadic_mellin_bounded_norm (roughBand A B W) (fun n => χ (n : ZMod q)) u U 1 hU zero_le_one (by intro n hn have hi := mem_Ioc.mp (mem_filter.mp hn).1 exact ⟨hUA.trans ((Nat.floor_lt hA).mp hi.1).le, ((Nat.le_floor_iff hB).mp hi.2).trans hBU⟩) (fun n _ => χ.norm_le_one (n : ZMod q)) simpa only [mul_one] using hh end Bounty end section /- Read the actual prime-comparison coordinates from the original unshared endpoint embedding. No values at shared slots are reconstructed or chosen. -/ open Finset Classical namespace Bounty noncomputable def physicalUnsharedCoordinate {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (u : GroupMarkedLists P (fun g => ell + (C g).card)) (g : G) (s : PhysicalSlots J ell) (hs : s ∈ physicalUnsharedSlots (C g)) : P g := u g ((physicalGroupUnsharedIndex (C g)).symm ⟨s, hs⟩) theorem physical_unshared_coordinate_embedding {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (g : G) (s : PhysicalSlots J ell) (hs : s ∈ physicalUnsharedSlots (C g)) : physicalUnsharedCoordinate C (physicalGroupUnsharedEmbedding C L) g s hs = L g s := by change L g ((physicalGroupUnsharedIndex (C g)) ((physicalGroupUnsharedIndex (C g)).symm ⟨s, hs⟩)).val = _ rw [Equiv.apply_symm_apply] theorem repeated_big_aux_union_unshared {G : Type*} [DecidableEq G] {J ell : ℕ} (A B : Finset (RepeatedBigFlatIndex G J ell)) (i : RepeatedBigFlatIndex G J ell) (hi : i ∈ A ∪ B) : i.2 ∈ physicalUnsharedSlots (repeatedBigAuxCut A B i.1) := by rw [physicalUnsharedSlots, mem_compl] intro hs obtain ⟨j, hj, he⟩ := (physical_mem_shared_slots_iff _ _).mp hs apply hj apply (mem_repeatedBigAuxCut A B i.1 j).mpr have hie : i = ⟨i.1, Sum.inl j⟩ := Sigma.ext rfl (heq_of_eq he) rwa [← hie] noncomputable def physicalPrimeUnsharedRestriction {G : Type*} [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (A B T : Finset (RepeatedBigFlatIndex G J ell)) (hT : T ⊆ A ∪ B) (u : GroupMarkedLists P (fun g => ell + (repeatedBigAuxCut A B g).card)) : ∀ i : T, P i.val.1 := fun i => physicalUnsharedCoordinate (repeatedBigAuxCut A B) u i.val.1 i.val.2 (repeated_big_aux_union_unshared A B i.val (hT i.property)) theorem physical_prime_unshared_restriction_embedding {G : Type*} [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (A B T : Finset (RepeatedBigFlatIndex G J ell)) (hT : T ⊆ A ∪ B) (L : PhysicalMarkLists P J ell) : physicalPrimeUnsharedRestriction A B T hT (physicalGroupUnsharedEmbedding (repeatedBigAuxCut A B) L) = finiteCoordinateRestrict T (repeatedBigFlatEquiv P J ell (fun g s => L g s)) := by funext i exact physical_unshared_coordinate_embedding (repeatedBigAuxCut A B) L i.val.1 i.val.2 _ end Bounty end section /- Freezing the small selected data gives an actual local coefficient on big source, target, and auxiliary labels, while preserving the full coefficient. -/ open scoped Classical namespace Bounty end Bounty end section /- Logarithmic marked-list lengths give a polynomial overlap factor, which is dominated by the lower endpoint of the prime pools. -/ open Filter namespace Bounty theorem four_pow_length_le_rpow {L A : ℝ} (hL : 0 < L) {J n : ℕ} (hJ : (J : ℝ) ≤ A * Real.log L) : (4 : ℝ) ^ (J * n) ≤ L ^ (A * n * Real.log 4) := by have h4 : 0 ≤ Real.log (4 : ℝ) := Real.log_nonneg (by norm_num) calc _ = Real.exp (((J : ℝ) * n) * Real.log 4) := by rw [← Nat.cast_mul, Real.exp_nat_mul, Real.exp_log (by norm_num)] _ ≤ Real.exp ((A * Real.log L * n) * Real.log 4) := by apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hJ (Nat.cast_nonneg n)) h4 _ = _ := by rw [Real.rpow_def_of_pos hL]; congr 1; ring theorem eventually_polynomial_div_exp_power {c : ℝ} (hc : 0 < c) (A a D : ℝ) : ∀ᶠ L : ℝ in atTop, A * L ^ a / Real.exp (L ^ c) ≤ L ^ (-D) := by filter_upwards [eventually_mul_rpow_le_exp_rpow (a+D) A hc, eventually_gt_atTop (0 : ℝ)] with L hbound hL rw [Real.rpow_neg hL.le, ← one_div] apply (le_div_iff₀ (Real.rpow_pos_of_pos hL D)).mpr rw [div_mul_eq_mul_div] apply (div_le_iff₀ (Real.exp_pos _)).mpr calc _ = A * L ^ (a+D) := by rw [Real.rpow_add hL]; ring _ ≤ _ := by simpa only [one_mul] using hbound end Bounty end section /- A relative square-error budget gives a linear error for harmonic pairings. -/ open Finset namespace Bounty theorem harmonic_replacement_error_envelope {E D ε : ℝ} (hE : 0 ≤ E) (hε : 0 ≤ ε) (hε1 : ε ≤ 1) (hD : D ≤ E*ε^2) : Real.sqrt D * Real.sqrt E + Real.sqrt (2*(E+D)) * Real.sqrt D ≤ 3*E*ε := by have hs : (Real.sqrt E)^2 = E := Real.sq_sqrt hE have hDE : D ≤ E := hD.trans (by have hsq : ε^2 ≤ (1 : ℝ)^2 := pow_le_pow_left₀ hε hε1 2 nlinarith [mul_le_mul_of_nonneg_left hsq hE]) have hd : Real.sqrt D ≤ Real.sqrt E*ε := (Real.sqrt_le_left (mul_nonneg (Real.sqrt_nonneg _) hε)).mpr (by nlinarith) have he : Real.sqrt (2*(E+D)) ≤ 2*Real.sqrt E := (Real.sqrt_le_left (by positivity)).mpr (by nlinarith) calc _ ≤ (Real.sqrt E*ε)*Real.sqrt E + (2*Real.sqrt E)*(Real.sqrt E*ε) := add_le_add (mul_le_mul_of_nonneg_right hd (Real.sqrt_nonneg _)) (mul_le_mul he hd (Real.sqrt_nonneg _) (by positivity)) _ = 3*(Real.sqrt E)^2*ε := by ring _ = _ := by rw [hs] end Bounty end section /- The original auxiliary draw measure gives a bilinear Fourier multiplier, without excluding repeated prime labels or changing the tuple spaces. -/ open Finset MeasureTheory open scoped Classical ComplexConjugate namespace Bounty noncomputable def physicalAuxFourierMultiplier {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) (x : ℝ) : ℂ := ∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * bA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * bB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 * fourier (-(k * (∏ g, ∏ j : repeatedBigAuxCut A B g, (aux g j).val : ℕ))) (x : AddCircle (1 : ℝ)) theorem physical_aux_fourier_split {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) (x : ℝ) : physicalAuxFourierMultiplier P V A B hU hAB k bA bB x = ∑ a : (∀ i : A, P i.val.1), ∑ b : (∀ i : B, P i.val.1), ((finiteProductWeight (fun i : A => physicalLabelLaw V i.val.1) a : ℂ) * bA a) * ((finiteProductWeight (fun i : B => physicalLabelLaw V i.val.1) b : ℂ) * bB b) * fourier (-(k * ((∏ i : A, (a i).val) * (∏ i : B, (b i).val) : ℕ))) (x : AddCircle (1 : ℝ)) := by unfold physicalAuxFourierMultiplier rw [repeated_big_aux_split_sum P A B hU hAB] apply sum_congr rfl intro a _ apply sum_congr rfl intro b _ rw [repeatedBigAuxSplitEquiv_symm_mass, repeatedBigAuxSplitEquiv_symm_label_prod] simp only [Equiv.apply_symm_apply, Complex.ofReal_mul] ring theorem physical_aux_averaged_shift_fourier {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) (S T : Finset ℤ) (f g : ℤ → ℂ) : (∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * bA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * bB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 * ∑ n ∈ S, let δ : ℤ := k * (∏ g, ∏ j : repeatedBigAuxCut A B g, (aux g j).val : ℕ) if n+δ ∈ T then conj (f n)*g (n+δ) else 0) = ∫ x in (0 : ℝ)..1, conj (finiteFourierSum S f x) * finiteFourierSum T g x * physicalAuxFourierMultiplier P V A B hU hAB k bA bB x := by exact finite_averaged_shift_fourier univ (fun aux => (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * bA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * bB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2) (fun aux => k * (∏ g, ∏ j : repeatedBigAuxCut A B g, (aux g j).val : ℕ)) S T f g end Bounty end section /- The actual major region is bounded by a finite sum of local Fourier energies on explicit rational-centered intervals. -/ open Finset MeasureTheory namespace Bounty theorem product_major_energy_cover (S : Finset ℤ) (f : ℤ → ℂ) {k : ℤ} {L q U V : ℝ} (hk : k ≠ 0) (hU : 0 < U) (hV : 0 < V) (hscale : L^q ≤ U*V) : let Q := ⌊L^q⌋₊ let N := Q*(k.natAbs+1) let w := L^q/(|(k : ℝ)| * (U*V)) (∫ x in productMajorArcSet k L q U V ∩ Set.Ioc 0 1, ‖finiteFourierSum S f x‖^2) ≤ ∑ r ∈ Icc 1 Q, ∑ u ∈ Icc (-(N : ℤ)) (N : ℤ), ∫ x in Set.Icc (-(u : ℝ)/((k : ℝ)*r)-w) (-(u : ℝ)/((k : ℝ)*r)+w), ‖finiteFourierSum S f x‖^2 := by classical dsimp only let s := (Icc 1 ⌊L^q⌋₊).product (Icc (-((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℤ)) ((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℤ)) let C (i : ℕ × ℤ) := Set.Icc (-(i.2 : ℝ)/((k : ℝ)*i.1)-L^q/(|(k : ℝ)| * (U*V))) (-(i.2 : ℝ)/((k : ℝ)*i.1)+L^q/(|(k : ℝ)| * (U*V))) have hc := (continuous_finiteFourierSum S f).norm.pow 2 have hb := finite_cover_integral_le volume s (productMajorArcSet k L q U V ∩ Set.Ioc 0 1) C (fun x => ‖finiteFourierSum S f x‖^2) ((product_major_arc_set_measurable k L q U V).inter measurableSet_Ioc) (fun _ _ => measurableSet_Icc) (fun _ => sq_nonneg _) (hc.integrableOn_Ioc.mono_set Set.inter_subset_right) (fun _ _ => hc.integrableOn_Icc) ?_ · apply hb.trans_eq exact Finset.sum_finset_product s (Icc 1 ⌊L^q⌋₊) (fun _ => Icc (-((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℤ)) ((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℤ)) (fun _ => mem_product) · intro x hx obtain ⟨r, u, hr, hu, hclose⟩ := product_major_arc_finite_cover hk hU hV hscale ⟨hx.2.1.le, hx.2.2⟩ hx.1 refine ⟨(r,u), mem_product.mpr ⟨hr,hu⟩, ?_⟩ dsimp only [C, Set.mem_Icc] have hh := abs_le.mp hclose constructor <;> linarith end Bounty end section /- On a fixed residual gcd slice the rational phase separates in a finite four-factor box. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Recombine every residual gcd slice with one frequency-independent coefficient family. -/ open Finset open scoped Classical namespace Bounty theorem sum_eq_sum_residual_gcd_slices {r : ℕ} (hr : 0 < r) (N : Finset ℕ) (F : ℕ → ℂ) : (∑ n ∈ N, F n) = ∑ d ∈ r.divisors, ∑ n ∈ N.filter (fun n => n.gcd r = d), F n := by exact (sum_fiberwise_of_maps_to (fun n _ => Nat.mem_divisors.mpr ⟨Nat.gcd_dvd_right n r, hr.ne'⟩) F).symm end Bounty end section /- The actual conjugated cell character times a Mellin phase has unit bound and remains in its original logarithmic cell. -/ open Finset open scoped Classical namespace Bounty theorem prime_cell_phased_conjugate_norm {I : Type*} [Fintype I] (P : I → Finset ℕ) (h : ℝ) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (ζ : ℝ) (x : ∀ i, P i) : ‖(starRingEnd ℂ) (primeProductCellCharacter P h d χ x) * physicalPhase ζ (∏ i, (x i).val)‖ ≤ 1 := by rw [norm_mul, Complex.norm_conj, physical_phase_norm, mul_one] exact prime_product_cell_character_norm P h d χ x theorem prime_cell_phased_conjugate_range {I : Type*} [Fintype I] (P : I → Finset ℕ) {h : ℝ} (hh : 0 < h) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (ζ : ℝ) (x : ∀ i, P i) (hpos : 0 < ∏ i, (x i).val) (hx : (starRingEnd ℂ) (primeProductCellCharacter P h d χ x) * physicalPhase ζ (∏ i, (x i).val) ≠ 0) : Real.exp (((d : ℝ)-1)*h) < (∏ i, (x i).val : ℕ) ∧ (∏ i, (x i).val : ℕ) ≤ Real.exp ((d : ℝ)*h) := by have hchar : primeProductCellCharacter P h d χ x ≠ 0 := by intro he exact hx (by rw [he, map_zero, zero_mul]) exact (upper_log_cell_nat_eq_iff hh hpos d).mp (prime_cell_character_mem P h d χ x hchar) end Bounty end section /- The finite retained-cell coefficient sum with its exact mass normalization. -/ open Finset open scoped Classical namespace Bounty theorem finite_retained_log_cells_card {X : Type*} [Fintype X] (μ z : X → ℝ) {h ξ L : ℝ} (hh : 0 < h) (hL : 0 ≤ L) (hz : ∀ x, 0 ≤ z x ∧ z x ≤ L) : ((finiteRetainedCells μ (fun x => upperLogCell h (z x)) ξ).card : ℝ) ≤ L/h+2 := by have hcard : (finiteRetainedCells μ (fun x => upperLogCell h (z x)) ξ).card ≤ (finiteOccupiedCells (fun x => upperLogCell h (z x))).card := card_filter_le _ _ have hr := upper_log_occupied_cells_card_real_le z hh hL hz exact (Nat.cast_le.mpr hcard).trans (by simpa only [sub_zero] using hr) theorem prime_retained_cell_expansion_cost {I : Type*} [Fintype I] [dI : DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (Q : ℕ) {h ξ L : ℝ} (hh : 0 < h) (hξ : 0 < ξ) (hL : 0 ≤ L) (hrange : ∀ x : (∀ i, P i), 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L) : (∑ d ∈ primeProductRetainedCells P V h ξ, ∑ _χ : BoundedPrimitiveCharacter Q, ‖((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell h (Real.log (∏ i, (z i).val : ℕ))) d : ℝ) : ℂ)‖) ≤ (L / h + 2) * (Q * Q : ℕ) / ξ := by cases Subsingleton.elim dI (Classical.typeDecidableEq I) have hc : ((primeProductRetainedCells P V h ξ).card : ℝ) ≤ L / h + 2 := finite_retained_log_cells_card (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z : (∀ i, P i) => Real.log (∏ i, (z i).val : ℕ)) hh hL hrange exact (prime_cell_expansion_cost P V Q h _ hξ (fun _ hd => prime_product_retained_cell_mass P V h ξ hd)).trans (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hc (Nat.cast_nonneg _)) hξ.le) end Bounty end section /- Harmonic summation of the extracted prime-character bound for the actual Q weight. -/ open Finset namespace Bounty theorem candidate_Q_character_bound_of_prime_bound (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) (S : Finset ℕ) {d : ℕ} (χ : DirichletCharacter ℂ d) (h : ℕ) (X H : ℝ) (hX : 0 ≤ X) (hH : 0 ≤ H) (hprime : ∀ y : ∀ slot, candidateQRestChoices c L r jStar hr slot, ‖∑ p ∈ ((candidateQBand (c*L) 0).filter (fun p => p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y ∈ S)).filter (fun p => p.Coprime h), χ (p : ZMod d)‖ ≤ (X / (orderedSlotProduct (candidateQRestChoices c L r jStar hr) y : ℝ)) * H) : ‖∑ n ∈ S.filter (fun n => n.Coprime h), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod d)‖ ≤ X * H * candidateQRestHarmonicMass c L r jStar hr := by classical let N : ℝ := (r.factorial : ℝ)^(candidateQIndices c L).card have hN : 0 < N := by dsimp only [N]; positivity have hn : ‖(1 / (N : ℂ))‖ = 1/N := by rw [norm_div, norm_one, Complex.norm_real, Real.norm_of_nonneg hN.le] have heq := candidate_Q_zero_character_window_split c L r jStar hr hj S χ h (fun _ => 1) simp only [mul_one] at heq rw [heq, ← Complex.ofReal_pow] change ‖(1 / (N : ℂ)) * _‖ ≤ _ rw [norm_mul, hn] calc _ ≤ (1/N) * ∑ y : ∀ slot, candidateQRestChoices c L r jStar hr slot, ‖if (orderedSlotProduct (candidateQRestChoices c L r jStar hr) y).Coprime h then χ (orderedSlotProduct (candidateQRestChoices c L r jStar hr) y : ZMod d) * ∑ p ∈ ((candidateQBand (c*L) 0).filter (fun p => p * orderedSlotProduct (candidateQRestChoices c L r jStar hr) y ∈ S)).filter (fun p => p.Coprime h), χ (p : ZMod d) else 0‖ := mul_le_mul_of_nonneg_left (norm_sum_le _ _) (by positivity) _ ≤ (1/N) * ∑ y : ∀ slot, candidateQRestChoices c L r jStar hr slot, (X / (orderedSlotProduct (candidateQRestChoices c L r jStar hr) y : ℝ)) * H := by apply mul_le_mul_of_nonneg_left _ (by positivity) apply sum_le_sum intro y _ split_ifs with hy · rw [norm_mul] exact (mul_le_of_le_one_left (norm_nonneg _) (χ.norm_le_one _)).trans (hprime y) · simp only [norm_zero] positivity _ = _ := by rw [candidate_Q_rest_harmonic_eq_tuple_sum, mul_sum, mul_sum] apply sum_congr rfl intro y _ dsimp only [N] ring end Bounty end section /- The full actual prime comparison block with structural vanishing and probe bounds discharged. -/ namespace Bounty open Finset open scoped Classical noncomputable def primeActivePhase {I : Type*} (P : I → Finset ℕ) (active : Finset I) (ζ Θ : ℝ) (x : ∀ i, P i) : ℂ := primeTuplePhase ζ Θ (∏ i ∈ active, (x i).val) theorem prime_active_phase_norm {I : Type*} (P : I → Finset ℕ) (active : Finset I) (ζ Θ : ℝ) (x : ∀ i, P i) : ‖primeActivePhase P active ζ Θ x‖ = 1 := prime_tuple_phase_norm ζ Θ _ theorem prime_asymmetric_grouped_block_bound {G : Type*} [Fintype G] [DecidableEq G] {I : G → Type*} [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)] (P : G → Finset ℕ) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hP : ∀ g p, p ∈ P g → 0 < p) (hmass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (probes tails : ∀ g, Finset (I g)) (hpt : ∀ g, Disjoint (probes g) (tails g)) (m ell : ℕ) (hm : 0 < m) (hp : ∀ g, (probes g).card = m) (ht : ∀ g, (tails g).card = ell) (s t : Finset G) (hst : Disjoint s t) (active : Finset (Sigma I)) (Q : ℕ) (h : ℝ) (keptA keptB : Finset (Sigma I) → Finset ℤ) (ζ Θ : ℝ) (f g : (∀ g, I g → P g) → ℂ) (hf : ∀ a, finiteGroupSlotSymmetric a f) (hg : ∀ a, finiteGroupSlotSymmetric a g) (ε : ℝ) (hε : 0 ≤ ε) (herr : ∀ S ∈ (s.sigma probes).powerset, ∀ T ∈ (t.sigma probes).powerset, ∀ A ∈ cleanNonemptySubsets (s.sigma probes \ S), ∀ B ∈ cleanNonemptySubsets (t.sigma probes \ T), ‖cleanKernelPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeAsymmetricComparisonKernel (fun a : Sigma I => P a.1) (fun a => V a.1) active Q h keptA keptB ζ Θ A B) (finiteCoordinateComponent (fun a : Sigma I => physicalLabelLaw V a.1) S (s.sigma probes).toList (finiteGroupedTailTest (physicalLabelLaw V) tails f)) (finiteCoordinateComponent (fun a : Sigma I => physicalLabelLaw V a.1) T (t.sigma probes).toList (finiteGroupedTailTest (physicalLabelLaw V) tails g)) - cleanRawPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeActivePhase (fun a : Sigma I => P a.1) active ζ Θ) (finiteCoordinateComponent (fun a : Sigma I => physicalLabelLaw V a.1) S (s.sigma probes).toList (finiteGroupedTailTest (physicalLabelLaw V) tails f)) (finiteCoordinateComponent (fun a : Sigma I => physicalLabelLaw V a.1) T (t.sigma probes).toList (finiteGroupedTailTest (physicalLabelLaw V) tails g))‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (finiteCoordinateComponent (fun a : Sigma I => physicalLabelLaw V a.1) S (s.sigma probes).toList (finiteGroupedTailTest (physicalLabelLaw V) tails f))) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (finiteCoordinateComponent (fun a : Sigma I => physicalLabelLaw V a.1) T (t.sigma probes).toList (finiteGroupedTailTest (physicalLabelLaw V) tails g)))) : ‖cleanRawPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeActivePhase (fun a : Sigma I => P a.1) active ζ Θ) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g) - ∑ A ∈ cleanNonemptySubsets (s.sigma probes), ∑ B ∈ cleanNonemptySubsets (t.sigma probes), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeAsymmetricComparisonKernel (fun a : Sigma I => P a.1) (fun a => V a.1) active Q h keptA keptB ζ Θ A B) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g)‖ ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ s.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((s.sigma probes).card + (t.sigma probes).card) * ε) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) g) := by have hμ : ∀ g (x : P g), 0 ≤ physicalLabelLaw V g x := physical_label_law_nonneg V (fun g => (hV g).le) have hmμ : ∀ g, ∑ x : P g, physicalLabelLaw V g x = 1 := fun g => physical_label_law_sum V g (hV g) (hmass g) have hnμ : ∀ g (x : P g), physicalLabelLaw V g x ≠ 0 := by intro g x unfold physicalLabelLaw apply div_ne_zero one_ne_zero exact mul_ne_zero (hV g).ne' (by exact_mod_cast (hP g x.val x.property).ne') let rootInlineArg0 := physicalLabelLaw (P := P) V let rootInlineArg1 := hmμ let rootInlineArg2 := hnμ let rootInlineArg3 := primeActivePhase (fun a : Sigma I => P a.1) active ζ Θ let rootInlineArg4 := fun x => (prime_active_phase_norm (fun a : Sigma I => P a.1) active ζ Θ x).le let rootInlineArg5 := fun A B => primeAsymmetricValue (fun a : Sigma I => P a.1) (fun a => V a.1) (active \ (A ∪ B)) A B Q h (keptA A) (keptB B) ζ Θ let μ := rootInlineArg0 let hmass := rootInlineArg1 let hμnz := rootInlineArg2 let k := rootInlineArg3 let hk := rootInlineArg4 let F := rootInlineArg5 have hUV : Disjoint (s.sigma probes) (t.sigma probes) := by apply disjoint_left.mpr intro a ha hb exact disjoint_left.mp hst (mem_sigma.mp ha).1 (mem_sigma.mp hb).1 exact finite_asymmetric_signed_block_envelope (fun a : Sigma I => μ a.1) (fun a x => hμ a.1 x) (fun a => hmass a.1) active (s.sigma probes) (t.sigma probes) hUV (fun a x => hμnz a.1 x) k hk F (finiteGroupedTailTest μ tails f) (finiteGroupedTailTest μ tails g) _ _ _ _ (finite_flatten_tail_norm_le μ hμ hmass tails f) (finite_flatten_tail_norm_le μ hμ hmass tails g) (finite_flatten_probe_tail_norm μ hμ hmass probes tails hpt m ell hm hp ht s f hf) (finite_flatten_probe_tail_norm μ hμ hmass probes tails hpt m ell hm hp ht t g hg) ε hε herr end Bounty end section /- The globally defined physical row family inherits the full-state energy bound with the exact endpoint phase, original weights and total cutoffs. -/ namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Physical end Bounty end section /- At each physical visit, the full continuation passes through the raw ghost row exactly, with the existing full ledger/memory target. The chosen physical slot enumeration may be any current pattern. -/ namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_full_global_ghost_row (j : I) (D : Fin N → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (a : (g : Fin N) → ↥(P g) → Bool) (hV : ∀ g, V g ≠ 0) (F : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) : globalBirthJointCutRawRow (fun g => GlobalBirthRawStep.visit (a := a g) (fun _ => 0) (β g) (1 - retention j) (V g) ρ (hV g) B) B B (physicalFullContinuation D L F) (fun g => (H g, boundedOrderedTupleToFinite (q g))) = physicalFullLedgerRow C k ω β retention ρ V (some (.inl j)) F (H, physicalFullMemoryState D L q) := by exact full_mixed_raw_ghost_continuation (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) (fun j H x e => physicalFullGlobalEdgePhase (C j) (k j) H (ω j) (fun g p => β g p / V g) ρ V x e) ω β retention ρ V a hV j F (H, physicalFullMemoryState D L q) end Physical end Bounty end section /- The actual bounded physical state keeps its ordered mark list, birth ledger and pending memory. Its full-state encoding is allowed to vary at successive cuts of a physical schedule. -/ open scoped Classical namespace Bounty abbrev PhysicalBoundedMarkState {N : ℕ} (P : Fin N → Finset ℕ) (J ell B : ℕ) := PhysicalMarkLists P J ell × ((g : Fin N) → Finset ↥(P g)) × ((g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) noncomputable def physicalBoundedMarkEncode {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (s : PhysicalBoundedMarkState P J ell B) : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B := (s.2.1, physicalFullMemoryState C s.1 s.2.2) noncomputable def physicalMarkRawExtension {N J ell B : ℕ} {P : Fin N → Finset ℕ} (F : PhysicalBoundedMarkState P J ell B → ℂ) (R : PhysicalMarkLists P J ell) (s : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) : ℂ := if h : ∀ g, (s g).2.1 ≤ B then F (R, (fun g => (s g).1), fun g => ⟨⟨(s g).2.1, Nat.lt_succ_of_le (h g)⟩, (s g).2.2⟩) else 0 end Bounty end section /- The support of a small-cap full active edge is exactly the support of the large-cap edge whose target still satisfies the small total cap. -/ open Finset Classical namespace Bounty section variable {G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) {b B : ℕ} (h : b ≤ B) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b) [Fintype G] (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) theorem fullActiveEdgeEvent_cap_support_iff (hs : productTotalMemory s ≤ b) (e : FullActiveEdgeEvent n S b A Δ D s) : fullActiveEdgeEventWeight n S b A Δ D ω μ ρ V s e ≠ 0 ↔ fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V (productStateCapEmbed h s) (fullActiveEdgeEventCapEquiv n S A Δ D h s e) ≠ 0 ∧ productTotalMemory (fullActiveEdgeEventTarget n S B A Δ D (productStateCapEmbed h s) (fullActiveEdgeEventCapEquiv n S A Δ D h s e)) ≤ b := by rw [fullActiveEdgeEventWeight_cap n S A Δ D h s ω μ ρ V hs e] split_ifs <;> simp_all theorem fullActiveEdgeEventWeight_cap_of_ne_zero (e : FullActiveEdgeEvent n S b A Δ D s) (hw : fullActiveEdgeEventWeight n S b A Δ D ω μ ρ V s e ≠ 0) : fullActiveEdgeEventWeight n S b A Δ D ω μ ρ V s e = fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V (productStateCapEmbed h s) (fullActiveEdgeEventCapEquiv n S A Δ D h s e) := by have hs : productTotalMemory s ≤ b := by by_contra hs apply hw rw [fullActiveEdgeEventWeight_full_caps] simp only [hs, false_and, if_false] rw [fullActiveEdgeEventWeight_cap n S A Δ D h s ω μ ρ V hs e] exact if_pos ((fullActiveEdgeEvent_cap_support_iff n S A Δ D h s ω μ ρ V hs e).mp hw).2 end end Bounty end section /- Exact supported-event transport for permutations, signed ghost visits, and varying full active edges. The initial total memory stays below the smaller cap, and the image consists exactly of supported events staying there. -/ open Finset Classical namespace Bounty universe uJ uK uG uP uA section variable {J : Type uJ} {K : Type uK} {G : Type uG} {P : G → Type uP} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) (Δ D : ∀ k c, A k c → G → ℤ) {b B : ℕ} (h : b ≤ B) def fullPermutationMixedEventCapEmbed (k : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b) : FullPermutationMixedEvent n S b A Δ D k s → FullPermutationMixedEvent n S B A Δ D k (productStateCapEmbed h s) := match k with | none => id | some (.inl _) => fun e => ⟨coupledGhostEventCapEmbed h s e.down⟩ | some (.inr j) => fullActiveEdgeEventCapEquiv n (S j) (A j) (Δ j) (D j) h s variable [Fintype G] [DecidableEq G] (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end end Bounty end section /- Transport to paths staying below a height cap. The transported phase retains its norm bound, and the complementary high-maximum action is exactly the difference between the full action and its capped part. -/ open Finset Classical namespace Bounty universe uK uX uY uE uF noncomputable def finiteSafePathPhase {K : Type uK} {X : Type uX} {Y : Type uY} (E : K → X → Type uE) (F : K → Y → Type uF) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (w : ∀ k x, E k x → ℝ) (v : ∀ k y, F k y → ℝ) (height : Y → ℕ) (b : ℕ) (e : X → Y) (P : X → Prop) (closed : ∀ k x, P x → ∀ a : FiniteNonzeroEvent E w k x, P (t k x a.val)) (δ : ∀ k x, P x → FiniteNonzeroEvent E w k x ≃ FiniteSelectedEvent F (finiteSafeEventPredicate F u v height b) k (e x)) (ht : ∀ k x (hx : P x) a, e (t k x a.val) = u k (e x) (δ k x hx a).val) (ks : List K) (phase : ∀ y, FiniteEventPath F u ks y → ℂ) : ∀ x, FiniteEventPath E t ks x → ℂ := finiteSupportedPathPhase E F t u w (finiteSafeEventPredicate F u v height b) e P closed δ ht ks phase theorem finite_safe_path_action_transport {K : Type uK} {X : Type uX} {Y : Type uY} (E : K → X → Type uE) (F : K → Y → Type uF) [∀ k x, Fintype (E k x)] [∀ k y, Fintype (F k y)] (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (w : ∀ k x, E k x → ℝ) (v : ∀ k y, F k y → ℝ) (height : Y → ℕ) (b : ℕ) (e : X → Y) (P : X → Prop) (closed : ∀ k x, P x → ∀ a : FiniteNonzeroEvent E w k x, P (t k x a.val)) (δ : ∀ k x, P x → FiniteNonzeroEvent E w k x ≃ FiniteSelectedEvent F (finiteSafeEventPredicate F u v height b) k (e x)) (ht : ∀ k x (hx : P x) a, e (t k x a.val) = u k (e x) (δ k x hx a).val) (hw : ∀ k x (hx : P x) a, v k (e x) (δ k x hx a).val = w k x a.val) (ks : List K) (phase : ∀ y, FiniteEventPath F u ks y → ℂ) (f : Y → ℂ) (x : X) (hx : P x) (hheight : height (e x) ≤ b) : finiteEventPathAction E t w ks (finiteSafePathPhase E F t u w v height b e P closed δ ht ks phase) (fun x => f (e x)) x = finiteEventPathAction F u v ks (fun y p => if finiteEventPathMaximum F u height ks y p ≤ b then phase y p else 0) f (e x) := by let Q := finiteSafeEventPredicate F u v height b let _ : ∀ k y, Fintype (FiniteSelectedEvent F Q k y) := finiteSelectedEventFintype F Q exact (finite_supported_path_action_transport E F t u w v Q e P closed δ ht hw ks phase f x hx).trans ((finite_event_path_action_selected F u Q v ks phase f (e x)).trans (finite_event_path_action_safe F u v height b ks phase f (e x) hheight).symm) theorem finite_event_path_action_sub_safe {K : Type uK} {X : Type uX} (E : K → X → Type uE) [∀ k x, Fintype (E k x)] (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (height : X → ℕ) (b : ℕ) (ks : List K) (phase : ∀ x, FiniteEventPath E t ks x → ℂ) (f : X → ℂ) (x : X) : finiteEventPathAction E t w ks phase f x - finiteEventPathAction E t w ks (fun x p => if finiteEventPathMaximum E t height ks x p ≤ b then phase x p else 0) f x = finiteEventPathAction E t w ks (fun x p => if b < finiteEventPathMaximum E t height ks x p then phase x p else 0) f x := by unfold finiteEventPathAction rw [← sum_sub_distrib] apply sum_congr rfl intro p _ by_cases hp : finiteEventPathMaximum E t height ks x p ≤ b · simp only [if_pos hp, if_neg (not_lt.mpr hp), mul_zero, zero_mul, sub_self] · simp only [if_neg hp, if_pos (Nat.lt_of_not_ge hp), mul_zero, zero_mul, sub_zero] end Bounty end section /- Bilinear large-sieve bounds retaining a two-sided hyperbolic product window. -/ open Finset namespace Bounty theorem dyadic_product_prefix_filter (K X m : ℕ) (hm : 0 < m) (T : Finset ℕ) (hT : T ⊆ range (2 ^ K)) : (range (min (2 ^ K) (X / m + 1))).filter (fun n => n ∈ T) = T.filter (fun n => m * n ≤ X) := by ext n simp only [mem_filter, mem_range, lt_min_iff, Nat.lt_succ_iff] constructor · rintro ⟨⟨_, hn⟩, hnT⟩ refine ⟨hnT, ?_⟩ simpa only [Nat.mul_comm] using (Nat.le_div_iff_mul_le hm).mp hn · rintro ⟨hnT, hprod⟩ refine ⟨⟨mem_range.mp (hT hnT), ?_⟩, hnT⟩ exact (Nat.le_div_iff_mul_le hm).mpr (by simpa only [Nat.mul_comm] using hprod) theorem multiplicative_large_sieve_product_upper (Q : Finset ℕ) {D R N V : ℝ} (hD : 0 < D) (hR : 1 ≤ R) (hQD : ∀ q ∈ Q, D ≤ (q : ℝ)) (hQR : ∀ q ∈ Q, (q : ℝ) ≤ R) (K X : ℕ) (S T : Finset ℕ) (hSpos : ∀ m ∈ S, 0 < m) (hT : T ⊆ range (2 ^ K)) (a b : ℕ → ℂ) (hN : 0 ≤ N) (hV : 0 ≤ V) (hS : ∀ m ∈ S, (m : ℝ) ≤ N) (hcol : ∀ n ∈ range (2 ^ K), (n : ℝ) ≤ V) : (∑ q ∈ Q, 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖∑ m ∈ S, ∑ n ∈ T.filter (fun n => m * n ≤ X), a m * b n * χ ((m * n : ℕ) : ZMod q)‖) ≤ (K + 1 : ℝ) * ((6 + 8 * Real.pi) / D) * Real.sqrt ((N + R ^ 2) * (V + R ^ 2) * (∑ m ∈ S, ‖a m‖ ^ 2) * ∑ n ∈ T, ‖b n‖ ^ 2) := by classical let κ : ℕ → ℕ := fun m => min (2 ^ K) (X / m + 1) let b' : ℕ → ℂ := fun n => if n ∈ T then b n else 0 have henergy : (∑ n ∈ range (2 ^ K), ‖b' n‖ ^ 2) = ∑ n ∈ T, ‖b n‖ ^ 2 := by calc _ = ∑ n ∈ T, ‖b' n‖ ^ 2 := by symm apply sum_subset hT intro n hn hnT simp [b', hnT] _ = _ := sum_congr rfl (fun n hn => by simp [b', hn]) have hrow (q : ℕ) (χ : DirichletCharacter ℂ q) (m : ℕ) (hm : m ∈ S) : (∑ n ∈ range (κ m), a m * b' n * χ ((m * n : ℕ) : ZMod q)) = ∑ n ∈ T.filter (fun n => m * n ≤ X), a m * b n * χ ((m * n : ℕ) : ZMod q) := by simp only [b', mul_ite, ite_mul, mul_zero, zero_mul] rw [← sum_filter] rw [dyadic_product_prefix_filter K X m (hSpos m hm) T hT] have h := multiplicative_large_sieve_dyadic_prefix Q hD hR hQD hQR K S κ (fun m _ => min_le_left _ _) a b' hN hV hS hcol rw [henergy] at h convert h using 1 apply sum_congr rfl intro q hq congr 1 apply sum_congr rfl intro χ hχ congr 1 symm exact sum_congr rfl (hrow q χ) theorem sum_product_window_eq_sub {E : Type*} [AddCommGroup E] (A B : ℕ) (hAB : A ≤ B) (T : Finset ℕ) (m : ℕ) (w : ℕ → E) : (∑ n ∈ T.filter (fun n => A < m * n ∧ m * n ≤ B), w n) = (∑ n ∈ T.filter (fun n => m * n ≤ B), w n) - ∑ n ∈ T.filter (fun n => m * n ≤ A), w n := by have hset : T.filter (fun n => A < m * n ∧ m * n ≤ B) = T.filter (fun n => m * n ≤ B) \ T.filter (fun n => m * n ≤ A) := by ext n simp only [mem_filter, mem_sdiff] constructor · rintro ⟨hnT, hnA, hnB⟩ exact ⟨⟨hnT, hnB⟩, fun h => (not_le_of_gt hnA) h.2⟩ · rintro ⟨⟨hnT, hnB⟩, hnA⟩ exact ⟨hnT, Nat.lt_of_not_ge (fun h => hnA ⟨hnT, h⟩), hnB⟩ rw [hset, sum_sdiff_eq_sub] intro n hn obtain ⟨hnT, hnA⟩ := mem_filter.mp hn exact mem_filter.mpr ⟨hnT, hnA.trans hAB⟩ theorem multiplicative_large_sieve_product_window (Q : Finset ℕ) {D R N V : ℝ} (hD : 0 < D) (hR : 1 ≤ R) (hQD : ∀ q ∈ Q, D ≤ (q : ℝ)) (hQR : ∀ q ∈ Q, (q : ℝ) ≤ R) (K A B : ℕ) (S T : Finset ℕ) (hSpos : ∀ m ∈ S, 0 < m) (hT : T ⊆ range (2 ^ K)) (a b : ℕ → ℂ) (hN : 0 ≤ N) (hV : 0 ≤ V) (hS : ∀ m ∈ S, (m : ℝ) ≤ N) (hcol : ∀ n ∈ range (2 ^ K), (n : ℝ) ≤ V) : (∑ q ∈ Q, 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖∑ m ∈ S, ∑ n ∈ T.filter (fun n => A < m * n ∧ m * n ≤ B), a m * b n * χ ((m * n : ℕ) : ZMod q)‖) ≤ 2 * (K + 1 : ℝ) * ((6 + 8 * Real.pi) / D) * Real.sqrt ((N + R ^ 2) * (V + R ^ 2) * (∑ m ∈ S, ‖a m‖ ^ 2) * ∑ n ∈ T, ‖b n‖ ^ 2) := by by_cases hAB : A ≤ B · have hdiff (q : ℕ) (χ : DirichletCharacter ℂ q) : (∑ m ∈ S, ∑ n ∈ T.filter (fun n => A < m * n ∧ m * n ≤ B), a m * b n * χ ((m * n : ℕ) : ZMod q)) = (∑ m ∈ S, ∑ n ∈ T.filter (fun n => m * n ≤ B), a m * b n * χ ((m * n : ℕ) : ZMod q)) - (∑ m ∈ S, ∑ n ∈ T.filter (fun n => m * n ≤ A), a m * b n * χ ((m * n : ℕ) : ZMod q)) := by rw [← sum_sub_distrib] apply sum_congr rfl intro m hm exact sum_product_window_eq_sub A B hAB T m _ have htri : (∑ q ∈ Q, 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖∑ m ∈ S, ∑ n ∈ T.filter (fun n => A < m * n ∧ m * n ≤ B), a m * b n * χ ((m * n : ℕ) : ZMod q)‖) ≤ (∑ q ∈ Q, 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖∑ m ∈ S, ∑ n ∈ T.filter (fun n => m * n ≤ B), a m * b n * χ ((m * n : ℕ) : ZMod q)‖) + (∑ q ∈ Q, 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖∑ m ∈ S, ∑ n ∈ T.filter (fun n => m * n ≤ A), a m * b n * χ ((m * n : ℕ) : ZMod q)‖) := by rw [← sum_add_distrib] apply sum_le_sum intro q hq rw [← mul_add, ← sum_add_distrib] apply mul_le_mul_of_nonneg_left _ (by positivity) apply sum_le_sum intro χ hχ rw [hdiff] exact norm_sub_le _ _ have hB := multiplicative_large_sieve_product_upper Q hD hR hQD hQR K B S T hSpos hT a b hN hV hS hcol have hA := multiplicative_large_sieve_product_upper Q hD hR hQD hQR K A S T hSpos hT a b hN hV hS hcol have h := htri.trans (add_le_add hB hA) nlinarith only [h] · have hempty (m : ℕ) : T.filter (fun n => A < m * n ∧ m * n ≤ B) = ∅ := by apply filter_eq_empty_iff.mpr intro n hn omega simp only [hempty, sum_empty, sum_const_zero, norm_zero, mul_zero] positivity theorem multiplicative_large_sieve_product_window_real (Q : Finset ℕ) {D R N V A B : ℝ} (hD : 0 < D) (hR : 1 ≤ R) (hQD : ∀ q ∈ Q, D ≤ (q : ℝ)) (hQR : ∀ q ∈ Q, (q : ℝ) ≤ R) (hA : 0 ≤ A) (hB : 0 ≤ B) (K : ℕ) (S T : Finset ℕ) (hSpos : ∀ m ∈ S, 0 < m) (hT : T ⊆ range (2 ^ K)) (a b : ℕ → ℂ) (hN : 0 ≤ N) (hV : 0 ≤ V) (hS : ∀ m ∈ S, (m : ℝ) ≤ N) (hcol : ∀ n ∈ range (2 ^ K), (n : ℝ) ≤ V) : (∑ q ∈ Q, 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖∑ m ∈ S, ∑ n ∈ T.filter (fun n : ℕ => A < (m : ℝ) * (n : ℝ) ∧ (m : ℝ) * (n : ℝ) ≤ B), a m * b n * χ ((m * n : ℕ) : ZMod q)‖) ≤ 2 * (K + 1 : ℝ) * ((6 + 8 * Real.pi) / D) * Real.sqrt ((N + R ^ 2) * (V + R ^ 2) * (∑ m ∈ S, ‖a m‖ ^ 2) * ∑ n ∈ T, ‖b n‖ ^ 2) := by have h := multiplicative_large_sieve_product_window Q hD hR hQD hQR K ⌊A⌋₊ ⌊B⌋₊ S T hSpos hT a b hN hV hS hcol simpa only [Nat.floor_lt hA, Nat.le_floor_iff hB, Nat.cast_mul] using h end Bounty end section /- The physical edge with every target list and auxiliary draw is one unified full-state row. Its globally extended phase is bounded everywhere. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def physicalFullObservedRow (before after : Fin N → Finset (Fin J)) : Option (I ⊕ K) → (PhysicalMarkObservation P ell C → FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) → FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ := fullMixedObservedRow (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) (fun j H x e => physicalFullGlobalEdgePhase (C j) (k j) H (ω j) (fun g p => β g p / V g) ρ V x e) ω (fun g p => β g p / V g) retention ρ V (physicalFullEventObservation C k before after) end Physical end Bounty end section /- Finite dyadic assembly for primitive character norms and complementary moduli. -/ open Finset namespace Bounty theorem primitiveCharacterBlockNorm_dyadic_moduli (Q : Finset ℕ) (V : (q : ℕ) → DirichletCharacter ℂ q → ℂ) : primitiveCharacterBlockNorm Q V = ∑ k ∈ dyadicNatIndices Q, primitiveCharacterBlockNorm (dyadicNatBucket Q k) V := by exact (sum_dyadicNatBuckets Q (fun q => 1 / (q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖V q χ‖)).symm theorem primitiveCharacterBlockNorm_le_dyadic_blocks (Q S T : Finset ℕ) (F : ℕ → ℕ → (q : ℕ) → DirichletCharacter ℂ q → ℂ) {B : ℝ} (hblock : ∀ k ∈ dyadicNatIndices Q, ∀ i ∈ dyadicNatIndices S, ∀ j ∈ dyadicNatIndices T, primitiveCharacterBlockNorm (dyadicNatBucket Q k) (∑ m ∈ dyadicNatBucket S i, ∑ n ∈ dyadicNatBucket T j, F m n) ≤ B) : primitiveCharacterBlockNorm Q (∑ m ∈ S, ∑ n ∈ T, F m n) ≤ ((dyadicNatIndices Q).card : ℝ) * (dyadicNatIndices S).card * (dyadicNatIndices T).card * B := by rw [primitiveCharacterBlockNorm_dyadic_moduli] calc _ ≤ ∑ k ∈ dyadicNatIndices Q, ∑ i ∈ dyadicNatIndices S, ∑ j ∈ dyadicNatIndices T, B := by apply sum_le_sum intro k hk rw [← sum_dyadicNatBuckets_bilinear S T F] apply (subadditive_finset_sum_le _ (primitiveCharacterBlockNorm_zero _) (primitiveCharacterBlockNorm_add_le _) _ _).trans apply sum_le_sum intro i hi apply (subadditive_finset_sum_le _ (primitiveCharacterBlockNorm_zero _) (primitiveCharacterBlockNorm_add_le _) _ _).trans exact sum_le_sum (fun j hj => hblock k hk i hi j hj) _ = _ := by simp only [sum_const, nsmul_eq_mul]; ring theorem complementary_conductor_sum_le_character_blockNorm {Ω : Type*} (Q : Finset ℕ) (h : ℕ) (T : Finset Ω) (μ : Ω → ℂ) (value : Ω → ℕ) (V : (q : ℕ) → DirichletCharacter ℂ q → ℂ) (hV : ∀ f ∈ Q, ∀ χ : DirichletCharacter ℂ f, (∑ t ∈ T.filter (fun t => (value t).Coprime h), μ t * χ (value t : ZMod f)) = V f χ) : (∑ f ∈ Q, complementaryConductorNormTerm f h T μ value / (f.totient : ℝ)) ≤ primitiveCharacterBlockNorm Q V := by classical unfold primitiveCharacterBlockNorm apply sum_le_sum intro f hf rw [div_eq_mul_inv, mul_comm, one_div] apply mul_le_mul_of_nonneg_left _ (by positivity) unfold complementaryConductorNormTerm calc _ = ∑ χ ∈ (univ : Finset (DirichletCharacter ℂ f)).filter (fun χ => χ.IsPrimitive ∧ χ ≠ 1), ‖V f χ‖ := by apply sum_congr rfl intro χ hχ rw [hV f hf χ] _ ≤ ∑ χ ∈ primitiveCharacters f, ‖V f χ‖ := by apply sum_le_sum_of_subset_of_nonneg _ (fun χ _ _ => norm_nonneg _) intro χ hχ exact mem_filter.mpr ⟨mem_univ _, (mem_filter.mp hχ).2.1⟩ theorem candidate_large_mass_le_uniform_complementary (c L q : ℝ) (r jStar N R : ℕ) {X Y : ℝ} (hX : 1 ≤ X) (hNX : (N : ℝ) ≤ X) (hY : 0 ≤ Y) (hbound : ∀ h ∈ (Icc 1 N).filter Squarefree, (∑ f ∈ Icc (max 2 (R + 1)) (N / h), complementaryConductorNormTerm f h (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u) / (f.totient : ℝ)) ≤ Y) : candidateLargePrimitiveTypeIMass c L q r jStar N R ≤ ((2 * primeEulerProductUpperConstant) * Real.log (2 * X)) * Y := by apply (candidate_large_primitive_mass_le_complementary c L q r jStar N R).trans calc _ ≤ ∑ h ∈ (Icc 1 N).filter Squarefree, (1 / (h.totient : ℝ)) * Y := by apply sum_le_sum intro h hh exact mul_le_mul_of_nonneg_left (hbound h hh) (by positivity) _ = (∑ h ∈ (Icc 1 N).filter Squarefree, 1 / (h.totient : ℝ)) * Y := (sum_mul ..).symm _ ≤ _ := mul_le_mul_of_nonneg_right (totient_sieve_squarefree_mass_le_log N hX hNX) hY end Bounty end section /- Admissible actual components satisfy the shared-slice comparison estimate. -/ namespace Bounty open Finset open scoped Classical theorem finite_admissible_component_slice_error_le {I : Type*} [Fintype I] [DecidableEq I] {X : I → Type*} [∀ i, Fintype (X i)] (μ : ∀ i, X i → ℝ) (hμ : ∀ i x, 0 ≤ μ i x) (hmass : ∀ i, ∑ x, μ i x = 1) (active U V S T A B : Finset I) (hU : U ⊆ active) (hV : V ⊆ active) (hUV : Disjoint U V) (hA : A ⊆ U \ S) (hB : B ⊆ V \ T) (KA : (∀ i : A, X i.1) → (∀ i : A, X i.1) → ℂ) (KB : (∀ i : B, X i.1) → (∀ i : B, X i.1) → ℂ) (phase : (∀ i : ↥(active \ (A ∪ B)), X i.1) → (∀ i : A, X i.1) → (∀ i : B, X i.1) → ℂ) (f g : (∀ i, X i) → ℂ) (ε : ℝ) (hε : 0 ≤ ε) (hfree : ∀ c, ∀ (u : (∀ i : A, X i.1) → ℂ) (v : (∀ i : B, X i.1) → ℂ), ‖finiteTwoKernelPairingError (finiteProductWeight (fun i : A => μ i.1)) (finiteProductWeight (fun i : B => μ i.1)) KA KB (phase c) u v‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun i : A => μ i.1)) u) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun i : B => μ i.1)) v)) : ‖cleanRawPairing (finiteProductWeight μ) (fun x => phase (finiteCoordinateRestrict (active \ (A ∪ B)) x) (finiteCoordinateRestrict A x) (finiteCoordinateRestrict B x)) (finiteCoordinateComponent μ S U.toList (finiteCoordinateComponent μ ∅ activeᶜ.toList f)) (finiteCoordinateComponent μ T V.toList (finiteCoordinateComponent μ ∅ activeᶜ.toList g)) - cleanKernelPairing (finiteProductWeight μ) (finiteAsymmetricKernel μ (active \ (A ∪ B)) A B (fun c a b => finiteTwoKernelAverage (finiteProductWeight (fun i : A => μ i.1)) (finiteProductWeight (fun i : B => μ i.1)) KA KB a b (phase c))) (finiteCoordinateComponent μ S U.toList (finiteCoordinateComponent μ ∅ activeᶜ.toList f)) (finiteCoordinateComponent μ T V.toList (finiteCoordinateComponent μ ∅ activeᶜ.toList g))‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ S U.toList (finiteCoordinateComponent μ ∅ activeᶜ.toList f))) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight μ) (finiteCoordinateComponent μ T V.toList (finiteCoordinateComponent μ ∅ activeᶜ.toList g))) := by have hAU : A ⊆ U := fun i hi => (mem_sdiff.mp (hA hi)).1 have hBV : B ⊆ V := fun i hi => (mem_sdiff.mp (hB hi)).1 have hAa : A ⊆ active := hAU.trans hU have hBa : B ⊆ active := hBV.trans hV have hAB : Disjoint A B := hUV.mono hAU hBV obtain ⟨hsA, hsB, hsT, _, hAT, hBT, hc⟩ := finite_active_four_partition active A B hAa hBa hAB obtain ⟨F, hF⟩ := finite_four_component_factors_shared_b μ hmass (active \ (A ∪ B)) A B activeᶜ hsA hsB hsT hAB hAT hBT hc U S hA f obtain ⟨G, hG⟩ := finite_four_component_factors_shared_a μ hmass (active \ (A ∪ B)) A B activeᶜ hsA hsB hsT hAB hAT hBT hc V T hB g apply finite_four_asymmetric_pairing_error_le μ hμ hmass (active \ (A ∪ B)) A B activeᶜ hsA hsB hsT hAB hAT hBT hc KA KB phase _ _ F G hF hG ε hε intro c simpa only [finiteWeightedEnergy, Complex.norm_conj] using hfree c (G c) (fun b => (starRingEnd ℂ) (F c b)) end Bounty end section /- From actual weighted prime candidates to a smooth shifted-prime supply. -/ open Finset Filter namespace Bounty theorem eventually_candidate_shifted_prime_supply {c q δ : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hsmall : (6 / 5 : ℝ) * c ≤ δ) (C : ℝ) {σ : ℝ} (hσ : 0 < σ) : ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (S : Finset ℕ), S ⊆ arithmeticProductWindow 1 (Real.exp L) → (∀ u ∈ S, (2 * u + 1).Prime) → Real.exp L * L ^ (-C) ≤ (∑ u ∈ S, candidateCoefficient c L q r jStar u) → ∃ P : Finset ℕ, P ⊆ primeBand (2 * Real.exp L) (33 * Real.exp L) ∧ Real.exp ((1 - σ) * L) ≤ (P.card : ℝ) ∧ ∀ p ∈ P, ∀ t : ℕ, t.Prime → t ∣ p - 1 → (t : ℝ) ≤ Real.exp (δ * L) := by have hδ : 0 < δ := lt_of_lt_of_le (by positivity) hsmall have hlarge : ∀ᶠ L : ℝ in atTop, (2 : ℝ) ≤ Real.exp (δ * L) := (Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hδ)).eventually_ge_atTop 2 filter_upwards [eventually_candidate_subset_card_lower hc hr hq0 hq1 C hσ, eventually_candidate_coefficient_primeFactors_range hc hsmall, hlarge, eventually_ge_atTop (0 : ℝ)] with L hcard hsmooth htwo hL intro jStar S hS hprime hmass let T := S.filter (fun u => candidateCoefficient c L q r jStar u ≠ 0) have hTS : T ⊆ S := filter_subset _ _ have hTmass : (∑ u ∈ T, candidateCoefficient c L q r jStar u) = ∑ u ∈ S, candidateCoefficient c L q r jStar u := sum_filter_ne_zero _ have hTcard := hcard jStar T (hTS.trans hS) (by rwa [hTmass]) let P := T.image (fun u => 2 * u + 1) have hPcard : P.card = T.card := by apply card_image_of_injective intro u v huv change 2 * u + 1 = 2 * v + 1 at huv omega refine ⟨P, ?_, ?_, ?_⟩ · intro p hp obtain ⟨u, hu, rfl⟩ := mem_image.mp hp obtain ⟨hlo, hhi⟩ := (mem_arithmeticProductWindow_iff one_ne_zero (Real.exp L)).mp (hS (hTS hu)) simp only [one_mul] at hlo hhi have he : (1 : ℝ) ≤ Real.exp L := Real.one_le_exp hL apply (mem_primeBand_iff (by positivity) (by positivity) _).mpr refine ⟨hprime u (hTS hu), ?_, ?_⟩ <;> push_cast <;> nlinarith · simpa only [hPcard] using hTcard · intro p hp t ht hdiv obtain ⟨u, hu, rfl⟩ := mem_image.mp hp have hdiv' : t ∣ 2 * u := by simpa only [Nat.add_sub_cancel] using hdiv rcases ht.dvd_mul.mp hdiv' with ht2 | htu · have ht_eq : t = 2 := (Nat.dvd_prime Nat.prime_two).mp ht2 |>.resolve_left ht.ne_one simpa only [ht_eq, Nat.cast_ofNat] using htwo · have hu0 : u ≠ 0 := by have hw := (mem_arithmeticProductWindow_iff one_ne_zero (Real.exp L)).mp (hS (hTS hu)) intro hz simp only [hz, Nat.cast_zero, mul_zero] at hw linarith [Real.exp_pos L] exact (hsmooth q r jStar u (mem_filter.mp hu).2 t (Nat.mem_primeFactors.mpr ⟨ht, htu, hu0⟩)).2 /- The remaining weighted prime-extraction statement at the actual candidate weights and interval. This definition does not assert the statement. -/ def CandidateShiftedPrimeMassSupply : Prop := ∀ δ : ℝ, 0 < δ → δ < 1 / 4 → ∃ (c q C : ℝ) (r jStar : ℕ), 0 < c ∧ 0 < r ∧ 0 ≤ q ∧ q < 1 ∧ (6 / 5 : ℝ) * c ≤ δ ∧ ∀ᶠ L : ℝ in atTop, ∃ S : Finset ℕ, S ⊆ arithmeticProductWindow 1 (Real.exp L) ∧ (∀ u ∈ S, (2 * u + 1).Prime) ∧ Real.exp L * L ^ (-C) ≤ (∑ u ∈ S, candidateCoefficient c L q r jStar u) theorem wide_smooth_supply_of_candidate_prime_mass (hM : CandidateShiftedPrimeMassSupply) : WideSmoothShiftedPrimeSupply := by apply wide_smooth_supply_of_exponential_scale intro δ hδ hδsmall σ hσ obtain ⟨c, q, C, r, jStar, hc, hr, hq0, hq1, hsmall, hmass⟩ := hM δ hδ hδsmall filter_upwards [hmass, eventually_candidate_shifted_prime_supply hc hr hq0 hq1 hsmall C hσ] with L hS hshift obtain ⟨S, hS, hprime, hmass⟩ := hS exact hshift jStar S hS hprime hmass theorem target_of_candidate_prime_mass_and_zero_free (hM : CandidateShiftedPrimeMassSupply) (hZ : PrimitiveZeroFreeHalfPlane) : fcTypeOfName% "Erdos1057.erdos_1057" := target_of_wide_smooth_primes_and_zero_free (wide_smooth_supply_of_candidate_prime_mass hM) hZ end Bounty end section /- Uniform rough-integer character cancellation for polynomial-size moduli. -/ open Finset Filter namespace Bounty theorem eventually_rpow_le_exp_sqrt (T : ℝ) : ∀ᶠ L : ℝ in atTop, L^T ≤ Real.exp (Real.sqrt L) := by filter_upwards [eventually_exp_neg_rpow_mul_rpow_le (by norm_num : (0 : ℝ) < 1/2) (by norm_num : (0 : ℝ) < 1) T 0] with L hL simp only [neg_one_mul, neg_zero, Real.rpow_zero, ← Real.sqrt_eq_rpow] at hL have h := mul_le_mul_of_nonneg_left hL (Real.exp_nonneg (Real.sqrt L)) have he : Real.exp (Real.sqrt L) * Real.exp (-Real.sqrt L) = 1 := by rw [← Real.exp_add, add_neg_cancel, Real.exp_zero] simpa only [← mul_assoc, he, one_mul, mul_one] using h theorem eventually_rough_interval_character_power_bound {a : ℝ} (ha : 0 < a) (T Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), χ ≠ 1 → (r : ℝ) ≤ L^T → ∀ A B : ℕ, A ≤ B → (B : ℝ) ≤ 2*Y → ‖∑ n ∈ (Ioc A B).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)), χ (n : ZMod r)‖ ≤ Y * L^(-Bsave) := by obtain ⟨K, hK, hcount⟩ := exists_rough_interval_character_bound have hK' : 0 ≤ 2*K+1 := by linarith filter_upwards [eventually_rough_cell_sieve_parameters ha, eventually_rough_cell_error_profile_le ha hK' (-1) (Bsave + T), eventually_rpow_le_exp_sqrt T, eventually_ge_atTop (1 : ℝ)] with L hpar hprofile hmod hL intro Y hY r hr χ hχ hrT A B hAB hBY have hL0 : 0 < L := zero_lt_one.trans_le hL have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hrpos : 0 < r := Nat.pos_of_ne_zero (NeZero.ne r) have hpf : ∀ p ∈ r.primeFactors, (p : ℝ) ≤ Real.exp (Real.sqrt L) := by intro p hp exact (Nat.cast_le.mpr (Nat.le_of_dvd hrpos (Nat.dvd_of_mem_primeFactors hp))).trans (hrT.trans hmod) have hraw := hcount A B r χ hχ hpar.2.2.1 hAB hpf hpar.1 hpar.2.1 let V := ∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1 - 1/(p : ℝ)) let M := (((B : ℝ)-A)/r.totient) * V let E := Real.exp (-L^(1/8 : ℝ)) let F := Real.exp (-(a/2)*L) have hV0 : 0 ≤ V := (finite_prime_avoidance_product_pos _ (fun _ hp => small_prime_pool_prime hp)).le have hV1 : V ≤ 1 := finite_prime_avoidance_product_le_one _ (fun _ hp => small_prime_pool_prime hp) have hlen : 0 ≤ (B : ℝ)-A := sub_nonneg.mpr (Nat.cast_le.mpr hAB) have hphi : (1 : ℝ) ≤ r.totient := by exact_mod_cast Nat.totient_pos.mpr hrpos have hM0 : 0 ≤ M := by dsimp [M]; positivity have hM : M ≤ 2*Y := by calc _ ≤ ((B : ℝ)-A)/r.totient := mul_le_of_le_one_right (by positivity) hV1 _ ≤ (B : ℝ)-A := div_le_self hlen hphi _ ≤ B := sub_le_self _ (Nat.cast_nonneg A) _ ≤ 2*Y := hBY have hEF : 0 ≤ E ∧ 0 ≤ F := ⟨Real.exp_nonneg _, Real.exp_nonneg _⟩ have hlevel : (Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ)+2) ≤ Y*F := by apply hpar.2.2.2.1.trans have h := mul_le_mul_of_nonneg_right hY hEF.2 have he : Real.exp (a*L) * F = Real.exp ((a/2)*L) := by dsimp [F] rw [← Real.exp_add] congr 1 ring rwa [he] at h have hpoly : (2*K+1)*(E+F) ≤ L^(-(Bsave+T)) := by simpa only [neg_add_cancel, Real.rpow_zero, one_mul, E, F] using hprofile have hinside : 2*K*E+F ≤ (2*K+1)*(E+F) := by nlinarith have hfirst : M*K*Real.exp (-(roughCellSieveOrder L : ℝ)) ≤ 2*Y*K*E := mul_le_mul (mul_le_mul_of_nonneg_right hM hK.le) hpar.2.2.2.2 (Real.exp_nonneg _) (by positivity) calc _ ≤ (r : ℝ) * (M*K*Real.exp (-(roughCellSieveOrder L : ℝ)) + (Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ)+2)) := hraw _ ≤ L^T * (2*Y*K*E+Y*F) := mul_le_mul hrT (add_le_add hfirst hlevel) (by positivity) (by positivity) _ = Y*L^T*(2*K*E+F) := by ring _ ≤ Y*L^T*((2*K+1)*(E+F)) := mul_le_mul_of_nonneg_left hinside (by positivity) _ ≤ Y*L^T*L^(-(Bsave+T)) := mul_le_mul_of_nonneg_left hpoly (by positivity) _ = Y*L^(-Bsave) := by rw [mul_assoc, ← Real.rpow_add hL0] congr 2 ring end Bounty end section /- Natural representatives of the actual base and bad residue-pair conditions. -/ open Finset namespace Bounty theorem nat_residue_pair_preimage_card (r : ℕ) [NeZero r] (S : Finset (ZMod r × ZMod r)) : (((Finset.product (range r) (range r)).filter (fun v : ℕ × ℕ => ((v.1 : ZMod r), (v.2 : ZMod r)) ∈ S)).card) = S.card := by classical apply card_bij (fun v _ => ((v.1 : ZMod r), (v.2 : ZMod r))) · intro v hv exact (mem_filter.mp hv).2 · intro v hv w hw heq have hv' := (mem_filter.mp hv).1 have hw' := (mem_filter.mp hw).1 simp only [Finset.product_eq_sprod, mem_product, mem_range] at hv' hw' have h1 := congrArg (fun a : ZMod r × ZMod r => a.1.val) heq have h2 := congrArg (fun a : ZMod r × ZMod r => a.2.val) heq simp only [ZMod.val_natCast, Nat.mod_eq_of_lt hv'.1, Nat.mod_eq_of_lt hw'.1] at h1 simp only [ZMod.val_natCast, Nat.mod_eq_of_lt hv'.2, Nat.mod_eq_of_lt hw'.2] at h2 exact Prod.ext h1 h2 · intro v hv refine ⟨(v.1.val, v.2.val), mem_filter.mpr ⟨?_, ?_⟩, ?_⟩ · rw [Finset.product_eq_sprod, mem_product] exact ⟨mem_range.mpr v.1.val_lt, mem_range.mpr v.2.val_lt⟩ · simpa only [ZMod.natCast_zmod_val, Prod.mk.eta] using hv · simp only [ZMod.natCast_zmod_val, Prod.mk.eta] noncomputable def natPairBaseResidues (m : ℕ) : Finset (ℕ × ℕ) := (Finset.product (range m) (range m)).filter (fun v => (v.1*v.2) % m = 1 % m) noncomputable def natPairBadResidues (p : ℕ) (rough banned : Bool) : Finset (ℕ × ℕ) := (Finset.product (range p) (range p)).filter (fun v => (rough = true ∧ (v.1*v.2) % p = 0) ∨ (banned = true ∧ (v.1*v.2) % p = 1 % p)) theorem nat_pair_base_residue_card (m : ℕ) [NeZero m] : (natPairBaseResidues m).card = m.totient := by classical have hset : natPairBaseResidues m = (Finset.product (range m) (range m)).filter (fun v : ℕ × ℕ => ((v.1 : ZMod m), (v.2 : ZMod m)) ∈ (univ : Finset (ZMod m × ZMod m)).filter (fun w => w.1*w.2 = 1)) := by apply filter_congr intro v _ simp only [mem_filter, mem_univ, true_and] have he : ((v.1*v.2 : ℕ) : ZMod m) = 1 ↔ (v.1*v.2) % m = 1 % m := by simpa only [Nat.cast_one] using ZMod.natCast_eq_natCast_iff' (v.1*v.2) 1 m simpa only [Nat.cast_mul] using he.symm rw [hset, nat_residue_pair_preimage_card, finite_mul_one_pair_card, ZMod.card_units_eq_totient] theorem nat_pair_bad_residue_density (p : ℕ) [Fact p.Prime] (rough banned : Bool) : ((natPairBadResidues p rough banned).card : ℝ) / (p : ℝ)^2 = pairSieveDensity p rough banned := by classical have hset : natPairBadResidues p rough banned = (Finset.product (range p) (range p)).filter (fun v : ℕ × ℕ => ((v.1 : ZMod p), (v.2 : ZMod p)) ∈ pairSieveBadResidues p rough banned) := by apply filter_congr intro v _ simp only [pairSieveBadResidues, mem_filter, mem_univ, true_and] have h0 : ((v.1*v.2 : ℕ) : ZMod p) = 0 ↔ (v.1*v.2) % p = 0 := by simpa only [Nat.cast_zero, Nat.zero_mod] using ZMod.natCast_eq_natCast_iff' (v.1*v.2) 0 p have h1 : ((v.1*v.2 : ℕ) : ZMod p) = 1 ↔ (v.1*v.2) % p = 1 % p := by simpa only [Nat.cast_one] using ZMod.natCast_eq_natCast_iff' (v.1*v.2) 1 p simp only [← Nat.cast_mul, h0, h1] rw [hset, nat_residue_pair_preimage_card, pair_sieve_density_eq_card] theorem nat_pair_base_residue_bounds (m : ℕ) {v : ℕ × ℕ} (hv : v ∈ natPairBaseResidues m) : v.1 < m ∧ v.2 < m := by have h := (mem_filter.mp hv).1 simpa only [Finset.product_eq_sprod, mem_product, mem_range] using h theorem nat_pair_bad_residue_bounds (p : ℕ) (rough banned : Bool) {v : ℕ × ℕ} (hv : v ∈ natPairBadResidues p rough banned) : v.1 < p ∧ v.2 < p := by have h := (mem_filter.mp hv).1 simpa only [Finset.product_eq_sprod, mem_product, mem_range] using h theorem actual_pair_sieve_residue_card (m : ℕ) [NeZero m] (P : Finset ℕ) (rough banned : ℕ → Bool) (hP : ∀ p ∈ P, p.Prime) (hPm : ∀ p ∈ P, ¬p ∣ m) : (natPairSieveResidues m (natPairBaseResidues m) P (fun p => natPairBadResidues p (rough p) (banned p))).card = m.totient * ∏ p ∈ P, (natPairBadResidues p (rough p) (banned p)).card := by rw [nat_pair_sieve_residues_card m (Nat.pos_of_ne_zero (NeZero.ne m)) _ (fun _ hv => nat_pair_base_residue_bounds m hv) P _ hP hPm (fun p _ _ hv => nat_pair_bad_residue_bounds p (rough p) (banned p) hv), nat_pair_base_residue_card] end Bounty end section /- Exact Bernoulli mask identities used in the weighted pair sieve. -/ open Finset namespace Bounty theorem bernoulli_mask_inverse_avoidance (P : Finset ℕ) (q : ℝ) (hP : ∀ p ∈ P, 2 ≤ p) : (∑ S ∈ P.powerset, bernoulliSubsetWeight q P S * ∏ p ∈ S, (1 - 1/(p : ℝ))⁻¹) = ∏ p ∈ P, (1 + q/((p : ℝ)-1)) := by rw [show (∑ S ∈ P.powerset, bernoulliSubsetWeight q P S * ∏ p ∈ S, (1 - 1/(p : ℝ))⁻¹) = ∏ p ∈ P, ((1-q)+q*(1-1/(p : ℝ))⁻¹) from subset_weighted_product_expansion P q (1-q) (fun p => (1-1/(p : ℝ))⁻¹)] apply prod_congr rfl intro p hp have hpR : (2 : ℝ) ≤ p := Nat.cast_le.mpr (hP p hp) have hp0 : (p : ℝ) ≠ 0 := by linarith have hp1 : (p : ℝ)-1 ≠ 0 := by linarith field_simp ring theorem bernoulli_mask_contains {α : Type*} [DecidableEq α] (P F : Finset α) (hF : F ⊆ P) (q : ℝ) : (∑ S ∈ P.powerset, if F ⊆ S then bernoulliSubsetWeight q P S else 0) = q^F.card := by classical let b : α → ℝ := fun p => if p ∈ F then 0 else 1-q have hcomp (S : Finset α) (hS : S ⊆ P) : (∏ p ∈ P \ S, b p) = if F ⊆ S then (1-q)^(P.card-S.card) else 0 := by by_cases hFS : F ⊆ S · rw [if_pos hFS] calc _ = ∏ _p ∈ P \ S, (1-q) := by apply prod_congr rfl intro p hp exact if_neg (fun hpF => (mem_sdiff.mp hp).2 (hFS hpF)) _ = _ := by rw [prod_const, card_sdiff_of_subset hS] · rw [if_neg hFS] obtain ⟨p, hpF, hpS⟩ := Set.not_subset.mp hFS exact prod_eq_zero (mem_sdiff.mpr ⟨hF hpF, hpS⟩) (if_pos hpF) have hid : (∏ p ∈ P, (q + b p)) = q^F.card := by have hp : (∏ p ∈ P, (q + b p)) = ∏ p ∈ P, if p ∈ F then q else 1 := by apply prod_congr rfl intro p _ by_cases hp : p ∈ F <;> simp [b, hp] rw [hp, ← prod_filter] have hfilter : P.filter (fun p => p ∈ F) = F := filter_mem_eq_inter.trans (inter_eq_right.mpr hF) rw [hfilter, prod_const] rw [← hid, prod_add] apply sum_congr rfl intro S hS rw [hcomp S (mem_powerset.mp hS), prod_const] by_cases hFS : F ⊆ S <;> simp [hFS, bernoulliSubsetWeight] end Bounty end section /- The actual prime sets in the masked pair sieve and their omitted-prime corrections. -/ open Finset namespace Bounty noncomputable def maskedPairPrimes (m : ℕ) (z : ℝ) : Finset ℕ := (primeBand 0 z).filter (fun p => p ≠ 2 ∧ ¬p ∣ m) noncomputable def maskedPairRoughPrimes (m : ℕ) (W z : ℝ) : Finset ℕ := by classical exact (maskedPairPrimes m z).filter (fun p : ℕ => (p : ℝ) ≤ W) noncomputable def maskedPairBannedPrimes (m : ℕ) (z : ℝ) (A : Finset ℕ) : Finset ℕ := maskedPairPrimes m z \ A theorem mem_masked_pair_primes {m p : ℕ} {z : ℝ} (hz : 0 ≤ z) : p ∈ maskedPairPrimes m z ↔ p.Prime ∧ (p : ℝ) ≤ z ∧ p ≠ 2 ∧ ¬p ∣ m := by simp only [maskedPairPrimes, mem_filter, mem_primeBand_iff le_rfl hz] constructor · rintro ⟨⟨hp, _, hpz⟩, hp2, hpm⟩ exact ⟨hp, hpz, hp2, hpm⟩ · rintro ⟨hp, hpz, hp2, hpm⟩ exact ⟨⟨hp, Nat.cast_pos.mpr hp.pos, hpz⟩, hp2, hpm⟩ theorem masked_pair_rough_omission (m : ℕ) (hm : m ≠ 0) (W z : ℝ) (hW : 0 ≤ W) (hWz : W ≤ z) : (∏ p ∈ maskedPairRoughPrimes m W z, (1 - 1/(p : ℝ))) ≤ 2 * (∏ p ∈ primeBand 0 W, (1 - 1/(p : ℝ))) * (∏ p ∈ m.primeFactors, (1 - 1/(p : ℝ))⁻¹) := by classical have hz := hW.trans hWz have hQ : ∀ p ∈ primeBand 0 W, 2 ≤ p := fun p hp => ((mem_primeBand_iff le_rfl hW p).mp hp).1.two_le have hP : ∀ p ∈ maskedPairRoughPrimes m W z, 2 ≤ p := fun p hp => ((mem_masked_pair_primes hz).mp (mem_filter.mp hp).1).1.two_le have hmP : ∀ p ∈ m.primeFactors, 2 ≤ p := fun p hp => (Nat.mem_primeFactors.mp hp).1.two_le have hE : ∀ p ∈ insert 2 m.primeFactors, 2 ≤ p := by intro p hp rcases mem_insert.mp hp with rfl | hp · exact le_rfl · exact hmP p hp have hcover : primeBand 0 W \ insert 2 m.primeFactors ⊆ maskedPairRoughPrimes m W z := by intro p hp obtain ⟨hpW, hpE⟩ := mem_sdiff.mp hp obtain ⟨hprime, _, hpW⟩ := (mem_primeBand_iff le_rfl hW p).mp hpW have hp2 : p ≠ 2 := fun he => hpE (mem_insert.mpr (Or.inl he)) have hpm : ¬p ∣ m := fun hd => hpE (mem_insert_of_mem (Nat.mem_primeFactors.mpr ⟨hprime, hd, hm⟩)) exact mem_filter.mpr ⟨(mem_masked_pair_primes hz).mpr ⟨hprime, hpW.trans hWz, hp2, hpm⟩, hpW⟩ have hb := finite_avoidance_omission_bound _ _ _ hP hQ hE hcover have hc := mul_le_mul_of_nonneg_left (inverse_avoidance_insert_two_le m.primeFactors hmP) (prod_nonneg (fun p hp => (avoidance_factor_bounds (hQ p hp)).1.le)) exact hb.trans (hc.trans_eq (by ring)) theorem masked_pair_banned_omission (m : ℕ) (hm : m ≠ 0) (z : ℝ) (hz : 0 ≤ z) (A : Finset ℕ) (hA : ∀ p ∈ A, 2 ≤ p) : (∏ p ∈ maskedPairBannedPrimes m z A, (1 - 1/(p : ℝ))) ≤ 2 * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) * (∏ p ∈ m.primeFactors, (1 - 1/(p : ℝ))⁻¹) * (∏ p ∈ A, (1 - 1/(p : ℝ))⁻¹) := by have hQ : ∀ p ∈ primeBand 0 z, 2 ≤ p := fun p hp => ((mem_primeBand_iff le_rfl hz p).mp hp).1.two_le have hP : ∀ p ∈ maskedPairBannedPrimes m z A, 2 ≤ p := fun p hp => ((mem_masked_pair_primes hz).mp (mem_sdiff.mp hp).1).1.two_le have hmP : ∀ p ∈ m.primeFactors, 2 ≤ p := fun p hp => (Nat.mem_primeFactors.mp hp).1.two_le have hU : ∀ p ∈ m.primeFactors ∪ A, 2 ≤ p := fun p hp => (mem_union.mp hp).elim (hmP p) (hA p) have hE : ∀ p ∈ insert 2 (m.primeFactors ∪ A), 2 ≤ p := by intro p hp rcases mem_insert.mp hp with rfl | hp · exact le_rfl · exact hU p hp have hcover : primeBand 0 z \ insert 2 (m.primeFactors ∪ A) ⊆ maskedPairBannedPrimes m z A := by intro p hp obtain ⟨hpz, hpE⟩ := mem_sdiff.mp hp obtain ⟨hprime, _, hpz⟩ := (mem_primeBand_iff le_rfl hz p).mp hpz have hp2 : p ≠ 2 := fun he => hpE (mem_insert.mpr (Or.inl he)) have hpm : ¬p ∣ m := fun hd => hpE (mem_insert_of_mem (mem_union_left _ (Nat.mem_primeFactors.mpr ⟨hprime, hd, hm⟩))) have hpA : p ∉ A := fun hh => hpE (mem_insert_of_mem (mem_union_right _ hh)) exact mem_sdiff.mpr ⟨(mem_masked_pair_primes hz).mpr ⟨hprime, hpz, hp2, hpm⟩, hpA⟩ have hb := finite_avoidance_omission_bound _ _ _ hP hQ hE hcover have hI := (inverse_avoidance_insert_two_le (m.primeFactors ∪ A) hU).trans (mul_le_mul_of_nonneg_left (inverse_avoidance_union_le m.primeFactors A hmP hA) (by norm_num)) have hc := mul_le_mul_of_nonneg_left hI (prod_nonneg (fun p hp => (avoidance_factor_bounds (hQ p hp)).1.le)) exact hb.trans (hc.trans_eq (by ring)) end Bounty end section /- A uniform bound for the Euler correction of a modulus with large prime factors. -/ open Finset namespace Bounty section variable {L : ℝ} (hL : 1 ≤ L) (m : ℕ) (hm : m ≠ 0) (hmL : (m : ℝ) ≤ Real.exp L) (hmin : ∀ p ∈ m.primeFactors, L^2 ≤ (p : ℝ)) include L hL m hm hmL hmin theorem large_prime_modulus_inverse_bound : (∏ p ∈ m.primeFactors, (1 - 1/(p : ℝ))⁻¹) ≤ Real.exp 4 := by have hL0 : 0 < L := zero_lt_one.trans_le hL have hm0 : (0 : ℝ) < m := Nat.cast_pos.mpr (Nat.pos_of_ne_zero hm) have hlog : Real.log (m : ℝ) ≤ L := by simpa only [Real.log_exp] using Real.log_le_log hm0 hmL have hcard : (m.primeFactors.card : ℝ) ≤ 2*L := (primeFactors_card_le_two_log (Nat.pos_of_ne_zero hm)).trans (by linarith) have hsum : (∑ p ∈ m.primeFactors, 1/(p : ℝ)) ≤ 2 := by calc _ ≤ ∑ _p ∈ m.primeFactors, 1/L^2 := sum_le_sum (fun p hp => one_div_le_one_div_of_le (sq_pos_of_pos hL0) (hmin p hp)) _ = (m.primeFactors.card : ℝ) * (1/L^2) := by simp _ ≤ (2*L) * (1/L^2) := mul_le_mul_of_nonneg_right hcard (by positivity) _ ≤ 2 := by rw [mul_one_div] apply (div_le_iff₀ (sq_pos_of_pos hL0)).mpr nlinarith have hb := finite_inverse_avoidance_le_exp m.primeFactors (fun p hp => (Nat.mem_primeFactors.mp hp).1.two_le) exact hb.trans (Real.exp_le_exp.mpr (by linarith)) theorem large_prime_modulus_inverse_cube_bound : (∏ p ∈ m.primeFactors, (1 - 1/(p : ℝ))⁻¹)^3 ≤ Real.exp 12 := by have hI0 : 0 ≤ ∏ p ∈ m.primeFactors, (1 - 1/(p : ℝ))⁻¹ := prod_nonneg (fun p hp => inv_nonneg.mpr (avoidance_factor_bounds (Nat.mem_primeFactors.mp hp).1.two_le).1.le) have h := pow_le_pow_left₀ hI0 (large_prime_modulus_inverse_bound hL m hm hmL hmin) 3 calc _ ≤ (Real.exp 4)^3 := h _ = Real.exp 12 := by rw [← Real.exp_nat_mul]; norm_num end end Bounty end section /- Exact identification of the physical unbanned row with the asymmetric prime comparison. Shared coordinates, auxiliary samples, and both phases are retained; this is an identity, not an operator-norm hypothesis. -/ open Finset open scoped Classical namespace Bounty theorem repeated_big_prime_D_split {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (source : RepeatedBigLists P J ell) (a : ∀ i : A, P i.val.1) (b : ∀ i : B, P i.val.1) : repeatedBigD (repeatedBigAuxCut A B) source ((repeatedBigAuxSplitEquiv P A B hU hAB).symm (a, b)) = (∏ i : ↥(repeatedBigFlatActive J ell \ (A ∪ B)), (repeatedBigFlatEquiv P J ell source i.val).val) * (∏ i : A, (a i).val) * (∏ i : B, (b i).val) := by unfold repeatedBigD rw [prod_mul_distrib, repeated_big_shared_label_product_flat, repeatedBigAuxCut_shared, repeatedBigAuxSplitEquiv_symm_label_prod] exact (mul_assoc _ _ _).symm theorem repeated_big_prime_unbanned_kernel_eq {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (ζ Θ : ℝ) (source target : RepeatedBigLists P J ell) : (∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), repeatedBigUnbannedKernel V (fun _ _ => 1) (repeatedBigAuxCut A B) ζ (repeatedBigPrimeCoefficient P V A B hU hAB Q h (keptA A) (keptB B)) aux source target * physicalReturnPhase Θ (repeatedBigD (repeatedBigAuxCut A B) source aux)) = primeAsymmetricComparisonKernel (fun i : RepeatedBigFlatIndex G J ell => P i.1) (fun i => V i.1) (repeatedBigFlatActive J ell) Q h keptA keptB ζ Θ A B (repeatedBigFlatEquiv P J ell source) (repeatedBigFlatEquiv P J ell target) := by rw [prime_asymmetric_comparison_kernel_eq_aux_sum] have hc := repeated_big_shared_compatible_flat (repeatedBigAuxCut A B) source target rw [repeatedBigAuxCut_shared] at hc by_cases hxy : repeatedBigSharedCompatible (repeatedBigAuxCut A B) source target · rw [if_pos (hc.mp hxy)] calc _ = ∑ ab : (∀ i : A, P i.val.1) × (∀ i : B, P i.val.1), repeatedBigUnbannedKernel V (fun _ _ => 1) (repeatedBigAuxCut A B) ζ (repeatedBigPrimeCoefficient P V A B hU hAB Q h (keptA A) (keptB B)) ((repeatedBigAuxSplitEquiv P A B hU hAB).symm ab) source target * physicalReturnPhase Θ (repeatedBigD (repeatedBigAuxCut A B) source ((repeatedBigAuxSplitEquiv P A B hU hAB).symm ab)) := ((repeatedBigAuxSplitEquiv P A B hU hAB).symm.sum_comp _).symm _ = _ := by rw [Fintype.sum_prod_type] apply sum_congr rfl intro a _ apply sum_congr rfl intro b _ unfold repeatedBigUnbannedKernel rw [if_pos hxy, repeatedBigAuxSplitEquiv_symm_mass, repeated_big_target_mass_flat, repeatedBigAuxCut_shared, repeated_big_prime_coefficient_split, repeated_big_prime_D_split] rfl · rw [if_neg (fun h => hxy (hc.mpr h))] apply sum_eq_zero intro aux _ simp only [repeatedBigUnbannedKernel, if_neg hxy, zero_mul] end Bounty end section /- An elementary upper bound for the full prime avoidance product from harmonic sums. -/ open Finset namespace Bounty theorem harmonic_floor_le_inverse_prime_product (z : ℝ) (hz : 0 ≤ z) : (harmonic ⌊z⌋₊ : ℝ) ≤ ∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))⁻¹ := by classical have hP : ∀ p ∈ primeBand 0 z, p.Prime := fun p hp => ((mem_primeBand_iff le_rfl hz p).mp hp).1 have hS : ∀ n ∈ Icc 1 ⌊z⌋₊, n ∈ Nat.factoredNumbers (primeBand 0 z) := by intro n hn obtain ⟨hn1, hnz⟩ := mem_Icc.mp hn apply Nat.mem_factoredNumbers_iff_forall_le.mpr refine ⟨by omega, ?_⟩ intro p hpn hp _ exact (mem_primeBand_iff le_rfl hz p).mpr ⟨hp, Nat.cast_pos.mpr hp.pos, (Nat.cast_le.mpr (hpn.trans hnz)).trans (Nat.floor_le hz)⟩ have hfinite : (∑ n ∈ Icc 1 ⌊z⌋₊, (n : ℝ)^(-(1 : ℝ))) ≤ ∑' n : Nat.factoredNumbers (primeBand 0 z), (n.val : ℝ)^(-(1 : ℝ)) := by rw [← sum_subtype_of_mem (fun n : ℕ => (n : ℝ)^(-(1 : ℝ))) hS] apply (smooth_rpow_summable_and_sum _ hP (by norm_num : (0 : ℝ) < 1)).1.sum_le_tsum intro n _ exact Real.rpow_nonneg (Nat.cast_nonneg _) _ rw [(smooth_rpow_summable_and_sum _ hP (by norm_num : (0 : ℝ) < 1)).2] at hfinite simpa only [harmonic_eq_sum_Icc, Rat.cast_sum, Rat.cast_inv, Rat.cast_natCast, Real.rpow_neg_one, one_div] using hfinite theorem full_prime_avoidance_upper {z : ℝ} (hz : 1 < z) : (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) ≤ 1/Real.log z := by have hz0 := (zero_lt_one.trans hz).le have hP : ∀ p ∈ primeBand 0 z, 2 ≤ p := fun p hp => ((mem_primeBand_iff le_rfl hz0 p).mp hp).1.two_le have hV0 : 0 ≤ ∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ)) := prod_nonneg (fun p hp => (avoidance_factor_bounds (hP p hp)).1.le) have hid : (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))⁻¹) = 1 := by rw [← prod_mul_distrib] exact prod_eq_one (fun p hp => mul_inv_cancel₀ (avoidance_factor_bounds (hP p hp)).1.ne') have hlog := (log_le_harmonic_floor z hz0).trans (harmonic_floor_le_inverse_prime_product z hz0) have hm := mul_le_mul_of_nonneg_left hlog hV0 rw [hid] at hm exact (le_div_iff₀ (Real.log_pos hz)).mpr hm theorem full_prime_avoidance_exp_upper {t : ℝ} (ht : 0 < t) : (∏ p ∈ primeBand 0 (Real.exp t), (1 - 1/(p : ℝ))) ≤ 1/t := by simpa only [Real.log_exp] using full_prime_avoidance_upper (Real.one_lt_exp_iff.mpr ht) end Bounty end section /- Group-tagged prime labels and performed flags for the original ledger paths. -/ namespace Bounty section Ledger variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedLedgerPathBirthLabel (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (a : FullMixedBirthAddress S B steps) : Option ((g : Fin N) × P g) := (fullMixedLedgerPathBornData n S B A Δ D steps x p a).map (fullMixedBornPrime n) theorem full_mixed_ledger_birth_label_projection (H : (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullMixedLedgerPath n S B A Δ D steps (H, x)) (a : FullMixedBirthAddress S B steps) : fullMixedLedgerPathBirthLabel n S B A Δ D steps (H, x) p a = fullMixedPathBirthLabel n S B A Δ D steps x (finiteLedgerEventPathEquiv (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedLedgerUpdate n S B A Δ D) steps H x p) a := by unfold fullMixedLedgerPathBirthLabel fullMixedPathBirthLabel rw [full_mixed_ledger_birth_projection] end Ledger end Bounty end section /- Positivity and total weight of the actual microscopic assignment family. -/ open Finset Filter open scoped Topology namespace Bounty theorem candidate_micro_assignment_product_ne_zero (c L : ℝ) (r jStar J : ℕ) (x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i) : orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x ≠ 0 := by apply prod_ne_zero_iff.mpr intro i _ cases i with | inl slot => exact candidate_Q_slot_nonzero c L r jStar (⟨slot.1.val, (mem_filter.mp slot.1.property).1⟩, slot.2) (x (Sum.inl slot)).property | inr g => exact (mem_filter.mp (x (Sum.inr g)).property).2.ne_zero theorem eventually_candidate_micro_assignment_total_weight {c : ℝ} (hc : 0 < c) (r J : ℕ) (hJ : (12/5 : ℝ)*(r : ℝ)*c/(2 : ℝ)^J ≤ 1/25) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, (∑ _x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, 1 / candidateMicroAssignmentNormalization c L r J) ≤ Real.exp ((1/20 : ℝ)*L) * candidateMicroQHarmonicMass c L r jStar J := by filter_upwards [eventually_candidate_micro_assignment_size hc r J hJ, eventually_candidate_micro_assignment_normalization hc] with L hsize hnorm intro jStar obtain ⟨hnorm0, hnormeq⟩ := hnorm r jStar J have hpoint (x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i) : 1 / candidateMicroAssignmentNormalization c L r J ≤ Real.exp ((1/20 : ℝ)*L) * ((1 / candidateMicroAssignmentNormalization c L r J) / (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ)) := by have hD : (0 : ℝ) < orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x := Nat.cast_pos.mpr (Nat.pos_of_ne_zero (candidate_micro_assignment_product_ne_zero c L r jStar J x)) calc _ = (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ) * ((1 / candidateMicroAssignmentNormalization c L r J) / (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ)) := by field_simp _ ≤ _ := mul_le_mul_of_nonneg_right (hsize jStar x) (by positivity) calc _ ≤ ∑ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, Real.exp ((1/20 : ℝ)*L) * ((1 / candidateMicroAssignmentNormalization c L r J) / (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ)) := sum_le_sum (fun x _ => hpoint x) _ = Real.exp ((1/20 : ℝ)*L) * (∑ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, (1 / candidateMicroAssignmentNormalization c L r J) / (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ)) := (mul_sum _ _ _).symm _ = _ := by rw [hnormeq] end Bounty end section /- An explicit admissible microscopic cutoff and sieve exponent. -/ namespace Bounty theorem exists_candidate_micro_cutoff {c : ℝ} (hc : 0 < c) (r : ℕ) : ∃ J : ℕ, ∃ θ : ℝ, 0 < θ ∧ (6/5 : ℝ)*c/(2 : ℝ)^J < θ ∧ θ < 2*c/(2 : ℝ)^J ∧ 10*θ ≤ 1/20 ∧ (12/5 : ℝ)*(r : ℝ)*c/(2 : ℝ)^J ≤ 1/25 := by obtain ⟨J, hJ⟩ := pow_unbounded_of_one_lt (max (320*c) (60*(r : ℝ)*c)) (by norm_num : (1 : ℝ) < 2) have hpow : (0 : ℝ) < 2^J := by positivity have hlarge : 320*c < (2 : ℝ)^J := (le_max_left _ _).trans_lt hJ have hsize : 60*(r : ℝ)*c < (2 : ℝ)^J := (le_max_right _ _).trans_lt hJ refine ⟨J, (8/5 : ℝ)*c/(2 : ℝ)^J, by positivity, ?_, ?_, ?_, ?_⟩ · exact (div_lt_div_iff_of_pos_right hpow).mpr (by linarith) · exact (div_lt_div_iff_of_pos_right hpow).mpr (by linarith) · rw [← mul_div_assoc] apply (div_le_iff₀ hpow).mpr linarith · apply (div_le_iff₀ hpow).mpr linarith end Bounty end section /- Exact signed forest restoration for finite weighted sets of original full paths. -/ open scoped BigOperators open Classical namespace Bounty variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (encode : ((g : Fin N) × P g) → ℤ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (paths : Finset (FullPermutationMixedPath n S B A Δ D steps x)) (w : FullPermutationMixedPath n S B A Δ D steps x → ℂ) end Bounty end section /- Group the actual chronological full-path forest factors by their owning events. -/ open scoped BigOperators open Classical namespace Bounty variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedBirthAffectedOperations (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) : Finset (Fin steps.length) := birthForestAffectedOperations code (fullMixedIndexedBirthOwner S B steps) variable (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) (θ : (Fin (Fintype.card (FullMixedBirthAddress S B steps)) × Fin (Fintype.card (FullMixedBirthAddress S B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) end Bounty end section /- The literal total-memory cutoff for the lifted clean operator. Since clean transport keeps all memory lengths, this cutoff commutes with the clean action and with both adjacent active-slot averages. -/ open Finset open scoped Classical namespace Bounty noncomputable def cleanFullMemoryCutoff {G R : Type*} [Fintype G] {P : G → Finset ℕ} {J ell B : ℕ} (f : CleanFullMemoryState P J ell B → R → ℂ) (x : CleanFullMemoryState P J ell B) (r : R) : ℂ := productMemoryCutoff (fun y => f y r) x theorem clean_full_memory_cutoff_slice {G R : Type*} [Fintype G] {P : G → Finset ℕ} {J ell B : ℕ} (f : CleanFullMemoryState P J ell B → R → ℂ) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) : cleanFullMemorySlice (cleanFullMemoryCutoff f) N p = if (∑ g, (N g).val) ≤ B then cleanFullMemorySlice f N p else 0 := by by_cases h : (∑ g, (N g).val) ≤ B · rw [if_pos h] funext source r simp only [cleanFullMemorySlice, cleanFullMemoryCutoff, productMemoryCutoff, cleanFullMemoryState_total_memory] exact if_pos h · rw [if_neg h] funext source r simp only [cleanFullMemorySlice, cleanFullMemoryCutoff, productMemoryCutoff, cleanFullMemoryState_total_memory, Pi.zero_apply] exact if_neg h theorem clean_full_memory_cutoff_idempotent {G R : Type*} [Fintype G] {P : G → Finset ℕ} {J ell B : ℕ} (f : CleanFullMemoryState P J ell B → R → ℂ) : cleanFullMemoryCutoff (cleanFullMemoryCutoff f) = cleanFullMemoryCutoff f := by funext x r exact congrFun (productMemoryCutoff_idempotent (fun y => f y r)) x theorem clean_full_memory_cutoff_active_map {G R : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell B : ℕ} (f : CleanFullMemoryState P J ell B → R → ℂ) : cleanFullMemoryCutoff (cleanFullMemoryActiveMap f) = cleanFullMemoryActiveMap (cleanFullMemoryCutoff f) := by funext x r by_cases h : productTotalMemory x ≤ B <;> simp only [cleanFullMemoryCutoff, cleanFullMemoryActiveMap, productMemoryCutoff, fullActiveAverage, fullActivePermutation_total_memory, h, if_true, if_false, mul_zero, sum_const_zero] theorem clean_full_memory_cutoff_damped_action {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell B : ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState Pb J ell B → PhysicalResidues Ps → ℂ) : cleanFullMemoryCutoff (cleanFullMemoryPatternDampedAction Vb b C ζ θ ρ k K d f) = cleanFullMemoryPatternDampedAction Vb b C ζ θ ρ k K d (cleanFullMemoryCutoff f) := by apply clean_full_memory_slice_ext intro N p rw [clean_full_memory_cutoff_slice] unfold cleanFullMemoryPatternDampedAction rw [clean_full_memory_lift_slice, clean_full_memory_lift_slice, clean_full_memory_cutoff_slice] by_cases h : (∑ g, (N g).val) ≤ B · simp only [if_pos h] · simp only [if_neg h] funext source r simp only [cleanHybridPatternDampedAction, Pi.zero_apply, mul_zero, sum_const_zero] section variable {I S G : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : Fintype S] [sharedInstance3 : Fintype G] [sharedInstance4 : DecidableEq G] {Ps : S → Finset ℕ} {Pb : G → Finset ℕ} {J ell B : ℕ} (Vb : G → ℝ) (b : ∀ g, Pb g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : ∀ i, RepeatedBigLists Pb J ell → RepeatedBigLists Pb J ell → PhysicalAuxLabels Pb (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState Pb J ell B → PhysicalResidues Ps → ℂ) include I S G sharedInstance1 sharedInstance2 sharedInstance3 sharedInstance4 Ps Pb J ell B Vb b C ζ θ ρ k K d f theorem clean_full_memory_cutoff_projected_damped_action : cleanFullMemoryCutoff (cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction Vb b C ζ θ ρ k K d (cleanFullMemoryActiveMap f))) = cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction Vb b C ζ θ ρ k K d (cleanFullMemoryActiveMap (cleanFullMemoryCutoff f))) := by rw [clean_full_memory_cutoff_active_map, clean_full_memory_cutoff_damped_action, clean_full_memory_cutoff_active_map] theorem clean_full_memory_double_cutoff_projected_damped_action : cleanFullMemoryCutoff (cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction Vb b C ζ θ ρ k K d (cleanFullMemoryActiveMap (cleanFullMemoryCutoff f)))) = cleanFullMemoryCutoff (cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction Vb b C ζ θ ρ k K d (cleanFullMemoryActiveMap f))) := by rw [← clean_full_memory_cutoff_projected_damped_action, clean_full_memory_cutoff_idempotent] end section variable {G R : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] [sharedInstance3 : Fintype R] {P : G → Finset ℕ} {J ell B : ℕ} [sharedInstance6 : ∀ g (p : P g), NeZero p.val] (μ ν : ∀ g, P g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g p, 0 ≤ ν g p) include G R sharedInstance1 sharedInstance2 sharedInstance3 P J ell B sharedInstance6 μ ν hμ hν theorem clean_full_memory_cutoff_norm_le (f : CleanFullMemoryState P J ell B → R → ℂ) : cleanWeightedNorm (productMemoryWeight μ (fun g z => ν g z.1)) (cleanFullMemoryCutoff f) ≤ cleanWeightedNorm (productMemoryWeight μ (fun g z => ν g z.1)) f := by apply Real.sqrt_le_sqrt apply sum_le_sum intro x _ apply mul_le_mul_of_nonneg_left _ (productMemoryWeight_nonneg μ (fun g z => ν g z.1) hμ (fun g z => hν g z.1) x) apply sum_le_sum intro r _ exact pow_le_pow_left₀ (norm_nonneg _) (productMemoryCutoff_norm_le (fun y => f y r) x) 2 theorem clean_full_memory_cutoff_sandwich_norm_le (A : (CleanFullMemoryState P J ell B → R → ℂ) → CleanFullMemoryState P J ell B → R → ℂ) (M : ℝ) (hM : 0 ≤ M) (hA : ∀ f, cleanWeightedNorm (productMemoryWeight μ (fun g z => ν g z.1)) (A f) ≤ M * cleanWeightedNorm (productMemoryWeight μ (fun g z => ν g z.1)) f) (f : CleanFullMemoryState P J ell B → R → ℂ) : cleanWeightedNorm (productMemoryWeight μ (fun g z => ν g z.1)) (cleanFullMemoryCutoff (A (cleanFullMemoryCutoff f))) ≤ M * cleanWeightedNorm (productMemoryWeight μ (fun g z => ν g z.1)) f := (clean_full_memory_cutoff_norm_le μ ν hμ hν _).trans ((hA _).trans (mul_le_mul_of_nonneg_left (clean_full_memory_cutoff_norm_le μ ν hμ hν f) hM)) end end Bounty end section /- Every retained Q product remains disjoint from the full P pool. -/ open Finset namespace Bounty theorem candidate_micro_Q_product_free {c L : ℝ} (hcL : 0 ≤ c*L) (hpool : ∀ p ∈ (candidatePIndices c L).biUnion (candidatePBand (c*L)), (p : ℝ) ≤ Real.exp (Real.sqrt L)) (r jStar J : ℕ) (x : ∀ i, candidateMicroQSlotChoices c L r jStar J i) : Disjoint (orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) x).primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L))) := by classical apply disjoint_left.mpr intro p hp hP obtain ⟨hpp, hpdvd, _⟩ := Nat.mem_primeFactors.mp hp obtain ⟨slot, _, hpslot⟩ := ((Nat.prime_iff.mp hpp).dvd_finsetProd_iff (fun slot => (x slot).val)).mp hpdvd let s : (candidateQIndices c L) × Fin r := (⟨slot.1.val, (mem_filter.mp slot.1.property).1⟩, slot.2) have hmem : p ∈ (x slot).val.primeFactors := Nat.mem_primeFactors.mpr ⟨hpp, hpslot, candidate_Q_slot_nonzero c L r jStar s (x slot).property⟩ exact disjoint_left.mp (candidate_Q_slot_primeFactors_disjoint hcL hpool s (x slot).property) hmem hP end Bounty end section /- Exact local birth factorization retains every non-ledger edge restriction. -/ open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (k : K) (target : (g : Fin N) → Fin (S k g)ᶜ.card → P g) (H : (g : Fin N) → Finset (P g)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent (J := J) n S B A Δ D (some (.inr k)) s) end Full end Bounty end section /- The literal full clean-event sum, including its auxiliary draw and both total-memory cutoffs, equals the fresh-target integral. Memory symmetry is retained as an explicit hypothesis for the continuation. -/ open Finset open scoped Classical namespace Bounty theorem full_active_clean_event_sum {G : Type*} [Fintype G] [dG : DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (θ : ∀ c, A c → (∀ g, Fin (S g)ᶜ.card → P g) → ℂ) (f : ∀ c, A c → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) (hf : ∀ c a, ProductMemorySymmetric (f c a)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : let c := (productActiveMemorySplit S B x).1 let s := (productActiveMemorySplit S B x).2 (∑ e : FullActiveEdgeEvent n S B A Δ D x, (fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e : ℂ) * (if ∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅ then θ c e.1 (fun g => (unrestrictedJointEventTarget n (Δ c e.1) (D c e.1) (fun g => (S g)ᶜ.card) B s e.2 g).1) else 0) * f c e.1 (fullActiveEdgeEventTarget n S B A Δ D x e)) = if productTotalMemory x ≤ B then ∑ a : A c, (ω c a : ℂ) * (∏ g, (unrestrictedBoundedCleanFactor (n g) (Δ c a g) ρ (s g) : ℂ)) * ∑ target : (∀ g, Fin (S g)ᶜ.card → P g), ((∏ g, ∏ j, μ g (target g j) : ℝ) : ℂ) * θ c a target * f c a ((productActiveMemorySplit S B).symm (c, fun g => unrestrictedBoundedCleanTarget (n g) (Δ c a g) (s g) (target g))) else 0 := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro c s let F := fun a : A c => equivFiberSlice (productActiveMemorySplit S B) (f c a) c have hF (a : A c) : ProductMemorySymmetric (F a) := productActiveMemorySlice_symmetric S B (f c a) (hf c a) c have hrow (a : A c) := unrestricted_joint_clean_event_phase_sum n (Δ c a) (D c a) μ ρ V (fun g => (S g)ᶜ.card) B (θ c a) (F a) (hF a) s simp only [mul_assoc] at hrow have htotal : productTotalMemory s = productTotalMemory x := productActiveMemorySplit_total_memory S B x rw [Fintype.sum_sigma] simp only [fullActiveEdgeEventWeight, fullActiveEdgeEventTarget, Complex.ofReal_mul] change (∑ a : A c, ∑ e : UnrestrictedJointEvent n (Δ c a) (D c a) (fun g => (S g)ᶜ.card) B s, (ω c a : ℂ) * (unrestrictedJointCutoffEventWeight n (Δ c a) (D c a) μ ρ V (fun g => (S g)ᶜ.card) B s e : ℂ) * (if ∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅ then θ c a (fun g => (unrestrictedJointEventTarget n (Δ c a) (D c a) (fun g => (S g)ᶜ.card) B s e g).1) else 0) * F a (unrestrictedJointEventTarget n (Δ c a) (D c a) (fun g => (S g)ᶜ.card) B s e)) = _ simp only [mul_assoc, ← mul_sum] simp_rw [hrow] rw [htotal] split_ifs · apply sum_congr rfl intro a _ simp only [F, equivFiberSlice, Complex.ofReal_prod] apply congrArg (fun z : ℂ => (ω c a : ℂ) * ((∏ g, (unrestrictedBoundedCleanFactor (n g) (Δ c a g) ρ (s g) : ℂ)) * z)) apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro target _ rfl · simp only [mul_zero, sum_const_zero] end Bounty end section /- Pinned-prime kernels for one complete original ghost step, with its actual continuation. -/ open Finset Classical namespace Bounty section Ghost variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (μ : ∀ g, P g → ℝ) (q ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (sk : CoupledGhostSkeleton t B s) (i : CoupledGhostSampleIndex t B s sk) (p : P i.1) (F : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B → ℝ) end Ghost end Bounty end section /- Original sampled coordinates are exactly the performed positions in the fixed chronological order. -/ namespace Bounty section Paths variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : ∀ g, P g → ℕ) {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) end Paths end Bounty end section /- The actual physical schedule discharges the edge hypothesis of birth factorization. -/ open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Physical end Bounty end section /- Uniform length-weighted rows for the original joint and full auxiliary edge events. -/ open Finset Classical namespace Bounty theorem unrestricted_edge_row_bound_nonneg {ρ v vmin : ℝ} (hρ : ρ < 1) (hv : 0 ≤ v) (T : ℕ) : 0 ≤ unrestrictedEdgeRowBound ρ v vmin T := by unfold unrestrictedEdgeRowBound unrestrictedEdgeChoiceBound exact mul_nonneg (by positivity) (mul_nonneg (mul_nonneg (unrestrictedEdgeDampingBound_nonneg hρ T) (pow_nonneg hv _)) (by positivity)) theorem unrestricted_joint_length_row_le {G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) {ρ v vmin : ℝ} (V : G → ℝ) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : ∀ g, vmin ≤ V g) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (t : G → ℕ) (B T : ℕ) (ht : ∀ g, t g ≤ T) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : (∑ e : UnrestrictedJointEvent n Δ D t B s, |unrestrictedJointCutoffEventWeight n Δ D μ ρ V t B s e| * productLengthLyapunov v (unrestrictedJointEventTarget n Δ D t B s e)) ≤ productLengthLyapunov v s * unrestrictedEdgeRowBound ρ v vmin T ^ Fintype.card G := by have h := finite_product_gated_row_le (fun g => unrestrictedBoundedEventWeight (n g) (Δ g) (D g) (μ g) ρ (V g) (t g) B (s g)) (fun g e => v ^ (unrestrictedBoundedEventTarget (n g) (Δ g) (D g) (t g) B (s g) e).2.1.val) (fun _ _ => pow_nonneg (zero_lt_one.trans hv).le _) (fun g => v ^ (s g).2.1.val * unrestrictedEdgeRowBound ρ v vmin T) (fun g => unrestricted_bounded_length_row_le (n g) (Δ g) (D g) (μ g) hρ0 hρ1 hv hvmin (hV g) (hμ g) (hmass g) (t g) B T (ht g) (s g)) (fun e => productTotalMemory s ≤ B ∧ productTotalMemory (unrestrictedJointEventTarget n Δ D t B s e) ≤ B) simpa only [unrestrictedJointCutoffEventWeight, unrestrictedJointEventTarget, productLengthLyapunov, prod_mul_distrib, prod_const, card_univ] using h theorem full_active_edge_length_row_le {G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) {ρ v vmin : ℝ} (V : G → ℝ) (hω : ∀ c a, 0 ≤ ω c a) (hωmass : ∀ c, ∑ a, ω c a ≤ 1) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : ∀ g, vmin ≤ V g) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, (S g)ᶜ.card ≤ T) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : (∑ e : FullActiveEdgeEvent n S B A Δ D s, |fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V s e| * productLengthLyapunov v (fullActiveEdgeEventTarget n S B A Δ D s e)) ≤ productLengthLyapunov v s * unrestrictedEdgeRowBound ρ v vmin T ^ Fintype.card G := by let c := (productActiveMemorySplit S B s).1 let r := (productActiveMemorySplit S B s).2 have hL : 0 ≤ productLengthLyapunov v s * unrestrictedEdgeRowBound ρ v vmin T ^ Fintype.card G := mul_nonneg (productLengthLyapunov_nonneg (zero_lt_one.trans hv).le s) (pow_nonneg (unrestricted_edge_row_bound_nonneg hρ1 (zero_lt_one.trans hv).le T) _) rw [Fintype.sum_sigma] simp only [fullActiveEdgeEventWeight, abs_mul, fullActiveEdgeEventTarget, productLengthLyapunov_reassemble, abs_of_nonneg (hω _ _), mul_assoc, ← mul_sum] calc _ ≤ ∑ a : A c, ω c a * (productLengthLyapunov v r * unrestrictedEdgeRowBound ρ v vmin T ^ Fintype.card G) := by apply sum_le_sum intro a _ exact mul_le_mul_of_nonneg_left (unrestricted_joint_length_row_le n (Δ c a) (D c a) μ V hρ0 hρ1 hv hvmin hV hμ hmass (fun g => (S g)ᶜ.card) B T ht r) (hω c a) _ = (∑ a : A c, ω c a) * (productLengthLyapunov v s * unrestrictedEdgeRowBound ρ v vmin T ^ Fintype.card G) := by rw [← sum_mul, productLengthLyapunov_split] _ ≤ _ := by simpa only [one_mul] using mul_le_mul_of_nonneg_right (hωmass c) hL end Bounty end section /- The actual physical ghost coefficients satisfy the length-weighted row estimate. -/ open Finset Classical namespace Bounty theorem physical_ghost_length_damping {P : Type*} (n : P → ℕ) (q ρ v : ℝ) (hq1 : q ≤ 1) (hρ : 0 < ρ) (hv : 0 < v) (hD : q / ρ ^ 2 + ((1 - q) / ρ) / v ≤ 1) (z : UnrestrictedResidueParticle n) : physicalGhostRetention n q ρ z * v + |physicalGhostTermination n q ρ z| ≤ v := by have hd : 0 ≤ (1 - q) / ρ := div_nonneg (sub_nonneg.mpr hq1) hρ.le unfold physicalGhostRetention physicalGhostTermination split_ifs · rw [abs_neg, abs_of_nonneg hd] have h := mul_le_mul_of_nonneg_right hD hv.le rwa [add_mul, div_mul_cancel₀ _ hv.ne', one_mul] at h · simp theorem physical_bounded_ghost_length_row_le {P : Type*} [Fintype P] (n : P → ℕ) [∀ p, NeZero (n p)] (μ : P → ℝ) (q ρ V v : ℝ) (hμ : ∀ p, 0 ≤ μ p) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hρ : 0 < ρ) (hv : 0 < v) (hD : q / ρ ^ 2 + ((1 - q) / ρ) / v ≤ 1) (t B : ℕ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) : (∑ e : BoundedGhostEvent t B s, |boundedGhostEventWeight (physicalGhostRetention n q ρ) (physicalGhostTermination n q ρ) (physicalGhostBirth n q ρ V) (unrestrictedResidueWeight μ) t B s e| * v ^ (boundedGhostEventTarget t B s e).2.1.val) ≤ Real.exp ((|(1 - q) * V / ρ| * ∑ p, μ p) * v) * v ^ s.2.1.val := by have hA : ∀ z, 0 ≤ physicalGhostRetention n q ρ z := by intro z unfold physicalGhostRetention split_ifs · exact div_nonneg hq0 (sq_nonneg _) · exact zero_le_one have h := bounded_ghost_length_row_le (physicalGhostRetention n q ρ) (physicalGhostTermination n q ρ) (physicalGhostBirth n q ρ V) (unrestrictedResidueWeight μ) v hA (fun z => hμ z.1) hv.le (physical_ghost_length_damping n q ρ v hq1 hρ hv hD) t B s change _ ≤ Real.exp ((∑ z, physicalGhostBirthAtom n μ q ρ V z) * v) * v ^ s.2.1.val at h rw [physical_ghost_birth_atom_total] at h exact h theorem coupled_physical_ghost_length_row_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (μ : ∀ g, P g → ℝ) (q ρ v : ℝ) (V : G → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hρ : 0 < ρ) (hv : 0 < v) (hD : q / ρ ^ 2 + ((1 - q) / ρ) / v ≤ 1) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : (∑ e : CoupledGhostEvent t B s, |coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) (fun g => physicalGhostBirth (n g) q ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) t B s e| * productLengthLyapunov v (coupledGhostJointEventTarget t B s e)) ≤ (∏ g, Real.exp ((|(1 - q) * V g / ρ| * ∑ p, μ g p) * v)) * productLengthLyapunov v s := by have h := finite_product_gated_row_le (fun g => boundedGhostEventWeight (physicalGhostRetention (n g) q ρ) (physicalGhostTermination (n g) q ρ) (physicalGhostBirth (n g) q ρ (V g)) (unrestrictedResidueWeight (μ g)) (t g) B (s g)) (fun g e => v ^ (boundedGhostEventTarget (t g) B (s g) e).2.1.val) (fun _ _ => pow_nonneg hv.le _) (fun g => Real.exp ((|(1 - q) * V g / ρ| * ∑ p, μ g p) * v) * v ^ (s g).2.1.val) (fun g => physical_bounded_ghost_length_row_le (n g) (μ g) q ρ (V g) v (hμ g) hq0 hq1 hρ hv hD (t g) B (s g)) (fun e => productTotalMemory s ≤ B ∧ productTotalMemory (coupledGhostJointEventTarget t B s e) ≤ B) simpa only [coupledGhostJointEventWeight, coupledGhostJointEventTarget, productLengthLyapunov, prod_mul_distrib] using h end Bounty end section /- Pinning current birth primes leaves the length potential unchanged at a fixed original skeleton. -/ open Finset namespace Bounty theorem productLengthLyapunov_ghost_skeleton {G : Type*} [Fintype G] {P Z : G → Type*} (t : G → ℕ) (B : ℕ) (v : ℝ) (s : ProductBoundedOrderedState P Z t B) (sk : CoupledGhostSkeleton t B s) (births : CoupledGhostSamples t B s sk) : productLengthLyapunov v (coupledGhostJointEventTarget t B s ((coupledGhostSkeletonEquiv t B s).symm ⟨sk, births⟩)) = v ^ (∑ g, boundedGhostSkeletonOutputCount (t g) B (s g) (sk g).1 (sk g).2) := by rw [productLengthLyapunov_eq_total, coupled_ghost_skeleton_target_memory] theorem productLengthLyapunov_edge_skeleton {G : Type*} [Fintype G] {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (v : ℝ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n S B A Δ D s) (fresh : FullActiveEdgeSamples n S B A Δ D s sk) : productLengthLyapunov v (fullActiveEdgeEventTarget n S B A Δ D s ((fullActiveEdgeSkeletonEquiv n S B A Δ D s).symm ⟨sk, fresh⟩)) = v ^ (∑ g, unrestrictedSkeletonOutputCount (n g) (Δ (productActiveMemorySplit S B s).1 sk.1 g) (D (productActiveMemorySplit S B s).1 sk.1 g) (S g)ᶜ.card B ((productActiveMemorySplit S B s).2 g) (sk.2 g)) := by unfold fullActiveEdgeEventTarget rw [productLengthLyapunov_reassemble, productLengthLyapunov_eq_total] rcases sk with ⟨a, sk⟩ exact congrArg (fun m : ℕ => v ^ m) (full_active_edge_skeleton_target_memory n S B A Δ D s ⟨a, sk⟩ fresh) end Bounty end section /- The fixed initial ledger costs only a rare fresh-target perturbation. Auxiliary draws are untouched. Endpoint permutation averages contract the same full product norm, with no shared-fiber dimension factor. -/ open Finset open scoped Classical namespace Bounty theorem clean_initial_birth_kernel_norm_le {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (F : ∀ g, Finset (P g)) (C : G → Finset (Fin J)) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) (x y : RepeatedBigLists P J ell) (a : PhysicalAuxLabels P C) : ‖cleanInitialBirthKernel F C K x y a‖ ≤ B := by unfold cleanInitialBirthKernel split_ifs · exact hK x y a · simpa only [norm_zero] using hB theorem repeated_big_initial_birth_unbanned_error {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (F : ∀ g, Finset (P g)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (f : RepeatedBigLists P J ell → ℂ) : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigUnbannedRowAction V C ζ K f - repeatedBigUnbannedRowAction V C ζ (cleanInitialBirthKernel F C K) f) ≤ (B * Real.sqrt (repeatedBigInitialForbiddenProbability (ell := ell) V C F Pmin)) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f := by have h := repeated_big_unbanned_target_mask_norm V C hV hMass ζ K B hB hK (repeatedBigFreshHits F C) (repeatedBigInitialForbiddenProbability (ell := ell) V C F Pmin) (repeatedBigInitialForbiddenProbability_nonneg (ell := ell) V C F (fun g => (hV g).le) hPmin.le) (fun x => by apply le_of_eq_of_le _ (repeated_big_initial_forbidden_target_mass_le V C F hV hMass hPmin hp x) apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro y _ by_cases hc : repeatedBigSharedCompatible C x y <;> simp only [hc, ↓reduceIte, zero_mul]) f have he : repeatedBigUnbannedRowAction V C ζ K f - repeatedBigUnbannedRowAction V C ζ (cleanInitialBirthKernel F C K) f = repeatedBigUnbannedRowAction V C ζ (fun x y a => if repeatedBigFreshHits F C y then K x y a else 0) f := by funext x simp only [Pi.sub_apply, repeatedBigUnbannedRowAction] rw [← sum_sub_distrib] apply sum_congr rfl intro y _ rw [← sub_mul, ← sum_sub_distrib] congr 1 apply sum_congr rfl intro a _ by_cases ha : cleanInitialBirthAllowed F C y <;> simp [repeatedBigUnbannedKernel, cleanInitialBirthKernel, repeated_big_fresh_hits_iff_not_allowed, ha] rw [he] exact h section variable {I G : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : I → G → Finset (Fin J)) (F : ∀ g, Finset (P g)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (c : I → ℂ) (B : I → ℝ) (hB : ∀ i, 0 ≤ B i) (hK : ∀ i x y a, ‖K i x y a‖ ≤ B i) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) include I G sharedInstance1 sharedInstance2 P J ell V C F hV hMass ζ K c B hB hK Pmin hPmin hp end end Bounty end section /- A fixed initial forbidden set tests the same actual fresh draws in the physical and canonical slot orders. Auxiliary labels are not tested. -/ open Finset open scoped Classical namespace Bounty theorem physical_clean_initial_fresh_reindex {G : Type*} (P : G → Type*) {J ell : ℕ} (F : ∀ g, Finset (P g)) (C : G → Finset (Fin J)) (fresh : ∀ g, Fin ((physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) → P g) : (∀ g i, physicalCleanFreshEquiv P C fresh g i ∉ F g) ↔ ∀ g i, fresh g i ∉ F g := by constructor · intro h g i have hi := h g (physicalCleanFreshIndex C g i) simpa only [physicalCleanFreshEquiv_apply_index] using hi · intro h g i obtain ⟨j, rfl⟩ := (physicalCleanFreshIndex C g).surjective i simpa only [physicalCleanFreshEquiv_apply_index] using h g j /- Under the clean event mask, canonical target avoidance is literally the initial-forbidden-set test on the original physical event's fresh draws. -/ theorem physical_clean_initial_event_gate {G : Type*} {P : G → Finset ℕ} {J ell B : ℕ} (F : ∀ g, Finset (P g)) (C : G → Finset (Fin J)) (Δ D : G → ℤ) (s : ProductBoundedOrderedState (fun g => ↥(P g)) (fun g => UnrestrictedResidueParticle (fun p : P g => p.val)) (fun g => (physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) B) (e : UnrestrictedJointEvent (fun g (p : P g) => p.val) Δ D (fun g => (physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) B s) (z : ℂ) : (if ∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅ then if ∀ g i, physicalCleanFreshEquiv (fun g => ↥(P g)) C (fun g => (unrestrictedJointEventTarget (fun g (p : P g) => p.val) Δ D (fun g => (physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) B s e g).1) g i ∉ F g then z else 0 else 0) = if (∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅) ∧ (∀ g i, (e g).2.2.2 i ∉ F g) then z else 0 := by by_cases he : ∀ g, (e g).1 = ∅ ∧ (e g).2.1 = ∅ · rw [if_pos he, physical_clean_initial_fresh_reindex] have hi : (∀ g i, (unrestrictedJointEventTarget (fun g (p : P g) => p.val) Δ D (fun g => (physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) B s e g).1 i ∉ F g) ↔ ∀ g i, (e g).2.2.2 i ∉ F g := by exact forall_congr' fun g => unrestricted_clean_fresh_allowed (F g) (fun p : P g => p.val) (Δ g) (D g) _ B (s g) (e g) (he g) rw [hi] simp [he] · simp only [he, false_and, ↓reduceIte] end Bounty end section /- The full edge reindex keeps its shared labels and auxiliary draw unchanged. -/ open Finset Classical namespace Bounty section Full variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (τ : ∀ g, Equiv.Perm (Fin (s g).2.1.val)) noncomputable def fullEdgeMemoryReindex : FullActiveEdgeEvent n S B A Δ D s ≃ FullActiveEdgeEvent n S B A Δ D (productMemoryReindex s τ) := Equiv.sigmaCongrRight fun a => jointEdgeMemoryReindex n (Δ (productActiveMemorySplit S B s).1 a) (D (productActiveMemorySplit S B s).1 a) (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B s).2 τ omit [DecidableEq G] in theorem full_edge_reindex_weight (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (e : FullActiveEdgeEvent n S B A Δ D s) : fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V (productMemoryReindex s τ) (fullEdgeMemoryReindex n S B A Δ D s τ e) = fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V s e := by exact congrArg (fun w => ω (productActiveMemorySplit S B s).1 e.1 * w) (joint_edge_reindex_weight n _ _ (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B s).2 τ μ ρ V e.2) theorem full_edge_reindex_test (e : FullActiveEdgeEvent n S B A Δ D s) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) (hf : ProductMemorySymmetric f) : f (fullActiveEdgeEventTarget n S B A Δ D (productMemoryReindex s τ) (fullEdgeMemoryReindex n S B A Δ D s τ e)) = f (fullActiveEdgeEventTarget n S B A Δ D s e) := by exact joint_edge_reindex_test n _ _ (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B s).2 τ e.2 (equivFiberSlice (productActiveMemorySplit S B) f (productActiveMemorySplit S B s).1) (productActiveMemorySlice_symmetric S B f hf _) omit [Fintype G] [DecidableEq G] in theorem full_edge_reindex_active (e : FullActiveEdgeEvent n S B A Δ D s) (g : G) : (fullActiveEdgeEventTarget n S B A Δ D (productMemoryReindex s τ) (fullEdgeMemoryReindex n S B A Δ D s τ e) g).1 = (fullActiveEdgeEventTarget n S B A Δ D s e g).1 := by exact congrArg (fun a => (activeTupleSplit (S g)).symm ((productActiveMemorySplit S B s).1 g, a)) (joint_edge_reindex_active n _ _ (fun g => (S g)ᶜ.card) B (productActiveMemorySplit S B s).2 τ e.2 g) end Full end Bounty end section /- Birth sample coordinates embed into the unchanged global chronological address set. -/ open Classical namespace Bounty section Occurrence variable {J K : Type*} {N : ℕ} {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) noncomputable def fullMixedOccurrenceAddressEmbedding : FullMixedLocalBirthAddress S B (steps.get u) ↪ Fin (Fintype.card (FullMixedBirthAddress S B steps)) where toFun a := (fullMixedBirthOrder S B steps).symm ⟨u, a⟩ inj' := by intro a b h have he := (fullMixedBirthOrder S B steps).symm.injective h simpa only [Sigma.mk.inj_iff, heq_eq_eq, true_and] using he theorem full_mixed_occurrence_address_owner (a : FullMixedLocalBirthAddress S B (steps.get u)) : fullMixedBirthOwner S B steps (fullMixedBirthOrder S B steps (fullMixedOccurrenceAddressEmbedding S B steps u a)) = u := by change fullMixedBirthOwner S B steps ((fullMixedBirthOrder S B steps) ((fullMixedBirthOrder S B steps).symm ⟨u, a⟩)) = u rw [Equiv.apply_symm_apply] rfl end Occurrence section Samples variable {J K : Type*} {N : ℕ} {P Z : Fin N → Type*} {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) noncomputable def coupledGhostLocalSampleEmbedding (j : J) (s : ProductBoundedOrderedState P Z M B) (sk : CoupledGhostSkeleton M B s) : CoupledGhostSampleIndex M B s sk ↪ FullMixedLocalBirthAddress S B (some (.inl j)) where toFun i := ⟨i.1, ⟨i.2.val, lt_of_lt_of_le i.2.isLt (Nat.le_of_lt_succ (sk i.1).1.isLt)⟩⟩ inj' := by rintro ⟨g, a⟩ ⟨h, b⟩ he simp only [Sigma.mk.inj_iff] at he rcases he with ⟨rfl, he⟩ have hv := congrArg Fin.val (eq_of_heq he) have hab : a = b := Fin.ext hv subst b rfl noncomputable def fullEdgeLocalSampleEmbedding (n : ∀ g, P g → ℕ) (k : K) (A : SharedActiveLabels P (S k) → Type*) (Δ D : ∀ c, A c → Fin N → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n (S k) B A Δ D s) : FullActiveEdgeSampleIndex n (S k) B A Δ D s sk ↪ FullMixedLocalBirthAddress S B (some (.inr k) : Option (J ⊕ K)) where toFun i := ⟨i.1, i.2.val⟩ inj' := by rintro ⟨g, a⟩ ⟨h, b⟩ he change (⟨g, a.val⟩ : (g : Fin N) × Fin (S k g)ᶜ.card) = ⟨h, b.val⟩ at he simp only [Sigma.mk.inj_iff] at he rcases he with ⟨rfl, he⟩ have hab : a = b := Subtype.ext (eq_of_heq he) subst b rfl end Samples end Bounty end section /- A performed parent outside the current owner fiber lies strictly in the past. -/ namespace Bounty theorem restricted_birth_external_parent_owner_lt {N m L : ℕ} (embed : Fin m → Fin N) (hstrict : StrictMono embed) (owner : Fin N → Fin L) (hmono : Monotone owner) (u : Fin L) (howner : ∀ j, owner (embed j) = u) (performed : Fin N → Prop) (hcover : ∀ i, performed i → owner i = u → i ∈ Set.range embed) (j : Fin m) (p : Fin (embed j).val) (hp : performed (birthForestParentEmbedding (embed j) p)) (he : ¬ ∃ k : Fin j.val, embed (birthForestParentEmbedding j k) = birthForestParentEmbedding (embed j) p) : owner (birthForestParentEmbedding (embed j) p) < u := by have hle : owner (birthForestParentEmbedding (embed j) p) ≤ u := by rw [← howner j] exact hmono (show birthForestParentEmbedding (embed j) p ≤ embed j from Nat.le_of_lt p.isLt) apply lt_of_le_of_ne hle intro hu exact restricted_birth_parent_not_in_range embed hstrict j p he (hcover _ hp hu) theorem restricted_birth_anchors_past_local {N m L : ℕ} {α : Type*} (embed : Fin m → Fin N) (hstrict : StrictMono embed) (owner : Fin N → Fin L) (hmono : Monotone owner) (u : Fin L) (howner : ∀ j, owner (embed j) = u) (performed : Fin N → Prop) (hcover : ∀ i, performed i → owner i = u → i ∈ Set.range embed) (code : BirthForestCode N) (hparents : ∀ j p, code (embed j) = some p → performed (birthForestParentEmbedding (embed j) p)) (values other : Fin N → α) (hpast : ∀ i, owner i < u → values i = other i) : restrictedBirthAnchors embed code values = restrictedBirthAnchors embed code other := by funext j cases hc : code (embed j) with | none => simp only [restrictedBirthAnchors, hc] | some p => by_cases he : ∃ k : Fin j.val, embed (birthForestParentEmbedding j k) = birthForestParentEmbedding (embed j) p · simp only [restrictedBirthAnchors, hc, if_pos he] · simp only [restrictedBirthAnchors, hc, if_neg he] congr 1 exact hpast _ (restricted_birth_external_parent_owner_lt embed hstrict owner hmono u howner performed hcover j p (hparents j p hc) he) end Bounty end section /- Local phase products along the original schedule and its four-step edge positions. -/ open Finset open scoped Classical namespace Bounty theorem finite_schedule_local_phase_product {X : Type*} (E : ℕ → X → Type*) (target : ∀ i x, E i x → X) (phase : ∀ i x, E i x → ℂ) (m : ℕ) (x : X) (p : FiniteEventPath E target (List.range m) x) : finiteEventLocalPhase E target phase (List.range m) x p = ∏ i : Fin m, phase i.val (finiteScheduleOccurrence E target m x p i).1 (finiteScheduleOccurrence E target m x p i).2 := by rw [finite_event_local_phase_occurrences] let F : Fin m → ℂ := fun i => phase i.val (finiteScheduleOccurrence E target m x p i).1 (finiteScheduleOccurrence E target m x p i).2 change _ = ∏ i : Fin m, F i rw [← (finCongr (show (List.range m).length = m from List.length_range)).prod_comp F] apply prod_congr rfl intro i _ exact (finite_schedule_occurrence_apply E target phase m x p ((finCongr (show (List.range m).length = m from List.length_range)) i)).symm theorem four_step_sparse_product (n : ℕ) (f : Fin (4 * n + 1) → ℂ) (hf : ∀ i, i.val % 4 ≠ 2 → f i = 1) : (∏ i : Fin (4 * n + 1), f i) = ∏ j : Fin n, f ⟨4 * j.val + 2, by have := j.isLt; omega⟩ := by symm apply prod_bij_ne_one (fun j _ _ => (⟨4 * j.val + 2, by have := j.isLt; omega⟩ : Fin (4 * n + 1))) · intros; exact mem_univ _ · intro a _ _ b _ _ hab apply Fin.ext have hv := congrArg Fin.val hab dsimp only at hv omega · intro i _ hi have hm : i.val % 4 = 2 := by by_contra h exact hi (hf i h) let j : Fin n := ⟨i.val / 4, by have := i.isLt; omega⟩ have he : (⟨4 * j.val + 2, by have := j.isLt; omega⟩ : Fin (4 * n + 1)) = i := by apply Fin.ext dsimp only [j] omega refine ⟨j, mem_univ _, ?_, he⟩ simpa only [he] using hi · intros; rfl end Bounty end section /- The original ghost skeleton sum pays one atom for each fixed marked birth and no address-count factor. -/ open Finset Classical namespace Bounty theorem bounded_ghost_marked_coefficient_le {P Z : Type*} (A D : Z → ℝ) (hA : ∀ z, 0 ≤ A z) (ℓ ε v : ℝ) (hℓ : 0 ≤ ℓ) (hε : 0 ≤ ε) (hv : 0 ≤ v) (t B d : ℕ) (s : BoundedOrderedState P Z t B) (b : Fin (B + 1)) (r : Finset (Fin s.2.1.val)) : (if d ≤ b.val then boundedGhostSkeletonAbsMass A D t B s b r * v ^ boundedGhostSkeletonOutputCount t B s b r * ε ^ d * ℓ ^ (b.val - d) else 0) ≤ (((∏ i ∈ r, A (s.2.2 i)) * (∏ i ∈ univ \ r, |D (s.2.2 i)|)) * v ^ r.card) * (if d ≤ b.val then ε ^ d * ℓ ^ (b.val - d) * v ^ b.val / (b.val.factorial : ℝ) else 0) := by by_cases hd : d ≤ b.val · simp only [hd, if_true] by_cases hc : r.card + b.val ≤ B · simp only [boundedGhostSkeletonAbsMass, boundedGhostSkeletonOutputCount, hc, if_true] rw [abs_div, abs_mul, abs_of_nonneg (prod_nonneg fun i _ => hA _), abs_prod, abs_of_nonneg (Nat.cast_nonneg _), pow_add] exact (by ring : _ = _).le · simp only [boundedGhostSkeletonAbsMass, hc, if_false, zero_mul] exact mul_nonneg (mul_nonneg (mul_nonneg (prod_nonneg fun i _ => hA _) (prod_nonneg fun i _ => abs_nonneg _)) (pow_nonneg hv _)) (div_nonneg (mul_nonneg (mul_nonneg (pow_nonneg hε _) (pow_nonneg hℓ _)) (pow_nonneg hv _)) (Nat.cast_nonneg _)) · simp only [hd, if_false, mul_zero, le_refl] theorem bounded_ghost_marked_length_row_le {P Z : Type*} (A D : Z → ℝ) (hA : ∀ z, 0 ≤ A z) (ℓ ε v : ℝ) (hℓ : 0 ≤ ℓ) (hε : 0 ≤ ε) (hv : 0 ≤ v) (hdamp : ∀ z, A z * v + |D z| ≤ v) (t B d : ℕ) (s : BoundedOrderedState P Z t B) : (∑ b : Fin (B + 1), ∑ r : Finset (Fin s.2.1.val), if d ≤ b.val then boundedGhostSkeletonAbsMass A D t B s b r * v ^ boundedGhostSkeletonOutputCount t B s b r * ε ^ d * ℓ ^ (b.val - d) else 0) ≤ (ε * v) ^ d * Real.exp (ℓ * v) * v ^ s.2.1.val := by have hret : 0 ≤ ∏ i : Fin s.2.1.val, (A (s.2.2 i) * v + |D (s.2.2 i)|) := prod_nonneg fun i _ => add_nonneg (mul_nonneg (hA _) hv) (abs_nonneg _) calc _ ≤ ∑ b : Fin (B + 1), ∑ r : Finset (Fin s.2.1.val), (((∏ i ∈ r, A (s.2.2 i)) * (∏ i ∈ univ \ r, |D (s.2.2 i)|)) * v ^ r.card) * (if d ≤ b.val then ε ^ d * ℓ ^ (b.val - d) * v ^ b.val / (b.val.factorial : ℝ) else 0) := by apply sum_le_sum intro b _ exact sum_le_sum fun r _ => bounded_ghost_marked_coefficient_le A D hA ℓ ε v hℓ hε hv t B d s b r _ = (∏ i : Fin s.2.1.val, (A (s.2.2 i) * v + |D (s.2.2 i)|)) * ∑ b ∈ range (B + 1), if d ≤ b then ε ^ d * ℓ ^ (b - d) * v ^ b / (b.factorial : ℝ) else 0 := by simp_rw [← sum_mul, ghost_retention_length_sum] rw [← mul_sum, Fin.sum_univ_eq_sum_range (fun b => if d ≤ b then ε ^ d * ℓ ^ (b - d) * v ^ b / (b.factorial : ℝ) else 0) (B + 1)] _ ≤ (∏ i : Fin s.2.1.val, (A (s.2.2 i) * v + |D (s.2.2 i)|)) * ((ε * v) ^ d * Real.exp (ℓ * v)) := mul_le_mul_of_nonneg_left (marked_ghost_series_le ℓ ε v hℓ hε hv B d) hret _ ≤ v ^ s.2.1.val * ((ε * v) ^ d * Real.exp (ℓ * v)) := by apply mul_le_mul_of_nonneg_right _ (mul_nonneg (pow_nonneg (mul_nonneg hε hv) _) (Real.exp_pos _).le) rw [← Fin.prod_const] exact prod_le_prod₀ (fun i _ => add_nonneg (mul_nonneg (hA _) hv) (abs_nonneg _)) (fun i _ => hdamp _) _ = _ := by ring end Bounty end section /- Static selected-child counts agree with performed sample counts when all selected children are covered. -/ open Finset Classical namespace Bounty theorem selected_fiber_card {G : Type*} [DecidableEq G] {I : G → Type*} [∀ g, Fintype (I g)] {J : Type*} [Fintype J] (f : Sigma I ↪ J) (owner selected : J → Prop) [DecidablePred owner] [DecidablePred selected] (group : J → G) (howner : ∀ c, owner (f c)) (hgroup : ∀ c, group (f c) = c.1) (hcover : ∀ j, owner j → selected j → ∃ c, f c = j) (g : G) : (univ.filter (fun i : I g => selected (f ⟨g, i⟩))).card = (univ.filter (fun j => owner j ∧ group j = g ∧ selected j)).card := by apply card_bij (fun i _ => f ⟨g, i⟩) · intro i hi simp only [mem_filter, mem_univ, true_and] at hi ⊢ exact ⟨howner _, hgroup _, hi⟩ · intro a ha b hb hab have he := f.injective hab simpa only [Sigma.mk.inj_iff, heq_eq_eq, true_and] using he · intro j hj simp only [mem_filter, mem_univ, true_and] at hj obtain ⟨⟨h, c⟩, hc⟩ := hcover j hj.1 hj.2.2 have hh : h = g := by exact (hgroup ⟨h, c⟩).symm.trans ((congrArg group hc).trans hj.2.1) subst h refine ⟨c, ?_, hc⟩ simp only [mem_filter, mem_univ, true_and] rw [hc] exact hj.2.2 theorem restricted_birth_selected_iff {N m : ℕ} {α : Type*} (embed : Fin m → Fin N) (code : BirthForestCode N) (values : Fin N → α) (j : Fin m) : (restrictedBirthCode embed code j ≠ none ∨ restrictedBirthAnchors embed code values j ≠ none) ↔ code (embed j) ≠ none := by cases hc : code (embed j) with | none => simp [restrictedBirthCode, restrictedBirthAnchors, hc] | some p => by_cases he : ∃ k : Fin j.val, embed (birthForestParentEmbedding j k) = birthForestParentEmbedding (embed j) p · simp [restrictedBirthCode, restrictedBirthAnchors, hc, he] · simp [restrictedBirthCode, restrictedBirthAnchors, hc, he] end Bounty end section /- A reverse eligibility probability bounds the actual averaged storage-only operator. Choice-dependent external translations are transposed by inversion, and the proved per-choice energy constant is unchanged. -/ open Finset Classical namespace Bounty section variable {A G R : Type*} [Fintype A] [Fintype G] [Fintype R] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : A → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (π : A → ℝ) (τ : A → R ≃ R) end end Bounty end section /- The original labeled scalar splits with both exact permutation normalizations. -/ open scoped Classical namespace Bounty end Bounty end section /- Arbitrary logarithmic error bounds for the ordinary prime-number theorem. -/ open Filter Asymptotics section open Complex MeasureTheory Set Filter open scoped Topology namespace Bounty.OrdinaryZetaBounds theorem lower_re_two (s : ℂ) (hs : s.re = 2) : 1 / 3 ≤ ‖riemannZeta s‖ := by let f : ℕ → ℂ := fun n => ArithmeticFunction.moebius n have hb := OAI.Ostmann.lSeries_norm_bound_re_two f (fun n _ => by dsimp [f]; norm_cast; exact ArithmeticFunction.abs_moebius_le_one) s hs have he : riemannZeta s * LSeries f s = 1 := by have hsr : 1 < s.re := by rw [hs]; norm_num rw [← LSeries_one_eq_riemannZeta hsr] exact LSeries_one_mul_Lseries_moebius hsr have hn := congrArg norm he rw [norm_mul, norm_one] at hn have hpi : Real.pi ^ 2 / 6 ≤ 3 := by nlinarith [Real.pi_lt_four, Real.pi_pos] have hm := mul_le_mul_of_nonneg_left (hb.trans hpi) (norm_nonneg (riemannZeta s)) rw [hn] at hm linarith theorem upper (s : ℂ) (hre : 1 / 2 ≤ s.re) (him : 1 ≤ |s.im|) : ‖riemannZeta s‖ ≤ 3 + 2 * ‖s‖ := by have hs0 : s ≠ 0 := by intro h; norm_num [h] at hre have hs1 : s ≠ 1 := by intro h; norm_num [h] at him have hsrepr : (s.re : ℂ) + s.im * I = s := by apply Complex.ext <;> simp have hint := ZetaBnd_aux1b 1 (by norm_num) (σ := s.re) (t := s.im) (show 0 < s.re by linarith) simp only [Nat.cast_one, Real.one_rpow, hsrepr] at hint have hden : 1 ≤ ‖1 - s‖ := by have h := Complex.abs_im_le_norm (1 - s) simp only [sub_im, one_im, zero_sub, abs_neg] at h exact him.trans h have hnorm : ‖(-1 : ℂ) / (1 - s)‖ ≤ 1 := by rw [norm_div, norm_neg, norm_one] exact (div_le_one (by linarith)).mpr hden rw [← Zeta0EqZeta (N := 1) (by norm_num) (by linarith) hs1, riemannZeta0] simp only [Finset.sum_range_succ, Finset.sum_range_zero, zero_add, Nat.cast_zero, Nat.cast_one, Complex.zero_cpow hs0, div_zero, Complex.one_cpow, div_one, zero_add] have h := norm_add_le ((1 : ℂ) + -1 / (1 - s) + -1 / 2) (s * ∫ x in Ioi (1 : ℝ), (⌊x⌋ + 1 / 2 - x) / (x : ℂ) ^ (s + 1)) have h1 := norm_add_le ((1 : ℂ) + -1 / (1 - s)) (-1 / 2) have h2 := norm_add_le (1 : ℂ) (-1 / (1 - s)) have hmul := mul_le_mul_of_nonneg_left hint (norm_nonneg s) have hinv : 1 / s.re ≤ 2 := (div_le_iff₀ (by linarith)).mpr (by linarith) have hmul2 := mul_le_mul_of_nonneg_left hinv (norm_nonneg s) norm_num [norm_mul] at h h1 h2 hnorm ⊢ nlinarith theorem logDeriv_bound (s : ℂ) (hre : (47 / 48 : ℝ) ≤ s.re) (hre2 : s.re ≤ 2) (him : 3 < |s.im|) : ‖logDeriv riemannZeta s‖ ≤ 19200 * Real.log (24 * (|s.im| + 2)) := by let c : ℂ := 2 + s.im * I let g : ℂ → ℂ := fun z => riemannZeta (z + c) let A : ℝ := Real.log (24 * (|s.im| + 2)) have hc : c.re = 2 := by simp [c] have hci : c.im = s.im := by simp [c] have hne1 (z : ℂ) (hz : z ∈ Metric.ball 0 (25 / 24 : ℝ)) : z + c ≠ 1 := by have hn : ‖z‖ < 25 / 24 := by simpa only [Metric.mem_ball, dist_zero_right] using hz have hi := Complex.abs_im_le_norm z intro h have hi0 := congrArg Complex.im h simp only [add_im, hci, one_im] at hi0 have : |s.im| = |z.im| := by rw [show s.im = -z.im by linarith, abs_neg] linarith have hrez (z : ℂ) (hz : z ∈ Metric.ball 0 (25 / 24 : ℝ)) : (23 / 24 : ℝ) < (z + c).re := by have hn : ‖z‖ < 25 / 24 := by simpa only [Metric.mem_ball, dist_zero_right] using hz have hl := (abs_le.mp (Complex.abs_re_le_norm z)).1 simp only [add_re, hc] linarith have hne (z : ℂ) (hz : z ∈ Metric.ball 0 (25 / 24 : ℝ)) : g z ≠ 0 := OAI.ShortDraft.riemannZeta_ne_zero_of_re_gt (z + c) (hrez z hz) (hne1 z hz) have hg : AnalyticOnNhd ℂ g (Metric.ball 0 (25 / 24 : ℝ)) := by intro z hz exact (analyticAt_riemannZeta (hne1 z hz)).comp (f := fun w : ℂ => w + c) (by fun_prop) have hnorm (z : ℂ) (hz : z ∈ Metric.ball 0 (25 / 24 : ℝ)) : ‖g z‖ ≤ 8 * (|s.im| + 2) := by have hn : ‖z‖ < 25 / 24 := by simpa only [Metric.mem_ball, dist_zero_right] using hz have hcN : ‖c‖ ≤ 2 + |s.im| := by simpa [c] using norm_add_le (2 : ℂ) ((s.im : ℂ) * I) have himz : 1 ≤ |(z + c).im| := by have hi := abs_add_le (z.im + s.im) (-z.im) have hid : z.im + s.im + -z.im = s.im := by ring rw [hid, abs_neg] at hi have hi2 := Complex.abs_im_le_norm z simp only [add_im, hci] linarith have hu := upper (z + c) (by linarith [hrez z hz]) himz have ha := norm_add_le z c dsimp only [g] linarith have hA : 0 < A := by apply Real.log_pos; linarith [abs_nonneg s.im] have hlog (z : ℂ) (hz : z ∈ Metric.ball 0 (25 / 24 : ℝ)) : Real.log ‖g z‖ - Real.log ‖g 0‖ ≤ A := by have h0 : 1 / 3 ≤ ‖g 0‖ := by simpa [g] using lower_re_two c hc have h0p : 0 < ‖g 0‖ := by linarith have hzp : 0 < ‖g z‖ := norm_pos_iff.mpr (hne z hz) rw [← Real.log_div (ne_of_gt hzp) (ne_of_gt h0p)] apply Real.log_le_log (div_pos hzp h0p) apply (div_le_iff₀ h0p).mpr have hm := mul_le_mul_of_nonneg_left h0 (show 0 ≤ 24 * (|s.im| + 2) by positivity) nlinarith [hnorm z hz] have hw : ‖s - c‖ ≤ (25 / 24 : ℝ) - 1 / 48 := by have he : s - c = ((s.re - 2 : ℝ) : ℂ) := by apply Complex.ext <;> simp [c] rw [he, norm_real, Real.norm_eq_abs, abs_of_nonpos (by linarith)] linarith have hb := Bounty.logDeriv_norm_le_margin_disk g (25 / 24) A (1 / 48) (by norm_num) hA (by norm_num) hg hne hlog (s - c) hw have hcomp : logDeriv g (s - c) = logDeriv riemannZeta s := by have hd := logDeriv_comp (f := riemannZeta) (g := fun z : ℂ => z + c) (x := s - c) (differentiableAt_riemannZeta (by simpa using hne1 (s-c) (by rw [Metric.mem_ball, dist_zero_right] linarith))) (by fun_prop) simpa [g, Function.comp_def] using hd rw [hcomp] at hb convert hb using 1 <;> dsimp [A] <;> ring end Bounty.OrdinaryZetaBounds end section /- A coefficient-level Riesz inversion shared by the principal and character cases. -/ open Complex MeasureTheory OAI.Ostmann open scoped Topology namespace Bounty theorem riesz_mean_eq_vertical_lseries (a : ℕ → ℂ) (ha0 : a 0 = 0) (X σ : ℝ) (hX : 0 < X) (hσ : 1 ≤ σ) (ha : LSeriesSummable a (σ : ℂ)) : (∑' n : ℕ, a n * rieszPrimeTest (n / X)) = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, LSeries a (rieszMellinLine σ t) * rieszVerticalWeight X σ t := by let F : ℕ → ℝ → ℂ := fun n t => LSeries.term a (rieszMellinLine σ t) n * rieszVerticalWeight X σ t have hnorm (n : ℕ) (t : ℝ) : ‖F n t‖ = ‖LSeries.term a (σ : ℂ) n‖ * ‖rieszVerticalWeight X σ t‖ := by simp [F, norm_mul, LSeries.norm_term_eq, rieszMellinLine] have hcont (n : ℕ) : Continuous (fun t => LSeries.term a (rieszMellinLine σ t) n) := by by_cases hn : n = 0 · subst n simp only [LSeries.term_zero] exact continuous_const · simp only [LSeries.term_of_ne_zero hn] exact continuous_const.div ((rieszMellinLine_continuous σ).const_cpow (.inl (by exact_mod_cast hn))) (fun _ => Complex.cpow_ne_zero_iff.mpr (.inl (by exact_mod_cast hn))) have hint (n : ℕ) : Integrable (F n) := by apply ((rieszVerticalWeight_integrable X σ hX hσ).norm.const_mul ‖LSeries.term a (σ : ℂ) n‖).mono' · exact ((hcont n).mul (rieszVerticalWeight_continuous X σ hX (by linarith))).aestronglyMeasurable · exact Filter.Eventually.of_forall (fun t => (hnorm n t).le) have hsum : Summable (fun n => ∫ t : ℝ, ‖F n t‖) := by apply (ha.norm.mul_right (∫ t : ℝ, ‖rieszVerticalWeight X σ t‖)).congr intro n simp only [hnorm, integral_const_mul] have hinv (n : ℕ) : ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, F n t) = a n * rieszPrimeTest (n / X) := by by_cases hn : n = 0 · subst n simp [F, ha0] have hnR : 0 < (n : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero hn have hkernel (t : ℝ) : F n t = a n * (((n : ℝ) / X : ℝ) : ℂ) ^ (-rieszMellinLine σ t) * rieszMellinKernel (rieszMellinLine σ t) := by dsimp only [F] rw [LSeries.term_of_ne_zero hn, rieszVerticalWeight, Complex.cpow_neg, Complex.ofReal_div, Complex.div_cpow_ofReal_nonneg hnR.le hX.le, inv_div] push_cast ring simp_rw [hkernel, mul_assoc] rw [integral_const_mul] have h := rieszPrimeTest_mellin_inversion σ ((n : ℝ) / X) hσ (div_pos hnR hX) change ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, (((n : ℝ) / X : ℝ) : ℂ) ^ (-rieszMellinLine σ t) * rieszMellinKernel (rieszMellinLine σ t)) = _ at h rw [← h] ring calc _ = ∑' n : ℕ, ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, F n t := tsum_congr (fun n => (hinv n).symm) _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∑' n : ℕ, ∫ t : ℝ, F n t := tsum_mul_left _ = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, ∑' n : ℕ, F n t := by rw [integral_tsum_of_summable_integral_norm hint hsum] _ = _ := by congr 1 apply integral_congr_ae filter_upwards with t exact tsum_mul_right noncomputable def ordinaryRieszMean (X : ℝ) : ℂ := ∑' n : ℕ, (ArithmeticFunction.vonMangoldt n : ℂ) * rieszPrimeTest (n / X) theorem ordinaryRieszMean_eq_vertical_logDerivative (X σ : ℝ) (hX : 0 < X) (hσ : 1 < σ) : ordinaryRieszMean X = ((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, (-logDeriv riemannZeta (rieszMellinLine σ t)) * rieszVerticalWeight X σ t := by rw [ordinaryRieszMean, riesz_mean_eq_vertical_lseries _ (by simp) X σ hX hσ.le (ArithmeticFunction.LSeriesSummable_vonMangoldt (by simpa using hσ))] congr 1 apply integral_congr_ae filter_upwards with t rw [ArithmeticFunction.LSeries_vonMangoldt_eq_deriv_riemannZeta_div (by simpa [rieszMellinLine] using hσ)] simp only [logDeriv_apply, neg_div] end Bounty end section /- Pole cancellation and Riesz contour estimates for the principal zeta function. The final bound has the explicit large-height zeta estimate as an argument; it is supplied by the separately checked fixed-region probe. -/ open Complex Set Filter MeasureTheory DirichletCharacter open scoped Topology namespace ThirdZetaContour noncomputable def regularizedZeta : ℂ → ℂ := LFunctionTrivChar₁ 1 theorem regularizedZeta_apply {s : ℂ} (hs : s ≠ 1) : regularizedZeta s = (s - 1) * riemannZeta s := by simp only [regularizedZeta, LFunctionTrivChar₁, Function.update_of_ne hs, LFunctionTrivChar, LFunction_modOne_eq] theorem regularizedZeta_ne_zero (s : ℂ) (hs : (23 / 24 : ℝ) < s.re) : regularizedZeta s ≠ 0 := by by_cases h : s = 1 · subst s exact LFunctionTrivChar₁_apply_one_ne_zero 1 · rw [regularizedZeta_apply h] exact mul_ne_zero (sub_ne_zero.mpr h) (OAI.ShortDraft.riemannZeta_ne_zero_of_re_gt s hs h) noncomputable def centeredLogDerivative (s : ℂ) : ℂ := -logDeriv regularizedZeta s theorem centeredLogDerivative_analytic : AnalyticOnNhd ℂ centeredLogDerivative {s : ℂ | (23 / 24 : ℝ) < s.re} := by intro s hs have hF : AnalyticAt ℂ regularizedZeta s := (differentiable_LFunctionTrivChar₁ 1).analyticAt s exact (hF.deriv.div hF (regularizedZeta_ne_zero s hs)).neg theorem centeredLogDerivative_eq {s : ℂ} (hs : s ≠ 1) (hre : (23 / 24 : ℝ) < s.re) : centeredLogDerivative s = -logDeriv riemannZeta s - 1 / (s - 1) := by have hn := OAI.ShortDraft.riemannZeta_ne_zero_of_re_gt s hre hs have hd : deriv regularizedZeta s = (s - 1) * deriv riemannZeta s + riemannZeta s := by simpa only [regularizedZeta, LFunctionTrivChar, LFunction_modOne_eq] using deriv_LFunctionTrivChar₁_apply_of_ne_one 1 hs simp only [centeredLogDerivative, logDeriv_apply, hd, regularizedZeta_apply hs] field_simp <;> ring theorem centeredRiesz_rectangle_zero (X : ℝ) (hX : 0 < X) (a b c d : ℝ) (ha : (23 / 24 : ℝ) < a) (hab : a ≤ b) : OAI.Ostmann.rectangleBoundaryIntegral (fun s => centeredLogDerivative s * OAI.Ostmann.rieszContourWeight X s) a b c d = 0 := by apply OAI.Ostmann.rectangleBoundaryIntegral_eq_zero intro s hs have hsa : a ≤ s.re := ((uIcc_of_le hab) ▸ hs.1).1 exact (centeredLogDerivative_analytic s (ha.trans_le hsa)).mul (OAI.Ostmann.rieszContourWeight_analyticAt X hX s (by linarith)) open OAI.Ostmann open scoped Interval theorem riesz_horizontal_bound (f : ℂ → ℂ) (X a b t M : ℝ) (hX : 1 ≤ X) (hab : a ≤ b) (ht : 0 < |t|) (hM : 0 ≤ M) (hb : ∀ σ ∈ Icc a b, ‖f ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M) : ‖∫ σ in a..b, f ((σ : ℂ) + (t : ℂ) * I) * rieszContourWeight X ((σ : ℂ) + (t : ℂ) * I)‖ ≤ (M * X ^ b / t ^ 2) * (b - a) := by have hXp : 0 < X := by linarith have hpoint : ∀ σ ∈ Ι a b, ‖f ((σ : ℂ) + (t : ℂ) * I) * rieszContourWeight X ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M * X ^ b / t ^ 2 := by intro σ hσ have hσ' : σ ∈ Icc a b := by have hh := uIoc_subset_uIcc hσ rwa [uIcc_of_le hab] at hh have hk := rieszMellinKernel_im_bound ((σ : ℂ) + (t : ℂ) * I) (by simpa using ht) simp only [Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, zero_add, sq_abs] at hk have hx : X ^ σ ≤ X ^ b := Real.rpow_le_rpow_of_exponent_le hX hσ'.2 rw [norm_mul, rieszContourWeight, norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos hXp] simp only [Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, mul_zero, Complex.ofReal_im, Complex.I_im, zero_mul, sub_zero, add_zero] have hh := mul_le_mul (hb σ hσ') (mul_le_mul hx hk (norm_nonneg _) (Real.rpow_nonneg hXp.le _)) (by positivity) hM exact hh.trans_eq (by ring) have hi := intervalIntegral.norm_integral_le_of_norm_le_const hpoint simpa only [abs_of_nonneg (sub_nonneg.mpr hab)] using hi theorem riesz_left_bound : ∃ K : ℝ, 0 < K ∧ ∀ (f : ℂ → ℂ) (X a T M : ℝ), 0 < X → 1 / 2 ≤ a → 0 ≤ M → (∀ t ∈ Icc (-T) T, ‖f (rieszMellinLine a t)‖ ≤ M) → ‖∫ t in Icc (-T) T, f (rieszMellinLine a t) * rieszVerticalWeight X a t‖ ≤ K * M * X ^ a := by let J := ∫ t : ℝ, rieszLineMajorant t have hJ : 0 ≤ J := integral_nonneg rieszLineMajorant_nonneg refine ⟨J + 1, by linarith, ?_⟩ intro f X a T M hX ha hM hb have hg : Integrable (fun t : ℝ => (M * X ^ a) * rieszLineMajorant t) := rieszLineMajorant_integrable.const_mul _ have hnorm : ‖∫ t in Icc (-T) T, f (rieszMellinLine a t) * rieszVerticalWeight X a t‖ ≤ ∫ t in Icc (-T) T, (M * X ^ a) * rieszLineMajorant t := by apply norm_integral_le_of_norm_le hg.integrableOn filter_upwards [ae_restrict_mem measurableSet_Icc] with t ht have hk := rieszMellinKernel_half_strip (rieszMellinLine a t) (by simpa [rieszMellinLine] using ha) simp only [rieszMellinLine, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, zero_add] at hk rw [norm_mul, rieszVerticalWeight_norm X a t hX] have hh := mul_le_mul (hb t ht) (mul_le_mul_of_nonneg_left hk (Real.rpow_nonneg hX.le a)) (by positivity) hM exact hh.trans_eq (by ring) have hfull := setIntegral_le_integral hg (Filter.Eventually.of_forall (fun t => mul_nonneg (by positivity) (rieszLineMajorant_nonneg t))) (s := Icc (-T) T) simp only [integral_const_mul] at hnorm hfull apply (hnorm.trans hfull).trans dsimp only [J] at hJ ⊢ nlinarith [mul_nonneg hM (Real.rpow_nonneg hX.le a)] theorem centeredRiesz_rectangle_bound : ∃ K : ℝ, 0 < K ∧ ∀ (X a b T M : ℝ), 1 ≤ X → (23 / 24 : ℝ) < a → a ≤ b → 0 < T → 0 ≤ M → (∀ z ∈ uIcc a b ×ℂ uIcc (-T) T, ‖centeredLogDerivative z‖ ≤ M) → ‖∫ t in -T..T, centeredLogDerivative (rieszMellinLine b t) * rieszVerticalWeight X b t‖ ≤ K * M * X ^ a + 2 * (M * X ^ b / T ^ 2) * (b - a) := by obtain ⟨K,hK,hleft⟩ := riesz_left_bound refine ⟨K,hK,?_⟩ intro X a b T M hX ha hab hT hM hb have hXp : 0 < X := by linarith have hpoint (σ t : ℝ) (hσ : σ ∈ Icc a b) (ht : t ∈ Icc (-T) T) : ‖centeredLogDerivative ((σ : ℂ) + (t : ℂ) * I)‖ ≤ M := by apply hb _ ⟨?_,?_⟩ · simpa [uIcc_of_le hab] using hσ · simpa [uIcc_of_le (by linarith : -T ≤ T)] using ht have hl := hleft centeredLogDerivative X a T M hXp (by linarith) hM (fun t ht => hpoint a t ⟨le_rfl,hab⟩ ht) have hl' : ‖∫ t in -T..T, centeredLogDerivative (rieszMellinLine a t) * rieszVerticalWeight X a t‖ ≤ K * M * X ^ a := by simpa only [intervalIntegral.integral_of_le (by linarith : -T ≤ T), integral_Icc_eq_integral_Ioc] using hl have hu := riesz_horizontal_bound centeredLogDerivative X a b T M hX hab (by rwa [abs_of_pos hT]) hM (fun σ hσ => hpoint σ T hσ ⟨by linarith,le_rfl⟩) have hd := riesz_horizontal_bound centeredLogDerivative X a b (-T) M hX hab (by rwa [abs_neg,abs_of_pos hT]) hM (fun σ hσ => hpoint σ (-T) hσ ⟨le_rfl,by linarith⟩) rw [neg_sq] at hd have hz := centeredRiesz_rectangle_zero X hXp a b (-T) T ha hab have hv := rectangle_vertical_shift_norm_bound _ a b (-T) T hz change ‖∫ t in -T..T, centeredLogDerivative (rieszMellinLine b t) * rieszVerticalWeight X b t‖ ≤ ‖∫ t in -T..T, centeredLogDerivative (rieszMellinLine a t) * rieszVerticalWeight X a t‖ + _ + _ at hv linarith theorem scalar_vertical_inversion (X σ : ℝ) (hX : 0 < X) (hσ : 1 ≤ σ) : ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, rieszVerticalWeight X σ t) = rieszPrimeTest (1 / X) := by have hi := rieszPrimeTest_mellin_inversion σ (1 / X) hσ (by positivity) change ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, ((1 / X : ℝ) : ℂ) ^ (-rieszMellinLine σ t) * rieszMellinKernel (rieszMellinLine σ t)) = _ at hi simpa only [one_div, Complex.ofReal_inv, Complex.inv_cpow_ofReal_nonneg hX.le, Complex.cpow_neg, inv_inv, rieszVerticalWeight] using hi noncomputable def poleVerticalIntegrand (X t : ℝ) : ℂ := (1 / (rieszMellinLine 2 t - 1)) * rieszVerticalWeight X 2 t theorem poleVerticalIntegrand_eq (X t : ℝ) (hX : 0 < X) : poleVerticalIntegrand X t = ((X : ℂ) * rieszVerticalWeight X 1 t - rieszVerticalWeight X 2 t) / 2 := by have he : rieszMellinLine 2 t = rieszMellinLine 1 t + 1 := by unfold rieszMellinLine push_cast ring have hn0 : rieszMellinLine 1 t ≠ 0 := by intro h have := congrArg Complex.re h norm_num [rieszMellinLine] at this have hn1 : rieszMellinLine 1 t + 1 ≠ 0 := by intro h have := congrArg Complex.re h norm_num [rieszMellinLine] at this have hn2 : rieszMellinLine 1 t + 1 + 1 ≠ 0 := by intro h have := congrArg Complex.re h norm_num [rieszMellinLine] at this simp only [poleVerticalIntegrand, rieszVerticalWeight, he, add_sub_cancel_right, Complex.cpow_add _ _ (by exact_mod_cast hX.ne' : (X : ℂ) ≠ 0), Complex.cpow_one, rieszMellinKernel] field_simp <;> ring theorem poleVerticalIntegrand_integrable (X : ℝ) (hX : 0 < X) : Integrable (poleVerticalIntegrand X) := by have h := ((rieszVerticalWeight_integrable X 1 hX le_rfl).const_mul (X : ℂ)).sub (rieszVerticalWeight_integrable X 2 hX (by norm_num)) convert h.div_const (2 : ℂ) using 1 funext t exact poleVerticalIntegrand_eq X t hX theorem pole_vertical_integral (X : ℝ) (hX : 1 ≤ X) : ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, poleVerticalIntegrand X t) = (X : ℂ) / 2 - 1 + 1 / (2 * X) := by have hXp : 0 < X := by linarith have hi1 := scalar_vertical_inversion X 1 hXp le_rfl have hi2 := scalar_vertical_inversion X 2 hXp (by norm_num) have hfun : poleVerticalIntegrand X = fun t => ((X : ℂ) * rieszVerticalWeight X 1 t - rieszVerticalWeight X 2 t) / 2 := funext (fun t => poleVerticalIntegrand_eq X t hXp) rw [hfun, integral_div, integral_sub ((rieszVerticalWeight_integrable X 1 hXp le_rfl).const_mul (X : ℂ)) (rieszVerticalWeight_integrable X 2 hXp (by norm_num)), integral_const_mul] have ht0 : 0 ≤ 1 - 1 / X := sub_nonneg.mpr ((div_le_one hXp).mpr hX) have ht : rieszPrimeTest (1 / X) = (1 : ℂ) - 1 / X := by unfold rieszPrimeTest simp only [max_eq_left ht0, Complex.ofReal_sub, Complex.ofReal_one, Complex.ofReal_div] rw [ht] at hi1 hi2 calc _ = ((X : ℂ) * (((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, rieszVerticalWeight X 1 t) - (((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, rieszVerticalWeight X 2 t)) / 2 := by ring _ = _ := by rw [hi1,hi2] field_simp [show (X : ℂ) ≠ 0 by exact_mod_cast hXp.ne'] <;> ring theorem centered_right_bound : ∃ N : ℝ, 0 < N ∧ ∀ t : ℝ, ‖centeredLogDerivative (rieszMellinLine 2 t)‖ ≤ N := by let D : ℝ := ‖deriv riemannZeta 2 / riemannZeta 2‖ refine ⟨D + 1, by dsimp [D]; positivity, ?_⟩ intro t have hs : rieszMellinLine 2 t ≠ 1 := by intro h have := congrArg Complex.re h norm_num [rieszMellinLine] at this rw [centeredLogDerivative_eq hs (by norm_num [rieszMellinLine])] have hb := dlog_riemannZeta_bdd_on_vertical_lines_generalized 2 2 t (by norm_num) le_rfl rw [neg_div,norm_neg] at hb change ‖logDeriv riemannZeta (rieszMellinLine 2 t)‖ ≤ D at hb have hden : 1 ≤ ‖rieszMellinLine 2 t - 1‖ := by have h := Complex.re_le_norm (rieszMellinLine 2 t - 1) norm_num [rieszMellinLine] at h change 1 ≤ ‖(2 : ℂ) + (t : ℂ) * I - 1‖ exact h have hp : ‖(1 : ℂ) / (rieszMellinLine 2 t - 1)‖ ≤ 1 := by rw [norm_div,norm_one] exact (div_le_one (by linarith)).mpr hden calc _ ≤ ‖-logDeriv riemannZeta (rieszMellinLine 2 t)‖ + ‖(1 : ℂ) / (rieszMellinLine 2 t - 1)‖ := norm_sub_le _ _ _ ≤ D + 1 := by rw [norm_neg]; linarith theorem centered_growth_of_zeta_bound (hlarge : ∀ s : ℂ, (47 / 48 : ℝ) ≤ s.re → s.re ≤ 2 → 3 < |s.im| → ‖logDeriv riemannZeta s‖ ≤ 19200 * Real.log (24 * (|s.im| + 2))) : ∃ C : ℝ, 0 < C ∧ ∀ s : ℂ, (47 / 48 : ℝ) ≤ s.re → s.re ≤ 2 → ‖centeredLogDerivative s‖ ≤ C * (1 + Real.log (24 * (|s.im| + 2))) := by let K : Set ℂ := Icc (47 / 48 : ℝ) 2 ×ℂ Icc (-3 : ℝ) 3 have hK : IsCompact K := isCompact_Icc.reProdIm isCompact_Icc have hc : ContinuousOn centeredLogDerivative K := centeredLogDerivative_analytic.continuousOn.mono (by intro s hs change s.re ∈ Icc (47 / 48 : ℝ) 2 ∧ s.im ∈ Icc (-3 : ℝ) 3 at hs change (23 / 24 : ℝ) < s.re linarith [hs.1.1]) obtain ⟨C0,hC0⟩ := hK.exists_bound_of_continuousOn hc let C : ℝ := |C0| + 19201 have hC : 0 < C := by dsimp [C]; positivity refine ⟨C,hC,?_⟩ intro s hlo hhi have hlog : 0 ≤ Real.log (24 * (|s.im| + 2)) := Real.log_nonneg (by linarith [abs_nonneg s.im]) have hCbig : 19201 ≤ C := by dsimp [C]; linarith [abs_nonneg C0] by_cases ht : 3 < |s.im| · have hs : s ≠ 1 := by intro h; norm_num [h] at ht rw [centeredLogDerivative_eq hs (by linarith)] have hb := hlarge s hlo hhi ht have hden : 1 ≤ ‖s - 1‖ := by have h := Complex.abs_im_le_norm (s - 1) simp only [sub_im, one_im, sub_zero] at h linarith have hp : ‖(1 : ℂ) / (s - 1)‖ ≤ 1 := by rw [norm_div,norm_one] exact (div_le_one (by linarith)).mpr hden have hh := norm_sub_le (-logDeriv riemannZeta s) (1 / (s - 1)) rw [norm_neg] at hh nlinarith [mul_nonneg (sub_nonneg.mpr hCbig) hlog] · have hmem : s ∈ K := by change s.re ∈ Icc (47 / 48 : ℝ) 2 ∧ s.im ∈ Icc (-3 : ℝ) 3 exact ⟨⟨hlo,hhi⟩,abs_le.mp (le_of_not_gt ht)⟩ have hb := hC0 s hmem have hab := le_abs_self C0 nlinarith [mul_nonneg hC.le hlog] theorem tail_bound_inv_sq (g : ℝ → ℂ) (C T : ℝ) (hT : 0 < T) (hbound : ∀ t : ℝ, T < t → ‖g t‖ ≤ C / t ^ 2) : ‖∫ t in Ioi T, g t‖ ≤ C / T := by have hg : IntegrableOn (fun t : ℝ => C * t ^ (-(2 : ℝ))) (Ioi T) := (integrableOn_Ioi_rpow_of_lt (by norm_num) hT).const_mul C have hn : ‖∫ t in Ioi T, g t‖ ≤ ∫ t in Ioi T, C * t ^ (-(2 : ℝ)) := by apply norm_integral_le_of_norm_le hg filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht have hb := hbound t ht simpa only [Real.rpow_neg (hT.trans ht).le, Real.rpow_two, div_eq_mul_inv] using hb apply hn.trans_eq rw [integral_const_mul, integral_Ioi_rpow_of_lt (by norm_num : -(2 : ℝ) < -1) hT] norm_num only [neg_add_cancel_left, neg_div_neg_eq, div_one, Real.rpow_neg_one] ring theorem riesz_right_integrable (f : ℂ → ℂ) (X N : ℝ) (hX : 0 < X) (hcont : Continuous (fun t : ℝ => f (rieszMellinLine 2 t))) (hbound : ∀ t : ℝ, ‖f (rieszMellinLine 2 t)‖ ≤ N) : Integrable (fun t => f (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t) := by apply ((rieszVerticalWeight_integrable X 2 hX (by norm_num)).norm.const_mul N).mono' (hcont.mul (rieszVerticalWeight_continuous X 2 hX (by norm_num))).aestronglyMeasurable filter_upwards with t rw [Pi.mul_apply,norm_mul] exact mul_le_mul_of_nonneg_right (hbound t) (norm_nonneg _) theorem riesz_right_truncation (f : ℂ → ℂ) (X T N : ℝ) (hX : 0 < X) (hT : 0 < T) (hN : 0 ≤ N) (hcont : Continuous (fun t : ℝ => f (rieszMellinLine 2 t))) (hbound : ∀ t : ℝ, ‖f (rieszMellinLine 2 t)‖ ≤ N) : ‖∫ t : ℝ, f (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t‖ ≤ ‖∫ t in -T..T, f (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t‖ + 2 * N * X ^ (2 : ℕ) / T := by let g := fun t => f (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t have hpoint (t : ℝ) (ht : 0 < |t|) : ‖g t‖ ≤ N * X ^ (2 : ℕ) / t ^ 2 := by have hk := rieszMellinKernel_im_bound (rieszMellinLine 2 t) (by simpa [rieszMellinLine] using ht) simp only [rieszMellinLine, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_im, mul_one, Complex.I_re, mul_zero, add_zero, zero_add, sq_abs] at hk dsimp only [g] rw [norm_mul, rieszVerticalWeight_norm X 2 t hX, Real.rpow_two] have h := mul_le_mul (hbound t) (mul_le_mul_of_nonneg_left hk (sq_nonneg X)) (by positivity) hN exact h.trans_eq (by ring) have hp := tail_bound_inv_sq g (N * X ^ (2 : ℕ)) T hT (fun t ht => hpoint t (by rw [abs_of_pos (hT.trans ht)]; exact hT.trans ht)) have hn := tail_bound_inv_sq (fun t => g (-t)) (N * X ^ (2 : ℕ)) T hT (by intro t ht simpa only [neg_sq] using hpoint (-t) (by rw [abs_neg,abs_of_pos (hT.trans ht)]; exact hT.trans ht)) rw [integral_comp_neg_Ioi T g] at hn have hi := riesz_right_integrable f X N hX hcont hbound have hsum : ‖∫ t : ℝ, g t‖ ≤ ‖∫ t in Iic (-T), g t‖ + ‖∫ t in -T..T, g t‖ + ‖∫ t in Ioi T, g t‖ := by rw [integral_three_parts g hi T] exact (norm_add_le _ _).trans (add_le_add (norm_add_le _ _) le_rfl) change ‖∫ t : ℝ, g t‖ ≤ ‖∫ t in -T..T, g t‖ + _ rw [show 2 * N * X ^ (2 : ℕ) / T = 2 * (N * X ^ (2 : ℕ) / T) by ring] linarith theorem centered_right_continuous : Continuous (fun t : ℝ => centeredLogDerivative (rieszMellinLine 2 t)) := by apply continuous_iff_continuousAt.mpr intro t exact (centeredLogDerivative_analytic _ (by norm_num [rieszMellinLine])).continuousAt.comp (rieszMellinLine_continuous 2).continuousAt theorem ordinaryRieszMean_centered (X : ℝ) (hX : 1 ≤ X) : Bounty.ordinaryRieszMean X = ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, centeredLogDerivative (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t) + ((X : ℂ) / 2 - 1 + 1 / (2 * X)) := by have hXp : 0 < X := by linarith obtain ⟨N,hN,hb⟩ := centered_right_bound have hi := riesz_right_integrable centeredLogDerivative X N hXp centered_right_continuous hb have hp := poleVerticalIntegrand_integrable X hXp have he : (fun t : ℝ => (-logDeriv riemannZeta (rieszMellinLine 2 t)) * rieszVerticalWeight X 2 t) = fun t => centeredLogDerivative (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t + poleVerticalIntegrand X t := by funext t have hs : rieszMellinLine 2 t ≠ 1 := by intro h have := congrArg Complex.re h norm_num [rieszMellinLine] at this rw [centeredLogDerivative_eq hs (by norm_num [rieszMellinLine])] unfold poleVerticalIntegrand ring rw [Bounty.ordinaryRieszMean_eq_vertical_logDerivative X 2 hXp (by norm_num), he, integral_add hi hp, mul_add, pole_vertical_integral X hX] theorem ordinaryRieszMean_error_le_centered (X : ℝ) (hX : 1 ≤ X) : ‖Bounty.ordinaryRieszMean X - (X : ℂ) / 2‖ ≤ ‖∫ t : ℝ, centeredLogDerivative (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t‖ + 2 := by have hXp : 0 < X := by linarith have hc : ‖((1 / (2 * Real.pi) : ℝ) : ℂ)‖ ≤ 1 := by rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (by positivity)] exact (div_le_one (by positivity : 0 < 2 * Real.pi)).mpr (by linarith [Real.pi_gt_three]) have hr0 : 0 ≤ (1 : ℝ) / (2 * X) := by positivity have hr1 : (1 : ℝ) / (2 * X) ≤ 1 := (div_le_one (by positivity)).mpr (by linarith) have hp : ‖(1 : ℂ) / (2 * X)‖ ≤ 1 := by have he : (1 : ℂ) / (2 * X) = (((1 : ℝ) / (2 * X) : ℝ) : ℂ) := by push_cast; rfl rw [he,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg hr0] exact hr1 rw [ordinaryRieszMean_centered X hX] have he : ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, centeredLogDerivative (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t) + ((X : ℂ) / 2 - 1 + 1 / (2 * X)) - (X : ℂ) / 2 = ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, centeredLogDerivative (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t) + (-1 + 1 / (2 * X)) := by ring rw [he] have hn := norm_add_le (((1 / (2 * Real.pi) : ℝ) : ℂ) * ∫ t : ℝ, centeredLogDerivative (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t) (-1 + 1 / (2 * X)) have hsmall := norm_add_le (-1 : ℂ) (1 / (2 * X)) rw [norm_mul] at hn norm_num only [norm_neg,norm_one] at hsmall have hm := mul_le_of_le_one_left (norm_nonneg (∫ t : ℝ, centeredLogDerivative (rieszMellinLine 2 t) * rieszVerticalWeight X 2 t)) hc linarith theorem ordinaryRieszMean_log_bound (hlarge : ∀ s : ℂ, (47 / 48 : ℝ) ≤ s.re → s.re ≤ 2 → 3 < |s.im| → ‖logDeriv riemannZeta s‖ ≤ 19200 * Real.log (24 * (|s.im| + 2))) : ∃ D : ℝ, 0 < D ∧ ∀ X : ℝ, 2 ≤ X → ‖Bounty.ordinaryRieszMean X - (X : ℂ) / 2‖ ≤ D * X ^ (47 / 48 : ℝ) * (1 + Real.log (24 * (X ^ (2 : ℕ) + 2))) := by obtain ⟨C,hC,hgrowth⟩ := centered_growth_of_zeta_bound hlarge obtain ⟨N,hN,hright⟩ := centered_right_bound obtain ⟨K,hK,hrect⟩ := centeredRiesz_rectangle_bound let D := (K + 3) * C + 2 * N + 2 refine ⟨D, by dsimp [D]; positivity, ?_⟩ intro X hX let L := 1 + Real.log (24 * (X ^ (2 : ℕ) + 2)) let M := C * L have hXp : 0 < X := by linarith have hX1 : 1 ≤ X := by linarith have hXX : 1 ≤ X ^ (2 : ℕ) := by nlinarith have hL : 1 ≤ L := by have hh : 0 ≤ Real.log (24 * (X ^ (2 : ℕ) + 2)) := Real.log_nonneg (by nlinarith) dsimp [L] linarith have hM : 0 ≤ M := mul_nonneg hC.le (by linarith) have hpow : 1 ≤ X ^ (47 / 48 : ℝ) := Real.one_le_rpow hX1 (by norm_num) have hbound : ∀ z ∈ uIcc (47 / 48 : ℝ) 2 ×ℂ uIcc (-(X ^ (2 : ℕ))) (X ^ (2 : ℕ)), ‖centeredLogDerivative z‖ ≤ M := by intro z hz have hz' : z.re ∈ Icc (47 / 48 : ℝ) 2 ∧ z.im ∈ Icc (-(X ^ (2 : ℕ))) (X ^ (2 : ℕ)) := by simpa only [mem_reProdIm,uIcc_of_le (by norm_num : (47 / 48 : ℝ) ≤ 2), uIcc_of_le (by nlinarith : -(X ^ (2 : ℕ)) ≤ X ^ (2 : ℕ))] using hz have hh := hgrowth z hz'.1.1 hz'.1.2 have hl : Real.log (24 * (|z.im| + 2)) ≤ Real.log (24 * (X ^ (2 : ℕ) + 2)) := by apply Real.log_le_log (by positivity) have hi := abs_le.mpr hz'.2 linarith exact hh.trans (mul_le_mul_of_nonneg_left (by dsimp [L]; linarith) hC.le) have hr := hrect X (47 / 48) 2 (X ^ (2 : ℕ)) M hX1 (by norm_num) (by norm_num) (by positivity) hM hbound have ht := riesz_right_truncation centeredLogDerivative X (X ^ (2 : ℕ)) N hXp (by positivity) hN.le centered_right_continuous hright have htail : 2 * N * X ^ (2 : ℕ) / X ^ (2 : ℕ) = 2 * N := by field_simp rw [htail] at ht rw [Real.rpow_two] at hr have hquot : M * X ^ (2 : ℕ) / (X ^ (2 : ℕ)) ^ 2 ≤ M := by apply (div_le_iff₀ (by positivity)).mpr exact mul_le_mul_of_nonneg_left (by nlinarith : X ^ (2 : ℕ) ≤ (X ^ (2 : ℕ)) ^ 2) hM have hmPow : M ≤ M * X ^ (47 / 48 : ℝ) := by nlinarith have hb := ordinaryRieszMean_error_le_centered X hX1 have hbase : ‖Bounty.ordinaryRieszMean X - (X : ℂ) / 2‖ ≤ (K + 3) * M * X ^ (47 / 48 : ℝ) + 2 * N + 2 := by nlinarith have hLP : 1 ≤ X ^ (47 / 48 : ℝ) * L := one_le_mul_of_one_le_of_one_le hpow hL apply hbase.trans change (K + 3) * M * X ^ (47 / 48 : ℝ) + 2 * N + 2 ≤ D * X ^ (47 / 48 : ℝ) * L dsimp only [D,M] nlinarith [mul_nonneg (show 0 ≤ 2 * N + 2 by linarith) (sub_nonneg.mpr hLP)] theorem ordinaryRieszMean_logarithmic_bound (hlarge : ∀ s : ℂ, (47 / 48 : ℝ) ≤ s.re → s.re ≤ 2 → 3 < |s.im| → ‖logDeriv riemannZeta s‖ ≤ 19200 * Real.log (24 * (|s.im| + 2))) : ∃ C : ℝ, 0 < C ∧ ∀ X : ℝ, 2 ≤ X → ‖Bounty.ordinaryRieszMean X - (X : ℂ) / 2‖ ≤ C * X ^ (47 / 48 : ℝ) * Real.log X := by obtain ⟨D,hD,hbound⟩ := ordinaryRieszMean_log_bound hlarge refine ⟨12 * D, by positivity, ?_⟩ intro X hX have hl := Bounty.riesz_conductor_log_bound (q := 1) (by norm_num) hX simp only [mul_one,one_mul] at hl calc _ ≤ D * X ^ (47 / 48 : ℝ) * (1 + Real.log (24 * (X ^ (2 : ℕ) + 2))) := hbound X hX _ ≤ D * X ^ (47 / 48 : ℝ) * (12 * Real.log X) := mul_le_mul_of_nonneg_left hl (by positivity) _ = _ := by ring end ThirdZetaContour end section /- Centered finite Riesz unsmoothing, including the principal character. -/ open Complex Finset MeasureTheory OAI.Ostmann open scoped Topology namespace Bounty theorem riesz_centered_unsmoothing_bound {q : ℕ} (χ : DirichletCharacter ℂ q) {x : ℝ} (hx : 0 < x) {m : ℕ} (hm : 0 < m) : ‖twistedPsi χ x - (x : ℂ)‖ ≤ ((x + m) * ‖smoothedTwistedPsi χ (x + m) - ((x + m : ℝ) : ℂ) / 2‖ + x * ‖smoothedTwistedPsi χ x - (x : ℂ) / 2‖ + (m : ℝ) ^ 2 * (Real.log (x + m) + 1 / 2)) / m := by have hmp : 0 < (m : ℝ) := by exact_mod_cast hm let R : ℂ := ∑ n ∈ Icc (⌊x⌋₊ + 1) (⌊x⌋₊ + m), mangoldtTwist χ n * ((x + m - (n : ℝ) : ℝ) : ℂ) have he := riesz_smoothed_difference χ hx m rw [← riesz_twistedPsi_sum] at he have halg : (m : ℂ) * (twistedPsi χ x - (x : ℂ)) = (((x + m : ℝ) : ℂ) * (smoothedTwistedPsi χ (x + m) - ((x + m : ℝ) : ℂ) / 2) - (x : ℂ) * (smoothedTwistedPsi χ x - (x : ℂ) / 2) - R) + (m : ℂ) ^ 2 / 2 := by dsimp only [R] push_cast at * linear_combination -he have hR : ‖R‖ ≤ (m : ℝ)^2 * Real.log (x + m) := riesz_smoothed_remainder χ hx m apply (le_div_iff₀ hmp).mpr calc _ = ‖(m : ℂ) * (twistedPsi χ x - (x : ℂ))‖ := by rw [norm_mul, Complex.norm_natCast]; ring _ ≤ ‖((x + m : ℝ) : ℂ) * (smoothedTwistedPsi χ (x + m) - ((x + m : ℝ) : ℂ) / 2) - (x : ℂ) * (smoothedTwistedPsi χ x - (x : ℂ) / 2) - R‖ + ‖(m : ℂ)^2 / 2‖ := by rw [halg] exact norm_add_le _ _ _ ≤ (‖((x + m : ℝ) : ℂ) * (smoothedTwistedPsi χ (x + m) - ((x + m : ℝ) : ℂ) / 2)‖ + ‖(x : ℂ) * (smoothedTwistedPsi χ x - (x : ℂ) / 2)‖ + ‖R‖) + ‖(m : ℂ)^2 / 2‖ := by refine add_le_add ?_ le_rfl exact (norm_sub_le _ R).trans (add_le_add (norm_sub_le _ _) le_rfl) _ ≤ ((x + m) * ‖smoothedTwistedPsi χ (x + m) - ((x + m : ℝ) : ℂ) / 2‖ + x * ‖smoothedTwistedPsi χ x - (x : ℂ) / 2‖ + (m : ℝ)^2 * Real.log (x + m)) + (m : ℝ)^2 / 2 := by simp only [norm_mul, norm_real, Real.norm_eq_abs, abs_of_pos hx, abs_of_pos (by positivity : 0 < x + (m : ℝ)), norm_div, norm_pow, Complex.norm_natCast] norm_num exact hR _ = _ := by ring theorem principal_twistedPsi (x : ℝ) : twistedPsi (1 : DirichletCharacter ℂ 1) x = (Chebyshev.psi x : ℂ) := by have hc (n : ℕ) : (1 : DirichletCharacter ℂ 1) (n : ZMod 1) = 1 := by rw [Subsingleton.elim (n : ZMod 1) 1, map_one] simp [twistedPsi, Chebyshev.psi, hc] theorem principal_smoothedTwistedPsi {x : ℝ} (hx : 0 < x) : smoothedTwistedPsi (1 : DirichletCharacter ℂ 1) x = ordinaryRieszMean x := by classical have hc (n : ℕ) : (1 : DirichletCharacter ℂ 1) (n : ZMod 1) = 1 := by rw [Subsingleton.elim (n : ZMod 1) 1, map_one] have hs (n : ℕ) (hn : n ∉ Icc 1 ⌊x⌋₊) : (ArithmeticFunction.vonMangoldt n : ℂ) * rieszPrimeTest (n / x) = 0 := by by_cases hn0 : n = 0 · subst n simp · have hlarge : ⌊x⌋₊ < n := by simp only [mem_Icc] at hn; omega have hnlarge : x < n := Nat.lt_of_floor_lt hlarge have hdiv : 1 < (n : ℝ) / x := (one_lt_div hx).mpr hnlarge simp [rieszPrimeTest, max_eq_right (by linarith : 1 - (n : ℝ) / x ≤ 0)] rw [ordinaryRieszMean, tsum_eq_sum hs] unfold smoothedTwistedPsi apply sum_congr rfl intro n hn have hnle : (n : ℝ) ≤ x := (Nat.le_floor_iff hx.le).mp (mem_Icc.mp hn).2 have hdiv : (n : ℝ) / x ≤ 1 := (div_le_one hx).mpr hnle simp [mangoldtTwist, hc, rieszPrimeTest, max_eq_left (by linarith : 0 ≤ 1 - (n : ℝ) / x)] theorem centered_twistedPsi_bound_of_smoothed_exponent {θ : ℝ} (hθ0 : 0 ≤ θ) (hθ1 : θ ≤ 1) {q : ℕ} (χ : DirichletCharacter ℂ q) (hq : 0 < q) {C : ℝ} (hC : 0 < C) (hbound : ∀ y : ℝ, 2 ≤ y → ‖smoothedTwistedPsi χ y - (y : ℂ) / 2‖ ≤ C * y ^ θ * Real.log ((q : ℝ) * y)) {x : ℝ} (hx : 2 ≤ x) : ‖twistedPsi χ x - (x : ℂ)‖ ≤ (28 * C + 8) * x ^ ((1 + θ) / 2) * Real.log ((q : ℝ) * x) := by let p : ℝ := x ^ ((1 + θ) / 2) let m : ℕ := ⌈p⌉₊ let L : ℝ := Real.log ((q : ℝ) * x) have hx0 : 0 < x := by linarith have hq1 : (1 : ℝ) ≤ q := by exact_mod_cast hq have hq0 : (0 : ℝ) < q := by exact_mod_cast hq have hL : 0 ≤ L := Real.log_nonneg (by nlinarith) have hp1 : 1 ≤ p := Real.one_le_rpow (by linarith) (by linarith) have hp0 : 0 < p := by linarith have hpx : p ≤ x := by calc _ ≤ x ^ (1 : ℝ) := Real.rpow_le_rpow_of_exponent_le (by linarith) (by linarith) _ = x := Real.rpow_one _ have hmp : p ≤ (m : ℝ) := Nat.le_ceil p have hm2p : (m : ℝ) ≤ 2 * p := by have hh := Nat.ceil_lt_add_one hp0.le dsimp [m] linarith have hm : 0 < m := Nat.ceil_pos.mpr hp0 have hm0 : 0 < (m : ℝ) := by exact_mod_cast hm have hym : x + (m : ℝ) ≤ 3 * x := by linarith have hy2 : 2 ≤ x + (m : ℝ) := by linarith have hpow := power_three_scale_le_of_exponent hθ0 hθ1 hx0 (by positivity : 0 ≤ x + (m : ℝ)) hym have hlog := log_three_scale_le hq1 hx (by positivity : 0 < x + (m : ℝ)) hym have hlog0 : 0 ≤ Real.log ((q : ℝ) * (x + (m : ℝ))) := Real.log_nonneg (by nlinarith) have hsmy : ‖smoothedTwistedPsi χ (x + m) - ((x + m : ℝ) : ℂ) / 2‖ ≤ 9 * C * x ^ θ * L := by calc _ ≤ C * (x + m) ^ θ * Real.log ((q : ℝ) * (x + m)) := hbound _ hy2 _ ≤ C * (3 * x ^ θ) * (3 * L) := by gcongr _ = _ := by ring have hsmx : ‖smoothedTwistedPsi χ x - (x : ℂ) / 2‖ ≤ C * x ^ θ * L := hbound x hx have hp2 : x * x ^ θ = p ^ 2 := by dsimp [p] calc _ = x ^ (1 : ℝ) * x ^ θ := by rw [Real.rpow_one] _ = x ^ ((1 : ℝ) + θ) := (Real.rpow_add hx0 _ _).symm _ = x ^ (((1 + θ) / 2) * 2) := by congr 1; ring _ = _ := by rw [Real.rpow_mul hx0.le, Real.rpow_two] have hpair : (x + m) * ‖smoothedTwistedPsi χ (x + m) - ((x + m : ℝ) : ℂ) / 2‖ + x * ‖smoothedTwistedPsi χ x - (x : ℂ) / 2‖ ≤ 28 * C * p ^ 2 * L := by calc _ ≤ (3 * x) * (9 * C * x ^ θ * L) + x * (C * x ^ θ * L) := by gcongr _ = 28 * C * (x * x ^ θ) * L := by ring _ = _ := by rw [hp2] have hlogy0 : Real.log (x + (m : ℝ)) ≤ 3 * L := by apply le_trans _ hlog apply Real.log_le_log (by positivity) nlinarith have hhalf : (1 / 2 : ℝ) ≤ L := by have h2 : (1 / 2 : ℝ) ≤ Real.log 2 := by have hh := Real.one_sub_inv_le_log_of_pos (by norm_num : (0 : ℝ) < 2) norm_num at hh exact hh apply h2.trans apply Real.log_le_log (by norm_num) nlinarith have hlogy : Real.log (x + (m : ℝ)) + 1 / 2 ≤ 4 * L := by linarith have hpp : p ^ 2 ≤ p * m := by nlinarith have hmp2 : (m : ℝ) ^ 2 ≤ 2 * p * m := by nlinarith calc _ ≤ ((x + m) * ‖smoothedTwistedPsi χ (x + m) - ((x + m : ℝ) : ℂ) / 2‖ + x * ‖smoothedTwistedPsi χ x - (x : ℂ) / 2‖ + (m : ℝ) ^ 2 * (Real.log (x + m) + 1 / 2)) / m := riesz_centered_unsmoothing_bound χ hx0 hm _ ≤ (28 * C + 8) * p * L := by apply (div_le_iff₀ hm0).mpr calc _ ≤ 28 * C * p ^ 2 * L + (m : ℝ) ^ 2 * (4 * L) := by gcongr _ = 28 * C * p ^ 2 * L + 4 * (m : ℝ) ^ 2 * L := by ring _ ≤ 28 * C * (p * m) * L + 4 * (2 * p * m) * L := by gcongr _ = _ := by ring theorem ordinary_psi_bound_of_riesz {θ : ℝ} (hθ0 : 0 ≤ θ) (hθ1 : θ ≤ 1) {C : ℝ} (hC : 0 < C) (hbound : ∀ y : ℝ, 2 ≤ y → ‖ordinaryRieszMean y - (y : ℂ) / 2‖ ≤ C * y ^ θ * Real.log y) {x : ℝ} (hx : 2 ≤ x) : ‖Chebyshev.psi x - x‖ ≤ (28 * C + 8) * x ^ ((1 + θ) / 2) * Real.log x := by have h := centered_twistedPsi_bound_of_smoothed_exponent hθ0 hθ1 (1 : DirichletCharacter ℂ 1) (by norm_num) hC (fun y hy => by simpa [principal_smoothedTwistedPsi (by linarith : 0 < y)] using hbound y hy) hx rw [principal_twistedPsi, ← Complex.ofReal_sub, Complex.norm_real] at h simpa using h theorem power_log_isLittleO_log_error {p : ℝ} (hp : p < 1) (B : ℝ) : (fun x : ℝ => x ^ p * Real.log x) =o[Filter.atTop] (fun x : ℝ => x * Real.log x ^ (-B)) := by have h := (Asymptotics.isBigO_refl (fun x : ℝ => x ^ p * Real.log x ^ (-B)) Filter.atTop).mul_isLittleO (isLittleO_log_rpow_rpow_atTop (B + 1) (show 0 < 1 - p by linarith)) apply h.congr' · filter_upwards [Filter.eventually_gt_atTop (1 : ℝ)] with x hx rw [mul_assoc, ← Real.rpow_add (Real.log_pos hx)] simp only [neg_add_cancel_left, Real.rpow_one] · filter_upwards [Filter.eventually_gt_atTop (1 : ℝ)] with x hx rw [show x ^ p * Real.log x ^ (-B) * x ^ (1 - p) = (x ^ p * x ^ (1 - p)) * Real.log x ^ (-B) by ring, ← Real.rpow_add (by linarith : 0 < x)] simp only [add_sub_cancel, Real.rpow_one] theorem ordinary_psi_error_of_riesz_bound {θ : ℝ} (hθ0 : 0 ≤ θ) (hθ1 : θ < 1) {C : ℝ} (hC : 0 < C) (hbound : ∀ y : ℝ, 2 ≤ y → ‖ordinaryRieszMean y - (y : ℂ) / 2‖ ≤ C * y ^ θ * Real.log y) (B : ℝ) : (Chebyshev.psi - id) =o[Filter.atTop] (fun x : ℝ => x * Real.log x ^ (-B)) := by have hbig : (Chebyshev.psi - id) =O[Filter.atTop] (fun x : ℝ => x ^ ((1 + θ) / 2) * Real.log x) := by apply Asymptotics.IsBigO.of_bound (28 * C + 8) filter_upwards [Filter.eventually_ge_atTop (2 : ℝ)] with x hx have hb := ordinary_psi_bound_of_riesz hθ0 hθ1.le hC hbound hx change ‖Chebyshev.psi x - x‖ ≤ (28 * C + 8) * ‖x ^ ((1 + θ) / 2) * Real.log x‖ rw [Real.norm_of_nonneg (mul_nonneg (Real.rpow_nonneg (by linarith) _) (Real.log_nonneg (by linarith)))] simpa only [mul_assoc] using hb exact hbig.trans_isLittleO (power_log_isLittleO_log_error (by linarith) B) end Bounty end namespace Bounty theorem ordinary_psi_error_isLittleO (B : ℝ) : (Chebyshev.psi - id) =o[atTop] (fun x : ℝ => x * (Real.log x)^(-B)) := by obtain ⟨C, hC, hbound⟩ := ThirdZetaContour.ordinaryRieszMean_logarithmic_bound OrdinaryZetaBounds.logDeriv_bound exact ordinary_psi_error_of_riesz_bound (by norm_num) (by norm_num) hC hbound B end Bounty end section /- Exact last-prime decomposition of finite ordered rough-prime tuples. -/ open Finset namespace Bounty end Bounty end section /- Exact and asymptotic normalized strict Buchstab recursions on logarithmic cells. -/ open Finset Filter namespace Bounty noncomputable def logarithmicCellCountScale (L S Y : ℝ) : ℝ := (Real.exp (L ^ (-S)) * Y - Y) / L noncomputable def normalizedRoughCellCount (L S Y z : ℝ) : ℝ := ((roughBand Y (Real.exp (L ^ (-S)) * Y) z).card : ℝ) / logarithmicCellCountScale L S Y noncomputable def normalizedPrimeCellCount (L S Y : ℝ) : ℝ := ((primeBand Y (Real.exp (L ^ (-S)) * Y)).card : ℝ) / logarithmicCellCountScale L S Y theorem logarithmic_cell_count_scale_pos {L S Y : ℝ} (hL : 0 < L) (hY : 0 < Y) : 0 < logarithmicCellCountScale L S Y := by unfold logarithmicCellCountScale apply div_pos _ hL have hδ : 0 < L ^ (-S) := Real.rpow_pos_of_pos hL _ have he : 1 < Real.exp (L ^ (-S)) := by simpa only [Real.exp_zero] using Real.exp_lt_exp.mpr hδ nlinarith theorem logarithmic_cell_count_scale_div (L S Y t : ℝ) : logarithmicCellCountScale L S (Y / t) = logarithmicCellCountScale L S Y / t := by unfold logarithmicCellCountScale simp only [div_eq_mul_inv] ring theorem logarithmic_cell_small_prime_bound {L S Y : ℝ} (hY : Real.exp (L ^ (-S)) ≤ Y) {p : ℕ} (hp : (p : ℝ) ≤ Real.sqrt (Real.exp (L ^ (-S)) * Y)) : (p : ℝ) ≤ Y := by have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hB : Real.exp (L ^ (-S)) * Y ≤ Y ^ 2 := by nlinarith exact hp.trans ((Real.sqrt_le_iff).mpr ⟨hY0.le, hB⟩) theorem normalized_buchstab_cell_remainder_identity {L S Y z : ℝ} (hL : 0 < L) (hY : Real.exp (L ^ (-S)) ≤ Y) (hz : 0 < z) (hzY : z ≤ Y) : normalizedRoughCellCount L S Y z - normalizedPrimeCellCount L S Y - (∑ p ∈ primeBand z (Real.sqrt (Real.exp (L ^ (-S)) * Y)), normalizedRoughCellCount L S (Y / (p : ℝ)) (p : ℝ) / (p : ℝ)) = ((strictBuchstabRemainder Y (Real.exp (L ^ (-S)) * Y) z).card : ℝ) / logarithmicCellCountScale L S Y := by classical have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hscale := logarithmic_cell_count_scale_pos (S := S) hL hY0 have hδ : 0 < L ^ (-S) := Real.rpow_pos_of_pos hL _ have hY1 : 1 ≤ Y := (Real.one_le_exp hδ.le).trans hY have hB : 0 ≤ Real.exp (L ^ (-S)) * Y := by positivity have hcount : ((roughBand Y (Real.exp (L ^ (-S)) * Y) z).card : ℝ) = ((primeBand (max Y z) (Real.exp (L ^ (-S)) * Y)).card : ℝ) + (∑ p ∈ primeBand z (Real.sqrt (Real.exp (L ^ (-S)) * Y)), ((roughBand (max 1 (Y / (p : ℝ))) ((Real.exp (L ^ (-S)) * Y) / (p : ℝ)) (p : ℝ)).card : ℝ)) + ((strictBuchstabRemainder Y (Real.exp (L ^ (-S)) * Y) z).card : ℝ) := by exact_mod_cast strict_buchstab_count_with_remainder hY1 hB hz.le rw [max_eq_left hzY] at hcount have hcofactor : ∀ p ∈ primeBand z (Real.sqrt (Real.exp (L ^ (-S)) * Y)), ((roughBand (max 1 (Y / (p : ℝ))) ((Real.exp (L ^ (-S)) * Y) / (p : ℝ)) (p : ℝ)).card : ℝ) / logarithmicCellCountScale L S Y = normalizedRoughCellCount L S (Y / (p : ℝ)) (p : ℝ) / (p : ℝ) := by intro p hp obtain ⟨hpp, _, hpB⟩ := (mem_primeBand_iff hz.le (Real.sqrt_nonneg _) p).mp hp have hp0 : (0 : ℝ) < p := Nat.cast_pos.mpr hpp.pos have hpY : (p : ℝ) ≤ Y := logarithmic_cell_small_prime_bound hY hpB have hquot : 1 ≤ Y / (p : ℝ) := (le_div_iff₀ hp0).mpr (by simpa using hpY) rw [max_eq_right hquot, mul_div_assoc] unfold normalizedRoughCellCount rw [logarithmic_cell_count_scale_div] field_simp have hnorm := congrArg (fun t : ℝ => t / logarithmicCellCountScale L S Y) hcount rw [add_div, add_div, sum_div] at hnorm have hsum : (∑ p ∈ primeBand z (Real.sqrt (Real.exp (L ^ (-S)) * Y)), ((roughBand (max 1 (Y / (p : ℝ))) ((Real.exp (L ^ (-S)) * Y) / (p : ℝ)) (p : ℝ)).card : ℝ) / logarithmicCellCountScale L S Y) = ∑ p ∈ primeBand z (Real.sqrt (Real.exp (L ^ (-S)) * Y)), normalizedRoughCellCount L S (Y / (p : ℝ)) (p : ℝ) / (p : ℝ) := sum_congr rfl hcofactor rw [hsum] at hnorm change ((roughBand Y (Real.exp (L ^ (-S)) * Y) z).card : ℝ) / logarithmicCellCountScale L S Y - ((primeBand Y (Real.exp (L ^ (-S)) * Y)).card : ℝ) / logarithmicCellCountScale L S Y - _ = _ linarith theorem normalized_rough_cell_count_nonneg {L S Y z : ℝ} (hL : 0 < L) (hY : 0 < Y) : 0 ≤ normalizedRoughCellCount L S Y z := div_nonneg (Nat.cast_nonneg _) (logarithmic_cell_count_scale_pos hL hY).le theorem eventually_normalized_buchstab_cell_error {a γ₀ S : ℝ} (ha : 0 < a) (hγ₀ : 0 < γ₀) (hS : 0 ≤ S) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ γ : ℝ, γ₀ ≤ γ → ∀ Y : ℝ, Real.exp (a * L) ≤ Y → Real.exp (γ * L) ≤ Y → 0 ≤ normalizedRoughCellCount L S Y (Real.exp (γ * L)) - normalizedPrimeCellCount L S Y - (∑ p ∈ primeBand (Real.exp (γ * L)) (Real.sqrt (Real.exp (L ^ (-S)) * Y)), normalizedRoughCellCount L S (Y / (p : ℝ)) (p : ℝ) / (p : ℝ)) ∧ normalizedRoughCellCount L S Y (Real.exp (γ * L)) - normalizedPrimeCellCount L S Y - (∑ p ∈ primeBand (Real.exp (γ * L)) (Real.sqrt (Real.exp (L ^ (-S)) * Y)), normalizedRoughCellCount L S (Y / (p : ℝ)) (p : ℝ) / (p : ℝ)) ≤ L ^ (-Bsave) := by filter_upwards [eventually_rough_logarithmic_cell_squarefree_count_error hγ₀ hS Bsave, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (1 / a)] with L hbad hL1 hLa intro γ hγ Y hY hzY have hL : 0 < L := zero_lt_one.trans_le hL1 have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have haL : 1 ≤ a * L := by have h := (div_le_iff₀ ha).mp hLa nlinarith have hδ : L ^ (-S) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hL1 (neg_nonpos.mpr hS) have hcellY : Real.exp (L ^ (-S)) ≤ Y := (Real.exp_le_exp.mpr (hδ.trans haL)).trans hY rw [normalized_buchstab_cell_remainder_identity hL hcellY (Real.exp_pos _) hzY] have hscale := logarithmic_cell_count_scale_pos (S := S) hL hY0 refine ⟨div_nonneg (Nat.cast_nonneg _) hscale.le, ?_⟩ apply (div_le_iff₀ hscale).mpr have hY1 : 1 ≤ Y := (Real.one_le_exp (mul_nonneg ha.le hL.le)).trans hY have hrem : ((strictBuchstabRemainder Y (Real.exp (L ^ (-S)) * Y) (Real.exp (γ * L))).card : ℝ) ≤ (((roughBand Y (Real.exp (L ^ (-S)) * Y) (Real.exp (γ * L))).filter (fun n => ¬ Squarefree n)).card : ℝ) := by exact_mod_cast card_le_card (strict_buchstab_remainder_subset_nonsquarefree hY1) have herror := hbad γ hγ Y hY0.le rw [rough_band_squarefree_count_error] at herror exact hrem.trans herror end Bounty end section /- At a retained small prefix, the big action is the literal full capped edge event sum. Its displacement and residue translation depend only on the retained big labels and fixed auxiliary data. -/ open Finset Classical namespace Bounty section variable {S G : Type*} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) abbrev PhysicalSmallBigFullEvent (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) := FullActiveEdgeEvent n shared B (fun _ => Unit) (fun c _ => Δ d c) (fun c _ => D d c) x noncomputable def physicalSmallBigFullTarget (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalSmallBigFullEvent n shared B Δ D d x) := fullActiveEdgeEventTarget n shared B (fun _ => Unit) (fun c _ => Δ d c) (fun c _ => D d c) x e noncomputable def physicalSmallBigFullCoefficient (Ψ : ∀ d x, PhysicalResidues Ps → PhysicalSmallBigFullEvent n shared B Δ D d x → ℂ) (r : PhysicalResidues Ps) (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalSmallBigFullEvent n shared B Δ D d x) : ℂ := (fullActiveEdgeEventWeight n shared B (fun _ => Unit) (fun c _ => Δ d c) (fun c _ => D d c) (fun _ _ => 1) μ ρ V x e : ℂ) * Ψ d x r e omit [∀ g p, NeZero (n g p)] in /- This is an identity of the actual finite event sums, including both memory cutoffs and any bounded source/event-dependent coefficient. -/ theorem physical_small_big_full_prefix_eq (Ψ : ∀ d x, PhysicalResidues Ps → PhysicalSmallBigFullEvent n shared B Δ D d x → ℂ) (F : PhysicalSharedLists Ps J → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → PhysicalResidues Ps → ℂ) (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (r : PhysicalResidues Ps) : physicalSmallBigPrefixAction (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullCoefficient n shared B Δ D μ ρ V Ψ) (fun y => kbig (productActiveMemorySplit shared B y).1) F d x r = fullActiveExternalCoefficientAction n shared B (fun _ => Unit) (fun c _ => Δ d c) (fun c _ => D d c) (fun _ _ => 1) μ ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct d : ℕ))) (Ψ d) (F d) x r := by rfl variable [∀ p : PhysicalPrime Ps, NeZero p.2.val] theorem physical_small_big_full_prefix_energy_le {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, (shared g)ᶜ.card ≤ T) (Ψ : ∀ d x, PhysicalResidues Ps → PhysicalSmallBigFullEvent n shared B Δ D d x → ℂ) (H : ℝ) (hH : 0 ≤ H) (hΨ : ∀ d x r e, ‖Ψ d x r e‖ ≤ H) (F : PhysicalSharedLists Ps J → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → PhysicalResidues Ps → ℂ) (hF : ∀ d r, ProductMemorySymmetric (fun x => F d x r)) : physicalSmallBigConditionEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigPrefixAction (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullCoefficient n shared B Δ D μ ρ V Ψ) (fun y => kbig (productActiveMemorySplit shared B y).1) F) ≤ H ^ 2 * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * physicalSmallBigConditionEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by unfold physicalSmallBigConditionEnergy rw [mul_sum] apply sum_le_sum intro d hd simp_rw [physical_small_big_full_prefix_eq] exact full_active_external_coefficient_energy_le n shared B (fun _ => Unit) (fun c _ => Δ d c) (fun c _ => D d c) (fun _ _ => 1) μ ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct d : ℕ))) (by intros; exact zero_le_one) (by intro c; simp only [Fintype.sum_unique, le_refl]) hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht (Ψ d) H hH (hΨ d) (F d) (hF d) theorem physical_small_big_conditioned_full_prefix_energy_le [DecidableEq S] {ell : ℕ} (Vs : S → ℝ) (q : ℝ) {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, (shared g)ᶜ.card ≤ T) (Ψ : ∀ d x, PhysicalResidues Ps → PhysicalSmallBigFullEvent n shared B Δ D d x → ℂ) (H : ℝ) (hH : 0 ≤ H) (hΨ : ∀ d x r e, ‖Ψ d x r e‖ ≤ H) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : physicalSmallBigConditionEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigPrefixAction (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullCoefficient n shared B Δ D μ ρ V Ψ) (fun y => kbig (productActiveMemorySplit shared B y).1) (physicalSmallBigCondition Vs q F)) ≤ H ^ 2 * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * physicalSmallBigConditionEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigCondition Vs q F) := by exact physical_small_big_full_prefix_energy_le n shared B Δ D μ ρ V kbig hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht Ψ H hH hΨ (physicalSmallBigCondition Vs q F) (fun d r => physical_small_big_condition_memory_symmetric Vs q F hF d r) end end Bounty end section /- Energy transfer through the two actual small conditioning maps. The remaining bound is on the big event action at each retained small prefix. The small measure is the original residue-valid counting measure. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_energy_of_prefix_bound {S X : Type*} [Fintype S] [dS : DecidableEq S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (q ζ : ℝ) (W : X → ℝ) (hW : ∀ x, 0 ≤ W x) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) {A H K : ℝ} (hA : 0 ≤ A) (hH : 0 ≤ H) (hK : 0 ≤ K) (hκ : ∀ d, ‖κ d‖ ≤ H) (hcondition : ∀ u : PhysicalSmallBigState P J ell X → ℂ, physicalSmallBigConditionEnergy W (physicalSmallBigCondition V q u) ≤ A * physicalSmallBigEnergy V W u) (F : PhysicalSmallBigState P J ell X → ℂ) (hprefix : physicalSmallBigConditionEnergy W (physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F)) ≤ K * physicalSmallBigConditionEnergy W (physicalSmallBigCondition V q F)) : physicalSmallBigEnergy V W (physicalSmallBigAction V q ζ aux κ E target a k F) ≤ A ^ 2 * H ^ 2 * K * physicalSmallBigEnergy V W F := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) let Y := PhysicalSharedLists P J × (PhysicalResidues P × X) let ν : Y → ℝ := fun y => W y.2.2 let C : (PhysicalSmallBigState P J ell X → ℂ) → Y → ℂ := fun u y => physicalSmallBigCondition V q u y.1 y.2.2 y.2.1 let v : Y → ℂ := fun y => κ y.1 * physicalPhase ζ (physicalSharedProduct y.1) * physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F) y.1 y.2.2 y.2.1 have hCe (u : PhysicalSmallBigState P J ell X → ℂ) : finiteWeightedEnergy ν (C u) = physicalSmallBigConditionEnergy W (physicalSmallBigCondition V q u) := by simp only [ν, C, Y, finiteWeightedEnergy, Fintype.sum_prod_type, physicalSmallBigConditionEnergy] have hv : finiteWeightedEnergy ν v ≤ (H ^ 2 * K * A) * finiteWeightedEnergy (physicalSmallBigMeasure V W) F := by calc _ ≤ H ^ 2 * physicalSmallBigConditionEnergy W (physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F)) := by simp only [ν, v, Y, finiteWeightedEnergy, Fintype.sum_prod_type, physicalSmallBigConditionEnergy, mul_sum] apply sum_le_sum intro d _ apply sum_le_sum intro r _ apply sum_le_sum intro x _ rw [norm_mul, norm_mul, physical_phase_norm, mul_one, mul_pow] have hsq : ‖κ d‖ ^ 2 ≤ H ^ 2 := (sq_le_sq₀ (norm_nonneg _) hH).mpr (hκ d) nlinarith [mul_le_mul_of_nonneg_right hsq (mul_nonneg (hW x) (sq_nonneg ‖physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F) d x r‖))] _ ≤ H ^ 2 * (K * physicalSmallBigConditionEnergy W (physicalSmallBigCondition V q F)) := mul_le_mul_of_nonneg_left hprefix (sq_nonneg H) _ ≤ H ^ 2 * (K * (A * physicalSmallBigEnergy V W F)) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (hcondition F) hK) (sq_nonneg H) _ = _ := by rw [physical_small_big_energy_eq]; ring have h := finite_conditioned_energy_le (physicalSmallBigMeasure V W) ν (physical_small_big_measure_nonneg V hV W hW) (fun y => hW y.2.2) C hA (mul_nonneg (mul_nonneg (sq_nonneg H) hK) hA) (fun u => by rw [hCe, physical_small_big_energy_eq]; exact hcondition u) F (physicalSmallBigAction V q ζ aux κ E target a k F) v hv (fun u => by simpa only [ν, C, v, Y, Fintype.sum_prod_type] using physical_small_big_pairing V hV q ζ W aux κ E target a k u F) rw [physical_small_big_energy_eq, physical_small_big_energy_eq] at h convert h using 1 ring /- The small norm conversion is supplied by the original conditioning estimate, uniformly in the number J of retained slots. The only remaining energy premise concerns the explicit big-event operator. -/ theorem exists_physical_small_big_energy_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S X : Type) [Fintype S] [DecidableEq S] [Fintype X] (P : S → Finset ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] (J : ℕ) (V : S → ℝ), (∀ s, v ≤ V s) → ∀ (ζ : ℝ) (W : X → ℝ), (∀ x, 0 ≤ W x) → ∀ (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → X → Type) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (H K : ℝ), 0 ≤ H → 0 ≤ K → (∀ d, ‖κ d‖ ≤ H) → ∀ F : PhysicalSmallBigState P J ell X → ℂ, physicalSmallBigConditionEnergy W (physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F)) ≤ K * physicalSmallBigConditionEnergy W (physicalSmallBigCondition V q F) → physicalSmallBigEnergy V W (physicalSmallBigAction V q ζ aux κ E target a k F) ≤ A ^ (2 * Fintype.card S) * H ^ 2 * K * physicalSmallBigEnergy V W F := by obtain ⟨A, hA, hcond⟩ := exists_physical_small_big_condition_energy_bound hq0 hq1 hv ell refine ⟨A, hA, ?_⟩ intro S X _ dS _ cases Subsingleton.elim dS (Classical.typeDecidableEq S) intro P _ J V hV ζ W hW aux κ E _ target a k H K hH hK hκ F hprefix have h := physical_small_big_energy_of_prefix_bound V (fun s => hv.trans_le (hV s)) q ζ W hW aux κ E target a k (pow_nonneg (zero_le_one.trans hA) _) hH hK hκ (hcond S X P J V hV W hW) F hprefix simpa only [← pow_mul, Nat.mul_comm (Fintype.card S) 2] using h end Bounty end section /- Sparse small-source averaging in the original mixed measure. The choice index may include an auxiliary draw. A source gate stays explicit, and support rarity is used jointly before integrating either choice. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_sparse_permutation_energy_le {S X Q : Type*} [Fintype S] [Fintype X] [Fintype Q] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (W : X → ℝ) (hW : ∀ x, 0 ≤ W x) (π : Q → ℝ) (hπ : ∀ a, 0 ≤ π a) (hπmass : ∑ a, π a ≤ 1) (σ : Q → PhysicalPermutations S J ell) (good : PhysicalSmallBigState P J ell X → Prop) (bad : Q → PhysicalSmallBigState P J ell X → Prop) (output : Q → PhysicalSmallBigState P J ell X → ℂ) (hzero : ∀ a s, ¬ bad a s → output a s = 0) {δ K : ℝ} (hδ : 0 ≤ δ) (hK : 0 ≤ K) (hrare : ∀ s, good s → (∑ a, if bad a (physicalSmallBigPermutation (σ a) s) then π a else 0) ≤ δ) (f : PhysicalSmallBigState P J ell X → ℂ) (henergy : ∀ a, physicalSmallBigEnergy V W (output a) ≤ K * physicalSmallBigEnergy V W f) : physicalSmallBigEnergy V W (fun s => ∑ a, (π a : ℂ) * (if good s then output a (physicalSmallBigPermutation (σ a) s) else 0)) ≤ δ * K * physicalSmallBigEnergy V W f := by rw [← physical_small_big_energy_eq, ← physical_small_big_energy_eq] refine finite_sparse_average_energy_le π hπ hπmass (physicalSmallBigMeasure V W) (physical_small_big_measure_nonneg V hV W hW) (fun a s => good s ∧ bad a (physicalSmallBigPermutation (σ a) s)) _ ?_ hδ hK ?_ f ?_ · intro a s h by_cases hs : good s · rw [if_pos hs] exact hzero a _ (fun hb => h ⟨hs, hb⟩) · exact if_neg hs · intro s by_cases hs : good s · simpa only [hs, true_and] using hrare s hs · simpa only [hs, false_and, ite_false, sum_const_zero] using hδ · intro a rw [physical_small_big_energy_eq] calc _ ≤ physicalSmallBigEnergy V W (fun s => output a (physicalSmallBigPermutation (σ a) s)) := by rw [← physical_small_big_energy_eq, ← physical_small_big_energy_eq] apply sum_le_sum intro s _ apply mul_le_mul_of_nonneg_left _ (physical_small_big_measure_nonneg V hV W hW s) dsimp only split_ifs · exact le_rfl · simpa only [norm_zero, zero_pow (by decide : 2 ≠ 0)] using sq_nonneg ‖output a (physicalSmallBigPermutation (σ a) s)‖ _ = physicalSmallBigEnergy V W (output a) := physical_small_big_permutation_energy V W (σ a) _ _ ≤ _ := by simpa only [physical_small_big_energy_eq] using henergy a end Bounty end section /- Uniform small-slot averaging is self-adjoint for the actual mixed residue-valid measure. Big pending-memory symmetry is retained. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSmallBigAverage {S X : Type*} [Fintype S] [DecidableEq S] {P : S → Finset ℕ} {J ell : ℕ} (f : PhysicalSmallBigState P J ell X → ℂ) (s : PhysicalSmallBigState P J ell X) : ℂ := (Fintype.card (PhysicalPermutations S J ell) : ℂ)⁻¹ * ∑ σ : PhysicalPermutations S J ell, f (physicalSmallBigPermutation σ s) section variable {S X : Type*} [sharedInstance1 : Fintype S] [sharedInstance2 : DecidableEq S] [sharedInstance3 : Fintype X] {P : S → Finset ℕ} [sharedInstance5 : ∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) include S X sharedInstance1 sharedInstance2 sharedInstance3 P sharedInstance5 J ell V W theorem physical_small_big_permutation_pairing (σ : PhysicalPermutations S J ell) (f g : PhysicalSmallBigState P J ell X → ℂ) : (∑ s, (physicalSmallBigMeasure V W s : ℂ) * f s * g (physicalSmallBigPermutation σ s)) = ∑ s, (physicalSmallBigMeasure V W s : ℂ) * f (physicalSmallBigPermutation σ⁻¹ s) * g s := by have h := (physicalSmallBigPermutation (P := P) (X := X) σ).sum_comp (fun s => (physicalSmallBigMeasure V W s : ℂ) * f ((physicalSmallBigPermutation σ).symm s) * g s) have hi : (physicalSmallBigPermutation (P := P) (X := X) σ).symm = physicalSmallBigPermutation σ⁻¹ := by apply Equiv.ext intro s rfl simp only [physical_small_big_permutation_measure, Equiv.symm_apply_apply] at h simpa only [hi] using h theorem physical_small_big_average_pairing (f g : PhysicalSmallBigState P J ell X → ℂ) : (∑ s, (physicalSmallBigMeasure V W s : ℂ) * f s * physicalSmallBigAverage g s) = ∑ s, (physicalSmallBigMeasure V W s : ℂ) * physicalSmallBigAverage f s * g s := by calc _ = (Fintype.card (PhysicalPermutations S J ell) : ℂ)⁻¹ * ∑ σ : PhysicalPermutations S J ell, ∑ s, (physicalSmallBigMeasure V W s : ℂ) * f s * g (physicalSmallBigPermutation σ s) := by simp only [physicalSmallBigAverage, mul_sum] rw [sum_comm] apply sum_congr rfl intro σ _ apply sum_congr rfl intro s _ ring _ = (Fintype.card (PhysicalPermutations S J ell) : ℂ)⁻¹ * ∑ σ : PhysicalPermutations S J ell, ∑ s, (physicalSmallBigMeasure V W s : ℂ) * f (physicalSmallBigPermutation σ⁻¹ s) * g s := by simp_rw [physical_small_big_permutation_pairing] _ = (Fintype.card (PhysicalPermutations S J ell) : ℂ)⁻¹ * ∑ σ : PhysicalPermutations S J ell, ∑ s, (physicalSmallBigMeasure V W s : ℂ) * f (physicalSmallBigPermutation σ s) * g s := by apply congrArg (fun z : ℂ => (Fintype.card (PhysicalPermutations S J ell) : ℂ)⁻¹ * z) exact Equiv.sum_comp (Equiv.inv (PhysicalPermutations S J ell)) (fun σ => ∑ s, (physicalSmallBigMeasure V W s : ℂ) * f (physicalSmallBigPermutation σ s) * g s) _ = _ := by simp only [physicalSmallBigAverage, mul_sum, sum_mul] rw [sum_comm] apply sum_congr rfl intro s _ apply sum_congr rfl intro σ _ ring end theorem physical_small_big_average_memory_symmetric {S G : Type*} [Fintype S] [DecidableEq S] [DecidableEq G] {P : S → Finset ℕ} {Pb Z : G → Type*} {J ell B : ℕ} {t : G → ℕ} (f : PhysicalSmallBigState P J ell (ProductBoundedOrderedState Pb Z t B) → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s, x))) : ∀ s, ProductMemorySymmetric (fun x => physicalSmallBigAverage f (s, x)) := by intro s x g τ unfold physicalSmallBigAverage apply congrArg (fun z : ℂ => (Fintype.card (PhysicalPermutations S J ell) : ℂ)⁻¹ * z) apply sum_congr rfl intro σ _ exact hf (s.1, physicalPermuteLabels σ s.2) x g τ theorem physical_small_big_average_sandwich_pairing {S X : Type*} [Fintype S] [DecidableEq S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (T R : (PhysicalSmallBigState P J ell X → ℂ) → PhysicalSmallBigState P J ell X → ℂ) (f g : PhysicalSmallBigState P J ell X → ℂ) (hpair : (∑ s, (physicalSmallBigMeasure V W s : ℂ) * physicalSmallBigAverage f s * T (physicalSmallBigAverage g) s) = ∑ s, (physicalSmallBigMeasure V W s : ℂ) * R (physicalSmallBigAverage f) s * physicalSmallBigAverage g s) : (∑ s, (physicalSmallBigMeasure V W s : ℂ) * f s * physicalSmallBigAverage (T (physicalSmallBigAverage g)) s) = ∑ s, (physicalSmallBigMeasure V W s : ℂ) * physicalSmallBigAverage (R (physicalSmallBigAverage f)) s * g s := by rw [physical_small_big_average_pairing] exact hpair.trans (physical_small_big_average_pairing V W _ g) end Bounty end section /- Exact transposition through the original small conditioning map. The underlying measure remains the residue-valid small-state measure. -/ open Finset Classical namespace Bounty theorem physical_small_big_condition_conj {S X : Type*} [Fintype S] [DecidableEq S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (q : ℝ) (F : PhysicalSmallBigState P J ell X → ℂ) (d : PhysicalSharedLists P J) (x : X) (r : PhysicalResidues P) : physicalSmallBigCondition V q (fun s => (starRingEnd ℂ) (F s)) d x r = (starRingEnd ℂ) (physicalSmallBigCondition V q F d x r) := by simp only [physicalSmallBigCondition, physicalSmallCondition, map_mul, map_sum, Complex.conj_ofReal] section variable {S X : Type*} [sharedInstance1 : Fintype S] [sharedInstance2 : DecidableEq S] [sharedInstance3 : Fintype X] {P : S → Finset ℕ} [sharedInstance5 : ∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) include S X sharedInstance1 sharedInstance2 sharedInstance3 P sharedInstance5 J ell V hV theorem physical_small_big_bilinear_pairing (q ζ : ℝ) (W : X → ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists P J → ℂ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (u F : PhysicalSmallBigState P J ell X → ℂ) : (∑ s, (physicalSmallBigMeasure V W s : ℂ) * u s * physicalSmallBigAction V q ζ aux κ E target a k F s) = ∑ d, ∑ r, ∑ x, (W x : ℂ) * physicalSmallBigCondition V q u d x r * (κ d * physicalPhase ζ (physicalSharedProduct d) * physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F) d x r) := by have h := physical_small_big_pairing V hV q ζ W aux κ E target a k (fun s => (starRingEnd ℂ) (u s)) F simpa only [physical_small_big_condition_conj, Complex.conj_conj] using h /- A prefix transpose lifts exactly to the mixed measure. This statement is algebraic: its premise is an equality of the specified two prefix actions. -/ theorem physical_small_big_transpose_of_prefix_pairing (q : ℝ) (W : X → ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (E R : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] [∀ d x, Fintype (R d x)] (target : ∀ d x, E d x → X) (back : ∀ d x, R d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (b : PhysicalResidues P → ∀ d x, R d x → ℂ) (k l : X → ℤ) (u F : PhysicalSmallBigState P J ell X → ℂ) (hprefix : ∀ d, (∑ r, ∑ x, (W x : ℂ) * physicalSmallBigCondition V q u d x r * physicalSmallBigPrefixAction E target a k (physicalSmallBigCondition V q F) d x r) = ∑ r, ∑ x, (W x : ℂ) * physicalSmallBigPrefixAction R back b l (physicalSmallBigCondition V q u) d x r * physicalSmallBigCondition V q F d x r) : (∑ s, (physicalSmallBigMeasure V W s : ℂ) * u s * physicalSmallBigAction V q 0 aux (fun _ => 1) E target a k F s) = ∑ s, (physicalSmallBigMeasure V W s : ℂ) * physicalSmallBigAction V q 0 aux (fun _ => 1) R back b l u s * F s := by have hf := physical_small_big_bilinear_pairing V hV q 0 W aux (fun _ => 1) E target a k u F have hb := physical_small_big_bilinear_pairing V hV q 0 W aux (fun _ => 1) R back b l F u have hz (d : PhysicalSharedLists P J) : physicalPhase 0 (physicalSharedProduct d) = 1 := by simp [physicalPhase] simp only [hz, mul_one, one_mul] at hf hb rw [hf] calc _ = ∑ d, ∑ r, ∑ x, (W x : ℂ) * physicalSmallBigPrefixAction R back b l (physicalSmallBigCondition V q u) d x r * physicalSmallBigCondition V q F d x r := by apply sum_congr rfl intro d hd exact hprefix d _ = _ := by simpa only [mul_assoc, mul_comm, mul_left_comm] using hb.symm end end Bounty end section /- Absorb the genuine small-conditioning cost and big-memory energy cost into a fixed polynomial before choosing the omission parameter J. These are scalar bounds only; no identity for a physical operator is asserted. -/ open Finset Filter open scoped Topology namespace Bounty theorem mixed_conditioning_cost_le (small big : ℕ) {L aSmall aBig A₀ K : ℝ} (hL : 0 < L) (hA₀ : 0 ≤ A₀) (hK : 0 ≤ K) (hsmall : (small : ℝ) ≤ aSmall * Real.log L) (hbig : (big : ℝ) ≤ aBig * Real.log L) : A₀ ^ small * Real.sqrt (K ^ big) ≤ L ^ (aSmall * Real.log (max 1 A₀) + (aBig / 2) * Real.log (max 1 K)) := by have hs := repeated_big_group_energy_cost_le small hL hA₀ hsmall have hb := Real.sqrt_le_sqrt (repeated_big_group_energy_cost_le big hL hK hbig) have he : Real.sqrt (L ^ (aBig * Real.log (max 1 K))) = L ^ ((aBig / 2) * Real.log (max 1 K)) := by rw [Real.sqrt_eq_rpow, ← Real.rpow_mul hL.le] congr 1 ring rw [he] at hb calc _ ≤ L ^ (aSmall * Real.log (max 1 A₀)) * L ^ ((aBig / 2) * Real.log (max 1 K)) := mul_le_mul hs hb (Real.sqrt_nonneg _) (Real.rpow_nonneg hL.le _) _ = _ := (Real.rpow_add hL _ _).symm noncomputable def candidateMixedRareCostExponent (A₀ K : ℝ) : ℝ := (2 / (5 * Real.log 2)) * Real.log (max 1 A₀) + ((2 / (5 * Real.log 2)) / 2) * Real.log (max 1 K) theorem eventually_candidate_mixed_conditioning_cost_le {s : ℝ} (hs : 0 < s) : ∀ᶠ L : ℝ in atTop, ∀ A₀ K : ℝ, 0 ≤ A₀ → 0 ≤ K → A₀ ^ (candidateSmallPIndices s L).card * Real.sqrt (K ^ (candidateBigPIndices s L).card) ≤ L ^ candidateMixedRareCostExponent A₀ K := by obtain ⟨v, V, _, _, hpool⟩ := exists_candidate_P_pool_bounds hs filter_upwards [hpool] with L hp intro A₀ K hA₀ hK have hsmall : (candidateSmallPIndices s L).card ≤ (candidatePIndices s L).card := card_le_card (show candidateSmallPIndices s L ⊆ candidatePIndices s L from subset_union_left) have hbig : (candidateBigPIndices s L).card ≤ (candidatePIndices s L).card := card_le_card (show candidateBigPIndices s L ⊆ candidatePIndices s L from subset_union_right) apply mixed_conditioning_cost_le _ _ (zero_lt_one.trans_le hp.1) hA₀ hK · exact (by exact_mod_cast hsmall : ((candidateSmallPIndices s L).card : ℝ) ≤ ((candidatePIndices s L).card : ℝ)).trans hp.2.2.2.1 · exact (by exact_mod_cast hbig : ((candidateBigPIndices s L).card : ℝ) ≤ ((candidatePIndices s L).card : ℝ)).trans hp.2.2.2.1 theorem exists_candidate_mixed_rare_parameter {s : ℝ} (hs : 0 < s) (ell : ℕ) (hell : 0 < ell) (J₀ : ℕ) (A₀ K A E : ℝ) (hA₀ : 0 ≤ A₀) (hK : 0 ≤ K) : ∃ J : ℕ, J₀ ≤ J ∧ ((1 / (20 * Real.log 2)) / 2) * Real.log (((J + ell).choose ell : ℕ) : ℝ) > A + candidateMixedRareCostExponent A₀ K + E + 3 ∧ ∀ᶠ L : ℝ in atTop, let cost := 2 * L ^ A * (A₀ ^ (candidateSmallPIndices s L).card * Real.sqrt (K ^ (candidateBigPIndices s L).card)) * Real.sqrt ((⌈L ^ 2⌉₊ : ℝ) / (((J + ell).choose ell) ^ (candidateSmallPIndices s L).card : ℕ)) cost ≤ (1 / 2 : ℝ) * L ^ (-E) ∧ L ^ (-(E + 1)) + cost ≤ L ^ (-E) := by obtain ⟨J, hJ, hgain, hrare⟩ := exists_candidate_rare_transfer_parameter hs ell hell J₀ (A + candidateMixedRareCostExponent A₀ K) E refine ⟨J, hJ, hgain, ?_⟩ filter_upwards [hrare, eventually_candidate_mixed_conditioning_cost_le hs, eventually_ge_atTop (2 : ℝ)] with L hr hc hL dsimp only have hL0 : 0 < L := by linarith have hcost : 2 * L ^ A * (A₀ ^ (candidateSmallPIndices s L).card * Real.sqrt (K ^ (candidateBigPIndices s L).card)) * Real.sqrt ((⌈L ^ 2⌉₊ : ℝ) / (((J + ell).choose ell) ^ (candidateSmallPIndices s L).card : ℕ)) ≤ (1 / 2 : ℝ) * L ^ (-E) := by calc _ ≤ 2 * L ^ A * L ^ candidateMixedRareCostExponent A₀ K * Real.sqrt ((⌈L ^ 2⌉₊ : ℝ) / (((J + ell).choose ell) ^ (candidateSmallPIndices s L).card : ℕ)) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hc A₀ K hA₀ hK) (by positivity)) (Real.sqrt_nonneg _) _ = 2 * L ^ (A + candidateMixedRareCostExponent A₀ K) * Real.sqrt ((⌈L ^ 2⌉₊ : ℝ) / (((J + ell).choose ell) ^ (candidateSmallPIndices s L).card : ℕ)) := by rw [Real.rpow_add hL0] ring _ ≤ _ := hr refine ⟨hcost, ?_⟩ have hclean := rpow_next_saving_le_half E L hL linarith end Bounty end section /- The actual small and big candidate pools used by the mixed-state energy bounds. Their residue moduli are nonzero because all labels are prime. -/ namespace Bounty abbrev CandidateSmallGroup (scale L : ℝ) := ↥(candidateSmallPIndices scale L) noncomputable abbrev candidateSmallPool (scale L : ℝ) (g : CandidateSmallGroup scale L) : Finset ℕ := candidatePBand (scale * L) g.val end Bounty end section /- Exact small conditioning with two endpoint gates. Only the residual coefficient is a function of the small prefix; endpoint gates may depend on the complete small source or target. No norm bound is used. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSmallBigEndpointPhase {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (E : PhysicalSharedLists P J → X → Type*) (target : ∀ d x, E d x → X) (Ψ : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (sourceGate targetGate : PhysicalSmallBigState P J ell X → ℂ) (s : PhysicalSmallBigState P J ell X) (e : PhysicalSmallBigEvent E s) : ℂ := (starRingEnd ℂ) (sourceGate s) * Ψ s.1.1 (physicalSharedPrefix s.1.2) s.2 e.2 * targetGate (physicalSmallBigTarget E target k s e) theorem physical_small_big_phased_endpoint_gates {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (q : ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℝ) (Ψ : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (sourceGate targetGate F : PhysicalSmallBigState P J ell X → ℂ) (s : PhysicalSmallBigState P J ell X) : physicalSmallBigPhasedAction V q E target a k (physicalSmallBigEndpointPhase E target Ψ k sourceGate targetGate) F s = (starRingEnd ℂ) (sourceGate s) * physicalSmallBigAction V q 0 aux (fun _ => 1) E target (fun r d x e => (a r d x e : ℂ) * Ψ r d x e) k (fun t => targetGate t * F t) s := by simp only [physicalSmallBigPhasedAction, physicalSmallBigAction, mul_sum, physical_small_big_event_weight_phase, physicalSmallBigEndpointPhase, physicalPhase, zero_mul, Complex.ofReal_zero, Complex.exp_zero, one_mul] apply sum_congr rfl intro e _ ring theorem physical_small_big_gated_pairing {S X : Type*} [Fintype S] [dS : DecidableEq S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (q : ℝ) (W : X → ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℝ) (Ψ : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (sourceGate targetGate u F : PhysicalSmallBigState P J ell X → ℂ) : (∑ s, (physicalSmallBigMeasure V W s : ℂ) * (starRingEnd ℂ) (u s) * physicalSmallBigPhasedAction V q E target a k (physicalSmallBigEndpointPhase E target Ψ k sourceGate targetGate) F s) = ∑ d, ∑ r, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition V q (fun s => sourceGate s * u s) d x r) * physicalSmallBigPrefixAction E target (fun r d x e => (a r d x e : ℂ) * Ψ r d x e) k (physicalSmallBigCondition V q (fun s => targetGate s * F s)) d x r := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) calc _ = ∑ s, (physicalSmallBigMeasure V W s : ℂ) * (starRingEnd ℂ) (sourceGate s * u s) * physicalSmallBigAction V q 0 aux (fun _ => 1) E target (fun r d x e => (a r d x e : ℂ) * Ψ r d x e) k (fun t => targetGate t * F t) s := by apply sum_congr rfl intro s _ rw [physical_small_big_phased_endpoint_gates V q aux] simp only [map_mul] ring _ = _ := by have h := physical_small_big_pairing V hV q 0 W aux (fun _ => 1) E target (fun r d x e => (a r d x e : ℂ) * Ψ r d x e) k (fun s => sourceGate s * u s) (fun s => targetGate s * F s) simp only [physicalPhase, zero_mul, Complex.ofReal_zero, Complex.exp_zero, one_mul] at h convert h using 1 congr 3 end Bounty end section /- Exact per-list energy bounds for the pool-invariant convolution on positive positions. -/ open Finset namespace Bounty theorem invariant_triple_endpoint_int_divisible_energy (Q : Finset ℕ) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (S : Finset ℤ) (d N : ℕ) (hd : d ∈ Nat.factoredNumbers Q) (hdiv : ∀ n ∈ S, d ∣ n.natAbs) (hS : ∀ n ∈ S, 0 ≤ n ∧ n ≤ (N : ℤ)) : (∑ n ∈ S, ‖invariantTripleEndpoint Q α β γ n.natAbs‖ ^ 2) ≤ (A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 / d := by classical have hinj : Set.InjOn Int.natAbs S := by intro a ha b hb hab have hab' := congrArg (fun n : ℕ => (n : ℤ)) hab simpa only [Int.natAbs_of_nonneg (hS a ha).1, Int.natAbs_of_nonneg (hS b hb).1] using hab' calc _ = ∑ n ∈ S.image Int.natAbs, ‖invariantTripleEndpoint Q α β γ n‖ ^ 2 := by rw [sum_image] exact fun a ha b hb hab => hinj ha hb hab _ ≤ _ := invariant_triple_endpoint_divisible_energy Q α β γ hA hB hC hα hβ hγ (S.image Int.natAbs) d N hd (by intro m hm obtain ⟨n, hn, rfl⟩ := mem_image.mp hm exact hdiv n hn) (by intro m hm obtain ⟨n, hn, rfl⟩ := mem_image.mp hm have ht : (n.natAbs : ℤ) ≤ N := by rw [Int.natAbs_of_nonneg (hS n hn).1] exact (hS n hn).2 exact_mod_cast ht) theorem invariant_triple_endpoint_list_energy {G : Type*} [Fintype G] (P : G → Finset ℕ) (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (Q : Finset ℕ) (hQ : ∀ g, P g ⊆ Q) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (S : Finset ℤ) (N : ℕ) (hS : ∀ n ∈ S, 0 ≤ n ∧ n ≤ (N : ℤ)) {J ell : ℕ} (L : PhysicalMarkLists P J ell) : (∑ n ∈ S, if ∀ g s, ((L g s).val : ℤ) ∣ n then ‖invariantTripleEndpoint Q α β γ n.natAbs‖ ^ 2 else 0) ≤ ((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∏ g, ∏ s, 1 / ((L g s).val : ℝ) := by classical rw [← sum_filter] have h := invariant_triple_endpoint_int_divisible_energy Q α β γ hA hB hC hα hβ hγ (S.filter (fun n => ∀ g s, ((L g s).val : ℤ) ∣ n)) (physicalMarkProduct L) N (physical_mark_product_supported hprime Q hQ L) (by intro n hn; exact (physical_mark_product_dvd_iff hP hprime L n).mpr (mem_filter.mp hn).2) (by intro n hn; exact hS n (mem_filter.mp hn).1) rw [div_eq_mul_one_div, physical_mark_product_inverse L] at h exact h end Bounty end section /- The original small-residue normalization is one global scalar. It multiplies the whole mixed-state measure, rather than each transition. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSmallBigNormalizedMeasure {S X : Type*} [Fintype S] [dS : DecidableEq S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (s : PhysicalSmallBigState P J ell X) : ℝ := physicalResidueInitialMass V s.1 * W s.2 theorem physical_small_residue_factor_pos {S : Type*} [Fintype S] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] : 0 < ∏ p : PhysicalPrime P, (1 : ℝ) / p.2.val := by apply prod_pos intro p _ exact one_div_pos.mpr (by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne p.2.val)) theorem physical_small_big_normalized_measure_eq {S X : Type*} [Fintype S] [dS : DecidableEq S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (s : PhysicalSmallBigState P J ell X) : physicalSmallBigNormalizedMeasure V W s = (∏ p : PhysicalPrime P, (1 : ℝ) / p.2.val) * physicalSmallBigMeasure V W s := by unfold physicalSmallBigNormalizedMeasure physicalSmallBigMeasure by_cases h : physicalResidueMarksValid s.1.1 s.1.2 · rw [if_pos h, physical_residue_initial_mass_of_valid V s.1.1 s.1.2 h] ring · rw [if_neg h, physical_residue_initial_mass_zero V s.1 h] ring theorem physical_small_big_normalized_energy_eq {S X : Type*} [Fintype S] [dS : DecidableEq S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (F : PhysicalSmallBigState P J ell X → ℂ) : finiteWeightedEnergy (physicalSmallBigNormalizedMeasure V W) F = (∏ p : PhysicalPrime P, (1 : ℝ) / p.2.val) * physicalSmallBigEnergy V W F := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) rw [← physical_small_big_energy_eq] simp only [finiteWeightedEnergy, physical_small_big_normalized_measure_eq, mul_assoc, mul_sum] congr 3 theorem physical_small_big_normalized_norm_eq {S X : Type*} [Fintype S] [dS : DecidableEq S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (W : X → ℝ) (F : PhysicalSmallBigState P J ell X → ℂ) : cleanActiveNorm (physicalSmallBigNormalizedMeasure V W) F = Real.sqrt (∏ p : PhysicalPrime P, (1 : ℝ) / p.2.val) * cleanActiveNorm (physicalSmallBigMeasure V W) F := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) change Real.sqrt (finiteWeightedEnergy (physicalSmallBigNormalizedMeasure V W) F) = _ rw [physical_small_big_normalized_energy_eq, Real.sqrt_mul (physical_small_residue_factor_pos (P := P)).le, physical_small_big_sqrt_energy_eq_norm] congr 3 end Bounty end section /- Ghost visits on the genuine mixed state keep its small coordinate fixed. Their literal event sum, pending symmetry, and energy bounds use the original small measure and the product-factorial big memory law. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSmallBigGhostAction {S G : Type*} [Fintype G] {Ps : S → Finset ℕ} {P Z : G → Type*} [∀ g, Fintype (Z g)] {J ell : ℕ} (A D C ν : ∀ g, Z g → ℝ) (M : G → ℕ) (B : ℕ) (phase : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B), CoupledGhostEvent M B s.2 → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : ℂ := coupledGhostCutoffOperator A D C ν M B (fun x e => phase (s.1, x) e) (fun x => F (s.1, x)) s.2 theorem physical_small_big_ghost_eq_event_sum {S G : Type*} [Fintype G] {Ps : S → Finset ℕ} {P Z : G → Type*} [∀ g, Fintype (Z g)] {J ell : ℕ} (A D C ν : ∀ g, Z g → ℝ) (M : G → ℕ) (B : ℕ) (phase : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B), CoupledGhostEvent M B s.2 → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : physicalSmallBigGhostAction A D C ν M B phase F s = ∑ e : CoupledGhostEvent M B s.2, (coupledGhostJointEventWeight A D C ν M B s.2 e : ℂ) * phase s e * F (s.1, coupledGhostJointEventTarget M B s.2 e) := coupled_ghost_cutoff_eq_joint_event_sum A D C ν M B _ _ s.2 theorem physical_small_big_ghost_one_memory_symmetric {S G : Type*} [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] [∀ g, DecidableEq (Z g)] {J ell : ℕ} (A D C ν : ∀ g, Z g → ℝ) (M : G → ℕ) (B : ℕ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : ∀ s, ProductMemorySymmetric (fun x => physicalSmallBigGhostAction A D C ν M B (fun _ _ => 1) F (s, x)) := by intro s exact coupled_ghost_cutoff_one_symmetric A D C ν M B (fun x => F (s, x)) (hF s) theorem physical_small_big_absolute_ghost_energy_le_uniform {S G : Type*} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (μ : ∀ g, P g → ℝ) (q ρ : ℝ) (V : G → ℝ) (v vmax : ℝ) (M : G → ℕ) (B : ℕ) (hμ : ∀ g p, 0 < μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hρ : 0 < ρ) (hV : ∀ g, 0 ≤ V g) (hVmax : ∀ g, V g ≤ vmax) (hv : 0 < v) (hD : q / ρ ^ 2 + ((1 - q) / ρ) / v ≤ 1) (hC : ∀ g, q / ρ ^ 2 + ((1 - q) * V g / ρ) / v ≤ 1) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigGhostAction (fun g => physicalGhostRetention (n g) q ρ) (fun g z => |physicalGhostTermination (n g) q ρ z|) (fun g z => |physicalGhostBirth (n g) q ρ (V g) z|) (fun g => unrestrictedResidueWeight (μ g)) M B (fun _ _ => 1) F) ≤ physicalGhostUniformEnergyBound ρ vmax v ^ Fintype.card G * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by apply physical_small_big_fiber_energy_le Vs hVs _ F _ _ intro s have he : (fun x => physicalSmallBigGhostAction (fun g => physicalGhostRetention (n g) q ρ) (fun g z => |physicalGhostTermination (n g) q ρ z|) (fun g z => |physicalGhostBirth (n g) q ρ (V g) z|) (fun g => unrestrictedResidueWeight (μ g)) M B (fun _ _ => 1) F (s, x)) = physicalAbsoluteGhostCutoffProductOperator n μ q ρ V M B univ (fun x => F (s, x)) := by exact coupled_ghost_cutoff_one_eq_coordinate_action _ _ _ _ M B (fun x => F (s, x)) rw [he] simpa only [card_univ] using physical_ghost_absolute_cutoff_product_energy_le n μ q ρ V v vmax M B hμ hmass hq0 hq1 hρ hV hVmax hv hD hC univ (fun x => F (s, x)) (hF s) end Bounty end section /- Exact finite Cauchy expansion for the two shifted product equations. -/ open Finset open scoped ComplexConjugate namespace Bounty noncomputable def typeIIEquationTerm (α aH : ℕ → ℂ) (e n : ℕ) (v : ℕ × ℕ) : ℂ := if v.1 * n = 2 * e * v.2 + 1 then α v.1 * aH v.2 else 0 noncomputable def typeIIInnerSum (M H : Finset ℕ) (α aH : ℕ → ℂ) (e n : ℕ) : ℂ := ∑ v ∈ M ×ˢ H, typeIIEquationTerm α aH e n v theorem typeII_equation_same_m {e n m h h' : ℕ} (he : 0 < e) (hh : m*n=2*e*h+1) (hh' : m*n=2*e*h'+1) : h=h' := by have hmul : (2*e)*h=(2*e)*h' := by omega exact Nat.eq_of_mul_eq_mul_left (by omega : 0<2*e) hmul theorem typeII_equation_term_same_first {e n : ℕ} (he : 0 v.1≠w.1), (typeIIEquationTerm α aH e n v * conj (typeIIEquationTerm α aH e n w)).re := by classical unfold typeIIInnerSum rw [complex_finite_sum_norm_sq, ← sum_add_distrib] apply sum_congr rfl intro v hv have hdiag : (∑ w ∈ (M ×ˢ H).filter (fun w => v.1=w.1), (typeIIEquationTerm α aH e n v * conj (typeIIEquationTerm α aH e n w)).re) = ‖typeIIEquationTerm α aH e n v‖^2 := by rw [sum_eq_single v] · have h := congrArg Complex.re (Complex.normSq_eq_conj_mul_self (z := typeIIEquationTerm α aH e n v)) simpa only [Complex.ofReal_re, Complex.normSq_eq_norm_sq, mul_comm] using h.symm · intro w hw hwv rw [typeII_equation_term_same_first he α aH (mem_filter.mp hw).2 (Ne.symm hwv)] rfl · exact fun h => (h (mem_filter.mpr ⟨hv,rfl⟩)).elim rw [← hdiag] exact (sum_filter_add_sum_filter_not (M ×ˢ H) (fun w => v.1=w.1) _).symm theorem finite_complex_cauchy (S : Finset (ℕ × ℕ)) (a b : ℕ × ℕ → ℂ) : ‖∑ v ∈ S, a v*b v‖^2 ≤ (∑ v ∈ S, ‖a v‖^2)*(∑ v ∈ S, ‖b v‖^2) := by have ht : ‖∑ v ∈ S, a v*b v‖ ≤ ∑ v ∈ S, ‖a v‖*‖b v‖ := by simpa only [norm_mul] using norm_sum_le S (fun v => a v*b v) exact (pow_le_pow_left₀ (norm_nonneg _) ht 2).trans (sum_mul_sq_le_sq_mul_sq S (fun v => ‖a v‖) (fun v => ‖b v‖)) theorem typeII_cauchy_majorant (E N M H : Finset ℕ) (aE β α aH : ℕ → ℂ) (η : ℕ → ℕ → ℝ) (hη : ∀ e∈E, ∀ n∈N, 1≤η e n) : ‖∑ e∈E, ∑ n∈N, aE e*β n*typeIIInnerSum M H α aH e n‖^2 ≤ ((∑ e∈E, ‖aE e‖^2)*(∑ n∈N, ‖β n‖^2))* ∑ e∈E, ∑ n∈N, η e n*‖typeIIInnerSum M H α aH e n‖^2 := by have h := finite_complex_cauchy (E ×ˢ N) (fun v => aE v.1*β v.2) (fun v => typeIIInnerSum M H α aH v.1 v.2) simp only [sum_product, norm_mul, mul_pow] at h have hfactor : (∑ e∈E, ∑ n∈N, ‖aE e‖^2*‖β n‖^2) = (∑ e∈E, ‖aE e‖^2)*(∑ n∈N, ‖β n‖^2) := by rw [sum_mul] simp only [mul_sum] rw [hfactor] at h apply h.trans apply mul_le_mul_of_nonneg_left _ (by positivity) apply sum_le_sum intro e he apply sum_le_sum intro n hn exact le_mul_of_one_le_left (sq_nonneg _) (hη e he n hn) end Bounty end section /- Positive actual candidate allocation branches have a fixed logarithmic size loss. -/ open Finset Real namespace Bounty theorem candidate_allocation_exp_range {c L : ℝ} (hc : 0 < c) (hL : 0 < L) (hlog : 0 < log L) {r jStar : ℕ} (hr : 6 ≤ r) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) {R : ℝ} (hR : 0 ≤ R) (hcap : R ≤ smoothAllocationInventory _ (fun i => log (candidateAllocationValue c L r jStar x i)) (candidateAllocationActive c L r jStar)+88*log L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hweight : 0 < candidateAllocationWeight c L r jStar x R take) : exp (R-88*log L) ≤ (candidateAllocatedFactor c L r jStar x take : ℝ) ∧ (candidateAllocatedFactor c L r jStar x take : ℝ) ≤ exp R := by exact smooth_allocation_product_range _ (candidate_allocation_value_pos c L r jStar x) _ _ _ _ _ (fun i => by positivity) hR hcap (candidate_allocation_room hc hL hlog hr x) hweight theorem candidate_allocation_size_range {c L E : ℝ} (hc : 0 < c) (hL : 0 < L) (hlog : 0 < log L) (hE : 0 < E) (hE1 : 1 ≤ E) {r jStar : ℕ} (hr : 6 ≤ r) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (hcap : log E ≤ smoothAllocationInventory _ (fun i => log (candidateAllocationValue c L r jStar x i)) (candidateAllocationActive c L r jStar)+88*log L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hweight : 0 < candidateAllocationWeight c L r jStar x (log E) take) : E/L^88 ≤ (candidateAllocatedFactor c L r jStar x take : ℝ) ∧ (candidateAllocatedFactor c L r jStar x take : ℝ) ≤ E := by have hh := candidate_allocation_exp_range hc hL hlog hr x (log_nonneg hE1) hcap take hweight rw [exp_sub, exp_log hE] at hh have he : exp (88*log L) = L^88 := by rw [show (88 : ℝ)*log L = (88 : ℕ)*log L by norm_num, exp_nat_mul, exp_log hL] rwa [he] at hh end Bounty end section /- The localized pairing bound uses the exact original alternating physical root moment. -/ open scoped BigOperators InnerProductSpace namespace Bounty theorem physical_endpoint_block_gram_bound {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (starts : Finset ℤ) (R b D : ℕ) (hR : 2 ≤ R) (hD : 0 < D) (hstep : physicalOperatorStepBound P J ell patterns C k ≤ D) (f g : ℤ → ℂ) (hf : ∀ n ∈ reachablePositions starts (2 * R * b), n ∉ starts → f n = 0) {M : ℝ} (hM : 0 ≤ M) (hfM : ∀ n ∈ starts, ‖f n‖ ≤ M) : let positions := reachablePositions starts (2 * R * b) let A := physicalHilbertOperator V patterns C q ζ k K positions let F := physicalEndpointVector P V J ell q positions f let H := physicalEndpointVector P V J ell q positions g ‖inner ℂ F (A H)‖ ≤ ((D : ℝ) * M ^ 2) ^ (1 / (2 * (R : ℝ))) * (3 * ‖H‖ ^ 2) ^ (1 / 2 : ℝ) * (‖F‖ ^ 2) ^ ((1 - 1 / (R : ℝ)) / 2) * ((starts.card : ℝ) * (physicalRootMoment V patterns C q (fun j i => if j % 2 = 0 then -ζ i else ζ i) (fun j i => if j % 2 = 0 then -k i else k i) (fun j i a c aux => if j % 2 = 0 then (starRingEnd ℂ) (K i c a aux) else K i a c aux) starts (2 * R - 1) b).re) ^ (1 / (2 * (R : ℝ))) := by classical dsimp only let positions := reachablePositions starts (2 * R * b) let A := physicalHilbertOperator V patterns C q ζ k K positions let pos := fun x : physicalCutoff P J ell positions => x.val.1 let u := fun n => finiteFiberVector pos (physicalStateMass V J ell) n let kernel := fun x y : physicalCutoff P J ell positions => physicalSymmetricKernel (fun a c => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) a c) x.val y.val let f₀ := fun n => f n * (physicalDamping P J ell q n : ℂ) let g₀ := fun n => g n * (physicalDamping P J ell q n : ℂ) have hfs : ∀ x, pos x ∉ starts → f₀ (pos x) = 0 := by intro x hx dsimp only [f₀, pos] rw [hf x.val.1 ((mem_physical_cutoff P J ell positions x.val).mp x.property) hx, zero_mul] have hmax : ∀ n ∈ starts, ‖f₀ n‖ ≤ M := by intro n hn have hd := physical_damping_unit P J ell hq0 hq1 n dsimp only [f₀] rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hd.1] simpa only [mul_one] using mul_le_mul (hfM n hn) hd.2 hd.1 hM have hk : ∀ x y, (D : ℤ) < |pos x - pos y| → kernel x y = 0 := by intro x y hxy apply physical_operator_zero_of_far V patterns C q ζ k K x.val y.val have hcast : (physicalOperatorStepBound P J ell patterns C k : ℤ) < |y.val.1 - x.val.1| := by have hs : (physicalOperatorStepBound P J ell patterns C k : ℤ) ≤ D := by exact_mod_cast hstep exact hs.trans_lt (by simpa only [pos, abs_sub_comm] using hxy) rw [← Int.natCast_natAbs] at hcast exact_mod_cast hcast have hb := finite_position_block_gram_bound pos (physical_state_mass_pos V hV J ell).le kernel starts (by exact_mod_cast hD : (0 : ℤ) < D) f₀ g₀ hfs hk hM hmax hR have hr := physical_root_moment_re_eq_fiber_gram V hV patterns C q ζ k K starts R b (by omega) dsimp only at hr have hsum : (starts.card : ℝ) * (physicalRootMoment V patterns C q (fun j i => if j % 2 = 0 then -ζ i else ζ i) (fun j i => if j % 2 = 0 then -k i else k i) (fun j i a c aux => if j % 2 = 0 then (starRingEnd ℂ) (K i c a aux) else K i a c aux) starts (2 * R - 1) b).re = ∑ n ∈ starts, (inner ℂ (u n) (((A * A.adjoint) ^ R) (u n))).re := by by_cases hs : starts.card = 0 · have he : starts = ∅ := Finset.card_eq_zero.mp hs simp only [he, Finset.card_empty, Nat.cast_zero, zero_mul, Finset.sum_empty] · have hsr : (starts.card : ℝ) ≠ 0 := by exact_mod_cast hs have hh := (eq_div_iff hsr).mp hr rw [mul_comm] at hh exact hh change _ ≤ _ * _ * _ * (∑ n ∈ starts, (inner ℂ (u n) (((A * A.adjoint) ^ R) (u n))).re) ^ (1 / (2 * (R : ℝ))) at hb rw [← hsum] at hb simpa only [physicalEndpointVector, physicalHilbertOperator, positions, pos, kernel, f₀, g₀, Int.toNat_natCast] using hb end Bounty end section /- Exact lifted correlation after removing the prescribed shared primes from both invariant triple endpoints. All original damping and exclusion factors remain. -/ open Finset namespace Bounty end Bounty end section /- Exact character expansion with the full signed determinant modulus. -/ open Finset open scoped ComplexConjugate namespace Bounty theorem typeII_congruence_character_indicator {q : ℕ} [NeZero q] (m m' : ℕ) (hm' : m'.Coprime q) : (if Nat.ModEq q m m' then (1 : ℂ) else 0) = (1 / (q.totient : ℂ)) * ∑ χ : DirichletCharacter ℂ q, χ (m : ZMod q) * conj (χ (m' : ZMod q)) := by classical have hu : IsUnit (m' : ZMod q) := (ZMod.isUnit_iff_coprime m' q).mpr hm' have hs := DirichletCharacter.sum_char_inv_mul_char_eq ℂ hu (m : ZMod q) have hsum : (∑ χ : DirichletCharacter ℂ q, χ (m : ZMod q) * conj (χ (m' : ZMod q))) = if Nat.ModEq q m m' then (q.totient : ℂ) else 0 := by calc _ = ∑ χ : DirichletCharacter ℂ q, χ (m' : ZMod q)⁻¹ * χ (m : ZMod q) := by apply sum_congr rfl intro χ hχ rw [character_conj_apply_unit χ hu, mul_comm] _ = _ := by rw [hs] congr 1 rw [ZMod.natCast_eq_natCast_iff] exact propext Nat.ModEq.comm rw [hsum] have hφ : (q.totient : ℂ) ≠ 0 := by exact_mod_cast (Nat.totient_pos.mpr (NeZero.pos q)).ne' split_ifs <;> simp [hφ] theorem typeII_congruence_character_sum {q : ℕ} [NeZero q] {ι : Type*} (S : Finset ι) (m m' : ι → ℕ) (f : ι → ℂ) (hm' : ∀ x ∈ S, (m' x).Coprime q) : (∑ x ∈ S with Nat.ModEq q (m x) (m' x), f x) = (1 / (q.totient : ℂ)) * ∑ χ : DirichletCharacter ℂ q, ∑ x ∈ S, f x * χ (m x : ZMod q) * conj (χ (m' x : ZMod q)) := by classical rw [sum_filter] simp only [mul_sum] rw [sum_comm] apply sum_congr rfl intro x hx calc (if Nat.ModEq q (m x) (m' x) then f x else 0) = f x * (if Nat.ModEq q (m x) (m' x) then (1 : ℂ) else 0) := by split_ifs <;> simp _ = _ := by rw [typeII_congruence_character_indicator (m x) (m' x) (hm' x hx)] simp only [mul_sum] apply sum_congr rfl intro χ hχ ring theorem typeII_signed_congruence_iff {k : ℤ} {m m' : ℕ} : Int.ModEq (2 * |k|) (m : ℤ) (m' : ℤ) ↔ Nat.ModEq (2 * k.natAbs) m m' := by have hq : ((2 * k.natAbs : ℕ) : ℤ) = 2 * |k| := by simp only [Nat.cast_mul, Nat.cast_ofNat, Int.natCast_natAbs] rw [← hq, Int.natCast_modEq_iff] theorem typeII_rough_coprime_twice_natAbs {m : ℕ} {k : ℤ} {W : ℝ} (hm : 0 < m) (hk : k ≠ 0) (hW : 2 ≤ W) (hrough : ∀ p ∈ m.primeFactors, W < (p : ℝ)) (hsmall : (k.natAbs : ℝ) ≤ W) : Nat.Coprime m (2 * k.natAbs) := by have htwo : m.Coprime 2 := by apply Nat.coprime_of_dvd intro p hp hpm hptwo have hlarge := hrough p (Nat.mem_primeFactors.mpr ⟨hp, hpm, hm.ne'⟩) have hp2 : p ≤ 2 := Nat.le_of_dvd (by decide) hptwo have hp2' : (p : ℝ) ≤ 2 := by exact_mod_cast hp2 linarith exact htwo.mul_right (typeII_rough_coprime_natAbs hm hk hrough hsmall) end Bounty end section /- Uniform removal of the large P-part for bounded complex tests on rough shifted divisors. -/ open Finset Filter Real namespace Bounty theorem norm_weighted_finite_fibers_le (T : Finset ℕ) (fibers : ℕ → Finset ℕ) (a : ℕ → ℝ) (F : ℕ → ℕ → ℂ) (M : ℝ) (ha : ∀ u ∈ T, 0 ≤ a u) (hF : ∀ u ∈ T, ∀ m ∈ fibers u, ‖F u m‖ ≤ M) : ‖∑ u ∈ T, (a u : ℂ)*∑ m ∈ fibers u, F u m‖ ≤ M*(∑ u ∈ T, a u*((fibers u).card : ℝ)) := by calc _ ≤ ∑ u ∈ T, ‖(a u : ℂ)*∑ m ∈ fibers u, F u m‖ := norm_sum_le _ _ _ ≤ ∑ u ∈ T, a u*(((fibers u).card : ℝ)*M) := by apply sum_le_sum intro u hu rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (ha u hu)] apply mul_le_mul_of_nonneg_left _ (ha u hu) calc _ ≤ ∑ m ∈ fibers u, ‖F u m‖ := norm_sum_le _ _ _ ≤ ∑ _m ∈ fibers u, M := sum_le_sum (fun m hm => hF u hu m hm) _ = _ := by simp _ = _ := by rw [mul_sum] apply sum_congr rfl intro u hu ring end Bounty end section /- Polynomial separated-coefficient bounds uniform over allocation patterns and unit-bounded twists. -/ open Finset Filter namespace Bounty theorem norm_candidate_remaining_coefficient_le_divisors {c L : ℝ} {r jStar : ℕ} (hcL : 0 ≤ c*L) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (htwist : ∀ slot p, p ∈ candidateQSlotChoices c L r jStar slot → ‖twist slot p‖ ≤ 1) (h : ℕ) (hh : h ≠ 0) : ‖candidateRemainingComplexCoefficient c L r jStar take twist h‖ ≤ (h.divisors.card : ℝ) := by apply (norm_candidate_remaining_coefficient_le_rough_divisors hcL hr hj take hkeep twist htwist h).trans apply Nat.cast_le.mpr apply card_le_card intro p hp exact Nat.mem_divisors.mpr ⟨(mem_filter.mp hp).2, hh⟩ theorem exists_candidate_separated_coefficients_polynomial_bound {c : ℝ} (hc : 0 < c) {r : ℕ} (hr : 0 < r) : ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, ∀ hj : jStar ∈ candidateQIndices c L, ∀ take : Fin ((candidateQIndices c L).card*r) → Bool, ∀ hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false, ∀ twist : (candidateQIndices c L) × Fin r → ℕ → ℂ, (∀ slot p, p ∈ candidateQSlotChoices c L r jStar slot → ‖twist slot p‖ ≤ 1) → (∀ e : ℕ, ‖candidateTakenComplexCoefficient c L r jStar take twist e‖ ≤ L^C) ∧ (∀ q : ℕ, ‖candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist q‖ ≤ 1) ∧ (∀ h : ℕ, ‖candidateRemainingComplexCoefficient c L r jStar take twist h‖ ≤ (((candidateRoughBand c L jStar).filter (fun p => p ∣ h)).card : ℝ)) := by obtain ⟨C, hC, hpoly⟩ := exists_candidate_factorial_normalization_polynomial_bound hc r refine ⟨C, hC, ?_⟩ filter_upwards [hpoly, eventually_ge_atTop (0 : ℝ)] with L hpoly hL intro jStar hj take hkeep twist htwist have hcL : 0 ≤ c*L := mul_nonneg hc.le hL refine ⟨?_, ?_, ?_⟩ · intro e exact (norm_candidate_taken_coefficient_le_factorial_pow hcL hr hj take hkeep twist htwist e).trans hpoly · intro q exact norm_candidate_residual_prime_coefficient_le_one hcL hr hj take hkeep twist htwist q · intro h exact norm_candidate_remaining_coefficient_le_rough_divisors hcL hr hj take hkeep twist htwist h end Bounty end section /- Explicit exponent budgets for the low-rank forest contribution. -/ open Finset Classical namespace Bounty theorem birthForest_low_rank_power_saving {m : ℕ} (F : BirthForestCode m → ℂ) (r₀ N : ℕ) {L H G Cv Ca M Ch E : ℝ} (hL : 2 ≤ L) (hH : 0 ≤ H) (hM : 0 ≤ M) (hD : 0 ≤ G + Ca + M) (hm : (m : ℝ) ≤ L ^ M) (hHb : H ≤ L ^ Ch) (hfixed : Cv + Ch + M + 1 ≤ (N : ℝ) / 2) (haffected : 2 * r₀ * (G + Ca + M) ≤ (N : ℝ) / 2) (hgain : E + Cv + 1 ≤ G) (hF : ∀ code, birthForestRank code < r₀ → ‖F code‖ ≤ H * L ^ ((-G + Cv) * N + Cv + 2 * birthForestRank code * (G + Ca))) : ‖∑ code ∈ (univ : Finset (BirthForestCode m)).filter (fun code => birthForestRank code < r₀), (-1 : ℂ) ^ birthForestRank code * F code‖ ≤ L ^ (-(E * N)) := by have hL1 : 1 ≤ L := by linarith have hL0 : 0 < L := by linarith have hM1 : 1 ≤ L ^ M := Real.one_le_rpow hL1 hM have hm1 : (m : ℝ) + 1 ≤ L ^ (M + 1) := by calc (m : ℝ) + 1 ≤ L ^ M + L ^ M := add_le_add hm hM1 _ ≤ L ^ M * L := by nlinarith [Real.rpow_pos_of_pos hL0 M] _ = L ^ (M + 1) := by rw [Real.rpow_add hL0, Real.rpow_one] apply (birthForest_low_rank_power_bound F r₀ hL1 hH hD hm hF).trans calc _ ≤ L ^ (M + 1) * L ^ Ch * L ^ ((-G + Cv) * N + Cv + 2 * r₀ * (G + Ca + M)) := by apply mul_le_mul_of_nonneg_right _ (Real.rpow_pos_of_pos hL0 _).le exact mul_le_mul hm1 hHb hH (Real.rpow_pos_of_pos hL0 _).le _ = L ^ ((-G + Cv) * N + Cv + Ch + M + 1 + 2 * r₀ * (G + Ca + M)) := by rw [← Real.rpow_add hL0, ← Real.rpow_add hL0] congr 1 ring _ ≤ L ^ (-(E * N)) := by apply Real.rpow_le_rpow_of_exponent_le hL1 have hg := mul_le_mul_of_nonneg_right hgain (Nat.cast_nonneg N : (0 : ℝ) ≤ N) nlinarith end Bounty end section /- Encoding prime labels preserves every forest constraint on performed births. -/ open scoped Classical namespace Bounty theorem optional_forest_encoding_iff {m : ℕ} {α : Type*} (performed : Fin m → Prop) (label : Fin m → Option α) (hp : ∀ i, performed i → (label i).isSome = true) (encode : α → ℤ) (hinj : Function.Injective encode) (code : BirthForestCode m) : birthForestCompatible performed (fun i => ((label i).map encode).getD 0) code ↔ birthForestCompatible performed label code := by apply forall_congr' intro j cases code j with | none => rfl | some i => change (_ ∧ _ ∧ _) ↔ (_ ∧ _ ∧ _) constructor <;> rintro ⟨hi, hj, he⟩ · exact ⟨hi, hj, (optional_encoded_eq_iff encode hinj _ _ (hp _ hi) (hp _ hj)).mp he⟩ · exact ⟨hi, hj, (optional_encoded_eq_iff encode hinj _ _ (hp _ hi) (hp _ hj)).mpr he⟩ end Bounty end section /- Compact transitions preserve bounded positive branches and have total mass at most one. -/ open Finset Real namespace Bounty theorem smooth_allocation_weight_eq_product (n : ℕ) (v s : Fin n → ℝ) (active : Fin n → Bool) (R : ℝ) (take : Fin n → Bool) : smoothAllocationWeight n v s active R take = ∏ i, smoothSlotTransition (v i) (s i) (allocationPrefixResidual v R take i) (active i) (take i) := by induction n generalizing R with | zero => simp [smoothAllocationWeight] | succ n ih => rw [smoothAllocationWeight, Fin.prod_univ_succ, allocation_prefix_zero, ih] congr 1 apply prod_congr rfl intro i hi rw [allocation_prefix_succ] rfl noncomputable def compactSlotTransition (A v s R : ℝ) (active take : Bool) : ℝ := if active then typeIISmoothCutoff A take ((R-v)/s) else if take then 0 else 1 noncomputable def compactAllocationWeight (A : ℝ) (n : ℕ) (v s : Fin n → ℝ) (active : Fin n → Bool) (R : ℝ) (take : Fin n → Bool) : ℝ := ∏ i, compactSlotTransition A (v i) (s i) (allocationPrefixResidual v R take i) (active i) (take i) theorem compact_slot_transition_bounds (A v s R : ℝ) (active take : Bool) : 0 ≤ compactSlotTransition A v s R active take ∧ compactSlotTransition A v s R active take ≤ smoothSlotTransition v s R active take := by cases active · cases take <;> simp [compactSlotTransition, smoothSlotTransition, smoothSlotTakeProbability] · have hr := typeII_smooth_rho_bounds A ((R-v)/s) have ht := smooth_slot_transition_nonneg v s R true take have he : compactSlotTransition A v s R true take = typeIISmoothRho A ((R-v)/s)*smoothSlotTransition v s R true take := by cases take <;> simp [compactSlotTransition, typeIISmoothCutoff, smoothSlotTransition, smoothSlotTakeProbability] rw [he] refine ⟨mul_nonneg hr.1 ht, ?_⟩ simpa only [one_mul] using mul_le_mul_of_nonneg_right hr.2 ht theorem compact_slot_transition_eq {A v s R : ℝ} (active take : Bool) (harg : active = true → (R-v)/s ∈ Set.Icc (-A) A) : compactSlotTransition A v s R active take = smoothSlotTransition v s R active take := by cases active · cases take <;> simp [compactSlotTransition, smoothSlotTransition, smoothSlotTakeProbability] · have h := typeII_smooth_cutoff_eq_transition take (harg rfl) cases take <;> simpa only [compactSlotTransition, smoothSlotTransition, smoothSlotTakeProbability, Bool.false_eq_true, if_false, if_true] using h section variable (A : ℝ) (n : ℕ) (v s : Fin n → ℝ) (active : Fin n → Bool) (R : ℝ) include A n v s active R theorem compact_allocation_weight_bounds (take : Fin n → Bool) : 0 ≤ compactAllocationWeight A n v s active R take ∧ compactAllocationWeight A n v s active R take ≤ smoothAllocationWeight n v s active R take := by constructor · exact prod_nonneg (fun i _ => (compact_slot_transition_bounds _ _ _ _ _ _).1) · rw [smooth_allocation_weight_eq_product] exact prod_le_prod₀ (fun i _ => (compact_slot_transition_bounds _ _ _ _ _ _).1) (fun i _ => (compact_slot_transition_bounds _ _ _ _ _ _).2) theorem compact_allocation_total_mass_le_one : (∑ take, compactAllocationWeight A n v s active R take) ≤ 1 := by rw [← smooth_allocation_total_mass n v s active R] exact sum_le_sum (fun take _ => (compact_allocation_weight_bounds A n v s active R take).2) theorem compact_allocation_eq_of_args (take : Fin n → Bool) (harg : ∀ i, active i = true → (allocationPrefixResidual v R take i-v i)/s i ∈ Set.Icc (-A) A) : compactAllocationWeight A n v s active R take = smoothAllocationWeight n v s active R take := by rw [smooth_allocation_weight_eq_product] exact prod_congr rfl (fun i _ => compact_slot_transition_eq (active i) (take i) (harg i)) end end Bounty end section open scoped ContDiff namespace Bounty theorem typeII_pulled_schwartz_tsupport_subset (A : ℝ) (p : Fin 4 → ℝ) : tsupport (typeIIPulledSchwartz A (p 0) (p 1) (p 2) (p 3)) ⊆ tsupport (typeIIThreeLocalizer A) := by apply (tsupport_comp_subset (g := fun x : ℝ => (x : ℂ)) (by simp) (typeIIPulledCutoff A (p 0) (p 1) (p 2) (p 3))).trans exact tsupport_mul_subset_left.trans tsupport_mul_subset_left theorem typeII_pulled_support_radius (A : ℝ) : ∃ R : ℝ, 0 ≤ R ∧ ∀ p : Fin 4 → ℝ, tsupport (typeIIPulledSchwartz A (p 0) (p 1) (p 2) (p 3)) ⊆ Metric.closedBall 0 R := by obtain ⟨R, hR⟩ := (typeII_three_localizer_hasCompactSupport A).isCompact.isBounded.subset_closedBall 0 refine ⟨max R 0, le_max_right _ _, ?_⟩ intro p exact (typeII_pulled_schwartz_tsupport_subset A p).trans (hR.trans (Metric.closedBall_subset_closedBall (le_max_left _ _))) theorem typeII_pulled_derivative_polynomial_bound {A : ℝ} (hA : 0 ≤ A) (n : ℕ) : ∃ (d : ℕ) (C : ℝ), 0 ≤ C ∧ ∀ (p : Fin 4 → ℝ) (x : EuclideanSpace ℝ (Fin 3)), ‖iteratedFDeriv ℝ n (typeIIPulledSchwartz A (p 0) (p 1) (p 2) (p 3)) x‖ ≤ C * (1 + ‖p‖) ^ d := by have hG : Function.HasTemperateGrowth (fun y : (Fin 4 → ℝ) × EuclideanSpace ℝ (Fin 3) => (typeIIPulledJoint A y : ℂ)) := Complex.ofRealCLM.hasTemperateGrowth.comp (typeII_pulled_joint_hasTemperateGrowth A) obtain ⟨d, C, hC, hb⟩ := hG.norm_iteratedFDeriv_le_uniform n obtain ⟨R, hR0, hR⟩ := typeII_pulled_support_radius A refine ⟨d, C * (1 + R) ^ d, mul_nonneg hC (pow_nonneg (by linarith) _), ?_⟩ intro p x by_cases hx : x ∈ Metric.closedBall 0 R · have hfun : (fun x : EuclideanSpace ℝ (Fin 3) => (typeIIPulledJoint A (p, x) : ℂ)) = (typeIIPulledSchwartz A (p 0) (p 1) (p 2) (p 3) : EuclideanSpace ℝ (Fin 3) → ℂ) := by funext y change (typeIIPulledJoint A (p, y) : ℂ) = (typeIIPulledCutoff A (p 0) (p 1) (p 2) (p 3) y : ℂ) rw [typeII_pulled_joint_eq hA] have hslice := norm_iteratedFDeriv_slice_le hG.1 p x n rw [hfun] at hslice have hxR : ‖x‖ ≤ R := mem_closedBall_zero_iff.mp hx have hbase : 1 + ‖(p, x)‖ ≤ (1 + R) * (1 + ‖p‖) := by rw [Prod.norm_def] have hm : max ‖p‖ ‖x‖ ≤ ‖p‖ + R := max_le (by linarith) (by linarith [norm_nonneg p]) nlinarith [norm_nonneg p] calc _ ≤ C * (1 + ‖(p, x)‖) ^ d := hslice.trans (hb n le_rfl (p, x)) _ ≤ C * ((1 + R) * (1 + ‖p‖)) ^ d := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (by positivity) hbase d) hC _ = _ := by rw [mul_pow]; ring · have hz : iteratedFDeriv ℝ n (typeIIPulledSchwartz A (p 0) (p 1) (p 2) (p 3)) x = 0 := by apply Function.notMem_support.mp intro hs exact hx (hR p (support_iteratedFDeriv_subset n hs)) rw [hz, norm_zero] positivity end Bounty end section /- The actual first and second invariant endpoints, with exact finite support masks. -/ open Finset open scoped ComplexConjugate namespace Bounty noncomputable def typeIIInvariantEndpoint (P M R C : Finset ℕ) (A c : ℕ → ℂ) (t σ : ℝ) (v : ℕ) : ℂ := invariantTripleEndpoint P (fun m => if m ∈ M then A m * typeIIPhase t m else 0) (fun p => if p ∈ R then typeIIPhase (-σ) p else 0) (fun r => if r ∈ C then conj (c r) else 0) v theorem typeII_invariant_endpoint_unmask_coefficients (P M R C : Finset ℕ) (A c : ℕ → ℂ) (t σ : ℝ) (hA : ∀ m, m ∉ M → A m=0) (hc : ∀ r, r ∉ C → c r=0) (v : ℕ) : typeIIInvariantEndpoint P M R C A c t σ v = invariantTripleEndpoint P (fun m => A m * typeIIPhase t m) (fun p => if p ∈ R then typeIIPhase (-σ) p else 0) (fun r => conj (c r)) v := by have hfirst : (fun m => if m ∈ M then A m * typeIIPhase t m else 0) = (fun m => A m * typeIIPhase t m) := by funext m by_cases hm : m ∈ M · simp only [hm, if_true] · simp only [hm, if_false, hA m hm, zero_mul] have hlast : (fun r => if r ∈ C then conj (c r) else 0) = (fun r => conj (c r)) := by funext r by_cases hr : r ∈ C · simp only [hr, if_true] · simp only [hr, if_false, hc r hr, map_zero] unfold typeIIInvariantEndpoint rw [hfirst, hlast] end Bounty end section /- The actual remaining candidate coefficient has the required rough convolution. -/ open Finset open scoped ComplexConjugate namespace Bounty noncomputable def candidateResidualPrimeSupport (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card * r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) : Finset ℕ := orderedSlotProductSupport (fun slot : {slot : CandidateRemainingSlot c L r take // slot ≠ candidateRemainingRoughSlot c L r jStar hr hj take hkeep} => candidateQSlotChoices c L r jStar slot.val.val) theorem candidate_remaining_eq_typeIIRoughConvolution (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card * r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (σ : ℝ) (hphase : ∀ p ∈ candidateRoughBand c L jStar, twist (candidateRoughSlot c L r jStar hr hj) p = typeIIPhase σ p) (n : ℕ) : candidateRemainingComplexCoefficient c L r jStar take twist n = typeIIRoughConvolution (candidateRoughBand c L jStar) (candidateResidualPrimeSupport c L r jStar hr hj take hkeep) σ (candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist) n := by classical rw [candidate_remaining_rough_convolution c L r jStar hr hj take hkeep twist n] unfold typeIIRoughConvolution candidateResidualPrimeSupport conv_rhs => rw [← sum_attach] apply sum_congr · ext p simp only [mem_univ, mem_attach] · intro p _ rw [hphase p.val p.property] theorem candidate_residual_prime_coefficient_eq_zero_of_not_mem (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card * r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) {n : ℕ} (hn : n ∉ candidateResidualPrimeSupport c L r jStar hr hj take hkeep) : candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist n = 0 := by unfold candidateResidualPrimeCoefficient rw [ordered_slot_complex_weight_support _ _ hn, zero_div] end Bounty end section /- Absolute divisor cross mass on the original candidate window. -/ open Finset Filter Real namespace Bounty theorem shifted_divisor_cross_mass_le (T : Finset ℕ) (N : ℕ) (hN : ∀ u ∈ T, 2*u+1 ≤ N) : (∑ u ∈ T, (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ)) ≤ (N : ℝ) * (1 + log N) ^ 15 := by have h := divisor_square_cross_moment T (fun u => u) (fun u => 2*u+1) N N (fun _ _ _ _ h => h) (by intro a _ b _ h; dsimp at h; omega) (fun u hu => by have := hN u hu; omega) hN have hpos : 0 ≤ (N : ℝ) * (1 + log N)^15 := by positivity rw [← sq, sq_sqrt hpos] at h apply le_trans ?_ h apply sum_le_sum intro u _ have hp := Nat.le_mul_self (u.divisors.card * (2*u+1).divisors.card) have hp' : (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ) ≤ ((u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ)) * ((u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ)) := by exact_mod_cast hp nlinarith only [hp'] theorem eventually_arithmetic_window_divisor_cross_mass : ∀ᶠ L : ℝ in atTop, (∑ u ∈ arithmeticProductWindow 1 (exp L), (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ)) ≤ exp L * L^(16 : ℝ) := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (33*(2+log 33)^15 : ℝ)] with L hL hK have hL0 : 0 < L := by linarith have hE : 1 ≤ exp L := one_le_exp hL0.le let N : ℕ := ⌊33*exp L⌋₊ have hN0 : 0 < N := Nat.floor_pos.mpr (by linarith) have hNpos : (0 : ℝ) < N := by exact_mod_cast hN0 have hNle : (N : ℝ) ≤ 33*exp L := Nat.floor_le (by positivity) have hlog : 1+log N ≤ (2+log 33)*L := by have hh := log_le_log hNpos hNle rw [log_mul (by norm_num : (33 : ℝ) ≠ 0) (exp_ne_zero L), log_exp] at hh have h33 : 0 ≤ log 33 := log_nonneg (by norm_num) nlinarith have hmass := shifted_divisor_cross_mass_le (arithmeticProductWindow 1 (exp L)) N (by intro u hu have huhi : (u : ℝ) ≤ 16*exp L := by simpa only [one_mul] using ((mem_arithmeticProductWindow_iff one_ne_zero (exp L)).mp hu).2 apply Nat.le_floor push_cast linarith) calc _ ≤ (N : ℝ) * (1+log N)^15 := hmass _ ≤ (33*exp L) * ((2+log 33)*L)^15 := mul_le_mul hNle (pow_le_pow_left₀ (by positivity) hlog 15) (by positivity) (by positivity) _ = (33*(2+log 33)^15) * exp L * L^15 := by rw [mul_pow]; ring _ ≤ L * exp L * L^15 := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hK (exp_pos _).le) (pow_nonneg hL0.le _) _ = exp L * L^(16 : ℝ) := by norm_num only [rpow_ofNat]; ring end Bounty end section /- Fold the original P-weight into the retained h coefficient by exact supported/free uniqueness. -/ open Finset Filter namespace Bounty theorem supported_free_complex_product_reindex (P A B : Finset ℕ) (hA : ∀ p ∈ A, p ∈ Nat.factoredNumbers P) (hB : ∀ n ∈ B, n ≠ 0 ∧ Disjoint n.primeFactors P) (W Q F : ℕ → ℂ) : (∑ p ∈ A, ∑ n ∈ B, W p * Q n * F (p * n)) = ∑ h ∈ (A ×ˢ B).image (fun z => z.1 * z.2), W (primePoolPart P h) * Q (primePoolFreePart P h) * F h := by classical have hinj : Set.InjOn (fun z : ℕ × ℕ => z.1 * z.2) (↑(A ×ˢ B) : Set (ℕ × ℕ)) := by intro x hx y hy hxy obtain ⟨hxp, hxn⟩ := mem_product.mp hx obtain ⟨hyp, hyn⟩ := mem_product.mp hy obtain ⟨hp, hn⟩ := supported_free_product_unique (hA _ hxp) (hB _ hxn).1 (hB _ hxn).2 (hA _ hyp) (hB _ hyn).1 (hB _ hyn).2 hxy exact Prod.ext hp hn rw [sum_image hinj, sum_product] apply sum_congr rfl intro p hp apply sum_congr rfl intro n hn rw [primePoolPart_mul_of_free (hA _ hp) (hB _ hn).1 (hB _ hn).2, primePoolFreePart_mul_of_free (hA _ hp) (hB _ hn).1 (hB _ hn).2] noncomputable def candidateRetainedComplexCoefficient (c L q : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card * r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (h : ℕ) : ℂ := (markedDivisorWeight (candidatePIndices c L) (candidatePBand (c * L)) q (fun j => ∑ p ∈ candidatePBand (c * L) j, 1 / (p : ℝ)) (fun _ => 1) (h : ℤ) : ℂ) * candidateRemainingComplexCoefficient c L r jStar take twist (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c * L))) h) theorem eventually_candidate_retained_convolution {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card * r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (S : Finset ℕ), (∀ p ∈ S, p ∈ Nat.factoredNumbers ((candidatePIndices c L).biUnion (candidatePBand (c * L)))) → ∀ F : ℕ → ℂ, (∑ p ∈ S, ∑ n ∈ orderedSlotProductSupport (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val), (candidatePWeight c L q p : ℂ) * candidateRemainingComplexCoefficient c L r jStar take twist n * F (p * n)) = ∑ h ∈ (S ×ˢ orderedSlotProductSupport (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val)).image (fun z => z.1 * z.2), candidateRetainedComplexCoefficient c L q r jStar take twist h * F h := by filter_upwards [eventually_candidate_remaining_support_free hc] with L hfree intro q r jStar take twist S hS F classical rw [supported_free_complex_product_reindex _ S _ hS (hfree r jStar take)] apply sum_congr rfl intro h hh obtain ⟨pn, hpn, rfl⟩ := mem_image.mp hh obtain ⟨hp, hn⟩ := mem_product.mp hpn obtain ⟨hn0, hnfree⟩ := hfree r jStar take pn.2 hn have hp0 := Nat.ne_zero_of_mem_factoredNumbers (hS _ hp) rw [primePoolPart_mul_of_free (hS _ hp) hn0 hnfree, primePoolFreePart_mul_of_free (hS _ hp) hn0 hnfree] unfold candidateRetainedComplexCoefficient rw [candidate_marked_weight_mul_of_free c L q hn0 hnfree pn.1, primePoolFreePart_mul_of_free (hS _ hp) hn0 hnfree, candidate_P_weight_eq_marked c L q hp0] end Bounty end section /- Divisor-product mass on small finite subsets, with an absolute logarithmic loss. -/ open Finset namespace Bounty theorem divisor_product_subset_concentration {α : Type*} [DecidableEq α] (S : Finset α) (f g : α → ℕ) (N : ℕ) (hf : Set.InjOn f S) (hg : Set.InjOn g S) (hNf : ∀ x ∈ S, f x ≤ N) (hNg : ∀ x ∈ S, g x ≤ N) : (∑ x ∈ S, ((f x).divisors.card : ℝ) * ((g x).divisors.card : ℝ)) ≤ Real.sqrt (S.card : ℝ) * Real.sqrt ((N : ℝ) * (1 + Real.log N) ^ 15) := by have hmoment := divisor_square_cross_moment S f g N N hf hg hNf hNg rw [Real.mul_self_sqrt (by positivity)] at hmoment have hcs := Real.sum_mul_le_sqrt_mul_sqrt S (fun _ => (1 : ℝ)) (fun x => ((f x).divisors.card : ℝ) * ((g x).divisors.card : ℝ)) simp only [one_mul, one_pow, sum_const, nsmul_eq_mul, mul_one, mul_pow] at hcs exact hcs.trans (mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hmoment) (Real.sqrt_nonneg _)) theorem shifted_divisor_subset_concentration (S : Finset ℕ) (N : ℕ) (hN : ∀ u ∈ S, 2 * u + 1 ≤ N) : (∑ u ∈ S, (u.divisors.card : ℝ) * ((2 * u + 1).divisors.card : ℝ)) ≤ Real.sqrt (S.card : ℝ) * Real.sqrt ((N : ℝ) * (1 + Real.log N) ^ 15) := by apply divisor_product_subset_concentration S (fun u => u) (fun u => 2 * u + 1) N · intro a _ b _ hab exact hab · intro a _ b _ hab change 2 * a + 1 = 2 * b + 1 at hab omega · intro u hu have := hN u hu omega · exact hN end Bounty end section /- Real logarithmic phases, with an explicit integration-frequency convention. -/ open MeasureTheory namespace Bounty noncomputable def physicalMellinPhase (v t : ℝ) : ℂ := Complex.exp ((v * Real.log t : ℝ) * Complex.I) theorem physical_mellin_phase_norm (v t : ℝ) : ‖physicalMellinPhase v t‖ = 1 := by exact Complex.norm_exp_ofReal_mul_I _ theorem physical_mellin_phase_conj (v t : ℝ) : (starRingEnd ℂ) (physicalMellinPhase v t) = physicalMellinPhase (-v) t := by unfold physicalMellinPhase rw [← Complex.exp_conj] congr 1 simp only [map_mul, Complex.conj_ofReal, Complex.conj_I, neg_mul, Complex.ofReal_neg] ring theorem physical_mellin_phase_ratio (v n Z : ℝ) (D : ℕ) (hn : n ≠ 0) (hZ : Z ≠ 0) (hD : D ≠ 0) : physicalMellinPhase v (n / Z) * physicalPhase (-v) D = physicalMellinPhase v (n / (Z * D)) := by have hDr : (D : ℝ) ≠ 0 := by exact_mod_cast hD unfold physicalMellinPhase physicalPhase rw [← Complex.exp_add, Real.log_div hn hZ, Real.log_div hn (mul_ne_zero hZ hDr), Real.log_mul hZ hDr] congr 1 push_cast ring theorem physical_mellin_phase_integrable (ρ : ℝ → ℂ) (ν : ℝ → ℝ) (hρ : Integrable ρ) (hν : Continuous ν) (t : ℝ) : Integrable (fun v => ρ v * physicalMellinPhase (ν v) t) := by have hc : Continuous (fun v => physicalMellinPhase (ν v) t) := by unfold physicalMellinPhase fun_prop exact hρ.mul_bdd hc.aestronglyMeasurable (Filter.Eventually.of_forall (fun v => (physical_mellin_phase_norm (ν v) t).le)) end Bounty end section /- The original permutation/ghost/edge path is preserved by exact edge parameter transport. -/ open Finset open scoped Classical namespace Bounty section Events variable {J K G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ Δ' D D' : ∀ k c, A k c → G → ℤ) (hΔ : ∀ k, Δ k = Δ' k) (hD : ∀ k c a g p, ((n g p : ℤ) ∣ D k c a g ↔ (n g p : ℤ) ∣ D' k c a g)) noncomputable def fullPermutationParameterEventEquiv (tag : Option (J ⊕ K)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FullPermutationMixedEvent n S B A Δ D tag x ≃ FullPermutationMixedEvent n S B A Δ' D' tag x := match tag with | none => Equiv.refl _ | some (.inl _) => Equiv.refl _ | some (.inr k) => fullActiveParameterEventEquiv n (S k) B (A k) (Δ k) (Δ' k) (D k) (D' k) (hΔ k) (hD k) x theorem full_permutation_parameter_target (tag : Option (J ⊕ K)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag x) : fullPermutationMixedEventTarget n S B A Δ' D' tag x (fullPermutationParameterEventEquiv n S B A Δ Δ' D D' hΔ hD tag x e) = fullPermutationMixedEventTarget n S B A Δ D tag x e := by cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr k => exact full_active_parameter_target n (S k) B (A k) (Δ k) (Δ' k) (D k) (D' k) (hΔ k) (hD k) x e theorem full_permutation_parameter_weight [Fintype G] [DecidableEq G] (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) (tag : Option (J ⊕ K)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag x) : fullPermutationMixedEventWeight n S B A Δ' D' ω μ q ρ V tag x (fullPermutationParameterEventEquiv n S B A Δ Δ' D D' hΔ hD tag x e) = fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V tag x e := by cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr k => exact full_active_parameter_weight n (S k) B (A k) (Δ k) (Δ' k) (D k) (D' k) (hΔ k) (hD k) (ω k) μ ρ V x e noncomputable def fullPermutationParameterPathEquiv (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FiniteEventPath (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x ≃ FiniteEventPath (FullPermutationMixedEvent n S B A Δ' D') (fullPermutationMixedEventTarget n S B A Δ' D') steps x := finiteEventPathEquiv _ _ _ _ id (fullPermutationParameterEventEquiv n S B A Δ Δ' D D' hΔ hD) (fun tag x e => (full_permutation_parameter_target n S B A Δ Δ' D D' hΔ hD tag x e).symm) steps x theorem full_permutation_parameter_path_terminal (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FiniteEventPath (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x) : finiteEventPathTerminal _ (fullPermutationMixedEventTarget n S B A Δ' D') steps x (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x p) = finiteEventPathTerminal _ (fullPermutationMixedEventTarget n S B A Δ D) steps x p := finite_event_path_equiv_terminal _ _ _ _ id _ _ steps x p theorem full_permutation_parameter_path_weight [Fintype G] [DecidableEq G] (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FiniteEventPath (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x) : finiteEventPathWeight _ (fullPermutationMixedEventTarget n S B A Δ' D') (fullPermutationMixedEventWeight n S B A Δ' D' ω μ q ρ V) steps x (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x p) = finiteEventPathWeight _ (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps x p := finite_event_path_equiv_weight _ _ _ _ id _ _ _ _ (full_permutation_parameter_weight n S B A Δ Δ' D D' hΔ hD ω μ q ρ V) steps x p end Events end Bounty end section /- A fixed-support logarithmic cutoff with the inverse smoothing width as parameter. -/ open MeasureTheory open scoped ContDiff FourierTransform namespace Bounty noncomputable def typeIIWindowLogLocalizer (s : ℝ) : ℝ := Real.smoothTransition (s + 1) * Real.smoothTransition (Real.log 16 + 1 - s) noncomputable def typeIIWindowLogCutoff (r s : ℝ) : ℝ := typeIIWindowLogLocalizer s * Real.smoothTransition (r * (Real.exp s - 1)) * Real.smoothTransition (r * (16 - Real.exp s)) noncomputable def typeIIWindowLogJoint (y : ℝ × ℝ) : ℝ := typeIIWindowLogLocalizer y.2 * Real.smoothTransition (y.1 * (typeIITameExp (Real.log 16 + 1) y.2 - 1)) * Real.smoothTransition (y.1 * (16 - typeIITameExp (Real.log 16 + 1) y.2)) theorem typeII_window_log_localizer_eq_one {s : ℝ} (hs : s ∈ Set.Icc 0 (Real.log 16)) : typeIIWindowLogLocalizer s = 1 := by rw [typeIIWindowLogLocalizer, Real.smoothTransition.one_of_one_le (by linarith [hs.1]), Real.smoothTransition.one_of_one_le (by linarith [hs.2]), mul_one] theorem typeII_window_log_localizer_eq_zero {s : ℝ} (hs : s ∉ Set.Icc (-1) (Real.log 16 + 1)) : typeIIWindowLogLocalizer s = 0 := by by_cases hlo : s < -1 · rw [typeIIWindowLogLocalizer, Real.smoothTransition.zero_of_nonpos (by linarith), zero_mul] · have hhi : Real.log 16 + 1 < s := lt_of_not_ge (fun h => hs ⟨le_of_not_gt hlo, h⟩) rw [typeIIWindowLogLocalizer, Real.smoothTransition.zero_of_nonpos (by linarith : Real.log 16+1-s≤0), mul_zero] theorem typeII_window_log_localizer_hasCompactSupport : HasCompactSupport typeIIWindowLogLocalizer := HasCompactSupport.intro isCompact_Icc (fun _ hs => typeII_window_log_localizer_eq_zero hs) theorem typeII_window_log_localizer_contDiff : ContDiff ℝ ∞ typeIIWindowLogLocalizer := by unfold typeIIWindowLogLocalizer fun_prop theorem typeII_window_log_cutoff_contDiff (r : ℝ) : ContDiff ℝ ∞ (typeIIWindowLogCutoff r) := by have hl := typeII_window_log_localizer_contDiff unfold typeIIWindowLogCutoff fun_prop theorem typeII_window_log_cutoff_hasCompactSupport (r : ℝ) : HasCompactSupport (typeIIWindowLogCutoff r) := typeII_window_log_localizer_hasCompactSupport.mul_right.mul_right theorem typeII_window_log_cutoff_eq_smooth {δ : ℝ} (hδ : 0 < δ) (s : ℝ) : typeIIWindowLogCutoff δ⁻¹ s = typeIIWindowSmooth δ (Real.exp s) := by have heq : typeIIWindowLogCutoff δ⁻¹ s = typeIIWindowLogLocalizer s * typeIIWindowSmooth δ (Real.exp s) := by simp only [typeIIWindowLogCutoff, typeIIWindowSmooth, div_eq_mul_inv] rw [mul_comm δ⁻¹ (Real.exp s - 1), mul_comm δ⁻¹ (16 - Real.exp s)] ring rw [heq] by_cases hz : typeIIWindowSmooth δ (Real.exp s) = 0 · rw [hz, mul_zero] · have hs := typeII_window_smooth_support hδ hz have hlo : 0 < s := by simpa using hs.1 have hhi : s < Real.log 16 := (Real.lt_log_iff_exp_lt (by norm_num)).mpr hs.2 rw [typeII_window_log_localizer_eq_one ⟨hlo.le, hhi.le⟩, one_mul] theorem typeII_window_log_joint_hasTemperateGrowth : Function.HasTemperateGrowth typeIIWindowLogJoint := by have hr : Function.HasTemperateGrowth (fun y : ℝ × ℝ => y.1) := (ContinuousLinearMap.fst ℝ ℝ ℝ).hasTemperateGrowth have hs : Function.HasTemperateGrowth (fun y : ℝ × ℝ => y.2) := (ContinuousLinearMap.snd ℝ ℝ ℝ).hasTemperateGrowth have hl := (typeII_window_log_localizer_hasCompactSupport.hasTemperateGrowth typeII_window_log_localizer_contDiff).comp hs have he := (typeII_tame_exp_hasTemperateGrowth (Real.log 16 + 1)).comp hs have hg := smoothTransition_hasTemperateGrowth unfold typeIIWindowLogJoint fun_prop theorem typeII_window_log_joint_eq (r s : ℝ) : typeIIWindowLogJoint (r, s) = typeIIWindowLogCutoff r s := by by_cases hz : typeIIWindowLogLocalizer s = 0 · simp only [typeIIWindowLogJoint, typeIIWindowLogCutoff, hz, zero_mul] · have hs : s ∈ Set.Icc (-1) (Real.log 16 + 1) := by_contra (fun h => hz (typeII_window_log_localizer_eq_zero h)) have hp : 0 < Real.log 16 := Real.log_pos (by norm_num) have hb : |s| ≤ 2 * (Real.log 16 + 1 + 1) := abs_le.mpr ⟨by linarith [hs.1], by linarith [hs.2]⟩ simp only [typeIIWindowLogJoint, typeIIWindowLogCutoff, typeII_tame_exp_eq hb] noncomputable def typeIIWindowLogSchwartz (r : ℝ) : SchwartzMap ℝ ℂ := ((typeII_window_log_cutoff_hasCompactSupport r).comp_left (g := fun x : ℝ => (x : ℂ)) (by simp)).toSchwartzMap (Complex.ofRealCLM.contDiff.comp (typeII_window_log_cutoff_contDiff r)) noncomputable def typeIIWindowFourier (r : ℝ) : SchwartzMap ℝ ℂ := 𝓕 (typeIIWindowLogSchwartz r) theorem typeII_window_fourier_integrable (r : ℝ) : Integrable (typeIIWindowFourier r) := (typeIIWindowFourier r).integrable theorem typeII_window_fourier_inversion (r s : ℝ) : (typeIIWindowLogCutoff r s : ℂ) = ∫ ξ : ℝ, Complex.exp (((2 * Real.pi * ξ * s : ℝ) : ℂ) * Complex.I) * typeIIWindowFourier r ξ := by have hi := congrArg (fun f : SchwartzMap ℝ ℂ => f s) (FourierPair.fourierInv_fourier_eq (E := SchwartzMap ℝ ℂ) (F := SchwartzMap ℝ ℂ) (typeIIWindowLogSchwartz r)) rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq'] at hi change (∫ ξ : ℝ, Complex.exp (((2 * Real.pi * inner ℝ ξ s : ℝ) : ℂ) * Complex.I) • typeIIWindowFourier r ξ) = (typeIIWindowLogCutoff r s : ℂ) at hi rw [← hi] apply integral_congr_ae filter_upwards [] with ξ simp only [RCLike.inner_apply, starRingEnd_apply, star_trivial, smul_eq_mul] congr 2 push_cast ring end Bounty end section /- Pool-invariant endpoint energy on the exceptional square-divisibility set. -/ open Finset namespace Bounty theorem invariant_triple_endpoint_square_energy (Q P : Finset ℕ) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (hP : ∀ p ∈ P, p ∈ Nat.factoredNumbers Q) (S : Finset ℕ) (N : ℕ) (hS : ∀ n ∈ S, n ≤ N) : (∑ n ∈ S.filter (fun n => ∃ p ∈ P, p ^ 2 ∣ n), ‖invariantTripleEndpoint Q α β γ n‖ ^ 2) ≤ ((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∑ p ∈ P, 1 / (p : ℝ) ^ 2 := by classical let f := fun n : ℕ => ‖invariantTripleEndpoint Q α β γ n‖ ^ 2 have hpoint (n : ℕ) : (if ∃ p ∈ P, p ^ 2 ∣ n then f n else 0) ≤ ∑ p ∈ P, if p ^ 2 ∣ n then f n else 0 := by by_cases hn : ∃ p ∈ P, p ^ 2 ∣ n · obtain ⟨p, hp, hpn⟩ := hn rw [if_pos ⟨p, hp, hpn⟩] calc f n = (if p ^ 2 ∣ n then f n else 0) := (if_pos hpn).symm _ ≤ _ := single_le_sum (s := P) (f := fun r => if r ^ 2 ∣ n then f n else 0) (fun r _ => by split_ifs <;> positivity) hp · rw [if_neg hn] exact sum_nonneg (fun p _ => by split_ifs <;> positivity) change (∑ n ∈ S.filter (fun n => ∃ p ∈ P, p ^ 2 ∣ n), f n) ≤ _ rw [sum_filter] calc _ ≤ ∑ n ∈ S, ∑ p ∈ P, if p ^ 2 ∣ n then f n else 0 := sum_le_sum (fun n _ => hpoint n) _ = ∑ p ∈ P, ∑ n ∈ S.filter (fun n => p ^ 2 ∣ n), f n := by rw [sum_comm] simp only [sum_filter] _ ≤ ∑ p ∈ P, (A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 / (p : ℝ) ^ 2 := by apply sum_le_sum intro p hp have hsq : p ^ 2 ∈ Nat.factoredNumbers Q := by simpa only [pow_two] using Nat.mul_mem_factoredNumbers (hP p hp) (hP p hp) simpa only [Nat.cast_pow] using invariant_triple_endpoint_divisible_energy Q α β γ hA hB hC hα hβ hγ (S.filter (fun n => p ^ 2 ∣ n)) (p ^ 2) N hsq (fun n hn => (mem_filter.mp hn).2) (fun n hn => hS n (mem_filter.mp hn).1) _ = _ := by rw [mul_sum]; apply sum_congr rfl; intro p _; ring theorem invariant_triple_endpoint_square_error_energy (Q P : Finset ℕ) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (hP : ∀ p ∈ P, p ∈ Nat.factoredNumbers Q) (S : Finset ℕ) (N : ℕ) (hS : ∀ n ∈ S, n ≤ N) (e : ℕ → ℂ) {H : ℝ} (he : ∀ n ∈ S, (∀ p ∈ P, ¬ p ^ 2 ∣ n) → e n = 0) (hbound : ∀ n ∈ S, ‖e n‖ ≤ H * ‖invariantTripleEndpoint Q α β γ n‖) : (∑ n ∈ S, ‖e n‖ ^ 2) ≤ H ^ 2 * (((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∑ p ∈ P, 1 / (p : ℝ) ^ 2) := by classical have heq : (∑ n ∈ S, ‖e n‖ ^ 2) = ∑ n ∈ S.filter (fun n => ∃ p ∈ P, p ^ 2 ∣ n), ‖e n‖ ^ 2 := by rw [sum_filter] apply sum_congr rfl intro n hn split_ifs with hp · rfl · have hz := he n hn (by simpa only [not_exists, not_and] using hp) simp only [hz, norm_zero, zero_pow (by decide : 2 ≠ 0)] rw [heq] calc _ ≤ ∑ n ∈ S.filter (fun n => ∃ p ∈ P, p ^ 2 ∣ n), H ^ 2 * ‖invariantTripleEndpoint Q α β γ n‖ ^ 2 := by apply sum_le_sum intro n hn simpa only [mul_pow] using pow_le_pow_left₀ (norm_nonneg _) (hbound n (mem_filter.mp hn).1) 2 _ = H ^ 2 * ∑ n ∈ S.filter (fun n => ∃ p ∈ P, p ^ 2 ∣ n), ‖invariantTripleEndpoint Q α β γ n‖ ^ 2 := (mul_sum ..).symm _ ≤ _ := mul_le_mul_of_nonneg_left (invariant_triple_endpoint_square_energy Q P α β γ hA hB hC hα hβ hγ hP S N hS) (sq_nonneg H) end Bounty end section /- Common birth labels on the unchanged original paths retain their exact owning event. -/ open Classical namespace Bounty section Path variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) noncomputable def fullMixedCommonPathBornData : FullMixedCommonStepAddress M B steps → Option (FullMixedBornData n) := optionalBirthExtension (fullMixedCommonStepEmbedding S B steps) (fullMixedPathBornData n S B A Δ D steps x p) noncomputable def fullMixedCommonPathBirthLabel (a : FullMixedCommonStepAddress M B steps) : Option ((g : Fin N) × P g) := (fullMixedCommonPathBornData n S B A Δ D steps x p a).map (fullMixedBornPrime n) theorem full_mixed_common_path_label_extension (a : FullMixedCommonStepAddress M B steps) : fullMixedCommonPathBirthLabel n S B A Δ D steps x p a = optionalBirthExtension (fullMixedCommonStepEmbedding S B steps) (fullMixedPathBirthLabel n S B A Δ D steps x p) a := optional_birth_extension_map _ _ _ _ theorem full_mixed_common_path_data_occurrence (i : Fin steps.length) (a : FullMixedCommonLocalAddress M B (steps.get i)) : let e := finiteEventPathOccurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x p i fullMixedCommonPathBornData n S B A Δ D steps x p ⟨i, a⟩ = fullMixedCommonEventBornData n S B A Δ D (steps.get i) e.1 e.2 a := by exact optional_birth_extension_sigma (fun i => fullMixedCommonLocalEmbedding S B (steps.get i)) (fullMixedPathBornData n S B A Δ D steps x p) i a theorem full_mixed_common_path_label_occurrence (i : Fin steps.length) (a : FullMixedCommonLocalAddress M B (steps.get i)) : let e := finiteEventPathOccurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x p i fullMixedCommonPathBirthLabel n S B A Δ D steps x p ⟨i, a⟩ = fullMixedCommonEventBirthLabel n S B A Δ D (steps.get i) e.1 e.2 a := by unfold fullMixedCommonPathBirthLabel fullMixedCommonEventBirthLabel rw [full_mixed_common_path_data_occurrence] theorem full_mixed_common_path_distinct_iff : (∀ a b z, fullMixedCommonPathBirthLabel n S B A Δ D steps x p a = some z → fullMixedCommonPathBirthLabel n S B A Δ D steps x p b = some z → a = b) ↔ (∀ a b z, fullMixedPathBirthLabel n S B A Δ D steps x p a = some z → fullMixedPathBirthLabel n S B A Δ D steps x p b = some z → a = b) := by simp only [full_mixed_common_path_label_extension] exact optional_birth_extension_distinct_iff _ _ theorem full_mixed_common_path_all_labels_iff (Q : ((g : Fin N) × P g) → Prop) : (∀ a z, fullMixedCommonPathBirthLabel n S B A Δ D steps x p a = some z → Q z) ↔ (∀ a z, fullMixedPathBirthLabel n S B A Δ D steps x p a = some z → Q z) := by simp only [full_mixed_common_path_label_extension] exact optional_birth_extension_all_iff _ _ _ end Path end Bounty end section /- Absolute finite factorization and shifted correlation bounds from the divisor fourth moment. -/ open Finset Real namespace Bounty noncomputable def factorizationAbsoluteMass (M H : Finset ℕ) (α a : ℕ → ℂ) (z : ℕ) : ℝ := ∑ v ∈ (M ×ˢ H).filter (fun v => v.1*v.2 = z), ‖α v.1 * a v.2‖ theorem factorization_absolute_mass_nonneg (M H : Finset ℕ) (α a : ℕ → ℂ) (z : ℕ) : 0 ≤ factorizationAbsoluteMass M H α a z := sum_nonneg (fun _ _ => norm_nonneg _) theorem factorization_absolute_mass_le (M H : Finset ℕ) (α a : ℕ → ℂ) {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hα : ∀ m ∈ M, ‖α m‖ ≤ A) (ha : ∀ h ∈ H, h ≠ 0 → ‖a h‖ ≤ B*(h.divisors.card : ℝ)) {z : ℕ} (hz : z ≠ 0) : factorizationAbsoluteMass M H α a z ≤ A*B*(z.divisors.card : ℝ)^2 := by classical let S := (M ×ˢ H).filter (fun v => v.1*v.2 = z) have hprod (v : ℕ × ℕ) (hv : v ∈ S) : v.1*v.2 = z := (mem_filter.mp hv).2 have hc : S.card ≤ z.divisors.card := by apply card_le_card_of_injOn Prod.fst · intro v hv exact Nat.mem_divisors.mpr ⟨⟨v.2, (hprod v hv).symm⟩, hz⟩ · intro v hv w hw heq apply Prod.ext heq have hp : v.1 ≠ 0 := by intro h; apply hz; simpa [h] using (hprod v hv).symm have hh : v.1*v.2 = v.1*w.2 := by simpa only [heq] using (hprod v hv).trans (hprod w hw).symm exact Nat.eq_of_mul_eq_mul_left (Nat.pos_of_ne_zero hp) hh have hs : factorizationAbsoluteMass M H α a z ≤ (S.card : ℝ)*(A*B*(z.divisors.card : ℝ)) := by unfold factorizationAbsoluteMass calc _ ≤ ∑ v ∈ S, A*B*(z.divisors.card : ℝ) := by apply sum_le_sum intro v hv have hvp := mem_product.mp (mem_filter.mp hv).1 have hvz : v.2 ≠ 0 := by intro h; apply hz; simpa [h] using (hprod v hv).symm have hd : v.2 ∣ z := ⟨v.1, by simpa [mul_comm] using (hprod v hv).symm⟩ have hcard : (v.2.divisors.card : ℝ) ≤ z.divisors.card := by exact_mod_cast card_le_card (Nat.divisors_subset_of_dvd hz hd) rw [norm_mul] calc _ ≤ A*(B*(v.2.divisors.card : ℝ)) := mul_le_mul (hα v.1 hvp.1) (ha v.2 hvp.2 hvz) (norm_nonneg _) hA _ ≤ A*(B*(z.divisors.card : ℝ)) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hcard hB) hA _ = _ := by ring _ = _ := by simp calc _ ≤ (S.card : ℝ)*(A*B*(z.divisors.card : ℝ)) := hs _ ≤ (z.divisors.card : ℝ)*(A*B*(z.divisors.card : ℝ)) := by exact mul_le_mul_of_nonneg_right (by exact_mod_cast hc) (by positivity) _ = _ := by ring theorem factorization_absolute_cross_moment {ι : Type*} [DecidableEq ι] (S : Finset ι) (f g : ι → ℕ) (N : ℕ) (M H : Finset ℕ) (α a : ℕ → ℂ) {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hα : ∀ m ∈ M, ‖α m‖ ≤ A) (ha : ∀ h ∈ H, h ≠ 0 → ‖a h‖ ≤ B*(h.divisors.card : ℝ)) (hf : Set.InjOn f S) (hg : Set.InjOn g S) (hf0 : ∀ x ∈ S, f x ≠ 0) (hg0 : ∀ x ∈ S, g x ≠ 0) (hfN : ∀ x ∈ S, f x ≤ N) (hgN : ∀ x ∈ S, g x ≤ N) : (∑ x ∈ S, factorizationAbsoluteMass M H α a (f x) * factorizationAbsoluteMass M H α a (g x)) ≤ (A*B)^2*(N : ℝ)*(1+log N)^15 := by have hmoment := divisor_square_cross_moment S f g N N hf hg hfN hgN have hN : 0 ≤ (N : ℝ)*(1+log N)^15 := by by_cases h : N = 0 · simp [h] · have hlog : 0 ≤ log (N : ℝ) := log_nonneg (by exact_mod_cast Nat.one_le_iff_ne_zero.mpr h) positivity rw [← pow_two, sq_sqrt hN] at hmoment calc _ ≤ ∑ x ∈ S, (A*B)^2*((f x).divisors.card : ℝ)^2*((g x).divisors.card : ℝ)^2 := by apply sum_le_sum intro x hx calc _ ≤ (A*B*((f x).divisors.card : ℝ)^2)*(A*B*((g x).divisors.card : ℝ)^2) := mul_le_mul (factorization_absolute_mass_le M H α a hA hB hα ha (hf0 x hx)) (factorization_absolute_mass_le M H α a hA hB hα ha (hg0 x hx)) (factorization_absolute_mass_nonneg M H α a (g x)) (by positivity) _ = _ := by ring _ = (A*B)^2 * ∑ x ∈ S, ((f x).divisors.card : ℝ)^2*((g x).divisors.card : ℝ)^2 := by rw [mul_sum]; apply sum_congr rfl; intro x hx; ring _ ≤ (A*B)^2*((N : ℝ)*(1+log N)^15) := mul_le_mul_of_nonneg_left hmoment (sq_nonneg _) _ = _ := by ring end Bounty end section /- The actual normalized smooth kernel satisfies the manuscript's quadratic replacement error. -/ open Finset MeasureTheory open scoped NNReal namespace Bounty theorem local_mellin_kernel_unit_support (t : ℝ) (ht : 1 < |t|) : localMellinKernelSchwartz t = 0 := by change (localMellinKernel t : ℂ) = 0 rw [local_mellin_kernel_support] · norm_num · apply lt_trans _ ht apply (div_lt_one (by positivity : 0 < 16*Real.pi+1)).mpr linarith [Real.pi_gt_three] theorem normalized_local_kernel_error_bound (S : Finset ℕ) (a : ℕ → ℂ) {K : ℝ → ℂ} {C : ℝ≥0} (hK : LipschitzWith C K) (hsupp : ∀ t, 1 < |t| → K t = 0) (hS : ∀ n ∈ S, 0 < n) {Y H : ℝ} (hY : 0 < Y) (hH : 1 ≤ H) (hsmall : H ≤ Y/8) : (∫ v in Set.Icc (Y/2) (3*Y), ‖∑ n ∈ S, a n * (K (((n:ℝ)-v)/H) - K (v*Real.log ((n:ℝ)/v)/H))‖^2) / H^2 ≤ (5120*(C:ℝ)^2) * (H/Y)^2 * (∑ n ∈ S, ‖a n‖^2) := by have hHp : 0 < H := lt_of_lt_of_le zero_lt_one hH have hi := finite_local_kernel_error_integral S a hK hsupp hS hY hHp hsmall apply (div_le_div_of_nonneg_right hi (sq_nonneg H)).trans have heq : ((4*H+1)*((C:ℝ)*(16*H/Y))^2*(4*H)*(∑ n ∈ S, ‖a n‖^2)) / H^2 = 1024*(C:ℝ)^2*H*(4*H+1)/Y^2*(∑ n ∈ S, ‖a n‖^2) := by field_simp ring rw [heq] have hm : 0 ≤ ∑ n ∈ S, ‖a n‖^2 := sum_nonneg (fun n _ => sq_nonneg _) apply mul_le_mul_of_nonneg_right _ hm rw [div_pow, ← mul_div_assoc] apply (div_le_div_iff_of_pos_right (sq_pos_of_pos hY)).mpr nlinarith [mul_nonneg (sq_nonneg (C:ℝ)) (show 0 ≤ H*(H-1) by positivity)] theorem exists_actual_local_kernel_error_constant : ∃ C : ℝ, 0 < C ∧ ∀ (S : Finset ℕ) (a : ℕ → ℂ), (∀ n ∈ S, 0 < n) → ∀ Y H : ℝ, 0 < Y → 1 ≤ H → H ≤ Y/8 → (∫ v in Set.Icc (Y/2) (3*Y), ‖∑ n ∈ S, a n * (localMellinKernelSchwartz (((n:ℝ)-v)/H) - localMellinKernelSchwartz (v*Real.log ((n:ℝ)/v)/H))‖^2) / H^2 ≤ C * (H/Y)^2 * (∑ n ∈ S, ‖a n‖^2) := by obtain ⟨K, hK⟩ := local_mellin_kernel_lipschitz refine ⟨5120*(K:ℝ)^2+1, by positivity, ?_⟩ intro S a hS Y H hY hH hsmall apply (normalized_local_kernel_error_bound S a hK local_mellin_kernel_unit_support hS hY hH hsmall).trans gcongr linarith end Bounty end section /- The weighted Mellin energy is a genuine finite integral for exponents greater than one. -/ open Finset MeasureTheory namespace Bounty theorem local_mellin_polynomial_continuous (S : Finset ℕ) (a : ℕ → ℂ) : Continuous (localMellinPolynomial S a) := by unfold localMellinPolynomial fun_prop theorem local_mellin_polynomial_norm_le (S : Finset ℕ) (a : ℕ → ℂ) (t : ℝ) : ‖localMellinPolynomial S a t‖ ≤ ∑ n ∈ S, ‖a n‖ := by unfold localMellinPolynomial apply (norm_sum_le _ _).trans apply sum_le_sum intro n hn rw [norm_mul, Complex.norm_exp_ofReal_mul_I, mul_one] theorem local_mellin_weighted_energy_integrable (S : Finset ℕ) (a : ℕ → ℂ) {h j : ℝ} (hh : 0 < h) (hj : 1 < j) : Integrable (fun t : ℝ => (1+|h*t|)^(-j) * ‖localMellinPolynomial S a t‖^2) := by have hi : Integrable (fun t : ℝ => (1+|t|)^(-j)) := by simpa only [Real.norm_eq_abs] using (integrable_one_add_norm (E := ℝ) (r := j) (by simpa using hj)) have hs := hi.comp_mul_left' hh.ne' apply (hs.mul_const ((∑ n ∈ S, ‖a n‖)^2)).mono' · have hc : Continuous (fun t : ℝ => (1+|h*t|)^(-j) * ‖localMellinPolynomial S a t‖^2) := by have hp := local_mellin_polynomial_continuous S a have hb : Continuous (fun t : ℝ => 1+|h*t|) := by fun_prop exact (hb.rpow_const (fun t => Or.inl (by positivity))).mul (hp.norm.pow 2) exact hc.aestronglyMeasurable · filter_upwards [] with t rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)] exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) (local_mellin_polynomial_norm_le S a t) 2) (Real.rpow_nonneg (by positivity) _) end Bounty end section /- Rough factors outside all group pools leave the actual weighted marked sum unchanged. -/ open Finset namespace Bounty end Bounty end section /- The actual amplitude has uniformly bounded derivatives through order two. -/ open Set Real open scoped FourierTransform ContDiff namespace Bounty noncomputable def localMellinAmplitudeCutoff : SchwartzMap ℝ ℂ := (show HasCompactSupport (fun u : ℝ => ((typeIISmoothRho 2 u*exp (-u) : ℝ) : ℂ)) from by apply HasCompactSupport.intro (isCompact_Icc : IsCompact (Icc (-3 : ℝ) 3)) intro u hu have hz : typeIISmoothRho 2 u = 0 := by apply typeII_smooth_rho_eq_zero intro h apply hu constructor <;> linarith [h.1,h.2] simp [hz]).toSchwartzMap (by have hρ := typeII_smooth_rho_contDiff 2 have hc : ContDiff ℝ ∞ (fun x : ℝ => (x : ℂ)) := Complex.ofRealCLM.contDiff fun_prop) theorem local_mellin_amplitude_first (j : ℕ) (v u : ℝ) : SchwartzMap.derivCLM ℂ ℂ (localMellinAmplitudeSchwartz j v) u = exponentialProfileFirst localMellinAmplitudeCutoff (𝓕 localMellinKernelSchwartz) v u * (((1+v^2)^((j : ℝ)/4) : ℝ) : ℂ) := by exact ((exponential_profile_hasDerivAt localMellinAmplitudeCutoff (𝓕 localMellinKernelSchwartz) v u).mul_const _).deriv theorem local_mellin_amplitude_second (j : ℕ) (v u : ℝ) : SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ (localMellinAmplitudeSchwartz j v)) u = exponentialProfileSecond localMellinAmplitudeCutoff (𝓕 localMellinKernelSchwartz) v u * (((1+v^2)^((j : ℝ)/4) : ℝ) : ℂ) := by have he : (SchwartzMap.derivCLM ℂ ℂ (localMellinAmplitudeSchwartz j v) : ℝ → ℂ) = fun x => exponentialProfileFirst localMellinAmplitudeCutoff (𝓕 localMellinKernelSchwartz) v x * (((1+v^2)^((j : ℝ)/4) : ℝ) : ℂ) := funext (local_mellin_amplitude_first j v) change deriv _ u = _ rw [he] exact ((exponential_profile_first_hasDerivAt localMellinAmplitudeCutoff (𝓕 localMellinKernelSchwartz) v u).mul_const _).deriv theorem local_mellin_amplitude_derivatives_zero (j : ℕ) (v u : ℝ) (hu : u ∉ Icc (-3 : ℝ) 3) : SchwartzMap.derivCLM ℂ ℂ (localMellinAmplitudeSchwartz j v) u = 0 ∧ SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ (localMellinAmplitudeSchwartz j v)) u = 0 := by have hs : tsupport (localMellinAmplitudeSchwartz j v) ⊆ Icc (-3 : ℝ) 3 := by apply closure_minimal _ isClosed_Icc intro x hx by_contra hn exact hx (local_mellin_amplitude_zero j v x hn) have hs₁ := (SchwartzMap.tsupport_derivCLM_subset ℂ (localMellinAmplitudeSchwartz j v)).trans hs have hs₂ := (SchwartzMap.tsupport_derivCLM_subset ℂ (SchwartzMap.derivCLM ℂ ℂ (localMellinAmplitudeSchwartz j v))).trans hs₁ exact ⟨image_eq_zero_of_notMem_tsupport (fun h => hu (hs₁ h)), image_eq_zero_of_notMem_tsupport (fun h => hu (hs₂ h))⟩ theorem local_mellin_amplitude_uniform_derivatives (j : ℕ) : ∃ C₀ C₁ C₂ : ℝ, 0 ≤ C₀ ∧ 0 ≤ C₁ ∧ 0 ≤ C₂ ∧ ∀ v u : ℝ, ‖localMellinAmplitudeSchwartz j v u‖ ≤ C₀ ∧ ‖SchwartzMap.derivCLM ℂ ℂ (localMellinAmplitudeSchwartz j v) u‖ ≤ C₁ ∧ ‖SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ (localMellinAmplitudeSchwartz j v)) u‖ ≤ C₂ := by obtain ⟨C₀,C₁,C₂,hC₀,hC₁,hC₂,hbound⟩ := exponential_profile_weighted_bounds localMellinAmplitudeCutoff (𝓕 localMellinKernelSchwartz) j 3 refine ⟨C₀,C₁,C₂,hC₀,hC₁,hC₂,?_⟩ intro v u by_cases hu : u ∈ Icc (-3 : ℝ) 3 · have hb := hbound v u hu have hW : 0 ≤ (1+v^2)^((j : ℝ)/4) := by positivity constructor · change ‖exponentialProfile localMellinAmplitudeCutoff (𝓕 localMellinKernelSchwartz) v u * (((1+v^2)^((j : ℝ)/4) : ℝ) : ℂ)‖ ≤ _ simpa only [norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg hW,mul_comm] using hb.1 · rw [local_mellin_amplitude_first,local_mellin_amplitude_second] simpa only [norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg hW,mul_comm] using hb.2 · have hz := local_mellin_amplitude_derivatives_zero j v u hu simpa only [show localMellinAmplitudeSchwartz j v u = 0 from local_mellin_amplitude_zero j v u hu, hz.1,hz.2,norm_zero] using And.intro hC₀ (And.intro hC₁ hC₂) end Bounty end section open scoped BigOperators open MeasureTheory namespace Bounty end Bounty end section /- A first-derivative test with monotone phase increments on an integer interval. -/ open Finset namespace Bounty theorem sum_integer_interval_as_range (g : ℤ → ℂ) {a b : ℤ} (hab : a ≤ b) : ∑ n ∈ Icc a b, g n = ∑ n ∈ range (b-a+1).toNat, g (a+n) := by symm apply sum_bij (fun (n : ℕ) _ => a+(n : ℤ)) · intro n hn rw [mem_range] at hn rw [mem_Icc] have hcast : ((b-a+1).toNat : ℤ) = b-a+1 := Int.toNat_of_nonneg (by omega) constructor <;> omega · intro n hn m hm he omega · intro z hz have hz' := mem_Icc.mp hz refine ⟨(z-a).toNat, ?_, ?_⟩ · rw [mem_range] omega · omega · intro n hn rfl theorem integer_first_derivative_sum_bound (f : ℤ → ℝ) (a b k : ℤ) {δ : ℝ} (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (hband : ∀ n ∈ Icc a b, (k : ℝ)+δ ≤ f (n+1)-f n ∧ f (n+1)-f n ≤ (k : ℝ)+1-δ) (hmono : MonotoneOn (fun n => f (n+1)-f n) (Set.Icc a b) ∨ AntitoneOn (fun n => f (n+1)-f n) (Set.Icc a b)) : ‖∑ n ∈ Icc a b, realUnitPhase (f n)‖ ≤ 2/δ := by by_cases hab : a ≤ b · rw [sum_integer_interval_as_range _ hab] have hm (n : ℕ) (hn : n < (b-a+1).toNat) : a+(n : ℤ) ∈ Icc a b := by rw [mem_Icc] have hcast : ((b-a+1).toNat : ℤ) = b-a+1 := Int.toNat_of_nonneg (by omega) constructor <;> omega apply first_derivative_range_sum_bound (fun n => f (a+(n : ℤ))) _ k hδ hδhalf · intro n hn simpa only [Nat.cast_add, Nat.cast_one, ← add_assoc] using hband _ (hm n hn) · rcases hmono with hmon | hmon · left intro n hn m hm' hnm simpa only [Nat.cast_add, Nat.cast_one, ← add_assoc] using hmon (mem_Icc.mp (hm n hn)) (mem_Icc.mp (hm m hm')) (by omega) · right intro n hn m hm' hnm simpa only [Nat.cast_add, Nat.cast_one, ← add_assoc] using hmon (mem_Icc.mp (hm n hn)) (mem_Icc.mp (hm m hm')) (by omega) · rw [Icc_eq_empty_of_lt (lt_of_not_ge hab),sum_empty,norm_zero] positivity end Bounty end section /- A genuine second derivative exponential-sum test, using the proved first derivative estimate. -/ open Finset namespace Bounty theorem nat_second_derivative_sum_bound (f : ℕ → ℝ) {a b : ℕ} {lam A : ℝ} (hab : a ≤ b) (hlam : 0 < lam) (hA : 1 ≤ A) (hsep : ∀ i ∈ Icc a b, ∀ j ∈ Icc a b, i ≤ j → lam*((j : ℝ)-i) ≤ (f (j+1)-f j)-(f (i+1)-f i) ∧ (f (j+1)-f j)-(f (i+1)-f i) ≤ A*lam*((j : ℝ)-i)) : ‖∑ n ∈ Icc a b, realUnitPhase (f n)‖ ≤ 6*(A*((b : ℝ)-a+1)*Real.sqrt lam+2/Real.sqrt lam) := by have he := discrete_second_derivative_from_first (d := fun n => f (n+1)-f n) (z := fun n => realUnitPhase (f n)) (C := 2) hab hlam hA (by norm_num) hsep (fun n _ => (real_unit_phase_norm _).le) norm_num only [show (2 : ℝ)+4=6 by norm_num] at he apply he intro δ hδ hδhalf l r k hl hr hlr hband apply nat_first_derivative_sum_bound f l r k hδ hδhalf hband intro i hi j hj hij have hi' : i ∈ Icc a b := mem_Icc.mpr ⟨hl.trans hi.1,hi.2.trans hr⟩ have hj' : j ∈ Icc a b := mem_Icc.mpr ⟨hl.trans hj.1,hj.2.trans hr⟩ have h := (hsep i hi' j hj' hij).1 have hijR : (i : ℝ) ≤ j := by exact_mod_cast hij nlinarith theorem second_derivative_sum_bound {f f' f'' : ℝ → ℝ} {a b : ℕ} {lam A : ℝ} (hab : a ≤ b) (hlam : 0 < lam) (hA : 1 ≤ A) (hf : ∀ x ∈ Set.Icc (a : ℝ) (b+1), HasDerivAt f (f' x) x) (hf' : ∀ x ∈ Set.Icc (a : ℝ) (b+1), HasDerivAt f' (f'' x) x) (hb : ∀ x ∈ Set.Icc (a : ℝ) (b+1), lam ≤ f'' x ∧ f'' x ≤ A*lam) : ‖∑ n ∈ Icc a b, realUnitPhase (f n)‖ ≤ 6*(A*((b : ℝ)-a+1)*Real.sqrt lam+2/Real.sqrt lam) := by apply nat_second_derivative_sum_bound (fun n => f n) hab hlam hA intro i hi j hj hij have hi' : (i : ℝ) ∈ Set.Icc (a : ℝ) b := by constructor · exact_mod_cast (mem_Icc.mp hi).1 · exact_mod_cast (mem_Icc.mp hi).2 have hj' : (j : ℝ) ∈ Set.Icc (a : ℝ) b := by constructor · exact_mod_cast (mem_Icc.mp hj).1 · exact_mod_cast (mem_Icc.mp hj).2 simpa only [Nat.cast_add,Nat.cast_one] using second_derivative_increment_bounds hf hf' hb hi' hj' (by exact_mod_cast hij) theorem norm_sum_real_unit_phase_neg (S : Finset ℕ) (f : ℕ → ℝ) : ‖∑ n ∈ S, realUnitPhase (-f n)‖ = ‖∑ n ∈ S, realUnitPhase (f n)‖ := by have he (x : ℝ) : realUnitPhase (-x) = (starRingEnd ℂ) (realUnitPhase x) := by unfold realUnitPhase rw [← Complex.exp_conj] congr 1 simp only [map_mul,Complex.conj_ofReal,Complex.conj_I] push_cast ring simp_rw [he] rw [← map_sum] exact Complex.norm_conj _ theorem second_derivative_sum_bound_negative {f f' f'' : ℝ → ℝ} {a b : ℕ} {lam A : ℝ} (hab : a ≤ b) (hlam : 0 < lam) (hA : 1 ≤ A) (hf : ∀ x ∈ Set.Icc (a : ℝ) (b+1), HasDerivAt f (f' x) x) (hf' : ∀ x ∈ Set.Icc (a : ℝ) (b+1), HasDerivAt f' (f'' x) x) (hb : ∀ x ∈ Set.Icc (a : ℝ) (b+1), -A*lam ≤ f'' x ∧ f'' x ≤ -lam) : ‖∑ n ∈ Icc a b, realUnitPhase (f n)‖ ≤ 6*(A*((b : ℝ)-a+1)*Real.sqrt lam+2/Real.sqrt lam) := by have h := second_derivative_sum_bound hab hlam hA (fun x hx => (hf x hx).neg) (fun x hx => (hf' x hx).neg) (show ∀ x ∈ Set.Icc (a : ℝ) (b+1), lam ≤ -f'' x ∧ -f'' x ≤ A*lam from by intro x hx have hb' := hb x hx constructor <;> linarith) simpa only [Pi.neg_apply,norm_sum_real_unit_phase_neg] using h end Bounty end section /- Actual prime-polynomial power moments and derivative moments. The integer coefficients, their factorial energy bound, and their support range are all derived from the prime tuples rather than assumed. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem prime_polynomial_support_range (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (U : ℝ) (hU : ∀ p ∈ P, (p : ℝ) ≤ U) (j N : ℕ) (hN : U ^ j ≤ (N : ℝ)) : ∀ n ∈ primePolynomialSupport P j, 1 ≤ n ∧ n ≤ N := by intro n hn exact ⟨prime_polynomial_support_pos P hP j n hn, Nat.cast_le.mp ((prime_polynomial_support_real_le P U hU j n hn).trans hN)⟩ theorem prime_polynomial_mean_square_factor_nonneg (N : ℕ) (hN : 1 ≤ N) (a b : ℝ) (hab : a ≤ b) : 0 ≤ (b - a) + 4 * (N : ℝ) * (1 + Real.log N) := by have hlog : 0 ≤ Real.log N := Real.log_nonneg (by exact_mod_cast hN) exact add_nonneg (sub_nonneg.mpr hab) (mul_nonneg (mul_nonneg (by norm_num) (Nat.cast_nonneg _)) (add_nonneg zero_le_one hlog)) theorem prime_polynomial_power_mean_square (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (w : P → ℂ) (U : ℝ) (hU : ∀ p ∈ P, (p : ℝ) ≤ U) (j N : ℕ) (hN : 1 ≤ N) (hUN : U ^ j ≤ (N : ℝ)) (a b : ℝ) (hab : a ≤ b) : (∫ t in a..b, ‖(∑ p : P, w p * Complex.exp (((Real.log (p.val : ℝ) * t : ℝ) : ℂ) * Complex.I)) ^ j‖ ^ 2) ≤ ((b - a) + 4 * (N : ℝ) * (1 + Real.log N)) * (j.factorial : ℝ) * (∑ p : P, ‖w p‖ ^ 2) ^ j := by have hexp : (fun t : ℝ => ‖(∑ p : P, w p * Complex.exp (((Real.log (p.val : ℝ) * t : ℝ) : ℂ) * Complex.I)) ^ j‖ ^ 2) = (fun t : ℝ => ‖∑ n ∈ primePolynomialSupport P j, primePolynomialCoefficient P w j n * Complex.exp (((Real.log (n : ℝ) * t : ℝ) : ℂ) * Complex.I)‖ ^ 2) := by funext t rw [prime_polynomial_power_exp_log P hP w j t] rw [hexp] have hm := dirichlet_polynomial_mean_square (primePolynomialSupport P j) (primePolynomialCoefficient P w j) N a b hab (prime_polynomial_support_range P hP U hU j N hUN) have hc := mul_le_mul_of_nonneg_left (prime_polynomial_coefficients_sq_le_factorial P hP w j) (prime_polynomial_mean_square_factor_nonneg N hN a b hab) exact hm.trans (by simpa only [mul_assoc] using hc) theorem prime_polynomial_power_hasDerivAt (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (w : P → ℂ) (j : ℕ) (t : ℝ) : HasDerivAt (fun t : ℝ => (∑ p : P, w p * Complex.exp (((Real.log (p.val : ℝ) * t : ℝ) : ℂ) * Complex.I)) ^ j) (∑ n ∈ primePolynomialSupport P j, (primePolynomialCoefficient P w j n * ((Real.log (n : ℝ) : ℂ) * Complex.I)) * Complex.exp (((Real.log (n : ℝ) * t : ℝ) : ℂ) * Complex.I)) t := by have hexp : (fun t : ℝ => (∑ p : P, w p * Complex.exp (((Real.log (p.val : ℝ) * t : ℝ) : ℂ) * Complex.I)) ^ j) = (fun t : ℝ => ∑ n ∈ primePolynomialSupport P j, primePolynomialCoefficient P w j n * Complex.exp (((Real.log (n : ℝ) * t : ℝ) : ℂ) * Complex.I)) := funext (prime_polynomial_power_exp_log P hP w j) rw [hexp] exact dirichlet_polynomial_hasDerivAt _ _ t theorem prime_polynomial_power_derivative_mean_square (P : Finset ℕ) (hP : ∀ p ∈ P, Nat.Prime p) (w : P → ℂ) (U : ℝ) (hU : ∀ p ∈ P, (p : ℝ) ≤ U) (j N : ℕ) (hN : 1 ≤ N) (hUN : U ^ j ≤ (N : ℝ)) (a b : ℝ) (hab : a ≤ b) : (∫ t in a..b, ‖∑ n ∈ primePolynomialSupport P j, (primePolynomialCoefficient P w j n * ((Real.log (n : ℝ) : ℂ) * Complex.I)) * Complex.exp (((Real.log (n : ℝ) * t : ℝ) : ℂ) * Complex.I)‖ ^ 2) ≤ ((b - a) + 4 * (N : ℝ) * (1 + Real.log N)) * (Real.log N) ^ 2 * (j.factorial : ℝ) * (∑ p : P, ‖w p‖ ^ 2) ^ j := by have hs := prime_polynomial_support_range P hP U hU j N hUN have hm := dirichlet_polynomial_mean_square (primePolynomialSupport P j) (fun n => primePolynomialCoefficient P w j n * ((Real.log (n : ℝ) : ℂ) * Complex.I)) N a b hab hs have he := (dirichlet_derivative_coefficient_energy (primePolynomialSupport P j) (primePolynomialCoefficient P w j) N hs).trans (mul_le_mul_of_nonneg_left (prime_polynomial_coefficients_sq_le_factorial P hP w j) (sq_nonneg _)) exact hm.trans (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left he (prime_polynomial_mean_square_factor_nonneg N hN a b hab)) end Bounty end section /- Supremum energy on an arbitrary finite collection of closed unit intervals. -/ open scoped BigOperators open Set namespace Bounty theorem sparse_dirichlet_unit_interval_suprema (indices : Finset ℤ) (support : Finset ℕ) (c : ℕ → ℂ) (N : ℕ) {a b U E : ℝ} (hU : 0 ≤ U) (hE : 0 ≤ E) (hleft : ∀ j ∈ indices, a ≤ (j : ℝ)) (hright : ∀ j ∈ indices, (j : ℝ) + 1 ≤ b) (hwidth : b - a ≤ N) (hkernel : ∀ z : ℝ, |z| ≤ N → ‖∑ n ∈ support, Complex.exp ((Real.log (n : ℝ) * z : ℝ) * Complex.I)‖ ≤ U / (1 + |z|) + E) : (∑ j ∈ indices, unitIntervalEnergySup (fun t => ∑ n ∈ support, c n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)) j) ≤ (3 * U * (1 + 2 * (1 + Real.log N)) + (indices.card : ℝ) * E) * ∑ n ∈ support, ‖c n‖ ^ 2 := by classical let F : ℝ → ℂ := fun t => ∑ n ∈ support, c n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I) have hF : Continuous F := by dsimp [F]; fun_prop choose point hpoint hvalue using exists_unit_interval_energy_max F hF have hspan (i : ℤ) (hi : i ∈ indices) (j : ℤ) (hj : j ∈ indices) : |point i - point j| ≤ N := by have hi0 := (hpoint i).1 have hi1 := (hpoint i).2 have hj0 := (hpoint j).1 have hj1 := (hpoint j).2 exact abs_le.mpr ⟨by linarith [hleft i hi, hright j hj], by linarith [hright i hi, hleft j hj]⟩ have hclass (r : Fin 3) : (∑ j ∈ indices.filter (fun j => unitIntervalResidue j = r), unitIntervalEnergySup F j) ≤ (U * (1 + 2 * (1 + Real.log N)) + ((indices.filter (fun j => unitIntervalResidue j = r)).card : ℝ) * E) * ∑ n ∈ support, ‖c n‖ ^ 2 := by simp_rw [hvalue] exact sparse_dirichlet_polynomial_energy _ point support c N hU hE (fun i hi j hj hij => unit_interval_residue_separated (hpoint i) (hpoint j) ((Finset.mem_filter.mp hi).2.trans (Finset.mem_filter.mp hj).2.symm) hij) (fun i hi j hj => hspan i (Finset.mem_filter.mp hi).1 j (Finset.mem_filter.mp hj).1) hkernel have hsum := Finset.sum_le_sum (fun r (_ : r ∈ (Finset.univ : Finset (Fin 3))) => hclass r) have hcard : (∑ r : Fin 3, ((indices.filter (fun j => unitIntervalResidue j = r)).card : ℝ)) = (indices.card : ℝ) := by exact_mod_cast unit_interval_residue_card_sum indices have hfiber : (∑ r : Fin 3, ∑ j ∈ indices.filter (fun j => unitIntervalResidue j = r), unitIntervalEnergySup F j) = ∑ j ∈ indices, unitIntervalEnergySup F j := Finset.sum_fiberwise_of_maps_to (fun _ _ => Finset.mem_univ _) _ rw [hfiber, ← Finset.sum_mul, Finset.sum_add_distrib] at hsum simp_rw [← Finset.sum_mul] at hsum rw [hcard] at hsum simpa only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, Nat.cast_ofNat, mul_assoc] using hsum end Bounty end section namespace Bounty theorem affine_logarithmic_phase_hasDerivAt (q a u x : ℝ) (hq : 0 < q) (hx : 0 < x+a/q) : HasDerivAt (fun y => u * Real.log (q*y+a)) (logarithmicDerivativeChain u (a/q) 1 x) x := by have heq : q*x+a = q*(x+a/q) := by field_simp have hpos : 0 < q*x+a := by rw [heq]; positivity have h := ((((hasDerivAt_id x).const_mul q).add_const a).log (ne_of_gt hpos)).const_mul u simp only [logarithmicDerivativeChain, pow_zero, Nat.factorial_zero, Nat.cast_one, mul_one, Nat.zero_add, pow_one] simp only [id_eq, mul_one] at h apply h.congr_deriv rw [heq] field_simp theorem mixed_affine_logarithmic_phase_derivatives (hs : List ℝ) (q a u x : ℝ) (hq : 0 < q) (hhs : ∀ h ∈ hs, 0 ≤ h) (hx : 0 < x+a/q) : HasDerivAt (mixedForwardDifference hs (fun y => u * Real.log (q*y+a))) (mixedForwardDifference hs (logarithmicDerivativeChain u (a/q) 1) x) x ∧ HasDerivAt (mixedForwardDifference hs (logarithmicDerivativeChain u (a/q) 1)) (mixedForwardDifference hs (logarithmicDerivativeChain u (a/q) 2) x) x := by constructor · apply mixed_forward_difference_hasDerivAt hs _ _ (-(a/q)) hhs · intro y hy exact affine_logarithmic_phase_hasDerivAt q a u y hq (by linarith) · linarith · exact mixed_logarithmic_difference_hasDerivAt hs u (a/q) 1 x hhs hx end Bounty end section open Finset namespace Bounty theorem integer_phase_iterated_van_der_corput (A B H : ℤ) (m : ℕ) (T : ℝ) (φ : ℝ → ℝ) (hAB : A ≤ B) (hH : 1 ≤ H) (hHN : H ≤ B-A+1) (hT : 0 ≤ T) (hterminal : ∀ hs : List ℤ, hs.length = m → (∀ h ∈ hs, 1 ≤ h ∧ h < H) → ∀ a b : ℤ, A ≤ a → b ≤ B → ‖∑ n ∈ Icc a b, Complex.exp ((mixedForwardDifference (hs.map (fun h : ℤ => (h:ℝ))) φ (n:ℝ):ℂ)*Complex.I)‖ ≤ ((B-A+1:ℤ):ℝ)*T) : ∀ a b : ℤ, A ≤ a → b ≤ B → ‖∑ n ∈ Icc a b, Complex.exp ((φ (n:ℝ):ℂ)*Complex.I)‖ ≤ ((B-A+1:ℤ):ℝ)*vanDerCorputScalarBound (H:ℝ) T m := by induction m generalizing φ with | zero => intro a b ha hb simpa only [List.length_nil, List.map_nil, mixedForwardDifference, vanDerCorputScalarBound] using hterminal [] rfl (by simp) a b ha hb | succ m ih => intro a b ha hb let N : ℝ := ((B-A+1:ℤ):ℝ) let V : ℝ := vanDerCorputScalarBound (H:ℝ) T m have hN : 0 < N := by dsimp only [N]; exact_mod_cast (by omega : 0 < B-A+1) have hHr : 0 < (H:ℝ) := by exact_mod_cast (by omega : 0 < H) have hV : 0 ≤ V := van_der_corput_scalar_bound_nonneg _ _ hT _ have hdiff (h : ℤ) (hh : h ∈ Icc (1:ℤ) (H-1)) : ‖∑ n ∈ Icc a (b-h), Complex.exp (((φ ((n:ℝ)+(h:ℝ))-φ (n:ℝ)):ℂ)*Complex.I)‖ ≤ N*V := by simp only [← Complex.ofReal_sub] apply ih (φ := fun x => φ (x+(h:ℝ))-φ x) · intro hs hlen hshifts c d hc hd have hlen' : (hs++[h]).length = m+1 := by simp [hlen] have hshifts' : ∀ k ∈ hs++[h], 1 ≤ k ∧ k < H := by intro k hk rcases List.mem_append.mp hk with hk | hk · exact hshifts k hk · have heq : k = h := by simpa using hk subst k have hh' := mem_Icc.mp hh omega have he := hterminal (hs++[h]) hlen' hshifts' c d hc hd simpa only [List.map_append, List.map_cons, List.map_nil, mixed_forward_difference_append, mixedForwardDifference] using he · exact ha · have hh' := mem_Icc.mp hh omega have hsumbound : (∑ h ∈ Icc (1:ℤ) (H-1), ‖∑ n ∈ Icc a (b-h), Complex.exp (((φ ((n:ℝ)+(h:ℝ))-φ (n:ℝ)):ℂ)*Complex.I)‖) ≤ (H:ℝ)*(N*V) := by calc _ ≤ ∑ _h ∈ Icc (1:ℤ) (H-1), N*V := sum_le_sum hdiff _ = ((H:ℝ)-1)*(N*V) := by rw [sum_const, nsmul_eq_mul] congr 1 have hc := Int.card_Icc_of_le (a := 1) (b := H-1) (by omega) have heq : H-1+1-1 = H-1 := by ring rw [heq] at hc exact_mod_cast hc _ ≤ (H:ℝ)*(N*V) := by nlinarith have hvdc := integer_phase_van_der_corput_subinterval A B a b H φ hAB ha hb hH hHN have hsq : ‖∑ n ∈ Icc a b, Complex.exp ((φ (n:ℝ):ℂ)*Complex.I)‖^2 ≤ N^2*(2/(H:ℝ)+4*V) := by calc _ ≤ 2*N^2/(H:ℝ)+(4*N/(H:ℝ))*((H:ℝ)*(N*V)) := hvdc.trans (add_le_add le_rfl (mul_le_mul_of_nonneg_left hsumbound (by positivity))) _ = _ := by field_simp have hbase : 0 ≤ 2/(H:ℝ)+4*V := by positivity have hsqrt : (N*Real.sqrt (2/(H:ℝ)+4*V))^2 = N^2*(2/(H:ℝ)+4*V) := by rw [mul_pow, Real.sq_sqrt hbase] have hnonneg : 0 ≤ N*Real.sqrt (2/(H:ℝ)+4*V) := by positivity change _ ≤ N*Real.sqrt (2/(H:ℝ)+4*V) nlinarith [norm_nonneg (∑ n ∈ Icc a b, Complex.exp ((φ (n:ℝ):ℂ)*Complex.I))] end Bounty end section /- Prime divisibility after removing the actual shared product. -/ open Finset namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (p : PhysicalPrime P) include G sharedInstance1 P J ell C L hprime hdis p theorem physical_prime_dvd_shared_factor : p.2.val ∣ physicalSharedFactor C L ↔ p ∈ physicalSharedPrimes C L := by classical have hp := hprime p.1 _ p.2.property constructor · intro hd obtain ⟨a, _, ha⟩ := (hp.prime.dvd_finsetProd_iff _).mp hd have he : p.2.val = (L a.1 (Sum.inl a.2.val)).val := ((Nat.dvd_prime (hprime a.1 _ (L a.1 (Sum.inl a.2.val)).property)).mp ha).resolve_left hp.ne_one have htag : p = ⟨a.1, L a.1 (Sum.inl a.2.val)⟩ := physical_prime_value_injective hdis he rw [htag, mem_physical_shared_primes] exact ⟨Sum.inl a.2.val, (physical_mem_shared_slots_iff _ _).mpr ⟨a.2.val, (mem_sdiff.mp a.2.property).2, rfl⟩, rfl⟩ · intro hm obtain ⟨s, hs, he⟩ := (mem_physical_shared_primes C L p).mp hm obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff _ _).mp hs rw [← he] exact dvd_prod_of_mem (fun a : PhysicalSharedIndex C => (L a.1 (Sum.inl a.2.val)).val) (mem_univ ⟨p.1, ⟨j, mem_sdiff.mpr ⟨mem_univ _, hj⟩⟩⟩) theorem physical_prime_dvd_shared_mul (w : ℤ) : (p.2.val : ℤ) ∣ (physicalSharedFactor C L : ℤ) * w ↔ p ∈ physicalSharedPrimes C L ∨ (p.2.val : ℤ) ∣ w := by rw [(Nat.prime_iff_prime_int.mp (hprime p.1 _ p.2.property)).dvd_mul, Int.natCast_dvd_natCast, physical_prime_dvd_shared_factor C L hprime hdis] end end Bounty end section /- Extracted prime sums as literal four-factor divisor convolutions. -/ open Finset namespace Bounty noncomputable def endpointFourConvolution (δ α β γ : ℕ → ℂ) (n : ℕ) : ℂ := ∑ d ∈ n.divisors, δ d * endpointTripleConvolution α β γ (n / d) theorem prime_sum_eq_divisor_convolution (S : Finset ℕ) (δ f : ℕ → ℂ) {n : ℕ} (hn : n ≠ 0) : (∑ p ∈ S, if p ∣ n then δ p * f (n / p) else 0) = ∑ p ∈ n.divisors, (if p ∈ S then δ p else 0) * f (n / p) := by classical have hs : S.filter (fun p => p ∣ n) = n.divisors.filter (fun p => p ∈ S) := by ext p constructor · intro h obtain ⟨hp, hd⟩ := mem_filter.mp h exact mem_filter.mpr ⟨Nat.mem_divisors.mpr ⟨hd, hn⟩, hp⟩ · intro h obtain ⟨hd, hp⟩ := mem_filter.mp h exact mem_filter.mpr ⟨hp, (Nat.mem_divisors.mp hd).1⟩ rw [← sum_filter, hs, sum_filter] simp only [ite_mul, zero_mul] theorem prime_peel_weighted_triple_convolution (S Q : Finset ℕ) (δ W α β γ : ℕ → ℂ) (hW : ∀ a d : ℕ, d ≠ 0 → Disjoint d.primeFactors Q → W (a * d) = W a) (hα : ∀ d, ¬ Disjoint d.primeFactors Q → α d = 0) (hβ : ∀ d, ¬ Disjoint d.primeFactors Q → β d = 0) {n : ℕ} (hn : n ≠ 0) : (∑ p ∈ S, if p ∣ n then δ p * (W (n / p) * invariantTripleEndpoint Q α β γ (n / p)) else 0) = endpointFourConvolution (fun p => if p ∈ S then δ p else 0) α β (fun r => W r * γ (primePoolFreePart Q r)) n := by classical unfold endpointFourConvolution rw [← prime_sum_eq_divisor_convolution S δ _ hn] apply sum_congr rfl intro p _ by_cases hp : p ∣ n · rw [if_pos hp, if_pos hp] congr 1 apply weighted_invariant_triple_convolution Q W α β γ hW hα hβ intro hz have he := Nat.mul_div_cancel' hp rw [hz, mul_zero] at he exact hn he.symm · rw [if_neg hp, if_neg hp] end Bounty end section /- The actual prime-polynomial exceptional set is measurable and covered by exactly the occupied unit intervals used in its counting theorem. -/ open Finset Set MeasureTheory open scoped Classical namespace Bounty theorem prime_exceptional_times_measurable (s : Finset ℕ) (coeff : s → ℂ) (η R : ℝ) : MeasurableSet (primeExceptionalTimes s coeff η R) := by have hp : Continuous (primeReciprocalPolynomial s coeff) := by unfold primeReciprocalPolynomial fun_prop exact (isClosed_le continuous_abs continuous_const).measurableSet.inter (isOpen_lt continuous_const hp.norm).measurableSet theorem prime_exceptional_times_covered (s : Finset ℕ) (coeff : s → ℂ) (η R : ℝ) : ∀ t ∈ primeExceptionalTimes s coeff η R, ∃ j ∈ primeExceptionalIntervals s coeff η R, t ∈ Icc (j : ℝ) ((j : ℝ) + 1) := by intro t ht have hunit : t ∈ Icc ((⌊t⌋ : ℤ) : ℝ) (((⌊t⌋ : ℤ) : ℝ) + 1) := ⟨Int.floor_le t, (Int.lt_floor_add_one t).le⟩ refine ⟨⌊t⌋, ?_, hunit⟩ exact (mem_primeExceptionalIntervals s coeff η R ⌊t⌋).mpr ⟨t, hunit, ht⟩ theorem prime_exceptional_integral_le_unit_suprema (s : Finset ℕ) (coeff : s → ℂ) (η R : ℝ) (F : ℝ → ℂ) (hF : Continuous F) : (∫ t in primeExceptionalTimes s coeff η R, ‖F t‖ ^ 2) ≤ ∑ j ∈ primeExceptionalIntervals s coeff η R, unitIntervalEnergySup F j := exceptional_integral_le_unit_suprema (primeExceptionalIntervals s coeff η R) (primeExceptionalTimes s coeff η R) (prime_exceptional_times_measurable s coeff η R) F hF (prime_exceptional_times_covered s coeff η R) end Bounty end section /- A global norm bound for the literal reciprocal prime polynomial. -/ open Finset namespace Bounty theorem prime_reciprocal_polynomial_norm_le (s : Finset ℕ) (coeff : s → ℂ) {P B : ℝ} (hP : 1 ≤ P) (hB : 0 ≤ B) (hband : ∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) (hcoeff : ∀ p : s, ‖coeff p‖ ≤ B) (t : ℝ) : ‖primeReciprocalPolynomial s coeff t‖ ≤ 2 * B := by have hP0 : 0 < P := zero_lt_one.trans_le hP unfold primeReciprocalPolynomial calc _ ≤ ∑ p : s, ‖(coeff p / (p.val : ℂ)) * Complex.exp (((Real.log (p.val : ℝ) * t : ℝ) : ℂ) * Complex.I)‖ := norm_sum_le _ _ _ ≤ ∑ _p : s, B / P := by apply Finset.sum_le_sum intro p _ rw [norm_mul, Complex.norm_exp_ofReal_mul_I, mul_one, norm_div, Complex.norm_natCast] exact div_le_div₀ hB (hcoeff p) hP0 (hband p.val p.property).1 _ = (s.card : ℝ) * (B / P) := by simp _ ≤ (2 * P) * (B / P) := mul_le_mul_of_nonneg_right (nat_dyadic_card_le s P hP hband) (div_nonneg hB hP0.le) _ = 2 * B := by field_simp end Bounty end section /- Unit-size character, phase and cutoff factors preserve the global power bound. -/ open Finset Filter namespace Bounty end Bounty end section /- The actual normalized small-prime factor, including arbitrary unit phases. -/ open Finset Filter namespace Bounty theorem prime_reciprocal_polynomial_eq_harmonic_sum (s : Finset ℕ) (δ : ℕ → ℂ) (u : ℝ) : primeReciprocalPolynomial s (fun p => δ p.val) u = ∑ p ∈ s, δ p*harmonicMellinWeight u p := by unfold primeReciprocalPolynomial rw [← sum_coe_sort s (fun p => δ p*harmonicMellinWeight u p)] apply sum_congr rfl intro p _ unfold harmonicMellinWeight have he : ((Real.log (p.val : ℝ)*u : ℝ) : ℂ)*Complex.I = Complex.I*((u*Real.log (p.val : ℝ) : ℝ) : ℂ) := by push_cast; ring rw [he] push_cast ring theorem exists_candidate_small_prime_factor_data {c : ℝ} (hc : 0 < c) : ∃ Bcoeff : ℝ, 1 ≤ Bcoeff ∧ ∀ᶠ L : ℝ in atTop, ∀ g ∈ candidateSmallPIndices c L, ∀ (s : Finset ℕ) (P : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → (∀ p ∈ s, p.Prime) ∧ Real.exp (L^(1/10 : ℝ))/2 ≤ P ∧ P ≤ Real.exp (L^(1/5 : ℝ)) ∧ ∀ θ : ℕ → ℂ, (∀ p ∈ s, ‖θ p‖ ≤ 1) → ∀ p : s, ‖(1 / (((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))*θ p.val‖ ≤ Bcoeff := by obtain ⟨v,V,hv,_,hgroups⟩ := eventually_candidate_P_groups (α := (1/10 : ℝ)) (β := (1/5 : ℝ)) hc (by norm_num) (by norm_num) (by norm_num) refine ⟨max 1 (1/v),le_max_left _ _,?_⟩ filter_upwards [hgroups] with L hg intro g hgin s P hs hne hband have hdata := hg.2.2.2 g hgin obtain ⟨p,hp⟩ := hne have hpdata := hdata.2.2 p (hs hp) have hpband := hband p hp refine ⟨(fun p hp => (hdata.2.2 p (hs hp)).1),by linarith [hpdata.2.1], hpband.1.trans hpdata.2.2,?_⟩ intro θ hθ p have hmass := hdata.1 have hmasspos : 0 < ∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ) := hv.trans_le hmass rw [norm_mul,norm_div,norm_one,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hmasspos] calc _ ≤ 1/v*1 := mul_le_mul (one_div_le_one_div_of_le hv hmass) (hθ p.val p.property) (norm_nonneg _) (by positivity) _ ≤ max 1 (1/v) := by simpa only [mul_one] using le_max_right 1 (1/v) end Bounty end section /- Exact finite pullback along multiplication, with a constructed finite cutoff. -/ open Finset open scoped Classical namespace Bounty theorem integer_scaled_position_sum {s : ℤ} (hs : s ≠ 0) (Z positions : Finset ℤ) (hcover : ∀ z ∈ Z, s * z ∈ positions) (F : ℤ → ℂ) : (∑ n ∈ positions, if s ∣ n ∧ n / s ∈ Z then F (n / s) else 0) = ∑ z ∈ Z, F z := by have hsub : Z.image (fun z => s * z) ⊆ positions := by intro n hn obtain ⟨z, hz, rfl⟩ := mem_image.mp hn exact hcover z hz have ho : ∀ n ∈ positions, n ∉ Z.image (fun z => s * z) → (if s ∣ n ∧ n / s ∈ Z then F (n / s) else 0) = 0 := by intro n _ hn apply if_neg rintro ⟨hd, hz⟩ exact hn (mem_image.mpr ⟨n / s, hz, Int.mul_ediv_cancel' hd⟩) rw [← sum_subset hsub ho] rw [sum_image] · apply sum_congr rfl intro z hz have he : s * z / s = z := by exact Int.mul_ediv_cancel_left z hs rw [he, if_pos ⟨dvd_mul_right s z, hz⟩] · intro a _ b _ hab exact mul_left_cancel₀ hs hab end Bounty end section /- Exact shared and unshared coordinates for the original marked slots. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalCutSlotMap {J ell : ℕ} (C : Finset (Fin J)) : ↥(univ \ C) ⊕ Fin (ell + C.card) → PhysicalSlots J ell := Sum.elim (fun j => Sum.inl j.val) (fun j => (physicalGroupUnsharedIndex C j).val) theorem physical_cut_slot_map_bijective {J ell : ℕ} (C : Finset (Fin J)) : Function.Bijective (physicalCutSlotMap (ell := ell) C) := by constructor · intro a b hab cases a with | inl a => cases b with | inl b => exact congrArg Sum.inl (Subtype.ext (Sum.inl.inj hab)) | inr b => have hs : Sum.inl a.val ∈ physicalSharedSlots (ell := ell) C := (physical_mem_shared_slots_iff C _).mpr ⟨a.val, (mem_sdiff.mp a.property).2, rfl⟩ have hn := (physicalGroupUnsharedIndex (ell := ell) C b).property change Sum.inl a.val = (physicalGroupUnsharedIndex C b).val at hab rw [hab] at hs exact False.elim ((mem_compl.mp hn) hs) | inr a => cases b with | inl b => have hs : Sum.inl b.val ∈ physicalSharedSlots (ell := ell) C := (physical_mem_shared_slots_iff C _).mpr ⟨b.val, (mem_sdiff.mp b.property).2, rfl⟩ have hn := (physicalGroupUnsharedIndex (ell := ell) C a).property change (physicalGroupUnsharedIndex C a).val = Sum.inl b.val at hab rw [← hab] at hs exact False.elim ((mem_compl.mp hn) hs) | inr b => exact congrArg Sum.inr ((physicalGroupUnsharedIndex C).injective (Subtype.ext hab)) · intro s by_cases hs : s ∈ physicalSharedSlots (ell := ell) C · obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff C s).mp hs exact ⟨Sum.inl ⟨j, mem_sdiff.mpr ⟨mem_univ _, hj⟩⟩, rfl⟩ · have hu : s ∈ physicalUnsharedSlots (ell := ell) C := mem_compl.mpr hs refine ⟨Sum.inr ((physicalGroupUnsharedIndex C).symm ⟨s, hu⟩), ?_⟩ exact congrArg Subtype.val ((physicalGroupUnsharedIndex C).apply_symm_apply ⟨s, hu⟩) noncomputable def physicalCutSlotEquiv {J ell : ℕ} (C : Finset (Fin J)) : ↥(univ \ C) ⊕ Fin (ell + C.card) ≃ PhysicalSlots J ell := Equiv.ofBijective (physicalCutSlotMap C) (physical_cut_slot_map_bijective C) end Bounty end section /- Shared-coordinate independence of a prime coefficient does not remove the original auxiliary exclusions from the surrounding physical edge. -/ open Finset Classical namespace Bounty theorem physical_aux_avoids_shared_unshared_iff {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (L : PhysicalMarkLists P J ell) : physicalAuxAvoids C aux L ↔ (∀ g (j : C g) (s : ↥(univ \ C g)), aux g j ≠ L g (Sum.inl s.val)) ∧ (∀ g (j : C g) (u : Fin (ell + (C g).card)), aux g j ≠ physicalGroupUnsharedEmbedding C L g u) := by constructor · intro h exact ⟨fun g j s => h g j (Sum.inl s.val), fun g j u => h g j (physicalGroupUnsharedIndex (C g) u).val⟩ · rintro ⟨hs, hu⟩ g j s by_cases hmem : s ∈ physicalUnsharedSlots (C g) · intro he exact hu g j ((physicalGroupUnsharedIndex (C g)).symm ⟨s, hmem⟩) (he.trans (physical_unshared_coordinate_embedding C L g s hmem).symm) · have hshared : s ∈ physicalSharedSlots (C g) := by simpa only [physicalUnsharedSlots, mem_compl, not_not] using hmem obtain ⟨v, hv, rfl⟩ := (physical_mem_shared_slots_iff (C g) s).mp hshared exact hs g j ⟨v, mem_sdiff.mpr ⟨mem_univ _, hv⟩⟩ end Bounty end section /- Arbitrary power saving for the actual shared-draw error, uniformly over cuts, harmonic masses, and logarithmic list lengths. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- Vertex weights are insensitive to the sign of the integer position. -/ open Finset namespace Bounty theorem physical_vertex_weight_natAbs {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (q : ℝ) (n : ℤ) : physicalVertexWeight L q (n.natAbs : ℤ) = physicalVertexWeight L q n := by classical simp only [physicalVertexWeight, physicalOmega, physicalDivisorPool, Int.dvd_natAbs] theorem physical_vertex_weight_scaled_natAbs {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) (q : ℝ) (s : ℕ) (n : ℤ) : physicalVertexWeight L q ((s : ℤ) * (n.natAbs : ℤ)) = physicalVertexWeight L q ((s : ℤ) * n) := by simpa only [Int.natAbs_mul, Int.natAbs_natCast, Nat.cast_mul] using physical_vertex_weight_natAbs L q ((s : ℤ) * n) end Bounty end section /- The original invariant triple endpoints satisfy the required shared dilation identity. -/ open Finset namespace Bounty end Bounty end section /- The actual small residue endpoint factors combine into the original vertex schedule, including zero-weight paths and both slot permutations. -/ open Finset namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} include G sharedInstance1 P J ell theorem physical_residue_vertex_weight_mul (L : PhysicalMarkLists P J ell) (r : PhysicalResidues P) (a b : ℝ) : physicalResidueVertexWeight L a r * physicalResidueVertexWeight L b r = physicalResidueVertexWeight L (a * b) r := by unfold physicalResidueVertexWeight split_ifs <;> simp only [mul_pow, prod_mul_distrib, mul_zero] theorem physical_residue_endpoint_square (L : PhysicalMarkLists P J ell) (r : PhysicalResidues P) {q : ℝ} (hq : 0 ≤ q) : physicalResidueVertexWeight L (Real.sqrt q) r ^ 2 = physicalResidueVertexWeight L q r := by rw [pow_two, physical_residue_vertex_weight_mul, Real.mul_self_sqrt hq] theorem physical_residue_endpoint_schedule_product (L : ℕ → PhysicalMarkLists P J ell) (r : ℕ → PhysicalResidues P) {q : ℝ} (hq : 0 ≤ q) (N : ℕ) : (∏ j ∈ range (N + 1), physicalResidueVertexWeight (L j) (Real.sqrt q) (r j) * physicalResidueVertexWeight (L (j + 1)) (Real.sqrt q) (r (j + 1))) = ∏ j ∈ range (N + 2), physicalResidueVertexWeight (L j) (physicalEndpointSchedule q (N + 1) j) (r j) := by rw [adjacent_endpoint_product, range_product_endpoints] simp only [physical_residue_endpoint_square _ _ hq] have h0 : physicalEndpointSchedule q (N + 1) 0 = Real.sqrt q := by simp [physicalEndpointSchedule] have ht : physicalEndpointSchedule q (N + 1) (N + 1) = Real.sqrt q := by simp [physicalEndpointSchedule] rw [h0, ht] congr 1 apply prod_congr rfl intro j hj have hjN := mem_range.mp hj have hne0 : j + 1 ≠ 0 := by omega have hnet : j + 1 ≠ N + 1 := by omega simp only [physicalEndpointSchedule, hne0, hnet, or_self, if_false] theorem physical_residue_permuted_endpoint_product (L : ℕ → PhysicalMarkLists P J ell) (r : ℕ → PhysicalResidues P) (σ τ : ℕ → PhysicalPermutations G J ell) {q : ℝ} (hq : 0 ≤ q) (N : ℕ) : (∏ j ∈ range (N + 1), physicalResidueVertexWeight (physicalPermuteLabels (σ j) (L j)) (Real.sqrt q) (r j) * physicalResidueVertexWeight (physicalPermuteLabels (τ j) (L (j + 1))) (Real.sqrt q) (r (j + 1))) = ∏ j ∈ range (N + 2), physicalResidueVertexWeight (L j) (physicalEndpointSchedule q (N + 1) j) (r j) := by simp only [physical_small_vertex_permutation] exact physical_residue_endpoint_schedule_product L r hq N end end Bounty end section /- Arbitrary power saving for the actual shared-draw error, uniformly over cuts, harmonic masses, logarithmic list lengths, and polynomial endpoint logarithms. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_physical_shared_error_polynomial_decay {c v A B : ℝ} (hc : 0 < c) (hv : 0 < v) (hA : 0 ≤ A) (hB : 0 ≤ B) (E F D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type*) [Fintype G] (J : ℕ) (C : G → Finset (Fin J)) (V : G → ℝ) (T H Pmin : ℝ), (∀ g, v ≤ V g) → (J * Fintype.card G : ℕ) ≤ A * Real.log L → 0 ≤ T → T ≤ B * L^F → 0 ≤ H → H ≤ L ^ E → Real.exp (L ^ c) ≤ Pmin → (∑ g : G, (J - (C g).card : ℕ) * T / (V g * Pmin)) * (H + H / (1 / 2 : ℝ) ^ (2 * ∑ g : G, (J - (C g).card))) ≤ L ^ (-D) := by let e : ℝ := A * Real.log 4 let C0 : ℝ := A * B / v have hC0 : 0 ≤ C0 := by dsimp only [C0]; positivity filter_upwards [eventually_polynomial_div_exp_power hc (2*C0) (1+F+E+e) D, eventually_ge_atTop (1 : ℝ)] with L hdec hL intro G _ J C V T H Pmin hV hJ hT hTL hH hHL hPmin have hL0 : 0 < L := zero_lt_one.trans_le hL have hP0 : 0 < Pmin := (Real.exp_pos _).trans_le hPmin have hJL : ((J * Fintype.card G : ℕ) : ℝ) ≤ A * L := hJ.trans (mul_le_mul_of_nonneg_left (Real.log_le_self hL0.le) hA) have hδ : (∑ g : G, (J - (C g).card : ℕ) * T / (V g * Pmin)) ≤ C0 * L^(1+F) / Real.exp (L^c) := by calc _ ≤ (Fintype.card G : ℝ) * J * T / (v * Pmin) := physical_shared_error_uniform_bound C V hv hP0 hT hV _ ≤ (A*L) * (B*L^F) / (v * Real.exp (L^c)) := by have hjn : (Fintype.card G : ℝ) * J ≤ A*L := by simpa only [Nat.cast_mul, mul_comm] using hJL apply div_le_div₀ (by positivity) (mul_le_mul hjn hTL hT (by positivity)) (mul_pos hv (Real.exp_pos _)) (mul_le_mul_of_nonneg_left hPmin hv.le) _ = _ := by rw [Real.rpow_add hL0, Real.rpow_one] dsimp only [C0] field_simp have hother : H + H / (1 / 2 : ℝ) ^ (2 * ∑ g : G, (J - (C g).card)) ≤ 2 * L^E * L^e := by calc _ ≤ 2 * H * (4 : ℝ) ^ (J * Fintype.card G) := physical_shared_half_overlap_bound C hH _ ≤ 2 * L^E * L^e := mul_le_mul (mul_le_mul_of_nonneg_left hHL (by norm_num)) (by simpa only [Nat.mul_one, Nat.cast_one, mul_one] using (four_pow_length_le_rpow (n := 1) hL0 hJ)) (by positivity) (by positivity) calc _ ≤ (C0 * L^(1+F) / Real.exp (L^c)) * (2 * L^E * L^e) := mul_le_mul hδ hother (by positivity) (by positivity) _ = (2*C0) * L^(1+F+E+e) / Real.exp (L^c) := by simp only [Real.rpow_add hL0] ring _ ≤ _ := hdec end Bounty end section /- Read every retained prime coordinate directly from the selected groups. No completion on the complementary groups is chosen. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSelectedPrimeRestriction {G : Type*} [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (A B T : Finset (RepeatedBigFlatIndex G J ell)) (hT : T ⊆ A ∪ B) (S : Finset G) (hS : ∀ i ∈ T, i.1 ∈ S) (u : GroupMarkedLists (fun g : S => P g.val) (fun g : S => ell + (repeatedBigAuxCut A B g.val).card)) : ∀ i : T, P i.val.1 := fun i => u ⟨i.val.1, hS i.val i.property⟩ ((physicalGroupUnsharedIndex (repeatedBigAuxCut A B i.val.1)).symm ⟨i.val.2, repeated_big_aux_union_unshared A B i.val (hT i.property)⟩) end Bounty end section /- Deterministic residue phases along the actual chronological schedule. -/ open Finset namespace Bounty theorem deterministic_ledger_phase_map {I K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) (phase : ∀ k, L → (x : X) → E k x → ℂ) (tag : I → K) (ks : List I) (l : L) (x : X) (p : FiniteEventPath (fun i => E (tag i)) (fun i => target (tag i)) ks x) : deterministicLedgerPhase (fun i => E (tag i)) (fun i => target (tag i)) (fun i => update (tag i)) (fun i => phase (tag i)) ks l x p = deterministicLedgerPhase E target update phase (ks.map tag) l x (finiteEventPathMapEquiv E target tag ks x p) := by induction ks generalizing l x with | nil => rfl | cons i ks ih => rcases p with ⟨e, p⟩ exact congrArg (phase (tag i) l x e * ·) (ih (update (tag i) l x e) (target (tag i) x e) p) theorem deterministic_ledger_schedule_product {L X : Type*} (E : ℕ → X → Type*) (target : ∀ i x, E i x → X) (update : ∀ i, L → (x : X) → E i x → L) (phase : ∀ i, L → (x : X) → E i x → ℂ) (m : ℕ) (x : X) (p : FiniteEventPath E target (List.range m) x) (l : Fin (m + 1) → L) (hstep : ∀ i : Fin m, update i.val (l i.castSucc) (finiteScheduleOccurrence E target m x p i).1 (finiteScheduleOccurrence E target m x p i).2 = l i.succ) : deterministicLedgerPhase E target update phase (List.range m) (l 0) x p = ∏ i : Fin m, phase i.val (l i.castSucc) (finiteScheduleOccurrence E target m x p i).1 (finiteScheduleOccurrence E target m x p i).2 := by let lf : Fin ((List.range m).length + 1) → L := fun i => l ⟨i.val, by simpa only [List.length_range] using i.isLt⟩ have hs (i : Fin (List.range m).length) : update ((List.range m).get i) (lf i.castSucc) (finiteEventPathOccurrence E target (List.range m) x p i).1 (finiteEventPathOccurrence E target (List.range m) x p i).2 = lf i.succ := by let j : Fin m := ⟨i.val, by simpa only [List.length_range] using i.isLt⟩ exact (finite_schedule_occurrence_apply E target (fun t y e => update t (lf i.castSucc) y e) m x p j).symm.trans (hstep j) have h := deterministic_ledger_phase_eq_product E target update phase (List.range m) x p lf hs change deterministicLedgerPhase E target update phase (List.range m) (lf 0) x p = _ rw [h] let F : Fin m → ℂ := fun i => phase i.val (l i.castSucc) (finiteScheduleOccurrence E target m x p i).1 (finiteScheduleOccurrence E target m x p i).2 change _ = ∏ i : Fin m, F i rw [← (finCongr (show (List.range m).length = m from List.length_range)).prod_comp F] apply prod_congr rfl intro i _ exact (finite_schedule_occurrence_apply E target (fun t y e => phase t (lf i.castSucc) y e) m x p ((finCongr (show (List.range m).length = m from List.length_range)) i)).symm end Bounty end section /- The auxiliary multiplier has norm at most one for bounded tests under the original normalized reciprocal-prime law. -/ open Finset open scoped Classical namespace Bounty theorem physical_aux_fourier_norm {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hA : ∀ a, ‖bA a‖ ≤ 1) (hB : ∀ b, ‖bB b‖ ≤ 1) (x : ℝ) : ‖physicalAuxFourierMultiplier P V A B hU hAB k bA bB x‖ ≤ 1 := by unfold physicalAuxFourierMultiplier calc _ ≤ ∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), ‖(physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * bA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * bB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 * fourier (-(k * (∏ g, ∏ j : repeatedBigAuxCut A B g, (aux g j).val : ℕ))) (x : AddCircle (1 : ℝ))‖ := norm_sum_le _ _ _ ≤ ∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), physicalAuxMass V (repeatedBigAuxCut A B) aux := by apply sum_le_sum intro aux _ have hμ := physical_aux_mass_nonneg V (repeatedBigAuxCut A B) (fun g => (hV g).le) aux have hf (n : ℤ) : ‖fourier n (x : AddCircle (1 : ℝ))‖ = 1 := by rw [fourier_apply, Circle.norm_coe] simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hμ, hf, mul_one] calc _ ≤ physicalAuxMass V (repeatedBigAuxCut A B) aux * 1 * 1 := by gcongr · exact hA _ · exact hB _ _ = _ := by ring _ = 1 := physical_aux_mass_sum V (repeatedBigAuxCut A B) hV hMass end Bounty end section /- The original auxiliary multiplier obeys the supported bilinear estimate under product-atom bounds. Range assumptions apply only to nonzero tests. -/ open Finset open scoped Classical namespace Bounty theorem physical_product_test_energy_le {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (hV : ∀ i, 0 < V i) (hMass : ∀ i, ∑ p ∈ P i, 1 / (p : ℝ) = V i) (b : (∀ i, P i) → ℂ) (hb : ∀ x, ‖b x‖ ≤ 1) : (∑ x, finiteProductWeight (physicalLabelLaw V) x * ‖b x‖^2) ≤ 1 := by calc _ ≤ ∑ x, finiteProductWeight (physicalLabelLaw V) x := by apply sum_le_sum intro x _ have hw : 0 ≤ finiteProductWeight (physicalLabelLaw V) x := prod_nonneg (fun i _ => physical_label_law_nonneg V (fun i => (hV i).le) i (x i)) have he : ‖b x‖^2 ≤ 1 := by nlinarith [norm_nonneg (b x), hb x] simpa only [mul_one] using mul_le_mul_of_nonneg_left he hw _ = 1 := finite_product_weight_sum_one _ (fun i => physical_label_law_sum V i (hV i) (hMass i)) theorem physical_aux_fourier_dyadic_bound {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hA : ∀ a, ‖bA a‖ ≤ 1) (hB : ∀ b, ‖bB b‖ ≤ 1) (U W : ℕ) (hUpos : 0 < U) (hWpos : 0 < W) (hArange : ∀ a, bA a ≠ 0 → U ≤ ∏ i : A, (a i).val ∧ (∏ i : A, (a i).val) < 2*U) (hBrange : ∀ b, bB b ≠ 0 → W ≤ ∏ i : B, (b i).val ∧ (∏ i : B, (b i).val) < 2*W) {C D : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hAtomA : ∀ m : ℕ, (∑ a ∈ univ.filter (fun a : (∀ i : A, P i.val.1) => (∏ i : A, (a i).val) = m), finiteProductWeight (fun i : A => physicalLabelLaw V i.val.1) a) ≤ C/(m : ℝ)) (hAtomB : ∀ m : ℕ, (∑ b ∈ univ.filter (fun b : (∀ i : B, P i.val.1) => (∏ i : B, (b i).val) = m), finiteProductWeight (fun i : B => physicalLabelLaw V i.val.1) b) ≤ D/(m : ℝ)) (θ : ℝ) {u : ℤ} {r : ℕ} (hr : 0 < r) (hcop : (r : ℤ).gcd u = 1) {β : ℝ} (hβ : |β| ≤ 1/(r : ℝ)^2) (hθ : (-k : ℝ)*θ = u/r+β) : ‖physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ‖^2 ≤ 6*C*D*(1+Real.log r)* (1/(r : ℝ)+1/(U : ℝ)+1/(W : ℝ)+(r : ℝ)/((U : ℝ)*W)) := by rw [physical_aux_fourier_split] have hAn (a : ∀ i : A, P i.val.1) : 0 ≤ finiteProductWeight (fun i : A => physicalLabelLaw V i.val.1) a := prod_nonneg (fun i _ => physical_label_law_nonneg V (fun g => (hV g).le) i.val.1 (a i)) have hBn (b : ∀ i : B, P i.val.1) : 0 ≤ finiteProductWeight (fun i : B => physicalLabelLaw V i.val.1) b := prod_nonneg (fun i _ => physical_label_law_nonneg V (fun g => (hV g).le) i.val.1 (b i)) have heA := physical_product_test_energy_le (fun i : A => P i.val.1) (fun i : A => V i.val.1) (fun i => hV i.val.1) (fun i => hMass i.val.1) bA hA have heB := physical_product_test_energy_le (fun i : B => P i.val.1) (fun i : B => V i.val.1) (fun i => hV i.val.1) (fun i => hMass i.val.1) bB hB have hb := supported_product_fourier_dyadic_bound (fun a : (∀ i : A, P i.val.1) => ∏ i : A, (a i).val) (fun b : (∀ i : B, P i.val.1) => ∏ i : B, (b i).val) U W hUpos hWpos _ _ hAn hBn bA bB hArange hBrange hC hD hAtomA hAtomB k θ hr hcop hβ hθ apply hb.trans have hlog : 0 ≤ Real.log (r : ℝ) := Real.log_nonneg (by exact_mod_cast hr) have heAn : 0 ≤ ∑ a, finiteProductWeight (fun i : A => physicalLabelLaw V i.val.1) a * ‖bA a‖^2 := sum_nonneg (fun a _ => mul_nonneg (hAn a) (sq_nonneg _)) have heBn : 0 ≤ ∑ b, finiteProductWeight (fun i : B => physicalLabelLaw V i.val.1) b * ‖bB b‖^2 := sum_nonneg (fun b _ => mul_nonneg (hBn b) (sq_nonneg _)) calc _ ≤ (6*C*D*(1+Real.log r)* (1/(r : ℝ)+1/(U : ℝ)+1/(W : ℝ)+(r : ℝ)/((U : ℝ)*W)))*1*1 := by gcongr · exact heA · exact heB _ = _ := by ring end Bounty end section /- Explicit finite arc counts and positive-denominator rational centers. -/ open Finset MeasureTheory namespace Bounty theorem rational_major_arc_count (Q N : ℕ) : ((Icc 1 Q).card : ℝ) * ((Icc (-(N : ℤ)) (N : ℤ)).card : ℝ) = (Q : ℝ)*(2*(N : ℝ)+1) := by have hQ : (Icc 1 Q).card = Q := by rw [Nat.card_Icc]; omega have hN : (Icc (-(N : ℤ)) (N : ℤ)).card = 2*N+1 := by rw [Int.card_Icc]; omega rw [hQ,hN] push_cast rfl theorem product_major_energy_uniform_bound (S : Finset ℤ) (f : ℤ → ℂ) {k : ℤ} {L q U V E : ℝ} (hk : k ≠ 0) (hU : 0 < U) (hV : 0 < V) (hscale : L^q ≤ U*V) (hE : ∀ r ∈ Icc 1 ⌊L^q⌋₊, ∀ u ∈ Icc (-((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℤ)) ((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℤ), (∫ x in Set.Icc (-(u : ℝ)/((k : ℝ)*r)-L^q/(|(k : ℝ)| *(U*V))) (-(u : ℝ)/((k : ℝ)*r)+L^q/(|(k : ℝ)| *(U*V))), ‖finiteFourierSum S f x‖^2) ≤ E) : (∫ x in productMajorArcSet k L q U V ∩ Set.Ioc 0 1, ‖finiteFourierSum S f x‖^2) ≤ (⌊L^q⌋₊ : ℝ)*(2*((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℝ)+1)*E := by apply (product_major_energy_cover S f hk hU hV hscale).trans calc _ ≤ ∑ r ∈ Icc 1 ⌊L^q⌋₊, ∑ u ∈ Icc (-((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℤ)) ((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℤ), E := by apply sum_le_sum intro r hr apply sum_le_sum intro u hu exact hE r hr u hu _ = _ := by simp only [sum_const, nsmul_eq_mul] rw [← mul_assoc, rational_major_arc_count] theorem product_major_center_positive_denominator {k : ℤ} (hk : k ≠ 0) (u : ℤ) {r : ℕ} (hr : 0 < r) : -(u : ℝ)/((k : ℝ)*r) = ((-(k.sign*u) : ℤ) : ℝ)/((k.natAbs*r : ℕ) : ℝ) := by have hkR : (k : ℝ) ≠ 0 := by exact_mod_cast hk have hrR : (r : ℝ) ≠ 0 := by exact_mod_cast hr.ne' have ha : (k.natAbs : ℝ) ≠ 0 := by exact_mod_cast (Int.natAbs_ne_zero.mpr hk) have he : (k : ℝ)*(k.sign : ℝ) = (k.natAbs : ℝ) := by simpa only [Int.cast_mul, Int.cast_natCast] using congrArg (fun z : ℤ => (z : ℝ)) (Int.mul_sign_self k) push_cast field_simp nlinarith only [congrArg (fun x : ℝ => (u : ℝ)*x) he] end Bounty end section /- One character family works at every Mellin frequency, so the exact rational expansion can be integrated without changing its coefficients. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Exact finite dyadic decomposition of the original auxiliary multiplier. -/ open Finset open scoped Classical namespace Bounty theorem finite_dyadic_test_norm_le_one {X : Type*} (π : X → ℕ) (f : X → ℂ) (hf : ∀ x, ‖f x‖ ≤ 1) (j : ℕ) (x : X) : ‖finiteDyadicTest π j f x‖ ≤ 1 := by unfold finiteDyadicTest split_ifs · exact hf x · simp theorem finite_dyadic_card_le_three_mul {X : Type*} [Fintype X] (π : X → ℕ) (hπ : ∀ x, 0 < π x) {L : ℝ} (hL : 1 ≤ L) (hlog : ∀ x, Real.log (π x) ≤ L) : ((finiteDyadicIndices π).card : ℝ) ≤ 3*L := by have hb := finite_dyadic_indices_card_le π hπ (zero_le_one.trans hL) hlog have hhalf : (1/2 : ℝ) ≤ Real.log 2 := by linarith [Real.log_two_gt_d9] have hdiv : L/Real.log 2 ≤ 2*L := by apply (div_le_iff₀ (Real.log_pos (by norm_num : (1 : ℝ)<2))).mpr nlinarith linarith section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) include G sharedInstance1 sharedInstance2 J ell P V A B hU hAB k bA bB theorem physical_aux_fourier_dyadic_sum (θ : ℝ) : (∑ i ∈ finiteDyadicIndices (fun a : (∀ i : A, P i.val.1) => ∏ j, (a j).val), ∑ j ∈ finiteDyadicIndices (fun b : (∀ i : B, P i.val.1) => ∏ j, (b j).val), physicalAuxFourierMultiplier P V A B hU hAB k (finiteDyadicTest (fun a => ∏ j, (a j).val) i bA) (finiteDyadicTest (fun b => ∏ j, (b j).val) j bB) θ) = physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ := by simp_rw [physical_aux_fourier_split] exact finite_dyadic_pairing_sum _ _ _ _ _ _ _ theorem physical_aux_fourier_zero_left (hA : ∀ a, bA a = 0) (θ : ℝ) : physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ = 0 := by simp only [physicalAuxFourierMultiplier, hA, mul_zero, zero_mul, sum_const_zero] theorem physical_aux_fourier_zero_right (hB : ∀ b, bB b = 0) (θ : ℝ) : physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ = 0 := by simp only [physicalAuxFourierMultiplier, hB, mul_zero, zero_mul, sum_const_zero] end end Bounty end section /- The Mellin phase on the original free product factors across the actual auxiliary split without changing the phase sign or either test orientation. -/ open Finset open scoped Classical namespace Bounty theorem physical_aux_mellin_multiplier_split {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (f : (∀ i : A, P i.val.1) → ℂ) (g : (∀ i : B, P i.val.1) → ℂ) (hposA : ∀ x : (∀ i : A, P i.val.1), 0 < ∏ i, (x i).val) (hposB : ∀ y : (∀ i : B, P i.val.1), 0 < ∏ i, (y i).val) (ζ θ : ℝ) : physicalAuxFourierMultiplier P V A B hU hAB k (fun x => f x*physicalPhase ζ (∏ i, (x i).val)) (fun y => g y*physicalPhase ζ (∏ i, (y i).val)) θ = ∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * (f (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * g (repeatedBigAuxSplitEquiv P A B hU hAB aux).2) * physicalPhase ζ (physicalFreeFactor (repeatedBigAuxCut A B) aux) * fourier (-(k * (physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ))) (θ : AddCircle (1 : ℝ)) := by unfold physicalAuxFourierMultiplier apply sum_congr rfl intro aux _ have he := repeatedBigAuxSplitEquiv_symm_label_prod P A B hU hAB (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 simp only [Prod.mk.eta, Equiv.symm_apply_apply] at he change physicalFreeFactor (repeatedBigAuxCut A B) aux = _ at he change _ = _ * _ * physicalPhase ζ (physicalFreeFactor (repeatedBigAuxCut A B) aux) * _ rw [he, physical_phase_mul ζ (hposA _) (hposB _)] simp only [physicalFreeFactor] at he ⊢ rw [he] ring end Bounty end section /- The actual dependent divisor-character family has a cubic denominator energy cost. -/ open Finset MeasureTheory namespace Bounty theorem rational_gcd_character_family_energy_le (r Q : ℕ) (c : (d : ℕ) → AddChar (Additive (ZMod (r/d))ˣ) ℂ → ℂ) (P : (d : ℕ) → AddChar (Additive (ZMod (r/d))ˣ) ℂ → ℝ → ℂ) (a b B : ℝ) (hB : 0 ≤ B) (hP : ∀ d ∈ r.divisors, ∀ ψ, ContinuousOn (P d ψ) (Set.Icc a b)) (henergy : ∀ d ∈ r.divisors, ∀ ψ, (∫ t in Set.Icc a b, ‖P d ψ t‖^2) ≤ B) (hmass : (∑ d ∈ r.divisors, ∑ ψ, ‖c d ψ‖) ≤ (Q : ℝ)*Real.sqrt (Q : ℝ)) : (∫ t in Set.Icc a b, ‖∑ d ∈ r.divisors, ∑ ψ, c d ψ * P d ψ t‖^2) ≤ (Q : ℝ)^3 * B := by have h := dependent_weighted_family_energy_le r.divisors c P a b B hP henergy calc _ ≤ (∑ d ∈ r.divisors, ∑ ψ, ‖c d ψ‖)^2 * B := h _ ≤ ((Q : ℝ)*Real.sqrt (Q : ℝ))^2 * B := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (by positivity) hmass 2) hB _ = _ := by rw [mul_pow, Real.sq_sqrt (Nat.cast_nonneg Q)]; ring end Bounty end section /- Polynomial cell width, mass threshold and modulus give an explicit polynomial cost. -/ open Finset open scoped Classical namespace Bounty theorem prime_cell_polynomial_cost {L B C R : ℝ} {Q : ℕ} (hL : 3 ≤ L) (hB : 0 ≤ B) (hQ : (Q : ℝ) ≤ L^R) : (L / L^(-B) + 2) * (Q * Q : ℕ) / L^(-C) ≤ L^(B+C+2*R+2) := by have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hp : 1 ≤ L^(B+1) := Real.one_le_rpow hL1 (by linarith) have he : L / L^(-B) = L^(B+1) := by calc _ = L^(1 : ℝ) / L^(-B) := by rw [Real.rpow_one] _ = _ := by rw [← Real.rpow_sub hL0]; congr 1; ring have hc : L / L^(-B) + 2 ≤ L^(B+2) := by rw [he] have he' : L^(B+2) = L^(B+1)*L := by calc _ = L^((B+1)+1) := by congr 1; ring _ = _ := by rw [Real.rpow_add hL0, Real.rpow_one] rw [he'] nlinarith have hqq : ((Q*Q : ℕ) : ℝ) ≤ L^R*L^R := by rw [Nat.cast_mul] exact mul_le_mul hQ hQ (Nat.cast_nonneg _) (Real.rpow_pos_of_pos hL0 R).le calc _ ≤ L^(B+2) * (L^R*L^R) / L^(-C) := div_le_div_of_nonneg_right (mul_le_mul hc hqq (Nat.cast_nonneg _) (Real.rpow_pos_of_pos hL0 _).le) (Real.rpow_pos_of_pos hL0 _).le _ = _ := by rw [Real.rpow_neg hL0.le, div_inv_eq_mul, ← Real.rpow_add hL0, ← Real.rpow_add hL0, ← Real.rpow_add hL0] congr 1 ring theorem prime_retained_cell_polynomial_cost {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) {Q : ℕ} {L B C R : ℝ} (hL : 3 ≤ L) (hB : 0 ≤ B) (hQ : (Q : ℝ) ≤ L^R) (hrange : ∀ x : (∀ i, P i), 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L) : (∑ d ∈ primeProductRetainedCells P V (L^(-B)) (L^(-C)), ∑ _χ : BoundedPrimitiveCharacter Q, ‖((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell (L^(-B)) (Real.log (∏ i, (z i).val : ℕ))) d : ℝ) : ℂ)‖) ≤ L^(B+C+2*R+2) := by have hL0 : 0 < L := by linarith exact (prime_retained_cell_expansion_cost P V Q (Real.rpow_pos_of_pos hL0 _) (Real.rpow_pos_of_pos hL0 _) hL0.le hrange).trans (prime_cell_polynomial_cost hL hB hQ) end Bounty end section /- Literal four-factor kernel sums and their rational additive twists. -/ open Finset namespace Bounty noncomputable def fourBoxKernelSum (D A B C : Finset ℕ) (δ α β γ H : ℕ → ℂ) : ℂ := ∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, (δ d*α a*β b*γ c)*H (d*a*b*c) noncomputable def rationalFourBoxKernelSum (r : ℕ) (k : ℤ) (D A B C : Finset ℕ) (δ α β γ H : ℕ → ℂ) : ℂ := fourBoxKernelSum D A B C δ α β γ (fun n => H n * Complex.exp (Complex.I*(2*Real.pi*((k : ℝ)/r*(n : ℝ)) : ℝ))) theorem continuous_four_box_kernel_sum (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (H : ℝ → ℕ → ℂ) (hH : ∀ n, Continuous (fun t => H t n)) : Continuous (fun t => fourBoxKernelSum D A B C δ α β γ (H t)) := by unfold fourBoxKernelSum fun_prop theorem rational_box_cubic_cost {L A R : ℝ} (hL : 0 < L) {r : ℕ} (hr : (r : ℝ) ≤ L^R) : (r : ℝ)^3*L^(-(A+3*R)) ≤ L^(-A) := by calc _ ≤ (L^R)^3*L^(-(A+3*R)) := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (Nat.cast_nonneg r) hr 3) (Real.rpow_nonneg hL.le _) _ = L^(-A) := by rw [← Real.rpow_mul_natCast hL.le, ← Real.rpow_add hL] congr 1 ring end Bounty end section /- Uniform cancellation for the extracted actual Q-zero prime window. -/ open Finset Filter namespace Bounty theorem candidate_Q_zero_product_window_eq (c L : ℝ) {a R : ℕ} (ha : a ≠ 0) : (candidateQBand (c*L) 0).filter (fun p => p*R ∈ arithmeticProductWindow a (Real.exp L)) = (primeBand (Real.exp (c*L)) (Real.exp ((6/5 : ℝ)*(c*L)))).filter (fun p : ℕ => Real.exp L < ((a*R : ℕ) : ℝ)*(p : ℝ) ∧ ((a*R : ℕ) : ℝ)*(p : ℝ) ≤ 16*Real.exp L) := by ext p simp only [candidateQBand, dyadicPrimeBand, pow_zero, div_one, one_mul, mem_filter, mem_arithmeticProductWindow_iff ha] have he : a*(p*R) = (a*R)*p := by ac_rfl rw [he, Nat.cast_mul] theorem eventually_candidate_Q_prime_cancellation (hZ : PrimitiveZeroFreeHalfPlane) {c : ℝ} (hc : 0 < c) (B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ∀ (a R : ℕ), a ≠ 0 → R ≠ 0 → ‖∑ p ∈ ((candidateQBand (c*L) 0).filter (fun p => p*R ∈ arithmeticProductWindow a (Real.exp L))).filter (fun p => p.Coprime m), χ (p : ZMod f)‖ ≤ ((16*Real.exp L) / ((a*R : ℕ) : ℝ)) * L^(-B) := by filter_upwards [eventually_prime_band_coprime_relative_power_bound hZ hc B] with L hL intro f hf hfL χ hχ m hm hmL a R ha hR rw [candidate_Q_zero_product_window_eq c L ha] exact hL f hf hfL χ hχ (Real.exp ((6/5 : ℝ)*(c*L))) ((a*R : ℕ) : ℝ) (Real.exp L) (16*Real.exp L) (Real.exp_pos _).le (Nat.cast_pos.mpr (Nat.mul_pos (Nat.pos_of_ne_zero ha) (Nat.pos_of_ne_zero hR))) (Real.exp_pos L).le (by positivity) m hm hmL theorem eventually_candidate_Q_character_cancellation (hZ : PrimitiveZeroFreeHalfPlane) {c : ℝ} (hc : 0 < c) (B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ∀ (r jStar : ℕ) (hr : 0 < r), 0 < jStar → ∀ a : ℕ, a ≠ 0 → ‖∑ n ∈ (arithmeticProductWindow a (Real.exp L)).filter (fun n => n.Coprime m), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod f)‖ ≤ ((16*Real.exp L) / (a : ℝ)) * L^(-B) * candidateQRestHarmonicMass c L r jStar hr := by filter_upwards [eventually_candidate_Q_prime_cancellation hZ hc B, eventually_ge_atTop (0 : ℝ)] with L hL hL0 intro f hf hfL χ hχ m hm hmL r jStar hr hj a ha apply candidate_Q_character_bound_of_prime_bound c L r jStar hr hj (arithmeticProductWindow a (Real.exp L)) χ m ((16*Real.exp L)/(a : ℝ)) (L^(-B)) (by positivity) (Real.rpow_nonneg hL0 _) intro y have hb := hL f hf hfL χ hχ m hm hmL a (orderedSlotProduct (candidateQRestChoices c L r jStar hr) y) ha (candidate_Q_rest_product_nonzero c L r jStar hr y) simpa only [Nat.cast_mul, div_mul_eq_div_div] using hb end Bounty end section /- Literal physical rows on marks, ledgers and bounded memory. Ghost rows and every fixed-target edge row use the original raw operators. Full-slot permutations retain their original normalized average. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) def PhysicalMarkRowEncoding (tag : Option (I ⊕ K)) (before after : Fin N → Finset (Fin J)) : Prop := match tag with | none => True | some (.inl _) => before = after | some (.inr j) => before = C j ∧ after = C j end Physical end Bounty end section /- Exact comparison between two memory caps. Every nonzero smaller-cap path is identified with a larger-cap path whose total memory never exceeds the smaller cap. Whole-path phases retain all ordered event identities. -/ open Finset Classical namespace Bounty universe uJ uK uG uP uA section variable {J : Type uJ} {K : Type uK} {G : Type uG} {P : G → Type uP} [Fintype G] [DecidableEq G] (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (A : ∀ k, SharedActiveLabels P (S k) → Type uA) (Δ D : ∀ k c, A k c → G → ℤ) {b B : ℕ} (h : b ≤ B) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] end end Bounty end section /- Uniform per-block cancellation with arbitrary real product-window cutoffs. -/ open Finset Filter namespace Bounty theorem eventually_product_window_block_power_saving {a eta theta H C : ℝ} (ha : 0 < a) (heta : 0 < eta) (htheta : theta < 1/2) (hH : 0 ≤ H) (hC : 0 ≤ C) (B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ P U R : ℝ, Real.exp (a*L) ≤ P → Real.exp (a*L) ≤ U → U ≤ 32*Real.exp L → P*U ≤ C*Real.exp L → Real.exp (eta*L) ≤ R → R ≤ Real.exp (theta*L) → ∀ (Q S T : Finset ℕ), (∀ q ∈ Q, R/2 ≤ (q : ℝ)) → (∀ q ∈ Q, (q : ℝ) ≤ R) → (∀ m ∈ S, 0 < m) → (∀ n ∈ T, 0 < n) → (∀ m ∈ S, (m : ℝ) ≤ P) → (∀ n ∈ T, (n : ℝ) ≤ U) → ∀ α β : ℕ → ℂ, (∀ m ∈ S, ‖α m‖ ≤ Real.exp (H*Real.sqrt L)) → (∀ n ∈ T, ‖β n‖ ≤ Real.exp (H*Real.sqrt L)) → ∀ A Z : ℝ, 0 ≤ A → 0 ≤ Z → (∑ q ∈ Q, 1/(q.totient : ℝ) * ∑ χ ∈ primitiveCharacters q, ‖∑ m ∈ S, ∑ n ∈ T.filter (fun n : ℕ => A < (m : ℝ)*(n : ℝ) ∧ (m : ℝ)*(n : ℝ) ≤ Z), α m * β n * χ ((m*n : ℕ) : ZMod q)‖) ≤ Real.exp L * L^(-B) := by have hdecay := eventually_large_sieve_subexponential_energy_bound ha heta htheta (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) hH) (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) hC) 3 B filter_upwards [hdecay, eventually_window_dyadic_prefix_cost, eventually_ge_atTop (0 : ℝ), eventually_ge_atTop (4*(6 + 8*Real.pi))] with L hdecayL hcostL hL hprefL intro P U R hP hU hUHi hPU hRLo hRHi Q S T hQD hQR hSpos hTpos hS hT α β hα hβ A Z hA hZ have hP0 : 0 ≤ P := (Real.exp_pos _).le.trans hP have hU0 : 0 ≤ U := (Real.exp_pos _).le.trans hU have hU1 : 1 ≤ U := (Real.one_le_exp_iff.mpr (mul_nonneg ha.le hL)).trans hU have hR1 : 1 ≤ R := (Real.one_le_exp_iff.mpr (mul_nonneg heta.le hL)).trans hRLo have hR0 : 0 < R := zero_lt_one.trans_le hR1 let K := ⌊U⌋₊.log2 + 1 obtain ⟨hprefix, hcol⟩ := finite_nat_dyadic_prefix hU1 T hT have hK : (K + 1 : ℝ) ≤ L^2 := by simpa only [K, Nat.cast_add, Nat.cast_one] using hcostL U hU1 hUHi have hEa := positive_nat_finset_exponential_energy_le S α hP0 hSpos hS hα have hEb := positive_nat_finset_exponential_energy_le T β hU0 hTpos hT hβ have hEb' : (∑ n ∈ T, ‖β n‖^2) ≤ (2*U)*Real.exp ((2*H)*Real.sqrt L) := by exact hEb.trans (mul_le_mul_of_nonneg_right (by linarith) (Real.exp_nonneg _)) have hV : Real.exp (a*L) ≤ 2*U := hU.trans (by linarith) have hPV : P*(2*U) ≤ (2*C)*Real.exp L := by nlinarith have hnumeric := hdecayL P (2*U) R (∑ m ∈ S, ‖α m‖^2) (∑ n ∈ T, ‖β n‖^2) hP hV hPV hRLo hRHi (sum_nonneg (fun _ _ => sq_nonneg _)) hEa hEb' have hwindow := multiplicative_large_sieve_product_window_real Q (show 0 < R/2 by positivity) hR1 hQD hQR hA hZ K S T hSpos hprefix α β hP0 (by positivity : 0 ≤ 2*U) hS hcol calc _ ≤ 2*(K + 1 : ℝ)*((6 + 8*Real.pi)/(R/2)) * Real.sqrt ((P + R^2)*(2*U + R^2)*(∑ m ∈ S, ‖α m‖^2)*∑ n ∈ T, ‖β n‖^2) := hwindow _ ≤ (L^3/R) * Real.sqrt ((P + R^2)*(2*U + R^2)*(∑ m ∈ S, ‖α m‖^2)*∑ n ∈ T, ‖β n‖^2) := mul_le_mul_of_nonneg_right (window_dyadic_prefactor_le K hR0 hK hprefL) (Real.sqrt_nonneg _) _ ≤ _ := by rw [show (3 : ℝ) = ((3 : ℕ) : ℝ) by norm_num, Real.rpow_natCast] at hnumeric exact hnumeric end Bounty end section /- The physical edge with every target list and auxiliary draw is one unified full-state row. Its globally extended phase is bounded everywhere. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_full_observed_permutation_row (before after : Fin N → Finset (Fin J)) (F : PhysicalMarkObservation P ell C → FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) : physicalFullObservedRow C k ω β retention ρ V before after none F s = ∑ τ : FullActiveSlotPermutations (fun _ : Fin N => J + ell), (fullActivePermutationWeight (fun _ : Fin N => J + ell) τ : ℂ) * F (.inl ((physicalTransitionPermutationEquiv before after).symm τ)) (s.1, fullActivePermutation τ s.2) := by unfold physicalFullObservedRow fullMixedObservedRow refine Eq.trans ?_ (Equiv.sum_comp (Equiv.ulift : ULift.{0} (FullActiveSlotPermutations (fun _ : Fin N => J + ell)) ≃ _) (fun τ => (fullActivePermutationWeight (fun _ : Fin N => J + ell) τ : ℂ) * F (.inl ((physicalTransitionPermutationEquiv before after).symm τ)) (s.1, fullActivePermutation τ s.2))) apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ simp only [fullMixedLedgerPhase, mul_one] rfl theorem physical_full_observed_ghost_row (before after : Fin N → Finset (Fin J)) (j : I) (F : PhysicalMarkObservation P ell C → FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) : physicalFullObservedRow C k ω β retention ρ V before after (some (.inl j)) F s = physicalFullLedgerRow C k ω β retention ρ V (some (.inl j)) (F (.inr none)) s := by unfold physicalFullObservedRow fullMixedObservedRow physicalFullLedgerRow fullMixedLedgerRow finiteLocalPhasedRow apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ rfl end Physical end Bounty end section /- Exact candidate assembly over row, column, and conductor dyads. -/ open Finset Filter namespace Bounty noncomputable def candidateRemainderCharacterVector (c L q : ℝ) (r jStar : ℕ) (hr : 0 < r) (h p n : ℕ) : (f : ℕ) → DirichletCharacter ℂ f → ℂ := by classical exact fun f χ => if Real.exp L < (p * n : ℕ) ∧ (p * n : ℕ) ≤ 16 * Real.exp L then (if p.Coprime h then (1 : ℂ) else 0) * (if n.Coprime h then (candidateRemainderCoefficient c L q r jStar hr n : ℂ) else 0) * χ ((p * n : ℕ) : ZMod f) else 0 theorem candidate_large_mass_le_dyadic_blocks {c L : ℝ} (hcL : 0 ≤ c * L) (q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : 0 < jStar) (N R : ℕ) {X H B : ℝ} (hX : 1 ≤ X) (hNX : (N : ℝ) ≤ X) (hH : 0 ≤ H) (hB : 0 ≤ B) (hcount : ∀ h ∈ (Icc 1 N).filter Squarefree, ((dyadicNatIndices (Icc (max 2 (R + 1)) (N / h))).card : ℝ) ≤ H) (hblock : ∀ h ∈ (Icc 1 N).filter Squarefree, ∀ k ∈ dyadicNatIndices (Icc (max 2 (R + 1)) (N / h)), ∀ i ∈ dyadicNatIndices (candidateQBand (c * L) 0), ∀ j ∈ dyadicNatIndices (Icc 1 ⌊16 * Real.exp L⌋₊), primitiveCharacterBlockNorm (dyadicNatBucket (Icc (max 2 (R + 1)) (N / h)) k) (∑ p ∈ dyadicNatBucket (candidateQBand (c * L) 0) i, ∑ n ∈ dyadicNatBucket (Icc 1 ⌊16 * Real.exp L⌋₊) j, candidateRemainderCharacterVector c L q r jStar hr h p n) ≤ B) : candidateLargePrimitiveTypeIMass c L q r jStar N R ≤ ((2 * primeEulerProductUpperConstant) * Real.log (2 * X)) * H * (dyadicNatIndices (candidateQBand (c * L) 0)).card * (dyadicNatIndices (Icc 1 ⌊16 * Real.exp L⌋₊)).card * B := by classical let CS : ℝ := (dyadicNatIndices (candidateQBand (c * L) 0)).card let CT : ℝ := (dyadicNatIndices (Icc 1 ⌊16 * Real.exp L⌋₊)).card have hY : 0 ≤ H * CS * CT * B := by dsimp [CS, CT]; positivity have hbound : ∀ h ∈ (Icc 1 N).filter Squarefree, (∑ f ∈ Icc (max 2 (R + 1)) (N / h), complementaryConductorNormTerm f h (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u) / (f.totient : ℝ)) ≤ H * CS * CT * B := by intro h hh let Q := Icc (max 2 (R + 1)) (N / h) let F := candidateRemainderCharacterVector c L q r jStar hr h have hcomp := complementary_conductor_sum_le_character_blockNorm Q h (arithmeticProductWindow 1 (Real.exp L)) (fun u => (candidateCoefficient c L q r jStar u : ℂ)) (fun u => u) (∑ p ∈ candidateQBand (c * L) 0, ∑ n ∈ Icc 1 ⌊16 * Real.exp L⌋₊, F p n) (by intro f hf χ simpa only [Finset.sum_apply, F, candidateRemainderCharacterVector] using candidate_prime_remainder_character_positive_cutoff hcL q r jStar hr hj χ h) have hdyad := primitiveCharacterBlockNorm_le_dyadic_blocks Q (candidateQBand (c * L) 0) (Icc 1 ⌊16 * Real.exp L⌋₊) F (hblock h hh) apply hcomp.trans (hdyad.trans _) change ((dyadicNatIndices Q).card : ℝ) * CS * CT * B ≤ H * CS * CT * B exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (hcount h hh) (by dsimp [CS]; positivity)) (by dsimp [CT]; positivity)) hB have h := candidate_large_mass_le_uniform_complementary c L q r jStar N R hX hNX hY hbound convert h using 1 dsimp [CS, CT] ring end Bounty end section /- The active phase depends only on the shared, target, and source tuples. -/ open Finset open scoped Classical namespace Bounty theorem finite_active_value_three_partition {I M : Type*} [DecidableEq I] [CommMonoid M] (v : I → M) (active A B : Finset I) (hA : A ⊆ active) (hB : B ⊆ active) (hAB : Disjoint A B) : (∏ i ∈ active, v i) = (∏ i : ↥(active \ (A ∪ B)), v i.1) * (∏ i : A, v i.1) * ∏ i : B, v i.1 := by rw [prod_coe_sort (active \ (A ∪ B)) v, prod_coe_sort A v, prod_coe_sort B v, ← prod_sdiff (union_subset hA hB), prod_union hAB, mul_assoc] theorem finite_active_product_restrict {I M : Type*} [DecidableEq I] [CommMonoid M] {X : I → Type*} (v : ∀ i, X i → M) (active A B : Finset I) (hA : A ⊆ active) (hB : B ⊆ active) (hAB : Disjoint A B) (x : ∀ i, X i) : (∏ i ∈ active, v i (x i)) = (∏ i : ↥(active \ (A ∪ B)), v i.1 (finiteCoordinateRestrict (active \ (A ∪ B)) x i)) * (∏ i : A, v i.1 (finiteCoordinateRestrict A x i)) * ∏ i : B, v i.1 (finiteCoordinateRestrict B x i) := finite_active_value_three_partition (fun i => v i (x i)) active A B hA hB hAB theorem prime_active_phase_three_partition {I : Type*} [DecidableEq I] (P : I → Finset ℕ) (active A B : Finset I) (hA : A ⊆ active) (hB : B ⊆ active) (hAB : Disjoint A B) (ζ Θ : ℝ) (x : ∀ i, P i) : primeActivePhase P active ζ Θ x = primeTuplePhase ζ Θ ((∏ i : ↥(active \ (A ∪ B)), (finiteCoordinateRestrict (active \ (A ∪ B)) x i).val) * (∏ i : A, (finiteCoordinateRestrict A x i).val) * ∏ i : B, (finiteCoordinateRestrict B x i).val) := by unfold primeActivePhase congr 1 exact finite_active_product_restrict (fun _ p => p.val) active A B hA hB hAB x end Bounty end section /- Bounded physical memory decodes to the original joint raw state. The local zero extension is invisible behind the existing total output cutoff. -/ open Finset open scoped Classical namespace Bounty def physicalMarkRawReadout {N J ell B : ℕ} {P : Fin N → Finset ℕ} (s : PhysicalBoundedMarkState P J ell B) : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) := fun g => (s.2.1 g, boundedOrderedTupleToFinite (s.2.2 g)) theorem global_birth_joint_local_length_le_total {N : ℕ} {P : Fin N → Type*} {R : (g : Fin N) → P g → Type*} (s : GlobalBirthJointState R) (g : Fin N) : (s g).2.1 ≤ globalBirthJointLength s := Finset.single_le_sum (fun i _ => Nat.zero_le (s i).2.1) (Finset.mem_univ g) section variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (R : PhysicalMarkLists P J ell) include N J ell B P R theorem physical_mark_raw_extension_readout (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (s : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) (hs : ∀ g, (s g).2.1 ≤ B) : physicalMarkRawExtension (B := B) (F ∘ physicalMarkRawReadout) R s = F s := by unfold physicalMarkRawExtension rw [dif_pos hs] rfl theorem physical_mark_raw_readout_cutoff (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) : globalBirthJointRawCutoff B (physicalMarkRawExtension (B := B) (F ∘ physicalMarkRawReadout) R) = globalBirthJointRawCutoff B F := by funext s unfold globalBirthJointRawCutoff by_cases hs : globalBirthJointLength s ≤ B · rw [if_pos hs, if_pos hs, physical_mark_raw_extension_readout] exact fun g => (global_birth_joint_local_length_le_total s g).trans hs · rw [if_neg hs, if_neg hs] theorem physical_mark_raw_tensor_readout (row : (g : Fin N) → (GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val) → ℂ) → GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val) → ℂ) (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) : jointRawTensorCutoff B row (physicalMarkRawExtension (B := B) (F ∘ physicalMarkRawReadout) R) = jointRawTensorCutoff B row F := by unfold jointRawTensorCutoff rw [physical_mark_raw_readout_cutoff] end end Bounty end section /- The exact density of a simultaneous base congruence and local pair-sieve events. -/ open Finset namespace Bounty theorem actual_pair_sieve_residue_density (m : ℕ) [NeZero m] (P : Finset ℕ) (rough banned : ℕ → Bool) (hP : ∀ p ∈ P, p.Prime) (hPm : ∀ p ∈ P, ¬p ∣ m) : ((natPairSieveResidues m (natPairBaseResidues m) P (fun p => natPairBadResidues p (rough p) (banned p))).card : ℝ) / ((m : ℝ) * ∏ p ∈ P, (p : ℝ))^2 = ((m.totient : ℝ)/(m : ℝ)^2) * ∏ p ∈ P, pairSieveDensity p (rough p) (banned p) := by have hprod : (∏ p ∈ P, (natPairBadResidues p (rough p) (banned p)).card : ℝ) / (∏ p ∈ P, (p : ℝ))^2 = ∏ p ∈ P, pairSieveDensity p (rough p) (banned p) := by rw [← prod_pow, ← prod_div_distrib] apply prod_congr rfl intro p hp exact @nat_pair_bad_residue_density p ⟨hP p hp⟩ (rough p) (banned p) rw [actual_pair_sieve_residue_card m P rough banned hP hPm, Nat.cast_mul, Nat.cast_prod, mul_pow, mul_div_mul_comm, hprod] theorem nat_pair_base_mod_iff (m : ℕ) (hm : 0 < m) (x y : ℕ) : (x % m, y % m) ∈ natPairBaseResidues m ↔ (x*y) % m = 1 % m := by simp only [natPairBaseResidues, mem_filter, Finset.product_eq_sprod, mem_product, mem_range, Nat.mod_lt _ hm, and_self, true_and, ← Nat.mul_mod] theorem nat_pair_bad_mod_iff (p : ℕ) (hp : 0 < p) (rough banned : Bool) (x y : ℕ) : (x % p, y % p) ∈ natPairBadResidues p rough banned ↔ (rough = true ∧ (x*y) % p = 0) ∨ (banned = true ∧ (x*y) % p = 1 % p) := by simp only [natPairBadResidues, mem_filter, Finset.product_eq_sprod, mem_product, mem_range, Nat.mod_lt _ hp, and_self, true_and, ← Nat.mul_mod] end Bounty end section /- The mask-averaged Euler correction is bounded by the actual marked harmonic mass. -/ open Filter Finset open scoped Topology namespace Bounty theorem one_marked_groups_euler_lower {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (hdisj : (groups : Set G).PairwiseDisjoint P) (hP : ∀ g ∈ groups, ∀ p ∈ P g, p.Prime) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (mass : G → ℝ) (hpos : ∀ g ∈ groups, 0 < mass g) (hmass : ∀ g ∈ groups, (∑ p ∈ P g, 1/(p : ℝ)) = mass g) : (∏ p ∈ groups.biUnion P, (1 + q/((p : ℝ)-1))) ≤ ∑' n : Nat.factoredNumbers (groups.biUnion P), oneMarkedGroupTerm groups P q mass n.val := by rw [(one_marked_groups_summable_and_sum groups P hdisj hP q mass).2, prod_biUnion hdisj] apply Finset.prod_le_prod₀ · intro g hg apply prod_nonneg intro p hp have hpR : (1 : ℝ) < p := Nat.one_lt_cast.mpr (hP g hg p hp).one_lt positivity · intro g hg rw [one_marked_harmonic_mass_eq_normalized] exact normalized_one_marked_harmonic_lower (P g) (hP g hg) hq0 hq1 (hpos g hg) (hmass g hg) theorem eventually_candidate_unmarked_euler_lower {c q : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) : ∀ᶠ L : ℝ in atTop, (∏ p ∈ (candidatePIndices c L).biUnion (candidatePBand (c*L)), (1 + q/((p : ℝ)-1))) ≤ candidateOneMarkedHarmonicMass c L q := by obtain ⟨v, V, hv, _, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool] with L hp rcases hp with ⟨_, _, _, _, hpair, hdata⟩ exact one_marked_groups_euler_lower (candidatePIndices c L) (candidatePBand (c*L)) (fun i _ j _ hij => hpair hij) (fun j hj p hp => ((hdata j hj).2.2 p hp).1) hq0 hq1 _ (fun j hj => hv.trans_le (hdata j hj).1) (fun _ _ => rfl) theorem eventually_candidate_mask_inverse_bound {c q : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) : ∀ᶠ L : ℝ in atTop, ∀ P : Finset ℕ, P ⊆ (candidatePIndices c L).biUnion (candidatePBand (c*L)) → (∑ S ∈ P.powerset, bernoulliSubsetWeight q P S * ∏ p ∈ S, (1 - 1/(p : ℝ))⁻¹) ≤ candidateOneMarkedHarmonicMass c L q := by obtain ⟨v, V, hv, _, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool, eventually_candidate_unmarked_euler_lower hc hq0 hq1] with L hp he rcases hp with ⟨_, _, _, _, _, hdata⟩ have hprime : ∀ p ∈ (candidatePIndices c L).biUnion (candidatePBand (c*L)), p.Prime := by intro p hp obtain ⟨j, hj, hpj⟩ := mem_biUnion.mp hp exact ((hdata j hj).2.2 p hpj).1 intro P hP rw [bernoulli_mask_inverse_avoidance P q (fun p hp => (hprime p (hP hp)).two_le)] apply le_trans _ he apply prod_le_prod_of_subset_of_one_le₀ hP · intro p hp have hpR : (1 : ℝ) < p := Nat.one_lt_cast.mpr (hprime p (hP hp)).one_lt positivity · intro p hp _ have hpR : (1 : ℝ) < p := Nat.one_lt_cast.mpr (hprime p hp).one_lt exact le_add_of_nonneg_right (div_nonneg hq0 (by linarith)) end Bounty end section /- The full physical record determines the mark list, ledger and pending memory. -/ namespace Bounty theorem physical_full_memory_state_injective {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) : Function.Injective (fun s : PhysicalMarkLists P J ell × ((g : G) → BoundedOrderedTuple (Z g) B) => physicalFullMemoryState C s.1 s.2) := by intro s t h apply (physicalFullStateEquiv C).injective exact Subtype.ext h section Bounded variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) theorem physical_bounded_mark_encode_injective : Function.Injective (physicalBoundedMarkEncode (P := P) (ell := ell) (B := B) C) := by intro s t h have hm : (s.1, s.2.2) = (t.1, t.2.2) := physical_full_memory_state_injective C (congrArg Prod.snd h) have hmarks := congrArg Prod.fst hm have hmemory := congrArg Prod.snd hm have hledger := congrArg Prod.fst h exact Prod.ext hmarks (Prod.ext hledger hmemory) end Bounded end Bounty end section /- Full Euler-product control for the actual masked pair-sieve prime sets. -/ open Finset namespace Bounty theorem masked_pair_euler_bound (m : ℕ) (hm : m ≠ 0) (W z : ℝ) (hW : 0 ≤ W) (hWz : W ≤ z) (A : Finset ℕ) (hA : ∀ p ∈ A, 2 ≤ p) : (∏ p ∈ maskedPairRoughPrimes m W z, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ maskedPairBannedPrimes m z A, (1 - 1/(p : ℝ))) ≤ 8 * (∏ p ∈ primeBand 0 W, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) * (∏ p ∈ m.primeFactors, (1 - 1/(p : ℝ))⁻¹)^3 * (∏ p ∈ A, (1 - 1/(p : ℝ))⁻¹) := by have hz := hW.trans hWz have hR := masked_pair_rough_omission m hm W z hW hWz have hB := masked_pair_banned_omission m hm z hz A hA have hR0 : 0 ≤ ∏ p ∈ maskedPairRoughPrimes m W z, (1 - 1/(p : ℝ)) := by apply prod_nonneg intro p hp exact (avoidance_factor_bounds ((mem_masked_pair_primes hz).mp (mem_filter.mp hp).1).1.two_le).1.le have hB0 : 0 ≤ ∏ p ∈ maskedPairBannedPrimes m z A, (1 - 1/(p : ℝ)) := by apply prod_nonneg intro p hp exact (avoidance_factor_bounds ((mem_masked_pair_primes hz).mp (mem_sdiff.mp hp).1).1.two_le).1.le have h := mul_le_mul (pow_le_pow_left₀ hR0 hR 2) hB hB0 (sq_nonneg _) exact h.trans_eq (by ring) theorem masked_pair_euler_uniform_bound {L : ℝ} (hL : 1 ≤ L) (m : ℕ) (hm : m ≠ 0) (hmL : (m : ℝ) ≤ Real.exp L) (hmin : ∀ p ∈ m.primeFactors, L^2 ≤ (p : ℝ)) (W z : ℝ) (hW : 0 ≤ W) (hWz : W ≤ z) (A : Finset ℕ) (hA : ∀ p ∈ A, 2 ≤ p) : (∏ p ∈ maskedPairRoughPrimes m W z, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ maskedPairBannedPrimes m z A, (1 - 1/(p : ℝ))) ≤ (8 * Real.exp 12) * (∏ p ∈ primeBand 0 W, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) * (∏ p ∈ A, (1 - 1/(p : ℝ))⁻¹) := by have hz := hW.trans hWz have hV : 0 ≤ ∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ)) := prod_nonneg (fun p hp => (avoidance_factor_bounds ((mem_primeBand_iff le_rfl hz p).mp hp).1.two_le).1.le) have hI : 0 ≤ ∏ p ∈ A, (1 - 1/(p : ℝ))⁻¹ := prod_nonneg (fun p hp => inv_nonneg.mpr (avoidance_factor_bounds (hA p hp)).1.le) have hb := masked_pair_euler_bound m hm W z hW hWz A hA have hc := mul_le_mul_of_nonneg_left (large_prime_modulus_inverse_cube_bound hL m hm hmL hmin) (show 0 ≤ 8 * (∏ p ∈ primeBand 0 W, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) * (∏ p ∈ A, (1 - 1/(p : ℝ))⁻¹) by positivity) apply hb.trans convert hc using 1 <;> ring end Bounty end section /- Exact signed pairing transport for the concrete physical prime rows. -/ open Finset open scoped Classical namespace Bounty noncomputable def repeatedBigPrimeRow {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (ζ Θ : ℝ) (source target : RepeatedBigLists P J ell) : ℂ := ∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), repeatedBigUnbannedKernel V (fun _ _ => 1) (repeatedBigAuxCut A B) ζ (repeatedBigPrimeCoefficient P V A B hU hAB Q h (keptA A) (keptB B)) aux source target * physicalReturnPhase Θ (repeatedBigD (repeatedBigAuxCut A B) source aux) theorem repeated_big_prime_pairing_eq {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (ζ Θ : ℝ) (f g : RepeatedBigLists P J ell → ℂ) : cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeRow P V A B hU hAB Q h keptA keptB ζ Θ) f g = cleanKernelPairing (finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1)) (primeAsymmetricComparisonKernel (fun i : RepeatedBigFlatIndex G J ell => P i.1) (fun i => V i.1) (repeatedBigFlatActive J ell) Q h keptA keptB ζ Θ A B) (fun x => f ((repeatedBigFlatEquiv P J ell).symm x)) (fun x => g ((repeatedBigFlatEquiv P J ell).symm x)) := by rw [← repeated_big_clean_kernel_pairing_flat] congr 1 funext x y exact (repeated_big_prime_unbanned_kernel_eq P V A B hU hAB Q h keptA keptB ζ Θ ((repeatedBigFlatEquiv P J ell).symm x) ((repeatedBigFlatEquiv P J ell).symm y)).trans (by simp only [Equiv.apply_symm_apply]) end Bounty end section /- Prime-factor support of every actual microscopic assignment product. -/ open Finset Filter open scoped Topology namespace Bounty theorem eventually_candidate_micro_assignment_primeFactors_range {c δ : ℝ} (hc : 0 < c) (hsmall : (6/5 : ℝ)*c ≤ δ) : ∀ᶠ L : ℝ in atTop, ∀ r jStar J : ℕ, ∀ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, ∀ p ∈ (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x).primeFactors, L^20 < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp (δ*L) := by have hδ : 0 < δ := (by positivity : 0 < (6/5 : ℝ)*c).trans_le hsmall filter_upwards [eventually_candidateQIndices_geometry hc, eventually_candidate_P_pool_prime_range hc hδ, eventually_rpow_le_exp_sqrt 20, eventually_gt_atTop (0 : ℝ)] with L hQ hP hrough hL have hr : L^20 ≤ Real.exp (Real.sqrt L) := by change L ^ ((20 : ℕ) : ℝ) ≤ _ at hrough rw [Real.rpow_natCast] at hrough exact hrough have hregular : ∀ j ∈ candidateQIndices c L, L^20 ≤ Real.exp (c*L/(2 : ℝ)^j) := by intro j hj have hpow : L^20 = Real.exp (20*Real.log L) := by rw [mul_comm, Real.exp_mul, Real.exp_log hL] norm_num rw [hpow] exact Real.exp_le_exp.mpr (hQ.2 j hj).1 intro r jStar J x refine ordered_slot_product_primeFactors_inherit (candidateMicroAssignmentChoices c L r jStar J) ?_ (fun p => L^20 < (p : ℝ) ∧ (p : ℝ) ≤ Real.exp (δ*L)) ?_ x · intro i n hn cases i with | inl slot => exact candidate_Q_slot_nonzero c L r jStar (⟨slot.1.val, (mem_filter.mp slot.1.property).1⟩, slot.2) hn | inr g => exact (mem_filter.mp hn).2.ne_zero · intro i n hn p hp cases i with | inl slot => exact candidate_Q_slot_primeFactors_range (mul_nonneg hc.le hL.le) hr (mul_le_mul_of_nonneg_right hsmall hL.le) hregular (⟨slot.1.val, (mem_filter.mp slot.1.property).1⟩, slot.2) hn p hp | inr g => have hnprime : n.Prime := (mem_filter.mp hn).2 have hpn : p = n := ((Nat.dvd_prime hnprime).mp (Nat.dvd_of_mem_primeFactors hp)).resolve_left (Nat.mem_primeFactors.mp hp).1.ne_one subst p exact hP n (mem_biUnion.mpr ⟨g.val, g.property, hn⟩) end Bounty end section /- The explicit raw physical pattern has no freed first-block slots and coefficient one. Its exact pairing is the diagonal prime phase on tail averages. -/ open Finset open scoped Classical namespace Bounty def repeatedBigPrimeTailSlots (J ell : ℕ) : Finset (PhysicalSlots J ell) := univ.map Function.Embedding.inr section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] include G sharedInstance1 sharedInstance2 theorem repeatedBigPrimeTailSlots_compl (J ell : ℕ) : (repeatedBigFlatActive (G := G) J ell)ᶜ = univ.sigma (fun _ : G => repeatedBigPrimeTailSlots J ell) := by ext ⟨g, j | j⟩ <;> simp [repeatedBigFlatActive, repeatedBigPrimeTailSlots] theorem repeatedBigFlatShared_empty (J ell : ℕ) : repeatedBigFlatShared (G := G) (ell := ell) (fun _ => (∅ : Finset (Fin J))) = repeatedBigFlatActive J ell := by ext ⟨g, j | j⟩ <;> simp [repeatedBigFlatShared, repeatedBigFlatActive, physicalSharedSlots] theorem repeated_big_prime_raw_D {P : G → Finset ℕ} {J ell : ℕ} (source : RepeatedBigLists P J ell) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) : repeatedBigD (fun _ => ∅) source aux = ∏ i ∈ repeatedBigFlatActive J ell, (repeatedBigFlatEquiv P J ell source i).val := by have hs := repeated_big_shared_label_product_flat (fun _ : G => (∅ : Finset (Fin J))) source rw [repeatedBigFlatShared_empty] at hs calc _ = ∏ i : repeatedBigFlatActive J ell, (repeatedBigFlatEquiv P J ell source i.val).val := by simpa [repeatedBigD] using hs _ = _ := prod_coe_sort (repeatedBigFlatActive J ell) (fun i => (repeatedBigFlatEquiv P J ell source i).val) theorem repeated_big_prime_raw_kernel_eq (P : G → Finset ℕ) {J ell : ℕ} (V : G → ℝ) (ζ Θ : ℝ) (source target : RepeatedBigLists P J ell) : (∑ aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J))), repeatedBigUnbannedKernel V (fun _ _ => 1) (fun _ => ∅) ζ (fun _ _ _ => 1) aux source target * physicalReturnPhase Θ (repeatedBigD (fun _ => ∅) source aux)) = if finiteSharedCompatible (repeatedBigFlatActive J ell) (repeatedBigFlatEquiv P J ell source) (repeatedBigFlatEquiv P J ell target) then (finiteFreshMass (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1) (repeatedBigFlatActive J ell) (repeatedBigFlatEquiv P J ell target) : ℂ) * primeActivePhase (fun i : RepeatedBigFlatIndex G J ell => P i.1) (repeatedBigFlatActive J ell) ζ Θ (repeatedBigFlatEquiv P J ell source) else 0 := by have hc := repeated_big_shared_compatible_flat (fun _ : G => (∅ : Finset (Fin J))) source target rw [repeatedBigFlatShared_empty] at hc simp only [repeatedBigUnbannedKernel, hc, physicalAuxMass, mul_one, repeated_big_prime_raw_D, repeated_big_target_mass_flat, repeatedBigFlatShared_empty] split_ifs · simp only [primeActivePhase, primeTuplePhase, mul_assoc] simp · simp end theorem prime_raw_fresh_pairing_tail_average {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (hmass : ∀ i, ∑ v : P i, physicalLabelLaw V i v = 1) (active : Finset I) (hμ : ∀ i ∈ active, ∀ v : P i, physicalLabelLaw V i v ≠ 0) (ζ Θ : ℝ) (f g : (∀ i, P i) → ℂ) : cleanKernelPairing (finiteProductWeight (physicalLabelLaw V)) (fun x y => if finiteSharedCompatible active x y then (finiteFreshMass (physicalLabelLaw V) active y : ℂ) * primeActivePhase P active ζ Θ x else 0) f g = cleanRawPairing (finiteProductWeight (physicalLabelLaw V)) (primeActivePhase P active ζ Θ) (finiteCoordinateComponent (physicalLabelLaw V) ∅ activeᶜ.toList f) (finiteCoordinateComponent (physicalLabelLaw V) ∅ activeᶜ.toList g) := by let F := fun (A B : Finset I) (c : ∀ i : ↥(active \ (A ∪ B)), P i.val) (_ : ∀ i : A, P i.val) (_ : ∀ i : B, P i.val) => primeTuplePhase ζ Θ (∏ i : ↥(active \ (A ∪ B)), (c i).val) have hK : finiteAsymmetricComparisonKernel (physicalLabelLaw V) active F ∅ ∅ = fun x y => if finiteSharedCompatible active x y then (finiteFreshMass (physicalLabelLaw V) active y : ℂ) * primeActivePhase P active ζ Θ x else 0 := by funext x y unfold finiteAsymmetricComparisonKernel finiteAsymmetricKernel F simp only [finiteCoordinateRestrict, primeActivePhase] have hp := prod_coe_sort (active \ ((∅ : Finset I) ∪ ∅)) (fun i => (x i).val) rw [hp] simp only [union_self, sdiff_empty] have hp := finite_asymmetric_comparison_pairing_tail_projection (physicalLabelLaw V) hmass active ∅ ∅ (empty_subset _) (empty_subset _) (by simpa only [union_self, sdiff_empty] using hμ) F f g rw [hK] at hp exact hp.trans (finite_shared_raw_pairing_tail_average (physicalLabelLaw V) hmass active (primeActivePhase P active ζ Θ) f g) theorem repeated_big_prime_raw_pairing {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) {J ell : ℕ} (V : G → ℝ) (hmass : ∀ g, ∑ v : P g, physicalLabelLaw V g v = 1) (hμ : ∀ g (v : P g), physicalLabelLaw V g v ≠ 0) (ζ Θ : ℝ) (f g : RepeatedBigLists P J ell → ℂ) : cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (fun source target => ∑ aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J))), repeatedBigUnbannedKernel V (fun _ _ => 1) (fun _ => ∅) ζ (fun _ _ _ => 1) aux source target * physicalReturnPhase Θ (repeatedBigD (fun _ => ∅) source aux)) f g = cleanRawPairing (finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1)) (primeActivePhase (fun i : RepeatedBigFlatIndex G J ell => P i.1) (repeatedBigFlatActive J ell) ζ Θ) (finiteGroupedTailTest (physicalLabelLaw V) (fun _ => repeatedBigPrimeTailSlots J ell) f) (finiteGroupedTailTest (physicalLabelLaw V) (fun _ => repeatedBigPrimeTailSlots J ell) g) := by rw [clean_kernel_pairing_equiv (repeatedBigFlatEquiv P J ell)] simp only [repeated_big_prime_raw_kernel_eq, repeated_big_active_mass_flat, Equiv.apply_symm_apply] have hp := prime_raw_fresh_pairing_tail_average (fun i : RepeatedBigFlatIndex G J ell => P i.1) (fun i => V i.1) (fun i => hmass i.1) (repeatedBigFlatActive J ell) (fun i _ v => hμ i.1 v) ζ Θ (finiteGroupFlattenFunction f) (finiteGroupFlattenFunction g) rw [repeatedBigPrimeTailSlots_compl] at hp exact hp end Bounty end section /- Exact group-tagged ledger increments are the performed original birth slots. -/ open Finset open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) noncomputable def fullMixedLedgerGroupImage (s : FullMixedLedgerState n (M := M) B) (g : Fin N) : Finset ((h : Fin N) × P h) := (s.1 g).image (Sigma.mk g) theorem full_mixed_ledger_group_image_update (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (tag : Option (J ⊕ K)) (s : FullMixedLedgerState n (M := M) B) (e : FullPermutationMixedEvent n S B A Δ D tag s.2) (hs : FullMixedLedgerCovers n B s) (hw : fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V tag s.2 e ≠ 0) (g : Fin N) : fullMixedLedgerGroupImage n B (fullMixedLedgerTarget n S B A Δ D tag s e) g = fullMixedLedgerGroupImage n B s g ∪ fullMixedEventGroupBirthImage n S B A Δ D tag s.2 e g := by cases tag with | none => simp only [fullMixedLedgerGroupImage, fullMixedLedgerTarget, finiteLedgerEventTarget, fullMixedLedgerUpdate, fullMixedEventGroupBirthImage, fullMixedBirthCapacity] simp | some tag => cases tag with | inl j => rw [full_mixed_ghost_group_birth_image] change (s.1 g ∪ univ.image (fun i => ((e.down g).2.2 i).1)).image (Sigma.mk g) = _ rw [image_union, image_image] ext z simp only [fullMixedLedgerGroupImage, mem_union, mem_image, Function.comp_apply] | inr k => rw [full_mixed_edge_group_birth_image] have hl := full_edge_ledger_local_weight_ne_zero n (S k) B (A k) (Δ k) (D k) (ω k) μ ρ V s.2 e hw g have hu := bounded_edge_ledger_union_of_nonzero (n g) (Δ k (productActiveMemorySplit (S k) B s.2).1 e.1 g) (D k (productActiveMemorySplit (S k) B s.2).1 e.1 g) (S k g)ᶜ.card B (s.1 g) (μ g) ρ (V g) ((productActiveMemorySplit (S k) B s.2).2 g) (e.2 g) (hs g).2 hl unfold fullMixedLedgerGroupImage change (fullEdgeLedgerUpdate n (S k) B (A k) (Δ k) (D k) s.1 s.2 e g).image (Sigma.mk g) = _ unfold fullEdgeLedgerUpdate fullActiveEdgeEventTarget simp only [Equiv.apply_symm_apply] change (s.1 g ∪ univ.image (unrestrictedBoundedEventTarget (n g) (Δ k (productActiveMemorySplit (S k) B s.2).1 e.1 g) (D k (productActiveMemorySplit (S k) B s.2).1 e.1 g) (S k g)ᶜ.card B ((productActiveMemorySplit (S k) B s.2).2 g) (e.2 g)).1).image (Sigma.mk g) = _ rw [hu, image_union, image_image] ext z simp only [ mem_union, mem_image, Function.comp_apply] end Full end Bounty end section /- The actual coefficient is bounded by its fully normalized microscopic assignments. -/ open Finset Filter open scoped Topology namespace Bounty noncomputable def candidateMicroAssignmentMajorant (c L q : ℝ) (r jStar J : ℕ) (z : ℝ) (u : ℕ) : ℝ := ∑ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, primeAssignmentTerm ((candidatePIndices c L).biUnion (candidatePBand (c*L))) q z (candidateMicroAssignmentNormalization c L r J) u (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x) theorem candidate_coefficient_le_micro_assignment {c L q z : ℝ} (hcL : 0 ≤ c*L) (hq : 0 ≤ q) (hpool : ∀ p ∈ (candidatePIndices c L).biUnion (candidatePBand (c*L)), (p : ℝ) ≤ Real.exp (Real.sqrt L)) (r jStar J : ℕ) (hJ : J ≤ jStar) (hz : ∀ j ∈ candidateMacroQIndices c L J, ∀ p ∈ candidateQBand (c*L) j, z < (p : ℝ)) (u : ℕ) : candidateCoefficient c L q r jStar u ≤ candidateMicroAssignmentMajorant c L q r jStar J z u := by classical let P : candidatePIndices c L → Finset ℕ := fun g => candidatePBand (c*L) g.val have hprime : ∀ g p, p ∈ P g → p.Prime := fun _ _ hp => (mem_filter.mp hp).2 have hdisj : Pairwise (fun g h => Disjoint (P g) (P h)) := by intro g h hne exact pairwise_disjoint_dyadicPrimeBand hcL (by norm_num) (by norm_num) (fun he => hne (Subtype.ext he)) have hUnion : univ.biUnion P = (candidatePIndices c L).biUnion (candidatePBand (c*L)) := by ext p simp [P] have hW : 0 ≤ markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p : ℝ)) (fun _ => 1) (u : ℤ) := marked_divisor_weight_nonneg _ _ hq _ _ (fun _ _ => sum_nonneg (fun _ _ => by positivity)) _ unfold candidateCoefficient refine (mul_le_mul_of_nonneg_right (candidate_Q_free_weight_le_micro_majorant hcL r jStar J hJ hz _ u) hW).trans ?_ rw [one_marked_weight_unmarked_sum _ _ q _ hdisj u] unfold candidateMicroQFreeMajorant candidateMicroAssignmentMajorant rw [candidateMicroAssignmentChoices, ordered_slot_sum_test_sum, sum_mul] simp_rw [mul_sum] apply sum_le_sum intro x _ apply sum_le_sum intro y _ have hfree : Disjoint (orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) x).primeFactors (univ.biUnion P) := by rw [hUnion] exact candidate_micro_Q_product_free hcL hpool r jStar J x have h := free_mark_assignment_term P hprime hdisj y (candidate_micro_Q_product_pos c L r jStar J x).ne' hfree hq (by positivity : 0 ≤ (r.factorial : ℝ)^(candidateMicroQIndices c L J).card) (show 0 ≤ ∏ g ∈ candidatePIndices c L, ∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ) from prod_nonneg (fun _ _ => sum_nonneg (fun _ _ => by positivity))) z u rw [hUnion] at h by_cases hd : orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) x ∣ u ∧ ∀ p : ℕ, p.Prime → (p : ℝ) ≤ z → p ∉ (candidatePIndices c L).biUnion (candidatePBand (c*L)) → p ∣ u → p ∣ orderedSlotProduct (candidateMicroQSlotChoices c L r jStar J) x · simpa only [primeAssignmentCondition, hd, if_true, candidateMicroAssignmentNormalization, P] using h · simpa only [primeAssignmentCondition, hd, if_false, candidateMicroAssignmentNormalization, P] using h theorem eventually_candidate_coefficient_le_micro_assignment {c q θ : ℝ} (hc : 0 < c) (hq : 0 ≤ q) (r J : ℕ) (hθ : θ < 2*c/(2 : ℝ)^J) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J ≤ jStar → ∀ u : ℕ, candidateCoefficient c L q r jStar u ≤ candidateMicroAssignmentMajorant c L q r jStar J (Real.exp (θ*L)) u := by filter_upwards [eventually_candidate_P_pool_below_rough_cutoff hc, eventually_gt_atTop (0 : ℝ)] with L hpool hL intro jStar hj u exact candidate_coefficient_le_micro_assignment (mul_nonneg hc.le hL.le) hq hpool r jStar J hj (candidate_macro_Q_band_above hc.le hL J hθ) u end Bounty end section /- Summing reciprocal main terms and explicit lattice errors over actual assignments. -/ open Finset namespace Bounty theorem weighted_modulus_error_sum {I : Type*} [Fintype I] (w D : I → ℝ) (hw : ∀ i, 0 ≤ w i) {A B C M H : ℝ} (hB : 0 ≤ B) (hC : 0 ≤ C) (hM : 0 ≤ M) (hD : ∀ i, D i ≤ M) (hrec : (∑ i, w i / D i) = H) (hmass : (∑ i, w i) ≤ M*H) : (∑ i, w i * (A / D i + B*D i + C)) ≤ (A + B*M^2 + C*M)*H := by have herr : (∑ i, w i * (B*D i+C)) ≤ (B*M+C)*(M*H) := by calc _ ≤ ∑ i, w i * (B*M+C) := sum_le_sum (fun i _ => mul_le_mul_of_nonneg_left (add_le_add (mul_le_mul_of_nonneg_left (hD i) hB) le_rfl) (hw i)) _ = (B*M+C)*(∑ i, w i) := by rw [mul_sum]; apply sum_congr rfl; intro i _; ring _ ≤ _ := mul_le_mul_of_nonneg_left hmass (by positivity) have heq : (∑ i, w i * (A / D i + B*D i+C)) = A*(∑ i, w i/D i) + ∑ i, w i*(B*D i+C) := by rw [mul_sum, ← sum_add_distrib] apply sum_congr rfl intro i _ ring rw [heq, hrec] calc _ ≤ A*H + (B*M+C)*(M*H) := add_le_add le_rfl herr _ = _ := by ring theorem candidate_assignment_error_sum (c L : ℝ) (r jStar J : ℕ) {A B C M : ℝ} (hB : 0 ≤ B) (hC : 0 ≤ C) (hM : 0 ≤ M) (hN : 0 ≤ candidateMicroAssignmentNormalization c L r J) (hD : ∀ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ) ≤ M) (hrec : (∑ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, (1 / candidateMicroAssignmentNormalization c L r J) / (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ)) = candidateMicroQHarmonicMass c L r jStar J) (hmass : (∑ _x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, 1 / candidateMicroAssignmentNormalization c L r J) ≤ M*candidateMicroQHarmonicMass c L r jStar J) : (∑ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, (1 / candidateMicroAssignmentNormalization c L r J) * (A / (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ) + B*(orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ) + C)) ≤ (A+B*M^2+C*M)*candidateMicroQHarmonicMass c L r jStar J := by classical exact weighted_modulus_error_sum _ _ (fun _ => by positivity) hB hC hM hD hrec hmass end Bounty end section /- The remaining local phase acts on the original event and carries every edge restriction. -/ open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) noncomputable def fullMixedBirthResidualPhase : (tag : Option (J ⊕ K)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullPermutationMixedEvent n S B A Δ D tag x → ℂ | none, _, _ => 1 | some (.inl _), _, _ => 1 | some (.inr k), x, e => edgePhase k (fun _ => ∅) x e omit [∀ g, DecidableEq (P g)] in theorem full_mixed_local_freshness_factor (hedge : ∀ k H x e, edgePhase k H x e = (if FullMixedLocalBirthAvoids (J := J) n S B A Δ D H (some (.inr k)) x e ∧ FullMixedLocalBirthDistinct (J := J) n S B A Δ D (some (.inr k)) x e then 1 else 0) * edgePhase k (fun _ => ∅) x e) (tag : Option (J ⊕ K)) (s : FullMixedLedgerState n (M := M) B) (e : FullPermutationMixedEvent n S B A Δ D tag s.2) : fullMixedLedgerPhase n S B A Δ D edgePhase tag s e = (if FullMixedLocalBirthAvoids n S B A Δ D s.1 tag s.2 e ∧ FullMixedLocalBirthDistinct n S B A Δ D tag s.2 e then 1 else 0) * fullMixedBirthResidualPhase n S B A Δ D edgePhase tag s.2 e := by cases tag with | none => have ha : FullMixedLocalBirthAvoids n S B A Δ D s.1 none s.2 e := by intro a exact Fin.elim0 a.2 have hd : FullMixedLocalBirthDistinct n S B A Δ D none s.2 e := by intro a exact Fin.elim0 a.2 simp only [fullMixedLedgerPhase, fullMixedBirthResidualPhase, if_pos (And.intro ha hd), mul_one] | some tag => cases tag with | inl j => change fullMixedGhostFreshnessPhase n S B A Δ D j (fun g => (s.1 g, s.2 g)) e = _ rw [full_mixed_ghost_freshness_phase_birth_mask n S B A Δ D j s.1 s.2 e] simp only [fullMixedBirthResidualPhase, mul_one] | inr k => exact hedge k s.1 s.2 e end Full end Bounty end section /- The literal full clean event, with its shared-dependent physical displacement and total cutoff, is the clean repeated-kernel row. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- The fixed-forest operation factor reads optional birth labels, not pending-memory indices. -/ namespace Bounty end Bounty end section /- Exact clean-only change of encoding for the original physical full edge. This transports the literal no-storage, no-promotion event sum. Historical freshness and target-admissibility gates are not removed by this identity. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Exact chronological recursion on original paths; continuations retain the full preceding event. -/ open Finset Classical namespace Bounty section Paths variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end Paths end Bounty end section /- A uniform avoidance lower bound absorbs the normalized polynomial remainder. -/ open Finset Filter namespace Bounty theorem eventually_power_four_le_avoidance_square {θ : ℝ} (hθ : 0 < θ) : ∀ᶠ L : ℝ in atTop, ∀ W : ℝ, 1 ≤ W → W ≤ Real.exp (θ*L) → L^(-(4 : ℝ)) ≤ (∏ p ∈ primeBand 0 W, (1-1/(p : ℝ)))^2 := by let C := (2*primeEulerProductUpperConstant)*(1+θ) have hC : 0 < C := by dsimp [C]; positivity [primeEulerProductUpperConstant_pos] filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (Real.log 2), eventually_ge_atTop C] with L hL hlog hCL intro W hW hWup have hL0 : 0 < L := zero_lt_one.trans_le hL have hP : ∀ p ∈ primeBand 0 W, p.Prime := fun p hp => (mem_filter.mp hp).2 have hV := finite_prime_avoidance_product_lower (primeBand 0 W) hP hW (fun p hp => ((mem_primeBand_iff le_rfl (zero_le_one.trans hW) p).mp hp).2.2) have hden : 0 < (2*primeEulerProductUpperConstant)*Real.log (2*W) := by apply mul_pos (by positivity [primeEulerProductUpperConstant_pos]) apply Real.log_pos linarith have hlogW : Real.log W ≤ θ*L := by simpa only [Real.log_exp] using Real.log_le_log (zero_lt_one.trans_le hW) hWup have hd : (2*primeEulerProductUpperConstant)*Real.log (2*W) ≤ L^2 := by have hlogprod : Real.log (2*W) ≤ (1+θ)*L := by rw [Real.log_mul (by norm_num) (zero_lt_one.trans_le hW).ne'] nlinarith calc _ ≤ (2*primeEulerProductUpperConstant)*((1+θ)*L) := mul_le_mul_of_nonneg_left hlogprod (by positivity [primeEulerProductUpperConstant_pos]) _ = C*L := by dsimp [C]; ring _ ≤ L*L := mul_le_mul_of_nonneg_right hCL hL0.le _ = L^2 := by ring have hsmall : 1/L^2 ≤ ∏ p ∈ primeBand 0 W, (1-1/(p : ℝ)) := (div_le_div_of_nonneg_left zero_le_one hden hd).trans hV have hsquare := pow_le_pow_left₀ (by positivity : 0 ≤ 1/L^2) hsmall 2 have heq : L^(-(4 : ℝ)) = (1/L^2)^2 := by rw [Real.rpow_neg hL0.le] norm_num [Real.rpow_natCast] ring rw [heq] exact hsquare end Bounty end section /- Elementary uniform upper bounds for primes in the actual logarithmic cells. -/ open Finset Filter namespace Bounty theorem prime_band_subset_rough_band {A B z : ℝ} (hzA : z ≤ A) : primeBand A B ⊆ roughBand A B z := by intro p hp obtain ⟨hpI, hpprime⟩ := mem_filter.mp hp apply mem_filter.mpr refine ⟨hpI, ?_⟩ intro q hq rw [hpprime.primeFactors] at hq have hqp := mem_singleton.mp hq subst q have hAp : A < (p : ℝ) := Nat.lt_of_floor_lt (mem_Ioc.mp hpI).1 exact hzA.trans_lt hAp theorem exists_prime_logarithmic_cell_upper {a : ℝ} (ha : 0 < a) : ∃ C : ℝ, 0 < C ∧ ∀ S : ℝ, ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ((primeBand Y (Real.exp (L^(-S))*Y)).card : ℝ) ≤ C*(Real.exp (L^(-S))*Y-Y)/L := by obtain ⟨K, hK, hcount⟩ := exists_real_rough_integer_interval_count refine ⟨40*(K+1)/a+1, by positivity, ?_⟩ intro S have hb : 0 < 3*a/4 := by positivity filter_upwards [eventually_linear_exponential_profile_le_rpow hb hb K 0 (S+1), eventually_gt_atTop (0 : ℝ)] with L hprofile hL intro Y hY let len := Real.exp (L^(-S))*Y-Y let z := Real.exp ((a/40)*L) let V := ∏ p ∈ primeBand 0 z, (1-1/(p : ℝ)) have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hlen : 0 ≤ len := by have h := logarithmic_cell_length_lower (L := L) hY0.le S have hp : 0 ≤ Y*L^(-S) := by positivity exact hp.trans h have hz : 1 < z := Real.one_lt_exp_iff.mpr (by positivity) have hzY : z ≤ Y := by apply le_trans _ hY apply Real.exp_le_exp.mpr nlinarith have hV0 : 0 ≤ V := (finite_prime_avoidance_product_pos _ (fun _ hp => (mem_filter.mp hp).2)).le have hVz : V ≤ 1/((a/40)*L) := full_prime_avoidance_exp_upper (by positivity) have hbase := hcount hY0.le (show Y ≤ Real.exp (L^(-S))*Y by linarith) hz (show 1 ≤ 2 by omega) (show Even 2 by decide) change |((roughBand Y (Real.exp (L^(-S))*Y) z).card : ℝ)-len*V| ≤ K*(len*V*Real.exp (-2)+z^(4*(2 : ℝ)+2)) at hbase rw [show 4*(2 : ℝ)+2 = 10 by norm_num] at hbase have he2 : Real.exp (-2) ≤ 1 := Real.exp_le_one_iff.mpr (by norm_num) have hrough : ((roughBand Y (Real.exp (L^(-S))*Y) z).card : ℝ) ≤ (K+1)*len*V+K*z^(10 : ℝ) := by have hh := (abs_le.mp hbase).2 have he := mul_le_mul_of_nonneg_left he2 (mul_nonneg hlen hV0) nlinarith have hz10 : z^(10 : ℝ) = Real.exp ((a/4)*L) := by dsimp [z] rw [← Real.exp_mul] congr 1 ring have herror : K*z^(10 : ℝ) ≤ len/L := by simp only [zero_mul, add_zero] at hprofile have hm := mul_le_mul_of_nonneg_left hprofile (Real.exp_pos (a*L)).le have heq : Real.exp (a*L)*(K*Real.exp (-(3*a/4)*L)) = K*Real.exp ((a/4)*L) := by calc _ = K*Real.exp (a*L+(-(3*a/4)*L)) := by rw [Real.exp_add]; ring _ = _ := by congr 2; ring rw [heq] at hm rw [hz10] apply hm.trans calc _ ≤ Y*L^(-(S+1)) := mul_le_mul_of_nonneg_right hY (by positivity) _ = (Y*L^(-S))/L := by rw [show -(S+1) = -S+(-1) by ring, Real.rpow_add hL, Real.rpow_neg_one] ring _ ≤ len/L := div_le_div_of_nonneg_right (logarithmic_cell_length_lower hY0.le S) hL.le have hmain := mul_le_mul_of_nonneg_left hVz (show 0 ≤ (K+1)*len by positivity) have hcard : ((primeBand Y (Real.exp (L^(-S))*Y)).card : ℝ) ≤ ((roughBand Y (Real.exp (L^(-S))*Y) z).card : ℝ) := Nat.cast_le.mpr (card_le_card (prime_band_subset_rough_band hzY)) calc _ ≤ (K+1)*len*V+K*z^(10 : ℝ) := hcard.trans hrough _ ≤ (K+1)*len*(1/((a/40)*L))+len/L := add_le_add hmain herror _ = _ := by dsimp [len]; field_simp end Bounty end section /- Arbitrary power cancellation for rough integers with the actual harmonic Mellin twist. -/ open Finset Filter namespace Bounty theorem eventually_rough_interval_mellin_power_bound {a T : ℝ} (ha : 0 < a) (hT : 0 ≤ T) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), χ ≠ 1 → (r : ℝ) ≤ L^T → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ (Ioc m n).filter (fun i : ℕ => ∀ p ∈ i.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)), harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by filter_upwards [eventually_rough_interval_character_power_bound ha T (Bsave+T+1), eventually_ge_atTop (5 : ℝ)] with L hraw hL5 intro Y hY r hr χ hχ hrT v hv m n hmn hYm hn have hL : 0 < L := by linarith have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY by_cases heq : m = n · subst n simp only [Ioc_self, filter_empty, sum_empty, norm_zero] positivity have hmn' : m < n := lt_of_le_of_ne hmn heq let g := fun i : ℕ => if (∀ p ∈ i.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)) then χ (i : ZMod r) else 0 have hprefix : ∀ i ∈ Icc m n, ‖∑ j ∈ Ioc m i, g j‖ ≤ Y*L^(-(Bsave+T+1)) := by intro i hi have hh := hraw Y hY r χ hχ hrT m i (mem_Icc.mp hi).1 ((Nat.cast_le.mpr (mem_Icc.mp hi).2).trans hn) simpa only [sum_filter, g] using hh have hh := norm_harmonic_mellin_interval_sum_le g hY0 hmn' hYm hn (v := v) (B := Y*L^(-(Bsave+T+1))) (by positivity) hprefix have hpow : 1 ≤ L^T := Real.one_le_rpow (by linarith) hT have hgain : 3+2*|v| ≤ L^(T+1) := by calc _ ≤ 5*L^T := by nlinarith _ ≤ L*L^T := mul_le_mul_of_nonneg_right hL5 (by positivity) _ = _ := by rw [Real.rpow_add hL, Real.rpow_one]; ring calc _ = ‖∑ i ∈ Ioc m n, harmonicMellinWeight v i*g i‖ := by simp only [sum_filter, g, mul_ite, mul_zero] _ ≤ ((3+2*|v|)/Y)*(Y*L^(-(Bsave+T+1))) := hh _ = (3+2*|v|)*L^(-(Bsave+T+1)) := by field_simp _ ≤ L^(T+1)*L^(-(Bsave+T+1)) := mul_le_mul_of_nonneg_right hgain (by positivity) _ = L^(-Bsave) := by rw [← Real.rpow_add hL] congr 1 ring end Bounty end section /- Prime harmonic Mellin cancellation, with the original zero-free hypothesis explicit. -/ open Finset Filter namespace Bounty theorem eventually_prime_interval_mellin_power_bound (hZ : PrimitiveZeroFreeHalfPlane) {a T : ℝ} (ha : 0 < a) (hT : 0 ≤ T) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (r : ℕ), 0 < r → (r : ℝ) ≤ L^T → ∀ χ : DirichletCharacter ℂ r, χ ≠ 1 → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ (Ioc m n).filter Nat.Prime, harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by have ha2 : 0 < a/2 := by positivity filter_upwards [eventually_prime_band_coprime_relative_power_bound hZ ha2 (Bsave+T+1), eventually_rpow_le_exp_sqrt T, eventually_ge_atTop (10 : ℝ)] with L hraw hmod hL10 intro Y hY r hr hrT χ hχ v hv m n hmn hYm hn have hL : 0 < L := by linarith have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hrL : (r : ℝ) ≤ Real.exp L := hrT.trans (hmod.trans (Real.exp_le_exp.mpr (Real.sqrt_le_self_iff.mpr (Or.inr (by linarith))))) have hexp : Real.exp ((a/2)*L) < Y := by apply lt_of_lt_of_le _ hY exact Real.exp_lt_exp.mpr (by nlinarith) by_cases heq : m = n · subst n simp only [Ioc_self, filter_empty, sum_empty, norm_zero] positivity have hmn' : m < n := lt_of_le_of_ne hmn heq let g := fun i : ℕ => if i.Prime then χ (i : ZMod r) else 0 have hprefix : ∀ i ∈ Icc m n, ‖∑ j ∈ Ioc m i, g j‖ ≤ 2*Y*L^(-(Bsave+T+1)) := by intro i hi have hb := hraw r hr hrL χ hχ (i : ℝ) 1 (m : ℝ) (i : ℝ) (Nat.cast_nonneg _) zero_lt_one (Nat.cast_nonneg _) (Nat.cast_nonneg _) 1 (by omega) (by simpa only [Nat.cast_one] using Real.one_le_exp hL.le) have hset : ((primeBand (Real.exp ((a/2)*L)) (i : ℝ)).filter (fun p : ℕ => (m : ℝ) < 1*(p : ℝ) ∧ 1*(p : ℝ) ≤ i)).filter (fun p => p.Coprime 1) = (Ioc m i).filter Nat.Prime := by ext p simp only [mem_filter, mem_primeBand_iff (Real.exp_pos _).le (Nat.cast_nonneg i), one_mul, Nat.coprime_one_right_iff, and_true, mem_Ioc, Nat.cast_lt, Nat.cast_le] constructor · intro hp exact ⟨hp.2, hp.1.1⟩ · intro hp have hpY : Y ≤ (p : ℝ) := hYm.trans (Nat.cast_le.mpr hp.1.1) exact ⟨⟨hp.2, hexp.trans_le hpY, hp.1.2⟩, hp.1⟩ rw [hset, div_one] at hb have hiY : (i : ℝ) ≤ 2*Y := (Nat.cast_le.mpr (mem_Icc.mp hi).2).trans hn have hb' := hb.trans (mul_le_mul_of_nonneg_right hiY (by positivity)) simpa only [g, sum_filter] using hb' have hh := norm_harmonic_mellin_interval_sum_le g hY0 hmn' hYm hn (v := v) (B := 2*Y*L^(-(Bsave+T+1))) (by positivity) hprefix have hpow : 1 ≤ L^T := Real.one_le_rpow (by linarith) hT have hgain : 2*(3+2*|v|) ≤ L^(T+1) := by calc _ ≤ 10*L^T := by nlinarith _ ≤ L*L^T := mul_le_mul_of_nonneg_right hL10 (by positivity) _ = _ := by rw [Real.rpow_add hL, Real.rpow_one]; ring calc _ = ‖∑ i ∈ Ioc m n, harmonicMellinWeight v i*g i‖ := by simp only [sum_filter, g, mul_ite, mul_zero] _ ≤ ((3+2*|v|)/Y)*(2*Y*L^(-(Bsave+T+1))) := hh _ = (2*(3+2*|v|))*L^(-(Bsave+T+1)) := by field_simp _ ≤ L^(T+1)*L^(-(Bsave+T+1)) := mul_le_mul_of_nonneg_right hgain (by positivity) _ = L^(-Bsave) := by rw [← Real.rpow_add hL] congr 1 ring end Bounty end section /- Forest ties in a fixed original coupled-ghost skeleton, with the full target continuation retained. -/ open Finset Classical namespace Bounty theorem coupled_ghost_forest_continuation_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (μ : ∀ g, P g → ℝ) (q ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) (sk : CoupledGhostSkeleton t B s) {m : ℕ} (ord : Fin m ≃ CoupledGhostSampleIndex t B s sk) (code : BirthForestCode m) (anchor : Fin m → Option (Sigma P)) (η : G → ℝ) (hη : ∀ g, 0 ≤ η g) (hμ : ∀ g p, 0 ≤ μ g p) (hμatom : ∀ g p, μ g p ≤ η g) (v L : ℝ) (hv : 0 ≤ v) (hL : 0 ≤ L) (F : CoupledGhostSamples t B s sk → ℝ) (hF : ∀ births, F births ≤ L * productLengthLyapunov v (coupledGhostJointEventTarget t B s ((coupledGhostSkeletonEquiv t B s).symm ⟨sk, births⟩))) : (∑ births : CoupledGhostSamples t B s sk, if birthForestEqualValues code (fun j => (⟨(ord j).1, (births (ord j)).1⟩ : Sigma P)) ∧ birthLabelsAnchored anchor (fun j => (⟨(ord j).1, (births (ord j)).1⟩ : Sigma P)) then |coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) (fun g => physicalGhostBirth (n g) q ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) t B s ((coupledGhostSkeletonEquiv t B s).symm ⟨sk, births⟩)| * F births else 0) ≤ coupledGhostSkeletonAbsMass (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) t B s sk * (L * v ^ (∑ g, boundedGhostSkeletonOutputCount (t g) B (s g) (sk g).1 (sk g).2)) * ∏ j, match code j with | some _ => |(1 - q) * V (ord j).1 / ρ| * η (ord j).1 | none => match anchor j with | none => |(1 - q) * V (ord j).1 / ρ| * ∑ p, μ (ord j).1 p | some _ => |(1 - q) * V (ord j).1 / ρ| * η (ord j).1 := by have hb := labeled_anchored_forest_continuation_le (fun i : CoupledGhostSampleIndex t B s sk => UnrestrictedResidueParticle (n i.1)) ord (fun i z => (⟨i.1, z.1⟩ : Sigma P)) (fun i => physicalGhostBirthAtom (n i.1) (μ i.1) q ρ (V i.1)) code anchor (fun i => |(1 - q) * V i.1 / ρ| * ∑ p, μ i.1 p) (fun i => |(1 - q) * V i.1 / ρ| * η i.1) (fun i => mul_nonneg (abs_nonneg _) (sum_nonneg fun p _ => hμ i.1 p)) (fun i => mul_nonneg (abs_nonneg _) (hη i.1)) (fun i => physical_ghost_birth_atom_nonneg _ _ _ _ _ (hμ i.1)) (fun i => (physical_ghost_birth_atom_total (n i.1) (μ i.1) q ρ (V i.1)).le) (fun i => finiteLabelMass_tagged_ghost_le i.1 (n i.1) (μ i.1) q ρ (V i.1) (hη i.1) (hμatom i.1)) F (coupledGhostSkeletonAbsMass (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) t B s sk) (L * v ^ (∑ g, boundedGhostSkeletonOutputCount (t g) B (s g) (sk g).1 (sk g).2)) (coupled_ghost_skeleton_abs_mass_nonneg _ _ _ _ _ _) (mul_nonneg hL (pow_nonneg hv _)) (fun births => by simpa only [productLengthLyapunov_ghost_skeleton] using hF births) refine le_trans ?_ (le_trans hb ?_) · apply le_of_eq apply sum_congr rfl intro births _ split_ifs · rw [coupled_ghost_skeleton_weight_factor (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) (fun g => physicalGhostBirth (n g) q ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) (fun g (z : UnrestrictedResidueParticle (n g)) => hμ g z.1) t B s sk births] rfl · rfl · apply le_of_eq congr 1 apply prod_congr rfl intro j _ cases code j <;> cases anchor j <;> rfl end Bounty end section /- Forest ties in a fixed original full-edge skeleton, retaining its actual auxiliary draw and target continuation. -/ open Finset Classical namespace Bounty theorem full_edge_forest_continuation_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n S B A Δ D s) {m : ℕ} (ord : Fin m ≃ FullActiveEdgeSampleIndex n S B A Δ D s sk) (code : BirthForestCode m) (anchor : Fin m → Option (Sigma P)) (η : G → ℝ) (hη : ∀ g, 0 ≤ η g) (hμ : ∀ g p, 0 ≤ μ g p) (hμatom : ∀ g p, μ g p ≤ η g) (v L : ℝ) (hv : 0 ≤ v) (hL : 0 ≤ L) (F : FullActiveEdgeSamples n S B A Δ D s sk → ℝ) (hF : ∀ fresh, F fresh ≤ L * productLengthLyapunov v (fullActiveEdgeEventTarget n S B A Δ D s ((fullActiveEdgeSkeletonEquiv n S B A Δ D s).symm ⟨sk, fresh⟩))) : (∑ fresh : FullActiveEdgeSamples n S B A Δ D s sk, if birthForestEqualValues code (fun j => (⟨(ord j).1, fresh (ord j)⟩ : Sigma P)) ∧ birthLabelsAnchored anchor (fun j => (⟨(ord j).1, fresh (ord j)⟩ : Sigma P)) then |fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V s ((fullActiveEdgeSkeletonEquiv n S B A Δ D s).symm ⟨sk, fresh⟩)| * F fresh else 0) ≤ fullActiveEdgeSkeletonAbsMass n S B A Δ D ω ρ V s sk * (L * v ^ (∑ g, unrestrictedSkeletonOutputCount (n g) (Δ (productActiveMemorySplit S B s).1 sk.1 g) (D (productActiveMemorySplit S B s).1 sk.1 g) (S g)ᶜ.card B ((productActiveMemorySplit S B s).2 g) (sk.2 g))) * ∏ j, match code j with | some _ => η (ord j).1 | none => match anchor j with | none => ∑ p, μ (ord j).1 p | some _ => η (ord j).1 := by have hb := labeled_anchored_forest_continuation_le (fun i : FullActiveEdgeSampleIndex n S B A Δ D s sk => P i.1) ord (fun i p => (⟨i.1, p⟩ : Sigma P)) (fun i => μ i.1) code anchor (fun i => ∑ p, μ i.1 p) (fun i => η i.1) (fun i => sum_nonneg fun p _ => hμ i.1 p) (fun i => hη i.1) (fun i => hμ i.1) (fun _ => le_rfl) (fun i => finiteLabelMass_tagged_prime_le i.1 (μ i.1) (hη i.1) (hμatom i.1)) F (fullActiveEdgeSkeletonAbsMass n S B A Δ D ω ρ V s sk) (L * v ^ (∑ g, unrestrictedSkeletonOutputCount (n g) (Δ (productActiveMemorySplit S B s).1 sk.1 g) (D (productActiveMemorySplit S B s).1 sk.1 g) (S g)ᶜ.card B ((productActiveMemorySplit S B s).2 g) (sk.2 g))) (full_active_edge_skeleton_abs_mass_nonneg _ _ _ _ _ _ _ _ _ _ _) (mul_nonneg hL (pow_nonneg hv _)) (fun fresh => by simpa only [productLengthLyapunov_edge_skeleton] using hF fresh) refine le_trans ?_ (le_trans hb ?_) · apply le_of_eq apply sum_congr rfl intro fresh _ split_ifs · rw [full_active_edge_skeleton_weight_factor _ _ _ _ _ _ _ _ _ _ _ μ hμ] · rfl · apply le_of_eq congr 1 apply prod_congr rfl intro j _ cases code j <;> cases anchor j <;> rfl end Bounty end section /- The actual globally extended physical edge phase respects memory reindexing. -/ open Finset Classical namespace Bounty section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin N → Finset (Fin J)) (k : ℤ) (L R : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset ↥(P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (τ : ∀ g, Equiv.Perm (Fin (q g).1.val)) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) end Physical end Bounty end section /- The actual fixed-forest operation multiplier as a function of its local birth labels. -/ open Finset Classical namespace Bounty section Local variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) end Local end Bounty end section /- The actual head-event samples use the original global chronological order, independently of their values. -/ open Classical namespace Bounty section Ghost variable {J K : Type*} {N : ℕ} {P Z : Fin N → Type*} {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (j : J) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P Z M B) (sk : CoupledGhostSkeleton M B s) end Ghost section Edge variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (k : K) (steps : List (Option (J ⊕ K))) (A : SharedActiveLabels P (S k) → Type*) (Δ D : ∀ c, A c → Fin N → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n (S k) B A Δ D s) end Edge end Bounty end section /- Each performed global birth position has exactly the actual sample coordinate at its owning event. -/ namespace Bounty end Bounty end section /- Joint-cap-preserving marked rows for the actual coupled ghost skeletons. -/ open Finset Classical namespace Bounty theorem coupled_ghost_marked_length_row_le {G : Type*} [Fintype G] [DecidableEq G] {P Z : G → Type*} (A D : ∀ g, Z g → ℝ) (hA : ∀ g z, 0 ≤ A g z) (ℓ ε : G → ℝ) (v : ℝ) (hℓ : ∀ g, 0 ≤ ℓ g) (hε : ∀ g, 0 ≤ ε g) (hv : 0 ≤ v) (hdamp : ∀ g z, A g z * v + |D g z| ≤ v) (t : G → ℕ) (B : ℕ) (d : G → ℕ) (s : ProductBoundedOrderedState P Z t B) : (∑ sk : CoupledGhostSkeleton t B s, if ∀ g, d g ≤ (sk g).1.val then coupledGhostSkeletonAbsMass A D t B s sk * v ^ (∑ g, boundedGhostSkeletonOutputCount (t g) B (s g) (sk g).1 (sk g).2) * ∏ g, ε g ^ d g * ℓ g ^ ((sk g).1.val - d g) else 0) ≤ ∏ g, ((ε g * v) ^ d g * Real.exp (ℓ g * v) * v ^ (s g).2.1.val) := by let f := fun g (a : Fin (B + 1) × Finset (Fin (s g).2.1.val)) => if d g ≤ a.1.val then boundedGhostSkeletonAbsMass (A g) (D g) (t g) B (s g) a.1 a.2 * v ^ boundedGhostSkeletonOutputCount (t g) B (s g) a.1 a.2 * ε g ^ d g * ℓ g ^ (a.1.val - d g) else 0 have hf : ∀ g a, 0 ≤ f g a := by intro g a dsimp only [f] split_ifs · exact mul_nonneg (mul_nonneg (mul_nonneg (bounded_ghost_skeleton_abs_mass_nonneg _ _ _ _ _ _ _) (pow_nonneg hv _)) (pow_nonneg (hε g) _)) (pow_nonneg (hℓ g) _) · exact le_rfl have hrow : ∀ g, ∑ a, f g a ≤ (ε g * v) ^ d g * Real.exp (ℓ g * v) * v ^ (s g).2.1.val := by intro g simpa only [f, Fintype.sum_prod_type] using bounded_ghost_marked_length_row_le (A g) (D g) (hA g) (ℓ g) (ε g) v (hℓ g) (hε g) hv (hdamp g) (t g) B (d g) (s g) calc _ ≤ ∑ sk : CoupledGhostSkeleton t B s, ∏ g, f g (sk g) := by apply sum_le_sum intro sk _ by_cases hm : ∀ g, d g ≤ (sk g).1.val · simp only [if_pos hm] unfold coupledGhostSkeletonAbsMass split_ifs · have he : ∀ g, f g (sk g) = boundedGhostSkeletonAbsMass (A g) (D g) (t g) B (s g) (sk g).1 (sk g).2 * v ^ boundedGhostSkeletonOutputCount (t g) B (s g) (sk g).1 (sk g).2 * ε g ^ d g * ℓ g ^ ((sk g).1.val - d g) := by intro g exact if_pos (hm g) simp only [he, prod_mul_distrib] rw [prod_pow_eq_pow_sum] exact (by ring : _ = _).le · simp only [zero_mul] exact prod_nonneg fun g _ => hf g (sk g) · simp only [if_neg hm] exact prod_nonneg fun g _ => hf g (sk g) _ = ∏ g, ∑ a, f g a := (Fintype.prod_sum f).symm _ ≤ _ := prod_le_prod₀ (fun g _ => sum_nonneg fun a _ => hf g a) (fun g _ => hrow g) end Bounty end section /- The full original auxiliary edge skeleton pays one atom per marked fresh slot. -/ open Finset Classical namespace Bounty theorem full_active_edge_marked_length_row_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (ρ v vmin : ℝ) (V ℓ ε : G → ℝ) (hω : ∀ c a, 0 ≤ ω c a) (hωmass : ∀ c, ∑ a, ω c a ≤ 1) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : ∀ g, vmin ≤ V g) (hℓ : ∀ g, 0 ≤ ℓ g) (hℓ2 : ∀ g, ℓ g ≤ 2) (hε : ∀ g, 0 ≤ ε g) (T : ℕ) (ht : ∀ g, (S g)ᶜ.card ≤ T) (d : G → ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : (∑ sk : FullActiveEdgeSkeleton n S B A Δ D s, if ∀ g, d g ≤ (S g)ᶜ.card - (sk.2 g).2.1.card then fullActiveEdgeSkeletonAbsMass n S B A Δ D ω ρ V s sk * v ^ (∑ g, unrestrictedSkeletonOutputCount (n g) (Δ (productActiveMemorySplit S B s).1 sk.1 g) (D (productActiveMemorySplit S B s).1 sk.1 g) (S g)ᶜ.card B ((productActiveMemorySplit S B s).2 g) (sk.2 g)) * ∏ g, ε g ^ d g * ℓ g ^ ((S g)ᶜ.card - (sk.2 g).2.1.card - d g) else 0) ≤ (∏ g, ε g ^ d g) * productLengthLyapunov v s * unrestrictedEdgeRowBound ρ v vmin T ^ Fintype.card G := by let c := (productActiveMemorySplit S B s).1 let r := (productActiveMemorySplit S B s).2 let f := fun (a : A c) g (sk : UnrestrictedLocalEdgeSkeleton (n g) (Δ c a g) (D c a g) (S g)ᶜ.card B (r g)) => if d g ≤ (S g)ᶜ.card - sk.2.1.card then |unrestrictedBoundedSkeletonMass (n g) (Δ c a g) (D c a g) ρ (V g) (S g)ᶜ.card B (r g) sk.1 sk.2.1 sk.2.2| * v ^ unrestrictedSkeletonOutputCount (n g) (Δ c a g) (D c a g) (S g)ᶜ.card B (r g) sk * ε g ^ d g * ℓ g ^ ((S g)ᶜ.card - sk.2.1.card - d g) else 0 have hf : ∀ a g sk, 0 ≤ f a g sk := by intro a g sk dsimp only [f] split_ifs · exact mul_nonneg (mul_nonneg (mul_nonneg (abs_nonneg _) (pow_nonneg (zero_lt_one.trans hv).le _)) (pow_nonneg (hε g) _)) (pow_nonneg (hℓ g) _) · exact le_rfl have hrow : ∀ a g, ∑ sk, f a g sk ≤ ε g ^ d g * v ^ (r g).2.1.val * unrestrictedEdgeRowBound ρ v vmin T := by intro a g exact unrestricted_bounded_marked_length_row_le (n g) (Δ c a g) (D c a g) ρ (V g) v vmin (ℓ g) (ε g) hρ0 hρ1 hv hvmin (hV g) (hℓ g) (hℓ2 g) (hε g) (S g)ᶜ.card B T (d g) (ht g) (r g) have hprod : ∀ a, (∑ sk : ∀ g, UnrestrictedLocalEdgeSkeleton (n g) (Δ c a g) (D c a g) (S g)ᶜ.card B (r g), ∏ g, f a g (sk g)) ≤ (∏ g, ε g ^ d g) * productLengthLyapunov v s * unrestrictedEdgeRowBound ρ v vmin T ^ Fintype.card G := by intro a rw [← Fintype.prod_sum (f a)] have hh := prod_le_prod₀ (s := univ) (fun g _ => sum_nonneg fun sk _ => hf a g sk) (fun g _ => hrow a g) have hr : (∏ g, v ^ (r g).2.1.val) = productLengthLyapunov v s := productLengthLyapunov_split S B v s simpa only [prod_mul_distrib, prod_const, card_univ, hr] using hh have hnonneg : 0 ≤ (∏ g, ε g ^ d g) * productLengthLyapunov v s * unrestrictedEdgeRowBound ρ v vmin T ^ Fintype.card G := mul_nonneg (mul_nonneg (prod_nonneg fun g _ => pow_nonneg (hε g) _) (productLengthLyapunov_nonneg (zero_lt_one.trans hv).le s)) (pow_nonneg (unrestricted_edge_row_bound_nonneg hρ1 (zero_lt_one.trans hv).le T) _) rw [Fintype.sum_sigma] calc _ ≤ ∑ a : A c, ω c a * ∑ sk : ∀ g, UnrestrictedLocalEdgeSkeleton (n g) (Δ c a g) (D c a g) (S g)ᶜ.card B (r g), ∏ g, f a g (sk g) := by apply sum_le_sum intro a _ rw [mul_sum] apply sum_le_sum intro sk _ by_cases hm : ∀ g, d g ≤ (S g)ᶜ.card - (sk g).2.1.card · simp only [if_pos hm] unfold fullActiveEdgeSkeletonAbsMass dsimp only rw [abs_of_nonneg (hω c a)] split_ifs · have he : ∀ g, f a g (sk g) = |unrestrictedBoundedSkeletonMass (n g) (Δ c a g) (D c a g) ρ (V g) (S g)ᶜ.card B (r g) (sk g).1 (sk g).2.1 (sk g).2.2| * v ^ unrestrictedSkeletonOutputCount (n g) (Δ c a g) (D c a g) (S g)ᶜ.card B (r g) (sk g) * ε g ^ d g * ℓ g ^ ((S g)ᶜ.card - (sk g).2.1.card - d g) := fun g => if_pos (hm g) simp only [he, prod_mul_distrib] rw [prod_pow_eq_pow_sum] exact (by ring : _ = _).le · simp only [mul_zero, zero_mul] exact mul_nonneg (hω c a) (prod_nonneg fun g _ => hf a g (sk g)) · simp only [if_neg hm] exact mul_nonneg (hω c a) (prod_nonneg fun g _ => hf a g (sk g)) _ ≤ (∑ a : A c, ω c a) * ((∏ g, ε g ^ d g) * productLengthLyapunov v s * unrestrictedEdgeRowBound ρ v vmin T ^ Fintype.card G) := by rw [sum_mul] exact sum_le_sum fun a _ => mul_le_mul_of_nonneg_left (hprod a) (hω c a) _ ≤ _ := by simpa only [one_mul] using mul_le_mul_of_nonneg_right (hωmass c) hnonneg end Bounty end section /- Restricting the original forest preserves the exact selected-child exponent. -/ open Finset Classical namespace Bounty end Bounty end section /- Stage constraints retain the global forest and only select children owned by this stage. -/ namespace Bounty theorem owner_restricted_birth_forest_iff {N m L : ℕ} {α : Type*} (embed : Fin m → Fin N) (owner : Fin N → Fin L) (u : Fin L) (howner : ∀ j, owner (embed j) = u) (performed : Fin N → Prop) (hcover : ∀ i, performed i → owner i = u → i ∈ Set.range embed) (code : BirthForestCode N) (values : Fin N → α) (hchildren : ∀ i, owner i = u → code i ≠ none → performed i) : (∀ i, owner i = u → ∀ p, code i = some p → values i = values (birthForestParentEmbedding i p)) ↔ birthForestEqualValues (restrictedBirthCode embed code) (values ∘ embed) ∧ birthLabelsAnchored (restrictedBirthAnchors embed code values) (values ∘ embed) := by rw [← restricted_birth_forest_iff] constructor · intro h j p hp exact h (embed j) (howner j) p hp · intro h i hi p hp have hic : code i ≠ none := by rw [hp]; exact Option.some_ne_none _ obtain ⟨j, rfl⟩ := hcover i (hchildren i hi hic) hi exact h j p hp theorem owner_restricted_birth_forest_past_iff {N m L : ℕ} {α : Type*} (embed : Fin m → Fin N) (hstrict : StrictMono embed) (owner : Fin N → Fin L) (hmono : Monotone owner) (u : Fin L) (howner : ∀ j, owner (embed j) = u) (performed : Fin N → Prop) (hcover : ∀ i, performed i → owner i = u → i ∈ Set.range embed) (code : BirthForestCode N) (values history : Fin N → α) (hchildren : ∀ i, owner i = u → code i ≠ none → performed i) (hparents : ∀ j p, code (embed j) = some p → performed (birthForestParentEmbedding (embed j) p)) (hpast : ∀ i, owner i < u → values i = history i) : (∀ i, owner i = u → ∀ p, code i = some p → values i = values (birthForestParentEmbedding i p)) ↔ birthForestEqualValues (restrictedBirthCode embed code) (values ∘ embed) ∧ birthLabelsAnchored (restrictedBirthAnchors embed code history) (values ∘ embed) := by rw [owner_restricted_birth_forest_iff embed owner u howner performed hcover code values hchildren] rw [restricted_birth_anchors_past_local embed hstrict owner hmono u howner performed hcover code hparents values history hpast] end Bounty end section /- A sharp sieve upper bound on the same shrinking-cell scale as the Buchstab density. -/ open Finset Filter open scoped Topology namespace Bounty theorem logarithmic_cell_normalized_sieve_remainder {a b L S Y : ℝ} (hL : 0 < L) (hY : Real.exp (a*L) ≤ Y) (h : ℕ) : (Real.exp (b*L))^(4*(h : ℝ)+2)/logarithmicCellCountScale L S Y ≤ L^(S+1)*Real.exp (-(a-b*(4*(h : ℝ)+2))*L) := by have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hscale := logarithmic_cell_count_scale_pos (S := S) hL hY0 have hlow : Y*L^(-S)/L ≤ logarithmicCellCountScale L S Y := div_le_div_of_nonneg_right (logarithmic_cell_length_lower hY0.le S) hL.le apply (div_le_iff₀ hscale).mpr calc _ = Real.exp (a*L)*Real.exp (-(a-b*(4*(h : ℝ)+2))*L) := by rw [← Real.exp_mul, ← Real.exp_add] congr 1 ring _ ≤ Y*Real.exp (-(a-b*(4*(h : ℝ)+2))*L) := mul_le_mul_of_nonneg_right hY (Real.exp_pos _).le _ = (L^(S+1)*Real.exp (-(a-b*(4*(h : ℝ)+2))*L))*(Y*L^(-S)/L) := by have hp : L^(S+1)*L^(-S) = L := by rw [← Real.rpow_add hL, show S+1+-S = 1 by ring, Real.rpow_one] have hn : L ≠ 0 := hL.ne' field_simp nlinarith [hp] _ ≤ _ := mul_le_mul_of_nonneg_left hlow (by positivity) theorem exists_short_cell_rough_density_sieve_upper : ∃ K : ℝ, 0 < K ∧ ∀ (a b S : ℝ), 0 < a → 0 < b → ∀ h : ℕ, 1 ≤ h → Even h → b*(4*(h : ℝ)+2) < a → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → normalizedRoughCellCount L S Y (Real.exp (b*L)) ≤ (Mertens.primeProductLimitConstant/b)*(1+K*Real.exp (-(h : ℝ)))+ε := by obtain ⟨K, hK, hsieve⟩ := exists_real_rough_integer_interval_count refine ⟨K, hK, ?_⟩ intro a b S ha hb h hh heven hlevel ε hε have hd : 0 < a-b*(4*(h : ℝ)+2) := by linarith have ht0 := tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero (S+1) (a-b*(4*(h : ℝ)+2)) hd have ht := ((exponential_prime_avoidance_product_tendsto hb).mul_const (1+K*Real.exp (-(h : ℝ)))).add (ht0.const_mul K) simp only [mul_zero, add_zero] at ht have hev := ht.eventually_lt_const (show (Mertens.primeProductLimitConstant/b)*(1+K*Real.exp (-(h : ℝ))) < (Mertens.primeProductLimitConstant/b)*(1+K*Real.exp (-(h : ℝ)))+ε by linarith) filter_upwards [hev, eventually_gt_atTop (0 : ℝ)] with L hmajor hL intro Y hY have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hscale := logarithmic_cell_count_scale_pos (S := S) hL hY0 let len := Real.exp (L^(-S))*Y-Y let V := ∏ p ∈ primeBand 0 (Real.exp (b*L)), (1-1/(p : ℝ)) have hlen : 0 < len := by have hl := logarithmic_cell_length_lower (L := L) hY0.le S exact (mul_pos hY0 (Real.rpow_pos_of_pos hL _)).trans_le hl have hbase := hsieve hY0.le (show Y ≤ Real.exp (L^(-S))*Y by linarith) (Real.one_lt_exp_iff.mpr (mul_pos hb hL)) hh heven have hcount : ((roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (b*L))).card : ℝ) ≤ len*V*(1+K*Real.exp (-(h : ℝ)))+K*(Real.exp (b*L))^(4*(h : ℝ)+2) := by change |((roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (b*L))).card : ℝ)-len*V| ≤ K*(len*V*Real.exp (-(h : ℝ))+(Real.exp (b*L))^(4*(h : ℝ)+2)) at hbase have hupper := (le_abs_self _).trans hbase nlinarith have herror := logarithmic_cell_normalized_sieve_remainder (S := S) (b := b) hL hY h calc normalizedRoughCellCount L S Y (Real.exp (b*L)) ≤ (len*V*(1+K*Real.exp (-(h : ℝ)))+K*(Real.exp (b*L))^(4*(h : ℝ)+2))/ logarithmicCellCountScale L S Y := div_le_div_of_nonneg_right hcount hscale.le _ = (L*V)*(1+K*Real.exp (-(h : ℝ)))+ K*((Real.exp (b*L))^(4*(h : ℝ)+2)/logarithmicCellCountScale L S Y) := by unfold logarithmicCellCountScale change (len*V*(1+K*Real.exp (-(h : ℝ)))+K*(Real.exp (b*L))^(4*(h : ℝ)+2))/(len/L) = (L*V)*(1+K*Real.exp (-(h : ℝ)))+K*((Real.exp (b*L))^(4*(h : ℝ)+2)/(len/L)) field_simp [hL.ne', hlen.ne'] <;> ring _ ≤ (L*V)*(1+K*Real.exp (-(h : ℝ)))+ K*(L^(S+1)*Real.exp (-(a-b*(4*(h : ℝ)+2))*L)) := by gcongr _ ≤ _ := hmajor.le end Bounty end section /- Concrete omitted-small-label averaging for storage with external residues. The reverse eligibility estimate uses the step -k, while the literal forward operator still has displacement -kD and both total-memory cutoffs. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- The full shared-fiber storage transpose includes an arbitrary finite external coordinate. Its choice-dependent translation is inverted on the reverse side; the same total-memory cutoffs and auxiliary weights are retained. -/ open Finset Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) {A : SharedActiveLabels P S → Type*} [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) {R : Type*} [Fintype R] (τ : ∀ c, A c → R ≃ R) noncomputable def fullActiveStorageExternal := equivExternalFiberAverage (productActiveMemorySplit S B) ω (fun c a => unrestrictedStorageOnlyProduct n (Δ c a) (D c a) μ ρ V (fun g => (S g)ᶜ.card) B) τ noncomputable def fullActiveReversePromotionExternal := equivExternalFiberAverage (productActiveMemorySplit S B) ω (fun c a => unrestrictedReversePromotionOnlyProduct n (Δ c a) (D c a) μ ρ V (fun g => (S g)ᶜ.card) B) (fun c a => (τ c a).symm) /- Exact full-space weighted bilinear identity; no dimension factor or renormalization of shared or auxiliary coordinates is introduced. -/ theorem full_active_storage_external_pairing (hV : ∀ g, V g ≠ 0) (f g : ProductBoundedOrderedState P (fun j => UnrestrictedResidueParticle (n j)) M B → R → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) (hg : ∀ r, ProductMemorySymmetric (fun x => g x r)) : (∑ r, ∑ s, (productMemoryWeight μ (fun j => unrestrictedResidueWeight (μ j)) s : ℂ) * f s r * fullActiveStorageExternal n S B Δ D ω μ ρ V τ g s r) = ∑ r, ∑ s, (productMemoryWeight μ (fun j => unrestrictedResidueWeight (μ j)) s : ℂ) * fullActiveReversePromotionExternal n S B Δ D ω μ ρ V τ f s r * g s r := by apply equiv_external_fiber_average_pairing (productActiveMemorySplit S B) (productMemoryWeight μ (fun j => unrestrictedResidueWeight (μ j))) (sharedActiveWeight S μ) (productMemoryWeight μ (fun j => unrestrictedResidueWeight (μ j))) (productActiveMemorySplit_weight_symm S B μ (fun j => unrestrictedResidueWeight (μ j))) ω (fun c a => unrestrictedStorageOnlyProduct n (Δ c a) (D c a) μ ρ V (fun j => (S j)ᶜ.card) B) (fun c a => unrestrictedReversePromotionOnlyProduct n (Δ c a) (D c a) μ ρ V (fun j => (S j)ᶜ.card) B) τ f g intro c a r q exact unrestricted_storage_only_product_pairing n (Δ c a) (D c a) μ ρ V (fun j => (S j)ᶜ.card) B hV _ _ (productActiveMemorySlice_symmetric S B (fun x => f x r) (hf r) c) (productActiveMemorySlice_symmetric S B (fun x => g x q) (hg q) c) end end Bounty end section /- A proved per-auxiliary mixed edge bound. The small coordinates carry original residue-valid counting mass and the big coordinates carry the product/factorial memory law. Both small conditioning losses and the actual full big-event energy bound are discharged here. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_small_big_full_energy_bound {q vs : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : G → ℕ) (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ), (∀ s, vs ≤ Vs s) → ∀ (ζ : ℝ) (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists Ps J → ℂ) (Hκ : ℝ), 0 ≤ Hκ → (∀ d, ‖κ d‖ ≤ Hκ) → ∀ (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ (T : ℕ), (∀ g, (shared g)ᶜ.card ≤ T) → ∀ (Ψ : ∀ d x, PhysicalResidues Ps → PhysicalSmallBigFullEvent n shared B Δ D d x → ℂ) (H : ℝ), 0 ≤ H → (∀ d x r e, ‖Ψ d x r e‖ ≤ H) → ∀ (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigAction Vs q ζ aux κ (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullCoefficient n shared B Δ D μ ρ V Ψ) (fun x => kbig (productActiveMemorySplit shared B x).1) F) ≤ A ^ (2 * Fintype.card S) * Hκ ^ 2 * (H ^ 2 * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_energy_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ intro S G _ dS _ dG cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ n _ J M shared B Δ D μ ρ V kbig Vs hVs ζ aux κ Hκ hHκ hκ v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht Ψ H hH hΨ F hF exact hbound S (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) Ps J Vs hVs ζ (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1)) aux κ (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullCoefficient n shared B Δ D μ ρ V Ψ) (fun x => kbig (productActiveMemorySplit shared B x).1) Hκ (H ^ 2 * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) hHκ (mul_nonneg (sq_nonneg H) (pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _)) hκ F (physical_small_big_conditioned_full_prefix_energy_le n shared B Δ D μ ρ V kbig Vs q hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht Ψ H hH hΨ F hF) end Bounty end section /- The nonclean positive event sum splits into events with a promotion and storage-only events. A bounded complex coefficient is dominated without changing the event masks, either cutoff, or the external translation. -/ open Finset open scoped Classical namespace Bounty theorem finite_dirty_indicator {G : Type*} (p q : G → Prop) : (if ¬ (∀ g, p g ∧ q g) then (1 : ℂ) else 0) = (if ∃ g, ¬ q g then 1 else 0) + (if (∀ g, q g) ∧ (∃ g, ¬ p g) then 1 else 0) := by simp only [← not_forall, forall_and] by_cases hp : ∀ g, p g <;> by_cases hq : ∀ g, q g <;> simp [hp, hq] section variable {G : Type*} [Fintype G] [dG : DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) end section variable {A G R : Type*} [Fintype A] [Fintype G] [Fintype R] [dG : DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : A → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (π : A → ℝ) (τ : A → R ≃ R) end end Bounty end section /- Restrict the actual edge labels and retain the full coefficient at its original pattern. -/ open scoped Classical namespace Bounty section Edge variable {G I : Type*} {P : G → Finset ℕ} {J ell : ℕ} (small : G → Prop) (patterns : Finset I) (C : I → G → Finset (Fin J)) noncomputable def physicalRestrictedEdge (a : PhysicalEdgeLabels P J ell patterns C) : PhysicalEdgeLabels (fun g : {g // small g} => P g.val) J ell patterns (fun i g => C i g.val) := ⟨(fun g => a.1 g.val), (fun g => a.2.1 g.val), ⟨a.2.2.1, fun g => a.2.2.2 g.val⟩⟩ theorem physical_restricted_edge_pattern (a : PhysicalEdgeLabels P J ell patterns C) : (physicalRestrictedEdge small patterns C a).2.2.1 = a.2.2.1 := rfl variable [Fintype G] noncomputable def physicalFixedEdgeBigCoefficient (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) (i : I) (Lb Rb : PhysicalMarkLists (fun g : {g // ¬small g} => P g.val) J ell) (ab : PhysicalAuxLabels (fun g : {g // ¬small g} => P g.val) (fun g => C i g.val)) : ℂ := if hi : i = a.2.2.1.val then physicalCoupledBigCoefficient small (C i) (ζ i) (K i) (fun g => physicalPermuteLabels a.1 L g.val) (fun g => physicalPermuteLabels a.2.1 R g.val) (fun g => (hi.symm ▸ a.2.2.2) g.val) Lb Rb ab else 0 theorem physical_fixed_edge_big_coefficient_apply (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) : physicalFixedEdgeBigCoefficient small patterns C ζ K a L R a.2.2.1.val (fun g => physicalPermuteLabels a.1 L g.val) (fun g => physicalPermuteLabels a.2.1 R g.val) (fun g => a.2.2.2 g.val) = K a.2.2.1.val (physicalPermuteLabels a.1 L) (physicalPermuteLabels a.2.1 R) a.2.2.2 * physicalPhase (ζ a.2.2.1.val) (physicalD (fun g : {g // small g} => C a.2.2.1.val g.val) (fun g => physicalPermuteLabels a.1 L g.val) (fun g => a.2.2.2 g.val) * physicalD (fun g : {g // ¬small g} => C a.2.2.1.val g.val) (fun g => physicalPermuteLabels a.1 L g.val) (fun g => a.2.2.2 g.val)) := by simp only [physicalFixedEdgeBigCoefficient] exact physical_coupled_big_coefficient_restrict small (C a.2.2.1.val) (ζ a.2.2.1.val) (K a.2.2.1.val) a.2.2.2 (physicalPermuteLabels a.1 L) (physicalPermuteLabels a.2.1 R) end Edge end Bounty end section /- Prime-power removal with arbitrary logarithmic savings. -/ open Filter Asymptotics namespace Bounty theorem ordinary_sqrt_log_isLittleO (B : ℝ) : (fun x : ℝ => 2 * Real.sqrt x * Real.log x) =o[atTop] (fun x : ℝ => x * (Real.log x)^(-B)) := by have h := (isLittleO_log_rpow_rpow_atTop (B+1) (by norm_num : (0 : ℝ) < 1/2)).mul_isBigO (isBigO_refl (fun x : ℝ => x^((1 : ℝ)/2) * (Real.log x)^(-B)) atTop) have hl : (fun x : ℝ => (Real.log x)^(B+1) * (x^((1 : ℝ)/2) * (Real.log x)^(-B))) =ᶠ[atTop] (fun x : ℝ => Real.sqrt x * Real.log x) := by filter_upwards [eventually_gt_atTop (1 : ℝ)] with x hx have hp : (Real.log x)^(B+1) * (Real.log x)^(-B) = Real.log x := by rw [← Real.rpow_add (Real.log_pos hx)] rw [show B+1 + -B = (1 : ℝ) by ring, Real.rpow_one] rw [← Real.sqrt_eq_rpow] calc _ = Real.sqrt x * ((Real.log x)^(B+1) * (Real.log x)^(-B)) := by ring _ = _ := by rw [hp] have hr : (fun x : ℝ => x^((1 : ℝ)/2) * (x^((1 : ℝ)/2) * (Real.log x)^(-B))) =ᶠ[atTop] (fun x : ℝ => x * (Real.log x)^(-B)) := by filter_upwards [eventually_gt_atTop (0 : ℝ)] with x hx rw [← mul_assoc, ← Real.rpow_add hx] norm_num simpa only [mul_assoc] using (h.congr' hl hr).const_mul_left 2 theorem ordinary_prime_power_error_isLittleO (B : ℝ) : (Chebyshev.psi - Chebyshev.theta) =o[atTop] (fun x : ℝ => x * (Real.log x)^(-B)) := by have h : (Chebyshev.psi - Chebyshev.theta) =O[atTop] (fun x : ℝ => 2 * Real.sqrt x * Real.log x) := by apply IsBigO.of_norm_eventuallyLE filter_upwards [eventually_ge_atTop (1 : ℝ)] with x hx simpa only [Pi.sub_apply, Real.norm_eq_abs] using Chebyshev.abs_psi_sub_theta_le_sqrt_mul_log hx exact h.trans_isLittleO (ordinary_sqrt_log_isLittleO B) theorem ordinary_theta_error_isLittleO (B : ℝ) : (Chebyshev.theta - id) =o[atTop] (fun x : ℝ => x * (Real.log x)^(-B)) := by have heq : (Chebyshev.psi - id) - (Chebyshev.psi - Chebyshev.theta) = Chebyshev.theta - id := by funext x simp only [Pi.sub_apply] ring rw [← heq] exact (ordinary_psi_error_isLittleO B).sub (ordinary_prime_power_error_isLittleO B) theorem eventually_ordinary_theta_log_power_bound (B : ℝ) : ∀ᶠ x : ℝ in atTop, |Chebyshev.theta x - x| ≤ x * (Real.log x)^(-B) := by filter_upwards [(ordinary_theta_error_isLittleO B).def (by norm_num : (0 : ℝ) < 1), eventually_ge_atTop (1 : ℝ)] with x hx hx1 have hp : 0 ≤ x * (Real.log x)^(-B) := mul_nonneg (by linarith) (Real.rpow_nonneg (Real.log_nonneg hx1) _) simpa only [Pi.sub_apply, id_eq, Real.norm_eq_abs, one_mul, abs_of_nonneg hp] using hx theorem eventually_ordinary_theta_uniform_log_power_bound {a : ℝ} (ha : 0 < a) (B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ x : ℝ, Real.exp (a*L) ≤ x → |Chebyshev.theta x - x| ≤ x * (Real.log x)^(-B) := by obtain ⟨N, hN⟩ := eventually_atTop.mp (eventually_ordinary_theta_log_power_bound B) have hlim : Tendsto (fun L : ℝ => Real.exp (a*L)) atTop atTop := Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop ha) filter_upwards [hlim.eventually (eventually_ge_atTop N)] with L hL exact fun x hx => hN x (hL.trans hx) end Bounty end section /- The common Mertens normalization at the preliminary cutoff exp(sqrt L). -/ open Filter Real Finset open scoped Topology namespace Bounty theorem sqrt_prime_avoidance_product_tendsto : Tendsto (fun L : ℝ => sqrt L * ∏ p ∈ primeBand 0 (exp (sqrt L)), (1-1/(p : ℝ))) atTop (𝓝 Mertens.primeProductLimitConstant) := by have h := logarithmic_prime_avoidance_product_tendsto.comp (tendsto_exp_atTop.comp tendsto_sqrt_atTop) simpa only [Function.comp_def, log_exp] using h theorem eventually_sqrt_normalized_rough_base_error {a ε : ℝ} (ha : 0 < a) (hε : 0 < ε) (S : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, exp (a*L) ≤ Y → |normalizedRoughCellCount L S Y (exp (sqrt L))/sqrt L- Mertens.primeProductLimitConstant| ≤ ε := by have hsmall : Tendsto (fun L : ℝ => L^(-(1 : ℝ))) atTop (𝓝 0) := tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 1) have hlo := sqrt_prime_avoidance_product_tendsto.mul (hsmall.const_sub 1) have hhi := sqrt_prime_avoidance_product_tendsto.mul (hsmall.const_add 1) simp only [sub_zero, add_zero, mul_one] at hlo hhi filter_upwards [eventually_rough_logarithmic_cell_count ha S 1, hlo.eventually_const_lt (show Mertens.primeProductLimitConstant-ε < Mertens.primeProductLimitConstant by linarith), hhi.eventually_lt_const (show Mertens.primeProductLimitConstant < Mertens.primeProductLimitConstant+ε by linarith), eventually_gt_atTop (0 : ℝ)] with L hraw hlo hhi hL intro Y hY have hY0 : 0 < Y := (exp_pos _).trans_le hY have hs : 0 < sqrt L := sqrt_pos.2 hL have hscale := logarithmic_cell_count_scale_pos (S := S) hL hY0 let D := logarithmicCellCountScale L S Y*sqrt L let t := sqrt L * ∏ p ∈ primeBand 0 (exp (sqrt L)), (1-1/(p : ℝ)) have hD : 0 < D := mul_pos hscale hs have hm : roughLogarithmicCellMainTerm L S Y = D*t := by dsimp [D, t, roughLogarithmicCellMainTerm] calc _ = logarithmicCellCountScale L S Y * (sqrt L*sqrt L) * ∏ p ∈ primeBand 0 (exp (sqrt L)), (1-1/(p : ℝ)) := by rw [mul_self_sqrt hL.le] unfold logarithmicCellCountScale field_simp _ = _ := by ring have hr := hraw Y hY rw [hm] at hr have hrl := (abs_le.mp hr).1 have hru := (abs_le.mp hr).2 change Mertens.primeProductLimitConstant-ε < t*(1-L^(-(1 : ℝ))) at hlo change t*(1+L^(-(1 : ℝ))) < Mertens.primeProductLimitConstant+ε at hhi unfold normalizedRoughCellCount rw [div_div] change |((roughBand Y (exp (L^(-S))*Y) (exp (sqrt L))).card : ℝ)/D- Mertens.primeProductLimitConstant| ≤ ε apply abs_le.mpr constructor · have hn : D*(t*(1-L^(-(1 : ℝ)))) ≤ ((roughBand Y (exp (L^(-S))*Y) (exp (sqrt L))).card : ℝ) := by nlinarith have hd : t*(1-L^(-(1 : ℝ))) ≤ ((roughBand Y (exp (L^(-S))*Y) (exp (sqrt L))).card : ℝ)/D := by apply (le_div_iff₀ hD).mpr nlinarith linarith · have hn : ((roughBand Y (exp (L^(-S))*Y) (exp (sqrt L))).card : ℝ) ≤ D*(t*(1+L^(-(1 : ℝ)))) := by nlinarith have hd : ((roughBand Y (exp (L^(-S))*Y) (exp (sqrt L))).card : ℝ)/D ≤ t*(1+L^(-(1 : ℝ))) := by apply (div_le_iff₀ hD).mpr; nlinarith linarith end Bounty end section /- The uniform small-slot average is a contractive projection for the genuine mixed residue-valid energy. No product small-label law is used. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_permutation_mul {S X : Type*} {P : S → Finset ℕ} {J ell : ℕ} (σ τ : PhysicalPermutations S J ell) (x : PhysicalSmallBigState P J ell X) : physicalSmallBigPermutation σ (physicalSmallBigPermutation τ x) = physicalSmallBigPermutation (τ * σ) x := by apply Prod.ext · apply Prod.ext · rfl · funext g apply Function.Embedding.ext intro j rfl · rfl theorem physical_small_big_average_invariant {S X : Type*} [Fintype S] [DecidableEq S] {P : S → Finset ℕ} {J ell : ℕ} (f : PhysicalSmallBigState P J ell X → ℂ) (τ : PhysicalPermutations S J ell) (x : PhysicalSmallBigState P J ell X) : physicalSmallBigAverage f (physicalSmallBigPermutation τ x) = physicalSmallBigAverage f x := by unfold physicalSmallBigAverage simp only [physical_small_big_permutation_mul] apply congrArg (fun z : ℂ => (Fintype.card (PhysicalPermutations S J ell) : ℂ)⁻¹ * z) exact Equiv.sum_comp (Equiv.mulLeft τ) (fun σ => f (physicalSmallBigPermutation σ x)) theorem physical_small_big_average_energy_le {S X : Type*} [Fintype S] [dS : DecidableEq S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (W : X → ℝ) (hW : ∀ x, 0 ≤ W x) (f : PhysicalSmallBigState P J ell X → ℂ) : physicalSmallBigEnergy V W (physicalSmallBigAverage f) ≤ physicalSmallBigEnergy V W f := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) have hc : (Fintype.card (PhysicalPermutations S J ell) : ℝ) ≠ 0 := by exact_mod_cast (Fintype.card_ne_zero : Fintype.card (PhysicalPermutations S J ell) ≠ 0) have hm : (∑ _σ : PhysicalPermutations S J ell, (Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹) = 1 := by simp only [sum_const, card_univ, nsmul_eq_mul, mul_inv_cancel₀ hc] have h := finite_subprobability_average_energy_le (fun _σ : PhysicalPermutations S J ell => (Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹) (physicalSmallBigMeasure V W) (by intro σ; positivity) hm.le (physical_small_big_measure_nonneg V hV W hW) (fun σ x => f (physicalSmallBigPermutation σ x)) have he : (fun x => ∑ σ : PhysicalPermutations S J ell, (((Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹ : ℝ) : ℂ) * f (physicalSmallBigPermutation σ x)) = physicalSmallBigAverage f := by funext x simp only [physicalSmallBigAverage, Complex.ofReal_inv, Complex.ofReal_natCast, mul_sum] rw [he] at h simp_rw [physical_small_big_energy_eq, physical_small_big_permutation_energy] at h rw [← sum_mul, hm, one_mul] at h exact h end Bounty end section /- The literal mixed row vanishes outside its existing source total-memory cap, independently of all event coefficients and small endpoint data. -/ open Finset Classical namespace Bounty theorem physical_small_big_full_zero_above_cap {S G : Type*} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ) (q ζ : ℝ) (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (κ : PhysicalSharedLists Ps J → ℂ) (Ψ : ∀ d x, PhysicalResidues Ps → PhysicalSmallBigFullEvent n shared B Δ D d x → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (hs : ¬ productTotalMemory s.2 ≤ B) : physicalSmallBigAction Vs q ζ aux κ (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullCoefficient n shared B Δ D μ ρ V Ψ) (fun x => kbig (productActiveMemorySplit shared B x).1) F s = 0 := by unfold physicalSmallBigAction apply sum_eq_zero intro e he simp only [physicalSmallBigEventWeight, physicalSmallBigFullCoefficient, fullActiveEdgeEventWeight, unrestrictedJointCutoffEventWeight, productActiveMemorySplit_total_memory, hs, false_and, if_false, mul_zero, Complex.ofReal_zero, zero_mul] end Bounty end section /- The original small conditioning lifts a proved clean big-fiber estimate through an exact packed pairing. Endpoint multipliers stay explicit. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_multiplier_energy_le {S X : Type*} [Fintype S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (W : X → ℝ) (hW : ∀ x, 0 ≤ W x) (g f : PhysicalSmallBigState P J ell X → ℂ) (hg : ∀ s, ‖g s‖ ≤ 1) : physicalSmallBigEnergy V W (fun s => g s * f s) ≤ physicalSmallBigEnergy V W f := by rw [← physical_small_big_energy_eq, ← physical_small_big_energy_eq] apply sum_le_sum intro s _ apply mul_le_mul_of_nonneg_left _ (physical_small_big_measure_nonneg V hV W hW s) apply pow_le_pow_left₀ (norm_nonneg _) calc ‖g s * f s‖ = ‖g s‖ * ‖f s‖ := norm_mul _ _ _ ≤ 1 * ‖f s‖ := mul_le_mul_of_nonneg_right (hg s) (norm_nonneg _) _ = _ := one_mul _ theorem physical_small_big_clean_pairing_energy_le {S X : Type*} [Fintype S] [dS : DecidableEq S] [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (q : ℝ) (W : X → ℝ) (hW : ∀ x, 0 ≤ W x) (sourceGate targetGate : PhysicalSmallBigState P J ell X → ℂ) (hs : ∀ s, ‖sourceGate s‖ ≤ 1) (ht : ∀ s, ‖targetGate s‖ ≤ 1) {A M : ℝ} (hA : 0 ≤ A) (_hM : 0 ≤ M) (hcondition : ∀ u : PhysicalSmallBigState P J ell X → ℂ, physicalSmallBigConditionEnergy W (physicalSmallBigCondition V q u) ≤ A * physicalSmallBigEnergy V W u) (F output : PhysicalSmallBigState P J ell X → ℂ) (v : PhysicalSharedLists P J → X → PhysicalResidues P → ℂ) (hclean : ∀ d, cleanWeightedNorm W (v d) ≤ M * cleanWeightedNorm W (physicalSmallBigCondition V q (fun s => targetGate s * F s) d)) (hpair : ∀ u : PhysicalSmallBigState P J ell X → ℂ, (∑ s, (physicalSmallBigMeasure V W s : ℂ) * (starRingEnd ℂ) (u s) * output s) = ∑ d, ∑ r, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition V q (fun s => sourceGate s * u s) d x r) * v d x r) : physicalSmallBigEnergy V W output ≤ A ^ 2 * M ^ 2 * physicalSmallBigEnergy V W F := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) let Y := PhysicalSharedLists P J × (PhysicalResidues P × X) let ν : Y → ℝ := fun y => W y.2.2 let C : (PhysicalSmallBigState P J ell X → ℂ) → Y → ℂ := fun u y => physicalSmallBigCondition V q (fun s => sourceGate s * u s) y.1 y.2.2 y.2.1 let w : Y → ℂ := fun y => v y.1 y.2.2 y.2.1 have hCe (u : PhysicalSmallBigState P J ell X → ℂ) : finiteWeightedEnergy ν (C u) = physicalSmallBigConditionEnergy W (physicalSmallBigCondition V q (fun s => sourceGate s * u s)) := by simp only [ν, C, Y, finiteWeightedEnergy, Fintype.sum_prod_type, physicalSmallBigConditionEnergy] have hv : finiteWeightedEnergy ν w ≤ M ^ 2 * A * finiteWeightedEnergy (physicalSmallBigMeasure V W) F := by calc _ ≤ M ^ 2 * physicalSmallBigConditionEnergy W (physicalSmallBigCondition V q (fun s => targetGate s * F s)) := by simp only [ν, w, Y, finiteWeightedEnergy, Fintype.sum_prod_type, physicalSmallBigConditionEnergy, mul_sum] apply sum_le_sum intro d _ have hd := hclean d rw [clean_weighted_norm_eq_external_energy, clean_weighted_norm_eq_external_energy] at hd have h := pow_le_pow_left₀ (Real.sqrt_nonneg _) hd 2 rw [mul_pow] at h simp only [finiteWeightedEnergy] at h rw [Real.sq_sqrt, Real.sq_sqrt] at h · simp only [mul_sum] at h convert h using 1 <;> congr 2 all_goals exact sum_nonneg fun r _ => sum_nonneg fun x _ => mul_nonneg (hW x) (sq_nonneg _) _ ≤ M ^ 2 * (A * physicalSmallBigEnergy V W (fun s => targetGate s * F s)) := mul_le_mul_of_nonneg_left (hcondition _) (sq_nonneg _) _ ≤ M ^ 2 * (A * physicalSmallBigEnergy V W F) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (physical_small_big_multiplier_energy_le V hV W hW targetGate F ht) hA) (sq_nonneg _) _ = _ := by rw [physical_small_big_energy_eq]; ring have h := finite_conditioned_energy_le (physicalSmallBigMeasure V W) ν (physical_small_big_measure_nonneg V hV W hW) (fun y => hW y.2.2) C hA (mul_nonneg (sq_nonneg M) hA) (fun u => by rw [hCe, physical_small_big_energy_eq] exact (hcondition _).trans (mul_le_mul_of_nonneg_left (physical_small_big_multiplier_energy_le V hV W hW sourceGate u hs) hA)) F output w hv (fun u => by have hp := hpair u simp only [ν, C, w, Y, Fintype.sum_prod_type] at hp ⊢ convert hp using 1 <;> congr 3) rw [physical_small_big_energy_eq, physical_small_big_energy_eq] at h convert h using 1 ring theorem exists_physical_small_big_clean_pairing_energy_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S X : Type) [Fintype S] [DecidableEq S] [Fintype X] (P : S → Finset ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] (J : ℕ) (V : S → ℝ), (∀ s, v ≤ V s) → ∀ (W : X → ℝ), (∀ x, 0 ≤ W x) → ∀ (sourceGate targetGate : PhysicalSmallBigState P J ell X → ℂ), (∀ s, ‖sourceGate s‖ ≤ 1) → (∀ s, ‖targetGate s‖ ≤ 1) → ∀ (M : ℝ), 0 ≤ M → ∀ (F output : PhysicalSmallBigState P J ell X → ℂ) (w : PhysicalSharedLists P J → X → PhysicalResidues P → ℂ), (∀ d, cleanWeightedNorm W (w d) ≤ M * cleanWeightedNorm W (physicalSmallBigCondition V q (fun s => targetGate s * F s) d)) → (∀ u : PhysicalSmallBigState P J ell X → ℂ, (∑ s, (physicalSmallBigMeasure V W s : ℂ) * (starRingEnd ℂ) (u s) * output s) = ∑ d, ∑ r, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition V q (fun s => sourceGate s * u s) d x r) * w d x r) → physicalSmallBigEnergy V W output ≤ A ^ (2 * Fintype.card S) * M ^ 2 * physicalSmallBigEnergy V W F := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_condition_energy_bound hq0 hq1 hv ell refine ⟨A, hA, ?_⟩ intro S X _ dS _ cases Subsingleton.elim dS (Classical.typeDecidableEq S) intro P _ J V hV W hW sourceGate targetGate hs ht M hM F output w hclean hpair have h := physical_small_big_clean_pairing_energy_le V (fun s => hv.trans_le (hV s)) q W hW sourceGate targetGate hs ht (pow_nonneg (zero_le_one.trans hA) _) hM (hbound S X P J V hV W hW) F output w hclean hpair simpa only [← pow_mul, Nat.mul_comm (Fintype.card S) 2] using h end Bounty end section /- Pay the small-conditioning cost in the clean exponent before choosing the clean pattern parameters. The big dirty cost is then fixed, and J is chosen last. These are scalar budgets, not an assertion of a row identity. -/ open Filter open scoped Topology namespace Bounty end Bounty end section /- Concrete endpoint gates on the genuine mixed state. Small forbidden labels restrict only the target tail; no auxiliary draw is restricted. -/ open Finset open scoped Classical namespace Bounty def CleanMixedBigActiveInjective {S G : Type*} {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : Prop := ∀ g, Function.Injective (s.2 g).1 noncomputable def cleanMixedSourceGate {S G : Type*} {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : ℂ := if CleanMixedBigActiveInjective s then 1 else 0 noncomputable def cleanMixedTargetGate {S G : Type*} {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} (Fs : ∀ g, Finset (Ps g)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : ℂ := if CleanMixedBigActiveInjective s ∧ (∀ g (j : Fin ell), s.1.2 g (Sum.inr j) ∉ Fs g) then 1 else 0 theorem clean_mixed_big_active_injective_memory {S G : Type*} [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} (s : PhysicalBareResidueState Ps J ell) (x : ProductBoundedOrderedState P Z M B) (g : G) (τ : Equiv.Perm (Fin (x g).2.1.val)) : CleanMixedBigActiveInjective (s, productMemoryPermuteAt x g τ) ↔ CleanMixedBigActiveInjective (s, x) := by have he (j : G) : (productMemoryPermuteAt x g τ j).1 = (x j).1 := by by_cases hj : j = g · subst j simp only [productMemoryPermuteAt, Function.update_self] · simp only [productMemoryPermuteAt, Function.update_of_ne hj] simp only [CleanMixedBigActiveInjective, he] section variable {S G : Type*} {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} include S G Ps P Z J ell B M theorem clean_mixed_source_gate_norm_le (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : ‖cleanMixedSourceGate s‖ ≤ 1 := by unfold cleanMixedSourceGate split_ifs <;> norm_num theorem clean_mixed_target_gate_norm_le (Fs : ∀ g, Finset (Ps g)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : ‖cleanMixedTargetGate Fs s‖ ≤ 1 := by unfold cleanMixedTargetGate split_ifs <;> norm_num theorem cleanMixedSourceGate_conj (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : (starRingEnd ℂ) (cleanMixedSourceGate s) = cleanMixedSourceGate s := by unfold cleanMixedSourceGate split_ifs <;> simp theorem cleanMixedTargetGate_conj (Fs : ∀ g, Finset (Ps g)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : (starRingEnd ℂ) (cleanMixedTargetGate Fs s) = cleanMixedTargetGate Fs s := by unfold cleanMixedTargetGate split_ifs <;> simp end section variable {S G : Type*} [sharedInstance1 : DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} include S G sharedInstance1 Ps P Z J ell B M theorem clean_mixed_source_gate_memory (s : PhysicalBareResidueState Ps J ell) (x : ProductBoundedOrderedState P Z M B) (g : G) (τ : Equiv.Perm (Fin (x g).2.1.val)) : cleanMixedSourceGate (s, productMemoryPermuteAt x g τ) = cleanMixedSourceGate (s, x) := by simp only [cleanMixedSourceGate, clean_mixed_big_active_injective_memory] theorem clean_mixed_target_gate_memory (Fs : ∀ g, Finset (Ps g)) (s : PhysicalBareResidueState Ps J ell) (x : ProductBoundedOrderedState P Z M B) (g : G) (τ : Equiv.Perm (Fin (x g).2.1.val)) : cleanMixedTargetGate Fs (s, productMemoryPermuteAt x g τ) = cleanMixedTargetGate Fs (s, x) := by simp only [cleanMixedTargetGate, clean_mixed_big_active_injective_memory] theorem clean_mixed_target_gate_mul_memory_symmetric (Fs : ∀ g, Finset (Ps g)) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s, x))) : ∀ s, ProductMemorySymmetric (fun x => cleanMixedTargetGate Fs (s, x) * f (s, x)) := by intro s x g τ dsimp only rw [clean_mixed_target_gate_memory] exact congrArg (fun z : ℂ => cleanMixedTargetGate Fs (s, x) * z) (hf s x g τ) end end Bounty end section /- Small-slot averaging commutes exactly with a finite scalar-weighted auxiliary sum. The weights are independent of the mixed state. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_average_weighted_sum {S X Q : Type*} [Fintype S] [dS : DecidableEq S] [Fintype Q] {P : S → Finset ℕ} {J ell : ℕ} (w : Q → ℂ) (F : Q → PhysicalSmallBigState P J ell X → ℂ) : physicalSmallBigAverage (fun s => ∑ a, w a * F a s) = fun s => ∑ a, w a * physicalSmallBigAverage (F a) s := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) funext s simp only [physicalSmallBigAverage, mul_sum] rw [sum_comm] apply sum_congr rfl intro a _ apply sum_congr rfl intro σ _ ring end Bounty end section /- Adapters from a positive fraction of candidate mass to shifted-prime mass supply. -/ open Finset Filter namespace Bounty theorem exists_candidate_mass_fraction_polynomial_lower {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11 / 5 : ℝ) * (r : ℝ) * c = 1) : ∃ C : ℝ, 0 ≤ C ∧ ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ σ : ℝ, 0 < σ → ∀ mass : ℝ → ℝ, (∀ᶠ L : ℝ in atTop, σ * candidateCoefficientWindowMass c L q r jStar / L ≤ mass L) → ∀ᶠ L : ℝ in atTop, Real.exp L * L ^ (-C) ≤ mass L := by obtain ⟨C, hC, J, hmass⟩ := exists_candidate_coefficient_mass_polynomial_lower hc hr hq0 hq1 hcenter refine ⟨C + 2, by linarith, J, ?_⟩ intro jStar hj σ hσ mass hfraction exact eventually_polynomial_mass_lower_transfer C hσ (hmass jStar hj) hfraction theorem exists_centered_candidate_parameters {δ : ℝ} (hδ : 0 < δ) : ∃ c : ℝ, ∃ r : ℕ, 0 < c ∧ 0 < r ∧ (11 / 5 : ℝ) * (r : ℝ) * c = 1 ∧ (6 / 5 : ℝ) * c ≤ δ := by obtain ⟨r, hrlarge⟩ := exists_nat_gt (max 1 (1 / δ)) have hrone : (1 : ℝ) < (r : ℝ) := lt_of_le_of_lt (le_max_left _ _) hrlarge have hrpos : (0 : ℝ) < (r : ℝ) := by linarith have hr : 0 < r := by exact_mod_cast hrpos have hdiv : 1 / δ < (r : ℝ) := lt_of_le_of_lt (le_max_right _ _) hrlarge have hmul : 1 < (r : ℝ) * δ := (div_lt_iff₀ hδ).mp hdiv let c : ℝ := 5 / (11 * (r : ℝ)) have hc : 0 < c := by dsimp [c]; positivity refine ⟨c, r, hc, hr, ?_, ?_⟩ · dsimp [c] field_simp · have heq : (6 / 5 : ℝ) * c = 6 / (11 * (r : ℝ)) := by dsimp [c]; ring rw [heq] apply (div_le_iff₀ (by positivity : (0 : ℝ) < 11 * (r : ℝ))).mpr nlinarith theorem candidate_shifted_prime_mass_supply_of_positive_fraction (hfraction : ∀ (c q : ℝ) (r : ℕ), 0 < c → 0 < r → 0 ≤ q → q < 1 → (11 / 5 : ℝ) * (r : ℝ) * c = 1 → ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∃ σ : ℝ, 0 < σ ∧ ∀ᶠ L : ℝ in atTop, σ * candidateCoefficientWindowMass c L q r jStar / L ≤ ∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => (2 * u + 1).Prime), candidateCoefficient c L q r jStar u) : CandidateShiftedPrimeMassSupply := by intro δ hδ hδsmall obtain ⟨c, r, hc, hr, hcenter, hsmall⟩ := exists_centered_candidate_parameters hδ obtain ⟨C, hC, Jbase, hbase⟩ := exists_candidate_mass_fraction_polynomial_lower hc hr (by norm_num : (0 : ℝ) ≤ 0) (by norm_num : (0 : ℝ) < 1) hcenter obtain ⟨Jfrac, hfrac⟩ := hfraction c 0 r hc hr (by norm_num) (by norm_num) hcenter let jStar := max Jbase Jfrac + 1 have hjbase : Jbase < jStar := by dsimp [jStar]; omega have hjfrac : Jfrac < jStar := by dsimp [jStar]; omega obtain ⟨σ, hσ, hmass⟩ := hfrac jStar hjfrac have hpoly := hbase jStar hjbase σ hσ _ hmass refine ⟨c, 0, C, r, jStar, hc, hr, by norm_num, by norm_num, hsmall, ?_⟩ filter_upwards [hpoly] with L hL refine ⟨(arithmeticProductWindow 1 (Real.exp L)).filter (fun u => (2 * u + 1).Prime), filter_subset _ _, ?_, hL⟩ intro u hu exact (mem_filter.mp hu).2 end Bounty end section /- Absolute logarithmic endpoint bounds, uniform in all physical mark counts. -/ open Finset namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] (P : G → Finset ℕ) (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (Q : Finset ℕ) (hQ : ∀ g, P g ⊆ Q) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (J ell : ℕ) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (S : Finset ℤ) (N : ℕ) (hS : ∀ n ∈ S, 0 ≤ n ∧ n ≤ (N : ℤ)) (f : ℤ → ℂ) (hf : ∀ n ∈ S, ‖f n‖ ≤ ‖invariantTripleEndpoint Q α β γ n.natAbs‖) include G sharedInstance1 sharedInstance2 P hP hprime V hV hMass Q hQ α β γ A B C hA hB hC hα hβ hγ J ell q hq0 hq1 S N hS f hf theorem physical_invariant_endpoint_energy : ‖physicalEndpointVector P V J ell q S f‖ ^ 2 ≤ (A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 := by classical apply physical_endpoint_energy_of_list_bounds P V hV hMass J ell hq0 hq1 S f (by positivity) intro L calc _ ≤ ∑ n ∈ S, if ∀ g s, ((L g s).val : ℤ) ∣ n then ‖invariantTripleEndpoint Q α β γ n.natAbs‖ ^ 2 else 0 := by apply sum_le_sum intro n hn split_ifs · exact pow_le_pow_left₀ (norm_nonneg _) (hf n hn) 2 · exact le_rfl _ ≤ _ := invariant_triple_endpoint_list_energy P hP hprime Q hQ α β γ hA hB hC hα hβ hγ S N hS L theorem physical_invariant_endpoint_norm : ‖physicalEndpointVector P V J ell q S f‖ ≤ A * B * C * Real.sqrt N * (1 + Real.log N) ^ 8 := by have he := physical_invariant_endpoint_energy P hP hprime V hV hMass Q hQ α β γ hA hB hC hα hβ hγ J ell hq0 hq1 S N hS f hf have hp : (1 + Real.log N) ^ 15 ≤ (1 + Real.log N) ^ 16 := pow_le_pow_right₀ (by linarith [Real.log_natCast_nonneg N]) (by decide) have hs : (A * B * C * Real.sqrt N * (1 + Real.log N) ^ 8) ^ 2 = (A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 16 := by rw [mul_pow, mul_pow, Real.sq_sqrt (Nat.cast_nonneg N), ← pow_mul] apply (sq_le_sq₀ (norm_nonneg _) (by positivity)).mp rw [hs] exact he.trans (mul_le_mul_of_nonneg_left hp (by positivity)) end end Bounty end section /- Divisor bounds for the actual diagonal of the shifted factorization energy. -/ open Finset namespace Bounty theorem typeII_diagonal_divisor_fiber (E H : Finset ℕ) (w : ℕ) (hE : ∀ e∈E, 0 2*v.1*v.2=w), (v.2.divisors.card : ℝ)^2) ≤ (w.divisors.card : ℝ)^3 := by classical let F := (E ×ˢ H).filter (fun v => 2*v.1*v.2=w) by_cases hw : w=0 · subst w have hF : F=∅ := by apply filter_eq_empty_iff.mpr intro v hv heq have he := hE v.1 (mem_product.mp hv).1 have hh := hH v.2 (mem_product.mp hv).2 nlinarith change (∑ v∈F, (v.2.divisors.card : ℝ)^2) ≤ _ rw [hF, sum_empty] positivity have hdiv (v : ℕ×ℕ) (hv : v∈F) : v.2∣w := by refine ⟨2*v.1, ?_⟩ have heq := (mem_filter.mp hv).2 nlinarith have hinj : Set.InjOn (fun v : ℕ×ℕ => v.2) (↑F : Set (ℕ×ℕ)) := by intro v hv z hz hvz apply Prod.ext _ hvz have heqv := (mem_filter.mp hv).2 have heqz := (mem_filter.mp hz).2 have hh := hH v.2 (mem_product.mp (mem_filter.mp hv).1).2 change v.2=z.2 at hvz nlinarith have hsub : F.image Prod.snd ⊆ w.divisors := by intro h hh obtain ⟨v,hv,rfl⟩ := mem_image.mp hh exact Nat.mem_divisors.mpr ⟨hdiv v hv, hw⟩ change (∑ v∈F, (v.2.divisors.card : ℝ)^2) ≤ _ calc _ = ∑ h∈F.image Prod.snd, (h.divisors.card : ℝ)^2 := (sum_image hinj).symm _ ≤ ∑ h∈w.divisors, (h.divisors.card : ℝ)^2 := sum_le_sum_of_subset_of_nonneg hsub (fun _ _ _ => sq_nonneg _) _ ≤ ∑ _h∈w.divisors, (w.divisors.card : ℝ)^2 := by apply sum_le_sum intro h hh apply pow_le_pow_left₀ (by positivity) exact_mod_cast card_le_card (Nat.divisors_subset_of_dvd hw (Nat.mem_divisors.mp hh).1) _ = _ := by simp only [sum_const, nsmul_eq_mul]; ring theorem typeII_diagonal_shifted_fiber (E H : Finset ℕ) (v : ℕ) (hE : ∀ e∈E, 0 v=2*z.1*z.2+1), (z.2.divisors.card : ℝ)^2) ≤ ((v-1).divisors.card : ℝ)^3 := by have hs : (E ×ˢ H).filter (fun z => v=2*z.1*z.2+1) ⊆ (E ×ˢ H).filter (fun z => 2*z.1*z.2=v-1) := by intro z hz refine mem_filter.mpr ⟨(mem_filter.mp hz).1, ?_⟩ have h := (mem_filter.mp hz).2 omega exact (sum_le_sum_of_subset_of_nonneg hs (fun _ _ _ => sq_nonneg _)).trans (typeII_diagonal_divisor_fiber E H (v-1) hE hH) theorem positive_pair_sum_le_divisor_sum (M N : Finset ℕ) (X : ℕ) (f : ℕ → ℝ) (hM : ∀ m∈M, 0 < m) (hN : ∀ n∈N, 0 < n) (hX : ∀ m∈M, ∀ n∈N, m*n≤X) (hf : ∀ v, 0≤f v) : (∑ m∈M, ∑ n∈N, f (m*n)) ≤ ∑ v∈Icc 1 X, (v.divisors.card : ℝ)*f v := by classical let P := M ×ˢ N have hmap : ∀ z∈P, z.1*z.2∈Icc 1 X := by intro z hz obtain ⟨hm,hn⟩ := mem_product.mp hz exact mem_Icc.mpr ⟨Nat.mul_pos (hM z.1 hm) (hN z.2 hn),hX z.1 hm z.2 hn⟩ have hre : (∑ m∈M, ∑ n∈N, f (m*n)) = ∑ z∈P, f (z.1*z.2) := by simp only [P, sum_product] rw [hre] rw [← sum_fiberwise_of_maps_to hmap] apply sum_le_sum intro v hv let F := P.filter (fun z => z.1*z.2=v) have hv0 : v≠0 := by have := (mem_Icc.mp hv).1; omega have hinj : Set.InjOn (fun z : ℕ×ℕ => z.1) (↑F : Set (ℕ×ℕ)) := by intro z hz w hw heq apply Prod.ext heq have hzv := (mem_filter.mp hz).2 have hwv := (mem_filter.mp hw).2 have hz0 := hM z.1 (mem_product.mp (mem_filter.mp hz).1).1 apply Nat.eq_of_mul_eq_mul_left hz0 simpa only [heq] using hzv.trans hwv.symm have hsub : F.image Prod.fst ⊆ v.divisors := by intro m hm obtain ⟨z,hz,rfl⟩ := mem_image.mp hm exact Nat.mem_divisors.mpr ⟨⟨z.2,(mem_filter.mp hz).2.symm⟩,hv0⟩ have hc : F.card≤v.divisors.card := by rw [← card_image_of_injOn hinj] exact card_le_card hsub have heq : (∑ z∈F, f (z.1*z.2)) = (F.card : ℝ)*f v := by calc _ = ∑ _z∈F, f v := sum_congr rfl (fun z hz => congrArg f (mem_filter.mp hz).2) _ = _ := by simp only [sum_const,nsmul_eq_mul] change (∑ z∈F, f (z.1*z.2)) ≤ _ rw [heq] exact mul_le_mul_of_nonneg_right (by exact_mod_cast hc) (hf v) theorem typeII_diagonal_divisor_moment (E H M N : Finset ℕ) (X : ℕ) (hE : ∀ e∈E, 0 m*n=2*z.1*z.2+1), (z.2.divisors.card : ℝ)^2) ≤ 2*(X : ℝ)*(1+Real.log X)^15 := by calc _ ≤ ∑ m∈M, ∑ n∈N, ((m*n-1).divisors.card : ℝ)^3 := by apply sum_le_sum intro m hm apply sum_le_sum intro n hn exact typeII_diagonal_shifted_fiber E H (m*n) hE hH _ ≤ ∑ v∈Icc 1 X, (v.divisors.card : ℝ)*((v-1).divisors.card : ℝ)^3 := positive_pair_sum_le_divisor_sum M N X (fun v : ℕ => ((v-1).divisors.card : ℝ)^3) hM hN hX (fun _ => by positivity) _ ≤ _ := divisor_adjacent_cross_moment X end Bounty end section /- On the manuscript's good tuples the exact candidate allocation has a K0-independent loss L^88. -/ open Finset Real namespace Bounty theorem candidate_allocation_size_range_of_product_bounds {c L E B H : ℝ} (hc : 0 < c) (hL : 0 < L) (hlog : 0 < log L) (hE1 : 1 ≤ E) {r jStar P : ℕ} (hr : 6 ≤ r) (hj : jStar ∈ candidateQIndices c L) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (htotal : exp B ≤ (P*orderedSlotProduct (candidateQSlotChoices c L r jStar) x : ℕ)) (hretained : (P*(x (candidateRoughSlot c L r jStar (by omega) hj)).val : ℕ) ≤ exp H) (hE : log E ≤ B-H) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hweight : 0 < candidateAllocationWeight c L r jStar x (log E) take) : E/L^88 ≤ (candidateAllocatedFactor c L r jStar x take : ℝ) ∧ (candidateAllocatedFactor c L r jStar x take : ℝ) ≤ E := by apply candidate_allocation_size_range hc hL hlog (zero_lt_one.trans_le hE1) hE1 hr x _ take hweight have hi := candidate_allocation_inventory_of_product_bounds c L r jStar P (by omega) hj x B H htotal hretained linarith theorem candidate_allocation_good_tuple_range {c L E b : ℝ} (hc : 0 < c) (hL : 0 < L) (hlog : 0 < log L) (hb : 0 ≤ b) (hE1 : 1 ≤ E) {r jStar P : ℕ} (hr : 6 ≤ r) (hj : jStar ∈ candidateQIndices c L) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (htotal : exp L ≤ (P*orderedSlotProduct (candidateQSlotChoices c L r jStar) x : ℕ)) (hretained : (P*(x (candidateRoughSlot c L r jStar (by omega) hj)).val : ℕ) ≤ exp (b/2*L)) (hE : log E ≤ (1-b)*L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hweight : 0 < candidateAllocationWeight c L r jStar x (log E) take) : E/L^88 ≤ (candidateAllocatedFactor c L r jStar x take : ℝ) ∧ (candidateAllocatedFactor c L r jStar x take : ℝ) ≤ E := by apply candidate_allocation_size_range_of_product_bounds hc hL hlog hE1 hr hj x htotal hretained _ take hweight nlinarith [mul_nonneg hb hL.le] end Bounty end section /- The same discarded-part estimate for ordinary divisor sums with rough support. -/ open Finset Filter Real namespace Bounty theorem rough_supported_divisor_test_eq (W : ℝ) (n : ℕ) (F : ℕ → ℂ) (hF : ∀ m ∈ n.divisors, ¬(∀ p ∈ m.primeFactors, W ≤ (p : ℝ)) → F m = 0) : (∑ m ∈ n.divisors, F m) = ∑ m ∈ roughDivisors W n, F m := by classical symm apply sum_subset (filter_subset _ _) intro m hm hnot apply hF m hm intro hrough exact hnot (mem_filter.mpr ⟨hm,hrough⟩) end Bounty end section /- The explicit high-rank cutoff also preserves the low-rank power saving. -/ open Finset Classical Filter namespace Bounty theorem eventually_birthForest_low_rank_power_saving {a c C E G Cv Ca M Ch : ℝ} (ha : 0 < a) (hc : 0 < c) (hC : 0 ≤ C) (hE : 0 ≤ E) (hM : 0 ≤ M) (hD : 0 ≤ G + Ca + M) (hgain : E + Cv + 1 ≤ G) : ∀ᶠ L : ℝ in atTop, ∀ N m : ℕ, L ^ a ≤ (N : ℝ) → ∀ b H : ℝ, L ^ c ≤ b → (m : ℝ) ≤ L ^ M → 0 ≤ H → H ≤ L ^ Ch → ∀ F : BirthForestCode m → ℂ, let r := Nat.ceil (((2 * C + E + 1) * N * Real.log L) / b) (∀ code, birthForestRank code < r → ‖F code‖ ≤ H * L ^ ((-G + Cv) * N + Cv + 2 * birthForestRank code * (G + Ca))) → ‖∑ code ∈ (univ : Finset (BirthForestCode m)).filter (fun code => birthForestRank code < r), (-1 : ℂ) ^ birthForestRank code * F code‖ ≤ L ^ (-(E * N)) := by let D := G + Ca + M let ε := 1 / (4 * (D + 1)) have hD0 : 0 ≤ D := hD have hε : 0 < ε := by dsimp [ε]; positivity have hK : 0 ≤ 2 * C + E + 1 := by positivity have hratio : 2 * ε * D ≤ 1 / 2 := by have heq : 4 * (D + 1) * ε = 1 := by dsimp [ε] field_simp nlinarith filter_upwards [eventually_ge_atTop (2 : ℝ), (tendsto_rpow_atTop ha).eventually_ge_atTop (2 * (Cv + Ch + M + 1)), eventually_forest_rank_cutoff_small ha hc hε hK] with L hL hfixed hsmall intro N m hN b H hb hm hH hHb F dsimp only intro hF have hL0 : 0 < L := by linarith have hNr : (0 : ℝ) < N := (Real.rpow_pos_of_pos hL0 a).trans_le hN have hrr := (div_le_iff₀ hNr).mp (hsmall N hN b hb) apply birthForest_low_rank_power_saving F _ N (G := G) (Cv := Cv) (Ca := Ca) (M := M) (Ch := Ch) (E := E) hL hH hM hD hm hHb · linarith · have hrD := mul_le_mul_of_nonneg_right hrr hD0 have hNratio := mul_le_mul_of_nonneg_right hratio hNr.le dsimp only [D] at hrD hNratio nlinarith · exact hgain · exact hF end Bounty end section /- Signed full-edge actions preserve pending-memory symmetry when their coefficients respect the actual event reindexing. Active endpoints, auxiliary choices, storage/promotion slots and fresh labels satisfy this condition. -/ open Finset Classical namespace Bounty abbrev EdgeDrawObservation (P : Type*) (t : ℕ) := Σ _stores : Finset (Fin t), Σ promotions : Finset (Fin t), UnrestrictedFreshLabels P promotions section variable {G : Type*} [Fintype G] [dG : DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) {R : Type*} (σ : ∀ c, A c → R ≃ R) end end Bounty end section /- The candidate's remaining logarithmic inventory is bounded by a geometric band sum. -/ open Finset Real namespace Bounty theorem candidate_band_suffix_scale_sum_le {c L : ℝ} (hcL : 0 ≤ c*L) (b : ℕ) : (∑ j ∈ (candidateQIndices c L).filter (fun j => b ≤ j), c*L/2^j) ≤ 2*(c*L/2^b) := by let J := ⌊log (c*L/(20*log L))/log 2⌋₊ have hsubset : (candidateQIndices c L).filter (fun j => b ≤ j) ⊆ Ico b (J+1) := by intro j hj obtain ⟨hjQ,hbj⟩ := mem_filter.mp hj exact mem_Ico.mpr ⟨hbj,Nat.lt_succ_of_le (mem_Icc.mp hjQ).2⟩ have he (j : ℕ) : c*L/(2 : ℝ)^j = (c*L)*(1/2 : ℝ)^j := by rw [div_pow, one_pow] ring calc _ ≤ ∑ j ∈ Ico b (J+1), c*L/2^j := sum_le_sum_of_subset_of_nonneg hsubset (fun j _ _ => div_nonneg hcL (by positivity)) _ = (c*L)*∑ j ∈ Ico b (J+1), (1/2 : ℝ)^j := by simp_rw [he]; rw [mul_sum] _ ≤ (c*L)*((1/2 : ℝ)^b/(1-1/2)) := mul_le_mul_of_nonneg_left (geom_sum_Ico_le_of_lt_one (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num)) hcL _ = 2*(c*L/2^b) := by rw [he b]; ring theorem candidate_allocation_band_monotone {c L : ℝ} {r : ℕ} {i j : Fin ((candidateQIndices c L).card*r)} (hij : i ≤ j) : (candidateAllocationOrder c L r i).1.val ≤ (candidateAllocationOrder c L r j).1.val := by by_contra h have hh := candidate_allocation_band_strict (Nat.lt_of_not_ge h) exact (not_lt_of_ge hij) hh theorem candidate_allocation_suffix_scales {c L : ℝ} (hcL : 0 ≤ c*L) (r b : ℕ) : (∑ i : Fin ((candidateQIndices c L).card*r), if b ≤ (candidateAllocationOrder c L r i).1.val then c*L/2^(candidateAllocationOrder c L r i).1.val else 0) ≤ 2*(r : ℝ)*(c*L/2^b) := by classical calc _ = ∑ slot : (candidateQIndices c L) × Fin r, if b ≤ slot.1.val then c*L/2^slot.1.val else 0 := Fintype.sum_equiv (candidateAllocationOrder c L r) _ _ (fun _ => rfl) _ = (r : ℝ)*∑ j : candidateQIndices c L, if b ≤ j.val then c*L/2^j.val else 0 := by rw [Fintype.sum_prod_type] simp only [sum_const, card_univ, Fintype.card_fin, nsmul_eq_mul] rw [mul_sum] _ = (r : ℝ)*∑ j ∈ (candidateQIndices c L).filter (fun j => b ≤ j), c*L/2^j := by rw [sum_filter] congr 1 exact sum_coe_sort (candidateQIndices c L) (fun j => if b ≤ j then c*L/2^j else 0) _ ≤ (r : ℝ)*(2*(c*L/2^b)) := mul_le_mul_of_nonneg_left (candidate_band_suffix_scale_sum_le hcL b) (Nat.cast_nonneg r) _ = _ := by ring theorem candidate_allocation_suffix_inventory_le {c L : ℝ} (hcL : 0 ≤ c*L) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (i : Fin ((candidateQIndices c L).card*r)) : allocationSuffixInventory (fun k => log (candidateAllocationValue c L r jStar x k)) (candidateAllocationActive c L r jStar) i ≤ (12/5 : ℝ)*(r : ℝ)*(c*L/2^(candidateAllocationOrder c L r i).1.val) := by let b := (candidateAllocationOrder c L r i).1.val calc _ ≤ (6/5 : ℝ)*(∑ k : Fin ((candidateQIndices c L).card*r), if b ≤ (candidateAllocationOrder c L r k).1.val then c*L/2^(candidateAllocationOrder c L r k).1.val else 0) := by unfold allocationSuffixInventory rw [mul_sum] apply sum_le_sum intro k hk by_cases h : i ≤ k ∧ candidateAllocationActive c L r jStar k = true · rw [if_pos h, if_pos (candidate_allocation_band_monotone h.1)] have hv := (candidate_Q_slot_log_bounds c L r jStar (candidateAllocationOrder c L r k) (x _).property).2 simpa only [candidateAllocationValue, mul_div_assoc] using hv · rw [if_neg h] positivity _ ≤ (6/5 : ℝ)*(2*(r : ℝ)*(c*L/2^b)) := mul_le_mul_of_nonneg_left (candidate_allocation_suffix_scales hcL r b) (by norm_num) _ = _ := by dsimp [b]; ring end Bounty end section open MeasureTheory namespace Bounty theorem typeII_pulled_fourier_moment_polynomial {A : ℝ} (hA : 0 ≤ A) (M : ℕ) : ∃ (d : ℕ) (C : ℝ), 0 ≤ C ∧ ∀ p : Fin 4 → ℝ, (∫ ξ : EuclideanSpace ℝ (Fin 3), ‖ξ‖ ^ M * ‖typeIIPulledFourier A (p 0) (p 1) (p 2) (p 3) ξ‖) ≤ C * (1 + ‖p‖) ^ d := by obtain ⟨R, hR, hs⟩ := typeII_pulled_support_radius A exact fourier_moment_polynomial_of_fixed_support (fun p : Fin 4 → ℝ => typeIIPulledSchwartz A (p 0) (p 1) (p 2) (p 3)) (fun p => 1 + ‖p‖) (fun p => by linarith [norm_nonneg p]) R hR hs (typeII_pulled_derivative_polynomial_bound hA) M theorem typeII_pulled_fourier_l1_polynomial {A : ℝ} (hA : 0 ≤ A) : ∃ (d : ℕ) (C : ℝ), 0 ≤ C ∧ ∀ p : Fin 4 → ℝ, (∫ ξ : EuclideanSpace ℝ (Fin 3), ‖typeIIPulledFourier A (p 0) (p 1) (p 2) (p 3) ξ‖) ≤ C * (1 + ‖p‖) ^ d := by simpa only [pow_zero, one_mul] using typeII_pulled_fourier_moment_polynomial hA 0 theorem typeII_pulled_fourier_tail_polynomial {A : ℝ} (hA : 0 ≤ A) (M : ℕ) : ∃ (d : ℕ) (C : ℝ), 0 < C ∧ ∀ (p : Fin 4 → ℝ) (R : ℝ), 0 < R → (∫ ξ in {ξ : EuclideanSpace ℝ (Fin 3) | R < ‖ξ‖}, ‖typeIIPulledFourier A (p 0) (p 1) (p 2) (p 3) ξ‖) ≤ C * (1 + ‖p‖) ^ d * R ^ (-(M : ℝ)) := by obtain ⟨d, C, hC, hb⟩ := typeII_pulled_fourier_moment_polynomial hA M refine ⟨d, C + 1, by linarith, ?_⟩ intro p R hR calc _ ≤ (∫ ξ : EuclideanSpace ℝ (Fin 3), ‖ξ‖^M * ‖typeIIPulledFourier A (p 0) (p 1) (p 2) (p 3) ξ‖) / R^M := euclidean_schwartz_norm_tail_le_moment _ M hR _ ≤ (C * (1 + ‖p‖)^d) / R^M := div_le_div_of_nonneg_right (hb p) (pow_nonneg hR.le M) _ ≤ ((C + 1) * (1 + ‖p‖)^d) / R^M := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right (by linarith) (by positivity)) (pow_nonneg hR.le M) _ = _ := by rw [Real.rpow_neg hR.le, Real.rpow_natCast, div_eq_mul_inv] noncomputable def typeIIPulledFourierIntegrand (A q a b c : ℝ) (t ξ : EuclideanSpace ℝ (Fin 3)) : ℂ := Complex.exp (((2 * Real.pi * inner ℝ ξ t : ℝ) : ℂ) * Complex.I) * typeIIPulledFourier A q a b c ξ theorem typeII_pulled_fourier_integrand_norm (A q a b c : ℝ) (t ξ : EuclideanSpace ℝ (Fin 3)) : ‖typeIIPulledFourierIntegrand A q a b c t ξ‖ = ‖typeIIPulledFourier A q a b c ξ‖ := by rw [typeIIPulledFourierIntegrand, norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul] theorem typeII_pulled_fourier_integrand_integrable (A q a b c : ℝ) (t : EuclideanSpace ℝ (Fin 3)) : Integrable (typeIIPulledFourierIntegrand A q a b c t) := by have hc : Continuous (typeIIPulledFourierIntegrand A q a b c t) := by unfold typeIIPulledFourierIntegrand apply Continuous.mul · fun_prop · exact (typeIIPulledFourier A q a b c).continuous apply (typeII_pulled_fourier_integrable A q a b c).norm.mono' hc.aestronglyMeasurable exact Filter.Eventually.of_forall (fun ξ => (typeII_pulled_fourier_integrand_norm A q a b c t ξ).le) theorem typeII_pulled_fourier_truncation_le_tail (A q a b c R : ℝ) (t : EuclideanSpace ℝ (Fin 3)) : ‖(typeIIPulledCutoff A q a b c t : ℂ) - ∫ ξ in {ξ : EuclideanSpace ℝ (Fin 3) | ‖ξ‖ ≤ R}, typeIIPulledFourierIntegrand A q a b c t ξ‖ ≤ ∫ ξ in {ξ : EuclideanSpace ℝ (Fin 3) | R < ‖ξ‖}, ‖typeIIPulledFourier A q a b c ξ‖ := by have hs : MeasurableSet {ξ : EuclideanSpace ℝ (Fin 3) | ‖ξ‖ ≤ R} := (isClosed_le continuous_norm continuous_const).measurableSet have heq : {ξ : EuclideanSpace ℝ (Fin 3) | ‖ξ‖ ≤ R}ᶜ = {ξ : EuclideanSpace ℝ (Fin 3) | R < ‖ξ‖} := by ext ξ; simp rw [typeII_pulled_fourier_inversion] change ‖(∫ ξ : EuclideanSpace ℝ (Fin 3), typeIIPulledFourierIntegrand A q a b c t ξ) - _‖ ≤ _ rw [← setIntegral_compl hs (typeII_pulled_fourier_integrand_integrable A q a b c t), heq] apply (norm_integral_le_integral_norm _).trans exact le_of_eq (integral_congr_ae (Filter.Eventually.of_forall (fun ξ => typeII_pulled_fourier_integrand_norm A q a b c t ξ))) theorem typeII_pulled_fourier_truncation_polynomial {A : ℝ} (hA : 0 ≤ A) (M : ℕ) : ∃ (d : ℕ) (C : ℝ), 0 < C ∧ ∀ (p : Fin 4 → ℝ) (R : ℝ), 0 < R → ∀ t : EuclideanSpace ℝ (Fin 3), ‖(typeIIPulledCutoff A (p 0) (p 1) (p 2) (p 3) t : ℂ) - ∫ ξ in {ξ : EuclideanSpace ℝ (Fin 3) | ‖ξ‖ ≤ R}, typeIIPulledFourierIntegrand A (p 0) (p 1) (p 2) (p 3) t ξ‖ ≤ C * (1 + ‖p‖) ^ d * R ^ (-(M : ℝ)) := by obtain ⟨d, C, hC, hb⟩ := typeII_pulled_fourier_tail_polynomial hA M exact ⟨d, C, hC, fun p R hR t => (typeII_pulled_fourier_truncation_le_tail A (p 0) (p 1) (p 2) (p 3) R t).trans (hb p R hR)⟩ end Bounty end section /- Full absolute factorization mass with the original candidate coefficient. -/ open Finset Filter Real namespace Bounty theorem exists_candidate_divisor_test_absolute_bound {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (A : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (F : ℕ → ℕ → ℂ), (∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → (∑ u ∈ arithmeticProductWindow 1 (exp L), candidateCoefficient c L q r jStar u * ∑ m ∈ (2*u+1).divisors, ‖F u m‖) ≤ exp L * L^C := by obtain ⟨K,hK,hcoef⟩ := exists_candidate_coefficient_divisor_bound hc hr hq0 hq1 refine ⟨K+|A|+16, by positivity, ?_⟩ filter_upwards [hcoef, eventually_arithmetic_window_divisor_cross_mass, eventually_ge_atTop (1 : ℝ)] with L hcoeff hmass hL intro jStar F hF have hL0 : 0 < L := zero_lt_one.trans_le hL have hsum : (∑ u ∈ arithmeticProductWindow 1 (exp L), candidateCoefficient c L q r jStar u * ∑ m ∈ (2*u+1).divisors, ‖F u m‖) ≤ L^(K+|A|) * ∑ u ∈ arithmeticProductWindow 1 (exp L), (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ) := by rw [mul_sum] apply sum_le_sum intro u hu have hu0 : u ≠ 0 := by have hh := ((mem_arithmeticProductWindow_iff one_ne_zero (exp L)).mp hu).1 intro heq simp only [heq, mul_zero, Nat.cast_zero] at hh exact (exp_pos L).not_gt hh let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) have hdiv : primePoolFreePart P u ∣ u := ⟨primePoolPart P u, by simpa only [Nat.mul_comm] using (primePoolPart_mul_primePoolFreePart P u).symm⟩ have hcard : ((primePoolFreePart P u).divisors.card : ℝ) ≤ (u.divisors.card : ℝ) := by exact_mod_cast card_le_card (Nat.divisors_subset_of_dvd hu0 hdiv) have hcU : candidateCoefficient c L q r jStar u ≤ L^K*(u.divisors.card : ℝ) := (hcoeff jStar u).2.trans (mul_le_mul_of_nonneg_left hcard (rpow_nonneg hL0.le _)) have hinner : (∑ m ∈ (2*u+1).divisors, ‖F u m‖) ≤ ((2*u+1).divisors.card : ℝ)*L^|A| := by calc _ ≤ ∑ _m ∈ (2*u+1).divisors, L^|A| := sum_le_sum (fun m hm => (hF u hu m hm).trans (rpow_le_rpow_of_exponent_le hL (le_abs_self A))) _ = _ := by simp calc _ ≤ (L^K*(u.divisors.card : ℝ))*(((2*u+1).divisors.card : ℝ)*L^|A|) := mul_le_mul hcU hinner (sum_nonneg (fun _ _ => norm_nonneg _)) (by positivity) _ = _ := by rw [rpow_add hL0]; ring calc _ ≤ L^(K+|A|) * ∑ u ∈ arithmeticProductWindow 1 (exp L), (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ) := hsum _ ≤ L^(K+|A|) * (exp L*L^(16 : ℝ)) := mul_le_mul_of_nonneg_left hmass (rpow_nonneg hL0.le _) _ = exp L*L^(K+|A|+16) := by rw [rpow_add hL0 (K+|A|) 16]; ring end Bounty end section /- The full retained coefficient has a uniform polynomial-divisor bound. -/ open Finset Filter namespace Bounty theorem exists_candidate_retained_divisor_bound {c q : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) : ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card * r) → Bool) (_hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ), (∀ slot p, p ∈ candidateQSlotChoices c L r jStar slot → ‖twist slot p‖ ≤ 1) → ∀ h : ℕ, h ≠ 0 → ‖candidateRetainedComplexCoefficient c L q r jStar take twist h‖ ≤ L ^ C * (h.divisors.card : ℝ) := by obtain ⟨C, hC, hW⟩ := exists_candidate_marked_weight_rpow_bound hc hq0 hq1 refine ⟨C, hC, ?_⟩ filter_upwards [hW, eventually_ge_atTop (0 : ℝ)] with L hW hL intro r jStar hr hj take hkeep twist htwist h hh let P := (candidatePIndices c L).biUnion (candidatePBand (c * L)) have hres := norm_candidate_remaining_coefficient_le_divisors (mul_nonneg hc.le hL) hr hj take hkeep twist htwist (primePoolFreePart P h) (primePoolFreePart_ne_zero P hh) have hsub : (primePoolFreePart P h).divisors ⊆ h.divisors := Nat.divisors_subset_of_dvd hh (Nat.div_dvd_of_dvd (primePoolPart_dvd P h)) have hcard : ((primePoolFreePart P h).divisors.card : ℝ) ≤ h.divisors.card := by exact_mod_cast card_le_card hsub unfold candidateRetainedComplexCoefficient rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hW (h : ℤ)).1] exact mul_le_mul (hW (h : ℤ)).2 (hres.trans hcard) (norm_nonneg _) (Real.rpow_nonneg hL _) end Bounty end section /- Arbitrary logarithmic saving for divisor mass in the two boundary layers. -/ open Finset Filter Real namespace Bounty theorem eventually_boundary_scale (B : ℝ) (hB : 1 ≤ B) : ∀ᶠ L : ℝ in atTop, 1 ≤ L ∧ L^(-B) ≤ 1/2 ∧ 1 ≤ exp L * L^(-B) := by filter_upwards [eventually_rpow_le_exp_sqrt B, eventually_ge_atTop (2 : ℝ)] with L hpow hL have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hsqrt : sqrt L ≤ L := sqrt_le_iff.mpr ⟨hL0.le, by nlinarith⟩ have he : L^B ≤ exp L := hpow.trans (exp_le_exp.mpr hsqrt) refine ⟨hL1, ?_, ?_⟩ · calc L^(-B) ≤ L^(-1 : ℝ) := rpow_le_rpow_of_exponent_le hL1 (by linarith) _ = 1/L := by rw [rpow_neg_one, one_div] _ ≤ 1/2 := (div_le_div_iff₀ hL0 (by norm_num)).mpr (by linarith) · have hh := mul_le_mul_of_nonneg_right he (rpow_nonneg hL0.le (-B)) rwa [← rpow_add hL0, add_neg_cancel, rpow_zero] at hh theorem eventually_typeII_boundary_divisor_mass (B D : ℝ) (hB : 1 ≤ B) (hBD : 2*D+17 ≤ B) : ∀ᶠ L : ℝ in atTop, (∑ u ∈ typeIIBoundaryWindow (exp L) (L^(-B)), (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ)) ≤ exp L * L^(-D) := by filter_upwards [eventually_boundary_scale B hB, eventually_ge_atTop (6 : ℝ), eventually_ge_atTop (35*(2+log 35)^15 : ℝ)] with L hscale hL6 hK have hL0 : 0 < L := by linarith [hscale.1] have hE : 1 ≤ exp L := one_le_exp hL0.le have hδ : 0 ≤ L^(-B) := rpow_nonneg hL0.le _ let S := typeIIBoundaryWindow (exp L) (L^(-B)) let N : ℕ := ⌊35*exp L⌋₊ have hN0 : 0 < N := Nat.floor_pos.mpr (by linarith) have hNpos : (0 : ℝ) < N := by exact_mod_cast hN0 have hNle : (N : ℝ) ≤ 35*exp L := Nat.floor_le (by positivity) have hlog : 1+log N ≤ (2+log 35)*L := by have hh := log_le_log hNpos hNle rw [log_mul (by norm_num : (35 : ℝ) ≠ 0) (exp_ne_zero L), log_exp] at hh have h35 : 0 ≤ log 35 := log_nonneg (by norm_num) nlinarith [hscale.1] have hmoment : (N : ℝ)*(1+log N)^15 ≤ exp L*L^(16 : ℝ) := by calc _ ≤ (35*exp L)*((2+log 35)*L)^15 := mul_le_mul hNle (pow_le_pow_left₀ (by positivity) hlog 15) (by positivity) (by positivity) _ = (35*(2+log 35)^15)*exp L*L^15 := by rw [mul_pow]; ring _ ≤ L*exp L*L^15 := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hK (exp_pos _).le) (pow_nonneg hL0.le _) _ = exp L*L^(16 : ℝ) := by norm_num only [rpow_ofNat]; ring have hcard : (S.card : ℝ) ≤ exp L * L^(-B+1) := by have hc := typeII_boundary_window_card_le hE hδ hscale.2.1 calc _ ≤ 4*L^(-B)*exp L+2 := hc _ ≤ 6*(exp L*L^(-B)) := by nlinarith [hscale.2.2] _ ≤ L*(exp L*L^(-B)) := mul_le_mul_of_nonneg_right hL6 (by positivity) _ = exp L*L^(-B+1) := by rw [rpow_add hL0, rpow_one]; ring have hmass := shifted_divisor_subset_concentration S N (by intro u hu have huhi := (mem_typeII_boundary_window_bounds hE hδ hscale.2.1 hu).2 apply Nat.le_floor push_cast linarith) apply hmass.trans rw [← sqrt_mul (Nat.cast_nonneg S.card)] apply (sqrt_le_iff).mpr refine ⟨by positivity, ?_⟩ calc (S.card : ℝ)*((N : ℝ)*(1+log N)^15) ≤ (exp L*L^(-B+1))*(exp L*L^(16 : ℝ)) := mul_le_mul hcard hmoment (by positivity) (by positivity) _ = (exp L)^2 * L^(17-B) := by rw [show 17-B = (-B+1)+16 by ring, rpow_add hL0 (-B+1) 16]; ring _ ≤ (exp L)^2 * L^(-D+-D) := mul_le_mul_of_nonneg_left (rpow_le_rpow_of_exponent_le hscale.1 (by linarith)) (sq_nonneg _) _ = (exp L*L^(-D))^2 := by rw [rpow_add hL0]; ring end Bounty end section /- Divisible endpoint energy persists after a shift divisible by the same divisor. -/ open Finset namespace Bounty theorem invariant_triple_endpoint_shifted_divisible_energy (Q : Finset ℕ) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (S : Finset ℤ) (δ : ℤ) (d N : ℕ) (hd : d ∈ Nat.factoredNumbers Q) (hδ : (d : ℤ) ∣ δ) (hdiv : ∀ n ∈ S, (d : ℤ) ∣ n) (hS : ∀ n ∈ S, 0 ≤ n + δ ∧ n + δ ≤ (N : ℤ)) : (∑ n ∈ S, ‖invariantTripleEndpoint Q α β γ (n + δ).natAbs‖ ^ 2) ≤ (A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 / d := by classical have h := invariant_triple_endpoint_int_divisible_energy Q α β γ hA hB hC hα hβ hγ (S.image (fun n => n + δ)) d N hd (by intro m hm obtain ⟨n, hn, rfl⟩ := mem_image.mp hm exact Int.natCast_dvd.mp (dvd_add (hdiv n hn) hδ)) (by intro m hm obtain ⟨n, hn, rfl⟩ := mem_image.mp hm exact hS n hn) rw [sum_image] at h · exact h · intro a _ b _ hab exact add_right_cancel hab end Bounty end section /- The source modulation and shifted edge phase reproduce one Mellin character. -/ namespace Bounty noncomputable def physicalMellinSource (X Z v : ℝ) (f : ℤ → ℂ) (n : ℤ) : ℂ := ((X / (n : ℝ) : ℝ) : ℂ) * physicalMellinPhase (-v) ((n : ℝ) / Z) * f n theorem physical_bare_pattern_phase_shift {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (ζ v : ℝ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) : physicalBarePatternScalar V C (ζ - v) K aux L R = physicalBarePatternScalar V C ζ K aux L R * physicalPhase (-v) (physicalD C L aux) := by classical unfold physicalBarePatternScalar split_ifs · rw [sub_eq_add_neg, physical_phase_add] ring · exact (zero_mul _).symm theorem physical_mellin_source_edge {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (ζ v X Z : ℝ) (hZ : Z ≠ 0) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) (hD : physicalD C L aux ≠ 0) (f : ℤ → ℂ) (n : ℤ) (hn : n ≠ 0) : (starRingEnd ℂ) (physicalMellinSource X Z v f n) * physicalBarePatternScalar V C (ζ - v) K aux L R = (X : ℂ) * physicalMellinPhase v ((n : ℝ) / (Z * physicalD C L aux)) * ((n : ℂ)⁻¹ * (starRingEnd ℂ) (f n) * physicalBarePatternScalar V C ζ K aux L R) := by have hn' : (n : ℝ) ≠ 0 := by exact_mod_cast hn simp only [physicalMellinSource, map_mul, Complex.conj_ofReal, physical_mellin_phase_conj, neg_neg, physical_bare_pattern_phase_shift] calc _ = (X : ℂ) * (physicalMellinPhase v ((n : ℝ) / Z) * physicalPhase (-v) (physicalD C L aux)) * ((n : ℂ)⁻¹ * (starRingEnd ℂ) (f n) * physicalBarePatternScalar V C ζ K aux L R) := by push_cast ring _ = _ := by rw [physical_mellin_phase_ratio v (n : ℝ) Z _ hn' hZ hD] theorem physical_mellin_source_zero (X Z v : ℝ) (f : ℤ → ℂ) (n : ℤ) (hf : f n = 0) : physicalMellinSource X Z v f n = 0 := by simp only [physicalMellinSource, hf, mul_zero] end Bounty end section /- Finite-sum interchange for an explicitly normalized logarithmic Fourier representation. -/ open Finset MeasureTheory namespace Bounty section variable {A : Type*} (s : Finset A) (ρ : ℝ → ℂ) (ν : ℝ → ℝ) (hρ : Integrable ρ) (hν : Continuous ν) (c : A → ℂ) (t : A → ℝ) include A s ρ ν hρ hν c t theorem finite_mellin_sum_integrable : Integrable (fun v => ρ v * ∑ a ∈ s, c a * physicalMellinPhase (ν v) (t a)) := by simp_rw [mul_sum] apply integrable_finsetSum intro a _ apply ((physical_mellin_phase_integrable ρ ν hρ hν (t a)).mul_const (c a)).congr exact Filter.Eventually.of_forall (fun v => by ring) theorem finite_mellin_sum_representation (Ψ : ℝ → ℂ) (hΨ : ∀ a ∈ s, c a ≠ 0 → Ψ (t a) = ∫ v : ℝ, ρ v * physicalMellinPhase (ν v) (t a)) : (∑ a ∈ s, c a * Ψ (t a)) = ∫ v : ℝ, ρ v * ∑ a ∈ s, c a * physicalMellinPhase (ν v) (t a) := by have hi : ∀ a ∈ s, Integrable (fun v => ρ v * (c a * physicalMellinPhase (ν v) (t a))) := by intro a _ apply ((physical_mellin_phase_integrable ρ ν hρ hν (t a)).mul_const (c a)).congr exact Filter.Eventually.of_forall (fun v => by ring) simp_rw [mul_sum] rw [integral_finsetSum s hi] apply sum_congr rfl intro a ha by_cases hc : c a = 0 · simp only [hc, zero_mul, mul_zero, integral_zero] rw [hΨ a ha hc, ← integral_const_mul] apply integral_congr_ae exact Filter.Eventually.of_forall (fun v => by ring) end end Bounty end section /- Finite indexing of the literal physical edge sum, including every original guard. -/ open Finset namespace Bounty abbrev PhysicalMellinAtom {G I : Type*} [Fintype G] (P : G → Finset ℕ) (J ell : ℕ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (positions : Finset ℤ) := Σ _x : physicalCutoff P J ell positions, Σ _y : physicalCutoff P J ell positions, Σ i : patterns, PhysicalAuxLabels P (C i.val) noncomputable def physicalMellinAtomCoefficient {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (f g : ℤ → ℂ) (a : PhysicalMellinAtom P J ell patterns C positions) : ℂ := by classical let x := a.1.val let y := a.2.1.val let i := a.2.2.1.val let aux := a.2.2.2 exact if y.1 = x.1 + k i * (physicalD (C i) x.2.val aux : ℕ) then (x.1 : ℂ)⁻¹ * (starRingEnd ℂ) (f x.1) * physicalBarePatternScalar V (C i) (ζ i) (K i) aux x.2.val y.2.val * g y.1 * ((physicalVertexWeight x.2.val q x.1 * physicalVertexWeight y.2.val q y.1 : ℝ) : ℂ) else 0 noncomputable def physicalMellinAtomArgument {G I : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} {patterns : Finset I} {C : I → G → Finset (Fin J)} {positions : Finset ℤ} (Z : ℝ) (a : PhysicalMellinAtom P J ell patterns C positions) : ℝ := (a.1.val.1 : ℝ) / (Z * physicalD (C a.2.2.1.val) a.1.val.2.val a.2.2.2) theorem physical_mellin_atom_sum {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (patterns : Finset I) (C : I → G → Finset (Fin J)) (positions : Finset ℤ) (F : PhysicalState P J ell → PhysicalState P J ell → ∀ i, PhysicalAuxLabels P (C i) → ℂ) : (∑ a : PhysicalMellinAtom P J ell patterns C positions, F a.1.val a.2.1.val a.2.2.1.val a.2.2.2) = ∑ x ∈ physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, ∑ i ∈ patterns, ∑ aux : PhysicalAuxLabels P (C i), F x y i aux := by classical simp only [Fintype.sum_sigma] rw [sum_coe_sort (physicalCutoff P J ell positions) (fun x => ∑ y : physicalCutoff P J ell positions, ∑ i : patterns, ∑ aux : PhysicalAuxLabels P (C i.val), F x y.val i.val aux)] apply sum_congr rfl intro x _ rw [sum_coe_sort (physicalCutoff P J ell positions) (fun y => ∑ i : patterns, ∑ aux : PhysicalAuxLabels P (C i.val), F x y i.val aux)] apply sum_congr rfl intro y _ exact sum_coe_sort patterns (fun i => ∑ aux : PhysicalAuxLabels P (C i), F x y i aux) theorem physical_mellin_atom_coefficient_zero {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (f g : ℤ → ℂ) (a : PhysicalMellinAtom P J ell patterns C positions) (hf : f a.1.val.1 = 0) : physicalMellinAtomCoefficient V patterns C q ζ k K positions f g a = 0 := by classical simp only [physicalMellinAtomCoefficient, hf, map_zero, mul_zero, zero_mul, ite_self] theorem physical_mellin_atom_argument_pos {G I : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} {patterns : Finset I} {C : I → G → Finset (Fin J)} {positions : Finset ℤ} {Z : ℝ} (hZ : 0 < Z) (hP : ∀ g p, p ∈ P g → 0 < p) (a : PhysicalMellinAtom P J ell patterns C positions) (hn : 0 < a.1.val.1) : 0 < physicalMellinAtomArgument Z a := by unfold physicalMellinAtomArgument have hD := physical_D_pos (C a.2.2.1.val) a.1.val.2.val a.2.2.2 hP exact div_pos (by exact_mod_cast hn) (mul_pos hZ (by exact_mod_cast hD)) end Bounty end section /- Exact signed path sums retain arbitrary whole-path phases under parameter transport. -/ open Finset open scoped Classical namespace Bounty section Action variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ Δ' D D' : ∀ k c, A k c → G → ℤ) (hΔ : ∀ k, Δ k = Δ' k) (hD : ∀ k c a g p, ((n g p : ℤ) ∣ D k c a g ↔ (n g p : ℤ) ∣ D' k c a g)) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) theorem full_permutation_parameter_path_action (steps : List (Option (J ⊕ K))) (phase : ∀ x, FullPermutationMixedPath n S B A Δ D steps x → ℂ) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) : fullPermutationMixedPathAction n S B A Δ D ω μ q ρ V steps phase f = fullPermutationMixedPathAction n S B A Δ' D' ω μ q ρ V steps (fun x p => phase x ((fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x).symm p)) f := by let _ : ∀ (tag : Option (J ⊕ K)) x, Fintype (FullPermutationMixedEvent n S B A Δ D tag x) := fullPermutationMixedEventFintype n S B A Δ D let _ : ∀ (tag : Option (J ⊕ K)) x, Fintype (FullPermutationMixedEvent n S B A Δ' D' tag x) := fullPermutationMixedEventFintype n S B A Δ' D' funext x let _ := finiteEventPathFintype (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x let _ := finiteEventPathFintype (FullPermutationMixedEvent n S B A Δ' D') (fullPermutationMixedEventTarget n S B A Δ' D') steps x unfold fullPermutationMixedPathAction finiteEventPathAction rw [← (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x).sum_comp] apply sum_congr rfl intro p _ rw [full_permutation_parameter_path_weight, full_permutation_parameter_path_terminal] simp only [Equiv.symm_apply_apply] end Action end Bounty end section /- A nonnegative coefficient deficit supported on a discarded set costs one tail. -/ open Finset namespace Bounty theorem norm_weighted_fiber_deficit_le (T : Finset ℕ) (fibers : ℕ → Finset ℕ) (bad : ℕ → Prop) [DecidablePred bad] (a d : ℕ → ℝ) (F : ℕ → ℕ → ℂ) (M : ℝ) (hM : 0 ≤ M) (hd : ∀ u ∈ T, 0 ≤ d u) (hda : ∀ u ∈ T, d u ≤ a u) (heq : ∀ u ∈ T, ¬bad u → d u = a u) (hF : ∀ u ∈ T, ∀ m ∈ fibers u, ‖F u m‖ ≤ M) : ‖(∑ u ∈ T, (a u : ℂ)*∑ m ∈ fibers u, F u m) - ∑ u ∈ T, (d u : ℂ)*∑ m ∈ fibers u, F u m‖ ≤ M*(∑ u ∈ T.filter bad, a u*((fibers u).card : ℝ)) := by have hs : (∑ u ∈ T, (a u : ℂ)*∑ m ∈ fibers u, F u m) - (∑ u ∈ T, (d u : ℂ)*∑ m ∈ fibers u, F u m) = ∑ u ∈ T.filter bad, ((a u-d u : ℝ) : ℂ)*∑ m ∈ fibers u, F u m := by rw [← sum_sub_distrib, sum_filter] apply sum_congr rfl intro u hu by_cases hb : bad u · simp only [hb, if_true, Complex.ofReal_sub] ring · simp only [hb, if_false, heq u hu hb, sub_self] rw [hs] apply (norm_weighted_finite_fibers_le (T.filter bad) fibers (fun u => a u-d u) F M (fun u hu => sub_nonneg.mpr (hda u (mem_filter.mp hu).1)) (fun u hu => hF u (mem_filter.mp hu).1)).trans apply mul_le_mul_of_nonneg_left _ hM apply sum_le_sum intro u hu exact mul_le_mul_of_nonneg_right (sub_le_self _ (hd u (mem_filter.mp hu).1)) (Nat.cast_nonneg _) end Bounty end section /- Actual polynomial derivative bounds in the inverse smoothing width. -/ namespace Bounty theorem typeII_window_schwartz_tsupport_subset (r : ℝ) : tsupport (typeIIWindowLogSchwartz r) ⊆ tsupport typeIIWindowLogLocalizer := by apply (tsupport_comp_subset (g := fun x : ℝ => (x : ℂ)) (by simp) (typeIIWindowLogCutoff r)).trans exact tsupport_mul_subset_left.trans tsupport_mul_subset_left theorem typeII_window_support_radius : ∃ R : ℝ, 0 ≤ R ∧ ∀ r : ℝ, tsupport (typeIIWindowLogSchwartz r) ⊆ Metric.closedBall 0 R := by obtain ⟨R, hR⟩ := typeII_window_log_localizer_hasCompactSupport.isCompact.isBounded.subset_closedBall 0 refine ⟨max R 0, le_max_right _ _, ?_⟩ intro r exact (typeII_window_schwartz_tsupport_subset r).trans (hR.trans (Metric.closedBall_subset_closedBall (le_max_left _ _))) theorem typeII_window_derivative_polynomial_bound (n : ℕ) : ∃ (d : ℕ) (C : ℝ), 0 ≤ C ∧ ∀ r s : ℝ, ‖iteratedFDeriv ℝ n (typeIIWindowLogSchwartz r) s‖ ≤ C * (1 + |r|) ^ d := by have hG : Function.HasTemperateGrowth (fun y : ℝ × ℝ => (typeIIWindowLogJoint y : ℂ)) := Complex.ofRealCLM.hasTemperateGrowth.comp typeII_window_log_joint_hasTemperateGrowth obtain ⟨d, C, hC, hb⟩ := hG.norm_iteratedFDeriv_le_uniform n obtain ⟨R, hR0, hR⟩ := typeII_window_support_radius refine ⟨d, C * (1 + R) ^ d, mul_nonneg hC (pow_nonneg (by linarith) _), ?_⟩ intro r s by_cases hs : s ∈ Metric.closedBall 0 R · have hfun : (fun s : ℝ => (typeIIWindowLogJoint (r, s) : ℂ)) = (typeIIWindowLogSchwartz r : ℝ → ℂ) := by funext y change (typeIIWindowLogJoint (r, y) : ℂ) = (typeIIWindowLogCutoff r y : ℂ) rw [typeII_window_log_joint_eq] have hslice := norm_iteratedFDeriv_slice_le hG.1 r s n rw [hfun] at hslice have hsR : ‖s‖ ≤ R := mem_closedBall_zero_iff.mp hs have hbase : 1 + ‖(r, s)‖ ≤ (1 + R) * (1 + |r|) := by rw [Prod.norm_def, Real.norm_eq_abs] have hm : max |r| ‖s‖ ≤ |r| + R := max_le (by linarith) (by linarith [abs_nonneg r]) nlinarith [abs_nonneg r] calc _ ≤ C * (1 + ‖(r, s)‖) ^ d := hslice.trans (hb n le_rfl (r, s)) _ ≤ C * ((1 + R) * (1 + |r|)) ^ d := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (by positivity) hbase d) hC _ = _ := by rw [mul_pow]; ring · have hz : iteratedFDeriv ℝ n (typeIIWindowLogSchwartz r) s = 0 := by apply Function.notMem_support.mp intro ht exact hs (hR r (support_iteratedFDeriv_subset n ht)) rw [hz, norm_zero] positivity end Bounty end section /- Exact Mellin separation of the actual smooth product window. -/ open MeasureTheory namespace Bounty theorem typeII_window_mellin_phase {e h x : ℝ} (he : 0 < e) (hh : 0 < h) (hx : 0 < x) (ξ : ℝ) : Complex.exp (((2 * Real.pi * ξ * Real.log (e * h / x) : ℝ) : ℂ) * Complex.I) = (x : ℂ) ^ (-((2 * Real.pi * ξ : ℝ) : ℂ) * Complex.I) * (e : ℂ) ^ (((2 * Real.pi * ξ : ℝ) : ℂ) * Complex.I) * (h : ℂ) ^ (((2 * Real.pi * ξ : ℝ) : ℂ) * Complex.I) := by rw [Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr hx.ne'), Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr he.ne'), Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr hh.ne'), ← Complex.ofReal_log hx.le, ← Complex.ofReal_log he.le, ← Complex.ofReal_log hh.le, ← Complex.exp_add, ← Complex.exp_add, Real.log_div (mul_ne_zero he.ne' hh.ne') hx.ne', Real.log_mul he.ne' hh.ne'] congr 1 push_cast ring end Bounty end section /- Absolute candidate mass on a finite box containing the sharp product window. -/ open Finset Filter Real namespace Bounty end Bounty end section /- The actual small-mark extraction error is negligible on square multiples. -/ open Finset namespace Bounty theorem invariant_marked_prime_peel_error_energy {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (V : G → ℝ) (t : G → ℕ) (T : ℕ) (hV : ∀ g ∈ groups, v ≤ V g) (ht : ∀ g ∈ groups, t g ≤ T) (hprime : ∀ g ∈ groups, ∀ p ∈ P g, p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hg : g ∈ groups) (k : ℕ) (htg : t g = k + 1) (Q : Finset ℕ) (hQ : P g ⊆ Q) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (S : Finset ℕ) (N : ℕ) (hS : ∀ n ∈ S, 0 < n ∧ n ≤ N) : (∑ n ∈ S, ‖(markedDivisorWeight groups P q V t (n : ℤ) : ℂ) * invariantTripleEndpoint Q α β γ n - markedPrimePeel groups P q V t g k (invariantTripleEndpoint Q α β γ) n‖ ^ 2) ≤ ((markedDivisorBound q v T) ^ groups.card * (1 + 2 * Real.log N / v)) ^ 2 * (((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∑ p ∈ P g, 1 / (p : ℝ) ^ 2) := by have hsupport (p : ℕ) (hp : p ∈ P g) : p ∈ Nat.factoredNumbers Q := by apply Nat.mem_factoredNumbers_of_primeFactors_subset (hprime g hg p hp).ne_zero rw [(hprime g hg p hp).primeFactors] exact singleton_subset_iff.mpr (hQ hp) have hinvariant (n p : ℕ) (hp : p ∈ P g) (hpn : p ∣ n) : invariantTripleEndpoint Q α β γ (n / p) = invariantTripleEndpoint Q α β γ n := by have he := invariant_triple_endpoint_mul_supported (hsupport p hp) α β γ (n / p) rw [Nat.mul_div_cancel' hpn] at he exact he.symm apply invariant_triple_endpoint_square_error_energy Q (P g) α β γ hA hB hC hα hβ hγ hsupport S N (fun n hn => (hS n hn).2) · intro n _ hsq exact sub_eq_zero.mpr (marked_prime_peel_exact groups P q V t hprime hdis g hg k htg n hsq (invariantTripleEndpoint Q α β γ) (hinvariant n)) · intro n hn exact marked_prime_peel_error_norm_le groups P hq0 hq1 hv V t T hV ht g hg k (by omega) (hprime g hg) (invariantTripleEndpoint Q α β γ) n N (hS n hn).1 (hS n hn).2 (hinvariant n) end Bounty end section /- Including initial active primes absorbs the original initial-avoidance condition into one common distinctness predicate. -/ open Classical namespace Bounty section Total variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) noncomputable def fullMixedCommonBirthLabel : FullMixedCommonBirthAddress M B steps → Option ((g : Fin N) × P g) := initialAndBirthLabels (fullMixedCommonInitialPrime x) (fullMixedCommonPathBirthLabel n S B A Δ D steps x p) noncomputable def fullMixedCommonBirthPerformed (a : FullMixedCommonBirthAddress M B steps) : Prop := (fullMixedCommonBirthLabel n S B A Δ D steps x p a).isSome = true theorem full_mixed_common_initial_label (a : FullMixedCommonInitialAddress M) : fullMixedCommonBirthLabel n S B A Δ D steps x p (.inl a) = some (fullMixedCommonInitialPrime x a) := rfl theorem full_mixed_common_new_label (a : FullMixedCommonStepAddress M B steps) : fullMixedCommonBirthLabel n S B A Δ D steps x p (.inr a) = fullMixedCommonPathBirthLabel n S B A Δ D steps x p a := rfl variable [∀ g, DecidableEq (P g)] theorem full_mixed_common_initial_avoidance_iff : (∀ i a, fullMixedCommonPathBirthLabel n S B A Δ D steps x p a ≠ some (fullMixedCommonInitialPrime x i)) ↔ (∀ a z, fullMixedPathBirthLabel n S B A Δ D steps x p a = some z → z.2 ∉ fullActiveInitialLedger x z.1) := by rw [full_mixed_common_initial_avoids_iff] exact full_mixed_common_path_all_labels_iff n S B A Δ D steps x p _ end Total end Bounty end section /- Signed shifts retain injectivity on positive endpoints. -/ open Finset Filter Real namespace Bounty theorem eventually_localized_divisor_moment_cost {C : ℝ} (_hC : 0 ≤ C) : ∀ᶠ L : ℝ in atTop, ∀ Z : ℝ, 1 ≤ Z → log Z ≤ C*L → (⌈3*Z⌉₊ : ℝ)*(1+log (⌈3*Z⌉₊ : ℝ))^15 ≤ Z*L^(16 : ℝ) := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (4*(2+C+log 4)^15 : ℝ)] with L hL hK intro Z hZ hZlog have hZ0 : 0 < Z := by linarith have hNpos : (0 : ℝ) < ⌈3*Z⌉₊ := lt_of_lt_of_le (by positivity) (Nat.le_ceil (3*Z)) have hNle : (⌈3*Z⌉₊ : ℝ) ≤ 4*Z := by have hceil := Nat.ceil_lt_add_one (show 0 ≤ 3*Z by positivity) linarith have h4 : 0 ≤ log 4 := log_nonneg (by norm_num) have hlog : 1+log (⌈3*Z⌉₊ : ℝ) ≤ (2+C+log 4)*L := by have hh := log_le_log hNpos hNle rw [log_mul (by norm_num : (4 : ℝ) ≠ 0) hZ0.ne'] at hh nlinarith calc _ ≤ (4*Z)*((2+C+log 4)*L)^15 := mul_le_mul hNle (pow_le_pow_left₀ (by positivity) hlog 15) (by positivity) (by positivity) _ = (4*(2+C+log 4)^15)*Z*L^15 := by rw [mul_pow]; ring _ ≤ L*Z*L^15 := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hK hZ0.le) (pow_nonneg (by linarith) _) _ = Z*L^(16 : ℝ) := by norm_num only [rpow_ofNat]; ring end Bounty end section /- The actual finite additive convolution is a Schwartz function. -/ open Finset MeasureTheory open scoped ContDiff FourierTransform namespace Bounty noncomputable def localAdditivePolynomial (S : Finset ℕ) (a : ℕ → ℂ) (β : ℝ) : ℂ := ∑ n ∈ S, a n * Complex.exp (((2 * Real.pi * β * n : ℝ) : ℂ) * Complex.I) noncomputable def localAdditiveConvolution (S : Finset ℕ) (a : ℕ → ℂ) (H v : ℝ) : ℂ := ∑ n ∈ S, a n * localMellinKernelSchwartz (((n:ℝ)-v)/H) theorem local_kernel_translate_compact (n : ℝ) {H : ℝ} (hH : 0 < H) : HasCompactSupport (fun v => localMellinKernelSchwartz ((n-v)/H)) := by apply HasCompactSupport.intro (isCompact_Icc : IsCompact (Set.Icc (n-H) (n+H))) intro v hv apply local_mellin_kernel_unit_support apply lt_of_not_ge intro hb rw [abs_div, abs_of_pos hH] at hb have hh := abs_le.mp ((div_le_one hH).mp hb) exact hv ⟨by linarith [hh.2], by linarith [hh.1]⟩ theorem local_additive_convolution_contDiff (S : Finset ℕ) (a : ℕ → ℂ) (H : ℝ) : ContDiff ℝ ∞ (localAdditiveConvolution S a H) := by apply ContDiff.sum intro n hn exact contDiff_const.mul (localMellinKernelSchwartz.smooth'.comp (by fun_prop)) theorem local_additive_convolution_compact (S : Finset ℕ) (a : ℕ → ℂ) {H : ℝ} (hH : 0 < H) : HasCompactSupport (localAdditiveConvolution S a H) := by change HasCompactSupport (fun v => ∑ n ∈ S, a n * localMellinKernelSchwartz (((n:ℝ)-v)/H)) have hc := HasCompactSupport.finset_sum (s := S) (fun n hn => (local_kernel_translate_compact (n:ℝ) hH).mul_left (f := fun _ => a n)) simpa only [Finset.sum_fn, Pi.mul_apply] using hc noncomputable def localAdditiveSchwartz (S : Finset ℕ) (a : ℕ → ℂ) (H : ℝ) (hH : 0 < H) : SchwartzMap ℝ ℂ := (local_additive_convolution_compact S a hH).toSchwartzMap (local_additive_convolution_contDiff S a H) theorem integral_translate_div_scale (f : ℝ → ℂ) (n : ℝ) {H : ℝ} (hH : 0 < H) : (∫ v : ℝ, f ((n-v)/H)) = (H:ℂ) * ∫ u : ℝ, f u := by rw [integral_sub_left_eq_self (fun v => f (v/H)) volume n, Measure.integral_comp_div, abs_of_pos hH, Complex.real_smul] theorem local_kernel_translate_inverse_fourier (n β : ℝ) {H : ℝ} (hH : 0 < H) : (∫ v : ℝ, Complex.exp (((2*Real.pi*β*v:ℝ):ℂ)*Complex.I) * localMellinKernelSchwartz ((n-v)/H)) = (H:ℂ) * Complex.exp (((2*Real.pi*β*n:ℝ):ℂ)*Complex.I) * 𝓕 localMellinKernelSchwartz (H*β) := by let F : ℝ → ℂ := fun u => Complex.exp (((-2*Real.pi*u*(H*β):ℝ):ℂ)*Complex.I) * localMellinKernelSchwartz u have heq (v : ℝ) : Complex.exp (((2*Real.pi*β*v:ℝ):ℂ)*Complex.I) * localMellinKernelSchwartz ((n-v)/H) = Complex.exp (((2*Real.pi*β*n:ℝ):ℂ)*Complex.I) * F ((n-v)/H) := by dsimp only [F] rw [← mul_assoc, ← Complex.exp_add] congr 2 push_cast field_simp [Complex.ofReal_ne_zero.mpr hH.ne'] ring simp_rw [heq] rw [integral_const_mul, integral_translate_div_scale F n hH, local_mellin_kernel_fourier_formula] change _ = (H:ℂ) * _ * ∫ u : ℝ, F u ring end Bounty end section /- Signed ghost phases on the genuine mixed state may depend jointly on the small state, active labels and ordered newborn particles. All retention choices remain summed, so no symmetry of the ordered birth batch is needed. A fixed initial-forbidden-set gate tests newborn labels only. -/ open Finset Classical namespace Bounty section Symmetry variable {S G : Type*} [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] [∀ g, DecidableEq (Z g)] {J ell : ℕ} (A D C ν : ∀ g, Z g → ℝ) (M : G → ℕ) (B : ℕ) omit [∀ g, Fintype (P g)] in theorem physical_small_big_ghost_signed_memory_symmetric (phase : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B), CoupledGhostEvent M B s.2 → ℂ) (hphase : ∀ (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : CoupledGhostEvent M B s.2), phase (s.1, productMemoryReindex s.2 τ) (jointGhostMemoryReindex M B s.2 τ e) = phase s e) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : ∀ s, ProductMemorySymmetric (fun x => physicalSmallBigGhostAction A D C ν M B phase F (s, x)) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro s x g τ dsimp only refine (congrArg (fun y => physicalSmallBigGhostAction A D C ν M B phase F (s, y)) (product_memory_reindex_at x g τ)).symm.trans ?_ simp only [physical_small_big_ghost_eq_event_sum] let σ := Function.update (fun h => Equiv.refl (Fin (x h).2.1.val)) g τ rw [← (jointGhostMemoryReindex M B x σ).sum_comp] apply sum_congr rfl intro e _ rw [joint_ghost_reindex_weight] rw [hphase (s,x) σ e] exact congrArg (fun z : ℂ => (coupledGhostJointEventWeight A D C ν M B x e : ℂ) * phase (s,x) e * z) (joint_ghost_reindex_test M B x σ e (fun y => F (s,y)) (hF s)) end Symmetry noncomputable def physicalSmallBigGhostBirthPhase {S G : Type*} {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell : ℕ} (M : G → ℕ) (B : ℕ) (φ : PhysicalBareResidueState Ps J ell → (∀ g, Fin (M g) → P g) → (∀ g, FiniteOrderedTuple (Z g)) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) (e : CoupledGhostEvent M B s.2) : ℂ := φ s.1 (fun g => (s.2 g).1) (fun g => ⟨(e g).1.val, (e g).2.2⟩) theorem physical_small_big_ghost_birth_phase_reindex {S G : Type*} {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell : ℕ} (M : G → ℕ) (B : ℕ) (φ : PhysicalBareResidueState Ps J ell → (∀ g, Fin (M g) → P g) → (∀ g, FiniteOrderedTuple (Z g)) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : CoupledGhostEvent M B s.2) : physicalSmallBigGhostBirthPhase M B φ (s.1, productMemoryReindex s.2 τ) (jointGhostMemoryReindex M B s.2 τ e) = physicalSmallBigGhostBirthPhase M B φ s e := rfl theorem physical_small_big_ghost_birth_memory_symmetric {S G : Type*} [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] [∀ g, DecidableEq (Z g)] {J ell : ℕ} (A D C ν : ∀ g, Z g → ℝ) (M : G → ℕ) (B : ℕ) (φ : PhysicalBareResidueState Ps J ell → (∀ g, Fin (M g) → P g) → (∀ g, FiniteOrderedTuple (Z g)) → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : ∀ s, ProductMemorySymmetric (fun x => physicalSmallBigGhostAction A D C ν M B (physicalSmallBigGhostBirthPhase M B φ) F (s, x)) := physical_small_big_ghost_signed_memory_symmetric A D C ν M B _ (physical_small_big_ghost_birth_phase_reindex M B φ) F hF end Bounty end section /- Integrable envelopes for the actual amplitude and its Gram product, uniformly in both scales. -/ open MeasureTheory Set Real open scoped FourierTransform namespace Bounty theorem schwartz_product_star_second (f g : SchwartzMap ℝ ℂ) (u : ℝ) : deriv (deriv (fun x => f x*star (g x))) u = deriv (deriv f) u*star (g u)+2*deriv f u*star (deriv g u)+ f u*star (deriv (deriv g) u) := by have he : deriv (fun x => f x*star (g x)) = fun x => deriv f x*star (g x)+f x*star (deriv g x) := by funext x exact ((f.hasDerivAt x).mul (g.hasDerivAt x).star).deriv rw [he] have hf : HasDerivAt (deriv f) (deriv (deriv f) u) u := (SchwartzMap.derivCLM ℂ ℂ f).hasDerivAt u have hg : HasDerivAt (deriv g) (deriv (deriv g) u) u := (SchwartzMap.derivCLM ℂ ℂ g).hasDerivAt u have hh := ((hf.mul (g.hasDerivAt u).star).add ((f.hasDerivAt u).mul hg.star)).deriv change deriv (fun x => deriv f x*star (g x)+f x*star (deriv g x)) u = _ at hh rw [hh] ring noncomputable def localMellinAmplitudeProductSchwartz (j : ℕ) (v w : ℝ) : SchwartzMap ℝ ℂ := (show HasCompactSupport (fun u => localMellinAmplitude j v u*star (localMellinAmplitude j w u)) from by apply HasCompactSupport.intro (isCompact_Icc : IsCompact (Icc (-3 : ℝ) 3)) intro u hu rw [local_mellin_amplitude_zero j v u hu,zero_mul]).toSchwartzMap ((local_mellin_amplitude_contDiff j v).mul (Complex.conjCLE.toContinuousLinearMap.contDiff.comp (local_mellin_amplitude_contDiff j w))) theorem local_mellin_amplitude_product_fourier_bound (j : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ Integrable (fun s : ℝ => C/(1+s^2)) ∧ ∀ v w s, ‖∫ u : ℝ, Complex.exp (((-2*Real.pi*s*u : ℝ) : ℂ)*Complex.I) * localMellinAmplitude j v u*star (localMellinAmplitude j w u)‖ ≤ C/(1+s^2) := by obtain ⟨C₀,C₁,C₂,hC₀,hC₁,hC₂,hb⟩ := local_mellin_amplitude_uniform_derivatives j let F : ℝ × ℝ → SchwartzMap ℝ ℂ := fun p => localMellinAmplitudeProductSchwartz j p.1 p.2 have hs (p : ℝ × ℝ) (u : ℝ) (hu : u ∉ Icc (-3 : ℝ) 3) : F p u = 0 := by change localMellinAmplitude j p.1 u*star (localMellinAmplitude j p.2 u) = 0 rw [local_mellin_amplitude_zero j p.1 u hu,zero_mul] have hs₂ (p : ℝ × ℝ) (u : ℝ) (hu : u ∉ Icc (-3 : ℝ) 3) : SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ (F p)) u = 0 := by have hsub : tsupport (F p) ⊆ Icc (-3 : ℝ) 3 := by apply closure_minimal _ isClosed_Icc intro x hx by_contra hn exact hx (hs p x hn) apply image_eq_zero_of_notMem_tsupport intro hu' exact hu (hsub ((SchwartzMap.tsupport_derivCLM_subset ℂ (F p)) ((SchwartzMap.tsupport_derivCLM_subset ℂ (SchwartzMap.derivCLM ℂ ℂ (F p))) hu'))) have h₀ (p : ℝ × ℝ) (u : ℝ) : ‖F p u‖ ≤ C₀^2 := by change ‖localMellinAmplitudeSchwartz j p.1 u*star (localMellinAmplitudeSchwartz j p.2 u)‖ ≤ _ rw [norm_mul,norm_star,pow_two] exact mul_le_mul (hb p.1 u).1 (hb p.2 u).1 (norm_nonneg _) hC₀ have h₂ (p : ℝ × ℝ) (u : ℝ) : ‖SchwartzMap.derivCLM ℂ ℂ (SchwartzMap.derivCLM ℂ ℂ (F p)) u‖ ≤ 2*C₀*C₂+2*C₁^2 := by change ‖deriv (deriv (fun x => localMellinAmplitudeSchwartz j p.1 x* star (localMellinAmplitudeSchwartz j p.2 x))) u‖ ≤ _ rw [schwartz_product_star_second] apply le_trans ((norm_add_le _ _).trans (add_le_add (norm_add_le _ _) le_rfl)) simp only [norm_mul,norm_star,Complex.norm_ofNat] have hv := hb p.1 u have hw := hb p.2 u calc _ ≤ C₂*C₀+2*C₁*C₁+C₀*C₂ := by gcongr <;> first | exact hv.2.2 | exact hw.1 | exact hv.2.1 | exact hw.2.1 | exact hv.1 | exact hw.2.2 _ = _ := by ring obtain ⟨C,hC,hi,hf⟩ := compact_schwartz_fourier_envelope F 3 (C₀^2) (2*C₀*C₂+2*C₁^2) (by positivity) (by positivity) hs hs₂ h₀ h₂ refine ⟨C,hC,hi,?_⟩ intro v w s have he : 𝓕 (F (v,w)) s = ∫ u : ℝ, Complex.exp (((-2*Real.pi*s*u : ℝ) : ℂ)*Complex.I)* localMellinAmplitude j v u*star (localMellinAmplitude j w u) := by rw [SchwartzMap.fourier_coe,Real.fourier_eq'] apply integral_congr_ae filter_upwards [] with u simp only [RCLike.inner_apply,starRingEnd_apply,star_trivial,smul_eq_mul] change Complex.exp _*(localMellinAmplitude j v u*star (localMellinAmplitude j w u)) = _ simp only [mul_assoc] rw [← he] exact hf (v,w) s end Bounty end section open MeasureTheory namespace Bounty noncomputable def mellinDecayWeight (j : ℕ) (h t : ℝ) : ℝ := ((1+(h*t)^2)^j)⁻¹ theorem mellin_decay_weight_pos (j : ℕ) (h t : ℝ) : 0 < mellinDecayWeight j h t := by unfold mellinDecayWeight positivity theorem mellin_decay_weight_le_one (j : ℕ) (h t : ℝ) : mellinDecayWeight j h t ≤ 1 := by unfold mellinDecayWeight apply inv_le_one_of_one_le₀ exact one_le_pow₀ (by nlinarith [sq_nonneg (h*t)]) theorem mellin_decay_weight_bound (j : ℕ) (h t : ℝ) : mellinDecayWeight j h t ≤ (2:ℝ)^j * (1+|h*t|)^(-(j:ℝ)) := by have hb : 1+|h*t| ≤ 2*(1+(h*t)^2) := by nlinarith [sq_nonneg (|h*t|-1), sq_abs (h*t)] have hp := pow_le_pow_left₀ (by positivity : 0 ≤ 1+|h*t|) hb j rw [mul_pow] at hp rw [Real.rpow_neg (by positivity), Real.rpow_natCast] unfold mellinDecayWeight have hq : 1 / (1+(h*t)^2)^j ≤ (2:ℝ)^j / (1+|h*t|)^j := (div_le_div_iff₀ (by positivity) (by positivity)).mpr (by simpa only [one_mul] using hp) simpa only [one_div, div_eq_mul_inv, one_mul] using hq theorem mellin_decay_weight_continuous (j : ℕ) (h : ℝ) : Continuous (mellinDecayWeight j h) := by unfold mellinDecayWeight apply Continuous.inv₀ · fun_prop · intro t positivity theorem mellin_decay_weight_integrable {j : ℕ} (hj : 2 ≤ j) {h : ℝ} (hh : 0 < h) : Integrable (mellinDecayWeight j h) := by have hjR : (1:ℝ) < j := by exact_mod_cast (by omega : 1 < j) have hi : Integrable (fun t : ℝ => (1+|t|)^(-(j:ℝ))) := by simpa only [Real.norm_eq_abs] using (integrable_one_add_norm (E := ℝ) (r := (j:ℝ)) (by simpa using hjR)) apply ((hi.comp_mul_left' hh.ne').const_mul ((2:ℝ)^j)).mono' (mellin_decay_weight_continuous j h).aestronglyMeasurable filter_upwards [] with t rw [Real.norm_of_nonneg (mellin_decay_weight_pos j h t).le] exact mellin_decay_weight_bound j h t section variable {j : ℕ} (hj : 2 ≤ j) {h : ℝ} (hh : 0 < h) {g : ℝ → ℂ} (hg : Continuous g) {M : ℝ} (hgM : ∀ t, ‖g t‖ ≤ M) include j hj h hh g hg M hgM theorem mellin_weighted_bounded_integrable : Integrable (fun t => (mellinDecayWeight j h t : ℂ) * g t) := by apply ((mellin_decay_weight_integrable hj hh).mul_const M).mono' · exact ((Complex.continuous_ofReal.comp (mellin_decay_weight_continuous j h)).mul hg).aestronglyMeasurable · filter_upwards [] with t rw [norm_mul, Complex.norm_real, Real.norm_of_nonneg (mellin_decay_weight_pos j h t).le] exact mul_le_mul_of_nonneg_left (hgM t) (mellin_decay_weight_pos j h t).le theorem mellin_weighted_bounded_square_integrable : Integrable (fun t => ‖(mellinDecayWeight j h t : ℂ) * g t‖^2) := by apply ((mellin_decay_weight_integrable hj hh).mul_const (M^2)).mono' · exact (((Complex.continuous_ofReal.comp (mellin_decay_weight_continuous j h)).mul hg).norm.pow 2).aestronglyMeasurable · filter_upwards [] with t rw [Real.norm_of_nonneg (sq_nonneg _), norm_mul, Complex.norm_real, Real.norm_of_nonneg (mellin_decay_weight_pos j h t).le, mul_pow] have hw := mellin_decay_weight_le_one j h t have hw0 := (mellin_decay_weight_pos j h t).le have hwp : (mellinDecayWeight j h t)^2 ≤ mellinDecayWeight j h t := by nlinarith exact mul_le_mul hwp (pow_le_pow_left₀ (norm_nonneg _) (hgM t) 2) (sq_nonneg _) hw0 theorem mellin_weighted_square_energy_bound : (∫ t : ℝ, ‖(mellinDecayWeight j h t : ℂ) * g t‖^2) ≤ (2:ℝ)^j * ∫ t : ℝ, (1+|h*t|)^(-(j:ℝ)) * ‖g t‖^2 := by have hjR : (1:ℝ) < j := by exact_mod_cast (by omega : 1 < j) have hi : Integrable (fun t : ℝ => (1+|h*t|)^(-(j:ℝ))) := by have hi0 := integrable_one_add_norm (E := ℝ) (μ := volume) (r := (j:ℝ)) (by simpa using hjR) simpa only [Real.norm_eq_abs] using hi0.comp_mul_left' hh.ne' have hgi : Integrable (fun t => (1+|h*t|)^(-(j:ℝ)) * ‖g t‖^2) := by apply (hi.mul_const (M^2)).mono' · have hw : Continuous (fun t : ℝ => (1+|h*t|)^(-(j:ℝ))) := (by fun_prop : Continuous (fun t : ℝ => 1+|h*t|)).rpow_const (fun t => Or.inl (by positivity)) exact (hw.mul (hg.norm.pow 2)).aestronglyMeasurable · filter_upwards [] with t rw [Real.norm_of_nonneg (by positivity)] exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) (hgM t) 2) (by positivity) rw [← integral_const_mul] apply integral_mono (mellin_weighted_bounded_square_integrable hj hh hg hgM) (hgi.const_mul _) intro t dsimp only rw [norm_mul, Complex.norm_real, Real.norm_of_nonneg (mellin_decay_weight_pos j h t).le, mul_pow] have hw := mellin_decay_weight_le_one j h t have hw0 := (mellin_decay_weight_pos j h t).le have hwp : (mellinDecayWeight j h t)^2 ≤ mellinDecayWeight j h t := by nlinarith have hb := mul_le_mul_of_nonneg_right (hwp.trans (mellin_decay_weight_bound j h t)) (sq_nonneg ‖g t‖) simpa only [mul_assoc] using hb end end Bounty end section /- Absolute candidate mass on a finite box containing the sharp product window. -/ open Finset Filter Real namespace Bounty theorem eventually_candidate_finite_divisor_cross_mass (R : ℝ) (hR : 1 ≤ R) : ∀ᶠ L : ℝ in atTop, ∀ S : Finset ℕ, (∀ u ∈ S, (u : ℝ) ≤ R*exp L) → (∑ u ∈ S, (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ)) ≤ exp L * L^(16 : ℝ) := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop ((2*R+1)*(2+log (2*R+1))^15 : ℝ)] with L hL hK intro S hS have hL0 : 0 < L := by linarith have hE : 1 ≤ exp L := one_le_exp hL0.le let N : ℕ := ⌊(2*R+1)*exp L⌋₊ have hN0 : 0 < N := Nat.floor_pos.mpr (by nlinarith) have hNpos : (0 : ℝ) < N := by exact_mod_cast hN0 have hNle : (N : ℝ) ≤ (2*R+1)*exp L := Nat.floor_le (by positivity) have hlog : 1+log N ≤ (2+log (2*R+1))*L := by have hh := log_le_log hNpos hNle rw [log_mul (by linarith : ((2*R+1) : ℝ) ≠ 0) (exp_ne_zero L), log_exp] at hh have hlogR : 0 ≤ log (2*R+1) := log_nonneg (by linarith) nlinarith have hmass := shifted_divisor_cross_mass_le (S) N (by intro u hu have huhi := hS u hu apply Nat.le_floor push_cast nlinarith) calc _ ≤ (N : ℝ)*(1+log N)^15 := hmass _ ≤ ((2*R+1)*exp L)*((2+log (2*R+1))*L)^15 := mul_le_mul hNle (pow_le_pow_left₀ (by positivity) hlog 15) (by positivity) (by positivity) _ = ((2*R+1)*(2+log (2*R+1))^15)*exp L*L^15 := by rw [mul_pow]; ring _ ≤ L*exp L*L^15 := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hK (exp_pos _).le) (pow_nonneg hL0.le _) _ = exp L*L^(16 : ℝ) := by norm_num only [rpow_ofNat]; ring theorem exists_candidate_finite_test_absolute_bound {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (R : ℝ) (hR : 1 ≤ R) (A : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (S : Finset ℕ) (F : ℕ → ℕ → ℂ), (∀ u ∈ S, 0 < u ∧ (u : ℝ) ≤ R*exp L) → (∀ u ∈ S, ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → (∑ u ∈ S, candidateCoefficient c L q r jStar u * ∑ m ∈ (2*u+1).divisors, ‖F u m‖) ≤ exp L * L^C := by obtain ⟨K, hK, hcoef⟩ := exists_candidate_coefficient_divisor_bound hc hr hq0 hq1 refine ⟨K+|A|+16, by positivity, ?_⟩ filter_upwards [hcoef, eventually_candidate_finite_divisor_cross_mass R hR, eventually_ge_atTop (1 : ℝ)] with L hcoeff hmass hL intro jStar S F hS hF have hmassS := hmass S (fun u hu => (hS u hu).2) have hL0 : 0 < L := zero_lt_one.trans_le hL have hsum : (∑ u ∈ S, candidateCoefficient c L q r jStar u * ∑ m ∈ (2*u+1).divisors, ‖F u m‖) ≤ L^(K+|A|) * ∑ u ∈ S, (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ) := by rw [mul_sum] apply sum_le_sum intro u hu have hu0 : u ≠ 0 := Nat.ne_of_gt (hS u hu).1 let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) have hdiv : primePoolFreePart P u ∣ u := ⟨primePoolPart P u, by simpa only [Nat.mul_comm] using (primePoolPart_mul_primePoolFreePart P u).symm⟩ have hcard : ((primePoolFreePart P u).divisors.card : ℝ) ≤ (u.divisors.card : ℝ) := by exact_mod_cast card_le_card (Nat.divisors_subset_of_dvd hu0 hdiv) have hcU : candidateCoefficient c L q r jStar u ≤ L^K*(u.divisors.card : ℝ) := (hcoeff jStar u).2.trans (mul_le_mul_of_nonneg_left hcard (rpow_nonneg hL0.le _)) have hinner : (∑ m ∈ (2*u+1).divisors, ‖F u m‖) ≤ ((2*u+1).divisors.card : ℝ)*L^|A| := by calc _ ≤ ∑ _m ∈ (2*u+1).divisors, L^|A| := sum_le_sum (fun m hm => (hF u hu m hm).trans (rpow_le_rpow_of_exponent_le hL (le_abs_self A))) _ = _ := by simp calc _ ≤ (L^K*(u.divisors.card : ℝ))*(((2*u+1).divisors.card : ℝ)*L^|A|) := mul_le_mul hcU hinner (sum_nonneg (fun _ _ => norm_nonneg _)) (by positivity) _ = _ := by rw [rpow_add hL0]; ring calc _ ≤ L^(K+|A|) * ∑ u ∈ S, (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ) := hsum _ ≤ L^(K+|A|)*(exp L*L^(16 : ℝ)) := mul_le_mul_of_nonneg_left hmassS (rpow_nonneg hL0.le _) _ = exp L*L^(K+|A|+16) := by rw [rpow_add hL0 (K+|A|) 16]; ring end Bounty end section /- Exact finite divisor reindexing into the two-equation Type II inner sum. -/ open Finset namespace Bounty theorem finite_divisor_product_reindex (M N : Finset ℕ) (α β : ℕ → ℂ) (hα : ∀ m, m ∉ M → α m = 0) (hβ : ∀ n, n ∉ N → β n = 0) {z : ℕ} (hz : z ≠ 0) : (∑ m ∈ z.divisors, α m*β (z/m)) = ∑ m ∈ M, ∑ n ∈ N, if m*n=z then α m*β n else 0 := by classical have hinner (m : ℕ) : (∑ n ∈ N, if m*n=z then α m*β n else 0) = if m ∈ z.divisors then α m*β (z/m) else 0 := by by_cases hm : m ∈ z.divisors · rw [if_pos hm] have hd := (Nat.mem_divisors.mp hm).1 have hm0 : m ≠ 0 := by intro he; subst m; simp_all have hmq : m*(z/m)=z := Nat.mul_div_cancel' hd rw [sum_eq_single (z/m)] · rw [if_pos hmq] · intro n hn hneq rw [if_neg] intro he exact hneq (Nat.eq_of_mul_eq_mul_left (Nat.pos_of_ne_zero hm0) (he.trans hmq.symm)) · intro hn rw [hβ _ hn,mul_zero] simp only [ite_self] · rw [if_neg hm] apply sum_eq_zero intro n hn rw [if_neg] intro he exact hm (Nat.mem_divisors.mpr ⟨⟨n,he.symm⟩,hz⟩) simp_rw [hinner] rw [← sum_filter] have hset : M.filter (fun m => m ∈ z.divisors) = z.divisors.filter (fun m => m ∈ M) := by ext m simp only [mem_filter,and_comm] rw [hset] symm apply sum_subset (filter_subset _ _) intro m hm hn have hmM : m ∉ M := by intro h; exact hn (mem_filter.mpr ⟨hm,h⟩) rw [hα m hmM,zero_mul] theorem shifted_divisor_typeII_row (e : ℕ) (M N H : Finset ℕ) (α β aH : ℕ → ℂ) (hα : ∀ m, m ∉ M → α m = 0) (hβ : ∀ n, n ∉ N → β n = 0) : (∑ h ∈ H, aH h*∑ m ∈ (2*e*h+1).divisors, α m*β ((2*e*h+1)/m)) = ∑ n ∈ N, β n*typeIIInnerSum M H α aH e n := by classical have hre (h : ℕ) : (∑ m ∈ (2*e*h+1).divisors, α m*β ((2*e*h+1)/m)) = ∑ m ∈ M, ∑ n ∈ N, if m*n=2*e*h+1 then α m*β n else 0 := finite_divisor_product_reindex M N α β hα hβ (by omega) simp_rw [hre, mul_sum] calc _ = ∑ m ∈ M, ∑ h ∈ H, ∑ n ∈ N, aH h*(if m*n=2*e*h+1 then α m*β n else 0) := sum_comm _ = ∑ m ∈ M, ∑ n ∈ N, ∑ h ∈ H, aH h*(if m*n=2*e*h+1 then α m*β n else 0) := by apply sum_congr rfl intro m hm exact sum_comm _ = ∑ n ∈ N, ∑ m ∈ M, ∑ h ∈ H, aH h*(if m*n=2*e*h+1 then α m*β n else 0) := sum_comm _ = _ := by simp only [typeIIInnerSum,sum_product,typeIIEquationTerm,mul_sum] apply sum_congr rfl intro n hn apply sum_congr rfl intro m hm apply sum_congr rfl intro h hh split_ifs <;> ring end Bounty end section /- Coarse product masks are removed only under explicit equation-support compatibility. -/ open Finset namespace Bounty theorem typeII_inner_coarse_mask_eq (M H S : Finset ℕ) (α aH : ℕ → ℂ) (e n : ℕ) (hcompat : ∀ m ∈ M, ∀ h ∈ H, m*n=2*e*h+1 → e*h ∈ S) : typeIIInnerSum M H α (fun h => if e*h ∈ S then aH h else 0) e n = typeIIInnerSum M H α aH e n := by classical unfold typeIIInnerSum typeIIEquationTerm apply sum_congr rfl intro v hv obtain ⟨hm,hh⟩ := mem_product.mp hv by_cases heq : v.1*n=2*e*v.2+1 · simp only [heq,if_true,hcompat v.1 hm v.2 hh heq] · rw [if_neg heq,if_neg heq] theorem typeII_equation_coarse_bounds {e h m n : ℕ} {U V R L : ℝ} (he : 0 < e) (hh : 0 < h) (hU : 0 ≤ U) (_hV : 0 ≤ V) (hm : (m : ℝ) ≤ 2*U) (hn : (n : ℝ) ≤ 2*V) (hR : 2*U*V ≤ R*Real.exp L) (heq : m*n=2*e*h+1) : e*h ∈ Icc 1 ⌊R*Real.exp L⌋₊ := by apply mem_Icc.mpr refine ⟨Nat.one_le_iff_ne_zero.mpr (Nat.ne_of_gt (Nat.mul_pos he hh)),?_⟩ apply Nat.le_floor have hprod := mul_le_mul hm hn (Nat.cast_nonneg n) (show 0 ≤ 2*U by positivity) have heqR : (m : ℝ)*n=2*e*h+1 := by exact_mod_cast heq push_cast nlinarith end Bounty end section /- The first-derivative exponential-sum test under local calculus hypotheses. -/ open Finset namespace Bounty theorem first_derivative_test (f f' : ℝ → ℝ) (a b k : ℤ) {δ : ℝ} (hδ : 0 < δ) (hδhalf : δ ≤ 1/2) (hf : ∀ x ∈ Set.Icc (a : ℝ) ((b : ℝ)+1), HasDerivAt f (f' x) x) (hband : ∀ x ∈ Set.Icc (a : ℝ) ((b : ℝ)+1), (k : ℝ)+δ ≤ f' x ∧ f' x ≤ (k : ℝ)+1-δ) (hmono : MonotoneOn f' (Set.Icc (a : ℝ) ((b : ℝ)+1)) ∨ AntitoneOn f' (Set.Icc (a : ℝ) ((b : ℝ)+1))) : ‖∑ n ∈ Icc a b, realUnitPhase (f (n : ℝ))‖ ≤ 2/δ := by apply integer_first_derivative_sum_bound (fun n => f (n : ℝ)) a b k hδ hδhalf · intro n hn have hn' : (n : ℝ) ∈ Set.Icc (a : ℝ) (b : ℝ) := by obtain ⟨hn0,hn1⟩ := mem_Icc.mp hn exact ⟨by exact_mod_cast hn0, by exact_mod_cast hn1⟩ simpa only [Int.cast_add,Int.cast_one] using first_derivative_unit_increment_bounds hf hband hn' · have hc {n : ℤ} (hn : n ∈ Set.Icc a b) : (n : ℝ) ∈ Set.Icc (a : ℝ) (b : ℝ) := ⟨by exact_mod_cast hn.1,by exact_mod_cast hn.2⟩ rcases hmono with hm | hm · left intro n hn m hm' hnm simpa only [Int.cast_add,Int.cast_one] using monotoneOn_unit_increment hf hm (hc hn) (hc hm') (by exact_mod_cast hnm) · right intro n hn m hm' hnm simpa only [Int.cast_add,Int.cast_one] using antitoneOn_unit_increment hf hm (hc hn) (hc hm') (by exact_mod_cast hnm) end Bounty end section /- The second derivative test applied to the actual logarithmic phase. -/ open Finset namespace Bounty theorem positive_logarithmic_second_derivative (c U : ℝ) {a b : ℕ} (hc : 0 < c) (hU : 1 ≤ U) (hab : a ≤ b) (ha : U ≤ (a : ℝ)) (hb : (b : ℝ) ≤ 2*U) : ‖∑ n ∈ Icc a b, realUnitPhase (c*Real.log n)‖ ≤ 36*(Real.sqrt c+U/Real.sqrt c) := by have hU0 : 0 < U := by linarith have hx (x : ℝ) (h : x ∈ Set.Icc (a : ℝ) (b+1)) : U ≤ x ∧ x ≤ 3*U := by constructor <;> linarith [h.1,h.2] have hlam : 0 < c/(3*U)^2 := by positivity have htest := second_derivative_sum_bound_negative (f := fun x => c*Real.log x) (f' := fun x => c/x) (f'' := fun x => -(c/x^2)) (lam := c/(3*U)^2) (A := 9) hab hlam (by norm_num) (fun x h => by have hx0 : x ≠ 0 := ne_of_gt (hU0.trans_le (hx x h).1) simpa only [div_eq_mul_inv] using (Real.hasDerivAt_log hx0).const_mul c) (fun x h => by have hx0 : x ≠ 0 := ne_of_gt (hU0.trans_le (hx x h).1) simpa only [zero_mul,mul_one,zero_sub,neg_div,id_eq] using (hasDerivAt_const x c).fun_div (hasDerivAt_id x) hx0) (fun x h => by have hx0 : 0 < x := hU0.trans_le (hx x h).1 have hlo : U^2 ≤ x^2 := by nlinarith [(hx x h).1] have hhi : x^2 ≤ (3*U)^2 := by nlinarith [(hx x h).2] have h1 := div_le_div_of_nonneg_left hc.le (sq_pos_of_pos hx0) hhi have h2 := div_le_div_of_nonneg_left hc.le (sq_pos_of_pos hU0) hlo have heq : c/U^2 = 9*(c/(3*U)^2) := by field_simp; ring rw [heq] at h2 constructor <;> linarith) have hs : Real.sqrt (c/(3*U)^2) = Real.sqrt c/(3*U) := by rw [Real.sqrt_div hc.le,Real.sqrt_sq (by positivity)] rw [hs] at htest have hN : (b : ℝ)-a+1 ≤ 2*U := by linarith have hsc : 0 < Real.sqrt c := Real.sqrt_pos.mpr hc have heq : 6*(9*((b : ℝ)-a+1)*(Real.sqrt c/(3*U))+2/(Real.sqrt c/(3*U))) = 18*((b : ℝ)-a+1)/U*Real.sqrt c+36*U/Real.sqrt c := by field_simp ring rw [heq] at htest have hratio : ((b : ℝ)-a+1)/U ≤ 2 := (div_le_iff₀ hU0).mpr (by linarith) have hmain : 18*((b : ℝ)-a+1)/U*Real.sqrt c ≤ 36*Real.sqrt c := by have := mul_le_mul_of_nonneg_right hratio hsc.le calc _ = 18*(((b : ℝ)-a+1)/U*Real.sqrt c) := by ring _ ≤ 18*(2*Real.sqrt c) := mul_le_mul_of_nonneg_left this (by norm_num) _ = _ := by ring calc _ ≤ _ := htest _ ≤ 36*Real.sqrt c+36*U/Real.sqrt c := add_le_add hmain le_rfl _ = _ := by ring end Bounty end section /- The exceptional count for the actual reciprocal polynomial, using the proved growing moment and its genuine derivative mean square. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem prime_exceptional_intervals_moment_bound (s : Finset ℕ) (hs : ∀ p ∈ s, Nat.Prime p) (P B : ℝ) (b : s → ℂ) (hP : 1 ≤ P) (hB : 0 ≤ B) (hband : ∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) (hb : ∀ p : s, ‖b p‖ ≤ B) (j N : ℕ) (hN : 1 ≤ N) (hPN : (2 * P) ^ j ≤ (N : ℝ)) (η R : ℝ) (hη : 0 < η) : ((primeExceptionalIntervals s b η R).card : ℝ) * (η ^ j) ^ 2 ≤ 3 * (1 + 2 * (1 + Real.log N)) * (((2 * (⌈R⌉₊ : ℝ) + 3) + 4 * (N : ℝ) * (1 + Real.log N)) * (j.factorial : ℝ) * (2 * B ^ 2 / P) ^ j) := by let w : s → ℂ := fun p => b p / (p.val : ℂ) let lo : ℝ := -(⌈R⌉₊ : ℝ) - 1 let hi : ℝ := (⌈R⌉₊ : ℝ) + 2 let M := (hi - lo) + 4 * (N : ℝ) * (1 + Real.log N) let F : ℝ → ℂ := fun t => (primeReciprocalPolynomial s b t) ^ j let F' : ℝ → ℂ := fun t => ∑ n ∈ primePolynomialSupport s j, (primePolynomialCoefficient s w j n * ((Real.log (n : ℝ) : ℂ) * Complex.I)) * Complex.exp (((Real.log (n : ℝ) * t : ℝ) : ℂ) * Complex.I) let Q := M * (j.factorial : ℝ) * (2 * B ^ 2 / P) ^ j have hab : lo ≤ hi := by dsimp only [lo, hi] have : (0 : ℝ) ≤ ⌈R⌉₊ := Nat.cast_nonneg _ linarith have hM : 0 ≤ M := prime_polynomial_mean_square_factor_nonneg N hN lo hi hab have hbase : (∑ p : s, ‖w p‖ ^ 2) ≤ 2 * B ^ 2 / P := by simpa only [w, norm_div, Complex.norm_natCast, div_pow] using prime_dyadic_reciprocal_energy_le s P B b hP hB hband hb have hbase0 : 0 ≤ ∑ p : s, ‖w p‖ ^ 2 := sum_nonneg (fun _ _ => sq_nonneg _) have hP0 : 0 < P := zero_lt_one.trans_le hP have hQ : 0 ≤ Q := by dsimp only [Q]; positivity have hlog : 0 ≤ Real.log (N : ℝ) := Real.log_natCast_nonneg N have hF : ∀ t, HasDerivAt F (F' t) t := by intro t exact prime_polynomial_power_hasDerivAt s hs w j t have hF' : Continuous F' := by dsimp only [F']; fun_prop have he : (∫ t in lo..hi, ‖F t‖ ^ 2) ≤ Q := by have he0 := prime_polynomial_power_mean_square s hs w (2 * P) (fun p hp => (hband p hp).2) j N hN hPN lo hi hab refine he0.trans ?_ exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hbase0 hbase j) (mul_nonneg hM (Nat.cast_nonneg _)) have hd : (∫ t in lo..hi, ‖F' t‖ ^ 2) ≤ (1 + Real.log N) ^ 2 * Q := by have hd0 := prime_polynomial_power_derivative_mean_square s hs w (2 * P) (fun p hp => (hband p hp).2) j N hN hPN lo hi hab have hmul := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hbase0 hbase j) (mul_nonneg (mul_nonneg hM (sq_nonneg (Real.log N))) (Nat.cast_nonneg j.factorial)) have hd1 : (∫ t in lo..hi, ‖F' t‖ ^ 2) ≤ (Real.log N) ^ 2 * Q := hd0.trans (hmul.trans_eq (by dsimp only [Q]; ring)) refine hd1.trans (mul_le_mul_of_nonneg_right ?_ hQ) nlinarith have hout := occupied_unit_intervals_card_energy_le (Finset.Icc (-(⌈R⌉₊ : ℤ) - 1) (⌈R⌉₊ : ℤ)) (primeExceptionalTimes s b η R) F F' hab (fun i hi => (prime_exceptional_window_bounds R i hi).1) (fun i hi => (prime_exceptional_window_bounds R i hi).2) (pow_pos hη j) (fun t ht => by dsimp only [F] rw [norm_pow] exact pow_le_pow_left₀ hη.le ht.2.le j) hF hF' (by linarith : 0 < 1 + Real.log (N : ℝ)) he hd convert hout using 1 dsimp only [Q, M, hi, lo, primeExceptionalIntervals] ring end Bounty end section /- Absorption of sparse cardinality and coefficient energy in the interval-supremum bound. -/ open scoped BigOperators namespace Bounty end Bounty end section open Finset namespace Bounty end Bounty end section open Finset namespace Bounty theorem integer_Icc_sum_as_nat_Icc (g : ℤ → ℂ) (a b : ℤ) (hab : a ≤ b) : ∑ n ∈ Icc a b, g n = ∑ n ∈ Icc 0 (b-a).toNat, g (a+(n:ℤ)) := by symm apply sum_bij (fun (n : ℕ) _ => a+(n:ℤ)) · intro n hn have hn' := mem_Icc.mp hn rw [mem_Icc] omega · intro n hn m hm he omega · intro z hz have hz' := mem_Icc.mp hz refine ⟨(z-a).toNat, ?_, ?_⟩ · rw [mem_Icc] omega · omega · intro n hn rfl theorem integer_second_derivative_sum_bound {f f' f'' : ℝ → ℝ} {a b : ℤ} {lam A : ℝ} (hab : a ≤ b) (hlam : 0 < lam) (hA : 1 ≤ A) (hf : ∀ x ∈ Set.Icc (a:ℝ) ((b:ℝ)+1), HasDerivAt f (f' x) x) (hf' : ∀ x ∈ Set.Icc (a:ℝ) ((b:ℝ)+1), HasDerivAt f' (f'' x) x) (hb : ∀ x ∈ Set.Icc (a:ℝ) ((b:ℝ)+1), lam ≤ f'' x ∧ f'' x ≤ A*lam) : ‖∑ n ∈ Icc a b, realUnitPhase (f (n:ℝ))‖ ≤ 6*(A*((b:ℝ)-a+1)*Real.sqrt lam+2/Real.sqrt lam) := by have hD : ((b-a).toNat:ℝ) = (b:ℝ)-a := by exact_mod_cast Int.toNat_of_nonneg (show 0 ≤ b-a by omega) have hm (x : ℝ) (hx : x ∈ Set.Icc (0:ℝ) (((b-a).toNat:ℝ)+1)) : (a:ℝ)+x ∈ Set.Icc (a:ℝ) ((b:ℝ)+1) := by rw [hD] at hx constructor <;> linarith [hx.1,hx.2] have hbound := second_derivative_sum_bound (f := fun x => f ((a:ℝ)+x)) (f' := fun x => f' ((a:ℝ)+x)) (f'' := fun x => f'' ((a:ℝ)+x)) (a := 0) (b := (b-a).toNat) (Nat.zero_le _) hlam hA (fun x hx => by simpa only [Function.comp_def, id_eq, mul_one] using (hf _ (hm x (by simpa only [Nat.cast_zero] using hx))).comp x ((hasDerivAt_id x).const_add (a:ℝ))) (fun x hx => by simpa only [Function.comp_def, id_eq, mul_one] using (hf' _ (hm x (by simpa only [Nat.cast_zero] using hx))).comp x ((hasDerivAt_id x).const_add (a:ℝ))) (fun x hx => hb _ (hm x (by simpa only [Nat.cast_zero] using hx))) rw [integer_Icc_sum_as_nat_Icc _ a b hab] simpa only [Int.cast_add, Int.cast_natCast, Nat.cast_zero, sub_zero, hD] using hbound theorem integer_second_derivative_sum_bound_negative {f f' f'' : ℝ → ℝ} {a b : ℤ} {lam A : ℝ} (hab : a ≤ b) (hlam : 0 < lam) (hA : 1 ≤ A) (hf : ∀ x ∈ Set.Icc (a:ℝ) ((b:ℝ)+1), HasDerivAt f (f' x) x) (hf' : ∀ x ∈ Set.Icc (a:ℝ) ((b:ℝ)+1), HasDerivAt f' (f'' x) x) (hb : ∀ x ∈ Set.Icc (a:ℝ) ((b:ℝ)+1), -A*lam ≤ f'' x ∧ f'' x ≤ -lam) : ‖∑ n ∈ Icc a b, realUnitPhase (f (n:ℝ))‖ ≤ 6*(A*((b:ℝ)-a+1)*Real.sqrt lam+2/Real.sqrt lam) := by have hD : ((b-a).toNat:ℝ) = (b:ℝ)-a := by exact_mod_cast Int.toNat_of_nonneg (show 0 ≤ b-a by omega) have hm (x : ℝ) (hx : x ∈ Set.Icc (0:ℝ) (((b-a).toNat:ℝ)+1)) : (a:ℝ)+x ∈ Set.Icc (a:ℝ) ((b:ℝ)+1) := by rw [hD] at hx constructor <;> linarith [hx.1,hx.2] have hbound := second_derivative_sum_bound_negative (f := fun x => f ((a:ℝ)+x)) (f' := fun x => f' ((a:ℝ)+x)) (f'' := fun x => f'' ((a:ℝ)+x)) (a := 0) (b := (b-a).toNat) (Nat.zero_le _) hlam hA (fun x hx => by simpa only [Function.comp_def, id_eq, mul_one] using (hf _ (hm x (by simpa only [Nat.cast_zero] using hx))).comp x ((hasDerivAt_id x).const_add (a:ℝ))) (fun x hx => by simpa only [Function.comp_def, id_eq, mul_one] using (hf' _ (hm x (by simpa only [Nat.cast_zero] using hx))).comp x ((hasDerivAt_id x).const_add (a:ℝ))) (fun x hx => hb _ (hm x (by simpa only [Nat.cast_zero] using hx))) rw [integer_Icc_sum_as_nat_Icc _ a b hab] simpa only [Int.cast_add, Int.cast_natCast, Nat.cast_zero, sub_zero, hD] using hbound end Bounty end section /- The exact shared-prime overlap correction to the stripped vertex weight. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalUnsharedVertex {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ℝ) (w : ℤ) : ℝ := finiteMarkedVertex (physicalMarkedPrimes L \ physicalSharedPrimes C L) (fun p : PhysicalPrime P => (p.2.val : ℤ) ∣ w) q noncomputable def physicalSharedOverlap {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ℝ) (w : ℤ) : ℝ := ∏ p ∈ physicalSharedPrimes C L, if (p.2.val : ℤ) ∣ w then q else 1 theorem physical_shared_vertex_removal {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (q : ℝ) (w : ℤ) : physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * w) * physicalSharedOverlap C L q w = physicalUnsharedVertex C L q w := by rw [physical_vertex_weight_as_finite] have h := finite_shared_vertex_removal (physicalMarkedPrimes L) (physicalSharedPrimes C L) (fun p : PhysicalPrime P => (p.2.val : ℤ) ∣ w) (fun p : PhysicalPrime P => (p.2.val : ℤ) ∣ (physicalSharedFactor C L : ℤ) * w) q (physical_shared_primes_subset_marked C L) (fun p => physical_prime_dvd_shared_mul C L hprime hdis p w) unfold physicalSharedOverlap physicalUnsharedVertex convert h using 1 · congr 1 apply prod_congr rfl intro p _ split_ifs <;> rfl · apply congrArg (fun s => finiteMarkedVertex s (fun p : PhysicalPrime P => (p.2.val : ℤ) ∣ w) q) ext p simp only [mem_sdiff] theorem physical_shared_overlap_eq_one {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ℝ) (w : ℤ) (havoid : ∀ p ∈ physicalSharedPrimes C L, ¬(p.2.val : ℤ) ∣ w) : physicalSharedOverlap C L q w = 1 := by exact prod_eq_one (fun p hp => if_neg (havoid p hp)) theorem physical_shared_factor_eq_of_compatible {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) {L R : PhysicalMarkLists P J ell} (hshared : physicalSharedCompatible C L R) : physicalSharedFactor C L = physicalSharedFactor C R := by apply prod_congr rfl intro a _ rw [hshared a.1 a.2.val (mem_sdiff.mp a.2.property).2] theorem physical_shared_vertex_pair_removal {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (hshared : physicalSharedCompatible C L R) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (q : ℝ) (w z : ℤ) : (physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * w) * physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * z)) * (physicalSharedOverlap C L q w * physicalSharedOverlap C L q z) = physicalUnsharedVertex C L q w * physicalUnsharedVertex C R q z := by have hR : physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * z) * physicalSharedOverlap C L q z = physicalUnsharedVertex C R q z := by rw [physical_shared_factor_eq_of_compatible C hshared] simpa only [physicalSharedOverlap, physical_shared_primes_eq_of_compatible C hshared] using physical_shared_vertex_removal C R hprime hdis q z calc _ = (physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * w) * physicalSharedOverlap C L q w) * (physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * z) * physicalSharedOverlap C L q z) := by ring _ = _ := by rw [physical_shared_vertex_removal C L hprime hdis q w, hR] end Bounty end section /- Weighted support, rather than closure of all quotients, removes a finite endpoint mask. -/ open Finset open scoped ComplexConjugate namespace Bounty theorem typeII_weighted_direct_endpoint_support (M H : Finset ℕ) (A B : ℕ → ℂ) (W : ℕ → ℝ) (t : ℝ) {v : ℕ} (hv : 0 < v) (hM : ∀ m ∈ M, 0 < m) (hW : ∀ m ∈ M, ∀ h : ℕ, 0 < h → W (m*h)=W h) (hsupport : ∀ h : ℕ, 0 < h → h ∉ H → (W h:ℂ)*B h=0) : typeIIDirectEndpoint M H A B t v * (W v:ℂ) = typeIIDirectEndpoint M (Icc 1 v) A B t v * (W v:ℂ) := by classical rw [typeII_direct_endpoint_eq_divisor_mask M H A B t v hM, typeII_direct_endpoint_eq_divisor_mask M (Icc 1 v) A B t v hM, sum_mul, sum_mul] apply sum_congr rfl intro m hm by_cases hd : m ∣ v · have hq := reconstructed_factor_mem_Icc hv hd (le_refl v) have hqpos : 0 < v/m := (mem_Icc.mp hq).1 simp only [hd, true_and, hq, if_true] by_cases hh : v/m ∈ H · simp only [hh, if_true] · simp only [hh, if_false, zero_mul] have hWv : W v = W (v/m) := by calc _ = W (m*(v/m)) := congrArg W (Nat.mul_div_cancel' hd).symm _ = _ := hW m hm (v/m) hqpos have hz := congrArg (fun z : ℂ => conj z) (hsupport (v/m) hqpos hh) simp only [map_mul, Complex.conj_ofReal, map_zero] at hz rw [hWv] linear_combination -(A m * typeIIPhase t m) * hz · simp only [hd, false_and, if_false] theorem typeII_weighted_rough_endpoint_support (P M H R C : Finset ℕ) (A c : ℕ → ℂ) (W : ℕ → ℝ) (t σ : ℝ) {v : ℕ} (hv : 0 < v) (hM : ∀ m ∈ M, 0 < m) (hfree : ∀ m ∈ M, Disjoint m.primeFactors P) (hW : ∀ m ∈ M, ∀ h : ℕ, 0 < h → W (m*h)=W h) (hsupport : ∀ h : ℕ, 0 < h → h ∉ H → (W h:ℂ)*typeIIRoughConvolution R C σ c (primePoolFreePart P h)=0) : typeIIDirectEndpoint M H A (fun h => typeIIRoughConvolution R C σ c (primePoolFreePart P h)) t v * (W v:ℂ) = typeIIInvariantEndpoint P M R C A c t σ v * (W v:ℂ) := by rw [typeII_weighted_direct_endpoint_support M H A _ W t hv hM hW hsupport, typeII_direct_rough_endpoint_eq_invariant_of_complete P M (Icc 1 v) R C A c t σ hv hM hfree (fun m _ hd => reconstructed_factor_mem_Icc hv hd (le_refl v))] rfl theorem typeII_cross_pair_eq_invariant_of_weighted_support (P M H R C : Finset ℕ) (A c : ℕ → ℂ) (W : ℕ → ℝ) (ρ σ ξ₁ ξ₂ ξ₃ : ℝ) {z w : ℕ} (hz : 0 < z) (hw : 0 < w) (hM : ∀ m ∈ M, 0 < m) (hH : ∀ h ∈ H, 0 < h) (hfree : ∀ m ∈ M, Disjoint m.primeFactors P) (hW : ∀ m ∈ M, ∀ h : ℕ, 0 < h → W (m*h)=W h) (hsupport : ∀ h : ℕ, 0 < h → h ∉ H → (W h:ℂ)*typeIIRoughConvolution R C σ c (primePoolFreePart P h)=0) : typeIICrossPairCoefficient M H A W (fun h => typeIIRoughConvolution R C σ c (primePoolFreePart P h)) ρ ξ₁ ξ₂ ξ₃ z w = typeIIPhase (ρ+ξ₃) z * typeIIPhase (-ρ) w * conj (typeIIInvariantEndpoint P M R C A c (ρ-ξ₂) σ z) * typeIIInvariantEndpoint P M R C A c (ξ₁+ρ) σ w * (W z:ℂ) * (W w:ℂ) := by rw [typeII_cross_pair_coefficient_factorization M H A W _ ρ ξ₁ ξ₂ ξ₃ z w hM hH (fun m hm h hh => hW m hm h (hH h hh))] have hz' := typeII_weighted_rough_endpoint_support P M H R C A c W (ρ-ξ₂) σ hz hM hfree hW hsupport have hw' := typeII_weighted_rough_endpoint_support P M H R C A c W (ξ₁+ρ) σ hw hM hfree hW hsupport have hzc := congrArg (fun x : ℂ => conj x) hz' simp only [map_mul, Complex.conj_ofReal] at hzc calc _ = (typeIIPhase (ρ+ξ₃) z * typeIIPhase (-ρ) w) * (conj (typeIIDirectEndpoint M H A (fun h => typeIIRoughConvolution R C σ c (primePoolFreePart P h)) (ρ-ξ₂) z) * (W z:ℂ)) * (typeIIDirectEndpoint M H A (fun h => typeIIRoughConvolution R C σ c (primePoolFreePart P h)) (ξ₁+ρ) w * (W w:ℂ)) := by ring _ = _ := by rw [hzc, hw']; ring end Bounty end section /- The actual marked coefficients are unchanged by factors outside the prime pool. -/ open Finset namespace Bounty theorem physical_divisor_pool_mul_free {G : Type*} (P : G → Finset ℕ) (g : G) (Q : Finset ℕ) (hP : ∀ p ∈ P g, p.Prime) (hPQ : P g ⊆ Q) (a b : ℕ) (hb : b ≠ 0) (hfree : Disjoint b.primeFactors Q) : physicalDivisorPool P g ((a * b : ℕ) : ℤ) = physicalDivisorPool P g (a : ℤ) := by exact physical_divisor_pool_mul_disjoint P g hP (hfree.symm.mono_left hPQ) (Nat.mem_factoredNumbers_of_primeFactors_subset hb (fun _ h => h)) a theorem marked_divisor_weight_mul_free {G : Type*} (groups : Finset G) (P : G → Finset ℕ) (Q : Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (hP : ∀ g ∈ groups, ∀ p ∈ P g, p.Prime) (hPQ : ∀ g ∈ groups, P g ⊆ Q) (a b : ℕ) (hb : b ≠ 0) (hfree : Disjoint b.primeFactors Q) : markedDivisorWeight groups P q V t ((a * b : ℕ) : ℤ) = markedDivisorWeight groups P q V t (a : ℤ) := by unfold markedDivisorWeight apply prod_congr rfl intro g hg simp only [physicalOmega, physical_divisor_pool_mul_free P g Q (hP g hg) (hPQ g hg) a b hb hfree] theorem group_marked_average_mul_free {G : Type*} [Fintype G] (P : G → Finset ℕ) (Q : Finset ℕ) (t : G → ℕ) (hP : ∀ g, ∀ p ∈ P g, p.Prime) (hPQ : ∀ g, P g ⊆ Q) (a b : ℕ) (hb : b ≠ 0) (hfree : Disjoint b.primeFactors Q) (c : GroupMarkedLists P t → ℂ) : groupMarkedAverage P t ((a * b : ℕ) : ℤ) c = groupMarkedAverage P t (a : ℤ) c := by apply group_marked_average_congr_divisor_pools intro g exact physical_divisor_pool_mul_free P g Q (hP g) (hPQ g) a b hb hfree theorem primePoolPart_mul_pool_free (Q : Finset ℕ) (a b : ℕ) (hb : b ≠ 0) (hfree : Disjoint b.primeFactors Q) : primePoolPart Q (a * b) = primePoolPart Q a := by by_cases ha : a = 0 · simp only [ha, zero_mul] · rw [primePoolPart_mul Q ha hb, primePoolPart_eq_one_of_disjoint hfree.symm (Nat.mem_factoredNumbers_of_primeFactors_subset hb (fun _ h => h)), mul_one] end Bounty end section /- A four-factor convolution is majorized by the fourth Dirichlet power of zeta. -/ open Finset namespace Bounty theorem divisor_card_eq_zeta_square (n : ℕ) : n.divisors.card = (ArithmeticFunction.zeta ^ 2) n := by rw [pow_two, ArithmeticFunction.zeta_mul_apply] calc _ = ∑ _d ∈ n.divisors, (1 : ℕ) := by simp only [sum_const, smul_eq_mul, mul_one] _ = _ := by apply sum_congr rfl intro d hd exact (ArithmeticFunction.zeta_apply_ne (Nat.ne_of_gt (Nat.pos_of_mem_divisors hd))).symm theorem divisor_sum_zeta_norm_le (δ f : ℕ → ℂ) {D B : ℝ} (hD : 0 ≤ D) (_hB : 0 ≤ B) (k n : ℕ) (hδ : ∀ d, ‖δ d‖ ≤ D) (hf : ∀ m, ‖f m‖ ≤ B * ((ArithmeticFunction.zeta ^ k) m : ℝ)) : ‖∑ d ∈ n.divisors, δ d * f (n / d)‖ ≤ D * B * ((ArithmeticFunction.zeta ^ (k + 1)) n : ℝ) := by calc _ ≤ ∑ d ∈ n.divisors, ‖δ d * f (n / d)‖ := norm_sum_le _ _ _ ≤ ∑ d ∈ n.divisors, D * (B * ((ArithmeticFunction.zeta ^ k) (n / d) : ℝ)) := by apply sum_le_sum intro d _ rw [norm_mul] exact mul_le_mul (hδ d) (hf (n / d)) (norm_nonneg _) hD _ = D * B * (∑ d ∈ n.divisors, ((ArithmeticFunction.zeta ^ k) d : ℝ)) := by rw [← mul_sum, ← mul_sum, Nat.sum_div_divisors n (fun d => ((ArithmeticFunction.zeta ^ k) d : ℝ))] ring _ = _ := by rw [pow_succ, ArithmeticFunction.mul_zeta_apply, Nat.cast_sum] theorem divisor_pair_convolution_norm_le (β γ : ℕ → ℂ) {B C : ℝ} (hB : 0 ≤ B) (_hC : 0 ≤ C) (hβ : ∀ d, ‖β d‖ ≤ B) (hγ : ∀ d, ‖γ d‖ ≤ C) (n : ℕ) : ‖∑ d ∈ n.divisors, β d * γ (n / d)‖ ≤ B * C * ((ArithmeticFunction.zeta ^ 2) n : ℝ) := by calc _ ≤ ∑ d ∈ n.divisors, ‖β d * γ (n / d)‖ := norm_sum_le _ _ _ ≤ ∑ _d ∈ n.divisors, B * C := by apply sum_le_sum intro d _ rw [norm_mul] exact mul_le_mul (hβ d) (hγ (n / d)) (norm_nonneg _) hB _ = _ := by rw [sum_const, nsmul_eq_mul, divisor_card_eq_zeta_square]; ring theorem endpoint_triple_convolution_zeta_bound (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ d, ‖α d‖ ≤ A) (hβ : ∀ d, ‖β d‖ ≤ B) (hγ : ∀ d, ‖γ d‖ ≤ C) (n : ℕ) : ‖endpointTripleConvolution α β γ n‖ ≤ A * B * C * ((ArithmeticFunction.zeta ^ 3) n : ℝ) := by have h := divisor_sum_zeta_norm_le α (fun m => ∑ d ∈ m.divisors, β d * γ (m / d)) hA (mul_nonneg hB hC) 2 n hα (divisor_pair_convolution_norm_le β γ hB hC hβ hγ) simpa only [endpointTripleConvolution, mul_sum, ← mul_assoc] using h theorem endpoint_four_convolution_zeta_bound (δ α β γ : ℕ → ℂ) {D A B C : ℝ} (hD : 0 ≤ D) (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hδ : ∀ d, ‖δ d‖ ≤ D) (hα : ∀ d, ‖α d‖ ≤ A) (hβ : ∀ d, ‖β d‖ ≤ B) (hγ : ∀ d, ‖γ d‖ ≤ C) (n : ℕ) : ‖endpointFourConvolution δ α β γ n‖ ≤ D * A * B * C * ((ArithmeticFunction.zeta ^ 4) n : ℝ) := by have h := divisor_sum_zeta_norm_le δ (endpointTripleConvolution α β γ) hD (mul_nonneg (mul_nonneg hA hB) hC) 3 n hδ (endpoint_triple_convolution_zeta_bound α β γ hA hB hC hα hβ hγ) simpa only [endpointFourConvolution, ← mul_assoc] using h end Bounty end section /- The actual four-factor divisor convolution equals its finite box transform. -/ open Finset namespace Bounty theorem endpoint_four_finite_transform (S D A B C : Finset ℕ) (δ α β γ F : ℕ → ℂ) (hD : ∀ d ∈ D, 0 < d) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) (hδ : ∀ d, d ∉ D → δ d = 0) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (hγ : ∀ c, c ∉ C → γ c = 0) (hS : ∀ d ∈ D, ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, d*a*b*c ∈ S) : (∑ n ∈ S, endpointFourConvolution δ α β γ n*F n) = ∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, δ d*α a*β b*γ c*F (d*a*b*c) := by classical let U := (B ×ˢ C).image (fun bc => bc.1*bc.2) let V := (A ×ˢ U).image (fun ar => ar.1*ar.2) have hU : ∀ r ∈ U, 0 < r := finite_natural_product_pos B C hB hC have hV : ∀ r ∈ V, 0 < r := finite_natural_product_pos A U hA hU have hf : ∀ r, r ∉ V → endpointTripleConvolution α β γ r = 0 := endpoint_triple_finite_support A B C α β γ hA hB hC hα hβ hγ have hout := finite_divisor_convolution_transform S D V δ (endpointTripleConvolution α β γ) F hD hV hδ hf (by intro d hd r hr obtain ⟨ar,har,rfl⟩ := mem_image.mp hr obtain ⟨bc,hbc,hbcEq⟩ := mem_image.mp (mem_product.mp har).2 rw [← hbcEq] simpa only [Nat.mul_assoc] using hS d hd ar.1 (mem_product.mp har).1 bc.1 (mem_product.mp hbc).1 bc.2 (mem_product.mp hbc).2) calc _ = ∑ d ∈ D, ∑ r ∈ V, δ d*endpointTripleConvolution α β γ r*F (d*r) := hout _ = _ := by apply sum_congr rfl intro d hd have hi := endpoint_triple_finite_transform V A B C α β γ (fun r => F (d*r)) hA hB hC hα hβ hγ (by intro a ha b hb c hc apply mem_image.mpr refine ⟨(a,b*c),mem_product.mpr ⟨ha,?_⟩,?_⟩ · exact mem_image.mpr ⟨(b,c),mem_product.mpr ⟨hb,hc⟩,rfl⟩ · exact (Nat.mul_assoc a b c).symm) calc _ = δ d*(∑ r ∈ V, endpointTripleConvolution α β γ r*F (d*r)) := by rw [mul_sum] apply sum_congr rfl intro r hr ring _ = δ d*(∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, α a*β b*γ c*F (d*(a*b*c))) := congrArg (fun z => δ d*z) hi _ = _ := by simp only [mul_sum,mul_assoc] theorem endpoint_four_finite_mellin (S D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (hD : ∀ d ∈ D, 0 < d) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) (hδ : ∀ d, d ∉ D → δ d = 0) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (hγ : ∀ c, c ∉ C → γ c = 0) (hS : ∀ d ∈ D, ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, d*a*b*c ∈ S) (t : ℝ) : (∑ n ∈ S, endpointFourConvolution δ α β γ n*harmonicMellinWeight t n) = (∑ d ∈ D, δ d*harmonicMellinWeight t d)* (∑ a ∈ A, α a*harmonicMellinWeight t a)* (∑ b ∈ B, β b*harmonicMellinWeight t b)* (∑ c ∈ C, γ c*harmonicMellinWeight t c) := by rw [endpoint_four_finite_transform S D A B C δ α β γ _ hD hA hB hC hδ hα hβ hγ hS] exact harmonic_mellin_four_factor_box D A B C hD hA hB hC δ α β γ t end Bounty end section /- A nonzero coefficient supplies actual supported integer factors. -/ open Finset namespace Bounty theorem divisor_pair_nonzero_factors (α β : ℕ → ℂ) {n : ℕ} (hn : (∑ d ∈ n.divisors, α d*β (n/d)) ≠ 0) : ∃ a b : ℕ, 0 < a ∧ 0 < b ∧ α a ≠ 0 ∧ β b ≠ 0 ∧ a*b = n := by obtain ⟨a,ha,hna⟩ := exists_ne_zero_of_sum_ne_zero hn have hb : 0 < n/a := Nat.pos_of_ne_zero (by intro hz have he := Nat.mul_div_cancel' (Nat.dvd_of_mem_divisors ha) rw [hz,mul_zero] at he exact (Nat.ne_zero_of_mem_divisors ha) he.symm) refine ⟨a,n/a,Nat.pos_of_mem_divisors ha,hb,?_,?_,Nat.mul_div_cancel' (Nat.dvd_of_mem_divisors ha)⟩ · intro hz exact hna (by rw [hz,zero_mul]) · intro hz exact hna (by rw [hz,mul_zero]) theorem endpoint_triple_nonzero_factors (α β γ : ℕ → ℂ) {n : ℕ} (hn : endpointTripleConvolution α β γ n ≠ 0) : ∃ a b c : ℕ, 0 < a ∧ 0 < b ∧ 0 < c ∧ α a ≠ 0 ∧ β b ≠ 0 ∧ γ c ≠ 0 ∧ a*b*c = n := by unfold endpointTripleConvolution at hn obtain ⟨a,ha,hna⟩ := exists_ne_zero_of_sum_ne_zero hn obtain ⟨b,hb,hnab⟩ := exists_ne_zero_of_sum_ne_zero hna have ha0 := Nat.pos_of_mem_divisors ha have hb0 := Nat.pos_of_mem_divisors hb have hc0 : 0 < n/a/b := Nat.pos_of_ne_zero (by intro hz have he := Nat.mul_div_cancel' (Nat.dvd_of_mem_divisors hb) rw [hz,mul_zero] at he exact (Nat.ne_zero_of_mem_divisors hb) he.symm) have hα : α a ≠ 0 := by intro hz; exact hnab (by rw [hz,zero_mul,zero_mul]) have hβ : β b ≠ 0 := by intro hz; exact hnab (by rw [hz,mul_zero,zero_mul]) have hγ : γ (n/a/b) ≠ 0 := by intro hz; exact hnab (by rw [hz,mul_zero]) refine ⟨a,b,n/a/b,ha0,hb0,hc0,hα,hβ,hγ,?_⟩ rw [Nat.mul_assoc,Nat.mul_div_cancel' (Nat.dvd_of_mem_divisors hb), Nat.mul_div_cancel' (Nat.dvd_of_mem_divisors ha)] end Bounty end section /- One explicit finite position set covers both endpoints of every original shared/free shift with quotient in the prescribed finite set. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Split each original injective mark list into its shared and unshared embeddings. -/ open Finset open scoped Classical namespace Bounty abbrev PhysicalCutGroupData (P : Finset ℕ) {J : ℕ} (C : Finset (Fin J)) (ell : ℕ) := {f : (↥(univ \ C) ↪ ↥P) × (Fin (ell+C.card) ↪ ↥P) // Disjoint (Set.range f.1) (Set.range f.2)} noncomputable def physicalCutGroupEquiv (P : Finset ℕ) {J : ℕ} (C : Finset (Fin J)) (ell : ℕ) : (PhysicalSlots J ell ↪ ↥P) ≃ PhysicalCutGroupData P C ell := (Equiv.embeddingCongr (physicalCutSlotEquiv C).symm (Equiv.refl ↥P)).trans Equiv.sumEmbeddingEquivProdEmbeddingDisjoint noncomputable def physicalCutListEquiv {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) : PhysicalMarkLists P J ell ≃ (∀ g, PhysicalCutGroupData (P g) (C g) ell) := Equiv.piCongrRight (fun g => physicalCutGroupEquiv (P g) (C g) ell) theorem physical_cut_list_unshared {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (g : G) : (physicalCutListEquiv P C ell L g).val.2 = physicalGroupUnsharedEmbedding C L g := by apply Function.Embedding.ext intro i rfl end Bounty end section /- The actual candidate pools supply a common harmonic floor, exponentially large primes and a logarithmic bound on the total shared-slot count. -/ open Finset Filter open scoped Classical namespace Bounty theorem exists_candidate_shared_error_inputs {c : ℝ} (hc : 0 < c) (J : ℕ) : ∃ v A : ℝ, 0 < v ∧ 0 ≤ A ∧ ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ((J * S.card : ℕ) : ℝ) ≤ A * Real.log L ∧ ∀ (g : S), v ≤ ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ) ∧ ∀ p ∈ candidatePBand (c*L) g.val, p.Prime ∧ Real.exp (L^(1/10 : ℝ)) ≤ (p : ℝ) := by obtain ⟨v, V, hv, _, hpool⟩ := exists_candidate_P_pool_bounds hc refine ⟨v, (J : ℝ) * (2 / (5 * Real.log 2)), hv, by positivity, ?_⟩ filter_upwards [hpool] with L hL intro S hS refine ⟨?_, ?_⟩ · have hcard : (S.card : ℝ) ≤ (2 / (5 * Real.log 2)) * Real.log L := (Nat.cast_le.mpr (card_le_card hS)).trans hL.2.2.2.1 simpa only [Nat.cast_mul, mul_assoc] using mul_le_mul_of_nonneg_left hcard (Nat.cast_nonneg J) · intro g obtain ⟨hlo, _, hp⟩ := hL.2.2.2.2.2 g.val (hS g.property) exact ⟨hlo, fun p hmem => ⟨(hp p hmem).1, (hp p hmem).2.1.le⟩⟩ end Bounty end section /- Finite multiplication pullback retaining the original position guard. -/ open Finset open scoped Classical namespace Bounty theorem integer_guarded_position_sum {s : ℤ} (hs : s ≠ 0) (positions W : Finset ℤ) (F : ℤ → ℂ) (hzero : ∀ n ∈ positions, ¬ s ∣ n → F n = 0) (hW : ∀ n ∈ positions, s ∣ n → F n ≠ 0 → n / s ∈ W) : (∑ n ∈ positions, F n) = ∑ w ∈ W, if s * w ∈ positions then F (s * w) else 0 := by let A := W.filter (fun w => s * w ∈ positions) have hp := integer_scaled_position_sum hs A positions (fun w hw => (mem_filter.mp hw).2) (fun w => F (s * w)) calc _ = ∑ n ∈ positions, if s ∣ n ∧ n / s ∈ A then F (s * (n / s)) else 0 := by apply sum_congr rfl intro n hn by_cases hd : s ∣ n · rw [Int.mul_ediv_cancel' hd] by_cases hf : F n = 0 · simp only [hf, ite_self] · exact (if_pos ⟨hd, mem_filter.mpr ⟨hW n hn hd hf, by simpa only [Int.mul_ediv_cancel' hd] using hn⟩⟩).symm · rw [if_neg (fun h => hd h.1), hzero n hn hd] _ = ∑ w ∈ A, F (s * w) := hp _ = _ := by rw [sum_filter] end Bounty end section /- Positive absolute endpoints on the nonzero support of the original root test. -/ namespace Bounty end Bounty end section /- The positive-integer extension of the actual invariant triple endpoint. -/ open Finset namespace Bounty noncomputable def positiveInvariantEndpoint (P : Finset ℕ) (α β γ : ℕ → ℂ) (n : ℤ) : ℂ := if 0 < n then invariantTripleEndpoint P α β γ n.natAbs else 0 theorem positive_invariant_endpoint_nonzero (P : Finset ℕ) (α β γ : ℕ → ℂ) {n : ℤ} (hn : positiveInvariantEndpoint P α β γ n ≠ 0) : 0 < n := by by_contra h exact hn (if_neg h) end Bounty end section /- Positive shifted integer supports transport injectively to natural indices. -/ open Finset namespace Bounty theorem sum_shift_natAbs (S : Finset ℤ) (δ : ℤ) (F : ℕ → ℝ) (hpos : ∀ n ∈ S, 0 ≤ n + δ) : (∑ n ∈ S, F (n + δ).natAbs) = ∑ m ∈ S.image (fun n => (n + δ).natAbs), F m := by rw [sum_image] intro a ha b hb hab have he := congrArg (fun m : ℕ => (m : ℤ)) hab rw [Int.natAbs_of_nonneg (hpos a ha), Int.natAbs_of_nonneg (hpos b hb)] at he exact add_right_cancel he theorem shifted_natAbs_image_bounds (S : Finset ℤ) (δ : ℤ) (N : ℕ) (hpos : ∀ n ∈ S, 0 < n + δ ∧ n + δ ≤ (N : ℤ)) : ∀ m ∈ S.image (fun n => (n + δ).natAbs), 0 < m ∧ m ≤ N := by intro m hm obtain ⟨n, hn, rfl⟩ := mem_image.mp hm have he : ((n + δ).natAbs : ℤ) = n + δ := Int.natAbs_of_nonneg (hpos n hn).1.le constructor · exact_mod_cast (show (0 : ℤ) < ((n + δ).natAbs : ℤ) by rw [he]; exact (hpos n hn).1) · exact_mod_cast (show ((n + δ).natAbs : ℤ) ≤ N by rw [he]; exact (hpos n hn).2) end Bounty end section /- The original four-step schedule has one offset increment and two permutation normalizers per edge. -/ open Finset namespace Bounty def fourStepVertex (n : ℕ) (i : Fin (4 * n + 2)) : Fin (n + 1) := ⟨(i.val + 1) / 4, by have := i.isLt; omega⟩ theorem four_step_vertex_zero (n : ℕ) : fourStepVertex n 0 = 0 := by apply Fin.ext simp only [fourStepVertex, Fin.val_zero, zero_add, Nat.reduceDiv] theorem four_step_vertex_nonedge (n : ℕ) (i : Fin (4 * n + 1)) (hi : i.val % 4 ≠ 2) : fourStepVertex n i.castSucc = fourStepVertex n i.succ := by apply Fin.ext dsimp only [fourStepVertex, Fin.val_castSucc, Fin.val_succ] omega theorem four_step_vertex_edge_before {n : ℕ} (j : Fin n) : fourStepVertex n ⟨4 * j.val + 2, by have := j.isLt; omega⟩ = j.castSucc := by apply Fin.ext dsimp only [fourStepVertex, Fin.val_castSucc] omega theorem four_step_vertex_edge_after {n : ℕ} (j : Fin n) : fourStepVertex n ⟨4 * j.val + 3, by have := j.isLt; omega⟩ = j.succ := by apply Fin.ext dsimp only [fourStepVertex, Fin.val_succ] omega theorem four_step_block_product (n : ℕ) (f : Fin (4 * n + 1) → ℂ) : (∏ i, f i) = (∏ j : Fin n, ∏ t : Fin 4, f ⟨4 * j.val + t.val, by have := j.isLt; have := t.isLt; omega⟩) * f (Fin.last (4 * n)) := by rw [Fin.prod_univ_castSucc] congr 1 rw [← Fintype.prod_prod_type (fun jt : Fin n × Fin 4 => f ⟨4 * jt.1.val + jt.2.val, by have := jt.1.isLt; have := jt.2.isLt; omega⟩)] symm apply prod_bij (fun (jt : Fin n × Fin 4) _ => (⟨4 * jt.1.val + jt.2.val, by have := jt.1.isLt; have := jt.2.isLt; omega⟩ : Fin (4 * n))) · intros; exact mem_univ _ · intro a _ b _ hab have hv := congrArg Fin.val hab have ha := a.2.isLt have hb := b.2.isLt apply Prod.ext <;> apply Fin.ext <;> dsimp only at hv ⊢ <;> omega · intro i _ refine ⟨(⟨i.val / 4, by have := i.isLt; omega⟩, ⟨i.val % 4, by omega⟩), mem_univ _, ?_⟩ apply Fin.ext dsimp only omega · intros; rfl theorem four_step_normalized_product (n : ℕ) (c : ℂ) (f : Fin (4 * n + 1) → ℂ) (hvisit : ∀ j : Fin (n + 1), f ⟨4 * j.val, by have := j.isLt; omega⟩ = 1) (hleft : ∀ j : Fin n, f ⟨4 * j.val + 1, by have := j.isLt; omega⟩ = c) (hright : ∀ j : Fin n, f ⟨4 * j.val + 3, by have := j.isLt; omega⟩ = c) : (∏ i, f i) = ∏ j : Fin n, c * c * f ⟨4 * j.val + 2, by have := j.isLt; omega⟩ := by rw [four_step_block_product] have hlast : f (Fin.last (4 * n)) = 1 := hvisit (Fin.last n) rw [hlast, mul_one] apply prod_congr rfl intro j _ rw [Fin.prod_univ_four] change f ⟨4 * j.val + 0, _⟩ * f ⟨4 * j.val + 1, _⟩ * f ⟨4 * j.val + 2, _⟩ * f ⟨4 * j.val + 3, _⟩ = _ have hzero : f ⟨4 * j.val + 0, by have := j.isLt; omega⟩ = 1 := hvisit j.castSucc rw [hzero, hleft, hright] ring end Bounty end section /- Exact auxiliary shift averages reduce to the first endpoint's major energy once the actual multiplier has been bounded on minor arcs. -/ open Finset MeasureTheory open scoped Classical ComplexConjugate namespace Bounty theorem physical_aux_fourier_continuous {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) : Continuous (physicalAuxFourierMultiplier P V A B hU hAB k bA bB) := by unfold physicalAuxFourierMultiplier apply continuous_finsetSum intro aux _ exact continuous_const.mul (continuous_fourier_real _) theorem physical_aux_shift_major_energy {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hA : ∀ a, ‖bA a‖ ≤ 1) (hB : ∀ b, ‖bB b‖ ≤ 1) (S T : Finset ℤ) (f g : ℤ → ℂ) (M : Set ℝ) (hM : MeasurableSet M) {ε : ℝ} (hε : 0 ≤ ε) (hminor : ∀ θ, θ ∉ M → ‖physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ‖ ≤ ε) : ‖∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * bA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * bB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 * ∑ n ∈ S, let δ : ℤ := k * (∏ g, ∏ j : repeatedBigAuxCut A B g, (aux g j).val : ℕ) if n+δ ∈ T then conj (f n)*g (n+δ) else 0‖ ≤ Real.sqrt (ε^2*(∑ n ∈ S, ‖f n‖^2) + ∫ x in M ∩ Set.Ioc 0 1, ‖finiteFourierSum S f x‖^2) * Real.sqrt (∑ n ∈ T, ‖g n‖^2) := by rw [physical_aux_averaged_shift_fourier] exact finite_fourier_major_energy S T f g _ (physical_aux_fourier_continuous P V A B hU hAB k bA bB) M hM hε (physical_aux_fourier_norm P V A B hU hAB k bA bB hV hMass hA hB) hminor end Bounty end section /- Relabeling full-event edge keys preserves the actual dependent path and every pulled-back deterministic phase. -/ namespace Bounty section Keys variable {I K J G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → G → ℤ) (f : I → K) def fullPermutationKeyEventEquiv (tag : Option (J ⊕ I)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FullPermutationMixedEvent n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) tag x ≃ FullPermutationMixedEvent n S B A Δ D (tag.map (Sum.map id f)) x := match tag with | none => Equiv.refl _ | some (.inl _) => Equiv.refl _ | some (.inr _) => Equiv.refl _ theorem full_permutation_key_target (tag : Option (J ⊕ I)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) tag x) : fullPermutationMixedEventTarget n S B A Δ D (tag.map (Sum.map id f)) x (fullPermutationKeyEventEquiv n S B A Δ D f tag x e) = fullPermutationMixedEventTarget n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) tag x e := by cases tag with | none => rfl | some tag => cases tag <;> rfl noncomputable def fullPermutationKeyPathEquiv (steps : List (Option (J ⊕ I))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FullPermutationMixedPath n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) steps x ≃ FullPermutationMixedPath n S B A Δ D (steps.map (Option.map (Sum.map id f))) x := (finiteEventPathEquiv _ _ _ _ id (fullPermutationKeyEventEquiv n S B A Δ D f) (fun tag x e => (full_permutation_key_target n S B A Δ D f tag x e).symm) steps x).trans (finiteEventPathMapEquiv (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (Option.map (Sum.map id f)) steps x) theorem full_permutation_key_ledger_phase {L : Type*} (update : ∀ tag, L → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullPermutationMixedEvent n S B A Δ D tag x → L) (phase : ∀ tag, L → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullPermutationMixedEvent n S B A Δ D tag x → ℂ) (steps : List (Option (J ⊕ I))) (l : L) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) steps x) : deterministicLedgerPhase (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) update phase (steps.map (Option.map (Sum.map id f))) l x (fullPermutationKeyPathEquiv n S B A Δ D f steps x p) = deterministicLedgerPhase (FullPermutationMixedEvent n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i))) (fullPermutationMixedEventTarget n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i))) (fun tag l x e => update (tag.map (Sum.map id f)) l x (fullPermutationKeyEventEquiv n S B A Δ D f tag x e)) (fun tag l x e => phase (tag.map (Sum.map id f)) l x (fullPermutationKeyEventEquiv n S B A Δ D f tag x e)) steps l x p := by unfold fullPermutationKeyPathEquiv erw [Equiv.trans_apply] rw [← deterministic_ledger_phase_map] exact deterministic_ledger_phase_equiv _ _ _ _ id _ _ _ _ (by intros; rfl) _ _ (by intros; rfl) steps l x p end Keys end Bounty end section /- The exact original auxiliary multiplier is small outside a measurable rational major set, with an explicit polynomial choice of denominator cutoff. -/ open Finset open scoped Classical namespace Bounty theorem physical_aux_fourier_minor_bound {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hA : ∀ a, ‖bA a‖ ≤ 1) (hB : ∀ b, ‖bB b‖ ≤ 1) (U W : ℕ) (hUpos : 0 < U) (hWpos : 0 < W) (hArange : ∀ a, bA a ≠ 0 → U ≤ ∏ i : A, (a i).val ∧ (∏ i : A, (a i).val) < 2*U) (hBrange : ∀ b, bB b ≠ 0 → W ≤ ∏ i : B, (b i).val ∧ (∏ i : B, (b i).val) < 2*W) {C D : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) (hAtomA : ∀ m : ℕ, (∑ a ∈ univ.filter (fun a : (∀ i : A, P i.val.1) => (∏ i : A, (a i).val) = m), finiteProductWeight (fun i : A => physicalLabelLaw V i.val.1) a) ≤ C/(m : ℝ)) (hAtomB : ∀ m : ℕ, (∑ b ∈ univ.filter (fun b : (∀ i : B, P i.val.1) => (∏ i : B, (b i).val) = m), finiteProductWeight (fun i : B => physicalLabelLaw V i.val.1) b) ≤ D/(m : ℝ)) (L κ t q Rsave : ℝ) (hL : 512 ≤ L) (ht : 0 ≤ t) (hq : 0 ≤ q) (hparam : 2*κ+t+2*Rsave+3 ≤ q) (hCb : C ≤ L^κ) (hDb : D ≤ L^κ) (hUlarge : L^q ≤ (U : ℝ)) (hWlarge : L^q ≤ (W : ℝ)) (hlog : Real.log ((U : ℝ)*W) ≤ L^t) : ∀ θ, θ ∉ productMajorArcSet k L q U W → ‖physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ‖ ≤ L^(-Rsave) := by intro θ hminor exact product_minor_arc_norm_bound hL hC hD ht hq hparam hCb hDb hUlarge hWlarge hlog k θ _ (fun _u _r _β hr hcop hβ heq => physical_aux_fourier_dyadic_bound P V A B hU hAB k bA bB hV hMass hA hB U W hUpos hWpos hArange hBrange hC hD hAtomA hAtomB θ hr hcop hβ heq) hminor end Bounty end section open MeasureTheory namespace Bounty theorem local_mellin_interval_mean_square (S : Finset ℕ) (a : ℕ → ℂ) (N : ℕ) (hS : ∀ n ∈ S, 1 ≤ n ∧ n ≤ N) (T : ℝ) (hT : 0 ≤ T) : (∫ t in Set.Icc (-T) T, ‖localMellinPolynomial S a t‖^2) ≤ (2*T+4*(N:ℝ)*(1+Real.log N))*(∑ n ∈ S, ‖a n‖^2) := by have hm := dirichlet_polynomial_mean_square S a N (-T) T (by linarith) hS rw [intervalIntegral.integral_of_le (by linarith), ← integral_Icc_eq_integral_Ioc] at hm rw [show T - -T = 2*T by ring] at hm simpa only [localMellinPolynomial, mul_comm] using hm theorem local_mellin_rapid_tail (S : Finset ℕ) (a : ℕ → ℂ) (N : ℕ) (hS : ∀ n ∈ S, 1 ≤ n ∧ n ≤ N) {L h : ℝ} (hL : 1 ≤ L) (hh : 0 < h) (M : ℕ) : (∫ t in {t : ℝ | L/h < |t|}, (1+|h*t|)^(-((M+2:ℕ):ℝ))*‖localMellinPolynomial S a t‖^2) ≤ (8*(L/h)+8*(N:ℝ)*(1+Real.log N))*(∑ n ∈ S, ‖a n‖^2)*L^(-(M:ℝ)) := by have hE : 0 ≤ ∑ n ∈ S, ‖a n‖^2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) have hlog : 0 ≤ Real.log N := Real.log_natCast_nonneg N have hb := weighted_mean_tail_bound (fun t => ‖localMellinPolynomial S a t‖^2) ((local_mellin_polynomial_continuous S a).norm.pow 2) (fun _ => sq_nonneg _) hL hh (A := 2*(∑ n ∈ S, ‖a n‖^2)) (B := 4*(N:ℝ)*(1+Real.log N)*(∑ n ∈ S, ‖a n‖^2)) (by positivity) M (local_mellin_weighted_energy_integrable S a hh (by exact_mod_cast (by omega : 1 < M+2))) (fun T hT => by have hm := local_mellin_interval_mean_square S a N hS T hT.le nlinarith) convert hb using 1 ring end Bounty end section /- Comparing Mellin decay weights at nearby scales keeps the same polynomial. -/ open MeasureTheory namespace Bounty theorem mellin_decay_weight_scale_le (j : ℕ) {h q : ℝ} (hh : 0 ≤ h) (hq : 0 ≤ q) (hscale : h ≤ 32*q) (t : ℝ) : (1+|q*t|)^(-(j:ℝ)) ≤ (32:ℝ)^j * (1+|h*t|)^(-(j:ℝ)) := by have hx : 0 < 1+|q*t| := by positivity have hy : 0 < 1+|h*t| := by positivity have hxy : 1+|h*t| ≤ 32*(1+|q*t|) := by rw [abs_mul,abs_of_nonneg hh,abs_mul,abs_of_nonneg hq] nlinarith [mul_le_mul_of_nonneg_right hscale (abs_nonneg t)] rw [Real.rpow_neg hx.le, Real.rpow_natCast, Real.rpow_neg hy.le, Real.rpow_natCast] have hp : 1/(1+|q*t|)^j ≤ (32:ℝ)^j/(1+|h*t|)^j := by apply (div_le_div_iff₀ (pow_pos hx j) (pow_pos hy j)).mpr simpa only [one_mul,mul_pow] using pow_le_pow_left₀ hy.le hxy j simpa only [div_eq_mul_inv,one_mul] using hp theorem local_mellin_energy_scale_le {j : ℕ} (hj : 2 ≤ j) (S : Finset ℕ) (a : ℕ → ℂ) {Y Z H : ℝ} (hY : 0 < Y) (hZ : 0 < Z) (hH : 0 < H) (hZY : Z ≤ 32*Y) : (∫ t : ℝ, (1+|(H/Z)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) ≤ (32:ℝ)^j * ∫ t : ℝ, (1+|(H/Y)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2 := by have hjR : 1 < (j:ℝ) := by exact_mod_cast (show 1 < j by omega) have hi := local_mellin_weighted_energy_integrable S a (div_pos hH hZ) hjR have hi' := local_mellin_weighted_energy_integrable S a (div_pos hH hY) hjR have hscale : H/Y ≤ 32*(H/Z) := by calc H/Y ≤ H/(Z/32) := div_le_div_of_nonneg_left hH.le (by positivity) (by linarith) _ = 32*(H/Z) := by ring calc _ ≤ ∫ t : ℝ, (32:ℝ)^j * ((1+|(H/Y)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) := by apply integral_mono hi (hi'.const_mul _) intro t simpa only [mul_assoc] using mul_le_mul_of_nonneg_right (mellin_decay_weight_scale_le j (div_nonneg hH.le hY.le) (div_nonneg hH.le hZ.le) hscale t) (sq_nonneg ‖localMellinPolynomial S a t‖) _ = _ := integral_const_mul _ _ end Bounty end section /- Summing uniform centered local energies over the exact product major region. -/ open Finset MeasureTheory namespace Bounty theorem product_major_energy_of_rational_local (S : Finset ℤ) (f : ℤ → ℂ) {k : ℤ} {L q K U V Y A : ℝ} (hk : k ≠ 0) (hL : 5 ≤ L) (hq : 0 ≤ q) (hK : 0 ≤ K) (hkB : (k.natAbs : ℝ) ≤ L^K) (hU : 0 < U) (hV : 0 < V) (hY : 0 ≤ Y) (hscale : L^q ≤ U*V) (hlocal : ∀ (r : ℕ), 0 < r → (r : ℝ) ≤ L^(K+q) → ∀ a : ℤ, (∫ x in Set.Icc ((a : ℝ)/r-1/(|(k : ℝ)| *(U*V)/L^q)) ((a : ℝ)/r+1/(|(k : ℝ)| *(U*V)/L^q)), ‖finiteFourierSum S f x‖^2) ≤ Y*L^(-(A+2*q+K+1))) : (∫ x in productMajorArcSet k L q U V ∩ Set.Ioc 0 1, ‖finiteFourierSum S f x‖^2) ≤ Y*L^(-A) := by have hLp : 0 < L := by linarith have hwidth : 1/(|(k : ℝ)| *(U*V)/L^q) = L^q/(|(k : ℝ)| *(U*V)) := by rw [one_div_div] have hsum := product_major_energy_uniform_bound S f hk hU hV hscale (E := Y*L^(-(A+2*q+K+1))) ?_ · calc _ ≤ (⌊L^q⌋₊ : ℝ)*(2*((⌊L^q⌋₊*(k.natAbs+1) : ℕ) : ℝ)+1)* (Y*L^(-(A+2*q+K+1))) := hsum _ ≤ L^(2*q+K+1)*(Y*L^(-(A+2*q+K+1))) := mul_le_mul_of_nonneg_right (rational_major_arc_polynomial_count hL hq hK hkB) (mul_nonneg hY (Real.rpow_nonneg hLp.le _)) _ = Y*L^(-A) := by rw [mul_left_comm, ← Real.rpow_add hLp] congr 1 congr 1 ring · intro r hr u _ obtain ⟨hdr, hden⟩ := rational_major_arc_denominator hLp hk hkB hr have he := hlocal (k.natAbs*r) hdr hden (-(k.sign*u)) rw [hwidth, ← product_major_center_positive_denominator hk u (mem_Icc.mp hr).1] at he exact he end Bounty end section /- The exact phase factorization for arbitrary weights on the original auxiliary labels, independently of the Fourier or harmonic pairing. -/ open Finset open scoped Classical namespace Bounty theorem physical_aux_mellin_test_split {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (f : (∀ i : A, P i.val.1) → ℂ) (g : (∀ i : B, P i.val.1) → ℂ) (hposA : ∀ x : (∀ i : A, P i.val.1), 0 < ∏ i, (x i).val) (hposB : ∀ y : (∀ i : B, P i.val.1), 0 < ∏ i, (y i).val) (ζ : ℝ) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : (f (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * physicalPhase ζ (∏ i, ((repeatedBigAuxSplitEquiv P A B hU hAB aux).1 i).val)) * (g (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 * physicalPhase ζ (∏ i, ((repeatedBigAuxSplitEquiv P A B hU hAB aux).2 i).val)) = (f (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * g (repeatedBigAuxSplitEquiv P A B hU hAB aux).2) * physicalPhase ζ (physicalFreeFactor (repeatedBigAuxCut A B) aux) := by have he := repeatedBigAuxSplitEquiv_symm_label_prod P A B hU hAB (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 simp only [Prod.mk.eta, Equiv.symm_apply_apply] at he change physicalFreeFactor (repeatedBigAuxCut A B) aux = _ at he rw [he, physical_phase_mul ζ (hposA _) (hposB _)] ring end Bounty end section /- Absorb both retained-cell and character expansions into a prescribed saving. -/ open Finset open scoped Classical namespace Bounty theorem prime_retained_pair_cell_decay {I J : Type*} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J] (PA : I → Finset ℕ) (VA : I → ℝ) (PB : J → Finset ℕ) (VB : J → ℝ) {Q : ℕ} {L B C R D Y : ℝ} (hL : 3 ≤ L) (hB : 0 ≤ B) (hQ : (Q : ℝ) ≤ L^R) (hY : 0 ≤ Y) (hPA : ∀ x : (∀ i, PA i), 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L) (hPB : ∀ x : (∀ i, PB i), 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L) (F : ℤ → BoundedPrimitiveCharacter Q → ℤ → BoundedPrimitiveCharacter Q → ℂ) (hF : ∀ d ∈ primeProductRetainedCells PA VA (L^(-B)) (L^(-C)), ∀ χ, ∀ e ∈ primeProductRetainedCells PB VB (L^(-B)) (L^(-C)), ∀ ψ, ‖F d χ e ψ‖ ≤ Y * L^(-(D+2*(B+C+2*R+2)))) : let a := fun d => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := PA) VA)) (fun x => upperLogCell (L^(-B)) (Real.log (∏ i, (x i).val : ℕ))) d : ℝ) : ℂ) let b := fun e => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := PB) VB)) (fun x => upperLogCell (L^(-B)) (Real.log (∏ i, (x i).val : ℕ))) e : ℝ) : ℂ) ‖∑ d ∈ primeProductRetainedCells PA VA (L^(-B)) (L^(-C)), ∑ χ : BoundedPrimitiveCharacter Q, ∑ e ∈ primeProductRetainedCells PB VB (L^(-B)) (L^(-C)), ∑ ψ : BoundedPrimitiveCharacter Q, a d * b e * F d χ e ψ‖ ≤ Y * L^(-D) := by dsimp only have hL0 : 0 < L := by linarith have ha := prime_retained_cell_polynomial_cost (C := C) PA VA hL hB hQ hPA have hb := prime_retained_cell_polynomial_cost (C := C) PB VB hL hB hQ hPB refine (finite_two_cell_expansion_norm _ _ _ _ F (Real.rpow_pos_of_pos hL0 _).le (mul_nonneg hY (Real.rpow_pos_of_pos hL0 _).le) ha hb hF).trans_eq ?_ calc _ = Y * ((L^(B+C+2*R+2) * L^(B+C+2*R+2)) * L^(-(D+2*(B+C+2*R+2)))) := by ring _ = _ := by rw [← Real.rpow_add hL0, ← Real.rpow_add hL0] congr 2 ring end Bounty end section /- Small-conductor character cancellation for the actual candidate coefficient. -/ open Finset Filter namespace Bounty theorem eventually_candidate_character_cancellation (hZ : PrimitiveZeroFreeHalfPlane) {c : ℝ} (hc : 0 < c) (B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ), 0 ≤ q → ∀ (r jStar : ℕ) (hr : 0 < r), 0 < jStar → ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ‖∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime m), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod f)‖ ≤ (16*Real.exp L) * L^(-B) * candidateOneMarkedHarmonicMass c L q * candidateQRestHarmonicMass c L r jStar hr := by filter_upwards [eventually_candidate_character_coprime_convolution hc, eventually_candidate_Q_character_cancellation hZ hc B, eventually_ge_atTop (0 : ℝ)] with L hconv hQ hL intro q hq r jStar hr hj f hf hfL χ hχ m hm hmL let R : ℝ := candidateQRestHarmonicMass c L r jStar hr let C : ℝ := (16*Real.exp L) * L^(-B) * R have hR : 0 ≤ R := candidate_Q_rest_harmonic_nonneg c L r jStar hr have hC : 0 ≤ C := by dsimp only [C]; positivity have htest := hconv q r jStar f m χ (fun _ => 1) simp only [mul_one] at htest rw [htest] calc _ ≤ ∑ a ∈ (candidateSmallPSet c L (16*Real.exp L + 1)).filter (fun a => a.Coprime m), ‖(candidatePWeight c L q a : ℂ) * χ (a : ZMod f) * ∑ n ∈ (arithmeticProductWindow a (Real.exp L)).filter (fun n => n.Coprime m), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod f)‖ := norm_sum_le _ _ _ ≤ ∑ a ∈ (candidateSmallPSet c L (16*Real.exp L + 1)).filter (fun a => a.Coprime m), (candidatePWeight c L q a / (a : ℝ)) * C := by apply sum_le_sum intro a ha have hWa := candidate_P_weight_nonneg c L hq a have ha0 : a ≠ 0 := candidate_small_P_set_nonzero (mem_filter.mp ha).1 have hi := hQ f hf hfL χ hχ m hm hmL r jStar hr hj a ha0 rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_of_nonneg hWa] calc _ ≤ candidatePWeight c L q a * ‖∑ n ∈ (arithmeticProductWindow a (Real.exp L)).filter (fun n => n.Coprime m), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod f)‖ := by apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) exact mul_le_of_le_one_right hWa (χ.norm_le_one _) _ ≤ candidatePWeight c L q a * (((16*Real.exp L)/(a : ℝ)) * L^(-B) * R) := mul_le_mul_of_nonneg_left hi hWa _ = _ := by dsimp only [C]; ring _ ≤ ∑ a ∈ candidateSmallPSet c L (16*Real.exp L + 1), (candidatePWeight c L q a / (a : ℝ)) * C := by apply sum_le_sum_of_subset_of_nonneg (filter_subset _ _) intro a _ _ exact mul_nonneg (div_nonneg (candidate_P_weight_nonneg c L hq a) (Nat.cast_nonneg a)) hC _ = (∑ a ∈ candidateSmallPSet c L (16*Real.exp L + 1), candidatePWeight c L q a / (a : ℝ)) * C := (sum_mul _ _ _).symm _ ≤ candidateOneMarkedHarmonicMass c L q * C := by apply mul_le_mul_of_nonneg_right _ hC exact candidate_full_P_harmonic_sum_le_total (mul_nonneg hc.le hL) hq _ = _ := by dsimp only [C, R]; ring end Bounty end section /- The exact one-step physical/full-state identities compose through an entire finite schedule. The encoding at each cut is explicit, and changing it is permitted at normalized permutation steps. -/ namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) end Physical end Bounty end section /- The difference between two memory caps is precisely the larger-cap path sum over excursions beyond the smaller cap, with its original whole-path phase. -/ open Finset Classical namespace Bounty section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) {b B : ℕ} (h : b ≤ B) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) (steps : List (Option (J ⊕ K))) (phase : ∀ s, FullPermutationMixedPath n S B A Δ D steps s → ℂ) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) end end Bounty end section /- Exponential cancellation in the extracted actual Q-zero prime slot. -/ open Finset Filter namespace Bounty theorem eventually_candidate_Q_prime_exponential_cancellation (hZ : PrimitiveZeroFreeHalfPlane) {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ∀ (a R : ℕ), a ≠ 0 → R ≠ 0 → ‖∑ p ∈ ((candidateQBand (c*L) 0).filter (fun p => p*R ∈ arithmeticProductWindow a (Real.exp L))).filter (fun p => p.Coprime m), χ (p : ZMod f)‖ ≤ ((16*Real.exp L) / ((a*R : ℕ) : ℝ)) * Real.exp (-(c/64)*L) := by filter_upwards [eventually_prime_band_coprime_relative_exponential_bound hZ hc] with L hL intro f hf hfL χ hχ m hm hmL a R ha hR rw [candidate_Q_zero_product_window_eq c L ha] exact hL f hf hfL χ hχ (Real.exp ((6/5 : ℝ)*(c*L))) ((a*R : ℕ) : ℝ) (Real.exp L) (16*Real.exp L) (Real.exp_pos _).le (Nat.cast_pos.mpr (Nat.mul_pos (Nat.pos_of_ne_zero ha) (Nat.pos_of_ne_zero hR))) (Real.exp_pos L).le (by positivity) m hm hmL theorem eventually_candidate_Q_character_exponential_cancellation (hZ : PrimitiveZeroFreeHalfPlane) {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ∀ (r jStar : ℕ) (hr : 0 < r), 0 < jStar → ∀ a : ℕ, a ≠ 0 → ‖∑ n ∈ (arithmeticProductWindow a (Real.exp L)).filter (fun n => n.Coprime m), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod f)‖ ≤ ((16*Real.exp L) / (a : ℝ)) * Real.exp (-(c/64)*L) * candidateQRestHarmonicMass c L r jStar hr := by filter_upwards [eventually_candidate_Q_prime_exponential_cancellation hZ hc] with L hL intro f hf hfL χ hχ m hm hmL r jStar hr hj a ha apply candidate_Q_character_bound_of_prime_bound c L r jStar hr hj (arithmeticProductWindow a (Real.exp L)) χ m ((16*Real.exp L)/(a : ℝ)) (Real.exp (-(c/64)*L)) (by positivity) (Real.exp_nonneg _) intro y have hb := hL f hf hfL χ hχ m hm hmL a (orderedSlotProduct (candidateQRestChoices c L r jStar hr) y) ha (candidate_Q_rest_product_nonzero c L r jStar hr y) simpa only [Nat.cast_mul, div_mul_eq_div_div] using hb end Bounty end section /- Size bounds for the extracted Q-zero prime and its full remaining factor. -/ open Finset Filter namespace Bounty theorem candidate_center_scale_bounds {c : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) : (11/5 : ℝ) * c ≤ 1 ∧ c ≤ 5/11 ∧ 0 < c/2 ∧ c/2 < 1 := by have hr1 : (1 : ℝ) ≤ r := by exact_mod_cast hr have hprod := mul_le_mul_of_nonneg_right hr1 hc.le constructor · nlinarith constructor · nlinarith constructor · positivity · nlinarith theorem candidate_prime_remainder_real_geometry {c L p n : ℝ} (hc : 0 < c) (hscale : (11/5 : ℝ) * c ≤ 1) (hL : 0 ≤ L) (hn : 0 ≤ n) (hpLo : Real.exp (c*L) < p) (hpHi : p ≤ Real.exp ((6/5 : ℝ)*(c*L))) (hprodLo : Real.exp L < p*n) (hprodHi : p*n ≤ 16*Real.exp L) : Real.exp (c*L) < n ∧ n ≤ 16*Real.exp ((1-c)*L) ∧ p ≤ Real.exp ((1-c)*L) ∧ p ≤ 16*Real.exp L ∧ n ≤ 16*Real.exp L := by have hp0 : 0 ≤ p := (Real.exp_pos _).le.trans hpLo.le have hbalance : Real.exp ((6/5 : ℝ)*(c*L)) * Real.exp (c*L) ≤ Real.exp L := by rw [← Real.exp_add] apply Real.exp_le_exp.mpr have h := mul_le_mul_of_nonneg_right hscale hL nlinarith have hnLo : Real.exp (c*L) < n := by by_contra! hbad have h := mul_le_mul hpHi hbad hn (Real.exp_pos _).le exact (not_le_of_gt hprodLo) (h.trans hbalance) have hexp : Real.exp (c*L) * Real.exp ((1-c)*L) = Real.exp L := by rw [← Real.exp_add] congr 1 ring have hnHi : n ≤ 16*Real.exp ((1-c)*L) := by apply (mul_le_mul_iff_right₀ (Real.exp_pos (c*L))).mp calc Real.exp (c*L)*n ≤ p*n := mul_le_mul_of_nonneg_right hpLo.le hn _ ≤ 16*Real.exp L := hprodHi _ = Real.exp (c*L)*(16*Real.exp ((1-c)*L)) := by rw [mul_left_comm, hexp] have hpHi' : p ≤ Real.exp ((1-c)*L) := by apply hpHi.trans apply Real.exp_le_exp.mpr have h := mul_le_mul_of_nonneg_right hscale hL nlinarith have heL : Real.exp ((1-c)*L) ≤ Real.exp L := by apply Real.exp_le_exp.mpr nlinarith [mul_nonneg hc.le hL] refine ⟨hnLo, hnHi, hpHi', ?_, ?_⟩ · exact (hpHi'.trans heL).trans (by nlinarith [Real.exp_pos L]) · exact hnHi.trans (mul_le_mul_of_nonneg_left heL (by norm_num)) theorem candidate_Q_zero_prime_remainder_geometry {c L : ℝ} {r p n : ℕ} (hc : 0 < c) (hr : 0 < r) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hL : 0 ≤ L) (hp : p ∈ candidateQBand (c*L) 0) (hprod : p*n ∈ arithmeticProductWindow 1 (Real.exp L)) : Real.exp (c*L) < (p : ℝ) ∧ Real.exp (c*L) < (n : ℝ) ∧ (n : ℝ) ≤ 16*Real.exp ((1-c)*L) ∧ (p : ℝ) ≤ Real.exp ((1-c)*L) ∧ (p : ℝ) ≤ 16*Real.exp L ∧ (n : ℝ) ≤ 16*Real.exp L ∧ (p : ℝ)*(n : ℝ) ≤ 16*Real.exp L := by have hpBand : p ∈ primeBand (Real.exp (c*L)) (Real.exp ((6/5 : ℝ)*(c*L))) := by simpa only [candidateQBand, dyadicPrimeBand, pow_zero, div_one, one_mul] using hp obtain ⟨_, hpLo, hpHi⟩ := (mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le p).mp hpBand have hw := (mem_arithmeticProductWindow_iff (by norm_num : (1 : ℕ) ≠ 0) (Real.exp L)).mp hprod simp only [one_mul, Nat.cast_mul] at hw have hg := candidate_prime_remainder_real_geometry hc (candidate_center_scale_bounds hc hr hcenter).1 hL (Nat.cast_nonneg n) hpLo hpHi hw.1 hw.2 exact ⟨hpLo, hg.1, hg.2.1, hg.2.2.1, hg.2.2.2.1, hg.2.2.2.2, hw.2⟩ end Bounty end section /- The literal physical row exposes its original permutation or auxiliary choice to the continuation. Ghost observations contain no extra choice. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) noncomputable def physicalObservedMarkRow : Option (I ⊕ K) → (PhysicalMarkObservation P ell C → PhysicalBoundedMarkState P J ell B → ℂ) → PhysicalBoundedMarkState P J ell B → ℂ | none, F, s => ∑ σ : PhysicalPermutations (Fin N) J ell, ((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) * F (.inl σ) (physicalPermuteLabels σ s.1, s.2.1, s.2.2) | some (.inl j), F, s => globalBirthJointCutRawRow (fun g => GlobalBirthRawStep.visit (a := physicalGroupPhaseActivity s.1 g) (fun _ => 0) (β g) (1 - retention j) (V g) ρ (hV g) B) B B (physicalMarkRawExtension (F (.inr none)) s.1) (fun g => (s.2.1 g, boundedOrderedTupleToFinite (s.2.2 g))) | some (.inr j), F, s => ∑ R : PhysicalMarkLists P J ell, ∑ aux : PhysicalAuxLabels P (C j), (ω j (productActiveMemorySplit (fun g => physicalFullSharedIndices (C j g)) B (physicalFullMemoryState (C j) s.1 s.2.2)).1 aux : ℂ) * if physicalListAdmissible (C j) aux s.1 R then jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) (C j) (k j) s.1 R β ρ V aux) (physicalMarkRawExtension (F (.inr (some ⟨j, aux⟩))) R) (fun g => (s.2.1 g, boundedOrderedTupleToFinite (s.2.2 g))) else 0 end Physical end Bounty end section /- The vacuum-to-vacuum scalar of a full permutation/ghost/edge trajectory, with phase comparisons restricted to the paths which contribute. -/ open Finset Classical namespace Bounty section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) (steps : List (Option (J ⊕ K))) end end Bounty end section /- The precise free-tuple prime comparison estimate supplies the actual component error. -/ namespace Bounty open Finset open scoped Classical theorem prime_admissible_component_error_le {I : Type*} [Fintype I] [DecidableEq I] (P : I → Finset ℕ) (V : I → ℝ) (hV : ∀ i, 0 < V i) (hp : ∀ i p, p ∈ P i → 0 < p) (hmass : ∀ i, ∑ p ∈ P i, 1 / (p : ℝ) = V i) (active U W S T A B : Finset I) (hU : U ⊆ active) (hW : W ⊆ active) (hUW : Disjoint U W) (hA : A ⊆ U \ S) (hB : B ⊆ W \ T) (Q : ℕ) (h : ℝ) (keptA keptB : Finset I → Finset ℤ) (ζ Θ : ℝ) (f g : (∀ i, P i) → ℂ) (ε : ℝ) (hε : 0 ≤ ε) (hfree : ∀ α : ℝ, ∀ (u : (∀ i : A, P i.1) → ℂ) (v : (∀ i : B, P i.1) → ℂ), ‖finiteTwoKernelPairingError (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.1) (fun i => V i.1))) (finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.1) (fun i => V i.1))) (primeProductIdealKernel (fun i : A => P i.1) (fun i => V i.1) Q h (keptA A)) (primeProductIdealKernel (fun i : B => P i.1) (fun i => V i.1) Q h (keptB B)) (fun a b => Complex.exp (Complex.I * (ζ * Real.log (((∏ i : A, (a i).val : ℕ) : ℝ) * (∏ i : B, (b i).val : ℕ)) + 2 * Real.pi * (α * (((∏ i : A, (a i).val : ℕ) : ℝ) * (∏ i : B, (b i).val : ℕ))) : ℝ))) u v‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.1) (fun i => V i.1))) u) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.1) (fun i => V i.1))) v)) : ‖cleanKernelPairing (finiteProductWeight (physicalLabelLaw V)) (primeAsymmetricComparisonKernel P V active Q h keptA keptB ζ Θ A B) (finiteCoordinateComponent (physicalLabelLaw V) S U.toList (finiteCoordinateComponent (physicalLabelLaw V) ∅ activeᶜ.toList f)) (finiteCoordinateComponent (physicalLabelLaw V) T W.toList (finiteCoordinateComponent (physicalLabelLaw V) ∅ activeᶜ.toList g)) - cleanRawPairing (finiteProductWeight (physicalLabelLaw V)) (primeActivePhase P active ζ Θ) (finiteCoordinateComponent (physicalLabelLaw V) S U.toList (finiteCoordinateComponent (physicalLabelLaw V) ∅ activeᶜ.toList f)) (finiteCoordinateComponent (physicalLabelLaw V) T W.toList (finiteCoordinateComponent (physicalLabelLaw V) ∅ activeᶜ.toList g))‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (physicalLabelLaw V)) (finiteCoordinateComponent (physicalLabelLaw V) S U.toList (finiteCoordinateComponent (physicalLabelLaw V) ∅ activeᶜ.toList f))) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (physicalLabelLaw V)) (finiteCoordinateComponent (physicalLabelLaw V) T W.toList (finiteCoordinateComponent (physicalLabelLaw V) ∅ activeᶜ.toList g))) := by let μA := finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.1) (fun i => V i.1)) let μB := finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.1) (fun i => V i.1)) let KA := primeProductIdealKernel (fun i : A => P i.1) (fun i => V i.1) Q h (keptA A) let KB := primeProductIdealKernel (fun i : B => P i.1) (fun i => V i.1) Q h (keptB B) let π := fun a : ∀ i : A, P i.1 => ∏ i : A, (a i).val let τ := fun b : ∀ i : B, P i.1 => ∏ i : B, (b i).val let phase := fun (c : ∀ i : ↥(active \ (A ∪ B)), P i.1) (a : ∀ i : A, P i.1) (b : ∀ i : B, P i.1) => primeTuplePhase ζ Θ ((∏ i, (c i).val) * π a * τ b) have hAU : A ⊆ U := fun i hi => (mem_sdiff.mp (hA hi)).1 have hBW : B ⊆ W := fun i hi => (mem_sdiff.mp (hB hi)).1 have hAB : Disjoint A B := hUW.mono hAU hBW have hk : primeActivePhase P active ζ Θ = fun x => phase (finiteCoordinateRestrict (active \ (A ∪ B)) x) (finiteCoordinateRestrict A x) (finiteCoordinateRestrict B x) := by funext x exact prime_active_phase_three_partition P active A B (hAU.trans hU) (hBW.trans hW) hAB ζ Θ x rw [norm_sub_rev, hk] apply finite_admissible_component_slice_error_le (physicalLabelLaw V) (physical_label_law_nonneg V (fun i => (hV i).le)) (fun i => physical_label_law_sum V i (hV i) (hmass i)) active U W S T A B hU hW hUW hA hB KA KB phase f g ε hε intro c u v have hπ : ∀ a, 0 < π a := fun a => prod_pos (fun i _ => hp i.1 (a i).val (a i).property) have hτ : ∀ b, 0 < τ b := fun b => prod_pos (fun i _ => hp i.1 (b i).val (b i).property) have hc : 0 < ∏ i, (c i).val := prod_pos (fun i _ => hp i.1 (c i).val (c i).property) change ‖finiteTwoKernelPairingError μA μB KA KB (phase c) u v‖ ≤ _ rw [show phase c = (fun a b => primeTuplePhase ζ Θ ((∏ i, (c i).val) * π a * τ b)) from rfl, prime_shared_phase_error_norm μA μB KA KB π τ hπ hτ ζ Θ _ hc] exact hfree (Θ * (∏ i, (c i).val : ℕ)) u v end Bounty end section /- Visit identification with the already defined physical residue schedule. The literal tensor row retains its cumulative ledger and both total caps. -/ open Finset namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) end ResiduePath end Bounty end section /- Extending a bounded physical continuation by zero and reading out a bounded physical state exactly recovers that continuation. -/ namespace Bounty theorem physical_mark_extension_roundtrip {N J ell B : ℕ} {P : Fin N → Finset ℕ} (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalMarkRawExtension F s.1 (physicalMarkRawReadout s) = F s := by have hs : ∀ g, (physicalMarkRawReadout s g).2.1 ≤ B := fun g => Nat.le_of_lt_succ (s.2.2 g).1.isLt unfold physicalMarkRawExtension rw [dif_pos hs] apply congrArg F apply Prod.ext rfl apply Prod.ext rfl funext g rcases s.2.2 g with ⟨⟨m, hm⟩, q⟩ rfl end Bounty end section /- Lattice bounds in natural residues and a crude sufficient pair-sieve remainder bound. -/ open Finset namespace Bounty theorem interval_allowed_nat_residue_pairs_error (A B C D r : ℕ) (hr : 0 < r) (R : Finset (ℕ × ℕ)) (hR : ∀ v ∈ R, v.1 < r ∧ v.2 < r) (hAB : A ≤ B) (hCD : C ≤ D) : |(((Finset.product (Ioc A B) (Ioc C D)).filter (fun n : ℕ × ℕ => (n.1 % r, n.2 % r) ∈ R)).card : ℝ) - (R.card : ℝ) * ((((B : ℝ)-A)/r) * (((D : ℝ)-C)/r))| ≤ (R.card : ℝ) * (1 + ((B : ℝ)-A)/r + ((D : ℝ)-C)/r) := by let P := Finset.product (Ioc A B) (Ioc C D) let f : ℕ × ℕ → ℕ × ℕ := fun v => (v.1 % r, v.2 % r) let X := (((B : ℝ)-A)/r) * (((D : ℝ)-C)/r) let E := 1 + ((B : ℝ)-A)/r + ((D : ℝ)-C)/r have hsum : (∑ a ∈ R, ((P.filter (fun v => f v = a)).card : ℝ)) = ((P.filter (fun v => f v ∈ R)).card : ℝ) := by simpa only [sum_const, nsmul_eq_mul, mul_one] using sum_fiberwise_eq_sum_filter P R f (fun _ => (1 : ℝ)) have hbound (a : ℕ × ℕ) (ha : a ∈ R) : |((P.filter (fun v => f v = a)).card : ℝ)-X| ≤ E := by have hset : P.filter (fun v => f v = a) = P.filter (fun v : ℕ × ℕ => v.1 % r = a.1 % r ∧ v.2 % r = a.2 % r) := by apply filter_congr intro v _ change (v.1 % r, v.2 % r) = a ↔ _ rw [Prod.ext_iff, Nat.mod_eq_of_lt (hR a ha).1, Nat.mod_eq_of_lt (hR a ha).2] rw [hset] exact interval_residue_pair_count_error A B C D r a.1 a.2 hAB hCD hr have hid : ((P.filter (fun v => f v ∈ R)).card : ℝ) - (R.card : ℝ)*X = ∑ a ∈ R, (((P.filter (fun v => f v = a)).card : ℝ)-X) := by rw [sum_sub_distrib, hsum] simp only [sum_const, nsmul_eq_mul] change |((P.filter (fun v => f v ∈ R)).card : ℝ) - (R.card : ℝ)*X| ≤ (R.card : ℝ)*E rw [hid] exact (abs_sum_le_sum_abs _ _).trans ((sum_le_sum hbound).trans_eq (by simp)) theorem nat_pair_bad_residue_card_le (p : ℕ) (rough banned : Bool) : (natPairBadResidues p rough banned).card ≤ p^2 := by apply (card_le_card (filter_subset _ _)).trans_eq rw [Finset.product_eq_sprod, card_product, card_range] ring theorem actual_pair_sieve_residue_card_le (m : ℕ) [NeZero m] (P : Finset ℕ) (rough banned : ℕ → Bool) (hP : ∀ p ∈ P, p.Prime) (hPm : ∀ p ∈ P, ¬p ∣ m) : (natPairSieveResidues m (natPairBaseResidues m) P (fun p => natPairBadResidues p (rough p) (banned p))).card ≤ m * (∏ p ∈ P, p)^2 := by rw [actual_pair_sieve_residue_card m P rough banned hP hPm] apply (Nat.mul_le_mul (Nat.totient_le m) (prod_le_prod' (fun p _ => nat_pair_bad_residue_card_le p (rough p) (banned p)))).trans_eq rw [prod_pow] theorem pair_lattice_crude_error {m d R X Y : ℝ} (hm : 0 < m) (hd : 0 < d) (hX : 0 ≤ X) (hY : 0 ≤ Y) (hR : R ≤ m*d^2) : R*(1+X/(m*d)+Y/(m*d)) ≤ m*d^2 + (X+Y)*d := by have hquot : R/(m*d) ≤ d := (div_le_iff₀ (mul_pos hm hd)).mpr (by nlinarith) calc _ = R + (X+Y)*(R/(m*d)) := by ring _ ≤ m*d^2+(X+Y)*d := add_le_add hR (mul_le_mul_of_nonneg_left hquot (add_nonneg hX hY)) end Bounty end section /- Complete state-and-observation records remain injective when cut encodings vary. -/ namespace Bounty section Record variable {O : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (before after : Fin N → Finset (Fin J)) end Record section History variable {O : Type*} {N J ell B steps : ℕ} {P : Fin N → Finset ℕ} (cut : ℕ → Fin N → Finset (Fin J)) end History end Bounty end section /- The concrete prime row, extended by zero outside the active disjoint subset pairs. The valid branch retains the literal physical auxiliary sum. -/ open Finset open scoped Classical namespace Bounty noncomputable def repeatedBigPrimeRawRow {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (ζ Θ : ℝ) (source target : RepeatedBigLists P J ell) : ℂ := ∑ aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J))), repeatedBigUnbannedKernel V (fun _ _ => 1) (fun _ => ∅) ζ (fun _ _ _ => 1) aux source target * physicalReturnPhase Θ (repeatedBigD (fun _ => ∅) source aux) theorem repeated_big_active_pair_avoids_tail {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} {A B : Finset (RepeatedBigFlatIndex G J ell)} (hA : A ⊆ repeatedBigFlatActive J ell) (hB : B ⊆ repeatedBigFlatActive J ell) : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B := by intro g j hj exact repeatedBigFlatActive_not_mem_inr J ell g j ((union_subset hA hB) hj) noncomputable def repeatedBigPrimeComparisonRow {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (Q : ℕ) (h : ℝ) (keptA keptB : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (ζ Θ : ℝ) : RepeatedBigLists P J ell → RepeatedBigLists P J ell → ℂ := if hvalid : A ⊆ repeatedBigFlatActive J ell ∧ B ⊆ repeatedBigFlatActive J ell ∧ Disjoint A B then repeatedBigPrimeRow P V A B (repeated_big_active_pair_avoids_tail hvalid.1 hvalid.2.1) hvalid.2.2 Q h keptA keptB ζ Θ else 0 theorem repeatedBigPrimeComparisonRow_eq {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hA : A ⊆ repeatedBigFlatActive J ell) (hB : B ⊆ repeatedBigFlatActive J ell) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (ζ Θ : ℝ) : repeatedBigPrimeComparisonRow P V A B Q h keptA keptB ζ Θ = repeatedBigPrimeRow P V A B (repeated_big_active_pair_avoids_tail hA hB) hAB Q h keptA keptB ζ Θ := by unfold repeatedBigPrimeComparisonRow rw [dif_pos (show A ⊆ repeatedBigFlatActive J ell ∧ B ⊆ repeatedBigFlatActive J ell ∧ Disjoint A B from ⟨hA, hB, hAB⟩)] theorem repeated_big_prime_comparison_pairing_eq {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hA : A ⊆ repeatedBigFlatActive J ell) (hB : B ⊆ repeatedBigFlatActive J ell) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (ζ Θ : ℝ) (f g : RepeatedBigLists P J ell → ℂ) : cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeComparisonRow P V A B Q h keptA keptB ζ Θ) f g = cleanKernelPairing (finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1)) (primeAsymmetricComparisonKernel (fun i : RepeatedBigFlatIndex G J ell => P i.1) (fun i => V i.1) (repeatedBigFlatActive J ell) Q h keptA keptB ζ Θ A B) (finiteGroupFlattenFunction f) (finiteGroupFlattenFunction g) := by rw [repeatedBigPrimeComparisonRow_eq P V A B hA hB hAB] exact repeated_big_prime_pairing_eq P V A B (repeated_big_active_pair_avoids_tail hA hB) hAB Q h keptA keptB ζ Θ f g theorem repeated_big_prime_comparison_pairing_tail_eq {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hP : ∀ g p, p ∈ P g → 0 < p) (hmass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hA : A ⊆ repeatedBigFlatActive J ell) (hB : B ⊆ repeatedBigFlatActive J ell) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (ζ Θ : ℝ) (f g : RepeatedBigLists P J ell → ℂ) : cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeComparisonRow P V A B Q h keptA keptB ζ Θ) f g = cleanKernelPairing (finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1)) (primeAsymmetricComparisonKernel (fun i : RepeatedBigFlatIndex G J ell => P i.1) (fun i => V i.1) (repeatedBigFlatActive J ell) Q h keptA keptB ζ Θ A B) (finiteCoordinateComponent (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1) ∅ (repeatedBigFlatActive J ell)ᶜ.toList (finiteGroupFlattenFunction f)) (finiteCoordinateComponent (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1) ∅ (repeatedBigFlatActive J ell)ᶜ.toList (finiteGroupFlattenFunction g)) := by rw [repeated_big_prime_comparison_pairing_eq P V A B hA hB hAB] apply finite_asymmetric_comparison_pairing_tail_projection (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1) (fun i => physical_label_law_sum V i.1 (hV i.1) (hmass i.1)) (repeatedBigFlatActive J ell) A B hA hB intro i _ p unfold physicalLabelLaw apply div_ne_zero one_ne_zero exact mul_ne_zero (hV i.1).ne' (by exact_mod_cast (hP i.1 p.val p.property).ne') theorem repeated_big_active_mass_product {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) : repeatedBigActiveMass (J := J) (ell := ell) V (fun _ _ => 1) = finiteProductWeight (fun g => finiteProductWeight (fun _ : PhysicalSlots J ell => physicalLabelLaw (P := P) V g)) := by funext source simp only [repeatedBigActiveMass, finiteProductWeight, tiltedPhysicalBirthLaw, div_one] end Bounty end section /- The coherent ledger at each occurrence is the initial ledger plus prior births. -/ open Finset open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) noncomputable def fullMixedLedgerPriorGroupBirths (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (cut : ℕ) (g : Fin N) : Finset ((h : Fin N) × P h) := univ.biUnion fun j : Fin steps.length => if j.val < cut then univ.biUnion fun b : Fin (fullMixedBirthCapacity S B (steps.get j) g) => (fullMixedLedgerPathBirthLabel n S B A Δ D steps x p ⟨j, g, b⟩).toFinset else ∅ theorem full_mixed_prior_group_births_eq (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (cut : ℕ) (g : Fin N) : fullMixedLedgerPriorGroupBirths n S B A Δ D steps x p cut g = finiteEventPathPriorBirths (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fun tag s e => fullMixedEventGroupBirthImage n S B A Δ D tag s.2 e g) steps x p cut := by ext z simp only [fullMixedLedgerPriorGroupBirths, finiteEventPathPriorBirths, fullMixedEventGroupBirthImage, mem_biUnion, mem_univ, true_and] apply exists_congr intro j split_ifs · simp only [mem_biUnion, mem_univ, true_and, Option.mem_toFinset] rfl · rfl theorem mem_full_mixed_prior_group_births (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (cut : ℕ) (g : Fin N) (z : (h : Fin N) × P h) : z ∈ fullMixedLedgerPriorGroupBirths n S B A Δ D steps x p cut g ↔ ∃ j : Fin steps.length, j.val < cut ∧ ∃ b : Fin (fullMixedBirthCapacity S B (steps.get j) g), fullMixedLedgerPathBirthLabel n S B A Δ D steps x p ⟨j, g, b⟩ = some z := by simp only [fullMixedLedgerPriorGroupBirths, mem_biUnion, mem_univ, true_and] apply exists_congr intro j split_ifs <;> simp_all only [mem_biUnion, mem_univ, true_and, Option.mem_toFinset, Option.mem_def, Finset.notMem_empty, false_and, true_and, iff_self] variable (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem full_mixed_ledger_group_union_before (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (hx : FullMixedLedgerCovers n B x) (hw : ∀ j : Fin steps.length, let e := finiteEventPathOccurrence (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) steps x p j fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V (steps.get j) e.1.2 e.2 ≠ 0) (i : Fin steps.length) (g : Fin N) : fullMixedLedgerGroupImage n B (finiteEventPathOccurrence (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) steps x p i).1 g = fullMixedLedgerGroupImage n B x g ∪ fullMixedLedgerPriorGroupBirths n S B A Δ D steps x p i.val g := by rw [full_mixed_prior_group_births_eq] apply finite_event_path_ledger_union_before _ _ (fun s => fullMixedLedgerGroupImage n B s g) intro j apply full_mixed_ledger_group_image_update n S B A Δ D ω μ q ρ V · exact finite_event_path_occurrence_invariant _ _ (FullMixedLedgerCovers n B) (full_mixed_ledger_target_covers n S B A Δ D) steps x p hx j · exact hw j end Full end Bounty end section /- Literal clean event actions and their exact identification with the full-memory kernel action, including both adjacent active-slot averages. -/ open Finset open scoped Classical namespace Bounty noncomputable def cleanFullMemoryEventAction {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (D : SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) C) → PhysicalAuxLabels P C → G → ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (x : CleanFullMemoryState P J ell B) (rs : PhysicalResidues Ps) : ℂ := let source := (cleanFullMemoryEquiv P J ell B x).2.2.1 let c := (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 let s := (productActiveMemorySplit (cleanFullSharedSlots C) B x).2 let δ := fun c aux (_ : G) => -cleanFullSharedStep k C c aux d let Ψ := fun c aux (fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) => if repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) then K source (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) aux * physicalPhase ζ (cleanFullSharedD C c aux) * physicalReturnPhase θ (cleanFullSharedStep k C c aux d) * physicalPhase ζ (physicalSharedProduct d) else 0 ∑ e : FullActiveEdgeEvent (fun g (q : P g) => q.val) (cleanFullSharedSlots C) B (fun _ => PhysicalAuxLabels P C) δ D x, (fullActiveEdgeEventWeight (fun g (q : P g) => q.val) (cleanFullSharedSlots C) B (fun _ => PhysicalAuxLabels P C) δ D (fun _ aux => physicalAuxMass V C aux) (fun g => tiltedPhysicalBirthLaw V g (b g)) ρ V x e : ℂ) * (if ∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅ then Ψ c e.1 (fun g => (unrestrictedJointEventTarget (fun g (q : P g) => q.val) (δ c e.1) (D c e.1) (fun g => (cleanFullSharedSlots C g)ᶜ.card) B s e.2 g).1) else 0) * f (fullActiveEdgeEventTarget (fun g (q : P g) => q.val) (cleanFullSharedSlots C) B (fun _ => PhysicalAuxLabels P C) δ D x e) (physicalTranslateResidues rs (cleanFullSharedStep k C c e.1 d)) theorem clean_full_memory_event_action_apply {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (D : SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) C) → PhysicalAuxLabels P C → G → ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) (N : G → Fin (B + 1)) (p : FixedOrderedMemoryLabels P (fun g => (N g).val)) (source : RepeatedBigLists P J ell) (rm : FixedOrderedResidues p) (rs : PhysicalResidues Ps) : cleanFullMemoryEventAction V b C ζ θ ρ k D K d f (cleanFullMemoryState N p source rm) rs = if (∑ g, (N g).val) ≤ B then ∑ aux : PhysicalAuxLabels P C, ∑ target : RepeatedBigLists P J ell, (cleanHybridBetweenKernel V b C ζ θ ρ k (fun _ => B) p rm K d aux source target * physicalPhase ζ (physicalSharedProduct d)) * f (cleanFullMemoryState N p target (fixedOrderedResidueTranslate p rm (cleanHybridStep k C source aux d))) (physicalTranslateResidues rs (cleanHybridStep k C source aux d)) else 0 := by have hc : cleanFullMemoryEquiv P J ell B (cleanFullMemoryState N p source rm) = ⟨N, p, source, rm⟩ := (cleanFullMemoryEquiv P J ell B).apply_symm_apply ⟨N, p, source, rm⟩ unfold cleanFullMemoryEventAction rw [hc] exact (by cases Subsingleton.elim dG (Classical.typeDecidableEq G) let x := cleanFullMemoryState N p source rm let c := (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 let s := (productActiveMemorySplit (cleanFullSharedSlots C) B x).2 let δ := fun c aux (_ : G) => -cleanFullSharedStep (P := P) (ell := ell) k C c aux d let Ψ := fun c aux (fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) => if repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) then K source (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) aux * physicalPhase ζ (cleanFullSharedD (P := P) (ell := ell) C c aux) * physicalReturnPhase θ (cleanFullSharedStep (P := P) (ell := ell) k C c aux d) * physicalPhase ζ (physicalSharedProduct d) else 0 have h := full_active_clean_event_sum (fun g (q : P g) => q.val) (cleanFullSharedSlots C) B (fun _ => PhysicalAuxLabels P C) δ D (fun _ aux => physicalAuxMass V C aux) (fun g => tiltedPhysicalBirthLaw V g (b g)) ρ V Ψ (fun c aux x => f x (physicalTranslateResidues rs (cleanFullSharedStep k C c aux d))) (fun c aux => hf _) x dsimp only at h refine h.trans ?_ rw [show productTotalMemory x = ∑ g, (N g).val from cleanFullMemoryState_total_memory N p source rm] split_ifs · apply sum_congr rfl intro aux _ dsimp only [δ, Ψ, c, s, x] simp only [cleanFullSharedD_split, cleanFullSharedStep_split] exact clean_full_memory_fresh_kernel_row V b C ζ θ ρ k N p rm d K aux source (fun x => f x (physicalTranslateResidues rs (cleanHybridStep k C source aux d))) · rfl ) noncomputable def cleanFullMemoryPatternEventAction {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (D : ∀ i, SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) (C i)) → PhysicalAuxLabels P (C i) → G → ℤ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (x : CleanFullMemoryState P J ell B) (rs : PhysicalResidues Ps) : ℂ := ∑ i, cleanFullMemoryEventAction V b (C i) ζ θ ρ k (D i) (K i) d f x rs section variable {I S G : Type*} [sharedInstance1 : Fintype I] [sharedInstance2 : Fintype S] [sharedInstance3 : Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [sharedInstance8 : ∀ g (p : P g), NeZero p.val] (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (D : ∀ i, SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) (C i)) → PhysicalAuxLabels P (C i) → G → ℤ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) include I S G sharedInstance1 sharedInstance2 sharedInstance3 dG Ps P J ell B sharedInstance8 V b C ζ θ ρ k D K d f hf theorem clean_full_memory_pattern_event_action : cleanFullMemoryPatternEventAction V b C ζ θ ρ k D K d f = cleanFullMemoryCutoff (cleanFullMemoryPatternDampedAction V b C ζ θ ρ k K d f) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) apply clean_full_memory_slice_ext intro N p funext source r change (∑ i, cleanFullMemoryEventAction V b (C i) ζ θ ρ k (D i) (K i) d f (cleanFullMemoryState N p source r.2) r.1) = _ change _ = if productTotalMemory (cleanFullMemoryState N p source r.2) ≤ B then cleanFullMemoryPatternDampedAction V b C ζ θ ρ k K d f (cleanFullMemoryState N p source r.2) r.1 else 0 rw [cleanFullMemoryState_total_memory, clean_full_memory_pattern_damped_apply] by_cases h : (∑ g, (N g).val) ≤ B · rw [if_pos h] apply sum_congr rfl intro i _ have hi := clean_full_memory_event_action_apply V b (C i) ζ θ ρ k (D i) (K i) d f hf N p source r.2 r.1 simp only [if_pos h] at hi convert hi using 1 · congr 1 · apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro aux _ apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro target _ rfl · rw [if_neg h] apply sum_eq_zero intro i _ have hi := clean_full_memory_event_action_apply V b (C i) ζ θ ρ k (D i) (K i) d f hf N p source r.2 r.1 simp only [if_neg h] at hi convert hi using 1 congr 1 /- Both adjacent averages and both total-memory cutoffs agree with the kernel operator occurring in the existing full-memory norm bound. -/ theorem clean_full_memory_projected_event_action : cleanFullMemoryActiveMap (cleanFullMemoryPatternEventAction V b C ζ θ ρ k D K d (cleanFullMemoryActiveMap f)) = cleanFullMemoryCutoff (cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction V b C ζ θ ρ k K d (cleanFullMemoryActiveMap (cleanFullMemoryCutoff f)))) := by have hsym : ∀ r, ProductMemorySymmetric (fun x => cleanFullMemoryActiveMap f x r) := fun r => fullActiveAverage_symmetric (fun x => f x r) (hf r) rw [clean_full_memory_pattern_event_action V b C ζ θ ρ k D K d _ hsym, ← clean_full_memory_cutoff_active_map, clean_full_memory_double_cutoff_projected_damped_action] end end Bounty end section /- Pinned current births retain the entire original path continuation, including history-dependent tests. -/ open Finset Classical namespace Bounty section Paths variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) end Paths end Bounty end section /- Exact unnormalized root masses and the product bound that requires an explicit uniform row estimate. -/ open Finset Classical namespace Bounty section Mass variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end Mass end Bounty end section /- Concrete uniform Lyapunov rows and their iteration for the original full mixed trajectories. -/ open Finset Classical namespace Bounty noncomputable def fullMixedLengthRowFactor {J K G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V : G → ℝ) (T : ℕ) : Option (J ⊕ K) → ℝ | none => 1 | some (.inl j) => ∏ g, Real.exp ((|(1 - q j) * V g / ρ| * ∑ p, μ g p) * v) | some (.inr _) => unrestrictedEdgeRowBound ρ v vmin T ^ Fintype.card G theorem fullMixedLengthRowFactor_nonneg {J K G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V : G → ℝ) (T : ℕ) (hρ : ρ < 1) (hv : 0 ≤ v) (tag : Option (J ⊕ K)) : 0 ≤ fullMixedLengthRowFactor μ q ρ v vmin V T tag := by cases tag with | none => exact zero_le_one | some tag => cases tag with | inl j => exact prod_nonneg fun _ _ => (Real.exp_pos _).le | inr k => exact pow_nonneg (unrestricted_edge_row_bound_nonneg hρ hv T) _ section Mixed variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V : G → ℝ) theorem full_permutation_mixed_length_row_le (hω : ∀ k c a, 0 ≤ ω k c a) (hωmass : ∀ k c, ∑ a, ω k c a ≤ 1) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (hq0 : ∀ j, 0 ≤ q j) (hq1 : ∀ j, q j ≤ 1) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : ∀ g, vmin ≤ V g) (hD : ∀ j, q j / ρ ^ 2 + ((1 - q j) / ρ) / v ≤ 1) (T : ℕ) (ht : ∀ k g, (S k g)ᶜ.card ≤ T) (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : let _ : ∀ (tag : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D tag s) := fullPermutationMixedEventFintype n S B A Δ D (∑ e : FullPermutationMixedEvent n S B A Δ D tag s, |fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V tag s e| * productLengthLyapunov v (fullPermutationMixedEventTarget n S B A Δ D tag s e)) ≤ fullMixedLengthRowFactor μ q ρ v vmin V T tag * productLengthLyapunov v s := by let _ : ∀ (tag : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D tag s) := fullPermutationMixedEventFintype n S B A Δ D cases tag with | none => have hm : (∑ e : FullPermutationMixedEvent (J := J) n S B A Δ D none s, fullActivePermutationWeight M e.down) = 1 := ((Equiv.ulift : FullPermutationMixedEvent (J := J) n S B A Δ D none s ≃ FullActiveSlotPermutations M).sum_comp (fullActivePermutationWeight M)).trans (fullActivePermutationWeight_mass M) change (∑ e : FullPermutationMixedEvent (J := J) n S B A Δ D none s, |fullActivePermutationWeight M e.down| * productLengthLyapunov v s) ≤ 1 * productLengthLyapunov v s simp_rw [abs_of_nonneg (fullActivePermutationWeight_nonneg M _)] rw [← sum_mul, hm] | some tag => cases tag with | inl j => have he := (Equiv.ulift : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s ≃ CoupledGhostEvent M B s).sum_comp (fun e => |coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (q j) ρ) (fun g => physicalGhostTermination (n g) (q j) ρ) (fun g => physicalGhostBirth (n g) (q j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B s e| * productLengthLyapunov v (coupledGhostJointEventTarget M B s e)) apply le_trans ?_ (coupled_physical_ghost_length_row_le n μ (q j) ρ v V hμ (hq0 j) (hq1 j) hρ0 (zero_lt_one.trans hv) (hD j) M B s) apply le_of_eq refine Eq.trans ?_ he apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ rfl | inr k => exact (full_active_edge_length_row_le n (S k) B (A k) (Δ k) (D k) (ω k) μ V (hω k) (hωmass k) hρ0 hρ1 hv hvmin hV hμ hmass T (ht k) s).trans_eq (mul_comm _ _) end Mixed end Bounty end section /- Actual count-matched prime proxies are bounded by a uniform reciprocal density. -/ open Finset Filter namespace Bounty noncomputable def primeCellProxyCoefficient (L S Y : ℝ) : ℝ := ((primeBand Y (Real.exp (L^(-S))*Y)).card : ℝ) / (roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L))).card theorem exists_prime_cell_proxy_bound {a : ℝ} (ha : 0 < a) : ∃ C : ℝ, 0 < C ∧ ∀ S : ℝ, ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → 0 ≤ primeCellProxyCoefficient L S Y ∧ primeCellProxyCoefficient L S Y ≤ 1 ∧ primeCellProxyCoefficient L S Y ≤ C/(L*(∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1-1/(p : ℝ)))) := by obtain ⟨C, hC, hprime⟩ := exists_prime_logarithmic_cell_upper ha refine ⟨2*C, by positivity, ?_⟩ intro S filter_upwards [hprime S, eventually_rough_logarithmic_cell_count_pos ha S, eventually_sqrt_le_dyadic_scale ha 0, eventually_gt_atTop (0 : ℝ)] with L hprimeL hrough hsqrt hL intro Y hY let V := ∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1-1/(p : ℝ)) let len := Real.exp (L^(-S))*Y-Y let P := primeBand Y (Real.exp (L^(-S))*Y) let R := roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L)) have hV : 0 < V := finite_prime_avoidance_product_pos _ (fun _ hp => (mem_filter.mp hp).2) have hR : (0 : ℝ) < R.card := Nat.cast_pos.mpr (hrough Y hY).1 have hRlower : len*V/2 ≤ (R.card : ℝ) := (hrough Y hY).2.1 have hW : Real.exp (Real.sqrt L) ≤ Y := by apply le_trans _ hY apply Real.exp_le_exp.mpr simpa only [pow_zero, div_one] using hsqrt have hsub : P ⊆ R := prime_band_subset_rough_band hW have hunit := finite_cell_count_proxy R P hsub (hrough Y hY).1 refine ⟨hunit.1, hunit.2.1, ?_⟩ change (P.card : ℝ)/(R.card : ℝ) ≤ (2*C)/(L*V) apply (div_le_iff₀ hR).mpr calc _ ≤ C*len/L := hprimeL Y hY _ = ((2*C)/(L*V))*(len*V/2) := by field_simp _ ≤ _ := mul_le_mul_of_nonneg_left hRlower (by positivity) end Bounty end section /- A coefficient-preserving reindexing of every actual full mixed event. -/ open Finset Classical namespace Bounty section Mixed variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (τ : ∀ g, Equiv.Perm (Fin (s g).2.1.val)) end Mixed end Bounty end section /- The source decoding in the global physical phase does not inspect memory order. -/ open Finset Classical namespace Bounty end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) theorem physical_joint_adjacent_visit_literal_tensor (j : Fin (n + 1)) (activity : (g : Fin N) → ↥(P g) → Bool) (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (s : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) : globalBirthJointCutRawRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V (fun _ => ρ) hV B (2 * j.val)) B B F s = globalBirthJointCutRawRow (fun g => GlobalBirthRawStep.visit (a := activity g) (fun _ => 0) (β g) (η g j) (V g) ρ (hV g) B) B B F s := by have hr : (fun g (K : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val) → ℂ) (u : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val)) => globalBirthRawStepRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V (fun _ => ρ) hV B (2 * j.val) g) (fun H q => K (H, q)) u.1 u.2) = (fun g (K : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val) → ℂ) (u : GlobalBirthHistoryState (fun p : ↥(P g) => ZMod p.val)) => globalBirthRawStepRow (GlobalBirthRawStep.visit (a := activity g) (fun _ => 0) (β g) (η g j) (V g) ρ (hV g) B) (fun H q => K (H, q)) u.1 u.2) := by funext g K u exact physical_group_adjacent_finite_visit_row C aux k L a σ τ hcompat hlist hP hdis g (fun j => hk j g) (β g) (η g) (V g) ρ (hV g) B j (fun H q => K (H, q)) u.1 u.2 unfold globalBirthJointCutRawRow globalBirthJointRawRow rw [hr] end ResiduePath end Bounty end section /- The skeleton-only sample order agrees with the ORIGINAL full-path birth-coordinate map. -/ namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) section Ghost variable (j : J) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) (tail : FullPermutationMixedPath n S B A Δ D steps (fullPermutationMixedEventTarget n S B A Δ D (some (.inl j)) s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩))) end Ghost section Edge variable (k : K) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) (tail : FullPermutationMixedPath n S B A Δ D steps (fullPermutationMixedEventTarget n S B A Δ D (some (.inr k)) s ((fullPermutationEdgeBirthEquiv (J := J) n S B A Δ D s k).symm ⟨sk, fresh⟩))) end Edge end Full end Bounty end section /- Uniform prime Mellin cancellation across a polynomial number of logarithmic dyads. -/ open Finset Filter namespace Bounty theorem dyadic_prime_band_bucket (A B : ℝ) (k : ℕ) : dyadicNatBucket (primeBand A B) k = (Ioc (max ⌊A⌋₊ (2^k-1)) (min ⌊B⌋₊ (2^(k+1)-1))).filter Nat.Prime := by ext p by_cases hp : p.Prime · have hp0 := hp.pos have hk0 : 0 < 2^k := by positivity have hk1 : 0 < 2^(k+1) := by positivity simp only [dyadicNatBucket, primeBand, mem_filter, mem_Ioc, hp, and_true, Nat.log2_eq_iff hp.ne_zero, max_lt_iff, le_min_iff] omega · simp only [dyadicNatBucket, primeBand, mem_filter, hp, and_false, false_and] theorem eventually_prime_mellin_band_power_bound (hZ : PrimitiveZeroFreeHalfPlane) {a C T : ℝ} (ha : 0 < a) (hC : 0 < C) (hT : 0 ≤ T) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ A B : ℝ, Real.exp (a*L) ≤ A → 0 ≤ B → B ≤ Real.exp (C*L) → ∀ (r : ℕ), 0 < r → (r : ℝ) ≤ L^T → ∀ χ : DirichletCharacter ℂ r, χ ≠ 1 → ∀ v : ℝ, |v| ≤ L^T → ‖∑ p ∈ primeBand A B, harmonicMellinWeight v p*χ (p : ZMod r)‖ ≤ L^(-Bsave) := by classical have ha2 : 0 < a/2 := by positivity filter_upwards [eventually_prime_interval_mellin_power_bound hZ ha2 hT (Bsave+2), eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (2*Real.log 2/a), eventually_ge_atTop (C/Real.log 2+1)] with L hprime hL1 hLa hLc have hL : 0 < L := zero_lt_one.trans_le hL1 intro A B hA hB hBmax r hr hrT χ hχ v hv have hA0 : 0 ≤ A := (Real.exp_pos _).le.trans hA let F := primeBand A B let w := fun p : ℕ => harmonicMellinWeight v p*χ (p : ZMod r) have hFpos : ∀ p ∈ F, 0 < p := fun p hp => ((mem_primeBand_iff hA0 hB p).mp hp).1.pos have hFlow : ∀ p ∈ F, Real.exp (a*L) < (p : ℝ) := fun p hp => hA.trans_lt ((mem_primeBand_iff hA0 hB p).mp hp).2.1 have hFupper : ∀ p ∈ F, p ≤ ⌊Real.exp (C*L)⌋₊ := fun p hp => Nat.le_floor (((mem_primeBand_iff hA0 hB p).mp hp).2.2.trans hBmax) have hcount : ((dyadicNatIndices F).card : ℝ) ≤ L^2 := by have hraw := dyadicNatIndices_card_le_log F ⌊Real.exp (C*L)⌋₊ hFupper have hNpos : 0 < ⌊Real.exp (C*L)⌋₊ := Nat.floor_pos.mpr (Real.one_le_exp (by positivity)) have hlog : Real.log (⌊Real.exp (C*L)⌋₊ : ℝ) ≤ C*L := by simpa only [Real.log_exp] using Real.log_le_log (Nat.cast_pos.mpr hNpos) (Nat.floor_le (Real.exp_pos _).le) have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) calc _ ≤ Real.log (⌊Real.exp (C*L)⌋₊ : ℝ)/Real.log 2+1 := hraw _ ≤ (C*L)/Real.log 2+1 := add_le_add (div_le_div_of_nonneg_right hlog hlog2.le) le_rfl _ ≤ (C*L)/Real.log 2+L := add_le_add le_rfl hL1 _ = (C/Real.log 2+1)*L := by ring _ ≤ L*L := mul_le_mul_of_nonneg_right hLc hL.le _ = L^2 := (pow_two L).symm have htwo : 2 ≤ Real.exp ((a/2)*L) := by apply (Real.log_le_iff_le_exp (by norm_num : (0 : ℝ) < 2)).mp have hh := (div_le_iff₀ ha).mp hLa nlinarith have hexp : 2*Real.exp ((a/2)*L) ≤ Real.exp (a*L) := by have hm := mul_le_mul_of_nonneg_right htwo (Real.exp_pos ((a/2)*L)).le have he : Real.exp ((a/2)*L)*Real.exp ((a/2)*L) = Real.exp (a*L) := by rw [← Real.exp_add] congr 1 ring rwa [he] at hm have hbucket : ∀ k ∈ dyadicNatIndices F, ‖∑ p ∈ dyadicNatBucket F k, w p‖ ≤ L^(-(Bsave+2)) := by intro k hk obtain ⟨p, hp⟩ := (dyadicNatBucket_nonempty_iff F k).mpr hk have hpb := dyadicNatBucket_bounds F hFpos hp have hpF := (mem_dyadicNatBucket F k p).mp hp |>.1 let Y : ℝ := (2 : ℝ)^k have hY0 : 0 < Y := by positivity have hYlow : Real.exp ((a/2)*L) ≤ Y := by have hpY : (p : ℝ) < 2*Y := by have hh : (p : ℝ) < (2 : ℝ)^(k+1) := by exact_mod_cast hpb.2 simpa only [pow_succ, Y, mul_comm] using hh have hpL := hFlow p hpF nlinarith let lo := max ⌊A⌋₊ (2^k-1) let hi := min ⌊B⌋₊ (2^(k+1)-1) have hrepr : dyadicNatBucket F k = (Ioc lo hi).filter Nat.Prime := dyadic_prime_band_bucket A B k have hpI : p ∈ Ioc lo hi := (mem_filter.mp (hrepr ▸ hp)).1 have hlohi : lo ≤ hi := (mem_Ioc.mp hpI).1.le.trans (mem_Ioc.mp hpI).2 have hYm : Y ≤ (lo+1 : ℕ) := by have hkpos : 0 < 2^k := by positivity have hh : 2^k ≤ lo+1 := by dsimp [lo]; omega dsimp [Y] exact_mod_cast hh have hhiY : (hi : ℝ) ≤ 2*Y := by have hh : hi ≤ 2^(k+1) := (min_le_right _ _).trans (Nat.sub_le _ _) have hhR : (hi : ℝ) ≤ (2 : ℝ)^(k+1) := by exact_mod_cast hh simpa only [pow_succ, Y, mul_comm] using hhR rw [hrepr] exact hprime Y hYlow r hr hrT χ hχ v hv lo hi hlohi hYm hhiY change ‖∑ p ∈ F, w p‖ ≤ _ rw [← sum_dyadicNatBuckets F w] calc _ ≤ ∑ k ∈ dyadicNatIndices F, ‖∑ p ∈ dyadicNatBucket F k, w p‖ := norm_sum_le _ _ _ ≤ ∑ _k ∈ dyadicNatIndices F, L^(-(Bsave+2)) := sum_le_sum hbucket _ = ((dyadicNatIndices F).card : ℝ)*L^(-(Bsave+2)) := by simp only [sum_const, nsmul_eq_mul] _ ≤ L^2*L^(-(Bsave+2)) := mul_le_mul_of_nonneg_right hcount (by positivity) _ = L^(-Bsave) := by rw [← Real.rpow_natCast L 2, ← Real.rpow_add hL] congr 1 norm_num end Bounty end section /- The marked skeleton estimate for the original physical ghost parameters. -/ open Finset Classical namespace Bounty theorem coupled_physical_ghost_marked_length_row_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) (μ : ∀ g, P g → ℝ) (q ρ v : ℝ) (V ε : G → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hε : ∀ g, 0 ≤ ε g) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hρ : 0 < ρ) (hv : 0 < v) (hD : q / ρ ^ 2 + ((1 - q) / ρ) / v ≤ 1) (t : G → ℕ) (B : ℕ) (d : G → ℕ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) t B) : (∑ sk : CoupledGhostSkeleton t B s, if ∀ g, d g ≤ (sk g).1.val then coupledGhostSkeletonAbsMass (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) t B s sk * v ^ (∑ g, boundedGhostSkeletonOutputCount (t g) B (s g) (sk g).1 (sk g).2) * ∏ g, ε g ^ d g * (|(1 - q) * V g / ρ| * ∑ p, μ g p) ^ ((sk g).1.val - d g) else 0) ≤ (∏ g, (ε g * v) ^ d g) * (∏ g, Real.exp ((|(1 - q) * V g / ρ| * ∑ p, μ g p) * v)) * productLengthLyapunov v s := by have hA : ∀ g z, 0 ≤ physicalGhostRetention (n g) q ρ z := by intro g z unfold physicalGhostRetention split_ifs · exact div_nonneg hq0 (sq_nonneg _) · exact zero_le_one have h := coupled_ghost_marked_length_row_le (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) hA (fun g => |(1 - q) * V g / ρ| * ∑ p, μ g p) ε v (fun g => mul_nonneg (abs_nonneg _) (sum_nonneg fun p _ => hμ g p)) hε hv.le (fun g => physical_ghost_length_damping (n g) q ρ v hq1 hρ hv hD) t B d s simpa only [prod_mul_distrib, productLengthLyapunov] using h end Bounty end section /- Actual birth coordinates at any owner embed into the fixed original chronological index set. -/ open Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) s) end Owner section Path variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps s) (u : Fin steps.length) noncomputable abbrev fullMixedOwnerOccurrence := finiteEventPathOccurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps s p u end Path end Bounty end section /- Prime-label forest constraints survive the exact optional-label representation of original births. -/ namespace Bounty theorem birth_forest_equalValues_some_iff {m : ℕ} {α : Type*} (code : BirthForestCode m) (values : Fin m → α) : birthForestEqualValues code (fun i => some (values i)) ↔ birthForestEqualValues code values := by constructor · intro h i p hp exact Option.some.inj (h i p hp) · intro h i p hp exact congrArg some (h i p hp) theorem birth_labels_anchored_join_iff {m : ℕ} {α : Type*} (anchors : Fin m → Option (Option α)) (values : Fin m → α) (hvalid : ∀ i, anchors i ≠ some none) : birthLabelsAnchored anchors (fun i => some (values i)) ↔ birthLabelsAnchored (fun i => (anchors i).join) values := by constructor · intro h i a ha cases he : anchors i with | none => simp [he] at ha | some v => cases v with | none => exact False.elim (hvalid i he) | some b => have hb : b = a := by simpa only [he, Option.join_some, Option.some.injEq] using ha subst b exact Option.some.inj (h i (some a) he) · intro h i a ha cases a with | none => exact False.elim (hvalid i ha) | some a => exact congrArg some (h i a (by simp only [ha, Option.join_some])) theorem restricted_optional_anchors_valid {N m : ℕ} {α : Type*} (embed : Fin m → Fin N) (code : BirthForestCode N) (values : Fin N → Option α) (hparents : ∀ j p, code (embed j) = some p → values (birthForestParentEmbedding (embed j) p) ≠ none) : ∀ j, restrictedBirthAnchors embed code values j ≠ some none := by intro j cases hc : code (embed j) with | none => simp [restrictedBirthAnchors, hc] | some p => by_cases he : ∃ k : Fin j.val, embed (birthForestParentEmbedding j k) = birthForestParentEmbedding (embed j) p · simp [restrictedBirthAnchors, hc, he] · simpa only [restrictedBirthAnchors, hc, if_neg he, ne_eq, Option.some.injEq] using hparents j p hc theorem owner_optional_forest_past_iff {N m L : ℕ} {α : Type*} (embed : Fin m → Fin N) (hstrict : StrictMono embed) (owner : Fin N → Fin L) (hmono : Monotone owner) (u : Fin L) (howner : ∀ j, owner (embed j) = u) (performed : Fin N → Prop) (hcover : ∀ i, performed i → owner i = u → i ∈ Set.range embed) (code : BirthForestCode N) (values history : Fin N → Option α) (localValues : Fin m → α) (hlocal : ∀ j, values (embed j) = some (localValues j)) (hchildren : ∀ i, owner i = u → code i ≠ none → performed i) (hparents : ∀ j p, code (embed j) = some p → performed (birthForestParentEmbedding (embed j) p)) (hpresent : ∀ i, performed i → values i ≠ none) (hpast : ∀ i, owner i < u → values i = history i) : (∀ i, owner i = u → ∀ p, code i = some p → values i = values (birthForestParentEmbedding i p)) ↔ birthForestEqualValues (restrictedBirthCode embed code) localValues ∧ birthLabelsAnchored (fun j => (restrictedBirthAnchors embed code history j).join) localValues := by have ha := restricted_birth_anchors_past_local embed hstrict owner hmono u howner performed hcover code hparents values history hpast have hv := restricted_optional_anchors_valid embed code values (fun j p hp => hpresent _ (hparents j p hp)) rw [owner_restricted_birth_forest_past_iff embed hstrict owner hmono u howner performed hcover code values history hchildren hparents hpast] have hl : values ∘ embed = fun j => some (localValues j) := funext hlocal rw [hl, birth_forest_equalValues_some_iff] rw [birth_labels_anchored_join_iff _ _ (by intro j; rw [← ha]; exact hv j)] end Bounty end section /- The actual capped storage average on candidate prime pools. The estimate includes arbitrary choice-dependent external translations and derives the inverse-direction rarity from arithmetic, without a rarity assumption. -/ open Finset Filter open scoped Classical Topology namespace Bounty end Bounty end section /- Exact full-event formulas for storage without promotion and its reverse. The formulas keep the same auxiliary weights and both total-memory caps. -/ open Finset Classical namespace Bounty section variable {G : Type*} [Fintype G] [dG : DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) {A : SharedActiveLabels P S → Type*} [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) {R : Type*} (τ : ∀ c, A c → R ≃ R) theorem full_active_storage_external_eq_sum (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (r : R) : fullActiveStorageExternal n S B Δ D ω μ ρ V τ f x r = fullActiveExternalCoefficientAction n S B A Δ D ω μ ρ V τ (fun _ _ e => if (∀ g, (e.2 g).2.1 = ∅) ∧ (∃ g, (e.2 g).1 ≠ ∅) then 1 else 0) f x r := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold fullActiveStorageExternal equivExternalFiberAverage finiteExternalFiberAverage unrestrictedStorageOnlyProduct fullActiveExternalCoefficientAction rw [Fintype.sum_sigma] apply sum_congr rfl intro a _ dsimp only rw [unrestricted_coupled_cutoff_eq_joint_event_sum] simp only [mul_sum, fullActiveEdgeEventWeight, fullActiveEdgeEventTarget, Complex.ofReal_mul, mul_assoc] apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _; rfl theorem full_active_reverse_promotion_external_eq_sum (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (r : R) : fullActiveReversePromotionExternal n S B Δ D ω μ ρ V τ f x r = fullActiveExternalCoefficientAction n S B A (fun c a g => -Δ c a g) D ω μ ρ V (fun c a => (τ c a).symm) (fun _ _ e => ((∏ g, V g ^ (e.2 g).2.1.card / V g ^ (e.2 g).1.card : ℝ) : ℂ) * (if (∀ g, (e.2 g).1 = ∅) ∧ (∃ g, (e.2 g).2.1 ≠ ∅) then 1 else 0)) f x r := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold fullActiveReversePromotionExternal equivExternalFiberAverage finiteExternalFiberAverage unrestrictedReversePromotionOnlyProduct fullActiveExternalCoefficientAction rw [Fintype.sum_sigma] apply sum_congr rfl intro a _ dsimp only rw [unrestricted_coupled_cutoff_eq_joint_event_sum] simp only [mul_sum, fullActiveEdgeEventWeight, fullActiveEdgeEventTarget, Complex.ofReal_mul, mul_assoc] apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _; rfl end end Bounty end section /- Both forward and reverse eligibility rarity control the full nonclean average, including arbitrary bounded coefficients. The factor four in energy is the squared sum of the two square-root rarity bounds. -/ open Finset open scoped Classical namespace Bounty section variable {A G R : Type*} [Fintype A] [Fintype G] [Fintype R] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : A → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (π : A → ℝ) (τ : A → R ≃ R) end end Bounty end section /- One original memory edge with its small completion factor, exactly. -/ open scoped Classical namespace Bounty theorem physical_memory_labeled_group_factor {G I : Type*} [Fintype G] [dG : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (small : G → Prop) (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) : physicalMemoryLabeledScalar V patterns C ζ K a L R = physicalMemoryLabeledScalar (fun g : {g // small g} => V g.val) patterns (fun i g => C i g.val) (fun _ => 0) (fun _ _ _ _ => 1) (physicalRestrictedEdge small patterns C a) (fun g => L g.val) (fun g => R g.val) * physicalMemoryLabeledScalar (fun g : {g // ¬small g} => V g.val) patterns (fun i g => C i g.val) (fun _ => 0) (physicalFixedEdgeBigCoefficient small patterns C ζ K a L R) (physicalRestrictedEdge (fun g => ¬small g) patterns C a) (fun g => L g.val) (fun g => R g.val) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) have hn := physical_permutation_group_normalization small J ell simp only [physicalMemoryLabeledScalar, physicalRestrictedEdge, ← physical_permute_group_restrict, physical_fixed_edge_big_coefficient_apply, physical_phase_zero_frequency, mul_one] simp only [← Nat.card_eq_fintype_card] at hn ⊢ rw [hn, physical_list_admissible_group_split small, physical_aux_mass_group_split small, physical_D_group_split small] by_cases hs : physicalListAdmissible (fun g : {g // small g} => C a.2.2.1.val g.val) (fun g => a.2.2.2 g.val) (fun g => physicalPermuteLabels a.1 L g.val) (fun g => physicalPermuteLabels a.2.1 R g.val) · by_cases hb : physicalListAdmissible (fun g : {g // ¬small g} => C a.2.2.1.val g.val) (fun g => a.2.2.2 g.val) (fun g => physicalPermuteLabels a.1 L g.val) (fun g => physicalPermuteLabels a.2.1 R g.val) · simp only [hs, hb, and_self, if_true, Complex.ofReal_mul] ring · simp only [hs, hb, and_false, if_false, if_true, mul_zero] · simp only [hs, false_and, if_false, mul_zero, zero_mul] theorem physical_partial_memory_labeled_group_factor {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (small : G → Prop) (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) : (physicalCompletionMass (fun g : {g // small g} => V g.val) (fun g => C a.2.2.1.val g.val) ell : ℂ) * physicalMemoryLabeledScalar V patterns C ζ K a L R = physicalBareLabeledScalar (fun g : {g // small g} => V g.val) patterns (fun i g => C i g.val) (fun _ => 0) (fun _ _ _ _ => 1) (physicalRestrictedEdge small patterns C a) (fun g => L g.val) (fun g => R g.val) * physicalMemoryLabeledScalar (fun g : {g // ¬small g} => V g.val) patterns (fun i g => C i g.val) (fun _ => 0) (physicalFixedEdgeBigCoefficient small patterns C ζ K a L R) (physicalRestrictedEdge (fun g => ¬small g) patterns C a) (fun g => L g.val) (fun g => R g.val) := by rw [physical_memory_labeled_group_factor small, physical_memory_labeled_scalar_factor] simp only [physical_restricted_edge_pattern, mul_assoc] end Bounty end section /- Uniform ordinary-prime asymptotics on logarithmic cells. -/ open Filter namespace Bounty theorem eventually_ordinary_theta_scaled_power_bound {a K : ℝ} (ha : 0 < a) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ x : ℝ, Real.exp (a*L) ≤ x → |Chebyshev.theta x-x| ≤ a^(-K)*L^(-K)*x := by filter_upwards [eventually_ordinary_theta_uniform_log_power_bound ha K, eventually_gt_atTop (0 : ℝ)] with L hraw hL intro x hx have hx0 : 0 < x := (Real.exp_pos _).trans_le hx have hlog : a*L ≤ Real.log x := by have hh := Real.log_le_log (Real.exp_pos _) hx rwa [Real.log_exp] at hh have hp := Real.rpow_le_rpow_of_nonpos (mul_pos ha hL) hlog (neg_nonpos.mpr hK) calc _ ≤ x*(Real.log x)^(-K) := hraw x hx _ ≤ x*(a*L)^(-K) := mul_le_mul_of_nonneg_left hp hx0.le _ = _ := by rw [Real.mul_rpow ha.le hL.le]; ring theorem exists_ordinary_prime_logarithmic_cell_asymptotic {a S : ℝ} (ha : 0 < a) (hS : 0 ≤ S) : ∃ C : ℝ, 0 < C ∧ ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → |((primeBand Y (Real.exp (L^(-S))*Y)).card : ℝ) - ((Real.exp (L^(-S))-1)*Y)/Real.log Y| ≤ (C/L) * (((Real.exp (L^(-S))-1)*Y)/Real.log Y) := by let A := a^(-(S+1)) let C := 4*A+1/a have hA : 0 < A := Real.rpow_pos_of_pos ha _ have hC : 0 < C := by dsimp [C]; positivity refine ⟨2*C, by positivity, ?_⟩ filter_upwards [eventually_ordinary_theta_scaled_power_bound ha (show 0 ≤ S+1 by linarith), eventually_ge_atTop (1 : ℝ)] with L hraw hL1 intro Y hY have hL : 0 < L := zero_lt_one.trans_le hL1 have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hY1 : 1 < Y := (Real.one_lt_exp_iff.mpr (mul_pos ha hL)).trans_le hY have hδ0 : 0 < L^(-S) := Real.rpow_pos_of_pos hL _ have hδ1 : L^(-S) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hL1 (neg_nonpos.mpr hS) let B := Real.exp (L^(-S))*Y have hYB : Y ≤ B := by dsimp [B] exact le_mul_of_one_le_left hY0.le (Real.one_le_exp hδ0.le) have hB3 : B ≤ 3*Y := by dsimp [B] apply mul_le_mul_of_nonneg_right _ hY0.le exact (Real.exp_le_exp.mpr hδ1).trans (by linarith [Real.exp_one_lt_three]) have hH : 0 ≤ B-Y := sub_nonneg.mpr hYB have hwidth : L^(-S)*Y ≤ B-Y := by have hh := Real.add_one_le_exp (L^(-S)) have hm := mul_le_mul_of_nonneg_right hh hY0.le dsimp [B] nlinarith have hpow : L^(-(S+1)) = L^(-S)/L := by rw [show -(S+1) = -S + (-1 : ℝ) by ring, Real.rpow_add hL, Real.rpow_neg_one] ring have hθY := hraw Y hY have hθB := hraw B (hY.trans hYB) have hθ : |(Chebyshev.theta B-Chebyshev.theta Y)-(B-Y)| ≤ (C/L)*(B-Y) := by have hid : (Chebyshev.theta B-Chebyshev.theta Y)-(B-Y) = (Chebyshev.theta B-B)-(Chebyshev.theta Y-Y) := by ring rw [hid] calc _ ≤ |Chebyshev.theta B-B|+|Chebyshev.theta Y-Y| := abs_sub _ _ _ ≤ A*L^(-(S+1))*B+A*L^(-(S+1))*Y := add_le_add hθB hθY _ ≤ A*L^(-(S+1))*(3*Y)+A*L^(-(S+1))*Y := by gcongr _ = (4*A/L)*(L^(-S)*Y) := by rw [hpow]; ring _ ≤ (4*A/L)*(B-Y) := mul_le_mul_of_nonneg_left hwidth (by positivity) _ ≤ (C/L)*(B-Y) := by apply mul_le_mul_of_nonneg_right _ hH apply div_le_div_of_nonneg_right _ hL.le dsimp [C] linarith [one_div_pos.mpr ha] have hlogY : a*L ≤ Real.log Y := by have hh := Real.log_le_log (Real.exp_pos _) hY rwa [Real.log_exp] at hh have hscale : 1 ≤ (C/L)*Real.log Y := by calc _ = ((1/a)/L)*(a*L) := by field_simp _ ≤ (C/L)*(Real.log Y) := by apply mul_le_mul _ hlogY (by positivity) (by positivity) apply div_le_div_of_nonneg_right _ hL.le dsimp [C] linarith [one_div_pos.mpr ha] have hlogB : Real.log B ≤ (1+C/L)*Real.log Y := by have heq : Real.log B = L^(-S)+Real.log Y := by dsimp [B] rw [Real.log_mul (Real.exp_ne_zero _) hY0.ne', Real.log_exp] rw [heq] nlinarith have hh := ordinary_prime_band_relative_error hY1 hYB (show 0 ≤ C/L by positivity) hθ hlogB have heq : B-Y = (Real.exp (L^(-S))-1)*Y := by dsimp [B]; ring rw [heq] at hh convert hh using 1 <;> ring theorem eventually_ordinary_prime_logarithmic_cell_relative_error {a S ε : ℝ} (ha : 0 < a) (hS : 0 ≤ S) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → |((primeBand Y (Real.exp (L^(-S))*Y)).card : ℝ) - ((Real.exp (L^(-S))-1)*Y)/Real.log Y| ≤ ε * (((Real.exp (L^(-S))-1)*Y)/Real.log Y) := by obtain ⟨C, hC, hbound⟩ := exists_ordinary_prime_logarithmic_cell_asymptotic ha hS filter_upwards [hbound, eventually_ge_atTop (C/ε), eventually_ge_atTop (1 : ℝ)] with L hL hlarge hL1 intro Y hY have hL0 : 0 < L := zero_lt_one.trans_le hL1 have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hY1 : 1 < Y := (Real.one_lt_exp_iff.mpr (mul_pos ha hL0)).trans_le hY have hδ : 0 ≤ L^(-S) := (Real.rpow_pos_of_pos hL0 _).le have hmain : 0 ≤ ((Real.exp (L^(-S))-1)*Y)/Real.log Y := by apply div_nonneg _ (Real.log_pos hY1).le exact mul_nonneg (sub_nonneg.mpr (Real.one_le_exp hδ)) hY0.le have hsmall : C/L ≤ ε := by apply (div_le_iff₀ hL0).mpr have hh := (div_le_iff₀ hε).mp hlarge nlinarith exact (hL Y hY).trans (mul_le_mul_of_nonneg_right hsmall hmain) end Bounty end section /- External translations depending on shared labels and auxiliary choices preserve pending-memory symmetry of storage and reverse-promotion actions. -/ open Finset Classical namespace Bounty theorem full_active_external_fiber_average_symmetric {G : Type*} [DecidableEq G] {P Z : G → Type*} {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) {A : SharedActiveLabels P S → Type*} [∀ c, Fintype (A c)] (ω : ∀ c, A c → ℝ) (T : ∀ c, A c → (ProductBoundedOrderedState P Z (fun g => (S g)ᶜ.card) B → ℂ) → ProductBoundedOrderedState P Z (fun g => (S g)ᶜ.card) B → ℂ) {R : Type*} (τ : ∀ c, A c → R ≃ R) (hT : ∀ c a F, ProductMemorySymmetric F → ProductMemorySymmetric (T c a F)) (f : ProductBoundedOrderedState P Z M B → R → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) : ∀ r, ProductMemorySymmetric (fun x => equivExternalFiberAverage (productActiveMemorySplit S B) ω T τ f x r) := by intro r x g σ unfold equivExternalFiberAverage dsimp only rw [productActiveMemorySplit_permute S B x g σ] unfold finiteExternalFiberAverage apply sum_congr rfl intro a _ apply congrArg (fun z : ℂ => (ω (productActiveMemorySplit S B x).1 a : ℂ) * z) exact hT (productActiveMemorySplit S B x).1 a _ (productActiveMemorySlice_symmetric S B (fun y => f y (τ (productActiveMemorySplit S B x).1 a r)) (hf _) (productActiveMemorySplit S B x).1) (productActiveMemorySplit S B x).2 g σ section variable {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) {A : SharedActiveLabels P S → Type*} [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) {R : Type*} (τ : ∀ c, A c → R ≃ R) theorem full_active_storage_external_symmetric (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) : ∀ r, ProductMemorySymmetric (fun x => fullActiveStorageExternal n S B Δ D ω μ ρ V τ f x r) := by exact full_active_external_fiber_average_symmetric S B ω _ τ (fun c a F hF => unrestricted_storage_only_product_symmetric n (Δ c a) (D c a) μ ρ V (fun g => (S g)ᶜ.card) B F hF) f hf end end Bounty end section /- Actual mixed capped edge actions with arbitrary dependence on both small endpoints. Positive domination precedes small-prefix conditioning, so the coefficient is not required to be a spectator of either small completion. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) noncomputable def physicalSmallBigFullWeight (_r : PhysicalResidues Ps) (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalSmallBigFullEvent n shared B Δ D d x) : ℝ := fullActiveEdgeEventWeight n shared B (fun _ => Unit) (fun c _ => Δ d c) (fun c _ => D d c) (fun _ _ => 1) μ ρ V x e noncomputable def physicalSmallBigFullPhasedAction (Vs : S → ℝ) (q : ℝ) (Φ : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) := physicalSmallBigPhasedAction Vs q (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullWeight n shared B Δ D μ ρ V) (fun x => kbig (productActiveMemorySplit shared B x).1) Φ F omit [Fintype S] [DecidableEq G] [∀ g, Fintype (P g)] in theorem physical_small_big_full_weight_nonneg (hμ : ∀ g p, 0 ≤ μ g p) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ V g) (r : PhysicalResidues Ps) (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalSmallBigFullEvent n shared B Δ D d x) : 0 ≤ physicalSmallBigFullWeight n shared B Δ D μ ρ V r d x e := by exact fullActiveEdgeEventWeight_nonneg n shared B (fun _ => Unit) _ _ _ μ ρ V (fun _ _ => zero_le_one) hμ hρ hV x e theorem physical_small_big_full_positive_eq (Vs : S → ℝ) (q : ℝ) (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) : physicalSmallBigAction Vs q 0 aux (fun _ => 1) (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullCoefficient n shared B Δ D μ ρ V (fun _ _ _ _ => 1)) (fun x => kbig (productActiveMemorySplit shared B x).1) F = physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun _ _ => 1) F := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) funext s unfold physicalSmallBigAction physicalSmallBigFullPhasedAction physicalSmallBigPhasedAction apply sum_congr rfl intro e _ change physicalSmallBigEventWeight Vs q 0 aux (fun _ => 1) (PhysicalSmallBigFullEvent n shared B Δ D) (fun r d x e => (physicalSmallBigFullWeight n shared B Δ D μ ρ V r d x e : ℂ) * 1) (fun x => kbig (productActiveMemorySplit shared B x).1) s e * _ = _ rw [physical_small_big_event_weight_phase] simp only [physicalPhase, zero_mul, Complex.ofReal_zero, Complex.exp_zero, mul_one] end theorem exists_physical_small_big_phased_energy_bound {q vs : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : G → ℕ) (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ), (∀ s, vs ≤ Vs s) → ∀ (_aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ (T : ℕ), (∀ g, (shared g)ᶜ.card ≤ T) → ∀ (Φ : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s → ℂ) (H : ℝ), 0 ≤ H → (∀ s e, ‖Φ s e‖ ≤ H) → ∀ (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q Φ F) ≤ H ^ 2 * (A ^ (2 * Fintype.card S) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_full_energy_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ intro S G _ dS _ dG cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ n _ J M shared B Δ D μ ρ V kbig Vs hVs aux v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht Φ H hH hΦ F hF let W : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℝ := productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)) have hW : ∀ x, 0 ≤ W x := productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1) have hVs' : ∀ s, 0 < Vs s := fun s => hvs.trans_le (hVs s) have hFn : ∀ s, ProductMemorySymmetric (fun x => complexNormEnvelope F (s, x)) := by intro s x g τ exact congrArg (fun z : ℂ => (‖z‖ : ℂ)) (hF s x g τ) have hp := hbound S G Ps P n J M shared B Δ D μ ρ V kbig Vs hVs 0 aux (fun _ => 1) 1 zero_le_one (by intro; simp only [norm_one, le_refl]) v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht (fun _ _ _ _ => 1) 1 zero_le_one (by intros; simp only [norm_one, le_refl]) (complexNormEnvelope F) hFn rw [physical_small_big_full_positive_eq] at hp simp only [one_pow, mul_one, one_mul] at hp rw [← physical_small_big_energy_eq, ← physical_small_big_energy_eq, complexNormEnvelope_energy] at hp rw [← physical_small_big_energy_eq, ← physical_small_big_energy_eq] apply finite_weighted_energy_of_scaled_norm (physicalSmallBigMeasure Vs W) (physical_small_big_measure_nonneg Vs hVs' W hW) H hH (A ^ (2 * Fintype.card S) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) F _ _ _ hp intro s rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hH] change ‖physicalSmallBigPhasedAction _ _ _ _ _ _ Φ F s‖ ≤ H * ‖physicalSmallBigPhasedAction _ _ _ _ _ _ (fun _ _ => 1) (fun y => (‖F y‖ : ℂ)) s‖ rw [physical_small_big_positive_norm Vs hVs' q _ _ _ (physical_small_big_full_weight_nonneg n shared B Δ D μ ρ V hμ hρ0.le (fun g => (hvmin.trans_le (hVlo g)).le))] exact physical_small_big_phase_norm_le Vs hVs' q _ _ _ (physical_small_big_full_weight_nonneg n shared B Δ D μ ρ V hμ hρ0.le (fun g => (hvmin.trans_le (hVlo g)).le)) _ Φ H hΦ F s end Bounty end section /- The actual reverse-promotion operator, including its volume ratios, has the same energy constant as storage. This remains true after the full shared-label lift and inversion of external residue translations. -/ open Finset Classical namespace Bounty theorem full_active_reverse_promotion_external_energy_le {G R : Type*} [Fintype G] [DecidableEq G] [Fintype R] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) {A : SharedActiveLabels P S → Type*} [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (τ : ∀ c, A c → R ≃ R) (hω : ∀ c a, 0 ≤ ω c a) (hωmass : ∀ c, ∑ a, ω c a ≤ 1) {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, (S g)ᶜ.card ≤ T) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) : (∑ r, finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun x => fullActiveReversePromotionExternal n S B Δ D ω μ ρ V τ f x r)) ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * ∑ r, finiteWeightedEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun x => f x r) := by apply equiv_external_fiber_average_energy_le (productActiveMemorySplit S B) (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (sharedActiveWeight S μ) (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productActiveMemorySplit_weight_symm S B μ _) (sharedActiveWeight_nonneg S μ hμ) (productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1)) ω hω hωmass _ (fun c a => (τ c a).symm) f (pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _) intro c a r exact unrestricted_reverse_promotion_only_product_energy_le n (Δ c a) (D c a) μ ρ V (fun g => (S g)ᶜ.card) B hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht _ (productActiveMemorySlice_symmetric S B (fun x => f x r) (hf r) c) end Bounty end section /- Norm envelopes of averaged inputs remain fixed by small-slot averaging. This permits the genuine two-sided storage estimate to be used in positive domination of an arbitrary endpoint-dependent dirty coefficient. -/ open Finset open scoped Classical namespace Bounty section variable {S X : Type*} [sharedInstance1 : Fintype S] [sharedInstance2 : DecidableEq S] include S X sharedInstance1 sharedInstance2 theorem physical_small_big_average_add {P : S → Finset ℕ} {J ell : ℕ} (F G : PhysicalSmallBigState P J ell X → ℂ) : physicalSmallBigAverage (F + G) = physicalSmallBigAverage F + physicalSmallBigAverage G := by funext s simp only [physicalSmallBigAverage, Pi.add_apply, sum_add_distrib, mul_add] theorem physical_small_big_average_of_invariant {P : S → Finset ℕ} {J ell : ℕ} (F : PhysicalSmallBigState P J ell X → ℂ) (hF : ∀ (σ : PhysicalPermutations S J ell) s, F (physicalSmallBigPermutation σ s) = F s) : physicalSmallBigAverage F = F := by funext s unfold physicalSmallBigAverage simp only [hF, sum_const, card_univ, nsmul_eq_mul] rw [← mul_assoc, inv_mul_cancel₀, one_mul] exact_mod_cast (Fintype.card_ne_zero : Fintype.card (PhysicalPermutations S J ell) ≠ 0) theorem physical_small_big_average_envelope_fixed {P : S → Finset ℕ} {J ell : ℕ} (F : PhysicalSmallBigState P J ell X → ℂ) : physicalSmallBigAverage (complexNormEnvelope (physicalSmallBigAverage F)) = complexNormEnvelope (physicalSmallBigAverage F) := by apply physical_small_big_average_of_invariant intro σ s simp only [complexNormEnvelope, physical_small_big_average_invariant] theorem physical_small_big_average_envelope_energy_le [Fintype X] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (hV : ∀ s, 0 < V s) (W : X → ℝ) (hW : ∀ x, 0 ≤ W x) (F : PhysicalSmallBigState P J ell X → ℂ) : physicalSmallBigEnergy V W (complexNormEnvelope (physicalSmallBigAverage F)) ≤ physicalSmallBigEnergy V W F := by calc _ = physicalSmallBigEnergy V W (physicalSmallBigAverage F) := by simp only [physicalSmallBigEnergy, complexNormEnvelope_norm] _ ≤ _ := physical_small_big_average_energy_le V hV W hW F theorem physical_small_big_average_norm_domination {P : S → Finset ℕ} {J ell : ℕ} (F G : PhysicalSmallBigState P J ell X → ℂ) (hdom : ∀ s, ‖F s‖ ≤ (G s).re) (s : PhysicalSmallBigState P J ell X) : ‖physicalSmallBigAverage F s‖ ≤ (physicalSmallBigAverage G s).re := by have hc : 0 ≤ (Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹ := inv_nonneg.mpr (Nat.cast_nonneg _) have hf : ‖physicalSmallBigAverage F s‖ ≤ (Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹ * ∑ σ : PhysicalPermutations S J ell, ‖F (physicalSmallBigPermutation σ s)‖ := by unfold physicalSmallBigAverage rw [norm_mul, ← Complex.ofReal_natCast, ← Complex.ofReal_inv, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hc] exact mul_le_mul_of_nonneg_left (norm_sum_le _ _) hc apply hf.trans calc _ ≤ (Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹ * ∑ σ : PhysicalPermutations S J ell, (G (physicalSmallBigPermutation σ s)).re := mul_le_mul_of_nonneg_left (sum_le_sum fun σ _ => hdom _) hc _ = _ := by simp only [physicalSmallBigAverage, ← Complex.ofReal_natCast, ← Complex.ofReal_inv, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, Complex.re_sum] end end Bounty end section /- The original complex full-mixed action with its actual forest mask is bounded by original positive mass. -/ open Finset Classical namespace Bounty section Mixed variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (Q : ∀ s, FullPermutationMixedPath n S B A Δ D steps s → Prop) (phase : ∀ s, FullPermutationMixedPath n S B A Δ D steps s → ℂ) (hphase : ∀ s p, ‖phase s p‖ ≤ 1) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) include hphase end Mixed end Bounty end section /- The Cauchy energy with exact diagonal and off-diagonal factors. -/ open Finset open scoped ComplexConjugate namespace Bounty noncomputable def typeIIDiagonalEnergy (E N M H : Finset ℕ) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) : ℝ := ∑ e∈E, ∑ n∈N, η e n*(∑ v∈M ×ˢ H, ‖typeIIEquationTerm α aH e n v‖^2) noncomputable def typeIIOffDiagonalEnergy (E N M H : Finset ℕ) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) : ℝ := ∑ e∈E, ∑ n∈N, η e n*(∑ v∈M ×ˢ H, ∑ w∈(M ×ˢ H).filter (fun w => v.1≠w.1), (typeIIEquationTerm α aH e n v * conj (typeIIEquationTerm α aH e n w)).re) theorem typeII_energy_split (E N M H : Finset ℕ) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) (hE : ∀ e∈E, 0 if m*n=2*e*h+1 then (h.divisors.card : ℝ)^2 else 0 have hpoint (e : ℕ) (he : e∈E) (n : ℕ) (hn : n∈N) (m : ℕ) (hm : m∈M) (h : ℕ) (hh : h∈H) : η e n*‖typeIIEquationTerm α aH e n (m,h)‖^2 ≤ C*A^2*B^2*t e n m h := by by_cases heq : m*n=2*e*h+1 · simp only [typeIIEquationTerm, heq, if_pos, norm_mul, mul_pow, t] have ha := pow_le_pow_left₀ (norm_nonneg (α m)) (hα m hm) 2 have hb := pow_le_pow_left₀ (norm_nonneg (aH h)) (haH h hh) 2 have hp := mul_le_mul ha hb (sq_nonneg _) (sq_nonneg A) have hηp := mul_le_mul (hη e he n hn).2 hp (by positivity) hC nlinarith [hηp] · simp [typeIIEquationTerm, heq, t] have hsum : typeIIDiagonalEnergy E N M H η α aH ≤ C*A^2*B^2*(∑ e∈E, ∑ n∈N, ∑ m∈M, ∑ h∈H, t e n m h) := by unfold typeIIDiagonalEnergy simp only [sum_product, mul_sum] apply sum_le_sum intro e he apply sum_le_sum intro n hn apply sum_le_sum intro m hm apply sum_le_sum intro h hh exact hpoint e he n hn m hm h hh have hswap : (∑ e∈E, ∑ n∈N, ∑ m∈M, ∑ h∈H, t e n m h) = ∑ m∈M, ∑ n∈N, ∑ z∈(E ×ˢ H).filter (fun z => m*n=2*z.1*z.2+1), (z.2.divisors.card : ℝ)^2 := by simp only [sum_filter, sum_product] change (∑ e∈E, ∑ n∈N, ∑ m∈M, ∑ h∈H, t e n m h) = ∑ m∈M, ∑ n∈N, ∑ e∈E, ∑ h∈H, t e n m h calc _ = ∑ e∈E, ∑ m∈M, ∑ n∈N, ∑ h∈H, t e n m h := sum_congr rfl (fun e he => sum_comm) _ = ∑ m∈M, ∑ e∈E, ∑ n∈N, ∑ h∈H, t e n m h := sum_comm _ = _ := sum_congr rfl (fun m hm => sum_comm) rw [hswap] at hsum exact hsum.trans (mul_le_mul_of_nonneg_left (typeII_diagonal_divisor_moment E H M N X hE hH hM hN hX) (by positivity)) end Bounty end section /- Restore the whole signed forest expansion with a single rank cutoff. -/ open Finset Classical Filter namespace Bounty theorem eventually_birthForest_two_regime_power_saving {a c C E G Cv Ca M Ch : ℝ} (ha : 0 < a) (hc : 0 < c) (hC : 0 ≤ C) (hE : 0 ≤ E) (hM : 0 ≤ M) (hD : 0 ≤ G + Ca + M) (hgain : E + Cv + 2 ≤ G) : ∀ᶠ L : ℝ in atTop, ∀ N m : ℕ, L ^ a ≤ (N : ℝ) → ∀ b H A ε : ℝ, L ^ c ≤ b → (m : ℝ) ≤ L ^ M → 0 ≤ H → H ≤ L ^ Ch → 0 ≤ A → A ≤ L ^ (C * ((N : ℝ) + 1)) → 0 ≤ ε → (m : ℝ) ^ 2 * ε ≤ Real.exp (-b) → ∀ F : BirthForestCode m → ℂ, let r := Nat.ceil (((2 * C + (E + 1) + 1) * N * Real.log L) / b) (∀ code, birthForestRank code < r → ‖F code‖ ≤ H * L ^ ((-G + Cv) * N + Cv + 2 * birthForestRank code * (G + Ca))) → (∀ code, r ≤ birthForestRank code → ‖F code‖ ≤ A * ε ^ birthForestRank code) → ‖∑ code : BirthForestCode m, (-1 : ℂ) ^ birthForestRank code * F code‖ ≤ L ^ (-(E * N)) := by have hE1 : 0 ≤ E + 1 := by linarith have hgain1 : E + 1 + Cv + 1 ≤ G := by linarith filter_upwards [eventually_ge_atTop (2 : ℝ), (tendsto_rpow_atTop hc).eventually_ge_atTop (Real.log 2), eventually_birthForest_low_rank_power_saving ha hc hC hE1 hM hD hgain1] with L hL hlog hlow intro N m hN b H A ε hb hm hH hHb hA hAb hε hεb F dsimp only intro hF hhigh let r := Nat.ceil (((2 * C + (E + 1) + 1) * N * Real.log L) / b) have hL1 : 1 ≤ L := by linarith have hL0 : 0 < L := by linarith have hNr : (0 : ℝ) < N := (Real.rpow_pos_of_pos hL0 a).trans_le hN have hN1 : 1 ≤ N := by have hp : 0 < N := by exact_mod_cast hNr omega have hb2 : Real.log 2 ≤ b := hlog.trans hb have hδ0 : 0 ≤ (m : ℝ) ^ 2 * ε := by positivity have hδ2 : (m : ℝ) ^ 2 * ε ≤ 1 / 2 := by calc _ ≤ Real.exp (-b) := hεb _ ≤ Real.exp (-Real.log 2) := Real.exp_le_exp.mpr (by linarith) _ = 1 / 2 := by rw [Real.exp_neg, Real.exp_log (by norm_num : (0 : ℝ) < 2)]; norm_num have htail := (birthForest_rank_tail_norm_le F r hA hε (by linarith) hhigh).trans (forest_rank_cutoff_tail (E := E + 1) N hL hC hb2 hN1 hAb hδ0 hεb) have hhead := hlow N m hN b H hb hm hH hHb F hF rw [birthForest_rank_split _ r] calc _ ≤ 2 * L ^ (-((E + 1) * N)) := (norm_add_le _ _).trans (by linarith) _ ≤ L ^ (N : ℝ) * L ^ (-((E + 1) * N)) := by apply mul_le_mul_of_nonneg_right _ (Real.rpow_pos_of_pos hL0 _).le calc 2 ≤ L := hL _ = L ^ (1 : ℝ) := (Real.rpow_one _).symm _ ≤ L ^ (N : ℝ) := Real.rpow_le_rpow_of_exponent_le hL1 (by exact_mod_cast hN1) _ = L ^ (-(E * N)) := by rw [← Real.rpow_add hL0] congr 1 ring end Bounty end section /- Independent small and big active-slot averaging on the genuine mixed state. Both choices remain in the explicit finite sum. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSmallBigJointAverage {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell : ℕ} {M : G → ℕ} {B : ℕ} (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) := physicalSmallBigAverage (fun s => fullActiveAverage (fun x => F (s.1, x)) s.2) section variable {S G : Type*} [sharedInstance1 : Fintype S] [sharedInstance2 : DecidableEq S] [sharedInstance3 : Fintype G] [sharedInstance4 : DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell : ℕ} {M : G → ℕ} {B : ℕ} (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) include S G sharedInstance1 sharedInstance2 sharedInstance3 sharedInstance4 Ps P Z J ell M B F theorem physical_small_big_joint_average_eq_sum (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : physicalSmallBigJointAverage F s = ∑ e : PhysicalPermutations S J ell × FullActiveSlotPermutations M, (((Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹ * fullActivePermutationWeight M e.2 : ℝ) : ℂ) * F ((s.1.1, physicalPermuteLabels e.1 s.1.2), fullActivePermutation e.2 s.2) := by simp only [physicalSmallBigJointAverage, physicalSmallBigAverage, fullActiveAverage, Fintype.sum_prod_type, Complex.ofReal_mul, Complex.ofReal_inv, Complex.ofReal_natCast, mul_sum, mul_assoc] rfl theorem physical_small_big_joint_average_memory_symmetric (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : ∀ s, ProductMemorySymmetric (fun x => physicalSmallBigJointAverage F (s, x)) := by apply physical_small_big_average_memory_symmetric intro s exact fullActiveAverage_symmetric (fun x => F (s, x)) (hF s) end theorem physical_small_big_joint_average_energy_le {S G : Type*} [Fintype S] [dS : DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {J ell : ℕ} {M : G → ℕ} {B : ℕ} (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) : physicalSmallBigEnergy Vs (productMemoryWeight μ ν) (physicalSmallBigJointAverage F) ≤ physicalSmallBigEnergy Vs (productMemoryWeight μ ν) F := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) apply (physical_small_big_average_energy_le Vs hVs (productMemoryWeight μ ν) (productMemoryWeight_nonneg μ ν hμ hν) _).trans have h := physical_small_big_fiber_energy_le Vs hVs (productMemoryWeight μ ν) F (fun s => fullActiveAverage (fun x => F (s.1, x)) s.2) 1 (fun s => by simpa only [one_mul] using fullActiveAverage_energy_le μ ν hμ hν (fun x => F (s, x))) simpa only [one_mul] using h end Bounty end section /- Uniform compact bounds for the actual candidate transition arguments. -/ open Finset Filter Real namespace Bounty noncomputable def candidateAllocationRadius (r : ℕ) : ℝ := 3*(r : ℝ)+10 noncomputable def candidateAllocationArgument (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (R : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (i : Fin ((candidateQIndices c L).card*r)) : ℝ := (allocationPrefixResidual (fun k => log (candidateAllocationValue c L r jStar x k)) R take i - log (candidateAllocationValue c L r jStar x i))/(c*L/2^(candidateAllocationOrder c L r i).1.val) theorem candidate_allocation_arguments_bounded {c L : ℝ} (hc : 0 < c) (hL : 0 < L) (hlog : 1 ≤ log L) (hlarge : 20*log L ≤ c*L) (hsmall : c ≤ 20*log L) {r jStar : ℕ} (hr : 6 ≤ r) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) {R : ℝ} (hR : 0 ≤ R) (hcap : R ≤ smoothAllocationInventory _ (fun i => log (candidateAllocationValue c L r jStar x i)) (candidateAllocationActive c L r jStar)+88*log L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hweight : 0 < candidateAllocationWeight c L r jStar x R take) (i : Fin ((candidateQIndices c L).card*r)) : candidateAllocationArgument c L r jStar x R take i ∈ Set.Icc (-candidateAllocationRadius r) (candidateAllocationRadius r) := by have hp := smooth_allocation_prefix_invariant _ (fun k => log (candidateAllocationValue c L r jStar x k)) (fun k => c*L/2^(candidateAllocationOrder c L r k).1.val) (candidateAllocationActive c L r jStar) R (88*log L) take (fun k => by positivity) hR hcap (candidate_allocation_room hc hL (zero_lt_one.trans_le hlog) hr x) hweight i have hsuffix := candidate_allocation_suffix_inventory_le (mul_nonneg hc.le hL.le) r jStar x i have hscale := ((candidateQIndices_geometry hc hL hlog hlarge hsmall).2 (candidateAllocationOrder c L r i).1.val (candidateAllocationOrder c L r i).1.property).1 have hv := candidate_Q_slot_log_bounds c L r jStar (candidateAllocationOrder c L r i) (x _).property have hvhi : log (candidateAllocationValue c L r jStar x i) ≤ (6/5 : ℝ)*(c*L/2^(candidateAllocationOrder c L r i).1.val) := by simpa only [candidateAllocationValue, mul_div_assoc] using hv.2 have hvlo : 0 ≤ log (candidateAllocationValue c L r jStar x i) := by exact (by positivity : (0 : ℝ) ≤ c*L/2^(candidateAllocationOrder c L r i).1.val).trans hv.1.le have hs : 0 < c*L/2^(candidateAllocationOrder c L r i).1.val := by positivity have hrs : 0 ≤ (r : ℝ)*(c*L/2^(candidateAllocationOrder c L r i).1.val) := by positivity unfold candidateAllocationArgument candidateAllocationRadius constructor · apply (le_div_iff₀ hs).mpr nlinarith · apply (div_le_iff₀ hs).mpr nlinarith theorem eventually_candidate_allocation_arguments_bounded {c : ℝ} (hc : 0 < c) {r : ℕ} (hr : 6 ≤ r) : ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (R : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool), 0 ≤ R → R ≤ smoothAllocationInventory _ (fun i => log (candidateAllocationValue c L r jStar x i)) (candidateAllocationActive c L r jStar)+88*log L → 0 < candidateAllocationWeight c L r jStar x R take → ∀ i, candidateAllocationArgument c L r jStar x R take i ∈ Set.Icc (-candidateAllocationRadius r) (candidateAllocationRadius r) := by filter_upwards [eventually_candidateQIndices_parameters hc] with L hL intro jStar x R take hR hcap hw i exact candidate_allocation_arguments_bounded hc hL.1 hL.2.1 hL.2.2.1 hL.2.2.2 hr x hR hcap take hw i end Bounty end section open MeasureTheory namespace Bounty theorem typeII_e_majorant_log_scale_eq_one {L t : ℝ} (hL : 0 < L) (ht : t ∈ Set.Icc ((L ^ 88)⁻¹) 1) : typeIIEMajorant (L ^ 88) t = 1 := by apply typeII_e_majorant_eq_one _ ht.2 have hp : 0 < L ^ 88 := pow_pos hL _ have hb := mul_le_mul_of_nonneg_left ht.1 hp.le simpa only [mul_inv_cancel₀ hp.ne'] using hb end Bounty end section open Filter MeasureTheory namespace Bounty theorem parameter_weight_le_power {P : Type*} [NormedAddCommGroup P] {p : P} {L a : ℝ} (hL : 1 ≤ L) (ha : 0 ≤ a) (hp : ‖p‖ ≤ L ^ a) (d : ℕ) : (1 + ‖p‖) ^ d ≤ 2 ^ d * L ^ (a * d) := by have hone : 1 ≤ L ^ a := Real.one_le_rpow hL ha calc _ ≤ (2 * L ^ a) ^ d := pow_le_pow_left₀ (by positivity) (by linarith) d _ = 2 ^ d * (L ^ a) ^ d := mul_pow _ _ _ _ = 2 ^ d * L ^ (a * d) := by rw [← Real.rpow_natCast (L ^ a) d, ← Real.rpow_mul (by linarith : 0 ≤ L)] theorem typeII_pulled_fourier_polynomial_l1_cost {A a : ℝ} (hA : 0 ≤ A) (ha : 0 ≤ a) : ∃ B : ℝ, 0 < B ∧ ∀ᶠ L : ℝ in atTop, ∀ p : Fin 4 → ℝ, ‖p‖ ≤ L ^ a → (∫ ξ : EuclideanSpace ℝ (Fin 3), ‖typeIIPulledFourier A (p 0) (p 1) (p 2) (p 3) ξ‖) ≤ L ^ B := by obtain ⟨d, C, hC, hb⟩ := typeII_pulled_fourier_l1_polynomial hA refine ⟨a * d + 1, by positivity, ?_⟩ filter_upwards [eventually_ge_atTop (max 1 (C * 2 ^ d))] with L hL have hL1 : 1 ≤ L := (le_max_left _ _).trans hL have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL1 have hCL : C * 2 ^ d ≤ L := (le_max_right _ _).trans hL intro p hp calc _ ≤ C * (1 + ‖p‖) ^ d := hb p _ ≤ C * (2 ^ d * L ^ (a * d)) := mul_le_mul_of_nonneg_left (parameter_weight_le_power hL1 ha hp d) hC _ = (C * 2 ^ d) * L ^ (a * d) := by ring _ ≤ L * L ^ (a * d) := mul_le_mul_of_nonneg_right hCL (Real.rpow_nonneg hL0.le _) _ = L ^ (a * d + 1) := by rw [Real.rpow_add hL0, Real.rpow_one]; ring theorem typeII_pulled_fourier_exists_power_cutoff {A a D : ℝ} (hA : 0 ≤ A) (ha : 0 ≤ a) (hD : 0 ≤ D) : ∃ B : ℝ, 0 < B ∧ ∀ᶠ L : ℝ in atTop, ∀ p : Fin 4 → ℝ, ‖p‖ ≤ L ^ a → ∀ t : EuclideanSpace ℝ (Fin 3), ‖(typeIIPulledCutoff A (p 0) (p 1) (p 2) (p 3) t : ℂ) - ∫ ξ in {ξ : EuclideanSpace ℝ (Fin 3) | ‖ξ‖ ≤ L ^ B}, typeIIPulledFourierIntegrand A (p 0) (p 1) (p 2) (p 3) t ξ‖ ≤ L ^ (-D) := by obtain ⟨d, C, hC, hb⟩ := typeII_pulled_fourier_truncation_polynomial hA 1 let B : ℝ := a * d + D + 1 refine ⟨B, by dsimp [B]; positivity, ?_⟩ filter_upwards [eventually_ge_atTop (max 1 (C * 2 ^ d))] with L hL have hL1 : 1 ≤ L := (le_max_left _ _).trans hL have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL1 have hCL : C * 2 ^ d ≤ L := (le_max_right _ _).trans hL intro p hp t have hpower : 0 ≤ (L ^ B) ^ (-(1 : ℝ)) := Real.rpow_nonneg (Real.rpow_nonneg hL0.le _) _ calc _ ≤ C * (1 + ‖p‖) ^ d * (L ^ B) ^ (-(1 : ℝ)) := by simpa only [Nat.cast_one] using hb p (L ^ B) (Real.rpow_pos_of_pos hL0 B) t _ ≤ C * (2 ^ d * L ^ (a * d)) * (L ^ B) ^ (-(1 : ℝ)) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (parameter_weight_le_power hL1 ha hp d) hC.le) hpower _ = (C * 2 ^ d) * (L ^ (a * d) * (L ^ B) ^ (-(1 : ℝ))) := by ring _ ≤ L * (L ^ (a * d) * (L ^ B) ^ (-(1 : ℝ))) := mul_le_mul_of_nonneg_right hCL (mul_nonneg (Real.rpow_nonneg hL0.le _) hpower) _ = L ^ (-D) := by rw [← Real.rpow_mul hL0.le, mul_neg_one, ← Real.rpow_add hL0] conv_lhs => lhs; rw [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 dsimp [B] ring end Bounty end section /- Uniform candidate-weighted mass bounds on the exact boundary layers. -/ open Finset Filter Real namespace Bounty theorem exists_candidate_boundary_divisor_test_bound {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (A D : ℝ) : ∃ B : ℝ, 1 ≤ B ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (F : ℕ → ℕ → ℂ), (∀ u ∈ typeIIBoundaryWindow (exp L) (L^(-B)), ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → (∑ u ∈ typeIIBoundaryWindow (exp L) (L^(-B)), candidateCoefficient c L q r jStar u * ∑ m ∈ (2*u+1).divisors, ‖F u m‖) ≤ exp L * L^(-D) := by obtain ⟨K, hK, hcoef⟩ := exists_candidate_coefficient_divisor_bound hc hr hq0 hq1 let B := 2*max (D+K+A) 0+18 have hB : 1 ≤ B := by dsimp [B]; linarith [le_max_right (D+K+A) 0] have hBD : 2*(D+K+A)+17 ≤ B := by dsimp [B]; linarith [le_max_left (D+K+A) 0] refine ⟨B, hB, ?_⟩ filter_upwards [hcoef, eventually_typeII_boundary_divisor_mass B (D+K+A) hB hBD, eventually_boundary_scale B hB] with L hcoeff hmass hscale intro jStar F hF have hL0 : 0 < L := zero_lt_one.trans_le hscale.1 have hE : 1 ≤ exp L := one_le_exp hL0.le have hδ : 0 ≤ L^(-B) := rpow_nonneg hL0.le _ have hsum : (∑ u ∈ typeIIBoundaryWindow (exp L) (L^(-B)), candidateCoefficient c L q r jStar u * ∑ m ∈ (2*u+1).divisors, ‖F u m‖) ≤ L^(K+A) * ∑ u ∈ typeIIBoundaryWindow (exp L) (L^(-B)), (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ) := by rw [mul_sum] apply sum_le_sum intro u hu have hu0 : u ≠ 0 := Nat.ne_of_gt (mem_typeII_boundary_window_bounds hE hδ hscale.2.1 hu).1 let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) have hdiv : primePoolFreePart P u ∣ u := ⟨primePoolPart P u, by simpa only [Nat.mul_comm] using (primePoolPart_mul_primePoolFreePart P u).symm⟩ have hcard : ((primePoolFreePart P u).divisors.card : ℝ) ≤ (u.divisors.card : ℝ) := by exact_mod_cast card_le_card (Nat.divisors_subset_of_dvd hu0 hdiv) have hcU : candidateCoefficient c L q r jStar u ≤ L^K*(u.divisors.card : ℝ) := (hcoeff jStar u).2.trans (mul_le_mul_of_nonneg_left hcard (rpow_nonneg hL0.le _)) have hinner : (∑ m ∈ (2*u+1).divisors, ‖F u m‖) ≤ ((2*u+1).divisors.card : ℝ)*L^A := by calc _ ≤ ∑ _m ∈ (2*u+1).divisors, L^A := sum_le_sum (fun m hm => hF u hu m hm) _ = _ := by simp calc _ ≤ (L^K*(u.divisors.card : ℝ))*(((2*u+1).divisors.card : ℝ)*L^A) := mul_le_mul hcU hinner (sum_nonneg (fun _ _ => norm_nonneg _)) (by positivity) _ = _ := by rw [rpow_add hL0]; ring calc _ ≤ L^(K+A) * ∑ u ∈ typeIIBoundaryWindow (exp L) (L^(-B)), (u.divisors.card : ℝ) * ((2*u+1).divisors.card : ℝ) := hsum _ ≤ L^(K+A) * (exp L*L^(-(D+K+A))) := mul_le_mul_of_nonneg_left hmass (rpow_nonneg hL0.le _) _ = exp L*L^(-D) := by rw [mul_left_comm, ← rpow_add hL0] congr 2 ring end Bounty end section /- The free-label exclusion is bounded on multiples, with both endpoint sequences retained. -/ open Finset namespace Bounty section Endpoints variable (Q : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (hα' : ∀ m, ‖α' m‖ ≤ A) (hβ' : ∀ p, ‖β' p‖ ≤ B) (hγ' : ∀ r, ‖γ' r‖ ≤ C) (S : Finset ℤ) (δ : ℤ) (d N : ℕ) (hd : d ∈ Nat.factoredNumbers Q) (hδ : (d : ℤ) ∣ δ) (hdiv : ∀ n ∈ S, (d : ℤ) ∣ n) (hS : ∀ n ∈ S, 0 ≤ n ∧ n ≤ (N : ℤ)) (hS' : ∀ n ∈ S, 0 ≤ n + δ ∧ n + δ ≤ (N : ℤ)) include hA hB hC hα hβ hγ hα' hβ' hγ' hd hδ hdiv hS hS' theorem invariant_triple_endpoint_cross_multiples : (∑ n ∈ S, ‖invariantTripleEndpoint Q α β γ n.natAbs‖ * ‖invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs‖) ≤ (A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 / d := by have hf := invariant_triple_endpoint_int_divisible_energy Q α β γ hA hB hC hα hβ hγ S d N hd (fun n hn => Int.natCast_dvd.mp (hdiv n hn)) hS have hg := invariant_triple_endpoint_shifted_divisible_energy Q α' β' γ' hA hB hC hα' hβ' hγ' S δ d N hd hδ hdiv hS' have hsum := Real.sum_mul_le_sqrt_mul_sqrt S (fun n => ‖invariantTripleEndpoint Q α β γ n.natAbs‖) (fun n => ‖invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs‖) apply hsum.trans calc _ ≤ Real.sqrt ((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 / d) * Real.sqrt ((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 / d) := mul_le_mul (Real.sqrt_le_sqrt hf) (Real.sqrt_le_sqrt hg) (by positivity) (by positivity) _ = _ := Real.mul_self_sqrt (by positivity) theorem invariant_triple_endpoint_harmonic_multiples {Y K : ℝ} (hY : 0 < Y) (hK : 0 ≤ K) (hYlow : ∀ n ∈ S, Y ≤ (n : ℝ)) (w : ℤ → ℂ) (hw : ∀ n ∈ S, ‖w n‖ ≤ K) : ‖∑ n ∈ S, (w n / (n : ℂ)) * star (invariantTripleEndpoint Q α β γ n.natAbs) * invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs‖ ≤ K / Y * ((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 / d) := by have hcross := invariant_triple_endpoint_cross_multiples Q α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' S δ d N hd hδ hdiv hS hS' calc _ ≤ ∑ n ∈ S, ‖(w n / (n : ℂ)) * star (invariantTripleEndpoint Q α β γ n.natAbs) * invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs‖ := norm_sum_le _ _ _ ≤ ∑ n ∈ S, (K / Y) * (‖invariantTripleEndpoint Q α β γ n.natAbs‖ * ‖invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs‖) := by apply sum_le_sum intro n hn have hn0 : (0 : ℝ) < n := hY.trans_le (hYlow n hn) have hnC : ‖(n : ℂ)‖ = (n : ℝ) := by rw [← Complex.ofReal_intCast, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hn0] rw [norm_mul, norm_mul, norm_div, norm_star, hnC] have hquot : ‖w n‖ / (n : ℝ) ≤ K / Y := div_le_div₀ hK (hw n hn) hY (hYlow n hn) nlinarith [mul_le_mul_of_nonneg_right hquot (mul_nonneg (norm_nonneg (invariantTripleEndpoint Q α β γ n.natAbs)) (norm_nonneg (invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs)))] _ = K / Y * ∑ n ∈ S, ‖invariantTripleEndpoint Q α β γ n.natAbs‖ * ‖invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs‖ := (mul_sum ..).symm _ ≤ _ := mul_le_mul_of_nonneg_left hcross (div_nonneg hK hY.le) end Endpoints end Bounty end section /- The literal root-weighted arithmetic edge sum, before Mellin separation. -/ open Finset namespace Bounty noncomputable def physicalMellinRootCorrelation {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) : ℂ := by classical exact (physicalStateMass V J ell : ℂ) * ∑ x ∈ physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, ∑ i ∈ patterns, ∑ aux : PhysicalAuxLabels P (C i), if y.1 = x.1 + k i * (physicalD (C i) x.2.val aux : ℕ) then Ψ ((x.1 : ℝ) / (Z * physicalD (C i) x.2.val aux)) * (x.1 : ℂ)⁻¹ * (starRingEnd ℂ) (f x.1) * physicalBarePatternScalar V (C i) (ζ i) (K i) aux x.2.val y.2.val * g y.1 * ((physicalVertexWeight x.2.val q x.1 * physicalVertexWeight y.2.val q y.1 : ℝ) : ℂ) else 0 theorem physical_mellin_root_as_atoms {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) : physicalMellinRootCorrelation V patterns C q ζ k K positions f g Ψ Z = (physicalStateMass V J ell : ℂ) * ∑ a : PhysicalMellinAtom P J ell patterns C positions, physicalMellinAtomCoefficient V patterns C q ζ k K positions f g a * Ψ (physicalMellinAtomArgument Z a) := by classical unfold physicalMellinRootCorrelation apply congrArg (fun z : ℂ => (physicalStateMass V J ell : ℂ) * z) let T := fun (x y : PhysicalState P J ell) (i : I) (aux : PhysicalAuxLabels P (C i)) => (if y.1 = x.1 + k i * (physicalD (C i) x.2.val aux : ℕ) then (x.1 : ℂ)⁻¹ * (starRingEnd ℂ) (f x.1) * physicalBarePatternScalar V (C i) (ζ i) (K i) aux x.2.val y.2.val * g y.1 * ((physicalVertexWeight x.2.val q x.1 * physicalVertexWeight y.2.val q y.1 : ℝ) : ℂ) else 0) * Ψ ((x.1 : ℝ) / (Z * physicalD (C i) x.2.val aux)) have hs : (∑ a : PhysicalMellinAtom P J ell patterns C positions, physicalMellinAtomCoefficient V patterns C q ζ k K positions f g a * Ψ (physicalMellinAtomArgument Z a)) = ∑ x ∈ physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, ∑ i ∈ patterns, ∑ aux : PhysicalAuxLabels P (C i), T x y i aux := physical_mellin_atom_sum patterns C positions T rw [hs] apply sum_congr rfl intro x _ apply sum_congr rfl intro y _ apply sum_congr rfl intro i _ apply sum_congr rfl intro aux _ dsimp only [T] split_ifs <;> ring end Bounty end section /- Exact finite character expansion of the original physical Hilbert pairing. -/ open Finset namespace Bounty theorem physical_mellin_pairing_atoms {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (hP : ∀ g p, p ∈ P g → 0 < p) (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (f g : ℤ → ℂ) (hsource : ∀ n ∈ positions, f n ≠ 0 → 0 < n) (X Z v : ℝ) (hZ : Z ≠ 0) : inner ℂ (physicalEndpointVector P V J ell q positions (physicalMellinSource X Z v f)) (physicalHilbertOperator V patterns C q (fun i => ζ i - v) k K positions (physicalEndpointVector P V J ell q positions g)) = (X : ℂ) * (physicalStateMass V J ell : ℂ) * ∑ a : PhysicalMellinAtom P J ell patterns C positions, physicalMellinAtomCoefficient V patterns C q ζ k K positions f g a * physicalMellinPhase v (physicalMellinAtomArgument Z a) := by classical let T := fun (x y : PhysicalState P J ell) (i : I) (aux : PhysicalAuxLabels P (C i)) => (if y.1 = x.1 + k i * (physicalD (C i) x.2.val aux : ℕ) then (x.1 : ℂ)⁻¹ * (starRingEnd ℂ) (f x.1) * physicalBarePatternScalar V (C i) (ζ i) (K i) aux x.2.val y.2.val * g y.1 * ((physicalVertexWeight x.2.val q x.1 * physicalVertexWeight y.2.val q y.1 : ℝ) : ℂ) else 0) * physicalMellinPhase v ((x.1 : ℝ) / (Z * physicalD (C i) x.2.val aux)) have hs : (∑ a : PhysicalMellinAtom P J ell patterns C positions, physicalMellinAtomCoefficient V patterns C q ζ k K positions f g a * physicalMellinPhase v (physicalMellinAtomArgument Z a)) = ∑ x ∈ physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, ∑ i ∈ patterns, ∑ aux : PhysicalAuxLabels P (C i), T x y i aux := by exact physical_mellin_atom_sum patterns C positions T rw [hs, physical_endpoint_pairing_eq_bare V hV patterns C hq] simp_rw [mul_sum] apply sum_congr rfl intro x hx apply sum_congr rfl intro y _ apply sum_congr rfl intro i _ apply sum_congr rfl intro aux _ dsimp only [T] split_ifs with ht · by_cases hf : f x.1 = 0 · simp only [physical_mellin_source_zero X Z v f x.1 hf, hf, map_zero, zero_mul, mul_zero] · have hn : x.1 ≠ 0 := ne_of_gt (hsource x.1 ((mem_physical_cutoff P J ell positions x).mp hx) hf) rw [physical_mellin_source_edge V (C i) (ζ i) v X Z hZ (K i) aux x.2.val y.2.val (ne_of_gt (physical_D_pos (C i) x.2.val aux hP)) f x.1 hn] ring · simp only [mul_zero, zero_mul] end Bounty end section /- Mellin modulation preserves endpoint energy; the dyadic source weight contracts it. -/ open Finset namespace Bounty theorem physical_mellin_source_norm (X Z v : ℝ) (f : ℤ → ℂ) (n : ℤ) : ‖physicalMellinSource X Z v f n‖ = |X / (n : ℝ)| * ‖f n‖ := by simp only [physicalMellinSource, norm_mul, physical_mellin_phase_norm, mul_one, Complex.norm_real, Real.norm_eq_abs] end Bounty end section /- Fourier moments and uniform truncation for the actual logarithmic window. -/ open MeasureTheory namespace Bounty theorem typeII_window_fourier_moment_polynomial (M : ℕ) : ∃ (d : ℕ) (C : ℝ), 0 ≤ C ∧ ∀ r : ℝ, (∫ ξ : ℝ, ‖ξ‖ ^ M * ‖typeIIWindowFourier r ξ‖) ≤ C * (1 + |r|) ^ d := by obtain ⟨R, hR, hs⟩ := typeII_window_support_radius exact fourier_domain_moment_polynomial_of_fixed_support typeIIWindowLogSchwartz (fun r => 1 + |r|) (fun r => by linarith [abs_nonneg r]) R hR hs typeII_window_derivative_polynomial_bound M theorem typeII_window_fourier_l1_polynomial : ∃ (d : ℕ) (C : ℝ), 0 ≤ C ∧ ∀ r : ℝ, (∫ ξ : ℝ, ‖typeIIWindowFourier r ξ‖) ≤ C * (1 + |r|) ^ d := by simpa only [pow_zero, one_mul] using typeII_window_fourier_moment_polynomial 0 theorem typeII_window_fourier_tail_polynomial (M : ℕ) : ∃ (d : ℕ) (C : ℝ), 0 < C ∧ ∀ r R : ℝ, 0 < R → (∫ ξ in {ξ : ℝ | R < ‖ξ‖}, ‖typeIIWindowFourier r ξ‖) ≤ C * (1 + |r|) ^ d * R ^ (-(M : ℝ)) := by obtain ⟨d, C, hC, hb⟩ := typeII_window_fourier_moment_polynomial M refine ⟨d, C + 1, by linarith, ?_⟩ intro r R hR calc _ ≤ (∫ ξ : ℝ, ‖ξ‖^M * ‖typeIIWindowFourier r ξ‖) / R^M := schwartz_norm_tail_le_moment _ M hR _ ≤ (C * (1 + |r|)^d) / R^M := div_le_div_of_nonneg_right (hb r) (pow_nonneg hR.le M) _ ≤ ((C + 1) * (1 + |r|)^d) / R^M := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right (by linarith) (by positivity)) (pow_nonneg hR.le M) _ = _ := by rw [Real.rpow_neg hR.le, Real.rpow_natCast, div_eq_mul_inv] noncomputable def typeIIWindowFourierIntegrand (r s ξ : ℝ) : ℂ := Complex.exp (((2 * Real.pi * ξ * s : ℝ) : ℂ) * Complex.I) * typeIIWindowFourier r ξ theorem typeII_window_fourier_integrand_norm (r s ξ : ℝ) : ‖typeIIWindowFourierIntegrand r s ξ‖ = ‖typeIIWindowFourier r ξ‖ := by rw [typeIIWindowFourierIntegrand, norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul] theorem typeII_window_fourier_integrand_integrable (r s : ℝ) : Integrable (typeIIWindowFourierIntegrand r s) := by have hc : Continuous (typeIIWindowFourierIntegrand r s) := by unfold typeIIWindowFourierIntegrand apply Continuous.mul · fun_prop · exact (typeIIWindowFourier r).continuous apply (typeII_window_fourier_integrable r).norm.mono' hc.aestronglyMeasurable exact Filter.Eventually.of_forall (fun ξ => (typeII_window_fourier_integrand_norm r s ξ).le) theorem typeII_window_fourier_truncation_le_tail (r R s : ℝ) : ‖(typeIIWindowLogCutoff r s : ℂ) - ∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ R}, typeIIWindowFourierIntegrand r s ξ‖ ≤ ∫ ξ in {ξ : ℝ | R < ‖ξ‖}, ‖typeIIWindowFourier r ξ‖ := by have hs : MeasurableSet {ξ : ℝ | ‖ξ‖ ≤ R} := (isClosed_le continuous_norm continuous_const).measurableSet have heq : {ξ : ℝ | ‖ξ‖ ≤ R}ᶜ = {ξ : ℝ | R < ‖ξ‖} := by ext ξ; simp rw [typeII_window_fourier_inversion] change ‖(∫ ξ : ℝ, typeIIWindowFourierIntegrand r s ξ) - _‖ ≤ _ rw [← setIntegral_compl hs (typeII_window_fourier_integrand_integrable r s), heq] apply (norm_integral_le_integral_norm _).trans exact le_of_eq (integral_congr_ae (Filter.Eventually.of_forall (fun ξ => typeII_window_fourier_integrand_norm r s ξ))) theorem typeII_window_fourier_truncation_polynomial (M : ℕ) : ∃ (d : ℕ) (C : ℝ), 0 < C ∧ ∀ r R : ℝ, 0 < R → ∀ s : ℝ, ‖(typeIIWindowLogCutoff r s : ℂ) - ∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ R}, typeIIWindowFourierIntegrand r s ξ‖ ≤ C * (1 + |r|) ^ d * R ^ (-(M : ℝ)) := by obtain ⟨d, C, hC, hb⟩ := typeII_window_fourier_tail_polynomial M exact ⟨d, C, hC, fun r R hR s => (typeII_window_fourier_truncation_le_tail r R s).trans (hb r R hR)⟩ end Bounty end section /- Absolute finite test mass controls a relative complex coefficient error. -/ open Finset namespace Bounty theorem norm_fiber_coefficient_error_le (T : Finset ℕ) (fibers : ℕ → Finset ℕ) (a : ℕ → ℝ) (f g : ℕ → ℂ) (F : ℕ → ℕ → ℂ) {err : ℝ} (herr : 0 ≤ err) (ha : ∀ u ∈ T, 0 ≤ a u) (hfg : ∀ u ∈ T, ‖f u-g u‖ ≤ err*a u) : ‖(∑ u ∈ T, f u*∑ m ∈ fibers u, F u m) - ∑ u ∈ T, g u*∑ m ∈ fibers u, F u m‖ ≤ err*(∑ u ∈ T, a u*∑ m ∈ fibers u, ‖F u m‖) := by rw [← sum_sub_distrib] apply (norm_sum_le _ _).trans rw [mul_sum] apply sum_le_sum intro u hu rw [← sub_mul, norm_mul] calc _ ≤ (err*a u)*(∑ m ∈ fibers u, ‖F u m‖) := mul_le_mul (hfg u hu) (norm_sum_le _ _) (norm_nonneg _) (mul_nonneg herr (ha u hu)) _ = _ := by ring end Bounty end section /- The original initial-avoidance and birth-distinctness gates have a single forest expansion on the common address space. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedCommonIndexedPerformed (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : Prop := fullMixedCommonBirthPerformed n S B A Δ D steps x p (fullMixedCommonBirthOrder M B steps i) noncomputable def fullMixedCommonIndexedValue (encode : ((g : Fin N) × P g) → ℤ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : ℤ := ((fullMixedCommonBirthLabel n S B A Δ D steps x p (fullMixedCommonBirthOrder M B steps i)).map encode).getD 0 variable [∀ g, DecidableEq (P g)] theorem full_mixed_common_path_forest_expansion {Ω : Type*} (paths : Finset Ω) (x : Ω → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : ∀ ω, FullPermutationMixedPath n S B A Δ D steps (x ω)) (hx : ∀ ω ∈ paths, FullActiveInjective (x ω)) (encode : ((g : Fin N) × P g) → ℤ) (hencode : Function.Injective encode) (w : Ω → ℂ) : (∑ ω ∈ paths, (if ∀ a z, fullMixedPathBirthLabel n S B A Δ D steps (x ω) (p ω) a = some z → z.2 ∉ fullActiveInitialLedger (x ω) z.1 then (1 : ℂ) else 0) * (if ∀ a b z, fullMixedPathBirthLabel n S B A Δ D steps (x ω) (p ω) a = some z → fullMixedPathBirthLabel n S B A Δ D steps (x ω) (p ω) b = some z → a = b then (1 : ℂ) else 0) * w ω) = ∑ code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps)), (-1 : ℂ) ^ birthForestRank code * birthForestPathSum paths w (fun ω => fullMixedCommonIndexedPerformed n S B A Δ D steps (x ω) (p ω)) (fun ω => fullMixedCommonIndexedValue n S B A Δ D steps encode (x ω) (p ω)) code := by have h := initial_birth_path_forest_expansion paths (fullMixedCommonBirthOrder M B steps) encode hencode (fun ω => fullMixedCommonInitialPrime (x ω)) (fun ω => fullMixedCommonPathBirthLabel n S B A Δ D steps (x ω) (p ω)) w (fun ω hω => full_mixed_common_initial_injective (x ω) (hx ω hω)) change _ = ∑ code, (-1 : ℂ) ^ birthForestRank code * birthForestPathSum paths w (fun ω => initialBirthIndexedPerformed (fullMixedCommonBirthOrder M B steps) (fullMixedCommonInitialPrime (x ω)) (fullMixedCommonPathBirthLabel n S B A Δ D steps (x ω) (p ω))) (fun ω => initialBirthIndexedValue (fullMixedCommonBirthOrder M B steps) encode (fullMixedCommonInitialPrime (x ω)) (fullMixedCommonPathBirthLabel n S B A Δ D steps (x ω) (p ω))) code rw [← h] apply sum_congr rfl intro ω _ rw [full_mixed_common_initial_avoidance_iff, full_mixed_common_path_distinct_iff] split_ifs <;> rfl end Full end Bounty end section /- Small-mark removal with a coefficient depending on the other divisor pools. -/ open Finset namespace Bounty theorem marked_prime_peel_mul_invariant {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (g : G) (k : ℕ) (b f : ℕ → ℂ) (n : ℕ) (hb : ∀ p ∈ P g, p ∣ n → b (n / p) = b n) : markedPrimePeel groups P q V t g k (fun m => b m * f m) n = b n * markedPrimePeel groups P q V t g k f n := by classical unfold markedPrimePeel calc _ = (1 / (V g : ℂ)) * ∑ p ∈ P g, b n * (if p ∣ n then (markedDivisorWeight groups P q V (Function.update t g k) ((n / p : ℕ) : ℤ) : ℂ) * f (n / p) else 0) := by congr 1 apply sum_congr rfl intro p hp by_cases hpn : p ∣ n · simp only [if_pos hpn] rw [hb p hp hpn] ring · simp only [if_neg hpn, mul_zero] _ = _ := by rw [← mul_sum]; ring theorem invariant_marked_coefficient_peel_error_energy {G : Type*} [DecidableEq G] (groups : Finset G) (P : G → Finset ℕ) {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (V : G → ℝ) (t : G → ℕ) (T : ℕ) (hV : ∀ g ∈ groups, v ≤ V g) (ht : ∀ g ∈ groups, t g ≤ T) (hprime : ∀ g ∈ groups, ∀ p ∈ P g, p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (hg : g ∈ groups) (k : ℕ) (htg : t g = k + 1) (Q : Finset ℕ) (hQ : P g ⊆ Q) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (S : Finset ℕ) (N : ℕ) (hS : ∀ n ∈ S, 0 < n ∧ n ≤ N) (b : ℕ → ℂ) {H : ℝ} (hb : ∀ n ∈ S, ‖b n‖ ≤ H) (hinv : ∀ n ∈ S, ∀ p ∈ P g, p ∣ n → b (n / p) = b n) : (∑ n ∈ S, ‖(markedDivisorWeight groups P q V t (n : ℤ) : ℂ) * (b n * invariantTripleEndpoint Q α β γ n) - markedPrimePeel groups P q V t g k (fun m => b m * invariantTripleEndpoint Q α β γ m) n‖ ^ 2) ≤ H ^ 2 * (((markedDivisorBound q v T) ^ groups.card * (1 + 2 * Real.log N / v)) ^ 2 * (((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∑ p ∈ P g, 1 / (p : ℝ) ^ 2)) := by calc _ ≤ ∑ n ∈ S, H ^ 2 * ‖(markedDivisorWeight groups P q V t (n : ℤ) : ℂ) * invariantTripleEndpoint Q α β γ n - markedPrimePeel groups P q V t g k (invariantTripleEndpoint Q α β γ) n‖ ^ 2 := by apply sum_le_sum intro n hn rw [marked_prime_peel_mul_invariant groups P q V t g k b _ n (hinv n hn)] rw [show (markedDivisorWeight groups P q V t (n : ℤ) : ℂ) * (b n * invariantTripleEndpoint Q α β γ n) - b n * markedPrimePeel groups P q V t g k (invariantTripleEndpoint Q α β γ) n = b n * ((markedDivisorWeight groups P q V t (n : ℤ) : ℂ) * invariantTripleEndpoint Q α β γ n - markedPrimePeel groups P q V t g k (invariantTripleEndpoint Q α β γ) n) by ring] rw [norm_mul, mul_pow] exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (norm_nonneg _) (hb n hn) 2) (sq_nonneg _) _ = H ^ 2 * ∑ n ∈ S, ‖(markedDivisorWeight groups P q V t (n : ℤ) : ℂ) * invariantTripleEndpoint Q α β γ n - markedPrimePeel groups P q V t g k (invariantTripleEndpoint Q α β γ) n‖ ^ 2 := (mul_sum ..).symm _ ≤ _ := mul_le_mul_of_nonneg_left (invariant_marked_prime_peel_error_energy groups P hq0 hq1 hv V t T hV ht hprime hdis g hg k htg Q hQ α β γ hA hB hC hα hβ hγ S N hS) (sq_nonneg H) end Bounty end section /- The actual retained candidate coefficient satisfies the post-Cauchy absolute cross bound. -/ open Finset Filter Real namespace Bounty end Bounty end section /- Plancherel majorization of actual local finite Fourier energy. -/ open Finset MeasureTheory open scoped FourierTransform namespace Bounty theorem local_additive_inverse_fourier (S : Finset ℕ) (a : ℕ → ℂ) {H : ℝ} (hH : 0 < H) (β : ℝ) : 𝓕⁻ (localAdditiveSchwartz S a H hH) β = (H:ℂ) * 𝓕 localMellinKernelSchwartz (H*β) * localAdditivePolynomial S a β := by have hi (n : ℕ) : Integrable (fun v : ℝ => a n * (Complex.exp (((2*Real.pi*β*v:ℝ):ℂ)*Complex.I) * localMellinKernelSchwartz (((n:ℝ)-v)/H))) := by have hc : Continuous (fun v : ℝ => a n * (Complex.exp (((2*Real.pi*β*v:ℝ):ℂ)*Complex.I) * localMellinKernelSchwartz (((n:ℝ)-v)/H))) := by fun_prop apply hc.integrable_of_hasCompactSupport exact ((local_kernel_translate_compact (n:ℝ) hH).mul_left).mul_left have hform : 𝓕⁻ (localAdditiveSchwartz S a H hH) β = ∫ v : ℝ, ∑ n ∈ S, a n * (Complex.exp (((2*Real.pi*β*v:ℝ):ℂ)*Complex.I) * localMellinKernelSchwartz (((n:ℝ)-v)/H)) := by rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq'] apply integral_congr_ae filter_upwards [] with v change Complex.exp (((2*Real.pi*inner ℝ v β:ℝ):ℂ)*Complex.I) * localAdditiveConvolution S a H v = _ simp only [RCLike.inner_apply, starRingEnd_apply, star_trivial, localAdditiveConvolution, mul_sum] apply sum_congr rfl intro n hn have he : (2*Real.pi*(β*v):ℝ) = 2*Real.pi*β*v := by ring simp only [he] ring rw [hform, integral_finsetSum S (fun n _ => hi n)] simp_rw [integral_const_mul, local_kernel_translate_inverse_fourier _ _ hH] rw [localAdditivePolynomial, mul_sum] apply sum_congr rfl intro n hn push_cast ring theorem local_fourier_energy_le_convolution (S : Finset ℕ) (a : ℕ → ℂ) {H : ℝ} (hH : 0 < H) : (∫ β in {β : ℝ | |β| ≤ 1/H}, ‖localAdditivePolynomial S a β‖^2) ≤ (4 / H^2) * ∫ v : ℝ, ‖localAdditiveConvolution S a H v‖^2 := by let f := localAdditiveSchwartz S a H hH have hsq : Integrable (fun β : ℝ => ‖𝓕⁻ f β‖^2) := (memLp_two_iff_integrable_sq_norm (𝓕⁻ f).continuous.aestronglyMeasurable).mp ((𝓕⁻ f).memLp 2) have hpoint (β : ℝ) (hβ : |β| ≤ 1/H) : ‖localAdditivePolynomial S a β‖^2 ≤ (4/H^2)*‖𝓕⁻ f β‖^2 := by have hb : |H*β| ≤ 1 := by rw [abs_mul, abs_of_pos hH] exact (mul_le_mul_of_nonneg_left hβ hH.le).trans_eq (by field_simp) have hk := local_mellin_kernel_fourier_lower hb have hn : ‖𝓕⁻ f β‖ = H * ‖𝓕 localMellinKernelSchwartz (H*β)‖ * ‖localAdditivePolynomial S a β‖ := by rw [local_additive_inverse_fourier S a hH β, norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hH] have hmul : H * ‖localAdditivePolynomial S a β‖ ≤ 2*‖𝓕⁻ f β‖ := by rw [hn] nlinarith [mul_nonneg hH.le (norm_nonneg (localAdditivePolynomial S a β)), mul_nonneg (show 0 ≤ 2*‖𝓕 localMellinKernelSchwartz (H*β)‖-1 by linarith) (mul_nonneg hH.le (norm_nonneg (localAdditivePolynomial S a β)))] have hs := pow_le_pow_left₀ (mul_nonneg hH.le (norm_nonneg _)) hmul 2 rw [mul_pow, mul_pow] at hs rw [div_mul_eq_mul_div] apply (le_div_iff₀ (sq_pos_of_pos hH)).mpr nlinarith have hset : MeasurableSet {β : ℝ | |β| ≤ 1/H} := (isClosed_le continuous_abs continuous_const).measurableSet have hp : (∫ β in {β : ℝ | |β| ≤ 1/H}, ‖localAdditivePolynomial S a β‖^2) ≤ (4/H^2) * ∫ β : ℝ, ‖𝓕⁻ f β‖^2 := by calc _ ≤ ∫ β in {β : ℝ | |β| ≤ 1/H}, (4/H^2)*‖𝓕⁻ f β‖^2 := by apply integral_mono_of_nonneg (Filter.Eventually.of_forall (fun β => sq_nonneg _)) ((hsq.const_mul _).integrableOn) filter_upwards [ae_restrict_mem hset] with β hβ exact hpoint β hβ _ = (4/H^2)*∫ β in {β : ℝ | |β| ≤ 1/H}, ‖𝓕⁻ f β‖^2 := integral_const_mul _ _ _ ≤ _ := mul_le_mul_of_nonneg_left (setIntegral_le_integral hsq (Filter.Eventually.of_forall (fun β => sq_nonneg _))) (by positivity) have hpl := SchwartzMap.integral_norm_sq_fourier (𝓕⁻ f) rw [FourierTransform.fourier_fourierInv_eq] at hpl exact hp.trans_eq (by rw [← hpl]; rfl) end Bounty end section /- The inward cutoff permits enlarging the summation domain before Mellin inversion. -/ open Finset Real namespace Bounty theorem typeII_window_smooth_nat_support {x δ : ℝ} (hx : 0 < x) (hδ : 0 < δ) (u : ℕ) (hu : typeIIWindowSmooth δ ((u : ℝ)/x) ≠ 0) : u ∈ arithmeticProductWindow 1 x := by have hh := typeII_window_smooth_support hδ hu apply (mem_arithmeticProductWindow_iff one_ne_zero x).mpr simpa only [one_mul] using And.intro ((lt_div_iff₀ hx).mp hh.1) (((div_lt_iff₀ hx).mp hh.2).le) theorem typeII_smooth_sum_restrict {x δ : ℝ} (hx : 0 < x) (hδ : 0 < δ) (S : Finset ℕ) (hS : arithmeticProductWindow 1 x ⊆ S) (a G : ℕ → ℂ) : (∑ u ∈ S, a u * (typeIIWindowSmooth δ ((u : ℝ)/x) : ℂ) * G u) = ∑ u ∈ arithmeticProductWindow 1 x, a u * (typeIIWindowSmooth δ ((u : ℝ)/x) : ℂ) * G u := by symm apply sum_subset hS intro u hu hnot have hz : typeIIWindowSmooth δ ((u : ℝ)/x) = 0 := by by_contra hn exact hnot (typeII_window_smooth_nat_support hx hδ u hn) simp only [hz, Complex.ofReal_zero, mul_zero, zero_mul] end Bounty end section /- Exact big-active projection identities on the genuine mixed measure. Only big permutations commute with the endpoint gates; the small-tail gate is kept inside the small-conditioning map. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSmallBigBigAverage {S G : Type*} [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell : ℕ} {M : G → ℕ} {B : ℕ} (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : ℂ := fullActiveAverage (fun x => F (s.1, x)) s.2 theorem physical_small_big_big_average_self_adjoint {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {J ell : ℕ} {M : G → ℕ} {B : ℕ} (Vs : S → ℝ) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (f h : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) : (∑ s, (physicalSmallBigMeasure Vs (productMemoryWeight μ ν) s : ℂ) * (starRingEnd ℂ) (f s) * physicalSmallBigBigAverage h s) = ∑ s, (physicalSmallBigMeasure Vs (productMemoryWeight μ ν) s : ℂ) * (starRingEnd ℂ) (physicalSmallBigBigAverage f s) * h s := by conv_lhs => rw [Fintype.sum_prod_type] conv_rhs => rw [Fintype.sum_prod_type] apply sum_congr rfl intro s _ by_cases hs : physicalResidueMarksValid s.1 s.2 · simpa only [physicalSmallBigMeasure, hs, if_true, physicalSmallBigBigAverage, Complex.ofReal_mul, mul_sum, mul_assoc] using congrArg (fun z : ℂ => (physicalStateMass Vs J ell : ℂ) * z) (fullActiveAverage_self_adjoint μ ν (fun x => f (s, x)) (fun x => h (s, x))) · simp only [physicalSmallBigMeasure, hs, if_false, Complex.ofReal_zero, zero_mul, sum_const_zero] theorem physical_small_big_condition_big_average {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell : ℕ} {M : G → ℕ} {B : ℕ} (Vs : S → ℝ) (q : ℝ) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (d : PhysicalSharedLists Ps J) (x) (r : PhysicalResidues Ps) : physicalSmallBigCondition Vs q (physicalSmallBigBigAverage f) d x r = fullActiveAverage (fun y => physicalSmallBigCondition Vs q f d y r) x := by exact physical_small_condition_full_active_average Vs q r d (fun y L => f ((r, L), y)) x theorem physical_small_big_gate_big_average {S G : Type*} [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell : ℕ} {M : G → ℕ} {B : ℕ} (gate f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (hg : ∀ s (τ : FullActiveSlotPermutations M), gate (s.1, fullActivePermutation τ s.2) = gate s) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) : gate s * physicalSmallBigBigAverage f s = physicalSmallBigBigAverage (fun y => gate y * f y) s := by simp only [physicalSmallBigBigAverage, fullActiveAverage, hg, mul_sum] apply sum_congr rfl intro τ _ ring section variable {S G : Type*} {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} include S G Ps P Z J ell B M theorem clean_mixed_big_active_injective_permutation (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) (τ : FullActiveSlotPermutations M) : CleanMixedBigActiveInjective (s.1, fullActivePermutation τ s.2) ↔ CleanMixedBigActiveInjective s := by constructor · intro h g a b hab have he := h g (a₁ := (τ g).symm a) (a₂ := (τ g).symm b) have he' : (τ g).symm a = (τ g).symm b := he (by change (s.2 g).1 (τ g ((τ g).symm a)) = (s.2 g).1 (τ g ((τ g).symm b)) simpa only [Equiv.apply_symm_apply] using hab) exact (τ g).symm.injective he' · intro h g exact (h g).comp (τ g).injective theorem clean_mixed_source_gate_big_permutation (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) (τ : FullActiveSlotPermutations M) : cleanMixedSourceGate (s.1, fullActivePermutation τ s.2) = cleanMixedSourceGate s := by simp only [cleanMixedSourceGate, clean_mixed_big_active_injective_permutation] theorem clean_mixed_target_gate_big_permutation (Fs : ∀ s, Finset (Ps s)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B)) (τ : FullActiveSlotPermutations M) : cleanMixedTargetGate Fs (s.1, fullActivePermutation τ s.2) = cleanMixedTargetGate Fs s := by simp only [cleanMixedTargetGate, clean_mixed_big_active_injective_permutation] end end Bounty end section open MeasureTheory open scoped FourierTransform namespace Bounty noncomputable def localMellinTransform (h : ℝ) (g : ℝ → ℂ) (u : ℝ) : ℂ := (Real.exp (-u) : ℂ) * ∫ t : ℝ, Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * 𝓕 localMellinKernelSchwartz (Real.exp (-u)*(h*t)/(2*Real.pi)) * g t theorem local_mellin_amplitude_joint_continuous (j : ℕ) : Continuous (Function.uncurry (localMellinAmplitude j)) := by have hr := (typeII_smooth_rho_contDiff 2).continuous have hK := (𝓕 localMellinKernelSchwartz).continuous have hw : Continuous (fun p : ℝ × ℝ => (1+p.1^2)^((j:ℝ)/4)) := (by fun_prop : Continuous (fun p : ℝ × ℝ => 1+p.1^2)).rpow_const (fun p => Or.inl (by positivity)) unfold localMellinAmplitude Function.uncurry fun_prop theorem local_mellin_amplitude_weight_cancel (j : ℕ) (h t u : ℝ) : localMellinAmplitude (4*j) (h*t) u * (mellinDecayWeight j h t : ℂ) = ((typeIISmoothRho 2 u * Real.exp (-u) : ℝ) : ℂ) * 𝓕 localMellinKernelSchwartz (Real.exp (-u)*(h*t)/(2*Real.pi)) := by have he : (((4*j:ℕ):ℝ)/4) = (j:ℝ) := by push_cast; ring simp only [localMellinAmplitude, he, Real.rpow_natCast, mellinDecayWeight, Complex.ofReal_inv] rw [mul_assoc, mul_inv_cancel₀ (by exact_mod_cast (ne_of_gt (pow_pos (by positivity : 0 < 1+(h*t)^2) j))), mul_one] theorem local_mellin_transform_weighted_representation (j : ℕ) (h : ℝ) (g : ℝ → ℂ) (u : ℝ) : (typeIISmoothRho 2 u : ℂ) * localMellinTransform h g u = ∫ t : ℝ, Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * localMellinAmplitude (4*j) (h*t) u * ((mellinDecayWeight j h t : ℂ) * g t) := by unfold localMellinTransform rw [← integral_const_mul, ← integral_const_mul] apply integral_congr_ae filter_upwards [] with t have hc := local_mellin_amplitude_weight_cancel j h t u rw [Complex.ofReal_mul] at hc linear_combination -Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * g t * hc theorem local_mellin_rho_one_on_log_dyad {u : ℝ} (hu : u ∈ Set.Icc (Real.log (1/2:ℝ)) (Real.log 3)) : typeIISmoothRho 2 u = 1 := by apply typeII_smooth_rho_eq_one have h2 := Real.log_le_sub_one_of_pos (by norm_num : (0:ℝ) < 2) have h3 := Real.log_le_sub_one_of_pos (by norm_num : (0:ℝ) < 3) have hh : Real.log (1/2:ℝ) = -Real.log 2 := by rw [one_div, Real.log_inv] constructor <;> linarith [hu.1, hu.2] end Bounty end section /- On original paths with injective initial active labels, every compatible selected child is owned by a later event. -/ namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) theorem full_mixed_common_initial_label_injOn (hx : FullActiveInjective x) : Set.InjOn (fun i => fullMixedCommonBirthLabel n S B A Δ D steps x p (fullMixedCommonBirthOrder M B steps i)) {i | fullMixedCommonIndexStage M B steps i = 0} := by intro i hi j hj he obtain ⟨a, ha⟩ := (full_mixed_common_index_stage_zero_iff M B steps i).mp hi obtain ⟨b, hb⟩ := (full_mixed_common_index_stage_zero_iff M B steps j).mp hj dsimp only at he rw [ha, hb, full_mixed_common_initial_label, full_mixed_common_initial_label] at he have hab := full_mixed_common_initial_injective x hx (Option.some.inj he) apply (fullMixedCommonBirthOrder M B steps).injective rw [ha, hb, hab] theorem full_mixed_common_compatible_initial_child_none (hx : FullActiveInjective x) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (hcompat : birthForestCompatible (fun i => fullMixedCommonBirthPerformed n S B A Δ D steps x p (fullMixedCommonBirthOrder M B steps i)) (fun i => fullMixedCommonBirthLabel n S B A Δ D steps x p (fullMixedCommonBirthOrder M B steps i)) code) : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none := by apply birth_forest_no_child_in_injective_prefix code _ _ _ _ (full_mixed_common_initial_label_injOn n S B A Δ D steps x p hx) hcompat intro i j hij hj have h := full_mixed_common_index_stage_monotone M B steps hij.le rw [hj] at h exact le_antisymm h (Fin.zero_le _) end Full end Bounty end section /- Absolute-frequency and large-frequency bounds in the direct exponential convention. -/ open Finset namespace Bounty theorem logarithmic_unit_phase_eq (t x : ℝ) : realUnitPhase ((t/(2*Real.pi))*Real.log x) = Complex.exp (((t*Real.log x : ℝ) : ℂ)*Complex.I) := by unfold realUnitPhase congr 2 field_simp theorem logarithmic_second_derivative_positive (t U : ℝ) {a b : ℕ} (ht : 0 < t) (hU : 1 ≤ U) (hab : a ≤ b) (ha : U ≤ (a : ℝ)) (hb : (b : ℝ) ≤ 2*U) : ‖∑ n ∈ Icc a b, Complex.exp (((t*Real.log (n : ℝ) : ℝ) : ℂ)*Complex.I)‖ ≤ 108*(Real.sqrt t+U/Real.sqrt t) := by let c := t/(2*Real.pi) have hc : 0 < c := by dsimp [c]; positivity have hct : c ≤ t := div_le_self ht.le (by linarith [Real.pi_gt_three]) have hsct := Real.sqrt_le_sqrt hct have hsc : 0 < Real.sqrt c := Real.sqrt_pos.mpr hc have hst : 0 < Real.sqrt t := Real.sqrt_pos.mpr ht have heq : 2*Real.pi*c = t := by dsimp [c]; field_simp have ht9 : t ≤ 9*c := by have := mul_le_mul_of_nonneg_right (show 2*Real.pi ≤ 9 by linarith [Real.pi_lt_four]) hc.le nlinarith have hroot : Real.sqrt t ≤ 3*Real.sqrt c := by nlinarith [Real.sq_sqrt ht.le,Real.sq_sqrt hc.le] have hquot : U/Real.sqrt c ≤ 3*(U/Real.sqrt t) := by rw [← mul_div_assoc] apply (div_le_div_iff₀ hsc hst).mpr have := mul_le_mul_of_nonneg_left hroot (show 0 ≤ U by linarith) nlinarith have h := positive_logarithmic_second_derivative c U hc hU hab ha hb change ‖∑ n ∈ Icc a b, realUnitPhase ((t/(2*Real.pi))*Real.log n)‖ ≤ _ at h simp_rw [logarithmic_unit_phase_eq] at h have hq0 : 0 ≤ U/Real.sqrt t := by positivity nlinarith theorem norm_logarithmic_phase_neg (S : Finset ℕ) (t : ℝ) : ‖∑ n ∈ S, Complex.exp ((((-t)*Real.log (n : ℝ) : ℝ) : ℂ)*Complex.I)‖ = ‖∑ n ∈ S, Complex.exp (((t*Real.log (n : ℝ) : ℝ) : ℂ)*Complex.I)‖ := by have hn (n : ℕ) : ((-t)/(2*Real.pi))*Real.log n = -((t/(2*Real.pi))*Real.log n) := by ring simp_rw [← logarithmic_unit_phase_eq,hn] exact norm_sum_real_unit_phase_neg S (fun n => (t/(2*Real.pi))*Real.log n) theorem logarithmic_second_derivative_bound (t U : ℝ) {a b : ℕ} (ht : t ≠ 0) (hU : 1 ≤ U) (hab : a ≤ b) (ha : U ≤ (a : ℝ)) (hb : (b : ℝ) ≤ 2*U) : ‖∑ n ∈ Icc a b, Complex.exp (((t*Real.log (n : ℝ) : ℝ) : ℂ)*Complex.I)‖ ≤ 108*(Real.sqrt |t|+U/Real.sqrt |t|) := by rcases lt_or_gt_of_ne ht with hneg | hpos · have h := logarithmic_second_derivative_positive (-t) U (by linarith) hU hab ha hb rw [norm_logarithmic_phase_neg] at h simpa only [abs_of_neg hneg] using h · simpa only [abs_of_pos hpos] using logarithmic_second_derivative_positive t U hpos hU hab ha hb theorem logarithmic_second_derivative_large (t U Y : ℝ) {a b : ℕ} (hU : 1 ≤ U) (hab : a ≤ b) (ha : U ≤ (a : ℝ)) (hb : (b : ℝ) ≤ 2*U) (hUt : U ≤ |t|) (htY : |t| ≤ Y) : ‖∑ n ∈ Icc a b, Complex.exp (((t*Real.log (n : ℝ) : ℝ) : ℂ)*Complex.I)‖ ≤ 216*Real.sqrt Y := by have htpos : 0 < |t| := by linarith have hs : 0 < Real.sqrt |t| := Real.sqrt_pos.mpr htpos have hquot : U/Real.sqrt |t| ≤ Real.sqrt |t| := by apply (div_le_iff₀ hs).mpr nlinarith [Real.sq_sqrt htpos.le] have h := logarithmic_second_derivative_bound t U (abs_pos.mp htpos) hU hab ha hb have hsY := Real.sqrt_le_sqrt htY nlinarith end Bounty end section /- Quantitative cancellation of a logarithmic phase below its first aliasing frequency. -/ open Finset namespace Bounty theorem logarithmic_first_derivative_positive (a b : ℤ) (V t : ℝ) (ha : 0 < (a : ℝ)) (haV : (a : ℝ) ≤ V) (hbV : (b : ℝ)+1 ≤ V) (ht : 0 < t) (htmax : t ≤ Real.pi*(a : ℝ)) : ‖∑ n ∈ Icc a b, Complex.exp ((t*Real.log (n : ℝ) : ℝ)*Complex.I)‖ ≤ 4*Real.pi*V/t := by let c := t/(2*Real.pi) let δ := c/V have hV : 0 < V := ha.trans_le haV have hc : 0 < c := div_pos ht (by positivity) have hcmax : c ≤ (a : ℝ)/2 := by dsimp [c] apply (div_le_iff₀ (by positivity : 0 < 2*Real.pi)).mpr nlinarith have hd : 0 < δ := div_pos hc hV have hdhalf : δ ≤ 1/2 := (div_le_iff₀ hV).mpr (by linarith) have hf (x : ℝ) (hx : x ∈ Set.Icc (a : ℝ) ((b : ℝ)+1)) : HasDerivAt (fun x => c*Real.log x) (c/x) x := by have hxp : 0 < x := ha.trans_le hx.1 simpa only [div_eq_mul_inv] using (Real.hasDerivAt_log hxp.ne').const_mul c have hbound (x : ℝ) (hx : x ∈ Set.Icc (a : ℝ) ((b : ℝ)+1)) : (0 : ℝ)+δ ≤ c/x ∧ c/x ≤ (0 : ℝ)+1-δ := by have hxp : 0 < x := ha.trans_le hx.1 constructor · simpa only [zero_add] using div_le_div_of_nonneg_left hc.le hxp (hx.2.trans hbV) · have hcx : c/x ≤ 1/2 := (div_le_iff₀ hxp).mpr (by linarith [hx.1]) linarith have hm : AntitoneOn (fun x : ℝ => c/x) (Set.Icc (a : ℝ) ((b : ℝ)+1)) := by intro x hx y hy hxy exact div_le_div_of_nonneg_left hc.le (ha.trans_le hx.1) hxy have hh := first_derivative_test (fun x => c*Real.log x) (fun x => c/x) a b 0 hd hdhalf hf (by simpa only [Int.cast_zero] using hbound) (Or.inr hm) have he (n : ℤ) : realUnitPhase (c*Real.log (n : ℝ)) = Complex.exp ((t*Real.log (n : ℝ) : ℝ)*Complex.I) := by unfold realUnitPhase congr 2 dsimp [c] field_simp simp_rw [he] at hh calc _ ≤ 2/δ := hh _ = 4*Real.pi*V/t := by dsimp [δ,c]; field_simp <;> ring end Bounty end section /- Explicit counts for all unit intervals meeting the actual exceptional prime-polynomial set. The coefficient, sampling, and mean-square bounds are proved upstream; no exceptional-count or operator-bound premise remains. -/ open Finset open scoped Classical namespace Bounty theorem prime_exceptional_intervals_count_bound (s : Finset ℕ) (hs : ∀ p ∈ s, Nat.Prime p) (P Y R η : ℝ) (b : s → ℂ) (hP : 1 ≤ P) (hY : 1 ≤ Y) (hR : 0 ≤ R) (hRY : R ≤ Y) (hη : 0 < η) (hband : ∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) (hb : ∀ p : s, ‖b p‖ ≤ 1) : ((primeExceptionalIntervals s b η R).card : ℝ) ≤ 512 * Y * (1 + Real.log Y) ^ 2 * (primeMomentDegree Y P).factorial * ((2 / P) / η ^ 2) ^ primeMomentDegree Y P := by let j := primeMomentDegree Y P have hN : 1 ≤ ⌈Y⌉₊ := by have : (1 : ℝ) ≤ (⌈Y⌉₊ : ℝ) := hY.trans (Nat.le_ceil Y) exact_mod_cast this have hPN : (2 * P) ^ j ≤ (⌈Y⌉₊ : ℝ) := (prime_moment_degree_power_bounds hY (by linarith)).1.trans (Nat.le_ceil Y) have hm := prime_exceptional_intervals_moment_bound s hs P 1 b hP zero_le_one hband hb j ⌈Y⌉₊ hN hPN η R hη norm_num only [one_pow, mul_one] at hm have hv := prime_moment_sampling_overhead_le Y R hY hR hRY have hz : 0 ≤ (j.factorial : ℝ) * (2 / P) ^ j := by have : 0 ≤ P := zero_le_one.trans hP positivity have hm' : ((primeExceptionalIntervals s b η R).card : ℝ) * (η ^ j) ^ 2 ≤ (3 * (1 + 2 * (1 + Real.log (⌈Y⌉₊ : ℝ))) * ((2 * (⌈R⌉₊ : ℝ) + 3) + 4 * (⌈Y⌉₊ : ℝ) * (1 + Real.log (⌈Y⌉₊ : ℝ)))) * ((j.factorial : ℝ) * (2 / P) ^ j) := by convert hm using 1 ring have hnum := hm'.trans (mul_le_mul_of_nonneg_right hv hz) have hnum' : ((primeExceptionalIntervals s b η R).card : ℝ) * (η ^ j) ^ 2 ≤ (512 * Y * (1 + Real.log Y) ^ 2 * (j.factorial : ℝ)) * (2 / P) ^ j := hnum.trans_eq (by ring) exact prime_moment_remove_threshold j hη hnum' theorem prime_exceptional_intervals_rpow_count_bound (s : Finset ℕ) (hs : ∀ p ∈ s, Nat.Prime p) (P Y R L A : ℝ) (b : s → ℂ) (hP : 1 ≤ P) (hY : 1 ≤ Y) (hR : 0 ≤ R) (hRY : R ≤ Y) (hL : 0 < L) (hband : ∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) (hb : ∀ p : s, ‖b p‖ ≤ 1) : ((primeExceptionalIntervals s b (L ^ (-A)) R).card : ℝ) ≤ 512 * Y * (1 + Real.log Y) ^ 2 * (primeMomentDegree Y P).factorial * (2 * L ^ (2 * A) / P) ^ primeMomentDegree Y P := by have h := prime_exceptional_intervals_count_bound s hs P Y R (L ^ (-A)) b hP hY hR hRY (Real.rpow_pos_of_pos hL _) hband hb rwa [prime_moment_rpow_threshold_ratio P A hL] at h theorem prime_exceptional_intervals_subexponential_bound (s : Finset ℕ) (hs : ∀ p ∈ s, Nat.Prime p) (coeff : s → ℂ) {a beta c A L Y P R : ℝ} (ha0 : 0 ≤ a) (ha1 : a ≤ 1) (hc : 0 ≤ c) (hA : 0 ≤ A) (hL : Real.exp 1 ≤ L) (hY : 1 ≤ Y) (hlogY : Real.log Y ≤ c * L) (hPlo : Real.exp (L ^ a) / 2 ≤ P) (hPhi : P ≤ Real.exp (L ^ beta)) (hR : 0 ≤ R) (hRY : R ≤ Y) (hband : ∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) (hcoeff : ∀ p : s, ‖coeff p‖ ≤ 1) : ((primeExceptionalIntervals s coeff (L ^ (-A)) R).card : ℝ) ≤ Real.exp (primeMomentActualExponent c A * (L ^ beta + L ^ (1 - a) * Real.log L)) := by have hL0 : 0 < L := (Real.exp_pos 1).trans_le hL have hL1 : 1 ≤ L := (Real.one_le_exp (by norm_num : (0 : ℝ) ≤ 1)).trans hL have hLa : 1 ≤ L ^ a := Real.one_le_rpow hL1 ha0 have hE : 2 ≤ Real.exp (L ^ a) := by have htwo : (2 : ℝ) ≤ Real.exp 1 := by linarith [Real.add_one_le_exp (1 : ℝ)] exact htwo.trans (Real.exp_le_exp.mpr hLa) have hP : 1 ≤ P := by linarith have hcount := prime_exceptional_intervals_rpow_count_bound s hs P Y R L A coeff hP hY hR hRY hL0 hband hcoeff exact prime_moment_actual_budget_le_exp ha0 ha1 hc hA hL hY hlogY hPlo hPhi hcount end Bounty end section /- First derivative cancellation for the actual logarithmic phase on an arithmetic progression. -/ open Finset namespace Bounty section variable (A B : ℤ) (q a N C t : ℝ) (hq : 0 < q) (hN : 0 < N) (hC : 1 ≤ C) (hlo : q*N ≤ q*(A : ℝ)+a) (hhi : q*((B : ℝ)+1)+a ≤ C*q*N) include A B q a N C t hq hN hC hlo hhi theorem affine_logarithmic_first_positive (ht : 0 < t) (htmax : t ≤ Real.pi*N) : ‖∑ y ∈ Icc A B, Complex.exp (((t*Real.log (q*(y : ℝ)+a) : ℝ) : ℂ)*Complex.I)‖ ≤ 4*Real.pi*C*N/t := by let c := t/(2*Real.pi) let δ := c/(C*N) have hc : 0 < c := by dsimp [c]; positivity have hC0 : 0 < C := by linarith have hcmax : c ≤ N/2 := by dsimp [c] apply (div_le_iff₀ (by positivity : 0 < 2*Real.pi)).mpr nlinarith have hδ : 0 < δ := by dsimp [δ]; positivity have hδhalf : δ ≤ 1/2 := by dsimp [δ] apply (div_le_iff₀ (mul_pos hC0 hN)).mpr nlinarith [mul_le_mul_of_nonneg_right hC hN.le] have hscale (x : ℝ) (hx : x ∈ Set.Icc (A : ℝ) ((B : ℝ)+1)) : q*N ≤ q*x+a ∧ q*x+a ≤ C*q*N := by have h1 := mul_le_mul_of_nonneg_left hx.1 hq.le have h2 := mul_le_mul_of_nonneg_left hx.2 hq.le constructor <;> linarith have hf (x : ℝ) (hx : x ∈ Set.Icc (A : ℝ) ((B : ℝ)+1)) : HasDerivAt (fun x => c*Real.log (q*x+a)) (c*q/(q*x+a)) x := by have hpos : 0 < q*x+a := (mul_pos hq hN).trans_le (hscale x hx).1 have hlin : HasDerivAt (fun x => q*x+a) q x := by simpa only [mul_one,id_eq] using ((hasDerivAt_id x).const_mul q).add_const a have hd := (hlin.log hpos.ne').const_mul c have heq : c*(q/(q*x+a)) = c*q/(q*x+a) := by ring rw [heq] at hd exact hd have hband (x : ℝ) (hx : x ∈ Set.Icc (A : ℝ) ((B : ℝ)+1)) : (0 : ℝ)+δ ≤ c*q/(q*x+a) ∧ c*q/(q*x+a) ≤ (0 : ℝ)+1-δ := by have hpos : 0 < q*x+a := (mul_pos hq hN).trans_le (hscale x hx).1 constructor · simp only [zero_add] apply (le_div_iff₀ hpos).mpr have hs := mul_le_mul_of_nonneg_left (hscale x hx).2 hδ.le have heq : δ*(C*q*N)=c*q := by dsimp [δ]; field_simp <;> ring exact hs.trans_eq heq · have hd : c*q/(q*x+a) ≤ 1/2 := by apply (div_le_iff₀ hpos).mpr nlinarith [(hscale x hx).1,mul_le_mul_of_nonneg_right hcmax hq.le] linarith have hm : AntitoneOn (fun x => c*q/(q*x+a)) (Set.Icc (A : ℝ) ((B : ℝ)+1)) := by intro x hx y hy hxy have hpos : 0 < q*x+a := (mul_pos hq hN).trans_le (hscale x hx).1 exact div_le_div_of_nonneg_left (mul_nonneg hc.le hq.le) hpos (add_le_add (mul_le_mul_of_nonneg_left hxy hq.le) le_rfl) have h := first_derivative_test (fun x => c*Real.log (q*x+a)) (fun x => c*q/(q*x+a)) A B 0 hδ hδhalf hf (by simpa only [Int.cast_zero] using hband) (Or.inr hm) have he (y : ℤ) : realUnitPhase (c*Real.log (q*(y : ℝ)+a)) = Complex.exp (((t*Real.log (q*(y : ℝ)+a) : ℝ) : ℂ)*Complex.I) := by unfold realUnitPhase congr 2 dsimp [c] field_simp simp_rw [he] at h calc _ ≤ 2/δ := h _ = _ := by dsimp [δ,c]; field_simp <;> ring theorem affine_logarithmic_first_bound (ht : t ≠ 0) (htmax : |t| ≤ Real.pi*N) : ‖∑ y ∈ Icc A B, Complex.exp (((t*Real.log (q*(y : ℝ)+a) : ℝ) : ℂ)*Complex.I)‖ ≤ 4*Real.pi*C*N/|t| := by rcases lt_or_gt_of_ne ht with hneg | hpos · have h := affine_logarithmic_first_positive A B q a N C (-t) hq hN hC hlo hhi (by linarith) (by simpa only [abs_of_neg hneg] using htmax) simp only [neg_mul] at h rw [norm_sum_exp_phase_neg] at h simpa only [abs_of_neg hneg] using h · exact (affine_logarithmic_first_positive A B q a N C t hq hN hC hlo hhi hpos (by simpa only [abs_of_pos hpos] using htmax)).trans_eq (by rw [abs_of_pos hpos]) end end Bounty end section open Finset namespace Bounty theorem real_unit_phase_mixed_div_two_pi (hs : List ℝ) (f : ℝ → ℝ) (x : ℝ) : realUnitPhase (mixedForwardDifference hs (fun y => f y / (2*Real.pi)) x) = Complex.exp ((mixedForwardDifference hs f x : ℂ)*Complex.I) := by have hf : (fun y => f y / (2*Real.pi)) = (fun y => (2*Real.pi)⁻¹ * f y) := by funext y; ring rw [hf, mixed_forward_difference_const_mul] unfold realUnitPhase congr 1 push_cast field_simp <;> ring end Bounty end section /- Positive damping gives an explicit, bounded loss for the retained overlap branch. -/ open Finset open scoped Classical namespace Bounty theorem physical_shared_primes_card {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) : (physicalSharedPrimes C L).card = ∑ g : G, (J - (C g).card) := by rw [physicalSharedPrimes, card_map] have he : (univ.filter (fun a : Σ _g : G, PhysicalSlots J ell => a.2 ∈ physicalSharedSlots (C a.1))) = univ.sigma (fun g => physicalSharedSlots (C g)) := by ext a simp only [mem_filter, mem_univ, true_and, mem_sigma] rw [he, card_sigma] simp only [physical_shared_slots_card] theorem physical_shared_overlap_count {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ℝ) (w : ℤ) : physicalSharedOverlap C L q w = q ^ ((physicalSharedPrimes C L).filter (fun p => (p.2.val : ℤ) ∣ w)).card := by simp only [physicalSharedOverlap, prod_ite, prod_const, one_pow, mul_one] theorem physical_shared_overlap_lower {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (w : ℤ) : q ^ (∑ g : G, (J - (C g).card)) ≤ physicalSharedOverlap C L q w := by rw [physical_shared_overlap_count, ← physical_shared_primes_card C L] exact pow_le_pow_of_le_one hq0 hq1 (card_filter_le _ _) theorem physical_shared_vertex_pair_overlap_bound {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (hshared : physicalSharedCompatible C L R) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) {q : ℝ} (hq0 : 0 < q) (hq1 : q ≤ 1) (w z : ℤ) : physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * w) * physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * z) ≤ (physicalUnsharedVertex C L q w * physicalUnsharedVertex C R q z) / q ^ (2 * ∑ g : G, (J - (C g).card)) := by have hn (T : PhysicalMarkLists P J ell) (n : ℤ) : 0 ≤ physicalVertexWeight T q n := by unfold physicalVertexWeight split_ifs · exact prod_nonneg (fun g _ => pow_nonneg hq0.le _) · exact le_rfl have ho : q ^ (2 * ∑ g : G, (J - (C g).card)) ≤ physicalSharedOverlap C L q w * physicalSharedOverlap C L q z := by rw [two_mul, pow_add] exact mul_le_mul (physical_shared_overlap_lower C L hq0.le hq1 w) (physical_shared_overlap_lower C L hq0.le hq1 z) (pow_nonneg hq0.le _) ((pow_nonneg hq0.le _).trans (physical_shared_overlap_lower C L hq0.le hq1 w)) apply (le_div_iff₀ (pow_pos hq0 _)).mpr calc _ ≤ (physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * w) * physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * z)) * (physicalSharedOverlap C L q w * physicalSharedOverlap C L q z) := mul_le_mul_of_nonneg_left ho (mul_nonneg (hn L _) (hn R _)) _ = _ := physical_shared_vertex_pair_removal C L R hshared hprime hdis q w z end Bounty end section /- The residual weight retains an arbitrary bounded cutoff on the complete pool part. -/ open Finset namespace Bounty noncomputable def selectedMarkedWeight {G : Type*} [Fintype G] (P : G → Finset ℕ) (Q : Finset ℕ) (q : ℝ) (V : G → ℝ) (t u : G → ℕ) (big : Finset G) (b : GroupMarkedLists (fun g : big => P g.val) (fun g : big => u g.val) → ℂ) (κ : ℕ → ℂ) (n : ℕ) : ℂ := κ (primePoolPart Q n) * (markedDivisorWeight univ P q V t (n : ℤ) : ℂ) * groupMarkedAverage (fun g : big => P g.val) (fun g : big => u g.val) (n : ℤ) b theorem selected_marked_weight_mul_free {G : Type*} [Fintype G] (P : G → Finset ℕ) (Q : Finset ℕ) (q : ℝ) (V : G → ℝ) (t u : G → ℕ) (big : Finset G) (b : GroupMarkedLists (fun g : big => P g.val) (fun g : big => u g.val) → ℂ) (κ : ℕ → ℂ) (hP : ∀ g, ∀ p ∈ P g, p.Prime) (hPQ : ∀ g, P g ⊆ Q) (a d : ℕ) (hd : d ≠ 0) (hfree : Disjoint d.primeFactors Q) : selectedMarkedWeight P Q q V t u big b κ (a * d) = selectedMarkedWeight P Q q V t u big b κ a := by unfold selectedMarkedWeight rw [primePoolPart_mul_pool_free Q a d hd hfree, marked_divisor_weight_mul_free univ P Q q V t (fun g _ => hP g) (fun g _ => hPQ g) a d hd hfree, group_marked_average_mul_free (fun g : big => P g.val) Q (fun g : big => u g.val) (fun g => hP g.val) (fun g => hPQ g.val) a d hd hfree b] end Bounty end section /- A cutoff on the complete pool part couples the extracted prime to the residual pool part. -/ open Finset namespace Bounty end Bounty end section /- Absolute coefficient energy for the collapsed four-factor polynomial. -/ open Finset namespace Bounty theorem endpoint_four_convolution_square_sum (δ α β γ : ℕ → ℂ) {D A B C : ℝ} (hD : 0 ≤ D) (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hδ : ∀ d, ‖δ d‖ ≤ D) (hα : ∀ d, ‖α d‖ ≤ A) (hβ : ∀ d, ‖β d‖ ≤ B) (hγ : ∀ d, ‖γ d‖ ≤ C) (S : Finset ℕ) (N : ℕ) (hS : ∀ n ∈ S, 0 < n ∧ n ≤ N) : (∑ n ∈ S, ‖endpointFourConvolution δ α β γ n‖ ^ 2) ≤ (D * A * B * C) ^ 2 * ((N : ℝ) * (1 + Real.log N) ^ 15) := by have hsub : S ⊆ Ioc 0 N := fun n hn => mem_Ioc.mpr (hS n hn) calc _ ≤ ∑ n ∈ S, (D * A * B * C) ^ 2 * (((ArithmeticFunction.zeta ^ 4) n : ℕ) : ℝ) ^ 2 := by apply sum_le_sum intro n _ simpa only [mul_pow] using pow_le_pow_left₀ (norm_nonneg _) (endpoint_four_convolution_zeta_bound δ α β γ hD hA hB hC hδ hα hβ hγ n) 2 _ = (D * A * B * C) ^ 2 * ∑ n ∈ S, (((ArithmeticFunction.zeta ^ 4) n : ℕ) : ℝ) ^ 2 := by rw [mul_sum] _ ≤ (D * A * B * C) ^ 2 * ∑ n ∈ Ioc 0 N, (((ArithmeticFunction.zeta ^ 4) n : ℕ) : ℝ) ^ 2 := mul_le_mul_of_nonneg_left (sum_le_sum_of_subset_of_nonneg hsub (by intros; positivity)) (sq_nonneg _) _ ≤ _ := mul_le_mul_of_nonneg_left (zeta_four_square_summatory N) (sq_nonneg _) theorem endpoint_four_convolution_reciprocal_energy (δ α β γ : ℕ → ℂ) {D A B C U : ℝ} (hD : 0 ≤ D) (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hU : 0 < U) (hδ : ∀ d, ‖δ d‖ ≤ D) (hα : ∀ d, ‖α d‖ ≤ A) (hβ : ∀ d, ‖β d‖ ≤ B) (hγ : ∀ d, ‖γ d‖ ≤ C) (S : Finset ℕ) (N : ℕ) (hS : ∀ n ∈ S, 0 < n ∧ n ≤ N) (hUS : ∀ n ∈ S, U ≤ (n : ℝ)) : (∑ n ∈ S, ‖endpointFourConvolution δ α β γ n / (n : ℂ)‖ ^ 2) ≤ (D * A * B * C) ^ 2 * ((N : ℝ) * (1 + Real.log N) ^ 15) / U ^ 2 := by calc _ ≤ ∑ n ∈ S, ‖endpointFourConvolution δ α β γ n‖ ^ 2 / U ^ 2 := by apply sum_le_sum intro n hn rw [norm_div, Complex.norm_natCast, div_pow] exact div_le_div_of_nonneg_left (sq_nonneg _) (sq_pos_of_pos hU) (pow_le_pow_left₀ hU.le (hUS n hn) 2) _ = (∑ n ∈ S, ‖endpointFourConvolution δ α β γ n‖ ^ 2) / U ^ 2 := by rw [sum_div] _ ≤ _ := div_le_div_of_nonneg_right (endpoint_four_convolution_square_sum δ α β γ hD hA hB hC hδ hα hβ hγ S N hS) (sq_nonneg U) end Bounty end section /- A product of actual finite Mellin factors has a literal dyadic coefficient representation. -/ open Finset namespace Bounty end Bounty end section /- Exact dyadic representations of the ordinary and sparse mean-square subproducts. -/ open Finset namespace Bounty theorem divisor_pair_dyadic_representation (S A B : Finset ℕ) (α β : ℕ → ℂ) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (hS : ∀ a ∈ A, ∀ b ∈ B, a*b ∈ S) (U : ℝ) (hU : 0 ≤ U) (K : ℕ) (hsize : ∀ a ∈ A, ∀ b ∈ B, U < (a*b : ℕ) ∧ (a*b : ℕ) ≤ (2 : ℝ)^K*U) (t : ℝ) : (∑ a ∈ A, α a*harmonicMellinWeight t a)*(∑ b ∈ B, β b*harmonicMellinWeight t b) = ∑ j : Fin K, ∑ n ∈ Icc (⌊(2 : ℝ)^j.val*U⌋₊+1) ⌊(2 : ℝ)^(j.val+1)*U⌋₊, (if n ∈ S then (∑ d ∈ n.divisors, α d*β (n/d))/(n : ℂ) else 0)* Complex.exp (((Real.log (n : ℝ)*t : ℝ) : ℂ)*Complex.I) := by rw [← divisor_pair_finite_mellin S A B α β hA hB hα hβ hS] apply finite_mellin_dyadic_representation S _ U hU K intro n hn hne obtain ⟨a,b,ha,hb,han,hbn,he⟩ := divisor_pair_nonzero_factors α β hne have haA : a ∈ A := by by_contra hz; exact han (hα a hz) have hbB : b ∈ B := by by_contra hz; exact hbn (hβ b hz) simpa only [he] using hsize a haA b hbB theorem endpoint_triple_dyadic_representation (S A B C : Finset ℕ) (α β γ : ℕ → ℂ) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (hγ : ∀ c, c ∉ C → γ c = 0) (hS : ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, a*b*c ∈ S) (U : ℝ) (hU : 0 ≤ U) (K : ℕ) (hsize : ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, U < (a*b*c : ℕ) ∧ (a*b*c : ℕ) ≤ (2 : ℝ)^K*U) (t : ℝ) : (∑ a ∈ A, α a*harmonicMellinWeight t a)* (∑ b ∈ B, β b*harmonicMellinWeight t b)*(∑ c ∈ C, γ c*harmonicMellinWeight t c) = ∑ j : Fin K, ∑ n ∈ Icc (⌊(2 : ℝ)^j.val*U⌋₊+1) ⌊(2 : ℝ)^(j.val+1)*U⌋₊, (if n ∈ S then endpointTripleConvolution α β γ n/(n : ℂ) else 0)* Complex.exp (((Real.log (n : ℝ)*t : ℝ) : ℂ)*Complex.I) := by rw [← endpoint_triple_finite_mellin S A B C α β γ hA hB hC hα hβ hγ hS] apply finite_mellin_dyadic_representation S _ U hU K intro n hn hne obtain ⟨a,b,c,ha,hb,hc,han,hbn,hcn,he⟩ := endpoint_triple_nonzero_factors α β γ hne have haA : a ∈ A := by by_contra hz; exact han (hα a hz) have hbB : b ∈ B := by by_contra hz; exact hbn (hβ b hz) have hcC : c ∈ C := by by_contra hz; exact hcn (hγ c hz) simpa only [he] using hsize a haA b hbB c hcC end Bounty end section /- Actual divisor convolutions satisfy the global T-factor norm budget. -/ open Finset Filter namespace Bounty end Bounty end section /- Actual common event labels decoded from fresh draws and ordered ghost births. Complement slots embed into their original full target slots. -/ open Finset Classical namespace Bounty section Edge variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (k : K) noncomputable def commonForestEdgeLabels (draw : ∀ g, EdgeDrawObservation (P g) (S k g)ᶜ.card) : FullMixedCommonLocalAddress M B (some (Sum.inr (α := J) k)) → Option ((g : Fin N) × P g) := optionalBirthExtension (fullMixedCommonLocalEmbedding S B (some (.inr k))) (fun ⟨g, i⟩ => if h : i ∈ (draw g).2.1 then none else some ⟨g, (draw g).2.2 ⟨i, h⟩⟩) theorem full_mixed_common_edge_labels_eq_observation (n : (g : Fin N) → P g → ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent (J := J) n S B A Δ D (some (.inr k)) s) : fullMixedCommonEventBirthLabel n S B A Δ D (some (.inr k)) s e = commonForestEdgeLabels S B k (fun g => ⟨(e.2 g).1, (e.2 g).2.1, (e.2 g).2.2.2⟩) := by funext a rw [full_mixed_common_event_label_extension] apply congrArg (fun f => optionalBirthExtension (fullMixedCommonLocalEmbedding S B (some (.inr k))) f a) funext b obtain ⟨g, i⟩ := b simp only [fullMixedEventBirthLabel, fullMixedEventBornData] split_ifs <;> rfl end Edge section Ghost variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (j : J) noncomputable def commonForestGhostLabels (born : ∀ g, Σ b : Fin (B + 1), Fin b.val → P g) : FullMixedCommonLocalAddress M B (some (Sum.inl (β := K) j)) → Option ((g : Fin N) × P g) := fun ⟨g, i⟩ => if h : i.val < (born g).1.val then some ⟨g, (born g).2 ⟨i.val, h⟩⟩ else none theorem full_mixed_common_ghost_labels_eq_observation (n : (g : Fin N) → P g → ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s) : fullMixedCommonEventBirthLabel n S B A Δ D (some (.inl j)) s e = commonForestGhostLabels (M := M) B j (fun g => ⟨(e.down g).1, fun i => ((e.down g).2.2 i).1⟩) := by funext a have h := full_mixed_common_event_label_embed n S B A Δ D (some (.inl j)) s e a change fullMixedCommonEventBirthLabel n S B A Δ D (some (.inl j)) s e a = _ at h rw [h] obtain ⟨g, i⟩ := a simp only [fullMixedEventBirthLabel, fullMixedEventBornData, commonForestGhostLabels] split_ifs <;> rfl end Ghost end Bounty end section /- A nonzero original endpoint coefficient supplies the product scales used by the integral. -/ open Filter namespace Bounty end Bounty end section /- Glue the original lists from one shared embedding and its unshared completion. -/ open Finset open scoped Classical namespace Bounty abbrev PhysicalCutSharedEmbedding {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) := ∀ g, ↥(univ \ C g) ↪ ↥(P g) abbrev PhysicalCutCompletion {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) (s : PhysicalCutSharedEmbedding P C) := {u : GroupMarkedLists P (fun g => ell + (C g).card) // ∀ g, Disjoint (Set.range (s g)) (Set.range (u g))} noncomputable def physicalCutShared {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) : PhysicalCutSharedEmbedding P C := fun g => (physicalCutListEquiv P C ell L g).val.1 noncomputable def physicalCutCompletionOfList {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) : PhysicalCutCompletion P C ell (physicalCutShared C L) := ⟨fun g => (physicalCutListEquiv P C ell L g).val.2, fun g => (physicalCutListEquiv P C ell L g).property⟩ noncomputable def physicalCutGlue {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (s : PhysicalCutSharedEmbedding P C) (u : PhysicalCutCompletion P C ell s) : PhysicalMarkLists P J ell := (physicalCutListEquiv P C ell).symm (fun g => ⟨(s g,u.val g),u.property g⟩) section variable {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) include G P J ell C theorem physical_cut_glue_split (s : PhysicalCutSharedEmbedding P C) (u : PhysicalCutCompletion P C ell s) : physicalCutListEquiv P C ell (physicalCutGlue C s u) = fun g => ⟨(s g,u.val g),u.property g⟩ := (physicalCutListEquiv P C ell).apply_symm_apply _ theorem physical_cut_glue_shared (s : PhysicalCutSharedEmbedding P C) (u : PhysicalCutCompletion P C ell s) : physicalCutShared C (physicalCutGlue C s u) = s := by unfold physicalCutShared rw [physical_cut_glue_split] theorem physical_cut_glue_unshared (s : PhysicalCutSharedEmbedding P C) (u : PhysicalCutCompletion P C ell s) : (fun g => physicalGroupUnsharedEmbedding C (physicalCutGlue C s u) g) = u.val := by simp only [← physical_cut_list_unshared, physical_cut_glue_split] theorem physical_cut_glue_of_list (L : PhysicalMarkLists P J ell) : physicalCutGlue C (physicalCutShared C L) (physicalCutCompletionOfList C L) = L := by apply (physicalCutListEquiv P C ell).injective rw [physical_cut_glue_split] rfl theorem physical_cut_shared_compatible_iff (L R : PhysicalMarkLists P J ell) : physicalSharedCompatible C L R ↔ physicalCutShared C L = physicalCutShared C R := by constructor · intro h funext g apply Function.Embedding.ext intro j exact h g j.val (mem_sdiff.mp j.property).2 · intro h g j hj exact congrArg (fun s : PhysicalCutSharedEmbedding P C => s g ⟨j, mem_sdiff.mpr ⟨mem_univ _, hj⟩⟩) h end end Bounty end section /- The target needs only q=1/2 and arbitrarily large multiplicity. -/ open Finset Filter namespace Bounty theorem exists_centered_candidate_parameters_large {δ : ℝ} (hδ : 0 < δ) (rMin : ℕ) : ∃ c : ℝ, ∃ r : ℕ, 0 < c ∧ 0 < r ∧ rMin ≤ r ∧ (11 / 5 : ℝ) * (r : ℝ) * c = 1 ∧ (6 / 5 : ℝ) * c ≤ δ := by obtain ⟨r, hrlarge⟩ := exists_nat_gt (max ((rMin : ℝ) + 1) (1 / δ)) have hrbound : (rMin : ℝ) + 1 < (r : ℝ) := lt_of_le_of_lt (le_max_left _ _) hrlarge have hrone : (1 : ℝ) < (r : ℝ) := by linarith [Nat.cast_nonneg (α := ℝ) rMin] have hrmin : rMin ≤ r := by exact_mod_cast (show (rMin : ℝ) ≤ (r : ℝ) by linarith) have hrpos : (0 : ℝ) < (r : ℝ) := by linarith have hr : 0 < r := by exact_mod_cast hrpos have hdiv : 1 / δ < (r : ℝ) := lt_of_le_of_lt (le_max_right _ _) hrlarge have hmul : 1 < (r : ℝ) * δ := (div_lt_iff₀ hδ).mp hdiv let c : ℝ := 5 / (11 * (r : ℝ)) have hc : 0 < c := by dsimp [c]; positivity refine ⟨c, r, hc, hr, hrmin, ?_, ?_⟩ · dsimp [c] field_simp · have heq : (6 / 5 : ℝ) * c = 6 / (11 * (r : ℝ)) := by dsimp [c]; ring rw [heq] apply (div_le_iff₀ (by positivity : (0 : ℝ) < 11 * (r : ℝ))).mpr nlinarith theorem candidate_shifted_prime_mass_supply_of_half_positive_fraction (hfraction : ∀ (c : ℝ) (r : ℕ), 0 < c → 6 ≤ r → (11 / 5 : ℝ) * (r : ℝ) * c = 1 → ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∃ σ : ℝ, 0 < σ ∧ ∀ᶠ L : ℝ in atTop, σ * candidateCoefficientWindowMass c L (1/2) r jStar / L ≤ ∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => (2 * u + 1).Prime), candidateCoefficient c L (1/2) r jStar u) : CandidateShiftedPrimeMassSupply := by intro δ hδ hδsmall obtain ⟨c, r, hc, hr, hrlarge, hcenter, hsmall⟩ := exists_centered_candidate_parameters_large hδ 6 obtain ⟨C, hC, Jbase, hbase⟩ := exists_candidate_mass_fraction_polynomial_lower hc hr (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) < 1) hcenter obtain ⟨Jfrac, hfrac⟩ := hfraction c r hc hrlarge hcenter let jStar := max Jbase Jfrac + 1 have hjbase : Jbase < jStar := by dsimp [jStar]; omega have hjfrac : Jfrac < jStar := by dsimp [jStar]; omega obtain ⟨σ, hσ, hmass⟩ := hfrac jStar hjfrac have hpoly := hbase jStar hjbase σ hσ _ hmass refine ⟨c, 1/2, C, r, jStar, hc, hr, by norm_num, by norm_num, hsmall, ?_⟩ filter_upwards [hpoly] with L hL refine ⟨(arithmeticProductWindow 1 (Real.exp L)).filter (fun u => (2 * u + 1).Prime), filter_subset _ _, ?_, hL⟩ intro u hu exact (mem_filter.mp hu).2 end Bounty end section /- After the small selected data are fixed, the original fixed-edge big coefficient is independent of every other big edge and mark in the path. -/ open scoped Classical namespace Bounty theorem physical_selected_split_fixed_coefficient {I G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (small : G → Prop) (patterns : Finset I) (C : I → G → Finset (Fin J)) (pattern : Fin n → patterns) (ds : PhysicalGroupSelectedData (fun g : {g // small g} => P g.val) ell (fun j g => C (pattern j).val g.val)) (db : PhysicalGroupSelectedData (fun g : {g // ¬small g} => P g.val) ell (fun j g => C (pattern j).val g.val)) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (j : Fin n) (Lb Rb : PhysicalMarkLists (fun g : {g // ¬small g} => P g.val) J ell) (ab : PhysicalAuxLabels (fun g : {g // ¬small g} => P g.val) (fun g => C (pattern j).val g.val)) : let d := (physicalGroupSelectedSplit small (fun j => C (pattern j).val)).symm (ds, db) physicalFixedEdgeBigCoefficient small patterns C ζ K (d.2.2.1 j, d.2.2.2 j, ⟨pattern j, d.1 j⟩) (d.2.1 j.castSucc) (d.2.1 j.succ) (pattern j).val Lb Rb ab = physicalCoupledBigCoefficient small (C (pattern j).val) (ζ (pattern j).val) (K (pattern j).val) (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc)) (physicalPermuteLabels (ds.2.2.2 j) (ds.2.1 j.succ)) (ds.1 j) Lb Rb ab := by dsimp only let d := (physicalGroupSelectedSplit small (fun j => C (pattern j).val)).symm (ds, db) have hs := congrArg Prod.fst ((physicalGroupSelectedSplit small (fun j => C (pattern j).val)).apply_symm_apply (ds, db)) have hsl (i) : (fun g : {g // small g} => d.2.1 i g.val) = ds.2.1 i := congrArg (fun x => x.2.1 i) hs have hss : (fun g : {g // small g} => d.2.2.1 j g.val) = ds.2.2.1 j := congrArg (fun x => x.2.2.1 j) hs have hst : (fun g : {g // small g} => d.2.2.2 j g.val) = ds.2.2.2 j := congrArg (fun x => x.2.2.2 j) hs have hsa : (fun g : {g // small g} => d.1 j g.val) = ds.1 j := congrArg (fun x => x.1 j) hs change physicalFixedEdgeBigCoefficient small patterns C ζ K (d.2.2.1 j, d.2.2.2 j, ⟨pattern j, d.1 j⟩) (d.2.1 j.castSucc) (d.2.1 j.succ) (pattern j).val Lb Rb ab = _ simp only [physicalFixedEdgeBigCoefficient] rw [physical_permute_group_restrict, physical_permute_group_restrict, hss, hst, hsl, hsl, hsa] exact dif_pos trivial end Bounty end section /- The shared-overlap error vanishes to arbitrary power for every subfamily of the actual candidate prime pools, with the group family varying with L. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- A common mass floor and polynomial marked-weight envelope for every subfamily of the actual candidate pools. -/ open Finset Filter open scoped Classical namespace Bounty theorem exists_candidate_marked_error_inputs {c : ℝ} (hc : 0 < c) (T : ℕ) : ∃ v E : ℝ, 0 < v ∧ 0 ≤ E ∧ ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → (markedDivisorBound (1/2) v T) ^ Fintype.card S ≤ L^E ∧ ∀ (g : S), v ≤ ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ) := by obtain ⟨v, A, hv, hA, hinputs⟩ := exists_candidate_shared_error_inputs hc 1 let B := markedDivisorBound (1/2) v T have hB : 1 ≤ B := one_le_markedDivisorBound (1/2) v T refine ⟨v, A * Real.log B, hv, mul_nonneg hA (Real.log_nonneg hB), ?_⟩ filter_upwards [hinputs, eventually_gt_atTop (0 : ℝ)] with L hinputs hL intro S hS obtain ⟨hcount, hdata⟩ := hinputs S hS refine ⟨?_, fun g => (hdata g).1⟩ have hcard : ((univ : Finset S).card : ℝ) ≤ A * Real.log L := by simpa only [one_mul, card_univ, Fintype.card_coe] using hcount have hb := group_product_bound_of_log_card (univ : Finset S) (fun _ => B) hB hL (fun _ _ => zero_le_one.trans hB) (fun _ _ => le_rfl) hcard simpa only [prod_const, card_univ] using hb end Bounty end section /- The shared-draw error decays uniformly for polynomial endpoint logarithms on arbitrary subfamilies of the actual candidate pools. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_shared_polynomial_error {c F : ℝ} (hc : 0 < c) (hF : 0 ≤ F) (J : ℕ) (E D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (C : S → Finset (Fin J)) (w z : ℕ) (H : ℝ), 0 < w → 0 < z → Real.log w ≤ L^F → Real.log z ≤ L^F → 0 ≤ H → H ≤ L^E → (∑ g : S, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / ((∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) * Real.exp (L^(1/10 : ℝ)))) * (H + H / (1/2 : ℝ) ^ (2 * ∑ g : S, (J - (C g).card))) ≤ L^(-D) := by obtain ⟨v, A, hv, hA, hinputs⟩ := exists_candidate_shared_error_inputs hc J have hB : 0 ≤ 2 / Real.log 2 + (J : ℝ) := by positivity filter_upwards [hinputs, eventually_physical_shared_error_polynomial_decay (c := (1/10 : ℝ)) (by norm_num) hv hA hB E F D, eventually_ge_atTop (1 : ℝ)] with L hinputs hdec hL intro S hS C w z H hw hz hwlog hzlog hH hHL obtain ⟨hcount, hdata⟩ := hinputs S hS have h2 : 0 ≤ Real.log (2 : ℝ) := Real.log_nonneg (by norm_num) have hT : 0 ≤ Real.log w / Real.log 2 + Real.log z / Real.log 2 + J := by have hw1 : (1 : ℝ) ≤ w := by exact_mod_cast hw have hz1 : (1 : ℝ) ≤ z := by exact_mod_cast hz exact add_nonneg (add_nonneg (div_nonneg (Real.log_nonneg hw1) h2) (div_nonneg (Real.log_nonneg hz1) h2)) (Nat.cast_nonneg J) have hTL : Real.log w / Real.log 2 + Real.log z / Real.log 2 + J ≤ (2 / Real.log 2 + (J : ℝ)) * L^F := by have hw' := div_le_div_of_nonneg_right hwlog h2 have hz' := div_le_div_of_nonneg_right hzlog h2 have hJ := mul_le_mul_of_nonneg_left (Real.one_le_rpow hL hF) (Nat.cast_nonneg J : (0 : ℝ) ≤ J) calc _ ≤ L^F / Real.log 2 + L^F / Real.log 2 + (J : ℝ)*L^F := by linarith _ = _ := by ring exact hdec S J C (fun g => ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) H (Real.exp (L^(1/10 : ℝ))) (fun g => (hdata g).1) (by simpa only [Fintype.card_coe] using hcount) hT hTL hH hHL le_rfl end Bounty end section /- Bounded output values of the four-factor divisor convolution only see bounded positive inputs. -/ open Finset namespace Bounty theorem endpoint_four_convolution_truncate (δ α β γ : ℕ → ℂ) {N n : ℕ} (hn : n ≤ N) : endpointFourConvolution (fun d => if d ∈ Icc 1 N then δ d else 0) (fun a => if a ∈ Icc 1 N then α a else 0) (fun b => if b ∈ Icc 1 N then β b else 0) (fun c => if c ∈ Icc 1 N then γ c else 0) n = endpointFourConvolution δ α β γ n := by classical unfold endpointFourConvolution apply sum_congr rfl intro d hd have hdN : d ∈ Icc 1 N := mem_Icc.mpr ⟨Nat.pos_of_mem_divisors hd, (Nat.le_of_dvd (Nat.pos_of_ne_zero (Nat.ne_zero_of_mem_divisors hd)) (Nat.dvd_of_mem_divisors hd)).trans hn⟩ simp only [if_pos hdN] congr 1 unfold endpointTripleConvolution apply sum_congr rfl intro a ha have hnd : n / d ≤ N := (Nat.div_le_self n d).trans hn have haN : a ∈ Icc 1 N := mem_Icc.mpr ⟨Nat.pos_of_mem_divisors ha, (Nat.le_of_dvd (Nat.pos_of_ne_zero (Nat.ne_zero_of_mem_divisors ha)) (Nat.dvd_of_mem_divisors ha)).trans hnd⟩ apply sum_congr rfl intro b hb have hna : n / d / a ≤ N := (Nat.div_le_self (n / d) a).trans hnd have hbN : b ∈ Icc 1 N := mem_Icc.mpr ⟨Nat.pos_of_mem_divisors hb, (Nat.le_of_dvd (Nat.pos_of_ne_zero (Nat.ne_zero_of_mem_divisors hb)) (Nat.dvd_of_mem_divisors hb)).trans hna⟩ have hcpos : 0 < n / d / a / b := Nat.div_pos (Nat.le_of_dvd (Nat.pos_of_ne_zero (Nat.ne_zero_of_mem_divisors hb)) (Nat.dvd_of_mem_divisors hb)) (Nat.pos_of_mem_divisors hb) have hcN : n / d / a / b ∈ Icc 1 N := mem_Icc.mpr ⟨hcpos, (Nat.div_le_self (n / d / a) b).trans hna⟩ simp only [if_pos haN, if_pos hbN, if_pos hcN] end Bounty end section open MeasureTheory namespace Bounty theorem local_mellin_tail_power_saving (A B D : ℝ) : ∃ j : ℕ, 2 ≤ j ∧ ∀ (L Y h : ℝ) (S : Finset ℕ) (a : ℕ → ℂ) (N : ℕ), 16 ≤ L → 0 < Y → 0 < h → h⁻¹ ≤ Y → (∀ n ∈ S, 1 ≤ n ∧ n ≤ N) → (N:ℝ)*(1+Real.log N) ≤ Y*L^A → (∑ n ∈ S, ‖a n‖^2) ≤ Y*L^B → (∫ t in {t : ℝ | L/h < |t|}, (1+|h*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) ≤ Y^2*L^(-D) := by obtain ⟨M, hM⟩ := exists_nat_ge (max 1 A+B+D+1) refine ⟨M+2, by omega, ?_⟩ intro L Y h S a N hL hY hh hhi hS hN hE have hL1 : 1 ≤ L := by linarith have hLp : 0 < L := by linarith have hR : L/h ≤ Y*L^(max 1 A) := by calc L/h = L*h⁻¹ := div_eq_mul_inv _ _ _ ≤ L*Y := mul_le_mul_of_nonneg_left hhi hLp.le _ = Y*L^(1:ℝ) := by rw [Real.rpow_one]; ring _ ≤ _ := mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left _ _)) hY.le have hN' : (N:ℝ)*(1+Real.log N) ≤ Y*L^(max 1 A) := hN.trans (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_right _ _)) hY.le) have hconst : 8*(L/h)+8*(N:ℝ)*(1+Real.log N) ≤ 16*Y*L^(max 1 A) := by nlinarith have hprod : (8*(L/h)+8*(N:ℝ)*(1+Real.log N))*(∑ n ∈ S, ‖a n‖^2) ≤ (16*Y*L^(max 1 A))*(Y*L^B) := by exact mul_le_mul hconst hE (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) (by positivity) calc _ ≤ (8*(L/h)+8*(N:ℝ)*(1+Real.log N))*(∑ n ∈ S, ‖a n‖^2)*L^(-(M:ℝ)) := local_mellin_rapid_tail S a N hS hL1 hh M _ ≤ (16*Y*L^(max 1 A))*(Y*L^B)*L^(-(M:ℝ)) := mul_le_mul_of_nonneg_right hprod (Real.rpow_nonneg hLp.le _) _ = 16*Y^2*L^(max 1 A+B-(M:ℝ)) := by rw [sub_eq_add_neg, Real.rpow_add hLp, Real.rpow_add hLp] ring _ ≤ L*Y^2*L^(max 1 A+B-(M:ℝ)) := by gcongr _ = Y^2*L^(max 1 A+B-(M:ℝ)+1) := by rw [Real.rpow_add hLp, Real.rpow_one] ring _ ≤ Y^2*L^(-D) := by apply mul_le_mul_of_nonneg_left _ (sq_nonneg Y) exact Real.rpow_le_rpow_of_exponent_le hL1 (by linarith) end Bounty end section /- Positive integer Fourier sums agree with the local additive polynomial, including a fixed rational-center modulation of their coefficients. -/ open Finset namespace Bounty theorem fourier_real_add (n : ℤ) (c β : ℝ) : fourier n ((c+β : ℝ) : AddCircle (1 : ℝ)) = fourier n (c : AddCircle (1 : ℝ))*fourier n (β : AddCircle (1 : ℝ)) := by simp only [fourier_coe_apply, ← Complex.exp_add] congr 1 push_cast ring theorem finite_fourier_eq_local_additive (S : Finset ℤ) (f : ℤ → ℂ) (hS : ∀ n ∈ S, 0 ≤ n) (c β : ℝ) : finiteFourierSum S f (c+β) = localAdditivePolynomial (S.image Int.natAbs) (fun n => f n * fourier (n : ℤ) (c : AddCircle (1 : ℝ))) β := by unfold finiteFourierSum localAdditivePolynomial rw [sum_image] · apply sum_congr rfl intro n hn dsimp only rw [Int.natAbs_of_nonneg (hS n hn), fourier_real_add] have he : fourier n (β : AddCircle (1 : ℝ)) = Complex.exp (((2*Real.pi*β*n.natAbs : ℝ) : ℂ)*Complex.I) := by rw [fourier_coe_apply] congr 1 have hnR : (n.natAbs : ℝ) = (n : ℝ) := by simpa only [Int.cast_natCast] using congrArg (fun z : ℤ => (z : ℝ)) (Int.natAbs_of_nonneg (hS n hn)) rw [hnR] push_cast ring rw [he] ring · intro a ha b hb hab have he := congrArg (fun m : ℕ => (m : ℤ)) hab simpa only [Int.natAbs_of_nonneg (hS a ha), Int.natAbs_of_nonneg (hS b hb)] using he end Bounty end section /- Relabeling full-event keys preserves terminal states and the original signed real weights. -/ open scoped Classical namespace Bounty section Keys variable {I K J G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → G → ℤ) (f : I → K) theorem full_permutation_key_path_terminal (steps : List (Option (J ⊕ I))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) steps x) : finiteEventPathTerminal _ (fullPermutationMixedEventTarget n S B A Δ D) (steps.map (Option.map (Sum.map id f))) x (fullPermutationKeyPathEquiv n S B A Δ D f steps x p) = finiteEventPathTerminal _ (fullPermutationMixedEventTarget n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i))) steps x p := by let e := finiteEventPathEquiv _ _ _ _ id (fullPermutationKeyEventEquiv n S B A Δ D f) (fun tag x e => (full_permutation_key_target n S B A Δ D f tag x e).symm) steps x p exact (finite_event_path_map_terminal (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (Option.map (Sum.map id f)) steps x e).symm.trans (finite_event_path_equiv_terminal _ _ _ _ id _ _ steps x p) variable [Fintype G] [DecidableEq G] (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) theorem full_permutation_key_weight (tag : Option (J ⊕ I)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) tag x) : fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V (tag.map (Sum.map id f)) x (fullPermutationKeyEventEquiv n S B A Δ D f tag x e) = fullPermutationMixedEventWeight n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) (fun i => ω (f i)) μ q ρ V tag x e := by cases tag with | none => rfl | some tag => cases tag <;> rfl theorem full_permutation_key_path_weight (steps : List (Option (J ⊕ I))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) steps x) : finiteEventPathWeight _ (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) (steps.map (Option.map (Sum.map id f))) x (fullPermutationKeyPathEquiv n S B A Δ D f steps x p) = finiteEventPathWeight _ (fullPermutationMixedEventTarget n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i))) (fullPermutationMixedEventWeight n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) (fun i => ω (f i)) μ q ρ V) steps x p := by let e := finiteEventPathEquiv _ _ _ _ id (fullPermutationKeyEventEquiv n S B A Δ D f) (fun tag x e => (full_permutation_key_target n S B A Δ D f tag x e).symm) steps x p exact (finite_event_path_map_weight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (Option.map (Sum.map id f)) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps x e).symm.trans (finite_event_path_equiv_weight _ _ _ _ id _ _ _ _ (full_permutation_key_weight n S B A Δ D f ω μ q ρ V) steps x p) end Keys end Bounty end section /- The original local coefficient phase commutes with exact full-event key transport. -/ namespace Bounty section Keys variable {I K J G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → G → ℤ) (f : I → K) theorem full_permutation_key_local_phase (phase : ∀ tag x, FullPermutationMixedEvent n S B A Δ D tag x → ℂ) (steps : List (Option (J ⊕ I))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i)) steps x) : finiteEventLocalPhase (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) phase (steps.map (Option.map (Sum.map id f))) x (fullPermutationKeyPathEquiv n S B A Δ D f steps x p) = finiteEventLocalPhase (FullPermutationMixedEvent n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i))) (fullPermutationMixedEventTarget n (fun i => S (f i)) B (fun i => A (f i)) (fun i => Δ (f i)) (fun i => D (f i))) (fun tag x e => phase (tag.map (Sum.map id f)) x (fullPermutationKeyEventEquiv n S B A Δ D f tag x e)) steps x p := by have h := full_permutation_key_ledger_phase n S B A Δ D f (fun _ (_ : Unit) _ _ => ()) (fun tag (_ : Unit) x e => phase tag x e) steps () x p simpa only [deterministic_ledger_local_phase] using h end Keys end Bounty end section /- Explicit exponent bookkeeping for the normalized major/minor pairing. -/ open MeasureTheory namespace Bounty theorem major_minor_pairing_decay {L Y B D Ef Eg M : ℝ} (hL : 2 ≤ L) (hY : 0 ≤ Y) (hf0 : 0 ≤ Ef) (hg0 : 0 ≤ Eg) (hM0 : 0 ≤ M) (hf : Ef ≤ Y*L^B) (hg : Eg ≤ Y*L^B) (hM : M ≤ Y*L^(-(2*D+B+2))) : Real.sqrt ((L^(-(D+B+1)))^2*Ef+M)*Real.sqrt Eg ≤ Y*L^(-D) := by have hLp : 0 < L := by linarith have hpower : (L^(-(D+B+1)))^2*(Y*L^B) = Y*L^(-(2*D+B+2)) := by calc _ = Y*(L^(-(D+B+1))*L^(-(D+B+1))*L^B) := by ring _ = _ := by rw [← Real.rpow_add hLp, ← Real.rpow_add hLp] congr 2 ring have hfirst : (L^(-(D+B+1)))^2*Ef+M ≤ 2*Y*L^(-(2*D+B+2)) := by have hh := mul_le_mul_of_nonneg_left hf (sq_nonneg (L^(-(D+B+1)))) rw [hpower] at hh linarith have hproduct : ((L^(-(D+B+1)))^2*Ef+M)*Eg ≤ 2*Y^2*L^(-(2*D+2)) := by calc _ ≤ (2*Y*L^(-(2*D+B+2)))*(Y*L^B) := mul_le_mul hfirst hg hg0 (by positivity) _ = 2*Y^2*(L^(-(2*D+B+2))*L^B) := by ring _ = _ := by rw [← Real.rpow_add hLp] congr 2 ring have hsquare : (Y*L^(-D))^2 = Y^2*L^(-2*D) := by rw [mul_pow, pow_two (L^(-D)), ← Real.rpow_add hLp] congr 2 ring have hsmall : 2*Y^2*L^(-(2*D+2)) ≤ (Y*L^(-D))^2 := by rw [hsquare, show -(2*D+2) = -2*D-2 by ring, Real.rpow_sub hLp, Real.rpow_two, ← mul_div_assoc] apply (div_le_iff₀ (sq_pos_of_pos hLp)).2 have hsq : 2 ≤ L^2 := by nlinarith nlinarith [mul_le_mul_of_nonneg_left hsq (mul_nonneg (sq_nonneg Y) (Real.rpow_pos_of_pos hLp (-2*D)).le)] rw [← Real.sqrt_mul (add_nonneg (mul_nonneg (sq_nonneg _) hf0) hM0)] exact (Real.sqrt_le_iff).2 ⟨by positivity, hproduct.trans hsmall⟩ end Bounty end section /- Character cancellation normalized by the actual candidate coefficient mass. -/ open Finset Filter namespace Bounty theorem exists_candidate_character_relative_power_bound (hZ : PrimitiveZeroFreeHalfPlane) {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (B : ℝ) : ∃ J : ℕ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ‖∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime m), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod f)‖ ≤ candidateCoefficientWindowMass c L q r jStar * L^(-B) := by obtain ⟨V, hV, hrest⟩ := exists_candidate_Q_rest_harmonic_upper hc r hr obtain ⟨K, hK, J, hlower⟩ := exists_candidate_coefficient_window_mass_lower hc hr hq0 hq1 hcenter refine ⟨J, ?_⟩ filter_upwards [eventually_candidate_character_cancellation hZ hc (B+2), hrest, hlower, eventually_candidate_one_marked_mass_ge_one hc hq0 hq1.le, eventually_ge_atTop ((16*V)/K), eventually_gt_atTop (0 : ℝ)] with L hcancel hrestL hlowerL hPone hlarge hL intro jStar hj f hf hfL χ hχ m hm hmL have hj0 : 0 < jStar := (Nat.zero_le J).trans_lt hj have hP : 0 ≤ candidateOneMarkedHarmonicMass c L q := zero_le_one.trans hPone have hQ : 0 ≤ candidateQHarmonicMass c L r jStar := by apply tsum_nonneg intro n exact div_nonneg (candidate_Q_weight_nonneg c L r jStar n) (Nat.cast_nonneg n) have hconst : 16*V ≤ K*L := by simpa only [mul_comm L K] using (div_le_iff₀ hK).mp hlarge have hpowers : L^(-(B+2)) = L^(-B) / L^2 := by rw [show -(B+2) = -B - 2 by ring, Real.rpow_sub hL, Real.rpow_two] calc _ ≤ (16*Real.exp L) * L^(-(B+2)) * candidateOneMarkedHarmonicMass c L q * candidateQRestHarmonicMass c L r jStar hr := hcancel q hq0 r jStar hr hj0 f hf hfL χ hχ m hm hmL _ ≤ (16*Real.exp L) * L^(-(B+2)) * candidateOneMarkedHarmonicMass c L q * (V * candidateQHarmonicMass c L r jStar) := mul_le_mul_of_nonneg_left (hrestL jStar hj0) (by positivity) _ = (16*V) * (Real.exp L * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar * L^(-(B+2))) := by ring _ ≤ (K*L) * (Real.exp L * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar * L^(-(B+2))) := mul_le_mul_of_nonneg_right hconst (by positivity) _ = (K * (Real.exp L/L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar) * L^(-B) := by rw [hpowers] field_simp _ ≤ _ := mul_le_mul_of_nonneg_right (hlowerL jStar hj) (Real.rpow_nonneg hL.le _) end Bounty end section /- The energy of the literal physical history is the injective part of its full-state realization. This comparison retains every physical list and pending tuple, with the original product weights. -/ namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) end Physical end Bounty end section /- Actual error from changing memory caps is bounded by the ghost-birth excursion tail. The comparison transports the whole-path phase, retains all event identities, and measures the error on the smaller state space. -/ open Finset Classical namespace Bounty section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) {b B : ℕ} (h : b ≤ B) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end end Bounty end section /- Exponential character cancellation for the actual candidate coefficient. -/ open Finset Filter namespace Bounty theorem eventually_candidate_character_exponential_cancellation (hZ : PrimitiveZeroFreeHalfPlane) {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ), 0 ≤ q → ∀ (r jStar : ℕ) (hr : 0 < r), 0 < jStar → ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ‖∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime m), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod f)‖ ≤ (16*Real.exp L) * Real.exp (-(c/64)*L) * candidateOneMarkedHarmonicMass c L q * candidateQRestHarmonicMass c L r jStar hr := by filter_upwards [eventually_candidate_character_coprime_convolution hc, eventually_candidate_Q_character_exponential_cancellation hZ hc, eventually_ge_atTop (0 : ℝ)] with L hconv hQ hL intro q hq r jStar hr hj f hf hfL χ hχ m hm hmL let R : ℝ := candidateQRestHarmonicMass c L r jStar hr let C : ℝ := (16*Real.exp L) * Real.exp (-(c/64)*L) * R have hR : 0 ≤ R := candidate_Q_rest_harmonic_nonneg c L r jStar hr have hC : 0 ≤ C := by dsimp only [C]; positivity have htest := hconv q r jStar f m χ (fun _ => 1) simp only [mul_one] at htest rw [htest] calc _ ≤ ∑ a ∈ (candidateSmallPSet c L (16*Real.exp L + 1)).filter (fun a => a.Coprime m), ‖(candidatePWeight c L q a : ℂ) * χ (a : ZMod f) * ∑ n ∈ (arithmeticProductWindow a (Real.exp L)).filter (fun n => n.Coprime m), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod f)‖ := norm_sum_le _ _ _ ≤ ∑ a ∈ (candidateSmallPSet c L (16*Real.exp L + 1)).filter (fun a => a.Coprime m), (candidatePWeight c L q a / (a : ℝ)) * C := by apply sum_le_sum intro a ha have hWa := candidate_P_weight_nonneg c L hq a have ha0 : a ≠ 0 := candidate_small_P_set_nonzero (mem_filter.mp ha).1 have hi := hQ f hf hfL χ hχ m hm hmL r jStar hr hj a ha0 rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_of_nonneg hWa] calc _ ≤ candidatePWeight c L q a * ‖∑ n ∈ (arithmeticProductWindow a (Real.exp L)).filter (fun n => n.Coprime m), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod f)‖ := by apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) exact mul_le_of_le_one_right hWa (χ.norm_le_one _) _ ≤ candidatePWeight c L q a * (((16*Real.exp L)/(a : ℝ)) * Real.exp (-(c/64)*L) * R) := mul_le_mul_of_nonneg_left hi hWa _ = _ := by dsimp only [C]; ring _ ≤ ∑ a ∈ candidateSmallPSet c L (16*Real.exp L + 1), (candidatePWeight c L q a / (a : ℝ)) * C := by apply sum_le_sum_of_subset_of_nonneg (filter_subset _ _) intro a _ _ exact mul_nonneg (div_nonneg (candidate_P_weight_nonneg c L hq a) (Nat.cast_nonneg a)) hC _ = (∑ a ∈ candidateSmallPSet c L (16*Real.exp L + 1), candidatePWeight c L q a / (a : ℝ)) * C := (sum_mul _ _ _).symm _ ≤ candidateOneMarkedHarmonicMass c L q * C := by apply mul_le_mul_of_nonneg_right _ hC exact candidate_full_P_harmonic_sum_le_total (mul_nonneg hc.le hL) hq _ = _ := by dsimp only [C, R]; ring end Bounty end section /- Uniform size and product bounds for factor-two blocks meeting the candidate window. -/ open Finset Filter namespace Bounty theorem candidate_Q_zero_factor_two_geometry {c L : ℝ} {r p n : ℕ} {P U : ℝ} (hc : 0 < c) (hr : 0 < r) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hL : 0 ≤ L) (hp : p ∈ candidateQBand (c*L) 0) (hprod : p*n ∈ arithmeticProductWindow 1 (Real.exp L)) (hpP : (p : ℝ) ≤ P) (hPp : P ≤ 2*(p : ℝ)) (hnU : (n : ℝ) ≤ U) (hUn : U ≤ 2*(n : ℝ)) : Real.exp (c*L) < P ∧ Real.exp (c*L) < U ∧ P ≤ 32*Real.exp ((1-c)*L) ∧ U ≤ 32*Real.exp ((1-c)*L) ∧ P ≤ 32*Real.exp L ∧ U ≤ 32*Real.exp L ∧ P*U ≤ 64*Real.exp L := by obtain ⟨hpLo, hnLo, hnHi, hpHi, hpL, hnL, hpn⟩ := candidate_Q_zero_prime_remainder_geometry hc hr hcenter hL hp hprod refine ⟨hpLo.trans_le hpP, hnLo.trans_le hnU, ?_, ?_, ?_, ?_, ?_⟩ · nlinarith [Real.exp_pos ((1-c)*L)] · linarith · linarith · linarith · calc P*U ≤ (2*(p : ℝ))*(2*(n : ℝ)) := mul_le_mul hPp hUn ((Nat.cast_nonneg n).trans hnU) (by positivity) _ = 4*((p : ℝ)*(n : ℝ)) := by ring _ ≤ 64*Real.exp L := by linarith end Bounty end section /- Literal physical rows on marks, ledgers and bounded memory. Ghost rows and every fixed-target edge row use the original raw operators. Full-slot permutations retain their original normalized average. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) theorem physical_observed_mark_row_intertwines (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (tag : Option (I ⊕ K)) (before after : Fin N → Finset (Fin J)) (hencode : PhysicalMarkRowEncoding C tag before after) (F : PhysicalMarkObservation P ell C → FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalObservedMarkRow C k ω β retention ρ V hV tag (fun o => F o ∘ physicalBoundedMarkEncode after) s = physicalFullObservedRow C k ω β retention ρ V before after tag F (physicalBoundedMarkEncode before s) := by cases tag with | none => rw [physical_full_observed_permutation_row] exact physical_full_transition_phase_reindex before after s.1 s.2.2 (fun σ x => F (.inl σ) (s.2.1, x)) | some tag => cases tag with | inl j => change before = after at hencode subst after rw [physical_full_observed_ghost_row] exact physical_full_global_ghost_row C k ω β retention ρ V j before s.1 s.2.1 s.2.2 (fun g => physicalGroupPhaseActivity s.1 g) hV (F (.inr none)) | inr j => change before = C j ∧ after = C j at hencode rcases hencode with ⟨rfl, rfl⟩ refine (physical_full_all_endpoints_edge_observed_continuation (C j) (k j) s.1 s.2.1 s.2.2 hP hdis β ρ V (ω j) (fun aux => F (.inr (some ⟨j, aux⟩)))).trans ?_ unfold physicalFullObservedRow fullMixedObservedRow apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ change _ = _ * physicalFullGlobalEdgePhase (C j) (k j) s.2.1 (ω j) (fun g p => β g p / V g) ρ V (physicalFullMemoryState (C j) s.1 s.2.2) e * _ rw [physical_full_global_edge_phase_encode] rfl end Physical end Bounty end section /- The full signed prime block follows from the actual uniform free-tuple comparison estimates. -/ namespace Bounty open Finset open scoped Classical theorem prime_grouped_block_bound_of_free_tuple_estimates {G : Type*} [Fintype G] [DecidableEq G] {I : G → Type*} [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)] (P : G → Finset ℕ) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hP : ∀ g p, p ∈ P g → 0 < p) (hmass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (probes tails : ∀ g, Finset (I g)) (hpt : ∀ g, Disjoint (probes g) (tails g)) (m ell : ℕ) (hm : 0 < m) (hp : ∀ g, (probes g).card = m) (ht : ∀ g, (tails g).card = ell) (s t : Finset G) (hst : Disjoint s t) (active : Finset (Sigma I)) (hactive : activeᶜ = univ.sigma tails) (Q : ℕ) (h : ℝ) (keptA keptB : Finset (Sigma I) → Finset ℤ) (ζ Θ : ℝ) (f g : (∀ g, I g → P g) → ℂ) (hf : ∀ a, finiteGroupSlotSymmetric a f) (hg : ∀ a, finiteGroupSlotSymmetric a g) (ε : ℝ) (hε : 0 ≤ ε) (hfree : ∀ A ∈ cleanNonemptySubsets (s.sigma probes), ∀ B ∈ cleanNonemptySubsets (t.sigma probes), ∀ α : ℝ, ∀ (u : (∀ i : A, P i.1.1) → ℂ) (v : (∀ i : B, P i.1.1) → ℂ), ‖finiteTwoKernelPairingError (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.1.1) (fun i => V i.1.1))) (finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.1.1) (fun i => V i.1.1))) (primeProductIdealKernel (fun i : A => P i.1.1) (fun i => V i.1.1) Q h (keptA A)) (primeProductIdealKernel (fun i : B => P i.1.1) (fun i => V i.1.1) Q h (keptB B)) (fun a b => Complex.exp (Complex.I * (ζ * Real.log (((∏ i : A, (a i).val : ℕ) : ℝ) * (∏ i : B, (b i).val : ℕ)) + 2 * Real.pi * (α * (((∏ i : A, (a i).val : ℕ) : ℝ) * (∏ i : B, (b i).val : ℕ))) : ℝ))) u v‖ ≤ ε * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.1.1) (fun i => V i.1.1))) u) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.1.1) (fun i => V i.1.1))) v)) : ‖cleanRawPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeActivePhase (fun a : Sigma I => P a.1) active ζ Θ) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g) - ∑ A ∈ cleanNonemptySubsets (s.sigma probes), ∑ B ∈ cleanNonemptySubsets (t.sigma probes), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeAsymmetricComparisonKernel (fun a : Sigma I => P a.1) (fun a => V a.1) active Q h keptA keptB ζ Θ A B) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g)‖ ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ s.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((s.sigma probes).card + (t.sigma probes).card) * ε) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) g) := by have hsubset (r : Finset G) : r.sigma probes ⊆ active := by intro a ha by_contra hn have ht0 : a ∈ univ.sigma tails := hactive ▸ mem_compl.mpr hn exact disjoint_left.mp (hpt a.1) (mem_sigma.mp ha).2 (mem_sigma.mp ht0).2 have hdis : Disjoint (s.sigma probes) (t.sigma probes) := by apply disjoint_left.mpr intro a ha hb exact disjoint_left.mp hst (mem_sigma.mp ha).1 (mem_sigma.mp hb).1 apply prime_asymmetric_grouped_block_bound P V hV hP hmass probes tails hpt m ell hm hp ht s t hst active Q h keptA keptB ζ Θ f g hf hg ε hε intro S hS T hT A hA B hB have hAA : A ⊆ s.sigma probes \ S := ((clean_mem_nonempty_subsets _ _).mp hA).2 have hBB : B ⊆ t.sigma probes \ T := ((clean_mem_nonempty_subsets _ _).mp hB).2 have hAU : A ∈ cleanNonemptySubsets (s.sigma probes) := clean_nonempty_subsets_mono sdiff_subset hA have hBV : B ∈ cleanNonemptySubsets (t.sigma probes) := clean_nonempty_subsets_mono sdiff_subset hB have he := prime_admissible_component_error_le (fun a : Sigma I => P a.1) (fun a => V a.1) (fun a => hV a.1) (fun a p hp => hP a.1 p hp) (fun a => hmass a.1) active (s.sigma probes) (t.sigma probes) S T A B (hsubset s) (hsubset t) hdis hAA hBB Q h keptA keptB ζ Θ (finiteGroupFlattenFunction f) (finiteGroupFlattenFunction g) ε hε (hfree A hAU B hBV) simp only [hactive, finiteGroupedTailTest] at he ⊢ convert he using 1 <;> congr 1 end Bounty end section /- Fixed original choices and physical target marks define literal selectors on the observed physical rows, before any norm estimate. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) omit [∀ g, ∀ p : ↥(P g), NeZero p.val] in theorem physical_observed_selected_permutation_state (σ : PhysicalPermutations (Fin N) J ell) (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalObservedMarkRow C k ω β retention ρ V hV none (fun o t => if o = .inl σ then F t else 0) s = ((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) * F (physicalPermuteLabels σ s.1, s.2) := by simp [physicalObservedMarkRow, mul_ite] omit [∀ g, ∀ p : ↥(P g), NeZero p.val] in theorem physical_observed_selected_permutation (σ : PhysicalPermutations (Fin N) J ell) (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalObservedMarkRow C k ω β retention ρ V hV none (fun o t => if o = .inl σ then F (physicalMarkRawReadout t) else 0) s = ((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) * F (physicalMarkRawReadout s) := by simp [physicalObservedMarkRow, mul_ite] rfl end Physical end Bounty end section /- Actual simultaneous pair-sieve moments, with a direct lattice-error bound. -/ open Finset namespace Bounty def pairSieveBadEvent (rough banned : ℕ → Bool) (v : ℕ × ℕ) (p : ℕ) : Prop := (rough p = true ∧ (v.1*v.2) % p = 0) ∨ (banned p = true ∧ (v.1*v.2) % p = 1 % p) noncomputable def pairSieveBaseBox (A B C D m : ℕ) : Finset (ℕ × ℕ) := (Finset.product (Ioc A B) (Ioc C D)).filter (fun v => (v.1*v.2) % m = 1 % m) noncomputable def pairSieveIntersection (A B C D m : ℕ) (P : Finset ℕ) (rough banned : ℕ → Bool) : Finset (ℕ × ℕ) := by classical exact (pairSieveBaseBox A B C D m).filter (fun v => ∀ p ∈ P, pairSieveBadEvent rough banned v p) theorem actual_pair_sieve_intersection_error (A B C D m : ℕ) [NeZero m] (hAB : A ≤ B) (hCD : C ≤ D) (P : Finset ℕ) (rough banned : ℕ → Bool) (hP : ∀ p ∈ P, p.Prime) (hPm : ∀ p ∈ P, ¬p ∣ m) : |((pairSieveIntersection A B C D m P rough banned).card : ℝ) - (((B : ℝ)-A)*((D : ℝ)-C)*(m.totient : ℝ)/(m : ℝ)^2) * ∏ p ∈ P, pairSieveDensity p (rough p) (banned p)| ≤ (m : ℝ)*((∏ p ∈ P, p : ℕ) : ℝ)^2 + (((B : ℝ)-A)+((D : ℝ)-C))*((∏ p ∈ P, p : ℕ) : ℝ) := by classical let d := ∏ p ∈ P, p let N := m*d let R := natPairSieveResidues m (natPairBaseResidues m) P (fun p => natPairBadResidues p (rough p) (banned p)) have hm : 0 < m := Nat.pos_of_ne_zero (NeZero.ne m) have hd : 0 < d := prod_pos (fun p hp => (hP p hp).pos) have hN : 0 < N := mul_pos hm hd have hset : (pairSieveBaseBox A B C D m).filter (fun v => ∀ p ∈ P, pairSieveBadEvent rough banned v p) = (Finset.product (Ioc A B) (Ioc C D)).filter (fun v : ℕ × ℕ => (v.1 % N, v.2 % N) ∈ R) := by rw [pairSieveBaseBox, filter_filter] apply filter_congr intro v _ rw [nat_pair_sieve_residues_mod m (natPairBaseResidues m) P (fun p => natPairBadResidues p (rough p) (banned p)) hN v, nat_pair_base_mod_iff m hm] apply and_congr_right intro _ apply forall_congr' intro p apply imp_congr_right intro hp exact (nat_pair_bad_mod_iff p (hP p hp).pos (rough p) (banned p) v.1 v.2).symm have hcount := interval_allowed_nat_residue_pairs_error A B C D N hN R (fun _ hv => nat_pair_sieve_residues_bounds m (natPairBaseResidues m) P _ hv) hAB hCD have hNcast : (N : ℝ) = (m : ℝ) * ∏ p ∈ P, (p : ℝ) := by simp only [N, d, Nat.cast_mul, Nat.cast_prod] have hdensity := actual_pair_sieve_residue_density m P rough banned hP hPm change (R.card : ℝ) / ((m : ℝ) * ∏ p ∈ P, (p : ℝ))^2 = _ at hdensity have hmean : (R.card : ℝ) * ((((B : ℝ)-A)/N) * (((D : ℝ)-C)/N)) = (((B : ℝ)-A)*((D : ℝ)-C)*(m.totient : ℝ)/(m : ℝ)^2) * ∏ p ∈ P, pairSieveDensity p (rough p) (banned p) := by calc _ = ((B : ℝ)-A)*((D : ℝ)-C)*((R.card : ℝ)/(N : ℝ)^2) := by ring _ = _ := by rw [hNcast, hdensity]; ring rw [hmean] at hcount rw [pairSieveIntersection, hset] apply hcount.trans have hR : (R.card : ℝ) ≤ (m : ℝ)*(d : ℝ)^2 := by exact_mod_cast actual_pair_sieve_residue_card_le m P rough banned hP hPm have hx : 0 ≤ (B : ℝ)-A := sub_nonneg.mpr (Nat.cast_le.mpr hAB) have hy : 0 ≤ (D : ℝ)-C := sub_nonneg.mpr (Nat.cast_le.mpr hCD) simpa only [N, Nat.cast_mul] using pair_lattice_crude_error (Nat.cast_pos.mpr hm) (Nat.cast_pos.mpr hd) hx hy hR end Bounty end section /- Extending selected physical rows to all raw states using their actual input cutoff. -/ open scoped Classical namespace Bounty theorem physical_mark_raw_extension_eq_of_total_cutoff {N J ell B : ℕ} {P : Fin N → Finset ℕ} (R : PhysicalMarkLists P J ell) (F : PhysicalBoundedMarkState P J ell B → ℂ) (G : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (hzero : ∀ s, B < globalBirthJointLength s → G s = 0) (hreadout : ∀ s, s.1 = R → F s = G (physicalMarkRawReadout s)) : physicalMarkRawExtension F R = G := by funext s unfold physicalMarkRawExtension by_cases hs : ∀ g, (s g).2.1 ≤ B · rw [dif_pos hs] exact hreadout (R, (fun g => (s g).1), fun g => ⟨⟨(s g).2.1, Nat.lt_succ_of_le (hs g)⟩, (s g).2.2⟩) rfl · rw [dif_neg hs] symm apply hzero by_contra htotal apply hs intro g exact (global_birth_joint_local_length_le_total s g).trans (Nat.le_of_not_gt htotal) end Bounty end section /- All groups retain their tags in the cumulative birth ledger of the actual path. -/ open Finset open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) noncomputable def fullMixedLedgerTaggedImage (s : FullMixedLedgerState n (M := M) B) : Finset ((g : Fin N) × P g) := univ.biUnion (fullMixedLedgerGroupImage n B s) noncomputable def fullMixedLedgerPriorBirths (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (cut : ℕ) : Finset ((g : Fin N) × P g) := univ.biUnion fun a : FullMixedBirthAddress S B steps => if a.1.val < cut then (fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a).toFinset else ∅ theorem mem_full_mixed_ledger_tagged (x : FullMixedLedgerState n (M := M) B) (z : (g : Fin N) × P g) : z ∈ fullMixedLedgerTaggedImage n B x ↔ z.2 ∈ x.1 z.1 := by rcases z with ⟨g, z⟩ simp only [fullMixedLedgerTaggedImage, fullMixedLedgerGroupImage, mem_biUnion, mem_univ, true_and, mem_image] constructor · rintro ⟨h, y, hy, hzy⟩ cases hzy exact hy · intro hz exact ⟨g, z, hz, rfl⟩ theorem mem_full_mixed_ledger_prior_births (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (cut : ℕ) (z : (g : Fin N) × P g) : z ∈ fullMixedLedgerPriorBirths n S B A Δ D steps x p cut ↔ ∃ a : FullMixedBirthAddress S B steps, a.1.val < cut ∧ fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z := by simp only [fullMixedLedgerPriorBirths, mem_biUnion, mem_univ, true_and] apply exists_congr intro a split_ifs <;> simp_all only [Option.mem_toFinset, Option.mem_def, Finset.notMem_empty, false_and, true_and, iff_self] theorem full_mixed_ledger_prior_births_eq_groups (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (cut : ℕ) : fullMixedLedgerPriorBirths n S B A Δ D steps x p cut = univ.biUnion (fullMixedLedgerPriorGroupBirths n S B A Δ D steps x p cut) := by ext z rw [mem_full_mixed_ledger_prior_births] simp only [mem_biUnion, mem_univ, true_and, mem_full_mixed_prior_group_births] constructor · rintro ⟨⟨j, g, b⟩, hj, hb⟩ exact ⟨g, j, hj, b, hb⟩ · rintro ⟨g, j, hj, b, hb⟩ exact ⟨⟨j, g, b⟩, hj, hb⟩ variable (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem full_mixed_ledger_tagged_union_before (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (hx : FullMixedLedgerCovers n B x) (hp : finiteEventPathWeight (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fun tag s => fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V tag s.2) steps x p ≠ 0) (i : Fin steps.length) : fullMixedLedgerTaggedImage n B (finiteEventPathOccurrence (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) steps x p i).1 = fullMixedLedgerTaggedImage n B x ∪ fullMixedLedgerPriorBirths n S B A Δ D steps x p i.val := by have hw := finite_event_path_occurrence_weight_ne_zero _ _ _ steps x p hp simp only [fullMixedLedgerTaggedImage, full_mixed_ledger_prior_births_eq_groups] ext z simp only [mem_biUnion, mem_univ, true_and, mem_union] have hg := fun g => full_mixed_ledger_group_union_before n S B A Δ D ω μ q ρ V steps x p hx hw i g simp_rw [hg, mem_union, exists_or] theorem full_mixed_ledger_mem_before (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (hx : FullMixedLedgerCovers n B x) (hp : finiteEventPathWeight (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fun tag s => fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V tag s.2) steps x p ≠ 0) (i : Fin steps.length) (g : Fin N) (r : P g) : r ∈ (finiteEventPathOccurrence (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) steps x p i).1.1 g ↔ r ∈ x.1 g ∨ ∃ a : FullMixedBirthAddress S B steps, a.1.val < i.val ∧ fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some ⟨g, r⟩ := by have h := congrArg (fun H => (⟨g, r⟩ : (h : Fin N) × P h) ∈ H) (full_mixed_ledger_tagged_union_before n S B A Δ D ω μ q ρ V steps x p hx hp i) simpa only [mem_full_mixed_ledger_tagged, mem_union, mem_full_mixed_ledger_prior_births, eq_iff_iff] using h end Full end Bounty end section /- The concrete weighted rows bound full original path mass, in particular at empty memory. -/ open Finset Classical namespace Bounty theorem productLengthLyapunov_one_le {G : Type*} [Fintype G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} {v : ℝ} (hv : 1 ≤ v) (s : ProductBoundedOrderedState P Z M B) : 1 ≤ productLengthLyapunov v s := by rw [productLengthLyapunov_eq_total] exact one_le_pow₀ hv theorem productLengthLyapunov_empty {G : Type*} [Fintype G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (v : ℝ) (s : ProductBoundedOrderedState P Z M B) (hs : productTotalMemory s = 0) : productLengthLyapunov v s = 1 := by rw [productLengthLyapunov_eq_total, hs, pow_zero] section Root variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V : G → ℝ) end Root end Bounty end section /- Full-cell prime proxies: support, positivity, exact mass, and uniform size. -/ open Finset Filter namespace Bounty noncomputable def primeCellProxy (L S Y : ℝ) (n : ℕ) : ℝ := if n ∈ roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L)) then primeCellProxyCoefficient L S Y else 0 theorem prime_cell_proxy_nonneg (L S Y : ℝ) (n : ℕ) : 0 ≤ primeCellProxy L S Y n := by unfold primeCellProxy primeCellProxyCoefficient split <;> positivity theorem prime_cell_proxy_ne_zero_mem {L S Y : ℝ} {n : ℕ} (h : primeCellProxy L S Y n ≠ 0) : n ∈ roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L)) := by by_contra hn exact h (by simp only [primeCellProxy, if_neg hn]) theorem prime_cell_proxy_avoids_small_primes {L S Y : ℝ} {n : ℕ} (h : primeCellProxy L S Y n ≠ 0) : ∀ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), ¬p ∣ n := by intro p hp hpn have hn := prime_cell_proxy_ne_zero_mem h have hpp : p.Prime := (mem_filter.mp hp).2 have hpf : p ∈ n.primeFactors := Nat.mem_primeFactors.mpr ⟨hpp, hpn, (roughBand_pos hn).ne'⟩ have hlarge := (mem_filter.mp hn).2 p hpf have hsmall : (p : ℝ) ≤ Real.exp (Real.sqrt L) := (Nat.cast_le.mpr (mem_Ioc.mp (mem_filter.mp hp).1).2).trans (Nat.floor_le (Real.exp_pos _).le) exact (not_lt_of_ge hsmall) hlarge section variable {L S Y : ℝ} (hR : 0 < (roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L))).card) include L S Y hR theorem prime_cell_proxy_count_match : (∑ n ∈ Ioc ⌊Y⌋₊ ⌊Real.exp (L^(-S))*Y⌋₊, primeCellProxy L S Y n) = ((primeBand Y (Real.exp (L^(-S))*Y)).card : ℝ) := by classical have hsubset : roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L)) ⊆ Ioc ⌊Y⌋₊ ⌊Real.exp (L^(-S))*Y⌋₊ := fun _ hn => (mem_filter.mp hn).1 rw [← sum_subset hsubset (fun n _ hn => by simp only [primeCellProxy, if_neg hn])] trans ∑ _n ∈ roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L)), primeCellProxyCoefficient L S Y · exact sum_congr rfl (fun n hn => by simp only [primeCellProxy, if_pos hn]) simp only [sum_const, nsmul_eq_mul] unfold primeCellProxyCoefficient have hcard : ((roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L))).card : ℝ) ≠ 0 := (Nat.cast_pos.mpr hR).ne' field_simp theorem prime_cell_proxy_full_cell_zero_sum : (∑ n ∈ Ioc ⌊Y⌋₊ ⌊Real.exp (L^(-S))*Y⌋₊, ((if n.Prime then 1 else 0 : ℝ)-primeCellProxy L S Y n)) = 0 := by classical rw [sum_sub_distrib, prime_cell_proxy_count_match hR, sum_boole] exact sub_self _ end theorem exists_prime_cell_proxy_uniform_bound {a : ℝ} (ha : 0 < a) : ∃ C : ℝ, 0 < C ∧ ∀ S : ℝ, ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ n : ℕ, 0 ≤ primeCellProxy L S Y n ∧ primeCellProxy L S Y n ≤ 1 ∧ primeCellProxy L S Y n ≤ C/(L*(∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1-1/(p : ℝ)))) := by obtain ⟨C, hC, hbound⟩ := exists_prime_cell_proxy_bound ha refine ⟨C, hC, ?_⟩ intro S filter_upwards [hbound S, eventually_gt_atTop (0 : ℝ)] with L hb hL intro Y hY n have hV : 0 < ∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1-1/(p : ℝ)) := finite_prime_avoidance_product_pos _ (fun _ hp => (mem_filter.mp hp).2) unfold primeCellProxy split · exact hb Y hY · exact ⟨le_rfl, zero_le_one, by positivity⟩ end Bounty end section /- Literal clean-event masking by a fixed initial birth ledger. Only fresh active draws are tested; the original auxiliary law and bans remain. -/ open Finset open scoped Classical namespace Bounty noncomputable def cleanFullMemoryInitialEventAction {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (F : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (D : SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) C) → PhysicalAuxLabels P C → G → ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (x : CleanFullMemoryState P J ell B) (rs : PhysicalResidues Ps) : ℂ := let source := (cleanFullMemoryEquiv P J ell B x).2.2.1 let c := (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 let s := (productActiveMemorySplit (cleanFullSharedSlots C) B x).2 let δ := fun c aux (_ : G) => -cleanFullSharedStep (P := P) (ell := ell) k C c aux d let Ψ := fun c aux (fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) => if repeatedBigAuxAvoids C aux source ∧ repeatedBigAuxAvoids C aux (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) then K source (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) aux * physicalPhase ζ (cleanFullSharedD C c aux) * physicalReturnPhase θ (cleanFullSharedStep k C c aux d) * physicalPhase ζ (physicalSharedProduct d) else 0 ∑ e : FullActiveEdgeEvent (fun g (q : P g) => q.val) (cleanFullSharedSlots C) B (fun _ => PhysicalAuxLabels P C) δ D x, (fullActiveEdgeEventWeight (fun g (q : P g) => q.val) (cleanFullSharedSlots C) B (fun _ => PhysicalAuxLabels P C) δ D (fun _ aux => physicalAuxMass V C aux) (fun g => tiltedPhysicalBirthLaw V g (b g)) ρ V x e : ℂ) * (if (∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅) ∧ (∀ g i, (e.2 g).2.2.2 i ∉ F g) then Ψ c e.1 (fun g => (unrestrictedJointEventTarget (fun g (q : P g) => q.val) (δ c e.1) (D c e.1) (fun g => (cleanFullSharedSlots C g)ᶜ.card) B s e.2 g).1) else 0) * f (fullActiveEdgeEventTarget (fun g (q : P g) => q.val) (cleanFullSharedSlots C) B (fun _ => PhysicalAuxLabels P C) δ D x e) (physicalTranslateResidues rs (cleanFullSharedStep k C c e.1 d)) theorem clean_full_memory_initial_event_action {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (F : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (D : SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) C) → PhysicalAuxLabels P C → G → ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) : cleanFullMemoryInitialEventAction F V b C ζ θ ρ k D K d f = cleanFullMemoryEventAction V b C ζ θ ρ k D (cleanInitialBirthKernel F C K) d f := by funext x rs let source := (cleanFullMemoryEquiv P J ell B x).2.2.1 let c := (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 let s := (productActiveMemorySplit (cleanFullSharedSlots C) B x).2 let δ := fun c aux (_ : G) => -cleanFullSharedStep (P := P) (ell := ell) k C c aux d unfold cleanFullMemoryInitialEventAction cleanFullMemoryEventAction apply sum_congr rfl intro e _ by_cases he : ∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅ · have hi := clean_initial_birth_allowed_event_target F C (δ c e.1) (D c e.1) source s e.2 he by_cases hF : ∀ g i, (e.2 g).2.2.2 i ∉ F g · have ha := hi.mpr hF dsimp only [source, c, s, δ] at ha rw [if_pos ⟨he, hF⟩, if_pos he] simp only [cleanInitialBirthKernel] rw [if_pos ha] · have ha := mt hi.mp hF dsimp only [source, c, s, δ] at ha rw [if_neg (not_and_of_not_right _ hF), if_pos he] simp only [cleanInitialBirthKernel] rw [if_neg ha] simp only [zero_mul, mul_zero, ite_self] · rw [if_neg (not_and_of_not_left _ he), if_neg he] noncomputable def cleanFullMemoryInitialPatternEventAction {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (F : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (D : ∀ i, SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) (C i)) → PhysicalAuxLabels P (C i) → G → ℤ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (x : CleanFullMemoryState P J ell B) (rs : PhysicalResidues Ps) : ℂ := ∑ i, cleanFullMemoryInitialEventAction F V b (C i) ζ θ ρ k (D i) (K i) d f x rs theorem clean_full_memory_initial_pattern_event_action {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (F : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (D : ∀ i, SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) (C i)) → PhysicalAuxLabels P (C i) → G → ℤ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) : cleanFullMemoryInitialPatternEventAction F V b C ζ θ ρ k D K d f = cleanFullMemoryPatternEventAction V b C ζ θ ρ k D (fun i => cleanInitialBirthKernel F (C i) (K i)) d f := by funext x rs unfold cleanFullMemoryInitialPatternEventAction cleanFullMemoryPatternEventAction apply sum_congr rfl intro i _ exact congrFun (congrFun (clean_full_memory_initial_event_action F V b (C i) ζ θ ρ k (D i) (K i) d f) x) rs theorem clean_full_memory_initial_projected_action {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (F : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (D : ∀ i, SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) (C i)) → PhysicalAuxLabels P (C i) → G → ℤ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) : cleanFullMemoryActiveMap (cleanFullMemoryInitialPatternEventAction F V b C ζ θ ρ k D K d (cleanFullMemoryActiveMap f)) = cleanFullMemoryCutoff (cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction V b C ζ θ ρ k (fun i => cleanInitialBirthKernel F (C i) (K i)) d (cleanFullMemoryActiveMap (cleanFullMemoryCutoff f)))) := by rw [clean_full_memory_initial_pattern_event_action] exact clean_full_memory_projected_event_action V b C ζ θ ρ k D (fun i => cleanInitialBirthKernel F (C i) (K i)) d f hf end Bounty end section /- Signed full rows preserve memory symmetry with fixed initial avoidance and local birth factors. -/ open Finset Classical namespace Bounty section Row variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Row end Bounty end section /- The image is exactly the original performed addresses at the head operation. -/ namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) section Ghost variable (j : J) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) (tail : FullPermutationMixedPath n S B A Δ D steps (fullPermutationMixedEventTarget n S B A Δ D (some (.inl j)) s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩))) end Ghost section Edge variable (k : K) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) (tail : FullPermutationMixedPath n S B A Δ D steps (fullPermutationMixedEventTarget n S B A Δ D (some (.inr k)) s ((fullPermutationEdgeBirthEquiv (J := J) n S B A Δ D s k).symm ⟨sk, fresh⟩))) end Edge end Full end Bounty end section /- Nonprincipal harmonic Mellin cancellation for the actual exponential roughness test. -/ open Finset Filter namespace Bounty theorem eventually_exponential_rough_test_mellin_bound (hZ : PrimitiveZeroFreeHalfPlane) {γ C T : ℝ} (hγ : 0 < γ) (hC : 0 < C) (hT : 0 ≤ T) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ U V : ℝ, 1 ≤ U → 0 ≤ V → V ≤ Real.exp (C*L) → ∀ (r : ℕ), 0 < r → (r : ℝ) ≤ L^T → ∀ χ : DirichletCharacter ℂ r, χ ≠ 1 → ∀ v : ℝ, |v| ≤ L^T → ‖∑ n ∈ roughBand U V (Real.exp (γ*L)), harmonicMellinWeight v n*χ (n : ZMod r)‖ ≤ L^(-Bsave) := by classical filter_upwards [eventually_prime_mellin_band_power_bound hZ hγ hC hT (Bsave+2), eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (C+2)] with L hprime hL1 hLc have hL : 0 < L := zero_lt_one.trans_le hL1 intro U V hU hV hVmax r hr hrT χ hχ v hv by_cases hV1 : 1 ≤ V swap · have hVU : V ≤ U := by linarith simp only [roughBand, Ioc_eq_empty_of_le (Nat.floor_le_floor hVU), filter_empty, sum_empty, norm_zero] positivity let z := Real.exp (γ*L) let w := fun n : ℕ => harmonicMellinWeight v n*χ (n : ZMod r) have hwprod : ∀ p m : ℕ, 0 < p → 0 < m → w (p*m) = w p*w m := by intro p m hp hm dsimp [w] rw [Nat.cast_mul, harmonic_mellin_weight_mul v (Nat.cast_pos.mpr hp) (Nat.cast_pos.mpr hm), Nat.cast_mul, map_mul] ring have hwnorm : ∀ m : ℕ, 0 < m → ‖w m‖ ≤ 1/(m : ℝ) := by intro m hm dsimp [w] rw [norm_mul, norm_harmonic_mellin_weight v (Nat.cast_pos.mpr hm)] exact mul_le_of_le_one_right (by positivity) (χ.norm_le_one _) have hfirst : ‖∑ p ∈ primeBand (max U z) V, w p‖ ≤ L^(-(Bsave+2)) := hprime _ V (le_max_right _ _) hV hVmax r hr hrT χ hχ v hv have hinner : ∀ m ∈ roughBand 1 V z, ‖∑ p ∈ (primeBand z (m.minFac : ℝ)).filter (fun p : ℕ => U < (m : ℝ)*(p : ℝ) ∧ (m : ℝ)*(p : ℝ) ≤ V), w (p*m)‖ ≤ (1/(m : ℝ))*L^(-(Bsave+2)) := by intro m hm have hm0 := roughBand_pos hm have hmR : 0 < (m : ℝ) := Nat.cast_pos.mpr hm0 have hm1 : (1 : ℝ) ≤ m := by exact_mod_cast hm0 let P := (primeBand z (m.minFac : ℝ)).filter (fun p : ℕ => U < (m : ℝ)*(p : ℝ) ∧ (m : ℝ)*(p : ℝ) ≤ V) have hsum : (∑ p ∈ P, w (p*m)) = (∑ p ∈ P, w p)*w m := by rw [sum_mul] apply sum_congr rfl intro p hp exact hwprod p m ((mem_filter.mp (mem_filter.mp hp).1).2.pos) hm0 have hPbound : ‖∑ p ∈ P, w p‖ ≤ L^(-(Bsave+2)) := by dsimp [P] rw [primeBand_product_interval (Real.exp_pos _).le (Nat.cast_nonneg _) hmR (by linarith) hV] apply hprime _ _ (le_max_left _ _) (le_min (Nat.cast_nonneg _) (div_nonneg hV hmR.le)) _ r hr hrT χ hχ v hv exact (min_le_right _ _).trans ((div_le_self hV hm1).trans hVmax) change ‖∑ p ∈ P, w (p*m)‖ ≤ _ rw [hsum, norm_mul] have hmul := mul_le_mul hPbound (hwnorm m hm0) (norm_nonneg _) (by positivity) exact hmul.trans_eq (mul_comm _ _) have hlogV : Real.log V ≤ C*L := by simpa only [Real.log_exp] using Real.log_le_log (zero_lt_one.trans_le hV1) hVmax have hmass : (∑ m ∈ roughBand 1 V z, 1/(m : ℝ)) ≤ 1+C*L := (roughBandHarmonic_le_log hV1).trans (add_le_add le_rfl hlogV) have hscale : 2+C*L ≤ L^2 := by have hh := mul_le_mul_of_nonneg_right hLc hL.le nlinarith change ‖∑ n ∈ roughBand U V z, w n‖ ≤ _ rw [weighted_rough_band_cofactor_identity hU hV (Real.exp_pos _).le w] calc _ ≤ ‖∑ p ∈ primeBand (max U z) V, w p‖+ ‖∑ m ∈ roughBand 1 V z, ∑ p ∈ (primeBand z (m.minFac : ℝ)).filter (fun p : ℕ => U < (m : ℝ)*(p : ℝ) ∧ (m : ℝ)*(p : ℝ) ≤ V), w (p*m)‖ := norm_add_le _ _ _ ≤ L^(-(Bsave+2))+∑ m ∈ roughBand 1 V z, (1/(m : ℝ))*L^(-(Bsave+2)) := by apply add_le_add hfirst exact (norm_sum_le _ _).trans (sum_le_sum hinner) _ = (1+∑ m ∈ roughBand 1 V z, 1/(m : ℝ))*L^(-(Bsave+2)) := by rw [← sum_mul]; ring _ ≤ (2+C*L)*L^(-(Bsave+2)) := by apply mul_le_mul_of_nonneg_right _ (by positivity) linarith _ ≤ L^2*L^(-(Bsave+2)) := mul_le_mul_of_nonneg_right hscale (by positivity) _ = L^(-Bsave) := by rw [← Real.rpow_natCast L 2, ← Real.rpow_add hL] congr 1 norm_num end Bounty end section /- Order actual samples at any original owner by their unchanged global birth addresses. -/ namespace Bounty section Order variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) s) [Fintype (FullMixedEventBirthCoordinate n S B A Δ D (steps.get u) s e)] end Order section Path variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps s) (u : Fin steps.length) [Fintype (FullMixedEventBirthCoordinate n S B A Δ D (steps.get u) (fullMixedOwnerOccurrence n S B A Δ D steps s p u).1 (fullMixedOwnerOccurrence n S B A Δ D steps s p u).2)] end Path end Bounty end section /- A known event tag can use its actual local addresses at an arbitrary original schedule owner. -/ namespace Bounty section Tagged variable {J K : Type*} {N : ℕ} {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (tag : Option (J ⊕ K)) (htag : steps.get u = tag) noncomputable def fullMixedTaggedOccurrenceEmbedding : FullMixedLocalBirthAddress S B tag ↪ Fin (Fintype.card (FullMixedBirthAddress S B steps)) := (Equiv.cast (congrArg (FullMixedLocalBirthAddress S B) htag.symm)).toEmbedding.trans (fullMixedOccurrenceAddressEmbedding S B steps u) theorem full_mixed_tagged_occurrence_owner (a : FullMixedLocalBirthAddress S B tag) : fullMixedBirthOwner S B steps (fullMixedBirthOrder S B steps (fullMixedTaggedOccurrenceEmbedding S B steps u tag htag a)) = u := full_mixed_occurrence_address_owner S B steps u _ theorem full_mixed_tagged_occurrence_group (a : FullMixedLocalBirthAddress S B tag) : (fullMixedBirthOrder S B steps (fullMixedTaggedOccurrenceEmbedding S B steps u tag htag a)).2.1 = a.1 := by subst tag change (fullMixedBirthOrder S B steps ((fullMixedBirthOrder S B steps).symm ⟨u, a⟩)).2.1 = a.1 rw [Equiv.apply_symm_apply] end Tagged section Path variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (tag : Option (J ⊕ K)) (htag : steps.get u = tag) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) noncomputable def fullMixedTaggedOwnerEvent : FullPermutationMixedEvent n S B A Δ D (steps.get u) s := cast (congrArg (fun tag => FullPermutationMixedEvent n S B A Δ D tag s) htag.symm) e end Path end Bounty end section /- Both forward and reverse eligibility rarity control the full nonclean average, including arbitrary bounded coefficients. The factor four in energy is the squared sum of the two square-root rarity bounds. -/ open Finset open scoped Classical namespace Bounty section variable {A G R : Type*} [Fintype A] [Fintype G] [Fintype R] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (Δ D : A → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (t : G → ℕ) (B : ℕ) (π : A → ℝ) (τ : A → R ≃ R) end end Bounty end section /- Exact small bare / big memory factorization along a fixed original labeled path. -/ open Finset open scoped Classical namespace Bounty theorem physical_group_path_mass_subtype_factors {G : Type*} {J : ℕ} (V : G → ℝ) (groups : Finset G) (C : ℕ → G → Finset (Fin J)) (ell n : ℕ) : physicalGroupPathMass V groups C ell n = physicalStateMass (fun g : {g // g ∈ groups} => V g.val) J ell * ∏ j ∈ range n, physicalCompletionMass (fun g : {g // g ∈ groups} => V g.val) (fun g => C j g.val) ell := by rw [physical_group_path_mass_factors] congr 1 · exact prod_subtype groups (fun _ => Iff.rfl) _ · apply prod_congr rfl intro j hj exact prod_subtype groups (fun _ => Iff.rfl) _ theorem physical_group_fixed_path_factor {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (small : Finset G) (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (n : ℕ) : (physicalGroupPathMass V small (fun j => C (a j).2.2.1.val) ell n : ℂ) * physicalMemoryWalkScalar V patterns C ζ K a L n = (physicalStateMass (fun g : {g // g ∈ small} => V g.val) J ell : ℂ) * physicalBareWalkScalar (fun g : {g // g ∈ small} => V g.val) patterns (fun i g => C i g.val) (fun _ _ => 0) (fun _ _ _ _ _ => 1) (fun j => physicalRestrictedEdge (fun g => g ∈ small) patterns C (a j)) (fun j g => L j g.val) n * ∏ j ∈ range n, physicalMemoryLabeledScalar (fun g : {g // g ∉ small} => V g.val) patterns (fun i g => C i g.val) (fun _ => 0) (physicalFixedEdgeBigCoefficient (fun g => g ∈ small) patterns C (ζ (n - 1 - j)) (K (n - 1 - j)) (a j) (L j) (L (j + 1))) (physicalRestrictedEdge (fun g => g ∉ small) patterns C (a j)) (fun g => L j g.val) (fun g => L (j + 1) g.val) := by rw [physical_group_path_mass_subtype_factors] simp only [Complex.ofReal_mul, Complex.ofReal_prod, physicalMemoryWalkScalar, physicalBareWalkScalar] rw [mul_assoc, mul_assoc] congr 1 rw [← prod_mul_distrib, ← prod_mul_distrib] apply prod_congr rfl intro j hj have h := physical_partial_memory_labeled_group_factor (fun g => g ∈ small) V patterns C (ζ (n - 1 - j)) (K (n - 1 - j)) (a j) (L j) (L (j + 1)) convert h using 1 <;> congr! end Bounty end section /- A fixed stage support condition separates absent births from the actual sampled-label ties. -/ namespace Bounty def birthForestStageSupport {N L : ℕ} (owner : Fin N → Fin L) (u : Fin L) (performed : Fin N → Prop) (code : BirthForestCode N) : Prop := ∀ i, owner i = u → ∀ p, code i = some p → performed (birthForestParentEmbedding i p) ∧ performed i theorem birth_forest_stage_support_iff {N L : ℕ} {α : Type*} (owner : Fin N → Fin L) (u : Fin L) (performed : Fin N → Prop) (values : Fin N → Option α) (code : BirthForestCode N) (hperformed : ∀ i, performed i ↔ (values i).isSome = true) : birthForestStageCondition owner u values code ↔ birthForestStageSupport owner u performed code ∧ ∀ i, owner i = u → ∀ p, code i = some p → values i = values (birthForestParentEmbedding i p) := by constructor · intro h constructor · intro i hi p hp have hc := h i hi rw [hp] at hc exact ⟨(hperformed _).mpr hc.1, (hperformed _).mpr hc.2.1⟩ · intro i hi p hp have hc := h i hi rw [hp] at hc exact hc.2.2.symm · rintro ⟨hs, he⟩ i hi cases hc : code i with | none => trivial | some p => exact ⟨(hperformed _).mp (hs i hi p hc).1, (hperformed _).mp (hs i hi p hc).2, (he i hi p hc).symm⟩ theorem birth_forest_stage_support_children {N L : ℕ} (owner : Fin N → Fin L) (u : Fin L) (performed : Fin N → Prop) (code : BirthForestCode N) (h : birthForestStageSupport owner u performed code) : ∀ i, owner i = u → code i ≠ none → performed i := by intro i hi hc cases hp : code i with | none => exact False.elim (hc hp) | some p => exact (h i hi p hp).2 theorem owner_stage_support_forest_iff {N m L : ℕ} {α : Type*} (embed : Fin m → Fin N) (hstrict : StrictMono embed) (owner : Fin N → Fin L) (hmono : Monotone owner) (u : Fin L) (howner : ∀ j, owner (embed j) = u) (performed : Fin N → Prop) (hcover : ∀ i, performed i → owner i = u → i ∈ Set.range embed) (code : BirthForestCode N) (values history : Fin N → Option α) (localValues : Fin m → α) (hperformed : ∀ i, performed i ↔ (values i).isSome = true) (hlocal : ∀ j, values (embed j) = some (localValues j)) (hpast : ∀ i, owner i < u → values i = history i) : birthForestStageCondition owner u values code ↔ birthForestStageSupport owner u performed code ∧ birthForestEqualValues (restrictedBirthCode embed code) localValues ∧ birthLabelsAnchored (fun j => (restrictedBirthAnchors embed code history j).join) localValues := by rw [birth_forest_stage_support_iff owner u performed values code hperformed] apply and_congr_right intro hs apply owner_optional_forest_past_iff embed hstrict owner hmono u howner performed hcover code values history localValues hlocal (birth_forest_stage_support_children owner u performed code hs) (fun j p hp => (hs (embed j) (howner j) p hp).1) _ hpast intro i hi hn have hv := (hperformed i).mp hi rw [hn] at hv cases hv theorem restricted_join_selected_iff {N m : ℕ} {α : Type*} (embed : Fin m → Fin N) (code : BirthForestCode N) (history : Fin N → Option α) (hvalid : ∀ j, restrictedBirthAnchors embed code history j ≠ some none) (j : Fin m) : (restrictedBirthCode embed code j ≠ none ∨ (restrictedBirthAnchors embed code history j).join ≠ none) ↔ code (embed j) ≠ none := by have ha : (restrictedBirthAnchors embed code history j).join ≠ none ↔ restrictedBirthAnchors embed code history j ≠ none := by cases he : restrictedBirthAnchors embed code history j with | none => simp only [Option.join_none, ne_eq, not_true_eq_false] | some a => cases a with | none => exact False.elim (hvalid j he) | some a => simp rw [ha] exact restricted_birth_selected_iff embed code history j end Bounty end section /- Uniform convergence of normalized ordinary-prime counts on logarithmic cells. -/ open Filter Real namespace Bounty theorem eventually_normalized_prime_cell_error {a S ε : ℝ} (ha : 0 < a) (hS : 0 ≤ S) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ w : ℝ, a ≤ w → |normalizedPrimeCellCount L S (exp (w*L))-1/w| ≤ ε := by filter_upwards [eventually_ordinary_prime_logarithmic_cell_relative_error ha hS (mul_pos hε ha), eventually_gt_atTop (0 : ℝ)] with L hraw hL intro w hw have hw0 : 0 < w := ha.trans_le hw have hscale := logarithmic_cell_count_scale_pos (S := S) hL (exp_pos (w*L)) have hmain : (((exp (L^(-S))-1)*exp (w*L))/log (exp (w*L))) / logarithmicCellCountScale L S (exp (w*L)) = 1/w := by rw [log_exp] have hexp : exp (L^(-S))-1 ≠ 0 := (sub_pos.mpr (one_lt_exp_iff.mpr (rpow_pos_of_pos hL _))).ne' unfold logarithmicCellCountScale field_simp [hL.ne', hw0.ne', hexp] have hh := hraw (exp (w*L)) (exp_le_exp.mpr (mul_le_mul_of_nonneg_right hw hL.le)) calc _ = |((primeBand (exp (w*L)) (exp (L^(-S))*exp (w*L))).card : ℝ) - ((exp (L^(-S))-1)*exp (w*L))/log (exp (w*L))| / logarithmicCellCountScale L S (exp (w*L)) := by unfold normalizedPrimeCellCount rw [← hmain, ← sub_div, abs_div, abs_of_pos hscale] _ ≤ (ε*a) * ((((exp (L^(-S))-1)*exp (w*L))/log (exp (w*L))) / logarithmicCellCountScale L S (exp (w*L))) := by simpa only [mul_div_assoc] using div_le_div_of_nonneg_right hh hscale.le _ = ε*(a/w) := by rw [hmain]; ring _ ≤ ε := by apply mul_le_of_le_one_right hε.le exact (div_le_one hw0).mpr hw end Bounty end section /- Promotion support for the genuine mixed small/big model. Both endpoint memory caps remain inside the full event weight, and the small labels remain injective source lists. Eligibility is tested before auxiliary averaging. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) noncomputable def physicalSmallBigEligible (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) : Prop := ∃ g, (unrestrictedResidueEligible (n g) (Δ (physicalSharedPrefix s.1.2) (productActiveMemorySplit shared B s.2).1 g) (D (physicalSharedPrefix s.1.2) (productActiveMemorySplit shared B s.2).1 g) (s.2 g).2.2).Nonempty omit [Fintype S] [Fintype G] [dG : DecidableEq G] [∀ g, Fintype (P g)] in theorem physical_small_big_promoting_event_eligible (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (e : PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s) (he : ∃ g, (e.2.2 g).2.1.Nonempty) : physicalSmallBigEligible n shared B Δ D s := by obtain ⟨g, hg⟩ := he refine ⟨g, ?_⟩ exact unrestricted_promoting_event_eligible (n g) _ _ (shared g)ᶜ.card B ((productActiveMemorySplit shared B s.2).2 g) (e.2.2 g) hg.ne_empty theorem physical_small_big_promoting_zero (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ) (q : ℝ) (Φ : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (hno : ¬ physicalSmallBigEligible n shared B Δ D s) : physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun s e => if ∃ g, (e.2.2 g).2.1.Nonempty then Φ s e else 0) F s = 0 := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold physicalSmallBigFullPhasedAction physicalSmallBigPhasedAction apply sum_eq_zero intro e _ have he : ¬ ∃ g, (e.2.2 g).2.1.Nonempty := fun h => hno (physical_small_big_promoting_event_eligible n shared B Δ D s e h) simp only [if_neg he, mul_zero, zero_mul] end end Bounty end section /- The literal mixed positive storage row transposes to reverse promotion. The original small measure, both memory caps and all volume ratios are kept. -/ open Finset Classical namespace Bounty section variable {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) noncomputable def physicalSmallBigStoragePhase (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (_r : PhysicalResidues Ps) (e : PhysicalSmallBigFullEvent n shared B Δ D d x) : ℂ := if (∀ g, (e.2 g).2.1 = ∅) ∧ (∃ g, (e.2 g).1 ≠ ∅) then 1 else 0 noncomputable def physicalSmallBigReversePhase (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (_r : PhysicalResidues Ps) (e : PhysicalSmallBigFullEvent n shared B (fun d c g => -Δ d c g) D d x) : ℂ := ((∏ g, V g ^ (e.2 g).2.1.card / V g ^ (e.2 g).1.card : ℝ) : ℂ) * (if (∀ g, (e.2 g).1 = ∅) ∧ (∃ g, (e.2 g).2.1 ≠ ∅) then 1 else 0) noncomputable def physicalSmallBigStorageAction (Vs : S → ℝ) (q : ℝ) (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) := physicalSmallBigAction (ell := ell) Vs q 0 aux (fun _ => 1) (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullCoefficient n shared B Δ D μ ρ V (physicalSmallBigStoragePhase n shared B Δ D)) (fun x => kbig (productActiveMemorySplit shared B x).1) noncomputable def physicalSmallBigReverseAction (Vs : S → ℝ) (q : ℝ) (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) := physicalSmallBigAction (ell := ell) Vs q 0 aux (fun _ => 1) (PhysicalSmallBigFullEvent n shared B (fun d c g => -Δ d c g) D) (physicalSmallBigFullTarget n shared B (fun d c g => -Δ d c g) D) (physicalSmallBigFullCoefficient n shared B (fun d c g => -Δ d c g) D μ ρ V (physicalSmallBigReversePhase n shared B Δ D V)) (fun x => -kbig (productActiveMemorySplit shared B x).1) omit [DecidableEq S] [∀ p : PhysicalPrime Ps, NeZero p.2.val] [∀ g p, NeZero (n g p)] in theorem physical_small_big_storage_prefix_eq (F : PhysicalSharedLists Ps J → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → PhysicalResidues Ps → ℂ) (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (r : PhysicalResidues Ps) : physicalSmallBigPrefixAction (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullCoefficient n shared B Δ D μ ρ V (physicalSmallBigStoragePhase n shared B Δ D)) (fun y => kbig (productActiveMemorySplit shared B y).1) F d x r = fullActiveStorageExternal (A := fun _ => Unit) n shared B (fun c _ => Δ d c) (fun c _ => D d c) (fun _ _ => 1) μ ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct d : ℕ))) (F d) x r := by rw [physical_small_big_full_prefix_eq, full_active_storage_external_eq_sum] rfl omit [DecidableEq S] [∀ p : PhysicalPrime Ps, NeZero p.2.val] [∀ g p, NeZero (n g p)] in theorem physical_small_big_reverse_prefix_eq (F : PhysicalSharedLists Ps J → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → PhysicalResidues Ps → ℂ) (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (r : PhysicalResidues Ps) : physicalSmallBigPrefixAction (PhysicalSmallBigFullEvent n shared B (fun d c g => -Δ d c g) D) (physicalSmallBigFullTarget n shared B (fun d c g => -Δ d c g) D) (physicalSmallBigFullCoefficient n shared B (fun d c g => -Δ d c g) D μ ρ V (physicalSmallBigReversePhase n shared B Δ D V)) (fun y => -kbig (productActiveMemorySplit shared B y).1) F d x r = fullActiveReversePromotionExternal (A := fun _ => Unit) n shared B (fun c _ => Δ d c) (fun c _ => D d c) (fun _ _ => 1) μ ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct d : ℕ))) (F d) x r := by rw [physical_small_big_full_prefix_eq n shared B (fun d c g => -Δ d c g) D μ ρ V (fun c => -kbig c) (physicalSmallBigReversePhase n shared B Δ D V) F d x r, full_active_reverse_promotion_external_eq_sum] have he : (fun c (_ : Unit) => physicalResidueTranslationEquiv (P := Ps) (-kbig c * (physicalSharedProduct d : ℕ))) = (fun c (_ : Unit) => (physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct d : ℕ))).symm) := by funext c u apply Equiv.ext intro r change physicalTranslateResidues r (-kbig c * (physicalSharedProduct d : ℕ)) = physicalTranslateResidues r (-(kbig c * (physicalSharedProduct d : ℕ))) rw [neg_mul] rw [he] rfl theorem physical_small_big_storage_pairing (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (q : ℝ) (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (hV : ∀ g, V g ≠ 0) (u F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hu : ∀ s, ProductMemorySymmetric (fun x => u (s,x))) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s,x))) : (∑ s, (physicalSmallBigMeasure Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) s : ℂ) * u s * physicalSmallBigStorageAction n shared B Δ D μ ρ V kbig Vs q aux F s) = ∑ s, (physicalSmallBigMeasure Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) s : ℂ) * physicalSmallBigReverseAction n shared B Δ D μ ρ V kbig Vs q aux u s * F s := by apply physical_small_big_transpose_of_prefix_pairing Vs hVs q (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) aux intro d simp_rw [physical_small_big_storage_prefix_eq, physical_small_big_reverse_prefix_eq] exact full_active_storage_external_pairing (A := fun _ => Unit) n shared B (fun c _ => Δ d c) (fun c _ => D d c) (fun _ _ => 1) μ ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct d : ℕ))) hV (physicalSmallBigCondition Vs q u d) (physicalSmallBigCondition Vs q F d) (fun r => physical_small_big_condition_memory_symmetric Vs q u hu d r) (fun r => physical_small_big_condition_memory_symmetric Vs q F hF d r) end end Bounty end section /- Exact clean/dirty separation on the genuine mixed small-residue and big-memory row. The coefficient can depend on both small endpoints and on all big event choices; both memory cutoffs remain inside the event weight. -/ open Finset open scoped Classical namespace Bounty section variable {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (q : ℝ) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℝ) (k : X → ℤ) theorem physical_small_big_phased_add (Φ Ψ : ∀ s : PhysicalSmallBigState P J ell X, PhysicalSmallBigEvent E s → ℂ) (F : PhysicalSmallBigState P J ell X → ℂ) : physicalSmallBigPhasedAction V q E target a k (fun s e => Φ s e + Ψ s e) F = physicalSmallBigPhasedAction V q E target a k Φ F + physicalSmallBigPhasedAction V q E target a k Ψ F := by funext s simp only [physicalSmallBigPhasedAction, mul_add, add_mul, sum_add_distrib, Pi.add_apply] theorem physical_small_big_masked_norm_le_positive (hV : ∀ s, 0 < V s) (ha : ∀ r d x e, 0 ≤ a r d x e) (Q : ∀ s : PhysicalSmallBigState P J ell X, PhysicalSmallBigEvent E s → Prop) (Φ : ∀ s : PhysicalSmallBigState P J ell X, PhysicalSmallBigEvent E s → ℂ) (hΦ : ∀ s e, ‖Φ s e‖ ≤ 1) (F : PhysicalSmallBigState P J ell X → ℂ) (s : PhysicalSmallBigState P J ell X) : ‖physicalSmallBigPhasedAction V q E target a k (fun y e => if Q y e then Φ y e else 0) F s‖ ≤ (physicalSmallBigPhasedAction V q E target a k (fun y e => if Q y e then 1 else 0) (complexNormEnvelope F) s).re := by unfold physicalSmallBigPhasedAction complexNormEnvelope exact finite_masked_event_norm_le_positive_re (physicalSmallBigPositiveWeight V q E a k s) (physical_small_big_positive_weight_nonneg V hV q E a ha k s) (Q s) (Φ s) (fun e => F (physicalSmallBigTarget E target k s e)) (hΦ s) end section variable {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ) (q : ℝ) theorem physical_small_big_full_dirty_positive_split (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) : physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun _ e => if ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅) then 1 else 0) F = physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun _ e => if ∃ g, (e.2.2 g).2.1.Nonempty then 1 else 0) F + physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun _ e => if (∀ g, (e.2.2 g).2.1 = ∅) ∧ (∃ g, (e.2.2 g).1.Nonempty) then 1 else 0) F := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold physicalSmallBigFullPhasedAction rw [← physical_small_big_phased_add] congr 1 funext s e have h := finite_dirty_indicator (fun g => (e.2.2 g).1 = ∅) (fun g => (e.2.2 g).2.1 = ∅) simp only [Finset.nonempty_iff_ne_empty] convert h using 1 <;> split_ifs <;> rfl end end Bounty end section /- The arbitrary-phase mixed action already enforces its source cap. The uniform-average identity permits any finite enumeration of small-slot permutations, including the enumeration in the omission probability law. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_average_uniform {S X : Type*} [Fintype S] [dS : DecidableEq S] {Ps : S → Finset ℕ} {J ell : ℕ} (fi : Fintype (PhysicalPermutations S J ell)) (f : PhysicalSmallBigState Ps J ell X → ℂ) (s : PhysicalSmallBigState Ps J ell X) : physicalSmallBigAverage f s = ∑ σ ∈ fi.elems, ((1 / (@Fintype.card (PhysicalPermutations S J ell) fi : ℝ) : ℝ) : ℂ) * f (physicalSmallBigPermutation σ s) := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) let canon : Fintype (PhysicalPermutations S J ell) := Pi.instFintype rw [Subsingleton.elim fi canon] simp only [physicalSmallBigAverage, one_div, Complex.ofReal_inv, Complex.ofReal_natCast, mul_sum] rfl section variable {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ) (q : ℝ) (Φ : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) theorem physical_small_big_full_phased_zero_above_cap (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (hs : ¬ productTotalMemory s.2 ≤ B) : physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q Φ F s = 0 := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold physicalSmallBigFullPhasedAction physicalSmallBigPhasedAction apply sum_eq_zero intro e _ simp only [physicalSmallBigPositiveWeight, physicalSmallBigFullWeight, fullActiveEdgeEventWeight, unrestrictedJointCutoffEventWeight, productActiveMemorySplit_total_memory, hs, false_and, if_false, mul_zero, ite_self, Complex.ofReal_zero, zero_mul] end end Bounty end section /- At a fixed original auxiliary draw, the actual clean mixed row factors through the original small conditioning and the literal capped big event sum. The initial ledger tests only new fresh draws, never auxiliaries. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type*} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) noncomputable def physicalSmallBigCleanInitialPhase (initial : ∀ g, Finset (P g)) (Ψ : ∀ d x, PhysicalResidues Ps → PhysicalSmallBigFullEvent n shared B Δ D d x → ℂ) (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (r : PhysicalResidues Ps) (e : PhysicalSmallBigFullEvent n shared B Δ D d x) : ℂ := if (∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅) ∧ (∀ g i, (e.2 g).2.2.2 i ∉ initial g) then Ψ d x r e else 0 variable [dS : DecidableEq S] [∀ p : PhysicalPrime Ps, NeZero p.2.val] [∀ g p, NeZero (n g p)] theorem physical_small_big_clean_initial_pairing (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (q : ℝ) (W : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℝ) (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (initial : ∀ g, Finset (P g)) (Ψ : ∀ d x, PhysicalResidues Ps → PhysicalSmallBigFullEvent n shared B Δ D d x → ℂ) (sourceGate targetGate u F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) : (∑ s, (physicalSmallBigMeasure Vs W s : ℂ) * (starRingEnd ℂ) (u s) * physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (physicalSmallBigEndpointPhase (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (fun r d x e => physicalSmallBigCleanInitialPhase n shared B Δ D initial Ψ d x r e) (fun x => kbig (productActiveMemorySplit shared B x).1) sourceGate targetGate) F s) = ∑ d, ∑ r, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition Vs q (fun s => sourceGate s * u s) d x r) * fullActiveExternalCoefficientAction n shared B (fun _ => Unit) (fun c _ => Δ d c) (fun c _ => D d c) (fun _ _ => 1) μ ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct d : ℕ))) (physicalSmallBigCleanInitialPhase n shared B Δ D initial Ψ d) (physicalSmallBigCondition Vs q (fun s => targetGate s * F s) d) x r := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) have h := physical_small_big_gated_pairing Vs hVs q W aux (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullWeight n shared B Δ D μ ρ V) (fun r d x e => physicalSmallBigCleanInitialPhase n shared B Δ D initial Ψ d x r e) (fun x => kbig (productActiveMemorySplit shared B x).1) sourceGate targetGate u F change _ = ∑ d, ∑ r, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition Vs q (fun s => sourceGate s * u s) d x r) * physicalSmallBigPrefixAction (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullCoefficient n shared B Δ D μ ρ V (physicalSmallBigCleanInitialPhase n shared B Δ D initial Ψ)) (fun x => kbig (productActiveMemorySplit shared B x).1) (physicalSmallBigCondition Vs q (fun s => targetGate s * F s)) d x r at h simp_rw [physical_small_big_full_prefix_eq] at h exact h end end Bounty end section /- Cauchy energy on larger smooth-cutoff ranges retains the original outside factor. -/ open Finset namespace Bounty theorem typeII_energy_enlarge (E₀ N₀ E N M H : Finset ℕ) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) (hE : E₀⊆E) (hN : N₀⊆N) (hη : ∀ e∈E, ∀ n∈N, 0≤η e n) : (∑ e∈E₀, ∑ n∈N₀, η e n*‖typeIIInnerSum M H α aH e n‖^2) ≤ ∑ e∈E, ∑ n∈N, η e n*‖typeIIInnerSum M H α aH e n‖^2 := by calc _ ≤ ∑ e∈E₀, ∑ n∈N, η e n*‖typeIIInnerSum M H α aH e n‖^2 := by apply sum_le_sum intro e he exact sum_le_sum_of_subset_of_nonneg hN (fun n hn _ => mul_nonneg (hη e (hE he) n hn) (sq_nonneg _)) _ ≤ _ := sum_le_sum_of_subset_of_nonneg hE (fun e he _ => sum_nonneg (fun n hn => mul_nonneg (hη e he n hn) (sq_nonneg _))) theorem typeII_cauchy_enlarged_majorant (E₀ N₀ E N M H : Finset ℕ) (aE β α aH : ℕ → ℂ) (η : ℕ → ℕ → ℝ) (hEE : E₀⊆E) (hNN : N₀⊆N) (hE : ∀ e∈E, 0 x.2.1.1 ≠ x.2.2.1 ∧ x.2.1.1 * x.1.2 = 2 * x.1.1 * x.2.1.2 + 1 ∧ x.2.2.1 * x.1.2 = 2 * x.1.1 * x.2.2.2 + 1) noncomputable def typeIIOffCoefficient (α aH : ℕ → ℂ) (v w : ℕ × ℕ) : ℝ := (α v.1 * conj (α w.1) * aH v.2 * conj (aH w.2)).re def typeIIShiftMap (x : TypeIIOffIndex) : TypeIIShiftIndex := (((x.2.1.1 : ℤ) * x.2.2.2 - (x.2.2.1 : ℤ) * x.2.1.2, x.2.2.1 * x.2.1.2), x.2) def typeIIRecoveredE (y : TypeIIShiftIndex) : ℤ := ((y.2.2.1 : ℤ) - y.2.1.1) / (2 * y.1.1) def typeIIRecoveredN (y : TypeIIShiftIndex) : ℤ := (2 * typeIIRecoveredE y * y.2.1.2 + 1) / y.2.1.1 def typeIIRecoveredIndex (y : TypeIIShiftIndex) : TypeIIOffIndex := ((typeIIRecoveredE y |>.toNat, typeIIRecoveredN y |>.toNat), y.2) noncomputable def typeIIShiftWeight (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) (y : TypeIIShiftIndex) : ℝ := η (typeIIRecoveredE y).toNat (typeIIRecoveredN y).toNat * typeIIOffCoefficient α aH y.2.1 y.2.2 theorem mem_typeII_off_diagonal_support {E N M H : Finset ℕ} {x : TypeIIOffIndex} : x ∈ typeIIOffDiagonalSupport E N M H ↔ x.1.1 ∈ E ∧ x.1.2 ∈ N ∧ x.2.1.1 ∈ M ∧ x.2.1.2 ∈ H ∧ x.2.2.1 ∈ M ∧ x.2.2.2 ∈ H ∧ x.2.1.1 ≠ x.2.2.1 ∧ x.2.1.1 * x.1.2 = 2 * x.1.1 * x.2.1.2 + 1 ∧ x.2.2.1 * x.1.2 = 2 * x.1.1 * x.2.2.2 + 1 := by simp only [typeIIOffDiagonalSupport, mem_filter, mem_product] tauto theorem typeII_off_support_positive {E N M H : Finset ℕ} {x : TypeIIOffIndex} (hx : x ∈ typeIIOffDiagonalSupport E N M H) : 0 < x.1.1 ∧ 0 < x.1.2 ∧ 0 < x.2.1.1 ∧ 0 < x.2.2.1 := by obtain ⟨he, hn, hm, hh, hm', hh', hne, hfirst, hsecond⟩ := mem_typeII_off_diagonal_support.mp hx have hn0 : x.1.2 ≠ 0 := by intro hz; simp [hz] at hfirst have hm0 : x.2.1.1 ≠ 0 := by intro hz; simp [hz] at hfirst have hm'0 : x.2.2.1 ≠ 0 := by intro hz; simp [hz] at hsecond refine ⟨?_, Nat.pos_of_ne_zero hn0, Nat.pos_of_ne_zero hm0, Nat.pos_of_ne_zero hm'0⟩ by_contra h have he0 : x.1.1 = 0 := by omega simp only [he0, mul_zero, zero_mul, zero_add] at hfirst hsecond have hm1 := Nat.eq_one_of_mul_eq_one_right hfirst have hm'1 := Nat.eq_one_of_mul_eq_one_right hsecond exact hne (hm1.trans hm'1.symm) theorem typeII_off_diagonal_energy_eq_support (E N M H : Finset ℕ) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) : typeIIOffDiagonalEnergy E N M H η α aH = ∑ x ∈ typeIIOffDiagonalSupport E N M H, η x.1.1 x.1.2 * typeIIOffCoefficient α aH x.2.1 x.2.2 := by classical unfold typeIIOffDiagonalEnergy typeIIOffDiagonalSupport simp only [sum_filter, sum_product, mul_sum] apply sum_congr rfl intro e he apply sum_congr rfl intro n hn apply sum_congr rfl intro m hm apply sum_congr rfl intro h hh apply sum_congr rfl intro m' hm' apply sum_congr rfl intro h' hh' by_cases hoff : m ≠ m' · by_cases hfirst : m * n = 2 * e * h + 1 · by_cases hsecond : m' * n = 2 * e * h' + 1 · simp [hoff, hfirst, hsecond, typeIIEquationTerm, typeIIOffCoefficient, map_mul, mul_assoc, mul_left_comm, mul_comm] · simp [hoff, hfirst, hsecond, typeIIEquationTerm] · simp [hoff, hfirst, typeIIEquationTerm] · simp [hoff] theorem typeII_recovered_quotients {E N M H : Finset ℕ} {x : TypeIIOffIndex} (hx : x ∈ typeIIOffDiagonalSupport E N M H) : typeIIRecoveredE (typeIIShiftMap x) = (x.1.1 : ℤ) ∧ typeIIRecoveredN (typeIIShiftMap x) = (x.1.2 : ℤ) := by obtain ⟨he, hn, hm, hh, hm', hh', hne, hfirst, hsecond⟩ := mem_typeII_off_diagonal_support.mp hx have hpos := typeII_off_support_positive hx obtain ⟨k, hk, huniq⟩ := typeII_determinant_unique_nat hfirst hsecond hne have heq : typeIIRecoveredE (typeIIShiftMap x) = (x.1.1 : ℤ) := by unfold typeIIRecoveredE typeIIShiftMap dsimp rw [hk.2.2.2] exact typeII_determinant_e_quotient hk.1 hk.2.1 have hnq : typeIIRecoveredN (typeIIShiftMap x) = (x.1.2 : ℤ) := by unfold typeIIRecoveredN rw [heq] exact typeII_determinant_n_quotient (by exact_mod_cast hpos.2.2.1.ne') (by exact_mod_cast hfirst) exact ⟨heq, hnq⟩ theorem typeII_recovered_shift_map {E N M H : Finset ℕ} {x : TypeIIOffIndex} (hx : x ∈ typeIIOffDiagonalSupport E N M H) : typeIIRecoveredIndex (typeIIShiftMap x) = x := by obtain ⟨heq, hnq⟩ := typeII_recovered_quotients hx apply Prod.ext · apply Prod.ext <;> simp [typeIIRecoveredIndex, heq, hnq] · rfl theorem typeII_shift_map_injective (E N M H : Finset ℕ) : Set.InjOn typeIIShiftMap (typeIIOffDiagonalSupport E N M H) := by intro x hx y hy hxy calc x = typeIIRecoveredIndex (typeIIShiftMap x) := (typeII_recovered_shift_map hx).symm _ = typeIIRecoveredIndex (typeIIShiftMap y) := congrArg typeIIRecoveredIndex hxy _ = y := typeII_recovered_shift_map hy theorem typeII_shift_weight_map {E N M H : Finset ℕ} {x : TypeIIOffIndex} (hx : x ∈ typeIIOffDiagonalSupport E N M H) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) : typeIIShiftWeight η α aH (typeIIShiftMap x) = η x.1.1 x.1.2 * typeIIOffCoefficient α aH x.2.1 x.2.2 := by have hr := congrArg Prod.fst (typeII_recovered_shift_map hx) have he := congrArg (fun z : ℕ × ℕ => z.1) hr have hn := congrArg (fun z : ℕ × ℕ => z.2) hr unfold typeIIShiftWeight change (typeIIRecoveredE (typeIIShiftMap x)).toNat = x.1.1 at he change (typeIIRecoveredN (typeIIShiftMap x)).toNat = x.1.2 at hn rw [he, hn] rfl theorem typeII_off_diagonal_energy_eq_shift_image (E N M H : Finset ℕ) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) : typeIIOffDiagonalEnergy E N M H η α aH = ∑ y ∈ (typeIIOffDiagonalSupport E N M H).image typeIIShiftMap, typeIIShiftWeight η α aH y := by rw [sum_image (typeII_shift_map_injective E N M H)] rw [typeII_off_diagonal_energy_eq_support] apply sum_congr rfl intro x hx exact (typeII_shift_weight_map hx η α aH).symm end Bounty end section /- Literal finite events on the genuine mixed state. Edges move both small residues and small injective lists; visits change only big pending memory. The auxiliary draw and both independent active permutation choices remain part of each event. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G : Type} {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : K → Type) (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) def PhysicalSmallBigPathEvent : Option (H ⊕ K) → PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → Type _ | none, _ => PhysicalPermutations S J ell × FullActiveSlotPermutations M | some (.inl _), s => CoupledGhostEvent M B s.2 | some (.inr k), s => PhysicalMarkLists Ps J ell × FullActiveEdgeEvent n (shared k) B (fun _ => A k) (Δ k (physicalSharedPrefix s.1.2)) (D k (physicalSharedPrefix s.1.2)) s.2 noncomputable abbrev physicalSmallBigPathEventFintype [Fintype S] [Fintype G] [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k, Fintype (A k)] (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) : Fintype (PhysicalSmallBigPathEvent n shared B A Δ D tag s) := by cases tag with | none => dsimp [PhysicalSmallBigPathEvent]; infer_instance | some tag => cases tag <;> dsimp [PhysicalSmallBigPathEvent] <;> infer_instance variable [Fintype S] (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) noncomputable def physicalSmallBigPathEventTarget (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) : PhysicalSmallBigPathEvent n shared B A Δ D tag s → PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) := match tag with | none => fun e => ((s.1.1, physicalPermuteLabels e.1 s.1.2), fullActivePermutation e.2 s.2) | some (.inl _) => fun e => (s.1, coupledGhostJointEventTarget M B s.2 e) | some (.inr k) => fun e => ((physicalTranslateResidues s.1.1 (kbig k (productActiveMemorySplit (shared k) B s.2).1 e.2.1 * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ)), e.1), fullActiveEdgeEventTarget n (shared k) B (fun _ => A k) (Δ k (physicalSharedPrefix s.1.2)) (D k (physicalSharedPrefix s.1.2)) s.2 e.2) variable [Fintype G] (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) noncomputable def physicalSmallBigPathEventWeight (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) : PhysicalSmallBigPathEvent n shared B A Δ D tag s → ℝ := match tag with | none => fun e => (Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹ * fullActivePermutationWeight M e.2 | some (.inl j) => fun e => coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g => physicalGhostTermination (n g) (qghost j) ρ) (fun g => physicalGhostBirth (n g) (qghost j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B s.2 e | some (.inr k) => fun e => (if physicalSharedPrefix s.1.2 = physicalSharedPrefix e.1 then physicalCompletionMass Vs (fun _ => (∅ : Finset (Fin J))) ell * (physicalResidueVertexWeight s.1.2 (Real.sqrt qsmall) s.1.1 * physicalResidueVertexWeight e.1 (Real.sqrt qsmall) (physicalTranslateResidues s.1.1 (kbig k (productActiveMemorySplit (shared k) B s.2).1 e.2.1 * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ)))) else 0) * fullActiveEdgeEventWeight n (shared k) B (fun _ => A k) (Δ k (physicalSharedPrefix s.1.2)) (D k (physicalSharedPrefix s.1.2)) (fun _ a => ω k a) μ ρ V s.2 e.2 end end Bounty end section /- Genuine mixed rows preserve big pending-memory symmetry for signed phases invariant under the complete old-index event correspondence. Both small endpoints and every active/fresh observation may enter the coefficient. -/ open Finset Classical namespace Bounty section variable {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) noncomputable def physicalSmallBigEventMemoryReindex (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) : PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s ≃ PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) (s.1, productMemoryReindex s.2 τ) := Equiv.prodCongr (Equiv.refl _) (fullEdgeMemoryReindex n shared B (fun _ => Unit) (fun c _ => Δ (physicalSharedPrefix s.1.2) c) (fun c _ => D (physicalSharedPrefix s.1.2) c) s.2 τ) omit dG in theorem physical_small_big_reindex_weight (Vs : S → ℝ) (q : ℝ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s) : physicalSmallBigPositiveWeight Vs q (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullWeight n shared B Δ D μ ρ V) (fun x => kbig (productActiveMemorySplit shared B x).1) (s.1, productMemoryReindex s.2 τ) (physicalSmallBigEventMemoryReindex n shared B Δ D s τ e) = physicalSmallBigPositiveWeight Vs q (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullWeight n shared B Δ D μ ρ V) (fun x => kbig (productActiveMemorySplit shared B x).1) s e := by exact congrArg (fun w : ℝ => if physicalSharedPrefix s.1.2 = physicalSharedPrefix e.1 then physicalCompletionMass Vs (fun _ => (∅ : Finset (Fin J))) ell * (physicalResidueVertexWeight s.1.2 (Real.sqrt q) s.1.1 * physicalResidueVertexWeight e.1 (Real.sqrt q) (physicalTranslateResidues s.1.1 (kbig (productActiveMemorySplit shared B s.2).1 * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ)))) * w else 0) (full_edge_reindex_weight n shared B (fun _ => Unit) (fun c _ => Δ (physicalSharedPrefix s.1.2) c) (fun c _ => D (physicalSharedPrefix s.1.2) c) s.2 τ (fun _ _ => 1) μ ρ V e.2) theorem physical_small_big_reindex_test (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hF : ∀ z, ProductMemorySymmetric (fun x => F (z,x))) : F (physicalSmallBigTarget (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (fun x => kbig (productActiveMemorySplit shared B x).1) (s.1, productMemoryReindex s.2 τ) (physicalSmallBigEventMemoryReindex n shared B Δ D s τ e)) = F (physicalSmallBigTarget (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (fun x => kbig (productActiveMemorySplit shared B x).1) s e) := by exact full_edge_reindex_test n shared B (fun _ => Unit) (fun c _ => Δ (physicalSharedPrefix s.1.2) c) (fun c _ => D (physicalSharedPrefix s.1.2) c) s.2 τ e.2 (fun y => F ((physicalTranslateResidues s.1.1 (kbig (productActiveMemorySplit shared B s.2).1 * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ)), e.1), y)) (hF _) theorem physical_small_big_full_signed_memory_symmetric (Vs : S → ℝ) (q : ℝ) (Φ : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s → ℂ) (hΦ : ∀ (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s), Φ (s.1, productMemoryReindex s.2 τ) (physicalSmallBigEventMemoryReindex n shared B Δ D s τ e) = Φ s e) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hF : ∀ z, ProductMemorySymmetric (fun x => F (z,x))) : ∀ z, ProductMemorySymmetric (fun x => physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q Φ F (z,x)) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro z x g τ dsimp only refine (congrArg (fun y => physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q Φ F (z,y)) (product_memory_reindex_at x g τ)).symm.trans ?_ unfold physicalSmallBigFullPhasedAction physicalSmallBigPhasedAction rw [← (physicalSmallBigEventMemoryReindex n shared B Δ D (z,x) (Function.update (fun h => Equiv.refl (Fin (x h).2.1.val)) g τ)).sum_comp] apply sum_congr rfl intro e _ let σ := Function.update (fun h => Equiv.refl (Fin (x h).2.1.val)) g τ have hw := physical_small_big_reindex_weight n shared B Δ D μ ρ V kbig Vs q (z,x) σ e have hp := hΦ (z,x) σ e have ht := physical_small_big_reindex_test n shared B Δ D kbig (z,x) σ e F hF exact congrArg₂ (fun a b : ℂ => a * b) (congrArg₂ (fun a b : ℂ => a * b) (congrArg Complex.ofReal hw) hp) ht noncomputable def physicalSmallBigObservablePhase (Φ : PhysicalBareResidueState Ps J ell → PhysicalBareResidueState Ps J ell → (∀ g, Fin (M g) → P g) → (∀ g, Fin (M g) → P g) → (∀ g, EdgeDrawObservation (P g) (shared g)ᶜ.card) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (e : PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s) : ℂ := Φ s.1 (physicalSmallBigTarget (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (fun x => kbig (productActiveMemorySplit shared B x).1) s e).1 (fun g => (s.2 g).1) (fun g => (physicalSmallBigFullTarget n shared B Δ D (physicalSharedPrefix s.1.2) s.2 e.2 g).1) (fun g => ⟨(e.2.2 g).1, (e.2.2 g).2.1, (e.2.2 g).2.2.2⟩) omit [Fintype G] dG in theorem physical_small_big_observable_phase_reindex (Φ : PhysicalBareResidueState Ps J ell → PhysicalBareResidueState Ps J ell → (∀ g, Fin (M g) → P g) → (∀ g, Fin (M g) → P g) → (∀ g, EdgeDrawObservation (P g) (shared g)ᶜ.card) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s) : physicalSmallBigObservablePhase n shared B Δ D kbig Φ (s.1, productMemoryReindex s.2 τ) (physicalSmallBigEventMemoryReindex n shared B Δ D s τ e) = physicalSmallBigObservablePhase n shared B Δ D kbig Φ s e := by exact congrArg (fun target => Φ s.1 (physicalSmallBigTarget (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (fun x => kbig (productActiveMemorySplit shared B x).1) s e).1 (fun g => (s.2 g).1) target (fun g => ⟨(e.2.2 g).1, (e.2.2 g).2.1, (e.2.2 g).2.2.2⟩)) (funext (full_edge_reindex_active n shared B (fun _ => Unit) (fun c _ => Δ (physicalSharedPrefix s.1.2) c) (fun c _ => D (physicalSharedPrefix s.1.2) c) s.2 τ e.2)) end end Bounty end section /- The fixed compact cutoff preserves the actual allocation exactly on good tuples. -/ open Finset Filter Real namespace Bounty noncomputable def candidateCompactAllocationWeight (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (R : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) : ℝ := compactAllocationWeight (candidateAllocationRadius r) _ (fun i => log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) R take theorem candidate_compact_allocation_bounds (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (R : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) : 0 ≤ candidateCompactAllocationWeight c L r jStar x R take ∧ candidateCompactAllocationWeight c L r jStar x R take ≤ candidateAllocationWeight c L r jStar x R take := compact_allocation_weight_bounds _ _ _ _ _ _ _ theorem candidate_compact_allocation_total_mass_le_one (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (R : ℝ) : (∑ take, candidateCompactAllocationWeight c L r jStar x R take) ≤ 1 := compact_allocation_total_mass_le_one _ _ _ _ _ _ theorem eventually_candidate_compact_allocation_exact {c : ℝ} (hc : 0 < c) {r : ℕ} (hr : 6 ≤ r) : ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (R : ℝ), 0 ≤ R → R ≤ smoothAllocationInventory _ (fun i => log (candidateAllocationValue c L r jStar x i)) (candidateAllocationActive c L r jStar)+88*log L → (∀ take, candidateCompactAllocationWeight c L r jStar x R take = candidateAllocationWeight c L r jStar x R take) ∧ (∑ take, candidateCompactAllocationWeight c L r jStar x R take) = 1 := by filter_upwards [eventually_candidate_allocation_arguments_bounded hc hr] with L hargs intro jStar x R hR hcap have heq : ∀ take, candidateCompactAllocationWeight c L r jStar x R take = candidateAllocationWeight c L r jStar x R take := by intro take by_cases hpos : 0 < candidateAllocationWeight c L r jStar x R take · apply compact_allocation_eq_of_args intro i hi exact hargs jStar x R take hR hcap hpos i · have hb := candidate_compact_allocation_bounds c L r jStar x R take have hn := candidate_allocation_weight_nonneg c L r jStar x R take linarith refine ⟨heq, ?_⟩ simp only [heq, candidate_allocation_total_mass] theorem eventually_candidate_good_tuple_compact_allocation {c : ℝ} (hc : 0 < c) {r : ℕ} (hr : 6 ≤ r) : ∀ᶠ L : ℝ in atTop, ∀ (jStar P : ℕ) (hj : jStar ∈ candidateQIndices c L) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (E b : ℝ), 0 ≤ b → 1 ≤ E → exp L ≤ (P*orderedSlotProduct (candidateQSlotChoices c L r jStar) x : ℕ) → (P*(x (candidateRoughSlot c L r jStar (by omega) hj)).val : ℕ) ≤ exp (b/2*L) → log E ≤ (1-b)*L → (∀ take, candidateCompactAllocationWeight c L r jStar x (log E) take = candidateAllocationWeight c L r jStar x (log E) take) ∧ (∑ take, candidateCompactAllocationWeight c L r jStar x (log E) take) = 1 := by filter_upwards [eventually_candidate_compact_allocation_exact hc hr, eventually_ge_atTop (1 : ℝ)] with L hL hL1 intro jStar P hj x E b hb hE1 htotal hretained hE apply hL jStar x (log E) (log_nonneg hE1) have hi := candidate_allocation_inventory_of_product_bounds c L r jStar P (by omega) hj x L (b/2*L) htotal hretained have hlog := log_nonneg hL1 nlinarith [mul_nonneg hb (zero_le_one.trans hL1)] end Bounty end section /- Explicit polynomial envelope for the actual Type-II scale parameters. -/ open Filter MeasureTheory namespace Bounty noncomputable def typeIIScaleParameters (L U V E Z : ℝ) (k : ℤ) : Fin 4 → ℝ := ![L ^ 88, U / (2 * (k : ℝ) * E), Z / ((k : ℝ) * U * V), 1 / (U * V)] noncomputable def typeIIScaleEnvelopeExponent (K₀ Cz : ℝ) : ℝ := max 88 (max K₀ (max Cz 0)) theorem typeII_integer_abs_ge_one {k : ℤ} (hk : k ≠ 0) : 1 ≤ |(k : ℝ)| := by have hpos : (0 : ℤ) < |k| := abs_pos.mpr hk have h : (1 : ℤ) ≤ |k| := by omega exact_mod_cast h theorem typeII_scale_first_coefficient {L U E K₀ : ℝ} {k : ℤ} (hL : 0 < L) (hU : 0 < U) (hk : k ≠ 0) (hE : E = U * L ^ (-K₀)) : U / (2 * (k : ℝ) * E) = L ^ K₀ / (2 * (k : ℝ)) := by have hkr : (k : ℝ) ≠ 0 := by exact_mod_cast hk rw [hE, Real.rpow_neg hL.le] have hp : L ^ K₀ ≠ 0 := (Real.rpow_pos_of_pos hL K₀).ne' field_simp theorem typeII_scale_parameter_envelope {L U V E Z K₀ Cz : ℝ} {k : ℤ} (hL : 1 ≤ L) (hU : 0 < U) (hV : 0 < V) (hZ : 0 ≤ Z) (hk : k ≠ 0) (hE : E = U * L ^ (-K₀)) (hUV : 1 ≤ U * V) (hZbound : Z / (U * V) ≤ L ^ Cz) : ‖typeIIScaleParameters L U V E Z k‖ ≤ L ^ typeIIScaleEnvelopeExponent K₀ Cz := by have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL have hk1 := typeII_integer_abs_ge_one hk have hUV0 : 0 < U * V := mul_pos hU hV have ha : |U / (2 * (k : ℝ) * E)| ≤ L ^ K₀ := by rw [typeII_scale_first_coefficient hL0 hU hk hE, abs_div, abs_of_pos (Real.rpow_pos_of_pos hL0 K₀), abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] exact div_le_self (Real.rpow_nonneg hL0.le _) (by linarith) have hb : |Z / ((k : ℝ) * U * V)| ≤ L ^ Cz := by rw [abs_div, abs_of_nonneg hZ, abs_mul, abs_mul, abs_of_pos hU, abs_of_pos hV] have hd : U * V ≤ |(k : ℝ)| * U * V := by nlinarith exact (div_le_div_of_nonneg_left hZ hUV0 hd).trans hZbound have hc : |1 / (U * V)| ≤ 1 := by rw [abs_of_pos (one_div_pos.mpr hUV0)] exact div_le_self (by norm_num) hUV have hM0 : 0 ≤ typeIIScaleEnvelopeExponent K₀ Cz := by unfold typeIIScaleEnvelopeExponent exact (le_max_right Cz 0).trans ((le_max_right K₀ (max Cz 0)).trans (le_max_right 88 _)) apply (pi_norm_le_iff_of_nonneg (Real.rpow_nonneg hL0.le _)).mpr intro i fin_cases i · change ‖L ^ 88‖ ≤ _ rw [Real.norm_of_nonneg (pow_nonneg hL0.le _), ← Real.rpow_natCast] exact Real.rpow_le_rpow_of_exponent_le hL (le_max_left _ _) · change ‖U / (2 * (k : ℝ) * E)‖ ≤ _ rw [Real.norm_eq_abs] exact ha.trans (Real.rpow_le_rpow_of_exponent_le hL ((le_max_left K₀ _).trans (le_max_right 88 _))) · change ‖Z / ((k : ℝ) * U * V)‖ ≤ _ rw [Real.norm_eq_abs] exact hb.trans (Real.rpow_le_rpow_of_exponent_le hL ((le_max_left Cz 0).trans ((le_max_right K₀ _).trans (le_max_right 88 _)))) · change ‖1 / (U * V)‖ ≤ _ rw [Real.norm_eq_abs] exact hc.trans (Real.one_le_rpow hL hM0) end Bounty end section /- An arbitrary logarithmic saving for replacing the literal sharp candidate window. -/ open Finset Filter Real namespace Bounty theorem exists_candidate_sharp_smoothing_error_bound {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (A D : ℝ) : ∃ B : ℝ, 1 ≤ B ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (T : Finset ℕ) (ψ : ℕ → ℝ) (F : ℕ → ℕ → ℂ), arithmeticProductWindow 1 (exp L) ⊆ T → (∀ u ∈ T, 0 ≤ ψ u ∧ ψ u ≤ 1) → (∀ u ∈ T, u ∉ typeIIBoundaryWindow (exp L) (L^(-B)) → ψ u = if u ∈ arithmeticProductWindow 1 (exp L) then 1 else 0) → (∀ u ∈ typeIIBoundaryWindow (exp L) (L^(-B)), ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCoefficient c L q r jStar u : ℂ) * (∑ m ∈ (2*u+1).divisors, F u m)) - (∑ u ∈ T, (candidateCoefficient c L q r jStar u : ℂ) * (ψ u : ℂ) * (∑ m ∈ (2*u+1).divisors, F u m))‖ ≤ exp L * L^(-D) := by obtain ⟨B, hB, hbound⟩ := exists_candidate_boundary_divisor_test_bound hc hr hq0 hq1 A D refine ⟨B, hB, ?_⟩ filter_upwards [hbound] with L hL intro jStar T ψ F hT hψ hmatch hF have herror := finite_divisor_sharp_smoothed_difference_norm_le T (typeIIBoundaryWindow (exp L) (L^(-B))) (arithmeticProductWindow 1 (exp L)) (candidateCoefficient c L q r jStar) ψ F (candidate_coefficient_nonneg c L hq0 r jStar) hψ hmatch rw [inter_eq_right.mpr hT] at herror exact herror.trans (hL jStar F hF) end Bounty end section /- Removing a union of free-label divisibility exclusions costs the sum of reciprocal labels. -/ open Finset namespace Bounty section Endpoints variable (Q T : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (hα' : ∀ m, ‖α' m‖ ≤ A) (hβ' : ∀ p, ‖β' p‖ ≤ B) (hγ' : ∀ r, ‖γ' r‖ ≤ C) (S : Finset ℤ) (δ : ℤ) (N : ℕ) (hT : ∀ d ∈ T, d ∈ Nat.factoredNumbers Q) (hδ : ∀ d ∈ T, (d : ℤ) ∣ δ) (hS : ∀ n ∈ S, 0 ≤ n ∧ n ≤ (N : ℤ)) (hS' : ∀ n ∈ S, 0 ≤ n + δ ∧ n + δ ≤ (N : ℤ)) include hA hB hC hα hβ hγ hα' hβ' hγ' hT hδ hS hS' theorem invariant_triple_endpoint_excluded_cross_bound : (∑ n ∈ S.filter (fun n => ∃ d ∈ T, (d : ℤ) ∣ n), ‖invariantTripleEndpoint Q α β γ n.natAbs‖ * ‖invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs‖) ≤ ((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∑ d ∈ T, 1 / (d : ℝ) := by classical let f := fun n : ℤ => ‖invariantTripleEndpoint Q α β γ n.natAbs‖ * ‖invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs‖ have hpos : ∀ n, 0 ≤ f n := fun n => mul_nonneg (norm_nonneg _) (norm_nonneg _) have hpoint (n : ℤ) : (if ∃ d ∈ T, (d : ℤ) ∣ n then f n else 0) ≤ ∑ d ∈ T, if (d : ℤ) ∣ n then f n else 0 := by by_cases hn : ∃ d ∈ T, (d : ℤ) ∣ n · obtain ⟨d, hd, hdn⟩ := hn rw [if_pos ⟨d, hd, hdn⟩] calc f n = (if (d : ℤ) ∣ n then f n else 0) := (if_pos hdn).symm _ ≤ _ := single_le_sum (s := T) (f := fun (e : ℕ) => if (e : ℤ) ∣ n then f n else 0) (a := d) (fun e _ => by split_ifs <;> positivity) hd · rw [if_neg hn] exact sum_nonneg (fun d _ => by split_ifs <;> positivity) change (∑ n ∈ S.filter (fun n => ∃ d ∈ T, (d : ℤ) ∣ n), f n) ≤ _ rw [sum_filter] calc _ ≤ ∑ n ∈ S, ∑ d ∈ T, if (d : ℤ) ∣ n then f n else 0 := sum_le_sum (fun n _ => hpoint n) _ = ∑ d ∈ T, ∑ n ∈ S.filter (fun n => (d : ℤ) ∣ n), f n := by rw [sum_comm] simp only [sum_filter] _ ≤ ∑ d ∈ T, (A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15 / d := by apply sum_le_sum intro d hd exact invariant_triple_endpoint_cross_multiples Q α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' (S.filter (fun n => (d : ℤ) ∣ n)) δ d N (hT d hd) (hδ d hd) (fun n hn => (mem_filter.mp hn).2) (fun n hn => hS n (mem_filter.mp hn).1) (fun n hn => hS' n (mem_filter.mp hn).1) _ = _ := by rw [mul_sum] apply sum_congr rfl intro d _ ring theorem invariant_triple_endpoint_exclusion_error {Y K : ℝ} (hY : 0 < Y) (hK : 0 ≤ K) (hYlow : ∀ n ∈ S, Y ≤ (n : ℝ)) (w : ℤ → ℂ) (hw : ∀ n ∈ S, ‖w n‖ ≤ K) : let f := fun n : ℤ => (w n / (n : ℂ)) * star (invariantTripleEndpoint Q α β γ n.natAbs) * invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs ‖(∑ n ∈ S, f n) - ∑ n ∈ S.filter (fun n => ¬ ∃ d ∈ T, (d : ℤ) ∣ n), f n‖ ≤ (K / Y) * ((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∑ d ∈ T, 1 / (d : ℝ) := by classical dsimp only let bad := fun n : ℤ => ∃ d ∈ T, (d : ℤ) ∣ n let f := fun n : ℤ => (w n / (n : ℂ)) * star (invariantTripleEndpoint Q α β γ n.natAbs) * invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs have heq : (∑ n ∈ S, f n) - ∑ n ∈ S.filter (fun n => ¬ bad n), f n = ∑ n ∈ S.filter bad, f n := by apply sub_eq_iff_eq_add.mpr exact (sum_filter_add_sum_filter_not S bad f).symm change ‖(∑ n ∈ S, f n) - ∑ n ∈ S.filter (fun n => ¬ bad n), f n‖ ≤ _ rw [heq] apply (norm_sum_le _ _).trans calc _ ≤ ∑ n ∈ S.filter bad, (K / Y) * (‖invariantTripleEndpoint Q α β γ n.natAbs‖ * ‖invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs‖) := by apply sum_le_sum intro n hn have hnS := (mem_filter.mp hn).1 have hn0 : (0 : ℝ) < n := hY.trans_le (hYlow n hnS) have hnC : ‖(n : ℂ)‖ = (n : ℝ) := by rw [← Complex.ofReal_intCast, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hn0] dsimp only [f] rw [norm_mul, norm_mul, norm_div, norm_star, hnC, mul_assoc] exact mul_le_mul_of_nonneg_right (div_le_div₀ hK (hw n hnS) hY (hYlow n hnS)) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) _ = (K / Y) * ∑ n ∈ S.filter bad, ‖invariantTripleEndpoint Q α β γ n.natAbs‖ * ‖invariantTripleEndpoint Q α' β' γ' (n + δ).natAbs‖ := (mul_sum ..).symm _ ≤ _ := by rw [mul_assoc] exact mul_le_mul_of_nonneg_left (invariant_triple_endpoint_excluded_cross_bound Q T α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' S δ N hT hδ hS hS') (div_nonneg hK hY.le) end Endpoints end Bounty end section /- Exact Bochner integral separation of the original root-weighted physical pairing. -/ open Finset MeasureTheory namespace Bounty noncomputable def physicalMellinPairing {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (f g : ℤ → ℂ) (X Z v : ℝ) : ℂ := inner ℂ (physicalEndpointVector P V J ell q positions (physicalMellinSource X Z v f)) (physicalHilbertOperator V patterns C q (fun i => ζ i - v) k K positions (physicalEndpointVector P V J ell q positions g)) theorem physical_mellin_root_eq_integral {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (hP : ∀ g p, p ∈ P g → 0 < p) (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (f g : ℤ → ℂ) (hsource : ∀ n ∈ positions, f n ≠ 0 → 0 < n) (X Z : ℝ) (hX : X ≠ 0) (hZ : 0 < Z) (ρ : ℝ → ℂ) (ν : ℝ → ℝ) (hρ : Integrable ρ) (hν : Continuous ν) (Ψ : ℝ → ℂ) (hΨ : ∀ t : ℝ, 0 < t → Ψ t = ∫ v : ℝ, ρ v * physicalMellinPhase (ν v) t) : physicalMellinRootCorrelation V patterns C q ζ k K positions f g Ψ Z = (X : ℂ)⁻¹ * ∫ v : ℝ, ρ v * physicalMellinPairing V patterns C q ζ k K positions f g X Z (ν v) := by classical let c := physicalMellinAtomCoefficient V patterns C q ζ k K positions f g let t := fun a : PhysicalMellinAtom P J ell patterns C positions => physicalMellinAtomArgument Z a have he := finite_mellin_sum_representation univ ρ ν hρ hν c t Ψ (by intro a _ ha apply hΨ have hf : f a.1.val.1 ≠ 0 := by intro hf exact ha (physical_mellin_atom_coefficient_zero V patterns C q ζ k K positions f g a hf) exact physical_mellin_atom_argument_pos hZ hP a (hsource _ ((mem_physical_cutoff P J ell positions a.1.val).mp a.1.property) hf)) have hi : (∫ v : ℝ, ρ v * physicalMellinPairing V patterns C q ζ k K positions f g X Z (ν v)) = (X : ℂ) * ((physicalStateMass V J ell : ℂ) * ∫ v : ℝ, ρ v * ∑ a, c a * physicalMellinPhase (ν v) (t a)) := by calc _ = ∫ v : ℝ, (X : ℂ) * ((physicalStateMass V J ell : ℂ) * (ρ v * ∑ a, c a * physicalMellinPhase (ν v) (t a))) := by apply integral_congr_ae exact Filter.Eventually.of_forall (fun v => by dsimp only [physicalMellinPairing] rw [physical_mellin_pairing_atoms hP V hV patterns C hq ζ k K positions f g hsource X Z (ν v) (ne_of_gt hZ)] dsimp only [c, t] ring) _ = _ := by rw [integral_const_mul, integral_const_mul] rw [physical_mellin_root_as_atoms] change (physicalStateMass V J ell : ℂ) * (∑ a, c a * Ψ (t a)) = _ rw [he, hi] have hXc : (X : ℂ) ≠ 0 := by exact_mod_cast hX rw [inv_mul_cancel_left₀ hXc] end Bounty end section /- Smoothing precision is chosen before the Fourier truncation precision. -/ open Filter MeasureTheory namespace Bounty theorem typeII_window_fourier_polynomial_cost {B : ℝ} (hB : 0 ≤ B) : ∃ H : ℝ, 0 < H ∧ ∀ᶠ L : ℝ in atTop, (∫ ξ : ℝ, ‖typeIIWindowFourier (L ^ B) ξ‖) ≤ L ^ H := by obtain ⟨d, C, hC, hb⟩ := typeII_window_fourier_l1_polynomial refine ⟨B * d + 1, by positivity, ?_⟩ filter_upwards [eventually_ge_atTop (max 1 (C * 2 ^ d))] with L hL have hL1 : 1 ≤ L := (le_max_left _ _).trans hL have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL1 have hCL : C * 2 ^ d ≤ L := (le_max_right _ _).trans hL have hp : ‖L ^ B‖ ≤ L ^ B := by rw [Real.norm_eq_abs, abs_of_pos (Real.rpow_pos_of_pos hL0 B)] have hw : (1 + |L ^ B|) ^ d ≤ 2 ^ d * L ^ (B * d) := by simpa only [Real.norm_eq_abs] using parameter_weight_le_power hL1 hB hp d calc _ ≤ C * (1 + |L ^ B|) ^ d := hb _ _ ≤ C * (2 ^ d * L ^ (B * d)) := mul_le_mul_of_nonneg_left hw hC _ = (C * 2 ^ d) * L ^ (B * d) := by ring _ ≤ L * L ^ (B * d) := mul_le_mul_of_nonneg_right hCL (Real.rpow_nonneg hL0.le _) _ = L ^ (B * d + 1) := by rw [Real.rpow_add hL0, Real.rpow_one]; ring theorem typeII_window_smoothing_power_cutoff {B D : ℝ} (hB : 0 ≤ B) (hD : 0 ≤ D) : ∃ F : ℝ, 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ s : ℝ, ‖(typeIIWindowSmooth (L ^ (-B)) (Real.exp s) : ℂ) - ∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ L ^ F}, typeIIWindowFourierIntegrand (L ^ B) s ξ‖ ≤ L ^ (-D) := by obtain ⟨d, C, hC, hb⟩ := typeII_window_fourier_truncation_polynomial 1 let F : ℝ := B * d + D + 1 refine ⟨F, by dsimp [F]; positivity, ?_⟩ filter_upwards [eventually_ge_atTop (max 1 (C * 2 ^ d))] with L hL have hL1 : 1 ≤ L := (le_max_left _ _).trans hL have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL1 have hCL : C * 2 ^ d ≤ L := (le_max_right _ _).trans hL have hp : ‖L ^ B‖ ≤ L ^ B := by rw [Real.norm_eq_abs, abs_of_pos (Real.rpow_pos_of_pos hL0 B)] have hw : (1 + |L ^ B|) ^ d ≤ 2 ^ d * L ^ (B * d) := by simpa only [Real.norm_eq_abs] using parameter_weight_le_power hL1 hB hp d have hid : (L ^ (-B))⁻¹ = L ^ B := by rw [Real.rpow_neg hL0.le, inv_inv] have hδ : 0 < L ^ (-B) := Real.rpow_pos_of_pos hL0 _ intro s have heq := typeII_window_log_cutoff_eq_smooth hδ s rw [hid] at heq rw [← heq] have hpower : 0 ≤ (L ^ F) ^ (-(1 : ℝ)) := Real.rpow_nonneg (Real.rpow_nonneg hL0.le _) _ calc _ ≤ C * (1 + |L ^ B|) ^ d * (L ^ F) ^ (-(1 : ℝ)) := by simpa only [Nat.cast_one] using hb (L ^ B) (L ^ F) (Real.rpow_pos_of_pos hL0 F) s _ ≤ C * (2 ^ d * L ^ (B * d)) * (L ^ F) ^ (-(1 : ℝ)) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hw hC.le) hpower _ = (C * 2 ^ d) * (L ^ (B * d) * (L ^ F) ^ (-(1 : ℝ))) := by ring _ ≤ L * (L ^ (B * d) * (L ^ F) ^ (-(1 : ℝ))) := mul_le_mul_of_nonneg_right hCL (mul_nonneg (Real.rpow_nonneg hL0.le _) hpower) _ = L ^ (-D) := by rw [← Real.rpow_mul hL0.le, mul_neg_one, ← Real.rpow_add hL0] conv_lhs => lhs; rw [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 dsimp [F] ring theorem typeII_window_mellin_power_cutoff {B D : ℝ} (hB : 0 ≤ B) (hD : 0 ≤ D) : ∃ F : ℝ, 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ e h x : ℝ, 0 < e → 0 < h → 0 < x → ‖(typeIIWindowSmooth (L ^ (-B)) (e * h / x) : ℂ) - ∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ L ^ F}, ((x : ℂ) ^ (-((2 * Real.pi * ξ : ℝ) : ℂ) * Complex.I) * (e : ℂ) ^ (((2 * Real.pi * ξ : ℝ) : ℂ) * Complex.I) * (h : ℂ) ^ (((2 * Real.pi * ξ : ℝ) : ℂ) * Complex.I)) * typeIIWindowFourier (L ^ B) ξ‖ ≤ L ^ (-D) := by obtain ⟨F, hF, hf⟩ := typeII_window_smoothing_power_cutoff hB hD refine ⟨F, hF, ?_⟩ filter_upwards [hf] with L hL intro e h x he hh hx have harg : 0 < e * h / x := div_pos (mul_pos he hh) hx have ht := hL (Real.log (e * h / x)) rw [Real.exp_log harg] at ht convert ht using 2 congr 1 apply integral_congr_ae filter_upwards [] with ξ unfold typeIIWindowFourierIntegrand rw [typeII_window_mellin_phase he hh hx ξ] end Bounty end section /- Finite weighted Mellin sums and their exact integral linearity. -/ open Finset MeasureTheory namespace Bounty noncomputable def candidateWindowMellinKernel (L : ℝ) (u : ℕ) (ξ : ℝ) : ℂ := (Real.exp L : ℂ) ^ (-((2*Real.pi*ξ : ℝ) : ℂ)*Complex.I) * (u : ℂ) ^ (((2*Real.pi*ξ : ℝ) : ℂ)*Complex.I) theorem candidate_window_mellin_kernel_eq_exp (L : ℝ) {u : ℕ} (hu : 0 < u) (ξ : ℝ) : candidateWindowMellinKernel L u ξ = Complex.exp (((2*Real.pi*ξ*Real.log ((u:ℝ)/Real.exp L) : ℝ) : ℂ)*Complex.I) := by have h := typeII_window_mellin_phase (e := (u:ℝ)) (h := 1) (x := Real.exp L) (by exact_mod_cast hu) (by norm_num) (Real.exp_pos L) ξ simpa only [mul_one, Complex.ofReal_natCast, Complex.ofReal_one, Complex.one_cpow, candidateWindowMellinKernel] using h.symm theorem candidate_window_mellin_kernel_integrable (L B : ℝ) {u : ℕ} (hu : 0 < u) : Integrable (fun ξ : ℝ => candidateWindowMellinKernel L u ξ * typeIIWindowFourier (L^B) ξ) := by apply (typeII_window_fourier_integrand_integrable (L^B) (Real.log ((u:ℝ)/Real.exp L))).congr apply Filter.Eventually.of_forall intro ξ dsimp only rw [candidate_window_mellin_kernel_eq_exp L hu] rfl noncomputable def finiteWindowMellinIntegrand (L B : ℝ) (S : Finset ℕ) (a G : ℕ → ℂ) (ξ : ℝ) : ℂ := ∑ u ∈ S, a u * (candidateWindowMellinKernel L u ξ * typeIIWindowFourier (L^B) ξ) * G u section variable (L B : ℝ) (S : Finset ℕ) (a G : ℕ → ℂ) include L B S a G theorem finite_window_mellin_integrand_separated (ξ : ℝ) : finiteWindowMellinIntegrand L B S a G ξ = (Real.exp L : ℂ)^(-((2*Real.pi*ξ : ℝ):ℂ)*Complex.I) * typeIIWindowFourier (L^B) ξ * ∑ u ∈ S, a u * (u:ℂ)^(((2*Real.pi*ξ : ℝ):ℂ)*Complex.I) * G u := by simp only [finiteWindowMellinIntegrand, candidateWindowMellinKernel, mul_sum] apply sum_congr rfl intro u hu ring theorem finite_window_mellin_integrable (hS : ∀ u ∈ S, 0 < u) : Integrable (finiteWindowMellinIntegrand L B S a G) := by apply integrable_finsetSum intro u hu exact ((candidate_window_mellin_kernel_integrable L B (hS u hu)).const_mul (a u)).mul_const (G u) theorem finite_window_mellin_setIntegral (hS : ∀ u ∈ S, 0 < u) (E : Set ℝ) : (∫ ξ in E, finiteWindowMellinIntegrand L B S a G ξ) = ∑ u ∈ S, a u * (∫ ξ in E, candidateWindowMellinKernel L u ξ * typeIIWindowFourier (L^B) ξ) * G u := by unfold finiteWindowMellinIntegrand rw [integral_finsetSum] · apply sum_congr rfl intro u hu rw [integral_mul_const, integral_const_mul] · intro u hu exact (((candidate_window_mellin_kernel_integrable L B (hS u hu)).const_mul (a u)).mul_const (G u)).integrableOn end theorem finite_window_mellin_error_le (L B : ℝ) (S : Finset ℕ) (a G ψ : ℕ → ℂ) (hS : ∀ u ∈ S, 0 < u) (E : Set ℝ) (ε : ℝ) (hε : ∀ u ∈ S, ‖ψ u - (∫ ξ in E, candidateWindowMellinKernel L u ξ * typeIIWindowFourier (L^B) ξ)‖ ≤ ε) : ‖(∑ u ∈ S, a u * ψ u * G u) - (∫ ξ in E, finiteWindowMellinIntegrand L B S a G ξ)‖ ≤ ε * ∑ u ∈ S, ‖a u‖ * ‖G u‖ := by rw [finite_window_mellin_setIntegral L B S a G hS E, ← sum_sub_distrib] calc _ ≤ ∑ u ∈ S, ‖a u * ψ u * G u - a u * (∫ ξ in E, candidateWindowMellinKernel L u ξ * typeIIWindowFourier (L^B) ξ) * G u‖ := norm_sum_le _ _ _ ≤ ∑ u ∈ S, ε * (‖a u‖ * ‖G u‖) := by apply sum_le_sum intro u hu rw [show a u * ψ u * G u - a u * (∫ ξ in E, candidateWindowMellinKernel L u ξ * typeIIWindowFourier (L^B) ξ) * G u = a u * (ψ u - (∫ ξ in E, candidateWindowMellinKernel L u ξ * typeIIWindowFourier (L^B) ξ)) * G u by ring, norm_mul, norm_mul] have hh := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hε u hu) (norm_nonneg (a u))) (norm_nonneg (G u)) nlinarith only [hh] _ = _ := (mul_sum ..).symm end Bounty end section /- Only exact original performed births occupy the common event slots; shared active slots add no spurious births. -/ open Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) end Full end Bounty end section /- A coefficient that uses only designated big divisor pools is unchanged by a small prime. -/ open Finset namespace Bounty end Bounty end section /- Local additive Fourier energy reduces to the actual logarithmic convolution energy. -/ open Finset MeasureTheory namespace Bounty theorem local_additive_convolution_dyadic_support (S : Finset ℕ) (a : ℕ → ℂ) {Y H v : ℝ} (_hY : 0 < Y) (hH : 0 < H) (hsmall : H ≤ Y/8) (hS : ∀ n ∈ S, Y ≤ (n:ℝ) ∧ (n:ℝ) ≤ 2*Y) (hv : v ∉ Set.Icc (Y/2) (3*Y)) : localAdditiveConvolution S a H v = 0 := by unfold localAdditiveConvolution apply sum_eq_zero intro n hn have hz : localMellinKernelSchwartz (((n:ℝ)-v)/H) = 0 := by apply local_mellin_kernel_unit_support apply lt_of_not_ge intro hb rw [abs_div, abs_of_pos hH] at hb have ht := abs_le.mp ((div_le_one hH).mp hb) apply hv constructor <;> linarith [(hS n hn).1, (hS n hn).2, ht.1, ht.2] rw [hz, mul_zero] theorem local_log_convolution_continuousOn (S : Finset ℕ) (a : ℕ → ℂ) (hS : ∀ n ∈ S, 0 < n) {Y : ℝ} (hY : 0 < Y) (H : ℝ) : ContinuousOn (localLogConvolution S a H) (Set.Icc (Y/2) (3*Y)) := by have hv : ∀ v ∈ Set.Icc (Y/2) (3*Y), v ≠ 0 := by intro v hv have : 0 < v := by linarith [hv.1] exact this.ne' apply continuousOn_finsetSum intro n hn apply continuousOn_const.mul apply localMellinKernelSchwartz.continuous.comp_continuousOn apply ContinuousOn.div_const apply continuousOn_id.mul apply ContinuousOn.log · exact continuousOn_const.div continuousOn_id hv · intro v hv' exact div_ne_zero (by exact_mod_cast (hS n hn).ne') (hv v hv') theorem local_convolution_difference (S : Finset ℕ) (a : ℕ → ℂ) (H v : ℝ) : localAdditiveConvolution S a H v - localLogConvolution S a H v = ∑ n ∈ S, a n * (localMellinKernelSchwartz (((n:ℝ)-v)/H) - localMellinKernelSchwartz (v*Real.log ((n:ℝ)/v)/H)) := by simp only [localAdditiveConvolution, localLogConvolution, mul_sub, sum_sub_distrib] theorem exists_local_fourier_log_energy_constant : ∃ C : ℝ, 0 < C ∧ ∀ (S : Finset ℕ) (a : ℕ → ℂ) (Y H : ℝ), 0 < Y → 1 ≤ H → H ≤ Y/8 → (∀ n ∈ S, Y ≤ (n:ℝ) ∧ (n:ℝ) ≤ 2*Y) → (∫ β in {β : ℝ | |β| ≤ 1/H}, ‖localAdditivePolynomial S a β‖^2) ≤ (8/H^2) * (∫ v in Set.Icc (Y/2) (3*Y), ‖localLogConvolution S a H v‖^2) + C * (H/Y)^2 * (∑ n ∈ S, ‖a n‖^2) := by obtain ⟨C, hC, herr⟩ := exists_actual_local_kernel_error_constant refine ⟨8*C, by positivity, ?_⟩ intro S a Y H hY hH hsmall hS have hHp : 0 < H := lt_of_lt_of_le zero_lt_one hH have hSpos : ∀ n ∈ S, 0 < n := by intro n hn exact_mod_cast hY.trans_le (hS n hn).1 have hla := local_additive_convolution_contDiff S a H have hll := local_log_convolution_continuousOn S a hSpos hY H have hlaInt : IntegrableOn (fun v => ‖localAdditiveConvolution S a H v‖^2) (Set.Icc (Y/2) (3*Y)) := (hla.continuous.norm.pow 2).integrableOn_Icc have hllInt : IntegrableOn (fun v => ‖localLogConvolution S a H v‖^2) (Set.Icc (Y/2) (3*Y)) := (hll.norm.pow 2).integrableOn_Icc have hdInt : IntegrableOn (fun v => ‖localAdditiveConvolution S a H v-localLogConvolution S a H v‖^2) (Set.Icc (Y/2) (3*Y)) := ((hla.continuous.continuousOn.sub hll).norm.pow 2).integrableOn_Icc have htri (v : ℝ) : ‖localAdditiveConvolution S a H v‖^2 ≤ 2*‖localLogConvolution S a H v‖^2 + 2*‖localAdditiveConvolution S a H v-localLogConvolution S a H v‖^2 := by have hn := norm_add_le (localLogConvolution S a H v) (localAdditiveConvolution S a H v-localLogConvolution S a H v) have he : localLogConvolution S a H v + (localAdditiveConvolution S a H v-localLogConvolution S a H v) = localAdditiveConvolution S a H v := by abel rw [he] at hn have hs := pow_le_pow_left₀ (norm_nonneg _) hn 2 nlinarith [sq_nonneg (‖localLogConvolution S a H v‖- ‖localAdditiveConvolution S a H v-localLogConvolution S a H v‖)] have hti := integral_mono hlaInt ((hllInt.const_mul 2).add (hdInt.const_mul 2)) htri simp only [Pi.add_apply] at hti rw [integral_add (hllInt.const_mul 2) (hdInt.const_mul 2), integral_const_mul, integral_const_mul] at hti have he := herr S a hSpos Y H hY hH hsmall simp_rw [← local_convolution_difference S a H] at he have heq : (∫ v : ℝ, ‖localAdditiveConvolution S a H v‖^2) = ∫ v in Set.Icc (Y/2) (3*Y), ‖localAdditiveConvolution S a H v‖^2 := by symm apply setIntegral_eq_integral_of_forall_compl_eq_zero intro v hv rw [local_additive_convolution_dyadic_support S a hY hHp hsmall hS hv, norm_zero, zero_pow (by decide)] apply (local_fourier_energy_le_convolution S a hHp).trans rw [heq] calc _ ≤ (4/H^2) * (2*(∫ v in Set.Icc (Y/2) (3*Y), ‖localLogConvolution S a H v‖^2) + 2*(∫ v in Set.Icc (Y/2) (3*Y), ‖localAdditiveConvolution S a H v-localLogConvolution S a H v‖^2)) := mul_le_mul_of_nonneg_left hti (by positivity) _ = (8/H^2)*(∫ v in Set.Icc (Y/2) (3*Y), ‖localLogConvolution S a H v‖^2) + 8*((∫ v in Set.Icc (Y/2) (3*Y), ‖localAdditiveConvolution S a H v-localLogConvolution S a H v‖^2)/H^2) := by ring _ ≤ (8/H^2)*(∫ v in Set.Icc (Y/2) (3*Y), ‖localLogConvolution S a H v‖^2) + 8*(C*(H/Y)^2*(∑ n ∈ S, ‖a n‖^2)) := by linarith _ = _ := by ring end Bounty end section /- The square-error estimate for the actual ordered-list coefficient on big groups. -/ open Finset open scoped Classical namespace Bounty theorem weighted_small_mark_extraction_error_energy {G : Type*} [Fintype G] (P : G → Finset ℕ) {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (V : G → ℝ) (t : G → ℕ) (T : ℕ) (hV : ∀ g, v ≤ V g) (ht : ∀ g, t g ≤ T) (hprime : ∀ g, ∀ p ∈ P g, p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (k : ℕ) (htg : t g = k + 1) (big : Finset G) (hsmall : g ∉ big) (b : GroupMarkedLists (fun h : big => P h.val) (fun h : big => t h.val) → ℂ) {H : ℝ} (hH : 0 ≤ H) (hb : ∀ L, ‖b L‖ ≤ H) (Q : Finset ℕ) (hQ : P g ⊆ Q) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (positions : Finset ℕ) (N : ℕ) (hpos : ∀ n ∈ positions, 0 < n ∧ n ≤ N) : let c := fun n : ℕ => groupMarkedAverage (fun h : big => P h.val) (fun h : big => t h.val) (n : ℤ) b (∑ n ∈ positions, ‖weightedGroupMarkedSum P q V t (n : ℤ) (fun L => b (fun h : big => L h.val)) * invariantTripleEndpoint Q α β γ n - markedPrimePeel univ P q V t g k (fun m => c m * invariantTripleEndpoint Q α β γ m) n‖ ^ 2) ≤ H ^ 2 * (((markedDivisorBound q v T) ^ Fintype.card G * (1 + 2 * Real.log N / v)) ^ 2 * (((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∑ p ∈ P g, 1 / (p : ℝ) ^ 2)) := by classical dsimp only have hc (n : ℕ) : ‖groupMarkedAverage (fun h : big => P h.val) (fun h : big => t h.val) (n : ℤ) b‖ ≤ H := group_marked_average_norm_le _ _ _ b hH (fun L => hb L.val) have hinv (n p : ℕ) (hp : p ∈ P g) (hpn : p ∣ n) := group_marked_selected_average_div_prime P t big (fun h _ => hprime h) hdis g hsmall hp (hprime g p hp) hpn b have h := invariant_marked_coefficient_peel_error_energy univ P hq0 hq1 hv V t T (fun h _ => hV h) (fun h _ => ht h) (fun h _ => hprime h) hdis g (mem_univ g) k htg Q hQ α β γ hA hB hC hα hβ hγ positions N hpos (fun n => groupMarkedAverage (fun h : big => P h.val) (fun h : big => t h.val) (n : ℤ) b) (fun n _ => hc n) (fun n _ p hp hpn => hinv n p hp hpn) simpa only [weighted_group_marked_sum_selected_average, mul_assoc, card_univ] using h end Bounty end section /- Move both genuine big-active projections through the exact conditioned pairing. The endpoint gates remain inside conditioning. This is an identity, with no operator-norm premise. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_big_projected_pairing {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {J ell : ℕ} {M : G → ℕ} {B : ℕ} (Vs : S → ℝ) (q : ℝ) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (sourceGate targetGate : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (hsg : ∀ s (τ : FullActiveSlotPermutations M), sourceGate (s.1, fullActivePermutation τ s.2) = sourceGate s) (htg : ∀ s (τ : FullActiveSlotPermutations M), targetGate (s.1, fullActivePermutation τ s.2) = targetGate s) (T : (PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) → PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (A : PhysicalSharedLists Ps J → (ProductBoundedOrderedState P Z M B → PhysicalResidues Ps → ℂ) → ProductBoundedOrderedState P Z M B → PhysicalResidues Ps → ℂ) (hpair : ∀ u f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ, (∑ s, (physicalSmallBigMeasure Vs (productMemoryWeight μ ν) s : ℂ) * (starRingEnd ℂ) (u s) * T f s) = ∑ d, ∑ r, ∑ x, (productMemoryWeight μ ν x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition Vs q (fun s => sourceGate s * u s) d x r) * A d (physicalSmallBigCondition Vs q (fun s => targetGate s * f s) d) x r) (u f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) : (∑ s, (physicalSmallBigMeasure Vs (productMemoryWeight μ ν) s : ℂ) * (starRingEnd ℂ) (u s) * physicalSmallBigBigAverage (T (physicalSmallBigBigAverage f)) s) = ∑ d, ∑ r, ∑ x, (productMemoryWeight μ ν x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition Vs q (fun s => sourceGate s * u s) d x r) * fullActiveAverage (fun y => A d (fun z rs => fullActiveAverage (fun w => physicalSmallBigCondition Vs q (fun s => targetGate s * f s) d w rs) z) y r) x := by rw [physical_small_big_big_average_self_adjoint, hpair] have hs : (fun s => sourceGate s * physicalSmallBigBigAverage u s) = physicalSmallBigBigAverage (fun s => sourceGate s * u s) := by funext s exact physical_small_big_gate_big_average sourceGate u hsg s have ht : (fun s => targetGate s * physicalSmallBigBigAverage f s) = physicalSmallBigBigAverage (fun s => targetGate s * f s) := by funext s exact physical_small_big_gate_big_average targetGate f htg s rw [hs, ht] have htc : physicalSmallBigCondition Vs q (physicalSmallBigBigAverage (fun s => targetGate s * f s)) = fun d x r => fullActiveAverage (fun y => physicalSmallBigCondition Vs q (fun s => targetGate s * f s) d y r) x := by funext d x r exact physical_small_big_condition_big_average Vs q _ d x r rw [htc] simp_rw [physical_small_big_condition_big_average] apply sum_congr rfl intro d _ apply sum_congr rfl intro r _ exact (fullActiveAverage_self_adjoint μ ν (fun x => physicalSmallBigCondition Vs q (fun s => sourceGate s * u s) d x r) (fun y => A d (fun z rs => fullActiveAverage (fun w => physicalSmallBigCondition Vs q (fun s => targetGate s * f s) d w rs) z) y r)).symm end Bounty end section /- The independent small and big averages commute. No endpoint gate is moved through the small average in this identity. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type*} [sharedInstance1 : Fintype S] [sharedInstance2 : DecidableEq S] [sharedInstance3 : Fintype G] [sharedInstance4 : DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell : ℕ} {M : G → ℕ} {B : ℕ} (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) include S G sharedInstance1 sharedInstance2 sharedInstance3 sharedInstance4 Ps P Z J ell M B f theorem physical_small_big_averages_commute : physicalSmallBigAverage (physicalSmallBigBigAverage f) = physicalSmallBigBigAverage (physicalSmallBigAverage f) := by funext s simp only [physicalSmallBigAverage, physicalSmallBigBigAverage, fullActiveAverage, mul_sum] rw [sum_comm] apply sum_congr rfl intro τ _ apply sum_congr rfl intro σ _ change _ * (_ * f ((s.1.1, physicalPermuteLabels σ s.1.2), fullActivePermutation τ s.2)) = _ * (_ * f ((s.1.1, physicalPermuteLabels σ s.1.2), fullActivePermutation τ s.2)) ring theorem physical_small_big_joint_average_eq_big_small : physicalSmallBigJointAverage f = physicalSmallBigBigAverage (physicalSmallBigAverage f) := physical_small_big_averages_commute f end end Bounty end section /- Actual physical ghost bounds for signed birth-observable multipliers on the genuine mixed measure. The fixed initial gate and both adjacent joint slot averages remain in the operator. No local operator norm is assumed. -/ open Finset Classical namespace Bounty section Energy variable {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (μ : ∀ g, P g → ℝ) (q ρ : ℝ) (V : G → ℝ) (v vmax : ℝ) (M : G → ℕ) (B : ℕ) (hμ : ∀ g p, 0 < μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hρ : 0 < ρ) (hV : ∀ g, 0 ≤ V g) (hVmax : ∀ g, V g ≤ vmax) (hv : 0 < v) (hD : q / ρ ^ 2 + ((1 - q) / ρ) / v ≤ 1) (hC : ∀ g, q / ρ ^ 2 + ((1 - q) * V g / ρ) / v ≤ 1) include hVs hμ hmass hq0 hq1 hρ hV hVmax hv hD hC in theorem physical_small_big_ghost_phase_energy_le_uniform (phase : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), CoupledGhostEvent M B s.2 → ℂ) (hphase : ∀ s e, ‖phase s e‖ ≤ 1) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigGhostAction (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) (fun g => physicalGhostBirth (n g) q ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B phase F) ≤ physicalGhostUniformEnergyBound ρ vmax v ^ Fintype.card G * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) apply physical_small_big_fiber_energy_le Vs hVs _ F _ _ intro s apply finiteWeightedEnergy_le_of_envelope_domination (productMemoryWeight μ (fun g => unrestrictedResidueWeight (n := n g) (μ g))) (productMemoryWeight_nonneg μ (fun g => unrestrictedResidueWeight (n := n g) (μ g)) (fun g p => (hμ g p).le) (fun g z => (hμ g z.1).le)) (fun x => F (s,x)) _ (coupledGhostCutoffOperator (fun g => physicalGhostRetention (n g) q ρ) (fun g z => |physicalGhostTermination (n g) q ρ z|) (fun g z => |physicalGhostBirth (n g) q ρ (V g) z|) (fun g => unrestrictedResidueWeight (μ g)) M B (fun _ _ => 1)) · intro x exact (coupled_ghost_cutoff_norm_le_positive_re (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) (fun g => physicalGhostBirth (n g) q ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) (by intro g z; unfold physicalGhostRetention; split_ifs · exact div_nonneg hq0 (sq_nonneg ρ) · exact zero_le_one) (fun g z => (hμ g z.1).le) M B (fun x e => phase (s,x) e) (fun x e => hphase (s,x) e) (fun x => F (s,x)) x).trans (Complex.re_le_norm _) · rw [coupled_ghost_cutoff_one_eq_coordinate_action] have h := physical_ghost_absolute_cutoff_product_energy_le n μ q ρ V v vmax M B hμ hmass hq0 hq1 hρ hV hVmax hv hD hC univ (complexNormEnvelope (fun x => F (s,x))) (complexNormEnvelope_memory_symmetric _ (hF s)) simp only [physicalAbsoluteGhostCutoffProductOperator, physicalAbsoluteGhostProductOperator, physicalAbsoluteBoundedGhostOperator, card_univ] at h convert h using 1 variable [dS : DecidableEq S] end Energy end Bounty end section open MeasureTheory open scoped FourierTransform namespace Bounty noncomputable def centeredLocalMellinPolynomial (S : Finset ℕ) (a : ℕ → ℂ) (Y t : ℝ) : ℂ := Complex.exp (((-t*Real.log Y:ℝ):ℂ)*Complex.I) * localMellinPolynomial S a t theorem centered_local_mellin_polynomial_continuous (S : Finset ℕ) (a : ℕ → ℂ) (Y : ℝ) : Continuous (centeredLocalMellinPolynomial S a Y) := by have hp := local_mellin_polynomial_continuous S a unfold centeredLocalMellinPolynomial fun_prop theorem centered_local_mellin_polynomial_norm (S : Finset ℕ) (a : ℕ → ℂ) (Y t : ℝ) : ‖centeredLocalMellinPolynomial S a Y t‖ = ‖localMellinPolynomial S a t‖ := by unfold centeredLocalMellinPolynomial rw [norm_mul, Complex.norm_exp_ofReal_mul_I, one_mul] theorem local_log_convolution_mellin_coordinates (S : Finset ℕ) (a : ℕ → ℂ) (hS : ∀ n ∈ S, 0 < n) {h Y : ℝ} (hh : 0 < h) (hY : 0 < Y) (u : ℝ) : localLogConvolution S a (h*Y) (Y*Real.exp u) = ((h/(2*Real.pi):ℝ):ℂ) * localMellinTransform h (centeredLocalMellinPolynomial S a Y) u := by have hv : 0 < Y*Real.exp u := mul_pos hY (Real.exp_pos u) rw [local_mellin_representation S a hS hv (mul_pos hh hY)] have hc : h*Y/(2*Real.pi*(Y*Real.exp u)) = (h/(2*Real.pi))*Real.exp (-u) := by rw [Real.exp_neg] field_simp rw [hc] unfold localMellinTransform rw [Complex.ofReal_mul, mul_assoc] congr 1 congr 1 apply integral_congr_ae filter_upwards [] with t have hfreq : (h/(2*Real.pi)*Real.exp (-u))*t = Real.exp (-u)*(h*t)/(2*Real.pi) := by ring rw [hfreq, Real.log_mul hY.ne' (Real.exp_ne_zero u), Real.log_exp] unfold centeredLocalMellinPolynomial have hexp : Complex.exp (((-t*(Real.log Y+u):ℝ):ℂ)*Complex.I) = Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * Complex.exp (((-t*Real.log Y:ℝ):ℂ)*Complex.I) := by rw [← Complex.exp_add] congr 1 push_cast ring rw [hexp] ring theorem scaled_exponential_log_dyad_image {Y : ℝ} (hY : 0 < Y) : (fun u : ℝ => Y*Real.exp u) '' Set.Icc (Real.log (1/2:ℝ)) (Real.log 3) = Set.Icc (Y/2) (3*Y) := by have hc : Continuous (fun u : ℝ => Y*Real.exp u) := by fun_prop have hm : StrictMono (fun u : ℝ => Y*Real.exp u) := fun a b hab => mul_lt_mul_of_pos_left (Real.exp_strictMono hab) hY rw [hc.image_Icc_of_strictMono hm, Real.exp_log (by norm_num : (0:ℝ)<1/2), Real.exp_log (by norm_num : (0:ℝ)<3)] congr 1 <;> ring theorem logarithmic_dyad_integral_substitution {Y : ℝ} (hY : 0 < Y) (F : ℝ → ℝ) : (∫ v in Set.Icc (Y/2) (3*Y), F v) = ∫ u in Set.Icc (Real.log (1/2:ℝ)) (Real.log 3), Y*Real.exp u * F (Y*Real.exp u) := by rw [← scaled_exponential_log_dyad_image hY] have hi : Set.InjOn (fun u : ℝ => Y*Real.exp u) (Set.Icc (Real.log (1/2:ℝ)) (Real.log 3)) := by intro a ha b hb hab apply Real.exp_injective exact (mul_left_cancel₀ hY.ne') hab rw [integral_image_eq_integral_abs_deriv_smul measurableSet_Icc (fun u hu => ((Real.hasDerivAt_exp u).const_mul Y).hasDerivWithinAt) hi] apply integral_congr_ae filter_upwards [] with u rw [abs_of_pos (mul_pos hY (Real.exp_pos u)), smul_eq_mul] end Bounty end section open MeasureTheory open scoped ComplexConjugate namespace Bounty theorem exists_local_mellin_transform_energy_constant {j : ℕ} (hj : 2 ≤ j) : ∃ C : ℝ, 0 < C ∧ ∀ h : ℝ, 0 < h → ∀ g : ℝ → ℂ, Continuous g → (∃ M : ℝ, ∀ t, ‖g t‖ ≤ M) → Integrable (fun u : ℝ => ‖(typeIISmoothRho 2 u : ℂ) * localMellinTransform h g u‖^2) ∧ (∫ u in Set.Icc (Real.log (1/2:ℝ)) (Real.log 3), ‖localMellinTransform h g u‖^2) ≤ C * ∫ t : ℝ, (1+|h*t|)^(-(j:ℝ)) * ‖g t‖^2 := by obtain ⟨M₀, M₁, M₂, hM₀, hM₁, hM₂, hderiv⟩ := local_mellin_amplitude_uniform_derivatives (4*j) obtain ⟨C₀, hC₀, hCi, hFourier⟩ := local_mellin_amplitude_product_fourier_bound (4*j) have hCbase : 0 ≤ C₀*(2*Real.pi^2)*(2:ℝ)^j := by positivity refine ⟨C₀*(2*Real.pi^2)*(2:ℝ)^j+1, by linarith, ?_⟩ intro h hh g hg hgBound obtain ⟨M, hgM⟩ := hgBound let f : ℝ → ℂ := fun t => (mellinDecayWeight j h t : ℂ) * g t have hfc : Continuous f := (Complex.continuous_ofReal.comp (mellin_decay_weight_continuous j h)).mul hg have hfi : Integrable f := mellin_weighted_bounded_integrable hj hh hg hgM have hf2 : Integrable (fun t => ‖f t‖^2) := mellin_weighted_bounded_square_integrable hj hh hg hgM have hab (v u : ℝ) : ‖localMellinAmplitude (4*j) v u‖ ≤ M₀ := (hderiv v u).1 have hsupp := local_mellin_amplitude_zero (4*j) have hloc := oscillatory_schur_energy_integrable (local_mellin_amplitude_joint_continuous (4*j)) hM₀ hab hsupp hfc hfi h have hbound := oscillatory_schur_energy_bound (local_mellin_amplitude_joint_continuous (4*j)) hM₀ hab hsupp hC₀ hFourier hfc hfi hf2 h have heq (u : ℝ) : (∫ t : ℝ, Complex.exp (((-t*u:ℝ):ℂ)*Complex.I) * localMellinAmplitude (4*j) (h*t) u * f t) = (typeIISmoothRho 2 u : ℂ) * localMellinTransform h g u := (local_mellin_transform_weighted_representation j h g u).symm simp_rw [heq] at hloc hbound refine ⟨hloc, ?_⟩ have hsame : (∫ u in Set.Icc (Real.log (1/2:ℝ)) (Real.log 3), ‖localMellinTransform h g u‖^2) = ∫ u in Set.Icc (Real.log (1/2:ℝ)) (Real.log 3), ‖(typeIISmoothRho 2 u : ℂ) * localMellinTransform h g u‖^2 := by apply setIntegral_congr_fun measurableSet_Icc intro u hu dsimp only rw [local_mellin_rho_one_on_log_dyad hu, Complex.ofReal_one, one_mul] rw [hsame] calc _ ≤ ∫ u : ℝ, ‖(typeIISmoothRho 2 u : ℂ) * localMellinTransform h g u‖^2 := setIntegral_le_integral hloc (Filter.Eventually.of_forall (fun u => sq_nonneg _)) _ ≤ C₀*(2*Real.pi^2) * ∫ t : ℝ, ‖f t‖^2 := hbound _ ≤ C₀*(2*Real.pi^2) * ((2:ℝ)^j * ∫ t : ℝ, (1+|h*t|)^(-(j:ℝ))*‖g t‖^2) := mul_le_mul_of_nonneg_left (mellin_weighted_square_energy_bound hj hh hg hgM) (by positivity) _ ≤ _ := by have hE : 0 ≤ ∫ t : ℝ, (1+|h*t|)^(-(j:ℝ))*‖g t‖^2 := integral_nonneg (fun t => by positivity) nlinarith end Bounty end section open Finset Real namespace Bounty theorem typeII_finite_smooth_divisor_sum_restrict {L B : ℝ} (hL : 0 < L) (S : Finset ℕ) (hS : arithmeticProductWindow 1 (exp L) ⊆ S) (a : ℕ → ℂ) (F : ℕ → ℕ → ℂ) : (∑ u ∈ S, a u * (typeIIWindowSmooth (L^(-B)) ((u : ℝ)/exp L) : ℂ) * ∑ m ∈ (2*u+1).divisors, F u m) = ∑ u ∈ arithmeticProductWindow 1 (exp L), a u * ∑ m ∈ (2*u+1).divisors, (typeIIWindowSmooth (L^(-B)) ((u : ℝ)/exp L) : ℂ) * F u m := by rw [typeII_smooth_sum_restrict (exp_pos L) (rpow_pos_of_pos hL _) S hS] simp only [← mul_sum, mul_assoc] end Bounty end section /- The logarithmic first derivative bound for either sign of the frequency. -/ open Finset namespace Bounty theorem logarithmic_first_derivative_signed (a b : ℤ) (V t : ℝ) (ha : 0 < (a : ℝ)) (haV : (a : ℝ) ≤ V) (hbV : (b : ℝ)+1 ≤ V) (ht : t ≠ 0) (htmax : |t| ≤ Real.pi*(a : ℝ)) : ‖∑ n ∈ Icc a b, Complex.exp ((t*Real.log (n : ℝ) : ℝ)*Complex.I)‖ ≤ 4*Real.pi*V/|t| := by by_cases htp : 0 < t · rw [abs_of_pos htp] at htmax ⊢ exact logarithmic_first_derivative_positive a b V t ha haV hbV htp htmax · have htn : t < 0 := lt_of_le_of_ne (le_of_not_gt htp) ht have hpos := logarithmic_first_derivative_positive a b V (-t) ha haV hbV (by linarith) (by rwa [abs_of_neg htn] at htmax) rw [abs_of_neg htn] have he := norm_sum_exp_phase_neg (Icc a b) (fun n => t*Real.log (n : ℝ)) simp only [← neg_mul] at he rw [he] at hpos exact hpos end Bounty end section /- The actual exceptional prime-polynomial intervals are a subpower of Y, uniformly in the prime set and its bounded coefficients. -/ open Filter open scoped Topology namespace Bounty theorem eventually_prime_exceptional_intervals_subpower {a beta c A d ε : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hA : 0 ≤ A) (hd : 0 < d) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R : ℝ), 1 ≤ Y → d * L ≤ Real.log Y → Real.log Y ≤ c * L → Real.exp (L ^ a) / 2 ≤ P → P ≤ Real.exp (L ^ beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) → (∀ p : s, ‖coeff p‖ ≤ 1) → ((primeExceptionalIntervals s coeff (L ^ (-A)) R).card : ℝ) ≤ Y ^ ε := by filter_upwards [eventually_prime_moment_exp_le_rpow ha hbeta (zero_le_one.trans (prime_moment_actual_exponent_one_le hc hA)) hd hε, eventually_ge_atTop (Real.exp 1)] with L hsub hL intro s hs coeff Y P R hY hloglo hloghi hPlo hPhi hR hRY hband hcoeff exact (prime_exceptional_intervals_subexponential_bound s hs coeff ha.le ha1 hc hA hL hY hloghi hPlo hPhi hR hRY hband hcoeff).trans (hsub Y (zero_lt_one.trans_le hY) hloglo) end Bounty end section /- Fixed bounded coefficients reduce to unit coefficients by division. The original exceptional intervals are retained through a literal inclusion, with one additional power in the logarithmic threshold when the scale dominates the fixed coefficient bound. -/ open Finset open scoped Classical namespace Bounty theorem prime_reciprocal_polynomial_div (s : Finset ℕ) (coeff : s → ℂ) (B t : ℝ) : primeReciprocalPolynomial s (fun p => coeff p / (B : ℂ)) t = primeReciprocalPolynomial s coeff t / (B : ℂ) := by unfold primeReciprocalPolynomial rw [Finset.sum_div] apply Finset.sum_congr rfl intro p _ ring theorem prime_normalized_coefficient_norm_le_one (s : Finset ℕ) (coeff : s → ℂ) {B : ℝ} (hB : 0 < B) (hcoeff : ∀ p : s, ‖coeff p‖ ≤ B) (p : s) : ‖coeff p / (B : ℂ)‖ ≤ 1 := by rw [norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hB] exact (div_le_one hB).mpr (hcoeff p) theorem prime_bounded_coefficient_threshold {B L : ℝ} (A : ℝ) (hB : 0 < B) (hBL : B ≤ L) : L ^ (-(A + 1)) ≤ L ^ (-A) / B := by have hL : 0 < L := hB.trans_le hBL rw [show -(A + 1) = -A - 1 by ring, Real.rpow_sub hL, Real.rpow_one] exact div_le_div_of_nonneg_left (Real.rpow_nonneg hL.le _) hB hBL theorem prime_exceptional_intervals_normalize_subset (s : Finset ℕ) (coeff : s → ℂ) {B L : ℝ} (A R : ℝ) (hB : 0 < B) (hBL : B ≤ L) : primeExceptionalIntervals s coeff (L ^ (-A)) R ⊆ primeExceptionalIntervals s (fun p => coeff p / (B : ℂ)) (L ^ (-(A + 1))) R := by intro i hi obtain ⟨t, ht, hR, hlarge⟩ := (mem_primeExceptionalIntervals s coeff _ R i).mp hi apply (mem_primeExceptionalIntervals s (fun p => coeff p / (B : ℂ)) _ R i).mpr refine ⟨t, ht, hR, ?_⟩ rw [prime_reciprocal_polynomial_div, norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hB] exact (prime_bounded_coefficient_threshold A hB hBL).trans_lt ((div_lt_div_iff_of_pos_right hB).mpr hlarge) end Bounty end section open Finset namespace Bounty section variable (hs : List ℝ) (q a u lo hi : ℝ) (l r : ℤ) (hq : 0 < q) (hu : u ≠ 0) (hlr : l ≤ r) (hhs : ∀ h ∈ hs, 0 < h) (hlo : 0 < lo) (hlohi : lo ≤ hi) (hbox : ∀ x ∈ Set.Icc (l:ℝ) ((r:ℝ)+1), lo ≤ x+a/q ∧ x+a/q+hs.sum ≤ hi) include hs q a u lo hi l r hq hu hlr hhs hlo hlohi hbox theorem integer_mixed_logarithmic_sum_bound : let d := hs.length+2 let lam := hs.prod * |u| * ((hs.length+1).factorial:ℝ) / hi^d let A := (hi/lo)^d ‖∑ n ∈ Icc l r, realUnitPhase (mixedForwardDifference hs (fun y => u * Real.log (q*y+a)) (n:ℝ))‖ ≤ 6*(A*((r:ℝ)-l+1)*Real.sqrt lam+2/Real.sqrt lam) := by dsimp only let lam := hs.prod * |u| * ((hs.length+1).factorial:ℝ) / hi^(hs.length+2) let A := (hi/lo)^(hs.length+2) have hhi : 0 < hi := lt_of_lt_of_le hlo hlohi have hprod : 0 < hs.prod := List.prod_pos hhs have hlam : 0 < lam := by dsimp only [lam]; positivity have hA : 1 ≤ A := by apply one_le_pow₀ exact (le_div_iff₀ hlo).mpr (by simpa using hlohi) have hhs0 : ∀ h ∈ hs, 0 ≤ h := fun h hh => (hhs h hh).le have hcurv : hs.prod * |u| * ((1+hs.length).factorial:ℝ) / lo^(1+hs.length+1) = A*lam := by have hd : 1+hs.length+1 = hs.length+2 := by omega have hf : 1+hs.length = hs.length+1 := by omega rw [hd, hf] dsimp only [A, lam] rw [div_pow] field_simp have hcurvlow : hs.prod * |u| * ((1+hs.length).factorial:ℝ) / hi^(1+hs.length+1) = lam := by have hd : 1+hs.length+1 = hs.length+2 := by omega rw [hd, Nat.add_comm 1 hs.length] have hf : ∀ x ∈ Set.Icc (l:ℝ) ((r:ℝ)+1), HasDerivAt (mixedForwardDifference hs (fun y => u*Real.log (q*y+a))) (mixedForwardDifference hs (logarithmicDerivativeChain u (a/q) 1) x) x := by intro x hx exact (mixed_affine_logarithmic_phase_derivatives hs q a u x hq hhs0 (lt_of_lt_of_le hlo (hbox x hx).1)).1 have hf' : ∀ x ∈ Set.Icc (l:ℝ) ((r:ℝ)+1), HasDerivAt (mixedForwardDifference hs (logarithmicDerivativeChain u (a/q) 1)) (mixedForwardDifference hs (logarithmicDerivativeChain u (a/q) 2) x) x := by intro x hx exact (mixed_affine_logarithmic_phase_derivatives hs q a u x hq hhs0 (lt_of_lt_of_le hlo (hbox x hx).1)).2 rcases le_total 0 (u*(-1:ℝ)^(1+hs.length)) with hp | hn · apply integer_second_derivative_sum_bound hlr hlam hA hf hf' intro x hx have hb := mixed_logarithmic_difference_positive_bounds_on_box hs u (a/q) 1 x lo hi hhs0 hlo (hbox x hx).1 (hbox x hx).2 hp rwa [hcurv, hcurvlow] at hb · apply integer_second_derivative_sum_bound_negative hlr hlam hA hf hf' intro x hx have hb := mixed_logarithmic_difference_negative_bounds_on_box hs u (a/q) 1 x lo hi hhs0 hlo (hbox x hx).1 (hbox x hx).2 hn rw [hcurv, hcurvlow] at hb simpa only [neg_mul] using hb theorem integer_mixed_logarithmic_exp_sum_bound : let d := hs.length+2 let lam := hs.prod * |u/(2*Real.pi)| * ((hs.length+1).factorial:ℝ) / hi^d let A := (hi/lo)^d ‖∑ n ∈ Icc l r, Complex.exp ((mixedForwardDifference hs (fun y => u * Real.log (q*y+a)) (n:ℝ) : ℂ)*Complex.I)‖ ≤ 6*(A*((r:ℝ)-l+1)*Real.sqrt lam+2/Real.sqrt lam) := by have hne : u/(2*Real.pi) ≠ 0 := div_ne_zero hu (by positivity) have hb := integer_mixed_logarithmic_sum_bound hs q a (u/(2*Real.pi)) lo hi l r hq hne hlr hhs hlo hlohi hbox have hf : (fun y => u/(2*Real.pi)*Real.log (q*y+a)) = (fun y => (u*Real.log (q*y+a))/(2*Real.pi)) := by funext y; ring rw [hf] at hb simpa only [real_unit_phase_mixed_div_two_pi] using hb end end Bounty end section /- The remaining vertex weight depends only on the actual unshared labels. -/ open Finset open scoped Classical namespace Bounty theorem physical_unshared_tagged_mem {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (p : PhysicalPrime P) : p ∈ physicalMarkedPrimes L \ physicalSharedPrimes C L ↔ p.2 ∈ univ.image (physicalGroupUnsharedEmbedding C L p.1) := by rw [mem_sdiff, mem_physical_marked_primes, physical_group_unshared_embedding_mem] simp only [mem_physical_shared_primes, mem_physical_group_shared_primes] end Bounty end section /- The literal small-mark peel has one extracted prime and three remaining factors. -/ open Finset namespace Bounty theorem selected_marked_prime_peel_four_convolution {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (Q : Finset ℕ) (q : ℝ) (V : G → ℝ) (t u : G → ℕ) (g : G) (k : ℕ) (big : Finset G) (b : GroupMarkedLists (fun g : big => P g.val) (fun g : big => u g.val) → ℂ) (α β γ : ℕ → ℂ) (hP : ∀ g, ∀ p ∈ P g, p.Prime) (hPQ : ∀ g, P g ⊆ Q) (hα : ∀ d, ¬ Disjoint d.primeFactors Q → α d = 0) (hβ : ∀ d, ¬ Disjoint d.primeFactors Q → β d = 0) {n : ℕ} (hn : n ≠ 0) : markedPrimePeel univ P q V t g k (fun m => groupMarkedAverage (fun g : big => P g.val) (fun g : big => u g.val) (m : ℤ) b * invariantTripleEndpoint Q α β γ m) n = endpointFourConvolution (fun p => if p ∈ P g then 1 / (V g : ℂ) else 0) α β (fun r => selectedMarkedWeight P Q q V (Function.update t g k) u big b (fun _ => 1) r * γ (primePoolFreePart Q r)) n := by have h := prime_peel_weighted_triple_convolution (P g) Q (fun _ => 1 / (V g : ℂ)) (selectedMarkedWeight P Q q V (Function.update t g k) u big b (fun _ => 1)) α β γ (selected_marked_weight_mul_free P Q q V (Function.update t g k) u big b (fun _ => 1) hP hPQ) hα hβ hn simpa only [markedPrimePeel, selectedMarkedWeight, one_mul, mul_sum, mul_ite, mul_zero, mul_assoc] using h end Bounty end section /- The literal reciprocal four-fold convolution has the coefficient energy needed by the ordinary and exceptional dyadic mean-square estimates. -/ open Finset Filter namespace Bounty theorem eventually_four_convolution_reciprocal_power_energy {c E : ℝ} (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ (δ α β γ : ℕ → ℂ) (D A B C U : ℝ), 0 ≤ D → 0 ≤ A → 0 ≤ B → 0 ≤ C → 1 ≤ U → Real.log U ≤ c * L → D * A * B * C ≤ L ^ E → (∀ n, ‖δ n‖ ≤ D) → (∀ n, ‖α n‖ ≤ A) → (∀ n, ‖β n‖ ≤ B) → (∀ n, ‖γ n‖ ≤ C) → ∀ S : Finset ℕ, (∀ n ∈ S, U ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2 * U) → (∑ n ∈ S, ‖endpointFourConvolution δ α β γ n / (n : ℂ)‖ ^ 2) ≤ L ^ (2 * E + 16) / U := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (3 * (1 + Real.log 3 + c) ^ (15 : ℕ))] with L hL hlarge intro δ α β γ D A B C U hD hA hB hC hU hlog hprod hδ hα hβ hγ S hband have hU0 : 0 < U := zero_lt_one.trans_le hU have hL0 : 0 < L := zero_lt_one.trans_le hL have hS : ∀ n ∈ S, 0 < n ∧ n ≤ ⌈2 * U⌉₊ := by intro n hn constructor · exact_mod_cast hU0.trans_le (hband n hn).1 · exact_mod_cast (hband n hn).2.trans (Nat.le_ceil (2 * U)) have hraw := endpoint_four_convolution_reciprocal_energy δ α β γ hD hA hB hC hU0 hδ hα hβ hγ S ⌈2 * U⌉₊ hS (fun n hn => (hband n hn).1) have hN : (⌈2 * U⌉₊ : ℝ) ≤ 3 * U := by have hh := Nat.ceil_lt_add_one (by linarith : 0 ≤ 2 * U) linarith have hlog0 : 0 ≤ 1 + Real.log ⌈2 * U⌉₊ := by linarith [Real.log_natCast_nonneg ⌈2 * U⌉₊] have hprod0 : 0 ≤ D * A * B * C := by positivity have hsq : (D * A * B * C) ^ (2 : ℕ) ≤ (L ^ E) ^ (2 : ℕ) := pow_le_pow_left₀ hprod0 hprod 2 have hbudget := four_convolution_log_budget hc hL hlarge hU hlog calc _ ≤ (D * A * B * C) ^ (2 : ℕ) * ((⌈2 * U⌉₊ : ℝ) * (1 + Real.log ⌈2 * U⌉₊) ^ (15 : ℕ)) / U ^ (2 : ℕ) := hraw _ ≤ (L ^ E) ^ (2 : ℕ) * (3 * U * (1 + Real.log ⌈2 * U⌉₊) ^ (15 : ℕ)) / U ^ (2 : ℕ) := by gcongr _ = (L ^ E) ^ (2 : ℕ) * (3 * (1 + Real.log ⌈2 * U⌉₊) ^ (15 : ℕ)) / U := by field_simp _ ≤ (L ^ E) ^ (2 : ℕ) * L ^ (16 : ℕ) / U := by gcongr _ = L ^ (2 * E + 16) / U := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL0.le, ← Real.rpow_natCast, ← Real.rpow_add hL0] congr 2 norm_num ring end Bounty end section /- Four dyadic input factors need only five dyads after collapsing their coefficients. -/ open Finset namespace Bounty theorem four_dyadic_factor_product_bounds {UD UA UB UC : ℝ} {d a b c : ℕ} (hUD : 0 < UD) (hUA : 0 < UA) (hUB : 0 < UB) (hUC : 0 < UC) (hd : UD ≤ (d : ℝ) ∧ (d : ℝ) ≤ 2*UD) (ha : UA ≤ (a : ℝ) ∧ (a : ℝ) ≤ 2*UA) (hb : UB ≤ (b : ℝ) ∧ (b : ℝ) ≤ 2*UB) (hc : UC ≤ (c : ℝ) ∧ (c : ℝ) ≤ 2*UC) : UD*UA*UB*UC ≤ (d*a*b*c : ℕ) ∧ (d*a*b*c : ℕ) ≤ 16*(UD*UA*UB*UC) := by rcases hd with ⟨hdlo,hdhi⟩ rcases ha with ⟨halo,hahi⟩ rcases hb with ⟨hblo,hbhi⟩ rcases hc with ⟨hclo,hchi⟩ push_cast constructor · gcongr · calc _ ≤ (2*UD)*(2*UA)*(2*UB)*(2*UC) := by gcongr _ = _ := by ring end Bounty end section /- Fourier multipliers on the unchanged common initial-and-event allocation. Every touched address retains its performed test even at zero frequency. -/ open Finset Classical namespace Bounty section Common variable {J K Z : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) end Common section Actual variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) end Actual end Bounty end section /- The selected ordered-list average preserves the polynomial marked-weight bound. -/ open Finset namespace Bounty theorem selected_marked_weight_norm_le_rpow {G : Type*} [Fintype G] (P : G → Finset ℕ) (Q : Finset ℕ) {q v L K B : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (hL : 0 < L) (V : G → ℝ) (t u : G → ℕ) (T : ℕ) (big : Finset G) (hV : ∀ g, v ≤ V g) (ht : ∀ g, t g ≤ T) (hcard : (Fintype.card G : ℝ) ≤ K*Real.log L) (b : GroupMarkedLists (fun g : big => P g.val) (fun g : big => u g.val) → ℂ) (hb : ∀ l, ‖b l‖ ≤ L^B) (κ : ℕ → ℂ) (hκ : ∀ d, ‖κ d‖ ≤ 1) (n : ℕ) : ‖selectedMarkedWeight P Q q V t u big b κ n‖ ≤ L^(K*Real.log (markedDivisorBound q v T)+B) := by have hw := marked_divisor_weight_le_rpow univ P hq0 hq1 hv hL V t T (fun g _ => hV g) (fun g _ => ht g) (by simpa only [card_univ] using hcard) (n : ℤ) have hw0 := marked_divisor_weight_nonneg univ P hq0 V t (fun g _ => hv.le.trans (hV g)) (n : ℤ) have hb' := group_marked_average_norm_le (fun g : big => P g.val) (fun g : big => u g.val) (n : ℤ) b (Real.rpow_nonneg hL.le B) (fun l => hb l.val) rw [selectedMarkedWeight,norm_mul,norm_mul,Complex.norm_real,Real.norm_eq_abs, abs_of_nonneg hw0] calc _ ≤ (1*L^(K*Real.log (markedDivisorBound q v T)))*L^B := mul_le_mul (mul_le_mul (hκ _) hw hw0 (by norm_num)) hb' (norm_nonneg _) (by positivity) _ = _ := by rw [one_mul,← Real.rpow_add hL] end Bounty end section /- Exact dependent decomposition of an original list into shared and unshared data. -/ open Finset open scoped Classical namespace Bounty private theorem sigma_subtype_base_val_ext {A B : Type*} {R : A → B → Prop} (x y : Σ a, {b // R a b}) (hbase : x.1 = y.1) (hval : x.2.val = y.2.val) : x = y := by rcases x with ⟨a, ⟨u, hu⟩⟩ rcases y with ⟨b, ⟨v, hv⟩⟩ dsimp only at hbase hval subst b subst v rfl noncomputable def physicalCutListSigmaEquiv {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) : PhysicalMarkLists P J ell ≃ Σ s : PhysicalCutSharedEmbedding P C, PhysicalCutCompletion P C ell s where toFun L := ⟨physicalCutShared C L, physicalCutCompletionOfList C L⟩ invFun d := physicalCutGlue C d.1 d.2 left_inv L := physical_cut_glue_of_list C L right_inv d := by rcases d with ⟨s, ⟨u, hu⟩⟩ apply sigma_subtype_base_val_ext · exact physical_cut_glue_shared C s ⟨u, hu⟩ · change (fun g => (physicalCutListEquiv P C ell (physicalCutGlue C s ⟨u, hu⟩) g).val.2) = u rw [physical_cut_glue_split] noncomputable def sigmaSameBasePairEquiv {A : Type*} {B : A → Type*} : {x : (Σ a, B a) × (Σ a, B a) // x.1.1 = x.2.1} ≃ Σ a, B a × B a where toFun x := by rcases x with ⟨⟨⟨a, u⟩, ⟨b, v⟩⟩, h⟩ dsimp only at h subst b exact ⟨a, u, v⟩ invFun x := ⟨(⟨x.1, x.2.1⟩, ⟨x.1, x.2.2⟩), rfl⟩ left_inv x := by rcases x with ⟨⟨⟨a, u⟩, ⟨b, v⟩⟩, h⟩ dsimp only at h subst b rfl right_inv x := by rcases x with ⟨a, u, v⟩ rfl end Bounty end section /- The original full vertex pair on any retained bad event has the explicit shared-overlap loss. The coefficient may depend on the shared labels. -/ open Finset open scoped Classical namespace Bounty theorem physical_bad_vertex_coefficient_norm_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (hshared : physicalSharedCompatible C L R) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) {q : ℝ} (hq0 : 0 < q) (hq1 : q ≤ 1) (w z : ℤ) (bad : Prop) [Decidable bad] (K : ℂ) {H : ℝ} (hK : ‖K‖ ≤ H) : ‖if bad then ((physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * w) * physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * z) : ℝ) : ℂ) * K else 0‖ ≤ (physicalUnsharedVertex C L q w * physicalUnsharedVertex C R q z) * (H / q ^ (2 * ∑ g : G, (J - (C g).card))) * (if bad then 1 else 0) := by have hn (T : PhysicalMarkLists P J ell) (n : ℤ) : 0 ≤ physicalVertexWeight T q n := by unfold physicalVertexWeight split_ifs · exact prod_nonneg (fun g _ => pow_nonneg hq0.le _) · exact le_rfl have hp := mul_nonneg (hn L ((physicalSharedFactor C L : ℤ) * w)) (hn R ((physicalSharedFactor C L : ℤ) * z)) have ho := physical_shared_vertex_pair_overlap_bound C L R hshared hprime hdis hq0 hq1 w z by_cases hb : bad · rw [if_pos hb, if_pos hb, mul_one, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hp] calc _ ≤ ((physicalUnsharedVertex C L q w * physicalUnsharedVertex C R q z) / q ^ (2 * ∑ g : G, (J - (C g).card))) * H := mul_le_mul ho hK (norm_nonneg K) (hp.trans ho) _ = _ := by ring · simp only [if_neg hb, norm_zero, mul_zero, le_refl] end Bounty end section /- Harmonic summation of a pair error against the literal invariant endpoints. All position bounds and polynomial coefficient losses remain explicit. -/ open Finset namespace Bounty theorem invariant_harmonic_pair_error (Q : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (hα' : ∀ m, ‖α' m‖ ≤ A) (hβ' : ∀ p, ‖β' p‖ ≤ B) (hγ' : ∀ r, ‖γ' r‖ ≤ C) (S : Finset ℤ) (δ : ℤ) (N : ℕ) (hS : ∀ n ∈ S, 0 ≤ n ∧ n ≤ (N : ℤ)) (hS' : ∀ n ∈ S, 0 ≤ n + δ ∧ n + δ ≤ (N : ℤ)) {Y K M0 M1 ε : ℝ} (hY : 0 < Y) (hK : 0 ≤ K) (hM0 : 0 ≤ M0) (hM1 : 0 ≤ M1) (hε : 0 ≤ ε) (hYlow : ∀ n ∈ S, Y ≤ (n : ℝ)) (θ e : ℤ → ℂ) (W0 W1 : ℤ → ℝ) (hθ : ∀ n ∈ S, ‖θ n‖ ≤ K) (hW0 : ∀ n ∈ S, 0 ≤ W0 n ∧ W0 n ≤ M0) (hW1 : ∀ n ∈ S, 0 ≤ W1 n ∧ W1 n ≤ M1) (he : ∀ n ∈ S, ‖e n‖ ≤ W0 n * W1 n * ε) : ‖∑ n ∈ S, (θ n / (n : ℂ)) * star (invariantTripleEndpoint Q α β γ n.natAbs) * invariantTripleEndpoint Q α' β' γ' (n+δ).natAbs * e n‖ ≤ (K * M0 * M1 * ε / Y) * ((A*B*C)^2 * (N : ℝ) * (1+Real.log N)^15) := by have hweight : ∀ n ∈ S, ‖θ n * e n‖ ≤ K * M0 * M1 * ε := by intro n hn rw [norm_mul] have he' : ‖e n‖ ≤ M0 * M1 * ε := (he n hn).trans (mul_le_mul_of_nonneg_right (mul_le_mul (hW0 n hn).2 (hW1 n hn).2 (hW1 n hn).1 hM0) hε) calc _ ≤ K * (M0 * M1 * ε) := mul_le_mul (hθ n hn) he' (norm_nonneg _) hK _ = _ := by ring have hb := invariant_triple_endpoint_harmonic_multiples Q α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' S δ 1 N (Nat.mem_factoredNumbers_of_primeFactors_subset (by norm_num) (by simp)) (by simp) (by simp) hS hS' hY (by positivity) hYlow (fun n => θ n * e n) hweight simp only [Nat.cast_one, div_one] at hb convert hb using 1 congr 1 apply sum_congr rfl intro n _ ring end Bounty end section /- A literal fixed-pattern, fixed-auxiliary summand of the original root. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalFixedRootCorrelation {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (positions : Finset ℤ) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) : ℂ := (physicalStateMass V J ell : ℂ) * ∑ x ∈ physicalCutoff P J ell positions, ∑ y ∈ physicalCutoff P J ell positions, if y.1 = x.1 + k * (physicalD C x.2.val aux : ℕ) then Ψ ((x.1 : ℝ) / (Z * physicalD C x.2.val aux)) * (x.1 : ℂ)⁻¹ * (starRingEnd ℂ) (f x.1) * physicalBarePatternScalar V C ζ K aux x.2.val y.2.val * g y.1 * ((physicalVertexWeight x.2.val q x.1 * physicalVertexWeight y.2.val q y.1 : ℝ) : ℂ) else 0 noncomputable def physicalRootPositionTerm {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) (L R : PhysicalMarkLists P J ell) (n : ℤ) : ℂ := let t := n + k * (physicalD C L aux : ℕ) Ψ ((n : ℝ) / (Z * physicalD C L aux)) * (n : ℂ)⁻¹ * (starRingEnd ℂ) (f n) * physicalBarePatternScalar V C ζ K aux L R * g t * ((physicalVertexWeight L q n * physicalVertexWeight R q t : ℝ) : ℂ) theorem physical_mellin_root_sum_fixed {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) : physicalMellinRootCorrelation V patterns C q ζ k K positions f g Ψ Z = ∑ i ∈ patterns, ∑ aux : PhysicalAuxLabels P (C i), physicalFixedRootCorrelation V (C i) q (ζ i) (k i) (K i) aux positions f g Ψ Z := by unfold physicalMellinRootCorrelation physicalFixedRootCorrelation simp only [← mul_sum] congr 1 conv_lhs => arg 2 ext x rw [sum_comm] rw [sum_comm] apply sum_congr rfl intro i _ conv_lhs => arg 2 ext x rw [sum_comm] rw [sum_comm] end Bounty end section /- Exact finite product reindexing retains the original output support and coupled cutoff. -/ open Finset namespace Bounty theorem endpoint_four_finite_cutoff_transform (S D A B C : Finset ℕ) (δ α β γ F : ℕ → ℂ) (hD : ∀ d ∈ D, 0 < d) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) (hδ : ∀ d, d ∉ D → δ d = 0) (hα : ∀ a, a ∉ A → α a = 0) (hβ : ∀ b, b ∉ B → β b = 0) (hγ : ∀ c, c ∉ C → γ c = 0) : (∑ n ∈ S, endpointFourConvolution δ α β γ n * F n) = ∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, if d * a * b * c ∈ S then δ d * α a * β b * γ c * F (d*a*b*c) else 0 := by classical let U := S ∪ ((((D ×ˢ A) ×ˢ B) ×ˢ C).image (fun x => x.1.1.1 * x.1.1.2 * x.1.2 * x.2)) have hSU : S ⊆ U := subset_union_left calc _ = ∑ n ∈ S, endpointFourConvolution δ α β γ n * (if n ∈ S then F n else 0) := by apply sum_congr rfl intro n hn rw [if_pos hn] _ = ∑ n ∈ U, endpointFourConvolution δ α β γ n * (if n ∈ S then F n else 0) := by apply sum_subset hSU intro n _ hn rw [if_neg hn, mul_zero] _ = ∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, δ d * α a * β b * γ c * (if d*a*b*c ∈ S then F (d*a*b*c) else 0) := by apply endpoint_four_finite_transform U D A B C δ α β γ _ hD hA hB hC hδ hα hβ hγ intro d hd a ha b hb c hc exact mem_union_right S (mem_image.mpr ⟨(((d,a),b),c), mem_product.mpr ⟨mem_product.mpr ⟨mem_product.mpr ⟨hd,ha⟩,hb⟩,hc⟩, rfl⟩) _ = _ := by simp only [mul_ite, mul_zero] theorem endpoint_four_bounded_cutoff_transform (S : Finset ℕ) (N : ℕ) (hS : ∀ n ∈ S, n ≤ N) (δ α β γ F : ℕ → ℂ) : (∑ n ∈ S, endpointFourConvolution δ α β γ n * F n) = ∑ d ∈ Icc 1 N, ∑ a ∈ Icc 1 N, ∑ b ∈ Icc 1 N, ∑ c ∈ Icc 1 N, if d*a*b*c ∈ S then δ d * α a * β b * γ c * F (d*a*b*c) else 0 := by classical calc _ = ∑ n ∈ S, endpointFourConvolution (fun d => if d ∈ Icc 1 N then δ d else 0) (fun a => if a ∈ Icc 1 N then α a else 0) (fun b => if b ∈ Icc 1 N then β b else 0) (fun c => if c ∈ Icc 1 N then γ c else 0) n * F n := by apply sum_congr rfl intro n hn rw [endpoint_four_convolution_truncate δ α β γ (hS n hn)] _ = ∑ d ∈ Icc 1 N, ∑ a ∈ Icc 1 N, ∑ b ∈ Icc 1 N, ∑ c ∈ Icc 1 N, if d*a*b*c ∈ S then (if d ∈ Icc 1 N then δ d else 0) * (if a ∈ Icc 1 N then α a else 0) * (if b ∈ Icc 1 N then β b else 0) * (if c ∈ Icc 1 N then γ c else 0) * F (d*a*b*c) else 0 := by apply endpoint_four_finite_cutoff_transform all_goals first | (intro n hn; exact (mem_Icc.mp hn).1) | (intro n hn; exact if_neg hn) _ = _ := by apply sum_congr rfl intro d hd apply sum_congr rfl intro a ha apply sum_congr rfl intro b hb apply sum_congr rfl intro c hc rw [if_pos hd, if_pos ha, if_pos hb, if_pos hc] end Bounty end section open MeasureTheory namespace Bounty theorem local_mellin_weighted_energy_truncation (S : Finset ℕ) (a : ℕ → ℂ) {h R : ℝ} (hh : 0 < h) {j : ℕ} (hj : 2 ≤ j) : (∫ t : ℝ, (1+|h*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) ≤ (∫ t in {t : ℝ | |t| ≤ R}, ‖localMellinPolynomial S a t‖^2) + (∫ t in {t : ℝ | R < |t|}, (1+|h*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) := by have hi := local_mellin_weighted_energy_integrable S a hh (show (1:ℝ) ‖localMellinPolynomial S a t‖^2) {t : ℝ | |t| ≤ R} := by rw [hset] exact ((local_mellin_polynomial_continuous S a).norm.pow 2).integrableOn_Icc have hsplit := integral_add_compl hs hi have hcompl : {t : ℝ | |t| ≤ R}ᶜ = {t : ℝ | R < |t|} := by ext t; simp rw [hcompl] at hsplit rw [← hsplit] apply _root_.add_le_add _ le_rfl apply setIntegral_mono_on hi.integrableOn he hs intro t ht have hw : (1+|h*t|)^(-(j:ℝ)) ≤ 1 := by apply Real.rpow_le_one_of_one_le_of_nonpos · have : 0 ≤ |h*t| := abs_nonneg _ linarith · exact neg_nonpos.mpr (Nat.cast_nonneg j) simpa only [one_mul] using mul_le_mul_of_nonneg_right hw (sq_nonneg ‖localMellinPolynomial S a t‖) theorem local_mellin_truncation_power_saving (A B D : ℝ) : ∃ j : ℕ, 2 ≤ j ∧ ∀ (L Y h : ℝ) (S : Finset ℕ) (a : ℕ → ℂ) (N : ℕ), 16 ≤ L → 0 < Y → 0 < h → h⁻¹ ≤ Y → (∀ n ∈ S, 1 ≤ n ∧ n ≤ N) → (N:ℝ)*(1+Real.log N) ≤ Y*L^A → (∑ n ∈ S, ‖a n‖^2) ≤ Y*L^B → (∫ t : ℝ, (1+|h*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) ≤ (∫ t in {t : ℝ | |t| ≤ L/h}, ‖localMellinPolynomial S a t‖^2)+Y^2*L^(-D) := by obtain ⟨j,hj,htail⟩ := local_mellin_tail_power_saving A B D refine ⟨j,hj,?_⟩ intro L Y h S a N hL hY hh hhi hS hN hE exact (local_mellin_weighted_energy_truncation S a hh (R := L/h) hj).trans (_root_.add_le_add le_rfl (htail L Y h S a N hL hY hh hhi hS hN hE)) end Bounty end section /- Exact translation of local energy intervals to zero. -/ open MeasureTheory namespace Bounty theorem integral_centered_interval (f : ℝ → ℝ) (c w : ℝ) (hw : 0 ≤ w) : (∫ x in Set.Icc (c-w) (c+w), f x) = ∫ β in {β : ℝ | |β| ≤ w}, f (c+β) := by have hset : {β : ℝ | |β| ≤ w} = Set.Icc (-w) w := by ext β simp only [Set.mem_ofPred_eq, Set.mem_Icc, abs_le] rw [hset] simp_rw [integral_Icc_eq_integral_Ioc] rw [← intervalIntegral.integral_of_le (show c-w ≤ c+w by linarith), ← intervalIntegral.integral_of_le (show -w ≤ w by linarith), intervalIntegral.integral_comp_add_left] congr 1 theorem finite_fourier_centered_energy (S : Finset ℤ) (f : ℤ → ℂ) (hS : ∀ n ∈ S, 0 ≤ n) (c H : ℝ) (hH : 0 < H) : (∫ x in Set.Icc (c-1/H) (c+1/H), ‖finiteFourierSum S f x‖^2) = ∫ β in {β : ℝ | |β| ≤ 1/H}, ‖localAdditivePolynomial (S.image Int.natAbs) (fun n => f n * fourier (n : ℤ) (c : AddCircle (1 : ℝ))) β‖^2 := by rw [integral_centered_interval _ c (1/H) (by positivity)] simp_rw [finite_fourier_eq_local_additive S f hS] end Bounty end section /- The original signed full-path action is unchanged by exact edge-key relabeling. -/ open Finset open scoped Classical namespace Bounty section Action variable {I K J G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) (f : I → K) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end Action end Bounty end section /- Shift-uniform mean-square bounds for the actual normalized four-factor box. -/ open Finset MeasureTheory namespace Bounty private theorem harmonic_weight_add (t v x : ℝ) : harmonicMellinWeight (t + v) x = harmonicMellinWeight v x * Complex.exp (((Real.log x * t : ℝ) : ℂ) * Complex.I) := by unfold harmonicMellinWeight have he : Complex.I * (((t + v) * Real.log x : ℝ) : ℂ) = Complex.I * ((v * Real.log x : ℝ) : ℂ) + ((Real.log x * t : ℝ) : ℂ) * Complex.I := by push_cast; ring rw [he, Complex.exp_add] ring theorem harmonic_polynomial_shifted_mean_square (S : Finset ℕ) (a : ℕ → ℂ) (N : ℕ) (T v : ℝ) (hT : 0 ≤ T) (hS : ∀ n ∈ S, 1 ≤ n ∧ n ≤ N) : (∫ t in Set.Icc (-T) T, ‖∑ n ∈ S, a n * harmonicMellinWeight (t + v) n‖ ^ 2) ≤ (2*T + 4*(N : ℝ)*(1 + Real.log N)) * ∑ n ∈ S, ‖a n / (n : ℂ)‖ ^ 2 := by have hm := dirichlet_polynomial_mean_square S (fun n => a n * harmonicMellinWeight v n) N (-T) T (by linarith) hS rw [intervalIntegral.integral_of_le (by linarith), ← integral_Icc_eq_integral_Ioc] at hm rw [show T - -T = 2*T by ring] at hm calc _ = ∫ t in Set.Icc (-T) T, ‖∑ n ∈ S, (a n * harmonicMellinWeight v n) * Complex.exp (((Real.log (n : ℝ) * t : ℝ) : ℂ) * Complex.I)‖ ^ 2 := by apply setIntegral_congr_fun measurableSet_Icc intro t _ simp only [harmonic_weight_add, mul_assoc] _ ≤ _ := hm _ = _ := by congr 1 apply sum_congr rfl intro n hn rw [norm_mul, norm_harmonic_mellin_weight v (by exact_mod_cast (hS n hn).1), norm_div, Complex.norm_natCast] ring theorem harmonic_four_box_shifted_mean_square (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) {D₀ A₀ B₀ C₀ U : ℝ} (hD₀ : 0 ≤ D₀) (hA₀ : 0 ≤ A₀) (hB₀ : 0 ≤ B₀) (hC₀ : 0 ≤ C₀) (hU : 0 < U) (hD : ∀ d ∈ D, 0 < d) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) (hδ : ∀ d ∈ D, ‖δ d‖ ≤ D₀) (hα : ∀ a ∈ A, ‖α a‖ ≤ A₀) (hβ : ∀ b ∈ B, ‖β b‖ ≤ B₀) (hγ : ∀ c ∈ C, ‖γ c‖ ≤ C₀) (N : ℕ) (hproduct : ∀ d ∈ D, ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, U ≤ ((d*a*b*c : ℕ) : ℝ) ∧ d*a*b*c ≤ N) (T v : ℝ) (hT : 0 ≤ T) : (∫ t in Set.Icc (-T) T, ‖(∑ d ∈ D, δ d * harmonicMellinWeight (t + v) d) * (∑ a ∈ A, α a * harmonicMellinWeight (t + v) a) * (∑ b ∈ B, β b * harmonicMellinWeight (t + v) b) * (∑ c ∈ C, γ c * harmonicMellinWeight (t + v) c)‖ ^ 2) ≤ (2*T + 4*(N : ℝ)*(1 + Real.log N)) * ((D₀*A₀*B₀*C₀)^2 * ((N : ℝ)*(1 + Real.log N)^15) / U^2) := by classical let S := (D ×ˢ (A ×ˢ (B ×ˢ C))).image (fun q => q.1*q.2.1*q.2.2.1*q.2.2.2) let δ' : ℕ → ℂ := fun n => if n ∈ D then δ n else 0 let α' : ℕ → ℂ := fun n => if n ∈ A then α n else 0 let β' : ℕ → ℂ := fun n => if n ∈ B then β n else 0 let γ' : ℕ → ℂ := fun n => if n ∈ C then γ n else 0 have hS : ∀ n ∈ S, 0 < n ∧ n ≤ N ∧ U ≤ (n : ℝ) := by intro n hn obtain ⟨q, hq, rfl⟩ := mem_image.mp hn obtain ⟨hd, ha, hb, hc⟩ := by simpa only [mem_product] using hq have hp := hproduct q.1 hd q.2.1 ha q.2.2.1 hb q.2.2.2 hc exact ⟨mul_pos (mul_pos (mul_pos (hD _ hd) (hA _ ha)) (hB _ hb)) (hC _ hc), hp.2, hp.1⟩ have hrepr (z : ℝ) : (∑ n ∈ S, endpointFourConvolution δ' α' β' γ' n * harmonicMellinWeight z n) = (∑ d ∈ D, δ d * harmonicMellinWeight z d) * (∑ a ∈ A, α a * harmonicMellinWeight z a) * (∑ b ∈ B, β b * harmonicMellinWeight z b) * (∑ c ∈ C, γ c * harmonicMellinWeight z c) := by have he := endpoint_four_finite_mellin S D A B C δ' α' β' γ' hD hA hB hC (by intro n hn; simp [δ', hn]) (by intro n hn; simp [α', hn]) (by intro n hn; simp [β', hn]) (by intro n hn; simp [γ', hn]) (by intro d hd a ha b hb c hc exact mem_image.mpr ⟨(d,a,b,c), by simp [hd, ha, hb, hc], rfl⟩) z simpa [δ', α', β', γ'] using he have he := endpoint_four_convolution_reciprocal_energy δ' α' β' γ' hD₀ hA₀ hB₀ hC₀ hU (by intro n dsimp only [δ'] split_ifs with hn · exact hδ n hn · simpa only [norm_zero] using hD₀) (by intro n dsimp only [α'] split_ifs with hn · exact hα n hn · simpa only [norm_zero] using hA₀) (by intro n dsimp only [β'] split_ifs with hn · exact hβ n hn · simpa only [norm_zero] using hB₀) (by intro n dsimp only [γ'] split_ifs with hn · exact hγ n hn · simpa only [norm_zero] using hC₀) S N (fun n hn => ⟨(hS n hn).1, (hS n hn).2.1⟩) (fun n hn => (hS n hn).2.2) calc _ = ∫ t in Set.Icc (-T) T, ‖∑ n ∈ S, endpointFourConvolution δ' α' β' γ' n * harmonicMellinWeight (t + v) n‖ ^ 2 := by apply setIntegral_congr_fun measurableSet_Icc intro t _ dsimp only rw [hrepr] _ ≤ (2*T + 4*(N : ℝ)*(1 + Real.log N)) * ∑ n ∈ S, ‖endpointFourConvolution δ' α' β' γ' n / (n : ℂ)‖ ^ 2 := harmonic_polynomial_shifted_mean_square S _ N T v hT (fun n hn => ⟨(hS n hn).1, (hS n hn).2.1⟩) _ ≤ _ := mul_le_mul_of_nonneg_left he (by have hlog := Real.log_natCast_nonneg N positivity) end Bounty end section /- Actual normalized auxiliary averages from rational local energy and minor bounds. -/ open Finset MeasureTheory open scoped Classical ComplexConjugate namespace Bounty theorem physical_aux_shift_local_energy_decay {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (hA : ∀ a, ‖bA a‖ ≤ 1) (hB : ∀ b, ‖bB b‖ ≤ 1) (S T : Finset ℤ) (f g : ℤ → ℂ) {L q K HA HB Y E D : ℝ} (hk : k ≠ 0) (hL : 5 ≤ L) (hq : 0 ≤ q) (hK : 0 ≤ K) (hkB : (k.natAbs : ℝ) ≤ L^K) (hHA : 0 < HA) (hHB : 0 < HB) (hY : 0 ≤ Y) (hscale : L^q ≤ HA*HB) (hf : (∑ n ∈ S, ‖f n‖^2) ≤ Y*L^E) (hg : (∑ n ∈ T, ‖g n‖^2) ≤ Y*L^E) (hminor : ∀ θ, θ ∉ productMajorArcSet k L q HA HB → ‖physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ‖ ≤ L^(-(D+E+1))) (hlocal : ∀ (r : ℕ), 0 < r → (r : ℝ) ≤ L^(K+q) → ∀ a : ℤ, (∫ x in Set.Icc ((a : ℝ)/r-1/(|(k : ℝ)| *(HA*HB)/L^q)) ((a : ℝ)/r+1/(|(k : ℝ)| *(HA*HB)/L^q)), ‖finiteFourierSum S f x‖^2) ≤ Y*L^(-((2*D+E+2)+2*q+K+1))) : ‖∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ)* bA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * bB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 * ∑ n ∈ S, let δ : ℤ := k*(∏ g, ∏ j : repeatedBigAuxCut A B g, (aux g j).val : ℕ) if n+δ ∈ T then conj (f n)*g (n+δ) else 0‖ ≤ Y*L^(-D) := by have hLp : 0 < L := by linarith have hm := product_major_energy_of_rational_local S f hk hL hq hK hkB hHA hHB hY hscale hlocal exact (physical_aux_shift_major_energy P V A B hU hAB k bA bB hV hMass hA hB S T f g (productMajorArcSet k L q HA HB) (product_major_arc_set_measurable k L q HA HB) (Real.rpow_pos_of_pos hLp _).le hminor).trans (major_minor_pairing_decay (by linarith) hY (by positivity) (by positivity) (integral_nonneg fun _ => sq_nonneg _) hf hg hm) end Bounty end section /- Polynomially small conductor ranges contribute a negligible fraction of candidate mass. -/ open Finset Filter namespace Bounty theorem exists_candidate_small_conductor_relative_power_bound (hZ : PrimitiveZeroFreeHalfPlane) {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (A B : ℝ) : ∃ J : ℕ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → ∀ N R : ℕ, (N : ℝ) ≤ Real.exp L → (R : ℝ) ≤ L^A → candidateSmallPrimitiveTypeIMass c L q r jStar N R ≤ candidateCoefficientWindowMass c L q r jStar * L^(-B) := by obtain ⟨J, hnorm⟩ := exists_candidate_character_relative_power_bound hZ hc hr hq0 hq1 hcenter (A+B+2) refine ⟨J, ?_⟩ filter_upwards [hnorm, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (Real.log 2), eventually_ge_atTop (4*primeEulerProductUpperConstant)] with L hnormL hL1 hlog2 hlarge intro jStar hj N R hN hR have hL : 0 < L := lt_of_lt_of_le zero_lt_one hL1 let XA := candidateCoefficientWindowMass c L q r jStar have hXA : 0 ≤ XA := by apply sum_nonneg intro u _ exact candidate_coefficient_nonneg c L hq0 r jStar u have hweight : 0 ≤ XA * L^(-(A+B+2)) := by positivity have hD : 1 ≤ Real.exp L := by exact (Real.one_le_exp_iff).mpr hL.le have hbound := candidate_small_primitive_mass_le c L q r jStar N R (fun _ => XA * L^(-(A+B+2))) (fun _ _ => hweight) hD hN (by intro d hd f hf ψ _ hψ have hdpos : 0 < d := (mem_Icc.mp (mem_filter.mp hd).1).1 have hdN : d ≤ N := (mem_Icc.mp (mem_filter.mp hd).1).2 have hffilt := mem_filter.mp hf have hfpos : 0 < f := lt_trans Nat.zero_lt_one hffilt.2.1 have hfdvd : f ∣ d := Nat.dvd_of_mem_divisors hffilt.1 have hfle : f ≤ d := Nat.le_of_dvd hdpos hfdvd have hfL : (f : ℝ) ≤ Real.exp L := (Nat.cast_le.mpr (hfle.trans hdN)).trans hN have hdf : d/f ≠ 0 := (Nat.div_pos hfle hfpos).ne' have hdfL : ((d/f : ℕ) : ℝ) ≤ Real.exp L := (Nat.cast_le.mpr ((Nat.div_le_self d f).trans hdN)).trans hN exact hnormL jStar hj f hfpos hfL ψ hψ (d/f) hdf hdfL) have hlog : Real.log (2*Real.exp L) ≤ 2*L := by rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) (Real.exp_ne_zero L), Real.log_exp] linarith have hlog0 : 0 ≤ Real.log (2*Real.exp L) := by rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) (Real.exp_ne_zero L), Real.log_exp] positivity have hcardN : (Icc 2 R).card ≤ R := by rw [Nat.card_Icc]; omega have hcard : ((Icc 2 R).card : ℝ) ≤ L^A := (Nat.cast_le.mpr hcardN).trans hR have hsum : (∑ _f ∈ Icc 2 R, XA * L^(-(A+B+2))) ≤ L^A * (XA * L^(-(A+B+2))) := by simp only [sum_const, nsmul_eq_mul] exact mul_le_mul_of_nonneg_right hcard hweight calc _ ≤ ((2*primeEulerProductUpperConstant) * Real.log (2*Real.exp L)) * ∑ _f ∈ Icc 2 R, XA * L^(-(A+B+2)) := hbound _ ≤ ((2*primeEulerProductUpperConstant) * (2*L)) * (L^A * (XA * L^(-(A+B+2)))) := by apply mul_le_mul · exact mul_le_mul_of_nonneg_left hlog (by positivity [primeEulerProductUpperConstant_pos]) · exact hsum · exact sum_nonneg (fun _ _ => hweight) · positivity [primeEulerProductUpperConstant_pos] _ = (4*primeEulerProductUpperConstant*L) * (L^A * (XA * L^(-(A+B+2)))) := by ring _ ≤ (L*L) * (L^A * (XA * L^(-(A+B+2)))) := by apply mul_le_mul_of_nonneg_right · exact mul_le_mul_of_nonneg_right hlarge hL.le · positivity _ = XA * ((L^A * L^(2 : ℝ)) * L^(-(A+B+2))) := by rw [Real.rpow_two]; ring _ = XA * L^(-B) := by rw [← Real.rpow_add hL, ← Real.rpow_add hL] congr 2 ring end Bounty end section /- The literal physical mark-state history satisfies the full-state energy estimate after summing every physical list and bounded memory. This is an unmasked chronological history; a separate whole-path constraint must still be identified when applying it to the original physical sum. -/ namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Physical end Bounty end section /- Exponential character cancellation relative to the actual candidate mass. -/ open Finset Filter namespace Bounty theorem exists_candidate_character_relative_exponential_bound (hZ : PrimitiveZeroFreeHalfPlane) {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) : ∃ J : ℕ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ‖∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime m), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod f)‖ ≤ candidateCoefficientWindowMass c L q r jStar * Real.exp (-(c/128)*L) := by obtain ⟨V, hV, hrest⟩ := exists_candidate_Q_rest_harmonic_upper hc r hr obtain ⟨K, hK, J, hlower⟩ := exists_candidate_coefficient_window_mass_lower hc hr hq0 hq1 hcenter have hsmall := eventually_linear_exponential_profile_le_rpow (div_pos hc (by norm_num : (0 : ℝ) < 128)) (div_pos hc (by norm_num : (0 : ℝ) < 128)) 0 ((16*V)/K) 0 simp only [zero_mul, zero_add, neg_zero, Real.rpow_zero] at hsmall refine ⟨J, ?_⟩ filter_upwards [eventually_candidate_character_exponential_cancellation hZ hc, hrest, hlower, hsmall, eventually_candidate_one_marked_mass_ge_one hc hq0 hq1.le, eventually_gt_atTop (0 : ℝ)] with L hcancel hrestL hlowerL hsmallL hPone hL intro jStar hj f hf hfL χ hχ m hm hmL have hj0 : 0 < jStar := (Nat.zero_le J).trans_lt hj have hP : 0 ≤ candidateOneMarkedHarmonicMass c L q := zero_le_one.trans hPone have hQ : 0 ≤ candidateQHarmonicMass c L r jStar := by apply tsum_nonneg intro n exact div_nonneg (candidate_Q_weight_nonneg c L r jStar n) (Nat.cast_nonneg n) have hexp : Real.exp (-(c/128)*L) * Real.exp (-(c/128)*L) = Real.exp (-(c/64)*L) := by rw [← Real.exp_add]; congr 1; ring have hdecay : ((16*V)/K) * L * Real.exp (-(c/64)*L) ≤ Real.exp (-(c/128)*L) := by calc _ = (((16*V)/K) * L * Real.exp (-(c/128)*L)) * Real.exp (-(c/128)*L) := by rw [mul_assoc (((16*V)/K)*L), hexp] _ ≤ 1 * Real.exp (-(c/128)*L) := mul_le_mul_of_nonneg_right hsmallL (Real.exp_nonneg _) _ = _ := one_mul _ calc _ ≤ (16*Real.exp L) * Real.exp (-(c/64)*L) * candidateOneMarkedHarmonicMass c L q * candidateQRestHarmonicMass c L r jStar hr := hcancel q hq0 r jStar hr hj0 f hf hfL χ hχ m hm hmL _ ≤ (16*Real.exp L) * Real.exp (-(c/64)*L) * candidateOneMarkedHarmonicMass c L q * (V * candidateQHarmonicMass c L r jStar) := mul_le_mul_of_nonneg_left (hrestL jStar hj0) (by positivity) _ = (((16*V)/K) * L * Real.exp (-(c/64)*L)) * (K * (Real.exp L/L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar) := by field_simp _ ≤ Real.exp (-(c/128)*L) * (K * (Real.exp L/L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar) := mul_le_mul_of_nonneg_right hdecay (by positivity) _ ≤ Real.exp (-(c/128)*L) * candidateCoefficientWindowMass c L q r jStar := mul_le_mul_of_nonneg_left (hlowerL jStar hj) (Real.exp_nonneg _) _ = _ := mul_comm _ _ end Bounty end section /- The entire physical history may record every original choice and every encoded source and target. An arbitrary terminal function of this record is transported exactly, with no factorization of its history dependence. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K R : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) end Physical end Bounty end section /- The small-state vacuum pairing of the actual large-minus-small cap trajectory is controlled by the ghost-birth tail. The initial zero-memory mask disappears inside the pairing because the vacuum vanishes elsewhere. -/ open Finset Classical namespace Bounty section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) {b B : ℕ} (h : b ≤ B) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end end Bounty end section /- Product-window decay for actual candidate remainder coefficients in factor-two blocks. -/ open Finset Filter namespace Bounty theorem eventually_candidate_factor_two_block_decay {c q theta : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) (htheta : theta < 1/2) (B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, 0 < jStar → ∀ (h : ℕ) (R P U : ℝ), Real.exp ((c/512)*L) ≤ R → R ≤ Real.exp (theta*L) → ∀ Q S T : Finset ℕ, (∀ d ∈ Q, R/2 ≤ (d : ℝ)) → (∀ d ∈ Q, (d : ℝ) ≤ R) → S ⊆ candidateQBand (c*L) 0 → T ⊆ Icc 1 ⌊16*Real.exp L⌋₊ → (∀ p ∈ S, (p : ℝ) ≤ P ∧ P ≤ 2*(p : ℝ)) → (∀ n ∈ T, (n : ℝ) ≤ U ∧ U ≤ 2*(n : ℝ)) → primitiveCharacterBlockNorm Q (∑ p ∈ S, ∑ n ∈ T, fun f χ => if Real.exp L < ((p*n : ℕ) : ℝ) ∧ ((p*n : ℕ) : ℝ) ≤ 16*Real.exp L then (if p.Coprime h then (1 : ℂ) else 0) * (if n.Coprime h then (candidateRemainderCoefficient c L q r jStar hr n : ℂ) else 0) * χ ((p*n : ℕ) : ZMod f) else 0) ≤ Real.exp L * L^(-B) := by classical let H : ℝ := ((((6/5 : ℝ)*c + 2)*Real.log 2) + 1) have hH : 0 ≤ H := by dsimp only [H]; positivity have hblock := eventually_product_window_block_power_saving hc (div_pos hc (by norm_num : (0 : ℝ) < 512)) htheta hH (by norm_num : (0 : ℝ) ≤ 64) B filter_upwards [hblock, eventually_candidate_remainder_coefficient_le_exp_sqrt hc hr hq0 hq1, eventually_ge_atTop (0 : ℝ)] with L hblockL hremL hL intro jStar hj h R P U hRLo hRHi Q S T hQD hQR hSbase hTbase hSscale hTscale by_cases hactive : ∃ p ∈ S, ∃ n ∈ T, Real.exp L < ((p*n : ℕ) : ℝ) ∧ ((p*n : ℕ) : ℝ) ≤ 16*Real.exp L · obtain ⟨p, hp, n, hn, hpn⟩ := hactive have hwindow : p*n ∈ arithmeticProductWindow 1 (Real.exp L) := by apply (mem_arithmeticProductWindow_iff (by norm_num : (1 : ℕ) ≠ 0) (Real.exp L)).mpr simpa only [one_mul] using hpn obtain ⟨hPlo, hUlo, _, _, _, hUHi, hPU⟩ := candidate_Q_zero_factor_two_geometry hc hr hcenter hL (hSbase hp) hwindow (hSscale p hp).1 (hSscale p hp).2 (hTscale n hn).1 (hTscale n hn).2 have hSpos : ∀ p ∈ S, 0 < p := by intro p hp exact ((mem_dyadicPrimeBand_iff (c*L) 1 (6/5) 0 p).mp (hSbase hp)).1.pos have hTpos : ∀ n ∈ T, 0 < n := fun n hn => (mem_Icc.mp (hTbase hn)).1 have hexp1 : 1 ≤ Real.exp (H*Real.sqrt L) := Real.one_le_exp_iff.mpr (mul_nonneg hH (Real.sqrt_nonneg L)) have halpha : ∀ p ∈ S, ‖if p.Coprime h then (1 : ℂ) else 0‖ ≤ Real.exp (H*Real.sqrt L) := by intro p hp split_ifs · simpa only [norm_one] using hexp1 · simp only [norm_zero]; positivity have hbeta : ∀ n ∈ T, ‖if n.Coprime h then (candidateRemainderCoefficient c L q r jStar hr n : ℂ) else 0‖ ≤ Real.exp (H*Real.sqrt L) := by intro n hn split_ifs · rw [Complex.norm_real, Real.norm_of_nonneg (candidate_remainder_coefficient_nonneg c L hq0 r jStar hr n)] apply hremL jStar hj n exact (Nat.cast_le.mpr (mem_Icc.mp (hTbase hn)).2).trans (Nat.floor_le (by positivity)) · simp only [norm_zero]; positivity have hb := hblockL P U R hPlo.le hUlo.le hUHi hPU hRLo hRHi Q S T hQD hQR hSpos hTpos (fun p hp => (hSscale p hp).1) (fun n hn => (hTscale n hn).1) (fun p => if p.Coprime h then (1 : ℂ) else 0) (fun n => if n.Coprime h then (candidateRemainderCoefficient c L q r jStar hr n : ℂ) else 0) halpha hbeta (Real.exp L) (16*Real.exp L) (Real.exp_pos L).le (by positivity) simpa only [primitiveCharacterBlockNorm, Finset.sum_apply, sum_filter, Nat.cast_mul] using hb · have hz : (∑ p ∈ S, ∑ n ∈ T, fun (f : ℕ) (χ : DirichletCharacter ℂ f) => if Real.exp L < ((p*n : ℕ) : ℝ) ∧ ((p*n : ℕ) : ℝ) ≤ 16*Real.exp L then (if p.Coprime h then (1 : ℂ) else 0) * (if n.Coprime h then (candidateRemainderCoefficient c L q r jStar hr n : ℂ) else 0) * χ ((p*n : ℕ) : ZMod f) else 0) = 0 := by apply sum_eq_zero intro p hp apply sum_eq_zero intro n hn funext f χ exact if_neg (fun hpn => hactive ⟨p, hp, n, hn, hpn⟩) rw [hz, primitiveCharacterBlockNorm_zero] exact mul_nonneg (Real.exp_nonneg L) (Real.rpow_nonneg hL _) end Bounty end section /- The actual uniform prime-product comparison supplies every nonempty free-tuple estimate in the signed grouped block decomposition. -/ open Finset Filter open scoped Classical universe u namespace Bounty theorem eventually_prime_grouped_actual_comparison (hZ : PrimitiveZeroFreeHalfPlane) (c κ s z v D : ℝ) (hc : 0 < c) (hκ : 0 ≤ κ) (hs : 0 ≤ s) (hz : 0 ≤ z) (hD : 0 ≤ D) : let A₀ := D + 2 * (s + 1) let q := 2 * κ + (s + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type u} [Fintype G] [DecidableEq G] {I : G → Type u} [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)], ∀ (P : G → Finset ℕ) (V : G → ℝ), (∀ g, 0 < V g) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, L ^ (-v) ≤ V g) → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ (probes tails : ∀ g, Finset (I g)), (∀ g, Disjoint (probes g) (tails g)) → ∀ m ell : ℕ, 0 < m → (∀ g, (probes g).card = m) → (∀ g, (tails g).card = ell) → ∀ r t : Finset G, Disjoint r t → ∀ active : Finset (Sigma I), activeᶜ = univ.sigma tails → (∀ U ∈ cleanNonemptySubsets (r.sigma probes) ∪ cleanNonemptySubsets (t.sigma probes), ∀ a : (∀ i : U, P i.1.1), Real.log (∏ i : U, (a i).val : ℕ) ≤ L ^ s) → (∀ U ∈ cleanNonemptySubsets (r.sigma probes) ∪ cleanNonemptySubsets (t.sigma probes), ∀ n : ℕ, (∑ a ∈ univ.filter (fun a : (∀ i : U, P i.1.1) => (∏ i : U, (a i).val : ℕ) = n), finiteProductWeight (physicalLabelLaw (P := fun i : U => P i.1.1) (fun i => V i.1.1)) a) ≤ L ^ κ / (n : ℝ)) → ∀ ζ Θ : ℝ, |ζ| ≤ L ^ z → ∀ f g : (∀ g, I g → P g) → ℂ, (∀ a, finiteGroupSlotSymmetric a f) → (∀ a, finiteGroupSlotSymmetric a g) → let kept := fun U : Finset (Sigma I) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ ‖cleanRawPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeActivePhase (fun a : Sigma I => P a.1) active ζ Θ) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g) - ∑ A ∈ cleanNonemptySubsets (r.sigma probes), ∑ B ∈ cleanNonemptySubsets (t.sigma probes), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeAsymmetricComparisonKernel (fun a : Sigma I => P a.1) (fun a => V a.1) active Q h kept kept ζ Θ A B) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g)‖ ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma probes).card + (t.sigma probes).card) * L ^ (-D)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) g) := by intro A₀ q w x filter_upwards [eventually_prime_arbitrary_test_comparison.{u} hZ c κ s z v D hc hκ hs hz hD, eventually_gt_atTop (0 : ℝ)] with L hcomp hL intro Q h ξ G _ _ I _ _ P V hV hP hmass hVlower hband probes tails hpt m ell hm hp ht r t hrt active hactive hlog hatom ζ Θ hζ f g hf hg kept apply prime_grouped_block_bound_of_free_tuple_estimates P V hV (fun a p hp => (hP a p hp).1.pos) hmass probes tails hpt m ell hm hp ht r t hrt active hactive Q h kept kept ζ Θ f g hf hg (L ^ (-D)) (by positivity) intro A hA B hB α fA gB obtain ⟨a, ha⟩ := Finset.nonempty_iff_ne_empty.mpr ((clean_mem_nonempty_subsets _ _).mp hA).1 obtain ⟨b, hb⟩ := Finset.nonempty_iff_ne_empty.mpr ((clean_mem_nonempty_subsets _ _).mp hB).1 obtain ⟨a₀, a₁, hPa, ha₀, ha₁⟩ := hband a.1 obtain ⟨b₀, b₁, hPb, hb₀, hb₁⟩ := hband b.1 have he := hcomp (fun i : A => P i.1.1) (fun i => V i.1.1) ⟨a, ha⟩ (fun i : B => P i.1.1) (fun i => V i.1.1) ⟨b, hb⟩ (fun i => hV i.1.1) (fun i => hV i.1.1) (fun i => hP i.1.1) (fun i => hP i.1.1) (fun i => hmass i.1.1) (fun i => hmass i.1.1) (hVlower a.1) (hVlower b.1) a₀ a₁ b₀ b₁ hPa hPb ha₀ ha₁ hb₀ hb₁ (hlog A (mem_union_left _ hA)) (hlog B (mem_union_right _ hB)) (hatom A (mem_union_left _ hA)) (hatom B (mem_union_right _ hB)) fA gB α ζ hζ have hEA : 0 ≤ ∑ a : (∀ i : A, P i.1.1), finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.1.1) (fun i => V i.1.1)) a * ‖fA a‖ ^ 2 := by apply sum_nonneg intro a _ apply mul_nonneg _ (sq_nonneg _) exact prod_nonneg (fun i _ => physical_label_law_nonneg (P := fun i : A => P i.1.1) (fun i : A => V i.1.1) (fun i => (hV i.1.1).le) i (a i)) dsimp only at he rw [Real.sqrt_mul hEA] at he simpa only [finiteTwoKernelPairingError, finiteWeightedEnergy, mul_assoc] using he end Bounty end section /- The observed physical visit reads out to the original signed raw visit; its existing total cutoff absorbs the bounded-memory zero extension. -/ open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) theorem physical_observed_selected_state_visit (j : I) (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = s.1 then F t else 0) s = globalBirthJointCutRawRow (fun g => GlobalBirthRawStep.visit (a := physicalGroupPhaseActivity s.1 g) (fun _ => 0) (β g) (1 - retention j) (V g) ρ (hV g) B) B B (physicalMarkRawExtension F s.1) (physicalMarkRawReadout s) := by unfold physicalObservedMarkRow dsimp only conv_lhs => arg 4 equals (physicalMarkRawExtension F s.1) => funext u unfold physicalMarkRawExtension split_ifs <;> simp rfl end Physical end Bounty end section /- Selecting one original auxiliary draw and one physical target in the observed edge row recovers its literal raw tensor, with the exact weight. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) omit [∀ g, ∀ p : ↥(P g), NeZero p.val] in theorem physical_observed_selected_edge (j : K) (aux : PhysicalAuxLabels P (C j)) (R : PhysicalMarkLists P J ell) (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalObservedMarkRow C k ω β retention ρ V hV (some (.inr j)) (fun o t => if o = .inr (some ⟨j, aux⟩) ∧ t.1 = R then F (physicalMarkRawReadout t) else 0) s = (ω j (productActiveMemorySplit (fun g => physicalFullSharedIndices (C j g)) B (physicalFullMemoryState (C j) s.1 s.2.2)).1 aux : ℂ) * if physicalListAdmissible (C j) aux s.1 R then jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) (C j) (k j) s.1 R β ρ V aux) F (physicalMarkRawReadout s) else 0 := by unfold physicalObservedMarkRow dsimp only conv_lhs => arg 2 ext T arg 2 ext a' arg 2 arg 2 arg 3 equals (if (Sum.inr (some ⟨j, a'⟩) : PhysicalMarkObservation P ell C) = .inr (some ⟨j, aux⟩) ∧ T = R then physicalMarkRawExtension (B := B) (F ∘ physicalMarkRawReadout) T else fun _ => 0) => funext u by_cases ho : (Sum.inr (some ⟨j, a'⟩) : PhysicalMarkObservation P ell C) = .inr (some ⟨j, aux⟩) <;> by_cases hT : T = R <;> simp only [physicalMarkRawExtension, ho, hT, and_self, and_true, and_false, if_true, if_false, dite_eq_ite, ite_self, Function.comp_apply] refine (sum_eq_single R ?_ (by simp)).trans ?_ · intro T _ hT apply sum_eq_zero intro a' _ have hm : ¬ ((Sum.inr (some ⟨j, a'⟩) : PhysicalMarkObservation P ell C) = .inr (some ⟨j, aux⟩) ∧ T = R) := fun h => hT h.2 rw [if_neg hm] by_cases ha : physicalListAdmissible (C j) a' s.1 T · rw [if_pos ha, physical_full_edge_tensor_zero, mul_zero] · rw [if_neg ha, mul_zero] · refine (sum_eq_single aux ?_ (by simp)).trans ?_ · intro a' _ ha' have ho : (Sum.inr (some ⟨j, a'⟩) : PhysicalMarkObservation P ell C) ≠ .inr (some ⟨j, aux⟩) := by simpa using ha' simp only [ho, false_and, if_false] by_cases ha : physicalListAdmissible (C j) a' s.1 R · rw [if_pos ha, physical_full_edge_tensor_zero, mul_zero] · rw [if_neg ha, mul_zero] · simp only [eq_self, and_self, if_true] by_cases ha : physicalListAdmissible (C j) aux s.1 R · simp only [ha, if_true] rw [physical_mark_raw_tensor_readout] rfl · simp only [ha, if_false] end Physical end Bounty end section /- Empty-memory terminal and initial states for fixed selected physical paths. -/ open scoped Classical namespace Bounty noncomputable def physicalEmptyMemoryTerminal {N J ell B : ℕ} {P : Fin N → Finset ℕ} (s : PhysicalBoundedMarkState P J ell B) : ℂ := if ∀ g, (s.2.2 g).1.val = 0 then 1 else 0 theorem physical_empty_memory_terminal_extension {N J ell B : ℕ} {P : Fin N → Finset ℕ} (R : PhysicalMarkLists P J ell) : physicalMarkRawExtension (B := B) physicalEmptyMemoryTerminal R = fun s => if ∀ g, (s g).2.1 = 0 then (1 : ℂ) else 0 := by apply physical_mark_raw_extension_eq_of_total_cutoff · intro s hs have hn : ¬ ∀ g, (s g).2.1 = 0 := by intro h have hz : globalBirthJointLength s = 0 := by simp only [globalBirthJointLength, h, Finset.sum_const_zero] omega exact if_neg hn · intro s _ rfl noncomputable def physicalInitialMarkState {N J ell : ℕ} {P : Fin N → Finset ℕ} (B : ℕ) (R : PhysicalMarkLists P J ell) : PhysicalBoundedMarkState P J ell B := (R, (fun g => ghostPhaseActivitySupport (physicalGroupPhaseActivity R g)), fun _ => ⟨⟨0, Nat.zero_lt_succ B⟩, Fin.elim0⟩) theorem physical_initial_mark_state_readout {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (L : Fin (n + 1) → PhysicalMarkLists P J ell) : physicalMarkRawReadout (physicalInitialMarkState B (L 0)) = globalBirthJointInitial (fun g => physicalGroupBareAtomicActivity L g 0) := by funext g simp only [physicalMarkRawReadout, physicalInitialMarkState, globalBirthJointInitial, physical_group_bare_atomic_activity_initial] rfl end Bounty end section /- Exact pair-sieve moments indexed by squarefree moduli and a summed lattice error. -/ open Finset namespace Bounty noncomputable def pairSieveRemainder (A B C D m : ℕ) (rough banned : ℕ → Bool) (d : ℕ) : ℝ := ((pairSieveIntersection A B C D m d.primeFactors rough banned).card : ℝ) - (((B : ℝ)-A)*((D : ℝ)-C)*(m.totient : ℝ)/(m : ℝ)^2) * ∏ p ∈ d.primeFactors, pairSieveDensity p (rough p) (banned p) theorem pair_sieve_exact_moment (A B C D m : ℕ) (rough banned : ℕ → Bool) (S : Finset ℕ) (hS : ∀ p ∈ S, p.Prime) : ((pairSieveIntersection A B C D m S rough banned).card : ℝ) = (((B : ℝ)-A)*((D : ℝ)-C)*(m.totient : ℝ)/(m : ℝ)^2) * (∏ p ∈ S, pairSieveDensity p (rough p) (banned p)) + pairSieveRemainder A B C D m rough banned (∏ p ∈ S, p) := by simp only [pairSieveRemainder, Nat.primeFactors_prod hS] ring theorem pair_sieve_remainder_bound (A B C D m d : ℕ) [NeZero m] (rough banned : ℕ → Bool) (hAB : A ≤ B) (hCD : C ≤ D) (hd : Squarefree d) (hdm : ∀ p ∈ d.primeFactors, ¬p ∣ m) : |pairSieveRemainder A B C D m rough banned d| ≤ (m : ℝ)*(d : ℝ)^2 + (((B : ℝ)-A)+((D : ℝ)-C))*(d : ℝ) := by have hb := actual_pair_sieve_intersection_error A B C D m hAB hCD d.primeFactors rough banned (fun p hp => (Nat.mem_primeFactors.mp hp).1) hdm simpa only [pairSieveRemainder, Nat.prod_primeFactors_of_squarefree hd] using hb theorem pair_sieve_remainder_sum_le (A B C D m : ℕ) [NeZero m] (rough banned : ℕ → Bool) (hAB : A ≤ B) (hCD : C ≤ D) (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (hPm : ∀ p ∈ P, ¬p ∣ m) (R : ℝ) (hR : 0 ≤ R) : (∑ d ∈ blockSieveModuli P R, |pairSieveRemainder A B C D m rough banned d|) ≤ (m : ℝ)*R^3 + (((B : ℝ)-A)+((D : ℝ)-C))*R^2 := by have hprod : (∏ p ∈ P, p) ≠ 0 := ne_of_gt (prod_pos (fun p hp => (hP p hp).pos)) have hX : 0 ≤ ((B : ℝ)-A)+((D : ℝ)-C) := add_nonneg (sub_nonneg.mpr (Nat.cast_le.mpr hAB)) (sub_nonneg.mpr (Nat.cast_le.mpr hCD)) have hb (d : ℕ) (hd : d ∈ blockSieveModuli P R) : |pairSieveRemainder A B C D m rough banned d| ≤ (m : ℝ)*R^2 + (((B : ℝ)-A)+((D : ℝ)-C))*R := by obtain ⟨hd0, hdR, hdsf, hdprod⟩ := block_sieve_modulus_properties P hP R hd have hsub : d.primeFactors ⊆ P := by rw [← Nat.primeFactors_prod hP] exact Nat.primeFactors_mono hdprod hprod apply (pair_sieve_remainder_bound A B C D m d rough banned hAB hCD hdsf (fun p hp => hPm p (hsub hp))).trans exact add_le_add (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (Nat.cast_nonneg d) hdR 2) (Nat.cast_nonneg m)) (mul_le_mul_of_nonneg_left hdR hX) have hcard : ((blockSieveModuli P R).card : ℝ) ≤ R := by calc _ ≤ ((Icc 1 ⌊R⌋₊).card : ℝ) := by exact_mod_cast card_le_card (filter_subset (fun d => d ∣ ∏ p ∈ P, p) (Icc 1 ⌊R⌋₊)) _ = (⌊R⌋₊ : ℝ) := by simp _ ≤ R := Nat.floor_le hR calc _ ≤ ∑ _d ∈ blockSieveModuli P R, ((m : ℝ)*R^2 + (((B : ℝ)-A)+((D : ℝ)-C))*R) := sum_le_sum hb _ = ((blockSieveModuli P R).card : ℝ) * ((m : ℝ)*R^2 + (((B : ℝ)-A)+((D : ℝ)-C))*R) := by simp only [sum_const, nsmul_eq_mul] _ ≤ R * ((m : ℝ)*R^2 + (((B : ℝ)-A)+((D : ℝ)-C))*R) := mul_le_mul_of_nonneg_right hcard (by positivity) _ = _ := by ring end Bounty end section /- Exact freshness equivalence retains the original within-event distinctness condition. -/ open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem full_mixed_birth_freshness_iff (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (hx : FullMixedLedgerCovers n B x) (hp : finiteEventPathWeight (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fun tag s => fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V tag s.2) steps x p ≠ 0) : ((∀ (a : FullMixedBirthAddress S B steps) (z : (g : Fin N) × P g), fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z → z.2 ∉ (finiteEventPathOccurrence (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) steps x p a.1).1.1 z.1) ∧ (∀ (a b : FullMixedBirthAddress S B steps) z, a.1.val = b.1.val → fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z → fullMixedLedgerPathBirthLabel n S B A Δ D steps x p b = some z → a = b)) ↔ ((∀ (a : FullMixedBirthAddress S B steps) (z : (g : Fin N) × P g), fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z → z.2 ∉ x.1 z.1) ∧ (∀ (a b : FullMixedBirthAddress S B steps) z, fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z → fullMixedLedgerPathBirthLabel n S B A Δ D steps x p b = some z → a = b)) := by have h := birth_ledger_freshness_iff (fun a : FullMixedBirthAddress S B steps => a.1.val) (fullMixedLedgerPathBirthLabel n S B A Δ D steps x p) (fullMixedLedgerTaggedImage n B x) (fun a => fullMixedLedgerTaggedImage n B (finiteEventPathOccurrence (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) steps x p a.1).1) (fun a z => by rw [mem_full_mixed_ledger_tagged, mem_full_mixed_ledger_tagged] exact full_mixed_ledger_mem_before n S B A Δ D ω μ q ρ V steps x p hx hp a.1 z.1 z.2) simpa only [mem_full_mixed_ledger_tagged] using h end Full end Bounty end section /- The full-cell constant cancellation for the actual prime proxy with a Mellin weight. -/ open Finset Filter namespace Bounty end Bounty end section /- Uniform nonprincipal Mellin cancellation for an actual prime proxy on a truncated cell. -/ open Finset Filter namespace Bounty theorem eventually_prime_proxy_cell_mellin_power_bound {a T : ℝ} (ha : 0 < a) (hT : 0 ≤ T) (S Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y Z : ℝ, Real.exp (a*L) ≤ Y → Real.exp (a*L) ≤ Z → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), χ ≠ 1 → (r : ℝ) ≤ L^T → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ⌊Z⌋₊ ≤ m → n ≤ ⌊Real.exp (L^(-S))*Z⌋₊ → ‖∑ i ∈ Ioc m n, (primeCellProxy L S Z i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by obtain ⟨C, _, hcoeff⟩ := exists_prime_cell_proxy_bound ha filter_upwards [eventually_rough_interval_mellin_power_bound ha hT Bsave, hcoeff S] with L hrough hco intro Y Z hY hZ r hr χ hχ hrT v hv m n hmn hYm hn hZm hnZ have hc := hco Z hZ have hraw := hrough Y hY r χ hχ hrT v hv m n hmn hYm hn have hid : (∑ i ∈ Ioc m n, (primeCellProxy L S Z i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)) = (primeCellProxyCoefficient L S Z : ℂ)* ∑ i ∈ (Ioc m n).filter (fun i : ℕ => ∀ p ∈ i.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)), harmonicMellinWeight v i*χ (i : ZMod r) := by rw [mul_sum, sum_filter] apply sum_congr rfl intro i hi have hiI : i ∈ Ioc ⌊Z⌋₊ ⌊Real.exp (L^(-S))*Z⌋₊ := mem_Ioc.mpr ⟨hZm.trans_lt (mem_Ioc.mp hi).1, (mem_Ioc.mp hi).2.trans hnZ⟩ by_cases hp : ∀ p ∈ i.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ) · have hiR : i ∈ roughBand Z (Real.exp (L^(-S))*Z) (Real.exp (Real.sqrt L)) := mem_filter.mpr ⟨hiI, hp⟩ simp only [primeCellProxy, if_pos hiR, if_pos hp, mul_assoc] · have hiR : i ∉ roughBand Z (Real.exp (L^(-S))*Z) (Real.exp (Real.sqrt L)) := fun hh => hp (mem_filter.mp hh).2 simp only [primeCellProxy, if_neg hiR, if_neg hp, Complex.ofReal_zero, zero_mul] rw [hid, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hc.1] exact (mul_le_mul hc.2.1 hraw (norm_nonneg _) zero_le_one).trans_eq (one_mul _) end Bounty end section /- Memory-order invariance of the original physical residual phase. -/ open Finset Classical namespace Bounty end Bounty end section /- Signed original-event suffixes for a fixed birth forest preserve pending-memory symmetry. -/ open Finset Classical namespace Bounty section Suffix variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (residual : ∀ (tag : Option (J ⊕ K)) s, FullPermutationMixedEvent n S B A Δ D tag s → ℂ) (initial : (g : Fin N) → Finset (P g)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) (θ : (Fin (Fintype.card (FullMixedBirthAddress S B steps)) × Fin (Fintype.card (FullMixedBirthAddress S B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) end Suffix end Bounty end section /- The exact right-closed logarithmic partition used by the count-matched proxies. -/ open Finset namespace Bounty noncomputable def logarithmicCellIndex (δ : ℝ) (n : ℕ) : ℤ := ⌈Real.log (n : ℝ)/δ⌉-1 noncomputable def logarithmicCellBase (δ : ℝ) (k : ℤ) : ℝ := Real.exp ((k : ℝ)*δ) noncomputable def logarithmicCellSet (δ : ℝ) (k : ℤ) : Finset ℕ := Ioc ⌊logarithmicCellBase δ k⌋₊ ⌊Real.exp δ*logarithmicCellBase δ k⌋₊ noncomputable def logarithmicCellIndices (δ : ℝ) (F : Finset ℕ) : Finset ℤ := F.image (logarithmicCellIndex δ) noncomputable def primeLogarithmicProxy (L S : ℝ) (n : ℕ) : ℝ := primeCellProxy L S (logarithmicCellBase (L^(-S)) (logarithmicCellIndex (L^(-S)) n)) n theorem logarithmic_cell_base_pos (δ : ℝ) (k : ℤ) : 0 < logarithmicCellBase δ k := Real.exp_pos _ theorem logarithmic_cell_index_bounds {δ : ℝ} (hδ : 0 < δ) (n : ℕ) : (logarithmicCellIndex δ n : ℝ)*δ < Real.log (n : ℝ) ∧ Real.log (n : ℝ) ≤ ((logarithmicCellIndex δ n : ℝ)+1)*δ := by have h := Int.ceil_eq_iff.mp (rfl : ⌈Real.log (n : ℝ)/δ⌉ = ⌈Real.log (n : ℝ)/δ⌉) constructor · apply (lt_div_iff₀ hδ).mp simpa only [logarithmicCellIndex, Int.cast_sub, Int.cast_one] using h.1 · apply (div_le_iff₀ hδ).mp simpa only [logarithmicCellIndex, Int.cast_sub, Int.cast_one, sub_add_cancel] using h.2 theorem mem_logarithmic_cell_iff {δ : ℝ} (hδ : 0 < δ) {n : ℕ} (hn : 0 < n) (k : ℤ) : n ∈ logarithmicCellSet δ k ↔ logarithmicCellIndex δ n = k := by have hnR : 0 < (n : ℝ) := Nat.cast_pos.mpr hn have he : Real.exp δ*logarithmicCellBase δ k = Real.exp (((k : ℝ)+1)*δ) := by dsimp [logarithmicCellBase] rw [← Real.exp_add] congr 1 ring simp only [logarithmicCellSet, mem_Ioc, Nat.floor_lt (logarithmic_cell_base_pos δ k).le, Nat.le_floor_iff (mul_nonneg (Real.exp_pos δ).le (logarithmic_cell_base_pos δ k).le)] rw [he] change Real.exp ((k : ℝ)*δ) < (n : ℝ) ∧ (n : ℝ) ≤ Real.exp (((k : ℝ)+1)*δ) ↔ _ nth_rw 1 [← Real.exp_log hnR] nth_rw 2 [← Real.exp_log hnR] rw [Real.exp_lt_exp, Real.exp_le_exp] rw [logarithmicCellIndex, sub_eq_iff_eq_add, Int.ceil_eq_iff] simp only [Int.cast_add, Int.cast_one, add_sub_cancel_right] rw [lt_div_iff₀ hδ, div_le_iff₀ hδ] theorem logarithmic_cell_pos {δ : ℝ} {k : ℤ} {n : ℕ} (hn : n ∈ logarithmicCellSet δ k) : 0 < n := lt_of_le_of_lt (Nat.zero_le _) (mem_Ioc.mp hn).1 theorem logarithmic_interval_fiber {δ : ℝ} (hδ : 0 < δ) (m n : ℕ) (k : ℤ) : (Ioc m n).filter (fun i => logarithmicCellIndex δ i = k) = Ioc (max m ⌊logarithmicCellBase δ k⌋₊) (min n ⌊Real.exp δ*logarithmicCellBase δ k⌋₊) := by ext i simp only [mem_filter, mem_Ioc, max_lt_iff, le_min_iff] constructor · rintro ⟨⟨hmi, hin⟩, hik⟩ have hi0 : 0 < i := lt_of_le_of_lt (Nat.zero_le _) hmi have hc := (mem_Ioc.mp ((mem_logarithmic_cell_iff hδ hi0 k).mpr hik)) exact ⟨⟨hmi, hc.1⟩, hin, hc.2⟩ · rintro ⟨⟨hmi, hki⟩, hin, hik⟩ have hi0 : 0 < i := lt_of_le_of_lt (Nat.zero_le _) hmi exact ⟨⟨hmi, hin⟩, (mem_logarithmic_cell_iff hδ hi0 k).mp (mem_Ioc.mpr ⟨hki, hik⟩)⟩ theorem sum_logarithmic_cell_fibers {M : Type*} [AddCommMonoid M] (δ : ℝ) (F : Finset ℕ) (f : ℕ → M) : (∑ k ∈ logarithmicCellIndices δ F, ∑ n ∈ F.filter (fun n => logarithmicCellIndex δ n = k), f n) = ∑ n ∈ F, f n := by classical exact sum_fiberwise_of_maps_to (fun n hn => mem_image.mpr ⟨n, hn, rfl⟩) _ theorem prime_logarithmic_proxy_eq_on_cell {L S : ℝ} (hL : 0 < L) {k : ℤ} {n : ℕ} (hn : n ∈ logarithmicCellSet (L^(-S)) k) : primeLogarithmicProxy L S n = primeCellProxy L S (logarithmicCellBase (L^(-S)) k) n := by unfold primeLogarithmicProxy rw [(mem_logarithmic_cell_iff (by positivity) (logarithmic_cell_pos hn) k).mp hn] end Bounty end section /- An original compatible forest induces the actual local prime-label forest; no head parent comes from a later event. -/ open Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) section Ghost variable (j : J) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) (tail : FullPermutationMixedPath n S B A Δ D steps (fullPermutationMixedEventTarget n S B A Δ D (some (.inl j)) s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩))) end Ghost section Edge variable (k : K) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) (tail : FullPermutationMixedPath n S B A Δ D steps (fullPermutationMixedEventTarget n S B A Δ D (some (.inr k)) s ((fullPermutationEdgeBirthEquiv (J := J) n S B A Δ D s k).symm ⟨sk, fresh⟩))) end Edge end Full end Bounty end section /- The chronological sample embedding keeps the exact original group tag. -/ namespace Bounty end Bounty end section /- Original forest constraints at any owner depend only on current birth labels and the retained past. -/ namespace Bounty section Path variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps s) (u : Fin steps.length) [Fintype (FullMixedEventBirthCoordinate n S B A Δ D (steps.get u) (fullMixedOwnerOccurrence n S B A Δ D steps s p u).1 (fullMixedOwnerOccurrence n S B A Δ D steps s p u).2)] (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Path end Bounty end section /- At any owner, the actual ghost and edge sample order depends only on the fixed skeleton. -/ namespace Bounty section Ghost variable {J K : Type*} {N : ℕ} {P Z : Fin N → Type*} {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (j : J) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (htag : steps.get u = some (.inl j)) (s : ProductBoundedOrderedState P Z M B) (sk : CoupledGhostSkeleton M B s) noncomputable def fullMixedGhostOwnerSampleEmbedding : CoupledGhostSampleIndex M B s sk ↪ Fin (Fintype.card (FullMixedBirthAddress S B steps)) := (coupledGhostLocalSampleEmbedding S B j s sk).trans (fullMixedTaggedOccurrenceEmbedding S B steps u (some (.inl j)) htag) theorem full_mixed_ghost_owner_sample_owner (i : CoupledGhostSampleIndex M B s sk) : fullMixedBirthOwner S B steps (fullMixedBirthOrder S B steps (fullMixedGhostOwnerSampleEmbedding S B j steps u htag s sk i)) = u := full_mixed_tagged_occurrence_owner S B steps u (some (.inl j)) htag _ theorem full_mixed_ghost_owner_sample_group (i : CoupledGhostSampleIndex M B s sk) : (fullMixedBirthOrder S B steps (fullMixedGhostOwnerSampleEmbedding S B j steps u htag s sk i)).2.1 = i.1 := full_mixed_tagged_occurrence_group S B steps u (some (.inl j)) htag _ end Ghost section Edge variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (k : K) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (htag : steps.get u = some (.inr k)) (A : SharedActiveLabels P (S k) → Type*) (Δ D : ∀ c, A c → Fin N → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n (S k) B A Δ D s) noncomputable def fullMixedEdgeOwnerSampleEmbedding : FullActiveEdgeSampleIndex n (S k) B A Δ D s sk ↪ Fin (Fintype.card (FullMixedBirthAddress S B steps)) := (fullEdgeLocalSampleEmbedding (J := J) S B n k A Δ D s sk).trans (fullMixedTaggedOccurrenceEmbedding S B steps u (some (.inr k)) htag) theorem full_mixed_edge_owner_sample_owner (i : FullActiveEdgeSampleIndex n (S k) B A Δ D s sk) : fullMixedBirthOwner S B steps (fullMixedBirthOrder S B steps (fullMixedEdgeOwnerSampleEmbedding n S B k steps u htag A Δ D s sk i)) = u := full_mixed_tagged_occurrence_owner S B steps u (some (.inr k)) htag _ theorem full_mixed_edge_owner_sample_group (i : FullActiveEdgeSampleIndex n (S k) B A Δ D s sk) : (fullMixedBirthOrder S B steps (fullMixedEdgeOwnerSampleEmbedding n S B k steps u htag A Δ D s sk i)).2.1 = i.1 := full_mixed_tagged_occurrence_group S B steps u (some (.inr k)) htag _ end Edge end Bounty end section /- A fixed global birth history is updated only at the original event's owner. -/ open Classical namespace Bounty section History variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) end History end Bounty end section /- The big memory factors can be passed to a finite numbered group index without alteration. -/ open scoped Classical namespace Bounty section Reindex variable {G H I : Type*} (e : G ≃ H) (P : G → Finset ℕ) (J ell : ℕ) (patterns : Finset I) (C : I → G → Finset (Fin J)) [Fintype G] [Fintype H] [DecidableEq G] [DecidableEq H] theorem physical_memory_labeled_group_reindex (V : G → ℝ) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) : physicalMemoryLabeledScalar (fun h => V (e.symm h)) patterns (fun i h => C i (e.symm h)) ζ (fun i => physicalGroupReindexedCoefficient e (C i) (K i)) (physicalEdgeGroupReindex e P J ell patterns C a) (physicalMarkGroupReindex e P J ell L) (physicalMarkGroupReindex e P J ell R) = physicalMemoryLabeledScalar V patterns C ζ K a L R := by unfold physicalMemoryLabeledScalar change (Fintype.card (PhysicalPermutations H J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations H J ell) : ℂ)⁻¹ * (if physicalListAdmissible (fun h => C a.2.2.1.val (e.symm h)) (physicalAuxGroupReindex e P J (C a.2.2.1.val) a.2.2.2) (physicalPermuteLabels (physicalPermutationGroupReindex e J ell a.1) (physicalMarkGroupReindex e P J ell L)) (physicalPermuteLabels (physicalPermutationGroupReindex e J ell a.2.1) (physicalMarkGroupReindex e P J ell R)) then (physicalAuxMass (fun h => V (e.symm h)) (fun h => C a.2.2.1.val (e.symm h)) (physicalAuxGroupReindex e P J (C a.2.2.1.val) a.2.2.2) : ℂ) * physicalGroupReindexedCoefficient e (C a.2.2.1.val) (K a.2.2.1.val) (physicalPermuteLabels (physicalPermutationGroupReindex e J ell a.1) (physicalMarkGroupReindex e P J ell L)) (physicalPermuteLabels (physicalPermutationGroupReindex e J ell a.2.1) (physicalMarkGroupReindex e P J ell R)) (physicalAuxGroupReindex e P J (C a.2.2.1.val) a.2.2.2) * physicalPhase (ζ a.2.2.1.val) (physicalD (fun h => C a.2.2.1.val (e.symm h)) (physicalPermuteLabels (physicalPermutationGroupReindex e J ell a.1) (physicalMarkGroupReindex e P J ell L)) (physicalAuxGroupReindex e P J (C a.2.2.1.val) a.2.2.2)) else 0) = _ simp only [← physical_permute_group_reindex, physical_list_admissible_group_reindex, physical_aux_mass_group_reindex, physical_D_group_reindex, physical_group_reindexed_coefficient_apply] have hc := physical_permutation_group_reindex_card (J := J) (ell := ell) e simp only [← Nat.card_eq_fintype_card] at hc ⊢ rw [hc] end Reindex end Bounty end section /- Current birth support is fixed by the sample slots; only earlier-label presence comes from history. -/ open Classical namespace Bounty noncomputable def ownerSampleSupport {N m L : ℕ} {α : Type*} (embed : Fin m → Fin N) (owner : Fin N → Fin L) (u : Fin L) (history : Fin N → Option α) (i : Fin N) : Prop := if owner i = u then i ∈ Set.range embed else (history i).isSome = true section variable {N m L : ℕ} {α : Type*} (embed : Fin m → Fin N) include N m L α embed theorem owner_sample_support_cover (owner : Fin N → Fin L) (u : Fin L) (history : Fin N → Option α) : ∀ i, ownerSampleSupport embed owner u history i → owner i = u → i ∈ Set.range embed := by intro i hi hu simpa only [ownerSampleSupport, if_pos hu] using hi theorem owner_sample_support_presence (owner : Fin N → Fin L) (u : Fin L) (values history : Fin N → Option α) (hcover : ∀ i, (values i).isSome = true ∧ owner i = u ↔ i ∈ Set.range embed) (hother : ∀ i, owner i ≠ u → values i = history i) : ∀ i, ownerSampleSupport embed owner u history i ↔ (values i).isSome = true := by intro i by_cases hi : owner i = u · simp only [ownerSampleSupport, if_pos hi] exact ⟨fun h => ((hcover i).mpr h).1, fun h => (hcover i).mp ⟨h, hi⟩⟩ · simp only [ownerSampleSupport, if_neg hi, hother i hi] theorem owner_sample_support_anchors_valid (hstrict : StrictMono embed) (owner : Fin N → Fin L) (hmono : Monotone owner) (u : Fin L) (howner : ∀ j, owner (embed j) = u) (history : Fin N → Option α) (code : BirthForestCode N) (hs : birthForestStageSupport owner u (ownerSampleSupport embed owner u history) code) : ∀ j, restrictedBirthAnchors embed code history j ≠ some none := by intro j cases hc : code (embed j) with | none => simp [restrictedBirthAnchors, hc] | some p => by_cases he : ∃ k : Fin j.val, embed (birthForestParentEmbedding j k) = birthForestParentEmbedding (embed j) p · simp [restrictedBirthAnchors, hc, he] · have hp := (hs (embed j) (howner j) p hc).1 have hlt := restricted_birth_external_parent_owner_lt embed hstrict owner hmono u howner (ownerSampleSupport embed owner u history) (owner_sample_support_cover embed owner u history) j p hp he have hv : (history (birthForestParentEmbedding (embed j) p)).isSome = true := by simpa only [ownerSampleSupport, if_neg (ne_of_lt hlt)] using hp have hn : history (birthForestParentEmbedding (embed j) p) ≠ none := by intro h rw [h] at hv cases hv simpa only [restrictedBirthAnchors, hc, if_neg he, ne_eq, Option.some.injEq] using hn theorem owner_sample_stage_iff (hstrict : StrictMono embed) (owner : Fin N → Fin L) (hmono : Monotone owner) (u : Fin L) (howner : ∀ j, owner (embed j) = u) (code : BirthForestCode N) (values history : Fin N → Option α) (localValues : Fin m → α) (hcover : ∀ i, (values i).isSome = true ∧ owner i = u ↔ i ∈ Set.range embed) (hother : ∀ i, owner i ≠ u → values i = history i) (hlocal : ∀ j, values (embed j) = some (localValues j)) : birthForestStageCondition owner u values code ↔ birthForestStageSupport owner u (ownerSampleSupport embed owner u history) code ∧ birthForestEqualValues (restrictedBirthCode embed code) localValues ∧ birthLabelsAnchored (fun j => (restrictedBirthAnchors embed code history j).join) localValues := owner_stage_support_forest_iff embed hstrict owner hmono u howner (ownerSampleSupport embed owner u history) (owner_sample_support_cover embed owner u history) code values history localValues (owner_sample_support_presence embed owner u values history hcover hother) hlocal (fun i hi => hother i (ne_of_lt hi)) end end Bounty end section /- A genuine mixed-measure promotion rarity estimate. The finite choice index can jointly encode small-source permutations and fixed auxiliary draws. Only the scalar eligible-position probability remains as input; all per-choice operator bounds are proved for the actual capped events. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_small_big_promotion_average_energy_bound {q vs : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S G Q : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] [Fintype Q] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : G → ℕ) (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : Q → PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : Q → SharedActiveLabels P shared → ℤ) (Vs : S → ℝ), (∀ s, vs ≤ Vs s) → ∀ (_aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ (T : ℕ), (∀ g, (shared g)ᶜ.card ≤ T) → ∀ (π : Q → ℝ), (∀ a, 0 ≤ π a) → (∑ a, π a ≤ 1) → ∀ (σ : Q → PhysicalPermutations S J ell) (good : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → Prop) (Φ : ∀ a, ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B (Δ a) (D a)) s → ℂ) (H : ℝ), 0 ≤ H → (∀ a s e, ‖Φ a s e‖ ≤ H) → ∀ (δ : ℝ), 0 ≤ δ → (∀ s, good s → (∑ a, if physicalSmallBigEligible n shared B (Δ a) (D a) (physicalSmallBigPermutation (σ a) s) then π a else 0) ≤ δ) → ∀ (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun s => ∑ a, (π a : ℂ) * (if good s then physicalSmallBigFullPhasedAction n shared B (Δ a) (D a) μ ρ V (kbig a) Vs q (fun y e => if ∃ g, (e.2.2 g).2.1.Nonempty then Φ a y e else 0) F (physicalSmallBigPermutation (σ a) s) else 0)) ≤ δ * (H ^ 2 * (A ^ (2 * Fintype.card S) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G)) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_phased_energy_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ intro S G Q _ dS _ dG _ cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ n _ J M shared B Δ D μ ρ V kbig Vs hVs aux v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht π hπ hπmass σ good Φ H hH hΦ δ hδ hrare F hF refine physical_small_big_sparse_permutation_energy_le Vs (fun s => hvs.trans_le (hVs s)) (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1)) π hπ hπmass σ good (fun a => physicalSmallBigEligible n shared B (Δ a) (D a)) _ ?_ hδ ?_ hrare F ?_ · intro a s hno exact physical_small_big_promoting_zero n shared B (Δ a) (D a) μ ρ V (kbig a) Vs q (Φ a) F s hno · exact mul_nonneg (sq_nonneg H) (mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) (pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _)) · intro a apply hbound S G Ps P n J M shared B (Δ a) (D a) μ ρ V (kbig a) Vs hVs aux v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht _ H hH _ F hF intro s e split_ifs · exact hΦ a s e · simpa only [norm_zero] using hH end Bounty end section /- Candidate omission rarity for literal mixed-state support. The big factor may depend on retained big labels and fixed auxiliary data; it is unchanged by the small-source permutation. No big-label injectivity is used. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem physical_small_big_eligible_permute_iff {S G : Type*} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type*} (n : ∀ g, P g → ℕ) {J ell B : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (D_B : SharedActiveLabels P shared → ℕ) (k : ℤ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (σ : PhysicalPermutations S J ell) : physicalSmallBigEligible n shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) (physicalSmallBigPermutation σ s) ↔ ∃ g, (unrestrictedResidueEligible (n g) (-(k * (smallSourcePermutationDilation s.1.2 (D_B (productActiveMemorySplit shared B s.2).1) σ : ℤ))) (smallSourcePermutationDilation s.1.2 (D_B (productActiveMemorySplit shared B s.2).1) σ) (s.2 g).2.2).Nonempty := by rfl end Bounty end section /- The mixed reverse row retains the same big-group energy constant, even though its literal event coefficient includes the reversal ratios. -/ open Finset Classical namespace Bounty theorem physical_small_big_reverse_prefix_energy_le {S G : Type*} [Fintype S] [dS : DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ) (q : ℝ) {v vmin vmax : ℝ} (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g, vmin ≤ V g) (hVhi : ∀ g, V g ≤ vmax) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, (shared g)ᶜ.card ≤ T) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : physicalSmallBigConditionEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigPrefixAction (PhysicalSmallBigFullEvent n shared B (fun d c g => -Δ d c g) D) (physicalSmallBigFullTarget n shared B (fun d c g => -Δ d c g) D) (physicalSmallBigFullCoefficient n shared B (fun d c g => -Δ d c g) D μ ρ V (physicalSmallBigReversePhase n shared B Δ D V)) (fun x => -kbig (productActiveMemorySplit shared B x).1) (physicalSmallBigCondition Vs q F)) ≤ unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * physicalSmallBigConditionEnergy (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigCondition Vs q F) := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) unfold physicalSmallBigConditionEnergy rw [mul_sum] apply sum_le_sum intro d hd simp_rw [physical_small_big_reverse_prefix_eq] exact full_active_reverse_promotion_external_energy_le n shared B (fun c (_ : Unit) => Δ d c) (fun c (_ : Unit) => D d c) (fun _ _ => 1) μ ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct d : ℕ))) (by intros; exact zero_le_one) (by intro c; simp only [Fintype.sum_unique, le_refl]) hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht (physicalSmallBigCondition Vs q F d) (fun r => physical_small_big_condition_memory_symmetric Vs q F hF d r) /- All per-choice operator and conditioning bounds are discharged; A is uniform in J and the event data. -/ theorem exists_physical_small_big_reverse_energy_bound {q vs : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : G → ℕ) (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ), (∀ s, vs ≤ Vs s) → ∀ (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ (T : ℕ), (∀ g, (shared g)ᶜ.card ≤ T) → ∀ (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigReverseAction n shared B Δ D μ ρ V kbig Vs q aux F) ≤ A ^ (2 * Fintype.card S) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_energy_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ intro S G _ dS _ dG cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ n _ J M shared B Δ D μ ρ V kbig Vs hVs aux v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht F hF have h := hbound S (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) Ps J Vs hVs 0 (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1)) aux (fun _ => 1) (PhysicalSmallBigFullEvent n shared B (fun d c g => -Δ d c g) D) (physicalSmallBigFullTarget n shared B (fun d c g => -Δ d c g) D) (physicalSmallBigFullCoefficient n shared B (fun d c g => -Δ d c g) D μ ρ V (physicalSmallBigReversePhase n shared B Δ D V)) (fun x => -kbig (productActiveMemorySplit shared B x).1) 1 (unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) zero_le_one (pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _) (by intro d; simp) F (physical_small_big_reverse_prefix_energy_le n shared B Δ D μ ρ V kbig Vs q hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht F hF) simp only [one_pow, mul_one] at h convert h using 1 <;> congr 2 end Bounty end section /- Literal reverse mixed events vanish unless an old big-memory position is eligible for promotion. This is a support statement, not a norm premise. -/ open Finset Classical namespace Bounty theorem physical_small_big_reverse_zero {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ) (q : ℝ) (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (hno : ¬ ∃ g, (unrestrictedResidueEligible (n g) (-Δ (physicalSharedPrefix s.1.2) (productActiveMemorySplit shared B s.2).1 g) (D (physicalSharedPrefix s.1.2) (productActiveMemorySplit shared B s.2).1 g) (s.2 g).2.2).Nonempty) : physicalSmallBigReverseAction n shared B Δ D μ ρ V kbig Vs q aux F s = 0 := by unfold physicalSmallBigReverseAction physicalSmallBigAction apply sum_eq_zero rintro ⟨L, e⟩ he have hp : ¬ ((∀ g, (e.2 g).1 = ∅) ∧ (∃ g, (e.2 g).2.1 ≠ ∅)) := by rintro ⟨_, g, hg⟩ apply hno refine ⟨g, ?_⟩ exact unrestricted_promoting_event_eligible (n g) _ _ (shared g)ᶜ.card B ((productActiveMemorySplit shared B s.2).2 g) (e.2 g) hg simp only [physicalSmallBigEventWeight, physicalSmallBigFullCoefficient, physicalSmallBigReversePhase, if_neg hp, mul_zero, zero_mul] end Bounty end section /- Pointwise completion form of the positive mixed row. It makes explicit that the source small factor is independent of the big pending-memory order. -/ open Finset Classical namespace Bounty noncomputable def physicalSmallBigCompletion {S X : Type*} [Fintype S] {P : S → Finset ℕ} {J ell : ℕ} (q : ℝ) (F : PhysicalSmallBigState P J ell X → ℂ) (d : PhysicalSharedLists P J) (x : X) (r : PhysicalResidues P) : ℂ := ∑ L : PhysicalMarkLists P J ell, if physicalSharedPrefix L = d then (physicalResidueVertexWeight L (Real.sqrt q) r : ℂ) * F ((r, L), x) else 0 theorem physical_small_big_action_completion {S X : Type*} [Fintype S] [DecidableEq S] {P : S → Finset ℕ} {J ell : ℕ} (V : S → ℝ) (q : ℝ) (aux : PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) (E : PhysicalSharedLists P J → X → Type*) [∀ d x, Fintype (E d x)] (target : ∀ d x, E d x → X) (a : PhysicalResidues P → ∀ d x, E d x → ℂ) (k : X → ℤ) (F : PhysicalSmallBigState P J ell X → ℂ) (r : PhysicalResidues P) (L : PhysicalMarkLists P J ell) (x : X) : physicalSmallBigAction V q 0 aux (fun _ => 1) E target a k F ((r,L),x) = ((physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell * physicalResidueVertexWeight L (Real.sqrt q) r : ℝ) : ℂ) * physicalSmallBigPrefixAction E target a k (physicalSmallBigCompletion q F) (physicalSharedPrefix L) x r := by unfold physicalSmallBigAction physicalSmallBigEventWeight physicalSmallBigTarget physicalSmallBigPrefixAction physicalSmallBigCompletion simp only [Fintype.sum_prod_type] rw [sum_comm] simp only [mul_sum] apply sum_congr rfl intro e he apply sum_congr rfl intro R hR rw [physical_bare_empty_prefix V 0 aux (fun _ => 1) L R] have hz : physicalPhase 0 (physicalSharedProduct (physicalSharedPrefix L)) = 1 := by simp [physicalPhase] by_cases hh : physicalSharedPrefix L = physicalSharedPrefix R · simp only [if_pos hh, if_pos hh.symm, hz, mul_one, Complex.ofReal_mul] ring · have hh' : physicalSharedPrefix R ≠ physicalSharedPrefix L := Ne.symm hh simp only [if_neg hh, if_neg hh', zero_mul, mul_zero] theorem physical_small_big_completion_memory_symmetric {S G : Type*} [Fintype S] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} (q : ℝ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) (d : PhysicalSharedLists Ps J) (r : PhysicalResidues Ps) : ProductMemorySymmetric (fun x => physicalSmallBigCompletion q F d x r) := by intro x g τ unfold physicalSmallBigCompletion apply sum_congr rfl intro L hL split_ifs · exact congrArg (fun z : ℂ => (physicalResidueVertexWeight L (Real.sqrt q) r : ℂ) * z) (hF (r,L) x g τ) · rfl end Bounty end section /- Literal dirty domination after small-source averaging. Storage is identified with the exact row whose two-sided adjoint estimate is proved. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ) (q : ℝ) (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) theorem physical_small_big_storage_eq_phased (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) : physicalSmallBigStorageAction n shared B Δ D μ ρ V kbig Vs q aux F = physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun _ e => if (∀ g, (e.2.2 g).2.1 = ∅) ∧ (∃ g, (e.2.2 g).1.Nonempty) then 1 else 0) F := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold physicalSmallBigStorageAction physicalSmallBigFullCoefficient have h := physical_small_big_action_eq_phased Vs q 0 aux (fun _ => 1) (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullWeight n shared B Δ D μ ρ V) (fun r d x e => physicalSmallBigStoragePhase n shared B Δ D d x r e) (fun x => kbig (productActiveMemorySplit shared B x).1) F simp only [physicalSmallBigFullWeight, physicalSmallBigFullPhasedAction, physicalSmallBigStoragePhase, physicalPhase, zero_mul, Complex.ofReal_zero, Complex.exp_zero, one_mul, Finset.nonempty_iff_ne_empty] at h ⊢ convert h using 1 <;> funext s all_goals simp only [physicalSmallBigAction, physicalSmallBigPhasedAction, physicalSmallBigEventWeight] apply sum_congr rfl intro e _ dsimp only theorem physical_small_big_full_dirty_norm_le_positive (hVs : ∀ s, 0 < Vs s) (hμ : ∀ g p, 0 ≤ μ g p) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ V g) (Φ : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s → ℂ) (hΦ : ∀ s e, ‖Φ s e‖ ≤ 1) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) : ‖physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun y e => if ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅) then Φ y e else 0) F s‖ ≤ (physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun _ e => if ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅) then 1 else 0) (complexNormEnvelope F) s).re := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) have h := physical_small_big_masked_norm_le_positive Vs q (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (physicalSmallBigFullWeight n shared B Δ D μ ρ V) (fun x => kbig (productActiveMemorySplit shared B x).1) hVs (physical_small_big_full_weight_nonneg n shared B Δ D μ ρ V hμ hρ hV) (fun _ e => ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅)) Φ hΦ F s unfold physicalSmallBigFullPhasedAction physicalSmallBigPhasedAction at h ⊢ convert h using 1 <;> congr 1 <;> apply sum_congr rfl <;> intro e _ <;> dsimp only <;> split_ifs <;> rfl variable [DecidableEq S] theorem physical_small_big_averaged_dirty_domination (hVs : ∀ s, 0 < Vs s) (hμ : ∀ g p, 0 ≤ μ g p) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ V g) (Φ : ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n shared B Δ D) s → ℂ) (hΦ : ∀ s e, ‖Φ s e‖ ≤ 1) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) : ‖physicalSmallBigAverage (physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun y e => if ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅) then Φ y e else 0) F) s‖ ≤ ‖physicalSmallBigAverage (physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun _ e => if ∃ g, (e.2.2 g).2.1.Nonempty then 1 else 0) (complexNormEnvelope F)) s + physicalSmallBigAverage (physicalSmallBigStorageAction n shared B Δ D μ ρ V kbig Vs q aux (complexNormEnvelope F)) s‖ := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) have h := physical_small_big_average_norm_domination _ _ (physical_small_big_full_dirty_norm_le_positive n shared B Δ D μ ρ V kbig Vs q hVs hμ hρ hV Φ hΦ F) s rw [physical_small_big_full_dirty_positive_split, ← physical_small_big_storage_eq_phased n shared B Δ D μ ρ V kbig Vs q aux, physical_small_big_average_add] at h exact h.trans (Complex.re_le_norm _) end end Bounty end section /- Explicit determinant domain for the finite Type-II off-diagonal sum. -/ open Finset namespace Bounty def TypeIIShiftConditions (E N : Finset ℕ) (y : TypeIIShiftIndex) : Prop := 0 < y.2.1.1 ∧ y.1.1 ≠ 0 ∧ y.1.2 = y.2.2.1 * y.2.1.2 ∧ (y.1.2 : ℤ) + y.1.1 = (y.2.1.1 : ℤ) * y.2.2.2 ∧ Int.ModEq (2 * |y.1.1|) (y.2.1.1 : ℤ) (y.2.2.1 : ℤ) ∧ 0 < typeIIRecoveredE y ∧ 0 < typeIIRecoveredN y ∧ (typeIIRecoveredE y).toNat ∈ E ∧ (typeIIRecoveredN y).toNat ∈ N noncomputable def typeIIDeterminantDomain (E N M H : Finset ℕ) (K : Finset ℤ) (Z : Finset ℕ) : Finset TypeIIShiftIndex := by classical exact ((K ×ˢ Z) ×ˢ ((M ×ˢ H) ×ˢ (M ×ˢ H))).filter (TypeIIShiftConditions E N) theorem typeII_shift_map_conditions {E N M H : Finset ℕ} {x : TypeIIOffIndex} (hx : x ∈ typeIIOffDiagonalSupport E N M H) : TypeIIShiftConditions E N (typeIIShiftMap x) := by obtain ⟨he, hn, hm, hh, hm', hh', hne, hfirst, hsecond⟩ := mem_typeII_off_diagonal_support.mp hx have hp := typeII_off_support_positive hx obtain ⟨k, hk, _⟩ := typeII_determinant_unique_nat hfirst hsecond hne obtain ⟨hEq, hNq⟩ := typeII_recovered_quotients hx refine ⟨hp.2.2.1, ?_, rfl, ?_, ?_, ?_, ?_, ?_, ?_⟩ · change (x.2.1.1 : ℤ) * x.2.2.2 - (x.2.2.1 : ℤ) * x.2.1.2 ≠ 0 rw [hk.2.2.2] exact hk.1 · change ((x.2.2.1 * x.2.1.2 : ℕ) : ℤ) + ((x.2.1.1 : ℤ) * x.2.2.2 - (x.2.2.1 : ℤ) * x.2.1.2) = (x.2.1.1 : ℤ) * x.2.2.2 push_cast ring · change Int.ModEq (2 * |(x.2.1.1 : ℤ) * x.2.2.2 - (x.2.2.1 : ℤ) * x.2.1.2|) (x.2.1.1 : ℤ) (x.2.2.1 : ℤ) rw [hk.2.2.2] exact typeII_determinant_congruence hk.2.1 · rw [hEq] exact_mod_cast hp.1 · rw [hNq] exact_mod_cast hp.2.1 · simpa only [hEq, Int.toNat_natCast] using he · simpa only [hNq, Int.toNat_natCast] using hn theorem typeII_shift_conditions_reconstruction {E N M H : Finset ℕ} {y : TypeIIShiftIndex} {W : ℝ} (hv : y.2.1 ∈ M ×ˢ H) (hw : y.2.2 ∈ M ×ˢ H) (hconditions : TypeIIShiftConditions E N y) (hrough : ∀ p ∈ y.2.1.1.primeFactors, W < (p : ℝ)) (hsmall : |(y.1.1 : ℝ)| ≤ W) : typeIIRecoveredIndex y ∈ typeIIOffDiagonalSupport E N M H ∧ typeIIShiftMap (typeIIRecoveredIndex y) = y := by obtain ⟨hm, hk, hz, hcross, hmod, hepos, hnpos, heE, hnN⟩ := hconditions have hc := typeII_rough_coprime_determinant hm hk hrough hsmall have hd : (y.2.1.1 : ℤ) * y.2.2.2 - (y.2.2.1 : ℤ) * y.2.1.2 = y.1.1 := by rw [hz, Nat.cast_mul] at hcross linarith obtain ⟨en, hen, _⟩ := typeII_determinant_from_congruence (by exact_mod_cast hm) (by positivity : (0 : ℤ) ≤ y.2.1.2) hk hc hd hmod hepos have hEq : typeIIRecoveredE y = en.1 := typeII_determinant_e_quotient hk hen.2.2.2.2.1 have hNq : typeIIRecoveredN y = en.2 := by unfold typeIIRecoveredN rw [hEq] exact typeII_determinant_n_quotient (by exact_mod_cast hm.ne') hen.2.2.1 have hEc : ((typeIIRecoveredE y).toNat : ℤ) = en.1 := by rw [hEq] exact Int.toNat_of_nonneg hen.1.le have hNc : ((typeIIRecoveredN y).toNat : ℤ) = en.2 := by rw [hNq] exact Int.toNat_of_nonneg hen.2.1.le have hfirst : y.2.1.1 * (typeIIRecoveredN y).toNat = 2 * (typeIIRecoveredE y).toNat * y.2.1.2 + 1 := by exact_mod_cast (show (y.2.1.1 : ℤ) * ((typeIIRecoveredN y).toNat : ℤ) = 2 * ((typeIIRecoveredE y).toNat : ℤ) * y.2.1.2 + 1 by rw [hEc, hNc]; exact hen.2.2.1) have hsecond : y.2.2.1 * (typeIIRecoveredN y).toNat = 2 * (typeIIRecoveredE y).toNat * y.2.2.2 + 1 := by exact_mod_cast (show (y.2.2.1 : ℤ) * ((typeIIRecoveredN y).toNat : ℤ) = 2 * ((typeIIRecoveredE y).toNat : ℤ) * y.2.2.2 + 1 by rw [hEc, hNc]; exact hen.2.2.2.1) have hne : y.2.1.1 ≠ y.2.2.1 := by intro heq have hzE : typeIIRecoveredE y = 0 := by unfold typeIIRecoveredE; rw [heq]; simp rw [hzE] at hepos exact (lt_irrefl 0) hepos constructor · apply mem_typeII_off_diagonal_support.mpr exact ⟨heE, hnN, (mem_product.mp hv).1, (mem_product.mp hv).2, (mem_product.mp hw).1, (mem_product.mp hw).2, hne, hfirst, hsecond⟩ · apply Prod.ext · apply Prod.ext · exact hd · exact hz.symm · rfl theorem typeII_shift_image_eq_determinant_domain (E N M H : Finset ℕ) (K : Finset ℤ) (Z : Finset ℕ) {W : ℝ} (hrough : ∀ m ∈ M, ∀ p ∈ m.primeFactors, W < (p : ℝ)) (hsmall : ∀ k ∈ K, |(k : ℝ)| ≤ W) (hK : ∀ x ∈ typeIIOffDiagonalSupport E N M H, (typeIIShiftMap x).1.1 ∈ K) (hZ : ∀ x ∈ typeIIOffDiagonalSupport E N M H, (typeIIShiftMap x).1.2 ∈ Z) : (typeIIOffDiagonalSupport E N M H).image typeIIShiftMap = typeIIDeterminantDomain E N M H K Z := by classical ext y constructor · intro hy obtain ⟨x, hx, rfl⟩ := mem_image.mp hy obtain ⟨he, hn, hm, hh, hm', hh', hne, hfirst, hsecond⟩ := mem_typeII_off_diagonal_support.mp hx apply mem_filter.mpr refine ⟨?_, typeII_shift_map_conditions hx⟩ exact mem_product.mpr ⟨mem_product.mpr ⟨hK x hx, hZ x hx⟩, mem_product.mpr ⟨mem_product.mpr ⟨hm, hh⟩, mem_product.mpr ⟨hm', hh'⟩⟩⟩ · intro hy obtain ⟨hrange, hconditions⟩ := mem_filter.mp hy obtain ⟨hkz, hvw⟩ := mem_product.mp hrange obtain ⟨hv, hw⟩ := mem_product.mp hvw have hr := typeII_shift_conditions_reconstruction hv hw hconditions (hrough _ (mem_product.mp hv).1) (hsmall _ (mem_product.mp hkz).1) exact mem_image.mpr ⟨typeIIRecoveredIndex y, hr.1, hr.2⟩ theorem typeII_off_diagonal_energy_eq_determinant_sum (E N M H : Finset ℕ) (K : Finset ℤ) (Z : Finset ℕ) {W : ℝ} (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) (hrough : ∀ m ∈ M, ∀ p ∈ m.primeFactors, W < (p : ℝ)) (hsmall : ∀ k ∈ K, |(k : ℝ)| ≤ W) (hK : ∀ x ∈ typeIIOffDiagonalSupport E N M H, (typeIIShiftMap x).1.1 ∈ K) (hZ : ∀ x ∈ typeIIOffDiagonalSupport E N M H, (typeIIShiftMap x).1.2 ∈ Z) : typeIIOffDiagonalEnergy E N M H η α aH = ∑ y ∈ typeIIDeterminantDomain E N M H K Z, typeIIShiftWeight η α aH y := by rw [typeII_off_diagonal_energy_eq_shift_image, typeII_shift_image_eq_determinant_domain E N M H K Z hrough hsmall hK hZ] end Bounty end section /- Positive local actions for the literal mixed path events. Ghost and edge birth parameters are independent, so ghost births may be doubled alone. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G : Type} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : K → Type) (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) noncomputable def physicalSmallBigPathPositiveWeight (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (e : PhysicalSmallBigPathEvent n shared B A Δ D tag s) : ℝ := |physicalSmallBigPathEventWeight n shared B A Δ D kbig ω μ qghost ρ (match tag with | some (.inl _) => Vghost | _ => Vedge) Vs qsmall tag s e| variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k, Fintype (A k)] noncomputable def physicalSmallBigPathPositiveAction (tag : Option (H ⊕ K)) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) := let _ : ∀ (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)), Fintype (PhysicalSmallBigPathEvent n shared B A Δ D tag s) := physicalSmallBigPathEventFintype n shared B A Δ D finiteLocalEventAction (PhysicalSmallBigPathEvent n shared B A Δ D) (physicalSmallBigPathPositiveWeight n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall) (physicalSmallBigPathEventTarget n shared B A Δ D kbig) tag F omit [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k, Fintype (A k)] in theorem physical_small_big_path_edge_weight_nonneg (hVs : ∀ s, 0 < Vs s) (hω : ∀ k a, 0 ≤ ω k a) (hμ : ∀ g p, 0 ≤ μ g p) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ Vedge g) (k : K) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (e : PhysicalSmallBigPathEvent n shared B A Δ D (some (.inr k) : Option (H ⊕ K)) s) : 0 ≤ physicalSmallBigPathEventWeight n shared B A Δ D kbig ω μ qghost ρ Vedge Vs qsmall (some (.inr k)) s e := by unfold physicalSmallBigPathEventWeight dsimp only apply mul_nonneg · split_ifs · exact mul_nonneg (physical_completion_mass_pos Vs _ ell hVs).le (mul_nonneg (physical_residue_vertex_weight_nonneg _ (Real.sqrt_nonneg qsmall) _) (physical_residue_vertex_weight_nonneg _ (Real.sqrt_nonneg qsmall) _)) · exact le_rfl · exact fullActiveEdgeEventWeight_nonneg n (shared k) B (fun _ => A k) _ _ _ μ ρ Vedge (fun _ a => hω k a) hμ hρ hV s.2 e.2 end end Bounty end section /- Paths and memory heights for moving small states and capped big memory. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : K → Type) (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) abbrev PhysicalSmallBigPath (steps : List (Option (H ⊕ K))) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) := FiniteEventPath (PhysicalSmallBigPathEvent (H := H) (J := J) (ell := ell) n shared B A Δ D) (physicalSmallBigPathEventTarget n shared B A Δ D kbig) steps s variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k, Fintype (A k)] (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) end end Bounty end section /- Supported event transport preserves every small coordinate while changing the big-memory cap. Target agreement is asserted only at nonzero weight. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G : Type} {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (A : K → Type) (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) {b B : ℕ} (h : b ≤ B) variable [Fintype S] [Fintype G] (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) end end Bounty end section /- Fourier inversion over precisely the active allocation slots. -/ open Finset MeasureTheory namespace Bounty abbrev ActiveAllocationIndex {N : ℕ} (active : Fin N → Bool) := {i : Fin N // active i = true} noncomputable def activeAllocationFourierWeight {N : ℕ} (A : ℝ) (active take : Fin N → Bool) (ξ : ActiveAllocationIndex active → ℝ) : ℂ := ∏ i, typeIICutoffFourier A (take i.val) (ξ i) noncomputable def activeAllocationFourierIntegrand {N : ℕ} (A R : ℝ) (v s : Fin N → ℝ) (active take : Fin N → Bool) (ξ : ActiveAllocationIndex active → ℝ) : ℂ := ∏ i, typeIICutoffFourierIntegrand A (take i.val) ((allocationPrefixResidual v R take i.val - v i.val) / s i.val) (ξ i) theorem compact_allocation_active_product {N : ℕ} (A R : ℝ) (v s : Fin N → ℝ) (active take : Fin N → Bool) (hkeep : ∀ i, active i = false → take i = false) : compactAllocationWeight A N v s active R take = ∏ i : ActiveAllocationIndex active, typeIISmoothCutoff A (take i.val) ((allocationPrefixResidual v R take i.val - v i.val) / s i.val) := by classical unfold compactAllocationWeight calc _ = ∏ i, if active i = true then typeIISmoothCutoff A (take i) ((allocationPrefixResidual v R take i - v i) / s i) else 1 := by apply prod_congr rfl intro i hi cases ha : active i · simp [compactSlotTransition, hkeep i ha] · simp [compactSlotTransition] _ = ∏ i ∈ univ.filter (fun i => active i = true), typeIISmoothCutoff A (take i) ((allocationPrefixResidual v R take i - v i) / s i) := (prod_filter _ _).symm _ = _ := prod_subtype _ (by simp) _ theorem active_allocation_fourier_l1_le {N : ℕ} (A C : ℝ) (hC1 : 1 ≤ C) (hC : ∀ take : Bool, (∫ ξ : ℝ, ‖typeIICutoffFourier A take ξ‖) ≤ C) (active take : Fin N → Bool) : (∫ ξ : ActiveAllocationIndex active → ℝ, ‖activeAllocationFourierWeight A active take ξ‖) ≤ C ^ N := by simp only [activeAllocationFourierWeight, norm_prod] rw [integral_fintype_prod_volume_eq_prod (fun (i : ActiveAllocationIndex active) (ξ : ℝ) => ‖typeIICutoffFourier A (take i.val) ξ‖)] calc _ ≤ ∏ _i : ActiveAllocationIndex active, C := prod_le_prod₀ (fun _ _ => integral_nonneg (fun _ => norm_nonneg _)) (fun i _ => hC (take i.val)) _ = C ^ Fintype.card (ActiveAllocationIndex active) := by simp _ ≤ C ^ N := by apply pow_le_pow_right₀ hC1 simpa only [Fintype.card_fin] using Fintype.card_subtype_le (fun i => active i = true) end Bounty end section /- Uniform Fourier costs and power cutoffs for admissible Type-II scales. -/ open Filter MeasureTheory namespace Bounty end Bounty end section /- Polynomially many free labels above an exponential threshold have negligible reciprocal mass. -/ open Finset Filter namespace Bounty theorem finite_reciprocal_sum_le_card_div (T : Finset ℕ) {P : ℝ} (hP : 0 < P) (hT : ∀ p ∈ T, P ≤ (p : ℝ)) : (∑ p ∈ T, 1 / (p : ℝ)) ≤ (T.card : ℝ) / P := by calc _ ≤ ∑ _p ∈ T, 1 / P := sum_le_sum (fun p hp => one_div_le_one_div_of_le hP (hT p hp)) _ = _ := by simp [div_eq_mul_inv] theorem eventually_rpow_mul_exp_neg_rpow_le {a : ℝ} (ha : 0 < a) (C D : ℝ) : ∀ᶠ L : ℝ in atTop, L ^ C * Real.exp (-(L ^ a)) ≤ L ^ (-D) := by filter_upwards [eventually_gt_atTop (0 : ℝ), eventually_mul_rpow_log_add_le_rpow (a := 0) ha ha (show (0 : ℝ) < 1 by norm_num) (C + D) 0] with L hL hlog simp only [Real.rpow_zero, mul_one, add_zero, one_mul] at hlog simp only [Real.rpow_def_of_pos hL] at hlog ⊢ rw [← Real.exp_add] apply Real.exp_le_exp.mpr nlinarith end Bounty end section /- Transfer an integrable bound on the actual physical pairings to the root-weighted sum. -/ open MeasureTheory namespace Bounty end Bounty end section /- Instantiate physical Mellin separation with the actual compact cutoff Fourier transform. -/ open MeasureTheory namespace Bounty end Bounty end section /- The full compact, range-restricted allocation retains the original marking. -/ open Finset Real namespace Bounty noncomputable def candidateRangeAllocationMass (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (E : ℝ) : ℝ := ∑ take : Fin ((candidateQIndices c L).card*r) → Bool, if E/L^88 ≤ (candidateAllocatedFactor c L r jStar x take : ℝ) ∧ (candidateAllocatedFactor c L r jStar x take : ℝ) ≤ E then candidateCompactAllocationWeight c L r jStar x (log E) take else 0 noncomputable def candidateCompactRangeQWeight (c L : ℝ) (r jStar : ℕ) (E : ℝ) (n : ℕ) : ℝ := ∑ x : ∀ slot, candidateQSlotChoices c L r jStar slot, if orderedSlotProduct (candidateQSlotChoices c L r jStar) x = n then candidateRangeAllocationMass c L r jStar x E / ((r.factorial : ℝ)^(candidateQIndices c L).card) else 0 noncomputable def candidateCompactRangeCoefficient (c L q : ℝ) (r jStar : ℕ) (E : ℝ) (u : ℕ) : ℝ := candidateCompactRangeQWeight c L r jStar E (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u) * markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p : ℝ)) (fun _ => 1) (u : ℤ) theorem candidate_range_allocation_mass_bounds (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (E : ℝ) : 0 ≤ candidateRangeAllocationMass c L r jStar x E ∧ candidateRangeAllocationMass c L r jStar x E ≤ 1 := by constructor · exact sum_nonneg (fun take _ => by split_ifs · exact (candidate_compact_allocation_bounds c L r jStar x (log E) take).1 · exact le_rfl) · apply le_trans ?_ (candidate_compact_allocation_total_mass_le_one c L r jStar x (log E)) apply sum_le_sum intro take _ split_ifs · exact le_rfl · exact (candidate_compact_allocation_bounds c L r jStar x (log E) take).1 theorem candidate_compact_range_Q_bounds (c L : ℝ) (r jStar : ℕ) (E : ℝ) (n : ℕ) : 0 ≤ candidateCompactRangeQWeight c L r jStar E n ∧ candidateCompactRangeQWeight c L r jStar E n ≤ candidateQWeight c L r jStar n := by classical have sum_compare {X : Type} (s t : Finset X) (f g : X → ℝ) (hst : s=t) (hfg : ∀ x ∈ s, f x ≤ g x) : (∑ x ∈ s, f x) ≤ ∑ x ∈ t, g x := by rw [← hst] exact sum_le_sum hfg have hnorm : 0 ≤ (r.factorial : ℝ)^(candidateQIndices c L).card := by positivity constructor · exact sum_nonneg (fun x _ => by split_ifs · exact div_nonneg (candidate_range_allocation_mass_bounds c L r jStar x E).1 hnorm · exact le_rfl) · unfold candidateCompactRangeQWeight candidateQWeight orderedSlotWeight apply sum_compare · ext x; simp only [mem_univ] · intro x hx split_ifs · exact div_le_div_of_nonneg_right (candidate_range_allocation_mass_bounds c L r jStar x E).2 hnorm · exact le_rfl theorem candidate_compact_range_coefficient_bounds (c L : ℝ) {q : ℝ} (hq : 0 ≤ q) (r jStar : ℕ) (E : ℝ) (u : ℕ) : 0 ≤ candidateCompactRangeCoefficient c L q r jStar E u ∧ candidateCompactRangeCoefficient c L q r jStar E u ≤ candidateCoefficient c L q r jStar u := by have hw := marked_divisor_weight_nonneg (candidatePIndices c L) (candidatePBand (c*L)) hq (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p : ℝ)) (fun _ => 1) (fun _ _ => sum_nonneg (fun _ _ => by positivity)) (u : ℤ) have hb := candidate_compact_range_Q_bounds c L r jStar E (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u) exact ⟨mul_nonneg hb.1 hw, mul_le_mul_of_nonneg_right hb.2 hw⟩ theorem candidate_range_allocation_mass_eq_one (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (E : ℝ) (hunit : (∑ take, candidateCompactAllocationWeight c L r jStar x (log E) take) = 1) (hrange : ∀ take, 0 < candidateCompactAllocationWeight c L r jStar x (log E) take → E/L^88 ≤ (candidateAllocatedFactor c L r jStar x take : ℝ) ∧ (candidateAllocatedFactor c L r jStar x take : ℝ) ≤ E) : candidateRangeAllocationMass c L r jStar x E = 1 := by rw [← hunit] apply sum_congr rfl intro take ht split_ifs with h · rfl · have hn := (candidate_compact_allocation_bounds c L r jStar x (log E) take).1 have hp : ¬0 < candidateCompactAllocationWeight c L r jStar x (log E) take := fun hp => h (hrange take hp) linarith end Bounty end section /- Smoothing the literal candidate window with the specified smooth cutoff. -/ open Finset Filter Real namespace Bounty theorem exists_candidate_actual_window_smoothing_error_bound {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (A D : ℝ) : ∃ B : ℝ, 1 ≤ B ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (T : Finset ℕ) (F : ℕ → ℕ → ℂ), arithmeticProductWindow 1 (exp L) ⊆ T → (∀ u, ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCoefficient c L q r jStar u : ℂ) * (∑ m ∈ (2*u+1).divisors, F u m)) - (∑ u ∈ T, (candidateCoefficient c L q r jStar u : ℂ) * (typeIIWindowSmooth (L^(-B)) ((u : ℝ)/exp L) : ℂ) * (∑ m ∈ (2*u+1).divisors, F u m))‖ ≤ exp L * L^(-D) := by obtain ⟨B, hB, hbound⟩ := exists_candidate_sharp_smoothing_error_bound hc hr hq0 hq1 A D refine ⟨B, hB, ?_⟩ filter_upwards [hbound, eventually_gt_atTop (0 : ℝ)] with L hL hL0 intro jStar T F hT hF apply hL jStar T (fun u => typeIIWindowSmooth (L^(-B)) ((u : ℝ)/exp L)) F hT · intro u hu exact typeII_window_smooth_bounds _ _ · intro u hu hnot exact typeII_window_smooth_ratio_eq_off_boundary (exp_pos L) (rpow_pos_of_pos hL0 _) hnot · intro u hu m hm exact hF u m hm end Bounty end section /- Apply the proved Mellin cutoff to the actual candidate test on its coarse finite support. -/ open Finset Filter MeasureTheory Real namespace Bounty end Bounty end section open MeasureTheory namespace Bounty theorem exists_local_log_mellin_energy_constant {j : ℕ} (hj : 2 ≤ j) : ∃ C : ℝ, 0 < C ∧ ∀ (S : Finset ℕ) (a : ℕ → ℂ), (∀ n ∈ S, 0 < n) → ∀ h Y : ℝ, 0 < h → 0 < Y → (∫ v in Set.Icc (Y/2) (3*Y), ‖localLogConvolution S a (h*Y) v‖^2) ≤ 3*Y*h^2*C * ∫ t : ℝ, (1+|h*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2 := by obtain ⟨C, hC, hop⟩ := exists_local_mellin_transform_energy_constant hj refine ⟨C, hC, ?_⟩ intro S a hS h Y hh hY let g := centeredLocalMellinPolynomial S a Y have hg : Continuous g := centered_local_mellin_polynomial_continuous S a Y have hgM : ∃ M : ℝ, ∀ t, ‖g t‖ ≤ M := by refine ⟨∑ n ∈ S, ‖a n‖, ?_⟩ intro t rw [centered_local_mellin_polynomial_norm] exact local_mellin_polynomial_norm_le S a t obtain ⟨hloc, hbound⟩ := hop h hh g hg hgM have heI : (fun u : ℝ => ‖localMellinTransform h g u‖^2) =ᵐ[ volume.restrict (Set.Icc (Real.log (1/2:ℝ)) (Real.log 3))] (fun u : ℝ => ‖(typeIISmoothRho 2 u : ℂ)*localMellinTransform h g u‖^2) := by filter_upwards [ae_restrict_mem measurableSet_Icc] with u hu rw [local_mellin_rho_one_on_log_dyad hu, Complex.ofReal_one, one_mul] have hTi : IntegrableOn (fun u : ℝ => ‖localMellinTransform h g u‖^2) (Set.Icc (Real.log (1/2:ℝ)) (Real.log 3)) := hloc.integrableOn.congr heI.symm rw [logarithmic_dyad_integral_substitution hY] have hscale : (h/(2*Real.pi))^2 ≤ h^2 := by apply pow_le_pow_left₀ (by positivity) apply div_le_self hh.le linarith [Real.two_le_pi] calc _ ≤ ∫ u in Set.Icc (Real.log (1/2:ℝ)) (Real.log 3), (3*Y*h^2) * ‖localMellinTransform h g u‖^2 := by apply integral_mono_of_nonneg · filter_upwards [] with u exact mul_nonneg (mul_nonneg hY.le (Real.exp_pos u).le) (sq_nonneg _) · exact hTi.const_mul _ · filter_upwards [ae_restrict_mem measurableSet_Icc] with u hu rw [local_log_convolution_mellin_coordinates S a hS hh hY u, norm_mul, Complex.norm_real, Real.norm_of_nonneg (by positivity), mul_pow] have hu3 : Real.exp u ≤ 3 := by simpa only [Real.exp_log (by norm_num : (0:ℝ)<3)] using Real.exp_le_exp.mpr hu.2 have hc : Y*Real.exp u*(h/(2*Real.pi))^2 ≤ 3*Y*h^2 := by calc _ ≤ Y*3*h^2 := mul_le_mul (mul_le_mul_of_nonneg_left hu3 hY.le) hscale (sq_nonneg _) (mul_nonneg hY.le (by norm_num)) _ = _ := by ring simpa only [mul_assoc] using mul_le_mul_of_nonneg_right hc (sq_nonneg ‖localMellinTransform h g u‖) _ = (3*Y*h^2) * ∫ u in Set.Icc (Real.log (1/2:ℝ)) (Real.log 3), ‖localMellinTransform h g u‖^2 := integral_const_mul _ _ _ ≤ (3*Y*h^2) * (C * ∫ t : ℝ, (1+|h*t|)^(-(j:ℝ))*‖g t‖^2) := mul_le_mul_of_nonneg_left hbound (by positivity) _ = _ := by simp only [g, centered_local_mellin_polynomial_norm] ring end Bounty end section /- The original event updates only its common birth slots; initial prime labels are seeded once at the boundary. -/ open Classical namespace Bounty section History variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedCommonAddressWrite (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) s) (history : FullMixedCommonBirthAddress M B steps → Option (Sigma P)) : FullMixedCommonBirthAddress M B steps → Option (Sigma P) | .inl a => history (.inl a) | .inr a => if h : a.1 = u then fullMixedCommonEventBirthLabel n S B A Δ D (steps.get u) s e (cast (congrArg (fun v : Fin steps.length => FullMixedCommonLocalAddress M B (steps.get v)) h) a.2) else history (.inr a) noncomputable def fullMixedCommonHistoryWrite (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : Option (Sigma P) := fullMixedCommonAddressWrite n S B A Δ D steps u s e (fun a => history ((fullMixedCommonBirthOrder M B steps).symm a)) (fullMixedCommonBirthOrder M B steps i) noncomputable def fullMixedCommonHistorySeed (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : Option (Sigma P) := match fullMixedCommonBirthOrder M B steps i with | .inl a => some (fullMixedCommonInitialPrime s a) | .inr _ => history i theorem full_mixed_common_history_write_here (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (a : FullMixedCommonLocalAddress M B (steps.get u)) : fullMixedCommonHistoryWrite n S B A Δ D steps u s e history ((fullMixedCommonBirthOrder M B steps).symm (.inr ⟨u, a⟩)) = fullMixedCommonEventBirthLabel n S B A Δ D (steps.get u) s e a := by unfold fullMixedCommonHistoryWrite rw [Equiv.apply_symm_apply] simp [fullMixedCommonAddressWrite] theorem full_mixed_common_history_write_other (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) (hi : fullMixedCommonOwner M B steps (fullMixedCommonBirthOrder M B steps i) ≠ some u) : fullMixedCommonHistoryWrite n S B A Δ D steps u s e history i = history i := by obtain ⟨a, rfl⟩ := (fullMixedCommonBirthOrder M B steps).symm.surjective i cases a with | inl a => simp [fullMixedCommonHistoryWrite, fullMixedCommonAddressWrite] | inr a => have hv : a.1 ≠ u := by simpa only [Equiv.apply_symm_apply, fullMixedCommonOwner, ne_eq, Option.some.injEq] using hi simp [fullMixedCommonHistoryWrite, fullMixedCommonAddressWrite, hv] end History end Bounty end section /- Natural-index logarithmic sums and the first-derivative frequency range. -/ open Finset namespace Bounty theorem nat_logarithmic_first_derivative (a b : ℕ) (U t : ℝ) (hU : 1 ≤ U) (ha : U ≤ (a : ℝ)) (hab : a ≤ b) (hb : (b : ℝ) ≤ 2*U) (ht : t ≠ 0) (htmax : |t| ≤ U) : ‖∑ n ∈ Icc a b, Complex.exp ((t*Real.log (n : ℝ) : ℝ)*Complex.I)‖ ≤ 12*Real.pi*U/|t| := by have hcast : ∀ n : ℤ, ((n : ℤ) : ℝ) = (n : ℝ) := fun _ => rfl have he := nat_sum_eq_integer_interval_sum (fun n : ℤ => Complex.exp ((t*Real.log (n : ℝ) : ℝ)*Complex.I)) a b simp only [Int.cast_natCast] at he rw [he] have ha' : 0 < ((a : ℤ) : ℝ) := by exact_mod_cast (by linarith : 0 < (a : ℝ)) have hav : ((a : ℤ) : ℝ) ≤ 3*U := by simp only [Int.cast_natCast] have : (a : ℝ) ≤ (b : ℝ) := by exact_mod_cast hab linarith have hbV : ((b : ℤ) : ℝ)+1 ≤ 3*U := by simp only [Int.cast_natCast]; linarith have htpi : |t| ≤ Real.pi*((a : ℤ) : ℝ) := by simp only [Int.cast_natCast] have hp := Real.pi_gt_three nlinarith have hh := logarithmic_first_derivative_signed (a : ℤ) (b : ℤ) (3*U) t ha' hav hbV ht htpi convert hh using 1 <;> ring end Bounty end section /- The exceptional-interval subpower bound is uniform over coefficients bounded by any fixed real constant, with the large-scale threshold allowed to depend on that constant. -/ open Filter open scoped Topology namespace Bounty theorem eventually_prime_exceptional_bounded_coefficients_subpower {a beta c A B d ε : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hA : 0 ≤ A) (hB : 1 ≤ B) (hd : 0 < d) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R : ℝ), 1 ≤ Y → d * L ≤ Real.log Y → Real.log Y ≤ c * L → Real.exp (L ^ a) / 2 ≤ P → P ≤ Real.exp (L ^ beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) → (∀ p : s, ‖coeff p‖ ≤ B) → ((primeExceptionalIntervals s coeff (L ^ (-A)) R).card : ℝ) ≤ Y ^ ε := by have hA' : 0 ≤ A + 1 := by linarith have hB0 : 0 < B := zero_lt_one.trans_le hB filter_upwards [eventually_prime_exceptional_intervals_subpower ha ha1 hbeta hc hA' hd hε, eventually_ge_atTop B] with L hsub hBL intro s hs coeff Y P R hY hloglo hloghi hPlo hPhi hR hRY hband hcoeff have hcard := Finset.card_le_card (prime_exceptional_intervals_normalize_subset s coeff A R hB0 hBL) have hcardR : ((primeExceptionalIntervals s coeff (L ^ (-A)) R).card : ℝ) ≤ ((primeExceptionalIntervals s (fun p => coeff p / (B : ℂ)) (L ^ (-(A + 1))) R).card : ℝ) := by exact_mod_cast hcard exact hcardR.trans (hsub s hs (fun p => coeff p / (B : ℂ)) Y P R hY hloglo hloghi hPlo hPhi hR hRY hband (prime_normalized_coefficient_norm_le_one s coeff hB0 hcoeff)) end Bounty end section /- Uniform terminal power saving for the actual iterated logarithmic exponential phase. -/ open Finset namespace Bounty theorem exists_mixed_terminal_power_saving (k : ℕ) (C : ℝ) (hk : 2 ≤ k) (hC : 1 ≤ C) : ∃ B : ℝ, 0 < B ∧ ∀ (N eps : ℝ) (hs : List ℝ) (q a u : ℝ) (l r : ℤ), 1 ≤ N → 0 ≤ eps → hs.length = k-2 → (∀ h ∈ hs, 1 ≤ h ∧ h ≤ (⌊N^(eps/(2*(k : ℝ)))⌋₊ : ℝ)) → N^((k : ℝ)-2+eps) ≤ |u| → |u| ≤ N^((k : ℝ)-eps) → 0 < q → l ≤ r → (∀ x ∈ Set.Icc (l : ℝ) ((r : ℝ)+1), N ≤ x+a/q ∧ x+a/q+hs.sum ≤ C*N) → ‖∑ n ∈ Icc l r, Complex.exp ((mixedForwardDifference hs (fun y => u*Real.log (q*y+a)) (n : ℝ) : ℂ)*Complex.I)‖ ≤ B*N*N^(-eps/4) := by let K := ((k-1).factorial : ℝ)/(2*Real.pi*C^k) have hC0 : 0 < C := by linarith have hK : 0 < K := by dsimp [K]; positivity refine ⟨6*(C^k*C*Real.sqrt K+2/Real.sqrt K),by positivity,?_⟩ intro N eps hs q a u l r hN heps hlen hhs hu0 hu1 hq hlr hbox have hN0 : 0 < N := by linarith have hu : u ≠ 0 := abs_pos.mp ((Real.rpow_pos_of_pos hN0 _).trans_le hu0) have hhspos : ∀ h ∈ hs, 0 < h := fun h hh => lt_of_lt_of_le (by norm_num) (hhs h hh).1 have hhs0 : ∀ h ∈ hs, 0 ≤ h := fun h hh => (hhspos h hh).le have hdepth : hs.length+2 = k := by omega have hfac : hs.length+1 = k-1 := by omega have hNC : N ≤ C*N := by simpa only [one_mul] using mul_le_mul_of_nonneg_right hC hN0.le have h := integer_mixed_logarithmic_exp_sum_bound hs q a u N (C*N) l r hq hu hlr hhspos hN0 hNC hbox dsimp only at h rw [hdepth,hfac] at h have hratio : C*N/N = C := by field_simp rw [hratio] at h have hlam : hs.prod*|u/(2*Real.pi)| *((k-1).factorial : ℝ)/(C*N)^k = K*hs.prod*|u|/N^k := by dsimp [K] rw [abs_div,abs_of_pos (show 0 < 2*Real.pi by positivity),mul_pow] field_simp rw [hlam] at h obtain ⟨hp0,hp1⟩ := terminal_shift_product_bounds hs hN heps hk hlen hhs obtain ⟨hcurv0,hcurv1⟩ := scaled_curvature_power_bounds hN hK.le hp0 hp1 hu0 hu1 have hlrR : (l : ℝ) ≤ r := by exact_mod_cast hlr have hleft := (hbox l ⟨le_rfl,by linarith⟩).1 have hright := (hbox ((r : ℝ)+1) ⟨by linarith,le_rfl⟩).2 have hsum : 0 ≤ hs.sum := List.sum_nonneg hhs0 have hlength : (r : ℝ)-l+1 ≤ C*N := by linarith have hM : 0 ≤ (r : ℝ)-l+1 := by linarith exact h.trans (curvature_test_power_saving hN heps hK hK.le (pow_nonneg hC0.le _) hC0.le hM hlength hcurv0 hcurv1) end Bounty end section /- Arbitrary finite factor coefficients are restricted to their actual boxes automatically. -/ open Finset namespace Bounty theorem finite_support_weighted_sum (S : Finset ℕ) (a F : ℕ → ℂ) : (∑ n ∈ S, (if n ∈ S then a n else 0)*F n) = ∑ n ∈ S, a n*F n := by apply sum_congr rfl intro n hn rw [if_pos hn] end Bounty end section /- Unit coefficients embed the actual shorter divisor convolutions in the fourfold estimate. -/ open Finset Filter namespace Bounty theorem divisor_unit_convolution (f : ℕ → ℂ) {n : ℕ} (hn : n ≠ 0) : (∑ d ∈ n.divisors, (if d = 1 then (1 : ℂ) else 0)*f (n/d)) = f n := by classical rw [sum_eq_single 1] · simp only [ite_true, Nat.div_one, one_mul] · intro b _ hb rw [if_neg hb,zero_mul] · intro hnot exact False.elim (hnot (Nat.mem_divisors.mpr ⟨one_dvd n,hn⟩)) theorem endpoint_four_unit_left (α β γ : ℕ → ℂ) {n : ℕ} (hn : n ≠ 0) : endpointFourConvolution (fun d => if d = 1 then 1 else 0) α β γ n = endpointTripleConvolution α β γ n := by exact divisor_unit_convolution _ hn theorem endpoint_triple_unit_left (β γ : ℕ → ℂ) {n : ℕ} (hn : n ≠ 0) : endpointTripleConvolution (fun d => if d = 1 then 1 else 0) β γ n = ∑ d ∈ n.divisors, β d*γ (n/d) := by classical unfold endpointTripleConvolution rw [sum_eq_single 1] · simp only [ite_true, Nat.div_one, one_mul] · intro b _ hb simp only [if_neg hb,zero_mul,sum_const_zero] · intro hnot exact False.elim (hnot (Nat.mem_divisors.mpr ⟨one_dvd n,hn⟩)) end Bounty end section /- Exact local decoding of common forest factors on the original path. The path occurrence and full-slot chronological enumeration are unchanged. -/ open Finset Classical namespace Bounty section Decode variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) variable (n : (g : Fin N) → P g → ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) end Decode end Bounty end section /- Compatible original endpoints use one shared embedding and two independent completions. -/ open Finset open scoped Classical namespace Bounty abbrev PhysicalCompatibleMarkPair {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) := {x : PhysicalMarkLists P J ell × PhysicalMarkLists P J ell // physicalSharedCompatible C x.1 x.2} abbrev PhysicalJointCutData {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) := Σ s : PhysicalCutSharedEmbedding P C, PhysicalCutCompletion P C ell s × PhysicalCutCompletion P C ell s noncomputable def physicalCutPairEquiv {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) : PhysicalCompatibleMarkPair P C ell ≃ PhysicalJointCutData P C ell := (Equiv.subtypeEquiv (Equiv.prodCongr (physicalCutListSigmaEquiv P C ell) (physicalCutListSigmaEquiv P C ell)) (fun x => physical_cut_shared_compatible_iff C x.1 x.2)).trans sigmaSameBasePairEquiv section variable {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (d : PhysicalJointCutData P C ell) include G P J ell C d theorem physical_cut_pair_inverse_left : ((physicalCutPairEquiv P C ell).symm d).val.1 = physicalCutGlue C d.1 d.2.1 := rfl theorem physical_cut_pair_inverse_right : ((physicalCutPairEquiv P C ell).symm d).val.2 = physicalCutGlue C d.1 d.2.2 := rfl theorem physical_cut_pair_inverse_shared_aux : physicalSharedAux C ((physicalCutPairEquiv P C ell).symm d).val.1 = fun g j => d.1 g j := by rw [physical_cut_pair_inverse_left] have h := physical_cut_glue_shared C d.1 d.2.1 exact congrArg (fun s : PhysicalCutSharedEmbedding P C => fun g => (s g : ↥(univ \ C g) → ↥(P g))) h end end Bounty end section /- The stripped vertex is the original variable-length marked-list weight. -/ open Finset open scoped Classical namespace Bounty theorem physical_divisor_subtype_card {G : Type*} (P : G → Finset ℕ) (g : G) (n : ℤ) : ((univ : Finset (P g)).filter (fun p => (p.val : ℤ) ∣ n)).card = physicalOmega P g n := by have he : (((univ : Finset (P g)).filter (fun p => (p.val : ℤ) ∣ n)).image Subtype.val) = (P g).filter (fun p : ℕ => (p : ℤ) ∣ n) := by ext p simp only [mem_image, mem_filter, mem_univ, true_and, Subtype.exists] constructor · rintro ⟨a, ha, han, rfl⟩ exact ⟨ha, han⟩ · rintro ⟨hp, hpn⟩ exact ⟨p, hp, hpn, rfl⟩ rw [← card_image_of_injective _ Subtype.val_injective, he] rfl noncomputable def groupMarkedVertexWeight {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (t : G → ℕ) (n : ℤ) (L : GroupMarkedLists P t) : ℝ := if ∀ g i, ((L g i).val : ℤ) ∣ n then ∏ g, q ^ (physicalOmega P g n - t g) else 0 theorem physical_unshared_vertex_eq_group_weight {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (q : ℝ) (n : ℤ) : physicalUnsharedVertex C L q n = groupMarkedVertexWeight P q (fun g => ell + (C g).card) n (physicalGroupUnsharedEmbedding C L) := by have he : physicalUnsharedVertex C L q n = ∏ g, finiteMarkedVertex (univ.image (physicalGroupUnsharedEmbedding C L g)) (fun p : P g => (p.val : ℤ) ∣ n) q := by unfold physicalUnsharedVertex finiteMarkedVertex rw [Fintype.prod_sigma] apply prod_congr rfl intro g _ apply prod_congr rfl intro p _ simp only [physical_unshared_tagged_mem] rw [he] trans ∏ g, if ∀ i, ((physicalGroupUnsharedEmbedding C L g i).val : ℤ) ∣ n then q ^ (physicalOmega P g n - (ell + (C g).card)) else 0 · apply prod_congr rfl intro g _ have hf := finite_marked_embedding_indicator (physicalGroupUnsharedEmbedding C L g) (fun p : P g => (p.val : ℤ) ∣ n) q simp only [Fintype.card_fin] at hf convert hf using 2 congr 2 rw [← physical_divisor_subtype_card P g n] congr 1 ext p simp only [mem_filter, mem_univ, true_and] · unfold groupMarkedVertexWeight by_cases h : ∀ g i, ((physicalGroupUnsharedEmbedding C L g i).val : ℤ) ∣ n · rw [if_pos h] apply prod_congr rfl intro g _ rw [if_pos (h g)] · rw [if_neg h] push Not at h obtain ⟨g, i, hi⟩ := h apply prod_eq_zero (mem_univ g) exact if_neg (fun hh => hi (hh i)) theorem completion_marked_vertex_sum_eq_average {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (q : ℝ) (V : G → ℝ) (n : ℤ) (b : GroupMarkedLists P (fun g => ell + (C g).card) → ℂ) : (physicalCompletionMass V C ell : ℂ) * (∑ L : GroupMarkedLists P (fun g => ell + (C g).card), (groupMarkedVertexWeight P q (fun g => ell + (C g).card) n L : ℂ) * b L) = (markedDivisorWeight univ P q V (fun g => ell + (C g).card) n : ℂ) * groupMarkedAverage P (fun g => ell + (C g).card) n b := by have hs : (∑ L : GroupMarkedLists P (fun g => ell + (C g).card), (groupMarkedVertexWeight P q (fun g => ell + (C g).card) n L : ℂ) * b L) = ((∏ g, q ^ (physicalOmega P g n - (ell + (C g).card)) : ℝ) : ℂ) * ∑ L : GroupMarkedLists P (fun g => ell + (C g).card), if ∀ g i, ((L g i).val : ℤ) ∣ n then b L else 0 := by rw [mul_sum] apply sum_congr rfl intro L _ unfold groupMarkedVertexWeight split_ifs <;> simp only [Complex.ofReal_zero, zero_mul, mul_zero] rw [hs, ← mul_assoc] have hm : (physicalCompletionMass V C ell : ℂ) * ((∏ g, q ^ (physicalOmega P g n - (ell + (C g).card)) : ℝ) : ℂ) = ((∏ g, q ^ (physicalOmega P g n - (ell + (C g).card)) / V g ^ (ell + (C g).card) : ℝ) : ℂ) := by rw [← Complex.ofReal_mul] congr 1 unfold physicalCompletionMass rw [← prod_mul_distrib] apply prod_congr rfl intro g _ ring rw [hm, weighted_group_marked_indicator_eq_average] end Bounty end section /- Indexed rows on the common initial-and-event birth allocation. Initial birth factors remain outside the event composition; no initial gate is lost. -/ open Finset Classical namespace Bounty section Affected variable {J K Z : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) end Affected section Stage variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (residual : ∀ (tag : Option (J ⊕ K)) s, FullPermutationMixedEvent n S B A Δ D tag s → ℂ) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] end Stage end Bounty end section /- Exact unrestricted-mark formula for each original root contribution. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (positions : Finset ℤ) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) include G sharedInstance1 sharedInstance2 P J ell V C q ζ k K aux positions f g Ψ Z theorem physical_fixed_root_fibers : physicalFixedRootCorrelation V C q ζ k K aux positions f g Ψ Z = (physicalStateMass V J ell : ℂ) * ∑ n ∈ positions, ∑ L : PhysicalMarksAt P J ell n, if n + k * (physicalD C L.val aux : ℕ) ∈ positions then ∑ R : PhysicalMarksAt P J ell (n + k * (physicalD C L.val aux : ℕ)), physicalRootPositionTerm V C q ζ k K aux f g Ψ Z L.val R.val n else 0 := by unfold physicalFixedRootCorrelation rw [physical_cutoff_sum] congr 1 apply sum_congr rfl intro n _ apply sum_congr rfl intro L _ rw [← physical_cutoff_sum_at P J ell positions (n + k * (physicalD C L.val aux : ℕ)) (fun R => physicalRootPositionTerm V C q ζ k K aux f g Ψ Z L.val R n)] apply sum_congr rfl intro y _ split_ifs with h · simp only [physicalRootPositionTerm, h] · rfl theorem physical_fixed_root_all_lists : physicalFixedRootCorrelation V C q ζ k K aux positions f g Ψ Z = (physicalStateMass V J ell : ℂ) * ∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, ∑ n ∈ positions, if n + k * (physicalD C L aux : ℕ) ∈ positions then physicalRootPositionTerm V C q ζ k K aux f g Ψ Z L R n else 0 := by rw [physical_fixed_root_fibers] congr 1 have hf (n : ℤ) : (∑ L : PhysicalMarksAt P J ell n, if n + k * (physicalD C L.val aux : ℕ) ∈ positions then ∑ R : PhysicalMarksAt P J ell (n + k * (physicalD C L.val aux : ℕ)), physicalRootPositionTerm V C q ζ k K aux f g Ψ Z L.val R.val n else 0) = ∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if n + k * (physicalD C L aux : ℕ) ∈ positions then physicalRootPositionTerm V C q ζ k K aux f g Ψ Z L R n else 0 := by trans ∑ L : PhysicalMarksAt P J ell n, ∑ R : PhysicalMarkLists P J ell, if n + k * (physicalD C L.val aux : ℕ) ∈ positions then physicalRootPositionTerm V C q ζ k K aux f g Ψ Z L.val R n else 0 · apply sum_congr rfl intro L _ split_ifs with ht · rw [← physical_marks_sum_all P J ell _ (fun R => physicalRootPositionTerm V C q ζ k K aux f g Ψ Z L.val R n)] intro R hR simp only [physicalRootPositionTerm, physicalVertexWeight, if_neg hR, mul_zero, Complex.ofReal_zero] · simp only [sum_const_zero] · apply physical_marks_sum_all P J ell n (fun L => ∑ R : PhysicalMarkLists P J ell, if n + k * (physicalD C L aux : ℕ) ∈ positions then physicalRootPositionTerm V C q ζ k K aux f g Ψ Z L R n else 0) intro L hL apply sum_eq_zero intro R _ split_ifs · simp only [physicalRootPositionTerm, physicalVertexWeight, if_neg hL, zero_mul, Complex.ofReal_zero, mul_zero] · rfl simp only [hf] rw [sum_comm] apply sum_congr rfl intro L _ rw [sum_comm] end end Bounty end section /- Exact reciprocal, phase, and auxiliary factors in a shared-scaled root term. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalPhasedPairCoefficient {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (a b : ℝ) (w z : ℕ) (L R : PhysicalMarkLists P J ell) : ℂ := if physicalListAdmissible C aux L R then K L R aux * physicalPhase a (physicalSharedFactor C L * w) * physicalPhase b (physicalSharedFactor C L * z) * physicalPhase (-(a+b)) (physicalD C L aux) else 0 theorem physical_phased_root_term_scaled {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (C : G → Finset (Fin J)) (q a b : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) (L R : PhysicalMarkLists P J ell) (w : ℤ) (hf : f ((physicalSharedFactor C L : ℤ) * w) = f w) (hg : g ((physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ))) = g (w + k * (physicalFreeFactor C aux : ℕ))) : physicalRootPositionTerm V C q (-(a+b)) k K aux (fun n => physicalPhase (-a) n.natAbs * f n) (fun n => physicalPhase b n.natAbs * g n) Ψ Z L R ((physicalSharedFactor C L : ℤ) * w) = ((physicalAuxMass V C aux * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * (Ψ ((w : ℝ) / (Z * physicalFreeFactor C aux)) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (f w) * g (w + k * (physicalFreeFactor C aux : ℕ))) * ((physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * (w.natAbs : ℤ)) * physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * ((w + k * (physicalFreeFactor C aux : ℕ)).natAbs : ℤ)) : ℝ) : ℂ) * physicalPhasedPairCoefficient C K aux a b w.natAbs (w + k * (physicalFreeFactor C aux : ℕ)).natAbs L R := by have hs : (physicalSharedFactor C L : ℤ) ≠ 0 := by exact_mod_cast (physical_shared_factor_pos C L hprime).ne' have he : (physicalSharedFactor C L : ℤ) * w + k * (physicalD C L aux : ℕ) = (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) := by rw [physical_D_shared_free, Nat.cast_mul] ring have harg := physical_shared_scaled_position C L aux hprime ((physicalSharedFactor C L : ℤ) * w) Z (dvd_mul_right _ _) rw [Int.mul_ediv_cancel_left w hs] at harg unfold physicalRootPositionTerm dsimp only rw [he, hf, hg, harg] rw [physical_vertex_weight_scaled_natAbs, physical_vertex_weight_scaled_natAbs] simp only [Int.natAbs_mul, Int.natAbs_natCast, map_mul, ← physical_phase_reverse, neg_neg, Int.cast_mul, Int.cast_natCast, mul_inv] unfold physicalBarePatternScalar physicalPhasedPairCoefficient split_ifs · push_cast ring · simp only [mul_zero, zero_mul] end Bounty end section /- Positive extension agrees with the original endpoint on a positive cutoff. -/ open Finset namespace Bounty end Bounty end section /- A bounded error supported on the actual free-prime divisibility set is controlled by the endpoint exclusion estimate. -/ open Finset open scoped Classical namespace Bounty theorem invariant_harmonic_supported_error (Q T : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (hα' : ∀ m, ‖α' m‖ ≤ A) (hβ' : ∀ p, ‖β' p‖ ≤ B) (hγ' : ∀ r, ‖γ' r‖ ≤ C) (S : Finset ℤ) (δ : ℤ) (N : ℕ) (hT : ∀ d ∈ T, d ∈ Nat.factoredNumbers Q) (hδ : ∀ d ∈ T, (d : ℤ) ∣ δ) (hS : ∀ n ∈ S, 0 ≤ n ∧ n ≤ (N : ℤ)) (hS' : ∀ n ∈ S, 0 ≤ n + δ ∧ n + δ ≤ (N : ℤ)) {Y K E : ℝ} (hY : 0 < Y) (hK : 0 ≤ K) (hE : 0 ≤ E) (hYlow : ∀ n ∈ S, Y ≤ (n : ℝ)) (θ e : ℤ → ℂ) (hθ : ∀ n ∈ S, ‖θ n‖ ≤ K) (he : ∀ n ∈ S, ‖e n‖ ≤ E) (hsupport : ∀ n ∈ S, (∀ d ∈ T, ¬ (d : ℤ) ∣ n) → e n = 0) : ‖∑ n ∈ S, (θ n / (n : ℂ)) * star (invariantTripleEndpoint Q α β γ n.natAbs) * invariantTripleEndpoint Q α' β' γ' (n+δ).natAbs * e n‖ ≤ (K * E / Y) * ((A * B * C)^2 * (N : ℝ) * (1+Real.log N)^15) * ∑ d ∈ T, 1/(d : ℝ) := by have h := invariant_triple_endpoint_exclusion_error Q T α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' S δ N hT hδ hS hS' hY (mul_nonneg hK hE) hYlow (fun n => θ n * e n) (fun n hn => by rw [norm_mul] exact mul_le_mul (hθ n hn) (he n hn) (norm_nonneg _) hK) dsimp only at h have hz : (∑ n ∈ S.filter (fun n => ¬ ∃ d ∈ T, (d : ℤ) ∣ n), ((θ n * e n) / (n : ℂ)) * star (invariantTripleEndpoint Q α β γ n.natAbs) * invariantTripleEndpoint Q α' β' γ' (n+δ).natAbs) = 0 := by apply sum_eq_zero intro n hn have hnS := (mem_filter.mp hn).1 have hnT := (mem_filter.mp hn).2 rw [hsupport n hnS (by simpa only [not_exists, not_and] using hnT)] simp rw [hz, sub_zero] at h convert h using 1 congr 1 apply sum_congr rfl intro n _ ring end Bounty end section /- The original selected marked endpoint is approximated by its exact four-factor convolution, with the proved small-prime square-error bound. -/ open Finset open scoped Classical namespace Bounty theorem selected_four_convolution_error_energy {G : Type*} [Fintype G] [dG : DecidableEq G] (P : G → Finset ℕ) {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (V : G → ℝ) (t : G → ℕ) (T : ℕ) (hV : ∀ g, v ≤ V g) (ht : ∀ g, t g ≤ T) (hprime : ∀ g, ∀ p ∈ P g, p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (k : ℕ) (htg : t g = k + 1) (big : Finset G) (hsmall : g ∉ big) (b : GroupMarkedLists (fun h : big => P h.val) (fun h : big => t h.val) → ℂ) {H : ℝ} (hH : 0 ≤ H) (hb : ∀ L, ‖b L‖ ≤ H) (Q : Finset ℕ) (hQ : ∀ g, P g ⊆ Q) (α β γ : ℕ → ℂ) (hαfree : ∀ d, ¬ Disjoint d.primeFactors Q → α d = 0) (hβfree : ∀ d, ¬ Disjoint d.primeFactors Q → β d = 0) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (positions : Finset ℕ) (N : ℕ) (hpos : ∀ n ∈ positions, 0 < n ∧ n ≤ N) : let c := fun n : ℕ => groupMarkedAverage (fun h : big => P h.val) (fun h : big => t h.val) (n : ℤ) b (∑ n ∈ positions, ‖(markedDivisorWeight univ P q V t (n : ℤ) : ℂ) * c n * invariantTripleEndpoint Q α β γ n - endpointFourConvolution (fun p => if p ∈ P g then 1 / (V g : ℂ) else 0) α β (fun r => selectedMarkedWeight P Q q V (Function.update t g k) t big b (fun _ => 1) r * γ (primePoolFreePart Q r)) n‖ ^ 2) ≤ H ^ 2 * (((markedDivisorBound q v T) ^ Fintype.card G * (1 + 2 * Real.log N / v)) ^ 2 * (((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∑ p ∈ P g, 1 / (p : ℝ) ^ 2)) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) have he := weighted_small_mark_extraction_error_energy P hq0 hq1 hv V t T hV ht hprime hdis g k htg big hsmall b hH hb Q (hQ g) α β γ hA hB hC hα hβ hγ positions N hpos dsimp only at he ⊢ convert he using 1 apply sum_congr rfl intro n hn rw [weighted_group_marked_sum_selected_average, selected_marked_prime_peel_four_convolution P Q q V t t g k big b α β γ hprime hQ hαfree hβfree (ne_of_gt (hpos n hn).1)] rfl end Bounty end section /- Bounded four-factor convolutions become exact dyadic boxes without enlarging the output support. -/ open Finset namespace Bounty theorem endpoint_four_bounded_dyadic_transform (S : Finset ℕ) (N : ℕ) (hS : ∀ n ∈ S, n ≤ N) (δ α β γ F : ℕ → ℂ) : (∑ n ∈ S, endpointFourConvolution δ α β γ n * F n) = ∑ i ∈ dyadicNatIndices (Icc 1 N), ∑ j ∈ dyadicNatIndices (Icc 1 N), ∑ k ∈ dyadicNatIndices (Icc 1 N), ∑ l ∈ dyadicNatIndices (Icc 1 N), ∑ d ∈ dyadicNatBucket (Icc 1 N) i, ∑ a ∈ dyadicNatBucket (Icc 1 N) j, ∑ b ∈ dyadicNatBucket (Icc 1 N) k, ∑ c ∈ dyadicNatBucket (Icc 1 N) l, if d*a*b*c ∈ S then δ d * α a * β b * γ c * F (d*a*b*c) else 0 := by rw [sum_four_dyadicNatBuckets] exact endpoint_four_bounded_cutoff_transform S N hS δ α β γ F end Bounty end section open MeasureTheory Filter namespace Bounty theorem eventually_local_mellin_geometric_truncation {c : ℝ} (hc : 0 ≤ c) (B D : ℝ) : ∃ j : ℕ, 2 ≤ j ∧ ∀ᶠ L : ℝ in atTop, ∀ (Y h : ℝ) (S : Finset ℕ) (a : ℕ → ℂ) (N : ℕ), 0 < Y → 0 < h → h⁻¹ ≤ Y → (∀ n ∈ S, 1 ≤ n ∧ n ≤ N) → (N:ℝ) ≤ c*Y → Real.log N ≤ c*L → (∑ n ∈ S, ‖a n‖^2) ≤ Y*L^B → (∫ t : ℝ, (1+|h*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) ≤ (∫ t in {t : ℝ | |t| ≤ L/h}, ‖localMellinPolynomial S a t‖^2)+Y^2*L^(-D) := by obtain ⟨j,hj,htrunc⟩ := local_mellin_truncation_power_saving 2 B D refine ⟨j,hj,?_⟩ filter_upwards [eventually_ge_atTop (16:ℝ), eventually_ge_atTop (c*(c+1))] with L hL hcL intro Y h S a N hY hh hhi hS hN hlog hE apply htrunc L Y h S a N hL hY hh hhi hS _ hE have hL1 : 1 ≤ L := by linarith have hL0 : 0 ≤ L := by linarith have hlog0 : 0 ≤ Real.log N := Real.log_natCast_nonneg N calc (N:ℝ)*(1+Real.log N) ≤ (c*Y)*(1+c*L) := by gcongr _ ≤ (c*Y)*((c+1)*L) := mul_le_mul_of_nonneg_left (by nlinarith) (mul_nonneg hc hY.le) _ = Y*(c*(c+1)*L) := by ring _ ≤ Y*(L*L) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hcL hL0) hY.le _ = Y*L^2 := by ring _ = Y*L^(2:ℝ) := by rw [Real.rpow_two] end Bounty end section /- A fixed nine-interval cover of the full common-window convolution support. -/ open Finset MeasureTheory namespace Bounty theorem geometric_local_interval_cover {X : ℝ} (hX : 0 < X) (K : ℕ) {v : ℝ} (hv : v ∈ Set.Icc (X/2) (3*X*(2:ℝ)^K)) : ∃ i ∈ range (K+1), v ∈ Set.Icc ((X*(2:ℝ)^i)/2) (3*(X*(2:ℝ)^i)) := by induction K with | zero => exact ⟨0, by simp, by simpa using hv⟩ | succ K ih => by_cases hprev : v ≤ 3*X*(2:ℝ)^K · obtain ⟨i,hi,hvi⟩ := ih ⟨hv.1,hprev⟩ exact ⟨i, mem_range.mpr (by have := mem_range.mp hi; omega), hvi⟩ · refine ⟨K+1, by simp, ?_⟩ have hpos : 0 < X*(2:ℝ)^K := by positivity rw [pow_succ] at hv ⊢ constructor <;> nlinarith [hv.2] theorem wide_mellin_interval_cover {Y v : ℝ} (hY : 0 < Y) (hv : v ∈ Set.Icc (Y/16) (65*Y)) : ∃ i ∈ range 9, v ∈ Set.Icc (((Y/8)*(2:ℝ)^i)/2) (3*((Y/8)*(2:ℝ)^i)) := by apply geometric_local_interval_cover (by positivity : 0 < Y/8) 8 constructor <;> norm_num <;> linarith [hv.1,hv.2] theorem wide_mellin_scale_bounds {Y : ℝ} (hY : 0 < Y) {i : ℕ} (hi : i ∈ range 9) : Y/8 ≤ (Y/8)*(2:ℝ)^i ∧ (Y/8)*(2:ℝ)^i ≤ 32*Y := by have hlo : 1 ≤ (2:ℝ)^i := one_le_pow₀ (by norm_num) have hhi : (2:ℝ)^i ≤ 256 := by have h := pow_le_pow_right₀ (by norm_num : (1:ℝ) ≤ 2) (show i ≤ 8 by have := mem_range.mp hi; omega) norm_num at h exact h constructor <;> nlinarith theorem local_additive_convolution_wide_support (S : Finset ℕ) (a : ℕ → ℂ) {Y H v : ℝ} (_hY : 0 < Y) (hH : 0 < H) (hsmall : H ≤ Y/64) (hS : ∀ n ∈ S, Y/8 ≤ (n:ℝ) ∧ (n:ℝ) ≤ 64*Y) (hv : v ∉ Set.Icc (Y/16) (65*Y)) : localAdditiveConvolution S a H v = 0 := by unfold localAdditiveConvolution apply sum_eq_zero intro n hn have hz : localMellinKernelSchwartz (((n:ℝ)-v)/H) = 0 := by apply local_mellin_kernel_unit_support apply lt_of_not_ge intro hb rw [abs_div, abs_of_pos hH] at hb have ht := abs_le.mp ((div_le_one hH).mp hb) apply hv constructor <;> linarith [(hS n hn).1, (hS n hn).2, ht.1, ht.2] rw [hz, mul_zero] end Bounty end section /- Retained normalized four-factor boxes have uniform polynomial shifted energy. -/ open Finset Filter MeasureTheory namespace Bounty theorem eventually_harmonic_four_box_shifted_mean_square {c E : ℝ} (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, 1 ≤ Y → Real.log Y ≤ c*L → ∀ (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (D₀ A₀ B₀ C₀ : ℝ), 0 ≤ D₀ → 0 ≤ A₀ → 0 ≤ B₀ → 0 ≤ C₀ → D₀*A₀*B₀*C₀ ≤ L^E → (∀ d ∈ D, 0 < d) → (∀ a ∈ A, 0 < a) → (∀ b ∈ B, 0 < b) → (∀ z ∈ C, 0 < z) → (∀ d ∈ D, ‖δ d‖ ≤ D₀) → (∀ a ∈ A, ‖α a‖ ≤ A₀) → (∀ b ∈ B, ‖β b‖ ≤ B₀) → (∀ z ∈ C, ‖γ z‖ ≤ C₀) → (∀ d ∈ D, ∀ a ∈ A, ∀ b ∈ B, ∀ z ∈ C, Y/128 ≤ ((d*a*b*z : ℕ) : ℝ) ∧ ((d*a*b*z : ℕ) : ℝ) ≤ 64*Real.exp 2*Y) → ∀ T v : ℝ, 0 ≤ T → T ≤ L*Y → (∫ t in Set.Icc (-T) T, ‖(∑ d ∈ D, δ d * harmonicMellinWeight (t + v) d) * (∑ a ∈ A, α a * harmonicMellinWeight (t + v) a) * (∑ b ∈ B, β b * harmonicMellinWeight (t + v) b) * (∑ z ∈ C, γ z * harmonicMellinWeight (t + v) z)‖ ^ 2) ≤ L^(2*E+17) := by filter_upwards [eventually_harmonic_box_mean_square_scalar (E := E) hc] with L hL intro Y hY hlogY D A B C δ α β γ D₀ A₀ B₀ C₀ hD₀ hA₀ hB₀ hC₀ hprod hD hA hB hC hδ hα hβ hγ hgeom T v hT hTY let N := ⌈64*Real.exp 2*Y⌉₊ have hY0 : 0 < Y := zero_lt_one.trans_le hY have hb := harmonic_four_box_shifted_mean_square D A B C δ α β γ hD₀ hA₀ hB₀ hC₀ (show 0 < Y/128 by positivity) hD hA hB hC hδ hα hβ hγ N (by intro d hd a ha b hb z hz have hp := hgeom d hd a ha b hb z hz refine ⟨hp.1, ?_⟩ exact_mod_cast hp.2.trans (Nat.le_ceil (64*Real.exp 2*Y))) T v hT exact hb.trans (hL Y T (D₀*A₀*B₀*C₀) hY hlogY hT hTY (by positivity) hprod) end Bounty end section /- An exponentially growing conductor range has arbitrary relative power saving. -/ open Finset Filter namespace Bounty theorem exists_candidate_exponential_conductor_range_power_bound (hZ : PrimitiveZeroFreeHalfPlane) {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (B : ℝ) : ∃ J : ℕ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → ∀ N R : ℕ, (N : ℝ) ≤ Real.exp L → (R : ℝ) ≤ Real.exp ((c/512)*L) → candidateSmallPrimitiveTypeIMass c L q r jStar N R ≤ candidateCoefficientWindowMass c L q r jStar * L^(-B) := by obtain ⟨J, hnorm⟩ := exists_candidate_character_relative_exponential_bound hZ hc hr hq0 hq1 hcenter have hdecay := eventually_linear_exponential_profile_le_rpow (by positivity : 0 < (3*c)/512) (by positivity : 0 < (3*c)/512) 0 (4*primeEulerProductUpperConstant) B simp only [zero_mul, zero_add] at hdecay refine ⟨J, ?_⟩ filter_upwards [hnorm, hdecay, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (Real.log 2)] with L hnormL hdecayL hL1 hlog2 intro jStar hj N R hN hR have hL : 0 < L := lt_of_lt_of_le zero_lt_one hL1 let XA := candidateCoefficientWindowMass c L q r jStar have hXA : 0 ≤ XA := by apply sum_nonneg intro u _ exact candidate_coefficient_nonneg c L hq0 r jStar u have hweight : 0 ≤ XA * Real.exp (-(c/128)*L) := by positivity have hD : 1 ≤ Real.exp L := by exact (Real.one_le_exp_iff).mpr hL.le have hbound := candidate_small_primitive_mass_le c L q r jStar N R (fun _ => XA * Real.exp (-(c/128)*L)) (fun _ _ => hweight) hD hN (by intro d hd f hf ψ _ hψ have hdpos : 0 < d := (mem_Icc.mp (mem_filter.mp hd).1).1 have hdN : d ≤ N := (mem_Icc.mp (mem_filter.mp hd).1).2 have hffilt := mem_filter.mp hf have hfpos : 0 < f := lt_trans Nat.zero_lt_one hffilt.2.1 have hfdvd : f ∣ d := Nat.dvd_of_mem_divisors hffilt.1 have hfle : f ≤ d := Nat.le_of_dvd hdpos hfdvd have hfL : (f : ℝ) ≤ Real.exp L := (Nat.cast_le.mpr (hfle.trans hdN)).trans hN have hdf : d/f ≠ 0 := (Nat.div_pos hfle hfpos).ne' have hdfL : ((d/f : ℕ) : ℝ) ≤ Real.exp L := (Nat.cast_le.mpr ((Nat.div_le_self d f).trans hdN)).trans hN exact hnormL jStar hj f hfpos hfL ψ hψ (d/f) hdf hdfL) have hlog : Real.log (2*Real.exp L) ≤ 2*L := by rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) (Real.exp_ne_zero L), Real.log_exp] linarith have hlog0 : 0 ≤ Real.log (2*Real.exp L) := by rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) (Real.exp_ne_zero L), Real.log_exp] positivity have hcardN : (Icc 2 R).card ≤ R := by rw [Nat.card_Icc]; omega have hcard : ((Icc 2 R).card : ℝ) ≤ Real.exp ((c/512)*L) := (Nat.cast_le.mpr hcardN).trans hR have hsum : (∑ _f ∈ Icc 2 R, XA * Real.exp (-(c/128)*L)) ≤ Real.exp ((c/512)*L) * (XA * Real.exp (-(c/128)*L)) := by simp only [sum_const, nsmul_eq_mul] exact mul_le_mul_of_nonneg_right hcard hweight calc _ ≤ ((2*primeEulerProductUpperConstant) * Real.log (2*Real.exp L)) * ∑ _f ∈ Icc 2 R, XA * Real.exp (-(c/128)*L) := hbound _ ≤ ((2*primeEulerProductUpperConstant) * (2*L)) * (Real.exp ((c/512)*L) * (XA * Real.exp (-(c/128)*L))) := by apply mul_le_mul · exact mul_le_mul_of_nonneg_left hlog (by positivity [primeEulerProductUpperConstant_pos]) · exact hsum · exact sum_nonneg (fun _ _ => hweight) · positivity [primeEulerProductUpperConstant_pos] _ = XA * ((4*primeEulerProductUpperConstant) * L * Real.exp (-((3*c)/512)*L)) := by have hexp : Real.exp ((c/512)*L) * Real.exp (-(c/128)*L) = Real.exp (-((3*c)/512)*L) := by rw [← Real.exp_add]; congr 1; ring calc _ = XA * ((4*primeEulerProductUpperConstant) * L * (Real.exp ((c/512)*L) * Real.exp (-(c/128)*L))) := by ring _ = _ := by rw [hexp] _ ≤ XA * L^(-B) := mul_le_mul_of_nonneg_left hdecayL hXA end Bounty end section /- The physical edge with every target list and auxiliary draw is one unified full-state row. Its globally extended phase is bounded everywhere. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) abbrev PhysicalFullLedgerEvent (tag : Option (I ⊕ K)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) := FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) tag s.2 noncomputable abbrev physicalFullLedgerEventFintype (tag : Option (I ⊕ K)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) : Fintype (PhysicalFullLedgerEvent C k tag s) := fullPermutationMixedEventFintype (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) tag s.2 noncomputable def physicalFullLedgerEventTarget (tag : Option (I ⊕ K)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) := fullMixedLedgerTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) tag s e noncomputable def physicalFullLedgerEventPhase (tag : Option (I ⊕ K)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : ℂ := fullMixedLedgerPhase (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) (fun j H x e => physicalFullGlobalEdgePhase (C j) (k j) H (ω j) (fun g p => β g p / V g) ρ V x e) tag s e noncomputable def physicalFullLedgerEventWeight (tag : Option (I ⊕ K)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : ℝ := fullPermutationMixedEventWeight (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ω (fun g p => β g p / V g) retention ρ V tag s.2 e abbrev PhysicalFullTraceEntry := FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B × PhysicalMarkObservation P ell C × FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B noncomputable def physicalFullTraceObservation (tags : ℕ → Option (I ⊕ K)) (cut : ℕ → Fin N → Finset (Fin J)) (i : ℕ) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k (tags i) s) : PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C := (s, physicalFullEventObservation C k (cut i) (cut (i + 1)) (tags i) s e, physicalFullLedgerEventTarget C k (tags i) s e) omit [∀ g, ∀ p : ↥(P g), NeZero p.val] in theorem physical_full_ledger_event_phase_norm_le (tag : Option (I ⊕ K)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : ‖physicalFullLedgerEventPhase C k ω β ρ V tag s e‖ ≤ 1 := full_mixed_ledger_phase_norm_le _ _ _ _ _ _ _ (fun j H x e => physical_full_global_edge_phase_norm_le (C j) (k j) H (ω j) (fun g p => β g p / V g) ρ V x e) tag s e end Physical end Bounty end section /- Comparison of the actual vacuum scalars at two finite memory caps. -/ open Finset Classical namespace Bounty section variable {J K G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → G → ℤ) {b B : ℕ} (h : b ≤ B) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : G → ℝ) end end Bounty end section /- Candidate remainder cancellation on the actual prime and remainder dyadic buckets. -/ open Finset Filter namespace Bounty theorem eventually_candidate_dyadic_block_decay {c q theta : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) (htheta : theta < 1/2) (B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, 0 < jStar → ∀ (h : ℕ) (R : ℝ), Real.exp ((c/512)*L) ≤ R → R ≤ Real.exp (theta*L) → ∀ Q : Finset ℕ, (∀ d ∈ Q, R/2 ≤ (d : ℝ)) → (∀ d ∈ Q, (d : ℝ) ≤ R) → ∀ i j : ℕ, primitiveCharacterBlockNorm Q (∑ p ∈ dyadicNatBucket (candidateQBand (c*L) 0) i, ∑ n ∈ dyadicNatBucket (Icc 1 ⌊16*Real.exp L⌋₊) j, fun f χ => if Real.exp L < ((p*n : ℕ) : ℝ) ∧ ((p*n : ℕ) : ℝ) ≤ 16*Real.exp L then (if p.Coprime h then (1 : ℂ) else 0) * (if n.Coprime h then (candidateRemainderCoefficient c L q r jStar hr n : ℂ) else 0) * χ ((p*n : ℕ) : ZMod f) else 0) ≤ Real.exp L * L^(-B) := by filter_upwards [eventually_candidate_factor_two_block_decay hc hr hq0 hq1 hcenter htheta B] with L hblockL intro jStar hj h R hRLo hRHi Q hQD hQR i j have hSpos : ∀ p ∈ candidateQBand (c*L) 0, 0 < p := by intro p hp exact ((mem_dyadicPrimeBand_iff (c*L) 1 (6/5) 0 p).mp hp).1.pos have hTpos : ∀ n ∈ Icc 1 ⌊16*Real.exp L⌋₊, 0 < n := fun n hn => (mem_Icc.mp hn).1 exact hblockL jStar hj h R ((2 : ℝ)^(i+1)) ((2 : ℝ)^(j+1)) hRLo hRHi Q (dyadicNatBucket (candidateQBand (c*L) 0) i) (dyadicNatBucket (Icc 1 ⌊16*Real.exp L⌋₊) j) hQD hQR (dyadicNatBucket_subset _ _) (dyadicNatBucket_subset _ _) (fun p hp => dyadicNatBucket_upper_scale_real _ hSpos hp) (fun n hn => dyadicNatBucket_upper_scale_real _ hTpos hn) end Bounty end section /- Three consecutive selected physical rows retain both normalized permutation factors and the original signed edge action. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) noncomputable def physicalSelectedEdgeBlock (j : K) (aux : PhysicalAuxLabels P (C j)) (σ τ : PhysicalPermutations (Fin N) J ell) (R : PhysicalMarkLists P J ell) (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (s : PhysicalBoundedMarkState P J ell B) : ℂ := physicalObservedMarkRow C k ω β retention ρ V hV none (fun o t => if o = .inl σ then physicalObservedMarkRow C k ω β retention ρ V hV (some (.inr j)) (fun o u => if o = .inr (some ⟨j, aux⟩) ∧ u.1 = physicalPermuteLabels τ R then physicalObservedMarkRow C k ω β retention ρ V hV none (fun o v => if o = .inl (physicalInversePermutations τ) then F (physicalMarkRawReadout v) else 0) u else 0) t else 0) s theorem physical_selected_edge_block_eq (j : K) (aux : PhysicalAuxLabels P (C j)) (σ τ : PhysicalPermutations (Fin N) J ell) (R : PhysicalMarkLists P J ell) (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalSelectedEdgeBlock C k ω β retention ρ V hV j aux σ τ R F s = (((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) ^ 2) * (ω j (productActiveMemorySplit (fun g => physicalFullSharedIndices (C j g)) B (physicalFullMemoryState (C j) (physicalPermuteLabels σ s.1) s.2.2)).1 aux : ℂ) * if physicalListAdmissible (C j) aux (physicalPermuteLabels σ s.1) (physicalPermuteLabels τ R) then jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) (C j) (k j) (physicalPermuteLabels σ s.1) (physicalPermuteLabels τ R) β ρ V aux) F (physicalMarkRawReadout s) else 0 := by unfold physicalSelectedEdgeBlock rw [physical_observed_selected_permutation_state] simp_rw [physical_observed_selected_permutation] have he := physical_observed_selected_edge C k ω β retention ρ V hV j aux (physicalPermuteLabels τ R) (fun t => ((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) * F t) (physicalPermuteLabels σ s.1, s.2) have he' := congrArg (((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) * ·) he convert he'.trans ?_ using 1 · congr 2 funext o u split_ifs <;> rfl · by_cases ha : physicalListAdmissible (C j) aux (physicalPermuteLabels σ s.1) (physicalPermuteLabels τ R) · simp only [ha, if_true] rw [joint_raw_tensor_cutoff_mul B _ (fun g c F s => physical_full_edge_raw_row_mul _ _ _ _ _ _ _ _ g c F s)] ring_nf rfl · simp only [ha, if_false, mul_zero] end Physical end Bounty end section /- The signed grouped comparison for disjoint prime pools, with all subset atom and product-log hypotheses discharged from fixed group bounds. -/ open Finset Filter open scoped Classical universe u namespace Bounty theorem eventually_prime_grouped_disjoint_pool_comparison (hZ : PrimitiveZeroFreeHalfPlane) (c s z a v D ε : ℝ) (m : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (hm : 0 < m) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type u} [Fintype G] [DecidableEq G] {I : G → Type u} [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)], ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ (probes tails : ∀ g, Finset (I g)), (∀ g, Disjoint (probes g) (tails g)) → ∀ ell : ℕ, (∀ g, (probes g).card = m) → (∀ g, (tails g).card = ell) → ∀ r t : Finset G, Disjoint r t → ∀ active : Finset (Sigma I), activeᶜ = univ.sigma tails → ∀ ζ Θ : ℝ, |ζ| ≤ L ^ z → ∀ f g : (∀ g, I g → P g) → ℂ, (∀ a, finiteGroupSlotSymmetric a f) → (∀ a, finiteGroupSlotSymmetric a g) → let kept := fun U : Finset (Sigma I) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ ‖cleanRawPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeActivePhase (fun a : Sigma I => P a.1) active ζ Θ) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g) - ∑ A ∈ cleanNonemptySubsets (r.sigma probes), ∑ B ∈ cleanNonemptySubsets (t.sigma probes), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeAsymmetricComparisonKernel (fun a : Sigma I => P a.1) (fun a => V a.1) active Q h kept kept ζ Θ A B) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g)‖ ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma probes).card + (t.sigma probes).card) * L ^ (-D)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) g) := by intro κ s' A₀ q w x have hκ : 0 ≤ a * Real.log (primeFiberFactorBound v m) := mul_nonneg ha (Real.log_nonneg (one_le_primeFiberFactorBound v m)) filter_upwards [eventually_prime_grouped_actual_comparison.{u} hZ c (a * Real.log (primeFiberFactorBound v m)) (s + ε) z 1 D hc hκ (add_nonneg hs hε.le) hz hD, eventually_prime_subset_product_log_rpow a s ε m hs hε, eventually_gt_atTop (0 : ℝ), eventually_ge_atTop (1 / v)] with L hcomp hlogs hL hlarge intro Q h ξ G _ _ I _ _ P V hdisj hP hmass hV hlog hcard hband probes tails hpt ell hp ht r t hrt active hactive ζ Θ hζ f g hf hg kept have hVpos (g : G) : 0 < V g := hv.trans_le (hV g) have hVlower (g : G) : L ^ (-1 : ℝ) ≤ V g := by have hb := one_div_le_one_div_of_le (one_div_pos.mpr hv) hlarge have hb' : 1 / L ≤ v := by simpa only [one_div_one_div] using hb simpa only [Real.rpow_neg_one, one_div] using hb'.trans (hV g) have hprime (g : G) (p : ℕ) (hp : p ∈ P g) : p.Prime := (hP g p hp).1 have hpos (g : G) (p : ℕ) (hp : p ∈ P g) : 0 < p := (hprime g p hp).pos have hm' (g : G) : (probes g).card ≤ m := (hp g).le apply hcomp P V hVpos hP hmass hVlower hband probes tails hpt m ell hm hp ht r t hrt active hactive ?_ ?_ ζ Θ hζ f g hf hg · intro U hU b rcases mem_union.mp hU with hU | hU · exact hlogs P r probes hm' hpos hlog hcard U ((clean_mem_nonempty_subsets _ _).mp hU).2 b · exact hlogs P t probes hm' hpos hlog hcard U ((clean_mem_nonempty_subsets _ _).mp hU).2 b · intro U hU n rcases mem_union.mp hU with hU | hU · exact prime_subset_physical_atom_rpow P V hprime hdisj r probes m hv hL hV hm' hcard U ((clean_mem_nonempty_subsets _ _).mp hU).2 n · exact prime_subset_physical_atom_rpow P V hprime hdisj t probes m hv hL hV hm' hcard U ((clean_mem_nonempty_subsets _ _).mp hU).2 n end Bounty end section /- A two-variable finite sieve with all congruence moments and remainders evaluated. -/ open Finset namespace Bounty noncomputable def pairSieveAvoidance (A B C D m : ℕ) (P : Finset ℕ) (rough banned : ℕ → Bool) : Finset (ℕ × ℕ) := by classical exact (pairSieveBaseBox A B C D m).filter (fun v => ∀ p ∈ P, ¬pairSieveBadEvent rough banned v p) theorem exists_finite_pair_sieve_estimate : ∃ K : ℝ, 0 < K ∧ ∀ (A B C D m : ℕ) [NeZero m] (P : Finset ℕ) (rough banned : ℕ → Bool) {z : ℝ} {h : ℕ}, A ≤ B → C ≤ D → 1 < z → 1 ≤ h → Even h → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, 3 ≤ p) → (∀ p ∈ P, ¬p ∣ m) → (∀ p ∈ P, (p : ℝ) ≤ z) → |((pairSieveAvoidance A B C D m P rough banned).card : ℝ) - (((B : ℝ)-A)*((D : ℝ)-C)*(m.totient : ℝ)/(m : ℝ)^2) * ∏ p ∈ P, (1 - pairSieveDensity p (rough p) (banned p))| ≤ ((((B : ℝ)-A)*((D : ℝ)-C)*(m.totient : ℝ)/(m : ℝ)^2) * ∏ p ∈ P, (1 - pairSieveDensity p (rough p) (banned p))) * K * Real.exp (-(h : ℝ)) + ((m : ℝ)*(z^(4*(h : ℝ)+2))^3 + (((B : ℝ)-A)+((D : ℝ)-C))*(z^(4*(h : ℝ)+2))^2) := by classical obtain ⟨C₀, hC₀, hshell⟩ := exists_finite_prime_reciprocal_shell_bound refine ⟨blockSieveModelErrorConstant (3*C₀) (2/9), block_sieve_model_error_constant_pos _ _, ?_⟩ intro A B C D m hm P rough banned z h hAB hCD hz hh heven hP hP3 hPm hPz let g := fun p => pairSieveDensity p (rough p) (banned p) let M := ((B : ℝ)-A)*((D : ℝ)-C)*(m.totient : ℝ)/(m : ℝ)^2 have hX : 0 ≤ (B : ℝ)-A := sub_nonneg.mpr (Nat.cast_le.mpr hAB) have hY : 0 ≤ (D : ℝ)-C := sub_nonneg.mpr (Nat.cast_le.mpr hCD) have hM : 0 ≤ M := by dsimp [M]; positivity have hg : ∀ p ∈ P, 0 ≤ g p ∧ g p ≤ 1-(2/9 : ℝ) := by intro p hp have hb := pair_sieve_density_bounds (hP3 p hp) (rough p) (banned p) exact ⟨hb.1, by norm_num; exact hb.2.1⟩ have hs : ∀ w : ℝ, 1 < w → (∑ p ∈ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2), g p) ≤ 3*C₀ := by intro w hw calc _ ≤ ∑ p ∈ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2), 3*(1/(p : ℝ)) := by apply sum_le_sum intro p hp simpa only [mul_one_div] using (pair_sieve_density_bounds (hP3 p (mem_filter.mp hp).1) (rough p) (banned p)).2.2 _ = 3 * ∑ p ∈ P.filter (fun p : ℕ => w < (p : ℝ) ∧ (p : ℝ) ≤ w^2), 1/(p : ℝ) := (mul_sum _ _ _).symm _ ≤ 3*C₀ := mul_le_mul_of_nonneg_left (hshell P hP w hw) (by norm_num) have hmoment : ∀ S ∈ P.powerset, (∑ _v ∈ (pairSieveBaseBox A B C D m).filter (fun v => ∀ p ∈ S, pairSieveBadEvent rough banned v p), (1 : ℝ)) = M * (∏ p ∈ S, g p) + pairSieveRemainder A B C D m rough banned (∏ p ∈ S, p) := by intro S hS simpa only [sum_const, nsmul_eq_mul, mul_one, pairSieveIntersection] using pair_sieve_exact_moment A B C D m rough banned S (fun p hp => hP p (mem_powerset.mp hS hp)) have hbound := finite_prime_sieve_events P (pairSieveBaseBox A B C D m) (fun _ => (1 : ℝ)) (pairSieveBadEvent rough banned) g (pairSieveRemainder A B C D m rough banned) hz hM (by positivity) (by norm_num) hh heven hP hPz (fun _ _ => by norm_num) hg hs hmoment have herror := pair_sieve_remainder_sum_le A B C D m rough banned hAB hCD P hP hPm (z^(4*(h : ℝ)+2)) (Real.rpow_nonneg (zero_lt_one.trans hz).le _) simpa only [sum_const, nsmul_eq_mul, mul_one, pairSieveAvoidance] using hbound.trans (add_le_add le_rfl herror) end Bounty end section /- Actual signed physical rows and fully recorded histories preserve finite sums of arbitrary terminal tests. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K A H : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) end Physical end Bounty end section /- The existing full active-label initial ledger is exactly the ledger of the encoded physical initial state. -/ namespace Bounty end Bounty end section /- Local performed-birth predicates identify exactly with predicates on original path addresses. -/ namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) theorem full_mixed_path_local_freshness_iff : (∀ i : Fin steps.length, let e := finiteEventPathOccurrence (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) steps x p i FullMixedLocalBirthAvoids n S B A Δ D e.1.1 (steps.get i) e.1.2 e.2 ∧ FullMixedLocalBirthDistinct n S B A Δ D (steps.get i) e.1.2 e.2) ↔ ((∀ (a : FullMixedBirthAddress S B steps) (z : (g : Fin N) × P g), fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z → z.2 ∉ (finiteEventPathOccurrence (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) steps x p a.1).1.1 z.1) ∧ (∀ (a b : FullMixedBirthAddress S B steps) z, a.1.val = b.1.val → fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z → fullMixedLedgerPathBirthLabel n S B A Δ D steps x p b = some z → a = b)) := by constructor · intro h constructor · rintro ⟨i, a⟩ z hz exact (h i).1 a z hz · rintro ⟨i, a⟩ ⟨j, b⟩ z hij ha hb have heq : i = j := Fin.ext hij subst j exact congrArg (Sigma.mk i) ((h i).2 a b z ha hb) · rintro ⟨ha, hd⟩ i constructor · intro a z hz exact ha ⟨i, a⟩ z hz · intro a b z haz hbz have heq := hd ⟨i, a⟩ ⟨i, b⟩ z rfl haz hbz exact eq_of_heq (Sigma.mk.inj_iff.mp heq).2 theorem full_mixed_path_local_freshness_global_iff (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hx : FullMixedLedgerCovers n B x) (hp : finiteEventPathWeight (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fun tag s => fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V tag s.2) steps x p ≠ 0) : (∀ i : Fin steps.length, let e := finiteEventPathOccurrence (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) steps x p i FullMixedLocalBirthAvoids n S B A Δ D e.1.1 (steps.get i) e.1.2 e.2 ∧ FullMixedLocalBirthDistinct n S B A Δ D (steps.get i) e.1.2 e.2) ↔ ((∀ (a : FullMixedBirthAddress S B steps) (z : (g : Fin N) × P g), fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z → z.2 ∉ x.1 z.1) ∧ (∀ (a b : FullMixedBirthAddress S B steps) z, fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z → fullMixedLedgerPathBirthLabel n S B A Δ D steps x p b = some z → a = b)) := (full_mixed_path_local_freshness_iff n S B A Δ D steps x p).trans (full_mixed_birth_freshness_iff n S B A Δ D ω μ q ρ V steps x p hx hp) end Full end Bounty end section /- Extra local coefficients may inspect both active endpoints and the original auxiliary draw. -/ open Finset Classical namespace Bounty section Factor variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin N → Finset (Fin J)) (k : ℤ) (Θ : ((g : Fin N) → Fin (J + ell) → ↥(P g)) → ((g : Fin N) → Fin (J + ell) → ↥(P g)) → PhysicalAuxLabels P C → ℂ) end Factor end Bounty end section /- Number and lower scale of the actual logarithmic cells meeting a dyad. -/ open Finset Filter namespace Bounty theorem int_finset_card_le_real_span (F : Finset ℤ) {a b : ℝ} (hab : a ≤ b) (hF : ∀ k ∈ F, a ≤ (k : ℝ) ∧ (k : ℝ) ≤ b) : (F.card : ℝ) ≤ b-a+1 := by classical by_cases hne : F.Nonempty · let lo := F.min' hne let hi := F.max' hne have hlohi : lo ≤ hi := F.min'_le_max' hne have hsub : F ⊆ Icc lo hi := fun k hk => mem_Icc.mpr ⟨F.min'_le k hk, F.le_max' k hk⟩ have hc : (F.card : ℤ) ≤ (Icc lo hi).card := Int.ofNat_le.mpr (card_le_card hsub) rw [Int.card_Icc_of_le (a := lo) (b := hi) (by omega)] at hc have hcR : (F.card : ℝ) ≤ (hi : ℝ)+1-(lo : ℝ) := by exact_mod_cast hc have hlo := (hF lo (F.min'_mem hne)).1 have hhi := (hF hi (F.max'_mem hne)).2 linarith · rw [not_nonempty_iff_eq_empty.mp hne, card_empty, Nat.cast_zero] linarith theorem logarithmic_cell_indices_card_dyad {δ Y : ℝ} (hδ : 0 < δ) (hY : 0 < Y) (F : Finset ℕ) (hF : ∀ n ∈ F, Y ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*Y) : ((logarithmicCellIndices δ F).card : ℝ) ≤ Real.log 2/δ+2 := by have hlogY : Real.log Y ≤ Real.log (2*Y) := Real.log_le_log hY (by linarith) have hspan : Real.log Y/δ-1 ≤ Real.log (2*Y)/δ := by have := div_le_div_of_nonneg_right hlogY hδ.le linarith have hindices : ∀ k ∈ logarithmicCellIndices δ F, Real.log Y/δ-1 ≤ (k : ℝ) ∧ (k : ℝ) ≤ Real.log (2*Y)/δ := by intro k hk obtain ⟨n, hn, rfl⟩ := mem_image.mp hk have hnR : 0 < (n : ℝ) := hY.trans_le (hF n hn).1 have hb := logarithmic_cell_index_bounds hδ n have hlo := Real.log_le_log hY (hF n hn).1 have hhi := Real.log_le_log hnR (hF n hn).2 constructor · have hh : Real.log Y/δ ≤ (logarithmicCellIndex δ n : ℝ)+1 := (div_le_iff₀ hδ).mpr (hlo.trans hb.2) linarith · exact ((le_div_iff₀ hδ).mpr (hb.1.le.trans hhi)) have h := int_finset_card_le_real_span (logarithmicCellIndices δ F) hspan hindices rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) hY.ne'] at h convert h using 1 ring theorem logarithmic_cell_base_lower {a L δ : ℝ} (hδ : 0 < δ) (hsmall : δ ≤ a*L/2) {n : ℕ} (hn : Real.exp (a*L) ≤ (n : ℝ)) : Real.exp ((a/2)*L) ≤ logarithmicCellBase δ (logarithmicCellIndex δ n) := by have hnR : 0 < (n : ℝ) := (Real.exp_pos _).trans_le hn have hlog := Real.log_le_log (Real.exp_pos (a*L)) hn rw [Real.log_exp] at hlog have hb := (logarithmic_cell_index_bounds hδ n).2 apply Real.exp_le_exp.mpr nlinarith theorem eventually_logarithmic_cell_dyad_bounds {a S : ℝ} (ha : 0 < a) (hS : 0 ≤ S) : ∀ᶠ L : ℝ in atTop, 0 < L ∧ ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ F : Finset ℕ, (∀ n ∈ F, Y ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*Y) → ((logarithmicCellIndices (L^(-S)) F).card : ℝ) ≤ L^(S+1) ∧ ∀ k ∈ logarithmicCellIndices (L^(-S)) F, Real.exp ((a/2)*L) ≤ logarithmicCellBase (L^(-S)) k := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (2/a), eventually_ge_atTop (Real.log 2+2)] with L hL1 hLa hLc have hL : 0 < L := zero_lt_one.trans_le hL1 refine ⟨hL, ?_⟩ intro Y hY F hF have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hδ : 0 < L^(-S) := Real.rpow_pos_of_pos hL _ have hδ1 : L^(-S) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hL1 (by linarith) have hsmall : L^(-S) ≤ a*L/2 := by have hh := (div_le_iff₀ ha).mp hLa nlinarith constructor · have hc := logarithmic_cell_indices_card_dyad hδ hY0 F hF have hpow : 1 ≤ L^S := Real.one_le_rpow hL1 hS have hdiv : Real.log 2/L^(-S) = Real.log 2*L^S := by rw [Real.rpow_neg hL.le]; field_simp rw [hdiv] at hc calc _ ≤ Real.log 2*L^S+2 := hc _ ≤ (Real.log 2+2)*L^S := by nlinarith _ ≤ L*L^S := mul_le_mul_of_nonneg_right hLc (by positivity) _ = L^(S+1) := by rw [Real.rpow_add hL, Real.rpow_one]; ring · intro k hk obtain ⟨n, hn, rfl⟩ := mem_image.mp hk exact logarithmic_cell_base_lower hδ hsmall (hY.trans (hF n hn).1) end Bounty end section /- Exact full-cell cancellation leaves at most the two boundary cells of an interval. -/ open Finset namespace Bounty theorem logarithmic_cell_subset_interval {δ : ℝ} (hδ : 0 < δ) {m n : ℕ} {k : ℤ} (hk : k ∈ logarithmicCellIndices δ (Ioc m n)) (hleft : k ≠ logarithmicCellIndex δ (m+1)) (hright : k ≠ logarithmicCellIndex δ n) : logarithmicCellSet δ k ⊆ Ioc m n := by obtain ⟨i, hi, hik⟩ := mem_image.mp hk have hi0 : 0 < i := lt_of_le_of_lt (Nat.zero_le _) (mem_Ioc.mp hi).1 have hiC := (mem_logarithmic_cell_iff hδ hi0 k).mpr hik intro j hj obtain ⟨hjlo, hjhi⟩ := mem_Ioc.mp hj obtain ⟨hilo, hihi⟩ := mem_Ioc.mp hiC obtain ⟨hmi, hin⟩ := mem_Ioc.mp hi apply mem_Ioc.mpr constructor · by_contra h have hmC : m+1 ∈ logarithmicCellSet δ k := mem_Ioc.mpr ⟨by omega, by omega⟩ exact hleft ((mem_logarithmic_cell_iff hδ (by omega) k).mp hmC).symm · by_contra h have hn0 : 0 < n := by omega have hnC : n ∈ logarithmicCellSet δ k := mem_Ioc.mpr ⟨by omega, by omega⟩ exact hright ((mem_logarithmic_cell_iff hδ hn0 k).mp hnC).symm theorem logarithmic_interval_cancellation_bound {δ : ℝ} (hδ : 0 < δ) (m n : ℕ) (g : ℕ → ℂ) {M : ℝ} (hM : 0 ≤ M) (hzero : ∀ k ∈ logarithmicCellIndices δ (Ioc m n), ∑ i ∈ logarithmicCellSet δ k, g i = 0) (hmass : ∀ k ∈ logarithmicCellIndices δ (Ioc m n), (∑ i ∈ logarithmicCellSet δ k, ‖g i‖) ≤ M) : ‖∑ i ∈ Ioc m n, g i‖ ≤ 2*M := by classical let K := logarithmicCellIndices δ (Ioc m n) let B := K.filter (fun k => ¬logarithmicCellSet δ k ⊆ Ioc m n) let f := fun k => ∑ i ∈ (Ioc m n).filter (fun i => logarithmicCellIndex δ i = k), g i have hBK : B ⊆ K := filter_subset _ _ have hBpair : B ⊆ {logarithmicCellIndex δ (m+1), logarithmicCellIndex δ n} := by intro k hk obtain ⟨hkK, hknot⟩ := mem_filter.mp hk by_contra h have hneq : k ≠ logarithmicCellIndex δ (m+1) ∧ k ≠ logarithmicCellIndex δ n := by simpa only [mem_insert, mem_singleton, not_or] using h exact hknot (logarithmic_cell_subset_interval hδ hkK hneq.1 hneq.2) have hBcard : B.card ≤ 2 := (card_le_card hBpair).trans (by apply (card_insert_le _ _).trans simp only [card_singleton, Nat.le_refl]) have hfzero : ∀ k ∈ K, k ∉ B → f k = 0 := by intro k hk hnot have hsub : logarithmicCellSet δ k ⊆ Ioc m n := by by_contra h exact hnot (mem_filter.mpr ⟨hk, h⟩) have heq : (Ioc m n).filter (fun i => logarithmicCellIndex δ i = k) = logarithmicCellSet δ k := by ext i constructor · intro hi obtain ⟨hiI, hiK⟩ := mem_filter.mp hi exact (mem_logarithmic_cell_iff hδ (lt_of_le_of_lt (Nat.zero_le _) (mem_Ioc.mp hiI).1) k).mpr hiK · intro hi exact mem_filter.mpr ⟨hsub hi, (mem_logarithmic_cell_iff hδ (logarithmic_cell_pos hi) k).mp hi⟩ dsimp [f] rw [heq] exact hzero k hk have hsum : (∑ i ∈ Ioc m n, g i) = ∑ k ∈ B, f k := by rw [← sum_logarithmic_cell_fibers δ (Ioc m n) g] exact (sum_subset hBK hfzero).symm rw [hsum] calc _ ≤ ∑ k ∈ B, ‖f k‖ := norm_sum_le _ _ _ ≤ ∑ _k ∈ B, M := by apply sum_le_sum intro k hk apply (norm_sum_le _ _).trans apply le_trans _ (hmass k (hBK hk)) apply sum_le_sum_of_subset_of_nonneg · intro i hi obtain ⟨hiI, hiK⟩ := mem_filter.mp hi exact (mem_logarithmic_cell_iff hδ (lt_of_le_of_lt (Nat.zero_le _) (mem_Ioc.mp hiI).1) k).mpr hiK · intro i _ _ exact norm_nonneg _ _ = (B.card : ℝ)*M := by simp only [sum_const, nsmul_eq_mul] _ ≤ 2*M := mul_le_mul_of_nonneg_right (by exact_mod_cast hBcard) hM end Bounty end section /- Principal characters are exactly one on the actual prime-minus-proxy support. -/ open Finset Filter namespace Bounty theorem coprime_of_small_prime_avoidance {n r : ℕ} {W : ℝ} (hr : 0 < r) (hrW : (r : ℝ) ≤ W) (havoid : ∀ p ∈ primeBand 0 W, ¬p ∣ n) : n.Coprime r := by apply Nat.coprime_of_dvd' intro p hp hpn hpr have hpW : (p : ℝ) ≤ W := (Nat.cast_le.mpr (Nat.le_of_dvd hr hpr)).trans hrW have hW : 0 ≤ W := (Nat.cast_nonneg r).trans hrW have hpm : p ∈ primeBand 0 W := (mem_primeBand_iff le_rfl hW p).mpr ⟨hp, Nat.cast_pos.mpr hp.pos, hpW⟩ exact False.elim (havoid p hpm hpn) theorem prime_logarithmic_proxy_principal_identity (L S : ℝ) {n r : ℕ} (hr : 0 < r) (hrW : (r : ℝ) ≤ Real.exp (Real.sqrt L)) (hnW : Real.exp (Real.sqrt L) < (n : ℝ)) : (((if n.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S n : ℝ) : ℂ)* (1 : DirichletCharacter ℂ r) (n : ZMod r) = (((if n.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S n : ℝ) : ℂ) := by by_cases hp : n.Prime · have hcop : n.Coprime r := hp.coprime_iff_not_dvd.mpr (by intro hnr have hnrR := (Nat.cast_le.mpr (Nat.le_of_dvd hr hnr)).trans hrW exact (not_lt_of_ge hnrR) hnW) rw [MulChar.one_apply ((ZMod.isUnit_iff_coprime _ _).mpr hcop), mul_one] · by_cases hz : primeLogarithmicProxy L S n = 0 · simp only [if_neg hp, hz, sub_zero, Complex.ofReal_zero, zero_mul] · have hcop : n.Coprime r := coprime_of_small_prime_avoidance hr hrW (prime_cell_proxy_avoids_small_primes hz) rw [MulChar.one_apply ((ZMod.isUnit_iff_coprime _ _).mpr hcop), mul_one] theorem eventually_prime_logarithmic_proxy_principal_identity {a : ℝ} (ha : 0 < a) (S T : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ n : ℕ, Real.exp (a*L) ≤ (n : ℝ) → ∀ r : ℕ, 0 < r → (r : ℝ) ≤ L^T → (((if n.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S n : ℝ) : ℂ)* (1 : DirichletCharacter ℂ r) (n : ZMod r) = (((if n.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S n : ℝ) : ℂ) := by have ha2 : 0 < a/2 := by positivity filter_upwards [eventually_rpow_le_exp_sqrt T, eventually_sqrt_le_dyadic_scale ha2 0, eventually_gt_atTop (0 : ℝ)] with L hmod hsqrt hL intro n hn r hr hrT apply prime_logarithmic_proxy_principal_identity L S hr (hrT.trans hmod) apply lt_of_lt_of_le _ hn apply Real.exp_lt_exp.mpr simp only [pow_zero, div_one] at hsqrt nlinarith end Bounty end section /- The indexed forest phases retain exactly the original global initial-avoidance factor. -/ open Finset Classical namespace Bounty section Product variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (initial : (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) end Product end Bounty end section /- The actual count-matched proxy for the exponential roughness test. -/ open Finset Filter namespace Bounty def exponentialRoughTest (γ L : ℝ) (n : ℕ) : Prop := ∀ p ∈ n.primeFactors, Real.exp (γ*L) < (p : ℝ) noncomputable def roughTestIndicator (γ L : ℝ) (n : ℕ) : ℝ := by classical exact if exponentialRoughTest γ L n then 1 else 0 noncomputable def roughTestCellProxyCoefficient (γ L S Y : ℝ) : ℝ := ((roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (γ*L))).card : ℝ) / (roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L))).card noncomputable def roughTestCellProxy (γ L S Y : ℝ) (n : ℕ) : ℝ := if n ∈ roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L)) then roughTestCellProxyCoefficient γ L S Y else 0 noncomputable def roughTestLogarithmicProxy (γ L S : ℝ) (n : ℕ) : ℝ := roughTestCellProxy γ L S (logarithmicCellBase (L^(-S)) (logarithmicCellIndex (L^(-S)) n)) n theorem rough_band_subset_of_cutoff {A B W z : ℝ} (hWz : W ≤ z) : roughBand A B z ⊆ roughBand A B W := by intro n hn obtain ⟨hnI, hnrough⟩ := mem_filter.mp hn exact mem_filter.mpr ⟨hnI, fun p hp => hWz.trans_lt (hnrough p hp)⟩ theorem rough_test_cell_coefficient_bounds {γ L S Y : ℝ} (hcut : Real.sqrt L ≤ γ*L) : 0 ≤ roughTestCellProxyCoefficient γ L S Y ∧ roughTestCellProxyCoefficient γ L S Y ≤ 1 := by let I := roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (γ*L)) let R := roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L)) have hIR : I ⊆ R := rough_band_subset_of_cutoff (Real.exp_le_exp.mpr hcut) by_cases hR : R.card = 0 · have hI : I.card = 0 := Nat.eq_zero_of_le_zero (hR ▸ card_le_card hIR) change 0 ≤ (I.card : ℝ)/(R.card : ℝ) ∧ (I.card : ℝ)/(R.card : ℝ) ≤ 1 simp only [hR, hI, Nat.cast_zero, div_zero, le_refl, zero_le_one, and_self] · have h := finite_cell_count_proxy R I hIR (Nat.pos_of_ne_zero hR) exact ⟨h.1, h.2.1⟩ theorem rough_test_cell_proxy_nonneg (γ L S Y : ℝ) (n : ℕ) : 0 ≤ roughTestCellProxy γ L S Y n := by unfold roughTestCellProxy roughTestCellProxyCoefficient split <;> positivity theorem rough_test_cell_proxy_bounds {γ L S Y : ℝ} (hcut : Real.sqrt L ≤ γ*L) (n : ℕ) : 0 ≤ roughTestCellProxy γ L S Y n ∧ roughTestCellProxy γ L S Y n ≤ 1 := by unfold roughTestCellProxy split · exact rough_test_cell_coefficient_bounds hcut · exact ⟨le_rfl, zero_le_one⟩ theorem eventually_rough_test_proxy_cutoff {γ : ℝ} (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, Real.sqrt L ≤ γ*L := by simpa only [pow_zero, div_one] using eventually_sqrt_le_dyadic_scale hγ 0 theorem rough_test_cell_proxy_ne_zero_mem {γ L S Y : ℝ} {n : ℕ} (h : roughTestCellProxy γ L S Y n ≠ 0) : n ∈ roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L)) := by by_contra hn exact h (by simp only [roughTestCellProxy, if_neg hn]) theorem rough_band_avoids_small_primes {A B W : ℝ} {n : ℕ} (hn : n ∈ roughBand A B W) : ∀ p ∈ primeBand 0 W, ¬p ∣ n := by intro p hp hpn have hpf : p ∈ n.primeFactors := Nat.mem_primeFactors.mpr ⟨(mem_filter.mp hp).2, hpn, (roughBand_pos hn).ne'⟩ have hlarge := (mem_filter.mp hn).2 p hpf have hW : 0 ≤ W := by have hfloor : 0 < ⌊W⌋₊ := ((mem_filter.mp hp).2.pos).trans_le (mem_Ioc.mp (mem_filter.mp hp).1).2 have hh : 1 ≤ W := Nat.floor_pos.mp hfloor linarith have hsmall : (p : ℝ) ≤ W := (Nat.cast_le.mpr (mem_Ioc.mp (mem_filter.mp hp).1).2).trans (Nat.floor_le hW) exact (not_lt_of_ge hsmall) hlarge section variable {γ L S Y : ℝ} (hR : 0 < (roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L))).card) include γ L S Y hR theorem rough_test_cell_proxy_count_match : (∑ n ∈ Ioc ⌊Y⌋₊ ⌊Real.exp (L^(-S))*Y⌋₊, roughTestCellProxy γ L S Y n) = ((roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (γ*L))).card : ℝ) := by classical have hsubset : roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L)) ⊆ Ioc ⌊Y⌋₊ ⌊Real.exp (L^(-S))*Y⌋₊ := fun _ hn => (mem_filter.mp hn).1 rw [← sum_subset hsubset (fun n _ hn => by simp only [roughTestCellProxy, if_neg hn])] trans ∑ _n ∈ roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L)), roughTestCellProxyCoefficient γ L S Y · exact sum_congr rfl (fun n hn => by simp only [roughTestCellProxy, if_pos hn]) simp only [sum_const, nsmul_eq_mul] unfold roughTestCellProxyCoefficient have hcard : ((roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (Real.sqrt L))).card : ℝ) ≠ 0 := (Nat.cast_pos.mpr hR).ne' field_simp theorem rough_test_cell_proxy_full_cell_zero_sum : (∑ n ∈ Ioc ⌊Y⌋₊ ⌊Real.exp (L^(-S))*Y⌋₊, (roughTestIndicator γ L n-roughTestCellProxy γ L S Y n)) = 0 := by classical rw [sum_sub_distrib, rough_test_cell_proxy_count_match hR] simp only [roughTestIndicator, sum_boole] apply sub_eq_zero.mpr congr 2 ext i constructor · intro hi exact mem_filter.mpr ⟨(mem_filter.mp hi).1, (mem_filter.mp hi).2⟩ · intro hi exact mem_filter.mpr ⟨(mem_filter.mp hi).1, (mem_filter.mp hi).2⟩ end theorem rough_test_logarithmic_proxy_eq_on_cell {γ L S : ℝ} (hL : 0 < L) {k : ℤ} {n : ℕ} (hn : n ∈ logarithmicCellSet (L^(-S)) k) : roughTestLogarithmicProxy γ L S n = roughTestCellProxy γ L S (logarithmicCellBase (L^(-S)) k) n := by unfold roughTestLogarithmicProxy rw [(mem_logarithmic_cell_iff (by positivity) (logarithmic_cell_pos hn) k).mp hn] theorem eventually_rough_test_logarithmic_proxy_bounds {γ : ℝ} (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, ∀ S : ℝ, ∀ n : ℕ, 0 ≤ roughTestLogarithmicProxy γ L S n ∧ roughTestLogarithmicProxy γ L S n ≤ 1 ∧ |roughTestIndicator γ L n-roughTestLogarithmicProxy γ L S n| ≤ 1 := by classical filter_upwards [eventually_rough_test_proxy_cutoff hγ] with L hcut intro S n have hv := rough_test_cell_proxy_bounds (S := S) (Y := logarithmicCellBase (L^(-S)) (logarithmicCellIndex (L^(-S)) n)) hcut n change 0 ≤ roughTestLogarithmicProxy γ L S n ∧ roughTestLogarithmicProxy γ L S n ≤ 1 at hv refine ⟨hv.1, hv.2, ?_⟩ unfold roughTestIndicator split <;> rw [abs_le] <;> constructor <;> linarith [hv.1, hv.2] end Bounty end section /- Selected-child counts are fixed by the original forest and schedule, not by birth values. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) section Ghost variable (j : J) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) (tail : FullPermutationMixedPath n S B A Δ D steps (fullPermutationMixedEventTarget n S B A Δ D (some (.inl j)) s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B (some (.inl j) :: steps)))) end Ghost section Edge variable (k : K) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) (tail : FullPermutationMixedPath n S B A Δ D steps (fullPermutationMixedEventTarget n S B A Δ D (some (.inr k)) s ((fullPermutationEdgeBirthEquiv (J := J) n S B A Δ D s k).symm ⟨sk, fresh⟩))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B (some (.inr k) :: steps)))) end Edge end Full end Bounty end section /- Exact original-path data and performed-address coverage for arbitrary-owner fixed skeletons. -/ namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (x s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) section Ghost variable (j : J) (htag : steps.get u = some (.inl j)) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) end Ghost section Edge variable (k : K) (htag : steps.get u = some (.inr k)) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) end Edge end Full end Bounty end section /- Iterating the original event updates recovers exactly the original path's fixed global birth labels. -/ open Classical namespace Bounty section History variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) end History end Bounty end section /- One original event updates its fixed global birth coordinates without requiring a future path. -/ namespace Bounty section Local variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (tag : Option (J ⊕ K)) (htag : steps.get u = tag) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) (history : Fin (Fintype.card (FullMixedBirthAddress S B steps)) → Option (Sigma P)) end Local end Bounty end section /- The support partition is independent of sampled labels and preserves the entire sample-dependent integrand. -/ open Finset Classical namespace Bounty theorem owner_sample_stage_sum {N m L : ℕ} {α Z : Type*} [Fintype Z] (embed : Fin m → Fin N) (hstrict : StrictMono embed) (owner : Fin N → Fin L) (hmono : Monotone owner) (u : Fin L) (howner : ∀ j, owner (embed j) = u) (code : BirthForestCode N) (values : Z → Fin N → Option α) (history : Fin N → Option α) (localValues : Z → Fin m → α) (hcover : ∀ z i, (values z i).isSome = true ∧ owner i = u ↔ i ∈ Set.range embed) (hother : ∀ z i, owner i ≠ u → values z i = history i) (hlocal : ∀ z j, values z (embed j) = some (localValues z j)) (F : Z → ℝ) : (∑ z, if birthForestStageCondition owner u (values z) code then F z else 0) = if birthForestStageSupport owner u (ownerSampleSupport embed owner u history) code then ∑ z, if birthForestEqualValues (restrictedBirthCode embed code) (localValues z) ∧ birthLabelsAnchored (fun j => (restrictedBirthAnchors embed code history j).join) (localValues z) then F z else 0 else 0 := by by_cases hs : birthForestStageSupport owner u (ownerSampleSupport embed owner u history) code · rw [if_pos hs] apply sum_congr rfl intro z _ rw [owner_sample_stage_iff embed hstrict owner hmono u howner code (values z) history (localValues z) (hcover z) (hother z) (hlocal z)] simp only [hs, true_and] · rw [if_neg hs] apply sum_eq_zero intro z _ rw [owner_sample_stage_iff embed hstrict owner hmono u howner code (values z) history (localValues z) (hcover z) (hother z) (hlocal z)] simp only [hs, false_and, if_false] end Bounty end section /- Supported owner forests retain exactly one atom exponent per original selected child. -/ open Finset Classical namespace Bounty theorem owner_supported_selected_fiber_card {G : Type*} [Fintype G] [DecidableEq G] (I : G → Type*) [∀ g, Fintype (I g)] {m N L : ℕ} {α : Type*} (ord : Fin m ≃ Sigma I) (f : Sigma I ↪ Fin N) (owner : Fin N → Fin L) (u : Fin L) (group : Fin N → G) (howner : ∀ i, owner (f i) = u) (hgroup : ∀ i, group (f i) = i.1) (code : BirthForestCode N) (history : Fin N → Option α) (hs : birthForestStageSupport owner u (ownerSampleSupport (f ∘ ord) owner u history) code) (g : G) : (univ.filter (fun i : I g => code (f ⟨g, i⟩) ≠ none)).card = (univ.filter (fun i => owner i = u ∧ group i = g ∧ code i ≠ none)).card := by apply selected_fiber_card f (fun i => owner i = u) (fun i => code i ≠ none) group howner hgroup intro i hi hc have hp := birth_forest_stage_support_children owner u _ code hs i hi hc obtain ⟨j, hj⟩ := owner_sample_support_cover (f ∘ ord) owner u history i hp hi exact ⟨ord j, hj⟩ theorem grouped_join_restricted_forest_cost_eq {G : Type*} [Fintype G] [DecidableEq G] (I : G → Type*) [∀ g, Fintype (I g)] {m N : ℕ} {α : Type*} (ord : Fin m ≃ Sigma I) (f : Sigma I → Fin N) (code : BirthForestCode N) (history : Fin N → Option α) (root atom : G → ℝ) (d : G → ℕ) (hvalid : ∀ j, restrictedBirthAnchors (f ∘ ord) code history j ≠ some none) (hd : ∀ g, (univ.filter (fun i : I g => code (f ⟨g, i⟩) ≠ none)).card = d g) : (∏ j, match restrictedBirthCode (f ∘ ord) code j with | some _ => atom (ord j).1 | none => match (restrictedBirthAnchors (f ∘ ord) code history j).join with | none => root (ord j).1 | some _ => atom (ord j).1) = ∏ g, atom g ^ d g * root g ^ (Fintype.card (I g) - d g) := by apply grouped_forest_cost_eq I ord (restrictedBirthCode (f ∘ ord) code) (fun j => (restrictedBirthAnchors (f ∘ ord) code history j).join) root atom d intro g have he : (univ.filter (fun i : I g => restrictedBirthCode (f ∘ ord) code (ord.symm ⟨g, i⟩) ≠ none ∨ (restrictedBirthAnchors (f ∘ ord) code history (ord.symm ⟨g, i⟩)).join ≠ none)) = univ.filter (fun i : I g => code (f ⟨g, i⟩) ≠ none) := by ext i simp only [mem_filter, mem_univ, true_and, restricted_join_selected_iff _ _ _ hvalid, Function.comp_apply] exact Iff.of_eq (congrArg (fun k => code (f k) ≠ none) (ord.apply_symm_apply ⟨g, i⟩)) rw [he] exact hd g end Bounty end section /- No forest incidence removes exactly the local forest factor, leaving initial avoidance. -/ open Finset Classical namespace Bounty section Local variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) (θ : (Fin (Fintype.card (FullMixedBirthAddress S B steps)) × Fin (Fintype.card (FullMixedBirthAddress S B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) (i : Fin steps.length) (hi : i ∉ fullMixedBirthAffectedOperations S B steps code) end Local section Stage variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (residual : ∀ (tag : Option (J ⊕ K)) s, FullPermutationMixedEvent n S B A Δ D tag s → ℂ) (initial : (g : Fin N) → Finset (P g)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) (θ : (Fin (Fintype.card (FullMixedBirthAddress S B steps)) × Fin (Fintype.card (FullMixedBirthAddress S B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) (i : Fin steps.length) (hi : i ∉ fullMixedBirthAffectedOperations S B steps code) end Stage end Bounty end section /- The literal positive mixed storage and reverse rows preserve permutation symmetry of the big pending memory. The proof uses their pointwise completion form, not an inference from a restricted bilinear identity. -/ open Finset Classical namespace Bounty section variable {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ) (q : ℝ) (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) theorem physical_small_big_storage_memory_symmetric (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : ∀ s, ProductMemorySymmetric (fun x => physicalSmallBigStorageAction n shared B Δ D μ ρ V kbig Vs q aux F (s, x)) := by rintro ⟨r, L⟩ x g σ unfold physicalSmallBigStorageAction dsimp only rw [physical_small_big_action_completion, physical_small_big_action_completion, physical_small_big_storage_prefix_eq, physical_small_big_storage_prefix_eq] apply congrArg (fun z : ℂ => ((physicalCompletionMass Vs (fun _ => (∅ : Finset (Fin J))) ell * physicalResidueVertexWeight L (Real.sqrt q) r : ℝ) : ℂ) * z) exact full_active_storage_external_symmetric n shared B (fun c (_ : Unit) => Δ (physicalSharedPrefix L) c) (fun c (_ : Unit) => D (physicalSharedPrefix L) c) (fun _ _ => 1) μ ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct (physicalSharedPrefix L) : ℕ))) (physicalSmallBigCompletion q F (physicalSharedPrefix L)) (fun r => physical_small_big_completion_memory_symmetric q F hF (physicalSharedPrefix L) r) r x g σ end end Bounty end section /- The actual phased mixed action retains both small endpoints and all big event choices. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- The mixed small residue moves by the full original physical displacement. -/ open scoped Classical namespace Bounty end Bounty end section /- The actual candidate-pool mixed promotion estimate. The scalar omission probability and all per-choice operator bounds are discharged. A fixed auxiliary draw is absorbed into the arbitrary retained-big-label factor. -/ open Finset Filter open scoped Classical Topology namespace Bounty end Bounty end section /- Candidate omission rarity in the reversed big-residue direction. -/ open Finset Filter open scoped Classical Topology namespace Bounty end Bounty end section /- Concrete mixed edge parameters retain the full small-times-big divisor. -/ open scoped Classical namespace Bounty section Parameters variable {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) noncomputable def physicalMixedSharedD (d : PhysicalSharedLists Ps J) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) : ℕ := physicalSharedProduct d * physicalFullSharedD C c aux noncomputable def physicalMixedEdgeD (d : PhysicalSharedLists Ps J) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) (_g : G) : ℤ := physicalMixedSharedD C d c aux noncomputable def physicalMixedEdgeDelta (k : ℤ) (d : PhysicalSharedLists Ps J) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) (g : G) : ℤ := -k * physicalMixedEdgeD C d c aux g end Parameters section BigStep variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) noncomputable def physicalMixedBigStep (k : ℤ) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) : ℤ := k * (physicalFullSharedD C c aux : ℕ) end BigStep section Encoded variable {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (d : PhysicalSharedLists Ps J) (L : PhysicalMarkLists P J ell) (q : ∀ g, BoundedOrderedTuple (Z g) B) (aux : PhysicalAuxLabels P C) theorem physical_mixed_shared_D_at_state : physicalMixedSharedD C d (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C L q)).1 aux = physicalSharedProduct d * physicalD C L aux := by rw [physicalMixedSharedD, physical_full_shared_D_eq] end Encoded end Bounty end section /- Positive mixed edges preserve permutation symmetry of the pending big memory, including the small completion and its translated residue coordinate. -/ open Finset Classical namespace Bounty theorem full_active_external_positive_symmetric {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P shared → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) {R : Type*} (τ : ∀ c, A c → R ≃ R) (F : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → R → ℂ) (hF : ∀ r, ProductMemorySymmetric (fun x => F x r)) : ∀ r, ProductMemorySymmetric (fun x => fullActiveExternalPositiveAction n shared B A Δ D ω μ ρ V τ F x r) := by apply full_active_external_fiber_average_symmetric shared B ω _ τ _ F hF intro c a f hf rw [unrestricted_coupled_positive_cutoff_eq_product] exact unrestricted_positive_cutoff_product_symmetric n (Δ c a) (D c a) μ ρ V (fun g => (shared g)ᶜ.card) B univ f hf theorem physical_small_big_full_positive_memory_symmetric {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ) (q : ℝ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : ∀ s, ProductMemorySymmetric (fun x => physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (fun _ _ => 1) F (s, x)) := by let aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J))) := fun _ j => False.elim (notMem_empty j.val j.property) rw [← physical_small_big_full_positive_eq n shared B Δ D μ ρ V kbig Vs q aux F] rintro ⟨r, L⟩ x g σ dsimp only rw [physical_small_big_action_completion, physical_small_big_action_completion, physical_small_big_full_prefix_eq, physical_small_big_full_prefix_eq, ← full_active_external_positive_eq_sum, ← full_active_external_positive_eq_sum] apply congrArg (fun z : ℂ => ((physicalCompletionMass Vs (fun _ => (∅ : Finset (Fin J))) ell * physicalResidueVertexWeight L (Real.sqrt q) r : ℝ) : ℂ) * z) exact full_active_external_positive_symmetric n shared B (fun _ => Unit) (fun c _ => Δ (physicalSharedPrefix L) c) (fun c _ => D (physicalSharedPrefix L) c) (fun _ _ => 1) μ ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct (physicalSharedPrefix L) : ℕ))) (physicalSmallBigCompletion q F (physicalSharedPrefix L)) (fun r => physical_small_big_completion_memory_symmetric q F hF (physicalSharedPrefix L) r) r x g σ end Bounty end section /- Explicit finite determinant cutoffs for the actual Type-II energy. -/ open Finset namespace Bounty theorem typeII_off_determinant_bound {E N M H : Finset ℕ} {Elo U : ℝ} (hElo : 0 < Elo) (hE : ∀ e ∈ E, Elo ≤ (e : ℝ)) (hM : ∀ m ∈ M, (m : ℝ) ≤ U) {x : TypeIIOffIndex} (hx : x ∈ typeIIOffDiagonalSupport E N M H) : |((typeIIShiftMap x).1.1 : ℝ)| ≤ U / (2 * Elo) := by obtain ⟨he, hn, hm, hh, hm', hh', hne, hfirst, hsecond⟩ := mem_typeII_off_diagonal_support.mp hx obtain ⟨k, hk, _⟩ := typeII_determinant_unique_nat hfirst hsecond hne have hdiff : |(x.2.2.1 : ℝ) - x.2.1.1| ≤ U := by apply abs_le.mpr constructor · linarith [hM _ hm, Nat.cast_nonneg (α := ℝ) x.2.2.1] · linarith [hM _ hm', Nat.cast_nonneg (α := ℝ) x.2.1.1] have hb := typeII_determinant_abs_le_of_difference hElo (hE _ he) hdiff hk.2.1 simpa only [typeIIShiftMap, hk.2.2.2] using hb theorem typeII_determinant_interval_coverage {E N M H : Finset ℕ} {Elo U : ℝ} {B : ℕ} (hElo : 0 < Elo) (hE : ∀ e ∈ E, Elo ≤ (e : ℝ)) (hM : ∀ m ∈ M, (m : ℝ) ≤ U) (hB : U / (2 * Elo) ≤ B) {x : TypeIIOffIndex} (hx : x ∈ typeIIOffDiagonalSupport E N M H) : (typeIIShiftMap x).1.1 ∈ Icc (-(B : ℤ)) (B : ℤ) := by have hr := (typeII_off_determinant_bound hElo hE hM hx).trans hB have hi : |(typeIIShiftMap x).1.1| ≤ (B : ℤ) := by exact_mod_cast hr exact mem_Icc.mpr (abs_le.mp hi) theorem typeII_cross_product_interval_coverage {E N M H : Finset ℕ} {x : TypeIIOffIndex} (hx : x ∈ typeIIOffDiagonalSupport E N M H) : (typeIIShiftMap x).1.2 ∈ Icc 0 (M.sup id * H.sup id) := by obtain ⟨he, hn, hm, hh, hm', hh', hne, hfirst, hsecond⟩ := mem_typeII_off_diagonal_support.mp hx apply mem_Icc.mpr exact ⟨Nat.zero_le _, Nat.mul_le_mul (le_sup (f := id) hm') (le_sup (f := id) hh)⟩ theorem typeII_off_diagonal_energy_eq_bounded_determinant_sum (E N M H : Finset ℕ) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) {Elo U W : ℝ} {B : ℕ} (hElo : 0 < Elo) (hE : ∀ e ∈ E, Elo ≤ (e : ℝ)) (hM : ∀ m ∈ M, (m : ℝ) ≤ U) (hB : U / (2 * Elo) ≤ B) (hBW : (B : ℝ) ≤ W) (hrough : ∀ m ∈ M, ∀ p ∈ m.primeFactors, W < (p : ℝ)) : typeIIOffDiagonalEnergy E N M H η α aH = ∑ y ∈ typeIIDeterminantDomain E N M H (Icc (-(B : ℤ)) B) (Icc 0 (M.sup id * H.sup id)), typeIIShiftWeight η α aH y := by apply typeII_off_diagonal_energy_eq_determinant_sum E N M H _ _ η α aH hrough · intro k hk have hi : |k| ≤ (B : ℤ) := abs_le.mpr (mem_Icc.mp hk) have hr : |(k : ℝ)| ≤ (B : ℝ) := by exact_mod_cast hi exact hr.trans hBW · intro x hx exact typeII_determinant_interval_coverage hElo hE hM hB hx · intro x hx exact typeII_cross_product_interval_coverage hx end Bounty end section /- Exact auxiliary disintegration of the positive mixed path edge. The moving small prefix remains inside each literal full big-event operator. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_path_positive_edge_eq {H K S G : Type} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : K → Type) [∀ k, Fintype (A k)] (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) (hVs : ∀ s, 0 < Vs s) (hω : ∀ k a, 0 ≤ ω k a) (hμ : ∀ g p, 0 ≤ μ g p) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ Vedge g) (k : K) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) : physicalSmallBigPathPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall (some (.inr k)) F = fun s => ∑ a : A k, (ω k a : ℂ) * physicalSmallBigFullPhasedAction n (shared k) B (fun d c => Δ k d c a) (fun d c => D k d c a) μ ρ Vedge (fun c => kbig k c a) Vs qsmall (fun _ _ => 1) F s := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) funext s unfold physicalSmallBigPathPositiveAction finiteLocalEventAction dsimp only [physicalSmallBigPathEventFintype, PhysicalSmallBigPathEvent] rw [Fintype.sum_prod_type] simp only [Fintype.sum_sigma] rw [sum_comm] simp only [physicalSmallBigFullPhasedAction, physicalSmallBigPhasedAction, Fintype.sum_prod_type, Fintype.sum_sigma, Fintype.sum_unique, mul_sum] apply sum_congr rfl intro a _ apply sum_congr rfl intro L _ apply sum_congr rfl intro e _ have hw := physical_small_big_path_edge_weight_nonneg n shared B A Δ D kbig ω μ qghost ρ Vedge Vs qsmall hVs hω hμ hρ hV k s (L, ⟨a, e⟩) simp only [physicalSmallBigPathPositiveWeight, abs_of_nonneg hw] unfold physicalSmallBigPathEventWeight physicalSmallBigPathEventTarget physicalSmallBigPositiveWeight physicalSmallBigFullWeight physicalSmallBigTarget physicalSmallBigFullTarget fullActiveEdgeEventWeight fullActiveEdgeEventTarget dsimp only split_ifs <;> push_cast <;> ring end Bounty end section /- The permutation event in the mixed path is exactly the independent small and big active-slot average. Its original multiplicity is retained. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Signed mixed paths with a separate ghost birth parameter. This permits the doubled-ghost comparison while keeping every edge weight unchanged. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G : Type} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : K → Type) (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k, Fintype (A k)] end end Bounty end section /- Exact ghost-birth counts and memory growth for paths with moving small states. -/ open Finset Classical namespace Bounty section variable {H K S G : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : K → Type) (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) end end Bounty end section /- Exact moving-small-state transport between big-memory caps. -/ open Finset Classical namespace Bounty section variable {H K S G : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (A : K → Type) (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) {b B : ℕ} (h : b ≤ B) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k, Fintype (A k)] end end Bounty end section /- Observable mixed event data agree across memory caps on nonzero support. The cap-free data retain both endpoints, auxiliary choices, actual fresh labels, and ghost birth tuples and retained indices. Terminal observables of small states, active labels and pending lengths include the vacuum boundary. -/ open Finset Classical namespace Bounty section variable {H K S G : Type} {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (A : K → Type) (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) variable [Fintype S] [Fintype G] (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) end section variable {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Type*} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : ∀ g, Finset (Fin (M g))) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) end end Bounty end section /- Exact real rational coordinates of the recovered determinant variables. -/ namespace Bounty noncomputable def typeIIRealE (y : TypeIIShiftIndex) : ℝ := ((y.2.2.1 : ℝ) - y.2.1.1) / (2 * (y.1.1 : ℝ)) noncomputable def typeIIRealN (y : TypeIIShiftIndex) : ℝ := ((y.2.2.1 : ℝ) - y.2.1.1) * y.1.2 / ((y.1.1 : ℝ) * y.2.1.1 * y.2.2.1) + 1 / (y.2.1.1 : ℝ) theorem typeII_real_coordinate_algebra {m m' e n h z k : ℝ} (hm : m ≠ 0) (hm' : m' ≠ 0) (hk : k ≠ 0) (hdet : m' - m = 2 * e * k) (heq : m * n = 2 * e * h + 1) (hz : z = m' * h) : e = (m' - m) / (2 * k) ∧ n = (m' - m) * z / (k * m * m') + 1 / m := by constructor · apply (eq_div_iff (mul_ne_zero (by norm_num) hk)).mpr linear_combination -hdet · rw [hdet, hz] field_simp linear_combination heq theorem typeII_normalized_e_log_coordinates (U E k t₁ t₂ : ℝ) : ((U * Real.exp t₂ - U * Real.exp t₁) / (2 * k)) / E = (U / (2 * k * E)) * (Real.exp t₂ - Real.exp t₁) := by ring theorem typeII_normalized_n_log_coordinates (U V Z k t₁ t₂ t₃ : ℝ) (hU : U ≠ 0) (hV : V ≠ 0) (hk : k ≠ 0) : (((U * Real.exp t₂ - U * Real.exp t₁) * (Z * Real.exp t₃) / (k * (U * Real.exp t₁) * (U * Real.exp t₂)) + 1 / (U * Real.exp t₁)) / V) = (Z / (k * U * V)) * (Real.exp (t₃ - t₁) - Real.exp (t₃ - t₂)) + (1 / (U * V)) * Real.exp (-t₁) := by rw [Real.exp_sub, Real.exp_sub, Real.exp_neg] field_simp end Bounty end section /- The actual active-slot Fourier phase separates into unit prime-slot twists. -/ open Finset MeasureTheory namespace Bounty noncomputable def activeAllocationFrequencyInput {N : ℕ} (active : Fin N → Bool) (s : Fin N → ℝ) (ξ : ActiveAllocationIndex active → ℝ) (i : Fin N) : ℝ := if hi : active i = true then 2 * Real.pi * ξ ⟨i, hi⟩ / s i else 0 theorem active_allocation_frequency_sum {N : ℕ} (R : ℝ) (v s : Fin N → ℝ) (active take : Fin N → Bool) (ξ : ActiveAllocationIndex active → ℝ) : (∑ i, activeAllocationFrequencyInput active s ξ i * (orderedSlotResidual R (fun j => if take j then 1 else 0) v i - v i)) = 2 * Real.pi * ∑ i : ActiveAllocationIndex active, ξ i * ((allocationPrefixResidual v R take i.val - v i.val) / s i.val) := by classical simp_rw [← allocation_prefix_eq_ordered_residual] calc _ = ∑ i ∈ univ.filter (fun i => active i = true), activeAllocationFrequencyInput active s ξ i * (allocationPrefixResidual v R take i - v i) := by rw [sum_filter] apply sum_congr rfl intro i hi by_cases ha : active i = true · simp [ha] · simp [activeAllocationFrequencyInput, ha] _ = ∑ i : ActiveAllocationIndex active, activeAllocationFrequencyInput active s ξ i.val * (allocationPrefixResidual v R take i.val - v i.val) := sum_subtype _ (by simp) _ _ = _ := by rw [mul_sum] apply sum_congr rfl intro i hi simp only [activeAllocationFrequencyInput, i.property, dite_true] ring theorem active_allocation_integrand_phase {N : ℕ} (A R : ℝ) (v s : Fin N → ℝ) (active take : Fin N → Bool) (ξ : ActiveAllocationIndex active → ℝ) : activeAllocationFourierIntegrand A R v s active take ξ = Complex.exp (Complex.I * ((2 * Real.pi * ∑ i : ActiveAllocationIndex active, ξ i * ((allocationPrefixResidual v R take i.val - v i.val) / s i.val) : ℝ) : ℂ)) * activeAllocationFourierWeight A active take ξ := by simp only [activeAllocationFourierIntegrand, activeAllocationFourierWeight, typeIICutoffFourierIntegrand, prod_mul_distrib] rw [← Complex.exp_sum] congr 2 simp only [mul_sum, Complex.ofReal_sum] apply sum_congr rfl intro i hi push_cast ring theorem active_allocation_prime_powers_separated {N : ℕ} (A R : ℝ) (p s : Fin N → ℝ) (hp : ∀ i, 0 < p i) (active take : Fin N → Bool) (ξ : ActiveAllocationIndex active → ℝ) : activeAllocationFourierIntegrand A R (fun i => Real.log (p i)) s active take ξ = (Complex.exp (Complex.I * ((R * ∑ i, activeAllocationFrequencyInput active s ξ i : ℝ) : ℂ)) * ∏ j, (p j : ℂ) ^ ((orderedSlotFrequency (fun i => if take i then 1 else 0) (activeAllocationFrequencyInput active s ξ) j : ℂ) * Complex.I)) * activeAllocationFourierWeight A active take ξ := by rw [active_allocation_integrand_phase, ← active_allocation_frequency_sum, ordered_slot_prime_power_separation R _ p _ hp] theorem active_allocation_inactive_frequency_zero {N : ℕ} (active take : Fin N → Bool) (s : Fin N → ℝ) (ξ : ActiveAllocationIndex active → ℝ) (i : Fin N) (ha : active i = false) (ht : take i = false) : orderedSlotFrequency (fun j => if take j then 1 else 0) (activeAllocationFrequencyInput active s ξ) i = 0 := by simp [orderedSlotFrequency, activeAllocationFrequencyInput, ha, ht] end Bounty end section /- Uniform cube truncation for the actual active-slot allocation integral. -/ open Finset MeasureTheory namespace Bounty noncomputable def activeAllocationBoxMeasure {N : ℕ} (active : Fin N → Bool) (R : ℝ) : Measure (ActiveAllocationIndex active → ℝ) := Measure.pi (fun _ : ActiveAllocationIndex active => volume.restrict {ξ : ℝ | ‖ξ‖ ≤ R}) theorem active_allocation_box_integrable {N : ℕ} (A E R : ℝ) (v s : Fin N → ℝ) (active take : Fin N → Bool) : Integrable (activeAllocationFourierIntegrand A E v s active take) (activeAllocationBoxMeasure active R) := Integrable.fintype_prod (fun i => (typeII_cutoff_fourier_integrand_integrable A _ (take i.val)).integrableOn) theorem active_allocation_box_factorization {N : ℕ} (A E R : ℝ) (v s : Fin N → ℝ) (active take : Fin N → Bool) : (∫ ξ : ActiveAllocationIndex active → ℝ, activeAllocationFourierIntegrand A E v s active take ξ ∂activeAllocationBoxMeasure active R) = ∏ i : ActiveAllocationIndex active, ∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ R}, typeIICutoffFourierIntegrand A (take i.val) ((allocationPrefixResidual v E take i.val - v i.val) / s i.val) ξ := integral_fintype_prod_eq_prod _ theorem active_allocation_truncation_le {N : ℕ} (A C D E : ℝ) (M : ℕ) (hC1 : 1 ≤ C) (hC : ∀ take : Bool, (∫ ξ : ℝ, ‖typeIICutoffFourier A take ξ‖) ≤ C) (hD : 0 ≤ D) (hdecay : ∀ take : Bool, ∀ R : ℝ, 1 ≤ R → ∀ t : ℝ, ‖(typeIISmoothCutoff A take t : ℂ) - ∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ R}, typeIICutoffFourierIntegrand A take t ξ‖ ≤ D * R ^ (-(M : ℝ))) (v s : Fin N → ℝ) (active take : Fin N → Bool) (hkeep : ∀ i, active i = false → take i = false) {R : ℝ} (hR : 1 ≤ R) : ‖(compactAllocationWeight A N v s active E take : ℂ) - ∫ ξ : ActiveAllocationIndex active → ℝ, activeAllocationFourierIntegrand A E v s active take ξ ∂activeAllocationBoxMeasure active R‖ ≤ N * D * C ^ (N - 1) * R ^ (-(M : ℝ)) := by rw [compact_allocation_active_product A E v s active take hkeep, Complex.ofReal_prod, active_allocation_box_factorization] have hC0 : 0 ≤ C := by linarith have hR0 : 0 ≤ R := by linarith have hbound := complex_finset_product_error (univ : Finset (ActiveAllocationIndex active)) (fun i => (typeIISmoothCutoff A (take i.val) ((allocationPrefixResidual v E take i.val - v i.val) / s i.val) : ℂ)) (fun i => ∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ R}, typeIICutoffFourierIntegrand A (take i.val) ((allocationPrefixResidual v E take i.val - v i.val) / s i.val) ξ) hC0 (mul_nonneg hD (Real.rpow_nonneg hR0 _)) (fun i _ => by have hb := typeII_smooth_cutoff_bounds A ((allocationPrefixResidual v E take i.val - v i.val) / s i.val) (take i.val) simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hb.1] using hb.2.trans hC1) (fun i _ => typeII_cutoff_fourier_truncated_norm_le A C R _ (take i.val) (hC _)) (fun i _ => hdecay (take i.val) R hR _) have hcard : Fintype.card (ActiveAllocationIndex active) ≤ N := by simpa only [Fintype.card_fin] using Fintype.card_subtype_le (fun i => active i = true) simp only [card_univ] at hbound apply hbound.trans calc _ ≤ (N : ℝ) * (D * R ^ (-(M : ℝ))) * C ^ (N - 1) := by apply mul_le_mul · exact mul_le_mul_of_nonneg_right (Nat.cast_le.mpr hcard) (mul_nonneg hD (Real.rpow_nonneg hR0 _)) · exact pow_le_pow_right₀ hC1 (Nat.sub_le_sub_right hcard 1) · positivity · positivity _ = _ := by ring theorem active_allocation_fourier_bounds (A : ℝ) : ∃ C : ℝ, 1 ≤ C ∧ (∀ (N : ℕ) (active take : Fin N → Bool), (∫ ξ : ActiveAllocationIndex active → ℝ, ‖activeAllocationFourierWeight A active take ξ‖) ≤ C ^ N) ∧ ∀ M : ℕ, ∃ D : ℝ, 0 < D ∧ ∀ (N : ℕ) (E : ℝ) (v s : Fin N → ℝ) (active take : Fin N → Bool), (∀ i, active i = false → take i = false) → ∀ R : ℝ, 1 ≤ R → ‖(compactAllocationWeight A N v s active E take : ℂ) - ∫ ξ : ActiveAllocationIndex active → ℝ, activeAllocationFourierIntegrand A E v s active take ξ ∂activeAllocationBoxMeasure active R‖ ≤ N * D * C ^ (N - 1) * R ^ (-(M : ℝ)) := by obtain ⟨C, hC1, hC⟩ := typeII_cutoff_fourier_l1_bound A refine ⟨C, hC1, fun N active take => active_allocation_fourier_l1_le A C hC1 hC active take, ?_⟩ intro M obtain ⟨D, hD, hdecay⟩ := typeII_cutoff_fourier_rapid_truncation A M exact ⟨D, hD, fun N E v s active take hkeep R hR => active_allocation_truncation_le A C D E M hC1 hC hD.le hdecay v s active take hkeep hR⟩ end Bounty end section /- The compact range mask is exact outside the actual large-P tail. -/ open Finset Filter Real namespace Bounty theorem exists_candidate_rough_slot_scale {c b : ℝ} (hb : 0 < b) : ∃ J : ℕ, ∀ j : ℕ, J < j → (6/5 : ℝ)*c/2^j ≤ b/4 := by have hpow : ∀ᶠ j : ℕ in atTop, 24*c/(5*b) ≤ (2 : ℝ)^j := (tendsto_pow_atTop_atTop_of_one_lt (by norm_num : (1 : ℝ)<2)).eventually (eventually_ge_atTop (24*c/(5*b))) obtain ⟨J,hJ⟩ := eventually_atTop.mp hpow refine ⟨J, fun j hj => ?_⟩ have hh := (div_le_iff₀ (by positivity : (0 : ℝ)<5*b)).mp (hJ j hj.le) apply (div_le_iff₀ (by positivity : (0 : ℝ)<2^j)).mpr nlinarith theorem eventually_candidate_compact_range_exact {c b : ℝ} (hc : 0 < c) (hb : 0 < b) {r : ℕ} (hr : 6 ≤ r) (jStar : ℕ) (hscale : (6/5 : ℝ)*c/2^jStar ≤ b/4) : ∀ᶠ L : ℝ in atTop, ∀ (E q : ℝ), 1 ≤ E → log E ≤ (1-b)*L → ∀ u ∈ arithmeticProductWindow 1 (exp L), (primePoolPart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u : ℝ) ≤ exp (b/4*L) → candidateCompactRangeCoefficient c L q r jStar E u = candidateCoefficient c L q r jStar u := by filter_upwards [eventually_candidate_good_tuple_compact_allocation hc hr, eventually_fixed_candidateQ_prefix hc jStar, eventually_gt_atTop (1 : ℝ)] with L hgood hjPrefix hL intro E q hE hlogE u hu hP have hL0 : 0 < L := zero_lt_one.trans hL have hj : jStar ∈ candidateQIndices c L := hjPrefix (mem_Icc.mpr ⟨Nat.zero_le _, le_rfl⟩) let P := primePoolPart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u have hsum : candidateCompactRangeQWeight c L r jStar E (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u) = candidateQWeight c L r jStar (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u) := by unfold candidateCompactRangeQWeight candidateQWeight orderedSlotWeight refine sum_congr ?_ ?_ · ext x; simp only [mem_univ] intro x hx split_ifs with hxprod · have hprod : P*orderedSlotProduct (candidateQSlotChoices c L r jStar) x = u := by rw [hxprod] exact primePoolPart_mul_primePoolFreePart _ _ have htotal : exp L ≤ (P*orderedSlotProduct (candidateQSlotChoices c L r jStar) x : ℕ) := by rw [hprod] have hh : exp L < (u : ℝ) := by simpa only [one_mul] using ((mem_arithmeticProductWindow_iff one_ne_zero (exp L)).mp hu).1 exact hh.le have hxlog := (candidate_Q_slot_log_bounds c L r jStar (candidateRoughSlot c L r jStar (by omega) hj) (x _).property).2 simp only [candidateRoughSlot] at hxlog have hxpos : (0 : ℝ) < (x (candidateRoughSlot c L r jStar (by omega) hj)).val := by exact_mod_cast Nat.pos_of_ne_zero (candidate_Q_slot_nonzero c L r jStar _ (x _).property) have hxsmall : ((x (candidateRoughSlot c L r jStar (by omega) hj)).val : ℝ) ≤ exp (b/4*L) := by apply (log_le_iff_le_exp hxpos).mp apply hxlog.trans convert mul_le_mul_of_nonneg_right hscale hL0.le using 1 <;> ring have hretained : (P*(x (candidateRoughSlot c L r jStar (by omega) hj)).val : ℕ) ≤ exp (b/2*L) := by calc _ = (P : ℝ)*((x (candidateRoughSlot c L r jStar (by omega) hj)).val : ℝ) := by norm_cast _ ≤ exp (b/4*L)*exp (b/4*L) := mul_le_mul hP hxsmall (Nat.cast_nonneg _) (exp_pos _).le _ = _ := by rw [← exp_add]; congr 1; ring have hunit := (hgood jStar P hj x E b hb.le hE htotal hretained hlogE).2 rw [candidate_range_allocation_mass_eq_one c L r jStar x E hunit] intro take ht exact candidate_allocation_good_tuple_range hc hL0 (log_pos hL) hb.le hE hr hj x htotal hretained hlogE take (lt_of_lt_of_le ht (candidate_compact_allocation_bounds c L r jStar x (log E) take).2) · rfl unfold candidateCompactRangeCoefficient candidateCoefficient rw [hsum] end Bounty end section /- Full local forest factors and the original initial-avoidance gate have norm at most one. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (residual : ∀ (tag : Option (J ⊕ K)) s, FullPermutationMixedEvent n S B A Δ D tag s → ℂ) (initial : (g : Fin N) → Finset (P g)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) (θ : (Fin (Fintype.card (FullMixedBirthAddress S B steps)) × Fin (Fintype.card (FullMixedBirthAddress S B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) end Full end Bounty end section /- Uniform errors preserve the full labelled-slot normalization. -/ open Finset namespace Bounty theorem ordered_slot_complex_error_bound {I : Type*} [Fintype I] [DecidableEq I] (choices : I → Finset ℕ) {Z : ℝ} (hZ : 0 < Z) (n : ℕ) (f g : (∀ i, choices i) → ℂ) {err : ℝ} (hfg : ∀ x, ‖f x-g x‖ ≤ err) : ‖(∑ x : ∀ i, choices i, if orderedSlotProduct choices x=n then f x/(Z : ℂ) else 0) - ∑ x : ∀ i, choices i, if orderedSlotProduct choices x=n then g x/(Z : ℂ) else 0‖ ≤ err*orderedSlotWeight choices Z n := by classical have sum_compare (s t : Finset (∀ i, choices i)) (a b : (∀ i, choices i) → ℝ) (hst : s=t) (hab : ∀ x ∈ s, a x ≤ b x) : (∑ x ∈ s, a x) ≤ ∑ x ∈ t, b x := by rw [← hst] exact sum_le_sum hab rw [← sum_sub_distrib] apply (norm_sum_le _ _).trans unfold orderedSlotWeight rw [mul_sum] apply sum_compare · ext x; simp only [mem_univ] intro x hx by_cases h : orderedSlotProduct choices x=n · simp only [h, if_true, ← sub_div, norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hZ] simpa only [mul_one_div] using div_le_div_of_nonneg_right (hfg x) hZ.le · simp only [h, if_false, sub_self, norm_zero, mul_zero, le_refl] end Bounty end section /- Replace the original sharp candidate sum by an actual finite-frequency Mellin integral. -/ open Finset Filter MeasureTheory Real namespace Bounty end Bounty end section /- Reciprocal square mass has an exponential saving over harmonic prime mass. -/ open Finset Filter namespace Bounty theorem finite_reciprocal_square_sum_le (P : Finset ℕ) {M : ℝ} (hM : 0 < M) (hP : ∀ p ∈ P, M ≤ (p : ℝ)) : (∑ p ∈ P, 1 / (p : ℝ) ^ 2) ≤ (1 / M) * ∑ p ∈ P, 1 / (p : ℝ) := by rw [mul_sum] apply sum_le_sum intro p hp calc 1 / (p : ℝ) ^ 2 = (1 / (p : ℝ)) * (1 / (p : ℝ)) := by ring _ ≤ (1 / M) * (1 / (p : ℝ)) := mul_le_mul_of_nonneg_right (one_div_le_one_div_of_le hM (hP p hp)) (by positivity) theorem eventually_weighted_reciprocal_squares_le {a : ℝ} (ha : 0 < a) (C D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (P : Finset ℕ) (H : ℝ), 0 ≤ H → H * (∑ p ∈ P, 1 / (p : ℝ)) ≤ L ^ C → (∀ p ∈ P, Real.exp (L ^ a) ≤ (p : ℝ)) → H * (∑ p ∈ P, 1 / (p : ℝ) ^ 2) ≤ L ^ (-D) := by filter_upwards [eventually_rpow_mul_exp_neg_rpow_le ha C D] with L hL intro P H hH hmass hP calc _ ≤ H * ((1 / Real.exp (L ^ a)) * ∑ p ∈ P, 1 / (p : ℝ)) := mul_le_mul_of_nonneg_left (finite_reciprocal_square_sum_le P (Real.exp_pos _) hP) hH _ = (H * (∑ p ∈ P, 1 / (p : ℝ))) * Real.exp (-(L ^ a)) := by rw [Real.exp_neg]; ring _ ≤ L ^ C * Real.exp (-(L ^ a)) := mul_le_mul_of_nonneg_right hmass (Real.exp_pos _).le _ ≤ _ := hL end Bounty end section open MeasureTheory namespace Bounty end Bounty end section /- Seeded chronological history agrees exactly with all original common birth labels already owned by the past. -/ open Classical namespace Bounty section History variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedCommonPathHistory (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (t : ℕ) (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : Option (Sigma P) := if (fullMixedCommonIndexStage M B steps i).val ≤ t then fullMixedCommonBirthLabel n S B A Δ D steps s p (fullMixedCommonBirthOrder M B steps i) else history i theorem full_mixed_common_path_history_zero (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : fullMixedCommonPathHistory n S B A Δ D steps s p history 0 = fullMixedCommonHistorySeed n B steps s history := by funext i obtain ⟨a, rfl⟩ := (fullMixedCommonBirthOrder M B steps).symm.surjective i cases a <;> simp [fullMixedCommonPathHistory, fullMixedCommonHistorySeed, fullMixedCommonIndexStage, full_mixed_common_initial_label] theorem full_mixed_common_path_history_write (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (u : Fin steps.length) : fullMixedCommonHistoryWrite n S B A Δ D steps u (fullMixedOwnerOccurrence n S B A Δ D steps s p u).1 (fullMixedOwnerOccurrence n S B A Δ D steps s p u).2 (fullMixedCommonPathHistory n S B A Δ D steps s p history u.val) = fullMixedCommonPathHistory n S B A Δ D steps s p history (u.val + 1) := by funext i obtain ⟨a, rfl⟩ := (fullMixedCommonBirthOrder M B steps).symm.surjective i cases a with | inl a => simp [fullMixedCommonHistoryWrite, fullMixedCommonAddressWrite, fullMixedCommonPathHistory, fullMixedCommonIndexStage] | inr a => rcases a with ⟨v, a⟩ by_cases hv : v = u · subst v rw [full_mixed_common_history_write_here] simp only [fullMixedCommonPathHistory, fullMixedCommonIndexStage, Equiv.apply_symm_apply, Fin.val_succ, le_refl, if_true, full_mixed_common_new_label] exact (full_mixed_common_path_label_occurrence n S B A Δ D steps s p u a).symm · rw [full_mixed_common_history_write_other n S B A Δ D steps u _ _ _ _ (by simpa only [Equiv.apply_symm_apply, fullMixedCommonOwner, ne_eq, Option.some.injEq] using hv)] simp only [fullMixedCommonPathHistory, fullMixedCommonIndexStage, Equiv.apply_symm_apply, Fin.val_succ] have hval : v.val ≠ u.val := fun h => hv (Fin.ext h) by_cases h : v.val + 1 ≤ u.val · have h' : v.val + 1 ≤ u.val + 1 := by omega simp only [if_pos h, if_pos h'] · have h' : ¬v.val + 1 ≤ u.val + 1 := by omega simp only [if_neg h, if_neg h'] end History end Bounty end section /- A uniform first-derivative kernel estimate including zero frequency. -/ open Finset namespace Bounty theorem logarithmic_low_frequency_kernel (a b : ℕ) (U t : ℝ) (hU : 1 ≤ U) (ha : U ≤ (a : ℝ)) (hab : a ≤ b) (hb : (b : ℝ) ≤ 2*U) (htmax : |t| ≤ U) : ‖∑ n ∈ Icc a b, Complex.exp ((t*Real.log (n : ℝ) : ℝ)*Complex.I)‖ ≤ 24*Real.pi*U/(1+|t|) := by have hUp : 0 < U := lt_of_lt_of_le (by norm_num) hU have hden : 0 < 1+|t| := by positivity by_cases hsmall : |t| ≤ 1 · exact (norm_nat_log_phase_small a b U t hU ha hb hsmall).trans (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right (by nlinarith [Real.pi_gt_three] : (4 : ℝ) ≤ 24*Real.pi) hUp.le) hden.le) · have ht1 : 1 < |t| := lt_of_not_ge hsmall have htp : 0 < |t| := lt_trans (by norm_num) ht1 have htne : t ≠ 0 := abs_pos.mp htp calc _ ≤ 12*Real.pi*U/|t| := nat_logarithmic_first_derivative a b U t hU ha hab hb htne htmax _ ≤ 24*Real.pi*U/(1+|t|) := by apply (div_le_div_iff₀ htp hden).mpr have hh := mul_le_mul_of_nonneg_left (show 1+|t| ≤ 2*|t| by linarith) (show 0 ≤ 12*Real.pi*U by positivity) nlinarith end Bounty end section /- Actual logarithmic phase cancellation in each derivative-order frequency band. -/ open Finset namespace Bounty theorem exists_affine_logarithmic_derivative_band_bound (k : ℕ) (C : ℝ) (hk : 2 ≤ k) (hC : 1 ≤ C) : ∃ D : ℝ, 0 < D ∧ ∀ (N ε q c u : ℝ) (a b : ℤ), 1 ≤ N → 0 ≤ ε → ε ≤ 1 → (k : ℝ)^2 ≤ N → 2 ≤ N^(ε/(2*(k : ℝ))) → 0 < q → N^((k : ℝ)-2+ε) ≤ |u| → |u| ≤ N^((k : ℝ)-ε) → N ≤ (a : ℝ)+c/q → (b : ℝ)+1+c/q ≤ C*N → ‖∑ n ∈ Icc a b, Complex.exp (((u*Real.log (q*(n : ℝ)+c) : ℝ) : ℂ)*Complex.I)‖ ≤ D*N*N^(-(ε/((k : ℝ)*(2:ℝ)^(k-1)))) := by obtain ⟨T0,hT0,hterm⟩ := exists_mixed_terminal_power_saving k (C+5) hk (by linarith) let R := max 4 T0 have hR : 4 ≤ R := le_max_left _ _ have hRp : 0 < R := by linarith have hCp : 0 < C := by linarith refine ⟨(C+2)*5^(k-2)*R,by positivity,?_⟩ intro N ε q c u a b hN hε hε1 hkN hpow hq hu0 hu1 ha hb let A := logarithmicAmbientLeft N (c/q) let B := logarithmicAmbientRight N C (c/q) let M : ℝ := ((B-A+1 : ℤ) : ℝ) let H : ℤ := (Nat.floor (N^(ε/(2*(k : ℝ)))) : ℤ) let T := T0*N^(-ε/4) have hAB : A ≤ B := logarithmic_ambient_order N C (c/q) have hM : N ≤ M ∧ M ≤ (C+2)*N := logarithmic_ambient_length_bounds N C (c/q) hN hC have hMp : 0 < M := by linarith have hH := logarithmic_floor_shift_bounds N ε k hN hε1 hk hpow have hHN : H ≤ B-A+1 := by have hh : (H : ℝ) ≤ M := by exact hH.2.trans hM.1 dsimp only [M] at hh exact_mod_cast hh have hT : 0 ≤ T := by dsimp [T]; positivity have hterminal : ∀ hs : List ℤ, hs.length = k-2 → (∀ h ∈ hs, 1 ≤ h ∧ h < H) → ∀ l r : ℤ, A ≤ l → r ≤ B → ‖∑ n ∈ Icc l r, Complex.exp ((mixedForwardDifference (hs.map (fun h : ℤ => (h : ℝ))) (fun y => u*Real.log (q*y+c)) (n : ℝ) : ℂ)*Complex.I)‖ ≤ M*T := by intro hs hlen hshifts l r hl hr by_cases hlr : l ≤ r · have hmap : ∀ h ∈ hs.map (fun h : ℤ => (h : ℝ)), 1 ≤ h ∧ h ≤ (Nat.floor (N^(ε/(2*(k : ℝ)))) : ℝ) := by intro h hh obtain ⟨z,hz,rfl⟩ := List.mem_map.mp hh have hz' := hshifts z hz dsimp only [H] at hz' constructor · exact_mod_cast hz'.1 · exact_mod_cast hz'.2.le have hsum := logarithmic_shift_sum_le_scale N ε k hs hN hε1 hk hkN hlen (fun h hh => (hshifts h hh).2.le) have hbox : ∀ x ∈ Set.Icc (l : ℝ) ((r : ℝ)+1), N ≤ x+c/q ∧ x+c/q+(hs.map (fun h : ℤ => (h : ℝ))).sum ≤ (C+5)*N := by intro x hx have hlR : (A : ℝ) ≤ (l : ℝ) := by exact_mod_cast hl have hrR : (r : ℝ) ≤ (B : ℝ) := by exact_mod_cast hr exact logarithmic_ambient_box N C (c/q) _ x hN hC hsum ⟨hlR.trans hx.1,by linarith [hx.2]⟩ have ht := hterm N ε (hs.map (fun h : ℤ => (h : ℝ))) q c u l r hN hε (by simpa only [List.length_map] using hlen) hmap hu0 hu1 hq hlr hbox calc _ ≤ T0*N*N^(-ε/4) := ht _ = N*T := by dsimp [T]; ring _ ≤ M*T := mul_le_mul_of_nonneg_right hM.1 hT · rw [Icc_eq_empty_of_lt (lt_of_not_ge hlr),sum_empty,norm_zero] exact mul_nonneg hMp.le hT obtain ⟨haA,hbB⟩ := logarithmic_ambient_interval_contains N C (c/q) a b hN hC ha hb have hi := integer_phase_iterated_van_der_corput A B H (k-2) T (fun y => u*Real.log (q*y+c)) hAB hH.1 hHN hT hterminal a b haA hbB have hTR : T ≤ R*N^(-(ε/4)) := by dsimp [T] rw [show -ε/4 = -(ε/4) by ring] have htR : T0 ≤ R := le_max_right _ _ exact mul_le_mul_of_nonneg_right htR (by positivity) have hs := derivative_order_scalar_power_saving T R N ε k hN (by by_contra he; have he0 : ε = 0 := le_antisymm (le_of_not_gt he) hε simp only [he0,zero_div,Real.rpow_zero] at hpow; linarith) hk hR hpow hTR rw [derivative_decay_exponent_eq ε k hk] at hs have hs' : vanDerCorputScalarBound (H : ℝ) T (k-2) ≤ 5^(k-2)*R*N^(-(ε/((k : ℝ)*(2:ℝ)^(k-1)))) := by simpa only [H,Int.cast_natCast] using hs calc _ ≤ M*vanDerCorputScalarBound (H : ℝ) T (k-2) := hi _ ≤ M*(5^(k-2)*R*N^(-(ε/((k : ℝ)*(2:ℝ)^(k-1))))) := mul_le_mul_of_nonneg_left hs' hMp.le _ ≤ ((C+2)*N)*(5^(k-2)*R*N^(-(ε/((k : ℝ)*(2:ℝ)^(k-1))))) := mul_le_mul_of_nonneg_right hM.2 (by positivity) _ = _ := by ring end Bounty end section /- The actual exceptional interval count absorbs the square-root sparse-kernel error for a residual dyad of size at least Y^(3/5). -/ open Filter namespace Bounty theorem prime_exceptional_time_span_le {R Y : ℝ} (hR : 0 ≤ R) (hRY : R ≤ Y) (hY : 2 ≤ Y) : ((2 * ⌈R⌉₊ + 2 : ℕ) : ℝ) ≤ 4 * Y := by push_cast have hc := Nat.ceil_lt_add_one hR linarith theorem sparse_cardinality_square_root_absorption {C Y U : ℝ} {N : ℕ} (hY : 0 < Y) (_hC : 0 ≤ C) (hcard : C ≤ Y ^ (1 / 20 : ℝ)) (hN : (N : ℝ) ≤ 4 * Y) (hconstant : 432 ≤ Y ^ (1 / 20 : ℝ)) (hU : Y ^ (3 / 5 : ℝ) ≤ U) : C * (216 * Real.sqrt N) ≤ U := by have hsqrt : Real.sqrt N ≤ 2 * Real.sqrt Y := by calc _ ≤ Real.sqrt (4 * Y) := Real.sqrt_le_sqrt hN _ = 2 * Real.sqrt Y := by rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 4)]; norm_num calc C * (216 * Real.sqrt N) ≤ Y ^ (1 / 20 : ℝ) * (216 * (2 * Real.sqrt Y)) := mul_le_mul hcard (mul_le_mul_of_nonneg_left hsqrt (by norm_num)) (by positivity) (Real.rpow_nonneg hY.le _) _ = 432 * (Y ^ (1 / 20 : ℝ) * Y ^ (1 / 2 : ℝ)) := by rw [Real.sqrt_eq_rpow]; ring _ ≤ Y ^ (1 / 20 : ℝ) * (Y ^ (1 / 20 : ℝ) * Y ^ (1 / 2 : ℝ)) := mul_le_mul_of_nonneg_right hconstant (by positivity) _ = Y ^ (3 / 5 : ℝ) := by rw [← Real.rpow_add hY, ← Real.rpow_add hY]; norm_num _ ≤ U := hU theorem eventually_constant_le_rpow_of_log_lower {d ε K : ℝ} (hd : 0 < d) (hε : 0 < ε) (hK : 0 < K) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, 0 < Y → d * L ≤ Real.log Y → K ≤ Y ^ ε := by filter_upwards [eventually_ge_atTop (Real.log K / (ε * d))] with L hL intro Y hY hlog have hscale : Real.log K ≤ (ε * d) * L := by have hh := (div_le_iff₀ (mul_pos hε hd)).mp hL nlinarith only [hh] calc K = Real.exp (Real.log K) := (Real.exp_log hK).symm _ ≤ Real.exp (Real.log Y * ε) := Real.exp_le_exp.mpr (by have hh := mul_le_mul_of_nonneg_left hlog hε.le nlinarith only [hscale, hh]) _ = Y ^ ε := (Real.rpow_def_of_pos hY _).symm theorem eventually_prime_exceptional_sparse_absorption {a beta c A B d : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hA : 0 ≤ A) (hB : 1 ≤ B) (hd : 0 < d) : ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R U : ℝ), 1 ≤ Y → d * L ≤ Real.log Y → Real.log Y ≤ c * L → Real.exp (L ^ a) / 2 ≤ P → P ≤ Real.exp (L ^ beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) → (∀ p : s, ‖coeff p‖ ≤ B) → Y ^ (3 / 5 : ℝ) ≤ U → ((primeExceptionalIntervals s coeff (L ^ (-A)) R).card : ℝ) * (216 * Real.sqrt (2 * ⌈R⌉₊ + 2 : ℕ)) ≤ U := by filter_upwards [eventually_prime_exceptional_bounded_coefficients_subpower ha ha1 hbeta hc hA hB hd (by norm_num : (0 : ℝ) < 1 / 20), eventually_constant_le_rpow_of_log_lower hd (by norm_num : (0 : ℝ) < 1 / 20) (by norm_num : (0 : ℝ) < 432), eventually_constant_le_rpow_of_log_lower hd zero_lt_one (by norm_num : (0 : ℝ) < 2)] with L hcount hconstant htwo intro s hs coeff Y P R U hY hlo hhi hPlo hPhi hR hRY hband hcoeff hU have hY0 : 0 < Y := zero_lt_one.trans_le hY have hY2 : 2 ≤ Y := by simpa only [Real.rpow_one] using htwo Y hY0 hlo exact sparse_cardinality_square_root_absorption hY0 (Nat.cast_nonneg _) (hcount s hs coeff Y P R hY hlo hhi hPlo hPhi hR hRY hband hcoeff) (prime_exceptional_time_span_le hR hRY hY2) (hconstant Y hY0 hlo) hU end Bounty end section /- A literal product of four finite polynomials has explicit supported dyadic coefficients. -/ open Finset namespace Bounty end Bounty end section /- The shorter actual coefficient convolutions inherit the audited fourth-moment budget. -/ open Finset Filter namespace Bounty theorem eventually_pair_convolution_reciprocal_power_energy {c E : ℝ} (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ (β γ : ℕ → ℂ) (B C U : ℝ), 0 ≤ B → 0 ≤ C → 1 ≤ U → Real.log U ≤ c*L → B*C ≤ L^E → (∀ n, ‖β n‖ ≤ B) → (∀ n, ‖γ n‖ ≤ C) → ∀ S : Finset ℕ, (∀ n ∈ S, U ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*U) → (∑ n ∈ S, ‖(∑ d ∈ n.divisors, β d*γ (n/d))/(n : ℂ)‖^2) ≤ L^(2*E+16)/U := by filter_upwards [eventually_four_convolution_reciprocal_power_energy (E := E) hc] with L hL intro β γ B C U hB hC hU hlog hprod hβ hγ S hS let e : ℕ → ℂ := fun n => if n = 1 then 1 else 0 have he : ∀ n, ‖e n‖ ≤ 1 := by intro n; dsimp [e]; split_ifs <;> norm_num have hh := hL e e β γ 1 1 B C U zero_le_one zero_le_one hB hC hU hlog (by simpa only [one_mul] using hprod) he he hβ hγ S hS have heq : (∑ n ∈ S, ‖endpointFourConvolution e e β γ n/(n : ℂ)‖^2) = ∑ n ∈ S, ‖(∑ d ∈ n.divisors, β d*γ (n/d))/(n : ℂ)‖^2 := by apply sum_congr rfl intro n hn have hn0 : n ≠ 0 := (Nat.cast_pos.mp ((zero_lt_one.trans_le hU).trans_le (hS n hn).1)).ne' rw [endpoint_four_unit_left e β γ hn0,endpoint_triple_unit_left β γ hn0] rw [heq] at hh exact hh theorem eventually_triple_convolution_reciprocal_power_energy {c E : ℝ} (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ (α β γ : ℕ → ℂ) (A B C U : ℝ), 0 ≤ A → 0 ≤ B → 0 ≤ C → 1 ≤ U → Real.log U ≤ c*L → A*B*C ≤ L^E → (∀ n, ‖α n‖ ≤ A) → (∀ n, ‖β n‖ ≤ B) → (∀ n, ‖γ n‖ ≤ C) → ∀ S : Finset ℕ, (∀ n ∈ S, U ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*U) → (∑ n ∈ S, ‖endpointTripleConvolution α β γ n/(n : ℂ)‖^2) ≤ L^(2*E+16)/U := by filter_upwards [eventually_four_convolution_reciprocal_power_energy (E := E) hc] with L hL intro α β γ A B C U hA hB hC hU hlog hprod hα hβ hγ S hS let e : ℕ → ℂ := fun n => if n = 1 then 1 else 0 have he : ∀ n, ‖e n‖ ≤ 1 := by intro n; dsimp [e]; split_ifs <;> norm_num have hh := hL e α β γ 1 A B C U zero_le_one hA hB hC hU hlog (by simpa only [one_mul] using hprod) he hα hβ hγ S hS have heq : (∑ n ∈ S, ‖endpointFourConvolution e α β γ n/(n : ℂ)‖^2) = ∑ n ∈ S, ‖endpointTripleConvolution α β γ n/(n : ℂ)‖^2 := by apply sum_congr rfl intro n hn have hn0 : n ≠ 0 := (Nat.cast_pos.mp ((zero_lt_one.trans_le hU).trans_le (hS n hn).1)).ne' rw [endpoint_four_unit_left α β γ hn0] rw [heq] at hh exact hh theorem finite_masked_energy_le (S T : Finset ℕ) (f : ℕ → ℂ) : (∑ n ∈ S, ‖if n ∈ T then f n else 0‖^2) ≤ ∑ n ∈ S, ‖f n‖^2 := by apply sum_le_sum intro n _ split_ifs <;> simp only [norm_zero,zero_pow (by omega : 2 ≠ 0),le_refl] exact sq_nonneg _ end Bounty end section /- The exact common ghost multiplier is an ordered-newborn observable. Its phase never reads retained memory labels or retention indices. -/ open Finset Classical namespace Bounty section Ghost variable {I K S : Type*} {N J ell B : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) (M : Fin N → ℕ) (steps : List (Option (I ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) (i : Fin steps.length) (tag : I) (hi : steps.get i = some (.inl tag)) end Ghost end Bounty end section /- Reindex the full compatible endpoint sum without changing its coefficient or guards. -/ open Finset open scoped Classical namespace Bounty theorem physical_compatible_pair_sum_eq_cut_sum {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (F : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → ℂ) : (∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then F L R else 0) = ∑ d : PhysicalJointCutData P C ell, F (physicalCutGlue C d.1 d.2.1) (physicalCutGlue C d.1 d.2.2) := by let f : PhysicalMarkLists P J ell × PhysicalMarkLists P J ell → ℂ := fun x => F x.1 x.2 have hs : (∑ x : PhysicalCompatibleMarkPair P C ell, f x.val) = ∑ x : PhysicalMarkLists P J ell × PhysicalMarkLists P J ell, if physicalSharedCompatible C x.1 x.2 then f x else 0 := by rw [← sum_filter] exact (sum_subtype _ (by simp) f).symm have he := (physicalCutPairEquiv P C ell).symm.sum_comp (fun x : PhysicalCompatibleMarkPair P C ell => f x.val) rw [Fintype.sum_prod_type] at hs calc _ = ∑ x : PhysicalCompatibleMarkPair P C ell, f x.val := hs.symm _ = ∑ d : PhysicalJointCutData P C ell, f ((physicalCutPairEquiv P C ell).symm d).val := he.symm _ = _ := by apply sum_congr rfl intro d _ simp only [f, physical_cut_pair_inverse_left, physical_cut_pair_inverse_right] theorem physical_joint_normalized_sum_eq_shared_draw_sum {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (V : G → ℝ) (F : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → ℂ) : (∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then ((physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * F L R else 0) = ∑ d : PhysicalJointCutData P C ell, ((physicalAuxMass V (fun g => univ \ C g) (fun g j => d.1 g j) * physicalCompletionMass V C ell ^ 2 : ℝ) : ℂ) * F (physicalCutGlue C d.1 d.2.1) (physicalCutGlue C d.1 d.2.2) := by rw [physical_compatible_pair_sum_eq_cut_sum] apply sum_congr rfl intro d _ rw [physical_shared_joint_normalization] have haux : physicalSharedAux C (physicalCutGlue C d.1 d.2.1) = fun g j => d.1 g j := by simpa only [physical_cut_pair_inverse_left] using physical_cut_pair_inverse_shared_aux C d rw [haux] end Bounty end section /- Independent raw shared draws, with all original injectivity and disjointness guards. -/ open Finset open scoped Classical namespace Bounty def physicalRawCutGood {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (u v : GroupMarkedLists P (fun g => ell + (C g).card)) (s : PhysicalAuxLabels P (fun g => univ \ C g)) : Prop := (∀ g, Function.Injective (s g)) ∧ ∀ g, Disjoint (Set.range (s g)) (Set.range (u g)) ∧ Disjoint (Set.range (s g)) (Set.range (v g)) abbrev PhysicalRawCutData {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) := {x : (GroupMarkedLists P (fun g => ell + (C g).card) × GroupMarkedLists P (fun g => ell + (C g).card)) × PhysicalAuxLabels P (fun g => univ \ C g) // physicalRawCutGood C x.1.1 x.1.2 x.2} noncomputable def physicalCutRawEquiv {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) : PhysicalJointCutData P C ell ≃ PhysicalRawCutData P C ell where toFun d := ⟨((d.2.1.val,d.2.2.val),fun g j => d.1 g j), (fun g => (d.1 g).injective), fun g => ⟨d.2.1.property g,d.2.2.property g⟩⟩ invFun x := ⟨(fun g => ⟨x.val.2 g,x.property.1 g⟩), ⟨x.val.1.1,fun g => (x.property.2 g).1⟩, ⟨x.val.1.2,fun g => (x.property.2 g).2⟩⟩ left_inv d := by rcases d with ⟨s, ⟨u, hu⟩, ⟨v, hv⟩⟩ rfl right_inv x := by rcases x with ⟨⟨⟨u,v⟩,s⟩,h⟩ rfl theorem physical_joint_cut_sum_eq_raw_sum {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (F : GroupMarkedLists P (fun g => ell + (C g).card) → GroupMarkedLists P (fun g => ell + (C g).card) → PhysicalAuxLabels P (fun g => univ \ C g) → ℂ) : (∑ d : PhysicalJointCutData P C ell, F d.2.1.val d.2.2.val (fun g j => d.1 g j)) = ∑ u : GroupMarkedLists P (fun g => ell + (C g).card), ∑ v : GroupMarkedLists P (fun g => ell + (C g).card), ∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if physicalRawCutGood C u v s then F u v s else 0 := by let f : (GroupMarkedLists P (fun g => ell + (C g).card) × GroupMarkedLists P (fun g => ell + (C g).card)) × PhysicalAuxLabels P (fun g => univ \ C g) → ℂ := fun x => F x.1.1 x.1.2 x.2 have hs : (∑ x : PhysicalRawCutData P C ell, f x.val) = ∑ x, if physicalRawCutGood C x.1.1 x.1.2 x.2 then f x else 0 := by rw [← sum_filter] exact (sum_subtype _ (by simp) f).symm have he := (physicalCutRawEquiv P C ell).sum_comp (fun x : PhysicalRawCutData P C ell => f x.val) rw [Fintype.sum_prod_type] at hs rw [Fintype.sum_prod_type] at hs calc _ = ∑ x : PhysicalRawCutData P C ell, f x.val := he _ = _ := hs end Bounty end section /- Shared-factor reindexing with both original cutoff guards retained. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalQuotientPositions {G : Type*} [Fintype G] (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) (positions : Finset ℤ) : Finset ℤ := univ.biUnion (fun L : PhysicalMarkLists P J ell => positions.image (fun n => n / physicalSharedFactor C L)) theorem physical_mem_quotient_positions {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (positions : Finset ℤ) (L : PhysicalMarkLists P J ell) {n : ℤ} (hn : n ∈ positions) : n / physicalSharedFactor C L ∈ physicalQuotientPositions P C ell positions := by exact mem_biUnion.mpr ⟨L, mem_univ _, mem_image.mpr ⟨n, hn, rfl⟩⟩ theorem physical_fixed_root_reindex_guarded {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (C : G → Finset (Fin J)) (q ζ : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (positions W : Finset ℤ) (hW : ∀ L : PhysicalMarkLists P J ell, ∀ n ∈ positions, n / physicalSharedFactor C L ∈ W) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) : physicalFixedRootCorrelation V C q ζ k K aux positions f g Ψ Z = (physicalStateMass V J ell : ℂ) * ∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, ∑ w ∈ W, if (physicalSharedFactor C L : ℤ) * w ∈ positions ∧ (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) ∈ positions then physicalRootPositionTerm V C q ζ k K aux f g Ψ Z L R ((physicalSharedFactor C L : ℤ) * w) else 0 := by rw [physical_fixed_root_all_lists] congr 1 apply sum_congr rfl intro L _ apply sum_congr rfl intro R _ have hs : (physicalSharedFactor C L : ℤ) ≠ 0 := by exact_mod_cast (physical_shared_factor_pos C L hprime).ne' rw [integer_guarded_position_sum hs positions W (fun n => if n + k * (physicalD C L aux : ℕ) ∈ positions then physicalRootPositionTerm V C q ζ k K aux f g Ψ Z L R n else 0)] · apply sum_congr rfl intro w _ have he : (physicalSharedFactor C L : ℤ) * w + k * (physicalD C L aux : ℕ) = (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) := by rw [physical_D_shared_free, Nat.cast_mul] ring rw [he] split_ifs <;> simp_all · intro n _ hn have hL : ¬ ∀ g s, ((L g s).val : ℤ) ∣ n := fun hm => hn (physical_shared_factor_dvd C L n hdis hprime hm) simp only [physicalRootPositionTerm, physicalVertexWeight, if_neg hL, zero_mul, Complex.ofReal_zero, mul_zero, ite_self] · intro n hn _ _ exact hW L n hn end Bounty end section /- The literal selected marked endpoint and its peeled four-factor replacement. -/ open Finset open scoped Classical namespace Bounty noncomputable def selectedMarkedEndpoint {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (big : Finset G) (b : GroupMarkedLists (fun h : big => P h.val) (fun h : big => t h.val) → ℂ) (Q : Finset ℕ) (α β γ : ℕ → ℂ) (n : ℕ) : ℂ := (markedDivisorWeight univ P q V t (n : ℤ) : ℂ) * groupMarkedAverage (fun h : big => P h.val) (fun h : big => t h.val) (n : ℤ) b * invariantTripleEndpoint Q α β γ n noncomputable def selectedPeeledEndpoint {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (g : G) (k : ℕ) (big : Finset G) (b : GroupMarkedLists (fun h : big => P h.val) (fun h : big => t h.val) → ℂ) (Q : Finset ℕ) (α β γ : ℕ → ℂ) (n : ℕ) : ℂ := endpointFourConvolution (fun p => if p ∈ P g then 1 / (V g : ℂ) else 0) α β (fun r => selectedMarkedWeight P Q q V (Function.update t g k) t big b (fun _ => 1) r * γ (primePoolFreePart Q r)) n section variable {G : Type*} [sharedInstance1 : Fintype G] (P : G → Finset ℕ) {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (V : G → ℝ) (t : G → ℕ) (T : ℕ) (hV : ∀ g, v ≤ V g) (ht : ∀ g, t g ≤ T) (big : Finset G) (b : GroupMarkedLists (fun h : big => P h.val) (fun h : big => t h.val) → ℂ) {H : ℝ} (hH : 0 ≤ H) (hb : ∀ l, ‖b l‖ ≤ H) (Q : Finset ℕ) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) include G sharedInstance1 P q v hq0 hq1 hv V t T hV ht big b H hH hb Q α β γ A B C hA hB hC hα hβ hγ theorem selected_marked_endpoint_energy (positions : Finset ℕ) (N : ℕ) (hN : ∀ n ∈ positions, n ≤ N) : (∑ n ∈ positions, ‖selectedMarkedEndpoint P q V t big b Q α β γ n‖ ^ 2) ≤ ((markedDivisorBound q v T) ^ Fintype.card G * H) ^ 2 * ((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) := by let M := (markedDivisorBound q v T) ^ Fintype.card G have hM : 0 ≤ M := pow_nonneg (zero_le_one.trans (one_le_markedDivisorBound q v T)) _ have hn (n : ℕ) : ‖selectedMarkedEndpoint P q V t big b Q α β γ n‖ ≤ (M*H) * ‖invariantTripleEndpoint Q α β γ n‖ := by have hW := marked_divisor_weight_nonneg univ P hq0 V t (fun g _ => hv.le.trans (hV g)) (n : ℤ) have hWb : markedDivisorWeight univ P q V t (n : ℤ) ≤ M := by simpa only [card_univ] using marked_divisor_weight_le_pow univ P hq0 hq1 hv V t T (fun g _ => hV g) (fun g _ => ht g) (n : ℤ) have havg := group_marked_average_norm_le (fun h : big => P h.val) (fun h : big => t h.val) (n : ℤ) b hH (fun l => hb l.val) unfold selectedMarkedEndpoint rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hW] exact mul_le_mul_of_nonneg_right (mul_le_mul hWb havg (norm_nonneg _) hM) (norm_nonneg _) have he := invariant_triple_endpoint_divisible_energy Q α β γ hA hB hC hα hβ hγ positions 1 N (by simp [Nat.mem_factoredNumbers]) (by intro n _; exact one_dvd n) hN simp only [Nat.cast_one, div_one] at he calc _ ≤ ∑ n ∈ positions, (M*H)^2 * ‖invariantTripleEndpoint Q α β γ n‖^2 := by apply sum_le_sum intro n _ simpa only [mul_pow] using pow_le_pow_left₀ (norm_nonneg _) (hn n) 2 _ = (M*H)^2 * ∑ n ∈ positions, ‖invariantTripleEndpoint Q α β γ n‖^2 := (mul_sum ..).symm _ ≤ _ := mul_le_mul_of_nonneg_left he (sq_nonneg _) theorem selected_shifted_endpoint_energy (S : Finset ℤ) (δ : ℤ) (N : ℕ) (hpos : ∀ n ∈ S, 0 < n+δ ∧ n+δ ≤ (N : ℤ)) : (∑ n ∈ S, ‖selectedMarkedEndpoint P q V t big b Q α β γ (n+δ).natAbs‖ ^ 2) ≤ ((markedDivisorBound q v T) ^ Fintype.card G * H) ^ 2 * ((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) := by rw [sum_shift_natAbs S δ (fun m => ‖selectedMarkedEndpoint P q V t big b Q α β γ m‖ ^ 2) (fun n hn => (hpos n hn).1.le)] exact selected_marked_endpoint_energy P hq0 hq1 hv V t T hV ht big b hH hb Q α β γ hA hB hC hα hβ hγ _ N (fun m hm => (shifted_natAbs_image_bounds S δ N hpos m hm).2) end theorem selected_shifted_peel_error_energy {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (V : G → ℝ) (t : G → ℕ) (T : ℕ) (hV : ∀ g, v ≤ V g) (ht : ∀ g, t g ≤ T) (hprime : ∀ g, ∀ p ∈ P g, p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (k : ℕ) (htg : t g = k + 1) (big : Finset G) (hsmall : g ∉ big) (b : GroupMarkedLists (fun h : big => P h.val) (fun h : big => t h.val) → ℂ) {H : ℝ} (hH : 0 ≤ H) (hb : ∀ l, ‖b l‖ ≤ H) (Q : Finset ℕ) (hQ : ∀ g, P g ⊆ Q) (α β γ : ℕ → ℂ) (hαfree : ∀ d, ¬ Disjoint d.primeFactors Q → α d = 0) (hβfree : ∀ d, ¬ Disjoint d.primeFactors Q → β d = 0) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (S : Finset ℤ) (δ : ℤ) (N : ℕ) (hpos : ∀ n ∈ S, 0 < n+δ ∧ n+δ ≤ (N : ℤ)) : (∑ n ∈ S, ‖selectedMarkedEndpoint P q V t big b Q α β γ (n+δ).natAbs - selectedPeeledEndpoint P q V t g k big b Q α β γ (n+δ).natAbs‖ ^ 2) ≤ H ^ 2 * (((markedDivisorBound q v T) ^ Fintype.card G * (1 + 2 * Real.log N / v)) ^ 2 * (((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∑ p ∈ P g, 1 / (p : ℝ) ^ 2)) := by rw [sum_shift_natAbs S δ (fun m => ‖selectedMarkedEndpoint P q V t big b Q α β γ m - selectedPeeledEndpoint P q V t g k big b Q α β γ m‖ ^ 2) (fun n hn => (hpos n hn).1.le)] exact selected_four_convolution_error_energy P hq0 hq1 hv V t T hV ht hprime hdis g k htg big hsmall b hH hb Q hQ α β γ hαfree hβfree hA hB hC hα hβ hγ _ N (shifted_natAbs_image_bounds S δ N hpos) end Bounty end section /- A genuine output cutoff can remove the output mask on each full box, while only boxes meeting its original support need be retained. -/ open Finset namespace Bounty theorem four_box_supported_sum (S D A B C : Finset ℕ) (δ α β γ F : ℕ → ℂ) (hF : ∀ n, n ∉ S → F n = 0) : (∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, if d*a*b*c ∈ S then δ d*α a*β b*γ c*F (d*a*b*c) else 0) = ∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, δ d*α a*β b*γ c*F (d*a*b*c) := by classical apply sum_congr rfl intro d _ apply sum_congr rfl intro a _ apply sum_congr rfl intro b _ apply sum_congr rfl intro c _ by_cases h : d*a*b*c ∈ S · rw [if_pos h] · rw [if_neg h, hF _ h, mul_zero] theorem four_box_outside_support_zero (S D A B C : Finset ℕ) (δ α β γ F : ℕ → ℂ) (hF : ∀ n, n ∉ S → F n = 0) (hbox : ¬∃ d ∈ D, ∃ a ∈ A, ∃ b ∈ B, ∃ c ∈ C, d*a*b*c ∈ S) : (∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, δ d*α a*β b*γ c*F (d*a*b*c)) = 0 := by apply sum_eq_zero intro d hd apply sum_eq_zero intro a ha apply sum_eq_zero intro b hb apply sum_eq_zero intro c hc rw [hF _ (fun h => hbox ⟨d,hd,a,ha,b,hb,c,hc,h⟩), mul_zero] theorem endpoint_four_supported_dyadic_boxes (S : Finset ℕ) (N : ℕ) (hS : ∀ n ∈ S, n ≤ N) (δ α β γ F : ℕ → ℂ) (hF : ∀ n, n ∉ S → F n = 0) : (∑ n ∈ S, endpointFourConvolution δ α β γ n*F n) = ∑ i ∈ dyadicNatIndices (Icc 1 N), ∑ j ∈ dyadicNatIndices (Icc 1 N), ∑ k ∈ dyadicNatIndices (Icc 1 N), ∑ l ∈ dyadicNatIndices (Icc 1 N), if ∃ d ∈ dyadicNatBucket (Icc 1 N) i, ∃ a ∈ dyadicNatBucket (Icc 1 N) j, ∃ b ∈ dyadicNatBucket (Icc 1 N) k, ∃ c ∈ dyadicNatBucket (Icc 1 N) l, d*a*b*c ∈ S then ∑ d ∈ dyadicNatBucket (Icc 1 N) i, ∑ a ∈ dyadicNatBucket (Icc 1 N) j, ∑ b ∈ dyadicNatBucket (Icc 1 N) k, ∑ c ∈ dyadicNatBucket (Icc 1 N) l, δ d*α a*β b*γ c*F (d*a*b*c) else 0 := by classical rw [endpoint_four_bounded_dyadic_transform S N hS] apply sum_congr rfl intro i _ apply sum_congr rfl intro j _ apply sum_congr rfl intro k _ apply sum_congr rfl intro l _ rw [four_box_supported_sum S _ _ _ _ δ α β γ F hF] split_ifs with h · rfl · exact four_box_outside_support_zero S _ _ _ _ δ α β γ F hF h end Bounty end section /- The local convolution estimate needs only positive coefficient support. -/ open Finset MeasureTheory namespace Bounty theorem exists_local_additive_mellin_interval_constants {j : ℕ} (hj : 2 ≤ j) : ∃ Cj Cerr : ℝ, 0 < Cj ∧ 0 < Cerr ∧ ∀ (S : Finset ℕ) (a : ℕ → ℂ), (∀ n ∈ S, 0 < n) → ∀ Y H : ℝ, 0 < Y → 1 ≤ H → H ≤ Y/8 → (4/H^2) * (∫ v in Set.Icc (Y/2) (3*Y), ‖localAdditiveConvolution S a H v‖^2) ≤ (Cj/Y) * (∫ t : ℝ, (1+|(H/Y)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) + Cerr * (H/Y)^2 * (∑ n ∈ S, ‖a n‖^2) := by obtain ⟨Cj,hCj,hmellin⟩ := exists_local_log_mellin_energy_constant hj obtain ⟨C,hC,herr⟩ := exists_actual_local_kernel_error_constant refine ⟨24*Cj,8*C,by positivity,by positivity,?_⟩ intro S a hSpos Y H hY hH hsmall have hHp : 0 < H := lt_of_lt_of_le zero_lt_one hH have hlog := hmellin S a hSpos (H/Y) Y (div_pos hHp hY) hY rw [div_mul_cancel₀ H hY.ne'] at hlog have hla := local_additive_convolution_contDiff S a H have hll := local_log_convolution_continuousOn S a hSpos hY H have hlaInt : IntegrableOn (fun v => ‖localAdditiveConvolution S a H v‖^2) (Set.Icc (Y/2) (3*Y)) := (hla.continuous.norm.pow 2).integrableOn_Icc have hllInt : IntegrableOn (fun v => ‖localLogConvolution S a H v‖^2) (Set.Icc (Y/2) (3*Y)) := (hll.norm.pow 2).integrableOn_Icc have hdInt : IntegrableOn (fun v => ‖localAdditiveConvolution S a H v-localLogConvolution S a H v‖^2) (Set.Icc (Y/2) (3*Y)) := ((hla.continuous.continuousOn.sub hll).norm.pow 2).integrableOn_Icc have htri (v : ℝ) : ‖localAdditiveConvolution S a H v‖^2 ≤ 2*‖localLogConvolution S a H v‖^2 + 2*‖localAdditiveConvolution S a H v-localLogConvolution S a H v‖^2 := by have hn := norm_add_le (localLogConvolution S a H v) (localAdditiveConvolution S a H v-localLogConvolution S a H v) have he : localLogConvolution S a H v + (localAdditiveConvolution S a H v-localLogConvolution S a H v) = localAdditiveConvolution S a H v := by abel rw [he] at hn have hs := pow_le_pow_left₀ (norm_nonneg _) hn 2 nlinarith [sq_nonneg (‖localLogConvolution S a H v‖- ‖localAdditiveConvolution S a H v-localLogConvolution S a H v‖)] have hti := integral_mono hlaInt ((hllInt.const_mul 2).add (hdInt.const_mul 2)) htri simp only [Pi.add_apply] at hti rw [integral_add (hllInt.const_mul 2) (hdInt.const_mul 2), integral_const_mul, integral_const_mul] at hti have he := herr S a hSpos Y H hY hH hsmall simp_rw [← local_convolution_difference S a H] at he calc _ ≤ (8/H^2)*(∫ v in Set.Icc (Y/2) (3*Y), ‖localLogConvolution S a H v‖^2) + 8*((∫ v in Set.Icc (Y/2) (3*Y), ‖localAdditiveConvolution S a H v-localLogConvolution S a H v‖^2)/H^2) := by have ht := mul_le_mul_of_nonneg_left hti (show 0 ≤ 4/H^2 by positivity) calc _ ≤ (4/H^2) * (2*(∫ v in Set.Icc (Y/2) (3*Y), ‖localLogConvolution S a H v‖^2) + 2*(∫ v in Set.Icc (Y/2) (3*Y), ‖localAdditiveConvolution S a H v-localLogConvolution S a H v‖^2)) := ht _ = _ := by ring _ ≤ (8/H^2)*(3*Y*(H/Y)^2*Cj * ∫ t : ℝ, (1+|(H/Y)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) + 8*(C*(H/Y)^2*(∑ n ∈ S, ‖a n‖^2)) := by exact add_le_add (mul_le_mul_of_nonneg_left hlog (by positivity)) (mul_le_mul_of_nonneg_left he (by norm_num)) _ = _ := by have hc : (8/H^2)*(3*Y*(H/Y)^2*Cj) = 24*Cj/Y := by field_simp ring rw [← mul_assoc, hc] ring end Bounty end section /- The physical edge with every target list and auxiliary draw is one unified full-state row. Its globally extended phase is bounded everywhere. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def physicalFullRecordedTracePhase (tags : ℕ → Option (I ⊕ K)) (cut : ℕ → Fin N → Finset (Fin J)) (steps : ℕ) (initial : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (F : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C) → FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) := finiteRecordedSchedulePhase (PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventPhase C k ω β ρ V) tags (physicalFullTraceObservation C k tags cut) steps initial F end Physical end Bounty end section /- Actual tilted-law vacuum scalars at two finite memory caps. Explicit damping choices cover doubled ghost births while retaining the original edge coefficient. A small linear baseline distortion bounds the squared vacuum boundary factor by exp(2). -/ open Finset Classical namespace Bounty end Bounty end section /- Arbitrary power saving for the actual candidate large-conductor Type I mass. -/ open Finset Filter namespace Bounty theorem candidate_Q_zero_le_wide_bound {c L : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hL : 0 ≤ L) {p : ℕ} (hp : p ∈ candidateQBand (c * L) 0) : (p : ℝ) ≤ 16 * Real.exp L := by have hscale := (candidate_center_scale_bounds hc hr hcenter).1 have hupper : (p : ℝ) ≤ Real.exp ((6/5 : ℝ) * (c * L)) := by simpa only [pow_zero, div_one] using ((mem_dyadicPrimeBand_iff (c * L) 1 (6/5) 0 p).mp hp).2.2 have hexp : Real.exp ((6/5 : ℝ) * (c * L)) ≤ Real.exp L := by apply Real.exp_le_exp.mpr have h := mul_le_mul_of_nonneg_right hscale hL nlinarith [mul_nonneg hc.le hL] exact (hupper.trans hexp).trans (by nlinarith [Real.exp_pos L]) theorem eventually_candidate_large_primitive_power_saving {c q theta : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hq0 : 0 ≤ q) (hq1 : q < 1) (htheta : theta < 1/2) (B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, 0 < jStar → ∀ N : ℕ, (N : ℝ) ≤ Real.exp (theta * L) → candidateLargePrimitiveTypeIMass c L q r jStar N ⌊Real.exp ((c/512)*L)⌋₊ ≤ Real.exp L * L ^ (-B) := by have htheta' : (theta + 1/2) / 2 < (1/2 : ℝ) := by linarith filter_upwards [eventually_candidate_dyadic_block_decay hc hr hq0 hq1 hcenter htheta' (B + 5), eventually_dyadicConductorRange_scale_bounds c htheta, eventually_dyadicConductorRange_card_le_linear c htheta, eventually_dyadicNatIndices_card_le_linear, eventually_three_dyadic_counts_totient_factor_le_pow_five] with L hblock hscale hqcount hcount hcost intro jStar hj N hN have hL : 0 < L := hcost.1 have hNexp : (N : ℝ) ≤ Real.exp L := by apply hN.trans apply Real.exp_le_exp.mpr nlinarith have hcut : (c/512)*L = c*L/512 := by ring rw [hcut] let H : ℝ := (2 / Real.log 2 + 1) * L let CS : ℝ := (dyadicNatIndices (candidateQBand (c * L) 0)).card let CT : ℝ := (dyadicNatIndices (Icc 1 ⌊16 * Real.exp L⌋₊)).card have hlog : 0 < Real.log 2 := Real.log_pos (by norm_num) have hH : 0 ≤ H := by dsimp [H]; positivity have hCS : CS ≤ H := by apply hcount ⌊16 * Real.exp L⌋₊ (candidateQBand (c * L) 0) (Nat.floor_le (by positivity)) intro p hp exact Nat.le_floor (candidate_Q_zero_le_wide_bound hc hr hcenter hL.le hp) have hCT : CT ≤ H := by apply hcount ⌊16 * Real.exp L⌋₊ (Icc 1 ⌊16 * Real.exp L⌋₊) (Nat.floor_le (by positivity)) intro n hn exact (mem_Icc.mp hn).2 have hB : 0 ≤ Real.exp L * L ^ (-(B + 5)) := by positivity have hmain := candidate_large_mass_le_dyadic_blocks (mul_nonneg hc.le hL.le) q r jStar hr hj N ⌊Real.exp (c*L/512)⌋₊ (Real.one_le_exp_iff.mpr hL.le) hNexp hH hB (fun h _ => hqcount N h hN) (by intro h hh k hk i hi j hj' obtain ⟨hRlo, hRhi, hRone⟩ := hscale N h k hN hk have hbase : ∀ f ∈ Icc (max 2 (⌊Real.exp (c*L/512)⌋₊ + 1)) (N / h), 0 < f := by intro f hf have hf2 : 2 ≤ f := (le_max_left _ _).trans (mem_Icc.mp hf).1 omega have hQD : ∀ f ∈ dyadicNatBucket (Icc (max 2 (⌊Real.exp (c*L/512)⌋₊ + 1)) (N / h)) k, (2 : ℝ) ^ (k + 1) / 2 ≤ (f : ℝ) := by intro f hf have hlo := (dyadicNatBucket_bounds _ hbase hf).1 have hloR : (2 : ℝ) ^ k ≤ f := by exact_mod_cast hlo have heq : (2 : ℝ) ^ (k + 1) / 2 = (2 : ℝ) ^ k := by rw [pow_succ]; ring rwa [heq] have hQR : ∀ f ∈ dyadicNatBucket (Icc (max 2 (⌊Real.exp (c*L/512)⌋₊ + 1)) (N / h)) k, (f : ℝ) ≤ (2 : ℝ) ^ (k + 1) := by intro f hf exact_mod_cast (dyadicNatBucket_bounds _ hbase hf).2.le have hb := hblock jStar hj h ((2 : ℝ) ^ (k + 1)) (by simpa only [hcut] using hRlo) hRhi _ hQD hQR i j unfold candidateRemainderCharacterVector exact hb) have hfactor : (2 * primeEulerProductUpperConstant * Real.log (2 * Real.exp L)) * H * CS * CT ≤ L ^ 5 := hcost.2 H CS CT hH (by dsimp [CS]; positivity) (by dsimp [CT]; positivity) le_rfl hCS hCT calc _ ≤ (2 * primeEulerProductUpperConstant * Real.log (2 * Real.exp L)) * H * CS * CT * (Real.exp L * L ^ (-(B + 5))) := hmain _ ≤ L ^ 5 * (Real.exp L * L ^ (-(B + 5))) := mul_le_mul_of_nonneg_right hfactor hB _ = Real.exp L * L ^ (-B) := by have hpow : L ^ (5 : ℝ) = L ^ (5 : ℕ) := Real.rpow_natCast L 5 rw [← hpow] calc _ = Real.exp L * (L ^ (5 : ℝ) * L ^ (-(B + 5))) := by ring _ = _ := by rw [← Real.rpow_add hL, show (5 : ℝ) + (-(B + 5)) = -B by ring] end Bounty end section /- Three consecutive selected physical rows retain both normalized permutation factors and the original signed edge action. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) noncomputable def physicalSelectedStateEdgeBlock (j : K) (aux : PhysicalAuxLabels P (C j)) (σ τ : PhysicalPermutations (Fin N) J ell) (R : PhysicalMarkLists P J ell) (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : ℂ := physicalObservedMarkRow C k ω β retention ρ V hV none (fun o t => if o = .inl σ then physicalObservedMarkRow C k ω β retention ρ V hV (some (.inr j)) (fun o u => if o = .inr (some ⟨j, aux⟩) ∧ u.1 = physicalPermuteLabels τ R then physicalObservedMarkRow C k ω β retention ρ V hV none (fun o v => if o = .inl (physicalInversePermutations τ) then F v else 0) u else 0) t else 0) s theorem physical_selected_state_edge_block_readout (j : K) (aux : PhysicalAuxLabels P (C j)) (σ τ : PhysicalPermutations (Fin N) J ell) (R : PhysicalMarkLists P J ell) (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j aux σ τ R F s = physicalSelectedEdgeBlock C k ω β retention ρ V hV j aux σ τ R (physicalMarkRawExtension F R) s := by unfold physicalSelectedStateEdgeBlock physicalSelectedEdgeBlock apply congrArg (fun f => physicalObservedMarkRow C k ω β retention ρ V hV none f s) funext o t split_ifs with ho · apply congrArg (fun f => physicalObservedMarkRow C k ω β retention ρ V hV (some (.inr j)) f t) funext ob u split_ifs with hu · rw [physical_observed_selected_permutation_state, physical_observed_selected_permutation] congr 1 have hm : physicalPermuteLabels (physicalInversePermutations τ) u.1 = R := by rw [hu.2, physical_permute_inverse] calc F (physicalPermuteLabels (physicalInversePermutations τ) u.1, u.2) = physicalMarkRawExtension F (physicalPermuteLabels (physicalInversePermutations τ) u.1) (physicalMarkRawReadout (physicalPermuteLabels (physicalInversePermutations τ) u.1, u.2)) := (physical_mark_extension_roundtrip F (physicalPermuteLabels (physicalInversePermutations τ) u.1, u.2)).symm _ = physicalMarkRawExtension F R (physicalMarkRawReadout u) := by rw [hm]; rfl · rfl · rfl theorem physical_selected_state_edge_block_eq (j : K) (aux : PhysicalAuxLabels P (C j)) (σ τ : PhysicalPermutations (Fin N) J ell) (R : PhysicalMarkLists P J ell) (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j aux σ τ R F s = (((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) ^ 2) * (ω j (productActiveMemorySplit (fun g => physicalFullSharedIndices (C j g)) B (physicalFullMemoryState (C j) (physicalPermuteLabels σ s.1) s.2.2)).1 aux : ℂ) * if physicalListAdmissible (C j) aux (physicalPermuteLabels σ s.1) (physicalPermuteLabels τ R) then jointRawTensorCutoff B (physicalFullEdgeRawRow (B := B) (C j) (k j) (physicalPermuteLabels σ s.1) (physicalPermuteLabels τ R) β ρ V aux) (physicalMarkRawExtension F R) (physicalMarkRawReadout s) else 0 := by rw [physical_selected_state_edge_block_readout, physical_selected_edge_block_eq] end Physical end Bounty end section /- A fixed-order pair-sieve upper bound, uniform over all local flags. -/ open Finset namespace Bounty theorem exists_finite_pair_sieve_upper : ∃ K : ℝ, 0 < K ∧ ∀ (A B C D m : ℕ) [NeZero m] (P : Finset ℕ) (rough banned : ℕ → Bool) {z : ℝ}, A ≤ B → C ≤ D → 1 < z → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, 3 ≤ p) → (∀ p ∈ P, ¬p ∣ m) → (∀ p ∈ P, (p : ℝ) ≤ z) → ((pairSieveAvoidance A B C D m P rough banned).card : ℝ) ≤ K * (((B : ℝ)-A)*((D : ℝ)-C)/(m : ℝ)) * (∏ p ∈ P, (1 - pairSieveDensity p (rough p) (banned p))) + ((m : ℝ)*(z^(10 : ℝ))^3 + (((B : ℝ)-A)+((D : ℝ)-C))*(z^(10 : ℝ))^2) := by obtain ⟨K, hK, hb⟩ := exists_finite_pair_sieve_estimate refine ⟨1+K*Real.exp (-2), by positivity, ?_⟩ intro A B C D m hm P rough banned z hAB hCD hz hP hP3 hPm hPz have h := hb A B C D m P rough banned hAB hCD hz (h := 2) (by norm_num) (by decide) hP hP3 hPm hPz norm_num only [Nat.cast_ofNat] at h let V := ∏ p ∈ P, (1 - pairSieveDensity p (rough p) (banned p)) have hV : 0 ≤ V := prod_nonneg (fun p hp => by have hg := (pair_sieve_density_bounds (hP3 p hp) (rough p) (banned p)).2.1 linarith) have hX : 0 ≤ (B : ℝ)-A := sub_nonneg.mpr (Nat.cast_le.mpr hAB) have hY : 0 ≤ (D : ℝ)-C := sub_nonneg.mpr (Nat.cast_le.mpr hCD) have hm0 : (0 : ℝ) < m := Nat.cast_pos.mpr (Nat.pos_of_ne_zero (NeZero.ne m)) have hphi : (m.totient : ℝ) ≤ m := Nat.cast_le.mpr (Nat.totient_le m) have hmain : ((B : ℝ)-A)*((D : ℝ)-C)*(m.totient : ℝ)/(m : ℝ)^2 ≤ ((B : ℝ)-A)*((D : ℝ)-C)/(m : ℝ) := by apply (div_le_iff₀ (sq_pos_of_pos hm0)).mpr have hid : (((B : ℝ)-A)*((D : ℝ)-C)/(m : ℝ))*(m : ℝ)^2 = ((B : ℝ)-A)*((D : ℝ)-C)*(m : ℝ) := by field_simp rw [hid] exact mul_le_mul_of_nonneg_left hphi (mul_nonneg hX hY) have hsmall := (le_abs_self _).trans h have hmainV := mul_le_mul_of_nonneg_right hmain hV have hcoeff : 0 ≤ 1+K*Real.exp (-2) := by positivity have hscaled := mul_le_mul_of_nonneg_left hmainV hcoeff dsimp [V] at hscaled nlinarith theorem exists_finite_pair_sieve_product_upper : ∃ K : ℝ, 0 < K ∧ ∀ (A B C D m : ℕ) [NeZero m] (P : Finset ℕ) (rough banned : ℕ → Bool) {z : ℝ}, A ≤ B → C ≤ D → 1 < z → (∀ p ∈ P, p.Prime) → (∀ p ∈ P, 3 ≤ p) → (∀ p ∈ P, ¬p ∣ m) → (∀ p ∈ P, (p : ℝ) ≤ z) → ((pairSieveAvoidance A B C D m P rough banned).card : ℝ) ≤ K * (((B : ℝ)-A)*((D : ℝ)-C)/(m : ℝ)) * (∏ p ∈ P.filter (fun p => rough p = true), (1 - 1/(p : ℝ)))^2 * (∏ p ∈ P.filter (fun p => banned p = true), (1 - 1/(p : ℝ))) + ((m : ℝ)*(z^(10 : ℝ))^3 + (((B : ℝ)-A)+((D : ℝ)-C))*(z^(10 : ℝ))^2) := by obtain ⟨K, hK, hb⟩ := exists_finite_pair_sieve_upper refine ⟨4*K, by positivity, ?_⟩ intro A B C D m hm P rough banned z hAB hCD hz hP hP3 hPm hPz have h := hb A B C D m P rough banned hAB hCD hz hP hP3 hPm hPz have hX : 0 ≤ (B : ℝ)-A := sub_nonneg.mpr (Nat.cast_le.mpr hAB) have hY : 0 ≤ (D : ℝ)-C := sub_nonneg.mpr (Nat.cast_le.mpr hCD) have hc : 0 ≤ K * (((B : ℝ)-A)*((D : ℝ)-C)/(m : ℝ)) := by positivity have he := mul_le_mul_of_nonneg_left (pair_sieve_euler_product_le P hP3 rough banned) hc apply h.trans exact add_le_add (he.trans_eq (by ring)) le_rfl end Bounty end section /- Arbitrary complex weights on terminal tests commute with physical recorded histories. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K A H : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) end Physical end Bounty end section /- The eventual disjoint-pool comparison for literal repeated-list rows. Both pairings use the original symmetric tests and the untilted physical mass. The error is raw minus the signed sum over nonempty active probe subsets. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_repeated_big_prime_disjoint_pool_comparison (hZ : PrimitiveZeroFreeHalfPlane) (c s z a v D ε : ℝ) (m : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (hm : 0 < m) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G] (J ell : ℕ), ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, Disjoint r t → ∀ ζ Θ : ℝ, |ζ| ≤ L ^ z → ∀ f g : RepeatedBigLists P J ell → ℂ, f ∈ repeatedBigSymmetricSubspace → g ∈ repeatedBigSymmetricSubspace → let slots := fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)) let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ ‖cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeRawRow P V ζ Θ) f g - ∑ A ∈ cleanNonemptySubsets (r.sigma slots), ∑ B ∈ cleanNonemptySubsets (t.sigma slots), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeComparisonRow P V A B Q h kept kept ζ Θ) f g‖ ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma slots).card + (t.sigma slots).card) * L ^ (-D)) * Real.sqrt (finiteWeightedEnergy (repeatedBigActiveMass V (fun _ _ => 1)) f) * Real.sqrt (finiteWeightedEnergy (repeatedBigActiveMass V (fun _ _ => 1)) g) := by intro κ s' A₀ q w x filter_upwards [eventually_prime_grouped_disjoint_pool_comparison.{0} hZ c s z a v D ε m hc hs hz ha hv hD hε hm] with L hcomp intro Q h ξ G _ _ J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ f g hf hg slots kept have hVpos (j : G) : 0 < V j := hv.trans_le (hV j) have hPpos (j : G) (p : ℕ) (hp : p ∈ P j) : 0 < p := (hP j p hp).1.pos have hμ (j : G) (p : P j) : physicalLabelLaw V j p ≠ 0 := by unfold physicalLabelLaw apply div_ne_zero one_ne_zero exact mul_ne_zero (hVpos j).ne' (by exact_mod_cast (hPpos j p.val p.property).ne') have hslots (j : G) : Disjoint (slots j) (repeatedBigPrimeTailSlots J ell) := by apply disjoint_left.mpr intro i hi ht rcases mem_map.mp hi with ⟨k, _, rfl⟩ rcases mem_map.mp ht with ⟨l, _, he⟩ cases he have hcount (j : G) : (slots j).card = m := by simpa only [slots, card_map] using hp j have htailcount (j : G) : (repeatedBigPrimeTailSlots J ell).card = ell := by simp only [repeatedBigPrimeTailSlots, card_map, card_univ, Fintype.card_fin] have hbound := hcomp P V hdisj hP hmass hV hlog hcard hband slots (fun _ => repeatedBigPrimeTailSlots J ell) hslots ell hcount htailcount r t hrt (repeatedBigFlatActive J ell) (repeatedBigPrimeTailSlots_compl J ell) ζ Θ hζ f g ((repeated_big_symmetric_iff_group_slot_symmetric f).mp hf) ((repeated_big_symmetric_iff_group_slot_symmetric g).mp hg) have hraw := repeated_big_prime_raw_pairing P V (fun j => physical_label_law_sum V j (hVpos j) (hmass j)) hμ ζ Θ f g change cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeRawRow P V ζ Θ) f g = _ at hraw have hsub (u : Finset G) : u.sigma slots ⊆ repeatedBigFlatActive J ell := by rintro ⟨j, i⟩ hi rcases mem_map.mp (mem_sigma.mp hi).2 with ⟨k, _, rfl⟩ exact repeatedBigFlatActive_mem_inl J ell j k have hrt' : Disjoint (r.sigma slots) (t.sigma slots) := by apply disjoint_left.mpr intro i hi hj exact disjoint_left.mp hrt (mem_sigma.mp hi).1 (mem_sigma.mp hj).1 have hpair (A : Finset (RepeatedBigFlatIndex G J ell)) (hA : A ∈ cleanNonemptySubsets (r.sigma slots)) (B : Finset (RepeatedBigFlatIndex G J ell)) (hB : B ∈ cleanNonemptySubsets (t.sigma slots)) : cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeComparisonRow P V A B Q h kept kept ζ Θ) f g = cleanKernelPairing (finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1)) (primeAsymmetricComparisonKernel (fun i : RepeatedBigFlatIndex G J ell => P i.1) (fun i => V i.1) (repeatedBigFlatActive J ell) Q h kept kept ζ Θ A B) (finiteGroupedTailTest (physicalLabelLaw V) (fun _ => repeatedBigPrimeTailSlots J ell) f) (finiteGroupedTailTest (physicalLabelLaw V) (fun _ => repeatedBigPrimeTailSlots J ell) g) := by have ha := ((clean_mem_nonempty_subsets _ _).mp hA).2 have hb := ((clean_mem_nonempty_subsets _ _).mp hB).2 simpa only [finiteGroupedTailTest, repeatedBigPrimeTailSlots_compl] using repeated_big_prime_comparison_pairing_tail_eq P V hVpos hPpos hmass A B (ha.trans (hsub r)) (hb.trans (hsub t)) (hrt'.mono ha hb) Q h kept kept ζ Θ f g have hsum : (∑ A ∈ cleanNonemptySubsets (r.sigma slots), ∑ B ∈ cleanNonemptySubsets (t.sigma slots), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeComparisonRow P V A B Q h kept kept ζ Θ) f g) = ∑ A ∈ cleanNonemptySubsets (r.sigma slots), ∑ B ∈ cleanNonemptySubsets (t.sigma slots), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1)) (primeAsymmetricComparisonKernel (fun i : RepeatedBigFlatIndex G J ell => P i.1) (fun i => V i.1) (repeatedBigFlatActive J ell) Q h kept kept ζ Θ A B) (finiteGroupedTailTest (physicalLabelLaw V) (fun _ => repeatedBigPrimeTailSlots J ell) f) (finiteGroupedTailTest (physicalLabelLaw V) (fun _ => repeatedBigPrimeTailSlots J ell) g) := by apply sum_congr rfl intro A hA apply sum_congr rfl intro B hB rw [hpair A hA B hB] rw [hraw, hsum, repeated_big_active_mass_product V] exact hbound end Bounty end section /- Exact phase products separate initial avoidance, global distinctness, and local residuals. -/ open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (hedge : ∀ k H x e, edgePhase k H x e = (if FullMixedLocalBirthAvoids (J := J) n S B A Δ D H (some (.inr k)) x e ∧ FullMixedLocalBirthDistinct (J := J) n S B A Δ D (some (.inr k)) x e then 1 else 0) * edgePhase k (fun _ => ∅) x e) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) include hedge in theorem full_mixed_ledger_path_phase_factor (steps : List (Option (J ⊕ K))) (x : FullMixedLedgerState n (M := M) B) (p : FullMixedLedgerPath n S B A Δ D steps x) (hx : FullMixedLedgerCovers n B x) (hp : finiteEventPathWeight (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fun tag s => fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V tag s.2) steps x p ≠ 0) : finiteEventLocalPhase (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fullMixedLedgerPhase n S B A Δ D edgePhase) steps x p = (if ∀ (a : FullMixedBirthAddress S B steps) (z : (g : Fin N) × P g), fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z → z.2 ∉ x.1 z.1 then 1 else 0) * (if ∀ (a b : FullMixedBirthAddress S B steps) z, fullMixedLedgerPathBirthLabel n S B A Δ D steps x p a = some z → fullMixedLedgerPathBirthLabel n S B A Δ D steps x p b = some z → a = b then 1 else 0) * finiteEventLocalPhase (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fun tag s => fullMixedBirthResidualPhase n S B A Δ D edgePhase tag s.2) steps x p := by have h := finite_event_local_phase_indicator_factor (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fullMixedLedgerPhase n S B A Δ D edgePhase) (fun tag s => fullMixedBirthResidualPhase n S B A Δ D edgePhase tag s.2) (fun tag s e => FullMixedLocalBirthAvoids n S B A Δ D s.1 tag s.2 e ∧ FullMixedLocalBirthDistinct n S B A Δ D tag s.2 e) (fun tag s e => by have hlocal := full_mixed_local_freshness_factor n S B A Δ D edgePhase hedge tag s e by_cases hc : FullMixedLocalBirthAvoids n S B A Δ D s.1 tag s.2 e ∧ FullMixedLocalBirthDistinct n S B A Δ D tag s.2 e · simpa only [if_pos hc] using hlocal · simpa only [if_neg hc] using hlocal) steps x p refine h.trans ?_ apply congrArg (fun z : ℂ => z * _) exact complex_indicator_and_of_iff _ _ _ _ _ _ (full_mixed_path_local_freshness_global_iff n S B A Δ D steps x p ω μ q ρ V hx hp) end Full end Bounty end section /- Nonzero actual physical local phases preserve the physical injective active state. -/ open Finset open scoped Classical namespace Bounty section Edge variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (H : (g : Fin N) → Finset ↥(P g)) (ω : ∀ _c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_endpoint_phase_target_injective (L : PhysicalMarkLists P J ell) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) (hp : physicalFullEndpointPhase C k L H q ω μ ρ V e ≠ 0) : FullActiveInjective (fullActiveEdgeEventTarget (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) (physicalFullMemoryState C L q) e) := by have hw : fullActiveEdgeEventWeight (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e ≠ 0 := by intro h apply hp simp only [physicalFullEndpointPhase, if_pos h] have hsum : (∑ R : PhysicalMarkLists P J ell, physicalFullEdgePhase C k L R H q e) ≠ 0 := by simpa only [physicalFullEndpointPhase, if_neg hw] using hp obtain ⟨R, _, hR⟩ := exists_ne_zero_of_sum_ne_zero hsum rw [physical_full_edge_target_of_nonzero C k L R H q ω μ ρ V e hw hR] exact physical_full_state_injective C R _ theorem physical_global_phase_target_injective (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullEdgeEvent C k x) (hp : physicalFullGlobalEdgePhase C k H ω μ ρ V x e ≠ 0) : FullActiveInjective (fullActiveEdgeEventTarget (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x e) := by have hx : FullActiveInjective x := by by_contra hn apply hp simp only [physicalFullGlobalEdgePhase, dif_neg hn] have hencoded (L : PhysicalMarkLists P J ell) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) B) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) (he : physicalFullGlobalEdgePhase C k H ω μ ρ V (physicalFullMemoryState C L q) e ≠ 0) : FullActiveInjective (fullActiveEdgeEventTarget (fun g (p : ↥(P g)) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) (physicalFullMemoryState C L q) e) := by rw [physical_full_global_edge_phase_encode] at he exact physical_endpoint_phase_target_injective C k H ω μ ρ V L q e he have h := hencoded (physicalFullStateLabels C x hx) (fun g => (x g).2) rw [physical_full_state_encode_labels C x hx] at h exact h e hp end Edge section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_local_phase_target_injective (tag : Option (I ⊕ K)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) (hs : FullActiveInjective s.2) (hp : physicalFullLedgerEventPhase C k ω β ρ V tag s e ≠ 0) : FullActiveInjective (physicalFullLedgerEventTarget C k tag s e).2 := by cases tag with | none => intro g exact (hs g).comp (e.down g).injective | some tag => cases tag with | inl i => intro g change Function.Injective ((fullPermutationMixedEventTarget _ _ _ _ _ _ (some (.inl i)) s.2 e g).1) rw [fullPermutationMixedEventTarget_ghost_active] exact hs g | inr j => exact physical_global_phase_target_injective (C j) (k j) s.1 (ω j) (fun g p => β g p / V g) ρ V s.2 e hp end Physical end Bounty end section /- Precision-independent coefficient bounds for the actual global prime proxy. -/ open Finset Filter namespace Bounty theorem exists_prime_logarithmic_proxy_uniform_bound {a : ℝ} (ha : 0 < a) : ∃ C : ℝ, 0 < C ∧ ∀ S : ℝ, 0 ≤ S → ∀ᶠ L : ℝ in atTop, ∀ n : ℕ, Real.exp (a*L) ≤ (n : ℝ) → 0 ≤ primeLogarithmicProxy L S n ∧ primeLogarithmicProxy L S n ≤ 1 ∧ primeLogarithmicProxy L S n ≤ C/(L*(∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1-1/(p : ℝ)))) ∧ |(if n.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S n| ≤ 1 := by have ha2 : 0 < a/2 := by positivity obtain ⟨C, hC, hproxy⟩ := exists_prime_cell_proxy_uniform_bound ha2 refine ⟨C, hC, ?_⟩ intro S hS filter_upwards [eventually_logarithmic_cell_dyad_bounds ha hS, hproxy S] with L hcells hb intro n hn have hn0 : 0 < (n : ℝ) := (Real.exp_pos _).trans_le hn have hF : ∀ i ∈ ({n} : Finset ℕ), (n : ℝ) ≤ (i : ℝ) ∧ (i : ℝ) ≤ 2*n := by intro i hi obtain rfl := mem_singleton.mp hi exact ⟨le_rfl, by linarith⟩ have hbase := (hcells.2 (n : ℝ) hn {n} hF).2 (logarithmicCellIndex (L^(-S)) n) (mem_image.mpr ⟨n, mem_singleton_self n, rfl⟩) have hv := hb _ hbase n change 0 ≤ primeLogarithmicProxy L S n ∧ primeLogarithmicProxy L S n ≤ 1 ∧ primeLogarithmicProxy L S n ≤ C/(L*(∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1-1/(p : ℝ)))) at hv refine ⟨hv.1, hv.2.1, hv.2.2, ?_⟩ split <;> rw [abs_le] <;> constructor <;> linarith [hv.1, hv.2.1] end Bounty end section /- Global nonprincipal Mellin cancellation for the actual count-matched prime proxy. -/ open Finset Filter namespace Bounty theorem eventually_prime_logarithmic_proxy_mellin_power_bound {a S T : ℝ} (ha : 0 < a) (hS : 0 ≤ S) (hT : 0 ≤ T) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), χ ≠ 1 → (r : ℝ) ≤ L^T → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc m n, (primeLogarithmicProxy L S i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by classical have ha2 : 0 < a/2 := by positivity filter_upwards [eventually_logarithmic_cell_dyad_bounds ha hS, eventually_prime_proxy_cell_mellin_power_bound ha2 hT S (Bsave+S+1)] with L hcells hlocal have hL := hcells.1 have hδ : 0 < L^(-S) := Real.rpow_pos_of_pos hL _ intro Y hY r hr χ hχ hrT v hv m n _hmn hYm hn let F := Ioc m n let f := fun i : ℕ => (primeLogarithmicProxy L S i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r) have hF : ∀ i ∈ F, Y ≤ (i : ℝ) ∧ (i : ℝ) ≤ 2*Y := by intro i hi exact ⟨hYm.trans (Nat.cast_le.mpr (mem_Ioc.mp hi).1), (Nat.cast_le.mpr (mem_Ioc.mp hi).2).trans hn⟩ obtain ⟨hcount, hbases⟩ := hcells.2 Y hY F hF have hYsmall : Real.exp ((a/2)*L) ≤ Y := by apply le_trans _ hY exact Real.exp_le_exp.mpr (by nlinarith) have hfiber : ∀ k ∈ logarithmicCellIndices (L^(-S)) F, ‖∑ i ∈ F.filter (fun i => logarithmicCellIndex (L^(-S)) i = k), f i‖ ≤ L^(-(Bsave+S+1)) := by intro k hk let Z := logarithmicCellBase (L^(-S)) k let lo := max m ⌊Z⌋₊ let hi := min n ⌊Real.exp (L^(-S))*Z⌋₊ have heq : (∑ i ∈ F.filter (fun i => logarithmicCellIndex (L^(-S)) i = k), f i) = ∑ i ∈ Ioc lo hi, (primeCellProxy L S Z i : ℂ)*harmonicMellinWeight v i*χ (i : ZMod r) := by change (∑ i ∈ (Ioc m n).filter (fun i => logarithmicCellIndex (L^(-S)) i = k), f i) = _ rw [logarithmic_interval_fiber hδ] apply sum_congr rfl intro i hiI have hiC : i ∈ logarithmicCellSet (L^(-S)) k := mem_Ioc.mpr ⟨(le_max_right _ _).trans_lt (mem_Ioc.mp hiI).1, (mem_Ioc.mp hiI).2.trans (min_le_right _ _)⟩ dsimp [f] rw [prime_logarithmic_proxy_eq_on_cell hL hiC] rw [heq] by_cases hlohi : lo ≤ hi · apply hlocal Y Z hYsmall (hbases k hk) r χ hχ hrT v hv lo hi hlohi · exact hYm.trans (Nat.cast_le.mpr (Nat.add_le_add_right (le_max_left _ _) 1)) · exact (Nat.cast_le.mpr (min_le_left _ _)).trans hn · exact le_max_right _ _ · exact min_le_right _ _ · rw [Ioc_eq_empty_of_le (by omega : hi ≤ lo), sum_empty, norm_zero] positivity change ‖∑ i ∈ F, f i‖ ≤ _ rw [← sum_logarithmic_cell_fibers (L^(-S)) F f] calc _ ≤ ∑ k ∈ logarithmicCellIndices (L^(-S)) F, ‖∑ i ∈ F.filter (fun i => logarithmicCellIndex (L^(-S)) i = k), f i‖ := norm_sum_le _ _ _ ≤ ∑ _k ∈ logarithmicCellIndices (L^(-S)) F, L^(-(Bsave+S+1)) := sum_le_sum hfiber _ = ((logarithmicCellIndices (L^(-S)) F).card : ℝ)*L^(-(Bsave+S+1)) := by simp only [sum_const, nsmul_eq_mul] _ ≤ L^(S+1)*L^(-(Bsave+S+1)) := mul_le_mul_of_nonneg_right hcount (by positivity) _ = L^(-Bsave) := by rw [← Real.rpow_add hL]; congr 1; ring end Bounty end section /- Actual prime-minus-proxy prefix sums are controlled solely by the boundary cells. -/ open Finset Filter namespace Bounty theorem eventually_prime_logarithmic_proxy_prefix_bound {a S : ℝ} (ha : 0 < a) (hS : 0 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ m n : ℕ, Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)‖ ≤ 8*L^(-S)*Y+2 := by classical have ha2 : 0 < a/2 := by positivity obtain ⟨C, _, hproxy⟩ := exists_prime_cell_proxy_uniform_bound ha2 filter_upwards [eventually_logarithmic_cell_dyad_bounds ha hS, eventually_rough_logarithmic_cell_count_pos ha2 S, hproxy S, eventually_ge_atTop (1 : ℝ)] with L hcells hden hunit hL1 have hL := hcells.1 have hδ : 0 < L^(-S) := Real.rpow_pos_of_pos hL _ have hδ1 : L^(-S) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hL1 (by linarith) intro Y hY m n hYm hn let δ := L^(-S) let g := fun i : ℕ => (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ) have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hF : ∀ i ∈ Ioc m n, Y ≤ (i : ℝ) ∧ (i : ℝ) ≤ 2*Y := by intro i hi exact ⟨hYm.trans (Nat.cast_le.mpr (mem_Ioc.mp hi).1), (Nat.cast_le.mpr (mem_Ioc.mp hi).2).trans hn⟩ have hbases := (hcells.2 Y hY (Ioc m n) hF).2 have hzero : ∀ k ∈ logarithmicCellIndices δ (Ioc m n), ∑ i ∈ logarithmicCellSet δ k, g i = 0 := by intro k hk have hR := (hden (logarithmicCellBase δ k) (hbases k hk)).1 have hz := prime_cell_proxy_full_cell_zero_sum hR have heq : (∑ i ∈ logarithmicCellSet δ k, g i) = ∑ i ∈ logarithmicCellSet δ k, (((if i.Prime then 1 else 0 : ℝ)-primeCellProxy L S (logarithmicCellBase δ k) i : ℝ) : ℂ) := by apply sum_congr rfl intro i hi dsimp [g] rw [prime_logarithmic_proxy_eq_on_cell hL hi] rw [heq] dsimp [logarithmicCellSet, δ] exact_mod_cast hz have hmass : ∀ k ∈ logarithmicCellIndices δ (Ioc m n), (∑ i ∈ logarithmicCellSet δ k, ‖g i‖) ≤ 4*δ*Y+1 := by intro k hk let Z := logarithmicCellBase δ k have hZ : 0 < Z := logarithmic_cell_base_pos δ k have hZsmall : Z ≤ 2*Y := by obtain ⟨i, hi, hiK⟩ := mem_image.mp hk have hi0 : 0 < i := lt_of_le_of_lt (Nat.zero_le _) (mem_Ioc.mp hi).1 have hiC := (mem_logarithmic_cell_iff hδ hi0 k).mpr hiK exact (Nat.lt_of_floor_lt (mem_Ioc.mp hiC).1).le.trans (hF i hi).2 have hu := hunit Z (hbases k hk) have hnorm : ∀ i ∈ logarithmicCellSet δ k, ‖g i‖ ≤ 1 := by intro i hi dsimp [g] rw [prime_logarithmic_proxy_eq_on_cell hL hi, Complex.norm_real, Real.norm_eq_abs] have hlo := (hu i).1 have hup := (hu i).2.1 split <;> rw [abs_le] <;> constructor <;> linarith have hZB : Z ≤ Real.exp δ*Z := le_mul_of_one_le_left hZ.le (Real.one_le_exp hδ.le) have hcard : ((logarithmicCellSet δ k).card : ℝ) ≤ Real.exp δ*Z-Z+1 := by apply nat_finset_card_le_real_span _ hZB intro i hi exact ⟨(Nat.lt_of_floor_lt (mem_Ioc.mp hi).1).le, (Nat.cast_le.mpr (mem_Ioc.mp hi).2).trans (Nat.floor_le (by positivity))⟩ have hexp : Real.exp δ-1 ≤ 2*δ := by have he := Real.abs_exp_sub_one_le (show |δ| ≤ 1 by rwa [abs_of_pos hδ]) rw [abs_of_pos hδ] at he exact (le_abs_self _).trans he calc _ ≤ ∑ _i ∈ logarithmicCellSet δ k, (1 : ℝ) := sum_le_sum hnorm _ = ((logarithmicCellSet δ k).card : ℝ) := by simp only [sum_const, nsmul_eq_mul, mul_one] _ ≤ Real.exp δ*Z-Z+1 := hcard _ = (Real.exp δ-1)*Z+1 := by ring _ ≤ (2*δ)*Z+1 := by gcongr _ ≤ 4*δ*Y+1 := by nlinarith [mul_le_mul_of_nonneg_left hZsmall hδ.le] have hb := logarithmic_interval_cancellation_bound hδ m n g (M := 4*δ*Y+1) (by positivity) hzero hmass convert hb using 1 dsimp [δ, g] ring end Bounty end section /- Ledger-independent active coefficients preserve the actual physical birth factorization. -/ open Finset Classical namespace Bounty section Enriched variable {Ghost Edge : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Edge → Fin N → Finset (Fin J)) (k : Edge → ℤ) (ω : ∀ a, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C a g)) → PhysicalAuxLabels P (C a) → ℝ) (μ : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (Θ : ∀ a, ((g : Fin N) → Fin (J + ell) → ↥(P g)) → ((g : Fin N) → Fin (J + ell) → ↥(P g)) → PhysicalAuxLabels P (C a) → ℂ) end Enriched end Bounty end section /- Uniform nonprincipal Mellin cancellation for an actual rough-test proxy on a truncated cell. -/ open Finset Filter namespace Bounty theorem eventually_rough_test_proxy_cell_mellin_power_bound {a T γ : ℝ} (ha : 0 < a) (hγ : 0 < γ) (hT : 0 ≤ T) (S Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y Z : ℝ, Real.exp (a*L) ≤ Y → Real.exp (a*L) ≤ Z → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), χ ≠ 1 → (r : ℝ) ≤ L^T → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ⌊Z⌋₊ ≤ m → n ≤ ⌊Real.exp (L^(-S))*Z⌋₊ → ‖∑ i ∈ Ioc m n, (roughTestCellProxy γ L S Z i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by filter_upwards [eventually_rough_interval_mellin_power_bound ha hT Bsave, eventually_rough_test_proxy_cutoff hγ] with L hrough hcut intro Y Z hY _hZ r hr χ hχ hrT v hv m n hmn hYm hn hZm hnZ have hc := rough_test_cell_coefficient_bounds (S := S) (Y := Z) hcut have hraw := hrough Y hY r χ hχ hrT v hv m n hmn hYm hn have hid : (∑ i ∈ Ioc m n, (roughTestCellProxy γ L S Z i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)) = (roughTestCellProxyCoefficient γ L S Z : ℂ)* ∑ i ∈ (Ioc m n).filter (fun i : ℕ => ∀ p ∈ i.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)), harmonicMellinWeight v i*χ (i : ZMod r) := by rw [mul_sum, sum_filter] apply sum_congr rfl intro i hi have hiI : i ∈ Ioc ⌊Z⌋₊ ⌊Real.exp (L^(-S))*Z⌋₊ := mem_Ioc.mpr ⟨hZm.trans_lt (mem_Ioc.mp hi).1, (mem_Ioc.mp hi).2.trans hnZ⟩ by_cases hp : ∀ p ∈ i.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ) · have hiR : i ∈ roughBand Z (Real.exp (L^(-S))*Z) (Real.exp (Real.sqrt L)) := mem_filter.mpr ⟨hiI, hp⟩ simp only [roughTestCellProxy, if_pos hiR, if_pos hp, mul_assoc] · have hiR : i ∉ roughBand Z (Real.exp (L^(-S))*Z) (Real.exp (Real.sqrt L)) := fun hh => hp (mem_filter.mp hh).2 simp only [roughTestCellProxy, if_neg hiR, if_neg hp, Complex.ofReal_zero, zero_mul] rw [hid, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hc.1] exact (mul_le_mul hc.2 hraw (norm_nonneg _) zero_le_one).trans_eq (one_mul _) end Bounty end section /- Exact principal-character reduction on the rough-test difference support. -/ open Finset Filter namespace Bounty theorem rough_test_logarithmic_proxy_principal_identity (γ L S : ℝ) {n r : ℕ} (hcut : Real.sqrt L ≤ γ*L) (hn : 0 < n) (hr : 0 < r) (hrW : (r : ℝ) ≤ Real.exp (Real.sqrt L)) : ((roughTestIndicator γ L n-roughTestLogarithmicProxy γ L S n : ℝ) : ℂ)* (1 : DirichletCharacter ℂ r) (n : ZMod r) = ((roughTestIndicator γ L n-roughTestLogarithmicProxy γ L S n : ℝ) : ℂ) := by classical by_cases ht : exponentialRoughTest γ L n · have hcop : n.Coprime r := coprime_of_small_prime_avoidance hr hrW (by intro p hp hpn have hpf : p ∈ n.primeFactors := Nat.mem_primeFactors.mpr ⟨(mem_filter.mp hp).2, hpn, hn.ne'⟩ have hlarge := (Real.exp_le_exp.mpr hcut).trans_lt (ht p hpf) have hsmall := (Nat.cast_le.mpr (mem_Ioc.mp (mem_filter.mp hp).1).2).trans (Nat.floor_le (Real.exp_pos (Real.sqrt L)).le) exact (not_lt_of_ge hsmall) hlarge) rw [MulChar.one_apply ((ZMod.isUnit_iff_coprime _ _).mpr hcop), mul_one] · by_cases hz : roughTestLogarithmicProxy γ L S n = 0 · simp only [roughTestIndicator, if_neg ht, hz, sub_zero, Complex.ofReal_zero, zero_mul] · have hcop : n.Coprime r := coprime_of_small_prime_avoidance hr hrW (rough_band_avoids_small_primes (rough_test_cell_proxy_ne_zero_mem hz)) rw [MulChar.one_apply ((ZMod.isUnit_iff_coprime _ _).mpr hcop), mul_one] theorem eventually_rough_test_proxy_principal_identity {γ : ℝ} (hγ : 0 < γ) (S T : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ n : ℕ, 0 < n → ∀ r : ℕ, 0 < r → (r : ℝ) ≤ L^T → ((roughTestIndicator γ L n-roughTestLogarithmicProxy γ L S n : ℝ) : ℂ)* (1 : DirichletCharacter ℂ r) (n : ZMod r) = ((roughTestIndicator γ L n-roughTestLogarithmicProxy γ L S n : ℝ) : ℂ) := by classical filter_upwards [eventually_rpow_le_exp_sqrt T, eventually_rough_test_proxy_cutoff hγ] with L hmod hcut intro n hn r hr hrT exact rough_test_logarithmic_proxy_principal_identity γ L S hcut hn hr (hrT.trans hmod) end Bounty end section /- Actual prime-minus-proxy prefix sums are controlled solely by the boundary cells. -/ open Finset Filter namespace Bounty theorem eventually_rough_test_logarithmic_proxy_prefix_bound {a S γ : ℝ} (ha : 0 < a) (hγ : 0 < γ) (hS : 0 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ m n : ℕ, Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)‖ ≤ 8*L^(-S)*Y+2 := by classical have ha2 : 0 < a/2 := by positivity filter_upwards [eventually_logarithmic_cell_dyad_bounds ha hS, eventually_rough_logarithmic_cell_count_pos ha2 S, eventually_rough_test_proxy_cutoff hγ, eventually_ge_atTop (1 : ℝ)] with L hcells hden hcut hL1 have hL := hcells.1 have hδ : 0 < L^(-S) := Real.rpow_pos_of_pos hL _ have hδ1 : L^(-S) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hL1 (by linarith) intro Y hY m n hYm hn let δ := L^(-S) let g := fun i : ℕ => ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ) have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hF : ∀ i ∈ Ioc m n, Y ≤ (i : ℝ) ∧ (i : ℝ) ≤ 2*Y := by intro i hi exact ⟨hYm.trans (Nat.cast_le.mpr (mem_Ioc.mp hi).1), (Nat.cast_le.mpr (mem_Ioc.mp hi).2).trans hn⟩ have hbases := (hcells.2 Y hY (Ioc m n) hF).2 have hzero : ∀ k ∈ logarithmicCellIndices δ (Ioc m n), ∑ i ∈ logarithmicCellSet δ k, g i = 0 := by intro k hk have hR := (hden (logarithmicCellBase δ k) (hbases k hk)).1 have hz := rough_test_cell_proxy_full_cell_zero_sum (γ := γ) hR have heq : (∑ i ∈ logarithmicCellSet δ k, g i) = ∑ i ∈ logarithmicCellSet δ k, ((roughTestIndicator γ L i-roughTestCellProxy γ L S (logarithmicCellBase δ k) i : ℝ) : ℂ) := by apply sum_congr rfl intro i hi dsimp [g] rw [rough_test_logarithmic_proxy_eq_on_cell hL hi] rw [heq] dsimp [logarithmicCellSet, δ] exact_mod_cast hz have hmass : ∀ k ∈ logarithmicCellIndices δ (Ioc m n), (∑ i ∈ logarithmicCellSet δ k, ‖g i‖) ≤ 4*δ*Y+1 := by intro k hk let Z := logarithmicCellBase δ k have hZ : 0 < Z := logarithmic_cell_base_pos δ k have hZsmall : Z ≤ 2*Y := by obtain ⟨i, hi, hiK⟩ := mem_image.mp hk have hi0 : 0 < i := lt_of_le_of_lt (Nat.zero_le _) (mem_Ioc.mp hi).1 have hiC := (mem_logarithmic_cell_iff hδ hi0 k).mpr hiK exact (Nat.lt_of_floor_lt (mem_Ioc.mp hiC).1).le.trans (hF i hi).2 have hu := rough_test_cell_proxy_bounds (γ := γ) (L := L) (S := S) (Y := Z) hcut have hnorm : ∀ i ∈ logarithmicCellSet δ k, ‖g i‖ ≤ 1 := by intro i hi dsimp [g] rw [rough_test_logarithmic_proxy_eq_on_cell hL hi, Complex.norm_real, Real.norm_eq_abs] have hlo := (hu i).1 have hup := (hu i).2 unfold roughTestIndicator split <;> rw [abs_le] <;> constructor <;> linarith have hZB : Z ≤ Real.exp δ*Z := le_mul_of_one_le_left hZ.le (Real.one_le_exp hδ.le) have hcard : ((logarithmicCellSet δ k).card : ℝ) ≤ Real.exp δ*Z-Z+1 := by apply nat_finset_card_le_real_span _ hZB intro i hi exact ⟨(Nat.lt_of_floor_lt (mem_Ioc.mp hi).1).le, (Nat.cast_le.mpr (mem_Ioc.mp hi).2).trans (Nat.floor_le (by positivity))⟩ have hexp : Real.exp δ-1 ≤ 2*δ := by have he := Real.abs_exp_sub_one_le (show |δ| ≤ 1 by rwa [abs_of_pos hδ]) rw [abs_of_pos hδ] at he exact (le_abs_self _).trans he calc _ ≤ ∑ _i ∈ logarithmicCellSet δ k, (1 : ℝ) := sum_le_sum hnorm _ = ((logarithmicCellSet δ k).card : ℝ) := by simp only [sum_const, nsmul_eq_mul, mul_one] _ ≤ Real.exp δ*Z-Z+1 := hcard _ = (Real.exp δ-1)*Z+1 := by ring _ ≤ (2*δ)*Z+1 := by gcongr _ ≤ 4*δ*Y+1 := by nlinarith [mul_le_mul_of_nonneg_left hZsmall hδ.le] have hb := logarithmic_interval_cancellation_bound hδ m n g (M := 4*δ*Y+1) (by positivity) hzero hmass convert hb using 1 dsimp [δ, g] ring end Bounty end section /- Rank is exactly the sum of selected-child counts over original owners and groups. -/ open Finset Classical namespace Bounty theorem forest_rank_partition {n : ℕ} {O G : Type*} [Fintype O] [DecidableEq O] [Fintype G] [DecidableEq G] (code : BirthForestCode n) (owner : Fin n → O) (group : Fin n → G) : (∑ u, ∑ g, (univ.filter (fun i => owner i = u ∧ group i = g ∧ code i ≠ none)).card) = birthForestRank code := by have h := sum_card_fiberwise_eq_card_filter (univ.filter (fun i => code i ≠ none)) (univ : Finset (O × G)) (fun i => (owner i, group i)) simp only [mem_univ, filter_true] at h rw [Fintype.sum_prod_type] at h calc _ = ∑ u, ∑ g, ((univ.filter (fun i => code i ≠ none)).filter (fun i => (owner i, group i) = (u, g))).card := by apply sum_congr rfl intro u _ apply sum_congr rfl intro g _ congr 1 ext i simp only [mem_filter, mem_univ, true_and, Prod.mk.injEq] tauto _ = (univ.filter (fun i => code i ≠ none)).card := h _ = birthForestRank code := by rw [birthForestRank_eq_card_isSome] congr 1 ext i simp only [mem_filter, mem_univ, true_and] cases code i <;> simp end Bounty end section /- The actual chronological forest product has the fixed original selected-child exponents. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) section Ghost variable (j : J) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) (tail : FullPermutationMixedPath n S B A Δ D steps (fullPermutationMixedEventTarget n S B A Δ D (some (.inl j)) s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B (some (.inl j) :: steps)))) end Ghost section Edge variable (k : K) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) (tail : FullPermutationMixedPath n S B A Δ D steps (fullPermutationMixedEventTarget n S B A Δ D (some (.inr k)) s ((fullPermutationEdgeBirthEquiv (J := J) n S B A Δ D s k).symm ⟨sk, fresh⟩))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B (some (.inr k) :: steps)))) end Edge end Full end Bounty end section /- Uniform crude bounds for exponential roughness in logarithmic cells. -/ open Finset Filter namespace Bounty theorem exists_low_cutoff_rough_logarithmic_cell_upper {a : ℝ} (ha : 0 < a) : ∃ C : ℝ, 0 < C ∧ ∀ S : ℝ, ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ((roughBand Y (Real.exp (L^(-S))*Y) (Real.exp ((a/40)*L))).card : ℝ) ≤ C*(Real.exp (L^(-S))*Y-Y)/L := by obtain ⟨K, hK, hcount⟩ := exists_real_rough_integer_interval_count refine ⟨40*(K+1)/a+1, by positivity, ?_⟩ intro S have hb : 0 < 3*a/4 := by positivity filter_upwards [eventually_linear_exponential_profile_le_rpow hb hb K 0 (S+1), eventually_gt_atTop (0 : ℝ)] with L hprofile hL intro Y hY let len := Real.exp (L^(-S))*Y-Y let z := Real.exp ((a/40)*L) let V := ∏ p ∈ primeBand 0 z, (1-1/(p : ℝ)) have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hlen : 0 ≤ len := by have h := logarithmic_cell_length_lower (L := L) hY0.le S have hp : 0 ≤ Y*L^(-S) := by positivity exact hp.trans h have hz : 1 < z := Real.one_lt_exp_iff.mpr (by positivity) have hV0 : 0 ≤ V := (finite_prime_avoidance_product_pos _ (fun _ hp => (mem_filter.mp hp).2)).le have hVz : V ≤ 1/((a/40)*L) := full_prime_avoidance_exp_upper (by positivity) have hbase := hcount hY0.le (show Y ≤ Real.exp (L^(-S))*Y by linarith) hz (show 1 ≤ 2 by omega) (show Even 2 by decide) change |((roughBand Y (Real.exp (L^(-S))*Y) z).card : ℝ)-len*V| ≤ K*(len*V*Real.exp (-2)+z^(4*(2 : ℝ)+2)) at hbase rw [show 4*(2 : ℝ)+2 = 10 by norm_num] at hbase have he2 : Real.exp (-2) ≤ 1 := Real.exp_le_one_iff.mpr (by norm_num) have hrough : ((roughBand Y (Real.exp (L^(-S))*Y) z).card : ℝ) ≤ (K+1)*len*V+K*z^(10 : ℝ) := by have hh := (abs_le.mp hbase).2 have he := mul_le_mul_of_nonneg_left he2 (mul_nonneg hlen hV0) nlinarith have hz10 : z^(10 : ℝ) = Real.exp ((a/4)*L) := by dsimp [z] rw [← Real.exp_mul] congr 1 ring have herror : K*z^(10 : ℝ) ≤ len/L := by simp only [zero_mul, add_zero] at hprofile have hm := mul_le_mul_of_nonneg_left hprofile (Real.exp_pos (a*L)).le have heq : Real.exp (a*L)*(K*Real.exp (-(3*a/4)*L)) = K*Real.exp ((a/4)*L) := by calc _ = K*Real.exp (a*L+(-(3*a/4)*L)) := by rw [Real.exp_add]; ring _ = _ := by congr 2; ring rw [heq] at hm rw [hz10] apply hm.trans calc _ ≤ Y*L^(-(S+1)) := mul_le_mul_of_nonneg_right hY (by positivity) _ = (Y*L^(-S))/L := by rw [show -(S+1) = -S+(-1) by ring, Real.rpow_add hL, Real.rpow_neg_one] ring _ ≤ len/L := div_le_div_of_nonneg_right (logarithmic_cell_length_lower hY0.le S) hL.le have hmain := mul_le_mul_of_nonneg_left hVz (show 0 ≤ (K+1)*len by positivity) calc _ ≤ (K+1)*len*V+K*z^(10 : ℝ) := hrough _ ≤ (K+1)*len*(1/((a/40)*L))+len/L := add_le_add hmain herror _ = _ := by dsimp [len]; field_simp theorem exists_exponential_rough_logarithmic_cell_upper {a γ₀ : ℝ} (ha : 0 < a) (hγ₀ : 0 < γ₀) : ∃ C : ℝ, 0 < C ∧ ∀ S : ℝ, ∀ᶠ L : ℝ in atTop, ∀ γ : ℝ, γ₀ ≤ γ → ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ((roughBand Y (Real.exp (L^(-S))*Y) (Real.exp (γ*L))).card : ℝ) ≤ C*(Real.exp (L^(-S))*Y-Y)/L := by let a₀ := min a (40*γ₀) have ha₀ : 0 < a₀ := lt_min ha (by positivity) obtain ⟨C, hC, hbound⟩ := exists_low_cutoff_rough_logarithmic_cell_upper ha₀ refine ⟨C, hC, ?_⟩ intro S filter_upwards [hbound S, eventually_gt_atTop (0 : ℝ)] with L hb hL intro γ hγ Y hY have hY' : Real.exp (a₀*L) ≤ Y := (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right (min_le_left _ _) hL.le)).trans hY have hcut : Real.exp ((a₀/40)*L) ≤ Real.exp (γ*L) := by apply Real.exp_le_exp.mpr apply mul_le_mul_of_nonneg_right _ hL.le have hh : a₀ ≤ 40*γ₀ := min_le_right _ _ linarith exact (Nat.cast_le.mpr (card_le_card (rough_band_subset_of_cutoff hcut))).trans (hb Y hY') end Bounty end section /- The original full-path forest mask is exactly the conjunction of causal owner-stage conditions. -/ namespace Bounty section History variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps s) (history : Fin (Fintype.card (FullMixedBirthAddress S B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end History end Bounty end section /- Original reconstructed ghost and full auxiliary edge events write exactly their sampled primes. -/ namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedBirthAddress S B steps)) → Option (Sigma P)) section Ghost variable (j : J) (htag : steps.get u = some (.inl j)) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) end Ghost section Edge variable (k : K) (htag : steps.get u = some (.inr k)) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) end Edge end Full end Bounty end section /- The untouched edge row is the full original residual edge row, with initial avoidance. -/ open Finset Classical namespace Bounty end Bounty end section /- Two-sided small-slot averaging transfers reverse promotion rarity to literal mixed storage on the original small-state measure. -/ open Finset Classical namespace Bounty theorem exists_physical_small_big_storage_sandwich_energy_bound {q vs : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : G → ℕ) (shared : ∀ g, Finset (Fin (M g))) (B : ℕ) (Δ D : PhysicalSharedLists Ps J → SharedActiveLabels P shared → G → ℤ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (kbig : SharedActiveLabels P shared → ℤ) (Vs : S → ℝ), (∀ s, vs ≤ Vs s) → ∀ (aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ (T : ℕ), (∀ g, (shared g)ᶜ.card ≤ T) → ∀ (δ : ℝ), 0 ≤ δ → (∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), productTotalMemory s.2 ≤ B → (∑ σ : PhysicalPermutations S J ell, if physicalSmallBigEligible n shared B (fun d c g => -Δ d c g) D (physicalSmallBigPermutation σ s) then 1 / (Fintype.card (PhysicalPermutations S J ell) : ℝ) else 0) ≤ δ) → ∀ (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigAverage (physicalSmallBigStorageAction n shared B Δ D μ ρ V kbig Vs q aux (physicalSmallBigAverage F))) ≤ δ * (A ^ (2 * Fintype.card S) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_reverse_energy_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ intro S G _ dS _ dG cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ n _ J M shared B Δ D μ ρ V kbig Vs hVs aux v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht δ hδ hrare F hF let X := ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B let W : X → ℝ := productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)) let C : ℝ := A ^ (2 * Fintype.card S) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G let Rev := physicalSmallBigReverseAction (ell := ell) n shared B Δ D μ ρ V kbig Vs q aux let Sto := physicalSmallBigStorageAction (ell := ell) n shared B Δ D μ ρ V kbig Vs q aux have hVs0 : ∀ s, 0 < Vs s := fun s => hvs.trans_le (hVs s) have hW : ∀ x, 0 ≤ W x := productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1) have hC : 0 ≤ C := mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) (pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _) have hbase (f : PhysicalSmallBigState Ps J ell X → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s,x))) : physicalSmallBigEnergy Vs W (Rev f) ≤ C * physicalSmallBigEnergy Vs W f := by exact hbound S G Ps P n J M shared B Δ D μ ρ V kbig Vs hVs aux v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht f hf have hleft (f : PhysicalSmallBigState Ps J ell X → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s,x))) : physicalSmallBigEnergy Vs W (physicalSmallBigAverage (Rev f)) ≤ δ * C * physicalSmallBigEnergy Vs W f := by let π : PhysicalPermutations S J ell → ℝ := fun _ => 1 / (Fintype.card (PhysicalPermutations S J ell) : ℝ) let bad : PhysicalPermutations S J ell → PhysicalSmallBigState Ps J ell X → Prop := fun _ s => productTotalMemory s.2 ≤ B ∧ physicalSmallBigEligible n shared B (fun d c g => -Δ d c g) D s have hc : (Fintype.card (PhysicalPermutations S J ell) : ℝ) ≠ 0 := by exact_mod_cast (Fintype.card_ne_zero : Fintype.card (PhysicalPermutations S J ell) ≠ 0) have hm : ∑ σ, π σ ≤ 1 := by simp only [π, sum_const, card_univ, nsmul_eq_mul, one_div, mul_inv_cancel₀ hc, le_refl] have hh := physical_small_big_sparse_permutation_energy_le Vs hVs0 W hW π (by intro σ; exact one_div_nonneg.mpr (Nat.cast_nonneg _)) hm (fun σ => σ) (fun _ => True) bad (fun _ => Rev f) (by intro σ s hb by_cases hs : productTotalMemory s.2 ≤ B · apply physical_small_big_reverse_zero n shared B Δ D μ ρ V kbig Vs q aux f s exact fun he => hb ⟨hs, he⟩ · exact physical_small_big_full_zero_above_cap n shared B (fun d c g => -Δ d c g) D μ ρ V (fun c => -kbig c) Vs q 0 aux (fun _ => 1) (physicalSmallBigReversePhase n shared B Δ D V) f s hs) hδ hC (by intro s hsTrue by_cases hs : productTotalMemory s.2 ≤ B · have he : (∑ σ, @ite ℝ (bad σ (physicalSmallBigPermutation σ s)) (Classical.propDecidable _) (π σ) 0) = ∑ σ, if physicalSmallBigEligible n shared B (fun d c g => -Δ d c g) D (physicalSmallBigPermutation σ s) then π σ else 0 := by apply sum_congr rfl intro σ _ have hi : bad σ (physicalSmallBigPermutation σ s) ↔ physicalSmallBigEligible n shared B (fun d c g => -Δ d c g) D (physicalSmallBigPermutation σ s) := by exact and_iff_right hs simp only [hi] exact he.le.trans (hrare s hs) · have hz : (∑ σ, @ite ℝ (bad σ (physicalSmallBigPermutation σ s)) (Classical.propDecidable _) (π σ) 0) = 0 := by apply sum_eq_zero intro σ _ exact if_neg (fun hb => hs hb.1) exact hz.le.trans hδ) f (fun _ => hbase f hf) refine le_trans (le_of_eq ?_) hh apply congrArg (physicalSmallBigEnergy Vs W) funext s simp only [physicalSmallBigAverage, π, if_true, one_div, Complex.ofReal_inv, Complex.ofReal_natCast, mul_sum] have hrev (f : PhysicalSmallBigState Ps J ell X → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s,x))) : physicalSmallBigEnergy Vs W (physicalSmallBigAverage (Rev (physicalSmallBigAverage f))) ≤ δ * C * physicalSmallBigEnergy Vs W f := (hleft (physicalSmallBigAverage f) (physical_small_big_average_memory_symmetric f hf)).trans (mul_le_mul_of_nonneg_left (physical_small_big_average_energy_le Vs hVs0 W hW f) (mul_nonneg hδ hC)) have h := finite_symmetric_transpose_energy_le (physicalSmallBigMeasure Vs W) (physical_small_big_measure_nonneg Vs hVs0 W hW) (fun f : PhysicalSmallBigState Ps J ell X → ℂ => ∀ s, ProductMemorySymmetric (fun x => f (s,x))) (fun f => physicalSmallBigAverage (Sto (physicalSmallBigAverage f))) (fun f => physicalSmallBigAverage (Rev (physicalSmallBigAverage f))) (by intro f hf s x g σ; exact congrArg (starRingEnd ℂ) (hf s x g σ)) (by intro f hf exact physical_small_big_average_memory_symmetric _ (physical_small_big_storage_memory_symmetric n shared B Δ D μ ρ V kbig Vs q aux _ (physical_small_big_average_memory_symmetric f hf))) (by intro f g hf hg apply physical_small_big_average_sandwich_pairing Vs W Sto Rev f g exact physical_small_big_storage_pairing n shared B Δ D μ ρ V kbig Vs hVs0 q aux (fun g => (hvmin.trans_le (hVlo g)).ne') _ _ (physical_small_big_average_memory_symmetric f hf) (physical_small_big_average_memory_symmetric g hg)) (mul_nonneg hδ hC) (by intro f hf simpa only [physical_small_big_energy_eq] using hrev f hf) F hF simp only [physical_small_big_energy_eq] at h convert h using 1 <;> congr 2 end Bounty end section /- Uniform logarithmic displacement of an actual cofactor cell under fixed product bounds. -/ open Real namespace Bounty theorem cofactor_logarithmic_cell_distance {L S cLo cHi : ℝ} (hL : 1 ≤ L) (hS : 0 ≤ S) (hcLo : 0 < cLo) (hcHi : 0 < cHi) {p m : ℕ} (hp : 0 < p) (hm : 0 < m) (hlo : cLo*exp L ≤ (p : ℝ)*(m : ℝ)) (hhi : (p : ℝ)*(m : ℝ) ≤ cHi*exp L) : |(logarithmicCellIndex (L^(-S)) m : ℝ)*L^(-S)/L - (1-log (p : ℝ)/L)| ≤ (|log cLo|+|log cHi|+1)/L := by have hL0 : 0 < L := zero_lt_one.trans_le hL have hp0 : 0 < (p : ℝ) := Nat.cast_pos.mpr hp have hm0 : 0 < (m : ℝ) := Nat.cast_pos.mpr hm have hloglo := log_le_log (mul_pos hcLo (exp_pos L)) hlo have hloghi := log_le_log (mul_pos hp0 hm0) hhi rw [log_mul hcLo.ne' (exp_ne_zero _), log_exp, log_mul hp0.ne' hm0.ne'] at hloglo rw [log_mul hp0.ne' hm0.ne', log_mul hcHi.ne' (exp_ne_zero _), log_exp] at hloghi have hδ : 0 < L^(-S) := rpow_pos_of_pos hL0 _ have hδ1 : L^(-S) ≤ 1 := rpow_le_one_of_one_le_of_nonpos hL (neg_nonpos.mpr hS) obtain ⟨hl,hu⟩ := logarithmic_cell_index_bounds hδ m have hn : |(logarithmicCellIndex (L^(-S)) m : ℝ)*L^(-S)+log (p : ℝ)-L| ≤ |log cLo|+|log cHi|+1 := by apply abs_le.mpr constructor · linarith [neg_abs_le (log cLo), abs_nonneg (log cHi)] · linarith [le_abs_self (log cHi), abs_nonneg (log cLo)] have hid : (logarithmicCellIndex (L^(-S)) m : ℝ)*L^(-S)/L - (1-log (p : ℝ)/L) = ((logarithmicCellIndex (L^(-S)) m : ℝ)*L^(-S)+log (p : ℝ)-L)/L := by field_simp ring rw [hid, abs_div, abs_of_pos hL0] exact div_le_div_of_nonneg_right hn hL0.le theorem prime_band_logarithmic_exponent_bounds {a v L : ℝ} (hL : 0 < L) {p : ℕ} (hp : p ∈ primeBand (exp (a*L)) (exp (v*L))) : a ≤ log (p : ℝ)/L ∧ log (p : ℝ)/L ≤ v := by obtain ⟨hpp,hlo,hhi⟩ := (mem_primeBand_iff (exp_pos _).le (exp_pos _).le p).mp hp have hpl := log_le_log (exp_pos (a*L)) hlo.le have hpu := log_le_log (Nat.cast_pos.mpr hpp.pos) hhi rw [log_exp] at hpl hpu exact ⟨(le_div_iff₀ hL).mpr hpl, (div_le_iff₀ hL).mpr hpu⟩ end Bounty end section /- Exact proxy subtraction with the remaining candidate-weighted replacement errors explicit. -/ open Finset namespace Bounty end Bounty end section /- Exact shifted Buchstab mesh decomposition with explicit proxy replacement error. -/ open Finset Real namespace Bounty noncomputable def shiftedBuchstabUnbalancedPairs (T : Finset ℕ) (b q L : ℝ) : Finset (ℕ × ℕ) := by classical exact (shiftedBuchstabPairs T (exp (b*L))).filter (fun v => (v.1 : ℝ) ≤ exp (q*L)) noncomputable def shiftedBuchstabBalancedPairs (T : Finset ℕ) (b q L : ℝ) : Finset (ℕ × ℕ) := by classical exact (shiftedBuchstabPairs T (exp (b*L))).filter (fun v => ¬(v.1 : ℝ) ≤ exp (q*L)) noncomputable def shiftedBuchstabMeshBin (T : Finset ℕ) (b q L : ℝ) (N i : ℕ) : Finset (ℕ × ℕ) := primeGridPairBin b q N L (shiftedBuchstabUnbalancedPairs T b q L) i theorem mem_shifted_buchstab_unbalanced_pairs {T : Finset ℕ} {b q L : ℝ} {v : ℕ × ℕ} : v ∈ shiftedBuchstabUnbalancedPairs T b q L ↔ v ∈ shiftedBuchstabPairs T (exp (b*L)) ∧ (v.1 : ℝ) ≤ exp (q*L) := by classical exact mem_filter theorem mem_shifted_buchstab_balanced_pairs {T : Finset ℕ} {b q L : ℝ} {v : ℕ × ℕ} : v ∈ shiftedBuchstabBalancedPairs T b q L ↔ v ∈ shiftedBuchstabPairs T (exp (b*L)) ∧ exp (q*L) < (v.1 : ℝ) := by classical simp only [shiftedBuchstabBalancedPairs, mem_filter, not_le] theorem mem_shifted_buchstab_mesh_bin {T : Finset ℕ} {b q L : ℝ} {N i : ℕ} {v : ℕ × ℕ} : v ∈ shiftedBuchstabMeshBin T b q L N i ↔ v ∈ shiftedBuchstabUnbalancedPairs T b q L ∧ v.1 ∈ primeBand (exp (reciprocalGrid b q N i*L)) (exp (reciprocalGrid b q N (i+1)*L)) := mem_prime_grid_pair_bin theorem shifted_buchstab_unbalanced_prime_band (T : Finset ℕ) (b q L : ℝ) (hT : ∀ u ∈ T, 0 < u) {v : ℕ × ℕ} (hv : v ∈ shiftedBuchstabUnbalancedPairs T b q L) : v.1 ∈ primeBand (exp (b*L)) (exp (q*L)) := by obtain ⟨hv,hcut⟩ := mem_shifted_buchstab_unbalanced_pairs.mp hv have hp := shifted_buchstab_pair_properties T (exp (b*L)) hT hv exact (mem_primeBand_iff (exp_pos _).le (exp_pos _).le v.1).mpr ⟨hp.1,hp.2.2.2.2.1,hcut⟩ theorem weighted_shifted_buchstab_mesh_identity {M : Type*} [AddCommMonoid M] (T : Finset ℕ) (μ : ℕ → M) {b q L : ℝ} (hbq : b ≤ q) (hL : 0 ≤ L) {N : ℕ} (hN : 0 < N) (hT : ∀ u ∈ T, 0 < u) : (∑ u ∈ shiftedRoughSet T (exp (b*L)), μ u) = (∑ u ∈ (shiftedRoughSet T (exp (b*L))).filter (fun u => (2*u+1).Prime), μ u)+ (∑ i : Fin N, ∑ v ∈ shiftedBuchstabMeshBin T b q L N i, μ (shiftedPairIndex v))+ ∑ v ∈ shiftedBuchstabBalancedPairs T b q L, μ (shiftedPairIndex v) := by classical have hparts := sum_filter_add_sum_filter_not (shiftedBuchstabPairs T (exp (b*L))) (fun v => (v.1 : ℝ) ≤ exp (q*L)) (fun v => μ (shiftedPairIndex v)) have hmesh := sum_pairs_eq_sum_prime_grid_bins hbq hL hN (shiftedBuchstabUnbalancedPairs T b q L) (fun v => μ (shiftedPairIndex v)) (fun v hv => shifted_buchstab_unbalanced_prime_band T b q L hT hv) change (∑ v ∈ shiftedBuchstabUnbalancedPairs T b q L, μ (shiftedPairIndex v))+ (∑ v ∈ shiftedBuchstabBalancedPairs T b q L, μ (shiftedPairIndex v)) = ∑ v ∈ shiftedBuchstabPairs T (exp (b*L)), μ (shiftedPairIndex v) at hparts change (∑ v ∈ shiftedBuchstabUnbalancedPairs T b q L, μ (shiftedPairIndex v)) = ∑ i : Fin N, ∑ v ∈ shiftedBuchstabMeshBin T b q L N i, μ (shiftedPairIndex v) at hmesh rw [weighted_shifted_buchstab_pair_identity, ← hparts, hmesh, add_assoc] end Bounty end section /- Group the actual full-edge sampled forest costs by their original prime groups. -/ open Finset Classical namespace Bounty theorem full_edge_grouped_restricted_continuation_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {M : G → ℕ} (S : ∀ g, Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) (Δ D : ∀ c, A c → G → ℤ) (ω : ∀ c, A c → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n S B A Δ D s) {m : ℕ} (ord : Fin m ≃ FullActiveEdgeSampleIndex n S B A Δ D s sk) {Q : ℕ} (f : FullActiveEdgeSampleIndex n S B A Δ D s sk → Fin Q) (code : BirthForestCode Q) (history : Fin Q → Option (Sigma P)) (d : G → ℕ) (hvalid : ∀ i, restrictedBirthAnchors (f ∘ ord) code history i ≠ some none) (hd : ∀ g, (univ.filter (fun i : {i : Fin (S g)ᶜ.card // i ∉ (sk.2 g).2.1} => code (f ⟨g, i⟩) ≠ none)).card = d g) (η : G → ℝ) (hη : ∀ g, 0 ≤ η g) (hμ : ∀ g p, 0 ≤ μ g p) (hμatom : ∀ g p, μ g p ≤ η g) (v L : ℝ) (hv : 0 ≤ v) (hL : 0 ≤ L) (F : FullActiveEdgeSamples n S B A Δ D s sk → ℝ) (hF : ∀ fresh, F fresh ≤ L * productLengthLyapunov v (fullActiveEdgeEventTarget n S B A Δ D s ((fullActiveEdgeSkeletonEquiv n S B A Δ D s).symm ⟨sk, fresh⟩))) : (∑ fresh : FullActiveEdgeSamples n S B A Δ D s sk, if birthForestEqualValues (restrictedBirthCode (f ∘ ord) code) (fun j => (⟨(ord j).1, fresh (ord j)⟩ : Sigma P)) ∧ birthLabelsAnchored (fun i => (restrictedBirthAnchors (f ∘ ord) code history i).join) (fun j => (⟨(ord j).1, fresh (ord j)⟩ : Sigma P)) then |fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V s ((fullActiveEdgeSkeletonEquiv n S B A Δ D s).symm ⟨sk, fresh⟩)| * F fresh else 0) ≤ fullActiveEdgeSkeletonAbsMass n S B A Δ D ω ρ V s sk * (L * v ^ (∑ g, unrestrictedSkeletonOutputCount (n g) (Δ (productActiveMemorySplit S B s).1 sk.1 g) (D (productActiveMemorySplit S B s).1 sk.1 g) (S g)ᶜ.card B ((productActiveMemorySplit S B s).2 g) (sk.2 g))) * ∏ g, η g ^ d g * (∑ p, μ g p) ^ ((S g)ᶜ.card - (sk.2 g).2.1.card - d g) := by have hb := full_edge_forest_continuation_le n S B A Δ D ω μ ρ V s sk ord (restrictedBirthCode (f ∘ ord) code) (fun i => (restrictedBirthAnchors (f ∘ ord) code history i).join) η hη hμ hμatom v L hv hL F hF have hc := grouped_join_restricted_forest_cost_eq (fun g => {i : Fin (S g)ᶜ.card // i ∉ (sk.2 g).2.1}) ord f code history (fun g => ∑ p, μ g p) η d hvalid hd refine le_trans (le_of_eq ?_) (le_trans hb (le_of_eq ?_)) · apply sum_congr rfl intro fresh _ split_ifs <;> rfl · congr 1 convert hc using 1 · apply prod_congr rfl intro i _ cases restrictedBirthCode (f ∘ ord) code i <;> cases (restrictedBirthAnchors (f ∘ ord) code history i).join <;> rfl · simp only [Fintype.card_subtype_compl, Fintype.card_fin, Fintype.card_coe] end Bounty end section /- Original full dilation is recovered from the actual restricted encoded big state. -/ open scoped Classical namespace Bounty section Restrict variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell B : ℕ} (small : G → Prop) (C : G → Finset (Fin J)) (hC : ∀ g, small g → C g = ∅) (aux : PhysicalAuxLabels P C) (L : PhysicalMarkLists P J ell) {Z : {g : G // ¬small g} → Type*} (q : ∀ g, BoundedOrderedTuple (Z g) B) end Restrict section Endpoint variable {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (small : G → Prop) (C : G → Finset (Fin J)) (hC : ∀ g, small g → C g = ∅) {L R : PhysicalMarkLists P J ell} (h : physicalSharedCompatible C L R) end Endpoint end Bounty end section /- The actual mixed divisor, displacement and small-residue step in canonical full-memory coordinates. The small shared product stays in the divisor. -/ open scoped Classical namespace Bounty noncomputable def canonicalMixedEdgeD {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (d : PhysicalSharedLists Ps J) (c : SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) C)) (aux : PhysicalAuxLabels P C) (_g : G) : ℤ := (physicalSharedProduct d * cleanFullSharedD C c aux : ℕ) noncomputable def canonicalMixedEdgeDelta {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (k : ℤ) (d : PhysicalSharedLists Ps J) (c : SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) C)) (aux : PhysicalAuxLabels P C) (_g : G) : ℤ := -cleanFullSharedStep k C c aux d section variable {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) (aux : PhysicalAuxLabels P C) theorem physical_mixed_clean_D_reencode : physicalMixedEdgeD C d (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (fullActivePermutation (cleanPhysicalSlotChange C) x)).1 aux = canonicalMixedEdgeD C d (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 aux := by funext g unfold physicalMixedEdgeD physicalMixedSharedD canonicalMixedEdgeD rw [clean_physical_shared_D_reencode] theorem physical_mixed_clean_delta_reencode (k : ℤ) : physicalMixedEdgeDelta C k d (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (fullActivePermutation (cleanPhysicalSlotChange C) x)).1 aux = canonicalMixedEdgeDelta C k d (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 aux := by funext g unfold physicalMixedEdgeDelta rw [physical_mixed_clean_D_reencode] unfold canonicalMixedEdgeD canonicalMixedEdgeDelta cleanFullSharedStep rw [Nat.cast_mul] ring theorem physical_mixed_clean_step_reencode (k : ℤ) : physicalMixedBigStep C k (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (fullActivePermutation (cleanPhysicalSlotChange C) x)).1 aux * (physicalSharedProduct d : ℕ) = cleanFullSharedStep k C (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 aux d := by unfold physicalMixedBigStep cleanFullSharedStep rw [clean_physical_shared_D_reencode] end end Bounty end section /- The determinant reindexing uses only the actual nonzero coefficient support. -/ open Finset namespace Bounty theorem typeII_off_diagonal_energy_restrict_support (E N M H : Finset ℕ) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) : typeIIOffDiagonalEnergy E N M H η α aH = typeIIOffDiagonalEnergy E N (M.filter (fun m => α m ≠ 0)) H η α aH := by classical unfold typeIIOffDiagonalEnergy simp only [sum_product, sum_filter, mul_sum] apply sum_congr rfl intro e he apply sum_congr rfl intro n hn apply sum_congr rfl intro m hm by_cases hzero : α m = 0 · simp [hzero, typeIIEquationTerm] · simp only [ne_eq, hzero, not_false_eq_true, if_true, mul_sum] apply sum_congr rfl intro h hh apply sum_congr rfl intro m' hm' by_cases hzero' : α m' = 0 · simp [hzero', typeIIEquationTerm] · simp only [hzero', not_false_eq_true, if_true, mul_sum] theorem typeII_off_diagonal_energy_eq_supported_determinant_sum (E N M H : Finset ℕ) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) {Elo U W : ℝ} {B : ℕ} (hElo : 0 < Elo) (hE : ∀ e ∈ E, Elo ≤ (e : ℝ)) (hM : ∀ m ∈ M, (m : ℝ) ≤ U) (hB : U / (2 * Elo) ≤ B) (hBW : (B : ℝ) ≤ W) (hrough : ∀ m ∈ M, α m ≠ 0 → ∀ p ∈ m.primeFactors, W < (p : ℝ)) : typeIIOffDiagonalEnergy E N M H η α aH = ∑ y ∈ typeIIDeterminantDomain E N (M.filter (fun m => α m ≠ 0)) H (Icc (-(B : ℤ)) B) (Icc 0 ((M.filter (fun m => α m ≠ 0)).sup id * H.sup id)), typeIIShiftWeight η α aH y := by classical rw [typeII_off_diagonal_energy_restrict_support] apply typeII_off_diagonal_energy_eq_bounded_determinant_sum _ _ _ _ _ _ _ hElo hE (fun m hm => hM m (mem_filter.mp hm).1) hB hBW intro m hm exact hrough m (mem_filter.mp hm).1 (mem_filter.mp hm).2 end Bounty end section /- Actual local bounds for the positive mixed path event operators. Ghost births and edge birth parameters remain separate. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : K → Type) [∀ k, Fintype (A k)] (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) theorem physical_small_big_path_positive_edge_symmetric [DecidableEq S] (hVs : ∀ s, 0 < Vs s) (hω : ∀ k a, 0 ≤ ω k a) (hμ : ∀ g p, 0 ≤ μ g p) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ Vedge g) (k : K) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hF : ∀ s, ProductMemorySymmetric (fun x => F (s, x))) : ∀ s, ProductMemorySymmetric (fun x => physicalSmallBigPathPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall (some (.inr k)) F (s, x)) := by rw [physical_small_big_path_positive_edge_eq n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall hVs hω hμ hρ hV k F] intro s x g σ dsimp only apply sum_congr rfl intro a _ apply congrArg (fun z : ℂ => (ω k a : ℂ) * z) exact physical_small_big_full_positive_memory_symmetric n (shared k) B (fun d c => Δ k d c a) (fun d c => D k d c a) μ ρ Vedge (fun c => kbig k c a) Vs qsmall F hF s x g σ end theorem exists_physical_small_big_path_edge_energy_bound {qsmall vs : ℝ} (hq0 : 0 ≤ qsmall) (hq1 : qsmall < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ Ccond : ℝ, 1 ≤ Ccond ∧ ∀ (H K S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : G → ℕ) (shared : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : K → Type) [∀ k, Fintype (A k)] (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ), (∀ s, vs ≤ Vs s) → (∀ k a, 0 ≤ ω k a) → (∀ k, ∑ a, ω k a ≤ 1) → ∀ (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ Vedge g) → (∀ g, Vedge g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ (T : ℕ), (∀ k g, (shared k g)ᶜ.card ≤ T) → ∀ (k : K) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigPathPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall (some (.inr k)) F) ≤ Ccond ^ (2 * Fintype.card S) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨Ccond, hCcond, hbound⟩ := exists_physical_small_big_phased_energy_bound hq0 hq1 hvs ell refine ⟨Ccond, hCcond, ?_⟩ intro H K S G _ dS _ dG cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ n _ J M shared B A _ Δ D kbig ω μ qghost ρ Vedge Vghost Vs hVs hω hωmass v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht k F hF have hVs' : ∀ s, 0 < Vs s := fun s => hvs.trans_le (hVs s) rw [physical_small_big_path_positive_edge_eq n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall hVs' hω hμ hρ0.le (fun g => (hvmin.trans_le (hVlo g)).le) k F] apply physical_small_big_auxiliary_energy_bound Vs hVs' (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1)) (ω k) (hω k) (hωmass k) _ F _ · exact mul_nonneg (pow_nonneg (zero_le_one.trans hCcond) _) (pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _) · intro a let aux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J))) := fun _ j => False.elim (notMem_empty j.val j.property) have hh := hbound S G Ps P n J M (shared k) B (fun d c => Δ k d c a) (fun d c => D k d c a) μ ρ Vedge (fun c => kbig k c a) Vs hVs aux v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T (ht k) (fun _ _ => 1) 1 zero_le_one (by intros; simp only [norm_one, le_refl]) F hF simp only [one_pow, one_mul] at hh convert hh using 1 end Bounty end section /- Whole-path energy follows from the actual positive local actions. Only the positive comparison must preserve pending symmetry; a bounded signed phase may inspect the complete path. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Exact moving-small-state transport between big-memory caps. -/ open Finset Classical namespace Bounty section variable {H K S G : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (A : K → Type) (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) {b B : ℕ} (h : b ≤ B) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k, Fintype (A k)] (steps : List (Option (H ⊕ K))) (phase : ∀ s, PhysicalSmallBigPath (ell := ell) n shared B A Δ D kbig steps s → ℂ) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) end end Bounty end section /- Exact marking of ghost births with moving small states. Edge weights, residue shifts, and all cap indicators are unchanged. -/ open Finset Classical namespace Bounty section variable {H K S G : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : K → Type) (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qsmall a : ℝ) end end Bounty end section /- Actual normalized majorants on the logarithmic Type-II scale box. -/ open MeasureTheory namespace Bounty theorem typeII_e_majorant_normalized_support {L e E : ℝ} (hL : 0 < L) (hnz : typeIIEMajorant (L ^ 88) (e / E) ≠ 0) : e / E ∈ Set.Ioo ((L ^ 88)⁻¹ / 2) 2 := by have hlo : 1 < 2 * L ^ 88 * (e / E) := lt_of_not_ge (fun h => hnz (typeII_e_majorant_eq_zero (Or.inl h))) have hhi : e / E < 2 := lt_of_not_ge (fun h => hnz (typeII_e_majorant_eq_zero (Or.inr h))) refine ⟨?_, hhi⟩ have hp : 0 < L ^ 88 := pow_pos hL _ have hinv : (L ^ 88) * (L ^ 88)⁻¹ = 1 := mul_inv_cancel₀ hp.ne' nlinarith theorem typeII_n_majorant_normalized_support {n V : ℝ} (hnz : typeIINMajorant (n / V) ≠ 0) : n / V ∈ Set.Ioo (1 / 2) 3 := by have hlo : 1 < 2 * (n / V) := lt_of_not_ge (fun h => hnz (typeII_n_majorant_eq_zero (Or.inl h))) have hhi : n / V < 3 := lt_of_not_ge (fun h => hnz (typeII_n_majorant_eq_zero (Or.inr h))) exact ⟨by linarith, hhi⟩ theorem typeII_scaled_exp_log {m U : ℝ} (hm : 0 < m) (hU : 0 < U) : U * Real.exp (Real.log (m / U)) = m := by rw [Real.exp_log (div_pos hm hU)] field_simp theorem typeII_scale_log_pulled_coordinates {m m' z U V E Z k : ℝ} (hm : 0 < m) (hm' : 0 < m') (hz : 0 < z) (hU : 0 < U) (hV : 0 < V) (hZ : 0 < Z) (hk : k ≠ 0) : typeIIPulledE (U / (2 * k * E)) (typeIILogCoordinates ![m, m', z] ![U, U, Z]) = ((m' - m) / (2 * k)) / E ∧ typeIIPulledN (Z / (k * U * V)) (1 / (U * V)) (typeIILogCoordinates ![m, m', z] ![U, U, Z]) = ((m' - m) * z / (k * m * m') + 1 / m) / V := by have he := typeII_normalized_e_log_coordinates U E k (Real.log (m / U)) (Real.log (m' / U)) have hn := typeII_normalized_n_log_coordinates U V Z k (Real.log (m / U)) (Real.log (m' / U)) (Real.log (z / Z)) hU.ne' hV.ne' hk rw [typeII_scaled_exp_log hm hU, typeII_scaled_exp_log hm' hU] at he rw [typeII_scaled_exp_log hm hU, typeII_scaled_exp_log hm' hU, typeII_scaled_exp_log hz hZ] at hn exact ⟨he.symm, hn.symm⟩ theorem typeII_scale_log_cutoff_eq_majorants {A L m m' z U V E Z k : ℝ} (hm : 0 < m) (hm' : 0 < m') (hz : 0 < z) (hU : 0 < U) (hV : 0 < V) (hZ : 0 < Z) (hk : k ≠ 0) (hbox : ∀ i, (typeIILogCoordinates ![m, m', z] ![U, U, Z]) i ∈ Set.Icc (-A) A) : typeIIPulledCutoff A (L ^ 88) (U / (2 * k * E)) (Z / (k * U * V)) (1 / (U * V)) (typeIILogCoordinates ![m, m', z] ![U, U, Z]) = typeIIEMajorant (L ^ 88) (((m' - m) / (2 * k)) / E) * typeIINMajorant (((m' - m) * z / (k * m * m') + 1 / m) / V) := by obtain ⟨he, hn⟩ := typeII_scale_log_pulled_coordinates (E := E) hm hm' hz hU hV hZ hk rw [typeIIPulledCutoff, typeII_three_localizer_eq_one hbox, one_mul, he, hn] end Bounty end section /- Exact Fourier integral of each valid candidate allocation pattern. -/ open Finset MeasureTheory namespace Bounty noncomputable def candidateAllocationFourierTwist (c L : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (slot : (candidateQIndices c L) × Fin r) (n : ℕ) : ℂ := ((n : ℝ) : ℂ) ^ ((orderedSlotFrequency (fun i => if take i then 1 else 0) (activeAllocationFrequencyInput (candidateAllocationActive c L r jStar) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) ξ) ((candidateAllocationOrder c L r).symm slot) : ℂ) * Complex.I) noncomputable def candidateAllocationFourierScalar (c L : ℝ) (r jStar : ℕ) (R : ℝ) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) : ℂ := Complex.exp (Complex.I * ((R * ∑ i, activeAllocationFrequencyInput (candidateAllocationActive c L r jStar) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) ξ i : ℝ) : ℂ)) noncomputable def candidateSeparatedAllocationIntegrand (c L : ℝ) (r jStar : ℕ) (R : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (F : ℕ → ℕ → ℂ) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) : ℂ := candidateAllocationFourierScalar c L r jStar R ξ * (∑ e ∈ orderedSlotProductSupport (fun slot : CandidateTakenSlot c L r take => candidateQSlotChoices c L r jStar slot.val), ∑ h ∈ orderedSlotProductSupport (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val), candidateTakenComplexCoefficient c L r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) e * candidateRemainingComplexCoefficient c L r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) h * F e h) * activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ theorem candidate_allocation_fourier_scalar_norm (c L : ℝ) (r jStar : ℕ) (R : ℝ) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) : ‖candidateAllocationFourierScalar c L r jStar R ξ‖ = 1 := Complex.norm_exp_I_mul_ofReal _ theorem candidate_allocation_fourier_twist_norm (c L : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (slot : (candidateQIndices c L) × Fin r) {n : ℕ} (hn : 0 < n) : ‖candidateAllocationFourierTwist c L r jStar take ξ slot n‖ = 1 := by unfold candidateAllocationFourierTwist rw [Complex.norm_cpow_eq_rpow_re_of_pos (by exact_mod_cast hn)] simp theorem candidate_allocation_integrand_separated (c L : ℝ) (r jStar : ℕ) (R : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) : activeAllocationFourierIntegrand (candidateAllocationRadius r) R (fun i => Real.log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) take ξ = (candidateAllocationFourierScalar c L r jStar R ξ * ∏ slot, candidateAllocationFourierTwist c L r jStar take ξ slot (x slot).val) * activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ := by rw [active_allocation_prime_powers_separated (candidateAllocationRadius r) R (fun i => (candidateAllocationValue c L r jStar x i : ℝ)) _ (fun i => by exact_mod_cast candidate_allocation_value_pos c L r jStar x i)] congr 2 apply Fintype.prod_equiv (candidateAllocationOrder c L r) intro i simp only [candidateAllocationFourierTwist, Equiv.symm_apply_apply, candidateAllocationValue] theorem candidate_separated_allocation_integrand_eq (c L : ℝ) (r jStar : ℕ) (R : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (F : ℕ → ℕ → ℂ) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) : (∑ x : ∀ slot, candidateQSlotChoices c L r jStar slot, activeAllocationFourierIntegrand (candidateAllocationRadius r) R (fun i => Real.log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) take ξ * F (candidateAllocatedFactor c L r jStar x take) (candidateRetainedFactor c L r jStar 1 x take)) / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ) = candidateSeparatedAllocationIntegrand c L r jStar R take F ξ := by simp_rw [candidate_allocation_integrand_separated] unfold candidateSeparatedAllocationIntegrand rw [← candidate_slot_twisted_split_bivariate_test] simp only [sum_div, mul_sum, sum_mul] apply sum_congr rfl intro x hx ring end Bounty end section /- A small shared product has no prime factor in a disjoint big pool. -/ open Finset open scoped Classical namespace Bounty section Arithmetic variable {S G : Type*} [Fintype S] {Ps : S → Finset ℕ} {P : G → Finset ℕ} (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) {J : ℕ} (d : PhysicalSharedLists Ps J) include hPs hP hdis in theorem physical_big_prime_not_dvd_small_shared (g : G) (p : ↥(P g)) : ¬p.val ∣ physicalSharedProduct d := by intro hd have hp := hP g p.val p.property obtain ⟨s, _, hs⟩ := (hp.prime.dvd_finsetProd_iff _).mp hd obtain ⟨j, _, hj⟩ := (hp.prime.dvd_finsetProd_iff _).mp hs have he : p.val = (d s j).val := ((Nat.dvd_prime (hPs s _ (d s j).property)).mp hj).resolve_left hp.ne_one exact disjoint_left.mp (hdis s g) (d s j).property (he ▸ p.property) include hPs hP hdis in theorem physical_big_prime_dvd_small_mul_iff (g : G) (p : ↥(P g)) (D : ℕ) : ((p.val : ℤ) ∣ ((physicalSharedProduct d * D : ℕ) : ℤ)) ↔ (p.val : ℤ) ∣ (D : ℤ) := by have hn := physical_big_prime_not_dvd_small_shared hPs hP hdis d g p have hh : p.val ∣ physicalSharedProduct d * D ↔ p.val ∣ D := by rw [(hP g p.val p.property).dvd_mul] exact or_iff_right hn exact_mod_cast hh end Arithmetic section Mixed variable {S : Type*} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) (C : Fin N → Finset (Fin J)) (d : PhysicalSharedLists Ps J) include hPs hP hdis in theorem physical_mixed_dilation_divisibility (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) (g : Fin N) (p : ↥(P g)) : (p.val : ℤ) ∣ physicalMixedEdgeD C d c aux g ↔ (p.val : ℤ) ∣ physicalFullEdgeD C c aux g := by exact physical_big_prime_dvd_small_mul_iff hPs hP hdis d g p (physicalFullSharedD C c aux) theorem physical_mixed_delta_effective_big_step (k : ℤ) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) (g : Fin N) : physicalMixedEdgeDelta C k d c aux g = physicalFullEdgeDelta C (k * (physicalSharedProduct d : ℕ)) c aux g := by unfold physicalMixedEdgeDelta physicalMixedEdgeD physicalMixedSharedD physicalFullEdgeDelta physicalFullEdgeD push_cast ring end Mixed end Bounty end section /- Full compact allocation differs from the original test by one actual large-P tail. -/ open Finset Filter Real namespace Bounty theorem exists_candidate_compact_rough_test_reduction {c b q : ℝ} (hc : 0 < c) (hb : 0 < b) (hq0 : 0 ≤ q) (hq1 : q < 1) {r : ℕ} (hr : 6 ≤ r) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ A D : ℝ, ∀ᶠ L : ℝ in atTop, ∀ (E : ℝ) (F : ℕ → ℕ → ℂ), 1 ≤ E → log E ≤ (1-b)*L → (∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ roughDivisors (exp (sqrt L)) (2*u+1), ‖F u m‖ ≤ L^A) → ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCoefficient c L q r jStar u : ℂ)* ∑ m ∈ roughDivisors (exp (sqrt L)) (2*u+1), F u m) - ∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCompactRangeCoefficient c L q r jStar E u : ℂ)* ∑ m ∈ roughDivisors (exp (sqrt L)) (2*u+1), F u m‖ ≤ exp L*L^(-D) := by obtain ⟨J,hJ⟩ := exists_candidate_rough_slot_scale (c := c) hb refine ⟨J,?_⟩ intro jStar hj A D filter_upwards [eventually_candidate_compact_range_exact hc hb hr jStar (hJ jStar hj), eventually_candidate_large_P_rough_power_saving hc hq0 hq1 (show 0 < b/4 by positivity) r jStar (D+A), eventually_gt_atTop (0 : ℝ)] with L hgood htail hL intro E F hE hlogE hF have hbound := norm_weighted_fiber_deficit_le (arithmeticProductWindow 1 (exp L)) (fun u => roughDivisors (exp (sqrt L)) (2*u+1)) (fun u => exp (b/4*L) < (primePoolPart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u : ℝ)) (candidateCoefficient c L q r jStar) (candidateCompactRangeCoefficient c L q r jStar E) F (L^A) (rpow_nonneg hL.le _) (fun u hu => (candidate_compact_range_coefficient_bounds c L hq0 r jStar E u).1) (fun u hu => (candidate_compact_range_coefficient_bounds c L hq0 r jStar E u).2) (fun u hu hnot => hgood E q hE hlogE u hu (le_of_not_gt hnot)) hF calc _ ≤ L^A*candidateLargePRoughDivisorMass c L q r jStar (exp (b/4*L)) := hbound _ ≤ L^A*(exp L*L^(-(D+A))) := mul_le_mul_of_nonneg_left htail (rpow_nonneg hL.le _) _ = exp L*L^(-D) := by rw [mul_left_comm, ← rpow_add hL] congr 2 ring theorem exists_candidate_compact_divisor_test_reduction {c b q : ℝ} (hc : 0 < c) (hb : 0 < b) (hq0 : 0 ≤ q) (hq1 : q < 1) {r : ℕ} (hr : 6 ≤ r) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ A D : ℝ, ∀ᶠ L : ℝ in atTop, ∀ (E : ℝ) (F : ℕ → ℕ → ℂ), 1 ≤ E → log E ≤ (1-b)*L → (∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → (∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ¬(∀ p ∈ m.primeFactors, exp (sqrt L) ≤ (p : ℝ)) → F u m = 0) → ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCoefficient c L q r jStar u : ℂ)*∑ m ∈ (2*u+1).divisors, F u m) - ∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCompactRangeCoefficient c L q r jStar E u : ℂ)* ∑ m ∈ (2*u+1).divisors, F u m‖ ≤ exp L*L^(-D) := by obtain ⟨J,hJ⟩ := exists_candidate_compact_rough_test_reduction hc hb hq0 hq1 hr refine ⟨J,fun jStar hj A D => ?_⟩ filter_upwards [hJ jStar hj A D] with L hL intro E F hE hlogE hF hsupp have heq (a : ℕ → ℂ) : (∑ u ∈ arithmeticProductWindow 1 (exp L), a u*∑ m ∈ (2*u+1).divisors, F u m) = ∑ u ∈ arithmeticProductWindow 1 (exp L), a u* ∑ m ∈ roughDivisors (exp (sqrt L)) (2*u+1), F u m := by apply sum_congr rfl intro u hu rw [rough_supported_divisor_test_eq _ _ _ (hsupp u hu)] rw [heq, heq] exact hL E F hE hlogE (fun u hu m hm => hF u hu m (mem_filter.mp hm).1) end Bounty end section /- Real recovered coordinates without finite quotient membership guards. -/ namespace Bounty theorem typeII_recovered_e_real_of_congruence {y : TypeIIShiftIndex} (hmod : Int.ModEq (2 * |y.1.1|) (y.2.1.1 : ℤ) (y.2.2.1 : ℤ)) : (typeIIRecoveredE y : ℝ) = typeIIRealE y := by have hd := (typeII_signed_modulus_dvd y.1.1 _).mp (Int.modEq_iff_dvd.mp hmod) unfold typeIIRecoveredE typeIIRealE rw [Int.cast_div_charZero hd] push_cast rfl theorem typeII_positive_real_reconstruction {y : TypeIIShiftIndex} (hm : 0 < y.2.1.1) (hm' : 0 < y.2.2.1) (hk : y.1.1 ≠ 0) (hz : y.1.2 = y.2.2.1 * y.2.1.2) (hcross : (y.1.2 : ℤ) + y.1.1 = (y.2.1.1 : ℤ) * y.2.2.2) (hc : IsCoprime (y.2.1.1 : ℤ) y.1.1) (hmod : Int.ModEq (2 * |y.1.1|) (y.2.1.1 : ℤ) (y.2.2.1 : ℤ)) (he : 0 < typeIIRealE y) : 0 < typeIIRecoveredE y ∧ 0 < typeIIRecoveredN y ∧ ((typeIIRecoveredE y).toNat : ℝ) = typeIIRealE y ∧ ((typeIIRecoveredN y).toNat : ℝ) = typeIIRealN y := by have hEr := typeII_recovered_e_real_of_congruence hmod have hE : 0 < typeIIRecoveredE y := by have : (0 : ℝ) < typeIIRecoveredE y := hEr ▸ he exact_mod_cast this have hd : (y.2.1.1 : ℤ) * y.2.2.2 - (y.2.2.1 : ℤ) * y.2.1.2 = y.1.1 := by rw [hz, Nat.cast_mul] at hcross linarith obtain ⟨en, hen, _⟩ := typeII_determinant_from_congruence (by exact_mod_cast hm) (by positivity : (0 : ℤ) ≤ y.2.1.2) hk hc hd hmod hE have hEq : typeIIRecoveredE y = en.1 := typeII_determinant_e_quotient hk hen.2.2.2.2.1 have hNq : typeIIRecoveredN y = en.2 := by unfold typeIIRecoveredN rw [hEq] exact typeII_determinant_n_quotient (by exact_mod_cast hm.ne') hen.2.2.1 have hEc : ((typeIIRecoveredE y).toNat : ℤ) = en.1 := by rw [hEq] exact Int.toNat_of_nonneg hen.1.le have hNc : ((typeIIRecoveredN y).toNat : ℤ) = en.2 := by rw [hNq] exact Int.toNat_of_nonneg hen.2.1.le have hEreal : ((typeIIRecoveredE y).toNat : ℝ) = (en.1 : ℝ) := by exact_mod_cast hEc have hNreal : ((typeIIRecoveredN y).toNat : ℝ) = (en.2 : ℝ) := by exact_mod_cast hNc have hdet : (y.2.2.1 : ℝ) - y.2.1.1 = 2 * (en.1 : ℝ) * y.1.1 := by exact_mod_cast hen.2.2.2.2.1 have heq : (y.2.1.1 : ℝ) * en.2 = 2 * (en.1 : ℝ) * y.2.1.2 + 1 := by exact_mod_cast hen.2.2.1 have hzr : (y.1.2 : ℝ) = (y.2.2.1 : ℝ) * y.2.1.2 := by exact_mod_cast hz have hr := typeII_real_coordinate_algebra (by exact_mod_cast hm.ne') (by exact_mod_cast hm'.ne') (by exact_mod_cast hk) hdet heq hzr exact ⟨hE, hNq ▸ hen.2.1, hEreal.trans hr.1, hNreal.trans hr.2⟩ end Bounty end section /- Actual range-masked allocation with every valid active Fourier integral truncated. -/ open Finset MeasureTheory namespace Bounty noncomputable def candidateBoxRangeAllocationMass (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (E R : ℝ) : ℂ := ∑ take : Fin ((candidateQIndices c L).card*r) → Bool, if (∀ i, candidateAllocationActive c L r jStar i = false → take i = false) ∧ (E/L^88 ≤ (candidateAllocatedFactor c L r jStar x take : ℝ) ∧ (candidateAllocatedFactor c L r jStar x take : ℝ) ≤ E) then ∫ ξ, activeAllocationFourierIntegrand (candidateAllocationRadius r) (Real.log E) (fun i => Real.log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) take ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) R else 0 theorem candidate_compact_allocation_invalid_zero (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (E : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hbad : ¬∀ i, candidateAllocationActive c L r jStar i = false → take i = false) : candidateCompactAllocationWeight c L r jStar x (Real.log E) take = 0 := by have hb := candidate_compact_allocation_bounds c L r jStar x (Real.log E) take apply le_antisymm ?_ hb.1 by_contra h have hp : 0 < candidateAllocationWeight c L r jStar x (Real.log E) take := lt_of_lt_of_le (lt_of_not_ge h) hb.2 apply hbad intro i hi exact smooth_allocation_inactive_not_taken _ _ _ _ _ _ hp i hi theorem candidate_range_box_error (c L : ℝ) (r jStar : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (E R : ℝ) {err : ℝ} (herr : 0 ≤ err) (htrunc : ∀ take : Fin ((candidateQIndices c L).card*r) → Bool, (∀ i, candidateAllocationActive c L r jStar i = false → take i = false) → ‖(candidateCompactAllocationWeight c L r jStar x (Real.log E) take : ℂ) - ∫ ξ, activeAllocationFourierIntegrand (candidateAllocationRadius r) (Real.log E) (fun i => Real.log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) take ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) R‖ ≤ err) : ‖(candidateRangeAllocationMass c L r jStar x E : ℂ) - candidateBoxRangeAllocationMass c L r jStar x E R‖ ≤ (2 : ℝ)^((candidateQIndices c L).card*r)*err := by classical unfold candidateRangeAllocationMass candidateBoxRangeAllocationMass rw [Complex.ofReal_sum, ← sum_sub_distrib] apply (norm_sum_le _ _).trans calc _ ≤ ∑ _take : Fin ((candidateQIndices c L).card*r) → Bool, err := by apply sum_le_sum intro take ht by_cases hk : ∀ i, candidateAllocationActive c L r jStar i = false → take i = false · by_cases he : E/L^88 ≤ (candidateAllocatedFactor c L r jStar x take : ℝ) ∧ (candidateAllocatedFactor c L r jStar x take : ℝ) ≤ E · simpa only [he, and_true, if_pos hk, if_true] using htrunc take hk · simpa only [he, and_false, if_false, Complex.ofReal_zero, sub_self, norm_zero] using herr · have hz := candidate_compact_allocation_invalid_zero c L r jStar x E take hk simp only [hk, false_and, if_false, hz, ite_self, Complex.ofReal_zero, sub_self, norm_zero] exact herr _ = _ := by simp end Bounty end section /- Actual restricted active Fourier weights have the same uniform variation bound. -/ open Finset MeasureTheory namespace Bounty theorem active_allocation_box_weight_integrable {N : ℕ} (A R : ℝ) (active take : Fin N → Bool) : Integrable (activeAllocationFourierWeight A active take) (activeAllocationBoxMeasure active R) := Integrable.fintype_prod (fun i => (typeII_cutoff_fourier_integrable A (take i.val)).integrableOn) section variable {N : ℕ} (A C R : ℝ) (hC1 : 1 ≤ C) (hC : ∀ take : Bool, (∫ ξ : ℝ, ‖typeIICutoffFourier A take ξ‖) ≤ C) include N A C R hC1 hC theorem active_allocation_box_l1_le (active take : Fin N → Bool) : (∫ ξ, ‖activeAllocationFourierWeight A active take ξ‖ ∂activeAllocationBoxMeasure active R) ≤ C^N := by simp only [activeAllocationFourierWeight, activeAllocationBoxMeasure, norm_prod] rw [integral_fintype_prod_eq_prod (fun (i : ActiveAllocationIndex active) (ξ : ℝ) => ‖typeIICutoffFourier A (take i.val) ξ‖)] calc _ ≤ ∏ _i : ActiveAllocationIndex active, C := by apply prod_le_prod₀ · intro i hi exact integral_nonneg (fun ξ => norm_nonneg _) · intro i hi exact (setIntegral_le_integral (typeII_cutoff_fourier_integrable A (take i.val)).norm (Filter.Eventually.of_forall (fun ξ => norm_nonneg _))).trans (hC (take i.val)) _ = C^Fintype.card (ActiveAllocationIndex active) := by simp _ ≤ C^N := pow_le_pow_right₀ hC1 (by simpa only [Fintype.card_fin] using Fintype.card_subtype_le (fun i => active i = true)) theorem active_allocation_all_patterns_variation (active : Fin N → Bool) : (∑ take ∈ (univ : Finset (Fin N → Bool)).filter (fun take => ∀ i, active i = false → take i = false), ∫ ξ, ‖activeAllocationFourierWeight A active take ξ‖ ∂activeAllocationBoxMeasure active R) ≤ (2*C)^N := by calc _ ≤ ∑ take : Fin N → Bool, ∫ ξ, ‖activeAllocationFourierWeight A active take ξ‖ ∂activeAllocationBoxMeasure active R := by apply sum_le_sum_of_subset_of_nonneg (filter_subset _ _) intro take ht hnot exact integral_nonneg (fun ξ => norm_nonneg _) _ ≤ ∑ _take : Fin N → Bool, C^N := sum_le_sum (fun take _ => active_allocation_box_l1_le A C R hC1 hC active take) _ = (2*C)^N := by simp [mul_pow] end end Bounty end section /- Iterating the original mixed events from seeded initial primes recovers the exact common birth history. -/ open Classical namespace Bounty section History variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedCommonStepHistoryUpdate (t : ℕ) (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P) := if ht : t < steps.length then if htag : steps.get ⟨t, ht⟩ = tag then fullMixedCommonHistoryWrite n S B A Δ D steps ⟨t, ht⟩ s (fullMixedTaggedOwnerEvent n S B A Δ D steps ⟨t, ht⟩ tag htag s e) history else history else history theorem full_mixed_common_step_history_update_owner (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : fullMixedCommonStepHistoryUpdate n S B A Δ D steps u.val (steps.get u) s e history = fullMixedCommonHistoryWrite n S B A Δ D steps u s e history := by unfold fullMixedCommonStepHistoryUpdate rw [dif_pos u.isLt, dif_pos rfl] rfl theorem full_mixed_common_path_history_at (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (t : ℕ) (ht : t ≤ steps.length) : finiteEventPathHistoryAt (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedCommonStepHistoryUpdate n S B A Δ D steps) 0 steps s p (fullMixedCommonHistorySeed n B steps s history) t = fullMixedCommonPathHistory n S B A Δ D steps s p history t := by induction t with | zero => rw [finite_event_path_history_at_zero, full_mixed_common_path_history_zero] | succ t ih => have hlt : t < steps.length := Nat.lt_of_succ_le ht have h := finite_event_path_history_at_succ (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedCommonStepHistoryUpdate n S B A Δ D steps) 0 steps s p (fullMixedCommonHistorySeed n B steps s history) ⟨t, hlt⟩ simp only [Nat.zero_add] at h rw [h, ih (Nat.le_of_lt hlt)] exact (full_mixed_common_step_history_update_owner n S B A Δ D steps ⟨t, hlt⟩ _ _ _).trans (full_mixed_common_path_history_write n S B A Δ D steps s p history ⟨t, hlt⟩) end History end Bounty end section /- The complete sparse Gram kernel bound for logarithmic phases. -/ open Finset namespace Bounty theorem logarithmic_sparse_gram_kernel (a b : ℕ) (U Y t : ℝ) (hU : 1 ≤ U) (ha : U ≤ (a : ℝ)) (hb : (b : ℝ) ≤ 2*U) (htY : |t| ≤ Y) : ‖∑ n ∈ Icc a b, Complex.exp ((t*Real.log (n : ℝ) : ℝ)*Complex.I)‖ ≤ 24*Real.pi*U/(1+|t|)+216*Real.sqrt Y := by by_cases hab : a ≤ b · by_cases htU : |t| ≤ U · have h := logarithmic_low_frequency_kernel a b U t hU ha hab hb htU have hy : 0 ≤ 216*Real.sqrt Y := by positivity linarith · have h := logarithmic_second_derivative_large t U Y hU hab ha hb (le_of_lt (lt_of_not_ge htU)) htY have hc : 0 ≤ 24*Real.pi*U/(1+|t|) := by positivity linarith · rw [Icc_eq_empty_of_lt (lt_of_not_ge hab),sum_empty,norm_zero] positivity end Bounty end section /- A single logarithmic phase estimate across the covered frequency range. -/ open Finset namespace Bounty theorem exists_uniform_affine_logarithmic_phase_bound (K : ℕ) (C : ℝ) (hK : 2 ≤ K) (hC : 1 ≤ C) : ∃ D : ℝ, 0 < D ∧ ∀ (N ε q c u : ℝ) (a b : ℤ), 1 < N → 0 < ε → ε ≤ 1/2 → (K : ℝ)^2 ≤ N → 2 ≤ N^(ε/(2*(K : ℝ))) → 0 < q → u ≠ 0 → |u| ≤ N^((K : ℝ)-ε) → N ≤ (a : ℝ)+c/q → (b : ℝ)+1+c/q ≤ C*N → ‖∑ n ∈ Icc a b, Complex.exp (((u*Real.log (q*(n : ℝ)+c) : ℝ) : ℂ)*Complex.I)‖ ≤ D*N*(1/|u|+N^(-(ε/((K : ℝ)*(2:ℝ)^(K-1))))) := by classical let d : ℕ → ℝ := fun k => if hk : 2 ≤ k then Classical.choose (exists_affine_logarithmic_derivative_band_bound k C hk hC) else 1 have hdpos (k : ℕ) : 0 < d k := by by_cases hk : 2 ≤ k · simpa only [d,dif_pos hk] using (Classical.choose_spec (exists_affine_logarithmic_derivative_band_bound k C hk hC)).1 · simp only [d,dif_neg hk] norm_num let D := 4*Real.pi*C+∑ k ∈ range (K+1), d k have hsum : 0 ≤ ∑ k ∈ range (K+1), d k := sum_nonneg (fun k _ => (hdpos k).le) have hCp : 0 < C := by linarith have hDpos : 0 < D := by dsimp [D]; positivity have hfirst : 4*Real.pi*C ≤ D := by dsimp [D]; linarith have hdD (k : ℕ) (hk : k ≤ K) : d k ≤ D := by have hh := single_le_sum (fun j (_ : j ∈ range (K+1)) => (hdpos j).le) (show k ∈ range (K+1) by simpa using Nat.lt_succ_of_le hk) dsimp [D] have hp : 0 < 4*Real.pi*C := by positivity linarith refine ⟨D,hDpos,?_⟩ intro N ε q c u a b hN hε hεhalf hKN hpow hq hu huK ha hb have hNp : 0 < N := by linarith have huabs : 0 < |u| := abs_pos.mpr hu have hDN : 0 ≤ D*N := by positivity by_cases hlow : |u| ≤ Real.pi*N · have hlo : q*N ≤ q*(a : ℝ)+c := by have hh := mul_le_mul_of_nonneg_left ha hq.le field_simp at hh nlinarith have hhi : q*((b : ℝ)+1)+c ≤ C*q*N := by have hh := mul_le_mul_of_nonneg_left hb hq.le field_simp at hh nlinarith have hh := affine_logarithmic_first_bound a b q c N C u hq hNp hC hlo hhi hu hlow calc _ ≤ 4*Real.pi*C*N/|u| := hh _ ≤ D*N/|u| := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hfirst hNp.le) huabs.le _ = D*N*(1/|u|) := by ring _ ≤ _ := mul_le_mul_of_nonneg_left (le_add_of_nonneg_right (by positivity)) hDN · have hNu : N ≤ |u| := by have hp : N ≤ Real.pi*N := by nlinarith [Real.pi_gt_three] exact hp.trans (le_of_lt (lt_of_not_ge hlow)) obtain ⟨k,hk,hkK,hulo,huhi⟩ := exists_derivative_order_power_band K N |u| ε hN hε hεhalf hNu huK have hkspec := (Classical.choose_spec (exists_affine_logarithmic_derivative_band_bound k C hk hC)).2 have hdk : d k = Classical.choose (exists_affine_logarithmic_derivative_band_bound k C hk hC) := by simp only [d,dif_pos hk] rw [← hdk] at hkspec have hkR : (2 : ℝ) ≤ k := by exact_mod_cast hk have hkKR : (k : ℝ) ≤ K := by exact_mod_cast hkK have hkN : (k : ℝ)^2 ≤ N := by nlinarith have hθ : ε/(2*(K : ℝ)) ≤ ε/(2*(k : ℝ)) := div_le_div_of_nonneg_left hε.le (by positivity) (by linarith) have hpowk : 2 ≤ N^(ε/(2*(k : ℝ))) := hpow.trans (Real.rpow_le_rpow_of_exponent_le hN.le hθ) have hh := hkspec N ε q c u a b hN.le hε.le (by linarith) hkN hpowk hq hulo huhi ha hb have hexp := derivative_decay_exponent_antitone hε.le hk hkK have hpowers : N^(-(ε/((k : ℝ)*(2:ℝ)^(k-1)))) ≤ N^(-(ε/((K : ℝ)*(2:ℝ)^(K-1)))) := Real.rpow_le_rpow_of_exponent_le hN.le (neg_le_neg hexp) calc _ ≤ d k*N*N^(-(ε/((k : ℝ)*(2:ℝ)^(k-1)))) := hh _ ≤ D*N*N^(-(ε/((K : ℝ)*(2:ℝ)^(K-1)))) := mul_le_mul (mul_le_mul_of_nonneg_right (hdD k hkK) hNp.le) hpowers (by positivity) hDN _ ≤ _ := mul_le_mul_of_nonneg_left (le_add_of_nonneg_left (by positivity)) hDN end Bounty end section /- Exact two-factor finite polynomials come with their actual dyadic energy data. -/ open Finset Filter namespace Bounty theorem eventually_finite_pair_five_dyad_data {c E : ℝ} (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ (A B : Finset ℕ) (α β : ℕ → ℂ) (UA UB A0 B0 : ℝ), 0 < UA → 0 < UB → 0 ≤ A0 → 0 ≤ B0 → A0*B0 ≤ L^E → (∀ n ∈ A, ‖α n‖ ≤ A0) → (∀ n ∈ B, ‖β n‖ ≤ B0) → (∀ n ∈ A, UA ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UA) → (∀ n ∈ B, UB ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UB) → 1 ≤ UA*UB/2 → Real.log (8*(UA*UB)) ≤ c*L → ∃ (lo hi : Fin 5 → ℕ) (w : Fin 5 → ℕ → ℂ) (U : Fin 5 → ℝ), (∀ j, UA*UB/2 ≤ U j ∧ 1 ≤ U j ∧ Real.log (U j) ≤ c*L ∧ U j ≤ (lo j : ℝ) ∧ (hi j : ℝ) ≤ 2*U j ∧ (∑ n ∈ Icc (lo j) (hi j), ‖w j n‖^2) ≤ L^(2*E+16)/U j) ∧ ∀ t : ℝ, (∑ a ∈ A, α a*harmonicMellinWeight t a)* (∑ b ∈ B, β b*harmonicMellinWeight t b) = ∑ j : Fin 5, ∑ n ∈ Icc (lo j) (hi j), w j n*Complex.exp (((Real.log (n : ℝ)*t : ℝ) : ℂ)*Complex.I) := by classical filter_upwards [eventually_pair_convolution_reciprocal_power_energy (E := E) hc] with L henergy intro A B α β UA UB A0 B0 hUA hUB hA0 hB0 hprod hα hβ hA hB hV hlog let V := UA*UB let α' := fun n => if n ∈ A then α n else 0 let β' := fun n => if n ∈ B then β n else 0 have hα' : ∀ n, ‖α' n‖ ≤ A0 := by intro n dsimp [α'] split_ifs with hn · exact hα n hn · simpa only [norm_zero] using hA0 have hβ' : ∀ n, ‖β' n‖ ≤ B0 := by intro n dsimp [β'] split_ifs with hn · exact hβ n hn · simpa only [norm_zero] using hB0 refine ⟨(fun j => ⌊(2 : ℝ)^j.val*(V/2)⌋₊+1), (fun j => ⌊(2 : ℝ)^(j.val+1)*(V/2)⌋₊), (fun _ n => if n ∈ Icc 1 ⌊16*V⌋₊ then (∑ d ∈ n.divisors, α' d*β' (n/d))/(n : ℂ) else 0), (fun j => (2 : ℝ)^j.val*(V/2)),?_,?_⟩ · intro j have hg := five_dyad_full_geometry hV hlog j refine ⟨hg.1,hg.2.1,hg.2.2.1,hg.2.2.2.1,hg.2.2.2.2,?_⟩ refine (finite_masked_energy_le _ _ _).trans ?_ apply henergy α' β' A0 B0 _ hA0 hB0 hg.2.1 hg.2.2.1 hprod hα' hβ' intro n hn obtain ⟨hnlo,hnhi⟩ := mem_Icc.mp hn exact ⟨hg.2.2.2.1.trans (Nat.cast_le.mpr hnlo), (Nat.cast_le.mpr hnhi).trans hg.2.2.2.2⟩ · intro t exact (by classical dsimp only have hApos : ∀ a ∈ A, 0 < a := fun a ha => Nat.cast_pos.mp (hUA.trans_le (hA a ha).1) have hBpos : ∀ b ∈ B, 0 < b := fun b hb => Nat.cast_pos.mp (hUB.trans_le (hB b hb).1) have hprod : ∀ a ∈ A, ∀ b ∈ B, UA*UB ≤ (a*b : ℕ) ∧ (a*b : ℕ) ≤ 16*(UA*UB) := by intro a ha b hb simpa only [one_mul,Nat.one_mul] using four_dyadic_factor_product_bounds (UD := 1) (UA := 1) (UB := UA) (UC := UB) (d := 1) (a := 1) (b := a) (c := b) (by norm_num) (by norm_num) hUA hUB (by norm_num) (by norm_num) (hA a ha) (hB b hb) have hs : ∀ a ∈ A, ∀ b ∈ B, a*b ∈ Icc 1 ⌊16*(UA*UB)⌋₊ := by intro a ha b hb exact mem_Icc.mpr ⟨Nat.mul_pos (hApos a ha) (hBpos b hb),Nat.le_floor (hprod a ha b hb).2⟩ have hsize : ∀ a ∈ A, ∀ b ∈ B, UA*UB/2 < (a*b : ℕ) ∧ (a*b : ℕ) ≤ (2 : ℝ)^5*(UA*UB/2) := by intro a ha b hb have hp := hprod a ha b hb have hV : 0 < UA*UB := mul_pos hUA hUB constructor · linarith · norm_num at hp ⊢ linarith have hr := divisor_pair_dyadic_representation (Icc 1 ⌊16*(UA*UB)⌋₊) A B (fun n => if n ∈ A then α n else 0) (fun n => if n ∈ B then β n else 0) hApos hBpos (by intro n hn; exact if_neg hn) (by intro n hn; exact if_neg hn) hs (UA*UB/2) (by positivity) 5 hsize t simpa only [finite_support_weighted_sum] using hr ) end Bounty end section /- Exact three-factor finite polynomials come with their actual dyadic energy data. -/ open Finset Filter namespace Bounty theorem eventually_finite_triple_five_dyad_data {c E : ℝ} (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ (A B C : Finset ℕ) (α β γ : ℕ → ℂ) (UA UB UC A0 B0 C0 : ℝ), 0 < UA → 0 < UB → 0 < UC → 0 ≤ A0 → 0 ≤ B0 → 0 ≤ C0 → A0*B0*C0 ≤ L^E → (∀ n ∈ A, ‖α n‖ ≤ A0) → (∀ n ∈ B, ‖β n‖ ≤ B0) → (∀ n ∈ C, ‖γ n‖ ≤ C0) → (∀ n ∈ A, UA ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UA) → (∀ n ∈ B, UB ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UB) → (∀ n ∈ C, UC ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UC) → 1 ≤ UA*UB*UC/2 → Real.log (8*(UA*UB*UC)) ≤ c*L → ∃ (lo hi : Fin 5 → ℕ) (w : Fin 5 → ℕ → ℂ) (U : Fin 5 → ℝ), (∀ j, UA*UB*UC/2 ≤ U j ∧ 1 ≤ U j ∧ Real.log (U j) ≤ c*L ∧ U j ≤ (lo j : ℝ) ∧ (hi j : ℝ) ≤ 2*U j ∧ (∑ n ∈ Icc (lo j) (hi j), ‖w j n‖^2) ≤ L^(2*E+16)/U j) ∧ ∀ t : ℝ, (∑ a ∈ A, α a*harmonicMellinWeight t a)* (∑ b ∈ B, β b*harmonicMellinWeight t b)*(∑ d ∈ C, γ d*harmonicMellinWeight t d) = ∑ j : Fin 5, ∑ n ∈ Icc (lo j) (hi j), w j n*Complex.exp (((Real.log (n : ℝ)*t : ℝ) : ℂ)*Complex.I) := by classical filter_upwards [eventually_triple_convolution_reciprocal_power_energy (E := E) hc] with L henergy intro A B C α β γ UA UB UC A0 B0 C0 hUA hUB hUC hA0 hB0 hC0 hprod hα hβ hγ hA hB hC hV hlog let V := UA*UB*UC let α' := fun n => if n ∈ A then α n else 0 let β' := fun n => if n ∈ B then β n else 0 let γ' := fun n => if n ∈ C then γ n else 0 have hα' : ∀ n, ‖α' n‖ ≤ A0 := by intro n dsimp [α'] split_ifs with hn · exact hα n hn · simpa only [norm_zero] using hA0 have hβ' : ∀ n, ‖β' n‖ ≤ B0 := by intro n dsimp [β'] split_ifs with hn · exact hβ n hn · simpa only [norm_zero] using hB0 have hγ' : ∀ n, ‖γ' n‖ ≤ C0 := by intro n dsimp [γ'] split_ifs with hn · exact hγ n hn · simpa only [norm_zero] using hC0 refine ⟨(fun j => ⌊(2 : ℝ)^j.val*(V/2)⌋₊+1), (fun j => ⌊(2 : ℝ)^(j.val+1)*(V/2)⌋₊), (fun _ n => if n ∈ Icc 1 ⌊16*V⌋₊ then endpointTripleConvolution α' β' γ' n/(n : ℂ) else 0), (fun j => (2 : ℝ)^j.val*(V/2)),?_,?_⟩ · intro j have hg := five_dyad_full_geometry hV hlog j refine ⟨hg.1,hg.2.1,hg.2.2.1,hg.2.2.2.1,hg.2.2.2.2,?_⟩ refine (finite_masked_energy_le _ _ _).trans ?_ apply henergy α' β' γ' A0 B0 C0 _ hA0 hB0 hC0 hg.2.1 hg.2.2.1 hprod hα' hβ' hγ' intro n hn obtain ⟨hnlo,hnhi⟩ := mem_Icc.mp hn exact ⟨hg.2.2.2.1.trans (Nat.cast_le.mpr hnlo), (Nat.cast_le.mpr hnhi).trans hg.2.2.2.2⟩ · intro t exact (by classical dsimp only have hApos : ∀ a ∈ A, 0 < a := fun a ha => Nat.cast_pos.mp (hUA.trans_le (hA a ha).1) have hBpos : ∀ b ∈ B, 0 < b := fun b hb => Nat.cast_pos.mp (hUB.trans_le (hB b hb).1) have hCpos : ∀ c ∈ C, 0 < c := fun c hc => Nat.cast_pos.mp (hUC.trans_le (hC c hc).1) have hprod : ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, UA*UB*UC ≤ (a*b*c : ℕ) ∧ (a*b*c : ℕ) ≤ 16*(UA*UB*UC) := by intro a ha b hb c hc simpa only [one_mul,Nat.one_mul] using four_dyadic_factor_product_bounds (UD := 1) (UA := UA) (UB := UB) (UC := UC) (d := 1) (a := a) (b := b) (c := c) (by norm_num) hUA hUB hUC (by norm_num) (hA a ha) (hB b hb) (hC c hc) have hs : ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, a*b*c ∈ Icc 1 ⌊16*(UA*UB*UC)⌋₊ := by intro a ha b hb c hc exact mem_Icc.mpr ⟨Nat.mul_pos (Nat.mul_pos (hApos a ha) (hBpos b hb)) (hCpos c hc), Nat.le_floor (hprod a ha b hb c hc).2⟩ have hsize : ∀ a ∈ A, ∀ b ∈ B, ∀ c ∈ C, UA*UB*UC/2 < (a*b*c : ℕ) ∧ (a*b*c : ℕ) ≤ (2 : ℝ)^5*(UA*UB*UC/2) := by intro a ha b hb c hc have hp := hprod a ha b hb c hc have hV : 0 < UA*UB*UC := by positivity constructor · linarith · norm_num at hp ⊢ linarith have hr := endpoint_triple_dyadic_representation (Icc 1 ⌊16*(UA*UB*UC)⌋₊) A B C (fun n => if n ∈ A then α n else 0) (fun n => if n ∈ B then β n else 0) (fun n => if n ∈ C then γ n else 0) hApos hBpos hCpos (by intro n hn; exact if_neg hn) (by intro n hn; exact if_neg hn) (by intro n hn; exact if_neg hn) hs (UA*UB*UC/2) (by positivity) 5 hsize t simpa only [finite_support_weighted_sum] using hr ) end Bounty end section /- The shared harmonic law occurs once after the exact endpoint-list reindexing. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- On the actual divisor fibers, shared endpoint and auxiliary avoidance implies the original compatible-completion restrictions. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (u v : GroupMarkedLists P (fun g => ell + (C g).card)) (aux : PhysicalAuxLabels P C) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) (hu : ∀ g i, (u g i).val ∣ w) (hv : ∀ g i, (v g i).val ∣ z) include G sharedInstance1 P J ell C hprime u v aux w z hw hz hu hv theorem physical_shared_good_implies_cut_good (s : PhysicalAuxLabels P (fun g => univ \ C g)) (hs : physicalSharedDrawGood C (fun g => physicalSharedForbidden C aux g w z) s) : physicalRawCutGood C u v s := by refine ⟨fun g => (hs g).2, fun g => ⟨?_, ?_⟩⟩ · apply Set.disjoint_left.mpr rintro p ⟨j, rfl⟩ ⟨i, hi⟩ apply (hs g).1 j apply (physical_mem_shared_forbidden_iff C aux g (hprime g) hw hz (s g j)).mpr left rw [← hi] exact hu g i · apply Set.disjoint_left.mpr rintro p ⟨j, rfl⟩ ⟨i, hi⟩ apply (hs g).1 j apply (physical_mem_shared_forbidden_iff C aux g (hprime g) hw hz (s g j)).mpr right left rw [← hi] exact hv g i theorem physical_shared_good_iff_cut_avoiding (s : PhysicalAuxLabels P (fun g => univ \ C g)) : physicalSharedDrawGood C (fun g => physicalSharedForbidden C aux g w z) s ↔ physicalRawCutGood C u v s ∧ ∀ g j, s g j ∉ physicalSharedForbidden C aux g w z := by constructor · intro hs exact ⟨physical_shared_good_implies_cut_good C hprime u v aux hw hz hu hv s hs, fun g => (hs g).1⟩ · rintro ⟨hcut, havoid⟩ g exact ⟨havoid g, hcut.1 g⟩ theorem physical_cut_avoiding_mean_eq_shared_good_mean (F : PhysicalAuxLabels P (fun g => univ \ C g) → ℂ) : (∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if physicalRawCutGood C u v s then if ∀ g j, s g j ∉ physicalSharedForbidden C aux g w z then F s else 0 else 0) = ∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if physicalSharedDrawGood C (fun g => physicalSharedForbidden C aux g w z) s then F s else 0 := by apply sum_congr rfl intro s _ rw [physical_shared_good_iff_cut_avoiding C hprime u v aux hw hz hu hv s] by_cases hc : physicalRawCutGood C u v s · simp only [hc, true_and, if_true] · simp only [hc, false_and, if_false] end end Bounty end section /- Bounded shared-dependent coefficients on the actual bad-draw event. -/ open Finset open scoped Classical namespace Bounty theorem physical_bad_shared_mean_norm_le {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (aux : PhysicalAuxLabels P C) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (A : PhysicalAuxLabels P (fun g => univ \ C g) → Prop) [DecidablePred A] (hbad : ∀ s, A s → ¬physicalSharedDrawGood C (fun g => physicalSharedForbidden C aux g w z) s) (F : PhysicalAuxLabels P (fun g => univ \ C g) → ℂ) {B : ℝ} (hB : 0 ≤ B) (hF : ∀ s, A s → ‖F s‖ ≤ B) : ‖∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if A s then (physicalAuxMass V (fun g => univ \ C g) s : ℂ) * F s else 0‖ ≤ (∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin)) * B := by calc _ ≤ ∑ s : PhysicalAuxLabels P (fun g => univ \ C g), ‖if A s then (physicalAuxMass V (fun g => univ \ C g) s : ℂ) * F s else 0‖ := norm_sum_le _ _ _ ≤ (∑ s : PhysicalAuxLabels P (fun g => univ \ C g), physicalAuxMass V (fun g => univ \ C g) s * (if ¬physicalSharedDrawGood C (fun g => physicalSharedForbidden C aux g w z) s then 1 else 0)) * B := by rw [sum_mul] apply sum_le_sum intro s _ have hm := physical_aux_mass_nonneg V (fun g => univ \ C g) (fun g => (hV g).le) s by_cases hs : A s · rw [if_pos hs, if_pos (hbad s hs), mul_one, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hm] exact mul_le_mul_of_nonneg_left (hF s hs) hm · rw [if_neg hs, norm_zero] exact mul_nonneg (mul_nonneg hm (by split_ifs <;> norm_num)) hB _ ≤ _ := mul_le_mul_of_nonneg_right (physical_shared_draw_endpoint_bad_mass V C hV hMass aux hw hz hPmin hp) hB theorem physical_bad_cut_mean_norm_le {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (u v : GroupMarkedLists P (fun g => ell + (C g).card)) (aux : PhysicalAuxLabels P C) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (F : PhysicalAuxLabels P (fun g => univ \ C g) → ℂ) {B : ℝ} (hB : 0 ≤ B) (hF : ∀ s, physicalRawCutGood C u v s → ‖F s‖ ≤ B) : ‖∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if physicalRawCutGood C u v s ∧ ¬(∀ g j, s g j ∉ physicalSharedForbidden C aux g w z) then (physicalAuxMass V (fun g => univ \ C g) s : ℂ) * F s else 0‖ ≤ (∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin)) * B := by apply physical_bad_shared_mean_norm_le V C hV hMass aux hw hz hPmin hp (fun s => physicalRawCutGood C u v s ∧ ¬(∀ g j, s g j ∉ physicalSharedForbidden C aux g w z)) _ F hB · intro s hs exact hF s hs.1 · intro s hs hg exact hs.2 (fun g => (hg g).1) end Bounty end section /- Replacing both literal selected endpoints on the original harmonic support. -/ open Finset open scoped Classical namespace Bounty theorem selected_harmonic_peel_replacement {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (V : G → ℝ) (t : G → ℕ) (T : ℕ) (hV : ∀ g, v ≤ V g) (ht : ∀ g, t g ≤ T) (hprime : ∀ g, ∀ p ∈ P g, p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (g : G) (k : ℕ) (htg : t g = k + 1) (big : Finset G) (hsmall : g ∉ big) (b₀ b₁ : GroupMarkedLists (fun h : big => P h.val) (fun h : big => t h.val) → ℂ) {H : ℝ} (hH : 0 ≤ H) (hb₀ : ∀ l, ‖b₀ l‖ ≤ H) (hb₁ : ∀ l, ‖b₁ l‖ ≤ H) (Q : Finset ℕ) (hQ : ∀ g, P g ⊆ Q) (α₀ β₀ γ₀ α₁ β₁ γ₁ : ℕ → ℂ) (hα₀free : ∀ d, ¬ Disjoint d.primeFactors Q → α₀ d = 0) (hβ₀free : ∀ d, ¬ Disjoint d.primeFactors Q → β₀ d = 0) (hα₁free : ∀ d, ¬ Disjoint d.primeFactors Q → α₁ d = 0) (hβ₁free : ∀ d, ¬ Disjoint d.primeFactors Q → β₁ d = 0) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα₀ : ∀ m, ‖α₀ m‖ ≤ A) (hβ₀ : ∀ p, ‖β₀ p‖ ≤ B) (hγ₀ : ∀ r, ‖γ₀ r‖ ≤ C) (hα₁ : ∀ m, ‖α₁ m‖ ≤ A) (hβ₁ : ∀ p, ‖β₁ p‖ ≤ B) (hγ₁ : ∀ r, ‖γ₁ r‖ ≤ C) (S : Finset ℤ) (δ : ℤ) (N : ℕ) (θ : ℤ → ℂ) {Y K : ℝ} (hY : 0 < Y) (hK : 0 ≤ K) (hS : ∀ n ∈ S, 0 < n ∧ n ≤ (N : ℤ)) (hshift : ∀ n ∈ S, 0 < n+δ ∧ n+δ ≤ (N : ℤ)) (hYlow : ∀ n ∈ S, Y ≤ (n : ℝ)) (hθ : ∀ n ∈ S, ‖θ n‖ ≤ K) : let E := ((markedDivisorBound q v T) ^ Fintype.card G * H) ^ 2 * ((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) let D := H ^ 2 * (((markedDivisorBound q v T) ^ Fintype.card G * (1 + 2 * Real.log N / v)) ^ 2 * (((A * B * C) ^ 2 * (N : ℝ) * (1 + Real.log N) ^ 15) * ∑ p ∈ P g, 1 / (p : ℝ) ^ 2)) ‖(∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (selectedMarkedEndpoint P q V t big b₀ Q α₀ β₀ γ₀ n.natAbs) * selectedMarkedEndpoint P q V t big b₁ Q α₁ β₁ γ₁ (n+δ).natAbs) - (∑ n ∈ S, (θ n / (n : ℂ)) * (starRingEnd ℂ) (selectedPeeledEndpoint P q V t g k big b₀ Q α₀ β₀ γ₀ n.natAbs) * selectedPeeledEndpoint P q V t g k big b₁ Q α₁ β₁ γ₁ (n+δ).natAbs)‖ ≤ (K/Y) * (Real.sqrt D * Real.sqrt E + Real.sqrt (2*(E+D)) * Real.sqrt D) := by dsimp only apply finite_harmonic_replacement_energy_bound S θ _ _ _ _ hY hK hYlow hθ · simpa only [add_zero] using selected_shifted_endpoint_energy P hq0 hq1 hv V t T hV ht big b₀ hH hb₀ Q α₀ β₀ γ₀ hA hB hC hα₀ hβ₀ hγ₀ S 0 N (by simpa only [add_zero] using hS) · exact selected_shifted_endpoint_energy P hq0 hq1 hv V t T hV ht big b₁ hH hb₁ Q α₁ β₁ γ₁ hA hB hC hα₁ hβ₁ hγ₁ S δ N hshift · simpa only [add_zero] using selected_shifted_peel_error_energy P hq0 hq1 hv V t T hV ht hprime hdis g k htg big hsmall b₀ hH hb₀ Q hQ α₀ β₀ γ₀ hα₀free hβ₀free hA hB hC hα₀ hβ₀ hγ₀ S 0 N (by simpa only [add_zero] using hS) · exact selected_shifted_peel_error_energy P hq0 hq1 hv V t T hV ht hprime hdis g k htg big hsmall b₁ hH hb₁ Q hQ α₁ β₁ γ₁ hα₁free hβ₁free hA hB hC hα₁ hβ₁ hγ₁ S δ N hshift end Bounty end section /- The whole common window has a local Fourier-to-Mellin estimate with unchanged coefficients. -/ open Finset MeasureTheory namespace Bounty theorem exists_wide_local_fourier_mellin_energy_constants {j : ℕ} (hj : 2 ≤ j) : ∃ Cj Cerr : ℝ, 0 < Cj ∧ 0 < Cerr ∧ ∀ (S : Finset ℕ) (a : ℕ → ℂ) (Y H : ℝ), 0 < Y → 1 ≤ H → H ≤ Y/64 → (∀ n ∈ S, Y/8 ≤ (n:ℝ) ∧ (n:ℝ) ≤ 64*Y) → (∫ β in {β : ℝ | |β| ≤ 1/H}, ‖localAdditivePolynomial S a β‖^2) ≤ (Cj/Y) * (∫ t : ℝ, (1+|(H/Y)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) + Cerr * (H/Y)^2 * (∑ n ∈ S, ‖a n‖^2) := by obtain ⟨Cj,Cerr,hCj,hCerr,hinterval⟩ := exists_local_additive_mellin_interval_constants hj refine ⟨72*Cj*(32:ℝ)^j,576*Cerr,by positivity,by positivity,?_⟩ intro S a Y H hY hH hsmall hS have hHp : 0 < H := lt_of_lt_of_le zero_lt_one hH have hSpos : ∀ n ∈ S, 0 < n := by intro n hn have hp : 0 < (n:ℝ) := (by positivity : 0 < Y/8).trans_le (hS n hn).1 exact_mod_cast hp let I : ℝ := ∫ t : ℝ, (1+|(H/Y)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2 let E : ℝ := ∑ n ∈ S, ‖a n‖^2 have hI : 0 ≤ I := integral_nonneg (fun t => by positivity) have hE : 0 ≤ E := sum_nonneg (fun n _ => sq_nonneg _) have hlocal (i : ℕ) (hi : i ∈ range 9) : (4/H^2) * (∫ v in Set.Icc (((Y/8)*(2:ℝ)^i)/2) (3*((Y/8)*(2:ℝ)^i)), ‖localAdditiveConvolution S a H v‖^2) ≤ (8*Cj*(32:ℝ)^j/Y)*I + 64*Cerr*(H/Y)^2*E := by let Z : ℝ := (Y/8)*(2:ℝ)^i have hZ : 0 < Z := by dsimp [Z]; positivity obtain ⟨hZlo,hZhi⟩ := wide_mellin_scale_bounds hY hi have hHZ : H ≤ Z/8 := by dsimp [Z]; linarith have hbound := hinterval S a hSpos Z H hZ hH hHZ have hscale := local_mellin_energy_scale_le hj S a hY hZ hHp hZhi have hIz : 0 ≤ ∫ t : ℝ, (1+|(H/Z)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2 := integral_nonneg (fun t => by positivity) have hdiv : Cj/Z ≤ 8*Cj/Y := by apply (div_le_div_iff₀ hZ hY).mpr dsimp [Z] nlinarith [mul_le_mul_of_nonneg_left hZlo hCj.le] have hm : (Cj/Z) * (∫ t : ℝ, (1+|(H/Z)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) ≤ (8*Cj*(32:ℝ)^j/Y)*I := by calc _ ≤ (8*Cj/Y)*((32:ℝ)^j*I) := mul_le_mul hdiv hscale hIz (by positivity) _ = _ := by ring have hratio : H/Z ≤ 8*(H/Y) := by calc _ ≤ H/(Y/8) := div_le_div_of_nonneg_left hHp.le (by positivity) hZlo _ = _ := by ring have he : Cerr*(H/Z)^2*E ≤ 64*Cerr*(H/Y)^2*E := by have hs := pow_le_pow_left₀ (by positivity : 0 ≤ H/Z) hratio 2 have he' := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hs hCerr.le) hE calc _ ≤ Cerr*(8*(H/Y))^2*E := he' _ = _ := by ring exact hbound.trans (add_le_add hm he) have hcont := (local_additive_convolution_contDiff S a H).continuous have hcover := finite_cover_integral_le volume (range 9) (Set.Icc (Y/16) (65*Y)) (fun i => Set.Icc (((Y/8)*(2:ℝ)^i)/2) (3*((Y/8)*(2:ℝ)^i))) (fun v => ‖localAdditiveConvolution S a H v‖^2) measurableSet_Icc (fun _ _ => measurableSet_Icc) (fun _ => sq_nonneg _) (hcont.norm.pow 2).integrableOn_Icc (fun _ _ => (hcont.norm.pow 2).integrableOn_Icc) (fun v hv => wide_mellin_interval_cover hY hv) have heq : (∫ v : ℝ, ‖localAdditiveConvolution S a H v‖^2) = ∫ v in Set.Icc (Y/16) (65*Y), ‖localAdditiveConvolution S a H v‖^2 := by symm apply setIntegral_eq_integral_of_forall_compl_eq_zero intro v hv rw [local_additive_convolution_wide_support S a hY hHp hsmall hS hv, norm_zero, zero_pow (by decide)] apply (local_fourier_energy_le_convolution S a hHp).trans rw [heq] calc _ ≤ (4/H^2) * (∑ i ∈ range 9, ∫ v in Set.Icc (((Y/8)*(2:ℝ)^i)/2) (3*((Y/8)*(2:ℝ)^i)), ‖localAdditiveConvolution S a H v‖^2) := mul_le_mul_of_nonneg_left hcover (by positivity) _ = ∑ i ∈ range 9, (4/H^2) * (∫ v in Set.Icc (((Y/8)*(2:ℝ)^i)/2) (3*((Y/8)*(2:ℝ)^i)), ‖localAdditiveConvolution S a H v‖^2) := mul_sum _ _ _ _ ≤ ∑ _i ∈ range 9, ((8*Cj*(32:ℝ)^j/Y)*I + 64*Cerr*(H/Y)^2*E) := sum_le_sum hlocal _ = _ := by simp only [sum_const,card_range,nsmul_eq_mul] dsimp only [I,E] ring end Bounty end section /- The local Fourier-to-Mellin estimate on the same positive integer support and rational-center modulation used by the auxiliary major arcs. -/ open Finset MeasureTheory namespace Bounty theorem finite_fourier_modulated_energy (S : Finset ℤ) (f : ℤ → ℂ) (hS : ∀ n ∈ S, 0 ≤ n) (c : ℝ) : (∑ n ∈ S.image Int.natAbs, ‖f n * fourier (n : ℤ) (c : AddCircle (1 : ℝ))‖^2) = ∑ n ∈ S, ‖f n‖^2 := by rw [sum_image] · apply sum_congr rfl intro n hn rw [Int.natAbs_of_nonneg (hS n hn), norm_mul, fourier_apply, Circle.norm_coe, mul_one] · intro a ha b hb hab have he := congrArg (fun n : ℕ => (n : ℤ)) hab simpa only [Int.natAbs_of_nonneg (hS a ha), Int.natAbs_of_nonneg (hS b hb)] using he end Bounty end section /- Exact energy assembly from only the retained full dyadic boxes. -/ open Finset MeasureTheory namespace Bounty def retainedFourDyadicBox (S : Finset ℕ) (N i j k l : ℕ) : Prop := ∃ d ∈ dyadicNatBucket (Icc 1 N) i, ∃ a ∈ dyadicNatBucket (Icc 1 N) j, ∃ b ∈ dyadicNatBucket (Icc 1 N) k, ∃ c ∈ dyadicNatBucket (Icc 1 N) l, d*a*b*c ∈ S noncomputable def fourDyadicBoxSum (N : ℕ) (δ α β γ F : ℕ → ℂ) (i j k l : ℕ) : ℂ := ∑ d ∈ dyadicNatBucket (Icc 1 N) i, ∑ a ∈ dyadicNatBucket (Icc 1 N) j, ∑ b ∈ dyadicNatBucket (Icc 1 N) k, ∑ c ∈ dyadicNatBucket (Icc 1 N) l, δ d*α a*β b*γ c*F (d*a*b*c) theorem endpoint_four_dyadic_energy {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (S : Finset ℕ) (N : ℕ) (hS : ∀ n ∈ S, n ≤ N) (δ α β γ : ℕ → ℂ) (F : Ω → ℕ → ℂ) (hF : ∀ s n, n ∉ S → F s n = 0) (E : ℝ) (hE0 : 0 ≤ E) (hf : ∀ i ∈ dyadicNatIndices (Icc 1 N), ∀ j ∈ dyadicNatIndices (Icc 1 N), ∀ k ∈ dyadicNatIndices (Icc 1 N), ∀ l ∈ dyadicNatIndices (Icc 1 N), retainedFourDyadicBox S N i j k l → Integrable (fun s => ‖fourDyadicBoxSum N δ α β γ (F s) i j k l‖ ^ 2) μ) (hE : ∀ i ∈ dyadicNatIndices (Icc 1 N), ∀ j ∈ dyadicNatIndices (Icc 1 N), ∀ k ∈ dyadicNatIndices (Icc 1 N), ∀ l ∈ dyadicNatIndices (Icc 1 N), retainedFourDyadicBox S N i j k l → (∫ s, ‖fourDyadicBoxSum N δ α β γ (F s) i j k l‖ ^ 2 ∂μ) ≤ E) : (∫ s, ‖∑ n ∈ S, endpointFourConvolution δ α β γ n * F s n‖ ^ 2 ∂μ) ≤ ((dyadicNatIndices (Icc 1 N)).card : ℝ) ^ 8 * E := by classical let f : ℕ → ℕ → ℕ → ℕ → Ω → ℂ := fun i j k l s => if retainedFourDyadicBox S N i j k l then fourDyadicBoxSum N δ α β γ (F s) i j k l else 0 have heq (s : Ω) : (∑ n ∈ S, endpointFourConvolution δ α β γ n * F s n) = ∑ i ∈ dyadicNatIndices (Icc 1 N), ∑ j ∈ dyadicNatIndices (Icc 1 N), ∑ k ∈ dyadicNatIndices (Icc 1 N), ∑ l ∈ dyadicNatIndices (Icc 1 N), f i j k l s := by rw [endpoint_four_supported_dyadic_boxes S N hS δ α β γ (F s) (hF s)] apply sum_congr rfl intro i _ apply sum_congr rfl intro j _ apply sum_congr rfl intro k _ apply sum_congr rfl intro l _ by_cases h : retainedFourDyadicBox S N i j k l · have h' : ∃ d ∈ dyadicNatBucket (Icc 1 N) i, ∃ a ∈ dyadicNatBucket (Icc 1 N) j, ∃ b ∈ dyadicNatBucket (Icc 1 N) k, ∃ c ∈ dyadicNatBucket (Icc 1 N) l, d*a*b*c ∈ S := h simp only [f, if_pos h, if_pos h', fourDyadicBoxSum] · have h' : ¬∃ d ∈ dyadicNatBucket (Icc 1 N) i, ∃ a ∈ dyadicNatBucket (Icc 1 N) j, ∃ b ∈ dyadicNatBucket (Icc 1 N) k, ∃ c ∈ dyadicNatBucket (Icc 1 N) l, d*a*b*c ∈ S := h simp only [f, if_neg h, if_neg h'] simp_rw [heq] apply four_integrated_energy_le_card_eight μ _ f E · intro i hi j hj k hk l hl by_cases h : retainedFourDyadicBox S N i j k l · simpa only [f, if_pos h] using hf i hi j hj k hk l hl h · simp only [f, if_neg h, norm_zero, zero_pow (by omega : 2 ≠ 0)] exact integrable_zero _ _ _ · intro i hi j hj k hk l hl by_cases h : retainedFourDyadicBox S N i j k l · simpa only [f, if_pos h] using hE i hi j hj k hk l hl h · simpa only [f, if_neg h, norm_zero, zero_pow (by omega : 2 ≠ 0), integral_zero] using hE0 end Bounty end section /- The literal physical history retains a bounded condition on its entire record of states, permutations and auxiliary draws. Its weighted energy is bounded by the original full-path estimate with no record norm or counting factor. Identifying a particular independently defined physical sum remains a separate requirement. -/ namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Physical end Bounty end section /- Combining small and large conductor estimates with the principal-character loss. -/ open Finset Filter namespace Bounty theorem candidate_primitive_typeI_relative_bound_of_split (c L q C D : ℝ) (r jStar N R : ℕ) (hL : 2 ≤ L) (hmass : Real.exp L * L^(-C) ≤ candidateCoefficientWindowMass c L q r jStar) (hsmall : candidateSmallPrimitiveTypeIMass c L q r jStar N R ≤ candidateCoefficientWindowMass c L q r jStar * L^(-(D + 1))) (hlarge : candidateLargePrimitiveTypeIMass c L q r jStar N R ≤ Real.exp L * L^(-(C + D + 1))) : candidatePrimitiveTypeIMass c L q r jStar N ≤ candidateCoefficientWindowMass c L q r jStar * L^(-D) := by have hLpos : 0 < L := by linarith have hmass0 : 0 ≤ candidateCoefficientWindowMass c L q r jStar := (mul_pos (Real.exp_pos L) (Real.rpow_pos_of_pos hLpos (-C))).le.trans hmass have hpow : L^(-C) * L^(-(D + 1)) = L^(-(C + D + 1)) := by rw [← Real.rpow_add hLpos] congr 1 ring have hpow' : L * L^(-(D + 1)) = L^(-D) := by calc _ = L^(1 : ℝ) * L^(-(D + 1)) := by rw [Real.rpow_one] _ = _ := by rw [← Real.rpow_add hLpos]; congr 1; ring have hl : candidateLargePrimitiveTypeIMass c L q r jStar N R ≤ candidateCoefficientWindowMass c L q r jStar * L^(-(D + 1)) := by calc _ ≤ Real.exp L * L^(-(C + D + 1)) := hlarge _ = (Real.exp L * L^(-C)) * L^(-(D + 1)) := by rw [mul_assoc, hpow] _ ≤ _ := mul_le_mul_of_nonneg_right hmass (Real.rpow_nonneg hLpos.le _) rw [candidate_primitive_typeI_mass_split c L q r jStar N R] calc _ ≤ candidateCoefficientWindowMass c L q r jStar * L^(-(D + 1)) + candidateCoefficientWindowMass c L q r jStar * L^(-(D + 1)) := add_le_add hsmall hl _ = candidateCoefficientWindowMass c L q r jStar * (2 * L^(-(D + 1))) := by ring _ ≤ candidateCoefficientWindowMass c L q r jStar * (L * L^(-(D + 1))) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hLpos.le _)) hmass0 _ = _ := by rw [hpow'] theorem exists_candidate_relative_typeI_remainder_bound_of_large (hZ : PrimitiveZeroFreeHalfPlane) {c q θ : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hθ : θ ≤ 1) (hlarge : ∀ B : ℝ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, 0 < jStar → ∀ N : ℕ, (N : ℝ) ≤ Real.exp (θ * L) → candidateLargePrimitiveTypeIMass c L q r jStar N ⌊Real.exp ((c/512)*L)⌋₊ ≤ Real.exp L * L^(-B)) (D : ℝ) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, ∀ N : ℕ, (N : ℝ) ≤ Real.exp (θ * L) → (∑ d ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d|) ≤ candidateCoefficientWindowMass c L q r jStar * (L^(-D) + (16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := by obtain ⟨C, _, Jmass, hmass⟩ := exists_candidate_coefficient_mass_polynomial_lower hc hr hq0 hq1 hcenter obtain ⟨Jsmall, hsmall⟩ := exists_candidate_exponential_conductor_range_power_bound hZ hc hr hq0 hq1 hcenter (D + 1) refine ⟨max Jmass Jsmall, ?_⟩ intro jStar hj have hjmass : Jmass < jStar := lt_of_le_of_lt (le_max_left _ _) hj have hjsmall : Jsmall < jStar := lt_of_le_of_lt (le_max_right _ _) hj have hjpos : 0 < jStar := lt_of_le_of_lt (Nat.zero_le _) hj filter_upwards [hmass jStar hjmass, hsmall, hlarge (C + D + 1), eventually_candidate_typeI_remainder_le_primitive hc, eventually_ge_atTop (2 : ℝ)] with L hm hs hl hrem hL intro N hN have hL0 : 0 ≤ L := by linarith have hN' : (N : ℝ) ≤ Real.exp L := hN.trans (Real.exp_le_exp.mpr (by nlinarith only [hθ, hL0])) have hR : (⌊Real.exp ((c/512)*L)⌋₊ : ℝ) ≤ Real.exp ((c/512)*L) := Nat.floor_le (Real.exp_pos _).le have hprim := candidate_primitive_typeI_relative_bound_of_split c L q C D r jStar N ⌊Real.exp ((c/512)*L)⌋₊ hL hm (hs jStar hjsmall N _ hN' hR) (hl jStar hjpos N hN) calc _ ≤ candidatePrimitiveTypeIMass c L q r jStar N + candidateCoefficientWindowMass c L q r jStar * ((16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := hrem q hq0 r jStar N hN' _ ≤ candidateCoefficientWindowMass c L q r jStar * L^(-D) + candidateCoefficientWindowMass c L q r jStar * ((16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := add_le_add hprim le_rfl _ = _ := (mul_add _ _ _).symm theorem exists_candidate_relative_typeI_remainder_power_bound (hZ : PrimitiveZeroFreeHalfPlane) {c q θ : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hθ : θ < 1/2) (D : ℝ) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, ∀ N : ℕ, (N : ℝ) ≤ Real.exp (θ * L) → (∑ d ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d|) ≤ candidateCoefficientWindowMass c L q r jStar * (L^(-D) + (16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := by apply exists_candidate_relative_typeI_remainder_bound_of_large hZ hc hr hq0 hq1 hcenter (by linarith : θ ≤ 1) ?_ D intro B exact eventually_candidate_large_primitive_power_saving hc hr hcenter hq0 hq1 hθ B end Bounty end section /- Selected physical rows recover the original physical residue schedule. The literal tensor row retains its cumulative ledger and both total caps. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) end ResiduePath end Bounty end section /- An actual rough pair box avoiding the nonallowed shifted divisibility classes. -/ open Finset namespace Bounty noncomputable def maskedPairRoughFlag (W : ℝ) (p : ℕ) : Bool := by classical exact decide ((p : ℝ) ≤ W) def maskedPairBannedFlag (A : Finset ℕ) (p : ℕ) : Bool := decide (p ∉ A) noncomputable def maskedPairBox (a b c d m : ℕ) (W z : ℝ) (A : Finset ℕ) : Finset (ℕ × ℕ) := by classical exact (pairSieveBaseBox a b c d m).filter (fun v => (∀ p ∈ primeBand 0 W, ¬p ∣ v.1*v.2) ∧ (∀ p ∈ primeBand 0 z, ¬p ∣ m → p ∉ A → (v.1*v.2) % p ≠ 1 % p)) theorem masked_pair_box_subset (a b c d m : ℕ) (W z : ℝ) (hW : 0 ≤ W) (hWz : W ≤ z) (A : Finset ℕ) : maskedPairBox a b c d m W z A ⊆ pairSieveAvoidance a b c d m (maskedPairPrimes m z) (maskedPairRoughFlag W) (maskedPairBannedFlag A) := by classical have hz := hW.trans hWz intro v hv obtain ⟨hvbase, hvrough, hvban⟩ := mem_filter.mp hv apply mem_filter.mpr refine ⟨hvbase, ?_⟩ intro p hp hbad obtain ⟨hprime, hpz, _, hpm⟩ := (mem_masked_pair_primes hz).mp hp rcases hbad with ⟨hr, hzero⟩ | ⟨hb, hone⟩ · have hpW : (p : ℝ) ≤ W := by simpa [maskedPairRoughFlag] using hr exact hvrough p ((mem_primeBand_iff le_rfl hW p).mpr ⟨hprime, Nat.cast_pos.mpr hprime.pos, hpW⟩) (Nat.dvd_of_mod_eq_zero hzero) · have hpA : p ∉ A := by simpa [maskedPairBannedFlag] using hb exact hvban p ((mem_primeBand_iff le_rfl hz p).mpr ⟨hprime, Nat.cast_pos.mpr hprime.pos, hpz⟩) hpm hpA hone theorem exists_masked_pair_box_upper : ∃ K : ℝ, 0 < K ∧ ∀ (L : ℝ) (a b c d m : ℕ) [NeZero m] (W z : ℝ) (A : Finset ℕ), 1 ≤ L → (m : ℝ) ≤ Real.exp L → (∀ p ∈ m.primeFactors, L^2 ≤ (p : ℝ)) → a ≤ b → c ≤ d → 0 ≤ W → W ≤ z → 1 < z → (∀ p ∈ A, 2 ≤ p) → ((maskedPairBox a b c d m W z A).card : ℝ) ≤ K * (((b : ℝ)-a)*((d : ℝ)-c)/(m : ℝ)) * (∏ p ∈ primeBand 0 W, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) * (∏ p ∈ A, (1 - 1/(p : ℝ))⁻¹) + ((m : ℝ)*(z^(10 : ℝ))^3 + (((b : ℝ)-a)+((d : ℝ)-c))*(z^(10 : ℝ))^2) := by classical obtain ⟨K, hK, hb⟩ := exists_finite_pair_sieve_product_upper refine ⟨K*(8*Real.exp 12), by positivity, ?_⟩ intro L a b c d m hm W z A hL hmL hmin hab hcd hW hWz hz hA have hprop := fun (p : ℕ) (hp : p ∈ maskedPairPrimes m z) => (mem_masked_pair_primes (zero_lt_one.trans hz).le).mp hp have hprime : ∀ p ∈ maskedPairPrimes m z, p.Prime := fun p hp => (hprop p hp).1 have h3 : ∀ p ∈ maskedPairPrimes m z, 3 ≤ p := by intro p hp have h2 := (hprime p hp).two_le have hn := (hprop p hp).2.2.1 omega have h := hb a b c d m (maskedPairPrimes m z) (maskedPairRoughFlag W) (maskedPairBannedFlag A) hab hcd hz hprime h3 (fun p hp => (hprop p hp).2.2.2) (fun p hp => (hprop p hp).2.1) have hrf : (maskedPairPrimes m z).filter (fun p => maskedPairRoughFlag W p = true) = maskedPairRoughPrimes m W z := by ext p; simp [maskedPairRoughPrimes, maskedPairRoughFlag] have hbf : (maskedPairPrimes m z).filter (fun p => maskedPairBannedFlag A p = true) = maskedPairBannedPrimes m z A := by ext p; simp [maskedPairBannedPrimes, maskedPairBannedFlag] rw [hrf, hbf] at h have hcard : ((maskedPairBox a b c d m W z A).card : ℝ) ≤ ((pairSieveAvoidance a b c d m (maskedPairPrimes m z) (maskedPairRoughFlag W) (maskedPairBannedFlag A)).card : ℝ) := Nat.cast_le.mpr (card_le_card (masked_pair_box_subset a b c d m W z hW hWz A)) have hX : 0 ≤ (b : ℝ)-a := sub_nonneg.mpr (Nat.cast_le.mpr hab) have hY : 0 ≤ (d : ℝ)-c := sub_nonneg.mpr (Nat.cast_le.mpr hcd) have hc : 0 ≤ K * (((b : ℝ)-a)*((d : ℝ)-c)/(m : ℝ)) := by positivity have he := mul_le_mul_of_nonneg_left (masked_pair_euler_uniform_bound hL m (NeZero.ne m) hmL hmin W z hW hWz A hA) hc apply (hcard.trans h).trans apply add_le_add _ le_rfl convert he using 1 <;> ring end Bounty end section /- The actual local projected norm bound for the raw physical row minus the alternating prime-comparison rows. The only analytic input is the proved disjoint-prime-pool comparison, with its original hypotheses. -/ open Finset Filter open scoped Classical namespace Bounty noncomputable def repeatedBigPrimeDifferenceKernel {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (Q : ℕ) (h : ℝ) (kept : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (ζ Θ : ℝ) : RepeatedBigLists P J ell → RepeatedBigLists P J ell → ℂ := let slots := fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)) repeatedBigPrimeRawRow P V ζ Θ - ∑ A ∈ cleanNonemptySubsets (r.sigma slots), ∑ B ∈ cleanNonemptySubsets (t.sigma slots), (-1 : ℂ) ^ (A.card + B.card) • repeatedBigPrimeComparisonRow P V A B Q h kept kept ζ Θ theorem repeated_big_prime_difference_pairing {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (Q : ℕ) (h : ℝ) (kept : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (ζ Θ : ℝ) (f g : RepeatedBigLists P J ell → ℂ) : cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeDifferenceKernel P V probes r t Q h kept ζ Θ) f g = let slots := fun a => (probes a).map (Function.Embedding.inl (β := Fin ell)) cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeRawRow P V ζ Θ) f g - ∑ A ∈ cleanNonemptySubsets (r.sigma slots), ∑ B ∈ cleanNonemptySubsets (t.sigma slots), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeComparisonRow P V A B Q h kept kept ζ Θ) f g := by simp only [repeatedBigPrimeDifferenceKernel, clean_kernel_pairing_sub_kernel, clean_kernel_pairing_sum_kernel, clean_kernel_pairing_smul_kernel] theorem eventually_repeated_big_prime_projected_norm_le (hZ : PrimitiveZeroFreeHalfPlane) (c s z a v D ε : ℝ) (m : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (hm : 0 < m) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G] (J ell : ℕ), ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, Disjoint r t → ∀ ζ Θ : ℝ, |ζ| ≤ L ^ z → ∀ u : RepeatedBigLists P J ell → ℂ, u ∈ repeatedBigSymmetricSubspace → let slots := fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)) let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigSymmetrizeLinear (fun source => ∑ target, repeatedBigPrimeDifferenceKernel P V probes r t Q h kept ζ Θ source target * u target)) ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma slots).card + (t.sigma slots).card) * L ^ (-D)) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) u := by intro κ s' A₀ q w x filter_upwards [eventually_repeated_big_prime_disjoint_pool_comparison hZ c s z a v D ε m hc hs hz ha hv hD hε hm, eventually_gt_atTop (0 : ℝ)] with L hcomp hL intro Q h ξ G _ _ J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ u hu slots kept apply repeated_big_kernel_norm_le_of_bilinear V (fun j => (hv.trans_le (hV j)).le) (repeatedBigPrimeDifferenceKernel P V probes r t Q h kept ζ Θ) (by positivity) _ u hu intro f g hf hg rw [repeated_big_prime_difference_pairing] exact hcomp J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ f g hf hg end Bounty end section /- The exact initial-avoidance and distinctness factors on the original physical path. -/ open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (hedge : ∀ k H x e, edgePhase k H x e = (if FullMixedLocalBirthAvoids (J := J) n S B A Δ D H (some (.inr k)) x e ∧ FullMixedLocalBirthDistinct (J := J) n S B A Δ D (some (.inr k)) x e then 1 else 0) * edgePhase k (fun _ => ∅) x e) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (initial : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) include hedge in theorem full_mixed_physical_path_phase_factor (hx : FullMixedLedgerCovers n B (initial x, x)) (hp : finiteEventPathWeight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps x p ≠ 0) : fullMixedLedgerInducedPhase n S B A Δ D steps initial (finiteEventLocalPhase (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fullMixedLedgerPhase n S B A Δ D edgePhase) steps) x p = (if ∀ (a : FullMixedBirthAddress S B steps) (z : (g : Fin N) × P g), fullMixedPathBirthLabel n S B A Δ D steps x p a = some z → z.2 ∉ initial x z.1 then 1 else 0) * (if ∀ (a b : FullMixedBirthAddress S B steps) z, fullMixedPathBirthLabel n S B A Δ D steps x p a = some z → fullMixedPathBirthLabel n S B A Δ D steps x p b = some z → a = b then 1 else 0) * finiteEventLocalPhase (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedBirthResidualPhase n S B A Δ D edgePhase) steps x p := by let lift : FullMixedLedgerPath n S B A Δ D steps (initial x, x) := (finiteLedgerEventPathEquiv (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedLedgerUpdate n S B A Δ D) steps (initial x) x).symm p have hw := finite_ledger_event_path_weight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedLedgerUpdate n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps (initial x) x lift have hlift : finiteEventPathWeight (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fun tag s => fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V tag s.2) steps (initial x, x) lift ≠ 0 := by intro hz apply hp simpa only [lift, Equiv.apply_symm_apply] using hw.symm.trans hz have h := full_mixed_ledger_path_phase_factor n S B A Δ D edgePhase hedge ω μ q ρ V steps (initial x, x) lift hx hlift have hr := finite_ledger_event_local_phase (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedLedgerUpdate n S B A Δ D) (fullMixedBirthResidualPhase n S B A Δ D edgePhase) steps (initial x) x lift change finiteEventLocalPhase (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fun tag s => fullMixedBirthResidualPhase n S B A Δ D edgePhase tag s.2) steps (initial x, x) lift = _ at hr rw [hr] at h have hb (a : FullMixedBirthAddress S B steps) : fullMixedLedgerPathBirthLabel n S B A Δ D steps (initial x, x) lift a = fullMixedPathBirthLabel n S B A Δ D steps x p a := by simpa only [lift, Equiv.apply_symm_apply] using full_mixed_ledger_birth_label_projection n S B A Δ D steps (initial x) x lift a change finiteEventLocalPhase _ _ _ steps (initial x, x) lift = _ simpa only [hb, lift, Equiv.apply_symm_apply] using h end Full end Bounty end section /- The original full trace condition is retained as a function of the original physical path. -/ open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) variable (tags : ℕ → Option (I ⊕ K)) (cut : ℕ → Fin N → Finset (Fin J)) (steps : ℕ) (initialTrace : FullMixedLedgerState (fun g (p : {p // p ∈ P g}) => Subtype.val p) (M := fun _ => J + ell) B → List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (Φ : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C) → FullMixedLedgerState (fun g (p : {p // p ∈ P g}) => Subtype.val p) (M := fun _ => J + ell) B → ℂ) end Physical end Bounty end section /- Decode actual supported full states without changing marks, ledger or pending memory. -/ namespace Bounty noncomputable def physicalSupportedMarkDecode {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (hs : FullActiveInjective s.2) : PhysicalBoundedMarkState P J ell B := (physicalFullStateLabels C s.2 hs, s.1, fun g => (s.2 g).2) theorem physical_supported_mark_encode {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (hs : FullActiveInjective s.2) : physicalBoundedMarkEncode C (physicalSupportedMarkDecode C s hs) = s := Prod.ext rfl (physical_full_state_encode_labels C s.2 hs) section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (hs : FullActiveInjective s.2) end Physical end Bounty end section /- Principal-character Mellin discrepancy for the actual global prime proxy. -/ open Finset Filter namespace Bounty theorem eventually_prime_proxy_mellin_difference_bound {a S T Bsave : ℝ} (ha : 0 < a) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+Bsave+2 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight v i‖ ≤ L^(-Bsave) := by filter_upwards [eventually_prime_logarithmic_proxy_prefix_bound ha hS, eventually_linear_exponential_profile_le_rpow ha ha 20 0 (Bsave+T), eventually_ge_atTop (10 : ℝ)] with L hpref hprofile hL10 have hL : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith intro Y hY v hv m n hmn hYm hn have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY by_cases heq : m = n · subst n simp only [Ioc_self, sum_empty, norm_zero] positivity have hmn' : m < n := lt_of_le_of_ne hmn heq let g := fun i : ℕ => (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ) have hh := norm_harmonic_mellin_interval_sum_le g hY0 hmn' hYm hn (v := v) (B := 8*L^(-S)*Y+2) (by positivity) (fun i hi => hpref Y hY m i hYm ((Nat.cast_le.mpr (mem_Icc.mp hi).2).trans hn)) have hpow : 1 ≤ L^T := Real.one_le_rpow hL1 hT have hgain : 3+2*|v| ≤ 5*L^T := by nlinarith have hfirst : 40*L^T*L^(-S) ≤ L^(-Bsave)/2 := by have hcomp : L^(T-S) ≤ L^(-Bsave)/L^2 := by rw [show L^(-Bsave)/L^2 = L^(-Bsave+(-2)) by rw [Real.rpow_add hL, Real.rpow_neg hL.le] norm_num ring] apply Real.rpow_le_rpow_of_exponent_le hL1 linarith calc _ = 40*L^(T-S) := by rw [sub_eq_add_neg, Real.rpow_add hL]; ring _ ≤ 40*(L^(-Bsave)/L^2) := mul_le_mul_of_nonneg_left hcomp (by norm_num) _ ≤ L^(-Bsave)/2 := by have hC : (40 : ℝ)/L^2 ≤ 1/2 := by apply (div_le_iff₀ (by positivity : (0 : ℝ) < L^2)).mpr nlinarith calc _ = (40/L^2)*L^(-Bsave) := by ring _ ≤ (1/2)*L^(-Bsave) := mul_le_mul_of_nonneg_right hC (by positivity) _ = _ := by ring have hsecond : 10*L^T/Y ≤ L^(-Bsave)/2 := by simp only [zero_mul, add_zero] at hprofile have hrecip : 1/Y ≤ Real.exp (-a*L) := by have hh := one_div_le_one_div_of_le (Real.exp_pos (a*L)) hY simpa only [one_div, Real.exp_neg, neg_mul] using hh calc _ = (L^T/2)*(20*(1/Y)) := by ring _ ≤ (L^T/2)*(20*Real.exp (-a*L)) := by gcongr _ ≤ (L^T/2)*L^(-(Bsave+T)) := mul_le_mul_of_nonneg_left hprofile (by positivity) _ = L^(-Bsave)/2 := by rw [div_mul_eq_mul_div, ← Real.rpow_add hL] congr 2 ring calc _ = ‖∑ i ∈ Ioc m n, harmonicMellinWeight v i*g i‖ := by congr 1 apply sum_congr rfl intro i _ exact mul_comm _ _ _ ≤ ((3+2*|v|)/Y)*(8*L^(-S)*Y+2) := hh _ ≤ ((5*L^T)/Y)*(8*L^(-S)*Y+2) := by gcongr _ = 40*L^T*L^(-S)+10*L^T/Y := by field_simp; ring _ ≤ L^(-Bsave)/2+L^(-Bsave)/2 := add_le_add hfirst hsecond _ = L^(-Bsave) := by ring end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) include hstep in theorem physical_selected_adjacent_edge_block (j : Fin n) (F : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val) → ℂ) (s : PhysicalBoundedMarkState P J ell B) (hs : s.1 = L j.castSucc) : physicalSelectedEdgeBlock C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.succ) F s = (((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) ^ 2) * (ω j (productActiveMemorySplit (fun g => physicalFullSharedIndices (C j g)) B (physicalFullMemoryState (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) s.2.2)).1 (aux j) : ℂ) * globalBirthJointCutRawRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V (fun _ => ρ) hV B (2 * j.val + 1)) B B F (physicalMarkRawReadout s) := by rw [physical_selected_edge_block_eq, hs, if_pos (hlist j)] rw [physical_joint_adjacent_edge_literal_tensor C aux k L a σ τ hstep hcompat hlist hP hdis hk β η V ρ hV B] include hstep in theorem physical_selected_adjacent_state_edge_block (j : Fin n) (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) (hs : s.1 = L j.castSucc) : physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.succ) F s = (((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) ^ 2) * (ω j (productActiveMemorySplit (fun g => physicalFullSharedIndices (C j g)) B (physicalFullMemoryState (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) s.2.2)).1 (aux j) : ℂ) * globalBirthJointCutRawRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V (fun _ => ρ) hV B (2 * j.val + 1)) B B (physicalMarkRawExtension F (L j.succ)) (physicalMarkRawReadout s) := by rw [physical_selected_state_edge_block_readout] exact physical_selected_adjacent_edge_block C aux k L a σ τ hstep hcompat hlist hP hdis hk β η V ρ hV B ω retention j (physicalMarkRawExtension F (L j.succ)) s hs theorem physical_selected_adjacent_state_visit (j : Fin (n + 1)) (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = L j then F t else 0) (L j, s.2) = globalBirthJointCutRawRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β (fun _ i => 1 - retention i) V (fun _ => ρ) hV B (2 * j.val)) B B (physicalMarkRawExtension F (L j)) (physicalMarkRawReadout s) := by have hv := physical_observed_selected_state_visit C k ω β retention ρ V hV j F (L j, s.2) have hr := physical_joint_adjacent_visit_literal_tensor C aux k L a σ τ hcompat hlist hP hdis hk β (fun _ i => 1 - retention i) V ρ hV B j (fun g => physicalGroupPhaseActivity (L j) g) (physicalMarkRawExtension F (L j)) (physicalMarkRawReadout s) convert hv.trans hr.symm using 1 congr 1 funext o t split_ifs <;> rfl end ResiduePath end Bounty end section /- Coherent continuation substitution for original selected physical rows. -/ open Finset open scoped Classical namespace Bounty noncomputable def PhysicalMarkCoherent {N J ell B : ℕ} {P : Fin N → Finset ℕ} (L : PhysicalMarkLists P J ell) (s : PhysicalBoundedMarkState P J ell B) : Prop := s.1 = L ∧ GlobalBirthJointCoherent (fun g => physicalGroupPhaseActivity L g) (physicalMarkRawReadout s) theorem physical_mark_raw_extension_coherent_congr {N J ell B : ℕ} {P : Fin N → Finset ℕ} (L : PhysicalMarkLists P J ell) (F G : PhysicalBoundedMarkState P J ell B → ℂ) (hFG : ∀ t, PhysicalMarkCoherent L t → F t = G t) (u : GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) (hu : GlobalBirthJointCoherent (fun g => physicalGroupPhaseActivity L g) u) : physicalMarkRawExtension F L u = physicalMarkRawExtension G L u := by unfold physicalMarkRawExtension split_ifs with hc · exact hFG _ ⟨rfl, hu⟩ · rfl theorem physical_mark_raw_extension_zero {N J ell B : ℕ} {P : Fin N → Finset ℕ} (L : PhysicalMarkLists P J ell) : physicalMarkRawExtension (fun _ : PhysicalBoundedMarkState P J ell B => 0) L = fun _ => 0 := by funext u unfold physicalMarkRawExtension split_ifs <;> rfl section Rows variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] theorem physical_selected_visit_coherent_congr (j : I) (L : PhysicalMarkLists P J ell) (F G : PhysicalBoundedMarkState P J ell B → ℂ) (hFG : ∀ t, PhysicalMarkCoherent L t → F t = G t) (s : PhysicalBoundedMarkState P J ell B) (hs : PhysicalMarkCoherent L s) : physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = L then F t else 0) s = physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = L then G t else 0) s := by rw [← hs.1, physical_observed_selected_state_visit, physical_observed_selected_state_visit] apply global_birth_joint_cut_raw_row_congr · intro u hu apply physical_mark_raw_extension_coherent_congr · intro t ht apply hFG simpa only [hs.1] using ht · exact hu · simpa only [hs.1] using hs.2 omit [∀ g, ∀ p : ↥(P g), NeZero p.val] in theorem physical_selected_visit_zero (j : I) (L : PhysicalMarkLists P J ell) (s : PhysicalBoundedMarkState P J ell B) (hs : s.1 = L) : physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = L then 0 else 0) s = 0 := by rw [← hs, physical_observed_selected_state_visit, physical_mark_raw_extension_zero] simpa only [zero_mul] using global_birth_joint_cut_raw_row_mul (fun g => GlobalBirthRawStep.visit (a := physicalGroupPhaseActivity s.1 g) (fun _ => 0) (β g) (1 - retention j) (V g) ρ (hV g) B) B B 0 (fun _ => 0) (physicalMarkRawReadout s) theorem physical_selected_edge_coherent_congr (j : K) (aux : PhysicalAuxLabels P (C j)) (σ τ : PhysicalPermutations (Fin N) J ell) (L R : PhysicalMarkLists P J ell) (hlist : physicalListAdmissible (C j) aux (physicalPermuteLabels σ L) (physicalPermuteLabels τ R)) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ g s, ¬ ((L g s).val : ℤ) ∣ k j) (F G : PhysicalBoundedMarkState P J ell B → ℂ) (hFG : ∀ t, PhysicalMarkCoherent R t → F t = G t) (s : PhysicalBoundedMarkState P J ell B) (hs : PhysicalMarkCoherent L s) : physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j aux σ τ R F s = physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j aux σ τ R G s := by simp only [physical_selected_state_edge_block_eq, hs.1, if_pos hlist] congr 1 apply physical_raw_tensor_coherent_congr (C j) aux (k j) (physicalPermuteLabels σ L) (physicalPermuteLabels τ R) hlist hP hdis (fun g i => hk g (σ g i)) β ρ V · intro u hu apply physical_mark_raw_extension_coherent_congr R F G hFG simpa only [physical_group_phase_activity_permute] using hu · simpa only [physical_group_phase_activity_permute] using hs.2 omit [∀ g, ∀ p : ↥(P g), NeZero p.val] in theorem physical_selected_edge_zero (j : K) (aux : PhysicalAuxLabels P (C j)) (σ τ : PhysicalPermutations (Fin N) J ell) (R : PhysicalMarkLists P J ell) (s : PhysicalBoundedMarkState P J ell B) : physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j aux σ τ R (fun _ => 0) s = 0 := by rw [physical_selected_state_edge_block_eq, physical_mark_raw_extension_zero] split_ifs · rw [physical_full_edge_tensor_zero, mul_zero] · exact mul_zero _ omit [∀ g, ∀ p : ↥(P g), NeZero p.val] in omit [∀ g, ∀ p : ↥(P g), NeZero p.val] in theorem physical_selected_edge_zero_of_bad (j : K) (aux : PhysicalAuxLabels P (C j)) (σ τ : PhysicalPermutations (Fin N) J ell) (L R : PhysicalMarkLists P J ell) (hlist : physicalListAdmissible (C j) aux (physicalPermuteLabels σ L) (physicalPermuteLabels τ R)) (hbad : ¬ ∀ g a b, ((physicalPermuteLabels σ L) g a).val = ((physicalPermuteLabels τ R) g b).val → (((physicalPermuteLabels σ L) g a).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels σ L) aux : ℤ)) (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) (hs : PhysicalMarkCoherent L s) : physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j aux σ τ R F s = 0 := by rw [physical_selected_state_edge_block_eq, hs.1, if_pos hlist] rw [physical_raw_tensor_zero_of_bad_edge (C j) aux (k j) (physicalPermuteLabels σ L) (physicalPermuteLabels τ R) hlist β ρ V hbad] · exact mul_zero _ · simpa only [physical_group_phase_activity_permute] using hs.2 end Rows end Bounty end section /- Global nonprincipal Mellin cancellation for the actual count-matched rough-test proxy. -/ open Finset Filter namespace Bounty theorem eventually_rough_test_logarithmic_proxy_mellin_power_bound {a S T γ : ℝ} (ha : 0 < a) (hγ : 0 < γ) (hS : 0 ≤ S) (hT : 0 ≤ T) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), χ ≠ 1 → (r : ℝ) ≤ L^T → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc m n, (roughTestLogarithmicProxy γ L S i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by classical have ha2 : 0 < a/2 := by positivity filter_upwards [eventually_logarithmic_cell_dyad_bounds ha hS, eventually_rough_test_proxy_cell_mellin_power_bound ha2 hγ hT S (Bsave+S+1)] with L hcells hlocal have hL := hcells.1 have hδ : 0 < L^(-S) := Real.rpow_pos_of_pos hL _ intro Y hY r hr χ hχ hrT v hv m n _hmn hYm hn let F := Ioc m n let f := fun i : ℕ => (roughTestLogarithmicProxy γ L S i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r) have hF : ∀ i ∈ F, Y ≤ (i : ℝ) ∧ (i : ℝ) ≤ 2*Y := by intro i hi exact ⟨hYm.trans (Nat.cast_le.mpr (mem_Ioc.mp hi).1), (Nat.cast_le.mpr (mem_Ioc.mp hi).2).trans hn⟩ obtain ⟨hcount, hbases⟩ := hcells.2 Y hY F hF have hYsmall : Real.exp ((a/2)*L) ≤ Y := by apply le_trans _ hY exact Real.exp_le_exp.mpr (by nlinarith) have hfiber : ∀ k ∈ logarithmicCellIndices (L^(-S)) F, ‖∑ i ∈ F.filter (fun i => logarithmicCellIndex (L^(-S)) i = k), f i‖ ≤ L^(-(Bsave+S+1)) := by intro k hk let Z := logarithmicCellBase (L^(-S)) k let lo := max m ⌊Z⌋₊ let hi := min n ⌊Real.exp (L^(-S))*Z⌋₊ have heq : (∑ i ∈ F.filter (fun i => logarithmicCellIndex (L^(-S)) i = k), f i) = ∑ i ∈ Ioc lo hi, (roughTestCellProxy γ L S Z i : ℂ)*harmonicMellinWeight v i*χ (i : ZMod r) := by change (∑ i ∈ (Ioc m n).filter (fun i => logarithmicCellIndex (L^(-S)) i = k), f i) = _ rw [logarithmic_interval_fiber hδ] apply sum_congr rfl intro i hiI have hiC : i ∈ logarithmicCellSet (L^(-S)) k := mem_Ioc.mpr ⟨(le_max_right _ _).trans_lt (mem_Ioc.mp hiI).1, (mem_Ioc.mp hiI).2.trans (min_le_right _ _)⟩ dsimp [f] rw [rough_test_logarithmic_proxy_eq_on_cell hL hiC] rw [heq] by_cases hlohi : lo ≤ hi · apply hlocal Y Z hYsmall (hbases k hk) r χ hχ hrT v hv lo hi hlohi · exact hYm.trans (Nat.cast_le.mpr (Nat.add_le_add_right (le_max_left _ _) 1)) · exact (Nat.cast_le.mpr (min_le_left _ _)).trans hn · exact le_max_right _ _ · exact min_le_right _ _ · rw [Ioc_eq_empty_of_le (by omega : hi ≤ lo), sum_empty, norm_zero] positivity change ‖∑ i ∈ F, f i‖ ≤ _ rw [← sum_logarithmic_cell_fibers (L^(-S)) F f] calc _ ≤ ∑ k ∈ logarithmicCellIndices (L^(-S)) F, ‖∑ i ∈ F.filter (fun i => logarithmicCellIndex (L^(-S)) i = k), f i‖ := norm_sum_le _ _ _ ≤ ∑ _k ∈ logarithmicCellIndices (L^(-S)) F, L^(-(Bsave+S+1)) := sum_le_sum hfiber _ = ((logarithmicCellIndices (L^(-S)) F).card : ℝ)*L^(-(Bsave+S+1)) := by simp only [sum_const, nsmul_eq_mul] _ ≤ L^(S+1)*L^(-(Bsave+S+1)) := mul_le_mul_of_nonneg_right hcount (by positivity) _ = L^(-Bsave) := by rw [← Real.rpow_add hL]; congr 1; ring end Bounty end section /- Principal-character Mellin discrepancy for the actual global rough-test proxy. -/ open Finset Filter namespace Bounty theorem eventually_rough_test_proxy_mellin_difference_bound {a S T Bsave γ : ℝ} (ha : 0 < a) (hγ : 0 < γ) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+Bsave+2 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight v i‖ ≤ L^(-Bsave) := by filter_upwards [eventually_rough_test_logarithmic_proxy_prefix_bound ha hγ hS, eventually_linear_exponential_profile_le_rpow ha ha 20 0 (Bsave+T), eventually_ge_atTop (10 : ℝ)] with L hpref hprofile hL10 have hL : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith intro Y hY v hv m n hmn hYm hn have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY by_cases heq : m = n · subst n simp only [Ioc_self, sum_empty, norm_zero] positivity have hmn' : m < n := lt_of_le_of_ne hmn heq let g := fun i : ℕ => ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ) have hh := norm_harmonic_mellin_interval_sum_le g hY0 hmn' hYm hn (v := v) (B := 8*L^(-S)*Y+2) (by positivity) (fun i hi => hpref Y hY m i hYm ((Nat.cast_le.mpr (mem_Icc.mp hi).2).trans hn)) have hpow : 1 ≤ L^T := Real.one_le_rpow hL1 hT have hgain : 3+2*|v| ≤ 5*L^T := by nlinarith have hfirst : 40*L^T*L^(-S) ≤ L^(-Bsave)/2 := by have hcomp : L^(T-S) ≤ L^(-Bsave)/L^2 := by rw [show L^(-Bsave)/L^2 = L^(-Bsave+(-2)) by rw [Real.rpow_add hL, Real.rpow_neg hL.le] norm_num ring] apply Real.rpow_le_rpow_of_exponent_le hL1 linarith calc _ = 40*L^(T-S) := by rw [sub_eq_add_neg, Real.rpow_add hL]; ring _ ≤ 40*(L^(-Bsave)/L^2) := mul_le_mul_of_nonneg_left hcomp (by norm_num) _ ≤ L^(-Bsave)/2 := by have hC : (40 : ℝ)/L^2 ≤ 1/2 := by apply (div_le_iff₀ (by positivity : (0 : ℝ) < L^2)).mpr nlinarith calc _ = (40/L^2)*L^(-Bsave) := by ring _ ≤ (1/2)*L^(-Bsave) := mul_le_mul_of_nonneg_right hC (by positivity) _ = _ := by ring have hsecond : 10*L^T/Y ≤ L^(-Bsave)/2 := by simp only [zero_mul, add_zero] at hprofile have hrecip : 1/Y ≤ Real.exp (-a*L) := by have hh := one_div_le_one_div_of_le (Real.exp_pos (a*L)) hY simpa only [one_div, Real.exp_neg, neg_mul] using hh calc _ = (L^T/2)*(20*(1/Y)) := by ring _ ≤ (L^T/2)*(20*Real.exp (-a*L)) := by gcongr _ ≤ (L^T/2)*L^(-(Bsave+T)) := mul_le_mul_of_nonneg_left hprofile (by positivity) _ = L^(-Bsave)/2 := by rw [div_mul_eq_mul_div, ← Real.rpow_add hL] congr 2 ring calc _ = ‖∑ i ∈ Ioc m n, harmonicMellinWeight v i*g i‖ := by congr 1 apply sum_congr rfl intro i _ exact mul_comm _ _ _ ≤ ((3+2*|v|)/Y)*(8*L^(-S)*Y+2) := hh _ ≤ ((5*L^T)/Y)*(8*L^(-S)*Y+2) := by gcongr _ = 40*L^T*L^(-S)+10*L^T/Y := by field_simp; ring _ ≤ L^(-Bsave)/2+L^(-Bsave)/2 := add_le_add hfirst hsecond _ = L^(-Bsave) := by ring end Bounty end section /- The actual samples at any owner realize the fixed original forest child counts. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (x s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) section Ghost variable (j : J) (htag : steps.get u = some (.inl j)) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Ghost section Edge variable (k : K) (htag : steps.get u = some (.inr k)) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Edge end Full end Bounty end section /- The exact original forest indicator is a causal product along the same original mixed path. -/ open Finset Classical namespace Bounty section Factor variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Factor end Bounty end section /- The actual ghost and edge sample sums split by fixed skeleton support without altering the continuation. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedBirthAddress S B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) section Ghost variable [∀ g p, NeZero (n g p)] (j : J) (htag : steps.get u = some (.inl j)) (sk : CoupledGhostSkeleton M B s) end Ghost section Edge variable (k : K) (htag : steps.get u = some (.inr k)) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) end Edge end Full end Bounty end section /- Uniform normalized cofactor bounds for the finite Buchstab induction. -/ namespace Bounty open Finset Filter Real MeasureTheory open scoped Topology theorem exists_normalized_rough_cell_bound {a γ₀ : ℝ} (ha : 0 < a) (hγ₀ : 0 < γ₀) : ∃ C : ℝ, 0 < C ∧ ∀ S : ℝ, ∀ᶠ L : ℝ in atTop, ∀ γ w : ℝ, γ₀ ≤ γ → a ≤ w → 0 ≤ normalizedRoughCellCount L S (exp (w*L)) (exp (γ*L)) ∧ normalizedRoughCellCount L S (exp (w*L)) (exp (γ*L)) ≤ C := by obtain ⟨C, hC, hbound⟩ := exists_exponential_rough_logarithmic_cell_upper ha hγ₀ refine ⟨C, hC, fun S => ?_⟩ filter_upwards [hbound S, eventually_gt_atTop (0 : ℝ)] with L hboundL hL intro γ w hγ hw refine ⟨normalized_rough_cell_count_nonneg hL (exp_pos _), ?_⟩ unfold normalizedRoughCellCount apply (div_le_iff₀ (logarithmic_cell_count_scale_pos hL (exp_pos _))).mpr have hb := hboundL γ hγ (exp (w*L)) (exp_le_exp.mpr (mul_le_mul_of_nonneg_right hw hL.le)) simpa only [logarithmicCellCountScale, mul_div_assoc] using hb theorem prime_band_reciprocal_weight_error (f g : ℕ → ℝ) {A B δ : ℝ} (hfg : ∀ p ∈ primeBand A B, |f p-g p| ≤ δ) : |(∑ p ∈ primeBand A B, f p/(p : ℝ)) - (∑ p ∈ primeBand A B, g p/(p : ℝ))| ≤ δ*primeBandHarmonic A B := by rw [← sum_sub_distrib] calc _ ≤ ∑ p ∈ primeBand A B, |f p/(p : ℝ)-g p/(p : ℝ)| := abs_sum_le_sum_abs _ _ _ ≤ ∑ p ∈ primeBand A B, δ*(1/(p : ℝ)) := by apply sum_le_sum intro p hp rw [← sub_div, abs_div, abs_of_nonneg (show (0 : ℝ) ≤ (p : ℝ) from Nat.cast_nonneg p)] convert div_le_div_of_nonneg_right (hfg p hp) (Nat.cast_nonneg p) using 1; ring _ = _ := by unfold primeBandHarmonic; rw [mul_sum] theorem prime_band_reciprocal_weight_bound (f : ℕ → ℝ) {A B C : ℝ} (hf : ∀ p ∈ primeBand A B, |f p| ≤ C) : |∑ p ∈ primeBand A B, f p/(p : ℝ)| ≤ C*primeBandHarmonic A B := by simpa only [sub_zero, zero_div, sum_const_zero] using prime_band_reciprocal_weight_error f (fun _ => 0) (by simpa only [sub_zero] using hf) def UniformRoughDepthApprox (n : ℕ) (S : ℝ) : Prop := ∀ a b γ₀ gap : ℝ, 0 < a → 0 < γ₀ → 0 < gap → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ w γ : ℝ, a ≤ w → w ≤ b → γ₀ ≤ γ → gap ≤ w-γ → w+L^(-S)/L ≤ ((n : ℝ)+2)*γ → |normalizedRoughCellCount L S (exp (w*L)) (exp (γ*L))- buchstabDepthDensity n γ w| ≤ ε theorem uniform_rough_depth_cofactor_pointwise {n : ℕ} {S : ℝ} (hprev : UniformRoughDepthApprox n S) {a b γ₀ η τ : ℝ} (ha : 0 < a) (hγ₀ : 0 < γ₀) (hη : 0 < η) (hτ : 0 < τ) : ∀ᶠ L : ℝ in atTop, ∀ w γ α : ℝ, a ≤ w → w ≤ b → γ₀ ≤ γ → γ ≤ α → α ≤ w/2-η → w+L^(-S)/L ≤ ((n : ℝ)+3)*γ → |normalizedRoughCellCount L S (exp ((w-α)*L)) (exp (α*L))- buchstabDepthExtendedKernel n w α| ≤ τ := by filter_upwards [hprev (a/2) b γ₀ (2*η) (half_pos ha) hγ₀ (by positivity) τ hτ] with L hL intro w γ α haw hwb hγ hγα hα htop obtain ⟨hwlo,hwhi,hαlo,hgap,hdepth⟩ := buchstab_good_cofactor_domain n hη.le haw hwb hγ hγα hα htop rw [buchstab_depth_extended_kernel_eq n (by linarith)] exact hL (w-α) α hwlo (by linarith) hαlo hgap hdepth theorem prime_band_reciprocal_split_error (f g : ℕ → ℝ) {A B C D τ U V : ℝ} (hAB : A ≤ B) (hBC : B ≤ C) (hCD : C ≤ D) (hgood : ∀ p ∈ primeBand A B, |f p-g p| ≤ τ) (hf : ∀ p ∈ primeBand B D, |f p| ≤ U) (hg : ∀ p ∈ primeBand B C, |g p| ≤ V) : |(∑ p ∈ primeBand A D, f p/(p : ℝ)) - (∑ p ∈ primeBand A C, g p/(p : ℝ))| ≤ τ*primeBandHarmonic A B+U*primeBandHarmonic B D+V*primeBandHarmonic B C := by have heqf := prime_band_sum_add_adjacent (fun p => f p/(p : ℝ)) hAB (hBC.trans hCD) have heqg := prime_band_sum_add_adjacent (fun p => g p/(p : ℝ)) hAB hBC have hmain := prime_band_reciprocal_weight_error f g hgood have htailf := prime_band_reciprocal_weight_bound f hf have htailg := prime_band_reciprocal_weight_bound g hg rw [← heqf, ← heqg] have htri := abs_add_le ((∑ p ∈ primeBand A B, f p/(p : ℝ))-(∑ p ∈ primeBand A B, g p/(p : ℝ))) ((∑ p ∈ primeBand B D, f p/(p : ℝ))-(∑ p ∈ primeBand B C, g p/(p : ℝ))) have htri' := abs_sub (∑ p ∈ primeBand B D, f p/(p : ℝ)) (∑ p ∈ primeBand B C, g p/(p : ℝ)) have heq : (∑ p ∈ primeBand A B, f p/(p : ℝ))+ (∑ p ∈ primeBand B D, f p/(p : ℝ))- ((∑ p ∈ primeBand A B, g p/(p : ℝ))+(∑ p ∈ primeBand B C, g p/(p : ℝ))) = ((∑ p ∈ primeBand A B, f p/(p : ℝ))-(∑ p ∈ primeBand A B, g p/(p : ℝ)))+ ((∑ p ∈ primeBand B D, f p/(p : ℝ))-(∑ p ∈ primeBand B C, g p/(p : ℝ))) := by ring rw [heq] linarith theorem prime_band_eq_empty_of_upper_le {A B : ℝ} (hBA : B ≤ A) : primeBand A B = ∅ := by simp only [primeBand, Ioc_eq_empty_of_le (Nat.floor_mono hBA), filter_empty] theorem logarithmic_cell_sqrt_exp (w S : ℝ) {L : ℝ} (hL : L ≠ 0) : sqrt (exp (L^(-S))*exp (w*L)) = exp (((w+L^(-S)/L)/2)*L) := by have heq : exp (L^(-S))*exp (w*L) = (exp (((w+L^(-S)/L)/2)*L))^2 := by rw [pow_two, ← exp_add, ← exp_add] congr 1 field_simp ring rw [heq, sqrt_sq (exp_pos _).le] end Bounty /- Public declaration closure audit. -/ end section /- Candidate-prime arithmetic supplies reverse eligibility rarity for the literal mixed storage operator with both small-slot averages. The small measure is the original residue-valid measure, and big labels may repeat. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem uniform_indicator_probability_fintype_eq {T : Type*} (fa fb : Fintype T) (P : T → Prop) : (∑ t ∈ fa.elems, if P t then 1 / (@Fintype.card T fa : ℝ) else 0) = ∑ t ∈ fb.elems, if P t then 1 / (@Fintype.card T fb : ℝ) else 0 := by cases Subsingleton.elim fa fb rfl end Bounty end section /- The original mixed divisor is unchanged when only the big groups are reindexed. -/ open scoped Classical namespace Bounty section ReindexShared variable {G H : Type*} [Fintype G] [Fintype H] {P : G → Finset ℕ} {J ell : ℕ} (e : G ≃ H) (C : G → Finset (Fin J)) end ReindexShared section Encoded variable {G H : Type*} [Fintype G] [Fintype H] {P : G → Finset ℕ} {J ell B : ℕ} (small : G → Prop) (e : {g : G // ¬small g} ≃ H) (C : G → Finset (Fin J)) (hC : ∀ g, small g → C g = ∅) (aux : PhysicalAuxLabels P C) (L : PhysicalMarkLists P J ell) {Z : H → Type*} (q : ∀ h, BoundedOrderedTuple (Z h) B) include hC in theorem physical_mixed_shared_D_reindexed : physicalMixedSharedD (fun h => C (e.symm h).val) (physicalSharedPrefix (fun g : {g // small g} => L g.val)) (productActiveMemorySplit (fun h => physicalFullSharedIndices (C (e.symm h).val)) B (physicalFullMemoryState (fun h => C (e.symm h).val) (physicalMarkGroupReindex e (fun g => P g.val) J ell (fun g => L g.val)) q)).1 (physicalAuxGroupReindex e (fun g => P g.val) J (fun g => C g.val) (fun g => aux g.val)) = physicalD C L aux := by rw [physical_mixed_shared_D_at_state] rw [physical_D_group_reindex e (fun g : {g // ¬small g} => C g.val) (fun g => aux g.val) (fun g => L g.val)] symm rw [physical_D_group_split small C aux L, physical_D_empty_cut (fun g : {g // small g} => C g.val) (fun g => hC g.val g.property)] end Encoded end Bounty end section /- Nonnegative weighted enlargement from actual least-prime-factor pairs to ambient tests. -/ open Finset Real namespace Bounty theorem weighted_subset_le_test_sum {α : Type*} [DecidableEq α] {A B : Finset α} (hAB : A ⊆ B) (w t : α → ℝ) (hw : ∀ x ∈ B, 0 ≤ w x) (ht : ∀ x ∈ B, 0 ≤ t x) (hAt : ∀ x ∈ A, t x = 1) : (∑ x ∈ A, w x) ≤ ∑ x ∈ B, w x*t x := by calc _ = ∑ x ∈ A, w x*t x := by apply sum_congr rfl intro x hx rw [hAt x hx, mul_one] _ ≤ _ := sum_le_sum_of_subset_of_nonneg hAB (fun x hx _ => mul_nonneg (hw x hx) (ht x hx)) theorem shifted_buchstab_mesh_bin_rough_test {T : Finset ℕ} (hT : ∀ u ∈ T, 0 < u) {b q L : ℝ} {N i : ℕ} {v : ℕ × ℕ} (hv : v ∈ shiftedBuchstabMeshBin T b q L N i) : exponentialRoughTest (reciprocalGrid b q N i) L v.2 := by have hmem := mem_shifted_buchstab_mesh_bin.mp hv have hp := shifted_buchstab_pair_properties T (exp (b*L)) hT (mem_shifted_buchstab_unbalanced_pairs.mp hmem.1).1 have hlo := ((mem_primeBand_iff (exp_pos _).le (exp_pos _).le v.1).mp hmem.2).2.1 intro p hpf exact hlo.trans_le (Nat.cast_le.mpr (hp.2.2.2.2.2 p hpf)) theorem shifted_buchstab_mesh_bin_rough_indicator {T : Finset ℕ} (hT : ∀ u ∈ T, 0 < u) {b q L : ℝ} {N i : ℕ} {v : ℕ × ℕ} (hv : v ∈ shiftedBuchstabMeshBin T b q L N i) : roughTestIndicator (reciprocalGrid b q N i) L v.2 = 1 := by simp only [roughTestIndicator, if_pos (shifted_buchstab_mesh_bin_rough_test hT hv)] theorem shifted_buchstab_mesh_bin_le_ambient_rough_test {T : Finset ℕ} (hT : ∀ u ∈ T, 0 < u) {b q L : ℝ} {N i : ℕ} (A : Finset (ℕ × ℕ)) (μ : ℕ → ℝ) (hsub : shiftedBuchstabMeshBin T b q L N i ⊆ A) (hμ : ∀ v ∈ A, 0 ≤ μ (shiftedPairIndex v)) : (∑ v ∈ shiftedBuchstabMeshBin T b q L N i, μ (shiftedPairIndex v)) ≤ ∑ v ∈ A, μ (shiftedPairIndex v)*roughTestIndicator (reciprocalGrid b q N i) L v.2 := by apply weighted_subset_le_test_sum hsub _ _ hμ · intro v hv unfold roughTestIndicator split <;> norm_num · intro v hv exact shifted_buchstab_mesh_bin_rough_indicator hT hv theorem shifted_buchstab_balanced_le_ambient_prime_test {T : Finset ℕ} (hT : ∀ u ∈ T, 0 < u) {b q L : ℝ} (A : Finset (ℕ × ℕ)) (μ : ℕ → ℝ) (hsub : shiftedBuchstabBalancedPairs T b q L ⊆ A) (hμ : ∀ v ∈ A, 0 ≤ μ (shiftedPairIndex v)) (hprime : ∀ v ∈ shiftedBuchstabBalancedPairs T b q L, v.2.Prime) : (∑ v ∈ shiftedBuchstabBalancedPairs T b q L, μ (shiftedPairIndex v)) ≤ ∑ v ∈ A, μ (shiftedPairIndex v)* ((if v.1.Prime then 1 else 0)*(if v.2.Prime then 1 else 0)) := by apply weighted_subset_le_test_sum hsub _ _ hμ · intro v hv positivity · intro v hv have hp := shifted_buchstab_pair_properties T (exp (b*L)) hT (mem_shifted_buchstab_balanced_pairs.mp hv).1 simp only [if_pos hp.1, if_pos (hprime v hv), mul_one] end Bounty end section /- Exact reencoding of the actual mixed clean edge. The divisor includes both small and big shared factors; both total-memory cutoffs remain in the row. -/ open Finset open scoped Classical namespace Bounty theorem physical_mixed_clean_event_sum_reencode {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {J ell B : ℕ} {P : G → Finset ℕ} [∀ g (p : P g), NeZero p.val] (C : G → Finset (Fin J)) (k : ℤ) (d : PhysicalSharedLists Ps J) (ω : PhysicalAuxLabels P C → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (Θ : PhysicalAuxLabels P C → (∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) → ℂ) (f : PhysicalAuxLabels P C → CleanFullMemoryState P J ell B → ℂ) (hf : ∀ aux, ProductMemorySymmetric (f aux)) (x : CleanFullMemoryState P J ell B) : let τ := fullActivePermutation (cleanPhysicalSlotChange C) let y := τ x let Sp := fun g => physicalFullSharedIndices (ell := ell) (C g) let Sc := cleanFullSharedSlots (ell := ell) C let cp := (productActiveMemorySplit Sp B y).1 let sp := (productActiveMemorySplit Sp B y).2 let cc := (productActiveMemorySplit Sc B x).1 let sc := (productActiveMemorySplit Sc B x).2 (∑ e : FullActiveEdgeEvent (fun g (p : P g) => p.val) Sp B (fun _ => PhysicalAuxLabels P C) (physicalMixedEdgeDelta C k d) (physicalMixedEdgeD C d) y, (fullActiveEdgeEventWeight (fun g (p : P g) => p.val) Sp B (fun _ => PhysicalAuxLabels P C) (physicalMixedEdgeDelta C k d) (physicalMixedEdgeD C d) (fun _ => ω) μ ρ V y e : ℂ) * (if ∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅ then Θ e.1 (physicalCleanFreshEquiv (fun g => ↥(P g)) C (fun g => (unrestrictedJointEventTarget (fun g (p : P g) => p.val) (physicalMixedEdgeDelta C k d cp e.1) (physicalMixedEdgeD C d cp e.1) (fun g => (Sp g)ᶜ.card) B sp e.2 g).1)) else 0) * f e.1 (τ.symm (fullActiveEdgeEventTarget (fun g (p : P g) => p.val) Sp B (fun _ => PhysicalAuxLabels P C) (physicalMixedEdgeDelta C k d) (physicalMixedEdgeD C d) y e))) = ∑ e : FullActiveEdgeEvent (fun g (p : P g) => p.val) Sc B (fun _ => PhysicalAuxLabels P C) (canonicalMixedEdgeDelta C k d) (canonicalMixedEdgeD C d) x, (fullActiveEdgeEventWeight (fun g (p : P g) => p.val) Sc B (fun _ => PhysicalAuxLabels P C) (canonicalMixedEdgeDelta C k d) (canonicalMixedEdgeD C d) (fun _ => ω) μ ρ V x e : ℂ) * (if ∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅ then Θ e.1 (fun g => (unrestrictedJointEventTarget (fun g (p : P g) => p.val) (canonicalMixedEdgeDelta C k d cc e.1) (canonicalMixedEdgeD C d cc e.1) (fun g => (Sc g)ᶜ.card) B sc e.2 g).1) else 0) * f e.1 (fullActiveEdgeEventTarget (fun g (p : P g) => p.val) Sc B (fun _ => PhysicalAuxLabels P C) (canonicalMixedEdgeDelta C k d) (canonicalMixedEdgeD C d) x e) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro τ y Sp Sc cp sp cc sc have hsym (a : PhysicalAuxLabels P C) : ProductMemorySymmetric (fun z => f a (τ.symm z)) := fullActivePermutation_symmetric (fun g => (cleanPhysicalSlotChange C g).symm) (f a) (hf a) have hp := full_active_clean_event_sum (fun g (p : P g) => p.val) Sp B (fun _ => PhysicalAuxLabels P C) (physicalMixedEdgeDelta C k d) (physicalMixedEdgeD C d) (fun _ => ω) μ ρ V (fun _ a fresh => Θ a (physicalCleanFreshEquiv (fun g => ↥(P g)) C fresh)) (fun _ a z => f a (τ.symm z)) (fun _ a => hsym a) y have hc := full_active_clean_event_sum (fun g (p : P g) => p.val) Sc B (fun _ => PhysicalAuxLabels P C) (canonicalMixedEdgeDelta C k d) (canonicalMixedEdgeD C d) (fun _ => ω) μ ρ V (fun _ a fresh => Θ a fresh) (fun _ => f) (fun _ => hf) x dsimp only at hp hc refine Eq.trans ?_ (hp.trans (Eq.trans ?_ (hc.symm.trans ?_))) · apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ split_ifs <;> rfl · rw [show productTotalMemory y = productTotalMemory x from rfl] split_ifs · apply sum_congr rfl intro a _ have hd : physicalMixedEdgeDelta C k d cp a = canonicalMixedEdgeDelta C k d cc a := physical_mixed_clean_delta_reencode C d x a k change (ω a : ℂ) * (∏ g, (unrestrictedBoundedCleanFactor _ (physicalMixedEdgeDelta C k d cp a g) ρ (sp g) : ℂ)) * _ = (ω a : ℂ) * (∏ g, (unrestrictedBoundedCleanFactor _ (canonicalMixedEdgeDelta C k d cc a g) ρ (sc g) : ℂ)) * _ rw [hd] have hfactor : (∏ g, (unrestrictedBoundedCleanFactor (fun p : P g => p.val) (canonicalMixedEdgeDelta C k d cc a g) ρ (sp g) : ℂ)) = ∏ g, (unrestrictedBoundedCleanFactor (fun p : P g => p.val) (canonicalMixedEdgeDelta C k d cc a g) ρ (sc g) : ℂ) := by apply prod_congr rfl intro g _ rfl rw [hfactor] congr 1 let F := fun fresh : (∀ g, Fin (Sc g)ᶜ.card → P g) => Θ a fresh * f a ((productActiveMemorySplit Sc B).symm (cc, fun g => unrestrictedBoundedCleanTarget (fun p : P g => p.val) (canonicalMixedEdgeDelta C k d cc a g) (sc g) (fresh g))) have hsum := physical_clean_fresh_weighted_sum (fun g => ↥(P g)) C μ F simp only [F, ← mul_assoc] at hsum refine Eq.trans ?_ hsum apply sum_congr rfl intro fresh _ congr 1 have hr := physical_clean_reassemble_fresh C x (fun g => (unrestrictedBoundedCleanTarget (fun p : P g => p.val) (canonicalMixedEdgeDelta C k d cc a g) (sc g) ((physicalCleanFreshEquiv (fun g => ↥(P g)) C fresh) g)).2) fresh change _ = τ _ at hr rw [show (productActiveMemorySplit Sp B).symm (_, fun g => unrestrictedBoundedCleanTarget (fun p : P g => p.val) (canonicalMixedEdgeDelta C k d cc a g) (sp g) (fresh g)) = _ from hr] rw [Equiv.symm_apply_apply] rfl · rfl · apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ split_ifs <;> rfl end Bounty end section /- Exact original small conditioning at one actual auxiliary draw, using the physical mixed divisor and displacement. Endpoint gates stay in their original order; this theorem assumes no clean operator norm. -/ open Finset open scoped Classical namespace Bounty theorem physical_mixed_clean_fixed_aux_pairing {S G : Type*} [Fintype S] [Fintype G] [DecidableEq S] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] [∀ g (p : P g), NeZero p.val] (C : G → Finset (Fin J)) (k : ℤ) (a : PhysicalAuxLabels P C) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (q : ℝ) (W : CleanFullMemoryState P J ell B → ℝ) (smallAux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (initial : ∀ g, Finset (P g)) (Ψ : ∀ d x, PhysicalResidues Ps → PhysicalSmallBigFullEvent (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) d x → ℂ) (sourceGate targetGate u F : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : let n := fun g (p : P g) => p.val let shared := fun g => physicalFullSharedIndices (ell := ell) (C g) let Δ := fun d c => physicalMixedEdgeDelta C k d c a let D := fun d c => physicalMixedEdgeD C d c a let kbig := fun c => physicalMixedBigStep C k c a (∑ s, (physicalSmallBigMeasure Vs W s : ℂ) * (starRingEnd ℂ) (u s) * physicalSmallBigFullPhasedAction n shared B Δ D μ ρ V kbig Vs q (physicalSmallBigEndpointPhase (PhysicalSmallBigFullEvent n shared B Δ D) (physicalSmallBigFullTarget n shared B Δ D) (fun r d x e => physicalSmallBigCleanInitialPhase n shared B Δ D initial Ψ d x r e) (fun x => kbig (productActiveMemorySplit shared B x).1) sourceGate targetGate) F s) = ∑ d, ∑ r, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition Vs q (fun s => sourceGate s * u s) d x r) * fullActiveExternalCoefficientAction n shared B (fun _ => Unit) (fun c _ => Δ d c) (fun c _ => D d c) (fun _ _ => 1) μ ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (kbig c * (physicalSharedProduct d : ℕ))) (physicalSmallBigCleanInitialPhase n shared B Δ D initial Ψ d) (physicalSmallBigCondition Vs q (fun s => targetGate s * F s) d) x r := by exact physical_small_big_clean_initial_pairing (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) μ ρ V (fun c => physicalMixedBigStep C k c a) Vs hVs q W smallAux initial Ψ sourceGate targetGate u F end Bounty end section /- Character expansion of the actual finite determinant sum, with all quotient cutoffs. -/ open Finset open scoped ComplexConjugate namespace Bounty def TypeIIFreeShiftConditions (E N : Finset ℕ) (y : TypeIIShiftIndex) : Prop := 0 < y.2.1.1 ∧ y.1.1 ≠ 0 ∧ y.1.2 = y.2.2.1 * y.2.1.2 ∧ (y.1.2 : ℤ) + y.1.1 = (y.2.1.1 : ℤ) * y.2.2.2 ∧ 0 < typeIIRecoveredE y ∧ 0 < typeIIRecoveredN y ∧ (typeIIRecoveredE y).toNat ∈ E ∧ (typeIIRecoveredN y).toNat ∈ N noncomputable def typeIIFreeDeterminantSlice (E N M H Z : Finset ℕ) (k : ℤ) : Finset TypeIIShiftIndex := by classical exact ((({k} : Finset ℤ) ×ˢ Z) ×ˢ ((M ×ˢ H) ×ˢ (M ×ˢ H))).filter (TypeIIFreeShiftConditions E N) noncomputable def typeIIShiftComplexWeight (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) (y : TypeIIShiftIndex) : ℂ := (η (typeIIRecoveredE y).toNat (typeIIRecoveredN y).toNat : ℂ) * (α y.2.1.1 * conj (α y.2.2.1) * aH y.2.1.2 * conj (aH y.2.2.2)) theorem typeII_shift_complex_weight_re (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) (y : TypeIIShiftIndex) : (typeIIShiftComplexWeight η α aH y).re = typeIIShiftWeight η α aH y := by exact Complex.re_ofReal_mul _ _ end Bounty end section /- Actual signed path energy on the genuine mixed state. Small coordinates may change at every edge. The ghost parameter is independent of the edge parameter, and no local operator bound remains as a hypothesis. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Exact exponential extraction for any whole-path mask forcing births. -/ open Finset Classical namespace Bounty section variable {H K S G : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : K → Type) [∀ k, Fintype (A k)] (Δ D : ∀ k, PhysicalSharedLists Ps J → SharedActiveLabels P (shared k) → A k → G → ℤ) (kbig : ∀ k, SharedActiveLabels P (shared k) → A k → ℤ) (ω : ∀ k, A k → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) (steps : List (Option (H ⊕ K))) (allowed : ∀ s, PhysicalSmallBigPath (ell := ell) n shared B A Δ D kbig steps s → Prop) (phase : ∀ s, PhysicalSmallBigPath (ell := ell) n shared B A Δ D kbig steps s → ℂ) end end Bounty end section /- Discharge cross-pool disjointness for the actual small/big subtype split. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Original big-prime nondivisibility survives multiplication by the small shared product. -/ open scoped Classical namespace Bounty section Multiplier variable {S G : Type*} [Fintype S] {Ps : S → Finset ℕ} {P : G → Finset ℕ} (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) {J : ℕ} (d : PhysicalSharedLists Ps J) include hPs hP hdis in theorem physical_big_prime_dvd_effective_multiplier (g : G) (p : ↥(P g)) (k : ℤ) : (p.val : ℤ) ∣ k * (physicalSharedProduct d : ℕ) ↔ (p.val : ℤ) ∣ k := by have hp : Prime (p.val : ℤ) := Int.prime_iff_natAbs_prime.mpr (by simpa using hP g p.val p.property) have hn : ¬ (p.val : ℤ) ∣ (physicalSharedProduct d : ℕ) := by exact_mod_cast physical_big_prime_not_dvd_small_shared hPs hP hdis d g p exact hp.dvd_mul.trans (or_iff_left hn) include hPs hP hdis in theorem physical_big_prime_not_dvd_effective_multiplier (g : G) (p : ↥(P g)) (k : ℤ) (hk : ¬ (p.val : ℤ) ∣ k) : ¬ (p.val : ℤ) ∣ k * (physicalSharedProduct d : ℕ) := by exact fun h => hk ((physical_big_prime_dvd_effective_multiplier hPs hP hdis d g p k).mp h) end Multiplier end Bounty end section /- Mixed big paths are the original physical big paths with multiplier k times the small shared product. -/ open scoped Classical namespace Bounty section Physical variable {S K V : Type*} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) (C : K → Fin N → Finset (Fin J)) (d : K → PhysicalSharedLists Ps J) (k : K → ℤ) (B : ℕ) noncomputable def physicalMixedEffectiveBigPathEquiv (steps : List (Option (V ⊕ K))) (x : ProductBoundedOrderedState (fun g => ↥(P g)) (fun g => UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) (fun _ => J + ell) B) : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) steps x ≃ FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key)) steps x := fullPermutationParameterPathEquiv _ _ B _ _ _ _ _ (fun key => funext fun c => funext fun a => funext fun g => physical_mixed_delta_effective_big_step (C key) (d key) (k key) c a g) (fun key c a g p => physical_mixed_dilation_divisibility hPs hP hdis (C key) (d key) c a g p) steps x variable [∀ g, ∀ p : ↥(P g), NeZero p.val] theorem physical_mixed_effective_big_path_action (ω : ∀ key, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C key g)) → PhysicalAuxLabels P (C key) → ℝ) (μ : ∀ g, ↥(P g) → ℝ) (q : V → ℝ) (ρ : ℝ) (Vb : Fin N → ℝ) (steps : List (Option (V ⊕ K))) (phase : ∀ x, FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) steps x → ℂ) (f : ProductBoundedOrderedState (fun g => ↥(P g)) (fun g => UnrestrictedResidueParticle (fun p : ↥(P g) => p.val)) (fun _ => J + ell) B → ℂ) : fullPermutationMixedPathAction (fun g (p : ↥(P g)) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) ω μ q ρ Vb steps phase f = fullPermutationMixedPathAction (fun g (p : ↥(P g)) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key)) ω μ q ρ Vb steps (fun x p => phase x ((physicalMixedEffectiveBigPathEquiv hPs hP hdis C d k B steps x).symm p)) f := full_permutation_parameter_path_action _ _ B _ _ _ _ _ (fun key => funext fun c => funext fun a => funext fun g => physical_mixed_delta_effective_big_step (C key) (d key) (k key) c a g) (fun key c a g p => physical_mixed_dilation_divisibility hPs hP hdis (C key) (d key) c a g p) ω μ q ρ Vb steps phase f end Physical end Bounty end section /- The compact allocation integral with the original finite P factor retained. -/ open Finset MeasureTheory namespace Bounty theorem candidate_retained_factor_eq_mul_one (c L : ℝ) (r jStar p : ℕ) (x : ∀ slot, candidateQSlotChoices c L r jStar slot) (take : Fin ((candidateQIndices c L).card*r) → Bool) : candidateRetainedFactor c L r jStar p x take = p * candidateRetainedFactor c L r jStar 1 x take := by simp only [candidateRetainedFactor, one_mul] noncomputable def candidateFullPAllocationIntegrand (c L q : ℝ) (r jStar : ℕ) (R : ℝ) (S : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (F : ℕ → ℕ → ℂ) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) : ℂ := ∑ p ∈ S, (candidatePWeight c L q p : ℂ) * candidateSeparatedAllocationIntegrand c L r jStar R take (fun e n => F e (p*n)) ξ end Bounty end section /- Permutation occurrences have no birth addresses and keep their original active averaging row. -/ open Finset Classical namespace Bounty section Local variable {J K : Type*} {N : ℕ} {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Local section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (residual : ∀ (tag : Option (J ⊕ K)) s, FullPermutationMixedEvent n S B A Δ D tag s → ℂ) (initial : (g : Fin N) → Finset (P g)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) (θ : (Fin (Fintype.card (FullMixedBirthAddress S B steps)) × Fin (Fintype.card (FullMixedBirthAddress S B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Full end Bounty end section /- Box truncation keeps the original Q normalization and full marked coefficient. -/ open Finset MeasureTheory namespace Bounty noncomputable def candidateBoxRangeQWeight (c L : ℝ) (r jStar : ℕ) (E R : ℝ) (n : ℕ) : ℂ := ∑ x : ∀ slot, candidateQSlotChoices c L r jStar slot, if orderedSlotProduct (candidateQSlotChoices c L r jStar) x=n then candidateBoxRangeAllocationMass c L r jStar x E R / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ) else 0 noncomputable def candidateBoxRangeCoefficient (c L q : ℝ) (r jStar : ℕ) (E R : ℝ) (u : ℕ) : ℂ := candidateBoxRangeQWeight c L r jStar E R (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) u) * (markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p : ℝ)) (fun _ => 1) (u : ℤ) : ℝ) theorem candidate_box_Q_error (c L : ℝ) (r jStar : ℕ) (E R : ℝ) (n : ℕ) {err : ℝ} (herror : ∀ x, ‖(candidateRangeAllocationMass c L r jStar x E : ℂ) - candidateBoxRangeAllocationMass c L r jStar x E R‖ ≤ err) : ‖(candidateCompactRangeQWeight c L r jStar E n : ℂ) - candidateBoxRangeQWeight c L r jStar E R n‖ ≤ err*candidateQWeight c L r jStar n := by have hh := ordered_slot_complex_error_bound (candidateQSlotChoices c L r jStar) (show 0 < (r.factorial : ℝ)^(candidateQIndices c L).card by positivity) n (fun x => (candidateRangeAllocationMass c L r jStar x E : ℂ)) (fun x => candidateBoxRangeAllocationMass c L r jStar x E R) herror simpa only [candidateCompactRangeQWeight, candidateBoxRangeQWeight, candidateQWeight, Complex.ofReal_sum, apply_ite, Complex.ofReal_div, Complex.ofReal_zero] using hh theorem candidate_box_coefficient_error (c L : ℝ) {q : ℝ} (hq : 0 ≤ q) (r jStar : ℕ) (E R : ℝ) (u : ℕ) {err : ℝ} (herror : ∀ x, ‖(candidateRangeAllocationMass c L r jStar x E : ℂ) - candidateBoxRangeAllocationMass c L r jStar x E R‖ ≤ err) : ‖(candidateCompactRangeCoefficient c L q r jStar E u : ℂ) - candidateBoxRangeCoefficient c L q r jStar E R u‖ ≤ err*candidateCoefficient c L q r jStar u := by have hw := marked_divisor_weight_nonneg (candidatePIndices c L) (candidatePBand (c*L)) hq (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p : ℝ)) (fun _ => 1) (fun _ _ => sum_nonneg (fun _ _ => by positivity)) (u : ℤ) unfold candidateCompactRangeCoefficient candidateBoxRangeCoefficient candidateCoefficient rw [Complex.ofReal_mul, ← sub_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hw] simpa only [mul_assoc] using mul_le_mul_of_nonneg_right (candidate_box_Q_error c L r jStar E R _ herror) hw end Bounty end section /- A concrete finite geometric localization and its fixed logarithmic box. -/ open Finset namespace Bounty theorem typeII_factor_two_log_box {s t : ℝ} (hs : 0 < s) (ht : t ∈ Set.Icc s (2 * s)) : Real.log (t / s) ∈ Set.Icc (-1) 1 := by have hlo : 1 ≤ t / s := (le_div_iff₀ hs).mpr (by simpa using ht.1) have hhi : t / s ≤ 2 := (div_le_iff₀ hs).mpr (by nlinarith [ht.2]) have hp : 0 < t / s := zero_lt_one.trans_le hlo have hlog := Real.log_le_sub_one_of_pos hp have hnonneg := Real.log_nonneg hlo constructor <;> linarith end Bounty end section /- Separated Mellin powers for the actual three-variable real majorant. -/ open Finset MeasureTheory namespace Bounty noncomputable def typeIICrossFourierPowers (y : TypeIIShiftIndex) (ξ : EuclideanSpace ℝ (Fin 3)) : ℂ := typeIIPhase (2*Real.pi*ξ 0) y.2.1.1 * typeIIPhase (2*Real.pi*ξ 1) y.2.2.1 * typeIIPhase (2*Real.pi*ξ 2) y.1.2 theorem typeII_cross_fourier_powers_eq (y : TypeIIShiftIndex) (hm : 0 < y.2.1.1) (hm' : 0 < y.2.2.1) (hz : 0 < y.1.2) (ξ : EuclideanSpace ℝ (Fin 3)) : typeIICrossFourierPowers y ξ = ∏ i, ((![(y.2.1.1:ℝ),(y.2.2.1:ℝ),(y.1.2:ℝ)] : Fin 3 → ℝ) i : ℂ)^ (((2*Real.pi*ξ i : ℝ):ℂ)*Complex.I) := by simp [typeIICrossFourierPowers, Fin.prod_univ_three, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val_two, Complex.ofReal_natCast, typeIIPhase_eq_cpow _ hm, typeIIPhase_eq_cpow _ hm', typeIIPhase_eq_cpow _ hz] end Bounty end section /- The actual enlarged smooth energy retains an outside factor proportional to EV. -/ open Finset namespace Bounty theorem typeII_sum_norm_sq_of_range (S : Finset ℕ) (f : ℕ → ℂ) {X A : ℝ} (hX : 0 ≤ X) (hpos : ∀ n ∈ S, 0 < n) (hupper : ∀ n ∈ S, (n : ℝ) ≤ X) (hf : ∀ n ∈ S, ‖f n‖ ≤ A) : ∑ n ∈ S, ‖f n‖ ^ 2 ≤ X * A ^ 2 := by have hsub : S ⊆ Icc 1 ⌊X⌋₊ := by intro n hn exact mem_Icc.mpr ⟨hpos n hn, Nat.le_floor (hupper n hn)⟩ have hcard : S.card ≤ ⌊X⌋₊ := by simpa using card_le_card hsub have hcardR : (S.card : ℝ) ≤ X := (by exact_mod_cast hcard : (S.card : ℝ) ≤ (⌊X⌋₊ : ℝ)).trans (Nat.floor_le hX) calc _ ≤ ∑ _n ∈ S, A ^ 2 := sum_le_sum (fun n hn => pow_le_pow_left₀ (norm_nonneg _) (hf n hn) 2) _ = (S.card : ℝ) * A ^ 2 := by simp _ ≤ _ := mul_le_mul_of_nonneg_right hcardR (sq_nonneg _) theorem typeII_actual_smooth_cauchy (E₀ N₀ M H : Finset ℕ) (aE β α aH : ℕ → ℂ) {L E V A B : ℝ} (hL : 0 < L) (hE : 0 < E) (hV : 0 < V) (he : ∀ e ∈ E₀, E / L ^ 88 ≤ (e : ℝ) ∧ (e : ℝ) ≤ E) (hn : ∀ n ∈ N₀, V ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2 * V) (haE : ∀ e ∈ E₀, ‖aE e‖ ≤ A) (hβ : ∀ n ∈ N₀, ‖β n‖ ≤ B) : let EF := Icc ⌈E / (2 * L ^ 88)⌉₊ ⌊2 * E⌋₊ let NF := Icc ⌈V / 2⌉₊ ⌊3 * V⌋₊ let η := fun e n : ℕ => typeIIEMajorant (L ^ 88) ((e : ℝ) / E) * typeIINMajorant ((n : ℝ) / V) ‖∑ e ∈ E₀, ∑ n ∈ N₀, aE e * β n * typeIIInnerSum M H α aH e n‖ ^ 2 ≤ (2 * E * V * A ^ 2 * B ^ 2) * (typeIIDiagonalEnergy EF NF M H η α aH + typeIIOffDiagonalEnergy EF NF M H η α aH) := by dsimp only let EF := Icc ⌈E / (2 * L ^ 88)⌉₊ ⌊2 * E⌋₊ let NF := Icc ⌈V / 2⌉₊ ⌊3 * V⌋₊ let η := fun e n : ℕ => typeIIEMajorant (L ^ 88) ((e : ℝ) / E) * typeIINMajorant ((n : ℝ) / V) have hP : 0 < L ^ 88 := pow_pos hL _ have hlow : E / (2 * L ^ 88) ≤ E / L ^ 88 := div_le_div_of_nonneg_left hE.le hP (by nlinarith) have hEE : E₀ ⊆ EF := by intro e he₀ exact mem_Icc.mpr ⟨Nat.ceil_le.mpr (hlow.trans (he e he₀).1), Nat.le_floor ((he e he₀).2.trans (by linarith))⟩ have hNN : N₀ ⊆ NF := by intro n hn₀ exact mem_Icc.mpr ⟨Nat.ceil_le.mpr (by linarith [(hn n hn₀).1]), Nat.le_floor (by linarith [(hn n hn₀).2])⟩ have hEF : ∀ e ∈ EF, 0 < e := by intro e heF have hlo := (Nat.le_ceil (E / (2 * L ^ 88))).trans (by exact_mod_cast (mem_Icc.mp heF).1 : (⌈E / (2 * L ^ 88)⌉₊ : ℝ) ≤ e) have hp : (0 : ℝ) < e := lt_of_lt_of_le (by positivity) hlo exact_mod_cast hp have hη : ∀ e ∈ EF, ∀ n ∈ NF, 0 ≤ η e n := by intro e _ n _ exact mul_nonneg (typeII_e_majorant_bounds _ _).1 (typeII_n_majorant_bounds _).1 have hη₀ : ∀ e ∈ E₀, ∀ n ∈ N₀, 1 ≤ η e n := by intro e he₀ n hn₀ have helo : (L ^ 88)⁻¹ ≤ (e : ℝ) / E := by apply (le_div_iff₀ hE).mpr calc (L ^ 88)⁻¹ * E = E / L ^ 88 := by ring _ ≤ e := (he e he₀).1 have hehi : (e : ℝ) / E ≤ 1 := (div_le_one hE).mpr (he e he₀).2 have hnlo : 1 ≤ (n : ℝ) / V := (le_div_iff₀ hV).mpr (by simpa using (hn n hn₀).1) have hnhi : (n : ℝ) / V ≤ 2 := (div_le_iff₀ hV).mpr (hn n hn₀).2 have heq := typeII_e_majorant_log_scale_eq_one hL ⟨helo, hehi⟩ change 1 ≤ typeIIEMajorant (L ^ 88) ((e : ℝ) / E) * typeIINMajorant ((n : ℝ) / V) rw [heq, typeII_n_majorant_eq_one ⟨hnlo, hnhi⟩] norm_num have henergy : 0 ≤ typeIIDiagonalEnergy EF NF M H η α aH + typeIIOffDiagonalEnergy EF NF M H η α aH := by rw [← typeII_energy_split EF NF M H η α aH hEF] exact sum_nonneg (fun e heF => sum_nonneg (fun n hnF => mul_nonneg (hη e heF n hnF) (sq_nonneg _))) have hEA := typeII_sum_norm_sq_of_range E₀ aE hE.le (fun e he₀ => hEF e (hEE he₀)) (fun e he₀ => (he e he₀).2) haE have hNB := typeII_sum_norm_sq_of_range N₀ β (by linarith : 0 ≤ 2 * V) (fun n hn₀ => by have hp : (0 : ℝ) < n := hV.trans_le (hn n hn₀).1; exact_mod_cast hp) (fun n hn₀ => (hn n hn₀).2) hβ have hout : (∑ e ∈ E₀, ‖aE e‖ ^ 2) * (∑ n ∈ N₀, ‖β n‖ ^ 2) ≤ 2 * E * V * A ^ 2 * B ^ 2 := by calc _ ≤ (E * A ^ 2) * ((2 * V) * B ^ 2) := mul_le_mul hEA hNB (by positivity) (by positivity) _ = 2 * E * V * A ^ 2 * B ^ 2 := by ring exact (typeII_cauchy_enlarged_majorant E₀ N₀ EF NF M H aE β α aH η hEE hNN hEF hη hη₀).trans (mul_le_mul_of_nonneg_right hout henergy) end Bounty end section /- Total variation of all actual pre-Cauchy Fourier variables, independent of the allocation target. -/ open Finset Filter MeasureTheory Real namespace Bounty noncomputable def candidateMixedFourierVariation (c L : ℝ) (r jStar : ℕ) (B R T : ℝ) : ℝ := (∫ ν in {ν : ℝ | ‖ν‖ ≤ T}, ‖typeIIWindowFourier (L^B) ν‖) * ∑ take ∈ (univ : Finset (Fin ((candidateQIndices c L).card*r) → Bool)).filter (fun take => ∀ i, candidateAllocationActive c L r jStar i = false → take i = false), ∫ ξ, ‖activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ‖ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) R theorem exists_candidate_mixed_fourier_variation_bound {c B : ℝ} (hc : 0 < c) (hB : 0 ≤ B) (r : ℕ) : ∃ Cf : ℝ, 0 < Cf ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (R T : ℝ), candidateMixedFourierVariation c L r jStar B R T ≤ L^Cf := by obtain ⟨C,hC,hCl1⟩ := typeII_cutoff_fourier_l1_bound (candidateAllocationRadius r) have h2C : 1 ≤ 2*C := by linarith obtain ⟨H,hH,hwin⟩ := typeII_window_fourier_polynomial_cost hB refine ⟨H+candidateSlotCostExponent r (2*C), add_pos_of_pos_of_nonneg hH (candidate_slot_cost_exponent_nonneg r h2C),?_⟩ filter_upwards [hwin, eventually_candidate_slot_power_le_rpow hc h2C r, eventually_gt_atTop (0 : ℝ)] with L hwinL hslotL hL intro jStar R T have hw : (∫ ν in {ν : ℝ | ‖ν‖ ≤ T}, ‖typeIIWindowFourier (L^B) ν‖) ≤ L^H := by exact (setIntegral_le_integral (typeII_window_fourier_integrable (L^B)).norm (Filter.Eventually.of_forall (fun ν => norm_nonneg _))).trans hwinL have hs := (active_allocation_all_patterns_variation (candidateAllocationRadius r) C R hC hCl1 (candidateAllocationActive c L r jStar)).trans hslotL unfold candidateMixedFourierVariation calc _ ≤ L^H*L^candidateSlotCostExponent r (2*C) := mul_le_mul hw hs (sum_nonneg (fun take ht => integral_nonneg (fun ξ => norm_nonneg _))) (rpow_nonneg hL.le _) _ = _ := (rpow_add hL _ _).symm end Bounty end section /- Common forest constraints on original paths depend only on their completed chronological history. -/ namespace Bounty section History variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) theorem full_mixed_common_forest_stage_history_iff (u : Fin steps.length) : birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonPathHistory n S B A Δ D steps s p history (u.val + 1)) code ↔ birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fun i => fullMixedCommonBirthLabel n S B A Δ D steps s p (fullMixedCommonBirthOrder M B steps i)) code := by apply birth_forest_stage_congr _ (full_mixed_common_index_stage_monotone M B steps) intro i hi exact if_pos hi theorem full_mixed_common_forest_compatible_iff_history_stages (hcode : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) : birthForestCompatible (fun i => fullMixedCommonBirthPerformed n S B A Δ D steps s p (fullMixedCommonBirthOrder M B steps i)) (fun i => fullMixedCommonBirthLabel n S B A Δ D steps s p (fullMixedCommonBirthOrder M B steps i)) code ↔ ∀ u : Fin steps.length, birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonPathHistory n S B A Δ D steps s p history (u.val + 1)) code := by change birthForestCompatible (fun i => (fullMixedCommonBirthLabel n S B A Δ D steps s p (fullMixedCommonBirthOrder M B steps i)).isSome = true) _ _ ↔ _ rw [birth_forest_compatible_iff_event_stages (fullMixedCommonIndexStage M B steps) code hcode] exact forall_congr' fun u => (full_mixed_common_forest_stage_history_iff n S B A Δ D steps s p history code u).symm end History end Bounty end section /- With no selected initial child, forest rank is exactly the number of selected original event births. -/ open Finset Classical namespace Bounty variable {J K : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) def fullMixedCommonBirthGroup : FullMixedCommonBirthAddress M B steps → Fin N | .inl a => a.1 | .inr a => a.2.1 noncomputable def fullMixedCommonSelectedCount (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (u : Fin steps.length) (g : Fin N) : ℕ := (univ.filter (fun i => fullMixedCommonIndexStage M B steps i = u.succ ∧ fullMixedCommonBirthGroup M B steps (fullMixedCommonBirthOrder M B steps i) = g ∧ code i ≠ none)).card theorem full_mixed_common_selected_count_sum (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (hcode : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) : (∑ u, ∑ g, fullMixedCommonSelectedCount M B steps code u g) = birthForestRank code := by have h := forest_rank_partition code (fullMixedCommonIndexStage M B steps) (fun i => fullMixedCommonBirthGroup M B steps (fullMixedCommonBirthOrder M B steps i)) rw [Fin.sum_univ_succ] at h have hz : ∀ g : Fin N, (univ.filter (fun i => fullMixedCommonIndexStage M B steps i = 0 ∧ fullMixedCommonBirthGroup M B steps (fullMixedCommonBirthOrder M B steps i) = g ∧ code i ≠ none)).card = 0 := by intro g apply card_eq_zero.mpr apply eq_empty_iff_forall_notMem.mpr intro i hi have hm := (mem_filter.mp hi).2 exact hm.2.2 (hcode i hm.1) simp only [hz, sum_const_zero, zero_add] at h exact h end Bounty end section /- Actual sparse mean-square bounds for integer Dirichlet polynomials on a dyad. -/ open scoped BigOperators namespace Bounty theorem logarithmic_sparse_unit_interval_suprema (indices : Finset ℤ) (a b : ℕ) (c : ℕ → ℂ) (N : ℕ) {l r U : ℝ} (hU : 1 ≤ U) (ha : U ≤ (a : ℝ)) (hb : (b : ℝ) ≤ 2 * U) (hleft : ∀ j ∈ indices, l ≤ (j : ℝ)) (hright : ∀ j ∈ indices, (j : ℝ) + 1 ≤ r) (hwidth : r - l ≤ N) : (∑ j ∈ indices, unitIntervalEnergySup (fun t => ∑ n ∈ Finset.Icc a b, c n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)) j) ≤ (3 * (24 * Real.pi * U) * (1 + 2 * (1 + Real.log N)) + (indices.card : ℝ) * (216 * Real.sqrt N)) * ∑ n ∈ Finset.Icc a b, ‖c n‖ ^ 2 := by apply sparse_dirichlet_unit_interval_suprema indices (Finset.Icc a b) c N (by positivity) (by positivity) hleft hright hwidth intro z hz simpa only [mul_comm] using logarithmic_sparse_gram_kernel a b U N z hU ha hb hz theorem logarithmic_sparse_interval_energy_bound (indices : Finset ℤ) (a b : ℕ) (c : ℕ → ℂ) (N : ℕ) {l r U V : ℝ} (hU : 1 ≤ U) (ha : U ≤ (a : ℝ)) (hb : (b : ℝ) ≤ 2 * U) (hleft : ∀ j ∈ indices, l ≤ (j : ℝ)) (hright : ∀ j ∈ indices, (j : ℝ) + 1 ≤ r) (hwidth : r - l ≤ N) (hcard : (indices.card : ℝ) * (216 * Real.sqrt N) ≤ U) (henergy : (∑ n ∈ Finset.Icc a b, ‖c n‖ ^ 2) ≤ V / U) : (∑ j ∈ indices, unitIntervalEnergySup (fun t => ∑ n ∈ Finset.Icc a b, c n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)) j) ≤ (72 * Real.pi * (1 + 2 * (1 + Real.log N)) + 1) * V := by have hU0 : 0 < U := lt_of_lt_of_le zero_lt_one hU have hlog := Real.log_natCast_nonneg N have hc0 : 0 ≤ ∑ n ∈ Finset.Icc a b, ‖c n‖ ^ 2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) calc _ ≤ (3 * (24 * Real.pi * U) * (1 + 2 * (1 + Real.log N)) + (indices.card : ℝ) * (216 * Real.sqrt N)) * ∑ n ∈ Finset.Icc a b, ‖c n‖ ^ 2 := logarithmic_sparse_unit_interval_suprema indices a b c N hU ha hb hleft hright hwidth _ ≤ (3 * (24 * Real.pi * U) * (1 + 2 * (1 + Real.log N)) + U) * ∑ n ∈ Finset.Icc a b, ‖c n‖ ^ 2 := mul_le_mul_of_nonneg_right (add_le_add le_rfl hcard) hc0 _ ≤ (3 * (24 * Real.pi * U) * (1 + 2 * (1 + Real.log N)) + U) * (V / U) := mul_le_mul_of_nonneg_left henergy (by positivity) _ = _ := by field_simp; ring end Bounty end section /- Fixed positive power cancellation for logarithmic progressions at every large scale. -/ open Finset Filter namespace Bounty theorem eventually_uniform_affine_logarithmic_phase (K : ℕ) (C ε : ℝ) (hK : 2 ≤ K) (hC : 1 ≤ C) (hε : 0 < ε) (hεhalf : ε ≤ 1/2) : ∃ D : ℝ, 0 < D ∧ ∀ᶠ N : ℝ in atTop, ∀ (q c u : ℝ) (a b : ℤ), 0 < q → u ≠ 0 → |u| ≤ N^((K : ℝ)-ε) → N ≤ (a : ℝ)+c/q → (b : ℝ)+1+c/q ≤ C*N → ‖∑ n ∈ Icc a b, Complex.exp (((u*Real.log (q*(n : ℝ)+c) : ℝ) : ℂ)*Complex.I)‖ ≤ D*N*(1/|u|+N^(-(ε/((K : ℝ)*(2:ℝ)^(K-1))))) := by obtain ⟨D,hD,hbound⟩ := exists_uniform_affine_logarithmic_phase_bound K C hK hC have hKR : (0 : ℝ) < K := by exact_mod_cast (show 0 < K by omega) have hθ : 0 < ε/(2*(K : ℝ)) := by positivity refine ⟨D,hD,?_⟩ filter_upwards [eventually_gt_atTop (1 : ℝ),eventually_ge_atTop ((K : ℝ)^2), (tendsto_rpow_atTop hθ).eventually (eventually_ge_atTop (2 : ℝ))] with N hN hKN hpow intro q c u a b hq hu huK ha hb exact hbound N ε q c u a b hN hε hεhalf hKN hpow hq hu huK ha hb theorem eventually_long_affine_logarithmic_phase (τ C : ℝ) (hτ : 0 < τ) (hC : 1 ≤ C) : ∃ δ D : ℝ, 0 < δ ∧ 0 < D ∧ ∀ᶠ N : ℝ in atTop, ∀ (x q c u : ℝ) (a b : ℤ), 1 ≤ x → x^(τ/2) ≤ N → 0 < q → u ≠ 0 → |u| ≤ x^2 → N ≤ (a : ℝ)+c/q → (b : ℝ)+1+c/q ≤ C*N → ‖∑ n ∈ Icc a b, Complex.exp (((u*Real.log (q*(n : ℝ)+c) : ℝ) : ℂ)*Complex.I)‖ ≤ D*N*(1/|u|+N^(-δ)) := by let K := Nat.ceil (4/τ)+3 have hK : 2 ≤ K := by dsimp [K]; omega have hKR : (0 : ℝ) < K := by exact_mod_cast (show 0 < K by omega) have hKτ : 4/τ+1 ≤ (K : ℝ) := by have hc := Nat.le_ceil (4/τ) dsimp [K] push_cast linarith obtain ⟨D,hD,hbound⟩ := eventually_uniform_affine_logarithmic_phase K C (1/10) hK hC (by norm_num) (by norm_num) refine ⟨(1/10)/((K : ℝ)*(2:ℝ)^(K-1)),D,by positivity,hD,?_⟩ filter_upwards [hbound] with N hb intro x q c u a b hx hxN hq hu hux ha hb' apply hb q c u a b hq hu _ ha hb' exact hux.trans (long_frequency_upper_power K x N τ (1/10) hx hτ (by norm_num) hxN hKτ) end Bounty end section /- The actual allocation frequencies fit one fixed polynomial shift window. -/ open Finset Filter namespace Bounty end Bounty end section /- The actual residual coefficient has the polynomial bound required by the literal integral. -/ open Finset namespace Bounty end Bounty end section /- The residual coefficient in the selected original candidate endpoint. -/ open Finset Filter open scoped ComplexConjugate namespace Bounty noncomputable def candidateSelectedResidualCoefficient (c L q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (t u : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => u g.val) → ℂ) (κ θ : ℕ → ℂ) (n : ℕ) : ℂ := selectedMarkedWeight (fun g : candidatePIndices c L => candidatePBand (c*L) g.val) ((candidatePIndices c L).biUnion (candidatePBand (c*L))) q (fun g => ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) t u big b κ n * conj (candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) n)) * θ n theorem exists_candidate_selected_residual_power_bound {c q : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (T : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ L : ℝ in atTop, ∀ B : ℝ, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (t u : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => u g.val) → ℂ) (κ θ : ℕ → ℂ), (∀ g, t g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ d, ‖κ d‖ ≤ 1) → (∀ n, ‖θ n‖ ≤ 1) → ∀ n : ℕ, ‖candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ t u big b κ θ n‖ ≤ L^(C+B) := by obtain ⟨v,V,hv,_,hpool⟩ := exists_candidate_P_pool_bounds hc refine ⟨(2/(5*Real.log 2))*Real.log (markedDivisorBound q v T), mul_nonneg (by positivity) (Real.log_nonneg (one_le_markedDivisorBound q v T)), ?_⟩ filter_upwards [hpool] with L hp rcases hp with ⟨hL,_,_,hcard,_,hdata⟩ have hLpos : 0 < L := zero_lt_one.trans_le hL intro B r jStar hr hj take hkeep ξ t u big b κ θ ht hb hκ hθ n have hw := selected_marked_weight_norm_le_rpow (fun g : candidatePIndices c L => candidatePBand (c*L) g.val) ((candidatePIndices c L).biUnion (candidatePBand (c*L))) hq0 hq1 hv hLpos (fun g => ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) t u T big (fun g => (hdata g.val g.property).1) ht (by simpa using hcard) b hb κ hκ n have hr' := norm_candidate_residual_prime_coefficient_le_one (mul_nonneg hc.le hLpos.le) hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) (by intro slot p hp exact (candidate_allocation_fourier_twist_norm c L r jStar take ξ slot (Nat.pos_of_ne_zero (candidate_Q_slot_nonzero c L r jStar slot hp))).le) (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) n) rw [candidateSelectedResidualCoefficient,norm_mul,norm_mul,Complex.norm_conj] calc _ ≤ (L^((2/(5*Real.log 2))*Real.log (markedDivisorBound q v T)+B)*1)*1 := mul_le_mul (mul_le_mul hw hr' (norm_nonneg _) (Real.rpow_nonneg hLpos.le _)) (hθ n) (norm_nonneg _) (by positivity) _ = _ := by ring end Bounty end section /- Exact conditional marked-list averages for both stripped endpoints. -/ open Finset open scoped Classical namespace Bounty theorem group_marked_average_mul_left {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) (c : ℂ) (b : GroupMarkedLists P t → ℂ) : groupMarkedAverage P t n (fun L => c * b L) = c * groupMarkedAverage P t n b := by unfold groupMarkedAverage rw [← mul_sum] ring theorem completion_marked_pair_sum_eq_average {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (q : ℝ) (V : G → ℝ) (w z : ℤ) (b : GroupMarkedLists P (fun g => ell + (C g).card) → GroupMarkedLists P (fun g => ell + (C g).card) → ℂ) : (physicalCompletionMass V C ell : ℂ) ^ 2 * (∑ u : GroupMarkedLists P (fun g => ell + (C g).card), ∑ v : GroupMarkedLists P (fun g => ell + (C g).card), (groupMarkedVertexWeight P q (fun g => ell + (C g).card) w u : ℂ) * (groupMarkedVertexWeight P q (fun g => ell + (C g).card) z v : ℂ) * b u v) = (markedDivisorWeight univ P q V (fun g => ell + (C g).card) w : ℂ) * (markedDivisorWeight univ P q V (fun g => ell + (C g).card) z : ℂ) * groupMarkedAverage P (fun g => ell + (C g).card) w (fun u => groupMarkedAverage P (fun g => ell + (C g).card) z (b u)) := by calc _ = (physicalCompletionMass V C ell : ℂ) * ∑ u : GroupMarkedLists P (fun g => ell + (C g).card), (groupMarkedVertexWeight P q (fun g => ell + (C g).card) w u : ℂ) * ((physicalCompletionMass V C ell : ℂ) * ∑ v : GroupMarkedLists P (fun g => ell + (C g).card), (groupMarkedVertexWeight P q (fun g => ell + (C g).card) z v : ℂ) * b u v) := by simp only [mul_sum] apply sum_congr rfl intro u _ apply sum_congr rfl intro v _ ring _ = (physicalCompletionMass V C ell : ℂ) * ∑ u : GroupMarkedLists P (fun g => ell + (C g).card), (groupMarkedVertexWeight P q (fun g => ell + (C g).card) w u : ℂ) * ((markedDivisorWeight univ P q V (fun g => ell + (C g).card) z : ℂ) * groupMarkedAverage P (fun g => ell + (C g).card) z (b u)) := by simp only [completion_marked_vertex_sum_eq_average] _ = _ := by rw [completion_marked_vertex_sum_eq_average, group_marked_average_mul_left] ring end Bounty end section /- The original compatible-completion restriction and auxiliary ban use the same quantitative shared-draw exclusion estimate on the actual divisor fibers. -/ open Finset open scoped Classical namespace Bounty theorem physical_cut_shared_constant_error {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (u v : GroupMarkedLists P (fun g => ell + (C g).card)) (aux : PhysicalAuxLabels P C) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) (hu : ∀ g i, (u g i).val ∣ w) (hv : ∀ g i, (v g i).val ∣ z) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (c : ℂ) : ‖(∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if physicalRawCutGood C u v s then if ∀ g j, s g j ∉ physicalSharedForbidden C aux g w z then (physicalAuxMass V (fun g => univ \ C g) s : ℂ) * c else 0 else 0) - c‖ ≤ (∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin)) * ‖c‖ := by rw [physical_cut_avoiding_mean_eq_shared_good_mean C hprime u v aux hw hz hu hv] exact (by have he := finite_constant_restriction_error (S := PhysicalAuxLabels P (fun g => univ \ C g)) (fun s => physicalAuxMass V (fun g => univ \ C g) s) (fun s => physical_aux_mass_nonneg V _ (fun g => (hV g).le) s) (physical_aux_mass_sum V _ hV hMass) (physicalSharedDrawGood C (fun g => physicalSharedForbidden C aux g w z)) c rw [he] apply mul_le_mul_of_nonneg_right _ (norm_nonneg c) refine le_trans ?_ (physical_shared_draw_endpoint_bad_mass V C hV hMass aux hw hz hPmin hp) apply le_of_eq apply sum_congr rfl intro s _ by_cases hs : ¬physicalSharedDrawGood C (fun g => physicalSharedForbidden C aux g w z) s · simp only [if_pos hs] · simp only [if_neg hs] ) theorem group_marked_average_sub {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) (a b : GroupMarkedLists P t → ℂ) : groupMarkedAverage P t n (fun L => a L - b L) = groupMarkedAverage P t n a - groupMarkedAverage P t n b := by unfold groupMarkedAverage rw [sum_sub_distrib, mul_sub] theorem group_marked_pair_average_norm_le {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (w z : ℤ) (b : GroupMarkedLists P t → GroupMarkedLists P t → ℂ) {H : ℝ} (hH : 0 ≤ H) (hb : ∀ (u : GroupMarkedListsAt P t w) (v : GroupMarkedListsAt P t z), ‖b u.val v.val‖ ≤ H) : ‖groupMarkedAverage P t w (fun u => groupMarkedAverage P t z (b u))‖ ≤ H := by apply group_marked_average_norm_le P t w _ hH intro u exact group_marked_average_norm_le P t z (b u.val) hH (hb u) end Bounty end section /- The distinguished retained rough slot has no allocation Fourier twist. -/ namespace Bounty theorem candidate_rough_slot_allocation_twist_eq_one (c L : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (n : ℕ) : candidateAllocationFourierTwist c L r jStar take ξ (candidateRoughSlot c L r jStar hr hj) n = 1 := by have ha : candidateAllocationActive c L r jStar ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false := by simp only [candidateAllocationActive,Equiv.apply_symm_apply,candidateRoughSlot, and_self,not_true_eq_false,decide_false] unfold candidateAllocationFourierTwist rw [active_allocation_inactive_frequency_zero _ _ _ _ _ ha hkeep] simp end Bounty end section open MeasureTheory Filter namespace Bounty theorem eventually_local_fourier_of_mellin {b c : ℝ} (hb : 0 < b) (hc : 0 ≤ c) (A B : ℝ) : ∃ D : ℝ, A < D ∧ ∀ᶠ L : ℝ in atTop, ∀ (Y H : ℝ) (S : Finset ℕ) (a : ℕ → ℂ) (N : ℕ), Real.exp (b*L) ≤ Y → 1 ≤ H → H ≤ Real.exp ((b/2)*L) → (∀ n ∈ S, Y/8 ≤ (n:ℝ) ∧ (n:ℝ) ≤ 64*Y) → (∀ n ∈ S, n ≤ N) → (N:ℝ) ≤ c*Y → Real.log N ≤ c*L → (∑ n ∈ S, ‖a n‖^2) ≤ Y*L^B → (∫ t in {t : ℝ | |t| ≤ L*Y/H}, ‖localMellinPolynomial S a t‖^2) ≤ Y^2*L^(-D) → (∫ β in {β : ℝ | |β| ≤ 1/H}, ‖localAdditivePolynomial S a β‖^2) ≤ Y*L^(-A) := by obtain ⟨j,hj,htail⟩ := eventually_local_mellin_geometric_truncation hc B (A+1) obtain ⟨Cj,Cerr,hCj,hCerr,hwide⟩ := exists_wide_local_fourier_mellin_energy_constants hj refine ⟨A+1,by linarith,?_⟩ filter_upwards [htail, eventually_local_scale_error hb hCerr.le A B, eventually_ge_atTop (1:ℝ), eventually_ge_atTop (4*Cj)] with L htail hscale hL hLC intro Y H S a N hY hH hHu hS hNS hN hlog hE hlow have hYp : 0 < Y := (Real.exp_pos _).trans_le hY have hHp : 0 < H := lt_of_lt_of_le zero_lt_one hH have hLp : 0 < L := lt_of_lt_of_le zero_lt_one hL have hh : 0 < H/Y := div_pos hHp hYp have hinv : (H/Y)⁻¹ ≤ Y := by rw [inv_div] exact div_le_self hYp.le hH have hSN : ∀ n ∈ S, 1 ≤ n ∧ n ≤ N := by intro n hn have hnpos : 0 < (n:ℝ) := (by positivity : 0 < Y/8).trans_le (hS n hn).1 exact ⟨by exact_mod_cast hnpos,hNS n hn⟩ obtain ⟨hsmall,herror⟩ := hscale Y H (∑ n ∈ S, ‖a n‖^2) hY hH hHu hE have ht := htail Y (H/Y) S a N hYp hh hinv hSN hN hlog hE have hcut : L/(H/Y) = L*Y/H := by field_simp rw [hcut] at ht have hI : (∫ t : ℝ, (1+|(H/Y)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) ≤ 2*Y^2*L^(-(A+1)) := by linarith have hcoef : 2*Cj*L^(-(A+1)) ≤ L^(-A)/2 := by rw [show -(A+1) = -A-1 by ring, Real.rpow_sub hLp, Real.rpow_one] have hp := mul_le_mul_of_nonneg_right hLC (Real.rpow_pos_of_pos hLp (-A)).le calc 2*Cj*(L^(-A)/L) = (2*Cj*L^(-A))/L := by ring _ ≤ L^(-A)/2 := (div_le_iff₀ hLp).2 (by nlinarith) calc _ ≤ (Cj/Y)*(∫ t : ℝ, (1+|(H/Y)*t|)^(-(j:ℝ))*‖localMellinPolynomial S a t‖^2) + Cerr*(H/Y)^2*(∑ n ∈ S, ‖a n‖^2) := hwide S a Y H hYp hH hsmall hS _ ≤ (Cj/Y)*(2*Y^2*L^(-(A+1)))+Y*L^(-A)/2 := by exact _root_.add_le_add (mul_le_mul_of_nonneg_left hI (by positivity)) herror _ = Y*(2*Cj*L^(-(A+1)))+Y*L^(-A)/2 := by field_simp _ ≤ Y*(L^(-A)/2)+Y*L^(-A)/2 := by exact _root_.add_le_add (mul_le_mul_of_nonneg_left hcoef hYp.le) le_rfl _ = _ := by ring end Bounty end section /- The actual shifted rough mass of the candidate in its full arithmetic window. -/ open Finset Filter namespace Bounty noncomputable def candidateShiftedRoughMass (c L q : ℝ) (r jStar : ℕ) (z : ℝ) : ℝ := ∑ u ∈ shiftedRoughSet (arithmeticProductWindow 1 (Real.exp L)) z, candidateCoefficient c L q r jStar u theorem exists_candidate_shifted_rough_mass_estimate (hZ : PrimitiveZeroFreeHalfPlane) : ∃ K : ℝ, 0 < K ∧ ∀ (c q b : ℝ) (r h : ℕ), 0 < c → 0 < r → 0 ≤ q → q < 1 → (11/5 : ℝ) * (r : ℝ) * c = 1 → 0 < b → 1 ≤ h → Even h → b * (4 * (h : ℝ) + 2) < 1/2 → ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, |candidateShiftedRoughMass c L q r jStar (Real.exp (b * L)) - candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L))| ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * (K * Real.exp (-(h : ℝ)) + L^(-16 : ℝ)) := by obtain ⟨K, hK, hsieve⟩ := exists_shifted_totient_rough_sieve refine ⟨K, hK, ?_⟩ intro c q b r h hc hr hq0 hq1 hcenter hb hh heven hlevel let theta : ℝ := (b * (4 * (h : ℝ) + 2) + 1/2) / 2 have htheta : theta < 1/2 := by dsimp [theta]; linarith only [hlevel] obtain ⟨J, hdist⟩ := exists_candidate_relative_typeI_remainder_power_bound hZ hc hr hq0 hq1 hcenter htheta (18 : ℝ) refine ⟨J, ?_⟩ intro jStar hj filter_upwards [hdist jStar hj, eventually_candidate_midpoint_sieve_scale hb h hlevel, eventually_shifted_avoidance_absorbs_power hb (1 + 16 * primeEulerProductUpperConstant) (by positivity [primeEulerProductUpperConstant_pos])] with L hd hscale habs let N : ℕ := ⌊Real.exp (theta * L)⌋₊ have hN : (N : ℝ) ≤ Real.exp (theta * L) := Nat.floor_le (Real.exp_pos _).le have hXA : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro u _ exact candidate_coefficient_nonneg c L hq0 r jStar u have hsub : blockSieveModuli ((primeBand 0 (Real.exp (b * L))).erase 2) ((Real.exp (b * L))^(4 * (h : ℝ) + 2)) ⊆ oddSquarefreeModuli N := by apply odd_sieve_moduli_subset · intro p hp exact small_prime_pool_prime (mem_of_mem_erase hp) · intro p hp exact (mem_erase.mp hp).1 · exact hscale.2.1 have herror : (∑ d ∈ blockSieveModuli ((primeBand 0 (Real.exp (b * L))).erase 2) ((Real.exp (b * L))^(4 * (h : ℝ) + 2)), |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d|) ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * L^(-16 : ℝ) := by calc _ ≤ ∑ d ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d| := sum_le_sum_of_subset_of_nonneg hsub (fun _ _ _ => abs_nonneg _) _ ≤ candidateCoefficientWindowMass c L q r jStar * (L^(-18 : ℝ) + (16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := hd N hN _ = candidateCoefficientWindowMass c L q r jStar * ((1 + 16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := by ring _ ≤ candidateCoefficientWindowMass c L q r jStar * (shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * L^(-16 : ℝ)) := mul_le_mul_of_nonneg_left habs hXA _ = _ := by ring have hs := hsieve (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) hscale.1 hh heven (fun u _ => candidate_coefficient_nonneg c L hq0 r jStar u) change |candidateShiftedRoughMass c L q r jStar (Real.exp (b * L)) - candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L))| ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * K * Real.exp (-(h : ℝ)) + _ at hs calc _ ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * K * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli ((primeBand 0 (Real.exp (b * L))).erase 2) ((Real.exp (b * L))^(4 * (h : ℝ) + 2)), |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d| := hs _ ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * K * Real.exp (-(h : ℝ)) + candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * L^(-16 : ℝ) := add_le_add le_rfl herror _ = _ := by ring end Bounty end section /- Exact all-state zero extensions of the original selected physical rows. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) end ResiduePath end Bounty end section /- The actual masked pair count averaged over Bernoulli choices. -/ open Finset namespace Bounty end Bounty end section /- A single finite physical pattern family for the raw row minus the alternating prime-comparison rows. The raw pattern is kept explicitly. -/ open Finset open scoped Classical namespace Bounty def repeatedBigPrimeProbeSlots {G : Type*} {J ell : ℕ} (probes : G → Finset (Fin J)) (g : G) : Finset (PhysicalSlots J ell) := (probes g).map (Function.Embedding.inl (β := Fin ell)) abbrev RepeatedBigPrimePatternPair {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) := ↥(cleanNonemptySubsets (r.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes))) × ↥(cleanNonemptySubsets (t.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes))) abbrev RepeatedBigPrimePatternIndex {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) := Unit ⊕ RepeatedBigPrimePatternPair (ell := ell) probes r t theorem repeated_big_prime_pattern_pair_valid {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (ab : RepeatedBigPrimePatternPair (ell := ell) probes r t) : ab.1.val ⊆ repeatedBigFlatActive J ell ∧ ab.2.val ⊆ repeatedBigFlatActive J ell ∧ Disjoint ab.1.val ab.2.val := by have hsub (u : Finset G) : u.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes) ⊆ repeatedBigFlatActive J ell := by rintro ⟨g, i⟩ hi rcases mem_map.mp (mem_sigma.mp hi).2 with ⟨j, _, rfl⟩ exact repeatedBigFlatActive_mem_inl J ell g j have ha := ((clean_mem_nonempty_subsets _ _).mp ab.1.property).2 have hb := ((clean_mem_nonempty_subsets _ _).mp ab.2.property).2 refine ⟨ha.trans (hsub r), hb.trans (hsub t), ?_⟩ apply disjoint_left.mpr intro i hi hj exact disjoint_left.mp hrt (mem_sigma.mp (ha hi)).1 (mem_sigma.mp (hb hj)).1 noncomputable def repeatedBigPrimePatternCut {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) : RepeatedBigPrimePatternIndex (ell := ell) probes r t → G → Finset (Fin J) | .inl _ => fun _ => ∅ | .inr ab => repeatedBigAuxCut ab.1.val ab.2.val noncomputable def repeatedBigPrimePatternWeight {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) : RepeatedBigPrimePatternIndex (ell := ell) probes r t → ℂ | .inl _ => 1 | .inr ab => -(-1 : ℂ) ^ (ab.1.val.card + ab.2.val.card) noncomputable def repeatedBigPrimePatternKernel {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h : ℝ) (kept : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i) → ℂ | .inl _ => fun _ _ _ => 1 | .inr ab => let hv := repeated_big_prime_pattern_pair_valid probes r t hrt ab repeatedBigPrimeCoefficient P V ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 Q h (kept ab.1.val) (kept ab.2.val) section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h : ℝ) (kept : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (ζ Θ : ℝ) (source target : RepeatedBigLists P J ell) include G sharedInstance1 sharedInstance2 J ell P V probes r t hrt Q h kept ζ Θ source target theorem repeated_big_prime_pattern_raw_row : (∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())), repeatedBigPrimePatternWeight (ell := ell) probes r t (.inl ()) * repeatedBigUnbannedKernel V (fun _ _ => 1) (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) ζ (repeatedBigPrimePatternKernel P V probes r t hrt Q h kept (.inl ())) aux source target * physicalReturnPhase Θ (repeatedBigD (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) source aux)) = repeatedBigPrimeRawRow P V ζ Θ source target := by simp only [repeatedBigPrimePatternWeight, one_mul] rfl theorem repeated_big_prime_pattern_pair_row (ab : RepeatedBigPrimePatternPair (ell := ell) probes r t) : (∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab)), repeatedBigPrimePatternWeight probes r t (.inr ab) * repeatedBigUnbannedKernel V (fun _ _ => 1) (repeatedBigPrimePatternCut probes r t (.inr ab)) ζ (repeatedBigPrimePatternKernel P V probes r t hrt Q h kept (.inr ab)) aux source target * physicalReturnPhase Θ (repeatedBigD (repeatedBigPrimePatternCut probes r t (.inr ab)) source aux)) = -(-1 : ℂ) ^ (ab.1.val.card + ab.2.val.card) * repeatedBigPrimeComparisonRow P V ab.1.val ab.2.val Q h kept kept ζ Θ source target := by have hv := repeated_big_prime_pattern_pair_valid probes r t hrt ab rw [repeatedBigPrimeComparisonRow_eq P V ab.1.val ab.2.val hv.1 hv.2.1 hv.2.2] change (∑ aux, -(-1 : ℂ) ^ (ab.1.val.card + ab.2.val.card) * _ * _) = -(-1 : ℂ) ^ (ab.1.val.card + ab.2.val.card) * (∑ aux, _ * _) rw [mul_sum] apply sum_congr rfl intro aux haux dsimp only [repeatedBigPrimePatternCut, repeatedBigPrimePatternKernel] ring theorem repeated_big_prime_pattern_family_kernel : (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i), repeatedBigPrimePatternWeight probes r t i * repeatedBigUnbannedKernel V (fun _ _ => 1) (repeatedBigPrimePatternCut probes r t i) ζ (repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i) aux source target * physicalReturnPhase Θ (repeatedBigD (repeatedBigPrimePatternCut probes r t i) source aux)) = repeatedBigPrimeDifferenceKernel P V probes r t Q h kept ζ Θ source target := by rw [Fintype.sum_sum_type] simp only [Fintype.sum_unique, repeated_big_prime_pattern_raw_row, repeated_big_prime_pattern_pair_row] rw [Fintype.sum_prod_type] simp only [repeatedBigPrimeDifferenceKernel, Pi.sub_apply, Finset.sum_apply, Pi.smul_apply, smul_eq_mul] rw [sub_eq_add_neg] congr 1 simp only [neg_mul, ← sum_neg_distrib] let As := cleanNonemptySubsets (r.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes)) let Bs := cleanNonemptySubsets (t.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes)) let F := fun a b : Finset (RepeatedBigFlatIndex G J ell) => -((-1 : ℂ) ^ (a.card + b.card) * repeatedBigPrimeComparisonRow P V a b Q h kept kept ζ Θ source target) change (∑ a : As, ∑ b : Bs, F a.val b.val) = ∑ a ∈ As, ∑ b ∈ Bs, F a b calc _ = ∑ a : As, ∑ b ∈ Bs, F a.val b := by apply sum_congr rfl intro a ha exact sum_coe_sort Bs (F a.val) _ = _ := sum_coe_sort As (fun a => ∑ b ∈ Bs, F a b) end end Bounty end section /- An actual rough pair box avoiding the nonallowed shifted divisibility classes. -/ open Finset namespace Bounty noncomputable def oddMaskedPairBox (a b c d m : ℕ) (W z : ℝ) (A : Finset ℕ) : Finset (ℕ × ℕ) := by classical exact (pairSieveBaseBox a b c d m).filter (fun v => (∀ p ∈ primeBand 0 W, ¬p ∣ v.1*v.2) ∧ (∀ p ∈ primeBand 0 z, p ≠ 2 → ¬p ∣ m → p ∉ A → (v.1*v.2) % p ≠ 1 % p)) theorem odd_masked_pair_box_subset (a b c d m : ℕ) (W z : ℝ) (hW : 0 ≤ W) (hWz : W ≤ z) (A : Finset ℕ) : oddMaskedPairBox a b c d m W z A ⊆ pairSieveAvoidance a b c d m (maskedPairPrimes m z) (maskedPairRoughFlag W) (maskedPairBannedFlag A) := by classical have hz := hW.trans hWz intro v hv obtain ⟨hvbase, hvrough, hvban⟩ := mem_filter.mp hv apply mem_filter.mpr refine ⟨hvbase, ?_⟩ intro p hp hbad obtain ⟨hprime, hpz, hp2, hpm⟩ := (mem_masked_pair_primes hz).mp hp rcases hbad with ⟨hr, hzero⟩ | ⟨hb, hone⟩ · have hpW : (p : ℝ) ≤ W := by simpa [maskedPairRoughFlag] using hr exact hvrough p ((mem_primeBand_iff le_rfl hW p).mpr ⟨hprime, Nat.cast_pos.mpr hprime.pos, hpW⟩) (Nat.dvd_of_mod_eq_zero hzero) · have hpA : p ∉ A := by simpa [maskedPairBannedFlag] using hb exact hvban p ((mem_primeBand_iff le_rfl hz p).mpr ⟨hprime, Nat.cast_pos.mpr hprime.pos, hpz⟩) hp2 hpm hpA hone theorem exists_odd_masked_pair_box_upper : ∃ K : ℝ, 0 < K ∧ ∀ (L : ℝ) (a b c d m : ℕ) [NeZero m] (W z : ℝ) (A : Finset ℕ), 1 ≤ L → (m : ℝ) ≤ Real.exp L → (∀ p ∈ m.primeFactors, L^2 ≤ (p : ℝ)) → a ≤ b → c ≤ d → 0 ≤ W → W ≤ z → 1 < z → (∀ p ∈ A, 2 ≤ p) → ((oddMaskedPairBox a b c d m W z A).card : ℝ) ≤ K * (((b : ℝ)-a)*((d : ℝ)-c)/(m : ℝ)) * (∏ p ∈ primeBand 0 W, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) * (∏ p ∈ A, (1 - 1/(p : ℝ))⁻¹) + ((m : ℝ)*(z^(10 : ℝ))^3 + (((b : ℝ)-a)+((d : ℝ)-c))*(z^(10 : ℝ))^2) := by classical obtain ⟨K, hK, hb⟩ := exists_finite_pair_sieve_product_upper refine ⟨K*(8*Real.exp 12), by positivity, ?_⟩ intro L a b c d m hm W z A hL hmL hmin hab hcd hW hWz hz hA have hprop := fun (p : ℕ) (hp : p ∈ maskedPairPrimes m z) => (mem_masked_pair_primes (zero_lt_one.trans hz).le).mp hp have hprime : ∀ p ∈ maskedPairPrimes m z, p.Prime := fun p hp => (hprop p hp).1 have h3 : ∀ p ∈ maskedPairPrimes m z, 3 ≤ p := by intro p hp have h2 := (hprime p hp).two_le have hn := (hprop p hp).2.2.1 omega have h := hb a b c d m (maskedPairPrimes m z) (maskedPairRoughFlag W) (maskedPairBannedFlag A) hab hcd hz hprime h3 (fun p hp => (hprop p hp).2.2.2) (fun p hp => (hprop p hp).2.1) have hrf : (maskedPairPrimes m z).filter (fun p => maskedPairRoughFlag W p = true) = maskedPairRoughPrimes m W z := by ext p; simp [maskedPairRoughPrimes, maskedPairRoughFlag] have hbf : (maskedPairPrimes m z).filter (fun p => maskedPairBannedFlag A p = true) = maskedPairBannedPrimes m z A := by ext p; simp [maskedPairBannedPrimes, maskedPairBannedFlag] rw [hrf, hbf] at h have hcard : ((oddMaskedPairBox a b c d m W z A).card : ℝ) ≤ ((pairSieveAvoidance a b c d m (maskedPairPrimes m z) (maskedPairRoughFlag W) (maskedPairBannedFlag A)).card : ℝ) := Nat.cast_le.mpr (card_le_card (odd_masked_pair_box_subset a b c d m W z hW hWz A)) have hX : 0 ≤ (b : ℝ)-a := sub_nonneg.mpr (Nat.cast_le.mpr hab) have hY : 0 ≤ (d : ℝ)-c := sub_nonneg.mpr (Nat.cast_le.mpr hcd) have hc : 0 ≤ K * (((b : ℝ)-a)*((d : ℝ)-c)/(m : ℝ)) := by positivity have he := mul_le_mul_of_nonneg_left (masked_pair_euler_uniform_bound hL m (NeZero.ne m) hmL hmin W z hW hWz A hA) hc apply (hcard.trans h).trans apply add_le_add _ le_rfl convert he using 1 <;> ring end Bounty end section /- The original coefficient is retained exactly, including the zero-weight support. -/ open scoped Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (hedge : ∀ k H x e, edgePhase k H x e = (if FullMixedLocalBirthAvoids (J := J) n S B A Δ D H (some (.inr k)) x e ∧ FullMixedLocalBirthDistinct (J := J) n S B A Δ D (some (.inr k)) x e then 1 else 0) * edgePhase k (fun _ => ∅) x e) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (initial : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) include hedge in theorem full_mixed_physical_weighted_phase_factor (hx : FullMixedLedgerCovers n B (initial x, x)) : let w := finiteEventPathWeight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps x p (w : ℂ) * ( fullMixedLedgerInducedPhase n S B A Δ D steps initial (finiteEventLocalPhase (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fullMixedLedgerPhase n S B A Δ D edgePhase) steps) x p) = (w : ℂ) * ( (if ∀ (a : FullMixedBirthAddress S B steps) (z : (g : Fin N) × P g), fullMixedPathBirthLabel n S B A Δ D steps x p a = some z → z.2 ∉ initial x z.1 then 1 else 0) * (if ∀ (a b : FullMixedBirthAddress S B steps) z, fullMixedPathBirthLabel n S B A Δ D steps x p a = some z → fullMixedPathBirthLabel n S B A Δ D steps x p b = some z → a = b then 1 else 0) * finiteEventLocalPhase (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedBirthResidualPhase n S B A Δ D edgePhase) steps x p) := by dsimp only by_cases hw : finiteEventPathWeight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps x p = 0 · simp only [hw, Complex.ofReal_zero, zero_mul] · rw [full_mixed_physical_path_phase_factor n S B A Δ D edgePhase hedge ω μ q ρ V steps initial x p hx hw] end Full end Bounty end section /- Actual permutation and ghost events give the decoded mark relations. -/ namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) theorem physical_encoded_permutation_marks (before after : Fin N → Finset (Fin J)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k (none : Option (I ⊕ K)) s) (L R : PhysicalBoundedMarkState P J ell B) (hs : physicalBoundedMarkEncode before L = s) (ht : physicalBoundedMarkEncode after R = physicalFullLedgerEventTarget C k none s e) : R.1 = physicalPermuteLabels ((physicalTransitionPermutationEquiv before after).symm e.down) L.1 := by subst s have hfull := congrArg Prod.snd ht have hperm := physical_full_memory_transition_permute before after L.1 L.2.2 ((physicalTransitionPermutationEquiv before after).symm e.down) rw [Equiv.apply_symm_apply] at hperm exact physical_full_state_labels_of_eq after _ _ _ _ (hfull.trans hperm.symm) theorem physical_encoded_ghost_marks (cut : Fin N → Finset (Fin J)) (j : I) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k (some (.inl j)) s) (L R : PhysicalBoundedMarkState P J ell B) (hs : physicalBoundedMarkEncode cut L = s) (ht : physicalBoundedMarkEncode cut R = physicalFullLedgerEventTarget C k (some (.inl j)) s e) : R.1 = L.1 := by subst s funext g apply Function.Embedding.ext intro a have h := congrArg (fun t => (t.2 g).1 ((physicalFullSlotIndex (cut g)).symm a)) ht change R.1 g (physicalFullSlotIndex (cut g) ((physicalFullSlotIndex (cut g)).symm a)) = ((fullPermutationMixedEventTarget _ _ _ _ _ _ (some (.inl j)) (physicalFullMemoryState cut L.1 L.2.2) e) g).1 ((physicalFullSlotIndex (cut g)).symm a) at h have hg := fullPermutationMixedEventTarget_ghost_active (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) j (physicalFullMemoryState cut L.1 L.2.2) e g simpa only [physicalFullMemoryState, Equiv.apply_symm_apply] using h.trans (congrFun hg ((physicalFullSlotIndex (cut g)).symm a)) end Physical end Bounty end section /- Full character/Mellin discrepancy for the actual prime test and global count-matched proxy. -/ open Finset Filter namespace Bounty theorem eventually_prime_proxy_character_discrepancy (hZ : PrimitiveZeroFreeHalfPlane) {a S T Bsave : ℝ} (ha : 0 < a) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+Bsave+2 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by filter_upwards [eventually_prime_proxy_mellin_difference_bound ha hS hT hprecision, eventually_prime_logarithmic_proxy_principal_identity ha S T, eventually_prime_interval_mellin_power_bound hZ ha hT (Bsave+1), eventually_prime_logarithmic_proxy_mellin_power_bound ha hS hT (Bsave+1), eventually_ge_atTop (2 : ℝ)] with L hprincipal hidentity hprime hproxy hL2 have hL : 0 < L := by linarith intro Y hY r hr χ hrT v hv m n hmn hYm hn have hrpos : 0 < r := Nat.pos_of_ne_zero (NeZero.ne r) by_cases hχ : χ = 1 · subst χ have heq : (∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight v i*(1 : DirichletCharacter ℂ r) (i : ZMod r)) = ∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight v i := by apply sum_congr rfl intro i hi have hiY : Real.exp (a*L) ≤ (i : ℝ) := hY.trans (hYm.trans (Nat.cast_le.mpr (mem_Ioc.mp hi).1)) have hiid := hidentity i hiY r hrpos hrT calc _ = ((((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* (1 : DirichletCharacter ℂ r) (i : ZMod r))*harmonicMellinWeight v i := by ring _ = _ := by rw [hiid] rw [heq] exact hprincipal Y hY v hv m n hmn hYm hn · have hp := hprime Y hY r hrpos hrT χ hχ v hv m n hmn hYm hn have hb := hproxy Y hY r χ hχ hrT v hv m n hmn hYm hn have heq : (∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)) = (∑ i ∈ (Ioc m n).filter Nat.Prime, harmonicMellinWeight v i*χ (i : ZMod r))- ∑ i ∈ Ioc m n, (primeLogarithmicProxy L S i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r) := by simp only [sum_filter, Complex.ofReal_sub, sub_mul, sum_sub_distrib] congr 1 apply sum_congr rfl intro i _ by_cases hi : i.Prime <;> simp [hi] rw [heq] apply (norm_sub_le _ _).trans apply (add_le_add hp hb).trans have he : L^(-(Bsave+1)) = L^(-Bsave)/L := by rw [show -(Bsave+1) = -Bsave+(-1) by ring, Real.rpow_add hL, Real.rpow_neg_one] ring rw [he, ← add_div] apply (div_le_iff₀ hL).mpr nlinarith [mul_le_mul_of_nonneg_left hL2 (Real.rpow_nonneg hL.le (-Bsave))] end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) include hstep in theorem physical_selected_adjacent_edge_extension (j : Fin n) (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalMarkRawExtension (physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.succ) F) (L j.castSucc) = fun s => (((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) ^ 2) * (ω j (physicalSharedMarkLabels (C j) (physicalPermuteLabels (σ j) (L j.castSucc))) (aux j) : ℂ) * globalBirthJointCutRawRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β η V (fun _ => ρ) hV B (2 * j.val + 1)) B B (physicalMarkRawExtension F (L j.succ)) s := by apply physical_mark_raw_extension_eq_of_total_cutoff · intro s hs simp only [globalBirthJointCutRawRow, globalBirthJointRawCutoff, if_neg (Nat.not_le_of_gt hs), mul_zero] · intro s hs have he := physical_selected_adjacent_state_edge_block C aux k L a σ τ hstep hcompat hlist hP hdis hk β η V ρ hV B ω retention j F s hs simpa only [physical_full_memory_state_shared_labels] using he theorem physical_selected_adjacent_visit_extension (j : Fin (n + 1)) (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalMarkRawExtension (physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = L j then F t else 0)) (L j) = globalBirthJointCutRawRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β (fun _ i => 1 - retention i) V (fun _ => ρ) hV B (2 * j.val)) B B (physicalMarkRawExtension F (L j)) := by apply physical_mark_raw_extension_eq_of_total_cutoff · intro s hs simp only [globalBirthJointCutRawRow, globalBirthJointRawCutoff, if_neg (Nat.not_le_of_gt hs)] · intro s hs have he := physical_selected_adjacent_state_visit C aux k L a σ τ hcompat hlist hP hdis hk β V ρ hV B ω retention j F s have hstate : (L j, s.2) = s := by rw [← hs] rw [hstate] at he exact he end ResiduePath end Bounty end section /- Complete character/Mellin discrepancy for the actual exponential roughness test. -/ open Finset Filter namespace Bounty theorem eventually_rough_test_proxy_character_discrepancy (hZ : PrimitiveZeroFreeHalfPlane) {a γ C S T Bsave : ℝ} (ha : 0 < a) (hγ : 0 < γ) (hC : 0 < C) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+Bsave+2 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → Y ≤ Real.exp (C*L) → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by classical have hC1 : 0 < C+1 := by linarith filter_upwards [eventually_rough_test_proxy_mellin_difference_bound ha hγ hS hT hprecision, eventually_rough_test_proxy_principal_identity hγ S T, eventually_exponential_rough_test_mellin_bound hZ hγ hC1 hT (Bsave+1), eventually_rough_test_logarithmic_proxy_mellin_power_bound ha hγ hS hT (Bsave+1), eventually_ge_atTop (2 : ℝ), eventually_ge_atTop (2/a)] with L hprincipal hidentity hrough hproxy hL2 hLa have hL : 0 < L := by linarith intro Y hY hYup r hr χ hrT v hv m n hmn hYm hn have hrpos : 0 < r := Nat.pos_of_ne_zero (NeZero.ne r) have hY3 : 3 ≤ Y := by have hLa' := (div_le_iff₀ ha).mp hLa have hexp := Real.add_one_le_exp (a*L) nlinarith have hm1 : 1 ≤ (m : ℝ) := by push_cast at hYm linarith have hnexp : (n : ℝ) ≤ Real.exp ((C+1)*L) := by have htwo : 2 ≤ Real.exp L := by linarith [Real.add_one_le_exp L] calc _ ≤ 2*Y := hn _ ≤ 2*Real.exp (C*L) := mul_le_mul_of_nonneg_left hYup (by norm_num) _ ≤ Real.exp L*Real.exp (C*L) := mul_le_mul_of_nonneg_right htwo (Real.exp_pos _).le _ = Real.exp ((C+1)*L) := by rw [← Real.exp_add]; congr 1; ring by_cases hχ : χ = 1 · subst χ have heq : (∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight v i*(1 : DirichletCharacter ℂ r) (i : ZMod r)) = ∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight v i := by apply sum_congr rfl intro i hi have hi0 : 0 < i := lt_of_le_of_lt (Nat.zero_le _) (mem_Ioc.mp hi).1 have hiid := hidentity i hi0 r hrpos hrT calc _ = (((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* (1 : DirichletCharacter ℂ r) (i : ZMod r))*harmonicMellinWeight v i := by ring _ = _ := by rw [hiid] rw [heq] exact hprincipal Y hY v hv m n hmn hYm hn · have hp := hrough (m : ℝ) (n : ℝ) hm1 (Nat.cast_nonneg _) hnexp r hrpos hrT χ hχ v hv have hb := hproxy Y hY r χ hχ hrT v hv m n hmn hYm hn have heq : (∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)) = (∑ i ∈ roughBand (m : ℝ) (n : ℝ) (Real.exp (γ*L)), harmonicMellinWeight v i*χ (i : ZMod r))- ∑ i ∈ Ioc m n, (roughTestLogarithmicProxy γ L S i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r) := by simp only [roughBand, Nat.floor_natCast, sum_filter, Complex.ofReal_sub, sub_mul, sum_sub_distrib] congr 1 apply sum_congr rfl intro i _ by_cases hi : exponentialRoughTest γ L i · simp only [roughTestIndicator, if_pos hi, Complex.ofReal_one, one_mul] unfold exponentialRoughTest at hi rw [if_pos hi] · simp only [roughTestIndicator, if_neg hi, Complex.ofReal_zero, zero_mul] unfold exponentialRoughTest at hi rw [if_neg hi] rw [heq] apply (norm_sub_le _ _).trans apply (add_le_add hp hb).trans have he : L^(-(Bsave+1)) = L^(-Bsave)/L := by rw [show -(Bsave+1) = -Bsave+(-1) by ring, Real.rpow_add hL, Real.rpow_neg_one] ring rw [he, ← add_div] apply (div_le_iff₀ hL).mpr nlinarith [mul_le_mul_of_nonneg_left hL2 (Real.rpow_nonneg hL.le (-Bsave))] end Bounty end section /- Selected rows depend on continuations only at their prescribed target marks. -/ open Finset Classical namespace Bounty theorem physical_mark_raw_extension_marks_congr {N J ell B : ℕ} {P : Fin N → Finset ℕ} (L : PhysicalMarkLists P J ell) (F G : PhysicalBoundedMarkState P J ell B → ℂ) (hFG : ∀ t, t.1 = L → F t = G t) : physicalMarkRawExtension F L = physicalMarkRawExtension G L := by funext u unfold physicalMarkRawExtension split_ifs · exact hFG _ rfl · rfl section Rows variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) theorem physical_selected_visit_marks_congr (j : I) (L : PhysicalMarkLists P J ell) (F G : PhysicalBoundedMarkState P J ell B → ℂ) (hFG : ∀ t, t.1 = L → F t = G t) (s : PhysicalBoundedMarkState P J ell B) : physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = L then F t else 0) s = physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = L then G t else 0) s := by apply congrArg (fun f => physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) f s) funext o t split_ifs with h · exact hFG t h.2 · rfl theorem physical_selected_edge_marks_congr (j : K) (aux : PhysicalAuxLabels P (C j)) (σ τ : PhysicalPermutations (Fin N) J ell) (R : PhysicalMarkLists P J ell) (F G : PhysicalBoundedMarkState P J ell B → ℂ) (hFG : ∀ t, t.1 = R → F t = G t) (s : PhysicalBoundedMarkState P J ell B) : physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j aux σ τ R F s = physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j aux σ τ R G s := by rw [physical_selected_state_edge_block_eq, physical_selected_state_edge_block_eq, physical_mark_raw_extension_marks_congr R F G hFG] theorem physical_selected_edge_zero_of_nonadmissible (j : K) (aux : PhysicalAuxLabels P (C j)) (σ τ : PhysicalPermutations (Fin N) J ell) (L R : PhysicalMarkLists P J ell) (hbad : ¬ physicalListAdmissible (C j) aux (physicalPermuteLabels σ L) (physicalPermuteLabels τ R)) (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) (hs : s.1 = L) : physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j aux σ τ R F s = 0 := by rw [physical_selected_state_edge_block_eq, hs, if_neg hbad, mul_zero] end Rows end Bounty end section /- Uniform causal row estimates bound the exact original forest-restricted path integral. -/ open Finset Classical namespace Bounty section Rows variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Rows end Bounty end section /- The prime-only initial case of uniform finite-depth Buchstab approximation. -/ open Filter Real namespace Bounty theorem uniform_rough_depth_approx_zero {S : ℝ} (hS : 0 ≤ S) : UniformRoughDepthApprox 0 S := by intro a b γ₀ gap ha hγ₀ hgap ε hε filter_upwards [eventually_normalized_prime_cell_error ha hS hε, eventually_gt_atTop (0 : ℝ)] with L hprime hL intro w γ hw hwb hγ hsep htop have hw0 : 0 < w := ha.trans_le hw have hγw : γ ≤ w := by linarith have hA : 1 ≤ exp (w*L) := one_le_exp (mul_nonneg hw0.le hL.le) have hcut : exp (γ*L) ≤ exp (w*L) := exp_le_exp.mpr (mul_le_mul_of_nonneg_right hγw hL.le) have hB : exp (L^(-S))*exp (w*L) ≤ (exp (γ*L))^2 := by rw [← exp_add, ← exp_nat_mul] apply exp_le_exp.mpr norm_num only [Nat.cast_ofNat] have hh := mul_le_mul_of_nonneg_right htop hL.le norm_num only [Nat.cast_zero, zero_add] at hh have hc : (L^(-S)/L)*L = L^(-S) := div_mul_cancel₀ _ hL.ne' nlinarith have heq := rough_band_eq_prime_band_of_upper_le_cutoff_sq hA (exp_pos (γ*L)).le hB rw [max_eq_left hcut] at heq change |normalizedRoughCellCount L S (exp (w*L)) (exp (γ*L))-1/w| ≤ ε unfold normalizedRoughCellCount rw [heq] exact hprime w hw end Bounty end section /- Separating the induction range from the balanced cofactor tail. -/ namespace Bounty open Finset Filter Real MeasureTheory open scoped Topology theorem normalized_buchstab_cofactor_comparison_bound {n : ℕ} {S L a b γ₀ w γ η τ C K : ℝ} (hL : 0 < L) (ha : 0 < a) (hη : 0 ≤ η) (hηa : η ≤ a/4) (hτ : 0 ≤ τ) (hC : 0 ≤ C) (hK : 0 ≤ K) (haw : a ≤ w) (hwb : w ≤ b) (hγ : γ₀ ≤ γ) (hγw : γ ≤ w) (hδ : L^(-S)/L ≤ η) (hrough : ∀ α x : ℝ, γ₀ ≤ α → a/3 ≤ x → |normalizedRoughCellCount L S (exp (x*L)) (exp (α*L))| ≤ C) (hkernel : ∀ α : ℝ, γ₀ ≤ α → α ≤ b → |buchstabDepthExtendedKernel n w α| ≤ K) (hgood : ∀ α : ℝ, γ ≤ α → α ≤ w/2-η → |normalizedRoughCellCount L S (exp ((w-α)*L)) (exp (α*L))- buchstabDepthExtendedKernel n w α| ≤ τ) : |(∑ p ∈ primeBand (exp (γ*L)) (sqrt (exp (L^(-S))*exp (w*L))), normalizedRoughCellCount L S (exp (w*L)/(p : ℝ)) (p : ℝ)/(p : ℝ)) - (∑ p ∈ primeBand (exp (γ*L)) (exp (max γ (w/2)*L)), buchstabDepthExtendedKernel n w (log (p : ℝ)/L)/(p : ℝ))| ≤ τ*primeBandHarmonic (exp (γ₀*L)) (exp (b*L))+ (C+K)*primeBandHarmonic (exp ((w/2-η)*L)) (exp (((w+L^(-S)/L)/2)*L)) := by rw [logarithmic_cell_sqrt_exp w S hL.ne'] let v := (w+L^(-S)/L)/2 let t := max γ (w/2-η) let m := max γ (w/2) have hδ0 : 0 ≤ L^(-S)/L := by positivity have hhalfv : w/2 ≤ v := by dsimp [v]; linarith have hvb : v ≤ b := by dsimp [v]; linarith have htm : t ≤ m := max_le_max le_rfl (by linarith) have hγt : γ ≤ t := le_max_left _ _ have hmb : m ≤ b := max_le (hγw.trans hwb) (by linarith) have htlo : w/2-η ≤ t := le_max_right _ _ have hmass0 (u v : ℝ) : 0 ≤ primeBandHarmonic u v := by unfold primeBandHarmonic exact sum_nonneg (fun _ _ => by positivity) by_cases hγv : γ ≤ v · have hmv : m ≤ v := max_le hγv hhalfv have htv : t ≤ v := htm.trans hmv have he (x y : ℝ) (hxy : x ≤ y) : exp (x*L) ≤ exp (y*L) := exp_le_exp.mpr (mul_le_mul_of_nonneg_right hxy hL.le) have hpoint (p : ℕ) (hp : p ∈ primeBand (exp (γ*L)) (exp (t*L))) : |normalizedRoughCellCount L S (exp (w*L)/(p : ℝ)) (p : ℝ)- buchstabDepthExtendedKernel n w (log (p : ℝ)/L)| ≤ τ := by have hcoord := prime_log_coordinate_mem hL hp have hcut : log (p : ℝ)/L ≤ w/2-η := by by_cases hg : γ ≤ w/2-η · simpa only [t, max_eq_right hg] using hcoord.2 · have hh : log (p : ℝ)/L ≤ γ := by simpa only [t, max_eq_left (le_of_not_ge hg)] using hcoord.2 linarith [hcoord.1] have hp0 : (0 : ℝ) < p := by have hpp := ((mem_primeBand_iff (exp_pos _).le (exp_pos _).le p).mp hp).1 exact Nat.cast_pos.mpr hpp.pos rw [exponential_cofactor_log_coordinate w hL.ne' hp0] have hh := hgood (log (p : ℝ)/L) hcoord.1.le hcut simpa only [exponential_prime_log_coordinate hL.ne' hp0] using hh have htail (p : ℕ) (hp : p ∈ primeBand (exp (t*L)) (exp (v*L))) : |normalizedRoughCellCount L S (exp (w*L)/(p : ℝ)) (p : ℝ)| ≤ C := by have hcoord := prime_log_coordinate_mem hL hp have hp0 : (0 : ℝ) < p := by have hpp := ((mem_primeBand_iff (exp_pos _).le (exp_pos _).le p).mp hp).1 exact Nat.cast_pos.mpr hpp.pos have hα := hγ.trans (hγt.trans hcoord.1.le) have hx : a/3 ≤ w-log (p : ℝ)/L := by dsimp [v] at hcoord; linarith [hcoord.2] rw [exponential_cofactor_log_coordinate w hL.ne' hp0] have hh := hrough (log (p : ℝ)/L) (w-log (p : ℝ)/L) hα hx simpa only [exponential_prime_log_coordinate hL.ne' hp0] using hh have hktail (p : ℕ) (hp : p ∈ primeBand (exp (t*L)) (exp (m*L))) : |buchstabDepthExtendedKernel n w (log (p : ℝ)/L)| ≤ K := by have hcoord := prime_log_coordinate_mem hL hp exact hkernel _ (hγ.trans (hγt.trans hcoord.1.le)) (hcoord.2.trans hmb) have hb := prime_band_reciprocal_split_error (fun p => normalizedRoughCellCount L S (exp (w*L)/(p : ℝ)) (p : ℝ)) (fun p => buchstabDepthExtendedKernel n w (log (p : ℝ)/L)) (he _ _ hγt) (he _ _ htm) (he _ _ hmv) hpoint htail hktail have hmain := exponential_prime_band_harmonic_mono hL.le hγ (htm.trans hmb) have htail1 := exponential_prime_band_harmonic_mono hL.le htlo (le_refl v) have htail2 := exponential_prime_band_harmonic_mono hL.le htlo hmv calc _ ≤ τ*primeBandHarmonic (exp (γ*L)) (exp (t*L))+ C*primeBandHarmonic (exp (t*L)) (exp (v*L))+ K*primeBandHarmonic (exp (t*L)) (exp (m*L)) := hb _ ≤ τ*primeBandHarmonic (exp (γ₀*L)) (exp (b*L))+ C*primeBandHarmonic (exp ((w/2-η)*L)) (exp (v*L))+ K*primeBandHarmonic (exp ((w/2-η)*L)) (exp (v*L)) := add_le_add (add_le_add (mul_le_mul_of_nonneg_left hmain hτ) (mul_le_mul_of_nonneg_left htail1 hC)) (mul_le_mul_of_nonneg_left htail2 hK) _ = _ := by dsimp [v]; ring · have hvγ : v ≤ γ := le_of_not_ge hγv have hmγ : m = γ := max_eq_left (hhalfv.trans hvγ) have hempty : primeBand (exp (γ*L)) (exp (v*L)) = ∅ := prime_band_eq_empty_of_upper_le (exp_le_exp.mpr (mul_le_mul_of_nonneg_right hvγ hL.le)) change |(∑ p ∈ primeBand (exp (γ*L)) (exp (v*L)), normalizedRoughCellCount L S (exp (w*L)/(p : ℝ)) (p : ℝ)/(p : ℝ)) - (∑ p ∈ primeBand (exp (γ*L)) (exp (m*L)), buchstabDepthExtendedKernel n w (log (p : ℝ)/L)/(p : ℝ))| ≤ _ rw [hempty, hmγ, prime_band_eq_empty_of_upper_le le_rfl] simp only [sum_empty, sub_self, abs_zero] exact add_nonneg (mul_nonneg hτ (hmass0 _ _)) (mul_nonneg (add_nonneg hC hK) (hmass0 _ _)) theorem eventually_logarithmic_cell_width_div_le {S η : ℝ} (hS : 0 ≤ S) (hη : 0 < η) : ∀ᶠ L : ℝ in atTop, L^(-S)/L ≤ η := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (1/η)] with L hL1 hLη have hL : 0 < L := zero_lt_one.trans_le hL1 have hp : L^(-S) ≤ 1 := rpow_le_one_of_one_le_of_nonpos hL1 (neg_nonpos.mpr hS) have hηL : 1 ≤ η*L := by have h := (div_le_iff₀ hη).mp hLη nlinarith exact (div_le_div_of_nonneg_right hp hL.le).trans ((div_le_iff₀ hL).mpr hηL) theorem uniform_rough_depth_cofactor_sum_error {n : ℕ} {S : ℝ} (hS : 0 ≤ S) (hprev : UniformRoughDepthApprox n S) {a b γ₀ ε : ℝ} (ha : 0 < a) (hγ₀ : 0 < γ₀) (hγb : γ₀ < b) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ w γ : ℝ, a ≤ w → w ≤ b → γ₀ ≤ γ → γ ≤ w → w+L^(-S)/L ≤ ((n : ℝ)+3)*γ → |(∑ p ∈ primeBand (exp (γ*L)) (sqrt (exp (L^(-S))*exp (w*L))), normalizedRoughCellCount L S (exp (w*L)/(p : ℝ)) (p : ℝ)/(p : ℝ)) - (∑ p ∈ primeBand (exp (γ*L)) (exp (max γ (w/2)*L)), buchstabDepthExtendedKernel n w (log (p : ℝ)/L)/(p : ℝ))| ≤ ε := by obtain ⟨C,hC,hrough⟩ := exists_normalized_rough_cell_bound (a := a/3) (by positivity) hγ₀ have hc : ContinuousOn (fun p : ℝ × ℝ => buchstabDepthExtendedKernel n p.1 p.2) ((Set.Icc a b) ×ˢ (Set.Icc γ₀ b)) := by apply (buchstab_depth_extended_kernel_continuous n).mono intro p hp exact ⟨ha.trans_le hp.1.1, hγ₀.trans_le hp.2.1⟩ obtain ⟨K₀,hK₀⟩ := (isCompact_Icc.prod isCompact_Icc).exists_bound_of_continuousOn hc let K : ℝ := |K₀|+1 have hK : 0 < K := by dsimp [K]; positivity have hkernel : ∀ w α : ℝ, a ≤ w → w ≤ b → γ₀ ≤ α → α ≤ b → |buchstabDepthExtendedKernel n w α| ≤ K := by intro w α haw hwb hα hαb have hh := hK₀ (w,α) ⟨⟨haw,hwb⟩,⟨hα,hαb⟩⟩ rw [Real.norm_eq_abs] at hh exact hh.trans (by dsimp [K]; linarith [le_abs_self K₀]) let M : ℝ := |log (b/γ₀)|+1 have hM : 0 < M := by dsimp [M]; positivity let T : ℝ := 8/a+1 have hT : 0 < T := by dsimp [T]; positivity let τ : ℝ := ε/(4*M) have hτ : 0 < τ := by dsimp [τ]; positivity let η : ℝ := min (a/4) (ε/(4*(C+K)*T)) have hη : 0 < η := by dsimp [η]; positivity have hηa : η ≤ a/4 := min_le_left _ _ have hτbudget : τ*M = ε/4 := by dsimp [τ]; field_simp have hηbudget : (C+K)*(T*η) ≤ ε/4 := by have he : η*(4*(C+K)*T) ≤ ε := (le_div_iff₀ (by positivity : 0 < 4*(C+K)*T)).mp (min_le_right _ _) nlinarith have hmass := (exponential_prime_band_harmonic_tendsto hγ₀ hγb.le).eventually_lt_const (show log (b/γ₀) < M by dsimp [M]; linarith [le_abs_self (log (b/γ₀))]) filter_upwards [eventually_gt_atTop (0 : ℝ), hrough S, hmass, uniform_rough_depth_cofactor_pointwise hprev ha hγ₀ hη hτ, eventually_logarithmic_cell_width_div_le hS hη, exponential_prime_band_short_interval_bound (a := a/4) (η := 2*η) (by positivity) (by positivity) hη] with L hL hr hm hg hδ hs intro w γ haw hwb hγ hγw htop have hraw : ∀ α x : ℝ, γ₀ ≤ α → a/3 ≤ x → |normalizedRoughCellCount L S (exp (x*L)) (exp (α*L))| ≤ C := by intro α x hα hx obtain ⟨h0,h1⟩ := hr α x hα hx simpa only [abs_of_nonneg h0] using h1 have hp := normalized_buchstab_cofactor_comparison_bound hL ha hη.le hηa hτ.le hC.le hK.le haw hwb hγ hγw hδ hraw (fun α hα hαb => hkernel w α haw hwb hα hαb) (fun α hγα hα => hg w γ α haw hwb hγ hγα hα htop) have hδ0 : 0 ≤ L^(-S)/L := by positivity have hsmall : primeBandHarmonic (exp ((w/2-η)*L)) (exp (((w+L^(-S)/L)/2)*L)) ≤ T*η := by have hh := hs (w/2-η) ((w+L^(-S)/L)/2) (by linarith) (by linarith) (by linarith) convert hh using 1; dsimp [T]; field_simp; ring calc _ ≤ τ*primeBandHarmonic (exp (γ₀*L)) (exp (b*L))+ (C+K)*primeBandHarmonic (exp ((w/2-η)*L)) (exp (((w+L^(-S)/L)/2)*L)) := hp _ ≤ τ*M+(C+K)*(T*η) := add_le_add (mul_le_mul_of_nonneg_left hm.le hτ.le) (mul_le_mul_of_nonneg_left hsmall (add_nonneg hC.le hK.le)) _ ≤ ε := by linarith end Bounty /- Public declaration closure audit. -/ end section /- The full candidate mixed dirty estimate, with the genuine small-state measure, arbitrary bounded endpoint coefficient, and both small-slot averages. Actual promotion and storage bounds are discharged separately. -/ open Finset Filter open scoped Classical Topology namespace Bounty end Bounty end section /- The stage indicator is exactly the current original event test, with no births at permutation owners. -/ open Classical Finset namespace Bounty section Gain variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Gain end Bounty end section /- Actual fixed-skeleton ghost stages pay exactly their original selected-child atom costs. -/ open Finset Classical namespace Bounty section Ghost variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (j : J) (htag : steps.get u = some (.inl j)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedBirthAddress S B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) (sk : CoupledGhostSkeleton M B s) (μ : ∀ g, P g → ℝ) (q ρ v : ℝ) (V η : Fin N → ℝ) end Ghost end Bounty end section /- Actual fixed-skeleton full-edge stages pay exactly their original selected-child atom costs. -/ open Finset Classical namespace Bounty section Edge variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (k : K) (htag : steps.get u = some (.inr k)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedBirthAddress S B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (ω : ∀ c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (ρ v : ℝ) (V η : Fin N → ℝ) end Edge end Bounty end section /- Both encoded endpoint states use the same original full divisor and displacement. -/ open scoped Classical namespace Bounty theorem physical_mixed_step_factor {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (k : ℤ) (d : PhysicalSharedLists Ps J) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) : physicalMixedBigStep C k c aux * (physicalSharedProduct d : ℕ) = k * (physicalMixedSharedD C d c aux : ℕ) := by simp only [physicalMixedBigStep, physicalMixedSharedD, Nat.cast_mul] ring end Bounty end section /- The original fresh-birth initial-ledger gate survives the mixed clean encoding change. Neither auxiliary nor promoted labels are newly tested. -/ open Finset open scoped Classical namespace Bounty theorem physical_mixed_clean_initial_sum_reencode {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {J ell B : ℕ} {P : G → Finset ℕ} [∀ g (p : P g), NeZero p.val] (initial : ∀ g, Finset (P g)) (C : G → Finset (Fin J)) (k : ℤ) (d : PhysicalSharedLists Ps J) (ω : PhysicalAuxLabels P C → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (V : G → ℝ) (Θ : PhysicalAuxLabels P C → (∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) → ℂ) (f : PhysicalAuxLabels P C → CleanFullMemoryState P J ell B → ℂ) (hf : ∀ aux, ProductMemorySymmetric (f aux)) (x : CleanFullMemoryState P J ell B) : let τ := fullActivePermutation (cleanPhysicalSlotChange C) let y := τ x let Sp := fun g => physicalFullSharedIndices (ell := ell) (C g) let Sc := cleanFullSharedSlots (ell := ell) C let cp := (productActiveMemorySplit Sp B y).1 let sp := (productActiveMemorySplit Sp B y).2 let cc := (productActiveMemorySplit Sc B x).1 let sc := (productActiveMemorySplit Sc B x).2 (∑ e : FullActiveEdgeEvent (fun g (p : P g) => p.val) Sp B (fun _ => PhysicalAuxLabels P C) (physicalMixedEdgeDelta C k d) (physicalMixedEdgeD C d) y, (fullActiveEdgeEventWeight (fun g (p : P g) => p.val) Sp B (fun _ => PhysicalAuxLabels P C) (physicalMixedEdgeDelta C k d) (physicalMixedEdgeD C d) (fun _ => ω) μ ρ V y e : ℂ) * (if (∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅) ∧ (∀ g i, (e.2 g).2.2.2 i ∉ initial g) then Θ e.1 (physicalCleanFreshEquiv (fun g => ↥(P g)) C (fun g => (unrestrictedJointEventTarget (fun g (p : P g) => p.val) (physicalMixedEdgeDelta C k d cp e.1) (physicalMixedEdgeD C d cp e.1) (fun g => (Sp g)ᶜ.card) B sp e.2 g).1)) else 0) * f e.1 (τ.symm (fullActiveEdgeEventTarget (fun g (p : P g) => p.val) Sp B (fun _ => PhysicalAuxLabels P C) (physicalMixedEdgeDelta C k d) (physicalMixedEdgeD C d) y e))) = ∑ e : FullActiveEdgeEvent (fun g (p : P g) => p.val) Sc B (fun _ => PhysicalAuxLabels P C) (canonicalMixedEdgeDelta C k d) (canonicalMixedEdgeD C d) x, (fullActiveEdgeEventWeight (fun g (p : P g) => p.val) Sc B (fun _ => PhysicalAuxLabels P C) (canonicalMixedEdgeDelta C k d) (canonicalMixedEdgeD C d) (fun _ => ω) μ ρ V x e : ℂ) * (if (∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅) ∧ (∀ g i, (e.2 g).2.2.2 i ∉ initial g) then Θ e.1 (fun g => (unrestrictedJointEventTarget (fun g (p : P g) => p.val) (canonicalMixedEdgeDelta C k d cc e.1) (canonicalMixedEdgeD C d cc e.1) (fun g => (Sc g)ᶜ.card) B sc e.2 g).1) else 0) * f e.1 (fullActiveEdgeEventTarget (fun g (p : P g) => p.val) Sc B (fun _ => PhysicalAuxLabels P C) (canonicalMixedEdgeDelta C k d) (canonicalMixedEdgeD C d) x e) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro τ y Sp Sc cp sp cc sc have h := physical_mixed_clean_event_sum_reencode C k d ω μ ρ V (fun a fresh => if ∀ g i, fresh g i ∉ initial g then Θ a fresh else 0) f hf x dsimp only at h refine Eq.trans ?_ (h.trans ?_) · apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ congr 1 congr 1 convert (physical_clean_initial_event_gate initial C (physicalMixedEdgeDelta C k d cp e.1) (physicalMixedEdgeD C d cp e.1) sp e.2 (Θ e.1 (physicalCleanFreshEquiv (fun g => ↥(P g)) C (fun g => (unrestrictedJointEventTarget (fun g (p : P g) => p.val) (physicalMixedEdgeDelta C k d cp e.1) (physicalMixedEdgeD C d cp e.1) (fun g => (Sp g)ᶜ.card) B sp e.2 g).1)))).symm using 1 <;> congr 2 · apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ congr 1 congr 1 by_cases he : ∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅ · rw [if_pos he] have hi : (∀ g i, (unrestrictedJointEventTarget (fun g (p : P g) => p.val) (canonicalMixedEdgeDelta C k d cc e.1) (canonicalMixedEdgeD C d cc e.1) (fun g => (Sc g)ᶜ.card) B sc e.2 g).1 i ∉ initial g) ↔ ∀ g i, (e.2 g).2.2.2 i ∉ initial g := forall_congr' fun g => unrestricted_clean_fresh_allowed (initial g) (fun p : P g => p.val) (canonicalMixedEdgeDelta C k d cc e.1 g) (canonicalMixedEdgeD C d cc e.1 g) _ B (sc g) (e.2 g) (he g) by_cases ha : ∀ g i, (e.2 g).2.2.2 i ∉ initial g · rw [if_pos (hi.mpr ha), if_pos ⟨he, ha⟩] · rw [if_neg (mt hi.mp ha), if_neg (not_and_of_not_right _ ha)] · simp only [he, false_and, ↓reduceIte] end Bounty end section /- Exact character averages for all shifts in the finite off-diagonal energy. -/ open Finset open scoped ComplexConjugate namespace Bounty noncomputable def typeIICharacterAverage (E N M H Z : Finset ℕ) (k : ℤ) [NeZero (2 * k.natAbs)] (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) : ℂ := (1 / ((2 * k.natAbs).totient : ℂ)) * ∑ χ : DirichletCharacter ℂ (2 * k.natAbs), ∑ y ∈ typeIIFreeDeterminantSlice E N M H Z k, typeIIShiftComplexWeight η α aH y * χ (y.2.1.1 : ZMod (2 * k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2 * k.natAbs))) noncomputable def typeIICharacterSlice (E N M H Z : Finset ℕ) (k : ℤ) (η : ℕ → ℕ → ℝ) (α aH : ℕ → ℂ) : ℂ := if hk : k = 0 then 0 else @typeIICharacterAverage E N M H Z k ⟨by simpa only [ne_eq, mul_eq_zero, OfNat.ofNat_ne_zero, false_or, Int.natAbs_eq_zero] using hk⟩ η α aH theorem typeII_determinant_sum_slices (E N M H : Finset ℕ) (K : Finset ℤ) (Z : Finset ℕ) (f : TypeIIShiftIndex → ℝ) : (∑ y ∈ typeIIDeterminantDomain E N M H K Z, f y) = ∑ k ∈ K, ∑ y ∈ typeIIDeterminantDomain E N M H {k} Z, f y := by classical simp only [typeIIDeterminantDomain, sum_filter, sum_product, sum_singleton] theorem typeII_zero_determinant_slice (E N M H Z : Finset ℕ) : typeIIDeterminantDomain E N M H {0} Z = ∅ := by classical apply filter_eq_empty_iff.mpr intro y hy hc have hk : y.1.1 = 0 := mem_singleton.mp (mem_product.mp (mem_product.mp hy).1).1 exact hc.2.1 hk end Bounty end section /- Actual cap truncation on the genuine mixed state, including moving small labels and residues. The only symmetry assumption is on the terminal test's big pending-memory coordinates. All path masks remain inside the phase. -/ open Finset Classical namespace Bounty end Bounty end section /- Fold the full original P-weight inside the exact separated allocation integral. -/ open Finset Filter MeasureTheory namespace Bounty noncomputable def candidateRetainedAllocationSupport (c L : ℝ) (r jStar : ℕ) (S : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) : Finset ℕ := (S ×ˢ orderedSlotProductSupport (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val)).image (fun z => z.1*z.2) noncomputable def candidateRetainedAllocationIntegrand (c L q : ℝ) (r jStar : ℕ) (R : ℝ) (S : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (F : ℕ → ℕ → ℂ) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) : ℂ := candidateAllocationFourierScalar c L r jStar R ξ * (∑ e ∈ orderedSlotProductSupport (fun slot : CandidateTakenSlot c L r take => candidateQSlotChoices c L r jStar slot.val), ∑ h ∈ candidateRetainedAllocationSupport c L r jStar S take, candidateTakenComplexCoefficient c L r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) e * candidateRetainedComplexCoefficient c L q r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) h * F e h) * activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ theorem eventually_candidate_full_P_separated_convolution {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (S : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ), (∀ p ∈ S, p ∈ Nat.factoredNumbers ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) → ∀ F : ℕ → ℕ → ℂ, (∑ p ∈ S, (candidatePWeight c L q p : ℂ) * ∑ e ∈ orderedSlotProductSupport (fun slot : CandidateTakenSlot c L r take => candidateQSlotChoices c L r jStar slot.val), ∑ n ∈ orderedSlotProductSupport (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val), candidateTakenComplexCoefficient c L r jStar take twist e * candidateRemainingComplexCoefficient c L r jStar take twist n * F e (p*n)) = ∑ e ∈ orderedSlotProductSupport (fun slot : CandidateTakenSlot c L r take => candidateQSlotChoices c L r jStar slot.val), ∑ h ∈ candidateRetainedAllocationSupport c L r jStar S take, candidateTakenComplexCoefficient c L r jStar take twist e * candidateRetainedComplexCoefficient c L q r jStar take twist h * F e h := by filter_upwards [eventually_candidate_retained_convolution hc] with L hL intro q r jStar S take twist hS F simp_rw [mul_sum] rw [sum_comm] apply sum_congr rfl intro e he have h := hL q r jStar take twist S hS (F e) have hmul := congrArg (fun z => candidateTakenComplexCoefficient c L r jStar take twist e * z) h simpa only [mul_sum, candidateRetainedAllocationSupport, mul_assoc, mul_left_comm, mul_comm] using hmul theorem eventually_candidate_retained_allocation_integrand_eq {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (R : ℝ) (S : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool), (∀ p ∈ S, p ∈ Nat.factoredNumbers ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) → ∀ (F : ℕ → ℕ → ℂ) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ), candidateFullPAllocationIntegrand c L q r jStar R S take F ξ = candidateRetainedAllocationIntegrand c L q r jStar R S take F ξ := by filter_upwards [eventually_candidate_full_P_separated_convolution hc] with L hL intro q r jStar R S take hS F ξ unfold candidateFullPAllocationIntegrand candidateSeparatedAllocationIntegrand candidateRetainedAllocationIntegrand rw [← hL q r jStar S take (candidateAllocationFourierTwist c L r jStar take ξ) hS F] simp only [sum_mul, mul_sum] apply sum_congr rfl intro p hp apply sum_congr rfl intro e he apply sum_congr rfl intro n hn ring end Bounty end section /- Removing integer quotient guards using the support of the actual real cutoff. -/ open Finset open scoped ComplexConjugate namespace Bounty theorem typeII_smooth_cutoff_guard_removal {y : TypeIIShiftIndex} (E N : Finset ℕ) (η : ℝ → ℝ → ℝ) (hm : 0 < y.2.1.1) (hm' : 0 < y.2.2.1) (hk : y.1.1 ≠ 0) (hz : y.1.2 = y.2.2.1 * y.2.1.2) (hcross : (y.1.2 : ℤ) + y.1.1 = (y.2.1.1 : ℤ) * y.2.2.2) (hc : IsCoprime (y.2.1.1 : ℤ) y.1.1) (hmod : Int.ModEq (2 * |y.1.1|) (y.2.1.1 : ℤ) (y.2.2.1 : ℤ)) (hpos : ∀ e n, η e n ≠ 0 → 0 < e) (hmem : ∀ e n : ℕ, η e n ≠ 0 → e ∈ E ∧ n ∈ N) : (if 0 < typeIIRecoveredE y ∧ 0 < typeIIRecoveredN y ∧ (typeIIRecoveredE y).toNat ∈ E ∧ (typeIIRecoveredN y).toNat ∈ N then η (typeIIRecoveredE y).toNat (typeIIRecoveredN y).toNat else 0) = η (typeIIRealE y) (typeIIRealN y) := by classical by_cases he : 0 < typeIIRealE y · obtain ⟨hE, hN, hEr, hNr⟩ := typeII_positive_real_reconstruction hm hm' hk hz hcross hc hmod he by_cases hη : η (typeIIRealE y) (typeIIRealN y) = 0 · simp [hEr, hNr, hη] · have hη' : η (typeIIRecoveredE y).toNat (typeIIRecoveredN y).toNat ≠ 0 := by rwa [hEr, hNr] obtain ⟨hmE, hmN⟩ := hmem _ _ hη' simp [hE, hN, hmE, hmN, hEr, hNr] · have hE : ¬ 0 < typeIIRecoveredE y := by intro hp apply he rw [← typeII_recovered_e_real_of_congruence hmod] exact_mod_cast hp have hη : η (typeIIRealE y) (typeIIRealN y) = 0 := by by_contra hne exact he (hpos _ _ hne) simp [hE, hη] def TypeIICrossConditions (y : TypeIIShiftIndex) : Prop := 0 < y.2.1.1 ∧ y.1.1 ≠ 0 ∧ y.1.2 = y.2.2.1 * y.2.1.2 ∧ (y.1.2 : ℤ) + y.1.1 = (y.2.1.1 : ℤ) * y.2.2.2 noncomputable def typeIICrossSlice (M H Z : Finset ℕ) (k : ℤ) : Finset TypeIIShiftIndex := by classical exact ((({k} : Finset ℤ) ×ˢ Z) ×ˢ ((M ×ˢ H) ×ˢ (M ×ˢ H))).filter TypeIICrossConditions noncomputable def typeIIRealShiftWeight (η : ℝ → ℝ → ℝ) (α aH : ℕ → ℂ) (y : TypeIIShiftIndex) : ℂ := (η (typeIIRealE y) (typeIIRealN y) : ℂ) * (α y.2.1.1 * conj (α y.2.2.1) * aH y.2.1.2 * conj (aH y.2.2.2)) theorem typeII_smooth_shift_pointwise {y : TypeIIShiftIndex} (E N : Finset ℕ) (η : ℝ → ℝ → ℝ) (α aH : ℕ → ℂ) (hm' : 0 < y.2.2.1) {W : ℝ} (hrough : ∀ p ∈ y.2.1.1.primeFactors, W < (p : ℝ)) (hsmall : |(y.1.1 : ℝ)| ≤ W) (hpos : ∀ e n, η e n ≠ 0 → 0 < e) (hmem : ∀ e n : ℕ, η e n ≠ 0 → e ∈ E ∧ n ∈ N) : by classical exact (if TypeIIShiftConditions E N y then typeIIShiftComplexWeight (fun e n => η e n) α aH y else 0) = (if TypeIICrossConditions y ∧ Nat.ModEq (2 * y.1.1.natAbs) y.2.1.1 y.2.2.1 then typeIIRealShiftWeight η α aH y else 0) := by classical by_cases hcross : TypeIICrossConditions y · obtain ⟨hm, hk, hz, hcross⟩ := hcross by_cases hmod : Int.ModEq (2 * |y.1.1|) (y.2.1.1 : ℤ) (y.2.2.1 : ℤ) · have hnmod := (typeII_signed_congruence_iff (k := y.1.1) (m := y.2.1.1) (m' := y.2.2.1)).mp hmod have hc := typeII_rough_coprime_determinant hm hk hrough hsmall have hg := typeII_smooth_cutoff_guard_removal E N η hm hm' hk hz hcross hc hmod hpos hmem have hcc : TypeIICrossConditions y := ⟨hm, hk, hz, hcross⟩ have hs : TypeIIShiftConditions E N y ↔ 0 < typeIIRecoveredE y ∧ 0 < typeIIRecoveredN y ∧ (typeIIRecoveredE y).toNat ∈ E ∧ (typeIIRecoveredN y).toNat ∈ N := by unfold TypeIIShiftConditions tauto rw [if_pos (show TypeIICrossConditions y ∧ Nat.ModEq (2 * y.1.1.natAbs) y.2.1.1 y.2.2.1 from ⟨hcc, hnmod⟩)] simp only [hs, typeIIShiftComplexWeight, typeIIRealShiftWeight] rw [← hg] split_ifs <;> simp · have hnmod := mt (typeII_signed_congruence_iff (k := y.1.1) (m := y.2.1.1) (m' := y.2.2.1)).mpr hmod simp [TypeIIShiftConditions, TypeIICrossConditions, hmod, hnmod] · have hc : ¬ TypeIIShiftConditions E N y := by intro h exact hcross ⟨h.1, h.2.1, h.2.2.1, h.2.2.2.1⟩ simp [hc, hcross] end Bounty end section /- All actual allocation patterns may be truncated before Cauchy, at arbitrary logarithmic saving. -/ open Finset Filter Real namespace Bounty theorem eventually_candidate_allocation_box_error {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (A D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (E : ℝ) (F : ℕ → ℕ → ℂ), (∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCompactRangeCoefficient c L q r jStar E u : ℂ)* ∑ m ∈ (2*u+1).divisors, F u m) - ∑ u ∈ arithmeticProductWindow 1 (exp L), candidateBoxRangeCoefficient c L q r jStar E L u* ∑ m ∈ (2*u+1).divisors, F u m‖ ≤ exp L*L^(-D) := by obtain ⟨B,hB,hmass⟩ := exists_candidate_divisor_test_absolute_bound hc hr hq0 hq1 A obtain ⟨C,hC,hL1,hdecay⟩ := active_allocation_fourier_bounds (candidateAllocationRadius r) obtain ⟨M,hM⟩ := exists_candidate_truncation_order hc hC r (D+B) obtain ⟨CM,hCM,htrunc⟩ := hdecay M filter_upwards [hmass, hM M le_rfl CM hCM.le, eventually_ge_atTop (1 : ℝ)] with L hmassL hcost hL intro jStar E F hF have hL0 : 0 < L := zero_lt_one.trans_le hL let N := (candidateQIndices c L).card*r let err : ℝ := N*CM*C^(N-1)*L^(-(M : ℝ)) have herr : 0 ≤ err := by dsimp [err]; positivity have hall : 0 ≤ (2 : ℝ)^N*err := mul_nonneg (by positivity) herr have hsingle (x : ∀ slot, candidateQSlotChoices c L r jStar slot) : ‖(candidateRangeAllocationMass c L r jStar x E : ℂ) - candidateBoxRangeAllocationMass c L r jStar x E L‖ ≤ (2 : ℝ)^N*err := by apply candidate_range_box_error c L r jStar x E L herr intro take hkeep exact htrunc _ (log E) _ _ _ take hkeep L hL have hcost' : (2 : ℝ)^N*err ≤ L^(-(D+B)) := by convert hcost using 1 dsimp [N,err] ring have hbound := norm_fiber_coefficient_error_le (arithmeticProductWindow 1 (exp L)) (fun u => (2*u+1).divisors) (candidateCoefficient c L q r jStar) (fun u => (candidateCompactRangeCoefficient c L q r jStar E u : ℂ)) (candidateBoxRangeCoefficient c L q r jStar E L) F hall (fun u hu => candidate_coefficient_nonneg c L hq0 r jStar u) (fun u hu => candidate_box_coefficient_error c L hq0 r jStar E L u hsingle) calc _ ≤ ((2 : ℝ)^N*err)*(∑ u ∈ arithmeticProductWindow 1 (exp L), candidateCoefficient c L q r jStar u*∑ m ∈ (2*u+1).divisors, ‖F u m‖) := hbound _ ≤ L^(-(D+B))*(exp L*L^B) := mul_le_mul hcost' (hmassL jStar F hF) (sum_nonneg (fun u hu => mul_nonneg (candidate_coefficient_nonneg c L hq0 r jStar u) (sum_nonneg (fun _ _ => norm_nonneg _)))) (rpow_nonneg hL0.le _) _ = exp L*L^(-D) := by rw [mul_left_comm, ← rpow_add hL0] congr 2 ring end Bounty end section /- Exact full-P expansion of the actual box coefficient. -/ open Finset Filter namespace Bounty theorem candidate_box_Q_support (c L : ℝ) (r jStar : ℕ) (E R : ℝ) (n : ℕ) (hn : n ∉ orderedSlotProductSupport (candidateQSlotChoices c L r jStar)) : candidateBoxRangeQWeight c L r jStar E R n = 0 := by classical apply sum_eq_zero intro x hx apply if_neg intro he exact hn (mem_image.mpr ⟨x,mem_univ _,he⟩) end Bounty end section /- Exact finite summation of the three-variable majorant Fourier inversion. -/ open Finset MeasureTheory namespace Bounty end Bounty end section /- The smooth diagonal bound depends on UV and coefficient bounds, not on the allocation scale E. -/ open Finset namespace Bounty theorem typeII_actual_smooth_diagonal (M H : Finset ℕ) (α aH : ℕ → ℂ) {L E U V A B : ℝ} (hL : 0 < L) (hE : 0 < E) (hU : 0 < U) (hV : 0 < V) (hMpos : ∀ m ∈ M, 0 < m) (hM : ∀ m ∈ M, (m : ℝ) ≤ 2 * U) (hH : ∀ h ∈ H, 0 < h) (hα : ∀ m ∈ M, ‖α m‖ ≤ A) (haH : ∀ h ∈ H, ‖aH h‖ ≤ B * (h.divisors.card : ℝ)) : let EF := Icc ⌈E / (2 * L ^ 88)⌉₊ ⌊2 * E⌋₊ let NF := Icc ⌈V / 2⌉₊ ⌊3 * V⌋₊ let η := fun e n : ℕ => typeIIEMajorant (L ^ 88) ((e : ℝ) / E) * typeIINMajorant ((n : ℝ) / V) typeIIDiagonalEnergy EF NF M H η α aH ≤ A ^ 2 * B ^ 2 * (2 * (⌊6 * U * V⌋₊ : ℝ) * (1 + Real.log ⌊6 * U * V⌋₊) ^ 15) := by dsimp only let EF := Icc ⌈E / (2 * L ^ 88)⌉₊ ⌊2 * E⌋₊ let NF := Icc ⌈V / 2⌉₊ ⌊3 * V⌋₊ let η := fun e n : ℕ => typeIIEMajorant (L ^ 88) ((e : ℝ) / E) * typeIINMajorant ((n : ℝ) / V) have hEF : ∀ e ∈ EF, 0 < e := by intro e he have hlo := (Nat.le_ceil (E / (2 * L ^ 88))).trans (by exact_mod_cast (mem_Icc.mp he).1 : (⌈E / (2 * L ^ 88)⌉₊ : ℝ) ≤ e) have hp : (0 : ℝ) < e := lt_of_lt_of_le (by positivity) hlo exact_mod_cast hp have hNF : ∀ n ∈ NF, 0 < n := by intro n hn have hlo := (Nat.le_ceil (V / 2)).trans (by exact_mod_cast (mem_Icc.mp hn).1 : (⌈V / 2⌉₊ : ℝ) ≤ n) have hp : (0 : ℝ) < n := lt_of_lt_of_le (by positivity) hlo exact_mod_cast hp have hNupper : ∀ n ∈ NF, (n : ℝ) ≤ 3 * V := by intro n hn exact (by exact_mod_cast (mem_Icc.mp hn).2 : (n : ℝ) ≤ (⌊3 * V⌋₊ : ℝ)).trans (Nat.floor_le (by positivity)) have hX : ∀ m ∈ M, ∀ n ∈ NF, m * n ≤ ⌊6 * U * V⌋₊ := by intro m hm n hn apply Nat.le_floor push_cast calc (m : ℝ) * n ≤ (2 * U) * (3 * V) := mul_le_mul (hM m hm) (hNupper n hn) (Nat.cast_nonneg _) (by positivity) _ = 6 * U * V := by ring have hη : ∀ e ∈ EF, ∀ n ∈ NF, 0 ≤ η e n ∧ η e n ≤ 1 := by intro e _ n _ have he := typeII_e_majorant_bounds (L ^ 88) ((e : ℝ) / E) have hn := typeII_n_majorant_bounds ((n : ℝ) / V) refine ⟨mul_nonneg he.1 hn.1, ?_⟩ exact (mul_le_mul he.2 hn.2 hn.1 (by norm_num)).trans_eq (by norm_num) have hbound := typeII_diagonal_energy_bound EF NF M H ⌊6 * U * V⌋₊ η α aH (C := 1) (by norm_num) hEF hH hMpos hNF hX hη hα haH simpa only [one_mul] using hbound end Bounty end section /- Pointwise control of the complex truncated coefficient on every integer. -/ open Finset Filter Real namespace Bounty theorem eventually_candidate_box_pointwise_error {c : ℝ} (hc : 0 < c) (r : ℕ) (D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ), 0 ≤ q → ∀ (jStar : ℕ) (E : ℝ) (u : ℕ), ‖(candidateCompactRangeCoefficient c L q r jStar E u : ℂ) - candidateBoxRangeCoefficient c L q r jStar E L u‖ ≤ L^(-D)*candidateCoefficient c L q r jStar u := by obtain ⟨C,hC,hL1,hdecay⟩ := active_allocation_fourier_bounds (candidateAllocationRadius r) obtain ⟨M,hM⟩ := exists_candidate_truncation_order hc hC r D obtain ⟨CM,hCM,htrunc⟩ := hdecay M filter_upwards [hM M le_rfl CM hCM.le, eventually_ge_atTop (1 : ℝ)] with L hcost hL intro q hq jStar E u let N := (candidateQIndices c L).card*r let err : ℝ := N*CM*C^(N-1)*L^(-(M : ℝ)) have herr : 0 ≤ err := by dsimp [err]; positivity have hsingle (x : ∀ slot, candidateQSlotChoices c L r jStar slot) : ‖(candidateRangeAllocationMass c L r jStar x E : ℂ) - candidateBoxRangeAllocationMass c L r jStar x E L‖ ≤ (2 : ℝ)^N*err := by apply candidate_range_box_error c L r jStar x E L herr intro take hkeep exact htrunc _ (log E) _ _ _ take hkeep L hL have hcost' : (2 : ℝ)^N*err ≤ L^(-D) := by convert hcost using 1 dsimp [N,err] ring exact (candidate_box_coefficient_error c L hq r jStar E L u hsingle).trans (mul_le_mul_of_nonneg_right hcost' (candidate_coefficient_nonneg c L hq r jStar u)) theorem eventually_candidate_box_norm_bound {c : ℝ} (hc : 0 < c) (r : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ), 0 ≤ q → ∀ (jStar : ℕ) (E : ℝ) (u : ℕ), ‖candidateBoxRangeCoefficient c L q r jStar E L u‖ ≤ 2*candidateCoefficient c L q r jStar u := by filter_upwards [eventually_candidate_box_pointwise_error hc r 0] with L he intro q hq jStar E u have he' := he q hq jStar E u simp only [neg_zero, rpow_zero, one_mul] at he' have hb := candidate_compact_range_coefficient_bounds c L hq r jStar E u calc _ ≤ ‖(candidateCompactRangeCoefficient c L q r jStar E u : ℂ) - candidateBoxRangeCoefficient c L q r jStar E L u‖ + ‖(candidateCompactRangeCoefficient c L q r jStar E u : ℂ)‖ := by simpa only [add_comm] using norm_le_insert (candidateCompactRangeCoefficient c L q r jStar E u : ℂ) (candidateBoxRangeCoefficient c L q r jStar E L u) _ ≤ candidateCoefficient c L q r jStar u + candidateCoefficient c L q r jStar u := by apply add_le_add he' simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hb.1] using hb.2 _ = _ := by ring end Bounty end section /- The common forest mask is an exact causal factor on original paths, starting from the actual initial prime labels. -/ open Finset Classical namespace Bounty section Factor variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) noncomputable def fullMixedCommonForestHistoryGain (t : ℕ) (tag : Option (J ⊕ K)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : ℝ := if ht : t < steps.length then if steps.get ⟨t, ht⟩ = tag then if birthForestStageCondition (fullMixedCommonIndexStage M B steps) (Fin.succ ⟨t, ht⟩) (fullMixedCommonStepHistoryUpdate n S B A Δ D steps t tag s e history) code then 1 else 0 else 0 else 0 theorem full_mixed_common_forest_history_gain_owner (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val (steps.get u) s e history = if birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonHistoryWrite n S B A Δ D steps u s e history) code then 1 else 0 := by unfold fullMixedCommonForestHistoryGain rw [dif_pos u.isLt, if_pos rfl, full_mixed_common_step_history_update_owner] theorem full_mixed_common_forest_history_factor (hcode : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : finiteEventHistoryFactor (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedCommonStepHistoryUpdate n S B A Δ D steps) (fullMixedCommonForestHistoryGain n S B A Δ D steps code) 0 steps s p (fullMixedCommonHistorySeed n B steps s history) = if birthForestCompatible (fun i => fullMixedCommonBirthPerformed n S B A Δ D steps s p (fullMixedCommonBirthOrder M B steps i)) (fun i => fullMixedCommonBirthLabel n S B A Δ D steps s p (fullMixedCommonBirthOrder M B steps i)) code then 1 else 0 := by rw [finite_event_history_factor_eq_prod] trans (∏ u : Fin steps.length, if birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonPathHistory n S B A Δ D steps s p history (u.val + 1)) code then (1 : ℝ) else 0) · apply prod_congr rfl intro u _ dsimp only rw [Nat.zero_add, full_mixed_common_path_history_at n S B A Δ D steps s p history u.val (Nat.le_of_lt u.isLt), full_mixed_common_forest_history_gain_owner, full_mixed_common_path_history_write] · rw [prod_condition_indicators] simp only [← full_mixed_common_forest_compatible_iff_history_stages n S B A Δ D steps s p history code hcode] end Factor end Bounty end section /- Old performed coordinates embed into the common indices with their owner and group preserved; no within-owner order preservation is assumed. -/ namespace Bounty section Indices variable {J K : Type*} {N : ℕ} {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedCommonOldIndexEmbedding : Fin (Fintype.card (FullMixedBirthAddress S B steps)) ↪ Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) where toFun i := (fullMixedCommonBirthOrder M B steps).symm (.inr (fullMixedCommonStepEmbedding S B steps (fullMixedBirthOrder S B steps i))) inj' := by intro i j h have he := congrArg (fullMixedCommonBirthOrder M B steps) h simp only [Equiv.apply_symm_apply] at he exact (fullMixedBirthOrder S B steps).injective ((fullMixedCommonStepEmbedding S B steps).injective (Sum.inr.inj he)) theorem full_mixed_common_old_index_address (i : Fin (Fintype.card (FullMixedBirthAddress S B steps))) : fullMixedCommonBirthOrder M B steps (fullMixedCommonOldIndexEmbedding S B steps i) = .inr (fullMixedCommonStepEmbedding S B steps (fullMixedBirthOrder S B steps i)) := (fullMixedCommonBirthOrder M B steps).apply_symm_apply _ theorem full_mixed_common_old_index_stage (i : Fin (Fintype.card (FullMixedBirthAddress S B steps))) : fullMixedCommonIndexStage M B steps (fullMixedCommonOldIndexEmbedding S B steps i) = (fullMixedBirthOwner S B steps (fullMixedBirthOrder S B steps i)).succ := by unfold fullMixedCommonIndexStage rw [full_mixed_common_old_index_address] rfl theorem full_mixed_common_old_index_group (i : Fin (Fintype.card (FullMixedBirthAddress S B steps))) : fullMixedCommonBirthGroup M B steps (fullMixedCommonBirthOrder M B steps (fullMixedCommonOldIndexEmbedding S B steps i)) = (fullMixedBirthOrder S B steps i).2.1 := by rw [full_mixed_common_old_index_address] rfl end Indices section Path variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) end Path end Bounty end section /- Actual exceptional-set energy from the proved logarithmic sparse estimate. -/ open Finset Set MeasureTheory namespace Bounty theorem prime_exceptional_integral_logarithmic_bound (s : Finset ℕ) (coeff : s → ℂ) (η R : ℝ) (a b N : ℕ) (c : ℕ → ℂ) {U V : ℝ} (hU : 1 ≤ U) (ha : U ≤ (a : ℝ)) (hb : (b : ℝ) ≤ 2 * U) (hwidth : 2 * (⌈R⌉₊ : ℝ) + 2 ≤ N) (hcard : ((primeExceptionalIntervals s coeff η R).card : ℝ) * (216 * Real.sqrt N) ≤ U) (henergy : (∑ n ∈ Finset.Icc a b, ‖c n‖ ^ 2) ≤ V / U) : (∫ t in primeExceptionalTimes s coeff η R, ‖∑ n ∈ Finset.Icc a b, c n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)‖ ^ 2) ≤ (72 * Real.pi * (1 + 2 * (1 + Real.log N)) + 1) * V := by have hsub : primeExceptionalIntervals s coeff η R ⊆ Finset.Icc (-(⌈R⌉₊ : ℤ) - 1) (⌈R⌉₊ : ℤ) := by intro j hj exact ((mem_occupiedUnitIntervals _ _ _).mp hj).1 apply (prime_exceptional_integral_le_unit_suprema s coeff η R _ (by fun_prop)).trans apply logarithmic_sparse_interval_energy_bound (primeExceptionalIntervals s coeff η R) a b c N (l := -(⌈R⌉₊ : ℝ) - 1) (r := (⌈R⌉₊ : ℝ) + 1) hU ha hb · intro j hj exact (prime_exceptional_window_bounds R j (hsub hj)).1 · intro j hj have hh := (prime_exceptional_window_bounds R j (hsub hj)).2 linarith · linarith · exact hcard · exact henergy end Bounty end section /- The proven progression estimate applies to every residue class of an actual divisor interval. -/ open Finset Filter namespace Bounty theorem exists_divisor_residue_logarithmic_bound (τ : ℝ) (hτ : 0 < τ) : ∃ δ D N0 : ℝ, 0 < δ ∧ 0 < D ∧ 1 ≤ N0 ∧ ∀ (Y x u : ℝ) (a b d q : ℕ) [NeZero q] (r : ZMod q), 0 < d → Y ≤ (a : ℝ)+1 → (b : ℝ) ≤ 2*Y → N0 ≤ Y/((d : ℝ)*(q : ℝ)) → 1 ≤ x → x^(τ/2) ≤ Y/((d : ℝ)*(q : ℝ)) → u ≠ 0 → |u| ≤ x^2 → ‖∑ n ∈ (Ioc (a/d) (b/d)).filter (fun n : ℕ => (n : ZMod q) = r), Complex.exp (((u*Real.log ((n : ℝ)*(d : ℝ)) : ℝ) : ℂ)*Complex.I)‖ ≤ D*(Y/((d : ℝ)*(q : ℝ)))*(1/|u|+(Y/((d : ℝ)*(q : ℝ)))^(-δ)) := by obtain ⟨δ,D,hδ,hD,hphase⟩ := eventually_long_affine_logarithmic_phase τ 3 hτ (by norm_num) obtain ⟨N0,hN0⟩ := eventually_atTop.mp hphase refine ⟨δ,D,max 1 N0,hδ,hD,le_max_left _ _,?_⟩ intro Y x u a b d q hqInst r hd hYa hbY hN hx hxN hu hux have hdR : 0 < (d : ℝ) := by exact_mod_cast hd have hqNat : 0 < q := Nat.pos_of_ne_zero (NeZero.ne q) have hqR : 0 < (q : ℝ) := by exact_mod_cast hqNat have hprod : 0 < (d : ℝ)*(q : ℝ) := mul_pos hdR hqR have hN1 : 1 ≤ Y/((d : ℝ)*(q : ℝ)) := (le_max_left _ _).trans hN have hscale : (d : ℝ)*(q : ℝ) ≤ Y := by have hh := (le_div_iff₀ hprod).mp hN1 simpa only [one_mul] using hh let l : ℤ := (((a/d : ℕ) : ℤ)-(r.val : ℤ))/(q : ℤ)+1 let v : ℤ := (((b/d : ℕ) : ℤ)-(r.val : ℤ))/(q : ℤ) have hgeometry := progression_real_scale (a : ℤ) (b : ℤ) (d : ℤ) (q : ℤ) (r.val : ℤ) (by exact_mod_cast hd) (by exact_mod_cast hqNat) (by simpa only [Int.cast_natCast] using hYa) (by simpa only [Int.cast_natCast] using hbY) (by simpa only [Int.cast_natCast] using hscale) have hoffset : (d : ℝ)*(r.val : ℝ)/((d : ℝ)*(q : ℝ)) = (r.val : ℝ)/(q : ℝ) := by field_simp have hgeom : Y/((d : ℝ)*(q : ℝ)) ≤ (l : ℝ)+(r.val : ℝ)/(q : ℝ) ∧ (v : ℝ)+1+(r.val : ℝ)/(q : ℝ) ≤ 3*(Y/((d : ℝ)*(q : ℝ))) := by simpa only [l,v,Int.natCast_ediv,Int.cast_natCast] using hgeometry have hb := hN0 (Y/((d : ℝ)*(q : ℝ))) ((le_max_right _ _).trans hN) x ((d : ℝ)*(q : ℝ)) ((d : ℝ)*(r.val : ℝ)) u l v hx hxN hprod hu hux (by simpa only [hoffset] using hgeom.1) (by simpa only [hoffset] using hgeom.2) have he := natural_residue_interval_sum (a/d) (b/d) r (fun z : ℤ => Complex.exp (((u*Real.log ((z : ℝ)*(d : ℝ)) : ℝ) : ℂ)*Complex.I)) simp only [Int.cast_natCast] at he rw [he] convert hb using 1 congr 1 apply sum_congr rfl intro n hn congr 3 push_cast ring_nf end Bounty end section /- The original selected prime peel has exactly the residual used by the analytic application. -/ open Finset open scoped ComplexConjugate namespace Bounty theorem marked_divisor_weight_subtype {G : Type*} (groups : Finset G) (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (n : ℤ) : markedDivisorWeight univ (fun g : groups => P g.val) q (fun g => V g.val) (fun g => t g.val) n = markedDivisorWeight groups P q V t n := by exact prod_coe_sort groups (fun g => markedDivisorFactor q (V g) (physicalOmega P g n) (t g)) end Bounty end section /- The exact raw shared-draw formula also retains shared-dependent phases, position guards, and auxiliary-label exclusions. -/ open Finset open scoped Classical namespace Bounty theorem physical_normalized_cut_sum_eq_raw_draws {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (V : G → ℝ) (F : GroupMarkedLists P (fun g => ell + (C g).card) → GroupMarkedLists P (fun g => ell + (C g).card) → PhysicalAuxLabels P (fun g => univ \ C g) → ℂ) : (∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then ((physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * F (physicalGroupUnsharedEmbedding C L) (physicalGroupUnsharedEmbedding C R) (physicalSharedAux C L) else 0) = ∑ u : GroupMarkedLists P (fun g => ell + (C g).card), ∑ v : GroupMarkedLists P (fun g => ell + (C g).card), ∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if physicalRawCutGood C u v s then ((physicalAuxMass V (fun g => univ \ C g) s * physicalCompletionMass V C ell ^ 2 : ℝ) : ℂ) * F u v s else 0 := by have haux (d : PhysicalJointCutData P C ell) : physicalSharedAux C (physicalCutGlue C d.1 d.2.1) = fun g j => d.1 g j := by simpa only [physical_cut_pair_inverse_left] using physical_cut_pair_inverse_shared_aux C d rw [physical_joint_normalized_sum_eq_shared_draw_sum] simp only [physical_cut_glue_unshared, haux] exact physical_joint_cut_sum_eq_raw_sum P C (fun u v s => ((physicalAuxMass V (fun g => univ \ C g) s * physicalCompletionMass V C ell ^ 2 : ℝ) : ℂ) * F u v s) end Bounty end section /- The shared-exclusion loss after both conditional marked-list averages. -/ open Finset open scoped Classical namespace Bounty theorem physical_cut_shared_pair_average_error {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (aux : PhysicalAuxLabels P C) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (b : GroupMarkedLists P (fun g => ell + (C g).card) → GroupMarkedLists P (fun g => ell + (C g).card) → ℂ) {H : ℝ} (hH : 0 ≤ H) (hb : ∀ (u : GroupMarkedListsAt P (fun g => ell + (C g).card) (w : ℤ)) (v : GroupMarkedListsAt P (fun g => ell + (C g).card) (z : ℤ)), ‖b u.val v.val‖ ≤ H) : ‖groupMarkedAverage P (fun g => ell + (C g).card) (w : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) (z : ℤ) (fun v => ∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if physicalRawCutGood C u v s then if ∀ g j, s g j ∉ physicalSharedForbidden C aux g w z then (physicalAuxMass V (fun g => univ \ C g) s : ℂ) * b u v else 0 else 0)) - groupMarkedAverage P (fun g => ell + (C g).card) (w : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) (z : ℤ) (b u))‖ ≤ (∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin)) * H := by have hwL : 0 ≤ Real.log (w : ℝ) := Real.log_nonneg (by exact_mod_cast (show 1 ≤ w from hw)) have hzL : 0 ≤ Real.log (z : ℝ) := Real.log_nonneg (by exact_mod_cast (show 1 ≤ z from hz)) have hδ : 0 ≤ ∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin) := by apply sum_nonneg intro g _ have hv0 := (hV g).le positivity simp only [← group_marked_average_sub] apply group_marked_pair_average_norm_le P (fun g => ell + (C g).card) (w : ℤ) (z : ℤ) _ (mul_nonneg hδ hH) intro u v have hu : ∀ g i, (u.val g i).val ∣ w := by intro g i exact_mod_cast u.property g i have hv : ∀ g i, (v.val g i).val ∣ z := by intro g i exact_mod_cast v.property g i exact (physical_cut_shared_constant_error C hprime V hV hMass u.val v.val aux hw hz hu hv hPmin hp (b u.val v.val)).trans (mul_le_mul_of_nonneg_left (hb u v) hδ) end Bounty end section /- The bad-draw probability bound after both actual marked-list averages. -/ open Finset open scoped Classical namespace Bounty theorem physical_shared_error_factor_nonneg {G : Type*} [Fintype G] {J : ℕ} (C : G → Finset (Fin J)) (V : G → ℝ) (hV : ∀ g, 0 ≤ V g) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) {Pmin : ℝ} (hPmin : 0 ≤ Pmin) : 0 ≤ ∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin) := by have hwL : 0 ≤ Real.log (w : ℝ) := Real.log_nonneg (by exact_mod_cast (show 1 ≤ w from hw)) have hzL : 0 ≤ Real.log (z : ℝ) := Real.log_nonneg (by exact_mod_cast (show 1 ≤ z from hz)) apply sum_nonneg intro g _ have hv0 := hV g positivity end Bounty end section /- Separation and conjugation for the actual finite marked-list averages. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] (P : G → Finset ℕ) (t : G → ℕ) include G sharedInstance1 P t theorem group_marked_average_mul_right (n : ℤ) (b : GroupMarkedLists P t → ℂ) (c : ℂ) : groupMarkedAverage P t n (fun L => b L * c) = groupMarkedAverage P t n b * c := by simpa only [mul_comm] using group_marked_average_mul_left P t n c b theorem group_marked_pair_average_separate (w z : ℤ) (a b : GroupMarkedLists P t → ℂ) : groupMarkedAverage P t w (fun u => groupMarkedAverage P t z (fun v => a u * b v)) = groupMarkedAverage P t w a * groupMarkedAverage P t z b := by simp only [group_marked_average_mul_left, group_marked_average_mul_right] theorem group_marked_average_star (n : ℤ) (b : GroupMarkedLists P t → ℂ) : groupMarkedAverage P t n (fun L => star (b L)) = star (groupMarkedAverage P t n b) := by simp only [groupMarkedAverage, star_mul, star_inv₀, star_natCast, star_sum, mul_comm] end end Bounty end section /- A rational gcd slice acts on the full residual, separately from its prime-pool cutoff. -/ open Finset namespace Bounty noncomputable def rationalResidualGcdMultiplier (r d : ℕ) (ψ : AddChar (Additive (ZMod (r/d))ˣ) ℂ) (n : ℕ) : ℂ := if n.gcd r = d then unitAddCharDirichlet ψ ((n/d : ℕ) : ZMod (r/d)) else 0 theorem rational_residual_gcd_multiplier_norm_le (r d : ℕ) (ψ : AddChar (Additive (ZMod (r/d))ˣ) ℂ) (n : ℕ) : ‖rationalResidualGcdMultiplier r d ψ n‖ ≤ 1 := by unfold rationalResidualGcdMultiplier split_ifs · exact (unitAddCharDirichlet ψ).norm_le_one _ · simp only [norm_zero, zero_le_one] theorem rational_residual_gcd_filtered_sum (r d : ℕ) (ψ : AddChar (Additive (ZMod (r/d))ˣ) ℂ) (F : Finset ℕ) (a w : ℕ → ℂ) : (∑ n ∈ F.filter (fun n => n.gcd r = d), a n * unitAddCharDirichlet ψ ((n/d : ℕ) : ZMod (r/d)) * w n) = ∑ n ∈ F, a n * rationalResidualGcdMultiplier r d ψ n * w n := by rw [sum_filter] apply sum_congr rfl intro n _ by_cases hn : n.gcd r = d · simp only [rationalResidualGcdMultiplier, hn, if_true] · simp only [rationalResidualGcdMultiplier, hn, if_false, mul_zero, zero_mul] noncomputable def rationalProductCharacter (r d : ℕ) {q : ℕ} (χ : DirichletCharacter ℂ q) (ψ : AddChar (Additive (ZMod (r/d))ˣ) ℂ) : DirichletCharacter ℂ (q*(r/d)) := χ.changeLevel (Nat.dvd_mul_right q (r/d)) * (unitAddCharDirichlet ψ).changeLevel (Nat.dvd_mul_left (r/d) q) theorem rational_product_character_apply (r d : ℕ) {q : ℕ} (χ : DirichletCharacter ℂ q) (ψ : AddChar (Additive (ZMod (r/d))ˣ) ℂ) (n : ℕ) : rationalProductCharacter r d χ ψ (n : ZMod (q*(r/d))) = χ (n : ZMod q) * unitAddCharDirichlet ψ (n : ZMod (r/d)) := product_level_characters_nat_apply χ (unitAddCharDirichlet ψ) n theorem rational_product_modulus_power_bound {L A B : ℝ} (hL : 0 < L) {q r d : ℕ} (hq : (q : ℝ) ≤ L^A) (hr : (r : ℝ) ≤ L^B) : ((q*(r/d) : ℕ) : ℝ) ≤ L^(A+B) := by apply product_modulus_power_bound hL hq exact (Nat.cast_le.mpr (Nat.div_le_self r d)).trans hr theorem candidate_selected_residual_full_multiplier (c L q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (t u : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => u g.val) → ℂ) (κ θ ρ : ℕ → ℂ) (n : ℕ) : candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ t u big b κ (fun n => θ n*ρ n) n = candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ t u big b κ θ n * ρ n := by unfold candidateSelectedResidualCoefficient ring end Bounty end section /- The actual alternating selected visit/edge schedule for a fixed original path. -/ open scoped Classical namespace Bounty noncomputable def physicalMarkAtCut {N J ell n : ℕ} {P : Fin N → Finset ℕ} (L : Fin (n + 1) → PhysicalMarkLists P J ell) (i : ℕ) : PhysicalMarkLists P J ell := L ⟨min (i / 2) n, Nat.lt_succ_of_le (min_le_right _ _)⟩ section variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (L : Fin (n + 1) → PhysicalMarkLists P J ell) (j : Fin (n + 1)) include N J ell n P L j theorem physical_mark_at_cut_even : physicalMarkAtCut L (2 * j.val) = L j := by unfold physicalMarkAtCut congr 1 apply Fin.ext have := j.isLt dsimp omega theorem physical_mark_at_cut_odd : physicalMarkAtCut L (2 * j.val + 1) = L j := by unfold physicalMarkAtCut congr 1 apply Fin.ext have := j.isLt dsimp omega end section Schedule variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) noncomputable def physicalSelectedCoarseRow (i : ℕ) (F : PhysicalBoundedMarkState P J ell B → ℂ) : PhysicalBoundedMarkState P J ell B → ℂ := if hi : i < 2 * n + 1 then if he : i % 2 = 0 then let j : Fin (n + 1) := ⟨i / 2, by omega⟩ physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = L j then F t else 0) else let j : Fin n := ⟨i / 2, by omega⟩ physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.succ) F else fun _ => 0 noncomputable def physicalSelectedCoarseScalar (i : ℕ) : ℂ := if hi : i < 2 * n + 1 then if he : i % 2 = 0 then 1 else let j : Fin n := ⟨i / 2, by omega⟩ (((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) ^ 2) * (ω j (physicalSharedMarkLabels (C j) (physicalPermuteLabels (σ j) (L j.castSucc))) (aux j) : ℂ) else 1 theorem physical_selected_coarse_row_even (j : Fin (n + 1)) (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention (2 * j.val) F = physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = L j then F t else 0) := by have hj := j.isLt have hi : 2 * j.val < 2 * n + 1 := by omega have he : (2 * j.val) % 2 = 0 := by omega have hd : (2 * j.val) / 2 = j.val := by omega have hjEq (h : (2 * j.val) / 2 < n + 1) : (⟨(2 * j.val) / 2, h⟩ : Fin (n + 1)) = j := Fin.ext hd unfold physicalSelectedCoarseRow rw [dif_pos hi, dif_pos he] simp only [hjEq] congr 1 funext o t split_ifs <;> rfl theorem physical_selected_coarse_row_odd (j : Fin n) (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention (2 * j.val + 1) F = physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.succ) F := by have hj := j.isLt have hi : 2 * j.val + 1 < 2 * n + 1 := by omega have he : ¬ (2 * j.val + 1) % 2 = 0 := by omega have hd : (2 * j.val + 1) / 2 = j.val := by omega have hjEq (h : (2 * j.val + 1) / 2 < n) : (⟨(2 * j.val + 1) / 2, h⟩ : Fin n) = j := Fin.ext hd unfold physicalSelectedCoarseRow rw [dif_pos hi, dif_neg he] exact congrArg (fun t : Fin n => physicalSelectedStateEdgeBlock C k ω β retention ρ V hV t (aux t) (σ t) (τ t) (L t.succ) F) (hjEq _) theorem physical_selected_coarse_scalar_even (j : Fin (n + 1)) : physicalSelectedCoarseScalar C aux L σ ω (2 * j.val) = 1 := by have hj := j.isLt have hi : 2 * j.val < 2 * n + 1 := by omega have he : (2 * j.val) % 2 = 0 := by omega simp only [physicalSelectedCoarseScalar, dif_pos hi, dif_pos he] theorem physical_selected_coarse_scalar_odd (j : Fin n) : physicalSelectedCoarseScalar C aux L σ ω (2 * j.val + 1) = (((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) ^ 2) * (ω j (physicalSharedMarkLabels (C j) (physicalPermuteLabels (σ j) (L j.castSucc))) (aux j) : ℂ) := by have hj := j.isLt have hi : 2 * j.val + 1 < 2 * n + 1 := by omega have he : ¬ (2 * j.val + 1) % 2 = 0 := by omega have hd : (2 * j.val + 1) / 2 = j.val := by omega have hjEq (h : (2 * j.val + 1) / 2 < n) : (⟨(2 * j.val + 1) / 2, h⟩ : Fin n) = j := Fin.ext hd unfold physicalSelectedCoarseScalar rw [dif_pos hi, dif_neg he] exact congrArg (fun t : Fin n => (((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) ^ 2) * (ω t (physicalSharedMarkLabels (C t) (physicalPermuteLabels (σ t) (L t.castSucc))) (aux t) : ℂ)) (hjEq _) end Schedule end Bounty end section /- A uniform pair-count bound normalized by the actual candidate marked harmonic mass. -/ open Finset Filter open scoped Topology namespace Bounty end Bounty end section /- The local norm bound in the exact finite pattern-family form consumed by CleanHybridUnbannedBound. The raw row and alternating comparison signs remain explicit. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_repeated_big_prime_pattern_norm_le (hZ : PrimitiveZeroFreeHalfPlane) (c s z a v D ε : ℝ) (m : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (hm : 0 < m) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G] (J ell : ℕ), ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, ∀ hrt : Disjoint r t, ∀ ζ Θ : ℝ, |ζ| ≤ L ^ z → ∀ u : RepeatedBigLists P J ell → ℂ, u ∈ repeatedBigSymmetricSubspace → let slots := fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)) let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigSymmetrizeLinear (fun source => ∑ target, (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i), repeatedBigPrimePatternWeight probes r t i * repeatedBigUnbannedKernel V (fun _ _ => 1) (repeatedBigPrimePatternCut probes r t i) ζ (repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i) aux source target * physicalReturnPhase Θ (repeatedBigD (repeatedBigPrimePatternCut probes r t i) source aux)) * u target)) ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma slots).card + (t.sigma slots).card) * L ^ (-D)) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) u := by intro κ s' A₀ q w x filter_upwards [eventually_repeated_big_prime_projected_norm_le hZ c s z a v D ε m hc hs hz ha hv hD hε hm] with L hnorm intro Q h ξ G _ _ J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ u hu slots kept have hb := hnorm J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ u hu simpa only [repeated_big_prime_pattern_family_kernel] using hb end Bounty end section /- Explicit pointwise bounds for the actual raw and comparison pattern coefficients. Retained-cell membership supplies the required mass floors. -/ open Finset open scoped Classical namespace Bounty noncomputable def repeatedBigPrimePatternBound {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (Q : ℕ) (ξ : ℝ) : RepeatedBigPrimePatternIndex (ell := ell) probes r t → ℝ | .inl _ => 1 | .inr _ => ((Q * Q : ℕ) / ξ) ^ 2 theorem repeated_big_prime_pattern_bound_nonneg {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (Q : ℕ) (ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) : 0 ≤ repeatedBigPrimePatternBound probes r t Q ξ i := by cases i with | inl u => exact zero_le_one | inr ab => exact sq_nonneg _ theorem repeated_big_prime_pattern_weight_norm {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) : ‖repeatedBigPrimePatternWeight probes r t i‖ = 1 := by cases i <;> simp [repeatedBigPrimePatternWeight, norm_pow] theorem repeated_big_prime_pattern_kernel_norm_le {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (source target : RepeatedBigLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) : let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ ‖repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i source target aux‖ ≤ repeatedBigPrimePatternBound probes r t Q ξ i := by intro kept cases i with | inl u => simp only [repeatedBigPrimePatternKernel, repeatedBigPrimePatternBound, norm_one, le_refl] | inr ab => dsimp only [repeatedBigPrimePatternKernel, repeatedBigPrimePatternBound] refine repeated_big_prime_coefficient_norm_le P V ab.1.val ab.2.val _ _ Q h _ _ hξ ?_ ?_ source target aux · intro d hd exact prime_product_retained_cell_mass _ _ h ξ hd · intro d hd exact prime_product_retained_cell_mass _ _ h ξ hd end Bounty end section /- The actual masked pair count averaged over Bernoulli choices. -/ open Finset namespace Bounty theorem exists_odd_masked_pair_average_upper : ∃ K : ℝ, 0 < K ∧ ∀ (L : ℝ) (a b c d m : ℕ) [NeZero m] (W z q : ℝ) (P : Finset ℕ), 1 ≤ L → (m : ℝ) ≤ Real.exp L → (∀ p ∈ m.primeFactors, L^2 ≤ (p : ℝ)) → a ≤ b → c ≤ d → 0 ≤ W → W ≤ z → 1 < z → 0 ≤ q → q ≤ 1 → (∀ p ∈ P, 2 ≤ p) → (∑ S ∈ P.powerset, bernoulliSubsetWeight q P S * ((oddMaskedPairBox a b c d m W z S).card : ℝ)) ≤ K * (((b : ℝ)-a)*((d : ℝ)-c)/(m : ℝ)) * (∏ p ∈ primeBand 0 W, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) * (∏ p ∈ P, (1 + q/((p : ℝ)-1))) + ((m : ℝ)*(z^(10 : ℝ))^3 + (((b : ℝ)-a)+((d : ℝ)-c))*(z^(10 : ℝ))^2) := by obtain ⟨K, hK, hb⟩ := exists_odd_masked_pair_box_upper refine ⟨K, hK, ?_⟩ intro L a b c d m hm W z q P hL hmL hmin hab hcd hW hWz hz hq0 hq1 hP let M := K * (((b : ℝ)-a)*((d : ℝ)-c)/(m : ℝ)) * (∏ p ∈ primeBand 0 W, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) let E := (m : ℝ)*(z^(10 : ℝ))^3 + (((b : ℝ)-a)+((d : ℝ)-c))*(z^(10 : ℝ))^2 have hbound (S : Finset ℕ) (hS : S ∈ P.powerset) : bernoulliSubsetWeight q P S * ((oddMaskedPairBox a b c d m W z S).card : ℝ) ≤ bernoulliSubsetWeight q P S * (M * (∏ p ∈ S, (1 - 1/(p : ℝ))⁻¹) + E) := by exact mul_le_mul_of_nonneg_left (hb L a b c d m W z S hL hmL hmin hab hcd hW hWz hz (fun p hp => hP p (mem_powerset.mp hS hp))) (bernoulliSubsetWeight_nonneg hq0 hq1 P S) have hid : (∑ S ∈ P.powerset, bernoulliSubsetWeight q P S * (M * (∏ p ∈ S, (1 - 1/(p : ℝ))⁻¹) + E)) = M * (∑ S ∈ P.powerset, bernoulliSubsetWeight q P S * (∏ p ∈ S, (1 - 1/(p : ℝ))⁻¹)) + E * (∑ S ∈ P.powerset, bernoulliSubsetWeight q P S) := by rw [mul_sum, mul_sum, ← sum_add_distrib] apply sum_congr rfl intro S _ ring calc _ ≤ _ := sum_le_sum hbound _ = _ := hid _ = _ := by rw [bernoulli_mask_inverse_avoidance P q hP, sum_bernoulliSubsetWeight, mul_one] end Bounty end section /- Actual shifted pairs satisfy the corrected odd-prime sieve conditions. -/ open Finset namespace Bounty theorem odd_prime_shifted_divisibility {p u n : ℕ} (hp : p.Prime) (hp2 : p ≠ 2) (hn : n = 2*u+1) : p ∣ n-1 ↔ p ∣ u := by rw [hn, Nat.add_sub_cancel, hp.dvd_mul] have hnot : ¬p ∣ 2 := by intro h exact hp2 (((Nat.dvd_prime Nat.prime_two).mp h).resolve_left hp.ne_one) simp only [hnot, false_or] theorem shifted_unmarked_divisor_set (P : Finset ℕ) (hprime : ∀ p ∈ P, p.Prime) (hP2 : 2 ∉ P) (D u : ℕ) (v : ℕ × ℕ) (hv : v.1*v.2 = 2*u+1) : (P \ D.primeFactors).filter (fun p => p ∣ u) = (P \ D.primeFactors).filter (fun p => p ∣ v.1*v.2-1) := by apply filter_congr intro p hp have hpP := (mem_sdiff.mp hp).1 exact (odd_prime_shifted_divisibility (hprime p hpP) (fun he => hP2 (he ▸ hpP)) hv).symm theorem prime_assignment_odd_pair_mem (P : Finset ℕ) {W z : ℝ} (hz : 0 ≤ z) (a b c d D u : ℕ) (v : ℕ × ℕ) (hv : v.1*v.2 = 2*u+1) (hrect : v.1 ∈ Ioc a b ∧ v.2 ∈ Ioc c d) (hrough : ∀ p ∈ primeBand 0 W, ¬p ∣ v.1*v.2) (hcond : primeAssignmentCondition P z u D) : v ∈ oddMaskedPairBox a b c d D W z (P \ D.primeFactors) := by classical apply mem_filter.mpr refine ⟨?_, hrough, ?_⟩ · apply mem_filter.mpr refine ⟨?_, ?_⟩ · simpa only [Finset.product_eq_sprod, mem_product] using hrect · rw [hv, Nat.add_mod, Nat.mul_mod, Nat.mod_eq_zero_of_dvd hcond.1, mul_zero, Nat.zero_mod, zero_add, Nat.mod_mod] · intro p hp hp2 hpD hpA heq obtain ⟨hprime, _, hpz⟩ := (mem_primeBand_iff le_rfl hz p).mp hp have hpP : p ∉ P := by intro hpP exact hpA (mem_sdiff.mpr ⟨hpP, fun hpf => hpD (Nat.dvd_of_mem_primeFactors hpf)⟩) have hn : 1 ≤ v.1*v.2 := by omega have hdiv : p ∣ v.1*v.2-1 := (Nat.modEq_iff_dvd' hn).mp heq.symm exact hpD (hcond.2 p hprime hpz hpP ((odd_prime_shifted_divisibility hprime hp2 hv).mp hdiv)) noncomputable def oddPairAssignmentPower (a b c d D : ℕ) (W z : ℝ) (P : Finset ℕ) (q : ℝ) (v : ℕ × ℕ) : ℝ := by classical exact if v ∈ oddMaskedPairBox a b c d D W z (P \ D.primeFactors) then q^(((P \ D.primeFactors).filter (fun p => p ∣ v.1*v.2-1)).card) else 0 section variable (P : Finset ℕ) (hprime : ∀ p ∈ P, p.Prime) (hP2 : 2 ∉ P) {q N W z : ℝ} (hq : 0 ≤ q) (hN : 0 ≤ N) (hz : 0 ≤ z) include P hprime hP2 q N W z hq hN hz theorem prime_assignment_term_le_odd_pair (a b c d D u : ℕ) (v : ℕ × ℕ) (hv : v.1*v.2 = 2*u+1) (hrect : v.1 ∈ Ioc a b ∧ v.2 ∈ Ioc c d) (hrough : ∀ p ∈ primeBand 0 W, ¬p ∣ v.1*v.2) : primeAssignmentTerm P q z N u D ≤ (1/N) * oddPairAssignmentPower a b c d D W z P q v := by classical by_cases hcond : primeAssignmentCondition P z u D · have hmem := prime_assignment_odd_pair_mem P hz a b c d D u v hv hrect hrough hcond rw [primeAssignmentTerm, if_pos hcond, oddPairAssignmentPower, if_pos hmem, shifted_unmarked_divisor_set P hprime hP2 D u v hv] apply le_of_eq ring · rw [primeAssignmentTerm, if_neg hcond] apply mul_nonneg (by positivity) unfold oddPairAssignmentPower split_ifs <;> positivity theorem sum_prime_assignment_le_odd_pair_sum (a b c d D : ℕ) (S : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ) (hv : ∀ v ∈ S, v.1*v.2 = 2*u v+1) (hrect : ∀ v ∈ S, v.1 ∈ Ioc a b ∧ v.2 ∈ Ioc c d) (hrough : ∀ v ∈ S, ∀ p ∈ primeBand 0 W, ¬p ∣ v.1*v.2) : (∑ v ∈ S, primeAssignmentTerm P q z N (u v) D) ≤ (1/N) * ∑ v ∈ oddMaskedPairBox a b c d D W z (P \ D.primeFactors), q^(((P \ D.primeFactors).filter (fun p => p ∣ v.1*v.2-1)).card) := by classical have hpoint := sum_le_sum (fun v hvS => prime_assignment_term_le_odd_pair P hprime hP2 hq hN hz a b c d D (u v) v (hv v hvS) (hrect v hvS) (hrough v hvS)) rw [← mul_sum] at hpoint refine hpoint.trans (mul_le_mul_of_nonneg_left ?_ (by positivity)) unfold oddPairAssignmentPower rw [← sum_filter] apply sum_le_sum_of_subset_of_nonneg · intro v hvS exact (mem_filter.mp hvS).2 · intro v _ _ positivity end end Bounty end section /- The original coefficient, initial avoidance and residual phases retained by forest restoration. -/ open scoped Classical open Finset namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (initial : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) end Full end Bounty end section /- Original physical path coefficients with actual initial state and no generic edge premise. -/ open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) variable (steps : List (Option (I ⊕ K))) (C₀ : Fin N → Finset (Fin J)) (L : PhysicalMarkLists P J ell) end Physical end Bounty end section /- Decoded original observations retain their physical permutation and auxiliary labels. -/ namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (before after : Fin N → Finset (Fin J)) (tag : Option (I ⊕ K)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) theorem physical_encoded_observation_permutation (htag : tag = none) (L R : PhysicalBoundedMarkState P J ell B) (hs : physicalBoundedMarkEncode before L = s) (ht : physicalBoundedMarkEncode after R = physicalFullLedgerEventTarget C k tag s e) : ∃ σ : PhysicalPermutations (Fin N) J ell, physicalFullEventObservation C k before after tag s e = .inl σ ∧ R.1 = physicalPermuteLabels σ L.1 := by subst tag exact ⟨_, rfl, physical_encoded_permutation_marks C k before after s e L R hs ht⟩ theorem physical_encoded_observation_ghost (j : I) (htag : tag = some (.inl j)) : physicalFullEventObservation C k before after tag s e = .inr none := by subst tag rfl theorem physical_encoded_observation_edge (j : K) (htag : tag = some (.inr j)) : ∃ a : PhysicalAuxLabels P (C j), physicalFullEventObservation C k before after tag s e = .inr (some ⟨j, a⟩) := by subst tag exact ⟨e.1, rfl⟩ theorem physical_encoded_ghost_mark_step (j : I) (htag : tag = some (.inl j)) (hcut : before = after) (L R : PhysicalBoundedMarkState P J ell B) (hs : physicalBoundedMarkEncode before L = s) (ht : physicalBoundedMarkEncode after R = physicalFullLedgerEventTarget C k tag s e) : R.1 = L.1 := by subst tag subst after exact physical_encoded_ghost_marks C k before j s e L R hs ht end Physical end Bounty end section /- The actual preliminary candidate mass on the common Mertens density scale. -/ open Finset Filter open scoped Topology namespace Bounty theorem exists_candidate_shifted_rough_mass_density_lower (hZ : PrimitiveZeroFreeHalfPlane) : ∃ K : ℝ, 0 < K ∧ ∀ (c q b : ℝ) (r h : ℕ), 0 < c → 0 < r → 0 ≤ q → q < 1 → (11/5 : ℝ)*(r : ℝ)*c = 1 → 0 < b → 1 ≤ h → Even h → b*(4*(h : ℝ)+2) < 1/2 → ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ((shiftedSieveRatioConstant*Mertens.primeProductLimitConstant/b)* (1-K*Real.exp (-(h : ℝ)))-ε) * candidateCoefficientWindowMass c L q r jStar / L ≤ candidateShiftedRoughMass c L q r jStar (Real.exp (b*L)) := by obtain ⟨K, hK, hmass⟩ := exists_candidate_shifted_rough_mass_estimate hZ refine ⟨K, hK, ?_⟩ intro c q b r h hc hr hq0 hq1 hcenter hb hh heven hlevel obtain ⟨J, hJ⟩ := hmass c q b r h hc hr hq0 hq1 hcenter hb hh heven hlevel refine ⟨J, ?_⟩ intro jStar hj ε hε have hpow : Tendsto (fun L : ℝ => L^(-16 : ℝ)) atTop (𝓝 0) := tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 16) have hlim := (exponential_shifted_prime_avoidance_product_tendsto hb).mul (hpow.const_sub (1-K*Real.exp (-(h : ℝ)))) simp only [sub_zero] at hlim have hev := hlim.eventually_const_lt (show (shiftedSieveRatioConstant*Mertens.primeProductLimitConstant/b)* (1-K*Real.exp (-(h : ℝ)))-ε < (shiftedSieveRatioConstant*Mertens.primeProductLimitConstant/b)* (1-K*Real.exp (-(h : ℝ))) by linarith) filter_upwards [hJ jStar hj, hev, eventually_gt_atTop (0 : ℝ)] with L hm hd hL have hXA : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro u _ exact candidate_coefficient_nonneg c L hq0 r jStar u have hlower : candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b*L)) * (1-K*Real.exp (-(h : ℝ))-L^(-16 : ℝ)) ≤ candidateShiftedRoughMass c L q r jStar (Real.exp (b*L)) := by have h := (neg_le_neg hm).trans (neg_abs_le _) nlinarith calc _ ≤ ((L*shiftedPrimeAvoidanceProduct (Real.exp (b*L)))* (1-K*Real.exp (-(h : ℝ))-L^(-16 : ℝ))) * candidateCoefficientWindowMass c L q r jStar / L := by exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hd.le hXA) hL.le _ = candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b*L)) * (1-K*Real.exp (-(h : ℝ))-L^(-16 : ℝ)) := by field_simp _ ≤ _ := hlower end Bounty end section /- The successor step for actual rough-number short-cell asymptotics. -/ namespace Bounty open Finset Filter Real open scoped Topology theorem uniform_rough_depth_approx_succ_of_prime_error {n : ℕ} {S : ℝ} (hS : 0 ≤ S) (hprev : UniformRoughDepthApprox n S) (hprime : ∀ a ε : ℝ, 0 < a → 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ w : ℝ, a ≤ w → |normalizedPrimeCellCount L S (exp (w*L))-1/w| ≤ ε) : UniformRoughDepthApprox (n+1) S := by intro a b γ₀ gap ha hγ₀ hgap ε hε by_cases hγb : γ₀ < b · have hεq : 0 < ε/4 := by positivity filter_upwards [eventually_gt_atTop (0 : ℝ), uniform_rough_depth_cofactor_sum_error hS hprev ha hγ₀ hγb hεq, buchstab_depth_prime_kernel_uniform_error n ha hγ₀ hγb hεq, eventually_normalized_buchstab_cell_error ha hγ₀ hS 1, hprime a (ε/4) ha hεq, eventually_logarithmic_cell_width_div_le (S := 0) (by norm_num) hεq] with L hL hcofactor hkernel hrec hprimeL hsmall intro w γ haw hwb hγ hgapw htop have hγw : γ ≤ w := by linarith have htop' : w+L^(-S)/L ≤ ((n : ℝ)+3)*γ := by simpa only [Nat.cast_add, Nat.cast_one, show (n : ℝ)+1+2 = (n : ℝ)+3 by ring] using htop have hc := hcofactor w γ haw hwb hγ hγw htop' have hk := hkernel w γ haw hwb hγ hγw have hp := hprimeL w haw have hr := hrec γ hγ (exp (w*L)) (exp_le_exp.mpr (mul_le_mul_of_nonneg_right haw hL.le)) (exp_le_exp.mpr (mul_le_mul_of_nonneg_right hγw hL.le)) have hs : L^(-(1 : ℝ)) ≤ ε/4 := by simpa only [neg_zero, rpow_zero, rpow_neg_one, one_div] using hsmall have hrhi := hr.2.trans hs have hcl := (abs_le.mp hc).1 have hcu := (abs_le.mp hc).2 have hkl := (abs_lt.mp hk).1 have hku := (abs_lt.mp hk).2 have hpl := (abs_le.mp hp).1 have hpu := (abs_le.mp hp).2 apply abs_le.mpr constructor <;> linarith [hr.1] · filter_upwards [] with L intro w γ haw hwb hγ hgapw htop exfalso exact hγb (by linarith) end Bounty /- Public declaration closure audit. -/ end section open Finset Filter open scoped Topology namespace Bounty noncomputable def candidatePrimeBandRoughMass (c L q : ℝ) (r jStar : ℕ) (A B z : ℝ) : ℝ := by classical exact ∑ p ∈ primeBand A B, ∑ u ∈ (shiftedRoughSet (arithmeticProductWindow 1 (Real.exp L)) z).filter (fun u => p ∣ 2*u+1), candidateCoefficient c L q r jStar u theorem shifted_rough_prime_filter_eq (T : Finset ℕ) {z : ℝ} (hz : 0 ≤ z) (p : ℕ) : (shiftedRoughSet T z).filter (fun u => p ∣ 2*u+1) = T.filter (fun u => p ∣ 2*u+1 ∧ ∀ q ∈ (primeBand 0 z).erase 2, ¬q ∣ 2*u+1) := by classical ext u simp only [mem_filter, mem_shifted_rough_set_iff] rw [two_mul_add_one_odd_prime_avoidance_iff_rough u hz] tauto end Bounty end section /- Norm form of the actual mixed dirty estimate. The omission gain is square-rooted only after the genuine weighted energy bound is established. -/ open Finset Filter open scoped Classical Topology namespace Bounty end Bounty end section /- Actual fixed-skeleton ghost stages pay exactly their original selected-child atom costs. -/ open Finset Classical namespace Bounty section Ghost variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (j : J) (htag : steps.get u = some (.inl j)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedBirthAddress S B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) (μ : ∀ g, P g → ℝ) (q ρ v : ℝ) (V η : Fin N → ℝ) end Ghost end Bounty end section /- Actual fixed-skeleton full-edge stages pay exactly their original selected-child atom costs. -/ open Finset Classical namespace Bounty section Edge variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (k : K) (htag : steps.get u = some (.inr k)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedBirthAddress S B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) [∀ c, Fintype (A k c)] (ω : ∀ c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) end Edge end Bounty end section /- Exact original event rows with the chronological owner indicator. -/ open Finset Classical namespace Bounty section Reindex variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedBirthAddress S B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Reindex end Bounty end section /- The exact selected-child exponents on the original chronological schedule. -/ open Finset Classical namespace Bounty theorem finite_prod_pow_le_common_power {I : Type*} [Fintype I] (a : I → ℝ) (d : I → ℕ) (β : ℝ) (ha : ∀ i, 0 ≤ a i) (hab : ∀ i, a i ≤ β) : (∏ i, a i ^ d i) ≤ β ^ (∑ i, d i) := by rw [← prod_pow_eq_pow_sum] exact prod_le_prod₀ (s := univ) (fun i _ => pow_nonneg (ha i) _) (fun i _ => pow_le_pow_left₀ (ha i) (hab i) _) section Factor variable {J K : Type*} {N : ℕ} {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) variable {P : Fin N → Type*} [∀ g, Fintype (P g)] (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V : Fin N → ℝ) (T : ℕ) (β : ℝ) end Factor end Bounty end section /- The actual mixed target translates small residues by the original full displacement. -/ open scoped Classical namespace Bounty section Translation variable {G H : Type*} [Fintype G] [Fintype H] {P : G → Finset ℕ} {J ell B : ℕ} (small : G → Prop) (e : {g : G // ¬small g} ≃ H) (C : G → Finset (Fin J)) (hC : ∀ g, small g → C g = ∅) (aux : PhysicalAuxLabels P C) (L : PhysicalMarkLists P J ell) {Z : H → Type*} (q : ∀ h, BoundedOrderedTuple (Z h) B) (k : ℤ) (r : PhysicalResidues (fun g : {g // small g} => P g.val)) end Translation end Bounty end section /- Independent auxiliary subprobability averaging of the actual candidate mixed dirty operator. Both small-slot projections and all event masks remain literal, with no per-auxiliary norm hypothesis in the conclusion. -/ open Finset Filter open scoped Classical Topology namespace Bounty end Bounty end section /- The actual mixed clean event row, with total dilation phase and original small-residue translation, conjugates to the literal canonical clean action. The initial ledger is fixed, and only actual fresh births are tested. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalMixedCleanInitialAction {S G : Type*} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (y : CleanFullMemoryState P J ell B) (rs : PhysicalResidues Ps) : ℂ := let τ := fullActivePermutation (cleanPhysicalSlotChange C) let source := (cleanFullMemoryEquiv P J ell B (τ.symm y)).2.2.1 let Sp := fun g => physicalFullSharedIndices (ell := ell) (C g) let cp := (productActiveMemorySplit Sp B y).1 let sp := (productActiveMemorySplit Sp B y).2 ∑ e : FullActiveEdgeEvent (fun g (p : P g) => p.val) Sp B (fun _ => PhysicalAuxLabels P C) (physicalMixedEdgeDelta C k d) (physicalMixedEdgeD C d) y, (fullActiveEdgeEventWeight (fun g (p : P g) => p.val) Sp B (fun _ => PhysicalAuxLabels P C) (physicalMixedEdgeDelta C k d) (physicalMixedEdgeD C d) (fun _ aux => physicalAuxMass V C aux) (fun g => tiltedPhysicalBirthLaw V g (b g)) ρ V y e : ℂ) * (if (∀ g, (e.2 g).1 = ∅ ∧ (e.2 g).2.1 = ∅) ∧ (∀ g i, (e.2 g).2.2.2 i ∉ initial g) then let fresh := physicalCleanFreshEquiv (fun g => ↥(P g)) C (fun g => (unrestrictedJointEventTarget (fun g (p : P g) => p.val) (physicalMixedEdgeDelta C k d cp e.1) (physicalMixedEdgeD C d cp e.1) (fun g => (Sp g)ᶜ.card) B sp e.2 g).1) let target := repeatedBigFill C source (cleanFullFreshEquiv P C fresh) if repeatedBigAuxAvoids C e.1 source ∧ repeatedBigAuxAvoids C e.1 target then K source target e.1 * physicalPhase ζ (physicalMixedSharedD C d cp e.1) * physicalReturnPhase θ (physicalMixedBigStep C k cp e.1 * (physicalSharedProduct d : ℕ)) else 0 else 0) * f (fullActiveEdgeEventTarget (fun g (p : P g) => p.val) Sp B (fun _ => PhysicalAuxLabels P C) (physicalMixedEdgeDelta C k d) (physicalMixedEdgeD C d) y e) (physicalTranslateResidues rs (physicalMixedBigStep C k cp e.1 * (physicalSharedProduct d : ℕ))) theorem physical_mixed_clean_total_phase {S G : Type*} [Fintype S] [Fintype G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (d : PhysicalSharedLists Ps J) (x : ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) (aux : PhysicalAuxLabels P C) (ζ : ℝ) (hPs : ∀ s p, p ∈ Ps s → 0 < p) (hP : ∀ g p, p ∈ P g → 0 < p) : physicalPhase ζ (physicalMixedSharedD C d (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (fullActivePermutation (cleanPhysicalSlotChange C) x)).1 aux) = physicalPhase ζ (cleanFullSharedD C (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 aux) * physicalPhase ζ (physicalSharedProduct d) := by unfold physicalMixedSharedD rw [clean_physical_shared_D_reencode] have hb : 0 < cleanFullSharedD C (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 aux := by unfold cleanFullSharedD exact prod_pos fun g _ => mul_pos (prod_pos fun j _ => hP g _ ((productActiveMemorySplit (cleanFullSharedSlots C) B x).1 g j).property) (prod_pos fun j _ => hP g _ (aux g j).property) rw [physical_phase_mul ζ (clean_hybrid_shared_product_pos d hPs) hb, mul_comm] theorem physical_mixed_clean_initial_action_reencode {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) (hPs : ∀ s p, p ∈ Ps s → 0 < p) (hP : ∀ g p, p ∈ P g → 0 < p) (x : CleanFullMemoryState P J ell B) (rs : PhysicalResidues Ps) : physicalMixedCleanInitialAction initial V b C ζ θ ρ k K d (fun y r => f ((fullActivePermutation (cleanPhysicalSlotChange C)).symm y) r) (fullActivePermutation (cleanPhysicalSlotChange C) x) rs = cleanFullMemoryInitialEventAction initial V b C ζ θ ρ k (canonicalMixedEdgeD C d) K d f x rs := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) let c := (productActiveMemorySplit (cleanFullSharedSlots C) B x).1 let source := (cleanFullMemoryEquiv P J ell B x).2.2.1 let Θ := fun (a : PhysicalAuxLabels P C) (fresh : ∀ g, Fin (cleanFullSharedSlots (ell := ell) C g)ᶜ.card → P g) => if repeatedBigAuxAvoids C a source ∧ repeatedBigAuxAvoids C a (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) then K source (repeatedBigFill C source (cleanFullFreshEquiv P C fresh)) a * physicalPhase ζ (cleanFullSharedD C c a) * physicalReturnPhase θ (cleanFullSharedStep k C c a d) * physicalPhase ζ (physicalSharedProduct d) else 0 have h := physical_mixed_clean_initial_sum_reencode initial C k d (physicalAuxMass V C) (fun g => tiltedPhysicalBirthLaw V g (b g)) ρ V Θ (fun a z => f z (physicalTranslateResidues rs (cleanFullSharedStep k C c a d))) (fun a => hf _) x dsimp only at h refine Eq.trans ?_ (h.trans ?_) · dsimp only [physicalMixedCleanInitialAction] apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ rw [physical_mixed_clean_step_reencode C d x e.1 k] congr 1 congr 1 dsimp only [Θ, source, c] have hx : (fullActivePermutation (cleanPhysicalSlotChange C)).symm (fullActivePermutation (cleanPhysicalSlotChange C) x) = x := Equiv.symm_apply_apply _ _ have hsrc := congrArg (fun z : CleanFullMemoryState P J ell B => (cleanFullMemoryEquiv P J ell B z).2.2.1) hx rw [hsrc] split_ifs · rw [physical_mixed_clean_total_phase C d x e.1 ζ hPs hP] ring all_goals rfl · unfold cleanFullMemoryInitialEventAction apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ rfl end Bounty end section /- The full normalized candidate compact-allocation sum as a retained-factor integral. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- Character separation with real smooth cutoffs and no recovered quotient guards. -/ open Finset open scoped ComplexConjugate namespace Bounty theorem typeII_smooth_determinant_character_sum (E N M H Z : Finset ℕ) (k : ℤ) [NeZero (2 * k.natAbs)] (η : ℝ → ℝ → ℝ) (α aH : ℕ → ℂ) {W : ℝ} (hW : 2 ≤ W) (hM : ∀ m ∈ M, 0 < m) (hrough : ∀ m ∈ M, ∀ p ∈ m.primeFactors, W < (p : ℝ)) (hsmall : (k.natAbs : ℝ) ≤ W) (hpos : ∀ e n, η e n ≠ 0 → 0 < e) (hmem : ∀ e n : ℕ, η e n ≠ 0 → e ∈ E ∧ n ∈ N) : (∑ y ∈ typeIIDeterminantDomain E N M H {k} Z, typeIIShiftComplexWeight (fun e n => η e n) α aH y) = (1 / ((2 * k.natAbs).totient : ℂ)) * ∑ χ : DirichletCharacter ℂ (2 * k.natAbs), ∑ y ∈ typeIICrossSlice M H Z k, typeIIRealShiftWeight η α aH y * χ (y.2.1.1 : ZMod (2 * k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2 * k.natAbs))) := by classical have hk : k ≠ 0 := by intro hk have hne := NeZero.ne (2 * k.natAbs) simp [hk] at hne have habs : (k.natAbs : ℝ) = |(k : ℝ)| := by simpa only [Int.cast_abs, Int.cast_natCast] using congrArg (fun z : ℤ => (z : ℝ)) (Int.natCast_natAbs k) have hs : (∑ y ∈ typeIIDeterminantDomain E N M H {k} Z, typeIIShiftComplexWeight (fun e n => η e n) α aH y) = ∑ y ∈ (typeIICrossSlice M H Z k).filter (fun y => Nat.ModEq (2 * k.natAbs) y.2.1.1 y.2.2.1), typeIIRealShiftWeight η α aH y := by unfold typeIIDeterminantDomain typeIICrossSlice rw [filter_filter] simp only [sum_filter] apply sum_congr rfl intro y hy obtain ⟨hkz, hvw⟩ := mem_product.mp hy have hyk : y.1.1 = k := mem_singleton.mp (mem_product.mp hkz).1 obtain ⟨hv, hw⟩ := mem_product.mp hvw have hp := typeII_smooth_shift_pointwise E N η α aH (hM _ (mem_product.mp hw).1) (hrough _ (mem_product.mp hv).1) (show |(y.1.1 : ℝ)| ≤ W by simpa only [hyk, ← habs] using hsmall) hpos hmem simpa only [hyk] using hp rw [hs] apply typeII_congruence_character_sum intro y hy have hrange := (mem_filter.mp hy).1 have hm := (mem_product.mp (mem_product.mp (mem_product.mp hrange).2).2).1 exact typeII_rough_coprime_twice_natAbs (hM _ hm) hk hW (hrough _ hm) hsmall section variable {L E V e n : ℝ} (hL : 0 < L) (hE : 0 < E) (hV : 0 < V) (hne : typeIIEMajorant (L ^ 88) (e / E) * typeIINMajorant (n / V) ≠ 0) include L E V e n hL hE hV hne theorem typeII_majorant_real_support : 0 < e ∧ e < 2 * E ∧ n < 3 * V := by have he := typeII_e_majorant_normalized_support hL (left_ne_zero_of_mul hne) have hn := typeII_n_majorant_normalized_support (right_ne_zero_of_mul hne) have hlo : 0 < e / E := lt_trans (by positivity) he.1 exact ⟨(div_pos_iff_of_pos_right hE).mp hlo, (div_lt_iff₀ hE).mp he.2, (div_lt_iff₀ hV).mp hn.2⟩ theorem typeII_majorant_real_box : E / (2 * L ^ 88) < e ∧ e < 2 * E ∧ V / 2 < n ∧ n < 3 * V := by have he := typeII_e_majorant_normalized_support hL (left_ne_zero_of_mul hne) have hn := typeII_n_majorant_normalized_support (right_ne_zero_of_mul hne) refine ⟨?_, (div_lt_iff₀ hE).mp he.2, ?_, (div_lt_iff₀ hV).mp hn.2⟩ · have hh := (lt_div_iff₀ hE).mp he.1 calc E / (2 * L ^ 88) = ((L ^ 88)⁻¹ / 2) * E := by ring _ < e := hh · have hh := (lt_div_iff₀ hV).mp hn.1 calc V / 2 = (1 / 2 : ℝ) * V := by ring _ < n := hh end theorem typeII_majorant_integer_support {L E V : ℝ} (hL : 0 < L) (hE : 0 < E) (hV : 0 < V) (e n : ℕ) (hne : typeIIEMajorant (L ^ 88) ((e : ℝ) / E) * typeIINMajorant ((n : ℝ) / V) ≠ 0) : e ∈ Icc ⌈E / (2 * L ^ 88)⌉₊ ⌊2 * E⌋₊ ∧ n ∈ Icc ⌈V / 2⌉₊ ⌊3 * V⌋₊ := by have hs := typeII_majorant_real_box hL hE hV hne exact ⟨mem_Icc.mpr ⟨Nat.ceil_le.mpr hs.1.le, Nat.le_floor hs.2.1.le⟩, mem_Icc.mpr ⟨Nat.ceil_le.mpr hs.2.2.1.le, Nat.le_floor hs.2.2.2.le⟩⟩ end Bounty end section /- Both cross-products are positive on rough nontrivial factor supports. -/ namespace Bounty end Bounty end section /- Direct original-candidate to full box-allocation reduction, with rough support. -/ open Finset Filter Real namespace Bounty theorem exists_candidate_original_box_reduction {c b q : ℝ} (hc : 0 < c) (hb : 0 < b) (hq0 : 0 ≤ q) (hq1 : q < 1) {r : ℕ} (hr : 6 ≤ r) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ A D : ℝ, ∀ᶠ L : ℝ in atTop, ∀ (E : ℝ) (F : ℕ → ℕ → ℂ), 1 ≤ E → log E ≤ (1-b)*L → (∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → (∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ¬(∀ p ∈ m.primeFactors, exp (sqrt L) ≤ (p : ℝ)) → F u m = 0) → ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCoefficient c L q r jStar u : ℂ)*∑ m ∈ (2*u+1).divisors, F u m) - ∑ u ∈ arithmeticProductWindow 1 (exp L), candidateBoxRangeCoefficient c L q r jStar E L u*∑ m ∈ (2*u+1).divisors, F u m‖ ≤ exp L*L^(-D) := by obtain ⟨J,hJ⟩ := exists_candidate_compact_divisor_test_reduction hc hb hq0 hq1 hr refine ⟨J,fun jStar hj A D => ?_⟩ filter_upwards [hJ jStar hj A (D+1), eventually_candidate_allocation_box_error hc (show 0 < r by omega) hq0 hq1 A (D+1), eventually_ge_atTop (2 : ℝ)] with L hcompact hbox hL intro E F hE hlogE hF hsupp have hL0 : 0 < L := by linarith let middle : ℂ := ∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCompactRangeCoefficient c L q r jStar E u : ℂ)*∑ m ∈ (2*u+1).divisors, F u m calc _ ≤ ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCoefficient c L q r jStar u : ℂ)*∑ m ∈ (2*u+1).divisors, F u m)-middle‖ + ‖middle-(∑ u ∈ arithmeticProductWindow 1 (exp L), candidateBoxRangeCoefficient c L q r jStar E L u*∑ m ∈ (2*u+1).divisors, F u m)‖ := norm_sub_le_norm_sub_add_norm_sub _ middle _ _ ≤ exp L*L^(-(D+1))+exp L*L^(-(D+1)) := add_le_add (hcompact E F hE hlogE hF hsupp) (hbox jStar E F hF) _ = (2/L)*(exp L*L^(-D)) := by rw [show -(D+1) = -D+(-1) by ring, rpow_add hL0, rpow_neg_one] ring _ ≤ exp L*L^(-D) := mul_le_of_le_one_left (by positivity) ((div_le_one hL0).mpr hL) end Bounty end section /- Exact finite cross-slice reindexing with the signed second endpoint preserved. -/ open Finset open scoped ComplexConjugate namespace Bounty theorem typeII_cross_slice_sum_reindex (M H Z : Finset ℕ) (k : ℤ) (W : TypeIIShiftIndex → ℂ) (hM : ∀ m ∈ M, 0 < m) (hk : k ≠ 0) : (∑ y ∈ typeIICrossSlice M H Z k, W y) = ∑ z ∈ Z, ∑ m ∈ M, ∑ h' ∈ H, ∑ m' ∈ M, ∑ h ∈ H, if m'*h=z ∧ (z : ℤ)+k=(m : ℤ)*h' then W ((k,z),((m,h),(m',h'))) else 0 := by classical simp only [typeIICrossSlice, sum_filter, sum_product, sum_singleton] apply sum_congr rfl intro z hz apply sum_congr rfl intro m hm simp only [TypeIICrossConditions, hM m hm, true_and] rw [sum_comm] calc _ = ∑ m' ∈ M, ∑ h' ∈ H, ∑ h ∈ H, if z=m'*h ∧ (z : ℤ)+k=(m : ℤ)*h' then W ((k,z),((m,h),(m',h'))) else 0 := by apply sum_congr rfl intro m' hm' rw [sum_comm] apply sum_congr rfl intro h' hh' apply sum_congr rfl intro h hh by_cases hcross : z=m'*h ∧ (z : ℤ)+k=(m : ℤ)*h' · rw [if_pos ⟨hk, hcross⟩, if_pos hcross] · rw [if_neg (fun hc => hcross hc.2), if_neg hcross] _ = _ := by rw [sum_comm] apply sum_congr rfl intro h' hh' apply sum_congr rfl intro m' hm' apply sum_congr rfl intro h hh simp only [eq_comm (a := z) (b := m'*h)] theorem typeII_cross_slice_singleton_eq_cross_pair_coefficient (M H : Finset ℕ) (k : ℤ) (z w : ℕ) (A : ℕ → ℂ) (W : ℕ → ℝ) (B : ℕ → ℂ) (ρ ξ₁ ξ₂ ξ₃ : ℝ) (hM : ∀ m ∈ M, 0 < m) (hk : k ≠ 0) (hzw : (z : ℤ)+k=(w : ℤ)) : (∑ y ∈ typeIICrossSlice M H {z} k, A y.2.1.1 * conj (A y.2.2.1) * typeIISeparatedH W B ρ y.2.1.2 * conj (typeIISeparatedH W B ρ y.2.2.2) * typeIIPhase ξ₁ y.2.1.1 * typeIIPhase ξ₂ y.2.2.1 * typeIIPhase ξ₃ y.1.2) = typeIICrossPairCoefficient M H A W B ρ ξ₁ ξ₂ ξ₃ z w := by classical rw [typeII_cross_slice_sum_reindex M H {z} k _ hM hk, sum_singleton] unfold typeIICrossPairCoefficient apply sum_congr rfl intro m hm apply sum_congr rfl intro h' hh' apply sum_congr rfl intro m' hm' apply sum_congr rfl intro h hh have hcross : ((z : ℤ)+k=(m : ℤ)*h') ↔ m*h'=w := by rw [hzw] constructor <;> intro heq <;> exact_mod_cast heq.symm simp only [hcross] end Bounty end section /- Apply the proved Mellin cutoff to the actual candidate test on its coarse finite support. -/ open Finset Filter MeasureTheory Real namespace Bounty end Bounty end section /- Exact full-P expansion of the actual box coefficient. -/ open Finset Filter namespace Bounty theorem eventually_candidate_box_finite_convolution {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (E R X : ℝ) (U₀ : Finset ℕ) (F : ℕ → ℂ), (∀ u ∈ U₀, 0 < u ∧ (u : ℝ) ≤ X) → (∑ u ∈ U₀, candidateBoxRangeCoefficient c L q r jStar E R u*F u) = ∑ p ∈ candidateSmallPSet c L (X+1), (candidatePWeight c L q p : ℂ)* ∑ n ∈ orderedSlotProductSupport (candidateQSlotChoices c L r jStar), candidateBoxRangeQWeight c L r jStar E R n* (if p*n ∈ U₀ then F (p*n) else 0) := by classical filter_upwards [eventually_candidate_P_pool_below_rough_cutoff hc, eventually_ge_atTop (0 : ℝ)] with L hpool hL intro q r jStar E R X U₀ F hU₀ let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let S := candidateSmallPSet c L (X+1) let B := orderedSlotProductSupport (candidateQSlotChoices c L r jStar) let U := U₀ let T := (S ×ˢ B).image (fun z => z.1*z.2) have hS : ∀ p ∈ S, p ∈ Nat.factoredNumbers P := fun p hp => ((mem_candidateSmallPSet_iff c L _ p).mp hp).2 have hB : ∀ n ∈ B, n ≠ 0 ∧ Disjoint n.primeFactors P := by intro n hn obtain ⟨x,hx,rfl⟩ := mem_image.mp hn exact ⟨prod_ne_zero_iff.mpr (fun slot _ => candidate_Q_slot_nonzero c L r jStar slot (x slot).property), candidate_Q_tuple_primeFactors_disjoint (mul_nonneg hc.le hL) hpool x⟩ have hreindex := supported_free_complex_product_reindex P S B hS hB (fun p => (candidatePWeight c L q p : ℂ)) (candidateBoxRangeQWeight c L r jStar E R) (fun u => if u ∈ U then F u else 0) symm calc _ = ∑ u ∈ T, (candidatePWeight c L q (primePoolPart P u) : ℂ)* candidateBoxRangeQWeight c L r jStar E R (primePoolFreePart P u)* (if u ∈ U then F u else 0) := by simp_rw [mul_sum, ← mul_assoc] exact hreindex _ = ∑ u ∈ T, candidateBoxRangeCoefficient c L q r jStar E R u* (if u ∈ U then F u else 0) := by apply sum_congr rfl intro u hu obtain ⟨pn,hpn,rfl⟩ := mem_image.mp hu obtain ⟨hp,hn⟩ := mem_product.mp hpn obtain ⟨hn0,hnfree⟩ := hB pn.2 hn have hp0 := Nat.ne_zero_of_mem_factoredNumbers (hS pn.1 hp) rw [primePoolPart_mul_of_free (hS _ hp) hn0 hnfree, primePoolFreePart_mul_of_free (hS _ hp) hn0 hnfree] unfold candidateBoxRangeCoefficient rw [candidate_marked_weight_mul_of_free c L q hn0 hnfree pn.1, primePoolFreePart_mul_of_free (hS _ hp) hn0 hnfree, candidate_P_weight_eq_marked c L q hp0] ring _ = ∑ u ∈ T.filter (fun u => u ∈ U), candidateBoxRangeCoefficient c L q r jStar E R u*F u := by rw [sum_filter] simp only [mul_ite, mul_zero] _ = ∑ u ∈ U.filter (fun u => u ∈ T), candidateBoxRangeCoefficient c L q r jStar E R u*F u := by congr 1 ext u simp only [mem_filter, and_comm] _ = _ := by rw [sum_filter] apply sum_congr rfl intro u hu by_cases ht : u ∈ T · simp only [ht, if_true] · simp only [ht, if_false] have hnot : primePoolFreePart P u ∉ B := by intro hn have hurange := hU₀ u hu have hu0 : u ≠ 0 := (hurange.1).ne' have hpu : (primePoolPart P u : ℝ) ≤ (u : ℝ) := by exact_mod_cast Nat.le_of_dvd (Nat.pos_of_ne_zero hu0) (primePoolPart_dvd P u) have hp : primePoolPart P u ∈ S := by apply (mem_candidateSmallPSet_iff c L _ _).mpr exact ⟨by linarith [hurange.2],primePoolPart_mem_factoredNumbers P u⟩ exact ht (mem_image.mpr ⟨(primePoolPart P u,primePoolFreePart P u), mem_product.mpr ⟨hp,hn⟩,primePoolPart_mul_primePoolFreePart P u⟩) have hz := candidate_box_Q_support c L r jStar E R (primePoolFreePart P u) hnot change 0 = candidateBoxRangeQWeight c L r jStar E R (primePoolFreePart P u) * _ * _ rw [hz, zero_mul, zero_mul] end Bounty end section /- The common-address forest leaves exactly the original weight and local residual phases outside its constraints. -/ namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedCommonResidualWeight (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) : ℂ := (finiteEventPathWeight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps x p : ℂ) * finiteEventLocalPhase (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedBirthResidualPhase n S B A Δ D edgePhase) steps x p end Full end Bounty end section /- Uniform polynomial cost of the actual diagonal cutoff moment. -/ open Finset Filter Real namespace Bounty theorem eventually_typeII_diagonal_moment_cost {C : ℝ} (hC : 0 ≤ C) : ∀ᶠ L : ℝ in atTop, ∀ X : ℝ, 1 ≤ X → log X ≤ C*L → 2*(⌊6*X⌋₊ : ℝ)*(1+log (⌊6*X⌋₊ : ℝ))^15 ≤ X*L^(16 : ℝ) := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (12*(1+C+log 6)^15 : ℝ)] with L hL hK intro X hX hlogX have hX0 : 0 < X := by linarith have hNpos : (0 : ℝ) < ⌊6*X⌋₊ := by exact_mod_cast (Nat.floor_pos.mpr (show 1 ≤ 6*X by linarith)) have hNle : (⌊6*X⌋₊ : ℝ) ≤ 6*X := Nat.floor_le (by positivity) have h6 : 0 ≤ log 6 := log_nonneg (by norm_num) have hlog : 1+log (⌊6*X⌋₊ : ℝ) ≤ (1+C+log 6)*L := by have hh := log_le_log hNpos hNle rw [log_mul (by norm_num : (6 : ℝ) ≠ 0) hX0.ne'] at hh nlinarith calc _ ≤ (12*X)*((1+C+log 6)*L)^15 := mul_le_mul (by linarith) (pow_le_pow_left₀ (by positivity) hlog 15) (by positivity) (by positivity) _ = (12*(1+C+log 6)^15)*X*L^15 := by rw [mul_pow]; ring _ ≤ L*X*L^15 := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hK hX0.le) (pow_nonneg (by linarith) _) _ = X*L^(16 : ℝ) := by norm_num only [rpow_ofNat]; ring end Bounty end section /- Apply the proved Mellin cutoff to the actual candidate test on its coarse finite support. -/ open Finset Filter MeasureTheory Real namespace Bounty noncomputable def candidateFiniteMellinIntegrand (c L q : ℝ) (r jStar : ℕ) (E B : ℝ) (S : Finset ℕ) (F : ℕ → ℕ → ℂ) (ξ : ℝ) : ℂ := finiteWindowMellinIntegrand L B (S) (candidateBoxRangeCoefficient c L q r jStar E L) (fun u => ∑ m ∈ (2*u+1).divisors, F u m) ξ theorem candidate_finite_mellin_integrable (c L q : ℝ) (r jStar : ℕ) (E B : ℝ) (S : Finset ℕ) (F : ℕ → ℕ → ℂ) (hS : ∀ u ∈ S, 0 < u) : Integrable (candidateFiniteMellinIntegrand c L q r jStar E B S F) := by apply finite_window_mellin_integrable intro u hu exact hS u hu theorem exists_candidate_finite_smooth_mellin_bound {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (R : ℝ) (hR : 1 ≤ R) (B : ℝ) (hB : 0 ≤ B) (A D : ℝ) : ∃ K : ℝ, 0 < K ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (E : ℝ) (S : Finset ℕ) (F : ℕ → ℕ → ℂ), (∀ u ∈ S, 0 < u ∧ (u : ℝ) ≤ R*exp L) → (∀ u ∈ S, ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → ‖(∑ u ∈ S, candidateBoxRangeCoefficient c L q r jStar E L u * (typeIIWindowSmooth (L^(-B)) ((u:ℝ)/exp L) : ℂ) * (∑ m ∈ (2*u+1).divisors, F u m)) - (∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ L^K}, candidateFiniteMellinIntegrand c L q r jStar E B S F ξ)‖ ≤ exp L * L^(-D) := by obtain ⟨C, hC, hmass⟩ := exists_candidate_finite_test_absolute_bound hc hr hq0 hq1 R hR A let precision := C+max D 0+1 have hprecision : 0 ≤ precision := by dsimp [precision]; positivity obtain ⟨K, hK, hcut⟩ := typeII_window_mellin_power_cutoff hB hprecision refine ⟨K, hK, ?_⟩ filter_upwards [hmass, hcut, eventually_candidate_box_norm_bound hc r, eventually_ge_atTop (2 : ℝ)] with L hmassL hcutL hnorm hL intro jStar E S F hS hF have hL0 : 0 < L := by linarith have hfinite := finite_window_mellin_error_le L B (S) (candidateBoxRangeCoefficient c L q r jStar E L) (fun u => ∑ m ∈ (2*u+1).divisors, F u m) (fun u => (typeIIWindowSmooth (L^(-B)) ((u:ℝ)/exp L) : ℂ)) (fun u hu => (hS u hu).1) {ξ : ℝ | ‖ξ‖ ≤ L^K} (L^(-precision)) (by intro u hu have hup : (0 : ℝ) < u := by exact_mod_cast (hS u hu).1 simpa only [mul_one, Complex.ofReal_natCast, Complex.ofReal_one, Complex.one_cpow, candidateWindowMellinKernel] using hcutL (u:ℝ) 1 (exp L) hup (by norm_num) (exp_pos L)) change ‖(∑ u ∈ S, _ ) - (∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ L^K}, candidateFiniteMellinIntegrand c L q r jStar E B S F ξ)‖ ≤ _ at hfinite have hweights : (∑ u ∈ S, ‖candidateBoxRangeCoefficient c L q r jStar E L u‖ * ‖∑ m ∈ (2*u+1).divisors, F u m‖) ≤ 2*(exp L * L^C) := by calc _ ≤ ∑ u ∈ S, 2*(candidateCoefficient c L q r jStar u * ∑ m ∈ (2*u+1).divisors, ‖F u m‖) := by apply sum_le_sum intro u hu have hh := mul_le_mul (hnorm q hq0 jStar E u) (norm_sum_le (2*u+1).divisors (fun m => F u m)) (norm_nonneg (∑ m ∈ (2*u+1).divisors, F u m)) (mul_nonneg (by norm_num) (candidate_coefficient_nonneg c L hq0 r jStar u)) simpa only [mul_assoc] using hh _ = 2*(∑ u ∈ S, candidateCoefficient c L q r jStar u * ∑ m ∈ (2*u+1).divisors, ‖F u m‖) := (mul_sum ..).symm _ ≤ _ := mul_le_mul_of_nonneg_left (hmassL jStar S F hS hF) (by norm_num) apply hfinite.trans calc _ ≤ L^(-precision)*(2*(exp L*L^C)) := mul_le_mul_of_nonneg_left hweights (rpow_nonneg hL0.le _) _ ≤ L^(-precision)*(L*(exp L*L^C)) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hL (by positivity)) (by positivity) _ = exp L*(L^(-precision)*(L^(1:ℝ)*L^C)) := by rw [rpow_one]; ring _ = exp L*L^(-max D 0) := by rw [← rpow_add hL0, ← rpow_add hL0] congr 2 dsimp [precision] ring _ ≤ exp L*L^(-D) := mul_le_mul_of_nonneg_left (rpow_le_rpow_of_exponent_le (by linarith) (neg_le_neg (le_max_left _ _))) (exp_pos _).le end Bounty end section /- Order the actual independent samples by their common global addresses, retaining their original owner and group. -/ namespace Bounty section Ghost variable {J K : Type*} {N : ℕ} {P Z : Fin N → Type*} {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (j : J) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (htag : steps.get u = some (.inl j)) (s : ProductBoundedOrderedState P Z M B) (sk : CoupledGhostSkeleton M B s) noncomputable def fullMixedCommonGhostSampleEmbedding : CoupledGhostSampleIndex M B s sk ↪ Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) := (fullMixedGhostOwnerSampleEmbedding S B j steps u htag s sk).trans (fullMixedCommonOldIndexEmbedding S B steps) noncomputable def fullMixedCommonGhostSampleOrder : Fin (Fintype.card (CoupledGhostSampleIndex M B s sk)) ≃ CoupledGhostSampleIndex M B s sk := finiteEmbeddedOrder (fullMixedCommonGhostSampleEmbedding S B j steps u htag s sk) theorem full_mixed_common_ghost_sample_strictMono : StrictMono (fun i => fullMixedCommonGhostSampleEmbedding S B j steps u htag s sk (fullMixedCommonGhostSampleOrder S B j steps u htag s sk i)) := finite_embedded_order_strictMono _ theorem full_mixed_common_ghost_sample_owner (i : CoupledGhostSampleIndex M B s sk) : fullMixedCommonIndexStage M B steps (fullMixedCommonGhostSampleEmbedding S B j steps u htag s sk i) = u.succ := by change fullMixedCommonIndexStage M B steps (fullMixedCommonOldIndexEmbedding S B steps (fullMixedGhostOwnerSampleEmbedding S B j steps u htag s sk i)) = _ rw [full_mixed_common_old_index_stage, full_mixed_ghost_owner_sample_owner] theorem full_mixed_common_ghost_sample_group (i : CoupledGhostSampleIndex M B s sk) : fullMixedCommonBirthGroup M B steps (fullMixedCommonBirthOrder M B steps (fullMixedCommonGhostSampleEmbedding S B j steps u htag s sk i)) = i.1 := by change fullMixedCommonBirthGroup M B steps (fullMixedCommonBirthOrder M B steps (fullMixedCommonOldIndexEmbedding S B steps (fullMixedGhostOwnerSampleEmbedding S B j steps u htag s sk i))) = _ rw [full_mixed_common_old_index_group, full_mixed_ghost_owner_sample_group] end Ghost section Edge variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (k : K) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (htag : steps.get u = some (.inr k)) (A : SharedActiveLabels P (S k) → Type*) (Δ D : ∀ c, A c → Fin N → ℤ) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (sk : FullActiveEdgeSkeleton n (S k) B A Δ D s) noncomputable def fullMixedCommonEdgeSampleEmbedding : FullActiveEdgeSampleIndex n (S k) B A Δ D s sk ↪ Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) := (fullMixedEdgeOwnerSampleEmbedding n S B k steps u htag A Δ D s sk).trans (fullMixedCommonOldIndexEmbedding S B steps) noncomputable def fullMixedCommonEdgeSampleOrder : Fin (Fintype.card (FullActiveEdgeSampleIndex n (S k) B A Δ D s sk)) ≃ FullActiveEdgeSampleIndex n (S k) B A Δ D s sk := finiteEmbeddedOrder (fullMixedCommonEdgeSampleEmbedding n S B k steps u htag A Δ D s sk) theorem full_mixed_common_edge_sample_strictMono : StrictMono (fun i => fullMixedCommonEdgeSampleEmbedding n S B k steps u htag A Δ D s sk (fullMixedCommonEdgeSampleOrder n S B k steps u htag A Δ D s sk i)) := finite_embedded_order_strictMono _ theorem full_mixed_common_edge_sample_owner (i : FullActiveEdgeSampleIndex n (S k) B A Δ D s sk) : fullMixedCommonIndexStage M B steps (fullMixedCommonEdgeSampleEmbedding n S B k steps u htag A Δ D s sk i) = u.succ := by change fullMixedCommonIndexStage M B steps (fullMixedCommonOldIndexEmbedding S B steps (fullMixedEdgeOwnerSampleEmbedding n S B k steps u htag A Δ D s sk i)) = _ rw [full_mixed_common_old_index_stage, full_mixed_edge_owner_sample_owner] theorem full_mixed_common_edge_sample_group (i : FullActiveEdgeSampleIndex n (S k) B A Δ D s sk) : fullMixedCommonBirthGroup M B steps (fullMixedCommonBirthOrder M B steps (fullMixedCommonEdgeSampleEmbedding n S B k steps u htag A Δ D s sk i)) = i.1 := by change fullMixedCommonBirthGroup M B steps (fullMixedCommonBirthOrder M B steps (fullMixedCommonOldIndexEmbedding S B steps (fullMixedEdgeOwnerSampleEmbedding n S B k steps u htag A Δ D s sk i))) = _ rw [full_mixed_common_old_index_group, full_mixed_edge_owner_sample_group] end Edge end Bounty end section /- Uniform causal row estimates bound the exact original forest-restricted path integral. -/ open Finset Classical namespace Bounty section Rows variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) end Rows end Bounty end section /- The finite P cutoff gives exact support for the original retained coefficient. -/ open Finset Filter namespace Bounty noncomputable def candidateRetainedCutoffWeight (c L q : ℝ) (S : Finset ℕ) (h : ℕ) : ℝ := if primePoolPart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) h ∈ S then markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p : ℝ)) (fun _ => 1) (h : ℤ) else 0 noncomputable def candidateRetainedCutoffCoefficient (c L q : ℝ) (r jStar : ℕ) (S : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (h : ℕ) : ℂ := if primePoolPart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) h ∈ S then candidateRetainedComplexCoefficient c L q r jStar take twist h else 0 section variable (c L q : ℝ) (r jStar : ℕ) (S : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) include c L q r jStar S take twist theorem candidate_retained_cutoff_coefficient_eq_weight (h : ℕ) : candidateRetainedCutoffCoefficient c L q r jStar S take twist h = (candidateRetainedCutoffWeight c L q S h : ℂ) * candidateRemainingComplexCoefficient c L r jStar take twist (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) h) := by unfold candidateRetainedCutoffCoefficient candidateRetainedCutoffWeight candidateRetainedComplexCoefficient split_ifs <;> simp theorem candidate_retained_cutoff_coefficient_eq_zero_of_not_mem {h : ℕ} (hh : h ∉ candidateRetainedAllocationSupport c L r jStar S take) : candidateRetainedCutoffCoefficient c L q r jStar S take twist h = 0 := by classical let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) by_cases hp : primePoolPart P h ∈ S · have hn : primePoolFreePart P h ∉ orderedSlotProductSupport (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val) := by intro hn apply hh exact mem_image.mpr ⟨(primePoolPart P h, primePoolFreePart P h), mem_product.mpr ⟨hp, hn⟩, primePoolPart_mul_primePoolFreePart P h⟩ have hzero : candidateRemainingComplexCoefficient c L r jStar take twist (primePoolFreePart P h) = 0 := by unfold candidateRemainingComplexCoefficient rw [ordered_slot_complex_weight_support _ _ hn, zero_div] rw [candidateRetainedCutoffCoefficient, if_pos hp, candidateRetainedComplexCoefficient, hzero, mul_zero] · exact if_neg hp end theorem eventually_candidate_retained_cutoff_support {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (S : Finset ℕ), (∀ p ∈ S, p ∈ Nat.factoredNumbers ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) → ∀ (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (h : ℕ), candidateRetainedCutoffCoefficient c L q r jStar S take twist h = if h ∈ candidateRetainedAllocationSupport c L r jStar S take then candidateRetainedComplexCoefficient c L q r jStar take twist h else 0 := by classical filter_upwards [eventually_candidate_remaining_support_free hc] with L hfree intro q r jStar S hS take twist h by_cases hh : h ∈ candidateRetainedAllocationSupport c L r jStar S take · rw [if_pos hh] obtain ⟨⟨p,n⟩, hpn, rfl⟩ := mem_image.mp hh obtain ⟨hp, hn⟩ := mem_product.mp hpn obtain ⟨hn0, hnfree⟩ := hfree r jStar take n hn unfold candidateRetainedCutoffCoefficient rw [primePoolPart_mul_of_free (hS p hp) hn0 hnfree, if_pos hp] · rw [if_neg hh] exact candidate_retained_cutoff_coefficient_eq_zero_of_not_mem c L q r jStar S take twist hh theorem candidate_retained_cutoff_weight_mul_free_left (c L q : ℝ) (S : Finset ℕ) {m h : ℕ} (hm : m ≠ 0) (hh : h ≠ 0) (hfree : Disjoint m.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) : candidateRetainedCutoffWeight c L q S (m*h) = candidateRetainedCutoffWeight c L q S h := by unfold candidateRetainedCutoffWeight rw [prime_pool_part_mul_free_left hm hh hfree] split_ifs · simpa only [Nat.mul_comm] using candidate_marked_weight_mul_of_free c L q hm hfree h · rfl end Bounty end section /- The actual prime exceptional set has a uniform residual energy bound. The interval cardinality input is discharged by the proved growing moments. -/ open Filter Finset MeasureTheory namespace Bounty theorem eventually_prime_exceptional_residual_energy {a beta c A B d C : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hA : 0 ≤ A) (hB : 1 ≤ B) (hd : 0 < d) : ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R U : ℝ), 1 ≤ Y → d * L ≤ Real.log Y → Real.log Y ≤ c * L → Real.exp (L ^ a) / 2 ≤ P → P ≤ Real.exp (L ^ beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) → (∀ p : s, ‖coeff p‖ ≤ B) → Y ^ (3 / 5 : ℝ) ≤ U → ∀ (lo hi : ℕ) (w : ℕ → ℂ), U ≤ (lo : ℝ) → (hi : ℝ) ≤ 2 * U → (∑ n ∈ Finset.Icc lo hi, ‖w n‖ ^ 2) ≤ L ^ C / U → (∫ t in primeExceptionalTimes s coeff (L ^ (-A)) R, ‖∑ n ∈ Finset.Icc lo hi, w n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)‖ ^ 2) ≤ L ^ (C + 2) := by filter_upwards [eventually_prime_exceptional_sparse_absorption ha ha1 hbeta hc hA hB hd, eventually_sparse_logarithmic_prefactor_le_square hc, eventually_constant_le_rpow_of_log_lower hd zero_lt_one (by norm_num : (0 : ℝ) < 2), eventually_gt_atTop (0 : ℝ)] with L habs hbudget htwo hL intro s hs coeff Y P R U hY hlo hhi hPlo hPhi hR hRY hband hcoeff hU lo hi w hlow hhigh henergy have hY0 : 0 < Y := zero_lt_one.trans_le hY have hY2 : 2 ≤ Y := by simpa only [Real.rpow_one] using htwo Y hY0 hlo have hU1 : 1 ≤ U := (Real.one_le_rpow hY (by norm_num : (0 : ℝ) ≤ 3 / 5)).trans hU have hcard := habs s hs coeff Y P R U hY hlo hhi hPlo hPhi hR hRY hband hcoeff hU have hraw := prime_exceptional_integral_logarithmic_bound s coeff (L ^ (-A)) R lo hi (2 * ⌈R⌉₊ + 2) w hU1 hlow hhigh (by push_cast; rfl) hcard henergy have hpref := hbudget Y (2 * ⌈R⌉₊ + 2) hY0 (by omega) (prime_exceptional_time_span_le hR hRY hY2) hhi calc _ ≤ (72 * Real.pi * (1 + 2 * (1 + Real.log (2 * ⌈R⌉₊ + 2 : ℕ))) + 1) * L ^ C := hraw _ ≤ L ^ (2 : ℕ) * L ^ C := mul_le_mul_of_nonneg_right hpref (Real.rpow_nonneg hL.le C) _ = L ^ (C + 2) := by rw [← Real.rpow_two, ← Real.rpow_add hL]; congr 1; ring end Bounty end section /- The progression bound controls each divisor term for every Dirichlet character. -/ open Finset namespace Bounty theorem exists_divisor_character_logarithmic_bound (τ : ℝ) (hτ : 0 < τ) : ∃ δ D N0 : ℝ, 0 < δ ∧ 0 < D ∧ 1 ≤ N0 ∧ ∀ (Y x u : ℝ) (a b d q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), 0 < d → Y ≤ (a : ℝ)+1 → (b : ℝ) ≤ 2*Y → N0 ≤ Y/((d : ℝ)*(q : ℝ)) → 1 ≤ x → x^(τ/2) ≤ Y/((d : ℝ)*(q : ℝ)) → u ≠ 0 → |u| ≤ x^2 → ‖∑ n ∈ (Ioc a b).filter (fun n => d ∣ n), χ (n : ZMod q)*Complex.exp (((u*Real.log (n : ℝ) : ℝ) : ℂ)*Complex.I)‖ ≤ D*(Y/(d : ℝ))*(1/|u|+(Y/((d : ℝ)*(q : ℝ)))^(-δ)) := by obtain ⟨δ,D,N0,hδ,hD,hN0,hres⟩ := exists_divisor_residue_logarithmic_bound τ hτ refine ⟨δ,D,N0,hδ,hD,hN0,?_⟩ intro Y x u a b d q hqInst χ hd hYa hbY hN hx hxN hu hux have hdR : 0 < (d : ℝ) := by exact_mod_cast hd have hqR : 0 < (q : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) let E : ℝ := D*(Y/((d : ℝ)*(q : ℝ)))*(1/|u|+(Y/((d : ℝ)*(q : ℝ)))^(-δ)) have hNr : 0 < Y/((d : ℝ)*(q : ℝ)) := lt_of_lt_of_le (by linarith) hN have hE : 0 ≤ E := by dsimp [E]; positivity let F : ℕ → ℂ := fun m => Complex.exp (((u*Real.log ((m : ℝ)*(d : ℝ)) : ℝ) : ℂ)*Complex.I) have hc : ‖∑ m ∈ Ioc (a/d) (b/d), χ (m : ZMod q)*F m‖ ≤ (q : ℝ)*E := by apply character_sum_le_residue_phase_bounds _ χ F hE intro r hr exact hres Y x u a b d q r hd hYa hbY hN hx hxN hu hux rw [sum_interval_multiples a b d hd] have he : (∑ m ∈ Ioc (a/d) (b/d), χ ((m*d : ℕ) : ZMod q)*Complex.exp (((u*Real.log ((m*d : ℕ) : ℝ) : ℝ) : ℂ)*Complex.I)) = χ (d : ZMod q)*(∑ m ∈ Ioc (a/d) (b/d), χ (m : ZMod q)*F m) := by rw [mul_sum] apply sum_congr rfl intro m hm simp only [Nat.cast_mul,map_mul,F] ring rw [he,norm_mul] calc _ ≤ 1*‖∑ m ∈ Ioc (a/d) (b/d), χ (m : ZMod q)*F m‖ := mul_le_mul_of_nonneg_right (χ.norm_le_one _) (norm_nonneg _) _ ≤ (q : ℝ)*E := by simpa only [one_mul] using hc _ = _ := by dsimp [E] field_simp end Bounty end section /- The original compatible pair sum, after stripping shared vertex factors, becomes two marked-list averages with its exact shared-draw guard retained. -/ open Finset open scoped Classical namespace Bounty theorem physical_stripped_pair_sum_eq_marked_averages {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (V : G → ℝ) (q : ℝ) (w z : ℤ) (b : GroupMarkedLists P (fun g => ell + (C g).card) → GroupMarkedLists P (fun g => ell + (C g).card) → PhysicalAuxLabels P (fun g => univ \ C g) → ℂ) : (∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then ((physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * ((physicalUnsharedVertex C L q w : ℂ) * (physicalUnsharedVertex C R q z : ℂ) * b (physicalGroupUnsharedEmbedding C L) (physicalGroupUnsharedEmbedding C R) (physicalSharedAux C L)) else 0) = (markedDivisorWeight univ P q V (fun g => ell + (C g).card) w : ℂ) * (markedDivisorWeight univ P q V (fun g => ell + (C g).card) z : ℂ) * groupMarkedAverage P (fun g => ell + (C g).card) w (fun u => groupMarkedAverage P (fun g => ell + (C g).card) z (fun v => ∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if physicalRawCutGood C u v s then (physicalAuxMass V (fun g => univ \ C g) s : ℂ) * b u v s else 0)) := by simp only [physical_unshared_vertex_eq_group_weight] rw [physical_normalized_cut_sum_eq_raw_draws P C V (fun u v s => (groupMarkedVertexWeight P q (fun g => ell + (C g).card) w u : ℂ) * (groupMarkedVertexWeight P q (fun g => ell + (C g).card) z v : ℂ) * b u v s)] rw [← completion_marked_pair_sum_eq_average] simp only [mul_sum] apply sum_congr rfl intro u _ apply sum_congr rfl intro v _ apply sum_congr rfl intro s _ by_cases hs : physicalRawCutGood C u v s · simp only [if_pos hs, Complex.ofReal_mul, Complex.ofReal_pow] ring · simp only [if_neg hs, mul_zero] end Bounty end section /- The literal asymmetric prime kernels factor through the two original unshared endpoint embeddings and the unchanged auxiliary draw. -/ open Finset Classical namespace Bounty noncomputable def physicalUnsharedPrimeCoefficient {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (u v : GroupMarkedLists P (fun g => ell + (repeatedBigAuxCut A B g).card)) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : ℂ := primeProductIdealKernel (fun i : A => P i.val.1) (fun i => V i.val.1) Q h keptA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 (physicalPrimeUnsharedRestriction A B A subset_union_left v) * primeProductIdealKernel (fun i : B => P i.val.1) (fun i => V i.val.1) Q h keptB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 (physicalPrimeUnsharedRestriction A B B subset_union_right u) theorem physical_prime_coefficient_factors_unshared {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : repeatedBigPrimeCoefficient P V A B hU hAB Q h keptA keptB (fun g s => L g s) (fun g s => R g s) aux = physicalUnsharedPrimeCoefficient P V A B hU hAB Q h keptA keptB (physicalGroupUnsharedEmbedding (repeatedBigAuxCut A B) L) (physicalGroupUnsharedEmbedding (repeatedBigAuxCut A B) R) aux := by unfold physicalUnsharedPrimeCoefficient rw [physical_prime_unshared_restriction_embedding, physical_prime_unshared_restriction_embedding] rfl noncomputable def physicalUnsharedPrimePatternKernel {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h : ℝ) (kept : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, GroupMarkedLists P (fun g => ell + (repeatedBigPrimePatternCut probes r t i g).card) → GroupMarkedLists P (fun g => ell + (repeatedBigPrimePatternCut probes r t i g).card) → PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i) → ℂ | .inl _ => fun _ _ _ => 1 | .inr ab => let hv := repeated_big_prime_pattern_pair_valid probes r t hrt ab physicalUnsharedPrimeCoefficient P V ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 Q h (kept ab.1.val) (kept ab.2.val) theorem physical_prime_pattern_kernel_factors_unshared {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h : ℝ) (kept : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) : repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i (fun g s => L g s) (fun g s => R g s) aux = physicalUnsharedPrimePatternKernel P V probes r t hrt Q h kept i (physicalGroupUnsharedEmbedding (repeatedBigPrimePatternCut probes r t i) L) (physicalGroupUnsharedEmbedding (repeatedBigPrimePatternCut probes r t i) R) aux := by cases i with | inl u => rfl | inr ab => exact physical_prime_coefficient_factors_unshared P V ab.1.val ab.2.val _ _ Q h (kept ab.1.val) (kept ab.2.val) L R aux end Bounty end section /- Restrict a marked coefficient to selected groups without discarding the zero weight when a complementary divisor fiber is empty. -/ open Finset open scoped Classical namespace Bounty theorem weighted_group_marked_average_restrict {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (n : ℤ) (S : Finset G) (b : GroupMarkedLists (fun g : S => P g.val) (fun g : S => t g.val) → ℂ) : (markedDivisorWeight univ P q V t n : ℂ) * groupMarkedAverage P t n (fun L => b (fun g : S => L g.val)) = (markedDivisorWeight univ P q V t n : ℂ) * groupMarkedAverage (fun g : S => P g.val) (fun g : S => t g.val) n b := by rw [← weighted_group_marked_sum_eq_average, weighted_group_marked_sum_selected_average] theorem weighted_group_marked_pair_restrict {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (w z : ℤ) (S : Finset G) (a b : GroupMarkedLists (fun g : S => P g.val) (fun g : S => t g.val) → ℂ) : let W := fun n => markedDivisorWeight univ P q V t n ((W w * W z : ℝ) : ℂ) * groupMarkedAverage P t w (fun u => groupMarkedAverage P t z (fun v => a (fun g : S => u g.val) * b (fun g : S => v g.val))) = ((W w : ℂ) * groupMarkedAverage (fun g : S => P g.val) (fun g : S => t g.val) w a) * ((W z : ℂ) * groupMarkedAverage (fun g : S => P g.val) (fun g : S => t g.val) z b) := by dsimp only rw [group_marked_pair_average_separate] push_cast calc _ = ((markedDivisorWeight univ P q V t w : ℂ) * groupMarkedAverage P t w (fun u => a (fun g : S => u g.val))) * ((markedDivisorWeight univ P q V t z : ℂ) * groupMarkedAverage P t z (fun v => b (fun g : S => v g.val))) := by ring _ = _ := by rw [weighted_group_marked_average_restrict, weighted_group_marked_average_restrict] end Bounty end section /- The cut of an original prime pattern vanishes outside its two selected group sets. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- The source coefficient is conjugated when the separated pair is written as the usual conjugate-source times target pairing. -/ open Finset open scoped Classical namespace Bounty theorem real_weighted_marked_source_conjugation {G : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) (b : GroupMarkedLists P t → ℂ) (W : ℝ) (F : ℂ) : star ((W : ℂ) * groupMarkedAverage P t n (fun u => star (b u)) * F) = (W : ℂ) * groupMarkedAverage P t n b * star F := by rw [group_marked_average_star] simp [mul_comm, mul_assoc] end Bounty end section /- The full-residual rational multiplier is exactly the gcd-filtered original polynomial. -/ open Finset namespace Bounty end Bounty end section /- One rational coefficient family handles arbitrary product kernels and Mellin weights. -/ open Finset open scoped Classical namespace Bounty theorem rational_four_factor_full_gcd_kernel_expansion {r Q : ℕ} (hr : 0 < r) (hrQ : r ≤ Q) (u : ℤ) (M A P N : Finset ℕ) (hM : ∀ m ∈ M, m.Coprime r) (hA : ∀ a ∈ A, a.Coprime r) (hP : ∀ p ∈ P, p.Coprime r) : ∃ c : (d : ℕ) → AddChar (Additive (ZMod (r/d))ˣ) ℂ → ℂ, (∑ d ∈ r.divisors, ∑ ψ, ‖c d ψ‖) ≤ (r.divisors.card : ℝ)*Real.sqrt (Q : ℝ) ∧ (r.divisors.card : ℝ)*Real.sqrt (Q : ℝ) ≤ (Q : ℝ)*Real.sqrt (Q : ℝ) ∧ ∀ α δ β γ H : ℕ → ℂ, (∑ m ∈ M, ∑ a ∈ A, ∑ p ∈ P, ∑ n ∈ N, (α m*δ a*β p*γ n)*H (m*a*p*n)* Complex.exp (Complex.I*(2*Real.pi*((u : ℝ)/r*(m*a*p*n)) : ℝ))) = ∑ d ∈ r.divisors, ∑ ψ, c d ψ * ∑ m ∈ M, ∑ a ∈ A, ∑ p ∈ P, ∑ n ∈ N, (α m*unitAddCharDirichlet ψ (m : ZMod (r/d)))* (δ a*unitAddCharDirichlet ψ (a : ZMod (r/d)))* (β p*unitAddCharDirichlet ψ (p : ZMod (r/d)))* (γ n*rationalResidualGcdMultiplier r d ψ n)*H (m*a*p*n) := by have hex (d : ℕ) : ∃ c : AddChar (Additive (ZMod (r/d))ˣ) ℂ → ℂ, (∑ ψ, ‖c ψ‖) ≤ Real.sqrt (Q : ℝ) ∧ (d ∈ r.divisors → ∀ m a p n : ℕ, m.Coprime r → a.Coprime r → p.Coprime r → n.gcd r = d → (∑ ψ, c ψ*unitAddCharDirichlet ψ (m : ZMod (r/d))* unitAddCharDirichlet ψ (a : ZMod (r/d))* unitAddCharDirichlet ψ (p : ZMod (r/d))* unitAddCharDirichlet ψ ((n/d : ℕ) : ZMod (r/d))) = Complex.exp (Complex.I*(2*Real.pi*((u : ℝ)/r*(m*a*p*n)) : ℝ))) := by by_cases hd : d ∈ r.divisors · obtain ⟨c, hc, he⟩ := rational_four_factor_gcd_slice_expansion hr hrQ (Nat.pos_of_mem_divisors hd) (Nat.dvd_of_mem_divisors hd) u exact ⟨c, hc, fun _ => he⟩ · refine ⟨fun _ => 0, ?_, fun h => (hd h).elim⟩ simp choose c hc using hex have hmass : (∑ d ∈ r.divisors, ∑ ψ, ‖c d ψ‖) ≤ (r.divisors.card : ℝ)*Real.sqrt (Q : ℝ) := by calc _ ≤ ∑ _d ∈ r.divisors, Real.sqrt (Q : ℝ) := sum_le_sum (fun d _ => (hc d).1) _ = _ := by simp have hcard : (r.divisors.card : ℝ) ≤ (Q : ℝ) := by exact_mod_cast (Nat.card_divisors_le_self r).trans hrQ refine ⟨c, hmass, mul_le_mul_of_nonneg_right hcard (Real.sqrt_nonneg _), ?_⟩ intro α δ β γ H calc _ = ∑ m ∈ M, ∑ a ∈ A, ∑ p ∈ P, ∑ d ∈ r.divisors, ∑ n ∈ N.filter (fun n => n.gcd r = d), (α m*δ a*β p*γ n)*H (m*a*p*n)* Complex.exp (Complex.I*(2*Real.pi*((u : ℝ)/r*(m*a*p*n)) : ℝ)) := by apply sum_congr rfl intro m _ apply sum_congr rfl intro a _ apply sum_congr rfl intro p _ exact sum_eq_sum_residual_gcd_slices hr N _ _ = ∑ d ∈ r.divisors, ∑ m ∈ M, ∑ a ∈ A, ∑ p ∈ P, ∑ n ∈ N.filter (fun n => n.gcd r = d), (α m*δ a*β p*γ n)*H (m*a*p*n)* Complex.exp (Complex.I*(2*Real.pi*((u : ℝ)/r*(m*a*p*n)) : ℝ)) := by conv_lhs => arg 2 ext m arg 2 ext a rw [sum_comm] conv_lhs => arg 2 ext m rw [sum_comm] rw [sum_comm] _ = _ := by apply sum_congr rfl intro d hd calc _ = ∑ m ∈ M, ∑ a ∈ A, ∑ p ∈ P, ∑ n ∈ N.filter (fun n => n.gcd r = d), ∑ ψ, c d ψ * (α m*unitAddCharDirichlet ψ (m : ZMod (r/d))) * (δ a*unitAddCharDirichlet ψ (a : ZMod (r/d))) * (β p*unitAddCharDirichlet ψ (p : ZMod (r/d))) * (γ n*unitAddCharDirichlet ψ ((n/d : ℕ) : ZMod (r/d))) * H (m*a*p*n) := by apply sum_congr rfl intro m hm apply sum_congr rfl intro a ha apply sum_congr rfl intro p hp apply sum_congr rfl intro n hn rw [← (hc d).2 hd m a p n (hM m hm) (hA a ha) (hP p hp) (mem_filter.mp hn).2, mul_sum] apply sum_congr rfl intro ψ _ ring _ = ∑ ψ, ∑ m ∈ M, ∑ a ∈ A, ∑ p ∈ P, ∑ n ∈ N.filter (fun n => n.gcd r = d), c d ψ * (α m*unitAddCharDirichlet ψ (m : ZMod (r/d))) * (δ a*unitAddCharDirichlet ψ (a : ZMod (r/d))) * (β p*unitAddCharDirichlet ψ (p : ZMod (r/d))) * (γ n*unitAddCharDirichlet ψ ((n/d : ℕ) : ZMod (r/d))) * H (m*a*p*n) := by conv_lhs => arg 2 ext m arg 2 ext a arg 2 ext p rw [sum_comm] conv_lhs => arg 2 ext m arg 2 ext a rw [sum_comm] conv_lhs => arg 2 ext m rw [sum_comm] rw [sum_comm] _ = ∑ ψ, c d ψ * ∑ m ∈ M, ∑ a ∈ A, ∑ p ∈ P, ∑ n ∈ N.filter (fun n => n.gcd r = d), (α m*unitAddCharDirichlet ψ (m : ZMod (r/d))) * (δ a*unitAddCharDirichlet ψ (a : ZMod (r/d))) * (β p*unitAddCharDirichlet ψ (p : ZMod (r/d))) * (γ n*unitAddCharDirichlet ψ ((n/d : ℕ) : ZMod (r/d))) * H (m*a*p*n) := by simp only [mul_assoc, mul_sum] _ = _ := by apply sum_congr rfl intro ψ _ congr 1 apply sum_congr rfl intro m _ apply sum_congr rfl intro a _ apply sum_congr rfl intro p _ simpa only [mul_assoc] using rational_residual_gcd_filtered_sum r d ψ N (fun n => (α m*unitAddCharDirichlet ψ (m : ZMod (r/d))) * (δ a*unitAddCharDirichlet ψ (a : ZMod (r/d))) * (β p*unitAddCharDirichlet ψ (p : ZMod (r/d))) * γ n) (fun n => H (m*a*p*n)) end Bounty end section /- The complete fixed-path selected physical composition equals the original weighted raw schedule. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) end ResiduePath end Bounty end section /- Four chronological selected physical rows per edge: a visit, the chosen source permutation, the chosen auxiliary edge and target marks, and the inverse target permutation. Each is a local filter of the original observed row. -/ open scoped Classical namespace Bounty noncomputable def physicalSelectedFineTag (n i : ℕ) : Option (Fin (n + 1) ⊕ Fin n) := if hi : i < 4 * n + 1 then if h0 : i % 4 = 0 then some (.inl ⟨i / 4, by omega⟩) else if h2 : i % 4 = 2 then some (.inr ⟨i / 4, by omega⟩) else none else none section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) noncomputable def physicalSelectedFineTest (i : ℕ) (o : PhysicalMarkObservation P ell C) (t : PhysicalBoundedMarkState P J ell B) : Prop := if hi : i < 4 * n + 1 then if h0 : i % 4 = 0 then let j : Fin (n + 1) := ⟨i / 4, by omega⟩ o = .inr none ∧ t.1 = L j else let j : Fin n := ⟨i / 4, by omega⟩ if i % 4 = 1 then o = .inl (σ j) else if i % 4 = 2 then o = .inr (some ⟨j, aux j⟩) ∧ t.1 = physicalPermuteLabels (τ j) (L j.succ) else o = .inl (physicalInversePermutations (τ j)) else False variable (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) noncomputable def physicalSelectedFineRow (i : ℕ) (F : PhysicalBoundedMarkState P J ell B → ℂ) : PhysicalBoundedMarkState P J ell B → ℂ := physicalObservedMarkRow C k ω β retention ρ V hV (physicalSelectedFineTag n i) (fun o t => if physicalSelectedFineTest C aux L σ τ i o t then F t else 0) theorem physical_selected_fine_row_visit (j : Fin (n + 1)) (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention (4 * j.val) F = physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = L j then F t else 0) := by have hj := j.isLt have hi : 4 * j.val < 4 * n + 1 := by omega have h0 : (4 * j.val) % 4 = 0 := by omega have hd : (4 * j.val) / 4 = j.val := by omega have he (h : (4 * j.val) / 4 < n + 1) : (⟨(4 * j.val) / 4, h⟩ : Fin (n + 1)) = j := Fin.ext hd simp only [physicalSelectedFineRow, physicalSelectedFineTag, physicalSelectedFineTest, dif_pos hi, dif_pos h0, he] congr 1 funext o t split_ifs <;> rfl theorem physical_selected_fine_row_source_permutation (j : Fin n) (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention (4 * j.val + 1) F = physicalObservedMarkRow C k ω β retention ρ V hV none (fun o t => if o = .inl (σ j) then F t else 0) := by have hj := j.isLt have hi : 4 * j.val + 1 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 1) % 4 = 0 := by omega have h1 : (4 * j.val + 1) % 4 = 1 := by omega have h2 : ¬ (4 * j.val + 1) % 4 = 2 := by omega have hd : (4 * j.val + 1) / 4 = j.val := by omega have he (h : (4 * j.val + 1) / 4 < n) : (⟨(4 * j.val + 1) / 4, h⟩ : Fin n) = j := Fin.ext hd simp only [physicalSelectedFineRow, physicalSelectedFineTag, physicalSelectedFineTest, dif_pos hi, dif_neg h0, dif_neg h2, if_pos h1, he] theorem physical_selected_fine_row_edge (j : Fin n) (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention (4 * j.val + 2) F = physicalObservedMarkRow C k ω β retention ρ V hV (some (.inr j)) (fun o t => if o = .inr (some ⟨j, aux j⟩) ∧ t.1 = physicalPermuteLabels (τ j) (L j.succ) then F t else 0) := by have hj := j.isLt have hi : 4 * j.val + 2 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 2) % 4 = 0 := by omega have h1 : ¬ (4 * j.val + 2) % 4 = 1 := by omega have h2 : (4 * j.val + 2) % 4 = 2 := by omega have hd : (4 * j.val + 2) / 4 = j.val := by omega have he (h : (4 * j.val + 2) / 4 < n) : (⟨(4 * j.val + 2) / 4, h⟩ : Fin n) = j := Fin.ext hd simp only [physicalSelectedFineRow, physicalSelectedFineTag, physicalSelectedFineTest, dif_pos hi, dif_neg h0, dif_pos h2, if_neg h1, if_pos h2, he] congr 1 funext o t have haux (h : (4 * j.val + 2) / 4 < n) : (⟨⟨(4 * j.val + 2) / 4, h⟩, aux ⟨(4 * j.val + 2) / 4, h⟩⟩ : Σ j : Fin n, PhysicalAuxLabels P (C j)) = ⟨j, aux j⟩ := congrArg (fun j : Fin n => (⟨j, aux j⟩ : Σ j : Fin n, PhysicalAuxLabels P (C j))) (he h) simp only [haux] split_ifs <;> rfl theorem physical_selected_fine_row_target_permutation (j : Fin n) (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention (4 * j.val + 3) F = physicalObservedMarkRow C k ω β retention ρ V hV none (fun o t => if o = .inl (physicalInversePermutations (τ j)) then F t else 0) := by have hj := j.isLt have hi : 4 * j.val + 3 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 3) % 4 = 0 := by omega have h1 : ¬ (4 * j.val + 3) % 4 = 1 := by omega have h2 : ¬ (4 * j.val + 3) % 4 = 2 := by omega have hd : (4 * j.val + 3) / 4 = j.val := by omega have he (h : (4 * j.val + 3) / 4 < n) : (⟨(4 * j.val + 3) / 4, h⟩ : Fin n) = j := Fin.ext hd simp only [physicalSelectedFineRow, physicalSelectedFineTag, physicalSelectedFineTest, dif_pos hi, dif_neg h0, dif_neg h2, if_neg h1, if_neg h2, he] end Fine end Bounty end section /- The mask average equals the actual power weight on shifted prime divisibility. -/ open Finset Filter open scoped Topology namespace Bounty noncomputable def pairShiftedPrimeSet (P : Finset ℕ) (v : ℕ × ℕ) : Finset ℕ := P.filter (fun p => (v.1*v.2) % p = 1 % p) theorem pair_shifted_prime_set_eq_divisors (P : Finset ℕ) (v : ℕ × ℕ) (hv : 1 ≤ v.1*v.2) : pairShiftedPrimeSet P v = P.filter (fun p => p ∣ v.1*v.2-1) := by apply filter_congr intro p _ rw [eq_comm] exact Nat.modEq_iff_dvd' hv end Bounty end section /- The selected scalar product retains exactly one auxiliary law and both permutation averages per edge. -/ open Finset namespace Bounty section Product variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ : Fin n → PhysicalPermutations (Fin N) J ell) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) theorem physical_selected_coarse_scalar_product : (∏ i ∈ range (2 * n + 1), physicalSelectedCoarseScalar C aux L σ ω i) = ∏ j : Fin n, (((Fintype.card (PhysicalPermutations (Fin N) J ell) : ℝ)⁻¹ : ℂ) ^ 2) * (ω j (physicalSharedMarkLabels (C j) (physicalPermuteLabels (σ j) (L j.castSucc))) (aux j) : ℂ) := by rw [alternating_even_one_product _ n (fun j hj => physical_selected_coarse_scalar_even C aux L σ ω ⟨j, by omega⟩)] rw [← Fin.prod_univ_eq_prod_range] apply prod_congr rfl intro j hj exact physical_selected_coarse_scalar_odd C aux L σ ω j end Product end Bounty end section /- Finite cardinality bounds for the concrete physical prime patterns. -/ open Finset open scoped Classical namespace Bounty theorem repeated_big_prime_pattern_cut_subset {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (g : G) : repeatedBigPrimePatternCut probes r t i g ⊆ probes g := by cases i with | inl u => exact empty_subset _ | inr ab => intro j hj have hm := (mem_repeatedBigAuxCut ab.1.val ab.2.val g j).mp hj rcases mem_union.mp hm with ha | hb · have hs := ((clean_mem_nonempty_subsets _ _).mp ab.1.property).2 ha have hp := (mem_sigma.mp hs).2 simpa [repeatedBigPrimeProbeSlots] using hp · have hs := ((clean_mem_nonempty_subsets _ _).mp ab.2.property).2 hb have hp := (mem_sigma.mp hs).2 simpa [repeatedBigPrimeProbeSlots] using hp theorem repeated_big_prime_pattern_cut_card_le {G : Type*} [DecidableEq G] {J ell m : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hp : ∀ g, (probes g).card ≤ m) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (g : G) : (repeatedBigPrimePatternCut probes r t i g).card ≤ m := (card_le_card (repeated_big_prime_pattern_cut_subset probes r t i g)).trans (hp g) theorem repeated_big_prime_probe_sigma_card_le {G : Type*} [DecidableEq G] {J ell m : ℕ} (probes : G → Finset (Fin J)) (r : Finset G) (hp : ∀ g, (probes g).card ≤ m) : (r.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes)).card ≤ m * r.card := by rw [card_sigma] calc _ ≤ ∑ _g ∈ r, m := by apply sum_le_sum intro g hg simpa only [repeatedBigPrimeProbeSlots, card_map] using hp g _ = _ := by simp [Nat.mul_comm] theorem repeated_big_prime_pattern_pair_card {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) : Fintype.card (RepeatedBigPrimePatternPair (ell := ell) probes r t) = (2 ^ (r.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes)).card - 1) * (2 ^ (t.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes)).card - 1) := by unfold RepeatedBigPrimePatternPair rw [Fintype.card_prod, Fintype.card_coe, Fintype.card_coe] simp [cleanNonemptySubsets] theorem repeated_big_prime_pattern_pair_card_le {G : Type*} [DecidableEq G] {J ell m : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hp : ∀ g, (probes g).card ≤ m) : Fintype.card (RepeatedBigPrimePatternPair (ell := ell) probes r t) ≤ 2 ^ (m * (r.card + t.card)) := by rw [repeated_big_prime_pattern_pair_card] calc _ ≤ 2 ^ (r.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes)).card * 2 ^ (t.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes)).card := Nat.mul_le_mul (Nat.sub_le _ _) (Nat.sub_le _ _) _ = 2 ^ ((r.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes)).card + (t.sigma (repeatedBigPrimeProbeSlots (ell := ell) probes)).card) := (pow_add _ _ _).symm _ ≤ _ := by apply Nat.pow_le_pow_right (by decide : 1 ≤ 2) have hr := repeated_big_prime_probe_sigma_card_le (ell := ell) probes r hp have ht := repeated_big_prime_probe_sigma_card_le (ell := ell) probes t hp nlinarith theorem repeated_big_prime_pattern_pair_card_le_groups {G : Type*} [Fintype G] [DecidableEq G] {J ell m : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (hp : ∀ g, (probes g).card ≤ m) : Fintype.card (RepeatedBigPrimePatternPair (ell := ell) probes r t) ≤ 2 ^ (m * Fintype.card G) := by apply (repeated_big_prime_pattern_pair_card_le (ell := ell) probes r t hp).trans apply Nat.pow_le_pow_right (by decide : 1 ≤ 2) apply Nat.mul_le_mul_left rw [← card_union_of_disjoint hrt] exact card_le_univ _ end Bounty end section /- The actual projected clean-hybrid row, including tilt and auxiliary collision bans, specialized to the signed prime-comparison family. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- A uniform pair-count bound normalized by the actual candidate marked harmonic mass. -/ open Finset Filter open scoped Topology namespace Bounty theorem exists_candidate_odd_masked_pair_bound : ∃ K : ℝ, 0 < K ∧ ∀ (γ q : ℝ), 0 < γ → 0 ≤ q → q ≤ 1 → ∀ᶠ L : ℝ in atTop, ∀ (a b c d m : ℕ) [NeZero m] (W z : ℝ) (P : Finset ℕ), (m : ℝ) ≤ Real.exp L → (∀ p ∈ m.primeFactors, L^2 ≤ (p : ℝ)) → a ≤ b → c ≤ d → 0 ≤ W → W ≤ z → 1 < z → P ⊆ (candidatePIndices γ L).biUnion (candidatePBand (γ*L)) → (∑ S ∈ P.powerset, bernoulliSubsetWeight q P S * ((oddMaskedPairBox a b c d m W z S).card : ℝ)) ≤ K * (((b : ℝ)-a)*((d : ℝ)-c)/(m : ℝ)) * (∏ p ∈ primeBand 0 W, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) * candidateOneMarkedHarmonicMass γ L q + ((m : ℝ)*(z^(10 : ℝ))^3 + (((b : ℝ)-a)+((d : ℝ)-c))*(z^(10 : ℝ))^2) := by obtain ⟨K, hK, hb⟩ := exists_odd_masked_pair_average_upper refine ⟨K, hK, ?_⟩ intro γ q hγ hq0 hq1 obtain ⟨v, V, hv, _, hpool⟩ := exists_candidate_P_pool_bounds hγ filter_upwards [eventually_candidate_mask_inverse_bound hγ hq0 hq1, hpool, eventually_ge_atTop (1 : ℝ)] with L hmask hp hL rcases hp with ⟨_, _, _, _, _, hdata⟩ intro a b c d m hm W z P hmL hmin hab hcd hW hWz hz hP have hP2 : ∀ p ∈ P, 2 ≤ p := by intro p hp obtain ⟨j, hj, hpj⟩ := mem_biUnion.mp (hP hp) exact (((hdata j hj).2.2 p hpj).1).two_le have h := hb L a b c d m W z q P hL hmL hmin hab hcd hW hWz hz hq0 hq1 hP2 have he := hmask P hP rw [bernoulli_mask_inverse_avoidance P q hP2] at he have hX : 0 ≤ (b : ℝ)-a := sub_nonneg.mpr (Nat.cast_le.mpr hab) have hY : 0 ≤ (d : ℝ)-c := sub_nonneg.mpr (Nat.cast_le.mpr hcd) have hV : 0 ≤ ∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ)) := Finset.prod_nonneg (fun p hp => (avoidance_factor_bounds ((mem_primeBand_iff le_rfl (zero_lt_one.trans hz).le p).mp hp).1.two_le).1.le) apply h.trans exact add_le_add (mul_le_mul_of_nonneg_left he (by positivity)) le_rfl end Bounty end section /- The original ledger phase is restored by a signed forest sum, with all residual factors intact. -/ open scoped Classical open Finset namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (hedge : ∀ k H x e, edgePhase k H x e = (if FullMixedLocalBirthAvoids (J := J) n S B A Δ D H (some (.inr k)) x e ∧ FullMixedLocalBirthDistinct (J := J) n S B A Δ D (some (.inr k)) x e then 1 else 0) * edgePhase k (fun _ => ∅) x e) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (initial : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) end Full end Bounty end section /- The literal physical recorded history is a sum over its original full event paths. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) variable (tags : ℕ → Option (I ⊕ K)) (cut : ℕ → Fin N → Finset (Fin J)) (steps : ℕ) (initialTrace : FullMixedLedgerState (fun g (p : {p // p ∈ P g}) => Subtype.val p) (M := fun _ => J + ell) B → List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (Φ : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C) → FullMixedLedgerState (fun g (p : {p // p ∈ P g}) => Subtype.val p) (M := fun _ => J + ell) B → ℂ) (f : PhysicalFullBoundedState P J ell B → ℂ) end Physical end Bounty end section /- The actual projected clean-hybrid row, including tilt and auxiliary collision bans and initial-ledger avoidance, specialized to the signed prime-comparison family. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) include hstep in theorem physical_selected_coarse_adjacent_extension (i : ℕ) (hi : i < 2 * n + 1) (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalMarkRawExtension (physicalSelectedCoarseRow (B := B) C aux k L σ τ β V ρ hV ω retention i F) (physicalMarkAtCut L i) = fun s => physicalSelectedCoarseScalar C aux L σ ω i * globalBirthJointCutRawRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β (fun _ j => 1 - retention j) V (fun _ => ρ) hV B i) B B (physicalMarkRawExtension F (physicalMarkAtCut L (i + 1))) s := by by_cases he : i % 2 = 0 · let j : Fin (n + 1) := ⟨i / 2, by omega⟩ have hiEq : i = 2 * j.val := by dsimp [j]; omega rw [hiEq, physical_selected_coarse_row_even, physical_mark_at_cut_even, physical_mark_at_cut_odd, physical_selected_coarse_scalar_even] simp only [one_mul] exact physical_selected_adjacent_visit_extension C aux k L a σ τ hcompat hlist hP hdis hk β V ρ hV B ω retention j F · let j : Fin n := ⟨i / 2, by omega⟩ have hiEq : i = 2 * j.val + 1 := by dsimp [j]; omega have hnext : 2 * j.val + 1 + 1 = 2 * j.succ.val := by simp only [Fin.val_succ]; omega have hsource : physicalMarkAtCut L (2 * j.val + 1) = L j.castSucc := physical_mark_at_cut_odd L j.castSucc have htarget : physicalMarkAtCut L (2 * j.val + 1 + 1) = L j.succ := by rw [hnext, physical_mark_at_cut_even] rw [hiEq, physical_selected_coarse_row_odd, hsource, htarget, physical_selected_coarse_scalar_odd] exact physical_selected_adjacent_edge_extension C aux k L a σ τ hstep hcompat hlist hP hdis hk β (fun _ j => 1 - retention j) V ρ hV B ω retention j F include hstep in theorem physical_selected_coarse_adjacent_composition (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalMarkRawExtension (finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedCoarseRow (B := B) C aux k L σ τ β V ρ hV ω retention) (2 * n + 1) F) (L 0) = finiteRowComposition (S := fun _ => GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) (fun i G s => physicalSelectedCoarseScalar C aux L σ ω i * globalBirthJointCutRawRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β (fun _ j => 1 - retention j) V (fun _ => ρ) hV B i) B B G s) (2 * n + 1) (physicalMarkRawExtension F (L (Fin.last n))) := by have h := finite_row_composition_test_maps (S := fun _ => GlobalBirthJointState (fun g (p : ↥(P g)) => ZMod p.val)) (T := fun _ => PhysicalBoundedMarkState P J ell B) (fun i G s => physicalSelectedCoarseScalar C aux L σ ω i * globalBirthJointCutRawRow (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β (fun _ j => 1 - retention j) V (fun _ => ρ) hV B i) B B G s) (physicalSelectedCoarseRow (B := B) C aux k L σ τ β V ρ hV ω retention) (fun i G => physicalMarkRawExtension G (physicalMarkAtCut L i)) (2 * n + 1) (fun i hi G => physical_selected_coarse_adjacent_extension C aux k L a σ τ hstep hcompat hlist hP hdis hk β V ρ hV B ω retention i hi G) F have hfirst : physicalMarkAtCut L 0 = L 0 := by simpa using physical_mark_at_cut_even L (0 : Fin (n + 1)) have hlast : physicalMarkAtCut L (2 * n + 1) = L (Fin.last n) := by simpa using physical_mark_at_cut_odd L (Fin.last n) simpa only [hfirst, hlast] using h end ResiduePath end Bounty end section /- Exact Fourier reconstruction of original fixed-forest path sums from complete signed rows. -/ open Finset Classical MeasureTheory namespace Bounty section Fourier variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) s → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (initial : (g : Fin N) → Finset (P g)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) (encode : ((g : Fin N) × P g) → ℤ) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) end Fourier end Bounty end section /- Prescribed marks alone support every selected coarse row, without list admissibility. -/ open Finset Classical namespace Bounty section Support variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) theorem physical_selected_coarse_marks_congr (i : ℕ) (hi : i < 2 * n + 1) (F G : PhysicalBoundedMarkState P J ell B → ℂ) (hFG : ∀ t, t.1 = physicalMarkAtCut L (i + 1) → F t = G t) (s : PhysicalBoundedMarkState P J ell B) : physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention i F s = physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention i G s := by by_cases he : i % 2 = 0 · let j : Fin (n + 1) := ⟨i / 2, by omega⟩ have hij : i = 2 * j.val := by dsimp [j]; omega rw [hij] at hFG ⊢ rw [physical_selected_coarse_row_even, physical_selected_coarse_row_even] apply physical_selected_visit_marks_congr C k ω β retention ρ V hV j (L j) F G simpa only [physical_mark_at_cut_odd] using hFG · let j : Fin n := ⟨i / 2, by omega⟩ have hij : i = 2 * j.val + 1 := by dsimp [j]; omega have hnext : 2 * j.val + 1 + 1 = 2 * j.succ.val := by simp only [Fin.val_succ]; omega rw [hij] at hFG ⊢ rw [physical_selected_coarse_row_odd, physical_selected_coarse_row_odd] apply physical_selected_edge_marks_congr C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.succ) F G simpa only [hnext, physical_mark_at_cut_even] using hFG theorem physical_selected_coarse_marks_zero (i : ℕ) (hi : i < 2 * n + 1) (s : PhysicalBoundedMarkState P J ell B) (hs : s.1 = physicalMarkAtCut L i) : physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention i (fun _ => 0) s = 0 := by by_cases he : i % 2 = 0 · let j : Fin (n + 1) := ⟨i / 2, by omega⟩ have hij : i = 2 * j.val := by dsimp [j]; omega rw [hij] at hs ⊢ rw [physical_selected_coarse_row_even] apply physical_selected_visit_zero C k ω β retention ρ V hV j (L j) s simpa only [physical_mark_at_cut_even] using hs · let j : Fin n := ⟨i / 2, by omega⟩ have hij : i = 2 * j.val + 1 := by dsimp [j]; omega rw [hij, physical_selected_coarse_row_odd] exact physical_selected_edge_zero C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.succ) s end Support end Bounty end section /- Actual uniform rough-number densities on logarithmic cells. -/ namespace Bounty open Filter Real open scoped Topology theorem uniform_rough_depth_approx (n : ℕ) {S : ℝ} (hS : 0 ≤ S) : UniformRoughDepthApprox n S := by induction n with | zero => exact uniform_rough_depth_approx_zero hS | succ n ih => exact uniform_rough_depth_approx_succ_of_prime_error hS ih (fun a ε ha hε => eventually_normalized_prime_cell_error ha hS hε) theorem eventually_normalized_rough_buchstab_error {S a b γ₀ gap ε : ℝ} (hS : 0 ≤ S) (ha : 0 < a) (hγ₀ : 0 < γ₀) (hgap : 0 < gap) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ w γ : ℝ, a ≤ w → w ≤ b → γ₀ ≤ γ → gap ≤ w-γ → |normalizedRoughCellCount L S (exp (w*L)) (exp (γ*L))- buchstabDensity γ w| ≤ ε := by obtain ⟨n, hn⟩ := exists_nat_gt ((b+1)/γ₀) have htop0 : b+1 ≤ ((n : ℝ)+2)*γ₀ := by have hh := (div_lt_iff₀ hγ₀).mp hn nlinarith filter_upwards [(uniform_rough_depth_approx n hS) a b γ₀ gap ha hγ₀ hgap ε hε, eventually_logarithmic_cell_width_div_le hS (show (0:ℝ)<1 by norm_num), eventually_gt_atTop (0 : ℝ)] with L hN hδ hL intro w γ haw hwb hγ hsep have htop : w+L^(-S)/L ≤ ((n : ℝ)+2)*γ := by have hm := mul_le_mul_of_nonneg_left hγ (show 0 ≤ (n : ℝ)+2 by positivity) linarith have hwtop : w ≤ ((n : ℝ)+2)*γ := by have hδ0 : 0 ≤ L^(-S)/L := by positivity linarith have hh := hN w γ haw hwb hγ hsep htop rwa [buchstab_depth_density_eq_density (hγ₀.trans_le hγ) n hwtop] at hh theorem normalized_exponential_rough_cell_tendsto {S γ w : ℝ} (hS : 0 ≤ S) (hγ : 0 < γ) (hγw : γ < w) : Tendsto (fun L : ℝ => normalizedRoughCellCount L S (exp (w*L)) (exp (γ*L))) atTop (nhds (buchstabDensity γ w)) := by rw [Metric.tendsto_nhds] intro ε hε have hh := eventually_normalized_rough_buchstab_error (a := w) (b := w) (γ₀ := γ) (gap := w-γ) hS (hγ.trans hγw) hγ (sub_pos.mpr hγw) (show 0 < ε/2 by positivity) filter_upwards [hh] with L hL rw [Real.dist_eq] exact (hL w γ le_rfl le_rfl le_rfl le_rfl).trans_lt (by linarith) end Bounty /- Public declaration closure audit. -/ end section /- Upper density for candidate mass with a prescribed prime in an exponential band. -/ open Finset Filter open scoped Topology namespace Bounty end Bounty end section /- Candidate prime-band mass with the same sqrt-logarithmic cutoff as the actual proxy. -/ open Finset Filter open scoped Topology namespace Bounty theorem exists_candidate_prime_band_sqrt_rough_mass_estimate (hZ : PrimitiveZeroFreeHalfPlane) : ∃ K : ℝ, 0 < K ∧ ∀ (c q a v : ℝ) (r : ℕ), 0 < c → 0 < r → 0 ≤ q → q < 1 → (11/5 : ℝ)*(r : ℝ)*c = 1 → 0 < a → a ≤ v → v < 1/2 → ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, |candidatePrimeBandRoughMass c L q r jStar (Real.exp (a*L)) (Real.exp (v*L)) (Real.exp (Real.sqrt L)) - candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (Real.sqrt L)) * (∑ p ∈ primeBand (Real.exp (a*L)) (Real.exp (v*L)), 1 / ((p : ℝ)-1))| ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (Real.sqrt L)) * (∑ p ∈ primeBand (Real.exp (a*L)) (Real.exp (v*L)), 1 / ((p : ℝ)-1)) * K * Real.exp (-(roughCellSieveOrder L : ℝ)) + candidateCoefficientWindowMass c L q r jStar * ((1+16*primeEulerProductUpperConstant)*L^(-18 : ℝ)) := by classical obtain ⟨K, hK, hsieve⟩ := exists_summed_external_odd_prime_shifted_sieve refine ⟨K, hK, ?_⟩ intro c q a v r hc hr hq0 hq1 hcenter ha hav hvhalf let theta : ℝ := (v+1/2)/2 have htheta : theta < 1/2 := by dsimp [theta]; linarith only [hvhalf] have hv : 0 < v := ha.trans_le hav have hgap : 0 < theta-v := by dsimp [theta]; linarith only [hvhalf] have hmid : v+(theta-v)/2 < theta := by linarith have hbase : 0 ≤ v+(theta-v)/2 := by positivity obtain ⟨J, hdist⟩ := exists_candidate_relative_typeI_remainder_power_bound hZ hc hr hq0 hq1 hcenter htheta (18 : ℝ) refine ⟨J, ?_⟩ intro jStar hj filter_upwards [hdist jStar hj, eventually_exp_le_floor_exp hbase hmid, eventually_rough_cell_sieve_parameters hgap, eventually_rough_test_proxy_cutoff ha, eventually_gt_atTop (0 : ℝ), eventually_ge_atTop (Real.log 2/a)] with L hd hscale hpar hcut hL hLa let N : ℕ := ⌊Real.exp (theta*L)⌋₊ let P : Finset ℕ := (primeBand 0 (Real.exp (Real.sqrt L))).erase 2 let Q : Finset ℕ := primeBand (Real.exp (a*L)) (Real.exp (v*L)) have hz : 1 < Real.exp (Real.sqrt L) := hpar.2.2.1 have hP : ∀ p ∈ P, p.Prime := fun p hp => small_prime_pool_prime (mem_of_mem_erase hp) have hQ : ∀ p ∈ Q, p.Prime := by intro p hp exact ((mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le p).mp hp).1 have hQlower : ∀ p ∈ Q, Real.exp (a*L) < (p : ℝ) := by intro p hp exact ((mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le p).mp hp).2.1 have hQupper : ∀ p ∈ Q, (p : ℝ) ≤ Real.exp (v*L) := by intro p hp exact ((mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le p).mp hp).2.2 have hQodd : ∀ p ∈ Q, p ≠ 2 := by have hexp : 2 ≤ Real.exp (a*L) := by rw [← Real.exp_log (by norm_num : (0 : ℝ)<2)] apply Real.exp_le_exp.mpr have := (div_le_iff₀ ha).mp hLa nlinarith only [this] intro p hp heq have hp' := hQlower p hp norm_num [heq] at hp' linarith have hout : ∀ p ∈ Q, p ∉ P := by intro p hp hpP have hpmax := small_prime_pool_le (Real.exp_pos (Real.sqrt L)).le (mem_of_mem_erase hpP) have hcutexp : Real.exp (Real.sqrt L) ≤ Real.exp (a*L) := Real.exp_le_exp.mpr hcut exact (not_lt_of_ge (hpmax.trans hcutexp)) (hQlower p hp) have hprodlevel : ∀ p ∈ Q, ∀ d ∈ blockSieveModuli P ((Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ)+2)), p*d ≤ N := by intro p hp d hd have hdmax := (block_sieve_modulus_properties P hP _ hd).2.1 have hprod : (p : ℝ)*(d : ℝ) ≤ Real.exp ((v+(theta-v)/2)*L) := by calc _ ≤ Real.exp (v*L)*((Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ)+2)) := mul_le_mul (hQupper p hp) hdmax (Nat.cast_nonneg d) (Real.exp_pos _).le _ ≤ Real.exp (v*L)*Real.exp (((theta-v)/2)*L) := mul_le_mul_of_nonneg_left hpar.2.2.2.1 (Real.exp_pos _).le _ = _ := by rw [← Real.exp_add] congr 1 ring exact_mod_cast hprod.trans hscale have hs := hsieve P Q (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) N hz hpar.1 hpar.2.1 hP (fun p hp => (mem_erase.mp hp).1) (fun p hp => small_prime_pool_le (Real.exp_pos _).le (mem_of_mem_erase hp)) hQ hQodd hout (fun u _ => candidate_coefficient_nonneg c L hq0 r jStar u) hprodlevel have hmass : (∑ p ∈ Q, ∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => p ∣ 2*u+1 ∧ ∀ q ∈ P, ¬q ∣ 2*u+1), candidateCoefficient c L q r jStar u) = candidatePrimeBandRoughMass c L q r jStar (Real.exp (a*L)) (Real.exp (v*L)) (Real.exp (Real.sqrt L)) := by unfold candidatePrimeBandRoughMass apply sum_congr rfl intro p hp rw [shifted_rough_prime_filter_eq _ (Real.exp_pos _).le] rw [hmass] at hs have hN : (N : ℝ) ≤ Real.exp (theta*L) := Nat.floor_le (Real.exp_pos _).le have herr := hd N hN have herr' : (∑ m ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) m|) ≤ candidateCoefficientWindowMass c L q r jStar * ((1+16*primeEulerProductUpperConstant)*L^(-18 : ℝ)) := by convert herr using 1 <;> ring exact hs.trans (add_le_add le_rfl herr') end Bounty end section /- Finite injection from unbalanced prime-factor proxy sums into candidate prime-band rough mass. -/ open Finset namespace Bounty theorem prime_cofactor_rough_product {W : ℝ} {p m u : ℕ} (hp : p.Prime) (hpW : W < (p : ℝ)) (hprod : p * m = 2 * u + 1) (hm : ∀ q ∈ m.primeFactors, W < (q : ℝ)) : ∀ q ∈ (2 * u + 1).primeFactors, W < (q : ℝ) := by have hm0 : m ≠ 0 := by intro hzero; simp only [hzero, mul_zero] at hprod; omega rw [← hprod, Nat.primeFactors_mul hp.ne_zero hm0, hp.primeFactors] intro q hq rcases mem_union.mp hq with hqp | hqm · simpa only [mem_singleton.mp hqp] using hpW · exact hm q hqm theorem prime_cofactor_to_shifted_index_injective (F : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ) (hpos : ∀ v ∈ F, 0 < v.1) (hprod : ∀ v ∈ F, v.1 * v.2 = 2 * u v + 1) : Set.InjOn (fun v : ℕ × ℕ => (v.1, u v)) F := by intro x hx y hy hxy have hpair : (x.1, u x) = (y.1, u y) := hxy have hp := congrArg (fun z : ℕ × ℕ => z.1) hpair have hu := congrArg (fun z : ℕ × ℕ => z.2) hpair change x.1 = y.1 at hp change u x = u y at hu have hmul : x.1 * x.2 = x.1 * y.2 := by rw [hprod x hx, hp, hprod y hy, hu] exact Prod.ext hp (Nat.eq_of_mul_eq_mul_left (hpos x hx) hmul) theorem finite_prime_factor_proxy_bound (T Q : Finset ℕ) (F : Finset (ℕ × ℕ)) (μ f : ℕ → ℝ) (u : ℕ × ℕ → ℕ) {W C : ℝ} (hC : 0 ≤ C) (hμ : ∀ v ∈ T, 0 ≤ μ v) (hQ : ∀ p ∈ Q, p.Prime ∧ W < (p : ℝ)) (hdata : ∀ v ∈ F, u v ∈ T ∧ v.1 ∈ Q ∧ v.1 * v.2 = 2 * u v + 1) (hf : ∀ v ∈ F, 0 ≤ f v.2 ∧ f v.2 ≤ C) (hrough : ∀ v ∈ F, f v.2 ≠ 0 → ∀ p ∈ v.2.primeFactors, W < (p : ℝ)) : (∑ v ∈ F, μ (u v) * f v.2) ≤ C * ∑ p ∈ Q, ∑ v ∈ (shiftedRoughSet T W).filter (fun v => p ∣ 2 * v + 1), μ v := by classical let G := F.filter (fun v => f v.2 ≠ 0) let H := (Q ×ˢ shiftedRoughSet T W).filter (fun v => v.1 ∣ 2 * v.2 + 1) let φ := fun v : ℕ × ℕ => (v.1, u v) have hinj : Set.InjOn φ G := (prime_cofactor_to_shifted_index_injective F u (fun v hv => (hQ v.1 (hdata v hv).2.1).1.pos) (fun v hv => (hdata v hv).2.2)).mono (filter_subset _ _) have hmap : G.image φ ⊆ H := by intro x hx obtain ⟨v, hv, rfl⟩ := mem_image.mp hx obtain ⟨hvF, hvf⟩ := mem_filter.mp hv obtain ⟨huT, hpQ, hprod⟩ := hdata v hvF obtain ⟨hpp, hpW⟩ := hQ v.1 hpQ have huR : u v ∈ shiftedRoughSet T W := (mem_shifted_rough_set_iff T W (u v)).mpr ⟨huT, prime_cofactor_rough_product hpp hpW hprod (hrough v hvF hvf)⟩ apply mem_filter.mpr refine ⟨mem_product.mpr ⟨hpQ, huR⟩, ?_⟩ change v.1 ∣ 2 * u v + 1 rw [← hprod] exact dvd_mul_right _ _ have hsum : (∑ v ∈ F, μ (u v) * f v.2) = ∑ v ∈ G, μ (u v) * f v.2 := by symm apply sum_subset (filter_subset _ _) intro v hv hnot have hz : f v.2 = 0 := by by_contra hn exact hnot (mem_filter.mpr ⟨hv, hn⟩) rw [hz, mul_zero] have hμsum : (∑ v ∈ G, μ (u v)) ≤ ∑ x ∈ H, μ x.2 := by change (∑ v ∈ G, (fun x : ℕ × ℕ => μ x.2) (φ v)) ≤ _ rw [← sum_image (f := fun x : ℕ × ℕ => μ x.2) hinj] apply sum_le_sum_of_subset_of_nonneg hmap intro x hx hnot have hxR : x.2 ∈ shiftedRoughSet T W := (mem_product.mp (mem_filter.mp hx).1).2 exact hμ x.2 ((mem_shifted_rough_set_iff T W x.2).mp hxR).1 have hH : (∑ x ∈ H, μ x.2) = ∑ p ∈ Q, ∑ v ∈ (shiftedRoughSet T W).filter (fun v => p ∣ 2 * v + 1), μ v := by simp only [H, sum_filter, sum_product] rw [hsum] calc _ ≤ ∑ v ∈ G, μ (u v) * C := by apply sum_le_sum intro v hv have hvF := (mem_filter.mp hv).1 exact mul_le_mul_of_nonneg_left (hf v hvF).2 (hμ (u v) (hdata v hvF).1) _ = C * ∑ v ∈ G, μ (u v) := by rw [← sum_mul, mul_comm] _ ≤ C * ∑ x ∈ H, μ x.2 := mul_le_mul_of_nonneg_left hμsum hC _ = _ := by rw [hH] theorem rough_test_logarithmic_proxy_nonneg (γ L S : ℝ) (n : ℕ) : 0 ≤ roughTestLogarithmicProxy γ L S n := rough_test_cell_proxy_nonneg γ L S (logarithmicCellBase (L ^ (-S)) (logarithmicCellIndex (L ^ (-S)) n)) n theorem rough_test_logarithmic_proxy_le_coefficient {γ L S C : ℝ} (hC : 0 ≤ C) {n : ℕ} (hcoef : roughTestCellProxyCoefficient γ L S (logarithmicCellBase (L ^ (-S)) (logarithmicCellIndex (L ^ (-S)) n)) ≤ C) : roughTestLogarithmicProxy γ L S n ≤ C := by unfold roughTestLogarithmicProxy roughTestCellProxy split · exact hcoef · exact hC theorem rough_test_logarithmic_proxy_support {γ L S : ℝ} {n : ℕ} (hn : roughTestLogarithmicProxy γ L S n ≠ 0) : ∀ p ∈ n.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ) := by have hmem := rough_test_cell_proxy_ne_zero_mem (show roughTestCellProxy γ L S (logarithmicCellBase (L ^ (-S)) (logarithmicCellIndex (L ^ (-S)) n)) n ≠ 0 from hn) exact (mem_filter.mp hmem).2 theorem candidate_prime_factor_proxy_bound {c L q A B W C : ℝ} (r jStar : ℕ) (hq : 0 ≤ q) (hA : 0 ≤ A) (hB : 0 ≤ B) (hWA : W ≤ A) (hC : 0 ≤ C) (F : Finset (ℕ × ℕ)) (f : ℕ → ℝ) (u : ℕ × ℕ → ℕ) (hdata : ∀ v ∈ F, u v ∈ arithmeticProductWindow 1 (Real.exp L) ∧ v.1 ∈ primeBand A B ∧ v.1 * v.2 = 2 * u v + 1) (hf : ∀ v ∈ F, 0 ≤ f v.2 ∧ f v.2 ≤ C) (hrough : ∀ v ∈ F, f v.2 ≠ 0 → ∀ p ∈ v.2.primeFactors, W < (p : ℝ)) : (∑ v ∈ F, candidateCoefficient c L q r jStar (u v) * f v.2) ≤ C * candidatePrimeBandRoughMass c L q r jStar A B W := by apply finite_prime_factor_proxy_bound (arithmeticProductWindow 1 (Real.exp L)) (primeBand A B) F (candidateCoefficient c L q r jStar) f u hC (fun n hn => candidate_coefficient_nonneg c L hq r jStar n) _ hdata hf hrough intro p hp obtain ⟨hpp, hAp, _⟩ := (mem_primeBand_iff hA hB p).mp hp exact ⟨hpp, hWA.trans_lt hAp⟩ end Bounty end section /- Exact original event rows with the chronological owner indicator. -/ open Finset Classical namespace Bounty section Rows variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedBirthAddress S B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Rows end Bounty end section /- Exact normalization of the physical mixed parameters to the big-factor-first order used by the candidate omission and dirty-energy estimates. -/ namespace Bounty section variable {S G : Type*} [sharedInstance1 : Fintype S] [sharedInstance2 : Fintype G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) include S G sharedInstance1 sharedInstance2 Ps P J ell C theorem physical_mixed_edge_D_big_first (d : PhysicalSharedLists Ps J) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) (g : G) : physicalMixedEdgeD C d c aux g = (physicalFullSharedD C c aux * physicalSharedProduct d : ℕ) := by unfold physicalMixedEdgeD physicalMixedSharedD rw [Nat.mul_comm] theorem physical_mixed_edge_delta_big_first (k : ℤ) (d : PhysicalSharedLists Ps J) (c : SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C g))) (aux : PhysicalAuxLabels P C) (g : G) : physicalMixedEdgeDelta C k d c aux g = -(k * (physicalFullSharedD C c aux * physicalSharedProduct d : ℕ)) := by rw [physicalMixedEdgeDelta, physical_mixed_edge_D_big_first, neg_mul] end end Bounty end section /- Both adjacent active-slot averages absorb the physical/canonical encoding change. The initial forbidden sets are fixed throughout the averages. -/ open Finset open scoped Classical namespace Bounty theorem physical_mixed_clean_initial_projected_reencode {S G : Type*} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ g (p : P g), NeZero p.val] (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) (hPs : ∀ s p, p ∈ Ps s → 0 < p) (hP : ∀ g p, p ∈ P g → 0 < p) : cleanFullMemoryActiveMap (physicalMixedCleanInitialAction initial V b C ζ θ ρ k K d (cleanFullMemoryActiveMap f)) = cleanFullMemoryActiveMap (cleanFullMemoryInitialEventAction initial V b C ζ θ ρ k (canonicalMixedEdgeD C d) K d (cleanFullMemoryActiveMap f)) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) have hin : (fun y r => cleanFullMemoryActiveMap f ((fullActivePermutation (cleanPhysicalSlotChange C)).symm y) r) = cleanFullMemoryActiveMap f := by funext y r exact fullActiveAverage_invariant (fun z => f z r) (fun g => (cleanPhysicalSlotChange C g).symm) y have hs : ∀ r, ProductMemorySymmetric (fun x => cleanFullMemoryActiveMap f x r) := fun r => fullActiveAverage_symmetric (fun x => f x r) (hf r) have he (r : PhysicalResidues Ps) : (fun x => physicalMixedCleanInitialAction initial V b C ζ θ ρ k K d (cleanFullMemoryActiveMap f) (fullActivePermutation (cleanPhysicalSlotChange C) x) r) = (fun x => cleanFullMemoryInitialEventAction initial V b C ζ θ ρ k (canonicalMixedEdgeD C d) K d (cleanFullMemoryActiveMap f) x r) := by funext x have h := physical_mixed_clean_initial_action_reencode initial V b C ζ θ ρ k K d (cleanFullMemoryActiveMap f) hs hPs hP x r rw [hin] at h exact h funext x r have ha := fullActiveAverage_absorb_input_permutation (fun y => physicalMixedCleanInitialAction initial V b C ζ θ ρ k K d (cleanFullMemoryActiveMap f) y r) (cleanPhysicalSlotChange C) rw [he r] at ha exact (congrFun ha x).symm end Bounty end section /- Isolate the actual retained residual phase without removing initial-ledger avoidance. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (steps : List (Option (J ⊕ K))) (initial : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → (g : Fin N) → Finset (P g)) end Full end Bounty end section /- Bounded character slices for the actual smooth off-diagonal energy. -/ open Finset open scoped ComplexConjugate namespace Bounty noncomputable def typeIIRealCharacterAverage (M H Z : Finset ℕ) (k : ℤ) [NeZero (2 * k.natAbs)] (η : ℝ → ℝ → ℝ) (α aH : ℕ → ℂ) : ℂ := (1 / ((2 * k.natAbs).totient : ℂ)) * ∑ χ : DirichletCharacter ℂ (2 * k.natAbs), ∑ y ∈ typeIICrossSlice M H Z k, typeIIRealShiftWeight η α aH y * χ (y.2.1.1 : ZMod (2 * k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2 * k.natAbs))) noncomputable def typeIIRealCharacterSlice (M H Z : Finset ℕ) (k : ℤ) (η : ℝ → ℝ → ℝ) (α aH : ℕ → ℂ) : ℂ := if hk : k = 0 then 0 else @typeIIRealCharacterAverage M H Z k ⟨by simpa only [ne_eq, mul_eq_zero, OfNat.ofNat_ne_zero, false_or, Int.natAbs_eq_zero] using hk⟩ η α aH theorem typeII_smooth_character_slice_eq (E N M H Z : Finset ℕ) (k : ℤ) (η : ℝ → ℝ → ℝ) (α aH : ℕ → ℂ) {W : ℝ} (hW : 2 ≤ W) (hM : ∀ m ∈ M, 0 < m) (hrough : ∀ m ∈ M, ∀ p ∈ m.primeFactors, W < (p : ℝ)) (hsmall : (k.natAbs : ℝ) ≤ W) (hpos : ∀ e n, η e n ≠ 0 → 0 < e) (hmem : ∀ e n : ℕ, η e n ≠ 0 → e ∈ E ∧ n ∈ N) : (∑ y ∈ typeIIDeterminantDomain E N M H {k} Z, typeIIShiftWeight (fun e n => η e n) α aH y) = (typeIIRealCharacterSlice M H Z k η α aH).re := by classical by_cases hk : k = 0 · subst k rw [typeII_zero_determinant_slice] simp [typeIIRealCharacterSlice] · rw [typeIIRealCharacterSlice, dif_neg hk] have hs := @typeII_smooth_determinant_character_sum E N M H Z k ⟨by simpa only [ne_eq, mul_eq_zero, OfNat.ofNat_ne_zero, false_or, Int.natAbs_eq_zero] using hk⟩ η α aH W hW hM hrough hsmall hpos hmem have hr := congrArg Complex.re hs simpa only [Complex.re_sum, typeII_shift_complex_weight_re, typeIIRealCharacterAverage] using hr theorem typeII_smooth_off_diagonal_bounded (E N M H : Finset ℕ) (η : ℝ → ℝ → ℝ) (α aH : ℕ → ℂ) {Elo U W : ℝ} {B : ℕ} (hElo : 0 < Elo) (hE : ∀ e ∈ E, Elo ≤ (e : ℝ)) (hMpos : ∀ m ∈ M, 0 < m) (hM : ∀ m ∈ M, (m : ℝ) ≤ U) (hB : U / (2 * Elo) ≤ B) (hBW : (B : ℝ) ≤ W) (hW : 2 ≤ W) (hrough : ∀ m ∈ M, α m ≠ 0 → ∀ p ∈ m.primeFactors, W < (p : ℝ)) (hpos : ∀ e n, η e n ≠ 0 → 0 < e) (hmem : ∀ e n : ℕ, η e n ≠ 0 → e ∈ E ∧ n ∈ N) : typeIIOffDiagonalEnergy E N M H (fun e n => η e n) α aH = ∑ k ∈ Icc (-(B : ℤ)) B, (typeIIRealCharacterSlice (M.filter (fun m => α m ≠ 0)) H (Icc 0 ((M.filter (fun m => α m ≠ 0)).sup id * H.sup id)) k η α aH).re := by classical rw [typeII_off_diagonal_energy_eq_supported_determinant_sum E N M H (fun e n => η e n) α aH hElo hE hM hB hBW hrough, typeII_determinant_sum_slices] apply sum_congr rfl intro k hk apply typeII_smooth_character_slice_eq _ _ _ _ _ _ _ _ _ hW · intro m hm exact hMpos m (mem_filter.mp hm).1 · intro m hm exact hrough m (mem_filter.mp hm).1 (mem_filter.mp hm).2 · have hi : |k| ≤ (B : ℤ) := abs_le.mpr (mem_Icc.mp hk) rw [← Int.natCast_natAbs] at hi have hr : (k.natAbs : ℝ) ≤ B := by exact_mod_cast hi exact hr.trans hBW · exact hpos · exact hmem theorem typeII_majorant_off_diagonal_bounded (M H : Finset ℕ) (α aH : ℕ → ℂ) {L E V U W : ℝ} {B : ℕ} (hL : 0 < L) (hE : 0 < E) (hV : 0 < V) (hMpos : ∀ m ∈ M, 0 < m) (hM : ∀ m ∈ M, (m : ℝ) ≤ U) (hB : U / (2 * (E / (2 * L ^ 88))) ≤ B) (hBW : (B : ℝ) ≤ W) (hW : 2 ≤ W) (hrough : ∀ m ∈ M, α m ≠ 0 → ∀ p ∈ m.primeFactors, W < (p : ℝ)) : typeIIOffDiagonalEnergy (Icc ⌈E / (2 * L ^ 88)⌉₊ ⌊2 * E⌋₊) (Icc ⌈V / 2⌉₊ ⌊3 * V⌋₊) M H (fun e n => typeIIEMajorant (L ^ 88) ((e : ℝ) / E) * typeIINMajorant ((n : ℝ) / V)) α aH = ∑ k ∈ Icc (-(B : ℤ)) B, (typeIIRealCharacterSlice (M.filter (fun m => α m ≠ 0)) H (Icc 0 ((M.filter (fun m => α m ≠ 0)).sup id * H.sup id)) k (fun e n => typeIIEMajorant (L ^ 88) (e / E) * typeIINMajorant (n / V)) α aH).re := by have hlo : ∀ e ∈ Icc ⌈E / (2 * L ^ 88)⌉₊ ⌊2 * E⌋₊, E / (2 * L ^ 88) ≤ (e : ℝ) := by intro e he exact (Nat.le_ceil _).trans (by exact_mod_cast (mem_Icc.mp he).1) apply typeII_smooth_off_diagonal_bounded _ _ M H (fun e n => typeIIEMajorant (L ^ 88) (e / E) * typeIINMajorant (n / V)) α aH (by positivity) hlo hMpos hM hB hBW hW hrough · intro e n hne exact (typeII_majorant_real_support hL hE hV hne).1 · exact typeII_majorant_integer_support hL hE hV end Bounty end section /- Actual cross-product scale bounds on the support of the smooth majorants. -/ namespace Bounty theorem typeII_real_cross_equation {m m' h z k : ℝ} (hm : m ≠ 0) (hm' : m' ≠ 0) (hk : k ≠ 0) (hz : z = m' * h) : m * ((m' - m) * z / (k * m * m') + 1 / m) = 2 * ((m' - m) / (2 * k)) * h + 1 := by rw [hz] field_simp theorem typeII_cross_scale_range {U V E P m m' e n h z : ℝ} (hU : 0 < U) (hV : 0 < V) (hE : 0 < E) (hP : 0 < P) (hUV : 4 ≤ U * V) (hm : m ∈ Set.Icc U (2 * U)) (hm' : m' ∈ Set.Icc U (2 * U)) (he : e ∈ Set.Ioo (E / (2 * P)) (2 * E)) (hn : n ∈ Set.Ioo (V / 2) (3 * V)) (heq : m * n = 2 * e * h + 1) (hz : z = m' * h) : U ^ 2 * V / (16 * E) < z ∧ z < 12 * U ^ 2 * V * P / E := by have hm0 : 0 < m := hU.trans_le hm.1 have he0 : 0 < e := lt_trans (by positivity) he.1 have hmnlo : U * V / 2 < m * n := by calc U * V / 2 = U * (V / 2) := by ring _ ≤ m * (V / 2) := mul_le_mul_of_nonneg_right hm.1 (by positivity) _ < m * n := mul_lt_mul_of_pos_left hn.1 hm0 have hmnhi : m * n < 6 * U * V := by calc m * n < m * (3 * V) := mul_lt_mul_of_pos_left hn.2 hm0 _ ≤ (2 * U) * (3 * V) := mul_le_mul_of_nonneg_right hm.2 (by positivity) _ = 6 * U * V := by ring have hehpos : 0 < e * h := by nlinarith have hh : 0 < h := (mul_pos_iff_of_pos_left he0).mp hehpos have hlo : U * V / 16 < E * h := by have hbound := mul_lt_mul_of_pos_right he.2 hh nlinarith have hhi : E * h < 6 * U * V * P := by have helow : E < 2 * P * e := by have hh := (div_lt_iff₀ (by positivity : 0 < 2 * P)).mp he.1 nlinarith have hbound := mul_lt_mul_of_pos_right helow hh have hproduct := mul_lt_mul_of_pos_right hmnhi hP nlinarith [heq] have hElow : U ^ 2 * V / 16 < E * z := by have ha := mul_lt_mul_of_pos_left hlo hU have hb := mul_le_mul_of_nonneg_right hm'.1 (mul_nonneg hE.le hh.le) rw [hz] nlinarith have hEhigh : E * z < 12 * U ^ 2 * V * P := by have ha := mul_lt_mul_of_pos_left hhi (by positivity : 0 < 2 * U) have hb := mul_le_mul_of_nonneg_right hm'.2 (mul_nonneg hE.le hh.le) rw [hz] nlinarith constructor · apply (div_lt_iff₀ (by positivity : 0 < 16 * E)).mpr nlinarith · apply (lt_div_iff₀ hE).mpr nlinarith theorem typeII_majorant_cross_scale_range {y : TypeIIShiftIndex} {L U V E : ℝ} (hL : 0 < L) (hU : 0 < U) (hV : 0 < V) (hE : 0 < E) (hUV : 4 ≤ U * V) (hk : y.1.1 ≠ 0) (hm : (y.2.1.1 : ℝ) ∈ Set.Icc U (2 * U)) (hm' : (y.2.2.1 : ℝ) ∈ Set.Icc U (2 * U)) (hz : y.1.2 = y.2.2.1 * y.2.1.2) (hne : typeIIEMajorant (L ^ 88) (typeIIRealE y / E) * typeIINMajorant (typeIIRealN y / V) ≠ 0) : U ^ 2 * V / (16 * E) < (y.1.2 : ℝ) ∧ (y.1.2 : ℝ) < 12 * U ^ 2 * V * L ^ 88 / E := by obtain ⟨he, he', hn, hn'⟩ := typeII_majorant_real_box hL hE hV hne have hzr : (y.1.2 : ℝ) = (y.2.2.1 : ℝ) * y.2.1.2 := by exact_mod_cast hz have heq := typeII_real_cross_equation (k := (y.1.1 : ℝ)) (hU.trans_le hm.1).ne' (hU.trans_le hm'.1).ne' (by exact_mod_cast hk) hzr exact typeII_cross_scale_range hU hV hE (pow_pos hL _) hUV hm hm' ⟨he, he'⟩ ⟨hn, hn'⟩ heq hzr end Bounty end section /- Exact retained coefficient separation for the truncated active-slot integrals. -/ open Finset Filter MeasureTheory namespace Bounty section variable (c L : ℝ) (r jStar : ℕ) (R T : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (F : ℕ → ℕ → ℂ) include c L r jStar R T take F theorem candidate_separated_allocation_box_integrable : Integrable (candidateSeparatedAllocationIntegrand c L r jStar R take F) (activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) T) := by have h := (integrable_finsetSum (s := (univ : Finset (∀ slot, candidateQSlotChoices c L r jStar slot))) (fun x hx => (active_allocation_box_integrable (candidateAllocationRadius r) R T (fun i => Real.log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) take).mul_const (F (candidateAllocatedFactor c L r jStar x take) (candidateRetainedFactor c L r jStar 1 x take)))).div_const (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ) exact h.congr (Filter.Eventually.of_forall (candidate_separated_allocation_integrand_eq c L r jStar R take F)) theorem candidate_slot_box_integral : ((∑ x : ∀ slot, candidateQSlotChoices c L r jStar slot, (∫ ξ, activeAllocationFourierIntegrand (candidateAllocationRadius r) R (fun i => Real.log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) take ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) T) * F (candidateAllocatedFactor c L r jStar x take) (candidateRetainedFactor c L r jStar 1 x take)) / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ)) = ∫ ξ, candidateSeparatedAllocationIntegrand c L r jStar R take F ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) T := by symm calc _ = ∫ ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ, (∑ x : ∀ slot, candidateQSlotChoices c L r jStar slot, activeAllocationFourierIntegrand (candidateAllocationRadius r) R (fun i => Real.log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) take ξ * F (candidateAllocatedFactor c L r jStar x take) (candidateRetainedFactor c L r jStar 1 x take)) / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ) ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) T := integral_congr_ae (Filter.Eventually.of_forall (fun ξ => (candidate_separated_allocation_integrand_eq c L r jStar R take F ξ).symm)) _ = _ := by rw [integral_div, integral_finsetSum] · simp only [integral_mul_const] · intro x hx exact (active_allocation_box_integrable _ _ _ _ _ _ _).mul_const _ end theorem eventually_candidate_retained_box_integral {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (R T : ℝ) (S : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool), (∀ p ∈ S, p ∈ Nat.factoredNumbers ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) → ∀ F : ℕ → ℕ → ℂ, Integrable (candidateRetainedAllocationIntegrand c L q r jStar R S take F) (activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) T) ∧ (∑ p ∈ S, (candidatePWeight c L q p : ℂ) * ((∑ x : ∀ slot, candidateQSlotChoices c L r jStar slot, (∫ ξ, activeAllocationFourierIntegrand (candidateAllocationRadius r) R (fun i => Real.log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) take ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) T) * F (candidateAllocatedFactor c L r jStar x take) (candidateRetainedFactor c L r jStar p x take)) / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ))) = ∫ ξ, candidateRetainedAllocationIntegrand c L q r jStar R S take F ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) T := by filter_upwards [eventually_candidate_retained_allocation_integrand_eq hc] with L heq intro q r jStar R T S take hS F have hint : Integrable (candidateFullPAllocationIntegrand c L q r jStar R S take F) (activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) T) := by apply integrable_finsetSum intro p hp exact (candidate_separated_allocation_box_integrable c L r jStar R T take (fun e n => F e (p*n))).const_mul _ refine ⟨hint.congr (Filter.Eventually.of_forall (heq q r jStar R S take hS F)), ?_⟩ calc _ = ∫ ξ, candidateFullPAllocationIntegrand c L q r jStar R S take F ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) T := by unfold candidateFullPAllocationIntegrand rw [integral_finsetSum] · apply sum_congr rfl intro p hp rw [integral_const_mul] congr 1 simp_rw [candidate_retained_factor_eq_mul_one c L r jStar p] exact candidate_slot_box_integral c L r jStar R T take (fun e n => F e (p*n)) · intro p hp exact (candidate_separated_allocation_box_integrable c L r jStar R T take (fun e n => F e (p*n))).const_mul _ _ = _ := integral_congr_ae (Filter.Eventually.of_forall (heq q r jStar R S take hS F)) end Bounty end section /- Remove the original sharp window and truncate the allocation Fourier integrals together. -/ open Finset Filter MeasureTheory Real namespace Bounty end Bounty end section /- Expand original ledger freshness on common initial and event addresses, retaining the exact dependent paths and all local residual coefficients. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) theorem full_mixed_common_ledger_forest_expansion {Ω : Type*} (hedge : ∀ k H x e, edgePhase k H x e = (if FullMixedLocalBirthAvoids (J := J) n S B A Δ D H (some (.inr k)) x e ∧ FullMixedLocalBirthDistinct (J := J) n S B A Δ D (some (.inr k)) x e then 1 else 0) * edgePhase k (fun _ => ∅) x e) (paths : Finset Ω) (x : Ω → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : ∀ a, FullPermutationMixedPath n S B A Δ D steps (x a)) (hx : ∀ a ∈ paths, FullActiveInjective (x a)) (hcover : ∀ a ∈ paths, FullMixedLedgerCovers n B (fullActiveInitialLedger (x a), x a)) (F : Ω → ℂ) (encode : ((g : Fin N) × P g) → ℤ) (hencode : Function.Injective encode) : (∑ a ∈ paths, F a * (finiteEventPathWeight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps (x a) (p a) : ℂ) * fullMixedLedgerInducedPhase n S B A Δ D steps fullActiveInitialLedger (finiteEventLocalPhase (fun tag (s : FullMixedLedgerState n (M := M) B) => FullPermutationMixedEvent n S B A Δ D tag s.2) (fullMixedLedgerTarget n S B A Δ D) (fullMixedLedgerPhase n S B A Δ D edgePhase) steps) (x a) (p a)) = ∑ code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps)), (-1 : ℂ) ^ birthForestRank code * birthForestPathSum paths (fun a => F a * fullMixedCommonResidualWeight n S B A Δ D edgePhase ω μ q ρ V steps (x a) (p a)) (fun a => fullMixedCommonIndexedPerformed n S B A Δ D steps (x a) (p a)) (fun a => fullMixedCommonIndexedValue n S B A Δ D steps encode (x a) (p a)) code := by rw [← full_mixed_common_path_forest_expansion n S B A Δ D steps paths x p hx encode hencode (fun a => F a * fullMixedCommonResidualWeight n S B A Δ D edgePhase ω μ q ρ V steps (x a) (p a))] apply sum_congr rfl intro a ha rw [mul_assoc, full_mixed_physical_weighted_phase_factor n S B A Δ D edgePhase hedge ω μ q ρ V steps fullActiveInitialLedger (x a) (p a) (hcover a ha)] unfold fullMixedCommonResidualWeight ring end Full end Bounty end section /- A common forest coefficient is an actual original path action with no root-ledger gate left in its residual factor. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) end Full end Bounty end section /- Exact assembly of the original auxiliary draws after small-prefix conditioning. The source is read in canonical coordinates, while the event, both total-memory cutoffs, and the residue translation remain physical. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type*} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} noncomputable def physicalMixedCleanPrefixPhase (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (a : PhysicalAuxLabels P C) (d : PhysicalSharedLists Ps J) (x : CleanFullMemoryState P J ell B) (_r : PhysicalResidues Ps) (e : PhysicalSmallBigFullEvent (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) d x) : ℂ := let source := (cleanFullMemoryEquiv P J ell B ((fullActivePermutation (cleanPhysicalSlotChange C)).symm x)).2.2.1 let Sp := fun g => physicalFullSharedIndices (ell := ell) (C g) let cp := (productActiveMemorySplit Sp B x).1 let sp := (productActiveMemorySplit Sp B x).2 let fresh := physicalCleanFreshEquiv (fun g => ↥(P g)) C (fun g => (unrestrictedJointEventTarget (fun g (p : P g) => p.val) (physicalMixedEdgeDelta C k d cp a) (physicalMixedEdgeD C d cp a) (fun g => (Sp g)ᶜ.card) B sp e.2 g).1) let target := repeatedBigFill C source (cleanFullFreshEquiv P C fresh) if repeatedBigAuxAvoids C a source ∧ repeatedBigAuxAvoids C a target then K source target a * physicalPhase ζ (physicalMixedSharedD C d cp a) * physicalReturnPhase θ (physicalMixedBigStep C k cp a * (physicalSharedProduct d : ℕ)) else 0 variable [∀ g (p : P g), NeZero p.val] theorem physical_mixed_clean_aux_sum_eq_action (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (x : CleanFullMemoryState P J ell B) (r : PhysicalResidues Ps) : (∑ a : PhysicalAuxLabels P C, (physicalAuxMass V C a : ℂ) * fullActiveExternalCoefficientAction (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun _ => Unit) (fun c _ => physicalMixedEdgeDelta C k d c a) (fun c _ => physicalMixedEdgeD C d c a) (fun _ _ => 1) (fun g => tiltedPhysicalBirthLaw V g (b g)) ρ V (fun c _ => physicalResidueTranslationEquiv (P := Ps) (physicalMixedBigStep C k c a * (physicalSharedProduct d : ℕ))) (physicalSmallBigCleanInitialPhase (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) initial (physicalMixedCleanPrefixPhase C ζ θ k K a) d) f x r) = physicalMixedCleanInitialAction initial V b C ζ θ ρ k K d f x r := by unfold physicalMixedCleanInitialAction fullActiveExternalCoefficientAction rw [Fintype.sum_sigma] apply sum_congr rfl intro a _ rw [Fintype.sum_sigma] simp only [Fintype.sum_unique, mul_sum] apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ simp only [fullActiveEdgeEventWeight, one_mul, Complex.ofReal_mul, physicalSmallBigCleanInitialPhase, physicalMixedCleanPrefixPhase, fullActiveEdgeEventTarget, physicalResidueTranslationEquiv, Equiv.coe_fn_mk] split_ifs <;> ring end end Bounty end section /- The allocation gap is chosen after every pre-Cauchy coefficient exponent. -/ open Real namespace Bounty theorem typeII_diagonal_scalar_saving {L K U V aE aN aM aH D : ℝ} (hL : 2 ≤ L) (hK : 2*aE+2*aN+2*aM+2*aH+17+D ≤ K) : (2*(U*L^(-K))*V*(L^aE)^2*(L^aN)^2) * ((L^aM)^2*(L^aH)^2*((U*V)*L^(16 : ℝ))) ≤ (U*V)^2*L^(-D) := by have hL0 : 0 < L := by linarith let s : ℝ := -K+aE*2+aN*2+aM*2+aH*2+16 have heq : (2*(U*L^(-K))*V*(L^aE)^2*(L^aN)^2) * ((L^aM)^2*(L^aH)^2*((U*V)*L^(16 : ℝ))) = 2*(U*V)^2*L^s := by dsimp [s] have hs (a : ℝ) : L^(a*2) = (L^a)^2 := by simpa only [Nat.cast_ofNat] using rpow_mul_natCast hL0.le a 2 simp only [rpow_add hL0, hs] ring rw [heq] calc _ ≤ L*(U*V)^2*L^s := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hL (sq_nonneg _)) (rpow_nonneg hL0.le _) _ = (U*V)^2*L^(1+s) := by rw [rpow_add hL0 1 s, rpow_one]; ring _ ≤ _ := mul_le_mul_of_nonneg_left (rpow_le_rpow_of_exponent_le (by linarith) (by dsimp [s]; linarith)) (sq_nonneg _) end Bounty end section /- Remove the original sharp window and truncate the allocation Fourier integrals together. -/ open Finset Filter MeasureTheory Real namespace Bounty theorem exists_candidate_original_finite_mellin_reduction {c b q : ℝ} (hc : 0 < c) (hb : 0 < b) (hq0 : 0 ≤ q) (hq1 : q < 1) (R : ℝ) (hR : 1 ≤ R) {r : ℕ} (hr : 6 ≤ r) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ A D : ℝ, ∃ B : ℝ, 1 ≤ B ∧ ∃ K : ℝ, 0 < K ∧ ∀ᶠ L : ℝ in atTop, ∀ (E : ℝ) (S : Finset ℕ) (F : ℕ → ℕ → ℂ), (∀ u ∈ S, 0 < u ∧ (u : ℝ) ≤ R*exp L) → arithmeticProductWindow 1 (exp L) ⊆ S → 1 ≤ E → log E ≤ (1-b)*L → (∀ u, ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → (∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ¬(∀ p ∈ m.primeFactors, exp (sqrt L) ≤ (p : ℝ)) → F u m = 0) → Integrable (candidateFiniteMellinIntegrand c L q r jStar E B S F) ∧ ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCoefficient c L q r jStar u : ℂ)*∑ m ∈ (2*u+1).divisors, F u m) - (∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ L^K}, candidateFiniteMellinIntegrand c L q r jStar E B S F ξ)‖ ≤ exp L*L^(-D) := by obtain ⟨J,hJ⟩ := exists_candidate_original_box_reduction hc hb hq0 hq1 hr refine ⟨J,fun jStar hj A D => ?_⟩ have hr0 : 0 < r := by omega obtain ⟨B,hB,hsmooth⟩ := exists_candidate_actual_window_smoothing_error_bound hc hr0 hq0 hq1 A (D+1) obtain ⟨K,hK,htrunc⟩ := exists_candidate_finite_smooth_mellin_bound hc hr0 hq0 hq1 R hR B (by linarith) A (D+1) refine ⟨B,hB,K,hK,?_⟩ filter_upwards [hJ jStar hj A (D+1), hsmooth, htrunc, eventually_ge_atTop (3 : ℝ)] with L hboxL hsL htL hL intro E S F hS hSW hE hlogE hF hsupp have hL0 : 0 < L := by linarith let Fψ : ℕ → ℕ → ℂ := fun u m => (typeIIWindowSmooth (L^(-B)) ((u : ℝ)/exp L) : ℂ)*F u m have hψF : ∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ‖Fψ u m‖ ≤ L^A := by intro u hu m hm dsimp only [Fψ] rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (typeII_window_smooth_bounds _ _).1] exact (mul_le_mul_of_nonneg_right (typeII_window_smooth_bounds _ _).2 (norm_nonneg _)).trans (by simpa only [one_mul] using hF u m hm) have hψsupp : ∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ¬(∀ p ∈ m.primeFactors, exp (sqrt L) ≤ (p : ℝ)) → Fψ u m = 0 := by intro u hu m hm hp simp only [Fψ, hsupp u hu m hm hp, mul_zero] have hs := hsL jStar (S) F hSW hF have ha := hboxL E Fψ hE hlogE hψF hψsupp change ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCoefficient c L q r jStar u : ℂ) * ∑ m ∈ (2*u+1).divisors, (typeIIWindowSmooth (L^(-B)) ((u : ℝ)/exp L) : ℂ)*F u m) - (∑ u ∈ arithmeticProductWindow 1 (exp L), candidateBoxRangeCoefficient c L q r jStar E L u * ∑ m ∈ (2*u+1).divisors, (typeIIWindowSmooth (L^(-B)) ((u : ℝ)/exp L) : ℂ)*F u m)‖ ≤ _ at ha rw [← typeII_finite_smooth_divisor_sum_restrict hL0 S hSW, ← typeII_finite_smooth_divisor_sum_restrict hL0 S hSW] at ha have ht := htL jStar E S F hS (fun u hu m hm => hF u m hm) refine ⟨candidate_finite_mellin_integrable c L q r jStar E B S F (fun u hu => (hS u hu).1), ?_⟩ let s₁ : ℂ := ∑ u ∈ S, (candidateCoefficient c L q r jStar u : ℂ) * (typeIIWindowSmooth (L^(-B)) ((u : ℝ)/exp L) : ℂ) * ∑ m ∈ (2*u+1).divisors, F u m let s₂ : ℂ := ∑ u ∈ S, candidateBoxRangeCoefficient c L q r jStar E L u * (typeIIWindowSmooth (L^(-B)) ((u : ℝ)/exp L) : ℂ) * ∑ m ∈ (2*u+1).divisors, F u m calc _ ≤ ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCoefficient c L q r jStar u : ℂ)*∑ m ∈ (2*u+1).divisors, F u m)-s₁‖ + ‖s₁-(∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ L^K}, candidateFiniteMellinIntegrand c L q r jStar E B S F ξ)‖ := norm_sub_le_norm_sub_add_norm_sub _ s₁ _ _ ≤ exp L*L^(-(D+1)) + (‖s₁-s₂‖ + ‖s₂-(∫ ξ in {ξ : ℝ | ‖ξ‖ ≤ L^K}, candidateFiniteMellinIntegrand c L q r jStar E B S F ξ)‖) := add_le_add hs (norm_sub_le_norm_sub_add_norm_sub _ s₂ _) _ ≤ exp L*L^(-(D+1)) + (exp L*L^(-(D+1)) + exp L*L^(-(D+1))) := add_le_add le_rfl (add_le_add ha ht) _ = 3*(exp L*L^(-(D+1))) := by ring _ ≤ L*(exp L*L^(-(D+1))) := mul_le_mul_of_nonneg_right hL (by positivity) _ = exp L*(L^(1:ℝ)*L^(-(D+1))) := by rw [rpow_one]; ring _ = exp L*L^(-D) := by rw [← rpow_add hL0]; congr 2; ring end Bounty end section /- The exact performed coordinates of an original event exhaust its written common slots, including the none extension at shared slots. -/ namespace Bounty section Index variable {J K : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) theorem full_mixed_common_index_stage_succ_iff : fullMixedCommonIndexStage M B steps i = u.succ ↔ ∃ a, fullMixedCommonBirthOrder M B steps i = .inr ⟨u, a⟩ := by unfold fullMixedCommonIndexStage cases h : fullMixedCommonBirthOrder M B steps i with | inl a => constructor · intro he exact ((Fin.succ_ne_zero u) he.symm).elim · rintro ⟨b, hb⟩ cases hb | inr a => rcases a with ⟨v, a⟩ constructor · intro hv have hv' : v = u := Fin.succ_injective _ hv subst v exact ⟨a, rfl⟩ · rintro ⟨b, hb⟩ have hv : v = u := congrArg Sigma.fst (Sum.inr.inj hb) subst v rfl theorem full_mixed_common_history_owner_ne (h : fullMixedCommonIndexStage M B steps i ≠ u.succ) : fullMixedCommonOwner M B steps (fullMixedCommonBirthOrder M B steps i) ≠ some u := by intro he apply h unfold fullMixedCommonIndexStage cases ha : fullMixedCommonBirthOrder M B steps i with | inl a => simp [ha, fullMixedCommonOwner] at he | inr a => have hv : a.1 = u := by simpa only [ha, fullMixedCommonOwner, Option.some.injEq] using he exact congrArg Fin.succ hv end Index section Local variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (tag : Option (J ⊕ K)) (htag : steps.get u = tag) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) theorem full_mixed_common_tagged_history_write_here (a : FullMixedLocalBirthAddress S B tag) : fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u tag htag s e) history (fullMixedCommonOldIndexEmbedding S B steps (fullMixedTaggedOccurrenceEmbedding S B steps u tag htag a)) = fullMixedEventBirthLabel n S B A Δ D tag s e a := by subst tag change fullMixedCommonHistoryWrite n S B A Δ D steps u s e history ((fullMixedCommonBirthOrder M B steps).symm (.inr (fullMixedCommonStepEmbedding S B steps (fullMixedBirthOrder S B steps ((fullMixedBirthOrder S B steps).symm ⟨u, a⟩))))) = _ rw [Equiv.apply_symm_apply] exact (full_mixed_common_history_write_here n S B A Δ D steps u s e history (fullMixedCommonLocalEmbedding S B (steps.get u) a)).trans (full_mixed_common_event_label_embed n S B A Δ D (steps.get u) s e a) theorem full_mixed_common_tagged_history_write_coverage (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : ((fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u tag htag s e) history i).isSome = true ∧ fullMixedCommonIndexStage M B steps i = u.succ) ↔ ∃ c : FullMixedEventBirthCoordinate n S B A Δ D tag s e, fullMixedCommonOldIndexEmbedding S B steps (fullMixedTaggedOccurrenceEmbedding S B steps u tag htag (fullMixedBirthCoordinateEquiv n S B A Δ D tag s e c).val) = i := by constructor · rintro ⟨hi, hu⟩ subst tag obtain ⟨a, ha⟩ := (full_mixed_common_index_stage_succ_iff M B steps u i).mp hu have hi' : i = (fullMixedCommonBirthOrder M B steps).symm (.inr ⟨u, a⟩) := by rw [← ha, Equiv.symm_apply_apply] rw [hi', full_mixed_common_history_write_here] at hi have hp : fullMixedCommonEventBirthPerformed n S B A Δ D (steps.get u) s e a := (full_mixed_common_event_label_present n S B A Δ D (steps.get u) s e a).mpr hi obtain ⟨b, hb, hp⟩ := (full_mixed_common_event_performed_iff n S B A Δ D (steps.get u) s e a).mp hp refine ⟨(fullMixedBirthCoordinateEquiv n S B A Δ D (steps.get u) s e).symm ⟨b, hp⟩, ?_⟩ rw [Equiv.apply_symm_apply] apply (fullMixedCommonBirthOrder M B steps).injective rw [full_mixed_common_old_index_address, ha] change Sum.inr (fullMixedCommonStepEmbedding S B steps (fullMixedBirthOrder S B steps ((fullMixedBirthOrder S B steps).symm ⟨u, b⟩))) = _ rw [Equiv.apply_symm_apply] exact congrArg (fun a => Sum.inr (⟨u, a⟩ : FullMixedCommonStepAddress M B steps)) hb · rintro ⟨c, rfl⟩ refine ⟨?_, ?_⟩ · rw [full_mixed_common_tagged_history_write_here] simp only [fullMixedEventBirthLabel, Option.isSome_map] exact (fullMixedBirthCoordinateEquiv n S B A Δ D tag s e c).property · rw [full_mixed_common_old_index_stage, full_mixed_tagged_occurrence_owner] end Local end Bounty end section /- Ordinary and exceptional energies for finite families of actual dyads. -/ open Filter Finset Set MeasureTheory namespace Bounty theorem eventually_dyadic_family_mean_energy {c C k : ℝ} (hc : 0 ≤ c) : ∀ᶠ L : ℝ in atTop, ∀ (K : ℕ) (lo hi : Fin K → ℕ) (w : Fin K → ℕ → ℂ) (U : Fin K → ℝ) (R : ℝ), (K : ℝ) ≤ L ^ k → 0 ≤ R → (∀ j, 1 ≤ U j ∧ R ≤ U j ∧ Real.log (U j) ≤ c * L ∧ U j ≤ (lo j : ℝ) ∧ (hi j : ℝ) ≤ 2 * U j ∧ (∑ n ∈ Finset.Icc (lo j) (hi j), ‖w j n‖ ^ 2) ≤ L ^ C / U j) → (∫ t in Set.Icc (-R) R, ‖∑ j : Fin K, ∑ n ∈ Finset.Icc (lo j) (hi j), w j n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)‖ ^ 2) ≤ L ^ (C + 2 + 2 * k) := by filter_upwards [eventually_dyadic_polynomial_mean_square_power (C := C) hc, eventually_gt_atTop (0 : ℝ)] with L hmean hL intro K lo hi w U R hcard hR hdata apply finite_sum_integral_energy_power Finset.univ _ (by intro j; fun_prop) measurableSet_Icc (by exact fun _ ht => ht) hL · simpa only [Finset.card_univ, Fintype.card_fin] using hcard · intro j _ obtain ⟨hU, hRU, hlog, hlo, hhi, henergy⟩ := hdata j apply hmean (Finset.Icc (lo j) (hi j)) (w j) (U j) R hU hR hRU hlog _ henergy intro n hn obtain ⟨hnlo, hnhi⟩ := Finset.mem_Icc.mp hn exact ⟨hlo.trans (Nat.cast_le.mpr hnlo), (Nat.cast_le.mpr hnhi).trans hhi⟩ theorem eventually_prime_exceptional_dyadic_family_energy {a beta c A B d C k : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hA : 0 ≤ A) (hB : 1 ≤ B) (hd : 0 < d) : ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R : ℝ), 1 ≤ Y → d * L ≤ Real.log Y → Real.log Y ≤ c * L → Real.exp (L ^ a) / 2 ≤ P → P ≤ Real.exp (L ^ beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) → (∀ p : s, ‖coeff p‖ ≤ B) → ∀ (K : ℕ) (lo hi : Fin K → ℕ) (w : Fin K → ℕ → ℂ) (U : Fin K → ℝ), (K : ℝ) ≤ L ^ k → (∀ j, Y ^ (3 / 5 : ℝ) ≤ U j ∧ U j ≤ (lo j : ℝ) ∧ (hi j : ℝ) ≤ 2 * U j ∧ (∑ n ∈ Finset.Icc (lo j) (hi j), ‖w j n‖ ^ 2) ≤ L ^ C / U j) → (∫ t in primeExceptionalTimes s coeff (L ^ (-A)) R, ‖∑ j : Fin K, ∑ n ∈ Finset.Icc (lo j) (hi j), w j n * Complex.exp ((Real.log (n : ℝ) * t : ℝ) * Complex.I)‖ ^ 2) ≤ L ^ (C + 2 + 2 * k) := by filter_upwards [eventually_prime_exceptional_residual_energy (C := C) ha ha1 hbeta hc hA hB hd, eventually_gt_atTop (0 : ℝ)] with L hsparse hL intro s hs coeff Y P R hY hlo hhi hPlo hPhi hR hRY hband hcoeff K lo hi w U hcard hdata refine finite_sum_integral_energy_power Finset.univ _ (by intro j; fun_prop) (prime_exceptional_times_measurable s coeff (L ^ (-A)) R) (R := R) ?_ hL ?_ ?_ · intro t ht exact abs_le.mp ht.1 · simpa only [Finset.card_univ, Fintype.card_fin] using hcard · intro j _ obtain ⟨hU, hlow, hhigh, henergy⟩ := hdata j exact hsparse s hs coeff Y P R (U j) hY hlo hhi hPlo hPhi hR hRY hband hcoeff hU (lo j) (hi j) (w j) hlow hhigh henergy end Bounty end section /- Actual upper sieve weights transfer the proven phase bound to rough integers. -/ open Finset namespace Bounty theorem exists_rough_logarithmic_sieve_bound (τ : ℝ) (hτ : 0 < τ) : ∃ δ C K N0 : ℝ, 0 < δ ∧ 0 < C ∧ 0 < K ∧ 1 ≤ N0 ∧ ∀ (z : ℝ) (h : ℕ), 1 < z → 1 ≤ h → Even h → ∀ (Y x u : ℝ) (a b q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), a ≤ b → Y ≤ (a : ℝ)+1 → (b : ℝ) ≤ 2*Y → N0 ≤ Y/(z^(4*(h : ℝ)+2)*(q : ℝ)) → 1 ≤ x → x^(τ/2) ≤ Y/(z^(4*(h : ℝ)+2)*(q : ℝ)) → u ≠ 0 → |u| ≤ x^2 → ‖∑ n ∈ (Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ)), χ (n : ZMod q)*Complex.exp (((u*Real.log (n : ℝ) : ℝ) : ℂ)*Complex.I)‖ ≤ K*(2*Y*Real.exp (-(h : ℝ))+z^(4*(h : ℝ)+2))+ Y*(C*(1/|u|+(Y/(z^(4*(h : ℝ)+2)*(q : ℝ)))^(-δ)))*(K*Real.log (2*z)) := by obtain ⟨δ,C,N0,hδ,hC,hN0,hdiv⟩ := exists_divisor_character_logarithmic_bound τ hτ obtain ⟨K,hK,hweights⟩ := exists_rough_integer_polynomial refine ⟨δ,C,K,N0,hδ,hC,hK,hN0,?_⟩ intro z h hz hh heven Y x u a b q hqInst χ hab hYa hbY hN hx hxN hu hux obtain ⟨lam,habs,hsupport,hpoint,hmass,hover⟩ := hweights hz h hh heven have hz0 : 0 < z := lt_trans zero_lt_one hz have hqR : 0 < (q : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) have hlevel : 0 < z^(4*(h : ℝ)+2) := Real.rpow_pos_of_pos hz0 _ have hNpos : 0 < Y/(z^(4*(h : ℝ)+2)*(q : ℝ)) := lt_of_lt_of_le (lt_of_lt_of_le zero_lt_one hN0) hN have hY : 0 < Y := (div_pos_iff.mp hNpos).resolve_right (by intro ht exact (not_lt_of_ge (mul_pos hlevel hqR).le) ht.2) |>.1 have hfinite : Summable (fun d : ℕ => |lam d|/(d : ℝ)) := by apply summable_of_ne_finset_zero (s := Icc 1 ⌊z^(4*(h : ℝ)+2)⌋₊) intro d hd have hl : lam d = 0 := by by_contra hn exact hd (mem_Icc.mpr ⟨(hsupport d hn).1, Nat.le_floor (hsupport d hn).2.1⟩) simp only [hl,abs_zero,zero_div] have hm : (∑ d ∈ Icc 1 b, |lam d|/(d : ℝ)) ≤ K*Real.log (2*z) := (hfinite.sum_le_tsum (Icc 1 b) (fun d hd => by positivity)).trans hmass have ho := (hover (a : ℝ) (b : ℝ) (Nat.cast_nonneg _) (Nat.cast_le.mpr hab)).2 simp only [Nat.floor_natCast,roughBand] at ho apply rough_interval_oscillation_of_divisor_sums a b lam _ hY.le (show 0 ≤ C*(1/|u|+(Y/(z^(4*(h : ℝ)+2)*(q : ℝ)))^(-δ)) by positivity) (fun n hn => (hpoint n hn).2) · intro n hn rw [norm_mul,Complex.norm_exp_ofReal_mul_I,mul_one] exact χ.norm_le_one _ · apply ho.trans apply mul_le_mul_of_nonneg_left _ hK.le apply add_le_add _ le_rfl apply mul_le_mul_of_nonneg_right _ (Real.exp_pos _).le have ha : 0 ≤ (a : ℝ) := Nat.cast_nonneg _ linarith · exact hm · intro d hd hne have hdpos := (hsupport d hne).1 have hdR : 0 < (d : ℝ) := by exact_mod_cast hdpos have hscale : Y/(z^(4*(h : ℝ)+2)*(q : ℝ)) ≤ Y/((d : ℝ)*(q : ℝ)) := by apply div_le_div_of_nonneg_left hY.le (mul_pos hdR hqR) exact mul_le_mul_of_nonneg_right (hsupport d hne).2.1 hqR.le have hb := hdiv Y x u a b d q χ hdpos hYa hbY (hN.trans hscale) hx (hxN.trans hscale) hu hux have hp := Real.rpow_le_rpow_of_nonpos hNpos hscale (neg_nonpos.mpr hδ.le) calc _ ≤ C*(Y/(d : ℝ))*(1/|u|+(Y/((d : ℝ)*(q : ℝ)))^(-δ)) := hb _ ≤ C*(Y/(d : ℝ))*(1/|u|+(Y/(z^(4*(h : ℝ)+2)*(q : ℝ)))^(-δ)) := by gcongr _ = _ := by ring end Bounty end section /- The original weighted prime coefficient factors through unshared marks. The surrounding shared exclusions and dilation phase remain explicit. -/ open Finset Classical namespace Bounty section Phase variable {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h : ℝ) (kept : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) end Phase end Bounty end section /- The shared-draw exclusion removes the exact original overlap corrections. -/ open Finset open scoped Classical namespace Bounty theorem physical_shared_avoidance_from_draw {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (hprime : ∀ g p, p ∈ P g → p.Prime) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) (havoid : ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z) : ∀ p ∈ physicalSharedPrimes C L, ¬(p.2.val : ℤ) ∣ (w : ℤ) ∧ ¬(p.2.val : ℤ) ∣ (z : ℤ) := by intro p hp obtain ⟨s, hs, he⟩ := (mem_physical_shared_primes C L p).mp hp obtain ⟨j, hj, rfl⟩ := (physical_mem_shared_slots_iff (C p.1) s).mp hs let a : ↥(univ \ C p.1) := ⟨j, mem_sdiff.mpr ⟨mem_univ _, hj⟩⟩ have hn : ¬((physicalSharedAux C L p.1 a).val ∣ w ∨ (physicalSharedAux C L p.1 a).val ∣ z ∨ ∃ i, aux p.1 i = physicalSharedAux C L p.1 a) := by intro h exact havoid p.1 a ((physical_mem_shared_forbidden_iff C aux p.1 (hprime p.1) hw hz (physicalSharedAux C L p.1 a)).mpr h) constructor · intro hd apply hn left change (L p.1 (Sum.inl j)).val ∣ w rw [he] exact_mod_cast hd · intro hd apply hn right left change (L p.1 (Sum.inl j)).val ∣ z rw [he] exact_mod_cast hd theorem physical_shared_vertex_pair_of_draw_avoids {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) (hshared : physicalSharedCompatible C L R) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (q : ℝ) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) (havoid : ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z) : physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * (w : ℤ)) * physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * (z : ℤ)) = physicalUnsharedVertex C L q (w : ℤ) * physicalUnsharedVertex C R q (z : ℤ) := by have ha := physical_shared_avoidance_from_draw C L aux hprime hw hz havoid have he := physical_shared_vertex_pair_removal C L R hshared hprime hdis q (w : ℤ) (z : ℤ) rw [physical_shared_overlap_eq_one C L q (w : ℤ) (fun p hp => (ha p hp).1), physical_shared_overlap_eq_one C L q (z : ℤ) (fun p hp => (ha p hp).2), one_mul, mul_one] at he exact he end Bounty end section /- Direct retained-cell bounds on every pair of unshared marked lists. No compatible shared completion is required. -/ open Finset Classical namespace Bounty theorem physical_unshared_prime_coefficient_norm_le {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (u v : GroupMarkedLists P (fun g => ell + (repeatedBigAuxCut A B g).card)) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : ‖physicalUnsharedPrimeCoefficient P V A B hU hAB Q h (primeProductRetainedCells (fun i : A => P i.val.1) (fun i => V i.val.1) h ξ) (primeProductRetainedCells (fun i : B => P i.val.1) (fun i => V i.val.1) h ξ) u v aux‖ ≤ ((Q * Q : ℕ) / ξ) ^ 2 := by unfold physicalUnsharedPrimeCoefficient rw [norm_mul, pow_two] apply mul_le_mul (prime_ideal_kernel_norm_le _ _ Q h _ hξ (fun _ hd => prime_product_retained_cell_mass _ _ h ξ hd) _ _) (prime_ideal_kernel_norm_le _ _ Q h _ hξ (fun _ hd => prime_product_retained_cell_mass _ _ h ξ hd) _ _) (norm_nonneg _) positivity section Pattern variable {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (u v : GroupMarkedLists P (fun g => ell + (repeatedBigPrimePatternCut probes r t i g).card)) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) include hξ theorem physical_unshared_prime_pattern_kernel_norm_le : let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ ‖physicalUnsharedPrimePatternKernel P V probes r t hrt Q h kept i u v aux‖ ≤ repeatedBigPrimePatternBound probes r t Q ξ i := by intro kept cases i with | inl x => simp only [physicalUnsharedPrimePatternKernel, repeatedBigPrimePatternBound, norm_one, le_refl] | inr ab => exact physical_unshared_prime_coefficient_norm_le P V ab.1.val ab.2.val _ _ Q h ξ hξ u v aux theorem physical_unshared_weighted_prime_pattern_norm_le : let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ ‖repeatedBigPrimePatternWeight probes r t i * physicalUnsharedPrimePatternKernel P V probes r t hrt Q h kept i u v aux‖ ≤ repeatedBigPrimePatternBound probes r t Q ξ i := by intro kept rw [norm_mul, repeated_big_prime_pattern_weight_norm, one_mul] exact physical_unshared_prime_pattern_kernel_norm_le P V probes r t hrt Q h ξ hξ i u v aux end Pattern end Bounty end section /- A nonnegative real majorant for a finite complex weighted sum. -/ open Finset open scoped Classical namespace Bounty section variable {S : Type*} [sharedInstance1 : Fintype S] (μ : S → ℝ) (hμ : ∀ s, 0 ≤ μ s) (F : S → ℂ) (B : S → ℝ) (hB : ∀ s, ‖F s‖ ≤ B s) include S sharedInstance1 μ hμ F B hB theorem finite_weighted_norm_le_real_majorant : ‖∑ s, (μ s : ℂ) * F s‖ ≤ (∑ s, (μ s : ℂ) * (B s : ℂ)).re := by calc _ ≤ ∑ s, ‖(μ s : ℂ) * F s‖ := norm_sum_le _ _ _ ≤ ∑ s, μ s * B s := by apply sum_le_sum intro s _ rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hμ s)] exact mul_le_mul_of_nonneg_left (hB s) (hμ s) _ = _ := by simp only [Complex.re_sum, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] theorem finite_weighted_norm_le_majorant_norm : ‖∑ s, (μ s : ℂ) * F s‖ ≤ ‖∑ s, (μ s : ℂ) * (B s : ℂ)‖ := (finite_weighted_norm_le_real_majorant μ hμ F B hB).trans (Complex.re_le_norm _) end end Bounty end section /- The exact normalized full-vertex compatible pair functional. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalFullPairCorrelation {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (V : G → ℝ) (q : ℝ) (w z : ℕ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → ℂ) : ℂ := ∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then ((physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * (((physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * (w : ℤ)) * physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * (z : ℤ)) : ℝ) : ℂ) * K L R) else 0 section variable {G : Type*} [sharedInstance1 : Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (V : G → ℝ) (q : ℝ) (w z : ℕ) (F K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → ℂ) include G sharedInstance1 P J ell C V q w z F K theorem physical_full_pair_congr (h : ∀ L R, physicalSharedCompatible C L R → F L R = K L R) : physicalFullPairCorrelation P C V q w z F = physicalFullPairCorrelation P C V q w z K := by unfold physicalFullPairCorrelation apply sum_congr rfl intro L _ apply sum_congr rfl intro R _ by_cases hc : physicalSharedCompatible C L R · rw [if_pos hc, if_pos hc, h L R hc] · rw [if_neg hc, if_neg hc] theorem physical_full_pair_add : physicalFullPairCorrelation P C V q w z (fun L R => F L R + K L R) = physicalFullPairCorrelation P C V q w z F + physicalFullPairCorrelation P C V q w z K := by unfold physicalFullPairCorrelation rw [← sum_add_distrib] apply sum_congr rfl intro L _ rw [← sum_add_distrib] apply sum_congr rfl intro R _ by_cases hc : physicalSharedCompatible C L R · simp only [if_pos hc, mul_add] · simp only [if_neg hc, zero_add] end end Bounty end section /- The actual unshared coefficient separates the auxiliary draws from selected endpoint marks, using only retained cells and the original characters. -/ open Finset open scoped Classical namespace Bounty theorem physical_prime_cell_expansion {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (S : Finset G) (hA : ∀ i ∈ A, i.1 ∈ S) (hB : ∀ i ∈ B, i.1 ∈ S) (u v : GroupMarkedLists P (fun g => ell + (repeatedBigAuxCut A B g).card)) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : let PA := fun i : A => P i.val.1 let PB := fun i : B => P i.val.1 let VA := fun i : A => V i.val.1 let VB := fun i : B => V i.val.1 let a := fun d => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := PA) VA)) (fun z => upperLogCell h (Real.log (∏ i, (z i).val : ℕ))) d : ℝ) : ℂ) let b := fun e => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := PB) VB)) (fun z => upperLogCell h (Real.log (∏ i, (z i).val : ℕ))) e : ℝ) : ℂ) let split := repeatedBigAuxSplitEquiv P A B hU hAB aux physicalUnsharedPrimeCoefficient P V A B hU hAB Q h keptA keptB u v aux = ∑ d ∈ keptA, ∑ χ : BoundedPrimitiveCharacter Q, ∑ e ∈ keptB, ∑ ψ : BoundedPrimitiveCharacter Q, (a d*b e) * ((starRingEnd ℂ) (primeProductCellCharacter PA h d χ split.1) * (starRingEnd ℂ) (primeProductCellCharacter PB h e ψ split.2)) * (primeProductCellCharacter PB h e ψ (physicalSelectedPrimeRestriction A B B subset_union_right S hB (fun g : S => u g.val)) * primeProductCellCharacter PA h d χ (physicalSelectedPrimeRestriction A B A subset_union_left S hA (fun g : S => v g.val))) := by dsimp only exact prime_ideal_kernel_pair_cell_expansion (fun i : A => P i.val.1) (fun i => V i.val.1) (fun i : B => P i.val.1) (fun i => V i.val.1) Q h keptA keptB (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 (physicalPrimeUnsharedRestriction A B A subset_union_left v) (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 (physicalPrimeUnsharedRestriction A B B subset_union_right u) end Bounty end section /- Finite separated kernel expansions pass through the original weighted marked averages, including empty complementary fibers. -/ open Finset open scoped Classical namespace Bounty theorem group_marked_average_sum {G I : Type*} [Fintype G] (P : G → Finset ℕ) (t : G → ℕ) (n : ℤ) (s : Finset I) (b : I → GroupMarkedLists P t → ℂ) : groupMarkedAverage P t n (fun u => ∑ i ∈ s, b i u) = ∑ i ∈ s, groupMarkedAverage P t n (b i) := by unfold groupMarkedAverage rw [sum_comm, mul_sum] theorem weighted_marked_pair_finite_expansion {G I : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (w z : ℤ) (big : Finset G) (s : Finset I) (c : I → ℂ) (a b : I → GroupMarkedLists (fun g : big => P g.val) (fun g : big => t g.val) → ℂ) : let W := fun n => markedDivisorWeight univ P q V t n ((W w*W z : ℝ) : ℂ) * groupMarkedAverage P t w (fun u => groupMarkedAverage P t z (fun v => ∑ i ∈ s, c i * (a i (fun g : big => u g.val) * b i (fun g : big => v g.val)))) = ∑ i ∈ s, c i * (((W w : ℂ) * groupMarkedAverage (fun g : big => P g.val) (fun g : big => t g.val) w (a i)) * ((W z : ℂ) * groupMarkedAverage (fun g : big => P g.val) (fun g : big => t g.val) z (b i))) := by dsimp only simp_rw [group_marked_average_sum] rw [mul_sum] apply sum_congr rfl intro i _ simp_rw [group_marked_average_mul_left] rw [group_marked_average_mul_right] have he := weighted_group_marked_pair_restrict P q V t w z big (a i) (b i) dsimp only at he rw [group_marked_pair_average_separate] at he calc _ = c i * (((markedDivisorWeight univ P q V t w * markedDivisorWeight univ P q V t z : ℝ) : ℂ) * (groupMarkedAverage P t w (fun u => a i (fun g : big => u g.val)) * groupMarkedAverage P t z (fun v => b i (fun g : big => v g.val)))) := by ring _ = _ := by rw [he] end Bounty end section /- The exact rational box has the cubic denominator cost of its complete character family. -/ open Finset MeasureTheory namespace Bounty theorem rational_box_kernel_energy_le {r : ℕ} (hr : 0 < r) (k : ℤ) (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (H : ℝ → ℕ → ℂ) (hD : ∀ d ∈ D, d.Coprime r) (hA : ∀ a ∈ A, a.Coprime r) (hB : ∀ b ∈ B, b.Coprime r) (hH : ∀ n, Continuous (fun t => H t n)) (a b E : ℝ) (hE : 0 ≤ E) (henergy : ∀ d ∈ r.divisors, ∀ ψ : AddChar (Additive (ZMod (r/d))ˣ) ℂ, (∫ t in Set.Icc a b, ‖fourBoxKernelSum D A B C (fun n => δ n*unitAddCharDirichlet ψ (n : ZMod (r/d))) (fun n => α n*unitAddCharDirichlet ψ (n : ZMod (r/d))) (fun n => β n*unitAddCharDirichlet ψ (n : ZMod (r/d))) (fun n => γ n*rationalResidualGcdMultiplier r d ψ n) (H t)‖^2) ≤ E) : (∫ t in Set.Icc a b, ‖rationalFourBoxKernelSum r k D A B C δ α β γ (H t)‖^2) ≤ (r : ℝ)^3*E := by obtain ⟨c,hc,hcard,he⟩ := rational_four_factor_full_gcd_kernel_expansion hr (le_refl r) k D A B C hD hA hB have hpoint (t : ℝ) : rationalFourBoxKernelSum r k D A B C δ α β γ (H t) = ∑ d ∈ r.divisors, ∑ ψ, c d ψ * fourBoxKernelSum D A B C (fun n => δ n*unitAddCharDirichlet ψ (n : ZMod (r/d))) (fun n => α n*unitAddCharDirichlet ψ (n : ZMod (r/d))) (fun n => β n*unitAddCharDirichlet ψ (n : ZMod (r/d))) (fun n => γ n*rationalResidualGcdMultiplier r d ψ n) (H t) := by simpa only [rationalFourBoxKernelSum,fourBoxKernelSum,Nat.cast_mul,mul_assoc] using he δ α β γ (H t) have h := rational_gcd_character_family_energy_le r r c (fun d ψ t => fourBoxKernelSum D A B C (fun n => δ n*unitAddCharDirichlet ψ (n : ZMod (r/d))) (fun n => α n*unitAddCharDirichlet ψ (n : ZMod (r/d))) (fun n => β n*unitAddCharDirichlet ψ (n : ZMod (r/d))) (fun n => γ n*rationalResidualGcdMultiplier r d ψ n) (H t)) a b E hE (fun _ _ _ => (continuous_four_box_kernel_sum D A B C _ _ _ _ H hH).continuousOn) henergy (hc.trans hcard) simpa only [← hpoint] using h end Bounty end section /- The selected fixed physical path is exactly the original joint raw history, with all scalar factors retained. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) end ResiduePath end Bounty end section /- The actual selected four-row physical schedule groups exactly into the previously defined visit/edge-block schedule, with arbitrary terminal tests. -/ open scoped Classical namespace Bounty section Grouping variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) theorem physical_selected_fine_three_rows (j : Fin n) (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention (4 * j.val + 1) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention (4 * j.val + 2) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention (4 * j.val + 3) F)) = physicalSelectedStateEdgeBlock C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.succ) F := by rw [physical_selected_fine_row_source_permutation, physical_selected_fine_row_edge, physical_selected_fine_row_target_permutation] unfold physicalSelectedStateEdgeBlock apply congrArg (physicalObservedMarkRow C k ω β retention ρ V hV none) funext o t split_ifs with ho · apply congrArg (fun K => physicalObservedMarkRow C k ω β retention ρ V hV (some (.inr j)) K t) funext p u split_ifs with hp · apply congrArg (fun K => physicalObservedMarkRow C k ω β retention ρ V hV none K u) funext q v split_ifs <;> rfl · rfl · rfl theorem physical_selected_fine_grouped_visit (j : Fin (n + 1)) (F : PhysicalBoundedMarkState P J ell B → ℂ) : finiteRowGrouped (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention) visitThreeBlockLength (2 * j.val) F = physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention (2 * j.val) F := by unfold finiteRowGrouped rw [visit_three_block_cut_even, visit_three_block_length_even, finite_row_segment_one, physical_selected_fine_row_visit, physical_selected_coarse_row_even] theorem physical_selected_fine_grouped_edge (j : Fin n) (F : PhysicalBoundedMarkState P J ell B → ℂ) : finiteRowGrouped (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention) visitThreeBlockLength (2 * j.val + 1) F = physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention (2 * j.val + 1) F := by unfold finiteRowGrouped rw [visit_three_block_cut_odd, visit_three_block_length_odd, finite_row_segment_three] simp only [Nat.add_assoc, Nat.reduceAdd] rw [physical_selected_fine_three_rows, physical_selected_coarse_row_odd] theorem physical_selected_fine_grouped_eq_coarse (i : ℕ) (hi : i < 2 * n + 1) (F : PhysicalBoundedMarkState P J ell B → ℂ) : finiteRowGrouped (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention) visitThreeBlockLength i F = physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention i F := by by_cases h0 : i % 2 = 0 · let j : Fin (n + 1) := ⟨i / 2, by omega⟩ have hj : 2 * j.val = i := by dsimp [j]; omega have he := physical_selected_fine_grouped_visit C aux L σ τ k β V ρ hV ω retention j F simpa only [hj] using he · let j : Fin n := ⟨i / 2, by omega⟩ have hj : 2 * j.val + 1 = i := by dsimp [j]; omega have he := physical_selected_fine_grouped_edge C aux L σ τ k β V ρ hV ω retention j F simpa only [hj] using he theorem physical_selected_fine_composition_eq_coarse (F : PhysicalBoundedMarkState P J ell B → ℂ) : finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention) (4 * n + 1) F = finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention) (2 * n + 1) F := by rw [← finite_row_visit_three_grouping_constant] apply finite_row_composition_congr_before intro i hi K exact physical_selected_fine_grouped_eq_coarse C aux L σ τ k β V ρ hV ω retention i hi K end Grouping end Bounty end section /- Fixed physical fine-row selections become one bounded predicate on the chronological record of encoded states and original observations. -/ open scoped Classical namespace Bounty section Predicate variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (cut : ℕ → Fin N → Finset (Fin J)) noncomputable def physicalSelectedFineEncodedTest (i : ℕ) (o : PhysicalMarkObservation P ell C) (y : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) : Prop := ∃ t : PhysicalBoundedMarkState P J ell B, physicalBoundedMarkEncode (cut (i + 1)) t = y ∧ physicalSelectedFineTest C aux L σ τ i o t noncomputable def physicalSelectedFineTraceTest (i : ℕ) (r : PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C) : Prop := physicalSelectedFineEncodedTest C aux L σ τ cut i r.2.1 r.2.2 theorem physical_selected_fine_encoded_test_iff (i : ℕ) (o : PhysicalMarkObservation P ell C) (t : PhysicalBoundedMarkState P J ell B) : physicalSelectedFineEncodedTest C aux L σ τ cut i o (physicalBoundedMarkEncode (cut (i + 1)) t) ↔ physicalSelectedFineTest C aux L σ τ i o t := by constructor · rintro ⟨u, hu, htest⟩ have he : u = t := physical_bounded_mark_encode_injective (cut (i + 1)) hu simpa only [he] using htest · intro htest exact ⟨t, rfl, htest⟩ end Predicate end Bounty end section /- A concrete full-state coordinate schedule for the selected fine rows. Visits use empty shared coordinates; both sides of each edge use its C_j. -/ namespace Bounty noncomputable def physicalSelectedFineCut {N J n : ℕ} (C : Fin n → Fin N → Finset (Fin J)) (i : ℕ) : Fin N → Finset (Fin J) := if hj : i / 4 < n then if 2 ≤ i % 4 then C ⟨i / 4, hj⟩ else fun _ => ∅ else fun _ => ∅ theorem physical_selected_fine_cut_encoding {N J n : ℕ} (C : Fin n → Fin N → Finset (Fin J)) (i : ℕ) : PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (physicalSelectedFineCut C i) (physicalSelectedFineCut C (i + 1)) := by by_cases hi : i < 4 * n + 1 · by_cases h0 : i % 4 = 0 · have hcur : ¬ 2 ≤ i % 4 := by omega have hnext : ¬ 2 ≤ (i + 1) % 4 := by omega simp only [physicalSelectedFineTag, dif_pos hi, dif_pos h0, PhysicalMarkRowEncoding] unfold physicalSelectedFineCut split_ifs <;> simp_all · by_cases h2 : i % 4 = 2 · have hj : i / 4 < n := by omega have hj' : (i + 1) / 4 < n := by omega have hd : (i + 1) / 4 = i / 4 := by omega have hm : 2 ≤ (i + 1) % 4 := by omega simp only [physicalSelectedFineTag, dif_pos hi, PhysicalMarkRowEncoding, physicalSelectedFineCut, dif_pos hj, dif_pos hj', h2, le_refl, if_true, if_pos hm] constructor · rfl · exact congrArg C (Fin.ext hd) · simp only [physicalSelectedFineTag, dif_pos hi, dif_neg h0, dif_neg h2, PhysicalMarkRowEncoding] · simp only [physicalSelectedFineTag, dif_neg hi, PhysicalMarkRowEncoding] end Bounty end section /- The exact energy factor of the actual selected physical schedule. -/ namespace Bounty end Bounty end section /- The first selected visit forces the prescribed initial mark list, independently of every later row, continuation and pending-memory state. -/ open scoped Classical namespace Bounty theorem finite_row_composition_zero_of_first {S : ℕ → Type*} {V : Type*} [Zero V] (row : ∀ i, (S (i + 1) → V) → S i → V) (s : S 0) (hzero : ∀ F, row 0 F s = 0) (n : ℕ) (F : S (n + 1) → V) : finiteRowComposition row (n + 1) F s = 0 := by induction n with | zero => exact hzero F | succ n ih => exact ih (row (n + 1) F) section Visit variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (hV : ∀ g, V g ≠ 0) theorem physical_observed_selected_visit_zero_of_marks (j : I) (R : PhysicalMarkLists P J ell) (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) (hs : s.1 ≠ R) : physicalObservedMarkRow C k ω β retention ρ V hV (some (.inl j)) (fun o t => if o = .inr none ∧ t.1 = R then F t else 0) s = 0 := by unfold physicalObservedMarkRow dsimp only conv_lhs => arg 4 equals (fun _ => 0) => funext u unfold physicalMarkRawExtension split_ifs <;> simp_all conv_lhs => arg 4 equals (fun _ => (0 : ℂ) * 0) => funext u simp only [zero_mul] rw [global_birth_joint_cut_raw_row_mul, zero_mul] end Visit section Support variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) theorem physical_selected_fine_zero_of_initial_marks (F : PhysicalBoundedMarkState P J ell B → ℂ) (s : PhysicalBoundedMarkState P J ell B) (hs : s.1 ≠ L 0) : finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention) (4 * n + 1) F s = 0 := by apply finite_row_composition_zero_of_first intro G have hrow := physical_selected_fine_row_visit C aux L σ τ k β V ρ hV ω retention (0 : Fin (n + 1)) G simp only [Fin.val_zero, mul_zero] at hrow rw [hrow] exact physical_observed_selected_visit_zero_of_marks C k ω β retention ρ V hV 0 (L 0) G s hs theorem physical_selected_fine_initial_mark_indicator (F : PhysicalBoundedMarkState P J ell B → ℂ) (M : PhysicalMarkLists P J ell) : finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention) (4 * n + 1) F (physicalInitialMarkState B M) = if M = L 0 then finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention) (4 * n + 1) F (physicalInitialMarkState B (L 0)) else 0 := by by_cases hM : M = L 0 · subst M rw [if_pos rfl] · rw [if_neg hM] exact physical_selected_fine_zero_of_initial_marks C aux L σ τ k β V ρ hV ω retention F (physicalInitialMarkState B M) hM end Support end Bounty end section /- Exact selectors used to recover the prescribed labels and draws from a chronological record. -/ open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) theorem physical_selected_fine_test_visit (j : Fin (n + 1)) (o : PhysicalMarkObservation P ell C) (t : PhysicalBoundedMarkState P J ell B) : physicalSelectedFineTest C aux L σ τ (4 * j.val) o t ↔ o = .inr none ∧ t.1 = L j := by have hj := j.isLt have hi : 4 * j.val < 4 * n + 1 := by omega have h0 : (4 * j.val) % 4 = 0 := by omega have hd : (4 * j.val) / 4 = j.val := by omega have he (h : (4 * j.val) / 4 < n + 1) : (⟨(4 * j.val) / 4, h⟩ : Fin (n + 1)) = j := Fin.ext hd simp only [physicalSelectedFineTest, dif_pos hi, dif_pos h0, he] theorem physical_selected_fine_test_source_permutation (j : Fin n) (o : PhysicalMarkObservation P ell C) (t : PhysicalBoundedMarkState P J ell B) : physicalSelectedFineTest C aux L σ τ (4 * j.val + 1) o t ↔ o = .inl (σ j) := by have hj := j.isLt have hi : 4 * j.val + 1 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 1) % 4 = 0 := by omega have h1 : (4 * j.val + 1) % 4 = 1 := by omega have h2 : ¬ (4 * j.val + 1) % 4 = 2 := by omega have hd : (4 * j.val + 1) / 4 = j.val := by omega have he (h : (4 * j.val + 1) / 4 < n) : (⟨(4 * j.val + 1) / 4, h⟩ : Fin n) = j := Fin.ext hd simp only [physicalSelectedFineTest, dif_pos hi, dif_neg h0, if_pos h1, he] theorem physical_selected_fine_test_edge (j : Fin n) (o : PhysicalMarkObservation P ell C) (t : PhysicalBoundedMarkState P J ell B) : physicalSelectedFineTest C aux L σ τ (4 * j.val + 2) o t ↔ o = .inr (some ⟨j, aux j⟩) ∧ t.1 = physicalPermuteLabels (τ j) (L j.succ) := by have hj := j.isLt have hi : 4 * j.val + 2 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 2) % 4 = 0 := by omega have h1 : ¬ (4 * j.val + 2) % 4 = 1 := by omega have h2 : (4 * j.val + 2) % 4 = 2 := by omega have hd : (4 * j.val + 2) / 4 = j.val := by omega have he (h : (4 * j.val + 2) / 4 < n) : (⟨(4 * j.val + 2) / 4, h⟩ : Fin n) = j := Fin.ext hd simp only [physicalSelectedFineTest, dif_pos hi, dif_neg h0, if_neg h1, if_pos h2, he] have haux (h : (4 * j.val + 2) / 4 < n) : (⟨⟨(4 * j.val + 2) / 4, h⟩, aux ⟨(4 * j.val + 2) / 4, h⟩⟩ : Σ j : Fin n, PhysicalAuxLabels P (C j)) = ⟨j, aux j⟩ := congrArg (fun j : Fin n => (⟨j, aux j⟩ : Σ j : Fin n, PhysicalAuxLabels P (C j))) (he h) simp only [haux] theorem physical_selected_fine_test_target_permutation (j : Fin n) (o : PhysicalMarkObservation P ell C) (t : PhysicalBoundedMarkState P J ell B) : physicalSelectedFineTest C aux L σ τ (4 * j.val + 3) o t ↔ o = .inl (physicalInversePermutations (τ j)) := by have hj := j.isLt have hi : 4 * j.val + 3 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 3) % 4 = 0 := by omega have h1 : ¬ (4 * j.val + 3) % 4 = 1 := by omega have h2 : ¬ (4 * j.val + 3) % 4 = 2 := by omega have hd : (4 * j.val + 3) / 4 = j.val := by omega have he (h : (4 * j.val + 3) / 4 < n) : (⟨(4 * j.val + 3) / 4, h⟩ : Fin n) = j := Fin.ext hd simp only [physicalSelectedFineTest, dif_pos hi, dif_neg h0, if_neg h1, if_neg h2, he] end Fine end Bounty end section /- Explicit finite tilt and collision budgets for the actual prime-pattern family. Only the already defined physical perturbation error is estimated. -/ open Finset open scoped Classical namespace Bounty theorem repeated_big_prime_pattern_bound_sum_le {G : Type*} [DecidableEq G] {J ell m : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hp : ∀ g, (probes g).card ≤ m) (Q : ℕ) (ξ : ℝ) : (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q ξ i) ≤ 1 + (2 : ℝ) ^ (m * (r.card + t.card)) * ((Q * Q : ℕ) / ξ) ^ 2 := by rw [Fintype.sum_sum_type] simp only [repeatedBigPrimePatternBound, sum_const, card_univ, nsmul_eq_mul, Fintype.card_unit, Nat.cast_one, mul_one] apply add_le_add le_rfl apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) exact_mod_cast repeated_big_prime_pattern_pair_card_le (ell := ell) probes r t hp end Bounty end section /- Elementary side conditions for the exact prime-kernel parameter chain and its two disjoint collections of mapped probe slots. -/ open Finset Filter namespace Bounty /- All six parameters in the actual prime-kernel construction are nonnegative. The fiber factor is at least one for every `v` and `m`. -/ theorem repeated_big_prime_kernel_exponents_nonneg (s z a v D ε : ℝ) (m : ℕ) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hD : 0 ≤ D) (hε : 0 ≤ ε) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 0 ≤ κ ∧ 0 ≤ s' ∧ 0 ≤ A₀ ∧ 0 ≤ q ∧ 0 ≤ w ∧ 0 ≤ x := by intro κ s' A₀ q w x have hk : 0 ≤ κ := mul_nonneg ha (Real.log_nonneg (one_le_primeFiberFactorBound v m)) have hs' : 0 ≤ s' := add_nonneg hs hε have hA : 0 ≤ A₀ := by dsimp [A₀]; positivity have hq : 0 ≤ q := by dsimp [q]; positivity have hmz : 0 ≤ max z q := hz.trans (le_max_left _ _) have hw : 0 ≤ w := add_nonneg (add_nonneg (add_nonneg (mul_nonneg (by norm_num) hq) hmz) hA) (by norm_num) have hx : 0 ≤ x := by dsimp [x]; positivity exact ⟨hk, hs', hA, hq, hw, hx⟩ /- Disjoint blocks use at most `m` mapped probes per group in total. -/ theorem repeated_big_prime_mapped_probe_card_le {G : Type*} [Fintype G] [DecidableEq G] {J ell m : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (hp : ∀ g, (probes g).card ≤ m) : (r.sigma (fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)))).card + (t.sigma (fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)))).card ≤ m * Fintype.card G := by have hcard : r.card + t.card ≤ Fintype.card G := by rw [← card_union_of_disjoint hrt] exact card_le_univ _ calc _ ≤ m * r.card + m * t.card := Nat.add_le_add (repeated_big_prime_probe_sigma_card_le (ell := ell) probes r hp) (repeated_big_prime_probe_sigma_card_le (ell := ell) probes t hp) _ = m * (r.card + t.card) := by ring _ ≤ _ := Nat.mul_le_mul_left m hcard /- Polynomially many visits leave a positive baseline at every prime above the exponential lower cutoff. The threshold is uniform in both cutoffs. -/ theorem eventually_repeated_big_baseline_pos {c tau : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ T P : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ P → T / P ≤ 1 / 2 ∧ ∀ p : ℝ, P ≤ p → 0 < 1 - T / p := by filter_upwards [eventually_exp_neg_rpow_mul_rpow_le hc (show (0 : ℝ) < 1 by norm_num) tau 1, eventually_ge_atTop (2 : ℝ)] with L hsmall hL intro T P hT0 hT hP have hP0 : 0 < P := lt_of_lt_of_le (Real.exp_pos _) hP have hratio : T / P ≤ 1 / 2 := by calc _ ≤ L ^ tau / Real.exp (L ^ c) := div_le_div₀ (Real.rpow_nonneg (by linarith) tau) hT (Real.exp_pos _) hP _ = Real.exp (-1 * L ^ c) * L ^ tau := by simp only [neg_mul, one_mul, Real.exp_neg] ring _ ≤ L ^ (-(1 : ℝ)) := hsmall _ ≤ 1 / 2 := by rw [Real.rpow_neg_one, inv_eq_one_div] exact one_div_le_one_div_of_le (by norm_num) hL refine ⟨hratio, ?_⟩ intro p hp have hratio' : T / p ≤ 1 / 2 := (div_le_div_of_nonneg_left hT0 hP0 hp).trans hratio linarith end Bounty end section /- The mask average equals the actual power weight on shifted prime divisibility. -/ open Finset Filter open scoped Topology namespace Bounty theorem odd_masked_pair_box_filter (a b c d m : ℕ) (W z : ℝ) (P S : Finset ℕ) (hP : P ⊆ primeBand 0 z) (hPm : ∀ p ∈ P, ¬p ∣ m) (hP2 : 2 ∉ P) (hS : S ⊆ P) : oddMaskedPairBox a b c d m W z S = (oddMaskedPairBox a b c d m W z P).filter (fun v => pairShiftedPrimeSet P v ⊆ S) := by classical apply Finset.ext intro v rw [mem_filter] simp only [oddMaskedPairBox, mem_filter] change _ ↔ _ ∧ P.filter (fun p => (v.1*v.2) % p = 1 % p) ⊆ S constructor · rintro ⟨hbase, hrough, hban⟩ refine ⟨⟨hbase, hrough, ?_⟩, ?_⟩ · intro p hp hp2 hpm hpP exact hban p hp hp2 hpm (fun hpS => hpP (hS hpS)) · intro p hp obtain ⟨hpP, hpone⟩ := mem_filter.mp hp by_contra hpS exact hban p (hP hpP) (fun he => hP2 (he ▸ hpP)) (hPm p hpP) hpS hpone · rintro ⟨⟨hbase, hrough, hban⟩, hforced⟩ refine ⟨hbase, hrough, ?_⟩ intro p hp hp2 hpm hpS hpone by_cases hpP : p ∈ P · exact hpS (hforced (mem_filter.mpr ⟨hpP, hpone⟩)) · exact hban p hp hp2 hpm hpP hpone theorem odd_masked_pair_average_eq_power_weight (a b c d m : ℕ) (W z q : ℝ) (P : Finset ℕ) (hP : P ⊆ primeBand 0 z) (hPm : ∀ p ∈ P, ¬p ∣ m) (hP2 : 2 ∉ P) : (∑ S ∈ P.powerset, bernoulliSubsetWeight q P S * ((oddMaskedPairBox a b c d m W z S).card : ℝ)) = ∑ v ∈ oddMaskedPairBox a b c d m W z P, q^(pairShiftedPrimeSet P v).card := by classical calc _ = ∑ S ∈ P.powerset, ∑ v ∈ oddMaskedPairBox a b c d m W z P, if pairShiftedPrimeSet P v ⊆ S then bernoulliSubsetWeight q P S else 0 := by apply sum_congr rfl intro S hS rw [odd_masked_pair_box_filter a b c d m W z P S hP hPm hP2 (mem_powerset.mp hS)] have hc : (((oddMaskedPairBox a b c d m W z P).filter (fun v => pairShiftedPrimeSet P v ⊆ S)).card : ℝ) = ∑ v ∈ oddMaskedPairBox a b c d m W z P, if pairShiftedPrimeSet P v ⊆ S then (1 : ℝ) else 0 := by simp rw [hc, mul_sum] apply sum_congr rfl intro v _ split_ifs <;> simp _ = ∑ v ∈ oddMaskedPairBox a b c d m W z P, ∑ S ∈ P.powerset, if pairShiftedPrimeSet P v ⊆ S then bernoulliSubsetWeight q P S else 0 := sum_comm _ = _ := by apply sum_congr rfl intro v _ exact bernoulli_mask_contains P (pairShiftedPrimeSet P v) (filter_subset _ _) q theorem odd_masked_pair_average_eq_divisor_weight (a b c d m : ℕ) (W z q : ℝ) (P : Finset ℕ) (hP : P ⊆ primeBand 0 z) (hPm : ∀ p ∈ P, ¬p ∣ m) (hP2 : 2 ∉ P) : (∑ S ∈ P.powerset, bernoulliSubsetWeight q P S * ((oddMaskedPairBox a b c d m W z S).card : ℝ)) = ∑ v ∈ oddMaskedPairBox a b c d m W z P, q^((P.filter (fun p => p ∣ v.1*v.2-1)).card) := by rw [odd_masked_pair_average_eq_power_weight a b c d m W z q P hP hPm hP2] apply sum_congr rfl intro v hv have hbase := (mem_filter.mp hv).1 simp only [pairSieveBaseBox, Finset.product_eq_sprod, mem_filter, mem_product, mem_Ioc] at hbase have hx : 0 < v.1 := lt_of_le_of_lt (Nat.zero_le a) hbase.1.1.1 have hy : 0 < v.2 := lt_of_le_of_lt (Nat.zero_le c) hbase.1.2.1 rw [pair_shifted_prime_set_eq_divisors P v (Nat.succ_le_of_lt (mul_pos hx hy))] theorem exists_candidate_odd_shifted_divisor_pair_bound : ∃ K : ℝ, 0 < K ∧ ∀ (γ q : ℝ), 0 < γ → 0 ≤ q → q ≤ 1 → ∀ᶠ L : ℝ in atTop, ∀ (a b c d m : ℕ) [NeZero m] (W z : ℝ) (P : Finset ℕ), (m : ℝ) ≤ Real.exp L → (∀ p ∈ m.primeFactors, L^2 ≤ (p : ℝ)) → a ≤ b → c ≤ d → 0 ≤ W → W ≤ z → 1 < z → P ⊆ (candidatePIndices γ L).biUnion (candidatePBand (γ*L)) → P ⊆ primeBand 0 z → (∀ p ∈ P, ¬p ∣ m) → 2 ∉ P → (∑ v ∈ oddMaskedPairBox a b c d m W z P, q^((P.filter (fun p => p ∣ v.1*v.2-1)).card)) ≤ K * (((b : ℝ)-a)*((d : ℝ)-c)/(m : ℝ)) * (∏ p ∈ primeBand 0 W, (1 - 1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 z, (1 - 1/(p : ℝ))) * candidateOneMarkedHarmonicMass γ L q + ((m : ℝ)*(z^(10 : ℝ))^3 + (((b : ℝ)-a)+((d : ℝ)-c))*(z^(10 : ℝ))^2) := by obtain ⟨K, hK, hb⟩ := exists_candidate_odd_masked_pair_bound refine ⟨K, hK, ?_⟩ intro γ q hγ hq0 hq1 filter_upwards [hb γ q hγ hq0 hq1] with L h intro a b c d m hm W z P hmL hmin hab hcd hW hWz hz hP hPz hPm hP2 rw [← odd_masked_pair_average_eq_divisor_weight a b c d m W z q P hPz hPm hP2] exact h a b c d m W z P hmL hmin hab hcd hW hWz hz hP end Bounty end section /- The exact original physical mark history starts at its actual empty-memory initial state. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) variable (tags : ℕ → Option (I ⊕ K)) (cut : ℕ → Fin N → Finset (Fin J)) (steps : ℕ) (initialTrace : FullMixedLedgerState (fun g (p : {p // p ∈ P g}) => Subtype.val p) (M := fun _ => J + ell) B → List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (Φ : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C) → FullMixedLedgerState (fun g (p : {p // p ∈ P g}) => Subtype.val p) (M := fun _ => J + ell) B → ℂ) (f : PhysicalFullBoundedState P J ell B → ℂ) end Physical end Bounty end section /- The four actual fine-schedule tags at their chronological positions. -/ namespace Bounty theorem physical_fine_tag_visit {n : ℕ} (j : Fin (n + 1)) : physicalSelectedFineTag n (4 * j.val) = some (.inl j) := by have hj := j.isLt have hi : 4 * j.val < 4 * n + 1 := by omega have h0 : (4 * j.val) % 4 = 0 := by omega have he (h : (4 * j.val) / 4 < n + 1) : (⟨(4 * j.val) / 4, h⟩ : Fin (n + 1)) = j := Fin.ext (show (4 * j.val) / 4 = j.val from by omega) simp only [physicalSelectedFineTag, dif_pos hi, dif_pos h0, he] theorem physical_fine_tag_source_permutation {n : ℕ} (j : Fin n) : physicalSelectedFineTag n (4 * j.val + 1) = none := by have hj := j.isLt have hi : 4 * j.val + 1 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 1) % 4 = 0 := by omega have h2 : ¬ (4 * j.val + 1) % 4 = 2 := by omega simp only [physicalSelectedFineTag, dif_pos hi, dif_neg h0, dif_neg h2] theorem physical_fine_tag_edge {n : ℕ} (j : Fin n) : physicalSelectedFineTag n (4 * j.val + 2) = some (.inr j) := by have hj := j.isLt have hi : 4 * j.val + 2 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 2) % 4 = 0 := by omega have h2 : (4 * j.val + 2) % 4 = 2 := by omega have he (h : (4 * j.val + 2) / 4 < n) : (⟨(4 * j.val + 2) / 4, h⟩ : Fin n) = j := Fin.ext (show (4 * j.val + 2) / 4 = j.val from by omega) simp only [physicalSelectedFineTag, dif_pos hi, dif_neg h0, dif_pos h2, he] theorem physical_fine_tag_target_permutation {n : ℕ} (j : Fin n) : physicalSelectedFineTag n (4 * j.val + 3) = none := by have hj := j.isLt have hi : 4 * j.val + 3 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 3) % 4 = 0 := by omega have h2 : ¬ (4 * j.val + 3) % 4 = 2 := by omega simp only [physicalSelectedFineTag, dif_pos hi, dif_neg h0, dif_neg h2] end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) include hstep in theorem physical_selected_coarse_adjacent_raw_history (F : PhysicalBoundedMarkState P J ell B → ℂ) : physicalMarkRawExtension (finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedCoarseRow (B := B) C aux k L σ τ β V ρ hV ω retention) (2 * n + 1) F) (L 0) = fun s => (∏ i ∈ range (2 * n + 1), physicalSelectedCoarseScalar C aux L σ ω i) * globalBirthJointRawHistory (fun i g => physicalGroupBareAtomicActivity L g i) (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β (fun _ j => 1 - retention j) V (fun _ => ρ) hV B) (fun _ => B) (2 * n + 1) (physicalMarkRawExtension F (L (Fin.last n))) s := by rw [physical_selected_coarse_adjacent_composition C aux k L a σ τ hstep hcompat hlist hP hdis hk β V ρ hV B ω retention F] exact global_birth_joint_raw_history_weighted (fun i g => physicalGroupBareAtomicActivity L g i) (physicalJointAdjacentStep C aux k L a σ τ hcompat hlist hP hdis hk β (fun _ j => 1 - retention j) V (fun _ => ρ) hV B) (fun _ => B) (physicalSelectedCoarseScalar C aux L σ ω) (2 * n + 1) _ include hstep in theorem physical_selected_fixed_path_eq_adjacent : finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedCoarseRow (B := B) C aux k L σ τ β V ρ hV ω retention) (2 * n + 1) physicalEmptyMemoryTerminal (physicalInitialMarkState B (L 0)) = (∏ i ∈ range (2 * n + 1), physicalSelectedCoarseScalar C aux L σ ω i) * physicalJointAdjacentRawHistory C aux k L a σ τ hcompat hlist hP hdis hk β (fun _ j => 1 - retention j) V (fun _ => ρ) hV B := by have h := congrFun (physical_selected_coarse_adjacent_raw_history C aux k L a σ τ hstep hcompat hlist hP hdis hk β V ρ hV B ω retention (physicalEmptyMemoryTerminal (B := B))) (physicalMarkRawReadout (physicalInitialMarkState B (L 0))) have hext := physical_mark_extension_roundtrip (finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedCoarseRow (B := B) C aux k L σ τ β V ρ hV ω retention) (2 * n + 1) physicalEmptyMemoryTerminal) (physicalInitialMarkState B (L 0)) change physicalMarkRawExtension _ (L 0) _ = _ at hext rw [hext, physical_empty_memory_terminal_extension, physical_initial_mark_state_readout] at h exact h end ResiduePath end Bounty end section /- Enrich the original physical edge phase before restoring it as a signed forest sum. -/ open Finset Classical namespace Bounty end Bounty end section /- Passing the sharp short-cell sieve bound to the actual Buchstab density. -/ namespace Bounty open Filter Real open scoped Topology theorem exists_buchstab_density_sieve_upper : ∃ K : ℝ, 0 < K ∧ ∀ b : ℝ, 0 < b → ∀ h : ℕ, 1 ≤ h → Even h → b*(4*(h : ℝ)+2) < 1 → buchstabDensity b 1 ≤ (Mertens.primeProductLimitConstant/b)*(1+K*exp (-(h : ℝ))) := by obtain ⟨K,hK,hbound⟩ := exists_short_cell_rough_density_sieve_upper refine ⟨K,hK,?_⟩ intro b hb h hh heven hlevel have hhreal : (1 : ℝ) ≤ h := by exact_mod_cast hh have hb1 : b < 1 := by nlinarith have ht := normalized_exponential_rough_cell_tendsto (S := 1) (by norm_num) hb hb1 by_contra hn have hstrict : (Mertens.primeProductLimitConstant/b)*(1+K*exp (-(h : ℝ))) < buchstabDensity b 1 := lt_of_not_ge hn let ε := (buchstabDensity b 1- (Mertens.primeProductLimitConstant/b)*(1+K*exp (-(h : ℝ))))/2 have hε : 0 < ε := by dsimp [ε]; linarith have hlo := ht.eventually_const_lt (show (Mertens.primeProductLimitConstant/b)*(1+K*exp (-(h : ℝ)))+ε < buchstabDensity b 1 by dsimp [ε]; linarith) have hhi : ∀ᶠ L : ℝ in atTop, normalizedRoughCellCount L 1 (exp (1*L)) (exp (b*L)) ≤ (Mertens.primeProductLimitConstant/b)*(1+K*exp (-(h : ℝ)))+ε := by filter_upwards [hbound 1 b 1 (by norm_num) hb h hh heven hlevel ε hε] with L hL exact hL (exp (1*L)) le_rfl obtain ⟨L,hloL,hhiL⟩ := (hlo.and hhi).exists exact (not_lt_of_ge hhiL) hloL end Bounty /- Public declaration closure audit. -/ end section /- Sharp candidate prime-band upper density at the actual proxy cutoff. -/ open Finset Filter open scoped Topology namespace Bounty theorem sqrt_shifted_prime_avoidance_product_tendsto : Tendsto (fun L : ℝ => Real.sqrt L * shiftedPrimeAvoidanceProduct (Real.exp (Real.sqrt L))) atTop (𝓝 (shiftedSieveRatioConstant*Mertens.primeProductLimitConstant)) := by have h := logarithmic_shifted_prime_avoidance_product_tendsto.comp (Real.tendsto_exp_atTop.comp Real.tendsto_sqrt_atTop) change Tendsto (fun L : ℝ => Real.log (Real.exp (Real.sqrt L))*shiftedPrimeAvoidanceProduct (Real.exp (Real.sqrt L))) atTop _ at h simpa only [Real.log_exp] using h theorem exists_candidate_prime_band_sqrt_rough_mass_density_upper (hZ : PrimitiveZeroFreeHalfPlane) {c q a v : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) (ha : 0 < a) (hav : a ≤ v) (hvhalf : v < 1/2) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, candidatePrimeBandRoughMass c L q r jStar (Real.exp (a*L)) (Real.exp (v*L)) (Real.exp (Real.sqrt L)) ≤ (shiftedSieveRatioConstant*Mertens.primeProductLimitConstant*Real.log (v/a)+ε)* candidateCoefficientWindowMass c L q r jStar / Real.sqrt L := by obtain ⟨K, hK, hmass⟩ := exists_candidate_prime_band_sqrt_rough_mass_estimate hZ obtain ⟨J, hJ⟩ := hmass c q a v r hc hr hq0 hq1 hcenter ha hav hvhalf refine ⟨J, ?_⟩ intro jStar hj ε hε have hinv : Tendsto (fun L : ℝ => L^(-1 : ℝ)) atTop (𝓝 0) := tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 1) have hpow : Tendsto (fun L : ℝ => L^(-17 : ℝ)) atTop (𝓝 0) := tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 17) have hlim := ((sqrt_shifted_prime_avoidance_product_tendsto.mul (exponential_prime_predecessor_reciprocal_tendsto ha hav)).mul (hinv.const_add 1)).add (hpow.const_mul (1+16*primeEulerProductUpperConstant)) simp only [add_zero, mul_one, mul_zero] at hlim have hev := hlim.eventually_lt_const (show shiftedSieveRatioConstant*Mertens.primeProductLimitConstant*Real.log (v/a) < shiftedSieveRatioConstant*Mertens.primeProductLimitConstant*Real.log (v/a)+ε by linarith) filter_upwards [hJ jStar hj, hev, eventually_rough_cell_order_error_le ha hK.le (-1) 1, eventually_ge_atTop (1 : ℝ)] with L hm hd heL hL let X := candidateCoefficientWindowMass c L q r jStar let V := shiftedPrimeAvoidanceProduct (Real.exp (Real.sqrt L)) let H := ∑ p ∈ primeBand (Real.exp (a*L)) (Real.exp (v*L)), 1/((p : ℝ)-1) let C := 1+16*primeEulerProductUpperConstant have hL0 : 0 < L := zero_lt_one.trans_le hL have hsqrt : 0 < Real.sqrt L := Real.sqrt_pos.mpr hL0 have hX : 0 ≤ X := by apply sum_nonneg intro u _ exact candidate_coefficient_nonneg c L hq0 r jStar u have hV : 0 ≤ V := (shifted_prime_avoidance_product_pos _).le have hH : 0 ≤ H := by apply sum_nonneg intro p hp have hpprime := ((mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le p).mp hp).1 have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hpprime.two_le exact div_nonneg (by norm_num) (by linarith) have hC : 0 ≤ C := by dsimp [C]; positivity [primeEulerProductUpperConstant_pos] have he : K*Real.exp (-(roughCellSieveOrder L : ℝ)) ≤ L^(-1 : ℝ) := by have hp : 0 ≤ L^((-1 : ℝ)+1)*Real.exp (-(a/2)*L) := by positivity nlinarith only [heL, hp, hK] have hpow_id : L*L^(-18 : ℝ)=L^(-17 : ℝ) := by calc _ = L^(1 : ℝ)*L^(-18 : ℝ) := by rw [Real.rpow_one] _ = _ := by rw [← Real.rpow_add hL0]; norm_num have hpow_bound : Real.sqrt L*L^(-18 : ℝ) ≤ L^(-17 : ℝ) := by rw [← hpow_id] exact mul_le_mul_of_nonneg_right (Real.sqrt_le_self_iff.mpr (Or.inr hL)) (by positivity) have hmain : 0 ≤ X*V*H := mul_nonneg (mul_nonneg hX hV) hH have hupper : candidatePrimeBandRoughMass c L q r jStar (Real.exp (a*L)) (Real.exp (v*L)) (Real.exp (Real.sqrt L)) ≤ X*V*H*(1+L^(-1 : ℝ))+X*C*L^(-18 : ℝ) := by have hb := (le_abs_self _).trans hm change _ ≤ X*V*H*K*Real.exp (-(roughCellSieveOrder L : ℝ))+ X*(C*L^(-18 : ℝ)) at hb have he' := mul_le_mul_of_nonneg_left he hmain nlinarith only [hb, he'] apply (le_div_iff₀ hsqrt).mpr calc _ ≤ (X*V*H*(1+L^(-1 : ℝ))+X*C*L^(-18 : ℝ))*Real.sqrt L := mul_le_mul_of_nonneg_right hupper hsqrt.le _ = X*((Real.sqrt L*V*H)*(1+L^(-1 : ℝ))+C*(Real.sqrt L*L^(-18 : ℝ))) := by ring _ ≤ X*((Real.sqrt L*V*H)*(1+L^(-1 : ℝ))+C*L^(-17 : ℝ)) := by gcongr _ ≤ _ := by have hh := mul_le_mul_of_nonneg_left hd.le hX change X*((Real.sqrt L*V*H)*(1+L^(-1 : ℝ))+C*L^(-17 : ℝ)) ≤ _ at hh simpa only [mul_comm] using hh end Bounty end section /- The actual count-matched roughness proxy on the common Mertens density scale. -/ open Filter Real open scoped Topology namespace Bounty theorem density_ratio_error_bound {N D q K C η ε : ℝ} (hK : 0 < K) (hq : K/2 ≤ q) (hD : 0 ≤ D) (hDC : D ≤ C) (hη : 0 ≤ η) (hε : 0 ≤ ε) (hN : |N-D| ≤ η) (hQ : |q-K| ≤ η) (hsmall : (K+C)*η ≤ ε*(K*K/2)) : |N/q-D/K| ≤ ε := by have hq0 : 0 < q := (half_pos hK).trans_le hq rw [div_sub_div _ _ hq0.ne' hK.ne', abs_div, abs_of_pos (mul_pos hq0 hK)] apply (div_le_iff₀ (mul_pos hq0 hK)).mpr calc |N*K-q*D| = |K*(N-D)+D*(K-q)| := by congr 1; ring _ ≤ |K*(N-D)|+|D*(K-q)| := abs_add_le _ _ _ = K*|N-D|+D*|q-K| := by rw [abs_mul, abs_mul, abs_of_pos hK, abs_of_nonneg hD, abs_sub_comm K q] _ ≤ K*η+D*η := add_le_add (mul_le_mul_of_nonneg_left hN hK.le) (mul_le_mul_of_nonneg_left hQ hD) _ ≤ (K+C)*η := by nlinarith _ ≤ ε*(K*K/2) := hsmall _ ≤ ε*(q*K) := by apply mul_le_mul_of_nonneg_left _ hε nlinarith theorem eventually_sqrt_rough_test_proxy_coefficient_error {S a b γ₀ gap ε : ℝ} (hS : 0 ≤ S) (ha : 0 < a) (hγ₀ : 0 < γ₀) (hgap : 0 < gap) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ w γ : ℝ, a ≤ w → w ≤ b → γ₀ ≤ γ → gap ≤ w-γ → |sqrt L*roughTestCellProxyCoefficient γ L S (exp (w*L))- buchstabDensity γ w/Mertens.primeProductLimitConstant| ≤ ε := by let K := Mertens.primeProductLimitConstant have hK : 0 < K := Mertens.prime_product_limit_constant_pos obtain ⟨C, hC, hbound⟩ := buchstab_density_rectangle_bound (γ₁ := b) (w₁ := b) hγ₀ ha let η := min (K/2) (ε*(K*K)/(2*(K+C))) have hη : 0 < η := lt_min (half_pos hK) (by positivity) have hηK : η ≤ K/2 := min_le_left _ _ have hηε : (K+C)*η ≤ ε*(K*K/2) := by have h := (le_div_iff₀ (show 0 < 2*(K+C) by positivity)).mp (min_le_right (K/2) (ε*(K*K)/(2*(K+C)))) dsimp [η] nlinarith filter_upwards [eventually_normalized_rough_buchstab_error hS ha hγ₀ hgap hη, eventually_sqrt_normalized_rough_base_error ha hη S, eventually_gt_atTop (0 : ℝ)] with L hnum hden hL intro w γ hw hwb hγ hsep have hγb : γ ≤ b := by linarith obtain ⟨hD, hDC⟩ := hbound γ w hγ hγb hw hwb have hY : exp (a*L) ≤ exp (w*L) := exp_le_exp.mpr (mul_le_mul_of_nonneg_right hw hL.le) have hQ := hden (exp (w*L)) hY have hN := hnum w γ hw hwb hγ hsep have hq : K/2 ≤ normalizedRoughCellCount L S (exp (w*L)) (exp (sqrt L))/sqrt L := by have hh := (abs_le.mp hQ).1 change -η ≤ normalizedRoughCellCount L S (exp (w*L)) (exp (sqrt L))/sqrt L-K at hh linarith have hr := density_ratio_error_bound hK hq hD hDC hη.le hε.le hN hQ hηε have hs : sqrt L ≠ 0 := (sqrt_pos.2 hL).ne' have hc : logarithmicCellCountScale L S (exp (w*L)) ≠ 0 := (logarithmic_cell_count_scale_pos (S := S) hL (exp_pos _)).ne' have hid : normalizedRoughCellCount L S (exp (w*L)) (exp (γ*L)) / (normalizedRoughCellCount L S (exp (w*L)) (exp (sqrt L))/sqrt L) = sqrt L*roughTestCellProxyCoefficient γ L S (exp (w*L)) := by unfold normalizedRoughCellCount roughTestCellProxyCoefficient field_simp rwa [hid] at hr theorem eventually_rough_test_proxy_coefficient_upper {S a b γ₀ gap ε : ℝ} (hS : 0 ≤ S) (ha : 0 < a) (hγ₀ : 0 < γ₀) (hgap : 0 < gap) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ w γ : ℝ, a ≤ w → w ≤ b → γ₀ ≤ γ → gap ≤ w-γ → roughTestCellProxyCoefficient γ L S (exp (w*L)) ≤ (buchstabDensity γ w+ε)/(Mertens.primeProductLimitConstant*sqrt L) := by have hK := Mertens.prime_product_limit_constant_pos filter_upwards [eventually_sqrt_rough_test_proxy_coefficient_error (b := b) hS ha hγ₀ hgap (div_pos hε hK), eventually_gt_atTop (0 : ℝ)] with L hraw hL intro w γ hw hwb hγ hsep have hh := (abs_le.mp (hraw w γ hw hwb hγ hsep)).2 have hs := sqrt_pos.2 hL apply (le_div_iff₀ (mul_pos hK hs)).mpr have ht : sqrt L*roughTestCellProxyCoefficient γ L S (exp (w*L)) ≤ (buchstabDensity γ w+ε)/Mertens.primeProductLimitConstant := by rw [add_div] linarith have hu := (le_div_iff₀ hK).mp ht nlinarith end Bounty end section /- Uniform Lyapunov rows for an original owner, paying one common atom bound per selected child. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Owner end Bounty end section /- The candidate mixed dirty estimate with the original physical auxiliary law, concrete mixed displacement and divisor, and tilted physical birth law. Both small-slot projections, endpoint phases, and memory cutoffs are retained. -/ open Finset Filter open scoped Classical Topology namespace Bounty end Bounty end section /- The encoded forest coefficient is exactly an original event-path action with the retained residual phase. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (initial : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → (g : Fin N) → Finset (P g)) end Full end Bounty end section /- Actual majorant support admits finitely many fixed logarithmic boxes. -/ open Finset Filter namespace Bounty end Bounty end section /- The full box coefficient is the sum of the actual truncated retained integrals. -/ open Finset Filter MeasureTheory namespace Bounty theorem candidate_box_Q_test (c L : ℝ) (r jStar : ℕ) (E R : ℝ) (G : ℕ → ℂ) : (∑ n ∈ orderedSlotProductSupport (candidateQSlotChoices c L r jStar), candidateBoxRangeQWeight c L r jStar E R n*G n) = ∑ x : ∀ slot, candidateQSlotChoices c L r jStar slot, candidateBoxRangeAllocationMass c L r jStar x E R * G (orderedSlotProduct (candidateQSlotChoices c L r jStar) x) / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ) := by classical unfold candidateBoxRangeQWeight simp only [sum_mul, ite_mul, zero_mul] rw [sum_comm] apply sum_congr rfl intro x hx have hm : orderedSlotProduct (candidateQSlotChoices c L r jStar) x ∈ orderedSlotProductSupport (candidateQSlotChoices c L r jStar) := mem_image.mpr ⟨x,mem_univ _,rfl⟩ simp [hm, div_mul_eq_mul_div] end Bounty end section /- The original path action equals the signed sum on a pattern-independent forest code type. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) end Full end Bounty end section /- The literal gated clean mixed row, averaged over its original auxiliary draws, has the exact small-conditioning pairing with the physical big row. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type*} [Fintype S] [Fintype G] [DecidableEq S] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] [∀ g (p : P g), NeZero p.val] noncomputable def physicalMixedGatedCleanAction (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (Vs : S → ℝ) (q : ℝ) (sourceGate targetGate F : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) : ℂ := ∑ a : PhysicalAuxLabels P C, (physicalAuxMass V C a : ℂ) * physicalSmallBigFullPhasedAction (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) (fun g => tiltedPhysicalBirthLaw V g (b g)) ρ V (fun c => physicalMixedBigStep C k c a) Vs q (physicalSmallBigEndpointPhase (PhysicalSmallBigFullEvent (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a)) (physicalSmallBigFullTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a)) (fun r d x e => physicalSmallBigCleanInitialPhase (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) initial (physicalMixedCleanPrefixPhase C ζ θ k K a) d x r e) (fun x => physicalMixedBigStep C k (productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B x).1 a) sourceGate targetGate) F s theorem physical_mixed_gated_clean_pairing (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (q : ℝ) (W : CleanFullMemoryState P J ell B → ℝ) (smallAux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (sourceGate targetGate u F : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : (∑ s, (physicalSmallBigMeasure Vs W s : ℂ) * (starRingEnd ℂ) (u s) * physicalMixedGatedCleanAction initial V b C ζ θ ρ k K Vs q sourceGate targetGate F s) = ∑ d, ∑ r, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition Vs q (fun s => sourceGate s * u s) d x r) * physicalMixedCleanInitialAction initial V b C ζ θ ρ k K d (physicalSmallBigCondition Vs q (fun s => targetGate s * F s) d) x r := by have hswap (T : PhysicalAuxLabels P C → PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : (∑ s, (physicalSmallBigMeasure Vs W s : ℂ) * (starRingEnd ℂ) (u s) * ∑ a, (physicalAuxMass V C a : ℂ) * T a s) = ∑ a, (physicalAuxMass V C a : ℂ) * ∑ s, (physicalSmallBigMeasure Vs W s : ℂ) * (starRingEnd ℂ) (u s) * T a s := by simp only [mul_sum] rw [sum_comm] apply sum_congr rfl intro a _ apply sum_congr rfl intro s _ ring unfold physicalMixedGatedCleanAction rw [hswap] simp_rw [physical_mixed_clean_fixed_aux_pairing C k _ (fun g => tiltedPhysicalBirthLaw V g (b g)) ρ V Vs hVs q W smallAux initial (physicalMixedCleanPrefixPhase C ζ θ k K _) sourceGate targetGate u F] simp only [mul_sum] rw [sum_comm] apply sum_congr rfl intro d _ rw [sum_comm] apply sum_congr rfl intro r _ rw [sum_comm] apply sum_congr rfl intro x _ rw [← physical_mixed_clean_aux_sum_eq_action] rw [mul_sum] apply sum_congr rfl intro a _ ring end end Bounty end section /- Actual mixed edges with the original auxiliary law and a fixed initial fresh-birth exclusion. Both small and big slot averages remain at the two endpoints. The coefficient may inspect both small endpoints and every event. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} (C : G → Finset (Fin J)) (k : ℤ) abbrev PhysicalMixedCoefficientEvent (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) := PhysicalSmallBigEvent (PhysicalSmallBigFullEvent (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c g => physicalMixedEdgeDelta C k d c a g) (fun d c g => physicalMixedEdgeD C d c a g)) s noncomputable def physicalMixedCoefficientAction (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (initial : ∀ g, Finset (P g)) (Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) : ℂ := ∑ a : PhysicalAuxLabels P C, (physicalAuxMass V C a : ℂ) * physicalSmallBigFullPhasedAction (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c g => physicalMixedEdgeDelta C k d c a g) (fun d c g => physicalMixedEdgeD C d c a g) (fun g => tiltedPhysicalBirthLaw V g (baseline g)) ρ V (fun c => physicalMixedBigStep C k c a) Vs q (fun y e => if ∀ g i, (e.2.2 g).2.2.2 i ∉ initial g then Ψ a y e else 0) f s end theorem exists_physical_mixed_coefficient_projected_norm_bound {q vs : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (J B : ℕ) (C : G → Finset (Fin J)) (k : ℤ) (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (initial : ∀ g, Finset (P g)), (∀ s, vs ≤ Vs s) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → ∀ (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → ∀ T : ℕ, (∀ g, ell + (C g).card ≤ T) → ∀ (Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (H : ℝ), 0 ≤ H → (∀ a s e, ‖Ψ a s e‖ ≤ H) → ∀ f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ, (∀ s, ProductMemorySymmetric (fun x => f (s,x))) → let μ := fun g => tiltedPhysicalBirthLaw V g (baseline g) let W := productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)) cleanActiveNorm (physicalSmallBigMeasure Vs W) (physicalSmallBigJointAverage (physicalMixedCoefficientAction C k V baseline ρ Vs q initial Ψ (physicalSmallBigJointAverage f))) ≤ H * A ^ Fintype.card S * Real.sqrt (unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_phased_energy_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ intro S G _ dS _ dG cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ J B C k V baseline ρ Vs initial hVs hMass hbaseline v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi T ht Ψ H hH hΨ f hf μ W have hVs0 : ∀ s, 0 < Vs s := fun s => hvs.trans_le (hVs s) have hV : ∀ g, 0 < V g := fun g => hvmin.trans_le (hVlo g) have hμ : ∀ g p, 0 ≤ μ g p := fun g p => tiltedPhysicalBirthLaw_nonneg V g (baseline g) (hV g).le (fun p => (by norm_num : (0 : ℝ) ≤ 1/2).trans (hbaseline g p).1) p have hmass : ∀ g, ∑ p, μ g p ≤ 2 := fun g => (tiltedPhysicalBirthLaw_sum_bounds V g (baseline g) (hV g) (hMass g) (hbaseline g)).2 have hW : ∀ x, 0 ≤ W x := productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1) let K := unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G have hK : 0 ≤ K := pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _ have hcost : 0 ≤ H ^ 2 * (A ^ (2 * Fintype.card S) * K) := mul_nonneg (sq_nonneg _) (mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) hK) let f' := physicalSmallBigJointAverage f have hf' : ∀ s, ProductMemorySymmetric (fun x => f' (s,x)) := physical_small_big_joint_average_memory_symmetric f hf let smallAux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J))) := fun _ j => False.elim (notMem_empty j.val j.property) have hlocal (a : PhysicalAuxLabels P C) := hbound S G Ps (fun g => ↥(P g)) (fun g p => p.val) J (fun _ => J + ell) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c g => physicalMixedEdgeDelta C k d c a g) (fun d c g => physicalMixedEdgeD C d c a g) μ ρ V (fun c => physicalMixedBigStep C k c a) Vs hVs smallAux v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T (fun g => by simpa only [physical_full_unshared_indices_card] using ht g) (fun y e => if ∀ g i, (e.2.2 g).2.2.2 i ∉ initial g then Ψ a y e else 0) H hH (by intro y e; split_ifs; exact hΨ a y e; simpa only [norm_zero] using hH) f' hf' have havg : physicalSmallBigEnergy Vs W (physicalMixedCoefficientAction C k V baseline ρ Vs q initial Ψ f') ≤ (H ^ 2 * (A ^ (2 * Fintype.card S) * K)) * physicalSmallBigEnergy Vs W f' := by apply physical_small_big_auxiliary_energy_bound Vs hVs0 W hW (physicalAuxMass V C) (physical_aux_mass_nonneg V C (fun g => (hV g).le)) (physical_aux_mass_sum V C hV hMass).le _ f' _ hcost intro a convert hlocal a using 1 have hin : physicalSmallBigEnergy Vs W f' ≤ physicalSmallBigEnergy Vs W f := by convert physical_small_big_joint_average_energy_le Vs hVs0 μ (fun g => unrestrictedResidueWeight (μ g)) hμ (fun g z => hμ g z.1) f using 1 let out := physicalMixedCoefficientAction C k V baseline ρ Vs q initial Ψ f' have hout : physicalSmallBigEnergy Vs W (physicalSmallBigJointAverage out) ≤ physicalSmallBigEnergy Vs W out := by convert physical_small_big_joint_average_energy_le Vs hVs0 μ (fun g => unrestrictedResidueWeight (μ g)) hμ (fun g z => hμ g z.1) out using 1 have henergy : physicalSmallBigEnergy Vs W (physicalSmallBigJointAverage out) ≤ (H ^ 2 * (A ^ (2 * Fintype.card S) * K)) * physicalSmallBigEnergy Vs W f := hout.trans (havg.trans (mul_le_mul_of_nonneg_left hin hcost)) apply physical_small_big_norm_le_of_energy Vs W (H * A ^ Fintype.card S) K (mul_nonneg hH (pow_nonneg (zero_le_one.trans hA) _)) hK f _ have hp : (A ^ Fintype.card S) ^ 2 = A ^ (2 * Fintype.card S) := by rw [← pow_mul, Nat.mul_comm] simp only [mul_pow, hp, mul_assoc] at henergy ⊢ convert henergy using 1 congr 2 end Bounty end section /- The actual smooth diagonal has any required power saving after choosing the allocation gap. -/ open Finset Filter Real namespace Bounty theorem exists_typeII_actual_diagonal_saving {C : ℝ} (hC : 0 ≤ C) (aE aN aM aH D : ℝ) : ∃ K₀ : ℝ, 0 < K₀ ∧ ∀ᶠ L : ℝ in atTop, ∀ (K U V : ℝ) (M H : Finset ℕ) (α a : ℕ → ℂ), K₀ ≤ K → 0 < U → 0 < V → 1 ≤ U*V → log (U*V) ≤ C*L → (∀ m ∈ M, 0 < m) → (∀ m ∈ M, (m : ℝ) ≤ 2*U) → (∀ h ∈ H, 0 < h) → (∀ m ∈ M, ‖α m‖ ≤ L^aM) → (∀ h ∈ H, ‖a h‖ ≤ L^aH*(h.divisors.card : ℝ)) → let E := U*L^(-K) let EF := Icc ⌈E/(2*L^88)⌉₊ ⌊2*E⌋₊ let NF := Icc ⌈V/2⌉₊ ⌊3*V⌋₊ let η := fun e n : ℕ => typeIIEMajorant (L^88) ((e : ℝ)/E) * typeIINMajorant ((n : ℝ)/V) (2*E*V*(L^aE)^2*(L^aN)^2)*typeIIDiagonalEnergy EF NF M H η α a ≤ (U*V)^2*L^(-D) := by let K₀ := max 1 (2*aE+2*aN+2*aM+2*aH+17+D) refine ⟨K₀,lt_of_lt_of_le (by norm_num : (0 : ℝ) < 1) (le_max_left _ _),?_⟩ filter_upwards [eventually_typeII_diagonal_moment_cost hC, eventually_ge_atTop (2 : ℝ)] with L hcost hL intro K U V M H α a hK hU hV hUV hlogUV hMpos hM hH hα ha have hL0 : 0 < L := by linarith have hE : 0 < U*L^(-K) := mul_pos hU (rpow_pos_of_pos hL0 _) have hd := typeII_actual_smooth_diagonal M H α a hL0 hE hU hV hMpos hM hH hα ha have hm : 2*(⌊6*U*V⌋₊ : ℝ)*(1+log (⌊6*U*V⌋₊ : ℝ))^15 ≤ (U*V)*L^(16 : ℝ) := by simpa only [mul_assoc] using hcost (U*V) hUV hlogUV dsimp only at hd ⊢ have hd' := hd.trans (mul_le_mul_of_nonneg_left hm (mul_nonneg (sq_nonneg (L^aM)) (sq_nonneg (L^aH)))) exact (mul_le_mul_of_nonneg_left hd' (by positivity)).trans (typeII_diagonal_scalar_saving hL ((le_max_right 1 _).trans hK)) end Bounty end section /- Original reconstructed ghost and full auxiliary edge events write exactly their sampled primes. -/ namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) section Ghost variable (j : J) (htag : steps.get u = some (.inl j)) (sk : CoupledGhostSkeleton M B s) (births : CoupledGhostSamples M B s sk) theorem full_mixed_common_ghost_history_sample_label (i : CoupledGhostSampleIndex M B s sk) : fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inl j)) htag s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩)) history (fullMixedCommonGhostSampleEmbedding S B j steps u htag s sk i) = some ⟨i.1, (births i).1⟩ := by have h := full_mixed_common_tagged_history_write_here n S B A Δ D steps u (some (.inl j)) htag s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩) history (fullMixedBirthCoordinateEquiv n S B A Δ D (some (.inl j)) s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩) i).val refine h.trans ?_ exact congrArg (Option.map (fullMixedBornPrime n)) (full_mixed_birth_coordinate_data n S B A Δ D (some (.inl j)) s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩) i) theorem full_mixed_common_ghost_history_sample_coverage (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : ((fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inl j)) htag s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩)) history i).isSome = true ∧ fullMixedCommonIndexStage M B steps i = u.succ) ↔ ∃ c, fullMixedCommonGhostSampleEmbedding S B j steps u htag s sk c = i := full_mixed_common_tagged_history_write_coverage n S B A Δ D steps u (some (.inl j)) htag s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩) history i end Ghost section Edge variable (k : K) (htag : steps.get u = some (.inr k)) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk) theorem full_mixed_common_edge_history_sample_label (i : FullActiveEdgeSampleIndex n (S k) B (A k) (Δ k) (D k) s sk) : fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inr k)) htag s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, fresh⟩)) history (fullMixedCommonEdgeSampleEmbedding n S B k steps u htag (A k) (Δ k) (D k) s sk i) = some ⟨i.1, fresh i⟩ := by have h := full_mixed_common_tagged_history_write_here n S B A Δ D steps u (some (.inr k)) htag s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, fresh⟩) history (fullMixedBirthCoordinateEquiv n S B A Δ D (some (.inr k)) s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, fresh⟩) i).val refine h.trans ?_ exact congrArg (Option.map (fullMixedBornPrime n)) (full_mixed_birth_coordinate_data n S B A Δ D (some (.inr k)) s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, fresh⟩) i) theorem full_mixed_common_edge_history_sample_coverage (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : ((fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inr k)) htag s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, fresh⟩)) history i).isSome = true ∧ fullMixedCommonIndexStage M B steps i = u.succ) ↔ ∃ c, fullMixedCommonEdgeSampleEmbedding n S B k steps u htag (A k) (Δ k) (D k) s sk c = i := full_mixed_common_tagged_history_write_coverage n S B A Δ D steps u (some (.inr k)) htag s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, fresh⟩) history i end Edge end Full end Bounty end section /- Common forest stage factors at the original ghost, edge, and birth-free permutation events. -/ open Classical Finset namespace Bounty section Gain variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) theorem full_mixed_common_forest_history_gain_tagged (u : Fin steps.length) (tag : Option (J ⊕ K)) (htag : steps.get u = tag) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val tag s e history = if birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u tag htag s e) history) code then 1 else 0 := by subst tag exact full_mixed_common_forest_history_gain_owner n S B A Δ D steps code u s e history theorem full_mixed_common_none_owner_empty (u : Fin steps.length) (htag : steps.get u = none) (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : fullMixedCommonIndexStage M B steps i ≠ u.succ := by intro hi obtain ⟨a, _⟩ := (full_mixed_common_index_stage_succ_iff M B steps u i).mp hi have hempty : ∀ a : FullMixedCommonLocalAddress M B (steps.get u), False := by rw [htag] intro a exact Fin.elim0 a.2 exact hempty a theorem full_mixed_common_none_selected_count (u : Fin steps.length) (htag : steps.get u = none) (g : Fin N) : fullMixedCommonSelectedCount M B steps code u g = 0 := by apply card_eq_zero.mpr apply filter_eq_empty_iff.mpr intro i _ hi exact full_mixed_common_none_owner_empty B steps u htag i hi.1 theorem full_mixed_common_forest_history_gain_none (u : Fin steps.length) (htag : steps.get u = none) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D none s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val none s e history = 1 := by rw [full_mixed_common_forest_history_gain_tagged n S B A Δ D steps code u none htag] apply if_pos intro i hi exact False.elim (full_mixed_common_none_owner_empty B steps u htag i hi) end Gain end Bounty end section /- The common forest leaves only the actual local residual phase; its norm bound has no residual initial-avoidance mask. -/ namespace Bounty section Residual variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) end Residual end Bounty end section /- Four-factor integral decay with actual small-prime exceptional sets. Both integral-energy inputs are discharged from literal dyadic coefficients. The high- and low-frequency pointwise estimates remain explicit. -/ open Filter Finset Set MeasureTheory namespace Bounty theorem eventually_prime_four_factor_integral_decay {a beta c d Bcoeff A As H Bsave B0 Cmean Cres kmean kres q t : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hd : 0 < d) (hBcoeff : 1 ≤ Bcoeff) (hAs0 : 0 ≤ As) (hAs : A + (Cmean + 2 + 2 * kmean) + 1 ≤ 2 * As) (hH : A + 2 + (Cres + 2 + 2 * kres) + 1 ≤ 2 * H) (hBsave : A + B0 + 2 + 2 * q + 2 * t + 1 ≤ 2 * Bsave) : ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R : ℝ), 1 ≤ Y → d * L ≤ Real.log Y → Real.log Y ≤ c * L → Real.exp (L ^ a) / 2 ≤ P → P ≤ Real.exp (L ^ beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) → (∀ p : s, ‖coeff p‖ ≤ Bcoeff) → ∀ (Q M T : ℝ → ℂ), Continuous Q → Continuous M → Continuous T → (∀ u ∈ Set.Icc (-R) R, ‖Q u‖ ≤ L ^ q) → (∀ u ∈ Set.Icc (-R) R, ‖T u‖ ≤ L ^ t) → (∀ u ∈ Set.Icc (-R) R, L ^ B0 < |u| → ‖Q u‖ ≤ L ^ (-H)) → (∀ u ∈ Set.Icc (-R) R, |u| ≤ L ^ B0 → ‖M u‖ ≤ L ^ (-Bsave)) → ∀ (Km Kr : ℕ) (lom him : Fin Km → ℕ) (lor hir : Fin Kr → ℕ) (wm : Fin Km → ℕ → ℂ) (wr : Fin Kr → ℕ → ℂ) (Um : Fin Km → ℝ) (Ur : Fin Kr → ℝ), (Km : ℝ) ≤ L ^ kmean → (Kr : ℝ) ≤ L ^ kres → (∀ j, 1 ≤ Um j ∧ R ≤ Um j ∧ Real.log (Um j) ≤ c * L ∧ Um j ≤ (lom j : ℝ) ∧ (him j : ℝ) ≤ 2 * Um j ∧ (∑ n ∈ Finset.Icc (lom j) (him j), ‖wm j n‖ ^ 2) ≤ L ^ Cmean / Um j) → (∀ j, Y ^ (3 / 5 : ℝ) ≤ Ur j ∧ Ur j ≤ (lor j : ℝ) ∧ (hir j : ℝ) ≤ 2 * Ur j ∧ (∑ n ∈ Finset.Icc (lor j) (hir j), ‖wr j n‖ ^ 2) ≤ L ^ Cres / Ur j) → (∀ u, Q u * M u * T u = ∑ j : Fin Km, ∑ n ∈ Finset.Icc (lom j) (him j), wm j n * Complex.exp ((Real.log (n : ℝ) * u : ℝ) * Complex.I)) → (∀ u, M u * T u = ∑ j : Fin Kr, ∑ n ∈ Finset.Icc (lor j) (hir j), wr j n * Complex.exp ((Real.log (n : ℝ) * u : ℝ) * Complex.I)) → (∫ u in Set.Icc (-R) R, ‖primeReciprocalPolynomial s coeff u * Q u * M u * T u‖ ^ 2) ≤ L ^ (-A) := by filter_upwards [eventually_dyadic_family_mean_energy (C := Cmean) (k := kmean) hc, eventually_prime_exceptional_dyadic_family_energy (C := Cres) (k := kres) ha ha1 hbeta hc hAs0 hBcoeff hd, eventually_ge_atTop (4 : ℝ), eventually_ge_atTop (2 * Bcoeff)] with L hmean hsparse hL hLB intro s hs coeff Y P R hY hloglo hloghi hPlo hPhi hR hRY hband hcoeff Q M T hQ hM hT hQbound hTbound hhigh hlow Km Kr lom him lor hir wm wr Um Ur hKm hKr hmdata hrdata hmrep hrrep have hL1 : 1 ≤ L := by linarith have hP1 : 1 ≤ P := by have hx : 1 ≤ L ^ a := Real.one_le_rpow hL1 ha.le have he : Real.exp 1 ≤ Real.exp (L ^ a) := Real.exp_le_exp.mpr hx have htwo : 2 ≤ Real.exp (1 : ℝ) := by have hh := Real.add_one_le_exp (1 : ℝ) norm_num at hh ⊢ exact hh linarith have hS : Continuous (primeReciprocalPolynomial s coeff) := by unfold primeReciprocalPolynomial fun_prop have hSbound : ∀ u ∈ Set.Icc (-R) R, ‖primeReciprocalPolynomial s coeff u‖ ≤ L ^ (1 : ℝ) := by intro u _ simpa only [Real.rpow_one] using (prime_reciprocal_polynomial_norm_le s coeff hP1 (zero_le_one.trans hBcoeff) hband hcoeff u).trans hLB have hmean' := hmean Km lom him wm Um R hKm hR hmdata simp_rw [← hmrep] at hmean' have hsparse' := hsparse s hs coeff Y P R hY hloglo hloghi hPlo hPhi hR hRY hband hcoeff Kr lor hir wr Ur hKr hrdata simp_rw [← hrrep] at hsparse' have hE : {u ∈ Set.Icc (-R) R | L ^ (-As) < ‖primeReciprocalPolynomial s coeff u‖} = primeExceptionalTimes s coeff (L ^ (-As)) R := by ext u change ((-R ≤ u ∧ u ≤ R) ∧ _) ↔ (|u| ≤ R ∧ _) rw [abs_le] refine three_regime_integral_decay R (primeReciprocalPolynomial s coeff) Q M T hS hQ hM hT hL hAs (by simpa using hH) (by simpa using hBsave) hSbound hQbound hTbound ?_ hlow hmean' ?_ · intro u hu _ hlarge exact hhigh u hu hlarge · simpa only [hE] using hsparse' end Bounty end section /- Partial summation of the oscillatory rough count keeps the frequency in the coefficients. -/ open Finset namespace Bounty theorem exists_rough_harmonic_phase_bound (τ : ℝ) (hτ : 0 < τ) : ∃ δ C K N0 : ℝ, 0 < δ ∧ 0 < C ∧ 0 < K ∧ 1 ≤ N0 ∧ ∀ (z : ℝ) (h : ℕ), 1 < z → 1 ≤ h → Even h → ∀ (Y x u : ℝ) (a b q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), a ≤ b → Y ≤ (a : ℝ)+1 → (b : ℝ) ≤ 2*Y → N0 ≤ Y/(z^(4*(h : ℝ)+2)*(q : ℝ)) → 1 ≤ x → x^(τ/2) ≤ Y/(z^(4*(h : ℝ)+2)*(q : ℝ)) → u ≠ 0 → |u| ≤ x^2 → ‖∑ n ∈ (Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ)), harmonicMellinWeight u n*χ (n : ZMod q)‖ ≤ 3*K*(2*Real.exp (-(h : ℝ))+z^(4*(h : ℝ)+2)/Y+ C*Real.log (2*z)*(1/|u|+(Y/(z^(4*(h : ℝ)+2)*(q : ℝ)))^(-δ))) := by obtain ⟨δ,C,K,N0,hδ,hC,hK,hN0,hraw⟩ := exists_rough_logarithmic_sieve_bound τ hτ refine ⟨δ,C,K,N0,hδ,hC,hK,hN0,?_⟩ intro z h hz hh heven Y x u a b q hqInst χ hab hYa hbY hN hx hxN hu hux have hz0 : 0 < z := lt_trans zero_lt_one hz have hqR : 0 < (q : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) have hlevel : 0 < z^(4*(h : ℝ)+2) := Real.rpow_pos_of_pos hz0 _ have hNpos : 0 < Y/(z^(4*(h : ℝ)+2)*(q : ℝ)) := lt_of_lt_of_le (lt_of_lt_of_le zero_lt_one hN0) hN have hY : 0 < Y := (div_pos_iff.mp hNpos).resolve_right (by intro ht exact (not_lt_of_ge (mul_pos hlevel hqR).le) ht.2) |>.1 have hlog : 0 ≤ Real.log (2*z) := Real.log_nonneg (by linarith) by_cases heq : a = b · subst b simp only [Ioc_self,filter_empty,sum_empty,norm_zero] positivity have hab' : a < b := lt_of_le_of_ne hab heq let g : ℕ → ℂ := fun n => if ∀ p ∈ n.primeFactors, z < (p : ℝ) then χ (n : ZMod q)*Complex.exp (((u*Real.log (n : ℝ) : ℝ) : ℂ)*Complex.I) else 0 let B : ℝ := K*(2*Y*Real.exp (-(h : ℝ))+z^(4*(h : ℝ)+2))+ Y*(C*(1/|u|+(Y/(z^(4*(h : ℝ)+2)*(q : ℝ)))^(-δ)))*(K*Real.log (2*z)) have hB : 0 ≤ B := by dsimp [B]; positivity have hprefix : ∀ i ∈ Icc a b, ‖∑ n ∈ Ioc a i, g n‖ ≤ B := by intro i hi have hi' := mem_Icc.mp hi have hb := hraw z h hz hh heven Y x u a i q χ hi'.1 hYa ((Nat.cast_le.mpr hi'.2).trans hbY) hN hx hxN hu hux simpa only [sum_filter,g,B] using hb have hb := norm_harmonic_mellin_interval_sum_le (v := 0) g hY hab' (by simpa only [Nat.cast_add,Nat.cast_one] using hYa) hbY hB hprefix simp only [abs_zero,mul_zero,add_zero] at hb have he : (∑ n ∈ (Ioc a b).filter (fun n : ℕ => ∀ p ∈ n.primeFactors, z < (p : ℝ)), harmonicMellinWeight u n*χ (n : ZMod q)) = ∑ n ∈ Ioc a b, harmonicMellinWeight 0 n*g n := by rw [sum_filter] apply sum_congr rfl intro n hn simp only [g,harmonicMellinWeight,zero_mul,Complex.ofReal_zero, mul_zero,Complex.exp_zero] rw [mul_comm Complex.I] split_ifs <;> ring rw [he] apply hb.trans_eq dsimp [B] field_simp end Bounty end section /- Exact original full-vertex pair sum on the shared good event. -/ open Finset open scoped Classical namespace Bounty theorem physical_good_original_pair_sum_eq_marked_averages {G : Type*} [Fintype G] [dG : DecidableEq G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (V : G → ℝ) (q : ℝ) (aux : PhysicalAuxLabels P C) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) (b : GroupMarkedLists P (fun g => ell + (C g).card) → GroupMarkedLists P (fun g => ell + (C g).card) → ℂ) : (∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then ((physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * (if ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z then ((physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * (w : ℤ)) * physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * (z : ℤ)) : ℝ) : ℂ) * b (physicalGroupUnsharedEmbedding C L) (physicalGroupUnsharedEmbedding C R) else 0) else 0) = (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (w : ℤ) : ℂ) * (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (z : ℤ) : ℂ) * groupMarkedAverage P (fun g => ell + (C g).card) (w : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) (z : ℤ) (fun v => ∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if physicalRawCutGood C u v s then if ∀ g j, s g j ∉ physicalSharedForbidden C aux g w z then (physicalAuxMass V (fun g => univ \ C g) s : ℂ) * b u v else 0 else 0)) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) calc _ = ∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then ((physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * ((physicalUnsharedVertex C L q (w : ℤ) : ℂ) * (physicalUnsharedVertex C R q (z : ℤ) : ℂ) * (if ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z then b (physicalGroupUnsharedEmbedding C L) (physicalGroupUnsharedEmbedding C R) else 0)) else 0 := by apply sum_congr rfl intro L _ apply sum_congr rfl intro R _ by_cases hLR : physicalSharedCompatible C L R · simp only [if_pos hLR] by_cases ha : ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z · simp only [if_pos ha] rw [physical_shared_vertex_pair_of_draw_avoids C L R aux hLR hprime hdis q hw hz ha, Complex.ofReal_mul] · simp only [if_neg ha, mul_zero] · simp only [if_neg hLR] _ = _ := by have he := physical_stripped_pair_sum_eq_marked_averages P C V q (w : ℤ) (z : ℤ) (fun u v s => if ∀ g j, s g j ∉ physicalSharedForbidden C aux g w z then b u v else 0) refine he.trans ?_ apply congrArg (fun x : ℂ => (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (w : ℤ) : ℂ) * (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (z : ℤ) : ℂ) * x) apply congrArg (groupMarkedAverage P (fun g => ell + (C g).card) (w : ℤ)) funext u apply congrArg (groupMarkedAverage P (fun g => ell + (C g).card) (z : ℤ)) funext v apply sum_congr rfl intro s _ by_cases hc : physicalRawCutGood C u v s · simp only [if_pos hc, mul_ite, mul_zero] · simp only [if_neg hc] end Bounty end section /- The actual common forest action is the Fourier integral of chronological signed rows, with the common initial-birth multiplier kept outside the rows. -/ open Finset Classical MeasureTheory namespace Bounty section Fourier variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) s → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (encode : ((g : Fin N) × P g) → ℤ) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) end Fourier end Bounty end section /- Pointwise norm comparison for the actual compatible endpoint-pair sum. -/ open Finset open scoped Classical namespace Bounty theorem physical_pair_sum_norm_le_from_bound {G : Type*} [Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (V : G → ℝ) (hV : ∀ g, 0 < V g) (F : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → ℂ) (B : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → ℝ) (hB : ∀ L R, physicalSharedCompatible C L R → ‖F L R‖ ≤ B L R) : ‖∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then ((physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * F L R else 0‖ ≤ ‖∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then ((physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * (B L R : ℂ) else 0‖ := by rw [physical_compatible_pair_sum_eq_cut_sum, physical_compatible_pair_sum_eq_cut_sum] apply finite_weighted_norm_le_majorant_norm · intro d exact div_nonneg (mul_nonneg (physical_state_mass_pos V hV J ell).le (physical_completion_mass_pos V C ell hV).le) (Nat.cast_nonneg _) · intro d apply hB rw [physical_cut_shared_compatible_iff, physical_cut_glue_shared, physical_cut_glue_shared] end Bounty end section /- On the good shared draw, the original auxiliary exclusions are exactly the exclusions against the unshared endpoint lists. -/ open Finset open scoped Classical namespace Bounty def physicalUnsharedAuxAvoids {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (u : GroupMarkedLists P (fun g => ell + (C g).card)) : Prop := ∀ g (j : C g) s, aux g j ≠ u g s theorem physical_aux_avoids_iff_of_good_shared {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (L : PhysicalMarkLists P J ell) (w z : ℕ) (hgood : ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z) : physicalAuxAvoids C aux L ↔ physicalUnsharedAuxAvoids C aux (physicalGroupUnsharedEmbedding C L) := by rw [physical_aux_avoids_shared_unshared_iff] have hs : ∀ g (j : C g) (s : ↥(univ \ C g)), aux g j ≠ L g (Sum.inl s.val) := by intro g j s he apply hgood g s exact mem_filter.mpr ⟨mem_univ _, Or.inr ⟨j, he⟩⟩ exact and_iff_right hs theorem physical_list_admissible_iff_of_good_shared {G : Type*} {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) (w z : ℕ) (hLR : physicalSharedCompatible C L R) (hgood : ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z) : physicalListAdmissible C aux L R ↔ physicalUnsharedAuxAvoids C aux (physicalGroupUnsharedEmbedding C L) ∧ physicalUnsharedAuxAvoids C aux (physicalGroupUnsharedEmbedding C R) := by have hgR : ∀ g j, physicalSharedAux C R g j ∉ physicalSharedForbidden C aux g w z := by rw [← physical_shared_aux_eq_of_compatible C hLR] exact hgood rw [physicalListAdmissible, and_iff_right hLR, physical_aux_avoids_iff_of_good_shared C aux L w z hgood, physical_aux_avoids_iff_of_good_shared C aux R w z hgR] end Bounty end section /- Exact full-pair summation at a single shared quotient position. -/ open Finset open scoped Classical namespace Bounty theorem physical_scaled_root_sum_full_pair {G : Type*} [Fintype G] [dG : DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (C : G → Finset (Fin J)) (q a b : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (positions : Finset ℤ) (w : ℤ) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) (hf : ∀ (L : PhysicalMarkLists P J ell) w, f ((physicalSharedFactor C L : ℤ) * w) = f w) (hg : ∀ (L : PhysicalMarkLists P J ell) w, g ((physicalSharedFactor C L : ℤ) * w) = g w) : (physicalStateMass V J ell : ℂ) * (∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if (physicalSharedFactor C L : ℤ) * w ∈ positions ∧ (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) ∈ positions then physicalRootPositionTerm V C q (-(a+b)) k K aux (fun n => physicalPhase (-a) n.natAbs * f n) (fun n => physicalPhase b n.natAbs * g n) Ψ Z L R ((physicalSharedFactor C L : ℤ) * w) else 0) = (physicalAuxMass V C aux : ℂ) * (Ψ ((w : ℝ) / (Z * physicalFreeFactor C aux)) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (f w) * g (w + k * (physicalFreeFactor C aux : ℕ))) * physicalFullPairCorrelation P C V q w.natAbs (w + k * (physicalFreeFactor C aux : ℕ)).natAbs (fun L R => if (physicalSharedFactor C L : ℤ) * w ∈ positions ∧ (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) ∈ positions then physicalPhasedPairCoefficient C K aux a b w.natAbs (w + k * (physicalFreeFactor C aux : ℕ)).natAbs L R else 0) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold physicalFullPairCorrelation simp only [mul_sum] apply sum_congr rfl intro L _ apply sum_congr rfl intro R _ by_cases hguard : (physicalSharedFactor C L : ℤ) * w ∈ positions ∧ (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) ∈ positions · rw [if_pos hguard, physical_phased_root_term_scaled hprime V C q a b k K aux f g Ψ Z L R w (hf L w) (hg L _)] by_cases hshared : physicalSharedCompatible C L R · rw [if_pos hshared, if_pos hguard] push_cast ring · have hc : physicalPhasedPairCoefficient C K aux a b w.natAbs (w + k * (physicalFreeFactor C aux : ℕ)).natAbs L R = 0 := by apply if_neg exact fun h => hshared h.1 rw [if_neg hshared, hc] simp only [mul_zero] · rw [if_neg hguard] by_cases hshared : physicalSharedCompatible C L R · rw [if_pos hshared, if_neg hguard] simp only [mul_zero] · rw [if_neg hshared] simp only [mul_zero] end Bounty end section /- Polynomial envelopes for the actual finite comparison patterns. -/ open Finset Real open scoped Classical namespace Bounty theorem harmonic_pattern_bound_power {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) {L q x ξ : ℝ} (hL : 1 ≤ L) (hq : 0 ≤ q) (hx : 0 ≤ x) (Q : ℕ) (hQ : (Q : ℝ) ≤ L^q) (hξ : L^(-x) ≤ ξ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) : repeatedBigPrimePatternBound probes r t Q ξ i ≤ L^(4*q+2*x) := by have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL have hξ0 : 0 < ξ := (rpow_pos_of_pos hL0 (-x)).trans_le hξ have hQQ : ((Q*Q : ℕ) : ℝ) ≤ L^(2*q) := by rw [Nat.cast_mul] calc _ ≤ L^q*L^q := mul_self_le_mul_self (Nat.cast_nonneg _) hQ _ = _ := by rw [← rpow_add hL0]; congr 1; ring have hf : ((Q*Q : ℕ) : ℝ)/ξ ≤ L^(2*q+x) := by apply (div_le_iff₀ hξ0).mpr calc _ ≤ L^(2*q) := hQQ _ = L^(2*q+x)*L^(-x) := by rw [← rpow_add hL0]; congr 1; ring _ ≤ L^(2*q+x)*ξ := mul_le_mul_of_nonneg_left hξ (rpow_nonneg hL0.le _) cases i with | inl u => exact one_le_rpow hL (by positivity) | inr ab => change (((Q*Q : ℕ) : ℝ)/ξ)^2 ≤ _ calc _ ≤ (L^(2*q+x))^2 := by simpa only [pow_two] using mul_self_le_mul_self (div_nonneg (Nat.cast_nonneg _) hξ0.le) hf _ = _ := by rw [pow_two, ← rpow_add hL0]; congr 1; ring theorem harmonic_pattern_card_power {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) {L A : ℝ} (hL : 2 ≤ L) (hA : 0 ≤ A) (hslots : ((J*Fintype.card G : ℕ) : ℝ) ≤ A*log L) : (Fintype.card (RepeatedBigPrimePatternIndex (ell := ell) probes r t) : ℝ) ≤ L^(A*log 2+1) := by have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hc : Fintype.card (RepeatedBigPrimePatternIndex (ell := ell) probes r t) ≤ 1+2^(J*Fintype.card G) := by simpa only [RepeatedBigPrimePatternIndex, Fintype.card_sum, Fintype.card_unit, Fintype.card_fin] using Nat.add_le_add_left (repeated_big_prime_pattern_pair_card_le_groups (ell := ell) probes r t hrt (fun _ => card_le_univ _)) 1 have hp : (2 : ℝ)^(J*Fintype.card G) ≤ L^(A*log 2) := by calc _ = exp (log 2*((J*Fintype.card G : ℕ) : ℝ)) := by rw [← rpow_natCast, rpow_def_of_pos (by norm_num : (0 : ℝ) < 2)] _ ≤ exp (log 2*(A*log L)) := exp_le_exp.mpr (mul_le_mul_of_nonneg_left hslots (log_nonneg (by norm_num))) _ = _ := by rw [rpow_def_of_pos hL0]; congr 1; ring have hone : 1 ≤ L^(A*log 2) := one_le_rpow hL1 (mul_nonneg hA (log_nonneg (by norm_num))) calc _ ≤ (1 : ℝ)+2^(J*Fintype.card G) := by exact_mod_cast hc _ ≤ 1+L^(A*log 2) := add_le_add le_rfl hp _ ≤ L^(A*log 2)+L^(A*log 2) := add_le_add hone le_rfl _ = 2*L^(A*log 2) := by ring _ ≤ L*L^(A*log 2) := mul_le_mul_of_nonneg_right hL (rpow_nonneg hL0.le _) _ = L^(A*log 2+1) := by nth_rw 1 [← rpow_one L] rw [← rpow_add hL0] congr 1 ring end Bounty end section /- In each cell/character term, the two weighted selected endpoint averages are independent of the auxiliary prime draws. -/ open Finset open scoped Classical namespace Bounty theorem physical_prime_cell_average {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (S : Finset G) (hA : ∀ i ∈ A, i.1 ∈ S) (hB : ∀ i ∈ B, i.1 ∈ S) (q : ℝ) (w z : ℤ) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : let PA := fun i : A => P i.val.1 let PB := fun i : B => P i.val.1 let VA := fun i : A => V i.val.1 let VB := fun i : B => V i.val.1 let a := fun d => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := PA) VA)) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) d : ℝ) : ℂ) let b := fun e => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := PB) VB)) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) e : ℝ) : ℂ) let marks := fun g => ell + (repeatedBigAuxCut A B g).card let W := fun n => markedDivisorWeight univ P q V marks n let split := repeatedBigAuxSplitEquiv P A B hU hAB aux ((W w*W z : ℝ) : ℂ) * groupMarkedAverage P marks w (fun u => groupMarkedAverage P marks z (fun v => physicalUnsharedPrimeCoefficient P V A B hU hAB Q h keptA keptB u v aux)) = ∑ d ∈ keptA, ∑ χ : BoundedPrimitiveCharacter Q, ∑ e ∈ keptB, ∑ ψ : BoundedPrimitiveCharacter Q, ((a d*b e) * ((starRingEnd ℂ) (primeProductCellCharacter PA h d χ split.1) * (starRingEnd ℂ) (primeProductCellCharacter PB h e ψ split.2))) * (((W w : ℂ) * groupMarkedAverage (fun g : S => P g.val) (fun g : S => marks g.val) w (fun u => primeProductCellCharacter PB h e ψ (physicalSelectedPrimeRestriction A B B subset_union_right S hB u))) * ((W z : ℂ) * groupMarkedAverage (fun g : S => P g.val) (fun g : S => marks g.val) z (fun v => primeProductCellCharacter PA h d χ (physicalSelectedPrimeRestriction A B A subset_union_left S hA v)))) := by dsimp only simp_rw [physical_prime_cell_expansion P V A B hU hAB Q h keptA keptB S hA hB] simp_rw [group_marked_average_sum] simp only [mul_sum] apply sum_congr rfl intro d _ apply sum_congr rfl intro χ _ apply sum_congr rfl intro e _ apply sum_congr rfl intro ψ _ have he := weighted_marked_pair_finite_expansion P q V (fun g => ell + (repeatedBigAuxCut A B g).card) w z S (univ : Finset Unit) (fun _ => (((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) d : ℝ) : ℂ) * ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) e : ℝ) : ℂ)) * ((starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1) * (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2))) (fun _ u => primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (physicalSelectedPrimeRestriction A B B subset_union_right S hB u)) (fun _ v => primeProductCellCharacter (fun i : A => P i.val.1) h d χ (physicalSelectedPrimeRestriction A B A subset_union_left S hA v)) dsimp only at he simpa only [univ_unique, sum_singleton] using he end Bounty end section /- Polynomial atoms for the actual candidate pools and original mapped slots. -/ open Finset Filter open scoped Classical namespace Bounty theorem exists_candidate_subset_atom_inputs {c : ℝ} (hc : 0 < c) (J : ℕ) : ∃ κ : ℝ, 0 ≤ κ ∧ ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → let P := fun g : S => candidatePBand (c*L) g.val let V := fun g : S => ∑ p ∈ P g, 1/(p : ℝ) (∀ g, 0 < V g) ∧ ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r : Finset S) (A : Finset (RepeatedBigFlatIndex S J ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → ∀ n : ℕ, (∑ a ∈ univ.filter (fun a : (∀ i : A, P i.val.1) => (∏ i, (a i).val) = n), finiteProductWeight (fun i : A => physicalLabelLaw V i.val.1) a) ≤ L^κ/(n : ℝ) := by obtain ⟨v, W, hv, _, hpool⟩ := exists_candidate_P_pool_bounds hc let D : ℝ := 2/(5*Real.log 2) let κ := D*Real.log (primeFiberFactorBound v J) refine ⟨κ, mul_nonneg (by dsimp [D]; positivity) (Real.log_nonneg (one_le_primeFiberFactorBound v J)), ?_⟩ filter_upwards [hpool] with L hp intro S hS P V have hV (g : S) : v ≤ V g := (hp.2.2.2.2.2 g.val (hS g.property)).1 refine ⟨fun g => hv.trans_le (hV g), ?_⟩ intro ell probes r A hA n have hprime : ∀ g p, p ∈ P g → p.Prime := fun g p hpg => ((hp.2.2.2.2.2 g.val (hS g.property)).2.2 p hpg).1 have hdisj : Pairwise (fun g h : S => Disjoint (P g) (P h)) := by intro g h hgh exact hp.2.2.2.2.1 (fun he => hgh (Subtype.ext he)) have hcard : (Fintype.card S : ℝ) ≤ D*Real.log L := by simpa only [Fintype.card_coe] using (Nat.cast_le.mpr (card_le_card hS) : (S.card : ℝ) ≤ (candidatePIndices c L).card).trans hp.2.2.2.1 exact prime_subset_physical_atom_rpow P V hprime hdisj r (repeatedBigPrimeProbeSlots probes) J hv (zero_lt_one.trans_le hp.1) hV (fun g => by simpa only [repeatedBigPrimeProbeSlots, card_map, Fintype.card_fin] using card_le_univ (probes g)) hcard A hA n end Bounty end section /- A bounded chronological record predicate selects the actual local rows of the encoded physical event model, without changing any event coefficient. -/ open Finset open scoped Classical namespace Bounty section FullRecord variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) noncomputable def physicalSelectedFineFullRow (i : ℕ) (F : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) := physicalFullObservedRow C k ω β retention ρ V (cut i) (cut (i + 1)) (physicalSelectedFineTag n i) (fun o t => if physicalSelectedFineEncodedTest C aux L σ τ cut i o t then F t else 0) end FullRecord end Bounty end section /- Uniform and polynomial bounds retain only the genuine visit and edge costs. -/ namespace Bounty end Bounty end section /- A complete chronological selection identifies every mark list, permutation and auxiliary draw. -/ open scoped Classical namespace Bounty theorem physical_inverse_permutations_injective {G : Type*} {J ell : ℕ} : Function.Injective (physicalInversePermutations (G := G) (J := J) (ell := ell)) := by intro σ τ h funext g have hg := congrFun h g exact congrArg Equiv.symm hg section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) {aux aux' : ∀ j, PhysicalAuxLabels P (C j)} {L L' : Fin (n + 1) → PhysicalMarkLists P J ell} {σ τ σ' τ' : Fin n → PhysicalPermutations (Fin N) J ell} theorem physical_selected_fine_data_unique_of_joint_tests (h : ∀ i < 4 * n + 1, ∃ (o : PhysicalMarkObservation P ell C) (t : PhysicalBoundedMarkState P J ell B), physicalSelectedFineTest C aux L σ τ i o t ∧ physicalSelectedFineTest C aux' L' σ' τ' i o t) : aux = aux' ∧ L = L' ∧ σ = σ' ∧ τ = τ' := by have hL : L = L' := by funext j have hj := j.isLt have hi : 4 * j.val < 4 * n + 1 := by omega obtain ⟨o, t, ha, hb⟩ := h _ hi have ha := (physical_selected_fine_test_visit C aux L σ τ j _ _).mp ha have hb := (physical_selected_fine_test_visit C aux' L' σ' τ' j _ _).mp hb exact ha.2.symm.trans hb.2 have hσ : σ = σ' := by funext j have hj := j.isLt have hi : 4 * j.val + 1 < 4 * n + 1 := by omega obtain ⟨o, t, ha, hb⟩ := h _ hi have ha := (physical_selected_fine_test_source_permutation C aux L σ τ j _ _).mp ha have hb := (physical_selected_fine_test_source_permutation C aux' L' σ' τ' j _ _).mp hb exact Sum.inl.inj (ha.symm.trans hb) have hτ : τ = τ' := by funext j have hj := j.isLt have hi : 4 * j.val + 3 < 4 * n + 1 := by omega obtain ⟨o, t, ha, hb⟩ := h _ hi have ha := (physical_selected_fine_test_target_permutation C aux L σ τ j _ _).mp ha have hb := (physical_selected_fine_test_target_permutation C aux' L' σ' τ' j _ _).mp hb exact physical_inverse_permutations_injective (Sum.inl.inj (ha.symm.trans hb)) have haux : aux = aux' := by funext j have hj := j.isLt have hi : 4 * j.val + 2 < 4 * n + 1 := by omega obtain ⟨o, t, ha, hb⟩ := h _ hi have ha := (physical_selected_fine_test_edge C aux L σ τ j _ _).mp ha have hb := (physical_selected_fine_test_edge C aux' L' σ' τ' j _ _).mp hb exact eq_of_heq ((Sigma.mk.inj_iff.mp (Option.some.inj (Sum.inr.inj (ha.1.symm.trans hb.1)))).2) exact ⟨haux, hL, hσ, hτ⟩ theorem physical_selected_fine_data_unique (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) (h : ∀ i < 4 * n + 1, physicalSelectedFineTest C aux L σ τ i (o i) (t i)) (h' : ∀ i < 4 * n + 1, physicalSelectedFineTest C aux' L' σ' τ' i (o i) (t i)) : aux = aux' ∧ L = L' ∧ σ = σ' ∧ τ = τ' := physical_selected_fine_data_unique_of_joint_tests C (fun i hi => ⟨o i, t i, h i hi, h' i hi⟩) end Fine end Bounty end section /- The selected chronological physical rows evaluate to the original joint residue history. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) end ResiduePath end Bounty end section /- Arbitrary polynomial savings for the concrete prime-pattern perturbation error, uniformly in the group type, probes, cutoffs, and density loss. -/ open Filter Finset namespace Bounty /- The raw branch ensures that the numerical family budget dominates the uniform density-smallness quantity. -/ theorem repeated_big_density_le_numeric_error (s m J ell Q : ℕ) (xi T P v : ℝ) (hT : 0 ≤ T) (hP : 0 < P) (hv : 0 < v) : (((2 * s * (ell + m) : ℕ) : ℝ) * T / P) ≤ repeatedBigNumericError s m J ell Q xi T P v := by have hd : 0 ≤ (((2 * s * (ell + m) : ℕ) : ℝ) * T / P) := by positivity have hc : 0 ≤ (s : ℝ) * ((m : ℝ) * (2 * ((J + ell : ℕ) : ℝ))) / (v * P) := by positivity have hk : 0 ≤ (2 : ℝ) ^ (m * s) * (((Q * Q : ℕ) : ℝ) / xi) ^ 2 := by positivity unfold repeatedBigNumericError nlinarith end Bounty end section /- Integrating the corrected pair sieve over all actual normalized assignments. -/ open Finset Filter open scoped Topology namespace Bounty theorem exists_candidate_pair_sieve_bound : ∃ K : ℝ, 0 < K ∧ ∀ (c q θ : ℝ), 0 < c → 0 ≤ q → q ≤ 1 → 0 < θ → ∀ (r J : ℕ), θ < 2*c/(2 : ℝ)^J → (12/5 : ℝ)*(r : ℝ)*c/(2 : ℝ)^J ≤ 1/25 → ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ), J ≤ jStar → ∀ (a b s t : ℕ) (W : ℝ) (S : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ), a ≤ b → s ≤ t → 0 ≤ W → W ≤ Real.exp (θ*L) → (∀ v ∈ S, v.1*v.2 = 2*u v+1) → (∀ v ∈ S, v.1 ∈ Ioc a b ∧ v.2 ∈ Ioc s t) → (∀ v ∈ S, ∀ p ∈ primeBand 0 W, ¬p ∣ v.1*v.2) → (∑ v ∈ S, candidateCoefficient c L q r jStar (u v)) ≤ (K * (((b : ℝ)-a)*((t : ℝ)-s)) * (∏ p ∈ primeBand 0 W, (1-1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 (Real.exp (θ*L)), (1-1/(p : ℝ))) * candidateOneMarkedHarmonicMass c L q + ((Real.exp (θ*L))^(10 : ℝ))^3 * (Real.exp ((1/20 : ℝ)*L))^2 + (((b : ℝ)-a)+((t : ℝ)-s))*((Real.exp (θ*L))^(10 : ℝ))^2 * Real.exp ((1/20 : ℝ)*L)) * candidateMicroQHarmonicMass c L r jStar J := by classical obtain ⟨K, hK, hsieve⟩ := exists_candidate_odd_shifted_divisor_pair_bound refine ⟨K, hK, ?_⟩ intro c q θ hc hq0 hq1 hθ r J hcut hsize filter_upwards [hsieve c q hc hq0 hq1, eventually_candidate_coefficient_le_micro_assignment hc hq0 r J hcut, eventually_candidate_micro_assignment_size hc r J hsize, eventually_candidate_micro_assignment_total_weight hc r J hsize, eventually_candidate_micro_assignment_normalization hc, eventually_candidate_micro_assignment_primeFactors_range hc (show (6/5 : ℝ)*c ≤ 2*c by linarith), eventually_candidate_P_pool_prime_range hc hθ, eventually_ge_atTop (2 : ℝ)] with L hsi hmajor hds hmass hnorm hsupp hpool hL intro jStar hj a b s t W S u hab hst hW hWz hv hrect hrough let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let z := Real.exp (θ*L) let M := Real.exp ((1/20 : ℝ)*L) let N := candidateMicroAssignmentNormalization c L r J let A := K * (((b : ℝ)-a)*((t : ℝ)-s)) * (∏ p ∈ primeBand 0 W, (1-1/(p : ℝ)))^2 * (∏ p ∈ primeBand 0 z, (1-1/(p : ℝ))) * candidateOneMarkedHarmonicMass c L q let B := (z^(10 : ℝ))^3 let C := (((b : ℝ)-a)+((t : ℝ)-s))*(z^(10 : ℝ))^2 have hN : 0 < N := (hnorm r jStar J).1 have hz : 1 < z := Real.one_lt_exp_iff.mpr (mul_pos hθ (by linarith)) have hL1 : 1 ≤ L := by linarith have hL20 : L ≤ L^20 := by simpa using pow_le_pow_right₀ hL1 (show 1 ≤ 20 by omega) have hL220 : L^2 ≤ L^20 := pow_le_pow_right₀ hL1 (by omega) have hprime : ∀ p ∈ P, p.Prime := by intro p hp obtain ⟨g, _, hpg⟩ := mem_biUnion.mp hp exact (mem_filter.mp hpg).2 have hP2 : 2 ∉ P := by intro hp have h := (hpool 2 hp).1 norm_num at h linarith have hPz : P ⊆ primeBand 0 z := by intro p hp exact (mem_primeBand_iff le_rfl (Real.exp_pos _).le p).mpr ⟨hprime p hp, Nat.cast_pos.mpr (hprime p hp).pos, (hpool p hp).2⟩ have hB : 0 ≤ B := by dsimp [B]; positivity have hC : 0 ≤ C := by have hx : 0 ≤ (b : ℝ)-a := sub_nonneg.mpr (Nat.cast_le.mpr hab) have hy : 0 ≤ (t : ℝ)-s := sub_nonneg.mpr (Nat.cast_le.mpr hst) dsimp [C] positivity have hpoint (x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i) : (∑ v ∈ S, primeAssignmentTerm P q z N (u v) (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x)) ≤ (1/N) * (A / (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ) + B*(orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x : ℝ)+C) := by let D := orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x have hD : D ≠ 0 := candidate_micro_assignment_product_ne_zero c L r jStar J x have hDL : (D : ℝ) ≤ Real.exp L := (hds jStar x).trans (Real.exp_le_exp.mpr (by linarith)) have hmin : ∀ p ∈ D.primeFactors, L^2 ≤ (p : ℝ) := fun p hp => hL220.trans (hsupp r jStar J x p hp).1.le have hPm : ∀ p ∈ P \ D.primeFactors, ¬p ∣ D := by intro p hp hpd exact (mem_sdiff.mp hp).2 ((hprime p (mem_sdiff.mp hp).1).mem_primeFactors hpd hD) have he := @hsi a b s t D ⟨hD⟩ W z (P \ D.primeFactors) hDL hmin hab hst hW hWz hz (sdiff_subset) (fun p hp => hPz (mem_sdiff.mp hp).1) hPm (fun hp => hP2 (mem_sdiff.mp hp).1) have ht := sum_prime_assignment_le_odd_pair_sum P hprime hP2 hq0 hN.le (show 0 ≤ z from (Real.exp_pos (θ*L)).le) a b s t D S u hv hrect hrough refine ht.trans ((mul_le_mul_of_nonneg_left he (by positivity)).trans_eq ?_) dsimp [A, B, C, D] ring have hsum : (∑ v ∈ S, candidateCoefficient c L q r jStar (u v)) ≤ ∑ x : ∀ i, candidateMicroAssignmentChoices c L r jStar J i, ∑ v ∈ S, primeAssignmentTerm P q z N (u v) (orderedSlotProduct (candidateMicroAssignmentChoices c L r jStar J) x) := by calc _ ≤ ∑ v ∈ S, candidateMicroAssignmentMajorant c L q r jStar J z (u v) := sum_le_sum (fun v _ => hmajor jStar hj (u v)) _ = _ := by unfold candidateMicroAssignmentMajorant; rw [sum_comm] refine hsum.trans ((sum_le_sum (fun x _ => hpoint x)).trans ?_) exact candidate_assignment_error_sum c L r jStar J hB hC (Real.exp_pos _).le hN.le (hds jStar) (hnorm r jStar J).2 (hmass jStar) end Bounty end section /- Actual recorded physical histories factor into initial avoidance, birth distinctness and residual phases. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) variable (tags : ℕ → Option (I ⊕ K)) (cut : ℕ → Fin N → Finset (Fin J)) (steps : ℕ) (initialTrace : FullMixedLedgerState (fun g (p : {p // p ∈ P g}) => Subtype.val p) (M := fun _ => J + ell) B → List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (Φ : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C) → FullMixedLedgerState (fun g (p : {p // p ∈ P g}) => Subtype.val p) (M := fun _ => J + ell) B → ℂ) (f : PhysicalFullBoundedState P J ell B → ℂ) end Physical end Bounty end section /- The actual recorded physical history has an exact forest expansion. -/ open Finset open scoped Classical namespace Bounty section Physical variable {I K : Type*} {N J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (tags : ℕ → Option (I ⊕ K)) (cut : ℕ → Fin N → Finset (Fin J)) (steps : ℕ) (initialTrace : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (Φ : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C) → FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) (f : PhysicalFullBoundedState P J ell B → ℂ) end Physical end Bounty end section /- The exact prime-pattern family has a uniform initial-ledger error budget. Pattern signs remain inside their coefficient norms, and the fresh-target exclusion probability is the only additional loss. -/ open Finset Filter open scoped Classical namespace Bounty theorem repeated_big_prime_initial_pattern_error_le {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell m : ℕ} (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (hp : ∀ g, (probes g).card ≤ m) (F : ∀ g, Finset (P g)) (hF : ∀ g, (F g).card ≤ J + ell) (Q : ℕ) (xi : ℝ) {v Pmin : ℝ} (hv : 0 < v) (hV : ∀ g, v ≤ V g) (hPmin : 0 < Pmin) : (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ‖repeatedBigPrimePatternWeight probes r t i‖ * (repeatedBigPrimePatternBound probes r t Q xi i * Real.sqrt (repeatedBigInitialForbiddenProbability (ell := ell) V (repeatedBigPrimePatternCut probes r t i) F Pmin))) ≤ repeatedBigInitialError (Fintype.card G) m J ell Q xi Pmin v := by let delta := (Fintype.card G : ℝ) * (((ell + m : ℕ) : ℝ) * ((J + ell : ℕ) : ℝ)) / (v * Pmin) have hprob (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) : repeatedBigInitialForbiddenProbability (ell := ell) V (repeatedBigPrimePatternCut probes r t i) F Pmin ≤ delta := by simpa only [delta, mul_assoc] using repeated_big_initial_forbidden_probability_le V (repeatedBigPrimePatternCut probes r t i) F hv hPmin hV (repeated_big_prime_pattern_cut_card_le probes r t hp i) hF have hcard : r.card + t.card ≤ Fintype.card G := by rw [← card_union_of_disjoint hrt] exact card_le_univ _ simp only [repeated_big_prime_pattern_weight_norm, one_mul] calc _ ≤ ∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q xi i * Real.sqrt delta := by apply sum_le_sum intro i _ exact mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt (hprob i)) (repeated_big_prime_pattern_bound_nonneg probes r t Q xi i) _ = (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q xi i) * Real.sqrt delta := by rw [sum_mul] _ ≤ (1 + (2 : ℝ) ^ (m * (r.card + t.card)) * (((Q * Q : ℕ) : ℝ) / xi) ^ 2) * Real.sqrt delta := mul_le_mul_of_nonneg_right (repeated_big_prime_pattern_bound_sum_le (ell := ell) probes r t hp Q xi) (Real.sqrt_nonneg _) _ ≤ (1 + (2 : ℝ) ^ (m * Fintype.card G) * (((Q * Q : ℕ) : ℝ) / xi) ^ 2) * Real.sqrt delta := by apply mul_le_mul_of_nonneg_right _ (Real.sqrt_nonneg _) apply add_le_add le_rfl apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) exact pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 2) (Nat.mul_le_mul_left m hcard) _ = _ := rfl end Bounty end section /- The complete signed prime family has a concrete exceptional-operation bound on the original physical event model. All event choices remain summed. Only pointwise boundedness is required of the additional forest multiplier. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) include hstep in theorem physical_selected_fine_path_eq_adjacent : finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow (B := B) C aux L σ τ k β V ρ hV ω retention) (4 * n + 1) physicalEmptyMemoryTerminal (physicalInitialMarkState B (L 0)) = (∏ i ∈ range (2 * n + 1), physicalSelectedCoarseScalar C aux L σ ω i) * physicalJointAdjacentRawHistory C aux k L a σ τ hcompat hlist hP hdis hk β (fun _ j => 1 - retention j) V (fun _ => ρ) hV B := by rw [physical_selected_fine_composition_eq_coarse] exact physical_selected_fixed_path_eq_adjacent C aux k L a σ τ hstep hcompat hlist hP hdis hk β V ρ hV B ω retention end ResiduePath end Bounty end section /- One locally incompatible edge annihilates the original selected fine history. -/ open Finset open scoped Classical namespace Bounty section History variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (hlist : ∀ j, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] include hlist hP hdis hk in theorem physical_selected_coarse_coherent_congr (i : ℕ) (hi : i < 2 * n + 1) (F G : PhysicalBoundedMarkState P J ell B → ℂ) (hFG : ∀ t, PhysicalMarkCoherent (physicalMarkAtCut L (i + 1)) t → F t = G t) (s : PhysicalBoundedMarkState P J ell B) (hs : PhysicalMarkCoherent (physicalMarkAtCut L i) s) : physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention i F s = physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention i G s := by by_cases he : i % 2 = 0 · let j : Fin (n + 1) := ⟨i / 2, by omega⟩ have hij : i = 2 * j.val := by dsimp [j]; omega rw [hij] at hFG hs ⊢ rw [physical_selected_coarse_row_even, physical_selected_coarse_row_even] apply physical_selected_visit_coherent_congr C k ω β retention ρ V hV j (L j) F G · simpa only [physical_mark_at_cut_odd] using hFG · simpa only [physical_mark_at_cut_even] using hs · let j : Fin n := ⟨i / 2, by omega⟩ have hij : i = 2 * j.val + 1 := by dsimp [j]; omega have hnext : 2 * j.val + 1 + 1 = 2 * j.succ.val := by simp only [Fin.val_succ]; omega have hsource : physicalMarkAtCut L (2 * j.val + 1) = L j.castSucc := physical_mark_at_cut_odd L j.castSucc rw [hij] at hFG hs ⊢ rw [physical_selected_coarse_row_odd, physical_selected_coarse_row_odd] apply physical_selected_edge_coherent_congr C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.castSucc) (L j.succ) (hlist j) hP hdis (hk j) F G · simpa only [hnext, physical_mark_at_cut_even] using hFG · simpa only [hsource] using hs omit [∀ g, ∀ p : ↥(P g), NeZero p.val] in theorem physical_selected_coarse_zero (i : ℕ) (hi : i < 2 * n + 1) (s : PhysicalBoundedMarkState P J ell B) (hs : PhysicalMarkCoherent (physicalMarkAtCut L i) s) : physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention i (fun _ => 0) s = 0 := by by_cases he : i % 2 = 0 · let j : Fin (n + 1) := ⟨i / 2, by omega⟩ have hij : i = 2 * j.val := by dsimp [j]; omega rw [hij] at hs ⊢ rw [physical_selected_coarse_row_even] apply physical_selected_visit_zero C k ω β retention ρ V hV j (L j) s simpa only [physical_mark_at_cut_even] using hs.1 · let j : Fin n := ⟨i / 2, by omega⟩ have hij : i = 2 * j.val + 1 := by dsimp [j]; omega rw [hij] at hs ⊢ rw [physical_selected_coarse_row_odd] exact physical_selected_edge_zero C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.succ) s include hlist hP hdis hk in theorem physical_selected_coarse_history_zero_of_bad (hbad : ¬ ∀ j g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (F : PhysicalBoundedMarkState P J ell B → ℂ) : finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention) (2 * n + 1) F (physicalInitialMarkState B (L 0)) = 0 := by obtain ⟨j, hj⟩ := not_forall.mp hbad apply finite_row_composition_supported_zero_at (physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention) (fun i s => PhysicalMarkCoherent (physicalMarkAtCut L i) s) (2 * n + 1) (physical_selected_coarse_coherent_congr C aux k L σ τ β V ρ hV ω retention hlist hP hdis hk) (physical_selected_coarse_zero C aux k L σ τ β V ρ hV ω retention) (2 * j.val + 1) (by have := j.isLt; omega) · intro G s hs rw [physical_selected_coarse_row_odd] apply physical_selected_edge_zero_of_bad C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.castSucc) (L j.succ) (hlist j) hj G s simpa only [show physicalMarkAtCut L (2 * j.val + 1) = L j.castSucc from physical_mark_at_cut_odd L j.castSucc] using hs · have he : physicalMarkAtCut L 0 = L 0 := by simpa only [Fin.val_zero, Nat.mul_zero] using physical_mark_at_cut_even L (0 : Fin (n + 1)) rw [he] refine ⟨rfl, ?_⟩ exact global_birth_joint_initial_coherent (fun g => physicalGroupPhaseActivity (L 0) g) include hlist hP hdis hk in theorem physical_selected_fine_history_zero_of_bad (hbad : ¬ ∀ j g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (F : PhysicalBoundedMarkState P J ell B → ℂ) : finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention) (4 * n + 1) F (physicalInitialMarkState B (L 0)) = 0 := by rw [physical_selected_fine_composition_eq_coarse] exact physical_selected_coarse_history_zero_of_bad C aux k L σ τ β V ρ hV ω retention hlist hP hdis hk hbad F end History end Bounty end section /- An inadmissible selected edge annihilates the literal history for every terminal. -/ open Finset Classical namespace Bounty section History variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (hbad : ¬ ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) include hbad in theorem physical_selected_coarse_history_zero_of_nonadmissible (F : PhysicalBoundedMarkState P J ell B → ℂ) : finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention) (2 * n + 1) F (physicalInitialMarkState B (L 0)) = 0 := by obtain ⟨j, hj⟩ := not_forall.mp hbad apply finite_row_composition_supported_zero_at (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedCoarseRow C aux k L σ τ β V ρ hV ω retention) (fun i s => s.1 = physicalMarkAtCut L i) (2 * n + 1) (fun i hi F G hFG s _ => physical_selected_coarse_marks_congr C aux k L σ τ β V ρ hV ω retention i hi F G hFG s) (physical_selected_coarse_marks_zero C aux k L σ τ β V ρ hV ω retention) (2 * j.val + 1) (by have := j.isLt; omega) · intro G s hs rw [physical_selected_coarse_row_odd] apply physical_selected_edge_zero_of_nonadmissible C k ω β retention ρ V hV j (aux j) (σ j) (τ j) (L j.castSucc) (L j.succ) hj G s simpa only [show physicalMarkAtCut L (2 * j.val + 1) = L j.castSucc from physical_mark_at_cut_odd L j.castSucc] using hs · have he : physicalMarkAtCut L 0 = L 0 := by simpa only [Fin.val_zero, Nat.mul_zero] using physical_mark_at_cut_even L (0 : Fin (n + 1)) rw [he] rfl include hbad in theorem physical_selected_fine_history_zero_of_nonadmissible (F : PhysicalBoundedMarkState P J ell B → ℂ) : finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention) (4 * n + 1) F (physicalInitialMarkState B (L 0)) = 0 := by rw [physical_selected_fine_composition_eq_coarse] exact physical_selected_coarse_history_zero_of_nonadmissible C aux k L σ τ β V ρ hV ω retention hbad F end History end Bounty end section /- Group the unchanged fine tag schedule into visits and projected edges. -/ namespace Bounty section Schedule variable {X V : Type*} {n : ℕ} (row : Option (Fin (n + 1) ⊕ Fin n) → (X → V) → X → V) end Schedule end Bounty end section /- Quantitative positive subtraction after choosing the sieve depth and cutoff. -/ namespace Bounty open Filter Real open scoped Topology theorem exists_small_cutoff_even_sieve_parameter {A bMax level ε : ℝ} (hbMax : 0 < bMax) (hlevel : 0 < level) (hε : 0 < ε) : ∃ b : ℝ, ∃ h : ℕ, 0 < b ∧ b < bMax ∧ 1 ≤ h ∧ Even h ∧ b*(4*(h : ℝ)+2) < level ∧ (A/b)*exp (-(h : ℝ)) < ε := by let m : ℝ := min bMax level have hm : 0 < m := lt_min hbMax hlevel have ht1 : Tendsto (fun x : ℝ => x*exp (-x)) atTop (nhds 0) := by simpa only [rpow_one, neg_one_mul] using tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero 1 1 (by norm_num) have ht : Tendsto (fun x : ℝ => (2*A/m)*(4*x+2)*exp (-x)) atTop (nhds 0) := by have hh := ((ht1.const_mul 4).add (tendsto_exp_neg_atTop_nhds_zero.const_mul 2)).const_mul (2*A/m) convert hh using 1 · ext x ring · simp obtain ⟨H,hH⟩ := eventually_atTop.mp (ht.eventually_lt_const hε) obtain ⟨n,hn⟩ := exists_nat_gt (max (H/2) 1) let h : ℕ := 2*n have hn1 : (1 : ℝ) < n := (le_max_right _ _).trans_lt hn have hnNat : 1 < n := by exact_mod_cast hn1 have hh1 : 1 ≤ h := by dsimp [h]; omega have hhreal : (h : ℝ) = 2*(n : ℝ) := by dsimp [h]; push_cast; ring have hhH : H ≤ (h : ℝ) := by have hnH := (le_max_left (H/2) 1).trans_lt hn rw [hhreal] linarith have hhsmall := hH (h : ℝ) hhH let b : ℝ := m/(2*(4*(h : ℝ)+2)) have hfac : 0 < 4*(h : ℝ)+2 := by positivity have hden : 0 < 2*(4*(h : ℝ)+2) := by positivity have hb : 0 < b := by dsimp [b]; positivity refine ⟨b,h,hb,?_,hh1,?_,?_,?_⟩ · have hbm : b < m := by dsimp [b] apply (div_lt_iff₀ hden).mpr have hhn : (0 : ℝ) ≤ h := Nat.cast_nonneg _ nlinarith exact hbm.trans_le (min_le_left _ _) · exact ⟨n,by dsimp [h]; omega⟩ · have heq : b*(4*(h : ℝ)+2) = m/2 := by dsimp [b] field_simp rw [heq] have hmlevel : m ≤ level := min_le_right _ _ linarith · have heq : (A/b)*exp (-(h : ℝ)) = (2*A/m)*(4*(h : ℝ)+2)*exp (-(h : ℝ)) := by dsimp [b] field_simp rw [heq] exact hhsmall theorem exists_positive_buchstab_subtraction (Kpre : ℝ) {bMax : ℝ} (hbMax : 0 < bMax) : ∃ b : ℝ, ∃ h : ℕ, 0 < b ∧ b < bMax ∧ 1 ≤ h ∧ Even h ∧ b*(4*(h : ℝ)+2) < 1/2 ∧ (3/4 : ℝ) < (Mertens.primeProductLimitConstant/b)*(1-Kpre*exp (-(h : ℝ))) - (buchstabDensity b 1-1) := by obtain ⟨Kupper,hKupper,hupper⟩ := exists_buchstab_density_sieve_upper obtain ⟨b,h,hb,hbMax',hh,heven,hlevel,herror⟩ := exists_small_cutoff_even_sieve_parameter (A := Mertens.primeProductLimitConstant*(Kpre+Kupper)) hbMax (show (0 : ℝ)<1/2 by norm_num) (show (0 : ℝ)<1/4 by norm_num) refine ⟨b,h,hb,hbMax',hh,heven,hlevel,?_⟩ have hD := hupper b hb h hh heven (by linarith) have heq : (Mertens.primeProductLimitConstant/b)*(Kpre+Kupper)*exp (-(h : ℝ)) = (Mertens.primeProductLimitConstant*(Kpre+Kupper)/b)*exp (-(h : ℝ)) := by ring rw [← heq] at herror nlinarith end Bounty /- Public declaration closure audit. -/ end section /- Fixed-bin bounds for the actual cofactor proxy on constant-factor product support. -/ open Real Filter open scoped Topology namespace Bounty theorem eventually_cofactor_rough_test_coefficient_upper {γ a v cLo cHi S M ε : ℝ} (hγ : 0 < γ) (ha : 0 < a) (_hav : a ≤ v) (hv : v < 1-γ) (hcLo : 0 < cLo) (hcHi : 0 < cHi) (hS : 0 ≤ S) (hM : ∀ α ∈ Set.Icc a v, buchstabDensity γ (1-α) ≤ M) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ p m : ℕ, p ∈ primeBand (exp (a*L)) (exp (v*L)) → 0 < m → cLo*exp L ≤ (p : ℝ)*(m : ℝ) → (p : ℝ)*(m : ℝ) ≤ cHi*exp L → roughTestCellProxyCoefficient γ L S (logarithmicCellBase (L^(-S)) (logarithmicCellIndex (L^(-S)) m)) ≤ (M+ε)/(Mertens.primeProductLimitConstant*sqrt L) := by let g := (1-v-γ)/2 let w₀ := (1-v+γ)/2 have hg : 0 < g := by dsimp [g]; linarith have hw₀ : 0 < w₀ := by dsimp [w₀]; linarith have hc : ContinuousOn (fun w : ℝ => buchstabDensity γ w) (Set.Icc w₀ 2) := by apply buchstab_density_continuous.comp (show ContinuousOn (fun w : ℝ => (γ,w)) (Set.Icc w₀ 2) by fun_prop) intro w hw exact ⟨hγ, hw₀.trans_le hw.1⟩ obtain ⟨δ, hδ, hclose⟩ := Metric.uniformContinuousOn_iff_le.mp (isCompact_Icc.uniformContinuousOn_of_continuous hc) (ε/2) (by positivity) let C := |log cLo|+|log cHi|+1 let η := min δ (min g 1) have hC : 0 < C := by dsimp [C]; positivity have hη : 0 < η := lt_min hδ (lt_min hg zero_lt_one) have hηδ : η ≤ δ := min_le_left _ _ have hηg : η ≤ g := (min_le_right _ _).trans (min_le_left _ _) have hη1 : η ≤ 1 := (min_le_right _ _).trans (min_le_right _ _) filter_upwards [eventually_rough_test_proxy_coefficient_upper (a := w₀) (b := 2) (γ₀ := γ) (gap := g) hS hw₀ hγ hg (show 0 < ε/2 by positivity), eventually_ge_atTop (C/η), eventually_ge_atTop (1 : ℝ)] with L hbound hlarge hL1 intro p m hp hm hlo hhi have hL : 0 < L := zero_lt_one.trans_le hL1 have hsmall : C/L ≤ η := by apply (div_le_iff₀ hL).mpr have hh := (div_le_iff₀ hη).mp hlarge nlinarith let α := log (p : ℝ)/L let w := (logarithmicCellIndex (L^(-S)) m : ℝ)*L^(-S)/L obtain ⟨hαa,hαv⟩ := prime_band_logarithmic_exponent_bounds hL hp have hp0 : 0 < p := ((mem_primeBand_iff (exp_pos _).le (exp_pos _).le p).mp hp).1.pos have hdist : |w-(1-α)| ≤ η := (cofactor_logarithmic_cell_distance hL1 hS hcLo hcHi hp0 hm hlo hhi).trans hsmall have hparts := abs_le.mp hdist have hwlo : w₀ ≤ w := by dsimp [w₀, g] at *; linarith have hwhi : w ≤ 2 := by dsimp [α] at *; linarith have hwgap : g ≤ w-γ := by dsimp [w₀, g] at *; linarith have href : 1-α ∈ Set.Icc w₀ 2 := by dsimp [w₀, α] constructor <;> linarith have hcont := hclose w ⟨hwlo,hwhi⟩ (1-α) href (by simpa only [Real.dist_eq] using hdist.trans hηδ) rw [Real.dist_eq] at hcont have hdensity : buchstabDensity γ w ≤ M+ε/2 := by have hh := (abs_le.mp hcont).2 have hm := hM α ⟨hαa,hαv⟩ linarith have hb := hbound w γ hwlo hwhi le_rfl hwgap have hbase : exp (w*L) = logarithmicCellBase (L^(-S)) (logarithmicCellIndex (L^(-S)) m) := by unfold logarithmicCellBase dsimp [w] rw [div_mul_cancel₀ _ hL.ne'] rw [hbase] at hb apply hb.trans apply div_le_div_of_nonneg_right _ (mul_nonneg Mertens.prime_product_limit_constant_pos.le (sqrt_nonneg L)) linarith end Bounty end section /- Unbalanced proxy upper bounds with the sharp square-root sieve constant canceled explicitly. -/ open Finset Filter namespace Bounty theorem sqrt_proxy_mass_product {K L : ℝ} (hK : 0 < K) (hL : 0 < L) (R M H ε X : ℝ) : (M / (K * Real.sqrt L)) * ((R * K * H + ε) * X / Real.sqrt L) = (R * M * H + M * ε / K) * X / L := by have hs : 0 < Real.sqrt L := Real.sqrt_pos.mpr hL calc _ = (M * (R * K * H + ε) * X) / (K * (Real.sqrt L) ^ 2) := by field_simp _ = _ := by rw [Real.sq_sqrt hL.le]; field_simp theorem proxy_mass_error_budget {K M ε : ℝ} (hK : 0 < K) (hM : 0 ≤ M) (hε : 0 < ε) : let δ := ε * K / (M + 1) 0 < δ ∧ M * δ / K ≤ ε := by have hM1 : 0 < M + 1 := by linarith refine ⟨div_pos (mul_pos hε hK) hM1, ?_⟩ have heq : M * (ε * K / (M + 1)) / K = ε * (M / (M + 1)) := by field_simp rw [heq] exact mul_le_of_le_one_right hε.le ((div_le_one hM1).mpr (by linarith)) section variable (hZ : PrimitiveZeroFreeHalfPlane) {c q a v : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11 / 5 : ℝ) * (r : ℝ) * c = 1) (ha : 0 < a) (hav : a ≤ v) (hvhalf : v < 1 / 2) include hZ c q a v r hc hr hq0 hq1 hcenter ha hav hvhalf theorem exists_candidate_unbalanced_proxy_upper : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ M : ℝ, 0 ≤ M → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ (F : Finset (ℕ × ℕ)) (f : ℕ → ℝ) (u : ℕ × ℕ → ℕ), (∀ w ∈ F, u w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 ∈ primeBand (Real.exp (a * L)) (Real.exp (v * L)) ∧ w.1 * w.2 = 2 * u w + 1) → (∀ w ∈ F, 0 ≤ f w.2 ∧ f w.2 ≤ M / (Mertens.primeProductLimitConstant * Real.sqrt L)) → (∀ w ∈ F, f w.2 ≠ 0 → ∀ p ∈ w.2.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)) → (∑ w ∈ F, candidateCoefficient c L q r jStar (u w) * f w.2) ≤ (shiftedSieveRatioConstant * M * Real.log (v / a) + ε) * candidateCoefficientWindowMass c L q r jStar / L := by obtain ⟨J, hJ⟩ := exists_candidate_prime_band_sqrt_rough_mass_density_upper hZ hc hr hq0 hq1 hcenter ha hav hvhalf refine ⟨J, ?_⟩ intro jStar hj M hM ε hε let K := Mertens.primeProductLimitConstant have hK : 0 < K := Mertens.prime_product_limit_constant_pos let δ := ε * K / (M + 1) have hδ : 0 < δ ∧ M * δ / K ≤ ε := proxy_mass_error_budget hK hM hε filter_upwards [hJ jStar hj δ hδ.1, eventually_rough_test_proxy_cutoff ha, eventually_gt_atTop (0 : ℝ)] with L hmass hcut hL intro F f u hdata hf hrough have hs : 0 < Real.sqrt L := Real.sqrt_pos.mpr hL have hC : 0 ≤ M / (K * Real.sqrt L) := div_nonneg hM (mul_pos hK hs).le have hbridge := candidate_prime_factor_proxy_bound (c := c) r jStar hq0 (Real.exp_nonneg _) (Real.exp_nonneg _) (Real.exp_le_exp.mpr hcut) hC F f u hdata hf hrough have hX : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro n hn exact candidate_coefficient_nonneg c L hq0 r jStar n calc _ ≤ (M / (K * Real.sqrt L)) * candidatePrimeBandRoughMass c L q r jStar (Real.exp (a * L)) (Real.exp (v * L)) (Real.exp (Real.sqrt L)) := hbridge _ ≤ (M / (K * Real.sqrt L)) * ((shiftedSieveRatioConstant * K * Real.log (v / a) + δ) * candidateCoefficientWindowMass c L q r jStar / Real.sqrt L) := mul_le_mul_of_nonneg_left hmass hC _ = (shiftedSieveRatioConstant * M * Real.log (v / a) + M * δ / K) * candidateCoefficientWindowMass c L q r jStar / L := sqrt_proxy_mass_product hK hL _ _ _ _ _ _ ≤ _ := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right (add_le_add le_rfl hδ.2) hX) hL.le theorem exists_candidate_unbalanced_rough_logarithmic_proxy_upper : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ M : ℝ, 0 ≤ M → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ (γ S : ℝ) (F : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ), (∀ w ∈ F, u w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 ∈ primeBand (Real.exp (a * L)) (Real.exp (v * L)) ∧ w.1 * w.2 = 2 * u w + 1) → (∀ w ∈ F, roughTestCellProxyCoefficient γ L S (logarithmicCellBase (L ^ (-S)) (logarithmicCellIndex (L ^ (-S)) w.2)) ≤ M / (Mertens.primeProductLimitConstant * Real.sqrt L)) → (∑ w ∈ F, candidateCoefficient c L q r jStar (u w) * roughTestLogarithmicProxy γ L S w.2) ≤ (shiftedSieveRatioConstant * M * Real.log (v / a) + ε) * candidateCoefficientWindowMass c L q r jStar / L := by obtain ⟨J, hJ⟩ := exists_candidate_unbalanced_proxy_upper hZ hc hr hq0 hq1 hcenter ha hav hvhalf refine ⟨J, ?_⟩ intro jStar hj M hM ε hε filter_upwards [hJ jStar hj M hM ε hε, eventually_gt_atTop (0 : ℝ)] with L hbound hL intro γ S F u hdata hcoef apply hbound F (roughTestLogarithmicProxy γ L S) u hdata · intro w hw refine ⟨rough_test_logarithmic_proxy_nonneg γ L S w.2, ?_⟩ exact rough_test_logarithmic_proxy_le_coefficient (div_nonneg hM (mul_pos Mertens.prime_product_limit_constant_pos (Real.sqrt_pos.mpr hL)).le) (hcoef w hw) · intro w hw hne exact rough_test_logarithmic_proxy_support hne end end Bounty end section /- Uniform Lyapunov rows for an original owner, paying one common atom bound per selected child. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Owner end Bounty end section /- Restore the full original ledger path action before splitting its forest ranks. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (initial : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → (g : Fin N) → Finset (P g)) end Full end Bounty end section /- The original optional-label forest action is exactly the Fourier integral of its original signed rows. -/ open Finset Classical MeasureTheory namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (initial : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → (g : Fin N) → Finset (P g)) end Full end Bounty end section /- The localized cross-product scale satisfies the actual Fourier parameter envelope. -/ namespace Bounty theorem typeII_localized_scale_ratio {L U V E Z K₀ : ℝ} (hL : 24 ≤ L) (hU : 0 < U) (hV : 0 < V) (hE : E = U * L ^ (-K₀)) (hZ : Z ≤ 24 * U ^ 2 * V * L ^ 88 / E) : Z / (U * V) ≤ L ^ (K₀ + 89) := by have hL0 : 0 < L := by linarith have hp : L ^ K₀ ≠ 0 := (Real.rpow_pos_of_pos hL0 K₀).ne' have heq : (24 * U ^ 2 * V * L ^ 88 / E) / (U * V) = 24 * L ^ (K₀ + 88) := by rw [hE, Real.rpow_neg hL0.le, Real.rpow_add hL0] norm_num field_simp have hratio := div_le_div_of_nonneg_right hZ (mul_pos hU hV).le rw [heq] at hratio have hshift : L ^ (K₀ + 89) = L ^ (K₀ + 88) * L := by rw [show K₀ + 89 = (K₀ + 88) + 1 by ring, Real.rpow_add hL0, Real.rpow_one] rw [hshift] exact hratio.trans (by nlinarith [Real.rpow_pos_of_pos hL0 (K₀ + 88)]) theorem typeII_localized_parameter_envelope {L U V E Z K₀ : ℝ} {k : ℤ} (hL : 24 ≤ L) (hU : 0 < U) (hV : 0 < V) (hZ0 : 0 ≤ Z) (hk : k ≠ 0) (hE : E = U * L ^ (-K₀)) (hUV : 1 ≤ U * V) (hZ : Z ≤ 24 * U ^ 2 * V * L ^ 88 / E) : ‖typeIIScaleParameters L U V E Z k‖ ≤ L ^ typeIIScaleEnvelopeExponent K₀ (K₀ + 89) := by exact typeII_scale_parameter_envelope (by linarith) hU hV hZ0 hk hE hUV (typeII_localized_scale_ratio hL hU hV hE hZ) end Bounty end section /- A smooth dyadic partition, preserving the exterior spatial cutoff. -/ open Finset open scoped ContDiff namespace Bounty noncomputable def typeIISmoothDyadic (t : ℝ) : ℝ := Real.smoothTransition (2 * t - 1) - Real.smoothTransition (t - 1) theorem typeII_smooth_dyadic_contDiff : ContDiff ℝ ∞ typeIISmoothDyadic := by unfold typeIISmoothDyadic fun_prop theorem typeII_smooth_dyadic_zero {t : ℝ} (ht : t ≤ 1 / 2 ∨ 2 ≤ t) : typeIISmoothDyadic t = 0 := by unfold typeIISmoothDyadic rcases ht with ht | ht · rw [Real.smoothTransition.zero_of_nonpos (by linarith), Real.smoothTransition.zero_of_nonpos (by linarith), sub_self] · rw [Real.smoothTransition.one_of_one_le (by linarith), Real.smoothTransition.one_of_one_le (by linarith), sub_self] theorem typeII_smooth_dyadic_bounds (t : ℝ) : 0 ≤ typeIISmoothDyadic t ∧ typeIISmoothDyadic t ≤ 1 := by by_cases ht : t ≤ 1 / 2 · rw [typeII_smooth_dyadic_zero (Or.inl ht)] norm_num · have hp : Real.smoothTransition (t - 1) ≤ Real.smoothTransition (2 * t - 1) := Real.smoothTransition.monotone (by linarith) unfold typeIISmoothDyadic constructor · linarith · linarith [Real.smoothTransition.le_one (2 * t - 1), Real.smoothTransition.nonneg (t - 1)] theorem typeII_smooth_dyadic_support {t : ℝ} (ht : typeIISmoothDyadic t ≠ 0) : t ∈ Set.Ioo (1 / 2) 2 := by constructor · by_contra h exact ht (typeII_smooth_dyadic_zero (Or.inl (le_of_not_gt h))) · by_contra h exact ht (typeII_smooth_dyadic_zero (Or.inr (le_of_not_gt h))) theorem typeII_smooth_dyadic_telescope (x : ℝ) (N : ℕ) : ∑ j ∈ range (N + 1), typeIISmoothDyadic (x / 2 ^ j) = Real.smoothTransition (2 * x - 1) - Real.smoothTransition (x / 2 ^ N - 1) := by induction N with | zero => simp [typeIISmoothDyadic] | succ N ih => rw [sum_range_succ, ih, typeIISmoothDyadic] have heq : 2 * (x / (2 : ℝ) ^ (N + 1)) = x / 2 ^ N := by rw [pow_succ] ring rw [heq] ring theorem typeII_smooth_dyadic_partition {x : ℝ} {N : ℕ} (hx : 1 ≤ x) (hN : x ≤ (2 : ℝ) ^ N) : ∑ j ∈ range (N + 1), typeIISmoothDyadic (x / 2 ^ j) = 1 := by rw [typeII_smooth_dyadic_telescope] have hdiv : x / (2 : ℝ) ^ N ≤ 1 := (div_le_one (by positivity)).mpr hN rw [Real.smoothTransition.one_of_one_le (by linarith), Real.smoothTransition.zero_of_nonpos (by linarith)] norm_num theorem typeII_smooth_dyadic_partition_log {x R : ℝ} (hx : 1 ≤ x) (hR : x ≤ R) : ∑ j ∈ range (⌈Real.logb 2 R⌉₊ + 1), typeIISmoothDyadic (x / 2 ^ j) = 1 := by apply typeII_smooth_dyadic_partition hx apply hR.trans rw [← Real.rpow_natCast] apply (Real.logb_le_iff_le_rpow (by norm_num) (zero_lt_one.trans_le (hx.trans hR))).mp exact Nat.le_ceil _ theorem typeII_smooth_dyadic_log_box {t : ℝ} (ht : typeIISmoothDyadic t ≠ 0) : Real.log t ∈ Set.Icc (-1) 1 := by have hs := typeII_smooth_dyadic_support ht have ht0 : 0 < t := by linarith [hs.1] have hu := Real.log_le_sub_one_of_pos ht0 have hinv : 0 < t⁻¹ := inv_pos.mpr ht0 have hinvlt : t⁻¹ < 2 := by rw [inv_eq_one_div] apply (div_lt_iff₀ ht0).mpr linarith [hs.1] have hl := Real.log_le_sub_one_of_pos hinv rw [Real.log_inv] at hl constructor <;> linarith [hs.2] end Bounty end section /- The original candidate test is reduced directly to the actual retained box integrals. -/ open Finset Filter MeasureTheory Real namespace Bounty end Bounty end section /- The full box coefficient is the sum of the actual truncated retained integrals. -/ open Finset Filter MeasureTheory namespace Bounty noncomputable def candidateBoxFiniteTest (L E : ℝ) (S : Finset ℕ) (G : ℕ → ℂ) (e h : ℕ) : ℂ := if (E/L^88 ≤ (e : ℝ) ∧ (e : ℝ) ≤ E) ∧ e*h ∈ S then G (e*h) else 0 theorem candidate_box_single_P_finite_patterns (c L : ℝ) (r jStar p : ℕ) (E R : ℝ) (S : Finset ℕ) (G : ℕ → ℂ) : (∑ x : ∀ slot, candidateQSlotChoices c L r jStar slot, candidateBoxRangeAllocationMass c L r jStar x E R * (if p*orderedSlotProduct (candidateQSlotChoices c L r jStar) x ∈ S then G (p*orderedSlotProduct (candidateQSlotChoices c L r jStar) x) else 0) / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ)) = ∑ take ∈ (univ : Finset (Fin ((candidateQIndices c L).card*r) → Bool)).filter (fun take => ∀ i, candidateAllocationActive c L r jStar i = false → take i = false), (∑ x : ∀ slot, candidateQSlotChoices c L r jStar slot, (∫ ξ, activeAllocationFourierIntegrand (candidateAllocationRadius r) (Real.log E) (fun i => Real.log (candidateAllocationValue c L r jStar x i)) (fun i => c*L/2^(candidateAllocationOrder c L r i).1.val) (candidateAllocationActive c L r jStar) take ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) R) * candidateBoxFiniteTest L E S G (candidateAllocatedFactor c L r jStar x take) (candidateRetainedFactor c L r jStar p x take)) / (((r.factorial : ℝ)^(candidateQIndices c L).card : ℝ) : ℂ) := by classical unfold candidateBoxRangeAllocationMass rw [sum_filter] simp only [sum_mul, sum_div] rw [sum_comm] apply sum_congr rfl intro take ht by_cases hk : ∀ i, candidateAllocationActive c L r jStar i = false → take i = false · have hkeq : (∀ i, candidateAllocationActive c L r jStar i = false → take i = false) = True := propext (iff_true_intro hk) simp only [hkeq, true_and, if_true] apply sum_congr rfl intro x hx simp only [candidateBoxFiniteTest, candidate_allocation_factorization] by_cases he : E/L^88 ≤ (candidateAllocatedFactor c L r jStar x take : ℝ) ∧ (candidateAllocatedFactor c L r jStar x take : ℝ) ≤ E · by_cases hw : p*orderedSlotProduct (candidateQSlotChoices c L r jStar) x ∈ S · simp only [he, hw, and_self, if_true] · simp only [he, hw, true_and, if_false, mul_zero, zero_div] · simp only [he, false_and, if_false, zero_mul, mul_zero, zero_div] · simp only [hk, false_and, if_false, zero_mul, zero_div, sum_const_zero] theorem eventually_candidate_box_finite_retained_integrals {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (E R X : ℝ) (S : Finset ℕ) (G : ℕ → ℂ), (∀ u ∈ S, 0 < u ∧ (u : ℝ) ≤ X) → (∑ u ∈ S, candidateBoxRangeCoefficient c L q r jStar E R u*G u) = ∑ take ∈ (univ : Finset (Fin ((candidateQIndices c L).card*r) → Bool)).filter (fun take => ∀ i, candidateAllocationActive c L r jStar i = false → take i = false), ∫ ξ, candidateRetainedAllocationIntegrand c L q r jStar (Real.log E) (candidateSmallPSet c L (X+1)) take (candidateBoxFiniteTest L E S G) ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) R := by classical filter_upwards [eventually_candidate_box_finite_convolution hc, eventually_candidate_retained_box_integral hc] with L hconv hint intro q r jStar E R X S G hS rw [hconv q r jStar E R X S G hS] simp_rw [candidate_box_Q_test, candidate_box_single_P_finite_patterns, mul_sum] rw [sum_comm] apply sum_congr rfl intro take ht exact (hint q r jStar (Real.log E) R _ take (fun p hp => ((mem_candidateSmallPSet_iff c L _ p).mp hp).2) (candidateBoxFiniteTest L E S G)).2 end Bounty end section /- The actual signed family of clean mixed rows factors through the two canonical big projections. No norm estimate or assumed pairing is used. The initial forbidden sets stay fixed, and both endpoint gates stay inside small conditioning in their original order. -/ open Finset open scoped Classical namespace Bounty section variable {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] [DecidableEq S] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] [∀ g (p : P g), NeZero p.val] noncomputable def physicalMixedGatedCleanPatternAction (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (Vs : S → ℝ) (q : ℝ) (sourceGate targetGate f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) : ℂ := ∑ i, physicalMixedGatedCleanAction initial V b (C i) ζ θ ρ k (K i) Vs q sourceGate targetGate f s theorem physical_mixed_gated_clean_pattern_pairing (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (q : ℝ) (W : CleanFullMemoryState P J ell B → ℝ) (smallAux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J)))) (sourceGate targetGate u f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : (∑ s, (physicalSmallBigMeasure Vs W s : ℂ) * (starRingEnd ℂ) (u s) * physicalMixedGatedCleanPatternAction initial V b C ζ θ ρ k K Vs q sourceGate targetGate f s) = ∑ d, ∑ r, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition Vs q (fun s => sourceGate s * u s) d x r) * (∑ i, physicalMixedCleanInitialAction initial V b (C i) ζ θ ρ k (K i) d (physicalSmallBigCondition Vs q (fun s => targetGate s * f s) d) x r) := by simp only [physicalMixedGatedCleanPatternAction, mul_sum] rw [sum_comm] simp_rw [physical_mixed_gated_clean_pairing initial V b _ ζ θ ρ k _ Vs hVs q W smallAux sourceGate targetGate u f] rw [sum_comm] apply sum_congr rfl intro d _ rw [sum_comm] apply sum_congr rfl intro r _ exact sum_comm omit [DecidableEq S] [∀ p : PhysicalPrime Ps, NeZero p.2.val] in theorem physical_mixed_clean_pattern_projected_reencode (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (d : PhysicalSharedLists Ps J) (f : CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) (hf : ∀ r, ProductMemorySymmetric (fun x => f x r)) (hPs : ∀ s p, p ∈ Ps s → 0 < p) (hP : ∀ g p, p ∈ P g → 0 < p) : cleanFullMemoryActiveMap (fun x r => ∑ i, physicalMixedCleanInitialAction initial V b (C i) ζ θ ρ k (K i) d (cleanFullMemoryActiveMap f) x r) = cleanFullMemoryActiveMap (cleanFullMemoryInitialPatternEventAction initial V b C ζ θ ρ k (fun i => canonicalMixedEdgeD (C i) d) K d (cleanFullMemoryActiveMap f)) := by funext x r have hs (F : I → CleanFullMemoryState P J ell B → PhysicalResidues Ps → ℂ) : cleanFullMemoryActiveMap (fun y rs => ∑ i, F i y rs) x r = ∑ i, cleanFullMemoryActiveMap (F i) x r := by simp only [cleanFullMemoryActiveMap, fullActiveAverage, mul_sum] exact sum_comm rw [hs] change _ = cleanFullMemoryActiveMap (fun y rs => ∑ i, cleanFullMemoryInitialEventAction initial V b (C i) ζ θ ρ k (canonicalMixedEdgeD (C i) d) (K i) d (cleanFullMemoryActiveMap f) y rs) x r rw [hs] apply sum_congr rfl intro i _ exact congrFun (congrFun (physical_mixed_clean_initial_projected_reencode initial V b (C i) ζ θ ρ k (K i) d f hf hPs hP) x) r end end Bounty end section /- The signed raw-minus-comparison prime family on the genuine mixed state. Both endpoint slot averages, the original auxiliary law, and the fixed fresh-birth initial exclusion remain in the actual operator. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_joint_average_sum {I S G : Type*} [Fintype I] [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} (F : I → PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) : physicalSmallBigJointAverage (∑ i, F i) = ∑ i, physicalSmallBigJointAverage (F i) := by funext s rw [physical_small_big_joint_average_eq_sum] simp only [Finset.sum_apply, mul_sum] rw [sum_comm] apply sum_congr rfl intro i _ exact (physical_small_big_joint_average_eq_sum (F i) s).symm section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} noncomputable def physicalMixedRepeatedLabels (C : G → Finset (Fin J)) (x : CleanFullMemoryState P J ell B) : RepeatedBigLists P J ell := fun g j => (x g).1 ((physicalFullSlotIndex (C g)).symm j) noncomputable def physicalMixedCoefficientTarget (C : G → Finset (Fin J)) (k : ℤ) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent C k a s) : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) := physicalSmallBigTarget (PhysicalSmallBigFullEvent (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c g => physicalMixedEdgeDelta C k d c a g) (fun d c g => physicalMixedEdgeD C d c a g)) (physicalSmallBigFullTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c g => physicalMixedEdgeDelta C k d c a g) (fun d c g => physicalMixedEdgeD C d c a g)) (fun x => physicalMixedBigStep C k (productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B x).1 a) s e noncomputable def physicalMixedPrimePatternAction (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (k : ℤ) (initial : ∀ g, Finset (P g)) (φ : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent (repeatedBigPrimePatternCut probes r t i) k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) := let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ ∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, physicalMixedCoefficientAction (repeatedBigPrimePatternCut probes r t i) k V baseline ρ Vs q initial (fun a s e => repeatedBigPrimePatternWeight probes r t i * repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i (physicalMixedRepeatedLabels (repeatedBigPrimePatternCut probes r t i) s.2) (physicalMixedRepeatedLabels (repeatedBigPrimePatternCut probes r t i) (physicalMixedCoefficientTarget (repeatedBigPrimePatternCut probes r t i) k a s e).2) a * φ i a s e) f end end Bounty end section /- The actual auxiliary-averaged mixed coefficient row preserves pending symmetry when its signed phase observes the two active endpoints and the store, promotion-slot and fresh-label data. The fixed initial exclusion is applied to fresh births before the original auxiliary sum. -/ open Finset Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} [∀ g (p : P g), NeZero p.val] {J ell B : ℕ} (C : G → Finset (Fin J)) (k : ℤ) noncomputable def physicalMixedCoefficientReindex (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) := physicalSmallBigEventMemoryReindex (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c g => physicalMixedEdgeDelta C k d c a g) (fun d c g => physicalMixedEdgeD C d c a g) s τ noncomputable def physicalMixedCoefficientObservablePhase (a : PhysicalAuxLabels P C) (Φ : PhysicalBareResidueState Ps J ell → PhysicalBareResidueState Ps J ell → (∀ g, Fin (J + ell) → P g) → (∀ g, Fin (J + ell) → P g) → (∀ g, EdgeDrawObservation (P g) (physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) → ℂ) := physicalSmallBigObservablePhase (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c g => physicalMixedEdgeDelta C k d c a g) (fun d c g => physicalMixedEdgeD C d c a g) (fun c => physicalMixedBigStep C k c a) Φ omit dG in theorem physical_mixed_coefficient_observable_reindex (a : PhysicalAuxLabels P C) (Φ : PhysicalBareResidueState Ps J ell → PhysicalBareResidueState Ps J ell → (∀ g, Fin (J + ell) → P g) → (∀ g, Fin (J + ell) → P g) → (∀ g, EdgeDrawObservation (P g) (physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) → ℂ) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalMixedCoefficientEvent C k a s) : physicalMixedCoefficientObservablePhase C k a Φ (s.1, productMemoryReindex s.2 τ) (physicalMixedCoefficientReindex C k a s τ e) = physicalMixedCoefficientObservablePhase C k a Φ s e := physical_small_big_observable_phase_reindex _ _ B _ _ _ Φ s τ e theorem physical_mixed_coefficient_signed_memory_symmetric (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (initial : ∀ g, Finset (P g)) (Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (hΨ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalMixedCoefficientEvent C k a s), Ψ a (s.1, productMemoryReindex s.2 τ) (physicalMixedCoefficientReindex C k a s τ e) = Ψ a s e) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s,x))) : ∀ s, ProductMemorySymmetric (fun x => physicalMixedCoefficientAction C k V baseline ρ Vs q initial Ψ f (s,x)) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro s x g τ unfold physicalMixedCoefficientAction apply sum_congr rfl intro a _ apply congrArg (fun z : ℂ => (physicalAuxMass V C a : ℂ) * z) have hphase : ∀ (y : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (σ : ∀ h, Equiv.Perm (Fin (y.2 h).2.1.val)) (e : PhysicalMixedCoefficientEvent C k a y), (if ∀ h i, ((physicalMixedCoefficientReindex C k a y σ e).2.2 h).2.2.2 i ∉ initial h then Ψ a (y.1, productMemoryReindex y.2 σ) (physicalMixedCoefficientReindex C k a y σ e) else 0) = (if ∀ h i, (e.2.2 h).2.2.2 i ∉ initial h then Ψ a y e else 0) := by intro y σ e change (if ∀ h i, (e.2.2 h).2.2.2 i ∉ initial h then Ψ a (y.1, productMemoryReindex y.2 σ) (physicalMixedCoefficientReindex C k a y σ e) else 0) = _ rw [hΨ a y σ e] exact physical_small_big_full_signed_memory_symmetric _ _ B _ _ _ ρ V _ Vs q _ hphase f hf s x g τ end end Bounty end section /- Exact scalar normalization for the actual auxiliary-averaged mixed row. The fixed initial exclusion remains inside every event coefficient. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_joint_average_smul {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell B : ℕ} {M : G → ℕ} (c : ℂ) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) : physicalSmallBigJointAverage (c • f) = c • physicalSmallBigJointAverage f := by funext s simp only [physical_small_big_joint_average_eq_sum, Pi.smul_apply, smul_eq_mul, mul_sum] apply sum_congr rfl intro e _ ring section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} (C : G → Finset (Fin J)) (k : ℤ) (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (initial : ∀ g, Finset (P g)) (Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) theorem physical_mixed_coefficient_phase_mul (c : ℂ) : physicalMixedCoefficientAction C k V baseline ρ Vs q initial (fun a s e => c * Ψ a s e) f = c • physicalMixedCoefficientAction C k V baseline ρ Vs q initial Ψ f := by funext s simp only [physicalMixedCoefficientAction, physicalSmallBigFullPhasedAction, physicalSmallBigPhasedAction, Pi.smul_apply, smul_eq_mul, mul_sum] apply sum_congr rfl intro a _ apply sum_congr rfl intro e _ split_ifs <;> ring theorem physical_mixed_coefficient_phase_normalize (c : ℝ) (hΨ : ∀ a s e, ‖Ψ a s e‖ ≤ c) : physicalMixedCoefficientAction C k V baseline ρ Vs q initial Ψ f = (c : ℂ) • physicalMixedCoefficientAction C k V baseline ρ Vs q initial (fun a s e => Ψ a s e / (c : ℂ)) f := by rw [← physical_mixed_coefficient_phase_mul] congr 1 funext a s e exact (real_bound_mul_div_eq (hΨ a s e)).symm end end Bounty end section /- The actual ghost and edge sample sums split by fixed skeleton support without altering the continuation. -/ open Finset Classical namespace Bounty section Full variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) section Ghost variable [∀ g p, NeZero (n g p)] (j : J) (htag : steps.get u = some (.inl j)) (sk : CoupledGhostSkeleton M B s) theorem full_mixed_common_ghost_skeleton_stage_sum (F : CoupledGhostSamples M B s sk → ℝ) : let embed := fun i => (fullMixedCommonGhostSampleEmbedding S B j steps u htag s sk) ((fullMixedCommonGhostSampleOrder S B j steps u htag s sk) i) let owner := fullMixedCommonIndexStage M B steps let values := fun births => fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inl j)) htag s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩)) history let localValues := fun births i => (⟨(fullMixedCommonGhostSampleOrder S B j steps u htag s sk i).1, (births (fullMixedCommonGhostSampleOrder S B j steps u htag s sk i)).1⟩ : Sigma P) (∑ births : CoupledGhostSamples M B s sk, if birthForestStageCondition owner u.succ (values births) code then F births else 0) = if birthForestStageSupport owner u.succ (ownerSampleSupport embed owner u.succ history) code then ∑ births : CoupledGhostSamples M B s sk, if birthForestEqualValues (restrictedBirthCode embed code) (localValues births) ∧ birthLabelsAnchored (fun i => (restrictedBirthAnchors embed code history i).join) (localValues births) then F births else 0 else 0 := by dsimp only have h := owner_sample_stage_sum (fun i => (fullMixedCommonGhostSampleEmbedding S B j steps u htag s sk) ((fullMixedCommonGhostSampleOrder S B j steps u htag s sk) i)) (full_mixed_common_ghost_sample_strictMono S B j steps u htag s sk) (fullMixedCommonIndexStage M B steps) (full_mixed_common_index_stage_monotone M B steps) u.succ (fun i => full_mixed_common_ghost_sample_owner S B j steps u htag s sk (fullMixedCommonGhostSampleOrder S B j steps u htag s sk i)) code (fun births => fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inl j)) htag s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩)) history) history (fun births i => (⟨(fullMixedCommonGhostSampleOrder S B j steps u htag s sk i).1, (births (fullMixedCommonGhostSampleOrder S B j steps u htag s sk i)).1⟩ : Sigma P)) (by intro births i constructor · intro hi obtain ⟨c, hc⟩ := (full_mixed_common_ghost_history_sample_coverage n S B A Δ D steps u s history j htag sk births i).mp hi refine ⟨(fullMixedCommonGhostSampleOrder S B j steps u htag s sk).symm c, ?_⟩ dsimp only rw [Equiv.apply_symm_apply] exact hc · rintro ⟨i, rfl⟩ exact (full_mixed_common_ghost_history_sample_coverage n S B A Δ D steps u s history j htag sk births _).mpr ⟨(fullMixedCommonGhostSampleOrder S B j steps u htag s sk) i, rfl⟩) (fun births i hi => full_mixed_common_history_write_other n S B A Δ D steps u s _ history i (full_mixed_common_history_owner_ne M B steps u i hi)) (fun births i => full_mixed_common_ghost_history_sample_label n S B A Δ D steps u s history j htag sk births (fullMixedCommonGhostSampleOrder S B j steps u htag s sk i)) F convert h using 1 split_ifs · apply sum_congr rfl intro z _ split_ifs <;> rfl · rfl end Ghost section Edge variable (k : K) (htag : steps.get u = some (.inr k)) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) theorem full_mixed_common_edge_skeleton_stage_sum (F : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk → ℝ) : let embed := fun i => (fullMixedCommonEdgeSampleEmbedding n S B k steps u htag (A k) (Δ k) (D k) s sk) ((fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk) i) let owner := fullMixedCommonIndexStage M B steps let values := fun fresh => fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inr k)) htag s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, fresh⟩)) history let localValues := fun fresh i => (⟨(fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk i).1, fresh (fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk i)⟩ : Sigma P) (∑ fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk, if birthForestStageCondition owner u.succ (values fresh) code then F fresh else 0) = if birthForestStageSupport owner u.succ (ownerSampleSupport embed owner u.succ history) code then ∑ fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk, if birthForestEqualValues (restrictedBirthCode embed code) (localValues fresh) ∧ birthLabelsAnchored (fun i => (restrictedBirthAnchors embed code history i).join) (localValues fresh) then F fresh else 0 else 0 := by dsimp only have h := owner_sample_stage_sum (fun i => (fullMixedCommonEdgeSampleEmbedding n S B k steps u htag (A k) (Δ k) (D k) s sk) ((fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk) i)) (full_mixed_common_edge_sample_strictMono n S B k steps u htag (A k) (Δ k) (D k) s sk) (fullMixedCommonIndexStage M B steps) (full_mixed_common_index_stage_monotone M B steps) u.succ (fun i => full_mixed_common_edge_sample_owner n S B k steps u htag (A k) (Δ k) (D k) s sk (fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk i)) code (fun fresh => fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inr k)) htag s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, fresh⟩)) history) history (fun fresh i => (⟨(fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk i).1, fresh (fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk i)⟩ : Sigma P)) (by intro fresh i constructor · intro hi obtain ⟨c, hc⟩ := (full_mixed_common_edge_history_sample_coverage n S B A Δ D steps u s history k htag sk fresh i).mp hi refine ⟨(fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk).symm c, ?_⟩ dsimp only rw [Equiv.apply_symm_apply] exact hc · rintro ⟨i, rfl⟩ exact (full_mixed_common_edge_history_sample_coverage n S B A Δ D steps u s history k htag sk fresh _).mpr ⟨(fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk) i, rfl⟩) (fun fresh i hi => full_mixed_common_history_write_other n S B A Δ D steps u s _ history i (full_mixed_common_history_owner_ne M B steps u i hi)) (fun fresh i => full_mixed_common_edge_history_sample_label n S B A Δ D steps u s history k htag sk fresh (fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk i)) F convert h using 1 split_ifs · apply sum_congr rfl intro z _ split_ifs <;> rfl · rfl end Edge end Full end Bounty end section /- Exact original event rows with the chronological owner indicator. -/ open Finset Classical namespace Bounty section Reindex variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) theorem full_mixed_common_ghost_stage_reindex (j : J) (htag : steps.get u = some (.inl j)) : let _ : ∀ (tag : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D tag s) := fullPermutationMixedEventFintype n S B A Δ D (∑ e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s, |fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V (some (.inl j)) s e| * fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val (some (.inl j)) s e history * productLengthLyapunov v (fullPermutationMixedEventTarget n S B A Δ D (some (.inl j)) s e)) = ∑ sk : CoupledGhostSkeleton M B s, ∑ z : CoupledGhostSamples M B s sk, if birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inl j)) htag s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, z⟩)) history) code then |coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (q j) ρ) (fun g => physicalGhostTermination (n g) (q j) ρ) (fun g => physicalGhostBirth (n g) (q j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B s ((coupledGhostSkeletonEquiv M B s).symm ⟨sk, z⟩)| * productLengthLyapunov v (coupledGhostJointEventTarget M B s ((coupledGhostSkeletonEquiv M B s).symm ⟨sk, z⟩)) else 0 := by let _ : ∀ (tag : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D tag s) := fullPermutationMixedEventFintype n S B A Δ D have he := ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm.sum_comp (fun e => |fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V (some (.inl j)) s e| * fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val (some (.inl j)) s e history * productLengthLyapunov v (fullPermutationMixedEventTarget n S B A Δ D (some (.inl j)) s e))).symm rw [Fintype.sum_sigma] at he refine he.trans ?_ apply sum_congr rfl intro sk _ apply sum_congr rfl intro z _ rw [full_mixed_common_forest_history_gain_tagged n S B A Δ D steps code u (some (.inl j)) htag, full_permutation_ghost_skeleton_weight, full_permutation_ghost_skeleton_target] split_ifs <;> simp only [mul_one, mul_zero, zero_mul] theorem full_mixed_common_edge_stage_reindex (k : K) (htag : steps.get u = some (.inr k)) : let _ : ∀ (tag : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D tag s) := fullPermutationMixedEventFintype n S B A Δ D (∑ e : FullPermutationMixedEvent n S B A Δ D (some (.inr k)) s, |fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V (some (.inr k)) s e| * fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val (some (.inr k)) s e history * productLengthLyapunov v (fullPermutationMixedEventTarget n S B A Δ D (some (.inr k)) s e)) = ∑ sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s, ∑ z : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk, if birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inr k)) htag s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, z⟩)) history) code then |fullActiveEdgeEventWeight n (S k) B (A k) (Δ k) (D k) (ω k) μ ρ V s ((fullActiveEdgeSkeletonEquiv n (S k) B (A k) (Δ k) (D k) s).symm ⟨sk, z⟩)| * productLengthLyapunov v (fullActiveEdgeEventTarget n (S k) B (A k) (Δ k) (D k) s ((fullActiveEdgeSkeletonEquiv n (S k) B (A k) (Δ k) (D k) s).symm ⟨sk, z⟩)) else 0 := by let _ : ∀ (tag : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D tag s) := fullPermutationMixedEventFintype n S B A Δ D have he := ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm.sum_comp (fun e => |fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V (some (.inr k)) s e| * fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val (some (.inr k)) s e history * productLengthLyapunov v (fullPermutationMixedEventTarget n S B A Δ D (some (.inr k)) s e))).symm rw [Fintype.sum_sigma] at he refine he.trans ?_ apply sum_congr rfl intro sk _ apply sum_congr rfl intro z _ rw [full_mixed_common_forest_history_gain_tagged n S B A Δ D steps code u (some (.inr k)) htag, full_permutation_edge_skeleton_weight, full_permutation_edge_skeleton_target] split_ifs <;> simp only [mul_one, mul_zero, zero_mul] end Reindex end Bounty end section /- Exact selected-event exponents and Lyapunov factors for seeded common birth histories. -/ open Finset Classical namespace Bounty section Factor variable {J K : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) noncomputable def fullMixedCommonSelectedAt (t : ℕ) : ℕ := if ht : t < steps.length then ∑ g, fullMixedCommonSelectedCount M B steps code ⟨t, ht⟩ g else 0 theorem full_mixed_common_selected_at_owner (u : Fin steps.length) : fullMixedCommonSelectedAt M B steps code u.val = ∑ g, fullMixedCommonSelectedCount M B steps code u g := by unfold fullMixedCommonSelectedAt rw [dif_pos u.isLt] theorem full_mixed_common_selected_at_sum (hcode : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) : (∑ u : Fin steps.length, fullMixedCommonSelectedAt M B steps code u.val) = birthForestRank code := by simp only [full_mixed_common_selected_at_owner] exact full_mixed_common_selected_count_sum M B steps code hcode variable {P : Fin N → Type*} [∀ g, Fintype (P g)] (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V : Fin N → ℝ) (T : ℕ) (β : ℝ) noncomputable def fullMixedCommonForestRowFactor (t : ℕ) (tag : Option (J ⊕ K)) : ℝ := β ^ fullMixedCommonSelectedAt M B steps code t * fullMixedLengthRowFactor μ q ρ v vmin V T tag theorem full_mixed_common_forest_row_factor_nonneg (hβ : 0 ≤ β) (hρ : ρ < 1) (hv : 0 ≤ v) (t : ℕ) (tag : Option (J ⊕ K)) : 0 ≤ fullMixedCommonForestRowFactor M B steps code μ q ρ v vmin V T β t tag := mul_nonneg (pow_nonneg hβ _) (fullMixedLengthRowFactor_nonneg μ q ρ v vmin V T hρ hv tag) end Factor end Bounty end section /- Arbitrary logarithmic savings for all characters at large Mellin frequencies. -/ open Finset Filter namespace Bounty end Bounty end section /- Literal logarithmic phases and the original finite pattern family preserve the direct unshared prime-kernel bounds, without shared-completion premises. -/ open Finset Classical namespace Bounty section Envelope variable {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) include hξ theorem physical_unshared_prime_three_phase_norm_le (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (u v : GroupMarkedLists P (fun g => ell + (repeatedBigPrimePatternCut probes r t i g).card)) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b c : ℝ) (w z d : ℕ) : let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ ‖(repeatedBigPrimePatternWeight probes r t i * physicalUnsharedPrimePatternKernel P V probes r t hrt Q h kept i u v aux) * physicalPhase a w * physicalPhase b z * physicalPhase c d‖ ≤ repeatedBigPrimePatternBound probes r t Q ξ i := by intro kept simpa only [norm_mul, physical_phase_norm, mul_one] using physical_unshared_weighted_prime_pattern_norm_le P V probes r t hrt Q h ξ hξ i u v aux end Envelope end Bounty end section /- The complementary original full-vertex pair sum is controlled by the proved bad-draw probability and the exact shared-overlap loss. -/ open Finset open scoped Classical namespace Bounty theorem physical_bad_original_pair_norm_le {G : Type*} [Fintype G] [dG : DecidableEq G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) {q : ℝ} (hq0 : 0 < q) (hq1 : q ≤ 1) (aux : PhysicalAuxLabels P C) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → ℂ) {H : ℝ} (hH : 0 ≤ H) (hK : ∀ L R, physicalSharedCompatible C L R → ‖K L R‖ ≤ H) : ‖∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then ((physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * (if ¬(∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z) then ((physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * (w : ℤ)) * physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * (z : ℤ)) : ℝ) : ℂ) * K L R else 0) else 0‖ ≤ (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (w : ℤ) * markedDivisorWeight univ P q V (fun g => ell + (C g).card) (z : ℤ)) * ((∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin)) * (H / q ^ (2 * ∑ g : G, (J - (C g).card)))) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) let B : ℝ := H / q ^ (2 * ∑ g : G, (J - (C g).card)) let δ : ℝ := ∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin) let β : GroupMarkedLists P (fun g => ell + (C g).card) → GroupMarkedLists P (fun g => ell + (C g).card) → PhysicalAuxLabels P (fun g => univ \ C g) → ℂ := fun _ _ s => if ¬(∀ g j, s g j ∉ physicalSharedForbidden C aux g w z) then (B : ℂ) else 0 let M : ℂ := groupMarkedAverage P (fun g => ell + (C g).card) (w : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) (z : ℤ) (fun v => ∑ s : PhysicalAuxLabels P (fun g => univ \ C g), if physicalRawCutGood C u v s then (physicalAuxMass V (fun g => univ \ C g) s : ℂ) * β u v s else 0)) have hB0 : 0 ≤ B := div_nonneg hH (pow_nonneg hq0.le _) have hδ0 : 0 ≤ δ := physical_shared_error_factor_nonneg C V (fun g => (hV g).le) hw hz hPmin.le have hM : ‖M‖ ≤ δ * B := by apply group_marked_pair_average_norm_le P (fun g => ell + (C g).card) (w : ℤ) (z : ℤ) _ (mul_nonneg hδ0 hB0) intro u v have hh := physical_bad_cut_mean_norm_le V C hV hMass u.val v.val aux hw hz hPmin hp (fun _ => (B : ℂ)) hB0 (fun _ _ => by simp only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hB0, le_refl]) convert hh using 1 congr 1 apply sum_congr rfl intro s _ by_cases hc : physicalRawCutGood C u.val v.val s · by_cases ha : ∀ g j, s g j ∉ physicalSharedForbidden C aux g w z · have hn : ¬(physicalRawCutGood C u.val v.val s ∧ ¬(∀ g j, s g j ∉ physicalSharedForbidden C aux g w z)) := fun h => h.2 ha simp only [β, if_pos hc, if_neg (not_not.mpr ha), if_neg hn, mul_zero] · simp only [β, if_pos hc, if_pos ha, if_pos (And.intro hc ha)] · have hn : ¬(physicalRawCutGood C u.val v.val s ∧ ¬(∀ g j, s g j ∉ physicalSharedForbidden C aux g w z)) := fun h => hc h.1 simp only [if_neg hc, if_neg hn] have he : (∑ L : PhysicalMarkLists P J ell, ∑ R : PhysicalMarkLists P J ell, if physicalSharedCompatible C L R then ((physicalStateMass V J ell * physicalCompletionMass V C ell / (physicalSharedFactor C L : ℝ) : ℝ) : ℂ) * ((physicalUnsharedVertex C L q (w : ℤ) * physicalUnsharedVertex C R q (z : ℤ)) * B * (if ¬(∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z) then 1 else 0) : ℝ) else 0) = (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (w : ℤ) : ℂ) * (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (z : ℤ) : ℂ) * M := by convert physical_stripped_pair_sum_eq_marked_averages P C V q (w : ℤ) (z : ℤ) β using 1 apply sum_congr rfl intro L _ apply sum_congr rfl intro R _ by_cases hc : physicalSharedCompatible C L R · simp only [if_pos hc] by_cases ha : ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z · simp only [β, if_neg (not_not.mpr ha), mul_zero, Complex.ofReal_zero] · simp only [β, if_pos ha, mul_one, Complex.ofReal_mul] · simp only [if_neg hc] have hWw := marked_divisor_weight_nonneg univ P hq0.le V (fun g => ell + (C g).card) (fun g _ => (hV g).le) (w : ℤ) have hWz := marked_divisor_weight_nonneg univ P hq0.le V (fun g => ell + (C g).card) (fun g _ => (hV g).le) (z : ℤ) refine (physical_pair_sum_norm_le_from_bound P C V hV (fun L R => if ¬(∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z) then ((physicalVertexWeight L q ((physicalSharedFactor C L : ℤ) * (w : ℤ)) * physicalVertexWeight R q ((physicalSharedFactor C L : ℤ) * (z : ℤ)) : ℝ) : ℂ) * K L R else 0) (fun L R => (physicalUnsharedVertex C L q (w : ℤ) * physicalUnsharedVertex C R q (z : ℤ)) * B * (if ¬(∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z) then 1 else 0)) (fun L R hLR => physical_bad_vertex_coefficient_norm_le C L R hLR hprime hdis hq0 hq1 (w : ℤ) (z : ℤ) (¬(∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z)) (K L R) (hK L R hLR))).trans ?_ rw [he, norm_mul, norm_mul, Complex.norm_real, Complex.norm_real, Real.norm_eq_abs, Real.norm_eq_abs, abs_of_nonneg hWw, abs_of_nonneg hWz] exact mul_le_mul_of_nonneg_left hM (mul_nonneg hWw hWz) end Bounty end section /- The good original full-vertex contribution approximates the unconditioned marked-list average with the proved shared-exclusion loss. -/ open Finset open scoped Classical namespace Bounty theorem physical_good_pair_comparison {G : Type*} [Fintype G] [dG : DecidableEq G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) {q : ℝ} (hq : 0 ≤ q) (aux : PhysicalAuxLabels P C) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (b : GroupMarkedLists P (fun g => ell + (C g).card) → GroupMarkedLists P (fun g => ell + (C g).card) → ℂ) {H : ℝ} (hH : 0 ≤ H) (hb : ∀ (u : GroupMarkedListsAt P (fun g => ell + (C g).card) (w : ℤ)) (v : GroupMarkedListsAt P (fun g => ell + (C g).card) (z : ℤ)), ‖b u.val v.val‖ ≤ H) : ‖physicalFullPairCorrelation P C V q w z (fun L R => if ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z then b (physicalGroupUnsharedEmbedding C L) (physicalGroupUnsharedEmbedding C R) else 0) - (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (w : ℤ) : ℂ) * (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (z : ℤ) : ℂ) * groupMarkedAverage P (fun g => ell + (C g).card) (w : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) (z : ℤ) (b u))‖ ≤ (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (w : ℤ) * markedDivisorWeight univ P q V (fun g => ell + (C g).card) (z : ℤ)) * ((∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin)) * H) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) have he := physical_good_original_pair_sum_eq_marked_averages P C hprime hdis V q aux hw hz b have hh := physical_cut_shared_pair_average_error C hprime V hV hMass aux hw hz hPmin hp b hH hb have hWw := marked_divisor_weight_nonneg univ P hq V (fun g => ell + (C g).card) (fun g _ => (hV g).le) (w : ℤ) have hWz := marked_divisor_weight_nonneg univ P hq V (fun g => ell + (C g).card) (fun g _ => (hV g).le) (z : ℤ) unfold physicalFullPairCorrelation simp only [mul_ite, mul_zero] at he ⊢ rw [he, ← mul_sub, norm_mul, norm_mul, Complex.norm_real, Complex.norm_real, Real.norm_eq_abs, Real.norm_eq_abs, abs_of_nonneg hWw, abs_of_nonneg hWz] exact mul_le_mul_of_nonneg_left hh (mul_nonneg hWw hWz) end Bounty end section /- The original auxiliary probability weights and the finite prime-pattern family preserve explicit error bounds. Coincident free labels are retained. -/ open Finset open scoped Classical namespace Bounty theorem physical_auxiliary_error_average {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J : ℕ} (V : G → ℝ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (F : PhysicalAuxLabels P C → ℂ) {B : ℝ} (hF : ∀ aux, ‖F aux‖ ≤ B) : ‖∑ aux : PhysicalAuxLabels P C, (physicalAuxMass V C aux : ℂ) * F aux‖ ≤ B := by calc _ ≤ ∑ aux : PhysicalAuxLabels P C, ‖(physicalAuxMass V C aux : ℂ) * F aux‖ := norm_sum_le _ _ _ ≤ ∑ aux : PhysicalAuxLabels P C, physicalAuxMass V C aux * B := by apply sum_le_sum intro aux _ have hm := physical_aux_mass_nonneg V C (fun g => (hV g).le) aux rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hm] exact mul_le_mul_of_nonneg_left (hF aux) hm _ = B := by rw [← sum_mul, physical_aux_mass_sum V C hV hMass, one_mul] end Bounty end section /- The original fixed root equals a full-pair sum with literal cutoff guards. -/ open Finset open scoped Classical namespace Bounty theorem physical_fixed_root_full_pair_guarded {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (C : G → Finset (Fin J)) (q a b : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (positions W : Finset ℤ) (hW : ∀ L : PhysicalMarkLists P J ell, ∀ n ∈ positions, n / physicalSharedFactor C L ∈ W) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) (hf : ∀ (L : PhysicalMarkLists P J ell) w, f ((physicalSharedFactor C L : ℤ) * w) = f w) (hg : ∀ (L : PhysicalMarkLists P J ell) w, g ((physicalSharedFactor C L : ℤ) * w) = g w) : physicalFixedRootCorrelation V C q (-(a+b)) k K aux positions (fun n => physicalPhase (-a) n.natAbs * f n) (fun n => physicalPhase b n.natAbs * g n) Ψ Z = (physicalAuxMass V C aux : ℂ) * ∑ w ∈ W, (Ψ ((w : ℝ) / (Z * physicalFreeFactor C aux)) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (f w) * g (w + k * (physicalFreeFactor C aux : ℕ))) * physicalFullPairCorrelation P C V q w.natAbs (w + k * (physicalFreeFactor C aux : ℕ)).natAbs (fun L R => if (physicalSharedFactor C L : ℤ) * w ∈ positions ∧ (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) ∈ positions then physicalPhasedPairCoefficient C K aux a b w.natAbs (w + k * (physicalFreeFactor C aux : ℕ)).natAbs L R else 0) := by rw [physical_fixed_root_reindex_guarded hdis hprime V C q (-(a+b)) k K aux positions W hW] conv_lhs => arg 2 arg 2 ext L rw [sum_comm] conv_lhs => arg 2; rw [sum_comm] rw [mul_sum, mul_sum] apply sum_congr rfl intro w _ simpa only [mul_assoc] using physical_scaled_root_sum_full_pair hprime V C q a b k K aux positions w f g Ψ Z hf hg end Bounty end section /- The literal auxiliary prime set, including repeated draws only once, supports the endpoint divisibility exclusions. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalFreePrimeSet {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) : Finset ℕ := univ.biUnion (fun g => univ.image (fun j : C g => (aux g j).val)) theorem physical_mem_free_prime_set {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (p : ℕ) : p ∈ physicalFreePrimeSet C aux ↔ ∃ g j, (aux g j).val = p := by simp only [physicalFreePrimeSet, mem_biUnion, mem_univ, true_and, mem_image] theorem physical_free_prime_set_card {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) : (physicalFreePrimeSet C aux).card ≤ ∑ g : G, (C g).card := by apply card_biUnion_le.trans apply sum_le_sum intro g _ exact card_image_le.trans_eq (by simp) theorem physical_free_label_dvd_factor {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (g : G) (j : C g) : (aux g j).val ∣ physicalFreeFactor C aux := by apply dvd_trans (dvd_prod_of_mem (fun j : C g => (aux g j).val) (mem_univ j)) exact dvd_prod_of_mem (fun g => ∏ j : C g, (aux g j).val) (mem_univ g) theorem physical_free_prime_set_dvd_step {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (k : ℤ) {p : ℕ} (hp : p ∈ physicalFreePrimeSet C aux) : (p : ℤ) ∣ k * (physicalFreeFactor C aux : ℕ) := by obtain ⟨g, j, rfl⟩ := (physical_mem_free_prime_set C aux p).mp hp apply dvd_mul_of_dvd_right exact_mod_cast physical_free_label_dvd_factor C aux g j end Bounty end section /- Arbitrary fixed exponential frequency radii, with the original roughness cutoff. Adapted from LongRoughHarmonicDecay, LongRoughBandDecay, and ShiftedLongRoughBand. The only analytic change is the raw scale choice x = exp(CRadius * L), tau = a / CRadius. -/ open Finset Filter namespace Bounty theorem eventually_long_rough_harmonic_power_bound_radius {a CRadius : ℝ} (ha : 0 < a) (hRadius : 0 < CRadius) (T Bsave : ℝ) : ∃ B0 : ℝ, 0 < B0 ∧ ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), (q : ℝ) ≤ L^T → ∀ u : ℝ, L^B0 ≤ |u| → |u| ≤ (Real.exp (CRadius*L))^2 → ∀ m n : ℕ, m ≤ n → Y ≤ (m : ℝ)+1 → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ (Ioc m n).filter (fun i : ℕ => ∀ p ∈ i.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)), harmonicMellinWeight u i*χ (i : ZMod q)‖ ≤ L^(-Bsave) := by obtain ⟨δ,C,K,N0,hδ,hC,hK,hN0,hraw⟩ := exists_rough_harmonic_phase_bound (a/CRadius) (div_pos ha hRadius) refine ⟨max 1 (Bsave+2),lt_of_lt_of_le zero_lt_one (le_max_left _ _),?_⟩ have hfirst := eventually_exp_neg_rpow_mul_rpow_le (by norm_num : (0 : ℝ) < 1/8) (by norm_num : (0 : ℝ) < 1) 0 (Bsave+1) have hsecond := eventually_exp_neg_rpow_mul_rpow_le (by norm_num : (0 : ℝ) < 1) (half_pos ha) 0 (Bsave+1) have hthird := eventually_exp_neg_rpow_mul_rpow_le (by norm_num : (0 : ℝ) < 1) (show 0 < a*δ/2 by positivity) 1 (Bsave+1) filter_upwards [eventually_rough_cell_sieve_parameters ha, eventually_long_rough_sieve_scales ha T N0,hfirst,hsecond,hthird, eventually_ge_atTop (3*K*(3+4*C)),eventually_ge_atTop (1 : ℝ)] with L hpar hscale he1 he2 he3 hconstant hL intro Y hY q hqInst χ hqT u hu huX m n hmn hYm hnY have hL0 : 0 < L := zero_lt_one.trans_le hL have hq : 0 < (q : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne q) obtain ⟨hthreshold,hN,hlevel,hlog⟩ := hscale Y (q : ℝ) hY hq hqT have hu0 : 0 < |u| := (Real.rpow_pos_of_pos hL0 _).trans_le hu have hune : u ≠ 0 := abs_pos.mp hu0 have hx : 1 ≤ Real.exp (CRadius*L) := Real.one_le_exp (mul_nonneg hRadius.le hL0.le) have hscaleEq : (Real.exp (CRadius*L))^(a/CRadius/2) = (Real.exp L)^(a/2) := by rw [← Real.exp_mul, ← Real.exp_mul] congr 1 field_simp have hscaled := hscaleEq.le.trans hN have hb := hraw (Real.exp (Real.sqrt L)) (roughCellSieveOrder L) hpar.2.2.1 hpar.1 hpar.2.1 Y (Real.exp (CRadius*L)) u m n q χ hmn hYm hnY hthreshold hx hscaled hune huX let Z : ℝ := (Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ)+2) let N : ℝ := Y/(Z*(q : ℝ)) have hN' : Real.exp ((a/2)*L) ≤ N := by simpa only [N,Z,← Real.exp_mul,mul_comm L] using hN have hNpos : 0 < N := (Real.exp_pos _).trans_le hN' have hNpow : N^(-δ) ≤ Real.exp (-(a*δ/2)*L) := by have hp := Real.rpow_le_rpow_of_nonpos (Real.exp_pos _) hN' (neg_nonpos.mpr hδ.le) apply hp.trans_eq rw [← Real.exp_mul] congr 1 ring simp only [neg_one_mul,Real.rpow_zero,mul_one] at he1 simp only [Real.rpow_one,Real.rpow_zero,mul_one] at he2 simp only [Real.rpow_one] at he3 have huLower : L^(Bsave+2) ≤ |u| := (Real.rpow_le_rpow_of_exponent_le hL (le_max_right _ _)).trans hu have huInv : 1/|u| ≤ L^(-(Bsave+2)) := by have hi := one_div_le_one_div_of_le (Real.rpow_pos_of_pos hL0 _) huLower simpa only [one_div,Real.rpow_neg hL0.le] using hi have hp1 : L*(1/|u|) ≤ L^(-(Bsave+1)) := by apply (mul_le_mul_of_nonneg_left huInv hL0.le).trans_eq nth_rw 1 [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 ring have hp2 : L*N^(-δ) ≤ L^(-(Bsave+1)) := (mul_le_mul_of_nonneg_left hNpow hL0.le).trans (by simpa only [mul_comm] using he3) have hosc : C*Real.log (2*Real.exp (Real.sqrt L))*(1/|u|+N^(-δ)) ≤ (4*C)*L^(-(Bsave+1)) := by calc _ ≤ C*(2*L)*(1/|u|+N^(-δ)) := by apply mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hlog hC.le) positivity _ = (2*C)*(L*(1/|u|)+L*N^(-δ)) := by ring _ ≤ (2*C)*(L^(-(Bsave+1))+L^(-(Bsave+1))) := mul_le_mul_of_nonneg_left (add_le_add hp1 hp2) (by positivity) _ = _ := by ring have heOrder : Real.exp (-(roughCellSieveOrder L : ℝ)) ≤ L^(-(Bsave+1)) := hpar.2.2.2.2.trans he1 have heLevel : Z/Y ≤ L^(-(Bsave+1)) := hlevel.trans he2 calc _ ≤ 3*K*(2*Real.exp (-(roughCellSieveOrder L : ℝ))+Z/Y+ C*Real.log (2*Real.exp (Real.sqrt L))*(1/|u|+N^(-δ))) := hb _ ≤ 3*K*((3+4*C)*L^(-(Bsave+1))) := by apply mul_le_mul_of_nonneg_left _ (by positivity) nlinarith _ = (3*K*(3+4*C))*L^(-(Bsave+1)) := by ring _ ≤ L*L^(-(Bsave+1)) := mul_le_mul_of_nonneg_right hconstant (by positivity) _ = L^(-Bsave) := by nth_rw 1 [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 ring theorem eventually_long_roughBand_harmonic_power_bound_radius {a CRadius : ℝ} (ha : 0 < a) (hRadius : 0 < CRadius) (T Bsave : ℝ) : ∃ B0 : ℝ, 0 < B0 ∧ ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), (q : ℝ) ≤ L^T → ∀ u : ℝ, L^B0 ≤ |u| → |u| ≤ (Real.exp (CRadius*L))^2 → ∀ A B : ℝ, Y ≤ A → A ≤ B → B ≤ 2*Y → ‖∑ i ∈ roughBand A B (Real.exp (Real.sqrt L)), harmonicMellinWeight u i*χ (i : ZMod q)‖ ≤ L^(-Bsave) := by obtain ⟨B0,hB0,hbound⟩ := eventually_long_rough_harmonic_power_bound_radius ha hRadius T Bsave refine ⟨B0,hB0,?_⟩ filter_upwards [hbound] with L hL intro Y hY q hqInst χ hqT u hu huX A B hYA hAB hBY have hA : 0 ≤ A := ((Real.exp_pos _).trans_le (hY.trans hYA)).le have hB : 0 ≤ B := hA.trans hAB exact hL Y hY q χ hqT u hu huX ⌊A⌋₊ ⌊B⌋₊ (Nat.floor_le_floor hAB) (hYA.trans (Nat.lt_floor_add_one A).le) ((Nat.floor_le hB).trans hBY) theorem eventually_long_roughBand_shifted_power_bound_radius {a CRadius : ℝ} (ha : 0 < a) (hRadius : 0 < CRadius) (T S Bsave : ℝ) : ∃ B0 : ℝ, 0 < B0 ∧ ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), (q : ℝ) ≤ L^T → ∀ t σ : ℝ, L^B0 ≤ |t| → |t| ≤ Real.exp (CRadius*L) → |σ| ≤ L^S → ∀ A B : ℝ, Y ≤ A → A ≤ B → B ≤ 2*Y → ‖∑ i ∈ roughBand A B (Real.exp (Real.sqrt L)), harmonicMellinWeight (t+σ) i*χ (i : ZMod q)‖ ≤ L^(-Bsave) := by obtain ⟨Braw,hBraw,hraw⟩ := eventually_long_roughBand_harmonic_power_bound_radius ha hRadius T Bsave let M := max Braw S have hM : 0 < M := hBraw.trans_le (le_max_left _ _) refine ⟨M+1,by linarith,?_⟩ have hshift := eventually_exp_neg_rpow_mul_rpow_le (by norm_num : (0 : ℝ) < 1) hRadius S 0 have hlarge := (Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hRadius)).eventually_ge_atTop (2 : ℝ) filter_upwards [hraw,hshift,hlarge,eventually_ge_atTop (2 : ℝ)] with L hbound hshiftL heLarge hL2 intro Y hY q hqInst χ hqT t σ htlow htup hσ A B hYA hAB hBY have hL : 1 ≤ L := by linarith have hL0 : 0 < L := by linarith have hshift' : L^S ≤ Real.exp (CRadius*L) := by simp only [Real.rpow_one,neg_mul,neg_zero,Real.rpow_zero] at hshiftL have hm := mul_le_mul_of_nonneg_left hshiftL (Real.exp_pos (CRadius*L)).le have he : Real.exp (CRadius*L)*Real.exp (-(CRadius*L)) = 1 := by rw [← Real.exp_add,add_neg_cancel,Real.exp_zero] simpa only [← mul_assoc,he,one_mul,mul_one] using hm have hσM : |σ| ≤ L^M := hσ.trans (Real.rpow_le_rpow_of_exponent_le hL (le_max_right _ _)) have htM : 2*L^M ≤ |t| := by calc _ ≤ L*L^M := mul_le_mul_of_nonneg_right hL2 (by positivity) _ = L^(M+1) := by rw [Real.rpow_add hL0,Real.rpow_one]; ring _ ≤ |t| := htlow have htri : |t| ≤ |t+σ|+|σ| := by have hh := abs_add_le (t+σ) (-σ) simpa only [add_neg_cancel_right,abs_neg] using hh have hulow : L^Braw ≤ |t+σ| := by have hp : L^Braw ≤ L^M := Real.rpow_le_rpow_of_exponent_le hL (le_max_left _ _) linarith have huexp : |t+σ| ≤ (Real.exp (CRadius*L))^2 := by have he : 2 ≤ Real.exp (CRadius*L) := heLarge have hh := abs_add_le t σ have hs := hσ.trans hshift' nlinarith exact hbound Y hY q χ hqT (t+σ) hulow huexp A B hYA hAB hBY end Bounty end section /- Exact transport of the fixed selected fine schedule to the original physical observed rows with one bounded full-record terminal predicate. -/ open scoped Classical namespace Bounty section History variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (cut : ℕ → Fin N → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) include hP hdis hencode theorem physical_selected_fine_row_intertwines (i : ℕ) (F : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention i (F ∘ physicalBoundedMarkEncode (cut (i + 1))) s = physicalSelectedFineFullRow C aux L σ τ k β V ρ ω retention cut i F (physicalBoundedMarkEncode (cut i) s) := by unfold physicalSelectedFineRow physicalSelectedFineFullRow rw [← physical_observed_mark_row_intertwines C k ω β retention ρ V hV hP hdis (physicalSelectedFineTag n i) (cut i) (cut (i + 1)) (hencode i) (fun o y => if physicalSelectedFineEncodedTest C aux L σ τ cut i o y then F y else 0) s] apply congrArg (fun K => physicalObservedMarkRow C k ω β retention ρ V hV (physicalSelectedFineTag n i) K s) funext o t simp only [Function.comp_apply, physical_selected_fine_encoded_test_iff C aux L σ τ cut i o t] theorem physical_selected_fine_history_intertwines (steps : ℕ) (F : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B → ℂ) : finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C aux L σ τ k β V ρ hV ω retention) steps (F ∘ physicalBoundedMarkEncode (cut steps)) = finiteRowComposition (S := fun _ => FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (physicalSelectedFineFullRow C aux L σ τ k β V ρ ω retention cut) steps F ∘ physicalBoundedMarkEncode (cut 0) := by apply finite_row_composition_intertwines intro i F funext s exact physical_selected_fine_row_intertwines C aux L σ τ k β V ρ hV ω retention hP hdis cut hencode i F s end History end Bounty end section /- The empty-memory physical boundary is supported on exactly the prescribed initial marks, with the original history and all row scalars preserved. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (ζ : ∀ p : PhysicalPrime P, ZMod p.2.val) (hmarks : ∀ j : Fin (n + 1), ∀ p ∈ physicalMarkedPrimes (L j), ζ p = -(a j : ZMod p.2.val)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) end ResiduePath end Bounty end section /- Prescribed physical paths form disjoint selectors on chronological records. -/ open Finset open scoped Classical namespace Bounty abbrev PhysicalSelectedData {N J n : ℕ} (P : Fin N → Finset ℕ) (ell : ℕ) (C : Fin n → Fin N → Finset (Fin J)) := (∀ j, PhysicalAuxLabels P (C j)) × (Fin (n + 1) → PhysicalMarkLists P J ell) × (Fin n → PhysicalPermutations (Fin N) J ell) × (Fin n → PhysicalPermutations (Fin N) J ell) section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) noncomputable def physicalSelectedDataTest (d : PhysicalSelectedData P ell C) (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) : Prop := ∀ i < 4 * n + 1, physicalSelectedFineTest C d.1 d.2.1 d.2.2.1 d.2.2.2 i (o i) (t i) theorem physical_selected_data_unique {d e : PhysicalSelectedData P ell C} (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) (hd : physicalSelectedDataTest C d o t) (he : physicalSelectedDataTest C e o t) : d = e := by obtain ⟨ha, hL, hσ, hτ⟩ := physical_selected_fine_data_unique C o t hd he exact Prod.ext ha (Prod.ext hL (Prod.ext hσ hτ)) end Fine end Bounty end section /- Arbitrary power decay for the actual projected clean prime row on positive logarithmic blocks, including its density and collision errors. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- Explicit exponential saving in the assignment-summed pair lattice error. -/ namespace Bounty theorem pair_lattice_error_scale {L θ X Y : ℝ} (hL : 0 ≤ L) (hθ : 10*θ ≤ 1/20) (hX : X ≤ Real.exp ((27/50 : ℝ)*L)) (hY : Y ≤ Real.exp ((27/50 : ℝ)*L)) : ((Real.exp (θ*L))^(10 : ℝ))^3 * (Real.exp ((1/20 : ℝ)*L))^2 + (X+Y)*((Real.exp (θ*L))^(10 : ℝ))^2 * Real.exp ((1/20 : ℝ)*L) ≤ 3*Real.exp ((69/100 : ℝ)*L) := by have hz : (Real.exp (θ*L))^(10 : ℝ) = Real.exp (10*θ*L) := by rw [← Real.exp_mul] congr 1 ring have hfirst : ((Real.exp (θ*L))^(10 : ℝ))^3 * (Real.exp ((1/20 : ℝ)*L))^2 = Real.exp ((30*θ+1/10)*L) := by rw [hz, pow_succ, pow_two, pow_two] simp only [← Real.exp_add] congr 1 ring have hsecond : ((Real.exp (θ*L))^(10 : ℝ))^2 * Real.exp ((1/20 : ℝ)*L) = Real.exp ((20*θ+1/20)*L) := by rw [hz, pow_two] simp only [← Real.exp_add] congr 1 ring have h1 : Real.exp ((30*θ+1/10)*L) ≤ Real.exp ((69/100 : ℝ)*L) := by apply Real.exp_le_exp.mpr apply mul_le_mul_of_nonneg_right _ hL linarith have h2 : (X+Y)*Real.exp ((20*θ+1/20)*L) ≤ 2*Real.exp ((69/100 : ℝ)*L) := by calc _ ≤ (2*Real.exp ((27/50 : ℝ)*L))*Real.exp ((20*θ+1/20)*L) := mul_le_mul_of_nonneg_right (by linarith) (Real.exp_pos _).le _ = 2*Real.exp ((20*θ+59/100)*L) := by rw [mul_assoc, ← Real.exp_add] congr 2 ring _ ≤ _ := mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right (by linarith) hL)) (by norm_num) rw [hfirst, mul_assoc (X+Y), hsecond] linarith theorem eventually_pair_lattice_profile_small (C D : ℝ) : ∀ᶠ L : ℝ in Filter.atTop, C*L*Real.exp (-(31/100 : ℝ)*L) ≤ L^(-D) := by filter_upwards [eventually_linear_exponential_profile_le_rpow (by norm_num : (0 : ℝ) < 31/100) (by norm_num : (0 : ℝ) < 31/100) 0 C D] with L hL simpa only [zero_mul, zero_add] using hL end Bounty end section /- Arbitrary power decay for the actual projected clean prime row on positive logarithmic blocks, including density, collision, and static initial-ledger errors. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- The complete signed prime family on the original physical full state, including exact small-residue translation on every auxiliary fiber. The fixed initial gate only tests fresh births, and all event choices remain. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Exact physical history normalization under adjacent common-mark compatibility. No global residue assignment is supplied; all original local rows and cutoffs remain. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hcompat : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] include hstep hcompat hlist hP hdis hk in theorem physical_selected_fine_adjacent_normalization (hρ : ρ ≠ 0) : ((∏ g, ∏ s : PhysicalSlots J ell, β g (L 0 g s) / V g : ℝ) : ℂ) * finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow (B := B) C aux L σ τ k β V ρ hV ω retention) (4 * n + 1) physicalEmptyMemoryTerminal (physicalInitialMarkState B (L 0)) = (∏ i ∈ range (2 * n + 1), physicalSelectedCoarseScalar C aux L σ ω i) * (ghostPhaseCappedHistory (fun p : PhysicalPrime P => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity L p.1) j p.2) (fun p => physicalResidueAbsoluteHit a p.1 p.2) (fun _ j => 1 - retention (globalBirthFiniteIndex n j)) (fun p => β p.1 p.2) (fun p => V p.1) (fun _ => B) (fun _ => B) n : ℂ) := by rw [physical_selected_fine_path_eq_adjacent C aux k L a σ τ hstep hcompat hlist hP hdis hk β V ρ hV B ω retention, mul_left_comm] congr 1 exact physical_joint_adjacent_normalized_eq_capped_absolute C aux k L a σ τ hstep hcompat hlist hP hdis hk β (fun _ j => 1 - retention j) V (fun _ => ρ) hV B (fun _ => hρ) end ResiduePath end Bounty end section /- The unchanged full fine path action is a sequence of visits and projected edge rows. -/ namespace Bounty section Schedule variable {N m : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] (n : (g : Fin N) → P g → ℕ) [∀ g p, NeZero (n g p)] {M : Fin N → ℕ} (S : Fin m → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (phase : ∀ (tag : Option (Fin (m + 1) ⊕ Fin m)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B), FullPermutationMixedEvent n S B A Δ D tag x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : (g : Fin N) → P g → ℝ) (q : Fin (m + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Schedule end Bounty end section /- A positive margin after the unbalanced Buchstab mesh and balanced tail. -/ namespace Bounty open Finset Real theorem exists_positive_buchstab_mesh_parameters (Kpre Cbal : ℝ) (hCbal : 0 ≤ Cbal) : ∃ κ q b : ℝ, ∃ h N : ℕ, ∃ M : Fin N → ℝ, 0 < κ ∧ κ ≤ 1/50 ∧ q = 1/2-κ ∧ 0 < q ∧ q < 1/2 ∧ 0 < b ∧ b < q ∧ 1 ≤ h ∧ Even h ∧ b*(4*(h : ℝ)+2) < 1/2 ∧ Cbal*κ ≤ shiftedSieveRatioConstant/16 ∧ 0 < N ∧ (∀ i : Fin N, reciprocalGrid b q N (i : ℕ) < reciprocalGrid b q N ((i : ℕ)+1) ∧ 0 < M i ∧ ∀ α ∈ Set.Icc (reciprocalGrid b q N (i : ℕ)) (reciprocalGrid b q N ((i : ℕ)+1)), buchstabDensity (reciprocalGrid b q N (i : ℕ)) (1-α) ≤ M i) ∧ (∑ i : Fin N, M i*log (reciprocalGrid b q N ((i : ℕ)+1)/reciprocalGrid b q N (i : ℕ))) ≤ buchstabDensity b 1-1+1/16 ∧ shiftedSieveRatioConstant/2 < shiftedSieveRatioConstant*(Mertens.primeProductLimitConstant/b)*(1-Kpre*exp (-(h : ℝ))) - shiftedSieveRatioConstant* (∑ i : Fin N, M i*log (reciprocalGrid b q N ((i : ℕ)+1)/reciprocalGrid b q N (i : ℕ))) - Cbal*κ := by have hS : 0 < shiftedSieveRatioConstant := lt_of_lt_of_le zero_lt_one shifted_sieve_ratio_constant_bounds.1 let κ : ℝ := min (1/50) (shiftedSieveRatioConstant/(16*(Cbal+1))) have hκ : 0 < κ := by dsimp [κ]; positivity have hκmax : κ ≤ 1/50 := min_le_left _ _ have hκloss : Cbal*κ ≤ shiftedSieveRatioConstant/16 := by have he : κ*(16*(Cbal+1)) ≤ shiftedSieveRatioConstant := (le_div_iff₀ (by positivity : 0 < 16*(Cbal+1))).mp (min_le_right _ _) nlinarith let q : ℝ := 1/2-κ have hq : 0 < q := by dsimp [q]; linarith have hqhalf : q < 1/2 := by dsimp [q]; linarith obtain ⟨b,h,hb,hbq,hh,heven,hlevel,hgap⟩ := exists_positive_buchstab_subtraction Kpre hq obtain ⟨N,hN,M,hbins,hsum⟩ := exists_buchstab_upper_mesh_density_bound hb hbq hqhalf.le (show (0 : ℝ)<1/16 by norm_num) refine ⟨κ,q,b,h,N,M,hκ,hκmax,rfl,hq,hqhalf,hb,hbq,hh,heven,hlevel,hκloss,hN,hbins,hsum,?_⟩ have hgapS := mul_lt_mul_of_pos_left hgap hS have hsumS := mul_le_mul_of_nonneg_left hsum hS.le nlinarith end Bounty /- Public declaration closure audit. -/ end section /- Actual rough-proxy bin bounds and their finite aggregation. -/ open Finset Filter namespace Bounty theorem half_error_density_slack {R ε : ℝ} (hε : 0 < ε) : let η := ε / (2 * (|R| + 1)) 0 < η ∧ R * η ≤ ε / 2 := by have hd : 0 < 2 * (|R| + 1) := by positivity refine ⟨div_pos hε hd, ?_⟩ have hη : 0 ≤ ε / (2 * (|R| + 1)) := (div_pos hε hd).le calc R * (ε / (2 * (|R| + 1))) ≤ (|R| + 1) * (ε / (2 * (|R| + 1))) := mul_le_mul_of_nonneg_right (by linarith [le_abs_self R]) hη _ = ε / 2 := by field_simp theorem arithmetic_window_cofactor_product_bounds {L : ℝ} (hL : 0 ≤ L) {p m u : ℕ} (hu : u ∈ arithmeticProductWindow 1 (Real.exp L)) (hprod : p * m = 2 * u + 1) : 0 < m ∧ 2 * Real.exp L ≤ (p : ℝ) * (m : ℝ) ∧ (p : ℝ) * (m : ℝ) ≤ 33 * Real.exp L := by have hw := (mem_arithmeticProductWindow_iff (by norm_num : (1 : ℕ) ≠ 0) (Real.exp L)).mp hu simp only [one_mul] at hw have he : 1 ≤ Real.exp L := Real.one_le_exp hL have hp : (p : ℝ) * (m : ℝ) = 2 * (u : ℝ) + 1 := by exact_mod_cast hprod refine ⟨?_, ?_, ?_⟩ · by_contra hm have hm0 : m = 0 := by omega simp [hm0] at hprod · nlinarith [hw.1] · nlinarith [hw.2] end Bounty end section /- Uniform Lyapunov rows for an original owner, paying one common atom bound per selected child. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Owner end Bounty end section /- Applying the smooth spatial partition to the actual determinant support. -/ open Finset namespace Bounty theorem typeII_majorant_smooth_partition {y : TypeIIShiftIndex} {L U V E : ℝ} (hL : 0 < L) (hU : 0 < U) (hV : 0 < V) (hE : 0 < E) (hUV : 4 ≤ U * V) (hk : y.1.1 ≠ 0) (hm : (y.2.1.1 : ℝ) ∈ Set.Icc U (2 * U)) (hm' : (y.2.2.1 : ℝ) ∈ Set.Icc U (2 * U)) (hz : y.1.2 = y.2.2.1 * y.2.1.2) (hne : typeIIEMajorant (L ^ 88) (typeIIRealE y / E) * typeIINMajorant (typeIIRealN y / V) ≠ 0) : ∑ j ∈ range (⌈Real.logb 2 (192 * L ^ 88)⌉₊ + 1), typeIISmoothDyadic ((y.1.2 : ℝ) / (U ^ 2 * V / (16 * E) * 2 ^ j)) = 1 := by let Z₀ := U ^ 2 * V / (16 * E) have hZ₀ : 0 < Z₀ := by dsimp only [Z₀]; positivity have hr := typeII_majorant_cross_scale_range hL hU hV hE hUV hk hm hm' hz hne have hlo : 1 ≤ (y.1.2 : ℝ) / Z₀ := (le_div_iff₀ hZ₀).mpr (by simpa using hr.1.le) have hhi : (y.1.2 : ℝ) / Z₀ ≤ 192 * L ^ 88 := by apply (div_le_iff₀ hZ₀).mpr calc (y.1.2 : ℝ) ≤ 12 * U ^ 2 * V * L ^ 88 / E := hr.2.le _ = (192 * L ^ 88) * Z₀ := by dsimp only [Z₀]; ring calc _ = ∑ j ∈ range (⌈Real.logb 2 (192 * L ^ 88)⌉₊ + 1), typeIISmoothDyadic (((y.1.2 : ℝ) / Z₀) / 2 ^ j) := by apply sum_congr rfl intro j hj congr 1 dsimp only [Z₀] ring _ = 1 := typeII_smooth_dyadic_partition_log hlo hhi end Bounty end section /- Exact full-P and active-slot separation of the finite-window Mellin integrand. -/ open Finset Filter MeasureTheory Real namespace Bounty end Bounty end section /- Concrete signed-family pairing with both big-active projections. -/ open Finset open scoped Classical namespace Bounty section variable {I S G : Type*} [Fintype I] [Fintype S] [Fintype G] [DecidableEq S] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] [∀ g (p : P g), NeZero p.val] theorem physical_mixed_gated_clean_pattern_projected_pairing (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : I → G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (q : ℝ) (ν : ∀ g, P g → ℝ) (sourceGate targetGate : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (hsg : ∀ s (τ : FullActiveSlotPermutations (fun _ : G => J + ell)), sourceGate (s.1, fullActivePermutation τ s.2) = sourceGate s) (htg : ∀ s (τ : FullActiveSlotPermutations (fun _ : G => J + ell)), targetGate (s.1, fullActivePermutation τ s.2) = targetGate s) (u f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => targetGate (s,x) * f (s,x))) (hPs : ∀ s p, p ∈ Ps s → 0 < p) (hP : ∀ g p, p ∈ P g → 0 < p) : let W : CleanFullMemoryState P J ell B → ℝ := productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1) (∑ s, (physicalSmallBigMeasure Vs W s : ℂ) * (starRingEnd ℂ) (u s) * physicalSmallBigBigAverage (physicalMixedGatedCleanPatternAction initial V b C ζ θ ρ k K Vs q sourceGate targetGate (physicalSmallBigBigAverage f)) s) = ∑ d, ∑ r, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition Vs q (fun s => sourceGate s * u s) d x r) * cleanFullMemoryActiveMap (cleanFullMemoryInitialPatternEventAction initial V b C ζ θ ρ k (fun i => canonicalMixedEdgeD (C i) d) K d (cleanFullMemoryActiveMap (physicalSmallBigCondition Vs q (fun s => targetGate s * f s) d))) x r := by intro W let smallAux : PhysicalAuxLabels Ps (fun _ => (∅ : Finset (Fin J))) := fun _ j => False.elim (notMem_empty j.val j.property) have hp := physical_small_big_big_projected_pairing (Ps := Ps) (P := fun g => ↥(P g)) (Z := fun g => UnrestrictedResidueParticle (fun p : P g => p.val)) (J := J) (ell := ell) (M := fun _ => J + ell) (B := B) Vs q (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1) sourceGate targetGate hsg htg (physicalMixedGatedCleanPatternAction initial V b C ζ θ ρ k K Vs q sourceGate targetGate) (fun d f x r => ∑ i, physicalMixedCleanInitialAction initial V b (C i) ζ θ ρ k (K i) d f x r) (fun u f => physical_mixed_gated_clean_pattern_pairing initial V b C ζ θ ρ k K Vs hVs q W smallAux sourceGate targetGate u f) u f refine hp.trans ?_ apply sum_congr rfl intro d _ apply sum_congr rfl intro r _ apply sum_congr rfl intro x _ have he := congrFun (congrFun (physical_mixed_clean_pattern_projected_reencode initial V b C ζ θ ρ k K d (physicalSmallBigCondition Vs q (fun s => targetGate s * f s) d) (fun rs => physical_small_big_condition_memory_symmetric Vs q _ hf d rs) hPs hP) x) r have he' := congrArg (fun z : ℂ => (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition Vs q (fun s => sourceGate s * u s) d x r) * z) he dsimp only [cleanFullMemoryActiveMap, W] at he' ⊢ exact he' end end Bounty end section /- Repeated physical labels agree with the canonical source extraction and with reassembly from any reduced target. These identities do not require clean or supported events and therefore include invalid-target fallbacks. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type} {P : G → Finset ℕ} {J ell B : ℕ} theorem physical_mixed_repeated_labels_canonical (C : G → Finset (Fin J)) (x : CleanFullMemoryState P J ell B) : (cleanFullMemoryEquiv P J ell B ((fullActivePermutation (cleanPhysicalSlotChange C)).symm x)).2.2.1 = physicalMixedRepeatedLabels C x := by funext g j change (x g).1 ((physicalFullSlotIndex (C g)).symm (finSumFinEquiv.symm (finSumFinEquiv j))) = _ rw [Equiv.symm_apply_apply] rfl theorem physical_mixed_repeated_labels_reassemble (C : G → Finset (Fin J)) (x : CleanFullMemoryState P J ell B) (y : ProductBoundedOrderedState (fun g => ↥(P g)) (fun g => UnrestrictedResidueParticle (fun p : P g => p.val)) (fun g => (physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) B) : physicalMixedRepeatedLabels C ((productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B).symm ((productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B x).1, y)) = repeatedBigFill C (physicalMixedRepeatedLabels C x) (cleanFullFreshEquiv P C (physicalCleanFreshEquiv (fun g => ↥(P g)) C (fun g => (y g).1))) := by let z := (fullActivePermutation (cleanPhysicalSlotChange C)).symm x let N := fun g => (y g).2.1 let p := fun g j => ((y g).2.2 j).1 let r := fun g j => ((y g).2.2 j).2 let source := (cleanFullMemoryEquiv P J ell B z).2.2.1 let fresh := physicalCleanFreshEquiv (fun g => ↥(P g)) C (fun g => (y g).1) have hs : (productActiveMemorySplit (cleanFullSharedSlots C) B (cleanFullMemoryState N p source r)).1 = (productActiveMemorySplit (cleanFullSharedSlots C) B z).1 := by funext g i change (z g).1 (finSumFinEquiv (finSumFinEquiv.symm _)) = _ rw [Equiv.apply_symm_apply] rfl have hc := cleanFullMemoryState_reassemble_fill C N p source r fresh rw [hs] at hc have hp := physical_clean_reassemble_fresh C z (fun g => (y g).2) (fun g => (y g).1) have hz : fullActivePermutation (cleanPhysicalSlotChange C) z = x := Equiv.apply_symm_apply _ _ rw [hz] at hp change _ = fullActivePermutation (cleanPhysicalSlotChange C) ((productActiveMemorySplit (cleanFullSharedSlots C) B).symm ((productActiveMemorySplit (cleanFullSharedSlots C) B z).1, fun g => (fresh g, (⟨N g, fun j => ⟨p g j, r g j⟩⟩ : BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : P g => p.val)) B)))) at hp rw [hc] at hp rw [hp, clean_full_memory_physical_encoding] have hsource : source = physicalMixedRepeatedLabels C x := physical_mixed_repeated_labels_canonical C x rw [hsource] funext g j change repeatedBigFill C (physicalMixedRepeatedLabels C x) (cleanFullFreshEquiv P C fresh) g (physicalFullSlotIndex (C g) ((physicalFullSlotIndex (C g)).symm j)) = _ rw [Equiv.apply_symm_apply] end section variable {S G : Type} [sharedInstance1 : Fintype S] [sharedInstance2 : Fintype G] [sharedInstance3 : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} (C : G → Finset (Fin J)) include S G sharedInstance1 sharedInstance2 sharedInstance3 Ps P J ell B C theorem physical_mixed_repeated_labels_event_target (k : ℤ) (a : PhysicalAuxLabels P C) (d : PhysicalSharedLists Ps J) (x : CleanFullMemoryState P J ell B) (e : PhysicalSmallBigFullEvent (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) d x) : physicalMixedRepeatedLabels C (physicalSmallBigFullTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) d x e) = repeatedBigFill C (physicalMixedRepeatedLabels C x) (cleanFullFreshEquiv P C (physicalCleanFreshEquiv (fun g => ↥(P g)) C (fun g => (unrestrictedJointEventTarget (fun g (p : P g) => p.val) (physicalMixedEdgeDelta C k d (productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B x).1 a) (physicalMixedEdgeD C d (productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B x).1 a) (fun g => (physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) B (productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B x).2 e.2 g).1))) := physical_mixed_repeated_labels_reassemble C x _ theorem physical_mixed_clean_prefix_phase_eq_labels (ζ θ : ℝ) (k : ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (a : PhysicalAuxLabels P C) (d : PhysicalSharedLists Ps J) (x : CleanFullMemoryState P J ell B) (r : PhysicalResidues Ps) (e : PhysicalSmallBigFullEvent (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) d x) : let source := physicalMixedRepeatedLabels C x let target := physicalMixedRepeatedLabels C (physicalSmallBigFullTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) d x e) let cp := (productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B x).1 physicalMixedCleanPrefixPhase C ζ θ k K a d x r e = if repeatedBigAuxAvoids C a source ∧ repeatedBigAuxAvoids C a target then K source target a * physicalPhase ζ (physicalMixedSharedD C d cp a) * physicalReturnPhase θ (physicalMixedBigStep C k cp a * (physicalSharedProduct d : ℕ)) else 0 := by dsimp only unfold physicalMixedCleanPrefixPhase rw [physical_mixed_repeated_labels_canonical] dsimp only rw [← physical_mixed_repeated_labels_event_target C k a d x e] end end Bounty end section /- The actual signed prime-pattern family preserves pending symmetry. Its kernel only sees the two active endpoints. Original auxiliary sums, initial newborn exclusion and both endpoint slot averages are retained. -/ open Finset Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} [∀ g (p : P g), NeZero p.val] {J ell B : ℕ} omit dG in theorem physical_mixed_target_labels_reindex (C : G → Finset (Fin J)) (k : ℤ) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalMixedCoefficientEvent C k a s) : physicalMixedRepeatedLabels C (physicalMixedCoefficientTarget C k a (s.1, productMemoryReindex s.2 τ) (physicalMixedCoefficientReindex C k a s τ e)).2 = physicalMixedRepeatedLabels C (physicalMixedCoefficientTarget C k a s e).2 := by funext g j exact congrFun (full_edge_reindex_active (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun _ => Unit) (fun c _ g => physicalMixedEdgeDelta C k (physicalSharedPrefix s.1.2) c a g) (fun c _ g => physicalMixedEdgeD C (physicalSharedPrefix s.1.2) c a g) s.2 τ e.2 g) ((physicalFullSlotIndex (C g)).symm j) variable [DecidableEq S] end end Bounty end section /- Projection and mask identities used by the genuine mixed dirty-family bound. The small-tail gate is never commuted through a small-slot average. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_big_average_energy_le {S G : Type*} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {J ell B : ℕ} {M : G → ℕ} (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) : physicalSmallBigEnergy Vs (productMemoryWeight μ ν) (physicalSmallBigBigAverage f) ≤ physicalSmallBigEnergy Vs (productMemoryWeight μ ν) f := by have h := physical_small_big_fiber_energy_le Vs hVs (productMemoryWeight μ ν) f (physicalSmallBigBigAverage f) 1 (fun s => by have hh := fullActiveAverage_energy_le μ ν hμ hν (fun x => f (s,x)) simp only [one_mul] convert hh using 1 congr 2) simpa only [one_mul] using h section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} (C : G → Finset (Fin J)) (k : ℤ) noncomputable def physicalMixedDirtyPhase (Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent C k a s) : ℂ := if ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅) then Ψ a s e else 0 omit [DecidableEq G] in theorem physical_mixed_dirty_phase_norm_le (Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) {H : ℝ} (hH : 0 ≤ H) (hΨ : ∀ a s e, ‖Ψ a s e‖ ≤ H) : ∀ a s e, ‖physicalMixedDirtyPhase C k Ψ a s e‖ ≤ H := by intro a s e unfold physicalMixedDirtyPhase by_cases hh : ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅) · rw [if_pos hh] exact hΨ a s e · rw [if_neg hh] simpa only [norm_zero] using hH theorem physical_mixed_dirty_coefficient_action_eq (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (initial : ∀ g, Finset (P g)) (Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : physicalMixedCoefficientAction C k V baseline ρ Vs q initial (physicalMixedDirtyPhase C k Ψ) f = fun s => ∑ a : PhysicalAuxLabels P C, (physicalAuxMass V C a : ℂ) * physicalSmallBigFullPhasedAction (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c g => physicalMixedEdgeDelta C k d c a g) (fun d c g => physicalMixedEdgeD C d c a g) (fun g => tiltedPhysicalBirthLaw V g (baseline g)) ρ V (fun c => physicalMixedBigStep C k c a) Vs q (fun y e => if ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅) then (if ∀ g i, (e.2.2 g).2.2.2 i ∉ initial g then Ψ a y e else 0) else 0) f s := by funext s simp only [physicalMixedCoefficientAction, physicalSmallBigFullPhasedAction, physicalSmallBigPhasedAction, physicalMixedDirtyPhase, mul_sum] apply sum_congr rfl intro a _ apply sum_congr rfl intro e _ split_ifs <;> rfl end end Bounty end section /- Finite weighted truncation of the actual three-variable majorant transform. -/ open Finset MeasureTheory Filter namespace Bounty end Bounty end section /- Exact full-P and active-slot separation of the finite-window Mellin integrand. -/ open Finset Filter MeasureTheory Real namespace Bounty noncomputable def candidateFiniteCoarseMellinTest (L E : ℝ) (S : Finset ℕ) (ν : ℝ) (F : ℕ → ℕ → ℂ) : ℕ → ℕ → ℂ := candidateBoxFiniteTest L E S (fun u => (u : ℂ)^(((2*Real.pi*ν : ℝ) : ℂ)*Complex.I) * ∑ m ∈ (2*u+1).divisors, F u m) noncomputable def candidateFiniteMixedMellinIntegrand (c L q : ℝ) (r jStar : ℕ) (E B R : ℝ) (S : Finset ℕ) (F : ℕ → ℕ → ℂ) (ν : ℝ) : ℂ := (exp L : ℂ)^(-((2*Real.pi*ν : ℝ) : ℂ)*Complex.I) * typeIIWindowFourier (L^B) ν * ∑ take ∈ (univ : Finset (Fin ((candidateQIndices c L).card*r) → Bool)).filter (fun take => ∀ i, candidateAllocationActive c L r jStar i = false → take i = false), ∫ ξ, candidateRetainedAllocationIntegrand c L q r jStar (log E) (candidateSmallPSet c L (R*exp L+1)) take (candidateFiniteCoarseMellinTest L E S ν F) ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) L theorem eventually_candidate_finite_mixed_mellin_eq {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (E B R : ℝ) (S : Finset ℕ) (F : ℕ → ℕ → ℂ), (∀ u ∈ S, 0 < u ∧ (u : ℝ) ≤ R*exp L) → ∀ ν : ℝ, candidateFiniteMellinIntegrand c L q r jStar E B S F ν = candidateFiniteMixedMellinIntegrand c L q r jStar E B R S F ν := by filter_upwards [eventually_candidate_box_finite_retained_integrals hc] with L hL intro q r jStar E B R S F hS ν unfold candidateFiniteMellinIntegrand candidateFiniteMixedMellinIntegrand candidateFiniteCoarseMellinTest rw [finite_window_mellin_integrand_separated] congr 1 calc _ = ∑ u ∈ S, candidateBoxRangeCoefficient c L q r jStar E L u * ((u : ℂ)^(((2*Real.pi*ν : ℝ) : ℂ)*Complex.I) * ∑ m ∈ (2*u+1).divisors, F u m) := by apply sum_congr rfl intro u hu exact mul_assoc _ _ _ _ = _ := hL q r jStar E L (R*exp L) (S) (fun u => (u : ℂ)^(((2*Real.pi*ν : ℝ) : ℂ)*Complex.I) * ∑ m ∈ (2*u+1).divisors, F u m) hS end Bounty end section /- Exact Mellin-phase separation with the full coarse mask and allocation range retained. -/ open Finset namespace Bounty noncomputable def typeIIMellinPhase (ν : ℝ) (n : ℕ) : ℂ := (n : ℂ)^(((2*Real.pi*ν : ℝ) : ℂ)*Complex.I) theorem typeII_mellin_phase_mul (ν : ℝ) (e h : ℕ) : typeIIMellinPhase ν (e*h) = typeIIMellinPhase ν e*typeIIMellinPhase ν h := by unfold typeIIMellinPhase simpa only [Nat.cast_mul,Complex.ofReal_natCast] using Complex.mul_cpow_ofReal_nonneg (Nat.cast_nonneg e : (0 : ℝ) ≤ e) (Nat.cast_nonneg h : (0 : ℝ) ≤ h) (((2*Real.pi*ν : ℝ) : ℂ)*Complex.I) theorem typeII_mellin_phase_norm (ν : ℝ) {n : ℕ} (hn : 0 < n) : ‖typeIIMellinPhase ν n‖ = 1 := by unfold typeIIMellinPhase change ‖((n : ℝ) : ℂ)^(((2*Real.pi*ν : ℝ) : ℂ)*Complex.I)‖ = 1 rw [Complex.norm_cpow_eq_rpow_re_of_pos (by exact_mod_cast hn)] simp section variable (T M N H S : Finset ℕ) (aE α β aH : ℕ → ℂ) (L X ν : ℝ) (hα : ∀ m, m ∉ M → α m = 0) (hβ : ∀ n, n ∉ N → β n = 0) include T M N H S aE α β aH L X ν hα hβ theorem finite_mellin_divisor_typeII_masked : (∑ e ∈ T, ∑ h ∈ H, aE e*aH h*candidateBoxFiniteTest L X S (fun u => typeIIMellinPhase ν u*∑ m ∈ (2*u+1).divisors, α m*β ((2*u+1)/m)) e h) = ∑ e ∈ T.filter (fun e : ℕ => X/L^88 ≤ (e : ℝ) ∧ (e : ℝ) ≤ X), ∑ n ∈ N, (aE e*typeIIMellinPhase ν e)*β n* typeIIInnerSum M H α (fun h => if e*h ∈ S then aH h*typeIIMellinPhase ν h else 0) e n := by classical rw [sum_filter] apply sum_congr rfl intro e he by_cases hr : X/L^88 ≤ (e : ℝ) ∧ (e : ℝ) ≤ X · simp only [candidateBoxFiniteTest,hr,true_and,if_true] have hrow := congrArg (fun z : ℂ => (aE e*typeIIMellinPhase ν e)*z) (shifted_divisor_typeII_row e M N H α β (fun h => if e*h ∈ S then aH h*typeIIMellinPhase ν h else 0) hα hβ) calc _ = (aE e*typeIIMellinPhase ν e)* ∑ h ∈ H, (if e*h ∈ S then aH h*typeIIMellinPhase ν h else 0)* ∑ m ∈ (2*e*h+1).divisors, α m*β ((2*e*h+1)/m) := by rw [mul_sum] apply sum_congr rfl intro h hh by_cases hs : e*h ∈ S · simp only [hs,if_true,typeII_mellin_phase_mul] simp only [mul_assoc] ring · simp only [hs,if_false,mul_zero,zero_mul] _ = _ := by simpa only [mul_sum,mul_assoc] using hrow · simp only [candidateBoxFiniteTest,hr,false_and,if_false,mul_zero,sum_const_zero] theorem finite_mellin_divisor_typeII_compatible (hcompat : ∀ e ∈ T, X/L^88 ≤ (e : ℝ) ∧ (e : ℝ) ≤ X → ∀ n ∈ N, ∀ m ∈ M, ∀ h ∈ H, m*n=2*e*h+1 → e*h ∈ S) : (∑ e ∈ T, ∑ h ∈ H, aE e*aH h*candidateBoxFiniteTest L X S (fun u => typeIIMellinPhase ν u*∑ m ∈ (2*u+1).divisors, α m*β ((2*u+1)/m)) e h) = ∑ e ∈ T.filter (fun e : ℕ => X/L^88 ≤ (e : ℝ) ∧ (e : ℝ) ≤ X), ∑ n ∈ N, (aE e*typeIIMellinPhase ν e)*β n* typeIIInnerSum M H α (fun h => aH h*typeIIMellinPhase ν h) e n := by rw [finite_mellin_divisor_typeII_masked T M N H S aE α β aH L X ν hα hβ] apply sum_congr rfl intro e he obtain ⟨he,hr⟩ := mem_filter.mp he apply sum_congr rfl intro n hn rw [typeII_inner_coarse_mask_eq M H S α (fun h => aH h*typeIIMellinPhase ν h) e n (hcompat e he hr n hn)] end end Bounty end section /- Actual fixed-skeleton ghost stages pay exactly their original selected-child atom costs. -/ open Finset Classical namespace Bounty section Ghost variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (j : J) (htag : steps.get u = some (.inl j)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (sk : CoupledGhostSkeleton M B s) (μ : ∀ g, P g → ℝ) (q ρ v : ℝ) (V η : Fin N → ℝ) theorem full_mixed_common_ghost_skeleton_stage_le (hη : ∀ g, 0 ≤ η g) (hμ : ∀ g p, 0 ≤ μ g p) (hμatom : ∀ g p, μ g p ≤ η g) (hv : 0 ≤ v) : let d := fullMixedCommonSelectedCount M B steps code u (∑ births : CoupledGhostSamples M B s sk, if birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inl j)) htag s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩)) history) code then |coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) (fun g => physicalGhostBirth (n g) q ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B s ((coupledGhostSkeletonEquiv M B s).symm ⟨sk, births⟩)| * productLengthLyapunov v (coupledGhostJointEventTarget M B s ((coupledGhostSkeletonEquiv M B s).symm ⟨sk, births⟩)) else 0) ≤ if ∀ g, d g ≤ (sk g).1.val then coupledGhostSkeletonAbsMass (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) M B s sk * v ^ (∑ g, boundedGhostSkeletonOutputCount (M g) B (s g) (sk g).1 (sk g).2) * ∏ g, (|(1 - q) * V g / ρ| * η g) ^ d g * (|(1 - q) * V g / ρ| * ∑ p, μ g p) ^ ((sk g).1.val - d g) else 0 := by dsimp only let ord := fullMixedCommonGhostSampleOrder S B j steps u htag s sk let f := fullMixedCommonGhostSampleEmbedding S B j steps u htag s sk let owner := fullMixedCommonIndexStage M B steps let d := fullMixedCommonSelectedCount M B steps code u let root := fun g => |(1 - q) * V g / ρ| * ∑ p, μ g p let atom := fun g => |(1 - q) * V g / ρ| * η g rw [full_mixed_common_ghost_skeleton_stage_sum n S B A Δ D steps u s history code j htag sk] by_cases hs : birthForestStageSupport owner u.succ (ownerSampleSupport (f ∘ ord) owner u.succ history) code · dsimp only [owner, f, ord, Function.comp] at hs erw [if_pos hs] have hd : ∀ g, (univ.filter (fun i : Fin (sk g).1.val => code (f ⟨g, i⟩) ≠ none)).card = d g := by intro g exact owner_supported_selected_fiber_card (fun g => Fin (sk g).1.val) ord f owner u.succ (fun i => fullMixedCommonBirthGroup M B steps (fullMixedCommonBirthOrder M B steps i)) (full_mixed_common_ghost_sample_owner S B j steps u htag s sk) (full_mixed_common_ghost_sample_group S B j steps u htag s sk) code history hs g have hcap : ∀ g, d g ≤ (sk g).1.val := by intro g rw [← hd g] exact (card_filter_le _ _).trans_eq (by simp only [card_univ, Fintype.card_fin]) rw [if_pos hcap] have hvalid := owner_sample_support_anchors_valid (f ∘ ord) (full_mixed_common_ghost_sample_strictMono S B j steps u htag s sk) owner (full_mixed_common_index_stage_monotone M B steps) u.succ (fun i => full_mixed_common_ghost_sample_owner S B j steps u htag s sk (ord i)) history code hs have hcost := grouped_join_restricted_forest_cost_eq (fun g => Fin (sk g).1.val) ord f code history root atom d hvalid hd have hb := coupled_ghost_forest_continuation_le n μ q ρ V M B s sk ord (restrictedBirthCode (f ∘ ord) code) (fun i => (restrictedBirthAnchors (f ∘ ord) code history i).join) η hη hμ hμatom v 1 hv zero_le_one (fun births => productLengthLyapunov v (coupledGhostJointEventTarget M B s ((coupledGhostSkeletonEquiv M B s).symm ⟨sk, births⟩))) (fun _ => by simp only [one_mul]; exact le_rfl) rw [one_mul] at hb dsimp only [root, atom] at hcost refine le_trans (le_of_eq ?_) (le_trans hb (le_of_eq ?_)) · apply sum_congr rfl intro births _ dsimp only [f, ord, Function.comp] split_ifs <;> first | rfl | contradiction · congr 1 convert hcost using 1 · apply prod_congr rfl intro i _ cases restrictedBirthCode (f ∘ ord) code i <;> cases (restrictedBirthAnchors (f ∘ ord) code history i).join <;> rfl · simp only [Fintype.card_fin, d] · dsimp only [owner, f, ord, Function.comp] at hs erw [if_neg hs] split_ifs · exact mul_nonneg (mul_nonneg (coupled_ghost_skeleton_abs_mass_nonneg _ _ _ _ _ _) (pow_nonneg hv _)) (prod_nonneg fun g _ => mul_nonneg (pow_nonneg (mul_nonneg (abs_nonneg _) (hη g)) _) (pow_nonneg (mul_nonneg (abs_nonneg _) (sum_nonneg fun p _ => hμ g p)) _)) · exact le_rfl end Ghost end Bounty end section /- Actual fixed-skeleton full-edge stages pay exactly their original selected-child atom costs. -/ open Finset Classical namespace Bounty section Edge variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (k : K) (htag : steps.get u = some (.inr k)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s) (ω : ∀ c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (ρ v : ℝ) (V η : Fin N → ℝ) theorem full_mixed_common_edge_skeleton_stage_le (hη : ∀ g, 0 ≤ η g) (hμ : ∀ g p, 0 ≤ μ g p) (hμatom : ∀ g p, μ g p ≤ η g) (hv : 0 ≤ v) : let d := fullMixedCommonSelectedCount M B steps code u (∑ fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk, if birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inr k)) htag s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, fresh⟩)) history) code then |fullActiveEdgeEventWeight n (S k) B (A k) (Δ k) (D k) ω μ ρ V s ((fullActiveEdgeSkeletonEquiv n (S k) B (A k) (Δ k) (D k) s).symm ⟨sk, fresh⟩)| * productLengthLyapunov v (fullActiveEdgeEventTarget n (S k) B (A k) (Δ k) (D k) s ((fullActiveEdgeSkeletonEquiv n (S k) B (A k) (Δ k) (D k) s).symm ⟨sk, fresh⟩)) else 0) ≤ if ∀ g, d g ≤ ((S k g)ᶜ.card - (sk.2 g).2.1.card) then fullActiveEdgeSkeletonAbsMass n (S k) B (A k) (Δ k) (D k) ω ρ V s sk * v ^ (∑ g, unrestrictedSkeletonOutputCount (n g) (Δ k (productActiveMemorySplit (S k) B s).1 sk.1 g) (D k (productActiveMemorySplit (S k) B s).1 sk.1 g) (S k g)ᶜ.card B ((productActiveMemorySplit (S k) B s).2 g) (sk.2 g)) * ∏ g, η g ^ d g * (∑ p, μ g p) ^ (((S k g)ᶜ.card - (sk.2 g).2.1.card) - d g) else 0 := by dsimp only let ord := fullMixedCommonEdgeSampleOrder n S B k steps u htag (A k) (Δ k) (D k) s sk let f := fullMixedCommonEdgeSampleEmbedding n S B k steps u htag (A k) (Δ k) (D k) s sk let owner := fullMixedCommonIndexStage M B steps let d := fullMixedCommonSelectedCount M B steps code u rw [full_mixed_common_edge_skeleton_stage_sum n S B A Δ D steps u s history code k htag sk] by_cases hs : birthForestStageSupport owner u.succ (ownerSampleSupport (f ∘ ord) owner u.succ history) code · dsimp only [owner, f, ord, Function.comp] at hs erw [if_pos hs] have hd : ∀ g, (univ.filter (fun i : {i : Fin (S k g)ᶜ.card // i ∉ (sk.2 g).2.1} => code (f ⟨g, i⟩) ≠ none)).card = d g := by intro g exact owner_supported_selected_fiber_card (fun g => {i : Fin (S k g)ᶜ.card // i ∉ (sk.2 g).2.1}) ord f owner u.succ (fun i => fullMixedCommonBirthGroup M B steps (fullMixedCommonBirthOrder M B steps i)) (full_mixed_common_edge_sample_owner n S B k steps u htag (A k) (Δ k) (D k) s sk) (full_mixed_common_edge_sample_group n S B k steps u htag (A k) (Δ k) (D k) s sk) code history hs g have hcap : ∀ g, d g ≤ ((S k g)ᶜ.card - (sk.2 g).2.1.card) := by intro g rw [← hd g] have h := card_filter_le (s := (univ : Finset ({i : Fin (S k g)ᶜ.card // i ∉ (sk.2 g).2.1}))) (p := fun i => code (f ⟨g, i⟩) ≠ none) simpa only [card_univ, Fintype.card_subtype_compl, Fintype.card_fin, Fintype.card_coe] using h rw [if_pos hcap] have hvalid := owner_sample_support_anchors_valid (f ∘ ord) (full_mixed_common_edge_sample_strictMono n S B k steps u htag (A k) (Δ k) (D k) s sk) owner (full_mixed_common_index_stage_monotone M B steps) u.succ (fun i => full_mixed_common_edge_sample_owner n S B k steps u htag (A k) (Δ k) (D k) s sk (ord i)) history code hs have hb := full_edge_grouped_restricted_continuation_le n (S k) B (A k) (Δ k) (D k) ω μ ρ V s sk ord f code history d hvalid hd η hη hμ hμatom v 1 hv zero_le_one (fun fresh => productLengthLyapunov v (fullActiveEdgeEventTarget n (S k) B (A k) (Δ k) (D k) s ((fullActiveEdgeSkeletonEquiv n (S k) B (A k) (Δ k) (D k) s).symm ⟨sk, fresh⟩))) (fun _ => by simp only [one_mul]; exact le_rfl) rw [one_mul] at hb refine le_trans (le_of_eq ?_) hb apply sum_congr rfl intro fresh _ dsimp only [f, ord, Function.comp] split_ifs <;> first | rfl | contradiction · dsimp only [owner, f, ord, Function.comp] at hs erw [if_neg hs] split_ifs · exact mul_nonneg (mul_nonneg (full_active_edge_skeleton_abs_mass_nonneg _ _ _ _ _ _ _ _ _ _ _) (pow_nonneg hv _)) (prod_nonneg fun g _ => mul_nonneg (pow_nonneg (hη g) _) (pow_nonneg (sum_nonneg fun p _ => hμ g p) _)) · exact le_rfl end Edge end Bounty end section /- The high-frequency estimate on literal real-endpoint rough bands. -/ open Finset Filter namespace Bounty end Bounty end section /- The common forest's actual edge multiplier is an allowed observable of the physical mixed coefficient row. Original performed guards are retained. -/ open Finset Classical namespace Bounty section Mixed variable {I K S : Type} [Fintype S] {N J ell B : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} [∀ g (p : P g), NeZero p.val] (C : Fin N → Finset (Fin J)) (k : ℤ) (steps : List (Option (I ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) (i : Fin steps.length) (tag : K) (hi : steps.get i = some (.inr tag)) end Mixed end Bounty end section /- Both original shared-overlap branches combine into the marked-pair approximation. The coefficient is identified only on the good event. -/ open Finset open scoped Classical namespace Bounty theorem physical_whole_pair_comparison {G : Type*} [Fintype G] [dG : DecidableEq G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) {q : ℝ} (hq0 : 0 < q) (hq1 : q ≤ 1) (aux : PhysicalAuxLabels P C) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → ℂ) (b : GroupMarkedLists P (fun g => ell + (C g).card) → GroupMarkedLists P (fun g => ell + (C g).card) → ℂ) {H : ℝ} (hH : 0 ≤ H) (hK : ∀ L R, physicalSharedCompatible C L R → ‖K L R‖ ≤ H) (hb : ∀ (u : GroupMarkedListsAt P (fun g => ell + (C g).card) (w : ℤ)) (v : GroupMarkedListsAt P (fun g => ell + (C g).card) (z : ℤ)), ‖b u.val v.val‖ ≤ H) (hgood : ∀ L R, physicalSharedCompatible C L R → (∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z) → K L R = b (physicalGroupUnsharedEmbedding C L) (physicalGroupUnsharedEmbedding C R)) : ‖physicalFullPairCorrelation P C V q w z K - (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (w : ℤ) : ℂ) * (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (z : ℤ) : ℂ) * groupMarkedAverage P (fun g => ell + (C g).card) (w : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) (z : ℤ) (b u))‖ ≤ (markedDivisorWeight univ P q V (fun g => ell + (C g).card) (w : ℤ) * markedDivisorWeight univ P q V (fun g => ell + (C g).card) (z : ℤ)) * ((∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin)) * (H + H / q ^ (2 * ∑ g : G, (J - (C g).card)))) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) let W0 := markedDivisorWeight univ P q V (fun g => ell + (C g).card) (w : ℤ) let W1 := markedDivisorWeight univ P q V (fun g => ell + (C g).card) (z : ℤ) let δ : ℝ := ∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin) let T : ℂ := (W0 : ℂ) * (W1 : ℂ) * groupMarkedAverage P (fun g => ell + (C g).card) (w : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) (z : ℤ) (b u)) let Kg : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → ℂ := fun L R => if ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z then K L R else 0 let Kb : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → ℂ := fun L R => if ¬(∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z) then K L R else 0 have hsplit : physicalFullPairCorrelation P C V q w z K = physicalFullPairCorrelation P C V q w z Kg + physicalFullPairCorrelation P C V q w z Kb := by rw [← physical_full_pair_add] apply physical_full_pair_congr intro L R _ dsimp only [Kg, Kb] by_cases ha : ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z · simp only [if_pos ha, if_neg (not_not.mpr ha), add_zero] · simp only [if_neg ha, if_pos ha, zero_add] have hg : ‖physicalFullPairCorrelation P C V q w z Kg - T‖ ≤ (W0 * W1) * (δ * H) := by have he : physicalFullPairCorrelation P C V q w z Kg = physicalFullPairCorrelation P C V q w z (fun L R => if ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z then b (physicalGroupUnsharedEmbedding C L) (physicalGroupUnsharedEmbedding C R) else 0) := by apply physical_full_pair_congr intro L R hLR dsimp only [Kg] by_cases ha : ∀ g j, physicalSharedAux C L g j ∉ physicalSharedForbidden C aux g w z · rw [if_pos ha, if_pos ha, hgood L R hLR ha] · rw [if_neg ha, if_neg ha] rw [he] exact physical_good_pair_comparison P C hprime hdis V hV hMass hq0.le aux hw hz hPmin hp b hH hb have hbad : ‖physicalFullPairCorrelation P C V q w z Kb‖ ≤ (W0 * W1) * (δ * (H / q ^ (2 * ∑ g : G, (J - (C g).card)))) := by simpa only [physicalFullPairCorrelation, Kb, mul_ite, mul_zero] using physical_bad_original_pair_norm_le P C hprime hdis V hV hMass hq0 hq1 aux hw hz hPmin hp K hH hK change ‖physicalFullPairCorrelation P C V q w z K - T‖ ≤ (W0 * W1) * (δ * (H + H / q ^ (2 * ∑ g : G, (J - (C g).card)))) calc _ = ‖(physicalFullPairCorrelation P C V q w z Kg - T) + physicalFullPairCorrelation P C V q w z Kb‖ := by rw [hsplit] congr 1 ring _ ≤ ‖physicalFullPairCorrelation P C V q w z Kg - T‖ + ‖physicalFullPairCorrelation P C V q w z Kb‖ := norm_add_le _ _ _ ≤ (W0 * W1) * (δ * H) + (W0 * W1) * (δ * (H / q ^ (2 * ∑ g : G, (J - (C g).card)))) := add_le_add hg hbad _ = _ := by ring end Bounty end section /- Literal retained prime coefficients with all auxiliary exclusions and the three logarithmic phases, before and after removal of shared coordinates. -/ open Finset open scoped Classical namespace Bounty section Coefficient variable {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) (w z : ℕ) noncomputable def physicalOriginalPrimePairCoefficient (L R : PhysicalMarkLists P J ell) : ℂ := let C := repeatedBigPrimePatternCut probes r t i let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ if physicalListAdmissible C aux L R then (repeatedBigPrimePatternWeight probes r t i * repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i (fun g s => L g s) (fun g s => R g s) aux) * physicalPhase a (physicalSharedFactor C L * w) * physicalPhase b (physicalSharedFactor C L * z) * physicalPhase (-(a+b)) (physicalD C L aux) else 0 noncomputable def physicalUnsharedPrimePairCoefficient (u v : GroupMarkedLists P (fun g => ell + (repeatedBigPrimePatternCut probes r t i g).card)) : ℂ := let C := repeatedBigPrimePatternCut probes r t i let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ if physicalUnsharedAuxAvoids C aux u ∧ physicalUnsharedAuxAvoids C aux v then (repeatedBigPrimePatternWeight probes r t i * physicalUnsharedPrimePatternKernel P V probes r t hrt Q h kept i u v aux) * physicalPhase a w * physicalPhase b z * physicalPhase (-(a+b)) (physicalFreeFactor C aux) else 0 theorem physical_original_prime_pair_coefficient_norm_le (hξ : 0 < ξ) (L R : PhysicalMarkLists P J ell) : ‖physicalOriginalPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z L R‖ ≤ repeatedBigPrimePatternBound probes r t Q ξ i := by unfold physicalOriginalPrimePairCoefficient dsimp only split_ifs · rw [physical_prime_pattern_kernel_factors_unshared] simpa only [norm_mul, physical_phase_norm, mul_one] using physical_unshared_weighted_prime_pattern_norm_le P V probes r t hrt Q h ξ hξ i (physicalGroupUnsharedEmbedding (repeatedBigPrimePatternCut probes r t i) L) (physicalGroupUnsharedEmbedding (repeatedBigPrimePatternCut probes r t i) R) aux · simpa only [norm_zero] using repeated_big_prime_pattern_bound_nonneg probes r t Q ξ i theorem physical_unshared_prime_pair_coefficient_norm_le (hξ : 0 < ξ) (u v : GroupMarkedLists P (fun g => ell + (repeatedBigPrimePatternCut probes r t i g).card)) : ‖physicalUnsharedPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z u v‖ ≤ repeatedBigPrimePatternBound probes r t Q ξ i := by unfold physicalUnsharedPrimePairCoefficient dsimp only split_ifs · exact physical_unshared_prime_three_phase_norm_le P V probes r t hrt Q h ξ hξ i u v aux a b (-(a+b)) w z _ · simpa only [norm_zero] using repeated_big_prime_pattern_bound_nonneg probes r t Q ξ i theorem physical_prime_pair_coefficient_eq_of_good_shared (hprime : ∀ g p, p ∈ P g → p.Prime) (hw : 0 < w) (hz : 0 < z) (L R : PhysicalMarkLists P J ell) (hLR : physicalSharedCompatible (repeatedBigPrimePatternCut probes r t i) L R) (hgood : ∀ g j, physicalSharedAux (repeatedBigPrimePatternCut probes r t i) L g j ∉ physicalSharedForbidden (repeatedBigPrimePatternCut probes r t i) aux g w z) : physicalOriginalPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z L R = physicalUnsharedPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z (physicalGroupUnsharedEmbedding (repeatedBigPrimePatternCut probes r t i) L) (physicalGroupUnsharedEmbedding (repeatedBigPrimePatternCut probes r t i) R) := by unfold physicalOriginalPrimePairCoefficient physicalUnsharedPrimePairCoefficient dsimp only rw [physical_list_admissible_iff_of_good_shared _ aux L R w z hLR hgood] split_ifs · rw [physical_prime_pattern_kernel_factors_unshared, physical_D_shared_free] have hd : 0 < physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux := prod_pos (fun g _ => prod_pos (fun j _ => (hprime g _ (aux g j).property).pos)) have he := physical_shared_phase_cancel a b (physical_shared_factor_pos (repeatedBigPrimePatternCut probes r t i) L hprime) hw hz hd simp only [mul_assoc] at he ⊢ rw [he] · rfl end Coefficient end Bounty end section /- Cutoff guards are removed only on the nonzero support of the actual outer test. -/ open Finset open scoped Classical namespace Bounty theorem physical_fixed_root_full_pair_of_coverage {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (C : G → Finset (Fin J)) (q a b : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (positions W : Finset ℤ) (hW : ∀ L : PhysicalMarkLists P J ell, ∀ n ∈ positions, n / physicalSharedFactor C L ∈ W) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) (hf : ∀ (L : PhysicalMarkLists P J ell) w, f ((physicalSharedFactor C L : ℤ) * w) = f w) (hg : ∀ (L : PhysicalMarkLists P J ell) w, g ((physicalSharedFactor C L : ℤ) * w) = g w) (hcover : ∀ w ∈ W, Ψ ((w : ℝ) / (Z * physicalFreeFactor C aux)) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (f w) * g (w + k * (physicalFreeFactor C aux : ℕ)) ≠ 0 → ∀ L : PhysicalMarkLists P J ell, (physicalSharedFactor C L : ℤ) * w ∈ positions ∧ (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) ∈ positions) : physicalFixedRootCorrelation V C q (-(a+b)) k K aux positions (fun n => physicalPhase (-a) n.natAbs * f n) (fun n => physicalPhase b n.natAbs * g n) Ψ Z = (physicalAuxMass V C aux : ℂ) * ∑ w ∈ W, (Ψ ((w : ℝ) / (Z * physicalFreeFactor C aux)) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (f w) * g (w + k * (physicalFreeFactor C aux : ℕ))) * physicalFullPairCorrelation P C V q w.natAbs (w + k * (physicalFreeFactor C aux : ℕ)).natAbs (physicalPhasedPairCoefficient C K aux a b w.natAbs (w + k * (physicalFreeFactor C aux : ℕ)).natAbs) := by rw [physical_fixed_root_full_pair_guarded hdis hprime V C q a b k K aux positions W hW f g Ψ Z hf hg] congr 1 apply sum_congr rfl intro w hw by_cases ht : Ψ ((w : ℝ) / (Z * physicalFreeFactor C aux)) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (f w) * g (w + k * (physicalFreeFactor C aux : ℕ)) = 0 · rw [ht, zero_mul, zero_mul] · congr 1 apply physical_full_pair_congr intro L R _ exact if_pos (hcover w hw ht L) end Bounty end section /- The two unshared endpoint exclusions hold away from the original free-label divisibility set, since every free label divides the actual shift. -/ open Finset open scoped Classical namespace Bounty theorem physical_unshared_aux_avoids_of_no_free_divisor {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (n : ℤ) (hn : ∀ p ∈ physicalFreePrimeSet C aux, ¬ (p : ℤ) ∣ n) (u : GroupMarkedListsAt P (fun g => ell + (C g).card) n) : physicalUnsharedAuxAvoids C aux u.val := by intro g j s he have hp : (aux g j).val ∈ physicalFreePrimeSet C aux := (physical_mem_free_prime_set C aux _).mpr ⟨g, j, rfl⟩ have hd := u.property g s rw [← he] at hd exact hn _ hp hd theorem physical_no_free_divisor_shift {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (n k : ℤ) (hn : ∀ p ∈ physicalFreePrimeSet C aux, ¬ (p : ℤ) ∣ n) : ∀ p ∈ physicalFreePrimeSet C aux, ¬ (p : ℤ) ∣ n + k * (physicalFreeFactor C aux : ℕ) := by intro p hp hz apply hn p hp simpa only [add_sub_cancel_right] using dvd_sub hz (physical_free_prime_set_dvd_step C aux k hp) end Bounty end section /- The actual free-label divisor set has the support and prime lower bounds required by the invariant endpoint exclusion estimate. -/ open Finset open scoped Classical namespace Bounty theorem physical_free_prime_set_supported {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (hprime : ∀ g p, p ∈ P g → p.Prime) (Q : Finset ℕ) (hQ : ∀ g, P g ⊆ Q) {p : ℕ} (hp : p ∈ physicalFreePrimeSet C aux) : p ∈ Nat.factoredNumbers Q := by obtain ⟨g, j, rfl⟩ := (physical_mem_free_prime_set C aux p).mp hp have h := hprime g _ (aux g j).property apply Nat.mem_factoredNumbers_of_primeFactors_subset h.ne_zero rw [h.primeFactors] exact singleton_subset_iff.mpr (hQ g (aux g j).property) theorem physical_free_prime_set_lower {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) {Pmin : ℝ} (hP : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) {p : ℕ} (hp : p ∈ physicalFreePrimeSet C aux) : Pmin ≤ (p : ℝ) := by obtain ⟨g, j, rfl⟩ := (physical_mem_free_prime_set C aux p).mp hp exact hP g (aux g j) end Bounty end section /- Absolute errors averaged over all original auxiliary labels and patterns. -/ open Finset Real open scoped Classical namespace Bounty theorem physical_pattern_absolute_error {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (probes : G → Finset (Fin J)) (r t : Finset G) {B : ℝ} (F : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i) → ℂ) (hF : ∀ i aux, ‖F i aux‖ ≤ B) : ‖∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i), (physicalAuxMass V (repeatedBigPrimePatternCut probes r t i) aux : ℂ)*F i aux‖ ≤ (Fintype.card (RepeatedBigPrimePatternIndex (ell := ell) probes r t) : ℝ)*B := by apply (norm_sum_le _ _).trans calc _ ≤ ∑ _i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, B := by apply sum_le_sum intro i _ exact physical_auxiliary_error_average V _ hV hMass (F i) (hF i) _ = _ := by simp theorem physical_pattern_error_power {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (probes : G → Finset (Fin J)) (r t : Finset G) {L A D : ℝ} (hL : 0 < L) (hcard : (Fintype.card (RepeatedBigPrimePatternIndex (ell := ell) probes r t) : ℝ) ≤ L^A) (F : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i) → ℂ) (hF : ∀ i aux, ‖F i aux‖ ≤ L^(-(D+A))) : ‖∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i), (physicalAuxMass V (repeatedBigPrimePatternCut probes r t i) aux : ℂ)*F i aux‖ ≤ L^(-D) := by apply (physical_pattern_absolute_error V hV hMass probes r t F hF).trans calc _ ≤ L^A*L^(-(D+A)) := mul_le_mul_of_nonneg_right hcard (rpow_nonneg hL.le _) _ = _ := by rw [← rpow_add hL]; congr 1; ring end Bounty end section /- The actual four-factor estimate needs no separate exponential radius restriction. Adapted from LongRoughFourFactorIntegral; R <= Y and log Y <= c * L provide the fixed exponential radius needed by the generalized rough-band estimate. -/ open Filter Finset Set MeasureTheory namespace Bounty theorem exists_long_rough_four_factor_integral_decay_log_radius {a beta c d Bcoeff A As H Cmean Cres kmean kres q t aLong : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hd : 0 < d) (hBcoeff : 1 ≤ Bcoeff) (hAs0 : 0 ≤ As) (haLong : 0 < aLong) (hAs : A + (Cmean + 2 + 2 * kmean) + 1 ≤ 2 * As) (hH : A + 2 + (Cres + 2 + 2 * kres) + 1 ≤ 2 * H) (Tmod Sshift : ℝ) : ∃ B0 : ℝ, 0 < B0 ∧ ∀ Bsave : ℝ, A + B0 + 2 + 2 * q + 2 * t + 1 ≤ 2 * Bsave → ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R : ℝ), 1 ≤ Y → d * L ≤ Real.log Y → Real.log Y ≤ c * L → Real.exp (L ^ a) / 2 ≤ P → P ≤ Real.exp (L ^ beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2 * P) → (∀ p : s, ‖coeff p‖ ≤ Bcoeff) → ∀ (Q M T : ℝ → ℂ), Continuous M → Continuous T → ∀ (Ylong Alo Blo σ : ℝ) (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), Real.exp (aLong * L) ≤ Ylong → Ylong ≤ Alo → Alo ≤ Blo → Blo ≤ 2 * Ylong → (r : ℝ) ≤ L ^ Tmod → |σ| ≤ L ^ Sshift → (∀ u, Q u = ∑ i ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u + σ) i * χ (i : ZMod r)) → (∀ u ∈ Set.Icc (-R) R, ‖Q u‖ ≤ L ^ q) → (∀ u ∈ Set.Icc (-R) R, ‖T u‖ ≤ L ^ t) → (∀ u ∈ Set.Icc (-R) R, |u| ≤ L ^ B0 → ‖M u‖ ≤ L ^ (-Bsave)) → ∀ (Km Kr : ℕ) (lom him : Fin Km → ℕ) (lor hir : Fin Kr → ℕ) (wm : Fin Km → ℕ → ℂ) (wr : Fin Kr → ℕ → ℂ) (Um : Fin Km → ℝ) (Ur : Fin Kr → ℝ), (Km : ℝ) ≤ L ^ kmean → (Kr : ℝ) ≤ L ^ kres → (∀ j, 1 ≤ Um j ∧ R ≤ Um j ∧ Real.log (Um j) ≤ c * L ∧ Um j ≤ (lom j : ℝ) ∧ (him j : ℝ) ≤ 2 * Um j ∧ (∑ n ∈ Finset.Icc (lom j) (him j), ‖wm j n‖ ^ 2) ≤ L ^ Cmean / Um j) → (∀ j, Y ^ (3 / 5 : ℝ) ≤ Ur j ∧ Ur j ≤ (lor j : ℝ) ∧ (hir j : ℝ) ≤ 2 * Ur j ∧ (∑ n ∈ Finset.Icc (lor j) (hir j), ‖wr j n‖ ^ 2) ≤ L ^ Cres / Ur j) → (∀ u, Q u * M u * T u = ∑ j : Fin Km, ∑ n ∈ Finset.Icc (lom j) (him j), wm j n * Complex.exp ((Real.log (n : ℝ) * u : ℝ) * Complex.I)) → (∀ u, M u * T u = ∑ j : Fin Kr, ∑ n ∈ Finset.Icc (lor j) (hir j), wr j n * Complex.exp ((Real.log (n : ℝ) * u : ℝ) * Complex.I)) → (∫ u in Set.Icc (-R) R, ‖primeReciprocalPolynomial s coeff u * Q u * M u * T u‖ ^ 2) ≤ L ^ (-A) := by obtain ⟨B0, hB0, hhigh⟩ := eventually_long_roughBand_shifted_power_bound_radius haLong (show 0 < max 1 c from zero_lt_one.trans_le (le_max_left _ _)) Tmod Sshift H refine ⟨B0, hB0, ?_⟩ intro Bsave hBsave filter_upwards [hhigh, eventually_prime_four_factor_integral_decay ha ha1 hbeta hc hd hBcoeff hAs0 hAs hH hBsave, eventually_ge_atTop (0 : ℝ)] with L hrough hmain hL intro s hs coeff Y P R hY hloglo hloghi hPlo hPhi hR hRY hband hcoeff Q M T hM hT Ylong Alo Blo σ r hr χ hYlong hAlo hAB hBlo hmod hσ hQeq hQbound hTbound hlow Km Kr lom him lor hir wm wr Um Ur hKm hKr hmdata hrdata hmrep hrrep have hRexp : R ≤ Real.exp (max 1 c * L) := by calc R ≤ Y := hRY _ = Real.exp (Real.log Y) := (Real.exp_log (zero_lt_one.trans_le hY)).symm _ ≤ Real.exp (max 1 c * L) := Real.exp_le_exp.mpr (hloghi.trans (mul_le_mul_of_nonneg_right (le_max_right _ _) hL)) have hQ : Continuous Q := by have hh : Continuous (fun u => ∑ i ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u + σ) i * χ (i : ZMod r)) := by unfold harmonicMellinWeight fun_prop exact hh.congr (fun u => (hQeq u).symm) apply hmain s hs coeff Y P R hY hloglo hloghi hPlo hPhi hR hRY hband hcoeff Q M T hQ hM hT hQbound hTbound _ hlow Km Kr lom him lor hir wm wr Um Ur hKm hKr hmdata hrdata hmrep hrrep intro u hu hlarge rw [hQeq u] exact hrough Ylong hYlong r χ hmod u σ hlarge.le ((abs_le.mpr hu).trans hRexp) hσ Alo Blo hAlo hAB hBlo end Bounty end section /- The recorded-history identity applies to every physical terminal test, using the exact inverse of the encoding on its image. -/ open scoped Classical namespace Bounty section Terminal variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) end Terminal end Bounty end section /- Each fixed selection of marks, permutations and auxiliary draws inherits the original physical recorded-history energy bound with no path-count factor. -/ namespace Bounty section Energy variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) end Energy end Bounty end section /- Each full chronological record can select at most one prescribed physical path. -/ open Finset open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (cut : ℕ → Fin N → Finset (Fin J)) theorem physical_selected_fine_record_data_unique {aux aux' : ∀ j, PhysicalAuxLabels P (C j)} {L L' : Fin (n + 1) → PhysicalMarkLists P J ell} {σ τ σ' τ' : Fin n → PhysicalPermutations (Fin N) J ell} (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (h : List.Forall₂ (physicalSelectedFineTraceTest C aux L σ τ cut) (List.range (4 * n + 1)) r) (h' : List.Forall₂ (physicalSelectedFineTraceTest C aux' L' σ' τ' cut) (List.range (4 * n + 1)) r) : aux = aux' ∧ L = L' ∧ σ = σ' ∧ τ = τ' := by apply physical_selected_fine_data_unique_of_joint_tests C intro i hi have hir : i < r.length := by simpa only [← h.length_eq, List.length_range] using hi have hil : i < (List.range (4 * n + 1)).length := by simpa only [List.length_range] using hi have ha : physicalSelectedFineTraceTest C aux L σ τ cut i (r.get ⟨i, hir⟩) := by simpa only [List.get_eq_getElem, List.getElem_range] using h.get hil hir have hb : physicalSelectedFineTraceTest C aux' L' σ' τ' cut i (r.get ⟨i, hir⟩) := by simpa only [List.get_eq_getElem, List.getElem_range] using h'.get hil hir obtain ⟨t, het, ht⟩ := ha obtain ⟨u, heu, hu⟩ := hb have he : u = t := physical_bounded_mark_encode_injective (cut (i + 1)) (heu.trans het.symm) exact ⟨(r.get ⟨i, hir⟩).2.1, t, ht, he ▸ hu⟩ noncomputable def physicalSelectedDataRecordTest (d : PhysicalSelectedData P ell C) (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) : Prop := List.Forall₂ (physicalSelectedFineTraceTest C d.1 d.2.1 d.2.2.1 d.2.2.2 cut) (List.range (4 * n + 1)) r theorem physical_selected_data_record_unique {d e : PhysicalSelectedData P ell C} (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (hd : physicalSelectedDataRecordTest C cut d r) (he : physicalSelectedDataRecordTest C cut e r) : d = e := by obtain ⟨ha, hL, hσ, hτ⟩ := physical_selected_fine_record_data_unique C cut r hd he exact Prod.ext ha (Prod.ext hL (Prod.ext hσ hτ)) noncomputable def physicalSelectedDataRecordPhase (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) : ℂ := ∑ d ∈ S, if physicalSelectedDataRecordTest C cut d r then w d else 0 end Fine end Bounty end section /- Exact packing of original labeled physical paths by their indexed pattern sequence. -/ open Finset namespace Bounty section Packing variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) def physicalPathSelectedEquiv : (PhysicalMarkLists P J ell × (Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell)) ≃ (Σ pattern : Fin n → patterns, PhysicalSelectedData P ell (fun j => C (pattern j).val)) where toFun x := ⟨(fun j => (x.2 j).1.2.2.1), (fun j => (x.2 j).1.2.2.2), Fin.cons x.1 (fun j => (x.2 j).2), (fun j => (x.2 j).1.1), (fun j => (x.2 j).1.2.1)⟩ invFun y := (y.2.2.1 0, fun j => ((y.2.2.2.1 j, y.2.2.2.2 j, ⟨y.1 j, y.2.1 j⟩), y.2.2.1 j.succ)) left_inv x := by apply Prod.ext · rfl · funext j change (((x.2 j).1.1, (x.2 j).1.2.1, ⟨(x.2 j).1.2.2.1, (x.2 j).1.2.2.2⟩), (x.2 j).2) = x.2 j rcases x.2 j with ⟨⟨σ, τ, ⟨i, aux⟩⟩, L⟩ rfl right_inv y := by rcases y with ⟨pattern, aux, L, σ, τ⟩ change (⟨pattern, aux, Fin.cons (L 0) (fun j => L j.succ), σ, τ⟩ : Σ pattern : Fin n → patterns, PhysicalSelectedData P ell (fun j => C (pattern j).val)) = ⟨pattern, aux, L, σ, τ⟩ have hL : Fin.cons (L 0) (fun j => L j.succ) = L := by funext j refine Fin.cases ?_ (fun i => ?_) j <;> rfl rw [hL] theorem physical_path_selected_patterns (L : PhysicalMarkLists P J ell) (p : Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : (physicalPathSelectedEquiv patterns C (L, p)).1 = fun j => (p j).1.2.2.1 := rfl theorem physical_path_selected_aux (L : PhysicalMarkLists P J ell) (p : Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : (physicalPathSelectedEquiv patterns C (L, p)).2.1 = fun j => (p j).1.2.2.2 := rfl theorem physical_path_selected_marks_succ (L : PhysicalMarkLists P J ell) (p : Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (j : Fin n) : (physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.succ = (p j).2 := rfl theorem physical_path_selected_sigma (L : PhysicalMarkLists P J ell) (p : Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : (physicalPathSelectedEquiv patterns C (L, p)).2.2.2.1 = fun j => (p j).1.1 := rfl theorem physical_path_selected_marks_eq_finite_path (L : PhysicalMarkLists P J ell) (p : Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : (physicalPathSelectedEquiv patterns C (L, p)).2.2.1 = fun j => finitePathMarks L p j.val := by funext j refine Fin.cases ?_ (fun i => ?_) j · rfl · simp only [physical_path_selected_marks_succ, Fin.val_succ, finitePathMarks, dif_pos i.isLt] theorem physical_path_selected_inverse_step (pattern : Fin n → patterns) (d : PhysicalSelectedData P ell (fun j => C (pattern j).val)) (j : Fin n) : ((physicalPathSelectedEquiv patterns C).symm ⟨pattern, d⟩).2 j = ((d.2.2.1 j, d.2.2.2 j, ⟨pattern j, d.1 j⟩), d.2.1 j.succ) := rfl theorem physical_selected_inverse_finite_path_marks (pattern : Fin n → patterns) (d : PhysicalSelectedData P ell (fun j => C (pattern j).val)) : (fun j : Fin (n + 1) => finitePathMarks ((physicalPathSelectedEquiv patterns C).symm ⟨pattern, d⟩).1 ((physicalPathSelectedEquiv patterns C).symm ⟨pattern, d⟩).2 j.val) = d.2.1 := by funext j refine Fin.cases ?_ (fun i => ?_) j · rfl · simp only [Fin.val_succ, finitePathMarks, dif_pos i.isLt, physical_path_selected_inverse_step] end Packing end Bounty end section /- The complete list coefficient and unit phase of a selected physical path. -/ open Finset namespace Bounty section Coefficient variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) noncomputable def physicalSelectedCoefficient (d : PhysicalSelectedData P ell C) : ℂ := ∏ j : Fin n, K j (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ)) (d.1 j) * physicalPhase (ζ j) (physicalD (C j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (d.1 j)) end Coefficient end Bounty end section /- Arbitrary power decay for the actual signed prime family on the full bounded product memory measure, retaining both active-slot averages. All memory sectors and residue occurrences are integrated in the conclusion. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- Complete fine-history selection is equivalent to its four chronological tests. -/ open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) theorem physical_selected_data_test_iff_four (d : PhysicalSelectedData P ell C) (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) : physicalSelectedDataTest C d o t ↔ (∀ j : Fin (n + 1), o (4 * j.val) = .inr none ∧ (t (4 * j.val)).1 = d.2.1 j) ∧ (∀ j : Fin n, o (4 * j.val + 1) = .inl (d.2.2.1 j)) ∧ (∀ j : Fin n, o (4 * j.val + 2) = .inr (some ⟨j, d.1 j⟩) ∧ (t (4 * j.val + 2)).1 = physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ)) ∧ (∀ j : Fin n, o (4 * j.val + 3) = .inl (physicalInversePermutations (d.2.2.2 j))) := by constructor · intro h refine ⟨?_, ?_, ?_, ?_⟩ · intro j exact (physical_selected_fine_test_visit C _ _ _ _ j _ _).mp (h _ (by have := j.isLt; omega)) · intro j exact (physical_selected_fine_test_source_permutation C _ _ _ _ j _ _).mp (h _ (by have := j.isLt; omega)) · intro j exact (physical_selected_fine_test_edge C _ _ _ _ j _ _).mp (h _ (by have := j.isLt; omega)) · intro j exact (physical_selected_fine_test_target_permutation C _ _ _ _ j _ _).mp (h _ (by have := j.isLt; omega)) · rintro ⟨h0, h1, h2, h3⟩ i hi have hr : i % 4 < 4 := Nat.mod_lt _ (by omega) have he : i = 4 * (i / 4) + i % 4 := by omega rcases (show i % 4 = 0 ∨ i % 4 = 1 ∨ i % 4 = 2 ∨ i % 4 = 3 by omega) with h | h | h | h · let j : Fin (n + 1) := ⟨i / 4, by omega⟩ have hij : i = 4 * j.val := by dsimp [j]; omega rw [hij] exact (physical_selected_fine_test_visit C _ _ _ _ j _ _).mpr (h0 j) · let j : Fin n := ⟨i / 4, by omega⟩ have hij : i = 4 * j.val + 1 := by dsimp [j]; omega rw [hij] exact (physical_selected_fine_test_source_permutation C _ _ _ _ j _ _).mpr (h1 j) · let j : Fin n := ⟨i / 4, by omega⟩ have hij : i = 4 * j.val + 2 := by dsimp [j]; omega rw [hij] exact (physical_selected_fine_test_edge C _ _ _ _ j _ _).mpr (h2 j) · let j : Fin n := ⟨i / 4, by omega⟩ have hij : i = 4 * j.val + 3 := by dsimp [j]; omega rw [hij] exact (physical_selected_fine_test_target_permutation C _ _ _ _ j _ _).mpr (h3 j) end Fine end Bounty end section /- Algebraic normalization of the pair main term and its exponentially small remainder. -/ namespace Bounty theorem pair_main_term_normalization {L θ K B C X V U P H A : ℝ} (hL : 0 < L) (hθ : 0 < θ) (hK : 0 ≤ K) (hB : 0 ≤ B) (hC : 0 ≤ C) (hX : 0 ≤ X) (hU : 0 ≤ U) (hA : 0 ≤ A) (harea : X ≤ B*Real.exp L) (hUbound : U ≤ 1/(θ*L)) (hmass : P*H ≤ C*(L/Real.exp L)*A) : K*X*V^2*U*P*H ≤ (K*B*C/θ)*A*V^2 := by calc _ = (K*X*V^2*U)*(P*H) := by ring _ ≤ (K*X*V^2*U)*(C*(L/Real.exp L)*A) := mul_le_mul_of_nonneg_left hmass (by positivity) _ ≤ (K*(B*Real.exp L)*V^2*U)*(C*(L/Real.exp L)*A) := by gcongr _ ≤ (K*(B*Real.exp L)*V^2*(1/(θ*L)))*(C*(L/Real.exp L)*A) := by gcongr _ = _ := by field_simp theorem pair_error_term_normalization {L C H A E R : ℝ} (_hL : 0 < L) (_hC : 0 ≤ C) (hH : 0 ≤ H) (hA : 0 ≤ A) (hE : E ≤ 3*Real.exp ((69/100 : ℝ)*L)) (hmass : H ≤ C*(L/Real.exp L)*A) (hprofile : (3*C)*L*Real.exp (-(31/100 : ℝ)*L) ≤ R) : E*H ≤ A*R := by calc _ ≤ (3*Real.exp ((69/100 : ℝ)*L))*H := mul_le_mul_of_nonneg_right hE hH _ ≤ (3*Real.exp ((69/100 : ℝ)*L))*(C*(L/Real.exp L)*A) := mul_le_mul_of_nonneg_left hmass (by positivity) _ = ((3*C)*L*Real.exp (-(31/100 : ℝ)*L))*A := by have he : Real.exp ((69/100 : ℝ)*L) / Real.exp L = Real.exp (-(31/100 : ℝ)*L) := by rw [← Real.exp_sub] congr 1 ring calc _ = ((3*C)*L*(Real.exp ((69/100 : ℝ)*L)/Real.exp L))*A := by ring _ = _ := by rw [he] _ ≤ R*A := mul_le_mul_of_nonneg_right hprofile hA _ = _ := mul_comm _ _ end Bounty end section /- Arbitrary power decay for the initial-ledger-masked signed prime family on the full bounded product memory measure, retaining both active-slot averages. All memory sectors and residue occurrences are integrated in the conclusion. -/ open Finset Filter open scoped Classical namespace Bounty section variable (hZ : PrimitiveZeroFreeHalfPlane) (c s z a v D ε E beta tau : ℝ) (m J ell : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (htau : 0 ≤ tau) (hell : 0 < ell) (hml : ell ≤ m) (hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D) include hZ c s z a v D ε E beta tau m J ell hc hs hz ha hv hD hε htau hell hml hgap hDgap end end Bounty end section /- Exact original selected fine normalization with no supplied residue witness. Locally incompatible edges vanish in both the raw and normalized histories. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ))) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (η : Fin N → Fin (n + 1) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] end ResiduePath end Bounty end section /- Simultaneous upper bounds for a finite family of unbalanced rough-proxy bins. -/ open Finset Filter namespace Bounty end Bounty end section /- Uniform Lyapunov rows for an original owner, paying one common atom bound per selected child. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Owner end Bounty end section /- Three-variable Fourier expansion of the actual finite character cross-slice. -/ open Finset MeasureTheory open scoped ComplexConjugate namespace Bounty noncomputable def typeIICrossCharacterAmplitude {d : ℕ} (χ : DirichletCharacter ℂ d) (α aH : ℕ → ℂ) (y : TypeIIShiftIndex) : ℂ := α y.2.1.1 * conj (α y.2.2.1) * aH y.2.1.2 * conj (aH y.2.2.2) * χ (y.2.1.1 : ZMod d) * conj (χ (y.2.2.1 : ZMod d)) end Bounty end section /- Exact conversion of each smooth spatial correlation to harmonic normalization. -/ open Finset open scoped ContDiff namespace Bounty noncomputable def typeIIHarmonicDyadic (t : ℝ) : ℝ := t * typeIISmoothDyadic t theorem typeII_harmonic_dyadic_contDiff : ContDiff ℝ ∞ typeIIHarmonicDyadic := contDiff_id.mul typeII_smooth_dyadic_contDiff theorem typeII_harmonic_dyadic_bounds (t : ℝ) : 0 ≤ typeIIHarmonicDyadic t ∧ typeIIHarmonicDyadic t ≤ 2 := by by_cases hzero : typeIISmoothDyadic t = 0 · simp [typeIIHarmonicDyadic, hzero] · have hs := typeII_smooth_dyadic_support hzero have hb := typeII_smooth_dyadic_bounds t have ht : 0 ≤ t := by linarith [hs.1] exact ⟨mul_nonneg ht hb.1, (mul_le_of_le_one_right ht hb.2).trans hs.2.le⟩ theorem typeII_finite_harmonic_normalization (S : Finset ℕ) {Z : ℝ} (hZ : 0 < Z) (ψ : ℝ → ℝ) (f : ℕ → ℂ) (hS : ∀ z ∈ S, 0 < z) : (∑ z ∈ S, (ψ ((z : ℝ) / Z) : ℂ) * f z) = (Z : ℂ) * ∑ z ∈ S, ((((z : ℝ) / Z) * ψ ((z : ℝ) / Z) / (z : ℝ) : ℝ) : ℂ) * f z := by rw [mul_sum] apply sum_congr rfl intro z hz have hz0 : (z : ℝ) ≠ 0 := by exact_mod_cast (hS z hz).ne' have hid : Z * (((z : ℝ) / Z) * ψ ((z : ℝ) / Z) / (z : ℝ)) = ψ ((z : ℝ) / Z) := by field_simp rw [← mul_assoc, ← Complex.ofReal_mul, hid] end Bounty end section /- Original sharp candidate sums reduce to actual truncated Mellin and allocation integrals. -/ open Finset Filter MeasureTheory Real namespace Bounty end Bounty end section /- The clean part of the literal full coefficient row is exactly the gated clean row. The initial mask tests new births only; the residual phase uses the actual physical source and target labels for every event. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} noncomputable def physicalMixedFullResidualPhase (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (sourceGate targetGate : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent C k a s) : ℂ := let source := physicalMixedRepeatedLabels C s.2 let targetState := physicalMixedCoefficientTarget C k a s e let target := physicalMixedRepeatedLabels C targetState.2 let d := physicalSharedPrefix s.1.2 let cp := (productActiveMemorySplit (fun g => physicalFullSharedIndices (ell := ell) (C g)) B s.2).1 if repeatedBigAuxAvoids C a source ∧ repeatedBigAuxAvoids C a target then (starRingEnd ℂ) (sourceGate s) * physicalPhase ζ (physicalMixedSharedD C d cp a) * physicalReturnPhase θ (physicalMixedBigStep C k cp a * (physicalSharedProduct d : ℕ)) * targetGate targetState else 0 theorem physical_mixed_clean_coefficient_action_eq_gated (initial : ∀ g, Finset (P g)) (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ θ ρ : ℝ) (k : ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (Vs : S → ℝ) (q : ℝ) (sourceGate targetGate f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) : physicalMixedCoefficientAction C k V b ρ Vs q initial (fun a y e => if ∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅ then K (physicalMixedRepeatedLabels C y.2) (physicalMixedRepeatedLabels C (physicalMixedCoefficientTarget C k a y e).2) a * physicalMixedFullResidualPhase C ζ θ k sourceGate targetGate a y e else 0) f s = physicalMixedGatedCleanAction initial V b C ζ θ ρ k K Vs q sourceGate targetGate f s := by unfold physicalMixedCoefficientAction physicalMixedGatedCleanAction apply sum_congr rfl intro a _ congr 1 apply congrArg (fun phase => physicalSmallBigFullPhasedAction (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c => physicalMixedEdgeDelta C k d c a) (fun d c => physicalMixedEdgeD C d c a) (fun g => tiltedPhysicalBirthLaw V g (b g)) ρ V (fun c => physicalMixedBigStep C k c a) Vs q phase f s) funext y e unfold physicalSmallBigEndpointPhase physicalSmallBigCleanInitialPhase dsimp only rw [physical_mixed_clean_prefix_phase_eq_labels] unfold physicalMixedFullResidualPhase physicalMixedCoefficientTarget physicalSmallBigTarget dsimp only by_cases hi : ∀ g i, (e.2.2 g).2.2.2 i ∉ initial g · by_cases hc : ∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅ · rw [if_pos hi, if_pos hc, if_pos (And.intro hc hi)] split_ifs <;> ring · rw [if_pos hi, if_neg hc, if_neg (fun h => hc h.1)] simp only [mul_zero, zero_mul] · rw [if_neg hi, if_neg (fun h => hi h.2)] simp only [mul_zero, zero_mul] end end Bounty end section /- Exact complementary event masks for the actual mixed coefficient and signed prime family; the fixed initial exclusion remains inside the row. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} noncomputable def physicalMixedCleanPhase (C : G → Finset (Fin J)) (k : ℤ) (Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent C k a s) : ℂ := if ∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅ then Ψ a s e else 0 theorem physical_mixed_coefficient_clean_dirty (C : G → Finset (Fin J)) (k : ℤ) (V : G → ℝ) (b : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (initial : ∀ g, Finset (P g)) (Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : physicalMixedCoefficientAction C k V b ρ Vs q initial Ψ f = physicalMixedCoefficientAction C k V b ρ Vs q initial (physicalMixedCleanPhase C k Ψ) f + physicalMixedCoefficientAction C k V b ρ Vs q initial (physicalMixedDirtyPhase C k Ψ) f := by funext s simp only [physicalMixedCoefficientAction, physicalSmallBigFullPhasedAction, physicalSmallBigPhasedAction, Pi.add_apply, mul_sum, ← sum_add_distrib] apply sum_congr rfl intro a _ apply sum_congr rfl intro e _ unfold physicalMixedCleanPhase physicalMixedDirtyPhase split_ifs <;> ring theorem physical_mixed_prime_family_clean_dirty (V : G → ℝ) (b : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (k : ℤ) (initial : ∀ g, Finset (P g)) (φ : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent (repeatedBigPrimePatternCut probes r t i) k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : physicalMixedPrimePatternAction V b ρ Vs q probes r t hrt Q h ξ k initial φ f = physicalMixedPrimePatternAction V b ρ Vs q probes r t hrt Q h ξ k initial (fun i => physicalMixedCleanPhase (repeatedBigPrimePatternCut probes r t i) k (φ i)) f + physicalMixedPrimePatternAction V b ρ Vs q probes r t hrt Q h ξ k initial (fun i => physicalMixedDirtyPhase (repeatedBigPrimePatternCut probes r t i) k (φ i)) f := by unfold physicalMixedPrimePatternAction rw [← sum_add_distrib] apply sum_congr rfl intro i _ refine (physical_mixed_coefficient_clean_dirty (repeatedBigPrimePatternCut probes r t i) k V b ρ Vs q initial _ f).trans ?_ apply congrArg₂ (fun x y : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ => x + y) all_goals apply congrArg (fun Ψ => physicalMixedCoefficientAction (repeatedBigPrimePatternCut probes r t i) k V b ρ Vs q initial Ψ f) funext a y e · unfold physicalMixedCleanPhase split_ifs <;> simp_all · unfold physicalMixedDirtyPhase split_ifs <;> simp_all theorem physical_small_big_joint_average_add [DecidableEq S] (f g : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : physicalSmallBigJointAverage (f + g) = physicalSmallBigJointAverage f + physicalSmallBigJointAverage g := by funext s simp only [physical_small_big_joint_average_eq_sum, Pi.add_apply, mul_add, sum_add_distrib] end end Bounty end section /- The actual candidate dirty row in the same two-sided joint projection as the signed prime family. No auxiliary or local norm premise remains. -/ open Finset Filter open scoped Classical Topology namespace Bounty end Bounty end section /- Finite triangle and scalar normalization for the actual signed dirty prime family. The candidate theorem discharges the single-row hypothesis. -/ open Finset open scoped Classical namespace Bounty theorem physical_mixed_prime_dirty_norm_of_rows {S G : Type} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] [∀ g (p : P g), NeZero p.val] {J ell B m : ℕ} (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (hp : ∀ g, (probes g).card ≤ m) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (k : ℤ) (initial : ∀ g, Finset (P g)) (φ : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent (repeatedBigPrimePatternCut probes r t i) k a s → ℂ) (hφ : ∀ i a s e, ‖φ i a s e‖ ≤ 1) (w : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℝ) (hw : ∀ s, 0 ≤ w s) (cost : ℝ) (hcost : 0 ≤ cost) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (hrow : ∀ (C : G → Finset (Fin J)), (∀ g, (C g).card ≤ m) → ∀ Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ, (∀ a s e, ‖Ψ a s e‖ ≤ 1) → cleanActiveNorm w (physicalSmallBigJointAverage (physicalMixedCoefficientAction C k V baseline ρ Vs q initial (physicalMixedDirtyPhase C k Ψ) (physicalSmallBigJointAverage f))) ≤ cost * cleanActiveNorm w f) : cleanActiveNorm w (physicalSmallBigJointAverage (physicalMixedPrimePatternAction V baseline ρ Vs q probes r t hrt Q h ξ k initial (fun i => physicalMixedDirtyPhase (repeatedBigPrimePatternCut probes r t i) k (φ i)) (physicalSmallBigJointAverage f))) ≤ repeatedBigFamilyEnvelope (Fintype.card G) m Q ξ * cost * cleanActiveNorm w f := by let C := repeatedBigPrimePatternCut (ell := ell) probes r t let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ let K := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept let b := repeatedBigPrimePatternBound (ell := ell) probes r t Q ξ let Ψ := fun i a s (e : PhysicalMixedCoefficientEvent (B := B) (C i) k a s) => repeatedBigPrimePatternWeight probes r t i * K i (physicalMixedRepeatedLabels (C i) s.2) (physicalMixedRepeatedLabels (C i) (physicalMixedCoefficientTarget (C i) k a s e).2) a * φ i a s e have hb : ∀ i, 0 ≤ b i := repeated_big_prime_pattern_bound_nonneg probes r t Q ξ have hΨ : ∀ i a s e, ‖Ψ i a s e‖ ≤ b i := by intro i a s e dsimp only [Ψ] rw [norm_mul, norm_mul, repeated_big_prime_pattern_weight_norm, one_mul] exact (mul_le_mul_of_nonneg_right (repeated_big_prime_pattern_kernel_norm_le P V probes r t hrt Q h ξ hξ i _ _ a) (norm_nonneg _)).trans ((mul_le_mul_of_nonneg_left (hφ i a s e) (hb i)).trans_eq (mul_one _)) have hsum : ∑ i, b i ≤ repeatedBigFamilyEnvelope (Fintype.card G) m Q ξ := by apply (repeated_big_prime_pattern_bound_sum_le (ell := ell) probes r t hp Q ξ).trans apply add_le_add le_rfl apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) apply pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 2) apply Nat.mul_le_mul_left rw [← card_union_of_disjoint hrt] exact card_le_univ _ let u := fun i => physicalSmallBigJointAverage (physicalMixedCoefficientAction (C i) k V baseline ρ Vs q initial (physicalMixedDirtyPhase (C i) k (Ψ i)) (physicalSmallBigJointAverage f)) have hu (i) : cleanActiveNorm w (u i) ≤ b i * cost * cleanActiveNorm w f := by let ψ := fun a s e => Ψ i a s e / (b i : ℂ) have hψ : ∀ a s e, ‖ψ a s e‖ ≤ 1 := fun a s e => norm_div_real_bound_le_one (hb i) (hΨ i a s e) have hh := hrow (C i) (fun g => repeated_big_prime_pattern_cut_card_le probes r t hp i g) ψ hψ have hpdiv : (fun a s e => physicalMixedDirtyPhase (C i) k (Ψ i) a s e / (b i : ℂ)) = physicalMixedDirtyPhase (C i) k ψ := by funext a s e unfold physicalMixedDirtyPhase split_ifs <;> simp only [ψ, zero_div] have he := physical_mixed_coefficient_phase_normalize (C i) k V baseline ρ Vs q initial (physicalMixedDirtyPhase (C i) k (Ψ i)) (physicalSmallBigJointAverage f) (b i) (physical_mixed_dirty_phase_norm_le (C i) k (Ψ i) (hb i) (hΨ i)) rw [hpdiv] at he have heq : u i = (b i : ℂ) • physicalSmallBigJointAverage (physicalMixedCoefficientAction (C i) k V baseline ρ Vs q initial (physicalMixedDirtyPhase (C i) k ψ) (physicalSmallBigJointAverage f)) := by dsimp only [u] rw [he, physical_small_big_joint_average_smul] rw [heq, clean_active_norm_smul _ hw] rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hb i)] convert mul_le_mul_of_nonneg_left hh (hb i) using 1 <;> first | ring | rfl have heq : physicalSmallBigJointAverage (physicalMixedPrimePatternAction V baseline ρ Vs q probes r t hrt Q h ξ k initial (fun i => physicalMixedDirtyPhase (C i) k (φ i)) (physicalSmallBigJointAverage f)) = ∑ i, u i := by rw [physicalMixedPrimePatternAction, physical_small_big_joint_average_sum] apply sum_congr rfl intro i _ congr 2 funext a s e unfold physicalMixedDirtyPhase split_ifs <;> first | rfl | simp only [mul_zero] calc _ = cleanActiveNorm w (∑ i, u i) := by congr 1 _ ≤ ∑ i, cleanActiveNorm w (u i) := clean_active_norm_sum_le _ hw univ u _ ≤ ∑ i, b i * cost * cleanActiveNorm w f := sum_le_sum fun i _ => hu i _ = (∑ i, b i) * cost * cleanActiveNorm w f := by rw [sum_mul, sum_mul] _ ≤ _ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hsum hcost) (Real.sqrt_nonneg _) end Bounty end section /- Original sharp candidate sums reduce to actual truncated Mellin and allocation integrals. -/ open Finset Filter MeasureTheory Real namespace Bounty theorem exists_candidate_original_finite_mixed_mellin_reduction {c b q : ℝ} (hc : 0 < c) (hb : 0 < b) (hq0 : 0 ≤ q) (hq1 : q < 1) (R : ℝ) (hR : 1 ≤ R) {r : ℕ} (hr : 6 ≤ r) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ A D : ℝ, ∃ B : ℝ, 1 ≤ B ∧ ∃ K : ℝ, 0 < K ∧ ∀ᶠ L : ℝ in atTop, ∀ (E : ℝ) (S : Finset ℕ) (F : ℕ → ℕ → ℂ), (∀ u ∈ S, 0 < u ∧ (u : ℝ) ≤ R*exp L) → arithmeticProductWindow 1 (exp L) ⊆ S → 1 ≤ E → log E ≤ (1-b)*L → (∀ u, ∀ m ∈ (2*u+1).divisors, ‖F u m‖ ≤ L^A) → (∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ¬(∀ p ∈ m.primeFactors, exp (sqrt L) ≤ (p : ℝ)) → F u m = 0) → Integrable (candidateFiniteMixedMellinIntegrand c L q r jStar E B R S F) ∧ ‖(∑ u ∈ arithmeticProductWindow 1 (exp L), (candidateCoefficient c L q r jStar u : ℂ)*∑ m ∈ (2*u+1).divisors, F u m) - (∫ ν in {ν : ℝ | ‖ν‖ ≤ L^K}, candidateFiniteMixedMellinIntegrand c L q r jStar E B R S F ν)‖ ≤ exp L*L^(-D) := by obtain ⟨J,hJ⟩ := exists_candidate_original_finite_mellin_reduction hc hb hq0 hq1 R hR hr refine ⟨J,fun jStar hj A D => ?_⟩ obtain ⟨B,hB,K,hK,hbound⟩ := hJ jStar hj A D refine ⟨B,hB,K,hK,?_⟩ filter_upwards [hbound, eventually_candidate_finite_mixed_mellin_eq hc] with L hL heq intro E S F hS hSW hE hlogE hF hsupp have h := hL E S F hS hSW hE hlogE hF hsupp have he : candidateFiniteMellinIntegrand c L q r jStar E B S F = candidateFiniteMixedMellinIntegrand c L q r jStar E B R S F := funext (heq q r jStar E B R S F hS) rwa [he] at h end Bounty end section /- The actual normalized retained allocation integrand is a Type II sum on explicit finite supports. -/ open Finset namespace Bounty noncomputable def candidateB0TakenSupport (c L : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (X : ℝ) : Finset ℕ := (orderedSlotProductSupport (fun slot : CandidateTakenSlot c L r take => candidateQSlotChoices c L r jStar slot.val)).filter (fun e : ℕ => X/L^88 ≤ (e : ℝ) ∧ (e : ℝ) ≤ X) noncomputable def candidateB0TakenCoefficient (c L : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (ν : ℝ) (e : ℕ) : ℂ := candidateTakenComplexCoefficient c L r jStar take twist e*typeIIMellinPhase ν e noncomputable def candidateB0RetainedCoefficient (c L q : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (ν : ℝ) (h : ℕ) : ℂ := candidateRetainedComplexCoefficient c L q r jStar take twist h*typeIIMellinPhase ν h theorem candidate_taken_product_support_pos (c L : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) {e : ℕ} (he : e ∈ orderedSlotProductSupport (fun slot : CandidateTakenSlot c L r take => candidateQSlotChoices c L r jStar slot.val)) : 0 < e := by classical obtain ⟨x,hx,rfl⟩ := mem_image.mp he apply Nat.pos_of_ne_zero exact prod_ne_zero_iff.mpr (fun slot _ => candidate_Q_slot_nonzero c L r jStar slot.val (x slot).property) theorem candidate_retained_allocation_support_pos (c L : ℝ) (r jStar : ℕ) (P : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hP : ∀ p ∈ P, 0 < p) {h : ℕ} (hh : h ∈ candidateRetainedAllocationSupport c L r jStar P take) : 0 < h := by classical obtain ⟨⟨p,n⟩,hpn,rfl⟩ := mem_image.mp hh obtain ⟨hp,hn⟩ := mem_product.mp hpn apply Nat.mul_pos (hP p hp) obtain ⟨x,hx,rfl⟩ := mem_image.mp hn apply Nat.pos_of_ne_zero exact prod_ne_zero_iff.mpr (fun slot _ => candidate_Q_slot_nonzero c L r jStar slot.val (x slot).property) theorem candidate_B0_coefficient_norms (c L q : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (ν : ℝ) {n : ℕ} (hn : 0 < n) : ‖candidateB0TakenCoefficient c L r jStar take twist ν n‖ = ‖candidateTakenComplexCoefficient c L r jStar take twist n‖ ∧ ‖candidateB0RetainedCoefficient c L q r jStar take twist ν n‖ = ‖candidateRetainedComplexCoefficient c L q r jStar take twist n‖ := by simp only [candidateB0TakenCoefficient,candidateB0RetainedCoefficient,norm_mul, typeII_mellin_phase_norm ν hn,mul_one,and_self] theorem candidate_retained_box_typeII (c L q : ℝ) (r jStar : ℕ) (P M N : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (X ν R U V : ℝ) (α β : ℕ → ℂ) (hP : ∀ p ∈ P, 0 < p) (hU : 0 ≤ U) (hV : 0 ≤ V) (hM : ∀ m ∈ M, (m : ℝ) ≤ 2*U) (hN : ∀ n ∈ N, (n : ℝ) ≤ 2*V) (hR : 2*U*V ≤ R*Real.exp L) (hα : ∀ m, m ∉ M → α m = 0) (hβ : ∀ n, n ∉ N → β n = 0) : candidateRetainedAllocationIntegrand c L q r jStar (Real.log X) P take (candidateBoxFiniteTest L X (Icc 1 ⌊R*Real.exp L⌋₊) (fun u => typeIIMellinPhase ν u*∑ m ∈ (2*u+1).divisors, α m*β ((2*u+1)/m))) ξ = candidateAllocationFourierScalar c L r jStar (Real.log X) ξ * (∑ e ∈ candidateB0TakenSupport c L r jStar take X, ∑ n ∈ N, candidateB0TakenCoefficient c L r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) ν e * β n * typeIIInnerSum M (candidateRetainedAllocationSupport c L r jStar P take) α (candidateB0RetainedCoefficient c L q r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) ν) e n) * activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ := by unfold candidateRetainedAllocationIntegrand candidateB0TakenSupport candidateB0TakenCoefficient candidateB0RetainedCoefficient apply congrArg (fun z : ℂ => candidateAllocationFourierScalar c L r jStar (Real.log X) ξ * z * activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ) apply finite_mellin_divisor_typeII_compatible _ M N _ _ _ α β _ L X ν hα hβ intro e he hr n hn m hm h hh heq exact typeII_equation_coarse_bounds (candidate_taken_product_support_pos c L r jStar take he) (candidate_retained_allocation_support_pos c L r jStar P take hP hh) hU hV (hM m hm) (hN n hn) hR heq end Bounty end section /- Actual fixed-skeleton ghost stages pay exactly their original selected-child atom costs. -/ open Finset Classical namespace Bounty section Ghost variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (j : J) (htag : steps.get u = some (.inl j)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (μ : ∀ g, P g → ℝ) (q ρ v : ℝ) (V η : Fin N → ℝ) theorem full_mixed_common_ghost_all_skeletons_stage_le (hη : ∀ g, 0 ≤ η g) (hμ : ∀ g p, 0 ≤ μ g p) (hμatom : ∀ g p, μ g p ≤ η g) (hv : 0 < v) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hρ : 0 < ρ) (hD : q / ρ ^ 2 + ((1 - q) / ρ) / v ≤ 1) : let d := fullMixedCommonSelectedCount M B steps code u (∑ sk : CoupledGhostSkeleton M B s, ∑ births : CoupledGhostSamples M B s sk, if birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inl j)) htag s ((fullPermutationGhostBirthEquiv n S B A Δ D s j).symm ⟨sk, births⟩)) history) code then |coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) q ρ) (fun g => physicalGhostTermination (n g) q ρ) (fun g => physicalGhostBirth (n g) q ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B s ((coupledGhostSkeletonEquiv M B s).symm ⟨sk, births⟩)| * productLengthLyapunov v (coupledGhostJointEventTarget M B s ((coupledGhostSkeletonEquiv M B s).symm ⟨sk, births⟩)) else 0) ≤ (∏ g, ((|(1 - q) * V g / ρ| * η g) * v) ^ d g) * (∏ g, Real.exp ((|(1 - q) * V g / ρ| * ∑ p, μ g p) * v)) * productLengthLyapunov v s := by dsimp only refine le_trans (sum_le_sum fun sk _ => full_mixed_common_ghost_skeleton_stage_le n S B A Δ D steps u j htag s history code sk μ q ρ v V η hη hμ hμatom hv.le) ?_ have h := coupled_physical_ghost_marked_length_row_le n μ q ρ v V (fun g => |(1 - q) * V g / ρ| * η g) hμ (fun g => mul_nonneg (abs_nonneg _) (hη g)) hq0 hq1 hρ hv hD M B (fullMixedCommonSelectedCount M B steps code u) s refine le_trans (le_of_eq ?_) h apply sum_congr rfl intro sk _ split_ifs <;> rfl end Ghost end Bounty end section /- Actual fixed-skeleton full-edge stages pay exactly their original selected-child atom costs. -/ open Finset Classical namespace Bounty section Edge variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (k : K) (htag : steps.get u = some (.inr k)) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) [∀ c, Fintype (A k c)] (ω : ∀ c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) theorem full_mixed_common_edge_all_skeletons_stage_le (hη : ∀ g, 0 ≤ η g) (hμ : ∀ g p, 0 ≤ μ g p) (hμatom : ∀ g p, μ g p ≤ η g) (hv : 1 < v) (hω : ∀ c a, 0 ≤ ω c a) (hωmass : ∀ c, ∑ a, ω c a ≤ 1) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hvmin : 0 < vmin) (hV : ∀ g, vmin ≤ V g) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, (S k g)ᶜ.card ≤ T) : let d := fullMixedCommonSelectedCount M B steps code u (∑ sk : FullActiveEdgeSkeleton n (S k) B (A k) (Δ k) (D k) s, ∑ fresh : FullActiveEdgeSamples n (S k) B (A k) (Δ k) (D k) s sk, if birthForestStageCondition (fullMixedCommonIndexStage M B steps) u.succ (fullMixedCommonHistoryWrite n S B A Δ D steps u s (fullMixedTaggedOwnerEvent n S B A Δ D steps u (some (.inr k)) htag s ((fullPermutationEdgeBirthEquiv n S B A Δ D s k).symm ⟨sk, fresh⟩)) history) code then |fullActiveEdgeEventWeight n (S k) B (A k) (Δ k) (D k) ω μ ρ V s ((fullActiveEdgeSkeletonEquiv n (S k) B (A k) (Δ k) (D k) s).symm ⟨sk, fresh⟩)| * productLengthLyapunov v (fullActiveEdgeEventTarget n (S k) B (A k) (Δ k) (D k) s ((fullActiveEdgeSkeletonEquiv n (S k) B (A k) (Δ k) (D k) s).symm ⟨sk, fresh⟩)) else 0) ≤ (∏ g, η g ^ d g) * productLengthLyapunov v s * unrestrictedEdgeRowBound ρ v vmin T ^ N := by dsimp only refine le_trans (sum_le_sum fun sk _ => full_mixed_common_edge_skeleton_stage_le n S B A Δ D steps u k htag s history code sk ω μ ρ v V η hη hμ hμatom (zero_lt_one.trans hv).le) ?_ have h := full_active_edge_marked_length_row_le n (S k) B (A k) (Δ k) (D k) ω ρ v vmin V (fun g => ∑ p, μ g p) η hω hωmass hρ0 hρ1 hv hvmin hV (fun g => sum_nonneg fun p _ => hμ g p) hmass hη T ht (fullMixedCommonSelectedCount M B steps code u) s simp only [Fintype.card_fin] at h refine le_trans (le_of_eq ?_) h apply sum_congr rfl intro sk _ split_ifs <;> rfl end Edge end Bounty end section /- Integrate a uniform B0 bound against the actual mixed Fourier variation. -/ open Finset MeasureTheory Real namespace Bounty end Bounty end section /- Polynomial Mellin shifts are uniform in the high-frequency rough-band estimate. -/ open Finset Filter namespace Bounty end Bounty end section /- Numbering the same big groups preserves selected data and inactive-cap histories. -/ open Finset open scoped Classical namespace Bounty def physicalSelectedGroupReindex {G : Type*} {M J ell n : ℕ} (e : G ≃ Fin M) (P : G → Finset ℕ) (C : Fin n → G → Finset (Fin J)) : PhysicalGroupSelectedData P ell C ≃ PhysicalSelectedData (fun h => P (e.symm h)) ell (fun j h => C j (e.symm h)) := Equiv.prodCongr (Equiv.piCongrRight (fun j => physicalAuxGroupReindex e P J (C j))) (Equiv.prodCongr (Equiv.piCongrRight (fun _ => physicalMarkGroupReindex e P J ell)) (Equiv.prodCongr (Equiv.piCongrRight (fun _ => physicalPermutationGroupReindex e J ell)) (Equiv.piCongrRight (fun _ => physicalPermutationGroupReindex e J ell)))) def physicalPrimeReindex {G H : Type*} (e : G ≃ H) (P : G → Finset ℕ) : PhysicalPrime (fun h => P (e.symm h)) ≃ PhysicalPrime P := Equiv.sigmaCongrLeft (β := fun g => ↥(P g)) e.symm theorem ghost_phase_inactive_capped_history_reindex {I H : Type*} [Fintype I] [Fintype H] [DecidableEq I] [DecidableEq H] {R : I → Type*} [∀ i, Fintype (R i)] [∀ i, DecidableEq (R i)] (e : H ≃ I) (a : I → ℕ → Bool) (h : (i : I) → ℕ → R i) (η : I → ℕ → ℝ) (β V : I → ℝ) (B n : ℕ) (hB : Fintype.card I ≤ B) : ghostPhaseCappedHistory (fun p => a (e p)) (fun p => h (e p)) (fun p => η (e p)) (fun p => β (e p)) (fun p => V (e p)) (fun _ => B) (fun _ => B) n = ghostPhaseCappedHistory a h η β V (fun _ => B) (fun _ => B) n := by have hH : Fintype.card H ≤ B := (Fintype.card_congr e).trans_le hB rw [ghost_phase_capped_history_eq_run_product _ _ _ _ _ _ _ (fun _ => hH) (fun _ => hH), ghost_phase_capped_history_eq_run_product _ _ _ _ _ _ _ (fun _ => hB) (fun _ => hB)] exact e.prod_comp (fun p => ghostPhaseRunHistory (a p) (h p) (η p) (β p) (V p) n) end Bounty end section /- The unbalanced bin threshold is independent of logarithmic precision. -/ open Finset Filter namespace Bounty theorem exists_candidate_unbalanced_rough_bin_upper_uniform_precision (hZ : PrimitiveZeroFreeHalfPlane) {c q γ a v M : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11 / 5 : ℝ) * (r : ℝ) * c = 1) (hγ : 0 < γ) (ha : 0 < a) (hav : a ≤ v) (hvhalf : v < 1 / 2) (hvγ : v < 1 - γ) (hM : 0 ≤ M) (hdensity : ∀ α ∈ Set.Icc a v, buchstabDensity γ (1 - α) ≤ M) : ∃ J : ℕ, ∀ S : ℝ, 0 ≤ S → ∀ jStar : ℕ, J < jStar → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ (F : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ), (∀ w ∈ F, u w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 ∈ primeBand (Real.exp (a * L)) (Real.exp (v * L)) ∧ w.1 * w.2 = 2 * u w + 1) → (∑ w ∈ F, candidateCoefficient c L q r jStar (u w) * roughTestLogarithmicProxy γ L S w.2) ≤ (shiftedSieveRatioConstant * M * Real.log (v / a) + ε) * candidateCoefficientWindowMass c L q r jStar / L := by obtain ⟨J, hJ⟩ := exists_candidate_unbalanced_rough_logarithmic_proxy_upper hZ hc hr hq0 hq1 hcenter ha hav hvhalf refine ⟨J, ?_⟩ intro S hS jStar hj ε hε let R := shiftedSieveRatioConstant * Real.log (v / a) let η := ε / (2 * (|R| + 1)) have hη : 0 < η ∧ R * η ≤ ε / 2 := half_error_density_slack hε filter_upwards [hJ jStar hj (M + η) (by positivity) (ε / 2) (by positivity), eventually_cofactor_rough_test_coefficient_upper hγ ha hav hvγ (by norm_num : (0 : ℝ) < 2) (by norm_num : (0 : ℝ) < 33) hS hdensity hη.1, eventually_gt_atTop (0 : ℝ)] with L hbound hcoef hL intro F u hdata have hb := hbound γ S F u hdata (by intro w hw obtain ⟨huw, hpw, hprod⟩ := hdata w hw obtain ⟨hm, hlo, hhi⟩ := arithmetic_window_cofactor_product_bounds hL.le huw hprod exact hcoef w.1 w.2 hpw hm hlo hhi) have hX : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro n hn exact candidate_coefficient_nonneg c L hq0 r jStar n apply hb.trans apply div_le_div_of_nonneg_right _ hL.le apply mul_le_mul_of_nonneg_right _ hX dsimp [R] at hη nlinarith [hη.2] end Bounty end section /- The full original prime-kernel pair, including its three phases and all auxiliary exclusions, is approximated by the two marked endpoint averages. -/ open Finset open scoped Classical namespace Bounty theorem physical_prime_pair_comparison {G : Type*} [Fintype G] [dG : DecidableEq G] (P : G → Finset ℕ) {J ell : ℕ} (probes : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) {q : ℝ} (hq0 : 0 < q) (hq1 : q ≤ 1) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) : let C := repeatedBigPrimePatternCut probes r t i let W0 := markedDivisorWeight univ P q V (fun g => ell + (C g).card) (w : ℤ) let W1 := markedDivisorWeight univ P q V (fun g => ell + (C g).card) (z : ℤ) let H := repeatedBigPrimePatternBound probes r t Q ξ i ‖physicalFullPairCorrelation P C V q w z (physicalOriginalPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z) - (W0 : ℂ) * (W1 : ℂ) * groupMarkedAverage P (fun g => ell + (C g).card) (w : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) (z : ℤ) (physicalUnsharedPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z u))‖ ≤ (W0 * W1) * ((∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin)) * (H + H / q ^ (2 * ∑ g : G, (J - (C g).card)))) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) dsimp only apply physical_whole_pair_comparison P _ hprime hdis V hV hMass hq0 hq1 aux hw hz hPmin hp _ _ (repeated_big_prime_pattern_bound_nonneg probes r t Q ξ i) · intro L R _ exact physical_original_prime_pair_coefficient_norm_le P V probes r t hrt Q h ξ i aux a b w z hξ L R · intro u v exact physical_unshared_prime_pair_coefficient_norm_le P V probes r t hrt Q h ξ i aux a b w z hξ u.val v.val · intro L R hLR hgood exact physical_prime_pair_coefficient_eq_of_good_shared P V probes r t hrt Q h ξ i aux a b w z hprime hw hz L R hLR hgood end Bounty end section /- The exact pair formula on a prescribed finite support, with proved cutoff coverage. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Removing unshared auxiliary bans on the two absolute-value divisor fibers of the actual signed shift. -/ open Finset open scoped Classical namespace Bounty theorem physical_no_free_divisor_natAbs {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (n : ℤ) (hn : ∀ p ∈ physicalFreePrimeSet C aux, ¬ (p : ℤ) ∣ n) : ∀ p ∈ physicalFreePrimeSet C aux, ¬ (p : ℤ) ∣ (n.natAbs : ℤ) := by intro p hp simpa only [Int.natCast_dvd, Int.natAbs_natCast] using hn p hp theorem physical_marked_pair_aux_restriction_eq_signed {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (n k : ℤ) (hn : ∀ p ∈ physicalFreePrimeSet C aux, ¬ (p : ℤ) ∣ n) (b : GroupMarkedLists P (fun g => ell + (C g).card) → GroupMarkedLists P (fun g => ell + (C g).card) → ℂ) : groupMarkedAverage P (fun g => ell + (C g).card) (n.natAbs : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) ((n + k * (physicalFreeFactor C aux : ℕ)).natAbs : ℤ) (fun v => if physicalUnsharedAuxAvoids C aux u ∧ physicalUnsharedAuxAvoids C aux v then b u v else 0)) = groupMarkedAverage P (fun g => ell + (C g).card) (n.natAbs : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) ((n + k * (physicalFreeFactor C aux : ℕ)).natAbs : ℤ) (b u)) := by have hw := physical_no_free_divisor_natAbs C aux n hn have hz := physical_no_free_divisor_natAbs C aux _ (physical_no_free_divisor_shift C aux n k hn) unfold groupMarkedAverage congr 1 apply sum_congr rfl intro u _ dsimp only congr 1 apply sum_congr rfl intro v _ exact if_pos ⟨physical_unshared_aux_avoids_of_no_free_divisor C aux _ hw u, physical_unshared_aux_avoids_of_no_free_divisor C aux _ hz v⟩ end Bounty end section /- The actual unshared prime coefficient after deleting only its two auxiliary exclusion indicators. All kernel and phase factors are retained. -/ open Finset open scoped Classical namespace Bounty section Coefficient variable {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) (w z : ℕ) noncomputable def physicalFreePrimePairCoefficient (u v : GroupMarkedLists P (fun g => ell + (repeatedBigPrimePatternCut probes r t i g).card)) : ℂ := let cut := repeatedBigPrimePatternCut probes r t i let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ (repeatedBigPrimePatternWeight probes r t i * physicalUnsharedPrimePatternKernel P V probes r t hrt Q h kept i u v aux) * physicalPhase a w * physicalPhase b z * physicalPhase (-(a+b)) (physicalFreeFactor cut aux) theorem physical_free_prime_pair_coefficient_norm_le (hξ : 0 < ξ) (u v : GroupMarkedLists P (fun g => ell + (repeatedBigPrimePatternCut probes r t i g).card)) : ‖physicalFreePrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z u v‖ ≤ repeatedBigPrimePatternBound probes r t Q ξ i := by exact physical_unshared_prime_three_phase_norm_le P V probes r t hrt Q h ξ hξ i u v aux a b (-(a+b)) w z _ end Coefficient end Bounty end section /- Uniform decay of the reciprocal mass of the actual free-prime set, including group families which vary with the scale. -/ open Finset Filter open scoped Classical namespace Bounty theorem physical_free_prime_set_card_le_total {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) : (physicalFreePrimeSet C aux).card ≤ J * Fintype.card G := by apply (physical_free_prime_set_card C aux).trans calc _ ≤ ∑ _g : G, J := sum_le_sum (fun g _ => (card_le_card (subset_univ (C g))).trans_eq (by simp)) _ = _ := by simp [Nat.mul_comm] theorem physical_free_reciprocal_bound {G : Type*} [Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) {Pmin : ℝ} (hPmin : 0 < Pmin) (hP : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) : (∑ p ∈ physicalFreePrimeSet C aux, 1/(p : ℝ)) ≤ (J * Fintype.card G : ℕ) / Pmin := by apply (finite_reciprocal_sum_le_card_div _ hPmin (fun _ hp => physical_free_prime_set_lower C aux hP hp)).trans exact div_le_div_of_nonneg_right (Nat.cast_le.mpr (physical_free_prime_set_card_le_total C aux)) hPmin.le theorem eventually_physical_free_error_decay {c A : ℝ} (hc : 0 < c) (hA : 0 ≤ A) (E D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type) [Fintype G] (J : ℕ) (P : G → Finset ℕ) (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (H : ℝ), (J * Fintype.card G : ℕ) ≤ A * Real.log L → 0 ≤ H → H ≤ L^E → (∀ g (p : P g), Real.exp (L^c) ≤ (p.val : ℝ)) → H * (∑ p ∈ physicalFreePrimeSet C aux, 1/(p : ℝ)) ≤ L^(-D) := by filter_upwards [eventually_polynomial_div_exp_power hc A (E+1) D, eventually_gt_atTop (0 : ℝ)] with L hdec hL intro G _ J P C aux H hcount hH hHL hP have hlog : Real.log L ≤ L := (Real.log_le_sub_one_of_pos hL).trans (by linarith) have hn : (0 : ℝ) ≤ (J * Fintype.card G : ℕ) := Nat.cast_nonneg _ calc _ ≤ H * ((J * Fintype.card G : ℕ) / Real.exp (L^c)) := mul_le_mul_of_nonneg_left (physical_free_reciprocal_bound C aux (Real.exp_pos _) hP) hH _ ≤ L^E * (A * L / Real.exp (L^c)) := by apply mul_le_mul hHL (div_le_div_of_nonneg_right (hcount.trans (mul_le_mul_of_nonneg_left hlog hA)) (Real.exp_pos _).le) (div_nonneg hn (Real.exp_pos _).le) (Real.rpow_nonneg hL.le _) _ = A * L^(E+1) / Real.exp (L^c) := by rw [Real.rpow_add hL, Real.rpow_one]; ring _ ≤ _ := hdec theorem eventually_candidate_free_error_decay {c : ℝ} (hc : 0 < c) (J : ℕ) (E D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (C : S → Finset (Fin J)) (aux : PhysicalAuxLabels (fun g : S => candidatePBand (c*L) g.val) C) (H : ℝ), 0 ≤ H → H ≤ L^E → H * (∑ p ∈ physicalFreePrimeSet C aux, 1/(p : ℝ)) ≤ L^(-D) := by obtain ⟨v, A, _, hA, hinputs⟩ := exists_candidate_shared_error_inputs hc J filter_upwards [hinputs, eventually_physical_free_error_decay (c := (1/10 : ℝ)) (by norm_num) hA E D] with L hinputs hdec intro S hS C aux H hH hHL obtain ⟨hcount, hdata⟩ := hinputs S hS exact hdec S J _ C aux H (by simpa only [Fintype.card_coe] using hcount) hH hHL (fun g p => ((hdata g).2 p.val p.property).2) end Bounty end section /- The original retained prime pattern has a bounded separated kernel on the two unshared endpoint fibers. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- The original retained prime pattern has a bounded separated kernel on the selected groups of the two unshared endpoint fibers. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Radius-generalized companion; only the separate R <= exp L assumption is removed. The literal four-factor integral: representations, energies, and global bounds are proved. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_literal_four_factor_integral_decay_log_radius {a beta c d Bcoeff A As H E Et aLong : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hd : 0 < d) (hBcoeff : 1 ≤ Bcoeff) (hAs0 : 0 ≤ As) (haLong : 0 < aLong) (hAs : A+2*E+21 ≤ 2*As) (hH : A+2*E+23 ≤ 2*H) (Tmod Sshift : ℝ) : ∃ B0 : ℝ, 0 < B0 ∧ ∀ Bsave : ℝ, A+B0+2*Et+7 ≤ 2*Bsave → ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R : ℝ), 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ c*L → Real.exp (L^a)/2 ≤ P → P ≤ Real.exp (L^beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → (∀ p : s, ‖coeff p‖ ≤ Bcoeff) → ∀ (D F : Finset ℕ) (α γ : ℕ → ℂ) (UM UT BM BT : ℝ), 0 < UM → 1 ≤ UT → 0 ≤ BM → 0 ≤ BT → BM*BT ≤ L^E → BT ≤ L^Et → (∀ n ∈ D, ‖α n‖ ≤ BM) → (∀ n ∈ F, ‖γ n‖ ≤ BT) → (∀ n ∈ D, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (UQ Alo Blo σ : ℝ) (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (q : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ c*L → (∀ u ∈ Set.Icc (-R) R, |u| ≤ L^B0 → ‖∑ n ∈ D, α n*harmonicMellinWeight u n‖ ≤ L^(-Bsave)) → (∫ u in Set.Icc (-R) R, ‖primeReciprocalPolynomial s coeff u * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u+σ) n*χ (n : ZMod q))* (∑ n ∈ D, α n*harmonicMellinWeight u n)* (∑ n ∈ F, γ n*harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨B0,hB0,hmain⟩ := exists_long_rough_four_factor_integral_decay_log_radius (a := a) (beta := beta) (c := c) (d := d) (Bcoeff := Bcoeff) (A := A) (As := As) (H := H) (Cmean := 2*E+16) (Cres := 2*E+16) (kmean := 1) (kres := 1) (q := 1) (t := Et+1) (aLong := aLong) ha ha1 hbeta hc hd hBcoeff hAs0 haLong (by linarith) (by linarith) Tmod Sshift refine ⟨B0,hB0,?_⟩ intro Bsave hsave filter_upwards [hmain Bsave (by linarith), eventually_finite_pair_five_dyad_data (E := E) hc, eventually_finite_triple_five_dyad_data (E := E) hc, eventually_ge_atTop (5 : ℝ)] with L hdecay hpair htriple hL intro s hs coeff Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp hcoeff D F α γ UM UT BM BT hUM hUT hBM hBT hprod hBTpow hα hγ hD hF UQ Alo Blo σ q hqInst χ hUQ hQA hAB hBQ hq hσ hmeanScale hresScale hlog hlow have hLpos : 0 < L := by linarith have hUQ1 : 1 ≤ UQ := (Real.one_le_exp (mul_nonneg haLong.le hLpos.le)).trans hUQ have hUQpos : 0 < UQ := zero_lt_one.trans_le hUQ1 have hUTpos : 0 < UT := zero_lt_one.trans_le hUT have hpair1 : 1 ≤ UM*UT/2 := (Real.one_le_rpow hY (by norm_num : (0 : ℝ) ≤ 3/5)).trans hresScale have hpairs : UM*UT ≤ UQ*UM*UT := by nlinarith [mul_pos hUM hUTpos] have htriple1 : 1 ≤ UQ*UM*UT/2 := by linarith have hpairlog : Real.log (8*(UM*UT)) ≤ c*L := (Real.log_le_log (by positivity) (by linarith : 8*(UM*UT) ≤ 8*(UQ*UM*UT))).trans hlog let Qs := roughBand Alo Blo (Real.exp (Real.sqrt L)) let δ : ℕ → ℂ := fun n => χ (n : ZMod q)*(n : ℂ)^((σ : ℂ)*Complex.I) have hQs : ∀ n ∈ Qs, UQ ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UQ := by intro n hn have hm := mem_Ioc.mp (mem_filter.mp hn).1 exact ⟨hQA.trans ((Nat.floor_lt (hUQpos.le.trans hQA)).mp hm.1).le, ((Nat.le_floor_iff (hUQpos.le.trans (hQA.trans hAB))).mp hm.2).trans hBQ⟩ have hδ : ∀ n ∈ Qs, ‖δ n‖ ≤ 1 := by intro n hn have hnpos : 0 < (n : ℝ) := hUQpos.trans_le (hQs n hn).1 have hphase : ‖(n : ℂ)^((σ : ℂ)*Complex.I)‖ = 1 := by rw [show (n : ℂ) = ((n : ℝ) : ℂ) by simp, Complex.norm_cpow_eq_rpow_re_of_pos hnpos] simp dsimp [δ] rw [norm_mul,hphase,mul_one] exact χ.norm_le_one _ have hQrep : ∀ u : ℝ, (∑ n ∈ Qs, harmonicMellinWeight (u+σ) n*χ (n : ZMod q)) = ∑ n ∈ Qs, δ n*harmonicMellinWeight u n := by intro u apply sum_congr rfl intro n hn rw [← harmonic_mellin_weight_cpow_shift u σ (hUQpos.trans_le (hQs n hn).1)] dsimp [δ] ring obtain ⟨lom,him,wm,Vm,hmdata,hmrep⟩ := htriple Qs D F δ α γ UQ UM UT 1 BM BT hUQpos hUM hUTpos zero_le_one hBM hBT (by simpa only [one_mul] using hprod) hδ hα hγ hQs hD hF htriple1 hlog obtain ⟨lor,hir,wr,Vr,hrdata,hrrep⟩ := hpair D F α γ UM UT BM BT hUM hUTpos hBM hBT hprod hα hγ hD hF hpair1 hpairlog have hTbound : ∀ u : ℝ, ‖∑ n ∈ F, γ n*harmonicMellinWeight u n‖ ≤ L^(Et+1) := by intro u have hh := finite_dyadic_mellin_bounded_norm F γ u UT BT hUT hBT hF hγ simp only [mul_comm (harmonicMellinWeight u _) (γ _)] at hh calc _ ≤ 2*BT := hh _ ≤ L*L^Et := mul_le_mul (by linarith) hBTpow hBT hLpos.le _ = _ := by rw [Real.rpow_add hLpos,Real.rpow_one]; ring apply hdecay s hs coeff Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp hcoeff (fun u => ∑ n ∈ Qs, harmonicMellinWeight (u+σ) n*χ (n : ZMod q)) (fun u => ∑ n ∈ D, α n*harmonicMellinWeight u n) (fun u => ∑ n ∈ F, γ n*harmonicMellinWeight u n) (by unfold harmonicMellinWeight; fun_prop) (by unfold harmonicMellinWeight; fun_prop) UQ Alo Blo σ q χ hUQ hQA hAB hBQ hq hσ (fun _ => rfl) (fun u _ => by simpa only [Real.rpow_one] using (roughBand_mellin_global_norm UQ Alo Blo (Real.exp (Real.sqrt L)) (u+σ) hUQ1 hQA hAB hBQ q χ).trans (by linarith : 2 ≤ L)) (fun u _ => hTbound u) hlow 5 5 lom him lor hir wm wr Vm Vr (by simpa only [Nat.cast_ofNat, Real.rpow_one] using hL) (by simpa only [Nat.cast_ofNat, Real.rpow_one] using hL) · intro j exact ⟨(hmdata j).2.1,hmeanScale.trans (hmdata j).1,(hmdata j).2.2⟩ · intro j exact ⟨hresScale.trans (hrdata j).1,(hrdata j).2.2.2⟩ · intro u rw [hQrep] exact hmrep u · exact hrrep end Bounty end section /- A finite union of prescribed physical paths is one bounded recorded-history phase. -/ open Finset namespace Bounty section Energy variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) end Energy end Bounty end section /- Finite path sums reindex exactly by the actual pattern indices and selected data. -/ open Finset namespace Bounty noncomputable abbrev physicalLabeledPathFintype {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) : Fintype (Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) := by classical letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance letI : Fintype (PhysicalMarkLists P J ell) := inferInstance exact inferInstance noncomputable abbrev physicalSelectedDataFintype {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) : Fintype (PhysicalSelectedData P ell C) := by classical letI : Fintype (PhysicalMarkLists P J ell) := inferInstance letI : Fintype (PhysicalPermutations (Fin N) J ell) := inferInstance letI : ∀ j, Fintype (PhysicalAuxLabels P (C j)) := fun _ => inferInstance exact inferInstance section Packing variable {I R : Type*} [AddCommMonoid R] {N J ell n : ℕ} {P : Fin N → Finset ℕ} (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) end Packing end Bounty end section /- The original finite offset and residue constraints in selected-path coordinates. -/ open Finset open scoped Classical namespace Bounty section Coherence variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} {patterns : Finset I} (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) noncomputable def physicalPathSelectedOffset : Fin (n + 2) → ℤ := fun j => physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j.val def physicalPathSelectedMultiplier (j : Fin (n + 1)) : ℤ := k (n - j.val) (p j).1.2.2.1.val theorem physical_path_selected_offset_zero : physicalPathSelectedOffset C k L p 0 = 0 := rfl theorem physical_path_selected_offset_step (j : Fin (n + 1)) : physicalPathSelectedOffset C k L p j.succ = physicalPathSelectedOffset C k L p j.castSucc + physicalPathSelectedMultiplier C k p j * (physicalD (C ((physicalPathSelectedEquiv patterns C (L, p)).1 j).val) (physicalPermuteLabels ((physicalPathSelectedEquiv patterns C (L, p)).2.2.2.1 j) ((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc)) ((physicalPathSelectedEquiv patterns C (L, p)).2.1 j) : ℤ) := by rw [physical_path_selected_marks_eq_finite_path] simp only [physicalPathSelectedOffset, Fin.val_succ, Fin.val_castSucc] rw [physicalBareOffset] have ha : finitePathLabels p j.val = (p j).1 := by simp only [finitePathLabels, dif_pos j.isLt] rw [ha] simp only [physicalBareStep, Nat.add_sub_cancel, physicalPathSelectedMultiplier, physical_path_selected_patterns, physical_path_selected_sigma, physical_path_selected_aux] theorem physical_path_selected_marks_of_compatible (r : PhysicalResidues P) (hr : physicalFinitePathResidueCompatible C k n r L p) : ∀ j : Fin (n + 2), ∀ a ∈ physicalMarkedPrimes ((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j), r a = -(physicalPathSelectedOffset C k L p j : ZMod a.2.val) := by rw [physical_path_selected_marks_eq_finite_path] exact (physical_finite_path_residue_compatible_iff C k n r L p).mp hr end Coherence end Bounty end section /- Exact conversion of the original memory coefficient to selected chronological data. -/ open Finset namespace Bounty section Scalar variable {I : Type*} {N J ell r : ℕ} {P : Fin N → Finset ℕ} (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (pattern : Fin (r + 1) → patterns) (d : PhysicalSelectedData P ell (fun j => C (pattern j).val)) end Scalar end Bounty end section /- Observation and mark-transition conditions for a physical fine history. -/ open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) noncomputable def PhysicalFineHistoryCoherent (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) : Prop := (∀ j : Fin (n + 1), o (4 * j.val) = .inr none) ∧ (∀ j : Fin n, ∃ σ : PhysicalPermutations (Fin N) J ell, o (4 * j.val + 1) = .inl σ ∧ (t (4 * j.val + 1)).1 = physicalPermuteLabels σ (t (4 * j.val)).1) ∧ (∀ j : Fin n, ∃ a : PhysicalAuxLabels P (C j), o (4 * j.val + 2) = .inr (some ⟨j, a⟩)) ∧ (∀ j : Fin n, ∃ κ : PhysicalPermutations (Fin N) J ell, o (4 * j.val + 3) = .inl κ ∧ (t (4 * j.val + 4)).1 = physicalPermuteLabels κ (t (4 * j.val + 2)).1) theorem physical_coherent_fine_history_has_selection (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) (h : PhysicalFineHistoryCoherent C o t) : ∃! d : PhysicalSelectedData P ell C, physicalSelectedDataTest C d o t := by classical obtain ⟨h0, h1, h2, h3⟩ := h choose σ hσ hσmark using h1 choose a ha using h2 choose κ hκ hκmark using h3 let L : Fin (n + 1) → PhysicalMarkLists P J ell := fun j => (t (4 * j.val)).1 let d : PhysicalSelectedData P ell C := (a, L, σ, fun j => physicalInversePermutations (κ j)) have hd : physicalSelectedDataTest C d o t := by apply (physical_selected_data_test_iff_four C d o t).mpr refine ⟨fun j => ⟨h0 j, rfl⟩, hσ, ?_, ?_⟩ · intro j refine ⟨ha j, ?_⟩ change (t (4 * j.val + 2)).1 = physicalPermuteLabels (physicalInversePermutations (κ j)) (t (4 * (j.val + 1))).1 rw [show 4 * (j.val + 1) = 4 * j.val + 4 by omega, hκmark j] exact (physical_permute_inverse (κ j) _).symm · intro j change o (4 * j.val + 3) = .inl (physicalInversePermutations (physicalInversePermutations (κ j))) have hi : physicalInversePermutations (physicalInversePermutations (κ j)) = κ j := by funext g exact Equiv.symm_symm _ rw [hi] exact hκ j exact ⟨d, hd, fun e he => physical_selected_data_unique C o t he hd⟩ theorem physical_coherent_selected_source_marks (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) (h : PhysicalFineHistoryCoherent C o t) (d : PhysicalSelectedData P ell C) (hd : physicalSelectedDataTest C d o t) (j : Fin n) : physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc) = (t (4 * j.val + 1)).1 := by obtain ⟨h0, h1, _, _⟩ := (physical_selected_data_test_iff_four C d o t).mp hd obtain ⟨σ, ho, hm⟩ := h.2.1 j have he : σ = d.2.2.1 j := Sum.inl.inj (ho.symm.trans (h1 j)) rw [← he, ← (h0 j.castSucc).2] exact hm.symm end Fine end Bounty end section /- A uniform candidate-mass bound for each balanced dyadic rectangle. -/ open Finset Filter open scoped Topology namespace Bounty theorem exists_candidate_pair_mass_bound {c q θ Barea : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) (hθ : 0 < θ) (hBarea : 0 < Barea) (J : ℕ) (hcut : θ < 2*c/(2 : ℝ)^J) (hsize : (12/5 : ℝ)*(r : ℝ)*c/(2 : ℝ)^J ≤ 1/25) (hθsmall : 10*θ ≤ 1/20) : ∃ C : ℝ, 0 < C ∧ ∃ J0 : ℕ, J ≤ J0 ∧ ∀ D : ℝ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J0 < jStar → ∀ (a b s t : ℕ) (W : ℝ) (S : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ), a ≤ b → s ≤ t → 0 ≤ W → W ≤ Real.exp (θ*L) → (b : ℝ)-a ≤ Real.exp ((27/50 : ℝ)*L) → (t : ℝ)-s ≤ Real.exp ((27/50 : ℝ)*L) → ((b : ℝ)-a)*((t : ℝ)-s) ≤ Barea*Real.exp L → (∀ v ∈ S, v.1*v.2 = 2*u v+1) → (∀ v ∈ S, v.1 ∈ Ioc a b ∧ v.2 ∈ Ioc s t) → (∀ v ∈ S, ∀ p ∈ primeBand 0 W, ¬p ∣ v.1*v.2) → (∑ v ∈ S, candidateCoefficient c L q r jStar (u v)) ≤ C*candidateCoefficientWindowMass c L q r jStar * (∏ p ∈ primeBand 0 W, (1-1/(p : ℝ)))^2 + candidateCoefficientWindowMass c L q r jStar * L^(-D) := by obtain ⟨K, hK, hpair⟩ := exists_candidate_pair_sieve_bound obtain ⟨Cm, hCm, J0, hJJ0, hnorm⟩ := exists_candidate_micro_mass_normalization hc hr hq0 hq1 hcenter J refine ⟨K*Barea*Cm/θ, by positivity, J0, hJJ0, ?_⟩ intro D filter_upwards [hpair c q θ hc hq0 hq1.le hθ r J hcut hsize, hnorm, eventually_pair_lattice_profile_small (3*Cm) D, eventually_gt_atTop (0 : ℝ)] with L hp hm he hL intro jStar hj a b s t W S u hab hst hW hWz hx hy harea hv hrect hrough have hjJ : J ≤ jStar := hJJ0.trans (Nat.le_of_lt hj) have hXA : 0 ≤ candidateCoefficientWindowMass c L q r jStar := sum_nonneg (fun n _ => candidate_coefficient_nonneg c L hq0 r jStar n) have hVz : 0 ≤ ∏ p ∈ primeBand 0 (Real.exp (θ*L)), (1-1/(p : ℝ)) := by apply prod_nonneg intro p hpm exact (avoidance_factor_bounds ((mem_filter.mp hpm).2).two_le).1.le have hmain := pair_main_term_normalization hL hθ hK.le hBarea.le hCm.le (mul_nonneg (sub_nonneg.mpr (Nat.cast_le.mpr hab)) (sub_nonneg.mpr (Nat.cast_le.mpr hst))) hVz hXA harea (full_prime_avoidance_exp_upper (mul_pos hθ hL)) (hm jStar hj).1 (V := ∏ p ∈ primeBand 0 W, (1-1/(p : ℝ))) have herr := pair_error_term_normalization hL hCm.le (candidate_micro_Q_harmonic_nonneg c L r jStar J) hXA (pair_lattice_error_scale hL.le hθsmall hx hy) (hm jStar hj).2 he refine (hp jStar hjJ a b s t W S u hab hst hW hWz hv hrect hrough).trans ?_ convert add_le_add hmain herr using 1; ring end Bounty end section /- The actual recorded empty-memory terminal is insensitive to pending-memory order. -/ open scoped Classical namespace Bounty end Bounty end section /- Original selected normalization with no residue witness or list-admissibility premise. -/ open Finset open scoped Classical namespace Bounty section ResiduePath variable {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (aux : ∀ j, PhysicalAuxLabels P (C j)) (k : Fin n → ℤ) (L : Fin (n + 1) → PhysicalMarkLists P J ell) (a : Fin (n + 1) → ℤ) (σ τ : Fin n → PhysicalPermutations (Fin N) J ell) (hstep : ∀ j : Fin n, a j.succ = a j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ)) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin n, ∀ g s, ¬ ((L j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (B : ℕ) variable (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] include hstep hP hdis hk in theorem physical_selected_fine_normalization_unrestricted (hρ : ρ ≠ 0) : ((∏ g, ∏ s : PhysicalSlots J ell, β g (L 0 g s) / V g : ℝ) : ℂ) * finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow (B := B) C aux L σ τ k β V ρ hV ω retention) (4 * n + 1) physicalEmptyMemoryTerminal (physicalInitialMarkState B (L 0)) = (if ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ)) then (1 : ℂ) else 0) * (∏ i ∈ range (2 * n + 1), physicalSelectedCoarseScalar C aux L σ ω i) * (ghostPhaseCappedHistory (fun p : PhysicalPrime P => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity L p.1) j p.2) (fun p => physicalResidueAbsoluteHit a p.1 p.2) (fun _ j => 1 - retention (globalBirthFiniteIndex n j)) (fun p => β p.1 p.2) (fun p => V p.1) (fun _ => B) (fun _ => B) n : ℂ) := by by_cases hlist : ∀ j : Fin n, physicalListAdmissible (C j) (aux j) (physicalPermuteLabels (σ j) (L j.castSucc)) (physicalPermuteLabels (τ j) (L j.succ)) · simp only [if_pos hlist, one_mul] exact (by by_cases hc : ∀ j : Fin n, ∀ g s t, ((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val = ((physicalPermuteLabels (τ j) (L j.succ)) g t).val → (((physicalPermuteLabels (σ j) (L j.castSucc)) g s).val : ℤ) ∣ k j * (physicalD (C j) (physicalPermuteLabels (σ j) (L j.castSucc)) (aux j) : ℤ) · exact physical_selected_fine_adjacent_normalization C aux k L a σ τ hstep hc hlist hP hdis hk β V ρ hV B ω retention hρ · rw [physical_selected_fine_history_zero_of_bad C aux k L σ τ β V ρ hV ω retention hlist hP hdis hk hc physicalEmptyMemoryTerminal, physical_capped_history_zero_of_bad C aux k L a σ τ hstep hc] simp only [Complex.ofReal_zero, mul_zero] ) · rw [if_neg hlist, zero_mul, zero_mul, physical_selected_fine_history_zero_of_nonadmissible C aux k L σ τ β V ρ hV ω retention hlist physicalEmptyMemoryTerminal, mul_zero] end ResiduePath end Bounty end section /- The proved clean prime-family decay lifted to the genuine mixed measure by the original small conditioning. The only row premise is an exact pairing identity; no operation norm is assumed. Endpoint gates remain explicit. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- Explicit rank decay for the original complex forest-masked full-mixed path action. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress S B steps))) end Owner end Bounty end section /- Exact clean/dirty decomposition of the same signed physical prime family. Both endpoint projections and the fixed fresh-birth exclusion are retained. This is an identity, with no norm premise. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} theorem physical_mixed_prime_clean_action_eq_gated (V : G → ℝ) (b : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ ζ θ : ℝ) (k : ℤ) (initial : ∀ g, Finset (P g)) (sourceGate targetGate f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : let C := repeatedBigPrimePatternCut (ell := ell) probes r t let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ let K := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept physicalMixedPrimePatternAction V b ρ Vs q probes r t hrt Q h ξ k initial (fun i => physicalMixedCleanPhase (C i) k (physicalMixedFullResidualPhase (C i) ζ θ k sourceGate targetGate)) f = physicalMixedGatedCleanPatternAction initial V b C ζ θ ρ k (fun i a b c => repeatedBigPrimePatternWeight probes r t i * K i a b c) Vs q sourceGate targetGate f := by intro C kept K funext s unfold physicalMixedPrimePatternAction physicalMixedGatedCleanPatternAction simp only [Finset.sum_apply] apply sum_congr rfl intro i _ rw [← physical_mixed_clean_coefficient_action_eq_gated] congr 1 funext a y e dsimp only [C, K, kept] unfold physicalMixedCleanPhase split_ifs <;> simp_all theorem physical_mixed_prime_projected_clean_dirty [DecidableEq S] (V : G → ℝ) (b : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ ζ θ : ℝ) (k : ℤ) (initial : ∀ g, Finset (P g)) (sourceGate targetGate f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : let C := repeatedBigPrimePatternCut (ell := ell) probes r t let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ let K := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept physicalSmallBigJointAverage (physicalMixedPrimePatternAction V b ρ Vs q probes r t hrt Q h ξ k initial (fun i => physicalMixedFullResidualPhase (C i) ζ θ k sourceGate targetGate) (physicalSmallBigJointAverage f)) = physicalSmallBigJointAverage (physicalMixedGatedCleanPatternAction initial V b C ζ θ ρ k (fun i a b c => repeatedBigPrimePatternWeight probes r t i * K i a b c) Vs q sourceGate targetGate (physicalSmallBigJointAverage f)) + physicalSmallBigJointAverage (physicalMixedPrimePatternAction V b ρ Vs q probes r t hrt Q h ξ k initial (fun i => physicalMixedDirtyPhase (C i) k (physicalMixedFullResidualPhase (C i) ζ θ k sourceGate targetGate)) (physicalSmallBigJointAverage f)) := by intro C kept K rw [physical_mixed_prime_family_clean_dirty, physical_small_big_joint_average_add, physical_mixed_prime_clean_action_eq_gated] end end Bounty end section /- The actual signed prime-family dirty contribution, with both small and big endpoint projections, the original auxiliary law, and a fixed initial fresh-birth gate. The coefficient budget is proved from the prime family. -/ open Finset Filter open scoped Classical Topology namespace Bounty end Bounty end section /- The concrete residual physical phase is an active-endpoint observable. Its two Fourier factors have modulus one, and its auxiliary avoidance gate can only decrease the norm. The actual injectivity and small-tail endpoint gates preserve pending symmetry without commuting through slot averages. -/ open Finset Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} omit [DecidableEq G] in theorem physical_mixed_full_residual_phase_norm_le (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (sourceGate targetGate : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (hs : ∀ s, ‖sourceGate s‖ ≤ 1) (ht : ∀ s, ‖targetGate s‖ ≤ 1) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent C k a s) : ‖physicalMixedFullResidualPhase C ζ θ k sourceGate targetGate a s e‖ ≤ 1 := by unfold physicalMixedFullResidualPhase dsimp only split_ifs · have hc : ‖(starRingEnd ℂ) (sourceGate s)‖ ≤ 1 := by change ‖star (sourceGate s)‖ ≤ 1 simpa only [norm_star] using hs s simpa only [norm_mul, physical_phase_norm, physicalReturnPhase_norm, mul_one] using mul_le_mul hc (ht (physicalMixedCoefficientTarget C k a s e)) (norm_nonneg _) zero_le_one · simp only [norm_zero, zero_le_one] noncomputable def physicalMixedResidualObservable (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (sourceGate targetGate : PhysicalBareResidueState Ps J ell → (∀ g, Fin (J + ell) → P g) → ℂ) (a : PhysicalAuxLabels P C) (s t : PhysicalBareResidueState Ps J ell) (x y : ∀ g, Fin (J + ell) → P g) (_draw : ∀ g, EdgeDrawObservation (P g) (physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) : ℂ := let source := fun g j => x g ((physicalFullSlotIndex (C g)).symm j) let target := fun g j => y g ((physicalFullSlotIndex (C g)).symm j) let d := physicalSharedPrefix s.2 let cp := fun g => (activeTupleSplit (physicalFullSharedIndices (ell := ell) (C g)) (x g)).1 if repeatedBigAuxAvoids C a source ∧ repeatedBigAuxAvoids C a target then (starRingEnd ℂ) (sourceGate s x) * physicalPhase ζ (physicalMixedSharedD C d cp a) * physicalReturnPhase θ (physicalMixedBigStep C k cp a * (physicalSharedProduct d : ℕ)) * targetGate t y else 0 variable [∀ g (p : P g), NeZero p.val] omit [DecidableEq G] [∀ g (p : P g), NeZero p.val] in theorem physical_mixed_full_residual_eq_observable (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (sourceGate targetGate : PhysicalBareResidueState Ps J ell → (∀ g, Fin (J + ell) → P g) → ℂ) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent C k a s) : physicalMixedFullResidualPhase C ζ θ k (fun z => sourceGate z.1 (fun g => (z.2 g).1)) (fun z => targetGate z.1 (fun g => (z.2 g).1)) a s e = physicalMixedCoefficientObservablePhase C k a (physicalMixedResidualObservable C ζ θ k sourceGate targetGate a) s e := rfl omit [DecidableEq G] in theorem physical_mixed_concrete_residual_reindex (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (Fs : ∀ g, Finset (Ps g)) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalMixedCoefficientEvent C k a s) : physicalMixedFullResidualPhase C ζ θ k cleanMixedSourceGate (cleanMixedTargetGate Fs) a (s.1, productMemoryReindex s.2 τ) (physicalMixedCoefficientReindex C k a s τ e) = physicalMixedFullResidualPhase C ζ θ k cleanMixedSourceGate (cleanMixedTargetGate Fs) a s e := by let gs := fun (_ : PhysicalBareResidueState Ps J ell) (x : ∀ g, Fin (J + ell) → P g) => (if ∀ g, Function.Injective (x g) then (1 : ℂ) else 0) let gt := fun (t : PhysicalBareResidueState Ps J ell) (y : ∀ g, Fin (J + ell) → P g) => (if (∀ g, Function.Injective (y g)) ∧ (∀ g (j : Fin ell), t.2 g (Sum.inr j) ∉ Fs g) then (1 : ℂ) else 0) have hs : (cleanMixedSourceGate : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) = fun z => gs z.1 (fun g => (z.2 g).1) := by funext z simp only [cleanMixedSourceGate, CleanMixedBigActiveInjective, gs] split_ifs with h · exact if_pos h · exact if_neg h have ht : (cleanMixedTargetGate Fs : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) = fun z => gt z.1 (fun g => (z.2 g).1) := by funext z simp only [cleanMixedTargetGate, CleanMixedBigActiveInjective, gt] split_ifs with h · exact if_pos h · exact if_neg h rw [hs, ht] rw [physical_mixed_full_residual_eq_observable, physical_mixed_full_residual_eq_observable] exact physical_mixed_coefficient_observable_reindex C k a (physicalMixedResidualObservable C ζ θ k gs gt a) s τ e omit [DecidableEq G] [∀ g (p : P g), NeZero p.val] in theorem physical_mixed_concrete_residual_norm_le (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (Fs : ∀ g, Finset (Ps g)) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent C k a s) : ‖physicalMixedFullResidualPhase C ζ θ k cleanMixedSourceGate (cleanMixedTargetGate Fs) a s e‖ ≤ 1 := physical_mixed_full_residual_phase_norm_le C ζ θ k _ _ clean_mixed_source_gate_norm_le (clean_mixed_target_gate_norm_le Fs) a s e omit [DecidableEq G] [∀ g (p : P g), NeZero p.val] in theorem physical_mixed_concrete_residual_mul_norm_le (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (Fs : ∀ g, Finset (Ps g)) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent C k a s) (z : ℂ) (hz : ‖z‖ ≤ 1) : ‖physicalMixedFullResidualPhase C ζ θ k cleanMixedSourceGate (cleanMixedTargetGate Fs) a s e * z‖ ≤ 1 := by rw [norm_mul] exact (mul_le_mul (physical_mixed_concrete_residual_norm_le C ζ θ k Fs a s e) hz (norm_nonneg z) zero_le_one).trans_eq (one_mul 1) variable [DecidableEq S] end end Bounty end section /- Power truncation of a fixed character slice, with the smooth spatial weight outside. -/ open Finset MeasureTheory Filter open scoped ComplexConjugate namespace Bounty end Bounty end section /- Absolute character cross-sums retain the two exact factorization masks. -/ open Finset open scoped ComplexConjugate namespace Bounty theorem typeII_cross_character_amplitude_norm_le {d : ℕ} (χ : DirichletCharacter ℂ d) (α aH : ℕ → ℂ) (y : TypeIIShiftIndex) : ‖typeIICrossCharacterAmplitude χ α aH y‖ ≤ ‖α y.2.1.1 * aH y.2.2.2‖ * ‖α y.2.2.1 * aH y.2.1.2‖ := by unfold typeIICrossCharacterAmplitude simp only [norm_mul, Complex.norm_conj] calc _ ≤ (‖α y.2.1.1‖ * ‖α y.2.2.1‖ * ‖aH y.2.1.2‖ * ‖aH y.2.2.2‖) * 1 * 1 := mul_le_mul (mul_le_mul_of_nonneg_left (χ.norm_le_one _) (by positivity)) (χ.norm_le_one _) (norm_nonneg _) (by positivity) _ = _ := by ring theorem factorization_absolute_mass_product_eq_cross_sum (M H : Finset ℕ) (α aH : ℕ → ℂ) (z w : ℕ) : factorizationAbsoluteMass M H α aH z * factorizationAbsoluteMass M H α aH w = ∑ m ∈ M, ∑ h' ∈ H, ∑ m' ∈ M, ∑ h ∈ H, if m'*h=z ∧ m*h'=w then ‖α m * aH h'‖ * ‖α m' * aH h‖ else 0 := by classical rw [mul_comm (factorizationAbsoluteMass M H α aH z)] simp only [factorizationAbsoluteMass, sum_filter, sum_product] simp_rw [sum_mul] simp_rw [mul_sum] apply sum_congr rfl intro m hm apply sum_congr rfl intro h' hh' apply sum_congr rfl intro m' hm' apply sum_congr rfl intro h hh by_cases hz : m'*h=z <;> by_cases hw : m*h'=w <;> simp only [hz, hw, and_self, and_true, and_false, if_true, if_false, mul_zero, zero_mul] theorem typeII_cross_character_absolute_mass_le (M H Zs : Finset ℕ) (k : ℤ) (Z : ℝ) (ψ : ℝ → ℝ) (α aH : ℕ → ℂ) (χ : DirichletCharacter ℂ (2*k.natAbs)) (hM : ∀ m ∈ M, 0 < m) (hk : k ≠ 0) (hψ : ∀ z ∈ Zs, |ψ ((z:ℝ)/Z)| ≤ 1) (hpos : ∀ z ∈ Zs, 0 < z ∧ 0 < (z:ℤ)+k) : (∑ y ∈ typeIICrossSlice M H Zs k, ‖(ψ ((y.1.2:ℝ)/Z) : ℂ) * typeIICrossCharacterAmplitude χ α aH y‖) ≤ ∑ z ∈ Zs, factorizationAbsoluteMass M H α aH z * factorizationAbsoluteMass M H α aH ((z:ℤ)+k).toNat := by classical have hcastif (p : Prop) [Decidable p] (a b : ℝ) : ((if p then a else b : ℝ) : ℂ) = if p then (a:ℂ) else (b:ℂ) := by split_ifs <;> rfl have hreindex : (∑ y ∈ typeIICrossSlice M H Zs k, ‖(ψ ((y.1.2:ℝ)/Z) : ℂ) * typeIICrossCharacterAmplitude χ α aH y‖) = ∑ z ∈ Zs, ∑ m ∈ M, ∑ h' ∈ H, ∑ m' ∈ M, ∑ h ∈ H, if m'*h=z ∧ (z:ℤ)+k=(m:ℤ)*h' then ‖(ψ ((z:ℝ)/Z) : ℂ) * typeIICrossCharacterAmplitude χ α aH ((k,z),((m,h),(m',h')))‖ else 0 := by apply Complex.ofReal_injective simp only [Complex.ofReal_sum, hcastif, Complex.ofReal_zero] exact typeII_cross_slice_sum_reindex M H Zs k (fun y => (‖(ψ ((y.1.2:ℝ)/Z) : ℂ) * typeIICrossCharacterAmplitude χ α aH y‖ : ℂ)) hM hk rw [hreindex] apply sum_le_sum intro z hz rw [factorization_absolute_mass_product_eq_cross_sum] apply sum_le_sum intro m hm apply sum_le_sum intro h' hh' apply sum_le_sum intro m' hm' apply sum_le_sum intro h hh have hcross : ((z:ℤ)+k=(m:ℤ)*h') ↔ m*h'=((z:ℤ)+k).toNat := by have hcast : (((z:ℤ)+k).toNat : ℤ) = (z:ℤ)+k := Int.toNat_of_nonneg (hpos z hz).2.le constructor · intro heq have hh : (((z:ℤ)+k).toNat : ℤ) = ((m*h' : ℕ):ℤ) := by simpa only [Int.natCast_mul] using hcast.trans heq exact (Int.ofNat_inj.mp hh).symm · intro heq have hh := congrArg (fun n : ℕ => (n:ℤ)) heq simpa only [Int.natCast_mul, hcast] using hh.symm simp only [hcross] split_ifs · rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] calc _ ≤ 1 * ‖typeIICrossCharacterAmplitude χ α aH ((k,z),((m,h),(m',h')))‖ := mul_le_mul_of_nonneg_right (hψ z hz) (norm_nonneg _) _ ≤ _ := by simpa only [one_mul] using typeII_cross_character_amplitude_norm_le χ α aH ((k,z),((m,h),(m',h'))) · exact le_rfl end Bounty end section /- Exact removal of inactive spatial indices, preserving both factorization masks. -/ open Finset MeasureTheory namespace Bounty noncomputable def typeIIActiveCrossZ (Z : ℝ) (k : ℤ) (Zs : Finset ℕ) : Finset ℕ := by classical exact Zs.filter (fun z => 0 < z ∧ 0 < (z:ℤ)+k ∧ (z:ℝ) ≤ 2*Z) theorem typeII_smooth_cross_sum_active_support (M H Zs : Finset ℕ) (k : ℤ) (Z : ℝ) (F : TypeIIShiftIndex → ℂ) (hZ : 0 < Z) (hH : ∀ h ∈ H, 0 < h) : (∑ y ∈ typeIICrossSlice M H Zs k, (typeIISmoothDyadic ((y.1.2:ℝ)/Z):ℂ) * F y) = ∑ y ∈ typeIICrossSlice M H (typeIIActiveCrossZ Z k Zs) k, (typeIISmoothDyadic ((y.1.2:ℝ)/Z):ℂ) * F y := by classical have hsub : typeIICrossSlice M H (typeIIActiveCrossZ Z k Zs) k ⊆ typeIICrossSlice M H Zs k := by intro y hy obtain ⟨hprod, hc⟩ := mem_filter.mp hy obtain ⟨hks, hpairs⟩ := mem_product.mp hprod obtain ⟨hk, hz⟩ := mem_product.mp hks exact mem_filter.mpr ⟨mem_product.mpr ⟨mem_product.mpr ⟨hk, (mem_filter.mp hz).1⟩, hpairs⟩, hc⟩ symm apply sum_subset hsub intro y hy hnot by_cases hψ : typeIISmoothDyadic ((y.1.2:ℝ)/Z) = 0 · simp [hψ] exfalso apply hnot obtain ⟨hprod, hc⟩ := mem_filter.mp hy obtain ⟨hks, hpairs⟩ := mem_product.mp hprod obtain ⟨hyk, hyz⟩ := mem_product.mp hks obtain ⟨hleft, hright⟩ := mem_product.mp hpairs have hkp : y.1.1 = k := mem_singleton.mp hyk have hψs := typeII_smooth_dyadic_support hψ have hz0 : 0 < y.1.2 := by have hh := (lt_div_iff₀ hZ).mp hψs.1 have hzR : (0:ℝ) < (y.1.2:ℝ) := by linarith exact_mod_cast hzR have hzupper : (y.1.2:ℝ) ≤ 2*Z := ((div_lt_iff₀ hZ).mp hψs.2).le have hw0 : 0 < (y.1.2:ℤ)+k := by obtain ⟨hm, _, _, hcross⟩ := hc rw [hkp] at hcross rw [hcross] apply mul_pos · exact_mod_cast hm · exact_mod_cast hH _ (mem_product.mp hright).2 exact mem_filter.mpr ⟨mem_product.mpr ⟨mem_product.mpr ⟨hyk, mem_filter.mpr ⟨hyz, hz0, hw0, hzupper⟩⟩, hpairs⟩, hc⟩ end Bounty end section /- Exact smooth spatial partition of every actual majorant character slice. -/ open Finset MeasureTheory open scoped ComplexConjugate namespace Bounty noncomputable def typeIISmoothDyadicCount (L : ℝ) : ℕ := ⌈Real.logb 2 (192 * L^88)⌉₊ + 1 noncomputable def typeIISmoothDyadicScale (U V E : ℝ) (j : ℕ) : ℝ := U^2 * V / (16*E) * 2^j theorem typeII_smooth_dyadic_scale_pos {U V E : ℝ} (hU : 0 < U) (hV : 0 < V) (hE : 0 < E) (j : ℕ) : 0 < typeIISmoothDyadicScale U V E j := by unfold typeIISmoothDyadicScale positivity theorem typeII_majorant_character_dyadic_partition (L U V E : ℝ) (k : ℤ) (M H Zs : Finset ℕ) (α aH : ℕ → ℂ) (χ : DirichletCharacter ℂ (2*k.natAbs)) (hL : 0 < L) (hU : 0 < U) (hV : 0 < V) (hE : 0 < E) (hUV : 4 ≤ U*V) (hM : ∀ m ∈ M, (m:ℝ) ∈ Set.Icc U (2*U)) : (∑ y ∈ typeIICrossSlice M H Zs k, typeIIRealShiftWeight (fun e n => typeIIEMajorant (L^88) (e/E) * typeIINMajorant (n/V)) α aH y * χ (y.2.1.1 : ZMod (2*k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2*k.natAbs)))) = ∑ j ∈ range (typeIISmoothDyadicCount L), ∑ y ∈ typeIICrossSlice M H Zs k, (typeIISmoothDyadic ((y.1.2:ℝ)/typeIISmoothDyadicScale U V E j) : ℂ) * typeIIRealShiftWeight (fun e n => typeIIEMajorant (L^88) (e/E) * typeIINMajorant (n/V)) α aH y * χ (y.2.1.1 : ZMod (2*k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2*k.natAbs))) := by classical rw [sum_comm] apply sum_congr rfl intro y hy by_cases hη : typeIIEMajorant (L^88) (typeIIRealE y/E) * typeIINMajorant (typeIIRealN y/V) = 0 · simp [typeIIRealShiftWeight, hη] obtain ⟨hprod, hc⟩ := mem_filter.mp hy obtain ⟨_, hpairs⟩ := mem_product.mp hprod obtain ⟨hv, hw⟩ := mem_product.mp hpairs have hp := typeII_majorant_smooth_partition hL hU hV hE hUV hc.2.1 (hM _ (mem_product.mp hv).1) (hM _ (mem_product.mp hw).1) hc.2.2.1 hη have hpc : (∑ j ∈ range (typeIISmoothDyadicCount L), (typeIISmoothDyadic ((y.1.2:ℝ)/typeIISmoothDyadicScale U V E j) : ℂ)) = 1 := by rw [← Complex.ofReal_sum] simpa only [typeIISmoothDyadicCount, typeIISmoothDyadicScale, Complex.ofReal_one] using congrArg (fun x : ℝ => (x:ℂ)) hp simp only [← sum_mul, hpc, one_mul] end Bounty end section /- Actual B0 coefficients have polynomial bounds before choosing the allocation gap. -/ open Finset Filter namespace Bounty theorem candidate_remaining_coefficient_zero (c L : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) : candidateRemainingComplexCoefficient c L r jStar take twist 0 = 0 := by classical unfold candidateRemainingComplexCoefficient apply div_eq_zero_iff.mpr left unfold orderedSlotComplexWeight apply sum_eq_zero intro x hx have hn : orderedSlotProduct (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val) x ≠ 0 := by apply prod_ne_zero_iff.mpr intro slot hslot exact candidate_Q_slot_nonzero c L r jStar slot.val (x slot).property simp only [hn, if_false] section variable (c L q : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) include c L q r jStar take twist theorem candidate_retained_coefficient_zero : candidateRetainedComplexCoefficient c L q r jStar take twist 0 = 0 := by simp only [candidateRetainedComplexCoefficient, primePoolFreePart, Nat.zero_div, candidate_remaining_coefficient_zero, mul_zero] theorem candidate_B0_retained_eq_phase (ν : ℝ) : candidateB0RetainedCoefficient c L q r jStar take twist ν = fun h => typeIIPhase (2*Real.pi*ν) h * candidateRetainedComplexCoefficient c L q r jStar take twist h := by funext h by_cases hh : h = 0 · subst h simp [candidateB0RetainedCoefficient, candidate_retained_coefficient_zero] · rw [candidateB0RetainedCoefficient, typeIIPhase_eq_cpow _ (Nat.pos_of_ne_zero hh)] exact mul_comm _ _ end theorem exists_candidate_B0_polynomial_bounds {c : ℝ} (hc : 0 < c) {r : ℕ} (hr : 6 ≤ r) : ∃ aE aH : ℝ, 0 ≤ aE ∧ 0 ≤ aH ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool), take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar (by omega) hj)) = false → ∀ (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (ν : ℝ), (∀ e : ℕ, 0 < e → ‖candidateB0TakenCoefficient c L r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) ν e‖ ≤ L^aE) ∧ (∀ h : ℕ, 0 < h → ‖candidateB0RetainedCoefficient c L (1/2) r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) ν h‖ ≤ L^aH*(h.divisors.card:ℝ)) := by have hr0 : 0 < r := by omega obtain ⟨aE, haE, htake⟩ := exists_candidate_separated_coefficients_polynomial_bound hc hr0 obtain ⟨aH, haH, hret⟩ := exists_candidate_retained_divisor_bound (q := (1/2:ℝ)) hc (by norm_num) (by norm_num) refine ⟨aE, aH, haE, haH, ?_⟩ filter_upwards [htake, hret] with L htake hret intro jStar hj take hkeep ξ ν have htwist : ∀ slot p, p ∈ candidateQSlotChoices c L r jStar slot → ‖candidateAllocationFourierTwist c L r jStar take ξ slot p‖ ≤ 1 := by intro slot p hp exact (candidate_allocation_fourier_twist_norm c L r jStar take ξ slot (Nat.pos_of_ne_zero (candidate_Q_slot_nonzero c L r jStar slot hp))).le constructor · intro e he rw [(candidate_B0_coefficient_norms c L (1/2) r jStar take _ ν he).1] exact (htake jStar hj take hkeep _ htwist).1 e · intro h hh rw [(candidate_B0_coefficient_norms c L (1/2) r jStar take _ ν hh).2] exact hret r jStar hr0 hj take hkeep _ htwist h hh.ne' end Bounty end section /- Exact original event rows with the chronological owner indicator. -/ open Finset Classical namespace Bounty section Rows variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v : ℝ) (V : Fin N → ℝ) (steps : List (Option (J ⊕ K))) (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) theorem full_mixed_common_ghost_original_stage_le (j : J) (htag : steps.get u = some (.inl j)) (η : Fin N → ℝ) (hη : ∀ g, 0 ≤ η g) (hμ : ∀ g p, 0 ≤ μ g p) (hμatom : ∀ g p, μ g p ≤ η g) (hv : 0 < v) (hq0 : 0 ≤ q j) (hq1 : q j ≤ 1) (hρ : 0 < ρ) (hD : q j / ρ ^ 2 + ((1 - q j) / ρ) / v ≤ 1) : let _ : ∀ (tag : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D tag s) := fullPermutationMixedEventFintype n S B A Δ D (∑ e : FullPermutationMixedEvent n S B A Δ D (some (.inl j)) s, |fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V (some (.inl j)) s e| * fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val (some (.inl j)) s e history * productLengthLyapunov v (fullPermutationMixedEventTarget n S B A Δ D (some (.inl j)) s e)) ≤ (∏ g, ((|(1 - q j) * V g / ρ| * η g) * v) ^ fullMixedCommonSelectedCount M B steps code u g) * (∏ g, Real.exp ((|(1 - q j) * V g / ρ| * ∑ p, μ g p) * v)) * productLengthLyapunov v s := by refine le_trans (le_of_eq (full_mixed_common_ghost_stage_reindex n S B A Δ D ω μ q ρ v V steps u s history code j htag)) ?_ exact full_mixed_common_ghost_all_skeletons_stage_le n S B A Δ D steps u j htag s history code μ (q j) ρ v V η hη hμ hμatom hv hq0 hq1 hρ hD theorem full_mixed_common_edge_original_stage_le (k : K) (htag : steps.get u = some (.inr k)) (η : Fin N → ℝ) (hη : ∀ g, 0 ≤ η g) (hμ : ∀ g p, 0 ≤ μ g p) (hμatom : ∀ g p, μ g p ≤ η g) (hv : 1 < v) (hω : ∀ c a, 0 ≤ ω k c a) (hωmass : ∀ c, ∑ a, ω k c a ≤ 1) (vmin : ℝ) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hvmin : 0 < vmin) (hV : ∀ g, vmin ≤ V g) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (T : ℕ) (ht : ∀ g, (S k g)ᶜ.card ≤ T) : let _ : ∀ (tag : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D tag s) := fullPermutationMixedEventFintype n S B A Δ D (∑ e : FullPermutationMixedEvent n S B A Δ D (some (.inr k)) s, |fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V (some (.inr k)) s e| * fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val (some (.inr k)) s e history * productLengthLyapunov v (fullPermutationMixedEventTarget n S B A Δ D (some (.inr k)) s e)) ≤ (∏ g, η g ^ fullMixedCommonSelectedCount M B steps code u g) * productLengthLyapunov v s * unrestrictedEdgeRowBound ρ v vmin T ^ N := by refine le_trans (le_of_eq (full_mixed_common_edge_stage_reindex n S B A Δ D ω μ q ρ v V steps u s history code k htag)) ?_ exact full_mixed_common_edge_all_skeletons_stage_le n S B A Δ D steps u k htag s history code (ω k) μ ρ v vmin V η hη hμ hμatom hv hω hωmass hρ0 hρ1 hvmin hV hmass T ht end Rows end Bounty end section /- Restrict the B0 hypothesis to the actual allocation frequency box. -/ open Finset MeasureTheory Real namespace Bounty theorem active_allocation_box_ae_support {N : ℕ} (active : Fin N → Bool) (R : ℝ) : ∀ᵐ ξ ∂activeAllocationBoxMeasure active R, ∀ i, ‖ξ i‖ ≤ R := by unfold activeAllocationBoxMeasure exact Filter.eventually_all.2 (fun i => (Measure.tendsto_eval_ae_ae (μ := fun _ : ActiveAllocationIndex active => volume.restrict {x : ℝ | ‖x‖ ≤ R}) (i := i)).eventually (ae_restrict_mem ((isClosed_le continuous_norm continuous_const).measurableSet))) theorem candidate_finite_mixed_mellin_norm_le_box_variation (c L q : ℝ) (r jStar : ℕ) (E B R : ℝ) (S : Finset ℕ) (F : ℕ → ℕ → ℂ) (T : ℝ) {Q : ℝ} (_hQ : 0 ≤ Q) (hbound : ∀ ν : ℝ, ‖ν‖ ≤ T → ∀ take : Fin ((candidateQIndices c L).card*r) → Bool, (∀ i, candidateAllocationActive c L r jStar i = false → take i = false) → ∀ ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ, (∀ i, ‖ξ i‖ ≤ L) → ‖candidateRetainedAllocationIntegrand c L q r jStar (log E) (candidateSmallPSet c L (R*exp L+1)) take (candidateFiniteCoarseMellinTest L E S ν F) ξ‖ ≤ Q*‖activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ‖) : ‖∫ ν in {ν : ℝ | ‖ν‖ ≤ T}, candidateFiniteMixedMellinIntegrand c L q r jStar E B R S F ν‖ ≤ Q*candidateMixedFourierVariation c L r jStar B L T := by classical let patterns := (univ : Finset (Fin ((candidateQIndices c L).card*r) → Bool)).filter (fun take => ∀ i, candidateAllocationActive c L r jStar i = false → take i = false) let C : ℝ := ∑ take ∈ patterns, ∫ ξ, ‖activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ‖ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) L have hinner (ν : ℝ) (hν : ‖ν‖ ≤ T) (take : Fin ((candidateQIndices c L).card*r) → Bool) (htake : take ∈ patterns) : ‖∫ ξ, candidateRetainedAllocationIntegrand c L q r jStar (log E) (candidateSmallPSet c L (R*exp L+1)) take (candidateFiniteCoarseMellinTest L E S ν F) ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) L‖ ≤ Q * ∫ ξ, ‖activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ‖ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) L := by calc _ ≤ ∫ ξ, Q*‖activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ‖ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) L := norm_integral_le_of_norm_le ((active_allocation_box_weight_integrable (candidateAllocationRadius r) L (candidateAllocationActive c L r jStar) take).norm.const_mul Q) (by filter_upwards [active_allocation_box_ae_support (candidateAllocationActive c L r jStar) L] with ξ hξ exact hbound ν hν take (mem_filter.mp htake).2 ξ hξ) _ = _ := integral_const_mul Q _ have hsum (ν : ℝ) (hν : ‖ν‖ ≤ T) : ‖∑ take ∈ patterns, ∫ ξ, candidateRetainedAllocationIntegrand c L q r jStar (log E) (candidateSmallPSet c L (R*exp L+1)) take (candidateFiniteCoarseMellinTest L E S ν F) ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) L‖ ≤ Q*C := by calc _ ≤ ∑ take ∈ patterns, ‖∫ ξ, candidateRetainedAllocationIntegrand c L q r jStar (log E) (candidateSmallPSet c L (R*exp L+1)) take (candidateFiniteCoarseMellinTest L E S ν F) ξ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) L‖ := norm_sum_le _ _ _ ≤ ∑ take ∈ patterns, Q * ∫ ξ, ‖activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ‖ ∂activeAllocationBoxMeasure (candidateAllocationActive c L r jStar) L := sum_le_sum (fun take htake => hinner ν hν take htake) _ = Q*C := (mul_sum ..).symm have hphase (ν : ℝ) : ‖(exp L : ℂ)^(-((2*Real.pi*ν : ℝ) : ℂ)*Complex.I)‖ = 1 := by rw [Complex.norm_cpow_eq_rpow_re_of_pos (exp_pos L)] simp have hT : MeasurableSet {ν : ℝ | ‖ν‖ ≤ T} := (isClosed_le continuous_norm continuous_const).measurableSet have hdom : ∀ᵐ ν ∂volume.restrict {ν : ℝ | ‖ν‖ ≤ T}, ‖candidateFiniteMixedMellinIntegrand c L q r jStar E B R S F ν‖ ≤ ‖typeIIWindowFourier (L^B) ν‖*(Q*C) := by filter_upwards [ae_restrict_mem hT] with ν hν unfold candidateFiniteMixedMellinIntegrand rw [norm_mul, norm_mul, hphase, one_mul] exact mul_le_mul_of_nonneg_left (hsum ν hν) (norm_nonneg _) calc _ ≤ ∫ ν in {ν : ℝ | ‖ν‖ ≤ T}, ‖typeIIWindowFourier (L^B) ν‖*(Q*C) := norm_integral_le_of_norm_le (((typeII_window_fourier_integrable (L^B)).norm).mul_const (Q*C)).integrableOn hdom _ = (∫ ν in {ν : ℝ | ‖ν‖ ≤ T}, ‖typeIIWindowFourier (L^B) ν‖)*(Q*C) := integral_mul_const _ _ _ = Q*candidateMixedFourierVariation c L r jStar B L T := by dsimp only [candidateMixedFourierVariation, C, patterns] ring end Bounty end section /- The selected edge displacement splits across precisely the original groups. -/ open scoped Classical namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (small : G → Prop) (C : Fin n → G → Finset (Fin J)) include G sharedInstance1 P J ell n small C theorem physical_selected_group_D_split (d : PhysicalGroupSelectedData P ell C) (j : Fin n) : physicalD (C j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (d.1 j) = physicalD (fun g : {g // small g} => C j g.val) (physicalPermuteLabels ((physicalGroupSelectedSplit small C d).1.2.2.1 j) ((physicalGroupSelectedSplit small C d).1.2.1 j.castSucc)) ((physicalGroupSelectedSplit small C d).1.1 j) * physicalD (fun g : {g // ¬small g} => C j g.val) (physicalPermuteLabels ((physicalGroupSelectedSplit small C d).2.2.2.1 j) ((physicalGroupSelectedSplit small C d).2.2.1 j.castSucc)) ((physicalGroupSelectedSplit small C d).2.1 j) := by simpa only [physical_group_selected_split_small, physical_group_selected_split_big, ← physical_permute_group_restrict] using (physical_D_group_split small (C j) (d.1 j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc))) theorem physical_selected_group_inverse_D (ds : PhysicalGroupSelectedData (fun g : {g // small g} => P g.val) ell (fun j g => C j g.val)) (db : PhysicalGroupSelectedData (fun g : {g // ¬small g} => P g.val) ell (fun j g => C j g.val)) (j : Fin n) : let d := (physicalGroupSelectedSplit small C).symm (ds, db) physicalD (C j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (d.1 j) = physicalD (fun g : {g // small g} => C j g.val) (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc)) (ds.1 j) * physicalD (fun g : {g // ¬small g} => C j g.val) (physicalPermuteLabels (db.2.2.1 j) (db.2.1 j.castSucc)) (db.1 j) := by have h := physical_selected_group_D_split small C ((physicalGroupSelectedSplit small C).symm (ds, db)) j rw [Equiv.apply_symm_apply] at h exact h end theorem physical_selected_group_reindexed_D {G : Type*} [Fintype G] {M J ell n : ℕ} (e : G ≃ Fin M) (P : G → Finset ℕ) (C : Fin n → G → Finset (Fin J)) (d : PhysicalGroupSelectedData P ell C) (j : Fin n) : let dn := physicalSelectedGroupReindex e P C d physicalD (fun h => C j (e.symm h)) (physicalPermuteLabels (dn.2.2.1 j) (dn.2.1 j.castSucc)) (dn.1 j) = physicalD (C j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (d.1 j) := by exact physical_D_group_reindex e (C j) (d.1 j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) end Bounty end section /- The proved all-character rough-band theorem discharges the high-frequency premise of the actual four-factor integral estimate. -/ open Filter Finset Set MeasureTheory namespace Bounty end Bounty end section /- The original spatial test vanishes on every newly added sufficiently large P factor. -/ open Finset namespace Bounty theorem candidate_box_finite_test_large_P (L E X : ℝ) (S : Finset ℕ) (G : ℕ → ℂ) (hS : ∀ u ∈ S, (u : ℝ) ≤ X) (e p n : ℕ) (he : 0 < e) (hn : 0 < n) (hp : X < (p : ℝ)) : candidateBoxFiniteTest L E S G e (p*n) = 0 := by have hmul : p ≤ e*(p*n) := by calc p = p*1 := by ring _ ≤ p*(e*n) := Nat.mul_le_mul_left p (Nat.mul_pos he hn) _ = _ := by ring have hnot : e*(p*n) ∉ S := by intro hm have hbound := hS _ hm have hmR : (p : ℝ) ≤ (e*(p*n) : ℕ) := by exact_mod_cast hmul linarith unfold candidateBoxFiniteTest exact if_neg (fun h => hnot h.2) theorem candidate_separated_finite_test_large_P (c L : ℝ) (r jStar : ℕ) (R E X : ℝ) (S : Finset ℕ) (G : ℕ → ℂ) (hS : ∀ u ∈ S, (u : ℝ) ≤ X) (take : Fin ((candidateQIndices c L).card*r) → Bool) (p : ℕ) (hp : X < (p : ℝ)) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) : candidateSeparatedAllocationIntegrand c L r jStar R take (fun e n => candidateBoxFiniteTest L E S G e (p*n)) ξ = 0 := by classical unfold candidateSeparatedAllocationIntegrand have hz : (∑ e ∈ orderedSlotProductSupport (fun slot : CandidateTakenSlot c L r take => candidateQSlotChoices c L r jStar slot.val), ∑ n ∈ orderedSlotProductSupport (fun slot : CandidateRemainingSlot c L r take => candidateQSlotChoices c L r jStar slot.val), candidateTakenComplexCoefficient c L r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) e * candidateRemainingComplexCoefficient c L r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) n * candidateBoxFiniteTest L E S G e (p*n)) = 0 := by apply sum_eq_zero intro e he apply sum_eq_zero intro n hn have hepos := candidate_taken_product_support_pos c L r jStar take he have hnpos : 0 < n := by obtain ⟨x,hx,rfl⟩ := mem_image.mp hn apply Nat.pos_of_ne_zero exact prod_ne_zero_iff.mpr (fun slot _ => candidate_Q_slot_nonzero c L r jStar slot.val (x slot).property) rw [candidate_box_finite_test_large_P L E X S G hS e p n hepos hnpos hp,mul_zero] rw [hz,mul_zero,zero_mul] end Bounty end section /- High-frequency cancellation with the actual allocation twist and two character factors. -/ open Finset Filter namespace Bounty end Bounty end section /- Simultaneous upper bounds for a finite family of unbalanced rough-proxy bins. -/ open Finset Filter namespace Bounty theorem exists_candidate_unbalanced_rough_finite_bins_upper_uniform_precision {ι : Type*} [Fintype ι] (hZ : PrimitiveZeroFreeHalfPlane) {c q : ℝ} {r : ℕ} {γ a v M : ι → ℝ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11 / 5 : ℝ) * (r : ℝ) * c = 1) (hγ : ∀ i, 0 < γ i) (ha : ∀ i, 0 < a i) (hav : ∀ i, a i ≤ v i) (hvhalf : ∀ i, v i < 1 / 2) (hvγ : ∀ i, v i < 1 - γ i) (hM : ∀ i, 0 ≤ M i) (hdensity : ∀ i, ∀ α ∈ Set.Icc (a i) (v i), buchstabDensity (γ i) (1 - α) ≤ M i) : ∃ J : ℕ, ∀ S : ℝ, 0 ≤ S → ∀ jStar : ℕ, J < jStar → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ (F : ι → Finset (ℕ × ℕ)) (u : ι → ℕ × ℕ → ℕ), (∀ i, ∀ w ∈ F i, u i w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 ∈ primeBand (Real.exp (a i * L)) (Real.exp (v i * L)) ∧ w.1 * w.2 = 2 * u i w + 1) → (∑ i, ∑ w ∈ F i, candidateCoefficient c L q r jStar (u i w) * roughTestLogarithmicProxy (γ i) L S w.2) ≤ (shiftedSieveRatioConstant * (∑ i, M i * Real.log (v i / a i)) + ε) * candidateCoefficientWindowMass c L q r jStar / L := by classical have hbins := fun i => exists_candidate_unbalanced_rough_bin_upper_uniform_precision hZ hc hr hq0 hq1 hcenter (hγ i) (ha i) (hav i) (hvhalf i) (hvγ i) (hM i) (hdensity i) choose Js hJs using hbins refine ⟨Finset.univ.sup Js, ?_⟩ intro S hS jStar hj ε hε let δ := ε / ((Fintype.card ι : ℝ) + 1) have hden : 0 < (Fintype.card ι : ℝ) + 1 := by positivity have hδ : 0 < δ := div_pos hε hden have hδeq : ((Fintype.card ι : ℝ) + 1) * δ = ε := by dsimp [δ] field_simp have hδerror : (Fintype.card ι : ℝ) * δ ≤ ε := by nlinarith have hbinEvent := fun i => hJs i S hS jStar (lt_of_le_of_lt (Finset.le_sup (Finset.mem_univ i)) hj) δ hδ have hEvent := Filter.eventually_all.mpr hbinEvent filter_upwards [hEvent, eventually_gt_atTop (0 : ℝ)] with L hbound hL intro F u hdata have hX : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro n hn exact candidate_coefficient_nonneg c L hq0 r jStar n have hsum : (∑ i, (shiftedSieveRatioConstant * M i * Real.log (v i / a i) + δ)) = shiftedSieveRatioConstant * (∑ i, M i * Real.log (v i / a i)) + (Fintype.card ι : ℝ) * δ := by simp only [sum_add_distrib, sum_const, card_univ, nsmul_eq_mul] rw [mul_sum] congr 1 apply sum_congr rfl intro i hi ring calc (∑ i, ∑ w ∈ F i, candidateCoefficient c L q r jStar (u i w) * roughTestLogarithmicProxy (γ i) L S w.2) ≤ ∑ i, (shiftedSieveRatioConstant * M i * Real.log (v i / a i) + δ) * candidateCoefficientWindowMass c L q r jStar / L := by apply sum_le_sum intro i hi exact hbound i (F i) (u i) (hdata i) _ = (shiftedSieveRatioConstant * (∑ i, M i * Real.log (v i / a i)) + (Fintype.card ι : ℝ) * δ) * candidateCoefficientWindowMass c L q r jStar / L := by rw [← sum_div, ← sum_mul, hsum] _ ≤ (shiftedSieveRatioConstant * (∑ i, M i * Real.log (v i / a i)) + ε) * candidateCoefficientWindowMass c L q r jStar / L := by apply div_le_div_of_nonneg_right _ hL.le exact mul_le_mul_of_nonneg_right (by linarith [hδerror]) hX end Bounty end section /- The actual retained prime pair has arbitrarily small relative shared-draw error for logarithmic list lengths and exponentially large prime pools. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- The literal difference between the original full prime pair and its unshared marked-average comparison at density one half. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalPrimePairError {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) (w z : ℕ) : ℂ := let C := repeatedBigPrimePatternCut probes r t i physicalFullPairCorrelation P C V (1/2) w z (physicalOriginalPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z) - (markedDivisorWeight univ P (1/2) V (fun g => ell + (C g).card) (w : ℤ) : ℂ) * (markedDivisorWeight univ P (1/2) V (fun g => ell + (C g).card) (z : ℤ) : ℂ) * groupMarkedAverage P (fun g => ell + (C g).card) (w : ℤ) (fun u => groupMarkedAverage P (fun g => ell + (C g).card) (z : ℤ) (physicalUnsharedPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z u)) theorem physical_prime_pair_error_bound {G : Type*} [Fintype G] [dG : DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) {w z : ℕ} (hw : 0 < w) (hz : 0 < z) {Pmin ε : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (herror : let C := repeatedBigPrimePatternCut probes r t i let H := repeatedBigPrimePatternBound probes r t Q ξ i (∑ g, (J - (C g).card : ℕ) * (Real.log w / Real.log 2 + Real.log z / Real.log 2 + J) / (V g * Pmin)) * (H + H / (1/2 : ℝ) ^ (2 * ∑ g : G, (J - (C g).card))) ≤ ε) : let C := repeatedBigPrimePatternCut probes r t i ‖physicalPrimePairError P V probes r t hrt Q h ξ i aux a b w z‖ ≤ (markedDivisorWeight univ P (1/2) V (fun g => ell + (C g).card) (w : ℤ) * markedDivisorWeight univ P (1/2) V (fun g => ell + (C g).card) (z : ℤ)) * ε := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) dsimp only at herror ⊢ apply (physical_prime_pair_comparison P probes hprime hdis V hV hMass (by norm_num : (0 : ℝ) < 1/2) (by norm_num : (1/2 : ℝ) ≤ 1) r t hrt Q h ξ hξ i aux a b hw hz hPmin hp).trans apply mul_le_mul_of_nonneg_left herror exact mul_nonneg (marked_divisor_weight_nonneg univ P (by norm_num) V _ (fun g _ => (hV g).le) _) (marked_divisor_weight_nonneg univ P (by norm_num) V _ (fun g _ => (hV g).le) _) end Bounty end section /- The position bridge for the original retained prime kernel and invariant endpoints. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalRootPrimeKernel {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) : ℂ := repeatedBigPrimePatternWeight probes r t i * repeatedBigPrimePatternKernel P V probes r t hrt Q h (fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ) i (fun g s => L g s) (fun g s => R g s) aux end Bounty end section /- Fixed-auxiliary cutoff coverage, without coverage of unrelated auxiliary shifts. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalFixedAuxPositionClosure {G : Type*} [Fintype G] (P : G → Finset ℕ) {J : ℕ} (C : G → Finset (Fin J)) (ell : ℕ) (k : ℤ) (aux : PhysicalAuxLabels P C) (S : Finset ℤ) : Finset ℤ := univ.biUnion (fun L : PhysicalMarkLists P J ell => S.image (fun w => (physicalSharedFactor C L : ℤ) * w) ∪ S.image (fun w => (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)))) section variable {G : Type*} [sharedInstance1 : Fintype G] (P : G → Finset ℕ) {J ell : ℕ} (C : G → Finset (Fin J)) (k : ℤ) (aux : PhysicalAuxLabels P C) include G sharedInstance1 P J ell C k aux theorem physical_fixed_aux_position_coverage (S : Finset ℤ) (L : PhysicalMarkLists P J ell) {w : ℤ} (hw : w ∈ S) : (physicalSharedFactor C L : ℤ) * w ∈ physicalFixedAuxPositionClosure P C ell k aux S ∧ (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) ∈ physicalFixedAuxPositionClosure P C ell k aux S := by constructor · exact mem_biUnion.mpr ⟨L, mem_univ _, mem_union_left _ (mem_image.mpr ⟨w, hw, rfl⟩)⟩ · exact mem_biUnion.mpr ⟨L, mem_univ _, mem_union_right _ (mem_image.mpr ⟨w, hw, rfl⟩)⟩ theorem physical_fixed_aux_closure_subset_iff (S positions : Finset ℤ) : physicalFixedAuxPositionClosure P C ell k aux S ⊆ positions ↔ ∀ (L : PhysicalMarkLists P J ell) w, w ∈ S → (physicalSharedFactor C L : ℤ) * w ∈ positions ∧ (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) ∈ positions := by constructor · intro h L w hw have hc := physical_fixed_aux_position_coverage P C k aux S L hw exact ⟨h hc.1, h hc.2⟩ · intro h n hn obtain ⟨L, _, hn⟩ := mem_biUnion.mp hn rcases mem_union.mp hn with hn | hn · obtain ⟨w, hw, rfl⟩ := mem_image.mp hn exact (h L w hw).1 · obtain ⟨w, hw, rfl⟩ := mem_image.mp hn exact (h L w hw).2 end end Bounty end section /- Literal positive support of the original harmonic dyadic cutoff. -/ open Finset namespace Bounty theorem typeII_harmonic_dyadic_support {t : ℝ} (h : typeIIHarmonicDyadic t ≠ 0) : t ∈ Set.Ioo (1/2) 2 := by apply typeII_smooth_dyadic_support intro hz exact h (by simp only [typeIIHarmonicDyadic, hz, mul_zero]) noncomputable def harmonicPositiveSupport (Z : ℝ) (k : ℤ) (d : ℕ) : Finset ℤ := (Icc 1 ⌊2*Z*(d : ℝ)⌋).filter (fun w => Z*(d : ℝ)/2 < (w : ℝ) ∧ 0 < w + k*(d : ℤ)) theorem mem_harmonic_positive_support {Z : ℝ} {k w : ℤ} {d : ℕ} (hw : w ∈ harmonicPositiveSupport Z k d) : 0 < w ∧ Z*(d : ℝ)/2 < (w : ℝ) ∧ (w : ℝ) ≤ 2*Z*(d : ℝ) ∧ 0 < w + k*(d : ℤ) := by have h := mem_filter.mp hw have hi := mem_Icc.mp h.1 exact ⟨by omega, h.2.1, (Int.le_floor.mp hi.2), h.2.2⟩ theorem original_harmonic_test_support (P : Finset ℕ) (α₀ β₀ γ₀ α₁ β₁ γ₁ : ℕ → ℂ) {Z : ℝ} (hZ : 0 < Z) (k : ℤ) {d : ℕ} (hd : 0 < d) (w : ℤ) (h : (typeIIHarmonicDyadic ((w : ℝ)/(Z*(d : ℝ))) : ℂ) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (positiveInvariantEndpoint P α₀ β₀ γ₀ w) * positiveInvariantEndpoint P α₁ β₁ γ₁ (w+k*(d : ℤ)) ≠ 0) : w ∈ harmonicPositiveSupport Z k d := by have hψ : typeIIHarmonicDyadic ((w : ℝ)/(Z*(d : ℝ))) ≠ 0 := by intro hz apply h simp only [hz, Complex.ofReal_zero, zero_mul] have hs := typeII_harmonic_dyadic_support hψ have hZd : 0 < Z*(d : ℝ) := mul_pos hZ (by exact_mod_cast hd) have hlo : Z*(d : ℝ)/2 < (w : ℝ) := by have hh := (lt_div_iff₀ hZd).mp hs.1 linarith have hhi : (w : ℝ) < 2*Z*(d : ℝ) := by have hh := (div_lt_iff₀ hZd).mp hs.2 linarith have hwpos : 0 < w := by have : 0 < (w : ℝ) := lt_trans (half_pos hZd) hlo exact_mod_cast this have htpos : 0 < w+k*(d : ℤ) := by apply positive_invariant_endpoint_nonzero P α₁ β₁ γ₁ intro hz exact h (by rw [hz, mul_zero]) exact mem_filter.mpr ⟨mem_Icc.mpr ⟨by omega, Int.le_floor.mpr hhi.le⟩, hlo, htpos⟩ theorem harmonic_positive_support_upper_shift {Z : ℝ} (k : ℤ) {d : ℕ} (hk : |(k : ℝ)| ≤ Z) {w : ℤ} (hw : w ∈ harmonicPositiveSupport Z k d) : (w + k*(d : ℤ) : ℤ) ≤ ⌊3*Z*(d : ℝ)⌋ := by have hs := mem_harmonic_positive_support hw apply Int.le_floor.mpr have hh := mul_le_mul_of_nonneg_right (le_trans (le_abs_self (k : ℝ)) hk) (Nat.cast_nonneg d : (0 : ℝ) ≤ d) push_cast linarith [hs.2.2.1] end Bounty end section /- The exact error from deleting the two remaining auxiliary indicators is supported on the free-label divisibility set. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalFreePrimePairError {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) (w z : ℕ) : ℂ := let marks := fun g => ell + (repeatedBigPrimePatternCut probes r t i g).card groupMarkedAverage P marks (w : ℤ) (fun u => groupMarkedAverage P marks (z : ℤ) (physicalUnsharedPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z u)) - groupMarkedAverage P marks (w : ℤ) (fun u => groupMarkedAverage P marks (z : ℤ) (physicalFreePrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z u)) section variable {G : Type*} [sharedInstance1 : Fintype G] [dG : DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) include G sharedInstance1 dG J ell P V probes r t hrt Q h ξ theorem physical_free_prime_pair_error_zero (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) (n k : ℤ) (hn : ∀ p ∈ physicalFreePrimeSet (repeatedBigPrimePatternCut probes r t i) aux, ¬ (p : ℤ) ∣ n) : physicalFreePrimePairError P V probes r t hrt Q h ξ i aux a b n.natAbs (n + k * (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux : ℕ)).natAbs = 0 := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold physicalFreePrimePairError apply sub_eq_zero.mpr exact physical_marked_pair_aux_restriction_eq_signed _ aux n k hn _ theorem physical_free_prime_pair_error_norm_le (hξ : 0 < ξ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) (w z : ℕ) : ‖physicalFreePrimePairError P V probes r t hrt Q h ξ i aux a b w z‖ ≤ 2 * repeatedBigPrimePatternBound probes r t Q ξ i := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold physicalFreePrimePairError dsimp only apply (norm_sub_le _ _).trans have hH := repeated_big_prime_pattern_bound_nonneg probes r t Q ξ i have hr := group_marked_pair_average_norm_le P _ (w : ℤ) (z : ℤ) _ hH (fun u v => physical_unshared_prime_pair_coefficient_norm_le P V probes r t hrt Q h ξ i aux a b w z hξ u.val v.val) have hf := group_marked_pair_average_norm_le P _ (w : ℤ) (z : ℤ) _ hH (fun u v => physical_free_prime_pair_coefficient_norm_le P V probes r t hrt Q h ξ i aux a b w z hξ u.val v.val) exact (add_le_add hr hf).trans_eq (by ring) end end Bounty end section /- The actual unrestricted prime pair is a product of the two marked endpoint averages, with the original three phases and pattern sign. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Uniqueness of selected data makes the exact record phase multiplicative. -/ open Finset open scoped Classical namespace Bounty section Product variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (cut : ℕ → Fin N → Finset (Fin J)) (S : Finset (PhysicalSelectedData P ell C)) (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) end Product end Bounty end section /- The unrestricted physical prime pair is expressed using only its selected big-group averages, while the full marked weights retain every empty fiber. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Cumulative original big-edge displacement for selected physical data. -/ namespace Bounty noncomputable def physicalSelectedCumulativeOffset {N J ell n : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (d : PhysicalSelectedData P ell C) : Fin (n + 1) → ℤ := Fin.partialSum (fun j => k j * (physicalD (C j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (d.1 j) : ℤ)) end Bounty end section /- The disjoint record phase is exactly the complex weighted sum of the selected physical histories. -/ open Finset open scoped Classical namespace Bounty section Sum variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) end Sum end Bounty end section /- Nonzero original return coefficients enforce every structural list condition. -/ open Finset open scoped Classical namespace Bounty section Support variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) theorem physical_finite_return_scalar_edge_nonzero (h : physicalFiniteReturnScalar V patterns C ζ k K n L p ≠ 0) (j : Fin (n + 1)) : physicalBareLabeledScalar V patterns C (ζ (n - j.val)) (K (n - j.val)) (p j).1 (finitePathMarks L p j.val) (finitePathMarks L p (j.val + 1)) ≠ 0 := by unfold physicalFiniteReturnScalar physicalBareReturnScalar at h split_ifs at h with he · unfold physicalBareWalkScalar at h have hj := (prod_ne_zero_iff.mp h) j.val (mem_range.mpr j.isLt) have ha : finitePathLabels p j.val = (p j).1 := by simp only [finitePathLabels, dif_pos j.isLt] simpa only [Nat.add_sub_cancel, ha] using hj · exact (h rfl).elim theorem physical_finite_return_scalar_selected_lists (h : physicalFiniteReturnScalar V patterns C ζ k K n L p ≠ 0) : ∀ j : Fin (n + 1), physicalListAdmissible (C ((physicalPathSelectedEquiv patterns C (L, p)).1 j).val) ((physicalPathSelectedEquiv patterns C (L, p)).2.1 j) (physicalPermuteLabels ((physicalPathSelectedEquiv patterns C (L, p)).2.2.2.1 j) ((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc)) (physicalPermuteLabels ((physicalPathSelectedEquiv patterns C (L, p)).2.2.2.2 j) ((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.succ)) := by intro j rw [physical_path_selected_marks_eq_finite_path] change physicalListAdmissible (C (p j).1.2.2.1.val) (p j).1.2.2.2 (physicalPermuteLabels (p j).1.1 (finitePathMarks L p j.val)) (physicalPermuteLabels (p j).1.2.1 (finitePathMarks L p (j.val + 1))) by_contra hn exact physical_finite_return_scalar_edge_nonzero V patterns C ζ k K L p h j (physical_bare_scalar_zero_of_incompatible V patterns C (ζ (n - j.val)) (K (n - j.val)) (p j).1 (finitePathMarks L p j.val) (finitePathMarks L p (j.val + 1)) hn) end Support end Bounty end section /- Multiplier nondivisibility requires an explicit nonzero short-step hypothesis. -/ open Finset namespace Bounty section Multipliers variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) theorem physical_path_selected_multiplier_not_dvd_of_bounds (pmin : ℕ) (hk0 : ∀ t < n + 1, ∀ i ∈ patterns, k t i ≠ 0) (hshort : ∀ t < n + 1, ∀ i ∈ patterns, (k t i).natAbs < pmin) (hpool : ∀ g a, a ∈ P g → pmin ≤ a) : ∀ j : Fin (n + 1), ∀ g s, ¬ (((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc g s).val : ℤ) ∣ physicalPathSelectedMultiplier C k p j := by intro j g s apply nat_not_dvd_int_of_natAbs_lt · exact Int.natAbs_pos.mpr (hk0 (n - j.val) (by omega) _ (p j).1.2.2.1.property) · exact (hshort (n - j.val) (by omega) _ (p j).1.2.2.1.property).trans_le (hpool g _ ((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc g s).property) end Multipliers end Bounty end section /- The original finite-path histories agree with their clamped selected coordinates. -/ open Finset open scoped Classical namespace Bounty section Alignment variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] {patterns : Finset I} (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (η : ℕ → ℝ) (β : PhysicalPrime P → ℝ) (V : Fin N → ℝ) theorem physical_finite_path_run_alignment (a : PhysicalPrime P) : ghostPhaseRunHistory (fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity (physicalPathSelectedEquiv patterns C (L, p)).2.2.1 a.1) j a.2) (physicalResidueAbsoluteHit (physicalPathSelectedOffset C k L p) a.1 a.2) (fun j => η (globalBirthFiniteIndex (n + 1) j).val) (β a) (V a.1) (n + 1) = ghostPhaseRunHistory (fun j => decide (a ∈ physicalMarkedPrimes (finitePathMarks L p j))) (fun j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j : ZMod a.2.val)) η (β a) (V a.1) (n + 1) := by apply ghost_phase_run_history_congr · intro j hj have hi : globalBirthFiniteIndex (n + 1) j = ⟨j, by omega⟩ := global_birth_finite_index_at (⟨j, by omega⟩ : Fin (n + 2)) simp only [globalBirthFiniteActivity, hi, physicalGroupBareFiniteActivity, physicalGroupPhaseActivity, physical_path_selected_marks_eq_finite_path, mem_physical_marked_primes] · intro j hj have hi : globalBirthFiniteIndex (n + 1) j = ⟨j, by omega⟩ := global_birth_finite_index_at (⟨j, by omega⟩ : Fin (n + 2)) simp only [physicalResidueAbsoluteHit, hi, physicalPathSelectedOffset] · intro j hj congr 1 exact min_eq_left hj end Alignment end Bounty end section /- Exact reindexing retains a support predicate on the original physical paths. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Summing all consistent selectors recovers the original observed local coefficients. -/ open Finset open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) (h : PhysicalFineHistoryCoherent C o t) [Fintype (PhysicalSelectedData P ell C)] include h omit [Fintype (PhysicalSelectedData P ell C)] in theorem physical_coherent_selected_coefficient (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (a : ∀ j, PhysicalAuxLabels P (C j)) (ha : ∀ j, o (4 * j.val + 2) = .inr (some ⟨j, a j⟩)) (d : PhysicalSelectedData P ell C) (hd : physicalSelectedDataTest C d o t) : physicalSelectedCoefficient C ζ K d = ∏ j : Fin n, K j (t (4 * j.val + 1)).1 (t (4 * j.val + 2)).1 (a j) * physicalPhase (ζ j) (physicalD (C j) (t (4 * j.val + 1)).1 (a j)) := by apply prod_congr rfl intro j _ have hs := physical_coherent_selected_source_marks C o t h d hd j have he := ((physical_selected_data_test_iff_four C d o t).mp hd).2.2.1 j have haux : d.1 j = a j := by have hh := Option.some.inj (Sum.inr.inj (he.1.symm.trans (ha j))) exact eq_of_heq (Sigma.mk.inj_iff.mp hh).2 rw [hs, ← he.2, haux] end Fine end Bounty end section /- The complete balanced rough-pair sum, with a constant independent of the balance width. -/ open Finset Filter open scoped Topology namespace Bounty def balancedPairWindow (κ L : ℝ) (v : ℕ × ℕ) : Prop := Real.exp (((1/2 : ℝ)-2*κ)*L) ≤ (v.1 : ℝ) ∧ (v.1 : ℝ) ≤ Real.exp (((1/2 : ℝ)+2*κ)*L) ∧ Real.exp (((1/2 : ℝ)-2*κ)*L) ≤ (v.2 : ℝ) ∧ (v.2 : ℝ) ≤ Real.exp (((1/2 : ℝ)+2*κ)*L) ∧ Real.exp L ≤ ((v.1*v.2 : ℕ) : ℝ) ∧ ((v.1*v.2 : ℕ) : ℝ) ≤ 33*Real.exp L theorem exists_candidate_balanced_rough_pair_bound {c q θ : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) (hθ : 0 < θ) (J : ℕ) (hcut : θ < 2*c/(2 : ℝ)^J) (hsize : (12/5 : ℝ)*(r : ℝ)*c/(2 : ℝ)^J ≤ 1/25) (hθsmall : 10*θ ≤ 1/20) : ∃ C : ℝ, 0 < C ∧ ∃ J0 : ℕ, J ≤ J0 ∧ ∀ᶠ L : ℝ in atTop, ∀ (κ : ℝ), 0 ≤ κ → κ ≤ 1/50 → ∀ jStar : ℕ, J0 < jStar → ∀ (W : ℝ) (S : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ), 1 ≤ W → W ≤ Real.exp (θ*L) → (∀ v ∈ S, balancedPairWindow κ L v) → (∀ v ∈ S, v.1*v.2 = 2*u v+1) → (∀ v ∈ S, ∀ p ∈ primeBand 0 W, ¬p ∣ v.1*v.2) → (∑ v ∈ S, candidateCoefficient c L q r jStar (u v)) ≤ C*(κ*L+1)*candidateCoefficientWindowMass c L q r jStar * (∏ p ∈ primeBand 0 W, (1-1/(p : ℝ)))^2 := by classical obtain ⟨Cp, hCp, J0, hJJ0, hp⟩ := exists_candidate_pair_mass_bound hc hr hq0 hq1 hcenter hθ (by norm_num : (0 : ℝ) < 33) J hcut hsize hθsmall let Cd := 36/Real.log 2+18 have hCd : 0 < Cd := by dsimp [Cd]; positivity [Real.log_pos (by norm_num : (1 : ℝ) < 2)] refine ⟨Cd*(Cp+1), by positivity, J0, hJJ0, ?_⟩ filter_upwards [hp 4, eventually_power_four_le_avoidance_square hθ, eventually_gt_atTop (0 : ℝ)] with L hpair havoid hL intro κ hκ hκup jStar hj W S u hW hWup hS hv hrough let XA := candidateCoefficientWindowMass c L q r jStar let V := ∏ p ∈ primeBand 0 W, (1-1/(p : ℝ)) have hXA : 0 ≤ XA := sum_nonneg (fun n _ => candidate_coefficient_nonneg c L hq0 r jStar n) have hpos : ∀ v ∈ S, 0 < v.1 ∧ 0 < v.2 := by intro v hvs exact ⟨Nat.cast_pos.mp ((Real.exp_pos _).trans_le (hS v hvs).1), Nat.cast_pos.mp ((Real.exp_pos _).trans_le (hS v hvs).2.2.1)⟩ have hupper : ((1/2 : ℝ)+2*κ)*L ≤ (27/50 : ℝ)*L := mul_le_mul_of_nonneg_right (by linarith) hL.le have hlocal (k : ℕ × ℕ) (hk : k ∈ dyadicPairIndices S) : (∑ v ∈ dyadicPairBucket S k, candidateCoefficient c L q r jStar (u v)) ≤ (Cp+1)*XA*V^2 := by obtain ⟨v, hvs, hkm, hkn, hkprod⟩ := dyadic_pair_bucket_scales S hpos hk have hm : (2 : ℝ)^k.1 ≤ Real.exp ((27/50 : ℝ)*L) := hkm.trans ((hS v hvs).2.1.trans (Real.exp_le_exp.mpr hupper)) have hn : (2 : ℝ)^k.2 ≤ Real.exp ((27/50 : ℝ)*L) := hkn.trans ((hS v hvs).2.2.2.1.trans (Real.exp_le_exp.mpr hupper)) have harea : (2 : ℝ)^k.1 * (2 : ℝ)^k.2 ≤ 33*Real.exp L := hkprod.trans (hS v hvs).2.2.2.2.2 have hend (i : ℕ) : 2^i-1 ≤ 2^(i+1)-1 := by have hpow : (2 : ℕ)^i ≤ 2^(i+1) := Nat.pow_le_pow_right (by omega) (by omega) omega have ht := hpair jStar hj (2^k.1-1) (2^(k.1+1)-1) (2^k.2-1) (2^(k.2+1)-1) W (dyadicPairBucket S k) u (hend _) (hend _) (zero_le_one.trans hW) hWup (by simpa only [dyadic_index_side_length] using hm) (by simpa only [dyadic_index_side_length] using hn) (by simpa only [dyadic_index_side_length] using harea) (fun v hvk => hv v (mem_filter.mp hvk).1) (fun v hvk => dyadic_pair_bucket_rectangle S hpos k hvk) (fun v hvk => hrough v (mem_filter.mp hvk).1) have he := mul_le_mul_of_nonneg_left (havoid W hW hWup) hXA calc _ ≤ Cp*XA*V^2 + XA*L^(-(4 : ℝ)) := ht _ ≤ Cp*XA*V^2 + XA*V^2 := add_le_add le_rfl he _ = _ := by ring have hcount := dyadic_balanced_pair_count S hκ hL.le (fun v hvs => ⟨(hpos v hvs).1, (hpos v hvs).2, (hS v hvs).1, (hS v hvs).2.1, (hS v hvs).2.2.2.2⟩) calc _ = ∑ k ∈ dyadicPairIndices S, ∑ v ∈ dyadicPairBucket S k, candidateCoefficient c L q r jStar (u v) := (sum_dyadic_pair_buckets S _).symm _ ≤ ∑ _k ∈ dyadicPairIndices S, (Cp+1)*XA*V^2 := sum_le_sum hlocal _ = ((dyadicPairIndices S).card : ℝ)*((Cp+1)*XA*V^2) := by simp only [sum_const, nsmul_eq_mul] _ ≤ (Cd*(κ*L+1))*((Cp+1)*XA*V^2) := mul_le_mul_of_nonneg_right hcount (by positivity) _ = _ := by dsimp [Cd, XA, V]; ring end Bounty end section /- Adjacent actual fine events and their decoded targets give the required history coherence. -/ namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) (s : Fin (4 * n + 1) → FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : ∀ i, PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i.val) (s i)) (hnext : ∀ (i : ℕ) (hi : i + 1 < 4 * n + 1), s ⟨i + 1, hi⟩ = physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i) (s ⟨i, by omega⟩) (e ⟨i, by omega⟩)) (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) (ho : ∀ i : Fin (4 * n + 1), o i.val = physicalFullEventObservation C k (cut i.val) (cut (i.val + 1)) (physicalSelectedFineTag n i.val) (s i) (e i)) (ht : ∀ i : Fin (4 * n + 1), physicalBoundedMarkEncode (cut (i.val + 1)) (t i.val) = physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i.val) (s i) (e i)) include hencode hnext ho ht in theorem physical_fine_events_coherent : PhysicalFineHistoryCoherent C o t := by have hs (i : ℕ) (hi : i + 1 < 4 * n + 1) : physicalBoundedMarkEncode (cut (i + 1)) (t i) = s ⟨i + 1, hi⟩ := (ht ⟨i, by omega⟩).trans (hnext i hi).symm refine ⟨?_, ?_, ?_, ?_⟩ · intro j let i : Fin (4 * n + 1) := ⟨4 * j.val, by have := j.isLt; omega⟩ exact (ho i).trans (physical_encoded_observation_ghost C k (cut i.val) (cut (i.val + 1)) (physicalSelectedFineTag n i.val) (s i) (e i) j (physical_fine_tag_visit j)) · intro j let i : Fin (4 * n + 1) := ⟨4 * j.val + 1, by have := j.isLt; omega⟩ obtain ⟨σ, hσ, hm⟩ := physical_encoded_observation_permutation C k (cut i.val) (cut (i.val + 1)) (physicalSelectedFineTag n i.val) (s i) (e i) (physical_fine_tag_source_permutation j) (t (4 * j.val)) (t i.val) (hs (4 * j.val) (by have := j.isLt; omega)) (ht i) exact ⟨σ, (ho i).trans hσ, hm⟩ · intro j let i : Fin (4 * n + 1) := ⟨4 * j.val + 2, by have := j.isLt; omega⟩ obtain ⟨a, ha⟩ := physical_encoded_observation_edge C k (cut i.val) (cut (i.val + 1)) (physicalSelectedFineTag n i.val) (s i) (e i) j (physical_fine_tag_edge j) exact ⟨a, (ho i).trans ha⟩ · intro j let i : Fin (4 * n + 1) := ⟨4 * j.val + 3, by have := j.isLt; omega⟩ obtain ⟨κ, hκ, hm⟩ := physical_encoded_observation_permutation C k (cut i.val) (cut (i.val + 1)) (physicalSelectedFineTag n i.val) (s i) (e i) (physical_fine_tag_target_permutation j) (t (4 * j.val + 2)) (t i.val) (hs (4 * j.val + 2) (by have := j.isLt; omega)) (ht i) have htag : physicalSelectedFineTag n (4 * j.val + 4) = some (.inl j.succ) := by simpa only [Fin.val_succ, Nat.mul_add, Nat.mul_one] using physical_fine_tag_visit j.succ have hc : cut (4 * j.val + 4) = cut (4 * j.val + 5) := by simpa only [htag, PhysicalMarkRowEncoding] using hencode (4 * j.val + 4) let l : Fin (4 * n + 1) := ⟨4 * j.val + 4, by have := j.isLt; omega⟩ have hg := physical_encoded_ghost_mark_step C k (cut l.val) (cut (l.val + 1)) (physicalSelectedFineTag n l.val) (s l) (e l) j.succ htag hc (t i.val) (t l.val) (hs (4 * j.val + 3) (by have := j.isLt; omega)) (ht l) exact ⟨κ, (ho i).trans hκ, hg.trans hm⟩ end Fine end Bounty end section /- The actual physical phase and empty-memory terminal satisfy every suffix symmetry hypothesis. -/ open Finset Classical namespace Bounty end Bounty end section /- One shared pattern sequence packs the original edge and mark paths by groups. -/ open Finset open scoped Classical namespace Bounty abbrev PhysicalSplitSelectedPaths {I : Type*} {N J ell n : ℕ} (P : Fin N → Finset ℕ) (small : Fin N → Prop) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) := Σ pattern : Fin n → patterns, PhysicalGroupSelectedData (fun g : {g // small g} => P g.val) ell (fun j g => C (pattern j).val g.val) × PhysicalGroupSelectedData (fun g : {g // ¬small g} => P g.val) ell (fun j g => C (pattern j).val g.val) noncomputable def physicalPathGroupSplitEquiv {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (small : Fin N → Prop) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) : (PhysicalMarkLists P J ell × (Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell)) ≃ PhysicalSplitSelectedPaths (ell := ell) (n := n) P small patterns C := (physicalPathSelectedEquiv patterns C).trans (Equiv.sigmaCongrRight fun pattern => physicalGroupSelectedSplit small (fun j => C (pattern j).val)) noncomputable abbrev physicalGroupSelectedDataFintype {G : Type*} [Fintype G] {J ell n : ℕ} {P : G → Finset ℕ} (C : Fin n → G → Finset (Fin J)) : Fintype (PhysicalGroupSelectedData P ell C) := by letI : Fintype (PhysicalMarkLists P J ell) := inferInstance letI : Fintype (PhysicalPermutations G J ell) := inferInstance letI : ∀ j, Fintype (PhysicalAuxLabels P (C j)) := fun _ => inferInstance exact inferInstance section Sums variable {I R : Type*} [AddCommMonoid R] {N J ell n : ℕ} {P : Fin N → Finset ℕ} (small : Fin N → Prop) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) end Sums end Bounty end section /- Choose the original small-conditioning constant before the desired clean saving and every prime-family size parameter. This makes the order A, then E, then m and D explicit without a circular parameter choice. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- The high-rank tail of the actual original complex forest-masked path actions. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) end Owner end Bounty end section /- The original signed clean mixed family satisfies the analytic power bound with both big projections retained. Its exact pairing is proved from actual events; no pairing or local operator norm is assumed. The small-tail endpoint gate stays inside conditioning. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- Uniform localized absolute mass for the actual retained candidate cross-sum. -/ open Finset Filter Real namespace Bounty end Bounty end section /- Exact normalized dyadic Fourier representation of the original off-diagonal energy. -/ open Finset MeasureTheory namespace Bounty end Bounty end section /- Exact scale bounds for the finite smooth dyadic partition. -/ open Finset Filter Real namespace Bounty private theorem dyadic_ceil_power_le {x : ℝ} (hx : 1 ≤ x) : (2:ℝ)^⌈logb 2 x⌉₊ ≤ 2*x := by have hx0 : 0 < x := zero_lt_one.trans_le hx have ht : 0 ≤ logb 2 x := logb_nonneg (by norm_num) hx calc (2:ℝ)^⌈logb 2 x⌉₊ = (2:ℝ)^(⌈logb 2 x⌉₊:ℝ) := (rpow_natCast _ _).symm _ ≤ (2:ℝ)^(logb 2 x+1) := rpow_le_rpow_of_exponent_le (by norm_num) (Nat.ceil_lt_add_one ht).le _ = 2*x := by rw [rpow_add (by norm_num : (0:ℝ)<2), rpow_one, rpow_logb (by norm_num : (0:ℝ)<2) (by norm_num : (2:ℝ)≠1) hx0] ring theorem typeII_smooth_dyadic_scale_mono_zero {U V E : ℝ} (hU : 0 < U) (hV : 0 < V) (hE : 0 < E) (j : ℕ) : typeIISmoothDyadicScale U V E 0 ≤ typeIISmoothDyadicScale U V E j := by unfold typeIISmoothDyadicScale simpa only [pow_zero, mul_one] using mul_le_mul_of_nonneg_left (one_le_pow₀ (show (1:ℝ)≤2 by norm_num) : (1:ℝ)≤2^j) (show 0 ≤ U^2*V/(16*E) by positivity) theorem typeII_smooth_dyadic_scale_le {L U V E : ℝ} {j : ℕ} (hL : 1 ≤ L) (hU : 0 < U) (hV : 0 < V) (hE : 0 < E) (hj : j < typeIISmoothDyadicCount L) : typeIISmoothDyadicScale U V E j ≤ 24*U^2*V*L^88/E := by have hpow : 1 ≤ L^88 := one_le_pow₀ hL have hp := dyadic_ceil_power_le (show (1:ℝ)≤192*L^88 by linarith) have hj' : j ≤ ⌈logb 2 (192*L^88)⌉₊ := by unfold typeIISmoothDyadicCount at hj omega have hbase : 0 ≤ U^2*V/(16*E) := by positivity calc _ ≤ (U^2*V/(16*E))*((2:ℝ)^⌈logb 2 (192*L^88)⌉₊) := mul_le_mul_of_nonneg_left (pow_le_pow_right₀ (by norm_num) hj') hbase _ ≤ (U^2*V/(16*E))*(2*(192*L^88)) := mul_le_mul_of_nonneg_left hp hbase _ = 24*U^2*V*L^88/E := by field_simp; ring theorem typeII_smooth_dyadic_scale_sum_le {L U V E : ℝ} (hL : 1 ≤ L) (hU : 0 < U) (hV : 0 < V) (hE : 0 < E) : (∑ j ∈ range (typeIISmoothDyadicCount L), typeIISmoothDyadicScale U V E j) ≤ 48*U^2*V*L^88/E := by let n : ℕ := ⌈logb 2 (192*L^88)⌉₊ have hbase : 0 ≤ U^2*V/(16*E) := by positivity have hn : n < typeIISmoothDyadicCount L := Nat.lt_succ_self n calc _ = (U^2*V/(16*E))*((2:ℝ)^(n+1)-1) := by simp only [typeIISmoothDyadicScale, ← mul_sum, typeIISmoothDyadicCount] rw [geom_sum_eq (by norm_num : (2:ℝ)≠1)] norm_num [n] _ ≤ (U^2*V/(16*E))*(2*(2:ℝ)^n) := mul_le_mul_of_nonneg_left (by rw [pow_succ]; linarith) hbase _ = 2*typeIISmoothDyadicScale U V E n := by unfold typeIISmoothDyadicScale; ring _ ≤ 2*(24*U^2*V*L^88/E) := mul_le_mul_of_nonneg_left (typeII_smooth_dyadic_scale_le hL hU hV hE hn) (by norm_num) _ = 48*U^2*V*L^88/E := by ring end Bounty end section /- The full-box B0 identity feeds directly into the actual smooth Cauchy energy. -/ open Finset namespace Bounty theorem candidate_retained_box_smooth_cauchy (c L : ℝ) (r jStar : ℕ) (P M N : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (E ν R U V AE AN : ℝ) (α β : ℕ → ℂ) (hL : 0 < L) (hE : 0 < E) (hU : 0 < U) (hV : 0 < V) (hP : ∀ p ∈ P, 0 < p) (hM : ∀ m ∈ M, (m:ℝ) ≤ 2*U) (hN : ∀ n ∈ N, V ≤ (n:ℝ) ∧ (n:ℝ) ≤ 2*V) (hR : 2*U*V ≤ R*Real.exp L) (hα : ∀ m, m ∉ M → α m=0) (hβ : ∀ n, n ∉ N → β n=0) (haE : ∀ e ∈ candidateB0TakenSupport c L r jStar take E, ‖candidateB0TakenCoefficient c L r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) ν e‖ ≤ AE) (hβbound : ∀ n ∈ N, ‖β n‖ ≤ AN) : let H := candidateRetainedAllocationSupport c L r jStar P take let aH := candidateB0RetainedCoefficient c L (1/2) r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) ν let EF := Icc ⌈E/(2*L^88)⌉₊ ⌊2*E⌋₊ let NF := Icc ⌈V/2⌉₊ ⌊3*V⌋₊ let η := fun e n : ℕ => typeIIEMajorant (L^88) ((e:ℝ)/E) * typeIINMajorant ((n:ℝ)/V) ‖candidateRetainedAllocationIntegrand c L (1/2) r jStar (Real.log E) P take (candidateBoxFiniteTest L E (Icc 1 ⌊R*Real.exp L⌋₊) (fun u => typeIIMellinPhase ν u * ∑ m ∈ (2*u+1).divisors, α m*β ((2*u+1)/m))) ξ‖^2 ≤ ‖activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ‖^2 * ((2*E*V*AE^2*AN^2) * (typeIIDiagonalEnergy EF NF M H η α aH + typeIIOffDiagonalEnergy EF NF M H η α aH)) := by dsimp only rw [candidate_retained_box_typeII c L (1/2) r jStar P M N take ξ E ν R U V α β hP hU.le hV.le hM (fun n hn => (hN n hn).2) hR hα hβ, norm_mul, norm_mul, candidate_allocation_fourier_scalar_norm, one_mul, mul_pow] have hc := typeII_actual_smooth_cauchy (candidateB0TakenSupport c L r jStar take E) N M (candidateRetainedAllocationSupport c L r jStar P take) (candidateB0TakenCoefficient c L r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) ν) β α (candidateB0RetainedCoefficient c L (1/2) r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) ν) hL hE hV (fun e he => (mem_filter.mp he).2) hN haE hβbound exact (mul_le_mul_of_nonneg_right hc (sq_nonneg _)).trans_eq (mul_comm _ _) end Bounty end section /- Uniform Lyapunov rows for an original owner, paying one common atom bound per selected child. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) theorem full_mixed_common_owner_stage_row_le (hω : ∀ k c a, 0 ≤ ω k c a) (hωmass : ∀ k c, ∑ a, ω k c a ≤ 1) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (hη : ∀ g, 0 ≤ η g) (hμatom : ∀ g p, μ g p ≤ η g) (hghostAtom : ∀ j g, (|(1 - q j) * V g / ρ| * η g) * v ≤ β) (hedgeAtom : ∀ g, η g ≤ β) (hq0 : ∀ j, 0 ≤ q j) (hq1 : ∀ j, q j ≤ 1) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : ∀ g, vmin ≤ V g) (hD : ∀ j, q j / ρ ^ 2 + ((1 - q j) / ρ) / v ≤ 1) (T : ℕ) (ht : ∀ k g, (S k g)ᶜ.card ≤ T) (u : Fin steps.length) (tag : Option (J ⊕ K)) (htag : steps.get u = tag) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : let _ : ∀ (tag : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D tag s) := fullPermutationMixedEventFintype n S B A Δ D (∑ e : FullPermutationMixedEvent n S B A Δ D tag s, |fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V tag s e| * fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val tag s e history * productLengthLyapunov v (fullPermutationMixedEventTarget n S B A Δ D tag s e)) ≤ (β ^ (∑ g, fullMixedCommonSelectedCount M B steps code u g) * fullMixedLengthRowFactor μ q ρ v vmin V T tag) * productLengthLyapunov v s := by let _ : ∀ (tag : Option (J ⊕ K)) s, Fintype (FullPermutationMixedEvent n S B A Δ D tag s) := fullPermutationMixedEventFintype n S B A Δ D have hv0 := (zero_lt_one.trans hv).le have hH := productLengthLyapunov_nonneg hv0 s cases tag with | none => simp_rw [full_mixed_common_forest_history_gain_none n S B A Δ D steps code u htag, mul_one] simp only [full_mixed_common_none_selected_count B steps code u htag, sum_const_zero, pow_zero, one_mul] exact full_permutation_mixed_length_row_le n S B A Δ D ω μ q ρ v vmin V hω hωmass hμ hmass hq0 hq1 hρ0 hρ1 hv hvmin hV hD T ht none s | some tag => cases tag with | inl j => have hb := full_mixed_common_ghost_original_stage_le n S B A Δ D ω μ q ρ v V steps u s history code j htag η hη hμ hμatom (zero_lt_one.trans hv) (hq0 j) (hq1 j) hρ0 (hD j) have hp := finite_prod_pow_le_common_power (fun g => (|(1 - q j) * V g / ρ| * η g) * v) (fullMixedCommonSelectedCount M B steps code u) β (fun g => mul_nonneg (mul_nonneg (abs_nonneg _) (hη g)) hv0) (hghostAtom j) exact hb.trans (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hp (prod_nonneg fun _ _ => (Real.exp_pos _).le)) hH) | inr k => have hb := full_mixed_common_edge_original_stage_le n S B A Δ D ω μ q ρ v V steps u s history code k htag η hη hμ hμatom hv (hω k) (hωmass k) vmin hρ0 hρ1 hvmin hV hmass T (ht k) have hp := finite_prod_pow_le_common_power η (fullMixedCommonSelectedCount M B steps code u) β hη hedgeAtom have hh := hb.trans (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hp hH) (pow_nonneg (unrestricted_edge_row_bound_nonneg hρ1 hv0 T) N)) simpa only [fullMixedLengthRowFactor, Fintype.card_fin, mul_assoc, mul_left_comm, mul_comm] using hh end Owner end Bounty end section /- The original memory coefficient and complete selected history agree, including zero rows. -/ open Finset open scoped Classical namespace Bounty section Coefficient variable {I : Type*} {N J ell r : ℕ} {P : Fin N → Finset ℕ} (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (pattern : Fin (r + 1) → patterns) (d : PhysicalSelectedData P ell (fun j => C (pattern j).val)) variable [∀ g, ∀ p : ↥(P g), NeZero p.val] end Coefficient end Bounty end section /- Enlarging the finite P range preserves each original spatially supported integrand. -/ open Finset Filter namespace Bounty theorem candidate_small_P_set_mono (c L : ℝ) {X Y : ℝ} (hXY : X ≤ Y) : candidateSmallPSet c L X ⊆ candidateSmallPSet c L Y := by intro p hp obtain ⟨hpX,hpool⟩ := (mem_candidateSmallPSet_iff c L X p).mp hp exact (mem_candidateSmallPSet_iff c L Y p).mpr ⟨hpX.trans_le hXY,hpool⟩ theorem candidate_full_P_finite_test_enlarge (c L q : ℝ) (r jStar : ℕ) (R E X Y : ℝ) (S : Finset ℕ) (G : ℕ → ℂ) (hXY : X ≤ Y) (hS : ∀ u ∈ S, (u : ℝ) ≤ X) (take : Fin ((candidateQIndices c L).card*r) → Bool) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) : candidateFullPAllocationIntegrand c L q r jStar R (candidateSmallPSet c L (X+1)) take (candidateBoxFiniteTest L E S G) ξ = candidateFullPAllocationIntegrand c L q r jStar R (candidateSmallPSet c L (Y+1)) take (candidateBoxFiniteTest L E S G) ξ := by classical unfold candidateFullPAllocationIntegrand apply sum_subset (candidate_small_P_set_mono c L (by linarith : X+1 ≤ Y+1)) intro p hpY hpX have hpnot : ¬ (p : ℝ) < X+1 := by intro hh exact hpX ((mem_candidateSmallPSet_iff c L (X+1) p).mpr ⟨hh,((mem_candidateSmallPSet_iff c L (Y+1) p).mp hpY).2⟩) have hp : X < (p : ℝ) := by linarith [le_of_not_gt hpnot] rw [candidate_separated_finite_test_large_P c L r jStar R E X S G hS take p hp ξ,mul_zero] theorem eventually_candidate_retained_finite_test_enlarge {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (R E X Y : ℝ) (S : Finset ℕ) (G : ℕ → ℂ), X ≤ Y → (∀ u ∈ S, (u : ℝ) ≤ X) → ∀ (take : Fin ((candidateQIndices c L).card*r) → Bool) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ), candidateRetainedAllocationIntegrand c L q r jStar R (candidateSmallPSet c L (X+1)) take (candidateBoxFiniteTest L E S G) ξ = candidateRetainedAllocationIntegrand c L q r jStar R (candidateSmallPSet c L (Y+1)) take (candidateBoxFiniteTest L E S G) ξ := by filter_upwards [eventually_candidate_retained_allocation_integrand_eq hc] with L heq intro q r jStar R E X Y S G hXY hS take ξ rw [← heq q r jStar R (candidateSmallPSet c L (X+1)) take (fun p hp => ((mem_candidateSmallPSet_iff c L (X+1) p).mp hp).2) _ ξ, ← heq q r jStar R (candidateSmallPSet c L (Y+1)) take (fun p hp => ((mem_candidateSmallPSet_iff c L (Y+1) p).mp hp).2) _ ξ] exact candidate_full_P_finite_test_enlarge c L q r jStar R E X Y S G hXY hS take ξ end Bounty end section /- Saturation of the finite pool cutoff on an explicitly bounded spatial window. -/ open Finset namespace Bounty theorem candidate_pool_part_mem_small_P_set (c L X : ℝ) {n : ℕ} (hn : 0 < n) (hX : (n : ℝ) < X) : primePoolPart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) n ∈ candidateSmallPSet c L X := by apply (mem_candidateSmallPSet_iff c L X _).mpr refine ⟨lt_of_le_of_lt ?_ hX, primePoolPart_mem_factoredNumbers _ _⟩ exact_mod_cast Nat.le_of_dvd hn (primePoolPart_dvd _ n) theorem candidate_retained_cutoff_weight_eq_of_lt (c L q X : ℝ) {n : ℕ} (hn : 0 < n) (hX : (n : ℝ) < X) : candidateRetainedCutoffWeight c L q (candidateSmallPSet c L X) n = markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p : ℝ)) (fun _ => 1) (n : ℤ) := by exact if_pos (candidate_pool_part_mem_small_P_set c L X hn hX) theorem active_cross_endpoints_lt_cutoff {Z X : ℝ} {k : ℤ} {Zs : Finset ℕ} {z : ℕ} (hz : z ∈ typeIIActiveCrossZ Z k Zs) (hk : |(k : ℝ)| ≤ Z) (hX : 3*Z < X) : (z : ℝ) < X ∧ (((z : ℤ)+k).toNat : ℝ) < X := by obtain ⟨_, hz0, hw0, hzZ⟩ := mem_filter.mp hz have hZ : 0 < Z := by have : (0 : ℝ) < z := by exact_mod_cast hz0 linarith have hw : (((z : ℤ)+k).toNat : ℝ) = (z : ℝ)+(k : ℝ) := by exact_mod_cast Int.toNat_of_nonneg hw0.le rw [hw] constructor · linarith · have := le_abs_self (k : ℝ) linarith end Bounty end section /- The literal four-factor integral: representations, energies, and global bounds are proved. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- The actual common birth-forest phases compose with the original mixed residual and preserve pending-memory symmetry under both slot averages. -/ open Finset Classical namespace Bounty section Action variable {I K S : Type} [Fintype S] [DecidableEq S] {N J ell B : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} [∀ g (p : P g), NeZero p.val] (steps : List (Option (I ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B steps))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) (i : Fin steps.length) (tag : K) (hi : steps.get i = some (.inr tag)) end Action end Bounty end section /- The actual full-prime-pair approximation error, summed with the original harmonic weight and invariant endpoint functions. -/ open Finset open scoped Classical namespace Bounty theorem physical_prime_harmonic_pair_error {G : Type*} [Fintype G] [dG : DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) {v : ℝ} (hv : 0 < v) (hV : ∀ g, v ≤ V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) {Pmin ε : ℝ} (hPmin : 0 < Pmin) (hε : 0 ≤ ε) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ n, ‖γ n‖ ≤ C) (hα' : ∀ m, ‖α' m‖ ≤ A) (hβ' : ∀ p, ‖β' p‖ ≤ B) (hγ' : ∀ n, ‖γ' n‖ ≤ C) (S : Finset ℤ) (δ : ℤ) (N : ℕ) (hS : ∀ n ∈ S, 0 ≤ n ∧ n ≤ (N : ℤ)) (hS' : ∀ n ∈ S, 0 < n+δ ∧ n+δ ≤ (N : ℤ)) {Y K : ℝ} (hY : 0 < Y) (hK : 0 ≤ K) (hYlow : ∀ n ∈ S, Y ≤ (n : ℝ)) (θ : ℤ → ℂ) (hθ : ∀ n ∈ S, ‖θ n‖ ≤ K) (herror : ∀ n ∈ S, let cut := repeatedBigPrimePatternCut probes r t i let H := repeatedBigPrimePatternBound probes r t Q ξ i (∑ g, (J - (cut g).card : ℕ) * (Real.log n.natAbs / Real.log 2 + Real.log (n+δ).natAbs / Real.log 2 + J) / (V g * Pmin)) * (H + H / (1/2 : ℝ) ^ (2 * ∑ g : G, (J - (cut g).card))) ≤ ε) : let M := (markedDivisorBound (1/2) v (ell+J)) ^ Fintype.card G ‖∑ n ∈ S, (θ n / (n : ℂ)) * star (invariantTripleEndpoint pool α β γ n.natAbs) * invariantTripleEndpoint pool α' β' γ' (n+δ).natAbs * physicalPrimePairError P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs‖ ≤ (K * M * M * ε / Y) * ((A*B*C)^2 * (N : ℝ) * (1+Real.log N)^15) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) let cut := repeatedBigPrimePatternCut probes r t i let marks := fun g => ell + (cut g).card let W := fun n : ℤ => markedDivisorWeight univ P (1/2) V marks n let M := (markedDivisorBound (1/2) v (ell+J)) ^ Fintype.card G have hV0 : ∀ g, 0 < V g := fun g => hv.trans_le (hV g) have hmarks : ∀ g, marks g ≤ ell+J := by intro g apply Nat.add_le_add_left exact (card_le_card (subset_univ (cut g))).trans_eq (by simp) have hW (n : ℤ) : 0 ≤ W n ∧ W n ≤ M := by refine ⟨marked_divisor_weight_nonneg univ P (by norm_num) V marks (fun g _ => (hV0 g).le) n, ?_⟩ simpa only [card_univ] using marked_divisor_weight_le_pow univ P (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) < 1) hv V marks (ell+J) (fun g _ => hV g) (fun g _ => hmarks g) n have hM : 0 ≤ M := pow_nonneg (zero_le_one.trans (one_le_markedDivisorBound (1/2) v (ell+J))) _ apply invariant_harmonic_pair_error pool α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' S δ N hS (fun n hn => ⟨(hS' n hn).1.le, (hS' n hn).2⟩) hY hK hM hM hε hYlow θ (fun n => physicalPrimePairError P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs) (fun n => W n.natAbs) (fun n => W (n+δ).natAbs) hθ (fun n _ => hW n.natAbs) (fun n _ => hW (n+δ).natAbs) intro n hn have hn0 : (0 : ℤ) < n := by exact_mod_cast hY.trans_le (hYlow n hn) exact physical_prime_pair_error_bound P V probes hprime hdis hV0 hMass r t hrt Q h ξ hξ i aux a b (Int.natAbs_pos.mpr (ne_of_gt hn0)) (Int.natAbs_pos.mpr (ne_of_gt (hS' n hn).1)) hPmin hp (herror n hn) end Bounty end section /- The exact pair formula uses coverage only for its actual auxiliary labels. -/ open Finset open scoped Classical namespace Bounty theorem physical_fixed_root_full_pair_on_fixed_support {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (C : G → Finset (Fin J)) (q a b : ℝ) (k : ℤ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (aux : PhysicalAuxLabels P C) (positions S : Finset ℤ) (hclosure : physicalFixedAuxPositionClosure P C ell k aux S ⊆ positions) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) (hf : ∀ (L : PhysicalMarkLists P J ell) w, f ((physicalSharedFactor C L : ℤ) * w) = f w) (hg : ∀ (L : PhysicalMarkLists P J ell) w, g ((physicalSharedFactor C L : ℤ) * w) = g w) (hsupport : ∀ w : ℤ, Ψ ((w : ℝ) / (Z * physicalFreeFactor C aux)) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (f w) * g (w + k * (physicalFreeFactor C aux : ℕ)) ≠ 0 → w ∈ S) : physicalFixedRootCorrelation V C q (-(a+b)) k K aux positions (fun n => physicalPhase (-a) n.natAbs * f n) (fun n => physicalPhase b n.natAbs * g n) Ψ Z = (physicalAuxMass V C aux : ℂ) * ∑ w ∈ S, (Ψ ((w : ℝ) / (Z * physicalFreeFactor C aux)) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (f w) * g (w + k * (physicalFreeFactor C aux : ℕ))) * physicalFullPairCorrelation P C V q w.natAbs (w + k * (physicalFreeFactor C aux : ℕ)).natAbs (physicalPhasedPairCoefficient C K aux a b w.natAbs (w + k * (physicalFreeFactor C aux : ℕ)).natAbs) := by let W := S ∪ physicalQuotientPositions P C ell positions have hW : ∀ L : PhysicalMarkLists P J ell, ∀ n ∈ positions, n / physicalSharedFactor C L ∈ W := fun L n hn => mem_union_right _ (physical_mem_quotient_positions P C positions L hn) have hc : ∀ w ∈ W, Ψ ((w : ℝ) / (Z * physicalFreeFactor C aux)) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (f w) * g (w + k * (physicalFreeFactor C aux : ℕ)) ≠ 0 → ∀ L : PhysicalMarkLists P J ell, (physicalSharedFactor C L : ℤ) * w ∈ positions ∧ (physicalSharedFactor C L : ℤ) * (w + k * (physicalFreeFactor C aux : ℕ)) ∈ positions := by intro w _ hw L exact (physical_fixed_aux_closure_subset_iff P C k aux S positions).mp hclosure L w (hsupport w hw) rw [physical_fixed_root_full_pair_of_coverage hdis hprime V C q a b k K aux positions W hW f g Ψ Z hf hg hc] congr 1 symm apply sum_subset (subset_union_left (s₁ := S) (s₂ := physicalQuotientPositions P C ell positions)) intro w _ hw have hz : Ψ ((w : ℝ) / (Z * physicalFreeFactor C aux)) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (f w) * g (w + k * (physicalFreeFactor C aux : ℕ)) = 0 := by by_contra hn exact hw (hsupport w hn) rw [hz, zero_mul] end Bounty end section /- Concrete support parameters for the original invariant harmonic error estimate. -/ open Finset namespace Bounty theorem harmonic_positive_error_parameters {Z : ℝ} (hZ : 0 < Z) (k : ℤ) {d : ℕ} (hd : 0 < d) (hk : |(k : ℝ)| ≤ Z) : 0 < Z*(d : ℝ)/2 ∧ ∀ w ∈ harmonicPositiveSupport Z k d, (0 ≤ w ∧ w ≤ (⌈3*Z*(d : ℝ)⌉₊ : ℤ)) ∧ (0 < w+k*(d : ℤ) ∧ w+k*(d : ℤ) ≤ (⌈3*Z*(d : ℝ)⌉₊ : ℤ)) ∧ Z*(d : ℝ)/2 ≤ (w : ℝ) ∧ ‖(typeIIHarmonicDyadic ((w : ℝ)/(Z*(d : ℝ))) : ℂ)‖ ≤ 2 := by have hZd : 0 < Z*(d : ℝ) := mul_pos hZ (by exact_mod_cast hd) refine ⟨half_pos hZd, ?_⟩ intro w hw have hs := mem_harmonic_positive_support hw have hwN : (w : ℝ) ≤ (⌈3*Z*(d : ℝ)⌉₊ : ℝ) := by calc _ ≤ 2*Z*(d : ℝ) := hs.2.2.1 _ ≤ 3*Z*(d : ℝ) := by nlinarith _ ≤ _ := Nat.le_ceil _ have htN : ((w+k*(d : ℤ) : ℤ) : ℝ) ≤ (⌈3*Z*(d : ℝ)⌉₊ : ℝ) := (Int.le_floor.mp (harmonic_positive_support_upper_shift k hk hw)).trans (Nat.le_ceil _) refine ⟨⟨hs.1.le, by exact_mod_cast hwN⟩, ⟨hs.2.2.2, by exact_mod_cast htN⟩, hs.2.1.le, ?_⟩ rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (typeII_harmonic_dyadic_bounds _).1] exact (typeII_harmonic_dyadic_bounds _).2 end Bounty end section /- A uniform bound for the actual marked weights at any retained cut. -/ open Finset open scoped Classical namespace Bounty theorem physical_marked_weight_bound {G : Type*} [Fintype G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (cut : G → Finset (Fin J)) {v : ℝ} (hv : 0 < v) (hV : ∀ g, v ≤ V g) (n : ℤ) : let W := markedDivisorWeight univ P (1/2) V (fun g => ell + (cut g).card) n 0 ≤ W ∧ W ≤ (markedDivisorBound (1/2) v (ell+J)) ^ Fintype.card G := by refine ⟨marked_divisor_weight_nonneg univ P (by norm_num) V _ (fun g _ => (hv.trans_le (hV g)).le) n, ?_⟩ have hmarks : ∀ g, ell + (cut g).card ≤ ell+J := by intro g apply Nat.add_le_add_left exact (card_le_card (subset_univ (cut g))).trans_eq (by simp) simpa only [card_univ] using marked_divisor_weight_le_pow univ P (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) < 1) hv V (fun g => ell + (cut g).card) (ell+J) (fun g _ => hV g) (fun g _ => hmarks g) n end Bounty end section /- Exact decomposition of the original full prime pair into the unrestricted marked pair and the two checked error terms. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] [sharedInstance2 : DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) include G sharedInstance1 sharedInstance2 J ell P V probes r t hrt Q h ξ i aux a b theorem physical_prime_pair_decomposition (w z : ℕ) : let cut := repeatedBigPrimePatternCut probes r t i let marks := fun g => ell + (cut g).card let W := fun n : ℤ => markedDivisorWeight univ P (1/2) V marks n physicalFullPairCorrelation P cut V (1/2) w z (physicalOriginalPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z) = physicalPrimePairError P V probes r t hrt Q h ξ i aux a b w z + ((W w * W z : ℝ) : ℂ) * physicalFreePrimePairError P V probes r t hrt Q h ξ i aux a b w z + ((W w * W z : ℝ) : ℂ) * groupMarkedAverage P marks (w : ℤ) (fun u => groupMarkedAverage P marks (z : ℤ) (physicalFreePrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w z u)) := by unfold physicalPrimePairError physicalFreePrimePairError dsimp only push_cast ring theorem physical_prime_harmonic_decomposition (S : Finset ℤ) (δ : ℤ) (F : ℤ → ℂ) : let cut := repeatedBigPrimePatternCut probes r t i let marks := fun g => ell + (cut g).card let W := fun n : ℤ => markedDivisorWeight univ P (1/2) V marks n (∑ n ∈ S, F n * physicalFullPairCorrelation P cut V (1/2) n.natAbs (n+δ).natAbs (physicalOriginalPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs)) - (∑ n ∈ S, F n * ((W n.natAbs * W (n+δ).natAbs : ℝ) : ℂ) * groupMarkedAverage P marks (n.natAbs : ℤ) (fun u => groupMarkedAverage P marks ((n+δ).natAbs : ℤ) (physicalFreePrimePairCoefficient P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs u))) = (∑ n ∈ S, F n * physicalPrimePairError P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs) + (∑ n ∈ S, F n * ((W n.natAbs * W (n+δ).natAbs : ℝ) : ℂ) * physicalFreePrimePairError P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs) := by dsimp only rw [← sum_sub_distrib, ← sum_add_distrib] apply sum_congr rfl intro n _ rw [physical_prime_pair_decomposition] ring end end Bounty end section /- The logarithmic Fourier transform of the literal original harmonic dyadic cutoff. -/ open MeasureTheory open scoped FourierTransform ContDiff namespace Bounty noncomputable def harmonicLogCutoff (u : ℝ) : ℝ := typeIIHarmonicDyadic (Real.exp u) theorem harmonic_log_cutoff_contDiff : ContDiff ℝ ∞ harmonicLogCutoff := typeII_harmonic_dyadic_contDiff.comp Real.contDiff_exp theorem harmonic_log_cutoff_support {u : ℝ} (h : harmonicLogCutoff u ≠ 0) : u ∈ Set.Icc (-1) 1 := by have hs : typeIISmoothDyadic (Real.exp u) ≠ 0 := by intro hz exact h (by simp only [harmonicLogCutoff, typeIIHarmonicDyadic, hz, mul_zero]) simpa only [Real.log_exp] using typeII_smooth_dyadic_log_box hs theorem harmonic_log_cutoff_hasCompactSupport : HasCompactSupport harmonicLogCutoff := by apply HasCompactSupport.intro isCompact_Icc intro u hu by_contra hn exact hu (harmonic_log_cutoff_support hn) noncomputable def harmonicLogSchwartz : SchwartzMap ℝ ℂ := (harmonic_log_cutoff_hasCompactSupport.comp_left (g := fun x : ℝ => (x : ℂ)) (by simp)).toSchwartzMap (Complex.ofRealCLM.contDiff.comp harmonic_log_cutoff_contDiff) noncomputable def harmonicLogFourier : SchwartzMap ℝ ℂ := 𝓕 harmonicLogSchwartz theorem harmonic_log_fourier_integrable : Integrable harmonicLogFourier := harmonicLogFourier.integrable theorem harmonic_log_fourier_inversion (u : ℝ) : (harmonicLogCutoff u : ℂ) = ∫ v : ℝ, Complex.exp ((2*Real.pi*v*u : ℝ)*Complex.I)*harmonicLogFourier v := by have hi := congrArg (fun f : SchwartzMap ℝ ℂ => f u) (FourierPair.fourierInv_fourier_eq (E := SchwartzMap ℝ ℂ) (F := SchwartzMap ℝ ℂ) harmonicLogSchwartz) rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq'] at hi change (∫ v : ℝ, Complex.exp ((2*Real.pi*inner ℝ v u : ℝ)*Complex.I) • harmonicLogFourier v) = (harmonicLogCutoff u : ℂ) at hi rw [← hi] apply integral_congr_ae filter_upwards [] with v simp only [RCLike.inner_apply, starRingEnd_apply, star_trivial, smul_eq_mul] congr 2 push_cast ring theorem harmonic_log_fourier_rapid_tail (M : ℕ) : ∃ C : ℝ, 0 < C ∧ ∀ R : ℝ, 1 ≤ R → (∫ v in {v : ℝ | R < ‖v‖}, ‖harmonicLogFourier v‖) ≤ C*R^(-(M : ℝ)) := schwartz_norm_rapid_tail harmonicLogFourier M end Bounty end section /- Common positive endpoint windows for two fixed logarithmic cells. -/ namespace Bounty noncomputable def harmonicCellProductScale (h : ℝ) (i j : ℤ) : ℝ := Real.exp (((i : ℝ) - 1) * h) * Real.exp (((j : ℝ) - 1) * h) theorem harmonic_cell_product_scale_pos (h : ℝ) (i j : ℤ) : 0 < harmonicCellProductScale h i j := by unfold harmonicCellProductScale positivity theorem harmonic_cell_product_bounds {h : ℝ} (hh : 0 < h) (hh1 : h ≤ 1) {D_A D_B : ℕ} (hA : 0 < D_A) (hB : 0 < D_B) {i j : ℤ} (hcA : upperLogCell h (Real.log D_A) = i) (hcB : upperLogCell h (Real.log D_B) = j) : harmonicCellProductScale h i j < (D_A * D_B : ℕ) ∧ ((D_A * D_B : ℕ) : ℝ) ≤ Real.exp 2 * harmonicCellProductScale h i j := by obtain ⟨hAl, hAu⟩ := (upper_log_cell_nat_eq_iff hh hA i).mp hcA obtain ⟨hBl, hBu⟩ := (upper_log_cell_nat_eq_iff hh hB j).mp hcB have hAe : 0 < Real.exp (((i : ℝ) - 1) * h) := Real.exp_pos _ have hBr : (0 : ℝ) < D_B := by exact_mod_cast hB constructor · rw [Nat.cast_mul] unfold harmonicCellProductScale exact (mul_lt_mul_of_pos_left hBl hAe).trans (mul_lt_mul_of_pos_right hAl hBr) · have hu : (D_A : ℝ) * (D_B : ℝ) ≤ Real.exp ((i : ℝ) * h) * Real.exp ((j : ℝ) * h) := mul_le_mul hAu hBu (Nat.cast_nonneg _) (Real.exp_pos _).le have he : Real.exp ((i : ℝ) * h) * Real.exp ((j : ℝ) * h) = Real.exp (2 * h) * harmonicCellProductScale h i j := by unfold harmonicCellProductScale simp only [← Real.exp_add] congr 1 ring rw [Nat.cast_mul] apply hu.trans rw [he] exact mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr (by linarith)) (harmonic_cell_product_scale_pos h i j).le theorem harmonic_common_window_of_scale {Z H : ℝ} (hZ : 0 < Z) (hH : 0 < H) {d : ℕ} (hHd : H ≤ (d : ℝ)) (hdH : (d : ℝ) ≤ Real.exp 2 * H) {k w : ℤ} (hk : |(k : ℝ)| ≤ Z / 4) (hψ : typeIIHarmonicDyadic ((w : ℝ) / (Z * (d : ℝ))) ≠ 0) : (w : ℝ) ∈ Set.Ioo (Z * H / 4) (3 * Real.exp 2 * (Z * H)) ∧ ((w + k * (d : ℤ) : ℤ) : ℝ) ∈ Set.Ioo (Z * H / 4) (3 * Real.exp 2 * (Z * H)) := by have hd : (0 : ℝ) < d := hH.trans_le hHd have hZd : 0 < Z * (d : ℝ) := mul_pos hZ hd have hs := typeII_harmonic_dyadic_support hψ have hwlo := (lt_div_iff₀ hZd).mp hs.1 have hwhi := (div_lt_iff₀ hZd).mp hs.2 have hYd : Z * H ≤ Z * (d : ℝ) := mul_le_mul_of_nonneg_left hHd hZ.le have hdY : Z * (d : ℝ) ≤ Real.exp 2 * (Z * H) := by nlinarith [mul_le_mul_of_nonneg_left hdH hZ.le] have hY : 0 < Z * H := mul_pos hZ hH have hEY : 0 < Real.exp 2 * (Z * H) := mul_pos (Real.exp_pos _) hY have hkl := mul_le_mul_of_nonneg_right (abs_le.mp hk).1 hd.le have hku := mul_le_mul_of_nonneg_right (abs_le.mp hk).2 hd.le constructor · constructor <;> nlinarith · push_cast constructor <;> nlinarith end Bounty end section /- The actual weighted sum of selected physical histories satisfies the same energy bound. -/ open Finset namespace Bounty section Energy variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) end Energy end Bounty end section /- The exact new-mark count for original finite paths with compatible residues. -/ open Finset namespace Bounty section Counts variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (hscalar : physicalFiniteReturnScalar V patterns C ζ k K n L p ≠ 0) (r : PhysicalResidues P) (hr : physicalFinitePathResidueCompatible C k n r L p) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin (n + 1), ∀ g s, ¬ (((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc g s).val : ℤ) ∣ physicalPathSelectedMultiplier C k p j) include hscalar hr hP hdis hk theorem physical_finite_path_selected_new_marks (j : Fin (n + 1)) (g : Fin N) : (physicalGroupMarks ((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.succ) g \ physicalGroupMarks ((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc) g).card = ell + (C ((physicalPathSelectedEquiv patterns C (L, p)).1 j).val g).card := by have hcompat := physical_group_residue_path_compatibility (fun j => C ((physicalPathSelectedEquiv patterns C (L, p)).1 j).val) (physicalPathSelectedEquiv patterns C (L, p)).2.1 (physicalPathSelectedMultiplier C k p) (physicalPathSelectedEquiv patterns C (L, p)).2.2.1 (physicalPathSelectedOffset C k L p) (physicalPathSelectedEquiv patterns C (L, p)).2.2.2.1 (physicalPathSelectedEquiv patterns C (L, p)).2.2.2.2 (physical_path_selected_offset_step C k L p) r (physical_path_selected_marks_of_compatible C k L p r hr) j have hc := physical_bare_group_new_marks_card (C ((physicalPathSelectedEquiv patterns C (L, p)).1 j).val) ((physicalPathSelectedEquiv patterns C (L, p)).2.1 j) (physicalPathSelectedMultiplier C k p j) (physicalPermuteLabels ((physicalPathSelectedEquiv patterns C (L, p)).2.2.2.1 j) ((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc)) (physicalPermuteLabels ((physicalPathSelectedEquiv patterns C (L, p)).2.2.2.2 j) ((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.succ)) (physical_finite_return_scalar_selected_lists V patterns C ζ k K L p hscalar j) hP hdis hcompat g (fun s => hk j g (((physicalPathSelectedEquiv patterns C (L, p)).2.2.2.1 j) g s)) simpa only [physical_group_marks_permute] using hc theorem physical_finite_path_new_marks : ∀ j < n + 1, ∀ g, (physicalGroupMarks (finitePathMarks L p (j + 1)) g \ physicalGroupMarks (finitePathMarks L p j) g).card = ell + (C (finitePathLabels p j).2.2.1.val g).card := by intro j hj g have hc := physical_finite_path_selected_new_marks V patterns C ζ k K L p hscalar r hr hP hdis hk ⟨j, hj⟩ g rw [physical_path_selected_marks_eq_finite_path] at hc have ha : finitePathLabels p j = (p ⟨j, hj⟩).1 := by simp only [finitePathLabels, dif_pos hj] simpa only [Fin.val_succ, Fin.val_castSucc, ha, physical_path_selected_patterns] using hc end Counts end Bounty end section /- Coherent decoded chronological records have an exhaustive coefficient selection. -/ open Finset open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) [Fintype (PhysicalSelectedData P ell C)] (cut : ℕ → Fin N → Finset (Fin J)) (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (hlen : r.length = 4 * n + 1) (ho : ∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.1 = o i) (ht : ∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.2 = physicalBoundedMarkEncode (cut (i + 1)) (t i)) include hlen ho ht omit [Fintype (PhysicalSelectedData P ell C)] in theorem physical_selected_record_iff_decoded (d : PhysicalSelectedData P ell C) : physicalSelectedDataRecordTest C cut d r ↔ physicalSelectedDataTest C d o t := by constructor · intro h i hi have hir : i < r.length := by omega have hil : i < (List.range (4 * n + 1)).length := by simpa using hi have hh := h.get hil hir simp only [List.get_eq_getElem, List.getElem_range] at hh change physicalSelectedFineEncodedTest C d.1 d.2.1 d.2.2.1 d.2.2.2 cut i (r.get ⟨i, hir⟩).2.1 (r.get ⟨i, hir⟩).2.2 at hh rw [ho i hir, ht i hir] at hh exact (physical_selected_fine_encoded_test_iff C _ _ _ _ cut i _ _).mp hh · intro h apply List.forall₂_of_length_eq_of_get · simpa only [List.length_range] using hlen.symm · intro i hi hir have hin : i < 4 * n + 1 := by simpa using hi simp only [List.get_eq_getElem, List.getElem_range] change physicalSelectedFineEncodedTest C d.1 d.2.1 d.2.2.1 d.2.2.2 cut i (r.get ⟨i, hir⟩).2.1 (r.get ⟨i, hir⟩).2.2 rw [ho i hir, ht i hir] exact (physical_selected_fine_encoded_test_iff C _ _ _ _ cut i _ _).mpr (h i hin) end Fine end Bounty end section /- The normalized balanced rough-pair bound with all microscopic choices discharged. -/ open Finset Filter open scoped Topology namespace Bounty theorem exists_candidate_balanced_normalized_pair_bound {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) : ∃ C : ℝ, 0 < C ∧ ∃ J0 : ℕ, ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ jStar : ℕ, J0 < jStar → ∀ (S : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ), (∀ v ∈ S, balancedPairWindow κ L v) → (∀ v ∈ S, v.1*v.2 = 2*u v+1) → (∀ v ∈ S, ∀ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), ¬p ∣ v.1*v.2) → (∑ v ∈ S, candidateCoefficient c L q r jStar (u v)) / (L^2*(∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1-1/(p : ℝ)))^2) ≤ C*(κ+1/L)*candidateCoefficientWindowMass c L q r jStar/L := by obtain ⟨J, θ, hθ, _, hcut, hθsmall, hsize⟩ := exists_candidate_micro_cutoff hc r obtain ⟨C, hC, J0, _, hbound⟩ := exists_candidate_balanced_rough_pair_bound hc hr hq0 hq1 hcenter hθ J hcut hsize hθsmall refine ⟨C, hC, J0, ?_⟩ filter_upwards [hbound, eventually_sqrt_le_dyadic_scale hθ 0, eventually_gt_atTop (0 : ℝ)] with L hb hsqrt hL intro κ hκ hκup jStar hj S u hS hv hrough have hW : Real.exp (Real.sqrt L) ≤ Real.exp (θ*L) := by apply Real.exp_le_exp.mpr simpa only [pow_zero, div_one] using hsqrt have hraw := hb κ hκ hκup jStar hj (Real.exp (Real.sqrt L)) S u (Real.one_le_exp (Real.sqrt_nonneg _)) hW hS hv hrough have hV : 0 < ∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1-1/(p : ℝ)) := finite_prime_avoidance_product_pos _ (fun p hp => (mem_filter.mp hp).2) have hden : 0 < L^2*(∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1-1/(p : ℝ)))^2 := by positivity refine (div_le_div_of_nonneg_right hraw hden.le).trans_eq ?_ field_simp end Bounty end section /- A supported original fine path supplies coherent decoded observations and mark targets. -/ open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) include hencode in theorem physical_fine_trace_coherent (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (hs : FullActiveInjective s.2) (p : FiniteEventPath (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (List.range (4 * n + 1)) s) (hp : finiteEventLocalPhase (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventPhase C k ω β ρ V (physicalSelectedFineTag n i)) (List.range (4 * n + 1)) s p ≠ 0) : let r := finiteEventPathObservations (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (List.range (4 * n + 1)) s p ∃ (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B), PhysicalFineHistoryCoherent C o t ∧ r.length = 4 * n + 1 ∧ (∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.1 = o i) ∧ (∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.2 = physicalBoundedMarkEncode (cut (i + 1)) (t i)) := by let E := fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let target := fun i => physicalFullLedgerEventTarget (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let occ := finiteScheduleOccurrence E target (4 * n + 1) s p let source := fun i => (occ i).1 let event := fun i => (occ i).2 have hinj (i : Fin (4 * n + 1)) : FullActiveInjective (target i.val (source i) (event i)).2 := (finite_schedule_supported_invariant E target (fun i => physicalFullLedgerEventPhase C k ω β ρ V (physicalSelectedFineTag n i)) (fun u => FullActiveInjective u.2) (fun i u e hu he => physical_local_phase_target_injective C k ω β ρ V _ u e hu he) (4 * n + 1) s p hs hp i).2 let o : ℕ → PhysicalMarkObservation P ell C := fun i => if hi : i < 4 * n + 1 then physicalFullEventObservation C k (cut i) (cut (i + 1)) (physicalSelectedFineTag n i) (source ⟨i, hi⟩) (event ⟨i, hi⟩) else .inr none let t : ℕ → PhysicalBoundedMarkState P J ell B := fun i => if hi : i < 4 * n + 1 then physicalSupportedMarkDecode (cut (i + 1)) (target i (source ⟨i, hi⟩) (event ⟨i, hi⟩)) (hinj ⟨i, hi⟩) else physicalSupportedMarkDecode (cut 0) s hs have ho (i : Fin (4 * n + 1)) : o i.val = physicalFullEventObservation C k (cut i.val) (cut (i.val + 1)) (physicalSelectedFineTag n i.val) (source i) (event i) := by simp only [o, dif_pos i.isLt] have ht (i : Fin (4 * n + 1)) : physicalBoundedMarkEncode (cut (i.val + 1)) (t i.val) = physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i.val) (source i) (event i) := by simp only [t, dif_pos i.isLt] exact physical_supported_mark_encode (cut (i.val + 1)) _ _ have hnext (i : ℕ) (hi : i + 1 < 4 * n + 1) : source ⟨i + 1, hi⟩ = physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i) (source ⟨i, by omega⟩) (event ⟨i, by omega⟩) := finite_schedule_source_after E target (4 * n + 1) s p i hi refine ⟨o, t, physical_fine_events_coherent C k cut hencode source event hnext o t ho ht, ?_, ?_, ?_⟩ · simp only [finite_event_path_observations_length, List.length_range] · intro i hi have hii : i < 4 * n + 1 := by simpa only [finite_event_path_observations_length, List.length_range] using hi have hget := finite_schedule_observations_get E target (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (4 * n + 1) s p ⟨i, hii⟩ exact (congrArg (fun r => r.2.1) hget).trans (ho ⟨i, hii⟩).symm · intro i hi have hii : i < 4 * n + 1 := by simpa only [finite_event_path_observations_length, List.length_range] using hi have hget := finite_schedule_observations_get E target (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (4 * n + 1) s p ⟨i, hii⟩ exact (congrArg (fun r => r.2.2) hget).trans (ht ⟨i, hii⟩).symm end Fine end Bounty end section /- The actual physical fixed-forest sum is the integral of its complete signed row composition. -/ open Finset Classical MeasureTheory namespace Bounty end Bounty end section /- An inactive cap only needs to cover the selected prime groups. -/ open Finset open scoped Classical namespace Bounty theorem physical_group_finite_path_capped_eq_run_product {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] {patterns : Finset I} (groups : Finset (Fin N)) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (η : ℕ → ℝ) (β : PhysicalPrime P → ℝ) (V : Fin N → ℝ) (B : ℕ) (hB : (physicalPrimeGroups P groups).card ≤ B) : ghostPhaseCappedHistory (fun a : ↥(physicalPrimeGroups P groups) => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity (physicalPathSelectedEquiv patterns C (L, p)).2.2.1 a.val.1) j a.val.2) (fun a => physicalResidueAbsoluteHit (physicalPathSelectedOffset C k L p) a.val.1 a.val.2) (fun _ j => η (globalBirthFiniteIndex (n + 1) j).val) (fun a => β a.val) (fun a => V a.val.1) (fun _ => B) (fun _ => B) (n + 1) = ∏ a ∈ physicalPrimeGroups P groups, ghostPhaseRunHistory (fun j => decide (a ∈ physicalMarkedPrimes (finitePathMarks L p j))) (fun j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j : ZMod a.2.val)) η (β a) (V a.1) (n + 1) := by rw [ghost_phase_capped_history_eq_run_product _ _ _ _ _ _ _ (fun _ => by simpa only [Fintype.card_coe] using hB) (fun _ => by simpa only [Fintype.card_coe] using hB)] calc _ = ∏ a : ↥(physicalPrimeGroups P groups), ghostPhaseRunHistory (fun j => decide (a.val ∈ physicalMarkedPrimes (finitePathMarks L p j))) (fun j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j : ZMod a.val.2.val)) η (β a.val) (V a.val.1) (n + 1) := by apply prod_congr rfl intro a ha exact physical_finite_path_run_alignment C k L p η β V a.val _ = _ := prod_coe_sort (physicalPrimeGroups P groups) (fun a : PhysicalPrime P => ghostPhaseRunHistory (fun j => decide (a ∈ physicalMarkedPrimes (finitePathMarks L p j))) (fun j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j : ZMod a.2.val)) η (β a) (V a.1) (n + 1)) end Bounty end section /- Literal small-residue and big-memory factors of an original finite path. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalGroupFiniteVertexWeight {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} {patterns : Finset I} (groups : Finset (Fin N)) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (k : ℕ → I → ℤ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (r : PhysicalGroupResidues P groups) : ℝ := ∏ j ∈ range (n + 2), physicalResidueVertexWeight (fun g : ↥groups => finitePathMarks L p j g.val) (physicalEndpointSchedule q (n + 1) j) (physicalTranslateResidues (physicalGroupResidueVector r) (physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j)) noncomputable def physicalGroupFiniteCappedHistory {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] {patterns : Finset I} (groups : Finset (Fin N)) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (k : ℕ → I → ℤ) (β : PhysicalPrime P → ℝ) (V : Fin N → ℝ) (B : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : ℝ := ghostPhaseCappedHistory (fun a : ↥(physicalPrimeGroups P groups) => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity (physicalPathSelectedEquiv patterns C (L, p)).2.2.1 a.val.1) j a.val.2) (fun a => physicalResidueAbsoluteHit (physicalPathSelectedOffset C k L p) a.val.1 a.val.2) (fun _ j => 1 - physicalEndpointSchedule q (n + 1) (globalBirthFiniteIndex (n + 1) j).val) (fun a => β a.val) (fun a => V a.val.1) (fun _ => B) (fun _ => B) (n + 1) end Bounty end section /- Large least-prime factors force prime cofactors in the balanced pair window. -/ namespace Bounty open Finset Filter Real open scoped Topology theorem cofactor_prime_of_product_lt_cube {p m : ℕ} (hp : p.Prime) (hpm : p ≤ m) (hrough : ∀ q ∈ m.primeFactors, p ≤ q) (hprod : p*m < p^3) : m.Prime := by have hm0 : 0 < m := hp.pos.trans_le hpm have hm1 : m ≠ 1 := by have hh := hp.two_le.trans hpm; omega have hmin : p ≤ m.minFac := hrough m.minFac (Nat.mem_primeFactors.mpr ⟨Nat.minFac_prime hm1,Nat.minFac_dvd m,hm0.ne'⟩) by_contra hmprime have hsq : p^2 ≤ m := (Nat.pow_le_pow_left hmin 2).trans (Nat.minFac_sq_le_self hm0 hmprime) have hcube : p^3 ≤ p*m := calc p^3 = p*(p^2) := by ring _ ≤ p*m := Nat.mul_le_mul_left p hsq exact (not_lt_of_ge hcube) hprod theorem eventually_large_least_factor_balanced_prime {κ : ℝ} (hκ : 0 < κ) (hκmax : κ ≤ 1/50) : ∀ᶠ L : ℝ in atTop, ∀ p m : ℕ, p.Prime → p ≤ m → (∀ q ∈ m.primeFactors, p ≤ q) → exp (((1/2 : ℝ)-κ)*L) ≤ (p : ℝ) → exp L ≤ ((p*m : ℕ) : ℝ) → ((p*m : ℕ) : ℝ) ≤ 33*exp L → m.Prime ∧ balancedPairWindow κ L (p,m) := by have hgap : 0 < (1/2 : ℝ)-3*κ := by linarith have htκ : Tendsto (fun L : ℝ => exp (κ*L)) atTop atTop := tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hκ) have htc : Tendsto (fun L : ℝ => exp (((1/2 : ℝ)-3*κ)*L)) atTop atTop := tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hgap) filter_upwards [eventually_gt_atTop (0 : ℝ), htκ.eventually_ge_atTop 33, htc.eventually_gt_atTop 33] with L hL hκL hcL intro p m hp hpm hrough hpLo hprodLo hprodHi have hp0 : (0 : ℝ) < p := Nat.cast_pos.mpr hp.pos have hm0 : (0 : ℝ) ≤ m := Nat.cast_nonneg _ have hpmR : (p : ℝ) ≤ m := Nat.cast_le.mpr hpm have hprodR : (p : ℝ)*(m : ℝ) ≤ 33*exp L := by exact_mod_cast hprodHi have hcubeR : ((p*m : ℕ) : ℝ) < (p : ℝ)^3 := calc _ ≤ 33*exp L := hprodHi _ < exp (((1/2 : ℝ)-3*κ)*L)*exp L := mul_lt_mul_of_pos_right hcL (exp_pos _) _ = (exp (((1/2 : ℝ)-κ)*L))^3 := by rw [← exp_add, ← exp_nat_mul] congr 1 ring _ ≤ (p : ℝ)^3 := by gcongr have hcube : p*m < p^3 := by exact_mod_cast hcubeR have hmprime := cofactor_prime_of_product_lt_cube hp hpm hrough hcube have hmUp : (m : ℝ) ≤ exp (((1/2 : ℝ)+2*κ)*L) := by apply (mul_le_mul_iff_right₀ (exp_pos (((1/2 : ℝ)-κ)*L))).mp calc exp (((1/2 : ℝ)-κ)*L)*(m : ℝ) ≤ (p : ℝ)*(m : ℝ) := mul_le_mul_of_nonneg_right hpLo hm0 _ ≤ 33*exp L := hprodR _ ≤ exp (κ*L)*exp L := mul_le_mul_of_nonneg_right hκL (exp_pos _).le _ = exp (((1/2 : ℝ)-κ)*L)*exp (((1/2 : ℝ)+2*κ)*L) := by rw [← exp_add, ← exp_add] congr 1 ring have hpLower : exp (((1/2 : ℝ)-2*κ)*L) ≤ (p : ℝ) := (exp_le_exp.mpr (mul_le_mul_of_nonneg_right (by linarith) hL.le)).trans hpLo exact ⟨hmprime,hpLower,hpmR.trans hmUp,hpLower.trans hpmR,hmUp,hprodLo,hprodHi⟩ theorem arithmetic_product_window_one_pos (L : ℝ) {u : ℕ} (hu : u ∈ arithmeticProductWindow 1 (exp L)) : 0 < u := by have hh := ((mem_arithmeticProductWindow_iff (by norm_num : (1 : ℕ) ≠ 0) (exp L)).mp hu).1 simp only [one_mul] at hh exact Nat.cast_pos.mp ((exp_pos L).trans hh) theorem shifted_buchstab_pair_arithmetic_window_bounds {L z : ℝ} (hL : 0 ≤ L) {v : ℕ × ℕ} (hv : v ∈ shiftedBuchstabPairs (arithmeticProductWindow 1 (exp L)) z) : 2*exp L < ((v.1*v.2 : ℕ) : ℝ) ∧ ((v.1*v.2 : ℕ) : ℝ) ≤ 33*exp L := by obtain ⟨hp,hpm,hidx,hprod,hz,hrough⟩ := shifted_buchstab_pair_properties (arithmeticProductWindow 1 (exp L)) z (fun u hu => arithmetic_product_window_one_pos L hu) hv have hrange := (mem_arithmeticProductWindow_iff (by norm_num : (1 : ℕ) ≠ 0) (exp L)).mp hidx simp only [one_mul] at hrange have hprodR : ((v.1*v.2 : ℕ) : ℝ) = 2*(shiftedPairIndex v : ℝ)+1 := by exact_mod_cast hprod have he : 1 ≤ exp L := one_le_exp hL constructor <;> linarith theorem eventually_shifted_buchstab_balanced_prime {κ : ℝ} (hκ : 0 < κ) (hκmax : κ ≤ 1/50) : ∀ᶠ L : ℝ in atTop, ∀ z : ℝ, ∀ v ∈ shiftedBuchstabPairs (arithmeticProductWindow 1 (exp L)) z, exp (((1/2 : ℝ)-κ)*L) ≤ (v.1 : ℝ) → v.2.Prime ∧ balancedPairWindow κ L v := by filter_upwards [eventually_large_least_factor_balanced_prime hκ hκmax, eventually_ge_atTop (0 : ℝ)] with L hbal hL intro z v hv hlo obtain ⟨hp,hpm,hidx,hprod,hz,hrough⟩ := shifted_buchstab_pair_properties (arithmeticProductWindow 1 (exp L)) z (fun u hu => arithmetic_product_window_one_pos L hu) hv obtain ⟨hloProd,hhiProd⟩ := shifted_buchstab_pair_arithmetic_window_bounds hL hv exact hbal v.1 v.2 hp hpm hrough hlo (by linarith [exp_pos L]) hhiProd end Bounty /- Public declaration closure audit. -/ end section /- Original coupled summands are transported without separating their coefficients. -/ open Finset open scoped Classical namespace Bounty section Sums variable {I R : Type*} [AddCommMonoid R] {N J ell n : ℕ} {P : Fin N → Finset ℕ} (small : Fin N → Prop) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) end Sums section Marks variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (small : Fin N → Prop) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (p : Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) end Marks end Bounty end section /- The actual signed clean family with both independent full active-slot averages. The small initial-tail gate stays inside the operator. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- Actual retained candidate cross-sums admit a uniform power frequency cutoff. -/ open Finset MeasureTheory Filter open scoped ComplexConjugate namespace Bounty end Bounty end section /- Explicit propagation of box errors through both finite sums and the character normalization. -/ open Finset MeasureTheory namespace Bounty end Bounty end section /- Actual exponential scale ranges imply the determinant and spatial scale conditions. -/ open Finset Filter Real namespace Bounty noncomputable def typeIIAdmissibleDeterminantBound (L K : ℝ) : ℕ := ⌈2*L^(K+88)⌉₊ theorem typeII_admissible_determinant_bound {L K U E : ℝ} (hL : 0 < L) (hU : 0 < U) (hE : E = U*L^(-K)) : (2*U)/(2*(E/(2*L^88))) ≤ (typeIIAdmissibleDeterminantBound L K : ℝ) := by have hp : L^K ≠ 0 := (rpow_pos_of_pos hL K).ne' calc _ = 2*L^(K+88) := by rw [hE, rpow_add hL, rpow_neg hL.le] norm_num field_simp _ ≤ _ := Nat.le_ceil _ private theorem determinant_bound_le_three_rpow {L K : ℝ} (hL : 1 ≤ L) (hK : 0 ≤ K) : (typeIIAdmissibleDeterminantBound L K : ℝ) ≤ 3*L^(K+88) := by have hp : 1 ≤ L^(K+88) := one_le_rpow hL (by linarith) have hceil := Nat.ceil_lt_add_one (show 0 ≤ 2*L^(K+88) by positivity) change (⌈2*L^(K+88)⌉₊ : ℝ) ≤ _ linarith theorem eventually_typeII_actual_dyadic_geometry {b K : ℝ} (hb : 0 < b) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ U V E : ℝ, exp (b*L) ≤ U → U ≤ exp L → exp (b*L) ≤ V → V ≤ exp L → E = U*L^(-K) → 0 < U ∧ 0 < V ∧ 0 < E ∧ 4 ≤ U*V ∧ log (U*V) ≤ 2*L ∧ (2*U)/(2*(E/(2*L^88))) ≤ (typeIIAdmissibleDeterminantBound L K : ℝ) ∧ max 1 (typeIIAdmissibleDeterminantBound L K : ℝ) ≤ typeIISmoothDyadicScale U V E 0 ∧ log (24*U^2*V*L^88/E) ≤ 3*L ∧ (typeIIAdmissibleDeterminantBound L K : ℝ) ≤ exp (sqrt L) ∧ 2 ≤ exp (sqrt L) := by have hgrowth := eventually_mul_rpow_log_add_le_rpow (a := (0:ℝ)) (b := (1:ℝ)) (c := 2*b) (by norm_num) (by norm_num) (by positivity) 88 (log 48) have hlogcost := eventually_mul_rpow_log_add_le_rpow (a := (0:ℝ)) (b := (1:ℝ)) (c := (1:ℝ)) (by norm_num) (by norm_num) (by norm_num) (K+88) (log 24) have hsqrtcost := eventually_mul_rpow_log_add_le_rpow (a := (0:ℝ)) (b := (1/2:ℝ)) (c := (1:ℝ)) (by norm_num) (by norm_num) (by norm_num) (K+88) (log 3) filter_upwards [hgrowth, hlogcost, hsqrtcost, eventually_ge_atTop (1:ℝ)] with L hgrowth hlogcost hsqrtcost hL simp only [rpow_zero, rpow_one, mul_one, one_mul, ← sqrt_eq_rpow] at hgrowth hlogcost hsqrtcost intro U V E hUlo hUhi hVlo hVhi hE have hL0 : 0 < L := zero_lt_one.trans_le hL have hU : 0 < U := (exp_pos _).trans_le hUlo have hV : 0 < V := (exp_pos _).trans_le hVlo have hE0 : 0 < E := by rw [hE]; positivity have hpK : 0 < L^K := rpow_pos_of_pos hL0 K have hp88 : 1 ≤ L^88 := one_le_pow₀ hL have hp : 1 ≤ L^(K+88) := one_le_rpow hL (by linarith) have hUVlower : 48*L^88 ≤ U*V := by have hl : log (48*L^88) ≤ (2*b)*L := by rw [log_mul (by norm_num) (by positivity), log_pow] norm_num linarith calc _ = exp (log (48*L^88)) := (exp_log (by positivity)).symm _ ≤ exp ((2*b)*L) := exp_le_exp.mpr hl _ = exp (b*L)*exp (b*L) := by rw [← exp_add]; congr 1; ring _ ≤ U*V := mul_le_mul hUlo hVlo (exp_pos _).le hU.le have hUV : 4 ≤ U*V := by nlinarith have hlogU : log U ≤ L := by simpa only [log_exp] using log_le_log hU hUhi have hlogV : log V ≤ L := by simpa only [log_exp] using log_le_log hV hVhi have hlogUV : log (U*V) ≤ 2*L := by rw [log_mul hU.ne' hV.ne']; linarith have hB := determinant_bound_le_three_rpow hL hK have hscale : max 1 (typeIIAdmissibleDeterminantBound L K : ℝ) ≤ typeIISmoothDyadicScale U V E 0 := by have heq : typeIISmoothDyadicScale U V E 0 = U*V*L^K/16 := by simp only [typeIISmoothDyadicScale, pow_zero, mul_one] rw [hE, rpow_neg hL0.le] field_simp rw [heq] calc _ ≤ 3*L^(K+88) := max_le (by linarith) hB _ = (48*L^88)*L^K/16 := by rw [rpow_add hL0]; norm_num; ring _ ≤ U*V*L^K/16 := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hUVlower hpK.le) (by norm_num) have hupper : 24*U^2*V*L^88/E = 24*U*V*L^(K+88) := by rw [hE, rpow_add hL0, rpow_neg hL0.le] norm_num field_simp have hlogupper : log (24*U^2*V*L^88/E) ≤ 3*L := by rw [hupper, log_mul (by positivity) (by positivity), log_mul (by positivity) hV.ne', log_mul (by norm_num) hU.ne', log_rpow hL0] linarith have hBrough : (typeIIAdmissibleDeterminantBound L K : ℝ) ≤ exp (sqrt L) := by apply hB.trans have hl : log (3*L^(K+88)) ≤ sqrt L := by rw [log_mul (by norm_num) (by positivity), log_rpow hL0] linarith calc _ = exp (log (3*L^(K+88))) := (exp_log (by positivity)).symm _ ≤ _ := exp_le_exp.mpr hl have hrough : 2 ≤ exp (sqrt L) := by have hsqrt : 1 ≤ sqrt L := one_le_sqrt.mpr hL linarith [add_one_le_exp (sqrt L)] exact ⟨hU, hV, hE0, hUV, hlogUV, typeII_admissible_determinant_bound hL0 hU hE, hscale, hlogupper, hBrough, hrough⟩ end Bounty end section /- Uniform Lyapunov rows for an original owner, paying one common atom bound per selected child. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) end Owner end Bounty end section /- The original finite P cutoff may be enlarged exponentially on its unchanged spatial test. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- Actual common forest edge phases leave untouched rows unchanged. For affected rows their signed projected norm and memory symmetry are proved from the prime family and the decoded event multiplier. -/ open Finset Classical namespace Bounty end Bounty end section /- The original finite P cutoff may be enlarged exponentially on its unchanged spatial test. -/ open Finset Filter MeasureTheory namespace Bounty theorem eventually_fixed_exp_add_one_le_exp {C : ℝ} (R : ℝ) (hC : 1 < C) : ∀ᶠ L : ℝ in atTop, R*Real.exp L+1 ≤ Real.exp (C*L) := by filter_upwards [eventually_const_mul_exp_le_exp hC (R+1),eventually_ge_atTop (0 : ℝ)] with L hL hL0 simp only [one_mul] at hL have he : 1 ≤ Real.exp L := Real.one_le_exp hL0 linarith theorem eventually_coarse_retained_Psupport_enlarge {c C : ℝ} (Rcoarse : ℝ) (hc : 0 < c) (hC : 1 < C) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (R E : ℝ) (S : Finset ℕ) (G : ℕ → ℂ), (∀ u ∈ S, (u : ℝ) ≤ Rcoarse*Real.exp L) → ∀ (take : Fin ((candidateQIndices c L).card*r) → Bool) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ), candidateRetainedAllocationIntegrand c L q r jStar R (candidateSmallPSet c L (Rcoarse*Real.exp L+1)) take (candidateBoxFiniteTest L E S G) ξ = candidateRetainedAllocationIntegrand c L q r jStar R (candidateSmallPSet c L (Real.exp (C*L))) take (candidateBoxFiniteTest L E S G) ξ := by filter_upwards [eventually_candidate_retained_finite_test_enlarge hc, eventually_fixed_exp_add_one_le_exp Rcoarse hC] with L henlarge hcut intro q r jStar R E S G hS take ξ have hh := henlarge q r jStar R E (Rcoarse*Real.exp L) (Real.exp (C*L)-1) S G (by linarith) hS take ξ simpa only [sub_add_cancel] using hh end Bounty end section /- The integer ceiling creates only a fixed ratio and logarithmic loss. -/ namespace Bounty theorem harmonic_ceiling_scale_bounds {x : ℝ} (hx : 1 ≤ x) : (⌈3*x⌉₊ : ℝ) ≤ 4*x ∧ (⌈3*x⌉₊ : ℝ)/(x/2) ≤ 8 ∧ Real.log (⌈3*x⌉₊ : ℝ) ≤ Real.log 4 + Real.log x := by have hx0 : 0 < x := zero_lt_one.trans_le hx have hc := Nat.ceil_lt_add_one (by positivity : 0 ≤ 3*x) have hu : (⌈3*x⌉₊ : ℝ) ≤ 4*x := by linarith have hN0 : 0 < (⌈3*x⌉₊ : ℝ) := lt_of_lt_of_le (by positivity) (Nat.le_ceil (3*x)) refine ⟨hu, (div_le_iff₀ (half_pos hx0)).mpr (by linarith), ?_⟩ calc _ ≤ Real.log (4*x) := Real.log_le_log hN0 hu _ = _ := Real.log_mul (by norm_num) hx0.ne' theorem harmonic_ceiling_log_from_scales {Z D U V : ℝ} (hZ : 0 < Z) (hD : 0 < D) (hprod : 1 ≤ Z*D) (hZU : Z ≤ Real.exp U) (hDV : D ≤ Real.exp V) : Real.log (⌈3*(Z*D)⌉₊ : ℝ) ≤ Real.log 4 + U + V := by have hz : Real.log Z ≤ U := (Real.log_le_iff_le_exp hZ).mpr hZU have hd : Real.log D ≤ V := (Real.log_le_iff_le_exp hD).mpr hDV have hh := (harmonic_ceiling_scale_bounds hprod).2.2 rw [Real.log_mul hZ.ne' hD.ne'] at hh linarith end Bounty end section /- Exact finite positive cutoffs covering the actual auxiliary shift. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Exact positive harmonic root with arbitrary original list coefficient. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Removing the actual remaining auxiliary exclusions inside the weighted invariant harmonic sum costs a reciprocal sum over the actual free labels. -/ open Finset open scoped Classical namespace Bounty theorem physical_prime_aux_harmonic_error {G : Type*} [Fintype G] [dG : DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) {v : ℝ} (hv : 0 < v) (hV : ∀ g, v ≤ V g) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) (k : ℤ) (pool : Finset ℕ) (hpool : ∀ g, P g ⊆ pool) (α β γ α' β' γ' : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ n, ‖γ n‖ ≤ C) (hα' : ∀ m, ‖α' m‖ ≤ A) (hβ' : ∀ p, ‖β' p‖ ≤ B) (hγ' : ∀ n, ‖γ' n‖ ≤ C) (S : Finset ℤ) (N : ℕ) (hS : ∀ n ∈ S, 0 ≤ n ∧ n ≤ (N : ℤ)) (hS' : ∀ n ∈ S, let δ : ℤ := k * (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux : ℕ) 0 ≤ n+δ ∧ n+δ ≤ (N : ℤ)) {Y K : ℝ} (hY : 0 < Y) (hK : 0 ≤ K) (hYlow : ∀ n ∈ S, Y ≤ (n : ℝ)) (θ : ℤ → ℂ) (hθ : ∀ n ∈ S, ‖θ n‖ ≤ K) : let cut := repeatedBigPrimePatternCut probes r t i let δ : ℤ := k * (physicalFreeFactor cut aux : ℕ) let M := (markedDivisorBound (1/2) v (ell+J)) ^ Fintype.card G let W := fun n : ℤ => markedDivisorWeight univ P (1/2) V (fun g => ell + (cut g).card) n ‖∑ n ∈ S, (θ n / (n : ℂ)) * star (invariantTripleEndpoint pool α β γ n.natAbs) * invariantTripleEndpoint pool α' β' γ' (n+δ).natAbs * ((W n.natAbs * W (n+δ).natAbs : ℝ) : ℂ) * physicalFreePrimePairError P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs‖ ≤ (K * (M * M * (2 * repeatedBigPrimePatternBound probes r t Q ξ i)) / Y) * ((A*B*C)^2 * (N : ℝ) * (1+Real.log N)^15) * ∑ p ∈ physicalFreePrimeSet cut aux, 1/(p : ℝ) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) let cut := repeatedBigPrimePatternCut probes r t i let δ : ℤ := k * (physicalFreeFactor cut aux : ℕ) let M := (markedDivisorBound (1/2) v (ell+J)) ^ Fintype.card G let H := repeatedBigPrimePatternBound probes r t Q ξ i let W := fun n : ℤ => markedDivisorWeight univ P (1/2) V (fun g => ell + (cut g).card) n let e := fun n : ℤ => ((W n.natAbs * W (n+δ).natAbs : ℝ) : ℂ) * physicalFreePrimePairError P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs have hW (n : ℤ) : 0 ≤ W n ∧ W n ≤ M := physical_marked_weight_bound P V cut hv hV n have hM : 0 ≤ M := (hW 0).1.trans (hW 0).2 have hH : 0 ≤ H := repeated_big_prime_pattern_bound_nonneg probes r t Q ξ i have he (n : ℤ) : ‖e n‖ ≤ M*M*(2*H) := by dsimp only [e] rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (hW _).1 (hW _).1)] exact mul_le_mul (mul_le_mul (hW _).2 (hW _).2 (hW _).1 hM) (physical_free_prime_pair_error_norm_le P V probes r t hrt Q h ξ hξ i aux a b _ _) (norm_nonneg _) (mul_nonneg hM hM) have hzero (n : ℤ) (hn : ∀ p ∈ physicalFreePrimeSet cut aux, ¬ (p : ℤ) ∣ n) : e n = 0 := by dsimp only [e] rw [physical_free_prime_pair_error_zero P V probes r t hrt Q h ξ i aux a b n k hn, mul_zero] have hb := invariant_harmonic_supported_error pool (physicalFreePrimeSet cut aux) α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' S δ N (fun p hp => physical_free_prime_set_supported cut aux hprime pool hpool hp) (fun p hp => physical_free_prime_set_dvd_step cut aux k hp) hS hS' hY hK (mul_nonneg (mul_nonneg hM hM) (mul_nonneg (by norm_num) hH)) hYlow θ e hθ (fun n _ => he n) (fun n _ hn => hzero n hn) simpa only [e, mul_assoc] using hb end Bounty end section /- The original memory scalar is a product over selected data, with both permutation normalizers and every zero-weight list constraint retained. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSelectedMemoryProduct {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (C : Fin n → G → Finset (Fin J)) (V : G → ℝ) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (d : PhysicalGroupSelectedData P ell C) : ℂ := ∏ j : Fin n, (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations G J ell) : ℂ)⁻¹ * (if physicalListAdmissible (C j) (d.1 j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ)) then (physicalAuxMass V (C j) (d.1 j) : ℂ) * K j (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ)) (d.1 j) * physicalPhase (ζ j) (physicalD (C j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (d.1 j)) else 0) theorem physical_selected_memory_product_unrestricted {N J ell r : ℕ} {P : Fin N → Finset ℕ} (C : Fin (r + 1) → Fin N → Finset (Fin J)) (V : Fin N → ℝ) (ζ : Fin (r + 1) → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (d : PhysicalSelectedData P ell C) : physicalSelectedMemoryProduct C V ζ K d = (if ∀ j : Fin (r + 1), physicalListAdmissible (C j) (d.1 j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ)) then (1 : ℂ) else 0) * (∏ i ∈ range (2 * (r + 1) + 1), physicalSelectedCoarseScalar C d.1 d.2.1 d.2.2.1 (fun j _ aux => physicalAuxMass V (C j) aux) i) * physicalSelectedCoefficient C ζ K d := by by_cases hlist : ∀ j : Fin (r + 1), physicalListAdmissible (C j) (d.1 j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ)) · rw [if_pos hlist, one_mul, physical_selected_coarse_scalar_product, physicalSelectedCoefficient, ← prod_mul_distrib] unfold physicalSelectedMemoryProduct apply prod_congr rfl intro j _ rw [if_pos (hlist j)] simp only [Complex.ofReal_natCast, ← Nat.card_eq_fintype_card] ring · rw [if_neg hlist, zero_mul, zero_mul] push Not at hlist obtain ⟨j, hj⟩ := hlist unfold physicalSelectedMemoryProduct apply Finset.prod_eq_zero (mem_univ j) rw [if_neg hj, mul_zero] theorem physical_selected_memory_product_reindex {G : Type*} [Fintype G] [DecidableEq G] {N J ell n : ℕ} {P : G → Finset ℕ} (e : G ≃ Fin N) (C : Fin n → G → Finset (Fin J)) (V : G → ℝ) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (d : PhysicalGroupSelectedData P ell C) : physicalSelectedMemoryProduct (fun j g => C j (e.symm g)) (fun g => V (e.symm g)) ζ (fun j => physicalGroupReindexedCoefficient e (C j) (K j)) (physicalSelectedGroupReindex e P C d) = physicalSelectedMemoryProduct C V ζ K d := by unfold physicalSelectedMemoryProduct apply prod_congr rfl intro j _ have h := physical_memory_labeled_group_reindex e P J ell (univ : Finset (Fin n)) C V ζ K (d.2.2.1 j, d.2.2.2 j, ⟨⟨j, mem_univ j⟩, d.1 j⟩) (d.2.1 j.castSucc) (d.2.1 j.succ) simp only [physicalMemoryLabeledScalar, ← Nat.card_eq_fintype_card] at h ⊢ dsimp only [physicalSelectedGroupReindex, physicalEdgeGroupReindex, Equiv.prodCongr, Equiv.piCongrRight, Equiv.sigmaCongrRight, Equiv.coe_fn_mk, Prod.map] at h ⊢ exact h end Bounty end section /- The literal full-pair harmonic sum minus its unrestricted marked-average sum. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalPositiveHarmonicDifference {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) : ℂ := let cut := repeatedBigPrimePatternCut probes r t i let d := physicalFreeFactor cut aux let δ : ℤ := k*(d : ℤ) let marks := fun g => ell+(cut g).card let W := fun n : ℤ => markedDivisorWeight univ P (1/2) V marks n let S := harmonicPositiveSupport Z k d let F := fun n : ℤ => ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)/(n : ℂ)) * star (invariantTripleEndpoint pool α β γ n.natAbs) * invariantTripleEndpoint pool α' β' γ' (n+δ).natAbs (∑ n ∈ S, F n * physicalFullPairCorrelation P cut V (1/2) n.natAbs (n+δ).natAbs (physicalOriginalPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs)) - (∑ n ∈ S, F n * ((W n.natAbs * W (n+δ).natAbs : ℝ) : ℂ) * groupMarkedAverage P marks (n.natAbs : ℤ) (fun u => groupMarkedAverage P marks ((n+δ).natAbs : ℤ) (physicalFreePrimePairCoefficient P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs u))) end Bounty end section /- Exact logarithmic Mellin representation and uniform truncation for the original cutoff. -/ open MeasureTheory namespace Bounty theorem harmonic_dyadic_mellin_representation {t : ℝ} (ht : 0 < t) : (typeIIHarmonicDyadic t : ℂ) = ∫ v : ℝ, harmonicLogFourier v*physicalMellinPhase (2*Real.pi*v) t := by have he := harmonic_log_fourier_inversion (Real.log t) simp only [harmonicLogCutoff, Real.exp_log ht] at he rw [he] apply integral_congr_ae exact Filter.Eventually.of_forall (fun v => mul_comm _ _) end Bounty end section /- A fixed positive compact cutoff covering both endpoints of every cell comparison. -/ open scoped ContDiff namespace Bounty noncomputable def harmonicCommonCutoff (t : ℝ) : ℝ := Real.smoothTransition (8 * t - 1) * Real.smoothTransition (4 - t / Real.exp 2) theorem harmonic_common_cutoff_bounds (t : ℝ) : 0 ≤ harmonicCommonCutoff t ∧ harmonicCommonCutoff t ≤ 1 := by unfold harmonicCommonCutoff constructor · exact mul_nonneg (Real.smoothTransition.nonneg _) (Real.smoothTransition.nonneg _) · exact mul_le_one₀ (Real.smoothTransition.le_one _) (Real.smoothTransition.nonneg _) (Real.smoothTransition.le_one _) theorem harmonic_common_cutoff_eq_one {t : ℝ} (ht : t ∈ Set.Icc (1 / 4) (3 * Real.exp 2)) : harmonicCommonCutoff t = 1 := by have hdiv : t / Real.exp 2 ≤ 3 := (div_le_iff₀ (Real.exp_pos _)).mpr (by linarith [ht.2]) unfold harmonicCommonCutoff rw [Real.smoothTransition.one_of_one_le (by linarith [ht.1]), Real.smoothTransition.one_of_one_le (by linarith), mul_one] theorem harmonic_common_cutoff_support {t : ℝ} (ht : harmonicCommonCutoff t ≠ 0) : t ∈ Set.Ioo (1 / 8) (4 * Real.exp 2) := by constructor · by_contra hlo have hzero : 8 * t - 1 ≤ 0 := by linarith exact ht (by unfold harmonicCommonCutoff; rw [Real.smoothTransition.zero_of_nonpos hzero, zero_mul]) · by_contra hhi have hdiv : 4 ≤ t / Real.exp 2 := (le_div_iff₀ (Real.exp_pos _)).mpr (by linarith) exact ht (by unfold harmonicCommonCutoff; rw [Real.smoothTransition.zero_of_nonpos (by linarith : 4 - t / Real.exp 2 ≤ 0), mul_zero]) theorem harmonic_common_cutoff_contDiff : ContDiff ℝ ∞ harmonicCommonCutoff := by unfold harmonicCommonCutoff fun_prop theorem harmonic_common_cutoff_scaled_eq_one {Y x : ℝ} (hY : 0 < Y) (hx : x ∈ Set.Icc (Y / 4) (3 * Real.exp 2 * Y)) : harmonicCommonCutoff (x / Y) = 1 := by apply harmonic_common_cutoff_eq_one constructor · apply (le_div_iff₀ hY).mpr linarith [hx.1] · exact (div_le_iff₀ hY).mpr hx.2 theorem harmonic_common_cutoff_scaled_support {Y x : ℝ} (hY : 0 < Y) (hx : harmonicCommonCutoff (x / Y) ≠ 0) : x ∈ Set.Ioo (Y / 8) (4 * Real.exp 2 * Y) := by have hs := harmonic_common_cutoff_support hx constructor · have := (lt_div_iff₀ hY).mp hs.1 linarith · exact (div_lt_iff₀ hY).mp hs.2 end Bounty end section /- The normalized central Mellin integral uses the fixed Fourier L1 mass. -/ open MeasureTheory Filter namespace Bounty theorem normalized_harmonic_central_bound {Y E : ℝ} (hY : 0 < Y) (hE : 0 ≤ E) (S : Set ℝ) (G : ℝ → ℂ) (hG : ∀ᵐ v ∂volume.restrict S, ‖G v‖ ≤ Y*E) : ‖(Y : ℂ)⁻¹ * ∫ v in S, harmonicLogFourier v * G v‖ ≤ (∫ v : ℝ, ‖harmonicLogFourier v‖) * E := by have hb : ‖∫ v in S, harmonicLogFourier v * G v‖ ≤ (∫ v in S, ‖harmonicLogFourier v‖) * (Y*E) := by calc _ ≤ ∫ v in S, ‖harmonicLogFourier v‖ * (Y*E) := norm_integral_le_of_norm_le ((harmonic_log_fourier_integrable.norm.mul_const (Y*E)).integrableOn) (hG.mono (fun v hv => by rw [norm_mul] exact mul_le_mul_of_nonneg_left hv (norm_nonneg _))) _ = _ := integral_mul_const _ _ have hm : (∫ v in S, ‖harmonicLogFourier v‖) ≤ ∫ v : ℝ, ‖harmonicLogFourier v‖ := setIntegral_le_integral harmonic_log_fourier_integrable.norm (Eventually.of_forall (fun v => norm_nonneg (harmonicLogFourier v))) rw [norm_mul, norm_inv, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hY] calc _ ≤ Y⁻¹ * ((∫ v in S, ‖harmonicLogFourier v‖) * (Y*E)) := mul_le_mul_of_nonneg_left hb (inv_nonneg.mpr hY.le) _ ≤ Y⁻¹ * ((∫ v : ℝ, ‖harmonicLogFourier v‖) * (Y*E)) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hm (mul_nonneg hY.le hE)) (inv_nonneg.mpr hY.le) _ = _ := by field_simp end Bounty end section /- The selected-history sum with both empty-memory boundaries has an exact scalar energy bound. -/ open Finset namespace Bounty section Energy variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) end Energy end Bounty end section /- Exact normalization of one actual supported root-path term. -/ open Finset open scoped Classical namespace Bounty section Normalization variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (hp : physicalRootNormalizablePath V patterns C ζ k K L p) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin (n + 1), ∀ g s, ¬ (((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc g s).val : ℤ) ∣ physicalPathSelectedMultiplier C k p j) (b : PhysicalPrime P → ℝ) (hb : ∀ a, b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a, b a ≠ 0) include hp hP hdis hk hb hb0 end Normalization end Bounty end section /- The actual nonzero original physical path has a coherent decoded fine trace. -/ open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) include hencode in theorem physical_original_fine_trace_coherent (x : PhysicalFullBoundedState P J ell B) (hx : FullActiveInjective x) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) (hp : (finiteEventPathWeight (FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventWeight (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ω (fun g p => β g p / V g) retention ρ V) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p : ℂ) * fullMixedLedgerInducedPhase (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) fullActiveInitialLedger (finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventPhase C k ω β ρ V) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))) x p ≠ 0) : let lift : FiniteEventPath (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x, x) := (finiteLedgerEventPathEquiv (FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullMixedLedgerUpdate (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x) x).symm p let pos := (finiteEventPathMapEquiv (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalSelectedFineTag n) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x)).symm lift let r := finiteEventPathObservations (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x) pos ∃ (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B), PhysicalFineHistoryCoherent C o t ∧ r.length = 4 * n + 1 ∧ (∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.1 = o i) ∧ (∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.2 = physicalBoundedMarkEncode (cut (i + 1)) (t i)) := by let lift : FiniteEventPath (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x, x) := (finiteLedgerEventPathEquiv (FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullMixedLedgerUpdate (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x) x).symm p let pos := (finiteEventPathMapEquiv (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalSelectedFineTag n) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x)).symm lift have hphase := (mul_ne_zero_iff.mp hp).2 have hpos : finiteEventLocalPhase (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventPhase C k ω β ρ V (physicalSelectedFineTag n i)) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x) pos ≠ 0 := by intro hz apply hphase have hmap := finite_event_path_map_local_phase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventPhase C k ω β ρ V) (physicalSelectedFineTag n) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x) pos change finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventPhase C k ω β ρ V) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x, x) lift = 0 simpa only [pos, Equiv.apply_symm_apply] using hmap.symm.trans hz exact physical_fine_trace_coherent C k ω β ρ V cut hencode (fullActiveInitialLedger x, x) hx pos hpos end Fine end Bounty end section /- The balanced contribution of two actual full-cell prime proxies. -/ open Finset Filter namespace Bounty theorem exists_candidate_balanced_prime_proxy_bound {c q a : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) (ha : 0 < a) : ∃ C : ℝ, 0 < C ∧ ∃ J0 : ℕ, ∀ σ : ℝ, ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ jStar : ℕ, J0 < jStar → ∀ (F : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ) (Y Z : ℕ → ℝ), (∀ v ∈ F, balancedPairWindow κ L v) → (∀ v ∈ F, v.1*v.2 = 2*u v+1) → (∀ v ∈ F, Real.exp (a*L) ≤ Y v.1 ∧ Real.exp (a*L) ≤ Z v.2) → (∑ v ∈ F, candidateCoefficient c L q r jStar (u v)* primeCellProxy L σ (Y v.1) v.1*primeCellProxy L σ (Z v.2) v.2) ≤ C*(κ+1/L)*candidateCoefficientWindowMass c L q r jStar/L := by classical obtain ⟨Cb, hCb, J0, hbalanced⟩ := exists_candidate_balanced_normalized_pair_bound hc hr hq0 hq1 hcenter obtain ⟨Cp, hCp, hproxy⟩ := exists_prime_cell_proxy_uniform_bound ha refine ⟨Cp^2*Cb, by positivity, J0, ?_⟩ intro σ filter_upwards [hbalanced, hproxy σ, eventually_gt_atTop (0 : ℝ)] with L hb hp hL intro κ hκ hκup jStar hj F u Y Z hwindow hproduct hbase let A := fun v : ℕ × ℕ => candidateCoefficient c L q r jStar (u v) let f := fun v : ℕ × ℕ => primeCellProxy L σ (Y v.1) v.1 let g := fun v : ℕ × ℕ => primeCellProxy L σ (Z v.2) v.2 let V := ∏ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), (1-1/(p : ℝ)) let T := F.filter (fun v => f v ≠ 0 ∧ g v ≠ 0) have hV : 0 < V := finite_prime_avoidance_product_pos _ (fun _ hp => (mem_filter.mp hp).2) have hTF : T ⊆ F := filter_subset _ _ have hrough : ∀ v ∈ T, ∀ p ∈ primeBand 0 (Real.exp (Real.sqrt L)), ¬p ∣ v.1*v.2 := by intro v hv p hpm hpd have hfg := (mem_filter.mp hv).2 have hpp : p.Prime := (mem_filter.mp hpm).2 rcases hpp.dvd_mul.mp hpd with hpx | hpy · exact prime_cell_proxy_avoids_small_primes hfg.1 p hpm hpx · exact prime_cell_proxy_avoids_small_primes hfg.2 p hpm hpy have hsum : (∑ v ∈ F, A v*f v*g v) = ∑ v ∈ T, A v*f v*g v := by symm apply sum_subset hTF intro v hv hnot have hh : ¬(f v ≠ 0 ∧ g v ≠ 0) := fun h => hnot (mem_filter.mpr ⟨hv, h⟩) by_cases hf : f v = 0 · simp only [hf, mul_zero, zero_mul] · have hg : g v = 0 := by by_contra hg; exact hh ⟨hf, hg⟩ simp only [hg, mul_zero] have hweights := sum_nonneg_pair_coefficient_bound T A f g (K := Cp/(L*V)) (by positivity) (fun v _ => candidate_coefficient_nonneg c L hq0 r jStar (u v)) (fun v hv => (hp (Y v.1) (hbase v (hTF hv)).1 v.1).2.2) (fun v _ => prime_cell_proxy_nonneg L σ (Z v.2) v.2) (fun v hv => (hp (Z v.2) (hbase v (hTF hv)).2 v.2).2.2) have hnorm := hb κ hκ hκup jStar hj T u (fun v hv => hwindow v (hTF hv)) (fun v hv => hproduct v (hTF hv)) hrough change (∑ v ∈ F, A v*f v*g v) ≤ _ rw [hsum] calc _ ≤ (Cp/(L*V))^2*(∑ v ∈ T, A v) := hweights _ = Cp^2*((∑ v ∈ T, A v)/(L^2*V^2)) := by ring _ ≤ Cp^2*(Cb*(κ+1/L)*candidateCoefficientWindowMass c L q r jStar/L) := mul_le_mul_of_nonneg_left hnorm (sq_nonneg Cp) _ = _ := by ring end Bounty end section /- The selected coefficient is a function only of the two active endpoints and auxiliary draw. -/ open Finset open scoped Classical namespace Bounty section Active variable {N J ell : ℕ} {P : Fin N → Finset ℕ} (before after C : Fin N → Finset (Fin J)) (ζ : ℝ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) noncomputable def physicalActiveMarkLabels (a : (g : Fin N) → Fin (J + ell) → ↥(P g)) (ha : ∀ g, Function.Injective (a g)) : PhysicalMarkLists P J ell := fun g => ⟨a g ∘ (physicalFullSlotIndex (before g)).symm, (ha g).comp (physicalFullSlotIndex (before g)).symm.injective⟩ noncomputable def physicalActiveCoefficient (s t : (g : Fin N) → Fin (J + ell) → ↥(P g)) (a : PhysicalAuxLabels P C) : ℂ := if hs : ∀ g, Function.Injective (s g) then if ht : ∀ g, Function.Injective (t g) then K (physicalActiveMarkLabels before s hs) (physicalActiveMarkLabels after t ht) a * physicalPhase ζ (physicalD C (physicalActiveMarkLabels before s hs) a) else 0 else 0 theorem physical_active_mark_labels_encode (L : PhysicalMarkLists P J ell) : physicalActiveMarkLabels before (fun g i => L g (physicalFullSlotIndex (before g) i)) (fun g => (L g).injective.comp (physicalFullSlotIndex (before g)).injective) = L := by funext g apply Function.Embedding.ext intro i exact congrArg (L g) ((physicalFullSlotIndex (before g)).apply_symm_apply i) theorem physical_active_coefficient_encode (L R : PhysicalMarkLists P J ell) (a : PhysicalAuxLabels P C) : physicalActiveCoefficient before after C ζ K (fun g i => L g (physicalFullSlotIndex (before g) i)) (fun g i => R g (physicalFullSlotIndex (after g) i)) a = K L R a * physicalPhase ζ (physicalD C L a) := by have hL : ∀ g, Function.Injective (fun i => L g (physicalFullSlotIndex (before g) i)) := fun g => (L g).injective.comp (physicalFullSlotIndex (before g)).injective have hR : ∀ g, Function.Injective (fun i => R g (physicalFullSlotIndex (after g) i)) := fun g => (R g).injective.comp (physicalFullSlotIndex (after g)).injective simp only [physicalActiveCoefficient, dif_pos hL, dif_pos hR, physical_active_mark_labels_encode] end Active end Bounty end section /- Sum the actual auxiliary draw outside the mixed full action, with arbitrary coupled phases. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Full ambient domains and the precise remaining candidate-weighted proxy errors. -/ open Finset Filter namespace Bounty noncomputable def shiftedPrimeBandPairs (T : Finset ℕ) (A B : ℝ) : Finset (ℕ × ℕ) := by classical exact (shiftedFactorPairs T).filter (fun v => v.1 ∈ primeBand A B) noncomputable def shiftedBalancedPairs (T : Finset ℕ) (κ L : ℝ) : Finset (ℕ × ℕ) := by classical exact (shiftedFactorPairs T).filter (balancedPairWindow κ L) noncomputable def ambientRoughProxyError (T : Finset ℕ) (μ : ℕ → ℝ) (γ L S A B : ℝ) : ℝ := ∑ v ∈ shiftedPrimeBandPairs T A B, μ (shiftedPairIndex v)* (roughTestIndicator γ L v.2-roughTestLogarithmicProxy γ L S v.2) noncomputable def ambientPrimeProxyError (T : Finset ℕ) (μ : ℕ → ℝ) (κ L S : ℝ) : ℝ := by classical exact ∑ v ∈ shiftedBalancedPairs T κ L, μ (shiftedPairIndex v)* ((if v.1.Prime then 1 else 0 : ℝ)*(if v.2.Prime then 1 else 0 : ℝ)- primeLogarithmicProxy L S v.1*primeLogarithmicProxy L S v.2) theorem shifted_prime_band_pair_data (T : Finset ℕ) (A B : ℝ) {v : ℕ × ℕ} (hv : v ∈ shiftedPrimeBandPairs T A B) : shiftedPairIndex v ∈ T ∧ v.1 ∈ primeBand A B ∧ v.1*v.2=2*shiftedPairIndex v+1 := by classical have h := shifted_factor_pair_properties T (mem_filter.mp hv).1 exact ⟨h.2.2.1,(mem_filter.mp hv).2,h.2.2.2⟩ theorem shifted_balanced_pair_data (T : Finset ℕ) (κ L : ℝ) {v : ℕ × ℕ} (hv : v ∈ shiftedBalancedPairs T κ L) : shiftedPairIndex v ∈ T ∧ balancedPairWindow κ L v ∧ v.1*v.2=2*shiftedPairIndex v+1 := by classical have h := shifted_factor_pair_properties T (mem_filter.mp hv).1 exact ⟨h.2.2.1,(mem_filter.mp hv).2,h.2.2.2⟩ theorem ambient_rough_test_sum_eq_proxy_add_error (T : Finset ℕ) (μ : ℕ → ℝ) (γ L S A B : ℝ) : (∑ v ∈ shiftedPrimeBandPairs T A B, μ (shiftedPairIndex v)*roughTestIndicator γ L v.2) = (∑ v ∈ shiftedPrimeBandPairs T A B, μ (shiftedPairIndex v)*roughTestLogarithmicProxy γ L S v.2)+ ambientRoughProxyError T μ γ L S A B := by unfold ambientRoughProxyError rw [← sum_add_distrib] apply sum_congr rfl intro v hv ring theorem ambient_prime_test_sum_eq_proxy_add_error (T : Finset ℕ) (μ : ℕ → ℝ) (κ L S : ℝ) : (∑ v ∈ shiftedBalancedPairs T κ L, μ (shiftedPairIndex v)* (if v.1.Prime then 1 else 0 : ℝ)*(if v.2.Prime then 1 else 0 : ℝ)) = (∑ v ∈ shiftedBalancedPairs T κ L, μ (shiftedPairIndex v)* primeLogarithmicProxy L S v.1*primeLogarithmicProxy L S v.2)+ ambientPrimeProxyError T μ κ L S := by classical unfold ambientPrimeProxyError rw [← sum_add_distrib] apply sum_congr rfl intro v hv ring end Bounty end section /- The actual signed candidate family, with its original fresh-birth gate, auxiliary law, and both full endpoint averages. The clean and dirty bounds are evaluated in the same tilted mixed measure. All analytic assumptions remain explicit; no local operator bound is assumed. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- The actual candidate truncation estimate on the original finite spatial support. -/ open Finset MeasureTheory Filter open scoped ComplexConjugate namespace Bounty end Bounty end section /- A transparent final algebraic reduction to the literal frequency-restricted cross integrals. -/ open Finset MeasureTheory namespace Bounty end Bounty end section /- The full Cauchy factor times the finite dyadic truncation error has arbitrary saving. -/ open Finset Real namespace Bounty theorem typeII_actual_dyadic_error_saving {L K aE A D T U V E : ℝ} (hL : 576 ≤ L) (hK : 0 ≤ K) (hU : 0 < U) (hV : 0 < V) (hE : E = U*L^(-K)) (hT : D+K+2*aE+2*A+177 ≤ T) : (2*E*V*(L^aE)^2*(L^A)^2) * ((2*(typeIIAdmissibleDeterminantBound L K : ℝ)) * (∑ j ∈ range (typeIISmoothDyadicCount L), typeIISmoothDyadicScale U V E j) * L^(-T)) ≤ (U*V)^2*L^(-D) := by have hL1 : 1 ≤ L := by linarith have hL0 : 0 < L := by linarith have hE0 : 0 < E := by rw [hE]; positivity have hp : 1 ≤ L^(K+88) := one_le_rpow hL1 (by linarith) have hceil := Nat.ceil_lt_add_one (show 0 ≤ 2*L^(K+88) by positivity) have hB : (typeIIAdmissibleDeterminantBound L K : ℝ) ≤ 3*L^(K+88) := by change (⌈2*L^(K+88)⌉₊ : ℝ) ≤ _ linarith have hsum := typeII_smooth_dyadic_scale_sum_le hL1 hU hV hE0 let s : ℝ := (K+88)+88+aE*2+A*2+(-T) calc _ ≤ (2*E*V*(L^aE)^2*(L^A)^2) * ((2*(3*L^(K+88))) * (48*U^2*V*L^88/E) * L^(-T)) := by gcongr exact sum_nonneg (fun j _ => (typeII_smooth_dyadic_scale_pos hU hV hE0 j).le) _ = 576*(U*V)^2*L^s := by have hs (a : ℝ) : L^(a*2) = (L^a)^2 := by simpa only [Nat.cast_ofNat] using rpow_mul_natCast hL0.le a 2 simp only [s, rpow_add hL0, hs, rpow_ofNat] field_simp ring _ ≤ L*(U*V)^2*L^s := by gcongr _ = (U*V)^2*L^(1+s) := by rw [rpow_add hL0 1 s, rpow_one] ring _ ≤ (U*V)^2*L^(-D) := by apply mul_le_mul_of_nonneg_left _ (sq_nonneg _) apply rpow_le_rpow_of_exponent_le hL1 dsimp only [s] linarith end Bounty end section /- Uniform Lyapunov rows for an original owner, paying one common atom bound per selected child. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) end Owner end Bounty end section /- Actual dyadic scales and the coarse positive box meet the original Mellin reduction. -/ open Finset Filter Real namespace Bounty end Bounty end section /- The original box coefficient expands directly using the enlarged finite P support. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- One exponential pool cutoff covers every actual dyadic cross endpoint. -/ open Filter Real namespace Bounty theorem eventually_candidate_cross_scale_below_cutoff {b K : ℝ} (hb : 0 < b) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ U V E Z : ℝ, exp (b*L) ≤ U → U ≤ exp L → exp (b*L) ≤ V → V ≤ exp L → E = U*L^(-K) → 0 < Z → Z ≤ 24*U^2*V*L^88/E → 3*Z < exp (4*L) := by filter_upwards [eventually_typeII_actual_dyadic_geometry hb hK, eventually_ge_atTop (log 3+1)] with L hgeo hL intro U V E Z hUlo hUhi hVlo hVhi hE hZ hZupper obtain ⟨hU, hV, hE0, _, _, _, _, hlog, _⟩ := hgeo U V E hUlo hUhi hVlo hVhi hE have hlogZ : log Z ≤ 3*L := (log_le_log hZ hZupper).trans hlog have hZexp : Z ≤ exp (3*L) := by calc Z = exp (log Z) := (exp_log hZ).symm _ ≤ exp (3*L) := exp_le_exp.mpr hlogZ have hthree : 3 < exp L := (log_lt_iff_lt_exp (by norm_num)).mp (by linarith) calc 3*Z ≤ 3*exp (3*L) := mul_le_mul_of_nonneg_left hZexp (by norm_num) _ < exp L*exp (3*L) := mul_lt_mul_of_pos_right hthree (exp_pos _) _ = exp (4*L) := by rw [← exp_add]; congr 1; ring end Bounty end section /- Actual dyadic scales and the coarse positive box meet the original Mellin reduction. -/ open Finset Filter Real namespace Bounty theorem eventually_original_mellin_scale_geometry_range {b K R : ℝ} (hb : 0 < b) (hK : 0 ≤ K) (hR : 0 < R) : ∀ᶠ L : ℝ in atTop, ∀ U V : ℝ, exp (b*L) ≤ U → exp (b*L) ≤ V → 2*U*V ≤ R*exp L → 1 ≤ U*L^(-K) ∧ log (U*L^(-K)) ≤ (1-b/2)*L := by have hgrowth := eventually_mul_rpow_log_add_le_rpow (a := (0:ℝ)) (b := (1:ℝ)) (c := b) (by norm_num) (by norm_num) hb K 0 have hconstant := eventually_mul_rpow_log_add_le_rpow (a := (0:ℝ)) (b := (1:ℝ)) (c := b/2) (by norm_num) (by norm_num) (by positivity) 0 (log R) filter_upwards [hgrowth, hconstant, eventually_ge_atTop (1:ℝ)] with L hgrowth hconstant hL simp only [rpow_zero, rpow_one, mul_one, zero_mul, zero_add, add_zero] at hgrowth hconstant intro U V hUlo hVlo hcoarse have hL0 : 0 < L := zero_lt_one.trans_le hL have hU : 0 < U := (exp_pos _).trans_le hUlo have hV : 0 < V := (exp_pos _).trans_le hVlo have hE : 0 < U*L^(-K) := by positivity have hlogUlo : b*L ≤ log U := by simpa only [log_exp] using log_le_log (exp_pos _) hUlo have hlogVlo : b*L ≤ log V := by simpa only [log_exp] using log_le_log (exp_pos _) hVlo have hUV : U*V ≤ R*exp L := by nlinarith [mul_pos hU hV] have hlogUV := log_le_log (mul_pos hU hV) hUV rw [log_mul hU.ne' hV.ne', log_mul hR.ne' (exp_ne_zero _), log_exp] at hlogUV have hlogE : log (U*L^(-K)) = log U-K*log L := by rw [log_mul hU.ne' (rpow_pos_of_pos hL0 _).ne', log_rpow hL0] ring have hnonneg : 0 ≤ log (U*L^(-K)) := by rw [hlogE]; linarith constructor · rw [← exp_log hE] exact one_le_exp_iff.mpr hnonneg · rw [hlogE] have hcost : 0 ≤ K*log L := mul_nonneg hK (log_nonneg hL) nlinarith end Bounty end section /- Fixed multiplicative scale constants are absorbed with their exact logarithmic cost. -/ open Finset Filter Real namespace Bounty theorem determinant_bound_le_three_rpow_public {L K : ℝ} (hL : 1 ≤ L) (hK : 0 ≤ K) : (typeIIAdmissibleDeterminantBound L K : ℝ) ≤ 3*L^(K+88) := by have hp : 1 ≤ L^(K+88) := one_le_rpow hL (by linarith) have hceil := Nat.ceil_lt_add_one (show 0 ≤ 2*L^(K+88) by positivity) change (⌈2*L^(K+88)⌉₊ : ℝ) ≤ _ linarith end Bounty end section /- The literal original group vertex weight is the product of its two permuted endpoint factors at every original edge and offset. -/ open Finset open scoped Classical namespace Bounty theorem physical_group_finite_vertex_weight_edges {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} {patterns : Finset I} (groups : Finset (Fin N)) (C : I → Fin N → Finset (Fin J)) {q : ℝ} (hq : 0 ≤ q) (k : ℕ → I → ℤ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (r : PhysicalGroupResidues P groups) : physicalGroupFiniteVertexWeight groups C q k L p r = ∏ j : Fin (n + 1), physicalResidueVertexWeight (fun g : ↥groups => physicalPermuteLabels (p j).1.1 (finitePathMarks L p j.val) g.val) (Real.sqrt q) (physicalTranslateResidues (physicalGroupResidueVector r) (physicalPathSelectedOffset C k L p j.castSucc)) * physicalResidueVertexWeight (fun g : ↥groups => physicalPermuteLabels (p j).1.2.1 (finitePathMarks L p (j.val + 1)) g.val) (Real.sqrt q) (physicalTranslateResidues (physicalGroupResidueVector r) (physicalPathSelectedOffset C k L p j.succ)) := by unfold physicalGroupFiniteVertexWeight rw [← physical_residue_permuted_endpoint_product (fun j (g : ↥groups) => finitePathMarks L p j g.val) (fun j => physicalTranslateResidues (physicalGroupResidueVector r) (physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j)) (fun j (g : ↥groups) => (finitePathLabels p j).1 g.val) (fun j (g : ↥groups) => (finitePathLabels p j).2.1 g.val) hq n] rw [← Fin.prod_univ_eq_prod_range] apply prod_congr rfl intro j _ simp only [finitePathLabels, dif_pos j.isLt] rfl end Bounty end section /- The actual auxiliary free factor inherits the prime and slot budgets. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [sharedInstance1 : Fintype G] {P : G → Finset ℕ} {J : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) include G sharedInstance1 P J C aux theorem physical_free_factor_exp_bound {B : ℝ} (hB : 0 ≤ B) (hp : ∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp B) : (physicalFreeFactor C aux : ℝ) ≤ Real.exp (B*((J*Fintype.card G : ℕ) : ℝ)) := by have hcard : ∀ g, (C g).card ≤ J := fun g => (card_le_card (subset_univ (C g))).trans_eq (by simp) have hinner (g : G) : (∏ j : C g, ((aux g j).val : ℝ)) ≤ Real.exp (B*J) := by calc _ ≤ ∏ _j : C g, Real.exp B := prod_le_prod₀ (fun _ _ => Nat.cast_nonneg _) (fun j _ => hp g _ (aux g j).property) _ = Real.exp (B*(C g).card) := by rw [← Real.exp_sum] simp only [sum_const, card_univ, Fintype.card_coe, nsmul_eq_mul] congr 1 ring _ ≤ Real.exp (B*J) := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left (by exact_mod_cast hcard g) hB) calc _ = ∏ g, ∏ j : C g, ((aux g j).val : ℝ) := by simp only [physicalFreeFactor, Nat.cast_prod] _ ≤ ∏ _g : G, Real.exp (B*J) := prod_le_prod₀ (fun g _ => prod_nonneg (fun _ _ => Nat.cast_nonneg _)) (fun g _ => hinner g) _ = _ := by rw [← Real.exp_sum] simp only [sum_const, card_univ, nsmul_eq_mul, Nat.cast_mul] congr 1 ring theorem physical_harmonic_ceiling_log_bound (hprime : ∀ g p, p ∈ P g → p.Prime) {B Z U : ℝ} (hB : 0 ≤ B) (hZ : 0 < Z) (hp : ∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp B) (hprod : 1 ≤ Z*(physicalFreeFactor C aux : ℝ)) (hZU : Z ≤ Real.exp U) : Real.log (⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ) ≤ Real.log 4 + U + B*((J*Fintype.card G : ℕ) : ℝ) := by have hd : 0 < physicalFreeFactor C aux := prod_pos (fun g _ => prod_pos (fun j _ => (hprime g _ (aux g j).property).pos)) simpa only [mul_assoc] using harmonic_ceiling_log_from_scales hZ (by exact_mod_cast hd) hprod hZU (physical_free_factor_exp_bound C aux hB hp) theorem physical_harmonic_log_bound_of_original_cutoff (hprime : ∀ g p, p ∈ P g → p.Prime) {B Z L : ℝ} (hB : 0 ≤ B) (hZ : 0 < Z) (hp : ∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp B) (hprod : 1 ≤ Z*(physicalFreeFactor C aux : ℝ)) (hcut : 3*Z < Real.exp (4*L)) : Real.log (⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ) ≤ Real.log 4 + 4*L + B*((J*Fintype.card G : ℕ) : ℝ) := by apply physical_harmonic_ceiling_log_bound C aux hprime hB hZ hp hprod linarith end end Bounty end section /- The original positive harmonic root on its literal dyadic support. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- An explicit polynomial bound absorbs the complete harmonic energy scale loss. -/ namespace Bounty theorem harmonic_energy_scalar_polynomial {A s L N Y : ℝ} (hA : 0 ≤ A) (hs : 0 ≤ s) (hL : 1 ≤ L) (hcost : 16*(5+Real.log 4+A)^15 ≤ L) (hN : 1 ≤ N) (hratio : N/Y ≤ 8) (hlog : Real.log N ≤ Real.log 4+4*L+A*L^s*Real.log L) : 2*(N/Y)*(1+Real.log N)^15 ≤ L^(15*(max 1 s+1)+1) := by let p : ℝ := max 1 s+1 let C : ℝ := 5+Real.log 4+A have hL0 : 0 < L := zero_lt_one.trans_le hL have hm0 : 0 ≤ max 1 s := hs.trans (le_max_right _ _) have hp0 : 0 ≤ p := add_nonneg hm0 zero_le_one have h1 : 1 ≤ L^p := Real.one_le_rpow hL hp0 have hlin : L ≤ L^p := by simpa only [Real.rpow_one] using Real.rpow_le_rpow_of_exponent_le hL (show (1 : ℝ) ≤ p by dsimp [p]; linarith) have hpow : L^s*Real.log L ≤ L^p := by calc _ ≤ L^s*L := mul_le_mul_of_nonneg_left (Real.log_le_self hL0.le) (Real.rpow_nonneg hL0.le s) _ = L^(s+1) := by rw [Real.rpow_add hL0, Real.rpow_one] _ ≤ _ := Real.rpow_le_rpow_of_exponent_le hL (by dsimp [p]; linarith [le_max_right (1 : ℝ) s]) have hlog4 : 0 ≤ Real.log 4 := Real.log_nonneg (by norm_num) have h4 : 4*L ≤ 4*L^p := mul_le_mul_of_nonneg_left hlin (by norm_num) have hc : Real.log 4 ≤ Real.log 4*L^p := by simpa only [mul_one] using mul_le_mul_of_nonneg_left h1 hlog4 have ha : A*L^s*Real.log L ≤ A*L^p := by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hpow hA have hsum : 1+Real.log N ≤ C*L^p := by dsimp [C]; nlinarith have hnonneg : 0 ≤ 1+Real.log N := add_nonneg zero_le_one (Real.log_nonneg hN) have hpower : (L^p)^15 = L^(15*p) := by rw [← Real.rpow_mul_natCast hL0.le] congr 1 ring calc _ ≤ 16*(1+Real.log N)^15 := mul_le_mul_of_nonneg_right (by linarith) (pow_nonneg hnonneg _) _ ≤ 16*(C*L^p)^15 := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hnonneg hsum 15) (by norm_num) _ = (16*C^15)*L^(15*p) := by rw [mul_pow, hpower]; ring _ ≤ L*L^(15*p) := mul_le_mul_of_nonneg_right hcost (Real.rpow_nonneg hL0.le _) _ = _ := by change L*L^(15*p) = L^(15*p+1) rw [Real.rpow_add hL0, Real.rpow_one] exact mul_comm _ _ end Bounty end section /- The exact memory product of a merged selected path reduces to the big selected data with the original small labels retained in its coefficient. -/ open Finset open scoped Classical namespace Bounty theorem physical_selected_split_memory_labeled {I G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell n : ℕ} (small : G → Prop) (patterns : Finset I) (C : I → G → Finset (Fin J)) (pattern : Fin n → patterns) (ds : PhysicalGroupSelectedData (fun g : {g // small g} => P g.val) ell (fun j g => C (pattern j).val g.val)) (db : PhysicalGroupSelectedData (fun g : {g // ¬small g} => P g.val) ell (fun j g => C (pattern j).val g.val)) (V : G → ℝ) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (j : Fin n) : let d := (physicalGroupSelectedSplit small (fun j => C (pattern j).val)).symm (ds, db) let a : PhysicalEdgeLabels P J ell patterns C := (d.2.2.1 j, d.2.2.2 j, ⟨pattern j, d.1 j⟩) physicalMemoryLabeledScalar (fun g : {g // ¬small g} => V g.val) patterns (fun i g => C i g.val) (fun _ => 0) (physicalFixedEdgeBigCoefficient small patterns C ζ K a (d.2.1 j.castSucc) (d.2.1 j.succ)) (physicalRestrictedEdge (fun g => ¬small g) patterns C a) (fun g => d.2.1 j.castSucc g.val) (fun g => d.2.1 j.succ g.val) = (Fintype.card (PhysicalPermutations {g // ¬small g} J ell) : ℂ)⁻¹ * (Fintype.card (PhysicalPermutations {g // ¬small g} J ell) : ℂ)⁻¹ * (if physicalListAdmissible (fun g => C (pattern j).val g.val) (db.1 j) (physicalPermuteLabels (db.2.2.1 j) (db.2.1 j.castSucc)) (physicalPermuteLabels (db.2.2.2 j) (db.2.1 j.succ)) then (physicalAuxMass (fun g : {g // ¬small g} => V g.val) (fun g => C (pattern j).val g.val) (db.1 j) : ℂ) * physicalCoupledBigCoefficient small (C (pattern j).val) (ζ (pattern j).val) (K (pattern j).val) (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc)) (physicalPermuteLabels (ds.2.2.2 j) (ds.2.1 j.succ)) (ds.1 j) (physicalPermuteLabels (db.2.2.1 j) (db.2.1 j.castSucc)) (physicalPermuteLabels (db.2.2.2 j) (db.2.1 j.succ)) (db.1 j) else 0) := by dsimp only let d := (physicalGroupSelectedSplit small (fun j => C (pattern j).val)).symm (ds, db) have hb := congrArg Prod.snd ((physicalGroupSelectedSplit small (fun j => C (pattern j).val)).apply_symm_apply (ds, db)) have hbl (i) : (fun g : {g // ¬small g} => d.2.1 i g.val) = db.2.1 i := congrArg (fun x => x.2.1 i) hb have hbs : (fun g : {g // ¬small g} => d.2.2.1 j g.val) = db.2.2.1 j := congrArg (fun x => x.2.2.1 j) hb have hbt : (fun g : {g // ¬small g} => d.2.2.2 j g.val) = db.2.2.2 j := congrArg (fun x => x.2.2.2 j) hb have hba : (fun g : {g // ¬small g} => d.1 j g.val) = db.1 j := congrArg (fun x => x.1 j) hb simp only [physicalMemoryLabeledScalar, physicalRestrictedEdge, physical_phase_zero_frequency, mul_one] change _ = _ rw [hbl, hbl, hbs, hbt, hba] rw [physical_selected_split_fixed_coefficient] end Bounty end section /- Both actual harmonic replacement errors on the same positive support. -/ open Finset open scoped Classical namespace Bounty theorem physical_positive_harmonic_replacement_error {G : Type*} [Fintype G] [dG : DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) {v : ℝ} (hv : 0 < v) (hV : ∀ g, v ≤ V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b : ℝ) {Z : ℝ} (hZ : 0 < Z) (k : ℤ) (hk : |(k : ℝ)| ≤ Z) {Pmin ε : ℝ} (hPmin : 0 < Pmin) (hε : 0 ≤ ε) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (pool : Finset ℕ) (hpool : ∀ g, P g ⊆ pool) (α β γ α' β' γ' : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ n, ‖γ n‖ ≤ C) (hα' : ∀ m, ‖α' m‖ ≤ A) (hβ' : ∀ p, ‖β' p‖ ≤ B) (hγ' : ∀ n, ‖γ' n‖ ≤ C) (herror : ∀ n ∈ harmonicPositiveSupport Z k (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux), let cut := repeatedBigPrimePatternCut probes r t i let δ : ℤ := k*(physicalFreeFactor cut aux : ℤ) let H := repeatedBigPrimePatternBound probes r t Q ξ i (∑ g, (J-(cut g).card : ℕ) * (Real.log n.natAbs / Real.log 2 + Real.log (n+δ).natAbs / Real.log 2 + J) / (V g*Pmin)) * (H+H/(1/2 : ℝ)^(2*∑ g : G, (J-(cut g).card))) ≤ ε) : let cut := repeatedBigPrimePatternCut probes r t i let d := physicalFreeFactor cut aux let N := ⌈3*Z*(d : ℝ)⌉₊ let Y := Z*(d : ℝ)/2 let M := (markedDivisorBound (1/2) v (ell+J))^Fintype.card G let energy := 2*((N : ℝ)/Y)*(1+Real.log N)^15 let H := repeatedBigPrimePatternBound probes r t Q ξ i ‖physicalPositiveHarmonicDifference P V probes r t hrt Q h ξ i aux a b Z k pool α β γ α' β' γ'‖ ≤ (M*M*(A*B*C)^2*energy)*ε + (2*M*M*(A*B*C)^2*energy*H)*(∑ p ∈ physicalFreePrimeSet cut aux, 1/(p : ℝ)) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) let cut := repeatedBigPrimePatternCut probes r t i let d := physicalFreeFactor cut aux let δ : ℤ := k*(d : ℤ) let N := ⌈3*Z*(d : ℝ)⌉₊ let S := harmonicPositiveSupport Z k d let θ := fun n : ℤ => (typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ) let F := fun n : ℤ => θ n/(n : ℂ)*star (invariantTripleEndpoint pool α β γ n.natAbs)* invariantTripleEndpoint pool α' β' γ' (n+δ).natAbs have hd : 0 < d := prod_pos (fun g _ => prod_pos (fun u _ => (hprime g _ (aux g u).property).pos)) have hs := harmonic_positive_error_parameters hZ k hd hk have hshared := physical_prime_harmonic_pair_error P V probes hprime hdis hv hV hMass r t hrt Q h ξ hξ i aux a b hPmin hε hp pool α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' S δ N (fun n hn => (hs.2 n hn).1) (fun n hn => (hs.2 n hn).2.1) hs.1 (by norm_num : (0 : ℝ) ≤ 2) (fun n hn => (hs.2 n hn).2.2.1) θ (fun n hn => (hs.2 n hn).2.2.2) herror have haux := physical_prime_aux_harmonic_error P V probes hprime hv hV r t hrt Q h ξ hξ i aux a b k pool hpool α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' S N (fun n hn => (hs.2 n hn).1) (fun n hn => ⟨(hs.2 n hn).2.1.1.le, (hs.2 n hn).2.1.2⟩) hs.1 (by norm_num : (0 : ℝ) ≤ 2) (fun n hn => (hs.2 n hn).2.2.1) θ (fun n hn => (hs.2 n hn).2.2.2) have hdec := physical_prime_harmonic_decomposition P V probes r t hrt Q h ξ i aux a b S δ F apply (congrArg norm hdec).trans_le apply ((norm_add_le _ _).trans (add_le_add hshared haux)).trans_eq ring end Bounty end section /- The exact unrestricted main term already present in the harmonic difference. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalFreePositiveHarmonicMain {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) : ℂ := let cut := repeatedBigPrimePatternCut probes r t i let d := physicalFreeFactor cut aux let δ : ℤ := k*(d : ℤ) let marks := fun g => ell+(cut g).card let W := fun n : ℤ => markedDivisorWeight univ P (1/2) V marks n let S := harmonicPositiveSupport Z k d let F := fun n : ℤ => ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)/(n : ℂ)) * star (invariantTripleEndpoint pool α β γ n.natAbs) * invariantTripleEndpoint pool α' β' γ' (n+δ).natAbs ∑ n ∈ S, F n * ((W n.natAbs * W (n+δ).natAbs : ℝ) : ℂ) * groupMarkedAverage P marks (n.natAbs : ℤ) (fun u => groupMarkedAverage P marks ((n+δ).natAbs : ℤ) (physicalFreePrimePairCoefficient P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs u)) theorem physical_positive_harmonic_difference_eq_main {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) : let cut := repeatedBigPrimePatternCut probes r t i let d := physicalFreeFactor cut aux let δ : ℤ := k*(d : ℤ) physicalPositiveHarmonicDifference P V probes r t hrt Q h ξ i aux a b Z k pool α β γ α' β' γ' = (∑ n ∈ harmonicPositiveSupport Z k d, ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)/(n : ℂ)) * star (invariantTripleEndpoint pool α β γ n.natAbs) * invariantTripleEndpoint pool α' β' γ' (n+δ).natAbs * physicalFullPairCorrelation P cut V (1/2) n.natAbs (n+δ).natAbs (physicalOriginalPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs)) - physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ i aux a b Z k pool α β γ α' β' γ' := rfl end Bounty end section /- The original harmonic cutoff separates exactly from the auxiliary free product. -/ open Finset MeasureTheory namespace Bounty end Bounty end section /- An auxiliary-independent finite support for the actual cell-localized harmonic cutoff. -/ open Finset namespace Bounty noncomputable def harmonicCommonSupport (Y : ℝ) : Finset ℤ := Icc ⌈Y/8⌉ ⌊4*Real.exp 2*Y⌋ theorem mem_harmonic_common_support {Y : ℝ} {n : ℤ} : n ∈ harmonicCommonSupport Y ↔ Y/8 ≤ (n : ℝ) ∧ (n : ℝ) ≤ 4*Real.exp 2*Y := by simp only [harmonicCommonSupport, mem_Icc, Int.ceil_le, Int.le_floor] theorem harmonic_common_support_positive {Y : ℝ} (hY : 0 < Y) {n : ℤ} (hn : n ∈ harmonicCommonSupport Y) : 0 < n := by have hnr : (0 : ℝ) < n := (div_pos hY (by norm_num)).trans_le (mem_harmonic_common_support.mp hn).1 exact_mod_cast hnr section variable {Z H : ℝ} (hZ : 0 < Z) (hH : 0 < H) {d : ℕ} (hHd : H ≤ (d : ℝ)) (hdH : (d : ℝ) ≤ Real.exp 2*H) include Z H hZ hH d hHd hdH theorem harmonic_positive_support_subset_common (k : ℤ) : harmonicPositiveSupport Z k d ⊆ harmonicCommonSupport (Z*H) := by intro n hn have hs := mem_harmonic_positive_support hn apply mem_harmonic_common_support.mpr have hY : 0 < Z*H := mul_pos hZ hH have hlow := mul_le_mul_of_nonneg_left hHd hZ.le have hupp := mul_le_mul_of_nonneg_left hdH hZ.le have he : 0 < Real.exp 2 := Real.exp_pos _ constructor <;> nlinarith [hs.2.1, hs.2.2.1] theorem harmonic_nonzero_mem_positive_support {k n : ℤ} (hk : |(k : ℝ)| ≤ Z/4) (hψ : typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) ≠ 0) : n ∈ harmonicPositiveSupport Z k d := by have hd : (0 : ℝ) < d := hH.trans_le hHd have hZd : 0 < Z*(d : ℝ) := mul_pos hZ hd have hs := typeII_harmonic_dyadic_support hψ have hlo := (lt_div_iff₀ hZd).mp hs.1 have hhi := (div_lt_iff₀ hZd).mp hs.2 have hw := harmonic_common_window_of_scale hZ hH hHd hdH hk hψ have hn0 : 0 < n := by have hnr : (0 : ℝ) < n := (div_pos (mul_pos hZ hH) (by norm_num)).trans hw.1.1 exact_mod_cast hnr have hshift : 0 < n+k*(d : ℤ) := by have hz : (0 : ℝ) < (n+k*(d : ℤ) : ℤ) := (div_pos (mul_pos hZ hH) (by norm_num)).trans hw.2.1 exact_mod_cast hz exact mem_filter.mpr ⟨mem_Icc.mpr ⟨by omega, Int.le_floor.mpr (by simpa only [mul_assoc] using hhi.le)⟩, by linarith, hshift⟩ theorem harmonic_sum_common_support {k : ℤ} (hk : |(k : ℝ)| ≤ Z/4) (c : ℤ → ℂ) : (∑ n ∈ harmonicPositiveSupport Z k d, (typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)*c n) = ∑ n ∈ harmonicCommonSupport (Z*H), (typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)*c n := by apply sum_subset (harmonic_positive_support_subset_common hZ hH hHd hdH k) intro n _ hn have hz : typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) = 0 := by by_contra hne exact hn (harmonic_nonzero_mem_positive_support hZ hH hHd hdH hk hne) rw [hz, Complex.ofReal_zero, zero_mul] end end Bounty end section /- The fixed smooth logarithmic Fourier weight for the common source cutoff divided by its argument. -/ open MeasureTheory open scoped FourierTransform ContDiff namespace Bounty end Bounty end section /- The fixed smooth logarithmic Fourier weight for the common window cutoff. -/ open MeasureTheory open scoped FourierTransform ContDiff namespace Bounty noncomputable def harmonicWindowLogCutoff (u : ℝ) : ℂ := (harmonicCommonCutoff (Real.exp u) : ℂ) theorem harmonic_window_log_cutoff_contDiff : ContDiff ℝ ∞ harmonicWindowLogCutoff := by apply Complex.ofRealCLM.contDiff.comp exact harmonic_common_cutoff_contDiff.comp Real.contDiff_exp theorem harmonic_window_log_cutoff_support {u : ℝ} (hu : harmonicWindowLogCutoff u ≠ 0) : u ∈ Set.Icc (-Real.log 8) (Real.log 4 + 2) := by have hcut : harmonicCommonCutoff (Real.exp u) ≠ 0 := by intro hz apply hu simp only [harmonicWindowLogCutoff, hz, Complex.ofReal_zero] have hs := harmonic_common_cutoff_support hcut have hlo := Real.log_lt_log (by norm_num : (0 : ℝ) < 1/8) hs.1 have hhi := Real.log_lt_log (Real.exp_pos u) hs.2 rw [Real.log_div (by norm_num : (1 : ℝ) ≠ 0) (by norm_num : (8 : ℝ) ≠ 0), Real.log_one, zero_sub, Real.log_exp] at hlo rw [Real.log_exp, Real.log_mul (by norm_num : (4 : ℝ) ≠ 0) (Real.exp_ne_zero 2), Real.log_exp] at hhi exact ⟨hlo.le, hhi.le⟩ theorem harmonic_window_log_cutoff_hasCompactSupport : HasCompactSupport harmonicWindowLogCutoff := by apply HasCompactSupport.intro (K := Set.Icc (-Real.log 8) (Real.log 4 + 2)) isCompact_Icc intro u hu by_contra hne exact hu (harmonic_window_log_cutoff_support hne) noncomputable def harmonicWindowLogSchwartz : SchwartzMap ℝ ℂ := harmonic_window_log_cutoff_hasCompactSupport.toSchwartzMap harmonic_window_log_cutoff_contDiff noncomputable def harmonicWindowLogFourier : SchwartzMap ℝ ℂ := 𝓕 harmonicWindowLogSchwartz theorem harmonic_window_log_fourier_integrable : Integrable harmonicWindowLogFourier := harmonicWindowLogFourier.integrable theorem harmonic_window_log_fourier_inversion (u : ℝ) : harmonicWindowLogCutoff u = ∫ v : ℝ, Complex.exp ((2*Real.pi*v*u : ℝ)*Complex.I) * harmonicWindowLogFourier v := by have hi := congrArg (fun f : SchwartzMap ℝ ℂ => f u) (FourierPair.fourierInv_fourier_eq (E := SchwartzMap ℝ ℂ) (F := SchwartzMap ℝ ℂ) harmonicWindowLogSchwartz) rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq'] at hi change (∫ v : ℝ, Complex.exp ((2*Real.pi*inner ℝ v u : ℝ)*Complex.I) • harmonicWindowLogFourier v) = harmonicWindowLogCutoff u at hi rw [← hi] apply integral_congr_ae filter_upwards [] with v simp only [RCLike.inner_apply, starRingEnd_apply, star_trivial, smul_eq_mul] congr 2 push_cast ring end Bounty end section /- One extra power absorbs the fixed Fourier L1 mass, uniformly in the central radius. -/ open MeasureTheory Filter namespace Bounty theorem eventually_harmonic_central_integral_decay (D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (Y R : ℝ) (G : ℝ → ℂ), 0 < Y → (∀ v : ℝ, ‖v‖ ≤ R → ‖G v‖ ≤ Y*L^(-(D+1))) → ‖(Y : ℂ)⁻¹ * ∫ v in {v : ℝ | ‖v‖ ≤ R}, harmonicLogFourier v * G v‖ ≤ L^(-D) := by filter_upwards [eventually_ge_atTop (max 1 (∫ v : ℝ, ‖harmonicLogFourier v‖))] with L hL intro Y R G hY hG have hL0 : 0 < L := zero_lt_one.trans_le ((le_max_left _ _).trans hL) have hmass := (le_max_right _ _).trans hL have hs : MeasurableSet {v : ℝ | ‖v‖ ≤ R} := (isClosed_le continuous_norm continuous_const).measurableSet have hGe : ∀ᵐ v ∂volume.restrict {v : ℝ | ‖v‖ ≤ R}, ‖G v‖ ≤ Y*L^(-(D+1)) := (ae_restrict_mem hs).mono (fun v hv => hG v hv) refine (normalized_harmonic_central_bound hY (Real.rpow_pos_of_pos hL0 _).le _ G hGe).trans ?_ calc _ ≤ L * L^(-(D+1)) := mul_le_mul_of_nonneg_right hmass (Real.rpow_pos_of_pos hL0 _).le _ = L^(-D) := by calc _ = L^(1 : ℝ) * L^(-(D+1)) := by rw [Real.rpow_one] _ = _ := by rw [← Real.rpow_add hL0]; congr 1; ring end Bounty end section /- The original physical initial mass and finite selected-path sum obey one scalar energy estimate. -/ open Finset namespace Bounty section Energy variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) omit [∀ g, ∀ p : ↥(P g), NeZero p.val] in theorem physical_selected_initial_pairing (a : PhysicalMarkLists P J ell → ℂ) (F : PhysicalBoundedMarkState P J ell B → ℂ) : (∑ M : PhysicalMarkLists P J ell, a M * (∑ d ∈ S, w d * finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C d.1 d.2.1 d.2.2.1 d.2.2.2 k β V ρ hV ω retention) (4 * n + 1) F (physicalInitialMarkState B M))) = ∑ d ∈ S, a (d.2.1 0) * (w d * finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C d.1 d.2.1 d.2.2.1 d.2.2.2 k β V ρ hV ω retention) (4 * n + 1) F (physicalInitialMarkState B (d.2.1 0))) := by apply finite_selected_source_pairing intro d hd M have h := physical_selected_fine_initial_mark_indicator C d.1 d.2.1 d.2.2.1 d.2.2.2 k β V ρ hV ω retention F M split_ifs with hM · simpa only [if_pos hM] using h · simpa only [if_neg hM] using h end Energy end Bounty end section /- The actual root residue model equals the baseline times its original memory-history sum. -/ open Finset open scoped Classical namespace Bounty section Normalization variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (b : PhysicalPrime P → ℝ) (hb : ∀ a, b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a, b a ≠ 0) include hP hdis hk hb hb0 end Normalization end Bounty end section /- Incompatible residue paths have zero complete normalized phase product. -/ open Finset open scoped Classical namespace Bounty section Finite variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) {patterns : Finset I} (C : I → Fin N → Finset (Fin J)) (q : ℝ) (k : ℕ → I → ℤ) (b : PhysicalPrime P → ℝ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) end Finite end Bounty end section /- The recovered trace coefficient is a product of local active-endpoint factors. -/ open Finset open scoped Classical namespace Bounty section Record variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) noncomputable def physicalObservedCoefficient (j : Fin n) (o : PhysicalMarkObservation P ell C) (s t : (g : Fin N) → Fin (J + ell) → ↥(P g)) : ℂ := if h : ∃ a : PhysicalAuxLabels P (C j), o = .inr (some ⟨j, a⟩) then physicalActiveCoefficient (cut (4 * j.val + 2)) (cut (4 * j.val + 3)) (C j) (ζ j) (K j) s t h.choose else 0 theorem physical_observed_coefficient_aux (j : Fin n) (a : PhysicalAuxLabels P (C j)) (s t : (g : Fin N) → Fin (J + ell) → ↥(P g)) : physicalObservedCoefficient C cut ζ K j (.inr (some ⟨j, a⟩)) s t = physicalActiveCoefficient (cut (4 * j.val + 2)) (cut (4 * j.val + 3)) (C j) (ζ j) (K j) s t a := by have h : ∃ b : PhysicalAuxLabels P (C j), (Sum.inr (some ⟨j, a⟩) : PhysicalMarkObservation P ell C) = .inr (some ⟨j, b⟩) := ⟨a, rfl⟩ unfold physicalObservedCoefficient rw [dif_pos h] have he : h.choose = a := by exact (eq_of_heq (Sigma.mk.inj_iff.mp (Option.some.inj (Sum.inr.inj h.choose_spec))).2).symm rw [he] noncomputable def physicalRecordCoefficient (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) : ℂ := ∏ j : Fin n, match r[4 * j.val + 1]?, r[4 * j.val + 2]? with | some s, some t => physicalObservedCoefficient C cut ζ K j t.2.1 (fun g => (s.2.2.2 g).1) (fun g => (t.2.2.2 g).1) | _, _ => 0 theorem physical_record_coefficient_decoded (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (hlen : r.length = 4 * n + 1) (ho : ∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.1 = o i) (ht : ∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.2 = physicalBoundedMarkEncode (cut (i + 1)) (t i)) (a : ∀ j, PhysicalAuxLabels P (C j)) (ha : ∀ j, o (4 * j.val + 2) = .inr (some ⟨j, a j⟩)) : physicalRecordCoefficient C cut ζ K r = ∏ j : Fin n, K j (t (4 * j.val + 1)).1 (t (4 * j.val + 2)).1 (a j) * physicalPhase (ζ j) (physicalD (C j) (t (4 * j.val + 1)).1 (a j)) := by unfold physicalRecordCoefficient apply prod_congr rfl intro j _ have h1 : 4 * j.val + 1 < r.length := by omega have h2 : 4 * j.val + 2 < r.length := by omega rw [List.getElem?_eq_getElem h1, List.getElem?_eq_getElem h2] change physicalObservedCoefficient C cut ζ K j (r.get ⟨_, h2⟩).2.1 (fun g => ((r.get ⟨_, h1⟩).2.2.2 g).1) (fun g => ((r.get ⟨_, h2⟩).2.2.2 g).1) = _ rw [ho _ h2, ha j, physical_observed_coefficient_aux, ht _ h1, ht _ h2] exact physical_active_coefficient_encode _ _ _ _ _ _ _ _ end Record end Bounty end section /- A supported original root term, with memory expansion confined to selected groups. -/ open Finset open scoped Classical namespace Bounty theorem physical_finite_root_term_partial_memory_normalization {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (hp : physicalRootNormalizablePath V patterns C ζ k K L p) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin (n + 1), ∀ g s, ¬ (((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc g s).val : ℤ) ∣ physicalPathSelectedMultiplier C k p j) (b : PhysicalPrime P → ℝ) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a ≠ 0) : (physicalStateMass V J ell : ℂ) * physicalFiniteReturnScalar V patterns C ζ k K n L p * (physicalFiniteVertexExpectation C q k n L p : ℂ) = (physicalGroupPathMass V groupsᶜ (fun j => C (finitePathLabels p j).2.2.1.val) ell (n + 1) : ℂ) * physicalMemoryWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L p) (n + 1) * (poolPathResidueExpectation (fun a : PhysicalPrime P => a.2.val) (physicalPrimeGroups P groupsᶜ) (range (n + 2)) (fun a => (range (n + 2)).filter (fun j => a ∈ physicalMarkedPrimes (finitePathMarks L p j))) (fun a j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j : ZMod a.2.val)) (fun j => 1 - physicalEndpointSchedule q (n + 1) j) : ℝ) * (∏ a ∈ physicalPrimeGroups P groups, b a : ℝ) * (∏ a ∈ physicalPrimeGroups P groups, ghostPhaseRunHistory (fun j => decide (a ∈ physicalMarkedPrimes (finitePathMarks L p j))) (fun j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j : ZMod a.2.val)) (fun j => 1 - physicalEndpointSchedule q (n + 1) j) ((a.2.val : ℝ) * b a)⁻¹ (V a.1) (n + 1) : ℝ) := by obtain ⟨r, hr⟩ := hp.2 have hn := physical_finite_path_new_marks V patterns C ζ k K L p hp.1 r hr hP hdis hk rw [physical_root_normalizable_return_eq_walk V patterns C ζ k K L p hp] exact physical_partial_memory_walk_normalization groups V patterns C ζ K (finitePathLabels p) (finitePathMarks L p) (n + 1) _ _ b (fun j hj g _ => hn j hj g) hb hb0 end Bounty end section /- With unit endpoint coefficient and empty small cuts, only the small shared prefix remains. -/ open Finset open scoped Classical namespace Bounty section Groups variable {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (small : G → Prop) (C : G → Finset (Fin J)) (hC : ∀ g, small g → C g = ∅) (ζ : ℝ) end Groups end Bounty end section /- The balanced candidate bound for the actual global prime proxies. -/ open Finset Filter namespace Bounty theorem exists_candidate_balanced_logarithmic_prime_proxy_bound {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) : ∃ C : ℝ, 0 < C ∧ ∃ J : ℕ, ∀ S : ℝ, 0 ≤ S → ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ jStar : ℕ, J < jStar → ∀ (F : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ), (∀ v ∈ F, balancedPairWindow κ L v) → (∀ v ∈ F, v.1*v.2=2*u v+1) → (∑ v ∈ F, candidateCoefficient c L q r jStar (u v)* primeLogarithmicProxy L S v.1*primeLogarithmicProxy L S v.2) ≤ C*(κ+1/L)*candidateCoefficientWindowMass c L q r jStar/L := by obtain ⟨C,hC,J,hbound⟩ := exists_candidate_balanced_prime_proxy_bound hc hr hq0 hq1 hcenter (by norm_num : (0:ℝ)<1/5) refine ⟨C,hC,J,?_⟩ intro S hS filter_upwards [hbound S,eventually_ge_atTop (5:ℝ)] with L hb hL intro κ hκ hκup jStar hj F u hF hprod have hL1 : 1 ≤ L := by linarith have hL0 : 0 < L := by linarith have hδ : 0 < L^(-S) := by positivity have hδ1 : L^(-S) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hL1 (by linarith) have hsmall : L^(-S) ≤ (2/5:ℝ)*L/2 := by linarith let Y : ℕ → ℝ := fun n => logarithmicCellBase (L^(-S)) (logarithmicCellIndex (L^(-S)) n) have hbase (n : ℕ) (hn : Real.exp (((1/2:ℝ)-2*κ)*L) ≤ (n:ℝ)) : Real.exp ((1/5:ℝ)*L) ≤ Y n := by have hlow : Real.exp ((2/5:ℝ)*L) ≤ (n:ℝ) := by apply le_trans _ hn apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonneg_right (by linarith) hL0.le simpa only [show (2/5:ℝ)/2=1/5 by norm_num] using logarithmic_cell_base_lower hδ hsmall hlow have hh := hb κ hκ hκup jStar hj F u Y Y hF hprod (fun v hv => ⟨hbase v.1 (hF v hv).1,hbase v.2 (hF v hv).2.2.1⟩) exact hh end Bounty end section /- Concrete ambient enlargement and prime-mass lower bound with all spectral errors explicit. -/ open Finset Filter Real namespace Bounty noncomputable def ambientBuchstabUnbalancedTest (T : Finset ℕ) (μ : ℕ → ℝ) (b q L : ℝ) (N : ℕ) : ℝ := ∑ i : Fin N, ∑ v ∈ shiftedPrimeBandPairs T (exp (reciprocalGrid b q N i*L)) (exp (reciprocalGrid b q N ((i : ℕ)+1)*L)), μ (shiftedPairIndex v)*roughTestIndicator (reciprocalGrid b q N i) L v.2 noncomputable def ambientBuchstabBalancedTest (T : Finset ℕ) (μ : ℕ → ℝ) (κ L : ℝ) : ℝ := ∑ v ∈ shiftedBalancedPairs T κ L, μ (shiftedPairIndex v)* (if v.1.Prime then 1 else 0 : ℝ)*(if v.2.Prime then 1 else 0 : ℝ) noncomputable def ambientBuchstabUnbalancedProxy (T : Finset ℕ) (μ : ℕ → ℝ) (b q L S : ℝ) (N : ℕ) : ℝ := ∑ i : Fin N, ∑ v ∈ shiftedPrimeBandPairs T (exp (reciprocalGrid b q N i*L)) (exp (reciprocalGrid b q N ((i : ℕ)+1)*L)), μ (shiftedPairIndex v)*roughTestLogarithmicProxy (reciprocalGrid b q N i) L S v.2 noncomputable def ambientBuchstabBalancedProxy (T : Finset ℕ) (μ : ℕ → ℝ) (κ L S : ℝ) : ℝ := ∑ v ∈ shiftedBalancedPairs T κ L, μ (shiftedPairIndex v)* primeLogarithmicProxy L S v.1*primeLogarithmicProxy L S v.2 noncomputable def ambientBuchstabMeshError (T : Finset ℕ) (μ : ℕ → ℝ) (b q κ L S : ℝ) (N : ℕ) : ℝ := (∑ i : Fin N, ambientRoughProxyError T μ (reciprocalGrid b q N i) L S (exp (reciprocalGrid b q N i*L)) (exp (reciprocalGrid b q N ((i : ℕ)+1)*L)))+ ambientPrimeProxyError T μ κ L S theorem shifted_buchstab_mesh_bin_subset_ambient {T : Finset ℕ} (hT : ∀ u ∈ T, 0 < u) (b q L : ℝ) (N i : ℕ) : shiftedBuchstabMeshBin T b q L N i ⊆ shiftedPrimeBandPairs T (exp (reciprocalGrid b q N i*L)) (exp (reciprocalGrid b q N (i+1)*L)) := by intro v hv have hm := mem_shifted_buchstab_mesh_bin.mp hv apply mem_filter.mpr exact ⟨shifted_buchstab_pairs_subset_factor_pairs T _ hT (mem_shifted_buchstab_unbalanced_pairs.mp hm.1).1, hm.2⟩ theorem shifted_buchstab_balanced_subset_ambient {T : Finset ℕ} (hT : ∀ u ∈ T, 0 < u) {b q κ L : ℝ} (hwindow : ∀ v ∈ shiftedBuchstabBalancedPairs T b q L, balancedPairWindow κ L v) : shiftedBuchstabBalancedPairs T b q L ⊆ shiftedBalancedPairs T κ L := by classical intro v hv apply mem_filter.mpr exact ⟨shifted_buchstab_pairs_subset_factor_pairs T _ hT (mem_shifted_buchstab_balanced_pairs.mp hv).1, hwindow v hv⟩ theorem ambient_buchstab_tests_eq_proxy_add_error (T : Finset ℕ) (μ : ℕ → ℝ) (b q κ L S : ℝ) (N : ℕ) : ambientBuchstabUnbalancedTest T μ b q L N+ambientBuchstabBalancedTest T μ κ L = ambientBuchstabUnbalancedProxy T μ b q L S N+ambientBuchstabBalancedProxy T μ κ L S+ ambientBuchstabMeshError T μ b q κ L S N := by unfold ambientBuchstabUnbalancedTest ambientBuchstabBalancedTest ambientBuchstabUnbalancedProxy ambientBuchstabBalancedProxy ambientBuchstabMeshError simp_rw [ambient_rough_test_sum_eq_proxy_add_error T μ _ L S] rw [sum_add_distrib, ambient_prime_test_sum_eq_proxy_add_error T μ κ L S] ring theorem weighted_shifted_ambient_mesh_test_upper (T : Finset ℕ) (μ : ℕ → ℝ) {b q κ L : ℝ} (hbq : b ≤ q) (hL : 0 ≤ L) {N : ℕ} (hN : 0 < N) (hT : ∀ u ∈ T, 0 < u) (hμ : ∀ u ∈ T, 0 ≤ μ u) (hbal : ∀ v ∈ shiftedBuchstabBalancedPairs T b q L, v.2.Prime ∧ balancedPairWindow κ L v) : (∑ u ∈ shiftedRoughSet T (exp (b*L)), μ u) ≤ (∑ u ∈ (shiftedRoughSet T (exp (b*L))).filter (fun u => (2*u+1).Prime), μ u)+ ambientBuchstabUnbalancedTest T μ b q L N+ambientBuchstabBalancedTest T μ κ L := by have hU : (∑ i : Fin N, ∑ v ∈ shiftedBuchstabMeshBin T b q L N i, μ (shiftedPairIndex v)) ≤ ambientBuchstabUnbalancedTest T μ b q L N := by apply sum_le_sum intro i hi apply shifted_buchstab_mesh_bin_le_ambient_rough_test hT _ μ (shifted_buchstab_mesh_bin_subset_ambient hT b q L N i) intro v hv exact hμ _ (shifted_prime_band_pair_data T _ _ hv).1 have hB := shifted_buchstab_balanced_le_ambient_prime_test hT (shiftedBalancedPairs T κ L) μ (shifted_buchstab_balanced_subset_ambient hT (fun v hv => (hbal v hv).2)) (fun v hv => hμ _ (shifted_balanced_pair_data T κ L hv).1) (fun v hv => (hbal v hv).1) change (∑ v ∈ shiftedBuchstabBalancedPairs T b q L, μ (shiftedPairIndex v)) ≤ ∑ v ∈ shiftedBalancedPairs T κ L, μ (shiftedPairIndex v)* ((if v.1.Prime then 1 else 0)*(if v.2.Prime then 1 else 0)) at hB simp only [← mul_assoc] at hB have h := weighted_shifted_buchstab_mesh_identity T μ hbq hL hN hT change (∑ v ∈ shiftedBuchstabBalancedPairs T b q L, μ (shiftedPairIndex v)) ≤ ambientBuchstabBalancedTest T μ κ L at hB linarith theorem eventually_shifted_ambient_mesh_prime_lower {κ b : ℝ} (hκ : 0 < κ) (hκmax : κ ≤ 1/50) (hb : b ≤ (1/2 : ℝ)-κ) {N : ℕ} (hN : 0 < N) : ∀ᶠ L : ℝ in atTop, ∀ (μ : ℕ → ℝ) (S : ℝ), (∀ u ∈ arithmeticProductWindow 1 (exp L), 0 ≤ μ u) → (∑ u ∈ shiftedRoughSet (arithmeticProductWindow 1 (exp L)) (exp (b*L)), μ u)- ambientBuchstabUnbalancedProxy (arithmeticProductWindow 1 (exp L)) μ b ((1/2 : ℝ)-κ) L S N- ambientBuchstabBalancedProxy (arithmeticProductWindow 1 (exp L)) μ κ L S- ambientBuchstabMeshError (arithmeticProductWindow 1 (exp L)) μ b ((1/2 : ℝ)-κ) κ L S N ≤ ∑ u ∈ (shiftedRoughSet (arithmeticProductWindow 1 (exp L)) (exp (b*L))).filter (fun u => (2*u+1).Prime), μ u := by filter_upwards [eventually_shifted_buchstab_balanced_prime hκ hκmax, eventually_ge_atTop (0 : ℝ)] with L hbalanced hL intro μ S hμ have hT : ∀ u ∈ arithmeticProductWindow 1 (exp L), 0 < u := fun u hu => arithmetic_product_window_one_pos L hu have hbal : ∀ v ∈ shiftedBuchstabBalancedPairs (arithmeticProductWindow 1 (exp L)) b ((1/2 : ℝ)-κ) L, v.2.Prime ∧ balancedPairWindow κ L v := by intro v hv have hh := mem_shifted_buchstab_balanced_pairs.mp hv exact hbalanced (exp (b*L)) v hh.1 hh.2.le have h := weighted_shifted_ambient_mesh_test_upper (arithmeticProductWindow 1 (exp L)) μ hb hL hN hT hμ hbal have heq := ambient_buchstab_tests_eq_proxy_add_error (arithmeticProductWindow 1 (exp L)) μ b ((1/2 : ℝ)-κ) κ L S N linarith end Bounty end section /- Exact divisor/cofactor reindexing of full ambient shifted-product pair sums. -/ open Finset namespace Bounty theorem shifted_pair_index_of_dvd {p u : ℕ} (hd : p ∣ 2*u+1) : shiftedPairIndex (p,(2*u+1)/p) = u := by unfold shiftedPairIndex dsimp only rw [Nat.mul_div_cancel' hd] omega theorem sum_shifted_factor_pairs {M : Type*} [AddCommMonoid M] (T : Finset ℕ) (F : ℕ × ℕ → M) : (∑ v ∈ shiftedFactorPairs T, F v) = ∑ u ∈ T, ∑ p ∈ (2*u+1).divisors, F (p,(2*u+1)/p) := by classical have hprod (u : ℕ) (v : ℕ × ℕ) (hv : v ∈ (2*u+1).divisors.image (fun p => (p,(2*u+1)/p))) : v.1*v.2 = 2*u+1 := by obtain ⟨p,hp,rfl⟩ := mem_image.mp hv exact Nat.mul_div_cancel' (Nat.mem_divisors.mp hp).1 have hd : Set.PairwiseDisjoint (↑T) (fun u => (2*u+1).divisors.image (fun p => (p,(2*u+1)/p))) := by intro u hu w hw huw apply disjoint_left.mpr intro v hvu hvw have h1 := hprod u v hvu have h2 := hprod w v hvw exact huw (by omega) unfold shiftedFactorPairs rw [sum_biUnion hd] apply sum_congr rfl intro u hu rw [sum_image] intro p hp q hq hpq exact congrArg Prod.fst hpq end Bounty end section /- Chronological mixed events: one shared pattern, its original auxiliary, both small endpoints, and the original full big event with both caps. -/ open Finset open scoped Classical namespace Bounty section Events variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) abbrev PhysicalMixedWordState := PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) abbrev PhysicalMixedWordEdge (k : K) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) := Σ i : I, Σ a : A i, PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a)) s def PhysicalMixedWordEvent : Option (V ⊕ K) → PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → Type _ | none, _ => PhysicalPermutations S J ell × FullActiveSlotPermutations M | some (.inl _), s => CoupledGhostEvent M B s.2 | some (.inr k), s => PhysicalMixedWordEdge n shared B A Δ D k s noncomputable abbrev physicalMixedWordEventFintype [Fintype I] [∀ i, Fintype (A i)] [∀ g p, NeZero (n g p)] (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) : Fintype (PhysicalMixedWordEvent n shared B A Δ D tag s) := by cases tag with | none => dsimp [PhysicalMixedWordEvent]; infer_instance | some tag => cases tag <;> dsimp [PhysicalMixedWordEvent, PhysicalMixedWordEdge] <;> infer_instance variable (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) noncomputable def physicalMixedWordTarget (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) : PhysicalMixedWordEvent n shared B A Δ D tag s → PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B := match tag with | none => fun e => ((s.1.1, physicalPermuteLabels e.1 s.1.2), fullActivePermutation e.2 s.2) | some (.inl _) => fun e => (s.1, coupledGhostJointEventTarget M B s.2 e) | some (.inr k) => fun e => physicalSmallBigTarget _ (physicalSmallBigFullTarget n (shared e.1) B (fun d c => Δ k e.1 d c e.2.1) (fun d c => D k e.1 d c e.2.1)) (fun x => kbig k e.1 (productActiveMemorySplit (shared e.1) B x).1 e.2.1) s e.2.2 variable (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) noncomputable def physicalMixedWordWeight (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) : PhysicalMixedWordEvent n shared B A Δ D tag s → ℝ := match tag with | none => fun e => (Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹ * fullActivePermutationWeight M e.2 | some (.inl j) => fun e => coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g => physicalGhostTermination (n g) (qghost j) ρ) (fun g => physicalGhostBirth (n g) (qghost j) ρ (Vb g)) (fun g => unrestrictedResidueWeight (μ g)) M B s.2 e | some (.inr k) => fun e => ω e.1 (productActiveMemorySplit (shared e.1) B s.2).1 e.2.1 * physicalSmallBigPositiveWeight Vs (qedge k) _ (physicalSmallBigFullWeight n (shared e.1) B (fun d c => Δ k e.1 d c e.2.1) (fun d c => D k e.1 d c e.2.1) μ ρ Vb) (fun x => kbig k e.1 (productActiveMemorySplit (shared e.1) B x).1 e.2.1) s e.2.2 end Events end Bounty end section /- The proved candidate truncation errors survive the original normalized finite sums. -/ open Finset MeasureTheory Filter namespace Bounty end Bounty end section /- Uniform Lyapunov rows for an original owner, paying one common atom bound per selected child. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) end Owner end Bounty end section /- The original determinant and spatial indices discharge every saturation-scale input. -/ open Finset Filter namespace Bounty theorem eventually_actual_harmonic_scale_inputs {b K : ℝ} (hb : 0 < b) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ U V : ℝ, Real.exp (b*L) ≤ U → U ≤ Real.exp L → Real.exp (b*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), let Z := typeIISmoothDyadicScale U V (U*L^(-K)) j 0 < Z ∧ Z ≤ 24*U^2*V*L^88/(U*L^(-K)) ∧ |(k : ℝ)| ≤ Z ∧ 3*Z < Real.exp (4*L) := by filter_upwards [eventually_typeII_actual_dyadic_geometry hb hK, eventually_candidate_cross_scale_below_cutoff hb hK,eventually_ge_atTop (1 : ℝ)] with L hgeo hcut hL intro U V hUlo hUhi hVlo hVhi k hk j hj obtain ⟨hU,hV,hE,_,_,_,hscale,_⟩ := hgeo U V (U*L^(-K)) hUlo hUhi hVlo hVhi rfl have hpos := typeII_smooth_dyadic_scale_pos hU hV hE j have hupper := typeII_smooth_dyadic_scale_le hL hU hV hE (mem_range.mp hj) have hk' : |(k : ℝ)| ≤ (typeIIAdmissibleDeterminantBound L K : ℝ) := by apply abs_le.mpr have hh := mem_Icc.mp hk constructor · exact_mod_cast hh.1 · exact_mod_cast hh.2 refine ⟨hpos,hupper,?_,?_⟩ · exact hk'.trans ((le_max_right _ _).trans (hscale.trans (typeII_smooth_dyadic_scale_mono_zero hU hV hE j))) · exact hcut U V (U*L^(-K)) _ hUlo hUhi hVlo hVhi rfl hpos hupper end Bounty end section /- One exponential pool cutoff covers every actual dyadic cross endpoint. -/ open Finset Filter Real namespace Bounty end Bounty end section /- Original determinant and Fourier ranges imply the polynomial integral parameter bounds. -/ open Finset Filter namespace Bounty theorem eventually_original_harmonic_modulus_bound {K : ℝ} (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ((2*k.natAbs : ℕ) : ℝ) ≤ L^(K+89) := by filter_upwards [eventually_ge_atTop (6 : ℝ)] with L hL intro k hk have hL1 : 1 ≤ L := by linarith have hL0 : 0 < L := by linarith have hkNat : k.natAbs ≤ typeIIAdmissibleDeterminantBound L K := by have hh := mem_Icc.mp hk omega have hB := determinant_bound_le_three_rpow_public hL1 hK calc _ = 2*(k.natAbs : ℝ) := by push_cast; rfl _ ≤ 2*(3*L^(K+88)) := mul_le_mul_of_nonneg_left ((Nat.cast_le.mpr hkNat).trans hB) (by norm_num) _ = 6*L^(K+88) := by ring _ ≤ L*L^(K+88) := mul_le_mul_of_nonneg_right hL (by positivity) _ = L^(K+89) := by conv_lhs => lhs; rw [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 ring theorem eventually_original_endpoint_phase_bounds (T F : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (ν : ℝ) (ζ : EuclideanSpace ℝ (Fin 3)), ‖ν‖ ≤ L^T → ‖ζ‖ ≤ L^F → |2*Real.pi*ν| ≤ L^(max T F+1) ∧ ∀ i : Fin 3, |2*Real.pi*ν+2*Real.pi*ζ i| ≤ L^(max T F+1) ∧ |2*Real.pi*ν-2*Real.pi*ζ i| ≤ L^(max T F+1) := by filter_upwards [eventually_ge_atTop (max 1 (4*Real.pi))] with L hL intro ν ζ hν hζ have hL1 : 1 ≤ L := (le_max_left _ _).trans hL have hL0 : 0 < L := zero_lt_one.trans_le hL1 have hLpi : 4*Real.pi ≤ L := (le_max_right _ _).trans hL have hν' : |ν| ≤ L^(max T F) := by have hn : |ν| ≤ L^T := by simpa only [Real.norm_eq_abs] using hν exact hn.trans (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left _ _)) have hζ' (i : Fin 3) : |ζ i| ≤ L^(max T F) := by have hz : |ζ i| ≤ ‖ζ‖ := by simpa only [Real.norm_eq_abs] using PiLp.norm_apply_le ζ i exact hz.trans (hζ.trans (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_right _ _))) have hpi : 0 ≤ 2*Real.pi := by positivity have hcap : (4*Real.pi)*L^(max T F) ≤ L^(max T F+1) := by calc _ ≤ L*L^(max T F) := mul_le_mul_of_nonneg_right hLpi (by positivity) _ = _ := by rw [Real.rpow_add hL0,Real.rpow_one]; ring have hνbound : |2*Real.pi*ν| ≤ (2*Real.pi)*L^(max T F) := by rw [abs_mul,abs_of_nonneg hpi] exact mul_le_mul_of_nonneg_left hν' hpi refine ⟨(hνbound.trans ?_).trans hcap, ?_⟩ · exact mul_le_mul_of_nonneg_right (by linarith [Real.pi_pos]) (by positivity) · intro i have hzbound : |2*Real.pi*ζ i| ≤ (2*Real.pi)*L^(max T F) := by rw [abs_mul,abs_of_nonneg hpi] exact mul_le_mul_of_nonneg_left (hζ' i) hpi constructor · exact ((abs_add_le _ _).trans (by linarith [hνbound,hzbound])).trans hcap · exact ((abs_sub _ _).trans (by linarith [hνbound,hzbound])).trans hcap end Bounty end section /- A group-uniform threshold for the actual harmonic energy prefactor. -/ open Filter Finset open scoped Classical namespace Bounty theorem eventually_physical_harmonic_energy_polynomial {A s : ℝ} (hA : 0 ≤ A) (hs : 0 ≤ s) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type*) [Fintype G] (P : G → Finset ℕ) (J : ℕ) (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C), (∀ g p, p ∈ P g → p.Prime) → (∀ g p, p ∈ P g → Real.log (p : ℝ) ≤ L^s) → (J*Fintype.card G : ℕ) ≤ A*Real.log L → ∀ Z : ℝ, 0 < Z → 1 ≤ Z*(physicalFreeFactor C aux : ℝ) → 3*Z < Real.exp (4*L) → 2*((⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ)/(Z*(physicalFreeFactor C aux : ℝ)/2))* (1+Real.log (⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ))^15 ≤ L^(15*(max 1 s+1)+1) := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (16*(5+Real.log 4+A)^15)] with L hL hcost intro G _ P J C aux hprime hplog hslots Z hZ hprod hcut have hL0 : 0 < L := zero_lt_one.trans_le hL have hp : ∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp (L^s) := by intro g p hp apply (Real.log_le_iff_le_exp (by exact_mod_cast (hprime g p hp).pos)).mp exact hplog g p hp have hlog := physical_harmonic_log_bound_of_original_cutoff C aux hprime (Real.rpow_nonneg hL0.le _) hZ hp hprod hcut have hslot : L^s*((J*Fintype.card G : ℕ) : ℝ) ≤ A*L^s*Real.log L := by simpa only [mul_assoc, mul_left_comm] using mul_le_mul_of_nonneg_left hslots (Real.rpow_nonneg hL0.le s) have hlog' : Real.log (⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ) ≤ Real.log 4+4*L+A*L^s*Real.log L := by linarith have hN : 1 ≤ (⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ) := by have hh : 1 ≤ 3*Z*(physicalFreeFactor C aux : ℝ) := by nlinarith [hprod] exact hh.trans (Nat.le_ceil _) have hr : (⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ)/(Z*(physicalFreeFactor C aux : ℝ)/2) ≤ 8 := by simpa only [mul_assoc] using (harmonic_ceiling_scale_bounds hprod).2.1 exact harmonic_energy_scalar_polynomial hA hs hL hcost hN hr hlog' end Bounty end section /- The total logarithmic cost of subexponential prime labels is sublinear. -/ open Filter namespace Bounty theorem eventually_scaled_log_sublinear {A s ε : ℝ} (hA : 0 ≤ A) (hs : s < 1) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, A*L^s*Real.log L ≤ ε*L := by have hsmall := ((isLittleO_log_rpow_atTop (sub_pos.mpr hs)).const_mul_left A).bound hε filter_upwards [hsmall, eventually_ge_atTop (1 : ℝ)] with L hb hL have hL0 : 0 < L := zero_lt_one.trans_le hL have hn : A*Real.log L ≤ ε*L^(1-s) := by simpa only [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hA (Real.log_nonneg hL)), abs_of_nonneg (Real.rpow_nonneg hL0.le (1-s))] using hb calc _ = L^s*(A*Real.log L) := by ring _ ≤ L^s*(ε*L^(1-s)) := mul_le_mul_of_nonneg_left hn (Real.rpow_nonneg hL0.le s) _ = ε*(L^s*L^(1-s)) := by ring _ = ε*L := by rw [← Real.rpow_add hL0] have he : s+(1-s) = (1 : ℝ) := by ring rw [he, Real.rpow_one] end Bounty end section /- The complete original small walk and vertex factor is an exact product of local bare edge factors and the two translated endpoint weights. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_vertex_walk_edges {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (V : Fin N → ℝ) {q : ℝ} (hq : 0 ≤ q) (k : ℕ → I → ℤ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (r : PhysicalGroupResidues P groups) : physicalBareWalkScalar (fun g : ↥groups => V g.val) patterns (fun i g => C i g.val) (fun _ _ => 0) (fun _ _ _ _ _ => 1) (fun j => physicalRestrictedEdge (fun g => g ∈ groups) patterns C (finitePathLabels p j)) (fun j g => finitePathMarks L p j g.val) (n + 1) * (physicalGroupFiniteVertexWeight groups C q k L p r : ℂ) = ∏ j : Fin (n + 1), physicalBareLabeledScalar (fun g : ↥groups => V g.val) patterns (fun i g => C i g.val) (fun _ => 0) (fun _ _ _ _ => 1) (physicalRestrictedEdge (fun g => g ∈ groups) patterns C (p j).1) (fun g => finitePathMarks L p j.val g.val) (fun g => finitePathMarks L p (j.val + 1) g.val) * ((physicalResidueVertexWeight (fun g : ↥groups => physicalPermuteLabels (p j).1.1 (finitePathMarks L p j.val) g.val) (Real.sqrt q) (physicalTranslateResidues (physicalGroupResidueVector r) (physicalPathSelectedOffset C k L p j.castSucc)) * physicalResidueVertexWeight (fun g : ↥groups => physicalPermuteLabels (p j).1.2.1 (finitePathMarks L p (j.val + 1)) g.val) (Real.sqrt q) (physicalTranslateResidues (physicalGroupResidueVector r) (physicalPathSelectedOffset C k L p j.succ)) : ℝ) : ℂ) := by rw [physical_group_finite_vertex_weight_edges groups C hq k L p r] rw [Complex.ofReal_prod, physicalBareWalkScalar, ← Fin.prod_univ_eq_prod_range, ← Finset.prod_mul_distrib] apply prod_congr rfl intro j _ simp only [finitePathLabels, dif_pos j.isLt] end Bounty end section /- The chronological record recovers every original big-edge displacement and thus any function of the cumulative selected offsets. -/ open Finset open scoped Classical namespace Bounty section Record variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) noncomputable def physicalActiveDisplacement (j : Fin n) (s : (g : Fin N) → Fin (J + ell) → ↥(P g)) (a : PhysicalAuxLabels P (C j)) : ℤ := if hs : ∀ g, Function.Injective (s g) then k j * (physicalD (C j) (physicalActiveMarkLabels (cut (4 * j.val + 2)) s hs) a : ℤ) else 0 noncomputable def physicalObservedDisplacement (j : Fin n) (o : PhysicalMarkObservation P ell C) (s : (g : Fin N) → Fin (J + ell) → ↥(P g)) : ℤ := if h : ∃ a : PhysicalAuxLabels P (C j), o = .inr (some ⟨j, a⟩) then physicalActiveDisplacement C k cut j s h.choose else 0 noncomputable def physicalRecordDisplacement (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (j : Fin n) : ℤ := match r[4 * j.val + 1]?, r[4 * j.val + 2]? with | some s, some t => physicalObservedDisplacement C k cut j t.2.1 (fun g => (s.2.2.2 g).1) | _, _ => 0 theorem physical_observed_displacement_aux (j : Fin n) (a : PhysicalAuxLabels P (C j)) (s : (g : Fin N) → Fin (J + ell) → ↥(P g)) : physicalObservedDisplacement C k cut j (.inr (some ⟨j, a⟩)) s = physicalActiveDisplacement C k cut j s a := by have h : ∃ b : PhysicalAuxLabels P (C j), (Sum.inr (some ⟨j, a⟩) : PhysicalMarkObservation P ell C) = .inr (some ⟨j, b⟩) := ⟨a, rfl⟩ unfold physicalObservedDisplacement rw [dif_pos h] have he : h.choose = a := by exact (eq_of_heq (Sigma.mk.inj_iff.mp (Option.some.inj (Sum.inr.inj h.choose_spec))).2).symm rw [he] theorem physical_active_displacement_encode (j : Fin n) (L : PhysicalMarkLists P J ell) (a : PhysicalAuxLabels P (C j)) : physicalActiveDisplacement C k cut j (fun g i => L g (physicalFullSlotIndex (cut (4 * j.val + 2) g) i)) a = k j * (physicalD (C j) L a : ℤ) := by have hL : ∀ g, Function.Injective (fun i => L g (physicalFullSlotIndex (cut (4 * j.val + 2) g) i)) := fun g => (L g).injective.comp (physicalFullSlotIndex (cut (4 * j.val + 2) g)).injective simp only [physicalActiveDisplacement, dif_pos hL, physical_active_mark_labels_encode] theorem physical_record_displacement_decoded (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (hlen : r.length = 4 * n + 1) (ho : ∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.1 = o i) (ht : ∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.2 = physicalBoundedMarkEncode (cut (i + 1)) (t i)) (a : ∀ j, PhysicalAuxLabels P (C j)) (ha : ∀ j, o (4 * j.val + 2) = .inr (some ⟨j, a j⟩)) (j : Fin n) : physicalRecordDisplacement C k cut r j = k j * (physicalD (C j) (t (4 * j.val + 1)).1 (a j) : ℤ) := by have h1 : 4 * j.val + 1 < r.length := by omega have h2 : 4 * j.val + 2 < r.length := by omega unfold physicalRecordDisplacement rw [List.getElem?_eq_getElem h1, List.getElem?_eq_getElem h2] change physicalObservedDisplacement C k cut j (r.get ⟨_, h2⟩).2.1 (fun g => ((r.get ⟨_, h1⟩).2.2.2 g).1) = _ rw [ho _ h2, ha j, physical_observed_displacement_aux, ht _ h1] exact physical_active_displacement_encode C k cut j _ _ theorem physical_coherent_selected_cumulative_offset (o : ℕ → PhysicalMarkObservation P ell C) (t : ℕ → PhysicalBoundedMarkState P J ell B) (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (h : PhysicalFineHistoryCoherent C o t) (hlen : r.length = 4 * n + 1) (ho : ∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.1 = o i) (ht : ∀ (i : ℕ) (hi : i < r.length), (r.get ⟨i, hi⟩).2.2 = physicalBoundedMarkEncode (cut (i + 1)) (t i)) (d : PhysicalSelectedData P ell C) (hd : physicalSelectedDataTest C d o t) : physicalSelectedCumulativeOffset C k d = Fin.partialSum (physicalRecordDisplacement C k cut r) := by unfold physicalSelectedCumulativeOffset congr 1 funext j have ha : ∀ j, o (4 * j.val + 2) = .inr (some ⟨j, d.1 j⟩) := fun j => (((physical_selected_data_test_iff_four C d o t).mp hd).2.2.1 j).1 rw [physical_record_displacement_decoded C k cut o t r hlen ho ht d.1 ha j, physical_coherent_selected_source_marks C o t h d hd j] end Record end Bounty end section /- Endpoint phases preserve the exact harmonic cutoff norm. -/ namespace Bounty theorem physical_phase_star (a : ℝ) (n : ℕ) : star (physicalPhase a n) = physicalPhase (-a) n := (physical_phase_reverse a n).symm noncomputable def physicalPhasedHarmonicCutoff (a b Z : ℝ) (k : ℤ) (d : ℕ) (n : ℤ) : ℂ := (typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ) * physicalPhase a n.natAbs * physicalPhase b (n+k*(d : ℤ)).natAbs theorem physical_phased_harmonic_cutoff_norm (a b Z : ℝ) (k : ℤ) (d : ℕ) (n : ℤ) : ‖physicalPhasedHarmonicCutoff a b Z k d n‖ = ‖(typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)‖ := by simp only [physicalPhasedHarmonicCutoff, norm_mul, physical_phase_norm, mul_one] theorem physical_phased_harmonic_cutoff_bound (a b Z : ℝ) (k : ℤ) (d : ℕ) (n : ℤ) : ‖physicalPhasedHarmonicCutoff a b Z k d n‖ ≤ 2 := by rw [physical_phased_harmonic_cutoff_norm, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (typeII_harmonic_dyadic_bounds _).1] exact (typeII_harmonic_dyadic_bounds _).2 end Bounty end section /- Uniform tail control for the exactly separated harmonic cutoff. -/ open Finset MeasureTheory Filter Real namespace Bounty theorem eventually_harmonic_mellin_tail_power {r : ℝ} (hr : 0 < r) (C D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ B : ℝ, 0 ≤ B → B ≤ L^C → (∫ v in {v : ℝ | L^r < ‖v‖}, ‖harmonicLogFourier v‖)*B ≤ L^(-D) := by obtain ⟨M, hM⟩ := exists_nat_gt ((C+D+1)/r) have hMr : C+D+1 < r*(M : ℝ) := by have hh := (div_lt_iff₀ hr).mp hM simpa only [mul_comm] using hh obtain ⟨K, hK, htail⟩ := harmonic_log_fourier_rapid_tail M filter_upwards [eventually_ge_atTop (max 1 K)] with L hL have hL1 : 1 ≤ L := (le_max_left _ _).trans hL have hKL : K ≤ L := (le_max_right _ _).trans hL have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL1 intro B hB hBC calc _ ≤ (K*(L^r)^(-(M : ℝ)))*L^C := mul_le_mul (htail (L^r) (one_le_rpow hL1 hr.le)) hBC hB (by positivity) _ ≤ (L*(L^r)^(-(M : ℝ)))*L^C := by gcongr _ = L^(1-r*(M : ℝ)+C) := by nth_rw 1 [← rpow_one L] rw [← rpow_mul hL0.le, ← rpow_add hL0, ← rpow_add hL0] congr 1 ring _ ≤ L^(-D) := rpow_le_rpow_of_exponent_le hL1 (by linarith) end Bounty end section /- The actual common cutoff localizes every shifted endpoint to positive natural indices. -/ open Finset Real namespace Bounty theorem harmonic_common_cutoff_energy_le {Y : ℝ} (hY : 0 < Y) (S : Finset ℤ) (δ : ℤ) (F : ℕ → ℂ) : (∑ n ∈ S, ‖(harmonicCommonCutoff (((n+δ : ℤ) : ℝ)/Y) : ℂ)*F (n+δ).natAbs‖^2) ≤ ∑ m ∈ Icc 1 ⌈4*exp 2*Y⌉₊, ‖F m‖^2 := by classical let T := S.filter (fun n => harmonicCommonCutoff (((n+δ : ℤ) : ℝ)/Y) ≠ 0) have hpos : ∀ n ∈ T, 0 < n+δ ∧ n+δ ≤ (⌈4*exp 2*Y⌉₊ : ℤ) := by intro n hn have hs := harmonic_common_cutoff_scaled_support hY (mem_filter.mp hn).2 have hl : (0 : ℝ) < (n+δ : ℤ) := (div_pos hY (by norm_num)).trans hs.1 have hu : ((n+δ : ℤ) : ℝ) ≤ (⌈4*exp 2*Y⌉₊ : ℝ) := hs.2.le.trans (Nat.le_ceil _) exact ⟨by exact_mod_cast hl, by exact_mod_cast hu⟩ calc _ = ∑ n ∈ T, ‖(harmonicCommonCutoff (((n+δ : ℤ) : ℝ)/Y) : ℂ)*F (n+δ).natAbs‖^2 := by symm apply sum_subset (filter_subset _ _) intro n hn hnt have hz : harmonicCommonCutoff (((n+δ : ℤ) : ℝ)/Y) = 0 := by by_contra hne exact hnt (mem_filter.mpr ⟨hn,hne⟩) simp only [hz, Complex.ofReal_zero, zero_mul, norm_zero, zero_pow (by decide : 2 ≠ 0)] _ ≤ ∑ n ∈ T, ‖F (n+δ).natAbs‖^2 := by apply sum_le_sum intro n hn have hc := harmonic_common_cutoff_bounds (((n+δ : ℤ) : ℝ)/Y) have hb : ‖(harmonicCommonCutoff (((n+δ : ℤ) : ℝ)/Y) : ℂ)*F (n+δ).natAbs‖ ≤ ‖F (n+δ).natAbs‖ := by rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hc.1] exact mul_le_of_le_one_left (norm_nonneg _) hc.2 exact pow_le_pow_left₀ (norm_nonneg _) hb 2 _ = ∑ m ∈ T.image (fun n => (n+δ).natAbs), ‖F m‖^2 := sum_shift_natAbs T δ (fun m => ‖F m‖^2) (fun n hn => (hpos n hn).1.le) _ ≤ _ := by apply sum_le_sum_of_subset_of_nonneg · intro m hm have h := shifted_natAbs_image_bounds T δ ⌈4*exp 2*Y⌉₊ hpos m hm exact mem_Icc.mpr ⟨h.1,h.2⟩ · intro m hm hnot exact sq_nonneg _ end Bounty end section /- Exact logarithmic Mellin representation and uniform tails for the harmonic source cutoff. -/ open MeasureTheory namespace Bounty end Bounty end section /- Exact natural-number coordinates for the original common window. -/ open Finset namespace Bounty theorem mem_harmonic_common_natural_support {Y : ℝ} (hY : 0 < Y) {n : ℕ} : n ∈ (harmonicCommonSupport Y).image Int.natAbs ↔ Y/8 ≤ (n : ℝ) ∧ (n : ℝ) ≤ 4*Real.exp 2*Y := by constructor · intro hn obtain ⟨m,hm,rfl⟩ := mem_image.mp hn have hmp := harmonic_common_support_positive hY hm have he : (m.natAbs : ℝ) = (m : ℝ) := by simpa only [Int.cast_natCast] using congrArg (fun z : ℤ => (z : ℝ)) (Int.natAbs_of_nonneg hmp.le) rw [he] exact mem_harmonic_common_support.mp hm · intro hn refine mem_image.mpr ⟨(n : ℤ), ?_, ?_⟩ · apply mem_harmonic_common_support.mpr simpa only [Int.cast_natCast] using hn · simp only [Int.natAbs_natCast] theorem harmonic_common_natural_support_bound {Y : ℝ} (hY : 0 < Y) {n : ℕ} (hn : n ∈ (harmonicCommonSupport Y).image Int.natAbs) : 0 < n ∧ n ≤ ⌈4*Real.exp 2*Y⌉₊ := by have hs := (mem_harmonic_common_natural_support hY).mp hn constructor · have hp : (0 : ℝ) < n := lt_of_lt_of_le (by positivity : 0 < Y/8) hs.1 exact_mod_cast hp · have hb := hs.2.trans (Nat.le_ceil (4*Real.exp 2*Y)) exact_mod_cast hb theorem harmonic_common_cutoff_zero_outside_natural {Y : ℝ} (hY : 0 < Y) {n : ℕ} (hn : n ∉ (harmonicCommonSupport Y).image Int.natAbs) : harmonicCommonCutoff ((n : ℝ)/Y) = 0 := by by_contra hne have hs := harmonic_common_cutoff_scaled_support hY hne exact hn ((mem_harmonic_common_natural_support hY).mpr ⟨hs.1.le,hs.2.le⟩) end Bounty end section /- Exact logarithmic Mellin representation and uniform tails for the harmonic window cutoff. -/ open MeasureTheory namespace Bounty theorem harmonic_window_cutoff_mellin_representation {t : ℝ} (ht : 0 < t) : (harmonicCommonCutoff t : ℂ) = ∫ v : ℝ, harmonicWindowLogFourier v*physicalMellinPhase (2*Real.pi*v) t := by have he := harmonic_window_log_fourier_inversion (Real.log t) simp only [harmonicWindowLogCutoff, Real.exp_log ht] at he rw [he] apply integral_congr_ae exact Filter.Eventually.of_forall (fun v => mul_comm _ _) end Bounty end section /- The whole original integer common window at every rational center. -/ open Finset MeasureTheory namespace Bounty end Bounty end section /- Normalized finite box masses and rapid decay of the fixed harmonic source tail. -/ open Finset MeasureTheory Filter Real namespace Bounty theorem eventually_schwartz_tail_polynomial (f : SchwartzMap ℝ ℂ) {r : ℝ} (hr : 0 < r) (K C D : ℝ) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, (∫ u in {u : ℝ | L^r < ‖u‖}, ‖f u‖)*K*L^C ≤ L^(-D) := by obtain ⟨M, hM⟩ := exists_nat_gt ((C+D+1)/r) have hMr : C+D+1 < r*(M : ℝ) := by have hh := (div_lt_iff₀ hr).mp hM simpa only [mul_comm] using hh obtain ⟨A, hA, htail⟩ := schwartz_norm_rapid_tail f M filter_upwards [eventually_ge_atTop (max 1 (A*K))] with L hL have hL1 : 1 ≤ L := (le_max_left _ _).trans hL have hAK : A*K ≤ L := (le_max_right _ _).trans hL have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL1 calc _ ≤ (A*(L^r)^(-(M : ℝ)))*K*L^C := by gcongr exact htail (L^r) (one_le_rpow hL1 hr.le) _ = (A*K)*(L^r)^(-(M : ℝ))*L^C := by ring _ ≤ L*(L^r)^(-(M : ℝ))*L^C := by gcongr _ = L^(1-r*(M : ℝ)+C) := by nth_rw 1 [← rpow_one L] rw [← rpow_mul hL0.le, ← rpow_add hL0, ← rpow_add hL0] congr 1 ring _ ≤ L^(-D) := rpow_le_rpow_of_exponent_le hL1 (by linarith) end Bounty end section /- Harmonic coefficient-mass control of the window Mellin integrand. -/ open Finset namespace Bounty end Bounty end section /- The original finite joint residue histories satisfy one scalar bound with their exact initial and permutation weights. -/ open Finset namespace Bounty section Energy variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) end Energy end Bounty end section /- An inactive global cap writes the original root model in finite selected coordinates. -/ open Finset open scoped Classical namespace Bounty section Normalization variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (b : PhysicalPrime P → ℝ) (hb : ∀ a, b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a, b a ≠ 0) include hP hdis hk hb hb0 end Normalization end Bounty end section /- Original root terms normalize without restricting the finite path set. -/ open Finset open scoped Classical namespace Bounty section Normalization variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) end Normalization end Bounty end section /- Complete selector recovery on the original signed physical path, including zero paths. -/ open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def physicalOriginalFineWeight (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : ℂ := (finiteEventPathWeight (FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventWeight (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ω (fun g p => β g p / V g) retention ρ V) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p : ℂ) * fullMixedLedgerInducedPhase (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) fullActiveInitialLedger (finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventPhase C k ω β ρ V) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))) x p noncomputable def physicalOriginalFineRecord (cut : ℕ → Fin N → Finset (Fin J)) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C) := let lift : FiniteEventPath (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x, x) := (finiteLedgerEventPathEquiv (FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullMixedLedgerUpdate (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x) x).symm p let pos := (finiteEventPathMapEquiv (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalSelectedFineTag n) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x)).symm lift let r := finiteEventPathObservations (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x) pos r end Fine end Bounty end section /- The actual root model with only the selected groups converted to memory histories. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- An original root summand with explicit small residues and capped big memory. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- A unit-coefficient untouched physical edge, with its exact residual and initial-avoidance mask. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- A positive gap between the preliminary rough mass and the actual logarithmic proxy sums. -/ open Finset Filter namespace Bounty end Bounty end section /- Exact ambient discrepancies as bilinear shifted-product sums with explicit coefficient masks. -/ open Finset Filter namespace Bounty noncomputable def shiftedTypeIIBilinear (T : Finset ℕ) (μ α β : ℕ → ℝ) : ℝ := ∑ v ∈ shiftedFactorPairs T, μ (shiftedPairIndex v) * α v.1 * β v.2 noncomputable def typeIIRestrict (F : Finset ℕ) (f : ℕ → ℝ) (n : ℕ) : ℝ := if n ∈ F then f n else 0 theorem typeIIRestrict_ne_zero_iff (F : Finset ℕ) (f : ℕ → ℝ) (n : ℕ) : typeIIRestrict F f n ≠ 0 ↔ n ∈ F ∧ f n ≠ 0 := by by_cases hn : n ∈ F <;> simp [typeIIRestrict, hn] theorem typeIIRestrict_support_subset (F : Finset ℕ) (f : ℕ → ℝ) : Function.support (typeIIRestrict F f) ⊆ (F : Set ℕ) := by intro n hn exact ((typeIIRestrict_ne_zero_iff F f n).mp hn).1 theorem shifted_typeII_bilinear_complex_cast (T : Finset ℕ) (μ α β : ℕ → ℝ) : (shiftedTypeIIBilinear T μ α β : ℂ) = ∑ v ∈ shiftedFactorPairs T, (μ (shiftedPairIndex v) : ℂ) * (α v.1 : ℂ) * (β v.2 : ℂ) := by simp only [shiftedTypeIIBilinear, Complex.ofReal_sum, Complex.ofReal_mul] theorem typeIIRestrict_abs_le {F : Finset ℕ} {f : ℕ → ℝ} {C : ℝ} (hC : 0 ≤ C) (hf : ∀ n ∈ F, |f n| ≤ C) (n : ℕ) : |typeIIRestrict F f n| ≤ C := by by_cases hn : n ∈ F · simpa only [typeIIRestrict, if_pos hn] using hf n hn · simpa only [typeIIRestrict, if_neg hn, abs_zero] using hC theorem shifted_factor_pairs_swap (T : Finset ℕ) (v : ℕ × ℕ) : v.swap ∈ shiftedFactorPairs T ↔ v ∈ shiftedFactorPairs T := by simp only [mem_shifted_factor_pairs_iff, Prod.fst_swap, Prod.snd_swap, mul_comm] theorem shifted_typeII_bilinear_swap (T : Finset ℕ) (μ α β : ℕ → ℝ) : shiftedTypeIIBilinear T μ α β = shiftedTypeIIBilinear T μ β α := by classical unfold shiftedTypeIIBilinear refine sum_bij' (fun v _ => v.swap) (fun v _ => v.swap) ?_ ?_ ?_ ?_ ?_ · intro v hv exact (shifted_factor_pairs_swap T v).mpr hv · intro v hv exact (shifted_factor_pairs_swap T v).mpr hv · intro v _ exact Prod.swap_swap v · intro v _ exact Prod.swap_swap v · intro v _ simp only [shiftedPairIndex, Prod.fst_swap, Prod.snd_swap, mul_comm v.2 v.1] ring theorem shifted_factor_pairs_coordinate_bounds (T : Finset ℕ) (H : ℕ) (hT : ∀ u ∈ T, 2*u+1 ≤ H) {v : ℕ × ℕ} (hv : v ∈ shiftedFactorPairs T) : v.1 ∈ Icc 1 H ∧ v.2 ∈ Icc 1 H := by obtain ⟨h1,h2,hu,hprod⟩ := shifted_factor_pair_properties T hv have hb : v.1*v.2 ≤ H := hprod ▸ hT (shiftedPairIndex v) hu exact ⟨mem_Icc.mpr ⟨h1,(Nat.le_mul_of_pos_right v.1 h2).trans hb⟩, mem_Icc.mpr ⟨h2,(Nat.le_mul_of_pos_left v.2 h1).trans hb⟩⟩ noncomputable def ambientRoughTypeIIBeta (A B : ℝ) : ℕ → ℝ := typeIIRestrict (primeBand A B) (fun _ => 1) noncomputable def ambientBalancedTypeIIRange (κ L : ℝ) : Finset ℕ := (Icc 1 ⌊Real.exp (((1/2 : ℝ)+2*κ)*L)⌋₊).filter (fun n => Real.exp (((1/2 : ℝ)-2*κ)*L) ≤ (n : ℝ)) theorem mem_ambientBalancedTypeIIRange (κ L : ℝ) (n : ℕ) : n ∈ ambientBalancedTypeIIRange κ L ↔ Real.exp (((1/2 : ℝ)-2*κ)*L) ≤ (n : ℝ) ∧ (n : ℝ) ≤ Real.exp (((1/2 : ℝ)+2*κ)*L) := by classical simp only [ambientBalancedTypeIIRange, mem_filter, mem_Icc] constructor · rintro ⟨⟨_,hupper⟩,hlower⟩ exact ⟨hlower,(Nat.le_floor_iff (Real.exp_pos _).le).mp hupper⟩ · rintro ⟨hlower,hupper⟩ exact ⟨⟨Nat.cast_pos.mp ((Real.exp_pos _).trans_le hlower), Nat.le_floor hupper⟩,hlower⟩ theorem shifted_wide_window_factor_bound {L : ℝ} (hL : 0 ≤ L) {u : ℕ} (hu : u ∈ arithmeticProductWindow 1 (Real.exp L)) : Real.exp L ≤ ((2*u+1 : ℕ) : ℝ) ∧ ((2*u+1 : ℕ) : ℝ) ≤ 33*Real.exp L := by obtain ⟨hlo,hhi⟩ := (mem_arithmeticProductWindow_iff one_ne_zero (Real.exp L)).mp hu simp only [one_mul] at hlo hhi have hE := Real.one_le_exp hL push_cast constructor <;> nlinarith [Real.exp_pos L] theorem shifted_wide_window_nat_factor_bound {L : ℝ} (hL : 0 ≤ L) {u : ℕ} (hu : u ∈ arithmeticProductWindow 1 (Real.exp L)) : 2*u+1 ≤ ⌊33*Real.exp L⌋₊ := Nat.le_floor (shifted_wide_window_factor_bound hL hu).2 theorem balanced_pair_window_iff_typeII_ranges {κ L : ℝ} (hL : 0 ≤ L) {v : ℕ × ℕ} (hv : v ∈ shiftedFactorPairs (arithmeticProductWindow 1 (Real.exp L))) : balancedPairWindow κ L v ↔ v.1 ∈ ambientBalancedTypeIIRange κ L ∧ v.2 ∈ ambientBalancedTypeIIRange κ L := by have hdata := shifted_factor_pair_properties _ hv have hprod := shifted_wide_window_factor_bound hL hdata.2.2.1 rw [← hdata.2.2.2] at hprod simp only [balancedPairWindow, mem_ambientBalancedTypeIIRange] tauto noncomputable def ambientPrimeTypeIIAlpha (κ L S : ℝ) : ℕ → ℝ := typeIIRestrict (ambientBalancedTypeIIRange κ L) (fun n => (if n.Prime then 1 else 0 : ℝ) - primeLogarithmicProxy L S n) noncomputable def ambientPrimeTypeIIBeta (κ L : ℝ) : ℕ → ℝ := typeIIRestrict (ambientBalancedTypeIIRange κ L) (fun n => if n.Prime then 1 else 0) noncomputable def ambientProxyTypeIIBeta (κ L S : ℝ) : ℕ → ℝ := typeIIRestrict (ambientBalancedTypeIIRange κ L) (primeLogarithmicProxy L S) theorem ambient_prime_proxy_error_eq_typeII {κ L : ℝ} (hL : 0 ≤ L) (μ : ℕ → ℝ) (S : ℝ) : ambientPrimeProxyError (arithmeticProductWindow 1 (Real.exp L)) μ κ L S = shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) μ (ambientPrimeTypeIIAlpha κ L S) (ambientPrimeTypeIIBeta κ L) + shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) μ (ambientPrimeTypeIIAlpha κ L S) (ambientProxyTypeIIBeta κ L S) := by classical rw [shifted_typeII_bilinear_swap _ μ (ambientPrimeTypeIIAlpha κ L S) (ambientProxyTypeIIBeta κ L S)] unfold ambientPrimeProxyError shiftedBalancedPairs shiftedTypeIIBilinear rw [sum_filter, ← sum_add_distrib] apply sum_congr rfl intro v hv rw [balanced_pair_window_iff_typeII_ranges hL hv] unfold ambientPrimeTypeIIAlpha ambientPrimeTypeIIBeta ambientProxyTypeIIBeta typeIIRestrict by_cases hm : v.1 ∈ ambientBalancedTypeIIRange κ L <;> by_cases hn : v.2 ∈ ambientBalancedTypeIIRange κ L <;> simp only [hm,hn,and_self,and_false,false_and,if_true,if_false,mul_zero,zero_mul,add_zero] ring theorem rough_test_discrepancy_rough_support {γ L S : ℝ} (hcut : Real.sqrt L ≤ γ*L) {n : ℕ} (hn : roughTestIndicator γ L n - roughTestLogarithmicProxy γ L S n ≠ 0) : ∀ p ∈ n.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ) := by classical by_cases ht : exponentialRoughTest γ L n · intro p hp exact (Real.exp_le_exp.mpr hcut).trans_lt (ht p hp) · have hproxy : roughTestLogarithmicProxy γ L S n ≠ 0 := by intro hz exact hn (by simp only [roughTestIndicator, if_neg ht, hz, sub_self]) exact rough_test_logarithmic_proxy_support hproxy theorem prime_test_discrepancy_rough_support {L S : ℝ} {n : ℕ} (hnlarge : Real.exp (Real.sqrt L) < (n : ℝ)) (hn : (if n.Prime then 1 else 0 : ℝ) - primeLogarithmicProxy L S n ≠ 0) : ∀ p ∈ n.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ) := by classical by_cases hp : n.Prime · rw [hp.primeFactors] intro p hp' simpa only [mem_singleton.mp hp'] using hnlarge · have hproxy : primeLogarithmicProxy L S n ≠ 0 := by intro hz exact hn (by simp only [if_neg hp, hz, sub_self]) exact (mem_filter.mp (prime_cell_proxy_ne_zero_mem hproxy)).2 theorem eventually_rough_typeII_restriction_properties {γ : ℝ} (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, ∀ (S : ℝ) (F : Finset ℕ) (n : ℕ), |typeIIRestrict F (fun m => roughTestIndicator γ L m - roughTestLogarithmicProxy γ L S m) n| ≤ 1 ∧ (typeIIRestrict F (fun m => roughTestIndicator γ L m - roughTestLogarithmicProxy γ L S m) n ≠ 0 → n ∈ F ∧ ∀ p ∈ n.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)) := by filter_upwards [eventually_rough_test_proxy_cutoff hγ, eventually_rough_test_logarithmic_proxy_bounds hγ] with L hcut hbound intro S F n refine ⟨typeIIRestrict_abs_le zero_le_one (fun m _ => (hbound S m).2.2) n, ?_⟩ intro hn obtain ⟨hnF,hnd⟩ := (typeIIRestrict_ne_zero_iff F _ n).mp hn exact ⟨hnF, rough_test_discrepancy_rough_support hcut hnd⟩ theorem ambient_rough_typeII_beta_properties (A B : ℝ) (n : ℕ) : |ambientRoughTypeIIBeta A B n| ≤ 1 ∧ (ambientRoughTypeIIBeta A B n ≠ 0 → n ∈ primeBand A B ∧ n.Prime) := by refine ⟨typeIIRestrict_abs_le zero_le_one (by intros; norm_num) n, ?_⟩ intro hn have hmem := ((typeIIRestrict_ne_zero_iff (primeBand A B) _ n).mp hn).1 exact ⟨hmem,(mem_filter.mp hmem).2⟩ theorem ambient_prime_typeII_beta_abs_le (κ L : ℝ) (n : ℕ) : |ambientPrimeTypeIIBeta κ L n| ≤ 1 := by apply typeIIRestrict_abs_le zero_le_one intro m _ split <;> norm_num theorem eventually_balanced_typeII_coefficient_properties (S : ℝ) (hS : 0 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ n : ℕ, |ambientPrimeTypeIIAlpha κ L S n| ≤ 1 ∧ |ambientPrimeTypeIIBeta κ L n| ≤ 1 ∧ |ambientProxyTypeIIBeta κ L S n| ≤ 1 ∧ (ambientPrimeTypeIIAlpha κ L S n ≠ 0 → n ∈ ambientBalancedTypeIIRange κ L ∧ ∀ p ∈ n.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)) := by obtain ⟨C,hC,hbound⟩ := exists_prime_logarithmic_proxy_uniform_bound (by norm_num : (0 : ℝ) < 1/5) filter_upwards [hbound S hS, eventually_sqrt_le_dyadic_scale (by norm_num : (0 : ℝ) < 1/5) 0, eventually_gt_atTop (0 : ℝ)] with L hb hsqrt hL intro κ hκ hκmax n simp only [pow_zero, div_one] at hsqrt have hsize (m : ℕ) (hm : m ∈ ambientBalancedTypeIIRange κ L) : Real.exp ((1/5 : ℝ)*L) ≤ (m : ℝ) ∧ Real.exp (Real.sqrt L) < (m : ℝ) := by have hlo := ((mem_ambientBalancedTypeIIRange κ L m).mp hm).1 have hexp : (1/5 : ℝ)*L < ((1/2 : ℝ)-2*κ)*L := by nlinarith exact ⟨(Real.exp_le_exp.mpr hexp.le).trans hlo, (Real.exp_lt_exp.mpr (hsqrt.trans_lt hexp)).trans_le hlo⟩ refine ⟨typeIIRestrict_abs_le zero_le_one (fun m hm => (hb m (hsize m hm).1).2.2.2) n, ambient_prime_typeII_beta_abs_le κ L n, ?_, ?_⟩ · apply typeIIRestrict_abs_le zero_le_one intro m hm have h := hb m (hsize m hm).1 simpa only [abs_of_nonneg h.1] using h.2.1 · intro hn obtain ⟨hnF,hnd⟩ := (typeIIRestrict_ne_zero_iff _ _ n).mp hn exact ⟨hnF, prime_test_discrepancy_rough_support (hsize n hnF).2 hnd⟩ noncomputable def ambientRoughCofactorRange (L a v : ℝ) : Finset ℕ := (Icc 1 ⌊33*Real.exp L⌋₊).filter (fun m => Real.exp ((1-v)*L) ≤ (m : ℝ) ∧ (m : ℝ) ≤ 33*Real.exp ((1-a)*L)) noncomputable def ambientRoughIntervalTypeIIAlpha (γ L S a v : ℝ) : ℕ → ℝ := typeIIRestrict (ambientRoughCofactorRange L a v) (fun m => roughTestIndicator γ L m - roughTestLogarithmicProxy γ L S m) theorem ambient_rough_cofactor_range_eq_Icc (L a v : ℝ) : ambientRoughCofactorRange L a v = Icc (max 1 ⌈Real.exp ((1-v)*L)⌉₊) (min ⌊33*Real.exp L⌋₊ ⌊33*Real.exp ((1-a)*L)⌋₊) := by ext n simp only [ambientRoughCofactorRange, mem_filter, mem_Icc, max_le_iff, le_min_iff, Nat.ceil_le, Nat.le_floor_iff (by positivity : 0 ≤ 33*Real.exp ((1-a)*L))] tauto theorem ambient_balanced_typeII_range_eq_Icc (κ L : ℝ) : ambientBalancedTypeIIRange κ L = Icc (max 1 ⌈Real.exp (((1/2 : ℝ)-2*κ)*L)⌉₊) ⌊Real.exp (((1/2 : ℝ)+2*κ)*L)⌋₊ := by ext n simp only [ambientBalancedTypeIIRange, mem_filter, mem_Icc, max_le_iff, Nat.ceil_le] tauto theorem shifted_prime_band_cofactor_range {L a v : ℝ} (hL : 0 ≤ L) {w : ℕ × ℕ} (hw : w ∈ shiftedPrimeBandPairs (arithmeticProductWindow 1 (Real.exp L)) (Real.exp (a*L)) (Real.exp (v*L))) : w.2 ∈ ambientRoughCofactorRange L a v := by have hdata := shifted_prime_band_pair_data _ _ _ hw have hfac := (mem_filter.mp hw).1 have hcoords := shifted_factor_pairs_coordinate_bounds (arithmeticProductWindow 1 (Real.exp L)) ⌊33*Real.exp L⌋₊ (fun _ hu => shifted_wide_window_nat_factor_bound hL hu) hfac have hband := (mem_primeBand_iff (Real.exp_pos (a*L)).le (Real.exp_pos (v*L)).le w.1).mp hdata.2.1 have hprod := shifted_wide_window_factor_bound hL hdata.1 rw [← hdata.2.2, Nat.cast_mul] at hprod refine mem_filter.mpr ⟨hcoords.2, ?_, ?_⟩ · apply (mul_le_mul_iff_left₀ (Real.exp_pos (v*L))).mp calc Real.exp ((1-v)*L) * Real.exp (v*L) = Real.exp L := by rw [← Real.exp_add] congr 1 ring _ ≤ (w.1 : ℝ) * (w.2 : ℝ) := hprod.1 _ ≤ (w.2 : ℝ) * Real.exp (v*L) := by simpa only [mul_comm] using mul_le_mul_of_nonneg_right hband.2.2 (Nat.cast_nonneg w.2) · apply (mul_le_mul_iff_right₀ (Real.exp_pos (a*L))).mp calc Real.exp (a*L) * (w.2 : ℝ) ≤ (w.1 : ℝ) * (w.2 : ℝ) := mul_le_mul_of_nonneg_right hband.2.1.le (Nat.cast_nonneg w.2) _ ≤ 33*Real.exp L := hprod.2 _ = Real.exp (a*L) * (33*Real.exp ((1-a)*L)) := by have he : Real.exp (a*L) * Real.exp ((1-a)*L) = Real.exp L := by rw [← Real.exp_add] congr 1 ring rw [← he] ring theorem ambient_rough_proxy_error_eq_interval_typeII {L : ℝ} (hL : 0 ≤ L) (μ : ℕ → ℝ) (γ S a v : ℝ) : ambientRoughProxyError (arithmeticProductWindow 1 (Real.exp L)) μ γ L S (Real.exp (a*L)) (Real.exp (v*L)) = shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) μ (ambientRoughIntervalTypeIIAlpha γ L S a v) (ambientRoughTypeIIBeta (Real.exp (a*L)) (Real.exp (v*L))) := by classical rw [shifted_typeII_bilinear_swap] unfold ambientRoughProxyError shiftedPrimeBandPairs shiftedTypeIIBilinear rw [sum_filter] apply sum_congr rfl intro w hw by_cases hp : w.1 ∈ primeBand (Real.exp (a*L)) (Real.exp (v*L)) · have hm := shifted_prime_band_cofactor_range hL (mem_filter.mpr ⟨hw,hp⟩) simp only [if_pos hp, ambientRoughIntervalTypeIIAlpha, ambientRoughTypeIIBeta, typeIIRestrict, if_pos hm, mul_one] · simp only [if_neg hp, ambientRoughIntervalTypeIIAlpha, ambientRoughTypeIIBeta, typeIIRestrict, mul_zero, zero_mul] theorem ambient_rough_interval_typeII_support (γ L S a v : ℝ) : Function.support (ambientRoughIntervalTypeIIAlpha γ L S a v) ⊆ {m : ℕ | 1 ≤ m ∧ m ≤ ⌊33*Real.exp L⌋₊ ∧ Real.exp ((1-v)*L) ≤ (m : ℝ) ∧ (m : ℝ) ≤ 33*Real.exp ((1-a)*L)} := by intro m hm have h := ((typeIIRestrict_ne_zero_iff _ _ m).mp hm).1 exact ⟨(mem_Icc.mp (mem_filter.mp h).1).1, (mem_Icc.mp (mem_filter.mp h).1).2, (mem_filter.mp h).2⟩ theorem ambient_balanced_typeII_support (κ L S : ℝ) : Function.support (ambientPrimeTypeIIAlpha κ L S) ⊆ (ambientBalancedTypeIIRange κ L : Set ℕ) ∧ Function.support (ambientPrimeTypeIIBeta κ L) ⊆ (ambientBalancedTypeIIRange κ L : Set ℕ) ∧ Function.support (ambientProxyTypeIIBeta κ L S) ⊆ (ambientBalancedTypeIIRange κ L : Set ℕ) := ⟨typeIIRestrict_support_subset _ _, typeIIRestrict_support_subset _ _, typeIIRestrict_support_subset _ _⟩ theorem eventually_ambient_rough_interval_typeII_properties {γ : ℝ} (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, ∀ (S a v : ℝ) (m : ℕ), |ambientRoughIntervalTypeIIAlpha γ L S a v m| ≤ 1 ∧ (ambientRoughIntervalTypeIIAlpha γ L S a v m ≠ 0 → m ∈ ambientRoughCofactorRange L a v ∧ ∀ p ∈ m.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)) := by filter_upwards [eventually_rough_typeII_restriction_properties hγ] with L hL intro S a v m exact hL S (ambientRoughCofactorRange L a v) m end Bounty end section /- Every row is the actual signed ghost row, the two permutation averages, or the sum of actual mixed full actions over one pattern and one auxiliary. -/ open Finset open scoped Classical namespace Bounty section Rows variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] [Fintype I] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) (phase : ∀ tag s, PhysicalMixedWordEvent (ell := ell) n shared B A Δ D tag s → ℂ) noncomputable def physicalMixedWordRow := let _ : ∀ tag s, Fintype (PhysicalMixedWordEvent (ell := ell) (V := V) n shared B A Δ D tag s) := physicalMixedWordEventFintype (ell := ell) (V := V) n shared B A Δ D finiteLocalPhasedRow (PhysicalMixedWordEvent (ell := ell) (V := V) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) phase (physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge) theorem physical_mixed_word_row_edge (k : K) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) : physicalMixedWordRow n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase (some (.inr k)) F s = ∑ i : I, ∑ a : A i, (ω i (productActiveMemorySplit (shared i) B s.2).1 a : ℂ) * physicalSmallBigFullPhasedAction n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a) μ ρ Vb (fun c => kbig k i c a) Vs (qedge k) (fun s e => phase (some (.inr k)) s ⟨i, a, e⟩) F s := by unfold physicalMixedWordRow finiteLocalPhasedRow change (∑ e : Σ i : I, Σ a : A i, _, _) = _ rw [Fintype.sum_sigma] apply sum_congr rfl intro i _ rw [Fintype.sum_sigma] apply sum_congr rfl intro a _ unfold physicalSmallBigFullPhasedAction physicalSmallBigPhasedAction rw [mul_sum] apply sum_congr rfl intro e _ simp only [physicalMixedWordWeight, physicalMixedWordTarget, Complex.ofReal_mul] ring theorem physical_mixed_word_row_ghost (j : V) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) : physicalMixedWordRow n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase (some (.inl j)) F s = ∑ e : CoupledGhostEvent M B s.2, (coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g => physicalGhostTermination (n g) (qghost j) ρ) (fun g => physicalGhostBirth (n g) (qghost j) ρ (Vb g)) (fun g => unrestrictedResidueWeight (μ g)) M B s.2 e : ℂ) * phase (some (.inl j)) s e * F (s.1, coupledGhostJointEventTarget M B s.2 e) := rfl end Rows end Bounty end section /- Fixing the small permutation and target-mark choices determines the small prefix at each edge. The remaining path is an original full big-memory path. -/ open Finset open scoped Classical namespace Bounty section Plans variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell : ℕ} def PhysicalMixedSmallPlan : List (Option (V ⊕ K)) → Type | [] => PUnit | none :: ks => PhysicalPermutations S J ell × PhysicalMixedSmallPlan ks | some (.inl _) :: ks => PhysicalMixedSmallPlan ks | some (.inr _) :: ks => (I × PhysicalMarkLists Ps J ell) × PhysicalMixedSmallPlan ks noncomputable abbrev physicalMixedSmallPlanFintype [Fintype S] [Fintype I] : ∀ ks, Fintype (PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) (V := V) (K := K) ks) | [] => inferInstanceAs (Fintype PUnit) | none :: ks => let _ := physicalMixedSmallPlanFintype ks; inferInstanceAs (Fintype (_ × _)) | some (.inl _) :: ks => physicalMixedSmallPlanFintype ks | some (.inr _) :: ks => let _ := physicalMixedSmallPlanFintype ks; inferInstanceAs (Fintype (_ × _)) abbrev PhysicalMixedBigKey := K × I × PhysicalMarkLists Ps J ell × PhysicalMarkLists Ps J ell def physicalMixedBigSteps : ∀ ks : List (Option (V ⊕ K)), PhysicalMarkLists Ps J ell → PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks → List (Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) | [], _, _ => [] | none :: ks, L, (σ, pl) => none :: physicalMixedBigSteps ks (physicalPermuteLabels σ L) pl | some (.inl j) :: ks, L, pl => some (.inl j) :: physicalMixedBigSteps ks L pl | some (.inr k) :: ks, L, ((i, R), pl) => some (.inr (k, i, L, R)) :: physicalMixedBigSteps ks R pl end Plans section Big variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) abbrev PhysicalMixedPlannedBigPath (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) := FullPermutationMixedPath n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (physicalMixedBigSteps ks L pl) x end Big end Bounty end section /- The only extra real factor relative to the original full big event is the small completion/vertex factor, or one small permutation normalizer. -/ open Finset open scoped Classical namespace Bounty section Weight variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (Vs : S → ℝ) (qedge : K → ℝ) noncomputable def physicalMixedSmallWeight (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) : PhysicalMixedWordEvent n shared B A Δ D tag s → ℝ := match tag with | none => fun _ => (Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹ | some (.inl _) => fun _ => 1 | some (.inr k) => fun e => if physicalSharedPrefix s.1.2 = physicalSharedPrefix e.2.2.1 then physicalCompletionMass Vs (fun _ => (∅ : Finset (Fin J))) ell * (physicalResidueVertexWeight s.1.2 (Real.sqrt (qedge k)) s.1.1 * physicalResidueVertexWeight e.2.2.1 (Real.sqrt (qedge k)) (physicalTranslateResidues s.1.1 (kbig k e.1 (productActiveMemorySplit (shared e.1) B s.2).1 e.2.1 * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ)))) else 0 theorem physical_mixed_word_edge_weight_factor (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (k : K) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEdge n shared B A Δ D k s) : physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge (some (.inr k)) s e = physicalMixedSmallWeight (V := V) n shared B A Δ D kbig Vs qedge (some (.inr k)) s e * fullActiveEdgeEventWeight n (shared e.1) B (fun _ => A e.1) (Δ k e.1 (physicalSharedPrefix s.1.2)) (D k e.1 (physicalSharedPrefix s.1.2)) (ω e.1) μ ρ Vb s.2 (fullActiveFixedAuxEvent n (shared e.1) B (Δ k e.1 (physicalSharedPrefix s.1.2)) (D k e.1 (physicalSharedPrefix s.1.2)) s.2 e.2.1 e.2.2.2) := by simp only [physicalMixedWordWeight, physicalMixedSmallWeight, physicalSmallBigPositiveWeight, physicalSmallBigFullWeight, fullActiveEdgeEventWeight, fullActiveFixedAuxEvent, one_mul] split_ifs <;> ring end Weight end Bounty end section /- Partial normalization retains every original finite path and only the original return indicator. -/ open Finset open scoped Classical namespace Bounty theorem physical_finite_root_term_partial_unrestricted {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (hV : ∀ g, 0 < V g) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin (n + 1), ∀ g s, ¬ (((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc g s).val : ℤ) ∣ physicalPathSelectedMultiplier C k p j) (b : PhysicalPrime P → ℝ) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a ≠ 0) : (physicalStateMass V J ell : ℂ) * physicalFiniteReturnScalar V patterns C ζ k K n L p * (physicalFiniteVertexExpectation C q k n L p : ℂ) = if physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) (n + 1) = 0 then (physicalGroupPathMass V groupsᶜ (fun j => C (finitePathLabels p j).2.2.1.val) ell (n + 1) : ℂ) * physicalMemoryWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L p) (n + 1) * (poolPathResidueExpectation (fun a : PhysicalPrime P => a.2.val) (physicalPrimeGroups P groupsᶜ) (range (n + 2)) (fun a => (range (n + 2)).filter (fun j => a ∈ physicalMarkedPrimes (finitePathMarks L p j))) (fun a j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j : ZMod a.2.val)) (fun j => 1 - physicalEndpointSchedule q (n + 1) j) : ℝ) * (∏ a ∈ physicalPrimeGroups P groups, b a : ℝ) * (∏ a ∈ physicalPrimeGroups P groups, ghostPhaseRunHistory (fun j => decide (a ∈ physicalMarkedPrimes (finitePathMarks L p j))) (fun j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j : ZMod a.2.val)) (fun j => 1 - physicalEndpointSchedule q (n + 1) j) ((a.2.val : ℝ) * b a)⁻¹ (V a.1) (n + 1) : ℝ) else 0 := by by_cases ho : physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) (n + 1) = 0 · rw [if_pos ho] by_cases hs : physicalFiniteReturnScalar V patterns C ζ k K n L p = 0 · have hbare : physicalBareWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L p) (n + 1) = 0 := by simpa only [physicalFiniteReturnScalar, physicalBareReturnScalar, if_pos ho] using hs have hmem := (physical_memory_walk_scalar_zero_iff V hV patterns C ζ K (finitePathLabels p) (finitePathMarks L p) (n + 1)).mpr hbare simp only [hs, hmem, mul_zero, zero_mul] · by_cases hc : ∃ r : PhysicalResidues P, physicalFinitePathResidueCompatible C k n r L p · exact physical_finite_root_term_partial_memory_normalization groups V patterns C q ζ k K L p ⟨hs, hc⟩ hP hdis hk b hb hb0 · have he := physical_finite_vertex_expectation_zero_of_incompatible hdis hP C q k n L p hc have hz := physical_partial_run_residue_zero groups V (finitePathMarks L p) (n + 1) (fun a j => -(physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) j : ZMod a.2.val)) (fun j => 1 - physicalEndpointSchedule q (n + 1) j) b hb hb0 he have hzc := congrArg (fun z : ℝ => (z : ℂ)) hz push_cast at hzc rw [he] simp only [Complex.ofReal_zero, mul_zero] push_cast linear_combination -(physicalGroupPathMass V groupsᶜ (fun j => C (finitePathLabels p j).2.2.1.val) ell (n + 1) : ℂ) * physicalMemoryWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L p) (n + 1) * (∏ a ∈ physicalPrimeGroups P groups, (b a : ℂ)) * hzc · simp only [physicalFiniteReturnScalar, physicalBareReturnScalar, if_neg ho, mul_zero, zero_mul] end Bounty end section /- The original candidate off-diagonal energy, with normalized finite-frequency error. -/ open Finset MeasureTheory Filter namespace Bounty end Bounty end section /- Explicit rank decay for the original complex forest-masked full-mixed path action. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) end Owner end Bounty end section /- The original candidate prime pools give the explicit energy exponent 31. -/ open Filter Finset open scoped Classical namespace Bounty theorem eventually_candidate_harmonic_energy_polynomial {c A : ℝ} (hc : 0 < c) (hA : 0 ≤ A) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type*) [Fintype G] (ι : G → candidatePIndices c L) (J : ℕ) (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels (fun g => candidatePBand (c*L) (ι g).val) C), (J*Fintype.card G : ℕ) ≤ A*Real.log L → ∀ Z : ℝ, 0 < Z → 1 ≤ Z*(physicalFreeFactor C aux : ℝ) → 3*Z < Real.exp (4*L) → 2*((⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ)/(Z*(physicalFreeFactor C aux : ℝ)/2))* (1+Real.log (⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ))^15 ≤ L^(31 : ℝ) := by obtain ⟨v, V, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool, eventually_physical_harmonic_energy_polynomial hA (by norm_num : (0 : ℝ) ≤ 2/5)] with L hp he intro G _ ι J C aux hslots Z hZ hprod hcut have hprime : ∀ g p, p ∈ candidatePBand (c*L) (ι g).val → p.Prime := by intro g p hpg exact ((hp.2.2.2.2.2 (ι g).val (ι g).property).2.2 p hpg).1 have hplog : ∀ g p, p ∈ candidatePBand (c*L) (ι g).val → Real.log (p : ℝ) ≤ L^(2/5 : ℝ) := by intro g p hpg apply (Real.log_le_iff_le_exp (by exact_mod_cast (hprime g p hpg).pos)).mpr exact ((hp.2.2.2.2.2 (ι g).val (ι g).property).2.2 p hpg).2.2 have hexp : (15*(max 1 (2/5 : ℝ)+1)+1) = (31 : ℝ) := by norm_num simpa only [hexp] using he G (fun g => candidatePBand (c*L) (ι g).val) J C aux hprime hplog hslots Z hZ hprod hcut end Bounty end section /- A threshold independent of groups, labels and scales controls the actual free factor. -/ open Filter Finset open scoped Classical namespace Bounty theorem eventually_physical_free_factor_subexponential {A s ε : ℝ} (hA : 0 ≤ A) (hs : s < 1) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type*) [Fintype G] (P : G → Finset ℕ) (J : ℕ) (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C), (∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp (L^s)) → (J*Fintype.card G : ℕ) ≤ A*Real.log L → (physicalFreeFactor C aux : ℝ) ≤ Real.exp (ε*L) := by filter_upwards [eventually_scaled_log_sublinear hA hs hε, eventually_ge_atTop (0 : ℝ)] with L hb hL intro G _ P J C aux hp hslots apply (physical_free_factor_exp_bound C aux (Real.rpow_nonneg hL s) hp).trans apply Real.exp_le_exp.mpr have hslot : L^s*((J*Fintype.card G : ℕ) : ℝ) ≤ A*L^s*Real.log L := by simpa only [mul_assoc, mul_left_comm] using mul_le_mul_of_nonneg_left hslots (Real.rpow_nonneg hL s) exact hslot.trans hb end Bounty end section /- The actual ceiling endpoint scale has a uniform linear logarithmic bound. -/ open Filter Finset open scoped Classical namespace Bounty theorem eventually_physical_harmonic_log_linear {A s ε : ℝ} (hA : 0 ≤ A) (hs : s < 1) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type*) [Fintype G] (P : G → Finset ℕ) (J : ℕ) (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C), (∀ g p, p ∈ P g → p.Prime) → (∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp (L^s)) → (J*Fintype.card G : ℕ) ≤ A*Real.log L → ∀ Z : ℝ, 0 < Z → 1 ≤ Z*(physicalFreeFactor C aux : ℝ) → 3*Z < Real.exp (4*L) → Real.log (⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ) ≤ (4+ε)*L := by filter_upwards [eventually_scaled_log_sublinear hA hs (half_pos hε), eventually_ge_atTop (2*Real.log 4/ε), eventually_ge_atTop (0 : ℝ)] with L hb hc hL intro G _ P J C aux hprime hp hslots Z hZ hprod hcut have hlog := physical_harmonic_log_bound_of_original_cutoff C aux hprime (Real.rpow_nonneg hL s) hZ hp hprod hcut have hslot : L^s*((J*Fintype.card G : ℕ) : ℝ) ≤ A*L^s*Real.log L := by simpa only [mul_assoc, mul_left_comm] using mul_le_mul_of_nonneg_left hslots (Real.rpow_nonneg hL s) have hconst : 2*Real.log 4 ≤ L*ε := (div_le_iff₀ hε).mp hc nlinarith end Bounty end section /- The original smooth dyadic scale remains exponentially large at every index. -/ open Filter Real namespace Bounty theorem eventually_typeII_harmonic_scale_lower {b K : ℝ} (hb : 0 < b) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ U V : ℝ, exp (b*L) ≤ U → exp (b*L) ≤ V → ∀ j : ℕ, 2*exp (b*L) ≤ typeIISmoothDyadicScale U V (U*L^(-K)) j := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (log 32/b)] with L hL hc intro U V hUlo hVlo j have hL0 : 0 < L := zero_lt_one.trans_le hL have hU : 0 < U := (exp_pos _).trans_le hUlo have hV : 0 < V := (exp_pos _).trans_le hVlo have hE : 0 < U*L^(-K) := mul_pos hU (rpow_pos_of_pos hL0 _) have h32 : (32 : ℝ) ≤ exp (b*L) := by have hh : log 32 ≤ b*L := by nlinarith [(div_le_iff₀ hb).mp hc] calc _ = exp (log 32) := (exp_log (by norm_num)).symm _ ≤ _ := exp_le_exp.mpr hh have hUV : exp (b*L)*exp (b*L) ≤ U*V := mul_le_mul hUlo hVlo (exp_pos _).le hU.le have hpow : 1 ≤ L^K := one_le_rpow hL hK have heq : typeIISmoothDyadicScale U V (U*L^(-K)) 0 = U*V*L^K/16 := by simp only [typeIISmoothDyadicScale, pow_zero, mul_one] rw [rpow_neg hL0.le] field_simp calc _ ≤ U*V/16 := by nlinarith [mul_le_mul_of_nonneg_right h32 (exp_pos (b*L)).le] _ ≤ U*V*L^K/16 := by nlinarith [mul_le_mul_of_nonneg_left hpow (mul_pos hU hV).le] _ = typeIISmoothDyadicScale U V (U*L^(-K)) 0 := heq.symm _ ≤ _ := typeII_smooth_dyadic_scale_mono_zero hU hV hE j end Bounty end section /- Exact source conjugation and endpoint phase placement in a selected pairing. -/ open scoped Classical namespace Bounty theorem selected_marked_phased_pair {G : Type*} [Fintype G] (P : G → Finset ℕ) (marks : G → ℕ) (f g : GroupMarkedLists P marks → ℂ) (w z : ℕ) (Ww Wz a b : ℝ) (C θ F H K : ℂ) (hpair : K = C*physicalPhase a w*physicalPhase b z* ((Ww : ℂ)*groupMarkedAverage P marks (w : ℤ) f)* ((Wz : ℂ)*groupMarkedAverage P marks (z : ℤ) g)) : θ*star F*H*K = C*θ* star (physicalPhase (-a) w*((Ww : ℂ)*groupMarkedAverage P marks (w : ℤ) (fun u => star (f u))*F))* (physicalPhase b z*((Wz : ℂ)*groupMarkedAverage P marks (z : ℤ) g*H)) := by have hs := real_weighted_marked_source_conjugation P marks (w : ℤ) f Ww F rw [hpair, star_mul, hs, physical_phase_star, neg_neg] ring end Bounty end section /- The actual harmonic coefficient mass is controlled by endpoint square energies. -/ open Finset Real namespace Bounty theorem harmonic_coefficient_mass_le (S : Finset ℤ) (θ f g : ℤ → ℂ) {Y : ℝ} (hY : 0 < Y) (hYn : ∀ n ∈ S, Y ≤ (n : ℝ)) (hθ : ∀ n ∈ S, ‖θ n‖ ≤ 1) : (∑ n ∈ S, ‖(θ n/(n : ℂ))*star (f n)*g n‖) ≤ (1/Y)*sqrt (∑ n ∈ S, ‖f n‖^2)*sqrt (∑ n ∈ S, ‖g n‖^2) := by have hterm (n : ℤ) (hn : n ∈ S) : ‖θ n/(n : ℂ)‖ ≤ 1/Y := by have hn0 : (0 : ℝ) < n := hY.trans_le (hYn n hn) have hnorm : ‖(n : ℂ)‖ = (n : ℝ) := by rw [← Complex.ofReal_intCast, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hn0] rw [norm_div, hnorm] exact div_le_div₀ (by norm_num) (hθ n hn) hY (hYn n hn) calc _ ≤ ∑ n ∈ S, (1/Y)*(‖f n‖*‖g n‖) := by apply sum_le_sum intro n hn rw [norm_mul, norm_mul, norm_star] exact (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (hterm n hn) (norm_nonneg _)) (norm_nonneg _)).trans_eq (by ring) _ = (1/Y)*∑ n ∈ S, ‖f n‖*‖g n‖ := (mul_sum ..).symm _ ≤ _ := by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (Real.sum_mul_le_sqrt_mul_sqrt S (fun n => ‖f n‖) (fun n => ‖g n‖)) (one_div_nonneg.mpr hY.le) end Bounty end section /- Exact source conjugation and phase separation for the harmonic Mellin cutoff. -/ namespace Bounty theorem physical_mellin_phased_source_conj (X Z v a : ℝ) (F : ℤ → ℂ) (n : ℤ) : star (physicalMellinSource X Z v (fun m => physicalPhase (-a) m.natAbs * F m) n) = (X : ℂ) * (n : ℂ)⁻¹ * physicalMellinPhase v ((n : ℝ) / Z) * (physicalPhase a n.natAbs * star (F n)) := by simp only [physicalMellinSource, star_mul, Complex.star_def, Complex.conj_ofReal, physical_mellin_phase_conj, physical_phase_star, neg_neg] push_cast ring theorem physical_mellin_phased_source_norm (X Z v a : ℝ) (F : ℤ → ℂ) (n : ℤ) : ‖physicalMellinSource X Z v (fun m => physicalPhase (-a) m.natAbs * F m) n‖ = |X / (n : ℝ)| * ‖F n‖ := by simp only [physicalMellinSource, norm_mul, physical_mellin_phase_norm, physical_phase_norm, mul_one, one_mul, Complex.norm_real, Real.norm_eq_abs] theorem physical_mellin_phased_edge_normalized (X Z a b v : ℝ) (d : ℕ) (n z : ℤ) (F G : ℤ → ℂ) (hX : X ≠ 0) (hZ : Z ≠ 0) (hd : d ≠ 0) (hn : n ≠ 0) : (X : ℂ)⁻¹ * physicalPhase (-(a+b+v)) d * star (physicalMellinSource X Z v (fun m => physicalPhase (-a) m.natAbs * F m) n) * (physicalPhase b z.natAbs * G z) = physicalPhase (-(a+b)) d * physicalMellinPhase v ((n : ℝ) / (Z * d)) * ((n : ℂ)⁻¹ * physicalPhase a n.natAbs * physicalPhase b z.natAbs * star (F n) * G z) := by have hXc : (X : ℂ) ≠ 0 := by exact_mod_cast hX have hnr : (n : ℝ) ≠ 0 := by exact_mod_cast hn rw [physical_mellin_phased_source_conj] rw [show -(a+b+v) = -(a+b) + (-v) by ring, physical_phase_add] calc _ = ((X : ℂ)⁻¹ * (X : ℂ)) * physicalPhase (-(a+b)) d * (physicalMellinPhase v ((n : ℝ) / Z) * physicalPhase (-v) d) * ((n : ℂ)⁻¹ * physicalPhase a n.natAbs * physicalPhase b z.natAbs * star (F n) * G z) := by ring _ = _ := by rw [inv_mul_cancel₀ hXc, one_mul, physical_mellin_phase_ratio v (n : ℝ) Z d hnr hZ hd] end Bounty end section /- Nonempty original probe subsets have products between superpolynomial and subexponential scales, uniformly in their actual prime labels. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_subset_product_range {c ε : ℝ} (hc : 0 < c) (hε : 0 < ε) (J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r : Finset S) (A : Finset (RepeatedBigFlatIndex S J ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → A.Nonempty → ∀ a : (∀ i : A, candidatePBand (c*L) i.val.1.val), Real.exp (L^(1/10 : ℝ)) ≤ (∏ i, (a i).val : ℕ) ∧ (∏ i, (a i).val : ℕ) ≤ Real.exp (ε*L) := by obtain ⟨v, W, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc let D : ℝ := (J : ℝ)*(2/(5*Real.log 2)) filter_upwards [hpool, eventually_scaled_log_sublinear (A := D) (by dsimp [D]; positivity) (s := (2/5 : ℝ)) (by norm_num) hε] with L hp hscaled intro S hS ell probes r A hA hne a have hdata (i : A) := (hp.2.2.2.2.2 i.val.1.val (hS i.val.1.property)).2.2 (a i).val (a i).property have hcard : (A.card : ℝ) ≤ D*Real.log L := by have hAcard : A.card ≤ J*S.card := (card_le_card hA).trans ((repeated_big_prime_probe_sigma_card_le probes r (fun g => by simpa using card_le_univ (probes g))).trans (Nat.mul_le_mul_left J (by simpa only [Fintype.card_coe] using card_le_univ r))) have hScard : (S.card : ℝ) ≤ (2/(5*Real.log 2))*Real.log L := (Nat.cast_le.mpr (card_le_card hS)).trans hp.2.2.2.1 calc _ ≤ (J : ℝ)*S.card := by exact_mod_cast hAcard _ ≤ (J : ℝ)*((2/(5*Real.log 2))*Real.log L) := mul_le_mul_of_nonneg_left hScard (Nat.cast_nonneg J) _ = _ := by dsimp [D]; ring constructor · obtain ⟨i, hi⟩ := hne have hsingle : (a ⟨i, hi⟩).val ≤ ∏ j : A, (a j).val := single_le_prod' (fun j _ => (hdata j).1.one_le) (mem_univ (⟨i, hi⟩ : A)) exact (hdata ⟨i, hi⟩).2.1.le.trans (by exact_mod_cast hsingle) · calc ((∏ i, (a i).val : ℕ) : ℝ) = ∏ i : A, ((a i).val : ℝ) := by simp only [Nat.cast_prod] _ ≤ ∏ _i : A, Real.exp (L^(2/5 : ℝ)) := prod_le_prod₀ (fun _ _ => Nat.cast_nonneg _) (fun i _ => (hdata i).2.2) _ = Real.exp ((A.card : ℝ)*L^(2/5 : ℝ)) := by rw [← Real.exp_sum] simp only [sum_const, card_univ, Fintype.card_coe, nsmul_eq_mul] _ ≤ Real.exp (D*L^(2/5 : ℝ)*Real.log L) := Real.exp_le_exp.mpr (by have hh := mul_le_mul_of_nonneg_right hcard (Real.rpow_nonneg (zero_le_one.trans hp.1) (2/5)) nlinarith) _ ≤ Real.exp (ε*L) := Real.exp_le_exp.mpr hscaled end Bounty end section /- The genuine harmonic source cutoff separates a full positive four-factor box. -/ open Finset MeasureTheory namespace Bounty end Bounty end section /- The genuine window cutoff separates normalized four-factor harmonic polynomials. -/ open Finset MeasureTheory namespace Bounty private theorem box_weight_eq_phase_div (s x : ℝ) : harmonicMellinWeight s x = physicalMellinPhase s x / (x : ℂ) := by unfold harmonicMellinWeight physicalMellinPhase rw [mul_comm Complex.I] private theorem normalized_box_phase_ratio {Y x : ℝ} (hY : 0 < Y) (hx : 0 < x) (s u : ℝ) : physicalMellinPhase s x * physicalMellinPhase (2 * Real.pi * u) (x / Y) = physicalMellinPhase (-2 * Real.pi * u) Y * physicalMellinPhase (s + 2 * Real.pi * u) x := by unfold physicalMellinPhase rw [Real.log_div hx.ne' hY.ne'] simp only [← Complex.exp_add] congr 1 push_cast ring private theorem normalized_box_weight_ratio {Y x : ℝ} (hY : 0 < Y) (hx : 0 < x) (s u : ℝ) : harmonicMellinWeight s x * physicalMellinPhase (2 * Real.pi * u) (x / Y) = physicalMellinPhase (-2 * Real.pi * u) Y * harmonicMellinWeight (s + 2 * Real.pi * u) x := by simp only [box_weight_eq_phase_div] calc _ = (physicalMellinPhase s x * physicalMellinPhase (2 * Real.pi * u) (x / Y)) / (x : ℂ) := by ring _ = _ := by rw [normalized_box_phase_ratio hY hx]; ring theorem harmonic_normalized_four_box_integrable (Y s : ℝ) (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (hD : ∀ d ∈ D, 0 < d) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) : Integrable (fun u : ℝ => harmonicWindowLogFourier u * physicalMellinPhase (-2 * Real.pi * u) Y * ((∑ d ∈ D, δ d * harmonicMellinWeight (s + 2 * Real.pi * u) d) * (∑ a ∈ A, α a * harmonicMellinWeight (s + 2 * Real.pi * u) a) * (∑ b ∈ B, β b * harmonicMellinWeight (s + 2 * Real.pi * u) b) * (∑ c ∈ C, γ c * harmonicMellinWeight (s + 2 * Real.pi * u) c))) := by have hi := finite_mellin_sum_integrable (D ×ˢ (A ×ˢ (B ×ˢ C))) (fun u => harmonicWindowLogFourier u * physicalMellinPhase (-2 * Real.pi * u) Y) (fun u => s + 2 * Real.pi * u) (physical_mellin_phase_integrable harmonicWindowLogFourier (fun u => -2 * Real.pi * u) harmonic_window_log_fourier_integrable (by fun_prop) Y) (by fun_prop) (fun q => (δ q.1 * α q.2.1 * β q.2.2.1 * γ q.2.2.2) / (((q.1*q.2.1*q.2.2.1*q.2.2.2 : ℕ) : ℝ) : ℂ)) (fun q => ((q.1*q.2.1*q.2.2.1*q.2.2.2 : ℕ) : ℝ)) apply hi.congr filter_upwards [] with u simp only [sum_product] rw [← harmonic_mellin_four_factor_box D A B C hD hA hB hC δ α β γ] congr 1 apply sum_congr rfl intro d _ apply sum_congr rfl intro a _ apply sum_congr rfl intro b _ apply sum_congr rfl intro c _ rw [box_weight_eq_phase_div] ring theorem harmonic_normalized_four_box_mellin {Y : ℝ} (hY : 0 < Y) (s : ℝ) (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (hD : ∀ d ∈ D, 0 < d) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) : (∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, (δ d * α a * β b * γ c) * ((harmonicCommonCutoff (((d*a*b*c : ℕ) : ℝ) / Y) / ((d*a*b*c : ℕ) : ℝ) : ℝ) : ℂ) * physicalMellinPhase s ((d*a*b*c : ℕ) : ℝ)) = ∫ u : ℝ, harmonicWindowLogFourier u * physicalMellinPhase (-2 * Real.pi * u) Y * ((∑ d ∈ D, δ d * harmonicMellinWeight (s + 2 * Real.pi * u) d) * (∑ a ∈ A, α a * harmonicMellinWeight (s + 2 * Real.pi * u) a) * (∑ b ∈ B, β b * harmonicMellinWeight (s + 2 * Real.pi * u) b) * (∑ c ∈ C, γ c * harmonicMellinWeight (s + 2 * Real.pi * u) c)) := by let K := D ×ˢ (A ×ˢ (B ×ˢ C)) let m : ℕ × ℕ × ℕ × ℕ → ℝ := fun q => ((q.1*q.2.1*q.2.2.1*q.2.2.2 : ℕ) : ℝ) let f : ℕ × ℕ × ℕ × ℕ → ℂ := fun q => δ q.1 * α q.2.1 * β q.2.2.1 * γ q.2.2.2 have hm : ∀ q ∈ K, 0 < m q := by intro q hq obtain ⟨hd, ha, hb, hc⟩ := by simpa only [K, mem_product] using hq dsimp only [m] exact_mod_cast mul_pos (mul_pos (mul_pos (hD q.1 hd) (hA q.2.1 ha)) (hB q.2.2.1 hb)) (hC q.2.2.2 hc) have hrep := finite_mellin_sum_representation K harmonicWindowLogFourier (fun u => 2 * Real.pi * u) harmonic_window_log_fourier_integrable (by fun_prop) (fun q => f q * harmonicMellinWeight s (m q)) (fun q => m q / Y) (fun x => (harmonicCommonCutoff x : ℂ)) (by intro q hq _ exact harmonic_window_cutoff_mellin_representation (div_pos (hm q hq) hY)) calc _ = ∑ q ∈ K, (f q * harmonicMellinWeight s (m q)) * (harmonicCommonCutoff (m q / Y) : ℂ) := by dsimp only [K, f, m] simp only [sum_product] apply sum_congr rfl intro d _ apply sum_congr rfl intro a _ apply sum_congr rfl intro b _ apply sum_congr rfl intro c _ rw [box_weight_eq_phase_div, Complex.ofReal_div] ring _ = ∫ u : ℝ, harmonicWindowLogFourier u * ∑ q ∈ K, (f q * harmonicMellinWeight s (m q)) * physicalMellinPhase (2 * Real.pi * u) (m q / Y) := hrep _ = _ := by apply integral_congr_ae filter_upwards [] with u have hs : (∑ q ∈ K, (f q * harmonicMellinWeight s (m q)) * physicalMellinPhase (2 * Real.pi * u) (m q / Y)) = physicalMellinPhase (-2 * Real.pi * u) Y * ∑ q ∈ K, f q * harmonicMellinWeight (s + 2 * Real.pi * u) (m q) := by rw [mul_sum] apply sum_congr rfl intro q hq rw [mul_assoc, normalized_box_weight_ratio hY (hm q hq)] ring rw [hs, ← mul_assoc] dsimp only [K, f, m] simp only [sum_product] rw [harmonic_mellin_four_factor_box D A B C hD hA hB hC δ α β γ] end Bounty end section /- Absolute coefficient-mass control for the new harmonic source frequency. -/ open Finset MeasureTheory namespace Bounty end Bounty end section /- Power-saving centered Fourier reduction on the exact common integer support. -/ open Finset MeasureTheory Filter namespace Bounty theorem eventually_common_centered_fourier_of_mellin {b : ℝ} (hb : 0 < b) (A B : ℝ) : ∃ D : ℝ, A < D ∧ ∀ᶠ L : ℝ in atTop, ∀ (Y H c : ℝ) (f : ℤ → ℂ), Real.exp (b*L) ≤ Y → Real.log Y ≤ 6*L → 1 ≤ H → H ≤ Real.exp ((b/2)*L) → (∑ n ∈ harmonicCommonSupport Y, ‖f n‖^2) ≤ Y*L^B → (∫ t in {t : ℝ | |t| ≤ L*Y/H}, ‖localMellinPolynomial ((harmonicCommonSupport Y).image Int.natAbs) (fun n => f n*fourier (n:ℤ) (c:AddCircle (1:ℝ))) t‖^2) ≤ Y^2*L^(-D) → (∫ x in Set.Icc (c-1/H) (c+1/H), ‖finiteFourierSum (harmonicCommonSupport Y) f x‖^2) ≤ Y*L^(-A) := by obtain ⟨D,hD,hred⟩ := eventually_local_fourier_of_mellin hb (by norm_num : (0:ℝ)≤64) A B refine ⟨D,hD,?_⟩ filter_upwards [hred,eventually_harmonic_common_cutoff_geometry, eventually_ge_atTop (1:ℝ)] with L hred hcut hL intro Y H c f hY hlog hH hHu hE hM have hYp : 0 < Y := (Real.exp_pos _).trans_le hY have hY1 : 1 ≤ Y := (Real.one_le_exp (by positivity : 0 ≤ b*L)).trans hY have hHp : 0 < H := lt_of_lt_of_le zero_lt_one hH have hpos : ∀ n ∈ harmonicCommonSupport Y, 0 ≤ n := fun n hn => (harmonic_common_support_positive hYp hn).le obtain ⟨hN,hlogN⟩ := hcut Y hY1 hlog have hSN : ∀ n ∈ (harmonicCommonSupport Y).image Int.natAbs, n ≤ ⌈4*Real.exp 2*Y⌉₊ := fun n hn => (harmonic_common_natural_support_bound hYp hn).2 have hS : ∀ n ∈ (harmonicCommonSupport Y).image Int.natAbs, Y/8 ≤ (n:ℝ) ∧ (n:ℝ) ≤ 64*Y := by intro n hn exact ⟨((mem_harmonic_common_natural_support hYp).mp hn).1, (Nat.cast_le.mpr (hSN n hn)).trans hN⟩ rw [finite_fourier_centered_energy (harmonicCommonSupport Y) f hpos c H hHp] apply hred Y H ((harmonicCommonSupport Y).image Int.natAbs) (fun n => f n*fourier (n:ℤ) (c:AddCircle (1:ℝ))) ⌈4*Real.exp 2*Y⌉₊ hY hH hHu hS hSN hN hlogN _ hM rw [finite_fourier_modulated_energy (harmonicCommonSupport Y) f hpos c] exact hE end Bounty end section /- Squared Schwartz tails absorb fixed polynomial mean-square costs at a fixed radius exponent. -/ open Filter MeasureTheory Real namespace Bounty theorem eventually_schwartz_squared_tail_polynomial (f : SchwartzMap ℝ ℂ) {r : ℝ} (hr : 0 < r) (K E F : ℝ) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, (∫ u in {u : ℝ | L^r < ‖u‖}, ‖f u‖)^2 * (K*L^E) ≤ L^(-F) := by filter_upwards [eventually_schwartz_tail_polynomial f hr 1 0 0 (by norm_num), eventually_schwartz_tail_polynomial f hr K E F hK, eventually_gt_atTop (0 : ℝ)] with L hsmall hdecay hL have ht0 : 0 ≤ ∫ u in {u : ℝ | L^r < ‖u‖}, ‖f u‖ := integral_nonneg (fun _ => norm_nonneg _) have ht1 : (∫ u in {u : ℝ | L^r < ‖u‖}, ‖f u‖) ≤ 1 := by simpa only [rpow_zero, neg_zero, one_mul, mul_one] using hsmall calc _ ≤ (∫ u in {u : ℝ | L^r < ‖u‖}, ‖f u‖) * (K*L^E) := mul_le_mul_of_nonneg_right (by nlinarith only [ht0,ht1]) (mul_nonneg hK (rpow_nonneg hL.le E)) _ ≤ L^(-F) := by simpa only [mul_assoc] using hdecay end Bounty end section /- A fixed polynomial factor fits inside any positive linear exponential. -/ open Filter namespace Bounty theorem eventually_rpow_le_exp_linear (K : ℝ) {ε : ℝ} (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, L^K ≤ Real.exp (ε*L) := by filter_upwards [eventually_scaled_log_sublinear (A := max K 0) (le_max_right _ _) (s := 0) (by norm_num) hε, eventually_ge_atTop (1 : ℝ)] with L hscale hL have hL0 : 0 < L := zero_lt_one.trans_le hL simp only [Real.rpow_zero, mul_one] at hscale rw [Real.rpow_def_of_pos hL0] apply Real.exp_le_exp.mpr calc Real.log L*K = K*Real.log L := mul_comm _ _ _ ≤ max K 0*Real.log L := mul_le_mul_of_nonneg_right (le_max_left _ _) (Real.log_nonneg hL) _ ≤ ε*L := hscale end Bounty end section /- Energy and retained-box geometry for the exact original common cutoff. -/ open Finset Filter MeasureTheory namespace Bounty theorem eventually_harmonic_four_dyadic_energy {Ω : Type*} [MeasurableSpace Ω] : ∀ᶠ L : ℝ in atTop, ∀ (μ : Measure Ω) (Y : ℝ), 1 ≤ Y → Real.log Y ≤ 6*L → ∀ (δ α β γ : ℕ → ℂ) (phase : Ω → ℕ → ℂ) (E : ℝ), 0 ≤ E → let S := (harmonicCommonSupport Y).image Int.natAbs let N := ⌈4*Real.exp 2*Y⌉₊ let F := fun s (n : ℕ) => (harmonicCommonCutoff ((n : ℝ)/Y) : ℂ) / (n : ℂ) * phase s n (∀ i ∈ dyadicNatIndices (Icc 1 N), ∀ j ∈ dyadicNatIndices (Icc 1 N), ∀ k ∈ dyadicNatIndices (Icc 1 N), ∀ l ∈ dyadicNatIndices (Icc 1 N), retainedFourDyadicBox S N i j k l → Integrable (fun s => ‖fourDyadicBoxSum N δ α β γ (F s) i j k l‖ ^ 2) μ) → (∀ i ∈ dyadicNatIndices (Icc 1 N), ∀ j ∈ dyadicNatIndices (Icc 1 N), ∀ k ∈ dyadicNatIndices (Icc 1 N), ∀ l ∈ dyadicNatIndices (Icc 1 N), retainedFourDyadicBox S N i j k l → (∫ s, ‖fourDyadicBoxSum N δ α β γ (F s) i j k l‖ ^ 2 ∂μ) ≤ E) → (∫ s, ‖∑ n ∈ S, endpointFourConvolution δ α β γ n * F s n‖ ^ 2 ∂μ) ≤ L ^ 9 * E := by filter_upwards [eventually_dyadic_eighth_card_le 64, eventually_harmonic_common_cutoff_geometry] with L hcard hgeom intro μ Y hY hlog δ α β γ phase E hE0 S N F hf hE have hY0 : 0 < Y := by linarith have hS : ∀ n ∈ S, n ≤ N := fun n hn => (harmonic_common_natural_support_bound hY0 hn).2 have hF : ∀ s n, n ∉ S → F s n = 0 := by intro s n hn dsimp only [F] rw [harmonic_common_cutoff_zero_outside_natural hY0 hn, Complex.ofReal_zero, zero_div, zero_mul] exact (endpoint_four_dyadic_energy μ S N hS δ α β γ F hF E hE0 hf hE).trans (mul_le_mul_of_nonneg_right (hcard N (hgeom Y hY hlog).2) hE0) theorem retained_harmonic_four_dyadic_product_bounds {Y : ℝ} (hY : 0 < Y) {N i j k l d a b c : ℕ} (hbox : retainedFourDyadicBox ((harmonicCommonSupport Y).image Int.natAbs) N i j k l) (hd : d ∈ dyadicNatBucket (Icc 1 N) i) (ha : a ∈ dyadicNatBucket (Icc 1 N) j) (hb : b ∈ dyadicNatBucket (Icc 1 N) k) (hc : c ∈ dyadicNatBucket (Icc 1 N) l) : Y/128 ≤ ((d*a*b*c : ℕ) : ℝ) ∧ ((d*a*b*c : ℕ) : ℝ) ≤ 64*Real.exp 2*Y := by have hp : ∀ n ∈ Icc 1 N, 0 < n := fun n hn => (mem_Icc.mp hn).1 have h := retained_four_dyadic_product_bounds _ (Icc 1 N) (Icc 1 N) (Icc 1 N) (Icc 1 N) hp hp hp hp (fun n hn => (mem_harmonic_common_natural_support hY).mp hn) hbox hd ha hb hc constructor <;> linarith [h.1, h.2] end Bounty end section /- Normalized selected histories satisfy the scalar bound in the original absolute-residue formulation. -/ open Finset namespace Bounty section Energy variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) end Energy end Bounty end section /- The original root-path weight in its indexed selected coordinates. -/ open Finset open scoped Classical namespace Bounty section Term variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (β : PhysicalPrime P → ℝ) (B : ℕ) end Term end Bounty end section /- The root residue model is an unrestricted memory sum with only its return indicator. -/ open Finset open scoped Classical namespace Bounty section Normalization variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) end Normalization end Bounty end section /- The recovered coefficient as a local phase on the unchanged original events. -/ open scoped Classical namespace Bounty section Coefficient variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) noncomputable def physicalLocalCoefficientPhase : (tag : Option (Fin (n + 1) ⊕ Fin n)) → (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) → PhysicalFullLedgerEvent C k tag s → ℂ | none, _, _ => 1 | some (.inl _), _, _ => 1 | some (.inr j), s, e => physicalActiveCoefficient (cut (4 * j.val + 2)) (cut (4 * j.val + 3)) (C j) (ζ j) (K j) (fun g => (s.2 g).1) (fun g => ((physicalFullLedgerEventTarget C k (some (.inr j)) s e).2 g).1) e.1 theorem physical_local_coefficient_nonedge (i : ℕ) (hi : i % 4 ≠ 2) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i) s) : physicalLocalCoefficientPhase C k cut ζ K (physicalSelectedFineTag n i) s e = 1 := by have hgood (j : Fin n) : physicalSelectedFineTag n i ≠ some (.inr j) := by intro h unfold physicalSelectedFineTag at h split_ifs at h; simp_all generalize ht : physicalSelectedFineTag n i = tag at e ⊢ cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => exact (hgood j ht).elim theorem physical_local_coefficient_edge_observation (j : Fin n) (before after : Fin N → Finset (Fin J)) (tag : Option (Fin (n + 1) ⊕ Fin n)) (htag : tag = some (.inr j)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : physicalLocalCoefficientPhase C k cut ζ K tag s e = physicalObservedCoefficient C cut ζ K j (physicalFullEventObservation C k before after tag s e) (fun g => (s.2 g).1) (fun g => ((physicalFullLedgerEventTarget C k tag s e).2 g).1) := by subst tag exact (physical_observed_coefficient_aux C cut ζ K j e.1 _ _).symm end Coefficient end Bounty end section /- The original root model with the small-residue average outside the path sums. -/ open Finset open scoped Classical namespace Bounty theorem _root_.Bounty.SourceAuxPreload.sub_index {N n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (B : ℕ) (hB : (Bounty.physicalPrimeGroups P groups).card ≤ B) (j : Fin (n+1)) : n - (j : ℕ) < n+1 := by omega end Bounty end section /- Mesh parameters chosen before logarithmic proxy precision. -/ open Finset Filter namespace Bounty end Bounty end section /- Character and harmonic Mellin discrepancy for the actual ambient Type-II coefficient masks. -/ open Finset Filter namespace Bounty theorem typeIIRestrict_Icc_weighted_sum (f : ℕ → ℝ) (w : ℕ → ℂ) (a b m n : ℕ) : (∑ i ∈ Ioc m n, (typeIIRestrict (Icc a b) f i : ℂ) * w i) = ∑ i ∈ Ioc (max m (a-1)) (min n b), (f i : ℂ) * w i := by classical have hset : (Ioc m n).filter (fun i => i ∈ Icc a b) = Ioc (max m (a-1)) (min n b) := by ext i simp only [mem_filter, mem_Ioc, mem_Icc, max_lt_iff, le_min_iff] omega calc _ = ∑ i ∈ (Ioc m n).filter (fun i => i ∈ Icc a b), (f i : ℂ) * w i := by rw [sum_filter] apply sum_congr rfl intro i _ by_cases hi : i ∈ Icc a b <;> simp only [typeIIRestrict, hi, if_true, if_false, Complex.ofReal_zero, zero_mul] _ = _ := by rw [hset] theorem norm_Ioc_sum_le_rpow_of_dyadic {L B A : ℝ} (hA : 0 < A) (hL : 1 ≤ L) (hLbig : 2/Real.log 2+2 ≤ L) (g : ℕ → ℂ) (m n : ℕ) (hm : A ≤ ((m+1 : ℕ) : ℝ)) (hn : (n : ℝ) ≤ Real.exp (2*L)) (hlocal : ∀ Y : ℝ, A/2 ≤ Y → Y ≤ Real.exp (2*L) → ∀ lo hi : ℕ, lo ≤ hi → Y ≤ ((lo+1 : ℕ) : ℝ) → (hi : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc lo hi, g i‖ ≤ L^(-(B+2))) : ‖∑ i ∈ Ioc m n, g i‖ ≤ L^(-B) := by have hLpos : 0 < L := zero_lt_one.trans_le hL have hh := norm_Ioc_sum_le_dyadic_card g m n hA (Real.rpow_nonneg hLpos.le _) hm hn hlocal have hc := dyadicNatIndices_Ioc_card_le_exp_window hLpos.le m n hn have hcard : ((dyadicNatIndices (Ioc m n)).card : ℝ) ≤ L^2 := by have hmul := mul_le_mul_of_nonneg_right hLbig hLpos.le have hscale : 2*L/Real.log 2+2 ≤ (2/Real.log 2+2)*L := by calc _ = (2/Real.log 2)*L+2 := by ring _ ≤ _ := by nlinarith exact hc.trans (hscale.trans (by nlinarith [hmul])) calc _ ≤ ((dyadicNatIndices (Ioc m n)).card : ℝ) * L^(-(B+2)) := hh _ ≤ L^2 * L^(-(B+2)) := mul_le_mul_of_nonneg_right hcard (by positivity) _ = L^(-B) := by rw [← Real.rpow_two, ← Real.rpow_add hLpos] congr 1 ring theorem eventually_exp_half_le_half_exp {a : ℝ} (ha : 0 < a) : ∀ᶠ L : ℝ in atTop, Real.exp ((a/2)*L) ≤ Real.exp (a*L)/2 := by filter_upwards [eventually_ge_atTop (Real.log 2/(a/2))] with L hL have hscale : Real.log 2 ≤ (a/2)*L := by have h := (div_le_iff₀ (half_pos ha)).mp hL nlinarith only [h] have htwo : 2 ≤ Real.exp ((a/2)*L) := by calc _ = Real.exp (Real.log 2) := (Real.exp_log (by norm_num)).symm _ ≤ _ := Real.exp_le_exp.mpr hscale have heq : Real.exp (a*L) = Real.exp ((a/2)*L) * Real.exp ((a/2)*L) := by rw [← Real.exp_add] congr 1 ring rw [heq] nlinarith [Real.exp_pos ((a/2)*L)] theorem eventually_rough_test_proxy_long_discrepancy (hZ : PrimitiveZeroFreeHalfPlane) {a γ S T B : ℝ} (ha : 0 < a) (hγ : 0 < γ) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+B+4 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ t : ℝ, |t| ≤ L^T → ∀ m n : ℕ, Real.exp (a*L) ≤ ((m+1 : ℕ) : ℝ) → (n : ℝ) ≤ Real.exp (2*L) → ‖∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight t i*χ (i : ZMod r)‖ ≤ L^(-B) := by filter_upwards [eventually_rough_test_proxy_character_discrepancy hZ (half_pos ha) hγ (by norm_num : (0 : ℝ) < 2) hS hT (Bsave := B+2) (by linarith), eventually_exp_half_le_half_exp ha, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (2/Real.log 2+2)] with L hlocal hhalf hL hLbig intro r hr χ hrT t ht m n hm hn apply norm_Ioc_sum_le_rpow_of_dyadic (Real.exp_pos (a*L)) hL hLbig _ m n hm hn intro Y hY hYU lo hi hlohi hYlo hhi exact hlocal Y (hhalf.trans hY) hYU r χ hrT t ht lo hi hlohi hYlo hhi theorem eventually_prime_proxy_long_discrepancy (hZ : PrimitiveZeroFreeHalfPlane) {a S T B : ℝ} (ha : 0 < a) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+B+4 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ t : ℝ, |t| ≤ L^T → ∀ m n : ℕ, Real.exp (a*L) ≤ ((m+1 : ℕ) : ℝ) → (n : ℝ) ≤ Real.exp (2*L) → ‖∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight t i*χ (i : ZMod r)‖ ≤ L^(-B) := by filter_upwards [eventually_prime_proxy_character_discrepancy hZ (half_pos ha) hS hT (Bsave := B+2) (by linarith), eventually_exp_half_le_half_exp ha, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (2/Real.log 2+2)] with L hlocal hhalf hL hLbig intro r hr χ hrT t ht m n hm hn apply norm_Ioc_sum_le_rpow_of_dyadic (Real.exp_pos (a*L)) hL hLbig _ m n hm hn intro Y hY _ lo hi hlohi hYlo hhi exact hlocal Y (hhalf.trans hY) r χ hrT t ht lo hi hlohi hYlo hhi theorem norm_typeIIRestrict_Icc_sum_le (f : ℕ → ℝ) (w : ℕ → ℂ) (a b m n : ℕ) {A U E : ℝ} (ha : 1 ≤ a) (hlo : A ≤ (a : ℝ)) (hhi : (b : ℝ) ≤ U) (hbound : ∀ lo hi : ℕ, A ≤ ((lo+1 : ℕ) : ℝ) → (hi : ℝ) ≤ U → ‖∑ i ∈ Ioc lo hi, (f i : ℂ)*w i‖ ≤ E) : ‖∑ i ∈ Ioc m n, (typeIIRestrict (Icc a b) f i : ℂ)*w i‖ ≤ E := by rw [typeIIRestrict_Icc_weighted_sum] apply hbound · exact hlo.trans (Nat.cast_le.mpr (by omega)) · exact (Nat.cast_le.mpr (min_le_right n b)).trans hhi theorem eventually_ambient_rough_interval_typeII_discrepancy_uniform (hZ : PrimitiveZeroFreeHalfPlane) {γ vMax S T B : ℝ} (hγ : 0 < γ) (hv : vMax < 1) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+B+4 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ a v : ℝ, v ≤ vMax → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ t : ℝ, |t| ≤ L^T → ∀ m n : ℕ, ‖∑ i ∈ Ioc m n, (ambientRoughIntervalTypeIIAlpha γ L S a v i : ℂ)* harmonicMellinWeight t i*χ (i : ZMod r)‖ ≤ L^(-B) := by filter_upwards [eventually_rough_test_proxy_long_discrepancy hZ (by linarith : 0 < 1-vMax) hγ hS hT hprecision, eventually_ge_atTop (Real.log 33), eventually_ge_atTop (0 : ℝ)] with L hlong hL hL0 intro a v hvMax r hr χ hrT t ht m n have hlower : Real.exp ((1-vMax)*L) ≤ Real.exp ((1-v)*L) := by apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonneg_right (by linarith) hL0 have h33 : (33 : ℝ) ≤ Real.exp L := by calc _ = Real.exp (Real.log 33) := (Real.exp_log (by norm_num)).symm _ ≤ _ := Real.exp_le_exp.mpr hL have hupper : 33*Real.exp L ≤ Real.exp (2*L) := by calc _ ≤ Real.exp L*Real.exp L := mul_le_mul_of_nonneg_right h33 (by positivity) _ = _ := by rw [← Real.exp_add]; congr 1; ring simp only [ambientRoughIntervalTypeIIAlpha, ambient_rough_cofactor_range_eq_Icc, mul_assoc] apply norm_typeIIRestrict_Icc_sum_le _ _ _ _ m n (Nat.le_max_left _ _) (A := Real.exp ((1-vMax)*L)) (U := Real.exp (2*L)) · exact hlower.trans ((Nat.le_ceil _).trans (Nat.cast_le.mpr (Nat.le_max_right _ _))) · exact (Nat.cast_le.mpr (min_le_left _ _)).trans ((Nat.floor_le (by positivity)).trans hupper) · intro lo hi hlo hhi simpa only [mul_assoc] using hlong r χ hrT t ht lo hi hlo hhi theorem eventually_ambient_prime_typeII_discrepancy (hZ : PrimitiveZeroFreeHalfPlane) {S T B : ℝ} (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+B+4 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ t : ℝ, |t| ≤ L^T → ∀ m n : ℕ, ‖∑ i ∈ Ioc m n, (ambientPrimeTypeIIAlpha κ L S i : ℂ)* harmonicMellinWeight t i*χ (i : ZMod r)‖ ≤ L^(-B) := by filter_upwards [eventually_prime_proxy_long_discrepancy hZ (by norm_num : (0 : ℝ) < 2/5) hS hT hprecision, eventually_ge_atTop (0 : ℝ)] with L hlong hL intro κ hκ hκsmall r hr χ hrT t ht m n have hlower : Real.exp ((2/5 : ℝ)*L) ≤ Real.exp (((1/2 : ℝ)-2*κ)*L) := by apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonneg_right (by linarith) hL have hupper : Real.exp (((1/2 : ℝ)+2*κ)*L) ≤ Real.exp (2*L) := by apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonneg_right (by linarith) hL simp only [ambientPrimeTypeIIAlpha, ambient_balanced_typeII_range_eq_Icc, mul_assoc] apply norm_typeIIRestrict_Icc_sum_le _ _ _ _ m n (Nat.le_max_left _ _) (A := Real.exp ((2/5 : ℝ)*L)) (U := Real.exp (2*L)) · exact hlower.trans ((Nat.le_ceil _).trans (Nat.cast_le.mpr (Nat.le_max_right _ _))) · exact (Nat.floor_le (by positivity)).trans hupper · intro lo hi hlo hhi simpa only [mul_assoc] using hlong r χ hrT t ht lo hi hlo hhi end Bounty end section /- Every row is the actual signed ghost row, the two permutation averages, or the sum of actual mixed full actions over one pattern and one auxiliary. -/ open Finset open scoped Classical namespace Bounty section Paths variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] [Fintype I] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) (phase : ∀ tag s, PhysicalMixedWordEvent (ell := ell) n shared B A Δ D tag s → ℂ) noncomputable def physicalMixedWordPathAction (steps : List (Option (V ⊕ K))) (pathPhase : ∀ s, FiniteEventPath (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) steps s → ℂ) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) := let _ : ∀ tag s, Fintype (PhysicalMixedWordEvent (V := V) (ell := ell) n shared B A Δ D tag s) := physicalMixedWordEventFintype n shared B A Δ D finiteEventPathAction (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge) steps pathPhase F theorem physical_mixed_word_eq_paths (steps : List (Option (V ⊕ K))) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) : finiteOperatorListAction (physicalMixedWordRow n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase) steps F = physicalMixedWordPathAction n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge steps (finiteEventLocalPhase (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) phase steps) F := by let _ : ∀ tag s, Fintype (PhysicalMixedWordEvent (V := V) (ell := ell) n shared B A Δ D tag s) := physicalMixedWordEventFintype n shared B A Δ D exact finite_phased_rows_eq_event_paths _ _ _ _ steps F end Paths end Bounty end section /- Exact packing into small-coordinate choices and original full big paths. No pattern, auxiliary, permutation, or zero-weight event is removed. -/ open Finset open scoped Classical namespace Bounty section Packing variable {S G I V K : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) noncomputable def physicalMixedPathUnpack : ∀ ks r L x, FiniteEventPath (PhysicalMixedWordEvent (V := V) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) ks ((r, L), x) → Σ pl : PhysicalMixedSmallPlan (I := I) ks, PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x | [], _, _, _, _ => ⟨PUnit.unit, PUnit.unit⟩ | none :: ks, r, L, x, ⟨⟨σ, τ⟩, p⟩ => let z := physicalMixedPathUnpack ks r (physicalPermuteLabels σ L) (fullActivePermutation τ x) p ⟨(σ, z.1), ⟨ULift.up τ, z.2⟩⟩ | some (.inl _) :: ks, r, L, x, ⟨e, p⟩ => let z := physicalMixedPathUnpack ks r L (coupledGhostJointEventTarget M B x e) p ⟨z.1, ⟨ULift.up e, z.2⟩⟩ | some (.inr k) :: ks, r, L, x, ⟨⟨i, a, ⟨R, ⟨_, e⟩⟩⟩, p⟩ => let z := physicalMixedPathUnpack ks (physicalTranslateResidues r (kbig k i (productActiveMemorySplit (shared i) B x).1 a * (physicalSharedProduct (physicalSharedPrefix L) : ℕ))) R (fullActiveEdgeEventTarget n (shared i) B (fun _ => A i) (Δ k i (physicalSharedPrefix L)) (D k i (physicalSharedPrefix L)) x ⟨a, e⟩) p ⟨((i, R), z.1), ⟨⟨a, e⟩, z.2⟩⟩ noncomputable def physicalMixedPathPack : ∀ ks r L x, (Σ pl : PhysicalMixedSmallPlan (I := I) ks, PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) → FiniteEventPath (PhysicalMixedWordEvent (V := V) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) ks ((r, L), x) | [], _, _, _, _ => PUnit.unit | none :: ks, r, L, x, ⟨(σ, pl), ⟨τ, p⟩⟩ => ⟨(σ, τ.down), physicalMixedPathPack ks r (physicalPermuteLabels σ L) (fullActivePermutation τ.down x) ⟨pl, p⟩⟩ | some (.inl _) :: ks, r, L, x, ⟨pl, ⟨e, p⟩⟩ => ⟨e.down, physicalMixedPathPack ks r L (coupledGhostJointEventTarget M B x e.down) ⟨pl, p⟩⟩ | some (.inr k) :: ks, r, L, x, ⟨((i, R), pl), ⟨⟨a, e⟩, p⟩⟩ => ⟨⟨i, a, (R, ⟨(), e⟩)⟩, physicalMixedPathPack ks (physicalTranslateResidues r (kbig k i (productActiveMemorySplit (shared i) B x).1 a * (physicalSharedProduct (physicalSharedPrefix L) : ℕ))) R (fullActiveEdgeEventTarget n (shared i) B (fun _ => A i) (Δ k i (physicalSharedPrefix L)) (D k i (physicalSharedPrefix L)) x ⟨a, e⟩) ⟨pl, p⟩⟩ theorem physical_mixed_path_pack_unpack (ks : List (Option (V ⊕ K))) r L x (p : FiniteEventPath (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) ks ((r, L), x)) : physicalMixedPathPack n shared B A Δ D kbig ks r L x (physicalMixedPathUnpack n shared B A Δ D kbig ks r L x p) = p := by induction ks generalizing r L x with | nil => cases p; rfl | cons tag ks ih => cases tag with | none => rcases p with ⟨⟨σ, τ⟩, p⟩ simp only [physicalMixedPathUnpack, physicalMixedPathPack] erw [Sigma.eta, ih] | some tag => cases tag with | inl j => rcases p with ⟨e, p⟩ simp only [physicalMixedPathUnpack, physicalMixedPathPack] erw [Sigma.eta, ih] | inr k => rcases p with ⟨⟨i, a, R, u, e⟩, p⟩ cases u simp only [physicalMixedPathUnpack, physicalMixedPathPack] erw [Sigma.eta, ih] theorem physical_mixed_path_unpack_pack (ks : List (Option (V ⊕ K))) r L x (z : Σ pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks, PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) : physicalMixedPathUnpack n shared B A Δ D kbig ks r L x (physicalMixedPathPack n shared B A Δ D kbig ks r L x z) = z := by induction ks generalizing r L x with | nil => rcases z with ⟨⟨⟩, ⟨⟩⟩; rfl | cons tag ks ih => cases tag with | none => rcases z with ⟨⟨σ, pl⟩, ⟨⟨τ⟩, p⟩⟩ simp only [physicalMixedPathPack, physicalMixedPathUnpack] rw [ih] | some tag => cases tag with | inl j => rcases z with ⟨pl, ⟨⟨e⟩, p⟩⟩ simp only [physicalMixedPathPack, physicalMixedPathUnpack] rw [ih] | inr k => rcases z with ⟨⟨⟨i, R⟩, pl⟩, ⟨⟨a, e⟩, p⟩⟩ simp only [physicalMixedPathPack, physicalMixedPathUnpack] rw [ih] noncomputable def physicalMixedPathPackingEquiv (ks : List (Option (V ⊕ K))) r L x : FiniteEventPath (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) ks ((r, L), x) ≃ Σ pl : PhysicalMixedSmallPlan (I := I) ks, PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x where toFun := physicalMixedPathUnpack n shared B A Δ D kbig ks r L x invFun := physicalMixedPathPack n shared B A Δ D kbig ks r L x left_inv := physical_mixed_path_pack_unpack n shared B A Δ D kbig ks r L x right_inv := physical_mixed_path_unpack_pack n shared B A Δ D kbig ks r L x end Packing end Bounty end section /- Packing preserves the original chronological tags and number of steps. -/ namespace Bounty section Schedule variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell : ℕ} theorem physical_mixed_big_steps_tags (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) : (physicalMixedBigSteps ks L pl).map (Option.map (Sum.map id (fun key => key.1))) = ks := by induction ks generalizing L with | nil => rfl | cons tag ks ih => cases tag with | none => rcases pl with ⟨σ, pl⟩ simpa only [physicalMixedBigSteps, List.map_cons, Option.map_none] using congrArg (none :: ·) (ih (physicalPermuteLabels σ L) pl) | some tag => cases tag with | inl j => simpa only [physicalMixedBigSteps, List.map_cons, Option.map_some, Sum.map_inl, id_eq] using congrArg (some (.inl j) :: ·) (ih L pl) | inr k => rcases pl with ⟨⟨i, R⟩, pl⟩ simpa only [physicalMixedBigSteps, List.map_cons, Option.map_some, Sum.map_inr] using congrArg (some (.inr k) :: ·) (ih R pl) end Schedule end Bounty end section /- Small scalar factors have modulus at most one in the physical range. -/ open Finset open scoped Classical namespace Bounty section Small variable {S G I V K : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (Vs : S → ℝ) (qedge : K → ℝ) (hV : ∀ g, 1 ≤ Vs g) (hq : ∀ k, qedge k ≤ 1) end Small end Bounty end section /- The actual discrepant ambient coefficients are positive-indexed and free of the candidate group pool. -/ open Finset Filter namespace Bounty theorem eventually_ambient_rough_endpoint_group_free {c γ : ℝ} (hc : 0 < c) (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, ∀ S a v : ℝ, ∀ m : ℕ, ambientRoughIntervalTypeIIAlpha γ L S a v m ≠ 0 → 0 < m ∧ Disjoint m.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L))) := by filter_upwards [eventually_candidate_P_pool_below_rough_cutoff hc, eventually_ambient_rough_interval_typeII_properties hγ] with L hpool hrough intro S a v m hm obtain ⟨hmem, hprimes⟩ := (hrough S a v m).2 hm refine ⟨?_, prime_factors_disjoint_of_rough hpool hprimes⟩ exact (mem_Icc.mp (mem_filter.mp hmem).1).1 theorem eventually_ambient_prime_endpoint_group_free {c : ℝ} (hc : 0 < c) (S : ℝ) (hS : 0 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ m : ℕ, ambientPrimeTypeIIAlpha κ L S m ≠ 0 → 0 < m ∧ Disjoint m.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L))) := by filter_upwards [eventually_candidate_P_pool_below_rough_cutoff hc, eventually_balanced_typeII_coefficient_properties S hS] with L hpool hprime intro κ hκ hκmax m hm obtain ⟨hmem, hprimes⟩ := (hprime κ hκ hκmax m).2.2.2 hm refine ⟨?_, prime_factors_disjoint_of_rough hpool hprimes⟩ exact (mem_Icc.mp (mem_filter.mp hmem).1).1 end Bounty end section /- Every original root summand with explicit small residues, capped big memory, and its exact return indicator. -/ open Finset open scoped Classical namespace Bounty theorem physical_finite_root_term_mixed_unrestricted {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (hV : ∀ g, 0 < V g) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ j : Fin (n + 1), ∀ g s, ¬ (((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc g s).val : ℤ) ∣ physicalPathSelectedMultiplier C k p j) (b : PhysicalPrime P → ℝ) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a ≠ 0) (B : ℕ) (hB : (physicalPrimeGroups P groups).card ≤ B) : (physicalStateMass V J ell : ℂ) * physicalFiniteReturnScalar V patterns C ζ k K n L p * (physicalFiniteVertexExpectation C q k n L p : ℂ) = (∏ a ∈ physicalPrimeGroups P groups, b a : ℝ) * ∑ r : PhysicalGroupResidues P groupsᶜ, (∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ)) * (if physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) (n + 1) = 0 then (((physicalStateMass (fun g : ↥groupsᶜ => V g.val) J ell * ∏ j ∈ range (n + 1), physicalCompletionMass (fun g : ↥groupsᶜ => V g.val) (fun g => C (finitePathLabels p j).2.2.1.val g.val) ell : ℝ) : ℂ) * physicalMemoryWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L p) (n + 1) * physicalGroupFiniteVertexWeight groupsᶜ C q k L p r * physicalGroupFiniteCappedHistory groups C q k (fun a => ((a.2.val : ℝ) * b a)⁻¹) V B L p) else 0) := by rw [physical_finite_root_term_partial_unrestricted groups V patterns C q ζ k K L p hV hP hdis hk b hb hb0] by_cases ho : physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) (n + 1) = 0 · simp only [if_pos ho] rw [← physical_group_residue_vertex_pool_expectation groupsᶜ hdis hP] rw [← physical_group_finite_path_capped_eq_run_product groups C k L p (fun j => 1 - physicalEndpointSchedule q (n + 1) j) (fun a => ((a.2.val : ℝ) * b a)⁻¹) V B hB] rw [physical_group_path_mass_restriction] simp only [physicalGroupFiniteVertexWeight, physicalGroupFiniteCappedHistory, Complex.ofReal_sum, Complex.ofReal_mul, mul_sum, sum_mul] apply sum_congr rfl intro r _ ring · simp only [if_neg ho, mul_zero, sum_const_zero] end Bounty end section /- Exact packing of each ghost/permutation/edge/permutation block. -/ namespace Bounty variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell : ℕ} def physicalBlockFineSteps (bs : List (V × K)) (last : V) : List (Option (V ⊕ K)) := bs.flatMap (fun b => [some (.inl b.1), none, some (.inr b.2), none]) ++ [some (.inl last)] abbrev PhysicalSmallBlockData (Ps : S → Finset ℕ) (J ell : ℕ) (I : Type) := I × PhysicalMarkLists Ps J ell × PhysicalPermutations S J ell × PhysicalPermutations S J ell def physicalSmallBlockPlanPack (last : V) : ∀ bs : List (V × K), (Fin bs.length → PhysicalSmallBlockData Ps J ell I) → PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) (physicalBlockFineSteps bs last) | [], _ => PUnit.unit | _ :: bs, d => ((d 0).2.2.1, (((d 0).1, physicalPermuteLabels (d 0).2.2.2 (d 0).2.1), (physicalInversePermutations (d 0).2.2.2, physicalSmallBlockPlanPack last bs (fun j => d j.succ)))) noncomputable def physicalSmallBlockPlanUnpack (last : V) : ∀ bs : List (V × K), PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) (physicalBlockFineSteps bs last) → (Fin bs.length → PhysicalSmallBlockData Ps J ell I) | [], _ => Fin.elim0 | _ :: bs, p => Fin.cons (p.2.1.1, physicalPermuteLabels p.2.2.1 p.2.1.2, p.1, physicalInversePermutations p.2.2.1) (physicalSmallBlockPlanUnpack last bs p.2.2.2) theorem physical_small_block_plan_unpack_pack (last : V) (bs : List (V × K)) (d : Fin bs.length → PhysicalSmallBlockData Ps J ell I) : physicalSmallBlockPlanUnpack last bs (physicalSmallBlockPlanPack last bs d) = d := by induction bs with | nil => funext j; exact Fin.elim0 j | cons b bs ih => funext j refine Fin.cases ?_ (fun i => ?_) j · simp only [physicalSmallBlockPlanUnpack, physicalSmallBlockPlanPack, Fin.cons_zero, physical_permute_inverse] rfl · exact congrFun (ih (d := fun j => d j.succ)) i theorem physical_small_block_plan_pack_unpack (last : V) (bs : List (V × K)) (p : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) (physicalBlockFineSteps bs last)) : physicalSmallBlockPlanPack last bs (physicalSmallBlockPlanUnpack last bs p) = p := by induction bs with | nil => change (PUnit.unit : PUnit) = p; exact Subsingleton.elim _ _ | cons b bs ih => rcases p with ⟨σ, ⟨i, R⟩, κ, p⟩ simp only [physicalSmallBlockPlanPack, physicalSmallBlockPlanUnpack, Fin.cons_zero, Fin.cons_succ, physical_permute_inverse] change (σ, ((i, R), (κ, physicalSmallBlockPlanPack last bs (physicalSmallBlockPlanUnpack last bs p)))) = _ exact congrArg (fun q => (σ, ((i, R), (κ, q)))) (ih p) noncomputable def physicalSmallBlockPlanEquiv (last : V) (bs : List (V × K)) : (Fin bs.length → PhysicalSmallBlockData Ps J ell I) ≃ PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) (physicalBlockFineSteps bs last) where toFun := physicalSmallBlockPlanPack last bs invFun := physicalSmallBlockPlanUnpack last bs left_inv := physical_small_block_plan_unpack_pack last bs right_inv := physical_small_block_plan_pack_unpack last bs end Bounty end section /- The original B0 off-diagonal energy with every dyadic geometry condition discharged. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- The high-rank tail of the actual original complex forest-masked path actions. -/ open Finset Classical namespace Bounty section Owner variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) [∀ k c, Fintype (A k c)] (Δ D : ∀ k c, A k c → Fin N → ℤ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (steps : List (Option (J ⊕ K))) end Owner end Bounty end section /- Exact finite dyadic reassembly for the original ambient bilinear discrepancies. -/ open Finset namespace Bounty theorem sum_typeIIRestrict_dyadic (M : Finset ℕ) (α : ℕ → ℝ) {n : ℕ} (hn : n ∈ M) : (∑ k ∈ dyadicNatIndices M, typeIIRestrict (dyadicNatBucket M k) α n) = α n := by classical have hidx : n.log2 ∈ dyadicNatIndices M := mem_image_of_mem Nat.log2 hn simp [typeIIRestrict,dyadicNatBucket,hn,hidx] theorem shifted_typeII_bilinear_eq_dyadic_restrictions (T : Finset ℕ) (μ α β : ℕ → ℝ) (H : ℕ) (hT : ∀ u ∈ T, 2*u+1 ≤ H) : shiftedTypeIIBilinear T μ α β = ∑ i ∈ dyadicNatIndices (Icc 1 H), ∑ j ∈ dyadicNatIndices (Icc 1 H), shiftedTypeIIBilinear T μ (typeIIRestrict (dyadicNatBucket (Icc 1 H) i) α) (typeIIRestrict (dyadicNatBucket (Icc 1 H) j) β) := by classical unfold shiftedTypeIIBilinear simp_rw [sum_comm (s := dyadicNatIndices (Icc 1 H)) (t := shiftedFactorPairs T)] apply sum_congr rfl intro v hv obtain ⟨hm,hn⟩ := shifted_factor_pairs_coordinate_bounds T H hT hv simp only [← mul_sum,← sum_mul] rw [sum_typeIIRestrict_dyadic _ _ hm,sum_typeIIRestrict_dyadic _ _ hn] end Bounty end section /- Mesh parameters chosen before logarithmic proxy precision. -/ open Finset Filter namespace Bounty theorem exists_candidate_positive_proxy_gap_uniform_precision (hZ : PrimitiveZeroFreeHalfPlane) {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11 / 5 : ℝ) * (r : ℝ) * c = 1) : ∃ κ qCut b : ℝ, ∃ h N : ℕ, ∃ M : Fin N → ℝ, 0 < κ ∧ κ ≤ 1 / 50 ∧ qCut = 1 / 2 - κ ∧ 0 < qCut ∧ qCut < 1 / 2 ∧ 0 < b ∧ b < qCut ∧ 1 ≤ h ∧ Even h ∧ b * (4 * (h : ℝ) + 2) < 1 / 2 ∧ 0 < N ∧ (∀ i : Fin N, reciprocalGrid b qCut N (i : ℕ) < reciprocalGrid b qCut N ((i : ℕ) + 1) ∧ 0 < M i ∧ ∀ α ∈ Set.Icc (reciprocalGrid b qCut N (i : ℕ)) (reciprocalGrid b qCut N ((i : ℕ) + 1)), buchstabDensity (reciprocalGrid b qCut N (i : ℕ)) (1 - α) ≤ M i) ∧ (∑ i : Fin N, M i * Real.log (reciprocalGrid b qCut N ((i : ℕ) + 1) / reciprocalGrid b qCut N (i : ℕ))) ≤ buchstabDensity b 1 - 1 + 1 / 16 ∧ ∃ J : ℕ, ∀ S : ℝ, 0 ≤ S → ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, ∀ (F : Fin N → Finset (ℕ × ℕ)) (u : Fin N → ℕ × ℕ → ℕ) (B : Finset (ℕ × ℕ)) (uB : ℕ × ℕ → ℕ), (∀ i, ∀ w ∈ F i, u i w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 ∈ primeBand (Real.exp (reciprocalGrid b qCut N (i : ℕ) * L)) (Real.exp (reciprocalGrid b qCut N ((i : ℕ) + 1) * L)) ∧ w.1 * w.2 = 2 * u i w + 1) → (∀ w ∈ B, balancedPairWindow κ L w ∧ uB w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 * w.2 = 2 * uB w + 1) → (shiftedSieveRatioConstant / 3) * candidateCoefficientWindowMass c L q r jStar / L ≤ candidateShiftedRoughMass c L q r jStar (Real.exp (b * L)) - (∑ i : Fin N, ∑ w ∈ F i, candidateCoefficient c L q r jStar (u i w) * roughTestLogarithmicProxy (reciprocalGrid b qCut N (i : ℕ)) L S w.2) - ∑ w ∈ B, candidateCoefficient c L q r jStar (uB w) * primeLogarithmicProxy L S w.1 * primeLogarithmicProxy L S w.2 := by obtain ⟨Kpre, hKpre, hpre⟩ := exists_candidate_shifted_rough_mass_density_lower hZ obtain ⟨Cbal, hCbal, Jbal, hbal⟩ := exists_candidate_balanced_logarithmic_prime_proxy_bound hc hr hq0 hq1 hcenter obtain ⟨κ, qCut, b, h, N, M, hκ, hκup, hqCut, hqCut0, hqCuthalf, hb, hbq, hh, heven, hlevel, hκloss, hN, hbins, hmesh, hmargin⟩ := exists_positive_buchstab_mesh_parameters Kpre Cbal hCbal.le have hstart (i : Fin N) : 0 < reciprocalGrid b qCut N (i : ℕ) := hb.trans_le (reciprocal_grid_mem hbq.le hN (Nat.le_of_lt i.isLt)).1 have hend (i : Fin N) : reciprocalGrid b qCut N ((i : ℕ) + 1) < 1 / 2 := (reciprocal_grid_mem hbq.le hN (Nat.succ_le_of_lt i.isLt)).2.trans_lt hqCuthalf have hgap (i : Fin N) : reciprocalGrid b qCut N ((i : ℕ) + 1) < 1 - reciprocalGrid b qCut N (i : ℕ) := by have hs := (reciprocal_grid_mem hbq.le hN (Nat.le_of_lt i.isLt)).2 have he := hend i linarith refine ⟨κ, qCut, b, h, N, M, hκ, hκup, hqCut, hqCut0, hqCuthalf, hb, hbq, hh, heven, hlevel, hN, hbins, hmesh, ?_⟩ obtain ⟨Junbal, hunbal⟩ := exists_candidate_unbalanced_rough_finite_bins_upper_uniform_precision hZ hc hr hq0 hq1 hcenter hstart hstart (fun i => (hbins i).1.le) hend hgap (fun i => (hbins i).2.1.le) (fun i => (hbins i).2.2) obtain ⟨Jpre, hprebound⟩ := hpre c q b r h hc hr hq0 hq1 hcenter hb hh heven hlevel refine ⟨max Jpre (max Junbal Jbal), ?_⟩ intro S hS jStar hj have hjpre : Jpre < jStar := lt_of_le_of_lt (le_max_left _ _) hj have hjunbal : Junbal < jStar := lt_of_le_of_lt ((le_max_left Junbal Jbal).trans (le_max_right Jpre _)) hj have hjbal : Jbal < jStar := lt_of_le_of_lt ((le_max_right Junbal Jbal).trans (le_max_right Jpre _)) hj have hd : 0 < shiftedSieveRatioConstant := lt_of_lt_of_le zero_lt_one shifted_sieve_ratio_constant_bounds.1 have hε : 0 < shiftedSieveRatioConstant / 24 := by positivity filter_upwards [hprebound jStar hjpre _ hε, hunbal S hS jStar hjunbal _ hε, hbal S hS, eventually_proxy_gap_reciprocal_bound (C := Cbal) hd] with L hpreL hunbalL hbalL htail intro F u B uB hF hB have hX : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro n hn exact candidate_coefficient_nonneg c L hq0 r jStar n have hu := hunbalL F u hF have hbL := hbalL κ hκ.le hκup jStar hjbal B uB (fun w hw => (hB w hw).1) (fun w hw => (hB w hw).2.2) have hm : shiftedSieveRatioConstant / 2 < (shiftedSieveRatioConstant * Mertens.primeProductLimitConstant / b) * (1 - Kpre * Real.exp (-(h : ℝ))) - shiftedSieveRatioConstant * (∑ i : Fin N, M i * Real.log (reciprocalGrid b qCut N ((i : ℕ) + 1) / reciprocalGrid b qCut N (i : ℕ))) - Cbal * κ := by convert hmargin using 1 ring exact candidate_proxy_gap_arithmetic hd htail.1 hX htail.2 hm hpreL hu hbL end Bounty end section /- The original real bilinear block equals its literal complex divisor test. -/ open Finset namespace Bounty theorem shifted_typeII_bilinear_complex_divisor_sum (T : Finset ℕ) (μ α β : ℕ → ℝ) : (shiftedTypeIIBilinear T μ α β : ℂ) = ∑ u ∈ T, (μ u : ℂ) * ∑ m ∈ (2*u+1).divisors, (α m : ℂ)*(β ((2*u+1)/m) : ℂ) := by rw [shifted_typeII_bilinear_complex_cast,sum_shifted_factor_pairs] apply sum_congr rfl intro u hu rw [mul_sum] apply sum_congr rfl intro m hm simp only [shifted_pair_index_of_dvd (Nat.mem_divisors.mp hm).1] ring end Bounty end section /- The literal mixed small edge weight is the original neutral bare small coefficient times the two residue factors at its actual translated endpoints. -/ open Finset open scoped Classical namespace Bounty section Weight variable {S G I V K : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (Vs : S → ℝ) (qedge : K → ℝ) end Weight end Bounty end section /- The original small and big candidate pools have a uniformly subexponential free factor. -/ open Filter Finset open scoped Classical namespace Bounty theorem eventually_candidate_free_factor_subexponential {c A ε : ℝ} (hc : 0 < c) (hA : 0 ≤ A) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type*) [Fintype G] (ι : G → candidatePIndices c L) (J : ℕ) (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels (fun g => candidatePBand (c*L) (ι g).val) C), (J*Fintype.card G : ℕ) ≤ A*Real.log L → (physicalFreeFactor C aux : ℝ) ≤ Real.exp (ε*L) := by obtain ⟨v, V, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool, eventually_physical_free_factor_subexponential hA (by norm_num : (2/5 : ℝ) < 1) hε] with L hp he intro G _ ι J C aux hslots exact he G (fun g => candidatePBand (c*L) (ι g).val) J C aux (fun g p hpg => ((hp.2.2.2.2.2 (ι g).val (ι g).property).2.2 p hpg).2.2) hslots end Bounty end section /- The original candidate endpoint ceiling scale has logarithm at most (4+epsilon)L. -/ open Filter Finset open scoped Classical namespace Bounty theorem eventually_candidate_harmonic_log_linear {c A ε : ℝ} (hc : 0 < c) (hA : 0 ≤ A) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type*) [Fintype G] (ι : G → candidatePIndices c L) (J : ℕ) (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels (fun g => candidatePBand (c*L) (ι g).val) C), (J*Fintype.card G : ℕ) ≤ A*Real.log L → ∀ Z : ℝ, 0 < Z → 1 ≤ Z*(physicalFreeFactor C aux : ℝ) → 3*Z < Real.exp (4*L) → Real.log (⌈3*Z*(physicalFreeFactor C aux : ℝ)⌉₊ : ℝ) ≤ (4+ε)*L := by obtain ⟨v, V, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool, eventually_physical_harmonic_log_linear hA (by norm_num : (2/5 : ℝ) < 1) hε] with L hp he intro G _ ι J C aux hslots Z hZ hprod hcut exact he G (fun g => candidatePBand (c*L) (ι g).val) J C aux (fun g p hpg => ((hp.2.2.2.2.2 (ι g).val (ι g).property).2.2 p hpg).1) (fun g p hpg => ((hp.2.2.2.2.2 (ι g).val (ι g).property).2.2 p hpg).2.2) hslots Z hZ hprod hcut end Bounty end section /- Polynomial bookkeeping for the two actual harmonic replacement errors. -/ namespace Bounty theorem harmonic_error_power_envelope {L M energy m C : ℝ} (hL : 0 < L) (hM0 : 0 ≤ M) (hM : M ≤ L^m) (he0 : 0 ≤ energy) (he : energy ≤ L^(31 : ℝ)) : M*M*(L^C*L^C*L^C)^2*energy ≤ L^(2*m+6*C+31) := by calc _ ≤ L^m*L^m*(L^C*L^C*L^C)^2*L^(31 : ℝ) := by gcongr _ = _ := by simp only [← Real.rpow_mul_natCast hL.le, ← Real.rpow_add hL] congr 1 ring theorem harmonic_free_error_power_envelope {L common H T E : ℝ} (hL : 2 ≤ L) (hc0 : 0 ≤ common) (hc : common ≤ L^T) (hH0 : 0 ≤ H) (hH : H ≤ L^E) : 2*common*H ≤ L^(T+E+1) := by have hL0 : 0 < L := by linarith calc _ ≤ L*L^T*L^E := by gcongr _ = _ := by nth_rw 1 [← Real.rpow_one L] rw [← Real.rpow_add hL0, ← Real.rpow_add hL0] congr 1 ring theorem harmonic_error_decay_absorb {L common T D : ℝ} (hL : 0 < L) (hc : common ≤ L^T) : common*L^(-(D+T+1)) ≤ L^(-D-1) := by calc _ ≤ L^T*L^(-(D+T+1)) := mul_le_mul_of_nonneg_right hc (Real.rpow_nonneg hL.le _) _ = _ := by rw [← Real.rpow_add hL]; congr 1; ring theorem harmonic_two_errors_absorb {L D : ℝ} (hL : 2 ≤ L) : L^(-D-1)+L^(-D-1) ≤ L^(-D) := by have hL0 : 0 < L := by linarith calc _ = 2*L^(-D-1) := by ring _ ≤ L*L^(-D-1) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = _ := by nth_rw 1 [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 ring end Bounty end section /- Exact recovery of any cumulative-offset weight on the original signed path. The zero branch includes incoherent paths without extra assumptions. -/ open scoped Classical namespace Bounty section Original variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Original end Bounty end section /- The exact original unrestricted harmonic main term as a selected endpoint pairing. -/ open Finset open scoped Classical namespace Bounty end Bounty end section /- Original determinant shifts are uniformly small relative to the original harmonic dyadic scale. -/ open Finset Filter Real namespace Bounty theorem eventually_typeII_determinant_le_half_exp {b K : ℝ} (hb : 0 < b) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, (typeIIAdmissibleDeterminantBound L K : ℝ) ≤ exp (b*L)/2 := by have hgrowth := eventually_mul_rpow_log_add_le_rpow (a := (0 : ℝ)) (b := (1 : ℝ)) (c := b) (by norm_num) (by norm_num) hb (K+88) (log 6) filter_upwards [hgrowth,eventually_ge_atTop (1 : ℝ)] with L hg hL have hL0 : 0 < L := zero_lt_one.trans_le hL simp only [rpow_zero,rpow_one,mul_one] at hg have hlog : log (6*L^(K+88)) ≤ b*L := by rw [log_mul (by norm_num) (by positivity),log_rpow hL0] linarith have hexp : 6*L^(K+88) ≤ exp (b*L) := by calc _ = exp (log (6*L^(K+88))) := (exp_log (by positivity)).symm _ ≤ _ := exp_le_exp.mpr hlog have hdet := determinant_bound_le_three_rpow_public hL hK linarith theorem eventually_typeII_original_harmonic_shift_small {b K : ℝ} (hb : 0 < b) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ U V : ℝ, exp (b*L) ≤ U → U ≤ exp L → exp (b*L) ≤ V → V ≤ exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), |(k : ℝ)| ≤ typeIISmoothDyadicScale U V (U*L^(-K)) j/4 := by filter_upwards [eventually_typeII_determinant_le_half_exp hb hK, eventually_typeII_harmonic_scale_lower hb hK] with L hdet hscale intro U V hUlo _hUhi hVlo _hVhi k hk j _hj have hk' : |(k : ℝ)| ≤ (typeIIAdmissibleDeterminantBound L K : ℝ) := by apply abs_le.mpr obtain ⟨hklo,hkhi⟩ := mem_Icc.mp hk constructor · exact_mod_cast hklo · exact_mod_cast hkhi have hZ := hscale U V hUlo hVlo j linarith end Bounty end section /- Global bounds and common support for the expanded Mellin source and phased target. -/ namespace Bounty theorem harmonic_common_cutoff_scaled_zero_of_not_mem {Y x : ℝ} (hY : 0 < Y) (hx : x ∉ Set.Icc (Y / 8) (4 * Real.exp 2 * Y)) : harmonicCommonCutoff (x / Y) = 0 := by by_contra hne have hs := harmonic_common_cutoff_scaled_support hY hne exact hx ⟨hs.1.le, hs.2.le⟩ theorem harmonic_common_phased_target_zero_of_not_mem {Y : ℝ} (hY : 0 < Y) (b : ℝ) (G : ℤ → ℂ) (n : ℤ) (hn : (n : ℝ) ∉ Set.Icc (Y / 8) (4 * Real.exp 2 * Y)) : physicalPhase b n.natAbs * ((harmonicCommonCutoff ((n : ℝ) / Y) : ℂ) * G n) = 0 := by rw [harmonic_common_cutoff_scaled_zero_of_not_mem hY hn] simp only [Complex.ofReal_zero, zero_mul, mul_zero] end Bounty end section /- Exact common-window Mellin separation with auxiliary-independent endpoint functions. -/ open Finset MeasureTheory namespace Bounty noncomputable def harmonicCellSource (Y Z a v : ℝ) (F : ℤ → ℂ) (n : ℤ) : ℂ := physicalMellinSource Y Z v (fun m => physicalPhase (-a) m.natAbs * ((harmonicCommonCutoff ((m : ℝ)/Y) : ℂ)*F m)) n noncomputable def harmonicCellTarget (Y b : ℝ) (G : ℤ → ℂ) (n : ℤ) : ℂ := physicalPhase b n.natAbs*((harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)*G n) noncomputable def harmonicCellPairing (Y Z a b v : ℝ) (δ : ℤ) (F G : ℤ → ℂ) : ℂ := ∑ n ∈ harmonicCommonSupport Y, star (harmonicCellSource Y Z a v F n)* harmonicCellTarget Y b G (n+δ) theorem harmonic_cell_sum_eq_mellin {Z H : ℝ} (hZ : 0 < Z) (hH : 0 < H) {d : ℕ} (hHd : H ≤ (d : ℝ)) (hdH : (d : ℝ) ≤ Real.exp 2*H) {k : ℤ} (hk : |(k : ℝ)| ≤ Z/4) (a b : ℝ) (F G : ℤ → ℂ) : physicalPhase (-(a+b)) d * (∑ n ∈ harmonicPositiveSupport Z k d, ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)/(n : ℂ))* physicalPhase a n.natAbs*physicalPhase b (n+k*(d : ℤ)).natAbs* star (F n)*G (n+k*(d : ℤ))) = ((Z*H : ℝ) : ℂ)⁻¹ * ∫ v : ℝ, harmonicLogFourier v*physicalPhase (-(a+b+2*Real.pi*v)) d* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d : ℤ)) F G := by let Y := Z*H let T := harmonicCommonSupport Y let δ : ℤ := k*(d : ℤ) let Fc := fun n : ℤ => (harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)*F n let Gc := fun n : ℤ => (harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)*G n let c := fun n : ℤ => physicalPhase (-(a+b)) d * ((n : ℂ)⁻¹*physicalPhase a n.natAbs*physicalPhase b (n+δ).natAbs*star (Fc n)*Gc (n+δ)) have hY : 0 < Y := mul_pos hZ hH have hdr : (0 : ℝ) < d := hH.trans_le hHd have hd : 0 < d := by exact_mod_cast hdr have hTpos : ∀ n ∈ T, 0 < n := fun n hn => harmonic_common_support_positive hY hn have hleft : physicalPhase (-(a+b)) d * (∑ n ∈ harmonicPositiveSupport Z k d, ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)/(n : ℂ))* physicalPhase a n.natAbs*physicalPhase b (n+δ).natAbs*star (F n)*G (n+δ)) = ∑ n ∈ T, c n*(typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ) := by rw [mul_sum] trans ∑ n ∈ harmonicPositiveSupport Z k d, (typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)*c n · apply sum_congr rfl intro n hn by_cases hψ : typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) = 0 · simp only [hψ, Complex.ofReal_zero, zero_div, zero_mul, mul_zero] · have hw := harmonic_common_window_of_scale hZ hH hHd hdH hk hψ have hχn := harmonic_common_cutoff_scaled_eq_one hY ⟨hw.1.1.le, hw.1.2.le⟩ have hχz := harmonic_common_cutoff_scaled_eq_one hY ⟨hw.2.1.le, hw.2.2.le⟩ dsimp only [c, Fc, Gc] rw [hχn, hχz] simp only [Complex.ofReal_one, one_mul] ring · rw [harmonic_sum_common_support hZ hH hHd hdH hk c] apply sum_congr rfl intro n _ exact mul_comm _ _ have he := finite_mellin_sum_representation T harmonicLogFourier (fun v => 2*Real.pi*v) harmonic_log_fourier_integrable (by fun_prop) c (fun n => (n : ℝ)/(Z*(d : ℝ))) (fun t => (typeIIHarmonicDyadic t : ℂ)) (by intro n hn _ apply harmonic_dyadic_mellin_representation exact div_pos (by exact_mod_cast hTpos n hn) (mul_pos hZ hdr)) rw [hleft, he, ← integral_const_mul] apply integral_congr_ae filter_upwards [] with v dsimp only [harmonicCellPairing] rw [mul_sum, mul_sum, mul_sum] apply sum_congr rfl intro n hn have hp := physical_mellin_phased_edge_normalized Y Z a b (2*Real.pi*v) d n (n+δ) Fc Gc hY.ne' hZ.ne' hd.ne' (hTpos n hn).ne' dsimp only [harmonicCellSource, harmonicCellTarget, c] dsimp only [Fc, Gc] at hp calc _ = harmonicLogFourier v * (physicalPhase (-(a+b)) d*physicalMellinPhase (2*Real.pi*v) ((n : ℝ)/(Z*(d : ℝ)))* ((n : ℂ)⁻¹*physicalPhase a n.natAbs*physicalPhase b (n+δ).natAbs* star (Fc n)*Gc (n+δ))) := by ring _ = _ := by rw [← hp]; ring end Bounty end section /- Every supported product dyad of a nonempty actual probe subset is large. -/ open Finset Filter open scoped Classical namespace Bounty theorem supported_dyad_log_product {L : ℝ} {U W : ℕ} (hL : 2 ≤ L) (hU : 0 < U) (hW : 0 < W) (hlogU : Real.log (U : ℝ) ≤ L) (hlogW : Real.log (W : ℝ) ≤ L) : Real.log ((U : ℝ)*W) ≤ L^(2 : ℝ) := by rw [Real.log_mul (by exact_mod_cast Nat.ne_of_gt hU) (by exact_mod_cast Nat.ne_of_gt hW), Real.rpow_two] nlinarith end Bounty end section /- The original signed full-path moment retains an arbitrary complete selected weight. -/ open Finset Classical namespace Bounty section Weighted variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) [Fintype (PhysicalSelectedData P ell C)] (w : PhysicalSelectedData P ell C → ℂ) noncomputable def physicalOriginalWeightedMoment (f : PhysicalFullBoundedState P J ell B → ℂ) (x : PhysicalFullBoundedState P J ell B) : ℂ := let sizes := fun g (p : ↥(P g)) => p.val let S := fun j g => physicalFullSharedIndices (ell := ell) (C j g) let A := fun j (_ : SharedActiveLabels (fun g => ↥(P g)) (S j)) => PhysicalAuxLabels P (C j) let Δ := fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j) let D := fun j => physicalFullEdgeD (ell := ell) (C j) let steps := (List.range (4 * n + 1)).map (physicalSelectedFineTag n) let _ := fullPermutationMixedEventFintype (J := Fin (n + 1)) sizes S B A Δ D let _ := finiteEventPathFintype (FullPermutationMixedEvent sizes S B A Δ D) (fullPermutationMixedEventTarget sizes S B A Δ D) steps x ∑ p : FullPermutationMixedPath sizes S B A Δ D steps x, (physicalOriginalFineWeight C k ω β q ρ V x p * physicalSelectedDataRecordPhase C cut univ w (physicalOriginalFineRecord C k cut x p)) * f (finiteEventPathTerminal (FullPermutationMixedEvent sizes S B A Δ D) (fullPermutationMixedEventTarget sizes S B A Δ D) steps x p) end Weighted end Bounty end section /- Truncation of the independent source-cutoff frequency on a full four-factor box. -/ open Finset MeasureTheory Filter namespace Bounty end Bounty end section /- Source-frequency tails with the exact harmonic normalization on every coordinate. -/ open Finset MeasureTheory Filter namespace Bounty noncomputable def harmonicNormalizedFourBoxError (Y s R : ℝ) (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) : ℂ := (∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ c ∈ C, (δ d * α a * β b * γ c) * ((harmonicCommonCutoff (((d*a*b*c : ℕ) : ℝ) / Y) / ((d*a*b*c : ℕ) : ℝ) : ℝ) : ℂ) * physicalMellinPhase s ((d*a*b*c : ℕ) : ℝ)) - ∫ u in {u : ℝ | ‖u‖ ≤ R}, harmonicWindowLogFourier u * physicalMellinPhase (-2 * Real.pi * u) Y * ((∑ d ∈ D, δ d * harmonicMellinWeight (s + 2 * Real.pi * u) d) * (∑ a ∈ A, α a * harmonicMellinWeight (s + 2 * Real.pi * u) a) * (∑ b ∈ B, β b * harmonicMellinWeight (s + 2 * Real.pi * u) b) * (∑ c ∈ C, γ c * harmonicMellinWeight (s + 2 * Real.pi * u) c)) end Bounty end section /- The original birth and freshness phase is an explicit deterministic history phase. -/ open scoped Classical namespace Bounty section History variable {I K : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def physicalFullHistoryPhase (steps : List (Option (I ⊕ K))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps x) : ℂ := deterministicLedgerPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullMixedLedgerUpdate (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fun tag H x e => physicalFullLedgerEventPhase C k ω β ρ V tag (H, x) e) steps (fullActiveInitialLedger x) x p theorem physical_full_history_phase_eq_induced (steps : List (Option (I ⊕ K))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps x) : physicalFullHistoryPhase C k ω β ρ V steps x p = fullMixedLedgerInducedPhase (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps fullActiveInitialLedger (finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventPhase C k ω β ρ V) steps) x p := deterministic_ledger_phase_eq_lifted _ _ _ _ steps (fullActiveInitialLedger x) x p end History end Bounty end section /- The original nonzero ambient interval factors have unit caps and small-modulus coprimality. -/ open Finset Filter namespace Bounty private theorem restricted_interval_rough_properties (L : ℝ) (lo hi : ℕ) (f : ℕ → ℝ) {q : ℕ} (hq : 0 < q) (hqW : (q : ℝ) ≤ Real.exp (Real.sqrt L)) (hf : ∀ n, |f n| ≤ 1) (hrough : ∀ n, f n ≠ 0 → ∀ p ∈ n.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)) : (∀ n, ‖(typeIIRestrict (Ioc lo hi) f n : ℂ)‖ ≤ 1) ∧ ∀ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) f n : ℂ) ≠ 0), 0 < n ∧ n.Coprime q := by constructor · intro n simpa only [Complex.norm_real,Real.norm_eq_abs] using typeIIRestrict_abs_le zero_le_one (fun n _ => hf n) n · intro n hn obtain ⟨hnI,hnz⟩ := mem_filter.mp hn have hn0 : 0 < n := (Nat.zero_le lo).trans_lt (mem_Ioc.mp hnI).1 have hnR : typeIIRestrict (Ioc lo hi) f n ≠ 0 := by intro hz exact hnz (by rw [hz]; rfl) have hfn := ((typeIIRestrict_ne_zero_iff _ _ _).mp hnR).2 have hqZ : (q : ℤ) ≠ 0 := by exact_mod_cast hq.ne' have hsmall : (((q : ℤ).natAbs) : ℝ) ≤ Real.exp (Real.sqrt L) := by simpa only [Int.natAbs_natCast] using hqW exact ⟨hn0, by simpa only [Int.natAbs_natCast] using typeII_rough_coprime_natAbs hn0 hqZ (hrough n hfn) hsmall⟩ theorem eventually_rational_prime_M_properties (S Rmod : ℝ) (hS : 0 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ lo hi qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → (∀ n, ‖(typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κ L S) n : ℂ)‖ ≤ 1) ∧ ∀ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κ L S) n : ℂ) ≠ 0), 0 < n ∧ n.Coprime qRat := by filter_upwards [eventually_balanced_typeII_coefficient_properties S hS, eventually_rpow_le_exp_sqrt Rmod] with L hL hmod intro κ hκ hκmax lo hi qRat hq hqR exact restricted_interval_rough_properties L lo hi _ hq (hqR.trans hmod) (fun n => (hL κ hκ hκmax n).1) (fun n hn => ((hL κ hκ hκmax n).2.2.2 hn).2) theorem eventually_rational_rough_M_properties {γ : ℝ} (hγ : 0 < γ) (Rmod : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ S a v : ℝ, ∀ lo hi qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → (∀ n, ‖(typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γ L S a v) n : ℂ)‖ ≤ 1) ∧ ∀ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γ L S a v) n : ℂ) ≠ 0), 0 < n ∧ n.Coprime qRat := by filter_upwards [eventually_ambient_rough_interval_typeII_properties hγ, eventually_rpow_le_exp_sqrt Rmod] with L hL hmod intro S a v lo hi qRat hq hqR exact restricted_interval_rough_properties L lo hi _ hq (hqR.trans hmod) (fun n => (hL S a v n).1) (fun n hn => ((hL S a v n).2 hn).2) end Bounty end section /- The explicit retained-cell cost for the original candidate probe subsets. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- Normalized selected histories satisfy the scalar bound in the original absolute-residue formulation. -/ open Finset namespace Bounty section Energy variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) end Energy end Bounty end section /- The actual root residue model as a sum over indexed patterns and supported selected paths. -/ open Finset open scoped Classical namespace Bounty section Normalization variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (b : PhysicalPrime P → ℝ) (hb : ∀ a, b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a, b a ≠ 0) include hP hdis hk hb hb0 end Normalization end Bounty end section /- Fourier projection leaves only local phases in the unrestricted memory sum. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Fourier variable {I : Type*} {N J ell : ℕ} {P : Fin N → Finset ℕ} (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) noncomputable def physicalMemoryFourierWalkScalar (θ : ℝ) : ℂ := ∏ j ∈ range edges, physicalMemoryLabeledScalar V patterns C (ζ (edges - 1 - j)) (K (edges - 1 - j)) (a j) (L j) (L (j + 1)) * physicalReturnPhase θ (physicalBareStep C (k (edges - 1 - j)) (a j) (L j)) theorem physical_memory_fourier_walk_scalar_eq (θ : ℝ) : physicalMemoryFourierWalkScalar V patterns C ζ k K a L edges θ = physicalMemoryWalkScalar V patterns C ζ K a L edges * physicalReturnPhase θ (physicalBareOffset C k a L edges edges) := by simp only [physicalMemoryFourierWalkScalar, prod_mul_distrib, physicalMemoryWalkScalar, physical_bare_offset_phase_eq_prod] theorem physical_memory_fourier_walk_scalar_continuous : Continuous (physicalMemoryFourierWalkScalar V patterns C ζ k K a L edges) := by simp_rw [show physicalMemoryFourierWalkScalar V patterns C ζ k K a L edges = (fun θ => physicalMemoryWalkScalar V patterns C ζ K a L edges * physicalReturnPhase θ (physicalBareOffset C k a L edges edges)) from funext (physical_memory_fourier_walk_scalar_eq V patterns C ζ k K a L edges)] exact continuous_const.mul (physicalReturnPhase_continuous _) theorem physical_memory_fourier_return_integral (R : ℂ) : (∫ θ : ℝ in (0 : ℝ)..1, physicalMemoryFourierWalkScalar V patterns C ζ k K a L edges θ * R) = if physicalBareOffset C k a L edges edges = 0 then physicalMemoryWalkScalar V patterns C ζ K a L edges * R else 0 := by simp_rw [physical_memory_fourier_walk_scalar_eq] rw [intervalIntegral.integral_mul_const, intervalIntegral.integral_const_mul, physicalReturnPhase_integral] split_ifs <;> simp end Fourier end Bounty end section /- The chronological coefficient record is exactly the original local event-phase product. -/ open Finset open scoped Classical namespace Bounty section Locality variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) theorem physical_record_coefficient_local_phase (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (p : FiniteEventPath (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (List.range (4 * n + 1)) s) : physicalRecordCoefficient C cut ζ K (finiteEventPathObservations (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (List.range (4 * n + 1)) s p) = finiteEventLocalPhase (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (fun i => physicalLocalCoefficientPhase C k cut ζ K (physicalSelectedFineTag n i)) (List.range (4 * n + 1)) s p := by let E := fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let target := fun i => physicalFullLedgerEventTarget (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let observe := physicalFullTraceObservation (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n) cut let r := finiteEventPathObservations E target observe (List.range (4 * n + 1)) s p let occ := finiteScheduleOccurrence E target (4 * n + 1) s p rw [finite_schedule_local_phase_product, four_step_sparse_product _ _ (fun i hi => physical_local_coefficient_nonedge C k cut ζ K i.val hi _ _)] unfold physicalRecordCoefficient apply prod_congr rfl intro j _ have hlen : r.length = 4 * n + 1 := by simp only [r, finite_event_path_observations_length, List.length_range] have h1 : 4 * j.val + 1 < r.length := by omega have h2 : 4 * j.val + 2 < r.length := by omega change (match r[4 * j.val + 1]?, r[4 * j.val + 2]? with | some a, some b => physicalObservedCoefficient C cut ζ K j b.2.1 (fun g => (a.2.2.2 g).1) (fun g => (b.2.2.2 g).1) | _, _ => 0) = _ rw [List.getElem?_eq_getElem h1, List.getElem?_eq_getElem h2] change physicalObservedCoefficient C cut ζ K j (r.get ⟨_, h2⟩).2.1 (fun g => ((r.get ⟨_, h1⟩).2.2.2 g).1) (fun g => ((r.get ⟨_, h2⟩).2.2.2 g).1) = _ rw [finite_schedule_observations_get E target observe _ s p ⟨_, by omega⟩, finite_schedule_observations_get E target observe _ s p ⟨_, by omega⟩] change physicalObservedCoefficient C cut ζ K j (physicalFullEventObservation C k (cut (4 * j.val + 2)) (cut (4 * j.val + 2 + 1)) (physicalSelectedFineTag n (4 * j.val + 2)) (occ ⟨4 * j.val + 2, by omega⟩).1 (occ ⟨4 * j.val + 2, by omega⟩).2) (fun g => ((target (4 * j.val + 1) (occ ⟨4 * j.val + 1, by omega⟩).1 (occ ⟨4 * j.val + 1, by omega⟩).2).2 g).1) (fun g => ((target (4 * j.val + 2) (occ ⟨4 * j.val + 2, by omega⟩).1 (occ ⟨4 * j.val + 2, by omega⟩).2).2 g).1) = _ have hs := finite_schedule_source_after E target (4 * n + 1) s p (4 * j.val + 1) (by omega) change (occ ⟨4 * j.val + 2, by omega⟩).1 = target (4 * j.val + 1) (occ ⟨4 * j.val + 1, by omega⟩).1 (occ ⟨4 * j.val + 1, by omega⟩).2 at hs rw [← hs] exact (physical_local_coefficient_edge_observation C k cut ζ K j _ _ _ (physical_fine_tag_edge j) _ _).symm end Locality end Bounty end section /- The precise remaining ambient weighted replacement statement and its prime-mass consequence. -/ open Finset Filter namespace Bounty /- This is an explicit analytic hypothesis, not an assertion that replacement has been proved. -/ def CandidateAmbientReplacement : Prop := ∀ (c q : ℝ) (r : ℕ), 0 shared key.2.1 let Ab := fun (key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)) (_ : SharedActiveLabels P (C key)) => A key.2.1 let Δb := fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a let Db := fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a finiteEventPathTerminal (FullPermutationMixedEvent n C B Ab Δb Db) (fullPermutationMixedEventTarget n C B Ab Δb Db) (physicalMixedBigSteps ks L pl) x p theorem physical_mixed_planned_big_terminal (ks : List (Option (V ⊕ K))) r L (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) x (p : PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) : (finiteEventPathTerminal (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) ks ((r, L), x) (physicalMixedPathPack n shared B A Δ D kbig ks r L x ⟨pl, p⟩)).2 = physicalMixedPlannedBigTerminal n shared B A Δ D ks L pl x p := by induction ks generalizing r L x with | nil => rfl | cons tag ks ih => cases tag with | none => rcases pl with ⟨σ, pl⟩ rcases p with ⟨⟨τ⟩, p⟩ exact ih _ _ _ _ _ | some tag => cases tag with | inl j => rcases p with ⟨⟨e⟩, p⟩ exact ih _ _ _ _ _ | inr k => rcases pl with ⟨⟨i, R⟩, pl⟩ rcases p with ⟨⟨a, e⟩, p⟩ exact ih _ _ _ _ _ end Terminal end Bounty end section /- Exact separation of original big path weights from small scalar factors. -/ open Finset open scoped Classical namespace Bounty section Weights variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) noncomputable def physicalMixedPlannedBigWeight (ks : List (Option (V ⊕ K))) L (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) x (p : PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) : ℝ := let C := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1 let Ab := fun (key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)) (_ : SharedActiveLabels P (C key)) => A key.2.1 let Δb := fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a let Db := fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a finiteEventPathWeight (FullPermutationMixedEvent n C B Ab Δb Db) (fullPermutationMixedEventTarget n C B Ab Δb Db) (fullPermutationMixedEventWeight n C B Ab Δb Db (fun key => ω key.2.1) μ qghost ρ Vb) (physicalMixedBigSteps ks L pl) x p noncomputable def physicalMixedPlanSmallFactor (ks : List (Option (V ⊕ K))) (r : PhysicalResidues Ps) L (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) x (p : PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) : ℝ := finiteEventPathWeight (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedSmallWeight n shared B A Δ D kbig Vs qedge) ks ((r, L), x) (physicalMixedPathPack n shared B A Δ D kbig ks r L x ⟨pl, p⟩) theorem physical_mixed_planned_weight_factor (ks : List (Option (V ⊕ K))) r L (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) x (p : PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) : finiteEventPathWeight (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge) ks ((r, L), x) (physicalMixedPathPack n shared B A Δ D kbig ks r L x ⟨pl, p⟩) = physicalMixedPlanSmallFactor n shared B A Δ D kbig Vs qedge ks r L pl x p * physicalMixedPlannedBigWeight n shared B A Δ D ω μ qghost ρ Vb ks L pl x p := by induction ks generalizing r L x with | nil => simp only [physicalMixedPlanSmallFactor, physicalMixedPlannedBigWeight, physicalMixedBigSteps, finiteEventPathWeight, mul_one] | cons tag ks ih => cases tag with | none => rcases pl with ⟨σ, pl⟩ rcases p with ⟨⟨τ⟩, p⟩ simp only [physicalMixedPlanSmallFactor, physicalMixedPlannedBigWeight, physicalMixedPathPack, physicalMixedBigSteps, finiteEventPathWeight, physicalMixedWordWeight, physicalMixedSmallWeight, fullPermutationMixedEventWeight] at ih ⊢ erw [ih] ring_nf rfl | some tag => cases tag with | inl j => rcases p with ⟨⟨e⟩, p⟩ simp only [physicalMixedPlanSmallFactor, physicalMixedPlannedBigWeight, physicalMixedPathPack, physicalMixedBigSteps, finiteEventPathWeight, physicalMixedWordWeight, physicalMixedSmallWeight, fullPermutationMixedEventWeight, fullMixedMemoryEventWeight] at ih ⊢ erw [ih] ring_nf rfl | inr k => rcases pl with ⟨⟨i, R⟩, pl⟩ rcases p with ⟨⟨a, e⟩, p⟩ simp only [physicalMixedPlanSmallFactor, physicalMixedPlannedBigWeight, physicalMixedPathPack, physicalMixedBigSteps, finiteEventPathWeight, fullPermutationMixedEventWeight, fullMixedMemoryEventWeight] at ih ⊢ rw [physical_mixed_word_edge_weight_factor] erw [ih] dsimp only [physicalMixedWordTarget, physicalSmallBigTarget, physicalSmallBigFullTarget, fullPermutationMixedEventTarget, fullMixedMemoryEventTarget, fullActiveFixedAuxEvent, fullActiveEdgeEventTarget] ring end Weights end Bounty end section /- The actual normalized candidate residual produces the two invariant endpoints. -/ open Finset open scoped ComplexConjugate namespace Bounty end Bounty end section /- The original root model over all finite paths, with the small-residue average appearing once. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_residue_model_mixed_unrestricted {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (hV : ∀ g, 0 < V g) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (b : PhysicalPrime P → ℝ) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a ≠ 0) (B : ℕ) (hB : (physicalPrimeGroups P groups).card ≤ B) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance physicalRootResidueModel V patterns C q ζ k K n = (∏ a ∈ physicalPrimeGroups P groups, b a : ℝ) * ∑ r : PhysicalGroupResidues P groupsᶜ, (∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ)) * ∑ L : PhysicalMarkLists P J ell, ∑ p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, (if physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) (n + 1) = 0 then (((physicalStateMass (fun g : ↥groupsᶜ => V g.val) J ell * ∏ j ∈ range (n + 1), physicalCompletionMass (fun g : ↥groupsᶜ => V g.val) (fun g => C (finitePathLabels p j).2.2.1.val g.val) ell : ℝ) : ℂ) * physicalMemoryWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L p) (n + 1) * physicalGroupFiniteVertexWeight groupsᶜ C q k L p r * physicalGroupFiniteCappedHistory groups C q k (fun a => ((a.2.val : ℝ) * b a)⁻¹) V B L p) else 0) := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance unfold physicalRootResidueModel simp only [mul_sum] trans ∑ L : PhysicalMarkLists P J ell, ∑ p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, (∏ a ∈ physicalPrimeGroups P groups, b a : ℝ) * ∑ r : PhysicalGroupResidues P groupsᶜ, (∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ)) * (if physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (n + 1) (n + 1) = 0 then (((physicalStateMass (fun g : ↥groupsᶜ => V g.val) J ell * ∏ j ∈ range (n + 1), physicalCompletionMass (fun g : ↥groupsᶜ => V g.val) (fun g => C (finitePathLabels p j).2.2.1.val g.val) ell : ℝ) : ℂ) * physicalMemoryWalkScalar V patterns C ζ K (finitePathLabels p) (finitePathMarks L p) (n + 1) * physicalGroupFiniteVertexWeight groupsᶜ C q k L p r * physicalGroupFiniteCappedHistory groups C q k (fun a => ((a.2.val : ℝ) * b a)⁻¹) V B L p) else 0) · apply sum_congr rfl intro L _ apply sum_congr rfl intro p _ have hkp : ∀ j : Fin (n + 1), ∀ g s, ¬ (((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc g s).val : ℤ) ∣ physicalPathSelectedMultiplier C k p j := by intro j g s exact hk (n - j.val) (by omega) (p j).1.2.2.1.val (p j).1.2.2.1.property g _ ((physicalPathSelectedEquiv patterns C (L, p)).2.2.1 j.castSucc g s).property simpa only [mul_assoc] using physical_finite_root_term_mixed_unrestricted groups V patterns C q ζ k K L p hV hP hdis hkp b hb hb0 B hB · simp only [mul_sum] conv_lhs => arg 2 ext L rw [sum_comm] rw [sum_comm] end Bounty end section /- Selected arrays and initial marks are the exact coordinates of small plans. -/ namespace Bounty variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell n : ℕ} abbrev PhysicalSmallSelectedArrays (Ps : S → Finset ℕ) (J ell n : ℕ) (I : Type) := (Fin n → I) × (Fin (n + 1) → PhysicalMarkLists Ps J ell) × (Fin n → PhysicalPermutations S J ell) × (Fin n → PhysicalPermutations S J ell) def physicalSmallSelectedBlockEquiv : PhysicalSmallSelectedArrays Ps J ell n I ≃ PhysicalMarkLists Ps J ell × (Fin n → PhysicalSmallBlockData Ps J ell I) where toFun d := (d.2.1 0, fun j => (d.1 j, d.2.1 j.succ, d.2.2.1 j, d.2.2.2 j)) invFun p := ((fun j => (p.2 j).1), Fin.cons p.1 (fun j => (p.2 j).2.1), (fun j => (p.2 j).2.2.1), (fun j => (p.2 j).2.2.2)) left_inv := by rintro ⟨i, L, σ, τ⟩ have hL : Fin.cons (L 0) (fun j => L j.succ) = L := by funext j exact Fin.cases rfl (fun _ => rfl) j exact congrArg (fun L' => (i, L', σ, τ)) hL right_inv := by rintro ⟨L, d⟩ apply Prod.ext rfl funext j rfl noncomputable def physicalSmallSelectedBlockPlanEquiv (last : V) (bs : List (V × K)) : PhysicalSmallSelectedArrays Ps J ell bs.length I ≃ PhysicalMarkLists Ps J ell × PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) (physicalBlockFineSteps bs last) := physicalSmallSelectedBlockEquiv.trans (Equiv.prodCongr (Equiv.refl _) (physicalSmallBlockPlanEquiv last bs)) abbrev PhysicalSmallSelectedChoices (Ps : S → Finset ℕ) (ell n : ℕ) (C : I → S → Finset (Fin J)) := Σ i : Fin n → I, PhysicalGroupSelectedData Ps ell (fun j => C (i j)) def physicalEmptyAuxLabels (C : S → Finset (Fin J)) (hC : ∀ g, C g = ∅) : PhysicalAuxLabels Ps C := fun g s => False.elim (by simpa only [hC g, Finset.notMem_empty] using s.property) def physicalSmallSelectedArraysEquiv (C : I → S → Finset (Fin J)) (hC : ∀ i g, C i g = ∅) : PhysicalSmallSelectedChoices Ps ell n C ≃ PhysicalSmallSelectedArrays Ps J ell n I where toFun d := (d.1, d.2.2.1, d.2.2.2.1, d.2.2.2.2) invFun d := ⟨d.1, (fun j => physicalEmptyAuxLabels (C (d.1 j)) (hC (d.1 j))), d.2.1, d.2.2.1, d.2.2.2⟩ left_inv := by rintro ⟨i, a, L, σ, τ⟩ have ha : (fun j => physicalEmptyAuxLabels (Ps := Ps) (C (i j)) (hC (i j))) = a := by funext j g s exact False.elim (by simpa only [hC (i j) g, Finset.notMem_empty] using s.property) exact congrArg (fun a' => (⟨i, a', L, σ, τ⟩ : PhysicalSmallSelectedChoices Ps ell n C)) ha right_inv := by rintro ⟨i, L, σ, τ⟩; rfl end Bounty end section /- The actual selected fine schedule consists of the original indexed blocks. -/ namespace Bounty theorem physical_selected_fine_block_schedule (n : ℕ) : (List.range (4 * n + 1)).map (physicalSelectedFineTag n) = physicalBlockFineSteps (List.ofFn (fun j : Fin n => (j.castSucc, j))) (Fin.last n) := by have hmap : (List.range (4 * n + 1)).map (physicalSelectedFineTag n) = List.ofFn (fun j : Fin (4 * n + 1) => physicalSelectedFineTag n j.val) := by simpa using (List.ofFn_getElem_eq_map (List.range (4 * n + 1)) (physicalSelectedFineTag n)).symm rw [hmap, List.ofFn_succ', List.concat_eq_append] have hend : physicalSelectedFineTag n (4 * n) = some (.inl (Fin.last n)) := physical_fine_tag_visit (Fin.last n) simp only [Fin.val_last, hend] rw [List.ofFn_mul'] simp only [physicalBlockFineSteps, List.flatMap_def, List.map_ofFn] congr 2 apply congrArg List.ofFn funext j simp only [List.ofFn_succ, List.ofFn_zero] change [physicalSelectedFineTag n (4 * j.val + 0), physicalSelectedFineTag n (4 * j.val + 1), physicalSelectedFineTag n (4 * j.val + 2), physicalSelectedFineTag n (4 * j.val + 3)] = [some (.inl j.castSucc), none, some (.inr j), none] have hv : physicalSelectedFineTag n (4 * j.val) = some (.inl j.castSucc) := physical_fine_tag_visit j.castSucc simp only [Nat.add_zero, hv, physical_fine_tag_source_permutation, physical_fine_tag_edge, physical_fine_tag_target_permutation] end Bounty end section /- The original full-box candidate sum, with its saved diagonal and exact truncated energy. The allocation threshold is chosen after the coefficient costs and before the Fourier cutoff. -/ open Finset Filter namespace Bounty end Bounty end section /- Fixed frequency shifts in the actual ambient Type-II discrepancy bounds. -/ open Finset Filter namespace Bounty end Bounty end section /- Uniform low-frequency discrepancy across a whole polynomial shift window. -/ open Finset Filter namespace Bounty theorem abs_add_le_rpow_max_add_one {L u σ a b : ℝ} (hL : 2 ≤ L) (hu : |u| ≤ L ^ a) (hσ : |σ| ≤ L ^ b) : |u + σ| ≤ L ^ (max a b + 1) := by have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have ha := Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left a b) have hb := Real.rpow_le_rpow_of_exponent_le hL1 (le_max_right a b) calc _ ≤ |u| + |σ| := abs_add_le u σ _ ≤ 2 * L ^ max a b := by linarith _ ≤ L * L ^ max a b := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = L ^ (max a b + 1) := by rw [Real.rpow_add hL0, Real.rpow_one]; ring theorem eventually_ambient_rough_uniform_shift_discrepancy (hZ : PrimitiveZeroFreeHalfPlane) {γ vMax S B0 Cmod Sfreq B : ℝ} (hγ : 0 < γ) (hv : vMax < 1) (hS : 0 ≤ S) (hB0 : 0 ≤ B0) (hprecision : max (max B0 Sfreq) Cmod + B + 5 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ a v : ℝ, v ≤ vMax → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L ^ Cmod → ∀ u σ : ℝ, |u| ≤ L ^ B0 → |σ| ≤ L ^ Sfreq → ∀ m n : ℕ, ‖∑ i ∈ Ioc m n, (ambientRoughIntervalTypeIIAlpha γ L S a v i : ℂ) * harmonicMellinWeight (u + σ) i * χ (i : ZMod r)‖ ≤ L ^ (-B) := by have hx : 0 ≤ max (max B0 Sfreq) Cmod := hB0.trans ((le_max_left _ _).trans (le_max_left _ _)) have hT : 0 ≤ max (max B0 Sfreq) Cmod + 1 := by linarith filter_upwards [eventually_ambient_rough_interval_typeII_discrepancy_uniform hZ hγ hv hS hT (by linarith : (max (max B0 Sfreq) Cmod + 1) + B + 4 ≤ S), eventually_ge_atTop (2 : ℝ)] with L hdis hL intro a v hv' r hr χ hrange u σ hu hσ m n have hL1 : 1 ≤ L := by linarith apply hdis a v hv' r χ _ (u + σ) _ m n · exact hrange.trans (Real.rpow_le_rpow_of_exponent_le hL1 (by linarith [le_max_right (max B0 Sfreq) Cmod])) · exact (abs_add_le_rpow_max_add_one hL hu hσ).trans (Real.rpow_le_rpow_of_exponent_le hL1 (by linarith [le_max_left (max B0 Sfreq) Cmod])) theorem eventually_ambient_prime_uniform_shift_discrepancy (hZ : PrimitiveZeroFreeHalfPlane) {S B0 Cmod Sfreq B : ℝ} (hS : 0 ≤ S) (hB0 : 0 ≤ B0) (hprecision : max (max B0 Sfreq) Cmod + B + 5 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1 / 50 → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L ^ Cmod → ∀ u σ : ℝ, |u| ≤ L ^ B0 → |σ| ≤ L ^ Sfreq → ∀ m n : ℕ, ‖∑ i ∈ Ioc m n, (ambientPrimeTypeIIAlpha κ L S i : ℂ) * harmonicMellinWeight (u + σ) i * χ (i : ZMod r)‖ ≤ L ^ (-B) := by have hx : 0 ≤ max (max B0 Sfreq) Cmod := hB0.trans ((le_max_left _ _).trans (le_max_left _ _)) have hT : 0 ≤ max (max B0 Sfreq) Cmod + 1 := by linarith filter_upwards [eventually_ambient_prime_typeII_discrepancy hZ hS hT (by linarith : (max (max B0 Sfreq) Cmod + 1) + B + 4 ≤ S), eventually_ge_atTop (2 : ℝ)] with L hdis hL intro κ hκ hκ' r hr χ hrange u σ hu hσ m n have hL1 : 1 ≤ L := by linarith apply hdis κ hκ hκ' r χ _ (u + σ) _ m n · exact hrange.trans (Real.rpow_le_rpow_of_exponent_le hL1 (by linarith [le_max_right (max B0 Sfreq) Cmod])) · exact (abs_add_le_rpow_max_add_one hL hu hσ).trans (Real.rpow_le_rpow_of_exponent_le hL1 (by linarith [le_max_left (max B0 Sfreq) Cmod])) end Bounty end section /- Exponential coefficient support gives the actual dyadic base bounds. -/ open Finset Filter namespace Bounty theorem eventually_exponential_dyadic_base_bounds {a b C : ℝ} (ha : 0 < a) (hb : b < 1) (hC : 0 < C) : ∀ᶠ L : ℝ in atTop, ∀ U x : ℝ, Real.exp (a*L) ≤ x → x ≤ C*Real.exp (b*L) → U ≤ x → x ≤ 2*U → Real.exp ((a/2)*L) ≤ U ∧ U ≤ Real.exp L := by have hgap : 0 < 1-b := sub_pos.mpr hb filter_upwards [eventually_exp_half_le_half_exp ha, eventually_ge_atTop (Real.log C/(1-b))] with L hhalf hL intro U x hlo hhi hUx hxU have hlog : Real.log C ≤ (1-b)*L := by have h := (div_le_iff₀ hgap).mp hL nlinarith only [h] have hupper : C*Real.exp (b*L) ≤ Real.exp L := by calc _ = Real.exp (Real.log C+b*L) := by rw [Real.exp_add,Real.exp_log hC] _ ≤ _ := Real.exp_le_exp.mpr (by nlinarith only [hlog]) exact ⟨hhalf.trans (by linarith), hUx.trans (hhi.trans hupper)⟩ theorem original_dyadic_member_bounds (H i n : ℕ) (hn : n ∈ dyadicNatBucket (Icc 1 H) i) : originalDyadicBase i ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*originalDyadicBase i := by rw [dyadicNatBucket_eq_real_interval (Icc 1 H) (fun m hm => (mem_Icc.mp hm).1)] at hn exact ⟨(mem_filter.mp hn).2.1.le,(mem_filter.mp hn).2.2⟩ end Bounty end section /- The exact original finite dyadic partition has only polynomial cost. -/ open Finset Filter namespace Bounty theorem eventually_original_dyadic_count : ∀ᶠ L : ℝ in atTop, ((dyadicNatIndices (Icc 1 ⌊33*Real.exp L⌋₊)).card : ℝ) ≤ L^2 := by filter_upwards [eventually_ge_atTop (Real.log 33), eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (2/Real.log 2+2)] with L h33 hL hlarge have hL0 : 0 ≤ L := by linarith have h33exp : (33 : ℝ) ≤ Real.exp L := by calc _ = Real.exp (Real.log 33) := (Real.exp_log (by norm_num)).symm _ ≤ _ := Real.exp_le_exp.mpr h33 have hupper : 33*Real.exp L ≤ Real.exp (2*L) := by calc _ ≤ Real.exp L*Real.exp L := mul_le_mul_of_nonneg_right h33exp (Real.exp_pos L).le _ = _ := by rw [← Real.exp_add]; congr 1; ring have hc := dyadic_indices_card_window (Icc 1 ⌊33*Real.exp L⌋₊) (a := 0) (b := 2*L) (by linarith) (by intro n hn have hn' := mem_Icc.mp hn refine ⟨hn'.1, ?_, ?_⟩ · simpa only [Real.exp_zero,Nat.cast_one] using (Nat.cast_le (α := ℝ).mpr hn'.1) · exact (Nat.cast_le.mpr hn'.2).trans ((Nat.floor_le (by positivity)).trans hupper)) simp only [sub_zero] at hc have hmul := mul_le_mul_of_nonneg_right hlarge hL0 calc _ ≤ 2*L/Real.log 2+2 := hc _ = (2/Real.log 2)*L+2 := by ring _ ≤ (2/Real.log 2+2)*L := by nlinarith _ ≤ L^2 := by nlinarith [hmul] theorem abs_double_sum_le_card_sq {ι : Type*} (I : Finset ι) (f : ι → ι → ℝ) {R : ℝ} (hR : 0 ≤ R) (hf : ∀ i ∈ I, ∀ j ∈ I, f i j ≠ 0 → |f i j| ≤ R) : |∑ i ∈ I, ∑ j ∈ I, f i j| ≤ (I.card : ℝ)^2 * R := by calc _ ≤ ∑ i ∈ I, |∑ j ∈ I, f i j| := abs_sum_le_sum_abs _ _ _ ≤ ∑ i ∈ I, ∑ j ∈ I, |f i j| := sum_le_sum (fun _ _ => abs_sum_le_sum_abs _ _) _ ≤ ∑ _i ∈ I, ∑ _j ∈ I, R := by apply sum_le_sum intro i hi apply sum_le_sum intro j hj by_cases hz : f i j = 0 · simpa only [hz,abs_zero] using hR · exact hf i hi j hj hz _ = _ := by simp only [sum_const,nsmul_eq_mul]; ring end Bounty end section /- All harmonic support and scale parameters are verified on the original dyadic indices. -/ open Filter Finset Real open scoped Classical namespace Bounty theorem eventually_actual_candidate_harmonic_parameters {c b K A ε : ℝ} (hc : 0 < c) (hb : 0 < b) (hK : 0 ≤ K) (hA : 0 ≤ A) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type*) [Fintype G] (ι : G → candidatePIndices c L) (J : ℕ) (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels (fun g => candidatePBand (c*L) (ι g).val) C), (J*Fintype.card G : ℕ) ≤ A*log L → ∀ U V : ℝ, exp (b*L) ≤ U → U ≤ exp L → exp (b*L) ≤ V → V ≤ exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), let Z := typeIISmoothDyadicScale U V (U*L^(-K)) j let d := physicalFreeFactor C aux let Y := Z*(d : ℝ)/2 let N := ⌈3*Z*(d : ℝ)⌉₊ 0 < Z ∧ |(k : ℝ)| ≤ Z ∧ 1 ≤ Z*(d : ℝ) ∧ 3*Z < exp (4*L) ∧ 0 < Y ∧ exp (b*L) ≤ Y ∧ b*L ≤ log Y ∧ log Y ≤ (4+ε)*L ∧ (d : ℝ) ≤ exp (ε*L) ∧ 2*((N : ℝ)/Y)*(1+log (N : ℝ))^15 ≤ L^(31 : ℝ) ∧ log (N : ℝ) ≤ (4+ε)*L ∧ ∀ w ∈ harmonicPositiveSupport Z k d, (0 ≤ w ∧ w ≤ (N : ℤ)) ∧ (0 < w+k*(d : ℤ) ∧ w+k*(d : ℤ) ≤ (N : ℤ)) ∧ Y ≤ (w : ℝ) ∧ ‖(typeIIHarmonicDyadic ((w : ℝ)/(Z*(d : ℝ))) : ℂ)‖ ≤ 2 := by obtain ⟨v, vmax, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool, eventually_actual_harmonic_scale_inputs hb hK, eventually_typeII_harmonic_scale_lower hb hK, eventually_candidate_harmonic_energy_polynomial hc hA, eventually_candidate_free_factor_subexponential hc hA hε, eventually_candidate_harmonic_log_linear hc hA hε, eventually_ge_atTop (0 : ℝ)] with L hp hgeo hlo henergy hfree hlog hL intro G _ ι J C aux hslots U V hUlo hUhi hVlo hVhi k hk j hj dsimp only let Z := typeIISmoothDyadicScale U V (U*L^(-K)) j let d := physicalFreeFactor C aux have hprime : ∀ g p, p ∈ candidatePBand (c*L) (ι g).val → p.Prime := by intro g p hpg exact ((hp.2.2.2.2.2 (ι g).val (ι g).property).2.2 p hpg).1 have hd : 0 < d := prod_pos (fun g _ => prod_pos (fun u _ => (hprime g _ (aux g u).property).pos)) have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast hd obtain ⟨hZ, _, hkZ, hcut⟩ := hgeo U V hUlo hUhi hVlo hVhi k hk j hj have hYlo : exp (b*L) ≤ Z*(d : ℝ)/2 := by have hz := hlo U V hUlo hVlo j have hm := mul_le_mul_of_nonneg_left hd1 hZ.le dsimp only [Z] at * nlinarith have hY : 0 < Z*(d : ℝ)/2 := (exp_pos _).trans_le hYlo have hprod : 1 ≤ Z*(d : ℝ) := by have hh : 1 ≤ exp (b*L) := one_le_exp (mul_nonneg hb.le hL) linarith have he := henergy G ι J C aux hslots Z hZ hprod hcut have hdsmall := hfree G ι J C aux hslots have hNlog := hlog G ι J C aux hslots Z hZ hprod hcut have hYN : Z*(d : ℝ)/2 ≤ (⌈3*Z*(d : ℝ)⌉₊ : ℝ) := by have hh := Nat.le_ceil (3*Z*(d : ℝ)) nlinarith have hYlog : log (Z*(d : ℝ)/2) ≤ (4+ε)*L := (log_le_log hY hYN).trans hNlog have hloLog : b*L ≤ log (Z*(d : ℝ)/2) := (le_log_iff_exp_le hY).mpr hYlo exact ⟨hZ, hkZ, hprod, hcut, hY, hYlo, hloLog, hYlog, hdsmall, he, hNlog, (harmonic_positive_error_parameters hZ k hd hkZ).2⟩ end Bounty end section /- Scalar polynomial envelopes for selected endpoint peeling on the original support. -/ open Real namespace Bounty theorem selected_peel_log_factor_power {L v z : ℝ} (hv : 0 < v) (hL : 1 ≤ L) (hcoef : 1+10/v ≤ L) (hz0 : 0 ≤ z) (hz : z ≤ 5*L) : (1+2*z/v)^2 ≤ L^(4 : ℝ) := by have hb : 1+2*z/v ≤ L*L := by calc _ ≤ 1+2*(5*L)/v := by gcongr _ = 1+(10/v)*L := by ring _ ≤ L+(10/v)*L := add_le_add hL le_rfl _ = (1+10/v)*L := by ring _ ≤ L*L := mul_le_mul_of_nonneg_right hcoef (zero_le_one.trans hL) calc _ ≤ (L*L)^2 := pow_le_pow_left₀ (by positivity) hb 2 _ = _ := by norm_num [pow_two]; ring theorem selected_peel_harmonic_power {L M energy m Cb Ce : ℝ} (hL : 3 ≤ L) (hM0 : 0 ≤ M) (hM : M ≤ L^m) (he0 : 0 ≤ energy) (he : energy ≤ L^(31 : ℝ)) : 3*(M*L^Cb)^2*(L^Ce*L^Ce*L^Ce)^2*energy ≤ L^(2*m+2*Cb+6*Ce+32) := by have hL0 : 0 < L := by linarith calc _ ≤ L*(L^m*L^Cb)^2*(L^Ce*L^Ce*L^Ce)^2*L^(31 : ℝ) := by gcongr _ = _ := by nth_rw 1 [← rpow_one L] simp only [← rpow_mul_natCast hL0.le, ← rpow_add hL0] congr 1 ring theorem selected_peel_decay_absorb {L cost T : ℝ} (hL : 1 ≤ L) (hc : cost ≤ L^T) (D : ℝ) : cost*L^(-max 0 (D+T)) ≤ L^(-D) := by have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL calc _ ≤ L^T*L^(-max 0 (D+T)) := mul_le_mul_of_nonneg_right hc (rpow_nonneg hL0.le _) _ = L^(T-max 0 (D+T)) := by rw [← rpow_add hL0]; congr 1 _ ≤ _ := rpow_le_rpow_of_exponent_le hL (by linarith only [le_max_right (0 : ℝ) (D+T)]) end Bounty end section /- Recorded edge displacements are the actual local displacements on the unchanged chronological path. On supported states they equal the full edge divisor. -/ open scoped Classical namespace Bounty section Local variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) noncomputable def physicalLocalDisplacement : (tag : Option (Fin (n + 1) ⊕ Fin n)) → (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) → PhysicalFullLedgerEvent C k tag s → ℤ | none, _, _ => 0 | some (.inl _), _, _ => 0 | some (.inr j), s, e => physicalActiveDisplacement C k cut j (fun g => (s.2 g).1) e.1 theorem physical_local_displacement_edge_observation (j : Fin n) (before after : Fin N → Finset (Fin J)) (tag : Option (Fin (n + 1) ⊕ Fin n)) (htag : tag = some (.inr j)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : physicalLocalDisplacement C k cut tag s e = physicalObservedDisplacement C k cut j (physicalFullEventObservation C k before after tag s e) (fun g => (s.2 g).1) := by subst tag exact (physical_observed_displacement_aux C k cut j e.1 _).symm theorem physical_local_displacement_nonedge (i : ℕ) (hi : i % 4 ≠ 2) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i) s) : physicalLocalDisplacement C k cut (physicalSelectedFineTag n i) s e = 0 := by have hgood (j : Fin n) : physicalSelectedFineTag n i ≠ some (.inr j) := by intro h unfold physicalSelectedFineTag at h split_ifs at h; simp_all generalize ht : physicalSelectedFineTag n i = tag at e ⊢ cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => exact (hgood j ht).elim theorem physical_record_displacement_local (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (p : FiniteEventPath (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (List.range (4 * n + 1)) s) (j : Fin n) : let E := fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let target := fun i => physicalFullLedgerEventTarget (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let occ := finiteScheduleOccurrence E target (4 * n + 1) s p physicalRecordDisplacement C k cut (finiteEventPathObservations E target (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (List.range (4 * n + 1)) s p) j = physicalLocalDisplacement C k cut (physicalSelectedFineTag n (4 * j.val + 2)) (occ ⟨4 * j.val + 2, by have := j.isLt; omega⟩).1 (occ ⟨4 * j.val + 2, by have := j.isLt; omega⟩).2 := by dsimp only let E := fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let target := fun i => physicalFullLedgerEventTarget (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let observe := physicalFullTraceObservation (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n) cut let r := finiteEventPathObservations E target observe (List.range (4 * n + 1)) s p let occ := finiteScheduleOccurrence E target (4 * n + 1) s p have hlen : r.length = 4 * n + 1 := by simp only [r, finite_event_path_observations_length, List.length_range] have h1 : 4 * j.val + 1 < r.length := by omega have h2 : 4 * j.val + 2 < r.length := by omega change (match r[4 * j.val + 1]?, r[4 * j.val + 2]? with | some a, some b => physicalObservedDisplacement C k cut j b.2.1 (fun g => (a.2.2.2 g).1) | _, _ => 0) = _ rw [List.getElem?_eq_getElem h1, List.getElem?_eq_getElem h2] change physicalObservedDisplacement C k cut j (r.get ⟨_, h2⟩).2.1 (fun g => ((r.get ⟨_, h1⟩).2.2.2 g).1) = _ rw [finite_schedule_observations_get E target observe _ s p ⟨_, by omega⟩, finite_schedule_observations_get E target observe _ s p ⟨_, by omega⟩] change physicalObservedDisplacement C k cut j (physicalFullEventObservation C k (cut (4 * j.val + 2)) (cut (4 * j.val + 2 + 1)) (physicalSelectedFineTag n (4 * j.val + 2)) (occ ⟨4 * j.val + 2, by omega⟩).1 (occ ⟨4 * j.val + 2, by omega⟩).2) (fun g => ((target (4 * j.val + 1) (occ ⟨4 * j.val + 1, by omega⟩).1 (occ ⟨4 * j.val + 1, by omega⟩).2).2 g).1) = _ have hs := finite_schedule_source_after E target (4 * n + 1) s p (4 * j.val + 1) (by omega) change (occ ⟨4 * j.val + 2, by omega⟩).1 = target (4 * j.val + 1) (occ ⟨4 * j.val + 1, by omega⟩).1 (occ ⟨4 * j.val + 1, by omega⟩).2 at hs rw [← hs] exact (physical_local_displacement_edge_observation C k cut j _ _ _ (physical_fine_tag_edge j) _ _).symm theorem physical_active_displacement_full_divisor (j : Fin n) (hcut : cut (4 * j.val + 2) = C j) (x : PhysicalFullBoundedState P J ell B) (hx : FullActiveInjective x) (a : PhysicalAuxLabels P (C j)) : physicalActiveDisplacement C k cut j (fun g => (x g).1) a = k j * (physicalFullSharedD (C j) (productActiveMemorySplit (fun g => physicalFullSharedIndices (C j g)) B x).1 a : ℤ) := by have hx' : ∀ g, Function.Injective (x g).1 := hx simp only [physicalActiveDisplacement, dif_pos hx', hcut] change k j * (physicalD (C j) (physicalFullStateLabels (C j) x hx) a : ℤ) = _ have h := physical_full_shared_D_eq (C j) (physicalFullStateLabels (C j) x hx) (fun g => (x g).2) a rw [physical_full_state_encode_labels] at h rw [h] end Local end Bounty end section /- The actual Mellin-shifted ideal frequency has a fixed polynomial envelope. -/ open Filter Real namespace Bounty theorem eventually_harmonic_mellin_frequency_bound (A R : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ a b v : ℝ, |a| ≤ L^A → |b| ≤ L^A → |v| ≤ L^R → |-(a+b+2*Real.pi*v)| ≤ L^(max A R+1) := by filter_upwards [eventually_ge_atTop (max 1 (2+2*Real.pi))] with L hL have hL1 : 1 ≤ L := (le_max_left _ _).trans hL have hL0 : 0 < L := zero_lt_one.trans_le hL1 have hLC : 2+2*Real.pi ≤ L := (le_max_right _ _).trans hL have hA : L^A ≤ L^(max A R) := rpow_le_rpow_of_exponent_le hL1 (le_max_left _ _) have hR : L^R ≤ L^(max A R) := rpow_le_rpow_of_exponent_le hL1 (le_max_right _ _) intro a b v ha hb hv calc _ = |a+b+2*Real.pi*v| := abs_neg _ _ ≤ |a|+|b|+|2*Real.pi*v| := (abs_add_le _ _).trans (add_le_add (abs_add_le _ _) le_rfl) _ = |a|+|b|+(2*Real.pi)*|v| := by rw [abs_mul, abs_of_pos (by positivity : (0 : ℝ) < 2*Real.pi)] _ ≤ L^(max A R)+L^(max A R)+(2*Real.pi)*L^(max A R) := by gcongr · exact ha.trans hA · exact hb.trans hA · exact hv.trans hR _ = (2+2*Real.pi)*L^(max A R) := by ring _ ≤ L*L^(max A R) := mul_le_mul_of_nonneg_right hLC (rpow_nonneg hL0.le _) _ = L^(max A R+1) := by nth_rw 1 [← rpow_one L] rw [← rpow_add hL0] congr 1 ring end Bounty end section /- The common-window harmonic cell coefficient has mass bounded by endpoint energies. -/ open Finset Real namespace Bounty noncomputable def harmonicCellCoefficient (Y a b : ℝ) (d : ℕ) (δ : ℤ) (F G : ℤ → ℂ) (n : ℤ) : ℂ := physicalPhase (-(a+b)) d * ((n : ℂ)⁻¹ * physicalPhase a n.natAbs * physicalPhase b (n+δ).natAbs * star ((harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)*F n) * ((harmonicCommonCutoff (((n+δ : ℤ) : ℝ)/Y) : ℂ)*G (n+δ))) theorem harmonic_cell_coefficient_mass_le_energy {Y : ℝ} (hY : 0 < Y) (a b : ℝ) (d : ℕ) (δ : ℤ) (F G : ℤ → ℂ) : (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellCoefficient Y a b d δ F G n‖) ≤ (8/Y)*sqrt (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)*F n‖^2)* sqrt (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff (((n+δ : ℤ) : ℝ)/Y) : ℂ)*G (n+δ)‖^2) := by let θ : ℤ → ℂ := fun n => physicalPhase (-(a+b)) d * physicalPhase a n.natAbs * physicalPhase b (n+δ).natAbs let f : ℤ → ℂ := fun n => (harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)*F n let g : ℤ → ℂ := fun n => (harmonicCommonCutoff (((n+δ : ℤ) : ℝ)/Y) : ℂ)*G (n+δ) have hm := harmonic_coefficient_mass_le (harmonicCommonSupport Y) θ f g (div_pos hY (by norm_num : (0 : ℝ) < 8)) (fun n hn => (mem_harmonic_common_support.mp hn).1) (by intro n _; simp only [θ, norm_mul, physical_phase_norm, one_mul, le_refl]) have hscale : (1 : ℝ)/(Y/8) = 8/Y := by field_simp calc _ = ∑ n ∈ harmonicCommonSupport Y, ‖(θ n/(n : ℂ))*star (f n)*g n‖ := by apply sum_congr rfl intro n _ congr 1 dsimp only [harmonicCellCoefficient, θ, f, g] rw [div_eq_mul_inv] ring _ ≤ (1/(Y/8))*sqrt (∑ n ∈ harmonicCommonSupport Y, ‖f n‖^2)* sqrt (∑ n ∈ harmonicCommonSupport Y, ‖g n‖^2) := hm _ = _ := by rw [hscale] end Bounty end section /- Exact finite-circle interfaces for the common harmonic cell endpoints. -/ open Finset MeasureTheory open scoped ComplexConjugate namespace Bounty theorem harmonic_cell_target_zero_of_not_mem {Y : ℝ} (hY : 0 < Y) (b : ℝ) (G : ℤ → ℂ) (n : ℤ) (hn : n ∉ harmonicCommonSupport Y) : harmonicCellTarget Y b G n = 0 := by apply harmonic_common_phased_target_zero_of_not_mem hY b G n intro hmem exact hn (mem_harmonic_common_support.mpr hmem) theorem harmonic_cell_pairing_eq_masked_sum {Y : ℝ} (hY : 0 < Y) (Z a b v : ℝ) (δ : ℤ) (F G : ℤ → ℂ) : harmonicCellPairing Y Z a b v δ F G = ∑ n ∈ harmonicCommonSupport Y, if n + δ ∈ harmonicCommonSupport Y then star (harmonicCellSource Y Z a v F n) * harmonicCellTarget Y b G (n + δ) else 0 := by unfold harmonicCellPairing apply sum_congr rfl intro n hn by_cases hmem : n + δ ∈ harmonicCommonSupport Y · rw [if_pos hmem] · rw [if_neg hmem, harmonic_cell_target_zero_of_not_mem hY b G (n + δ) hmem, mul_zero] end Bounty end section /- Candidate inputs to the supported auxiliary-product Fourier estimate. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty end section /- An arbitrary selected weight passes from the actual recorded action to the original full-path moment with its original trace and signed phase intact. -/ open Finset Classical namespace Bounty section Trace variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g (p : P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (w : PhysicalSelectedData P ell C → ℂ) [Fintype (PhysicalSelectedData P ell C)] omit [∀ g (p : P g), NeZero p.val] in theorem physical_original_weighted_trace_phase (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : fullMixedLedgerInducedPhase (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) fullActiveInitialLedger (physicalFullRecordedTracePhase C k ω β ρ V (physicalSelectedFineTag n) cut (4 * n + 1) (fun _ => []) (fun r _ => physicalSelectedDataRecordPhase C cut univ w r)) x p = fullMixedLedgerInducedPhase (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) fullActiveInitialLedger (finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventPhase C k ω β ρ V) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))) x p * physicalSelectedDataRecordPhase C cut univ w (physicalOriginalFineRecord C k cut x p) := by let lift : FiniteEventPath (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x, x) := (finiteLedgerEventPathEquiv (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullMixedLedgerUpdate (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x) x).symm p change physicalFullRecordedTracePhase C k ω β ρ V (physicalSelectedFineTag n) cut (4 * n + 1) (fun _ => []) (fun r _ => physicalSelectedDataRecordPhase C cut univ w r) (fullActiveInitialLedger x, x) lift = finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventPhase C k ω β ρ V) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x, x) lift * _ unfold physicalFullRecordedTracePhase rw [finite_recorded_schedule_phase_factor] rfl theorem physical_original_weighted_moment_eq_trace_action (f : PhysicalFullBoundedState P J ell B → ℂ) (x : PhysicalFullBoundedState P J ell B) : physicalOriginalWeightedMoment C k ω β q ρ V cut w f x = fullMixedLedgerPathAction (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ω (fun g p => β g p / V g) q ρ V ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (physicalFullRecordedTracePhase C k ω β ρ V (physicalSelectedFineTag n) cut (4 * n + 1) (fun _ => []) (fun r _ => physicalSelectedDataRecordPhase C cut univ w r)) (fun s => f s.2) (fullActiveInitialLedger x, x) := by have he := congrFun (full_mixed_ledger_path_action_eq (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ω (fun g p => β g p / V g) q ρ V ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) fullActiveInitialLedger (physicalFullRecordedTracePhase C k ω β ρ V (physicalSelectedFineTag n) cut (4 * n + 1) (fun _ => []) (fun r _ => physicalSelectedDataRecordPhase C cut univ w r)) f) x rw [he] unfold physicalOriginalWeightedMoment fullPermutationMixedPathAction finiteEventPathAction apply sum_congr rfl intro p _ dsimp only rw [physical_original_weighted_trace_phase] unfold physicalOriginalFineWeight ring end Trace end Bounty end section /- Exact Mellin-polynomial factorization on the original common positive support. -/ open Finset MeasureTheory namespace Bounty end Bounty end section /- Total Fourier endpoint energies retain the actual common cutoff. -/ open Finset Real namespace Bounty theorem harmonic_cell_source_square_energy {Y : ℝ} (hY : 0 < Y) (Z a v : ℝ) (F : ℤ → ℂ) : (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖^2) ≤ 64*∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)*F n‖^2 := by rw [mul_sum] apply sum_le_sum intro n hn have hlo := (mem_harmonic_common_support.mp hn).1 have hn0 : (0 : ℝ) < n := (div_pos hY (by norm_num)).trans_le hlo have hr : Y/(n : ℝ) ≤ 8 := (div_le_iff₀ hn0).mpr (by linarith) have hnorm : ‖harmonicCellSource Y Z a v F n‖ ≤ 8*‖(harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)*F n‖ := by rw [harmonicCellSource,physical_mellin_phased_source_norm, abs_of_nonneg (div_nonneg hY.le hn0.le)] exact mul_le_mul_of_nonneg_right hr (norm_nonneg _) have hsq := pow_le_pow_left₀ (norm_nonneg _) hnorm 2 nlinarith only [hsq] theorem harmonic_cell_target_square_energy (Y b : ℝ) (G : ℤ → ℂ) : (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellTarget Y b G n‖^2) = ∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)*G n‖^2 := by simp only [harmonicCellTarget,norm_mul,physical_phase_norm,one_mul] end Bounty end section /- The normalized harmonic source separates into genuine harmonic Mellin polynomials. -/ open Finset MeasureTheory namespace Bounty end Bounty end section /- A common cell-scale major region controls the entire original multiplier. -/ open Finset open scoped Classical namespace Bounty theorem physical_aux_fourier_cell_minor_bound {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (hA : ∀ a, ‖bA a‖ ≤ 1) (hB : ∀ b, ‖bB b‖ ≤ 1) (L κ q Rsave HA HB : ℝ) (hL : 512 ≤ L) (hq : 0 ≤ q) (hparam : 2*κ+2+2*(Rsave+3)+3 ≤ q) (hHA : 0 ≤ HA) (hHB : 0 ≤ HB) (hposA : ∀ a : (∀ i : A, P i.val.1), 0 < ∏ i, (a i).val) (hposB : ∀ b : (∀ i : B, P i.val.1), 0 < ∏ i, (b i).val) (hlargeA : ∀ a : (∀ i : A, P i.val.1), 2*L^q ≤ (∏ i, (a i).val : ℕ)) (hlargeB : ∀ b : (∀ i : B, P i.val.1), 2*L^q ≤ (∏ i, (b i).val : ℕ)) (hlogA : ∀ a : (∀ i : A, P i.val.1), Real.log (∏ i, (a i).val : ℕ) ≤ L) (hlogB : ∀ b : (∀ i : B, P i.val.1), Real.log (∏ i, (b i).val : ℕ) ≤ L) (hcellA : ∀ a, bA a ≠ 0 → HA ≤ (∏ i, (a i).val : ℕ)) (hcellB : ∀ b, bB b ≠ 0 → HB ≤ (∏ i, (b i).val : ℕ)) (hAtomA : ∀ n : ℕ, (∑ a ∈ univ.filter (fun a : (∀ i : A, P i.val.1) => (∏ i, (a i).val) = n), finiteProductWeight (fun i : A => physicalLabelLaw V i.val.1) a) ≤ L^κ/(n : ℝ)) (hAtomB : ∀ n : ℕ, (∑ b ∈ univ.filter (fun b : (∀ i : B, P i.val.1) => (∏ i, (b i).val) = n), finiteProductWeight (fun i : B => physicalLabelLaw V i.val.1) b) ≤ L^κ/(n : ℝ)) : ∀ θ, θ ∉ productMajorArcSet k L (q+1) HA HB → ‖physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ‖ ≤ L^(-Rsave) := by intro θ hminor let π := fun a : (∀ i : A, P i.val.1) => ∏ i, (a i).val let τ := fun b : (∀ i : B, P i.val.1) => ∏ i, (b i).val have hL0 : 0 < L := by linarith have hdyad (i j : ℕ) : ‖physicalAuxFourierMultiplier P V A B hU hAB k (finiteDyadicTest π i bA) (finiteDyadicTest τ j bB) θ‖ ≤ L^(-(Rsave+3)) := by by_cases hai : ∃ a, finiteDyadicTest π i bA a ≠ 0 · by_cases hbj : ∃ b, finiteDyadicTest τ j bB b ≠ 0 · obtain ⟨haL, halog⟩ := finite_dyadic_endpoint_scales π bA hposA (fun a _ => hlargeA a) hlogA hai obtain ⟨hbL, hblog⟩ := finite_dyadic_endpoint_scales τ bB hposB (fun b _ => hlargeB b) hlogB hbj have haCell : HA ≤ 2*((2^i : ℕ) : ℝ) := by obtain ⟨a, ha⟩ := hai have hr := (finite_dyadic_test_range π bA (fun a _ => hposA a) i a ha).2 have hr' : (π a : ℝ) < 2*((2^i : ℕ) : ℝ) := by exact_mod_cast hr exact (hcellA a (finite_dyadic_test_ne_zero π bA ha)).trans hr'.le have hbCell : HB ≤ 2*((2^j : ℕ) : ℝ) := by obtain ⟨b, hb⟩ := hbj have hr := (finite_dyadic_test_range τ bB (fun b _ => hposB b) j b hb).2 have hr' : (τ b : ℝ) < 2*((2^j : ℕ) : ℝ) := by exact_mod_cast hr exact (hcellB b (finite_dyadic_test_ne_zero τ bB hb)).trans hr'.le have hscale : HA*HB ≤ 4*(((2^i : ℕ) : ℝ)*((2^j : ℕ) : ℝ)) := by have hm := mul_le_mul haCell hbCell hHB (hHA.trans haCell) nlinarith apply physical_aux_fourier_minor_bound P V A B hU hAB k (finiteDyadicTest π i bA) (finiteDyadicTest τ j bB) hV hMass (finite_dyadic_test_norm_le_one π bA hA i) (finite_dyadic_test_norm_le_one τ bB hB j) (2^i) (2^j) (by positivity) (by positivity) (fun a ha => finite_dyadic_test_range π bA (fun a _ => hposA a) i a ha) (fun b hb => finite_dyadic_test_range τ bB (fun b _ => hposB b) j b hb) (C := L^κ) (D := L^κ) (by positivity) (by positivity) hAtomA hAtomB L κ 2 q (Rsave+3) hL (by norm_num) hq hparam le_rfl le_rfl haL hbL (supported_dyad_log_product (by linarith) (by positivity) (by positivity) halog hblog) θ exact fun hm => hminor (product_major_arc_cell_subset (by linarith) hscale k hm) · push Not at hbj rw [physical_aux_fourier_zero_right P V A B hU hAB k _ _ hbj θ, norm_zero] positivity · push Not at hai rw [physical_aux_fourier_zero_left P V A B hU hAB k _ _ hai θ, norm_zero] positivity have hcA := finite_dyadic_card_le_three_mul π hposA (by linarith) hlogA have hcB := finite_dyadic_card_le_three_mul τ hposB (by linarith) hlogB have hcube : L^(3 : ℝ) = L*L*L := by rw [show (3 : ℝ) = 2+1 by norm_num, Real.rpow_add hL0, Real.rpow_one, Real.rpow_two] ring rw [← physical_aux_fourier_dyadic_sum P V A B hU hAB k bA bB θ] calc _ ≤ ∑ i ∈ finiteDyadicIndices π, ∑ j ∈ finiteDyadicIndices τ, ‖physicalAuxFourierMultiplier P V A B hU hAB k (finiteDyadicTest π i bA) (finiteDyadicTest τ j bB) θ‖ := (norm_sum_le _ _).trans (sum_le_sum (fun i _ => norm_sum_le _ _)) _ ≤ ∑ _i ∈ finiteDyadicIndices π, ∑ _j ∈ finiteDyadicIndices τ, L^(-(Rsave+3)) := sum_le_sum (fun i _ => sum_le_sum (fun j _ => hdyad i j)) _ = ((finiteDyadicIndices π).card : ℝ)*(finiteDyadicIndices τ).card*L^(-(Rsave+3)) := by simp only [sum_const, nsmul_eq_mul] ring _ ≤ (3*L)*(3*L)*L^(-(Rsave+3)) := by gcongr _ ≤ L^(3 : ℝ)*L^(-(Rsave+3)) := by apply mul_le_mul_of_nonneg_right _ (by positivity) rw [hcube] nlinarith _ = L^(-Rsave) := by rw [← Real.rpow_add hL0] congr 1 ring end Bounty end section /- Fixed-radius arbitrary-precision window tails on the actual harmonic dyadic factors. -/ open Finset Filter Real namespace Bounty end Bounty end section /- Integrated window-cutoff errors, controlled by shifted full-box square energy. -/ open Finset MeasureTheory namespace Bounty theorem harmonic_window_tail_square (a b Y R : ℝ) {P : ℝ → ℂ} {M B : ℝ} (hP : Continuous P) (hM : 0 ≤ M) (hPM : ∀ s, ‖P s‖ ≤ M) (hB : ∀ u, (∫ s in Set.Icc a b, ‖P (s+2*Real.pi*u)‖^2) ≤ B) : IntegrableOn (fun s => ‖∫ u in {u : ℝ | R < ‖u‖}, harmonicWindowLogFourier u * physicalMellinPhase (-2*Real.pi*u) Y * P (s+2*Real.pi*u)‖^2) (Set.Icc a b) ∧ (∫ s in Set.Icc a b, ‖∫ u in {u : ℝ | R < ‖u‖}, harmonicWindowLogFourier u * physicalMellinPhase (-2*Real.pi*u) Y * P (s+2*Real.pi*u)‖^2) ≤ (∫ u in {u : ℝ | R < ‖u‖}, ‖harmonicWindowLogFourier u‖)^2 * B := by have hκc : Continuous (fun u => harmonicWindowLogFourier u * physicalMellinPhase (-2*Real.pi*u) Y) := by apply harmonicWindowLogFourier.continuous.mul unfold physicalMellinPhase fun_prop have hκi := physical_mellin_phase_integrable harmonicWindowLogFourier (fun u => -2*Real.pi*u) harmonic_window_log_fourier_integrable (by fun_prop) Y have ht := integrated_translate_average_square (volume.restrict (Set.Icc a b)) (volume.restrict {u : ℝ | R < ‖u‖}) (2*Real.pi) hκc hκi.integrableOn hP hM hPM hB simpa only [IntegrableOn,norm_mul,physical_mellin_phase_norm,mul_one] using ht theorem harmonic_normalized_four_box_error_eq_tail {Y : ℝ} (hY : 0 < Y) (s R : ℝ) (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (hD : ∀ d ∈ D, 0 < d) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) : harmonicNormalizedFourBoxError Y s R D A B C δ α β γ = ∫ u in {u : ℝ | R < ‖u‖}, harmonicWindowLogFourier u * physicalMellinPhase (-2*Real.pi*u) Y * ((∑ d ∈ D, δ d * harmonicMellinWeight (s+2*Real.pi*u) d) * (∑ a ∈ A, α a * harmonicMellinWeight (s+2*Real.pi*u) a) * (∑ b ∈ B, β b * harmonicMellinWeight (s+2*Real.pi*u) b) * (∑ c ∈ C, γ c * harmonicMellinWeight (s+2*Real.pi*u) c)) := by have hs : MeasurableSet {u : ℝ | ‖u‖ ≤ R} := (isClosed_le continuous_norm continuous_const).measurableSet have heq : {u : ℝ | ‖u‖ ≤ R}ᶜ = {u : ℝ | R < ‖u‖} := by ext u; simp unfold harmonicNormalizedFourBoxError rw [harmonic_normalized_four_box_mellin hY s D A B C δ α β γ hD hA hB hC, ← setIntegral_compl hs (harmonic_normalized_four_box_integrable Y s D A B C δ α β γ hD hA hB hC), heq] end Bounty end section /- The original signed weight retains its complete history phase explicitly. -/ open scoped Classical namespace Bounty section Weight variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_original_weight_history (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : physicalOriginalFineWeight C k ω β retention ρ V x p = (finiteEventPathWeight (FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventWeight (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ω (fun g p => β g p / V g) retention ρ V) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p : ℂ) * physicalFullHistoryPhase C k ω β ρ V ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p := by rw [physical_full_history_phase_eq_induced] rfl end Weight end Bounty end section /- Original prime-pool and rough-band factors avoid every polynomial-sized rational modulus. -/ open Finset Filter namespace Bounty theorem eventually_rational_candidate_P_properties {c : ℝ} (hc : 0 < c) (Rmod : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ g ∈ candidatePIndices c L, ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ p ∈ candidatePBand (c*L) g, p.Prime ∧ p.Coprime qRat := by obtain ⟨v,V,hv,hV,hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool, eventually_exp_neg_rpow_mul_rpow_le (by norm_num : (0 : ℝ) < 1/10) zero_lt_one Rmod 0] with L hpool hdec have hmod : L^Rmod ≤ Real.exp (L^(1/10 : ℝ)) := by simp only [neg_one_mul,neg_zero,Real.rpow_zero] at hdec have hm := mul_le_mul_of_nonneg_left hdec (Real.exp_nonneg (L^(1/10 : ℝ))) have he : Real.exp (L^(1/10 : ℝ)) * Real.exp (-L^(1/10 : ℝ)) = 1 := by rw [← Real.exp_add,add_neg_cancel,Real.exp_zero] simpa only [← mul_assoc,he,one_mul,mul_one] using hm intro g hg qRat hq hqR p hp have hd := (hpool.2.2.2.2.2 g hg).2.2 p hp refine ⟨hd.1,hd.1.coprime_iff_not_dvd.mpr ?_⟩ intro hpq have hsmall : (p : ℝ) ≤ Real.exp (L^(1/10 : ℝ)) := (Nat.cast_le.mpr (Nat.le_of_dvd hq hpq)).trans (hqR.trans hmod) exact (not_lt_of_ge hsmall) hd.2.1 theorem eventually_rational_rough_Q_properties (Rmod : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ A B : ℝ, ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ n ∈ roughBand A B (Real.exp (Real.sqrt L)), 0 < n ∧ n.Coprime qRat := by filter_upwards [eventually_rpow_le_exp_sqrt Rmod] with L hmod intro A B qRat hq hqR n hn exact ⟨roughBand_pos hn, coprime_of_small_prime_avoidance hq (hqR.trans hmod) (rough_band_avoids_small_primes hn)⟩ end Bounty end section /- Exact phase convention for a normalized harmonic source at a positive integer. -/ namespace Bounty theorem fourier_real_eq_phase (n : ℕ) (c : ℝ) : fourier (n : ℤ) (c : AddCircle (1 : ℝ)) = Complex.exp (Complex.I * (2*Real.pi*(c*n) : ℝ)) := by rw [fourier_coe_apply] congr 1 push_cast ring theorem normalized_source_mellin_phase {Z : ℝ} (hZ : 0 < Z) (a v t : ℝ) {n : ℕ} (hn : 0 < n) : physicalMellinPhase (-v) ((n : ℝ)/Z)*physicalPhase (-a) n* physicalMellinPhase t n = physicalMellinPhase v Z*physicalMellinPhase (t-a-v) n := by have hnR : (n : ℝ) ≠ 0 := by exact_mod_cast hn.ne' unfold physicalMellinPhase physicalPhase rw [Real.log_div hnR hZ.ne'] simp only [← Complex.exp_add] congr 1 push_cast ring theorem normalized_harmonic_source_factor {Y Z : ℝ} (hY : 0 < Y) (hZ : 0 < Z) (a v t c : ℝ) (F : ℤ → ℂ) {n : ℕ} (hn : 0 < n) : (Y : ℂ)⁻¹*(harmonicCellSource Y Z a v F n * fourier (n : ℤ) (c : AddCircle (1 : ℝ)) * physicalMellinPhase t n) = physicalMellinPhase v Z * (F n * ((harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)/(n : ℂ)) * physicalMellinPhase (t-a-v) n * Complex.exp (Complex.I * (2*Real.pi*(c*n) : ℝ))) := by have hYC : (Y : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hY.ne' have hnC : (n : ℂ) ≠ 0 := by exact_mod_cast hn.ne' rw [fourier_real_eq_phase] unfold harmonicCellSource physicalMellinSource simp only [Int.cast_natCast, Int.natAbs_natCast, Complex.ofReal_div, Complex.ofReal_natCast] calc _ = (F n * ((harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)/(n : ℂ)) * Complex.exp (Complex.I * (2*Real.pi*(c*n) : ℝ))) * (physicalMellinPhase (-v) ((n : ℝ)/Z)*physicalPhase (-a) n* physicalMellinPhase t n) := by field_simp _ = _ := by rw [normalized_source_mellin_phase hZ a v t hn]; ring end Bounty end section /- The original physical memory coefficients obey the capped-history scalar estimate. -/ open Finset namespace Bounty section Sum variable {I : Type*} {N J ell r B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (phase : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (pattern : Fin (r + 1) → patterns) (k : Fin (r + 1) → ℤ) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (retention : Fin (r + 2) → ℝ) (S : Finset (PhysicalSelectedData P ell (fun j => C (pattern j).val))) (mask : PhysicalSelectedData P ell (fun j => C (pattern j).val) → ℂ) end Sum end Bounty end section /- The actual root residue model is a full memory-path integral of local Fourier phases. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Normalization variable {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) end Normalization end Bounty end section /- All-selector recovery is a local phase product on the original full path. -/ open scoped Classical namespace Bounty section Locality variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) noncomputable def physicalOriginalCoefficientPhase (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : ℂ := fullMixedLedgerInducedPhase (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) fullActiveInitialLedger (finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalLocalCoefficientPhase C k cut ζ K) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))) x p theorem physical_original_record_coefficient_phase (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : physicalRecordCoefficient C cut ζ K (physicalOriginalFineRecord C k cut x p) = physicalOriginalCoefficientPhase C k cut ζ K x p := by let lift : FiniteEventPath (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x, x) := (finiteLedgerEventPathEquiv (FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullMixedLedgerUpdate (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x) x).symm p let pos := (finiteEventPathMapEquiv (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalSelectedFineTag n) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x)).symm lift change physicalRecordCoefficient C cut ζ K (finiteEventPathObservations (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x) pos) = finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalLocalCoefficientPhase C k cut ζ K) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (fullActiveInitialLedger x, x) lift rw [physical_record_coefficient_local_phase] simpa only [pos, Equiv.apply_symm_apply] using (finite_event_path_map_local_phase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalLocalCoefficientPhase C k cut ζ K) (physicalSelectedFineTag n) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x) pos) end Locality end Bounty end section /- Conditional end-to-end reduction: the ambient weighted replacement hypothesis remains explicit. -/ namespace Bounty end Bounty end section /- Finite triangle assembly of the explicit, still unproved ambient component estimates. -/ open Finset Filter namespace Bounty theorem ambient_buchstab_mesh_error_le_uniform (T : Finset ℕ) (μ : ℕ → ℝ) (b q κ L S : ℝ) (N : ℕ) (R : ℝ) (hrough : ∀ i : Fin N, |ambientRoughProxyError T μ (reciprocalGrid b q N i) L S (Real.exp (reciprocalGrid b q N i*L)) (Real.exp (reciprocalGrid b q N ((i : ℕ)+1)*L))| ≤ R) (hprime : |ambientPrimeProxyError T μ κ L S| ≤ R) : |ambientBuchstabMeshError T μ b q κ L S N| ≤ ((N : ℝ)+1)*R := by unfold ambientBuchstabMeshError calc _ ≤ |∑ i : Fin N, ambientRoughProxyError T μ (reciprocalGrid b q N i) L S (Real.exp (reciprocalGrid b q N i*L)) (Real.exp (reciprocalGrid b q N ((i : ℕ)+1)*L))|+ |ambientPrimeProxyError T μ κ L S| := abs_add_le _ _ _ ≤ (∑ i : Fin N, |ambientRoughProxyError T μ (reciprocalGrid b q N i) L S (Real.exp (reciprocalGrid b q N i*L)) (Real.exp (reciprocalGrid b q N ((i : ℕ)+1)*L))|)+ |ambientPrimeProxyError T μ κ L S| := add_le_add (abs_sum_le_sum_abs _ _) le_rfl _ ≤ (∑ _i : Fin N, R)+R := add_le_add (sum_le_sum (fun i _ => hrough i)) hprime _ = _ := by simp only [sum_const, card_univ, Fintype.card_fin, nsmul_eq_mul]; ring theorem eventually_candidate_ambient_error_of_component_bounds {c q b κ S : ℝ} {r jStar N : ℕ} (hrough : ∀ i : Fin N, ∀ᶠ L : ℝ in atTop, |ambientRoughProxyError (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) (reciprocalGrid b (1/2-κ) N i) L S (Real.exp (reciprocalGrid b (1/2-κ) N i*L)) (Real.exp (reciprocalGrid b (1/2-κ) N ((i : ℕ)+1)*L))| ≤ candidateCoefficientWindowMass c L q r jStar*L^(-2 : ℝ)) (hprime : ∀ᶠ L : ℝ in atTop, |ambientPrimeProxyError (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) κ L S| ≤ candidateCoefficientWindowMass c L q r jStar*L^(-2 : ℝ)) : ∀ᶠ L : ℝ in atTop, |ambientBuchstabMeshError (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) b (1/2-κ) κ L S N| ≤ ((N : ℝ)+1)*candidateCoefficientWindowMass c L q r jStar*L^(-2 : ℝ) := by filter_upwards [Filter.eventually_all.mpr hrough, hprime] with L hr hp simpa only [mul_assoc] using ambient_buchstab_mesh_error_le_uniform (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) b (1/2-κ) κ L S N (candidateCoefficientWindowMass c L q r jStar*L^(-2 : ℝ)) hr hp /- An explicit analytic component hypothesis with one shared cell exponent and cutoff index. This definition does not assert either component estimate. -/ def CandidateAmbientComponentBounds : Prop := ∀ (c q : ℝ) (r : ℕ), 0 shared key.2.1 let Ab := fun (key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)) (_ : SharedActiveLabels P (C key)) => A key.2.1 let Δb := fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a let Db := fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a let _ : ∀ tag y, Fintype (FullPermutationMixedEvent (J := V) n C B Ab Δb Db tag y) := fullPermutationMixedEventFintype n C B Ab Δb Db finiteEventPathFintype (FullPermutationMixedEvent n C B Ab Δb Db) (fullPermutationMixedEventTarget n C B Ab Δb Db) (physicalMixedBigSteps ks L pl) x noncomputable def physicalMixedPlannedBigAction (ks : List (Option (V ⊕ K))) L (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (phase : ∀ x, PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x → ℂ) (F : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) := let C := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1 let Ab := fun (key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)) (_ : SharedActiveLabels P (C key)) => A key.2.1 let Δb := fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a let Db := fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a fullPermutationMixedPathAction n C B Ab Δb Db (fun key => ω key.2.1) μ qghost ρ Vb (physicalMixedBigSteps ks L pl) phase F end Actions end Bounty end section /- Pulling a small-coordinate history into the original big path phase preserves its modulus bound in the physical parameter range. -/ open Finset open scoped Classical namespace Bounty section Bounds variable {S G I V K : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (Vs : S → ℝ) (qedge : K → ℝ) (hV : ∀ g, 1 ≤ Vs g) (hq : ∀ k, qedge k ≤ 1) end Bounds end Bounty end section /- Exact mixed Fourier formula over all original paths; the small residue average remains outside the word. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_root_residue_model_mixed_fourier {I : Type*} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (hV : ∀ g, 0 < V g) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (b : PhysicalPrime P → ℝ) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a ≠ 0) (B : ℕ) (hB : (physicalPrimeGroups P groups).card ≤ B) : letI : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance physicalRootResidueModel V patterns C q ζ k K n = (∏ a ∈ physicalPrimeGroups P groups, b a : ℝ) * ∑ r : PhysicalGroupResidues P groupsᶜ, (∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ)) * ∫ θ : ℝ in (0 : ℝ)..1, ∑ L : PhysicalMarkLists P J ell, ∑ p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, (((physicalStateMass (fun g : ↥groupsᶜ => V g.val) J ell * ∏ j ∈ range (n + 1), physicalCompletionMass (fun g : ↥groupsᶜ => V g.val) (fun g => C (finitePathLabels p j).2.2.1.val g.val) ell : ℝ) : ℂ) * physicalMemoryFourierWalkScalar V patterns C ζ k K (finitePathLabels p) (finitePathMarks L p) (n + 1) θ * physicalGroupFiniteVertexWeight groupsᶜ C q k L p r * physicalGroupFiniteCappedHistory groups C q k (fun a => ((a.2.val : ℝ) * b a)⁻¹) V B L p) := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance rw [physical_root_residue_model_mixed_unrestricted groups V patterns C q ζ k K hV hP hdis hk b hb hb0 B hB] congr 1 apply sum_congr rfl intro r _ congr 1 symm rw [intervalIntegral.integral_finsetSum] · apply sum_congr rfl intro L _ rw [intervalIntegral.integral_finsetSum] · apply sum_congr rfl intro p _ rw [intervalIntegral.integral_mul_const, intervalIntegral.integral_mul_const, intervalIntegral.integral_const_mul] have he := physical_memory_fourier_return_integral V patterns C ζ k K (finitePathLabels p) (finitePathMarks L p) (n + 1) 1 simp only [mul_one] at he rw [he] split_ifs <;> simp only [mul_zero, zero_mul] · intro p _ exact (((continuous_const.mul (physical_memory_fourier_walk_scalar_continuous V patterns C ζ k K (finitePathLabels p) (finitePathMarks L p) (n + 1))).mul continuous_const).mul continuous_const).intervalIntegrable _ _ · intro L _ apply Continuous.intervalIntegrable apply continuous_finsetSum intro p _ exact ((continuous_const.mul (physical_memory_fourier_walk_scalar_continuous V patterns C ζ k K (finitePathLabels p) (finitePathMarks L p) (n + 1))).mul continuous_const).mul continuous_const end Bounty end section /- The inner singleton cross-slice is the existing exact endpoint coefficient. -/ open Finset MeasureTheory open scoped ComplexConjugate namespace Bounty end Bounty end section /- Decorating the original blocks retains exactly the selected edge endpoints. -/ namespace Bounty variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell : ℕ} theorem physical_selected_big_block_schedule (last : V) (bs : List (V × K)) (i : Fin bs.length → I) (L : Fin (bs.length + 1) → PhysicalMarkLists Ps J ell) (σ τ : Fin bs.length → PhysicalPermutations S J ell) : physicalMixedBigSteps (physicalBlockFineSteps bs last) (L 0) (physicalSmallBlockPlanPack last bs (fun j => (i j, L j.succ, σ j, τ j))) = physicalBlockFineSteps (List.ofFn (fun j : Fin bs.length => ((bs.get j).1, ((bs.get j).2, i j, physicalPermuteLabels (σ j) (L j.castSucc), physicalPermuteLabels (τ j) (L j.succ))))) last := by induction bs with | nil => rfl | cons b bs ih => change some (.inl b.1) :: none :: some (.inr (b.2, i 0, physicalPermuteLabels (σ 0) (L 0), physicalPermuteLabels (τ 0) (L (Fin.succ 0)))) :: none :: physicalMixedBigSteps (physicalBlockFineSteps bs last) (physicalPermuteLabels (physicalInversePermutations (τ 0)) (physicalPermuteLabels (τ 0) (L (Fin.succ 0)))) (physicalSmallBlockPlanPack last bs (fun j => (i j.succ, L j.succ.succ, σ j.succ, τ j.succ))) = _ rw [physical_permute_inverse, List.ofFn_succ] exact congrArg (fun rest => some (.inl b.1) :: none :: some (.inr (b.2, i 0, physicalPermuteLabels (σ 0) (L 0), physicalPermuteLabels (τ 0) (L (Fin.succ 0)))) :: none :: rest) (ih (fun j => i j.succ) (fun j => L j.succ) (fun j => σ j.succ) (fun j => τ j.succ)) end Bounty end section /- The exact original selected choices parametrise the actual fine small plan. -/ namespace Bounty variable {S I : Type} {Ps : S → Finset ℕ} {J ell n : ℕ} noncomputable def physicalSmallSelectedFinePlanEquiv : PhysicalSmallSelectedArrays Ps J ell n I ≃ PhysicalMarkLists Ps J ell × PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) := (Equiv.cast (by simp)).trans ((physicalSmallSelectedBlockPlanEquiv (Ps := Ps) (J := J) (ell := ell) (I := I) (Fin.last n) (List.ofFn (fun j : Fin n => (j.castSucc, j)))).trans (Equiv.prodCongr (Equiv.refl _) (Equiv.cast (congrArg (PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I)) (physical_selected_fine_block_schedule n).symm)))) noncomputable def physicalSmallSelectedPlanEquiv (C : I → S → Finset (Fin J)) (hC : ∀ i g, C i g = ∅) : PhysicalSmallSelectedChoices Ps ell n C ≃ PhysicalMarkLists Ps J ell × PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) := (physicalSmallSelectedArraysEquiv C hC).trans physicalSmallSelectedFinePlanEquiv end Bounty end section /- The original candidate energy with its diagonal and Fourier tail both saved. The remaining term is the literal frequency-restricted normalized energy. -/ open Finset Filter namespace Bounty end Bounty end section /- The exact finite P cutoff remains in the endpoint weight when removing H masks. -/ open Finset Filter open scoped ComplexConjugate namespace Bounty theorem eventually_candidate_cross_pair_eq_cutoff_endpoints {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (S : Finset ℕ), (∀ p ∈ S, p ∈ Nat.factoredNumbers ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) → ∀ (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (σ : ℝ), (∀ p ∈ candidateRoughBand c L jStar, twist (candidateRoughSlot c L r jStar hr hj) p = typeIIPhase σ p) → ∀ (M : Finset ℕ) (α : ℕ → ℂ) (modulus : ℕ) (χ : DirichletCharacter ℂ modulus) (ρ ξ₁ ξ₂ ξ₃ : ℝ) (z w : ℕ), 0 < z → 0 < w → (∀ m ∈ M, 0 < m) → (∀ m ∈ M, Disjoint m.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) → (∀ m, m ∉ M → α m=0) → let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let H := candidateRetainedAllocationSupport c L r jStar S take let W : ℕ → ℝ := fun n => markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p:ℝ)) (fun _ => 1) (n:ℤ) let cr := candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist let F₀ := invariantTripleEndpoint P (fun m => α m * χ (m : ZMod modulus) * typeIIPhase (ρ-ξ₂) m) (fun p => if p ∈ candidateRoughBand c L jStar then typeIIPhase (-σ) p else 0) (fun s => conj (cr s)) let G₀ := invariantTripleEndpoint P (fun m => α m * χ (m : ZMod modulus) * typeIIPhase (ξ₁+ρ) m) (fun p => if p ∈ candidateRoughBand c L jStar then typeIIPhase (-σ) p else 0) (fun s => conj (cr s)) typeIICrossPairCoefficient M H (fun m => α m * χ (m : ZMod modulus)) W (fun h => candidateRemainingComplexCoefficient c L r jStar take twist (primePoolFreePart P h)) ρ ξ₁ ξ₂ ξ₃ z w = typeIIPhase (ρ+ξ₃) z * typeIIPhase (-ρ) w * conj (F₀ z) * G₀ w * (candidateRetainedCutoffWeight c L q S z:ℂ) * (candidateRetainedCutoffWeight c L q S w:ℂ) := by classical filter_upwards [eventually_candidate_retained_cutoff_support hc] with L hcut intro q r jStar hr hj S hS take hkeep twist σ hphase M α modulus χ ρ ξ₁ ξ₂ ξ₃ z w hz hw hM hfree hα dsimp only let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let H := candidateRetainedAllocationSupport c L r jStar S take let W : ℕ → ℝ := fun n => markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p:ℝ)) (fun _ => 1) (n:ℤ) let B : ℕ → ℂ := fun h => candidateRemainingComplexCoefficient c L r jStar take twist (primePoolFreePart P h) let C := candidateResidualPrimeSupport c L r jStar hr hj take hkeep let cr := candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist have hH : ∀ h ∈ H, 0 < h := fun h hh => candidate_retained_allocation_support_pos c L r jStar S take (fun p hp => Nat.pos_of_ne_zero (Nat.ne_zero_of_mem_factoredNumbers (hS p hp))) hh have heq (h : ℕ) (hh : h ∈ H) : typeIISeparatedH W B ρ h = typeIISeparatedH (candidateRetainedCutoffWeight c L q S) B ρ h := by have he := hcut q r jStar S hS take twist h rw [if_pos hh, candidate_retained_cutoff_coefficient_eq_weight] at he have he' : (candidateRetainedCutoffWeight c L q S h:ℂ)*B h = (W h:ℂ)*B h := he simpa only [typeIISeparatedH, mul_assoc] using congrArg (fun x : ℂ => typeIIPhase ρ h*x) he'.symm have hcross : typeIICrossPairCoefficient M H (fun m => α m * χ (m : ZMod modulus)) W B ρ ξ₁ ξ₂ ξ₃ z w = typeIICrossPairCoefficient M H (fun m => α m * χ (m : ZMod modulus)) (candidateRetainedCutoffWeight c L q S) B ρ ξ₁ ξ₂ ξ₃ z w := by unfold typeIICrossPairCoefficient apply sum_congr rfl intro m hm apply sum_congr rfl intro h' hh' apply sum_congr rfl intro m' hm' apply sum_congr rfl intro h hh rw [heq h hh, heq h' hh'] have hB : B = fun h => typeIIRoughConvolution (candidateRoughBand c L jStar) C σ cr (primePoolFreePart P h) := by funext h exact candidate_remaining_eq_typeIIRoughConvolution c L r jStar hr hj take hkeep twist σ hphase _ change typeIICrossPairCoefficient M H (fun m => α m * χ (m : ZMod modulus)) W B ρ ξ₁ ξ₂ ξ₃ z w = _ rw [hcross, hB] rw [typeII_cross_pair_eq_invariant_of_weighted_support P M H (candidateRoughBand c L jStar) C (fun m => α m * χ (m : ZMod modulus)) cr (candidateRetainedCutoffWeight c L q S) ρ σ ξ₁ ξ₂ ξ₃ hz hw hM hH hfree (fun m hm h hh => candidate_retained_cutoff_weight_mul_free_left c L q S (hM m hm).ne' hh.ne' (hfree m hm)) (by intro h hh hn have hBh := congrFun hB h rw [← hBh] exact (candidate_retained_cutoff_coefficient_eq_weight c L q r jStar S take twist h).symm.trans (candidate_retained_cutoff_coefficient_eq_zero_of_not_mem c L q r jStar S take twist hn))] have hαχ : ∀ m, m ∉ M → α m * χ (m : ZMod modulus)=0 := by intro m hm rw [hα m hm, zero_mul] have hcr : ∀ s, s ∉ C → cr s=0 := fun s hs => candidate_residual_prime_coefficient_eq_zero_of_not_mem c L r jStar hr hj take hkeep twist hs rw [typeII_invariant_endpoint_unmask_coefficients P M (candidateRoughBand c L jStar) C _ cr (ρ-ξ₂) σ hαχ hcr z, typeII_invariant_endpoint_unmask_coefficients P M (candidateRoughBand c L jStar) C _ cr (ξ₁+ρ) σ hαχ hcr w] end Bounty end section /- The return Fourier multiplier is part of the original local coefficient. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalLocalFourierCoefficient {G I : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (C : I → G → Finset (Fin J)) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (t : ℕ) (i : I) (L R : PhysicalMarkLists P J ell) (a : PhysicalAuxLabels P (C i)) : ℂ := K t i L R a * physicalReturnPhase θ (k t i * (physicalD (C i) L a : ℤ)) theorem physical_memory_labeled_local_fourier {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (t : ℕ) (a : PhysicalEdgeLabels P J ell patterns C) (L R : PhysicalMarkLists P J ell) : physicalMemoryLabeledScalar V patterns C ζ (physicalLocalFourierCoefficient C k K θ t) a L R = physicalMemoryLabeledScalar V patterns C ζ (K t) a L R * physicalReturnPhase θ (physicalBareStep C (k t) a L) := by unfold physicalMemoryLabeledScalar physicalLocalFourierCoefficient physicalBareStep split_ifs <;> ring theorem physical_memory_fourier_as_local_coefficient {I : Type*} {N J ell : ℕ} {P : Fin N → Finset ℕ} (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) (θ : ℝ) : physicalMemoryFourierWalkScalar V patterns C ζ k K a L edges θ = physicalMemoryWalkScalar V patterns C ζ (physicalLocalFourierCoefficient C k K θ) a L edges := by simp only [physicalMemoryFourierWalkScalar, physicalMemoryWalkScalar, physical_memory_labeled_local_fourier] theorem physical_group_fourier_fixed_path_factor {I : Type*} {N J ell : ℕ} {P : Fin N → Finset ℕ} (small : Finset (Fin N)) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) (θ : ℝ) : (physicalGroupPathMass V small (fun j => C (a j).2.2.1.val) ell edges : ℂ) * physicalMemoryFourierWalkScalar V patterns C ζ k K a L edges θ = (physicalStateMass (fun g : ↥small => V g.val) J ell : ℂ) * physicalBareWalkScalar (fun g : ↥small => V g.val) patterns (fun i g => C i g.val) (fun _ _ => 0) (fun _ _ _ _ _ => 1) (fun j => physicalRestrictedEdge (fun g => g ∈ small) patterns C (a j)) (fun j g => L j g.val) edges * ∏ j ∈ range edges, physicalMemoryLabeledScalar (fun g : {g // g ∉ small} => V g.val) patterns (fun i g => C i g.val) (fun _ => 0) (physicalFixedEdgeBigCoefficient (fun g => g ∈ small) patterns C (ζ (edges - 1 - j)) (physicalLocalFourierCoefficient C k K θ (edges - 1 - j)) (a j) (L j) (L (j + 1))) (physicalRestrictedEdge (fun g => g ∉ small) patterns C (a j)) (fun g => L j g.val) (fun g => L (j + 1) g.val) := by rw [physical_memory_fourier_as_local_coefficient] exact physical_group_fixed_path_factor small V patterns C ζ (physicalLocalFourierCoefficient C k K θ) a L edges end Bounty end section /- The actual rough discrepancy coefficient supplies the low factor and its size bound. -/ open Finset Filter namespace Bounty noncomputable def ambientRoughMellinCoefficient (γ L S a v ν : ℝ) {q : ℕ} (χ : DirichletCharacter ℂ q) (n : ℕ) : ℂ := (ambientRoughIntervalTypeIIAlpha γ L S a v n : ℂ)*χ (n : ZMod q)* (n : ℂ)^((ν : ℂ)*Complex.I) theorem ambient_rough_mellin_polynomial_eq (γ L S a v ν u : ℝ) {q : ℕ} (χ : DirichletCharacter ℂ q) (lo hi : ℕ) : (∑ n ∈ Ioc lo hi, ambientRoughMellinCoefficient γ L S a v ν χ n*harmonicMellinWeight u n) = ∑ n ∈ Ioc lo hi, (ambientRoughIntervalTypeIIAlpha γ L S a v n : ℂ)* harmonicMellinWeight (u+ν) n*χ (n : ZMod q) := by apply sum_congr rfl intro n hn have hnpos : 0 < (n : ℝ) := by exact_mod_cast (Nat.zero_le lo).trans_lt (mem_Ioc.mp hn).1 rw [← harmonic_mellin_weight_cpow_shift u ν hnpos] unfold ambientRoughMellinCoefficient push_cast ring theorem eventually_ambient_rough_mellin_low_factor (hZ : PrimitiveZeroFreeHalfPlane) {γ vMax S B0 Cmod Sfreq B : ℝ} (hγ : 0 < γ) (hv : vMax < 1) (hS : 0 ≤ S) (hB0 : 0 ≤ B0) (hprecision : max (max B0 Sfreq) Cmod+B+5 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ a v : ℝ, v ≤ vMax → ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), (q : ℝ) ≤ L^Cmod → ∀ ν : ℝ, |ν| ≤ L^Sfreq → (∀ n : ℕ, 0 < n → ‖ambientRoughMellinCoefficient γ L S a v ν χ n‖ ≤ 1) ∧ ∀ u : ℝ, |u| ≤ L^B0 → ∀ lo hi : ℕ, ‖∑ n ∈ Ioc lo hi, ambientRoughMellinCoefficient γ L S a v ν χ n* harmonicMellinWeight u n‖ ≤ L^(-B) := by filter_upwards [eventually_ambient_rough_uniform_shift_discrepancy hZ hγ hv hS hB0 hprecision, eventually_rough_typeII_restriction_properties hγ] with L hlow hbound intro a v hv' q hqInst χ hq ν hν constructor · intro n hn have halpha : ‖(ambientRoughIntervalTypeIIAlpha γ L S a v n : ℂ)‖ ≤ 1 := by simpa only [Complex.norm_real,Real.norm_eq_abs,ambientRoughIntervalTypeIIAlpha] using (hbound S (ambientRoughCofactorRange L a v) n).1 have hphase : ‖(n : ℂ)^((ν : ℂ)*Complex.I)‖ = 1 := by rw [show (n : ℂ) = ((n : ℝ) : ℂ) by simp, Complex.norm_cpow_eq_rpow_re_of_pos (Nat.cast_pos.mpr hn)] simp unfold ambientRoughMellinCoefficient rw [norm_mul,norm_mul,hphase,mul_one] exact (mul_le_mul halpha (χ.norm_le_one _) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1) · intro u hu lo hi rw [ambient_rough_mellin_polynomial_eq] exact hlow a v hv' q χ hq u ν hu hν lo hi end Bounty end section /- The actual prime discrepancy coefficient supplies the low factor and its size bound. -/ open Finset Filter namespace Bounty noncomputable def ambientPrimeMellinCoefficient (κ L S ν : ℝ) {q : ℕ} (χ : DirichletCharacter ℂ q) (n : ℕ) : ℂ := (ambientPrimeTypeIIAlpha κ L S n : ℂ)*χ (n : ZMod q)* (n : ℂ)^((ν : ℂ)*Complex.I) theorem ambient_prime_mellin_polynomial_eq (κ L S ν u : ℝ) {q : ℕ} (χ : DirichletCharacter ℂ q) (lo hi : ℕ) : (∑ n ∈ Ioc lo hi, ambientPrimeMellinCoefficient κ L S ν χ n*harmonicMellinWeight u n) = ∑ n ∈ Ioc lo hi, (ambientPrimeTypeIIAlpha κ L S n : ℂ)* harmonicMellinWeight (u+ν) n*χ (n : ZMod q) := by apply sum_congr rfl intro n hn have hnpos : 0 < (n : ℝ) := by exact_mod_cast (Nat.zero_le lo).trans_lt (mem_Ioc.mp hn).1 rw [← harmonic_mellin_weight_cpow_shift u ν hnpos] unfold ambientPrimeMellinCoefficient push_cast ring theorem eventually_ambient_prime_mellin_low_factor (hZ : PrimitiveZeroFreeHalfPlane) {S B0 Cmod Sfreq B : ℝ} (hS : 0 ≤ S) (hB0 : 0 ≤ B0) (hprecision : max (max B0 Sfreq) Cmod+B+5 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), (q : ℝ) ≤ L^Cmod → ∀ ν : ℝ, |ν| ≤ L^Sfreq → (∀ n : ℕ, 0 < n → ‖ambientPrimeMellinCoefficient κ L S ν χ n‖ ≤ 1) ∧ ∀ u : ℝ, |u| ≤ L^B0 → ∀ lo hi : ℕ, ‖∑ n ∈ Ioc lo hi, ambientPrimeMellinCoefficient κ L S ν χ n* harmonicMellinWeight u n‖ ≤ L^(-B) := by filter_upwards [eventually_ambient_prime_uniform_shift_discrepancy hZ hS hB0 hprecision, eventually_balanced_typeII_coefficient_properties S hS] with L hlow hbound intro κ hκ hκmax q hqInst χ hq ν hν constructor · intro n hn have halpha : ‖(ambientPrimeTypeIIAlpha κ L S n : ℂ)‖ ≤ 1 := by simpa only [Complex.norm_real,Real.norm_eq_abs] using (hbound κ hκ hκmax n).1 have hphase : ‖(n : ℂ)^((ν : ℂ)*Complex.I)‖ = 1 := by rw [show (n : ℂ) = ((n : ℝ) : ℂ) by simp, Complex.norm_cpow_eq_rpow_re_of_pos (Nat.cast_pos.mpr hn)] simp unfold ambientPrimeMellinCoefficient rw [norm_mul,norm_mul,hphase,mul_one] exact (mul_le_mul halpha (χ.norm_le_one _) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1) · intro u hu lo hi rw [ambient_prime_mellin_polynomial_eq] exact hlow κ hκ hκmax q χ hq u ν hu hν lo hi end Bounty end section /- The precise remaining ambient weighted replacement statement and its prime-mass consequence. -/ open Finset Filter namespace Bounty theorem candidate_shifted_prime_fraction_of_fixed_slot_error_bound (hZ : PrimitiveZeroFreeHalfPlane) {c q : ℝ} {r : ℕ} (hc : 0 (2*u+1).Prime), candidateCoefficient c L q r jStar u := by classical obtain ⟨κ,qCut,b,h,N,M,hκ,hκmax,hqCut,hqCut0,hqCuthalf,hb,hbq,hh,heven,hlevel,hN,hbins,hmesh,hgap⟩ := exists_candidate_positive_proxy_gap_uniform_precision hZ hc hr hq0 hq1 hcenter subst qCut obtain ⟨Jerr,herr⟩ := hR κ b N hκ hκmax hb hbq hN obtain ⟨Jgap,hgapAll⟩ := hgap refine ⟨max Jerr Jgap,?_⟩ intro jStar hj have hjerr := lt_of_le_of_lt (le_max_left Jerr Jgap) hj have hjgap := lt_of_le_of_lt (le_max_right Jerr Jgap) hj obtain ⟨S,hS,herrS⟩ := herr jStar hjerr have hratio : 0 shiftedPrimeBandPairs T (Real.exp (reciprocalGrid b (1/2-κ) N (i:ℕ)*L)) (Real.exp (reciprocalGrid b (1/2-κ) N ((i:ℕ)+1)*L)) let B := shiftedBalancedPairs T κ L have hμ : ∀u∈T,0≤μ u := fun u _ => candidate_coefficient_nonneg c L hq0 r jStar u have hX : 0≤X := sum_nonneg hμ have hpos := hpositive F (fun _ => shiftedPairIndex) B shiftedPairIndex (fun i v hv => shifted_prime_band_pair_data T _ _ hv) (fun v hv => by have hd := shifted_balanced_pair_data T κ L hv exact ⟨hd.2.1,hd.1,hd.2.2⟩) have hlo := hlower μ S hμ let E := ambientBuchstabMeshError T μ b (1/2-κ) κ L S N let U := ambientBuchstabUnbalancedProxy T μ b (1/2-κ) L S N let BP := ambientBuchstabBalancedProxy T μ κ L S let R := candidateShiftedRoughMass c L q r jStar (Real.exp (b*L)) change (shiftedSieveRatioConstant/3)*X/L ≤ R-U-BP at hpos change R-U-BP-E ≤ ∑ u∈(shiftedRoughSet T (Real.exp (b*L))).filter (fun u=>(2*u+1).Prime),μ u at hlo have hscalar : ((N:ℝ)+1)*L^(-2:ℝ) ≤ (shiftedSieveRatioConstant/12)/L := by rw [Real.rpow_neg hL.le,Real.rpow_two,← div_eq_mul_inv] have hbig := (div_le_iff₀ hratio).mp hLbig apply (div_le_iff₀ (sq_pos_of_pos hL)).mpr have heq : ((shiftedSieveRatioConstant/12)/L)*L^2=shiftedSieveRatioConstant*L/12 := by field_simp rw [heq] linarith have hE : E ≤ (shiftedSieveRatioConstant/12)*X/L := by have he := (le_abs_self E).trans herror have hh := mul_le_mul_of_nonneg_left hscalar hX calc E ≤ ((N:ℝ)+1)*X*L^(-2:ℝ) := he _ = X*(((N:ℝ)+1)*L^(-2:ℝ)) := by ring _ ≤ X*((shiftedSieveRatioConstant/12)/L) := hh _ = _ := by ring have hprime : (shiftedSieveRatioConstant/4)*X/L ≤ ∑ u∈(shiftedRoughSet T (Real.exp (b*L))).filter (fun u=>(2*u+1).Prime),μ u := by have heq : (shiftedSieveRatioConstant/4)*X/L= (shiftedSieveRatioConstant/3)*X/L-(shiftedSieveRatioConstant/12)*X/L := by ring rw [heq] linarith apply hprime.trans apply sum_le_sum_of_subset_of_nonneg · intro u hu exact mem_filter.mpr ⟨(mem_shifted_rough_set_iff T _ u).mp (mem_filter.mp hu).1 |>.1, (mem_filter.mp hu).2⟩ · intro u hu hnot exact hμ u (mem_filter.mp hu).1 end Bounty end section /- Summing the original dyadic blocks preserves any prescribed logarithmic saving. -/ open Finset Filter namespace Bounty theorem eventually_original_bilinear_block_assembly (D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ μ α β : ℕ → ℝ, (∀ i ∈ dyadicNatIndices (Icc 1 ⌊33*Real.exp L⌋₊), ∀ j ∈ dyadicNatIndices (Icc 1 ⌊33*Real.exp L⌋₊), let B := shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) μ (typeIIRestrict (dyadicNatBucket (Icc 1 ⌊33*Real.exp L⌋₊) i) α) (typeIIRestrict (dyadicNatBucket (Icc 1 ⌊33*Real.exp L⌋₊) j) β) B ≠ 0 → |B| ≤ Real.exp L * L^(-(D+4))) → |shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) μ α β| ≤ Real.exp L * L^(-D) := by filter_upwards [eventually_original_dyadic_count,eventually_gt_atTop (0 : ℝ)] with L hcount hL intro μ α β hblocks rw [shifted_typeII_bilinear_eq_dyadic_restrictions _ _ _ _ _ (fun _ hu => shifted_wide_window_nat_factor_bound hL.le hu)] have hsum := abs_double_sum_le_card_sq (dyadicNatIndices (Icc 1 ⌊33*Real.exp L⌋₊)) (fun i j => shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) μ (typeIIRestrict (dyadicNatBucket (Icc 1 ⌊33*Real.exp L⌋₊) i) α) (typeIIRestrict (dyadicNatBucket (Icc 1 ⌊33*Real.exp L⌋₊) j) β)) (by positivity : 0 ≤ Real.exp L * L^(-(D+4))) hblocks have hsq : (((dyadicNatIndices (Icc 1 ⌊33*Real.exp L⌋₊)).card : ℝ))^2 ≤ L^4 := by nlinarith [Nat.cast_nonneg (α := ℝ) (dyadicNatIndices (Icc 1 ⌊33*Real.exp L⌋₊)).card] apply hsum.trans calc _ ≤ L^4 * (Real.exp L * L^(-(D+4))) := mul_le_mul_of_nonneg_right hsq (by positivity) _ = Real.exp L * (L^(4 : ℝ) * L^(-(D+4))) := by rw [Real.rpow_ofNat]; ring _ = Real.exp L * L^(-D) := by rw [← Real.rpow_add hL]; congr 2; ring end Bounty end section /- The path-dependent small factor is a deterministic residue ledger on the original planned big path, with the original local small edge weights. -/ open scoped Classical namespace Bounty section Ledger variable {S G I V K : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) abbrev PhysicalPlannedResidueEvent := FullPermutationMixedEvent (J := V) n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) noncomputable abbrev physicalPlannedResidueTarget := fullPermutationMixedEventTarget (J := V) n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) variable (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) noncomputable def physicalPlannedSmallUpdate (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (r : PhysicalResidues Ps) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : PhysicalPlannedResidueEvent n shared B A Δ D tag x → PhysicalResidues Ps := match tag with | none => fun _ => r | some (.inl _) => fun _ => r | some (.inr key) => fun e => physicalTranslateResidues r (kbig key.1 key.2.1 (productActiveMemorySplit (shared key.2.1) B x).1 e.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ)) variable (Vs : S → ℝ) (qedge : K → ℝ) noncomputable def physicalPlannedSmallPhase (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (r : PhysicalResidues Ps) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : PhysicalPlannedResidueEvent n shared B A Δ D tag x → ℂ := match tag with | none => fun _ => ((Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹ : ℂ) | some (.inl _) => fun _ => 1 | some (.inr key) => fun e => if physicalSharedPrefix key.2.2.1 = physicalSharedPrefix key.2.2.2 then ((physicalCompletionMass Vs (fun _ => (∅ : Finset (Fin J))) ell * (physicalResidueVertexWeight key.2.2.1 (Real.sqrt (qedge key.1)) r * physicalResidueVertexWeight key.2.2.2 (Real.sqrt (qedge key.1)) (physicalPlannedSmallUpdate n shared B A Δ D kbig (some (.inr key)) r x e)) : ℝ) : ℂ) else 0 theorem physical_mixed_plan_small_factor_eq_ledger (ks : List (Option (V ⊕ K))) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) : (physicalMixedPlanSmallFactor n shared B A Δ D kbig Vs qedge ks r L pl x p : ℂ) = deterministicLedgerPhase (PhysicalPlannedResidueEvent n shared B A Δ D) (physicalPlannedResidueTarget n shared B A Δ D) (physicalPlannedSmallUpdate n shared B A Δ D kbig) (physicalPlannedSmallPhase n shared B A Δ D kbig Vs qedge) (physicalMixedBigSteps ks L pl) r x p := by induction ks generalizing r L x with | nil => rfl | cons tag ks ih => cases tag with | none => rcases pl with ⟨σ, pl⟩ rcases p with ⟨⟨τ⟩, p⟩ simp only [physicalMixedPlanSmallFactor, physicalMixedPathPack, finiteEventPathWeight, physicalMixedSmallWeight, physicalMixedBigSteps, deterministicLedgerPhase, physicalPlannedSmallUpdate, physicalPlannedSmallPhase, Complex.ofReal_mul] at ih ⊢ simpa only [Complex.ofReal_inv, physicalMixedWordTarget, physicalPlannedResidueTarget, fullPermutationMixedEventTarget] using congrArg (((Fintype.card (PhysicalPermutations S J ell) : ℝ)⁻¹ : ℂ) * ·) (ih r (physicalPermuteLabels σ L) pl (fullActivePermutation τ x) p) | some tag => cases tag with | inl j => rcases p with ⟨⟨e⟩, p⟩ simp only [physicalMixedPlanSmallFactor, physicalMixedPathPack, finiteEventPathWeight, physicalMixedSmallWeight, physicalMixedBigSteps, deterministicLedgerPhase, physicalPlannedSmallUpdate, physicalPlannedSmallPhase, one_mul] at ih ⊢ exact ih r L pl (coupledGhostJointEventTarget M B x e) p | inr k => rcases pl with ⟨⟨i, R⟩, pl⟩ rcases p with ⟨⟨a, e⟩, p⟩ simp only [physicalMixedPlanSmallFactor, physicalMixedPathPack, finiteEventPathWeight, physicalMixedSmallWeight, physicalMixedBigSteps, deterministicLedgerPhase, physicalPlannedSmallUpdate, physicalPlannedSmallPhase, Complex.ofReal_mul] at ih ⊢ erw [ih] split_ifs <;> simp only [Complex.ofReal_mul, Complex.ofReal_zero, zero_mul] rfl end Ledger end Bounty end section /- Both replacement errors decay on the actual original candidate harmonic support. -/ open Filter Finset Real open scoped Classical namespace Bounty theorem eventually_candidate_harmonic_replacement_decay {c b K : ℝ} (hc : 0 < c) (hb : 0 < b) (hK : 0 ≤ K) (J ell : ℕ) (Cenv E D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → ∀ (probes : groups → Finset (Fin J)) (r t : Finset groups) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ), 0 < ξ → ∀ (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels (fun g : groups => candidatePBand (c*L) g.val) (repeatedBigPrimePatternCut probes r t i)), repeatedBigPrimePatternBound probes r t Q ξ i ≤ L^E → ∀ (a a' : ℝ) (pool : Finset ℕ), (∀ g : groups, candidatePBand (c*L) g.val ⊆ pool) → ∀ (α β γ α' β' γ' : ℕ → ℂ), (∀ n, ‖α n‖ ≤ L^Cenv) → (∀ n, ‖β n‖ ≤ L^Cenv) → (∀ n, ‖γ n‖ ≤ L^Cenv) → (∀ n, ‖α' n‖ ≤ L^Cenv) → (∀ n, ‖β' n‖ ≤ L^Cenv) → (∀ n, ‖γ' n‖ ≤ L^Cenv) → ∀ U V : ℝ, exp (b*L) ≤ U → U ≤ exp L → exp (b*L) ≤ V → V ≤ exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ‖physicalPositiveHarmonicDifference (fun g : groups => candidatePBand (c*L) g.val) (fun g => ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) probes r t hrt Q h ξ i aux a a' (typeIISmoothDyadicScale U V (U*L^(-K)) j) k pool α β γ α' β' γ'‖ ≤ L^(-D) := by obtain ⟨v, m, hv, hm, hmarked⟩ := exists_candidate_marked_error_inputs hc (ell+J) obtain ⟨v', Aslot, _, hAslot, hslots⟩ := exists_candidate_shared_error_inputs hc J obtain ⟨v'', vmax, _, _, hpoolData⟩ := exists_candidate_P_pool_bounds hc let T : ℝ := 2*m+6*Cenv+31 filter_upwards [hmarked, hslots, hpoolData, eventually_actual_candidate_harmonic_parameters hc hb hK hAslot (by norm_num : (0 : ℝ) < 1), eventually_candidate_shared_polynomial_error hc (by norm_num : (0 : ℝ) ≤ 2) J E (D+T+1), eventually_candidate_free_error_decay hc J (T+E+1) (D+1), eventually_ge_atTop (5 : ℝ)] with L hmL hslotL hpL hparam hsharedL hfreeL hL intro groups hgroups probes r t hrt Q h ξ hξ i aux hHbound a a' pool hpool α β γ α' β' γ' hα hβ hγ hα' hβ' hγ' U V hUlo hUhi hVlo hVhi k hk j hj let P := fun g : groups => candidatePBand (c*L) g.val let mass := fun g : groups => ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ) let cut := repeatedBigPrimePatternCut probes r t i let d := physicalFreeFactor cut aux let Z := typeIISmoothDyadicScale U V (U*L^(-K)) j let Y := Z*(d : ℝ)/2 let N := ⌈3*Z*(d : ℝ)⌉₊ let energy := 2*((N : ℝ)/Y)*(1+log N)^15 let M := (markedDivisorBound (1/2) v (ell+J))^Fintype.card groups let H := repeatedBigPrimePatternBound probes r t Q ξ i let common := M*M*(L^Cenv*L^Cenv*L^Cenv)^2*energy have hL0 : 0 < L := by linarith have hL2 : 2 ≤ L := by linarith have hcnt : (J*Fintype.card groups : ℕ) ≤ Aslot*log L := by simpa only [Fintype.card_coe] using (hslotL groups hgroups).1 have hh := hparam groups (fun g => ⟨g.val, hgroups g.property⟩) J cut aux hcnt U V hUlo hUhi hVlo hVhi k hk j hj obtain ⟨hZ, hkZ, hprod, hcut, hY, hYlo, _, _, _, he, hNlog, hs⟩ := hh have hprime : ∀ g p, p ∈ P g → p.Prime := by intro g p hpg exact ((hpL.2.2.2.2.2 g.val (hgroups g.property)).2.2 p hpg).1 have hdis : Pairwise (fun g g' => Disjoint (P g) (P g')) := by intro g g' hne exact hpL.2.2.2.2.1 (by intro heq; exact hne (Subtype.ext heq)) have hmass : ∀ g, v ≤ mass g := (hmL groups hgroups).2 have hM : M ≤ L^m := (hmL groups hgroups).1 have hM0 : 0 ≤ M := pow_nonneg (zero_le_one.trans (one_le_markedDivisorBound (1/2) v (ell+J))) _ have hH0 : 0 ≤ H := repeated_big_prime_pattern_bound_nonneg probes r t Q ξ i have henergy0 : 0 ≤ energy := by have hlog0 : 0 ≤ log (N : ℝ) := Real.log_natCast_nonneg N dsimp only [energy] positivity have hc0 : 0 ≤ common := mul_nonneg (mul_nonneg (mul_nonneg hM0 hM0) (sq_nonneg _)) henergy0 have hcBound : common ≤ L^T := harmonic_error_power_envelope hL0 hM0 hM henergy0 he have hfreeBound := hfreeL groups hgroups cut aux (2*common*H) (mul_nonneg (mul_nonneg (by norm_num) hc0) hH0) (harmonic_free_error_power_envelope hL2 hc0 hcBound hH0 hHbound) have hNpower : log (N : ℝ) ≤ L^(2 : ℝ) := by calc _ ≤ 5*L := by simpa only [show (4 : ℝ)+1=5 by norm_num] using hNlog _ ≤ L*L := mul_le_mul_of_nonneg_right hL hL0.le _ = _ := by norm_num [pow_two] have hsmall : ∀ n ∈ harmonicPositiveSupport Z k d, (∑ g : groups, (J-(cut g).card : ℕ) * (log n.natAbs/log 2 + log (n+k*(d : ℤ)).natAbs/log 2 + J) / (mass g*exp (L^(1/10 : ℝ)))) * (H+H/(1/2 : ℝ)^(2*∑ g : groups, (J-(cut g).card))) ≤ L^(-(D+T+1)) := by intro n hn have hn0 : 0 < n := (mem_harmonic_positive_support hn).1 have hn' := hs n hn have hwInterval : 0 ≤ n ∧ n ≤ (N : ℤ) := hn'.1 have hzInterval : 0 < n+k*(d : ℤ) ∧ n+k*(d : ℤ) ≤ (N : ℤ) := hn'.2.1 have hw : 0 < n.natAbs := Int.natAbs_pos.mpr hn0.ne' have hz : 0 < (n+k*(d : ℤ)).natAbs := Int.natAbs_pos.mpr hn'.2.1.1.ne' have hwN : n.natAbs ≤ N := by omega have hzN : (n+k*(d : ℤ)).natAbs ≤ N := by omega have hlogw : log (n.natAbs : ℝ) ≤ L^(2 : ℝ) := by exact (log_le_log (show (0 : ℝ) < n.natAbs by exact_mod_cast hw) (show (n.natAbs : ℝ) ≤ (N : ℝ) by exact_mod_cast hwN)).trans hNpower have hlogz : log ((n+k*(d : ℤ)).natAbs : ℝ) ≤ L^(2 : ℝ) := by exact (log_le_log (show (0 : ℝ) < (n+k*(d : ℤ)).natAbs by exact_mod_cast hz) (show ((n+k*(d : ℤ)).natAbs : ℝ) ≤ (N : ℝ) by exact_mod_cast hzN)).trans hNpower exact hsharedL groups hgroups cut _ _ H hw hz hlogw hlogz hH0 hHbound have hbound := physical_positive_harmonic_replacement_error P mass probes hprime hdis hv hmass (fun _ => rfl) r t hrt Q h ξ hξ i aux a a' hZ k hkZ (exp_pos _) (rpow_nonneg hL0.le (-(D+T+1))) (fun g p => ((hpL.2.2.2.2.2 g.val (hgroups g.property)).2.2 p.val p.property).2.1.le) pool hpool α β γ α' β' γ' (rpow_nonneg hL0.le Cenv) (rpow_nonneg hL0.le Cenv) (rpow_nonneg hL0.le Cenv) hα hβ hγ hα' hβ' hγ' hsmall apply hbound.trans have hsharedBound := harmonic_error_decay_absorb (D := D) hL0 hcBound have hsum := add_le_add hsharedBound hfreeBound have heq : -(D+1) = -D-1 := by ring rw [heq] at hsum apply (le_trans ?_ (hsum.trans (harmonic_two_errors_absorb (D := D) hL2))) dsimp only [common, energy, M, H, N, Y, Z, d, cut] ring_nf exact le_refl _ end Bounty end section /- Selected endpoint peeling has arbitrary power saving on the original candidate harmonic ranges. -/ open Filter Finset Real open scoped Classical namespace Bounty theorem eventually_candidate_selected_harmonic_peel_decay {c b K : ℝ} (hc : 0 < c) (hb : 0 < b) (hK : 0 ≤ K) (J ell : ℕ) (Cb Ce D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → ∀ (cut : groups → Finset (Fin J)) (aux : PhysicalAuxLabels (fun g : groups => candidatePBand (c*L) g.val) cut) (big : Finset groups) (g : groups) (κ : ℕ), ell+(cut g).card = κ+1 → g ∉ big → ∀ (b₀ b₁ : GroupMarkedLists (fun j : big => candidatePBand (c*L) j.val.val) (fun j : big => ell+(cut j.val).card) → ℂ), (∀ l, ‖b₀ l‖ ≤ L^Cb) → (∀ l, ‖b₁ l‖ ≤ L^Cb) → ∀ (pool : Finset ℕ), (∀ j : groups, candidatePBand (c*L) j.val ⊆ pool) → ∀ (α₀ β₀ γ₀ α₁ β₁ γ₁ : ℕ → ℂ), (∀ n, ¬ Disjoint n.primeFactors pool → α₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → α₁ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₁ n = 0) → (∀ n, ‖α₀ n‖ ≤ L^Ce) → (∀ n, ‖β₀ n‖ ≤ L^Ce) → (∀ n, ‖γ₀ n‖ ≤ L^Ce) → (∀ n, ‖α₁ n‖ ≤ L^Ce) → (∀ n, ‖β₁ n‖ ≤ L^Ce) → (∀ n, ‖γ₁ n‖ ≤ L^Ce) → ∀ U V : ℝ, exp (b*L) ≤ U → U ≤ exp L → exp (b*L) ≤ V → V ≤ exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), let P := fun g : groups => candidatePBand (c*L) g.val let mass := fun g : groups => ∑ p ∈ P g, 1/(p : ℝ) let marks := fun g : groups => ell+(cut g).card let Z := typeIISmoothDyadicScale U V (U*L^(-K)) j let d := physicalFreeFactor cut aux let S := harmonicPositiveSupport Z k d let δ : ℤ := k*(d : ℤ) ∀ θ : ℤ → ℂ, (∀ n ∈ S, ‖θ n‖ ≤ 2) → ‖(∑ n ∈ S, (θ n/(n : ℂ)) * star (selectedMarkedEndpoint P (1/2) mass marks big b₀ pool α₀ β₀ γ₀ n.natAbs) * selectedMarkedEndpoint P (1/2) mass marks big b₁ pool α₁ β₁ γ₁ (n+δ).natAbs) - (∑ n ∈ S, (θ n/(n : ℂ)) * star (selectedPeeledEndpoint P (1/2) mass marks g κ big b₀ pool α₀ β₀ γ₀ n.natAbs) * selectedPeeledEndpoint P (1/2) mass marks g κ big b₁ pool α₁ β₁ γ₁ (n+δ).natAbs)‖ ≤ L^(-D) := by obtain ⟨v, m, hv, _, hmarked⟩ := exists_candidate_marked_error_inputs hc (ell+J) obtain ⟨_, Aslot, _, hAslot, hslots⟩ := exists_candidate_shared_error_inputs hc J obtain ⟨_, vmax, _, _, hpoolData⟩ := exists_candidate_P_pool_bounds hc let T := 2*m+2*Cb+6*Ce+32 let B := max 0 (D+T) filter_upwards [hmarked, hslots, hpoolData, eventually_actual_candidate_harmonic_parameters hc hb hK hAslot (by norm_num : (0 : ℝ) < 1), eventually_weighted_reciprocal_squares_le (by norm_num : (0 : ℝ) < 1/10) 5 (2*B), eventually_ge_atTop (max 3 (max (1+10/v) vmax))] with L hmarkL hslotL hpoolL hparam hsquare hL intro groups hgroups cut aux big g κ hκ hg b₀ b₁ hb₀ hb₁ pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ U V hUlo hUhi hVlo hVhi k hk j hj dsimp only intro θ hθ let P := fun g : groups => candidatePBand (c*L) g.val let mass := fun g : groups => ∑ p ∈ P g, 1/(p : ℝ) let marks := fun g : groups => ell+(cut g).card let Z := typeIISmoothDyadicScale U V (U*L^(-K)) j let d := physicalFreeFactor cut aux let S := harmonicPositiveSupport Z k d let δ : ℤ := k*(d : ℤ) let Y := Z*(d : ℝ)/2 let N := ⌈3*Z*(d : ℝ)⌉₊ let M := (markedDivisorBound (1/2) v (ell+J))^Fintype.card groups let H := L^Cb let coeff := L^Ce*L^Ce*L^Ce let E := (M*H)^2*(coeff^2*(N : ℝ)*(1+log (N : ℝ))^15) let err := H^2*((M*(1+2*log (N : ℝ)/v))^2* ((coeff^2*(N : ℝ)*(1+log (N : ℝ))^15)*∑ p ∈ P g, 1/(p : ℝ)^2)) let energy := 2*((N : ℝ)/Y)*(1+log (N : ℝ))^15 let cost := 3*(M*H)^2*coeff^2*energy have hL3 : 3 ≤ L := (le_max_left _ _).trans hL have hL1 : 1 ≤ L := by linarith have hL0 : 0 < L := by linarith have hcoef : 1+10/v ≤ L := (le_trans (le_max_left _ _) (le_max_right _ _)).trans hL have hvmax : vmax ≤ L := (le_trans (le_max_right _ _) (le_max_right _ _)).trans hL have hcnt : ((J*Fintype.card groups : ℕ) : ℝ) ≤ Aslot*log L := by simpa only [Fintype.card_coe] using (hslotL groups hgroups).1 obtain ⟨hZ, _, _, _, hY, _, _, _, _, he, hNlog, hs⟩ := hparam groups (fun g => ⟨g.val, hgroups g.property⟩) J cut aux hcnt U V hUlo hUhi hVlo hVhi k hk j hj have hprime : ∀ j p, p ∈ P j → p.Prime := by intro j p hp exact ((hpoolL.2.2.2.2.2 j.val (hgroups j.property)).2.2 p hp).1 have hdis : Pairwise (fun j j' => Disjoint (P j) (P j')) := by intro j j' hne exact hpoolL.2.2.2.2.1 (by intro heq; exact hne (Subtype.ext heq)) have hmass : ∀ j, v ≤ mass j := (hmarkL groups hgroups).2 have hM : M ≤ L^m := (hmarkL groups hgroups).1 have hM0 : 0 ≤ M := pow_nonneg (zero_le_one.trans (one_le_markedDivisorBound (1/2) v (ell+J))) _ have hlog0 : 0 ≤ log (N : ℝ) := log_natCast_nonneg N have hE0 : 0 ≤ E := by dsimp only [E]; positivity have he0 : 0 ≤ energy := by dsimp only [energy]; positivity have hlog5 : log (N : ℝ) ≤ 5*L := by simpa only [show (4 : ℝ)+1=5 by norm_num] using hNlog have hlogpow := selected_peel_log_factor_power hv hL1 hcoef hlog0 hlog5 have hmassUpper : mass g ≤ L := ((hpoolL.2.2.2.2.2 g.val (hgroups g.property)).2.1).trans hvmax have hsqMass : (1+2*log (N : ℝ)/v)^2 * (∑ p ∈ P g, 1/(p : ℝ)) ≤ L^(5 : ℝ) := by calc _ ≤ L^(4 : ℝ)*L := mul_le_mul hlogpow hmassUpper (by positivity) (rpow_nonneg hL0.le _) _ = _ := by norm_num [pow_succ] have hsq := hsquare (P g) ((1+2*log (N : ℝ)/v)^2) (sq_nonneg _) hsqMass (fun p hp => ((hpoolL.2.2.2.2.2 g.val (hgroups g.property)).2.2 p hp).2.1.le) have hrel : err ≤ E*(L^(-B))^2 := by calc _ = E*((1+2*log (N : ℝ)/v)^2*∑ p ∈ P g, 1/(p : ℝ)^2) := by dsimp only [err, E]; ring _ ≤ E*L^(-(2*B)) := mul_le_mul_of_nonneg_left hsq hE0 _ = _ := by rw [← rpow_mul_natCast hL0.le]; congr 2; norm_num; ring have hε0 : 0 ≤ L^(-B) := rpow_nonneg hL0.le _ have hε1 : L^(-B) ≤ 1 := by calc _ ≤ L^(0 : ℝ) := rpow_le_rpow_of_exponent_le hL1 (neg_nonpos.mpr (le_max_left _ _)) _ = 1 := rpow_zero L have hcost : cost ≤ L^T := selected_peel_harmonic_power hL3 hM0 hM he0 he have hS : ∀ n ∈ S, 0 < n ∧ n ≤ (N : ℤ) := by intro n hn exact ⟨(mem_harmonic_positive_support hn).1, (hs n hn).1.2⟩ have hshift : ∀ n ∈ S, 0 < n+δ ∧ n+δ ≤ (N : ℤ) := fun n hn => (hs n hn).2.1 have hbound := selected_harmonic_peel_replacement P (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) < 1) hv mass marks (ell+J) hmass (fun j => Nat.add_le_add_left (by simpa only [Fintype.card_fin] using card_le_univ (cut j)) ell) hprime hdis g κ hκ big hg b₀ b₁ (rpow_nonneg hL0.le Cb) hb₀ hb₁ pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free (rpow_nonneg hL0.le Ce) (rpow_nonneg hL0.le Ce) (rpow_nonneg hL0.le Ce) hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ S δ N θ hY (by norm_num : (0 : ℝ) ≤ 2) hS hshift (fun n hn => (hs n hn).2.2.1) hθ apply hbound.trans change (2/Y)*(sqrt err*sqrt E+sqrt (2*(E+err))*sqrt err) ≤ L^(-D) calc _ ≤ (2/Y)*(3*E*L^(-B)) := mul_le_mul_of_nonneg_left (harmonic_replacement_error_envelope hE0 hε0 hε1 hrel) (div_nonneg (by norm_num) hY.le) _ = cost*L^(-B) := by dsimp only [cost, energy, E] simp only [div_eq_mul_inv] ring _ ≤ L^(-D) := selected_peel_decay_absorb hL1 hcost D end Bounty end section /- The original candidate data supplies uniform parameters for the common logarithmic-cell scale. -/ open Filter Finset Real namespace Bounty theorem harmonic_common_product_scale_parameters {Z H d b L : ℝ} (hZ : 0 < Z) (hH : 0 < H) (hHd : H ≤ d) (hdH : d ≤ exp 2*H) (hlo : exp (b*L) ≤ Z*d/2) (hlog : log (Z*d/2) ≤ 5*L) (hL : log 2 ≤ L) (hbL : 2 ≤ b*L) : 2*exp (b*L)/exp 2 ≤ Z*H ∧ 1 ≤ Z*H ∧ log (Z*H) ≤ 6*L := by have hY : 0 < Z*H := mul_pos hZ hH have hOld : 0 < Z*d/2 := (exp_pos _).trans_le hlo have hupper : Z*H ≤ Z*d := mul_le_mul_of_nonneg_left hHd hZ.le have hcompare : Z*d ≤ exp 2*(Z*H) := by have h := mul_le_mul_of_nonneg_left hdH hZ.le nlinarith have hlower : 2*exp (b*L)/exp 2 ≤ Z*H := by apply (div_le_iff₀ (exp_pos (2 : ℝ))).mpr nlinarith refine ⟨hlower,?_,?_⟩ · have he : exp 2 ≤ exp (b*L) := exp_le_exp.mpr hbL have hm : 1*exp 2 ≤ (Z*H)*exp 2 := by nlinarith exact (mul_le_mul_iff_left₀ (exp_pos (2 : ℝ))).mp (by simpa only [mul_comm] using hm) · have heq : Z*d = 2*(Z*d/2) := by ring have hl : log (Z*d) = log 2+log (Z*d/2) := by calc log (Z*d) = log (2*(Z*d/2)) := congrArg log heq _ = log 2+log (Z*d/2) := log_mul (by norm_num) hOld.ne' have hm := log_le_log hY hupper rw [hl] at hm linarith theorem eventually_candidate_harmonic_common_scale {c b K : ℝ} (hc : 0 < c) (hb : 0 < b) (hK : 0 ≤ K) (J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → ∀ (cut : groups → Finset (Fin J)) (aux : PhysicalAuxLabels (fun g : groups => candidatePBand (c*L) g.val) cut), ∀ U V : ℝ, exp (b*L) ≤ U → U ≤ exp L → exp (b*L) ≤ V → V ≤ exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ (h : ℝ) (D_A D_B : ℕ) (i_A i_B : ℤ), 0 < h → h ≤ 1 → 0 < D_A → 0 < D_B → physicalFreeFactor cut aux = D_A*D_B → upperLogCell h (log D_A) = i_A → upperLogCell h (log D_B) = i_B → let Z := typeIISmoothDyadicScale U V (U*L^(-K)) j let H := harmonicCellProductScale h i_A i_B let Y := Z*H 2*exp (b*L)/exp 2 ≤ Y ∧ 1 ≤ Y ∧ log Y ≤ 6*L ∧ |(k : ℝ)| ≤ Z/4 ∧ (physicalFreeFactor cut aux : ℝ) ≤ exp L := by obtain ⟨v,A,_hv,hA,hslots⟩ := exists_candidate_shared_error_inputs hc J filter_upwards [hslots, eventually_actual_candidate_harmonic_parameters hc hb hK hA (by norm_num : (0 : ℝ) < 1), eventually_typeII_original_harmonic_shift_small hb hK, eventually_ge_atTop (max (log 2) (2/b))] with L hslotsL hparam hshift hL intro groups hgroups cut aux U V hUlo hUhi hVlo hVhi k hk j hj h D_A D_B i_A i_B hh hh1 hDA hDB hd hcA hcB dsimp only have hcnt : ((J*Fintype.card groups : ℕ) : ℝ) ≤ A*log L := by simpa only [Fintype.card_coe] using (hslotsL groups hgroups).1 have hp := hparam groups (fun g => ⟨g.val,hgroups g.property⟩) J cut aux hcnt U V hUlo hUhi hVlo hVhi k hk j hj obtain ⟨hZ,_,_,_,_hOld,hOldLower,_,hOldLog,hdsmall,_,_,_⟩ := hp have hcell := harmonic_cell_product_bounds hh hh1 hDA hDB hcA hcB have hHd : harmonicCellProductScale h i_A i_B ≤ (physicalFreeFactor cut aux : ℝ) := by rw [hd] exact hcell.1.le have hdH : (physicalFreeFactor cut aux : ℝ) ≤ exp 2*harmonicCellProductScale h i_A i_B := by rw [hd] exact hcell.2 have hlog : log (typeIISmoothDyadicScale U V (U*L^(-K)) j * (physicalFreeFactor cut aux : ℝ)/2) ≤ 5*L := by simpa only [show (4 : ℝ)+1=5 by norm_num] using hOldLog have hLlog : log 2 ≤ L := (le_max_left _ _).trans hL have hbL : 2 ≤ b*L := by have ht := (div_le_iff₀ hb).mp ((le_max_right _ _).trans hL) nlinarith obtain ⟨hlow,hunit,hlogY⟩ := harmonic_common_product_scale_parameters hZ (harmonic_cell_product_scale_pos h i_A i_B) hHd hdH hOldLower hlog hLlog hbL refine ⟨hlow,hunit,hlogY,hshift U V hUlo hUhi hVlo hVhi k hk j hj,?_⟩ simpa only [one_mul] using hdsmall end Bounty end section /- Integrability and explicit frequency tails for the original normalized common-cell pairing. -/ open Finset MeasureTheory namespace Bounty section variable {Y Z : ℝ} (hY : 0 < Y) (hZ : Z ≠ 0) {d : ℕ} (hd : d ≠ 0) (a b : ℝ) (δ : ℤ) (F G : ℤ → ℂ) include Y Z hY hZ d hd a b δ F G theorem harmonic_cell_normalized_integrand_eq (v : ℝ) : (Y : ℂ)⁻¹ * (harmonicLogFourier v * physicalPhase (-(a+b+2*Real.pi*v)) d * harmonicCellPairing Y Z a b (2*Real.pi*v) δ F G) = harmonicLogFourier v * ∑ n ∈ harmonicCommonSupport Y, harmonicCellCoefficient Y a b d δ F G n * physicalMellinPhase (2*Real.pi*v) ((n : ℝ)/(Z*(d : ℝ))) := by simp only [harmonicCellPairing, mul_sum] apply sum_congr rfl intro n hn have hn0 : n ≠ 0 := (harmonic_common_support_positive hY hn).ne' have hp := physical_mellin_phased_edge_normalized Y Z a b (2*Real.pi*v) d n (n+δ) (fun m => (harmonicCommonCutoff ((m : ℝ)/Y) : ℂ)*F m) (fun m => (harmonicCommonCutoff ((m : ℝ)/Y) : ℂ)*G m) hY.ne' hZ hd hn0 dsimp only [harmonicCellSource, harmonicCellTarget, harmonicCellCoefficient] calc _ = harmonicLogFourier v * ((Y : ℂ)⁻¹ * physicalPhase (-(a+b+2*Real.pi*v)) d * star (physicalMellinSource Y Z (2*Real.pi*v) (fun m => physicalPhase (-a) m.natAbs * ((harmonicCommonCutoff ((m : ℝ)/Y) : ℂ)*F m)) n) * (physicalPhase b (n+δ).natAbs * ((harmonicCommonCutoff (((n+δ : ℤ) : ℝ)/Y) : ℂ)*G (n+δ)))) := by ring _ = _ := by rw [hp]; ring theorem harmonic_cell_normalized_integrable : Integrable (fun v : ℝ => (Y : ℂ)⁻¹ * (harmonicLogFourier v * physicalPhase (-(a+b+2*Real.pi*v)) d * harmonicCellPairing Y Z a b (2*Real.pi*v) δ F G)) := by have hi := finite_mellin_sum_integrable (harmonicCommonSupport Y) harmonicLogFourier (fun v => 2*Real.pi*v) harmonic_log_fourier_integrable (by fun_prop) (harmonicCellCoefficient Y a b d δ F G) (fun n => (n : ℝ)/(Z*(d : ℝ))) exact hi.congr (Filter.Eventually.of_forall (fun v => (harmonic_cell_normalized_integrand_eq hY hZ hd a b δ F G v).symm)) theorem harmonic_cell_weighted_pairing_integrable : Integrable (fun v : ℝ => harmonicLogFourier v * physicalPhase (-(a+b+2*Real.pi*v)) d * harmonicCellPairing Y Z a b (2*Real.pi*v) δ F G) := by have hYc : (Y : ℂ) ≠ 0 := by exact_mod_cast hY.ne' have hi := (harmonic_cell_normalized_integrable hY hZ hd a b δ F G).const_mul (Y : ℂ) simpa only [← mul_assoc, mul_inv_cancel₀ hYc, one_mul] using hi theorem harmonic_cell_normalized_integrand_norm (v : ℝ) : ‖(Y : ℂ)⁻¹ * (harmonicLogFourier v * physicalPhase (-(a+b+2*Real.pi*v)) d * harmonicCellPairing Y Z a b (2*Real.pi*v) δ F G)‖ ≤ ‖harmonicLogFourier v‖ * ∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellCoefficient Y a b d δ F G n‖ := by rw [harmonic_cell_normalized_integrand_eq hY hZ hd a b δ F G v, norm_mul] apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) apply (norm_sum_le _ _).trans simp only [norm_mul, physical_mellin_phase_norm, mul_one, le_refl] end end Bounty end section /- Polynomial common-cutoff energies for the literal candidate selected and peeled endpoints. -/ open Filter Finset Real namespace Bounty theorem exists_candidate_harmonic_cutoff_energy {c : ℝ} (hc : 0 < c) (J ell : ℕ) (Cb Ce : ℝ) : ∃ T : ℝ, ∀ᶠ L : ℝ in atTop, ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → ∀ (cut : groups → Finset (Fin J)) (big : Finset groups) (g : groups) (κ : ℕ), ell+(cut g).card = κ+1 → g ∉ big → ∀ (b₀ b₁ : GroupMarkedLists (fun j : big => candidatePBand (c*L) j.val.val) (fun j : big => ell+(cut j.val).card) → ℂ), (∀ l, ‖b₀ l‖ ≤ L^Cb) → (∀ l, ‖b₁ l‖ ≤ L^Cb) → ∀ (pool : Finset ℕ), (∀ j : groups, candidatePBand (c*L) j.val ⊆ pool) → ∀ (α₀ β₀ γ₀ α₁ β₁ γ₁ : ℕ → ℂ), (∀ n, ¬ Disjoint n.primeFactors pool → α₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → α₁ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₁ n = 0) → (∀ n, ‖α₀ n‖ ≤ L^Ce) → (∀ n, ‖β₀ n‖ ≤ L^Ce) → (∀ n, ‖γ₀ n‖ ≤ L^Ce) → (∀ n, ‖α₁ n‖ ≤ L^Ce) → (∀ n, ‖β₁ n‖ ≤ L^Ce) → (∀ n, ‖γ₁ n‖ ≤ L^Ce) → ∀ Y : ℝ, 1 ≤ Y → log Y ≤ 6*L → ∀ δ : ℤ, let P := fun j : groups => candidatePBand (c*L) j.val let mass := fun j : groups => ∑ p ∈ P j, 1/(p : ℝ) let marks := fun j : groups => ell+(cut j).card let energy := fun (F : ℕ → ℂ) (s : ℤ) => ∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff (((n+s : ℤ) : ℝ)/Y) : ℂ)*F (n+s).natAbs‖^2 ((8/Y)*sqrt (energy (selectedMarkedEndpoint P (1/2) mass marks big b₀ pool α₀ β₀ γ₀) 0)* sqrt (energy (selectedMarkedEndpoint P (1/2) mass marks big b₁ pool α₁ β₁ γ₁) δ) ≤ L^T) ∧ ((8/Y)*sqrt (energy (selectedPeeledEndpoint P (1/2) mass marks g κ big b₀ pool α₀ β₀ γ₀) 0)* sqrt (energy (selectedPeeledEndpoint P (1/2) mass marks g κ big b₁ pool α₁ β₁ γ₁) δ) ≤ L^T) := by classical obtain ⟨v,m,hv,_hm,hmarked⟩ := exists_candidate_marked_error_inputs hc (ell+J) obtain ⟨_,vmax,_,_,hpoolData⟩ := exists_candidate_P_pool_bounds hc refine ⟨2*m+2*Cb+6*Ce+32,?_⟩ filter_upwards [hmarked,hpoolData,eventually_harmonic_common_energy_polynomial, eventually_weighted_reciprocal_squares_le (by norm_num : (0 : ℝ) < 1/10) 5 0, eventually_ge_atTop (max (3 : ℝ) (max (log 5+2) (max (1+14/v) vmax)))] with L hmarkL hpoolL hscalar hsquare hL intro groups hgroups cut big g κ hκ hg b₀ b₁ hb₀ hb₁ pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ Y hY hlogY δ dsimp only let P := fun j : groups => candidatePBand (c*L) j.val let mass := fun j : groups => ∑ p ∈ P j, 1/(p : ℝ) let marks := fun j : groups => ell+(cut j).card let N := ⌈4*exp 2*Y⌉₊ let M := (markedDivisorBound (1/2) v (ell+J))^Fintype.card groups let E := (M*L^Cb)^2*((L^Ce*L^Ce*L^Ce)^2*(N : ℝ)*(1+log (N : ℝ))^15) let energy := 2*((N : ℝ)/(Y/8))*(1+log (N : ℝ))^15 have hL3 : 3 ≤ L := (le_max_left _ _).trans hL have hL1 : 1 ≤ L := by linarith have hL0 : 0 < L := by linarith have hY0 : 0 < Y := zero_lt_one.trans_le hY have hlogc : log 5+2 ≤ L := ((le_max_left _ _).trans (le_max_right _ _)).trans hL have hcoef : 1+14/v ≤ L := ((le_max_left _ _).trans ((le_max_right _ _).trans (le_max_right _ _))).trans hL have hvmax : vmax ≤ L := ((le_max_right _ _).trans ((le_max_right _ _).trans (le_max_right _ _))).trans hL have hmass : ∀ j, v ≤ mass j := (hmarkL groups hgroups).2 have hM : M ≤ L^m := (hmarkL groups hgroups).1 have hM0 : 0 ≤ M := pow_nonneg (zero_le_one.trans (one_le_markedDivisorBound (1/2) v (ell+J))) _ have hlog0 : 0 ≤ log (N : ℝ) := log_natCast_nonneg N have hE0 : 0 ≤ E := by dsimp only [E]; positivity have he0 : 0 ≤ energy := by dsimp only [energy]; positivity have he : energy ≤ L^(31 : ℝ) := hscalar Y hY hlogY have hlogN : log (N : ℝ) ≤ 7*L := by have h := (harmonic_common_window_ceiling_bounds hY).2.2 dsimp only [N] linarith have hfactor : (1+2*log (N : ℝ)/v)^2 ≤ L^(4 : ℝ) := by have hz : 1+2*log (N : ℝ)/v ≤ L*L := by calc _ ≤ 1+2*(7*L)/v := by gcongr _ = 1+(14/v)*L := by ring _ ≤ L+(14/v)*L := add_le_add hL1 le_rfl _ = (1+14/v)*L := by ring _ ≤ L*L := mul_le_mul_of_nonneg_right hcoef hL0.le calc _ ≤ (L*L)^2 := pow_le_pow_left₀ (by positivity) hz 2 _ = _ := by norm_num [pow_two]; ring have hmassUpper : mass g ≤ L := ((hpoolL.2.2.2.2.2 g.val (hgroups g.property)).2.1).trans hvmax have hfactorMass : (1+2*log (N : ℝ)/v)^2*(∑ p ∈ P g, 1/(p : ℝ)) ≤ L^(5 : ℝ) := by calc _ ≤ L^(4 : ℝ)*L := mul_le_mul hfactor hmassUpper (by positivity) (rpow_nonneg hL0.le _) _ = _ := by norm_num [pow_succ] have hsq : (1+2*log (N : ℝ)/v)^2*(∑ p ∈ P g, 1/(p : ℝ)^2) ≤ 1 := by simpa only [neg_zero,rpow_zero] using hsquare (P g) _ (sq_nonneg _) hfactorMass (fun p hp => ((hpoolL.2.2.2.2.2 g.val (hgroups g.property)).2.2 p hp).2.1.le) have hprime : ∀ j p, p ∈ P j → p.Prime := by intro j p hp exact ((hpoolL.2.2.2.2.2 j.val (hgroups j.property)).2.2 p hp).1 have hdis : Pairwise (fun j j' => Disjoint (P j) (P j')) := by intro j j' hne exact hpoolL.2.2.2.2.1 (by intro heq; exact hne (Subtype.ext heq)) have hmarks : ∀ j, marks j ≤ ell+J := fun j => Nat.add_le_add_left (by simpa only [Fintype.card_fin] using card_le_univ (cut j)) ell have hendpoint (b : GroupMarkedLists (fun j : big => P j.val) (fun j : big => marks j.val) → ℂ) (hb : ∀ l, ‖b l‖ ≤ L^Cb) (α β γ : ℕ → ℂ) (hαfree : ∀ n, ¬ Disjoint n.primeFactors pool → α n = 0) (hβfree : ∀ n, ¬ Disjoint n.primeFactors pool → β n = 0) (hα : ∀ n, ‖α n‖ ≤ L^Ce) (hβ : ∀ n, ‖β n‖ ≤ L^Ce) (hγ : ∀ n, ‖γ n‖ ≤ L^Ce) (s : ℤ) : (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff (((n+s : ℤ) : ℝ)/Y) : ℂ)* selectedMarkedEndpoint P (1/2) mass marks big b pool α β γ (n+s).natAbs‖^2) ≤ 4*E ∧ (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff (((n+s : ℤ) : ℝ)/Y) : ℂ)* selectedPeeledEndpoint P (1/2) mass marks g κ big b pool α β γ (n+s).natAbs‖^2) ≤ 4*E := by have hm := selected_marked_endpoint_energy P (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) < 1) hv mass marks (ell+J) hmass hmarks big b (rpow_nonneg hL0.le Cb) hb pool α β γ (rpow_nonneg hL0.le Ce) (rpow_nonneg hL0.le Ce) (rpow_nonneg hL0.le Ce) hα hβ hγ (Icc 1 N) N (fun n hn => (mem_Icc.mp hn).2) have hd := selected_four_convolution_error_energy P (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) < 1) hv mass marks (ell+J) hmass hmarks hprime hdis g κ hκ big hg b (rpow_nonneg hL0.le Cb) hb pool hpool α β γ hαfree hβfree (rpow_nonneg hL0.le Ce) (rpow_nonneg hL0.le Ce) (rpow_nonneg hL0.le Ce) hα hβ hγ (Icc 1 N) N (fun n hn => ⟨(mem_Icc.mp hn).1,(mem_Icc.mp hn).2⟩) have hd' : (∑ n ∈ Icc 1 N, ‖selectedMarkedEndpoint P (1/2) mass marks big b pool α β γ n- selectedPeeledEndpoint P (1/2) mass marks g κ big b pool α β γ n‖^2) ≤ E := by apply hd.trans calc _ = E*((1+2*log (N : ℝ)/v)^2*∑ p ∈ P g, 1/(p : ℝ)^2) := by dsimp only [E,M]; ring _ ≤ E*1 := mul_le_mul_of_nonneg_left hsq hE0 _ = E := mul_one _ constructor · exact (harmonic_common_cutoff_energy_le hY0 _ s _).trans (hm.trans (by linarith)) · apply (harmonic_common_cutoff_energy_le hY0 _ s _).trans have hp := finite_replacement_energy (Icc 1 N) (selectedMarkedEndpoint P (1/2) mass marks big b pool α β γ) (selectedPeeledEndpoint P (1/2) mass marks g κ big b pool α β γ) exact hp.trans (by linarith) have h₀ := hendpoint b₀ hb₀ α₀ β₀ γ₀ hα₀free hβ₀free hα₀ hβ₀ hγ₀ 0 have h₁ := hendpoint b₁ hb₁ α₁ β₁ γ₁ hα₁free hβ₁free hα₁ hβ₁ hγ₁ δ have hbudget : (8/Y)*(4*E) ≤ L^(2*m+2*Cb+6*Ce+32) := by calc _ = 2*(M*L^Cb)^2*(L^Ce*L^Ce*L^Ce)^2*energy := by dsimp only [E,energy] simp only [div_eq_mul_inv,mul_inv_rev,inv_inv] ring _ ≤ 3*(M*L^Cb)^2*(L^Ce*L^Ce*L^Ce)^2*energy := by gcongr; norm_num _ ≤ _ := selected_peel_harmonic_power hL3 hM0 hM he0 he have hpair {A B : ℝ} (hA : A ≤ 4*E) (hB : B ≤ 4*E) : (8/Y)*sqrt A*sqrt B ≤ L^(2*m+2*Cb+6*Ce+32) := by apply le_trans _ hbudget rw [mul_assoc] apply mul_le_mul_of_nonneg_left _ (by positivity) calc _ ≤ sqrt (4*E)*sqrt (4*E) := mul_le_mul (sqrt_le_sqrt hA) (sqrt_le_sqrt hB) (sqrt_nonneg _) (sqrt_nonneg _) _ = 4*E := mul_self_sqrt (by positivity) exact ⟨hpair h₀.1 h₁.1,hpair h₀.2 h₁.2⟩ end Bounty end section /- Actual auxiliary weights and tests acting on fixed harmonic cell endpoints. -/ open Finset MeasureTheory open scoped Classical ComplexConjugate namespace Bounty end Bounty end section /- The actual candidate tuple multiplier has arbitrary saving away from one cell-scale major region, with no single-dyad support assumption. -/ open Finset Filter open scoped Classical namespace Bounty theorem exists_candidate_cell_minor_bound {c : ℝ} (hc : 0 < c) (J : ℕ) (Rsave : ℝ) : ∃ q : ℝ, 0 ≤ q ∧ ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → let P := fun g : S => candidatePBand (c*L) g.val let V := fun g : S => ∑ p ∈ P g, 1/(p : ℝ) ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r t : Finset S) (A B : Finset (RepeatedBigFlatIndex S J ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → A.Nonempty → B ⊆ t.sigma (repeatedBigPrimeProbeSlots probes) → B.Nonempty → ∀ (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex S J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ), (∀ a, ‖bA a‖ ≤ 1) → (∀ b, ‖bB b‖ ≤ 1) → ∀ HA HB : ℝ, 0 ≤ HA → 0 ≤ HB → (∀ a, bA a ≠ 0 → HA ≤ (∏ i, (a i).val : ℕ)) → (∀ b, bB b ≠ 0 → HB ≤ (∏ i, (b i).val : ℕ)) → ∀ θ, θ ∉ productMajorArcSet k L q HA HB → ‖physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ‖ ≤ L^(-Rsave) := by obtain ⟨κ, _, hatom⟩ := exists_candidate_subset_atom_inputs hc J let q₀ := max 0 (2*κ+2+2*(Rsave+3)+3) have hq₀ : 0 ≤ q₀ := le_max_left _ _ refine ⟨q₀+1, by positivity, ?_⟩ filter_upwards [hatom, eventually_candidate_subset_product_range hc (ε := 1) (by norm_num) J, eventually_mul_rpow_le_exp_rpow q₀ 2 (c := (1/10 : ℝ)) (by norm_num), eventually_ge_atTop (512 : ℝ)] with L ha hrange hlarge hL intro S hS P V ell probes r t A B hA hAne hB hBne hU hAB k bA bB hbA hbB HA HB hHA hHB hcellA hcellB θ hminor have hrangeA := hrange S hS ell probes r A hA hAne have hrangeB := hrange S hS ell probes t B hB hBne have hposA (a : ∀ i : A, P i.val.1) : 0 < ∏ i, (a i).val := by have hh := (Real.exp_pos _).trans_le (hrangeA a).1 exact_mod_cast hh have hposB (b : ∀ i : B, P i.val.1) : 0 < ∏ i, (b i).val := by have hh := (Real.exp_pos _).trans_le (hrangeB b).1 exact_mod_cast hh have hlogA (a : ∀ i : A, P i.val.1) : Real.log (∏ i, (a i).val : ℕ) ≤ L := by have hp : (0 : ℝ) < (∏ i, (a i).val : ℕ) := by exact_mod_cast hposA a simpa only [Real.log_exp, one_mul] using Real.log_le_log hp (hrangeA a).2 have hlogB (b : ∀ i : B, P i.val.1) : Real.log (∏ i, (b i).val : ℕ) ≤ L := by have hp : (0 : ℝ) < (∏ i, (b i).val : ℕ) := by exact_mod_cast hposB b simpa only [Real.log_exp, one_mul] using Real.log_le_log hp (hrangeB b).2 exact physical_aux_fourier_cell_minor_bound P V A B hU hAB k bA bB (ha S hS).1 (fun _ => rfl) hbA hbB L κ q₀ Rsave HA HB hL hq₀ (le_max_right _ _) hHA hHB hposA hposB (fun a => hlarge.trans (hrangeA a).1) (fun b => hlarge.trans (hrangeB b).1) hlogA hlogB hcellA hcellB ((ha S hS).2 ell probes r A hA) ((ha S hS).2 ell probes t B hB) θ hminor end Bounty end section /- Separate endpoint energies from the identical-endpoint cutoff bound. -/ open Finset Real namespace Bounty theorem harmonic_source_energy_of_self_cutoff {Y B : ℝ} (hY : 0 < Y) (Z a v : ℝ) (F : ℤ → ℂ) (hself : (8/Y)*sqrt (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n:ℝ)/Y):ℂ)*F n‖^2)* sqrt (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n:ℝ)/Y):ℂ)*F n‖^2) ≤ B) : (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖^2) ≤ 8*Y*B := by have hE : 0 ≤ ∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n:ℝ)/Y):ℂ)*F n‖^2 := sum_nonneg (fun _ _ => sq_nonneg _) rw [mul_assoc, mul_self_sqrt hE] at hself have hs : 8*(∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n:ℝ)/Y):ℂ)*F n‖^2) ≤ B*Y := by apply (div_le_iff₀ hY).1 simpa only [div_mul_eq_mul_div] using hself have hb := harmonic_cell_source_square_energy hY Z a v F nlinarith theorem harmonic_target_energy_of_self_cutoff {Y B : ℝ} (hY : 0 < Y) (b : ℝ) (F : ℤ → ℂ) (hself : (8/Y)*sqrt (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n:ℝ)/Y):ℂ)*F n‖^2)* sqrt (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n:ℝ)/Y):ℂ)*F n‖^2) ≤ B) : (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellTarget Y b F n‖^2) ≤ Y*B/8 := by rw [harmonic_cell_target_square_energy] have hE : 0 ≤ ∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n:ℝ)/Y):ℂ)*F n‖^2 := sum_nonneg (fun _ _ => sq_nonneg _) rw [mul_assoc, mul_self_sqrt hE] at hself have hs : 8*(∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n:ℝ)/Y):ℂ)*F n‖^2) ≤ B*Y := by apply (div_le_iff₀ hY).1 simpa only [div_mul_eq_mul_div] using hself linarith theorem harmonic_single_energies_of_self_cutoff {Y L T : ℝ} (hY : 0 < Y) (hL : 8 ≤ L) (Z a b v : ℝ) (F : ℤ → ℂ) (hself : (8/Y)*sqrt (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n:ℝ)/Y):ℂ)*F n‖^2)* sqrt (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n:ℝ)/Y):ℂ)*F n‖^2) ≤ L^T) : (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖^2) ≤ Y*L^(T+1) ∧ (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellTarget Y b F n‖^2) ≤ Y*L^(T+1) := by have hLp : 0 < L := by linarith have hpower : 8*Y*L^T ≤ Y*L^(T+1) := by rw [Real.rpow_add hLp,Real.rpow_one] nlinarith [mul_le_mul_of_nonneg_right hL (mul_nonneg hY.le (Real.rpow_nonneg hLp.le T))] refine ⟨(harmonic_source_energy_of_self_cutoff hY Z a v F hself).trans hpower,?_⟩ apply (harmonic_target_energy_of_self_cutoff hY b F hself).trans apply le_trans _ hpower nlinarith [mul_nonneg hY.le (Real.rpow_nonneg hLp.le T)] end Bounty end section /- The integrated cutoff bound with an arbitrary base Mellin-frequency shift. -/ open Finset MeasureTheory namespace Bounty theorem harmonic_normalized_four_box_integrated_tail_shifted {Y : ℝ} (hY : 0 < Y) (a b R E w : ℝ) (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (hD : ∀ d ∈ D, 0 < d) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) (henergy : ∀ u, (∫ s in Set.Icc a b, ‖(∑ d ∈ D, δ d * harmonicMellinWeight (s+w+2*Real.pi*u) d) * (∑ a ∈ A, α a * harmonicMellinWeight (s+w+2*Real.pi*u) a) * (∑ b ∈ B, β b * harmonicMellinWeight (s+w+2*Real.pi*u) b) * (∑ c ∈ C, γ c * harmonicMellinWeight (s+w+2*Real.pi*u) c)‖^2) ≤ E) : IntegrableOn (fun s => ‖harmonicNormalizedFourBoxError Y (s+w) R D A B C δ α β γ‖^2) (Set.Icc a b) ∧ (∫ s in Set.Icc a b, ‖harmonicNormalizedFourBoxError Y (s+w) R D A B C δ α β γ‖^2) ≤ (∫ u in {u : ℝ | R < ‖u‖}, ‖harmonicWindowLogFourier u‖)^2 * E := by let P : ℝ → ℂ := fun s => (∑ d ∈ D, δ d * harmonicMellinWeight (s+w) d) * (∑ a ∈ A, α a * harmonicMellinWeight (s+w) a) * (∑ b ∈ B, β b * harmonicMellinWeight (s+w) b) * (∑ c ∈ C, γ c * harmonicMellinWeight (s+w) c) let M : ℝ := (∑ d ∈ D, ‖δ d‖) * (∑ a ∈ A, ‖α a‖) * (∑ b ∈ B, ‖β b‖) * (∑ c ∈ C, ‖γ c‖) have hP : Continuous P := by dsimp [P,harmonicMellinWeight]; fun_prop have hPM (s : ℝ) : ‖P s‖ ≤ M := by have hb (S : Finset ℕ) (f : ℕ → ℂ) (hS : ∀ n ∈ S, 0 < n) : ‖∑ n ∈ S, f n * harmonicMellinWeight (s+w) n‖ ≤ ∑ n ∈ S, ‖f n‖ := by simpa only [mul_comm,div_one] using finite_mellin_norm_le_mass S f (s+w) 1 zero_lt_one (fun n hn => by exact_mod_cast (Nat.succ_le_iff.mpr (hS n hn))) dsimp only [P,M] simp only [norm_mul] exact mul_le_mul (mul_le_mul (mul_le_mul (hb D δ hD) (hb A α hA) (norm_nonneg _) (by positivity)) (hb B β hB) (norm_nonneg _) (by positivity)) (hb C γ hC) (norm_nonneg _) (by positivity) have he : ∀ u, (∫ s in Set.Icc a b, ‖P (s+2*Real.pi*u)‖^2) ≤ E := by intro u simpa only [P,add_right_comm] using henergy u have ht := harmonic_window_tail_square a b Y R hP (show 0 ≤ M by dsimp [M]; positivity) hPM he have hid (s : ℝ) : (∫ u in {u : ℝ | R < ‖u‖}, harmonicWindowLogFourier u * physicalMellinPhase (-2*Real.pi*u) Y * P (s+2*Real.pi*u)) = harmonicNormalizedFourBoxError Y (s+w) R D A B C δ α β γ := by simpa only [P,add_right_comm] using (harmonic_normalized_four_box_error_eq_tail hY (s+w) R D A B C δ α β γ hD hA hB hC).symm simpa only [hid] using ht end Bounty end section /- The full signed physical weight includes its deterministic history on every schedule. -/ open scoped Classical namespace Bounty section General variable {I K : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) noncomputable def physicalFullSignedWeight (steps : List (Option (I ⊕ K))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps x) : ℂ := (finiteEventPathWeight (FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventWeight (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ω (fun g p => β g p / V g) retention ρ V) steps x p : ℂ) * physicalFullHistoryPhase C k ω β ρ V steps x p end General section Original variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_original_full_signed_weight (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : physicalOriginalFineWeight C k ω β retention ρ V x p = physicalFullSignedWeight C k ω β retention ρ V ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p := physical_original_weight_history C k ω β retention ρ V x p end Original end Bounty end section /- Original common-window harmonic pairings from rational local energy and minor bounds. -/ open Finset MeasureTheory open scoped Classical ComplexConjugate namespace Bounty theorem harmonic_cell_aux_local_energy_decay {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (bA : (∀ i : A, P i.val.1) → ℂ) (bB : (∀ i : B, P i.val.1) → ℂ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (hA : ∀ a, ‖bA a‖ ≤ 1) (hB : ∀ b, ‖bB b‖ ≤ 1) (Z a b v : ℝ) (F₀ G₀ : ℤ → ℂ) {L q K HA HB Y E D : ℝ} (hk : k ≠ 0) (hL : 5 ≤ L) (hq : 0 ≤ q) (hK : 0 ≤ K) (hkB : (k.natAbs : ℝ) ≤ L^K) (hHA : 0 < HA) (hHB : 0 < HB) (hY : 0 < Y) (hscale : L^q ≤ HA*HB) (hf : (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F₀ n‖^2) ≤ Y*L^E) (hg : (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellTarget Y b G₀ n‖^2) ≤ Y*L^E) (hminor : ∀ θ, θ ∉ productMajorArcSet k L q HA HB → ‖physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ‖ ≤ L^(-(D+E+1))) (hlocal : ∀ (r : ℕ), 0 < r → (r : ℝ) ≤ L^(K+q) → ∀ u : ℤ, (∫ x in Set.Icc ((u : ℝ)/r-1/(|(k : ℝ)| *(HA*HB)/L^q)) ((u : ℝ)/r+1/(|(k : ℝ)| *(HA*HB)/L^q)), ‖finiteFourierSum (harmonicCommonSupport Y) (harmonicCellSource Y Z a v F₀) x‖^2) ≤ Y*L^(-((2*D+E+2)+2*q+K+1))) : ‖∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ)* bA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * bB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 * harmonicCellPairing Y Z a b v (k*(∏ g, ∏ j : repeatedBigAuxCut A B g, (aux g j).val : ℕ)) F₀ G₀‖ ≤ Y*L^(-D) := by simp_rw [harmonic_cell_pairing_eq_masked_sum hY] exact physical_aux_shift_local_energy_decay P V A B hU hAB k bA bB hV hMass hA hB (harmonicCommonSupport Y) (harmonicCommonSupport Y) (harmonicCellSource Y Z a v F₀) (harmonicCellTarget Y b G₀) hk hL hq hK hkB hHA hHB hY.le hscale hf hg hminor hlocal end Bounty end section /- Polynomial source-frequency windows and exact enclosing-interval energy bounds. -/ open Filter MeasureTheory Real namespace Bounty end Bounty end section /- The exact common-source Mellin energy is the normalized cutoff energy times Y squared. -/ open Finset MeasureTheory namespace Bounty theorem common_source_mellin_polynomial {Y Z : ℝ} (hY : 0 < Y) (hZ : 0 < Z) (a v t c : ℝ) (F : ℤ → ℂ) : (Y : ℂ)⁻¹ * localMellinPolynomial ((harmonicCommonSupport Y).image Int.natAbs) (fun n => harmonicCellSource Y Z a v F n * fourier (n : ℤ) (c : AddCircle (1 : ℝ))) t = physicalMellinPhase v Z * ∑ n ∈ (harmonicCommonSupport Y).image Int.natAbs, F n * ((harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)/(n : ℂ)) * physicalMellinPhase (t-a-v) n * Complex.exp (Complex.I * (2*Real.pi*(c*n) : ℝ)) := by unfold localMellinPolynomial rw [mul_sum, mul_sum] apply sum_congr rfl intro n hn exact normalized_harmonic_source_factor hY hZ a v t c F (harmonic_common_natural_support_bound hY hn).1 theorem common_source_mellin_norm_sq {Y Z : ℝ} (hY : 0 < Y) (hZ : 0 < Z) (a v t c : ℝ) (F : ℤ → ℂ) : ‖localMellinPolynomial ((harmonicCommonSupport Y).image Int.natAbs) (fun n => harmonicCellSource Y Z a v F n * fourier (n : ℤ) (c : AddCircle (1 : ℝ))) t‖^2 = Y^2 * ‖∑ n ∈ (harmonicCommonSupport Y).image Int.natAbs, F n * ((harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)/(n : ℂ)) * physicalMellinPhase (t-a-v) n * Complex.exp (Complex.I * (2*Real.pi*(c*n) : ℝ))‖^2 := by have hYC : (Y : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hY.ne' have he := congrArg (fun z : ℂ => ‖(Y : ℂ)*z‖^2) (common_source_mellin_polynomial hY hZ a v t c F) simpa only [← mul_assoc, mul_inv_cancel₀ hYC, one_mul, norm_mul, physical_mellin_phase_norm, mul_one, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hY, mul_pow] using he theorem common_source_mellin_energy (μ : Measure ℝ) {Y Z : ℝ} (hY : 0 < Y) (hZ : 0 < Z) (a v c : ℝ) (F : ℤ → ℂ) : (∫ t, ‖localMellinPolynomial ((harmonicCommonSupport Y).image Int.natAbs) (fun n => harmonicCellSource Y Z a v F n * fourier (n : ℤ) (c : AddCircle (1 : ℝ))) t‖^2 ∂μ) = Y^2 * ∫ t, ‖∑ n ∈ (harmonicCommonSupport Y).image Int.natAbs, F n * ((harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)/(n : ℂ)) * physicalMellinPhase (t-a-v) n * Complex.exp (Complex.I * (2*Real.pi*(c*n) : ℝ))‖^2 ∂μ := by simp_rw [common_source_mellin_norm_sq hY hZ a v _ c F] exact integral_const_mul _ _ end Bounty end section /- A supported original root-pattern sum satisfies the finite-memory energy bound. -/ open Finset namespace Bounty section Sum variable {I : Type*} {N J ell r B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (phase : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (pattern : Fin (r + 1) → patterns) (k : ℕ → I → ℤ) (q : ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (S : Finset (PhysicalSelectedData P ell (fun j => C (pattern j).val))) (mask : PhysicalSelectedData P ell (fun j => C (pattern j).val) → ℂ) end Sum end Bounty end section /- The coefficient phase forgets the ledger and acts on the original full event path. -/ open scoped Classical namespace Bounty section Full variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) noncomputable def physicalFullCoefficientPhase (tag : Option (Fin (n + 1) ⊕ Fin n)) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent C k tag (fullActiveInitialLedger x, x)) : ℂ := physicalLocalCoefficientPhase C k cut ζ K tag (fullActiveInitialLedger x, x) e theorem physical_local_coefficient_forgets_ledger (tag : Option (Fin (n + 1) ⊕ Fin n)) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : physicalLocalCoefficientPhase C k cut ζ K tag s e = physicalFullCoefficientPhase C k cut ζ K tag s.2 e := by cases tag with | none => rfl | some tag => cases tag <;> rfl theorem physical_original_coefficient_full_phase (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : physicalOriginalCoefficientPhase C k cut ζ K x p = finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (physicalFullCoefficientPhase C k cut ζ K) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p := by let E := FullPermutationMixedEvent (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let target := fullPermutationMixedEventTarget (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let update := fullMixedLedgerUpdate (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let steps := (List.range (4 * n + 1)).map (physicalSelectedFineTag n) let lift := (finiteLedgerEventPathEquiv E target update steps (fullActiveInitialLedger x) x).symm p change finiteEventLocalPhase (fun tag (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) => E tag s.2) (finiteLedgerEventTarget E target update) (fun tag s e => physicalLocalCoefficientPhase C k cut ζ K tag s e) steps (fullActiveInitialLedger x, x) lift = finiteEventLocalPhase E target (physicalFullCoefficientPhase C k cut ζ K) steps x p simp_rw [physical_local_coefficient_forgets_ledger] exact (finite_ledger_event_local_phase E target update (fun tag y e => physicalFullCoefficientPhase C k cut ζ K tag y e) steps (fullActiveInitialLedger x) x lift).trans (congrArg (finiteEventLocalPhase E target (physicalFullCoefficientPhase C k cut ζ K) steps x) ((finiteLedgerEventPathEquiv E target update steps (fullActiveInitialLedger x) x).apply_symm_apply p)) end Full end Bounty end section /- Common cell and index thresholds for finitely many eventual component hypotheses. -/ open Filter namespace Bounty theorem finite_eventual_component_thresholds {ι : Type*} [Finite ι] (P : ι → ℝ → ℕ → ℝ → Prop) (hP : ∀ i, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∃ J : ℕ, ∀ j : ℕ, J < j → ∀ᶠ L : ℝ in atTop, P i S j L) : ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∃ J : ℕ, ∀ j : ℕ, J < j → ∀ᶠ L : ℝ in atTop, ∀ i, P i S j L := by choose s hs h using hP obtain ⟨S₁,hS₁⟩ := Finite.exists_le s refine ⟨max 0 S₁, le_max_left _ _, ?_⟩ intro S hS have hall (i : ι) := h i S ((hS₁ i).trans ((le_max_right _ _).trans hS)) choose j hj using hall obtain ⟨J,hJ⟩ := Finite.exists_le j refine ⟨J, ?_⟩ intro n hn exact Filter.eventually_all.mpr (fun i => hj i n ((hJ i).trans_lt hn)) /- Separate large-cell-exponent analytic hypotheses; no component bound is asserted here. Thresholds may initially depend on the component. -/ def CandidateAmbientLargeSComponentBounds : Prop := ∀ (c q : ℝ) (r : ℕ), 0 match i with | none => |ambientPrimeProxyError (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r j) κ L S| ≤ candidateCoefficientWindowMass c L q r j*L^(-2 : ℝ) | some i => |ambientRoughProxyError (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r j) (reciprocalGrid b (1/2-κ) N i) L S (Real.exp (reciprocalGrid b (1/2-κ) N i*L)) (Real.exp (reciprocalGrid b (1/2-κ) N ((i : ℕ)+1)*L))| ≤ candidateCoefficientWindowMass c L q r j*L^(-2 : ℝ) have hall : ∀ i, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∃ J : ℕ, ∀ j : ℕ, J < j → ∀ᶠ L : ℝ in atTop, P i S j L := by intro i cases i with | none => exact hprime | some i => exact hrough i obtain ⟨S,hS,hallS⟩ := finite_eventual_component_thresholds P hall obtain ⟨J,hJ⟩ := hallS S le_rfl refine ⟨S,hS,J,?_⟩ intro j hj have hev := hJ j hj exact ⟨fun i => hev.mono (fun L hL => hL (some i)), hev.mono (fun L hL => hL none)⟩ end Bounty end section /- The complete mixed word is a sum of original full big-memory path actions. All small factors, residues, and arbitrary coupled coefficients remain in the pulled-back path phase. No measure normalization is inserted. -/ open Finset open scoped Classical namespace Bounty section Sum variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] [Fintype I] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) theorem physical_mixed_paths_eq_original_big_paths (ks : List (Option (V ⊕ K))) (phase : ∀ s, FiniteEventPath (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) ks s → ℂ) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) r L x : let _ := physicalMixedSmallPlanFintype (Ps := Ps) (J := J) (ell := ell) (I := I) ks physicalMixedWordPathAction n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge ks phase F ((r, L), x) = ∑ pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks, physicalMixedPlannedBigAction n shared B A Δ D ω μ qghost ρ Vb ks L pl (fun y p => (physicalMixedPlanSmallFactor n shared B A Δ D kbig Vs qedge ks r L pl y p : ℂ) * phase ((r, L), y) (physicalMixedPathPack n shared B A Δ D kbig ks r L y ⟨pl, p⟩) * F (finiteEventPathTerminal (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) ks ((r, L), y) (physicalMixedPathPack n shared B A Δ D kbig ks r L y ⟨pl, p⟩))) (fun _ => 1) x := by let _ := physicalMixedSmallPlanFintype (Ps := Ps) (J := J) (ell := ell) (I := I) ks let _ : ∀ pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks, Fintype (PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) := fun pl => physicalMixedPlannedBigPathFintype n shared B A Δ D ks L pl x let _ : ∀ tag s, Fintype (PhysicalMixedWordEvent (V := V) (ell := ell) n shared B A Δ D tag s) := physicalMixedWordEventFintype n shared B A Δ D let _ := finiteEventPathFintype (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) ks ((r, L), x) unfold physicalMixedWordPathAction finiteEventPathAction rw [← (physicalMixedPathPackingEquiv n shared B A Δ D kbig ks r L x).symm.sum_comp] rw [Fintype.sum_sigma] apply sum_congr rfl intro pl _ unfold physicalMixedPlannedBigAction fullPermutationMixedPathAction finiteEventPathAction apply sum_congr · exact congrArg (fun inst : Fintype _ => @Finset.univ _ inst) (Subsingleton.elim _ _) · intro p _ change ((finiteEventPathWeight _ _ _ ks ((r, L), x) (physicalMixedPathPack n shared B A Δ D kbig ks r L x ⟨pl, p⟩) : ℝ) : ℂ) * _ * _ = _ rw [physical_mixed_planned_weight_factor] change ((physicalMixedPlanSmallFactor n shared B A Δ D kbig Vs qedge ks r L pl x p * physicalMixedPlannedBigWeight n shared B A Δ D ω μ qghost ρ Vb ks L pl x p : ℝ) : ℂ) * _ * _ = (physicalMixedPlannedBigWeight n shared B A Δ D ω μ qghost ρ Vb ks L pl x p : ℂ) * _ * 1 simp only [Complex.ofReal_mul] ring_nf rfl theorem physical_mixed_word_eq_original_big_paths (ks : List (Option (V ⊕ K))) (phase : ∀ tag s, PhysicalMixedWordEvent (ell := ell) n shared B A Δ D tag s → ℂ) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) r L x : let _ := physicalMixedSmallPlanFintype (Ps := Ps) (J := J) (ell := ell) (I := I) ks finiteOperatorListAction (physicalMixedWordRow n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase) ks F ((r, L), x) = ∑ pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks, physicalMixedPlannedBigAction n shared B A Δ D ω μ qghost ρ Vb ks L pl (fun y p => (physicalMixedPlanSmallFactor n shared B A Δ D kbig Vs qedge ks r L pl y p : ℂ) * finiteEventLocalPhase (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) phase ks ((r, L), y) (physicalMixedPathPack n shared B A Δ D kbig ks r L y ⟨pl, p⟩) * F (finiteEventPathTerminal (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) ks ((r, L), y) (physicalMixedPathPack n shared B A Δ D kbig ks r L y ⟨pl, p⟩))) (fun _ => 1) x := by rw [physical_mixed_word_eq_paths] exact physical_mixed_paths_eq_original_big_paths n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge ks _ F r L x end Sum end Bounty end section /- The packed mixed word uses the literal original physical big-event path family. -/ open scoped Classical namespace Bounty section Planned variable {S I V K : Type} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) (C : I → Fin N → Finset (Fin J)) (k : K → I → ℤ) (B : ℕ) (ω : ∀ i, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C i g)) → PhysicalAuxLabels P (C i) → ℝ) (μ : ∀ g, ↥(P g) → ℝ) (q : V → ℝ) (ρ : ℝ) (Vb : Fin N → ℝ) theorem physical_mixed_planned_effective_action (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (phase : ∀ x, PhysicalMixedPlannedBigPath (fun g (p : ↥(P g)) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i => physicalMixedEdgeDelta (C i) (k t i)) (fun _ i => physicalMixedEdgeD (C i)) ks L pl x → ℂ) (f : PhysicalFullBoundedState P J ell B → ℂ) : physicalMixedPlannedBigAction (fun g (p : ↥(P g)) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i => physicalMixedEdgeDelta (C i) (k t i)) (fun _ i => physicalMixedEdgeD (C i)) ω μ q ρ Vb ks L pl phase f = let Cb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => C key.2.1 let db := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => physicalSharedPrefix key.2.2.1 let kb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => k key.1 key.2.1 let steps := physicalMixedBigSteps ks L pl fullPermutationMixedPathAction (fun g (p : ↥(P g)) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (Cb key g)) B (fun key _ => PhysicalAuxLabels P (Cb key)) (fun key => physicalFullEdgeDelta (Cb key) (kb key * (physicalSharedProduct (db key) : ℕ))) (fun key => physicalFullEdgeD (Cb key)) (fun key => ω key.2.1) μ q ρ Vb steps (fun x p => phase x ((physicalMixedEffectiveBigPathEquiv hPs hP hdis Cb db kb B steps x).symm p)) f := by exact physical_mixed_effective_big_path_action hPs hP hdis (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => C key.2.1) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k key.1 key.2.1) B (fun key => ω key.2.1) μ q ρ Vb (physicalMixedBigSteps ks L pl) phase f end Planned end Bounty end section /- A single pattern sequence remains shared with arbitrary coupled big data. -/ open scoped Classical namespace Bounty variable {S I : Type} {Ps : S → Finset ℕ} {J ell n : ℕ} noncomputable def physicalSmallSelectedCoupledEquiv (C : I → S → Finset (Fin J)) (hC : ∀ i g, C i g = ∅) (B : (Fin n → I) → Type) : (Σ i : Fin n → I, PhysicalGroupSelectedData Ps ell (fun j => C (i j)) × B i) ≃ (Σ p : PhysicalMarkLists Ps J ell × PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)), B (((physicalSmallSelectedPlanEquiv C hC).symm p).1)) := ({ toFun := fun d => ⟨⟨d.1, d.2.1⟩, d.2.2⟩ invFun := fun d => ⟨d.1.1, d.1.2, d.2⟩ left_inv := by rintro ⟨_, _, _⟩; rfl right_inv := by rintro ⟨⟨_, _⟩, _⟩; rfl } : (Σ i : Fin n → I, PhysicalGroupSelectedData Ps ell (fun j => C (i j)) × B i) ≃ (Σ d : PhysicalSmallSelectedChoices Ps ell n C, B d.1)).trans (Equiv.sigmaCongrLeft' (physicalSmallSelectedPlanEquiv C hC)) noncomputable def physicalPathSmallPlanEquiv {N : ℕ} {P : Fin N → Finset ℕ} (small : Fin N → Prop) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : {g // small g}, C i.val g.val = ∅) : (PhysicalMarkLists P J ell × (Fin n → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell)) ≃ (Σ p : PhysicalMarkLists (fun g : {g // small g} => P g.val) J ell × PhysicalMixedSmallPlan (Ps := fun g : {g // small g} => P g.val) (J := J) (ell := ell) (I := patterns) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)), PhysicalGroupSelectedData (fun g : {g // ¬small g} => P g.val) ell (fun j g => C ((((physicalSmallSelectedPlanEquiv (fun (i : patterns) (g : {g // small g}) => C i.val g.val) hC).symm p).1 j).val) g.val)) := (physicalPathGroupSplitEquiv small patterns C).trans (physicalSmallSelectedCoupledEquiv (fun (i : patterns) (g : {g // small g}) => C i.val g.val) hC (fun i => PhysicalGroupSelectedData (fun g : {g // ¬small g} => P g.val) ell (fun j g => C (i j).val g.val))) end Bounty end section /- The decoded big schedule is the original fine word with its selected endpoints. -/ namespace Bounty variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell : ℕ} theorem physical_mixed_big_steps_cast {ks ks' : List (Option (V ⊕ K))} (h : ks = ks') (L : PhysicalMarkLists Ps J ell) (p : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) : physicalMixedBigSteps ks' L (cast (congrArg (PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I)) h) p) = physicalMixedBigSteps ks L p := by subst ks' rfl theorem physical_block_fine_steps_map {V' K' : Type} (bs : List (V × K)) (last : V) (f : V → V') (g : K → K') : (physicalBlockFineSteps bs last).map (Option.map (Sum.map f g)) = physicalBlockFineSteps (bs.map (fun b => (f b.1, g b.2))) (f last) := by simp [physicalBlockFineSteps, List.map_flatMap, List.flatMap_map] theorem physical_small_selected_arrays_cast {m n : ℕ} (h : m = n) (d : PhysicalSmallSelectedArrays Ps J ell m I) : cast (congrArg (fun n => PhysicalSmallSelectedArrays Ps J ell n I) h) d = ((fun j => d.1 (Fin.cast h.symm j)), (fun j => d.2.1 (Fin.cast (congrArg (fun n => n + 1) h.symm) j)), (fun j => d.2.2.1 (Fin.cast h.symm j)), (fun j => d.2.2.2 (Fin.cast h.symm j))) := by subst n rfl theorem physical_small_selected_fine_initial {n : ℕ} (d : PhysicalSmallSelectedArrays Ps J ell n I) : (physicalSmallSelectedFinePlanEquiv d).1 = d.2.1 0 := by simp only [physicalSmallSelectedFinePlanEquiv, physicalSmallSelectedBlockPlanEquiv, physicalSmallSelectedBlockEquiv, Equiv.trans_apply, Equiv.prodCongr_apply, Equiv.cast_apply, Equiv.coe_fn_mk, Prod.map_fst, Equiv.refl_apply] have hlen : n = (List.ofFn (fun j : Fin n => (j.castSucc, j))).length := by simp rw [physical_small_selected_arrays_cast hlen d] rfl theorem physical_small_selected_fine_big_steps {n : ℕ} (d : PhysicalSmallSelectedArrays Ps J ell n I) : physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (physicalSmallSelectedFinePlanEquiv d).1 (physicalSmallSelectedFinePlanEquiv d).2 = ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)).map (Option.map (Sum.map id (fun j => (j, d.1 j, physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc), physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ))))) := by rw [physical_small_selected_fine_initial] simp only [physicalSmallSelectedFinePlanEquiv, Equiv.trans_apply, Equiv.prodCongr_apply, Equiv.cast_apply, physicalSmallSelectedBlockPlanEquiv, physicalSmallSelectedBlockEquiv, physicalSmallBlockPlanEquiv, Equiv.coe_fn_mk, Prod.map_snd] have hlen : n = (List.ofFn (fun j : Fin n => (j.castSucc, j))).length := by simp rw [physical_small_selected_arrays_cast hlen d] rw [physical_mixed_big_steps_cast (physical_selected_fine_block_schedule n).symm] refine (physical_selected_big_block_schedule (Fin.last n) (List.ofFn (fun j : Fin n => (j.castSucc, j))) (fun j => d.1 (Fin.cast hlen.symm j)) (fun j => d.2.1 (Fin.cast (congrArg (fun n => n + 1) hlen.symm) j)) (fun j => d.2.2.1 (Fin.cast hlen.symm j)) (fun j => d.2.2.2 (Fin.cast hlen.symm j))).trans ?_ rw [physical_selected_fine_block_schedule, physical_block_fine_steps_map] simp only [List.map_ofFn, List.get_ofFn, id_eq] exact congrArg (fun bs => physicalBlockFineSteps bs (Fin.last n)) (List.ofFn_congr hlen (fun j : Fin n => (j.castSucc, (j, d.1 j, physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc), physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ))))).symm end Bounty end section /- Exact finite spatial decomposition and harmonic normalization of cross endpoints. -/ open Finset namespace Bounty theorem typeII_cross_slice_sum_singletons (M H Zs : Finset ℕ) (k : ℤ) (W : TypeIIShiftIndex → ℂ) (hM : ∀ m ∈ M, 0 < m) (hk : k ≠ 0) : (∑ y ∈ typeIICrossSlice M H Zs k, W y) = ∑ z ∈ Zs, ∑ y ∈ typeIICrossSlice M H {z} k, W y := by rw [typeII_cross_slice_sum_reindex M H Zs k W hM hk] apply sum_congr rfl intro z hz rw [typeII_cross_slice_sum_reindex M H {z} k W hM hk, sum_singleton] end Bounty end section /- The original endpoint formula on the window covered by the finite pool cutoff. -/ open Finset Filter open scoped ComplexConjugate namespace Bounty theorem eventually_candidate_cross_pair_eq_saturated_endpoints {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (X : ℝ), ∀ (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (σ : ℝ), (∀ p ∈ candidateRoughBand c L jStar, twist (candidateRoughSlot c L r jStar hr hj) p = typeIIPhase σ p) → ∀ (M : Finset ℕ) (α : ℕ → ℂ) (modulus : ℕ) (χ : DirichletCharacter ℂ modulus) (ρ ξ₁ ξ₂ ξ₃ : ℝ) (z w : ℕ), 0 < z → 0 < w → (z : ℝ) < X → (w : ℝ) < X → (∀ m ∈ M, 0 < m) → (∀ m ∈ M, Disjoint m.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) → (∀ m, m ∉ M → α m=0) → let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let H := candidateRetainedAllocationSupport c L r jStar (candidateSmallPSet c L X) take let W : ℕ → ℝ := fun n => markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p:ℝ)) (fun _ => 1) (n:ℤ) let cr := candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist let F₀ := invariantTripleEndpoint P (fun m => α m * χ (m : ZMod modulus) * typeIIPhase (ρ-ξ₂) m) (fun p => if p ∈ candidateRoughBand c L jStar then typeIIPhase (-σ) p else 0) (fun s => conj (cr s)) let G₀ := invariantTripleEndpoint P (fun m => α m * χ (m : ZMod modulus) * typeIIPhase (ξ₁+ρ) m) (fun p => if p ∈ candidateRoughBand c L jStar then typeIIPhase (-σ) p else 0) (fun s => conj (cr s)) typeIICrossPairCoefficient M H (fun m => α m * χ (m : ZMod modulus)) W (fun h => candidateRemainingComplexCoefficient c L r jStar take twist (primePoolFreePart P h)) ρ ξ₁ ξ₂ ξ₃ z w = typeIIPhase (ρ+ξ₃) z * typeIIPhase (-ρ) w * conj (F₀ z) * G₀ w * (W z : ℂ) * (W w : ℂ) := by filter_upwards [eventually_candidate_cross_pair_eq_cutoff_endpoints hc] with L hL intro q r jStar hr hj X take hkeep twist σ hphase M α modulus χ ρ ξ₁ ξ₂ ξ₃ z w hz hw hzX hwX hM hfree hα have he := hL q r jStar hr hj (candidateSmallPSet c L X) (fun p hp => ((mem_candidateSmallPSet_iff c L X p).mp hp).2) take hkeep twist σ hphase M α modulus χ ρ ξ₁ ξ₂ ξ₃ z w hz hw hM hfree hα dsimp only at he ⊢ rw [candidate_retained_cutoff_weight_eq_of_lt c L q X hz hzX, candidate_retained_cutoff_weight_eq_of_lt c L q X hw hwX] at he exact he end Bounty end section /- The actual ambient rough discrepancy discharges the last analytic low-factor premise. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- The actual ambient prime discrepancy discharges the last analytic low-factor premise. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- Literal endpoint phases agree with the coefficient convention used by the integral theorem. -/ open Finset namespace Bounty theorem character_typeIIPhase_norm_le {q : ℕ} (χ : DirichletCharacter ℂ q) (τ : ℝ) (n : ℕ) : ‖χ (n : ZMod q)*typeIIPhase τ n‖ ≤ 1 := by rw [norm_mul,typeIIPhase_norm,mul_one] exact χ.norm_le_one _ theorem typeIIPhase_harmonic_mellin_shift (σ u : ℝ) (n : ℕ) : typeIIPhase σ n*harmonicMellinWeight u n = harmonicMellinWeight (u+σ) n := by unfold typeIIPhase harmonicMellinWeight rw [← mul_div_assoc,← Complex.exp_add] congr 2 push_cast ring theorem ambient_rough_original_phase_coefficient (γ L S a v ν : ℝ) {q : ℕ} (χ : DirichletCharacter ℂ q) {n : ℕ} (hn : 0 < n) : (ambientRoughIntervalTypeIIAlpha γ L S a v n : ℂ)*χ (n : ZMod q)*typeIIPhase ν n = ambientRoughMellinCoefficient γ L S a v ν χ n := by rw [typeIIPhase_eq_cpow ν hn] rfl theorem ambient_prime_original_phase_coefficient (κ L S ν : ℝ) {q : ℕ} (χ : DirichletCharacter ℂ q) {n : ℕ} (hn : 0 < n) : (ambientPrimeTypeIIAlpha κ L S n : ℂ)*χ (n : ZMod q)*typeIIPhase ν n = ambientPrimeMellinCoefficient κ L S ν χ n := by rw [typeIIPhase_eq_cpow ν hn] rfl end Bounty end section /- Conditional end-to-end reduction: the ambient weighted replacement hypothesis remains explicit. -/ namespace Bounty end Bounty end section /- A fixed-slot replacement interface at only the parameters needed by the target. -/ open Finset Filter namespace Bounty /- An explicit remaining analytic hypothesis, restricted to q=1/2 and r≥6. The precision may depend on the fixed rough slot. -/ def CandidateHalfFixedSlotReplacement : Prop := ∀ (c : ℝ) (r : ℕ), 0 lhs; rw [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 ring rw [ambient_prime_proxy_error_eq_typeII hL0.le] calc _ ≤ _ := abs_add_le _ _ _ ≤ 2*(Real.exp L * L^(-(D+1))) := by linarith [hf,ht] _ ≤ L*(Real.exp L * L^(-(D+1))) := mul_le_mul_of_nonneg_right hL (by positivity) _ = Real.exp L * (L*L^(-(D+1))) := by ring _ = _ := by rw [hid] end Bounty end section /- At the actual encoded big source, the small residue ledger advances by the original effective multiplier times the original big divisor. -/ open scoped Classical namespace Bounty section Encoded variable {S I V K : Type} [Fintype S] {N J ell B : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : K → I → ℤ) (t : K) (i : I) (Ls Rs : PhysicalMarkLists Ps J ell) (r : PhysicalResidues Ps) (Lb : PhysicalMarkLists P J ell) (memory : ∀ g, BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : P g => p.val)) B) (e : PhysicalPlannedResidueEvent (V := V) (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i => physicalMixedEdgeDelta (C i) (k t i)) (fun _ i => physicalMixedEdgeD (C i)) (some (.inr (t, i, Ls, Rs))) (physicalFullMemoryState (C i) Lb memory)) end Encoded end Bounty end section /- The original small residue phase is preserved by exact transport of the planned big events. Both the auxiliary labels and the ledger are retained. -/ open scoped Classical namespace Bounty section Transport variable {S G I V K : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ Δ' D D' : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (hΔ : ∀ k i d, Δ k i d = Δ' k i d) (hD : ∀ k i d c a g p, (n g p : ℤ) ∣ D k i d c a g ↔ (n g p : ℤ) ∣ D' k i d c a g) noncomputable def physicalPlannedParameterEventEquiv (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : PhysicalPlannedResidueEvent n shared B A Δ D tag x ≃ PhysicalPlannedResidueEvent n shared B A Δ' D' tag x := fullPermutationParameterEventEquiv n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) (fun key => Δ' key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) (fun key => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) (fun key => D' key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) (fun key => hΔ key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) (fun key => hD key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) tag x noncomputable def physicalPlannedParameterPathEquiv (steps : List (Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : FiniteEventPath (PhysicalPlannedResidueEvent n shared B A Δ D) (physicalPlannedResidueTarget n shared B A Δ D) steps x ≃ FiniteEventPath (PhysicalPlannedResidueEvent n shared B A Δ' D') (physicalPlannedResidueTarget n shared B A Δ' D') steps x := fullPermutationParameterPathEquiv n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) (fun key => Δ' key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) (fun key => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) (fun key => D' key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) (fun key => hΔ key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) (fun key => hD key.1 key.2.1 (physicalSharedPrefix key.2.2.1)) steps x variable (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) theorem physical_planned_small_update_transport (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (r : PhysicalResidues Ps) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalPlannedResidueEvent n shared B A Δ D tag x) : physicalPlannedSmallUpdate n shared B A Δ' D' kbig tag r x (physicalPlannedParameterEventEquiv n shared B A Δ Δ' D D' hΔ hD tag x e) = physicalPlannedSmallUpdate n shared B A Δ D kbig tag r x e := by cases tag with | none => rfl | some tag => cases tag with | inl v => rfl | inr key => dsimp only [physicalPlannedSmallUpdate, physicalPlannedParameterEventEquiv, fullPermutationParameterEventEquiv] erw [full_active_parameter_auxiliary] theorem physical_planned_small_phase_transport (Vs : S → ℝ) (qedge : K → ℝ) (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (r : PhysicalResidues Ps) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalPlannedResidueEvent n shared B A Δ D tag x) : physicalPlannedSmallPhase n shared B A Δ' D' kbig Vs qedge tag r x (physicalPlannedParameterEventEquiv n shared B A Δ Δ' D D' hΔ hD tag x e) = physicalPlannedSmallPhase n shared B A Δ D kbig Vs qedge tag r x e := by cases tag with | none => rfl | some tag => cases tag with | inl v => rfl | inr key => dsimp only [physicalPlannedSmallPhase] rw [physical_planned_small_update_transport] theorem physical_planned_small_ledger_transport (Vs : S → ℝ) (qedge : K → ℝ) (steps : List (Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)))) (r : PhysicalResidues Ps) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FiniteEventPath (PhysicalPlannedResidueEvent n shared B A Δ D) (physicalPlannedResidueTarget n shared B A Δ D) steps x) : deterministicLedgerPhase (PhysicalPlannedResidueEvent n shared B A Δ' D') (physicalPlannedResidueTarget n shared B A Δ' D') (physicalPlannedSmallUpdate n shared B A Δ' D' kbig) (physicalPlannedSmallPhase n shared B A Δ' D' kbig Vs qedge) steps r x (physicalPlannedParameterPathEquiv n shared B A Δ Δ' D D' hΔ hD steps x p) = deterministicLedgerPhase (PhysicalPlannedResidueEvent n shared B A Δ D) (physicalPlannedResidueTarget n shared B A Δ D) (physicalPlannedSmallUpdate n shared B A Δ D kbig) (physicalPlannedSmallPhase n shared B A Δ D kbig Vs qedge) steps r x p := by exact deterministic_ledger_phase_equiv _ _ _ _ id _ _ _ _ (physical_planned_small_update_transport n shared B A Δ Δ' D D' hΔ hD kbig) _ _ (physical_planned_small_phase_transport n shared B A Δ Δ' D D' hΔ hD kbig Vs qedge) steps r x p theorem physical_mixed_plan_small_factor_transport (Vs : S → ℝ) (qedge : K → ℝ) (ks : List (Option (V ⊕ K))) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) : (physicalMixedPlanSmallFactor n shared B A Δ D kbig Vs qedge ks r L pl x p : ℂ) = deterministicLedgerPhase (PhysicalPlannedResidueEvent n shared B A Δ' D') (physicalPlannedResidueTarget n shared B A Δ' D') (physicalPlannedSmallUpdate n shared B A Δ' D' kbig) (physicalPlannedSmallPhase n shared B A Δ' D' kbig Vs qedge) (physicalMixedBigSteps ks L pl) r x (physicalPlannedParameterPathEquiv n shared B A Δ Δ' D D' hΔ hD (physicalMixedBigSteps ks L pl) x p) := by rw [physical_planned_small_ledger_transport, physical_mixed_plan_small_factor_eq_ledger] end Transport end Bounty end section /- Arbitrary power saving survives the full original prime-pattern and auxiliary average. -/ open Filter Finset Real open scoped Classical namespace Bounty theorem eventually_candidate_pattern_harmonic_decay {c b K q x : ℝ} (hc : 0 < c) (hb : 0 < b) (hK : 0 ≤ K) (hq : 0 ≤ q) (hx : 0 ≤ x) (J ell : ℕ) (Cenv D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → ∀ (probes : groups → Finset (Fin J)) (r t : Finset groups) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ), (Q : ℝ) ≤ L^q → L^(-x) ≤ ξ → ∀ (a a' : ℝ) (pool : Finset ℕ), (∀ g : groups, candidatePBand (c*L) g.val ⊆ pool) → ∀ (α β γ α' β' γ' : ℕ → ℂ), (∀ n, ‖α n‖ ≤ L^Cenv) → (∀ n, ‖β n‖ ≤ L^Cenv) → (∀ n, ‖γ n‖ ≤ L^Cenv) → (∀ n, ‖α' n‖ ≤ L^Cenv) → (∀ n, ‖β' n‖ ≤ L^Cenv) → (∀ n, ‖γ' n‖ ≤ L^Cenv) → ∀ U V : ℝ, exp (b*L) ≤ U → U ≤ exp L → exp (b*L) ≤ V → V ≤ exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ‖∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels (fun g : groups => candidatePBand (c*L) g.val) (repeatedBigPrimePatternCut probes r t i), (physicalAuxMass (fun g : groups => ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) (repeatedBigPrimePatternCut probes r t i) aux : ℂ)* physicalPositiveHarmonicDifference (fun g : groups => candidatePBand (c*L) g.val) (fun g => ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) probes r t hrt Q h ξ i aux a a' (typeIISmoothDyadicScale U V (U*L^(-K)) j) k pool α β γ α' β' γ'‖ ≤ L^(-D) := by obtain ⟨v, A, hv, hA, hinputs⟩ := exists_candidate_shared_error_inputs hc J let Acard := A*log 2+1 filter_upwards [hinputs, eventually_ge_atTop (2 : ℝ), eventually_candidate_harmonic_replacement_decay hc hb hK J ell Cenv (4*q+2*x) (D+Acard)] with L hinput hL hbase intro groups hgroups probes r t hrt Q h ξ hQ hξ a a' pool hpool α β γ α' β' γ' hα hβ hγ hα' hβ' hγ' U V hUlo hUhi hVlo hVhi k hk j hj have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hξ0 : 0 < ξ := (rpow_pos_of_pos hL0 (-x)).trans_le hξ have hmass : ∀ g : groups, 0 < ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ) := fun g => hv.trans_le ((hinput groups hgroups).2 g).1 have hslots : ((J*Fintype.card groups : ℕ) : ℝ) ≤ A*log L := by simpa only [Fintype.card_coe] using (hinput groups hgroups).1 have hcard : (Fintype.card (RepeatedBigPrimePatternIndex (ell := ell) probes r t) : ℝ) ≤ L^Acard := harmonic_pattern_card_power probes r t hrt hL hA hslots apply physical_pattern_error_power (fun g : groups => ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) hmass (fun _ => rfl) probes r t hL0 hcard intro i aux exact hbase groups hgroups probes r t hrt Q h ξ hξ0 i aux (harmonic_pattern_bound_power probes r t hL1 hq hx Q hQ hξ i) a a' pool hpool α β γ α' β' γ' hα hβ hγ hα' hβ' hγ' U V hUlo hUhi hVlo hVhi k hk j hj end Bounty end section /- Arbitrary precision at a fixed polynomial Mellin radius for the original harmonic sum. -/ open Filter Finset MeasureTheory Real namespace Bounty end Bounty end section /- Exact finite weighted averaging of the common-cell harmonic Mellin representation. -/ open Finset MeasureTheory namespace Bounty section variable {ι : Type*} {Z H : ℝ} (hZ : 0 < Z) (hH : 0 < H) (I : Finset ι) (c : ι → ℂ) (d : ι → ℕ) (hscale : ∀ i ∈ I, c i ≠ 0 → H ≤ (d i : ℝ) ∧ (d i : ℝ) ≤ Real.exp 2*H) include ι Z H hZ hH I c d hscale theorem harmonic_cell_family_integrable (a b : ℝ) (k : ℤ) (F G : ℤ → ℂ) : Integrable (fun v : ℝ => harmonicLogFourier v * ∑ i ∈ I, c i*physicalPhase (-(a+b+2*Real.pi*v)) (d i)* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d i : ℤ)) F G) := by have hi : ∀ i ∈ I, Integrable (fun v : ℝ => c i * (harmonicLogFourier v*physicalPhase (-(a+b+2*Real.pi*v)) (d i)* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d i : ℤ)) F G)) := by intro i hi by_cases hc : c i = 0 · simp only [hc,zero_mul] exact integrable_zero _ _ _ · have hd : d i ≠ 0 := by have hp : (0 : ℝ) < d i := hH.trans_le (hscale i hi hc).1 exact_mod_cast hp.ne' exact (harmonic_cell_weighted_pairing_integrable (mul_pos hZ hH) hZ.ne' hd a b (k*(d i : ℤ)) F G).const_mul (c i) apply (integrable_finsetSum I hi).congr filter_upwards [] with v rw [mul_sum] apply sum_congr rfl intro i hi ring theorem harmonic_cell_family_sum_eq_mellin {k : ℤ} (hk : |(k : ℝ)| ≤ Z/4) (a b : ℝ) (F G : ℤ → ℂ) : (∑ i ∈ I, c i * (physicalPhase (-(a+b)) (d i) * ∑ n ∈ harmonicPositiveSupport Z k (d i), ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d i : ℝ))) : ℂ)/(n : ℂ))* physicalPhase a n.natAbs*physicalPhase b (n+k*(d i : ℤ)).natAbs* star (F n)*G (n+k*(d i : ℤ)))) = ((Z*H : ℝ) : ℂ)⁻¹ * ∫ v : ℝ, harmonicLogFourier v * ∑ i ∈ I, c i*physicalPhase (-(a+b+2*Real.pi*v)) (d i)* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d i : ℤ)) F G := by classical let f : ι → ℝ → ℂ := fun i v => harmonicLogFourier v * (c i*physicalPhase (-(a+b+2*Real.pi*v)) (d i)* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d i : ℤ)) F G) have hi : ∀ i ∈ I, Integrable (f i) := by intro i hi have ht := harmonic_cell_family_integrable hZ hH {i} c d (by intro j hj hc have hj' : j = i := mem_singleton.mp hj subst j exact hscale i hi hc) a b k F G simpa only [sum_singleton] using ht calc _ = ((Z*H : ℝ) : ℂ)⁻¹ * ∑ i ∈ I, ∫ v : ℝ, f i v := by rw [mul_sum] apply sum_congr rfl intro i hi by_cases hc : c i = 0 · simp only [f,hc,zero_mul,mul_zero,integral_zero] · rw [harmonic_cell_sum_eq_mellin hZ hH (hscale i hi hc).1 (hscale i hi hc).2 hk a b F G] have hf : f i = fun v : ℝ => c i * (harmonicLogFourier v*physicalPhase (-(a+b+2*Real.pi*v)) (d i)* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d i : ℤ)) F G) := by funext v dsimp only [f] ring rw [hf,integral_const_mul] ring _ = ((Z*H : ℝ) : ℂ)⁻¹ * ∫ v : ℝ, ∑ i ∈ I, f i v := by rw [integral_finsetSum I hi] _ = _ := by congr 1 apply integral_congr_ae filter_upwards [] with v exact (mul_sum ..).symm end end Bounty end section /- Frequency-uniform total Fourier energies for the actual candidate endpoint functions. -/ open Filter Finset Real namespace Bounty end Bounty end section /- Individual candidate selected and peeled source and target energies. -/ open Filter Finset Real namespace Bounty theorem exists_candidate_harmonic_single_energy {c : ℝ} (hc : 0 < c) (J ell : ℕ) (Cb Ce : ℝ) : ∃ T : ℝ, ∀ᶠ L : ℝ in atTop, ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → ∀ (cut : groups → Finset (Fin J)) (big : Finset groups) (g : groups) (κ : ℕ), ell+(cut g).card = κ+1 → g ∉ big → ∀ (b₀ : GroupMarkedLists (fun j : big => candidatePBand (c*L) j.val.val) (fun j : big => ell+(cut j.val).card) → ℂ), (∀ l, ‖b₀ l‖ ≤ L^Cb) → ∀ (pool : Finset ℕ), (∀ j : groups, candidatePBand (c*L) j.val ⊆ pool) → ∀ (α β γ : ℕ → ℂ), (∀ n, ¬ Disjoint n.primeFactors pool → α n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β n = 0) → (∀ n, ‖α n‖ ≤ L^Ce) → (∀ n, ‖β n‖ ≤ L^Ce) → (∀ n, ‖γ n‖ ≤ L^Ce) → ∀ Y : ℝ, 1 ≤ Y → log Y ≤ 6*L → ∀ Z a b v : ℝ, let P := fun j : groups => candidatePBand (c*L) j.val let mass := fun j : groups => ∑ p ∈ P j, 1/(p : ℝ) let marks := fun j : groups => ell+(cut j).card let F := fun n : ℤ => selectedMarkedEndpoint P (1/2) mass marks big b₀ pool α β γ n.natAbs let G := fun n : ℤ => selectedPeeledEndpoint P (1/2) mass marks g κ big b₀ pool α β γ n.natAbs ((∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖^2) ≤ Y*L^T ∧ (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellTarget Y b F n‖^2) ≤ Y*L^T) ∧ ((∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v G n‖^2) ≤ Y*L^T ∧ (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellTarget Y b G n‖^2) ≤ Y*L^T) := by obtain ⟨T,hT⟩ := exists_candidate_harmonic_cutoff_energy hc J ell Cb Ce refine ⟨T+1,?_⟩ filter_upwards [hT,eventually_ge_atTop (8:ℝ)] with L hT hL intro groups hgroups cut big g κ hκ hg b₀ hb₀ pool hpool α β γ hαfree hβfree hα hβ hγ Y hY hlogY Z a b v have h := hT groups hgroups cut big g κ hκ hg b₀ b₀ hb₀ hb₀ pool hpool α β γ α β γ hαfree hβfree hαfree hβfree hα hβ hγ hα hβ hγ Y hY hlogY 0 dsimp only at h ⊢ have hYp : 0 < Y := zero_lt_one.trans_le hY constructor · apply harmonic_single_energies_of_self_cutoff hYp hL Z a b v simpa only [add_zero] using h.1 · apply harmonic_single_energies_of_self_cutoff hYp hL Z a b v simpa only [add_zero] using h.2 end Bounty end section /- Fixed-radius cutoff tails have arbitrary integrated precision on retained full boxes. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- Minor cancellation for the literal auxiliary cell/character summand with the exact Mellin frequency -(a+b+2*pi*v) from harmonic cutoff separation. -/ open Finset Filter open scoped Classical namespace Bounty theorem exists_candidate_actual_cell_mellin_minor {c : ℝ} (hc : 0 < c) (J : ℕ) (Rsave : ℝ) : ∃ q : ℝ, 0 ≤ q ∧ ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → let P := fun g : S => candidatePBand (c*L) g.val let V := fun g : S => ∑ p ∈ P g, 1/(p : ℝ) ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r t : Finset S) (A B : Finset (RepeatedBigFlatIndex S J ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → A.Nonempty → B ⊆ t.sigma (repeatedBigPrimeProbeSlots probes) → B.Nonempty → ∀ (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex S J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (Q : ℕ) (h : ℝ), 0 < h → ∀ (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (a b v θ : ℝ), θ ∉ productMajorArcSet k L q (Real.exp (((d : ℝ)-1)*h)) (Real.exp (((e : ℝ)-1)*h)) → ‖∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * ((starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1) * (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2)) * physicalPhase (-(a+b+2*Real.pi*v)) (physicalFreeFactor (repeatedBigAuxCut A B) aux) * fourier (-(k * (physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ))) (θ : AddCircle (1 : ℝ))‖ ≤ L^(-Rsave) := by obtain ⟨q, hq, hminor⟩ := exists_candidate_cell_minor_bound hc J Rsave refine ⟨q, hq, ?_⟩ filter_upwards [hminor, eventually_candidate_subset_product_range hc (ε := 1) (by norm_num) J] with L hm hrange intro S hS P V ell probes r t A B hA hAne hB hBne hU hAB k Q h hh d e χ ψ a b v θ hθ let ζ := -(a+b+2*Real.pi*v) have hposA (x : ∀ i : A, P i.val.1) : 0 < ∏ i, (x i).val := by have hb := (hrange S hS ell probes r A hA hAne x).1 have hp := (Real.exp_pos _).trans_le hb exact_mod_cast hp have hposB (y : ∀ i : B, P i.val.1) : 0 < ∏ i, (y i).val := by have hb := (hrange S hS ell probes t B hB hBne y).1 have hp := (Real.exp_pos _).trans_le hb exact_mod_cast hp rw [← physical_aux_mellin_multiplier_split P V A B hU hAB k (fun x => (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x)) (fun y => (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y)) hposA hposB ζ θ] exact hm S hS ell probes r t A B hA hAne hB hBne hU hAB k _ _ (prime_cell_phased_conjugate_norm _ h d χ ζ) (prime_cell_phased_conjugate_norm _ h e ψ ζ) (Real.exp (((d : ℝ)-1)*h)) (Real.exp (((e : ℝ)-1)*h)) (Real.exp_pos _).le (Real.exp_pos _).le (fun x hx => (prime_cell_phased_conjugate_range _ hh d χ ζ x (hposA x) hx).1.le) (fun y hy => (prime_cell_phased_conjugate_range _ hh e ψ ζ y (hposB y) hy).1.le) θ hθ end Bounty end section /- An equal schedule preserves the complete signed weight with its history. -/ open scoped Classical namespace Bounty section Schedule variable {I K : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (retention : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_full_signed_weight_schedule_cast {steps steps' : List (Option (I ⊕ K))} (h : steps = steps') (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps x) : physicalFullSignedWeight C k ω β retention ρ V steps' x (cast (congrArg (fun ks => FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ks x) h) p) = physicalFullSignedWeight C k ω β retention ρ V steps x p := by cases h rfl end Schedule end Bounty end section /- Square energy of central window averages with an arbitrary base frequency. -/ open Finset MeasureTheory namespace Bounty theorem harmonic_window_truncated_square (a b Y R w : ℝ) {P : ℝ → ℂ} {M E : ℝ} (hP : Continuous P) (hM : 0 ≤ M) (hPM : ∀ s, ‖P s‖ ≤ M) (hE : ∀ u, ‖u‖ ≤ R → (∫ s in Set.Icc a b, ‖P (s+w+2*Real.pi*u)‖^2) ≤ E) : IntegrableOn (fun s => ‖∫ u in {u : ℝ | ‖u‖ ≤ R}, harmonicWindowLogFourier u * physicalMellinPhase (-2*Real.pi*u) Y * P (s+w+2*Real.pi*u)‖^2) (Set.Icc a b) ∧ (∫ s in Set.Icc a b, ‖∫ u in {u : ℝ | ‖u‖ ≤ R}, harmonicWindowLogFourier u * physicalMellinPhase (-2*Real.pi*u) Y * P (s+w+2*Real.pi*u)‖^2) ≤ (∫ u in {u : ℝ | ‖u‖ ≤ R}, ‖harmonicWindowLogFourier u‖)^2 * E := by have hκc : Continuous (fun u => harmonicWindowLogFourier u * physicalMellinPhase (-2*Real.pi*u) Y) := by apply harmonicWindowLogFourier.continuous.mul unfold physicalMellinPhase fun_prop have hκi := physical_mellin_phase_integrable harmonicWindowLogFourier (fun u => -2*Real.pi*u) harmonic_window_log_fourier_integrable (by fun_prop) Y have hs : MeasurableSet {u : ℝ | ‖u‖ ≤ R} := (isClosed_le continuous_norm continuous_const).measurableSet have hEA : ∀ᵐ u ∂(volume.restrict {u : ℝ | ‖u‖ ≤ R}), (∫ s in Set.Icc a b, ‖P ((s+2*Real.pi*u)+w)‖^2) ≤ E := by filter_upwards [ae_restrict_mem hs] with u hu simpa only [add_right_comm] using hE u hu have hPc : Continuous (fun s => P (s+w)) := hP.comp (continuous_id.add continuous_const) have ht := integrated_translate_average_square_ae (volume.restrict (Set.Icc a b)) (volume.restrict {u : ℝ | ‖u‖ ≤ R}) (2*Real.pi) hκc hκi.integrableOn hPc hM (fun s => hPM (s+w)) hEA simpa only [IntegrableOn,norm_mul,physical_mellin_phase_norm,mul_one,add_right_comm] using ht theorem harmonic_normalized_four_box_truncated_energy (a b Y R E w : ℝ) (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (hD : ∀ d ∈ D, 0 < d) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ b ∈ B, 0 < b) (hC : ∀ c ∈ C, 0 < c) (henergy : ∀ u, ‖u‖ ≤ R → (∫ s in Set.Icc a b, ‖(∑ d ∈ D, δ d * harmonicMellinWeight (s+w+2*Real.pi*u) d) * (∑ a ∈ A, α a * harmonicMellinWeight (s+w+2*Real.pi*u) a) * (∑ b ∈ B, β b * harmonicMellinWeight (s+w+2*Real.pi*u) b) * (∑ c ∈ C, γ c * harmonicMellinWeight (s+w+2*Real.pi*u) c)‖^2) ≤ E) : let Q := fun s => ∫ u in {u : ℝ | ‖u‖ ≤ R}, harmonicWindowLogFourier u * physicalMellinPhase (-2*Real.pi*u) Y * ((∑ d ∈ D, δ d * harmonicMellinWeight (s+w+2*Real.pi*u) d) * (∑ a ∈ A, α a * harmonicMellinWeight (s+w+2*Real.pi*u) a) * (∑ b ∈ B, β b * harmonicMellinWeight (s+w+2*Real.pi*u) b) * (∑ c ∈ C, γ c * harmonicMellinWeight (s+w+2*Real.pi*u) c)) IntegrableOn (fun s => ‖Q s‖^2) (Set.Icc a b) ∧ (∫ s in Set.Icc a b, ‖Q s‖^2) ≤ (∫ u in {u : ℝ | ‖u‖ ≤ R}, ‖harmonicWindowLogFourier u‖)^2 * E := by let P : ℝ → ℂ := fun s => (∑ d ∈ D, δ d * harmonicMellinWeight s d) * (∑ a ∈ A, α a * harmonicMellinWeight s a) * (∑ b ∈ B, β b * harmonicMellinWeight s b) * (∑ c ∈ C, γ c * harmonicMellinWeight s c) let M : ℝ := (∑ d ∈ D, ‖δ d‖) * (∑ a ∈ A, ‖α a‖) * (∑ b ∈ B, ‖β b‖) * (∑ c ∈ C, ‖γ c‖) have hc (S : Finset ℕ) (f : ℕ → ℂ) : Continuous (fun s : ℝ => ∑ n ∈ S, f n * harmonicMellinWeight s n) := by unfold harmonicMellinWeight fun_prop have hP : Continuous P := ((hc D δ).mul (hc A α)).mul (hc B β) |>.mul (hc C γ) have hPM (s : ℝ) : ‖P s‖ ≤ M := by have hb (S : Finset ℕ) (f : ℕ → ℂ) (hS : ∀ n ∈ S, 0 < n) : ‖∑ n ∈ S, f n * harmonicMellinWeight s n‖ ≤ ∑ n ∈ S, ‖f n‖ := by simpa only [mul_comm,div_one] using finite_mellin_norm_le_mass S f s 1 zero_lt_one (fun n hn => by exact_mod_cast (Nat.succ_le_iff.mpr (hS n hn))) dsimp only [P,M] simp only [norm_mul] exact mul_le_mul (mul_le_mul (mul_le_mul (hb D δ hD) (hb A α hA) (norm_nonneg _) (by positivity)) (hb B β hB) (norm_nonneg _) (by positivity)) (hb C γ hC) (norm_nonneg _) (by positivity) have ht := harmonic_window_truncated_square a b Y R w hP (show 0 ≤ M by dsimp [M]; positivity) hPM henergy exact ht end Bounty end section /- The exact harmonic source inherits retained-box Mellin energy estimates. -/ open Finset Filter MeasureTheory namespace Bounty noncomputable def commonSourceBoxKernel (Y a v c t : ℝ) (n : ℕ) : ℂ := (harmonicCommonCutoff ((n : ℝ)/Y) : ℂ) / (n : ℂ) * (physicalMellinPhase (t-a-v) n * Complex.exp (Complex.I * (2*Real.pi*(c*n) : ℝ))) theorem eventually_common_source_mellin_of_boxes : ∀ᶠ L : ℝ in atTop, ∀ (μ : Measure ℝ) (Y Z a v c : ℝ), 1 ≤ Y → Real.log Y ≤ 6*L → 0 < Z → ∀ (F : ℤ → ℂ) (δ α β γ : ℕ → ℂ), (∀ n ∈ (harmonicCommonSupport Y).image Int.natAbs, F n = endpointFourConvolution δ α β γ n) → ∀ E : ℝ, 0 ≤ E → let S := (harmonicCommonSupport Y).image Int.natAbs let N := ⌈4*Real.exp 2*Y⌉₊ (∀ i ∈ dyadicNatIndices (Icc 1 N), ∀ j ∈ dyadicNatIndices (Icc 1 N), ∀ k ∈ dyadicNatIndices (Icc 1 N), ∀ l ∈ dyadicNatIndices (Icc 1 N), retainedFourDyadicBox S N i j k l → Integrable (fun t => ‖fourDyadicBoxSum N δ α β γ (commonSourceBoxKernel Y a v c t) i j k l‖ ^ 2) μ) → (∀ i ∈ dyadicNatIndices (Icc 1 N), ∀ j ∈ dyadicNatIndices (Icc 1 N), ∀ k ∈ dyadicNatIndices (Icc 1 N), ∀ l ∈ dyadicNatIndices (Icc 1 N), retainedFourDyadicBox S N i j k l → (∫ t, ‖fourDyadicBoxSum N δ α β γ (commonSourceBoxKernel Y a v c t) i j k l‖ ^ 2 ∂μ) ≤ E) → (∫ t, ‖localMellinPolynomial S (fun n => harmonicCellSource Y Z a v F n * fourier (n : ℤ) (c : AddCircle (1 : ℝ))) t‖ ^ 2 ∂μ) ≤ Y ^ 2 * (L ^ 9 * E) := by filter_upwards [eventually_harmonic_four_dyadic_energy (Ω := ℝ)] with L hboxes intro μ Y Z a v c hY hlog hZ F δ α β γ hF E hE0 S N hf hE have hYp : 0 < Y := by linarith have hb := hboxes μ Y hY hlog δ α β γ (fun t n => physicalMellinPhase (t-a-v) n * Complex.exp (Complex.I * (2*Real.pi*(c*n) : ℝ))) E hE0 hf hE have heq (t : ℝ) : (∑ n ∈ S, F n * ((harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)/(n : ℂ)) * physicalMellinPhase (t-a-v) n * Complex.exp (Complex.I * (2*Real.pi*(c*n) : ℝ))) = ∑ n ∈ S, endpointFourConvolution δ α β γ n * commonSourceBoxKernel Y a v c t n := by apply sum_congr rfl intro n hn rw [hF n hn] unfold commonSourceBoxKernel ring rw [common_source_mellin_energy μ hYp hZ a v c F] change Y ^ 2 * (∫ t, ‖∑ n ∈ S, F n * ((harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)/(n : ℂ)) * physicalMellinPhase (t-a-v) n * Complex.exp (Complex.I * (2*Real.pi*(c*n) : ℝ))‖ ^ 2 ∂μ) ≤ _ simp_rw [heq] exact mul_le_mul_of_nonneg_left hb (sq_nonneg Y) end Bounty end section /- Radius-generalized companion; only the separate R <= exp L assumption is removed. The actual ambient prime discrepancy discharges the last analytic low-factor premise. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_ambient_prime_four_factor_integral_decay_log_radius (hZ : PrimitiveZeroFreeHalfPlane) {a beta c d Bcoeff A As H Et aLong : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hd : 0 < d) (hBcoeff : 1 ≤ Bcoeff) (hAs0 : 0 ≤ As) (haLong : 0 < aLong) (hAs : A+2*Et+21 ≤ 2*As) (hH : A+2*Et+23 ≤ 2*H) (Tmod Sshift Cmod Sfreq : ℝ) : ∃ B0 : ℝ, 0 < B0 ∧ ∀ Bsave : ℝ, A+B0+2*Et+7 ≤ 2*Bsave → ∀ S : ℝ, 0 ≤ S → max (max B0 Sfreq) Cmod+Bsave+5 ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R : ℝ), 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ c*L → Real.exp (L^a)/2 ≤ P → P ≤ Real.exp (L^beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → (∀ p : s, ‖coeff p‖ ≤ Bcoeff) → ∀ (lo hi : ℕ) (F : Finset ℕ) (γT : ℕ → ℂ) (UM UT BT : ℝ), 0 < UM → 1 ≤ UT → 0 ≤ BT → BT ≤ L^Et → (∀ n ∈ F, ‖γT n‖ ≤ BT) → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (q : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ c*L → (∫ u in Set.Icc (-R) R, ‖primeReciprocalPolynomial s coeff u * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u+σ) n*χ (n : ZMod q))* (∑ n ∈ Ioc lo hi, ambientPrimeMellinCoefficient κM L S ν χM n*harmonicMellinWeight u n)* (∑ n ∈ F, γT n*harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨B0,hB0,hmain⟩ := exists_literal_four_factor_integral_decay_log_radius (E := Et) ha ha1 hbeta hc hd hBcoeff hAs0 haLong hAs hH Tmod Sshift refine ⟨B0,hB0,?_⟩ intro Bsave hsave S hS hprecision filter_upwards [hmain Bsave hsave, eventually_ambient_prime_mellin_low_factor hZ hS hB0.le hprecision] with L hdecay hlow intro s hs coeff Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp hcoeff lo hi F γT UM UT BT hUM hUT hBT hBTpow hγT hMband hFband κM ν qM hqMInst χM hκ hκmax hqM hν UQ Alo Blo σ q hqInst χ hUQ hQA hAB hBQ hq hσ hmeanScale hresScale hlog have hM := hlow κM hκ hκmax qM χM hqM ν hν apply hdecay s hs coeff Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp hcoeff (Ioc lo hi) F (ambientPrimeMellinCoefficient κM L S ν χM) γT UM UT 1 BT hUM hUT zero_le_one hBT (by simpa only [one_mul] using hBTpow) hBTpow (fun n hn => hM.1 n ((Nat.zero_le lo).trans_lt (mem_Ioc.mp hn).1)) hγT hMband hFband UQ Alo Blo σ q χ hUQ hQA hAB hBQ hq hσ hmeanScale hresScale hlog intro u _ hu exact hM.2 u hu lo hi end Bounty end section /- Radius-generalized companion; only the separate R <= exp L assumption is removed. The actual ambient rough discrepancy discharges the last analytic low-factor premise. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_ambient_rough_four_factor_integral_decay_log_radius (hZ : PrimitiveZeroFreeHalfPlane) {a beta c d Bcoeff A As H Et aLong γrough vMax : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hd : 0 < d) (hBcoeff : 1 ≤ Bcoeff) (hAs0 : 0 ≤ As) (haLong : 0 < aLong) (hγ : 0 < γrough) (hv : vMax < 1) (hAs : A+2*Et+21 ≤ 2*As) (hH : A+2*Et+23 ≤ 2*H) (Tmod Sshift Cmod Sfreq : ℝ) : ∃ B0 : ℝ, 0 < B0 ∧ ∀ Bsave : ℝ, A+B0+2*Et+7 ≤ 2*Bsave → ∀ S : ℝ, 0 ≤ S → max (max B0 Sfreq) Cmod+Bsave+5 ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R : ℝ), 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ c*L → Real.exp (L^a)/2 ≤ P → P ≤ Real.exp (L^beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → (∀ p : s, ‖coeff p‖ ≤ Bcoeff) → ∀ (lo hi : ℕ) (F : Finset ℕ) (γT : ℕ → ℂ) (UM UT BT : ℝ), 0 < UM → 1 ≤ UT → 0 ≤ BT → BT ≤ L^Et → (∀ n ∈ F, ‖γT n‖ ≤ BT) → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (q : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ c*L → (∫ u in Set.Icc (-R) R, ‖primeReciprocalPolynomial s coeff u * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u+σ) n*χ (n : ZMod q))* (∑ n ∈ Ioc lo hi, ambientRoughMellinCoefficient γrough L S aM v ν χM n*harmonicMellinWeight u n)* (∑ n ∈ F, γT n*harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨B0,hB0,hmain⟩ := exists_literal_four_factor_integral_decay_log_radius (E := Et) ha ha1 hbeta hc hd hBcoeff hAs0 haLong hAs hH Tmod Sshift refine ⟨B0,hB0,?_⟩ intro Bsave hsave S hS hprecision filter_upwards [hmain Bsave hsave, eventually_ambient_rough_mellin_low_factor hZ hγ hv hS hB0.le hprecision] with L hdecay hlow intro s hs coeff Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp hcoeff lo hi F γT UM UT BT hUM hUT hBT hBTpow hγT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ q hqInst χ hUQ hQA hAB hBQ hq hσ hmeanScale hresScale hlog have hM := hlow aM v hvM qM χM hqM ν hν apply hdecay s hs coeff Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp hcoeff (Ioc lo hi) F (ambientRoughMellinCoefficient γrough L S aM v ν χM) γT UM UT 1 BT hUM hUT zero_le_one hBT (by simpa only [one_mul] using hBTpow) hBTpow (fun n hn => hM.1 n ((Nat.zero_le lo).trans_lt (mem_Ioc.mp hn).1)) hγT hMband hFband UQ Alo Blo σ q χ hUQ hQA hAB hBQ hq hσ hmeanScale hresScale hlog intro u _ hu exact hM.2 u hu lo hi end Bounty end section /- The actual endpoint tilt and fixed damping choices satisfy all path energy hypotheses. -/ open Finset namespace Bounty section Sum variable {I : Type*} {N J ell r B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (phase : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (pattern : Fin (r + 1) → patterns) (k : ℕ → I → ℤ) (q : ℝ) (S : Finset (PhysicalSelectedData P ell (fun j => C (pattern j).val))) (mask : PhysicalSelectedData P ell (fun j => C (pattern j).val) → ℂ) end Sum end Bounty end section /- Complete selector recovery on the original signed physical path, including zero paths. -/ open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Fine end Bounty end section /- Exact finite reindexing transports the whole coupled weight unchanged. -/ open Finset open scoped Classical namespace Bounty variable {S I R : Type} [AddCommMonoid R] {Ps : S → Finset ℕ} {J ell n : ℕ} end Bounty end section /- Literal harmonic cross-correlations control the actual frequency-restricted integral. -/ open Finset MeasureTheory Filter namespace Bounty end Bounty end section /- The harmonic cross sum with the original marked weights and invariant endpoints. -/ open Finset open scoped ComplexConjugate namespace Bounty end Bounty end section /- An original selected candidate endpoint with the literal ambient rough discrepancy. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- An original selected candidate endpoint with the literal ambient prime discrepancy. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- The original nonzero-M filter does not change the restricted discrepancy polynomial. -/ open Finset namespace Bounty theorem typeIIRestrict_complex_ne_zero_iff (M : Finset ℕ) (α : ℕ → ℝ) (n : ℕ) : (typeIIRestrict M α n : ℂ) ≠ 0 ↔ n ∈ M ∧ α n ≠ 0 := by rw [Complex.ofReal_ne_zero] exact typeIIRestrict_ne_zero_iff M α n theorem typeIIRestrict_nonzero_sum (M : Finset ℕ) (α : ℕ → ℝ) (Φ : ℕ → ℂ) : (∑ n ∈ M.filter (fun n => (typeIIRestrict M α n : ℂ) ≠ 0), (typeIIRestrict M α n : ℂ)*Φ n) = ∑ n ∈ M, (α n : ℂ)*Φ n := by classical rw [sum_filter] apply sum_congr rfl intro n hn simp only [typeIIRestrict,if_pos hn] by_cases hzero : α n = 0 <;> simp [hzero] end Bounty end section /- Finite component thresholds with the fixed slot chosen before precision. -/ open Filter namespace Bounty theorem finite_fixed_slot_component_thresholds {ι : Type*} [Finite ι] (P : ι → ℝ → ℕ → ℝ → Prop) (hP : ∀ i, ∃ J : ℕ, ∀ j : ℕ, J < j → ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, P i S j L) : ∃ J : ℕ, ∀ j : ℕ, J < j → ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ i, P i S j L := by choose js h using hP obtain ⟨J, hJ⟩ := Finite.exists_le js refine ⟨J, ?_⟩ intro j hj have hall (i : ι) := h i j ((hJ i).trans_lt hj) choose s hs hbound using hall obtain ⟨S₁, hS₁⟩ := Finite.exists_le s refine ⟨max 0 S₁, le_max_left _ _, ?_⟩ intro S hS exact Filter.eventually_all.mpr (fun i => hbound i S ((hS₁ i).trans ((le_max_right _ _).trans hS))) end Bounty end section /- The original active block estimates imply the exact candidate-relative ambient errors. -/ open Finset Filter namespace Bounty theorem exists_candidate_ambient_error_from_blocks {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) : ∃ D : ℝ, 0 ≤ D ∧ ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, (∀ γ S a v : ℝ, (∀ i ∈ dyadicNatIndices (Icc 1 ⌊33*Real.exp L⌋₊), ∀ j ∈ dyadicNatIndices (Icc 1 ⌊33*Real.exp L⌋₊), let B := shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) (typeIIRestrict (dyadicNatBucket (Icc 1 ⌊33*Real.exp L⌋₊) i) (ambientRoughIntervalTypeIIAlpha γ L S a v)) (typeIIRestrict (dyadicNatBucket (Icc 1 ⌊33*Real.exp L⌋₊) j) (ambientRoughTypeIIBeta (Real.exp (a*L)) (Real.exp (v*L)))) B ≠ 0 → |B| ≤ Real.exp L * L^(-D)) → |ambientRoughProxyError (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) γ L S (Real.exp (a*L)) (Real.exp (v*L))| ≤ candidateCoefficientWindowMass c L q r jStar*L^(-2 : ℝ)) ∧ (∀ κ S : ℝ, (∀ proxy : Bool, ∀ i ∈ dyadicNatIndices (Icc 1 ⌊33*Real.exp L⌋₊), ∀ j ∈ dyadicNatIndices (Icc 1 ⌊33*Real.exp L⌋₊), let B := shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) (typeIIRestrict (dyadicNatBucket (Icc 1 ⌊33*Real.exp L⌋₊) i) (ambientPrimeTypeIIAlpha κ L S)) (typeIIRestrict (dyadicNatBucket (Icc 1 ⌊33*Real.exp L⌋₊) j) (if proxy then ambientProxyTypeIIBeta κ L S else ambientPrimeTypeIIBeta κ L)) B ≠ 0 → |B| ≤ Real.exp L * L^(-D)) → |ambientPrimeProxyError (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) κ L S| ≤ candidateCoefficientWindowMass c L q r jStar*L^(-2 : ℝ)) := by obtain ⟨E, hE, J, hmass⟩ := exists_candidate_error_mass_exponent hc hr hq0 hq1 hcenter refine ⟨E+5, by linarith, J, ?_⟩ intro jStar hj filter_upwards [hmass jStar hj,eventually_ambient_rough_error_of_active_blocks (E+1), eventually_ambient_prime_error_of_active_blocks E,eventually_ge_atTop (1 : ℝ)] with L hmass hrough hprime hL constructor · intro γ S a v hblocks apply hmass have hb := hrough (candidateCoefficient c L q r jStar) γ S a v (by simpa only [show E+1+4=E+5 by ring] using hblocks) apply hb.trans exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le hL (by linarith : -(E+1) ≤ -E)) (Real.exp_pos L).le · intro κ S hblocks exact hmass _ (hprime (candidateCoefficient c L q r jStar) κ S hblocks) end Bounty end section /- Exact small-factor transport onto the original effective big path family, including the inverse path map used by the original action formula. -/ open scoped Classical namespace Bounty section Effective variable {S I V K : Type} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : K → I → ℤ) (B : ℕ) abbrev PhysicalEffectivePlannedBigPath (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (x : PhysicalFullBoundedState P J ell B) := PhysicalMixedPlannedBigPath (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) ks L pl x noncomputable def physicalEffectivePlanSmallFactor (Vs : S → ℝ) (qedge : K → ℝ) (ks : List (Option (V ⊕ K))) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (x : PhysicalFullBoundedState P J ell B) (p : PhysicalEffectivePlannedBigPath C k B ks L pl x) : ℂ := deterministicLedgerPhase (PhysicalPlannedResidueEvent (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i))) (physicalPlannedResidueTarget (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i))) (physicalPlannedSmallUpdate (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i))) (physicalPlannedSmallPhase (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) Vs qedge) (physicalMixedBigSteps ks L pl) r x p variable (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) theorem physical_mixed_plan_small_factor_effective (Vs : S → ℝ) (qedge : K → ℝ) (ks : List (Option (V ⊕ K))) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (x : PhysicalFullBoundedState P J ell B) (p : PhysicalMixedPlannedBigPath (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i => physicalMixedEdgeDelta (C i) (k t i)) (fun _ i => physicalMixedEdgeD (C i)) ks L pl x) : (physicalMixedPlanSmallFactor (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i => physicalMixedEdgeDelta (C i) (k t i)) (fun _ i => physicalMixedEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) Vs qedge ks r L pl x p : ℂ) = physicalEffectivePlanSmallFactor C k B Vs qedge ks r L pl x (physicalMixedEffectiveBigPathEquiv hPs hP hdis (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => C key.2.1) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k key.1 key.2.1) B (physicalMixedBigSteps ks L pl) x p) := by exact physical_mixed_plan_small_factor_transport (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i => physicalMixedEdgeDelta (C i) (k t i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i => physicalMixedEdgeD (C i)) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i d => funext fun c => funext fun a => funext fun g => physical_mixed_delta_effective_big_step (C i) d (k t i) c a g) (fun _ i d c a g p => physical_mixed_dilation_divisibility hPs hP hdis (C i) d c a g p) (fun t i => physicalMixedBigStep (C i) (k t i)) Vs qedge ks r L pl x p theorem physical_mixed_plan_small_factor_effective_pullback (Vs : S → ℝ) (qedge : K → ℝ) (ks : List (Option (V ⊕ K))) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (x : PhysicalFullBoundedState P J ell B) (p : PhysicalEffectivePlannedBigPath C k B ks L pl x) : (physicalMixedPlanSmallFactor (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i => physicalMixedEdgeDelta (C i) (k t i)) (fun _ i => physicalMixedEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) Vs qedge ks r L pl x ((physicalMixedEffectiveBigPathEquiv hPs hP hdis (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => C key.2.1) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k key.1 key.2.1) B (physicalMixedBigSteps ks L pl) x).symm p) : ℂ) = physicalEffectivePlanSmallFactor C k B Vs qedge ks r L pl x p := by simpa only [Equiv.apply_symm_apply] using physical_mixed_plan_small_factor_effective C k B hPs hP hdis Vs qedge ks r L pl x ((physicalMixedEffectiveBigPathEquiv hPs hP hdis (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => C key.2.1) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k key.1 key.2.1) B (physicalMixedBigSteps ks L pl) x).symm p) end Effective end Bounty end section /- The original candidate selected and peeled harmonic sums have arbitrary Mellin tail precision. -/ open Filter Finset MeasureTheory Real namespace Bounty end Bounty end section /- The original local coefficient can be written using the edge cut directly, then transported through a relabeling of the original full-event keys. -/ open scoped Classical namespace Bounty section Coefficient variable {I V : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : I → ℤ) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) noncomputable def physicalFullKeyCoefficientPhase (tag : Option (V ⊕ I)) (x : PhysicalFullBoundedState P J ell B) (e : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) tag x) : ℂ := match tag with | none => 1 | some (.inl _) => 1 | some (.inr i) => physicalActiveCoefficient (C i) (C i) (C i) (ζ i) (K i) (fun g => (x g).1) (fun g => (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) (some (.inr i)) x e g).1) e.1 end Coefficient section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) (hbefore : ∀ j : Fin n, cut (4 * j.val + 2) = C j) (hafter : ∀ j : Fin n, cut (4 * j.val + 3) = C j) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) include hbefore hafter in theorem physical_full_coefficient_edge_cut (tag : Option (Fin (n + 1) ⊕ Fin n)) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent C k tag (fullActiveInitialLedger x, x)) : physicalFullCoefficientPhase C k cut ζ K tag x e = physicalFullKeyCoefficientPhase C k ζ K tag x e := by cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => dsimp only [physicalFullCoefficientPhase, physicalLocalCoefficientPhase, physicalFullKeyCoefficientPhase] rw [hbefore, hafter] rfl end Fine end Bounty end section /- Exact full cutoff-box energy from central shifted energy and a controlled tail. -/ open Finset MeasureTheory namespace Bounty theorem harmonic_normalized_full_box_energy {Y : ℝ} (hY : 0 < Y) (a b R Eall Ecentral w : ℝ) (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (hD : ∀ d ∈ D, 0 < d) (hA : ∀ a ∈ A, 0 < a) (hB : ∀ z ∈ B, 0 < z) (hC : ∀ z ∈ C, 0 < z) (hall : ∀ u, (∫ s in Set.Icc a b, ‖(∑ d ∈ D, δ d * harmonicMellinWeight (s+w+2*Real.pi*u) d) * (∑ z ∈ A, α z * harmonicMellinWeight (s+w+2*Real.pi*u) z) * (∑ z ∈ B, β z * harmonicMellinWeight (s+w+2*Real.pi*u) z) * (∑ z ∈ C, γ z * harmonicMellinWeight (s+w+2*Real.pi*u) z)‖^2) ≤ Eall) (hcentral : ∀ u, ‖u‖ ≤ R → (∫ s in Set.Icc a b, ‖(∑ d ∈ D, δ d * harmonicMellinWeight (s+w+2*Real.pi*u) d) * (∑ z ∈ A, α z * harmonicMellinWeight (s+w+2*Real.pi*u) z) * (∑ z ∈ B, β z * harmonicMellinWeight (s+w+2*Real.pi*u) z) * (∑ z ∈ C, γ z * harmonicMellinWeight (s+w+2*Real.pi*u) z)‖^2) ≤ Ecentral) : (∫ s in Set.Icc a b, ‖∑ d ∈ D, ∑ x ∈ A, ∑ y ∈ B, ∑ z ∈ C, (δ d * α x * β y * γ z) * ((harmonicCommonCutoff (((d*x*y*z : ℕ) : ℝ) / Y) / ((d*x*y*z : ℕ) : ℝ) : ℝ) : ℂ) * physicalMellinPhase (s+w) ((d*x*y*z : ℕ) : ℝ)‖^2) ≤ 2*(∫ u in {u : ℝ | R < ‖u‖}, ‖harmonicWindowLogFourier u‖)^2*Eall + 2*(∫ u in {u : ℝ | ‖u‖ ≤ R}, ‖harmonicWindowLogFourier u‖)^2*Ecentral := by let P : ℝ → ℂ := fun s => ∑ d ∈ D, ∑ x ∈ A, ∑ y ∈ B, ∑ z ∈ C, (δ d * α x * β y * γ z) * ((harmonicCommonCutoff (((d*x*y*z : ℕ) : ℝ) / Y) / ((d*x*y*z : ℕ) : ℝ) : ℝ) : ℂ) * physicalMellinPhase (s+w) ((d*x*y*z : ℕ) : ℝ) let Q : ℝ → ℂ := fun s => ∫ u in {u : ℝ | ‖u‖ ≤ R}, harmonicWindowLogFourier u * physicalMellinPhase (-2*Real.pi*u) Y * ((∑ d ∈ D, δ d * harmonicMellinWeight (s+w+2*Real.pi*u) d) * (∑ z ∈ A, α z * harmonicMellinWeight (s+w+2*Real.pi*u) z) * (∑ z ∈ B, β z * harmonicMellinWeight (s+w+2*Real.pi*u) z) * (∑ z ∈ C, γ z * harmonicMellinWeight (s+w+2*Real.pi*u) z)) have ht := harmonic_normalized_four_box_integrated_tail_shifted hY a b R Eall w D A B C δ α β γ hD hA hB hC hall have hc := harmonic_normalized_four_box_truncated_energy a b Y R Ecentral w D A B C δ α β γ hD hA hB hC hcentral have hPc : Continuous P := by dsimp [P,physicalMellinPhase]; fun_prop have herr (s : ℝ) : P s - Q s = harmonicNormalizedFourBoxError Y (s+w) R D A B C δ α β γ := rfl have he : Integrable (fun s => ‖P s - Q s‖^2) (volume.restrict (Set.Icc a b)) := by simpa only [IntegrableOn,herr] using ht.1 have hq : Integrable (fun s => ‖Q s‖^2) (volume.restrict (Set.Icc a b)) := hc.1 have htb : (∫ s in Set.Icc a b, ‖P s - Q s‖^2) ≤ (∫ u in {u : ℝ | R < ‖u‖}, ‖harmonicWindowLogFourier u‖)^2*Eall := by simpa only [herr] using ht.2 have hcb : (∫ s in Set.Icc a b, ‖Q s‖^2) ≤ (∫ u in {u : ℝ | ‖u‖ ≤ R}, ‖harmonicWindowLogFourier u‖)^2*Ecentral := hc.2 have hsplit := integral_square_le_twice_error_add_approximation (volume.restrict (Set.Icc a b)) P Q (hPc.norm.pow 2).integrableOn_Icc he hq change (∫ s in Set.Icc a b, ‖P s‖^2) ≤ _ apply hsplit.trans simpa only [mul_assoc] using add_le_add (mul_le_mul_of_nonneg_left htb (by norm_num : (0 : ℝ) ≤ 2)) (mul_le_mul_of_nonneg_left hcb (by norm_num : (0 : ℝ) ≤ 2)) end Bounty end section /- An exact common Mellin shift changes only the existing coefficient phase. -/ namespace Bounty theorem rational_phase_harmonic_common_shift (a b : ℂ) (s t w : ℝ) (n : ℕ) : a*typeIIPhase (s+w) n*b*harmonicMellinWeight t n = a*typeIIPhase s n*b*harmonicMellinWeight (t+w) n := by rw [typeIIPhase_add, ← typeIIPhase_harmonic_mellin_shift w t n] ring end Bounty end section /- Every occupied actual logarithmic cell has a superpolynomial lower scale and a subexponential upper scale, uniformly in its character. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_occupied_cell_scale {c ε : ℝ} (hc : 0 < c) (hε : 0 < ε) (J : ℕ) (q : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → let P := fun g : S => candidatePBand (c*L) g.val ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r : Finset S) (A : Finset (RepeatedBigFlatIndex S J ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → A.Nonempty → ∀ (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d : ℤ) (χ : BoundedPrimitiveCharacter Q) (ζ : ℝ), (∃ x : (∀ i : A, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase ζ (∏ i, (x i).val) ≠ 0) → L^q ≤ Real.exp (((d : ℝ)-1)*h) ∧ Real.exp (((d : ℝ)-1)*h) ≤ Real.exp (ε*L) := by filter_upwards [eventually_candidate_subset_product_range hc hε J, eventually_mul_rpow_le_exp_rpow q (Real.exp 1) (c := (1/10 : ℝ)) (by norm_num)] with L hrange hlarge intro S hS P ell probes r A hA hne Q h hh hh1 d χ ζ hx obtain ⟨x, hx⟩ := hx obtain ⟨hlo, hhi⟩ := hrange S hS ell probes r A hA hne x have hpos : 0 < ∏ i, (x i).val := by have hp := (Real.exp_pos _).trans_le hlo exact_mod_cast hp obtain ⟨hcellLo, hcellHi⟩ := prime_cell_phased_conjugate_range (fun i : A => P i.val.1) hh d χ ζ x hpos hx have hcellUpper : ((∏ i, (x i).val : ℕ) : ℝ) ≤ Real.exp 1 * Real.exp (((d : ℝ)-1)*h) := by calc _ ≤ Real.exp ((d : ℝ)*h) := hcellHi _ = Real.exp h * Real.exp (((d : ℝ)-1)*h) := by rw [← Real.exp_add] congr 1 ring _ ≤ _ := mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr hh1) (Real.exp_pos _).le refine ⟨?_, hcellLo.le.trans hhi⟩ exact le_of_mul_le_mul_left (hlarge.trans (hlo.trans hcellUpper)) (Real.exp_pos 1) end Bounty end section /- Centered Fourier power saving from the exact retained-box source estimates. -/ open Finset Filter MeasureTheory namespace Bounty theorem eventually_common_source_fourier_of_boxes {b : ℝ} (hb : 0 < b) (A B : ℝ) : ∃ D : ℝ, A < D ∧ ∀ᶠ L : ℝ in atTop, ∀ (Y H Z a v c : ℝ) (F : ℤ → ℂ) (δ α β γ : ℕ → ℂ), Real.exp (b*L) ≤ Y → Real.log Y ≤ 6*L → 1 ≤ H → H ≤ Real.exp ((b/2)*L) → 0 < Z → (∀ n ∈ (harmonicCommonSupport Y).image Int.natAbs, F n = endpointFourConvolution δ α β γ n) → (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖ ^ 2) ≤ Y*L^B → let S := (harmonicCommonSupport Y).image Int.natAbs let N := ⌈4*Real.exp 2*Y⌉₊ (∀ i ∈ dyadicNatIndices (Icc 1 N), ∀ j ∈ dyadicNatIndices (Icc 1 N), ∀ k ∈ dyadicNatIndices (Icc 1 N), ∀ l ∈ dyadicNatIndices (Icc 1 N), retainedFourDyadicBox S N i j k l → Integrable (fun t => ‖fourDyadicBoxSum N δ α β γ (commonSourceBoxKernel Y a v c t) i j k l‖ ^ 2) (volume.restrict {t : ℝ | |t| ≤ L*Y/H})) → (∀ i ∈ dyadicNatIndices (Icc 1 N), ∀ j ∈ dyadicNatIndices (Icc 1 N), ∀ k ∈ dyadicNatIndices (Icc 1 N), ∀ l ∈ dyadicNatIndices (Icc 1 N), retainedFourDyadicBox S N i j k l → (∫ t in {t : ℝ | |t| ≤ L*Y/H}, ‖fourDyadicBoxSum N δ α β γ (commonSourceBoxKernel Y a v c t) i j k l‖ ^ 2) ≤ L^(-D)) → (∫ x in Set.Icc (c-1/H) (c+1/H), ‖finiteFourierSum (harmonicCommonSupport Y) (harmonicCellSource Y Z a v F) x‖ ^ 2) ≤ Y*L^(-A) := by obtain ⟨D,hD,hred⟩ := eventually_common_centered_fourier_of_mellin hb A B refine ⟨D+9, by linarith, ?_⟩ filter_upwards [hred,eventually_common_source_mellin_of_boxes, eventually_ge_atTop (1 : ℝ)] with L hred hboxes hL intro Y H Z a v c F δ α β γ hY hlog hH hHu hZ hF hEs S N hf hM have hLp : 0 < L := lt_of_lt_of_le zero_lt_one hL have hY1 : 1 ≤ Y := (Real.one_le_exp (by positivity : 0 ≤ b*L)).trans hY apply hred Y H c (harmonicCellSource Y Z a v F) hY hlog hH hHu hEs have h := hboxes (volume.restrict {t : ℝ | |t| ≤ L*Y/H}) Y Z a v c hY1 hlog hZ F δ α β γ hF (L^(-(D+9))) (Real.rpow_nonneg hLp.le _) hf hM have hpow : L ^ 9 * L ^ (-(D+9)) = L ^ (-D) := by rw [← Real.rpow_natCast, ← Real.rpow_add hLp] congr 1 ring exact h.trans_eq (by rw [hpow]) end Bounty end section /- Pointwise rational twists preserve the original coefficient and phase order. -/ namespace Bounty section variable (r d : ℕ) {q : ℕ} (χ : DirichletCharacter ℂ q) (ψ : AddChar (Additive (ZMod (r/d))ˣ) ℂ) include r d q χ ψ theorem rational_normalized_phase_twist (a : ℂ) (τ : ℝ) (n : ℕ) : (a*(χ (n : ZMod q)*typeIIPhase τ n))* unitAddCharDirichlet ψ (n : ZMod (r/d)) = a*(rationalProductCharacter r d χ ψ (n : ZMod (q*(r/d)))*typeIIPhase τ n) := by rw [rational_product_character_apply] ring theorem rational_phase_left_twist (τ : ℝ) (n : ℕ) : (typeIIPhase τ n*χ (n : ZMod q))*unitAddCharDirichlet ψ (n : ZMod (r/d)) = typeIIPhase τ n*rationalProductCharacter r d χ ψ (n : ZMod (q*(r/d))) := by rw [rational_product_character_apply] ring theorem rational_weighted_phase_twist (a : ℂ) (τ : ℝ) (n : ℕ) : (a*χ (n : ZMod q)*typeIIPhase τ n)*unitAddCharDirichlet ψ (n : ZMod (r/d)) = a*rationalProductCharacter r d χ ψ (n : ZMod (q*(r/d)))*typeIIPhase τ n := by rw [rational_product_character_apply] ring end theorem candidate_selected_rational_multiplier (c L q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (t u : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => u g.val) → ℂ) (κ θ : ℕ → ℂ) (qRat dRat : ℕ) (ψ : AddChar (Additive (ZMod (qRat/dRat))ˣ) ℂ) (n : ℕ) : candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ t u big b κ θ n * rationalResidualGcdMultiplier qRat dRat ψ n = candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ t u big b κ (fun n => θ n*rationalResidualGcdMultiplier qRat dRat ψ n) n := (candidate_selected_residual_full_multiplier c L q r jStar hr hj take hkeep ξ t u big b κ θ (rationalResidualGcdMultiplier qRat dRat ψ) n).symm end Bounty end section /- Absorb the recovered local coefficient before expanding original freshness into forests. -/ open Finset open scoped Classical namespace Bounty section Enriched variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) end Enriched end Bounty end section /- A literal original endpoint correlation hypothesis controls the actual cross integral. -/ open Finset MeasureTheory open scoped ComplexConjugate namespace Bounty end Bounty end section /- The exact retained-support harmonic target controls the normalized truncated energy. -/ open Finset Filter MeasureTheory namespace Bounty noncomputable def typeIIRetainedHarmonicCorrelation (Z : ℝ) (k : ℤ) (M H : Finset ℕ) (α : ℕ → ℂ) (W : ℕ → ℝ) (B : ℕ → ℂ) (ρ : ℝ) (χ : DirichletCharacter ℂ (2*k.natAbs)) (ξ : EuclideanSpace ℝ (Fin 3)) : ℂ := let M₀ := M.filter (fun m => α m ≠ 0) let Zs := Icc 0 (M₀.sup id * H.sup id) ∑ z ∈ typeIIActiveCrossZ Z k Zs, ((typeIIHarmonicDyadic ((z:ℝ)/Z)/(z:ℝ) : ℝ):ℂ) * typeIICrossPairCoefficient M₀ H (fun m => α m * χ (m : ZMod (2*k.natAbs))) W B ρ (2*Real.pi*ξ 0) (2*Real.pi*ξ 1) (2*Real.pi*ξ 2) z ((z:ℤ)+k).toNat end Bounty end section /- Exact small-plan coordinates for the original mixed root scalar. -/ open Finset open scoped Classical namespace Bounty variable {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) abbrev PhysicalRootSmallPlan := PhysicalMarkLists (fun g : ↥groupsᶜ => P g.val) J ell × PhysicalMixedSmallPlan (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) noncomputable def physicalRootSmallPlanPattern (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) : Fin (n + 1) → patterns := ((physicalSmallSelectedPlanEquiv (fun (i : patterns) (g : ↥groupsᶜ) => C i.val g.val) hC).symm p).1 abbrev PhysicalRootSmallPlanBigData (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) := PhysicalGroupSelectedData (fun g : {g // g ∉ groupsᶜ} => P g.val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) noncomputable def physicalRootSmallPlanPath (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) : PhysicalMarkLists P J ell × (Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) := (physicalPathSmallPlanEquiv (fun g => g ∈ groupsᶜ) patterns C hC).symm ⟨p, db⟩ noncomputable def physicalRootMixedPathIntegrand [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (β : PhysicalPrime P → ℝ) (B : ℕ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : ℂ := (((physicalStateMass (fun g : ↥groupsᶜ => V g.val) J ell * ∏ j ∈ range (n + 1), physicalCompletionMass (fun g : ↥groupsᶜ => V g.val) (fun g => C (finitePathLabels p j).2.2.1.val g.val) ell : ℝ) : ℂ) * physicalMemoryFourierWalkScalar V patterns C ζ k K (finitePathLabels p) (finitePathMarks L p) (n + 1) θ * physicalGroupFiniteVertexWeight groupsᶜ C q k L p r * physicalGroupFiniteCappedHistory groups C q k β V B L p) noncomputable def physicalRootSmallPlanIntegrand [∀ a : PhysicalPrime P, NeZero a.2.val] (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (β : PhysicalPrime P → ℝ) (B : ℕ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) : ℂ := let old := physicalRootSmallPlanPath groups patterns C hC p db physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ old.1 old.2 end Bounty end section /- The original nonzero coefficient filter preserves every phased Mellin polynomial. -/ open Finset namespace Bounty theorem typeIIRestrict_nonzero_phase_mellin_sum (M : Finset ℕ) (α : ℕ → ℝ) {q : ℕ} (χ : DirichletCharacter ℂ q) (ν u : ℝ) : (∑ n ∈ M.filter (fun n => (typeIIRestrict M α n : ℂ) ≠ 0), (typeIIRestrict M α n : ℂ)*χ (n : ZMod q)*typeIIPhase ν n*harmonicMellinWeight u n) = ∑ n ∈ M, (α n : ℂ)*χ (n : ZMod q)*typeIIPhase ν n*harmonicMellinWeight u n := by simpa only [mul_assoc] using typeIIRestrict_nonzero_sum M α (fun n => χ (n : ZMod q)*typeIIPhase ν n*harmonicMellinWeight u n) end Bounty end section /- Assembly of finite rough and prime components with the corrected parameter order. -/ open Filter namespace Bounty def CandidateHalfFixedSlotComponentBounds : Prop := ∀ (c : ℝ) (r : ℕ), 0 match i with | none => |ambientPrimeProxyError (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L (1/2) r j) κ L S| ≤ candidateCoefficientWindowMass c L (1/2) r j*L^(-2 : ℝ) | some i => |ambientRoughProxyError (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L (1/2) r j) (reciprocalGrid b (1/2-κ) N i) L S (Real.exp (reciprocalGrid b (1/2-κ) N i*L)) (Real.exp (reciprocalGrid b (1/2-κ) N ((i : ℕ)+1)*L))| ≤ candidateCoefficientWindowMass c L (1/2) r j*L^(-2 : ℝ) have hall : ∀ i, ∃ J : ℕ, ∀ j : ℕ, J < j → ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, P i S j L := by intro i cases i with | none => exact hprime | some i => exact hrough i obtain ⟨J, hJ⟩ := finite_fixed_slot_component_thresholds P hall refine ⟨J, ?_⟩ intro j hj obtain ⟨S, hS, hbound⟩ := hJ j hj refine ⟨S, hS, ?_⟩ have hev := hbound S le_rfl exact eventually_candidate_ambient_error_of_component_bounds (fun i => hev.mono (fun L hL => hL (some i))) (hev.mono (fun L hL => hL none)) theorem target_of_candidate_half_fixed_slot_components (hZ : PrimitiveZeroFreeHalfPlane) (hR : CandidateHalfFixedSlotComponentBounds) : fcTypeOfName% "Erdos1057.erdos_1057" := target_of_candidate_half_fixed_slot_replacement hZ (candidate_half_fixed_slot_replacement_of_component_bounds hR) end Bounty end section /- The original coefficient phase separates from an arbitrary extra recorded weight. -/ open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Fine end Bounty end section /- Equal small plans induce the same effective path and small factor. -/ open scoped Classical namespace Bounty section Cast variable {S I V K : Type} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : K → I → ℤ) (B : ℕ) (ks : List (Option (V ⊕ K))) def physicalEffectivePlanPathCastEquiv {a b : PhysicalMarkLists Ps J ell × PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks} (h : a = b) (x : PhysicalFullBoundedState P J ell B) : PhysicalEffectivePlannedBigPath C k B ks a.1 a.2 x ≃ PhysicalEffectivePlannedBigPath C k B ks b.1 b.2 x := Equiv.cast (congrArg (fun a => PhysicalEffectivePlannedBigPath C k B ks a.1 a.2 x) h) theorem physical_effective_small_factor_plan_cast (Vs : S → ℝ) (qedge : K → ℝ) (r : PhysicalResidues Ps) {a b : PhysicalMarkLists Ps J ell × PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks} (h : a = b) (x : PhysicalFullBoundedState P J ell B) (p : PhysicalEffectivePlannedBigPath C k B ks a.1 a.2 x) : physicalEffectivePlanSmallFactor C k B Vs qedge ks r b.1 b.2 x (physicalEffectivePlanPathCastEquiv C k B ks h x p) = physicalEffectivePlanSmallFactor C k B Vs qedge ks r a.1 a.2 x p := by cases h rfl end Cast end Bounty end section /- The original coefficient phase is retained along the entire relabeled full path. -/ open scoped Classical namespace Bounty section Path variable {I H V : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : I → ℤ) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (f : H → I) noncomputable def physicalFullKeyPathEquiv (steps : List (Option (V ⊕ H))) (x : PhysicalFullBoundedState P J ell B) := fullPermutationKeyPathEquiv (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) f steps x theorem physical_full_key_coefficient_path (steps : List (Option (V ⊕ H))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C (f i) g)) B (fun i _ => PhysicalAuxLabels P (C (f i))) (fun i => physicalFullEdgeDelta (C (f i)) (k (f i))) (fun i => physicalFullEdgeD (C (f i))) steps x) : finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i))) (physicalFullKeyCoefficientPhase C k ζ K) (steps.map (Option.map (Sum.map id f))) x (physicalFullKeyPathEquiv C k f steps x p) = finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C (f i) g)) B (fun i _ => PhysicalAuxLabels P (C (f i))) (fun i => physicalFullEdgeDelta (C (f i)) (k (f i))) (fun i => physicalFullEdgeD (C (f i)))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C (f i) g)) B (fun i _ => PhysicalAuxLabels P (C (f i))) (fun i => physicalFullEdgeDelta (C (f i)) (k (f i))) (fun i => physicalFullEdgeD (C (f i)))) (physicalFullKeyCoefficientPhase (fun i => C (f i)) (fun i => k (f i)) (fun i => ζ (f i)) (fun i => K (f i))) steps x p := by have h := full_permutation_key_local_phase (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) f (physicalFullKeyCoefficientPhase C k ζ K) steps x p have hp : (fun (tag : Option (V ⊕ H)) (x : PhysicalFullBoundedState P J ell B) (e : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C (f i) g)) B (fun i _ => PhysicalAuxLabels P (C (f i))) (fun i => physicalFullEdgeDelta (C (f i)) (k (f i))) (fun i => physicalFullEdgeD (C (f i))) tag x) => physicalFullKeyCoefficientPhase C k ζ K (tag.map (Sum.map id f)) x (fullPermutationKeyEventEquiv (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) f tag x e)) = physicalFullKeyCoefficientPhase (fun i => C (f i)) (fun i => k (f i)) (fun i => ζ (f i)) (fun i => K (f i)) := by funext tag x e exact (by cases tag with | none => rfl | some tag => cases tag <;> rfl ) erw [hp] at h exact h end Path end Bounty end section /- The original row encoding supplies both endpoint cuts for the unchanged coefficient phase. -/ open scoped Classical namespace Bounty section Cut variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) include hencode in theorem physical_encoded_edge_cuts (j : Fin n) : cut (4 * j.val + 2) = C j ∧ cut (4 * j.val + 3) = C j := by have h := hencode (4 * j.val + 2) rw [physical_fine_tag_edge] at h exact h include hencode in theorem physical_full_coefficient_phase_edge_cut (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (steps : List (Option (Fin (n + 1) ⊕ Fin n))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps x) : finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (physicalFullCoefficientPhase C k cut ζ K) steps x p = finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (physicalFullKeyCoefficientPhase C k ζ K) steps x p := by have hφ : physicalFullCoefficientPhase (P := P) (ell := ell) (B := B) C k cut ζ K = physicalFullKeyCoefficientPhase C k ζ K := by funext tag x e exact physical_full_coefficient_edge_cut C k cut (fun j => (physical_encoded_edge_cuts C cut hencode j).1) (fun j => (physical_encoded_edge_cuts C cut hencode j).2) ζ K tag x e rw [hφ] end Cut end Bounty end section /- Central four-factor precision transfers to the literal normalized cutoff box. -/ open Finset Filter MeasureTheory namespace Bounty theorem eventually_harmonic_normalized_full_box_precision {r c E : ℝ} (hr : 0 < r) (hc : 0 ≤ c) (F : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, 1 ≤ Y → Real.log Y ≤ c*L → ∀ (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (D₀ A₀ B₀ C₀ : ℝ), 0 ≤ D₀ → 0 ≤ A₀ → 0 ≤ B₀ → 0 ≤ C₀ → D₀*A₀*B₀*C₀ ≤ L^E → (∀ d ∈ D, 0 < d) → (∀ a ∈ A, 0 < a) → (∀ b ∈ B, 0 < b) → (∀ z ∈ C, 0 < z) → (∀ d ∈ D, ‖δ d‖ ≤ D₀) → (∀ a ∈ A, ‖α a‖ ≤ A₀) → (∀ b ∈ B, ‖β b‖ ≤ B₀) → (∀ z ∈ C, ‖γ z‖ ≤ C₀) → (∀ d ∈ D, ∀ a ∈ A, ∀ b ∈ B, ∀ z ∈ C, Y/128 ≤ ((d*a*b*z : ℕ) : ℝ) ∧ ((d*a*b*z : ℕ) : ℝ) ≤ 64*Real.exp 2*Y) → ∀ T w : ℝ, 0 ≤ T → T ≤ L*Y → (∀ u, ‖u‖ ≤ L^r → (∫ s in Set.Icc (-T) T, ‖(∑ d ∈ D, δ d * harmonicMellinWeight (s+w+2*Real.pi*u) d) * (∑ a ∈ A, α a * harmonicMellinWeight (s+w+2*Real.pi*u) a) * (∑ b ∈ B, β b * harmonicMellinWeight (s+w+2*Real.pi*u) b) * (∑ z ∈ C, γ z * harmonicMellinWeight (s+w+2*Real.pi*u) z)‖^2) ≤ L^(-(F+1))) → (∫ s in Set.Icc (-T) T, ‖∑ d ∈ D, ∑ a ∈ A, ∑ b ∈ B, ∑ z ∈ C, (δ d * α a * β b * γ z) * ((harmonicCommonCutoff (((d*a*b*z : ℕ) : ℝ) / Y) / ((d*a*b*z : ℕ) : ℝ) : ℝ) : ℂ) * physicalMellinPhase (s+w) ((d*a*b*z : ℕ) : ℝ)‖^2) ≤ L^(-F) := by let M : ℝ := ∫ u, ‖harmonicWindowLogFourier u‖ filter_upwards [eventually_harmonic_four_box_shifted_mean_square (E := E) hc, eventually_schwartz_squared_tail_polynomial harmonicWindowLogFourier hr 1 (2*E+17) (F+1) (by norm_num), eventually_ge_atTop (2+2*M^2), eventually_gt_atTop (0 : ℝ)] with L hmean htail hconstant hL intro Y hY hlogY D A B C δ α β γ D₀ A₀ B₀ C₀ hD₀ hA₀ hB₀ hC₀ hprod hD hA hB hC hδ hα hβ hγ hgeom T w hT hTY hcentral have hb := harmonic_normalized_full_box_energy (zero_lt_one.trans_le hY) (-T) T (L^r) (L^(2*E+17)) (L^(-(F+1))) w D A B C δ α β γ hD hA hB hC (by intro u simpa only [add_assoc] using hmean Y hY hlogY D A B C δ α β γ D₀ A₀ B₀ C₀ hD₀ hA₀ hB₀ hC₀ hprod hD hA hB hC hδ hα hβ hγ hgeom T (w+2*Real.pi*u) hT hTY) hcentral have hm : (∫ u in {u : ℝ | ‖u‖ ≤ L^r}, ‖harmonicWindowLogFourier u‖) ≤ M := integral_mono_measure Measure.restrict_le_self (Eventually.of_forall (fun u => norm_nonneg (harmonicWindowLogFourier u))) harmonic_window_log_fourier_integrable.norm have hm0 : 0 ≤ ∫ u in {u : ℝ | ‖u‖ ≤ L^r}, ‖harmonicWindowLogFourier u‖ := integral_nonneg (fun u => norm_nonneg _) have hmass := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hm0 hm 2) (Real.rpow_nonneg hL.le (-(F+1))) simp only [one_mul] at htail apply hb.trans calc _ ≤ 2*L^(-(F+1)) + 2*M^2*L^(-(F+1)) := by nlinarith only [htail,hmass] _ = (2+2*M^2)*L^(-(F+1)) := by ring _ ≤ L*L^(-(F+1)) := mul_le_mul_of_nonneg_right hconstant (Real.rpow_nonneg hL.le _) _ = L^(-F) := by rw [show -F = 1 + -(F+1) by ring, Real.rpow_add hL, Real.rpow_one] end Bounty end section /- The actual local Fourier scale is large and subexponential for every nonzero pair of occupied cell-character tests. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_cell_local_scale {c b : ℝ} (hc : 0 < c) (hb : 0 < b) (J : ℕ) (K q W : ℝ) (hq : 0 ≤ q) (hW : 0 ≤ W) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → let P := fun g : S => candidatePBand (c*L) g.val ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r t : Finset S) (A B : Finset (RepeatedBigFlatIndex S J ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → A.Nonempty → B ⊆ t.sigma (repeatedBigPrimeProbeSlots probes) → B.Nonempty → ∀ (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (ζ : ℝ), (∃ x : (∀ i : A, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase ζ (∏ i, (x i).val) ≠ 0) → (∃ y : (∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y) * physicalPhase ζ (∏ i, (y i).val) ≠ 0) → ∀ (k : ℤ), k ≠ 0 → |(k : ℝ)| ≤ L^K → let HA := Real.exp (((d : ℝ)-1)*h) let HB := Real.exp (((e : ℝ)-1)*h) let H := |(k : ℝ)| *HA*HB/L^q L^W ≤ H ∧ H ≤ Real.exp ((b/2)*L) := by filter_upwards [eventually_candidate_occupied_cell_scale hc (show 0 < b/8 by positivity) J (q+W), eventually_rpow_le_exp_linear K (show 0 < b/4 by positivity), eventually_ge_atTop (1 : ℝ)] with L hcell hpoly hL intro S hS P ell probes r t A B hA hAne hB hBne Q h hh hh1 d e χ ψ ζ hXA hXB k hk hkK let HA := Real.exp (((d : ℝ)-1)*h) let HB := Real.exp (((e : ℝ)-1)*h) change L^W ≤ |(k : ℝ)| *HA*HB/L^q ∧ |(k : ℝ)| *HA*HB/L^q ≤ Real.exp ((b/2)*L) obtain ⟨hAl, hAu⟩ : L^(q+W) ≤ HA ∧ HA ≤ Real.exp ((b/8)*L) := hcell S hS ell probes r A hA hAne Q h hh hh1 d χ ζ hXA obtain ⟨hBl, hBu⟩ : L^(q+W) ≤ HB ∧ HB ≤ Real.exp ((b/8)*L) := hcell S hS ell probes t B hB hBne Q h hh hh1 e ψ ζ hXB have hL0 : 0 < L := zero_lt_one.trans_le hL have hp : 0 < L^q := Real.rpow_pos_of_pos hL0 q have hp1 : 1 ≤ L^q := Real.one_le_rpow hL hq have hHA0 : 0 ≤ HA := (Real.exp_pos _).le have hHB0 : 0 ≤ HB := (Real.exp_pos _).le have hnum0 : 0 ≤ |(k : ℝ)| *HA*HB := mul_nonneg (mul_nonneg (abs_nonneg _) hHA0) hHB0 have hHB1 : 1 ≤ HB := (Real.one_le_rpow hL (add_nonneg hq hW)).trans hBl have hk1 : 1 ≤ |(k : ℝ)| := by have hz : (0 : ℤ) < |k| := abs_pos.mpr hk have hi : (1 : ℤ) ≤ |k| := by omega exact_mod_cast hi constructor · apply (le_div_iff₀ hp).mpr calc L^W*L^q = L^(q+W) := by rw [← Real.rpow_add hL0] congr 1 ring _ = 1*L^(q+W)*1 := by ring _ ≤ |(k : ℝ)| *HA*HB := by gcongr · have hkexp : |(k : ℝ)| ≤ Real.exp ((b/4)*L) := hkK.trans hpoly calc _ ≤ |(k : ℝ)| *HA*HB := div_le_self hnum0 hp1 _ ≤ Real.exp ((b/4)*L)*Real.exp ((b/8)*L)*Real.exp ((b/8)*L) := by gcongr _ = Real.exp ((b/2)*L) := by rw [← Real.exp_add, ← Real.exp_add] congr 1 ring end Bounty end section /- Literal candidate cell-character auxiliary harmonic sums. The only analytic inputs left are the two endpoint energies and rational local source energy; empty cell tests give exactly zero. -/ open Finset Filter MeasureTheory open scoped Classical namespace Bounty theorem exists_candidate_cell_local_energy_decay {c : ℝ} (hc : 0 < c) (J : ℕ) (D E K : ℝ) (hK : 0 ≤ K) : ∃ q : ℝ, 0 ≤ q ∧ ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → let P := fun g : S => candidatePBand (c*L) g.val let V := fun g : S => ∑ p ∈ P g, 1/(p : ℝ) ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r t : Finset S) (A B : Finset (RepeatedBigFlatIndex S J ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → A.Nonempty → B ⊆ t.sigma (repeatedBigPrimeProbeSlots probes) → B.Nonempty → ∀ (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex S J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L^K → ∀ (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (a b v Y Z : ℝ) (F₀ G₀ : ℤ → ℂ), 0 < Y → let HA := Real.exp (((d : ℝ)-1)*h) let HB := Real.exp (((e : ℝ)-1)*h) (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a (2*Real.pi*v) F₀ n‖^2) ≤ Y*L^E → (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellTarget Y b G₀ n‖^2) ≤ Y*L^E → ((∃ x : (∀ i : A, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (x i).val) ≠ 0) → (∃ y : (∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (y i).val) ≠ 0) → ∀ (s : ℕ), 0 < s → (s : ℝ) ≤ L^(K+q) → ∀ u : ℤ, (∫ x in Set.Icc ((u : ℝ)/s-1/(|(k : ℝ)| *(HA*HB)/L^q)) ((u : ℝ)/s+1/(|(k : ℝ)| *(HA*HB)/L^q)), ‖finiteFourierSum (harmonicCommonSupport Y) (harmonicCellSource Y Z a (2*Real.pi*v) F₀) x‖^2) ≤ Y*L^(-((2*D+E+2)+2*q+K+1))) → ‖∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * ((starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1) * (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2)) * physicalPhase (-(a+b+2*Real.pi*v)) (physicalFreeFactor (repeatedBigAuxCut A B) aux) * harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)) F₀ G₀‖ ≤ Y*L^(-D) := by obtain ⟨q, hq, hminor⟩ := exists_candidate_actual_cell_mellin_minor hc J (D+E+1) obtain ⟨_, _, hatom⟩ := exists_candidate_subset_atom_inputs hc J refine ⟨q, hq, ?_⟩ filter_upwards [hminor, hatom, eventually_candidate_subset_product_range hc (ε := 1) (by norm_num) J, eventually_candidate_occupied_cell_scale hc (ε := 1) (by norm_num) J q, eventually_ge_atTop (5 : ℝ)] with L hm hmass hrange hcell hL intro S hS P V ell probes r t A B hA hAne hB hBne hU hAB k hk hkB Q h hh hh1 d e χ ψ a b v Y Z F₀ G₀ hY HA HB hf hg hlocal let ζ := -(a+b+2*Real.pi*v) let f := fun x => (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) let g := fun y => (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y) let bA := fun x => f x * physicalPhase ζ (∏ i, (x i).val) let bB := fun y => g y * physicalPhase ζ (∏ i, (y i).val) have hposA (x : ∀ i : A, P i.val.1) : 0 < ∏ i, (x i).val := by have hp := (Real.exp_pos _).trans_le (hrange S hS ell probes r A hA hAne x).1 exact_mod_cast hp have hposB (y : ∀ i : B, P i.val.1) : 0 < ∏ i, (y i).val := by have hp := (Real.exp_pos _).trans_le (hrange S hS ell probes t B hB hBne y).1 exact_mod_cast hp have htest (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : bA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * bB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 = (f (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * g (repeatedBigAuxSplitEquiv P A B hU hAB aux).2) * physicalPhase ζ (physicalFreeFactor (repeatedBigAuxCut A B) aux) := physical_aux_mellin_test_split P A B hU hAB f g hposA hposB ζ aux change ‖∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * (f (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * g (repeatedBigAuxSplitEquiv P A B hU hAB aux).2) * physicalPhase ζ (physicalFreeFactor (repeatedBigAuxCut A B) aux) * harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)) F₀ G₀‖ ≤ Y*L^(-D) have heq : (∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * bA (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * bB (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 * harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)) F₀ G₀) = (∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * (f (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 * g (repeatedBigAuxSplitEquiv P A B hU hAB aux).2) * physicalPhase ζ (physicalFreeFactor (repeatedBigAuxCut A B) aux) * harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)) F₀ G₀) := by apply sum_congr rfl intro aux _ rw [mul_assoc (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ), htest] ring rw [← heq] have hnonneg : 0 ≤ Y*L^(-D) := mul_nonneg hY.le (Real.rpow_nonneg (by linarith) _) by_cases hx : ∃ x, bA x ≠ 0 · by_cases hy : ∃ y, bB y ≠ 0 · have hHA : L^q ≤ HA := (hcell S hS ell probes r A hA hAne Q h hh hh1 d χ ζ hx).1 have hHB : L^q ≤ HB := (hcell S hS ell probes t B hB hBne Q h hh hh1 e ψ ζ hy).1 have hq1 : 1 ≤ L^q := Real.one_le_rpow (by linarith) hq have hscale : L^q ≤ HA*HB := by calc L^q ≤ HA := hHA _ = HA*1 := by ring _ ≤ HA*HB := mul_le_mul_of_nonneg_left (hq1.trans hHB) (Real.exp_pos _).le have hminor' : ∀ θ, θ ∉ productMajorArcSet k L q HA HB → ‖physicalAuxFourierMultiplier P V A B hU hAB k bA bB θ‖ ≤ L^(-(D+E+1)) := by intro θ hθ rw [physical_aux_mellin_multiplier_split P V A B hU hAB k f g hposA hposB ζ θ] exact hm S hS ell probes r t A B hA hAne hB hBne hU hAB k Q h hh d e χ ψ a b v θ hθ simpa only [physicalFreeFactor] using harmonic_cell_aux_local_energy_decay P V A B hU hAB k bA bB (hmass S hS).1 (fun _ => rfl) (prime_cell_phased_conjugate_norm _ h d χ ζ) (prime_cell_phased_conjugate_norm _ h e ψ ζ) Z a b (2*Real.pi*v) F₀ G₀ hk hL hq hK hkB (Real.exp_pos _) (Real.exp_pos _) hY hscale hf hg hminor' (hlocal hx hy) · push Not at hy simpa only [hy, mul_zero, zero_mul, sum_const_zero, norm_zero] using hnonneg · push Not at hx simpa only [hx, mul_zero, zero_mul, sum_const_zero, norm_zero] using hnonneg end Bounty end section /- A single original slot in a candidate big-prime group forces the actual occupied logarithmic cell above exp(L^(3/10)-1). -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_big_slot_cell_lower {c : ℝ} (hc : 0 < c) (J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → let P := fun g : S => candidatePBand (c*L) g.val ∀ (ell : ℕ) (A : Finset (RepeatedBigFlatIndex S J ell)), (∃ i : A, i.val.1.val ∈ candidateBigPIndices c L) → ∀ (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d : ℤ) (χ : BoundedPrimitiveCharacter Q) (ζ : ℝ), (∃ x : (∀ i : A, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase ζ (∏ i, (x i).val) ≠ 0) → Real.exp (L^(3/10 : ℝ)-1) ≤ Real.exp (((d : ℝ)-1)*h) := by obtain ⟨_, _, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc obtain ⟨_, _, _, _, hbig⟩ := eventually_candidate_P_groups (α := (3/10 : ℝ)) (β := (2/5 : ℝ)) hc (by norm_num) (by norm_num) (by norm_num) filter_upwards [hpool, hbig] with L hp hb intro S hS P ell A hi Q h hh hh1 d χ ζ hx obtain ⟨i, hi⟩ := hi obtain ⟨x, hx⟩ := hx have hprime (j : A) : (x j).val.Prime := ((hp.2.2.2.2.2 j.val.1.val (hS j.val.1.property)).2.2 (x j).val (x j).property).1 have hiBig : Real.exp (L^(3/10 : ℝ)) < ((x i).val : ℝ) := ((hb.2.2.2 i.val.1.val hi).2.2 (x i).val (x i).property).2.1 have hsingle : (x i).val ≤ ∏ j : A, (x j).val := single_le_prod' (fun j _ => (hprime j).one_le) (mem_univ i) have hprod : Real.exp (L^(3/10 : ℝ)) ≤ ((∏ j : A, (x j).val : ℕ) : ℝ) := hiBig.le.trans (by exact_mod_cast hsingle) have hpos : 0 < ∏ j : A, (x j).val := by have hp0 := (Real.exp_pos _).trans_le hprod exact_mod_cast hp0 have hcell := (prime_cell_phased_conjugate_range (fun i : A => P i.val.1) hh d χ ζ x hpos hx).2 apply le_of_mul_le_mul_left (a := Real.exp 1) · calc Real.exp 1 * Real.exp (L^(3/10 : ℝ)-1) = Real.exp (L^(3/10 : ℝ)) := by rw [← Real.exp_add] congr 1 ring _ ≤ Real.exp ((d : ℝ)*h) := hprod.trans hcell _ = Real.exp h * Real.exp (((d : ℝ)-1)*h) := by rw [← Real.exp_add] congr 1 ring _ ≤ _ := mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr hh1) (Real.exp_pos _).le · exact Real.exp_pos 1 end Bounty end section /- Complete selector recovery on the original signed physical path, including zero paths. -/ open scoped Classical namespace Bounty section Fine variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) variable (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) end Fine end Bounty end section /- Exact projected blocks for the original enriched physical ledger rows. -/ open scoped Classical namespace Bounty section Physical variable {N J ell m B : ℕ} {P : Fin N → Finset ℕ} [∀ g (p : ↥(P g)), NeZero p.val] (C : Fin m → Fin N → Finset (Fin J)) (k : Fin m → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (m + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin m → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) end Physical end Bounty end section /- The exact retained harmonic target, with every original finite support preserved. -/ open Finset Filter MeasureTheory namespace Bounty noncomputable def candidateB0HarmonicCorrelation (c L q : ℝ) (r jStar : ℕ) (P : Finset ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (ν Z : ℝ) (k : ℤ) (M : Finset ℕ) (α : ℕ → ℂ) (χ : DirichletCharacter ℂ (2*k.natAbs)) (ζ : EuclideanSpace ℝ (Fin 3)) : ℂ := typeIIRetainedHarmonicCorrelation Z k M (candidateRetainedAllocationSupport c L r jStar P take) α (fun n => markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p:ℝ)) (fun _ => 1) (n:ℤ)) (fun h => candidateRemainingComplexCoefficient c L r jStar take twist (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) h)) (2*Real.pi*ν) χ ζ theorem candidate_B0_retained_eq_separated (c L q : ℝ) (r jStar : ℕ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (ν : ℝ) : candidateB0RetainedCoefficient c L q r jStar take twist ν = typeIISeparatedH (fun n => markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p:ℝ)) (fun _ => 1) (n:ℤ)) (fun h => candidateRemainingComplexCoefficient c L r jStar take twist (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) h)) (2*Real.pi*ν) := by rw [candidate_B0_retained_eq_phase] funext h simp only [candidateRetainedComplexCoefficient, typeIISeparatedH, mul_assoc] end Bounty section /- Compact Fourier separation of the literal Type II coupled cutoff. -/ open Finset Filter MeasureTheory Real open scoped Topology namespace ThirdTypeIICompact open Bounty noncomputable def phase (x : Fin 3 → ℝ) (ξ : EuclideanSpace ℝ (Fin 3)) : ℂ := ∏ i, (x i : ℂ) ^ (((2 * Real.pi * ξ i : ℝ) : ℂ) * Complex.I) noncomputable def weight (A L U V E Z : ℝ) (k : ℤ) (ξ : EuclideanSpace ℝ (Fin 3)) : ℂ := (∏ i, ((![U,U,Z] i : ℝ) : ℂ) ^ (-((2 * Real.pi * ξ i : ℝ) : ℂ) * Complex.I)) * typeIIPulledFourier A (L^88) (U/(2*(k:ℝ)*E)) (Z/((k:ℝ)*U*V)) (1/(U*V)) ξ noncomputable def cutoff (L V E : ℝ) (k : ℤ) (x : Fin 3 → ℝ) : ℝ := typeIIEMajorant (L^88) (((x 1-x 0)/(2*(k:ℝ)))/E) * typeIINMajorant (((x 1-x 0)*x 2/((k:ℝ)*x 0*x 1)+1/x 0)/V) theorem weight_mul_phase_eq (A L U V E Z : ℝ) (k : ℤ) (x : Fin 3 → ℝ) (hU : 0 < U) (hZ : 0 < Z) (hx : ∀ i, 0 < x i) (ξ : EuclideanSpace ℝ (Fin 3)) : weight A L U V E Z k ξ * phase x ξ = typeIIPulledFourierIntegrand A (L^88) (U/(2*(k:ℝ)*E)) (Z/((k:ℝ)*U*V)) (1/(U*V)) (typeIILogCoordinates x ![U,U,Z]) ξ := by have hs : ∀ i, 0 < (![U,U,Z] i : ℝ) := by intro i; fin_cases i <;> assumption rw [typeIIPulledFourierIntegrand, typeII_pulled_logarithmic_phase_separation x _ hx hs] unfold weight phase ring theorem exists_coupled_cutoff_separation {A K D : ℝ} (hA : 0 ≤ A) (hD : 0 ≤ D) : ∃ F : ℝ, 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ (U V E Z : ℝ) (k : ℤ), 0 < U → 0 < V → 0 < Z → k ≠ 0 → E = U*L^(-K) → 1 ≤ U*V → Z ≤ 24*U^2*V*L^88/E → ∀ x : Fin 3 → ℝ, (∀ i, 0 < x i) → (∀ i, typeIILogCoordinates x ![U,U,Z] i ∈ Set.Icc (-A) A) → ‖(cutoff L V E k x : ℂ) - ∫ ξ in {ξ : EuclideanSpace ℝ (Fin 3) | ‖ξ‖ ≤ L^F}, weight A L U V E Z k ξ * phase x ξ‖ ≤ L^(-D) := by have ha : 0 ≤ typeIIScaleEnvelopeExponent K (K+89) := by unfold typeIIScaleEnvelopeExponent exact (le_max_right _ _).trans ((le_max_right _ _).trans (le_max_right _ _)) obtain ⟨F, hF, hcut⟩ := typeII_pulled_fourier_exists_power_cutoff hA ha hD refine ⟨F, hF, ?_⟩ filter_upwards [hcut, eventually_ge_atTop (24:ℝ)] with L hcut hL intro U V E Z k hU hV hZ hk hE hUV hZbound x hx hbox have hp := typeII_localized_parameter_envelope hL hU hV hZ.le hk hE hUV hZbound have hb := hcut (typeIIScaleParameters L U V E Z k) hp (typeIILogCoordinates x ![U,U,Z]) have hxvec : ![x 0,x 1,x 2] = x := by ext i; fin_cases i <;> rfl have he := typeII_scale_log_cutoff_eq_majorants (L := L) (E := E) (k := (k:ℝ)) (hx 0) (hx 1) (hx 2) hU hV hZ (by exact_mod_cast hk) (by simpa only [hxvec] using hbox) simp only [hxvec] at he change ‖(typeIIPulledCutoff A (L^88) (U/(2*(k:ℝ)*E)) (Z/((k:ℝ)*U*V)) (1/(U*V)) (typeIILogCoordinates x ![U,U,Z]) : ℂ) - ∫ ξ in {ξ : EuclideanSpace ℝ (Fin 3) | ‖ξ‖ ≤ L^F}, typeIIPulledFourierIntegrand A (L^88) (U/(2*(k:ℝ)*E)) (Z/((k:ℝ)*U*V)) (1/(U*V)) (typeIILogCoordinates x ![U,U,Z]) ξ‖ ≤ L^(-D) at hb rw [he] at hb simpa only [cutoff, ← weight_mul_phase_eq A L U V E Z k x hU hZ hx] using hb theorem integrable_weight_mul_phase (A L U V E Z : ℝ) (k : ℤ) (x : Fin 3 → ℝ) (hU : 0 < U) (hZ : 0 < Z) (hx : ∀ i, 0 < x i) : Integrable (fun ξ => weight A L U V E Z k ξ * phase x ξ) := by simpa only [weight_mul_phase_eq A L U V E Z k x hU hZ hx] using typeII_pulled_fourier_integrand_integrable A (L^88) (U/(2*(k:ℝ)*E)) (Z/((k:ℝ)*U*V)) (1/(U*V)) (typeIILogCoordinates x ![U,U,Z]) theorem finite_cutoff_error {ι : Type*} (S : Finset ι) (ω : ι → ℂ) (x : ι → Fin 3 → ℝ) (A L U V E Z : ℝ) (k : ℤ) (T : Set (EuclideanSpace ℝ (Fin 3))) (ε : ℝ) (hU : 0 < U) (hZ : 0 < Z) (hx : ∀ i ∈ S, ω i ≠ 0 → ∀ j, 0 < x i j) (herr : ∀ i ∈ S, ω i ≠ 0 → ‖(cutoff L V E k (x i) : ℂ) - ∫ ξ in T, weight A L U V E Z k ξ * phase (x i) ξ‖ ≤ ε) : ‖(∑ i ∈ S, ω i * (cutoff L V E k (x i) : ℂ)) - ∫ ξ in T, weight A L U V E Z k ξ * ∑ i ∈ S, ω i * phase (x i) ξ‖ ≤ ε * ∑ i ∈ S, ‖ω i‖ := by have hi (i : ι) (h : i ∈ S) : IntegrableOn (fun ξ => ω i * (weight A L U V E Z k ξ * phase (x i) ξ)) T := by by_cases hz : ω i = 0 · simp only [hz, zero_mul] exact integrableOn_zero · exact ((integrable_weight_mul_phase A L U V E Z k (x i) hU hZ (hx i h hz)).const_mul _).integrableOn have hs : (fun ξ => weight A L U V E Z k ξ * ∑ i ∈ S, ω i * phase (x i) ξ) = fun ξ => ∑ i ∈ S, ω i * (weight A L U V E Z k ξ * phase (x i) ξ) := by funext ξ rw [mul_sum] apply sum_congr rfl intro i _ ring rw [hs, integral_finsetSum S hi] simp_rw [integral_const_mul] rw [← sum_sub_distrib] calc _ ≤ ∑ i ∈ S, ‖ω i * (cutoff L V E k (x i) : ℂ) - ω i * ∫ ξ in T, weight A L U V E Z k ξ * phase (x i) ξ‖ := norm_sum_le _ _ _ ≤ ∑ i ∈ S, ε * ‖ω i‖ := by apply sum_le_sum intro i h by_cases hz : ω i = 0 · simp only [hz, zero_mul, sub_zero, norm_zero, mul_zero, le_refl] · rw [← mul_sub, norm_mul, mul_comm ε] exact mul_le_mul_of_nonneg_left (herr i h hz) (norm_nonneg _) _ = _ := (mul_sum ..).symm theorem exists_finite_coupled_cutoff_separation {A K D : ℝ} (hA : 0 ≤ A) (hD : 0 ≤ D) : ∃ F : ℝ, 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ (U V E Z : ℝ) (k : ℤ), 0 < U → 0 < V → 0 < Z → k ≠ 0 → E = U*L^(-K) → 1 ≤ U*V → Z ≤ 24*U^2*V*L^88/E → ∀ {ι : Type} (S : Finset ι) (ω : ι → ℂ) (x : ι → Fin 3 → ℝ), (∀ i ∈ S, ω i ≠ 0 → (∀ j, 0 < x i j) ∧ (∀ j, typeIILogCoordinates (x i) ![U,U,Z] j ∈ Set.Icc (-A) A)) → ‖(∑ i ∈ S, ω i * (cutoff L V E k (x i) : ℂ)) - ∫ ξ in {ξ : EuclideanSpace ℝ (Fin 3) | ‖ξ‖ ≤ L^F}, weight A L U V E Z k ξ * ∑ i ∈ S, ω i * phase (x i) ξ‖ ≤ L^(-D) * ∑ i ∈ S, ‖ω i‖ := by obtain ⟨F, hF, hcut⟩ := exists_coupled_cutoff_separation (K := K) hA hD refine ⟨F, hF, ?_⟩ filter_upwards [hcut] with L hcut intro U V E Z k hU hV hZ hk hE hUV hZbound ι S ω x hx exact finite_cutoff_error S ω x A L U V E Z k _ _ hU hZ (fun i hi hn => (hx i hi hn).1) (fun i hi hn => hcut U V E Z k hU hV hZ hk hE hUV hZbound (x i) (hx i hi hn).1 (hx i hi hn).2) theorem weight_norm (A L U V E Z : ℝ) (k : ℤ) (hU : 0 < U) (hZ : 0 < Z) (ξ : EuclideanSpace ℝ (Fin 3)) : ‖weight A L U V E Z k ξ‖ = ‖typeIIPulledFourier A (L^88) (U/(2*(k:ℝ)*E)) (Z/((k:ℝ)*U*V)) (1/(U*V)) ξ‖ := by have hs : ∀ i, 0 < (![U,U,Z] i : ℝ) := by intro i; fin_cases i <;> assumption have hp : ‖∏ i, ((![U,U,Z] i : ℝ) : ℂ) ^ (-((2 * Real.pi * ξ i : ℝ) : ℂ) * Complex.I)‖ = 1 := by rw [norm_prod] apply prod_eq_one intro i _ rw [Complex.norm_cpow_eq_rpow_re_of_pos (hs i)] simp rw [weight, norm_mul, hp, one_mul] theorem exists_weight_l1_bound {A K : ℝ} (hA : 0 ≤ A) : ∃ C : ℝ, 0 < C ∧ ∀ᶠ L : ℝ in atTop, ∀ (U V E Z : ℝ) (k : ℤ), 0 < U → 0 < V → 0 < Z → k ≠ 0 → E = U*L^(-K) → 1 ≤ U*V → Z ≤ 24*U^2*V*L^88/E → (∫ ξ : EuclideanSpace ℝ (Fin 3), ‖weight A L U V E Z k ξ‖) ≤ L^C := by have ha : 0 ≤ typeIIScaleEnvelopeExponent K (K+89) := by unfold typeIIScaleEnvelopeExponent exact (le_max_right _ _).trans ((le_max_right _ _).trans (le_max_right _ _)) obtain ⟨C, hC, hb⟩ := typeII_pulled_fourier_polynomial_l1_cost hA ha refine ⟨C, hC, ?_⟩ filter_upwards [hb, eventually_ge_atTop (24:ℝ)] with L hb hL intro U V E Z k hU hV hZ hk hE hUV hZbound have hp := typeII_localized_parameter_envelope hL hU hV hZ.le hk hE hUV hZbound simp_rw [weight_norm A L U V E Z k hU hZ] exact hb (typeIIScaleParameters L U V E Z k) hp theorem integral_weight_le (A L U V E Z : ℝ) (k : ℤ) (hU : 0 < U) (hZ : 0 < Z) (T : Set (EuclideanSpace ℝ (Fin 3))) (hT : MeasurableSet T) (f : EuclideanSpace ℝ (Fin 3) → ℂ) {R : ℝ} (hR : 0 ≤ R) (hf : ∀ ξ ∈ T, ‖f ξ‖ ≤ R) : ‖∫ ξ in T, weight A L U V E Z k ξ * f ξ‖ ≤ (∫ ξ : EuclideanSpace ℝ (Fin 3), ‖weight A L U V E Z k ξ‖) * R := by have hi : Integrable (fun ξ => ‖weight A L U V E Z k ξ‖) := by simp_rw [weight_norm A L U V E Z k hU hZ] exact (typeII_pulled_fourier_integrable A (L^88) (U/(2*(k:ℝ)*E)) (Z/((k:ℝ)*U*V)) (1/(U*V))).norm calc _ ≤ ∫ ξ in T, ‖weight A L U V E Z k ξ‖ * R := by apply norm_integral_le_of_norm_le (hi.mul_const R).integrableOn filter_upwards [ae_restrict_mem hT] with ξ hξ rw [norm_mul] exact mul_le_mul_of_nonneg_left (hf ξ hξ) (norm_nonneg _) _ = (∫ ξ in T, ‖weight A L U V E Z k ξ‖) * R := integral_mul_const _ _ _ ≤ _ := mul_le_mul_of_nonneg_right (setIntegral_le_integral hi (Eventually.of_forall (fun _ => norm_nonneg _))) hR theorem exists_finite_cutoff_bound {A K : ℝ} (hA : 0 ≤ A) : ∃ C : ℝ, 0 < C ∧ ∀ D : ℝ, 0 ≤ D → ∃ F : ℝ, 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ (U V E Z : ℝ) (k : ℤ), 0 < U → 0 < V → 0 < Z → k ≠ 0 → E = U*L^(-K) → 1 ≤ U*V → Z ≤ 24*U^2*V*L^88/E → ∀ {ι : Type} (S : Finset ι) (ω : ι → ℂ) (x : ι → Fin 3 → ℝ), (∀ i ∈ S, ω i ≠ 0 → (∀ j, 0 < x i j) ∧ (∀ j, typeIILogCoordinates (x i) ![U,U,Z] j ∈ Set.Icc (-A) A)) → ∀ R : ℝ, 0 ≤ R → (∀ ξ : EuclideanSpace ℝ (Fin 3), ‖ξ‖ ≤ L^F → ‖∑ i ∈ S, ω i * phase (x i) ξ‖ ≤ R) → ‖∑ i ∈ S, ω i * (cutoff L V E k (x i) : ℂ)‖ ≤ L^(-D) * ∑ i ∈ S, ‖ω i‖ + L^C * R := by obtain ⟨C, hC, hcost⟩ := exists_weight_l1_bound (K := K) hA refine ⟨C, hC, ?_⟩ intro D hD obtain ⟨F, hF, hcut⟩ := exists_finite_coupled_cutoff_separation (K := K) hA hD refine ⟨F, hF, ?_⟩ filter_upwards [hcost, hcut] with L hcost hcut intro U V E Z k hU hV hZ hk hE hUV hZbound ι S ω x hx R hR hf have he := hcut U V E Z k hU hV hZ hk hE hUV hZbound S ω x hx let t := ∫ ξ in {ξ : EuclideanSpace ℝ (Fin 3) | ‖ξ‖ ≤ L^F}, weight A L U V E Z k ξ * ∑ i ∈ S, ω i * phase (x i) ξ have ht : ‖t‖ ≤ L^C * R := (integral_weight_le A L U V E Z k hU hZ _ (isClosed_le continuous_norm continuous_const).measurableSet _ hR hf).trans (mul_le_mul_of_nonneg_right (hcost U V E Z k hU hV hZ hk hE hUV hZbound) hR) calc _ = ‖((∑ i ∈ S, ω i * (cutoff L V E k (x i) : ℂ))-t)+t‖ := by rw [sub_add_cancel] _ ≤ ‖(∑ i ∈ S, ω i * (cutoff L V E k (x i) : ℂ))-t‖+‖t‖ := norm_add_le _ _ _ ≤ _ := add_le_add he ht end ThirdTypeIICompact end section /- Direct dyadic character estimates from the compact cutoff bound. -/ open Finset Filter MeasureTheory Real open scoped Topology ComplexConjugate namespace ThirdTypeIIEnergy open Bounty ThirdTypeIICompact def coordinates (y : TypeIIShiftIndex) : Fin 3 → ℝ := ![(y.2.1.1:ℝ),(y.2.2.1:ℝ),(y.1.2:ℝ)] noncomputable def amplitude (Z : ℝ) {d : ℕ} (χ : DirichletCharacter ℂ d) (α aH : ℕ → ℂ) (y : TypeIIShiftIndex) : ℂ := (typeIISmoothDyadic ((y.1.2:ℝ)/Z):ℂ) * typeIICrossCharacterAmplitude χ α aH y theorem exists_dyadic_character_bound (K : ℝ) : ∃ C : ℝ, 0 < C ∧ ∀ D : ℝ, 0 ≤ D → ∃ F : ℝ, 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ (U V E Z : ℝ) (k : ℤ), 0 < U → 0 < V → 0 < Z → k ≠ 0 → E = U*L^(-K) → 1 ≤ U*V → Z ≤ 24*U^2*V*L^88/E → ∀ (M H Zs : Finset ℕ) (α aH : ℕ → ℂ) (χ : DirichletCharacter ℂ (2*k.natAbs)), (∀ m ∈ M, (m:ℝ) ∈ Set.Icc U (2*U)) → (∀ z ∈ Zs, 0 < z ∧ 0 < (z:ℤ)+k) → ∀ R : ℝ, 0 ≤ R → (∀ ξ : EuclideanSpace ℝ (Fin 3), ‖ξ‖ ≤ L^F → ‖∑ y ∈ typeIICrossSlice M H Zs k, amplitude Z χ α aH y * phase (coordinates y) ξ‖ ≤ R) → ‖∑ y ∈ typeIICrossSlice M H Zs k, (typeIISmoothDyadic ((y.1.2:ℝ)/Z):ℂ) * typeIIRealShiftWeight (fun e n => typeIIEMajorant (L^88) (e/E) * typeIINMajorant (n/V)) α aH y * χ (y.2.1.1 : ZMod (2*k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2*k.natAbs)))‖ ≤ L^(-D) * (∑ z ∈ Zs, factorizationAbsoluteMass M H α aH z * factorizationAbsoluteMass M H α aH ((z:ℤ)+k).toNat) + L^C * R := by classical obtain ⟨C, hC, hbound⟩ := exists_finite_cutoff_bound (A := 1) (K := K) (by norm_num) refine ⟨C, hC, ?_⟩ intro D hD obtain ⟨F, hF, hbound⟩ := hbound D hD refine ⟨F, hF, ?_⟩ filter_upwards [hbound, eventually_ge_atTop (1:ℝ)] with L hbound hL intro U V E Z k hU hV hZ hk hE hUV hZbound M H Zs α aH χ hM hpos R hR hphase have hMpos : ∀ m ∈ M, 0 < m := by intro m hm exact_mod_cast hU.trans_le (hM m hm).1 have hgeom : ∀ y ∈ typeIICrossSlice M H Zs k, amplitude Z χ α aH y ≠ 0 → (∀ i, 0 < coordinates y i) ∧ (∀ i, typeIILogCoordinates (coordinates y) ![U,U,Z] i ∈ Set.Icc (-1) 1) := by intro y hy hn obtain ⟨hks, hpairs⟩ := mem_product.mp (mem_filter.mp hy).1 obtain ⟨hm, hm'⟩ := mem_product.mp hpairs have hmy := hM _ (mem_product.mp hm).1 have hm'y := hM _ (mem_product.mp hm').1 have hzy := (hpos _ (mem_product.mp hks).2).1 have hψ : typeIISmoothDyadic ((y.1.2:ℝ)/Z) ≠ 0 := by intro hz exact hn (by simp only [amplitude, hz, Complex.ofReal_zero, zero_mul]) constructor · intro i fin_cases i · exact hU.trans_le hmy.1 · exact hU.trans_le hm'y.1 · change (0:ℝ) < (y.1.2:ℝ) exact_mod_cast hzy · intro i fin_cases i · exact typeII_factor_two_log_box hU hmy · exact typeII_factor_two_log_box hU hm'y · exact typeII_smooth_dyadic_log_box hψ have hb := hbound U V E Z k hU hV hZ hk hE hUV hZbound (typeIICrossSlice M H Zs k) (amplitude Z χ α aH) coordinates hgeom R hR hphase have hsum : (∑ y ∈ typeIICrossSlice M H Zs k, amplitude Z χ α aH y * (cutoff L V E k (coordinates y):ℂ)) = ∑ y ∈ typeIICrossSlice M H Zs k, (typeIISmoothDyadic ((y.1.2:ℝ)/Z):ℂ) * typeIIRealShiftWeight (fun e n => typeIIEMajorant (L^88) (e/E) * typeIINMajorant (n/V)) α aH y * χ (y.2.1.1 : ZMod (2*k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2*k.natAbs))) := by apply sum_congr rfl intro y hy have hky : y.1.1 = k := mem_singleton.mp (mem_product.mp (mem_product.mp (mem_filter.mp hy).1).1).1 dsimp only [amplitude, cutoff, coordinates, typeIIRealShiftWeight, typeIICrossCharacterAmplitude, typeIIRealE, typeIIRealN] rw [hky] push_cast ring rw [hsum] at hb apply hb.trans apply add_le_add _ le_rfl apply mul_le_mul_of_nonneg_left _ (Real.rpow_nonneg (by linarith : 0 ≤ L) _) exact typeII_cross_character_absolute_mass_le M H Zs k Z typeIISmoothDyadic α aH χ hMpos hk (fun z _ => by rw [abs_of_nonneg (typeII_smooth_dyadic_bounds _).1]; exact (typeII_smooth_dyadic_bounds _).2) hpos theorem localized_factorization_mass (M H Zs : Finset ℕ) (α aH : ℕ → ℂ) (k : ℤ) (Z : ℝ) {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hα : ∀ m ∈ M, ‖α m‖ ≤ A) (haH : ∀ h ∈ H, h ≠ 0 → ‖aH h‖ ≤ B*(h.divisors.card:ℝ)) (hpos : ∀ z ∈ Zs, 0 < z ∧ 0 < (z:ℤ)+k) (hloc : ∀ z ∈ Zs, (z:ℝ) ≤ 2*Z) (hk : |(k:ℝ)| ≤ Z) : (∑ z ∈ Zs, factorizationAbsoluteMass M H α aH z * factorizationAbsoluteMass M H α aH ((z:ℤ)+k).toNat) ≤ (A*B)^2*(⌈3*Z⌉₊:ℝ)*(1+log (⌈3*Z⌉₊:ℝ))^15 := by have hZ : 0 ≤ Z := (abs_nonneg (k:ℝ)).trans hk have hN : ∀ z ∈ Zs, z ≤ ⌈3*Z⌉₊ ∧ ((z:ℤ)+k).toNat ≤ ⌈3*Z⌉₊ := by intro z hz have hc : 3*Z ≤ (⌈3*Z⌉₊:ℝ) := Nat.le_ceil _ have hzR := hloc z hz have hkR := (abs_le.mp hk).2 constructor · exact_mod_cast (show (z:ℝ) ≤ (⌈3*Z⌉₊:ℝ) by linarith) · have hi : (z:ℤ)+k ≤ (⌈3*Z⌉₊:ℤ) := by exact_mod_cast (show (((z:ℤ)+k:ℤ):ℝ) ≤ (⌈3*Z⌉₊:ℝ) by push_cast; linarith) omega exact factorization_absolute_cross_moment Zs (fun z => z) (fun z => ((z:ℤ)+k).toNat) ⌈3*Z⌉₊ M H α aH hA hB hα haH (by intro x _ y _ h; exact h) (by intro x hx y hy h have := (hpos x hx).2 have := (hpos y hy).2 change ((x:ℤ)+k).toNat = ((y:ℤ)+k).toNat at h omega) (fun z hz => Nat.ne_of_gt (hpos z hz).1) (by intro z hz; have := (hpos z hz).2; omega) (fun z hz => (hN z hz).1) (fun z hz => (hN z hz).2) theorem exists_dyadic_power_bound (K : ℝ) : ∃ C : ℝ, 0 < C ∧ ∀ A B D : ℝ, ∃ F : ℝ, 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ (U V E Z : ℝ) (k : ℤ), 0 < U → 0 < V → 1 ≤ Z → k ≠ 0 → E = U*L^(-K) → 1 ≤ U*V → Z ≤ 24*U^2*V*L^88/E → log Z ≤ 3*L → |(k:ℝ)| ≤ Z → ∀ (M H Zs : Finset ℕ) (α aH : ℕ → ℂ) (χ : DirichletCharacter ℂ (2*k.natAbs)), (∀ m ∈ M, (m:ℝ) ∈ Set.Icc U (2*U)) → (∀ z ∈ Zs, 0 < z ∧ 0 < (z:ℤ)+k) → (∀ z ∈ Zs, (z:ℝ) ≤ 2*Z) → (∀ m ∈ M, ‖α m‖ ≤ L^A) → (∀ h ∈ H, h ≠ 0 → ‖aH h‖ ≤ L^B*(h.divisors.card:ℝ)) → ∀ R : ℝ, 0 ≤ R → (∀ ξ : EuclideanSpace ℝ (Fin 3), ‖ξ‖ ≤ L^F → ‖∑ y ∈ typeIICrossSlice M H Zs k, amplitude Z χ α aH y * phase (coordinates y) ξ‖ ≤ R) → ‖∑ y ∈ typeIICrossSlice M H Zs k, (typeIISmoothDyadic ((y.1.2:ℝ)/Z):ℂ) * typeIIRealShiftWeight (fun e n => typeIIEMajorant (L^88) (e/E) * typeIINMajorant (n/V)) α aH y * χ (y.2.1.1 : ZMod (2*k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2*k.natAbs)))‖ ≤ Z*L^(-D) + L^C * R := by obtain ⟨C, hC, hbound⟩ := exists_dyadic_character_bound K refine ⟨C, hC, ?_⟩ intro A B D let T := max 0 (D+2*(A+B)+16) obtain ⟨F, hF, hbound⟩ := hbound T (le_max_left _ _) refine ⟨F, hF, ?_⟩ filter_upwards [hbound, eventually_localized_divisor_moment_cost (by norm_num : (0:ℝ) ≤ 3), eventually_ge_atTop (1:ℝ)] with L hbound hcost hL intro U V E Z k hU hV hZ hk hE hUV hZupper hlog hksize M H Zs α aH χ hM hpos hloc hα haH R hR hphase have hL0 : 0 < L := zero_lt_one.trans_le hL have hZ0 : 0 < Z := zero_lt_one.trans_le hZ have hb := hbound U V E Z k hU hV hZ0 hk hE hUV hZupper M H Zs α aH χ hM hpos R hR hphase have hm := localized_factorization_mass M H Zs α aH k Z (rpow_nonneg hL0.le A) (rpow_nonneg hL0.le B) hα haH hpos hloc hksize have hp : (L^A*L^B)^2 = L^(2*(A+B)) := by rw [← rpow_add hL0, ← rpow_mul_natCast hL0.le] congr 1 ring have hm' : (∑ z ∈ Zs, factorizationAbsoluteMass M H α aH z * factorizationAbsoluteMass M H α aH ((z:ℤ)+k).toNat) ≤ Z*L^(2*(A+B)+16) := by calc _ ≤ (L^A*L^B)^2*(⌈3*Z⌉₊:ℝ)*(1+log (⌈3*Z⌉₊:ℝ))^15 := hm _ = L^(2*(A+B))*((⌈3*Z⌉₊:ℝ)*(1+log (⌈3*Z⌉₊:ℝ))^15) := by rw [hp]; ring _ ≤ L^(2*(A+B))*(Z*L^(16:ℝ)) := mul_le_mul_of_nonneg_left (hcost Z hZ hlog) (rpow_nonneg hL0.le _) _ = _ := by rw [rpow_add hL0]; ring have he : L^(-T)*(Z*L^(2*(A+B)+16)) ≤ Z*L^(-D) := by calc _ = Z*L^(-T+(2*(A+B)+16)) := by rw [rpow_add hL0 (-T) (2*(A+B)+16)]; ring _ ≤ _ := mul_le_mul_of_nonneg_left (rpow_le_rpow_of_exponent_le hL (by have := le_max_right 0 (D+2*(A+B)+16); dsimp only [T]; linarith)) hZ0.le exact hb.trans (add_le_add ((mul_le_mul_of_nonneg_left hm' (rpow_nonneg hL0.le _)).trans he) le_rfl) end ThirdTypeIIEnergy end section /- The finite spatial phase sum, normalized as a harmonic correlation. -/ open Finset open scoped ComplexConjugate namespace CompactTypeIIHarmonic open Bounty theorem phase_sum_eq_harmonic (Z : ℝ) (k : ℤ) (M H Zs : Finset ℕ) (α : ℕ → ℂ) (W : ℕ → ℝ) (B : ℕ → ℂ) (ρ : ℝ) (χ : DirichletCharacter ℂ (2*k.natAbs)) (hM : ∀ m ∈ M, 0 < m) (hk : k ≠ 0) (hZ : 0 < Z) (hpos : ∀ z ∈ Zs, 0 < z ∧ 0 < (z : ℤ)+k) (ξ : EuclideanSpace ℝ (Fin 3)) : (∑ y ∈ typeIICrossSlice M H Zs k, ((typeIISmoothDyadic ((y.1.2:ℝ)/Z):ℂ) * typeIICrossCharacterAmplitude χ α (typeIISeparatedH W B ρ) y) * (∏ i, ((![(y.2.1.1:ℝ),(y.2.2.1:ℝ),(y.1.2:ℝ)] : Fin 3 → ℝ) i : ℂ) ^ (((2*Real.pi*ξ i : ℝ):ℂ)*Complex.I))) = (Z : ℂ) * ∑ z ∈ Zs, ((typeIIHarmonicDyadic ((z:ℝ)/Z)/(z:ℝ):ℝ):ℂ) * typeIICrossPairCoefficient M H (fun m => α m*χ (m : ZMod (2*k.natAbs))) W B ρ (2*Real.pi*ξ 0) (2*Real.pi*ξ 1) (2*Real.pi*ξ 2) z ((z:ℤ)+k).toNat := by classical calc _ = ∑ y ∈ typeIICrossSlice M H Zs k, ((typeIISmoothDyadic ((y.1.2:ℝ)/Z):ℂ) * typeIICrossCharacterAmplitude χ α (typeIISeparatedH W B ρ) y) * typeIICrossFourierPowers y ξ := by apply sum_congr rfl intro y hy have hy' := mem_product.mp (mem_filter.mp hy).1 have hm := (mem_product.mp (mem_product.mp hy'.2).1).1 have hm' := (mem_product.mp (mem_product.mp hy'.2).2).1 have hz := (mem_product.mp hy'.1).2 rw [typeII_cross_fourier_powers_eq y (hM _ hm) (hM _ hm') (hpos _ hz).1 ξ] _ = ∑ z ∈ Zs, (typeIISmoothDyadic ((z:ℝ)/Z):ℂ) * typeIICrossPairCoefficient M H (fun m => α m*χ (m : ZMod (2*k.natAbs))) W B ρ (2*Real.pi*ξ 0) (2*Real.pi*ξ 1) (2*Real.pi*ξ 2) z ((z:ℤ)+k).toNat := by rw [typeII_cross_slice_sum_singletons M H Zs k _ hM hk] apply sum_congr rfl intro z hz rw [← typeII_cross_slice_singleton_eq_cross_pair_coefficient M H k z ((z:ℤ)+k).toNat (fun m => α m*χ (m : ZMod (2*k.natAbs))) W B ρ (2*Real.pi*ξ 0) (2*Real.pi*ξ 1) (2*Real.pi*ξ 2) hM hk (Int.toNat_of_nonneg (hpos z hz).2.le).symm, mul_sum] apply sum_congr rfl intro y hy have hzy : y.1.2 = z := mem_singleton.mp (mem_product.mp (mem_product.mp (mem_filter.mp hy).1).1).2 simp only [typeIICrossCharacterAmplitude, typeIICrossFourierPowers, hzy, map_mul] ring _ = _ := by rw [typeII_finite_harmonic_normalization Zs hZ typeIISmoothDyadic _ (fun z hz => (hpos z hz).1)] rfl end CompactTypeIIHarmonic end section /- A direct dyadic Type II estimate from the literal harmonic correlation. -/ open Finset Filter MeasureTheory Real open scoped Topology ComplexConjugate namespace ThirdTypeIIHarmonic open Bounty ThirdTypeIICompact ThirdTypeIIEnergy theorem exists_dyadic_harmonic_bound (K a b D : ℝ) : ∃ Q F : ℝ, 0 < Q ∧ 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ (U V E Z : ℝ) (k : ℤ), 0 < U → 0 < V → 1 ≤ Z → k ≠ 0 → E = U*L^(-K) → 1 ≤ U*V → Z ≤ 24*U^2*V*L^88/E → log Z ≤ 3*L → |(k:ℝ)| ≤ Z → ∀ (M H Zs : Finset ℕ) (α : ℕ → ℂ) (W : ℕ → ℝ) (B : ℕ → ℂ) (ρ : ℝ) (χ : DirichletCharacter ℂ (2*k.natAbs)), (∀ m ∈ M, (m:ℝ) ∈ Set.Icc U (2*U)) → (∀ z ∈ Zs, 0 < z ∧ 0 < (z:ℤ)+k) → (∀ z ∈ Zs, (z:ℝ) ≤ 2*Z) → (∀ m ∈ M, ‖α m‖ ≤ L^a) → (∀ h ∈ H, h ≠ 0 → ‖typeIISeparatedH W B ρ h‖ ≤ L^b*(h.divisors.card:ℝ)) → (∀ ξ : EuclideanSpace ℝ (Fin 3), ‖ξ‖ ≤ L^F → ‖∑ z ∈ Zs, ((typeIIHarmonicDyadic ((z:ℝ)/Z)/(z:ℝ):ℝ):ℂ) * typeIICrossPairCoefficient M H (fun m => α m*χ (m : ZMod (2*k.natAbs))) W B ρ (2*Real.pi*ξ 0) (2*Real.pi*ξ 1) (2*Real.pi*ξ 2) z ((z:ℤ)+k).toNat‖ ≤ L^(-Q)) → ‖∑ y ∈ typeIICrossSlice M H Zs k, (typeIISmoothDyadic ((y.1.2:ℝ)/Z):ℂ) * typeIIRealShiftWeight (fun e n => typeIIEMajorant (L^88) (e/E) * typeIINMajorant (n/V)) α (typeIISeparatedH W B ρ) y * χ (y.2.1.1 : ZMod (2*k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2*k.natAbs)))‖ ≤ Z*L^(-D) := by obtain ⟨C, hC, hbound⟩ := exists_dyadic_power_bound K obtain ⟨F, hF, hbound⟩ := hbound a b (D+1) let Q := max 1 (C+D+1) refine ⟨Q, F, lt_of_lt_of_le zero_lt_one (le_max_left _ _), hF, ?_⟩ filter_upwards [hbound, eventually_ge_atTop (2:ℝ)] with L hbound hL intro U V E Z k hU hV hZ hk hE hUV hZupper hlog hksize M H Zs α W B ρ χ hM hpos hloc hα haH hcorr have hL0 : 0 < L := by linarith have hZ0 : 0 < Z := zero_lt_one.trans_le hZ have hMpos : ∀ m ∈ M, 0 < m := by intro m hm exact_mod_cast hU.trans_le (hM m hm).1 have hphase : ∀ ξ : EuclideanSpace ℝ (Fin 3), ‖ξ‖ ≤ L^F → ‖∑ y ∈ typeIICrossSlice M H Zs k, amplitude Z χ α (typeIISeparatedH W B ρ) y * phase (coordinates y) ξ‖ ≤ Z*L^(-Q) := by intro ξ hξ have he := CompactTypeIIHarmonic.phase_sum_eq_harmonic Z k M H Zs α W B ρ χ hMpos hk hZ0 hpos ξ change (∑ y ∈ typeIICrossSlice M H Zs k, amplitude Z χ α (typeIISeparatedH W B ρ) y * phase (coordinates y) ξ) = _ at he rw [he, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hZ0] exact mul_le_mul_of_nonneg_left (hcorr ξ hξ) hZ0.le have hb := hbound U V E Z k hU hV hZ hk hE hUV hZupper hlog hksize M H Zs α (typeIISeparatedH W B ρ) χ hM hpos hloc hα haH (Z*L^(-Q)) (by positivity) hphase have hexp : C-Q ≤ -(D+1) := by have := le_max_right 1 (C+D+1) dsimp only [Q] linarith have hp : L^C*(Z*L^(-Q)) ≤ Z*L^(-(D+1)) := by calc _ = Z*L^(C-Q) := by rw [sub_eq_add_neg, rpow_add hL0 C (-Q)]; ring _ ≤ _ := mul_le_mul_of_nonneg_left (rpow_le_rpow_of_exponent_le (by linarith) hexp) hZ0.le have hsum : Z*L^(-(D+1))+Z*L^(-(D+1)) ≤ Z*L^(-D) := by rw [show -(D+1) = -D-1 by ring, rpow_sub hL0, rpow_one] calc _ = (2/L)*(Z*L^(-D)) := by ring _ ≤ _ := mul_le_of_le_one_left (by positivity) ((div_le_one hL0).mpr hL) exact hb.trans ((add_le_add le_rfl hp).trans hsum) end ThirdTypeIIHarmonic end section /- Norm bounds for the finite normalized character and determinant sums. -/ open Finset open scoped ComplexConjugate namespace CompactTypeIINormalization open Bounty theorem normalized_family_bound {n : ℕ} [NeZero n] {ι : Type*} (J : Finset ι) (S : DirichletCharacter ℂ n → ι → ℂ) (δ : ι → ℝ) (hS : ∀ χ, ∀ j ∈ J, ‖S χ j‖ ≤ δ j) : ‖(1/(n.totient:ℂ)) * ∑ χ, ∑ j ∈ J, S χ j‖ ≤ ∑ j ∈ J, δ j := by classical have hcard : Fintype.card (DirichletCharacter ℂ n) = n.totient := by rw [← Nat.card_eq_fintype_card] exact DirichletCharacter.card_eq_totient_of_hasEnoughRootsOfUnity ℂ n have hφ : (0:ℝ) < n.totient := by exact_mod_cast Nat.totient_pos.mpr (NeZero.pos n) rw [norm_mul, norm_div, norm_one, Complex.norm_natCast] calc _ ≤ (1/(n.totient:ℝ)) * ∑ _χ : DirichletCharacter ℂ n, ∑ j ∈ J, δ j := by apply mul_le_mul_of_nonneg_left _ (by positivity) apply (norm_sum_le _ _).trans apply sum_le_sum intro χ _ exact (norm_sum_le _ _).trans (sum_le_sum (hS χ)) _ = ∑ j ∈ J, δ j := by simp [hcard, ne_of_gt hφ] theorem character_slice_bound (L U V E : ℝ) (k : ℤ) (M H Zs : Finset ℕ) (α aH : ℕ → ℂ) (hL : 0 < L) (hU : 0 < U) (hV : 0 < V) (hE : 0 < E) (hUV : 4 ≤ U*V) (hk : k ≠ 0) (hM : ∀ m ∈ M, (m:ℝ) ∈ Set.Icc U (2*U)) (δ : ℕ → ℝ) (hδ : ∀ χ : DirichletCharacter ℂ (2*k.natAbs), ∀ j ∈ range (typeIISmoothDyadicCount L), ‖∑ y ∈ typeIICrossSlice M H Zs k, (typeIISmoothDyadic ((y.1.2:ℝ)/typeIISmoothDyadicScale U V E j):ℂ) * typeIIRealShiftWeight (fun e n => typeIIEMajorant (L^88) (e/E) * typeIINMajorant (n/V)) α aH y * χ (y.2.1.1 : ZMod (2*k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2*k.natAbs)))‖ ≤ δ j) : ‖typeIIRealCharacterSlice M H Zs k (fun e n => typeIIEMajorant (L^88) (e/E) * typeIINMajorant (n/V)) α aH‖ ≤ ∑ j ∈ range (typeIISmoothDyadicCount L), δ j := by classical let : NeZero (2*k.natAbs) := ⟨by simpa only [ne_eq, mul_eq_zero, OfNat.ofNat_ne_zero, false_or, Int.natAbs_eq_zero] using hk⟩ rw [typeIIRealCharacterSlice, dite_eq_right hk] unfold typeIIRealCharacterAverage simp_rw [typeII_majorant_character_dyadic_partition L U V E k M H Zs α aH _ hL hU hV hE hUV hM] exact normalized_family_bound _ _ δ hδ theorem signed_interval_norm_le (N : ℕ) (f : ℤ → ℂ) (δ : ℝ) (hzero : f 0 = 0) (hbound : ∀ k ∈ Icc (-(N:ℤ)) (N:ℤ), k ≠ 0 → ‖f k‖ ≤ δ) : ‖∑ k ∈ Icc (-(N:ℤ)) (N:ℤ), f k‖ ≤ (2*(N:ℝ))*δ := by classical have heq : (∑ k ∈ Icc (-(N:ℤ)) (N:ℤ), f k) = ∑ k ∈ (Icc (-(N:ℤ)) (N:ℤ)).filter (fun k => k ≠ 0), f k := by rw [sum_filter] apply sum_congr rfl intro k _ by_cases hk : k = 0 <;> simp [hk, hzero] rw [heq] calc _ ≤ ∑ _k ∈ (Icc (-(N:ℤ)) (N:ℤ)).filter (fun k => k ≠ 0), δ := by apply (norm_sum_le _ _).trans exact sum_le_sum (fun k hk => hbound k (mem_filter.mp hk).1 (mem_filter.mp hk).2) _ = (2*(N:ℝ))*δ := by simp [signed_interval_nonzero_card] end CompactTypeIINormalization end section /- A direct bound for the off-diagonal energy from harmonic correlations. -/ open Finset Filter Real open scoped ComplexConjugate namespace CompactTypeIIOffDiagonal open Bounty CompactTypeIINormalization theorem exists_off_diagonal_harmonic_bound (K a b T : ℝ) : ∃ Q F : ℝ, 0 < Q ∧ 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ (U V E Wrough : ℝ) (N : ℕ), 0 < U → 0 < V → E = U*L^(-K) → 4 ≤ U*V → max 1 (N:ℝ) ≤ typeIISmoothDyadicScale U V E 0 → log (24*U^2*V*L^88/E) ≤ 3*L → (2*U)/(2*(E/(2*L^88))) ≤ (N:ℝ) → (N:ℝ) ≤ Wrough → 2 ≤ Wrough → ∀ (M H : Finset ℕ) (α : ℕ → ℂ) (W : ℕ → ℝ) (B : ℕ → ℂ) (ρ : ℝ), (∀ m ∈ M, (m:ℝ) ∈ Set.Icc U (2*U)) → (∀ h ∈ H, 0 < h) → (∀ m ∈ M, ‖α m‖ ≤ L^a) → (∀ h ∈ H, h ≠ 0 → ‖typeIISeparatedH W B ρ h‖ ≤ L^b*(h.divisors.card:ℝ)) → (∀ m ∈ M, α m ≠ 0 → ∀ p ∈ m.primeFactors, Wrough < (p:ℝ)) → (∀ k ∈ Icc (-(N:ℤ)) (N:ℤ), k ≠ 0 → ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ χ : DirichletCharacter ℂ (2*k.natAbs), ∀ ξ : EuclideanSpace ℝ (Fin 3), ‖ξ‖ ≤ L^F → let M₀ := M.filter (fun m => α m ≠ 0) let Z := typeIISmoothDyadicScale U V E j let Zs := typeIIActiveCrossZ Z k (Icc 0 (M₀.sup id * H.sup id)) ‖∑ z ∈ Zs, ((typeIIHarmonicDyadic ((z:ℝ)/Z)/(z:ℝ):ℝ):ℂ) * typeIICrossPairCoefficient M₀ H (fun m => α m*χ (m : ZMod (2*k.natAbs))) W B ρ (2*Real.pi*ξ 0) (2*Real.pi*ξ 1) (2*Real.pi*ξ 2) z ((z:ℤ)+k).toNat‖ ≤ L^(-Q)) → typeIIOffDiagonalEnergy (Icc ⌈E/(2*L^88)⌉₊ ⌊2*E⌋₊) (Icc ⌈V/2⌉₊ ⌊3*V⌋₊) M H (fun e n => typeIIEMajorant (L^88) ((e:ℝ)/E) * typeIINMajorant ((n:ℝ)/V)) α (typeIISeparatedH W B ρ) ≤ (2*(N:ℝ)) * (∑ j ∈ range (typeIISmoothDyadicCount L), typeIISmoothDyadicScale U V E j) * L^(-T) := by classical obtain ⟨Q, F, hQ, hF, hbound⟩ := ThirdTypeIIHarmonic.exists_dyadic_harmonic_bound K a b T refine ⟨Q, F, hQ, hF, ?_⟩ filter_upwards [hbound, eventually_ge_atTop (1:ℝ)] with L hbound hL intro U V E Wrough N hU hV hE hUV hbase hlog hN hNW hWr M H α W B ρ hM hH hα haH hrough hcorr have hL0 : 0 < L := zero_lt_one.trans_le hL have hE0 : 0 < E := by rw [hE]; positivity let M₀ := M.filter (fun m => α m ≠ 0) let Zs := Icc 0 (M₀.sup id * H.sup id) let η := fun e n : ℝ => typeIIEMajorant (L^88) (e/E) * typeIINMajorant (n/V) let aH := typeIISeparatedH W B ρ have hM₀ : ∀ m ∈ M₀, (m:ℝ) ∈ Set.Icc U (2*U) := by intro m hm exact hM m (mem_filter.mp hm).1 have hslices : ∀ k ∈ Icc (-(N:ℤ)) (N:ℤ), k ≠ 0 → ‖typeIIRealCharacterSlice M₀ H Zs k η α aH‖ ≤ ∑ j ∈ range (typeIISmoothDyadicCount L), typeIISmoothDyadicScale U V E j * L^(-T) := by intro k hk hk0 apply character_slice_bound L U V E k M₀ H Zs α aH hL0 hU hV hE0 hUV hk0 hM₀ intro χ j hj let Z := typeIISmoothDyadicScale U V E j have hZ0 : 0 < Z := typeII_smooth_dyadic_scale_pos hU hV hE0 j have hZmono : typeIISmoothDyadicScale U V E 0 ≤ Z := typeII_smooth_dyadic_scale_mono_zero hU hV hE0 j have hZ1 : 1 ≤ Z := (le_trans (le_max_left _ _) hbase).trans hZmono have hZN : (N:ℝ) ≤ Z := (le_trans (le_max_right _ _) hbase).trans hZmono have hZupper : Z ≤ 24*U^2*V*L^88/E := typeII_smooth_dyadic_scale_le hL hU hV hE0 (mem_range.mp hj) have hZlog : log Z ≤ 3*L := (Real.log_le_log hZ0 hZupper).trans hlog have hksize : |(k:ℝ)| ≤ Z := by have hi : |k| ≤ (N:ℤ) := abs_le.mpr (mem_Icc.mp hk) have hr : |(k:ℝ)| ≤ (N:ℝ) := by exact_mod_cast hi exact hr.trans hZN have hb := hbound U V E Z k hU hV hZ1 hk0 hE (by linarith) hZupper hZlog hksize M₀ H (typeIIActiveCrossZ Z k Zs) α W B ρ χ hM₀ (fun z hz => ⟨(mem_filter.mp hz).2.1, (mem_filter.mp hz).2.2.1⟩) (fun z hz => (mem_filter.mp hz).2.2.2) (fun m hm => hα m (mem_filter.mp hm).1) haH (hcorr k hk hk0 j hj χ) have heq := typeII_smooth_cross_sum_active_support M₀ H Zs k Z (fun y => typeIIRealShiftWeight η α aH y * χ (y.2.1.1 : ZMod (2*k.natAbs)) * conj (χ (y.2.2.1 : ZMod (2*k.natAbs)))) hZ0 hH simp only [← mul_assoc] at heq rw [heq] exact hb have hMpos : ∀ m ∈ M, 0 < m := by intro m hm exact_mod_cast hU.trans_le (hM m hm).1 rw [typeII_majorant_off_diagonal_bounded M H α aH hL0 hE0 hV hMpos (fun m hm => (hM m hm).2) hN hNW hWr hrough, ← Complex.re_sum] apply (Complex.re_le_norm _).trans have hs := signed_interval_norm_le N (fun k => typeIIRealCharacterSlice M₀ H Zs k η α aH) (∑ j ∈ range (typeIISmoothDyadicCount L), typeIISmoothDyadicScale U V E j * L^(-T)) (by simp [typeIIRealCharacterSlice]) hslices simpa only [← sum_mul, mul_assoc] using hs end CompactTypeIIOffDiagonal end section /- The candidate bilinear estimate obtained directly from harmonic cancellation. -/ open Finset Filter Real namespace ThirdTypeIICandidate open Bounty theorem exists_candidate_B0_bound_of_harmonic {c b A D : ℝ} (hc : 0 < c) (hb : 0 < b) {r : ℕ} (hr : 6 ≤ r) : ∃ Kmin : ℝ, 0 < Kmin ∧ ∀ K : ℝ, Kmin ≤ K → ∃ Q F : ℝ, 0 < Q ∧ 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool), take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar (by omega) hj)) = false → ∀ (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (ν R U V : ℝ), Real.exp (b*L) ≤ U → U ≤ Real.exp L → Real.exp (b*L) ≤ V → V ≤ Real.exp L → 2*U*V ≤ R*Real.exp L → ∀ (P M N : Finset ℕ) (α β : ℕ → ℂ), (∀ p ∈ P, 0 < p) → (∀ m ∈ M, (m:ℝ) ∈ Set.Icc U (2*U)) → (∀ n ∈ N, (n:ℝ) ∈ Set.Icc V (2*V)) → (∀ m, m ∉ M → α m = 0) → (∀ n, n ∉ N → β n = 0) → (∀ m ∈ M, ‖α m‖ ≤ L^A) → (∀ n ∈ N, ‖β n‖ ≤ L^A) → (∀ m ∈ M, α m ≠ 0 → ∀ p ∈ m.primeFactors, Real.exp (Real.sqrt L) < (p:ℝ)) → (∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K:ℤ)) (typeIIAdmissibleDeterminantBound L K), k ≠ 0 → ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ χ : DirichletCharacter ℂ (2*k.natAbs), ∀ ζ : EuclideanSpace ℝ (Fin 3), ‖ζ‖ ≤ L^F → ‖candidateB0HarmonicCorrelation c L (1/2) r jStar P take (candidateAllocationFourierTwist c L r jStar take ξ) ν (typeIISmoothDyadicScale U V (U*L^(-K)) j) k M α χ ζ‖ ≤ L^(-Q)) → ‖candidateRetainedAllocationIntegrand c L (1/2) r jStar (Real.log (U*L^(-K))) P take (candidateBoxFiniteTest L (U*L^(-K)) (Icc 1 ⌊R*Real.exp L⌋₊) (fun u => typeIIMellinPhase ν u * ∑ m ∈ (2*u+1).divisors, α m*β ((2*u+1)/m))) ξ‖ ≤ (2*U*V*L^(-D/2)) * ‖activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ‖ := by classical obtain ⟨aE, aH, haE, haH, hcoeff⟩ := exists_candidate_B0_polynomial_bounds hc hr obtain ⟨Kmin, hKmin, hdiag⟩ := exists_typeII_actual_diagonal_saving (C := 2) (by norm_num) aE A A aH D refine ⟨Kmin, hKmin, ?_⟩ intro K hK have hK0 : 0 ≤ K := hKmin.le.trans hK obtain ⟨Q, F, hQ, hF, hoff⟩ := CompactTypeIIOffDiagonal.exists_off_diagonal_harmonic_bound K A aH (D+K+2*aE+2*A+177) refine ⟨Q, F, hQ, hF, ?_⟩ filter_upwards [hcoeff, hdiag, hoff, eventually_typeII_actual_dyadic_geometry hb hK0, eventually_ge_atTop (576:ℝ)] with L hcoeff hdiag hoff hgeo hL intro jStar hj take hkeep ξ ν R U V hUlo hUhi hVlo hVhi hR P M N α β hP hM hN hαsupport hβsupport hα hβ hrough hcorr have hL0 : 0 < L := by linarith obtain ⟨hU, hV, hE, hUV, hlogUV, hdet, hbase, hlog, hbound, hWr⟩ := hgeo U V (U*L^(-K)) hUlo hUhi hVlo hVhi rfl have hH : ∀ h ∈ candidateRetainedAllocationSupport c L r jStar P take, 0 < h := fun h hh => candidate_retained_allocation_support_pos c L r jStar P take hP hh obtain ⟨htaken, hretained⟩ := hcoeff jStar hj take hkeep ξ ν have hd := hdiag K U V M (candidateRetainedAllocationSupport c L r jStar P take) α (candidateB0RetainedCoefficient c L (1/2) r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) ν) hK hU hV (by linarith) hlogUV (fun m hm => Nat.cast_pos.mp (hU.trans_le (hM m hm).1)) (fun m hm => (hM m hm).2) hH hα (fun h hh => hretained h (hH h hh)) have he := hoff U V (U*L^(-K)) (Real.exp (Real.sqrt L)) (typeIIAdmissibleDeterminantBound L K) hU hV rfl hUV hbase hlog hdet hbound hWr M (candidateRetainedAllocationSupport c L r jStar P take) α (fun n => markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) (1/2) (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p:ℝ)) (fun _ => 1) (n:ℤ)) (fun h => candidateRemainingComplexCoefficient c L r jStar take (candidateAllocationFourierTwist c L r jStar take ξ) (primePoolFreePart ((candidatePIndices c L).biUnion (candidatePBand (c*L))) h)) (2*Real.pi*ν) hM hH hα (by intro h hh hn rw [← candidate_B0_retained_eq_separated] exact hretained h (hH h hh)) hrough hcorr rw [← candidate_B0_retained_eq_separated] at he have herr := typeII_actual_dyadic_error_saving (aE := aE) (A := A) (D := D) (T := D+K+2*aE+2*A+177) hL hK0 hU hV (E := U*L^(-K)) rfl (le_refl _) have hfactor : 0 ≤ 2*(U*L^(-K))*V*(L^aE)^2*(L^A)^2 := by positivity have ho := (mul_le_mul_of_nonneg_left he hfactor).trans herr have hs := candidate_retained_box_smooth_cauchy c L r jStar P M N take ξ (U*L^(-K)) ν R U V (L^aE) (L^A) α β hL0 hE hU hV hP (fun m hm => (hM m hm).2) hN hR hαsupport hβsupport (fun e he => htaken e (candidate_taken_product_support_pos c L r jStar take (mem_filter.mp he).1)) hβ dsimp only at hd hs have hs' := hs.trans (mul_le_mul_of_nonneg_left (show _ ≤ (U*V)^2*L^(-D) + (U*V)^2*L^(-D) by rw [mul_add] exact add_le_add hd ho) (sq_nonneg _)) have hpow : (L^(-D/2))^2 = L^(-D) := by rw [← Real.rpow_mul_natCast hL0.le] congr 1 ring apply (sq_le_sq₀ (norm_nonneg _) (by positivity)).mp apply hs'.trans simp only [mul_pow, hpow] nlinarith [sq_nonneg ‖activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ‖, Real.rpow_nonneg hL0.le (-D)] end ThirdTypeIICandidate end namespace Bounty theorem exists_candidate_B0_bound_of_harmonic {c b A D : ℝ} (hc : 0 < c) (hb : 0 < b) {r : ℕ} (hr : 6 ≤ r) : ∃ Kmin : ℝ, 0 < Kmin ∧ ∀ K : ℝ, Kmin ≤ K → ∃ Q F : ℝ, 0 < Q ∧ 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool), take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar (by omega) hj)) = false → ∀ (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (ν R U V : ℝ), Real.exp (b*L) ≤ U → U ≤ Real.exp L → Real.exp (b*L) ≤ V → V ≤ Real.exp L → 2*U*V ≤ R*Real.exp L → ∀ (P M N : Finset ℕ) (α β : ℕ → ℂ), (∀ p ∈ P, 0 < p) → (∀ m ∈ M, (m:ℝ) ∈ Set.Icc U (2*U)) → (∀ n ∈ N, (n:ℝ) ∈ Set.Icc V (2*V)) → (∀ m, m ∉ M → α m = 0) → (∀ n, n ∉ N → β n = 0) → (∀ m ∈ M, ‖α m‖ ≤ L^A) → (∀ n ∈ N, ‖β n‖ ≤ L^A) → (∀ m ∈ M, α m ≠ 0 → ∀ p ∈ m.primeFactors, Real.exp (Real.sqrt L) < (p:ℝ)) → (∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K:ℤ)) (typeIIAdmissibleDeterminantBound L K), k ≠ 0 → ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ χ : DirichletCharacter ℂ (2*k.natAbs), ∀ ζ : EuclideanSpace ℝ (Fin 3), ‖ζ‖ ≤ L^F → ‖candidateB0HarmonicCorrelation c L (1/2) r jStar P take (candidateAllocationFourierTwist c L r jStar take ξ) ν (typeIISmoothDyadicScale U V (U*L^(-K)) j) k M α χ ζ‖ ≤ L^(-Q)) → ‖candidateRetainedAllocationIntegrand c L (1/2) r jStar (Real.log (U*L^(-K))) P take (candidateBoxFiniteTest L (U*L^(-K)) (Icc 1 ⌊R*Real.exp L⌋₊) (fun u => typeIIMellinPhase ν u * ∑ m ∈ (2*u+1).divisors, α m*β ((2*u+1)/m))) ξ‖ ≤ (2*U*V*L^(-D/2)) * ‖activeAllocationFourierWeight (candidateAllocationRadius r) (candidateAllocationActive c L r jStar) take ξ‖ := by exact ThirdTypeIICandidate.exists_candidate_B0_bound_of_harmonic (A := A) (D := D) hc hb hr end Bounty end section /- The exact root integrand retains the small bare factors and big memory factors. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_mixed_path_integrand_factor {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (β : PhysicalPrime P → ℝ) (B : ℕ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ L p = (physicalStateMass (fun g : ↥groupsᶜ => V g.val) J ell : ℂ) * physicalBareWalkScalar (fun g : ↥groupsᶜ => V g.val) patterns (fun i g => C i g.val) (fun _ _ => 0) (fun _ _ _ _ _ => 1) (fun j => physicalRestrictedEdge (fun g => g ∈ groupsᶜ) patterns C (finitePathLabels p j)) (fun j g => finitePathMarks L p j g.val) (n + 1) * (∏ j ∈ range (n + 1), physicalMemoryLabeledScalar (fun g : {g // g ∉ groupsᶜ} => V g.val) patterns (fun i g => C i g.val) (fun _ => 0) (physicalFixedEdgeBigCoefficient (fun g => g ∈ groupsᶜ) patterns C (ζ ((n + 1) - 1 - j)) (physicalLocalFourierCoefficient C k K θ ((n + 1) - 1 - j)) (finitePathLabels p j) (finitePathMarks L p j) (finitePathMarks L p (j + 1))) (physicalRestrictedEdge (fun g => g ∉ groupsᶜ) patterns C (finitePathLabels p j)) (fun g => finitePathMarks L p j g.val) (fun g => finitePathMarks L p (j + 1) g.val)) * physicalGroupFiniteVertexWeight groupsᶜ C q k L p r * physicalGroupFiniteCappedHistory groups C q k β V B L p := by unfold physicalRootMixedPathIntegrand rw [← physical_group_path_mass_subtype_factors V groupsᶜ (fun j => C (finitePathLabels p j).2.2.1.val) ell (n + 1)] rw [physical_group_fourier_fixed_path_factor] end Bounty end section /- The scalar coordinates use exactly the original small and big selected data. -/ open scoped Classical namespace Bounty variable {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) noncomputable def physicalRootSmallPlanSmallData (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) : PhysicalGroupSelectedData (fun g : ↥groupsᶜ => P g.val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) := ((physicalSmallSelectedPlanEquiv (fun (i : patterns) (g : ↥groupsᶜ) => C i.val g.val) hC).symm p).2 theorem physical_root_small_plan_path_selected (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) : physicalRootSmallPlanPath groups patterns C hC p db = (physicalPathSelectedEquiv patterns C).symm ⟨physicalRootSmallPlanPattern groups patterns C hC p, (physicalGroupSelectedSplit (fun g => g ∈ groupsᶜ) (fun j => C (physicalRootSmallPlanPattern groups patterns C hC p j).val)).symm (physicalRootSmallPlanSmallData groups patterns C hC p, db)⟩ := rfl theorem physical_root_small_plan_selected_coordinates (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) : physicalPathSelectedEquiv patterns C (physicalRootSmallPlanPath groups patterns C hC p db) = ⟨physicalRootSmallPlanPattern groups patterns C hC p, (physicalGroupSelectedSplit (fun g => g ∈ groupsᶜ) (fun j => C (physicalRootSmallPlanPattern groups patterns C hC p j).val)).symm (physicalRootSmallPlanSmallData groups patterns C hC p, db)⟩ := by rw [physical_root_small_plan_path_selected, Equiv.apply_symm_apply] end Bounty end section /- A named dependent sum keeps the exact small-plan scalar manageable. -/ open Finset open scoped Classical namespace Bounty section Sum variable {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (β : PhysicalPrime P → ℝ) (B : ℕ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) noncomputable def physicalRootSmallPlanSumCore (F : PhysicalMarkLists P J ell → (Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) → ℂ) : ℂ := by let := physicalLabeledPathFintype (P := P) (ell := ell) (n := n + 1) patterns C let e := physicalPathSmallPlanEquiv (P := P) (ell := ell) (n := n + 1) (fun g => g ∈ groupsᶜ) patterns C hC let := Fintype.ofEquiv _ e exact ∑ x, F (e.symm x).1 (e.symm x).2 noncomputable def physicalRootSmallPlanSum : ℂ := physicalRootSmallPlanSumCore (n := n) groups patterns C hC (physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ) omit [∀ a : PhysicalPrime P, NeZero a.2.val] in theorem physical_root_small_plan_sum_core (F : PhysicalMarkLists P J ell → (Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) → ℂ) : let := physicalLabeledPathFintype (P := P) (ell := ell) (n := n + 1) patterns C (∑ L : PhysicalMarkLists P J ell, ∑ p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, F L p) = physicalRootSmallPlanSumCore groups patterns C hC F := by let := physicalLabeledPathFintype (P := P) (ell := ell) (n := n + 1) patterns C let e := physicalPathSmallPlanEquiv (P := P) (ell := ell) (n := n + 1) (fun g => g ∈ groupsᶜ) patterns C hC let := Fintype.ofEquiv _ e have he := e.symm.sum_comp (fun x => F x.1 x.2) simpa only [physicalRootSmallPlanSumCore, Fintype.sum_prod_type] using! he.symm theorem physical_root_mixed_sum_eq_small_plan : let := physicalLabeledPathFintype (P := P) (ell := ell) (n := n + 1) patterns C (∑ L : PhysicalMarkLists P J ell, ∑ p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell, physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ L p) = physicalRootSmallPlanSum (n := n) groups patterns C hC V q ζ k K β B r θ := by exact physical_root_small_plan_sum_core groups patterns C hC (physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ) end Sum end Bounty end section /- Only the chosen big prime pool is numbered for the original memory history. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSelectedBigPrimeEquiv {N : ℕ} (P : Fin N → Finset ℕ) (groups : Finset (Fin N)) : PhysicalPrime (fun g : {g // g ∉ groupsᶜ} => P g.val) ≃ ↥(physicalPrimeGroups P groups) where toFun p := ⟨⟨p.1.val, p.2⟩, by have hg : p.1.val ∈ groups := by simpa using p.1.property simp [physicalPrimeGroups, hg]⟩ invFun p := ⟨⟨p.val.1, by have hg : p.val.1 ∈ groups := by simpa [physicalPrimeGroups] using p.property simpa using hg⟩, p.val.2⟩ left_inv p := by cases p; rfl right_inv p := by cases p; rfl noncomputable def physicalBigPrimeNumbering {N M : ℕ} (P : Fin N → Finset ℕ) (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) : PhysicalPrime (fun h => P (e.symm h).val) ≃ ↥(physicalPrimeGroups P groups) := (physicalPrimeReindex e (fun g => P g.val)).trans (physicalSelectedBigPrimeEquiv P groups) abbrev physicalNumberedBigPrimeNonzero {N M : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) : ∀ z : PhysicalPrime (fun h => P (e.symm h).val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨(e.symm z.1).val, z.2⟩ : PhysicalPrime P).2.val) theorem physical_group_capped_history_numbered {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (q : ℝ) (k : ℕ → I → ℤ) (β : PhysicalPrime P → ℝ) (V : Fin N → ℝ) (B : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) (hB : (physicalPrimeGroups P groups).card ≤ B) : let := physicalNumberedBigPrimeNonzero (P := P) groups e physicalGroupFiniteCappedHistory groups C q k β V B L p = ghostPhaseCappedHistory (fun z : PhysicalPrime (fun h => P (e.symm h).val) => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity (physicalPathSelectedEquiv patterns C (L, p)).2.2.1 (e.symm z.1).val) j z.2) (fun z => physicalResidueAbsoluteHit (physicalPathSelectedOffset C k L p) (e.symm z.1).val z.2) (fun _ j => 1 - physicalEndpointSchedule q (n + 1) (globalBirthFiniteIndex (n + 1) j).val) (fun z => β ⟨(e.symm z.1).val, z.2⟩) (fun z => V (e.symm z.1).val) (fun _ => B) (fun _ => B) (n + 1) := by let := physicalNumberedBigPrimeNonzero (P := P) groups e unfold physicalGroupFiniteCappedHistory exact (ghost_phase_inactive_capped_history_reindex (physicalBigPrimeNumbering P groups e) (fun a : ↥(physicalPrimeGroups P groups) => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity (physicalPathSelectedEquiv patterns C (L, p)).2.2.1 a.val.1) j a.val.2) (fun a => physicalResidueAbsoluteHit (physicalPathSelectedOffset C k L p) a.val.1 a.val.2) (fun _ j => 1 - physicalEndpointSchedule q (n + 1) (globalBirthFiniteIndex (n + 1) j).val) (fun a => β a.val) (fun a => V a.val.1) B (n + 1) (by simpa using hB)).symm end Bounty end section /- The actual rough integral with the original restricted coefficient and nonzero-M filter. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- The actual prime integral with the original restricted coefficient and nonzero-M filter. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- Original active dyadic block estimates suffice for the original target. -/ open Finset Filter namespace Bounty /- The remaining local analytic estimates, with jStar fixed before precision. No estimate is asserted by this definition. -/ def CandidateHalfActiveBlockBounds : Prop := ∀ (c : ℝ) (r : ℕ), 0 C key.2.1 let kb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => k key.1 key.2.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (Cb key g)) B (fun key _ => PhysicalAuxLabels P (Cb key)) (fun key => physicalFullEdgeDelta (Cb key) (kb key)) (fun key => physicalFullEdgeD (Cb key))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (Cb key g)) B (fun key _ => PhysicalAuxLabels P (Cb key)) (fun key => physicalFullEdgeDelta (Cb key) (kb key)) (fun key => physicalFullEdgeD (Cb key))) (physicalFullKeyCoefficientPhase Cb kb ζ coeff) (physicalMixedBigSteps ks L pl) x p theorem physical_effective_coefficient_plan_cast (ks : List (Option (V ⊕ K))) {a b : PhysicalMarkLists Ps J ell × PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks} (h : a = b) (x : PhysicalFullBoundedState P J ell B) (p : PhysicalEffectivePlannedBigPath C k B ks a.1 a.2 x) : physicalEffectivePlanCoefficientPhase C k B ζ coeff ks b.1 b.2 x (physicalEffectivePlanPathCastEquiv C k B ks h x p) = physicalEffectivePlanCoefficientPhase C k B ζ coeff ks a.1 a.2 x p := by cases h rfl end Coefficient end Bounty end section /- Decorated key transport preserves the original birth and freshness history. -/ open scoped Classical namespace Bounty section History variable {I H V : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : I → ℤ) (f : H → I) variable (ω : ∀ i, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C i g)) → PhysicalAuxLabels P (C i) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (W : Fin N → ℝ) theorem physical_full_key_history_phase (tag : Option (V ⊕ H)) (L : ∀ g, Finset (P g)) (x : PhysicalFullBoundedState P J ell B) (e : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C (f i) g)) B (fun i _ => PhysicalAuxLabels P (C (f i))) (fun i => physicalFullEdgeDelta (C (f i)) (k (f i))) (fun i => physicalFullEdgeD (C (f i))) tag x) : physicalFullLedgerEventPhase C k ω β ρ W (tag.map (Sum.map id f)) (L, x) (fullPermutationKeyEventEquiv (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) f tag x e) = physicalFullLedgerEventPhase (fun i => C (f i)) (fun i => k (f i)) (fun i => ω (f i)) β ρ W tag (L, x) e := by cases tag with | none => rfl | some tag => cases tag <;> rfl end History end Bounty end section /- Full physical path terminals are preserved by schedule casts and edge-key transport. -/ open scoped Classical namespace Bounty section Terminal variable {I K : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) noncomputable def physicalFullPathTerminal (steps : List (Option (I ⊕ K))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps x) := finiteEventPathTerminal (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) steps x p theorem physical_full_terminal_schedule_cast {steps steps' : List (Option (I ⊕ K))} (h : steps = steps') (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps x) : physicalFullPathTerminal C k steps' x (cast (congrArg (fun ks => FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ks x) h) p) = physicalFullPathTerminal C k steps x p := by cases h rfl theorem physical_full_key_path_terminal {H : Type} (f : H → K) (steps : List (Option (I ⊕ H))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (f j) g)) B (fun j _ => PhysicalAuxLabels P (C (f j))) (fun j => physicalFullEdgeDelta (C (f j)) (k (f j))) (fun j => physicalFullEdgeD (C (f j))) steps x) : physicalFullPathTerminal C k (steps.map (Option.map (Sum.map id f))) x (physicalFullKeyPathEquiv C k f steps x p) = physicalFullPathTerminal (fun j => C (f j)) (fun j => k (f j)) steps x p := full_permutation_key_path_terminal (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) f steps x p end Terminal end Bounty end section /- The complete signed weight on the actual effective planned big path. -/ open scoped Classical namespace Bounty section Coefficient variable {S I V K : Type} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : K → I → ℤ) (B : ℕ) (ω : ∀ key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K), SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C key.2.1 g)) → PhysicalAuxLabels P (C key.2.1) → ℝ) (β : (g : Fin N) → P g → ℝ) (retention : V → ℝ) (ρ : ℝ) (W : Fin N → ℝ) noncomputable def physicalEffectivePlanSignedWeight (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (x : PhysicalFullBoundedState P J ell B) (p : PhysicalEffectivePlannedBigPath C k B ks L pl x) : ℂ := let Cb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => C key.2.1 let kb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => k key.1 key.2.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) physicalFullSignedWeight Cb kb ω β retention ρ W (physicalMixedBigSteps ks L pl) x p theorem physical_effective_signed_weight_plan_cast (ks : List (Option (V ⊕ K))) {a b : PhysicalMarkLists Ps J ell × PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks} (h : a = b) (x : PhysicalFullBoundedState P J ell B) (p : PhysicalEffectivePlannedBigPath C k B ks a.1 a.2 x) : physicalEffectivePlanSignedWeight C k B ω β retention ρ W ks b.1 b.2 x (physicalEffectivePlanPathCastEquiv C k B ks h x p) = physicalEffectivePlanSignedWeight C k B ω β retention ρ W ks a.1 a.2 x p := by cases h rfl end Coefficient end Bounty end section /- The original local Fourier scale dominates the actual first small prime when one occupied selected cell contains a slot from a big-prime group. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_big_cell_local_scale {c b : ℝ} (hc : 0 < c) (hb : 0 < b) (J : ℕ) (K q : ℝ) (hq : 0 ≤ q) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → let P := fun g : S => candidatePBand (c*L) g.val ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r t : Finset S) (A B : Finset (RepeatedBigFlatIndex S J ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → A.Nonempty → B ⊆ t.sigma (repeatedBigPrimeProbeSlots probes) → B.Nonempty → (∃ i : A, i.val.1.val ∈ candidateBigPIndices c L) → ∀ (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (ζ : ℝ), (∃ x : (∀ i : A, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase ζ (∏ i, (x i).val) ≠ 0) → (∃ y : (∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y) * physicalPhase ζ (∏ i, (y i).val) ≠ 0) → ∀ (k : ℤ), k ≠ 0 → |(k : ℝ)| ≤ L^K → ∀ Psmall : ℝ, Psmall ≤ Real.exp (L^(1/5 : ℝ)) → let HA := Real.exp (((d : ℝ)-1)*h) let HB := Real.exp (((e : ℝ)-1)*h) let H := |(k : ℝ)| *HA*HB/L^q 4096*Psmall*L ≤ H ∧ H ≤ Real.exp ((b/2)*L) := by filter_upwards [eventually_candidate_big_slot_cell_lower hc J, eventually_small_prime_scale_le_big (q+1), eventually_candidate_occupied_cell_scale hc (ε := 1) (by norm_num) J 0, eventually_candidate_cell_local_scale hc hb J K q 0 hq (le_refl 0), eventually_ge_atTop (1 : ℝ)] with L hbig hsmall hcell hlocal hL intro S hS P ell probes r t A B hA hAne hB hBne hAbig Q h hh hh1 d e χ ψ ζ hx hy k hk hkK Psmall hPsmall let HA := Real.exp (((d : ℝ)-1)*h) let HB := Real.exp (((e : ℝ)-1)*h) change 4096*Psmall*L ≤ |(k : ℝ)| *HA*HB/L^q ∧ |(k : ℝ)| *HA*HB/L^q ≤ Real.exp ((b/2)*L) have hHA : 4096*Real.exp (L^(1/5 : ℝ))*L^(q+1) ≤ HA := hsmall.trans (hbig S hS ell A hAbig Q h hh hh1 d χ ζ hx) have hHB : 1 ≤ HB := by simpa only [Real.rpow_zero] using (hcell S hS ell probes t B hB hBne Q h hh hh1 e ψ ζ hy).1 have hL0 : 0 < L := zero_lt_one.trans_le hL have hk1 : 1 ≤ |(k : ℝ)| := by have hz : (0 : ℤ) < |k| := abs_pos.mpr hk have hi : (1 : ℤ) ≤ |k| := by omega exact_mod_cast hi refine ⟨?_, (hlocal S hS ell probes r t A B hA hAne hB hBne Q h hh hh1 d e χ ψ ζ hx hy k hk hkK).2⟩ apply (le_div_iff₀ (Real.rpow_pos_of_pos hL0 q)).mpr calc 4096*Psmall*L*L^q = 4096*Psmall*L^(q+1) := by rw [Real.rpow_add hL0, Real.rpow_one] ring _ ≤ 4096*Real.exp (L^(1/5 : ℝ))*L^(q+1) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hPsmall (by norm_num)) (Real.rpow_nonneg hL0.le _) _ = 1*(4096*Real.exp (L^(1/5 : ℝ))*L^(q+1))*1 := by ring _ ≤ |(k : ℝ)| *HA*HB := by gcongr end Bounty end section /- Uniform character energy bounds control the literal normalized rational cutoff box. -/ open Finset Filter MeasureTheory namespace Bounty theorem eventually_rational_normalized_full_box_precision {ρ c E : ℝ} (hρ : 0 < ρ) (hc : 0 ≤ c) (F : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ qRat : ℕ, 0 < qRat → ∀ k : ℤ, ∀ Y : ℝ, 1 ≤ Y → Real.log Y ≤ c*L → ∀ (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (D₀ A₀ B₀ C₀ : ℝ), 0 ≤ D₀ → 0 ≤ A₀ → 0 ≤ B₀ → 0 ≤ C₀ → D₀*A₀*B₀*C₀ ≤ L^E → (∀ d ∈ D, 0 < d) → (∀ a ∈ A, 0 < a) → (∀ b ∈ B, 0 < b) → (∀ z ∈ C, 0 < z) → (∀ d ∈ D, d.Coprime qRat) → (∀ a ∈ A, a.Coprime qRat) → (∀ b ∈ B, b.Coprime qRat) → (∀ d ∈ D, ‖δ d‖ ≤ D₀) → (∀ a ∈ A, ‖α a‖ ≤ A₀) → (∀ b ∈ B, ‖β b‖ ≤ B₀) → (∀ z ∈ C, ‖γ z‖ ≤ C₀) → (∀ d ∈ D, ∀ a ∈ A, ∀ b ∈ B, ∀ z ∈ C, Y/128 ≤ ((d*a*b*z : ℕ) : ℝ) ∧ ((d*a*b*z : ℕ) : ℝ) ≤ 64*Real.exp 2*Y) → ∀ T w : ℝ, 0 ≤ T → T ≤ L*Y → (∀ d ∈ qRat.divisors, ∀ ψ : AddChar (Additive (ZMod (qRat/d))ˣ) ℂ, ∀ u : ℝ, ‖u‖ ≤ L^ρ → (∫ s in Set.Icc (-T) T, ‖(∑ n ∈ D, (δ n*unitAddCharDirichlet ψ (n : ZMod (qRat/d)))* harmonicMellinWeight (s+w+2*Real.pi*u) n) * (∑ n ∈ A, (α n*unitAddCharDirichlet ψ (n : ZMod (qRat/d)))* harmonicMellinWeight (s+w+2*Real.pi*u) n) * (∑ n ∈ B, (β n*unitAddCharDirichlet ψ (n : ZMod (qRat/d)))* harmonicMellinWeight (s+w+2*Real.pi*u) n) * (∑ n ∈ C, (γ n*rationalResidualGcdMultiplier qRat d ψ n)* harmonicMellinWeight (s+w+2*Real.pi*u) n)‖^2) ≤ L^(-(F+1))) → (∫ s in Set.Icc (-T) T, ‖rationalFourBoxKernelSum qRat k D A B C δ α β γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (s+w) (n : ℝ))‖^2) ≤ (qRat : ℝ)^3*L^(-F) := by filter_upwards [eventually_harmonic_normalized_full_box_precision (E := E) hρ hc F, eventually_gt_atTop (0 : ℝ)] with L hcutoff hL intro qRat hqRat k Y hY hlogY D A B C δ α β γ D₀ A₀ B₀ C₀ hD₀ hA₀ hB₀ hC₀ hprod hD hA hB hC hDcop hAcop hBcop hδ hα hβ hγ hgeom T w hT hTY hcentral have htwist (x y : ℂ) (K : ℝ) (hx : ‖x‖ ≤ K) (hy : ‖y‖ ≤ 1) : ‖x*y‖ ≤ K := by calc _ = ‖x‖*‖y‖ := norm_mul x y _ ≤ ‖x‖*1 := mul_le_mul_of_nonneg_left hy (norm_nonneg x) _ = ‖x‖ := mul_one _ _ ≤ K := hx apply rational_box_kernel_energy_le hqRat k D A B C δ α β γ (fun s n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (s+w) (n : ℝ)) hDcop hAcop hBcop (fun _ => by unfold physicalMellinPhase; fun_prop) (-T) T (L^(-F)) (Real.rpow_nonneg hL.le _) intro d hd ψ have hbound := hcutoff Y hY hlogY D A B C (fun n => δ n*unitAddCharDirichlet ψ (n : ZMod (qRat/d))) (fun n => α n*unitAddCharDirichlet ψ (n : ZMod (qRat/d))) (fun n => β n*unitAddCharDirichlet ψ (n : ZMod (qRat/d))) (fun n => γ n*rationalResidualGcdMultiplier qRat d ψ n) D₀ A₀ B₀ C₀ hD₀ hA₀ hB₀ hC₀ hprod hD hA hB hC (fun n hn => htwist _ _ _ (hδ n hn) ((unitAddCharDirichlet ψ).norm_le_one _)) (fun n hn => htwist _ _ _ (hα n hn) ((unitAddCharDirichlet ψ).norm_le_one _)) (fun n hn => htwist _ _ _ (hβ n hn) ((unitAddCharDirichlet ψ).norm_le_one _)) (fun n hn => htwist _ _ _ (hγ n hn) (rational_residual_gcd_multiplier_norm_le qRat d ψ n)) hgeom T w hT hTY (hcentral d hd ψ) simpa only [fourBoxKernelSum, mul_assoc] using hbound end Bounty end section /- The original residual phase gives the exact full coefficient edge between both averages. -/ open scoped Classical namespace Bounty section Physical variable {N J ell m B : ℕ} {P : Fin N → Finset ℕ} [∀ g (p : ↥(P g)), NeZero p.val] (C : Fin m → Fin N → Finset (Fin J)) (k : Fin m → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (m + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin m → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) end Physical end Bounty end section /- The original enriched physical path action equals the projected ledger schedule. -/ open scoped Classical namespace Bounty section Physical variable {N J ell m B : ℕ} {P : Fin N → Finset ℕ} [∀ g (p : ↥(P g)), NeZero p.val] (C : Fin m → Fin N → Finset (Fin J)) (k : Fin m → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (m + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin m → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) end Physical end Bounty end section /- The actual selected coefficient yields a bounded residual phase, including initial avoidance. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) end Physical end Bounty end section /- Integrate the conditional retained harmonic estimate over the actual frequency boxes. -/ open Finset Filter MeasureTheory Real namespace Bounty end Bounty end section /- Restricting the reconstructed path recovers its literal selected mark arrays. -/ namespace Bounty theorem physical_group_selected_inverse_big_marks {G : Type*} {P : G → Finset ℕ} {J ell n : ℕ} (small : G → Prop) (C : Fin n → G → Finset (Fin J)) (ds : PhysicalGroupSelectedData (fun g : {g // small g} => P g.val) ell (fun j g => C j g.val)) (db : PhysicalGroupSelectedData (fun g : {g // ¬small g} => P g.val) ell (fun j g => C j g.val)) : (fun j (g : {g // ¬small g}) => ((physicalGroupSelectedSplit small C).symm (ds, db)).2.1 j g.val) = db.2.1 := by have h := congrArg (fun d => d.2.2.1) ((physicalGroupSelectedSplit small C).apply_symm_apply (ds, db)) exact h theorem physical_root_small_plan_big_marks {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) : (fun j (g : {g // g ∉ groupsᶜ}) => (physicalPathSelectedEquiv patterns C (physicalRootSmallPlanPath groups patterns C hC p db)).2.2.1 j g.val) = db.2.1 := by rw [physical_root_small_plan_selected_coordinates] exact physical_group_selected_inverse_big_marks _ _ _ _ end Bounty end section /- The full original residue model in the exact small-plan coordinates. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_root_residue_model_small_plan {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (hV : ∀ g, 0 < V g) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (b : PhysicalPrime P → ℝ) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a ≠ 0) (B : ℕ) (hB : (physicalPrimeGroups P groups).card ≤ B) : physicalRootResidueModel V patterns C q ζ k K n = (∏ a ∈ physicalPrimeGroups P groups, b a : ℝ) * ∑ r : PhysicalGroupResidues P groupsᶜ, (∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ)) * ∫ θ : ℝ in (0 : ℝ)..1, physicalRootSmallPlanSum (n := n) groups patterns C hC V q ζ k K (fun a => ((a.2.val : ℝ) * b a)⁻¹) B r θ := by let := physicalLabeledPathFintype (P := P) (ell := ell) (n := n + 1) patterns C rw [physical_root_residue_model_mixed_fourier groups V patterns C q ζ k K hV hP hdis hk b hb hb0 B hB] apply congrArg (fun z : ℂ => ((∏ a ∈ physicalPrimeGroups P groups, b a : ℝ) : ℂ) * z) apply sum_congr rfl intro r _ apply congrArg (fun z : ℂ => ((∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ) : ℝ) : ℂ) * z) apply congrArg (fun f : ℝ → ℂ => ∫ θ : ℝ in (0 : ℝ)..1, f θ) funext θ exact physical_root_mixed_sum_eq_small_plan (I := I) (P := P) (J := J) (ell := ell) (n := n) groups patterns C hC V q ζ k K (fun a => ((a.2.val : ℝ) * b a)⁻¹) B r θ end Bounty end section /- Exact active harmonic endpoints after saturation of the original finite pool support. -/ open Finset Filter open scoped ComplexConjugate namespace Bounty theorem eventually_candidate_harmonic_eq_saturated_endpoints {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (X : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (σ : ℝ), (∀ p ∈ candidateRoughBand c L jStar, twist (candidateRoughSlot c L r jStar hr hj) p = typeIIPhase σ p) → ∀ (Z : ℝ) (k : ℤ) (M : Finset ℕ) (α : ℕ → ℂ) (ν : ℝ) (χ : DirichletCharacter ℂ (2*k.natAbs)) (ξ : EuclideanSpace ℝ (Fin 3)), |(k : ℝ)| ≤ Z → 3*Z < X → (∀ m ∈ M, 0 < m) → (∀ m, m ∉ M → α m = 0) → (∀ m ∈ M, α m ≠ 0 → Disjoint m.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) → let H := candidateRetainedAllocationSupport c L r jStar (candidateSmallPSet c L X) take let M₀ := M.filter (fun m => α m ≠ 0) let Zs := typeIIActiveCrossZ Z k (Icc 0 (M₀.sup id * H.sup id)) let P := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let W : ℕ → ℝ := fun n => markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) q (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p : ℝ)) (fun _ => 1) (n : ℤ) let cr := candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist let F₀ := invariantTripleEndpoint P (fun m => α m * χ (m : ZMod (2*k.natAbs)) * typeIIPhase ((2*Real.pi*ν)-2*Real.pi*ξ 1) m) (fun p => if p ∈ candidateRoughBand c L jStar then typeIIPhase (-σ) p else 0) (fun s => conj (cr s)) let G₀ := invariantTripleEndpoint P (fun m => α m * χ (m : ZMod (2*k.natAbs)) * typeIIPhase (2*Real.pi*ξ 0+(2*Real.pi*ν)) m) (fun p => if p ∈ candidateRoughBand c L jStar then typeIIPhase (-σ) p else 0) (fun s => conj (cr s)) candidateB0HarmonicCorrelation c L q r jStar (candidateSmallPSet c L X) take twist ν Z k M α χ ξ = ∑ z ∈ Zs, ((typeIIHarmonicDyadic ((z : ℝ)/Z)/(z : ℝ) : ℝ) : ℂ) * (typeIIPhase ((2*Real.pi*ν)+2*Real.pi*ξ 2) z * typeIIPhase (-(2*Real.pi*ν)) ((z : ℤ)+k).toNat * conj (F₀ z) * G₀ ((z : ℤ)+k).toNat * (W z : ℂ) * (W ((z : ℤ)+k).toNat : ℂ)) := by classical filter_upwards [eventually_candidate_cross_pair_eq_saturated_endpoints hc] with L hL intro q r jStar hr hj X take hkeep twist σ hphase Z k M α ν χ ξ hk hX hM hα hfree dsimp only unfold candidateB0HarmonicCorrelation typeIIRetainedHarmonicCorrelation dsimp only apply sum_congr rfl intro z hz have hzpos := (mem_filter.mp hz).2.1 have hwpos := (mem_filter.mp hz).2.2.1 obtain ⟨hzX, hwX⟩ := active_cross_endpoints_lt_cutoff hz hk hX have hsupport : ∀ m, m ∉ M.filter (fun m => α m ≠ 0) → α m = 0 := by intro m hm by_cases hmM : m ∈ M · by_contra hne exact hm (mem_filter.mpr ⟨hmM, hne⟩) · exact hα m hmM rw [hL q r jStar hr hj X take hkeep twist σ hphase (M.filter (fun m => α m ≠ 0)) α (2*k.natAbs) χ (2*Real.pi*ν) (2*Real.pi*ξ 0) (2*Real.pi*ξ 1) (2*Real.pi*ξ 2) z ((z : ℤ)+k).toNat hzpos (Int.pos_iff_toNat_pos.mp hwpos) hzX hwX (fun m hm => hM m (mem_filter.mp hm).1) (fun m hm => hfree m (mem_filter.mp hm).1 (mem_filter.mp hm).2) hsupport] end Bounty end section /- Nonzero original sums provide actual coefficient witnesses. -/ open Finset namespace Bounty theorem shifted_typeII_nonzero_factors (T : Finset ℕ) (μ α β : ℕ → ℝ) (hne : shiftedTypeIIBilinear T μ α β ≠ 0) : ∃ v ∈ shiftedFactorPairs T, α v.1 ≠ 0 ∧ β v.2 ≠ 0 := by obtain ⟨v,hv,hterm⟩ := exists_ne_zero_of_sum_ne_zero hne refine ⟨v,hv,?_,?_⟩ · intro hzero exact hterm (by rw [hzero,mul_zero,zero_mul]) · intro hzero exact hterm (by rw [hzero,mul_zero]) end Bounty end section /- Integrate the conditional retained harmonic estimate over the actual frequency boxes. -/ open Finset Filter MeasureTheory Real namespace Bounty end Bounty end section /- Integrate the conditional retained harmonic estimate over the actual frequency boxes. -/ open Finset Filter MeasureTheory Real namespace Bounty theorem exists_candidate_finite_mixed_bound_of_saturated_harmonic_range {c b A D Bwin : ℝ} (R : ℝ) (hRcoarse : 1 ≤ R) (hc : 0 < c) (hb : 0 < b) (hBwin : 0 ≤ Bwin) {r : ℕ} (hr : 6 ≤ r) : ∃ Kmin : ℝ, 0 < Kmin ∧ ∀ K : ℝ, Kmin ≤ K → ∃ Q F : ℝ, 0 < Q ∧ 0 < F ∧ ∀ᶠ L : ℝ in atTop, ∀ (jStar : ℕ), jStar ∈ candidateQIndices c L → ∀ (U V T : ℝ) (M N : Finset ℕ) (α β : ℕ → ℂ), exp (b*L) ≤ U → U ≤ exp L → exp (b*L) ≤ V → V ≤ exp L → 2*U*V ≤ R*exp L → (∀ m ∈ M, (m:ℝ) ∈ Set.Icc U (2*U)) → (∀ n ∈ N, (n:ℝ) ∈ Set.Icc V (2*V)) → (∀ m, m ∉ M → α m = 0) → (∀ n, n ∉ N → β n = 0) → (∀ m ∈ M, ‖α m‖ ≤ L^A) → (∀ n ∈ N, ‖β n‖ ≤ L^A) → (∀ m ∈ M, α m ≠ 0 → ∀ p ∈ m.primeFactors, exp (sqrt L) < (p:ℝ)) → (∀ ν : ℝ, ‖ν‖ ≤ T → ∀ take : Fin ((candidateQIndices c L).card*r) → Bool, (∀ i, candidateAllocationActive c L r jStar i = false → take i = false) → ∀ ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ, (∀ i, ‖ξ i‖ ≤ L) → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K:ℤ)) (typeIIAdmissibleDeterminantBound L K), k ≠ 0 → ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ χ : DirichletCharacter ℂ (2*k.natAbs), ∀ ζ : EuclideanSpace ℝ (Fin 3), ‖ζ‖ ≤ L^F → ‖candidateB0HarmonicCorrelation c L (1/2) r jStar (candidateSmallPSet c L (exp (4*L))) take (candidateAllocationFourierTwist c L r jStar take ξ) ν (typeIISmoothDyadicScale U V (U*L^(-K)) j) k M α χ ζ‖ ≤ L^(-Q)) → ‖∫ ν in {ν : ℝ | ‖ν‖ ≤ T}, candidateFiniteMixedMellinIntegrand c L (1/2) r jStar (U*L^(-K)) Bwin R (Icc 1 ⌊R*exp L⌋₊) (fun u m => α m*β ((2*u+1)/m)) ν‖ ≤ exp L*L^(-D) := by classical obtain ⟨Cf, hCf, hvariation⟩ := exists_candidate_mixed_fourier_variation_bound hc hBwin r obtain ⟨Kmin, hKmin, hpoint⟩ := exists_candidate_B0_bound_of_harmonic (A := A) (D := 2*(D+Cf+2)) hc hb hr refine ⟨Kmin, hKmin, ?_⟩ intro K hK obtain ⟨Q, F, hQ, hF, hpoint⟩ := hpoint K hK refine ⟨Q, F, hQ, hF, ?_⟩ filter_upwards [hpoint, hvariation, eventually_coarse_retained_Psupport_enlarge R hc (by norm_num : (1 : ℝ) < 4), eventually_ge_atTop (max 1 R)] with L hpoint hvariation henlarge hL intro jStar hj U V T M N α β hUlo hUhi hVlo hVhi hcoarse hM hN hαsupport hβsupport hα hβ hrough hcorr have hRnonneg : 0 ≤ R := by linarith have hL1 : 1 ≤ L := (le_max_left 1 R).trans hL have hLR : R ≤ L := (le_max_right 1 R).trans hL have hL0 : 0 < L := by linarith [hL1] have hU : 0 < U := (exp_pos _).trans_le hUlo have hV : 0 < V := (exp_pos _).trans_le hVlo have hscalar : 0 ≤ 2*U*V*L^(-(2*(D+Cf+2))/2) := by positivity have hi := candidate_finite_mixed_mellin_norm_le_box_variation c L (1/2) r jStar (U*L^(-K)) Bwin R (Icc 1 ⌊R*exp L⌋₊) (fun u m => α m*β ((2*u+1)/m)) T hscalar (by intro ν hν take htake ξ hξ have hinactive : candidateAllocationActive c L r jStar ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar (by omega) hj)) = false := by simp only [candidateAllocationActive, Equiv.apply_symm_apply, candidateRoughSlot, and_self, not_true_eq_false, decide_false] have hs := hpoint jStar hj take (htake _ hinactive) ξ ν R U V hUlo hUhi hVlo hVhi hcoarse (candidateSmallPSet c L (exp (4*L))) M N α β (fun p hp => Nat.pos_of_ne_zero (candidate_small_P_set_nonzero hp)) hM hN hαsupport hβsupport hα hβ hrough (hcorr ν hν take htake ξ hξ) have heq := henlarge (1/2) r jStar (log (U*L^(-K))) (U*L^(-K)) (Icc 1 ⌊R*exp L⌋₊) (fun u => typeIIMellinPhase ν u * ∑ m ∈ (2*u+1).divisors, α m*β ((2*u+1)/m)) (by intro u hu exact (Nat.cast_le.mpr (mem_Icc.mp hu).2).trans (Nat.floor_le (by positivity))) take ξ rw [← heq] at hs simpa only [candidateFiniteCoarseMellinTest, typeIIMellinPhase] using hs) have hexp : -(2*(D+Cf+2))/2+Cf = -D-2 := by ring have hpow : L^(-D-2)*L^(2 : ℝ) = L^(-D) := by rw [← rpow_add hL0] congr 1 ring have hR : R ≤ L^(2 : ℝ) := by rw [rpow_two] nlinarith [hL1,hLR] calc _ ≤ (2*U*V*L^(-(2*(D+Cf+2))/2))* candidateMixedFourierVariation c L r jStar Bwin L T := hi _ ≤ (2*U*V*L^(-(2*(D+Cf+2))/2))*L^Cf := mul_le_mul_of_nonneg_left (hvariation jStar L T) hscalar _ = (2*U*V)*L^(-D-2) := by rw [mul_assoc, ← rpow_add hL0, hexp] _ ≤ (R*exp L)*L^(-D-2) := mul_le_mul_of_nonneg_right hcoarse (rpow_nonneg hL0.le _) _ ≤ (L^2*exp L)*L^(-D-2) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hR (exp_pos L).le) (rpow_nonneg hL0.le _) _ = exp L*L^(-D) := by rw [← hpow] ring end Bounty end section /- The actual rough integral with the original restricted coefficient and nonzero-M filter. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- The actual prime integral with the original restricted coefficient and nonzero-M filter. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- The fixed original small plan determines a local big coefficient. The original Fourier return phase and arbitrary coupled coefficient are retained. -/ open scoped Classical namespace Bounty section Coefficient variable {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) noncomputable def physicalRootPlanBigCoefficient (j : Fin (n + 1)) (Lb Rb : PhysicalMarkLists (fun g : {g // g ∉ groupsᶜ} => P g.val) J ell) (ab : PhysicalAuxLabels (fun g : {g // g ∉ groupsᶜ} => P g.val) (fun g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val)) : ℂ := let ds := physicalRootSmallPlanSmallData groups patterns C hC p let i := (physicalRootSmallPlanPattern groups patterns C hC p j).val physicalCoupledBigCoefficient (fun g => g ∈ groupsᶜ) (C i) (ζ (n - j.val) i) (physicalLocalFourierCoefficient C k K θ (n - j.val) i) (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc)) (physicalPermuteLabels (ds.2.2.2 j) (ds.2.1 j.succ)) (ds.1 j) Lb Rb ab end Coefficient end Bounty end section /- Literal mark and edge coordinates of the original reconstructed root path. -/ open scoped Classical namespace Bounty section Coordinates variable {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) theorem physical_root_path_mark_coordinate (j : Fin (n + 2)) : let old := physicalRootSmallPlanPath groups patterns C hC p db let d := (physicalGroupSelectedSplit (fun g => g ∈ groupsᶜ) (fun j => C (physicalRootSmallPlanPattern groups patterns C hC p j).val)).symm (physicalRootSmallPlanSmallData groups patterns C hC p, db) finitePathMarks old.1 old.2 j.val = d.2.1 j := by dsimp only rw [physical_root_small_plan_path_selected] exact congrFun (physical_selected_inverse_finite_path_marks patterns C (physicalRootSmallPlanPattern groups patterns C hC p) _) j theorem physical_root_path_edge_coordinate (j : Fin (n + 1)) : let old := physicalRootSmallPlanPath groups patterns C hC p db let d := (physicalGroupSelectedSplit (fun g => g ∈ groupsᶜ) (fun j => C (physicalRootSmallPlanPattern groups patterns C hC p j).val)).symm (physicalRootSmallPlanSmallData groups patterns C hC p, db) finitePathLabels old.2 j.val = (d.2.2.1 j, d.2.2.2 j, ⟨physicalRootSmallPlanPattern groups patterns C hC p j, d.1 j⟩) := by dsimp only rw [physical_root_small_plan_path_selected] simp only [finitePathLabels, dif_pos j.isLt, physical_path_selected_inverse_step] end Coordinates end Bounty end section /- The full deterministic history follows the actual decorated-key path equivalence. -/ open scoped Classical namespace Bounty section Path variable {I H V : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : I → ℤ) (f : H → I) variable (ω : ∀ i, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C i g)) → PhysicalAuxLabels P (C i) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (W : Fin N → ℝ) theorem physical_full_key_history_path (steps : List (Option (V ⊕ H))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C (f i) g)) B (fun i _ => PhysicalAuxLabels P (C (f i))) (fun i => physicalFullEdgeDelta (C (f i)) (k (f i))) (fun i => physicalFullEdgeD (C (f i))) steps x) : physicalFullHistoryPhase C k ω β ρ W (steps.map (Option.map (Sum.map id f))) x (physicalFullKeyPathEquiv C k f steps x p) = physicalFullHistoryPhase (fun i => C (f i)) (fun i => k (f i)) (fun i => ω (f i)) β ρ W steps x p := by have h := full_permutation_key_ledger_phase (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) f (fullMixedLedgerUpdate (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i))) (fun tag L x e => physicalFullLedgerEventPhase C k ω β ρ W tag (L, x) e) steps (fullActiveInitialLedger x) x p have hu : (fun (tag : Option (V ⊕ H)) (L : ∀ g, Finset (P g)) (x : PhysicalFullBoundedState P J ell B) (e : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C (f i) g)) B (fun i _ => PhysicalAuxLabels P (C (f i))) (fun i => physicalFullEdgeDelta (C (f i)) (k (f i))) (fun i => physicalFullEdgeD (C (f i))) tag x) => fullMixedLedgerUpdate (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) (tag.map (Sum.map id f)) L x (fullPermutationKeyEventEquiv (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) f tag x e)) = fullMixedLedgerUpdate (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C (f i) g)) B (fun i _ => PhysicalAuxLabels P (C (f i))) (fun i => physicalFullEdgeDelta (C (f i)) (k (f i))) (fun i => physicalFullEdgeD (C (f i))) := by funext tag L x e exact (by cases tag with | none => rfl | some tag => cases tag <;> rfl ) have hp : (fun (tag : Option (V ⊕ H)) (L : ∀ g, Finset (P g)) (x : PhysicalFullBoundedState P J ell B) (e : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C (f i) g)) B (fun i _ => PhysicalAuxLabels P (C (f i))) (fun i => physicalFullEdgeDelta (C (f i)) (k (f i))) (fun i => physicalFullEdgeD (C (f i))) tag x) => physicalFullLedgerEventPhase C k ω β ρ W (tag.map (Sum.map id f)) (L, x) (fullPermutationKeyEventEquiv (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) f tag x e)) = (fun tag L x e => physicalFullLedgerEventPhase (fun i => C (f i)) (fun i => k (f i)) (fun i => ω (f i)) β ρ W tag (L, x) e) := by funext tag L x e exact physical_full_key_history_phase C k f ω β ρ W tag L x e erw [hu, hp] at h exact h end Path end Bounty end section /- The terminal state on the actual effective planned big path. -/ open scoped Classical namespace Bounty section Coefficient variable {S I V K : Type} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : K → I → ℤ) (B : ℕ) noncomputable def physicalEffectivePlanTerminal (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) (x : PhysicalFullBoundedState P J ell B) (p : PhysicalEffectivePlannedBigPath C k B ks L pl x) := let Cb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => C key.2.1 let kb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => k key.1 key.2.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) physicalFullPathTerminal Cb kb (physicalMixedBigSteps ks L pl) x p theorem physical_effective_terminal_plan_cast (ks : List (Option (V ⊕ K))) {a b : PhysicalMarkLists Ps J ell × PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks} (h : a = b) (x : PhysicalFullBoundedState P J ell B) (p : PhysicalEffectivePlannedBigPath C k B ks a.1 a.2 x) : physicalEffectivePlanTerminal C k B ks b.1 b.2 x (physicalEffectivePlanPathCastEquiv C k B ks h x p) = physicalEffectivePlanTerminal C k B ks a.1 a.2 x p := by cases h rfl end Coefficient end Bounty end section /- The literal original root scalar is the dependent sum over its exact small-plan coordinates. -/ open Finset Classical namespace Bounty section Sum variable {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (β : PhysicalPrime P → ℝ) (B : ℕ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) theorem physical_root_small_plan_sigma : let _ := physicalMixedSmallPlanFintype (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) let _ : ∀ p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns, Fintype (PhysicalRootSmallPlanBigData groups patterns C hC p) := fun p => physicalGroupSelectedDataFintype (P := fun g : {g // g ∉ groupsᶜ} => P g.val) (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) physicalRootSmallPlanSum (n := n) groups patterns C hC V q ζ k K β B r θ = ∑ p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns, ∑ db : PhysicalRootSmallPlanBigData groups patterns C hC p, physicalRootSmallPlanIntegrand groups patterns C hC V q ζ k K β B r θ p db := by let _ := physicalMixedSmallPlanFintype (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) let _ : ∀ p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns, Fintype (PhysicalRootSmallPlanBigData groups patterns C hC p) := fun p => physicalGroupSelectedDataFintype (P := fun g : {g // g ∉ groupsᶜ} => P g.val) (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) unfold physicalRootSmallPlanSum physicalRootSmallPlanSumCore dsimp only rw [← Fintype.sum_sigma'] apply sum_congr · exact congrArg (fun inst : Fintype _ => @Finset.univ _ inst) (Subsingleton.elim _ _) · intro p _ rfl end Sum end Bounty end section /- Expand the actual original selected-coefficient moment only after recovering its local coefficient. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) variable [Fintype (PhysicalSelectedData P ell C)] end Physical end Bounty end section /- The original capped big history is the history of the numbered big selected data. -/ open scoped Classical namespace Bounty variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) noncomputable def physicalRootNumberedBigData : PhysicalSelectedData (fun h => P (e.symm h).val) ell (fun j h => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm h).val) := physicalSelectedGroupReindex e (fun g => P g.val) (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) db theorem physical_root_numbered_big_activity (g : Fin M) : physicalGroupBareFiniteActivity (physicalPathSelectedEquiv patterns C (physicalRootSmallPlanPath groups patterns C hC p db)).2.2.1 (e.symm g).val = physicalGroupBareFiniteActivity (physicalRootNumberedBigData groups e patterns C hC p db).2.1 g := by funext j z have hm := congrFun (congrFun (physical_root_small_plan_big_marks groups patterns C hC p db) j) (e.symm g) change physicalGroupPhaseActivity _ _ _ = physicalGroupPhaseActivity _ _ _ unfold physicalGroupPhaseActivity physicalGroupMarks physicalGroupMarkEmbedding rw [hm] rfl variable [∀ a : PhysicalPrime P, NeZero a.2.val] theorem physical_root_numbered_big_capped_history (q : ℝ) (k : ℕ → I → ℤ) (β : PhysicalPrime P → ℝ) (V : Fin N → ℝ) (B : ℕ) (hB : (physicalPrimeGroups P groups).card ≤ B) : let := physicalNumberedBigPrimeNonzero (P := P) groups e let old := physicalRootSmallPlanPath groups patterns C hC p db physicalGroupFiniteCappedHistory groups C q k β V B old.1 old.2 = ghostPhaseCappedHistory (fun z : PhysicalPrime (fun h => P (e.symm h).val) => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity (physicalRootNumberedBigData groups e patterns C hC p db).2.1 z.1) j z.2) (fun z => physicalResidueAbsoluteHit (P := fun h => P (e.symm h).val) (physicalPathSelectedOffset C k old.1 old.2) z.1 z.2) (fun _ j => 1 - physicalEndpointSchedule q (n + 1) (globalBirthFiniteIndex (n + 1) j).val) (fun z => β ⟨(e.symm z.1).val, z.2⟩) (fun z => V (e.symm z.1).val) (fun _ => B) (fun _ => B) (n + 1) := by let := physicalNumberedBigPrimeNonzero (P := P) groups e dsimp only rw [physical_group_capped_history_numbered groups e patterns C q k β V B _ _ hB] have ha : (fun z : PhysicalPrime (fun h => P (e.symm h).val) => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity (physicalPathSelectedEquiv patterns C (physicalRootSmallPlanPath groups patterns C hC p db)).2.2.1 (e.symm z.1).val) j z.2) = (fun z : PhysicalPrime (fun h => P (e.symm h).val) => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity (physicalRootNumberedBigData groups e patterns C hC p db).2.1 z.1) j z.2) := by funext z j rw [physical_root_numbered_big_activity groups e patterns C hC p db] rw [ha] rfl end Bounty end section /- The actual ambient rough discrepancy in the original saturated finite harmonic correlation. -/ open Finset Filter open scoped ComplexConjugate namespace Bounty end Bounty end section /- The actual ambient prime discrepancy in the original saturated finite harmonic correlation. -/ open Finset Filter open scoped ComplexConjugate namespace Bounty end Bounty end section /- Nonzero blocks of the actual ambient discrepancies have the required Type-II sizes. -/ open Finset Filter namespace Bounty theorem eventually_ambient_rough_active_dyadic_bounds {aMin vMax : ℝ} (haMin : 0 < aMin) (hvMax : vMax < 1) : ∀ᶠ L : ℝ in atTop, ∀ (γ S a v : ℝ), aMin ≤ a → v ≤ vMax → ∀ (T : Finset ℕ) (μ : ℕ → ℝ) (H i j : ℕ), shiftedTypeIIBilinear T μ (typeIIRestrict (dyadicNatBucket (Icc 1 H) i) (ambientRoughIntervalTypeIIAlpha γ L S a v)) (typeIIRestrict (dyadicNatBucket (Icc 1 H) j) (ambientRoughTypeIIBeta (Real.exp (a*L)) (Real.exp (v*L)))) ≠ 0 → Real.exp ((min ((1-vMax)/2) (aMin/2))*L) ≤ originalDyadicBase i ∧ originalDyadicBase i ≤ Real.exp L ∧ Real.exp ((min ((1-vMax)/2) (aMin/2))*L) ≤ originalDyadicBase j ∧ originalDyadicBase j ≤ Real.exp L := by filter_upwards [eventually_exponential_dyadic_base_bounds (a := 1-vMax) (b := 1-aMin) (C := (33 : ℝ)) (by linarith) (by linarith) (by norm_num), eventually_exponential_dyadic_base_bounds (a := aMin) (b := vMax) (C := (1 : ℝ)) haMin hvMax (by norm_num),eventually_ge_atTop (0 : ℝ)] with L hmBase hnBase hL intro γ S a v ha hv T μ H i j hne obtain ⟨w,_,hwm,hwn⟩ := shifted_typeII_nonzero_factors T μ _ _ hne obtain ⟨hmi,hα⟩ := (typeIIRestrict_ne_zero_iff _ _ _).mp hwm obtain ⟨hnj,hβ⟩ := (typeIIRestrict_ne_zero_iff _ _ _).mp hwn have hmrange := ambient_rough_interval_typeII_support γ L S a v hα have hnmem := (ambient_rough_typeII_beta_properties (Real.exp (a*L)) (Real.exp (v*L)) w.2).2 hβ have hnrange := (mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le w.2).mp hnmem.1 have hmlo : Real.exp ((1-vMax)*L) ≤ (w.1 : ℝ) := (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right (by linarith) hL)).trans hmrange.2.2.1 have hmhi : (w.1 : ℝ) ≤ 33*Real.exp ((1-aMin)*L) := hmrange.2.2.2.trans (mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right (by linarith) hL)) (by norm_num)) have hnlo : Real.exp (aMin*L) ≤ (w.2 : ℝ) := (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right ha hL)).trans hnrange.2.1.le have hnhi : (w.2 : ℝ) ≤ 1*Real.exp (vMax*L) := by simpa only [one_mul] using hnrange.2.2.trans (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right hv hL)) have hmb := original_dyadic_member_bounds H i w.1 hmi have hnb := original_dyadic_member_bounds H j w.2 hnj obtain ⟨hmlo',hmhi'⟩ := hmBase _ _ hmlo hmhi hmb.1 hmb.2 obtain ⟨hnlo',hnhi'⟩ := hnBase _ _ hnlo hnhi hnb.1 hnb.2 refine ⟨?_,hmhi',?_,hnhi'⟩ · exact (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right (min_le_left _ _) hL)).trans hmlo' · exact (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right (min_le_right _ _) hL)).trans hnlo' theorem eventually_ambient_prime_active_dyadic_bounds : ∀ᶠ L : ℝ in atTop, ∀ (κ S : ℝ), 0 ≤ κ → κ ≤ 1/50 → ∀ (proxy : Bool) (T : Finset ℕ) (μ : ℕ → ℝ) (H i j : ℕ), shiftedTypeIIBilinear T μ (typeIIRestrict (dyadicNatBucket (Icc 1 H) i) (ambientPrimeTypeIIAlpha κ L S)) (typeIIRestrict (dyadicNatBucket (Icc 1 H) j) (if proxy then ambientProxyTypeIIBeta κ L S else ambientPrimeTypeIIBeta κ L)) ≠ 0 → Real.exp ((1/5 : ℝ)*L) ≤ originalDyadicBase i ∧ originalDyadicBase i ≤ Real.exp L ∧ Real.exp ((1/5 : ℝ)*L) ≤ originalDyadicBase j ∧ originalDyadicBase j ≤ Real.exp L := by filter_upwards [eventually_exponential_dyadic_base_bounds (a := (2/5 : ℝ)) (b := (3/5 : ℝ)) (C := (1 : ℝ)) (by norm_num) (by norm_num) (by norm_num),eventually_ge_atTop (0 : ℝ)] with L hBase hL intro κ S hκ hκmax proxy T μ H i j hne obtain ⟨w,_,hwm,hwn⟩ := shifted_typeII_nonzero_factors T μ _ _ hne obtain ⟨hmi,hα⟩ := (typeIIRestrict_ne_zero_iff _ _ _).mp hwm obtain ⟨hnj,hβ⟩ := (typeIIRestrict_ne_zero_iff _ _ _).mp hwn have hmrange := (ambient_balanced_typeII_support κ L S).1 hα have hnrange : w.2 ∈ ambientBalancedTypeIIRange κ L := by cases proxy with | false => exact (ambient_balanced_typeII_support κ L S).2.1 hβ | true => exact (ambient_balanced_typeII_support κ L S).2.2 hβ have hrange (n : ℕ) (hn : n ∈ ambientBalancedTypeIIRange κ L) : Real.exp ((2/5 : ℝ)*L) ≤ (n : ℝ) ∧ (n : ℝ) ≤ 1*Real.exp ((3/5 : ℝ)*L) := by obtain ⟨hlo,hhi⟩ := (mem_ambientBalancedTypeIIRange κ L n).mp hn constructor · exact (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right (by linarith) hL)).trans hlo · simpa only [one_mul] using hhi.trans (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right (by linarith) hL)) have hmr := hrange w.1 hmrange have hnr := hrange w.2 hnrange have hmb := original_dyadic_member_bounds H i w.1 hmi have hnb := original_dyadic_member_bounds H j w.2 hnj have hm := hBase _ _ hmr.1 hmr.2 hmb.1 hmb.2 have hn := hBase _ _ hnr.1 hnr.2 hnb.1 hnb.2 norm_num at hm hn exact ⟨hm.1,hm.2,hn.1,hn.2⟩ end Bounty end section /- A nonzero original block derives its product scale from an actual factor pair. -/ open Finset namespace Bounty theorem original_active_dyadic_product_bounds {L : ℝ} (hL : 0 ≤ L) (μ α β : ℕ → ℝ) (H i j : ℕ) (hne : shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) μ (typeIIRestrict (dyadicNatBucket (Icc 1 H) i) α) (typeIIRestrict (dyadicNatBucket (Icc 1 H) j) β) ≠ 0) : Real.exp L / 4 ≤ originalDyadicBase i * originalDyadicBase j ∧ originalDyadicBase i * originalDyadicBase j ≤ 33*Real.exp L := by obtain ⟨w, hw, hα, hβ⟩ := shifted_typeII_nonzero_factors _ μ _ _ hne have hmi := ((typeIIRestrict_ne_zero_iff _ _ _).mp hα).1 have hnj := ((typeIIRestrict_ne_zero_iff _ _ _).mp hβ).1 have hm := original_dyadic_member_bounds H i w.1 hmi have hn := original_dyadic_member_bounds H j w.2 hnj have hi := (originalDyadicBase_pos i).le have hj := (originalDyadicBase_pos j).le have hd := shifted_factor_pair_properties _ hw have hp := shifted_wide_window_factor_bound hL hd.2.2.1 rw [← hd.2.2.2, Nat.cast_mul] at hp have hlo := mul_le_mul hm.1 hn.1 hj (Nat.cast_nonneg w.1) have hhi := mul_le_mul hm.2 hn.2 (Nat.cast_nonneg w.2) (by positivity : 0 ≤ 2*originalDyadicBase i) constructor <;> nlinarith [hp.1,hp.2] end Bounty end section /- The sharp original real bilinear block is controlled by its actual saturated harmonic tests. -/ open Finset Filter MeasureTheory Real namespace Bounty theorem exists_original_real_bilinear_bound_of_saturated_harmonic {c b : ℝ} (hc : 0 (α m : ℂ)) χ ζ‖ ≤ L^(-Q)) → |shiftedTypeIIBilinear (arithmeticProductWindow 1 (exp L)) (candidateCoefficient c L (1/2) r jStar) α β| ≤ exp L*L^(-D) := by obtain ⟨J, hJ⟩ := exists_candidate_original_finite_mixed_mellin_reduction hc (half_pos hb) (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) < 1) 66 (by norm_num) hr refine ⟨J, ?_⟩ intro jStar hj D obtain ⟨Bwin, hBwin, T, hT, hred⟩ := hJ jStar hj 0 (D+1) obtain ⟨Kmin, hKmin, hpoint⟩ := exists_candidate_finite_mixed_bound_of_saturated_harmonic_range (A := 0) (D := D+1) (Bwin := Bwin) 66 (by norm_num) hc hb (by linarith) hr refine ⟨Bwin, T, hBwin, hT, Kmin, hKmin, ?_⟩ intro K hK have hK0 : 0 ≤ K := hKmin.le.trans hK obtain ⟨Q, F, hQ, hF, hpoint⟩ := hpoint K hK refine ⟨Q, F, hQ, hF, ?_⟩ filter_upwards [hred,hpoint,eventually_original_mellin_scale_geometry_range hb hK0 (by norm_num : (0 : ℝ) < 66),eventually_fixed_candidateQ_prefix hc jStar, eventually_ge_atTop (2 : ℝ)] with L hred hpoint hgeo hprefix hL intro U V M N α β hUlo hUhi hVlo hVhi hcoarse hM hN hαsupp hβsupp hα hβ hrough hcorr have hL0 : 0 < L := by linarith have hjQ := hprefix (mem_Icc.mpr ⟨Nat.zero_le jStar,le_rfl⟩) have hE := hgeo U V hUlo hVlo hcoarse let G : ℕ → ℕ → ℂ := fun u m => (α m : ℂ)*(β ((2*u+1)/m) : ℂ) have hG : ∀ u, ∀ m ∈ (2*u+1).divisors, ‖G u m‖ ≤ L^(0 : ℝ) := by intro u m hm dsimp only [G] rw [norm_mul,Complex.norm_real,Complex.norm_real,Real.norm_eq_abs,Real.norm_eq_abs,rpow_zero] exact (mul_le_mul (hα m) (hβ ((2*u+1)/m)) (abs_nonneg _) zero_le_one).trans (by norm_num) have hGrough : ∀ u ∈ arithmeticProductWindow 1 (exp L), ∀ m ∈ (2*u+1).divisors, ¬(∀ p ∈ m.primeFactors, exp (sqrt L) ≤ (p : ℝ)) → G u m = 0 := by intro u hu m hm hnot have hz : α m = 0 := by by_contra hn exact hnot (fun p hp => (hrough m hn p hp).le) simp only [G,hz,Complex.ofReal_zero,zero_mul] have hS : ∀ u ∈ Icc 1 ⌊66*exp L⌋₊, 0 < u ∧ (u : ℝ) ≤ 66*exp L := by intro u hu exact ⟨(mem_Icc.mp hu).1,(Nat.cast_le.mpr (mem_Icc.mp hu).2).trans (Nat.floor_le (by positivity))⟩ have hSW : arithmeticProductWindow 1 (exp L) ⊆ Icc 1 ⌊66*exp L⌋₊ := by intro u hu have hw := (mem_arithmeticProductWindow_iff one_ne_zero (exp L)).mp hu simp only [one_mul] at hw have hu0 : 0 < u := by exact_mod_cast ((exp_pos L).trans hw.1) exact mem_Icc.mpr ⟨hu0,Nat.le_floor (by nlinarith [hw.2,exp_pos L])⟩ have herr := (hred (U*L^(-K)) (Icc 1 ⌊66*exp L⌋₊) G hS hSW hE.1 hE.2 hG hGrough).2 have hi := hpoint jStar hjQ U V (L^T) M N (fun m => (α m : ℂ)) (fun n => (β n : ℂ)) hUlo hUhi hVlo hVhi hcoarse hM hN (by intro m hm; simp only [hαsupp m hm,Complex.ofReal_zero]) (by intro n hn; simp only [hβsupp n hn,Complex.ofReal_zero]) (by intro m hm; simpa only [Complex.norm_real,Real.norm_eq_abs,rpow_zero] using hα m) (by intro n hn; simpa only [Complex.norm_real,Real.norm_eq_abs,rpow_zero] using hβ n) (by intro m hm hn; exact hrough m (by simpa only [ne_eq,Complex.ofReal_eq_zero] using hn)) hcorr rw [← shifted_typeII_bilinear_complex_divisor_sum] at herr let z : ℂ := (shiftedTypeIIBilinear (arithmeticProductWindow 1 (exp L)) (candidateCoefficient c L (1/2) r jStar) α β : ℂ) let w : ℂ := ∫ ν in {ν : ℝ | ‖ν‖ ≤ L^T}, candidateFiniteMixedMellinIntegrand c L (1/2) r jStar (U*L^(-K)) Bwin 66 (Icc 1 ⌊66*exp L⌋₊) G ν have hbnd : ‖z‖ ≤ ‖z-w‖+‖w‖ := by simpa only [sub_add_cancel] using norm_add_le (z-w) w have hfinal := hbnd.trans (add_le_add herr hi) have hid : exp L*L^(-(D+1))+exp L*L^(-(D+1)) ≤ exp L*L^(-D) := by calc _ = (2/L)*(exp L*L^(-D)) := by rw [show -(D+1) = -D+(-1) by ring,rpow_add hL0,rpow_neg_one] ring _ ≤ _ := mul_le_of_le_one_left (by positivity) ((div_le_one hL0).mpr hL) simpa only [z,Complex.norm_real,Real.norm_eq_abs] using hfinal.trans hid end Bounty end section /- Parameter-neutral absorption of any fixed polynomial prefactor in an integral saving. -/ open Filter namespace Bounty end Bounty end section /- The original reconstructed path has exactly the fixed-small-plan local big coefficient for every possible big source, target, and auxiliary draw. -/ open scoped Classical namespace Bounty end Bounty end section /- The original fixed-small-plan memory product is exactly the selected big memory product, retaining the full Fourier coefficient and all zero rows. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_plan_memory_product {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) : let old := physicalRootSmallPlanPath groups patterns C hC p db (∏ j ∈ range (n + 1), physicalMemoryLabeledScalar (fun g : {g // g ∉ groupsᶜ} => V g.val) patterns (fun i g => C i g.val) (fun _ => 0) (physicalFixedEdgeBigCoefficient (fun g => g ∈ groupsᶜ) patterns C (ζ ((n + 1) - 1 - j)) (physicalLocalFourierCoefficient C k K θ ((n + 1) - 1 - j)) (finitePathLabels old.2 j) (finitePathMarks old.1 old.2 j) (finitePathMarks old.1 old.2 (j + 1))) (physicalRestrictedEdge (fun g => g ∉ groupsᶜ) patterns C (finitePathLabels old.2 j)) (fun g => finitePathMarks old.1 old.2 j g.val) (fun g => finitePathMarks old.1 old.2 (j + 1) g.val)) = physicalSelectedMemoryProduct (fun j (g : {g // g ∉ groupsᶜ}) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) (fun g : {g // g ∉ groupsᶜ} => V g.val) (fun _ => 0) (physicalRootPlanBigCoefficient groups patterns C hC ζ k K θ p) db := by dsimp only rw [← Fin.prod_univ_eq_prod_range, physicalSelectedMemoryProduct] apply prod_congr rfl intro j _ have hs := physical_root_path_mark_coordinate groups patterns C hC p db j.castSucc have ht := physical_root_path_mark_coordinate groups patterns C hC p db j.succ dsimp only [Fin.val_castSucc, Fin.val_succ] at hs ht rw [hs, ht, physical_root_path_edge_coordinate] simp only [physical_phase_zero_frequency, mul_one, Nat.add_sub_cancel] have h := physical_selected_split_memory_labeled (fun g => g ∈ groupsᶜ) patterns C (physicalRootSmallPlanPattern groups patterns C hC p) (physicalRootSmallPlanSmallData groups patterns C hC p) db V (ζ (n - j.val)) (physicalLocalFourierCoefficient C k K θ (n - j.val)) j simp only [physicalRootPlanBigCoefficient, ← Nat.card_eq_fintype_card] at h ⊢ convert h using 1 · exact physical_memory_labeled_scalar_instances _ _ _ _ _ _ _ _ _ _ _ _ · congr 1 split_ifs · congr 2 exact physical_aux_mass_instances _ _ _ _ _ · rfl end Bounty end section /- The small coordinates of the original reconstructed path are exactly those of the fixed selected small plan. -/ open scoped Classical namespace Bounty section Coordinates variable {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) theorem physical_root_path_small_marks (j : Fin (n + 2)) : let old := physicalRootSmallPlanPath groups patterns C hC p db (fun g : ↥groupsᶜ => finitePathMarks old.1 old.2 j.val g.val) = (physicalRootSmallPlanSmallData groups patterns C hC p).2.1 j := by dsimp only rw [physical_root_path_mark_coordinate] exact congrArg (fun d => d.1.2.1 j) ((physicalGroupSelectedSplit (fun g => g ∈ groupsᶜ) (fun j => C (physicalRootSmallPlanPattern groups patterns C hC p j).val)).apply_symm_apply (physicalRootSmallPlanSmallData groups patterns C hC p, db)) theorem physical_root_path_small_edge (j : Fin (n + 1)) : let old := physicalRootSmallPlanPath groups patterns C hC p db let ds := physicalRootSmallPlanSmallData groups patterns C hC p physicalRestrictedEdge (fun g => g ∈ groupsᶜ) patterns C (old.2 j).1 = (ds.2.2.1 j, ds.2.2.2 j, ⟨physicalRootSmallPlanPattern groups patterns C hC p j, ds.1 j⟩) := by dsimp only have he := physical_root_path_edge_coordinate groups patterns C hC p db j simp only [finitePathLabels, dif_pos j.isLt] at he rw [he] let ds := physicalRootSmallPlanSmallData groups patterns C hC p let d := (physicalGroupSelectedSplit (fun g => g ∈ groupsᶜ) (fun j => C (physicalRootSmallPlanPattern groups patterns C hC p j).val)).symm (ds, db) have hs := congrArg Prod.fst ((physicalGroupSelectedSplit (fun g => g ∈ groupsᶜ) (fun j => C (physicalRootSmallPlanPattern groups patterns C hC p j).val)).apply_symm_apply (ds, db)) have hσ : (fun g : ↥groupsᶜ => d.2.2.1 j g.val) = ds.2.2.1 j := congrArg (fun d => d.2.2.1 j) hs have hτ : (fun g : ↥groupsᶜ => d.2.2.2 j g.val) = ds.2.2.2 j := congrArg (fun d => d.2.2.2 j) hs have ha : (fun g : ↥groupsᶜ => d.1 j g.val) = ds.1 j := congrArg (fun d => d.1 j) hs change (((fun g : ↥groupsᶜ => d.2.2.1 j g.val), (fun g : ↥groupsᶜ => d.2.2.2 j g.val), ⟨physicalRootSmallPlanPattern groups patterns C hC p j, (fun g : ↥groupsᶜ => d.1 j g.val)⟩) : PhysicalEdgeLabels (fun g : ↥groupsᶜ => P g.val) J ell patterns (fun i g => C i g.val)) = _ rw [hσ, hτ, ha] end Coordinates end Bounty end section /- The original prime precision estimate retains an independent bounded multiplier on the full residual. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- The original rough precision estimate retains an independent bounded multiplier on the full residual. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- Key relabeling preserves the full signed weight, including its history phase. -/ open scoped Classical namespace Bounty section Key variable {I H V : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : I → ℤ) (f : H → I) variable (ω : ∀ i, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C i g)) → PhysicalAuxLabels P (C i) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (W : Fin N → ℝ) (retention : V → ℝ) theorem physical_full_key_signed_weight (steps : List (Option (V ⊕ H))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C (f i) g)) B (fun i _ => PhysicalAuxLabels P (C (f i))) (fun i => physicalFullEdgeDelta (C (f i)) (k (f i))) (fun i => physicalFullEdgeD (C (f i))) steps x) : physicalFullSignedWeight C k ω β retention ρ W (steps.map (Option.map (Sum.map id f))) x (physicalFullKeyPathEquiv C k f steps x p) = physicalFullSignedWeight (fun i => C (f i)) (fun i => k (f i)) (fun i => ω (f i)) β retention ρ W steps x p := by have hw := full_permutation_key_path_weight (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i _ => PhysicalAuxLabels P (C i)) (fun i => physicalFullEdgeDelta (C i) (k i)) (fun i => physicalFullEdgeD (C i)) f ω (fun g p => β g p / W g) retention ρ W steps x p have hh := physical_full_key_history_path C k f ω β ρ W steps x p exact congrArg₂ (fun (w : ℝ) (h : ℂ) => (w : ℂ) * h) hw hh end Key end Bounty end section /- Radius-generalized companion; only the separate R <= exp L assumption is removed. The original prime precision estimate retains an independent bounded multiplier on the full residual. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_original_filtered_prime_integral_precision_with_residual_multiplier_log_radius (hZ : PrimitiveZeroFreeHalfPlane) {c q cLog d A aLong : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (T : ℕ) (Tmod Sshift Cmod Sfreq : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ ρ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → (∀ n, ‖ρ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p)*harmonicMellinWeight u p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*χQ (n : ZMod qQ)*harmonicMellinWeight u n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n*harmonicMellinWeight u n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n) n* harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hres⟩ := exists_candidate_selected_residual_power_bound hc hq0 hq1 T obtain ⟨Bcoeff,hBcoeff,hsmall⟩ := exists_candidate_small_prime_factor_data hc refine ⟨C,hC,?_⟩ intro B let X := max 0 ((A+2*(C+B)+23)/2) have hAs0 : 0 ≤ X := le_max_left _ _ have hX : (A+2*(C+B)+23)/2 ≤ X := le_max_right _ _ have hAs : A+2*(C+B)+21 ≤ 2*X := by linarith have hH : A+2*(C+B)+23 ≤ 2*X := by linarith obtain ⟨B0,hB0,hmain⟩ := exists_ambient_prime_four_factor_integral_decay_log_radius (a := (1/10 : ℝ)) (beta := (1/5 : ℝ)) (Et := C+B) hZ (by norm_num) (by norm_num) (by norm_num) hcLog hd hBcoeff hAs0 haLong hAs hH Tmod Sshift Cmod Sfreq let Bsave := (A+B0+2*(C+B)+7)/2 have hsave : A+B0+2*(C+B)+7 ≤ 2*Bsave := by dsimp [Bsave]; linarith refine ⟨max 0 (max (max B0 Sfreq) Cmod+Bsave+5), le_max_left _ _, ?_⟩ intro S hS0 have hS : 0 ≤ S := (le_max_left _ _).trans hS0 have hprecision : max (max B0 Sfreq) Cmod+Bsave+5 ≤ S := (le_max_right _ _).trans hS0 filter_upwards [hmain Bsave hsave S hS hprecision,hres,hsmall,eventually_gt_atTop (0 : ℝ)] with L hdecay hresL hsmallL hL intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ρ ht hb hκ hρ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog obtain ⟨hsprime,hPlo,hPhi,hcoeff⟩ := hsmallL g hg s P hs hne hsp have hT := hresL B r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n) ht hb hκ (fun n => by rw [norm_mul] exact (mul_le_mul (character_typeIIPhase_norm_le χT τT n) (hρ n) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1)) have hbound := hdecay s hsprime (fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p.val : ZMod qP)*typeIIPhase τP p.val)) Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp (hcoeff (fun n => χP (n : ZMod qP)*typeIIPhase τP n) (fun n _ => character_typeIIPhase_norm_le χP τP n)) lo hi F (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n)) UM UT (L^(C+B)) hUM hUT (Real.rpow_nonneg hL.le _) le_rfl (fun n _ => hT n) hMband hFband κM ν qM χM hκM hκmax hqM hν UQ Alo Blo σ qQ χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog have hQeq (u : ℝ) : (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*χQ (n : ZMod qQ)*harmonicMellinWeight u n) = ∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u+σ) n*χQ (n : ZMod qQ) := by apply sum_congr rfl intro n _ rw [mul_right_comm,typeIIPhase_harmonic_mellin_shift] have hMeq (u : ℝ) : (∑ n ∈ Ioc lo hi, (ambientPrimeTypeIIAlpha κM L S n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n*harmonicMellinWeight u n) = ∑ n ∈ Ioc lo hi, ambientPrimeMellinCoefficient κM L S ν χM n*harmonicMellinWeight u n := by apply sum_congr rfl intro n hn rw [ambient_prime_original_phase_coefficient κM L S ν χM ((Nat.zero_le lo).trans_lt (mem_Ioc.mp hn).1)] have hPeq (u : ℝ) := prime_reciprocal_polynomial_eq_harmonic_sum s (fun n : ℕ => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (n : ZMod qP)*typeIIPhase τP n)) u simpa only [typeIIRestrict_nonzero_phase_mellin_sum,hPeq,hQeq,hMeq] using hbound end Bounty end section /- Radius-generalized companion; only the separate R <= exp L assumption is removed. The original rough precision estimate retains an independent bounded multiplier on the full residual. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_original_filtered_rough_integral_precision_with_residual_multiplier_log_radius (hZ : PrimitiveZeroFreeHalfPlane) {c q cLog d A aLong γrough vMax : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (hγ : 0 < γrough) (hv : vMax < 1) (T : ℕ) (Tmod Sshift Cmod Sfreq : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ ρ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → (∀ n, ‖ρ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p)*harmonicMellinWeight u p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*χQ (n : ZMod qQ)*harmonicMellinWeight u n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n*harmonicMellinWeight u n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n) n* harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hres⟩ := exists_candidate_selected_residual_power_bound hc hq0 hq1 T obtain ⟨Bcoeff,hBcoeff,hsmall⟩ := exists_candidate_small_prime_factor_data hc refine ⟨C,hC,?_⟩ intro B let X := max 0 ((A+2*(C+B)+23)/2) have hAs0 : 0 ≤ X := le_max_left _ _ have hX : (A+2*(C+B)+23)/2 ≤ X := le_max_right _ _ have hAs : A+2*(C+B)+21 ≤ 2*X := by linarith have hH : A+2*(C+B)+23 ≤ 2*X := by linarith obtain ⟨B0,hB0,hmain⟩ := exists_ambient_rough_four_factor_integral_decay_log_radius (a := (1/10 : ℝ)) (beta := (1/5 : ℝ)) (Et := C+B) hZ (by norm_num) (by norm_num) (by norm_num) hcLog hd hBcoeff hAs0 haLong hγ hv hAs hH Tmod Sshift Cmod Sfreq let Bsave := (A+B0+2*(C+B)+7)/2 have hsave : A+B0+2*(C+B)+7 ≤ 2*Bsave := by dsimp [Bsave]; linarith refine ⟨max 0 (max (max B0 Sfreq) Cmod+Bsave+5), le_max_left _ _, ?_⟩ intro S hS0 have hS : 0 ≤ S := (le_max_left _ _).trans hS0 have hprecision : max (max B0 Sfreq) Cmod+Bsave+5 ≤ S := (le_max_right _ _).trans hS0 filter_upwards [hmain Bsave hsave S hS hprecision,hres,hsmall,eventually_gt_atTop (0 : ℝ)] with L hdecay hresL hsmallL hL intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ρ ht hb hκ hρ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog obtain ⟨hsprime,hPlo,hPhi,hcoeff⟩ := hsmallL g hg s P hs hne hsp have hT := hresL B r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n) ht hb hκ (fun n => by rw [norm_mul] exact (mul_le_mul (character_typeIIPhase_norm_le χT τT n) (hρ n) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1)) have hbound := hdecay s hsprime (fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p.val : ZMod qP)*typeIIPhase τP p.val)) Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp (hcoeff (fun n => χP (n : ZMod qP)*typeIIPhase τP n) (fun n _ => character_typeIIPhase_norm_le χP τP n)) lo hi F (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n)) UM UT (L^(C+B)) hUM hUT (Real.rpow_nonneg hL.le _) le_rfl (fun n _ => hT n) hMband hFband aM v ν qM χM hvM hqM hν UQ Alo Blo σ qQ χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog have hQeq (u : ℝ) : (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*χQ (n : ZMod qQ)*harmonicMellinWeight u n) = ∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u+σ) n*χQ (n : ZMod qQ) := by apply sum_congr rfl intro n _ rw [mul_right_comm,typeIIPhase_harmonic_mellin_shift] have hMeq (u : ℝ) : (∑ n ∈ Ioc lo hi, (ambientRoughIntervalTypeIIAlpha γrough L S aM v n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n*harmonicMellinWeight u n) = ∑ n ∈ Ioc lo hi, ambientRoughMellinCoefficient γrough L S aM v ν χM n*harmonicMellinWeight u n := by apply sum_congr rfl intro n hn rw [ambient_rough_original_phase_coefficient γrough L S aM v ν χM ((Nat.zero_le lo).trans_lt (mem_Ioc.mp hn).1)] have hPeq (u : ℝ) := prime_reciprocal_polynomial_eq_harmonic_sum s (fun n : ℕ => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (n : ZMod qP)*typeIIPhase τP n)) u simpa only [typeIIRestrict_nonzero_phase_mellin_sum,hPeq,hQeq,hMeq] using hbound end Bounty end section /- The high-rank bound instantiated with the actual recovered physical coefficient. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (b : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) end Physical end Bounty end section /- Concrete Fourier rows retain the recovered physical coefficient and original initial-label gate. -/ open Finset Classical MeasureTheory namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (b : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (initial : (g : Fin N) → Finset ↥(P g)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) (θ : (Fin (Fintype.card (FullMixedBirthAddress (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) × Fin (Fintype.card (FullMixedBirthAddress (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) → ℝ) (encode : ((g : Fin N) × ↥(P g)) → ℤ) end Physical end Bounty end section /- The actual recovered physical coefficient has one common forest code space across all edge patterns. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) variable [Fintype (PhysicalSelectedData P ell C)] end Physical end Bounty end section /- Each fixed small plan supplies the exact original big-step multiplier. -/ open scoped Classical namespace Bounty variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) noncomputable def physicalRootPlanMultiplier (j : Fin (n + 1)) : ℤ := k (n - j.val) (physicalRootSmallPlanPattern groups patterns C hC p j).val * (physicalSharedProduct (physicalSharedPrefix (physicalPermuteLabels ((physicalRootSmallPlanSmallData groups patterns C hC p).2.2.1 j) ((physicalRootSmallPlanSmallData groups patterns C hC p).2.1 j.castSucc))) : ℕ) theorem physical_root_small_plan_path_pattern (db : PhysicalRootSmallPlanBigData groups patterns C hC p) (j : Fin (n + 1)) : ((physicalRootSmallPlanPath groups patterns C hC p db).2 j).1.2.2.1 = physicalRootSmallPlanPattern groups patterns C hC p j := rfl theorem physical_root_plan_offset_step (e : {g // g ∉ groupsᶜ} ≃ Fin M) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) (j : Fin (n + 1)) : let old := physicalRootSmallPlanPath groups patterns C hC p db let dn := physicalRootNumberedBigData groups e patterns C hC p db physicalPathSelectedOffset C k old.1 old.2 j.succ = physicalPathSelectedOffset C k old.1 old.2 j.castSucc + physicalRootPlanMultiplier groups patterns C hC k p j * (physicalD (fun g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val) (physicalPermuteLabels (dn.2.2.1 j) (dn.2.1 j.castSucc)) (dn.1 j) : ℤ) := by dsimp only have ho := physical_path_selected_offset_step C k (physicalRootSmallPlanPath groups patterns C hC p db).1 (physicalRootSmallPlanPath groups patterns C hC p db).2 j rw [physical_root_small_plan_selected_coordinates] at ho dsimp only [physicalPathSelectedMultiplier] at ho rw [physical_root_small_plan_path_pattern] at ho have hsplit := physical_selected_group_inverse_D (fun g => g ∈ groupsᶜ) (fun j => C (physicalRootSmallPlanPattern groups patterns C hC p j).val) (physicalRootSmallPlanSmallData groups patterns C hC p) db j dsimp only at hsplit rw [hsplit] at ho have hempty := physical_D_empty_cut (fun g : ↥groupsᶜ => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) (fun g => hC (physicalRootSmallPlanPattern groups patterns C hC p j) g) ((physicalRootSmallPlanSmallData groups patterns C hC p).1 j) (physicalPermuteLabels ((physicalRootSmallPlanSmallData groups patterns C hC p).2.2.1 j) ((physicalRootSmallPlanSmallData groups patterns C hC p).2.1 j.castSucc)) have hfin : @Subtype.fintype (Fin N) (fun g => g ∈ groupsᶜ) (fun g => Classical.propDecidable (g ∈ groupsᶜ)) (Fin.fintype N) = Finset.Subtype.fintype groupsᶜ := Subsingleton.elim _ _ rw [hfin, hempty] at ho have hd := physical_selected_group_reindexed_D e (fun g : {g // g ∉ groupsᶜ} => P g.val) (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) db j dsimp only at hd dsimp only [physicalRootNumberedBigData] rw [hd] have hbig : @Subtype.fintype (Fin N) (fun g => g ∉ groupsᶜ) (fun g => @instDecidableNot (g ∈ groupsᶜ) (Classical.propDecidable (g ∈ groupsᶜ))) (Fin.fintype N) = @Subtype.fintype (Fin N) (fun g => g ∉ groupsᶜ) (fun g => @instDecidableNot (g ∈ groupsᶜ) (Finset.decidableMem g groupsᶜ)) (Fin.fintype N) := Subsingleton.elim _ _ rw [hbig] at ho simpa only [physicalRootPlanMultiplier, Nat.cast_mul, mul_assoc] using ho theorem physical_root_plan_multiplier_not_dvd (e : {g // g ∉ groupsᶜ} ≃ Fin M) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (j : Fin (n + 1)) (g : Fin M) (a : ↥(P (e.symm g).val)) : ¬ (a.val : ℤ) ∣ physicalRootPlanMultiplier groups patterns C hC k p j := by have hd : ∀ s : ↥groupsᶜ, ∀ g : Fin M, Disjoint (P s.val) (P (e.symm g).val) := by intro s g apply hdis intro he apply (e.symm g).property simpa only [← he] using s.property apply physical_big_prime_not_dvd_effective_multiplier (fun s => hP s.val) (fun g => hP (e.symm g).val) hd (physicalSharedPrefix (physicalPermuteLabels ((physicalRootSmallPlanSmallData groups patterns C hC p).2.2.1 j) ((physicalRootSmallPlanSmallData groups patterns C hC p).2.1 j.castSucc))) exact hk (n - j.val) (by omega) _ (physicalRootSmallPlanPattern groups patterns C hC p j).property (e.symm g).val a.val a.property end Bounty end section /- Original product-scale savings imply the exponential-scale block interface. -/ open Finset namespace Bounty end Bounty end section /- Exact active-block geometry supplies the coarse range and every original cross-scale input. -/ open Finset Filter namespace Bounty end Bounty end section /- The actual restricted ambient coefficients meet the unit and rough-support inputs. -/ open Finset Filter namespace Bounty theorem eventually_ambient_rough_dyadic_coefficient_properties {γ : ℝ} (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, ∀ (S a v : ℝ) (H i j n : ℕ), |typeIIRestrict (dyadicNatBucket (Icc 1 H) i) (ambientRoughIntervalTypeIIAlpha γ L S a v) n| ≤ 1 ∧ |typeIIRestrict (dyadicNatBucket (Icc 1 H) j) (ambientRoughTypeIIBeta (Real.exp (a*L)) (Real.exp (v*L))) n| ≤ 1 ∧ (typeIIRestrict (dyadicNatBucket (Icc 1 H) i) (ambientRoughIntervalTypeIIAlpha γ L S a v) n ≠ 0 → ∀ p ∈ n.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)) := by filter_upwards [eventually_rough_typeII_restriction_properties hγ] with L hprop intro S a v H i j n have ha (m : ℕ) := hprop S (ambientRoughCofactorRange L a v) m refine ⟨typeIIRestrict_abs_le zero_le_one (fun m _ => (ha m).1) n, typeIIRestrict_abs_le zero_le_one (fun m _ => (ambient_rough_typeII_beta_properties (Real.exp (a*L)) (Real.exp (v*L)) m).1) n, ?_⟩ intro hn exact ((ha n).2 ((typeIIRestrict_ne_zero_iff _ _ _).mp hn).2).2 theorem eventually_ambient_prime_dyadic_coefficient_properties (S : ℝ) (hS : 0 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ (proxy : Bool) (H i j n : ℕ), |typeIIRestrict (dyadicNatBucket (Icc 1 H) i) (ambientPrimeTypeIIAlpha κ L S) n| ≤ 1 ∧ |typeIIRestrict (dyadicNatBucket (Icc 1 H) j) (if proxy then ambientProxyTypeIIBeta κ L S else ambientPrimeTypeIIBeta κ L) n| ≤ 1 ∧ (typeIIRestrict (dyadicNatBucket (Icc 1 H) i) (ambientPrimeTypeIIAlpha κ L S) n ≠ 0 → ∀ p ∈ n.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)) := by filter_upwards [eventually_balanced_typeII_coefficient_properties S hS] with L hprop intro κ hκ hκmax proxy H i j n have ha := hprop κ hκ hκmax refine ⟨typeIIRestrict_abs_le zero_le_one (fun m _ => (ha m).1) n, ?_, ?_⟩ · apply typeIIRestrict_abs_le zero_le_one intro m hm cases proxy with | false => exact (ha m).2.1 | true => exact (ha m).2.2.1 · intro hn exact ((ha n).2.2.2 ((typeIIRestrict_ne_zero_iff _ _ _).mp hn).2).2 end Bounty end section /- The actual recorded selected-path action equals the original physical moment. The original trace, local phases and zero-weight paths are retained. -/ open Finset Classical namespace Bounty section Trace variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g (p : P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) [Fintype (PhysicalSelectedData P ell C)] end Trace end Bounty end section /- The original root integrand factors through selected big data while its small vertex weight remains a function of the complete big path. -/ open Finset open scoped Classical namespace Bounty section Integrand variable {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (k : ℕ → I → ℤ) (r : PhysicalGroupResidues P groupsᶜ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) noncomputable def physicalRootPlanSmallWeight (db : PhysicalRootSmallPlanBigData groups patterns C hC p) : ℂ := let old := physicalRootSmallPlanPath groups patterns C hC p db physicalBareWalkScalar (fun g : ↥groupsᶜ => V g.val) patterns (fun i g => C i g.val) (fun _ _ => 0) (fun _ _ _ _ _ => 1) (fun j => physicalRestrictedEdge (fun g => g ∈ groupsᶜ) patterns C (finitePathLabels old.2 j)) (fun j g => finitePathMarks old.1 old.2 j g.val) (n + 1) * (physicalGroupFiniteVertexWeight groupsᶜ C q k old.1 old.2 r : ℂ) theorem physical_root_plan_integrand_selected (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (β : PhysicalPrime P → ℝ) (B : ℕ) (θ : ℝ) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) : let old := physicalRootSmallPlanPath groups patterns C hC p db physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ old.1 old.2 = (physicalStateMass (fun g : ↥groupsᶜ => V g.val) J ell : ℂ) * physicalRootPlanSmallWeight groups patterns C hC V q k r p db * physicalSelectedMemoryProduct (fun j (g : {g // g ∉ groupsᶜ}) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) (fun g : {g // g ∉ groupsᶜ} => V g.val) (fun _ => 0) (physicalRootPlanBigCoefficient groups patterns C hC ζ k K θ p) db * (physicalGroupFiniteCappedHistory groups C q k β V B old.1 old.2 : ℂ) := by dsimp only rw [physical_root_mixed_path_integrand_factor, physical_root_plan_memory_product, physicalRootPlanSmallWeight] ring end Integrand end Bounty end section /- Rational character twists preserve the original prime precision estimate with the exact residual gcd multiplier. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- Rational character twists preserve the original rough precision estimate with the exact residual gcd multiplier. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- Radius-generalized companion; only the separate R <= exp L assumption is removed. Rational character twists preserve the original prime precision estimate with the exact residual gcd multiplier. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_rational_filtered_prime_integral_precision_log_radius (hZ : PrimitiveZeroFreeHalfPlane) {c q cLog d A aLong : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → ∀ (qRat dRat : ℕ), 0 < qRat → 0 < dRat → dRat ∣ qRat → (qRat : ℝ) ≤ L^Rmod → ∀ ψ : AddChar (Additive (ZMod (qRat/dRat))ˣ) ℂ, (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase τP p)*harmonicMellinWeight u p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight u n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase ν n*harmonicMellinWeight u n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*rationalResidualGcdMultiplier qRat dRat ψ n) n* harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hmain⟩ := exists_original_filtered_prime_integral_precision_with_residual_multiplier_log_radius (A := A) hZ hc hq0 hq1 hcLog hd haLong T (Tmod+Rmod) Sshift (Cmod+Rmod) Sfreq refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,eventually_gt_atTop (0 : ℝ)] with L hdecay hL intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ have hquot : 0 < qRat/dRat := Nat.div_pos (Nat.le_of_dvd hqRat0 hdvd) hdRat exact @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ (rationalResidualGcdMultiplier qRat dRat ψ) ht hb hκ (rational_residual_gcd_multiplier_norm_le qRat dRat ψ) g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp (qP*(qRat/dRat)) qT (rationalProductCharacter qRat dRat χP ψ) χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν (qM*(qRat/dRat)) ⟨mul_ne_zero (NeZero.ne qM) hquot.ne'⟩ (rationalProductCharacter qRat dRat χM ψ) hκM hκmax (rational_product_modulus_power_bound hL hqM hqRat) hν UQ Alo Blo σ (qQ*(qRat/dRat)) ⟨mul_ne_zero (NeZero.ne qQ) hquot.ne'⟩ (rationalProductCharacter qRat dRat χQ ψ) hUQ hQA hAB hBQ (rational_product_modulus_power_bound hL hqQ hqRat) hσ hmeanScale hresScale hlog end Bounty end section /- Radius-generalized companion; only the separate R <= exp L assumption is removed. Rational character twists preserve the original rough precision estimate with the exact residual gcd multiplier. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_rational_filtered_rough_integral_precision_log_radius (hZ : PrimitiveZeroFreeHalfPlane) {c q cLog d A aLong γrough vMax : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (hγ : 0 < γrough) (hv : vMax < 1) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → ∀ (qRat dRat : ℕ), 0 < qRat → 0 < dRat → dRat ∣ qRat → (qRat : ℝ) ≤ L^Rmod → ∀ ψ : AddChar (Additive (ZMod (qRat/dRat))ˣ) ℂ, (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase τP p)*harmonicMellinWeight u p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight u n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase ν n*harmonicMellinWeight u n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*rationalResidualGcdMultiplier qRat dRat ψ n) n* harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hmain⟩ := exists_original_filtered_rough_integral_precision_with_residual_multiplier_log_radius (A := A) hZ hc hq0 hq1 hcLog hd haLong hγ hv T (Tmod+Rmod) Sshift (Cmod+Rmod) Sfreq refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,eventually_gt_atTop (0 : ℝ)] with L hdecay hL intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ have hquot : 0 < qRat/dRat := Nat.div_pos (Nat.le_of_dvd hqRat0 hdvd) hdRat exact @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ (rationalResidualGcdMultiplier qRat dRat ψ) ht hb hκ (rational_residual_gcd_multiplier_norm_le qRat dRat ψ) g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp (qP*(qRat/dRat)) qT (rationalProductCharacter qRat dRat χP ψ) χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν (qM*(qRat/dRat)) ⟨mul_ne_zero (NeZero.ne qM) hquot.ne'⟩ (rationalProductCharacter qRat dRat χM ψ) hvM (rational_product_modulus_power_bound hL hqM hqRat) hν UQ Alo Blo σ (qQ*(qRat/dRat)) ⟨mul_ne_zero (NeZero.ne qQ) hquot.ne'⟩ (rationalProductCharacter qRat dRat χQ ψ) hUQ hQA hAB hBQ (rational_product_modulus_power_bound hL hqQ hqRat) hσ hmeanScale hresScale hlog end Bounty end section /- The original coefficient moment equals its low-rank part plus a quantitatively bounded remainder. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (b : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) variable [Fintype (PhysicalSelectedData P ell C)] end Physical end Bounty end section /- The actual coefficient-enriched Fourier phases are bounded and preserve pending-memory symmetry. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (b : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (initial : (g : Fin N) → Finset ↥(P g)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) (θ : (Fin (Fintype.card (FullMixedBirthAddress (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) × Fin (Fintype.card (FullMixedBirthAddress (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) → ℝ) (encode : ((g : Fin N) × ↥(P g)) → ℤ) end Physical end Bounty end section /- The exact small residue factor adds no forbidden set from the small initial root. -/ namespace Bounty end Bounty end section /- The high-rank bound instantiated with the actual recovered physical coefficient. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (b : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) end Physical end Bounty end section /- The original selected physical coefficient uses the same common forest Fourier rows, including the initial factor and every original normalizer. -/ open Finset Classical MeasureTheory namespace Bounty end Bounty end section /- The actual ambient dyadic blocks reduce to their original saturated harmonic tests. -/ open Finset Filter MeasureTheory Real namespace Bounty theorem exists_actual_rough_block_harmonic_reduction {c γ a v : ℝ} (hc : 0 (α m : ℂ)) χ ζ‖ ≤ L^(-Q)) → |shiftedTypeIIBilinear (arithmeticProductWindow 1 (exp L)) (candidateCoefficient c L (1/2) r jStar) α β| ≤ exp L*L^(-D) := by let b := min ((1-v)/2) (a/2) have hb : 0 original_dyadic_member_bounds H i m hm) (fun n hn => original_dyadic_member_bounds H j n hn) (fun m hm => if_neg hm) (fun n hn => if_neg hn) (fun n => (hprops S a v H i j n).1) (fun n => (hprops S a v H i j n).2.1) (fun n => (hprops S a v H i j n).2.2) hcorr end Bounty end section /- The actual ambient dyadic blocks reduce to their original saturated harmonic tests. -/ open Finset Filter MeasureTheory Real namespace Bounty theorem exists_actual_prime_block_harmonic_reduction {c : ℝ} (hc : 0 (α m : ℂ)) χ ζ‖ ≤ L^(-Q)) → |shiftedTypeIIBilinear (arithmeticProductWindow 1 (exp L)) (candidateCoefficient c L (1/2) r jStar) α β| ≤ exp L*L^(-D) := by let b : ℝ := 1/5 have hb : 0 original_dyadic_member_bounds H i m hm) (fun n hn => original_dyadic_member_bounds H j n hn) (fun m hm => if_neg hm) (fun n hn => if_neg hn) (fun n => (hprops κ hκ hκmax proxy H i j n).1) (fun n => (hprops κ hκ hκmax proxy H i j n).2.1) (fun n => (hprops κ hκ hκmax proxy H i j n).2.2) hcorr end Bounty end section /- The weighted sum of selected fine histories is the original moment paired against its exact initial mark mass, with both memory boundaries empty. -/ open Finset Classical namespace Bounty theorem physical_full_vacuum_terminal_encode {N J ell B : ℕ} {P : Fin N → Finset ℕ} (cut : Fin N → Finset (Fin J)) : (fun t : PhysicalBoundedMarkState P J ell B => fullMemoryVacuum (physicalBoundedMarkEncode cut t).2) = physicalEmptyMemoryTerminal := by funext t simp only [fullMemoryVacuum, physicalBoundedMarkEncode, physicalFullMemoryState, physicalEmptyMemoryTerminal] split_ifs with h <;> simp [h] simpa only [Fin.ext_iff, Fin.val_zero] using not_forall.mp h section Pairing variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g (p : P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) [Fintype (PhysicalSelectedData P ell C)] (hV : ∀ g, V g ≠ 0) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) end Pairing end Bounty end section /- The actual original path offset is indexed by all numbered big selected data, so the original fixed-plan multiplier supplies the moment's step law. -/ open scoped Classical namespace Bounty section Offset variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) noncomputable def physicalRootNumberedPlanOffset (dn : PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val)) : Fin (n + 2) → ℤ := let db := (physicalSelectedGroupReindex e (fun g => P g.val) (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val)).symm dn let old := physicalRootSmallPlanPath groups patterns C hC p db physicalPathSelectedOffset C k old.1 old.2 theorem physical_root_numbered_plan_offset_step (dn : PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val)) (j : Fin (n + 1)) : physicalRootNumberedPlanOffset groups e patterns C hC k p dn j.succ = physicalRootNumberedPlanOffset groups e patterns C hC k p dn j.castSucc + physicalRootPlanMultiplier groups patterns C hC k p j * (physicalD (fun g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val) (physicalPermuteLabels (dn.2.2.1 j) (dn.2.1 j.castSucc)) (dn.1 j) : ℤ) := by have h := physical_root_plan_offset_step groups patterns C hC k p e ((physicalSelectedGroupReindex e (fun g => P g.val) (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val)).symm dn) j simpa only [physicalRootNumberedPlanOffset, physicalRootNumberedBigData, Equiv.apply_symm_apply] using h end Offset theorem physical_numbered_big_pools_disjoint {N M : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) : Pairwise (fun g h => Disjoint (P (e.symm g).val) (P (e.symm h).val)) := by intro a b hab apply hdis intro h exact hab (e.symm.injective (Subtype.ext h)) end Bounty end section /- The actual small weight depends on big selected data only through the original offset sequence; both small permutation averages remain explicit. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalSelectedSmallWeight {S : Type*} [Fintype S] {Ps : S → Finset ℕ} {J ell n : ℕ} (Cs : Fin n → S → Finset (Fin J)) (Vs : S → ℝ) (q : ℝ) (r : PhysicalResidues Ps) (a : Fin (n + 1) → ℤ) (d : PhysicalGroupSelectedData Ps ell Cs) : ℂ := ∏ j : Fin n, (Nat.card (PhysicalPermutations S J ell) : ℂ)⁻¹ * (Nat.card (PhysicalPermutations S J ell) : ℂ)⁻¹ * physicalBarePatternScalar Vs (Cs j) 0 (fun _ _ _ => 1) (d.1 j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ)) * ((physicalResidueVertexWeight (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (Real.sqrt q) (physicalTranslateResidues r (a j.castSucc)) * physicalResidueVertexWeight (physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ)) (Real.sqrt q) (physicalTranslateResidues r (a j.succ)) : ℝ) : ℂ) theorem physical_root_small_weight_selected {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) {q : ℝ} (hq : 0 ≤ q) (k : ℕ → I → ℤ) (r : PhysicalGroupResidues P groupsᶜ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (db : PhysicalRootSmallPlanBigData groups patterns C hC p) : let old := physicalRootSmallPlanPath groups patterns C hC p db physicalRootPlanSmallWeight groups patterns C hC V q k r p db = physicalSelectedSmallWeight (fun j (g : ↥groupsᶜ) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) (fun g => V g.val) q (physicalGroupResidueVector r) (physicalPathSelectedOffset C k old.1 old.2) (physicalRootSmallPlanSmallData groups patterns C hC p) := by dsimp only rw [physicalRootPlanSmallWeight, physical_small_vertex_walk_edges groupsᶜ patterns C V hq k] unfold physicalSelectedSmallWeight apply prod_congr rfl intro j _ have he := physical_root_path_small_edge groups patterns C hC p db j have hσ := congrArg Prod.fst he have hτ := congrArg (fun a => a.2.1) he dsimp only [physicalRestrictedEdge] at hσ hτ have hL := physical_root_path_small_marks groups patterns C hC p db j.castSucc have hR := physical_root_path_small_marks groups patterns C hC p db j.succ dsimp only [Fin.val_castSucc, Fin.val_succ] at hL hR rw [he, hL, hR] rw [physical_permute_group_restrict, physical_permute_group_restrict] rw [hσ, hτ, hL, hR] simp only [physicalBareLabeledScalar, ← Nat.card_eq_fintype_card] end Bounty end section /- A common Mellin center is absorbed into the four original phases, preserving the rational residual slice. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- A common Mellin frequency shift preserves the original rational rough precision bound. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- Radius-generalized companion; only the separate R <= exp L assumption is removed. A common Mellin center is absorbed into the four original phases, preserving the rational residual slice. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_rational_shifted_filtered_prime_integral_precision_log_radius (hZ : PrimitiveZeroFreeHalfPlane) {c q cLog d A aLong : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → ∀ (qRat dRat : ℕ), 0 < qRat → 0 < dRat → dRat ∣ qRat → (qRat : ℝ) ≤ L^Rmod → ∀ ψ : AddChar (Additive (ZMod (qRat/dRat))ˣ) ℂ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase τP p)*harmonicMellinWeight (u+w) p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight (u+w) n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase ν n*harmonicMellinWeight (u+w) n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*rationalResidualGcdMultiplier qRat dRat ψ n) n* harmonicMellinWeight (u+w) n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hmain⟩ := exists_rational_filtered_prime_integral_precision_log_radius (A := A) hZ hc hq0 hq1 hcLog hd haLong T Tmod (max Sshift W+1) Cmod (max Sfreq W+1) Rmod refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,eventually_add_frequency_power_bound Sfreq W, eventually_add_frequency_power_bound Sshift W] with L hdecay hfreq hshift intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ w hw have hresult := @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT (τP+w) (τT+w) lo hi F UM UT hUM hUT hMband hFband κM (ν+w) qM hqMInst χM hκM hκmax hqM (hfreq ν w hν hw) UQ Alo Blo (σ+w) qQ hqQInst χQ hUQ hQA hAB hBQ hqQ (hshift σ w hσ hw) hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ have hP (u : ℝ) : (∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))* typeIIPhase (τP+w) p)*harmonicMellinWeight u p) = ∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))* typeIIPhase τP p)*harmonicMellinWeight (u+w) p := by apply sum_congr rfl intro p _ simpa only [mul_assoc,mul_one] using rational_phase_harmonic_common_shift ((1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))) 1 τP u w p have hQ (u : ℝ) : (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase (σ+w) n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight u n) = ∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ simpa only [one_mul] using rational_phase_harmonic_common_shift 1 (rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))) σ u w n have hM (u : ℝ) : (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))* typeIIPhase (ν+w) n*harmonicMellinWeight u n) = ∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))* typeIIPhase ν n*harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ simpa only [mul_one] using rational_phase_harmonic_common_shift ((typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))) 1 ν u w n have hT (u : ℝ) : (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase (τT+w) n* rationalResidualGcdMultiplier qRat dRat ψ n) n*harmonicMellinWeight u n) = ∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n* rationalResidualGcdMultiplier qRat dRat ψ n) n*harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ unfold candidateSelectedResidualCoefficient dsimp only rw [typeIIPhase_add, ← typeIIPhase_harmonic_mellin_shift w u n] ring simpa only [hP,hQ,hM,hT] using hresult end Bounty end section /- Radius-generalized companion; only the separate R <= exp L assumption is removed. A common Mellin frequency shift preserves the original rational rough precision bound. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_rational_shifted_filtered_rough_integral_precision_log_radius (hZ : PrimitiveZeroFreeHalfPlane) {c q cLog d A aLong γrough vMax : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (hγ : 0 < γrough) (hv : vMax < 1) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → ∀ (qRat dRat : ℕ), 0 < qRat → 0 < dRat → dRat ∣ qRat → (qRat : ℝ) ≤ L^Rmod → ∀ ψ : AddChar (Additive (ZMod (qRat/dRat))ˣ) ℂ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase τP p)*harmonicMellinWeight (u+w) p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight (u+w) n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase ν n*harmonicMellinWeight (u+w) n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*rationalResidualGcdMultiplier qRat dRat ψ n) n* harmonicMellinWeight (u+w) n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hmain⟩ := exists_rational_filtered_rough_integral_precision_log_radius (A := A) hZ hc hq0 hq1 hcLog hd haLong hγ hv T Tmod (max Sshift W+1) Cmod (max Sfreq W+1) Rmod refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS, eventually_add_frequency_power_bound Sshift W, eventually_add_frequency_power_bound Sfreq W] with L hdecay hshift hfreq intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ w hw have hraw := @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT (τP+w) (τT+w) lo hi F UM UT hUM hUT hMband hFband aM v (ν+w) qM hqMInst χM hvM hqM (hfreq ν w hν hw) UQ Alo Blo (σ+w) qQ hqQInst χQ hUQ hQA hAB hBQ hqQ (hshift σ w hσ hw) hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ have heP (u : ℝ) : (∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase (τP+w) p)* harmonicMellinWeight u p) = ∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase τP p)* harmonicMellinWeight (u+w) p := by apply sum_congr rfl intro p _ simpa only [mul_one, mul_assoc] using rational_phase_harmonic_common_shift ((1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))) 1 τP u w p have heQ (u : ℝ) : (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase (σ+w) n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))* harmonicMellinWeight u n) = ∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))* harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ simpa only [one_mul] using rational_phase_harmonic_common_shift 1 (rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))) σ u w n have heM (u : ℝ) : (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase (ν+w) n* harmonicMellinWeight u n) = ∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase ν n* harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ simpa only [mul_one] using rational_phase_harmonic_common_shift ((typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))) 1 ν u w n have heT (u : ℝ) : (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase (τT+w) n* rationalResidualGcdMultiplier qRat dRat ψ n) n*harmonicMellinWeight u n) = ∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n* rationalResidualGcdMultiplier qRat dRat ψ n) n*harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ unfold candidateSelectedResidualCoefficient dsimp only rw [typeIIPhase_add, ← typeIIPhase_harmonic_mellin_shift w u n] ring simpa only [heP, heQ, heM, heT] using hraw end Bounty end section /- At the original empty-memory root, disjoint physical pools supply the prime encoding and all coverage hypotheses. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (b : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) variable [Fintype (PhysicalSelectedData P ell C)] end Physical end Bounty end section /- Actual untouched edges retain their complete coefficient and initial gate; permutation rows remain active averages. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (b : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (initial : (g : Fin N) → Finset ↥(P g)) (code : BirthForestCode (Fintype.card (FullMixedBirthAddress (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) (θ : (Fin (Fintype.card (FullMixedBirthAddress (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) × Fin (Fintype.card (FullMixedBirthAddress (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) → ℝ) (encode : ((g : Fin N) × ↥(P g)) → ℤ) end Physical end Bounty end section /- The original coefficient moment equals its low-rank part plus a quantitatively bounded remainder. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (b : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) variable [Fintype (PhysicalSelectedData P ell C)] end Physical end Bounty end section /- The original memory-walk coefficient times its capped residue history, summed over selected data, is the original physical moment with its exact initial mass. Zero rows and the original coefficient are retained. -/ open Finset Classical namespace Bounty end Bounty end section /- A fixed step sequence uses its own local coefficients directly: the coarse selected scalar and actual residue history sum to the original moment. -/ open Finset Classical namespace Bounty end Bounty end section /- The full selected-data weight can retain the small residue factor. Its actual capped history is encoded without assuming local factorization. -/ open Finset Classical namespace Bounty end Bounty end section /- The original root small weight uses the cumulative sum of the selected big edge displacements, with no residual reference to reconstructed paths. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) theorem physical_root_numbered_plan_offset_cumulative (d : PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val)) : physicalRootNumberedPlanOffset groups e patterns C hC k p d = physicalSelectedCumulativeOffset (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k p) d := by funext j induction j using Fin.induction with | zero => rw [physicalSelectedCumulativeOffset, Fin.partialSum_zero] exact physical_path_selected_offset_zero C k _ _ | succ j ih => rw [physical_root_numbered_plan_offset_step, ih, physicalSelectedCumulativeOffset, Fin.partialSum_succ] theorem physical_root_numbered_small_weight_cumulative [∀ z : PhysicalPrime P, NeZero z.2.val] (V : Fin N → ℝ) {q : ℝ} (hq : 0 ≤ q) (r : PhysicalGroupResidues P groupsᶜ) (d : PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val)) : physicalRootPlanSmallWeight groups patterns C hC V q k r p ((physicalSelectedGroupReindex e (fun g => P g.val) (fun j (g : {g // g ∉ groupsᶜ}) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val)).symm d) = physicalSelectedSmallWeight (fun j (g : ↥groupsᶜ) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) (fun g => V g.val) q (physicalGroupResidueVector r) (physicalSelectedCumulativeOffset (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k p) d) (physicalRootSmallPlanSmallData groups patterns C hC p) := by rw [physical_root_small_weight_selected groups patterns C hC V hq k r p] change physicalSelectedSmallWeight _ _ _ _ (physicalRootNumberedPlanOffset groups e patterns C hC k p d) _ = _ rw [physical_root_numbered_plan_offset_cumulative] end Root end Bounty end section /- The selected small edge factor as a deterministic residue phase on the original full chronological events. -/ open scoped Classical namespace Bounty section Local variable {S : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) noncomputable def physicalSelectedSmallLocalUpdate (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : PhysicalResidues Ps := physicalTranslateResidues r (physicalLocalDisplacement C k cut tag s e) variable (Cs : Fin n → S → Finset (Fin J)) (Vs : S → ℝ) (q : ℝ) (ds : PhysicalGroupSelectedData Ps ell Cs) noncomputable def physicalSelectedSmallLocalPhase (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : ℂ := match tag with | none => (Nat.card (PhysicalPermutations S J ell) : ℂ)⁻¹ | some (.inl _) => 1 | some (.inr j) => physicalBarePatternScalar Vs (Cs j) 0 (fun _ _ _ => 1) (ds.1 j) (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc)) (physicalPermuteLabels (ds.2.2.2 j) (ds.2.1 j.succ)) * ((physicalResidueVertexWeight (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc)) (Real.sqrt q) r * physicalResidueVertexWeight (physicalPermuteLabels (ds.2.2.2 j) (ds.2.1 j.succ)) (Real.sqrt q) (physicalSelectedSmallLocalUpdate C k cut (some (.inr j)) r s e) : ℝ) : ℂ) theorem physical_selected_small_local_phase_visit (j : Fin (n + 1)) (tag : Option (Fin (n + 1) ⊕ Fin n)) (htag : tag = some (.inl j)) (r : PhysicalResidues Ps) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : physicalSelectedSmallLocalPhase C k cut Cs Vs q ds tag r s e = 1 := by subst tag rfl theorem physical_selected_small_local_phase_permutation (tag : Option (Fin (n + 1) ⊕ Fin n)) (htag : tag = none) (r : PhysicalResidues Ps) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : physicalSelectedSmallLocalPhase C k cut Cs Vs q ds tag r s e = (Nat.card (PhysicalPermutations S J ell) : ℂ)⁻¹ := by subst tag rfl theorem physical_selected_small_local_phase_edge (j : Fin n) (tag : Option (Fin (n + 1) ⊕ Fin n)) (htag : tag = some (.inr j)) (r : PhysicalResidues Ps) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : physicalSelectedSmallLocalPhase C k cut Cs Vs q ds tag r s e = physicalBarePatternScalar Vs (Cs j) 0 (fun _ _ _ => 1) (ds.1 j) (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc)) (physicalPermuteLabels (ds.2.2.2 j) (ds.2.1 j.succ)) * ((physicalResidueVertexWeight (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc)) (Real.sqrt q) r * physicalResidueVertexWeight (physicalPermuteLabels (ds.2.2.2 j) (ds.2.1 j.succ)) (Real.sqrt q) (physicalSelectedSmallLocalUpdate C k cut tag r s e) : ℝ) : ℂ) := by subst tag rfl end Local end Bounty end section /- The original prime discrepancy coefficients give decay for the literal rational box. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- The original rough discrepancy coefficients give decay for the literal rational box. -/ open Finset Filter MeasureTheory namespace Bounty end Bounty end section /- The original prime discrepancy coefficients give decay for the normalized cutoff rational box. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_rational_prime_cutoff_integral_precision (hZ : PrimitiveZeroFreeHalfPlane) {c q cLog d A aLong : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → (∀ p ∈ s, ∀ z ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), ∀ m ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), ∀ n ∈ F, Y/128 ≤ ((p*z*m*n : ℕ) : ℝ) ∧ ((p*z*m*n : ℕ) : ℝ) ≤ 64*Real.exp 2*Y) → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat s (roughBand Alo Blo (Real.exp (Real.sqrt L))) ((Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0)) F (fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p)) (fun n => typeIIPhase σ n*χQ (n : ZMod qQ)) (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n) (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n)) (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hres⟩ := exists_candidate_selected_residual_power_bound hc hq0 hq1 T obtain ⟨Bcoeff,hBcoeff,hsmall⟩ := exists_candidate_small_prime_factor_data hc obtain ⟨_,_,hmain⟩ := exists_rational_shifted_filtered_prime_integral_precision_log_radius (A := A+3*Rmod+1) hZ hc hq0 hq1 hcLog hd haLong T Tmod Sshift Cmod Sfreq Rmod (max W 1+1) refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,hres,hsmall, eventually_rational_candidate_P_properties hc Rmod, eventually_rational_rough_Q_properties Rmod, eventually_rational_prime_M_properties S Rmod (hS₀.trans hS), eventually_rational_normalized_full_box_precision (E := C+B+1) (by norm_num : (0 : ℝ) < 1) hcLog (A+3*Rmod), eventually_harmonic_mellin_frequency_bound W 1, eventually_ge_atTop (max 1 Bcoeff)] with L hdecay hresL hsmallL hP hQ hM hcut hfreq hLbound have hL1 : 1 ≤ L := (le_max_left _ _).trans hLbound have hL : 0 < L := zero_lt_one.trans_le hL1 have hBL : Bcoeff ≤ L := (le_max_right _ _).trans hLbound intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog hgeom qRat hqRat0 hqRat aRat w hw let δ : ℕ → ℂ := fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p) let α : ℕ → ℂ := fun n => typeIIPhase σ n*χQ (n : ZMod qQ) let β : ℕ → ℂ := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n let γ := candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n) have hp := hP g (Finset.mem_union_left _ hg) qRat hqRat0 hqRat have hq := hQ Alo Blo qRat hqRat0 hqRat have hm := hM κM hκM hκmax lo hi qRat hqRat0 hqRat have hFpos : ∀ n ∈ F, 0 < n := by intro n hn have hnR : (0 : ℝ) < n := zero_lt_one.trans_le (hUT.trans (hFband n hn).1) exact_mod_cast hnR have hδ : ∀ p ∈ s, ‖δ p‖ ≤ Bcoeff := by obtain ⟨_,_,_,hcoeff⟩ := hsmallL g hg s P hs hne hsp intro p hp' exact hcoeff (fun n => χP (n : ZMod qP)*typeIIPhase τP n) (fun n _ => character_typeIIPhase_norm_le χP τP n) ⟨p,hp'⟩ have hα : ∀ n, ‖α n‖ ≤ 1 := by intro n simpa only [α,mul_comm] using character_typeIIPhase_norm_le χQ σ n have hβ : ∀ n, ‖β n‖ ≤ 1 := by intro n dsimp only [β] rw [mul_assoc,norm_mul] exact (mul_le_mul (hm.1 n) (character_typeIIPhase_norm_le χM ν n) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1) have hγ : ∀ n, ‖γ n‖ ≤ L^(C+B) := hresL B r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n) ht hb hκ (character_typeIIPhase_norm_le χT τT) have hprod : Bcoeff*1*1*L^(C+B) ≤ L^(C+B+1) := by calc _ ≤ L*L^(C+B) := by simpa only [mul_one] using mul_le_mul_of_nonneg_right hBL (Real.rpow_nonneg hL.le (C+B)) _ = _ := by rw [Real.rpow_add hL (C+B) 1, Real.rpow_one]; ring have hRL : R ≤ L*Y := hRY.trans (le_mul_of_one_le_left (zero_le_one.trans hY) hL1) have hbox := hcut qRat hqRat0 aRat Y hY hYhi s (roughBand Alo Blo (Real.exp (Real.sqrt L))) ((Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0)) F δ α β γ Bcoeff 1 1 (L^(C+B)) (zero_le_one.trans hBcoeff) zero_le_one zero_le_one (Real.rpow_nonneg hL.le _) hprod (fun p hp' => (hp p (hs hp')).1.pos) (fun n hn => (hq n hn).1) (fun n hn => (hm.2 n hn).1) hFpos (fun p hp' => (hp p (hs hp')).2) (fun n hn => (hq n hn).2) (fun n hn => (hm.2 n hn).2) hδ (fun n _ => hα n) (fun n _ => hβ n) (fun n _ => hγ n) hgeom R w hR hRL (by intro dRat hdRat ψ u hu have hw' : |w+2*Real.pi*u| ≤ L^(max W 1+1) := by have hh := hfreq w 0 u hw (by simpa only [abs_zero] using Real.rpow_nonneg hL.le W) (by simpa only [Real.norm_eq_abs] using hu) simpa only [add_zero,abs_neg] using hh have hb' := @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 (Nat.pos_of_mem_divisors hdRat) (Nat.dvd_of_mem_divisors hdRat) hqRat ψ (w+2*Real.pi*u) hw' simpa only [δ,α,β,γ,rational_normalized_phase_twist,rational_phase_left_twist, rational_weighted_phase_twist,candidate_selected_rational_multiplier,add_assoc] using hb') exact hbox.trans (rational_box_cubic_cost hL hqRat) end Bounty end section /- The original rough discrepancy coefficients give decay for the normalized rational cutoff box. -/ open Finset Filter MeasureTheory namespace Bounty theorem exists_rational_rough_cutoff_integral_precision (hZ : PrimitiveZeroFreeHalfPlane) {c q cLog d A aLong γrough vMax ρ : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (hγ : 0 < γrough) (hv : vMax < 1) (hρ : 0 < ρ) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → (∀ p ∈ s, ∀ nQ ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), ∀ nM ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), ∀ nT ∈ F, Y/128 ≤ ((p*nQ*nM*nT : ℕ) : ℝ) ∧ ((p*nQ*nM*nT : ℕ) : ℝ) ≤ 64*Real.exp 2*Y) → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat s (roughBand Alo Blo (Real.exp (Real.sqrt L))) ((Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0)) F (fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p)) (fun n => typeIIPhase σ n*χQ (n : ZMod qQ)) (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n) (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n)) (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hmain⟩ := exists_rational_shifted_filtered_rough_integral_precision_log_radius (A := A+3*Rmod+1) hZ hc hq0 hq1 hcLog hd haLong hγ hv T Tmod Sshift Cmod Sfreq Rmod (max W ρ+1) obtain ⟨Cres,_,hres⟩ := exists_candidate_selected_residual_power_bound hc hq0 hq1 T obtain ⟨vpool,_,hvpool,_,hpool⟩ := exists_candidate_P_pool_bounds hc refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS, eventually_rational_candidate_P_properties hc Rmod, eventually_rational_rough_Q_properties Rmod, eventually_rational_rough_M_properties hγ Rmod, hres, hpool, eventually_ge_atTop (1/vpool), eventually_ge_atTop (1 : ℝ), eventually_harmonic_mellin_frequency_bound W ρ, eventually_rational_normalized_full_box_precision (E := Cres+B+1) hρ hcLog (A+3*Rmod)] with L hdecay hP hQ hM hres hpool hpoolInv hL1 hfreq hcutoff have hL : 0 < L := zero_lt_one.trans_le hL1 intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog hgeom qRat hqRat0 hqRat aRat w hw let δ : ℕ → ℂ := fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p) let α : ℕ → ℂ := fun n => typeIIPhase σ n*χQ (n : ZMod qQ) let β : ℕ → ℂ := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n let γ := candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n) have hp := hP g (Finset.mem_union_left _ hg) qRat hqRat0 hqRat have hq := hQ Alo Blo qRat hqRat0 hqRat have hm := hM S aM v lo hi qRat hqRat0 hqRat have hFpos : ∀ n ∈ F, 0 < n := by intro n hn have hnR : (0 : ℝ) < n := zero_lt_one.trans_le (hUT.trans (hFband n hn).1) exact_mod_cast hnR have hδ : ∀ n, ‖δ n‖ ≤ L := by intro n have hvM := (hpool.2.2.2.2.2 g (Finset.mem_union_left _ hg)).1 have hmass : 0 < ∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ) := hvpool.trans_le hvM calc ‖δ n‖ ≤ ‖(1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))‖*1 := by dsimp only [δ] rw [norm_mul] exact mul_le_mul_of_nonneg_left (character_typeIIPhase_norm_le χP τP n) (norm_nonneg _) _ = 1/(∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) := by simp only [norm_div,norm_one,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hmass,mul_one] _ ≤ 1/vpool := one_div_le_one_div_of_le hvpool hvM _ ≤ L := hpoolInv have hα : ∀ n, ‖α n‖ ≤ 1 := by intro n simpa only [α,norm_mul,typeIIPhase_norm,one_mul] using χQ.norm_le_one (n : ZMod qQ) have hβ : ∀ n, ‖β n‖ ≤ 1 := by intro n simpa only [β,norm_mul,typeIIPhase_norm,mul_one,one_mul] using mul_le_mul (hm.1 n) (χM.norm_le_one (n : ZMod qM)) (norm_nonneg _) zero_le_one have hγcap : ∀ n, ‖γ n‖ ≤ L^(Cres+B) := hres B r jStar hr hj take hkeep ξ tmarks umarks big b κ _ ht hb hκ (fun n => character_typeIIPhase_norm_le χT τT n) have hcap : L*1*1*L^(Cres+B) ≤ L^(Cres+B+1) := by rw [mul_one,mul_one,Real.rpow_add hL (Cres+B) 1,Real.rpow_one] exact le_of_eq (mul_comm _ _) have hbox := hcutoff qRat hqRat0 aRat Y hY hYhi s (roughBand Alo Blo (Real.exp (Real.sqrt L))) ((Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0)) F δ α β γ L 1 1 (L^(Cres+B)) hL.le zero_le_one zero_le_one (Real.rpow_nonneg hL.le _) hcap (fun p hp' => (hp p (hs hp')).1.pos) (fun n hn => (hq n hn).1) (fun n hn => (hm.2 n hn).1) hFpos (fun p hp' => (hp p (hs hp')).2) (fun n hn => (hq n hn).2) (fun n hn => (hm.2 n hn).2) (fun n _ => hδ n) (fun n _ => hα n) (fun n _ => hβ n) (fun n _ => hγcap n) hgeom R w hR (hRY.trans (le_mul_of_one_le_left (zero_le_one.trans hY) hL1)) (by intro dRat hdRat ψ u hu have hshift : |w+2*Real.pi*u| ≤ L^(max W ρ+1) := by have hf := hfreq w 0 u hw (by simpa using Real.rpow_nonneg hL.le W) (by simpa only [Real.norm_eq_abs] using hu) simpa only [add_zero,abs_neg] using hf have henergy := @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 (Nat.pos_of_mem_divisors hdRat) (Nat.dvd_of_mem_divisors hdRat) hqRat ψ (w+2*Real.pi*u) hshift simpa only [δ,α,β,γ,rational_normalized_phase_twist,rational_phase_left_twist, rational_weighted_phase_twist,candidate_selected_rational_multiplier,add_assoc] using henergy) exact hbox.trans (rational_box_cubic_cost hL hqRat) end Bounty end section /- At the original empty-memory root, disjoint physical pools supply the prime encoding and all coverage hypotheses. -/ open Finset Classical namespace Bounty section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : ↥(P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (b : (g : Fin N) → ↥(P g) → ℝ) (q : Fin (n + 1) → ℝ) (ρ v vmin : ℝ) (V η : Fin N → ℝ) (β : ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (ζ : Fin n → ℝ) (K : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) variable [Fintype (PhysicalSelectedData P ell C)] end Physical end Bounty end section /- The actual residue history sum has the common-forest expansion at the original empty-memory root, with its initial mass and original coefficient. -/ open Finset Classical namespace Bounty end Bounty end section /- The original fixed-plan big capped history, with its original offsets and effective multipliers, is the true selected moment for any local coefficient. -/ open Finset Classical namespace Bounty end Bounty end section /- The original fixed-plan big capped history retains arbitrary full selected weights, including the path-dependent small residue factor, in its record action. -/ open Finset Classical namespace Bounty end Bounty end section /- An arbitrary path-dependent weight stays inside the exact conversion from the full selected memory product to the recorded operator action. -/ open Finset Classical namespace Bounty end Bounty end section /- The literal original root small weight is recovered from chronological big displacements, including all zero-weight original paths. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Root end Bounty end section /- The small factor recovered from the record is exactly the deterministic residue phase along the original four-step event schedule. -/ open Finset open scoped Classical namespace Bounty section Ledger variable {S : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) (Cs : Fin n → S → Finset (Fin J)) (Vs : S → ℝ) (q : ℝ) (ds : PhysicalGroupSelectedData Ps ell Cs) theorem physical_record_small_ledger (r : PhysicalResidues Ps) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (p : FiniteEventPath (fun i => PhysicalFullLedgerEvent C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (List.range (4 * n + 1)) s) : let E := fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let target := fun i => physicalFullLedgerEventTarget (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let record := finiteEventPathObservations E target (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (List.range (4 * n + 1)) s p deterministicLedgerPhase E target (fun i => physicalSelectedSmallLocalUpdate C k cut (physicalSelectedFineTag n i)) (fun i => physicalSelectedSmallLocalPhase C k cut Cs Vs q ds (physicalSelectedFineTag n i)) (List.range (4 * n + 1)) r s p = physicalSelectedSmallWeight Cs Vs q r (Fin.partialSum (physicalRecordDisplacement C k cut record)) ds := by dsimp only let E := fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let target := fun i => physicalFullLedgerEventTarget (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) let occ := finiteScheduleOccurrence E target (4 * n + 1) s p let record := finiteEventPathObservations E target (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (List.range (4 * n + 1)) s p let d := physicalRecordDisplacement C k cut record let a := Fin.partialSum d let l : Fin (4 * n + 2) → PhysicalResidues Ps := fun i => physicalTranslateResidues r (a (fourStepVertex n i)) have hs (i : Fin (4 * n + 1)) : physicalSelectedSmallLocalUpdate C k cut (physicalSelectedFineTag n i.val) (l i.castSucc) (occ i).1 (occ i).2 = l i.succ := by dsimp only [physicalSelectedSmallLocalUpdate, l] rw [physical_translate_residues_add] by_cases hi : i.val % 4 = 2 · let j : Fin n := ⟨i.val / 4, by have := i.isLt; omega⟩ have he : i = (⟨4 * j.val + 2, by have := j.isLt; omega⟩ : Fin (4 * n + 1)) := by apply Fin.ext dsimp only [j] omega rw [he] have hd := physical_record_displacement_local C k cut s p j change d j = physicalLocalDisplacement C k cut (physicalSelectedFineTag n (4 * j.val + 2)) (occ ⟨4 * j.val + 2, by have := j.isLt; omega⟩).1 (occ ⟨4 * j.val + 2, by have := j.isLt; omega⟩).2 at hd rw [← hd] change physicalTranslateResidues r (a (fourStepVertex n ⟨4 * j.val + 2, _⟩) + d j) = physicalTranslateResidues r (a (fourStepVertex n ⟨4 * j.val + 3, _⟩)) rw [four_step_vertex_edge_before, four_step_vertex_edge_after] exact congrArg (physicalTranslateResidues r) (Fin.partialSum_succ d j).symm · rw [physical_local_displacement_nonedge C k cut i.val hi, add_zero, four_step_vertex_nonedge n i hi] have hzero : l 0 = r := by dsimp only [l] rw [four_step_vertex_zero] exact (congrArg (physicalTranslateResidues r) (Fin.partialSum_zero d)).trans (physical_translate_residues_zero r) have hp := deterministic_ledger_schedule_product E target (fun i => physicalSelectedSmallLocalUpdate C k cut (physicalSelectedFineTag n i)) (fun i => physicalSelectedSmallLocalPhase C k cut Cs Vs q ds (physicalSelectedFineTag n i)) (4 * n + 1) s p l hs rw [hzero] at hp rw [hp] let f : Fin (4 * n + 1) → ℂ := fun i => physicalSelectedSmallLocalPhase C k cut Cs Vs q ds (physicalSelectedFineTag n i.val) (l i.castSucc) (occ i).1 (occ i).2 have hv (j : Fin (n + 1)) : f ⟨4 * j.val, Nat.lt_succ_of_le (Nat.mul_le_mul_left 4 (Nat.le_of_lt_succ j.isLt))⟩ = 1 := by dsimp only [f] exact physical_selected_small_local_phase_visit C k cut Cs Vs q ds j _ (physical_fine_tag_visit j) _ _ _ have hl (j : Fin n) : f ⟨4 * j.val + 1, by have := j.isLt; omega⟩ = (Nat.card (PhysicalPermutations S J ell) : ℂ)⁻¹ := by dsimp only [f] exact physical_selected_small_local_phase_permutation C k cut Cs Vs q ds _ (physical_fine_tag_source_permutation j) _ _ _ have hr (j : Fin n) : f ⟨4 * j.val + 3, by have := j.isLt; omega⟩ = (Nat.card (PhysicalPermutations S J ell) : ℂ)⁻¹ := by dsimp only [f] exact physical_selected_small_local_phase_permutation C k cut Cs Vs q ds _ (physical_fine_tag_target_permutation j) _ _ _ change (∏ i, f i) = _ rw [four_step_normalized_product n _ f hv hl hr] unfold physicalSelectedSmallWeight apply prod_congr rfl intro j _ dsimp only [f] rw [physical_selected_small_local_phase_edge C k cut Cs Vs q ds j _ (physical_fine_tag_edge j)] rw [hs ⟨4 * j.val + 2, by have := j.isLt; omega⟩] have hb : l (⟨4 * j.val + 2, by have := j.isLt; omega⟩ : Fin (4 * n + 1)).castSucc = physicalTranslateResidues r (a j.castSucc) := by dsimp only [l] change physicalTranslateResidues r (a (fourStepVertex n ⟨4 * j.val + 2, _⟩)) = _ rw [four_step_vertex_edge_before] have ha : l (⟨4 * j.val + 2, by have := j.isLt; omega⟩ : Fin (4 * n + 1)).succ = physicalTranslateResidues r (a j.succ) := by dsimp only [l] change physicalTranslateResidues r (a (fourStepVertex n ⟨4 * j.val + 3, _⟩)) = _ rw [four_step_vertex_edge_after] rw [hb, ha] ring end Ledger end Bounty end section /- The complete original root integrand, including its path-dependent small vertex weight and its original Fourier coefficient, enters the record action. -/ open Finset Classical namespace Bounty section Numbered variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) noncomputable def physicalRootNumberedCompleteWeight (d : PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val)) : ℂ := physicalRootPlanSmallWeight groups patterns C hC V q k r p ((physicalSelectedGroupReindex e (fun g => P g.val) (fun j (g : {g // g ∉ groupsᶜ}) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val)).symm d) * physicalSelectedCoefficient (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val) (fun _ => 0) (fun j => physicalGroupReindexedCoefficient e (fun g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) (physicalRootPlanBigCoefficient groups patterns C hC ζ k K θ p j)) d end Numbered end Bounty end section /- The chronological small residue phase is a phase on the original full path. Bookkeeping-ledger removal preserves its entire displacement history. -/ open scoped Classical namespace Bounty section Original variable {S : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) (Cs : Fin n → S → Finset (Fin J)) (Vs : S → ℝ) (q : ℝ) (ds : PhysicalGroupSelectedData Ps ell Cs) noncomputable def physicalFullSmallUpdate (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent C k tag (fullActiveInitialLedger x, x)) : PhysicalResidues Ps := physicalSelectedSmallLocalUpdate C k cut tag r (fullActiveInitialLedger x, x) e noncomputable def physicalFullSmallPhase (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent C k tag (fullActiveInitialLedger x, x)) : ℂ := physicalSelectedSmallLocalPhase C k cut Cs Vs q ds tag r (fullActiveInitialLedger x, x) e omit [Fintype S] in theorem physical_small_update_forgets_ledger (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : physicalSelectedSmallLocalUpdate C k cut tag r s e = physicalFullSmallUpdate C k cut tag r s.2 e := by cases tag with | none => rfl | some tag => cases tag <;> rfl theorem physical_small_phase_forgets_ledger (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (e : PhysicalFullLedgerEvent C k tag s) : physicalSelectedSmallLocalPhase C k cut Cs Vs q ds tag r s e = physicalFullSmallPhase C k cut Cs Vs q ds tag r s.2 e := by cases tag with | none => rfl | some tag => cases tag <;> rfl theorem physical_original_small_ledger (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : deterministicLedgerPhase (FullPermutationMixedEvent (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (physicalFullSmallUpdate C k cut) (physicalFullSmallPhase C k cut Cs Vs q ds) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) r x p = physicalSelectedSmallWeight Cs Vs q r (Fin.partialSum (physicalRecordDisplacement C k cut (physicalOriginalFineRecord C k cut x p))) ds := by let E := FullPermutationMixedEvent (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let target := fullPermutationMixedEventTarget (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let history := fullMixedLedgerUpdate (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let steps := (List.range (4 * n + 1)).map (physicalSelectedFineTag n) let lift := (finiteLedgerEventPathEquiv E target history steps (fullActiveInitialLedger x) x).symm p let pos := (finiteEventPathMapEquiv (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalSelectedFineTag n) (List.range (4 * n + 1)) (fullActiveInitialLedger x, x)).symm lift have hpos := physical_record_small_ledger C k cut Cs Vs q ds r (fullActiveInitialLedger x, x) pos dsimp only at hpos have hu (tag) : physicalSelectedSmallLocalUpdate (P := P) (ell := ell) (Ps := Ps) (B := B) C k cut tag = (fun r s e => physicalFullSmallUpdate C k cut tag r s.2 e) := by funext r s e exact physical_small_update_forgets_ledger C k cut tag r s e have hφ (tag) : physicalSelectedSmallLocalPhase (P := P) (B := B) C k cut Cs Vs q ds tag = (fun r s e => physicalFullSmallPhase C k cut Cs Vs q ds tag r s.2 e) := by funext r s e exact physical_small_phase_forgets_ledger C k cut Cs Vs q ds tag r s e simp_rw [hu, hφ] at hpos have hmap := deterministic_ledger_phase_map (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (fun tag r s e => physicalFullSmallUpdate C k cut tag r s.2 e) (fun tag r s e => physicalFullSmallPhase C k cut Cs Vs q ds tag r s.2 e) (physicalSelectedFineTag n) (List.range (4 * n + 1)) r (fullActiveInitialLedger x, x) pos have hforget := deterministic_ledger_phase_forget E target history (physicalFullSmallUpdate C k cut) (physicalFullSmallPhase C k cut Cs Vs q ds) steps (fullActiveInitialLedger x) r x lift simp only [pos] at hmap erw [Equiv.apply_symm_apply] at hmap simp only [lift, Equiv.apply_symm_apply] at hforget exact hforget.symm.trans (hmap.symm.trans hpos) end Original end Bounty end section /- The original unnumbered fixed-plan root sum is exactly its recorded action. -/ open Finset Classical namespace Bounty section Numbered variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Numbered end Bounty end section /- The selected small factor is a deterministic small phase on the original full path, weighted by the original signed fine-path weight. -/ open scoped Classical namespace Bounty section Weighted variable {S : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) (Cs : Fin n → S → Finset (Fin J)) (Vs : S → ℝ) (q : ℝ) (ds : PhysicalGroupSelectedData Ps ell Cs) end Weighted end Bounty end section /- The literal original root small weight is the deterministic small residue phase on the original full path, including zero-weight paths. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Root end Bounty end section /- On supported original states, the decoded small displacement agrees with the raw full-edge divisor used by the mixed-word small residue phase. -/ open scoped Classical namespace Bounty section Raw variable {S : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) noncomputable def physicalFullSmallRawUpdate (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent C k tag (fullActiveInitialLedger x, x)) : PhysicalResidues Ps := match tag with | none => r | some (.inl _) => r | some (.inr j) => physicalTranslateResidues r (k j * (physicalFullSharedD (C j) (productActiveMemorySplit (fun g => physicalFullSharedIndices (C j g)) B x).1 e.1 : ℤ)) variable (Cs : Fin n → S → Finset (Fin J)) (Vs : S → ℝ) (q : ℝ) (ds : PhysicalGroupSelectedData Ps ell Cs) noncomputable def physicalFullSmallRawPhase (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent C k tag (fullActiveInitialLedger x, x)) : ℂ := match tag with | none => (Nat.card (PhysicalPermutations S J ell) : ℂ)⁻¹ | some (.inl _) => 1 | some (.inr j) => physicalBarePatternScalar Vs (Cs j) 0 (fun _ _ _ => 1) (ds.1 j) (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc)) (physicalPermuteLabels (ds.2.2.2 j) (ds.2.1 j.succ)) * ((physicalResidueVertexWeight (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc)) (Real.sqrt q) r * physicalResidueVertexWeight (physicalPermuteLabels (ds.2.2.2 j) (ds.2.1 j.succ)) (Real.sqrt q) (physicalFullSmallRawUpdate C k (some (.inr j)) r x e) : ℝ) : ℂ) variable (cut : ℕ → Fin N → Finset (Fin J)) (hcut : ∀ j : Fin n, cut (4 * j.val + 2) = C j) include hcut omit [Fintype S] in theorem physical_full_small_update_raw (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (hx : FullActiveInjective x) (e : PhysicalFullLedgerEvent C k tag (fullActiveInitialLedger x, x)) : physicalFullSmallUpdate C k cut tag r x e = physicalFullSmallRawUpdate C k tag r x e := by cases tag with | none => exact physical_translate_residues_zero r | some tag => cases tag with | inl j => exact physical_translate_residues_zero r | inr j => dsimp only [physicalFullSmallUpdate, physicalSelectedSmallLocalUpdate, physicalLocalDisplacement, physicalFullSmallRawUpdate] rw [physical_active_displacement_full_divisor C k cut j (hcut j) x hx] theorem physical_full_small_phase_raw (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (hx : FullActiveInjective x) (e : PhysicalFullLedgerEvent C k tag (fullActiveInitialLedger x, x)) : physicalFullSmallPhase C k cut Cs Vs q ds tag r x e = physicalFullSmallRawPhase C k Cs Vs q ds tag r x e := by cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => have h := physical_full_small_update_raw C k cut hcut (some (.inr j)) r x hx e dsimp only [physicalFullSmallUpdate] at h dsimp only [physicalFullSmallPhase, physicalSelectedSmallLocalPhase, physicalFullSmallRawPhase] rw [h] theorem physical_small_ledger_raw_on_support (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ks : List (Option (Fin (n + 1) ⊕ Fin n))) (r : PhysicalResidues Ps) (s : FullMixedLedgerState (fun g (p : ↥(P g)) => p.val) (M := fun _ => J + ell) B) (p : FiniteEventPath (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) ks s) (hs : FullActiveInjective s.2) (hp : finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventPhase C k ω β ρ V) ks s p ≠ 0) : deterministicLedgerPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (fun tag r s e => physicalFullSmallUpdate C k cut tag r s.2 e) (fun tag r s e => physicalFullSmallPhase C k cut Cs Vs q ds tag r s.2 e) ks r s p = deterministicLedgerPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (fun tag r s e => physicalFullSmallRawUpdate C k tag r s.2 e) (fun tag r s e => physicalFullSmallRawPhase C k Cs Vs q ds tag r s.2 e) ks r s p := by exact deterministic_ledger_phase_eq_on_support _ _ (physicalFullLedgerEventPhase C k ω β ρ V) (fun s => FullActiveInjective s.2) (fun tag s e hs hp => physical_local_phase_target_injective C k ω β ρ V tag s e hs hp) _ _ (fun tag r s e hs _ => physical_full_small_update_raw C k cut hcut tag r s.2 hs e) _ _ (fun tag r s e hs _ => physical_full_small_phase_raw C k Cs Vs q ds cut hcut tag r s.2 hs e) ks r s p hs hp end Raw end Bounty end section /- The raw divisor and decoded small phases agree after multiplication by the original signed weight, including every zero-weight path. -/ open scoped Classical namespace Bounty section Weighted variable {S : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (Cs : Fin n → S → Finset (Fin J)) (Vs : S → ℝ) (q : ℝ) (ds : PhysicalGroupSelectedData Ps ell Cs) (cut : ℕ → Fin N → Finset (Fin J)) (hcut : ∀ j : Fin n, cut (4 * j.val + 2) = C j) end Weighted end Bounty end section /- The selected small endpoints decorate the original fine edge keys. The effective planned phase retains the original raw small residue update. -/ open scoped Classical namespace Bounty section Keys variable {S I : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : Fin n → I → ℤ) (i : Fin n → I) {Cs : Fin n → S → Finset (Fin J)} (ds : PhysicalGroupSelectedData Ps ell Cs) def physicalSelectedPlannedKey (j : Fin n) : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) := (j, i j, physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc), physicalPermuteLabels (ds.2.2.2 j) (ds.2.1 j.succ)) noncomputable def physicalSelectedPlannedMultiplier (j : Fin n) : ℤ := k j (i j) * (physicalSharedProduct (physicalSharedPrefix (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc))) : ℕ) noncomputable def physicalSelectedPlannedEventEquiv (tag : Option (Fin (n + 1) ⊕ Fin n)) (x : PhysicalFullBoundedState P J ell B) := fullPermutationKeyEventEquiv (fun g (p : P g) => p.val) (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) => fun g => physicalFullSharedIndices (ell := ell) (C key.2.1 g)) B (fun key _ => PhysicalAuxLabels P (C key.2.1)) (fun key => physicalFullEdgeDelta (C key.2.1) (k key.1 key.2.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ))) (fun key => physicalFullEdgeD (C key.2.1)) (physicalSelectedPlannedKey i ds) tag x theorem physical_selected_planned_update (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) tag (fullActiveInitialLedger x, x)) : physicalPlannedSmallUpdate (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) (tag.map (Sum.map id (physicalSelectedPlannedKey i ds))) r x (physicalSelectedPlannedEventEquiv C k i ds tag x e) = physicalFullSmallRawUpdate (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) tag r x e := by cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => change physicalTranslateResidues r (k j (i j) * (physicalFullSharedD (C (i j)) (productActiveMemorySplit (fun g => physicalFullSharedIndices (C (i j) g)) B x).1 e.1 : ℤ) * (physicalSharedProduct (physicalSharedPrefix (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc))) : ℕ)) = physicalTranslateResidues r (k j (i j) * (physicalSharedProduct (physicalSharedPrefix (physicalPermuteLabels (ds.2.2.1 j) (ds.2.1 j.castSucc))) : ℕ) * (physicalFullSharedD (C (i j)) (productActiveMemorySplit (fun g => physicalFullSharedIndices (C (i j) g)) B x).1 e.1 : ℤ)) congr 1 ring end Keys end Bounty end section /- The original fixed-plan root sum is exactly its full-path moment with complete selected weight. -/ open Finset Classical namespace Bounty section Numbered variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Numbered end Bounty end section /- The original fine path is transported to its decorated effective path with the exact small phase. -/ open scoped Classical namespace Bounty section Paths variable {S I : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : Fin n → I → ℤ) (i : Fin n → I) {Cs : Fin n → S → Finset (Fin J)} (ds : PhysicalGroupSelectedData Ps ell Cs) noncomputable def physicalSelectedPlannedPathEquiv (steps : List (Option (Fin (n + 1) ⊕ Fin n))) (x : PhysicalFullBoundedState P J ell B) := fullPermutationKeyPathEquiv (fun g (p : P g) => p.val) (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) => fun g => physicalFullSharedIndices (ell := ell) (C key.2.1 g)) B (fun key _ => PhysicalAuxLabels P (C key.2.1)) (fun key => physicalFullEdgeDelta (C key.2.1) (k key.1 key.2.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ))) (fun key => physicalFullEdgeD (C key.2.1)) (physicalSelectedPlannedKey i ds) steps x theorem physical_selected_planned_ledger_phase (hCs : ∀ j s, Cs j s = ∅) (Vs : S → ℝ) (q : ℝ) (steps : List (Option (Fin (n + 1) ⊕ Fin n))) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j))) steps x) : deterministicLedgerPhase (PhysicalPlannedResidueEvent (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i))) (physicalPlannedResidueTarget (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i))) (physicalPlannedSmallUpdate (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i))) (physicalPlannedSmallPhase (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) Vs (fun _ => q)) (steps.map (Option.map (Sum.map id (physicalSelectedPlannedKey i ds)))) r x (physicalSelectedPlannedPathEquiv C k i ds steps x p) = deterministicLedgerPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j)))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j)))) (physicalFullSmallRawUpdate (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds)) (physicalFullSmallRawPhase (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) Cs Vs q ds) steps r x p := by have h := full_permutation_key_ledger_phase (fun g (p : P g) => p.val) (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) => fun g => physicalFullSharedIndices (ell := ell) (C key.2.1 g)) B (fun key _ => PhysicalAuxLabels P (C key.2.1)) (fun key => physicalFullEdgeDelta (C key.2.1) (k key.1 key.2.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ))) (fun key => physicalFullEdgeD (C key.2.1)) (physicalSelectedPlannedKey i ds) (physicalPlannedSmallUpdate (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i))) (physicalPlannedSmallPhase (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) Vs (fun _ => q)) steps r x p change _ = deterministicLedgerPhase _ _ (fun tag r x e => physicalPlannedSmallUpdate (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) (tag.map (Sum.map id (physicalSelectedPlannedKey i ds))) r x (physicalSelectedPlannedEventEquiv C k i ds tag x e)) (fun tag r x e => physicalPlannedSmallPhase (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) Vs (fun _ => q) (tag.map (Sum.map id (physicalSelectedPlannedKey i ds))) r x (physicalSelectedPlannedEventEquiv C k i ds tag x e)) steps r x p at h have hu : (fun (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) tag (fullActiveInitialLedger x, x)) => physicalPlannedSmallUpdate (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) (tag.map (Sum.map id (physicalSelectedPlannedKey i ds))) r x (physicalSelectedPlannedEventEquiv C k i ds tag x e)) = physicalFullSmallRawUpdate (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) := by funext tag r x e exact physical_selected_planned_update C k i ds tag r x e have hφ : (fun (tag : Option (Fin (n + 1) ⊕ Fin n)) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) tag (fullActiveInitialLedger x, x)) => physicalPlannedSmallPhase (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) Vs (fun _ => q) (tag.map (Sum.map id (physicalSelectedPlannedKey i ds))) r x (physicalSelectedPlannedEventEquiv C k i ds tag x e)) = physicalFullSmallRawPhase (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) Cs Vs q ds := by funext tag r x e exact (by cases tag with | none => simp only [Option.map, physicalPlannedSmallPhase, physicalFullSmallRawPhase, Complex.ofReal_natCast, Nat.card_eq_fintype_card] | some tag => cases tag with | inl j => rfl | inr j => have hu := physical_selected_planned_update C k i ds (some (.inr j)) r x e dsimp only [physicalPlannedSmallPhase, Option.map, Sum.map, Sum.elim, Function.comp_apply, physicalSelectedPlannedKey, physicalFullSmallRawPhase] rw [physical_bare_neutral_empty_cut Vs (Cs j) (hCs j)] dsimp only [physicalSelectedPlannedKey, Option.map, Sum.map, Sum.elim, Function.comp_apply] at hu rw [hu] simp only [physicalCompletionMass, Finset.card_empty, Nat.add_zero] split_ifs <;> simp only [Complex.ofReal_mul, zero_mul] ) erw [hu, hφ] at h exact h end Paths end Bounty end section /- The decoded selected coordinates recover the original root plan and its effective multiplier. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) theorem physical_root_selected_small_plan : physicalSmallSelectedFinePlanEquiv (physicalRootSmallPlanPattern groups patterns C hC pl, (physicalRootSmallPlanSmallData groups patterns C hC pl).2.1, (physicalRootSmallPlanSmallData groups patterns C hC pl).2.2.1, (physicalRootSmallPlanSmallData groups patterns C hC pl).2.2.2) = pl := by exact (physicalSmallSelectedPlanEquiv (fun (i : patterns) (g : ↥groupsᶜ) => C i.val g.val) hC).apply_symm_apply pl end Root end Bounty end section /- The original root coefficient is a function of the actual decorated edge key, with both original local Fourier phases and the original auxiliary coefficient retained. -/ open scoped Classical namespace Bounty section Key variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) noncomputable def physicalRootKeyCoefficient (key : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) := physicalGroupReindexedCoefficient e (fun g => C key.2.1.val g.val) (physicalCoupledBigCoefficient (fun g => g ∈ groupsᶜ) (C key.2.1.val) (ζ (n - key.1.val) key.2.1.val) (physicalLocalFourierCoefficient C k K θ (n - key.1.val) key.2.1.val) key.2.2.1 key.2.2.2 (physicalEmptyAuxLabels (fun g : ↥groupsᶜ => C key.2.1.val g.val) (hC key.2.1))) theorem physical_root_key_coefficient (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (j : Fin (n + 1)) : physicalRootKeyCoefficient groups e patterns C hC ζ k K θ (physicalSelectedPlannedKey (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) j) = physicalGroupReindexedCoefficient e (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val g.val) (physicalRootPlanBigCoefficient groups patterns C hC ζ k K θ pl j) := by have ha : physicalEmptyAuxLabels (fun g : ↥groupsᶜ => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val g.val) (hC (physicalRootSmallPlanPattern groups patterns C hC pl j)) = (physicalRootSmallPlanSmallData groups patterns C hC pl).1 j := by funext g a exact False.elim (by simpa only [hC (physicalRootSmallPlanPattern groups patterns C hC pl j) g, Finset.notMem_empty] using a.property) dsimp only [physicalRootKeyCoefficient, physicalRootPlanBigCoefficient, physicalSelectedPlannedKey] rw [ha] rfl end Key end Bounty end section /- The selected full path is identified with the effective big path of its actual small plan. -/ open scoped Classical namespace Bounty section Effective variable {S I : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : Fin n → I → ℤ) (i : Fin n → I) {Cs : Fin n → S → Finset (Fin J)} (ds : PhysicalGroupSelectedData Ps ell Cs) def physicalSelectedSmallArrays : PhysicalSmallSelectedArrays Ps J ell n I := (i, ds.2.1, ds.2.2.1, ds.2.2.2) noncomputable def physicalSelectedEffectivePathEquiv (x : PhysicalFullBoundedState P J ell B) : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x ≃ PhysicalEffectivePlannedBigPath C k B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (physicalSmallSelectedFinePlanEquiv (physicalSelectedSmallArrays i ds)).1 (physicalSmallSelectedFinePlanEquiv (physicalSelectedSmallArrays i ds)).2 x := (physicalSelectedPlannedPathEquiv C k i ds ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x).trans (Equiv.cast (congrArg (fun steps => FullPermutationMixedPath (fun g (p : P g) => p.val) (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) => fun g => physicalFullSharedIndices (ell := ell) (C key.2.1 g)) B (fun key _ => PhysicalAuxLabels P (C key.2.1)) (fun key => physicalFullEdgeDelta (C key.2.1) (k key.1 key.2.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ))) (fun key => physicalFullEdgeD (C key.2.1)) steps x) (physical_small_selected_fine_big_steps (physicalSelectedSmallArrays i ds)).symm)) theorem physical_selected_effective_small_factor (hCs : ∀ j s, Cs j s = ∅) (Vs : S → ℝ) (q : ℝ) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : physicalEffectivePlanSmallFactor C k B Vs (fun _ => q) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) r (physicalSmallSelectedFinePlanEquiv (physicalSelectedSmallArrays i ds)).1 (physicalSmallSelectedFinePlanEquiv (physicalSelectedSmallArrays i ds)).2 x (physicalSelectedEffectivePathEquiv C k i ds x p) = deterministicLedgerPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j)))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j)))) (physicalFullSmallRawUpdate (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds)) (physicalFullSmallRawPhase (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) Cs Vs q ds) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) r x p := by have h := deterministic_ledger_phase_schedule_cast (PhysicalPlannedResidueEvent (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i))) (physicalPlannedResidueTarget (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i))) (physicalPlannedSmallUpdate (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i))) (physicalPlannedSmallPhase (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i d => physicalFullEdgeDelta (C i) (k t i * (physicalSharedProduct d : ℕ))) (fun _ i _ => physicalFullEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) Vs (fun _ => q)) (physical_small_selected_fine_big_steps (physicalSelectedSmallArrays i ds)).symm r x (physicalSelectedPlannedPathEquiv C k i ds ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p) exact h.trans (physical_selected_planned_ledger_phase C k i ds hCs Vs q ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) r x p) end Effective end Bounty end section /- The original root plan has the same small factor as its selected effective full path. -/ open scoped Classical namespace Bounty section Effective variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) noncomputable def physicalRootSelectedEffectivePathEquiv (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : FullPermutationMixedPath (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) (fun j => physicalFullEdgeDelta (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k pl j)) (fun j => physicalFullEdgeD (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x ≃ PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x := (physicalSelectedEffectivePathEquiv (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) x).trans (physicalEffectivePlanPathCastEquiv (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physical_root_selected_small_plan groups patterns C hC pl) x) theorem physical_root_effective_small_factor (V : Fin N → ℝ) (q : ℝ) (r : PhysicalGroupResidues P groupsᶜ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : FullPermutationMixedPath (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) (fun j => physicalFullEdgeDelta (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k pl j)) (fun j => physicalFullEdgeD (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x) : let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun g : ↥groupsᶜ => V g.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x (physicalRootSelectedEffectivePathEquiv groups e patterns C hC k pl x path) = deterministicLedgerPhase (FullPermutationMixedEvent (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j))) (fullPermutationMixedEventTarget (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j))) (physicalFullSmallRawUpdate Cn kn) (physicalFullSmallRawPhase Cn kn (fun j (g : ↥groupsᶜ) => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val g.val) (fun g => V g.val) q (physicalRootSmallPlanSmallData groups patterns C hC pl)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) x path := by have h := physical_effective_small_factor_plan_cast (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (fun g : ↥groupsᶜ => V g.val) (fun _ => q) (physicalGroupResidueVector r) (physical_root_selected_small_plan groups patterns C hC pl) x (physicalSelectedEffectivePathEquiv (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) x path) exact h.trans (physical_selected_effective_small_factor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) (fun j g => hC (physicalRootSmallPlanPattern groups patterns C hC pl j) g) (fun g => V g.val) q (physicalGroupResidueVector r) x path) end Effective end Bounty end section /- The selected effective plan retains the original local full-path coefficient. -/ open scoped Classical namespace Bounty section Selected variable {S I : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : Fin n → I → ℤ) (i : Fin n → I) {Cs : Fin n → S → Finset (Fin J)} (ds : PhysicalGroupSelectedData Ps ell Cs) (ζ : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) → ℝ) (coeff : ∀ key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n), PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C key.2.1) → ℂ) theorem physical_selected_effective_coefficient (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : physicalEffectivePlanCoefficientPhase C k B ζ coeff ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (physicalSmallSelectedFinePlanEquiv (physicalSelectedSmallArrays i ds)).1 (physicalSmallSelectedFinePlanEquiv (physicalSelectedSmallArrays i ds)).2 x (physicalSelectedEffectivePathEquiv C k i ds x p) = finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j)))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j)))) (physicalFullKeyCoefficientPhase (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) (fun j => ζ (physicalSelectedPlannedKey i ds j)) (fun j => coeff (physicalSelectedPlannedKey i ds j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p := by let Cb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) => C key.2.1 let kb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) => k key.1 key.2.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) have h := finite_event_phase_schedule_cast (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (Cb key g)) B (fun key _ => PhysicalAuxLabels P (Cb key)) (fun key => physicalFullEdgeDelta (Cb key) (kb key)) (fun key => physicalFullEdgeD (Cb key))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (Cb key g)) B (fun key _ => PhysicalAuxLabels P (Cb key)) (fun key => physicalFullEdgeDelta (Cb key) (kb key)) (fun key => physicalFullEdgeD (Cb key))) (physicalFullKeyCoefficientPhase Cb kb ζ coeff) (physical_small_selected_fine_big_steps (physicalSelectedSmallArrays i ds)).symm x (physicalSelectedPlannedPathEquiv C k i ds ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p) exact h.trans (physical_full_key_coefficient_path Cb kb ζ coeff (physicalSelectedPlannedKey i ds) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p) end Selected end Bounty end section /- The selected effective plan retains the original complete signed full-path weight. -/ open scoped Classical namespace Bounty section Selected variable {S I : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : Fin n → I → ℤ) (i : Fin n → I) {Cs : Fin n → S → Finset (Fin J)} (ds : PhysicalGroupSelectedData Ps ell Cs) (ω : ∀ key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n), SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C key.2.1 g)) → PhysicalAuxLabels P (C key.2.1) → ℝ) (β : (g : Fin N) → P g → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (W : Fin N → ℝ) theorem physical_selected_effective_signed_weight (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : physicalEffectivePlanSignedWeight C k B ω β retention ρ W ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (physicalSmallSelectedFinePlanEquiv (physicalSelectedSmallArrays i ds)).1 (physicalSmallSelectedFinePlanEquiv (physicalSelectedSmallArrays i ds)).2 x (physicalSelectedEffectivePathEquiv C k i ds x p) = physicalFullSignedWeight (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) (fun j => ω (physicalSelectedPlannedKey i ds j)) β retention ρ W ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p := by let Cb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) => C key.2.1 let kb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) => k key.1 key.2.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) have h := physical_full_signed_weight_schedule_cast Cb kb ω β retention ρ W (physical_small_selected_fine_big_steps (physicalSelectedSmallArrays i ds)).symm x (physicalSelectedPlannedPathEquiv C k i ds ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p) exact h.trans (physical_full_key_signed_weight Cb kb (physicalSelectedPlannedKey i ds) ω β ρ W retention ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p) end Selected end Bounty end section /- The selected effective plan retains the original full-path terminal state. -/ open scoped Classical namespace Bounty section Selected variable {S I : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : Fin n → I → ℤ) (i : Fin n → I) {Cs : Fin n → S → Finset (Fin J)} (ds : PhysicalGroupSelectedData Ps ell Cs) theorem physical_selected_effective_terminal (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (i j) g)) B (fun j _ => PhysicalAuxLabels P (C (i j))) (fun j => physicalFullEdgeDelta (C (i j)) (physicalSelectedPlannedMultiplier k i ds j)) (fun j => physicalFullEdgeD (C (i j))) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : physicalEffectivePlanTerminal C k B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (physicalSmallSelectedFinePlanEquiv (physicalSelectedSmallArrays i ds)).1 (physicalSmallSelectedFinePlanEquiv (physicalSelectedSmallArrays i ds)).2 x (physicalSelectedEffectivePathEquiv C k i ds x p) = physicalFullPathTerminal (fun j => C (i j)) (physicalSelectedPlannedMultiplier k i ds) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p := by let Cb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) => C key.2.1 let kb := fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) => k key.1 key.2.1 * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) have h := physical_full_terminal_schedule_cast Cb kb (physical_small_selected_fine_big_steps (physicalSelectedSmallArrays i ds)).symm x (physicalSelectedPlannedPathEquiv C k i ds ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p) exact h.trans (physical_full_key_path_terminal Cb kb (physicalSelectedPlannedKey i ds) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x p) end Selected end Bounty end section /- The literal original root record weight equals the actual effective-plan small factor after multiplication by the original signed weight, including zero-weight paths. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Root end Bounty end section /- The actual root effective path retains the complete original local coefficient. -/ open scoped Classical namespace Bounty section Effective variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) theorem physical_root_effective_coefficient (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (cut : ℕ → Fin M → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalSelectedFineTag (n + 1) i) (cut i) (cut (i + 1))) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : FullPermutationMixedPath (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) (fun j => physicalFullEdgeDelta (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k pl j)) (fun j => physicalFullEdgeD (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x) : let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl physicalEffectivePlanCoefficientPhase (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x (physicalRootSelectedEffectivePathEquiv groups e patterns C hC k pl x path) = finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j))) (fullPermutationMixedEventTarget (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j))) (physicalFullCoefficientPhase Cn kn cut (fun _ => 0) (fun j => physicalGroupReindexedCoefficient e (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val g.val) (physicalRootPlanBigCoefficient groups patterns C hC ζ k K θ pl j))) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x path := by let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl have hc := physical_effective_coefficient_plan_cast (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physical_root_selected_small_plan groups patterns C hC pl) x (physicalSelectedEffectivePathEquiv (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) x path) have hs := physical_selected_effective_coefficient (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) x path have hK : (fun j => physicalRootKeyCoefficient groups e patterns C hC ζ k K θ (physicalSelectedPlannedKey (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) j)) = (fun j => physicalGroupReindexedCoefficient e (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val g.val) (physicalRootPlanBigCoefficient groups patterns C hC ζ k K θ pl j)) := by funext j exact physical_root_key_coefficient groups e patterns C hC ζ k K θ pl j erw [hK] at hs exact hc.trans (hs.trans (physical_full_coefficient_phase_edge_cut Cn kn cut hencode (fun _ => 0) (fun j => physicalGroupReindexedCoefficient e (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val g.val) (physicalRootPlanBigCoefficient groups patterns C hC ζ k K θ pl j)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x path).symm) end Effective end Bounty end section /- The actual root auxiliary mass and full signed history transport to the effective path. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) theorem physical_root_effective_signed_weight (V : Fin N → ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : FullPermutationMixedPath (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) (fun j => physicalFullEdgeDelta (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k pl j)) (fun j => physicalFullEdgeD (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x) : let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl physicalEffectivePlanSignedWeight (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val) aux) β retention ρ (fun g => V (e.symm g).val) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x (physicalRootSelectedEffectivePathEquiv groups e patterns C hC k pl x path) = physicalOriginalFineWeight Cn kn (fun j _ aux => physicalAuxMass (fun g => V (e.symm g).val) (Cn j) aux) β retention ρ (fun g => V (e.symm g).val) x path := by let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl have hc := physical_effective_signed_weight_plan_cast (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val) aux) β retention ρ (fun g => V (e.symm g).val) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physical_root_selected_small_plan groups patterns C hC pl) x (physicalSelectedEffectivePathEquiv (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) x path) have hs := physical_selected_effective_signed_weight (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val) aux) β retention ρ (fun g => V (e.symm g).val) x path exact hc.trans (hs.trans (physical_original_full_signed_weight Cn kn (fun j _ aux => physicalAuxMass (fun g => V (e.symm g).val) (Cn j) aux) β retention ρ (fun g => V (e.symm g).val) x path).symm) end Root end Bounty end section /- The actual root effective path ends at the original terminal state. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) theorem physical_root_effective_terminal (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : FullPermutationMixedPath (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) (fun j => physicalFullEdgeDelta (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k pl j)) (fun j => physicalFullEdgeD (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x) : physicalEffectivePlanTerminal (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x (physicalRootSelectedEffectivePathEquiv groups e patterns C hC k pl x path) = physicalFullPathTerminal (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k pl) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x path := by have hc := physical_effective_terminal_plan_cast (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physical_root_selected_small_plan groups patterns C hC pl) x (physicalSelectedEffectivePathEquiv (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) x path) exact hc.trans (physical_selected_effective_terminal (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) (physicalRootSmallPlanPattern groups patterns C hC pl) (physicalRootSmallPlanSmallData groups patterns C hC pl) x path) end Root end Bounty end section /- The literal original root record weight is the actual mixed-plan small factor on its inverse effective path, with the original signed weight retained. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Root end Bounty end section /- The complete original root weight splits into the actual effective small factor and the original local coefficient phase without changing the signed path weight. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Root end Bounty end section /- The complete original root weight splits into the actual mixed small factor and the original local coefficient phase without changing the signed path weight. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Root end Bounty end section /- The complete original root moment is the sum of the actual effective small factor, transported original coefficient phase, signed weight and terminal value along full paths. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Root end Bounty end section /- The complete original root integrand follows the actual effective path, including its signed history weight, small factor, coefficient and terminal value. -/ open scoped Classical namespace Bounty section Integrand variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootEffectiveIntegrand (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x) : ℂ := physicalEffectivePlanSignedWeight (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val) aux) β retention ρ (fun g => V (e.symm g).val) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x path * physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x path * physicalEffectivePlanCoefficientPhase (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x path * f (physicalEffectivePlanTerminal (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x path) end Integrand end Bounty end section /- The complete original root moment is the sum of the actual mixed small factor, original coefficient phase, signed weight and terminal value along full paths. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Root end Bounty end section /- The literal original fixed-plan root sum is its explicit signed effective-factor path sum. -/ open Finset Classical namespace Bounty section Numbered variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Numbered end Bounty end section /- The original root moment is exactly reindexed over the actual effective paths. -/ open scoped Classical namespace Bounty section Sum variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootEffectivePathSum (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ℂ := let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl let _ := fullPermutationMixedEventFintype (J := Fin (n + 2)) (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j)) let _ := finiteEventPathFintype (FullPermutationMixedEvent (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j))) (fullPermutationMixedEventTarget (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j))) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x let _ : Fintype (PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x) := Fintype.ofEquiv (FullPermutationMixedPath (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x) (physicalRootSelectedEffectivePathEquiv groups e patterns C hC k pl x) ∑ path : PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x, physicalRootEffectiveIntegrand groups e patterns C hC k pl V q ζ K r θ β retention ρ f x path end Sum end Bounty end section /- The literal original fixed-plan root sum is its explicit signed mixed-factor path sum. -/ open Finset Classical namespace Bounty section Numbered variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) omit [∀ z : PhysicalPrime P, NeZero z.2.val] in theorem physical_root_group_pools_disjoint (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val) := by intro s g apply hdis intro he apply (e.symm g).property simpa only [← he] using s.property end Numbered end Bounty end section /- The literal original fixed-plan root sum is exactly its sum over effective paths. -/ open Finset Classical namespace Bounty section Numbered variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Numbered end Bounty end section /- The actual effective-path sum is the original full path action with its entire history phase. -/ open scoped Classical namespace Bounty section Action variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootEffectivePhase (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x) : ℂ := let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 physicalFullHistoryPhase Cb kb (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val) aux) β ρ (fun g => V (e.symm g).val) steps x path * physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x path * physicalEffectivePlanCoefficientPhase (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x path theorem physical_root_effective_path_action (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 physicalRootEffectivePathSum groups e patterns C hC k pl V q ζ K r θ β retention ρ f x = fullPermutationMixedPathAction (fun g (p : P (e.symm g).val) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (Cb key g)) B (fun key _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) (fun key => physicalFullEdgeDelta (Cb key) (kb key)) (fun key => physicalFullEdgeD (Cb key)) (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) steps (physicalRootEffectivePhase groups e patterns C hC k pl V q ζ K r θ β ρ) f x := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) unfold physicalRootEffectivePathSum fullPermutationMixedPathAction finiteEventPathAction dsimp only apply Finset.sum_congr · exact congrArg (fun inst : Fintype _ => @Finset.univ _ inst) (Subsingleton.elim _ _) · intro path _ unfold physicalRootEffectiveIntegrand physicalRootEffectivePhase physicalEffectivePlanSignedWeight physicalFullSignedWeight physicalEffectivePlanTerminal physicalFullPathTerminal dsimp only ring end Action end Bounty end section /- The actual effective root sum is the original mixed planned action with its exact history phase. -/ open scoped Classical namespace Bounty section Planned variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) theorem physical_root_effective_eq_planned_action (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) physicalRootEffectivePathSum groups e patterns C hC k pl V q ζ K r θ β retention ρ f x = physicalMixedPlannedBigAction (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun _ (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 (fun y path => physicalRootEffectivePhase groups e patterns C hC k pl V q ζ K r θ β ρ y ((physicalMixedEffectiveBigPathEquiv (Ps := fun s : ↥groupsᶜ => P s.val) (P := fun g : Fin M => P (e.symm g).val) (J := J) (ell := ell) hPs hPb hdis (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k (n - key.1.val) key.2.1.val) B (physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2) y) path)) f x := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) have h := congrFun (physical_mixed_planned_effective_action hPs hPb hdis (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 (fun y path => physicalRootEffectivePhase groups e patterns C hC k pl V q ζ K r θ β ρ y ((physicalMixedEffectiveBigPathEquiv (Ps := fun s : ↥groupsᶜ => P s.val) (P := fun g : Fin M => P (e.symm g).val) (J := J) (ell := ell) hPs hPb hdis (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k (n - key.1.val) key.2.1.val) B (physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2) y) path)) f) x simp only [Equiv.apply_symm_apply] at h exact (physical_root_effective_path_action groups e patterns C hC k pl V q ζ K r θ β retention ρ f x).trans h.symm end Planned end Bounty end section /- The concrete fine-cut encoding gives a common empty-cut initial state for every root plan. -/ open Finset Classical namespace Bounty theorem physical_selected_fine_cut_zero {N J n : ℕ} (C : Fin n → Fin N → Finset (Fin J)) : physicalSelectedFineCut C 0 = (fun _ => ∅) := by simp [physicalSelectedFineCut] section Numbered variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) end Numbered end Bounty end section /- The actual small factor separates from the unchanged history and original coefficient. -/ open scoped Classical namespace Bounty section Factor variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootEffectiveRemainder (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x) : ℂ := let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 physicalFullHistoryPhase Cb kb (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val) aux) β ρ (fun g => V (e.symm g).val) steps x path * physicalEffectivePlanCoefficientPhase (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x path omit [∀ z : PhysicalPrime P, NeZero z.2.val] in theorem physical_root_effective_phase_factor (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x) : physicalRootEffectivePhase groups e patterns C hC k pl V q ζ K r θ β ρ x path = physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x path * physicalRootEffectiveRemainder groups e patterns C hC k pl V ζ K θ β ρ x path := by unfold physicalRootEffectivePhase physicalRootEffectiveRemainder dsimp only ring end Factor end Bounty end section /- The literal root mixed path, its small-plan packing, and its effective big-path equivalence. -/ open scoped Classical namespace Bounty section Geometry variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) abbrev PhysicalRootMixedState := PhysicalMixedWordState (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (M := fun _ : Fin M => J + ell) (fun g (p : P (e.symm g).val) => p.val) B abbrev PhysicalRootMixedEvent (tag : Option (Fin (n + 2) ⊕ Fin (n + 1))) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) := PhysicalMixedWordEvent (Ps := fun s : ↥groupsᶜ => P s.val) (ell := ell) (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) tag s noncomputable def physicalRootMixedTarget (tag : Option (Fin (n + 2) ⊕ Fin (n + 1))) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (event : PhysicalRootMixedEvent groups e patterns C k tag s) := physicalMixedWordTarget (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) tag s event abbrev PhysicalRootMixedPath (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) := FiniteEventPath (PhysicalRootMixedEvent groups e patterns C k) (physicalRootMixedTarget groups e patterns C k) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) s abbrev PhysicalRootPlannedPath (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) := PhysicalMixedPlannedBigPath (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x noncomputable def physicalRootMixedPackingEquiv (r : PhysicalResidues (fun s : ↥groupsᶜ => P s.val)) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) := physicalMixedPathPackingEquiv (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) r L x noncomputable def physicalRootPlannedEffectiveEquiv (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) := physicalMixedEffectiveBigPathEquiv (Ps := fun s : ↥groupsᶜ => P s.val) (P := fun g : Fin M => P (e.symm g).val) (J := J) (ell := ell) hPs hPb hdis (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k (n - key.1.val) key.2.1.val) B (physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2) x end Geometry end Bounty end section /- The original root scalar is the exact effective-path sum over small plans and both initial mark lists. -/ open Finset Classical namespace Bounty section Sum variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) end Sum end Bounty end section /- The actual mixed small factor separates without changing the root history or coefficient phase. -/ open scoped Classical namespace Bounty section Factor variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootPlannedRemainder (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalRootPlannedPath groups e patterns C k pl x) : ℂ := physicalRootEffectiveRemainder groups e patterns C hC k pl V ζ K θ β ρ x (physicalRootPlannedEffectiveEquiv groups e patterns C k hPs hPb hdis pl x path) omit [∀ z : PhysicalPrime P, NeZero z.2.val] in theorem physical_root_planned_phase_factor (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalRootPlannedPath groups e patterns C k pl x) : physicalRootEffectivePhase groups e patterns C hC k pl V q ζ K r θ β ρ x (physicalRootPlannedEffectiveEquiv groups e patterns C k hPs hPb hdis pl x path) = (physicalMixedPlanSmallFactor (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x path : ℂ) * physicalRootPlannedRemainder groups e patterns C hC k pl V ζ K θ β ρ hPs hPb hdis x path := by have h := physical_mixed_plan_small_factor_effective (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B hPs hPb hdis (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x path rw [physical_root_effective_phase_factor] exact congrArg (fun z : ℂ => z * physicalRootPlannedRemainder groups e patterns C hC k pl V ζ K θ β ρ hPs hPb hdis x path) h.symm end Factor end Bounty end section /- The original history and coefficient phase on a full mixed path uses its actual small-plan packing. -/ open scoped Classical namespace Bounty section Phase variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootMixedPhase (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (path : PhysicalRootMixedPath (n := n) groups e patterns C k s) : ℂ := let z := physicalRootMixedPackingEquiv groups e patterns C k s.1.1 s.1.2 s.2 path physicalRootPlannedRemainder groups e patterns C hC k (s.1.2, z.1) V ζ K θ β ρ hPs hPb hdis s.2 z.2 omit [∀ z : PhysicalPrime P, NeZero z.2.val] in theorem physical_root_mixed_phase_pack (r0 : PhysicalResidues (fun t : ↥groupsᶜ => P t.val)) (L : PhysicalMarkLists (fun t : ↥groupsᶜ => P t.val) J ell) (sp : PhysicalMixedSmallPlan (Ps := (fun t : ↥groupsᶜ => P t.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalRootPlannedPath groups e patterns C k (L, sp) x) : physicalRootMixedPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis ((r0, L), x) ((physicalRootMixedPackingEquiv groups e patterns C k r0 L x).symm ⟨sp, path⟩) = physicalRootPlannedRemainder groups e patterns C hC k (L, sp) V ζ K θ β ρ hPs hPb hdis x path := by unfold physicalRootMixedPhase have h := (physicalRootMixedPackingEquiv groups e patterns C k r0 L x).apply_symm_apply ⟨sp, path⟩ exact congrArg (fun z : Σ sp : PhysicalMixedSmallPlan (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))), PhysicalRootPlannedPath groups e patterns C k (L, sp) x => physicalRootPlannedRemainder groups e patterns C hC k (L, z.1) V ζ K θ β ρ hPs hPb hdis x z.2) h end Phase end Bounty end section /- The full mixed path action is exactly the sum of the original effective root path sums. -/ open Finset Classical namespace Bounty section Action variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootMixedAction (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ℂ := let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) physicalMixedWordPathAction (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalRootMixedPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis) (fun s => f s.2) ((physicalGroupResidueVector r, L), x) theorem physical_root_mixed_action_eq_plan_sum (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) physicalRootMixedAction groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis f L x = ∑ sp : PhysicalMixedSmallPlan (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))), physicalRootEffectivePathSum groups e patterns C hC k (L, sp) V q ζ K r θ β retention ρ f x := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) unfold physicalRootMixedAction dsimp only erw [physical_mixed_paths_eq_original_big_paths] apply sum_congr rfl intro sp _ rw [physical_root_effective_eq_planned_action groups e patterns C hC k (L, sp) V q ζ K r θ β retention ρ hPs hPb hdis f x] unfold physicalMixedPlannedBigAction fullPermutationMixedPathAction finiteEventPathAction apply sum_congr rfl intro path _ dsimp only have hp := physical_root_mixed_phase_pack groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis (physicalGroupResidueVector r) L sp x path have ht := physical_mixed_planned_big_terminal (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) L sp x path have hf := physical_root_planned_phase_factor groups e patterns C hC k (L, sp) V q ζ K r θ β ρ hPs hPb hdis x path erw [hp, ht, hf] dsimp only [physicalMixedPlannedBigTerminal] ring end Action end Bounty end /- Direct weighted selection of physical paths, without a recorded-history action. -/ open Finset Classical namespace Bounty theorem direct_filtered_rows_weighted_fiber {D K X : Type*} (E : K → X → Type*) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (phase : ∀ k x, E k x → ℂ) (weight : ∀ k x, E k x → ℝ) (allowed : D → ∀ k x, E k x → Prop) (S : Finset D) (w : D → ℂ) (ks : List K) (F : X → ℂ) (x : X) : (∑ d ∈ S, w d * finiteOperatorListAction (finiteLocalPhasedRow E target (fun k x e => if allowed d k x e then phase k x e else 0) weight) ks F x) = finiteEventPathAction E target weight ks (fun x p => (∑ d ∈ S, if finiteEventPathAllowed E target (allowed d) ks x p then w d else 0) * finiteEventLocalPhase E target phase ks x p) F x := by simp_rw [finite_phased_rows_eq_event_paths] unfold finiteEventPathAction simp_rw [Finset.mul_sum, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro p _ simp only [Finset.mul_sum, Finset.sum_mul] apply Finset.sum_congr rfl intro d _ rw [finite_event_local_phase_filter] split_ifs <;> ring section Physical variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g (p : P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (β : (g : Fin N) → P g → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (retention : Fin (n + 1) → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) theorem physical_direct_selected_history_rows (d : PhysicalSelectedData P ell C) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) (steps : ℕ) (F : FullMixedLedgerState (fun g (p : P g) => p.val) (M := fun _ => J + ell) B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : let _ : ∀ i x, Fintype (PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) x) := fun i x => physicalFullLedgerEventFintype C k (physicalSelectedFineTag n i) x finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C d.1 d.2.1 d.2.2.1 d.2.2.2 k β V ρ hV ω retention) steps (F ∘ physicalBoundedMarkEncode (cut steps)) s = finiteOperatorListAction (finiteLocalPhasedRow (fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (fun i x e => if physicalSelectedFineTraceTest C d.1 d.2.1 d.2.2.1 d.2.2.2 cut i (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut i x e) then physicalFullLedgerEventPhase C k ω β ρ V (physicalSelectedFineTag n i) x e else 0) (fun i => physicalFullLedgerEventWeight C k ω β retention ρ V (physicalSelectedFineTag n i))) (List.range steps) F (physicalBoundedMarkEncode (cut 0) s) := by let _ : ∀ i x, Fintype (PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) x) := fun i x => physicalFullLedgerEventFintype C k (physicalSelectedFineTag n i) x rw [physical_selected_fine_history_intertwines C d.1 d.2.1 d.2.2.1 d.2.2.2 k β V ρ hV ω retention hP hdis cut hencode steps F] dsimp only [Function.comp_apply] rw [finite_row_composition_eq_operator_list] congr 1 funext i F x unfold physicalSelectedFineFullRow physicalFullObservedRow fullMixedObservedRow finiteLocalPhasedRow apply Finset.sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ unfold physicalSelectedFineTraceTest physicalFullTraceObservation physicalFullLedgerEventPhase physicalFullLedgerEventWeight physicalFullLedgerEventTarget dsimp only split_ifs <;> simp only [mul_zero, zero_mul] theorem physical_direct_selected_weighted_fiber (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) (steps : ℕ) (F : FullMixedLedgerState (fun g (p : P g) => p.val) (M := fun _ => J + ell) B → ℂ) (s : PhysicalBoundedMarkState P J ell B) : let _ : ∀ i x, Fintype (PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) x) := fun i x => physicalFullLedgerEventFintype C k (physicalSelectedFineTag n i) x (∑ d ∈ S, w d * finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C d.1 d.2.1 d.2.2.1 d.2.2.2 k β V ρ hV ω retention) steps (F ∘ physicalBoundedMarkEncode (cut steps)) s) = finiteEventPathAction (fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventWeight C k ω β retention ρ V (physicalSelectedFineTag n i)) (List.range steps) (fun x p => (∑ d ∈ S, if finiteEventPathAllowed (fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (fun i x e => physicalSelectedFineTraceTest C d.1 d.2.1 d.2.2.1 d.2.2.2 cut i (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut i x e)) (List.range steps) x p then w d else 0) * finiteEventLocalPhase (fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventPhase C k ω β ρ V (physicalSelectedFineTag n i)) (List.range steps) x p) F (physicalBoundedMarkEncode (cut 0) s) := by let _ : ∀ i x, Fintype (PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i) x) := fun i x => physicalFullLedgerEventFintype C k (physicalSelectedFineTag n i) x simp_rw [physical_direct_selected_history_rows C k β V ρ hV ω retention cut _ hP hdis hencode steps F s] exact direct_filtered_rows_weighted_fiber _ _ _ _ _ S w (List.range steps) F _ end Physical section Normalization variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g (p : P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) [Fintype (PhysicalSelectedData P ell C)] (k : Fin n → ℤ) (a : PhysicalSelectedData P ell C → Fin (n + 1) → ℤ) (hstep : ∀ d, ∀ j : Fin n, a d j.succ = a d j.castSucc + k j * (physicalD (C j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (d.1 j) : ℤ)) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ d : PhysicalSelectedData P ell C, ∀ j : Fin n, ∀ g s, ¬ ((d.2.1 j.castSucc g s).val : ℤ) ∣ k j) (β : (g : Fin N) → P g → ℝ) (V : Fin N → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (q : Fin (n + 1) → ℝ) (hρ : ρ ≠ 0) include hstep hP hdis hk hρ in theorem physical_direct_weighted_normalization (w : PhysicalSelectedData P ell C → ℂ) : (∑ d : PhysicalSelectedData P ell C, (if ∀ j : Fin n, physicalListAdmissible (C j) (d.1 j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ)) then (1 : ℂ) else 0) * (∏ i ∈ range (2 * n + 1), physicalSelectedCoarseScalar C d.1 d.2.1 d.2.2.1 (fun j _ aux => physicalAuxMass V (C j) aux) i) * w d * (ghostPhaseCappedHistory (fun p : PhysicalPrime P => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity d.2.1 p.1) j p.2) (fun p => physicalResidueAbsoluteHit (a d) p.1 p.2) (fun _ j => 1 - q (globalBirthFiniteIndex n j)) (fun p => β p.1 p.2) (fun p => V p.1) (fun _ => B) (fun _ => B) n : ℂ)) = ∑ L : PhysicalMarkLists P J ell, ((∏ g, ∏ s : PhysicalSlots J ell, β g (L g s) / V g : ℝ) : ℂ) * (∑ d : PhysicalSelectedData P ell C, w d * finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C d.1 d.2.1 d.2.2.1 d.2.2.2 k β V ρ hV (fun j _ aux => physicalAuxMass V (C j) aux) q) (4 * n + 1) physicalEmptyMemoryTerminal (physicalInitialMarkState B L)) := by rw [physical_selected_initial_pairing C k β V ρ hV (fun j _ aux => physicalAuxMass V (C j) aux) q univ w (fun L => ((∏ g, ∏ s : PhysicalSlots J ell, β g (L g s) / V g : ℝ) : ℂ)) physicalEmptyMemoryTerminal] apply Finset.sum_congr rfl intro d _ have hn := physical_selected_fine_normalization_unrestricted C d.1 k d.2.1 (a d) d.2.2.1 d.2.2.2 (hstep d) hP hdis (hk d) β V ρ hV B (fun j _ aux => physicalAuxMass V (C j) aux) q hρ linear_combination -(w d) * hn end Normalization end Bounty /- Exhaustive arbitrary-weight selection on original nonzero physical paths. -/ open Finset Classical namespace Bounty section Selection variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (cut : ℕ → Fin N → Finset (Fin J)) theorem physical_direct_selector_eq_record_phase (S : Finset (PhysicalSelectedData P ell C)) (w : PhysicalSelectedData P ell C → ℂ) (x : FullMixedLedgerState (fun g (p : P g) => p.val) (M := fun _ => J + ell) B) (p : FiniteEventPath (fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (List.range (4 * n + 1)) x) : (∑ d ∈ S, if finiteEventPathAllowed (fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (fun i x e => physicalSelectedFineTraceTest C d.1 d.2.1 d.2.2.1 d.2.2.2 cut i (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut i x e)) (List.range (4 * n + 1)) x p then w d else 0) = physicalSelectedDataRecordPhase C cut S w (finiteEventPathObservations (fun i => PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k (physicalSelectedFineTag n i)) (fun i => physicalFullLedgerEventTarget C k (physicalSelectedFineTag n i)) (physicalFullTraceObservation C k (physicalSelectedFineTag n) cut) (List.range (4 * n + 1)) x p) := by unfold physicalSelectedDataRecordPhase physicalSelectedDataRecordTest apply Finset.sum_congr rfl intro d _ rw [finite_event_path_observations_forall₂] theorem physical_direct_record_phase_at [Fintype (PhysicalSelectedData P ell C)] (r : List (PhysicalFullTraceEntry (P := P) (ell := ell) (B := B) C)) (d : PhysicalSelectedData P ell C) (hd : physicalSelectedDataRecordTest C cut d r) (w : PhysicalSelectedData P ell C → ℂ) : physicalSelectedDataRecordPhase C cut univ w r = w d := by unfold physicalSelectedDataRecordPhase rw [Finset.sum_eq_single d] · rw [if_pos hd] · intro b _ hb apply if_neg intro h exact hb (physical_selected_data_record_unique C cut r h hd) · intro h exact (h (mem_univ d)).elim end Selection section Original variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_direct_original_selector_collapse [Fintype (PhysicalSelectedData P ell C)] (cut : ℕ → Fin N → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) (x : PhysicalFullBoundedState P J ell B) (hx : FullActiveInjective x) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) : physicalOriginalFineWeight C k ω β retention ρ V x p = 0 ∨ ∃ d : PhysicalSelectedData P ell C, physicalSelectedDataRecordTest C cut d (physicalOriginalFineRecord C k cut x p) ∧ (∀ e, physicalSelectedDataRecordTest C cut e (physicalOriginalFineRecord C k cut x p) → e = d) ∧ ∀ w : PhysicalSelectedData P ell C → ℂ, physicalSelectedDataRecordPhase C cut univ w (physicalOriginalFineRecord C k cut x p) = w d := by by_cases hp : physicalOriginalFineWeight C k ω β retention ρ V x p = 0 · exact Or.inl hp · right obtain ⟨o, t, hcoh, hlen, ho, ht⟩ := physical_original_fine_trace_coherent C k ω β retention ρ V cut hencode x hx p hp obtain ⟨d, hd, _⟩ := physical_coherent_fine_history_has_selection C o t hcoh have htest : physicalSelectedDataRecordTest C cut d (physicalOriginalFineRecord C k cut x p) := (physical_selected_record_iff_decoded C cut o t (physicalOriginalFineRecord C k cut x p) hlen ho ht d).mpr hd refine ⟨d, htest, ?_, ?_⟩ · intro e he exact physical_selected_data_record_unique C cut _ he htest · intro w exact physical_direct_record_phase_at C cut _ d htest w theorem physical_direct_original_weighted_phase [Fintype (PhysicalSelectedData P ell C)] (cut : ℕ → Fin N → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) (x : PhysicalFullBoundedState P J ell B) (hx : FullActiveInjective x) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) (w : PhysicalSelectedData P ell C → ℂ) (z : ℂ) (hvalue : ∀ d, physicalSelectedDataRecordTest C cut d (physicalOriginalFineRecord C k cut x p) → w d = z) : physicalOriginalFineWeight C k ω β retention ρ V x p * physicalSelectedDataRecordPhase C cut univ w (physicalOriginalFineRecord C k cut x p) = physicalOriginalFineWeight C k ω β retention ρ V x p * z := by rcases physical_direct_original_selector_collapse C k ω β retention ρ V cut hencode x hx p with hz | ⟨d, hd, _, hw⟩ · rw [hz, zero_mul, zero_mul] · rw [hw w, hvalue d hd] end Original end Bounty /- The raw divisor and decoded small phases agree after multiplication by the original signed weight, including every zero-weight path. -/ open scoped Classical namespace Bounty section Weighted variable {S : Type} [Fintype S] {Ps : S → Finset ℕ} {N J ell n B : ℕ} {P : Fin N → Finset ℕ} (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (Cs : Fin n → S → Finset (Fin J)) (Vs : S → ℝ) (q : ℝ) (ds : PhysicalGroupSelectedData Ps ell Cs) (cut : ℕ → Fin N → Finset (Fin J)) (hcut : ∀ j : Fin n, cut (4 * j.val + 2) = C j) include hcut in theorem physical_direct_small_raw_phase (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → ↥(P g) → ℝ) (retention : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (r : PhysicalResidues Ps) (x : PhysicalFullBoundedState P J ell B) (hx : FullActiveInjective x) (p : FullPermutationMixedPath (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) x) (hp : physicalOriginalFineWeight C k ω β retention ρ V x p ≠ 0) : let E := FullPermutationMixedEvent (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let target := fullPermutationMixedEventTarget (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let steps := (List.range (4 * n + 1)).map (physicalSelectedFineTag n) deterministicLedgerPhase E target (physicalFullSmallUpdate C k cut) (physicalFullSmallPhase C k cut Cs Vs q ds) steps r x p = deterministicLedgerPhase E target (physicalFullSmallRawUpdate C k) (physicalFullSmallRawPhase C k Cs Vs q ds) steps r x p := by dsimp only let E := FullPermutationMixedEvent (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let target := fullPermutationMixedEventTarget (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let history := fullMixedLedgerUpdate (J := Fin (n + 1)) (fun g (p : ↥(P g)) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (ell := ell) (C j) (k j)) (fun j => physicalFullEdgeD (ell := ell) (C j)) let steps := (List.range (4 * n + 1)).map (physicalSelectedFineTag n) let lift := (finiteLedgerEventPathEquiv E target history steps (fullActiveInitialLedger x) x).symm p have hphase : finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventPhase C k ω β ρ V) steps (fullActiveInitialLedger x, x) lift ≠ 0 := (mul_ne_zero_iff.mp hp).2 have h := physical_small_ledger_raw_on_support C k Cs Vs q ds cut hcut ω β ρ V steps r (fullActiveInitialLedger x, x) lift hx hphase have hd := deterministic_ledger_phase_forget E target history (physicalFullSmallUpdate C k cut) (physicalFullSmallPhase C k cut Cs Vs q ds) steps (fullActiveInitialLedger x) r x lift have hr := deterministic_ledger_phase_forget E target history (physicalFullSmallRawUpdate C k) (physicalFullSmallRawPhase C k Cs Vs q ds) steps (fullActiveInitialLedger x) r x lift simp only [lift, Equiv.apply_symm_apply] at hd hr exact hd.symm.trans (h.trans hr) end Weighted end Bounty /- Pointwise complete selected weights on original paths, using direct selector recovery. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) theorem physical_root_direct_weighted_effective_complete [Fintype (PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val))] (V : Fin N → ℝ) {q : ℝ} (hq : 0 ≤ q) (r : PhysicalGroupResidues P groupsᶜ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (fun g => physicalFullSharedIndices (ell := ell) (C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) → PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) → ℝ) (β : (g : Fin M) → ↥(P (e.symm g).val) → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (cut : ℕ → Fin M → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalSelectedFineTag (n + 1) i) (cut i) (cut (i + 1))) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (hx : FullActiveInjective x) (path : FullPermutationMixedPath (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) (fun j => physicalFullEdgeDelta (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k pl j)) (fun j => physicalFullEdgeD (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x) : let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl let record := physicalOriginalFineRecord Cn kn cut x path let weight := physicalOriginalFineWeight Cn kn ω β retention ρ (fun g => V (e.symm g).val) x path weight * physicalSelectedDataRecordPhase Cn cut Finset.univ (physicalRootNumberedCompleteWeight groups e patterns C hC V q ζ k K r θ pl) record = weight * physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun g : ↥groupsᶜ => V g.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x (physicalRootSelectedEffectivePathEquiv groups e patterns C hC k pl x path) * physicalEffectivePlanCoefficientPhase (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x (physicalRootSelectedEffectivePathEquiv groups e patterns C hC k pl x path) := by let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl let Cs := fun j (g : ↥groupsᶜ) => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val g.val let ds := physicalRootSmallPlanSmallData groups patterns C hC pl let Kb := fun j => physicalGroupReindexedCoefficient e (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val g.val) (physicalRootPlanBigCoefficient groups patterns C hC ζ k K θ pl j) by_cases hp : physicalOriginalFineWeight Cn kn ω β retention ρ (fun g => V (e.symm g).val) x path = 0 · dsimp only rw [hp, zero_mul, zero_mul, zero_mul] · obtain ⟨o, t, hcoh, hlen, ho, ht⟩ := physical_original_fine_trace_coherent Cn kn ω β retention ρ (fun g => V (e.symm g).val) cut hencode x hx path hp have hcut : ∀ j : Fin (n + 1), cut (4 * j.val + 2) = Cn j := by intro j have h := hencode (4 * j.val + 2) rw [physical_fine_tag_edge] at h exact h.1 dsimp only rw [mul_assoc] apply physical_direct_original_weighted_phase Cn kn ω β retention ρ (fun g => V (e.symm g).val) cut hencode x hx path intro d hd have hdd := (physical_selected_record_iff_decoded Cn cut o t (physicalOriginalFineRecord Cn kn cut x path) hlen ho ht d).mp hd unfold physicalRootNumberedCompleteWeight apply congrArg₂ (fun a b : ℂ => a * b) · rw [physical_root_numbered_small_weight_cumulative groups e patterns C hC k pl V hq r] rw [physical_coherent_selected_cumulative_offset Cn kn cut o t (physicalOriginalFineRecord Cn kn cut x path) hcoh hlen ho ht d hdd] have hs := physical_original_small_ledger Cn kn cut Cs (fun g => V g.val) q ds (physicalGroupResidueVector r) x path have hr := physical_direct_small_raw_phase Cn kn Cs (fun g => V g.val) q ds cut hcut ω β retention ρ (fun g => V (e.symm g).val) (physicalGroupResidueVector r) x hx path hp have he := physical_root_effective_small_factor groups e patterns C hC k pl V q r x path exact hs.symm.trans (hr.trans he.symm) · have ha : ∀ j, o (4 * j.val + 2) = .inr (some ⟨j, d.1 j⟩) := fun j => (((physical_selected_data_test_iff_four Cn d o t).mp hdd).2.2.1 j).1 have hc := physical_coherent_selected_coefficient Cn o t hcoh (fun _ => 0) Kb d.1 ha d hdd have hr := physical_record_coefficient_decoded Cn cut (fun _ => 0) Kb o t (physicalOriginalFineRecord Cn kn cut x path) hlen ho ht d.1 ha have hp1 := physical_original_record_coefficient_phase Cn kn cut (fun _ => 0) Kb x path have hp2 := physical_original_coefficient_full_phase Cn kn cut (fun _ => 0) Kb x path have he := physical_root_effective_coefficient groups e patterns C hC k pl ζ K θ cut hencode x path exact hc.trans (hr.symm.trans (hp1.trans (hp2.trans he.symm))) end Root end Bounty /- The original fixed-small-plan integrand enters selected fine rows directly. -/ open Finset Classical namespace Bounty section Numbered variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) [Fintype (PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val))] (β : PhysicalPrime P → ℝ) (hB : (physicalPrimeGroups P groups).card ≤ B) include hB theorem physical_root_numbered_integrand_sum_coarse : let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Pn := fun g => P (e.symm g).val let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val let Vn := fun g => V (e.symm g).val (∑ d : PhysicalSelectedData Pn ell Cn, let db := (physicalSelectedGroupReindex e (fun g => P g.val) (fun j (g : {g // g ∉ groupsᶜ}) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val)).symm d let old := physicalRootSmallPlanPath groups patterns C hC p db physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ old.1 old.2) = (physicalStateMass (fun g : ↥groupsᶜ => V g.val) J ell : ℂ) * ∑ d : PhysicalSelectedData Pn ell Cn, (if ∀ j : Fin (n + 1), physicalListAdmissible (Cn j) (d.1 j) (physicalPermuteLabels (d.2.2.1 j) (d.2.1 j.castSucc)) (physicalPermuteLabels (d.2.2.2 j) (d.2.1 j.succ)) then (1 : ℂ) else 0) * (∏ i ∈ range (2 * (n + 1) + 1), physicalSelectedCoarseScalar Cn d.1 d.2.1 d.2.2.1 (fun j _ aux => physicalAuxMass Vn (Cn j) aux) i) * physicalRootNumberedCompleteWeight groups e patterns C hC V q ζ k K r θ p d * (ghostPhaseCappedHistory (fun z : PhysicalPrime Pn => fun j => globalBirthFiniteActivity (physicalGroupBareFiniteActivity d.2.1 z.1) j z.2) (fun z => physicalResidueAbsoluteHit (physicalRootNumberedPlanOffset groups e patterns C hC k p d) z.1 z.2) (fun _ j => 1 - physicalEndpointSchedule q (n + 1) (globalBirthFiniteIndex (n + 1) j).val) (fun z => β ⟨(e.symm z.1).val, z.2⟩) (fun z => V (e.symm z.1).val) (fun _ => B) (fun _ => B) (n + 1) : ℂ) := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) dsimp only rw [Finset.mul_sum] apply sum_congr rfl intro d _ rw [physical_root_plan_integrand_selected] have hm := physical_selected_memory_product_reindex e (fun j (g : {g // g ∉ groupsᶜ}) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) (fun g : {g // g ∉ groupsᶜ} => V g.val) (fun _ => 0) (physicalRootPlanBigCoefficient groups patterns C hC ζ k K θ p) ((physicalSelectedGroupReindex e (fun g => P g.val) (fun j (g : {g // g ∉ groupsᶜ}) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val)).symm d) simp only [Equiv.apply_symm_apply] at hm have hc := physical_root_numbered_big_capped_history groups e patterns C hC p ((physicalSelectedGroupReindex e (fun g => P g.val) (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val)).symm d) q k β V B hB simp only [physicalRootNumberedBigData, Equiv.apply_symm_apply] at hc rw [← hm, physical_selected_memory_product_unrestricted, hc, physicalRootNumberedCompleteWeight] dsimp only [physicalRootNumberedPlanOffset] ring theorem physical_root_numbered_integrand_sum_selected_rows (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (hρ : ρ ≠ 0) : let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Pn := fun g => P (e.symm g).val let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val let Vn := fun g => V (e.symm g).val let βn := fun (g : Fin M) (z : Pn g) => β ⟨(e.symm g).val, z⟩ (∑ d : PhysicalSelectedData Pn ell Cn, let db := (physicalSelectedGroupReindex e (fun g => P g.val) (fun j (g : {g // g ∉ groupsᶜ}) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val)).symm d let old := physicalRootSmallPlanPath groups patterns C hC p db physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ old.1 old.2) = (physicalStateMass (fun g : ↥groupsᶜ => V g.val) J ell : ℂ) * ∑ L : PhysicalMarkLists Pn J ell, ((∏ g, ∏ s : PhysicalSlots J ell, βn g (L g s) / Vn g : ℝ) : ℂ) * (∑ d : PhysicalSelectedData Pn ell Cn, physicalRootNumberedCompleteWeight groups e patterns C hC V q ζ k K r θ p d * finiteRowComposition (S := fun _ => PhysicalBoundedMarkState Pn J ell B) (physicalSelectedFineRow Cn d.1 d.2.1 d.2.2.1 d.2.2.2 (physicalRootPlanMultiplier groups patterns C hC k p) βn Vn ρ (fun g => hV (e.symm g).val) (fun j _ aux => physicalAuxMass Vn (Cn j) aux) (fun j => physicalEndpointSchedule q (n + 1) j.val)) (4 * (n + 1) + 1) physicalEmptyMemoryTerminal (physicalInitialMarkState B L)) := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) dsimp only rw [physical_root_numbered_integrand_sum_coarse groups e patterns C hC V q ζ k K r θ p β hB] congr 1 exact physical_direct_weighted_normalization (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k p) (physicalRootNumberedPlanOffset groups e patterns C hC k p) (physical_root_numbered_plan_offset_step groups e patterns C hC k p) (fun g => hP (e.symm g).val) (physical_numbered_big_pools_disjoint groups e hdis) (fun d j g s => physical_root_plan_multiplier_not_dvd groups patterns C hC k p e hP hdis hk j g (d.2.1 j.castSucc g s)) (fun g z => β ⟨(e.symm g).val, z⟩) (fun g => V (e.symm g).val) ρ (fun g => hV (e.symm g).val) (fun j => physicalEndpointSchedule q (n + 1) j.val) hρ (physicalRootNumberedCompleteWeight groups e patterns C hC V q ζ k K r θ p) end Numbered end Bounty /- Direct weighted selected rows give the original full-path moment. -/ open Finset Classical namespace Bounty section Paths variable {N J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ g (p : P g), NeZero p.val] (C : Fin n → Fin N → Finset (Fin J)) (k : Fin n → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (cut : ℕ → Fin N → Finset (Fin J)) (w : PhysicalSelectedData P ell C → ℂ) [Fintype (PhysicalSelectedData P ell C)] theorem physical_direct_selected_rows_eq_weighted_moment (hV : ∀ g, V g ≠ 0) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) (f : PhysicalFullBoundedState P J ell B → ℂ) (L : PhysicalMarkLists P J ell) (memory : ∀ g, BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : P g => p.val)) B) : let x := physicalFullMemoryState (cut 0) L memory (∑ d : PhysicalSelectedData P ell C, w d * finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C d.1 d.2.1 d.2.2.1 d.2.2.2 k β V ρ hV ω q) (4 * n + 1) ((fun s => f s.2) ∘ physicalBoundedMarkEncode (cut (4 * n + 1))) (L, fullActiveInitialLedger x, memory)) = physicalOriginalWeightedMoment C k ω β q ρ V cut w f x := by intro x let _ : ∀ t s, Fintype (PhysicalFullLedgerEvent (I := Fin (n + 1)) (P := P) (ell := ell) (B := B) C k t s) := fun t s => physicalFullLedgerEventFintype C k t s rw [physical_direct_selected_weighted_fiber C k β V ρ hV ω q cut univ w hP hdis hencode] simp_rw [physical_direct_selector_eq_record_phase] rw [finite_event_path_action_map (PhysicalFullLedgerEvent (P := P) (ell := ell) (B := B) C k) (physicalFullLedgerEventTarget C k) (physicalSelectedFineTag n) (physicalFullLedgerEventWeight C k ω β q ρ V)] rw [physical_original_weighted_moment_eq_trace_action] change _ = finiteEventPathAction (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (physicalFullLedgerEventWeight C k ω β q ρ V) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) (physicalFullRecordedTracePhase C k ω β ρ V (physicalSelectedFineTag n) cut (4 * n + 1) (fun _ => []) (fun r _ => physicalSelectedDataRecordPhase C cut univ w r)) (fun s => f s.2) (fullActiveInitialLedger x, x) congr 1 funext s p rw [finite_event_path_map_local_phase] simp only [Equiv.apply_symm_apply] unfold physicalFullRecordedTracePhase rw [finite_recorded_schedule_phase_factor] simp only [List.nil_append] exact mul_comm _ _ theorem physical_direct_initial_rows_eq_weighted_moment (hV : ∀ g, V g ≠ 0) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hencode : ∀ i, PhysicalMarkRowEncoding C (physicalSelectedFineTag n i) (cut i) (cut (i + 1))) (L : PhysicalMarkLists P J ell) : (∑ d : PhysicalSelectedData P ell C, w d * finiteRowComposition (S := fun _ => PhysicalBoundedMarkState P J ell B) (physicalSelectedFineRow C d.1 d.2.1 d.2.2.1 d.2.2.2 k β V ρ hV ω q) (4 * n + 1) physicalEmptyMemoryTerminal (physicalInitialMarkState B L)) = physicalOriginalWeightedMoment C k ω β q ρ V cut w fullMemoryVacuum (physicalFullMemoryState (cut 0) L (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun p : P g => p.val)) B)) := by have h := physical_direct_selected_rows_eq_weighted_moment C k ω β q ρ V cut w hV hP hdis hencode fullMemoryVacuum L (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun p : P g => p.val)) B) dsimp only at h simp only [Function.comp_def, physical_full_vacuum_terminal_encode] at h simpa only [physical_full_initial_ledger, physicalInitialMarkState, fullEmptyBoundedMemory] using h end Paths end Bounty /- The original fixed-plan root sum is exactly its full-path moment with complete selected weight. -/ open Finset Classical namespace Bounty section Numbered variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) theorem physical_root_direct_integrand_sum_eq_weighted_moment {B : ℕ} [Fintype (PhysicalRootSmallPlanBigData groups patterns C hC p)] [Fintype (PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val))] (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hV : ∀ g, V g ≠ 0) (hρ : ρ ≠ 0) (hB : (physicalPrimeGroups P groups).card ≤ B) (cut : ℕ → Fin M → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val) (physicalSelectedFineTag (n + 1) i) (cut i) (cut (i + 1))) : let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Pn := fun g => P (e.symm g).val let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val let Vn := fun g => V (e.symm g).val let βn := fun (g : Fin M) (z : Pn g) => β ⟨(e.symm g).val, z⟩ (∑ db : PhysicalRootSmallPlanBigData groups patterns C hC p, let old := physicalRootSmallPlanPath groups patterns C hC p db physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ old.1 old.2) = (physicalStateMass (fun g : ↥groupsᶜ => V g.val) J ell : ℂ) * ∑ L : PhysicalMarkLists Pn J ell, ((∏ g, ∏ s : PhysicalSlots J ell, βn g (L g s) / Vn g : ℝ) : ℂ) * physicalOriginalWeightedMoment Cn (physicalRootPlanMultiplier groups patterns C hC k p) (fun j _ aux => physicalAuxMass Vn (Cn j) aux) βn (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ Vn cut (physicalRootNumberedCompleteWeight groups e patterns C hC V q ζ k K r θ p) fullMemoryVacuum (physicalFullMemoryState (cut 0) L (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : Pn g => z.val)) B)) := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) dsimp only rw [← (physicalSelectedGroupReindex e (fun g => P g.val) (fun j (g : {g // g ∉ groupsᶜ}) => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val)).symm.sum_comp (fun db => let old := physicalRootSmallPlanPath groups patterns C hC p db physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ old.1 old.2)] rw [physical_root_numbered_integrand_sum_selected_rows groups e patterns C hC V q ζ k K r θ p β hB hP hdis hk ρ hV hρ] congr 1 apply sum_congr rfl intro L _ congr 1 exact physical_direct_initial_rows_eq_weighted_moment (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k p) (fun j _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val) aux) (fun g z => β ⟨(e.symm g).val, z⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ (fun g => V (e.symm g).val) cut (physicalRootNumberedCompleteWeight groups e patterns C hC V q ζ k K r θ p) (fun g => hV (e.symm g).val) (fun g => hP (e.symm g).val) (physical_numbered_big_pools_disjoint groups e hdis) hencode L end Numbered end Bounty /- Direct weighted identities preserve the original effective integrand and path sum. -/ open scoped Classical namespace Bounty section Integrand variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) theorem physical_root_direct_effective_integrand [∀ z : PhysicalPrime P, NeZero z.2.val] [Fintype (PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val))] (hq : 0 ≤ q) (cut : ℕ → Fin M → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalSelectedFineTag (n + 1) i) (cut i) (cut (i + 1))) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (hx : FullActiveInjective x) (path : FullPermutationMixedPath (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) (fun j => physicalFullEdgeDelta (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalRootPlanMultiplier groups patterns C hC k pl j)) (fun j => physicalFullEdgeD (fun g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x) : let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl (physicalOriginalFineWeight Cn kn (fun j _ aux => physicalAuxMass (fun g => V (e.symm g).val) (Cn j) aux) β retention ρ (fun g => V (e.symm g).val) x path * physicalSelectedDataRecordPhase Cn cut Finset.univ (physicalRootNumberedCompleteWeight groups e patterns C hC V q ζ k K r θ pl) (physicalOriginalFineRecord Cn kn cut x path)) * f (physicalFullPathTerminal Cn kn ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x path) = physicalRootEffectiveIntegrand groups e patterns C hC k pl V q ζ K r θ β retention ρ f x (physicalRootSelectedEffectivePathEquiv groups e patterns C hC k pl x path) := by let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl have h := physical_root_direct_weighted_effective_complete groups e patterns C hC k pl V hq r ζ K θ (fun j _ aux => physicalAuxMass (fun g => V (e.symm g).val) (Cn j) aux) β retention ρ cut hencode x hx path have hw := physical_root_effective_signed_weight groups e patterns C hC k pl V β retention ρ x path have ht := physical_root_effective_terminal groups e patterns C hC k pl x path dsimp only unfold physicalRootEffectiveIntegrand rw [hw, ht] exact congrArg (fun z => z * f (physicalFullPathTerminal Cn kn ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x path)) h end Integrand end Bounty open scoped Classical namespace Bounty section Sum variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) theorem physical_root_direct_moment_eq_effective_path_sum [Fintype (PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val))] (hq : 0 ≤ q) (cut : ℕ → Fin M → Finset (Fin J)) (hencode : ∀ i, PhysicalMarkRowEncoding (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val) (physicalSelectedFineTag (n + 1) i) (cut i) (cut (i + 1))) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (hx : FullActiveInjective x) : let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl physicalOriginalWeightedMoment Cn kn (fun j _ aux => physicalAuxMass (fun g => V (e.symm g).val) (Cn j) aux) β retention ρ (fun g => V (e.symm g).val) cut (physicalRootNumberedCompleteWeight groups e patterns C hC V q ζ k K r θ pl) f x = physicalRootEffectivePathSum groups e patterns C hC k pl V q ζ K r θ β retention ρ f x := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC pl j).val (e.symm g).val let kn := physicalRootPlanMultiplier groups patterns C hC k pl let _ := fullPermutationMixedEventFintype (J := Fin (n + 2)) (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j)) let _ := finiteEventPathFintype (FullPermutationMixedEvent (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j))) (fullPermutationMixedEventTarget (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j))) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x let _ : Fintype (PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x) := Fintype.ofEquiv (FullPermutationMixedPath (fun g (p : P (e.symm g).val) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (Cn j g)) B (fun j _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cn j)) (fun j => physicalFullEdgeDelta (Cn j) (kn j)) (fun j => physicalFullEdgeD (Cn j)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x) (physicalRootSelectedEffectivePathEquiv groups e patterns C hC k pl x) unfold physicalOriginalWeightedMoment physicalRootEffectivePathSum dsimp only refine Eq.trans ?_ ((physicalRootSelectedEffectivePathEquiv groups e patterns C hC k pl x).sum_comp (physicalRootEffectiveIntegrand groups e patterns C hC k pl V q ζ K r θ β retention ρ f x)) apply Finset.sum_congr rfl intro path _ exact physical_root_direct_effective_integrand groups e patterns C hC k pl V q ζ K r θ β retention ρ hq cut hencode f x hx path end Sum end Bounty section /- The original root scalar equals the literal mixed path action averaged over its initial marks. -/ open Finset Classical namespace Bounty section Scalar variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) noncomputable def physicalRootMixedScalar : ℂ := (physicalStateMass (fun s : ↥groupsᶜ => V s.val) J ell : ℂ) * ∑ Ls : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell, ∑ Lb : PhysicalMarkLists (fun g => P (e.symm g).val) J ell, ((∏ g, ∏ s : PhysicalSlots J ell, β ⟨(e.symm g).val, Lb g s⟩ / V (e.symm g).val : ℝ) : ℂ) * physicalRootMixedAction (n := n) groups e patterns C hC k V q ζ K r θ (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ (fun (s : ↥groupsᶜ) => hP s.val) (fun (g : Fin M) => hP (e.symm g).val) (physical_root_group_pools_disjoint groups e hdis) fullMemoryVacuum Ls (physicalFullMemoryState (fun _ => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B)) theorem physical_root_compact_small_plan_eq_mixed_scalar (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (hV : ∀ g, V g ≠ 0) (hρ : ρ ≠ 0) (hB : (physicalPrimeGroups P groups).card ≤ B) (hq : 0 ≤ q) : physicalRootSmallPlanSum (n := n) groups patterns C hC V q ζ k K β B r θ = physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis := by let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) let _ : ∀ p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns, Fintype (PhysicalRootSmallPlanBigData groups patterns C hC p) := fun p => physicalGroupSelectedDataFintype (P := fun g : {g // g ∉ groupsᶜ} => P g.val) (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val g.val) let _ : ∀ p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns, Fintype (PhysicalSelectedData (fun g => P (e.symm g).val) ell (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val)) := fun p => physicalSelectedDataFintype (fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val) have hf : ∀ p : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns, (∑ db : PhysicalRootSmallPlanBigData groups patterns C hC p, physicalRootSmallPlanIntegrand groups patterns C hC V q ζ k K β B r θ p db) = (physicalStateMass (fun s : ↥groupsᶜ => V s.val) J ell : ℂ) * ∑ Lb : PhysicalMarkLists (fun g => P (e.symm g).val) J ell, ((∏ g, ∏ s : PhysicalSlots J ell, β ⟨(e.symm g).val, Lb g s⟩ / V (e.symm g).val : ℝ) : ℂ) * physicalRootEffectivePathSum groups e patterns C hC k p V q ζ K r θ (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ fullMemoryVacuum (physicalFullMemoryState (fun _ => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B)) := by intro p unfold physicalRootSmallPlanIntegrand let Cn := fun j g => C (physicalRootSmallPlanPattern groups patterns C hC p j).val (e.symm g).val let cut := physicalSelectedFineCut Cn have hencode := physical_selected_fine_cut_encoding Cn rw [physical_root_direct_integrand_sum_eq_weighted_moment groups e patterns C hC V q ζ k K r θ p hP hdis hk β ρ hV hρ hB cut hencode] simp only [cut, physical_selected_fine_cut_zero] congr 1 apply sum_congr rfl intro L _ congr 1 exact physical_root_direct_moment_eq_effective_path_sum groups e patterns C hC k p V q ζ K r θ (fun g z => β ⟨(e.symm g).val, z⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ hq cut hencode fullMemoryVacuum (physicalFullMemoryState (fun _ => ∅) L (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B)) (physical_full_state_injective (fun _ => ∅) L (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B)) rw [physical_root_small_plan_sigma] simp_rw [hf] rw [← Finset.mul_sum, Fintype.sum_prod_type] unfold physicalRootMixedScalar congr 1 apply sum_congr rfl intro Ls _ rw [Finset.sum_comm] apply sum_congr rfl intro Lb _ rw [← Finset.mul_sum] congr 1 exact (physical_root_mixed_action_eq_plan_sum (n := n) groups e patterns C hC k V q ζ K r θ (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ (fun (s : ↥groupsᶜ) => hP s.val) (fun (g : Fin M) => hP (e.symm g).val) (physical_root_group_pools_disjoint groups e hdis) fullMemoryVacuum Ls (physicalFullMemoryState (fun _ => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B))).symm theorem physical_root_small_plan_eq_mixed_scalar (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (hV : ∀ g, V g ≠ 0) (hρ : ρ ≠ 0) (hB : (physicalPrimeGroups P groups).card ≤ B) (hq : 0 ≤ q) : physicalRootSmallPlanSum (n := n) groups patterns C hC V q ζ k K β B r θ = physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis := by exact physical_root_compact_small_plan_eq_mixed_scalar groups e patterns C hC V q ζ k K r θ β ρ hP hdis hk hV hρ hB hq end Scalar end Bounty end section /- The full original residue model is expressed using the literal mixed path action and its exact history phase. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_root_residue_model_mixed_action {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (q : ℝ) (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (hV : ∀ g, 0 < V g) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (b : PhysicalPrime P → ℝ) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → b a ≠ 0) (B : ℕ) (hB : (physicalPrimeGroups P groups).card ≤ B) : physicalRootResidueModel V patterns C q ζ k K n = (∏ a ∈ physicalPrimeGroups P groups, b a : ℝ) * ∑ r : PhysicalGroupResidues P groupsᶜ, (∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ)) * ∫ θ : ℝ in (0 : ℝ)..1, physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ (fun a => ((a.2.val : ℝ) * b a)⁻¹) 1 hP hdis := by rw [physical_root_residue_model_small_plan groups V patterns C hC q ζ k K hV hP hdis hk b hb hb0 B hB] apply congrArg (fun z : ℂ => ((∏ a ∈ physicalPrimeGroups P groups, b a : ℝ) : ℂ) * z) apply sum_congr rfl intro r _ apply congrArg (fun z : ℂ => ((∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ) : ℝ) : ℂ) * z) apply congrArg (fun f : ℝ → ℂ => ∫ θ : ℝ in (0 : ℝ)..1, f θ) funext θ exact physical_root_small_plan_eq_mixed_scalar groups e patterns C hC V q ζ k K r θ (fun a => ((a.2.val : ℝ) * b a)⁻¹) 1 hP hdis hk (fun g => ne_of_gt (hV g)) one_ne_zero hB hq end Bounty end end section -- Source module: PinnedNonprincipal /- Pointwise nonprincipal specialization for measuring the actual analytic dependency closure. -/ noncomputable section open scoped Classical BigOperators ContDiff namespace OAI.ApplicationAudit open ActualEisensteinCubic open ConcretePrimeRowBridge hiding O open ShortDraftHeckeBridge open CanonicalQuadraticSieve hiding O open SecondPassArithmetic hiding O open SixthPowerAverage CompactMellinBridge InitialMeanSquare CanonicalRowCompletion theorem nonprincipal_open_strip_of_theta_models {q₀ : ℕ} [NeZero q₀] (χ : DirichletCharacter ℂ q₀) (hχ : χ ≠ 1) (S : Finset (Ideal ActualEisensteinCubic.O)) (hbad : fixedBadPrimes⊆S) (hSp : ∀P∈S,Prime P) (ρ q levelBound : ℝ) (hρ : 0<ρ) (hq : 1(finiteEulerFactor χ S s*SmoothMobiusCorrection.eulerCorrection χ S s)* mellin (fun Z : ℝ=>weightedCompactSum χ S W Z⁻¹) (-s)) (mellin W) ((hE.mul hH).mul hM) hWanalytic (corrected_weighted_mellin_identity χ S hSp W hW hWs) z hz hzneq (ConcreteCompactWeight.weight_mellin_ne_zero z)).1 theorem nonprincipal_LFunction_ne_zero {q : ℕ} [NeZero q] (χ : DirichletCharacter ℂ q) (hχ : χ ≠ 1) (z : ℂ) (hz : (23 : ℝ) / 24 < z.re) : χ.LFunction z ≠ 0 := by by_cases hz1 : z.re < 1 · have hm := hasCanonicalThetaModels_of_fixed_shell_models (reflectionExcludedPrimes q) (CanonicalCoefficientClass.initialBase χ) (CubicEisenstein.fixedReflectionRayCount (reflectionConductor q) (reflectionConductor_ne_zero q (NeZero.ne q))) actualReflectionScale 1 CompletedGauss.completedRamifiedStep (CubicEisenstein.fixedCuspLevelBound (reflectionConductor q)) (actual_fixedShellModels q (NeZero.ne q) χ) exact nonprincipal_open_strip_of_theta_models χ hχ (reflectionExcludedPrimes q) (reflectionExcludedPrimes_bad q) (reflectionExcludedPrimes_prime q) 1 CompletedGauss.completedRamifiedStep (CubicEisenstein.fixedCuspLevelBound (reflectionConductor q)) (by norm_num) CompletedGauss.completedRamifiedStep_gt_one (reflectionLevelBound_ge_one q (NeZero.ne q)) hm z hz hz1 · exact DirichletCharacter.LFunction_ne_zero_of_one_le_re χ (Or.inl hχ) (le_of_not_gt hz1) end OAI.ApplicationAudit end end section -- Source module: WeakCandidateTarget /- Sound migration of the candidate target to the actual 23/24 zero-free theorem. -/ /- Actual zero-free and prime-sum inputs at the weaker exponent. -/ namespace Bounty.WeakZeroFree /- The actual Mathlib L-function is nonzero in the weaker half-plane. -/ theorem actual_zero_free : PrimitiveZeroFreeRightOf (23 / 24) := by intro χ s hs let : NeZero χ.modulus := ⟨χ.positive.ne'⟩ exact OAI.ApplicationAudit.nonprincipal_LFunction_ne_zero χ.character χ.nontrivial s hs theorem primitive_twistedPsi_power_saving (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (χ : OAI.Ostmann.PrimitiveComplexCharacter) (x : ℝ), 2 ≤ x → ‖twistedPsi χ.character x‖ ≤ C * x ^ ((95 : ℝ) / 96) * Real.log ((χ.modulus : ℝ) * x) := Bounty.primitive_twistedPsi_power_saving_23_24 hZ end Bounty.WeakZeroFree /- Quantitative prime-character companions for the 23/24 zero-free strip. -/ open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree theorem prime_power_error_le_character_scale_linear {q x : ℝ} (hq : 1 ≤ q) (hx : 2 ≤ x) : 2 * Real.sqrt x * Real.log x ≤ 2 * x ^ ((95 : ℝ) / 96) * Real.log (q * x) := by have hx0 : 0 < x := by linarith have hx1 : 1 ≤ x := by linarith have hlog : Real.log x ≤ Real.log (q * x) := Real.log_le_log hx0 (by nlinarith) have hsqrt : Real.sqrt x ≤ x ^ ((95 : ℝ) / 96) := by rw [Real.sqrt_eq_rpow] exact Real.rpow_le_rpow_of_exponent_le hx1 (by norm_num) have hlog0 : 0 ≤ Real.log x := Real.log_nonneg hx1 gcongr theorem primitive_twistedTheta_power_saving_linear_log (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (χ : OAI.Ostmann.PrimitiveComplexCharacter) (x : ℝ), 2 ≤ x → ‖twistedTheta χ.character x‖ ≤ C * x ^ ((95 : ℝ) / 96) * Real.log ((χ.modulus : ℝ) * x) := by obtain ⟨C, hC, hbound⟩ := primitive_twistedPsi_power_saving hZ refine ⟨C + 2, by linarith, ?_⟩ intro χ x hx have hq : (1 : ℝ) ≤ χ.modulus := by exact_mod_cast χ.positive have he := prime_power_error_le_character_scale_linear hq hx have ht := norm_twistedTheta_le χ.character (by linarith : 1 ≤ x) (hbound χ x hx) nlinarith end Bounty.WeakZeroFree /- Quantitative prime-character companions for the 23/24 zero-free strip. -/ open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree /- The logarithm in a character prefix estimate loses only a logarithmic ratio. -/ theorem reciprocal_character_shell_scale_le {q x C : ℝ} (hq : 1 ≤ q) (hx : 2 ≤ x) (hC : 0 ≤ C) : 2 * (1 / (x * Real.log x)) * (C * (2 * x) ^ ((95 : ℝ) / 96) * Real.log (q * (2 * x))) ≤ 8 * C * x ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log x) := by have hx0 : 0 < x := by linarith have hq0 : 0 < q := by linarith have hlx : 0 < Real.log x := Real.log_pos (by linarith) have hlq : 0 ≤ Real.log q := Real.log_nonneg hq have hltwo : Real.log 2 ≤ Real.log x := Real.log_le_log (by norm_num) hx have hp : (2 : ℝ) ^ ((95 : ℝ) / 96) ≤ 2 := Real.rpow_le_self_of_one_le (by norm_num) (by norm_num) have hxpow : x ^ ((95 : ℝ) / 96) = x * x ^ (-(1 : ℝ) / 96) := by calc _ = x ^ ((1 : ℝ) + (-(1 : ℝ) / 96)) := by norm_num _ = x ^ (1 : ℝ) * x ^ (-(1 : ℝ) / 96) := Real.rpow_add hx0 _ _ _ = _ := by rw [Real.rpow_one] have hl : Real.log (q * (2 * x)) ≤ 2 * (Real.log x + Real.log q) := by rw [Real.log_mul hq0.ne' (by positivity), Real.log_mul (by norm_num) hx0.ne'] linarith have hratio : Real.log (q * (2 * x)) / Real.log x ≤ 2 * (1 + Real.log q / Real.log x) := by apply (div_le_iff₀ hlx).mpr calc _ ≤ 2 * (Real.log x + Real.log q) := hl _ = _ := by field_simp have hr0 : 0 ≤ Real.log (q * (2 * x)) / Real.log x := by apply div_nonneg _ hlx.le exact Real.log_nonneg (by nlinarith) calc _ = (2 * C * (2 : ℝ) ^ ((95 : ℝ) / 96) * x ^ (-(1 : ℝ) / 96)) * (Real.log (q * (2 * x)) / Real.log x) := by rw [Real.mul_rpow (by norm_num) hx0.le, hxpow] field_simp _ ≤ (2 * C * 2 * x ^ (-(1 : ℝ) / 96)) * (2 * (1 + Real.log q / Real.log x)) := by have hfirst : 2 * C * (2 : ℝ) ^ ((95 : ℝ) / 96) * x ^ (-(1 : ℝ) / 96) ≤ 2 * C * 2 * x ^ (-(1 : ℝ) / 96) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hp (by positivity)) (Real.rpow_nonneg hx0.le _) exact mul_le_mul hfirst hratio hr0 (by positivity) _ = _ := by ring /- Every subinterval ending within twice its lower endpoint has a true reciprocal-prime power saving. The prefix hypothesis is the actual twisted theta sum. -/ theorem reciprocal_prime_partial_dyadic_shell_bound {q : ℕ} (χ : DirichletCharacter ℂ q) (hq : 0 < q) {C : ℝ} (hC : 0 ≤ C) (hbound : ∀ z : ℝ, 2 ≤ z → ‖twistedTheta χ z‖ ≤ C * z ^ ((95 : ℝ) / 96) * Real.log ((q : ℝ) * z)) {x y : ℝ} (hx : 2 ≤ x) (hxy : x ≤ y) (hy : y ≤ 2 * x) : ‖∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ 8 * C * x ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log x) := by have hx0 : 0 < x := by linarith have hy0 : 0 ≤ y := by linarith have hq1 : (1 : ℝ) ≤ q := by exact_mod_cast hq let B := C * (2 * x) ^ ((95 : ℝ) / 96) * Real.log ((q : ℝ) * (2 * x)) have hB : 0 ≤ B := by have hl : 0 ≤ Real.log ((q : ℝ) * (2 * x)) := Real.log_nonneg (by nlinarith) positivity have hm : 2 ≤ ⌊x⌋₊ := by apply Nat.le_floor norm_num exact hx have hprefix : ∀ k ∈ Finset.Icc ⌊x⌋₊ ⌊y⌋₊, ‖twistedTheta χ k‖ ≤ B := by intro k hk obtain ⟨hmk, hkn⟩ := Finset.mem_Icc.mp hk have hk2 : (2 : ℝ) ≤ k := by exact_mod_cast hm.trans hmk have hkx : (k : ℝ) ≤ 2 * x := ((Nat.le_floor_iff hy0).mp hkn).trans hy have hl : 0 ≤ Real.log ((q : ℝ) * k) := Real.log_nonneg (by nlinarith) apply (hbound k hk2).trans dsimp [B] gcongr exact (norm_reciprocal_prime_sum_real_Ioc_le χ hx hB hprefix).trans (reciprocal_character_shell_scale_le hq1 hx hC) end Bounty.WeakZeroFree /- Quantitative prime-character companions for the 23/24 zero-free strip. -/ open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree theorem reciprocal_character_profile_doubling {q x : ℝ} (hq : 1 ≤ q) (hx : 2 ≤ x) : (2 * x) ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log (2 * x)) ≤ (2 : ℝ) ^ (-(1 : ℝ) / 96) * (x ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log x)) := by have hx0 : 0 < x := by linarith have hlx : 0 < Real.log x := Real.log_pos (by linarith) have hlq : 0 ≤ Real.log q := Real.log_nonneg hq have hlogs : Real.log x ≤ Real.log (2 * x) := Real.log_le_log hx0 (by linarith) have hratio : Real.log q / Real.log (2 * x) ≤ Real.log q / Real.log x := div_le_div_of_nonneg_left hlq hlx hlogs rw [Real.mul_rpow (by norm_num) hx0.le] calc _ ≤ ((2 : ℝ) ^ (-(1 : ℝ) / 96) * x ^ (-(1 : ℝ) / 96)) * (1 + Real.log q / Real.log x) := by gcongr _ = _ := by ring /- The upper endpoint is unrestricted. The constant and decay depend only on the theta prefix constant and the lower endpoint. -/ theorem reciprocal_prime_interval_bound_of_theta {q : ℕ} (χ : DirichletCharacter ℂ q) (hq : 0 < q) {C : ℝ} (hC : 0 ≤ C) (hbound : ∀ z : ℝ, 2 ≤ z → ‖twistedTheta χ z‖ ≤ C * z ^ ((95 : ℝ) / 96) * Real.log ((q : ℝ) * z)) {x y : ℝ} (hx : 2 ≤ x) (hxy : x ≤ y) : ‖∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ (8 * C / (1 - (2 : ℝ) ^ (-(1 : ℝ) / 96))) * x ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log x) := by classical have hq1 : (1 : ℝ) ≤ q := by exact_mod_cast hq have hlq : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg hq1 have htail := norm_sum_real_Ioc_le_of_dyadic_bound (fun p : ℕ => if p.Prime then (1 / (p : ℝ)) • χ (p : ZMod q) else 0) (fun a : ℝ => a ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log a)) (K := 8 * C) (r := (2 : ℝ) ^ (-(1 : ℝ) / 96)) (by positivity) (Real.rpow_nonneg (by norm_num) _) (Real.rpow_lt_one_of_one_lt_of_neg (by norm_num) (by norm_num)) (by intro a ha have hla : 0 ≤ Real.log a := Real.log_nonneg (by linarith) have ha0 : 0 ≤ a := by linarith positivity) (fun a ha => reciprocal_character_profile_doubling hq1 ha) (by intro a b ha hab hb rw [← Finset.sum_filter] simpa only [mul_assoc] using reciprocal_prime_partial_dyadic_shell_bound χ hq hC hbound ha hab hb) hx hxy rw [← Finset.sum_filter] at htail simpa only [mul_assoc] using htail end Bounty.WeakZeroFree /- Quantitative prime-character companions for the 23/24 zero-free strip. -/ open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree theorem reciprocal_prime_induction_error_absorbed {q x : ℝ} (hq : 1 ≤ q) (hx : 2 ≤ x) : 2 * Real.log q / x ≤ 4 * x ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log x) := by have hx0 : 0 < x := by linarith have hlx : 0 < Real.log x := Real.log_pos (by linarith) have hlq : 0 ≤ Real.log q := Real.log_nonneg hq have hr : 0 < x ^ (-(1 : ℝ) / 96) := Real.rpow_pos_of_pos hx0 _ have hp : x ^ ((95 : ℝ) / 96) = x * x ^ (-(1 : ℝ) / 96) := by calc _ = x ^ ((1 : ℝ) + (-(1 : ℝ) / 96)) := by norm_num _ = _ := by rw [Real.rpow_add hx0, Real.rpow_one] have hlog : Real.log x ≤ 2 * (x * x ^ (-(1 : ℝ) / 96)) := by have hh := Real.log_le_rpow_div hx0.le (by norm_num : (0 : ℝ) < 95 / 96) rw [hp] at hh have hxp : 0 ≤ x * x ^ (-(1 : ℝ) / 96) := by positivity linarith have hratio : Real.log x / x ≤ 2 * x ^ (-(1 : ℝ) / 96) := (div_le_iff₀ hx0).mpr (by nlinarith [hlog]) calc 2 * Real.log q / x = (2 * (Real.log q / Real.log x)) * (Real.log x / x) := by field_simp _ ≤ (2 * (Real.log q / Real.log x)) * (2 * x ^ (-(1 : ℝ) / 96)) := mul_le_mul_of_nonneg_left hratio (by positivity) _ ≤ _ := by nlinarith theorem norm_reciprocal_prime_sum_sub_primitive_le_decay {q : ℕ} (hq : 0 < q) (χ : DirichletCharacter ℂ q) (S : Finset ℕ) (hS : ∀ p ∈ S, p.Prime) {a : ℝ} (ha : 2 ≤ a) (haS : ∀ p ∈ S, a ≤ (p : ℝ)) : ‖(∑ p ∈ S, (1 / (p : ℝ)) • χ (p : ZMod q)) - ∑ p ∈ S, (1 / (p : ℝ)) • χ.primitiveCharacter (p : ZMod χ.conductor)‖ ≤ 4 * a ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log a) := by exact (norm_reciprocal_prime_sum_sub_primitive_le_two_log hq χ S hS (by linarith : 0 < a) haS).trans (reciprocal_prime_induction_error_absorbed (by exact_mod_cast hq) ha) end Bounty.WeakZeroFree /- Quantitative prime-character companions for the 23/24 zero-free strip. -/ open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree /- Uniform in the upper endpoint, the modulus, and the nonprincipal character. The lower endpoint retains the full `1/96` power saving. -/ theorem reciprocal_prime_interval_bound_of_zero_free (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ x y : ℝ, 2 ≤ x → x ≤ y → ‖∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ C * x ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log x) := by classical obtain ⟨A, hA, htheta⟩ := primitive_twistedTheta_power_saving_linear_log hZ let D := 8 * A / (1 - (2 : ℝ) ^ (-(1 : ℝ) / 96)) have hr : (2 : ℝ) ^ (-(1 : ℝ) / 96) < 1 := Real.rpow_lt_one_of_one_lt_of_neg (by norm_num) (by norm_num) have hD : 0 < D := by dsimp [D]; positivity refine ⟨D + 4, by positivity, ?_⟩ intro q hq χ hχ x y hx hxy let : NeZero q := ⟨hq.ne'⟩ have hd : 0 < χ.conductor := Nat.pos_of_ne_zero χ.conductor_ne_zero have hdq : χ.conductor ≤ q := Nat.le_of_dvd hq χ.conductor_dvd_level have hprimitive : χ.primitiveCharacter ≠ 1 := by intro he apply hχ rw [← χ.changeLevel_primitiveCharacter, he, map_one] let ψ : OAI.Ostmann.PrimitiveComplexCharacter := ⟨χ.conductor, hd, χ.primitiveCharacter, χ.primitiveCharacter_isPrimitive, hprimitive⟩ have hp := reciprocal_prime_interval_bound_of_theta χ.primitiveCharacter hd hA.le (fun z hz => htheta ψ z hz) hx hxy have hx0 : 0 < x := by linarith have hlx : 0 < Real.log x := Real.log_pos (by linarith) have hd0 : (0 : ℝ) < χ.conductor := by exact_mod_cast hd have hlogs : Real.log (χ.conductor : ℝ) ≤ Real.log (q : ℝ) := Real.log_le_log hd0 (by exact_mod_cast hdq) have hp' : ‖∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ.primitiveCharacter (p : ZMod χ.conductor)‖ ≤ D * x ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log x) := by apply hp.trans change D * x ^ (-(1 : ℝ) / 96) * (1 + Real.log χ.conductor / Real.log x) ≤ _ gcongr have he := norm_reciprocal_prime_sum_sub_primitive_le_decay hq χ ((Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime) (fun p hp => (Finset.mem_filter.mp hp).2) hx (fun p hp => by have hm := (Finset.mem_Ioc.mp (Finset.mem_filter.mp hp).1).1 exact ((Nat.floor_lt hx0.le).mp hm).le) calc _ = ‖((∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ (p : ZMod q)) - (∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ.primitiveCharacter (p : ZMod χ.conductor))) + (∑ p ∈ (Finset.Ioc ⌊x⌋₊ ⌊y⌋₊).filter Nat.Prime, (1 / (p : ℝ)) • χ.primitiveCharacter (p : ZMod χ.conductor))‖ := by rw [sub_add_cancel] _ ≤ _ := (norm_add_le _ _).trans (add_le_add he hp') _ = _ := by ring end Bounty.WeakZeroFree /- Quantitative prime-character companions for the 23/24 zero-free strip. -/ open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree theorem reciprocal_character_profile_antitone {a x Q : ℝ} (ha : 2 ≤ a) (hax : a ≤ x) (hQ : 1 ≤ Q) : x ^ (-(1 : ℝ) / 96) * (1 + Real.log Q / Real.log x) ≤ a ^ (-(1 : ℝ) / 96) * (1 + Real.log Q / Real.log a) := by have ha0 : 0 < a := by linarith have hla : 0 < Real.log a := Real.log_pos (by linarith) have hlog : Real.log a ≤ Real.log x := Real.log_le_log ha0 hax have hlx : 0 < Real.log x := hla.trans_le hlog have hQlog : 0 ≤ Real.log Q := Real.log_nonneg hQ apply mul_le_mul · exact Real.rpow_le_rpow_of_nonpos ha0 hax (by norm_num) · have h := div_le_div_of_nonneg_left hQlog hla hlog linarith · positivity · positivity theorem reciprocal_prime_band_product_interval_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ a b c U V : ℝ, 2 ≤ a → 0 ≤ b → 0 < c → 0 ≤ U → 0 ≤ V → ‖∑ p ∈ (primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V), (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ C * a ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log a) := by obtain ⟨C, hC, hbound⟩ := reciprocal_prime_interval_bound_of_zero_free hZ refine ⟨C, hC, ?_⟩ intro q hq χ hχ a b c U V ha hb hc hU hV rw [primeBand_product_interval (by linarith : 0 ≤ a) hb hc hU hV] let x := max a (U / c) let y := min b (V / c) have hax : a ≤ x := le_max_left _ _ have hx : 2 ≤ x := ha.trans hax have hqR : (1 : ℝ) ≤ q := by exact_mod_cast hq by_cases hxy : x ≤ y · have h := hbound q hq χ hχ x y hx hxy change ‖∑ p ∈ primeBand x y, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ _ at h apply h.trans simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (reciprocal_character_profile_antitone ha hax hqR) hC.le · change ‖∑ p ∈ primeBand x y, (1 / (p : ℝ)) • χ (p : ZMod q)‖ ≤ _ rw [primeBand_eq_empty_of_upper_le (le_of_not_ge hxy), Finset.sum_empty, norm_zero] have hlq : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg hqR have hla : 0 < Real.log a := Real.log_pos (by linarith) positivity end Bounty.WeakZeroFree /- Quantitative prime-character companions for the 23/24 zero-free strip. -/ open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree theorem ordinary_prime_band_product_interval_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ a b c U V : ℝ, 2 ≤ a → 0 ≤ b → 0 < c → 0 ≤ U → 0 ≤ V → ‖∑ p ∈ (primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V), χ (p : ZMod q)‖ ≤ 2 * b * C * a ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log a) := by obtain ⟨C, hC, hbound⟩ := reciprocal_prime_band_product_interval_bound hZ refine ⟨C, hC, ?_⟩ intro q hq χ hχ a b c U V ha hb hc hU hV have haq : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg (by exact_mod_cast hq) have haa : 0 < Real.log a := Real.log_pos (by linarith) have ha0 : 0 ≤ a := by linarith have hB : 0 ≤ C * a ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log a) := by positivity have h := ordinary_sum_le_of_reciprocal_prefix ((primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V)) (fun p => χ (p : ZMod q)) hb hB (fun p hp => ((mem_primeBand_iff ha0 hb p).mp (mem_filter.mp hp).1).1.pos) (fun p hp => ((mem_primeBand_iff ha0 hb p).mp (mem_filter.mp hp).1).2.2) (fun k => by rw [primeBand_product_filter_prefix ha0 hb] exact hbound q hq χ hχ a (min b (k : ℝ)) c U V ha (le_min hb (Nat.cast_nonneg k)) hc hU hV) convert h using 1 ring end Bounty.WeakZeroFree /- Quantitative prime-character companions for the 23/24 zero-free strip. -/ open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree theorem ordinary_prime_band_product_relative_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ a b c U V : ℝ, 2 ≤ a → 0 ≤ b → 0 < c → 0 ≤ U → 0 ≤ V → ‖∑ p ∈ (primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V), χ (p : ZMod q)‖ ≤ 2 * (V / c) * C * a ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log a) := by obtain ⟨C, hC, hbound⟩ := ordinary_prime_band_product_interval_bound hZ refine ⟨C, hC, ?_⟩ intro q hq χ hχ a b c U V ha hb hc hU hV have hqlog : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg (by exact_mod_cast hq) have halog : 0 < Real.log a := Real.log_pos (by linarith) rw [primeBand_product_clip_upper (by linarith) hb hc hU hV] apply (hbound q hq χ hχ a (min b (V / c)) c U V ha (le_min hb (div_nonneg hV hc.le)) hc hU hV).trans gcongr exact min_le_right _ _ theorem ordinary_prime_band_product_coprime_relative_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ a b c U V : ℝ, 2 ≤ a → 0 ≤ b → 0 < c → 0 ≤ U → 0 ≤ V → ∀ m : ℕ, m ≠ 0 → ‖∑ p ∈ ((primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V)).filter (fun p => p.Coprime m), χ (p : ZMod q)‖ ≤ (V / c) * (2 * C * a ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log a) + (m.primeFactors.card : ℝ) / a) := by obtain ⟨C, hC, hbound⟩ := ordinary_prime_band_product_relative_bound hZ refine ⟨C, hC, ?_⟩ intro q hq χ hχ a b c U V ha hb hc hU hV m hm let S := (primeBand a b).filter (fun p : ℕ => U < c * (p : ℝ) ∧ c * (p : ℝ) ≤ V) have hS (p : ℕ) (hp : p ∈ S) : p.Prime ∧ a < (p : ℝ) ∧ (p : ℝ) ≤ b := (mem_primeBand_iff (by linarith) hb p).mp (mem_filter.mp hp).1 have hupper (p : ℕ) (hp : p ∈ S) : (p : ℝ) ≤ V / c := by apply (le_div_iff₀ hc).mpr simpa only [mul_comm] using (mem_filter.mp hp).2.2 have herr := prime_sum_filter_coprime_relative_error S (fun p hp => (hS p hp).1) (fun p => χ (p : ZMod q)) (fun p _ => χ.norm_le_one _) (by linarith : 0 < a) (div_nonneg hV hc.le) (fun p hp => (hS p hp).2.1.le) hupper hm apply herr.trans apply le_trans (add_le_add (hbound q hq χ hχ a b c U V ha hb hc hU hV) le_rfl) exact le_of_eq (by ring) end Bounty.WeakZeroFree /- Quantitative prime-character companions for the 23/24 zero-free strip. -/ open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree theorem prime_coprime_relative_profile_bound {c L C : ℝ} (hc : 0 < c) (hL : 0 < L) (hC : 0 ≤ C) {f m : ℕ} (hf : 0 < f) (hfL : (f : ℝ) ≤ Real.exp L) (hm : m ≠ 0) (hmL : (m : ℝ) ≤ Real.exp L) : 2 * C * (Real.exp (c * L)) ^ (-(1 : ℝ) / 96) * (1 + Real.log (f : ℝ) / Real.log (Real.exp (c * L))) + (m.primeFactors.card : ℝ) / Real.exp (c * L) ≤ (2 * C * (1 + 1 / c)) * Real.exp (-(c / 96) * L) + (1 / Real.log 2) * L * Real.exp (-c * L) := by have hf0 : (0 : ℝ) < f := by exact_mod_cast hf have hm0 : (0 : ℝ) < m := by exact_mod_cast Nat.pos_of_ne_zero hm have hflog : Real.log (f : ℝ) ≤ L := by simpa only [Real.log_exp] using Real.log_le_log hf0 hfL have hmlog : Real.log (m : ℝ) ≤ L := by simpa only [Real.log_exp] using Real.log_le_log hm0 hmL have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) have hcard : (m.primeFactors.card : ℝ) ≤ L / Real.log 2 := (primeFactors_card_le_log_div_log_two (Nat.pos_of_ne_zero hm)).trans (div_le_div_of_nonneg_right hmlog hlog2.le) have hquot : Real.log (f : ℝ) / (c * L) ≤ 1 / c := by apply (div_le_iff₀ (mul_pos hc hL)).mpr calc Real.log (f : ℝ) ≤ L := hflog _ = (1 / c) * (c * L) := by field_simp rw [Real.log_exp, ← Real.exp_mul] have hexp : c * L * (-(1 : ℝ) / 96) = -(c / 96) * L := by ring rw [hexp] calc _ ≤ 2 * C * Real.exp (-(c / 96) * L) * (1 + 1 / c) + (L / Real.log 2) / Real.exp (c * L) := by apply add_le_add · exact mul_le_mul_of_nonneg_left (add_le_add le_rfl hquot) (by positivity) · exact div_le_div_of_nonneg_right hcard (Real.exp_nonneg _) _ = _ := by simp only [neg_mul, Real.exp_neg]; ring theorem eventually_prime_band_coprime_relative_power_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c : ℝ} (hc : 0 < c) (B : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ b t U V : ℝ, 0 ≤ b → 0 < t → 0 ≤ U → 0 ≤ V → ∀ m : ℕ, m ≠ 0 → (m : ℝ) ≤ Real.exp L → ‖∑ p ∈ ((primeBand (Real.exp (c * L)) b).filter (fun p : ℕ => U < t * (p : ℝ) ∧ t * (p : ℝ) ≤ V)).filter (fun p => p.Coprime m), χ (p : ZMod f)‖ ≤ (V / t) * L ^ (-B) := by obtain ⟨C, hC, hbound⟩ := ordinary_prime_band_product_coprime_relative_bound hZ have hlarge : ∀ᶠ L : ℝ in atTop, (2 : ℝ) ≤ Real.exp (c * L) := (Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hc)).eventually_ge_atTop 2 filter_upwards [eventually_linear_exponential_profile_le_rpow (div_pos hc (by norm_num : (0 : ℝ) < 96)) hc (2 * C * (1 + 1 / c)) (1 / Real.log 2) B, hlarge, eventually_gt_atTop (0 : ℝ)] with L hdecay hlarge hL intro f hf hfL χ hχ b t U V hb ht hU hV m hm hmL apply (hbound f hf χ hχ (Real.exp (c * L)) b t U V hlarge hb ht hU hV m hm).trans apply mul_le_mul_of_nonneg_left _ (div_nonneg hV ht.le) exact (prime_coprime_relative_profile_bound hc hL hC.le hf hfL hm hmL).trans hdecay end Bounty.WeakZeroFree /- Quantitative prime-character companions for the 23/24 zero-free strip. -/ open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree theorem eventually_prime_profile_exponential {c : ℝ} (hc : 0 < c) (C D : ℝ) : ∀ᶠ L : ℝ in atTop, C * Real.exp (-(c / 96) * L) + D * L * Real.exp (-c * L) ≤ Real.exp (-(c / 192) * L) := by have hsmall : 0 < c / 192 := div_pos hc (by norm_num) have hlarge : 0 < 191 * c / 192 := by positivity filter_upwards [eventually_linear_exponential_profile_le_rpow hsmall hlarge C D 0] with L hL simp only [neg_zero, Real.rpow_zero] at hL have hx : Real.exp (-(c / 192) * L) * Real.exp (-(c / 192) * L) = Real.exp (-(c / 96) * L) := by rw [← Real.exp_add]; congr 1; ring have hy : Real.exp (-(191 * c / 192) * L) * Real.exp (-(c / 192) * L) = Real.exp (-c * L) := by rw [← Real.exp_add]; congr 1; ring calc _ = (C * Real.exp (-(c / 192) * L) + D * L * Real.exp (-(191 * c / 192) * L)) * Real.exp (-(c / 192) * L) := by rw [add_mul, mul_assoc C, mul_assoc (D * L), hx, hy] _ ≤ 1 * Real.exp (-(c / 192) * L) := mul_le_mul_of_nonneg_right hL (Real.exp_nonneg _) _ = _ := one_mul _ theorem eventually_prime_band_coprime_relative_exponential_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ b t U V : ℝ, 0 ≤ b → 0 < t → 0 ≤ U → 0 ≤ V → ∀ m : ℕ, m ≠ 0 → (m : ℝ) ≤ Real.exp L → ‖∑ p ∈ ((primeBand (Real.exp (c * L)) b).filter (fun p : ℕ => U < t * (p : ℝ) ∧ t * (p : ℝ) ≤ V)).filter (fun p => p.Coprime m), χ (p : ZMod f)‖ ≤ (V / t) * Real.exp (-(c / 192) * L) := by obtain ⟨C, hC, hbound⟩ := ordinary_prime_band_product_coprime_relative_bound hZ have hlarge : ∀ᶠ L : ℝ in atTop, (2 : ℝ) ≤ Real.exp (c * L) := (Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hc)).eventually_ge_atTop 2 filter_upwards [eventually_prime_profile_exponential hc (2 * C * (1 + 1 / c)) (1 / Real.log 2), hlarge, eventually_gt_atTop (0 : ℝ)] with L hdecay hlarge hL intro f hf hfL χ hχ b t U V hb ht hU hV m hm hmL apply (hbound f hf χ hχ (Real.exp (c * L)) b t U V hlarge hb ht hU hV m hm).trans apply mul_le_mul_of_nonneg_left _ (div_nonneg hV ht.le) exact (prime_coprime_relative_profile_bound hc hL hC.le hf hfL hm hmL).trans hdecay end Bounty.WeakZeroFree open Finset Filter open scoped Topology BigOperators namespace Bounty.WeakZeroFree theorem eventually_wide_ambient_prime_cancellation (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {δ σ : ℝ} (hδ : 0 < δ) (hσ : 0 < σ) : ∀ᶠ y : ℝ in atTop, ∀ L : ℕ, 0 < L → Real.log (L : ℝ) ≤ y ^ δ * Real.log (5 * y) → ∀ χ : DirichletCharacter ℂ L, χ ≠ 1 → ‖∑ p ∈ primeBand (y / 4) (5 * y), χ (p : ZMod L)‖ ≤ y ^ ((95 : ℝ) / 96 + 2 * δ + σ) := by obtain ⟨C, hC, hbound⟩ := ordinary_prime_band_product_interval_bound hZ let A : ℝ := 20 * C / (4 : ℝ) ^ (-(1 : ℝ) / 96) filter_upwards [eventually_log_natLog_le_rpow δ hδ, eventually_const_le_mul_rpow hσ (show (0 : ℝ) < 1 by norm_num) A, eventually_ge_atTop (4 * Real.exp 1), eventually_ge_atTop (8 : ℝ)] with y hlog hA hyexp hy8 have hy0 : 0 < y := by linarith have hy1 : 1 ≤ y := by linarith have ha2 : 2 ≤ y / 4 := by linarith have ha0 : 0 < y / 4 := by positivity have hb0 : 0 ≤ 5 * y := by positivity have hden : 1 ≤ Real.log (y / 4) := by calc 1 = Real.log (Real.exp 1) := (Real.log_exp 1).symm _ ≤ Real.log (y / 4) := Real.log_le_log (Real.exp_pos _) (by linarith) have hden0 : 0 < Real.log (y / 4) := by linarith have hpow : 1 ≤ y ^ (2 * δ) := Real.one_le_rpow hy1 (by linarith) intro L hL hLlog χ hχ have hL0 : 0 ≤ Real.log (L : ℝ) := Real.log_nonneg (by exact_mod_cast hL) have hLpow : Real.log (L : ℝ) ≤ y ^ (2 * δ) := by simpa only [two_mul] using (hlog L hLlog).1 have hfrac : Real.log (L : ℝ) / Real.log (y / 4) ≤ y ^ (2 * δ) := by apply le_trans _ hLpow apply (div_le_iff₀ hden0).mpr exact le_mul_of_one_le_right hL0 hden have hfactor : 1 + Real.log (L : ℝ) / Real.log (y / 4) ≤ 2 * y ^ (2 * δ) := by linarith have hfilter : (primeBand (y / 4) (5 * y)).filter (fun p : ℕ => (0 : ℝ) < 1 * (p : ℝ) ∧ 1 * (p : ℝ) ≤ 5 * y) = primeBand (y / 4) (5 * y) := by apply filter_eq_self.mpr intro p hp have hp' := (mem_primeBand_iff ha0.le hb0 p).mp hp simpa only [one_mul] using And.intro (show (0 : ℝ) < p by exact_mod_cast hp'.1.pos) hp'.2.2 have hbasic := hbound L hL χ hχ (y / 4) (5 * y) 1 0 (5 * y) ha2 hb0 (by norm_num) (by norm_num) hb0 rw [hfilter] at hbasic calc _ ≤ 2 * (5 * y) * C * (y / 4) ^ (-(1 : ℝ) / 96) * (1 + Real.log (L : ℝ) / Real.log (y / 4)) := hbasic _ ≤ 2 * (5 * y) * C * (y / 4) ^ (-(1 : ℝ) / 96) * (2 * y ^ (2 * δ)) := mul_le_mul_of_nonneg_left hfactor (by positivity) _ = A * y ^ ((95 : ℝ) / 96 + 2 * δ) := by rw [Real.div_rpow hy0.le (by norm_num)] have h31 : y ^ ((95 : ℝ) / 96) = y * y ^ (-(1 : ℝ) / 96) := by rw [show (95 : ℝ) / 96 = 1 + (-(1 : ℝ) / 96) by norm_num, Real.rpow_add hy0, Real.rpow_one] rw [Real.rpow_add hy0, h31] dsimp only [A] ring _ ≤ y ^ σ * y ^ ((95 : ℝ) / 96 + 2 * δ) := mul_le_mul_of_nonneg_right (by simpa only [one_mul] using hA) (by positivity) _ = y ^ ((95 : ℝ) / 96 + 2 * δ + σ) := by rw [← Real.rpow_add hy0] congr 1 ring theorem wideAmbientPrimeCancellation_of_zero_free (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : WideAmbientPrimeCancellationAt (95 / 96) := by intro δ hδ _ σ hσ exact eventually_wide_ambient_prime_cancellation hZ hδ hσ theorem target_of_wide_smooth_primes_and_zero_free (hS : WideSmoothShiftedPrimeSupply) (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : fcTypeOfName% "Erdos1057.erdos_1057" := by exact target_of_wide_smooth_supply_and_cancellation (by norm_num : (95 : ℝ) / 96 < 1) hS (wideAmbientPrimeCancellation_of_zero_free hZ) theorem target_of_candidate_prime_mass_and_zero_free (hM : CandidateShiftedPrimeMassSupply) (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : fcTypeOfName% "Erdos1057.erdos_1057" := target_of_wide_smooth_primes_and_zero_free (wide_smooth_supply_of_candidate_prime_mass hM) hZ theorem eventually_candidate_Q_prime_exponential_cancellation (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ∀ (a R : ℕ), a ≠ 0 → R ≠ 0 → ‖∑ p ∈ ((candidateQBand (c*L) 0).filter (fun p => p*R ∈ arithmeticProductWindow a (Real.exp L))).filter (fun p => p.Coprime m), χ (p : ZMod f)‖ ≤ ((16*Real.exp L) / ((a*R : ℕ) : ℝ)) * Real.exp (-(c/192)*L) := by filter_upwards [eventually_prime_band_coprime_relative_exponential_bound hZ hc] with L hL intro f hf hfL χ hχ m hm hmL a R ha hR rw [candidate_Q_zero_product_window_eq c L ha] exact hL f hf hfL χ hχ (Real.exp ((6/5 : ℝ)*(c*L))) ((a*R : ℕ) : ℝ) (Real.exp L) (16*Real.exp L) (Real.exp_pos _).le (Nat.cast_pos.mpr (Nat.mul_pos (Nat.pos_of_ne_zero ha) (Nat.pos_of_ne_zero hR))) (Real.exp_pos L).le (by positivity) m hm hmL theorem eventually_candidate_Q_character_exponential_cancellation (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ∀ (r jStar : ℕ) (hr : 0 < r), 0 < jStar → ∀ a : ℕ, a ≠ 0 → ‖∑ n ∈ (arithmeticProductWindow a (Real.exp L)).filter (fun n => n.Coprime m), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod f)‖ ≤ ((16*Real.exp L) / (a : ℝ)) * Real.exp (-(c/192)*L) * candidateQRestHarmonicMass c L r jStar hr := by filter_upwards [eventually_candidate_Q_prime_exponential_cancellation hZ hc] with L hL intro f hf hfL χ hχ m hm hmL r jStar hr hj a ha apply candidate_Q_character_bound_of_prime_bound c L r jStar hr hj (arithmeticProductWindow a (Real.exp L)) χ m ((16*Real.exp L)/(a : ℝ)) (Real.exp (-(c/192)*L)) (by positivity) (Real.exp_nonneg _) intro y have hb := hL f hf hfL χ hχ m hm hmL a (orderedSlotProduct (candidateQRestChoices c L r jStar hr) y) ha (candidate_Q_rest_product_nonzero c L r jStar hr y) simpa only [Nat.cast_mul, div_mul_eq_div_div] using hb theorem eventually_candidate_character_exponential_cancellation (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (q : ℝ), 0 ≤ q → ∀ (r jStar : ℕ) (hr : 0 < r), 0 < jStar → ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ‖∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime m), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod f)‖ ≤ (16*Real.exp L) * Real.exp (-(c/192)*L) * candidateOneMarkedHarmonicMass c L q * candidateQRestHarmonicMass c L r jStar hr := by filter_upwards [eventually_candidate_character_coprime_convolution hc, eventually_candidate_Q_character_exponential_cancellation hZ hc, eventually_ge_atTop (0 : ℝ)] with L hconv hQ hL intro q hq r jStar hr hj f hf hfL χ hχ m hm hmL let R : ℝ := candidateQRestHarmonicMass c L r jStar hr let C : ℝ := (16*Real.exp L) * Real.exp (-(c/192)*L) * R have hR : 0 ≤ R := candidate_Q_rest_harmonic_nonneg c L r jStar hr have hC : 0 ≤ C := by dsimp only [C]; positivity have htest := hconv q r jStar f m χ (fun _ => 1) simp only [mul_one] at htest rw [htest] calc _ ≤ ∑ a ∈ (candidateSmallPSet c L (16*Real.exp L + 1)).filter (fun a => a.Coprime m), ‖(candidatePWeight c L q a : ℂ) * χ (a : ZMod f) * ∑ n ∈ (arithmeticProductWindow a (Real.exp L)).filter (fun n => n.Coprime m), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod f)‖ := norm_sum_le _ _ _ ≤ ∑ a ∈ (candidateSmallPSet c L (16*Real.exp L + 1)).filter (fun a => a.Coprime m), (candidatePWeight c L q a / (a : ℝ)) * C := by apply sum_le_sum intro a ha have hWa := candidate_P_weight_nonneg c L hq a have ha0 : a ≠ 0 := candidate_small_P_set_nonzero (mem_filter.mp ha).1 have hi := hQ f hf hfL χ hχ m hm hmL r jStar hr hj a ha0 rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_of_nonneg hWa] calc _ ≤ candidatePWeight c L q a * ‖∑ n ∈ (arithmeticProductWindow a (Real.exp L)).filter (fun n => n.Coprime m), (candidateQWeight c L r jStar n : ℂ) * χ (n : ZMod f)‖ := by apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) exact mul_le_of_le_one_right hWa (χ.norm_le_one _) _ ≤ candidatePWeight c L q a * (((16*Real.exp L)/(a : ℝ)) * Real.exp (-(c/192)*L) * R) := mul_le_mul_of_nonneg_left hi hWa _ = _ := by dsimp only [C]; ring _ ≤ ∑ a ∈ candidateSmallPSet c L (16*Real.exp L + 1), (candidatePWeight c L q a / (a : ℝ)) * C := by apply sum_le_sum_of_subset_of_nonneg (filter_subset _ _) intro a _ _ exact mul_nonneg (div_nonneg (candidate_P_weight_nonneg c L hq a) (Nat.cast_nonneg a)) hC _ = (∑ a ∈ candidateSmallPSet c L (16*Real.exp L + 1), candidatePWeight c L q a / (a : ℝ)) * C := (sum_mul _ _ _).symm _ ≤ candidateOneMarkedHarmonicMass c L q * C := by apply mul_le_mul_of_nonneg_right _ hC exact candidate_full_P_harmonic_sum_le_total (mul_nonneg hc.le hL) hq _ = _ := by dsimp only [C, R]; ring theorem exists_candidate_character_relative_exponential_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) : ∃ J : ℕ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → ∀ (f : ℕ), 0 < f → (f : ℝ) ≤ Real.exp L → ∀ χ : DirichletCharacter ℂ f, χ ≠ 1 → ∀ (m : ℕ), m ≠ 0 → (m : ℝ) ≤ Real.exp L → ‖∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => u.Coprime m), (candidateCoefficient c L q r jStar u : ℂ) * χ (u : ZMod f)‖ ≤ candidateCoefficientWindowMass c L q r jStar * Real.exp (-(c/384)*L) := by obtain ⟨V, hV, hrest⟩ := exists_candidate_Q_rest_harmonic_upper hc r hr obtain ⟨K, hK, J, hlower⟩ := exists_candidate_coefficient_window_mass_lower hc hr hq0 hq1 hcenter have hsmall := eventually_linear_exponential_profile_le_rpow (div_pos hc (by norm_num : (0 : ℝ) < 384)) (div_pos hc (by norm_num : (0 : ℝ) < 384)) 0 ((16*V)/K) 0 simp only [zero_mul, zero_add, neg_zero, Real.rpow_zero] at hsmall refine ⟨J, ?_⟩ filter_upwards [eventually_candidate_character_exponential_cancellation hZ hc, hrest, hlower, hsmall, eventually_candidate_one_marked_mass_ge_one hc hq0 hq1.le, eventually_gt_atTop (0 : ℝ)] with L hcancel hrestL hlowerL hsmallL hPone hL intro jStar hj f hf hfL χ hχ m hm hmL have hj0 : 0 < jStar := (Nat.zero_le J).trans_lt hj have hP : 0 ≤ candidateOneMarkedHarmonicMass c L q := zero_le_one.trans hPone have hQ : 0 ≤ candidateQHarmonicMass c L r jStar := by apply tsum_nonneg intro n exact div_nonneg (candidate_Q_weight_nonneg c L r jStar n) (Nat.cast_nonneg n) have hexp : Real.exp (-(c/384)*L) * Real.exp (-(c/384)*L) = Real.exp (-(c/192)*L) := by rw [← Real.exp_add]; congr 1; ring have hdecay : ((16*V)/K) * L * Real.exp (-(c/192)*L) ≤ Real.exp (-(c/384)*L) := by calc _ = (((16*V)/K) * L * Real.exp (-(c/384)*L)) * Real.exp (-(c/384)*L) := by rw [mul_assoc (((16*V)/K)*L), hexp] _ ≤ 1 * Real.exp (-(c/384)*L) := mul_le_mul_of_nonneg_right hsmallL (Real.exp_nonneg _) _ = _ := one_mul _ calc _ ≤ (16*Real.exp L) * Real.exp (-(c/192)*L) * candidateOneMarkedHarmonicMass c L q * candidateQRestHarmonicMass c L r jStar hr := hcancel q hq0 r jStar hr hj0 f hf hfL χ hχ m hm hmL _ ≤ (16*Real.exp L) * Real.exp (-(c/192)*L) * candidateOneMarkedHarmonicMass c L q * (V * candidateQHarmonicMass c L r jStar) := mul_le_mul_of_nonneg_left (hrestL jStar hj0) (by positivity) _ = (((16*V)/K) * L * Real.exp (-(c/192)*L)) * (K * (Real.exp L/L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar) := by field_simp _ ≤ Real.exp (-(c/384)*L) * (K * (Real.exp L/L) * candidateOneMarkedHarmonicMass c L q * candidateQHarmonicMass c L r jStar) := mul_le_mul_of_nonneg_right hdecay (by positivity) _ ≤ Real.exp (-(c/384)*L) * candidateCoefficientWindowMass c L q r jStar := mul_le_mul_of_nonneg_left (hlowerL jStar hj) (Real.exp_nonneg _) _ = _ := mul_comm _ _ theorem exists_candidate_exponential_conductor_range_power_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (B : ℝ) : ∃ J : ℕ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, J < jStar → ∀ N R : ℕ, (N : ℝ) ≤ Real.exp L → (R : ℝ) ≤ Real.exp ((c/512)*L) → candidateSmallPrimitiveTypeIMass c L q r jStar N R ≤ candidateCoefficientWindowMass c L q r jStar * L^(-B) := by obtain ⟨J, hnorm⟩ := exists_candidate_character_relative_exponential_bound hZ hc hr hq0 hq1 hcenter have hdecay := eventually_linear_exponential_profile_le_rpow (by positivity : 0 < c/1536) (by positivity : 0 < c/1536) 0 (4*primeEulerProductUpperConstant) B simp only [zero_mul, zero_add] at hdecay refine ⟨J, ?_⟩ filter_upwards [hnorm, hdecay, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (Real.log 2)] with L hnormL hdecayL hL1 hlog2 intro jStar hj N R hN hR have hL : 0 < L := lt_of_lt_of_le zero_lt_one hL1 let XA := candidateCoefficientWindowMass c L q r jStar have hXA : 0 ≤ XA := by apply sum_nonneg intro u _ exact candidate_coefficient_nonneg c L hq0 r jStar u have hweight : 0 ≤ XA * Real.exp (-(c/384)*L) := by positivity have hD : 1 ≤ Real.exp L := by exact (Real.one_le_exp_iff).mpr hL.le have hbound := candidate_small_primitive_mass_le c L q r jStar N R (fun _ => XA * Real.exp (-(c/384)*L)) (fun _ _ => hweight) hD hN (by intro d hd f hf ψ _ hψ have hdpos : 0 < d := (mem_Icc.mp (mem_filter.mp hd).1).1 have hdN : d ≤ N := (mem_Icc.mp (mem_filter.mp hd).1).2 have hffilt := mem_filter.mp hf have hfpos : 0 < f := lt_trans Nat.zero_lt_one hffilt.2.1 have hfdvd : f ∣ d := Nat.dvd_of_mem_divisors hffilt.1 have hfle : f ≤ d := Nat.le_of_dvd hdpos hfdvd have hfL : (f : ℝ) ≤ Real.exp L := (Nat.cast_le.mpr (hfle.trans hdN)).trans hN have hdf : d/f ≠ 0 := (Nat.div_pos hfle hfpos).ne' have hdfL : ((d/f : ℕ) : ℝ) ≤ Real.exp L := (Nat.cast_le.mpr ((Nat.div_le_self d f).trans hdN)).trans hN exact hnormL jStar hj f hfpos hfL ψ hψ (d/f) hdf hdfL) have hlog : Real.log (2*Real.exp L) ≤ 2*L := by rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) (Real.exp_ne_zero L), Real.log_exp] linarith have hlog0 : 0 ≤ Real.log (2*Real.exp L) := by rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) (Real.exp_ne_zero L), Real.log_exp] positivity have hcardN : (Icc 2 R).card ≤ R := by rw [Nat.card_Icc]; omega have hcard : ((Icc 2 R).card : ℝ) ≤ Real.exp ((c/512)*L) := (Nat.cast_le.mpr hcardN).trans hR have hsum : (∑ _f ∈ Icc 2 R, XA * Real.exp (-(c/384)*L)) ≤ Real.exp ((c/512)*L) * (XA * Real.exp (-(c/384)*L)) := by simp only [sum_const, nsmul_eq_mul] exact mul_le_mul_of_nonneg_right hcard hweight calc _ ≤ ((2*primeEulerProductUpperConstant) * Real.log (2*Real.exp L)) * ∑ _f ∈ Icc 2 R, XA * Real.exp (-(c/384)*L) := hbound _ ≤ ((2*primeEulerProductUpperConstant) * (2*L)) * (Real.exp ((c/512)*L) * (XA * Real.exp (-(c/384)*L))) := by apply mul_le_mul · exact mul_le_mul_of_nonneg_left hlog (by positivity [primeEulerProductUpperConstant_pos]) · exact hsum · exact sum_nonneg (fun _ _ => hweight) · positivity [primeEulerProductUpperConstant_pos] _ = XA * ((4*primeEulerProductUpperConstant) * L * Real.exp (-(c/1536)*L)) := by have hexp : Real.exp ((c/512)*L) * Real.exp (-(c/384)*L) = Real.exp (-(c/1536)*L) := by rw [← Real.exp_add]; congr 1; ring calc _ = XA * ((4*primeEulerProductUpperConstant) * L * (Real.exp ((c/512)*L) * Real.exp (-(c/384)*L))) := by ring _ = _ := by rw [hexp] _ ≤ XA * L^(-B) := mul_le_mul_of_nonneg_left hdecayL hXA theorem exists_candidate_relative_typeI_remainder_bound_of_large (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q θ : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hθ : θ ≤ 1) (hlarge : ∀ B : ℝ, ∀ᶠ L : ℝ in atTop, ∀ jStar : ℕ, 0 < jStar → ∀ N : ℕ, (N : ℝ) ≤ Real.exp (θ * L) → candidateLargePrimitiveTypeIMass c L q r jStar N ⌊Real.exp ((c/512)*L)⌋₊ ≤ Real.exp L * L^(-B)) (D : ℝ) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, ∀ N : ℕ, (N : ℝ) ≤ Real.exp (θ * L) → (∑ d ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d|) ≤ candidateCoefficientWindowMass c L q r jStar * (L^(-D) + (16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := by obtain ⟨C, _, Jmass, hmass⟩ := exists_candidate_coefficient_mass_polynomial_lower hc hr hq0 hq1 hcenter obtain ⟨Jsmall, hsmall⟩ := exists_candidate_exponential_conductor_range_power_bound hZ hc hr hq0 hq1 hcenter (D + 1) refine ⟨max Jmass Jsmall, ?_⟩ intro jStar hj have hjmass : Jmass < jStar := lt_of_le_of_lt (le_max_left _ _) hj have hjsmall : Jsmall < jStar := lt_of_le_of_lt (le_max_right _ _) hj have hjpos : 0 < jStar := lt_of_le_of_lt (Nat.zero_le _) hj filter_upwards [hmass jStar hjmass, hsmall, hlarge (C + D + 1), eventually_candidate_typeI_remainder_le_primitive hc, eventually_ge_atTop (2 : ℝ)] with L hm hs hl hrem hL intro N hN have hL0 : 0 ≤ L := by linarith have hN' : (N : ℝ) ≤ Real.exp L := hN.trans (Real.exp_le_exp.mpr (by nlinarith only [hθ, hL0])) have hR : (⌊Real.exp ((c/512)*L)⌋₊ : ℝ) ≤ Real.exp ((c/512)*L) := Nat.floor_le (Real.exp_pos _).le have hprim := candidate_primitive_typeI_relative_bound_of_split c L q C D r jStar N ⌊Real.exp ((c/512)*L)⌋₊ hL hm (hs jStar hjsmall N _ hN' hR) (hl jStar hjpos N hN) calc _ ≤ candidatePrimitiveTypeIMass c L q r jStar N + candidateCoefficientWindowMass c L q r jStar * ((16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := hrem q hq0 r jStar N hN' _ ≤ candidateCoefficientWindowMass c L q r jStar * L^(-D) + candidateCoefficientWindowMass c L q r jStar * ((16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := add_le_add hprim le_rfl _ = _ := (mul_add _ _ _).symm theorem exists_candidate_relative_typeI_remainder_power_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q θ : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ) * (r : ℝ) * c = 1) (hθ : θ < 1/2) (D : ℝ) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, ∀ N : ℕ, (N : ℝ) ≤ Real.exp (θ * L) → (∑ d ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d|) ≤ candidateCoefficientWindowMass c L q r jStar * (L^(-D) + (16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := by apply exists_candidate_relative_typeI_remainder_bound_of_large hZ hc hr hq0 hq1 hcenter (by linarith : θ ≤ 1) ?_ D intro B exact eventually_candidate_large_primitive_power_saving hc hr hcenter hq0 hq1 hθ B theorem exists_candidate_shifted_rough_mass_estimate (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ K : ℝ, 0 < K ∧ ∀ (c q b : ℝ) (r h : ℕ), 0 < c → 0 < r → 0 ≤ q → q < 1 → (11/5 : ℝ) * (r : ℝ) * c = 1 → 0 < b → 1 ≤ h → Even h → b * (4 * (h : ℝ) + 2) < 1/2 → ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, |candidateShiftedRoughMass c L q r jStar (Real.exp (b * L)) - candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L))| ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * (K * Real.exp (-(h : ℝ)) + L^(-16 : ℝ)) := by obtain ⟨K, hK, hsieve⟩ := exists_shifted_totient_rough_sieve refine ⟨K, hK, ?_⟩ intro c q b r h hc hr hq0 hq1 hcenter hb hh heven hlevel let theta : ℝ := (b * (4 * (h : ℝ) + 2) + 1/2) / 2 have htheta : theta < 1/2 := by dsimp [theta]; linarith only [hlevel] obtain ⟨J, hdist⟩ := exists_candidate_relative_typeI_remainder_power_bound hZ hc hr hq0 hq1 hcenter htheta (18 : ℝ) refine ⟨J, ?_⟩ intro jStar hj filter_upwards [hdist jStar hj, eventually_candidate_midpoint_sieve_scale hb h hlevel, eventually_shifted_avoidance_absorbs_power hb (1 + 16 * primeEulerProductUpperConstant) (by positivity [primeEulerProductUpperConstant_pos])] with L hd hscale habs let N : ℕ := ⌊Real.exp (theta * L)⌋₊ have hN : (N : ℝ) ≤ Real.exp (theta * L) := Nat.floor_le (Real.exp_pos _).le have hXA : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro u _ exact candidate_coefficient_nonneg c L hq0 r jStar u have hsub : blockSieveModuli ((primeBand 0 (Real.exp (b * L))).erase 2) ((Real.exp (b * L))^(4 * (h : ℝ) + 2)) ⊆ oddSquarefreeModuli N := by apply odd_sieve_moduli_subset · intro p hp exact small_prime_pool_prime (mem_of_mem_erase hp) · intro p hp exact (mem_erase.mp hp).1 · exact hscale.2.1 have herror : (∑ d ∈ blockSieveModuli ((primeBand 0 (Real.exp (b * L))).erase 2) ((Real.exp (b * L))^(4 * (h : ℝ) + 2)), |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d|) ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * L^(-16 : ℝ) := by calc _ ≤ ∑ d ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d| := sum_le_sum_of_subset_of_nonneg hsub (fun _ _ _ => abs_nonneg _) _ ≤ candidateCoefficientWindowMass c L q r jStar * (L^(-18 : ℝ) + (16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := hd N hN _ = candidateCoefficientWindowMass c L q r jStar * ((1 + 16 * primeEulerProductUpperConstant) * L^(-18 : ℝ)) := by ring _ ≤ candidateCoefficientWindowMass c L q r jStar * (shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * L^(-16 : ℝ)) := mul_le_mul_of_nonneg_left habs hXA _ = _ := by ring have hs := hsieve (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) hscale.1 hh heven (fun u _ => candidate_coefficient_nonneg c L hq0 r jStar u) change |candidateShiftedRoughMass c L q r jStar (Real.exp (b * L)) - candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L))| ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * K * Real.exp (-(h : ℝ)) + _ at hs calc _ ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * K * Real.exp (-(h : ℝ)) + ∑ d ∈ blockSieveModuli ((primeBand 0 (Real.exp (b * L))).erase 2) ((Real.exp (b * L))^(4 * (h : ℝ) + 2)), |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) d| := hs _ ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * K * Real.exp (-(h : ℝ)) + candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b * L)) * L^(-16 : ℝ) := add_le_add le_rfl herror _ = _ := by ring theorem exists_candidate_shifted_rough_mass_density_lower (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ K : ℝ, 0 < K ∧ ∀ (c q b : ℝ) (r h : ℕ), 0 < c → 0 < r → 0 ≤ q → q < 1 → (11/5 : ℝ)*(r : ℝ)*c = 1 → 0 < b → 1 ≤ h → Even h → b*(4*(h : ℝ)+2) < 1/2 → ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ((shiftedSieveRatioConstant*Mertens.primeProductLimitConstant/b)* (1-K*Real.exp (-(h : ℝ)))-ε) * candidateCoefficientWindowMass c L q r jStar / L ≤ candidateShiftedRoughMass c L q r jStar (Real.exp (b*L)) := by obtain ⟨K, hK, hmass⟩ := exists_candidate_shifted_rough_mass_estimate hZ refine ⟨K, hK, ?_⟩ intro c q b r h hc hr hq0 hq1 hcenter hb hh heven hlevel obtain ⟨J, hJ⟩ := hmass c q b r h hc hr hq0 hq1 hcenter hb hh heven hlevel refine ⟨J, ?_⟩ intro jStar hj ε hε have hpow : Tendsto (fun L : ℝ => L^(-16 : ℝ)) atTop (𝓝 0) := tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 16) have hlim := (exponential_shifted_prime_avoidance_product_tendsto hb).mul (hpow.const_sub (1-K*Real.exp (-(h : ℝ)))) simp only [sub_zero] at hlim have hev := hlim.eventually_const_lt (show (shiftedSieveRatioConstant*Mertens.primeProductLimitConstant/b)* (1-K*Real.exp (-(h : ℝ)))-ε < (shiftedSieveRatioConstant*Mertens.primeProductLimitConstant/b)* (1-K*Real.exp (-(h : ℝ))) by linarith) filter_upwards [hJ jStar hj, hev, eventually_gt_atTop (0 : ℝ)] with L hm hd hL have hXA : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro u _ exact candidate_coefficient_nonneg c L hq0 r jStar u have hlower : candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b*L)) * (1-K*Real.exp (-(h : ℝ))-L^(-16 : ℝ)) ≤ candidateShiftedRoughMass c L q r jStar (Real.exp (b*L)) := by have h := (neg_le_neg hm).trans (neg_abs_le _) nlinarith calc _ ≤ ((L*shiftedPrimeAvoidanceProduct (Real.exp (b*L)))* (1-K*Real.exp (-(h : ℝ))-L^(-16 : ℝ))) * candidateCoefficientWindowMass c L q r jStar / L := by exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hd.le hXA) hL.le _ = candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (b*L)) * (1-K*Real.exp (-(h : ℝ))-L^(-16 : ℝ)) := by field_simp _ ≤ _ := hlower theorem exists_candidate_prime_band_sqrt_rough_mass_estimate (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ K : ℝ, 0 < K ∧ ∀ (c q a v : ℝ) (r : ℕ), 0 < c → 0 < r → 0 ≤ q → q < 1 → (11/5 : ℝ)*(r : ℝ)*c = 1 → 0 < a → a ≤ v → v < 1/2 → ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, |candidatePrimeBandRoughMass c L q r jStar (Real.exp (a*L)) (Real.exp (v*L)) (Real.exp (Real.sqrt L)) - candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (Real.sqrt L)) * (∑ p ∈ primeBand (Real.exp (a*L)) (Real.exp (v*L)), 1 / ((p : ℝ)-1))| ≤ candidateCoefficientWindowMass c L q r jStar * shiftedPrimeAvoidanceProduct (Real.exp (Real.sqrt L)) * (∑ p ∈ primeBand (Real.exp (a*L)) (Real.exp (v*L)), 1 / ((p : ℝ)-1)) * K * Real.exp (-(roughCellSieveOrder L : ℝ)) + candidateCoefficientWindowMass c L q r jStar * ((1+16*primeEulerProductUpperConstant)*L^(-18 : ℝ)) := by classical obtain ⟨K, hK, hsieve⟩ := exists_summed_external_odd_prime_shifted_sieve refine ⟨K, hK, ?_⟩ intro c q a v r hc hr hq0 hq1 hcenter ha hav hvhalf let theta : ℝ := (v+1/2)/2 have htheta : theta < 1/2 := by dsimp [theta]; linarith only [hvhalf] have hv : 0 < v := ha.trans_le hav have hgap : 0 < theta-v := by dsimp [theta]; linarith only [hvhalf] have hmid : v+(theta-v)/2 < theta := by linarith have hbase : 0 ≤ v+(theta-v)/2 := by positivity obtain ⟨J, hdist⟩ := exists_candidate_relative_typeI_remainder_power_bound hZ hc hr hq0 hq1 hcenter htheta (18 : ℝ) refine ⟨J, ?_⟩ intro jStar hj filter_upwards [hdist jStar hj, eventually_exp_le_floor_exp hbase hmid, eventually_rough_cell_sieve_parameters hgap, eventually_rough_test_proxy_cutoff ha, eventually_gt_atTop (0 : ℝ), eventually_ge_atTop (Real.log 2/a)] with L hd hscale hpar hcut hL hLa let N : ℕ := ⌊Real.exp (theta*L)⌋₊ let P : Finset ℕ := (primeBand 0 (Real.exp (Real.sqrt L))).erase 2 let Q : Finset ℕ := primeBand (Real.exp (a*L)) (Real.exp (v*L)) have hz : 1 < Real.exp (Real.sqrt L) := hpar.2.2.1 have hP : ∀ p ∈ P, p.Prime := fun p hp => small_prime_pool_prime (mem_of_mem_erase hp) have hQ : ∀ p ∈ Q, p.Prime := by intro p hp exact ((mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le p).mp hp).1 have hQlower : ∀ p ∈ Q, Real.exp (a*L) < (p : ℝ) := by intro p hp exact ((mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le p).mp hp).2.1 have hQupper : ∀ p ∈ Q, (p : ℝ) ≤ Real.exp (v*L) := by intro p hp exact ((mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le p).mp hp).2.2 have hQodd : ∀ p ∈ Q, p ≠ 2 := by have hexp : 2 ≤ Real.exp (a*L) := by rw [← Real.exp_log (by norm_num : (0 : ℝ)<2)] apply Real.exp_le_exp.mpr have := (div_le_iff₀ ha).mp hLa nlinarith only [this] intro p hp heq have hp' := hQlower p hp norm_num [heq] at hp' linarith have hout : ∀ p ∈ Q, p ∉ P := by intro p hp hpP have hpmax := small_prime_pool_le (Real.exp_pos (Real.sqrt L)).le (mem_of_mem_erase hpP) have hcutexp : Real.exp (Real.sqrt L) ≤ Real.exp (a*L) := Real.exp_le_exp.mpr hcut exact (not_lt_of_ge (hpmax.trans hcutexp)) (hQlower p hp) have hprodlevel : ∀ p ∈ Q, ∀ d ∈ blockSieveModuli P ((Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ)+2)), p*d ≤ N := by intro p hp d hd have hdmax := (block_sieve_modulus_properties P hP _ hd).2.1 have hprod : (p : ℝ)*(d : ℝ) ≤ Real.exp ((v+(theta-v)/2)*L) := by calc _ ≤ Real.exp (v*L)*((Real.exp (Real.sqrt L))^(4*(roughCellSieveOrder L : ℝ)+2)) := mul_le_mul (hQupper p hp) hdmax (Nat.cast_nonneg d) (Real.exp_pos _).le _ ≤ Real.exp (v*L)*Real.exp (((theta-v)/2)*L) := mul_le_mul_of_nonneg_left hpar.2.2.2.1 (Real.exp_pos _).le _ = _ := by rw [← Real.exp_add] congr 1 ring exact_mod_cast hprod.trans hscale have hs := hsieve P Q (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) N hz hpar.1 hpar.2.1 hP (fun p hp => (mem_erase.mp hp).1) (fun p hp => small_prime_pool_le (Real.exp_pos _).le (mem_of_mem_erase hp)) hQ hQodd hout (fun u _ => candidate_coefficient_nonneg c L hq0 r jStar u) hprodlevel have hmass : (∑ p ∈ Q, ∑ u ∈ (arithmeticProductWindow 1 (Real.exp L)).filter (fun u => p ∣ 2*u+1 ∧ ∀ q ∈ P, ¬q ∣ 2*u+1), candidateCoefficient c L q r jStar u) = candidatePrimeBandRoughMass c L q r jStar (Real.exp (a*L)) (Real.exp (v*L)) (Real.exp (Real.sqrt L)) := by unfold candidatePrimeBandRoughMass apply sum_congr rfl intro p hp rw [shifted_rough_prime_filter_eq _ (Real.exp_pos _).le] rw [hmass] at hs have hN : (N : ℝ) ≤ Real.exp (theta*L) := Nat.floor_le (Real.exp_pos _).le have herr := hd N hN have herr' : (∑ m ∈ oddSquarefreeModuli N, |shiftedTotientSieveRemainder (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L q r jStar) m|) ≤ candidateCoefficientWindowMass c L q r jStar * ((1+16*primeEulerProductUpperConstant)*L^(-18 : ℝ)) := by convert herr using 1; ring exact hs.trans (add_le_add le_rfl herr') theorem exists_candidate_prime_band_sqrt_rough_mass_density_upper (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q a v : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11/5 : ℝ)*(r : ℝ)*c = 1) (ha : 0 < a) (hav : a ≤ v) (hvhalf : v < 1/2) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, candidatePrimeBandRoughMass c L q r jStar (Real.exp (a*L)) (Real.exp (v*L)) (Real.exp (Real.sqrt L)) ≤ (shiftedSieveRatioConstant*Mertens.primeProductLimitConstant*Real.log (v/a)+ε)* candidateCoefficientWindowMass c L q r jStar / Real.sqrt L := by obtain ⟨K, hK, hmass⟩ := exists_candidate_prime_band_sqrt_rough_mass_estimate hZ obtain ⟨J, hJ⟩ := hmass c q a v r hc hr hq0 hq1 hcenter ha hav hvhalf refine ⟨J, ?_⟩ intro jStar hj ε hε have hinv : Tendsto (fun L : ℝ => L^(-1 : ℝ)) atTop (𝓝 0) := tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 1) have hpow : Tendsto (fun L : ℝ => L^(-17 : ℝ)) atTop (𝓝 0) := tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 17) have hlim := ((sqrt_shifted_prime_avoidance_product_tendsto.mul (exponential_prime_predecessor_reciprocal_tendsto ha hav)).mul (hinv.const_add 1)).add (hpow.const_mul (1+16*primeEulerProductUpperConstant)) simp only [add_zero, mul_one, mul_zero] at hlim have hev := hlim.eventually_lt_const (show shiftedSieveRatioConstant*Mertens.primeProductLimitConstant*Real.log (v/a) < shiftedSieveRatioConstant*Mertens.primeProductLimitConstant*Real.log (v/a)+ε by linarith) filter_upwards [hJ jStar hj, hev, eventually_rough_cell_order_error_le ha hK.le (-1) 1, eventually_ge_atTop (1 : ℝ)] with L hm hd heL hL let X := candidateCoefficientWindowMass c L q r jStar let V := shiftedPrimeAvoidanceProduct (Real.exp (Real.sqrt L)) let H := ∑ p ∈ primeBand (Real.exp (a*L)) (Real.exp (v*L)), 1/((p : ℝ)-1) let C := 1+16*primeEulerProductUpperConstant have hL0 : 0 < L := zero_lt_one.trans_le hL have hsqrt : 0 < Real.sqrt L := Real.sqrt_pos.mpr hL0 have hX : 0 ≤ X := by apply sum_nonneg intro u _ exact candidate_coefficient_nonneg c L hq0 r jStar u have hV : 0 ≤ V := (shifted_prime_avoidance_product_pos _).le have hH : 0 ≤ H := by apply sum_nonneg intro p hp have hpprime := ((mem_primeBand_iff (Real.exp_pos _).le (Real.exp_pos _).le p).mp hp).1 have hp2 : (2 : ℝ) ≤ p := by exact_mod_cast hpprime.two_le exact div_nonneg (by norm_num) (by linarith) have hC : 0 ≤ C := by dsimp [C]; positivity [primeEulerProductUpperConstant_pos] have he : K*Real.exp (-(roughCellSieveOrder L : ℝ)) ≤ L^(-1 : ℝ) := by have hp : 0 ≤ L^((-1 : ℝ)+1)*Real.exp (-(a/2)*L) := by positivity nlinarith only [heL, hp, hK] have hpow_id : L*L^(-18 : ℝ)=L^(-17 : ℝ) := by calc _ = L^(1 : ℝ)*L^(-18 : ℝ) := by rw [Real.rpow_one] _ = _ := by rw [← Real.rpow_add hL0]; norm_num have hpow_bound : Real.sqrt L*L^(-18 : ℝ) ≤ L^(-17 : ℝ) := by rw [← hpow_id] exact mul_le_mul_of_nonneg_right (Real.sqrt_le_self_iff.mpr (Or.inr hL)) (by positivity) have hmain : 0 ≤ X*V*H := mul_nonneg (mul_nonneg hX hV) hH have hupper : candidatePrimeBandRoughMass c L q r jStar (Real.exp (a*L)) (Real.exp (v*L)) (Real.exp (Real.sqrt L)) ≤ X*V*H*(1+L^(-1 : ℝ))+X*C*L^(-18 : ℝ) := by have hb := (le_abs_self _).trans hm change _ ≤ X*V*H*K*Real.exp (-(roughCellSieveOrder L : ℝ))+ X*(C*L^(-18 : ℝ)) at hb have he' := mul_le_mul_of_nonneg_left he hmain nlinarith only [hb, he'] apply (le_div_iff₀ hsqrt).mpr calc _ ≤ (X*V*H*(1+L^(-1 : ℝ))+X*C*L^(-18 : ℝ))*Real.sqrt L := mul_le_mul_of_nonneg_right hupper hsqrt.le _ = X*((Real.sqrt L*V*H)*(1+L^(-1 : ℝ))+C*(Real.sqrt L*L^(-18 : ℝ))) := by ring _ ≤ X*((Real.sqrt L*V*H)*(1+L^(-1 : ℝ))+C*L^(-17 : ℝ)) := by gcongr _ ≤ _ := by have hh := mul_le_mul_of_nonneg_left hd.le hX change X*((Real.sqrt L*V*H)*(1+L^(-1 : ℝ))+C*L^(-17 : ℝ)) ≤ _ at hh simpa only [mul_comm] using hh theorem exists_candidate_unbalanced_proxy_upper (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q a v : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11 / 5 : ℝ) * (r : ℝ) * c = 1) (ha : 0 < a) (hav : a ≤ v) (hvhalf : v < 1 / 2) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ M : ℝ, 0 ≤ M → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ (F : Finset (ℕ × ℕ)) (f : ℕ → ℝ) (u : ℕ × ℕ → ℕ), (∀ w ∈ F, u w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 ∈ primeBand (Real.exp (a * L)) (Real.exp (v * L)) ∧ w.1 * w.2 = 2 * u w + 1) → (∀ w ∈ F, 0 ≤ f w.2 ∧ f w.2 ≤ M / (Mertens.primeProductLimitConstant * Real.sqrt L)) → (∀ w ∈ F, f w.2 ≠ 0 → ∀ p ∈ w.2.primeFactors, Real.exp (Real.sqrt L) < (p : ℝ)) → (∑ w ∈ F, candidateCoefficient c L q r jStar (u w) * f w.2) ≤ (shiftedSieveRatioConstant * M * Real.log (v / a) + ε) * candidateCoefficientWindowMass c L q r jStar / L := by obtain ⟨J, hJ⟩ := exists_candidate_prime_band_sqrt_rough_mass_density_upper hZ hc hr hq0 hq1 hcenter ha hav hvhalf refine ⟨J, ?_⟩ intro jStar hj M hM ε hε let K := Mertens.primeProductLimitConstant have hK : 0 < K := Mertens.prime_product_limit_constant_pos let δ := ε * K / (M + 1) have hδ : 0 < δ ∧ M * δ / K ≤ ε := proxy_mass_error_budget hK hM hε filter_upwards [hJ jStar hj δ hδ.1, eventually_rough_test_proxy_cutoff ha, eventually_gt_atTop (0 : ℝ)] with L hmass hcut hL intro F f u hdata hf hrough have hs : 0 < Real.sqrt L := Real.sqrt_pos.mpr hL have hC : 0 ≤ M / (K * Real.sqrt L) := div_nonneg hM (mul_pos hK hs).le have hbridge := candidate_prime_factor_proxy_bound (c := c) r jStar hq0 (Real.exp_nonneg _) (Real.exp_nonneg _) (Real.exp_le_exp.mpr hcut) hC F f u hdata hf hrough have hX : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro n hn exact candidate_coefficient_nonneg c L hq0 r jStar n calc _ ≤ (M / (K * Real.sqrt L)) * candidatePrimeBandRoughMass c L q r jStar (Real.exp (a * L)) (Real.exp (v * L)) (Real.exp (Real.sqrt L)) := hbridge _ ≤ (M / (K * Real.sqrt L)) * ((shiftedSieveRatioConstant * K * Real.log (v / a) + δ) * candidateCoefficientWindowMass c L q r jStar / Real.sqrt L) := mul_le_mul_of_nonneg_left hmass hC _ = (shiftedSieveRatioConstant * M * Real.log (v / a) + M * δ / K) * candidateCoefficientWindowMass c L q r jStar / L := sqrt_proxy_mass_product hK hL _ _ _ _ _ _ ≤ _ := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right (add_le_add le_rfl hδ.2) hX) hL.le theorem exists_candidate_unbalanced_rough_logarithmic_proxy_upper (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q a v : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11 / 5 : ℝ) * (r : ℝ) * c = 1) (ha : 0 < a) (hav : a ≤ v) (hvhalf : v < 1 / 2) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ M : ℝ, 0 ≤ M → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ (γ S : ℝ) (F : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ), (∀ w ∈ F, u w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 ∈ primeBand (Real.exp (a * L)) (Real.exp (v * L)) ∧ w.1 * w.2 = 2 * u w + 1) → (∀ w ∈ F, roughTestCellProxyCoefficient γ L S (logarithmicCellBase (L ^ (-S)) (logarithmicCellIndex (L ^ (-S)) w.2)) ≤ M / (Mertens.primeProductLimitConstant * Real.sqrt L)) → (∑ w ∈ F, candidateCoefficient c L q r jStar (u w) * roughTestLogarithmicProxy γ L S w.2) ≤ (shiftedSieveRatioConstant * M * Real.log (v / a) + ε) * candidateCoefficientWindowMass c L q r jStar / L := by obtain ⟨J, hJ⟩ := exists_candidate_unbalanced_proxy_upper hZ hc hr hq0 hq1 hcenter ha hav hvhalf refine ⟨J, ?_⟩ intro jStar hj M hM ε hε filter_upwards [hJ jStar hj M hM ε hε, eventually_gt_atTop (0 : ℝ)] with L hbound hL intro γ S F u hdata hcoef apply hbound F (roughTestLogarithmicProxy γ L S) u hdata · intro w hw refine ⟨rough_test_logarithmic_proxy_nonneg γ L S w.2, ?_⟩ exact rough_test_logarithmic_proxy_le_coefficient (div_nonneg hM (mul_pos Mertens.prime_product_limit_constant_pos (Real.sqrt_pos.mpr hL)).le) (hcoef w hw) · intro w hw hne exact rough_test_logarithmic_proxy_support hne theorem exists_candidate_unbalanced_rough_bin_upper_uniform_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q γ a v M : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11 / 5 : ℝ) * (r : ℝ) * c = 1) (hγ : 0 < γ) (ha : 0 < a) (hav : a ≤ v) (hvhalf : v < 1 / 2) (hvγ : v < 1 - γ) (hM : 0 ≤ M) (hdensity : ∀ α ∈ Set.Icc a v, buchstabDensity γ (1 - α) ≤ M) : ∃ J : ℕ, ∀ S : ℝ, 0 ≤ S → ∀ jStar : ℕ, J < jStar → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ (F : Finset (ℕ × ℕ)) (u : ℕ × ℕ → ℕ), (∀ w ∈ F, u w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 ∈ primeBand (Real.exp (a * L)) (Real.exp (v * L)) ∧ w.1 * w.2 = 2 * u w + 1) → (∑ w ∈ F, candidateCoefficient c L q r jStar (u w) * roughTestLogarithmicProxy γ L S w.2) ≤ (shiftedSieveRatioConstant * M * Real.log (v / a) + ε) * candidateCoefficientWindowMass c L q r jStar / L := by obtain ⟨J, hJ⟩ := exists_candidate_unbalanced_rough_logarithmic_proxy_upper hZ hc hr hq0 hq1 hcenter ha hav hvhalf refine ⟨J, ?_⟩ intro S hS jStar hj ε hε let R := shiftedSieveRatioConstant * Real.log (v / a) let η := ε / (2 * (|R| + 1)) have hη : 0 < η ∧ R * η ≤ ε / 2 := half_error_density_slack hε filter_upwards [hJ jStar hj (M + η) (by positivity) (ε / 2) (by positivity), eventually_cofactor_rough_test_coefficient_upper hγ ha hav hvγ (by norm_num : (0 : ℝ) < 2) (by norm_num : (0 : ℝ) < 33) hS hdensity hη.1, eventually_gt_atTop (0 : ℝ)] with L hbound hcoef hL intro F u hdata have hb := hbound γ S F u hdata (by intro w hw obtain ⟨huw, hpw, hprod⟩ := hdata w hw obtain ⟨hm, hlo, hhi⟩ := arithmetic_window_cofactor_product_bounds hL.le huw hprod exact hcoef w.1 w.2 hpw hm hlo hhi) have hX : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro n hn exact candidate_coefficient_nonneg c L hq0 r jStar n apply hb.trans apply div_le_div_of_nonneg_right _ hL.le apply mul_le_mul_of_nonneg_right _ hX dsimp [R] at hη nlinarith [hη.2] theorem exists_candidate_unbalanced_rough_finite_bins_upper_uniform_precision {ι : Type*} [Fintype ι] (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q : ℝ} {r : ℕ} {γ a v M : ι → ℝ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11 / 5 : ℝ) * (r : ℝ) * c = 1) (hγ : ∀ i, 0 < γ i) (ha : ∀ i, 0 < a i) (hav : ∀ i, a i ≤ v i) (hvhalf : ∀ i, v i < 1 / 2) (hvγ : ∀ i, v i < 1 - γ i) (hM : ∀ i, 0 ≤ M i) (hdensity : ∀ i, ∀ α ∈ Set.Icc (a i) (v i), buchstabDensity (γ i) (1 - α) ≤ M i) : ∃ J : ℕ, ∀ S : ℝ, 0 ≤ S → ∀ jStar : ℕ, J < jStar → ∀ ε : ℝ, 0 < ε → ∀ᶠ L : ℝ in atTop, ∀ (F : ι → Finset (ℕ × ℕ)) (u : ι → ℕ × ℕ → ℕ), (∀ i, ∀ w ∈ F i, u i w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 ∈ primeBand (Real.exp (a i * L)) (Real.exp (v i * L)) ∧ w.1 * w.2 = 2 * u i w + 1) → (∑ i, ∑ w ∈ F i, candidateCoefficient c L q r jStar (u i w) * roughTestLogarithmicProxy (γ i) L S w.2) ≤ (shiftedSieveRatioConstant * (∑ i, M i * Real.log (v i / a i)) + ε) * candidateCoefficientWindowMass c L q r jStar / L := by classical have hbins := fun i => exists_candidate_unbalanced_rough_bin_upper_uniform_precision hZ hc hr hq0 hq1 hcenter (hγ i) (ha i) (hav i) (hvhalf i) (hvγ i) (hM i) (hdensity i) choose Js hJs using hbins refine ⟨Finset.univ.sup Js, ?_⟩ intro S hS jStar hj ε hε let δ := ε / ((Fintype.card ι : ℝ) + 1) have hden : 0 < (Fintype.card ι : ℝ) + 1 := by positivity have hδ : 0 < δ := div_pos hε hden have hδeq : ((Fintype.card ι : ℝ) + 1) * δ = ε := by dsimp [δ] field_simp have hδerror : (Fintype.card ι : ℝ) * δ ≤ ε := by nlinarith have hbinEvent := fun i => hJs i S hS jStar (lt_of_le_of_lt (Finset.le_sup (Finset.mem_univ i)) hj) δ hδ have hEvent := Filter.eventually_all.mpr hbinEvent filter_upwards [hEvent, eventually_gt_atTop (0 : ℝ)] with L hbound hL intro F u hdata have hX : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro n hn exact candidate_coefficient_nonneg c L hq0 r jStar n have hsum : (∑ i, (shiftedSieveRatioConstant * M i * Real.log (v i / a i) + δ)) = shiftedSieveRatioConstant * (∑ i, M i * Real.log (v i / a i)) + (Fintype.card ι : ℝ) * δ := by simp only [sum_add_distrib, sum_const, card_univ, nsmul_eq_mul] rw [mul_sum] congr 1 apply sum_congr rfl intro i hi ring calc (∑ i, ∑ w ∈ F i, candidateCoefficient c L q r jStar (u i w) * roughTestLogarithmicProxy (γ i) L S w.2) ≤ ∑ i, (shiftedSieveRatioConstant * M i * Real.log (v i / a i) + δ) * candidateCoefficientWindowMass c L q r jStar / L := by apply sum_le_sum intro i hi exact hbound i (F i) (u i) (hdata i) _ = (shiftedSieveRatioConstant * (∑ i, M i * Real.log (v i / a i)) + (Fintype.card ι : ℝ) * δ) * candidateCoefficientWindowMass c L q r jStar / L := by rw [← sum_div, ← sum_mul, hsum] _ ≤ (shiftedSieveRatioConstant * (∑ i, M i * Real.log (v i / a i)) + ε) * candidateCoefficientWindowMass c L q r jStar / L := by apply div_le_div_of_nonneg_right _ hL.le exact mul_le_mul_of_nonneg_right (by linarith [hδerror]) hX theorem exists_candidate_positive_proxy_gap_uniform_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q : ℝ} {r : ℕ} (hc : 0 < c) (hr : 0 < r) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcenter : (11 / 5 : ℝ) * (r : ℝ) * c = 1) : ∃ κ qCut b : ℝ, ∃ h N : ℕ, ∃ M : Fin N → ℝ, 0 < κ ∧ κ ≤ 1 / 50 ∧ qCut = 1 / 2 - κ ∧ 0 < qCut ∧ qCut < 1 / 2 ∧ 0 < b ∧ b < qCut ∧ 1 ≤ h ∧ Even h ∧ b * (4 * (h : ℝ) + 2) < 1 / 2 ∧ 0 < N ∧ (∀ i : Fin N, reciprocalGrid b qCut N (i : ℕ) < reciprocalGrid b qCut N ((i : ℕ) + 1) ∧ 0 < M i ∧ ∀ α ∈ Set.Icc (reciprocalGrid b qCut N (i : ℕ)) (reciprocalGrid b qCut N ((i : ℕ) + 1)), buchstabDensity (reciprocalGrid b qCut N (i : ℕ)) (1 - α) ≤ M i) ∧ (∑ i : Fin N, M i * Real.log (reciprocalGrid b qCut N ((i : ℕ) + 1) / reciprocalGrid b qCut N (i : ℕ))) ≤ buchstabDensity b 1 - 1 + 1 / 16 ∧ ∃ J : ℕ, ∀ S : ℝ, 0 ≤ S → ∀ jStar : ℕ, J < jStar → ∀ᶠ L : ℝ in atTop, ∀ (F : Fin N → Finset (ℕ × ℕ)) (u : Fin N → ℕ × ℕ → ℕ) (B : Finset (ℕ × ℕ)) (uB : ℕ × ℕ → ℕ), (∀ i, ∀ w ∈ F i, u i w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 ∈ primeBand (Real.exp (reciprocalGrid b qCut N (i : ℕ) * L)) (Real.exp (reciprocalGrid b qCut N ((i : ℕ) + 1) * L)) ∧ w.1 * w.2 = 2 * u i w + 1) → (∀ w ∈ B, balancedPairWindow κ L w ∧ uB w ∈ arithmeticProductWindow 1 (Real.exp L) ∧ w.1 * w.2 = 2 * uB w + 1) → (shiftedSieveRatioConstant / 3) * candidateCoefficientWindowMass c L q r jStar / L ≤ candidateShiftedRoughMass c L q r jStar (Real.exp (b * L)) - (∑ i : Fin N, ∑ w ∈ F i, candidateCoefficient c L q r jStar (u i w) * roughTestLogarithmicProxy (reciprocalGrid b qCut N (i : ℕ)) L S w.2) - ∑ w ∈ B, candidateCoefficient c L q r jStar (uB w) * primeLogarithmicProxy L S w.1 * primeLogarithmicProxy L S w.2 := by obtain ⟨Kpre, hKpre, hpre⟩ := exists_candidate_shifted_rough_mass_density_lower hZ obtain ⟨Cbal, hCbal, Jbal, hbal⟩ := exists_candidate_balanced_logarithmic_prime_proxy_bound hc hr hq0 hq1 hcenter obtain ⟨κ, qCut, b, h, N, M, hκ, hκup, hqCut, hqCut0, hqCuthalf, hb, hbq, hh, heven, hlevel, hκloss, hN, hbins, hmesh, hmargin⟩ := exists_positive_buchstab_mesh_parameters Kpre Cbal hCbal.le have hstart (i : Fin N) : 0 < reciprocalGrid b qCut N (i : ℕ) := hb.trans_le (reciprocal_grid_mem hbq.le hN (Nat.le_of_lt i.isLt)).1 have hend (i : Fin N) : reciprocalGrid b qCut N ((i : ℕ) + 1) < 1 / 2 := (reciprocal_grid_mem hbq.le hN (Nat.succ_le_of_lt i.isLt)).2.trans_lt hqCuthalf have hgap (i : Fin N) : reciprocalGrid b qCut N ((i : ℕ) + 1) < 1 - reciprocalGrid b qCut N (i : ℕ) := by have hs := (reciprocal_grid_mem hbq.le hN (Nat.le_of_lt i.isLt)).2 have he := hend i linarith refine ⟨κ, qCut, b, h, N, M, hκ, hκup, hqCut, hqCut0, hqCuthalf, hb, hbq, hh, heven, hlevel, hN, hbins, hmesh, ?_⟩ obtain ⟨Junbal, hunbal⟩ := exists_candidate_unbalanced_rough_finite_bins_upper_uniform_precision hZ hc hr hq0 hq1 hcenter hstart hstart (fun i => (hbins i).1.le) hend hgap (fun i => (hbins i).2.1.le) (fun i => (hbins i).2.2) obtain ⟨Jpre, hprebound⟩ := hpre c q b r h hc hr hq0 hq1 hcenter hb hh heven hlevel refine ⟨max Jpre (max Junbal Jbal), ?_⟩ intro S hS jStar hj have hjpre : Jpre < jStar := lt_of_le_of_lt (le_max_left _ _) hj have hjunbal : Junbal < jStar := lt_of_le_of_lt ((le_max_left Junbal Jbal).trans (le_max_right Jpre _)) hj have hjbal : Jbal < jStar := lt_of_le_of_lt ((le_max_right Junbal Jbal).trans (le_max_right Jpre _)) hj have hd : 0 < shiftedSieveRatioConstant := lt_of_lt_of_le zero_lt_one shifted_sieve_ratio_constant_bounds.1 have hε : 0 < shiftedSieveRatioConstant / 24 := by positivity filter_upwards [hprebound jStar hjpre _ hε, hunbal S hS jStar hjunbal _ hε, hbal S hS, eventually_proxy_gap_reciprocal_bound (C := Cbal) hd] with L hpreL hunbalL hbalL htail intro F u B uB hF hB have hX : 0 ≤ candidateCoefficientWindowMass c L q r jStar := by apply sum_nonneg intro n hn exact candidate_coefficient_nonneg c L hq0 r jStar n have hu := hunbalL F u hF have hbL := hbalL κ hκ.le hκup jStar hjbal B uB (fun w hw => (hB w hw).1) (fun w hw => (hB w hw).2.2) have hm : shiftedSieveRatioConstant / 2 < (shiftedSieveRatioConstant * Mertens.primeProductLimitConstant / b) * (1 - Kpre * Real.exp (-(h : ℝ))) - shiftedSieveRatioConstant * (∑ i : Fin N, M i * Real.log (reciprocalGrid b qCut N ((i : ℕ) + 1) / reciprocalGrid b qCut N (i : ℕ))) - Cbal * κ := by convert hmargin using 1 ring exact candidate_proxy_gap_arithmetic hd htail.1 hX htail.2 hm hpreL hu hbL theorem candidate_shifted_prime_fraction_of_fixed_slot_error_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q : ℝ} {r : ℕ} (hc : 0 (2*u+1).Prime), candidateCoefficient c L q r jStar u := by classical obtain ⟨κ,qCut,b,h,N,M,hκ,hκmax,hqCut,hqCut0,hqCuthalf,hb,hbq,hh,heven,hlevel,hN,hbins,hmesh,hgap⟩ := exists_candidate_positive_proxy_gap_uniform_precision hZ hc hr hq0 hq1 hcenter subst qCut obtain ⟨Jerr,herr⟩ := hR κ b N hκ hκmax hb hbq hN obtain ⟨Jgap,hgapAll⟩ := hgap refine ⟨max Jerr Jgap,?_⟩ intro jStar hj have hjerr := lt_of_le_of_lt (le_max_left Jerr Jgap) hj have hjgap := lt_of_le_of_lt (le_max_right Jerr Jgap) hj obtain ⟨S,hS,herrS⟩ := herr jStar hjerr have hratio : 0 shiftedPrimeBandPairs T (Real.exp (reciprocalGrid b (1/2-κ) N (i:ℕ)*L)) (Real.exp (reciprocalGrid b (1/2-κ) N ((i:ℕ)+1)*L)) let B := shiftedBalancedPairs T κ L have hμ : ∀u∈T,0≤μ u := fun u _ => candidate_coefficient_nonneg c L hq0 r jStar u have hX : 0≤X := sum_nonneg hμ have hpos := hpositive F (fun _ => shiftedPairIndex) B shiftedPairIndex (fun i v hv => shifted_prime_band_pair_data T _ _ hv) (fun v hv => by have hd := shifted_balanced_pair_data T κ L hv exact ⟨hd.2.1,hd.1,hd.2.2⟩) have hlo := hlower μ S hμ let E := ambientBuchstabMeshError T μ b (1/2-κ) κ L S N let U := ambientBuchstabUnbalancedProxy T μ b (1/2-κ) L S N let BP := ambientBuchstabBalancedProxy T μ κ L S let R := candidateShiftedRoughMass c L q r jStar (Real.exp (b*L)) change (shiftedSieveRatioConstant/3)*X/L ≤ R-U-BP at hpos change R-U-BP-E ≤ ∑ u∈(shiftedRoughSet T (Real.exp (b*L))).filter (fun u=>(2*u+1).Prime),μ u at hlo have hscalar : ((N:ℝ)+1)*L^(-2:ℝ) ≤ (shiftedSieveRatioConstant/12)/L := by rw [Real.rpow_neg hL.le,Real.rpow_two,← div_eq_mul_inv] have hbig := (div_le_iff₀ hratio).mp hLbig apply (div_le_iff₀ (sq_pos_of_pos hL)).mpr have heq : ((shiftedSieveRatioConstant/12)/L)*L^2=shiftedSieveRatioConstant*L/12 := by field_simp rw [heq] linarith have hE : E ≤ (shiftedSieveRatioConstant/12)*X/L := by have he := (le_abs_self E).trans herror have hh := mul_le_mul_of_nonneg_left hscalar hX calc E ≤ ((N:ℝ)+1)*X*L^(-2:ℝ) := he _ = X*(((N:ℝ)+1)*L^(-2:ℝ)) := by ring _ ≤ X*((shiftedSieveRatioConstant/12)/L) := hh _ = _ := by ring have hprime : (shiftedSieveRatioConstant/4)*X/L ≤ ∑ u∈(shiftedRoughSet T (Real.exp (b*L))).filter (fun u=>(2*u+1).Prime),μ u := by have heq : (shiftedSieveRatioConstant/4)*X/L= (shiftedSieveRatioConstant/3)*X/L-(shiftedSieveRatioConstant/12)*X/L := by ring rw [heq] linarith apply hprime.trans apply sum_le_sum_of_subset_of_nonneg · intro u hu exact mem_filter.mpr ⟨(mem_shifted_rough_set_iff T _ u).mp (mem_filter.mp hu).1 |>.1, (mem_filter.mp hu).2⟩ · intro u hu hnot exact hμ u (mem_filter.mp hu).1 theorem candidate_shifted_prime_mass_supply_of_half_fixed_slot_replacement (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (hR : CandidateHalfFixedSlotReplacement) : CandidateShiftedPrimeMassSupply := by apply candidate_shifted_prime_mass_supply_of_half_positive_fraction intro c r hc hr hcenter obtain ⟨J, hJ⟩ := candidate_shifted_prime_fraction_of_fixed_slot_error_bound hZ hc (by omega : 0 < r) (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) < 1) hcenter (hR c r hc hr hcenter) refine ⟨J, ?_⟩ intro jStar hj refine ⟨shiftedSieveRatioConstant/4, ?_, hJ jStar hj⟩ have hratio : 0 < shiftedSieveRatioConstant := lt_of_lt_of_le zero_lt_one shifted_sieve_ratio_constant_bounds.1 positivity theorem target_of_candidate_half_fixed_slot_replacement (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (hR : CandidateHalfFixedSlotReplacement) : fcTypeOfName% "Erdos1057.erdos_1057" := target_of_candidate_prime_mass_and_zero_free (candidate_shifted_prime_mass_supply_of_half_fixed_slot_replacement hZ hR) hZ theorem target_of_candidate_half_fixed_slot_components (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (hR : CandidateHalfFixedSlotComponentBounds) : fcTypeOfName% "Erdos1057.erdos_1057" := target_of_candidate_half_fixed_slot_replacement hZ (candidate_half_fixed_slot_replacement_of_component_bounds hR) theorem target_of_candidate_half_active_blocks (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (hB : CandidateHalfActiveBlockBounds) : fcTypeOfName% "Erdos1057.erdos_1057" := target_of_candidate_half_fixed_slot_components hZ (candidate_half_components_of_active_blocks hB) theorem target_of_actual_zero_free_and_candidate_half_active_blocks (hB : CandidateHalfActiveBlockBounds) : fcTypeOfName% "Erdos1057.erdos_1057" := target_of_candidate_half_active_blocks actual_zero_free hB end Bounty.WeakZeroFree end section -- Source module: WeakAnalyticLeaves /- Weaker-zero-free companions for the prime-memory and Mellin estimate chains. -/ open Finset Filter open scoped Topology BigOperators Classical universe u v namespace Bounty.WeakZeroFree theorem prime_tuple_cell_bound_of_zero_free (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (q : ℕ), 0 < q → ∀ χ : DirichletCharacter ℂ q, χ ≠ 1 → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → 0 < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ U W : ℝ, 0 ≤ U → 0 ≤ W → ‖∑ x : (∀ j, P j), (finiteProductWeight (physicalLabelLaw V) x : ℂ) * (if U < ((∏ j, (x j).val : ℕ) : ℝ) ∧ ((∏ j, (x j).val : ℕ) : ℝ) ≤ W then χ ((∏ j, (x j).val : ℕ) : ZMod q) else 0)‖ ≤ (C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log a) := by obtain ⟨C, hC, hbound⟩ := reciprocal_prime_band_product_interval_bound hZ refine ⟨C, hC, ?_⟩ intro q hq χ hχ I _ _ P V i hV hp hmass a b hPi ha hb U W hU hW have hqR : (1 : ℝ) ≤ q := by exact_mod_cast hq have hlq : 0 ≤ Real.log (q : ℝ) := Real.log_nonneg hqR have hla : 0 < Real.log a := Real.log_pos (by linarith) have hB : 0 ≤ C * a ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log a) := by positivity have h := prime_tuple_cell_norm_le P V i hV hp hmass χ U W hB (fun c hc => by rw [hPi] simpa only [Nat.cast_mul] using hbound q hq χ hχ a b (c : ℝ) U W ha hb (by exact_mod_cast hc) hU hW) calc _ ≤ (C * a ^ (-(1 : ℝ) / 96) * (1 + Real.log q / Real.log a)) / V i := h _ = _ := by ring theorem prime_tuple_cell_correlation_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (q r : ℕ), 0 < q → 0 < r → ∀ (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r), χ.IsPrimitive → ψ.IsPrimitive → (⟨q, χ⟩ : (n : ℕ) × DirichletCharacter ℂ n) ≠ ⟨r, ψ⟩ → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → 0 < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ U W : ℝ, 0 ≤ U → 0 ≤ W → ‖∑ x : (∀ j, P j), (finiteProductWeight (physicalLabelLaw V) x : ℂ) * (if U < ((∏ j, (x j).val : ℕ) : ℝ) ∧ ((∏ j, (x j).val : ℕ) : ℝ) ≤ W then χ ((∏ j, (x j).val : ℕ) : ZMod q) * star (ψ ((∏ j, (x j).val : ℕ) : ZMod r)) else 0)‖ ≤ (C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (q * r : ℕ) / Real.log a) := by obtain ⟨C, hC, hbound⟩ := prime_tuple_cell_bound_of_zero_free hZ refine ⟨C, hC, ?_⟩ intro q r hq hr χ ψ hχ hψ hne I _ _ P V i hV hp hmass a b hPi ha hb U W hU hW have hn := primitive_product_level_mul_star_ne_one χ ψ hq hr hχ hψ hne have h := hbound (q * r) (Nat.mul_pos hq hr) (χ.changeLevel (Nat.dvd_mul_right q r) * star (ψ.changeLevel (Nat.dvd_mul_left r q))) hn P V i hV hp hmass a b hPi ha hb U W hU hW simpa only [product_level_mul_star_nat_apply] using h theorem prime_tuple_log_cell_correlation_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ (q r : ℕ), 0 < q → 0 < r → ∀ (χ : DirichletCharacter ℂ q) (ψ : DirichletCharacter ℂ r), χ.IsPrimitive → ψ.IsPrimitive → (⟨q, χ⟩ : (n : ℕ) × DirichletCharacter ℂ n) ≠ ⟨r, ψ⟩ → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → 0 < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h : ℝ, 0 < h → ∀ d : ℤ, ‖∑ x : (∀ j, P j), if upperLogCell h (Real.log (∏ j, (x j).val : ℕ)) = d then (finiteProductWeight (physicalLabelLaw V) x : ℂ) * χ ((∏ j, (x j).val : ℕ) : ZMod q) * star (ψ ((∏ j, (x j).val : ℕ) : ZMod r)) else 0‖ ≤ (C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (q * r : ℕ) / Real.log a) := by obtain ⟨C, hC, hbound⟩ := prime_tuple_cell_correlation_bound hZ refine ⟨C, hC, ?_⟩ intro q r hq hr χ ψ hχ hψ hne I _ _ P V i hV hp hmass a b hPi ha hb h hh d let U := Real.exp (((d : ℝ) - 1) * h) let W := Real.exp ((d : ℝ) * h) have hbnd := hbound q r hq hr χ ψ hχ hψ hne P V i hV hp hmass a b hPi ha hb U W (Real.exp_pos _).le (Real.exp_pos _).le have heq (x : ∀ j, P j) : (if upperLogCell h (Real.log (∏ j, (x j).val : ℕ)) = d then (finiteProductWeight (physicalLabelLaw V) x : ℂ) * χ ((∏ j, (x j).val : ℕ) : ZMod q) * star (ψ ((∏ j, (x j).val : ℕ) : ZMod r)) else 0) = (finiteProductWeight (physicalLabelLaw V) x : ℂ) * (if U < ((∏ j, (x j).val : ℕ) : ℝ) ∧ ((∏ j, (x j).val : ℕ) : ℝ) ≤ W then χ ((∏ j, (x j).val : ℕ) : ZMod q) * star (ψ ((∏ j, (x j).val : ℕ) : ZMod r)) else 0) := by have hn : 0 < ∏ j, (x j).val := Finset.prod_pos (fun j _ => hp j _ (x j).property) simp only [upper_log_cell_nat_eq_iff hh hn] change (if U < _ ∧ _ ≤ W then _ else _) = _ split_ifs <;> simp only [mul_assoc, mul_zero] rw [Finset.sum_congr rfl (fun x _ => heq x)] exact hbnd theorem prime_tuple_log_cell_kernel_energy (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ {T : Type*} [Fintype T] (q : T → ℕ) (χ : (t : T) → DirichletCharacter ℂ (q t)), (∀ t, 0 < q t) → (∀ t, (χ t).IsPrimitive) → Function.Injective (fun t => (⟨q t, χ t⟩ : (n : ℕ) × DirichletCharacter ℂ n)) → ∀ Q : ℕ, 0 < Q → (∀ t, q t ≤ Q) → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → 0 < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → (∀ t j p, p ∈ P j → p.Coprime (q t)) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h ξ : ℝ, 0 < h → 0 < ξ → ∀ kept : Finset ℤ, (∀ d ∈ kept, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) → (Fintype.card T - 1 : ℕ) * (((C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 → ∀ f : (∀ j, P j) → ℂ, (∑ x, finiteProductWeight (physicalLabelLaw (P := P) V) x * ‖∑ y, (finiteProductWeight (physicalLabelLaw (P := P) V) y : ℂ) * finiteCellFrameKernel (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun z => upperLogCell h (Real.log (∏ j, (z j).val : ℕ))) kept (fun t z => star (χ t ((∏ j, (z j).val : ℕ) : ZMod (q t)))) x y * f y‖ ^ 2) ≤ 4 * ∑ x, finiteProductWeight (physicalLabelLaw (P := P) V) x * ‖f x‖ ^ 2 := by obtain ⟨C, hC, hbnd⟩ := prime_tuple_log_cell_correlation_bound hZ refine ⟨C, hC, ?_⟩ intro T _ q χ hq hχ hinj Q hQ hqQ I _ _ P V i hV hp hmass hcop a b hPi ha hb h ξ hh hξ kept hkept hsmall f have hVi := hV i have ha0 : 0 < a := by linarith have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hQ1 : (1 : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Nat.mul_ne_zero (Nat.ne_of_gt hQ) (Nat.ne_of_gt hQ)) have hδ : 0 ≤ (C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a) := by have := Real.log_nonneg hQ1 positivity refine finite_cell_kernel_energy_of_raw_gram (finiteProductWeight (physicalLabelLaw (P := P) V)) ?_ (fun z => upperLogCell h (Real.log (∏ j, (z j).val : ℕ))) kept hδ hξ hkept (fun t z => star (χ t ((∏ j, (z j).val : ℕ) : ZMod (q t)))) ?_ hsmall ?_ f · intro x exact Finset.prod_nonneg (fun j _ => physical_label_law_nonneg V (fun k => (hV k).le) j (x j)) · intro t x _ rw [norm_star] exact prime_tuple_character_norm_one P (χ t) (hcop t) x · intro d hd t s hts have hraw := hbnd (q t) (q s) (hq t) (hq s) (χ t) (χ s) (hχ t) (hχ s) (fun he => hts (hinj he)) P V i hV hp hmass a b hPi ha hb h hh d have hqprod : (0 : ℝ) < (q t * q s : ℕ) := by exact_mod_cast Nat.mul_pos (hq t) (hq s) have hprod : (q t * q s : ℕ) ≤ Q * Q := Nat.mul_le_mul (hqQ t) (hqQ s) have hlogs : Real.log (q t * q s : ℕ) ≤ Real.log (Q * Q : ℕ) := Real.log_le_log hqprod (by exact_mod_cast hprod) have hmono : (C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (q t * q s : ℕ) / Real.log a) ≤ (C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a) := mul_le_mul_of_nonneg_left (add_le_add le_rfl (div_le_div_of_nonneg_right hlogs hlog.le)) (by positivity) simpa only [starRingEnd_apply, star_star] using hraw.trans hmono theorem bounded_primitive_smallness (Q : ℕ) {V C a ξ : ℝ} (hV : 0 < V) (hC : 0 < C) (ha : 2 ≤ a) (hQ : 0 < Q) (hξ : 0 < ξ) (hsmall : (Q * Q - 1 : ℕ) * (((C / V) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1) : (Fintype.card (BoundedPrimitiveCharacter Q) - 1 : ℕ) * (((C / V) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 := by have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hQ1 : (1 : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Nat.mul_ne_zero (Nat.ne_of_gt hQ) (Nat.ne_of_gt hQ)) have hδ : 0 ≤ ((C / V) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ := by have := Real.log_nonneg hQ1 positivity have hcard : (Fintype.card (BoundedPrimitiveCharacter Q) - 1 : ℕ) ≤ Q * Q - 1 := Nat.sub_le_sub_right (bounded_primitive_character_card_le Q) 1 exact (mul_le_mul_of_nonneg_right (by exact_mod_cast hcard) hδ).trans hsmall theorem prime_product_ideal_kernel_energy (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → p.Prime ∧ Q < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h ξ : ℝ, 0 < h → 0 < ξ → ∀ kept : Finset ℤ, (∀ d ∈ kept, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) → (Q * Q - 1 : ℕ) * (((C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 → ∀ f : (∀ j, P j) → ℂ, (∑ x, finiteProductWeight (physicalLabelLaw V) x * ‖∑ y, (finiteProductWeight (physicalLabelLaw V) y : ℂ) * primeProductIdealKernel P V Q h kept x y * f y‖ ^ 2) ≤ 4 * ∑ x, finiteProductWeight (physicalLabelLaw V) x * ‖f x‖ ^ 2 := by obtain ⟨C, hC, hbnd⟩ := prime_tuple_log_cell_kernel_energy hZ refine ⟨C, hC, ?_⟩ intro Q hQ I _ _ P V i hV hp hmass a b hPi ha hb h ξ hh hξ kept hkept hsmall f have hs := bounded_primitive_smallness Q (hV i) hC ha hQ hξ hsmall change _ ≤ _ unfold primeProductIdealKernel have test := hbnd (T := BoundedPrimitiveCharacter Q) boundedPrimitiveModulus boundedPrimitiveValue bounded_primitive_modulus_pos bounded_primitive_value_primitive (bounded_primitive_character_injective Q) Q hQ bounded_primitive_modulus_le P V i hV (fun j p h => (hp j p h).1.pos) hmass (fun t j p h => prime_above_modulus_coprime (hp j p h).1 (bounded_primitive_modulus_pos t) (bounded_primitive_modulus_le t) (hp j p h).2) a b hPi ha hb h ξ hh hξ kept hkept hs f exact test theorem prime_family_log_cell_gram (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → 0 < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h : ℝ, 0 < h → ∀ d : ℤ, ∀ t s : BoundedPrimitiveCharacter Q, t ≠ s → ‖∑ x : (∀ j, P j), if upperLogCell h (Real.log (∏ j, (x j).val : ℕ)) = d then (finiteProductWeight (physicalLabelLaw V) x : ℂ) * boundedPrimitiveValue t ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus t)) * star (boundedPrimitiveValue s ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus s))) else 0‖ ≤ (C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a) := by obtain ⟨C, hC, hbnd⟩ := prime_tuple_log_cell_correlation_bound hZ refine ⟨C, hC, ?_⟩ intro Q hQ I _ _ P V i hV hp hmass a b hPi ha hb h hh d t s hts have hVi := hV i have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hraw := hbnd (boundedPrimitiveModulus t) (boundedPrimitiveModulus s) (bounded_primitive_modulus_pos t) (bounded_primitive_modulus_pos s) (boundedPrimitiveValue t) (boundedPrimitiveValue s) (bounded_primitive_value_primitive t) (bounded_primitive_value_primitive s) (fun he => hts (bounded_primitive_character_injective Q he)) P V i hV hp hmass a b hPi ha hb h hh d have hprod : boundedPrimitiveModulus t * boundedPrimitiveModulus s ≤ Q * Q := Nat.mul_le_mul (bounded_primitive_modulus_le t) (bounded_primitive_modulus_le s) have hpos : (0 : ℝ) < (boundedPrimitiveModulus t * boundedPrimitiveModulus s : ℕ) := by exact_mod_cast Nat.mul_pos (bounded_primitive_modulus_pos t) (bounded_primitive_modulus_pos s) have hl := Real.log_le_log hpos (show ((boundedPrimitiveModulus t * boundedPrimitiveModulus s : ℕ) : ℝ) ≤ (Q * Q : ℕ) by exact_mod_cast hprod) apply hraw.trans exact mul_le_mul_of_nonneg_left (add_le_add le_rfl (div_le_div_of_nonneg_right hl hlog.le)) (by positivity) theorem prime_product_ideal_character_reproduction (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → p.Prime ∧ Q < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h ξ : ℝ, 0 < h → 0 < ξ → ∀ kept : Finset ℤ, (∀ d ∈ kept, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) → ∀ (t : BoundedPrimitiveCharacter Q) (y : ∀ j, P j), upperLogCell h (Real.log (∏ j, (y j).val : ℕ)) ∈ kept → ‖(∑ x, (finiteProductWeight (physicalLabelLaw V) x : ℂ) * primeProductIdealKernel P V Q h kept x y * boundedPrimitiveValue t ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus t))) - boundedPrimitiveValue t ((∏ j, (y j).val : ℕ) : ZMod (boundedPrimitiveModulus t))‖ ≤ (Q * Q : ℕ) * (((C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) := by obtain ⟨C, hC, hbnd⟩ := prime_family_log_cell_gram hZ refine ⟨C, hC, ?_⟩ intro Q hQ I _ _ P V i hV hp hmass a b hPi ha hb h ξ hh hξ kept hkept t y hy let ψ : BoundedPrimitiveCharacter Q → (∀ j, P j) → ℂ := fun s x => star (boundedPrimitiveValue s ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus s))) let δ := (C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a) have hVi := hV i have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hQ1 : (1 : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr (Nat.mul_ne_zero (Nat.ne_of_gt hQ) (Nat.ne_of_gt hQ)) have hδ : 0 ≤ δ := by have := Real.log_nonneg hQ1 dsimp only [δ] positivity have hunit : ∀ s x, finiteProductWeight (physicalLabelLaw (P := P) V) x ≠ 0 → ‖ψ s x‖ = 1 := by intro s x _ rw [show ψ s x = star (boundedPrimitiveValue s ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus s))) from rfl, norm_star] exact prime_tuple_character_norm_one P (boundedPrimitiveValue s) (fun j p hj => prime_above_modulus_coprime (hp j p hj).1 (bounded_primitive_modulus_pos s) (bounded_primitive_modulus_le s) (hp j p hj).2) x have hraw : ∀ d ∈ kept, ∀ s u, s ≠ u → ‖∑ x : (∀ j, P j), if upperLogCell h (Real.log (∏ j, (x j).val : ℕ)) = d then (finiteProductWeight (physicalLabelLaw V) x : ℂ) * (starRingEnd ℂ) (ψ s x) * ψ u x else 0‖ ≤ δ := by intro d _ s u hsu simpa only [ψ, starRingEnd_apply, star_star] using hbnd Q hQ P V i hV (fun j p hj => (hp j p hj).1.pos) hmass a b hPi ha hb h hh d s u hsu have hrec := finite_cell_character_reproduction (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) kept ψ hunit hδ hξ hkept hraw t y hy (fun s => by dsimp only [ψ] rw [norm_star] exact (boundedPrimitiveValue s).norm_le_one _) have hc : ((Fintype.card (BoundedPrimitiveCharacter Q) - 1 : ℕ) : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast (Nat.sub_le (Fintype.card (BoundedPrimitiveCharacter Q)) 1).trans (bounded_primitive_character_card_le Q) have hout := hrec.trans (mul_le_mul_of_nonneg_right hc (div_nonneg hδ hξ.le)) simpa only [primeProductIdealKernel, ψ, starRingEnd_apply, star_star, δ] using hout /- The logarithmic factor is bounded crudely by another `Q²`, leaving a uniform exponential-times-power majorant. The exponent bounds may be any reals. -/ theorem prime_kernel_reproduction_error_majorant (c C q v x L : ℝ) (hc : 0 < c) (hC : 0 < C) (hL : 1 < L) (Q : ℕ) (V ξ a : ℝ) (hQ : 0 < Q) (hQbound : (Q : ℝ) ≤ L ^ q) (hV : L ^ (-v) ≤ V) (hξ : L ^ (-x) ≤ ξ) (ha : Real.exp (L ^ c) ≤ a) : ((Q * Q : ℕ) : ℝ) * (((C / V) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a)) / ξ) ≤ (2 * C) * Real.exp (-(1 / 96 : ℝ) * L ^ c) * L ^ (4 * q + v + x) := by have hL0 : 0 < L := by linarith have hV0 : 0 < V := (Real.rpow_pos_of_pos hL0 (-v)).trans_le hV have hξ0 : 0 < ξ := (Real.rpow_pos_of_pos hL0 (-x)).trans_le hξ have ha0 : 0 < a := (Real.exp_pos _).trans_le ha have halog : 1 ≤ Real.log a := by have hh := Real.log_le_log (Real.exp_pos (L ^ c)) ha rw [Real.log_exp] at hh exact (Real.one_le_rpow hL.le hc.le).trans hh have hVinv : 1 / V ≤ L ^ v := by calc _ ≤ 1 / L ^ (-v) := one_div_le_one_div_of_le (Real.rpow_pos_of_pos hL0 (-v)) hV _ = _ := by rw [Real.rpow_neg hL0.le]; simp have hξinv : 1 / ξ ≤ L ^ x := by calc _ ≤ 1 / L ^ (-x) := one_div_le_one_div_of_le (Real.rpow_pos_of_pos hL0 (-x)) hξ _ = _ := by rw [Real.rpow_neg hL0.le]; simp have hadecay : a ^ (-(1 : ℝ) / 96) ≤ Real.exp (-(1 / 96 : ℝ) * L ^ c) := by calc _ ≤ (Real.exp (L ^ c)) ^ (-(1 : ℝ) / 96) := Real.rpow_le_rpow_of_nonpos (Real.exp_pos _) ha (by norm_num) _ = _ := by rw [← Real.exp_mul]; congr 1; ring have hQsq : (Q : ℝ) ^ 2 ≤ (L ^ q) ^ 2 := pow_le_pow_left₀ (Nat.cast_nonneg Q) hQbound 2 have hlogbound : 1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a ≤ 2 * (L ^ q) ^ 2 := (prime_kernel_log_factor_le Q a hQ halog).trans (by linarith) have hlog0 : 0 ≤ 1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a := by have hQQ : (1 : ℝ) ≤ ((Q * Q : ℕ) : ℝ) := by exact_mod_cast (show 1 ≤ Q * Q by nlinarith) have hh := Real.log_nonneg hQQ positivity calc _ = (Q : ℝ) ^ 2 * C * (1 / V) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a) * (1 / ξ) := by push_cast ring _ ≤ (L ^ q) ^ 2 * C * L ^ v * Real.exp (-(1 / 96 : ℝ) * L ^ c) * (2 * (L ^ q) ^ 2) * L ^ x := by gcongr _ = _ := by rw [show 4 * q + v + x = q + q + v + q + q + x by ring] simp only [Real.rpow_add hL0] ring /- One threshold in `L` works for every allowed modulus bound, mass, cell width, and prime-band starting point. -/ theorem eventually_prime_kernel_reproduction_error_small (c C q v x D : ℝ) (hc : 0 < c) (hC : 0 < C) : ∀ᶠ L : ℝ in atTop, ∀ (Q : ℕ) (V ξ a : ℝ), 0 < Q → (Q : ℝ) ≤ L ^ q → L ^ (-v) ≤ V → L ^ (-x) ≤ ξ → Real.exp (L ^ c) ≤ a → ((Q * Q : ℕ) : ℝ) * (((C / V) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log ((Q * Q : ℕ) : ℝ) / Real.log a)) / ξ) ≤ L ^ (-D) := by filter_upwards [eventually_exp_neg_rpow_mul_rpow_le hc (by norm_num : (0 : ℝ) < 1 / 96) (4 * q + v + x + 1) D, eventually_gt_atTop (1 : ℝ), eventually_ge_atTop (2 * C)] with L hdecay hL hCL intro Q V ξ a hQ hQbound hV hξ ha have hL0 : 0 < L := by linarith calc _ ≤ (2 * C) * Real.exp (-(1 / 96 : ℝ) * L ^ c) * L ^ (4 * q + v + x) := prime_kernel_reproduction_error_majorant c C q v x L hc hC hL Q V ξ a hQ hQbound hV hξ ha _ ≤ L * Real.exp (-(1 / 96 : ℝ) * L ^ c) * L ^ (4 * q + v + x) := by gcongr _ = Real.exp (-(1 / 96 : ℝ) * L ^ c) * L ^ (4 * q + v + x + 1) := by rw [Real.rpow_add hL0 (4 * q + v + x) 1, Real.rpow_one] ring _ ≤ L ^ (-D) := hdecay theorem prime_product_ideal_dirichlet_reproduction (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I : Type*} [Fintype I] [DecidableEq I], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I), (∀ j, 0 < V j) → (∀ j p, p ∈ P j → p.Prime ∧ Q < p) → (∀ j, ∑ p ∈ P j, 1 / (p : ℝ) = V j) → ∀ a b : ℝ, P i = primeBand a b → 2 ≤ a → 0 ≤ b → ∀ h ξ : ℝ, 0 < h → 0 < ξ → ∀ kept : Finset ℤ, (∀ d ∈ kept, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d) → ∀ q : ℕ, 0 < q → q ≤ Q → ∀ (χ : DirichletCharacter ℂ q) (y : ∀ j, P j), upperLogCell h (Real.log (∏ j, (y j).val : ℕ)) ∈ kept → ‖(∑ x, (finiteProductWeight (physicalLabelLaw V) x : ℂ) * primeProductIdealKernel P V Q h kept x y * χ ((∏ j, (x j).val : ℕ) : ZMod q)) - χ ((∏ j, (y j).val : ℕ) : ZMod q)‖ ≤ (Q * Q : ℕ) * (((C / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) := by obtain ⟨C, hC, hbnd⟩ := prime_product_ideal_character_reproduction hZ refine ⟨C, hC, ?_⟩ intro Q hQ I _ _ P V i hV hp hmass a b hPi ha hb h ξ hh hξ kept hkept q hq hqQ χ y hy obtain ⟨t, _, ht⟩ := bounded_primitive_inducing hq hqQ χ have heval (x : ∀ j, P j) : boundedPrimitiveValue t ((∏ j, (x j).val : ℕ) : ZMod (boundedPrimitiveModulus t)) = χ ((∏ j, (x j).val : ℕ) : ZMod q) := by apply ht exact Nat.coprime_prod_left_iff.mpr (fun j _ => prime_above_modulus_coprime (hp j (x j).val (x j).property).1 hq hqQ (hp j (x j).val (x j).property).2) simpa only [heval] using hbnd Q hQ P V i hV hp hmass a b hPi ha hb h ξ hh hξ kept hkept t y hy noncomputable def primeKernelError (C : ℝ) (Q : ℕ) (V a ξ : ℝ) : ℝ := (Q * Q : ℕ) * (((C / V) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) theorem prime_kernel_error_nonneg {C V a ξ : ℝ} {Q : ℕ} (hC : 0 ≤ C) (hV : 0 ≤ V) (ha : 2 ≤ a) (hξ : 0 ≤ ξ) (hQ : 0 < Q) : 0 ≤ primeKernelError C Q V a ξ := by have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hq : (1 : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast Nat.mul_pos hQ hQ have hlogq := Real.log_nonneg hq unfold primeKernelError positivity theorem prime_major_arc_comparison (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I J : Type u} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I) (R : J → Finset ℕ) (W : J → ℝ) (j : J), (∀ k, 0 < V k) → (∀ k, 0 < W k) → (∀ k p, p ∈ P k → p.Prime ∧ Q < p) → (∀ k p, p ∈ R k → p.Prime ∧ Q < p) → (∀ k, ∑ p ∈ P k, 1 / (p : ℝ) = V k) → (∀ k, ∑ p ∈ R k, 1 / (p : ℝ) = W k) → ∀ a b a' b' : ℝ, P i = primeBand a b → R j = primeBand a' b' → 2 ≤ a → 0 ≤ b → 2 ≤ a' → 0 ≤ b' → ∀ h ξ : ℝ, 0 < h → 0 < ξ → ∀ keptP keptR : Finset ℤ, (∀ d ∈ keptP, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ k, (x k).val : ℕ))) d) → (∀ d ∈ keptR, ξ ≤ finiteCellMass (finiteProductWeight (physicalLabelLaw (P := R) W)) (fun y => upperLogCell h (Real.log (∏ k, (y k).val : ℕ))) d) → ∀ (x : ∀ k, P k) (y : ∀ k, R k), upperLogCell h (Real.log (∏ k, (x k).val : ℕ)) ∈ keptP → upperLogCell h (Real.log (∏ k, (y k).val : ℕ)) ∈ keptR → ∀ r : ℕ, 0 < r → r ≤ Q → ∀ u : ℤ, ∀ ζ β B : ℝ, 0 ≤ B → ((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ) ≤ B → (∀ d e, primeProductIdealKernel P V Q h keptP d x * primeProductIdealKernel R W Q h keptR e y ≠ 0 → ((∏ k, (d k).val : ℕ) : ℝ) * (∏ k, (e k).val : ℕ) ≤ B) → ‖finiteTwoKernelAverage (finiteProductWeight (physicalLabelLaw V)) (finiteProductWeight (physicalLabelLaw W)) (primeProductIdealKernel P V Q h keptP) (primeProductIdealKernel R W Q h keptR) x y (fun d e => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (d k).val : ℕ) : ℝ) * (∏ k, (e k).val : ℕ)) + 2 * Real.pi * (((u : ℝ) / r + β) * (((∏ k, (d k).val : ℕ) : ℝ) * (∏ k, (e k).val : ℕ))) : ℝ))) - Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ)) + 2 * Real.pi * (((u : ℝ) / r + β) * (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ))) : ℝ))‖ ≤ (2 * h * (|ζ| + 2 * Real.pi * |β| * B)) * (Q * Q : ℕ) * (Q * Q : ℕ) + Real.sqrt (Q : ℝ) * (primeKernelError C Q (V i) a ξ + primeKernelError C Q (W j) a' ξ + primeKernelError C Q (V i) a ξ * primeKernelError C Q (W j) a' ξ) := by obtain ⟨C, hC, hrep⟩ := prime_product_ideal_dirichlet_reproduction hZ refine ⟨C, hC, ?_⟩ intro Q hQ I J _ _ _ _ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hξ keptP keptR hkeptP hkeptR x y hx hy r hr hrQ u ζ β B hB hxy hsupport let π : (∀ k, P k) → ℕ := fun d => ∏ k, (d k).val let τ : (∀ k, R k) → ℕ := fun e => ∏ k, (e k).val have hπpos (d : ∀ k, P k) : (0 : ℝ) < π d := by exact_mod_cast Finset.prod_pos (fun k _ => (hP k (d k).val (d k).property).1.pos) have hτpos (e : ∀ k, R k) : (0 : ℝ) < τ e := by exact_mod_cast Finset.prod_pos (fun k _ => (hR k (e k).val (e k).property).1.pos) have hπ (d : ∀ k, P k) : (π d).Coprime r := Nat.coprime_prod_left_iff.mpr (fun k _ => prime_above_modulus_coprime (hP k (d k).val (d k).property).1 hr hrQ (hP k (d k).val (d k).property).2) have hτ (e : ∀ k, R k) : (τ e).Coprime r := Nat.coprime_prod_left_iff.mpr (fun k _ => prime_above_modulus_coprime (hR k (e k).val (e k).property).1 hr hrQ (hR k (e k).val (e k).property).2) have hμ (d : ∀ k, P k) : 0 ≤ finiteProductWeight (physicalLabelLaw V) d := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg V (fun k => (hV k).le) k (d k)) have hν (e : ∀ k, R k) : 0 ≤ finiteProductWeight (physicalLabelLaw W) e := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg W (fun k => (hW k).le) k (e k)) let M := fun d e => majorArcMultiplier ζ β (Real.log ((π d : ℝ) * τ e)) have hm (d : ∀ k, P k) (e : ∀ k, R k) (hne : primeProductIdealKernel P V Q h keptP d x * primeProductIdealKernel R W Q h keptR e y ≠ 0) : ‖M d e - M x y‖ ≤ 2 * h * (|ζ| + 2 * Real.pi * |β| * B) := by exact major_arc_multiplier_log_products ζ β _ _ _ _ B h (hπpos d) (hτpos e) (hπpos x) (hτpos y) (prime_ideal_kernel_log_localized P V Q hh keptP d x (mul_ne_zero_iff.mp hne).1).le (prime_ideal_kernel_log_localized R W Q hh keptR e y (mul_ne_zero_iff.mp hne).2).le (hsupport d e hne) hxy have hmain := rational_kernel_multiplier_comparison π τ (finiteProductWeight (physicalLabelLaw V)) (finiteProductWeight (physicalLabelLaw W)) (primeProductIdealKernel P V Q h keptP) (primeProductIdealKernel R W Q h keptR) x y hr hrQ u hπ hτ (prime_kernel_error_nonneg hC.le (hV i).le ha hξ.le hQ) (prime_kernel_error_nonneg hC.le (hW j).le ha' hξ.le hQ) (fun χ => hrep Q hQ P V i hV hP hVP a b hPi ha hb h ξ hh hξ keptP hkeptP r hr hrQ χ x hx) (fun χ => hrep Q hQ R W j hW hR hWR a' b' hRj ha' hb' h ξ hh hξ keptR hkeptR r hr hrQ χ y hy) hμ hν (by positivity) (prime_ideal_kernel_abs_column_le P V (fun k => (hV k).le) Q h keptP (fun d hd => hξ.trans_le (hkeptP d hd)) x) (prime_ideal_kernel_abs_column_le R W (fun k => (hW k).le) Q h keptR (fun d hd => hξ.trans_le (hkeptR d hd)) y) M (by exact (major_arc_multiplier_norm ζ β _).le) hm have hphase (d : ∀ k, P k) (e : ∀ k, R k) : M d e * Complex.exp (Complex.I * (2 * Real.pi * ((u : ℝ) / r * (π d * τ e)) : ℝ)) = Complex.exp (Complex.I * (ζ * Real.log ((π d : ℝ) * τ e) + 2 * Real.pi * (((u : ℝ) / r + β) * ((π d : ℝ) * τ e)) : ℝ)) := by simpa only [Nat.cast_mul] using major_arc_rational_phase_factor ζ β u (mul_pos (hπpos d) (hτpos e)) simpa only [hphase, π, τ] using hmain theorem prime_kernel_gram_error_le {C V a ξ : ℝ} {Q : ℕ} (hC : 0 ≤ C) (hV : 0 ≤ V) (ha : 2 ≤ a) (hξ : 0 ≤ ξ) (hQ : 0 < Q) : (Q * Q - 1 : ℕ) * (((C / V) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ primeKernelError C Q V a ξ := by have hlog : 0 < Real.log a := Real.log_pos (by linarith) have hq : (1 : ℝ) ≤ (Q * Q : ℕ) := by exact_mod_cast Nat.mul_pos hQ hQ have hlogq := Real.log_nonneg hq unfold primeKernelError apply mul_le_mul_of_nonneg_right · exact_mod_cast Nat.sub_le (Q * Q) 1 · positivity theorem eventually_prime_kernel_error_and_energy_small (c C q v x D : ℝ) (hc : 0 < c) (hC : 0 < C) (hD : 0 ≤ D) : ∀ᶠ L : ℝ in atTop, ∀ (Q : ℕ) (V ξ a : ℝ), 0 < Q → (Q : ℝ) ≤ L ^ q → L ^ (-v) ≤ V → L ^ (-x) ≤ ξ → Real.exp (L ^ c) ≤ a → primeKernelError C Q V a ξ ≤ L ^ (-D) ∧ (Q * Q - 1 : ℕ) * (((C / V) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 := by filter_upwards [eventually_prime_kernel_reproduction_error_small c C q v x D hc hC, eventually_ge_atTop (1 : ℝ)] with L herror hL have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL intro Q V ξ a hQ hQb hV hξ ha have herr : primeKernelError C Q V a ξ ≤ L ^ (-D) := herror Q V ξ a hQ hQb hV hξ ha have ha2 : 2 ≤ a := by calc 2 ≤ Real.exp 1 := by linarith [Real.add_one_le_exp (1 : ℝ)] _ ≤ Real.exp (L ^ c) := Real.exp_le_exp.mpr (Real.one_le_rpow hL hc.le) _ ≤ a := ha refine ⟨herr, (prime_kernel_gram_error_le hC.le ?_ ha2 ?_ hQ).trans (herr.trans ?_)⟩ · exact (Real.rpow_pos_of_pos hL0 (-v)).le.trans hV · exact (Real.rpow_pos_of_pos hL0 (-x)).le.trans hξ · simpa only [Real.rpow_zero] using Real.rpow_le_rpow_of_exponent_le hL (show -D ≤ 0 by linarith) theorem prime_major_arc_dyadic_pairing (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C : ℝ, 0 < C ∧ ∀ Q : ℕ, 0 < Q → ∀ {I J : Type u} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I) (R : J → Finset ℕ) (W : J → ℝ) (j : J), (∀ k, 0 < V k) → (∀ k, 0 < W k) → (∀ k p, p ∈ P k → p.Prime ∧ Q < p) → (∀ k p, p ∈ R k → p.Prime ∧ Q < p) → (∀ k, ∑ p ∈ P k, 1 / (p : ℝ) = V k) → (∀ k, ∑ p ∈ R k, 1 / (p : ℝ) = W k) → ∀ a b a' b' : ℝ, P i = primeBand a b → R j = primeBand a' b' → 2 ≤ a → 0 ≤ b → 2 ≤ a' → 0 ≤ b' → ∀ h ξ : ℝ, 0 < h → h ≤ Real.log 2 → 0 < ξ → ∀ U T : ℝ, 0 ≤ U → 0 ≤ T → ∀ (f : (∀ k, P k) → ℂ) (g : (∀ k, R k) → ℂ), (∀ x, f x ≠ 0 → U ≤ ((∏ k, (x k).val : ℕ) : ℝ) ∧ ((∏ k, (x k).val : ℕ) : ℝ) ≤ 2 * U) → (∀ y, g y ≠ 0 → T ≤ ((∏ k, (y k).val : ℕ) : ℝ) ∧ ((∏ k, (y k).val : ℕ) : ℝ) ≤ 2 * T) → ∀ r : ℕ, 0 < r → r ≤ Q → ∀ u : ℤ, ∀ ζ β : ℝ, let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let cellP := fun x : (∀ k, P k) => upperLogCell h (Real.log (∏ k, (x k).val : ℕ)) let cellR := fun y : (∀ k, R k) => upperLogCell h (Real.log (∏ k, (y k).val : ℕ)) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) let phase := fun (x : ∀ k, P k) (y : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ)) + 2 * Real.pi * (((u : ℝ) / r + β) * (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ))) : ℝ)) ‖∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * ((phase x y - finiteTwoKernelAverage μ ν KA KB x y phase) * f x * g y)‖ ≤ (Real.sqrt (((finiteOccupiedCells cellP).card + (finiteOccupiedCells cellR).card : ℝ) * ξ) + (2 * h * (|ζ| + 2 * Real.pi * |β| * (16 * U * T))) * (Q * Q : ℕ) * (Q * Q : ℕ) + Real.sqrt (Q : ℝ) * (primeKernelError C Q (V i) a ξ + primeKernelError C Q (W j) a' ξ + primeKernelError C Q (V i) a ξ * primeKernelError C Q (W j) a' ξ)) * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by obtain ⟨C, hC, hpoint⟩ := prime_major_arc_comparison.{u} hZ refine ⟨C, hC, ?_⟩ intro Q hQ I J _ _ _ _ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hh2 hξ U T hU hT f g hf hg r hr hrQ u ζ β let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let cellP := fun x : (∀ k, P k) => upperLogCell h (Real.log (∏ k, (x k).val : ℕ)) let cellR := fun y : (∀ k, R k) => upperLogCell h (Real.log (∏ k, (y k).val : ℕ)) let keptP := primeProductRetainedCells P V h ξ let keptR := primeProductRetainedCells R W h ξ let KA := primeProductIdealKernel P V Q h keptP let KB := primeProductIdealKernel R W Q h keptR let phase := fun (x : ∀ k, P k) (y : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ)) + 2 * Real.pi * (((u : ℝ) / r + β) * (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ))) : ℝ)) let comparison := fun x y => finiteTwoKernelAverage μ ν KA KB x y phase let E := fun x y => cellP x ∉ keptP ∨ cellR y ∉ keptR let ε := (2 * h * (|ζ| + 2 * Real.pi * |β| * (16 * U * T))) * (Q * Q : ℕ) * (Q * Q : ℕ) + Real.sqrt (Q : ℝ) * (primeKernelError C Q (V i) a ξ + primeKernelError C Q (W j) a' ξ + primeKernelError C Q (V i) a ξ * primeKernelError C Q (W j) a' ξ) have hμ (x : ∀ k, P k) : 0 ≤ μ x := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg V (fun k => (hV k).le) k (x k)) have hν (y : ∀ k, R k) : 0 ≤ ν y := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg W (fun k => (hW k).le) k (y k)) have hμmass : ∑ x, μ x = 1 := finite_product_weight_sum_one _ (fun k => physical_label_law_sum V k (hV k) (hVP k)) have hνmass : ∑ y, ν y = 1 := finite_product_weight_sum_one _ (fun k => physical_label_law_sum W k (hW k) (hWR k)) have hraw (x : ∀ k, P k) (y : ∀ k, R k) : ‖phase x y‖ ≤ 1 := by have hn (t : ℝ) : ‖Complex.exp (Complex.I * (t : ℂ))‖ = 1 := by rw [Complex.norm_exp] simp exact (hn _).le have hzero (x : ∀ k, P k) (y : ∀ k, R k) (he : E x y) : comparison x y = 0 := by rcases he with hx | hy · apply finite_two_kernel_average_zero_left intro d exact prime_ideal_kernel_zero_of_right_discarded P V Q h keptP d x hx · apply finite_two_kernel_average_zero_right intro e exact prime_ideal_kernel_zero_of_right_discarded R W Q h keptR e y hy have hε : 0 ≤ ε := by have hεA := prime_kernel_error_nonneg hC.le (hV i).le ha hξ.le hQ have hεB := prime_kernel_error_nonneg hC.le (hW j).le ha' hξ.le hQ dsimp only [ε] positivity have hclose (x : ∀ k, P k) (y : ∀ k, R k) (hfx : f x ≠ 0) (hgy : g y ≠ 0) (he : ¬ E x y) : ‖phase x y - comparison x y‖ ≤ ε := by have hx : cellP x ∈ keptP := not_not.mp (not_or.mp he).1 have hy : cellR y ∈ keptR := not_not.mp (not_or.mp he).2 have hc := prime_kernel_pair_dyadic_cap P V R W Q (fun k p hp => (hP k p hp).1.pos) (fun k p hp => (hR k p hp).1.pos) hh hh2 keptP keptR hU hT x y (hf x hfx).2 (hg y hgy).2 have hp := hpoint Q hQ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hξ keptP keptR (fun d hd => prime_product_retained_cell_mass P V h ξ hd) (fun e he => prime_product_retained_cell_mass R W h ξ he) x y hx hy r hr hrQ u ζ β (16 * U * T) (by positivity) hc.1 hc.2 rw [norm_sub_rev] exact hp have hpair := finite_retained_comparison_pairing_supported μ ν hμ hν hμmass hνmass E phase comparison hraw hzero f g hε hclose have hmass : finitePairEventMass μ ν E ≤ ((finiteOccupiedCells cellP).card + (finiteOccupiedCells cellR).card : ℝ) * ξ := finite_pair_discarded_mass_le μ ν hμ hν hμmass hνmass cellP cellR hξ.le have heps : Real.sqrt (finitePairEventMass μ ν E) + ε ≤ Real.sqrt (((finiteOccupiedCells cellP).card + (finiteOccupiedCells cellR).card : ℝ) * ξ) + ε := add_le_add (Real.sqrt_le_sqrt hmass) le_rfl have hbound := hpair.trans (mul_le_mul_of_nonneg_right heps (Real.sqrt_nonneg _)) simpa only [ε, add_assoc] using hbound theorem prime_minor_arc_dyadic_pairing (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ C₀ : ℝ, 0 < C₀ ∧ ∀ Q : ℕ, 0 < Q → ∀ {I J : Type u} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I) (R : J → Finset ℕ) (W : J → ℝ) (j : J), (∀ k, 0 < V k) → (∀ k, 0 < W k) → (∀ k p, p ∈ P k → p.Prime ∧ Q < p) → (∀ k p, p ∈ R k → p.Prime ∧ Q < p) → (∀ k, ∑ p ∈ P k, 1 / (p : ℝ) = V k) → (∀ k, ∑ p ∈ R k, 1 / (p : ℝ) = W k) → ∀ a b a' b' : ℝ, P i = primeBand a b → R j = primeBand a' b' → 2 ≤ a → 0 ≤ b → 2 ≤ a' → 0 ≤ b' → ∀ h ξ : ℝ, 0 < h → h ≤ Real.log 2 → 0 < ξ → (Q * Q - 1 : ℕ) * (((C₀ / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 → (Q * Q - 1 : ℕ) * (((C₀ / W j) * a' ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a')) / ξ) ≤ 1 → ∀ U T : ℕ, 0 < U → 0 < T → ∀ (f : (∀ k, P k) → ℂ) (g : (∀ k, R k) → ℂ), (∀ x, f x ≠ 0 → U ≤ (∏ k, (x k).val : ℕ) ∧ (∏ k, (x k).val : ℕ) < 2 * U) → (∀ y, g y ≠ 0 → T ≤ (∏ k, (y k).val : ℕ) ∧ (∏ k, (y k).val : ℕ) < 2 * T) → ∀ C D : ℝ, 0 ≤ C → 0 ≤ D → (∀ m : ℕ, (∑ x ∈ Finset.univ.filter (fun x : (∀ k, P k) => (∏ k, (x k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw V) x) ≤ C / (m : ℝ)) → (∀ m : ℕ, (∑ y ∈ Finset.univ.filter (fun y : (∀ k, R k) => (∏ k, (y k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw W) y) ≤ D / (m : ℝ)) → ∀ r : ℕ, 0 < r → ∀ u : ℤ, (r : ℤ).gcd u = 1 → ∀ β : ℝ, |β| ≤ 1 / (r : ℝ) ^ 2 → ∀ ζ : ℝ, let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) let phase := fun (x : ∀ k, P k) (y : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ)) + 2 * Real.pi * (((u : ℝ) / r + β) * (((∏ k, (x k).val : ℕ) : ℝ) * (∏ k, (y k).val : ℕ))) : ℝ)) ‖∑ x, ∑ y, ((μ x * ν y : ℝ) : ℂ) * ((phase x y - finiteTwoKernelAverage μ ν KA KB x y phase) * f x * g y)‖ ≤ 33 * Real.sqrt (6 * C * D * (1 + Real.log r) * (1 / (r : ℝ) + 1 / (U : ℝ) + 1 / (T : ℝ) + (r : ℝ) / ((U : ℝ) * T))) * Real.sqrt ((∑ x, μ x * ‖f x‖ ^ 2) * ∑ y, ν y * ‖g y‖ ^ 2) := by obtain ⟨C₀, hC₀, henergy⟩ := prime_product_ideal_kernel_energy.{u} hZ refine ⟨C₀, hC₀, ?_⟩ intro Q hQ I J _ _ _ _ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hh2 hξ hsmallP hsmallR U T hU hT f g hf hg C D hC hD hμatom hνatom r hr u hcop β hβ ζ let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) have hμ (x : ∀ k, P k) : 0 ≤ μ x := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg V (fun k => (hV k).le) k (x k)) have hν (y : ∀ k, R k) : 0 ≤ ν y := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg W (fun k => (hW k).le) k (y k)) have hπ (x : ∀ k, P k) : 0 < (∏ k, (x k).val : ℕ) := Finset.prod_pos (fun k _ => (hP k (x k).val (x k).property).1.pos) have hτ (y : ∀ k, R k) : 0 < (∏ k, (y k).val : ℕ) := Finset.prod_pos (fun k _ => (hR k (y k).val (y k).property).1.pos) have hEA := henergy Q hQ P V i hV hP hVP a b hPi ha hb h ξ hh hξ (primeProductRetainedCells P V h ξ) (fun d hd => prime_product_retained_cell_mass P V h ξ hd) hsmallP f have hEB := henergy Q hQ R W j hW hR hWR a' b' hRj ha' hb' h ξ hh hξ (primeProductRetainedCells R W h ξ) (fun d hd => prime_product_retained_cell_mass R W h ξ hd) hsmallR g have hTf := prime_kernel_transform_dyadic_support P V Q (fun k p hp => (hP k p hp).1.pos) hh hh2 (primeProductRetainedCells P V h ξ) f hf have hTg := prime_kernel_transform_dyadic_support R W Q (fun k p hp => (hR k p hp).1.pos) hh hh2 (primeProductRetainedCells R W h ξ) g hg exact kernel_full_phase_dyadic_comparison (fun x : ∀ k, P k => ∏ k, (x k).val) (fun y : ∀ k, R k => ∏ k, (y k).val) hπ hτ U T hU hT μ ν hμ hν KA KB f g hf hg hTf hTg hEA hEB hC hD hμatom hνatom hr hcop hβ ζ theorem prime_all_frequency_dyadic_pairing (hZ : PrimitiveZeroFreeRightOf (23 / 24)) : ∃ CM CE : ℝ, 0 < CM ∧ 0 < CE ∧ ∀ L q κ t n x w z d B : ℝ, 512 ≤ L → 0 ≤ q → 0 ≤ t → 0 ≤ d → 2 * κ + t + 2 * B + 3 ≤ q → n + 2 * B + 2 ≤ x → 4 * q + max z q + B + 2 ≤ w → q + B + 2 ≤ d → ∀ Q : ℕ, Q = ⌊L ^ q⌋₊ → 0 < Q → ∀ {I J : Type u} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I) (R : J → Finset ℕ) (W : J → ℝ) (j : J), (∀ k, 0 < V k) → (∀ k, 0 < W k) → (∀ k p, p ∈ P k → p.Prime ∧ Q < p) → (∀ k p, p ∈ R k → p.Prime ∧ Q < p) → (∀ k, ∑ p ∈ P k, 1 / (p : ℝ) = V k) → (∀ k, ∑ p ∈ R k, 1 / (p : ℝ) = W k) → ∀ a b a' b' : ℝ, P i = primeBand a b → R j = primeBand a' b' → 2 ≤ a → 0 ≤ b → 2 ≤ a' → 0 ≤ b' → ∀ h ξ : ℝ, 0 < h → h ≤ Real.log 2 → 0 < ξ → h ≤ L ^ (-w) → ξ ≤ L ^ (-x) → (Q * Q - 1 : ℕ) * (((CE / V i) * a ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a)) / ξ) ≤ 1 → (Q * Q - 1 : ℕ) * (((CE / W j) * a' ^ (-(1 : ℝ) / 96) * (1 + Real.log (Q * Q : ℕ) / Real.log a')) / ξ) ≤ 1 → primeKernelError CM Q (V i) a ξ ≤ L ^ (-d) → primeKernelError CM Q (W j) a' ξ ≤ L ^ (-d) → (((finiteOccupiedCells (fun v : (∀ k, P k) => upperLogCell h (Real.log (∏ k, (v k).val : ℕ)))).card + (finiteOccupiedCells (fun v : (∀ k, R k) => upperLogCell h (Real.log (∏ k, (v k).val : ℕ)))).card : ℕ) : ℝ) ≤ L ^ n → ∀ U T : ℕ, L ^ q ≤ (U : ℝ) → L ^ q ≤ (T : ℝ) → Real.log ((U : ℝ) * T) ≤ L ^ t → ∀ (f : (∀ k, P k) → ℂ) (g : (∀ k, R k) → ℂ), (∀ v, f v ≠ 0 → U ≤ (∏ k, (v k).val : ℕ) ∧ (∏ k, (v k).val : ℕ) < 2 * U) → (∀ v, g v ≠ 0 → T ≤ (∏ k, (v k).val : ℕ) ∧ (∏ k, (v k).val : ℕ) < 2 * T) → ∀ C D : ℝ, 0 ≤ C → 0 ≤ D → C ≤ L ^ κ → D ≤ L ^ κ → (∀ m : ℕ, (∑ v ∈ Finset.univ.filter (fun v : (∀ k, P k) => (∏ k, (v k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw V) v) ≤ C / (m : ℝ)) → (∀ m : ℕ, (∑ v ∈ Finset.univ.filter (fun v : (∀ k, R k) => (∏ k, (v k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw W) v) ≤ D / (m : ℝ)) → ∀ α ζ : ℝ, |ζ| ≤ L ^ z → let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) let phase := fun (v : ∀ k, P k) (s : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (v k).val : ℕ) : ℝ) * (∏ k, (s k).val : ℕ)) + 2 * Real.pi * (α * (((∏ k, (v k).val : ℕ) : ℝ) * (∏ k, (s k).val : ℕ))) : ℝ)) ‖∑ v, ∑ s, ((μ v * ν s : ℝ) : ℂ) * ((phase v s - finiteTwoKernelAverage μ ν KA KB v s phase) * f v * g s)‖ ≤ L ^ (-B) * Real.sqrt ((∑ v, μ v * ‖f v‖ ^ 2) * ∑ s, ν s * ‖g s‖ ^ 2) := by obtain ⟨CM, hCM, hmajor⟩ := prime_major_arc_dyadic_pairing.{u} hZ obtain ⟨CE, hCE, hminor⟩ := prime_minor_arc_dyadic_pairing.{u} hZ refine ⟨CM, CE, hCM, hCE, ?_⟩ intro L q κ t n x w z d B hL hq ht hd hparam hxp hwp hdp Q hQfloor hQ I J _ _ _ _ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hh2 hξ hhb hξb hsmallP hsmallR hεP hεR hcells U T hUb hTb hlog f g hf hg C D hC hD hCb hDb hμatom hνatom α ζ hζ have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hU0 : (0 : ℝ) < U := (Real.rpow_pos_of_pos hL0 q).trans_le hUb have hT0 : (0 : ℝ) < T := (Real.rpow_pos_of_pos hL0 q).trans_le hTb have hU : 0 < U := by exact_mod_cast hU0 have hT : 0 < T := by exact_mod_cast hT0 obtain ⟨u, r, β, hr, hcop, hα, hβ, hscale, hratio, hcase⟩ := polynomial_dirichlet_dichotomy α L q U T hL1 hq hUb hTb rw [hα] rcases hcase with hmajorr | hminorr · have hrQ : r ≤ Q := by simpa only [hQfloor] using hmajorr have hpair := hmajor Q hQ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hh2 hξ U T hU0.le hT0.le f g (fun v hv => ⟨by exact_mod_cast (hf v hv).1, by exact_mod_cast (hf v hv).2.le⟩) (fun v hv => ⟨by exact_mod_cast (hg v hv).1, by exact_mod_cast (hg v hv).2.le⟩) r hr hrQ u ζ β apply hpair.trans apply mul_le_mul_of_nonneg_right _ (Real.sqrt_nonneg _) have hQb : (Q : ℝ) ≤ L ^ q := by rw [hQfloor] exact Nat.floor_le (Real.rpow_pos_of_pos hL0 q).le have hnum := major_arc_coefficient_small hL (Nat.cast_nonneg Q) (by positivity) hξ.le hh.le (abs_nonneg ζ) (mul_nonneg (abs_nonneg β) (mul_pos hU0 hT0).le) (prime_kernel_error_nonneg hCM.le (hV i).le ha hξ.le hQ) (prime_kernel_error_nonneg hCM.le (hW j).le ha' hξ.le hQ) hq hd hQb hcells hξb hhb hζ hscale hεP hεR hxp hwp hdp convert hnum using 1 <;> first | rfl | (push_cast; ring) · have hpair := hminor Q hQ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha hb ha' hb' h ξ hh hh2 hξ hsmallP hsmallR U T hU hT f g hf hg C D hC hD hμatom hνatom r hr u hcop β hβ ζ apply hpair.trans apply mul_le_mul_of_nonneg_right _ (Real.sqrt_nonneg _) exact minor_arc_uniform_factor_le hL hC hD ht hq hparam hCb hDb hUb hTb hminorr.le hratio hlog theorem eventually_prime_arbitrary_test_comparison (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c κ s z v B : ℝ) (hc : 0 < c) (hκ : 0 ≤ κ) (hs : 0 ≤ s) (hz : 0 ≤ z) (hB : 0 ≤ B) : let A := B + 2 * (s + 1) let q := 2 * κ + (s + 1) + 2 * A + 3 let w := 4 * q + max z q + A + 2 let x := (s + w + 2) + 2 * A + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {I J : Type u} [Fintype I] [DecidableEq I] [Fintype J] [DecidableEq J], ∀ (P : I → Finset ℕ) (V : I → ℝ) (i : I) (R : J → Finset ℕ) (W : J → ℝ) (j : J), (∀ k, 0 < V k) → (∀ k, 0 < W k) → (∀ k p, p ∈ P k → p.Prime ∧ Q < p) → (∀ k p, p ∈ R k → p.Prime ∧ Q < p) → (∀ k, ∑ p ∈ P k, 1 / (p : ℝ) = V k) → (∀ k, ∑ p ∈ R k, 1 / (p : ℝ) = W k) → L ^ (-v) ≤ V i → L ^ (-v) ≤ W j → ∀ a b a' b' : ℝ, P i = primeBand a b → R j = primeBand a' b' → Real.exp (L ^ c) ≤ a → 0 ≤ b → Real.exp (L ^ c) ≤ a' → 0 ≤ b' → (∀ t : (∀ k, P k), Real.log (∏ k, (t k).val : ℕ) ≤ L ^ s) → (∀ t : (∀ k, R k), Real.log (∏ k, (t k).val : ℕ) ≤ L ^ s) → (∀ m : ℕ, (∑ t ∈ Finset.univ.filter (fun t : (∀ k, P k) => (∏ k, (t k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw V) t) ≤ L ^ κ / (m : ℝ)) → (∀ m : ℕ, (∑ t ∈ Finset.univ.filter (fun t : (∀ k, R k) => (∏ k, (t k).val : ℕ) = m), finiteProductWeight (physicalLabelLaw W) t) ≤ L ^ κ / (m : ℝ)) → ∀ (f : (∀ k, P k) → ℂ) (g : (∀ k, R k) → ℂ), ∀ α ζ : ℝ, |ζ| ≤ L ^ z → let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) let phase := fun (t : ∀ k, P k) (r : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log (((∏ k, (t k).val : ℕ) : ℝ) * (∏ k, (r k).val : ℕ)) + 2 * Real.pi * (α * (((∏ k, (t k).val : ℕ) : ℝ) * (∏ k, (r k).val : ℕ))) : ℝ)) ‖∑ t, ∑ r, ((μ t * ν r : ℝ) : ℂ) * ((phase t r - finiteTwoKernelAverage μ ν KA KB t r phase) * f t * g r)‖ ≤ L ^ (-B) * Real.sqrt ((∑ t, μ t * ‖f t‖ ^ 2) * ∑ r, ν r * ‖g r‖ ^ 2) := by intro A q w x let n := s + w + 2 let d := q + A + 2 have hA : 0 ≤ A := by dsimp only [A]; positivity have hq : 0 ≤ q := by dsimp only [q]; positivity have hw : 1 ≤ w := by have hmax : 0 ≤ max z q := hz.trans (le_max_left _ _) dsimp only [w] linarith have hd : 0 ≤ d := by dsimp only [d]; positivity obtain ⟨CM, CE, hCM, hCE, hbound⟩ := prime_all_frequency_dyadic_pairing.{u} hZ filter_upwards [eventually_ge_atTop (512 : ℝ), eventually_prime_kernel_error_and_energy_small c CM q v x d hc hCM hd, eventually_prime_kernel_error_and_energy_small c CE q v x d hc hCE hd, eventually_prime_band_product_scale.{u} hc q] with L hL hM hE hprod intro Q h ξ I J _ _ _ _ P V i R W j hV hW hP hR hVP hWR hVi hWj a b a' b' hPi hRj ha hb ha' hb' hmaxP hmaxR hμatom hνatom f g α ζ hζ let μ := finiteProductWeight (physicalLabelLaw (P := P) V) let ν := finiteProductWeight (physicalLabelLaw (P := R) W) let π := fun t : ∀ k, P k => (∏ k, (t k).val : ℕ) let τ := fun t : ∀ k, R k => (∏ k, (t k).val : ℕ) let KA := primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) let KB := primeProductIdealKernel R W Q h (primeProductRetainedCells R W h ξ) let phase := fun (t : ∀ k, P k) (r : ∀ k, R k) => Complex.exp (Complex.I * (ζ * Real.log ((π t : ℝ) * τ r) + 2 * Real.pi * (α * ((π t : ℝ) * τ r)) : ℝ)) let K := fun t r => phase t r - finiteTwoKernelAverage μ ν KA KB t r phase have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hQ : 0 < Q := Nat.floor_pos.mpr (Real.one_le_rpow hL1 hq) have hQb : (Q : ℝ) ≤ L ^ q := Nat.floor_le (Real.rpow_pos_of_pos hL0 q).le have hh : 0 < h := Real.rpow_pos_of_pos hL0 _ have hξ : 0 < ξ := Real.rpow_pos_of_pos hL0 _ have hh2 : h ≤ Real.log 2 := polynomial_width_le_log_two (by linarith) hw have ha2 : 2 ≤ a := by have he : 2 ≤ Real.exp (L ^ c) := by calc 2 ≤ Real.exp 1 := by linarith [Real.add_one_le_exp (1 : ℝ)] _ ≤ Real.exp (L ^ c) := Real.exp_le_exp.mpr (Real.one_le_rpow hL1 hc.le) exact he.trans ha have ha2' : 2 ≤ a' := by have he : 2 ≤ Real.exp (L ^ c) := by calc 2 ≤ Real.exp 1 := by linarith [Real.add_one_le_exp (1 : ℝ)] _ ≤ Real.exp (L ^ c) := Real.exp_le_exp.mpr (Real.one_le_rpow hL1 hc.le) exact he.trans ha' have hμ (t : ∀ k, P k) : 0 ≤ μ t := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg V (fun k => (hV k).le) k (t k)) have hν (t : ∀ k, R k) : 0 ≤ ν t := Finset.prod_nonneg (fun k _ => physical_label_law_nonneg W (fun k => (hW k).le) k (t k)) have hπ (t : ∀ k, P k) : 0 < π t := Finset.prod_pos (fun k _ => (hP k (t k).val (t k).property).1.pos) have hτ (t : ∀ k, R k) : 0 < τ t := Finset.prod_pos (fun k _ => (hR k (t k).val (t k).property).1.pos) have hlogP (t : ∀ k, P k) : 0 ≤ Real.log (π t) ∧ Real.log (π t) ≤ L ^ s := ⟨Real.log_nonneg (by exact_mod_cast hπ t), hmaxP t⟩ have hlogR (t : ∀ k, R k) : 0 ≤ Real.log (τ t) ∧ Real.log (τ t) ≤ L ^ s := ⟨Real.log_nonneg (by exact_mod_cast hτ t), hmaxR t⟩ have hcells := two_upper_log_cell_cards_polynomial (fun t => Real.log (π t)) (fun t => Real.log (τ t)) (by linarith : 4 ≤ L) hs (show 0 ≤ w by linarith) hlogP hlogR have hminP := hprod P i (fun k p hp => (hP k p hp).1.pos) a b hPi ha hb have hminR := hprod R j (fun k p hp => (hR k p hp).1.pos) a' b' hRj ha' hb' have hMP := (hM Q (V i) ξ a hQ hQb hVi le_rfl ha).1 have hMR := (hM Q (W j) ξ a' hQ hQb hWj le_rfl ha').1 have hEP := (hE Q (V i) ξ a hQ hQb hVi le_rfl ha).2 have hER := (hE Q (W j) ξ a' hQ hQb hWj le_rfl ha').2 change ‖∑ t, ∑ r, ((μ t * ν r : ℝ) : ℂ) * (K t r * f t * g r)‖ ≤ _ rw [finite_weighted_pairing_reorder] apply finite_dyadic_pairing_polynomial_bound π τ μ ν hμ hν f g K hL0 (finite_dyadic_card_polynomial π hπ (by linarith) hs hmaxP) (finite_dyadic_card_polynomial τ hτ (by linarith) hs hmaxR) intro k _ l _ by_cases hfk : ∃ t, finiteDyadicTest π k f t ≠ 0 · by_cases hgl : ∃ r, finiteDyadicTest τ l g r ≠ 0 · have hU := finite_dyadic_endpoint_scales π f hπ (fun t _ => hminP t) hmaxP hfk have hT := finite_dyadic_endpoint_scales τ g hτ (fun t _ => hminR t) hmaxR hgl have hlog := dyadic_log_product_polynomial (show (0 : ℝ) < (2 ^ k : ℕ) by positivity) (show (0 : ℝ) < (2 ^ l : ℕ) by positivity) (by linarith : 2 ≤ L) hU.2 hT.2 have hp := hbound L q κ (s + 1) n x w z d A hL hq (by positivity) hd (by dsimp only [q]; linarith) (by dsimp only [x, n]; linarith) (by dsimp only [w]; linarith) (by dsimp only [d]; linarith) Q rfl hQ P V i R W j hV hW hP hR hVP hWR a b a' b' hPi hRj ha2 hb ha2' hb' h ξ hh hh2 hξ le_rfl le_rfl hEP hER hMP hMR hcells (2 ^ k) (2 ^ l) hU.1 hT.1 hlog (finiteDyadicTest π k f) (finiteDyadicTest τ l g) (finite_dyadic_test_range π f (fun t _ => hπ t) k) (finite_dyadic_test_range τ g (fun r _ => hτ r) l) (L ^ κ) (L ^ κ) (by positivity) (by positivity) le_rfl le_rfl hμatom hνatom α ζ hζ have he : -B - (s + 1) - (s + 1) = -A := by dsimp only [A]; ring rw [he, ← finite_weighted_pairing_reorder] exact hp · have hg0 : ∀ r, finiteDyadicTest τ l g r = 0 := by intro r by_contra hn exact hgl ⟨r, hn⟩ simp [hg0] · have hf0 : ∀ t, finiteDyadicTest π k f t = 0 := by intro t by_contra hn exact hfk ⟨t, hn⟩ simp [hf0] theorem eventually_prime_interval_mellin_power_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {a T : ℝ} (ha : 0 < a) (hT : 0 ≤ T) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (r : ℕ), 0 < r → (r : ℝ) ≤ L^T → ∀ χ : DirichletCharacter ℂ r, χ ≠ 1 → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ (Ioc m n).filter Nat.Prime, harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by have ha2 : 0 < a/2 := by positivity filter_upwards [eventually_prime_band_coprime_relative_power_bound hZ ha2 (Bsave+T+1), eventually_rpow_le_exp_sqrt T, eventually_ge_atTop (10 : ℝ)] with L hraw hmod hL10 intro Y hY r hr hrT χ hχ v hv m n hmn hYm hn have hL : 0 < L := by linarith have hY0 : 0 < Y := (Real.exp_pos _).trans_le hY have hrL : (r : ℝ) ≤ Real.exp L := hrT.trans (hmod.trans (Real.exp_le_exp.mpr (Real.sqrt_le_self_iff.mpr (Or.inr (by linarith))))) have hexp : Real.exp ((a/2)*L) < Y := by apply lt_of_lt_of_le _ hY exact Real.exp_lt_exp.mpr (by nlinarith) by_cases heq : m = n · subst n simp only [Ioc_self, filter_empty, sum_empty, norm_zero] positivity have hmn' : m < n := lt_of_le_of_ne hmn heq let g := fun i : ℕ => if i.Prime then χ (i : ZMod r) else 0 have hprefix : ∀ i ∈ Icc m n, ‖∑ j ∈ Ioc m i, g j‖ ≤ 2*Y*L^(-(Bsave+T+1)) := by intro i hi have hb := hraw r hr hrL χ hχ (i : ℝ) 1 (m : ℝ) (i : ℝ) (Nat.cast_nonneg _) zero_lt_one (Nat.cast_nonneg _) (Nat.cast_nonneg _) 1 (by omega) (by simpa only [Nat.cast_one] using Real.one_le_exp hL.le) have hset : ((primeBand (Real.exp ((a/2)*L)) (i : ℝ)).filter (fun p : ℕ => (m : ℝ) < 1*(p : ℝ) ∧ 1*(p : ℝ) ≤ i)).filter (fun p => p.Coprime 1) = (Ioc m i).filter Nat.Prime := by ext p simp only [mem_filter, mem_primeBand_iff (Real.exp_pos _).le (Nat.cast_nonneg i), one_mul, Nat.coprime_one_right_iff, and_true, mem_Ioc, Nat.cast_lt, Nat.cast_le] constructor · intro hp exact ⟨hp.2, hp.1.1⟩ · intro hp have hpY : Y ≤ (p : ℝ) := hYm.trans (Nat.cast_le.mpr hp.1.1) exact ⟨⟨hp.2, hexp.trans_le hpY, hp.1.2⟩, hp.1⟩ rw [hset, div_one] at hb have hiY : (i : ℝ) ≤ 2*Y := (Nat.cast_le.mpr (mem_Icc.mp hi).2).trans hn have hb' := hb.trans (mul_le_mul_of_nonneg_right hiY (by positivity)) simpa only [g, sum_filter] using hb' have hh := norm_harmonic_mellin_interval_sum_le g hY0 hmn' hYm hn (v := v) (B := 2*Y*L^(-(Bsave+T+1))) (by positivity) hprefix have hpow : 1 ≤ L^T := Real.one_le_rpow (by linarith) hT have hgain : 2*(3+2*|v|) ≤ L^(T+1) := by calc _ ≤ 10*L^T := by nlinarith _ ≤ L*L^T := mul_le_mul_of_nonneg_right hL10 (by positivity) _ = _ := by rw [Real.rpow_add hL, Real.rpow_one]; ring calc _ = ‖∑ i ∈ Ioc m n, harmonicMellinWeight v i*g i‖ := by simp only [sum_filter, g, mul_ite, mul_zero] _ ≤ ((3+2*|v|)/Y)*(2*Y*L^(-(Bsave+T+1))) := hh _ = (2*(3+2*|v|))*L^(-(Bsave+T+1)) := by field_simp _ ≤ L^(T+1)*L^(-(Bsave+T+1)) := mul_le_mul_of_nonneg_right hgain (by positivity) _ = L^(-Bsave) := by rw [← Real.rpow_add hL] congr 1 ring theorem eventually_prime_mellin_band_power_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {a C T : ℝ} (ha : 0 < a) (hC : 0 < C) (hT : 0 ≤ T) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ A B : ℝ, Real.exp (a*L) ≤ A → 0 ≤ B → B ≤ Real.exp (C*L) → ∀ (r : ℕ), 0 < r → (r : ℝ) ≤ L^T → ∀ χ : DirichletCharacter ℂ r, χ ≠ 1 → ∀ v : ℝ, |v| ≤ L^T → ‖∑ p ∈ primeBand A B, harmonicMellinWeight v p*χ (p : ZMod r)‖ ≤ L^(-Bsave) := by classical have ha2 : 0 < a/2 := by positivity filter_upwards [eventually_prime_interval_mellin_power_bound hZ ha2 hT (Bsave+2), eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (2*Real.log 2/a), eventually_ge_atTop (C/Real.log 2+1)] with L hprime hL1 hLa hLc have hL : 0 < L := zero_lt_one.trans_le hL1 intro A B hA hB hBmax r hr hrT χ hχ v hv have hA0 : 0 ≤ A := (Real.exp_pos _).le.trans hA let F := primeBand A B let w := fun p : ℕ => harmonicMellinWeight v p*χ (p : ZMod r) have hFpos : ∀ p ∈ F, 0 < p := fun p hp => ((mem_primeBand_iff hA0 hB p).mp hp).1.pos have hFlow : ∀ p ∈ F, Real.exp (a*L) < (p : ℝ) := fun p hp => hA.trans_lt ((mem_primeBand_iff hA0 hB p).mp hp).2.1 have hFupper : ∀ p ∈ F, p ≤ ⌊Real.exp (C*L)⌋₊ := fun p hp => Nat.le_floor (((mem_primeBand_iff hA0 hB p).mp hp).2.2.trans hBmax) have hcount : ((dyadicNatIndices F).card : ℝ) ≤ L^2 := by have hraw := dyadicNatIndices_card_le_log F ⌊Real.exp (C*L)⌋₊ hFupper have hNpos : 0 < ⌊Real.exp (C*L)⌋₊ := Nat.floor_pos.mpr (Real.one_le_exp (by positivity)) have hlog : Real.log (⌊Real.exp (C*L)⌋₊ : ℝ) ≤ C*L := by simpa only [Real.log_exp] using Real.log_le_log (Nat.cast_pos.mpr hNpos) (Nat.floor_le (Real.exp_pos _).le) have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) calc _ ≤ Real.log (⌊Real.exp (C*L)⌋₊ : ℝ)/Real.log 2+1 := hraw _ ≤ (C*L)/Real.log 2+1 := add_le_add (div_le_div_of_nonneg_right hlog hlog2.le) le_rfl _ ≤ (C*L)/Real.log 2+L := add_le_add le_rfl hL1 _ = (C/Real.log 2+1)*L := by ring _ ≤ L*L := mul_le_mul_of_nonneg_right hLc hL.le _ = L^2 := (pow_two L).symm have htwo : 2 ≤ Real.exp ((a/2)*L) := by apply (Real.log_le_iff_le_exp (by norm_num : (0 : ℝ) < 2)).mp have hh := (div_le_iff₀ ha).mp hLa nlinarith have hexp : 2*Real.exp ((a/2)*L) ≤ Real.exp (a*L) := by have hm := mul_le_mul_of_nonneg_right htwo (Real.exp_pos ((a/2)*L)).le have he : Real.exp ((a/2)*L)*Real.exp ((a/2)*L) = Real.exp (a*L) := by rw [← Real.exp_add] congr 1 ring rwa [he] at hm have hbucket : ∀ k ∈ dyadicNatIndices F, ‖∑ p ∈ dyadicNatBucket F k, w p‖ ≤ L^(-(Bsave+2)) := by intro k hk obtain ⟨p, hp⟩ := (dyadicNatBucket_nonempty_iff F k).mpr hk have hpb := dyadicNatBucket_bounds F hFpos hp have hpF := (mem_dyadicNatBucket F k p).mp hp |>.1 let Y : ℝ := (2 : ℝ)^k have hY0 : 0 < Y := by positivity have hYlow : Real.exp ((a/2)*L) ≤ Y := by have hpY : (p : ℝ) < 2*Y := by have hh : (p : ℝ) < (2 : ℝ)^(k+1) := by exact_mod_cast hpb.2 simpa only [pow_succ, Y, mul_comm] using hh have hpL := hFlow p hpF nlinarith let lo := max ⌊A⌋₊ (2^k-1) let hi := min ⌊B⌋₊ (2^(k+1)-1) have hrepr : dyadicNatBucket F k = (Ioc lo hi).filter Nat.Prime := dyadic_prime_band_bucket A B k have hpI : p ∈ Ioc lo hi := (mem_filter.mp (hrepr ▸ hp)).1 have hlohi : lo ≤ hi := (mem_Ioc.mp hpI).1.le.trans (mem_Ioc.mp hpI).2 have hYm : Y ≤ (lo+1 : ℕ) := by have hkpos : 0 < 2^k := by positivity have hh : 2^k ≤ lo+1 := by dsimp [lo]; omega dsimp [Y] exact_mod_cast hh have hhiY : (hi : ℝ) ≤ 2*Y := by have hh : hi ≤ 2^(k+1) := (min_le_right _ _).trans (Nat.sub_le _ _) have hhR : (hi : ℝ) ≤ (2 : ℝ)^(k+1) := by exact_mod_cast hh simpa only [pow_succ, Y, mul_comm] using hhR rw [hrepr] exact hprime Y hYlow r hr hrT χ hχ v hv lo hi hlohi hYm hhiY change ‖∑ p ∈ F, w p‖ ≤ _ rw [← sum_dyadicNatBuckets F w] calc _ ≤ ∑ k ∈ dyadicNatIndices F, ‖∑ p ∈ dyadicNatBucket F k, w p‖ := norm_sum_le _ _ _ ≤ ∑ _k ∈ dyadicNatIndices F, L^(-(Bsave+2)) := sum_le_sum hbucket _ = ((dyadicNatIndices F).card : ℝ)*L^(-(Bsave+2)) := by simp only [sum_const, nsmul_eq_mul] _ ≤ L^2*L^(-(Bsave+2)) := mul_le_mul_of_nonneg_right hcount (by positivity) _ = L^(-Bsave) := by rw [← Real.rpow_natCast L 2, ← Real.rpow_add hL] congr 1 norm_num theorem eventually_exponential_rough_test_mellin_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {γ C T : ℝ} (hγ : 0 < γ) (hC : 0 < C) (hT : 0 ≤ T) (Bsave : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ U V : ℝ, 1 ≤ U → 0 ≤ V → V ≤ Real.exp (C*L) → ∀ (r : ℕ), 0 < r → (r : ℝ) ≤ L^T → ∀ χ : DirichletCharacter ℂ r, χ ≠ 1 → ∀ v : ℝ, |v| ≤ L^T → ‖∑ n ∈ roughBand U V (Real.exp (γ*L)), harmonicMellinWeight v n*χ (n : ZMod r)‖ ≤ L^(-Bsave) := by classical filter_upwards [eventually_prime_mellin_band_power_bound hZ hγ hC hT (Bsave+2), eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (C+2)] with L hprime hL1 hLc have hL : 0 < L := zero_lt_one.trans_le hL1 intro U V hU hV hVmax r hr hrT χ hχ v hv by_cases hV1 : 1 ≤ V swap · have hVU : V ≤ U := by linarith simp only [roughBand, Ioc_eq_empty_of_le (Nat.floor_le_floor hVU), filter_empty, sum_empty, norm_zero] positivity let z := Real.exp (γ*L) let w := fun n : ℕ => harmonicMellinWeight v n*χ (n : ZMod r) have hwprod : ∀ p m : ℕ, 0 < p → 0 < m → w (p*m) = w p*w m := by intro p m hp hm dsimp [w] rw [Nat.cast_mul, harmonic_mellin_weight_mul v (Nat.cast_pos.mpr hp) (Nat.cast_pos.mpr hm), Nat.cast_mul, map_mul] ring have hwnorm : ∀ m : ℕ, 0 < m → ‖w m‖ ≤ 1/(m : ℝ) := by intro m hm dsimp [w] rw [norm_mul, norm_harmonic_mellin_weight v (Nat.cast_pos.mpr hm)] exact mul_le_of_le_one_right (by positivity) (χ.norm_le_one _) have hfirst : ‖∑ p ∈ primeBand (max U z) V, w p‖ ≤ L^(-(Bsave+2)) := hprime _ V (le_max_right _ _) hV hVmax r hr hrT χ hχ v hv have hinner : ∀ m ∈ roughBand 1 V z, ‖∑ p ∈ (primeBand z (m.minFac : ℝ)).filter (fun p : ℕ => U < (m : ℝ)*(p : ℝ) ∧ (m : ℝ)*(p : ℝ) ≤ V), w (p*m)‖ ≤ (1/(m : ℝ))*L^(-(Bsave+2)) := by intro m hm have hm0 := roughBand_pos hm have hmR : 0 < (m : ℝ) := Nat.cast_pos.mpr hm0 have hm1 : (1 : ℝ) ≤ m := by exact_mod_cast hm0 let P := (primeBand z (m.minFac : ℝ)).filter (fun p : ℕ => U < (m : ℝ)*(p : ℝ) ∧ (m : ℝ)*(p : ℝ) ≤ V) have hsum : (∑ p ∈ P, w (p*m)) = (∑ p ∈ P, w p)*w m := by rw [sum_mul] apply sum_congr rfl intro p hp exact hwprod p m ((mem_filter.mp (mem_filter.mp hp).1).2.pos) hm0 have hPbound : ‖∑ p ∈ P, w p‖ ≤ L^(-(Bsave+2)) := by dsimp [P] rw [primeBand_product_interval (Real.exp_pos _).le (Nat.cast_nonneg _) hmR (by linarith) hV] apply hprime _ _ (le_max_left _ _) (le_min (Nat.cast_nonneg _) (div_nonneg hV hmR.le)) _ r hr hrT χ hχ v hv exact (min_le_right _ _).trans ((div_le_self hV hm1).trans hVmax) change ‖∑ p ∈ P, w (p*m)‖ ≤ _ rw [hsum, norm_mul] have hmul := mul_le_mul hPbound (hwnorm m hm0) (norm_nonneg _) (by positivity) exact hmul.trans_eq (mul_comm _ _) have hlogV : Real.log V ≤ C*L := by simpa only [Real.log_exp] using Real.log_le_log (zero_lt_one.trans_le hV1) hVmax have hmass : (∑ m ∈ roughBand 1 V z, 1/(m : ℝ)) ≤ 1+C*L := (roughBandHarmonic_le_log hV1).trans (add_le_add le_rfl hlogV) have hscale : 2+C*L ≤ L^2 := by have hh := mul_le_mul_of_nonneg_right hLc hL.le nlinarith change ‖∑ n ∈ roughBand U V z, w n‖ ≤ _ rw [weighted_rough_band_cofactor_identity hU hV (Real.exp_pos _).le w] calc _ ≤ ‖∑ p ∈ primeBand (max U z) V, w p‖+ ‖∑ m ∈ roughBand 1 V z, ∑ p ∈ (primeBand z (m.minFac : ℝ)).filter (fun p : ℕ => U < (m : ℝ)*(p : ℝ) ∧ (m : ℝ)*(p : ℝ) ≤ V), w (p*m)‖ := norm_add_le _ _ _ ≤ L^(-(Bsave+2))+∑ m ∈ roughBand 1 V z, (1/(m : ℝ))*L^(-(Bsave+2)) := by apply add_le_add hfirst exact (norm_sum_le _ _).trans (sum_le_sum hinner) _ = (1+∑ m ∈ roughBand 1 V z, 1/(m : ℝ))*L^(-(Bsave+2)) := by rw [← sum_mul]; ring _ ≤ (2+C*L)*L^(-(Bsave+2)) := by apply mul_le_mul_of_nonneg_right _ (by positivity) linarith _ ≤ L^2*L^(-(Bsave+2)) := mul_le_mul_of_nonneg_right hscale (by positivity) _ = L^(-Bsave) := by rw [← Real.rpow_natCast L 2, ← Real.rpow_add hL] congr 1 norm_num theorem eventually_prime_grouped_actual_comparison (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c κ s z v D : ℝ) (hc : 0 < c) (hκ : 0 ≤ κ) (hs : 0 ≤ s) (hz : 0 ≤ z) (hD : 0 ≤ D) : let A₀ := D + 2 * (s + 1) let q := 2 * κ + (s + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type u} [Fintype G] [DecidableEq G] {I : G → Type u} [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)], ∀ (P : G → Finset ℕ) (V : G → ℝ), (∀ g, 0 < V g) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, L ^ (-v) ≤ V g) → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ (probes tails : ∀ g, Finset (I g)), (∀ g, Disjoint (probes g) (tails g)) → ∀ m ell : ℕ, 0 < m → (∀ g, (probes g).card = m) → (∀ g, (tails g).card = ell) → ∀ r t : Finset G, Disjoint r t → ∀ active : Finset (Sigma I), activeᶜ = univ.sigma tails → (∀ U ∈ cleanNonemptySubsets (r.sigma probes) ∪ cleanNonemptySubsets (t.sigma probes), ∀ a : (∀ i : U, P i.1.1), Real.log (∏ i : U, (a i).val : ℕ) ≤ L ^ s) → (∀ U ∈ cleanNonemptySubsets (r.sigma probes) ∪ cleanNonemptySubsets (t.sigma probes), ∀ n : ℕ, (∑ a ∈ univ.filter (fun a : (∀ i : U, P i.1.1) => (∏ i : U, (a i).val : ℕ) = n), finiteProductWeight (physicalLabelLaw (P := fun i : U => P i.1.1) (fun i => V i.1.1)) a) ≤ L ^ κ / (n : ℝ)) → ∀ ζ Θ : ℝ, |ζ| ≤ L ^ z → ∀ f g : (∀ g, I g → P g) → ℂ, (∀ a, finiteGroupSlotSymmetric a f) → (∀ a, finiteGroupSlotSymmetric a g) → let kept := fun U : Finset (Sigma I) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ ‖cleanRawPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeActivePhase (fun a : Sigma I => P a.1) active ζ Θ) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g) - ∑ A ∈ cleanNonemptySubsets (r.sigma probes), ∑ B ∈ cleanNonemptySubsets (t.sigma probes), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeAsymmetricComparisonKernel (fun a : Sigma I => P a.1) (fun a => V a.1) active Q h kept kept ζ Θ A B) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g)‖ ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma probes).card + (t.sigma probes).card) * L ^ (-D)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) g) := by intro A₀ q w x filter_upwards [eventually_prime_arbitrary_test_comparison.{u} hZ c κ s z v D hc hκ hs hz hD, eventually_gt_atTop (0 : ℝ)] with L hcomp hL intro Q h ξ G _ _ I _ _ P V hV hP hmass hVlower hband probes tails hpt m ell hm hp ht r t hrt active hactive hlog hatom ζ Θ hζ f g hf hg kept apply prime_grouped_block_bound_of_free_tuple_estimates P V hV (fun a p hp => (hP a p hp).1.pos) hmass probes tails hpt m ell hm hp ht r t hrt active hactive Q h kept kept ζ Θ f g hf hg (L ^ (-D)) (by positivity) intro A hA B hB α fA gB obtain ⟨a, ha⟩ := Finset.nonempty_iff_ne_empty.mpr ((clean_mem_nonempty_subsets _ _).mp hA).1 obtain ⟨b, hb⟩ := Finset.nonempty_iff_ne_empty.mpr ((clean_mem_nonempty_subsets _ _).mp hB).1 obtain ⟨a₀, a₁, hPa, ha₀, ha₁⟩ := hband a.1 obtain ⟨b₀, b₁, hPb, hb₀, hb₁⟩ := hband b.1 have he := hcomp (fun i : A => P i.1.1) (fun i => V i.1.1) ⟨a, ha⟩ (fun i : B => P i.1.1) (fun i => V i.1.1) ⟨b, hb⟩ (fun i => hV i.1.1) (fun i => hV i.1.1) (fun i => hP i.1.1) (fun i => hP i.1.1) (fun i => hmass i.1.1) (fun i => hmass i.1.1) (hVlower a.1) (hVlower b.1) a₀ a₁ b₀ b₁ hPa hPb ha₀ ha₁ hb₀ hb₁ (hlog A (mem_union_left _ hA)) (hlog B (mem_union_right _ hB)) (hatom A (mem_union_left _ hA)) (hatom B (mem_union_right _ hB)) fA gB α ζ hζ have hEA : 0 ≤ ∑ a : (∀ i : A, P i.1.1), finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.1.1) (fun i => V i.1.1)) a * ‖fA a‖ ^ 2 := by apply sum_nonneg intro a _ apply mul_nonneg _ (sq_nonneg _) exact prod_nonneg (fun i _ => physical_label_law_nonneg (P := fun i : A => P i.1.1) (fun i : A => V i.1.1) (fun i => (hV i.1.1).le) i (a i)) dsimp only at he rw [Real.sqrt_mul hEA] at he simpa only [finiteTwoKernelPairingError, finiteWeightedEnergy, mul_assoc] using he theorem eventually_prime_grouped_disjoint_pool_comparison (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c s z a v D ε : ℝ) (m : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (hm : 0 < m) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type u} [Fintype G] [DecidableEq G] {I : G → Type u} [∀ g, Fintype (I g)] [∀ g, DecidableEq (I g)], ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ (probes tails : ∀ g, Finset (I g)), (∀ g, Disjoint (probes g) (tails g)) → ∀ ell : ℕ, (∀ g, (probes g).card = m) → (∀ g, (tails g).card = ell) → ∀ r t : Finset G, Disjoint r t → ∀ active : Finset (Sigma I), activeᶜ = univ.sigma tails → ∀ ζ Θ : ℝ, |ζ| ≤ L ^ z → ∀ f g : (∀ g, I g → P g) → ℂ, (∀ a, finiteGroupSlotSymmetric a f) → (∀ a, finiteGroupSlotSymmetric a g) → let kept := fun U : Finset (Sigma I) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ ‖cleanRawPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeActivePhase (fun a : Sigma I => P a.1) active ζ Θ) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g) - ∑ A ∈ cleanNonemptySubsets (r.sigma probes), ∑ B ∈ cleanNonemptySubsets (t.sigma probes), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight (fun a : Sigma I => physicalLabelLaw V a.1)) (primeAsymmetricComparisonKernel (fun a : Sigma I => P a.1) (fun a => V a.1) active Q h kept kept ζ Θ A B) (finiteGroupedTailTest (physicalLabelLaw V) tails f) (finiteGroupedTailTest (physicalLabelLaw V) tails g)‖ ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma probes).card + (t.sigma probes).card) * L ^ (-D)) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) f) * Real.sqrt (finiteWeightedEnergy (finiteProductWeight (fun g => finiteProductWeight (fun _ : I g => physicalLabelLaw V g))) g) := by intro κ s' A₀ q w x have hκ : 0 ≤ a * Real.log (primeFiberFactorBound v m) := mul_nonneg ha (Real.log_nonneg (one_le_primeFiberFactorBound v m)) filter_upwards [eventually_prime_grouped_actual_comparison.{u} hZ c (a * Real.log (primeFiberFactorBound v m)) (s + ε) z 1 D hc hκ (add_nonneg hs hε.le) hz hD, eventually_prime_subset_product_log_rpow a s ε m hs hε, eventually_gt_atTop (0 : ℝ), eventually_ge_atTop (1 / v)] with L hcomp hlogs hL hlarge intro Q h ξ G _ _ I _ _ P V hdisj hP hmass hV hlog hcard hband probes tails hpt ell hp ht r t hrt active hactive ζ Θ hζ f g hf hg kept have hVpos (g : G) : 0 < V g := hv.trans_le (hV g) have hVlower (g : G) : L ^ (-1 : ℝ) ≤ V g := by have hb := one_div_le_one_div_of_le (one_div_pos.mpr hv) hlarge have hb' : 1 / L ≤ v := by simpa only [one_div_one_div] using hb simpa only [Real.rpow_neg_one, one_div] using hb'.trans (hV g) have hprime (g : G) (p : ℕ) (hp : p ∈ P g) : p.Prime := (hP g p hp).1 have hpos (g : G) (p : ℕ) (hp : p ∈ P g) : 0 < p := (hprime g p hp).pos have hm' (g : G) : (probes g).card ≤ m := (hp g).le apply hcomp P V hVpos hP hmass hVlower hband probes tails hpt m ell hm hp ht r t hrt active hactive ?_ ?_ ζ Θ hζ f g hf hg · intro U hU b rcases mem_union.mp hU with hU | hU · exact hlogs P r probes hm' hpos hlog hcard U ((clean_mem_nonempty_subsets _ _).mp hU).2 b · exact hlogs P t probes hm' hpos hlog hcard U ((clean_mem_nonempty_subsets _ _).mp hU).2 b · intro U hU n rcases mem_union.mp hU with hU | hU · exact prime_subset_physical_atom_rpow P V hprime hdisj r probes m hv hL hV hm' hcard U ((clean_mem_nonempty_subsets _ _).mp hU).2 n · exact prime_subset_physical_atom_rpow P V hprime hdisj t probes m hv hL hV hm' hcard U ((clean_mem_nonempty_subsets _ _).mp hU).2 n theorem eventually_repeated_big_prime_disjoint_pool_comparison (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c s z a v D ε : ℝ) (m : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (hm : 0 < m) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G] (J ell : ℕ), ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, Disjoint r t → ∀ ζ Θ : ℝ, |ζ| ≤ L ^ z → ∀ f g : RepeatedBigLists P J ell → ℂ, f ∈ repeatedBigSymmetricSubspace → g ∈ repeatedBigSymmetricSubspace → let slots := fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)) let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ ‖cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeRawRow P V ζ Θ) f g - ∑ A ∈ cleanNonemptySubsets (r.sigma slots), ∑ B ∈ cleanNonemptySubsets (t.sigma slots), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeComparisonRow P V A B Q h kept kept ζ Θ) f g‖ ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma slots).card + (t.sigma slots).card) * L ^ (-D)) * Real.sqrt (finiteWeightedEnergy (repeatedBigActiveMass V (fun _ _ => 1)) f) * Real.sqrt (finiteWeightedEnergy (repeatedBigActiveMass V (fun _ _ => 1)) g) := by intro κ s' A₀ q w x filter_upwards [eventually_prime_grouped_disjoint_pool_comparison.{0} hZ c s z a v D ε m hc hs hz ha hv hD hε hm] with L hcomp intro Q h ξ G _ _ J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ f g hf hg slots kept have hVpos (j : G) : 0 < V j := hv.trans_le (hV j) have hPpos (j : G) (p : ℕ) (hp : p ∈ P j) : 0 < p := (hP j p hp).1.pos have hμ (j : G) (p : P j) : physicalLabelLaw V j p ≠ 0 := by unfold physicalLabelLaw apply div_ne_zero one_ne_zero exact mul_ne_zero (hVpos j).ne' (by exact_mod_cast (hPpos j p.val p.property).ne') have hslots (j : G) : Disjoint (slots j) (repeatedBigPrimeTailSlots J ell) := by apply disjoint_left.mpr intro i hi ht rcases mem_map.mp hi with ⟨k, _, rfl⟩ rcases mem_map.mp ht with ⟨l, _, he⟩ cases he have hcount (j : G) : (slots j).card = m := by simpa only [slots, card_map] using hp j have htailcount (j : G) : (repeatedBigPrimeTailSlots J ell).card = ell := by simp only [repeatedBigPrimeTailSlots, card_map, card_univ, Fintype.card_fin] have hbound := hcomp P V hdisj hP hmass hV hlog hcard hband slots (fun _ => repeatedBigPrimeTailSlots J ell) hslots ell hcount htailcount r t hrt (repeatedBigFlatActive J ell) (repeatedBigPrimeTailSlots_compl J ell) ζ Θ hζ f g ((repeated_big_symmetric_iff_group_slot_symmetric f).mp hf) ((repeated_big_symmetric_iff_group_slot_symmetric g).mp hg) have hraw := repeated_big_prime_raw_pairing P V (fun j => physical_label_law_sum V j (hVpos j) (hmass j)) hμ ζ Θ f g change cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeRawRow P V ζ Θ) f g = _ at hraw have hsub (u : Finset G) : u.sigma slots ⊆ repeatedBigFlatActive J ell := by rintro ⟨j, i⟩ hi rcases mem_map.mp (mem_sigma.mp hi).2 with ⟨k, _, rfl⟩ exact repeatedBigFlatActive_mem_inl J ell j k have hrt' : Disjoint (r.sigma slots) (t.sigma slots) := by apply disjoint_left.mpr intro i hi hj exact disjoint_left.mp hrt (mem_sigma.mp hi).1 (mem_sigma.mp hj).1 have hpair (A : Finset (RepeatedBigFlatIndex G J ell)) (hA : A ∈ cleanNonemptySubsets (r.sigma slots)) (B : Finset (RepeatedBigFlatIndex G J ell)) (hB : B ∈ cleanNonemptySubsets (t.sigma slots)) : cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeComparisonRow P V A B Q h kept kept ζ Θ) f g = cleanKernelPairing (finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1)) (primeAsymmetricComparisonKernel (fun i : RepeatedBigFlatIndex G J ell => P i.1) (fun i => V i.1) (repeatedBigFlatActive J ell) Q h kept kept ζ Θ A B) (finiteGroupedTailTest (physicalLabelLaw V) (fun _ => repeatedBigPrimeTailSlots J ell) f) (finiteGroupedTailTest (physicalLabelLaw V) (fun _ => repeatedBigPrimeTailSlots J ell) g) := by have ha := ((clean_mem_nonempty_subsets _ _).mp hA).2 have hb := ((clean_mem_nonempty_subsets _ _).mp hB).2 simpa only [finiteGroupedTailTest, repeatedBigPrimeTailSlots_compl] using repeated_big_prime_comparison_pairing_tail_eq P V hVpos hPpos hmass A B (ha.trans (hsub r)) (hb.trans (hsub t)) (hrt'.mono ha hb) Q h kept kept ζ Θ f g have hsum : (∑ A ∈ cleanNonemptySubsets (r.sigma slots), ∑ B ∈ cleanNonemptySubsets (t.sigma slots), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigPrimeComparisonRow P V A B Q h kept kept ζ Θ) f g) = ∑ A ∈ cleanNonemptySubsets (r.sigma slots), ∑ B ∈ cleanNonemptySubsets (t.sigma slots), (-1 : ℂ) ^ (A.card + B.card) * cleanKernelPairing (finiteProductWeight (fun i : RepeatedBigFlatIndex G J ell => physicalLabelLaw V i.1)) (primeAsymmetricComparisonKernel (fun i : RepeatedBigFlatIndex G J ell => P i.1) (fun i => V i.1) (repeatedBigFlatActive J ell) Q h kept kept ζ Θ A B) (finiteGroupedTailTest (physicalLabelLaw V) (fun _ => repeatedBigPrimeTailSlots J ell) f) (finiteGroupedTailTest (physicalLabelLaw V) (fun _ => repeatedBigPrimeTailSlots J ell) g) := by apply sum_congr rfl intro A hA apply sum_congr rfl intro B hB rw [hpair A hA B hB] rw [hraw, hsum, repeated_big_active_mass_product V] exact hbound theorem eventually_repeated_big_prime_projected_norm_le (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c s z a v D ε : ℝ) (m : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (hm : 0 < m) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G] (J ell : ℕ), ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, Disjoint r t → ∀ ζ Θ : ℝ, |ζ| ≤ L ^ z → ∀ u : RepeatedBigLists P J ell → ℂ, u ∈ repeatedBigSymmetricSubspace → let slots := fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)) let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigSymmetrizeLinear (fun source => ∑ target, repeatedBigPrimeDifferenceKernel P V probes r t Q h kept ζ Θ source target * u target)) ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma slots).card + (t.sigma slots).card) * L ^ (-D)) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) u := by intro κ s' A₀ q w x filter_upwards [eventually_repeated_big_prime_disjoint_pool_comparison hZ c s z a v D ε m hc hs hz ha hv hD hε hm, eventually_gt_atTop (0 : ℝ)] with L hcomp hL intro Q h ξ G _ _ J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ u hu slots kept apply repeated_big_kernel_norm_le_of_bilinear V (fun j => (hv.trans_le (hV j)).le) (repeatedBigPrimeDifferenceKernel P V probes r t Q h kept ζ Θ) (by positivity) _ u hu intro f g hf hg rw [repeated_big_prime_difference_pairing] exact hcomp J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ f g hf hg theorem eventually_prime_proxy_character_discrepancy (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {a S T Bsave : ℝ} (ha : 0 < a) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+Bsave+2 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by filter_upwards [eventually_prime_proxy_mellin_difference_bound ha hS hT hprecision, eventually_prime_logarithmic_proxy_principal_identity ha S T, eventually_prime_interval_mellin_power_bound hZ ha hT (Bsave+1), eventually_prime_logarithmic_proxy_mellin_power_bound ha hS hT (Bsave+1), eventually_ge_atTop (2 : ℝ)] with L hprincipal hidentity hprime hproxy hL2 have hL : 0 < L := by linarith intro Y hY r hr χ hrT v hv m n hmn hYm hn have hrpos : 0 < r := Nat.pos_of_ne_zero (NeZero.ne r) by_cases hχ : χ = 1 · subst χ have heq : (∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight v i*(1 : DirichletCharacter ℂ r) (i : ZMod r)) = ∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight v i := by apply sum_congr rfl intro i hi have hiY : Real.exp (a*L) ≤ (i : ℝ) := hY.trans (hYm.trans (Nat.cast_le.mpr (mem_Ioc.mp hi).1)) have hiid := hidentity i hiY r hrpos hrT calc _ = ((((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* (1 : DirichletCharacter ℂ r) (i : ZMod r))*harmonicMellinWeight v i := by ring _ = _ := by rw [hiid] rw [heq] exact hprincipal Y hY v hv m n hmn hYm hn · have hp := hprime Y hY r hrpos hrT χ hχ v hv m n hmn hYm hn have hb := hproxy Y hY r χ hχ hrT v hv m n hmn hYm hn have heq : (∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)) = (∑ i ∈ (Ioc m n).filter Nat.Prime, harmonicMellinWeight v i*χ (i : ZMod r))- ∑ i ∈ Ioc m n, (primeLogarithmicProxy L S i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r) := by simp only [sum_filter, Complex.ofReal_sub, sub_mul, sum_sub_distrib] congr 1 apply sum_congr rfl intro i _ by_cases hi : i.Prime <;> simp [hi] rw [heq] apply (norm_sub_le _ _).trans apply (add_le_add hp hb).trans have he : L^(-(Bsave+1)) = L^(-Bsave)/L := by rw [show -(Bsave+1) = -Bsave+(-1) by ring, Real.rpow_add hL, Real.rpow_neg_one] ring rw [he, ← add_div] apply (div_le_iff₀ hL).mpr nlinarith [mul_le_mul_of_nonneg_left hL2 (Real.rpow_nonneg hL.le (-Bsave))] theorem eventually_rough_test_proxy_character_discrepancy (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {a γ C S T Bsave : ℝ} (ha : 0 < a) (hγ : 0 < γ) (hC : 0 < C) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+Bsave+2 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ Y : ℝ, Real.exp (a*L) ≤ Y → Y ≤ Real.exp (C*L) → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ v : ℝ, |v| ≤ L^T → ∀ m n : ℕ, m ≤ n → Y ≤ (m+1 : ℕ) → (n : ℝ) ≤ 2*Y → ‖∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)‖ ≤ L^(-Bsave) := by classical have hC1 : 0 < C+1 := by linarith filter_upwards [eventually_rough_test_proxy_mellin_difference_bound ha hγ hS hT hprecision, eventually_rough_test_proxy_principal_identity hγ S T, eventually_exponential_rough_test_mellin_bound hZ hγ hC1 hT (Bsave+1), eventually_rough_test_logarithmic_proxy_mellin_power_bound ha hγ hS hT (Bsave+1), eventually_ge_atTop (2 : ℝ), eventually_ge_atTop (2/a)] with L hprincipal hidentity hrough hproxy hL2 hLa have hL : 0 < L := by linarith intro Y hY hYup r hr χ hrT v hv m n hmn hYm hn have hrpos : 0 < r := Nat.pos_of_ne_zero (NeZero.ne r) have hY3 : 3 ≤ Y := by have hLa' := (div_le_iff₀ ha).mp hLa have hexp := Real.add_one_le_exp (a*L) nlinarith have hm1 : 1 ≤ (m : ℝ) := by push_cast at hYm linarith have hnexp : (n : ℝ) ≤ Real.exp ((C+1)*L) := by have htwo : 2 ≤ Real.exp L := by linarith [Real.add_one_le_exp L] calc _ ≤ 2*Y := hn _ ≤ 2*Real.exp (C*L) := mul_le_mul_of_nonneg_left hYup (by norm_num) _ ≤ Real.exp L*Real.exp (C*L) := mul_le_mul_of_nonneg_right htwo (Real.exp_pos _).le _ = Real.exp ((C+1)*L) := by rw [← Real.exp_add]; congr 1; ring by_cases hχ : χ = 1 · subst χ have heq : (∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight v i*(1 : DirichletCharacter ℂ r) (i : ZMod r)) = ∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight v i := by apply sum_congr rfl intro i hi have hi0 : 0 < i := lt_of_le_of_lt (Nat.zero_le _) (mem_Ioc.mp hi).1 have hiid := hidentity i hi0 r hrpos hrT calc _ = (((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* (1 : DirichletCharacter ℂ r) (i : ZMod r))*harmonicMellinWeight v i := by ring _ = _ := by rw [hiid] rw [heq] exact hprincipal Y hY v hv m n hmn hYm hn · have hp := hrough (m : ℝ) (n : ℝ) hm1 (Nat.cast_nonneg _) hnexp r hrpos hrT χ hχ v hv have hb := hproxy Y hY r χ hχ hrT v hv m n hmn hYm hn have heq : (∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r)) = (∑ i ∈ roughBand (m : ℝ) (n : ℝ) (Real.exp (γ*L)), harmonicMellinWeight v i*χ (i : ZMod r))- ∑ i ∈ Ioc m n, (roughTestLogarithmicProxy γ L S i : ℂ)* harmonicMellinWeight v i*χ (i : ZMod r) := by simp only [roughBand, Nat.floor_natCast, sum_filter, Complex.ofReal_sub, sub_mul, sum_sub_distrib] congr 1 apply sum_congr rfl intro i _ by_cases hi : exponentialRoughTest γ L i · simp only [roughTestIndicator, if_pos hi, Complex.ofReal_one, one_mul] unfold exponentialRoughTest at hi rw [if_pos hi] · simp only [roughTestIndicator, if_neg hi, Complex.ofReal_zero, zero_mul] unfold exponentialRoughTest at hi rw [if_neg hi] rw [heq] apply (norm_sub_le _ _).trans apply (add_le_add hp hb).trans have he : L^(-(Bsave+1)) = L^(-Bsave)/L := by rw [show -(Bsave+1) = -Bsave+(-1) by ring, Real.rpow_add hL, Real.rpow_neg_one] ring rw [he, ← add_div] apply (div_le_iff₀ hL).mpr nlinarith [mul_le_mul_of_nonneg_left hL2 (Real.rpow_nonneg hL.le (-Bsave))] theorem eventually_repeated_big_prime_pattern_norm_le (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c s z a v D ε : ℝ) (m : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (hm : 0 < m) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G] (J ell : ℕ), ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, ∀ hrt : Disjoint r t, ∀ ζ Θ : ℝ, |ζ| ≤ L ^ z → ∀ u : RepeatedBigLists P J ell → ℂ, u ∈ repeatedBigSymmetricSubspace → let slots := fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)) let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigSymmetrizeLinear (fun source => ∑ target, (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i), repeatedBigPrimePatternWeight probes r t i * repeatedBigUnbannedKernel V (fun _ _ => 1) (repeatedBigPrimePatternCut probes r t i) ζ (repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i) aux source target * physicalReturnPhase Θ (repeatedBigD (repeatedBigPrimePatternCut probes r t i) source aux)) * u target)) ≤ (Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + Real.sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma slots).card + (t.sigma slots).card) * L ^ (-D)) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) u := by intro κ s' A₀ q w x filter_upwards [eventually_repeated_big_prime_projected_norm_le hZ c s z a v D ε m hc hs hz ha hv hD hε hm] with L hnorm intro Q h ξ G _ _ J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ u hu slots kept have hb := hnorm J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ u hu simpa only [repeated_big_prime_pattern_family_kernel] using hb end Bounty.WeakZeroFree section /- Direct finite weighted energy bounds for the signed clean-prime operator. -/ open Finset Real namespace ThirdCleanEnergy open Bounty theorem norm_mono {X : Type*} [Fintype X] (μ ν : X → ℝ) (h : ∀ x, μ x ≤ ν x) (f : X → ℂ) : cleanActiveNorm μ f ≤ cleanActiveNorm ν f := by apply sqrt_le_sqrt exact sum_le_sum fun x _ => mul_le_mul_of_nonneg_right (h x) (sq_nonneg _) theorem norm_le_scaled {X : Type*} [Fintype X] (μ ν : X → ℝ) {C : ℝ} (hC : 0 ≤ C) (h : ∀ x, ν x ≤ C * μ x) (f : X → ℂ) : cleanActiveNorm ν f ≤ sqrt C * cleanActiveNorm μ f := by unfold cleanActiveNorm rw [← sqrt_mul hC, mul_sum] apply sqrt_le_sqrt exact sum_le_sum fun x _ => by simpa only [mul_assoc] using mul_le_mul_of_nonneg_right (h x) (sq_nonneg ‖f x‖) end ThirdCleanEnergy end section /- Direct comparison of the actual tilted target law with the untilted law. -/ open Finset Real open scoped Classical namespace ThirdCleanTransfer open Bounty theorem target_mass_density {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (x : RepeatedBigLists P J ell) : repeatedBigTargetMass V b C x = repeatedBigTargetMass V (fun _ _ => 1) C x * cleanUnsharedDensity b C x := by classical simp only [repeated_big_target_mass_physical, cleanUnsharedDensity, tiltedPhysicalBirthLaw, div_eq_mul_inv, one_mul, prod_mul_distrib, inv_one, mul_one] theorem unshared_density_bounds {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (b : ∀ g, P g → ℝ) (hb : ∀ g p, 0 < b g p ∧ b g p ≤ 1) (C : G → Finset (Fin J)) (x : RepeatedBigLists P J ell) : 1 ≤ cleanUnsharedDensity b C x ∧ cleanUnsharedDensity b C x ≤ cleanActiveDensity b x := by have hfactor (g : G) (p : P g) : 1 ≤ 1 / b g p := (le_div_iff₀ (hb g p).1).2 (by simpa using (hb g p).2) have hu : 1 ≤ cleanUnsharedDensity b C x := one_le_prod₀ fun g _ => one_le_prod₀ fun s _ => hfactor g (x g s) refine ⟨hu, ?_⟩ have hs : 1 ≤ cleanSharedDensity b C x := one_le_prod₀ fun g _ => one_le_prod₀ fun s _ => hfactor g (x g s) rw [clean_active_density_split b C x] exact le_mul_of_one_le_left (zero_le_one.trans hu) hs theorem banned_density {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (a : PhysicalAuxLabels P C) (x y : RepeatedBigLists P J ell) : repeatedBigKernel V b C ζ K a x y = (cleanUnsharedDensity b C y : ℂ) * repeatedBigKernel V (fun _ _ => 1) C ζ K a x y := by classical unfold repeatedBigKernel split_ifs · rw [target_mass_density] push_cast ring · simp theorem scalar_error {d δ : ℝ} (hd : 1 ≤ d) (hδ : d ≤ 1 + δ) (z : ℂ) : ‖(d : ℂ)*z-z‖ ≤ δ*‖z‖ := by have heq : (d : ℂ)*z-z = ((d-1 : ℝ) : ℂ)*z := by push_cast; ring rw [heq, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (by linarith)] exact mul_le_mul_of_nonneg_right (by linarith) (norm_nonneg _) theorem banned_density_error {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (hb : ∀ g p, 0 < b g p ∧ b g p ≤ 1) {δ : ℝ} (hd : ∀ x : RepeatedBigLists P J ell, cleanActiveDensity b x ≤ 1 + δ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (a : PhysicalAuxLabels P C) (x y : RepeatedBigLists P J ell) : ‖repeatedBigKernel V b C ζ K a x y - repeatedBigKernel V (fun _ _ => 1) C ζ K a x y‖ ≤ δ*‖repeatedBigKernel V (fun _ _ => 1) C ζ K a x y‖ := by rw [banned_density] have h := unshared_density_bounds b hb C y exact scalar_error h.1 (h.2.trans (hd y)) _ noncomputable def bannedAction {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (f : RepeatedBigLists P J ell → ℂ) : RepeatedBigLists P J ell → ℂ := fun x => ∑ y, (∑ a, repeatedBigKernel V b C ζ K a x y) * f y noncomputable def unbannedAction {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (C : G → Finset (Fin J)) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (f : RepeatedBigLists P J ell → ℂ) : RepeatedBigLists P J ell → ℂ := fun x => ∑ y, (∑ a, repeatedBigUnbannedKernel V b C ζ K a x y) * f y theorem tilt_operator_error {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (hb : ∀ g p, 0 < b g p ∧ b g p ≤ 1) {δ : ℝ} (hδ : 0 ≤ δ) (hd : ∀ x : RepeatedBigLists P J ell, cleanActiveDensity b x ≤ 1 + δ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) (f : RepeatedBigLists P J ell → ℂ) : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (bannedAction V b C ζ K f - bannedAction V (fun _ _ => 1) C ζ K f) ≤ (δ * B) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f := by classical have h := repeated_big_dominated_schur V C hV hMass ζ K B hB hK (fun x y => ∑ a, (repeatedBigKernel V b C ζ K a x y - repeatedBigKernel V (fun _ _ => 1) C ζ K a x y)) δ hδ (fun x y => by calc _ ≤ ∑ a, ‖repeatedBigKernel V b C ζ K a x y - repeatedBigKernel V (fun _ _ => 1) C ζ K a x y‖ := norm_sum_le _ _ _ ≤ ∑ a, δ * ‖repeatedBigKernel V (fun _ _ => 1) C ζ K a x y‖ := sum_le_sum fun a _ => banned_density_error V b hb hd C ζ K a x y _ = _ := (mul_sum ..).symm) f simpa only [Pi.sub_def, bannedAction, sum_sub_distrib, sub_mul] using h theorem full_operator_error {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (hb : ∀ g p, 0 < b g p ∧ b g p ≤ 1) {δ : ℝ} (hδ : 0 ≤ δ) (hd : ∀ x : RepeatedBigLists P J ell, cleanActiveDensity b x ≤ 1 + δ) (C : G → Finset (Fin J)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (f : RepeatedBigLists P J ell → ℂ) : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (bannedAction V b C ζ K f - unbannedAction V (fun _ _ => 1) C ζ K f) ≤ (B * (δ + ∑ g, (C g).card * (2 * (J + ell : ℕ)) / (V g * Pmin))) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f := by classical have ht := tilt_operator_error V b hb hδ hd C hV hMass ζ K B hB hK f have he := repeated_big_ban_removal_operator_error V C hV hMass ζ K B hB hK hPmin hp f simp only [sum_sub_distrib, sub_mul] at he change cleanActiveNorm _ (unbannedAction V (fun _ _ => 1) C ζ K f - bannedAction V (fun _ _ => 1) C ζ K f) ≤ _ at he have htriangle := clean_active_norm_sub_le (repeatedBigActiveMass V (fun _ _ => 1)) (fun x => repeated_big_untilted_active_mass_nonneg V (fun g => (hV g).le) x) (bannedAction V b C ζ K f - bannedAction V (fun _ _ => 1) C ζ K f) (unbannedAction V (fun _ _ => 1) C ζ K f - bannedAction V (fun _ _ => 1) C ζ K f) have hid : (bannedAction V b C ζ K f - bannedAction V (fun _ _ => 1) C ζ K f) - (unbannedAction V (fun _ _ => 1) C ζ K f - bannedAction V (fun _ _ => 1) C ζ K f) = bannedAction V b C ζ K f - unbannedAction V (fun _ _ => 1) C ζ K f := by abel rw [hid] at htriangle exact htriangle.trans ((add_le_add ht he).trans_eq (by ring)) theorem initial_operator_error {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (hb : ∀ g p, 0 < b g p ∧ b g p ≤ 1) {δ : ℝ} (hδ : 0 ≤ δ) (hd : ∀ x : RepeatedBigLists P J ell, cleanActiveDensity b x ≤ 1 + δ) (C : G → Finset (Fin J)) (F : ∀ g, Finset (P g)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (B : ℝ) (hB : 0 ≤ B) (hK : ∀ x y a, ‖K x y a‖ ≤ B) {Pmin : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (f : RepeatedBigLists P J ell → ℂ) : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (bannedAction V b C ζ (cleanInitialBirthKernel F C K) f - unbannedAction V (fun _ _ => 1) C ζ K f) ≤ (B * (δ + (∑ g, (C g).card * (2 * (J + ell : ℕ)) / (V g * Pmin)) + sqrt (repeatedBigInitialForbiddenProbability (ell := ell) V C F Pmin))) * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f := by have ht := full_operator_error V b hb hδ hd C hV hMass ζ (cleanInitialBirthKernel F C K) B hB (clean_initial_birth_kernel_norm_le F C K B hB hK) hPmin hp f have he := repeated_big_initial_birth_unbanned_error V C F hV hMass ζ K B hB hK hPmin hp f change cleanActiveNorm _ (unbannedAction V (fun _ _ => 1) C ζ K f - unbannedAction V (fun _ _ => 1) C ζ (cleanInitialBirthKernel F C K) f) ≤ _ at he have htriangle := clean_active_norm_sub_le (repeatedBigActiveMass V (fun _ _ => 1)) (fun x => repeated_big_untilted_active_mass_nonneg V (fun g => (hV g).le) x) (bannedAction V b C ζ (cleanInitialBirthKernel F C K) f - unbannedAction V (fun _ _ => 1) C ζ (cleanInitialBirthKernel F C K) f) (unbannedAction V (fun _ _ => 1) C ζ K f - unbannedAction V (fun _ _ => 1) C ζ (cleanInitialBirthKernel F C K) f) have hid : (bannedAction V b C ζ (cleanInitialBirthKernel F C K) f - unbannedAction V (fun _ _ => 1) C ζ (cleanInitialBirthKernel F C K) f) - (unbannedAction V (fun _ _ => 1) C ζ K f - unbannedAction V (fun _ _ => 1) C ζ (cleanInitialBirthKernel F C K) f) = bannedAction V b C ζ (cleanInitialBirthKernel F C K) f - unbannedAction V (fun _ _ => 1) C ζ K f := by abel rw [hid] at htriangle exact htriangle.trans ((add_le_add ht he).trans_eq (by ring)) end ThirdCleanTransfer end section /- A signed family estimate under the actual tilted law and initial exclusions. -/ open Finset Real open scoped Classical namespace ThirdCleanFamily open Bounty ThirdCleanTransfer theorem projected_family_norm {I X : Type*} [Fintype I] [Fintype X] (μ ν : X → ℝ) (hμ : ∀ x, 0 ≤ μ x) {C M : ℝ} (hC : 0 ≤ C) (hM : 0 ≤ M) (hlower : ∀ x, μ x ≤ ν x) (hupper : ∀ x, ν x ≤ C*μ x) (P : (X → ℂ) →ₗ[ℂ] (X → ℂ)) (hP : ∀ g, cleanActiveNorm μ (P g) ≤ cleanActiveNorm μ g) (A B : I → X → ℂ) (ε : I → ℝ) (hε : ∀ i, 0 ≤ ε i) (f : X → ℂ) (herr : ∀ i, cleanActiveNorm μ (B i - A i) ≤ ε i * cleanActiveNorm μ f) (hmain : cleanActiveNorm μ (P (∑ i, A i)) ≤ M * cleanActiveNorm μ f) : cleanActiveNorm ν (P (∑ i, B i)) ≤ (sqrt C * (M + ∑ i, ε i)) * cleanActiveNorm ν f := by have herror : cleanActiveNorm μ (P (∑ i, (B i - A i))) ≤ (∑ i, ε i) * cleanActiveNorm μ f := by apply (hP _).trans apply (clean_active_norm_sum_le μ hμ _ _).trans simpa only [sum_mul] using sum_le_sum (fun i _ => herr i) have heq : P (∑ i, B i) = P (∑ i, A i) + P (∑ i, (B i - A i)) := by rw [sum_sub_distrib, map_sub] abel calc _ ≤ sqrt C * cleanActiveNorm μ (P (∑ i, B i)) := ThirdCleanEnergy.norm_le_scaled μ ν hC hupper _ _ ≤ sqrt C * ((M + ∑ i, ε i) * cleanActiveNorm μ f) := by apply mul_le_mul_of_nonneg_left _ (sqrt_nonneg _) rw [heq] exact (clean_active_norm_add_le μ hμ _ _).trans ((add_le_add hmain herror).trans_eq (by ring)) _ = (sqrt C * (M + ∑ i, ε i)) * cleanActiveNorm μ f := by ring _ ≤ _ := mul_le_mul_of_nonneg_left (ThirdCleanEnergy.norm_mono μ ν hlower f) (mul_nonneg (sqrt_nonneg _) (add_nonneg hM (sum_nonneg fun i _ => hε i))) theorem literal_family_norm {I G : Type*} [Fintype I] [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (hb : ∀ g p, 0 < b g p ∧ b g p ≤ 1) {δ : ℝ} (hδ : 0 ≤ δ) (hd : ∀ x : RepeatedBigLists P J ell, 1 ≤ cleanActiveDensity b x ∧ cleanActiveDensity b x ≤ 1 + δ) (C : I → G → Finset (Fin J)) (F : ∀ g, Finset (P g)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ : ℝ) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (B : I → ℝ) (hB : ∀ i, 0 ≤ B i) (hK : ∀ i x y a, ‖K i x y a‖ ≤ B i) {Pmin M : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (hM : 0 ≤ M) (f : RepeatedBigLists P J ell → ℂ) (hsigned : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigSymmetrizeLinear (∑ i, unbannedAction V (fun _ _ => 1) (C i) ζ (K i) f)) ≤ M * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f) : cleanActiveNorm (repeatedBigActiveMass V b) (repeatedBigSymmetrizeLinear (∑ i, bannedAction V b (C i) ζ (cleanInitialBirthKernel F (C i) (K i)) f)) ≤ (sqrt (1 + δ) * (M + ∑ i, B i * (δ + (∑ g, (C i g).card * (2 * (J + ell : ℕ)) / (V g * Pmin)) + sqrt (repeatedBigInitialForbiddenProbability (ell := ell) V (C i) F Pmin)))) * cleanActiveNorm (repeatedBigActiveMass V b) f := by have hμ := repeated_big_untilted_active_mass_nonneg (P := P) (J := J) (ell := ell) V (fun g => (hV g).le) apply projected_family_norm _ _ hμ (by positivity) hM (fun x => by rw [repeated_big_active_mass_density V b x] exact le_mul_of_one_le_right (hμ x) (hd x).1) (fun x => by rw [repeated_big_active_mass_density V b x, mul_comm (1 + δ)] exact mul_le_mul_of_nonneg_left (hd x).2 (hμ x)) repeatedBigSymmetrizeLinear (fun v => repeated_big_symmetrize_norm_le _ hμ (repeated_big_active_mass_permutation V _) v) _ _ _ _ f _ hsigned · intro i apply mul_nonneg (hB i) apply add_nonneg _ (sqrt_nonneg _) exact add_nonneg hδ (sum_nonneg fun g _ => div_nonneg (by positivity) (mul_nonneg (hV g).le hPmin.le)) · intro i exact initial_operator_error V b hb hδ (fun x => (hd x).2) (C i) F hV hMass ζ (K i) (B i) (hB i) (hK i) hPmin hp f end ThirdCleanFamily end section /- Return phases and signed coefficients for the direct family estimate. -/ open Finset Real open scoped Classical namespace ThirdCleanFamily open Bounty ThirdCleanTransfer theorem literal_phase_family_norm {I G : Type*} [Fintype I] [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (b : ∀ g, P g → ℝ) (hb : ∀ g p, 0 < b g p ∧ b g p ≤ 1) {δ : ℝ} (hδ : 0 ≤ δ) (hd : ∀ x : RepeatedBigLists P J ell, 1 ≤ cleanActiveDensity b x ∧ cleanActiveDensity b x ≤ 1 + δ) (C : I → G → Finset (Fin J)) (F : ∀ g, Finset (P g)) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (ζ Θ : ℝ) (c : I → ℂ) (hc : ∀ i, ‖c i‖ ≤ 1) (K : ∀ i, RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (B : I → ℝ) (hB : ∀ i, 0 ≤ B i) (hK : ∀ i x y a, ‖K i x y a‖ ≤ B i) {Pmin M : ℝ} (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val : ℝ)) (hM : 0 ≤ M) (f : RepeatedBigLists P J ell → ℂ) (hsigned : cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) (repeatedBigSymmetrizeLinear (fun x => ∑ y, (∑ i, ∑ aux, c i * repeatedBigUnbannedKernel V (fun _ _ => 1) (C i) ζ (K i) aux x y * physicalReturnPhase Θ (repeatedBigD (C i) x aux)) * f y)) ≤ M * cleanActiveNorm (repeatedBigActiveMass V (fun _ _ => 1)) f) : cleanActiveNorm (repeatedBigActiveMass V b) (repeatedBigSymmetrizeLinear (fun x => ∑ y, (∑ i, ∑ aux, repeatedBigKernel V b (C i) ζ (fun x y a => c i * cleanInitialBirthKernel F (C i) (K i) x y a) aux x y * physicalReturnPhase Θ (repeatedBigD (C i) x aux)) * f y)) ≤ (sqrt (1 + δ) * (M + ∑ i, B i * (δ + (∑ g, (C i g).card * (2 * (J + ell : ℕ)) / (V g * Pmin)) + sqrt (repeatedBigInitialForbiddenProbability (ell := ell) V (C i) F Pmin)))) * cleanActiveNorm (repeatedBigActiveMass V b) f := by let H := fun i x y a => c i * K i x y a * physicalReturnPhase Θ (repeatedBigD (C i) x a) have hu (i : I) (aux : PhysicalAuxLabels P (C i)) (x y : RepeatedBigLists P J ell) : repeatedBigUnbannedKernel V (fun _ _ => 1) (C i) ζ (H i) aux x y = c i * repeatedBigUnbannedKernel V (fun _ _ => 1) (C i) ζ (K i) aux x y * physicalReturnPhase Θ (repeatedBigD (C i) x aux) := by unfold repeatedBigUnbannedKernel H split_ifs <;> (try simp_all only [↓reduceIte]) <;> ring have hb' (i : I) (aux : PhysicalAuxLabels P (C i)) (x y : RepeatedBigLists P J ell) : repeatedBigKernel V b (C i) ζ (cleanInitialBirthKernel F (C i) (H i)) aux x y = repeatedBigKernel V b (C i) ζ (fun x y a => c i * cleanInitialBirthKernel F (C i) (K i) x y a) aux x y * physicalReturnPhase Θ (repeatedBigD (C i) x aux) := by unfold repeatedBigKernel cleanInitialBirthKernel H split_ifs <;> (try simp_all only [↓reduceIte]) <;> ring have hU : (∑ i, unbannedAction V (fun _ _ => 1) (C i) ζ (H i) f) = fun x => ∑ y, (∑ i, ∑ aux, c i * repeatedBigUnbannedKernel V (fun _ _ => 1) (C i) ζ (K i) aux x y * physicalReturnPhase Θ (repeatedBigD (C i) x aux)) * f y := by ext x simp only [Finset.sum_apply, unbannedAction, hu] rw [sum_comm] simp only [sum_mul] have hB' : (∑ i, bannedAction V b (C i) ζ (cleanInitialBirthKernel F (C i) (H i)) f) = fun x => ∑ y, (∑ i, ∑ aux, repeatedBigKernel V b (C i) ζ (fun x y a => c i * cleanInitialBirthKernel F (C i) (K i) x y a) aux x y * physicalReturnPhase Θ (repeatedBigD (C i) x aux)) * f y := by ext x simp only [Finset.sum_apply, bannedAction, hb'] rw [sum_comm] simp only [sum_mul] have hH (i : I) (x y : RepeatedBigLists P J ell) (a : PhysicalAuxLabels P (C i)) : ‖H i x y a‖ ≤ B i := by simp only [H, norm_mul, physicalReturnPhase_norm, mul_one] exact (mul_le_mul (hc i) (hK i x y a) (norm_nonneg _) zero_le_one).trans_eq (one_mul _) have h := literal_family_norm V b hb hδ hd C F hV hMass ζ H B hB hH hPmin hp hM f (by rw [hU]; exact hsigned) rwa [hB'] at h end ThirdCleanFamily end section /- Numerical bounds for the direct global-density perturbation. -/ open Finset Real open scoped Classical namespace ThirdCleanNumeric open Bounty theorem global_loss_le_numeric (s m J ell Q : ℕ) (xi T P v : ℝ) (hT : 0 ≤ T) (hP : 0 < P) (hv : 0 < v) : 2 * ((s : ℝ) * (J + ell : ℕ)) * T / P ≤ repeatedBigNumericError s (m + J) J ell Q xi T P v := by apply le_trans _ (repeated_big_density_le_numeric_error s (m + J) J ell Q xi T P v hT hP hv) apply div_le_div_of_nonneg_right _ hP.le apply mul_le_mul_of_nonneg_right _ hT push_cast nlinarith [mul_nonneg (show 0 ≤ (s : ℝ) by positivity) (show 0 ≤ (m : ℝ) by positivity)] theorem family_error_le_numeric {G : Type*} [Fintype G] [DecidableEq G] {J ell m : ℕ} (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (hp : ∀ g, (probes g).card ≤ m) (Q : ℕ) (xi T P v : ℝ) (hv : 0 < v) (hV : ∀ g, v ≤ V g) (hT : 0 ≤ T) (hP : 0 < P) : (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q xi i * (2 * ((Fintype.card G : ℝ) * (J + ell : ℕ)) * T / P + ∑ g, (repeatedBigPrimePatternCut probes r t i g).card * (2 * (J + ell : ℕ)) / (V g * P))) ≤ repeatedBigNumericError (Fintype.card G) (m + J) J ell Q xi T P v := by let loss := (((2 * Fintype.card G * (ell + (m + J)) : ℕ) : ℝ) * T / P) + (Fintype.card G : ℝ) * (((m + J : ℕ) : ℝ) * (2 * (J + ell : ℕ))) / (v * P) have hp' : ∀ g, (probes g).card ≤ m + J := fun g => (hp g).trans (Nat.le_add_right m J) have hzero : 0 ≤ loss := by dsimp [loss]; positivity have hrow (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) : 2 * ((Fintype.card G : ℝ) * (J + ell : ℕ)) * T / P + (∑ g, (repeatedBigPrimePatternCut probes r t i g).card * (2 * (J + ell : ℕ)) / (V g * P)) ≤ loss := by apply add_le_add · apply div_le_div_of_nonneg_right _ hP.le apply mul_le_mul_of_nonneg_right _ hT push_cast nlinarith [mul_nonneg (show 0 ≤ (Fintype.card G : ℝ) by positivity) (show 0 ≤ (m : ℝ) by positivity)] · calc _ ≤ ∑ _g : G, ((m + J : ℕ) : ℝ) * (2 * (J + ell : ℕ)) / (v * P) := by apply sum_le_sum intro g _ have hc : (repeatedBigPrimePatternCut probes r t i g).card ≤ m + J := repeated_big_prime_pattern_cut_card_le probes r t hp' i g apply div_le_div₀ (by positivity) (mul_le_mul_of_nonneg_right (Nat.cast_le.mpr hc) (by positivity)) (mul_pos hv hP) (mul_le_mul_of_nonneg_right (hV g) hP.le) _ = _ := by simp only [sum_const, card_univ, nsmul_eq_mul]; ring have hcard : r.card + t.card ≤ Fintype.card G := by rw [← card_union_of_disjoint hrt] exact card_le_univ _ calc _ ≤ ∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q xi i * loss := sum_le_sum fun i _ => mul_le_mul_of_nonneg_left (hrow i) (repeated_big_prime_pattern_bound_nonneg probes r t Q xi i) _ = (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q xi i) * loss := (sum_mul ..).symm _ ≤ (1 + (2 : ℝ) ^ ((m + J) * (r.card + t.card)) * ((Q * Q : ℕ) / xi) ^ 2) * loss := mul_le_mul_of_nonneg_right (repeated_big_prime_pattern_bound_sum_le probes r t hp' Q xi) hzero _ ≤ (1 + (2 : ℝ) ^ ((m + J) * Fintype.card G) * ((Q * Q : ℕ) / xi) ^ 2) * loss := by apply mul_le_mul_of_nonneg_right _ hzero apply add_le_add le_rfl apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) exact pow_le_pow_right₀ (by norm_num) (Nat.mul_le_mul_left (m + J) hcard) _ = _ := rfl end ThirdCleanNumeric end section /- Global density control after the number of active slots is fixed. -/ open Finset Filter Real namespace ThirdCleanDensity open Bounty theorem global_density_bound {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (b : ∀ g, P g → ℝ) {T Pmin : ℝ} (hT : 0 ≤ T) (hPmin : 0 < Pmin) (hp : ∀ g (p : P g), Pmin ≤ (p.val:ℝ)) (hb : ∀ g (p : P g), b g p = 1-T/(p.val:ℝ)) (hsmall : ((Fintype.card G:ℝ)*(J+ell:ℕ))*T/Pmin ≤ 1/2) (l : RepeatedBigLists P J ell) : 1 ≤ cleanActiveDensity b l ∧ cleanActiveDensity b l ≤ 1+2*(((Fintype.card G:ℝ)*(J+ell:ℕ))*T/Pmin) := by have h := physical_lifespan_tilt_density_bounds (I := G × PhysicalSlots J ell) (fun i => i.1) (fun i => l i.1 i.2) b hT hPmin (fun i => hp i.1 _) (fun i => hb i.1 _) (by simpa only [Fintype.card_prod, Fintype.card_sum, Fintype.card_fin, Nat.cast_mul] using hsmall) simpa only [cleanActiveDensity, Fintype.prod_prod_type, Fintype.card_prod, Fintype.card_sum, Fintype.card_fin, Nat.cast_mul] using h.1 end ThirdCleanDensity end namespace Bounty.WeakZeroFree open Real in theorem _root_.Bounty.WeakZeroFree.eventually_repeated_big_prime_initial_clean_power_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c s z a v D ε E beta tau : ℝ) (m J ell : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (htau : 0 ≤ tau) (hell : 0 < ell) (hml : ell ≤ m) (hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G], ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, ∀ hrt : Disjoint r t, beta * Real.log L ≤ (r.card : ℝ) → beta * Real.log L ≤ (t.card : ℝ) → ∀ ζ θ : ℝ, |ζ| ≤ L ^ z → ∀ F : ∀ g, Finset (P g), (∀ g, (F g).card ≤ J + ell) → let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ let C := repeatedBigPrimePatternCut (ell := ell) probes r t let K₀ := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept let K := fun i => cleanInitialBirthKernel F (C i) (K₀ i) let weights := repeatedBigPrimePatternWeight (ell := ell) probes r t ∀ (b : ∀ g, P g → ℝ), ∀ T Pmin : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ Pmin → (∀ g (p : P g), Pmin ≤ (p.val : ℝ)) → (∀ g (p : P g), b g p = 1 - T / (p.val : ℝ)) → ∀ (S : Type) [Fintype S] (Ps : S → Finset ℕ) (N : G → ℕ) (k : ℤ) (p : FixedOrderedMemoryLabels P N), ∀ [∀ q : PhysicalPrime Ps, NeZero q.2.val] [∀ g j, NeZero (p g j).val], ∀ (d : PhysicalSharedLists Ps J) (f : RepeatedBigLists P J ell → (PhysicalResidues Ps × FixedOrderedResidues p) → ℂ), cleanWeightedNorm (repeatedBigActiveMass V b) (cleanActiveMap repeatedBigSymmetrizeLinear (cleanHybridPatternCoreAction V b C ζ θ k p (fun i source target aux => weights i * K i source target aux) d (cleanActiveMap repeatedBigSymmetrizeLinear f))) ≤ L ^ (-E) * cleanWeightedNorm (repeatedBigActiveMass V b) f := by intro κ s' A₀ q w x have hm : 0 < m := hell.trans_le hml have hexp := repeated_big_prime_kernel_exponents_nonneg s z a v D ε m hs hz ha hD hε.le have hq : 0 ≤ q := hexp.2.2.2.1 have hx : 0 ≤ x := hexp.2.2.2.2.2 filter_upwards [Bounty.WeakZeroFree.eventually_repeated_big_prime_pattern_norm_le hZ c s z a v D ε m hc hs hz ha hv hD hε hm, eventually_repeated_big_numeric_error_small (m + J) J ell ha hq hx htau hv hc (E + 1), eventually_repeated_big_numeric_error_small (m + J) J ell ha hq hx htau hv hc 1, eventually_repeated_big_initial_error_small m J ell ha hq hx hv hc hml (E + 1), eventually_repeated_big_baseline_pos (tau := tau) hc, eventually_ge_atTop (6 : ℝ)] with L hnorm herr hsmall hinit hbaseline hL intro Q h ξ G _ dG cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF kept C K₀ K weights b T Pmin hT hTmax hPminexp hpmin hb S _ Ps N k p _ _ d f have hL0 : 0 < L := by linarith have hPmin : 0 < Pmin := (Real.exp_pos _).trans_le hPminexp have hVpos : ∀ g, 0 < V g := fun g => hv.trans_le (hV g) have hb' : ∀ g q, 0 < b g q ∧ b g q ≤ 1 := by intro g q rw [hb g q] refine ⟨(hbaseline T Pmin hT hTmax hPminexp).2 q.val (hpmin g q), ?_⟩ exact sub_le_self _ (div_nonneg hT (hPmin.le.trans (hpmin g q))) have hp' : ∀ g, (probes g).card ≤ m := fun g => (hp g).le have hQ : (Q : ℝ) ≤ L ^ q := Nat.floor_le (Real.rpow_nonneg hL0.le _) let δ := 2 * (((Fintype.card G : ℝ) * (J + ell : ℕ)) * T / Pmin) have hδ : 0 ≤ δ := by dsimp [δ]; positivity have hδsmall : δ ≤ 1 := by have hnum := hsmall (Fintype.card G) Q ξ T Pmin hcard hQ le_rfl hT hTmax hPminexp have hloss := ThirdCleanNumeric.global_loss_le_numeric (Fintype.card G) m J ell Q ξ T Pmin v hT hPmin hv have hpow : L ^ (-(1 : ℝ)) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos (by linarith) (by norm_num) apply le_trans _ (hnum.trans hpow) simpa only [δ, mul_div_assoc, mul_assoc] using hloss have hd (y : RepeatedBigLists P J ell) : 1 ≤ cleanActiveDensity b y ∧ cleanActiveDensity b y ≤ 1 + δ := by apply ThirdCleanDensity.global_density_bound b hT hPmin hpmin hb _ y change 2 * _ ≤ 1 at hδsmall linarith have hnum : (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q ξ i * (δ + ∑ g, (C i g).card * (2 * (J + ell : ℕ)) / (V g * Pmin))) ≤ L ^ (-(E + 1)) := by have hn := (ThirdCleanNumeric.family_error_le_numeric V probes r t hrt hp' Q ξ T Pmin v hv hV hT hPmin).trans (herr (Fintype.card G) Q ξ T Pmin hcard hQ le_rfl hT hTmax hPminexp) convert hn using 1 <;> simp only [δ, C, mul_div_assoc, mul_assoc] apply sum_congr · exact Finset.ext (by intro i; simp only [mem_univ]) · intro i _; rfl have hI : (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q ξ i * sqrt (repeatedBigInitialForbiddenProbability (ell := ell) V (C i) F Pmin)) ≤ L ^ (-(E + 1)) := by have hi := (repeated_big_prime_initial_pattern_error_le V probes r t hrt hp' F hF Q ξ hv hV hPmin).trans (hinit (Fintype.card G) Q ξ Pmin hcard hQ le_rfl hPminexp) convert hi using 1 <;> simp only [C, repeated_big_prime_pattern_weight_norm, one_mul] apply sum_congr · exact Finset.ext (by intro i; simp only [mem_univ]) · intro i _; rfl let M := sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ r.card) + sqrt (((ell : ℝ) ^ ell / (m : ℝ) ^ ell) ^ t.card) + (3 : ℝ) ^ ((r.sigma (fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)))).card + (t.sigma (fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)))).card) * L ^ (-D) have hM0 : 0 ≤ M := by dsimp [M]; positivity have htheta : 0 < (ell : ℝ) ^ ell / (m : ℝ) ^ ell := by positivity have htheta1 : (ell : ℝ) ^ ell / (m : ℝ) ^ ell ≤ 1 := by apply (div_le_one (by positivity)).mpr exact pow_le_pow_left₀ (Nat.cast_nonneg _) (by exact_mod_cast hml) ell have hM : M ≤ L ^ (-(E + 1)) := by exact repeated_big_positive_block_bound (E := E + 1) (D := D) m (Fintype.card G) r.card t.card ((r.sigma (fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)))).card + (t.sigma (fun g => (probes g).map (Function.Embedding.inl (β := Fin ell)))).card) (by linarith) htheta htheta1 hr ht hcard (repeated_big_prime_mapped_probe_card_le probes r t hrt hp') (by linarith [hgap]) (by linarith [hDgap]) have htotal : (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q ξ i * (δ + (∑ g, (C i g).card * (2 * (J + ell : ℕ)) / (V g * Pmin)) + sqrt (repeatedBigInitialForbiddenProbability (ell := ell) V (C i) F Pmin))) ≤ 2 * L ^ (-(E + 1)) := by simp_rw [mul_add, sum_add_distrib] at hnum ⊢ linarith have hscale : sqrt (1 + δ) * (M + ∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q ξ i * (δ + (∑ g, (C i g).card * (2 * (J + ell : ℕ)) / (V g * Pmin)) + sqrt (repeatedBigInitialForbiddenProbability (ell := ell) V (C i) F Pmin))) ≤ L ^ (-E) := by have hsqrt : sqrt (1 + δ) ≤ 2 := (sqrt_le_iff).2 ⟨by norm_num, by linarith⟩ calc _ ≤ sqrt (1 + δ) * (3 * L ^ (-(E + 1))) := mul_le_mul_of_nonneg_left (by linarith) (sqrt_nonneg _) _ ≤ 2 * (3 * L ^ (-(E + 1))) := mul_le_mul_of_nonneg_right hsqrt (by positivity) _ ≤ L ^ (-E) := by rw [show -(E + 1) = -E - 1 by ring, Real.rpow_sub hL0, Real.rpow_one] calc _ = (6 * L ^ (-E)) / L := by ring _ ≤ L ^ (-E) := (div_le_iff₀ hL0).2 (by nlinarith [mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le (-E))]) apply clean_hybrid_symmetric_pattern_norm_le V (fun g => (hVpos g).le) b (fun g q => (hb' g q).1.le) C ζ θ k p (fun i source target aux => weights i * K i source target aux) d (L ^ (-E)) (Real.rpow_nonneg hL0.le _) _ f intro Θ u hu have hideal := hnorm J ell P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt ζ Θ hζ u hu have hout := ThirdCleanFamily.literal_phase_family_norm V b hb' hδ hd C F hVpos hmass ζ Θ weights (fun i => (repeated_big_prime_pattern_weight_norm probes r t i).le) K₀ (repeatedBigPrimePatternBound probes r t Q ξ) (repeated_big_prime_pattern_bound_nonneg probes r t Q ξ) (fun i source target aux => repeated_big_prime_pattern_kernel_norm_le P V probes r t hrt Q h ξ (Real.rpow_pos_of_pos hL0 _) i source target aux) hPmin hpmin hM0 u hideal exact hout.trans (mul_le_mul_of_nonneg_right hscale (Real.sqrt_nonneg _)) theorem _root_.Bounty.WeakZeroFree.eventually_repeated_big_prime_initial_full_memory_power_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c s z a v D ε E beta tau : ℝ) (m J ell : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (htau : 0 ≤ tau) (hell : 0 < ell) (hml : ell ≤ m) (hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G], ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → ∀ hP : ∀ g p, p ∈ P g → p.Prime ∧ Q < p, (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, ∀ hrt : Disjoint r t, beta * Real.log L ≤ (r.card : ℝ) → beta * Real.log L ≤ (t.card : ℝ) → ∀ ζ θ : ℝ, |ζ| ≤ L ^ z → ∀ F : ∀ g, Finset (P g), (∀ g, (F g).card ≤ J + ell) → let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ let C := repeatedBigPrimePatternCut (ell := ell) probes r t let K₀ := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept let K := fun i => cleanInitialBirthKernel F (C i) (K₀ i) let weights := repeatedBigPrimePatternWeight (ell := ell) probes r t ∀ (b : ∀ g, P g → ℝ), ∀ T Pmin : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ Pmin → (∀ g (p : P g), Pmin ≤ (p.val : ℝ)) → (∀ g (p : P g), b g p = 1 - T / (p.val : ℝ)) → ∀ (S : Type) [Fintype S] (Ps : S → Finset ℕ) (fullB : ℕ) (k : ℤ) (ν : ∀ g, P g → ℝ) (ρ : ℝ), (∀ g p, 0 ≤ ν g p) → 0 ≤ ρ → ρ ≤ 1 → ∀ [∀ q : PhysicalPrime Ps, NeZero q.2.val] (d : PhysicalSharedLists Ps J), let _ : ∀ g (p : P g), NeZero p.val := fun g p => ⟨(hP g p.val p.property).1.pos.ne'⟩ ∀ f : CleanFullMemoryState P J ell fullB → PhysicalResidues Ps → ℂ, cleanWeightedNorm (productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1)) (cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction V b C ζ θ ρ k (fun i source target aux => weights i * K i source target aux) d (cleanFullMemoryActiveMap f))) ≤ L ^ (-E) * cleanWeightedNorm (productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1)) f := by intro κ s' A₀ q w x filter_upwards [_root_.Bounty.WeakZeroFree.eventually_repeated_big_prime_initial_clean_power_bound hZ c s z a v D ε E beta tau m J ell hc hs hz ha hv hD hε htau hell hml hgap hDgap, eventually_repeated_big_baseline_pos (tau := tau) hc, eventually_gt_atTop (0 : ℝ)] with L hpower hbaseline hL intro Q h ξ G _ dG cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF kept C K₀ K weights b T Pmin hT hTmax hPminexp hpmin hb S _ Ps fullB k ν ρ hν hρ0 hρ1 _ d let _ : ∀ g (p : P g), NeZero p.val := fun g p => ⟨(hP g p.val p.property).1.pos.ne'⟩ intro _ f have hbpos : ∀ g p, 0 < b g p := by intro g p rw [hb g p] exact (hbaseline T Pmin hT hTmax hPminexp).2 p.val (hpmin g p) apply clean_full_memory_projected_damped_norm_le V b ν (fun g => (hv.trans_le (hV g)).le) (fun g p => (hbpos g p).le) hν C ζ θ ρ hρ0 hρ1 k (fun i source target aux => weights i * K i source target aux) d (L ^ (-E)) (Real.rpow_nonneg hL.le _) _ f intro N p u exact hpower P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF b T Pmin hT hTmax hPminexp hpmin hb S Ps (fun g => (N g).val) k p d u theorem _root_.Bounty.WeakZeroFree.eventually_repeated_big_prime_initial_full_memory_cutoff_power_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c s z a v D ε E beta tau : ℝ) (m J ell : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (htau : 0 ≤ tau) (hell : 0 < ell) (hml : ell ≤ m) (hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G], ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → ∀ hP : ∀ g p, p ∈ P g → p.Prime ∧ Q < p, (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, ∀ hrt : Disjoint r t, beta * Real.log L ≤ (r.card : ℝ) → beta * Real.log L ≤ (t.card : ℝ) → ∀ ζ θ : ℝ, |ζ| ≤ L ^ z → ∀ F : ∀ g, Finset (P g), (∀ g, (F g).card ≤ J + ell) → let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ let C := repeatedBigPrimePatternCut (ell := ell) probes r t let K₀ := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept let K := fun i => cleanInitialBirthKernel F (C i) (K₀ i) let weights := repeatedBigPrimePatternWeight (ell := ell) probes r t ∀ (b : ∀ g, P g → ℝ), ∀ T Pmin : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ Pmin → (∀ g (p : P g), Pmin ≤ (p.val : ℝ)) → (∀ g (p : P g), b g p = 1 - T / (p.val : ℝ)) → ∀ (S : Type) [Fintype S] (Ps : S → Finset ℕ) (fullB : ℕ) (k : ℤ) (ν : ∀ g, P g → ℝ) (ρ : ℝ), (∀ g p, 0 ≤ ν g p) → 0 ≤ ρ → ρ ≤ 1 → ∀ [∀ q : PhysicalPrime Ps, NeZero q.2.val] (d : PhysicalSharedLists Ps J), let _ : ∀ g (p : P g), NeZero p.val := fun g p => ⟨(hP g p.val p.property).1.pos.ne'⟩ ∀ f : CleanFullMemoryState P J ell fullB → PhysicalResidues Ps → ℂ, cleanWeightedNorm (productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1)) (cleanFullMemoryCutoff (cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction V b C ζ θ ρ k (fun i source target aux => weights i * K i source target aux) d (cleanFullMemoryActiveMap (cleanFullMemoryCutoff f))))) ≤ L ^ (-E) * cleanWeightedNorm (productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1)) f := by intro κ s' A₀ q w x filter_upwards [_root_.Bounty.WeakZeroFree.eventually_repeated_big_prime_initial_full_memory_power_bound hZ c s z a v D ε E beta tau m J ell hc hs hz ha hv hD hε htau hell hml hgap hDgap, eventually_repeated_big_baseline_pos (tau := tau) hc, eventually_gt_atTop (0 : ℝ)] with L hpower hbaseline hL intro Q h ξ G _ dG cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF kept C K₀ K weights b T Pmin hT hTmax hPminexp hpmin hb S _ Ps fullB k ν ρ hν hρ0 hρ1 _ d let _ : ∀ g (p : P g), NeZero p.val := fun g p => ⟨(hP g p.val p.property).1.pos.ne'⟩ intro _ f have hbpos : ∀ g p, 0 < b g p := by intro g p rw [hb g p] exact (hbaseline T Pmin hT hTmax hPminexp).2 p.val (hpmin g p) apply clean_full_memory_cutoff_sandwich_norm_le (fun g => tiltedPhysicalBirthLaw V g (b g)) ν (fun g p => tiltedPhysicalBirthLaw_nonneg V g (b g) (hv.trans_le (hV g)).le (fun p => (hbpos g p).le) p) hν (fun u => cleanFullMemoryActiveMap (cleanFullMemoryPatternDampedAction V b C ζ θ ρ k (fun i source target aux => weights i * K i source target aux) d (cleanFullMemoryActiveMap u))) (L ^ (-E)) (Real.rpow_nonneg hL.le _) _ f intro u exact hpower P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF b T Pmin hT hTmax hPminexp hpmin hb S Ps fullB k ν ρ hν hρ0 hρ1 d u theorem _root_.Bounty.WeakZeroFree.eventually_repeated_big_prime_initial_literal_event_power_bound (hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c s z a v D ε E beta tau : ℝ) (m J ell : ℕ) (hc : 0 < c) (hs : 0 ≤ s) (hz : 0 ≤ z) (ha : 0 ≤ a) (hv : 0 < v) (hD : 0 ≤ D) (hε : 0 < ε) (htau : 0 ≤ tau) (hell : 0 < ell) (hml : ell ≤ m) (hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D) : let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G], ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → ∀ hP : ∀ g p, p ∈ P g → p.Prime ∧ Q < p, (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, ∀ hrt : Disjoint r t, beta * Real.log L ≤ (r.card : ℝ) → beta * Real.log L ≤ (t.card : ℝ) → ∀ ζ θ : ℝ, |ζ| ≤ L ^ z → ∀ F : ∀ g, Finset (P g), (∀ g, (F g).card ≤ J + ell) → let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ let C := repeatedBigPrimePatternCut (ell := ell) probes r t let K₀ := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept let weights := repeatedBigPrimePatternWeight (ell := ell) probes r t ∀ (b : ∀ g, P g → ℝ), ∀ T Pmin : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ Pmin → (∀ g (p : P g), Pmin ≤ (p.val : ℝ)) → (∀ g (p : P g), b g p = 1 - T / (p.val : ℝ)) → ∀ (S : Type) [Fintype S] (Ps : S → Finset ℕ) (fullB : ℕ) (k : ℤ) (ν : ∀ g, P g → ℝ) (ρ : ℝ), (∀ g p, 0 ≤ ν g p) → 0 ≤ ρ → ρ ≤ 1 → ∀ [∀ q : PhysicalPrime Ps, NeZero q.2.val] (d : PhysicalSharedLists Ps J), let _ : ∀ g (p : P g), NeZero p.val := fun g p => ⟨(hP g p.val p.property).1.pos.ne'⟩ ∀ Dban : ∀ i, SharedActiveLabels (fun g => ↥(P g)) (cleanFullSharedSlots (ell := ell) (C i)) → PhysicalAuxLabels P (C i) → G → ℤ, ∀ f : CleanFullMemoryState P J ell fullB → PhysicalResidues Ps → ℂ, (∀ rs, ProductMemorySymmetric (fun x => f x rs)) → cleanWeightedNorm (productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1)) (cleanFullMemoryActiveMap (cleanFullMemoryInitialPatternEventAction F V b C ζ θ ρ k Dban (fun i source target aux => weights i * K₀ i source target aux) d (cleanFullMemoryActiveMap f))) ≤ L ^ (-E) * cleanWeightedNorm (productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1)) f := by intro κ s' A₀ q w x filter_upwards [_root_.Bounty.WeakZeroFree.eventually_repeated_big_prime_initial_full_memory_cutoff_power_bound hZ c s z a v D ε E beta tau m J ell hc hs hz ha hv hD hε htau hell hml hgap hDgap] with L hpower intro Q h ξ G _ dG cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF kept C K₀ weights b T Pmin hT hTmax hPminexp hpmin hb S _ Ps fullB k ν ρ hν hρ0 hρ1 _ d let _ : ∀ g (p : P g), NeZero p.val := fun g p => ⟨(hP g p.val p.property).1.pos.ne'⟩ intro _ Dban f hf let K := fun i => cleanInitialBirthKernel F (C i) (K₀ i) have hK : (fun (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) => cleanInitialBirthKernel F (C i) (fun source target aux => weights i * K₀ i source target aux)) = (fun i source target aux => weights i * K i source target aux) := by funext i source target aux dsimp only [K, cleanInitialBirthKernel] split_ifs <;> simp only [mul_zero] rw [clean_full_memory_initial_projected_action F V b C ζ θ ρ k Dban (fun i source target aux => weights i * K₀ i source target aux) d f hf] erw [hK] exact hpower P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF b T Pmin hT hTmax hPminexp hpmin hb S Ps fullB k ν ρ hν hρ0 hρ1 d f theorem _root_.Bounty.WeakZeroFree.exists_physical_mixed_clean_prime_power_bound (qsmall vsmall : ℝ) (ell : ℕ) (hq0 : 0 ≤ qsmall) (hq1 : qsmall < 1) (hvs : 0 < vsmall) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (_hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c s z a v D ε E beta tau : ℝ) (m J : ℕ) (_hc : 0 < c) (_hs : 0 ≤ s) (_hz : 0 ≤ z) (_ha : 0 ≤ a) (_hv : 0 < v) (_hD : 0 ≤ D) (_hε : 0 < ε) (_htau : 0 ≤ tau) (_hell : 0 < ell) (_hml : ell ≤ m) (_hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (_hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D), let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G], ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → ∀ hP : ∀ g p, p ∈ P g → p.Prime ∧ Q < p, (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, ∀ hrt : Disjoint r t, beta * Real.log L ≤ (r.card : ℝ) → beta * Real.log L ≤ (t.card : ℝ) → ∀ ζ θ : ℝ, |ζ| ≤ L ^ z → ∀ F : ∀ g, Finset (P g), (∀ g, (F g).card ≤ J + ell) → let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ let C := repeatedBigPrimePatternCut (ell := ell) probes r t let K₀ := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept let weights := repeatedBigPrimePatternWeight (ell := ell) probes r t ∀ (b : ∀ g, P g → ℝ), ∀ T Pmin : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ Pmin → (∀ g (p : P g), Pmin ≤ (p.val : ℝ)) → (∀ g (p : P g), b g p = 1 - T / (p.val : ℝ)) → ∀ (S : Type) [Fintype S] [DecidableEq S] (Ps : S → Finset ℕ) (fullB : ℕ) (k : ℤ) (ν : ∀ g, P g → ℝ) (ρ : ℝ), (∀ g p, 0 ≤ ν g p) → 0 ≤ ρ → ρ ≤ 1 → ∀ [∀ q : PhysicalPrime Ps, NeZero q.2.val], let _ : ∀ g (p : P g), NeZero p.val := fun g p => ⟨(hP g p.val p.property).1.pos.ne'⟩ let W : CleanFullMemoryState P J ell fullB → ℝ := productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1) ∀ (Vs : S → ℝ), (∀ s, vsmall ≤ Vs s) → ∀ sourceGate targetGate : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell fullB) → ℂ, (∀ s, ‖sourceGate s‖ ≤ 1) → (∀ s, ‖targetGate s‖ ≤ 1) → (∀ s (τ : FullActiveSlotPermutations (fun _ : G => J + ell)), sourceGate (s.1, fullActivePermutation τ s.2) = sourceGate s) → (∀ s (τ : FullActiveSlotPermutations (fun _ : G => J + ell)), targetGate (s.1, fullActivePermutation τ s.2) = targetGate s) → ∀ f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell fullB) → ℂ, (∀ s, ProductMemorySymmetric (fun x => targetGate (s,x) * f (s,x))) → physicalSmallBigEnergy Vs W (physicalSmallBigBigAverage (physicalMixedGatedCleanPatternAction F V b C ζ θ ρ k (fun i source target aux => weights i * K₀ i source target aux) Vs qsmall sourceGate targetGate (physicalSmallBigBigAverage f))) ≤ A ^ (2 * Fintype.card S) * (L ^ (-E)) ^ 2 * physicalSmallBigEnergy Vs W f := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_clean_pairing_energy_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ intro hZ c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap κ s' A₀ q w x filter_upwards [_root_.Bounty.WeakZeroFree.eventually_repeated_big_prime_initial_literal_event_power_bound hZ c s z a v D ε E beta tau m J ell hc hs hz ha hv hD hε htau hell hml hgap hDgap, eventually_repeated_big_baseline_pos (tau := tau) hc, eventually_gt_atTop (0 : ℝ)] with L hpower hbaseline hL intro Q h ξ G _ dG cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF kept C K₀ weights b T Pmin hT hTmax hPminexp hpmin hb S _ dS cases Subsingleton.elim dS (Classical.typeDecidableEq S) intro Ps fullB k ν ρ hν hρ0 hρ1 _ let _ : ∀ g (p : P g), NeZero p.val := fun g p => ⟨(hP g p.val p.property).1.pos.ne'⟩ intro _ W Vs hVs sourceGate targetGate hsg htg hsgPerm htgPerm f hf have hbpos : ∀ g p, 0 < b g p := by intro g p rw [hb g p] exact (hbaseline T Pmin hT hTmax hPminexp).2 p.val (hpmin g p) have hW : ∀ x, 0 ≤ W x := productMemoryWeight_nonneg _ _ (fun g p => tiltedPhysicalBirthLaw_nonneg V g (b g) (hv.trans_le (hV g)).le (fun p => (hbpos g p).le) p) (fun g p => hν g p.1) let K := fun i source target aux => weights i * K₀ i source target aux let output := physicalSmallBigBigAverage (physicalMixedGatedCleanPatternAction F V b C ζ θ ρ k K Vs qsmall sourceGate targetGate (physicalSmallBigBigAverage f)) let Tclean := fun (d : PhysicalSharedLists Ps J) (u : CleanFullMemoryState P J ell fullB → PhysicalResidues Ps → ℂ) => cleanFullMemoryActiveMap (cleanFullMemoryInitialPatternEventAction F V b C ζ θ ρ k (fun i => canonicalMixedEdgeD (C i) d) K d (cleanFullMemoryActiveMap u)) have hPs : ∀ s p, p ∈ Ps s → 0 < p := by intro s p hp exact Nat.pos_of_ne_zero (NeZero.ne (show ℕ from (⟨s, ⟨p, hp⟩⟩ : PhysicalPrime Ps).2.val)) have hpair (u : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell fullB) → ℂ) : (∑ s, (physicalSmallBigMeasure Vs W s : ℂ) * (starRingEnd ℂ) (u s) * output s) = ∑ d, ∑ rs, ∑ x, (W x : ℂ) * (starRingEnd ℂ) (physicalSmallBigCondition Vs qsmall (fun s => sourceGate s * u s) d x rs) * Tclean d (physicalSmallBigCondition Vs qsmall (fun s => targetGate s * f s) d) x rs := by exact physical_mixed_gated_clean_pattern_projected_pairing F V b C ζ θ ρ k K Vs (fun s => hvs.trans_le (hVs s)) qsmall ν sourceGate targetGate hsgPerm htgPerm u f hf hPs (fun g p hp => (hP g p hp).1.pos) apply hbound S (CleanFullMemoryState P J ell fullB) Ps J Vs hVs W hW sourceGate targetGate hsg htg (L ^ (-E)) (Real.rpow_nonneg hL.le _) f output (fun d => Tclean d (physicalSmallBigCondition Vs qsmall (fun s => targetGate s * f s) d)) _ hpair intro d exact hpower P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF b T Pmin hT hTmax hPminexp hpmin hb S Ps fullB k ν ρ hν hρ0 hρ1 d (fun i => canonicalMixedEdgeD (C i) d) _ (fun rs => physical_small_big_condition_memory_symmetric Vs qsmall _ hf d rs) theorem _root_.Bounty.WeakZeroFree.exists_physical_mixed_clean_prime_joint_norm_bound (qsmall vsmall : ℝ) (ell : ℕ) (hq0 : 0 ≤ qsmall) (hq1 : qsmall < 1) (hvs : 0 < vsmall) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (_hZ : PrimitiveZeroFreeRightOf (23 / 24)) (c s z a v D ε E beta tau : ℝ) (m J : ℕ) (_hc : 0 < c) (_hs : 0 ≤ s) (_hz : 0 ≤ z) (_ha : 0 ≤ a) (_hv : 0 < v) (_hD : 0 ≤ D) (_hε : 0 < ε) (_htau : 0 ≤ tau) (_hell : 0 < ell) (_hml : ell ≤ m) (_hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (_hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D), let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {G : Type} [Fintype G] [DecidableEq G], ∀ (P : G → Finset ℕ) (V : G → ℝ), Pairwise (fun g h => Disjoint (P g) (P h)) → ∀ hP : ∀ g p, p ∈ P g → p.Prime ∧ Q < p, (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, ∀ hrt : Disjoint r t, beta * Real.log L ≤ (r.card : ℝ) → beta * Real.log L ≤ (t.card : ℝ) → ∀ ζ θ : ℝ, |ζ| ≤ L ^ z → ∀ F : ∀ g, Finset (P g), (∀ g, (F g).card ≤ J + ell) → let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun i : U => P i.1.1) (fun i => V i.1.1) h ξ let C := repeatedBigPrimePatternCut (ell := ell) probes r t let K₀ := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept let weights := repeatedBigPrimePatternWeight (ell := ell) probes r t ∀ (b : ∀ g, P g → ℝ), ∀ T Pmin : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ Pmin → (∀ g (p : P g), Pmin ≤ (p.val : ℝ)) → (∀ g (p : P g), b g p = 1 - T / (p.val : ℝ)) → ∀ (S : Type) [Fintype S] [DecidableEq S] (Ps : S → Finset ℕ) (fullB : ℕ) (k : ℤ) (ν : ∀ g, P g → ℝ) (ρ : ℝ), (∀ g p, 0 ≤ ν g p) → 0 ≤ ρ → ρ ≤ 1 → ∀ [∀ q : PhysicalPrime Ps, NeZero q.2.val], let _ : ∀ g (p : P g), NeZero p.val := fun g p => ⟨(hP g p.val p.property).1.pos.ne'⟩ let W : CleanFullMemoryState P J ell fullB → ℝ := productMemoryWeight (fun g => tiltedPhysicalBirthLaw V g (b g)) (fun g z => ν g z.1) ∀ (Vs : S → ℝ), (∀ s, vsmall ≤ Vs s) → ∀ (Fs : ∀ s, Finset (Ps s)) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell fullB) → ℂ), (∀ s, ProductMemorySymmetric (fun x => f (s,x))) → cleanActiveNorm (physicalSmallBigMeasure Vs W) (physicalSmallBigJointAverage (physicalMixedGatedCleanPatternAction F V b C ζ θ ρ k (fun i source target aux => weights i * K₀ i source target aux) Vs qsmall cleanMixedSourceGate (cleanMixedTargetGate Fs) (physicalSmallBigJointAverage f))) ≤ A ^ Fintype.card S * L ^ (-E) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := by obtain ⟨A, hA, hbound⟩ := _root_.Bounty.WeakZeroFree.exists_physical_mixed_clean_prime_power_bound qsmall vsmall ell hq0 hq1 hvs refine ⟨A, hA, ?_⟩ intro hZ c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap κ s' A₀ q w x filter_upwards [hbound hZ c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap, eventually_repeated_big_baseline_pos (tau := tau) hc, eventually_gt_atTop (0 : ℝ)] with L hpower hbaseline hL intro Q h ξ G _ dG cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF kept C K₀ weights b T Pmin hT hTmax hPminexp hpmin hb S _ dS cases Subsingleton.elim dS (Classical.typeDecidableEq S) intro Ps fullB k ν ρ hν hρ0 hρ1 _ let _ : ∀ g (p : P g), NeZero p.val := fun g p => ⟨(hP g p.val p.property).1.pos.ne'⟩ intro _ W Vs hVs Fs f hf have hbpos : ∀ g p, 0 < b g p := by intro g p rw [hb g p] exact (hbaseline T Pmin hT hTmax hPminexp).2 p.val (hpmin g p) have hW : ∀ x, 0 ≤ W x := productMemoryWeight_nonneg _ _ (fun g p => tiltedPhysicalBirthLaw_nonneg V g (b g) (hv.trans_le (hV g)).le (fun p => (hbpos g p).le) p) (fun g p => hν g p.1) have hVs' : ∀ s, 0 < Vs s := fun s => hvs.trans_le (hVs s) let K := fun i source target aux => weights i * K₀ i source target aux let row := physicalMixedGatedCleanPatternAction (B := fullB) F V b C ζ θ ρ k K Vs qsmall cleanMixedSourceGate (cleanMixedTargetGate Fs) have hbase := hpower P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ F hF b T Pmin hT hTmax hPminexp hpmin hb S Ps fullB k ν ρ hν hρ0 hρ1 Vs hVs cleanMixedSourceGate (cleanMixedTargetGate Fs) clean_mixed_source_gate_norm_le (clean_mixed_target_gate_norm_le Fs) clean_mixed_source_gate_big_permutation (clean_mixed_target_gate_big_permutation Fs) (physicalSmallBigAverage f) (clean_mixed_target_gate_mul_memory_symmetric Fs _ (physical_small_big_average_memory_symmetric f hf)) have heq : physicalSmallBigJointAverage (row (physicalSmallBigJointAverage f)) = physicalSmallBigAverage (physicalSmallBigBigAverage (row (physicalSmallBigBigAverage (physicalSmallBigAverage f)))) := by rw [physical_small_big_joint_average_eq_big_small f] rfl have hnonneg : 0 ≤ A ^ (2 * Fintype.card S) * (L ^ (-E)) ^ 2 := mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) (sq_nonneg _) have he : physicalSmallBigEnergy Vs W (physicalSmallBigJointAverage (row (physicalSmallBigJointAverage f))) ≤ A ^ (2 * Fintype.card S) * (L ^ (-E)) ^ 2 * physicalSmallBigEnergy Vs W f := by rw [heq] exact (physical_small_big_average_energy_le Vs hVs' W hW _).trans (hbase.trans (mul_le_mul_of_nonneg_left (physical_small_big_average_energy_le Vs hVs' W hW f) hnonneg)) have hn := physical_small_big_norm_le_of_energy Vs W (A ^ Fintype.card S * L ^ (-E)) 1 (mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) (Real.rpow_nonneg hL.le _)) zero_le_one f (physicalSmallBigJointAverage (row (physicalSmallBigJointAverage f))) (by simpa only [mul_pow, ← pow_mul, Nat.mul_comm, mul_one] using he) simp only [Real.sqrt_one, mul_one, row, K] at hn convert hn using 1 all_goals congr 3 theorem eventually_rough_test_proxy_long_discrepancy (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {a γ S T B : ℝ} (ha : 0 < a) (hγ : 0 < γ) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+B+4 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ t : ℝ, |t| ≤ L^T → ∀ m n : ℕ, Real.exp (a*L) ≤ ((m+1 : ℕ) : ℝ) → (n : ℝ) ≤ Real.exp (2*L) → ‖∑ i ∈ Ioc m n, ((roughTestIndicator γ L i-roughTestLogarithmicProxy γ L S i : ℝ) : ℂ)* harmonicMellinWeight t i*χ (i : ZMod r)‖ ≤ L^(-B) := by filter_upwards [eventually_rough_test_proxy_character_discrepancy hZ (half_pos ha) hγ (by norm_num : (0 : ℝ) < 2) hS hT (Bsave := B+2) (by linarith), eventually_exp_half_le_half_exp ha, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (2/Real.log 2+2)] with L hlocal hhalf hL hLbig intro r hr χ hrT t ht m n hm hn apply norm_Ioc_sum_le_rpow_of_dyadic (Real.exp_pos (a*L)) hL hLbig _ m n hm hn intro Y hY hYU lo hi hlohi hYlo hhi exact hlocal Y (hhalf.trans hY) hYU r χ hrT t ht lo hi hlohi hYlo hhi theorem eventually_prime_proxy_long_discrepancy (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {a S T B : ℝ} (ha : 0 < a) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+B+4 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ t : ℝ, |t| ≤ L^T → ∀ m n : ℕ, Real.exp (a*L) ≤ ((m+1 : ℕ) : ℝ) → (n : ℝ) ≤ Real.exp (2*L) → ‖∑ i ∈ Ioc m n, (((if i.Prime then 1 else 0 : ℝ)-primeLogarithmicProxy L S i : ℝ) : ℂ)* harmonicMellinWeight t i*χ (i : ZMod r)‖ ≤ L^(-B) := by filter_upwards [eventually_prime_proxy_character_discrepancy hZ (half_pos ha) hS hT (Bsave := B+2) (by linarith), eventually_exp_half_le_half_exp ha, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (2/Real.log 2+2)] with L hlocal hhalf hL hLbig intro r hr χ hrT t ht m n hm hn apply norm_Ioc_sum_le_rpow_of_dyadic (Real.exp_pos (a*L)) hL hLbig _ m n hm hn intro Y hY _ lo hi hlohi hYlo hhi exact hlocal Y (hhalf.trans hY) r χ hrT t ht lo hi hlohi hYlo hhi theorem eventually_ambient_rough_interval_typeII_discrepancy_uniform (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {γ vMax S T B : ℝ} (hγ : 0 < γ) (hv : vMax < 1) (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+B+4 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ a v : ℝ, v ≤ vMax → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ t : ℝ, |t| ≤ L^T → ∀ m n : ℕ, ‖∑ i ∈ Ioc m n, (ambientRoughIntervalTypeIIAlpha γ L S a v i : ℂ)* harmonicMellinWeight t i*χ (i : ZMod r)‖ ≤ L^(-B) := by filter_upwards [eventually_rough_test_proxy_long_discrepancy hZ (by linarith : 0 < 1-vMax) hγ hS hT hprecision, eventually_ge_atTop (Real.log 33), eventually_ge_atTop (0 : ℝ)] with L hlong hL hL0 intro a v hvMax r hr χ hrT t ht m n have hlower : Real.exp ((1-vMax)*L) ≤ Real.exp ((1-v)*L) := by apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonneg_right (by linarith) hL0 have h33 : (33 : ℝ) ≤ Real.exp L := by calc _ = Real.exp (Real.log 33) := (Real.exp_log (by norm_num)).symm _ ≤ _ := Real.exp_le_exp.mpr hL have hupper : 33*Real.exp L ≤ Real.exp (2*L) := by calc _ ≤ Real.exp L*Real.exp L := mul_le_mul_of_nonneg_right h33 (by positivity) _ = _ := by rw [← Real.exp_add]; congr 1; ring simp only [ambientRoughIntervalTypeIIAlpha, ambient_rough_cofactor_range_eq_Icc, mul_assoc] apply norm_typeIIRestrict_Icc_sum_le _ _ _ _ m n (Nat.le_max_left _ _) (A := Real.exp ((1-vMax)*L)) (U := Real.exp (2*L)) · exact hlower.trans ((Nat.le_ceil _).trans (Nat.cast_le.mpr (Nat.le_max_right _ _))) · exact (Nat.cast_le.mpr (min_le_left _ _)).trans ((Nat.floor_le (by positivity)).trans hupper) · intro lo hi hlo hhi simpa only [mul_assoc] using hlong r χ hrT t ht lo hi hlo hhi theorem eventually_ambient_prime_typeII_discrepancy (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {S T B : ℝ} (hS : 0 ≤ S) (hT : 0 ≤ T) (hprecision : T+B+4 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L^T → ∀ t : ℝ, |t| ≤ L^T → ∀ m n : ℕ, ‖∑ i ∈ Ioc m n, (ambientPrimeTypeIIAlpha κ L S i : ℂ)* harmonicMellinWeight t i*χ (i : ZMod r)‖ ≤ L^(-B) := by filter_upwards [eventually_prime_proxy_long_discrepancy hZ (by norm_num : (0 : ℝ) < 2/5) hS hT hprecision, eventually_ge_atTop (0 : ℝ)] with L hlong hL intro κ hκ hκsmall r hr χ hrT t ht m n have hlower : Real.exp ((2/5 : ℝ)*L) ≤ Real.exp (((1/2 : ℝ)-2*κ)*L) := by apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonneg_right (by linarith) hL have hupper : Real.exp (((1/2 : ℝ)+2*κ)*L) ≤ Real.exp (2*L) := by apply Real.exp_le_exp.mpr exact mul_le_mul_of_nonneg_right (by linarith) hL simp only [ambientPrimeTypeIIAlpha, ambient_balanced_typeII_range_eq_Icc, mul_assoc] apply norm_typeIIRestrict_Icc_sum_le _ _ _ _ m n (Nat.le_max_left _ _) (A := Real.exp ((2/5 : ℝ)*L)) (U := Real.exp (2*L)) · exact hlower.trans ((Nat.le_ceil _).trans (Nat.cast_le.mpr (Nat.le_max_right _ _))) · exact (Nat.floor_le (by positivity)).trans hupper · intro lo hi hlo hhi simpa only [mul_assoc] using hlong r χ hrT t ht lo hi hlo hhi theorem eventually_ambient_rough_uniform_shift_discrepancy (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {γ vMax S B0 Cmod Sfreq B : ℝ} (hγ : 0 < γ) (hv : vMax < 1) (hS : 0 ≤ S) (hB0 : 0 ≤ B0) (hprecision : max (max B0 Sfreq) Cmod + B + 5 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ a v : ℝ, v ≤ vMax → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L ^ Cmod → ∀ u σ : ℝ, |u| ≤ L ^ B0 → |σ| ≤ L ^ Sfreq → ∀ m n : ℕ, ‖∑ i ∈ Ioc m n, (ambientRoughIntervalTypeIIAlpha γ L S a v i : ℂ) * harmonicMellinWeight (u + σ) i * χ (i : ZMod r)‖ ≤ L ^ (-B) := by have hx : 0 ≤ max (max B0 Sfreq) Cmod := hB0.trans ((le_max_left _ _).trans (le_max_left _ _)) have hT : 0 ≤ max (max B0 Sfreq) Cmod + 1 := by linarith filter_upwards [eventually_ambient_rough_interval_typeII_discrepancy_uniform hZ hγ hv hS hT (by linarith : (max (max B0 Sfreq) Cmod + 1) + B + 4 ≤ S), eventually_ge_atTop (2 : ℝ)] with L hdis hL intro a v hv' r hr χ hrange u σ hu hσ m n have hL1 : 1 ≤ L := by linarith apply hdis a v hv' r χ _ (u + σ) _ m n · exact hrange.trans (Real.rpow_le_rpow_of_exponent_le hL1 (by linarith [le_max_right (max B0 Sfreq) Cmod])) · exact (abs_add_le_rpow_max_add_one hL hu hσ).trans (Real.rpow_le_rpow_of_exponent_le hL1 (by linarith [le_max_left (max B0 Sfreq) Cmod])) theorem eventually_ambient_prime_uniform_shift_discrepancy (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {S B0 Cmod Sfreq B : ℝ} (hS : 0 ≤ S) (hB0 : 0 ≤ B0) (hprecision : max (max B0 Sfreq) Cmod + B + 5 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1 / 50 → ∀ (r : ℕ) [NeZero r] (χ : DirichletCharacter ℂ r), (r : ℝ) ≤ L ^ Cmod → ∀ u σ : ℝ, |u| ≤ L ^ B0 → |σ| ≤ L ^ Sfreq → ∀ m n : ℕ, ‖∑ i ∈ Ioc m n, (ambientPrimeTypeIIAlpha κ L S i : ℂ) * harmonicMellinWeight (u + σ) i * χ (i : ZMod r)‖ ≤ L ^ (-B) := by have hx : 0 ≤ max (max B0 Sfreq) Cmod := hB0.trans ((le_max_left _ _).trans (le_max_left _ _)) have hT : 0 ≤ max (max B0 Sfreq) Cmod + 1 := by linarith filter_upwards [eventually_ambient_prime_typeII_discrepancy hZ hS hT (by linarith : (max (max B0 Sfreq) Cmod + 1) + B + 4 ≤ S), eventually_ge_atTop (2 : ℝ)] with L hdis hL intro κ hκ hκ' r hr χ hrange u σ hu hσ m n have hL1 : 1 ≤ L := by linarith apply hdis κ hκ hκ' r χ _ (u + σ) _ m n · exact hrange.trans (Real.rpow_le_rpow_of_exponent_le hL1 (by linarith [le_max_right (max B0 Sfreq) Cmod])) · exact (abs_add_le_rpow_max_add_one hL hu hσ).trans (Real.rpow_le_rpow_of_exponent_le hL1 (by linarith [le_max_left (max B0 Sfreq) Cmod])) theorem eventually_ambient_rough_mellin_low_factor (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {γ vMax S B0 Cmod Sfreq B : ℝ} (hγ : 0 < γ) (hv : vMax < 1) (hS : 0 ≤ S) (hB0 : 0 ≤ B0) (hprecision : max (max B0 Sfreq) Cmod+B+5 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ a v : ℝ, v ≤ vMax → ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), (q : ℝ) ≤ L^Cmod → ∀ ν : ℝ, |ν| ≤ L^Sfreq → (∀ n : ℕ, 0 < n → ‖ambientRoughMellinCoefficient γ L S a v ν χ n‖ ≤ 1) ∧ ∀ u : ℝ, |u| ≤ L^B0 → ∀ lo hi : ℕ, ‖∑ n ∈ Ioc lo hi, ambientRoughMellinCoefficient γ L S a v ν χ n* harmonicMellinWeight u n‖ ≤ L^(-B) := by filter_upwards [eventually_ambient_rough_uniform_shift_discrepancy hZ hγ hv hS hB0 hprecision, eventually_rough_typeII_restriction_properties hγ] with L hlow hbound intro a v hv' q hqInst χ hq ν hν constructor · intro n hn have halpha : ‖(ambientRoughIntervalTypeIIAlpha γ L S a v n : ℂ)‖ ≤ 1 := by simpa only [Complex.norm_real,Real.norm_eq_abs,ambientRoughIntervalTypeIIAlpha] using (hbound S (ambientRoughCofactorRange L a v) n).1 have hphase : ‖(n : ℂ)^((ν : ℂ)*Complex.I)‖ = 1 := by rw [show (n : ℂ) = ((n : ℝ) : ℂ) by simp, Complex.norm_cpow_eq_rpow_re_of_pos (Nat.cast_pos.mpr hn)] simp unfold ambientRoughMellinCoefficient rw [norm_mul,norm_mul,hphase,mul_one] exact (mul_le_mul halpha (χ.norm_le_one _) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1) · intro u hu lo hi rw [ambient_rough_mellin_polynomial_eq] exact hlow a v hv' q χ hq u ν hu hν lo hi theorem eventually_ambient_prime_mellin_low_factor (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {S B0 Cmod Sfreq B : ℝ} (hS : 0 ≤ S) (hB0 : 0 ≤ B0) (hprecision : max (max B0 Sfreq) Cmod+B+5 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), (q : ℝ) ≤ L^Cmod → ∀ ν : ℝ, |ν| ≤ L^Sfreq → (∀ n : ℕ, 0 < n → ‖ambientPrimeMellinCoefficient κ L S ν χ n‖ ≤ 1) ∧ ∀ u : ℝ, |u| ≤ L^B0 → ∀ lo hi : ℕ, ‖∑ n ∈ Ioc lo hi, ambientPrimeMellinCoefficient κ L S ν χ n* harmonicMellinWeight u n‖ ≤ L^(-B) := by filter_upwards [eventually_ambient_prime_uniform_shift_discrepancy hZ hS hB0 hprecision, eventually_balanced_typeII_coefficient_properties S hS] with L hlow hbound intro κ hκ hκmax q hqInst χ hq ν hν constructor · intro n hn have halpha : ‖(ambientPrimeTypeIIAlpha κ L S n : ℂ)‖ ≤ 1 := by simpa only [Complex.norm_real,Real.norm_eq_abs] using (hbound κ hκ hκmax n).1 have hphase : ‖(n : ℂ)^((ν : ℂ)*Complex.I)‖ = 1 := by rw [show (n : ℂ) = ((n : ℝ) : ℂ) by simp, Complex.norm_cpow_eq_rpow_re_of_pos (Nat.cast_pos.mpr hn)] simp unfold ambientPrimeMellinCoefficient rw [norm_mul,norm_mul,hphase,mul_one] exact (mul_le_mul halpha (χ.norm_le_one _) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1) · intro u hu lo hi rw [ambient_prime_mellin_polynomial_eq] exact hlow κ hκ hκmax q χ hq u ν hu hν lo hi theorem exists_ambient_prime_four_factor_integral_decay_log_radius (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {a beta c d Bcoeff A As H Et aLong : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hd : 0 < d) (hBcoeff : 1 ≤ Bcoeff) (hAs0 : 0 ≤ As) (haLong : 0 < aLong) (hAs : A+2*Et+21 ≤ 2*As) (hH : A+2*Et+23 ≤ 2*H) (Tmod Sshift Cmod Sfreq : ℝ) : ∃ B0 : ℝ, 0 < B0 ∧ ∀ Bsave : ℝ, A+B0+2*Et+7 ≤ 2*Bsave → ∀ S : ℝ, 0 ≤ S → max (max B0 Sfreq) Cmod+Bsave+5 ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R : ℝ), 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ c*L → Real.exp (L^a)/2 ≤ P → P ≤ Real.exp (L^beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → (∀ p : s, ‖coeff p‖ ≤ Bcoeff) → ∀ (lo hi : ℕ) (F : Finset ℕ) (γT : ℕ → ℂ) (UM UT BT : ℝ), 0 < UM → 1 ≤ UT → 0 ≤ BT → BT ≤ L^Et → (∀ n ∈ F, ‖γT n‖ ≤ BT) → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (q : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ c*L → (∫ u in Set.Icc (-R) R, ‖primeReciprocalPolynomial s coeff u * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u+σ) n*χ (n : ZMod q))* (∑ n ∈ Ioc lo hi, ambientPrimeMellinCoefficient κM L S ν χM n*harmonicMellinWeight u n)* (∑ n ∈ F, γT n*harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨B0,hB0,hmain⟩ := exists_literal_four_factor_integral_decay_log_radius (E := Et) ha ha1 hbeta hc hd hBcoeff hAs0 haLong hAs hH Tmod Sshift refine ⟨B0,hB0,?_⟩ intro Bsave hsave S hS hprecision filter_upwards [hmain Bsave hsave, eventually_ambient_prime_mellin_low_factor hZ hS hB0.le hprecision] with L hdecay hlow intro s hs coeff Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp hcoeff lo hi F γT UM UT BT hUM hUT hBT hBTpow hγT hMband hFband κM ν qM hqMInst χM hκ hκmax hqM hν UQ Alo Blo σ q hqInst χ hUQ hQA hAB hBQ hq hσ hmeanScale hresScale hlog have hM := hlow κM hκ hκmax qM χM hqM ν hν apply hdecay s hs coeff Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp hcoeff (Ioc lo hi) F (ambientPrimeMellinCoefficient κM L S ν χM) γT UM UT 1 BT hUM hUT zero_le_one hBT (by simpa only [one_mul] using hBTpow) hBTpow (fun n hn => hM.1 n ((Nat.zero_le lo).trans_lt (mem_Ioc.mp hn).1)) hγT hMband hFband UQ Alo Blo σ q χ hUQ hQA hAB hBQ hq hσ hmeanScale hresScale hlog intro u _ hu exact hM.2 u hu lo hi theorem exists_ambient_rough_four_factor_integral_decay_log_radius (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {a beta c d Bcoeff A As H Et aLong γrough vMax : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (hbeta : beta < 1) (hc : 0 ≤ c) (hd : 0 < d) (hBcoeff : 1 ≤ Bcoeff) (hAs0 : 0 ≤ As) (haLong : 0 < aLong) (hγ : 0 < γrough) (hv : vMax < 1) (hAs : A+2*Et+21 ≤ 2*As) (hH : A+2*Et+23 ≤ 2*H) (Tmod Sshift Cmod Sfreq : ℝ) : ∃ B0 : ℝ, 0 < B0 ∧ ∀ Bsave : ℝ, A+B0+2*Et+7 ≤ 2*Bsave → ∀ S : ℝ, 0 ≤ S → max (max B0 Sfreq) Cmod+Bsave+5 ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (s : Finset ℕ), (∀ p ∈ s, Nat.Prime p) → ∀ (coeff : s → ℂ) (Y P R : ℝ), 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ c*L → Real.exp (L^a)/2 ≤ P → P ≤ Real.exp (L^beta) → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → (∀ p : s, ‖coeff p‖ ≤ Bcoeff) → ∀ (lo hi : ℕ) (F : Finset ℕ) (γT : ℕ → ℂ) (UM UT BT : ℝ), 0 < UM → 1 ≤ UT → 0 ≤ BT → BT ≤ L^Et → (∀ n ∈ F, ‖γT n‖ ≤ BT) → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (q : ℕ) [NeZero q] (χ : DirichletCharacter ℂ q), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (q : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ c*L → (∫ u in Set.Icc (-R) R, ‖primeReciprocalPolynomial s coeff u * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u+σ) n*χ (n : ZMod q))* (∑ n ∈ Ioc lo hi, ambientRoughMellinCoefficient γrough L S aM v ν χM n*harmonicMellinWeight u n)* (∑ n ∈ F, γT n*harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨B0,hB0,hmain⟩ := exists_literal_four_factor_integral_decay_log_radius (E := Et) ha ha1 hbeta hc hd hBcoeff hAs0 haLong hAs hH Tmod Sshift refine ⟨B0,hB0,?_⟩ intro Bsave hsave S hS hprecision filter_upwards [hmain Bsave hsave, eventually_ambient_rough_mellin_low_factor hZ hγ hv hS hB0.le hprecision] with L hdecay hlow intro s hs coeff Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp hcoeff lo hi F γT UM UT BT hUM hUT hBT hBTpow hγT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ q hqInst χ hUQ hQA hAB hBQ hq hσ hmeanScale hresScale hlog have hM := hlow aM v hvM qM χM hqM ν hν apply hdecay s hs coeff Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp hcoeff (Ioc lo hi) F (ambientRoughMellinCoefficient γrough L S aM v ν χM) γT UM UT 1 BT hUM hUT zero_le_one hBT (by simpa only [one_mul] using hBTpow) hBTpow (fun n hn => hM.1 n ((Nat.zero_le lo).trans_lt (mem_Ioc.mp hn).1)) hγT hMband hFband UQ Alo Blo σ q χ hUQ hQA hAB hBQ hq hσ hmeanScale hresScale hlog intro u _ hu exact hM.2 u hu lo hi theorem exists_original_filtered_prime_integral_precision_with_residual_multiplier_log_radius (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d A aLong : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (T : ℕ) (Tmod Sshift Cmod Sfreq : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ ρ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → (∀ n, ‖ρ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p)*harmonicMellinWeight u p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*χQ (n : ZMod qQ)*harmonicMellinWeight u n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n*harmonicMellinWeight u n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n) n* harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hres⟩ := exists_candidate_selected_residual_power_bound hc hq0 hq1 T obtain ⟨Bcoeff,hBcoeff,hsmall⟩ := exists_candidate_small_prime_factor_data hc refine ⟨C,hC,?_⟩ intro B let X := max 0 ((A+2*(C+B)+23)/2) have hAs0 : 0 ≤ X := le_max_left _ _ have hX : (A+2*(C+B)+23)/2 ≤ X := le_max_right _ _ have hAs : A+2*(C+B)+21 ≤ 2*X := by linarith have hH : A+2*(C+B)+23 ≤ 2*X := by linarith obtain ⟨B0,hB0,hmain⟩ := exists_ambient_prime_four_factor_integral_decay_log_radius (a := (1/10 : ℝ)) (beta := (1/5 : ℝ)) (Et := C+B) hZ (by norm_num) (by norm_num) (by norm_num) hcLog hd hBcoeff hAs0 haLong hAs hH Tmod Sshift Cmod Sfreq let Bsave := (A+B0+2*(C+B)+7)/2 have hsave : A+B0+2*(C+B)+7 ≤ 2*Bsave := by dsimp [Bsave]; linarith refine ⟨max 0 (max (max B0 Sfreq) Cmod+Bsave+5), le_max_left _ _, ?_⟩ intro S hS0 have hS : 0 ≤ S := (le_max_left _ _).trans hS0 have hprecision : max (max B0 Sfreq) Cmod+Bsave+5 ≤ S := (le_max_right _ _).trans hS0 filter_upwards [hmain Bsave hsave S hS hprecision,hres,hsmall,eventually_gt_atTop (0 : ℝ)] with L hdecay hresL hsmallL hL intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ρ ht hb hκ hρ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog obtain ⟨hsprime,hPlo,hPhi,hcoeff⟩ := hsmallL g hg s P hs hne hsp have hT := hresL B r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n) ht hb hκ (fun n => by rw [norm_mul] exact (mul_le_mul (character_typeIIPhase_norm_le χT τT n) (hρ n) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1)) have hbound := hdecay s hsprime (fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p.val : ZMod qP)*typeIIPhase τP p.val)) Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp (hcoeff (fun n => χP (n : ZMod qP)*typeIIPhase τP n) (fun n _ => character_typeIIPhase_norm_le χP τP n)) lo hi F (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n)) UM UT (L^(C+B)) hUM hUT (Real.rpow_nonneg hL.le _) le_rfl (fun n _ => hT n) hMband hFband κM ν qM χM hκM hκmax hqM hν UQ Alo Blo σ qQ χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog have hQeq (u : ℝ) : (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*χQ (n : ZMod qQ)*harmonicMellinWeight u n) = ∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u+σ) n*χQ (n : ZMod qQ) := by apply sum_congr rfl intro n _ rw [mul_right_comm,typeIIPhase_harmonic_mellin_shift] have hMeq (u : ℝ) : (∑ n ∈ Ioc lo hi, (ambientPrimeTypeIIAlpha κM L S n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n*harmonicMellinWeight u n) = ∑ n ∈ Ioc lo hi, ambientPrimeMellinCoefficient κM L S ν χM n*harmonicMellinWeight u n := by apply sum_congr rfl intro n hn rw [ambient_prime_original_phase_coefficient κM L S ν χM ((Nat.zero_le lo).trans_lt (mem_Ioc.mp hn).1)] have hPeq (u : ℝ) := prime_reciprocal_polynomial_eq_harmonic_sum s (fun n : ℕ => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (n : ZMod qP)*typeIIPhase τP n)) u simpa only [typeIIRestrict_nonzero_phase_mellin_sum,hPeq,hQeq,hMeq] using hbound theorem exists_original_filtered_rough_integral_precision_with_residual_multiplier_log_radius (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d A aLong γrough vMax : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (hγ : 0 < γrough) (hv : vMax < 1) (T : ℕ) (Tmod Sshift Cmod Sfreq : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ ρ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → (∀ n, ‖ρ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p)*harmonicMellinWeight u p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*χQ (n : ZMod qQ)*harmonicMellinWeight u n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n*harmonicMellinWeight u n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n) n* harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hres⟩ := exists_candidate_selected_residual_power_bound hc hq0 hq1 T obtain ⟨Bcoeff,hBcoeff,hsmall⟩ := exists_candidate_small_prime_factor_data hc refine ⟨C,hC,?_⟩ intro B let X := max 0 ((A+2*(C+B)+23)/2) have hAs0 : 0 ≤ X := le_max_left _ _ have hX : (A+2*(C+B)+23)/2 ≤ X := le_max_right _ _ have hAs : A+2*(C+B)+21 ≤ 2*X := by linarith have hH : A+2*(C+B)+23 ≤ 2*X := by linarith obtain ⟨B0,hB0,hmain⟩ := exists_ambient_rough_four_factor_integral_decay_log_radius (a := (1/10 : ℝ)) (beta := (1/5 : ℝ)) (Et := C+B) hZ (by norm_num) (by norm_num) (by norm_num) hcLog hd hBcoeff hAs0 haLong hγ hv hAs hH Tmod Sshift Cmod Sfreq let Bsave := (A+B0+2*(C+B)+7)/2 have hsave : A+B0+2*(C+B)+7 ≤ 2*Bsave := by dsimp [Bsave]; linarith refine ⟨max 0 (max (max B0 Sfreq) Cmod+Bsave+5), le_max_left _ _, ?_⟩ intro S hS0 have hS : 0 ≤ S := (le_max_left _ _).trans hS0 have hprecision : max (max B0 Sfreq) Cmod+Bsave+5 ≤ S := (le_max_right _ _).trans hS0 filter_upwards [hmain Bsave hsave S hS hprecision,hres,hsmall,eventually_gt_atTop (0 : ℝ)] with L hdecay hresL hsmallL hL intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ρ ht hb hκ hρ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog obtain ⟨hsprime,hPlo,hPhi,hcoeff⟩ := hsmallL g hg s P hs hne hsp have hT := hresL B r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n) ht hb hκ (fun n => by rw [norm_mul] exact (mul_le_mul (character_typeIIPhase_norm_le χT τT n) (hρ n) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1)) have hbound := hdecay s hsprime (fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p.val : ZMod qP)*typeIIPhase τP p.val)) Y P R hY hYlo hYhi hPlo hPhi hR hRY hsp (hcoeff (fun n => χP (n : ZMod qP)*typeIIPhase τP n) (fun n _ => character_typeIIPhase_norm_le χP τP n)) lo hi F (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*ρ n)) UM UT (L^(C+B)) hUM hUT (Real.rpow_nonneg hL.le _) le_rfl (fun n _ => hT n) hMband hFband aM v ν qM χM hvM hqM hν UQ Alo Blo σ qQ χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog have hQeq (u : ℝ) : (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*χQ (n : ZMod qQ)*harmonicMellinWeight u n) = ∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), harmonicMellinWeight (u+σ) n*χQ (n : ZMod qQ) := by apply sum_congr rfl intro n _ rw [mul_right_comm,typeIIPhase_harmonic_mellin_shift] have hMeq (u : ℝ) : (∑ n ∈ Ioc lo hi, (ambientRoughIntervalTypeIIAlpha γrough L S aM v n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n*harmonicMellinWeight u n) = ∑ n ∈ Ioc lo hi, ambientRoughMellinCoefficient γrough L S aM v ν χM n*harmonicMellinWeight u n := by apply sum_congr rfl intro n hn rw [ambient_rough_original_phase_coefficient γrough L S aM v ν χM ((Nat.zero_le lo).trans_lt (mem_Ioc.mp hn).1)] have hPeq (u : ℝ) := prime_reciprocal_polynomial_eq_harmonic_sum s (fun n : ℕ => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (n : ZMod qP)*typeIIPhase τP n)) u simpa only [typeIIRestrict_nonzero_phase_mellin_sum,hPeq,hQeq,hMeq] using hbound theorem exists_rational_filtered_prime_integral_precision_log_radius (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d A aLong : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → ∀ (qRat dRat : ℕ), 0 < qRat → 0 < dRat → dRat ∣ qRat → (qRat : ℝ) ≤ L^Rmod → ∀ ψ : AddChar (Additive (ZMod (qRat/dRat))ˣ) ℂ, (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase τP p)*harmonicMellinWeight u p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight u n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase ν n*harmonicMellinWeight u n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*rationalResidualGcdMultiplier qRat dRat ψ n) n* harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hmain⟩ := exists_original_filtered_prime_integral_precision_with_residual_multiplier_log_radius (A := A) hZ hc hq0 hq1 hcLog hd haLong T (Tmod+Rmod) Sshift (Cmod+Rmod) Sfreq refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,eventually_gt_atTop (0 : ℝ)] with L hdecay hL intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ have hquot : 0 < qRat/dRat := Nat.div_pos (Nat.le_of_dvd hqRat0 hdvd) hdRat exact @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ (rationalResidualGcdMultiplier qRat dRat ψ) ht hb hκ (rational_residual_gcd_multiplier_norm_le qRat dRat ψ) g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp (qP*(qRat/dRat)) qT (rationalProductCharacter qRat dRat χP ψ) χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν (qM*(qRat/dRat)) ⟨mul_ne_zero (NeZero.ne qM) hquot.ne'⟩ (rationalProductCharacter qRat dRat χM ψ) hκM hκmax (rational_product_modulus_power_bound hL hqM hqRat) hν UQ Alo Blo σ (qQ*(qRat/dRat)) ⟨mul_ne_zero (NeZero.ne qQ) hquot.ne'⟩ (rationalProductCharacter qRat dRat χQ ψ) hUQ hQA hAB hBQ (rational_product_modulus_power_bound hL hqQ hqRat) hσ hmeanScale hresScale hlog theorem exists_rational_filtered_rough_integral_precision_log_radius (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d A aLong γrough vMax : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (hγ : 0 < γrough) (hv : vMax < 1) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → ∀ (qRat dRat : ℕ), 0 < qRat → 0 < dRat → dRat ∣ qRat → (qRat : ℝ) ≤ L^Rmod → ∀ ψ : AddChar (Additive (ZMod (qRat/dRat))ˣ) ℂ, (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase τP p)*harmonicMellinWeight u p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight u n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase ν n*harmonicMellinWeight u n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*rationalResidualGcdMultiplier qRat dRat ψ n) n* harmonicMellinWeight u n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hmain⟩ := exists_original_filtered_rough_integral_precision_with_residual_multiplier_log_radius (A := A) hZ hc hq0 hq1 hcLog hd haLong hγ hv T (Tmod+Rmod) Sshift (Cmod+Rmod) Sfreq refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,eventually_gt_atTop (0 : ℝ)] with L hdecay hL intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ have hquot : 0 < qRat/dRat := Nat.div_pos (Nat.le_of_dvd hqRat0 hdvd) hdRat exact @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ (rationalResidualGcdMultiplier qRat dRat ψ) ht hb hκ (rational_residual_gcd_multiplier_norm_le qRat dRat ψ) g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp (qP*(qRat/dRat)) qT (rationalProductCharacter qRat dRat χP ψ) χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν (qM*(qRat/dRat)) ⟨mul_ne_zero (NeZero.ne qM) hquot.ne'⟩ (rationalProductCharacter qRat dRat χM ψ) hvM (rational_product_modulus_power_bound hL hqM hqRat) hν UQ Alo Blo σ (qQ*(qRat/dRat)) ⟨mul_ne_zero (NeZero.ne qQ) hquot.ne'⟩ (rationalProductCharacter qRat dRat χQ ψ) hUQ hQA hAB hBQ (rational_product_modulus_power_bound hL hqQ hqRat) hσ hmeanScale hresScale hlog theorem exists_rational_shifted_filtered_prime_integral_precision_log_radius (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d A aLong : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → ∀ (qRat dRat : ℕ), 0 < qRat → 0 < dRat → dRat ∣ qRat → (qRat : ℝ) ≤ L^Rmod → ∀ ψ : AddChar (Additive (ZMod (qRat/dRat))ˣ) ℂ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase τP p)*harmonicMellinWeight (u+w) p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight (u+w) n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase ν n*harmonicMellinWeight (u+w) n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*rationalResidualGcdMultiplier qRat dRat ψ n) n* harmonicMellinWeight (u+w) n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hmain⟩ := exists_rational_filtered_prime_integral_precision_log_radius (A := A) hZ hc hq0 hq1 hcLog hd haLong T Tmod (max Sshift W+1) Cmod (max Sfreq W+1) Rmod refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,eventually_add_frequency_power_bound Sfreq W, eventually_add_frequency_power_bound Sshift W] with L hdecay hfreq hshift intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ w hw have hresult := @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT (τP+w) (τT+w) lo hi F UM UT hUM hUT hMband hFband κM (ν+w) qM hqMInst χM hκM hκmax hqM (hfreq ν w hν hw) UQ Alo Blo (σ+w) qQ hqQInst χQ hUQ hQA hAB hBQ hqQ (hshift σ w hσ hw) hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ have hP (u : ℝ) : (∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))* typeIIPhase (τP+w) p)*harmonicMellinWeight u p) = ∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))* typeIIPhase τP p)*harmonicMellinWeight (u+w) p := by apply sum_congr rfl intro p _ simpa only [mul_assoc,mul_one] using rational_phase_harmonic_common_shift ((1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))) 1 τP u w p have hQ (u : ℝ) : (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase (σ+w) n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight u n) = ∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ simpa only [one_mul] using rational_phase_harmonic_common_shift 1 (rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))) σ u w n have hM (u : ℝ) : (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))* typeIIPhase (ν+w) n*harmonicMellinWeight u n) = ∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))* typeIIPhase ν n*harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ simpa only [mul_one] using rational_phase_harmonic_common_shift ((typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))) 1 ν u w n have hT (u : ℝ) : (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase (τT+w) n* rationalResidualGcdMultiplier qRat dRat ψ n) n*harmonicMellinWeight u n) = ∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n* rationalResidualGcdMultiplier qRat dRat ψ n) n*harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ unfold candidateSelectedResidualCoefficient dsimp only rw [typeIIPhase_add, ← typeIIPhase_harmonic_mellin_shift w u n] ring simpa only [hP,hQ,hM,hT] using hresult theorem exists_rational_shifted_filtered_rough_integral_precision_log_radius (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d A aLong γrough vMax : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (hγ : 0 < γrough) (hv : vMax < 1) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → ∀ (qRat dRat : ℕ), 0 < qRat → 0 < dRat → dRat ∣ qRat → (qRat : ℝ) ≤ L^Rmod → ∀ ψ : AddChar (Additive (ZMod (qRat/dRat))ˣ) ℂ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖(∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase τP p)*harmonicMellinWeight (u+w) p) * (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))*harmonicMellinWeight (u+w) n)* (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase ν n*harmonicMellinWeight (u+w) n)* (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n*rationalResidualGcdMultiplier qRat dRat ψ n) n* harmonicMellinWeight (u+w) n)‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hmain⟩ := exists_rational_filtered_rough_integral_precision_log_radius (A := A) hZ hc hq0 hq1 hcLog hd haLong hγ hv T Tmod (max Sshift W+1) Cmod (max Sfreq W+1) Rmod refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS, eventually_add_frequency_power_bound Sshift W, eventually_add_frequency_power_bound Sfreq W] with L hdecay hshift hfreq intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ w hw have hraw := @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT (τP+w) (τT+w) lo hi F UM UT hUM hUT hMband hFband aM v (ν+w) qM hqMInst χM hvM hqM (hfreq ν w hν hw) UQ Alo Blo (σ+w) qQ hqQInst χQ hUQ hQA hAB hBQ hqQ (hshift σ w hσ hw) hmeanScale hresScale hlog qRat dRat hqRat0 hdRat hdvd hqRat ψ have heP (u : ℝ) : (∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase (τP+w) p)* harmonicMellinWeight u p) = ∑ p ∈ s, (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))*typeIIPhase τP p)* harmonicMellinWeight (u+w) p := by apply sum_congr rfl intro p _ simpa only [mul_one, mul_assoc] using rational_phase_harmonic_common_shift ((1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* rationalProductCharacter qRat dRat χP ψ (p : ZMod (qP*(qRat/dRat)))) 1 τP u w p have heQ (u : ℝ) : (∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase (σ+w) n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))* harmonicMellinWeight u n) = ∑ n ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), typeIIPhase σ n*rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))* harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ simpa only [one_mul] using rational_phase_harmonic_common_shift 1 (rationalProductCharacter qRat dRat χQ ψ (n : ZMod (qQ*(qRat/dRat)))) σ u w n have heM (u : ℝ) : (∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase (ν+w) n* harmonicMellinWeight u n) = ∑ n ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))*typeIIPhase ν n* harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ simpa only [mul_one] using rational_phase_harmonic_common_shift ((typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* rationalProductCharacter qRat dRat χM ψ (n : ZMod (qM*(qRat/dRat)))) 1 ν u w n have heT (u : ℝ) : (∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase (τT+w) n* rationalResidualGcdMultiplier qRat dRat ψ n) n*harmonicMellinWeight u n) = ∑ n ∈ F, candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n* rationalResidualGcdMultiplier qRat dRat ψ n) n*harmonicMellinWeight (u+w) n := by apply sum_congr rfl intro n _ unfold candidateSelectedResidualCoefficient dsimp only rw [typeIIPhase_add, ← typeIIPhase_harmonic_mellin_shift w u n] ring simpa only [heP, heQ, heM, heT] using hraw theorem exists_rational_prime_cutoff_integral_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d A aLong : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → (∀ p ∈ s, ∀ z ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), ∀ m ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), ∀ n ∈ F, Y/128 ≤ ((p*z*m*n : ℕ) : ℝ) ∧ ((p*z*m*n : ℕ) : ℝ) ≤ 64*Real.exp 2*Y) → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat s (roughBand Alo Blo (Real.exp (Real.sqrt L))) ((Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0)) F (fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p)) (fun n => typeIIPhase σ n*χQ (n : ZMod qQ)) (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n) (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n)) (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hres⟩ := exists_candidate_selected_residual_power_bound hc hq0 hq1 T obtain ⟨Bcoeff,hBcoeff,hsmall⟩ := exists_candidate_small_prime_factor_data hc obtain ⟨_,_,hmain⟩ := exists_rational_shifted_filtered_prime_integral_precision_log_radius (A := A+3*Rmod+1) hZ hc hq0 hq1 hcLog hd haLong T Tmod Sshift Cmod Sfreq Rmod (max W 1+1) refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,hres,hsmall, eventually_rational_candidate_P_properties hc Rmod, eventually_rational_rough_Q_properties Rmod, eventually_rational_prime_M_properties S Rmod (hS₀.trans hS), eventually_rational_normalized_full_box_precision (E := C+B+1) (by norm_num : (0 : ℝ) < 1) hcLog (A+3*Rmod), eventually_harmonic_mellin_frequency_bound W 1, eventually_ge_atTop (max 1 Bcoeff)] with L hdecay hresL hsmallL hP hQ hM hcut hfreq hLbound have hL1 : 1 ≤ L := (le_max_left _ _).trans hLbound have hL : 0 < L := zero_lt_one.trans_le hL1 have hBL : Bcoeff ≤ L := (le_max_right _ _).trans hLbound intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog hgeom qRat hqRat0 hqRat aRat w hw let δ : ℕ → ℂ := fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p) let α : ℕ → ℂ := fun n => typeIIPhase σ n*χQ (n : ZMod qQ) let β : ℕ → ℂ := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n let γ := candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n) have hp := hP g (Finset.mem_union_left _ hg) qRat hqRat0 hqRat have hq := hQ Alo Blo qRat hqRat0 hqRat have hm := hM κM hκM hκmax lo hi qRat hqRat0 hqRat have hFpos : ∀ n ∈ F, 0 < n := by intro n hn have hnR : (0 : ℝ) < n := zero_lt_one.trans_le (hUT.trans (hFband n hn).1) exact_mod_cast hnR have hδ : ∀ p ∈ s, ‖δ p‖ ≤ Bcoeff := by obtain ⟨_,_,_,hcoeff⟩ := hsmallL g hg s P hs hne hsp intro p hp' exact hcoeff (fun n => χP (n : ZMod qP)*typeIIPhase τP n) (fun n _ => character_typeIIPhase_norm_le χP τP n) ⟨p,hp'⟩ have hα : ∀ n, ‖α n‖ ≤ 1 := by intro n simpa only [α,mul_comm] using character_typeIIPhase_norm_le χQ σ n have hβ : ∀ n, ‖β n‖ ≤ 1 := by intro n dsimp only [β] rw [mul_assoc,norm_mul] exact (mul_le_mul (hm.1 n) (character_typeIIPhase_norm_le χM ν n) (norm_nonneg _) zero_le_one).trans_eq (mul_one 1) have hγ : ∀ n, ‖γ n‖ ≤ L^(C+B) := hresL B r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n) ht hb hκ (character_typeIIPhase_norm_le χT τT) have hprod : Bcoeff*1*1*L^(C+B) ≤ L^(C+B+1) := by calc _ ≤ L*L^(C+B) := by simpa only [mul_one] using mul_le_mul_of_nonneg_right hBL (Real.rpow_nonneg hL.le (C+B)) _ = _ := by rw [Real.rpow_add hL (C+B) 1, Real.rpow_one]; ring have hRL : R ≤ L*Y := hRY.trans (le_mul_of_one_le_left (zero_le_one.trans hY) hL1) have hbox := hcut qRat hqRat0 aRat Y hY hYhi s (roughBand Alo Blo (Real.exp (Real.sqrt L))) ((Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0)) F δ α β γ Bcoeff 1 1 (L^(C+B)) (zero_le_one.trans hBcoeff) zero_le_one zero_le_one (Real.rpow_nonneg hL.le _) hprod (fun p hp' => (hp p (hs hp')).1.pos) (fun n hn => (hq n hn).1) (fun n hn => (hm.2 n hn).1) hFpos (fun p hp' => (hp p (hs hp')).2) (fun n hn => (hq n hn).2) (fun n hn => (hm.2 n hn).2) hδ (fun n _ => hα n) (fun n _ => hβ n) (fun n _ => hγ n) hgeom R w hR hRL (by intro dRat hdRat ψ u hu have hw' : |w+2*Real.pi*u| ≤ L^(max W 1+1) := by have hh := hfreq w 0 u hw (by simpa only [abs_zero] using Real.rpow_nonneg hL.le W) (by simpa only [Real.norm_eq_abs] using hu) simpa only [add_zero,abs_neg] using hh have hb' := @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 (Nat.pos_of_mem_divisors hdRat) (Nat.dvd_of_mem_divisors hdRat) hqRat ψ (w+2*Real.pi*u) hw' simpa only [δ,α,β,γ,rational_normalized_phase_twist,rational_phase_left_twist, rational_weighted_phase_twist,candidate_selected_rational_multiplier,add_assoc] using hb') exact hbox.trans (rational_box_cubic_cost hL hqRat) theorem exists_rational_rough_cutoff_integral_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d A aLong γrough vMax ρ : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (haLong : 0 < aLong) (hγ : 0 < γrough) (hv : vMax < 1) (hρ : 0 < ρ) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R : ℝ), s ⊆ candidatePBand (c*L) g → s.Nonempty → 1 ≤ Y → d*L ≤ Real.log Y → Real.log Y ≤ cLog*L → 0 ≤ R → R ≤ Y → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), Real.exp (aLong*L) ≤ UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → R ≤ UQ*UM*UT/2 → Y^(3/5 : ℝ) ≤ UM*UT/2 → Real.log (8*(UQ*UM*UT)) ≤ cLog*L → (∀ p ∈ s, ∀ nQ ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), ∀ nM ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), ∀ nT ∈ F, Y/128 ≤ ((p*nQ*nM*nT : ℕ) : ℝ) ∧ ((p*nQ*nM*nT : ℕ) : ℝ) ≤ 64*Real.exp 2*Y) → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat s (roughBand Alo Blo (Real.exp (Real.sqrt L))) ((Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0)) F (fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p)) (fun n => typeIIPhase σ n*χQ (n : ZMod qQ)) (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n) (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n)) (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) := by obtain ⟨C,hC,hmain⟩ := exists_rational_shifted_filtered_rough_integral_precision_log_radius (A := A+3*Rmod+1) hZ hc hq0 hq1 hcLog hd haLong hγ hv T Tmod Sshift Cmod Sfreq Rmod (max W ρ+1) obtain ⟨Cres,_,hres⟩ := exists_candidate_selected_residual_power_bound hc hq0 hq1 T obtain ⟨vpool,_,hvpool,_,hpool⟩ := exists_candidate_P_pool_bounds hc refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS, eventually_rational_candidate_P_properties hc Rmod, eventually_rational_rough_Q_properties Rmod, eventually_rational_rough_M_properties hγ Rmod, hres, hpool, eventually_ge_atTop (1/vpool), eventually_ge_atTop (1 : ℝ), eventually_harmonic_mellin_frequency_bound W ρ, eventually_rational_normalized_full_box_precision (E := Cres+B+1) hρ hcLog (A+3*Rmod)] with L hdecay hP hQ hM hres hpool hpoolInv hL1 hfreq hcutoff have hL : 0 < L := zero_lt_one.trans_le hL1 intro r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog hgeom qRat hqRat0 hqRat aRat w hw let δ : ℕ → ℂ := fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p) let α : ℕ → ℂ := fun n => typeIIPhase σ n*χQ (n : ZMod qQ) let β : ℕ → ℂ := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n let γ := candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n) have hp := hP g (Finset.mem_union_left _ hg) qRat hqRat0 hqRat have hq := hQ Alo Blo qRat hqRat0 hqRat have hm := hM S aM v lo hi qRat hqRat0 hqRat have hFpos : ∀ n ∈ F, 0 < n := by intro n hn have hnR : (0 : ℝ) < n := zero_lt_one.trans_le (hUT.trans (hFband n hn).1) exact_mod_cast hnR have hδ : ∀ n, ‖δ n‖ ≤ L := by intro n have hvM := (hpool.2.2.2.2.2 g (Finset.mem_union_left _ hg)).1 have hmass : 0 < ∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ) := hvpool.trans_le hvM calc ‖δ n‖ ≤ ‖(1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))‖*1 := by dsimp only [δ] rw [norm_mul] exact mul_le_mul_of_nonneg_left (character_typeIIPhase_norm_le χP τP n) (norm_nonneg _) _ = 1/(∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) := by simp only [norm_div,norm_one,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hmass,mul_one] _ ≤ 1/vpool := one_div_le_one_div_of_le hvpool hvM _ ≤ L := hpoolInv have hα : ∀ n, ‖α n‖ ≤ 1 := by intro n simpa only [α,norm_mul,typeIIPhase_norm,one_mul] using χQ.norm_le_one (n : ZMod qQ) have hβ : ∀ n, ‖β n‖ ≤ 1 := by intro n simpa only [β,norm_mul,typeIIPhase_norm,mul_one,one_mul] using mul_le_mul (hm.1 n) (χM.norm_le_one (n : ZMod qM)) (norm_nonneg _) zero_le_one have hγcap : ∀ n, ‖γ n‖ ≤ L^(Cres+B) := hres B r jStar hr hj take hkeep ξ tmarks umarks big b κ _ ht hb hκ (fun n => character_typeIIPhase_norm_le χT τT n) have hcap : L*1*1*L^(Cres+B) ≤ L^(Cres+B+1) := by rw [mul_one,mul_one,Real.rpow_add hL (Cres+B) 1,Real.rpow_one] exact le_of_eq (mul_comm _ _) have hbox := hcutoff qRat hqRat0 aRat Y hY hYhi s (roughBand Alo Blo (Real.exp (Real.sqrt L))) ((Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0)) F δ α β γ L 1 1 (L^(Cres+B)) hL.le zero_le_one zero_le_one (Real.rpow_nonneg hL.le _) hcap (fun p hp' => (hp p (hs hp')).1.pos) (fun n hn => (hq n hn).1) (fun n hn => (hm.2 n hn).1) hFpos (fun p hp' => (hp p (hs hp')).2) (fun n hn => (hq n hn).2) (fun n hn => (hm.2 n hn).2) (fun n _ => hδ n) (fun n _ => hα n) (fun n _ => hβ n) (fun n _ => hγcap n) hgeom R w hR (hRY.trans (le_mul_of_one_le_left (zero_le_one.trans hY) hL1)) (by intro dRat hdRat ψ u hu have hshift : |w+2*Real.pi*u| ≤ L^(max W ρ+1) := by have hf := hfreq w 0 u hw (by simpa using Real.rpow_nonneg hL.le W) (by simpa only [Real.norm_eq_abs] using hu) simpa only [add_zero,abs_neg] using hf have henergy := @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs hne hY hYlo hYhi hR hRY hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hqQ hσ hmeanScale hresScale hlog qRat dRat hqRat0 (Nat.pos_of_mem_divisors hdRat) (Nat.dvd_of_mem_divisors hdRat) hqRat ψ (w+2*Real.pi*u) hshift simpa only [δ,α,β,γ,rational_normalized_phase_twist,rational_phase_left_twist, rational_weighted_phase_twist,candidate_selected_rational_multiplier,add_assoc] using henergy) exact hbox.trans (rational_box_cubic_cost hL hqRat) end Bounty.WeakZeroFree end section -- Source module: ActualAnalyticExports /- Actual zero-free specializations of the full-memory and mixed norm estimates. -/ open Finset Filter open scoped Topology BigOperators Classical namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree end section -- Source module: WeakActualLocalEnergy /- Actual source and cell estimates using the verified weaker zero-free theorem. -/ open scoped Topology BigOperators Classical -- Source module: CandidateRetainedBoxScales /- The actual small-prime and rough factors supply the retained common-window scales. The local width is an explicit upstream input; no desired integral scale is assumed. -/ open Finset Filter namespace Bounty theorem eventually_common_cell_exponential_lower {b : ℝ} (hb : 0 < b) : ∀ᶠ L : ℝ in atTop, ∀ Z H d : ℝ, 0 < Z → d ≤ Real.exp 2*H → Real.exp (b*L) ≤ Z*d/2 → Real.exp ((b/2)*L) ≤ Z*H := by filter_upwards [eventually_ge_atTop (4/b)] with L hL intro Z H d hZ hcell hlower have hgap := (div_le_iff₀ hb).mp hL have he : Real.exp 2*Real.exp ((b/2)*L) ≤ Real.exp (b*L) := by rw [← Real.exp_add] apply Real.exp_le_exp.mpr nlinarith only [hgap] have hm := mul_le_mul_of_nonneg_left hcell hZ.le have hh : Real.exp 2*Real.exp ((b/2)*L) ≤ Real.exp 2*(Z*H) := by nlinarith only [he,hlower,hm,Real.exp_pos (b*L)] exact (mul_le_mul_iff_right₀ (Real.exp_pos 2)).mp hh theorem exists_actual_retained_box_scales {c b cLog : ℝ} (hc : 0 < c) (hb : 0 < b) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∃ aLong : ℝ, 0 < aLong ∧ ∀ᶠ L : ℝ in atTop, ∀ g ∈ candidateSmallPIndices c L, ∀ Y P UQ UM UT Hlocal R : ℝ, Real.exp (b*L) ≤ Y → Real.log Y ≤ cLog*L → 0 < UQ → 0 < UM → 0 < UT → 0 < Hlocal → 4096*P*L ≤ Hlocal → R ≤ 2*L*Y/Hlocal → ∀ p q m t : ℕ, p ∈ candidatePBand (c*L) g → q ∈ candidateRoughBand c L jStar → P ≤ (p : ℝ) → (p : ℝ) ≤ 2*P → UQ < (q : ℝ) → (q : ℝ) ≤ 2*UQ → UM ≤ (m : ℝ) → (m : ℝ) ≤ 2*UM → UT ≤ (t : ℝ) → (t : ℝ) ≤ 2*UT → p*q*m*t ∈ (harmonicCommonSupport Y).image Int.natAbs → 1 ≤ P ∧ Real.exp (aLong*L) ≤ UQ ∧ R ≤ Y ∧ R ≤ UQ*UM*UT/2 ∧ Y^(3/5 : ℝ) ≤ UM*UT/2 ∧ Real.log (8*(UQ*UM*UT)) ≤ (cLog+1)*L := by obtain ⟨J,hJ⟩ := exists_candidate_long_rough_dyadic_window hc (show 0 < b/5 by positivity) refine ⟨J,?_⟩ intro jStar hj obtain ⟨aLong,haLong,hrough⟩ := hJ jStar hj obtain ⟨Bcoeff,hBcoeff,hsmall⟩ := exists_candidate_small_prime_factor_data hc refine ⟨aLong,haLong,?_⟩ filter_upwards [hrough,hsmall, eventually_four_factor_residual_scale (beta := (1/5 : ℝ)) (d := b) (eta := b/5) (C := 256) (by norm_num) hb (by linarith) (by norm_num), eventually_ge_atTop (Real.log 32+2),eventually_ge_atTop (1 : ℝ)] with L hroughL hsmallL hresidual hlogconst hL intro g hg Y P UQ UM UT Hlocal R hYlo hYlog hQ hM hT hH hwidth hR p q m t hp hq hpLo hpHi hqLo hqHi hmLo hmHi htLo htHi hprod have hL0 : 0 < L := zero_lt_one.trans_le hL have hY : 0 < Y := (Real.exp_pos _).trans_le hYlo have hYlower : b*L ≤ Real.log Y := (Real.le_log_iff_exp_le hY).mpr hYlo have hs : ({p} : Finset ℕ) ⊆ candidatePBand (c*L) g := by simpa only [singleton_subset_iff] have hsp : ∀ n ∈ ({p} : Finset ℕ), P ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*P := by intro n hn have he : n = p := mem_singleton.mp hn simpa only [he] using And.intro hpLo hpHi obtain ⟨_,hPlower,hPupper,_⟩ := hsmallL g hg {p} P hs (singleton_nonempty p) hsp have hP1 : 1 ≤ P := by have hpow : 1 ≤ L^(1/10 : ℝ) := Real.one_le_rpow hL (by norm_num) have he := Real.add_one_le_exp (L^(1/10 : ℝ)) linarith have hP : 0 < P := zero_lt_one.trans_le hP1 have hQne : ((candidateRoughBand c L jStar).filter (fun n : ℕ => UQ < (n : ℝ) ∧ (n : ℝ) ≤ 2*UQ)).Nonempty := ⟨q,mem_filter.mpr ⟨hq,hqLo,hqHi⟩⟩ obtain ⟨hQlong,hQshort,_⟩ := hroughL UQ hQ hQne have hproduct := (mem_harmonic_common_natural_support hY).mp hprod have hlow : P*UQ*UM*UT ≤ ((p*q*m*t : ℕ) : ℝ) := by push_cast gcongr have hhigh : ((p*q*m*t : ℕ) : ℝ) ≤ 16*(P*UQ*UM*UT) := by push_cast calc _ ≤ (2*P)*(2*UQ)*(2*UM)*(2*UT) := by gcongr _ = _ := by ring have hmean : Y/(256*P) ≤ UQ*UM*UT/2 := by apply (div_le_iff₀ (by positivity : 0 < 256*P)).mpr nlinarith only [hproduct.1.trans hhigh] have hres : Y/(256*P*UQ) ≤ UM*UT/2 := by apply (div_le_iff₀ (by positivity : 0 < 256*P*UQ)).mpr nlinarith only [hproduct.1.trans hhigh] have htime : 2*L*Y/Hlocal ≤ Y/(256*P) := by apply (div_le_div_iff₀ hH (by positivity : 0 < 256*P)).mpr have hw : 512*P*L ≤ Hlocal := by nlinarith only [hwidth, mul_nonneg hP.le hL0.le] nlinarith only [mul_le_mul_of_nonneg_left hw hY.le] have htriple : UQ*UM*UT ≤ 4*Real.exp 2*Y := by have hm : UQ*UM*UT ≤ P*(UQ*UM*UT) := le_mul_of_one_le_left (by positivity) hP1 nlinarith only [hm,hlow,hproduct.2] have hlog : Real.log (8*(UQ*UM*UT)) ≤ (cLog+1)*L := by have hh := Real.log_le_log (by positivity : 0 < 8*(UQ*UM*UT)) (show 8*(UQ*UM*UT) ≤ 32*Real.exp 2*Y by nlinarith only [htriple]) rw [Real.log_mul (by positivity : (32*Real.exp 2 : ℝ) ≠ 0) hY.ne', Real.log_mul (by norm_num : (32 : ℝ) ≠ 0) (Real.exp_ne_zero 2),Real.log_exp] at hh nlinarith only [hh,hYlog,hlogconst] have hRY : R ≤ Y := (hR.trans htime).trans (div_le_self hY.le (show 1 ≤ 256*P by linarith)) exact ⟨hP1,hQlong,hRY,hR.trans (htime.trans hmean), hresidual Y P UQ (UM*UT/2) hY hP hQ hYlower hPupper hQshort hres,hlog⟩ end Bounty -- Source module: ActualRetainedPrimeBoxPrecision /- The original prime cutoff estimate on a retained box, with its integral scales derived from actual factor support. -/ open Finset Filter MeasureTheory namespace Bounty.WeakZeroFree theorem exists_actual_retained_prime_cutoff_integral_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ (A : ℝ) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ), ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R Hlocal : ℝ), s ⊆ candidatePBand (c*L) g → 1 ≤ Y → Real.exp (d*L) ≤ Y → Real.log Y ≤ cLog*L → 0 ≤ R → 0 < Hlocal → 4096*P*L ≤ Hlocal → R ≤ 2*L*Y/Hlocal → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), 0 < UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → roughBand Alo Blo (Real.exp (Real.sqrt L)) ⊆ candidateRoughBand c L jStar → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → (∃ p ∈ s, ∃ z ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), ∃ m ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), ∃ n ∈ F, p*z*m*n ∈ (harmonicCommonSupport Y).image Int.natAbs) → (∀ p ∈ s, ∀ z ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), ∀ m ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0), ∀ n ∈ F, Y/128 ≤ ((p*z*m*n : ℕ) : ℝ) ∧ ((p*z*m*n : ℕ) : ℝ) ≤ 64*Real.exp 2*Y) → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat s (roughBand Alo Blo (Real.exp (Real.sqrt L))) ((Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ) ≠ 0)) F (fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p)) (fun n => typeIIPhase σ n*χQ (n : ZMod qQ)) (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n) (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n)) (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) := by obtain ⟨J,hgeometry⟩ := exists_actual_retained_box_scales hc hd refine ⟨J,?_⟩ intro jStar hjStar A T Tmod Sshift Cmod Sfreq Rmod W obtain ⟨aLong,haLong,hscales⟩ := hgeometry jStar hjStar obtain ⟨C,hC,hmain⟩ := exists_rational_prime_cutoff_integral_precision (cLog := cLog+1) (d := d) (A := A) hZ hc hq0 hq1 (by linarith) hd haLong T Tmod Sshift Cmod Sfreq Rmod W refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,hscales,eventually_gt_atTop (0 : ℝ)] with L hdecay hscale hL intro r hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R Hlocal hs hY hYlo hYhi hR hHlocal hwidth hRwidth hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hQsubset hqQ hσ hwitness hprod qRat hqRat0 hqRat aRat w hw obtain ⟨p,hp,z,hz,m,hm,n,hn,hwindow⟩ := hwitness have hzReal := (mem_roughBand_real_iff (hUQ.le.trans hQA) (hUQ.le.trans (hQA.trans hAB)) z).mp hz have hgeometryL := hscale g hg Y P UQ UM UT Hlocal R hYlo hYhi hUQ hUM (zero_lt_one.trans_le hUT) hHlocal hwidth hRwidth p z m n (hs hp) (hQsubset hz) (hsp p hp).1 (hsp p hp).2 (hQA.trans_lt hzReal.1) (hzReal.2.1.trans hBQ) (hMband m (mem_filter.mp hm).1).1 (hMband m (mem_filter.mp hm).1).2 (hFband n hn).1 (hFband n hn).2 hwindow have hYloglo : d*L ≤ Real.log Y := (Real.le_log_iff_exp_le (zero_lt_one.trans_le hY)).mpr hYlo have hYloghi : Real.log Y ≤ (cLog+1)*L := by nlinarith only [hYhi,hL] exact @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs ⟨p,hp⟩ hY hYloglo hYloghi hR hgeometryL.2.2.1 hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband κM ν qM hqMInst χM hκM hκmax hqM hν UQ Alo Blo σ qQ hqQInst χQ hgeometryL.2.1 hQA hAB hBQ hqQ hσ hgeometryL.2.2.2.1 hgeometryL.2.2.2.2.1 hgeometryL.2.2.2.2.2 hprod qRat hqRat0 hqRat aRat w hw end Bounty.WeakZeroFree -- Source module: ActualRetainedRoughBoxPrecision /- The original rough cutoff estimate on a retained box, with its integral scales derived from actual factor support. -/ open Finset Filter MeasureTheory namespace Bounty.WeakZeroFree theorem exists_actual_retained_rough_cutoff_integral_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d γrough vMax ρ : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (hγ : 0 < γrough) (hv : vMax < 1) (hρ : 0 < ρ) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ (A : ℝ) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ), ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (s : Finset ℕ) (Y P R Hlocal : ℝ), s ⊆ candidatePBand (c*L) g → 1 ≤ Y → Real.exp (d*L) ≤ Y → Real.log Y ≤ cLog*L → 0 ≤ R → 0 < Hlocal → 4096*P*L ≤ Hlocal → R ≤ 2*L*Y/Hlocal → (∀ p ∈ s, P ≤ (p : ℝ) ∧ (p : ℝ) ≤ 2*P) → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ) (F : Finset ℕ) (UM UT : ℝ), 0 < UM → 1 ≤ UT → (∀ n ∈ Ioc lo hi, UM ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UM) → (∀ n ∈ F, UT ≤ (n : ℝ) ∧ (n : ℝ) ≤ 2*UT) → ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (UQ Alo Blo σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), 0 < UQ → UQ ≤ Alo → Alo ≤ Blo → Blo ≤ 2*UQ → roughBand Alo Blo (Real.exp (Real.sqrt L)) ⊆ candidateRoughBand c L jStar → (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → (∃ p ∈ s, ∃ z ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), ∃ m ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), ∃ n ∈ F, p*z*m*n ∈ (harmonicCommonSupport Y).image Int.natAbs) → (∀ p ∈ s, ∀ z ∈ roughBand Alo Blo (Real.exp (Real.sqrt L)), ∀ m ∈ (Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0), ∀ n ∈ F, Y/128 ≤ ((p*z*m*n : ℕ) : ℝ) ∧ ((p*z*m*n : ℕ) : ℝ) ≤ 64*Real.exp 2*Y) → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat s (roughBand Alo Blo (Real.exp (Real.sqrt L))) ((Ioc lo hi).filter (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ) ≠ 0)) F (fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p)) (fun n => typeIIPhase σ n*χQ (n : ZMod qQ)) (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* χM (n : ZMod qM)*typeIIPhase ν n) (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n)) (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) := by obtain ⟨J,hgeometry⟩ := exists_actual_retained_box_scales hc hd refine ⟨J,?_⟩ intro jStar hjStar A T Tmod Sshift Cmod Sfreq Rmod W obtain ⟨aLong,haLong,hscales⟩ := hgeometry jStar hjStar obtain ⟨C,hC,hmain⟩ := exists_rational_rough_cutoff_integral_precision (cLog := cLog+1) (d := d) (A := A) hZ hc hq0 hq1 (by linarith) hd haLong hγ hv hρ T Tmod Sshift Cmod Sfreq Rmod W refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hmain B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,hscales,eventually_gt_atTop (0 : ℝ)] with L hdecay hscale hL intro r hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R Hlocal hs hY hYlo hYhi hR hHlocal hwidth hRwidth hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hUQ hQA hAB hBQ hQsubset hqQ hσ hwitness hprod qRat hqRat0 hqRat aRat w hw obtain ⟨p,hp,z,hz,m,hm,n,hn,hwindow⟩ := hwitness have hzReal := (mem_roughBand_real_iff (hUQ.le.trans hQA) (hUQ.le.trans (hQA.trans hAB)) z).mp hz have hgeometryL := hscale g hg Y P UQ UM UT Hlocal R hYlo hYhi hUQ hUM (zero_lt_one.trans_le hUT) hHlocal hwidth hRwidth p z m n (hs hp) (hQsubset hz) (hsp p hp).1 (hsp p hp).2 (hQA.trans_lt hzReal.1) (hzReal.2.1.trans hBQ) (hMband m (mem_filter.mp hm).1).1 (hMband m (mem_filter.mp hm).1).2 (hFband n hn).1 (hFband n hn).2 hwindow have hYloglo : d*L ≤ Real.log Y := (Real.le_log_iff_exp_le (zero_lt_one.trans_le hY)).mpr hYlo have hYloghi : Real.log Y ≤ (cLog+1)*L := by nlinarith only [hYhi,hL] exact @hdecay r jStar hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg s Y P R hs ⟨p,hp⟩ hY hYloglo hYloghi hR hgeometryL.2.2.1 hsp qP qT χP χT τP τT lo hi F UM UT hUM hUT hMband hFband aM v ν qM hqMInst χM hvM hqM hν UQ Alo Blo σ qQ hqQInst χQ hgeometryL.2.1 hQA hAB hBQ hqQ hσ hgeometryL.2.2.2.1 hgeometryL.2.2.2.2.1 hgeometryL.2.2.2.2.2 hprod qRat hqRat0 hqRat aRat w hw end Bounty.WeakZeroFree -- Source module: FourBoxNonzeroSupport /- Finite four-factor boxes retain their original coefficients when zero coordinates are removed. Nonzero boxes have literal nonzero product witnesses. -/ open Finset namespace Bounty theorem four_box_kernel_sum_nonzero_witness (D A B C : Finset ℕ) (δ α β γ H : ℕ → ℂ) (hne : fourBoxKernelSum D A B C δ α β γ H ≠ 0) : ∃ d ∈ D, ∃ a ∈ A, ∃ b ∈ B, ∃ c ∈ C, δ d ≠ 0 ∧ α a ≠ 0 ∧ β b ≠ 0 ∧ γ c ≠ 0 ∧ H (d*a*b*c) ≠ 0 := by unfold fourBoxKernelSum at hne obtain ⟨d,hd,hdne⟩ := exists_ne_zero_of_sum_ne_zero hne obtain ⟨a,ha,hane⟩ := exists_ne_zero_of_sum_ne_zero hdne obtain ⟨b,hb,hbne⟩ := exists_ne_zero_of_sum_ne_zero hane obtain ⟨c,hc,hcne⟩ := exists_ne_zero_of_sum_ne_zero hbne simp only [mul_ne_zero_iff] at hcne exact ⟨d,hd,a,ha,b,hb,c,hc,hcne.1.1.1.1,hcne.1.1.1.2, hcne.1.1.2,hcne.1.2,hcne.2⟩ theorem four_box_kernel_sum_swap_middle (D A B C : Finset ℕ) (δ α β γ H : ℕ → ℂ) : fourBoxKernelSum D A B C δ α β γ H = fourBoxKernelSum D B A C δ β α γ H := by unfold fourBoxKernelSum apply sum_congr rfl intro d _ rw [sum_comm] apply sum_congr rfl intro b _ apply sum_congr rfl intro a _ apply sum_congr rfl intro c _ have hn : d*a*b*c = d*b*a*c := by ring rw [hn] ring end Bounty -- Source module: ActualCutoffBoxWitness /- Nonzero normalized rational boxes have actual coefficient witnesses in the common window. -/ open Finset namespace Bounty theorem rational_cutoff_box_nonzero_witness {Y : ℝ} (hY : 0 < Y) (r : ℕ) (k : ℤ) (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (t : ℝ) (hne : rationalFourBoxKernelSum r k D A B C δ α β γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase t (n : ℝ)) ≠ 0) : ∃ d ∈ D, ∃ a ∈ A, ∃ b ∈ B, ∃ c ∈ C, δ d ≠ 0 ∧ α a ≠ 0 ∧ β b ≠ 0 ∧ γ c ≠ 0 ∧ d*a*b*c ∈ (harmonicCommonSupport Y).image Int.natAbs := by obtain ⟨d,hd,a,ha,b,hb,c,hc,hδ,hα,hβ,hγ,hH⟩ := four_box_kernel_sum_nonzero_witness D A B C δ α β γ _ hne have hcut : harmonicCommonCutoff (((d*a*b*c : ℕ) : ℝ)/Y) ≠ 0 := by intro hz apply hH simp only [hz,zero_div,Complex.ofReal_zero,zero_mul] have hs := harmonic_common_cutoff_scaled_support hY hcut exact ⟨d,hd,a,ha,b,hb,c,hc,hδ,hα,hβ,hγ, (mem_harmonic_common_natural_support hY).mpr ⟨hs.1.le,hs.2.le⟩⟩ theorem rational_cutoff_box_eq_zero_of_no_supported_product {Y : ℝ} (hY : 0 < Y) (r : ℕ) (k : ℤ) (D A B C : Finset ℕ) (δ α β γ : ℕ → ℂ) (hzero : ¬∃ d ∈ D, ∃ a ∈ A, ∃ b ∈ B, ∃ c ∈ C, δ d ≠ 0 ∧ α a ≠ 0 ∧ β b ≠ 0 ∧ γ c ≠ 0 ∧ d*a*b*c ∈ (harmonicCommonSupport Y).image Int.natAbs) (t : ℝ) : rationalFourBoxKernelSum r k D A B C δ α β γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase t (n : ℝ)) = 0 := by by_contra hne exact hzero (rational_cutoff_box_nonzero_witness hY r k D A B C δ α β γ t hne) end Bounty -- Source module: ActualDyadicFactorSupport /- Exact dyadic clipping of the original rough and Type II factors, retaining the finite cap. -/ open Finset namespace Bounty theorem dyadicNatBucket_Icc_filter_roughBand_eq (N k : ℕ) (A B W : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) : (dyadicNatBucket (Icc 1 N) k).filter (fun n => n ∈ roughBand A B W) = roughBand (max A (originalDyadicBase k)) (min B (min (N : ℝ) (2*originalDyadicBase k))) W := by classical rw [dyadicNatBucket_eq_real_interval (Icc 1 N) (fun n hn => (mem_Icc.mp hn).1)] ext n have hbase := originalDyadicBase_pos k have hupper : 0 ≤ min B (min (N : ℝ) (2*originalDyadicBase k)) := by positivity simp only [mem_filter, mem_Icc, mem_roughBand_real_iff hA hB, mem_roughBand_real_iff (le_max_of_le_left hA) hupper, max_lt_iff, le_min_iff] constructor · rintro ⟨⟨⟨hn1, hnN⟩, hnlo, hnhi⟩, hnA, hnB, hnrough⟩ exact ⟨⟨hnA, hnlo⟩, ⟨hnB, by exact_mod_cast hnN, hnhi⟩, hnrough⟩ · rintro ⟨⟨hnA, hnlo⟩, ⟨hnB, hnN, hnhi⟩, hnrough⟩ have hnpos : 0 < n := by exact_mod_cast (hA.trans_lt hnA) exact ⟨⟨⟨hnpos, by exact_mod_cast hnN⟩, hnlo, hnhi⟩, hnA, hnB, hnrough⟩ theorem typeIIRestrict_dyadicNatBucket_Icc_Ioc (N k lo hi : ℕ) (f : ℕ → ℝ) : typeIIRestrict (dyadicNatBucket (Icc 1 N) k) (typeIIRestrict (Ioc lo hi) f) = typeIIRestrict (Ioc (max lo ((2 : ℕ)^k-1)) (min hi (min N ((2 : ℕ)^(k+1)-1)))) f := by rw [dyadicNatBucket_Icc_eq_Ioc] funext n simp only [typeIIRestrict, mem_Ioc, max_lt_iff, le_min_iff] split_ifs <;> simp_all theorem dyadicNatBucket_Icc_filter_typeIIRestrict_ne_zero (N k lo hi : ℕ) (f : ℕ → ℝ) : (dyadicNatBucket (Icc 1 N) k).filter (fun n => (typeIIRestrict (Ioc lo hi) f n : ℂ) ≠ 0) = (Ioc (max lo ((2 : ℕ)^k-1)) (min hi (min N ((2 : ℕ)^(k+1)-1)))).filter (fun n => (typeIIRestrict (Ioc (max lo ((2 : ℕ)^k-1)) (min hi (min N ((2 : ℕ)^(k+1)-1)))) f n : ℂ) ≠ 0) := by classical rw [dyadicNatBucket_Icc_eq_Ioc] ext n simp only [mem_filter, ne_eq, Complex.ofReal_eq_zero, typeIIRestrict_ne_zero_iff, mem_Ioc, max_lt_iff, le_min_iff] tauto theorem mem_clipped_dyadic_Ioc_real_bounds (N k lo hi n : ℕ) (hn : n ∈ Ioc (max lo ((2 : ℕ)^k-1)) (min hi (min N ((2 : ℕ)^(k+1)-1)))) : originalDyadicBase k < (n : ℝ) ∧ (n : ℝ) ≤ 2*originalDyadicBase k := by have hbucket : n ∈ dyadicNatBucket (Icc 1 N) k := by rw [dyadicNatBucket_Icc_eq_Ioc] simp only [mem_Ioc, max_lt_iff, le_min_iff] at hn ⊢ exact ⟨hn.1.2, hn.2.2⟩ rw [dyadicNatBucket_eq_real_interval (Icc 1 N) (fun m hm => (mem_Icc.mp hm).1)] at hbucket exact (mem_filter.mp hbucket).2 theorem dyadicNatBucket_Icc_roughBand_nonempty_endpoints (N k : ℕ) (A B W : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hne : ((dyadicNatBucket (Icc 1 N) k).filter (fun n => n ∈ roughBand A B W)).Nonempty) : max A (originalDyadicBase k) ≤ min B (min (N : ℝ) (2*originalDyadicBase k)) := by rw [dyadicNatBucket_Icc_filter_roughBand_eq N k A B W hA hB] at hne obtain ⟨n, hn⟩ := hne have hbase := originalDyadicBase_pos k have hupper : 0 ≤ min B (min (N : ℝ) (2*originalDyadicBase k)) := by positivity have hb := (mem_roughBand_real_iff (le_max_of_le_left hA) hupper n).mp hn exact hb.1.le.trans hb.2.1 end Bounty -- Source module: ActualDyadicRationalBox /- Exact support clipping and coordinate reordering for the original rational box. -/ open Finset namespace Bounty theorem actual_dyadic_rational_box_eq (N kP kM kQ kT lo hi r : ℕ) (aRat : ℤ) (Pband : Finset ℕ) (A B W : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (f : ℕ → ℝ) (δ θM θQ γ H : ℕ → ℂ) : rationalFourBoxKernelSum r aRat (dyadicNatBucket (Icc 1 N) kP) (dyadicNatBucket (Icc 1 N) kM) (dyadicNatBucket (Icc 1 N) kQ) (dyadicNatBucket (Icc 1 N) kT) (fun p => if p ∈ Pband then δ p else 0) (fun m => (typeIIRestrict (Ioc lo hi) f m : ℂ)*θM m) (fun q => if q ∈ roughBand A B W then θQ q else 0) γ H = rationalFourBoxKernelSum r aRat ((dyadicNatBucket (Icc 1 N) kP).filter (fun p => p ∈ Pband)) (roughBand (max A (originalDyadicBase kQ)) (min B (min (N : ℝ) (2*originalDyadicBase kQ))) W) ((Ioc (max lo ((2 : ℕ)^kM-1)) (min hi (min N ((2 : ℕ)^(kM+1)-1)))).filter (fun m => (typeIIRestrict (Ioc (max lo ((2 : ℕ)^kM-1)) (min hi (min N ((2 : ℕ)^(kM+1)-1)))) f m : ℂ) ≠ 0)) (dyadicNatBucket (Icc 1 N) kT) δ θQ (fun m => (typeIIRestrict (Ioc (max lo ((2 : ℕ)^kM-1)) (min hi (min N ((2 : ℕ)^(kM+1)-1)))) f m : ℂ)*θM m) γ H := by classical have hM (m : ℕ) (hm : m ∈ dyadicNatBucket (Icc 1 N) kM) : typeIIRestrict (Ioc (max lo ((2 : ℕ)^kM-1)) (min hi (min N ((2 : ℕ)^(kM+1)-1)))) f m = typeIIRestrict (Ioc lo hi) f m := by have h := congrFun (typeIIRestrict_dyadicNatBucket_Icc_Ioc N kM lo hi f) m simpa only [typeIIRestrict, if_pos hm] using h.symm unfold rationalFourBoxKernelSum rw [four_box_kernel_sum_swap_middle] rw [← dyadicNatBucket_Icc_filter_roughBand_eq N kQ A B W hA hB, ← dyadicNatBucket_Icc_filter_typeIIRestrict_ne_zero N kM lo hi f] simp only [fourBoxKernelSum, sum_filter] apply sum_congr rfl intro p hp by_cases hpP : p ∈ Pband · simp only [hpP, if_true] apply sum_congr rfl intro q hq by_cases hqQ : q ∈ roughBand A B W · simp only [hqQ, if_true] apply sum_congr rfl intro m hm rw [hM m hm] by_cases hm0 : (typeIIRestrict (Ioc lo hi) f m : ℂ) = 0 · simp only [hm0, ne_eq, not_true_eq_false, if_false, zero_mul, mul_zero, sum_const_zero] · simp only [hm0, ne_eq, not_false_eq_true, if_true] · simp only [hqQ, if_false, mul_zero, zero_mul, sum_const_zero] · simp only [hpP, if_false, zero_mul, sum_const_zero] end Bounty -- Source module: ActualDyadicPrimeBoxPrecision /- The original masked dyadic prime box has arbitrary precision after the actual common-cell width is imposed; its support and integral scales are derived. -/ open Finset Filter MeasureTheory namespace Bounty.WeakZeroFree theorem exists_actual_dyadic_prime_cutoff_integral_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ (A : ℝ) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ), ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (N kP kM kQ kT : ℕ) (Y R Hlocal : ℝ), 1 ≤ Y → Real.exp (d*L) ≤ Y → Real.log Y ≤ cLog*L → 0 ≤ R → 0 < Hlocal → 4096*Real.exp (L^(1/5 : ℝ))*L ≤ Hlocal → R ≤ 2*L*Y/Hlocal → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ), ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat (dyadicNatBucket (Icc 1 N) kP) (dyadicNatBucket (Icc 1 N) kM) (dyadicNatBucket (Icc 1 N) kQ) (dyadicNatBucket (Icc 1 N) kT) (fun p => if p ∈ candidatePBand (c*L) g then (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p) else 0) (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n)) (fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0) (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n)) (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) := by classical obtain ⟨J,hmain⟩ := exists_actual_retained_prime_cutoff_integral_precision hZ hc hq0 hq1 hcLog hd obtain ⟨Bcoeff,hBcoeff,hsmall⟩ := exists_candidate_small_prime_factor_data hc refine ⟨J,?_⟩ intro jStar hjStar A T Tmod Sshift Cmod Sfreq Rmod W obtain ⟨C,hC,hprecision⟩ := hmain jStar hjStar A T Tmod Sshift Cmod Sfreq Rmod W refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hprecision B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,hsmall,eventually_gt_atTop (0 : ℝ)] with L hdecay hsmallL hL intro r hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg N kP kM kQ kT Y R Hlocal hY hYlo hYhi hR hHlocal hwidth hRwidth qP qT χP χT τP τT lo hi κM ν qM hqMInst χM hκM hκmax hqM hν σ qQ hqQInst χQ hqQ hσ qRat hqRat0 hqRat aRat w hw let PP := dyadicNatBucket (Icc 1 N) kP let QQ := dyadicNatBucket (Icc 1 N) kQ let MM := dyadicNatBucket (Icc 1 N) kM let TT := dyadicNatBucket (Icc 1 N) kT let a0 := Real.exp (c*L/2^jStar) let b0 := Real.exp ((6/5 : ℝ)*c*L/2^jStar) let qlo := max a0 (originalDyadicBase kQ) let qhi := min b0 (min (N : ℝ) (2*originalDyadicBase kQ)) let ml := max lo ((2 : ℕ)^kM-1) let mh := min hi (min N ((2 : ℕ)^(kM+1)-1)) let f := ambientPrimeTypeIIAlpha κM L S let ps := PP.filter (fun p => p ∈ candidatePBand (c*L) g) let qs := roughBand qlo qhi (Real.exp (Real.sqrt L)) let ms := (Ioc ml mh).filter (fun n => (typeIIRestrict (Ioc ml mh) f n : ℂ) ≠ 0) let δ : ℕ → ℂ := fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p) let α : ℕ → ℂ := fun n => typeIIPhase σ n*χQ (n : ZMod qQ) let β : ℕ → ℂ := fun n => (typeIIRestrict (Ioc ml mh) f n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n) let γ := candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n) have heq (u : ℝ) := actual_dyadic_rational_box_eq N kP kM kQ kT lo hi qRat aRat (candidatePBand (c*L) g) a0 b0 (Real.exp (Real.sqrt L)) (Real.exp_pos _).le (Real.exp_pos _).le f δ (fun n => χM (n : ZMod qM)*typeIIPhase ν n) α γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ)) change (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat PP MM QQ TT (fun p => if p ∈ candidatePBand (c*L) g then δ p else 0) (fun n => (typeIIRestrict (Ioc lo hi) f n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n)) (fun n => if n ∈ roughBand a0 b0 (Real.exp (Real.sqrt L)) then α n else 0) γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) suffices hgoal : (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat ps qs ms TT δ α β γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) by calc _ = (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat ps qs ms TT δ α β γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) := by apply integral_congr_ae exact Filter.Eventually.of_forall (fun u => congrArg (fun z : ℂ => ‖z‖^2) (heq u)) _ ≤ _ := hgoal by_cases hex : ∃ p ∈ ps, ∃ z ∈ qs, ∃ m ∈ ms, ∃ n ∈ TT, δ p ≠ 0 ∧ α z ≠ 0 ∧ β m ≠ 0 ∧ γ n ≠ 0 ∧ p*z*m*n ∈ (harmonicCommonSupport Y).image Int.natAbs · obtain ⟨p,hp,z,hz,m,hm,n,hn,_,_,_,_,hwindow⟩ := hex have hqs : qs = QQ.filter (fun n => n ∈ candidateRoughBand c L jStar) := by exact (dyadicNatBucket_Icc_filter_roughBand_eq N kQ a0 b0 (Real.exp (Real.sqrt L)) (Real.exp_pos _).le (Real.exp_pos _).le).symm have hms : ms = MM.filter (fun n => (typeIIRestrict (Ioc lo hi) f n : ℂ) ≠ 0) := (dyadicNatBucket_Icc_filter_typeIIRestrict_ne_zero N kM lo hi f).symm have hpband : ps ⊆ candidatePBand (c*L) g := fun x hx => (mem_filter.mp hx).2 have hpP : ps ⊆ PP := filter_subset _ _ have hQbucket : qs ⊆ QQ := by rw [hqs]; exact filter_subset _ _ have hmM : ms ⊆ MM := by rw [hms]; exact filter_subset _ _ have hqband : qs ⊆ candidateRoughBand c L jStar := by intro x hx exact (mem_filter.mp (hqs ▸ hx)).2 have hsp : ∀ x ∈ ps, originalDyadicBase kP ≤ (x : ℝ) ∧ (x : ℝ) ≤ 2*originalDyadicBase kP := by intro x hx have hx' := hpP hx change x ∈ dyadicNatBucket (Icc 1 N) kP at hx' rw [dyadicNatBucket_eq_real_interval (Icc 1 N) (fun n hn => (mem_Icc.mp hn).1)] at hx' exact ⟨(mem_filter.mp hx').2.1.le,(mem_filter.mp hx').2.2⟩ have hMband : ∀ x ∈ Ioc ml mh, originalDyadicBase kM ≤ (x : ℝ) ∧ (x : ℝ) ≤ 2*originalDyadicBase kM := by intro x hx have h := mem_clipped_dyadic_Ioc_real_bounds N kM lo hi x hx exact ⟨h.1.le,h.2⟩ have hTband : ∀ x ∈ TT, (2 : ℝ)^kT ≤ (x : ℝ) ∧ (x : ℝ) ≤ 2*(2 : ℝ)^kT := by intro x hx obtain ⟨hl,hu⟩ := dyadicNatBucket_bounds (Icc 1 N) (fun n hn => (mem_Icc.mp hn).1) hx constructor · exact_mod_cast hl · have hu' : (x : ℝ) ≤ (2 : ℝ)^(kT+1) := by exact_mod_cast hu.le simpa only [pow_succ,mul_comm] using hu' have hQorder : qlo ≤ qhi := dyadicNatBucket_Icc_roughBand_nonempty_endpoints N kQ a0 b0 (Real.exp (Real.sqrt L)) (Real.exp_pos _).le (Real.exp_pos _).le ⟨z,by change z ∈ QQ.filter (fun n => n ∈ candidateRoughBand c L jStar); rw [← hqs]; exact hz⟩ have hPupper := (hsmallL g hg ps (originalDyadicBase kP) hpband ⟨p,hp⟩ hsp).2.2.1 have hwidthP : 4096*originalDyadicBase kP*L ≤ Hlocal := (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hPupper (by norm_num)) hL.le).trans hwidth have hretained : retainedFourDyadicBox ((harmonicCommonSupport Y).image Int.natAbs) N kP kQ kM kT := ⟨p,hpP hp,z,hQbucket hz,m,hmM hm,n,hn,hwindow⟩ have hprod : ∀ p ∈ ps, ∀ z ∈ qs, ∀ m ∈ ms, ∀ n ∈ TT, Y/128 ≤ ((p*z*m*n : ℕ) : ℝ) ∧ ((p*z*m*n : ℕ) : ℝ) ≤ 64*Real.exp 2*Y := by intro p hp z hz m hm n hn exact retained_harmonic_four_dyadic_product_bounds (zero_lt_one.trans_le hY) hretained (hpP hp) (hQbucket hz) (hmM hm) hn have hresult := @hdecay r hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg ps Y (originalDyadicBase kP) R Hlocal hpband hY hYlo hYhi hR hHlocal hwidthP hRwidth hsp qP qT χP χT τP τT ml mh TT (originalDyadicBase kM) ((2 : ℝ)^kT) (originalDyadicBase_pos kM) (one_le_pow₀ (by norm_num)) hMband hTband κM ν qM hqMInst χM hκM hκmax hqM hν (originalDyadicBase kQ) qlo qhi σ qQ hqQInst χQ (originalDyadicBase_pos kQ) (le_max_right _ _) hQorder (min_le_of_right_le (min_le_right _ _)) hqband hqQ hσ ⟨p,hp,z,hz,m,hm,n,hn,hwindow⟩ hprod qRat hqRat0 hqRat aRat w hw simpa only [ps,qs,ms,TT,δ,α,β,γ,f,mul_assoc] using hresult · have hz (u : ℝ) := rational_cutoff_box_eq_zero_of_no_supported_product (zero_lt_one.trans_le hY) qRat aRat ps qs ms TT δ α β γ hex (u+w) simp_rw [hz] simpa only [norm_zero,zero_pow (by decide : (2 : ℕ) ≠ 0),integral_zero] using (Real.rpow_nonneg hL.le (-A)) end Bounty.WeakZeroFree -- Source module: ActualDyadicRoughBoxPrecision /- The original masked dyadic rough box has arbitrary precision after the actual common-cell width is imposed; its support and integral scales are derived. -/ open Finset Filter MeasureTheory namespace Bounty.WeakZeroFree theorem exists_actual_dyadic_rough_cutoff_integral_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q cLog d γrough vMax ρ : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hcLog : 0 ≤ cLog) (hd : 0 < d) (hγ : 0 < γrough) (hv : vMax < 1) (hρ : 0 < ρ) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ (A : ℝ) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ), ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (N kP kM kQ kT : ℕ) (Y R Hlocal : ℝ), 1 ≤ Y → Real.exp (d*L) ≤ Y → Real.log Y ≤ cLog*L → 0 ≤ R → 0 < Hlocal → 4096*Real.exp (L^(1/5 : ℝ))*L ≤ Hlocal → R ≤ 2*L*Y/Hlocal → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ), ∀ (aM v ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), v ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, ∀ w : ℝ, |w| ≤ L^W → (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat (dyadicNatBucket (Icc 1 N) kP) (dyadicNatBucket (Icc 1 N) kM) (dyadicNatBucket (Icc 1 N) kQ) (dyadicNatBucket (Icc 1 N) kT) (fun p => if p ∈ candidatePBand (c*L) g then (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p) else 0) (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM v) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n)) (fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0) (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n)) (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) := by classical obtain ⟨J,hmain⟩ := exists_actual_retained_rough_cutoff_integral_precision hZ hc hq0 hq1 hcLog hd hγ hv hρ obtain ⟨Bcoeff,hBcoeff,hsmall⟩ := exists_candidate_small_prime_factor_data hc refine ⟨J,?_⟩ intro jStar hjStar A T Tmod Sshift Cmod Sfreq Rmod W obtain ⟨C,hC,hprecision⟩ := hmain jStar hjStar A T Tmod Sshift Cmod Sfreq Rmod W refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hprecision B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,hsmall,eventually_gt_atTop (0 : ℝ)] with L hdecay hsmallL hL intro r hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg N kP kM kQ kT Y R Hlocal hY hYlo hYhi hR hHlocal hwidth hRwidth qP qT χP χT τP τT lo hi aM v ν qM hqMInst χM hvM hqM hν σ qQ hqQInst χQ hqQ hσ qRat hqRat0 hqRat aRat w hw let PP := dyadicNatBucket (Icc 1 N) kP let QQ := dyadicNatBucket (Icc 1 N) kQ let MM := dyadicNatBucket (Icc 1 N) kM let TT := dyadicNatBucket (Icc 1 N) kT let a0 := Real.exp (c*L/2^jStar) let b0 := Real.exp ((6/5 : ℝ)*c*L/2^jStar) let qlo := max a0 (originalDyadicBase kQ) let qhi := min b0 (min (N : ℝ) (2*originalDyadicBase kQ)) let ml := max lo ((2 : ℕ)^kM-1) let mh := min hi (min N ((2 : ℕ)^(kM+1)-1)) let f := ambientRoughIntervalTypeIIAlpha γrough L S aM v let ps := PP.filter (fun p => p ∈ candidatePBand (c*L) g) let qs := roughBand qlo qhi (Real.exp (Real.sqrt L)) let ms := (Ioc ml mh).filter (fun n => (typeIIRestrict (Ioc ml mh) f n : ℂ) ≠ 0) let δ : ℕ → ℂ := fun p => (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p) let α : ℕ → ℂ := fun n => typeIIPhase σ n*χQ (n : ZMod qQ) let β : ℕ → ℂ := fun n => (typeIIRestrict (Ioc ml mh) f n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n) let γ := candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n) have heq (u : ℝ) := actual_dyadic_rational_box_eq N kP kM kQ kT lo hi qRat aRat (candidatePBand (c*L) g) a0 b0 (Real.exp (Real.sqrt L)) (Real.exp_pos _).le (Real.exp_pos _).le f δ (fun n => χM (n : ZMod qM)*typeIIPhase ν n) α γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ)) change (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat PP MM QQ TT (fun p => if p ∈ candidatePBand (c*L) g then δ p else 0) (fun n => (typeIIRestrict (Ioc lo hi) f n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n)) (fun n => if n ∈ roughBand a0 b0 (Real.exp (Real.sqrt L)) then α n else 0) γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) suffices hgoal : (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat ps qs ms TT δ α β γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) ≤ L^(-A) by calc _ = (∫ u in Set.Icc (-R) R, ‖rationalFourBoxKernelSum qRat aRat ps qs ms TT δ α β γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (u+w) (n : ℝ))‖^2) := by apply integral_congr_ae exact Filter.Eventually.of_forall (fun u => congrArg (fun z : ℂ => ‖z‖^2) (heq u)) _ ≤ _ := hgoal by_cases hex : ∃ p ∈ ps, ∃ z ∈ qs, ∃ m ∈ ms, ∃ n ∈ TT, δ p ≠ 0 ∧ α z ≠ 0 ∧ β m ≠ 0 ∧ γ n ≠ 0 ∧ p*z*m*n ∈ (harmonicCommonSupport Y).image Int.natAbs · obtain ⟨p,hp,z,hz,m,hm,n,hn,_,_,_,_,hwindow⟩ := hex have hqs : qs = QQ.filter (fun n => n ∈ candidateRoughBand c L jStar) := by exact (dyadicNatBucket_Icc_filter_roughBand_eq N kQ a0 b0 (Real.exp (Real.sqrt L)) (Real.exp_pos _).le (Real.exp_pos _).le).symm have hms : ms = MM.filter (fun n => (typeIIRestrict (Ioc lo hi) f n : ℂ) ≠ 0) := (dyadicNatBucket_Icc_filter_typeIIRestrict_ne_zero N kM lo hi f).symm have hpband : ps ⊆ candidatePBand (c*L) g := fun x hx => (mem_filter.mp hx).2 have hpP : ps ⊆ PP := filter_subset _ _ have hQbucket : qs ⊆ QQ := by rw [hqs]; exact filter_subset _ _ have hmM : ms ⊆ MM := by rw [hms]; exact filter_subset _ _ have hqband : qs ⊆ candidateRoughBand c L jStar := by intro x hx exact (mem_filter.mp (hqs ▸ hx)).2 have hsp : ∀ x ∈ ps, originalDyadicBase kP ≤ (x : ℝ) ∧ (x : ℝ) ≤ 2*originalDyadicBase kP := by intro x hx have hx' := hpP hx change x ∈ dyadicNatBucket (Icc 1 N) kP at hx' rw [dyadicNatBucket_eq_real_interval (Icc 1 N) (fun n hn => (mem_Icc.mp hn).1)] at hx' exact ⟨(mem_filter.mp hx').2.1.le,(mem_filter.mp hx').2.2⟩ have hMband : ∀ x ∈ Ioc ml mh, originalDyadicBase kM ≤ (x : ℝ) ∧ (x : ℝ) ≤ 2*originalDyadicBase kM := by intro x hx have h := mem_clipped_dyadic_Ioc_real_bounds N kM lo hi x hx exact ⟨h.1.le,h.2⟩ have hTband : ∀ x ∈ TT, (2 : ℝ)^kT ≤ (x : ℝ) ∧ (x : ℝ) ≤ 2*(2 : ℝ)^kT := by intro x hx obtain ⟨hl,hu⟩ := dyadicNatBucket_bounds (Icc 1 N) (fun n hn => (mem_Icc.mp hn).1) hx constructor · exact_mod_cast hl · have hu' : (x : ℝ) ≤ (2 : ℝ)^(kT+1) := by exact_mod_cast hu.le simpa only [pow_succ,mul_comm] using hu' have hQorder : qlo ≤ qhi := dyadicNatBucket_Icc_roughBand_nonempty_endpoints N kQ a0 b0 (Real.exp (Real.sqrt L)) (Real.exp_pos _).le (Real.exp_pos _).le ⟨z,by change z ∈ QQ.filter (fun n => n ∈ candidateRoughBand c L jStar); rw [← hqs]; exact hz⟩ have hPupper := (hsmallL g hg ps (originalDyadicBase kP) hpband ⟨p,hp⟩ hsp).2.2.1 have hwidthP : 4096*originalDyadicBase kP*L ≤ Hlocal := (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hPupper (by norm_num)) hL.le).trans hwidth have hretained : retainedFourDyadicBox ((harmonicCommonSupport Y).image Int.natAbs) N kP kQ kM kT := ⟨p,hpP hp,z,hQbucket hz,m,hmM hm,n,hn,hwindow⟩ have hprod : ∀ p ∈ ps, ∀ z ∈ qs, ∀ m ∈ ms, ∀ n ∈ TT, Y/128 ≤ ((p*z*m*n : ℕ) : ℝ) ∧ ((p*z*m*n : ℕ) : ℝ) ≤ 64*Real.exp 2*Y := by intro p hp z hz m hm n hn exact retained_harmonic_four_dyadic_product_bounds (zero_lt_one.trans_le hY) hretained (hpP hp) (hQbucket hz) (hmM hm) hn have hresult := @hdecay r hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg ps Y (originalDyadicBase kP) R Hlocal hpband hY hYlo hYhi hR hHlocal hwidthP hRwidth hsp qP qT χP χT τP τT ml mh TT (originalDyadicBase kM) ((2 : ℝ)^kT) (originalDyadicBase_pos kM) (one_le_pow₀ (by norm_num)) hMband hTband aM v ν qM hqMInst χM hvM hqM hν (originalDyadicBase kQ) qlo qhi σ qQ hqQInst χQ (originalDyadicBase_pos kQ) (le_max_right _ _) hQorder (min_le_of_right_le (min_le_right _ _)) hqband hqQ hσ ⟨p,hp,z,hz,m,hm,n,hn,hwindow⟩ hprod qRat hqRat0 hqRat aRat w hw simpa only [ps,qs,ms,TT,δ,α,β,γ,f,mul_assoc] using hresult · have hz (u : ℝ) := rational_cutoff_box_eq_zero_of_no_supported_product (zero_lt_one.trans_le hY) qRat aRat ps qs ms TT δ α β γ hex (u+w) simp_rw [hz] simpa only [norm_zero,zero_pow (by decide : (2 : ℕ) ≠ 0),integral_zero] using (Real.rpow_nonneg hL.le (-A)) end Bounty.WeakZeroFree -- Source module: ActualSourceBoxBridge /- Exact rational-center identification and compact-interval integrability for full dyadic boxes in the common harmonic source. The Fourier sign is positive. -/ open Finset MeasureTheory namespace Bounty theorem common_source_four_dyadic_box_eq_rational (N : ℕ) (δ α β γ : ℕ → ℂ) (Y a v : ℝ) (aRat : ℤ) (qRat : ℕ) (t : ℝ) (i j k l : ℕ) : fourDyadicBoxSum N δ α β γ (commonSourceBoxKernel Y a v ((aRat : ℝ)/qRat) t) i j k l = rationalFourBoxKernelSum qRat aRat (dyadicNatBucket (Icc 1 N) i) (dyadicNatBucket (Icc 1 N) j) (dyadicNatBucket (Icc 1 N) k) (dyadicNatBucket (Icc 1 N) l) δ α β γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (t+(-(a+v))) (n : ℝ)) := by have ht : t-a-v = t+(-(a+v)) := by ring simp only [fourDyadicBoxSum,commonSourceBoxKernel,rationalFourBoxKernelSum, fourBoxKernelSum,Complex.ofReal_div,Complex.ofReal_natCast,ht,mul_assoc] theorem continuous_common_source_four_dyadic_box (N : ℕ) (δ α β γ : ℕ → ℂ) (Y a v center : ℝ) (i j k l : ℕ) : Continuous (fun t => fourDyadicBoxSum N δ α β γ (commonSourceBoxKernel Y a v center t) i j k l) := by unfold fourDyadicBoxSum commonSourceBoxKernel physicalMellinPhase fun_prop theorem common_source_four_dyadic_box_integrable_norm_sq (N : ℕ) (δ α β γ : ℕ → ℂ) (Y a v center R : ℝ) (i j k l : ℕ) : Integrable (fun t => ‖fourDyadicBoxSum N δ α β γ (commonSourceBoxKernel Y a v center t) i j k l‖^2) (volume.restrict {t : ℝ | |t| ≤ R}) := by have hset : {t : ℝ | |t| ≤ R} = Set.Icc (-R) R := by ext t exact (abs_le : |t| ≤ R ↔ -R ≤ t ∧ t ≤ R) rw [hset] exact ((continuous_common_source_four_dyadic_box N δ α β γ Y a v center i j k l).norm.pow 2).integrableOn_Icc end Bounty -- Source module: ActualPrimeSourceFourier /- Rational-centered Fourier decay for the original prime source, with explicit source energy and exact convolution identification retained as inputs. -/ open Finset Filter MeasureTheory namespace Bounty.WeakZeroFree theorem exists_actual_prime_source_fourier_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q d : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hd : 0 < d) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ (A E : ℝ) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ), ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (Y H Z a v : ℝ) (F : ℤ → ℂ), Real.exp (d*L) ≤ Y → Real.log Y ≤ 6*L → 4096*Real.exp (L^(1/5 : ℝ))*L ≤ H → H ≤ Real.exp ((d/2)*L) → 0 < Z → |a| ≤ L^W → |v| ≤ L^W → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ), ∀ (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, let δ : ℕ → ℂ := fun p => if p ∈ candidatePBand (c*L) g then (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p) else 0 let α : ℕ → ℂ := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n) let β : ℕ → ℂ := fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0 let γ := candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n) (∀ n ∈ (harmonicCommonSupport Y).image Int.natAbs, F n = endpointFourConvolution δ α β γ n) → (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖^2) ≤ Y*L^E → (∫ x in Set.Icc ((aRat : ℝ)/qRat-1/H) ((aRat : ℝ)/qRat+1/H), ‖finiteFourierSum (harmonicCommonSupport Y) (harmonicCellSource Y Z a v F) x‖^2) ≤ Y*L^(-A) := by obtain ⟨J,hmain⟩ := exists_actual_dyadic_prime_cutoff_integral_precision (cLog := 6) hZ hc hq0 hq1 (by norm_num) hd refine ⟨J,?_⟩ intro jStar hjStar A E T Tmod Sshift Cmod Sfreq Rmod W obtain ⟨D,hD,hfourier⟩ := eventually_common_source_fourier_of_boxes hd A E obtain ⟨C,hC,hprecision⟩ := hmain jStar hjStar D T Tmod Sshift Cmod Sfreq Rmod (W+1) refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hprecision B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,hfourier,eventually_ge_atTop (2 : ℝ)] with L hdecay hsource hL intro r hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg Y H Z a v F hYlo hYhi hwidth hHupper hZpos ha hv qP qT χP χT τP τT lo hi κM ν qM hqMInst χM hκM hκmax hqM hν σ qQ hqQInst χQ hqQ hσ qRat hqRat0 hqRat aRat δ α β γ hF hEs have hLpos : 0 < L := by linarith have hY1 : 1 ≤ Y := (Real.one_le_exp (mul_nonneg hd.le hLpos.le)).trans hYlo have hYpos : 0 < Y := zero_lt_one.trans_le hY1 have hexp : 1 ≤ Real.exp (L^(1/5 : ℝ)) := Real.one_le_exp (Real.rpow_nonneg hLpos.le _) have hH1 : 1 ≤ H := by calc 1 ≤ 4096*1*2 := by norm_num _ ≤ 4096*Real.exp (L^(1/5 : ℝ))*L := mul_le_mul (mul_le_mul_of_nonneg_left hexp (by norm_num)) hL (by norm_num) (by positivity) _ ≤ H := hwidth have hHpos : 0 < H := zero_lt_one.trans_le hH1 have hw : |-(a+v)| ≤ L^(W+1) := by rw [abs_neg,Real.rpow_add hLpos,Real.rpow_one] calc |a+v| ≤ |a|+|v| := abs_add_le a v _ ≤ L^W+L^W := add_le_add ha hv _ = L^W*2 := by ring _ ≤ L^W*L := mul_le_mul_of_nonneg_left hL (Real.rpow_nonneg hLpos.le W) have hR : 0 ≤ L*Y/H := (div_pos (mul_pos hLpos hYpos) hHpos).le have hRwidth : L*Y/H ≤ 2*L*Y/H := by calc L*Y/H ≤ 2*(L*Y/H) := by linarith _ = 2*L*Y/H := by ring apply hsource Y H Z a v ((aRat : ℝ)/qRat) F δ α β γ hYlo hYhi hH1 hHupper hZpos hF hEs · intro i hiIdx j hjIdx k hk l hl hretained exact common_source_four_dyadic_box_integrable_norm_sq _ δ α β γ Y a v ((aRat : ℝ)/qRat) (L*Y/H) i j k l · intro i hiIdx j hjIdx k hk l hl hretained let N := ⌈4*Real.exp 2*Y⌉₊ have hb := @hdecay r hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg N i j k l Y (L*Y/H) H hY1 hYlo hYhi hR hHpos hwidth hRwidth qP qT χP χT τP τT lo hi κM ν qM hqMInst χM hκM hκmax hqM hν σ qQ hqQInst χQ hqQ hσ qRat hqRat0 hqRat aRat (-(a+v)) hw have hset : {t : ℝ | |t| ≤ L*Y/H} = Set.Icc (-(L*Y/H)) (L*Y/H) := by ext t simp only [Set.mem_ofPred_eq,Set.mem_Icc,abs_le] rw [hset] calc _ = (∫ t in Set.Icc (-(L*Y/H)) (L*Y/H), ‖rationalFourBoxKernelSum qRat aRat (dyadicNatBucket (Icc 1 N) i) (dyadicNatBucket (Icc 1 N) j) (dyadicNatBucket (Icc 1 N) k) (dyadicNatBucket (Icc 1 N) l) δ α β γ (fun n => ((harmonicCommonCutoff ((n : ℝ)/Y)/(n : ℝ) : ℝ) : ℂ)* physicalMellinPhase (t+(-(a+v))) (n : ℝ))‖^2) := by apply integral_congr_ae exact Filter.Eventually.of_forall (fun t => congrArg (fun z : ℂ => ‖z‖^2) (common_source_four_dyadic_box_eq_rational N δ α β γ Y a v aRat qRat t i j k l)) _ ≤ L^(-D) := hb end Bounty.WeakZeroFree -- Source module: ActualRoughSourceFourier /- Rational-centered source Fourier decay for the original rough coefficient, with the source energy and exact endpoint convolution retained explicitly. -/ open Finset Filter MeasureTheory namespace Bounty.WeakZeroFree theorem exists_actual_rough_source_fourier_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c q d γrough vMax ρ : ℝ} (hc : 0 < c) (hq0 : 0 ≤ q) (hq1 : q < 1) (hd : 0 < d) (hγ : 0 < γrough) (hv : vMax < 1) (hρ : 0 < ρ) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ (A E : ℝ) (T : ℕ) (Tmod Sshift Cmod Sfreq Rmod W : ℝ), ∃ C : ℝ, 0 ≤ C ∧ ∀ B : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (tmarks umarks : candidatePIndices c L → ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => umarks g.val) → ℂ) (κ : ℕ → ℂ), (∀ g, tmarks g ≤ T) → (∀ l, ‖b l‖ ≤ L^B) → (∀ n, ‖κ n‖ ≤ 1) → ∀ (g : ℕ), g ∈ candidateSmallPIndices c L → ∀ (Y H Z a v : ℝ) (F : ℤ → ℂ), Real.exp (d*L) ≤ Y → Real.log Y ≤ 6*L → 4096*Real.exp (L^(1/5 : ℝ))*L ≤ H → H ≤ Real.exp ((d/2)*L) → 0 < Z → |a| ≤ L^W → |v| ≤ L^W → ∀ (qP qT : ℕ) (χP : DirichletCharacter ℂ qP) (χT : DirichletCharacter ℂ qT) (τP τT : ℝ) (lo hi : ℕ), ∀ (aM vM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), vM ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, let δ : ℕ → ℂ := fun p => if p ∈ candidatePBand (c*L) g then (1/(((∑ p ∈ candidatePBand (c*L) g, 1/(p : ℝ)) : ℝ) : ℂ))* (χP (p : ZMod qP)*typeIIPhase τP p) else 0 let α : ℕ → ℂ := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n) let β : ℕ → ℂ := fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0 let γ := candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ tmarks umarks big b κ (fun n => χT (n : ZMod qT)*typeIIPhase τT n) (∀ n ∈ (harmonicCommonSupport Y).image Int.natAbs, F n = endpointFourConvolution δ α β γ n) → (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖^2) ≤ Y*L^E → (∫ x in Set.Icc ((aRat : ℝ)/qRat-1/H) ((aRat : ℝ)/qRat+1/H), ‖finiteFourierSum (harmonicCommonSupport Y) (harmonicCellSource Y Z a v F) x‖^2) ≤ Y*L^(-A) := by obtain ⟨J,hmain⟩ := exists_actual_dyadic_rough_cutoff_integral_precision (cLog := 6) hZ hc hq0 hq1 (by norm_num) hd hγ hv hρ refine ⟨J,?_⟩ intro jStar hjStar A E T Tmod Sshift Cmod Sfreq Rmod W obtain ⟨D,hAD,hsource⟩ := eventually_common_source_fourier_of_boxes hd A E obtain ⟨C,hC,hprecision⟩ := hmain jStar hjStar D T Tmod Sshift Cmod Sfreq Rmod (W+1) refine ⟨C,hC,?_⟩ intro B obtain ⟨S₀,hS₀,hbound⟩ := hprecision B refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,hsource,eventually_ge_atTop (2 : ℝ)] with L hbox hsource hL intro r hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg Y H Z a v F hY hlog hwidth hHu hZpos ha hvPhase qP qT χP χT τP τT lo hi aM vM ν qM hqMInst χM hvM hqM hν σ qQ hqQInst χQ hqQ hσ qRat hqRat0 hqRat aRat δ α β γ hF hEs have hLp : 0 < L := by linarith have hY1 : 1 ≤ Y := (Real.one_le_exp (by positivity : 0 ≤ d*L)).trans hY have hYp : 0 < Y := zero_lt_one.trans_le hY1 have hexp : 1 ≤ Real.exp (L^(1/5 : ℝ)) := Real.one_le_exp (Real.rpow_nonneg hLp.le _) have hH : 1 ≤ H := by nlinarith [mul_le_mul_of_nonneg_right hexp hLp.le] have hHp : 0 < H := zero_lt_one.trans_le hH have hR : 0 ≤ L*Y/H := by positivity have hRwidth : L*Y/H ≤ 2*L*Y/H := by apply div_le_div_of_nonneg_right _ hHp.le nlinarith [mul_nonneg hLp.le hYp.le] have hw : |-(a+v)| ≤ L^(W+1) := by rw [abs_neg,Real.rpow_add hLp,Real.rpow_one] have hp : 0 < L^W := Real.rpow_pos_of_pos hLp W exact (abs_add_le a v).trans ((add_le_add ha hvPhase).trans (by nlinarith [mul_le_mul_of_nonneg_left hL hp.le])) apply hsource Y H Z a v ((aRat : ℝ)/qRat) F δ α β γ hY hlog hH hHu hZpos hF hEs · intro kP hkP kM hkM kQ hkQ kT hkT hretained exact common_source_four_dyadic_box_integrable_norm_sq ⌈4*Real.exp 2*Y⌉₊ δ α β γ Y a v ((aRat : ℝ)/qRat) (L*Y/H) kP kM kQ kT · intro kP hkP kM hkM kQ hkQ kT hkT hretained have h := @hbox r hr hj take hkeep ξ tmarks umarks big b κ ht hb hκ g hg ⌈4*Real.exp 2*Y⌉₊ kP kM kQ kT Y (L*Y/H) H hY1 hY hlog hR hHp hwidth hRwidth qP qT χP χT τP τT lo hi aM vM ν qM hqMInst χM hvM hqM hν σ qQ hqQInst χQ hqQ hσ qRat hqRat0 hqRat aRat (-(a+v)) hw have hset : {t : ℝ | |t| ≤ L*Y/H} = Set.Icc (-(L*Y/H)) (L*Y/H) := by ext t simp only [Set.mem_ofPred_eq, Set.mem_Icc, abs_le] rw [hset] have heq (t : ℝ) := congrArg (fun z : ℂ => ‖z‖^2) (common_source_four_dyadic_box_eq_rational ⌈4*Real.exp 2*Y⌉₊ δ α β γ Y a v aRat qRat t kP kM kQ kT) exact (le_of_eq_of_le (integral_congr_ae (Filter.Eventually.of_forall heq)) h) end Bounty.WeakZeroFree -- Source module: ActualSelectedSourceEnergy /- The original selected endpoint has polynomial source and target energy, with the actual candidate rough factor and normalized residual coefficient. -/ open Finset Filter open scoped ComplexConjugate namespace Bounty theorem exists_actual_selected_source_energy {c : ℝ} (hc : 0 < c) (J ell : ℕ) (Cb : ℝ) : ∃ E : ℝ, ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (cut : candidatePIndices c L → Finset (Fin J)) (big : Finset (candidatePIndices c L)) (g : candidatePIndices c L) (k : ℕ), ell+(cut g).card = k+1 → g ∉ big → ∀ (b₀ : GroupMarkedLists (fun j : big => candidatePBand (c*L) j.val.val) (fun j : big => ell+(cut j.val).card) → ℂ), (∀ l, ‖b₀ l‖ ≤ L^Cb) → ∀ (α θQ : ℕ → ℂ), (∀ n, ¬ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L))) → α n = 0) → (∀ n, ‖α n‖ ≤ 1) → (∀ n, ‖θQ n‖ ≤ 1) → ∀ Y : ℝ, 1 ≤ Y → Real.log Y ≤ 6*L → ∀ Z a b v : ℝ, let P := fun j : candidatePIndices c L => candidatePBand (c*L) j.val let mass := fun j : candidatePIndices c L => ∑ p ∈ P j, 1/(p : ℝ) let marks := fun j : candidatePIndices c L => ell+(cut j).card let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let β := fun n => if n ∈ candidateRoughBand c L jStar then θQ n else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) n) let F := fun n : ℤ => selectedPeeledEndpoint P (1/2) mass marks g k big b₀ pool α β γ n.natAbs (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖^2) ≤ Y*L^E ∧ (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellTarget Y b F n‖^2) ≤ Y*L^E := by classical obtain ⟨E,hE⟩ := exists_candidate_harmonic_single_energy hc J ell Cb 0 refine ⟨E,?_⟩ filter_upwards [hE,eventually_candidate_P_pool_below_rough_cutoff hc, eventually_ge_atTop (0 : ℝ)] with L henergy hpool hL intro r jStar hr hj take hkeep ξ cut big g k hk hg b₀ hb₀ α θQ hfree hα hθQ Y hY hlog Z a b v let β : ℕ → ℂ := fun n => if n ∈ candidateRoughBand c L jStar then θQ n else 0 let γ : ℕ → ℂ := fun n => conj (candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) n) have hβfree (n : ℕ) (hn : ¬ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) : β n = 0 := by have hout : n ∉ candidateRoughBand c L jStar := by intro hmem exact hn (prime_factors_disjoint_of_rough hpool (mem_filter.mp hmem).2) exact if_neg hout have hβ (n : ℕ) : ‖β n‖ ≤ 1 := by dsimp only [β] split_ifs · exact hθQ n · simp only [norm_zero,zero_le_one] have hγ (n : ℕ) : ‖γ n‖ ≤ 1 := by dsimp only [γ] rw [Complex.norm_conj] exact norm_candidate_residual_prime_coefficient_le_one (mul_nonneg hc.le hL) hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) (fun slot p hp => (candidate_allocation_fourier_twist_norm c L r jStar take ξ slot (Nat.pos_of_ne_zero (candidate_Q_slot_nonzero c L r jStar slot hp))).le) n have h := henergy (candidatePIndices c L) (subset_refl _) cut big g k hk hg b₀ hb₀ ((candidatePIndices c L).biUnion (candidatePBand (c*L))) (fun j p hp => mem_biUnion.mpr ⟨j.val,j.property,hp⟩) α β γ hfree hβfree (by simpa only [Real.rpow_zero] using hα) (by simpa only [Real.rpow_zero] using hβ) (by simpa only [Real.rpow_zero] using hγ) Y hY hlog Z a b v exact h.2 end Bounty -- Source module: ActualSourceFactorProperties /- Unit bounds and prime-pool support for the literal twisted source factor. -/ open Finset Filter namespace Bounty theorem restricted_twisted_source_properties (pool I : Finset ℕ) (f : ℕ → ℝ) (hf : ∀ n, |f n| ≤ 1) (hfree : ∀ n, f n ≠ 0 → Disjoint n.primeFactors pool) (q : ℕ) (χ : DirichletCharacter ℂ q) (ν : ℝ) : (∀ n, ‖(typeIIRestrict I f n : ℂ)*(χ (n : ZMod q)*typeIIPhase ν n)‖ ≤ 1) ∧ (∀ n, ¬ Disjoint n.primeFactors pool → (typeIIRestrict I f n : ℂ)*(χ (n : ZMod q)*typeIIPhase ν n) = 0) := by constructor · intro n have hb : ‖(typeIIRestrict I f n : ℂ)‖ ≤ 1 := by simpa only [Complex.norm_real,Real.norm_eq_abs] using typeIIRestrict_abs_le zero_le_one (fun n _ => hf n) n rw [norm_mul,norm_mul,typeIIPhase_norm,mul_one] exact (mul_le_mul hb (χ.norm_le_one _) (norm_nonneg _) zero_le_one).trans_eq (one_mul 1) · intro n hn have hz : f n = 0 := by by_contra hne exact hn (hfree n hne) simp only [typeIIRestrict,hz,ite_self,Complex.ofReal_zero,zero_mul] theorem eventually_actual_prime_source_factor_properties {c : ℝ} (hc : 0 < c) (S : ℝ) (hS : 0 ≤ S) : ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ (I : Finset ℕ) (q : ℕ) (χ : DirichletCharacter ℂ q) (ν : ℝ), (∀ n, ‖(typeIIRestrict I (ambientPrimeTypeIIAlpha κ L S) n : ℂ)* (χ (n : ZMod q)*typeIIPhase ν n)‖ ≤ 1) ∧ (∀ n, ¬ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L))) → (typeIIRestrict I (ambientPrimeTypeIIAlpha κ L S) n : ℂ)* (χ (n : ZMod q)*typeIIPhase ν n) = 0) := by filter_upwards [eventually_balanced_typeII_coefficient_properties S hS, eventually_ambient_prime_endpoint_group_free hc S hS] with L hbound hfree intro κ hκ hκmax I q χ ν exact restricted_twisted_source_properties _ I _ (fun n => (hbound κ hκ hκmax n).1) (fun n hn => (hfree κ hκ hκmax n hn).2) q χ ν theorem eventually_actual_rough_source_factor_properties {c γ : ℝ} (hc : 0 < c) (hγ : 0 < γ) : ∀ᶠ L : ℝ in atTop, ∀ S a v : ℝ, ∀ (I : Finset ℕ) (q : ℕ) (χ : DirichletCharacter ℂ q) (ν : ℝ), (∀ n, ‖(typeIIRestrict I (ambientRoughIntervalTypeIIAlpha γ L S a v) n : ℂ)* (χ (n : ZMod q)*typeIIPhase ν n)‖ ≤ 1) ∧ (∀ n, ¬ Disjoint n.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L))) → (typeIIRestrict I (ambientRoughIntervalTypeIIAlpha γ L S a v) n : ℂ)* (χ (n : ZMod q)*typeIIPhase ν n) = 0) := by filter_upwards [eventually_ambient_rough_interval_typeII_properties hγ, eventually_ambient_rough_endpoint_group_free hc hγ] with L hbound hfree intro S a v I q χ ν exact restricted_twisted_source_properties _ I _ (fun n => (hbound S a v n).1) (fun n hn => (hfree S a v n hn).2) q χ ν end Bounty -- Source module: ActualPeeledSourceEnergy /- Polynomial source and target energy for the exact prime and rough peeled endpoints. -/ open Finset Filter open scoped ComplexConjugate namespace Bounty theorem exists_actual_prime_peeled_source_energy {c : ℝ} (hc : 0 < c) (J ell : ℕ) (Cb : ℝ) : ∃ E : ℝ, ∀ S : ℝ, 0 ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (cut : candidatePIndices c L → Finset (Fin J)) (big : Finset (candidatePIndices c L)) (g : candidatePIndices c L) (k : ℕ), ell+(cut g).card = k+1 → g ∉ big → ∀ (b₀ : GroupMarkedLists (fun j : big => candidatePBand (c*L) j.val.val) (fun j : big => ell+(cut j.val).card) → ℂ), (∀ l, ‖b₀ l‖ ≤ L^Cb) → ∀ (lo hi : ℕ) (κ ν : ℝ) (qM : ℕ) (χM : DirichletCharacter ℂ qM), 0 ≤ κ → κ ≤ 1/50 → ∀ (σ : ℝ) (qQ : ℕ) (χQ : DirichletCharacter ℂ qQ), let α := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κ L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n) let θQ := fun n => typeIIPhase σ n*χQ (n : ZMod qQ) ∀ Y : ℝ, 1 ≤ Y → Real.log Y ≤ 6*L → ∀ Z a b v : ℝ, let P := fun j : candidatePIndices c L => candidatePBand (c*L) j.val let mass := fun j : candidatePIndices c L => ∑ p ∈ P j, 1/(p : ℝ) let marks := fun j : candidatePIndices c L => ell+(cut j).card let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let β := fun n => if n ∈ candidateRoughBand c L jStar then θQ n else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) n) let F := fun n : ℤ => selectedPeeledEndpoint P (1/2) mass marks g k big b₀ pool α β γ n.natAbs (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖^2) ≤ Y*L^E ∧ (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellTarget Y b F n‖^2) ≤ Y*L^E := by classical obtain ⟨E,hE⟩ := exists_actual_selected_source_energy hc J ell Cb refine ⟨E,?_⟩ intro S hS filter_upwards [hE,eventually_actual_prime_source_factor_properties hc S hS] with L henergy hfactor intro r jStar hr hj take hkeep ξ cut big g k hk hg b₀ hb₀ lo hi κ ν qM χM hκ hκmax σ qQ χQ have hp := hfactor κ hκ hκmax (Ioc lo hi) qM χM ν have hθ (n : ℕ) : ‖typeIIPhase σ n*χQ (n : ZMod qQ)‖ ≤ 1 := by rw [norm_mul,typeIIPhase_norm,one_mul] exact χQ.norm_le_one _ exact henergy r jStar hr hj take hkeep ξ cut big g k hk hg b₀ hb₀ (fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κ L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n)) (fun n => typeIIPhase σ n*χQ (n : ZMod qQ)) hp.2 hp.1 hθ theorem exists_actual_rough_peeled_source_energy {c γrough : ℝ} (hc : 0 < c) (hγ : 0 < γrough) (J ell : ℕ) (Cb : ℝ) : ∃ E : ℝ, ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (cut : candidatePIndices c L → Finset (Fin J)) (big : Finset (candidatePIndices c L)) (g : candidatePIndices c L) (k : ℕ), ell+(cut g).card = k+1 → g ∉ big → ∀ (b₀ : GroupMarkedLists (fun j : big => candidatePBand (c*L) j.val.val) (fun j : big => ell+(cut j.val).card) → ℂ), (∀ l, ‖b₀ l‖ ≤ L^Cb) → ∀ (lo hi : ℕ) (S aM vM ν : ℝ) (qM : ℕ) (χM : DirichletCharacter ℂ qM), ∀ (σ : ℝ) (qQ : ℕ) (χQ : DirichletCharacter ℂ qQ), let α := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n) let θQ := fun n => typeIIPhase σ n*χQ (n : ZMod qQ) ∀ Y : ℝ, 1 ≤ Y → Real.log Y ≤ 6*L → ∀ Z a b v : ℝ, let P := fun j : candidatePIndices c L => candidatePBand (c*L) j.val let mass := fun j : candidatePIndices c L => ∑ p ∈ P j, 1/(p : ℝ) let marks := fun j : candidatePIndices c L => ell+(cut j).card let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let β := fun n => if n ∈ candidateRoughBand c L jStar then θQ n else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) n) let F := fun n : ℤ => selectedPeeledEndpoint P (1/2) mass marks g k big b₀ pool α β γ n.natAbs (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖^2) ≤ Y*L^E ∧ (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellTarget Y b F n‖^2) ≤ Y*L^E := by classical obtain ⟨E,hE⟩ := exists_actual_selected_source_energy hc J ell Cb refine ⟨E,?_⟩ filter_upwards [hE,eventually_actual_rough_source_factor_properties hc hγ] with L henergy hfactor intro r jStar hr hj take hkeep ξ cut big g k hk hg b₀ hb₀ lo hi S aM vM ν qM χM σ qQ χQ have hp := hfactor S aM vM (Ioc lo hi) qM χM ν have hθ (n : ℕ) : ‖typeIIPhase σ n*χQ (n : ZMod qQ)‖ ≤ 1 := by rw [norm_mul,typeIIPhase_norm,one_mul] exact χQ.norm_le_one _ exact henergy r jStar hr hj take hkeep ξ cut big g k hk hg b₀ hb₀ (fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n)) (fun n => typeIIPhase σ n*χQ (n : ZMod qQ)) hp.2 hp.1 hθ end Bounty -- Source module: ActualPeeledEndpoint /- The literal candidate peeled endpoint has exactly the residual coefficient used in the original four-factor analytic estimates. -/ open Finset open scoped ComplexConjugate namespace Bounty theorem candidate_selected_peeled_endpoint_eq_four_convolution (c L q : ℝ) (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (marks : candidatePIndices c L → ℕ) (g : candidatePIndices c L) (k : ℕ) (big : Finset (candidatePIndices c L)) (b : GroupMarkedLists (fun g : big => candidatePBand (c*L) g.val.val) (fun g : big => marks g.val) → ℂ) (α β : ℕ → ℂ) (n : ℕ) : selectedPeeledEndpoint (fun g : candidatePIndices c L => candidatePBand (c*L) g.val) q (fun g => ∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) marks g k big b ((candidatePIndices c L).biUnion (candidatePBand (c*L))) α β (fun m => conj (candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) m)) n = endpointFourConvolution (fun p => if p ∈ candidatePBand (c*L) g.val then 1/(((∑ p ∈ candidatePBand (c*L) g.val, 1/(p : ℝ)) : ℝ) : ℂ) else 0) α β (candidateSelectedResidualCoefficient c L q r jStar hr hj take hkeep ξ (Function.update marks g k) marks big b (fun _ => 1) (fun _ => 1)) n := by classical unfold selectedPeeledEndpoint congr 1 funext m simp only [candidateSelectedResidualCoefficient,mul_one] end Bounty -- Source module: ActualPeeledPrimeSourceFourier /- Fourier precision for the literal original peeled prime source. Its energy and four-factor convolution identity are supplied by the proved candidate APIs. -/ open Finset Filter MeasureTheory open scoped ComplexConjugate namespace Bounty.WeakZeroFree theorem exists_actual_peeled_prime_source_fourier_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c d : ℝ} (hc : 0 < c) (hd : 0 < d) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ (A : ℝ) (Jprobe ell : ℕ) (Cb Tmod Sshift Cmod Sfreq Rmod W : ℝ), ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (cut : candidatePIndices c L → Finset (Fin Jprobe)) (big : Finset (candidatePIndices c L)) (g : candidatePIndices c L) (k : ℕ), ell+(cut g).card = k+1 → g ∉ big → g.val ∈ candidateSmallPIndices c L → ∀ (b₀ : GroupMarkedLists (fun j : big => candidatePBand (c*L) j.val.val) (fun j : big => ell+(cut j.val).card) → ℂ), (∀ l, ‖b₀ l‖ ≤ L^Cb) → ∀ (lo hi : ℕ) (κM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → ∀ (Y H Z a v : ℝ), Real.exp (d*L) ≤ Y → Real.log Y ≤ 6*L → 4096*Real.exp (L^(1/5 : ℝ))*L ≤ H → H ≤ Real.exp ((d/2)*L) → 0 < Z → |a| ≤ L^W → |v| ≤ L^W → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, let P := fun j : candidatePIndices c L => candidatePBand (c*L) j.val let mass := fun j : candidatePIndices c L => ∑ p ∈ P j, 1/(p : ℝ) let marks := fun j : candidatePIndices c L => ell+(cut j).card let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let α := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n) let β := fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) n) let F := fun n : ℤ => selectedPeeledEndpoint P (1/2) mass marks g k big b₀ pool α β γ n.natAbs (∫ x in Set.Icc ((aRat : ℝ)/qRat-1/H) ((aRat : ℝ)/qRat+1/H), ‖finiteFourierSum (harmonicCommonSupport Y) (harmonicCellSource Y Z a v F) x‖^2) ≤ Y*L^(-A) := by classical obtain ⟨J,hmain⟩ := exists_actual_prime_source_fourier_precision (q := (1/2 : ℝ)) hZ hc (by norm_num) (by norm_num) hd refine ⟨J,?_⟩ intro jStar hjStar A Jprobe ell Cb Tmod Sshift Cmod Sfreq Rmod W obtain ⟨E,henergy⟩ := exists_actual_prime_peeled_source_energy hc Jprobe ell Cb obtain ⟨C,hC,hprecision⟩ := hmain jStar hjStar A E (ell+Jprobe) Tmod Sshift Cmod Sfreq Rmod W obtain ⟨S₀,hS₀,hbound⟩ := hprecision Cb refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,henergy S (hS₀.trans hS),eventually_ge_atTop (1 : ℝ)] with L hdecay henergyL hL intro r hr hj take hkeep ξ cut big g k hk hg hgSmall b₀ hb₀ lo hi κM ν qM hqMInst χM hκM hκmax hqM hν σ qQ hqQInst χQ hqQ hσ Y H Z a v hYlo hYhi hwidth hHupper hZpos ha hv qRat hqRat0 hqRat aRat P mass marks pool α β γ F have hcard (j : candidatePIndices c L) : (cut j).card ≤ Jprobe := by simpa only [Fintype.card_fin] using Finset.card_le_univ (cut j) have hkbound : k ≤ ell+Jprobe := by have := hcard g omega have ht : ∀ j, Function.update marks g k j ≤ ell+Jprobe := by intro j by_cases hjg : j = g · subst j simpa only [Function.update_self] using hkbound · simpa only [Function.update_of_ne hjg] using Nat.add_le_add_left (hcard j) ell have hchar (n : ℕ) : (1 : DirichletCharacter ℂ 1) (n : ZMod 1) = 1 := by rw [Subsingleton.elim (n : ZMod 1) 1] exact map_one _ have hY1 : 1 ≤ Y := (Real.one_le_exp (mul_nonneg hd.le (zero_le_one.trans hL))).trans hYlo have hresult := @hdecay r hr hj take hkeep ξ (Function.update marks g k) marks big b₀ (fun _ => 1) ht hb₀ (by intro n; simp only [norm_one,le_refl]) g.val hgSmall Y H Z a v F hYlo hYhi hwidth hHupper hZpos ha hv 1 1 (1 : DirichletCharacter ℂ 1) (1 : DirichletCharacter ℂ 1) 0 0 lo hi κM ν qM hqMInst χM hκM hκmax hqM hν σ qQ hqQInst χQ hqQ hσ qRat hqRat0 hqRat aRat apply hresult · intro n hn have h := candidate_selected_peeled_endpoint_eq_four_convolution c L (1/2) r jStar hr hj take hkeep ξ marks g k big b₀ α β n simpa only [F,P,mass,marks,pool,γ,Int.natAbs_natCast,hchar,typeIIPhase_zero,mul_one] using h · have he := henergyL r jStar hr hj take hkeep ξ cut big g k hk hg b₀ hb₀ lo hi κM ν qM χM hκM hκmax σ qQ χQ Y hY1 hYhi Z a 0 v exact he.1 end Bounty.WeakZeroFree -- Source module: ActualPeeledRoughSourceFourier /- Rational-centered Fourier decay for the original peeled rough endpoint, with its coefficient identity and source energy discharged. -/ open Finset Filter MeasureTheory open scoped ComplexConjugate namespace Bounty.WeakZeroFree theorem exists_actual_peeled_rough_source_fourier_precision (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c d γrough vMax ρ : ℝ} (hc : 0 < c) (hd : 0 < d) (hγ : 0 < γrough) (hv : vMax < 1) (hρ : 0 < ρ) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ (A : ℝ) (Jprobe ell : ℕ) (Cb Tmod Sshift Cmod Sfreq Rmod W : ℝ), ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (r : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (cut : candidatePIndices c L → Finset (Fin Jprobe)) (big : Finset (candidatePIndices c L)) (g : candidatePIndices c L) (k : ℕ), ell+(cut g).card = k+1 → g ∉ big → g.val ∈ candidateSmallPIndices c L → ∀ (b₀ : GroupMarkedLists (fun j : big => candidatePBand (c*L) j.val.val) (fun j : big => ell+(cut j.val).card) → ℂ), (∀ l, ‖b₀ l‖ ≤ L^Cb) → ∀ (lo hi : ℕ) (aM vM ν : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), vM ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → ∀ (Y H Z a v : ℝ), Real.exp (d*L) ≤ Y → Real.log Y ≤ 6*L → 4096*Real.exp (L^(1/5 : ℝ))*L ≤ H → H ≤ Real.exp ((d/2)*L) → 0 < Z → |a| ≤ L^W → |v| ≤ L^W → ∀ qRat : ℕ, 0 < qRat → (qRat : ℝ) ≤ L^Rmod → ∀ aRat : ℤ, let P := fun j : candidatePIndices c L => candidatePBand (c*L) j.val let mass := fun j : candidatePIndices c L => ∑ p ∈ P j, 1/(p : ℝ) let marks := fun j : candidatePIndices c L => ell+(cut j).card let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let α := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν n) let β := fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) n) let F := fun n : ℤ => selectedPeeledEndpoint P (1/2) mass marks g k big b₀ pool α β γ n.natAbs (∫ x in Set.Icc ((aRat : ℝ)/qRat-1/H) ((aRat : ℝ)/qRat+1/H), ‖finiteFourierSum (harmonicCommonSupport Y) (harmonicCellSource Y Z a v F) x‖^2) ≤ Y*L^(-A) := by classical obtain ⟨J,hmain⟩ := exists_actual_rough_source_fourier_precision (q := 1/2) hZ hc (by norm_num) (by norm_num) hd hγ hv hρ refine ⟨J,?_⟩ intro jStar hjStar A Jprobe ell Cb Tmod Sshift Cmod Sfreq Rmod W obtain ⟨E,henergy⟩ := exists_actual_rough_peeled_source_energy hc hγ Jprobe ell Cb obtain ⟨C,hC,hprecision⟩ := hmain jStar hjStar A E (ell+Jprobe) Tmod Sshift Cmod Sfreq Rmod W obtain ⟨S₀,hS₀,hbound⟩ := hprecision Cb refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hbound S hS,henergy,eventually_ge_atTop (1 : ℝ)] with L hsource henergy hL intro r hr hj take hkeep ξ cut big g k hk hgb hg b₀ hb₀ lo hi aM vM ν qM hqMInst χM hvM hqM hν σ qQ hqQInst χQ hqQ hσ Y H Z a v hY hlog hwidth hHu hZpos ha hvPhase qRat hqRat0 hqRat aRat P mass marks pool α β γ F have hLp : 0 < L := zero_lt_one.trans_le hL have hY1 : 1 ≤ Y := (Real.one_le_exp (mul_nonneg hd.le hLp.le)).trans hY have hcard (j : candidatePIndices c L) : (cut j).card ≤ Jprobe := by simpa using (Finset.card_le_univ (cut j)) have ht : ∀ j, Function.update marks g k j ≤ ell+Jprobe := by intro j by_cases h : j = g · subst j rw [Function.update_self] have hcg := hcard g omega · rw [Function.update_of_ne h] exact Nat.add_le_add_left (hcard j) ell have hc1 (n : ℕ) : (1 : DirichletCharacter ℂ 1) (n : ZMod 1) = 1 := by rw [Subsingleton.elim (n : ZMod 1) 1] exact map_one _ have hEs : (∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellSource Y Z a v F n‖^2) ≤ Y*L^E := (henergy r jStar hr hj take hkeep ξ cut big g k hk hgb b₀ hb₀ lo hi S aM vM ν qM χM σ qQ χQ Y hY1 hlog Z a 0 v).1 apply @hsource r hr hj take hkeep ξ (Function.update marks g k) marks big b₀ (fun _ => 1) ht hb₀ (by intro n; simp) g.val hg Y H Z a v F hY hlog hwidth hHu hZpos ha hvPhase 1 1 (1 : DirichletCharacter ℂ 1) (1 : DirichletCharacter ℂ 1) 0 0 lo hi aM vM ν qM hqMInst χM hvM hqM hν σ qQ hqQInst χQ hqQ hσ qRat hqRat0 hqRat aRat · intro n hn have h := candidate_selected_peeled_endpoint_eq_four_convolution c L (1/2) r jStar hr hj take hkeep ξ marks g k big b₀ α β n simpa only [F,P,mass,marks,pool,γ,Int.natAbs_natCast,hc1,typeIIPhase_zero,mul_one] using h · exact hEs end Bounty.WeakZeroFree -- Source module: ActualSourceCellScale /- Actual occupied comparison cells simultaneously supply the source size and local Fourier width, with a genuine lower bound on the auxiliary product. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_actual_occupied_source_cell_scale {c b : ℝ} (hc : 0 < c) (hb : 0 < b) (J : ℕ) (K q : ℝ) (hq : 0 ≤ q) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → let P := fun g : S => candidatePBand (c*L) g.val ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r t : Finset S) (A B : Finset (RepeatedBigFlatIndex S J ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → A.Nonempty → B ⊆ t.sigma (repeatedBigPrimeProbeSlots probes) → B.Nonempty → (∃ i : A, i.val.1.val ∈ candidateBigPIndices c L) → ∀ (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (ζ : ℝ) (x : ∀ i : A, P i.val.1) (y : ∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase ζ (∏ i, (x i).val) ≠ 0 → (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y) * physicalPhase ζ (∏ i, (y i).val) ≠ 0 → ∀ (k : ℤ), k ≠ 0 → |(k : ℝ)| ≤ L^K → ∀ Z : ℝ, 0 < Z → Real.exp (2*b*L) ≤ Z*((((∏ i, (x i).val)*(∏ i, (y i).val)) : ℕ) : ℝ)/2 → let HA := Real.exp (((d : ℝ)-1)*h) let HB := Real.exp (((e : ℝ)-1)*h) let Y := Z*(HA*HB) let Hlocal := |(k : ℝ)| *(HA*HB)/L^q Real.exp (b*L) ≤ Y ∧ 1 ≤ Y ∧ 1 ≤ Hlocal ∧ 4096*Real.exp (L^(1/5 : ℝ))*L ≤ Hlocal ∧ Hlocal ≤ Real.exp ((b/2)*L) := by filter_upwards [eventually_candidate_big_cell_local_scale hc hb J K q hq, eventually_common_cell_exponential_lower (b := 2*b) (by positivity), eventually_ge_atTop (1 : ℝ)] with L hlocal hsize hL intro S hS P ell probes r t A B hA hAne hB hBne hAbig Q h hh hh1 d e χ ψ ζ x y hx hy k hk hkK Z hZ hproduct have hwidth := hlocal S hS ell probes r t A B hA hAne hB hBne hAbig Q h hh hh1 d e χ ψ ζ ⟨x,hx⟩ ⟨y,hy⟩ k hk hkK (Real.exp (L^(1/5 : ℝ))) (le_refl _) have hposA : 0 < ∏ i : A, (x i).val := by apply Finset.prod_pos intro i _ exact ((mem_dyadicPrimeBand_iff (c*L) (3/2) (9/5) i.val.1.val (x i).val).mp (x i).property).1.pos have hposB : 0 < ∏ i : B, (y i).val := by apply Finset.prod_pos intro i _ exact ((mem_dyadicPrimeBand_iff (c*L) (3/2) (9/5) i.val.1.val (y i).val).mp (y i).property).1.pos have hcharA : primeProductCellCharacter (fun i : A => P i.val.1) h d χ x ≠ 0 := by intro hz exact hx (by rw [hz,map_zero,zero_mul]) have hcharB : primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y ≠ 0 := by intro hz exact hy (by rw [hz,map_zero,zero_mul]) have hcell := harmonic_cell_product_bounds hh hh1 hposA hposB (prime_cell_character_mem (fun i : A => P i.val.1) h d χ x hcharA) (prime_cell_character_mem (fun i : B => P i.val.1) h e ψ y hcharB) have hY := hsize Z (harmonicCellProductScale h d e) (((∏ i : A, (x i).val)*(∏ i : B, (y i).val) : ℕ) : ℝ) hZ hcell.2 hproduct have hbhalf : (2*b)/2 = b := by ring rw [hbhalf] at hY have hYone : 1 ≤ Z*harmonicCellProductScale h d e := (Real.one_le_exp (mul_nonneg hb.le (zero_le_one.trans hL))).trans hY have hExp : 1 ≤ Real.exp (L^(1/5 : ℝ)) := Real.one_le_exp (Real.rpow_nonneg (zero_le_one.trans hL) _) have hbase : 1 ≤ Real.exp (L^(1/5 : ℝ))*L := by simpa only [one_mul] using mul_le_mul hExp hL zero_le_one (Real.exp_nonneg _) have hHone : 1 ≤ |(k : ℝ)| * (Real.exp (((d : ℝ)-1)*h)*Real.exp (((e : ℝ)-1)*h))/L^q := by have hw := hwidth.1 simp only [mul_assoc] at hw nlinarith only [hbase,hw] exact ⟨hY,hYone,hHone,by simpa only [mul_assoc] using hwidth.1, by simpa only [mul_assoc] using hwidth.2⟩ end Bounty -- Source module: ActualEmptyCellSum /- Empty original cell tests make the literal auxiliary harmonic sum zero, without any source-energy or positive-scale hypothesis. -/ open Finset open scoped Classical namespace Bounty private theorem cell_character_zero_of_no_phased_support {I : Type*} [Fintype I] (P : I → Finset ℕ) (Q : ℕ) (h : ℝ) (d : ℤ) (χ : BoundedPrimitiveCharacter Q) (ζ : ℝ) (hnone : ¬∃ x : (∀ i, P i), (starRingEnd ℂ) (primeProductCellCharacter P h d χ x) * physicalPhase ζ (∏ i, (x i).val) ≠ 0) (x : ∀ i, P i) : (starRingEnd ℂ) (primeProductCellCharacter P h d χ x) = 0 := by have hz : (starRingEnd ℂ) (primeProductCellCharacter P h d χ x) * physicalPhase ζ (∏ i, (x i).val) = 0 := by by_contra hne exact hnone ⟨x,hne⟩ apply norm_eq_zero.mp have hn := congrArg (fun z : ℂ => ‖z‖) hz simpa only [norm_mul,physical_phase_norm,mul_one,norm_zero] using hn theorem candidate_cell_aux_sum_eq_zero_of_no_left {S : Finset ℕ} {J ell : ℕ} (P : S → Finset ℕ) (V : S → ℝ) (A B : Finset (RepeatedBigFlatIndex S J ell)) (hU : ∀ (g : S) (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex S J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (Q : ℕ) (h : ℝ) (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (Y Z a b v : ℝ) (F₀ G₀ : ℤ → ℂ) (hnone : ¬∃ x : (∀ i : A, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (x i).val) ≠ 0) : (∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * ((starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1) * (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2)) * physicalPhase (-(a+b+2*Real.pi*v)) (physicalFreeFactor (repeatedBigAuxCut A B) aux) * harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)) F₀ G₀) = 0 := by apply sum_eq_zero intro aux _ have hz := cell_character_zero_of_no_phased_support (fun i : A => P i.val.1) Q h d χ (-(a+b+2*Real.pi*v)) hnone (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 simp only [hz,zero_mul,mul_zero] theorem candidate_cell_aux_sum_eq_zero_of_no_right {S : Finset ℕ} {J ell : ℕ} (P : S → Finset ℕ) (V : S → ℝ) (A B : Finset (RepeatedBigFlatIndex S J ell)) (hU : ∀ (g : S) (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex S J ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ) (Q : ℕ) (h : ℝ) (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (Y Z a b v : ℝ) (F₀ G₀ : ℤ → ℂ) (hnone : ¬∃ x : (∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ x) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (x i).val) ≠ 0) : (∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * ((starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1) * (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2)) * physicalPhase (-(a+b+2*Real.pi*v)) (physicalFreeFactor (repeatedBigAuxCut A B) aux) * harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)) F₀ G₀) = 0 := by apply sum_eq_zero intro aux _ have hz := cell_character_zero_of_no_phased_support (fun i : B => P i.val.1) Q h e ψ (-(a+b+2*Real.pi*v)) hnone (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 simp only [hz,zero_mul,mul_zero] end Bounty -- Source module: ActualPrimeCellLocalEnergy /- The original prime peeled endpoints satisfy the comparison-cell estimate. The source and target energies and rational local source bound are discharged. -/ open Finset Filter MeasureTheory open scoped ComplexConjugate namespace Bounty.WeakZeroFree theorem exists_actual_prime_cell_local_energy_decay (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c dSource : ℝ} (hc : 0 < c) (hdSource : 0 < dSource) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ (D : ℝ) (Jprobe ell : ℕ) (Cb K Tmod Sshift Cmod Sfreq W : ℝ), 0 ≤ K → ∃ q : ℝ, 0 ≤ q ∧ ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (rQ : ℕ) (hrQ : 0 < rQ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*rQ) → Bool) (hkeep : take ((candidateAllocationOrder c L rQ).symm (candidateRoughSlot c L rQ jStar hrQ hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L rQ jStar) → ℝ) (cut : candidatePIndices c L → Finset (Fin Jprobe)) (big : Finset (candidatePIndices c L)) (g : candidatePIndices c L) (kPeel : ℕ), ell+(cut g).card = kPeel+1 → g ∉ big → g.val ∈ candidateSmallPIndices c L → ∀ (b₀ b₁ : GroupMarkedLists (fun j : big => candidatePBand (c*L) j.val.val) (fun j : big => ell+(cut j.val).card) → ℂ), (∀ l, ‖b₀ l‖ ≤ L^Cb) → (∀ l, ‖b₁ l‖ ≤ L^Cb) → ∀ (lo hi : ℕ) (κM ν₀ ν₁ : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν₀| ≤ L^Sfreq → |ν₁| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → let P₀ := fun j : candidatePIndices c L => candidatePBand (c*L) j.val let mass := fun j : candidatePIndices c L => ∑ p ∈ P₀ j, 1/(p : ℝ) let marks := fun j : candidatePIndices c L => ell+(cut j).card let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let α₀ := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₀ n) let α₁ := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₁ n) let β := fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L rQ jStar hrQ hj take hkeep (candidateAllocationFourierTwist c L rQ jStar take ξ) n) let F₀ := fun n : ℤ => selectedPeeledEndpoint P₀ (1/2) mass marks g kPeel big b₀ pool α₀ β γ n.natAbs let G₀ := fun n : ℤ => selectedPeeledEndpoint P₀ (1/2) mass marks g kPeel big b₁ pool α₁ β γ n.natAbs ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → let P := fun j : groups => candidatePBand (c*L) j.val let V := fun j : groups => ∑ p ∈ P j, 1/(p : ℝ) ∀ (probes : groups → Finset (Fin Jprobe)) (r t : Finset groups) (A B : Finset (RepeatedBigFlatIndex groups Jprobe ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → A.Nonempty → B ⊆ t.sigma (repeatedBigPrimeProbeSlots probes) → B.Nonempty → (∃ i : A, i.val.1.val ∈ candidateBigPIndices c L) → ∀ (hU : ∀ j (i : Fin ell), (⟨j, Sum.inr i⟩ : RepeatedBigFlatIndex groups Jprobe ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L^K → ∀ (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (a b v Z : ℝ), 0 < Z → |a| ≤ L^W → |2*Real.pi*v| ≤ L^W → let HA := Real.exp (((d : ℝ)-1)*h) let HB := Real.exp (((e : ℝ)-1)*h) let Y := Z*(HA*HB) Real.log Y ≤ 6*L → (∀ (x : ∀ i : A, P i.val.1) (y : ∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (x i).val) ≠ 0 → (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (y i).val) ≠ 0 → Real.exp (2*dSource*L) ≤ Z*((((∏ i, (x i).val)*(∏ i, (y i).val)) : ℕ) : ℝ)/2) → ‖∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * ((starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1) * (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2)) * physicalPhase (-(a+b+2*Real.pi*v)) (physicalFreeFactor (repeatedBigAuxCut A B) aux) * harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)) F₀ G₀‖ ≤ Y*L^(-D) := by classical obtain ⟨J,hsource⟩ := exists_actual_peeled_prime_source_fourier_precision hZ hc hdSource refine ⟨J,?_⟩ intro jStar hjStar D Jprobe ell Cb K Tmod Sshift Cmod Sfreq W hK obtain ⟨E,henergy⟩ := exists_actual_prime_peeled_source_energy hc Jprobe ell Cb obtain ⟨q,hq,hcell⟩ := exists_candidate_cell_local_energy_decay hc Jprobe D E K hK obtain ⟨S₀,hS₀,hfourier⟩ := hsource jStar hjStar ((2*D+E+2)+2*q+K+1) Jprobe ell Cb Tmod Sshift Cmod Sfreq (K+q) W refine ⟨q,hq,S₀,hS₀,?_⟩ intro S hS filter_upwards [henergy S (hS₀.trans hS),hfourier S hS,hcell, eventually_actual_occupied_source_cell_scale hc hdSource Jprobe K q hq, eventually_ge_atTop (1 : ℝ)] with L he hf hcell hscale hL intro rQ hrQ hj take hkeep ξ cut big g kPeel hkPeel hgb hgSmall b₀ b₁ hb₀ hb₁ lo hi κM ν₀ ν₁ qM hqMInst χM hκM hκmax hqM hν₀ hν₁ σ qQ hqQInst χQ hqQ hσ P₀ mass marks pool α₀ α₁ β γ F₀ G₀ groups hgroups P V probes r t A B hA hAne hB hBne hAbig hU hAB k hk hkB Q h hh hh1 d e χ ψ a b v Z hZpos ha hv HA HB Y hlog hproduct have hYpos : 0 < Y := mul_pos hZpos (mul_pos (Real.exp_pos _) (Real.exp_pos _)) have hnonneg : 0 ≤ Y*L^(-D) := mul_nonneg hYpos.le (Real.rpow_nonneg (zero_le_one.trans hL) _) by_cases hx : ∃ x : (∀ i : A, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (x i).val) ≠ 0 · by_cases hy : ∃ y : (∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (y i).val) ≠ 0 · obtain ⟨x,hx0⟩ := hx obtain ⟨y,hy0⟩ := hy have hkAbs : |(k : ℝ)| ≤ L^K := by simpa only [Nat.cast_natAbs,Int.cast_abs] using hkB have hs := hscale groups hgroups ell probes r t A B hA hAne hB hBne hAbig Q h hh hh1 d e χ ψ (-(a+b+2*Real.pi*v)) x y hx0 hy0 k hk hkAbs Z hZpos (hproduct x y hx0 hy0) have he₀ := he rQ jStar hrQ hj take hkeep ξ cut big g kPeel hkPeel hgb b₀ hb₀ lo hi κM ν₀ qM χM hκM hκmax σ qQ χQ Y hs.2.1 hlog Z a b (2*Real.pi*v) have he₁ := he rQ jStar hrQ hj take hkeep ξ cut big g kPeel hkPeel hgb b₁ hb₁ lo hi κM ν₁ qM χM hκM hκmax σ qQ χQ Y hs.2.1 hlog Z a b (2*Real.pi*v) apply hcell groups hgroups ell probes r t A B hA hAne hB hBne hU hAB k hk hkB Q h hh hh1 d e χ ψ a b v Y Z F₀ G₀ hYpos he₀.1 he₁.2 intro _ _ qRat hqRat0 hqRat aRat exact @hf rQ hrQ hj take hkeep ξ cut big g kPeel hkPeel hgb hgSmall b₀ hb₀ lo hi κM ν₀ qM hqMInst χM hκM hκmax hqM hν₀ σ qQ hqQInst χQ hqQ hσ Y (|(k : ℝ)| *(HA*HB)/L^q) Z a (2*Real.pi*v) hs.1 hlog hs.2.2.2.1 hs.2.2.2.2 hZpos ha hv qRat hqRat0 hqRat aRat · rw [candidate_cell_aux_sum_eq_zero_of_no_right P V A B hU hAB k Q h d e χ ψ Y Z a b v F₀ G₀ hy, norm_zero] exact hnonneg · rw [candidate_cell_aux_sum_eq_zero_of_no_left P V A B hU hAB k Q h d e χ ψ Y Z a b v F₀ G₀ hx, norm_zero] exact hnonneg end Bounty.WeakZeroFree -- Source module: ActualRoughCellLocalEnergy /- The original rough peeled endpoints satisfy the comparison-cell estimate. The source and target energies and rational local source bound are discharged. -/ open Finset Filter MeasureTheory open scoped ComplexConjugate namespace Bounty.WeakZeroFree theorem exists_actual_rough_cell_local_energy_decay (hZ : PrimitiveZeroFreeRightOf (23 / 24)) {c dSource γrough vMax ρ : ℝ} (hc : 0 < c) (hdSource : 0 < dSource) (hγ : 0 < γrough) (hv : vMax < 1) (hρ : 0 < ρ) : ∃ J : ℕ, ∀ jStar : ℕ, J < jStar → ∀ (D : ℝ) (Jprobe ell : ℕ) (Cb K Tmod Sshift Cmod Sfreq W : ℝ), 0 ≤ K → ∃ q : ℝ, 0 ≤ q ∧ ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (rQ : ℕ) (hrQ : 0 < rQ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*rQ) → Bool) (hkeep : take ((candidateAllocationOrder c L rQ).symm (candidateRoughSlot c L rQ jStar hrQ hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L rQ jStar) → ℝ) (cut : candidatePIndices c L → Finset (Fin Jprobe)) (big : Finset (candidatePIndices c L)) (g : candidatePIndices c L) (kPeel : ℕ), ell+(cut g).card = kPeel+1 → g ∉ big → g.val ∈ candidateSmallPIndices c L → ∀ (b₀ b₁ : GroupMarkedLists (fun j : big => candidatePBand (c*L) j.val.val) (fun j : big => ell+(cut j.val).card) → ℂ), (∀ l, ‖b₀ l‖ ≤ L^Cb) → (∀ l, ‖b₁ l‖ ≤ L^Cb) → ∀ (lo hi : ℕ) (aM vM ν₀ ν₁ : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), vM ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν₀| ≤ L^Sfreq → |ν₁| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → let P₀ := fun j : candidatePIndices c L => candidatePBand (c*L) j.val let mass := fun j : candidatePIndices c L => ∑ p ∈ P₀ j, 1/(p : ℝ) let marks := fun j : candidatePIndices c L => ell+(cut j).card let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let α₀ := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₀ n) let α₁ := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₁ n) let β := fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L rQ jStar hrQ hj take hkeep (candidateAllocationFourierTwist c L rQ jStar take ξ) n) let F₀ := fun n : ℤ => selectedPeeledEndpoint P₀ (1/2) mass marks g kPeel big b₀ pool α₀ β γ n.natAbs let G₀ := fun n : ℤ => selectedPeeledEndpoint P₀ (1/2) mass marks g kPeel big b₁ pool α₁ β γ n.natAbs ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → let P := fun j : groups => candidatePBand (c*L) j.val let V := fun j : groups => ∑ p ∈ P j, 1/(p : ℝ) ∀ (probes : groups → Finset (Fin Jprobe)) (r t : Finset groups) (A B : Finset (RepeatedBigFlatIndex groups Jprobe ell)), A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes) → A.Nonempty → B ⊆ t.sigma (repeatedBigPrimeProbeSlots probes) → B.Nonempty → (∃ i : A, i.val.1.val ∈ candidateBigPIndices c L) → ∀ (hU : ∀ j (i : Fin ell), (⟨j, Sum.inr i⟩ : RepeatedBigFlatIndex groups Jprobe ell) ∉ A ∪ B) (hAB : Disjoint A B) (k : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L^K → ∀ (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (a b v Z : ℝ), 0 < Z → |a| ≤ L^W → |2*Real.pi*v| ≤ L^W → let HA := Real.exp (((d : ℝ)-1)*h) let HB := Real.exp (((e : ℝ)-1)*h) let Y := Z*(HA*HB) Real.log Y ≤ 6*L → (∀ (x : ∀ i : A, P i.val.1) (y : ∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (x i).val) ≠ 0 → (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (y i).val) ≠ 0 → Real.exp (2*dSource*L) ≤ Z*((((∏ i, (x i).val)*(∏ i, (y i).val)) : ℕ) : ℝ)/2) → ‖∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * ((starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1) * (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2)) * physicalPhase (-(a+b+2*Real.pi*v)) (physicalFreeFactor (repeatedBigAuxCut A B) aux) * harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)) F₀ G₀‖ ≤ Y*L^(-D) := by classical obtain ⟨J,hsource⟩ := exists_actual_peeled_rough_source_fourier_precision hZ hc hdSource hγ hv hρ refine ⟨J,?_⟩ intro jStar hjStar D Jprobe ell Cb K Tmod Sshift Cmod Sfreq W hK obtain ⟨E,henergy⟩ := exists_actual_rough_peeled_source_energy hc hγ Jprobe ell Cb obtain ⟨q,hq,hcell⟩ := exists_candidate_cell_local_energy_decay hc Jprobe D E K hK obtain ⟨S₀,hS₀,hfourier⟩ := hsource jStar hjStar ((2*D+E+2)+2*q+K+1) Jprobe ell Cb Tmod Sshift Cmod Sfreq (K+q) W refine ⟨q,hq,S₀,hS₀,?_⟩ intro S hS filter_upwards [henergy,hfourier S hS,hcell, eventually_actual_occupied_source_cell_scale hc hdSource Jprobe K q hq, eventually_ge_atTop (1 : ℝ)] with L he hf hcell hscale hL intro rQ hrQ hj take hkeep ξ cut big g kPeel hkPeel hgb hgSmall b₀ b₁ hb₀ hb₁ lo hi aM vM ν₀ ν₁ qM hqMInst χM hvM hqM hν₀ hν₁ σ qQ hqQInst χQ hqQ hσ P₀ mass marks pool α₀ α₁ β γ F₀ G₀ groups hgroups P V probes r t A B hA hAne hB hBne hAbig hU hAB k hk hkB Q h hh hh1 d e χ ψ a b v Z hZpos ha hv HA HB Y hlog hproduct have hYpos : 0 < Y := mul_pos hZpos (mul_pos (Real.exp_pos _) (Real.exp_pos _)) have hnonneg : 0 ≤ Y*L^(-D) := mul_nonneg hYpos.le (Real.rpow_nonneg (zero_le_one.trans hL) _) by_cases hx : ∃ x : (∀ i : A, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (x i).val) ≠ 0 · by_cases hy : ∃ y : (∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y) * physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (y i).val) ≠ 0 · obtain ⟨x,hx0⟩ := hx obtain ⟨y,hy0⟩ := hy have hkAbs : |(k : ℝ)| ≤ L^K := by simpa only [Nat.cast_natAbs,Int.cast_abs] using hkB have hs := hscale groups hgroups ell probes r t A B hA hAne hB hBne hAbig Q h hh hh1 d e χ ψ (-(a+b+2*Real.pi*v)) x y hx0 hy0 k hk hkAbs Z hZpos (hproduct x y hx0 hy0) have he₀ := he rQ jStar hrQ hj take hkeep ξ cut big g kPeel hkPeel hgb b₀ hb₀ lo hi S aM vM ν₀ qM χM σ qQ χQ Y hs.2.1 hlog Z a b (2*Real.pi*v) have he₁ := he rQ jStar hrQ hj take hkeep ξ cut big g kPeel hkPeel hgb b₁ hb₁ lo hi S aM vM ν₁ qM χM σ qQ χQ Y hs.2.1 hlog Z a b (2*Real.pi*v) apply hcell groups hgroups ell probes r t A B hA hAne hB hBne hU hAB k hk hkB Q h hh hh1 d e χ ψ a b v Y Z F₀ G₀ hYpos he₀.1 he₁.2 intro _ _ qRat hqRat0 hqRat aRat exact @hf rQ hrQ hj take hkeep ξ cut big g kPeel hkPeel hgb hgSmall b₀ hb₀ lo hi aM vM ν₀ qM hqMInst χM hvM hqM hν₀ σ qQ hqQInst χQ hqQ hσ Y (|(k : ℝ)| *(HA*HB)/L^q) Z a (2*Real.pi*v) hs.1 hlog hs.2.2.2.1 hs.2.2.2.2 hZpos ha hv qRat hqRat0 hqRat aRat · rw [candidate_cell_aux_sum_eq_zero_of_no_right P V A B hU hAB k Q h d e χ ψ Y Z a b v F₀ G₀ hy, norm_zero] exact hnonneg · rw [candidate_cell_aux_sum_eq_zero_of_no_left P V A B hU hAB k Q h d e χ ψ Y Z a b v F₀ G₀ hx, norm_zero] exact hnonneg end Bounty.WeakZeroFree end section -- Source module: WeakActualOriginalDecay /- Original harmonic decay with the actual weaker zero-free input. -/ open scoped Topology BigOperators Classical -- Source module: PrimeAuxCellCoefficient /- The exact auxiliary cell coefficients have total absolute mass at most one and preserve the occupied cell scale. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalPrimeCellAuxCoeff {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (h : ℝ) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (e : ℤ) (ψ : BoundedPrimitiveCharacter Q) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : ℂ := (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * star (primeProductCellCharacter (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1) * star (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2) theorem physical_prime_cell_aux_mass {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (h : ℝ) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (e : ℤ) (ψ : BoundedPrimitiveCharacter Q) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) : (∑ aux, ‖physicalPrimeCellAuxCoeff P V A B hU hAB h d χ e ψ aux‖) ≤ 1 := by calc _ ≤ ∑ aux, physicalAuxMass V (repeatedBigAuxCut A B) aux := by apply sum_le_sum intro aux _ have hm := physical_aux_mass_nonneg V (repeatedBigAuxCut A B) (fun g => (hV g).le) aux have ha := prime_product_cell_character_norm (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 have hb := prime_product_cell_character_norm (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 simp only [physicalPrimeCellAuxCoeff, norm_mul, norm_star, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hm] exact (mul_le_mul (mul_le_mul_of_nonneg_left ha hm) hb (norm_nonneg _) (mul_nonneg hm zero_le_one)).trans_eq (by ring) _ = 1 := physical_aux_mass_sum V (repeatedBigAuxCut A B) hV hMass theorem physical_prime_cell_aux_scale {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) {h : ℝ} (hh : 0 < h) (hh1 : h ≤ 1) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (e : ℤ) (ψ : BoundedPrimitiveCharacter Q) (hP : ∀ g, ∀ p ∈ P g, 0 < p) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) (hc : physicalPrimeCellAuxCoeff P V A B hU hAB h d χ e ψ aux ≠ 0) : harmonicCellProductScale h d e ≤ (physicalFreeFactor (repeatedBigAuxCut A B) aux : ℝ) ∧ (physicalFreeFactor (repeatedBigAuxCut A B) aux : ℝ) ≤ Real.exp 2*harmonicCellProductScale h d e := by have hca : primeProductCellCharacter (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 ≠ 0 := by intro hz exact hc (by simp only [physicalPrimeCellAuxCoeff, hz, star_zero, mul_zero, zero_mul]) have hcb : primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 ≠ 0 := by intro hz exact hc (by simp only [physicalPrimeCellAuxCoeff, hz, star_zero, mul_zero]) have hpA : 0 < ∏ i : A, ((repeatedBigAuxSplitEquiv P A B hU hAB aux).1 i).val := prod_pos (fun i _ => hP i.val.1 _ ((repeatedBigAuxSplitEquiv P A B hU hAB aux).1 i).property) have hpB : 0 < ∏ i : B, ((repeatedBigAuxSplitEquiv P A B hU hAB aux).2 i).val := prod_pos (fun i _ => hP i.val.1 _ ((repeatedBigAuxSplitEquiv P A B hU hAB aux).2 i).property) have heq : physicalFreeFactor (repeatedBigAuxCut A B) aux = (∏ i : A, ((repeatedBigAuxSplitEquiv P A B hU hAB aux).1 i).val) * (∏ i : B, ((repeatedBigAuxSplitEquiv P A B hU hAB aux).2 i).val) := by have he := repeatedBigAuxSplitEquiv_symm_label_prod P A B hU hAB (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 simpa only [physicalFreeFactor, Prod.eta, Equiv.symm_apply_apply] using he rw [heq] have hs := harmonic_cell_product_bounds hh hh1 hpA hpB (prime_cell_character_mem _ h d χ _ hca) (prime_cell_character_mem _ h e ψ _ hcb) exact ⟨hs.1.le, hs.2⟩ end Bounty -- Source module: PrimeAuxHarmonicFamily /- The exact finite harmonic family attached to a retained pair of prime cells. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalPrimeCellHarmonicFamily {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (h : ℝ) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (e : ℤ) (ψ : BoundedPrimitiveCharacter Q) (a b Z : ℝ) (k : ℤ) (F G : ℤ → ℂ) : ℂ := ∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), physicalPrimeCellAuxCoeff P V A B hU hAB h d χ e ψ aux * (physicalPhase (-(a+b)) (physicalFreeFactor (repeatedBigAuxCut A B) aux) * ∑ n ∈ harmonicPositiveSupport Z k (physicalFreeFactor (repeatedBigAuxCut A B) aux), ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℝ))) : ℂ)/(n : ℂ))* physicalPhase a n.natAbs* physicalPhase b (n+k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)).natAbs* star (F n)*G (n+k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ))) end Bounty -- Source module: PrimeAuxFamilyPerturbation /- A uniform finite harmonic replacement error survives the exact auxiliary probability average. -/ open Finset open scoped Classical namespace Bounty theorem physical_prime_cell_family_perturbation {Gt : Type*} [Fintype Gt] [DecidableEq Gt] {J ell : ℕ} (P : Gt → Finset ℕ) (V : Gt → ℝ) (A B : Finset (RepeatedBigFlatIndex Gt J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex Gt J ell) ∉ A ∪ B) (hAB : Disjoint A B) (h : ℝ) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (e : ℤ) (ψ : BoundedPrimitiveCharacter Q) (a b Z : ℝ) (k : ℤ) (F G F' G' : ℤ → ℂ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) {ε : ℝ} (hε : 0 ≤ ε) (herr : ∀ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), let m := physicalFreeFactor (P := P) (repeatedBigAuxCut A B) aux ‖(∑ n ∈ harmonicPositiveSupport Z k m, (physicalPhasedHarmonicCutoff a b Z k m n/(n : ℂ))*star (F n)*G (n+k*(m : ℤ))) - (∑ n ∈ harmonicPositiveSupport Z k m, (physicalPhasedHarmonicCutoff a b Z k m n/(n : ℂ))*star (F' n)*G' (n+k*(m : ℤ)))‖ ≤ ε) : ‖physicalPrimeCellHarmonicFamily P V A B hU hAB h d χ e ψ a b Z k F G - physicalPrimeCellHarmonicFamily P V A B hU hAB h d χ e ψ a b Z k F' G'‖ ≤ ε := by let c := physicalPrimeCellAuxCoeff P V A B hU hAB h d χ e ψ let m := physicalFreeFactor (P := P) (repeatedBigAuxCut A B) have hsum (F G : ℤ → ℂ) : physicalPrimeCellHarmonicFamily P V A B hU hAB h d χ e ψ a b Z k F G = ∑ aux, c aux*physicalPhase (-(a+b)) (m aux) * ∑ n ∈ harmonicPositiveSupport Z k (m aux), (physicalPhasedHarmonicCutoff a b Z k (m aux) n/(n : ℂ))*star (F n)*G (n+k*(m aux : ℤ)) := by unfold physicalPrimeCellHarmonicFamily apply sum_congr rfl intro aux _ dsimp only [c, m] simp only [mul_assoc] congr 1 congr 1 apply sum_congr rfl intro n _ dsimp only [physicalPhasedHarmonicCutoff, m] ring rw [hsum F G, hsum F' G', ← sum_sub_distrib] calc _ ≤ ∑ aux, ‖c aux*physicalPhase (-(a+b)) (m aux) * (∑ n ∈ harmonicPositiveSupport Z k (m aux), (physicalPhasedHarmonicCutoff a b Z k (m aux) n/(n : ℂ))*star (F n)*G (n+k*(m aux : ℤ))) - c aux*physicalPhase (-(a+b)) (m aux) * (∑ n ∈ harmonicPositiveSupport Z k (m aux), (physicalPhasedHarmonicCutoff a b Z k (m aux) n/(n : ℂ))*star (F' n)*G' (n+k*(m aux : ℤ)))‖ := norm_sum_le _ _ _ ≤ ∑ aux, ‖c aux‖*ε := by apply sum_le_sum intro aux _ rw [← mul_sub, norm_mul, norm_mul, physical_phase_norm, mul_one] exact mul_le_mul_of_nonneg_left (herr aux) (norm_nonneg _) _ = (∑ aux, ‖c aux‖)*ε := (sum_mul ..).symm _ ≤ 1*ε := mul_le_mul_of_nonneg_right (physical_prime_cell_aux_mass P V A B hU hAB h d χ e ψ hV hMass) hε _ = ε := one_mul _ end Bounty -- Source module: CandidateAuxCellPeel /- The marked-to-peeled approximation is uniform before the exact auxiliary cell average, on all original candidate groups. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_aux_cell_peel {c bWindow Kdet : ℝ} (hc : 0 < c) (hb : 0 < bWindow) (hK : 0 ≤ Kdet) (J ell : ℕ) (Ce D : ℝ) : ∀ᶠ L : ℝ in atTop, let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) ∀ (A B : Finset (RepeatedBigFlatIndex (candidatePIndices c L) J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex (candidatePIndices c L) J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (d : ℤ) (χ : BoundedPrimitiveCharacter Q) (e : ℤ) (ψ : BoundedPrimitiveCharacter Q), let cut := repeatedBigAuxCut A B let marks := fun g => ell+(cut g).card ∀ (big : Finset (candidatePIndices c L)) (g : candidatePIndices c L) (κ : ℕ), marks g = κ+1 → g ∉ big → (∀ j, 0 < mass j) → ∀ (b₀ b₁ : GroupMarkedLists (fun j : big => P j.val) (fun j : big => marks j.val) → ℂ), (∀ u, ‖b₀ u‖ ≤ 1) → (∀ u, ‖b₁ u‖ ≤ 1) → ∀ (pool : Finset ℕ), (∀ j, P j ⊆ pool) → ∀ (α₀ β₀ γ₀ α₁ β₁ γ₁ : ℕ → ℂ), (∀ n, ¬ Disjoint n.primeFactors pool → α₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → α₁ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₁ n = 0) → (∀ n, ‖α₀ n‖ ≤ L^Ce) → (∀ n, ‖β₀ n‖ ≤ L^Ce) → (∀ n, ‖γ₀ n‖ ≤ L^Ce) → (∀ n, ‖α₁ n‖ ≤ L^Ce) → (∀ n, ‖β₁ n‖ ≤ L^Ce) → (∀ n, ‖γ₁ n‖ ≤ L^Ce) → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ a b : ℝ, let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j let F := fun n : ℤ => selectedMarkedEndpoint P (1/2) mass marks big b₀ pool α₀ β₀ γ₀ n.natAbs let G := fun n : ℤ => selectedMarkedEndpoint P (1/2) mass marks big b₁ pool α₁ β₁ γ₁ n.natAbs let F' := fun n : ℤ => selectedPeeledEndpoint P (1/2) mass marks g κ big b₀ pool α₀ β₀ γ₀ n.natAbs let G' := fun n : ℤ => selectedPeeledEndpoint P (1/2) mass marks g κ big b₁ pool α₁ β₁ γ₁ n.natAbs ‖physicalPrimeCellHarmonicFamily P mass A B hU hAB h d χ e ψ a b Z k F G - physicalPrimeCellHarmonicFamily P mass A B hU hAB h d χ e ψ a b Z k F' G'‖ ≤ L^(-D) := by filter_upwards [eventually_candidate_selected_harmonic_peel_decay hc hb hK J ell 0 Ce D, eventually_gt_atTop (0 : ℝ)] with L hpeel hL intro P mass A B hU hAB Q h d χ e ψ cut marks big g κ hκ hg hmass b₀ b₁ hb₀ hb₁ pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ U V hUlo hUhi hVlo hVhi k hk j hj a b Z F G F' G' apply physical_prime_cell_family_perturbation P mass A B hU hAB h d χ e ψ a b Z k F G F' G' hmass (fun _ => rfl) (Real.rpow_pos_of_pos hL _).le intro aux exact hpeel (candidatePIndices c L) (subset_refl _) cut aux big g κ hκ hg b₀ b₁ (by simpa only [Real.rpow_zero] using hb₀) (by simpa only [Real.rpow_zero] using hb₁) pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ U V hUlo hUhi hVlo hVhi k hk j hj (physicalPhasedHarmonicCutoff a b Z k (physicalFreeFactor cut aux)) (fun n _ => physical_phased_harmonic_cutoff_bound a b Z k (physicalFreeFactor cut aux) n) end Bounty -- Source module: HarmonicFamilyTruncation /- The signed auxiliary average keeps its cancellation on the central interval. -/ open Finset MeasureTheory namespace Bounty theorem harmonic_cell_family_truncation {ι : Type*} {Z H : ℝ} (hZ : 0 < Z) (hH : 0 < H) (I : Finset ι) (c : ι → ℂ) (d : ι → ℕ) (hscale : ∀ i ∈ I, c i ≠ 0 → H ≤ (d i : ℝ) ∧ (d i : ℝ) ≤ Real.exp 2*H) {k : ℤ} (hk : |(k : ℝ)| ≤ Z/4) (a b : ℝ) (F G : ℤ → ℂ) (R : ℝ) : ‖(∑ i ∈ I, c i * (physicalPhase (-(a+b)) (d i) * ∑ n ∈ harmonicPositiveSupport Z k (d i), ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d i : ℝ))) : ℂ)/(n : ℂ))* physicalPhase a n.natAbs*physicalPhase b (n+k*(d i : ℤ)).natAbs* star (F n)*G (n+k*(d i : ℤ)))) - ((Z*H : ℝ) : ℂ)⁻¹ * ∫ v in {v : ℝ | ‖v‖ ≤ R}, harmonicLogFourier v * ∑ i ∈ I, c i*physicalPhase (-(a+b+2*Real.pi*v)) (d i)* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d i : ℤ)) F G‖ ≤ (∫ v in {v : ℝ | R < ‖v‖}, ‖harmonicLogFourier v‖) * ∑ i ∈ I, ‖c i‖ * ∑ n ∈ harmonicCommonSupport (Z*H), ‖harmonicCellCoefficient (Z*H) a b (d i) (k*(d i : ℤ)) F G n‖ := by let mass := fun i => ∑ n ∈ harmonicCommonSupport (Z*H), ‖harmonicCellCoefficient (Z*H) a b (d i) (k*(d i : ℤ)) F G n‖ have hY : 0 < Z*H := mul_pos hZ hH have hn (v : ℝ) : ‖((Z*H : ℝ) : ℂ)⁻¹ * (harmonicLogFourier v * ∑ i ∈ I, c i*physicalPhase (-(a+b+2*Real.pi*v)) (d i)* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d i : ℤ)) F G)‖ ≤ ‖harmonicLogFourier v‖ * ∑ i ∈ I, ‖c i‖*mass i := by rw [mul_sum, mul_sum] refine (norm_sum_le _ _).trans ?_ rw [mul_sum] apply sum_le_sum intro i hi by_cases hc : c i = 0 · simp only [hc, zero_mul, mul_zero, norm_zero, le_refl] · have hd : d i ≠ 0 := by have hpos : (0 : ℝ) < d i := hH.trans_le (hscale i hi hc).1 exact_mod_cast hpos.ne' calc _ = ‖c i‖ * ‖((Z*H : ℝ) : ℂ)⁻¹ * (harmonicLogFourier v*physicalPhase (-(a+b+2*Real.pi*v)) (d i)* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d i : ℤ)) F G)‖ := by rw [← norm_mul] congr 1 ring _ ≤ ‖c i‖ * (‖harmonicLogFourier v‖ * mass i) := mul_le_mul_of_nonneg_left (harmonic_cell_normalized_integrand_norm hY hZ.ne' hd a b (k*(d i : ℤ)) F G v) (norm_nonneg _) _ = _ := by ring have hs : MeasurableSet {v : ℝ | ‖v‖ ≤ R} := (isClosed_le continuous_norm continuous_const).measurableSet have heq : {v : ℝ | ‖v‖ ≤ R}ᶜ = {v : ℝ | R < ‖v‖} := by ext v; simp rw [harmonic_cell_family_sum_eq_mellin hZ hH I c d hscale hk a b F G, ← integral_const_mul, ← integral_const_mul, ← setIntegral_compl hs ((harmonic_cell_family_integrable hZ hH I c d hscale a b k F G).const_mul _), heq] calc _ ≤ ∫ v in {v : ℝ | R < ‖v‖}, ‖harmonicLogFourier v‖ * ∑ i ∈ I, ‖c i‖*mass i := norm_integral_le_of_norm_le ((harmonic_log_fourier_integrable.norm.mul_const _).integrableOn) (Filter.Eventually.of_forall hn) _ = _ := integral_mul_const _ _ end Bounty -- Source module: HarmonicFamilyDecay /- Arbitrary decay of the original signed family from central cancellation and polynomial tail mass. -/ open Finset MeasureTheory Filter namespace Bounty theorem eventually_harmonic_cell_family_decay {r : ℝ} (hr : 0 < r) (C D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ {ι : Type*} (Z H : ℝ) (I : Finset ι) (c : ι → ℂ) (d : ι → ℕ) (k : ℤ) (a b : ℝ) (F G : ℤ → ℂ), 0 < Z → 0 < H → (∀ i ∈ I, c i ≠ 0 → H ≤ (d i : ℝ) ∧ (d i : ℝ) ≤ Real.exp 2*H) → |(k : ℝ)| ≤ Z/4 → (∑ i ∈ I, ‖c i‖ * ∑ n ∈ harmonicCommonSupport (Z*H), ‖harmonicCellCoefficient (Z*H) a b (d i) (k*(d i : ℤ)) F G n‖) ≤ L^C → (∀ v : ℝ, ‖v‖ ≤ L^r → ‖∑ i ∈ I, c i*physicalPhase (-(a+b+2*Real.pi*v)) (d i)* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d i : ℤ)) F G‖ ≤ (Z*H)*L^(-(D+2))) → ‖∑ i ∈ I, c i * (physicalPhase (-(a+b)) (d i) * ∑ n ∈ harmonicPositiveSupport Z k (d i), ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d i : ℝ))) : ℂ)/(n : ℂ))* physicalPhase a n.natAbs*physicalPhase b (n+k*(d i : ℤ)).natAbs* star (F n)*G (n+k*(d i : ℤ)))‖ ≤ L^(-D) := by filter_upwards [eventually_ge_atTop (2 : ℝ), eventually_harmonic_mellin_tail_power hr C (D+1), eventually_harmonic_central_integral_decay (D+1)] with L hL ht hc intro ι Z H I c d k a b F G hZ hH hscale hk hmass hcentral let S := ∑ i ∈ I, c i * (physicalPhase (-(a+b)) (d i) * ∑ n ∈ harmonicPositiveSupport Z k (d i), ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d i : ℝ))) : ℂ)/(n : ℂ))* physicalPhase a n.natAbs*physicalPhase b (n+k*(d i : ℤ)).natAbs* star (F n)*G (n+k*(d i : ℤ))) let A := fun v : ℝ => ∑ i ∈ I, c i*physicalPhase (-(a+b+2*Real.pi*v)) (d i)* harmonicCellPairing (Z*H) Z a b (2*Real.pi*v) (k*(d i : ℤ)) F G let T := ((Z*H : ℝ) : ℂ)⁻¹ * ∫ v in {v : ℝ | ‖v‖ ≤ L^r}, harmonicLogFourier v*A v have htail : ‖S-T‖ ≤ L^(-(D+1)) := (harmonic_cell_family_truncation hZ hH I c d hscale hk a b F G (L^r)).trans (ht _ (by positivity) hmass) have hcent : ‖T‖ ≤ L^(-(D+1)) := by apply hc (Z*H) (L^r) A (mul_pos hZ hH) intro v hv simpa only [show D+1+1 = D+2 by ring] using hcentral v hv have hL0 : 0 < L := lt_of_lt_of_le (by norm_num) hL change ‖S‖ ≤ _ calc ‖S‖ = ‖(S-T)+T‖ := by congr 1; ring _ ≤ ‖S-T‖+‖T‖ := norm_add_le _ _ _ ≤ L^(-(D+1))+L^(-(D+1)) := add_le_add htail hcent _ ≤ L*L^(-(D+1)) := by nlinarith [Real.rpow_pos_of_pos hL0 (-(D+1))] _ = L^(-D) := by calc _ = L^(1 : ℝ)*L^(-(D+1)) := by rw [Real.rpow_one] _ = _ := by rw [← Real.rpow_add hL0]; congr 1; ring end Bounty -- Source module: HarmonicFamilyMass /- Polynomial endpoint energies control the absolute mass used only for the tail. -/ open Finset Real namespace Bounty end Bounty -- Source module: PrimeAuxCellDecay /- Central cancellation and individual cutoff energies imply decay of the original auxiliary cell family. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty -- Source module: PrimeRetainedAuxDecay /- Absorb the exact outer inverse cell masses and character sums after auxiliary cancellation. -/ open Finset Filter open scoped Classical namespace Bounty end Bounty -- Source module: PrimeRetainedFamilyDifference /- The same retained-cell cost controls the difference of two exact endpoint families. -/ open Finset open scoped Classical namespace Bounty theorem prime_retained_harmonic_families_close {Gt : Type*} [Fintype Gt] [DecidableEq Gt] {J ell : ℕ} (P : Gt → Finset ℕ) (V : Gt → ℝ) (A B' : Finset (RepeatedBigFlatIndex Gt J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex Gt J ell) ∉ A ∪ B') (hAB : Disjoint A B') {Q : ℕ} {L B C R D : ℝ} (hL : 3 ≤ L) (hB : 0 ≤ B) (hQ : (Q : ℝ) ≤ L^R) (hPA : ∀ x : (∀ i : A, P i.val.1), 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L) (hPB : ∀ x : (∀ i : B', P i.val.1), 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L) (a b Z : ℝ) (k : ℤ) (F G F' G' : ℤ → BoundedPrimitiveCharacter Q → ℤ → ℂ) : let h := L^(-B) let kept := fun U : Finset (RepeatedBigFlatIndex Gt J ell) => primeProductRetainedCells (fun i : U => P i.val.1) (fun i => V i.val.1) h (L^(-C)) let mA := fun d => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) d : ℝ) : ℂ) let mB := fun e => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : B' => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) e : ℝ) : ℂ) (∀ d ∈ kept A, ∀ χ, ∀ e ∈ kept B', ∀ ψ, ‖physicalPrimeCellHarmonicFamily P V A B' hU hAB h d χ e ψ a b Z k (F e ψ) (G d χ) - physicalPrimeCellHarmonicFamily P V A B' hU hAB h d χ e ψ a b Z k (F' e ψ) (G' d χ)‖ ≤ L^(-(D+2*(B+C+2*R+2)))) → ‖(∑ d ∈ kept A, ∑ χ : BoundedPrimitiveCharacter Q, ∑ e ∈ kept B', ∑ ψ : BoundedPrimitiveCharacter Q, mA d*mB e*physicalPrimeCellHarmonicFamily P V A B' hU hAB h d χ e ψ a b Z k (F e ψ) (G d χ)) - (∑ d ∈ kept A, ∑ χ : BoundedPrimitiveCharacter Q, ∑ e ∈ kept B', ∑ ψ : BoundedPrimitiveCharacter Q, mA d*mB e*physicalPrimeCellHarmonicFamily P V A B' hU hAB h d χ e ψ a b Z k (F' e ψ) (G' d χ))‖ ≤ L^(-D) := by intro h kept mA mB herr have he := prime_retained_pair_cell_decay (fun i : A => P i.val.1) (fun i => V i.val.1) (fun i : B' => P i.val.1) (fun i => V i.val.1) hL hB hQ zero_le_one hPA hPB (fun d χ e ψ => physicalPrimeCellHarmonicFamily P V A B' hU hAB h d χ e ψ a b Z k (F e ψ) (G d χ) - physicalPrimeCellHarmonicFamily P V A B' hU hAB h d χ e ψ a b Z k (F' e ψ) (G' d χ)) (fun d hd χ e he ψ => by simpa only [one_mul] using herr d hd χ e he ψ) simpa only [mul_sub, sum_sub_distrib, one_mul] using he end Bounty -- Source module: FiniteCellHarmonicLift /- Lifting an exact finite cell expansion to a phased harmonic finite sum. -/ open Finset open scoped Classical namespace Bounty theorem finite_cell_harmonic_lift {G ι : Type*} [Fintype G] (P : G → Finset ℕ) (marks : G → ℕ) (cells : Finset ι) (f g : ι → GroupMarkedLists P marks → ℂ) (coeff : ι → ℂ) (W : ℕ → ℝ) (K : ℕ → ℕ → ℂ) (hK : ∀ w z, K w z = ∑ i ∈ cells, coeff i * (((W w : ℂ)*groupMarkedAverage P marks (w : ℤ) (f i)) * ((W z : ℂ)*groupMarkedAverage P marks (z : ℤ) (g i)))) (T : Finset ℤ) (w z : ℤ → ℕ) (θ : ℤ → ℂ) (F H : ℕ → ℂ) (a b : ℝ) (C : ℂ) : (∑ n ∈ T, θ n*star (F (w n))*H (z n)* (C*physicalPhase a (w n)*physicalPhase b (z n)*K (w n) (z n))) = C*∑ i ∈ cells, coeff i*∑ n ∈ T, θ n* star (physicalPhase (-a) (w n)* ((W (w n) : ℂ)*groupMarkedAverage P marks (w n : ℤ) (fun u => star (f i u))*F (w n)))* (physicalPhase b (z n)* ((W (z n) : ℂ)*groupMarkedAverage P marks (z n : ℤ) (g i)*H (z n))) := by simp_rw [hK] simp only [mul_sum] rw [sum_comm] apply sum_congr rfl intro i hi apply sum_congr rfl intro n hn have hp := selected_marked_phased_pair P marks (f i) (g i) (w n) (z n) (W (w n)) (W (z n)) a b (C*coeff i) (θ n) (F (w n)) (H (z n)) ((C*coeff i)*physicalPhase a (w n)*physicalPhase b (z n)* ((W (w n) : ℂ)*groupMarkedAverage P marks (w n : ℤ) (f i))* ((W (z n) : ℂ)*groupMarkedAverage P marks (z n : ℤ) (g i))) rfl convert hp using 1 <;> ring end Bounty -- Source module: PrimeCellsHarmonic /- Exact cell-dependent endpoints in the original two-sided prime average. -/ open Finset open scoped Classical namespace Bounty theorem physical_prime_cells_harmonic {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (S : Finset G) (hA : ∀ i ∈ A, i.1 ∈ S) (hB : ∀ i ∈ B, i.1 ∈ S) (q : ℝ) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) (T : Finset ℤ) (w z : ℤ → ℕ) (θ : ℤ → ℂ) (F H : ℕ → ℂ) (a b : ℝ) (C : ℂ) : let marks := fun g => ell + (repeatedBigAuxCut A B g).card let W := fun n : ℕ => markedDivisorWeight univ P q V marks n let cells := (keptA ×ˢ (univ : Finset (BoundedPrimitiveCharacter Q))) ×ˢ (keptB ×ˢ (univ : Finset (BoundedPrimitiveCharacter Q))) let f := fun (j : (ℤ × BoundedPrimitiveCharacter Q) × (ℤ × BoundedPrimitiveCharacter Q)) u => primeProductCellCharacter (fun i : B => P i.val.1) h j.2.1 j.2.2 (physicalSelectedPrimeRestriction A B B subset_union_right S hB u) let g := fun (j : (ℤ × BoundedPrimitiveCharacter Q) × (ℤ × BoundedPrimitiveCharacter Q)) u => primeProductCellCharacter (fun i : A => P i.val.1) h j.1.1 j.1.2 (physicalSelectedPrimeRestriction A B A subset_union_left S hA u) let coeff := fun (j : (ℤ × BoundedPrimitiveCharacter Q) × (ℤ × BoundedPrimitiveCharacter Q)) => ((((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) j.1.1 : ℝ) : ℂ) * ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) j.2.1 : ℝ) : ℂ)) * ((starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h j.1.1 j.1.2 (repeatedBigAuxSplitEquiv P A B hU hAB aux).1) * (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h j.2.1 j.2.2 (repeatedBigAuxSplitEquiv P A B hU hAB aux).2))) (∑ n ∈ T, θ n*star (F (w n))*H (z n)* (C*physicalPhase a (w n)*physicalPhase b (z n)* (((W (w n)*W (z n) : ℝ) : ℂ)*groupMarkedAverage P marks (w n : ℤ) (fun u => groupMarkedAverage P marks (z n : ℤ) (fun v => physicalUnsharedPrimeCoefficient P V A B hU hAB Q h keptA keptB u v aux))))) = C*∑ j ∈ cells, coeff j*∑ n ∈ T, θ n* star (physicalPhase (-a) (w n)* ((W (w n) : ℂ)*groupMarkedAverage (fun i : S => P i.val) (fun i : S => marks i.val) (w n : ℤ) (fun u => star (f j u))*F (w n)))* (physicalPhase b (z n)* ((W (z n) : ℂ)*groupMarkedAverage (fun i : S => P i.val) (fun i : S => marks i.val) (z n : ℤ) (g j)*H (z n))) := by intro marks W cells f g coeff let K := fun x y : ℕ => ((W x*W y : ℝ) : ℂ)*groupMarkedAverage P marks (x : ℤ) (fun u => groupMarkedAverage P marks (y : ℤ) (fun v => physicalUnsharedPrimeCoefficient P V A B hU hAB Q h keptA keptB u v aux)) apply finite_cell_harmonic_lift (fun i : S => P i.val) (fun i : S => marks i.val) cells f g coeff W K _ T w z θ F H a b C intro x y have he := physical_prime_cell_average P V A B hU hAB Q h keptA keptB S hA hB q (x : ℤ) (y : ℤ) aux dsimp only at he simpa only [cells, sum_product] using he end Bounty -- Source module: PrimePatternHarmonicAverage /- The original signed pattern and auxiliary phase stay outside the cell expansion. -/ open Finset open scoped Classical namespace Bounty theorem physical_free_prime_inr_weighted_average {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (ab : RepeatedBigPrimePatternPair (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab))) (a b q : ℝ) (w z : ℕ) : let hv := repeated_big_prime_pattern_pair_valid probes r t hrt ab let cut := repeatedBigPrimePatternCut probes r t (.inr ab) let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ let marks := fun g => ell+(cut g).card let W := fun n : ℕ => markedDivisorWeight univ P q V marks n ((W w*W z : ℝ) : ℂ)*groupMarkedAverage P marks (w : ℤ) (fun u => groupMarkedAverage P marks (z : ℤ) (physicalFreePrimePairCoefficient P V probes r t hrt Q h ξ (.inr ab) aux a b w z u)) = (repeatedBigPrimePatternWeight probes r t (.inr ab)* physicalPhase (-(a+b)) (physicalFreeFactor cut aux))*physicalPhase a w*physicalPhase b z* (((W w*W z : ℝ) : ℂ)*groupMarkedAverage P marks (w : ℤ) (fun u => groupMarkedAverage P marks (z : ℤ) (fun v => physicalUnsharedPrimeCoefficient P V ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 Q h (kept ab.1.val) (kept ab.2.val) u v aux))) := by intro hv cut kept marks W unfold physicalFreePrimePairCoefficient dsimp only [physicalUnsharedPrimePatternKernel, marks, cut, repeatedBigPrimePatternCut] simp only [groupMarkedAverage, mul_sum] apply sum_congr rfl intro u _ apply sum_congr rfl intro v _ dsimp only [kept, hv] ring theorem physical_free_harmonic_inr_average {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (ab : RepeatedBigPrimePatternPair (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab))) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) : let hv := repeated_big_prime_pattern_pair_valid probes r t hrt ab let cut := repeatedBigPrimePatternCut probes r t (.inr ab) let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ let marks := fun g => ell+(cut g).card let W := fun n : ℕ => markedDivisorWeight univ P (1/2) V marks n let d := physicalFreeFactor cut aux let δ : ℤ := k*(d : ℤ) physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ (.inr ab) aux a b Z k pool α β γ α' β' γ' = ∑ n ∈ harmonicPositiveSupport Z k d, ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)/(n : ℂ))* star (invariantTripleEndpoint pool α β γ n.natAbs)* invariantTripleEndpoint pool α' β' γ' (n+δ).natAbs* ((repeatedBigPrimePatternWeight probes r t (.inr ab)*physicalPhase (-(a+b)) d)* physicalPhase a n.natAbs*physicalPhase b (n+δ).natAbs* (((W n.natAbs*W (n+δ).natAbs : ℝ) : ℂ)* groupMarkedAverage P marks (n.natAbs : ℤ) (fun u => groupMarkedAverage P marks ((n+δ).natAbs : ℤ) (fun v => physicalUnsharedPrimeCoefficient P V ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 Q h (kept ab.1.val) (kept ab.2.val) u v aux)))) := by intro hv cut kept marks W d δ unfold physicalFreePositiveHarmonicMain dsimp only apply sum_congr rfl intro n _ have he := physical_free_prime_inr_weighted_average P V probes r t hrt Q h ξ ab aux a b (1/2) n.natAbs (n+δ).natAbs dsimp only at he simpa only [mul_assoc] using congrArg (fun x : ℂ => ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)/(n : ℂ))* star (invariantTripleEndpoint pool α β γ n.natAbs)* invariantTripleEndpoint pool α' β' γ' (n+δ).natAbs*x) he end Bounty -- Source module: PrimePatternHarmonicCells /- The literal original nonempty pattern is a finite sum of its exact cell-dependent harmonic pairings. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalPrimeHarmonicCellSum {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (S : Finset G) (hA : ∀ i ∈ A, i.1 ∈ S) (hB : ∀ i ∈ B, i.1 ∈ S) (q : ℝ) (aux : PhysicalAuxLabels P (repeatedBigAuxCut A B)) (T : Finset ℤ) (w z : ℤ → ℕ) (θ : ℤ → ℂ) (F H : ℕ → ℂ) (a b : ℝ) (C : ℂ) : ℂ := let marks := fun g => ell + (repeatedBigAuxCut A B g).card let W := fun n : ℕ => markedDivisorWeight univ P q V marks n let cells := (keptA ×ˢ (univ : Finset (BoundedPrimitiveCharacter Q))) ×ˢ (keptB ×ˢ (univ : Finset (BoundedPrimitiveCharacter Q))) let f := fun (j : (ℤ × BoundedPrimitiveCharacter Q) × (ℤ × BoundedPrimitiveCharacter Q)) u => primeProductCellCharacter (fun i : B => P i.val.1) h j.2.1 j.2.2 (physicalSelectedPrimeRestriction A B B subset_union_right S hB u) let g := fun (j : (ℤ × BoundedPrimitiveCharacter Q) × (ℤ × BoundedPrimitiveCharacter Q)) u => primeProductCellCharacter (fun i : A => P i.val.1) h j.1.1 j.1.2 (physicalSelectedPrimeRestriction A B A subset_union_left S hA u) let coeff := fun (j : (ℤ × BoundedPrimitiveCharacter Q) × (ℤ × BoundedPrimitiveCharacter Q)) => ((((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) j.1.1 : ℝ) : ℂ) * ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) j.2.1 : ℝ) : ℂ)) * ((starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h j.1.1 j.1.2 (repeatedBigAuxSplitEquiv P A B hU hAB aux).1) * (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h j.2.1 j.2.2 (repeatedBigAuxSplitEquiv P A B hU hAB aux).2))) C*∑ j ∈ cells, coeff j*∑ n ∈ T, θ n* star (physicalPhase (-a) (w n)* ((W (w n) : ℂ)*groupMarkedAverage (fun i : S => P i.val) (fun i : S => marks i.val) (w n : ℤ) (fun u => star (f j u))*F (w n)))* (physicalPhase b (z n)* ((W (z n) : ℂ)*groupMarkedAverage (fun i : S => P i.val) (fun i : S => marks i.val) (z n : ℤ) (g j)*H (z n))) theorem physical_free_harmonic_inr_cells {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (ab : RepeatedBigPrimePatternPair (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab))) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) : let hv := repeated_big_prime_pattern_pair_valid probes r t hrt ab let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ let hA : ∀ j ∈ ab.1.val, j.1 ∈ r ∪ t := fun _j hj => mem_union_left t (mem_sigma.mp (((clean_mem_nonempty_subsets _ _).mp ab.1.property).2 hj)).1 let hB : ∀ j ∈ ab.2.val, j.1 ∈ r ∪ t := fun _j hj => mem_union_right r (mem_sigma.mp (((clean_mem_nonempty_subsets _ _).mp ab.2.property).2 hj)).1 let d := physicalFreeFactor (repeatedBigPrimePatternCut probes r t (.inr ab)) aux physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ (.inr ab) aux a b Z k pool α β γ α' β' γ' = physicalPrimeHarmonicCellSum P V ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 Q h (kept ab.1.val) (kept ab.2.val) (r ∪ t) hA hB (1/2) aux (harmonicPositiveSupport Z k d) Int.natAbs (fun n => (n+k*(d : ℤ)).natAbs) (fun n => (typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)/(n : ℂ)) (invariantTripleEndpoint pool α β γ) (invariantTripleEndpoint pool α' β' γ') a b (repeatedBigPrimePatternWeight probes r t (.inr ab)*physicalPhase (-(a+b)) d) := by intro hv kept hA hB d rw [physical_free_harmonic_inr_average] exact physical_prime_cells_harmonic P V ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 Q h (kept ab.1.val) (kept ab.2.val) (r ∪ t) hA hB (1/2) aux (harmonicPositiveSupport Z k d) Int.natAbs (fun n => (n+k*(d : ℤ)).natAbs) (fun n => (typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)/(n : ℂ)) (invariantTripleEndpoint pool α β γ) (invariantTripleEndpoint pool α' β' γ') a b (repeatedBigPrimePatternWeight probes r t (.inr ab)*physicalPhase (-(a+b)) d) end Bounty -- Source module: PrimeAuxHarmonicExpansion /- Exact reindexing of the original auxiliary average into its cell-dependent endpoint families. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalPrimeCellEndpoint {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B U : Finset (RepeatedBigFlatIndex G J ell)) (hUAB : U ⊆ A ∪ B) (S : Finset G) (hUS : ∀ i ∈ U, i.1 ∈ S) (q : ℝ) (f : (∀ i : U, P i.val.1) → ℂ) (E : ℕ → ℂ) (n : ℕ) : ℂ := (markedDivisorWeight univ P q V (fun g => ell + (repeatedBigAuxCut A B g).card) n : ℂ) * groupMarkedAverage (fun i : S => P i.val) (fun i : S => ell + (repeatedBigAuxCut A B i.val).card) (n : ℤ) (fun u => f (physicalSelectedPrimeRestriction A B U hUAB S hUS u)) * E n theorem physical_prime_harmonic_cells_aux_sum {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (S : Finset G) (hA : ∀ i ∈ A, i.1 ∈ S) (hB : ∀ i ∈ B, i.1 ∈ S) (q : ℝ) (E E' : ℕ → ℂ) (a b Z : ℝ) (k : ℤ) (σ : ℂ) : let F := fun e (ψ : BoundedPrimitiveCharacter Q) (n : ℤ) => physicalPrimeCellEndpoint P V A B B subset_union_right S hB q (fun x => star (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ x)) E n.natAbs let G := fun d (χ : BoundedPrimitiveCharacter Q) (n : ℤ) => physicalPrimeCellEndpoint P V A B A subset_union_left S hA q (primeProductCellCharacter (fun i : A => P i.val.1) h d χ) E' n.natAbs let mA := fun d => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : A => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) d : ℝ) : ℂ) let mB := fun e => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : B => P i.val.1) (fun i => V i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) e : ℝ) : ℂ) (∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), (physicalAuxMass V (repeatedBigAuxCut A B) aux : ℂ) * physicalPrimeHarmonicCellSum P V A B hU hAB Q h keptA keptB S hA hB q aux (harmonicPositiveSupport Z k (physicalFreeFactor (repeatedBigAuxCut A B) aux)) Int.natAbs (fun n => (n+k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)).natAbs) (fun n => (typeIIHarmonicDyadic ((n : ℝ)/(Z*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℝ))) : ℂ)/(n : ℂ)) E E' a b (σ*physicalPhase (-(a+b)) (physicalFreeFactor (repeatedBigAuxCut A B) aux))) = σ * ∑ d ∈ keptA, ∑ χ : BoundedPrimitiveCharacter Q, ∑ e ∈ keptB, ∑ ψ : BoundedPrimitiveCharacter Q, mA d*mB e*physicalPrimeCellHarmonicFamily P V A B hU hAB h d χ e ψ a b Z k (F e ψ) (G d χ) := by intro F G mA mB simp only [physicalPrimeHarmonicCellSum, sum_product] simp only [mul_sum] rw [sum_comm] apply sum_congr rfl intro d _ rw [sum_comm] apply sum_congr rfl intro χ _ rw [sum_comm] apply sum_congr rfl intro e _ rw [sum_comm] apply sum_congr rfl intro ψ _ simp only [physicalPrimeCellHarmonicFamily, mul_sum] apply sum_congr rfl intro aux _ simp only [physicalPrimeCellAuxCoeff] apply sum_congr rfl intro n _ dsimp only [F, G, mA, mB, physicalPrimeCellEndpoint] rw [star_mul, physical_phase_star, neg_neg] simp only [starRingEnd_apply] ring end Bounty -- Source module: PrimePatternAuxPeel /- The literal nonempty-pattern auxiliary average differs from its peeled cell expansion by an arbitrary logarithmic saving. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_physical_free_harmonic_inr_peel {c bWindow Kdet : ℝ} (hc : 0 < c) (hb : 0 < bWindow) (hK : 0 ≤ Kdet) (J ell : ℕ) (Ce D B C R : ℝ) (hB : 0 ≤ B) : ∀ᶠ L : ℝ in atTop, let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) ∀ (probes : candidatePIndices c L → Finset (Fin J)) (r t : Finset (candidatePIndices c L)) (hrt : Disjoint r t) (ab : RepeatedBigPrimePatternPair (ell := ell) probes r t), let hv := repeated_big_prime_pattern_pair_valid probes r t hrt ab let hA : ∀ j ∈ ab.1.val, j.1 ∈ r ∪ t := fun _j hj => mem_union_left t (mem_sigma.mp (((clean_mem_nonempty_subsets _ _).mp ab.1.property).2 hj)).1 let hB' : ∀ j ∈ ab.2.val, j.1 ∈ r ∪ t := fun _j hj => mem_union_right r (mem_sigma.mp (((clean_mem_nonempty_subsets _ _).mp ab.2.property).2 hj)).1 let cut := repeatedBigAuxCut ab.1.val ab.2.val let marks := fun j => ell+(cut j).card ∀ (g : candidatePIndices c L) (κ : ℕ), marks g = κ+1 → g ∉ r ∪ t → (∀ j, 0 < mass j) → ∀ Q : ℕ, (Q : ℝ) ≤ L^R → (∀ x : (∀ i : ab.1.val, P i.val.1), 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L) → (∀ x : (∀ i : ab.2.val, P i.val.1), 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L) → ∀ (pool : Finset ℕ), (∀ j, P j ⊆ pool) → ∀ (α₀ β₀ γ₀ α₁ β₁ γ₁ : ℕ → ℂ), (∀ n, ¬ Disjoint n.primeFactors pool → α₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → α₁ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₁ n = 0) → (∀ n, ‖α₀ n‖ ≤ L^Ce) → (∀ n, ‖β₀ n‖ ≤ L^Ce) → (∀ n, ‖γ₀ n‖ ≤ L^Ce) → (∀ n, ‖α₁ n‖ ≤ L^Ce) → (∀ n, ‖β₁ n‖ ≤ L^Ce) → (∀ n, ‖γ₁ n‖ ≤ L^Ce) → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ a b : ℝ, let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j let h := L^(-B) let kept := fun U : Finset (RepeatedBigFlatIndex (candidatePIndices c L) J ell) => primeProductRetainedCells (fun i : U => P i.val.1) (fun i => mass i.val.1) h (L^(-C)) let b₀ := fun e (ψ : BoundedPrimitiveCharacter Q) u => star (primeProductCellCharacter (fun i : ab.2.val => P i.val.1) h e ψ (physicalSelectedPrimeRestriction ab.1.val ab.2.val ab.2.val subset_union_right (r ∪ t) hB' u)) let b₁ := fun d (χ : BoundedPrimitiveCharacter Q) u => primeProductCellCharacter (fun i : ab.1.val => P i.val.1) h d χ (physicalSelectedPrimeRestriction ab.1.val ab.2.val ab.1.val subset_union_left (r ∪ t) hA u) let F' := fun e ψ (n : ℤ) => selectedPeeledEndpoint P (1/2) mass marks g κ (r ∪ t) (b₀ e ψ) pool α₀ β₀ γ₀ n.natAbs let G' := fun d χ (n : ℤ) => selectedPeeledEndpoint P (1/2) mass marks g κ (r ∪ t) (b₁ d χ) pool α₁ β₁ γ₁ n.natAbs let mA := fun d => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : ab.1.val => P i.val.1) (fun i => mass i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) d : ℝ) : ℂ) let mB := fun e => ((1 / finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i : ab.2.val => P i.val.1) (fun i => mass i.val.1))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) e : ℝ) : ℂ) ‖(∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab)), (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t (.inr ab)) aux : ℂ)* physicalFreePositiveHarmonicMain P mass probes r t hrt Q h (L^(-C)) (.inr ab) aux a b Z k pool α₀ β₀ γ₀ α₁ β₁ γ₁) - repeatedBigPrimePatternWeight probes r t (.inr ab)* ∑ d ∈ kept ab.1.val, ∑ χ : BoundedPrimitiveCharacter Q, ∑ e ∈ kept ab.2.val, ∑ ψ : BoundedPrimitiveCharacter Q, mA d*mB e*physicalPrimeCellHarmonicFamily P mass ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 h d χ e ψ a b Z k (F' e ψ) (G' d χ)‖ ≤ L^(-D) := by filter_upwards [eventually_candidate_aux_cell_peel hc hb hK J ell Ce (D+2*(B+C+2*R+2)), eventually_ge_atTop (3 : ℝ)] with L hpeel hL intro P mass probes r t hrt ab hv hA hB' cut marks g κ hκ hg hmass Q hQ hPA hPB pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ U V hUlo hUhi hVlo hVhi k hk j hj a b Z h kept b₀ b₁ F' G' mA mB let F := fun e (ψ : BoundedPrimitiveCharacter Q) (n : ℤ) => selectedMarkedEndpoint P (1/2) mass marks (r ∪ t) (b₀ e ψ) pool α₀ β₀ γ₀ n.natAbs let G := fun d (χ : BoundedPrimitiveCharacter Q) (n : ℤ) => selectedMarkedEndpoint P (1/2) mass marks (r ∪ t) (b₁ d χ) pool α₁ β₁ γ₁ n.natAbs have hdiff := prime_retained_harmonic_families_close (C := C) (D := D) P mass ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 hL hB hQ hPA hPB a b Z k F G F' G' have heach : ∀ d ∈ kept ab.1.val, ∀ χ : BoundedPrimitiveCharacter Q, ∀ e ∈ kept ab.2.val, ∀ ψ : BoundedPrimitiveCharacter Q, ‖physicalPrimeCellHarmonicFamily P mass ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 h d χ e ψ a b Z k (F e ψ) (G d χ) - physicalPrimeCellHarmonicFamily P mass ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 h d χ e ψ a b Z k (F' e ψ) (G' d χ)‖ ≤ L^(-(D+2*(B+C+2*R+2))) := by intro d _ χ e _ ψ have hb₀ : ∀ u, ‖b₀ e ψ u‖ ≤ 1 := by intro u dsimp only [b₀] rw [norm_star] exact prime_product_cell_character_norm _ h e ψ _ have hb₁ : ∀ u, ‖b₁ d χ u‖ ≤ 1 := fun _ => prime_product_cell_character_norm _ h d χ _ exact hpeel ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 Q h d χ e ψ (r ∪ t) g κ hκ hg hmass (b₀ e ψ) (b₁ d χ) hb₀ hb₁ pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ U V hUlo hUhi hVlo hVhi k hk j hj a b have hexp := physical_prime_harmonic_cells_aux_sum P mass ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 Q h (kept ab.1.val) (kept ab.2.val) (r ∪ t) hA hB' (1/2) (invariantTripleEndpoint pool α₀ β₀ γ₀) (invariantTripleEndpoint pool α₁ β₁ γ₁) a b Z k (repeatedBigPrimePatternWeight probes r t (.inr ab)) have hsum := Finset.sum_congr (s₁ := (univ : Finset (PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab))))) rfl (fun aux _ => congrArg (fun z : ℂ => (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t (.inr ab)) aux : ℂ)*z) (physical_free_harmonic_inr_cells P mass probes r t hrt Q h (L^(-C)) ab aux a b Z k pool α₀ β₀ γ₀ α₁ β₁ γ₁)) rw [hsum.trans hexp, ← mul_sub, norm_mul, repeated_big_prime_pattern_weight_norm, one_mul] exact hdiff heach end Bounty -- Source module: PrimeAuxPairDecay /- Central cancellation and shifted pair energies imply decay of the original auxiliary cell family. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_physical_prime_cell_family_decay_of_pair {r : ℝ} (hr : 0 < r) (T D : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hAB : Disjoint A B) (h : ℝ) (d : ℤ) {Q : ℕ} (χ : BoundedPrimitiveCharacter Q) (e : ℤ) (ψ : BoundedPrimitiveCharacter Q) (a b Z : ℝ) (k : ℤ) (F G : ℤ → ℂ), (∀ g, 0 < V g) → (∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) → (∀ g, ∀ p ∈ P g, 0 < p) → 0 < h → h ≤ 1 → 0 < Z → |(k : ℝ)| ≤ Z/4 → let Y := Z*harmonicCellProductScale h d e let c := physicalPrimeCellAuxCoeff P V A B hU hAB h d χ e ψ let m := physicalFreeFactor (repeatedBigAuxCut A B) (∀ aux, c aux ≠ 0 → (8/Y)*Real.sqrt (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff ((n : ℝ)/Y) : ℂ)*F n‖^2)* Real.sqrt (∑ n ∈ harmonicCommonSupport Y, ‖(harmonicCommonCutoff (((n+k*(m aux : ℤ) : ℤ) : ℝ)/Y) : ℂ)*G (n+k*(m aux : ℤ))‖^2) ≤ L^T) → (∀ v : ℝ, ‖v‖ ≤ L^r → ‖∑ aux, c aux*physicalPhase (-(a+b+2*Real.pi*v)) (m aux)* harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(m aux : ℤ)) F G‖ ≤ Y*L^(-(D+2))) → ‖physicalPrimeCellHarmonicFamily P V A B hU hAB h d χ e ψ a b Z k F G‖ ≤ L^(-D) := by filter_upwards [eventually_ge_atTop (8 : ℝ), eventually_harmonic_cell_family_decay hr T D] with L hL hdecay intro Gt _ _ J ell P V A B hU hAB h d Q χ e ψ a b Z k F G hV hMass hP hh hh1 hZ hk Y c m hpair hcentral have hL0 : 0 < L := by linarith have hY : 0 < Y := mul_pos hZ (harmonic_cell_product_scale_pos h d e) have hcoeff := physical_prime_cell_aux_mass P V A B hU hAB h d χ e ψ hV hMass have hmass : (∑ aux, ‖c aux‖ * ∑ n ∈ harmonicCommonSupport Y, ‖harmonicCellCoefficient Y a b (m aux) (k*(m aux : ℤ)) F G n‖) ≤ L^T := by calc _ ≤ ∑ aux, ‖c aux‖*L^T := by apply sum_le_sum intro aux _ by_cases hz : c aux = 0 · simp only [hz, norm_zero, zero_mul, le_refl] · exact mul_le_mul_of_nonneg_left ((harmonic_cell_coefficient_mass_le_energy hY a b (m aux) (k*(m aux : ℤ)) F G).trans (hpair aux hz)) (norm_nonneg _) _ = (∑ aux, ‖c aux‖)*L^T := (sum_mul ..).symm _ ≤ 1*L^T := mul_le_mul_of_nonneg_right hcoeff (Real.rpow_pos_of_pos hL0 T).le _ = L^T := one_mul _ exact hdecay Z (harmonicCellProductScale h d e) univ c m k a b F G hZ (harmonic_cell_product_scale_pos h d e) (fun aux _ hc => physical_prime_cell_aux_scale P V A B hU hAB hh hh1 d χ e ψ hP aux hc) hk hmass hcentral end Bounty -- Source module: ActualRetainedCellSourceParameters /- Original retained harmonic windows supply the source-scale hypotheses for occupied comparison cells, with source exponent half the window exponent. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_actual_retained_cell_source_parameters {c bWindow K : ℝ} (hc : 0 < c) (hbWindow : 0 < bWindow) (hK : 0 ≤ K) (J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → let P := fun g : groups => candidatePBand (c*L) g.val ∀ (ell : ℕ) (A B : Finset (RepeatedBigFlatIndex groups J ell)) (_hU : ∀ g (i : Fin ell), (⟨g, Sum.inr i⟩ : RepeatedBigFlatIndex groups J ell) ∉ A ∪ B) (_hAB : Disjoint A B), ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (ζ : ℝ) (x : ∀ i : A, P i.val.1) (y : ∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x) * physicalPhase ζ (∏ i, (x i).val) ≠ 0 → (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y) * physicalPhase ζ (∏ i, (y i).val) ≠ 0 → let Z := typeIISmoothDyadicScale U V (U*L^(-K)) j let HA := Real.exp (((d : ℝ)-1)*h) let HB := Real.exp (((e : ℝ)-1)*h) let Y := Z*(HA*HB) 0 < Z ∧ Real.exp (2*(bWindow/2)*L) ≤ Z*((((∏ i, (x i).val)*(∏ i, (y i).val)) : ℕ) : ℝ)/2 ∧ 1 ≤ Y ∧ Real.log Y ≤ 6*L ∧ |(k : ℝ)| ≤ Z/4 := by filter_upwards [eventually_candidate_harmonic_common_scale hc hbWindow hK J, eventually_typeII_harmonic_scale_lower hbWindow hK] with L hcommon hlower intro groups hgroups P ell A B hU hAB U V hUlo hUhi hVlo hVhi k hk j hj Q h hh hh1 d e χ ψ ζ x y hx hy let aux := (repeatedBigAuxSplitEquiv P A B hU hAB).symm (x,y) have hprod : physicalFreeFactor (repeatedBigAuxCut A B) aux = (∏ i : A, (x i).val)*(∏ i : B, (y i).val) := repeatedBigAuxSplitEquiv_symm_label_prod P A B hU hAB x y have hposA : 0 < ∏ i : A, (x i).val := by apply Finset.prod_pos intro i _ exact ((mem_dyadicPrimeBand_iff (c*L) (3/2) (9/5) i.val.1.val (x i).val).mp (x i).property).1.pos have hposB : 0 < ∏ i : B, (y i).val := by apply Finset.prod_pos intro i _ exact ((mem_dyadicPrimeBand_iff (c*L) (3/2) (9/5) i.val.1.val (y i).val).mp (y i).property).1.pos have hcharA : primeProductCellCharacter (fun i : A => P i.val.1) h d χ x ≠ 0 := by intro hz exact hx (by rw [hz,map_zero,zero_mul]) have hcharB : primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y ≠ 0 := by intro hz exact hy (by rw [hz,map_zero,zero_mul]) have hs := hcommon groups hgroups (repeatedBigAuxCut A B) aux U V hUlo hUhi hVlo hVhi k hk j hj h _ _ d e hh hh1 hposA hposB hprod (prime_cell_character_mem (fun i : A => P i.val.1) h d χ x hcharA) (prime_cell_character_mem (fun i : B => P i.val.1) h e ψ y hcharB) have hzLower := hlower U V hUlo hVlo j have hZ : 0 < typeIISmoothDyadicScale U V (U*L^(-K)) j := (mul_pos (by norm_num) (Real.exp_pos _)).trans_le hzLower have hprodOne : (1 : ℝ) ≤ (((∏ i : A, (x i).val)*(∏ i : B, (y i).val) : ℕ) : ℝ) := by exact_mod_cast Nat.succ_le_of_lt (Nat.mul_pos hposA hposB) refine ⟨hZ,?_,hs.2.1,hs.2.2.1,hs.2.2.2.1⟩ rw [show 2*(bWindow/2)*L = bWindow*L by ring] nlinarith only [hzLower,mul_le_mul_of_nonneg_left hprodOne hZ.le] end Bounty -- Source module: CandidateOriginalCellDecay /- Peeled auxiliary cell decay on the original harmonic windows; pair energies and occupied-cell scales are discharged. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_aux_cell_decay {c bWindow Kdet r : ℝ} (hc : 0 < c) (hb : 0 < bWindow) (hK : 0 ≤ Kdet) (hr : 0 < r) (J ell : ℕ) (Ce D : ℝ) : ∀ᶠ L : ℝ in atTop, let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) ∀ (A B : Finset (RepeatedBigFlatIndex (candidatePIndices c L) J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex (candidatePIndices c L) J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d : ℤ) (χ : BoundedPrimitiveCharacter Q) (e : ℤ) (ψ : BoundedPrimitiveCharacter Q), let cut := repeatedBigAuxCut A B let marks := fun g => ell+(cut g).card ∀ (big : Finset (candidatePIndices c L)) (g : candidatePIndices c L) (κ : ℕ), marks g = κ+1 → g ∉ big → (∀ j, 0 < mass j) → ∀ (b₀ b₁ : GroupMarkedLists (fun j : big => P j.val) (fun j : big => marks j.val) → ℂ), (∀ u, ‖b₀ u‖ ≤ 1) → (∀ u, ‖b₁ u‖ ≤ 1) → ∀ (pool : Finset ℕ), (∀ j, P j ⊆ pool) → ∀ (α₀ β₀ γ₀ α₁ β₁ γ₁ : ℕ → ℂ), (∀ n, ¬ Disjoint n.primeFactors pool → α₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → α₁ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₁ n = 0) → (∀ n, ‖α₀ n‖ ≤ L^Ce) → (∀ n, ‖β₀ n‖ ≤ L^Ce) → (∀ n, ‖γ₀ n‖ ≤ L^Ce) → (∀ n, ‖α₁ n‖ ≤ L^Ce) → (∀ n, ‖β₁ n‖ ≤ L^Ce) → (∀ n, ‖γ₁ n‖ ≤ L^Ce) → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ a b : ℝ, let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j let F' := fun n : ℤ => selectedPeeledEndpoint P (1/2) mass marks g κ big b₀ pool α₀ β₀ γ₀ n.natAbs let G' := fun n : ℤ => selectedPeeledEndpoint P (1/2) mass marks g κ big b₁ pool α₁ β₁ γ₁ n.natAbs let Y := Z*harmonicCellProductScale h d e let caux := physicalPrimeCellAuxCoeff P mass A B hU hAB h d χ e ψ let m := physicalFreeFactor (repeatedBigAuxCut A B) (∀ v : ℝ, ‖v‖ ≤ L^r → ‖∑ aux, caux aux*physicalPhase (-(a+b+2*Real.pi*v)) (m aux)* harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(m aux : ℤ)) F' G'‖ ≤ Y*L^(-(D+2))) → ‖physicalPrimeCellHarmonicFamily P mass A B hU hAB h d χ e ψ a b Z k F' G'‖ ≤ L^(-D) := by obtain ⟨T,henergy⟩ := exists_candidate_harmonic_cutoff_energy hc J ell 0 Ce filter_upwards [henergy, eventually_physical_prime_cell_family_decay_of_pair hr T D, eventually_actual_retained_cell_source_parameters hc hb hK J, eventually_gt_atTop (0 : ℝ)] with L he hdecay hscale hL intro P mass A B hU hAB Q h hh hh1 d χ e ψ cut marks big g κ hκ hg hmass b₀ b₁ hb₀ hb₁ pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ U V hUlo hUhi hVlo hVhi k hk j hj a b Z F' G' Y caux m hcentral by_cases hocc : ∃ aux, caux aux ≠ 0 · obtain ⟨aux,haux⟩ := hocc have hca : primeProductCellCharacter (fun i : A => P i.val.1) h d χ (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 ≠ 0 := by intro hz exact haux (by simp only [caux, physicalPrimeCellAuxCoeff, hz, star_zero, mul_zero, zero_mul]) have hcb : primeProductCellCharacter (fun i : B => P i.val.1) h e ψ (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 ≠ 0 := by intro hz exact haux (by simp only [caux, physicalPrimeCellAuxCoeff, hz, star_zero, mul_zero]) have hp (n : ℕ) : physicalPhase 0 n ≠ 0 := by intro hz have hn := physical_phase_norm 0 n rw [hz, norm_zero] at hn exact zero_ne_one hn have hs := hscale (candidatePIndices c L) (subset_refl _) ell A B hU hAB U V hUlo hUhi hVlo hVhi k hk j hj Q h hh hh1 d e χ ψ 0 (repeatedBigAuxSplitEquiv P A B hU hAB aux).1 (repeatedBigAuxSplitEquiv P A B hU hAB aux).2 (mul_ne_zero (star_ne_zero.mpr hca) (hp _)) (mul_ne_zero (star_ne_zero.mpr hcb) (hp _)) apply hdecay P mass A B hU hAB h d χ e ψ a b Z k F' G' hmass (fun _ => rfl) (fun g p hp => ((mem_dyadicPrimeBand_iff (c*L) (3/2) (9/5) g.val p).mp hp).1.pos) hh hh1 hs.1 hs.2.2.2.2 · intro aux _ have he' := (he (candidatePIndices c L) (subset_refl _) cut big g κ hκ hg b₀ b₁ (by simpa only [Real.rpow_zero] using hb₀) (by simpa only [Real.rpow_zero] using hb₁) pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ Y hs.2.2.1 hs.2.2.2.1 (k*(m aux : ℤ))).2 simpa only [add_zero] using he' · exact hcentral · have hz : ∀ aux, caux aux = 0 := by simpa only [not_exists, not_not] using hocc have hf : physicalPrimeCellHarmonicFamily P mass A B hU hAB h d χ e ψ a b Z k F' G' = 0 := by unfold physicalPrimeCellHarmonicFamily apply sum_eq_zero intro aux _ rw [show physicalPrimeCellAuxCoeff P mass A B hU hAB h d χ e ψ aux = 0 from hz aux, zero_mul] rw [hf,norm_zero] exact (Real.rpow_pos_of_pos hL _).le end Bounty -- Source module: PrimePatternCentralDecay /- The original nonempty-pattern auxiliary average decays from central cancellation of the exact peeled cell endpoints. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_physical_free_harmonic_inr_of_peeled_central {c bWindow Kdet r0 : ℝ} (hc : 0 < c) (hb : 0 < bWindow) (hK : 0 ≤ Kdet) (hr0 : 0 < r0) (J ell : ℕ) (Ce D B C R : ℝ) (hB : 0 ≤ B) : ∀ᶠ L : ℝ in atTop, let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) ∀ (probes : candidatePIndices c L → Finset (Fin J)) (r t : Finset (candidatePIndices c L)) (hrt : Disjoint r t) (ab : RepeatedBigPrimePatternPair (ell := ell) probes r t), let hv := repeated_big_prime_pattern_pair_valid probes r t hrt ab let hA : ∀ j ∈ ab.1.val, j.1 ∈ r ∪ t := fun _j hj => mem_union_left t (mem_sigma.mp (((clean_mem_nonempty_subsets _ _).mp ab.1.property).2 hj)).1 let hB' : ∀ j ∈ ab.2.val, j.1 ∈ r ∪ t := fun _j hj => mem_union_right r (mem_sigma.mp (((clean_mem_nonempty_subsets _ _).mp ab.2.property).2 hj)).1 let cut := repeatedBigAuxCut ab.1.val ab.2.val let marks := fun j => ell+(cut j).card ∀ (g : candidatePIndices c L) (κ : ℕ), marks g = κ+1 → g ∉ r ∪ t → (∀ j, 0 < mass j) → ∀ Q : ℕ, (Q : ℝ) ≤ L^R → (∀ x : (∀ i : ab.1.val, P i.val.1), 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L) → (∀ x : (∀ i : ab.2.val, P i.val.1), 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L) → ∀ (pool : Finset ℕ), (∀ j, P j ⊆ pool) → ∀ (α₀ β₀ γ₀ α₁ β₁ γ₁ : ℕ → ℂ), (∀ n, ¬ Disjoint n.primeFactors pool → α₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₀ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → α₁ n = 0) → (∀ n, ¬ Disjoint n.primeFactors pool → β₁ n = 0) → (∀ n, ‖α₀ n‖ ≤ L^Ce) → (∀ n, ‖β₀ n‖ ≤ L^Ce) → (∀ n, ‖γ₀ n‖ ≤ L^Ce) → (∀ n, ‖α₁ n‖ ≤ L^Ce) → (∀ n, ‖β₁ n‖ ≤ L^Ce) → (∀ n, ‖γ₁ n‖ ≤ L^Ce) → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ a b : ℝ, let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j let h := L^(-B) let kept := fun U : Finset (RepeatedBigFlatIndex (candidatePIndices c L) J ell) => primeProductRetainedCells (fun i : U => P i.val.1) (fun i => mass i.val.1) h (L^(-C)) let b₀ := fun e (ψ : BoundedPrimitiveCharacter Q) u => star (primeProductCellCharacter (fun i : ab.2.val => P i.val.1) h e ψ (physicalSelectedPrimeRestriction ab.1.val ab.2.val ab.2.val subset_union_right (r ∪ t) hB' u)) let b₁ := fun d (χ : BoundedPrimitiveCharacter Q) u => primeProductCellCharacter (fun i : ab.1.val => P i.val.1) h d χ (physicalSelectedPrimeRestriction ab.1.val ab.2.val ab.1.val subset_union_left (r ∪ t) hA u) let F' := fun e ψ (n : ℤ) => selectedPeeledEndpoint P (1/2) mass marks g κ (r ∪ t) (b₀ e ψ) pool α₀ β₀ γ₀ n.natAbs let G' := fun d χ (n : ℤ) => selectedPeeledEndpoint P (1/2) mass marks g κ (r ∪ t) (b₁ d χ) pool α₁ β₁ γ₁ n.natAbs (∀ d ∈ kept ab.1.val, ∀ χ : BoundedPrimitiveCharacter Q, ∀ e ∈ kept ab.2.val, ∀ ψ : BoundedPrimitiveCharacter Q, ∀ v : ℝ, ‖v‖ ≤ L^r0 → let Y := Z*harmonicCellProductScale h d e ‖∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut ab.1.val ab.2.val), physicalPrimeCellAuxCoeff P mass ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 h d χ e ψ aux * physicalPhase (-(a+b+2*Real.pi*v)) (physicalFreeFactor (repeatedBigAuxCut ab.1.val ab.2.val) aux) * harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(physicalFreeFactor (repeatedBigAuxCut ab.1.val ab.2.val) aux : ℤ)) (F' e ψ) (G' d χ)‖ ≤ Y*L^(-((D+1)+2*(B+C+2*R+2)+2))) → ‖(∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab)), (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t (.inr ab)) aux : ℂ)* physicalFreePositiveHarmonicMain P mass probes r t hrt Q h (L^(-C)) (.inr ab) aux a b Z k pool α₀ β₀ γ₀ α₁ β₁ γ₁)‖ ≤ L^(-D) := by filter_upwards [eventually_physical_free_harmonic_inr_peel hc hb hK J ell Ce (D+1) B C R hB, eventually_candidate_aux_cell_decay hc hb hK hr0 J ell Ce ((D+1)+2*(B+C+2*R+2)), eventually_ge_atTop (3 : ℝ)] with L hpeel hdecay hL intro P mass probes r t hrt ab hv hA hB' cut marks g κ hκ hg hmass Q hQ hPA hPB pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ U V hUlo hUhi hVlo hVhi k hk j hj a b Z h kept b₀ b₁ F' G' hcentral have hL0 : 0 < L := by linarith have hh : 0 < h := Real.rpow_pos_of_pos hL0 _ have hh1 : h ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos (by linarith) (by linarith) have hb₀ (e : ℤ) (ψ : BoundedPrimitiveCharacter Q) : ∀ u, ‖b₀ e ψ u‖ ≤ 1 := by intro u dsimp only [b₀] rw [norm_star] exact prime_product_cell_character_norm _ h e ψ _ have hb₁ (d : ℤ) (χ : BoundedPrimitiveCharacter Q) : ∀ u, ‖b₁ d χ u‖ ≤ 1 := fun _ => prime_product_cell_character_norm _ h d χ _ have hcell : ∀ d ∈ kept ab.1.val, ∀ χ : BoundedPrimitiveCharacter Q, ∀ e ∈ kept ab.2.val, ∀ ψ : BoundedPrimitiveCharacter Q, ‖physicalPrimeCellHarmonicFamily P mass ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 h d χ e ψ a b Z k (F' e ψ) (G' d χ)‖ ≤ 1*L^(-((D+1)+2*(B+C+2*R+2))) := by intro d hd χ e he ψ simpa only [one_mul] using hdecay ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 Q h hh hh1 d χ e ψ (r ∪ t) g κ hκ hg hmass (b₀ e ψ) (b₁ d χ) (hb₀ e ψ) (hb₁ d χ) pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ U V hUlo hUhi hVlo hVhi k hk j hj a b (hcentral d hd χ e he ψ) have hret := prime_retained_pair_cell_decay (fun i : ab.1.val => P i.val.1) (fun i => mass i.val.1) (fun i : ab.2.val => P i.val.1) (fun i => mass i.val.1) hL hB hQ zero_le_one hPA hPB (fun d χ e ψ => physicalPrimeCellHarmonicFamily P mass ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 h d χ e ψ a b Z k (F' e ψ) (G' d χ)) hcell have hclose := hpeel probes r t hrt ab g κ hκ hg hmass Q hQ hPA hPB pool hpool α₀ β₀ γ₀ α₁ β₁ γ₁ hα₀free hβ₀free hα₁free hβ₁free hα₀ hβ₀ hγ₀ hα₁ hβ₁ hγ₁ U V hUlo hUhi hVlo hVhi k hk j hj a b have htri (x y : ℂ) : ‖x‖ ≤ ‖x-y‖+‖y‖ := by simpa only [add_comm] using norm_le_norm_add_norm_sub' x y have hnorm := (htri _ _).trans (_root_.add_le_add hclose (show _ ≤ L^(-(D+1)) from by rw [norm_mul, repeated_big_prime_pattern_weight_norm, one_mul] simpa only [one_mul] using hret)) apply hnorm.trans calc L^(-(D+1))+L^(-(D+1)) = 2*L^(-(D+1)) := by ring _ ≤ L*L^(-(D+1)) := mul_le_mul_of_nonneg_right (by linarith) (Real.rpow_pos_of_pos hL0 _).le _ = L^(-D) := by conv_lhs => lhs; rw [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 ring end Bounty -- Source module: OriginalCellCentralTransfer /- Remove occupied-cell scale conditions from the original-window central estimate. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_original_cell_central_transfer {c bWindow Kdet : ℝ} (hc : 0 < c) (hb : 0 < bWindow) (hK : 0 ≤ Kdet) (J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → let P := fun g : groups => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) ∀ (ell : ℕ) (A B : Finset (RepeatedBigFlatIndex groups J ell)) (hU : ∀ g (i : Fin ell), (⟨g, Sum.inr i⟩ : RepeatedBigFlatIndex groups J ell) ∉ A ∪ B) (hAB : Disjoint A B), ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ (Q : ℕ) (h : ℝ), 0 < h → h ≤ 1 → ∀ (d e : ℤ) (χ ψ : BoundedPrimitiveCharacter Q) (a b v E : ℝ) (F G : ℤ → ℂ), let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j let Y := Z*harmonicCellProductScale h d e let value := ∑ aux : PhysicalAuxLabels P (repeatedBigAuxCut A B), physicalPrimeCellAuxCoeff P mass A B hU hAB h d χ e ψ aux * physicalPhase (-(a+b+2*Real.pi*v)) (physicalFreeFactor (repeatedBigAuxCut A B) aux) * harmonicCellPairing Y Z a b (2*Real.pi*v) (k*(physicalFreeFactor (repeatedBigAuxCut A B) aux : ℤ)) F G (0 < Z → Real.log Y ≤ 6*L → (∀ (x : ∀ i : A, P i.val.1) (y : ∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x)* physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (x i).val) ≠ 0 → (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y)* physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (y i).val) ≠ 0 → Real.exp (2*(bWindow/2)*L) ≤ Z*((((∏ i, (x i).val)*(∏ i, (y i).val)) : ℕ) : ℝ)/2) → ‖value‖ ≤ Y*L^(-E)) → ‖value‖ ≤ Y*L^(-E) := by filter_upwards [eventually_actual_retained_cell_source_parameters hc hb hK J, eventually_gt_atTop (0 : ℝ)] with L hs hL intro groups hgroups P mass ell A B hU hAB U V hUlo hUhi hVlo hVhi k hk j hj Q h hh hh1 d e χ ψ a b v E F G Z Y value hbound have hZ : 0 < Z := typeII_smooth_dyadic_scale_pos ((Real.exp_pos _).trans_le hUlo) ((Real.exp_pos _).trans_le hVlo) (mul_pos ((Real.exp_pos _).trans_le hUlo) (Real.rpow_pos_of_pos hL _)) j have hnonneg : 0 ≤ Y*L^(-E) := mul_nonneg (mul_pos hZ (harmonic_cell_product_scale_pos h d e)).le (Real.rpow_pos_of_pos hL _).le by_cases hx : ∃ x : (∀ i : A, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : A => P i.val.1) h d χ x)* physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (x i).val) ≠ 0 · by_cases hy : ∃ y : (∀ i : B, P i.val.1), (starRingEnd ℂ) (primeProductCellCharacter (fun i : B => P i.val.1) h e ψ y)* physicalPhase (-(a+b+2*Real.pi*v)) (∏ i, (y i).val) ≠ 0 · obtain ⟨x,hx⟩ := hx obtain ⟨y,hy⟩ := hy have hscale := hs groups hgroups ell A B hU hAB U V hUlo hUhi hVlo hVhi k hk j hj Q h hh hh1 d e χ ψ (-(a+b+2*Real.pi*v)) x y hx hy apply hbound hZ hscale.2.2.2.1 intro x y hx hy exact (hs groups hgroups ell A B hU hAB U V hUlo hUhi hVlo hVhi k hk j hj Q h hh hh1 d e χ ψ (-(a+b+2*Real.pi*v)) x y hx hy).2.1 · have hz : value = 0 := by simpa only [value,physicalPrimeCellAuxCoeff,starRingEnd_apply,mul_assoc] using candidate_cell_aux_sum_eq_zero_of_no_right P mass A B hU hAB k Q h d e χ ψ Y Z a b v F G hy rw [hz,norm_zero] exact hnonneg · have hz : value = 0 := by simpa only [value,physicalPrimeCellAuxCoeff,starRingEnd_apply,mul_assoc] using candidate_cell_aux_sum_eq_zero_of_no_left P mass A B hU hAB k Q h d e χ ψ Y Z a b v F G hx rw [hz,norm_zero] exact hnonneg end Bounty -- Source module: ActualRemainingFactorProperties /- Uniform unit bounds and prime-pool exclusion for the original remaining factors. The witnesses are extracted from `exists_actual_selected_source_energy`. -/ open Finset Filter open scoped ComplexConjugate namespace Bounty theorem eventually_actual_remaining_factor_properties {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L r jStar) → ℝ) (θQ : ℕ → ℂ), (∀ n, ‖θQ n‖ ≤ 1) → let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let β := fun n => if n ∈ candidateRoughBand c L jStar then θQ n else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) n) (∀ n, ‖β n‖ ≤ 1) ∧ (∀ n, ¬ Disjoint n.primeFactors pool → β n = 0) ∧ (∀ n, ‖γ n‖ ≤ 1) := by classical filter_upwards [eventually_candidate_P_pool_below_rough_cutoff hc, eventually_ge_atTop (0 : ℝ)] with L hpool hL intro r jStar hr hj take hkeep ξ θQ hθQ pool β γ refine ⟨?_, ?_, ?_⟩ · intro n dsimp only [β] split_ifs · exact hθQ n · simp only [norm_zero, zero_le_one] · intro n hn have hout : n ∉ candidateRoughBand c L jStar := by intro hmem exact hn (prime_factors_disjoint_of_rough hpool (mem_filter.mp hmem).2) exact if_neg hout · intro n dsimp only [γ] rw [Complex.norm_conj] exact norm_candidate_residual_prime_coefficient_le_one (mul_nonneg hc.le hL) hr hj take hkeep (candidateAllocationFourierTwist c L r jStar take ξ) (fun slot p hp => (candidate_allocation_fourier_twist_norm c L r jStar take ξ slot (Nat.pos_of_ne_zero (candidate_Q_slot_nonzero c L r jStar slot hp))).le) n end Bounty -- Source module: ActualCandidateSmallWitness /- A small candidate group remains outside every selection of big groups. -/ open Finset Filter namespace Bounty theorem eventually_candidate_small_group_outside_big {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ big : Finset (candidatePIndices c L), (∀ g ∈ big, g.val ∈ candidateBigPIndices c L) → ∃ g : candidatePIndices c L, g.val ∈ candidateSmallPIndices c L ∧ g ∉ big := by obtain ⟨v, V, hv, hV, hpool⟩ := exists_candidate_P_pool_bounds hc filter_upwards [hpool, eventually_candidate_small_big_indices_disjoint hc, eventually_gt_atTop (1 : ℝ)] with L hpoolL hdis hL intro big hbig have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) have hcard : 0 < ((candidateSmallPIndices c L).card : ℝ) := (mul_pos (div_pos zero_lt_one (mul_pos (by norm_num) hlog2)) (Real.log_pos hL)).trans_le hpoolL.2.1 have hcardNat : 0 < (candidateSmallPIndices c L).card := by exact_mod_cast hcard obtain ⟨j, hj⟩ := card_pos.mp hcardNat have hjAll : j ∈ candidatePIndices c L := mem_union_left _ hj refine ⟨⟨j, hjAll⟩, hj, ?_⟩ intro hjBig exact disjoint_left.mp hdis hj (hbig ⟨j, hjAll⟩ hjBig) end Bounty -- Source module: ActualPatternPeelMark /- The original pattern leaves a positive peel mark outside its selected groups. -/ open Finset namespace Bounty theorem actual_pattern_aux_cut_eq_empty {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hA : A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes)) (hB : B ⊆ t.sigma (repeatedBigPrimeProbeSlots probes)) (g : G) (hg : g ∉ r ∪ t) : repeatedBigAuxCut A B g = ∅ := by apply eq_empty_iff_forall_notMem.mpr intro j hj rcases mem_union.mp ((mem_repeatedBigAuxCut A B g j).mp hj) with ha | hb · exact hg (mem_union_left _ (mem_sigma.mp (hA ha)).1) · exact hg (mem_union_right _ (mem_sigma.mp (hB hb)).1) theorem actual_pattern_peel_mark {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hA : A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes)) (hB : B ⊆ t.sigma (repeatedBigPrimeProbeSlots probes)) (g : G) (hg : g ∉ r ∪ t) (hell : 0 < ell) : ell + (repeatedBigAuxCut A B g).card = (ell - 1) + 1 := by rw [actual_pattern_aux_cut_eq_empty probes r t A B hA hB g hg, card_empty, Nat.add_zero, Nat.sub_add_cancel hell] end Bounty -- Source module: ActualPatternBigWitness /- A nonempty original comparison pattern inherits its selected group property. -/ open Finset namespace Bounty theorem actual_pattern_group_witness {G : Type*} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r : Finset G) (A : Finset (RepeatedBigFlatIndex G J ell)) (hA : A ⊆ r.sigma (repeatedBigPrimeProbeSlots probes)) (hAne : A.Nonempty) (property : G → Prop) (hproperty : ∀ g ∈ r, property g) : ∃ i : A, property i.val.1 := by obtain ⟨i, hi⟩ := hAne exact ⟨⟨i, hi⟩, hproperty i.1 (mem_sigma.mp (hA hi)).1⟩ end Bounty -- Source module: ActualPrimeOriginalDecay /- Original nonempty prime-pattern harmonic decay for the actual prime coefficients. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree -- Source module: ActualRoughOriginalDecay /- Original nonempty prime-pattern harmonic decay for the actual rough coefficients. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree end section -- Source module: WeakActualComparisonDecay /- Nonempty-pattern sums and complete comparison decay from the actual zero-free theorem. -/ open scoped Topology BigOperators Classical -- Source module: CandidateNonemptyPatternSum /- The exact nonempty-pattern sum preserves arbitrary power saving. -/ open Filter Finset Real open scoped Classical namespace Bounty theorem exists_candidate_nonempty_pattern_sum_exponent {c : ℝ} (hc : 0 < c) (J : ℕ) : ∃ A : ℝ, 0 ≤ A ∧ ∀ᶠ L : ℝ in atTop, ∀ (groups : Finset ℕ), groups ⊆ candidatePIndices c L → ∀ (ell : ℕ) (probes : groups → Finset (Fin J)) (r t : Finset groups), Disjoint r t → ∀ (D : ℝ) (F : RepeatedBigPrimePatternPair (ell := ell) probes r t → ℂ), (∀ ab, ‖F ab‖ ≤ L^(-(D+A))) → ‖∑ ab, F ab‖ ≤ L^(-D) := by obtain ⟨v,A,_hv,hA,hinputs⟩ := exists_candidate_shared_error_inputs hc J refine ⟨A*log 2+1,by positivity,?_⟩ filter_upwards [hinputs,eventually_ge_atTop (2 : ℝ)] with L hinput hL intro groups hgroups ell probes r t hrt D F hF have hL0 : 0 < L := by linarith have hslots : ((J*Fintype.card groups : ℕ) : ℝ) ≤ A*log L := by simpa only [Fintype.card_coe] using (hinput groups hgroups).1 have hcard := harmonic_pattern_card_power (ell := ell) probes r t hrt hL hA hslots have hpair : (Fintype.card (RepeatedBigPrimePatternPair (ell := ell) probes r t) : ℝ) ≤ L^(A*log 2+1) := by simp only [RepeatedBigPrimePatternIndex,Fintype.card_sum,Fintype.card_unit, Nat.cast_add,Nat.cast_one] at hcard linarith calc ‖∑ ab, F ab‖ ≤ ∑ ab, ‖F ab‖ := norm_sum_le _ _ _ ≤ ∑ _ab : RepeatedBigPrimePatternPair (ell := ell) probes r t, L^(-(D+(A*log 2+1))) := sum_le_sum (fun ab _ => hF ab) _ = (Fintype.card (RepeatedBigPrimePatternPair (ell := ell) probes r t) : ℝ)* L^(-(D+(A*log 2+1))) := by simp _ ≤ L^(A*log 2+1)*L^(-(D+(A*log 2+1))) := mul_le_mul_of_nonneg_right hpair (rpow_nonneg hL0.le _) _ = L^(-D) := by rw [← rpow_add hL0]; congr 1; ring end Bounty -- Source module: ActualPrimeNonemptyDecay /- Complete nonempty-pattern harmonic decay with the exact original signed weights. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree -- Source module: ActualPrimeComparisonDecay /- The full replacement error plus nonempty comparison term has arbitrary power saving. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree -- Source module: ActualRoughNonemptyDecay /- Complete nonempty-pattern harmonic decay with the exact original signed weights. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree -- Source module: ActualRoughComparisonDecay /- The full replacement error plus nonempty comparison term has arbitrary power saving. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree end section -- Source module: WeakUniformWindowDecay /- The actual zero-free theorem gives thresholds uniform in the later determinant window. -/ open scoped Topology BigOperators Classical -- Source module: ActualPrimeUniformOriginalDecay /- The distinguished-band threshold is uniform in the later determinant window. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree theorem exists_actual_prime_original_harmonic_decay_uniform_window (hZeta : PrimitiveZeroFreeRightOf (23 / 24)) {c bWindow : ℝ} (hc : 0 < c) (hb : 0 < bWindow) : ∃ J₀ : ℕ, ∀ jStar : ℕ, J₀ < jStar → ∀ Kdet : ℝ, 0 ≤ Kdet → ∀ (D : ℝ) (J ell : ℕ) (B C R Kfull Tmod Sshift Cmod Sfreq W : ℝ), 0 < ell → 0 ≤ B → 0 ≤ Kfull → ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (rQ : ℕ) (hrQ : 0 < rQ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*rQ) → Bool) (hkeep : take ((candidateAllocationOrder c L rQ).symm (candidateRoughSlot c L rQ jStar hrQ hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L rQ jStar) → ℝ) (lo hi : ℕ) (κM ν₀ ν₁ : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν₀| ≤ L^Sfreq → |ν₁| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let α₀ := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₀ n) let α₁ := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₁ n) let β := fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L rQ jStar hrQ hj take hkeep (candidateAllocationFourierTwist c L rQ jStar take ξ) n) ∀ (probes : candidatePIndices c L → Finset (Fin J)) (r t : Finset (candidatePIndices c L)) (hrt : Disjoint r t), (∀ g ∈ r ∪ t, g.val ∈ candidateBigPIndices c L) → ∀ (ab : RepeatedBigPrimePatternPair (ell := ell) probes r t) (Q : ℕ), (Q : ℝ) ≤ L^R → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L^Kfull → ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ a b : ℝ, |a| ≤ L^W → let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j ‖∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab)), (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t (.inr ab)) aux : ℂ)* physicalFreePositiveHarmonicMain P mass probes r t hrt Q (L^(-B)) (L^(-C)) (.inr ab) aux a b Z k pool α₀ β γ α₁ β γ‖ ≤ L^(-D) := by obtain ⟨J₀,hlocal⟩ := exists_actual_prime_cell_local_energy_decay hZeta hc (by linarith : 0 < bWindow/2) refine ⟨J₀,?_⟩ intro jStar hjStar Kdet hKdet D J ell B C R Kfull Tmod Sshift Cmod Sfreq W hell hB hKfull obtain ⟨_q,_hq,S₀,hS₀,hloc⟩ := hlocal jStar hjStar ((D+1)+2*(B+C+2*R+2)+2) J ell 0 Kfull Tmod Sshift Cmod Sfreq (max W 2) hKfull refine ⟨S₀,hS₀,?_⟩ intro S hS obtain ⟨v,_m,hv,_hm,hmarked⟩ := exists_candidate_marked_error_inputs hc (ell+J) filter_upwards [hloc S hS, eventually_physical_free_harmonic_inr_of_peeled_central hc hb hKdet (by norm_num : (0 : ℝ) < 1) J ell 0 D B C R hB, eventually_original_cell_central_transfer hc hb hKdet J, eventually_actual_prime_source_factor_properties hc S (hS₀.trans hS), eventually_actual_remaining_factor_properties hc, eventually_candidate_small_group_outside_big hc, hmarked, eventually_candidate_subset_product_range hc (by norm_num : (0 : ℝ) < 1) J, eventually_ge_atTop (8 : ℝ)] with L hcell hmain htransfer hfactor hremain hsmall hmark hrange hL intro rQ hrQ hj take hkeep ξ lo hi κM ν₀ ν₁ qM _ χM hκM hκmax hqM hν₀ hν₁ σ qQ _ χQ hqQ hσ P mass pool α₀ α₁ β γ probes r t hrt hbig ab Q hQ U V hUlo hUhi hVlo hVhi k hk hk0 hkfull j hjd a b ha Z have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hα₀ := hfactor κM hκM hκmax (Ioc lo hi) qM χM ν₀ have hα₁ := hfactor κM hκM hκmax (Ioc lo hi) qM χM ν₁ have hθ (n : ℕ) : ‖typeIIPhase σ n*χQ (n : ZMod qQ)‖ ≤ 1 := by rw [norm_mul,typeIIPhase_norm,one_mul] exact χQ.norm_le_one _ have hβγ := hremain rQ jStar hrQ hj take hkeep ξ _ hθ have hmass : ∀ g, 0 < mass g := fun g => hv.trans_le ((hmark _ (subset_refl _)).2 g) obtain ⟨g,hgsmall,hg⟩ := hsmall (r ∪ t) hbig have hAsub := ((clean_mem_nonempty_subsets _ _).mp ab.1.property).2 have hAne := Finset.nonempty_iff_ne_empty.mpr (((clean_mem_nonempty_subsets _ _).mp ab.1.property).1) have hBsub := ((clean_mem_nonempty_subsets _ _).mp ab.2.property).2 have hBne := Finset.nonempty_iff_ne_empty.mpr (((clean_mem_nonempty_subsets _ _).mp ab.2.property).1) have hκ := actual_pattern_peel_mark probes r t ab.1.val ab.2.val hAsub hBsub g hg hell have hlog (s : Finset (candidatePIndices c L)) (A : Finset (RepeatedBigFlatIndex (candidatePIndices c L) J ell)) (hA : A ⊆ s.sigma (repeatedBigPrimeProbeSlots probes)) (hne : A.Nonempty) (x : ∀ i : A, P i.val.1) : 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L := by obtain ⟨hlo,hhi⟩ := hrange _ (subset_refl _) ell probes s A hA hne x have hp : (1 : ℝ) ≤ (∏ i, (x i).val : ℕ) := (Real.one_le_exp (Real.rpow_nonneg hL0.le _)).trans hlo exact ⟨Real.log_nonneg hp,(Real.log_le_iff_le_exp (zero_lt_one.trans_le hp)).mpr (by simpa only [one_mul] using hhi)⟩ apply hmain probes r t hrt ab g (ell-1) hκ hg hmass Q hQ (hlog r ab.1.val hAsub hAne) (hlog t ab.2.val hBsub hBne) pool (fun g p hp => mem_biUnion.mpr ⟨g.val,g.property,hp⟩) α₀ β γ α₁ β γ hα₀.2 hβγ.2.1 hα₁.2 hβγ.2.1 (by simpa only [Real.rpow_zero] using hα₀.1) (by simpa only [Real.rpow_zero] using hβγ.1) (by simpa only [Real.rpow_zero] using hβγ.2.2) (by simpa only [Real.rpow_zero] using hα₁.1) (by simpa only [Real.rpow_zero] using hβγ.1) (by simpa only [Real.rpow_zero] using hβγ.2.2) U V hUlo hUhi hVlo hVhi k hk j hjd a b intro d _ χ e _ ψ v hv let hvPair := repeated_big_prime_pattern_pair_valid probes r t hrt ab have hA : ∀ i ∈ ab.1.val, i.1 ∈ r ∪ t := fun _ hi => mem_union_left t (mem_sigma.mp (hAsub hi)).1 have hB' : ∀ i ∈ ab.2.val, i.1 ∈ r ∪ t := fun _ hi => mem_union_right r (mem_sigma.mp (hBsub hi)).1 let b₀ := fun u => star (primeProductCellCharacter (fun i : ab.2.val => P i.val.1) (L^(-B)) e ψ (physicalSelectedPrimeRestriction ab.1.val ab.2.val ab.2.val subset_union_right (r ∪ t) hB' u)) let b₁ := fun u => primeProductCellCharacter (fun i : ab.1.val => P i.val.1) (L^(-B)) d χ (physicalSelectedPrimeRestriction ab.1.val ab.2.val ab.1.val subset_union_left (r ∪ t) hA u) have hb₀ : ∀ u, ‖b₀ u‖ ≤ L^(0 : ℝ) := by intro u dsimp only [b₀] rw [norm_star,Real.rpow_zero] exact prime_product_cell_character_norm _ _ _ _ _ have hb₁ : ∀ u, ‖b₁ u‖ ≤ L^(0 : ℝ) := by intro u rw [Real.rpow_zero] exact prime_product_cell_character_norm _ _ _ _ _ have hh : 0 < L^(-B) := Real.rpow_pos_of_pos hL0 _ have hh1 : L^(-B) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hL1 (by linarith) apply htransfer (candidatePIndices c L) (subset_refl _) ell ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hvPair.1 hvPair.2.1) hvPair.2.2 U V hUlo hUhi hVlo hVhi k hk j hjd Q (L^(-B)) hh hh1 d e χ ψ a b v _ _ _ intro hZ hYlog hproduct have hav : |a| ≤ L^(max W 2) := ha.trans (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left _ _)) have hvL : |v| ≤ L := by simpa only [Real.norm_eq_abs,Real.rpow_one] using hv have hvv : |2*Real.pi*v| ≤ L^(max W 2) := by calc _ = |2*Real.pi| * |v| := abs_mul _ _ _ ≤ 8*L := mul_le_mul (by rw [abs_of_pos (by positivity)]; linarith [Real.pi_lt_four]) hvL (abs_nonneg _) (by norm_num) _ ≤ L^(2 : ℝ) := by norm_num; nlinarith _ ≤ _ := Real.rpow_le_rpow_of_exponent_le hL1 (le_max_right _ _) have hAbig := actual_pattern_group_witness probes r ab.1.val hAsub hAne (fun g : candidatePIndices c L => g.val ∈ candidateBigPIndices c L) (fun g hg => hbig g (mem_union_left t hg)) simpa only [physicalPrimeCellAuxCoeff,harmonicCellProductScale,Z,b₀,b₁,α₀,α₁,β,γ,pool,starRingEnd_apply,mul_assoc] using hcell rQ hrQ hj take hkeep ξ (repeatedBigAuxCut ab.1.val ab.2.val) (r ∪ t) g (ell-1) hκ hg hgsmall b₀ b₁ hb₀ hb₁ lo hi κM ν₀ ν₁ qM χM hκM hκmax hqM hν₀ hν₁ σ qQ χQ hqQ hσ (candidatePIndices c L) (subset_refl _) probes r t ab.1.val ab.2.val hAsub hAne hBsub hBne hAbig (repeated_big_active_pair_avoids_tail hvPair.1 hvPair.2.1) hvPair.2.2 k hk0 hkfull Q (L^(-B)) hh hh1 d e χ ψ a b v Z hZ hav hvv hYlog hproduct end Bounty.WeakZeroFree -- Source module: ActualRoughUniformOriginalDecay /- The distinguished-band threshold is uniform in the later determinant window. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree theorem exists_actual_rough_original_harmonic_decay_uniform_window (hZeta : PrimitiveZeroFreeRightOf (23 / 24)) {c bWindow γrough vMax ρ : ℝ} (hc : 0 < c) (hb : 0 < bWindow) (hγrough : 0 < γrough) (hvMax : vMax < 1) (hρ : 0 < ρ) : ∃ J₀ : ℕ, ∀ jStar : ℕ, J₀ < jStar → ∀ Kdet : ℝ, 0 ≤ Kdet → ∀ (D : ℝ) (J ell : ℕ) (B C R Kfull Tmod Sshift Cmod Sfreq W : ℝ), 0 < ell → 0 ≤ B → 0 ≤ Kfull → ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (rQ : ℕ) (hrQ : 0 < rQ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*rQ) → Bool) (hkeep : take ((candidateAllocationOrder c L rQ).symm (candidateRoughSlot c L rQ jStar hrQ hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L rQ jStar) → ℝ) (lo hi : ℕ) (aM vM ν₀ ν₁ : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), vM ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν₀| ≤ L^Sfreq → |ν₁| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let α₀ := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₀ n) let α₁ := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₁ n) let β := fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L rQ jStar hrQ hj take hkeep (candidateAllocationFourierTwist c L rQ jStar take ξ) n) ∀ (probes : candidatePIndices c L → Finset (Fin J)) (r t : Finset (candidatePIndices c L)) (hrt : Disjoint r t), (∀ g ∈ r ∪ t, g.val ∈ candidateBigPIndices c L) → ∀ (ab : RepeatedBigPrimePatternPair (ell := ell) probes r t) (Q : ℕ), (Q : ℝ) ≤ L^R → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L^Kfull → ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ a b : ℝ, |a| ≤ L^W → let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j ‖∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab)), (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t (.inr ab)) aux : ℂ)* physicalFreePositiveHarmonicMain P mass probes r t hrt Q (L^(-B)) (L^(-C)) (.inr ab) aux a b Z k pool α₀ β γ α₁ β γ‖ ≤ L^(-D) := by obtain ⟨J₀,hlocal⟩ := exists_actual_rough_cell_local_energy_decay hZeta hc (by linarith : 0 < bWindow/2) hγrough hvMax hρ refine ⟨J₀,?_⟩ intro jStar hjStar Kdet hKdet D J ell B C R Kfull Tmod Sshift Cmod Sfreq W hell hB hKfull obtain ⟨_q,_hq,S₀,hS₀,hloc⟩ := hlocal jStar hjStar ((D+1)+2*(B+C+2*R+2)+2) J ell 0 Kfull Tmod Sshift Cmod Sfreq (max W 2) hKfull refine ⟨S₀,hS₀,?_⟩ intro S hS obtain ⟨v,_m,hv,_hm,hmarked⟩ := exists_candidate_marked_error_inputs hc (ell+J) filter_upwards [hloc S hS, eventually_physical_free_harmonic_inr_of_peeled_central hc hb hKdet (by norm_num : (0 : ℝ) < 1) J ell 0 D B C R hB, eventually_original_cell_central_transfer hc hb hKdet J, eventually_actual_rough_source_factor_properties hc hγrough, eventually_actual_remaining_factor_properties hc, eventually_candidate_small_group_outside_big hc, hmarked, eventually_candidate_subset_product_range hc (by norm_num : (0 : ℝ) < 1) J, eventually_ge_atTop (8 : ℝ)] with L hcell hmain htransfer hfactor hremain hsmall hmark hrange hL intro rQ hrQ hj take hkeep ξ lo hi aM vM ν₀ ν₁ qM _ χM hvM hqM hν₀ hν₁ σ qQ _ χQ hqQ hσ P mass pool α₀ α₁ β γ probes r t hrt hbig ab Q hQ U V hUlo hUhi hVlo hVhi k hk hk0 hkfull j hjd a b ha Z have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hα₀ := hfactor S aM vM (Ioc lo hi) qM χM ν₀ have hα₁ := hfactor S aM vM (Ioc lo hi) qM χM ν₁ have hθ (n : ℕ) : ‖typeIIPhase σ n*χQ (n : ZMod qQ)‖ ≤ 1 := by rw [norm_mul,typeIIPhase_norm,one_mul] exact χQ.norm_le_one _ have hβγ := hremain rQ jStar hrQ hj take hkeep ξ _ hθ have hmass : ∀ g, 0 < mass g := fun g => hv.trans_le ((hmark _ (subset_refl _)).2 g) obtain ⟨g,hgsmall,hg⟩ := hsmall (r ∪ t) hbig have hAsub := ((clean_mem_nonempty_subsets _ _).mp ab.1.property).2 have hAne := Finset.nonempty_iff_ne_empty.mpr (((clean_mem_nonempty_subsets _ _).mp ab.1.property).1) have hBsub := ((clean_mem_nonempty_subsets _ _).mp ab.2.property).2 have hBne := Finset.nonempty_iff_ne_empty.mpr (((clean_mem_nonempty_subsets _ _).mp ab.2.property).1) have hκ := actual_pattern_peel_mark probes r t ab.1.val ab.2.val hAsub hBsub g hg hell have hlog (s : Finset (candidatePIndices c L)) (A : Finset (RepeatedBigFlatIndex (candidatePIndices c L) J ell)) (hA : A ⊆ s.sigma (repeatedBigPrimeProbeSlots probes)) (hne : A.Nonempty) (x : ∀ i : A, P i.val.1) : 0 ≤ Real.log (∏ i, (x i).val : ℕ) ∧ Real.log (∏ i, (x i).val : ℕ) ≤ L := by obtain ⟨hlo,hhi⟩ := hrange _ (subset_refl _) ell probes s A hA hne x have hp : (1 : ℝ) ≤ (∏ i, (x i).val : ℕ) := (Real.one_le_exp (Real.rpow_nonneg hL0.le _)).trans hlo exact ⟨Real.log_nonneg hp,(Real.log_le_iff_le_exp (zero_lt_one.trans_le hp)).mpr (by simpa only [one_mul] using hhi)⟩ apply hmain probes r t hrt ab g (ell-1) hκ hg hmass Q hQ (hlog r ab.1.val hAsub hAne) (hlog t ab.2.val hBsub hBne) pool (fun g p hp => mem_biUnion.mpr ⟨g.val,g.property,hp⟩) α₀ β γ α₁ β γ hα₀.2 hβγ.2.1 hα₁.2 hβγ.2.1 (by simpa only [Real.rpow_zero] using hα₀.1) (by simpa only [Real.rpow_zero] using hβγ.1) (by simpa only [Real.rpow_zero] using hβγ.2.2) (by simpa only [Real.rpow_zero] using hα₁.1) (by simpa only [Real.rpow_zero] using hβγ.1) (by simpa only [Real.rpow_zero] using hβγ.2.2) U V hUlo hUhi hVlo hVhi k hk j hjd a b intro d _ χ e _ ψ v hv let hvPair := repeated_big_prime_pattern_pair_valid probes r t hrt ab have hA : ∀ i ∈ ab.1.val, i.1 ∈ r ∪ t := fun _ hi => mem_union_left t (mem_sigma.mp (hAsub hi)).1 have hB' : ∀ i ∈ ab.2.val, i.1 ∈ r ∪ t := fun _ hi => mem_union_right r (mem_sigma.mp (hBsub hi)).1 let b₀ := fun u => star (primeProductCellCharacter (fun i : ab.2.val => P i.val.1) (L^(-B)) e ψ (physicalSelectedPrimeRestriction ab.1.val ab.2.val ab.2.val subset_union_right (r ∪ t) hB' u)) let b₁ := fun u => primeProductCellCharacter (fun i : ab.1.val => P i.val.1) (L^(-B)) d χ (physicalSelectedPrimeRestriction ab.1.val ab.2.val ab.1.val subset_union_left (r ∪ t) hA u) have hb₀ : ∀ u, ‖b₀ u‖ ≤ L^(0 : ℝ) := by intro u dsimp only [b₀] rw [norm_star,Real.rpow_zero] exact prime_product_cell_character_norm _ _ _ _ _ have hb₁ : ∀ u, ‖b₁ u‖ ≤ L^(0 : ℝ) := by intro u rw [Real.rpow_zero] exact prime_product_cell_character_norm _ _ _ _ _ have hh : 0 < L^(-B) := Real.rpow_pos_of_pos hL0 _ have hh1 : L^(-B) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hL1 (by linarith) apply htransfer (candidatePIndices c L) (subset_refl _) ell ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hvPair.1 hvPair.2.1) hvPair.2.2 U V hUlo hUhi hVlo hVhi k hk j hjd Q (L^(-B)) hh hh1 d e χ ψ a b v _ _ _ intro hZ hYlog hproduct have hav : |a| ≤ L^(max W 2) := ha.trans (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left _ _)) have hvL : |v| ≤ L := by simpa only [Real.norm_eq_abs,Real.rpow_one] using hv have hvv : |2*Real.pi*v| ≤ L^(max W 2) := by calc _ = |2*Real.pi| * |v| := abs_mul _ _ _ ≤ 8*L := mul_le_mul (by rw [abs_of_pos (by positivity)]; linarith [Real.pi_lt_four]) hvL (abs_nonneg _) (by norm_num) _ ≤ L^(2 : ℝ) := by norm_num; nlinarith _ ≤ _ := Real.rpow_le_rpow_of_exponent_le hL1 (le_max_right _ _) have hAbig := actual_pattern_group_witness probes r ab.1.val hAsub hAne (fun g : candidatePIndices c L => g.val ∈ candidateBigPIndices c L) (fun g hg => hbig g (mem_union_left t hg)) simpa only [physicalPrimeCellAuxCoeff,harmonicCellProductScale,Z,b₀,b₁,α₀,α₁,β,γ,pool,starRingEnd_apply,mul_assoc] using hcell rQ hrQ hj take hkeep ξ (repeatedBigAuxCut ab.1.val ab.2.val) (r ∪ t) g (ell-1) hκ hg hgsmall b₀ b₁ hb₀ hb₁ lo hi aM vM ν₀ ν₁ qM χM hvM hqM hν₀ hν₁ σ qQ χQ hqQ hσ (candidatePIndices c L) (subset_refl _) probes r t ab.1.val ab.2.val hAsub hAne hBsub hBne hAbig (repeated_big_active_pair_avoids_tail hvPair.1 hvPair.2.1) hvPair.2.2 k hk0 hkfull Q (L^(-B)) hh hh1 d e χ ψ a b v Z hZ hav hvv hYlog hproduct end Bounty.WeakZeroFree -- Source module: ActualPrimeUniformComparisonDecay /- Complete comparison decay with the distinguished-band threshold before the window and precision. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree theorem exists_actual_prime_comparison_harmonic_decay_uniform_window (hZeta : PrimitiveZeroFreeRightOf (23 / 24)) {c bWindow : ℝ} (hc : 0 < c) (hb : 0 < bWindow) : ∃ J₀ : ℕ, ∀ jStar : ℕ, J₀ < jStar → ∀ Kdet : ℝ, 0 ≤ Kdet → ∀ (D : ℝ) (J ell : ℕ) (B C R Kfull Tmod Sshift Cmod Sfreq W : ℝ), 0 < ell → 0 ≤ B → 0 ≤ Kfull → ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (rQ : ℕ) (hrQ : 0 < rQ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*rQ) → Bool) (hkeep : take ((candidateAllocationOrder c L rQ).symm (candidateRoughSlot c L rQ jStar hrQ hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L rQ jStar) → ℝ) (lo hi : ℕ) (κM ν₀ ν₁ : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), 0 ≤ κM → κM ≤ 1/50 → (qM : ℝ) ≤ L^Cmod → |ν₀| ≤ L^Sfreq → |ν₁| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let α₀ := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₀ n) let α₁ := fun n => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₁ n) let β := fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L rQ jStar hrQ hj take hkeep (candidateAllocationFourierTwist c L rQ jStar take ξ) n) ∀ (probes : candidatePIndices c L → Finset (Fin J)) (r t : Finset (candidatePIndices c L)) (hrt : Disjoint r t), (∀ g ∈ r ∪ t, g.val ∈ candidateBigPIndices c L) → ∀ (Q : ℕ), (Q : ℝ) ≤ L^R → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L^Kfull → ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ a b : ℝ, |a| ≤ L^W → let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j ‖(∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i), (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t i) aux : ℂ)* physicalPositiveHarmonicDifference P mass probes r t hrt Q (L^(-B)) (L^(-C)) i aux a b Z k pool α₀ β γ α₁ β γ) + (∑ ab : RepeatedBigPrimePatternPair (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab)), (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t (.inr ab)) aux : ℂ)* physicalFreePositiveHarmonicMain P mass probes r t hrt Q (L^(-B)) (L^(-C)) (.inr ab) aux a b Z k pool α₀ β γ α₁ β γ)‖ ≤ L^(-D) := by obtain ⟨J₀,hbase⟩ := exists_actual_prime_original_harmonic_decay_uniform_window hZeta hc hb refine ⟨J₀,?_⟩ intro jStar hjStar Kdet hKdet D J ell B C R Kfull Tmod Sshift Cmod Sfreq W hell hB hKfull obtain ⟨A,_hA,hsum⟩ := exists_candidate_nonempty_pattern_sum_exponent hc J obtain ⟨S₀,hS₀,hdecay⟩ := hbase jStar hjStar Kdet hKdet (D+1+A) J ell B C R Kfull Tmod Sshift Cmod Sfreq W hell hB hKfull refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hdecay S hS,hsum, eventually_candidate_pattern_harmonic_decay hc hb hKdet (le_max_right R 0) (le_max_right C 0) J ell 0 (D+1), eventually_actual_prime_source_factor_properties hc S (hS₀.trans hS), eventually_actual_remaining_factor_properties hc, eventually_ge_atTop (2 : ℝ)] with L hdec hsumL herror hfactor hremain hL intro rQ hrQ hj take hkeep ξ lo hi κM ν₀ ν₁ qM _ χM hκM hκmax hqM hν₀ hν₁ σ qQ _ χQ hqQ hσ P mass pool α₀ α₁ β γ probes r t hrt hbig Q hQ U V hUlo hUhi hVlo hVhi k hk hk0 hkfull j hjd a b ha Z have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hα₀ := hfactor κM hκM hκmax (Ioc lo hi) qM χM ν₀ have hα₁ := hfactor κM hκM hκmax (Ioc lo hi) qM χM ν₁ have hθ (n : ℕ) : ‖typeIIPhase σ n*χQ (n : ZMod qQ)‖ ≤ 1 := by rw [norm_mul,typeIIPhase_norm,one_mul] exact χQ.norm_le_one _ have hβγ := hremain rQ jStar hrQ hj take hkeep ξ _ hθ have hQ' : (Q : ℝ) ≤ L^(max R 0) := hQ.trans (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left _ _)) have hξ : L^(-(max C 0)) ≤ L^(-C) := Real.rpow_le_rpow_of_exponent_le hL1 (neg_le_neg (le_max_left _ _)) have he := herror (candidatePIndices c L) (subset_refl _) probes r t hrt Q (L^(-B)) (L^(-C)) hQ' hξ a b pool (fun g p hp => mem_biUnion.mpr ⟨g.val,g.property,hp⟩) α₀ β γ α₁ β γ (by simpa only [Real.rpow_zero] using hα₀.1) (by simpa only [Real.rpow_zero] using hβγ.1) (by simpa only [Real.rpow_zero] using hβγ.2.2) (by simpa only [Real.rpow_zero] using hα₁.1) (by simpa only [Real.rpow_zero] using hβγ.1) (by simpa only [Real.rpow_zero] using hβγ.2.2) U V hUlo hUhi hVlo hVhi k hk j hjd have hc' := hsumL (candidatePIndices c L) (subset_refl _) ell probes r t hrt (D+1) (fun ab => ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab)), (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t (.inr ab)) aux : ℂ)* physicalFreePositiveHarmonicMain P mass probes r t hrt Q (L^(-B)) (L^(-C)) (.inr ab) aux a b Z k pool α₀ β γ α₁ β γ) (fun ab => hdec rQ hrQ hj take hkeep ξ lo hi κM ν₀ ν₁ qM χM hκM hκmax hqM hν₀ hν₁ σ qQ χQ hqQ hσ probes r t hrt hbig ab Q hQ U V hUlo hUhi hVlo hVhi k hk hk0 hkfull j hjd a b ha) calc _ ≤ L^(-(D+1)) + L^(-(D+1)) := (norm_add_le _ _).trans (_root_.add_le_add he hc') _ = 2*L^(-(D+1)) := by ring _ ≤ L*L^(-(D+1)) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = L^(-D) := by nth_rw 1 [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 ring end Bounty.WeakZeroFree -- Source module: ActualRoughUniformComparisonDecay /- Complete comparison decay with the distinguished-band threshold before the window and precision. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree theorem exists_actual_rough_comparison_harmonic_decay_uniform_window (hZeta : PrimitiveZeroFreeRightOf (23 / 24)) {c bWindow γrough vMax ρ : ℝ} (hc : 0 < c) (hb : 0 < bWindow) (hγrough : 0 < γrough) (hvMax : vMax < 1) (hρ : 0 < ρ) : ∃ J₀ : ℕ, ∀ jStar : ℕ, J₀ < jStar → ∀ Kdet : ℝ, 0 ≤ Kdet → ∀ (D : ℝ) (J ell : ℕ) (B C R Kfull Tmod Sshift Cmod Sfreq W : ℝ), 0 < ell → 0 ≤ B → 0 ≤ Kfull → ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (rQ : ℕ) (hrQ : 0 < rQ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*rQ) → Bool) (hkeep : take ((candidateAllocationOrder c L rQ).symm (candidateRoughSlot c L rQ jStar hrQ hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L rQ jStar) → ℝ) (lo hi : ℕ) (aM vM ν₀ ν₁ : ℝ) (qM : ℕ) [NeZero qM] (χM : DirichletCharacter ℂ qM), vM ≤ vMax → (qM : ℝ) ≤ L^Cmod → |ν₀| ≤ L^Sfreq → |ν₁| ≤ L^Sfreq → ∀ (σ : ℝ) (qQ : ℕ) [NeZero qQ] (χQ : DirichletCharacter ℂ qQ), (qQ : ℝ) ≤ L^Tmod → |σ| ≤ L^Sshift → let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let α₀ := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₀ n) let α₁ := fun n => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) n : ℂ)* (χM (n : ZMod qM)*typeIIPhase ν₁ n) let β := fun n => if n ∈ candidateRoughBand c L jStar then typeIIPhase σ n*χQ (n : ZMod qQ) else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L rQ jStar hrQ hj take hkeep (candidateAllocationFourierTwist c L rQ jStar take ξ) n) ∀ (probes : candidatePIndices c L → Finset (Fin J)) (r t : Finset (candidatePIndices c L)) (hrt : Disjoint r t), (∀ g ∈ r ∪ t, g.val ∈ candidateBigPIndices c L) → ∀ (Q : ℕ), (Q : ℝ) ≤ L^R → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L^Kfull → ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ a b : ℝ, |a| ≤ L^W → let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j ‖(∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i), (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t i) aux : ℂ)* physicalPositiveHarmonicDifference P mass probes r t hrt Q (L^(-B)) (L^(-C)) i aux a b Z k pool α₀ β γ α₁ β γ) + (∑ ab : RepeatedBigPrimePatternPair (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab)), (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t (.inr ab)) aux : ℂ)* physicalFreePositiveHarmonicMain P mass probes r t hrt Q (L^(-B)) (L^(-C)) (.inr ab) aux a b Z k pool α₀ β γ α₁ β γ)‖ ≤ L^(-D) := by obtain ⟨J₀,hbase⟩ := exists_actual_rough_original_harmonic_decay_uniform_window hZeta hc hb hγrough hvMax hρ refine ⟨J₀,?_⟩ intro jStar hjStar Kdet hKdet D J ell B C R Kfull Tmod Sshift Cmod Sfreq W hell hB hKfull obtain ⟨A,_hA,hsum⟩ := exists_candidate_nonempty_pattern_sum_exponent hc J obtain ⟨S₀,hS₀,hdecay⟩ := hbase jStar hjStar Kdet hKdet (D+1+A) J ell B C R Kfull Tmod Sshift Cmod Sfreq W hell hB hKfull refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hdecay S hS,hsum, eventually_candidate_pattern_harmonic_decay hc hb hKdet (le_max_right R 0) (le_max_right C 0) J ell 0 (D+1), eventually_actual_rough_source_factor_properties hc hγrough, eventually_actual_remaining_factor_properties hc, eventually_ge_atTop (2 : ℝ)] with L hdec hsumL herror hfactor hremain hL intro rQ hrQ hj take hkeep ξ lo hi aM vM ν₀ ν₁ qM _ χM hvM hqM hν₀ hν₁ σ qQ _ χQ hqQ hσ P mass pool α₀ α₁ β γ probes r t hrt hbig Q hQ U V hUlo hUhi hVlo hVhi k hk hk0 hkfull j hjd a b ha Z have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hα₀ := hfactor S aM vM (Ioc lo hi) qM χM ν₀ have hα₁ := hfactor S aM vM (Ioc lo hi) qM χM ν₁ have hθ (n : ℕ) : ‖typeIIPhase σ n*χQ (n : ZMod qQ)‖ ≤ 1 := by rw [norm_mul,typeIIPhase_norm,one_mul] exact χQ.norm_le_one _ have hβγ := hremain rQ jStar hrQ hj take hkeep ξ _ hθ have hQ' : (Q : ℝ) ≤ L^(max R 0) := hQ.trans (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left _ _)) have hξ : L^(-(max C 0)) ≤ L^(-C) := Real.rpow_le_rpow_of_exponent_le hL1 (neg_le_neg (le_max_left _ _)) have he := herror (candidatePIndices c L) (subset_refl _) probes r t hrt Q (L^(-B)) (L^(-C)) hQ' hξ a b pool (fun g p hp => mem_biUnion.mpr ⟨g.val,g.property,hp⟩) α₀ β γ α₁ β γ (by simpa only [Real.rpow_zero] using hα₀.1) (by simpa only [Real.rpow_zero] using hβγ.1) (by simpa only [Real.rpow_zero] using hβγ.2.2) (by simpa only [Real.rpow_zero] using hα₁.1) (by simpa only [Real.rpow_zero] using hβγ.1) (by simpa only [Real.rpow_zero] using hβγ.2.2) U V hUlo hUhi hVlo hVhi k hk j hjd have hc' := hsumL (candidatePIndices c L) (subset_refl _) ell probes r t hrt (D+1) (fun ab => ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t (.inr ab)), (physicalAuxMass mass (repeatedBigPrimePatternCut probes r t (.inr ab)) aux : ℂ)* physicalFreePositiveHarmonicMain P mass probes r t hrt Q (L^(-B)) (L^(-C)) (.inr ab) aux a b Z k pool α₀ β γ α₁ β γ) (fun ab => hdec rQ hrQ hj take hkeep ξ lo hi aM vM ν₀ ν₁ qM χM hvM hqM hν₀ hν₁ σ qQ χQ hqQ hσ probes r t hrt hbig ab Q hQ U V hUlo hUhi hVlo hVhi k hk hk0 hkfull j hjd a b ha) calc _ ≤ L^(-(D+1)) + L^(-(D+1)) := (norm_add_le _ _).trans (_root_.add_le_add he hc') _ = 2*L^(-(D+1)) := by ring _ ≤ L*L^(-(D+1)) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = L^(-D) := by nth_rw 1 [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 ring end Bounty.WeakZeroFree namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree end section -- Source module: WeakActualRawBlocks /- Original raw and block estimates from the actual zero-free theorem, conditional only on the selected central moments. -/ open scoped Topology BigOperators Classical -- Source module: ActualRawShiftPower /- Preserve the distinction between determinant precision and the resulting shift exponent. -/ open Finset namespace Bounty theorem actual_determinant_shift_power {L K : ℝ} (hL : 3 ≤ L) (hK : 0 ≤ K) {k : ℤ} (hk : k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ)) : |(k : ℝ)| ≤ L^(K+89) := by have hL1 : 1 ≤ L := by linarith have hL0 : 0 < L := by linarith have hk' : |(k : ℝ)| ≤ (typeIIAdmissibleDeterminantBound L K : ℝ) := by apply abs_le.mpr obtain ⟨hklo, hkhi⟩ := mem_Icc.mp hk constructor · exact_mod_cast hklo · exact_mod_cast hkhi calc _ ≤ 3*L^(K+88) := hk'.trans (determinant_bound_le_three_rpow_public hL1 hK) _ ≤ L*L^(K+88) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = L^(K+89) := by calc L*L^(K+88) = L^(1 : ℝ)*L^(K+88) := by rw [Real.rpow_one] _ = L^((1 : ℝ)+(K+88)) := (Real.rpow_add hL0 _ _).symm _ = L^(K+89) := by congr 1; ring end Bounty -- Source module: PhysicalDExponentialBound /- Exponential bounds for physical dilation products and their finite maxima. -/ open Finset namespace Bounty theorem physical_D_le_exp {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} {B : ℝ} (hB : 0 ≤ B) (hP : ∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp B) (C : G → Finset (Fin J)) (labels : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P C) : (physicalD C labels aux : ℝ) ≤ Real.exp ((Fintype.card G : ℝ) * (2 * J) * B) := by classical have hprod (S : Finset (Fin J)) (f : S → ℕ) (hf : ∀ i, (f i : ℝ) ≤ Real.exp B) : ((∏ i, f i : ℕ) : ℝ) ≤ Real.exp ((J : ℝ) * B) := by calc _ = ∏ i : S, (f i : ℝ) := by simp only [Nat.cast_prod] _ ≤ ∏ _i : S, Real.exp B := prod_le_prod₀ (fun _ _ => Nat.cast_nonneg _) (fun i _ => hf i) _ = Real.exp ((S.card : ℝ) * B) := by rw [← Real.exp_sum] simp only [sum_const, card_univ, Fintype.card_coe, nsmul_eq_mul] _ ≤ Real.exp ((J : ℝ) * B) := by apply Real.exp_le_exp.mpr apply mul_le_mul_of_nonneg_right _ hB exact_mod_cast (show S.card ≤ J by simpa using card_le_univ S) have hg (g : G) : (physicalGroupD C labels aux g : ℝ) ≤ Real.exp ((2 * J : ℝ) * B) := by have hleft := hprod (univ \ C g) (fun j => (labels g (Sum.inl j.val)).val) (fun j => hP g _ (labels g (Sum.inl j.val)).property) rw [Finset.prod_coe_sort (univ \ C g) (fun j => (labels g (Sum.inl j)).val)] at hleft have hright := hprod (C g) (fun j => (aux g j).val) (fun j => hP g _ (aux g j).property) calc _ ≤ Real.exp ((J : ℝ)*B) * Real.exp ((J : ℝ)*B) := by unfold physicalGroupD rw [Nat.cast_mul] exact mul_le_mul hleft hright (Nat.cast_nonneg _) (Real.exp_pos _).le _ = _ := by rw [← Real.exp_add]; congr 1; ring calc _ = ∏ g, (physicalGroupD C labels aux g : ℝ) := by simp only [physicalD, Nat.cast_prod] _ ≤ ∏ _g : G, Real.exp ((2 * J : ℝ) * B) := prod_le_prod₀ (fun _ _ => Nat.cast_nonneg _) (fun g _ => hg g) _ = _ := by rw [← Real.exp_sum] simp only [sum_const, card_univ, nsmul_eq_mul] congr 1 ring theorem physical_D_max_le_exp {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} {B : ℝ} (hB : 0 ≤ B) (hP : ∀ g p, p ∈ P g → (p : ℝ) ≤ Real.exp B) (C : G → Finset (Fin J)) : (physicalDMax P J ell C : ℝ) ≤ Real.exp ((Fintype.card G : ℝ) * (2 * J) * B) := by classical rw [physicalDMax, ← Nat.le_floor_iff (Real.exp_pos _).le] apply Finset.sup_le intro a _ exact Nat.le_floor (physical_D_le_exp hB hP C a.1 a.2) end Bounty -- Source module: ScaledLogPower /- A fixed logarithmic cost fits inside any larger power. -/ open Filter namespace Bounty theorem eventually_scaled_log_power {A s t ε : ℝ} (hA : 0 ≤ A) (hst : s < t) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, A*L^s*Real.log L ≤ ε*L^t := by have hsmall := ((isLittleO_log_rpow_atTop (sub_pos.mpr hst)).const_mul_left A).bound hε filter_upwards [hsmall, eventually_ge_atTop (1 : ℝ)] with L hb hL have hL0 : 0 < L := zero_lt_one.trans_le hL have hn : A*Real.log L ≤ ε*L^(t-s) := by simpa only [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hA (Real.log_nonneg hL)), abs_of_nonneg (Real.rpow_nonneg hL0.le (t-s))] using hb calc _ = L^s*(A*Real.log L) := by ring _ ≤ L^s*(ε*L^(t-s)) := mul_le_mul_of_nonneg_left hn (Real.rpow_nonneg hL0.le s) _ = ε*(L^s*L^(t-s)) := by ring _ = ε*L^t := by rw [← Real.rpow_add hL0]; congr 2; ring end Bounty -- Source module: CandidateStepSublinear /- The dilation range of candidate pools is subexponential, uniformly in cuts. -/ open Finset Filter namespace Bounty theorem eventually_candidate_D_max_le_exp_power {c ε t : ℝ} (hc : 0 < c) (hε : 0 < ε) (ht : (2/5 : ℝ) < t) (J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) (C : S → Finset (Fin J)), (physicalDMax (fun g : S => candidatePBand (c*L) g.val) J ell C : ℝ) ≤ Real.exp (ε*L^t) := by obtain ⟨v, W, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc let D : ℝ := (2 * J) * (2/(5*Real.log 2)) filter_upwards [hpool, eventually_scaled_log_power (A := D) (by dsimp [D]; positivity) (s := (2/5 : ℝ)) ht hε] with L hp hscaled intro S hS ell C have hL : 0 ≤ L := zero_le_one.trans hp.1 have hScard : (S.card : ℝ) ≤ (2/(5*Real.log 2))*Real.log L := (Nat.cast_le.mpr (card_le_card hS)).trans hp.2.2.2.1 have hlabels (g : S) (p : ℕ) (hpm : p ∈ candidatePBand (c*L) g.val) : (p : ℝ) ≤ Real.exp (L^(2/5 : ℝ)) := ((hp.2.2.2.2.2 g.val (hS g.property)).2.2 p hpm).2.2 calc _ ≤ Real.exp ((S.card : ℝ) * (2 * J) * L^(2/5 : ℝ)) := by simpa only [Fintype.card_coe] using physical_D_max_le_exp (J := J) (ell := ell) (Real.rpow_nonneg (zero_le_one.trans hp.1) _) hlabels C _ ≤ Real.exp (D * L^(2/5 : ℝ) * Real.log L) := by apply Real.exp_le_exp.mpr have hh := mul_le_mul_of_nonneg_right hScard (show 0 ≤ (2 * J : ℝ) * L^(2/5 : ℝ) by positivity) dsimp [D] nlinarith _ ≤ _ := Real.exp_le_exp.mpr hscaled end Bounty -- Source module: PolynomialPowerExponential /- Any positive power exponential absorbs a fixed polynomial. -/ open Filter namespace Bounty theorem eventually_rpow_le_exp_power (K : ℝ) {t ε : ℝ} (ht : 0 < t) (hε : 0 < ε) : ∀ᶠ L : ℝ in atTop, L^K ≤ Real.exp (ε*L^t) := by filter_upwards [eventually_scaled_log_power (A := max K 0) (le_max_right _ _) (s := 0) ht hε, eventually_ge_atTop (1 : ℝ)] with L hscale hL have hL0 : 0 < L := zero_lt_one.trans_le hL simp only [Real.rpow_zero, mul_one] at hscale rw [Real.rpow_def_of_pos hL0] apply Real.exp_le_exp.mpr calc Real.log L*K = K*Real.log L := mul_comm _ _ _ ≤ max K 0*Real.log L := mul_le_mul_of_nonneg_right (le_max_left _ _) (Real.log_nonneg hL) _ ≤ ε*L^t := hscale end Bounty -- Source module: CandidatePositiveStepPower /- A positive displacement bound with a sublinear logarithm. -/ open Finset Filter namespace Bounty theorem eventually_candidate_positive_step_power {c t ε : ℝ} (hc : 0 < c) (ht : (2/5 : ℝ) < t) (hε : 0 < ε) (J : ℕ) (K : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) {I : Type} (patterns : Finset I) (C : I → S → Finset (Fin J)) (k : I → ℤ), (∀ i ∈ patterns, |(k i : ℝ)| ≤ L^K) → ((max 1 (physicalOperatorStepBound (fun g : S => candidatePBand (c*L) g.val) J ell patterns C k) : ℕ) : ℝ) ≤ Real.exp (ε*L^t) := by have hε2 : 0 < ε/2 := by positivity have ht0 : 0 < t := by linarith filter_upwards [eventually_candidate_D_max_le_exp_power hc hε2 ht J, eventually_rpow_le_exp_power K ht0 hε2, eventually_ge_atTop (1 : ℝ)] with L hD hpoly hL intro S hS ell I patterns C k hk have hL0 : 0 ≤ L := zero_le_one.trans hL rw [Nat.cast_max, Nat.cast_one] apply max_le · exact Real.one_le_exp_iff.mpr (mul_nonneg hε.le (Real.rpow_nonneg hL0 _)) · rw [← Nat.le_floor_iff (Real.exp_pos _).le] apply Finset.sup_le intro i hi apply Nat.le_floor unfold physicalStepBound rw [Nat.cast_mul, Nat.cast_natAbs, Int.cast_abs] calc _ ≤ Real.exp (ε/2*L^t) * Real.exp (ε/2*L^t) := mul_le_mul ((hk i hi).trans hpoly) (hD S hS ell (C i)) (Nat.cast_nonneg _) (Real.exp_pos _).le _ = _ := by rw [← Real.exp_add]; congr 1; ring end Bounty -- Source module: PolynomialSqrtRadius /- Polynomial lengths times a square-root exponential fit in a linear exponential. -/ open Filter namespace Bounty theorem eventually_polynomial_sqrt_radius (M : ℝ) {b : ℝ} (hb : 0 < b) : ∀ᶠ L : ℝ in atTop, L^M * Real.exp (Real.sqrt L) ≤ Real.exp (b*L)/8 := by filter_upwards [eventually_exp_neg_rpow_mul_rpow_mul_exp_sqrt_le (b := (1 : ℝ)) (by norm_num) hb (show (0 : ℝ) ≤ 1 by norm_num) M 1, eventually_ge_atTop (8 : ℝ)] with L hd hL simp only [Real.rpow_one, one_mul, Real.rpow_neg_one] at hd have hinv : L⁻¹ ≤ (8 : ℝ)⁻¹ := inv_anti₀ (by norm_num) hL have hdiv : (L^M * Real.exp (Real.sqrt L)) / Real.exp (b*L) ≤ (8 : ℝ)⁻¹ := by simpa only [neg_mul, mul_neg, Real.exp_neg, div_eq_mul_inv, mul_assoc, mul_comm, mul_left_comm] using hd.trans hinv have h := (div_le_iff₀ (Real.exp_pos (b*L))).mp hdiv simpa only [div_eq_mul_inv, mul_comm] using h end Bounty -- Source module: CandidatePositiveGraphRadius /- The positive step bound needed by the block inequality obeys the same localization scale. -/ open Finset Filter namespace Bounty theorem eventually_candidate_positive_graph_radius {c b : ℝ} (hc : 0 < c) (hb : 0 < b) (J : ℕ) (K M : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) {I : Type} (patterns : Finset I) (C : I → S → Finset (Fin J)) (k : I → ℤ), (∀ i ∈ patterns, |(k i : ℝ)| ≤ L^K) → ∀ N : ℕ, (N : ℝ) ≤ L^M → ((N * max 1 (physicalOperatorStepBound (fun g : S => candidatePBand (c*L) g.val) J ell patterns C k) : ℕ) : ℝ) ≤ Real.exp (b*L)/8 := by filter_upwards [eventually_candidate_positive_step_power hc (t := (1/2 : ℝ)) (by norm_num) (show (0 : ℝ) < 1 by norm_num) J K, eventually_polynomial_sqrt_radius M hb, eventually_ge_atTop (1 : ℝ)] with L hs hr hL intro S hS ell I patterns C k hk N hN have hstep := hs S hS ell patterns C k hk rw [one_mul, ← Real.sqrt_eq_rpow] at hstep calc _ ≤ L^M * Real.exp (Real.sqrt L) := by rw [Nat.cast_mul] exact mul_le_mul hN hstep (Nat.cast_nonneg _) (Real.rpow_nonneg (zero_le_one.trans hL) _) _ ≤ _ := hr end Bounty -- Source module: PositiveDyadicGraphRadius /- The chosen moment length localizes the positive physical displacement bound. -/ open Finset Filter namespace Bounty theorem eventually_candidate_positive_dyadic_radius {c b : ℝ} (hc : 0 < c) (hb : 0 < b) (J : ℕ) (K : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) {I : Type} (patterns : Finset I) (C : I → S → Finset (Fin J)) (k : I → ℤ), (∀ i ∈ patterns, |(k i : ℝ)| ≤ L^K) → ∀ Z : ℝ, Real.exp (b*L) ≤ Z → (((2 * ⌈L^(13/25 : ℝ)⌉₊) * max 1 (physicalOperatorStepBound (fun g : S => candidatePBand (c*L) g.val) J ell patterns C k) : ℕ) : ℝ) ≤ Z/8 := by filter_upwards [eventually_candidate_positive_graph_radius hc hb J K 1, eventually_repeated_big_visit_density_le (alpha := (13/25 : ℝ)) (tau := 1) (by norm_num) (by norm_num)] with L hradius hlength intro S hS ell I patterns C k hk Z hZ have hN : (((2 * ⌈L^(13/25 : ℝ)⌉₊ : ℕ) : ℝ)) ≤ L^((1 : ℝ)) := by apply hlength push_cast linarith exact (hradius S hS ell patterns C k hk _ hN).trans (div_le_div_of_nonneg_right hZ (by norm_num)) theorem eventually_raw_moment_at_least_two : ∀ᶠ L : ℝ in atTop, 2 ≤ ⌈L^(13/25 : ℝ)⌉₊ := by filter_upwards [(tendsto_rpow_atTop (by norm_num : (0 : ℝ) < 13/25)).eventually_ge_atTop 2] with L hL exact_mod_cast hL.trans (Nat.le_ceil (L^(13/25 : ℝ))) end Bounty -- Source module: PhysicalPoolSharedScale /- Shared-prime stripping for every pool containing the original prime groups. -/ open Finset namespace Bounty theorem positive_invariant_endpoint_shared_scale_of_pool {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (hprime : ∀ g p, p ∈ P g → p.Prime) (pool : Finset ℕ) (hpool : ∀ g, P g ⊆ pool) (α β γ : ℕ → ℂ) (L : PhysicalMarkLists P J ell) (w : ℤ) : positiveInvariantEndpoint pool α β γ ((physicalSharedFactor C L : ℤ) * w) = positiveInvariantEndpoint pool α β γ w := by have hs : 0 < (physicalSharedFactor C L : ℤ) := by exact_mod_cast physical_shared_factor_pos C L hprime have hm : physicalSharedFactor C L ∈ Nat.factoredNumbers pool := Nat.factoredNumbers_mono (by intro p hp obtain ⟨g, _, hp⟩ := mem_biUnion.mp hp exact hpool g hp) (physical_shared_factor_supported C L hprime) have he : invariantTripleEndpoint pool α β γ ((physicalSharedFactor C L : ℤ) * w).natAbs = invariantTripleEndpoint pool α β γ w.natAbs := by simpa only [Int.natAbs_mul, Int.natAbs_natCast] using invariant_triple_endpoint_mul_supported hm α β γ w.natAbs simp only [positiveInvariantEndpoint, mul_pos_iff_of_pos_left hs, he] end Bounty -- Source module: PhysicalPoolPositiveRoot /- The original positive harmonic root on its literal dyadic support. -/ open Finset open scoped Classical namespace Bounty theorem physical_prime_positive_harmonic_root_of_pool {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (pool : Finset ℕ) (hpool : ∀ g, P g ⊆ pool) (q a b : ℝ) (k : ℤ) (positions : Finset ℤ) (α₀ β₀ γ₀ α₁ β₁ γ₁ : ℕ → ℂ) {Z : ℝ} (hZ : 0 < Z) (hclosure : physicalFixedAuxPositionClosure P (repeatedBigPrimePatternCut probes r t i) ell k aux (harmonicPositiveSupport Z k (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux)) ⊆ positions) : physicalFixedRootCorrelation V (repeatedBigPrimePatternCut probes r t i) q (-(a+b)) k (physicalRootPrimeKernel P V probes r t hrt Q h ξ i) aux positions (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α₀ β₀ γ₀ n) (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α₁ β₁ γ₁ n) (fun x => (typeIIHarmonicDyadic x : ℂ)) Z = (physicalAuxMass V (repeatedBigPrimePatternCut probes r t i) aux : ℂ) * ∑ w ∈ harmonicPositiveSupport Z k (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux), ((typeIIHarmonicDyadic ((w : ℝ) / (Z * physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux)) : ℂ) * (w : ℂ)⁻¹ * (starRingEnd ℂ) (invariantTripleEndpoint pool α₀ β₀ γ₀ w.natAbs) * invariantTripleEndpoint pool α₁ β₁ γ₁ (w + k * (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux : ℕ)).natAbs) * physicalFullPairCorrelation P (repeatedBigPrimePatternCut probes r t i) V q w.natAbs (w + k * (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux : ℕ)).natAbs (physicalOriginalPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b w.natAbs (w + k * (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux : ℕ)).natAbs) := by have hd : 0 < physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux := prod_pos (fun g _ => prod_pos (fun j _ => (hprime g _ (aux g j).property).pos)) have hbase := physical_fixed_root_full_pair_on_fixed_support hdis hprime V (repeatedBigPrimePatternCut probes r t i) q a b k (physicalRootPrimeKernel P V probes r t hrt Q h ξ i) aux positions (harmonicPositiveSupport Z k (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux)) hclosure (positiveInvariantEndpoint pool α₀ β₀ γ₀) (positiveInvariantEndpoint pool α₁ β₁ γ₁) (fun x => (typeIIHarmonicDyadic x : ℂ)) Z (positive_invariant_endpoint_shared_scale_of_pool _ hprime pool hpool α₀ β₀ γ₀) (positive_invariant_endpoint_shared_scale_of_pool _ hprime pool hpool α₁ β₁ γ₁) (original_harmonic_test_support pool α₀ β₀ γ₀ α₁ β₁ γ₁ hZ k hd) apply Eq.trans hbase congr 1 apply sum_congr rfl intro w hw have hs := mem_harmonic_positive_support hw rw [positiveInvariantEndpoint, if_pos hs.1, positiveInvariantEndpoint, if_pos hs.2.2.2] rfl end Bounty -- Source module: PhysicalHarmonicResidual /- The literal signed full-pair harmonic residual. Pattern weights already occur inside the original coefficient and are not multiplied in again. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) noncomputable def physicalSignedPositiveHarmonicResidual : ℂ := ∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i), let cut := repeatedBigPrimePatternCut probes r t i let d := physicalFreeFactor cut aux let δ : ℤ := k*(d : ℤ) (physicalAuxMass V cut aux : ℂ) * ∑ n ∈ harmonicPositiveSupport Z k d, ((typeIIHarmonicDyadic ((n : ℝ)/(Z*(d : ℝ))) : ℂ)/(n : ℂ)) * star (invariantTripleEndpoint pool α β γ n.natAbs) * invariantTripleEndpoint pool α' β' γ' (n+δ).natAbs * physicalFullPairCorrelation P cut V (1/2) n.natAbs (n+δ).natAbs (physicalOriginalPrimePairCoefficient P V probes r t hrt Q h ξ i aux a b n.natAbs (n+δ).natAbs) theorem physical_harmonic_residual_decomposition : physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' = (∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) aux : ℂ) * physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ (.inl ()) aux a b Z k pool α β γ α' β' γ') + (∑ ab : RepeatedBigPrimePatternPair (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inr ab)), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t (.inr ab)) aux : ℂ) * physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ (.inr ab) aux a b Z k pool α β γ α' β' γ') + (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t i), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t i) aux : ℂ) * physicalPositiveHarmonicDifference P V probes r t hrt Q h ξ i aux a b Z k pool α β γ α' β' γ') := by unfold physicalSignedPositiveHarmonicResidual calc _ = (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t i), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t i) aux : ℂ) * physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ i aux a b Z k pool α β γ α' β' γ') + (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t i), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t i) aux : ℂ) * physicalPositiveHarmonicDifference P V probes r t hrt Q h ξ i aux a b Z k pool α β γ α' β' γ') := by rw [← sum_add_distrib] apply sum_congr rfl intro i _ rw [← sum_add_distrib] apply sum_congr rfl intro aux _ rw [physical_positive_harmonic_difference_eq_main] dsimp only ring _ = _ := by congr 1 rw [Fintype.sum_sum_type] simp only [Fintype.sum_unique] end end Bounty -- Source module: PhysicalSignedRootIdentity /- The complete signed harmonic residual is a single physical root pairing. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) noncomputable def physicalSignedHarmonicPositions : Finset ℤ := univ.biUnion (fun i : RepeatedBigPrimePatternIndex (ell := ell) probes r t => univ.biUnion (fun aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i) => physicalFixedAuxPositionClosure P (repeatedBigPrimePatternCut probes r t i) ell k aux (harmonicPositiveSupport Z k (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux)))) theorem physical_signed_harmonic_position_coverage (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) : physicalFixedAuxPositionClosure P (repeatedBigPrimePatternCut probes r t i) ell k aux (harmonicPositiveSupport Z k (physicalFreeFactor (repeatedBigPrimePatternCut probes r t i) aux)) ⊆ physicalSignedHarmonicPositions (ell := ell) P probes r t Z k := by intro n hn exact mem_biUnion.mpr ⟨i, mem_univ _, mem_biUnion.mpr ⟨aux, mem_univ _, hn⟩⟩ theorem physical_signed_harmonic_residual_eq_root (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (hpool : ∀ g, P g ⊆ pool) (hZ : 0 < Z) (positions : Finset ℤ) (hclosure : physicalSignedHarmonicPositions (ell := ell) P probes r t Z k ⊆ positions) : physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' = physicalMellinRootCorrelation V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) positions (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n) (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n) (fun x => (typeIIHarmonicDyadic x : ℂ)) Z := by rw [physical_mellin_root_sum_fixed] unfold physicalSignedPositiveHarmonicResidual apply sum_congr rfl intro i _ apply sum_congr rfl intro aux _ rw [physical_prime_positive_harmonic_root_of_pool P V probes r t hrt Q h ξ i aux hdis hprime pool hpool (1/2) a b k positions α β γ α' β' γ' hZ ((physical_signed_harmonic_position_coverage P probes r t Z k i aux).trans hclosure)] simp only [div_eq_mul_inv, starRingEnd_apply] end end Bounty -- Source module: PhysicalSignedPositionBounds /- The canonical physical positions and every associated source dyad stay above the harmonic scale. -/ open Finset open scoped Classical namespace Bounty theorem physical_fixed_aux_closure_lower {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) (hprime : ∀ g p, p ∈ P g → p.Prime) {Z : ℝ} (hZ : 0 < Z) (k : ℤ) (hk : |(k : ℝ)| ≤ Z/4) {n : ℤ} (hn : n ∈ physicalFixedAuxPositionClosure P C ell k aux (harmonicPositiveSupport Z k (physicalFreeFactor C aux))) : Z/4 < (n : ℝ) := by obtain ⟨L, _, hn⟩ := mem_biUnion.mp hn have hs : (1 : ℝ) ≤ physicalSharedFactor C L := by exact_mod_cast physical_shared_factor_pos C L hprime have hdN : 0 < physicalFreeFactor C aux := prod_pos (fun g _ => prod_pos (fun j _ => (hprime g _ (aux g j).property).pos)) have hd : (1 : ℝ) ≤ physicalFreeFactor C aux := by exact_mod_cast hdN have hmul (x : ℝ) (hx : Z/4 < x) : Z/4 < (physicalSharedFactor C L : ℝ)*x := by have hx0 : 0 ≤ x := le_of_lt ((by positivity : 0 < Z/4).trans hx) nlinarith [mul_nonneg (sub_nonneg.mpr hs) hx0] rcases mem_union.mp hn with hn | hn · obtain ⟨w, hw, rfl⟩ := mem_image.mp hn have hw' := mem_harmonic_positive_support hw push_cast apply hmul nlinarith [mul_nonneg hZ.le (sub_nonneg.mpr hd)] · obtain ⟨w, hw, rfl⟩ := mem_image.mp hn have hw' := mem_harmonic_positive_support hw have hklo := (abs_le.mp hk).1 have hkm := mul_le_mul_of_nonneg_right hklo (Nat.cast_nonneg (physicalFreeFactor C aux)) push_cast apply hmul nlinarith [mul_nonneg hZ.le (sub_nonneg.mpr hd)] theorem physical_signed_harmonic_positions_lower {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hprime : ∀ g p, p ∈ P g → p.Prime) {Z : ℝ} (hZ : 0 < Z) (k : ℤ) (hk : |(k : ℝ)| ≤ Z/4) {n : ℤ} (hn : n ∈ physicalSignedHarmonicPositions (ell := ell) P probes r t Z k) : Z/4 < (n : ℝ) := by obtain ⟨i, _, hn⟩ := mem_biUnion.mp hn obtain ⟨aux, _, hn⟩ := mem_biUnion.mp hn exact physical_fixed_aux_closure_lower (ell := ell) (repeatedBigPrimePatternCut probes r t i) aux hprime hZ k hk hn theorem physical_signed_harmonic_dyadic_lower {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hprime : ∀ g p, p ∈ P g → p.Prime) {Z : ℝ} (hZ : 0 < Z) (k : ℤ) (hk : |(k : ℝ)| ≤ Z/4) {j : ℕ} (hj : j ∈ (physicalSignedHarmonicPositions (ell := ell) P probes r t Z k).image (fun n => n.natAbs.log2)) : Z/8 < (2 : ℝ)^j := by obtain ⟨n, hn, hj⟩ := mem_image.mp hj have hl := physical_signed_harmonic_positions_lower probes r t hprime hZ k hk hn have hn0 : 0 < n := by exact_mod_cast ((by positivity : (0 : ℝ) < Z/4).trans hl) have hb := (Nat.log2_eq_iff (Int.natAbs_ne_zero.mpr (ne_of_gt hn0))).mp hj have he : (n.natAbs : ℤ) = n := by rw [Int.natCast_natAbs, abs_of_pos hn0] have he' : (n.natAbs : ℝ) = n := by calc (n.natAbs : ℝ) = ((n.natAbs : ℤ) : ℝ) := by simp _ = (n : ℝ) := congrArg (fun z : ℤ => (z : ℝ)) he have hb' : (n.natAbs : ℝ) < (2 : ℝ)^(j+1) := by exact_mod_cast hb.2 rw [he', pow_succ] at hb' linarith theorem physical_signed_harmonic_dyadic_radius {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hprime : ∀ g p, p ∈ P g → p.Prime) {Z : ℝ} (hZ : 0 < Z) (k : ℤ) (hk : |(k : ℝ)| ≤ Z/4) {j radius : ℕ} (hr : (radius : ℝ) ≤ Z/8) (hj : j ∈ (physicalSignedHarmonicPositions (ell := ell) P probes r t Z k).image (fun n => n.natAbs.log2)) : radius ≤ 2^j := by exact_mod_cast (hr.trans_lt (physical_signed_harmonic_dyadic_lower probes r t hprime hZ k hk hj)).le end Bounty -- Source module: PhysicalPositionUpper /- Upper bounds for the complete source and target position closure. -/ open Finset open scoped Classical namespace Bounty theorem physical_fixed_aux_closure_upper {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (C : G → Finset (Fin J)) (aux : PhysicalAuxLabels P C) {Z : ℝ} (hZ : 0 ≤ Z) (k : ℤ) (hk : |(k : ℝ)| ≤ Z) {n : ℤ} (hn : n ∈ physicalFixedAuxPositionClosure P C ell k aux (harmonicPositiveSupport Z k (physicalFreeFactor C aux))) : (n : ℝ) ≤ 3*Z*(physicalDMax P J ell C : ℝ) := by obtain ⟨L, _, hn⟩ := mem_biUnion.mp hn have hmax : (physicalD C L aux : ℝ) ≤ physicalDMax P J ell C := Nat.cast_le.mpr (physical_D_le_max P J ell C L aux) have htop : 3*Z*(physicalD C L aux : ℝ) ≤ 3*Z*(physicalDMax P J ell C : ℝ) := mul_le_mul_of_nonneg_left hmax (by positivity) rw [physical_D_shared_free, Nat.cast_mul] at htop have hs : (0 : ℝ) ≤ physicalSharedFactor C L := Nat.cast_nonneg _ have hd : (0 : ℝ) ≤ physicalFreeFactor C aux := Nat.cast_nonneg _ rcases mem_union.mp hn with hn | hn · obtain ⟨w, hw, rfl⟩ := mem_image.mp hn have hw' := (mem_harmonic_positive_support hw).2.2.1 push_cast calc _ ≤ (physicalSharedFactor C L : ℝ)*(2*Z*(physicalFreeFactor C aux : ℝ)) := mul_le_mul_of_nonneg_left hw' hs _ ≤ 3*Z*((physicalSharedFactor C L : ℝ)*(physicalFreeFactor C aux : ℝ)) := by nlinarith [mul_nonneg hZ (mul_nonneg hs hd)] _ ≤ _ := htop · obtain ⟨w, hw, rfl⟩ := mem_image.mp hn have hw' := (mem_harmonic_positive_support hw).2.2.1 have hk' := mul_le_mul_of_nonneg_right ((le_abs_self (k : ℝ)).trans hk) hd push_cast calc _ ≤ (physicalSharedFactor C L : ℝ)*(3*Z*(physicalFreeFactor C aux : ℝ)) := by apply mul_le_mul_of_nonneg_left _ hs linarith _ = 3*Z*((physicalSharedFactor C L : ℝ)*(physicalFreeFactor C aux : ℝ)) := by ring _ ≤ _ := htop theorem physical_signed_harmonic_positions_upper {G : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) {Z H : ℝ} (hZ : 0 ≤ Z) (k : ℤ) (hk : |(k : ℝ)| ≤ Z) (hD : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, (physicalDMax P J ell (repeatedBigPrimePatternCut probes r t i) : ℝ) ≤ H) {n : ℤ} (hn : n ∈ physicalSignedHarmonicPositions (ell := ell) P probes r t Z k) : (n : ℝ) ≤ 3*Z*H := by obtain ⟨i, _, hn⟩ := mem_biUnion.mp hn obtain ⟨aux, _, hn⟩ := mem_biUnion.mp hn exact (physical_fixed_aux_closure_upper (repeatedBigPrimePatternCut probes r t i) aux hZ k hk hn).trans (mul_le_mul_of_nonneg_left (hD i) (by positivity)) end Bounty -- Source module: CandidateDExponentialBound /- The dilation range of candidate pools is subexponential, uniformly in cuts. -/ open Finset Filter namespace Bounty theorem eventually_candidate_D_max_le_exp {c ε : ℝ} (hc : 0 < c) (hε : 0 < ε) (J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) (C : S → Finset (Fin J)), (physicalDMax (fun g : S => candidatePBand (c*L) g.val) J ell C : ℝ) ≤ Real.exp (ε*L) := by obtain ⟨v, W, _, _, hpool⟩ := exists_candidate_P_pool_bounds hc let D : ℝ := (2 * J) * (2/(5*Real.log 2)) filter_upwards [hpool, eventually_scaled_log_sublinear (A := D) (by dsimp [D]; positivity) (s := (2/5 : ℝ)) (by norm_num) hε] with L hp hscaled intro S hS ell C have hL : 0 ≤ L := zero_le_one.trans hp.1 have hScard : (S.card : ℝ) ≤ (2/(5*Real.log 2))*Real.log L := (Nat.cast_le.mpr (card_le_card hS)).trans hp.2.2.2.1 have hlabels (g : S) (p : ℕ) (hpm : p ∈ candidatePBand (c*L) g.val) : (p : ℝ) ≤ Real.exp (L^(2/5 : ℝ)) := ((hp.2.2.2.2.2 g.val (hS g.property)).2.2 p hpm).2.2 calc _ ≤ Real.exp ((S.card : ℝ) * (2 * J) * L^(2/5 : ℝ)) := by simpa only [Fintype.card_coe] using physical_D_max_le_exp (J := J) (ell := ell) (Real.rpow_nonneg (zero_le_one.trans hp.1) _) hlabels C _ ≤ Real.exp (D * L^(2/5 : ℝ) * Real.log L) := by apply Real.exp_le_exp.mpr have hh := mul_le_mul_of_nonneg_right hScard (show 0 ≤ (2 * J : ℝ) * L^(2/5 : ℝ) by positivity) dsimp [D] nlinarith _ ≤ _ := Real.exp_le_exp.mpr hscaled end Bounty -- Source module: CandidatePositionUpper /- The candidate position closure is contained in a fixed exponential interval. -/ open Finset Filter namespace Bounty theorem eventually_candidate_harmonic_positions_upper {c : ℝ} (hc : 0 < c) (J : ℕ) (a : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r t : Finset S) (Z : ℝ) (k : ℤ), 0 ≤ Z → Z ≤ Real.exp (a*L) → |(k : ℝ)| ≤ Z → ∀ n ∈ physicalSignedHarmonicPositions (ell := ell) (fun g : S => candidatePBand (c*L) g.val) probes r t Z k, (n : ℝ) ≤ Real.exp ((a+2)*L) := by filter_upwards [eventually_candidate_D_max_le_exp hc (show (0 : ℝ) < 1 by norm_num) J, eventually_ge_atTop (Real.log (3 : ℝ))] with L hd hL intro S hS ell probes r t Z k hZ hZhi hk n hn have h3 : (3 : ℝ) ≤ Real.exp L := by rw [← Real.exp_log (by norm_num : (0 : ℝ) < 3)] exact Real.exp_le_exp.mpr hL have hbound := physical_signed_harmonic_positions_upper probes r t hZ k hk (fun i => hd S hS ell (repeatedBigPrimePatternCut probes r t i)) hn rw [one_mul] at hbound calc (n : ℝ) ≤ 3*Z*Real.exp L := hbound _ ≤ Real.exp L * Real.exp (a*L) * Real.exp L := by gcongr _ = Real.exp ((a+2)*L) := by rw [← Real.exp_add, ← Real.exp_add] congr 1 ring end Bounty -- Source module: ActualPositionBounds /- Canonical positions for the original harmonic windows are positive and exponentially bounded. -/ open Finset Filter namespace Bounty theorem eventually_actual_harmonic_positions_bounds {c b K : ℝ} (hc : 0 < c) (hb : 0 < b) (hK : 0 ≤ K) (J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r t : Finset S), ∀ U V : ℝ, Real.exp (b*L) ≤ U → U ≤ Real.exp L → Real.exp (b*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ n ∈ physicalSignedHarmonicPositions (ell := ell) (fun g : S => candidatePBand (c*L) g.val) probes r t (typeIISmoothDyadicScale U V (U*L^(-K)) j) k, 0 < n ∧ (n : ℝ) ≤ Real.exp (6*L) := by filter_upwards [eventually_candidate_harmonic_positions_upper hc J 4, eventually_actual_harmonic_scale_inputs hb hK, eventually_typeII_original_harmonic_shift_small hb hK] with L hupper hscale hshift intro S hS ell probes r t U V hUlo hUhi hVlo hVhi k hk j hj n hn obtain ⟨hZ, _, hkZ, hZhi⟩ := hscale U V hUlo hUhi hVlo hVhi k hk j hj have hkquarter := hshift U V hUlo hUhi hVlo hVhi k hk j hj have hprime (g : S) (p : ℕ) (hp : p ∈ candidatePBand (c*L) g.val) : p.Prime := ((mem_dyadicPrimeBand_iff (c*L) (3/2) (9/5) g.val p).mp hp).1 have hlower := physical_signed_harmonic_positions_lower probes r t hprime hZ k hkquarter hn refine ⟨?_, ?_⟩ · have hpos : (0 : ℝ) < n := lt_trans (div_pos hZ (by norm_num)) hlower exact_mod_cast hpos · have hu := hupper S hS ell probes r t _ k hZ.le (by linarith) hkZ n hn norm_num only [show (4 : ℝ)+2=6 by norm_num] at hu exact hu end Bounty -- Source module: ActualRawDyadicRadius /- The original determinant and harmonic windows supply the literal raw moment radius. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_actual_raw_dyadic_radius {c b K : ℝ} (hc : 0 < c) (hb : 0 < b) (hK : 0 ≤ K) (J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r t : Finset S), ∀ U V : ℝ, Real.exp (b*L) ≤ U → U ≤ Real.exp L → Real.exp (b*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), let P := fun g : S => candidatePBand (c*L) g.val let Z := typeIISmoothDyadicScale U V (U*L^(-K)) j let D := max 1 (physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k)) ∀ i ∈ (physicalSignedHarmonicPositions (ell := ell) P probes r t Z k).image (fun n => n.natAbs.log2), 2*⌈L^(13/25 : ℝ)⌉₊*D ≤ 2^i := by filter_upwards [eventually_candidate_positive_dyadic_radius hc hb J (K+89), eventually_typeII_harmonic_scale_lower hb hK, eventually_typeII_original_harmonic_shift_small hb hK, eventually_ge_atTop (3 : ℝ)] with L hradius hlower hshift hL intro S hS ell probes r t U V hUlo hUhi hVlo hVhi k hk j hj dsimp only intro i hi have hlow := hlower U V hUlo hVlo j have hZ : 0 < typeIISmoothDyadicScale U V (U*L^(-K)) j := by have hp := Real.exp_pos (b*L) linarith have hzexp : Real.exp (b*L) ≤ typeIISmoothDyadicScale U V (U*L^(-K)) j := by have hp := Real.exp_pos (b*L) linarith have hprime (g : S) (p : ℕ) (hp : p ∈ candidatePBand (c*L) g.val) : p.Prime := ((mem_dyadicPrimeBand_iff (c*L) (3/2) (9/5) g.val p).mp hp).1 have hrad := hradius S hS ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k) (fun _ _ => actual_determinant_shift_power hL hK hk) _ hzexp exact physical_signed_harmonic_dyadic_radius probes r t hprime hZ k (hshift U V hUlo hUhi hVlo hVhi k hk j hj) hrad hi end Bounty -- Source module: CandidateBlockMoment /- The block supremum cost is uniformly bounded at the chosen moment order. -/ open Finset Filter namespace Bounty theorem eventually_candidate_block_moment {c C₀ : ℝ} (hc : 0 < c) (hC : 0 ≤ C₀) (J : ℕ) (K : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) {I : Type} (patterns : Finset I) (C : I → S → Finset (Fin J)) (k : I → ℤ), (∀ i ∈ patterns, |(k i : ℝ)| ≤ L^K) → (((max 1 (physicalOperatorStepBound (fun g : S => candidatePBand (c*L) g.val) J ell patterns C k) : ℕ) : ℝ) * Real.exp (C₀ * Real.sqrt L)^2)^ (1/(2*(Nat.ceil (L^(13/25 : ℝ)) : ℝ))) ≤ Real.exp 1 := by filter_upwards [eventually_candidate_positive_step_power hc (t := (1/2 : ℝ)) (by norm_num) (show (0 : ℝ) < 1 by norm_num) J K, eventually_block_sup_moment_bound (a := (13/25 : ℝ)) (d := (1/2 : ℝ)) (by norm_num) (by norm_num) hC 1, Real.tendsto_log_atTop.eventually_ge_atTop 1, eventually_ge_atTop (1 : ℝ)] with L hs hm hlog hL intro S hS ell I patterns C k hk let D := max 1 (physicalOperatorStepBound (fun g : S => candidatePBand (c*L) g.val) J ell patterns C k) have hD : (0 : ℝ) < D := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one (le_max_left _ _) : 0 < D) apply hm D hD have hstep := hs S hS ell patterns C k hk rw [one_mul] at hstep have hlogD : Real.log D ≤ L^(1/2 : ℝ) := by exact (Real.log_le_iff_le_exp hD).mpr hstep calc Real.log D ≤ L^(1/2 : ℝ) := hlogD _ ≤ 1 * L^(1/2 : ℝ) * Real.log L := by rw [one_mul] exact le_mul_of_one_le_right (Real.rpow_nonneg (zero_le_one.trans hL) _) hlog end Bounty -- Source module: ActualRawBlockCost /- The original determinant range supplies a bounded block cost at the actual moment order. -/ open Finset Filter namespace Bounty theorem eventually_actual_raw_block_cost {c K : ℝ} (hc : 0 < c) (hK : 0 ≤ K) (J : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (ell : ℕ) (probes : S → Finset (Fin J)) (r t : Finset S), ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), let D := max 1 (physicalOperatorStepBound (fun g : S => candidatePBand (c*L) g.val) J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k)) ((D : ℝ)*Real.exp ((14*Real.log 2)*Real.sqrt L)^2)^ (1/(2*(Nat.ceil (L^(13/25 : ℝ)) : ℝ))) ≤ Real.exp 1 := by have hC : (0 : ℝ) ≤ 14*Real.log 2 := mul_nonneg (by norm_num) (Real.log_nonneg (by norm_num)) filter_upwards [eventually_candidate_block_moment hc hC J (K+89), eventually_ge_atTop (3 : ℝ)] with L hblock hL intro S hS ell probes r t k hk exact hblock S hS ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k) (fun _ _ => actual_determinant_shift_power hL hK hk) end Bounty -- Source module: FinitePairingCutoff /- Move a finitely supported pairing to any cutoff containing its active edges. -/ open Finset open scoped ComplexConjugate namespace Bounty theorem finite_pairing_cutoff_mask {X : Type*} [DecidableEq X] (S T : Finset X) (f g : X → ℂ) (K : X → X → ℂ) (hsource : ∀ x ∈ S, f x ≠ 0 → x ∈ T) (hedge : ∀ x ∈ S, f x ≠ 0 → ∀ y ∈ S, K x y ≠ 0 → y ∈ T) : (∑ x ∈ S, ∑ y ∈ S, star (f x) * K x y * g y) = ∑ x ∈ T, ∑ y ∈ T, star (if x ∈ S then f x else 0) * K x y * (if y ∈ S then g y else 0) := by have hleft : (∑ x ∈ S, ∑ y ∈ S, star (f x) * K x y * g y) = ∑ x ∈ S ∩ T, ∑ y ∈ S ∩ T, star (f x) * K x y * g y := by calc _ = ∑ x ∈ S ∩ T, ∑ y ∈ S, star (f x) * K x y * g y := by symm apply sum_subset inter_subset_left intro x hx hxt have hf : f x = 0 := by by_contra hn exact hxt (mem_inter.mpr ⟨hx, hsource x hx hn⟩) simp [hf] _ = _ := by apply sum_congr rfl intro x hx symm apply sum_subset inter_subset_left intro y hy hyt by_cases hf : f x = 0 · simp [hf] · have hk : K x y = 0 := by by_contra hn exact hyt (mem_inter.mpr ⟨hy, hedge x (mem_inter.mp hx).1 hf y hy hn⟩) simp [hk] rw [hleft] symm calc _ = ∑ x ∈ S ∩ T, ∑ y ∈ T, star (if x ∈ S then f x else 0) * K x y * (if y ∈ S then g y else 0) := by symm apply sum_subset inter_subset_right intro x hx hxt have hs : x ∉ S := fun hs => hxt (mem_inter.mpr ⟨hs, hx⟩) simp [hs] _ = _ := by apply sum_congr rfl intro x hx simp only [if_pos (mem_inter.mp hx).1] calc _ = ∑ y ∈ S ∩ T, star (f x) * K x y * (if y ∈ S then g y else 0) := by symm apply sum_subset inter_subset_right intro y hy hyt have hs : y ∉ S := fun hs => hyt (mem_inter.mpr ⟨hs, hy⟩) simp [hs] _ = _ := by apply sum_congr rfl intro y hy rw [if_pos (mem_inter.mp hy).1] end Bounty -- Source module: PhysicalPairingCutoff /- Exact restriction of a physical endpoint pairing to a reachable position set. -/ open Finset open scoped Classical InnerProductSpace namespace Bounty noncomputable def physicalPositionMask (S : Finset ℤ) (f : ℤ → ℂ) (n : ℤ) : ℂ := if n ∈ S then f n else 0 theorem physical_unsym_operator_zero_of_far {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (x y : PhysicalState P J ell) (hfar : physicalOperatorStepBound P J ell patterns C k < (y.1 - x.1).natAbs) : (∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) x y) = 0 := by apply sum_eq_zero intro i hi unfold physicalPatternKernel apply sum_eq_zero intro aux _ exact physical_edge_zero_of_far V (C i) q (ζ i) (k i) (K i) aux x y ((le_sup (f := fun i => physicalStepBound P J ell (C i) (k i)) hi).trans_lt hfar) theorem physical_endpoint_pairing_cutoff {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions starts : Finset ℤ) (radius : ℕ) (hstep : physicalOperatorStepBound P J ell patterns C k ≤ radius) (f g : ℤ → ℂ) (hf : ∀ n ∈ positions, f n ≠ 0 → n ∈ starts) : inner ℂ (physicalEndpointVector P V J ell q positions f) (physicalHilbertOperator V patterns C q ζ k K positions (physicalEndpointVector P V J ell q positions g)) = inner ℂ (physicalEndpointVector P V J ell q (reachablePositions starts radius) (physicalPositionMask positions f)) (physicalHilbertOperator V patterns C q ζ k K (reachablePositions starts radius) (physicalEndpointVector P V J ell q (reachablePositions starts radius) (physicalPositionMask positions g))) := by simp only [physicalEndpointVector, physicalHilbertOperator] rw [physical_position_kernel_pairing P V hV, physical_position_kernel_pairing P V hV] congr 1 let F := fun x : PhysicalState P J ell => f x.1 * (physicalDamping P J ell q x.1 : ℂ) let Gf := fun x : PhysicalState P J ell => g x.1 * (physicalDamping P J ell q x.1 : ℂ) let A := fun x y : PhysicalState P J ell => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) x y have hs : ∀ x ∈ physicalCutoff P J ell positions, F x ≠ 0 → x ∈ physicalCutoff P J ell (reachablePositions starts radius) := by intro x hx hfx apply (mem_physical_cutoff _ _ _ _ _).mpr apply mem_reachable_positions_self _ radius apply hf x.1 ((mem_physical_cutoff _ _ _ _ _).mp hx) intro hz exact hfx (by simp [F, hz]) have he : ∀ x ∈ physicalCutoff P J ell positions, F x ≠ 0 → ∀ y ∈ physicalCutoff P J ell positions, A x y ≠ 0 → y ∈ physicalCutoff P J ell (reachablePositions starts radius) := by intro x hx hfx y _ hxy apply (mem_physical_cutoff _ _ _ _ _).mpr apply mem_reachable_positions (hf x.1 ((mem_physical_cutoff _ _ _ _ _).mp hx) (by intro hz exact hfx (by simp [F, hz]))) apply le_trans _ hstep by_contra hn exact hxy (physical_unsym_operator_zero_of_far V patterns C q ζ k K x y (lt_of_not_ge hn)) simpa only [F, Gf, A, starRingEnd_apply, physicalPositionMask, mem_physical_cutoff, ite_mul, zero_mul] using finite_pairing_cutoff_mask (physicalCutoff P J ell positions) (physicalCutoff P J ell (reachablePositions starts radius)) F Gf A hs he end Bounty -- Source module: PhysicalDyadicRoot /- Exact partition of the physical source variable into dyadic blocks. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalDyadicSource (j : ℕ) (f : ℤ → ℂ) (n : ℤ) : ℂ := if n.natAbs.log2 = j then f n else 0 theorem physical_dyadic_source_nonzero (j : ℕ) (f : ℤ → ℂ) {n : ℤ} (hn : physicalDyadicSource j f n ≠ 0) : f n ≠ 0 ∧ n.natAbs.log2 = j := by by_cases h : n.natAbs.log2 = j · exact ⟨by simpa only [physicalDyadicSource, if_pos h] using hn, h⟩ · exact False.elim (hn (if_neg h)) theorem physical_dyadic_source_scale (j : ℕ) (f : ℤ → ℂ) (hf : ∀ n, f n ≠ 0 → 0 < n) {n : ℤ} (hn : physicalDyadicSource j f n ≠ 0) : (2 : ℝ)^j ≤ (n : ℝ) ∧ (n : ℝ) < 2*(2 : ℝ)^j := by obtain ⟨hnf, hnj⟩ := physical_dyadic_source_nonzero j f hn have hp := hf n hnf have hpn : n.natAbs ≠ 0 := Int.natAbs_ne_zero.mpr (ne_of_gt hp) have hb := (Nat.log2_eq_iff hpn).mp hnj have he : (n.natAbs : ℤ) = n := by simp only [Int.natCast_natAbs, abs_of_pos hp] have he' : (n.natAbs : ℝ) = n := by calc (n.natAbs : ℝ) = ((n.natAbs : ℤ) : ℝ) := by simp _ = (n : ℝ) := congrArg (fun z : ℤ => (z : ℝ)) he rw [pow_succ] at hb constructor · have hr : (2 : ℝ)^j ≤ n.natAbs := by exact_mod_cast hb.1 simpa only [he'] using hr · have hr : (n.natAbs : ℝ) < (2 : ℝ)^j*2 := by exact_mod_cast hb.2 simpa only [he', mul_comm] using hr theorem physical_mellin_root_dyadic_sum {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (f g : ℤ → ℂ) (Ψ : ℝ → ℂ) (Z : ℝ) : (∑ j ∈ positions.image (fun n => n.natAbs.log2), physicalMellinRootCorrelation V patterns C q ζ k K positions (physicalDyadicSource j f) g Ψ Z) = physicalMellinRootCorrelation V patterns C q ζ k K positions f g Ψ Z := by simp only [physical_mellin_root_as_atoms, ← mul_sum] congr 1 rw [sum_comm] apply sum_congr rfl intro a _ rw [← sum_mul] congr 1 have hm : a.1.val.1.natAbs.log2 ∈ positions.image (fun n => n.natAbs.log2) := mem_image_of_mem _ ((mem_physical_cutoff P J ell positions a.1.val).mp a.1.property) calc _ = ∑ j ∈ positions.image (fun n => n.natAbs.log2), if a.1.val.1.natAbs.log2 = j then physicalMellinAtomCoefficient V patterns C q ζ k K positions f g a else 0 := by apply sum_congr rfl intro j _ unfold physicalMellinAtomCoefficient by_cases hj : a.1.val.1.natAbs.log2 = j <;> simp [physicalDyadicSource, hj] _ = _ := by simp [hm] end Bounty -- Source module: PhysicalDyadicPairingCutoff /- Localize each actual Mellin source block, with both original endpoint masks retained. -/ open Finset open scoped Classical namespace Bounty def physicalDyadicStarts (j : ℕ) : Finset ℤ := Ico ((2 : ℤ)^j) ((2 : ℤ)^(j+1)) theorem physical_dyadic_source_mem_starts (j : ℕ) (f : ℤ → ℂ) (hf : ∀ n, f n ≠ 0 → 0 < n) {n : ℤ} (hn : physicalDyadicSource j f n ≠ 0) : n ∈ physicalDyadicStarts j := by have hb := physical_dyadic_source_scale j f hf hn rw [mul_comm, ← pow_succ] at hb apply mem_Ico.mpr exact_mod_cast hb theorem physical_position_mask_mellin (S : Finset ℤ) (X Z v : ℝ) (f : ℤ → ℂ) : physicalPositionMask S (physicalMellinSource X Z v f) = physicalMellinSource X Z v (physicalPositionMask S f) := by funext n by_cases hn : n ∈ S <;> simp [physicalPositionMask, physicalMellinSource, hn] theorem physical_dyadic_mellin_pairing_cutoff {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (radius j : ℕ) (hstep : physicalOperatorStepBound P J ell patterns C k ≤ radius) (f g : ℤ → ℂ) (hf : ∀ n, f n ≠ 0 → 0 < n) (X Z v : ℝ) : physicalMellinPairing V patterns C q ζ k K positions (physicalDyadicSource j f) g X Z v = physicalMellinPairing V patterns C q ζ k K (reachablePositions (physicalDyadicStarts j) radius) (physicalPositionMask positions (physicalDyadicSource j f)) (physicalPositionMask positions g) X Z v := by unfold physicalMellinPairing rw [← physical_position_mask_mellin] apply physical_endpoint_pairing_cutoff V hV patterns C q (fun i => ζ i - v) k K positions (physicalDyadicStarts j) radius hstep intro n _ hn apply physical_dyadic_source_mem_starts j f hf intro hz exact hn (physical_mellin_source_zero X Z v _ n hz) end Bounty -- Source module: PhysicalDyadicNeighborhood /- Integer geometry of the reachable neighborhood of one physical source dyad. -/ open Finset namespace Bounty theorem physical_reachable_dyadic_bounds (j radius : ℕ) {n : ℤ} (hn : n ∈ reachablePositions (physicalDyadicStarts j) radius) : (2 : ℤ)^j - radius ≤ n ∧ n < (2 : ℤ)^(j+1) + radius := by obtain ⟨m, hm, hn⟩ := mem_biUnion.mp hn have hm' := mem_Ico.mp hm have hn' := mem_Icc.mp hn omega theorem physical_reachable_dyadic_range (j radius : ℕ) (hr : radius ≤ 2^j) : ∀ n ∈ reachablePositions (physicalDyadicStarts j) radius, 0 ≤ n ∧ n ≤ ((2^(j+1) + radius : ℕ) : ℤ) := by intro n hn have hb := physical_reachable_dyadic_bounds j radius hn have hr' : (radius : ℤ) ≤ (2 : ℤ)^j := by exact_mod_cast hr have he : ((2^(j+1)+radius : ℕ) : ℤ) = (2 : ℤ)^(j+1)+radius := by push_cast; rfl rw [he] omega end Bounty -- Source module: PhysicalRawEndpointPointwise /- The actual phases, source dyad, and cutoff masks contract the invariant endpoints. -/ open Finset open scoped Classical namespace Bounty theorem physical_phase_positive_endpoint_norm_le (pool : Finset ℕ) (α β γ : ℕ → ℂ) (a : ℝ) (n : ℤ) : ‖physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n‖ ≤ ‖invariantTripleEndpoint pool α β γ n.natAbs‖ := by rw [norm_mul, physical_phase_norm, one_mul] by_cases hn : 0 < n <;> simp [positiveInvariantEndpoint, hn] theorem physical_masked_phase_endpoint_norm_le (S : Finset ℤ) (pool : Finset ℕ) (α β γ : ℕ → ℂ) (a : ℝ) (n : ℤ) : ‖physicalPositionMask S (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n) n‖ ≤ ‖invariantTripleEndpoint pool α β γ n.natAbs‖ := by by_cases hn : n ∈ S · simpa only [physicalPositionMask, if_pos hn] using physical_phase_positive_endpoint_norm_le pool α β γ a n · simp only [physicalPositionMask, if_neg hn, norm_zero, norm_nonneg] theorem physical_masked_dyadic_mellin_endpoint_norm_le (S : Finset ℤ) (pool : Finset ℕ) (α β γ : ℕ → ℂ) (a Z v : ℝ) (j : ℕ) (n : ℤ) : ‖physicalMellinSource ((2 : ℝ)^j) Z v (physicalPositionMask S (physicalDyadicSource j (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n))) n‖ ≤ ‖invariantTripleEndpoint pool α β γ n.natAbs‖ := by let f := fun n : ℤ => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n let F := physicalPositionMask S (physicalDyadicSource j f) change ‖physicalMellinSource ((2 : ℝ)^j) Z v F n‖ ≤ _ have hnorm : ‖F n‖ ≤ ‖invariantTripleEndpoint pool α β γ n.natAbs‖ := by by_cases hn : n ∈ S · by_cases hj : n.natAbs.log2 = j · simpa only [F, physicalPositionMask, if_pos hn, physicalDyadicSource, if_pos hj, f] using physical_phase_positive_endpoint_norm_le pool α β γ a n · simp only [F, physicalPositionMask, if_pos hn, physicalDyadicSource, if_neg hj, norm_zero, norm_nonneg] · simp only [F, physicalPositionMask, if_neg hn, norm_zero, norm_nonneg] by_cases hn : F n = 0 · rw [physical_mellin_source_zero _ _ _ _ _ hn, norm_zero] exact norm_nonneg _ · have hd : physicalDyadicSource j f n ≠ 0 := by intro hz exact hn (by simp [F, physicalPositionMask, hz]) have hp : ∀ n, f n ≠ 0 → 0 < n := by intro n hn apply positive_invariant_endpoint_nonzero pool α β γ intro hz exact hn (by simp [f, hz]) have hb := (physical_dyadic_source_scale j f hp hd).1 have hx : (0 : ℝ) < 2^j := by positivity have hnpos : (0 : ℝ) < n := hx.trans_le hb rw [physical_mellin_source_norm, abs_of_nonneg (div_nonneg hx.le hnpos.le)] exact (mul_le_of_le_one_left (norm_nonneg _) ((div_le_one hnpos).mpr hb)).trans hnorm end Bounty -- Source module: PhysicalDyadicSourceSupport /- Exact support and cardinality of the original physical dyadic source. -/ open Finset open scoped Classical namespace Bounty theorem physical_dyadic_starts_card (j : ℕ) : (physicalDyadicStarts j).card = 2^j := by simp only [physicalDyadicStarts, Int.card_Ico, pow_succ] rw [show (2 : ℤ)^j*2 - 2^j = 2^j by ring] norm_cast theorem physical_raw_dyadic_source_support (S : Finset ℤ) (pool : Finset ℕ) (α β γ : ℕ → ℂ) (a Z v : ℝ) (j : ℕ) {n : ℤ} (hn : n ∉ physicalDyadicStarts j) : physicalMellinSource ((2 : ℝ)^j) Z v (physicalPositionMask S (physicalDyadicSource j (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n))) n = 0 := by apply physical_mellin_source_zero by_cases hS : n ∈ S · rw [physicalPositionMask, if_pos hS] by_contra hne apply hn apply physical_dyadic_source_mem_starts j _ _ hne intro m hm apply positive_invariant_endpoint_nonzero pool α β γ intro hz exact hm (by rw [hz, mul_zero]) · simp only [physicalPositionMask, if_neg hS] end Bounty -- Source module: PhysicalAlternatingMomentNonneg /- Positivity of the literal alternating physical root moment. -/ open Finset open scoped BigOperators InnerProductSpace namespace Bounty theorem physical_alternating_root_moment_nonneg {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (starts : Finset ℤ) (R b : ℕ) (hR : 0 < R) : 0 ≤ (physicalRootMoment V patterns C q (fun j i => if j % 2 = 0 then -ζ i else ζ i) (fun j i => if j % 2 = 0 then -k i else k i) (fun j i a c aux => if j % 2 = 0 then (starRingEnd ℂ) (K i c a aux) else K i a c aux) starts (2*R-1) b).re := by rw [physical_root_moment_re_eq_fiber_gram V hV patterns C q ζ k K starts R b hR] apply div_nonneg _ (Nat.cast_nonneg _) apply sum_nonneg intro n _ apply positive_spectral_moment_nonneg _ (LinearMap.isSymmetric_self_comp_adjoint _) intro v rw [LinearMap.comp_apply, ← LinearMap.adjoint_inner_left] exact inner_self_nonneg (𝕜 := ℂ) end Bounty -- Source module: PhysicalRawEndpointNorm /- Raw physical endpoint norms with an absolute logarithmic exponent, uniform in mark counts. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (pool : Finset ℕ) (hpool : ∀ g, P g ⊆ pool) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (J ell : ℕ) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (S : Finset ℤ) (j radius : ℕ) (hr : radius ≤ 2^j) (a Z v : ℝ) include hP hprime hV hMass hpool hA hB hC hα hβ hγ hq0 hq1 hr theorem physical_raw_mellin_source_endpoint_norm : ‖physicalEndpointVector P V J ell q (reachablePositions (physicalDyadicStarts j) radius) (physicalMellinSource ((2 : ℝ)^j) Z v (physicalPositionMask S (physicalDyadicSource j (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n))))‖ ≤ A*B*C * Real.sqrt (2^(j+1)+radius : ℕ) * (1+Real.log (2^(j+1)+radius : ℕ))^8 := by apply physical_invariant_endpoint_norm P hP hprime V hV hMass pool hpool α β γ hA hB hC hα hβ hγ J ell hq0 hq1 _ (2^(j+1)+radius) (physical_reachable_dyadic_range j radius hr) intro n _ exact physical_masked_dyadic_mellin_endpoint_norm_le S pool α β γ a Z v j n theorem physical_raw_target_endpoint_norm : ‖physicalEndpointVector P V J ell q (reachablePositions (physicalDyadicStarts j) radius) (physicalPositionMask S (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n))‖ ≤ A*B*C * Real.sqrt (2^(j+1)+radius : ℕ) * (1+Real.log (2^(j+1)+radius : ℕ))^8 := by apply physical_invariant_endpoint_norm P hP hprime V hV hMass pool hpool α β γ hA hB hC hα hβ hγ J ell hq0 hq1 _ (2^(j+1)+radius) (physical_reachable_dyadic_range j radius hr) intro n _ exact physical_masked_phase_endpoint_norm_le S pool α β γ a n end end Bounty -- Source module: PhysicalRawDyadicGram /- The actual masked dyadic Mellin pairing is bounded by its literal alternating root moment. -/ open Finset open scoped Classical InnerProductSpace namespace Bounty theorem physical_raw_dyadic_gram_bound {G I : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (pool : Finset ℕ) (hpool : ∀ g, P g ⊆ pool) (α β γ α' β' γ' : ℕ → ℂ) {A B C₀ : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C₀) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C₀) (hα' : ∀ m, ‖α' m‖ ≤ A) (hβ' : ∀ p, ‖β' p‖ ≤ B) (hγ' : ∀ r, ‖γ' r‖ ≤ C₀) (S : Finset ℤ) (j R b D : ℕ) (hR : 2 ≤ R) (hD : 0 < D) (hstep : physicalOperatorStepBound P J ell patterns C k ≤ D) (hr : 2*R*b ≤ 2^j) (a c Z v : ℝ) {M : ℝ} (hM : 0 ≤ M) (hfM : ∀ n ∈ physicalDyadicStarts j, ‖invariantTripleEndpoint pool α β γ n.natAbs‖ ≤ M) : let f := physicalPositionMask S (physicalDyadicSource j (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n)) let g := physicalPositionMask S (fun n => physicalPhase c n.natAbs * positiveInvariantEndpoint pool α' β' γ' n) let E := A*B*C₀ * Real.sqrt (2^(j+1)+2*R*b : ℕ) * (1+Real.log (2^(j+1)+2*R*b : ℕ))^8 let moment := physicalRootMoment V patterns C q (fun e i => if e % 2 = 0 then -(ζ i-v) else ζ i-v) (fun e i => if e % 2 = 0 then -k i else k i) (fun e i x y aux => if e % 2 = 0 then (starRingEnd ℂ) (K i y x aux) else K i x y aux) (physicalDyadicStarts j) (2*R-1) b ‖physicalMellinPairing V patterns C q ζ k K (reachablePositions (physicalDyadicStarts j) (2*R*b)) f g ((2 : ℝ)^j) Z v‖ ≤ ((D : ℝ)*M^2)^(1/(2*(R : ℝ))) * (3*E^2)^(1/2 : ℝ) * (E^2)^((1-1/(R : ℝ))/2) * ((2 : ℝ)^j*moment.re)^(1/(2*(R : ℝ))) := by dsimp only have hs := physical_raw_mellin_source_endpoint_norm P hP hprime V hV hMass pool hpool α β γ hA hB hC hα hβ hγ J ell hq0 hq1 S j (2*R*b) hr a Z v have ht := physical_raw_target_endpoint_norm P hP hprime V hV hMass pool hpool α' β' γ' hA hB hC hα' hβ' hγ' J ell hq0 hq1 S j (2*R*b) hr c have hm := physical_alternating_root_moment_nonneg V hV patterns C q (fun i => ζ i-v) k K (physicalDyadicStarts j) R b (by omega) have hp := physical_endpoint_block_gram_bound V hV patterns C hq0 hq1 (fun i => ζ i-v) k K (physicalDyadicStarts j) R b D hR hD hstep (physicalMellinSource ((2 : ℝ)^j) Z v (physicalPositionMask S (physicalDyadicSource j (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n)))) (physicalPositionMask S (fun n => physicalPhase c n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) (fun n _ hn => physical_raw_dyadic_source_support S pool α β γ a Z v j hn) hM (fun n hn => (physical_masked_dyadic_mellin_endpoint_norm_le S pool α β γ a Z v j n).trans (hfM n hn)) dsimp only at hp rw [physical_dyadic_starts_card, Nat.cast_pow, Nat.cast_ofNat] at hp apply hp.trans have hR1 : (1 : ℝ) ≤ R := by exact_mod_cast (by omega : 1 ≤ R) have htheta : 0 ≤ (1-1/(R : ℝ))/2 := by have hdiv := (div_le_one (lt_of_lt_of_le zero_lt_one hR1)).mpr hR1 linarith gcongr end Bounty -- Source module: PhysicalDyadicEnergyScalar /- Fixed endpoint-energy powers on a dyadic neighborhood. -/ namespace Bounty theorem dyadic_sqrt_energy_sq_le {N X C U : ℝ} (hN : 0 ≤ N) (hX : 0 ≤ X) (hC : 0 ≤ C) (hNbound : N ≤ 4*X) (hU : 2*C ≤ U) : (C * Real.sqrt N)^2 ≤ X*U^2 := by calc _ = C^2*N := by rw [mul_pow, Real.sq_sqrt hN] _ ≤ C^2*(4*X) := mul_le_mul_of_nonneg_left hNbound (sq_nonneg C) _ = X*(2*C)^2 := by ring _ ≤ X*U^2 := by gcongr theorem physical_dyadic_endpoint_energy_sq (j radius : ℕ) (hr : radius ≤ 2^j) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) : (A*B*C * Real.sqrt (2^(j+1)+radius : ℕ) * (1+Real.log (2^(j+1)+radius : ℕ))^8)^2 ≤ (2 : ℝ)^j * (max 1 (2*(A*B*C*(1+Real.log (2^(j+1)+radius : ℕ))^8)))^2 := by have hN : ((2^(j+1)+radius : ℕ) : ℝ) ≤ 4*(2 : ℝ)^j := by have hr' : (radius : ℝ) ≤ (2 : ℝ)^j := by exact_mod_cast hr push_cast rw [pow_succ] linarith [show 0 ≤ (2 : ℝ)^j by positivity] have hs := dyadic_sqrt_energy_sq_le (Nat.cast_nonneg (2^(j+1)+radius)) (show 0 ≤ (2 : ℝ)^j by positivity) (show 0 ≤ A*B*C*(1+Real.log (2^(j+1)+radius : ℕ))^8 by positivity) hN (le_max_right 1 (2*(A*B*C*(1+Real.log (2^(j+1)+radius : ℕ))^8))) convert hs using 1 ring end Bounty -- Source module: PhysicalRawDyadicDecay /- Actual raw per-dyad decay from the literal alternating root moment. -/ open Finset open scoped Classical InnerProductSpace namespace Bounty theorem physical_raw_dyadic_moment_decay {G I : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (pool : Finset ℕ) (hpool : ∀ g, P g ⊆ pool) (α β γ α' β' γ' : ℕ → ℂ) {A B C₀ : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C₀) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C₀) (hα' : ∀ m, ‖α' m‖ ≤ A) (hβ' : ∀ p, ‖β' p‖ ≤ B) (hγ' : ∀ r, ‖γ' r‖ ≤ C₀) (S : Finset ℤ) (j R b D : ℕ) (hR : 2 ≤ R) (hD : 0 < D) (hstep : physicalOperatorStepBound P J ell patterns C k ≤ D) (hr : 2*R*b ≤ 2^j) (a c Z v : ℝ) {M : ℝ} (hM : 0 ≤ M) (hfM : ∀ n ∈ physicalDyadicStarts j, ‖invariantTripleEndpoint pool α β γ n.natAbs‖ ≤ M) {B₀ T : ℝ} (hB₀ : 0 ≤ B₀) (hT : 0 ≤ T) (hblock : ((D : ℝ)*M^2)^(1/(2*(R : ℝ))) ≤ B₀) (hmoment : (physicalRootMoment V patterns C q (fun e i => if e % 2 = 0 then -(ζ i-v) else ζ i-v) (fun e i => if e % 2 = 0 then -k i else k i) (fun e i x y aux => if e % 2 = 0 then (starRingEnd ℂ) (K i y x aux) else K i x y aux) (physicalDyadicStarts j) (2*R-1) b).re ≤ T^(2*R)) : let f := physicalPositionMask S (physicalDyadicSource j (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n)) let g := physicalPositionMask S (fun n => physicalPhase c n.natAbs * positiveInvariantEndpoint pool α' β' γ' n) let U := max 1 (2*(A*B*C₀*(1+Real.log (2^(j+1)+2*R*b : ℕ))^8)) ‖physicalMellinPairing V patterns C q ζ k K (reachablePositions (physicalDyadicStarts j) (2*R*b)) f g ((2 : ℝ)^j) Z v‖ ≤ B₀ * Real.sqrt 3 * (2 : ℝ)^j * U^2 * T := by dsimp only have hp := physical_raw_dyadic_gram_bound P hP hprime V hV hMass patterns C hq0 hq1 ζ k K pool hpool α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' S j R b D hR hD hstep hr a c Z v hM hfM dsimp only at hp have hm := physical_alternating_root_moment_nonneg V hV patterns C q (fun i => ζ i-v) k K (physicalDyadicStarts j) R b (by omega) have he := physical_dyadic_endpoint_energy_sq j (2*R*b) hr hA hB hC apply hp.trans apply block_gram_of_energy_bounds (by omega : 1 ≤ R) (sq_nonneg _) (sq_nonneg _) (mul_nonneg (by positivity) hm) hB₀ (by positivity) (le_max_left _ _) hT hblock he he exact mul_le_mul_of_nonneg_left hmoment (by positivity) end Bounty -- Source module: PhysicalDyadicMellinSum /- Exact finite dyadic sum of localized Mellin pairings. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_dyadic_mellin_sum_cutoff {G I : Type*} [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {J ell : ℕ} (V : G → ℝ) (hV : ∀ g, 0 < V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (positions : Finset ℤ) (radius : ℕ) (hstep : physicalOperatorStepBound P J ell patterns C k ≤ radius) (f g : ℤ → ℂ) (hf : ∀ n, f n ≠ 0 → 0 < n) (s : Finset ℕ) (Z : ℝ) (ρ : ℝ → ℂ) (ν : ℝ → ℝ) : (∑ j ∈ s, (((2 : ℝ)^j : ℝ) : ℂ)⁻¹ * ∫ v : ℝ, ρ v * physicalMellinPairing V patterns C q ζ k K positions (physicalDyadicSource j f) g ((2 : ℝ)^j) Z (ν v)) = ∑ j ∈ s, (((2 : ℝ)^j : ℝ) : ℂ)⁻¹ * ∫ v : ℝ, ρ v * physicalMellinPairing V patterns C q ζ k K (reachablePositions (physicalDyadicStarts j) radius) (physicalPositionMask positions (physicalDyadicSource j f)) (physicalPositionMask positions g) ((2 : ℝ)^j) Z (ν v) := by apply sum_congr rfl intro j _ apply congrArg (fun z : ℂ => (((2 : ℝ)^j : ℝ) : ℂ)⁻¹ * z) apply integral_congr_ae filter_upwards [] with v apply congrArg (fun z : ℂ => ρ v * z) exact physical_dyadic_mellin_pairing_cutoff V hV patterns C q ζ k K positions radius j hstep f g hf ((2 : ℝ)^j) Z (ν v) end Bounty -- Source module: PhysicalSignedRootMellin /- Exact physical Mellin representation of the entire signed residual. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (hpool : ∀ g, P g ⊆ pool) (hV : ∀ g, 0 < V g) (hZ : 0 < Z) (positions : Finset ℤ) (hclosure : physicalSignedHarmonicPositions (ell := ell) P probes r t Z k ⊆ positions) include hdis hprime hpool hV hZ hclosure theorem physical_signed_harmonic_residual_dyadic_mellin : physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' = ∑ j ∈ positions.image (fun n => n.natAbs.log2), (((2 : ℝ)^j : ℝ) : ℂ)⁻¹ * ∫ v : ℝ, harmonicLogFourier v * physicalMellinPairing V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) positions (physicalDyadicSource j (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n)) (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n) ((2 : ℝ)^j) Z (2*Real.pi*v) := by rw [physical_signed_harmonic_residual_eq_root P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' hdis hprime hpool hZ positions hclosure, ← physical_mellin_root_dyadic_sum] apply sum_congr rfl intro j _ apply physical_mellin_root_eq_integral (fun g p hp => (hprime g p hp).pos) V hV _ _ (by norm_num) _ _ _ positions _ _ _ ((2 : ℝ)^j) Z (by positivity) hZ harmonicLogFourier (fun v => 2*Real.pi*v) harmonic_log_fourier_integrable (by fun_prop) (fun x => (typeIIHarmonicDyadic x : ℂ)) (fun _ ht => harmonic_dyadic_mellin_representation ht) intro n _ hn have hf := (physical_dyadic_source_nonzero j _ hn).1 apply positive_invariant_endpoint_nonzero pool α β γ intro hz exact hf (by rw [hz, mul_zero]) end end Bounty -- Source module: PhysicalActualDyadicCutoff /- The original signed residual as localized dyadic physical Mellin pairings. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_signed_harmonic_residual_local_mellin {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (hpool : ∀ g, P g ⊆ pool) (hV : ∀ g, 0 < V g) (hZ : 0 < Z) (positions : Finset ℤ) (hclosure : physicalSignedHarmonicPositions (ell := ell) P probes r t Z k ⊆ positions) (radius : ℕ) (hstep : physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k) ≤ radius) : physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' = ∑ j ∈ positions.image (fun n => n.natAbs.log2), (((2 : ℝ)^j : ℝ) : ℂ)⁻¹ * ∫ v : ℝ, harmonicLogFourier v * physicalMellinPairing V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (reachablePositions (physicalDyadicStarts j) radius) (physicalPositionMask positions (physicalDyadicSource j (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n))) (physicalPositionMask positions (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) ((2 : ℝ)^j) Z (2*Real.pi*v) := by refine (physical_signed_harmonic_residual_dyadic_mellin P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' hdis hprime hpool hV hZ positions hclosure).trans ?_ apply physical_dyadic_mellin_sum_cutoff V hV _ _ _ _ _ _ positions radius hstep intro n hn apply positive_invariant_endpoint_nonzero pool α β γ intro hz exact hn (by rw [hz, mul_zero]) end Bounty -- Source module: PhysicalActualDyadicMomentBound /- The original signed prime kernel in the literal alternating dyadic moment bound. -/ open Finset open scoped Classical namespace Bounty theorem physical_actual_dyadic_moment_bound {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (hpool : ∀ g, P g ⊆ pool) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ n, ‖α n‖ ≤ A) (hβ : ∀ n, ‖β n‖ ≤ B) (hγ : ∀ n, ‖γ n‖ ≤ C) (hα' : ∀ n, ‖α' n‖ ≤ A) (hβ' : ∀ n, ‖β' n‖ ≤ B) (hγ' : ∀ n, ‖γ' n‖ ≤ C) (positions : Finset ℤ) (j R D : ℕ) (hR : 2 ≤ R) (hD : 0 < D) (hstep : physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k) ≤ D) (hr : 2*R*D ≤ 2^j) (v : ℝ) {M B₀ T : ℝ} (hM : 0 ≤ M) (hB₀ : 0 ≤ B₀) (hT : 0 ≤ T) (hsource : ∀ n ∈ physicalDyadicStarts j, ‖invariantTripleEndpoint pool α β γ n.natAbs‖ ≤ M) (hblock : ((D : ℝ)*M^2)^(1/(2*(R : ℝ))) ≤ B₀) (hmoment : (physicalRootMoment V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun e _ => if e % 2 = 0 then -(-(a+b)-2*Real.pi*v) else -(a+b)-2*Real.pi*v) (fun e _ => if e % 2 = 0 then -k else k) (fun e i x y aux => if e % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i y x aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ i x y aux) (physicalDyadicStarts j) (2*R-1) D).re ≤ T^(2*R)) : ‖physicalMellinPairing V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (reachablePositions (physicalDyadicStarts j) (2*R*D)) (physicalPositionMask positions (physicalDyadicSource j (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n))) (physicalPositionMask positions (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) ((2 : ℝ)^j) Z (2*Real.pi*v)‖ ≤ (2 : ℝ)^j * (B₀ * Real.sqrt 3 * (max 1 (2*(A*B*C*(1+Real.log (2^(j+1)+2*R*D : ℕ))^8)))^2 * T) := by have hp := physical_raw_dyadic_moment_decay P hdis hprime V hV hMass (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) ≤ 1) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) pool hpool α β γ α' β' γ' hA hB hC hα hβ hγ hα' hβ' hγ' positions j R D D hR hD hstep hr (-a) b Z (2*Real.pi*v) hM hsource hB₀ hT hblock hmoment dsimp only at hp convert hp using 1 ring end Bounty -- Source module: DyadicMellinEnvelope /- Reciprocal dyadic scale cancellation with an integrable frequency envelope. -/ open Finset MeasureTheory namespace Bounty theorem dyadic_mellin_sum_norm_le_envelope {I : Type*} (S : Finset I) (X : I → ℝ) (hX : ∀ i ∈ S, 0 < X i) (F : I → ℝ → ℂ) (g : ℝ → ℂ) (B : I → ℝ → ℝ) (hB : ∀ i ∈ S, Integrable (fun v => ‖g v‖ * B i v)) (hF : ∀ i ∈ S, ∀ᵐ v : ℝ, ‖F i v‖ ≤ X i * B i v) : ‖∑ i ∈ S, (X i : ℂ)⁻¹ * ∫ v : ℝ, g v * F i v‖ ≤ ∑ i ∈ S, ∫ v : ℝ, ‖g v‖ * B i v := by apply (norm_sum_le _ _).trans apply sum_le_sum intro i hi have hb : ‖∫ v : ℝ, g v * F i v‖ ≤ X i * ∫ v : ℝ, ‖g v‖ * B i v := by calc _ ≤ ∫ v : ℝ, X i * (‖g v‖ * B i v) := by apply norm_integral_le_of_norm_le ((hB i hi).const_mul (X i)) filter_upwards [hF i hi] with v hv rw [norm_mul] calc _ ≤ ‖g v‖ * (X i * B i v) := mul_le_mul_of_nonneg_left hv (norm_nonneg _) _ = _ := by ring _ = _ := integral_const_mul _ _ rw [norm_mul, norm_inv, Complex.norm_real, Real.norm_of_nonneg (hX i hi).le] calc _ ≤ (X i)⁻¹ * (X i * ∫ v : ℝ, ‖g v‖ * B i v) := mul_le_mul_of_nonneg_left hb (inv_nonneg.mpr (hX i hi).le) _ = _ := by rw [← mul_assoc, inv_mul_cancel₀ (hX i hi).ne', one_mul] end Bounty -- Source module: PhysicalResidualMellinEnvelope /- The original signed residual with an integrable, frequency-dependent local envelope. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_residual_local_envelope {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (hpool : ∀ g, P g ⊆ pool) (hV : ∀ g, 0 < V g) (hZ : 0 < Z) (positions : Finset ℤ) (hclosure : physicalSignedHarmonicPositions (ell := ell) P probes r t Z k ⊆ positions) (radius : ℕ) (hstep : physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k) ≤ radius) (B : ℕ → ℝ → ℝ) (hB : ∀ j ∈ positions.image (fun n => n.natAbs.log2), Integrable (fun v => ‖harmonicLogFourier v‖ * B j v)) (hpair : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, ‖physicalMellinPairing V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (reachablePositions (physicalDyadicStarts j) radius) (physicalPositionMask positions (physicalDyadicSource j (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n))) (physicalPositionMask positions (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) ((2 : ℝ)^j) Z (2*Real.pi*v)‖ ≤ (2 : ℝ)^j * B j v) : ‖physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ'‖ ≤ ∑ j ∈ positions.image (fun n => n.natAbs.log2), ∫ v : ℝ, ‖harmonicLogFourier v‖ * B j v := by rw [physical_signed_harmonic_residual_local_mellin P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' hdis hprime hpool hV hZ positions hclosure radius hstep] exact dyadic_mellin_sum_norm_le_envelope _ (fun j => (2 : ℝ)^j) (fun _ _ => by positivity) _ harmonicLogFourier B hB hpair end Bounty -- Source module: PhysicalResidualCommonEnvelope /- A common frequency envelope leaves only the finite dyadic count. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_residual_common_envelope {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (hpool : ∀ g, P g ⊆ pool) (hV : ∀ g, 0 < V g) (hZ : 0 < Z) (positions : Finset ℤ) (hclosure : physicalSignedHarmonicPositions (ell := ell) P probes r t Z k ⊆ positions) (radius : ℕ) (hstep : physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k) ≤ radius) (C : ℝ) (B : ℝ → ℝ) (hB : Integrable (fun v => ‖harmonicLogFourier v‖ * B v)) (hpair : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, ‖physicalMellinPairing V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (reachablePositions (physicalDyadicStarts j) radius) (physicalPositionMask positions (physicalDyadicSource j (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n))) (physicalPositionMask positions (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) ((2 : ℝ)^j) Z (2*Real.pi*v)‖ ≤ (2 : ℝ)^j * (C * B v)) : ‖physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ'‖ ≤ ((positions.image (fun n => n.natAbs.log2)).card : ℝ) * C * ∫ v : ℝ, ‖harmonicLogFourier v‖ * B v := by have hi : Integrable (fun v => ‖harmonicLogFourier v‖ * (C * B v)) := by apply (hB.const_mul C).congr exact Filter.Eventually.of_forall (fun v => by ring) have hp := physical_residual_local_envelope P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' hdis hprime hpool hV hZ positions hclosure radius hstep (fun _ v => C * B v) (fun _ _ => hi) hpair apply hp.trans_eq have he : (fun v : ℝ => ‖harmonicLogFourier v‖ * (C * B v)) = (fun v : ℝ => C * (‖harmonicLogFourier v‖ * B v)) := by funext v; ring simp only [he, integral_const_mul, sum_const, nsmul_eq_mul] ring end Bounty -- Source module: WeightedPiecewiseMellin /- A measurable split retains the exact integrable Fourier weight on both pieces. -/ open MeasureTheory open scoped Classical namespace Bounty theorem weighted_piecewise_mellin_properties {s : Set ℝ} (hs : MeasurableSet s) (w f g : ℝ → ℝ) (hf : IntegrableOn (fun v => w v * f v) s) (hg : IntegrableOn (fun v => w v * g v) sᶜ) : Integrable (fun v => w v * s.piecewise f g v) ∧ (∫ v : ℝ, w v * s.piecewise f g v) = (∫ v in s, w v * f v) + ∫ v in sᶜ, w v * g v := by have he : (fun v => w v * s.piecewise f g v) = (fun v => s.indicator (fun x => w x * f x) v + sᶜ.indicator (fun x => w x * g x) v) := by funext v by_cases hv : v ∈ s <;> simp [Set.piecewise, hv] have hf' := hf.integrable_indicator hs have hg' := hg.integrable_indicator hs.compl rw [he] exact ⟨hf'.add hg', by rw [integral_add hf' hg', integral_indicator hs, integral_indicator hs.compl]⟩ end Bounty -- Source module: PhysicalResidualSplitEnvelope /- An exact central/tail split for the original signed residual. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_residual_split_envelope {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (hpool : ∀ g, P g ⊆ pool) (hV : ∀ g, 0 < V g) (hZ : 0 < Z) (positions : Finset ℤ) (hclosure : physicalSignedHarmonicPositions (ell := ell) P probes r t Z k ⊆ positions) (radius : ℕ) (hstep : physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k) ≤ radius) (s : Set ℝ) (hs : MeasurableSet s) (C : ℝ) (T E : ℝ → ℝ) (hT : IntegrableOn (fun v => ‖harmonicLogFourier v‖ * T v) s) (hE : IntegrableOn (fun v => ‖harmonicLogFourier v‖ * E v) sᶜ) (hcentral : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, v ∈ s → ‖physicalMellinPairing V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (reachablePositions (physicalDyadicStarts j) radius) (physicalPositionMask positions (physicalDyadicSource j (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n))) (physicalPositionMask positions (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) ((2 : ℝ)^j) Z (2*Real.pi*v)‖ ≤ (2 : ℝ)^j * (C * T v)) (htail : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, ‖physicalMellinPairing V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (reachablePositions (physicalDyadicStarts j) radius) (physicalPositionMask positions (physicalDyadicSource j (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n))) (physicalPositionMask positions (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) ((2 : ℝ)^j) Z (2*Real.pi*v)‖ ≤ (2 : ℝ)^j * E v) : ‖physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ'‖ ≤ ((positions.image (fun n => n.natAbs.log2)).card : ℝ) * (C * (∫ v in s, ‖harmonicLogFourier v‖ * T v) + ∫ v in sᶜ, ‖harmonicLogFourier v‖ * E v) := by have hTc : IntegrableOn (fun v => ‖harmonicLogFourier v‖ * (C * T v)) s := by apply (hT.const_mul C).congr exact Filter.Eventually.of_forall (fun v => by ring) have hprops := weighted_piecewise_mellin_properties hs (fun v => ‖harmonicLogFourier v‖) (fun v => C * T v) E hTc hE have hpair : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, ‖physicalMellinPairing V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (reachablePositions (physicalDyadicStarts j) radius) (physicalPositionMask positions (physicalDyadicSource j (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n))) (physicalPositionMask positions (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) ((2 : ℝ)^j) Z (2*Real.pi*v)‖ ≤ (2 : ℝ)^j * (1 * s.piecewise (fun v => C * T v) E v) := by intro j hj filter_upwards [hcentral j hj, htail j hj] with v hc ht by_cases hv : v ∈ s · simpa [Set.piecewise, hv] using hc hv · simpa [Set.piecewise, hv] using ht have hp := physical_residual_common_envelope P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' hdis hprime hpool hV hZ positions hclosure radius hstep 1 (s.piecewise (fun v => C * T v) E) hprops.1 hpair have he : (∫ v in s, ‖harmonicLogFourier v‖ * (C * T v)) = C * ∫ v in s, ‖harmonicLogFourier v‖ * T v := by calc _ = ∫ v in s, C * (‖harmonicLogFourier v‖ * T v) := by apply integral_congr_ae exact Filter.Eventually.of_forall (fun v => by ring) _ = _ := integral_const_mul C _ simpa only [mul_one, hprops.2, he] using hp end Bounty -- Source module: PhysicalResidualFiniteMoment /- A bounded-frequency moment estimate combined with a direct pairing bound for the tail. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_residual_finite_moment_envelope {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (hpool : ∀ g, P g ⊆ pool) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ n, ‖α n‖ ≤ A) (hβ : ∀ n, ‖β n‖ ≤ B) (hγ : ∀ n, ‖γ n‖ ≤ C) (hα' : ∀ n, ‖α' n‖ ≤ A) (hβ' : ∀ n, ‖β' n‖ ≤ B) (hγ' : ∀ n, ‖γ' n‖ ≤ C) (hZ : 0 < Z) (positions : Finset ℤ) (hclosure : physicalSignedHarmonicPositions (ell := ell) P probes r t Z k ⊆ positions) (R D : ℕ) (hR : 2 ≤ R) (hD : 0 < D) (hstep : physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k) ≤ D) (hr : ∀ j ∈ positions.image (fun n => n.natAbs.log2), 2*R*D ≤ 2^j) (M : ℕ → ℝ) (B₀ U W : ℝ) (T E : ℝ → ℝ) (hB₀ : 0 ≤ B₀) (hM : ∀ j ∈ positions.image (fun n => n.natAbs.log2), 0 ≤ M j) (hT : ∀ᵐ v : ℝ, ‖v‖ ≤ W → 0 ≤ T v) (hsource : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ n ∈ physicalDyadicStarts j, ‖invariantTripleEndpoint pool α β γ n.natAbs‖ ≤ M j) (hblock : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ((D : ℝ)*(M j)^2)^(1/(2*(R : ℝ))) ≤ B₀) (hmoment : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, ‖v‖ ≤ W → (physicalRootMoment V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun e _ => if e % 2 = 0 then -(-(a+b)-2*Real.pi*v) else -(a+b)-2*Real.pi*v) (fun e _ => if e % 2 = 0 then -k else k) (fun e i x y aux => if e % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i y x aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ i x y aux) (physicalDyadicStarts j) (2*R-1) D).re ≤ (T v)^(2*R)) (hU : ∀ j ∈ positions.image (fun n => n.natAbs.log2), max 1 (2*(A*B*C*(1+Real.log (2^(j+1)+2*R*D : ℕ))^8)) ≤ U) (htail : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, ‖physicalMellinPairing V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (reachablePositions (physicalDyadicStarts j) (2*R*D)) (physicalPositionMask positions (physicalDyadicSource j (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n))) (physicalPositionMask positions (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) ((2 : ℝ)^j) Z (2*Real.pi*v)‖ ≤ (2 : ℝ)^j * E v) (hEnvelope : IntegrableOn (fun v => ‖harmonicLogFourier v‖ * T v) {v | ‖v‖ ≤ W}) (hTailEnvelope : IntegrableOn (fun v => ‖harmonicLogFourier v‖ * E v) {v | ‖v‖ ≤ W}ᶜ) : ‖physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ'‖ ≤ ((positions.image (fun n => n.natAbs.log2)).card : ℝ) * ((B₀ * Real.sqrt 3 * U^2) * (∫ v in {v : ℝ | ‖v‖ ≤ W}, ‖harmonicLogFourier v‖ * T v) + ∫ v in {v : ℝ | ‖v‖ ≤ W}ᶜ, ‖harmonicLogFourier v‖ * E v) := by have hstep' : physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k) ≤ 2*R*D := by apply hstep.trans simpa only [one_mul] using Nat.mul_le_mul_right D (show 1 ≤ 2*R by omega) apply physical_residual_split_envelope P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' hdis hprime hpool hV hZ positions hclosure (2*R*D) hstep' {v | ‖v‖ ≤ W} ((isClosed_le continuous_norm continuous_const).measurableSet) (B₀ * Real.sqrt 3 * U^2) T E hEnvelope hTailEnvelope _ htail intro j hj filter_upwards [hT, hmoment j hj] with v hTv hmv intro hv have hp := physical_actual_dyadic_moment_bound P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' hdis hprime hpool hV hMass hA hB hC hα hβ hγ hα' hβ' hγ' positions j R D hR hD hstep (hr j hj) v (hM j hj) hB₀ (hTv hv) (hsource j hj) (hblock j hj) (hmv hv) apply hp.trans apply mul_le_mul_of_nonneg_left _ (by positivity) apply mul_le_mul_of_nonneg_right _ (hTv hv) apply mul_le_mul_of_nonneg_left _ (mul_nonneg hB₀ (Real.sqrt_nonneg 3)) exact pow_le_pow_left₀ (by positivity) (hU j hj) 2 end Bounty -- Source module: PhysicalDyadicUpper /- Exponential position support gives linear logarithmic dyad bounds. -/ open Finset namespace Bounty theorem physical_dyadic_index_upper {S : Finset ℤ} {A : ℝ} (hS : ∀ n ∈ S, 0 < n ∧ (n : ℝ) ≤ Real.exp A) {j : ℕ} (hj : j ∈ S.image (fun n => n.natAbs.log2)) : (2 : ℝ)^j ≤ Real.exp A := by classical obtain ⟨n, hn, hj⟩ := mem_image.mp hj have hn0 := (hS n hn).1 have hb := (Nat.log2_eq_iff (Int.natAbs_ne_zero.mpr (ne_of_gt hn0))).mp hj have he : (n.natAbs : ℝ) = n := by have hi : (n.natAbs : ℤ) = n := by rw [Int.natCast_natAbs, abs_of_pos hn0] calc (n.natAbs : ℝ) = ((n.natAbs : ℤ) : ℝ) := by simp _ = (n : ℝ) := congrArg (fun z : ℤ => (z : ℝ)) hi have hl : (2 : ℝ)^j ≤ (n.natAbs : ℝ) := by exact_mod_cast hb.1 rw [he] at hl exact hl.trans (hS n hn).2 theorem physical_dyadic_indices_card {S : Finset ℤ} {A : ℝ} (hS : ∀ n ∈ S, 0 < n ∧ (n : ℝ) ≤ Real.exp A) : (S.image (fun n => n.natAbs.log2)).card ≤ Nat.floor (A/Real.log 2)+1 := by classical apply (card_le_card (t := range (Nat.floor (A/Real.log 2)+1)) ?_).trans (le_of_eq (card_range _)) intro j hj apply mem_range.mpr apply Nat.lt_succ_of_le apply Nat.le_floor apply (le_div_iff₀ (Real.log_pos (by norm_num : (1 : ℝ) < 2))).mpr have hl := Real.log_le_log (by positivity : (0 : ℝ) < (2 : ℝ)^j) (physical_dyadic_index_upper hS hj) simpa only [Real.log_pow, Real.log_exp] using hl theorem physical_dyadic_log_upper {j : ℕ} {A : ℝ} (hj : (2 : ℝ)^j ≤ Real.exp A) {n : ℤ} (hn : n ∈ physicalDyadicStarts j) : 0 < n ∧ Real.log (n.natAbs : ℝ) ≤ Real.log 2 + A := by have hn' := mem_Ico.mp hn have hn0 : 0 < n := (by positivity : (0 : ℤ) < 2^j).trans_le hn'.1 refine ⟨hn0, ?_⟩ have he : (n.natAbs : ℝ) = n := by have hi : (n.natAbs : ℤ) = n := by rw [Int.natCast_natAbs, abs_of_pos hn0] calc (n.natAbs : ℝ) = ((n.natAbs : ℤ) : ℝ) := by simp _ = (n : ℝ) := congrArg (fun z : ℤ => (z : ℝ)) hi have hhi : (n.natAbs : ℝ) ≤ 2*Real.exp A := by rw [he] have hh : (n : ℝ) < (2 : ℝ)^(j+1) := by exact_mod_cast hn'.2 rw [pow_succ] at hh nlinarith have hp : (0 : ℝ) < n.natAbs := by exact_mod_cast Int.natAbs_pos.mpr hn0.ne' have hl := Real.log_le_log hp hhi simpa only [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) (Real.exp_ne_zero A), Real.log_exp] using hl end Bounty -- Source module: PhysicalResidualScalarBounds /- Absolute polynomial bounds for the raw dyadic count and fixed endpoint allowance. -/ open Finset Filter namespace Bounty theorem physical_dyadic_unit_allowance_le {L : ℝ} (hL : 1 ≤ L) (hconst : 2*(8 : ℝ)^8 ≤ L) (hlog : Real.log 3 ≤ L) (j radius : ℕ) (hr : radius ≤ 2^j) (hj : (2 : ℝ)^j ≤ Real.exp (6*L)) : max 1 (2*(1+Real.log (2^(j+1)+radius : ℕ))^8) ≤ L^9 := by have hL0 : 0 ≤ L := zero_le_one.trans hL have hN1 : (1 : ℝ) ≤ (2^(j+1)+radius : ℕ) := by exact_mod_cast (Nat.succ_le_of_lt (show 0 < 2^(j+1)+radius by positivity)) have hN : ((2^(j+1)+radius : ℕ) : ℝ) ≤ 3*Real.exp (6*L) := by have hr' : (radius : ℝ) ≤ (2 : ℝ)^j := by exact_mod_cast hr push_cast rw [pow_succ] linarith have hnlog := Real.log_le_log (lt_of_lt_of_le zero_lt_one hN1) hN rw [Real.log_mul (by norm_num : (3 : ℝ) ≠ 0) (Real.exp_ne_zero _), Real.log_exp] at hnlog have hbase0 : 0 ≤ 1+Real.log (2^(j+1)+radius : ℕ) := by linarith [Real.log_nonneg hN1] have hbase : 1+Real.log (2^(j+1)+radius : ℕ) ≤ 8*L := by linarith apply max_le · simpa using (pow_le_pow_left₀ (by norm_num : (0 : ℝ) ≤ 1) hL 9) · calc 2*(1+Real.log (2^(j+1)+radius : ℕ))^8 ≤ 2*(8*L)^8 := by exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hbase0 hbase 8) (by norm_num) _ = (2*(8 : ℝ)^8)*L^8 := by ring _ ≤ L*L^8 := mul_le_mul_of_nonneg_right hconst (pow_nonneg hL0 _) _ = L^9 := by ring theorem physical_dyadic_card_le_sq {L : ℝ} (hL : 1 ≤ L) (hc : 6/Real.log 2+1 ≤ L) (S : Finset ℤ) (hS : ∀ n ∈ S, 0 < n ∧ (n : ℝ) ≤ Real.exp (6*L)) : ((S.image (fun n => n.natAbs.log2)).card : ℝ) ≤ L^2 := by have hL0 : 0 ≤ L := zero_le_one.trans hL have hb : ((S.image (fun n => n.natAbs.log2)).card : ℝ) ≤ (Nat.floor (6*L/Real.log 2) : ℝ)+1 := by exact_mod_cast physical_dyadic_indices_card hS have hf := Nat.floor_le (show 0 ≤ 6*L/Real.log 2 by positivity) calc _ ≤ 6*L/Real.log 2+1 := hb.trans (by linarith) _ = (6/Real.log 2)*L+1 := by ring _ ≤ (6/Real.log 2+1)*L := by nlinarith _ ≤ L*L := mul_le_mul_of_nonneg_right hc hL0 _ = L^2 := by ring theorem physical_raw_prefactor_le {L U : ℝ} {N : ℕ} (hL : 0 ≤ L) (hN : (N : ℝ) ≤ L^2) (hU0 : 0 ≤ U) (hU : U ≤ L^9) (hcost : Real.exp 1*Real.sqrt 3 ≤ L) : (N : ℝ)*(Real.exp 1*Real.sqrt 3*U^2) ≤ L^21 := by have hinner := mul_le_mul hcost (pow_le_pow_left₀ hU0 hU 2) (sq_nonneg U) hL calc _ ≤ L^2*(L*(L^9)^2) := mul_le_mul hN hinner (by positivity) (sq_nonneg L) _ = L^21 := by ring end Bounty -- Source module: PhysicalResidualPolynomialSplit /- Polynomial central and tail prefactors with only a bounded-frequency moment premise. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_residual_polynomial_finite_moment {L : ℝ} (hL : 1 ≤ L) (hconst : 2*(8 : ℝ)^8 ≤ L) (hlog : Real.log 3 ≤ L) (hc : 6/Real.log 2+1 ≤ L) (hcost : Real.exp 1*Real.sqrt 3 ≤ L) {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (hpool : ∀ g, P g ⊆ pool) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (hα : ∀ n, ‖α n‖ ≤ 1) (hβ : ∀ n, ‖β n‖ ≤ 1) (hγ : ∀ n, ‖γ n‖ ≤ 1) (hα' : ∀ n, ‖α' n‖ ≤ 1) (hβ' : ∀ n, ‖β' n‖ ≤ 1) (hγ' : ∀ n, ‖γ' n‖ ≤ 1) (hZ : 0 < Z) (positions : Finset ℤ) (hpositions : ∀ n ∈ positions, 0 < n ∧ (n : ℝ) ≤ Real.exp (6*L)) (hclosure : physicalSignedHarmonicPositions (ell := ell) P probes r t Z k ⊆ positions) (R D : ℕ) (hR : 2 ≤ R) (hD : 0 < D) (hstep : physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k) ≤ D) (hr : ∀ j ∈ positions.image (fun n => n.natAbs.log2), 2*R*D ≤ 2^j) (M : ℕ → ℝ) (W : ℝ) (T E : ℝ → ℝ) (hM : ∀ j ∈ positions.image (fun n => n.natAbs.log2), 0 ≤ M j) (hT : ∀ᵐ v : ℝ, ‖v‖ ≤ W → 0 ≤ T v) (hE : ∀ᵐ v : ℝ, 0 ≤ E v) (hsource : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ n ∈ physicalDyadicStarts j, ‖invariantTripleEndpoint pool α β γ n.natAbs‖ ≤ M j) (hblock : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ((D : ℝ)*(M j)^2)^(1/(2*(R : ℝ))) ≤ Real.exp 1) (hmoment : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, ‖v‖ ≤ W → (physicalRootMoment V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun e _ => if e % 2 = 0 then -(-(a+b)-2*Real.pi*v) else -(a+b)-2*Real.pi*v) (fun e _ => if e % 2 = 0 then -k else k) (fun e i x y aux => if e % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i y x aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ i x y aux) (physicalDyadicStarts j) (2*R-1) D).re ≤ (T v)^(2*R)) (htail : ∀ j ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, ‖physicalMellinPairing V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => -(a+b)) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (reachablePositions (physicalDyadicStarts j) (2*R*D)) (physicalPositionMask positions (physicalDyadicSource j (fun n => physicalPhase (-a) n.natAbs * positiveInvariantEndpoint pool α β γ n))) (physicalPositionMask positions (fun n => physicalPhase b n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) ((2 : ℝ)^j) Z (2*Real.pi*v)‖ ≤ (2 : ℝ)^j * E v) (hEnvelope : IntegrableOn (fun v => ‖harmonicLogFourier v‖ * T v) {v | ‖v‖ ≤ W}) (hTailEnvelope : IntegrableOn (fun v => ‖harmonicLogFourier v‖ * E v) {v | ‖v‖ ≤ W}ᶜ) : ‖physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ'‖ ≤ L^21 * (∫ v in {v : ℝ | ‖v‖ ≤ W}, ‖harmonicLogFourier v‖ * T v) + L^2 * ∫ v in {v : ℝ | ‖v‖ ≤ W}ᶜ, ‖harmonicLogFourier v‖ * E v := by have hallow : ∀ j ∈ positions.image (fun n => n.natAbs.log2), max 1 (2*((1 : ℝ)*1*1*(1+Real.log (2^(j+1)+2*R*D : ℕ))^8)) ≤ L^9 := by intro j hj simpa only [one_mul] using physical_dyadic_unit_allowance_le hL hconst hlog j (2*R*D) (hr j hj) (physical_dyadic_index_upper hpositions hj) have hp := physical_residual_finite_moment_envelope P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' hdis hprime hpool hV hMass (by norm_num : (0 : ℝ) ≤ 1) (by norm_num : (0 : ℝ) ≤ 1) (by norm_num : (0 : ℝ) ≤ 1) hα hβ hγ hα' hβ' hγ' hZ positions hclosure R D hR hD hstep hr M (Real.exp 1) (L^9) W T E (le_of_lt (Real.exp_pos _)) hM hT hsource hblock hmoment hallow htail hEnvelope hTailEnvelope have hcard := physical_dyadic_card_le_sq hL hc positions hpositions have hfactor := physical_raw_prefactor_le (zero_le_one.trans hL) hcard (pow_nonneg (zero_le_one.trans hL) 9) (le_refl (L^9)) hcost have hs : MeasurableSet {v : ℝ | ‖v‖ ≤ W} := (isClosed_le continuous_norm continuous_const).measurableSet have hIntegral : 0 ≤ ∫ v in {v : ℝ | ‖v‖ ≤ W}, ‖harmonicLogFourier v‖ * T v := by apply integral_nonneg_of_ae filter_upwards [hT.filter_mono ae_restrict_le, ae_restrict_mem hs] with v hv hm exact mul_nonneg (norm_nonneg _) (hv hm) have hTailIntegral : 0 ≤ ∫ v in {v : ℝ | ‖v‖ ≤ W}ᶜ, ‖harmonicLogFourier v‖ * E v := by apply integral_nonneg_of_ae filter_upwards [hE.filter_mono ae_restrict_le] with v hv exact mul_nonneg (norm_nonneg _) hv apply hp.trans rw [mul_add, ← mul_assoc] exact add_le_add (mul_le_mul_of_nonneg_right hfactor hIntegral) (mul_le_mul_of_nonneg_right hcard hTailIntegral) end Bounty -- Source module: PhysicalResidualScalarDecay /- A finite central saving and a polynomial direct tail give arbitrary decay after integration. -/ open MeasureTheory Filter namespace Bounty theorem eventually_physical_residual_scalar_decay {r : ℝ} (hr : 0 < r) (C D : ℝ) : ∀ᶠ L : ℝ in atTop, L^21 * (∫ v in {v : ℝ | ‖v‖ ≤ L^r}, ‖harmonicLogFourier v‖ * L^(-(D+23))) + L^2 * (∫ v in {v : ℝ | ‖v‖ ≤ L^r}ᶜ, ‖harmonicLogFourier v‖ * L^C) ≤ L^(-D) := by filter_upwards [eventually_harmonic_mellin_tail_power hr (C+2) (D+1), eventually_ge_atTop (2 : ℝ), eventually_ge_atTop (∫ v : ℝ, ‖harmonicLogFourier v‖)] with L htail hL hmass have hL0 : 0 < L := by linarith have hcentral : (∫ v in {v : ℝ | ‖v‖ ≤ L^r}, ‖harmonicLogFourier v‖) ≤ L := by exact (setIntegral_le_integral harmonic_log_fourier_integrable.norm (Filter.Eventually.of_forall (fun v => norm_nonneg (harmonicLogFourier v)))).trans hmass have hc : L^21 * (∫ v in {v : ℝ | ‖v‖ ≤ L^r}, ‖harmonicLogFourier v‖ * L^(-(D+23))) ≤ L^(-(D+1)) := by rw [integral_mul_const] calc _ ≤ L^21 * (L * L^(-(D+23))) := by exact mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hcentral (Real.rpow_pos_of_pos hL0 _).le) (pow_nonneg hL0.le _) _ = L^(-(D+1)) := by calc _ = L^(21 : ℝ) * (L^(1 : ℝ) * L^(-(D+23))) := by rw [Real.rpow_ofNat, Real.rpow_one] _ = _ := by rw [← Real.rpow_add hL0, ← Real.rpow_add hL0] congr 1 ring have heq : {v : ℝ | ‖v‖ ≤ L^r}ᶜ = {v : ℝ | L^r < ‖v‖} := by ext v; simp have ht : L^2 * (∫ v in {v : ℝ | ‖v‖ ≤ L^r}ᶜ, ‖harmonicLogFourier v‖ * L^C) ≤ L^(-(D+1)) := by rw [heq, integral_mul_const] convert htail (L^(C+2)) (Real.rpow_pos_of_pos hL0 _).le le_rfl using 1 rw [Real.rpow_add hL0, Real.rpow_ofNat] ring calc _ ≤ L^(-(D+1)) + L^(-(D+1)) := add_le_add hc ht _ = 2 * L^(-(D+1)) := by ring _ ≤ L * L^(-(D+1)) := mul_le_mul_of_nonneg_right hL (Real.rpow_pos_of_pos hL0 _).le _ = L^(-D) := by calc _ = L^(1 : ℝ) * L^(-(D+1)) := by rw [Real.rpow_one] _ = _ := by rw [← Real.rpow_add hL0] congr 1 ring end Bounty -- Source module: FiniteKernelSchurNorm /- The finite Schur estimate controls the actual Euclidean kernel operator. -/ open Finset open scoped Classical namespace Bounty theorem finite_kernel_schur_norm {X : Type*} [Fintype X] (K : X → X → ℂ) {A : ℝ} (hA : 0 ≤ A) (hrow : ∀ x, ∑ y, ‖K x y‖ ≤ A) (hcol : ∀ y, ∑ x, ‖K x y‖ ≤ A) (f : EuclideanSpace ℂ X) : ‖finiteKernelOperator K f‖ ≤ A*‖f‖ := by have h := constant_measure_schur univ K (μ := 1) zero_le_one (fun x _ => hrow x) (fun y _ => hcol y) f apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg hA (norm_nonneg f))).mp simpa only [EuclideanSpace.norm_sq_eq, finite_kernel_operator_apply, one_mul, mul_pow] using h end Bounty -- Source module: PhysicalHilbertSchur /- Uniform Schur bounds for the literal physical Hilbert operator at every frequency. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_hilbert_schur_bound {q v : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hv : 0 < v) (ell m : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J : ℕ) (V : G → ℝ), (∀ g, v ≤ V g) → (∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) → ∀ (I : Type) (patterns : Finset I) (C : I → G → Finset (Fin J)) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (B : I → ℝ), (∀ i ∈ patterns, ∀ g, (C i g).card ≤ m) → (∀ i ∈ patterns, 0 ≤ B i) → (∀ i ∈ patterns, ∀ a b aux, ‖K i a b aux‖ ≤ B i) → ∀ (positions : Finset ℤ) (f : EuclideanSpace ℂ (physicalCutoff P J ell positions)), ‖physicalHilbertOperator V patterns C q ζ k K positions f‖ ≤ ((∑ i ∈ patterns, B i)*A^(Fintype.card G))*‖f‖ := by obtain ⟨A, hA, hbound⟩ := exists_physical_operator_bounds hq0 hq1 hv ell m refine ⟨A, hA, ?_⟩ intro G _ _ P J V hV hMass I patterns C ζ k K B hC hB hK positions f apply finite_kernel_schur_norm _ (mul_nonneg (sum_nonneg hB) (pow_nonneg (zero_le_one.trans hA) _)) · intro x rw [sum_coe_sort (physicalCutoff P J ell positions) (fun y => ‖physicalSymmetricKernel (fun a b => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) a b) x.val y‖)] exact (hbound G P J V hV hMass I patterns C ζ k K B hC hB hK x.val (physicalCutoff P J ell positions)).1 · intro y rw [sum_coe_sort (physicalCutoff P J ell positions) (fun x => ‖physicalSymmetricKernel (fun a b => ∑ i ∈ patterns, physicalPatternKernel V (C i) q (ζ i) (k i) (K i) a b) x y.val‖)] exact (hbound G P J V hV hMass I patterns C ζ k K B hC hB hK y.val (physicalCutoff P J ell positions)).2 end Bounty -- Source module: CandidateHilbertPolynomial /- The literal signed candidate kernel has an absolute polynomial operator bound. -/ open Finset Filter open scoped Classical namespace Bounty theorem exists_candidate_hilbert_polynomial {c q x : ℝ} (hc : 0 < c) (hq : 0 ≤ q) (hx : 0 ≤ x) (J ell : ℕ) : ∃ E : ℝ, 0 ≤ E ∧ ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (probes : S → Finset (Fin J)) (r t : Finset S) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ), (Q : ℝ) ≤ L^q → L^(-x) ≤ ξ → let P := fun g : S => candidatePBand (c*L) g.val let V := fun g : S => ∑ p ∈ P g, 1/(p : ℝ) ∀ ζ : RepeatedBigPrimePatternIndex (ell := ell) probes r t → ℝ, ∀ k : RepeatedBigPrimePatternIndex (ell := ell) probes r t → ℤ, ∀ (positions : Finset ℤ) (f : EuclideanSpace ℂ (physicalCutoff P J ell positions)), ‖physicalHilbertOperator V univ (repeatedBigPrimePatternCut probes r t) (1/2) ζ k (physicalRootPrimeKernel P V probes r t hrt Q h ξ) positions f‖ ≤ L^E*‖f‖ := by obtain ⟨v, A₀, hv, hA₀, hinput⟩ := exists_candidate_shared_error_inputs hc J obtain ⟨v₁, A₁, _, hA₁, hcount⟩ := exists_candidate_shared_error_inputs hc 1 obtain ⟨A, hA, hschur⟩ := exists_physical_hilbert_schur_bound (q := (1/2 : ℝ)) (by norm_num) (by norm_num) hv ell J have hlogA : 0 ≤ Real.log A := Real.log_nonneg hA have hlog2 : 0 ≤ Real.log (2 : ℝ) := Real.log_nonneg (by norm_num) refine ⟨(A₀*Real.log 2+1+(4*q+2*x))+(A₁*Real.log A), by positivity, ?_⟩ filter_upwards [hinput, hcount, eventually_ge_atTop (2 : ℝ)] with L hinput hcount hL intro S hS probes r t hrt Q h ξ hQ hξ P V ζ k positions f have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hξ0 : 0 < ξ := (Real.rpow_pos_of_pos hL0 (-x)).trans_le hξ have hslots : ((J*Fintype.card S : ℕ) : ℝ) ≤ A₀*Real.log L := by simpa only [Fintype.card_coe] using (hinput S hS).1 have hcard : (Fintype.card S : ℝ) ≤ A₁*Real.log L := by simpa only [Nat.one_mul, Fintype.card_coe] using (hcount S hS).1 have hp := harmonic_pattern_card_power (ell := ell) probes r t hrt hL hA₀ hslots have hK : ∀ i ∈ (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)), ∀ a b aux, ‖physicalRootPrimeKernel P V probes r t hrt Q h ξ i a b aux‖ ≤ L^(4*q+2*x) := by intro i _ a b aux have hi := repeated_big_prime_pattern_kernel_norm_le P V probes r t hrt Q h ξ hξ0 i (fun g s => a g s) (fun g s => b g s) aux rw [physicalRootPrimeKernel, norm_mul, repeated_big_prime_pattern_weight_norm, one_mul] exact hi.trans (harmonic_pattern_bound_power probes r t hL1 hq hx Q hQ hξ i) have hs := hschur S P J V (fun g => ((hinput S hS).2 g).1) (fun _ => rfl) (RepeatedBigPrimePatternIndex (ell := ell) probes r t) univ (repeatedBigPrimePatternCut probes r t) ζ k (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (fun _ => L^(4*q+2*x)) (fun i _ g => by simpa only [Fintype.card_fin] using (card_le_univ (repeatedBigPrimePatternCut probes r t i g))) (fun _ _ => Real.rpow_nonneg hL0.le _) hK positions f have hpow : A^(Fintype.card S) ≤ L^(A₁*Real.log A) := by calc _ = Real.exp (Real.log A*(Fintype.card S : ℝ)) := by rw [← Real.rpow_natCast, Real.rpow_def_of_pos (lt_of_lt_of_le zero_lt_one hA)] _ ≤ Real.exp (Real.log A*(A₁*Real.log L)) := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left hcard hlogA) _ = _ := by rw [Real.rpow_def_of_pos hL0]; congr 1; ring have hsum : (∑ _i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, L^(4*q+2*x)) ≤ L^(A₀*Real.log 2+1+(4*q+2*x)) := by simp only [sum_const, card_univ, nsmul_eq_mul] calc _ ≤ L^(A₀*Real.log 2+1)*L^(4*q+2*x) := mul_le_mul_of_nonneg_right hp (Real.rpow_nonneg hL0.le _) _ = _ := (Real.rpow_add hL0 _ _).symm apply hs.trans apply mul_le_mul_of_nonneg_right _ (norm_nonneg f) calc _ ≤ L^(A₀*Real.log 2+1+(4*q+2*x))*L^(A₁*Real.log A) := mul_le_mul hsum hpow (pow_nonneg (zero_le_one.trans hA) _) (Real.rpow_nonneg hL0.le _) _ = _ := (Real.rpow_add hL0 _ _).symm end Bounty -- Source module: PhysicalRawDyadicAbsolute /- A direct all-frequency pairing envelope from an absolute operator bound. -/ open Finset open scoped Classical InnerProductSpace namespace Bounty theorem physical_raw_dyadic_absolute_bound {G I : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (hP : Pairwise (fun g h => Disjoint (P g) (P h))) (hprime : ∀ g p, p ∈ P g → p.Prime) (V : G → ℝ) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) (patterns : Finset I) (C : I → G → Finset (Fin J)) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (ζ : I → ℝ) (k : I → ℤ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (pool : Finset ℕ) (hpool : ∀ g, P g ⊆ pool) (α β γ α' β' γ' : ℕ → ℂ) {A B C₀ : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C₀) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C₀) (hα' : ∀ m, ‖α' m‖ ≤ A) (hβ' : ∀ p, ‖β' p‖ ≤ B) (hγ' : ∀ r, ‖γ' r‖ ≤ C₀) (S : Finset ℤ) (j radius : ℕ) (hr : radius ≤ 2^j) (a c Z v H : ℝ) (hH : 0 ≤ H) (hop : ∀ f : EuclideanSpace ℂ (physicalCutoff P J ell (reachablePositions (physicalDyadicStarts j) radius)), ‖physicalHilbertOperator V patterns C q (fun i => ζ i-v) k K (reachablePositions (physicalDyadicStarts j) radius) f‖ ≤ H*‖f‖) : let f := physicalPositionMask S (physicalDyadicSource j (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n)) let g := physicalPositionMask S (fun n => physicalPhase c n.natAbs * positiveInvariantEndpoint pool α' β' γ' n) let U := max 1 (2*(A*B*C₀*(1+Real.log (2^(j+1)+radius : ℕ))^8)) ‖physicalMellinPairing V patterns C q ζ k K (reachablePositions (physicalDyadicStarts j) radius) f g ((2 : ℝ)^j) Z v‖ ≤ (2 : ℝ)^j*(H*U^2) := by dsimp only let positions := reachablePositions (physicalDyadicStarts j) radius let F := physicalEndpointVector P V J ell q positions (physicalMellinSource ((2 : ℝ)^j) Z v (physicalPositionMask S (physicalDyadicSource j (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n)))) let G₀ := physicalEndpointVector P V J ell q positions (physicalPositionMask S (fun n => physicalPhase c n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) let E := A*B*C₀*Real.sqrt (2^(j+1)+radius : ℕ)*(1+Real.log (2^(j+1)+radius : ℕ))^8 have hE : 0 ≤ E := by dsimp [E]; positivity have hs : ‖F‖ ≤ E := physical_raw_mellin_source_endpoint_norm P hP hprime V hV hMass pool hpool α β γ hA hB hC hα hβ hγ J ell hq0 hq1 S j radius hr a Z v have ht : ‖G₀‖ ≤ E := physical_raw_target_endpoint_norm P hP hprime V hV hMass pool hpool α' β' γ' hA hB hC hα' hβ' hγ' J ell hq0 hq1 S j radius hr c have henergy := physical_dyadic_endpoint_energy_sq j radius hr hA hB hC change ‖inner ℂ F (physicalHilbertOperator V patterns C q (fun i => ζ i-v) k K positions G₀)‖ ≤ _ calc _ ≤ ‖F‖*‖physicalHilbertOperator V patterns C q (fun i => ζ i-v) k K positions G₀‖ := norm_inner_le_norm _ _ _ ≤ E*(H*E) := mul_le_mul hs ((hop G₀).trans (mul_le_mul_of_nonneg_left ht hH)) (norm_nonneg _) hE _ = H*E^2 := by ring _ ≤ H*((2 : ℝ)^j*(max 1 (2*(A*B*C₀*(1+Real.log (2^(j+1)+radius : ℕ))^8)))^2) := mul_le_mul_of_nonneg_left henergy hH _ = _ := by ring end Bounty -- Source module: CandidateDyadicAbsolute /- A polynomial all-frequency envelope for the actual candidate Mellin pairing. -/ open Finset Filter open scoped Classical namespace Bounty theorem exists_candidate_dyadic_absolute_envelope {c q x : ℝ} (hc : 0 < c) (hq : 0 ≤ q) (hx : 0 ≤ x) (J ell : ℕ) : ∃ E : ℝ, 0 ≤ E ∧ ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (probes : S → Finset (Fin J)) (r t : Finset S) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ), (Q : ℝ) ≤ L^q → L^(-x) ≤ ξ → let P := fun g : S => candidatePBand (c*L) g.val let V := fun g : S => ∑ p ∈ P g, 1/(p : ℝ) ∀ (pool : Finset ℕ), (∀ g, P g ⊆ pool) → ∀ (α β γ α' β' γ' : ℕ → ℂ), (∀ n, ‖α n‖ ≤ 1) → (∀ n, ‖β n‖ ≤ 1) → (∀ n, ‖γ n‖ ≤ 1) → (∀ n, ‖α' n‖ ≤ 1) → (∀ n, ‖β' n‖ ≤ 1) → (∀ n, ‖γ' n‖ ≤ 1) → ∀ (positions : Finset ℤ) (i radius : ℕ), radius ≤ 2^i → (2 : ℝ)^i ≤ Real.exp (6*L) → ∀ (ζ a a' Z v : ℝ) (k : ℤ), ‖physicalMellinPairing (ell := ell) V univ (repeatedBigPrimePatternCut probes r t) (1/2) (fun _ => ζ) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (reachablePositions (physicalDyadicStarts i) radius) (physicalPositionMask positions (physicalDyadicSource i (fun n => physicalPhase a n.natAbs * positiveInvariantEndpoint pool α β γ n))) (physicalPositionMask positions (fun n => physicalPhase a' n.natAbs * positiveInvariantEndpoint pool α' β' γ' n)) ((2 : ℝ)^i) Z (2*Real.pi*v)‖ ≤ (2 : ℝ)^i*L^E := by obtain ⟨E₀, hE₀, hop⟩ := exists_candidate_hilbert_polynomial hc hq hx J ell obtain ⟨v₀, A, hv₀, _, hinput⟩ := exists_candidate_shared_error_inputs hc J refine ⟨E₀+18, by linarith, ?_⟩ filter_upwards [hop, hinput, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (2*(8 : ℝ)^8), eventually_ge_atTop (Real.log 3)] with L hop hinput hL hconst hlog intro S hS probes r t hrt Q h ξ hQ hξ P V pool hpool α β γ α' β' γ' hα hβ hγ hα' hβ' hγ' positions i radius hr hi ζ a a' Z v k have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL have hdis : Pairwise (fun g h => Disjoint (P g) (P h)) := by intro g g' hgg' exact pairwise_disjoint_dyadicPrimeBand (mul_nonneg hc.le hL0.le) (by norm_num : (0 : ℝ) ≤ 3/2) (by norm_num : (9/5 : ℝ) ≤ 2*(3/2)) (Subtype.val_injective.ne hgg') have hprime : ∀ g p, p ∈ P g → p.Prime := by intro g p hp exact ((hinput S hS).2 g).2 p hp |>.1 have hV : ∀ g, 0 < V g := fun g => hv₀.trans_le ((hinput S hS).2 g).1 have hb := physical_raw_dyadic_absolute_bound (ell := ell) P hdis hprime V hV (fun _ => rfl) univ (repeatedBigPrimePatternCut probes r t) (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) ≤ 1) (fun _ => ζ) (fun _ => k) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) pool hpool α β γ α' β' γ' (by norm_num : (0 : ℝ) ≤ 1) (by norm_num : (0 : ℝ) ≤ 1) (by norm_num : (0 : ℝ) ≤ 1) hα hβ hγ hα' hβ' hγ' positions i radius hr a a' Z (2*Real.pi*v) (L^E₀) (Real.rpow_nonneg hL0.le _) (hop S hS probes r t hrt Q h ξ hQ hξ (fun _ => ζ-2*Real.pi*v) (fun _ => k) _) dsimp only at hb simp only [one_mul] at hb have hU := physical_dyadic_unit_allowance_le hL hconst hlog i radius hr hi apply hb.trans calc _ ≤ (2 : ℝ)^i*(L^E₀*(L^9)^2) := by gcongr _ = (2 : ℝ)^i*L^(E₀+18) := by rw [show (L^9)^2 = L^18 by ring, ← Real.rpow_natCast L 18, ← Real.rpow_add hL0] norm_num end Bounty -- Source module: InvariantRoughSupremum /- Rough coefficients give the square-root exponential supremum used in block moments. -/ open Finset namespace Bounty theorem invariant_triple_endpoint_rough_exp {W : ℝ} (hW : 1 < W) (pool : Finset ℕ) (α β γ : ℕ → ℂ) {A B C : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hC : 0 ≤ C) (hα : ∀ m, ‖α m‖ ≤ A) (hβ : ∀ p, ‖β p‖ ≤ B) (hγ : ∀ r, ‖γ r‖ ≤ C) (hαrough : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → W ≤ (p : ℝ)) → α m = 0) (hβrough : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → W ≤ (p : ℝ)) → β m = 0) {n : ℕ} (hn : n ≠ 0) : ‖invariantTripleEndpoint pool α β γ n‖ ≤ A*B*C*Real.exp (2*(Real.log 2*Real.log n/Real.log W)) := by have hb := endpoint_triple_convolution_rough_exp hW α β γ hA hB hC hα hβ hγ hαrough hβrough (primePoolFreePart_ne_zero pool hn) apply hb.trans have hpos : (0 : ℝ) < primePoolFreePart pool n := by exact_mod_cast Nat.pos_of_ne_zero (primePoolFreePart_ne_zero pool hn) have hle : (primePoolFreePart pool n : ℝ) ≤ n := by exact_mod_cast (Nat.div_le_self n (primePoolPart pool n)) have hlog := Real.log_le_log hpos hle have hlogW : 0 ≤ Real.log W := (Real.log_pos hW).le gcongr theorem invariant_triple_endpoint_sqrt_bound {L C : ℝ} (hL : 0 < L) (pool : Finset ℕ) (α β γ : ℕ → ℂ) (hα : ∀ m, ‖α m‖ ≤ 1) (hβ : ∀ p, ‖β p‖ ≤ 1) (hγ : ∀ r, ‖γ r‖ ≤ 1) (hαrough : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → Real.exp (Real.sqrt L) ≤ (p : ℝ)) → α m = 0) (hβrough : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → Real.exp (Real.sqrt L) ≤ (p : ℝ)) → β m = 0) {n : ℕ} (hn : n ≠ 0) (hlog : Real.log n ≤ C*L) : ‖invariantTripleEndpoint pool α β γ n‖ ≤ Real.exp ((2*Real.log 2*C)*Real.sqrt L) := by have hs : 0 < Real.sqrt L := Real.sqrt_pos.mpr hL have hb := invariant_triple_endpoint_rough_exp (Real.one_lt_exp_iff.mpr hs) pool α β γ zero_le_one zero_le_one zero_le_one hα hβ hγ hαrough hβrough hn simp only [one_mul, Real.log_exp] at hb apply hb.trans apply Real.exp_le_exp.mpr have hratio : Real.log n/Real.sqrt L ≤ C*Real.sqrt L := by apply (div_le_iff₀ hs).mpr calc Real.log n ≤ C*L := hlog _ = C*Real.sqrt L*Real.sqrt L := by rw [mul_assoc, ← pow_two, Real.sq_sqrt hL.le] have hh := mul_le_mul_of_nonneg_left hratio (Real.log_nonneg (by norm_num : (1 : ℝ) ≤ 2)) rw [← mul_div_assoc] at hh nlinarith theorem invariant_triple_endpoint_dyadic_sqrt_bound {L a : ℝ} (hL : 0 < L) (hlogL : Real.log 2 ≤ L) (pool : Finset ℕ) (α β γ : ℕ → ℂ) (hα : ∀ m, ‖α m‖ ≤ 1) (hβ : ∀ p, ‖β p‖ ≤ 1) (hγ : ∀ r, ‖γ r‖ ≤ 1) (hαrough : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → Real.exp (Real.sqrt L) ≤ (p : ℝ)) → α m = 0) (hβrough : ∀ m, ¬ (∀ p : ℕ, p ∈ m.primeFactors → Real.exp (Real.sqrt L) ≤ (p : ℝ)) → β m = 0) {j : ℕ} (hj : (2 : ℝ)^j ≤ Real.exp (a*L)) {n : ℤ} (hn : n ∈ physicalDyadicStarts j) : ‖invariantTripleEndpoint pool α β γ n.natAbs‖ ≤ Real.exp ((2*Real.log 2*(a+1))*Real.sqrt L) := by obtain ⟨hn0, hlog⟩ := physical_dyadic_log_upper hj hn apply invariant_triple_endpoint_sqrt_bound hL pool α β γ hα hβ hγ hαrough hβrough (Int.natAbs_ne_zero.mpr hn0.ne') linarith end Bounty -- Source module: ActualFiniteResidual /- A central-frequency original moment bound implies decay of the actual signed residual. -/ open Finset Filter MeasureTheory open scoped Classical namespace Bounty theorem eventually_actual_residual_of_central_moment {c b K q x η : ℝ} (hc : 0 < c) (hb : 0 < b) (hK : 0 ≤ K) (hq : 0 ≤ q) (hx : 0 ≤ x) (hη : 0 < η) (J ell : ℕ) (F : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices c L → ∀ (probes : S → Finset (Fin J)) (r t : Finset S) (hrt : Disjoint r t) (Q : ℕ) (h ξ a a' : ℝ), (Q : ℝ) ≤ L^q → L^(-x) ≤ ξ → ∀ U W : ℝ, Real.exp (b*L) ≤ U → U ≤ Real.exp L → Real.exp (b*L) ≤ W → W ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), let P := fun g : S => candidatePBand (c*L) g.val let V := fun g : S => ∑ p ∈ P g, 1/(p : ℝ) let Z := typeIISmoothDyadicScale U W (U*L^(-K)) j let R := Nat.ceil (L^(13/25 : ℝ)) let D := max 1 (physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k)) let positions := physicalSignedHarmonicPositions (ell := ell) P probes r t Z k ∀ (pool : Finset ℕ), (∀ g, P g ⊆ pool) → ∀ (α β γ α' β' γ' : ℕ → ℂ), (∀ n, ‖α n‖ ≤ 1) → (∀ n, ‖β n‖ ≤ 1) → (∀ n, ‖γ n‖ ≤ 1) → (∀ n, ‖α' n‖ ≤ 1) → (∀ n, ‖β' n‖ ≤ 1) → (∀ n, ‖γ' n‖ ≤ 1) → (∀ n, ¬ (∀ p : ℕ, p ∈ n.primeFactors → Real.exp (Real.sqrt L) ≤ (p : ℝ)) → α n = 0) → (∀ n, ¬ (∀ p : ℕ, p ∈ n.primeFactors → Real.exp (Real.sqrt L) ≤ (p : ℝ)) → β n = 0) → (∀ i ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, ‖v‖ ≤ L^η → (physicalRootMoment V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun e _ => if e % 2 = 0 then -(-(a+a')-2*Real.pi*v) else -(a+a')-2*Real.pi*v) (fun e _ => if e % 2 = 0 then -k else k) (fun e i x y aux => if e % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i y x aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ i x y aux) (physicalDyadicStarts i) (2*R-1) D).re ≤ (L^(-(F+23)))^(2*R)) → ‖physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a a' Z k pool α β γ α' β' γ'‖ ≤ L^(-F) := by obtain ⟨E, _, hop⟩ := exists_candidate_dyadic_absolute_envelope hc hq hx J ell obtain ⟨v₀, A, hv₀, _, hinput⟩ := exists_candidate_shared_error_inputs hc J filter_upwards [hinput, hop, eventually_physical_residual_scalar_decay hη E F, eventually_actual_raw_dyadic_radius hc hb hK J, eventually_actual_raw_block_cost hc hK J, eventually_actual_harmonic_positions_bounds hc hb hK J, eventually_actual_harmonic_scale_inputs hb hK, eventually_raw_moment_at_least_two, eventually_ge_atTop (1 : ℝ), eventually_ge_atTop (2*(8 : ℝ)^8), eventually_ge_atTop (Real.log 3), eventually_ge_atTop (6/Real.log 2+1), eventually_ge_atTop (Real.exp 1*Real.sqrt 3), eventually_ge_atTop (Real.log 2)] with L hinput hop hdecay hradius hblock hpositions hscale hR hL hconst hlog hcard hcost hlog2 intro S hS probes r t hrt Q h ξ a a' hQ hξ U W hUlo hUhi hWlo hWhi k hk j hj P V Z R D positions pool hpool α β γ α' β' γ' hα hβ hγ hα' hβ' hγ' hαrough hβrough hmoment have hL0 : 0 < L := lt_of_lt_of_le zero_lt_one hL have hdis : Pairwise (fun g h => Disjoint (P g) (P h)) := by intro g g' hgg' exact pairwise_disjoint_dyadicPrimeBand (mul_nonneg hc.le hL0.le) (by norm_num : (0 : ℝ) ≤ 3/2) (by norm_num : (9/5 : ℝ) ≤ 2*(3/2)) (Subtype.val_injective.ne hgg') have hprime : ∀ g p, p ∈ P g → p.Prime := by intro g p hp exact ((hinput S hS).2 g).2 p hp |>.1 have hV : ∀ g, 0 < V g := fun g => hv₀.trans_le ((hinput S hS).2 g).1 have hpos : ∀ n ∈ positions, 0 < n ∧ (n : ℝ) ≤ Real.exp (6*L) := hpositions S hS ell probes r t U W hUlo hUhi hWlo hWhi k hk j hj have hD : 0 < D := lt_of_lt_of_le Nat.zero_lt_one (le_max_left _ _) have hZ : 0 < Z := (hscale U W hUlo hUhi hWlo hWhi k hk j hj).1 apply le_trans (physical_residual_polynomial_finite_moment hL hconst hlog hcard hcost P V probes r t hrt Q h ξ a a' Z k pool α β γ α' β' γ' hdis hprime hpool hV (fun _ => rfl) hα hβ hγ hα' hβ' hγ' hZ positions hpos (Subset.refl _) R D hR hD (le_max_right _ _) (hradius S hS ell probes r t U W hUlo hUhi hWlo hWhi k hk j hj) (fun _ => Real.exp ((14*Real.log 2)*Real.sqrt L)) (L^η) (fun _ => L^(-(F+23))) (fun _ => L^E) (fun _ _ => (Real.exp_pos _).le) (Eventually.of_forall (fun _ _ => (Real.rpow_pos_of_pos hL0 _).le)) (Eventually.of_forall (fun _ => (Real.rpow_pos_of_pos hL0 _).le)) ?_ (fun _ _ => hblock S hS ell probes r t k hk) hmoment ?_ (harmonic_log_fourier_integrable.norm.mul_const _).integrableOn (harmonic_log_fourier_integrable.norm.mul_const _).integrableOn) hdecay · intro i hi n hn have he : 2*Real.log 2*((6 : ℝ)+1) = 14*Real.log 2 := by ring simpa only [he] using invariant_triple_endpoint_dyadic_sqrt_bound hL0 hlog2 pool α β γ hα hβ hγ hαrough hβrough (physical_dyadic_index_upper hpos hi) hn · intro i hi apply Eventually.of_forall intro v exact hop S hS probes r t hrt Q h ξ hQ hξ pool hpool α β γ α' β' γ' hα hβ hγ hα' hβ' hγ' positions i (2*R*D) (hradius S hS ell probes r t U W hUlo hUhi hWlo hWhi k hk j hj i hi) (physical_dyadic_index_upper hpos hi) (-(a+a')) (-a) a' Z v k end Bounty -- Source module: CentralHarmonicMoment /- The exact central moment hypothesis for the original signed harmonic residual. -/ open Finset MeasureTheory open scoped Classical namespace Bounty def physicalCentralHarmonicMoment {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ a a' Z : ℝ) (k : ℤ) (L η F : ℝ) : Prop := let R := Nat.ceil (L^(13/25 : ℝ)) let D := max 1 (physicalOperatorStepBound P J ell (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (fun _ => k)) let positions := physicalSignedHarmonicPositions (ell := ell) P probes r t Z k ∀ i ∈ positions.image (fun n => n.natAbs.log2), ∀ᵐ v : ℝ, ‖v‖ ≤ L^η → (physicalRootMoment V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) (1/2) (fun e _ => if e % 2 = 0 then -(-(a+a')-2*Real.pi*v) else -(a+a')-2*Real.pi*v) (fun e _ => if e % 2 = 0 then -k else k) (fun e i x y aux => if e % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i y x aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ i x y aux) (physicalDyadicStarts i) (2*R-1) D).re ≤ (L^(-(F+23)))^(2*R) end Bounty -- Source module: PhysicalRawHarmonicIsolation /- The raw harmonic main is recovered from the signed physical residual, the signed replacement error, and the nonempty comparison mains. -/ open Finset open scoped Classical namespace Bounty section variable {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) theorem physical_raw_harmonic_isolation : (∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) aux : ℂ) * physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ (.inl ()) aux a b Z k pool α β γ α' β' γ') = physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ' - (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t i), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t i) aux : ℂ) * physicalPositiveHarmonicDifference P V probes r t hrt Q h ξ i aux a b Z k pool α β γ α' β' γ') - (∑ ab : RepeatedBigPrimePatternPair (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inr ab)), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t (.inr ab)) aux : ℂ) * physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ (.inr ab) aux a b Z k pool α β γ α' β' γ') := by rw [physical_harmonic_residual_decomposition] ring end theorem physical_raw_auxiliary_average {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (F : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) → ℂ) (aux0 : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ()))) : (∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) aux : ℂ) * F aux) = F aux0 := by have : Subsingleton (PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ()))) := by change Subsingleton (PhysicalAuxLabels P (fun _ => (∅ : Finset (Fin J)))) infer_instance let : Unique (PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ()))) := ⟨⟨aux0⟩, fun _ => Subsingleton.elim _ _⟩ rw [Fintype.sum_unique] change (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) aux0 : ℂ) * F aux0 = F aux0 have hm : physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) aux0 = 1 := by exact physical_aux_mass_empty V aux0 simp only [hm, Complex.ofReal_one, one_mul] end Bounty -- Source module: PhysicalRawOriginalCorrelation /- Exact raw harmonic recovery of the original candidate correlation. -/ /- Marked weights retain constant averages even when a marked-list fiber is empty. -/ open Finset open scoped Classical namespace Bounty theorem weighted_group_marked_average_const {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (n : ℤ) (c : ℂ) : (markedDivisorWeight univ P q V t n : ℂ) * groupMarkedAverage P t n (fun _ => c) = (markedDivisorWeight univ P q V t n : ℂ) * c := by rw [← weighted_group_marked_sum_eq_average] simp only [weightedGroupMarkedSum, sum_const, card_univ, nsmul_eq_mul, marked_divisor_weight_eq_fiber_mass, Nat.card_eq_fintype_card] push_cast ring theorem weighted_group_marked_pair_average_const {G : Type*} [Fintype G] (P : G → Finset ℕ) (q : ℝ) (V : G → ℝ) (t : G → ℕ) (n m : ℤ) (c : ℂ) : (markedDivisorWeight univ P q V t n : ℂ) * (markedDivisorWeight univ P q V t m : ℂ) * groupMarkedAverage P t n (fun _ => groupMarkedAverage P t m (fun _ => c)) = (markedDivisorWeight univ P q V t n : ℂ) * (markedDivisorWeight univ P q V t m : ℂ) * c := by calc _ = (markedDivisorWeight univ P q V t m : ℂ) * ((markedDivisorWeight univ P q V t n : ℂ) * groupMarkedAverage P t n (fun _ => groupMarkedAverage P t m (fun _ => c))) := by ring _ = (markedDivisorWeight univ P q V t m : ℂ) * ((markedDivisorWeight univ P q V t n : ℂ) * groupMarkedAverage P t m (fun _ => c)) := by rw [weighted_group_marked_average_const] _ = (markedDivisorWeight univ P q V t n : ℂ) * ((markedDivisorWeight univ P q V t m : ℂ) * groupMarkedAverage P t m (fun _ => c)) := by ring _ = _ := by rw [weighted_group_marked_average_const]; ring end Bounty /- The empty-cut main is the literal marked harmonic correlation with no residual kernel. -/ open Finset open scoped Classical namespace Bounty theorem physical_raw_group_marked_average {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ()))) (a b : ℝ) (w z : ℕ) : groupMarkedAverage P (fun _ => ell) (w : ℤ) (fun u => groupMarkedAverage P (fun _ => ell) (z : ℤ) (physicalFreePrimePairCoefficient P V probes r t hrt Q h ξ (.inl ()) aux a b w z u)) = groupMarkedAverage P (fun _ => ell) (w : ℤ) (fun _ => groupMarkedAverage P (fun _ => ell) (z : ℤ) (fun _ => physicalPhase a w * physicalPhase b z)) := by apply congrArg (groupMarkedAverage P (fun _ => ell) (w : ℤ)) funext u apply congrArg (groupMarkedAverage P (fun _ => ell) (z : ℤ)) funext v exact (by have hd : physicalFreeFactor (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) aux = 1 := physical_free_factor_empty aux change 1 * 1 * physicalPhase a w * physicalPhase b z * physicalPhase (-(a+b)) (physicalFreeFactor (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) aux) = _ rw [hd] have he : physicalPhase (-(a+b)) 1 = 1 := by simp [physicalPhase] rw [he] ring ) theorem physical_raw_harmonic_main_eq_marked_sum {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ()))) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) : physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ (.inl ()) aux a b Z k pool α β γ α' β' γ' = ∑ n ∈ harmonicPositiveSupport Z k 1, ((typeIIHarmonicDyadic ((n : ℝ)/Z) : ℂ)/(n : ℂ)) * star (invariantTripleEndpoint pool α β γ n.natAbs) * invariantTripleEndpoint pool α' β' γ' (n+k).natAbs * ((markedDivisorWeight univ P (1/2) V (fun _ => ell) (n.natAbs : ℤ) * markedDivisorWeight univ P (1/2) V (fun _ => ell) ((n+k).natAbs : ℤ) : ℝ) : ℂ) * (physicalPhase a n.natAbs * physicalPhase b (n+k).natAbs) := by have hd : physicalFreeFactor (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) aux = 1 := physical_free_factor_empty aux unfold physicalFreePositiveHarmonicMain dsimp only rw [hd] simp only [repeatedBigPrimePatternCut, card_empty, Nat.add_zero, Nat.cast_one, mul_one] apply sum_congr rfl intro n _hn rw [physical_raw_group_marked_average P V probes r t hrt Q h ξ aux a b n.natAbs (n+k).natAbs] simp only [Complex.ofReal_mul] simpa only [mul_assoc] using congrArg (fun z => (((typeIIHarmonicDyadic ((n : ℝ)/Z) : ℂ)/(n : ℂ)) * star (invariantTripleEndpoint pool α β γ n.natAbs) * invariantTripleEndpoint pool α' β' γ' (n+k).natAbs) * z) (weighted_group_marked_pair_average_const P (1/2) V (fun _ => ell) (n.natAbs : ℤ) ((n+k).natAbs : ℤ) (physicalPhase a n.natAbs * physicalPhase b (n+k).natAbs)) end Bounty /- Exact reindexing of the positive integer harmonic window onto its finite natural support. -/ open Finset namespace Bounty theorem positive_harmonic_cast_summand (Z : ℝ) (F : ℕ → ℂ) {n : ℤ} (hn : 0 ≤ n) : ((typeIIHarmonicDyadic ((n : ℝ)/Z) : ℂ)/(n : ℂ)) * F n.natAbs = ((typeIIHarmonicDyadic ((n.natAbs : ℝ)/Z) : ℂ)/(n.natAbs : ℂ)) * F n.natAbs := by have he : (n.natAbs : ℤ) = n := by simpa only [abs_of_nonneg hn] using Int.natCast_natAbs n have hr := congrArg (fun z : ℤ => (z : ℝ)) he have hc := congrArg (fun z : ℤ => (z : ℂ)) he simp only [Int.cast_natCast] at hr hc rw [hr, hc] theorem positive_harmonic_sum_eq_active {Z : ℝ} (hZ : 0 < Z) (k : ℤ) (B : ℕ) (F : ℕ → ℂ) (hbound : ∀ n ∈ harmonicPositiveSupport Z k 1, F n.natAbs ≠ 0 → n.natAbs ≤ B) : (∑ n ∈ harmonicPositiveSupport Z k 1, ((typeIIHarmonicDyadic ((n : ℝ)/Z) : ℂ)/(n : ℂ)) * F n.natAbs) = ∑ z ∈ typeIIActiveCrossZ Z k (Icc 0 B), ((typeIIHarmonicDyadic ((z : ℝ)/Z) : ℂ)/(z : ℂ)) * F z := by classical apply sum_bij_ne_zero (fun n _ _ => n.natAbs) · intro n hn hne have hs := mem_harmonic_positive_support hn have he : (n.natAbs : ℤ) = n := by simpa only [abs_of_nonneg hs.1.le] using Int.natCast_natAbs n have hr := congrArg (fun z : ℤ => (z : ℝ)) he simp only [Int.cast_natCast] at hr have hF : F n.natAbs ≠ 0 := by intro hz exact hne (by rw [hz, mul_zero]) apply mem_filter.mpr refine ⟨mem_Icc.mpr ⟨Nat.zero_le _, hbound n hn hF⟩, ?_⟩ refine ⟨?_, ?_, ?_⟩ · have hp : (0 : ℤ) < (n.natAbs : ℤ) := by simpa only [he] using hs.1 exact_mod_cast hp · simpa only [he, Nat.cast_one, mul_one] using hs.2.2.2 · simpa only [hr, Nat.cast_one, mul_one] using hs.2.2.1 · intro n hn _ m hm _ he have hn0 := (mem_harmonic_positive_support hn).1.le have hm0 := (mem_harmonic_positive_support hm).1.le have hcast := congrArg (fun z : ℕ => (z : ℤ)) he simpa only [Int.natCast_natAbs, abs_of_nonneg hn0, abs_of_nonneg hm0] using hcast · intro z hz hne obtain ⟨hzB, hzpos, hwpos, hzupper⟩ := mem_filter.mp hz have hpsi : typeIIHarmonicDyadic ((z : ℝ)/Z) ≠ 0 := by intro hzero exact hne (by simp only [hzero, Complex.ofReal_zero, zero_div, zero_mul]) have hs := typeII_harmonic_dyadic_support hpsi have hlo : Z/2 < (z : ℝ) := by have hh := (lt_div_iff₀ hZ).mp hs.1 linarith have hzH : (z : ℤ) ∈ harmonicPositiveSupport Z k 1 := by apply mem_filter.mpr refine ⟨mem_Icc.mpr ⟨by omega, ?_⟩, ?_, ?_⟩ · apply Int.le_floor.mpr simpa only [Int.cast_natCast, Nat.cast_one, mul_one] using hzupper · simpa only [Int.cast_natCast, Nat.cast_one, mul_one] using hlo · simpa only [Nat.cast_one, mul_one] using hwpos refine ⟨(z : ℤ), hzH, ?_, by simp⟩ simpa only [Int.cast_natCast, Int.natAbs_natCast] using hne · intro n hn _ exact positive_harmonic_cast_summand Z F (mem_harmonic_positive_support hn).1.le end Bounty /- Nonzero finite cross-pair coefficients retain both original product supports. -/ open Finset namespace Bounty theorem finite_cross_pair_nonzero_bounds (M H : Finset ℕ) (A : ℕ → ℂ) (W : ℕ → ℝ) (B : ℕ → ℂ) (ρ ξ₁ ξ₂ ξ₃ : ℝ) (z w : ℕ) (hne : typeIICrossPairCoefficient M H A W B ρ ξ₁ ξ₂ ξ₃ z w ≠ 0) : z ≤ M.sup id * H.sup id ∧ w ≤ M.sup id * H.sup id := by classical unfold typeIICrossPairCoefficient at hne obtain ⟨m, hm, hne⟩ := exists_ne_zero_of_sum_ne_zero hne obtain ⟨h', hh', hne⟩ := exists_ne_zero_of_sum_ne_zero hne obtain ⟨m', hm', hne⟩ := exists_ne_zero_of_sum_ne_zero hne obtain ⟨h, hh, hne⟩ := exists_ne_zero_of_sum_ne_zero hne have he : m'*h=z ∧ m*h'=w := by by_contra hz exact hne (if_neg hz) constructor · rw [← he.1] exact Nat.mul_le_mul (le_sup (f := id) hm') (le_sup (f := id) hh) · rw [← he.2] exact Nat.mul_le_mul (le_sup (f := id) hm) (le_sup (f := id) hh') end Bounty /- The raw physical main written on the original finite natural harmonic window. -/ open Finset open scoped Classical namespace Bounty theorem physical_phase_eq_typeIIPhase (a : ℝ) (n : ℕ) : physicalPhase a n = typeIIPhase a n := by unfold physicalPhase typeIIPhase congr 1 ring noncomputable def physicalRawNaturalCoefficient {G : Type*} [Fintype G] (P : G → Finset ℕ) (V : G → ℝ) (ell : ℕ) (a b : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (z : ℕ) : ℂ := typeIIPhase a z * typeIIPhase b ((z : ℤ)+k).toNat * star (invariantTripleEndpoint pool α β γ z) * invariantTripleEndpoint pool α' β' γ' ((z : ℤ)+k).toNat * (markedDivisorWeight univ P (1/2) V (fun _ => ell) (z : ℤ) : ℂ) * (markedDivisorWeight univ P (1/2) V (fun _ => ell) (((z : ℤ)+k).toNat : ℤ) : ℂ) theorem physical_raw_harmonic_main_eq_natural_sum {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ()))) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (hZ : 0 < Z) (B : ℕ) (hbound : ∀ n ∈ harmonicPositiveSupport Z k 1, physicalRawNaturalCoefficient P V ell a b k pool α β γ α' β' γ' n.natAbs ≠ 0 → n.natAbs ≤ B) : physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ (.inl ()) aux a b Z k pool α β γ α' β' γ' = ∑ z ∈ typeIIActiveCrossZ Z k (Icc 0 B), ((typeIIHarmonicDyadic ((z : ℝ)/Z) : ℂ)/(z : ℂ)) * physicalRawNaturalCoefficient P V ell a b k pool α β γ α' β' γ' z := by rw [physical_raw_harmonic_main_eq_marked_sum] trans ∑ n ∈ harmonicPositiveSupport Z k 1, ((typeIIHarmonicDyadic ((n : ℝ)/Z) : ℂ)/(n : ℂ)) * physicalRawNaturalCoefficient P V ell a b k pool α β γ α' β' γ' n.natAbs · apply sum_congr rfl intro n hn have hs := mem_harmonic_positive_support hn have hncast : (n.natAbs : ℤ) = n := by simpa only [abs_of_nonneg hs.1.le] using Int.natCast_natAbs n have htpos : 0 ≤ n+k := by simpa only [Nat.cast_one, mul_one] using hs.2.2.2.le have htnat : ((n.natAbs : ℤ)+k).toNat = (n+k).natAbs := by rw [hncast] have he : (((n+k).toNat : ℕ) : ℤ) = ((n+k).natAbs : ℤ) := by rw [Int.toNat_of_nonneg htpos, Int.natCast_natAbs, abs_of_nonneg htpos] exact_mod_cast he simp only [physicalRawNaturalCoefficient, htnat, physical_phase_eq_typeIIPhase, Complex.ofReal_mul] ring · exact positive_harmonic_sum_eq_active hZ k B _ hbound end Bounty /- The literal empty-cut, one-mark main equals the original saturated candidate harmonic test. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty theorem eventually_candidate_raw_harmonic_eq_b0 {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (X : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (σ : ℝ), (∀ p ∈ candidateRoughBand c L jStar, twist (candidateRoughSlot c L r jStar hr hj) p = typeIIPhase σ p) → ∀ (Z : ℝ) (k : ℤ) (M : Finset ℕ) (α : ℕ → ℂ) (ν : ℝ) (χ : DirichletCharacter ℂ (2*k.natAbs)) (ζ : EuclideanSpace ℝ (Fin 3)), 0 < Z → |(k : ℝ)| ≤ Z → 3*Z < X → (∀ m ∈ M, 0 < m) → (∀ m, m ∉ M → α m = 0) → (∀ m ∈ M, α m ≠ 0 → Disjoint m.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) → let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let V := fun g : candidatePIndices c L => ∑ p ∈ P g, 1/(p : ℝ) let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let cr := candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist let α₀ := fun m => α m * χ (m : ZMod (2*k.natAbs)) * typeIIPhase ((2*Real.pi*ν)-2*Real.pi*ζ 1) m let β₀ := fun p => if p ∈ candidateRoughBand c L jStar then typeIIPhase (-σ) p else 0 let γ₀ := fun s => conj (cr s) let α₁ := fun m => α m * χ (m : ZMod (2*k.natAbs)) * typeIIPhase (2*Real.pi*ζ 0+(2*Real.pi*ν)) m ∀ (J : ℕ) (probes : candidatePIndices c L → Finset (Fin J)) (rP tP : Finset (candidatePIndices c L)) (hrt : Disjoint rP tP) (Q : ℕ) (h ξ : ℝ) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := 1) probes rP tP (.inl ()))), physicalFreePositiveHarmonicMain P V probes rP tP hrt Q h ξ (.inl ()) aux ((2*Real.pi*ν)+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) Z k pool α₀ β₀ γ₀ α₁ β₀ γ₀ = candidateB0HarmonicCorrelation c L (1/2) r jStar (candidateSmallPSet c L X) take twist ν Z k M α χ ζ := by filter_upwards [eventually_candidate_harmonic_eq_saturated_endpoints hc, eventually_candidate_cross_pair_eq_saturated_endpoints hc] with L hsum hpoint intro r jStar hr hj X take hkeep twist σ hphase Z k M α ν χ ζ hZ hk hX hM hα hfree P V pool cr α₀ β₀ γ₀ α₁ J probes rP tP hrt Q h ξ aux let M₀ := M.filter (fun m => α m ≠ 0) let H := candidateRetainedAllocationSupport c L r jStar (candidateSmallPSet c L X) take have hM₀ : ∀ m ∈ M₀, 0 < m := fun m hm => hM m (mem_filter.mp hm).1 have hfree₀ : ∀ m ∈ M₀, Disjoint m.primeFactors pool := fun m hm => hfree m (mem_filter.mp hm).1 (mem_filter.mp hm).2 have hα₀ : ∀ m, m ∉ M₀ → α m = 0 := by intro m hm by_cases hmM : m ∈ M · by_contra hn exact hm (mem_filter.mpr ⟨hmM, hn⟩) · exact hα m hmM have hW (n : ℤ) := marked_divisor_weight_subtype (candidatePIndices c L) (candidatePBand (c*L)) (1/2) (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p : ℝ)) (fun _ => 1) n have hbound : ∀ n ∈ harmonicPositiveSupport Z k 1, physicalRawNaturalCoefficient P V 1 ((2*Real.pi*ν)+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) k pool α₀ β₀ γ₀ α₁ β₀ γ₀ n.natAbs ≠ 0 → n.natAbs ≤ M₀.sup id * H.sup id := by intro n hn hne have hs := mem_harmonic_positive_support hn have hncast : (n.natAbs : ℤ) = n := by simpa only [abs_of_nonneg hs.1.le] using Int.natCast_natAbs n have hnr := congrArg (fun z : ℤ => (z : ℝ)) hncast simp only [Int.cast_natCast] at hnr have hnp : 0 < n.natAbs := by have hh : (0 : ℤ) < (n.natAbs : ℤ) := by simpa only [hncast] using hs.1 exact_mod_cast hh have hwp : 0 < (n.natAbs : ℤ)+k := by simpa only [hncast, Nat.cast_one, mul_one] using hs.2.2.2 have hwt : (((n.natAbs : ℤ)+k).toNat : ℤ) = n+k := by rw [Int.toNat_of_nonneg hwp.le, hncast] have hwr := congrArg (fun z : ℤ => (z : ℝ)) hwt simp only [Int.cast_natCast, Int.cast_add] at hwr have hnupper : (n.natAbs : ℝ) ≤ 2*Z := by simpa only [hnr, Nat.cast_one, mul_one] using hs.2.2.1 have hwupper : (((n.natAbs : ℤ)+k).toNat : ℝ) ≤ 3*Z := by rw [hwr] have hkupper := (le_abs_self (k : ℝ)).trans hk linarith have he := hpoint (1/2) r jStar hr hj X take hkeep twist σ hphase M₀ α (2*k.natAbs) χ (2*Real.pi*ν) (2*Real.pi*ζ 0) (2*Real.pi*ζ 1) (2*Real.pi*ζ 2) n.natAbs ((n.natAbs : ℤ)+k).toNat hnp (Int.pos_iff_toNat_pos.mp hwp) (by linarith) (hwupper.trans_lt hX) hM₀ hfree₀ hα₀ have hcp : typeIICrossPairCoefficient M₀ H (fun m => α m * χ (m : ZMod (2*k.natAbs))) (fun n => markedDivisorWeight (candidatePIndices c L) (candidatePBand (c*L)) (1/2) (fun j => ∑ p ∈ candidatePBand (c*L) j, 1/(p : ℝ)) (fun _ => 1) (n : ℤ)) (fun s => candidateRemainingComplexCoefficient c L r jStar take twist (primePoolFreePart pool s)) (2*Real.pi*ν) (2*Real.pi*ζ 0) (2*Real.pi*ζ 1) (2*Real.pi*ζ 2) n.natAbs ((n.natAbs : ℤ)+k).toNat ≠ 0 := by intro hz apply hne have he' := he.symm.trans hz simpa only [physicalRawNaturalCoefficient, P, V, pool, cr, α₀, β₀, γ₀, α₁, hW, starRingEnd_apply] using he' exact (finite_cross_pair_nonzero_bounds M₀ H _ _ _ _ _ _ _ _ _ hcp).1 rw [physical_raw_harmonic_main_eq_natural_sum P V probes rP tP hrt Q h ξ aux _ _ Z k pool α₀ β₀ γ₀ α₁ β₀ γ₀ hZ (M₀.sup id * H.sup id) hbound] symm simpa only [physicalRawNaturalCoefficient, P, V, pool, cr, α₀, β₀, γ₀, α₁, M₀, H, hW, starRingEnd_apply, Complex.ofReal_div, Complex.ofReal_natCast] using hsum (1/2) r jStar hr hj X take hkeep twist σ hphase Z k M α ν χ ζ hk hX hM hα hfree end Bounty /- The complete raw auxiliary average equals the original saturated candidate harmonic test. -/ open Finset Filter open scoped Classical ComplexConjugate namespace Bounty theorem eventually_candidate_raw_average_eq_b0 {c : ℝ} (hc : 0 < c) : ∀ᶠ L : ℝ in atTop, ∀ (r jStar : ℕ) (hr : 0 < r) (hj : jStar ∈ candidateQIndices c L) (X : ℝ) (take : Fin ((candidateQIndices c L).card*r) → Bool) (hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr hj)) = false) (twist : (candidateQIndices c L) × Fin r → ℕ → ℂ) (σ : ℝ), (∀ p ∈ candidateRoughBand c L jStar, twist (candidateRoughSlot c L r jStar hr hj) p = typeIIPhase σ p) → ∀ (Z : ℝ) (k : ℤ) (M : Finset ℕ) (α : ℕ → ℂ) (ν : ℝ) (χ : DirichletCharacter ℂ (2*k.natAbs)) (ζ : EuclideanSpace ℝ (Fin 3)), 0 < Z → |(k : ℝ)| ≤ Z → 3*Z < X → (∀ m ∈ M, 0 < m) → (∀ m, m ∉ M → α m = 0) → (∀ m ∈ M, α m ≠ 0 → Disjoint m.primeFactors ((candidatePIndices c L).biUnion (candidatePBand (c*L)))) → let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let V := fun g : candidatePIndices c L => ∑ p ∈ P g, 1/(p : ℝ) let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let cr := candidateResidualPrimeCoefficient c L r jStar hr hj take hkeep twist let α₀ := fun m => α m * χ (m : ZMod (2*k.natAbs)) * typeIIPhase ((2*Real.pi*ν)-2*Real.pi*ζ 1) m let β₀ := fun p => if p ∈ candidateRoughBand c L jStar then typeIIPhase (-σ) p else 0 let γ₀ := fun s => conj (cr s) let α₁ := fun m => α m * χ (m : ZMod (2*k.natAbs)) * typeIIPhase (2*Real.pi*ζ 0+(2*Real.pi*ν)) m ∀ (J : ℕ) (probes : candidatePIndices c L → Finset (Fin J)) (rP tP : Finset (candidatePIndices c L)) (hrt : Disjoint rP tP) (Q : ℕ) (h ξ : ℝ), (∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := 1) probes rP tP (.inl ())), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := 1) probes rP tP (.inl ())) aux : ℂ) * physicalFreePositiveHarmonicMain P V probes rP tP hrt Q h ξ (.inl ()) aux ((2*Real.pi*ν)+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) Z k pool α₀ β₀ γ₀ α₁ β₀ γ₀) = candidateB0HarmonicCorrelation c L (1/2) r jStar (candidateSmallPSet c L X) take twist ν Z k M α χ ζ := by filter_upwards [eventually_candidate_raw_harmonic_eq_b0 hc] with L hL intro r jStar hr hj X take hkeep twist σ hphase Z k M α ν χ ζ hZ hk hX hM hα hfree P V pool cr α₀ β₀ γ₀ α₁ J probes rP tP hrt Q h ξ let aux0 : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := 1) probes rP tP (.inl ())) := fun _ j => False.elim (by simpa only [repeatedBigPrimePatternCut, notMem_empty] using j.property) rw [physical_raw_auxiliary_average P V probes rP tP _ aux0] exact hL r jStar hr hj X take hkeep twist σ hphase Z k M α ν χ ζ hZ hk hX hM hα hfree J probes rP tP hrt Q h ξ aux0 end Bounty /- Recovering the raw main from the residual and the combined error/comparison term. -/ open Finset open scoped Classical namespace Bounty theorem physical_raw_harmonic_two_term_bound {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (a b Z : ℝ) (k : ℤ) (pool : Finset ℕ) (α β γ α' β' γ' : ℕ → ℂ) (Rbound ECbound : ℝ) (hR : ‖physicalSignedPositiveHarmonicResidual (ell := ell) P V probes r t hrt Q h ξ a b Z k pool α β γ α' β' γ'‖ ≤ Rbound) (hEC : ‖(∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t i), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t i) aux : ℂ) * physicalPositiveHarmonicDifference P V probes r t hrt Q h ξ i aux a b Z k pool α β γ α' β' γ') + (∑ ab : RepeatedBigPrimePatternPair (ell := ell) probes r t, ∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inr ab)), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t (.inr ab)) aux : ℂ) * physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ (.inr ab) aux a b Z k pool α β γ α' β' γ')‖ ≤ ECbound) : ‖∑ aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())), (physicalAuxMass V (repeatedBigPrimePatternCut (ell := ell) probes r t (.inl ())) aux : ℂ) * physicalFreePositiveHarmonicMain P V probes r t hrt Q h ξ (.inl ()) aux a b Z k pool α β γ α' β' γ'‖ ≤ Rbound + ECbound := by rw [physical_raw_harmonic_isolation, sub_sub] exact (norm_sub_le _ _).trans (add_le_add hR hEC) end Bounty -- Source module: ActualPrimeB0Decay /- The literal original B0 harmonic correlation follows from its selected central moment. -/ open Finset Filter MeasureTheory open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree theorem exists_actual_prime_b0_decay_of_central_moment (hZeta : PrimitiveZeroFreeRightOf (23 / 24)) {c bWindow : ℝ} (hc : 0 < c) (hb : 0 < bWindow) : ∃ J₀ : ℕ, ∀ jStar : ℕ, J₀ < jStar → ∀ Kdet : ℝ, 0 ≤ Kdet → ∀ (D : ℝ) (J : ℕ) (B C R T F η : ℝ), 0 ≤ B → 0 < η → ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (rQ : ℕ) (hrQ : 0 < rQ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*rQ) → Bool) (_hkeep : take ((candidateAllocationOrder c L rQ).symm (candidateRoughSlot c L rQ jStar hrQ hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L rQ jStar) → ℝ) (lo hi : ℕ) (κM : ℝ), 0 ≤ κM → κM ≤ 1/50 → ∀ (ν : ℝ) (ζ : EuclideanSpace ℝ (Fin 3)), ‖ν‖ ≤ L^T → ‖ζ‖ ≤ L^F → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), k ≠ 0 → ∀ (χ : DirichletCharacter ℂ (2*k.natAbs)) j, j ∈ range (typeIISmoothDyadicCount L) → let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) ∀ (probes : candidatePIndices c L → Finset (Fin J)) (r t : Finset (candidatePIndices c L)) (hrt : Disjoint r t), (∀ g ∈ r ∪ t, g.val ∈ candidateBigPIndices c L) → ∀ Q : ℕ, (Q : ℝ) ≤ L^R → physicalCentralHarmonicMoment (ell := 1) P mass probes r t hrt Q (L^(-B)) (L^(-C)) (2*Real.pi*ν+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) Z k L η (D+1) → ‖candidateB0HarmonicCorrelation c L (1/2) rQ jStar (candidateSmallPSet c L (Real.exp (4*L))) take (candidateAllocationFourierTwist c L rQ jStar take ξ) ν Z k (Ioc lo hi) (fun m => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) m : ℂ)) χ ζ‖ ≤ L^(-D) := by obtain ⟨J₀,hbase⟩ := exists_actual_prime_comparison_harmonic_decay_uniform_window hZeta hc hb refine ⟨J₀,?_⟩ intro jStar hjStar Kdet hKdet D J B C R T F η hB hη obtain ⟨S₀,hS₀,hcmp⟩ := hbase jStar hjStar Kdet hKdet (D+1) J 1 B C R (Kdet+89) 0 0 (Kdet+89) (max T F+1) (max T F+1) (by decide) hB (by linarith) refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hcmp S hS, eventually_actual_residual_of_central_moment hc hb hKdet (le_max_right R 0) (le_max_right C 0) hη J 1 (D+1), eventually_candidate_raw_average_eq_b0 hc, eventually_actual_harmonic_scale_inputs hb hKdet, eventually_actual_prime_source_factor_properties hc S (hS₀.trans hS), eventually_actual_remaining_factor_properties hc, eventually_balanced_typeII_coefficient_properties S (hS₀.trans hS), eventually_ambient_prime_endpoint_group_free hc S (hS₀.trans hS), eventually_original_harmonic_modulus_bound hKdet, eventually_original_endpoint_phase_bounds T F, eventually_ge_atTop (2 : ℝ)] with L hcmp hres hraw hscale hfactor hremain hrough hfree hmod hphase hL intro rQ hrQ hj take hkeep ξ lo hi κM hκM hκmax ν ζ hν hζ U V hUlo hUhi hVlo hVhi k hk hk0 χ j hjd Z P mass probes r t hrt hbig Q hQ hmoment have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith let : NeZero (2*k.natAbs) := ⟨Nat.ne_of_gt (Nat.mul_pos (by decide) (Int.natAbs_pos.mpr hk0))⟩ let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let αM := fun m => (typeIIRestrict (Ioc lo hi) (ambientPrimeTypeIIAlpha κM L S) m : ℂ) let α₀ := fun m => αM m*χ (m : ZMod (2*k.natAbs))*typeIIPhase (2*Real.pi*ν-2*Real.pi*ζ 1) m let α₁ := fun m => αM m*χ (m : ZMod (2*k.natAbs))*typeIIPhase (2*Real.pi*ζ 0+2*Real.pi*ν) m let β := fun n => if n ∈ candidateRoughBand c L jStar then (1 : ℂ) else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L rQ jStar hrQ hj take hkeep (candidateAllocationFourierTwist c L rQ jStar take ξ) n) have hchar (n : ℕ) : (1 : DirichletCharacter ℂ 1) (n : ZMod 1) = 1 := by rw [Subsingleton.elim (n : ZMod 1) 1, map_one] have hph := hphase ν ζ hν hζ have hkfull : (k.natAbs : ℝ) ≤ L^(Kdet+89) := by have hm := hmod k hk push_cast at hm nlinarith [Nat.cast_nonneg (α := ℝ) k.natAbs] have hEC := hcmp rQ hrQ hj take hkeep ξ lo hi κM (2*Real.pi*ν-2*Real.pi*ζ 1) (2*Real.pi*ζ 0+2*Real.pi*ν) (2*k.natAbs) χ hκM hκmax (hmod k hk) (hph.2 1).2 (by simpa only [add_comm] using (hph.2 0).1) 0 1 1 (by simp) (by simp) probes r t hrt hbig Q hQ U V hUlo hUhi hVlo hVhi k hk hk0 hkfull j hjd (2*Real.pi*ν+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) (hph.2 2).1 simp only [typeIIPhase_zero,hchar,mul_one] at hEC have hα₀ := hfactor κM hκM hκmax (Ioc lo hi) (2*k.natAbs) χ (2*Real.pi*ν-2*Real.pi*ζ 1) have hα₁ := hfactor κM hκM hκmax (Ioc lo hi) (2*k.natAbs) χ (2*Real.pi*ζ 0+2*Real.pi*ν) have hβγ := hremain rQ jStar hrQ hj take hkeep ξ (fun _ => 1) (by intro n; simp) have hαrough : ∀ n, ¬ (∀ p : ℕ, p ∈ n.primeFactors → Real.exp (Real.sqrt L) ≤ (p : ℝ)) → α₀ n = 0 := by intro n hn have hz : ambientPrimeTypeIIAlpha κM L S n = 0 := by by_contra hne exact hn (fun p hp => (((hrough κM hκM hκmax n).2.2.2 hne).2 p hp).le) simp only [α₀,αM,typeIIRestrict,hz,ite_self,Complex.ofReal_zero,zero_mul] have hβrough : ∀ n, ¬ (∀ p : ℕ, p ∈ n.primeFactors → Real.exp (Real.sqrt L) ≤ (p : ℝ)) → β n = 0 := by intro n hn have hout : n ∉ candidateRoughBand c L jStar := by intro hm exact hn (fun p hp => ((mem_filter.mp hm).2 p hp).le) exact if_neg hout have hQ' : (Q : ℝ) ≤ L^(max R 0) := hQ.trans (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left _ _)) have hξ : L^(-(max C 0)) ≤ L^(-C) := Real.rpow_le_rpow_of_exponent_le hL1 (neg_le_neg (le_max_left _ _)) have hR := hres (candidatePIndices c L) (subset_refl _) probes r t hrt Q (L^(-B)) (L^(-C)) (2*Real.pi*ν+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) hQ' hξ U V hUlo hUhi hVlo hVhi k hk j hjd pool (fun g p hp => mem_biUnion.mpr ⟨g.val,g.property,hp⟩) α₀ β γ α₁ β γ (by simpa only [α₀,αM,mul_assoc] using hα₀.1) hβγ.1 hβγ.2.2 (by simpa only [α₁,αM,mul_assoc] using hα₁.1) hβγ.1 hβγ.2.2 hαrough hβrough hmoment have hsc := hscale U V hUlo hUhi hVlo hVhi k hk j hjd have htwist : ∀ p ∈ candidateRoughBand c L jStar, candidateAllocationFourierTwist c L rQ jStar take ξ (candidateRoughSlot c L rQ jStar hrQ hj) p = typeIIPhase 0 p := by intro p _ rw [candidate_rough_slot_allocation_twist_eq_one c L rQ jStar hrQ hj take hkeep ξ p,typeIIPhase_zero] have heq := hraw rQ jStar hrQ hj (Real.exp (4*L)) take hkeep (candidateAllocationFourierTwist c L rQ jStar take ξ) 0 htwist Z k (Ioc lo hi) αM ν χ ζ hsc.1 hsc.2.2.1 hsc.2.2.2 (fun m hm => (Nat.zero_le lo).trans_lt (mem_Ioc.mp hm).1) (by intro m hm; simp only [αM,typeIIRestrict,if_neg hm,Complex.ofReal_zero]) (by intro m _ hm exact (hfree κM hκM hκmax m ((typeIIRestrict_complex_ne_zero_iff _ _ _).mp hm).2).2) J probes r t hrt Q (L^(-B)) (L^(-C)) simp only [neg_zero,typeIIPhase_zero] at heq rw [← heq] have hbound := physical_raw_harmonic_two_term_bound P mass probes r t hrt Q (L^(-B)) (L^(-C)) (2*Real.pi*ν+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) Z k pool α₀ β γ α₁ β γ (L^(-(D+1))) (L^(-(D+1))) hR (by simpa only [α₀,α₁,αM,β,γ,pool,mul_assoc] using hEC) apply hbound.trans calc L^(-(D+1))+L^(-(D+1)) = 2*L^(-(D+1)) := by ring _ ≤ L*L^(-(D+1)) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = L^(-D) := by nth_rw 1 [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 ring end Bounty.WeakZeroFree -- Source module: SelectedCentralMoments /- A selected-data central moment premise with the threshold before all later precision choices. -/ open Finset Filter open scoped Classical namespace Bounty def CandidateSelectedCentralMoments (c bWindow : ℝ) (rQ : ℕ) : Prop := ∃ J₀ : ℕ, ∀ jStar : ℕ, J₀ < jStar → ∀ Kdet : ℝ, 0 ≤ Kdet → ∀ D T F : ℝ, ∃ (J : ℕ) (B C R η : ℝ), 0 ≤ B ∧ 0 < η ∧ ∀ᶠ L : ℝ in atTop, ∀ (hrQ : 0 < rQ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*rQ) → Bool) (_hkeep : take ((candidateAllocationOrder c L rQ).symm (candidateRoughSlot c L rQ jStar hrQ hj)) = false) (_ξ : ActiveAllocationIndex (candidateAllocationActive c L rQ jStar) → ℝ) (ν : ℝ) (ζ : EuclideanSpace ℝ (Fin 3)), ‖ν‖ ≤ L^T → ‖ζ‖ ≤ L^F → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), k ≠ 0 → ∀ j ∈ range (typeIISmoothDyadicCount L), let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) ∃ (probes : candidatePIndices c L → Finset (Fin J)) (r t : Finset (candidatePIndices c L)) (hrt : Disjoint r t), (∀ g ∈ r ∪ t, g.val ∈ candidateBigPIndices c L) ∧ ∃ Q : ℕ, (Q : ℝ) ≤ L^R ∧ physicalCentralHarmonicMoment (ell := 1) P mass probes r t hrt Q (L^(-B)) (L^(-C)) (2*Real.pi*ν+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) Z k L η (D+1) end Bounty -- Source module: ActualPrimeBlockCentral /- Prime blocks from a selected central moment, with the fixed index chosen first. -/ open Finset Filter open scoped Classical namespace Bounty.WeakZeroFree theorem exists_actual_prime_block_of_selected_central_moments (hZeta : PrimitiveZeroFreeRightOf (23 / 24)) {c : ℝ} (hc : 0 < c) {r : ℕ} (hr : 6 ≤ r) (hmoment : CandidateSelectedCentralMoments c (1/5) r) : ∃ J₀ : ℕ, ∀ jStar : ℕ, J₀ < jStar → ∀ D : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ κ : ℝ, 0 ≤ κ → κ ≤ 1/50 → ∀ proxy : Bool, ∀ i j : ℕ, let H := ⌊33*Real.exp L⌋₊ let M := dyadicNatBucket (Icc 1 H) i let N := dyadicNatBucket (Icc 1 H) j let α := typeIIRestrict M (ambientPrimeTypeIIAlpha κ L S) let β := typeIIRestrict N (if proxy then ambientProxyTypeIIBeta κ L S else ambientPrimeTypeIIBeta κ L) let B := shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L (1/2) r jStar) α β B ≠ 0 → |B| ≤ Real.exp L*L^(-D) := by obtain ⟨Jblock,hblock⟩ := exists_actual_prime_block_harmonic_reduction hc hr obtain ⟨Jb0,hb0⟩ := exists_actual_prime_b0_decay_of_central_moment hZeta hc (by norm_num : (0 : ℝ) < 1/5) obtain ⟨Jmoment,hmoment⟩ := hmoment refine ⟨max Jblock (max Jb0 Jmoment),?_⟩ intro jStar hjStar D have hjblock := (le_max_left Jblock (max Jb0 Jmoment)).trans_lt hjStar have hjb0 := ((le_max_left Jb0 Jmoment).trans (le_max_right Jblock (max Jb0 Jmoment))).trans_lt hjStar have hjmoment := ((le_max_right Jb0 Jmoment).trans (le_max_right Jblock (max Jb0 Jmoment))).trans_lt hjStar obtain ⟨T,_hT,K,hK,hblock⟩ := hblock jStar hjblock D obtain ⟨Q,F,_hQ,_hF,hblock⟩ := hblock K le_rfl obtain ⟨J,B,C,R,η,hB,hη,hmoment⟩ := hmoment jStar hjmoment K hK.le Q T F obtain ⟨S₀,hS₀,hb0⟩ := hb0 jStar hjb0 K hK.le Q J B C R T F η hB hη refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hblock S (hS₀.trans hS),hb0 S hS,hmoment, eventually_ambient_prime_active_dyadic_bounds,eventually_fixed_candidateQ_prefix hc jStar] with L hblock hb0 hmoment hsizes hprefix intro κ hκ hκmax proxy i j dsimp only intro hne apply hblock κ hκ hκmax proxy i j hne intro ν hν take htake ξ _hξ k hk hk0 jd hjd χ ζ hζ have hr0 : 0 < r := by omega have hj : jStar ∈ candidateQIndices c L := hprefix (mem_Icc.mpr ⟨Nat.zero_le _,le_rfl⟩) have hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr0 hj)) = false := by apply htake simp only [candidateAllocationActive,Equiv.apply_symm_apply,candidateRoughSlot, and_self,not_true_eq_false,decide_false] have hsize := hsizes κ S hκ hκmax proxy (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L (1/2) r jStar) ⌊33*Real.exp L⌋₊ i j hne obtain ⟨probes,rP,tP,hrt,hbig,q,hq,hmom⟩ := hmoment hr0 hj take hkeep ξ ν ζ hν hζ (originalDyadicBase i) (originalDyadicBase j) hsize.1 hsize.2.1 hsize.2.2.1 hsize.2.2.2 k hk hk0 jd hjd have htest := hb0 r hr0 hj take hkeep ξ ((2 : ℕ)^i-1) (min ⌊33*Real.exp L⌋₊ ((2 : ℕ)^(i+1)-1)) κ hκ hκmax ν ζ hν hζ (originalDyadicBase i) (originalDyadicBase j) hsize.1 hsize.2.1 hsize.2.2.1 hsize.2.2.2 k hk hk0 χ jd hjd probes rP tP hrt hbig q hq hmom simpa only [dyadicNatBucket_Icc_eq_Ioc] using htest end Bounty.WeakZeroFree -- Source module: ActualRoughB0Decay /- The literal original B0 harmonic correlation follows from its selected central moment. -/ open Finset Filter MeasureTheory open scoped Classical ComplexConjugate namespace Bounty.WeakZeroFree theorem exists_actual_rough_b0_decay_of_central_moment (hZeta : PrimitiveZeroFreeRightOf (23 / 24)) {c bWindow γrough vMax ρ : ℝ} (hc : 0 < c) (hb : 0 < bWindow) (hγrough : 0 < γrough) (hvMax : vMax < 1) (hρ : 0 < ρ) : ∃ J₀ : ℕ, ∀ jStar : ℕ, J₀ < jStar → ∀ Kdet : ℝ, 0 ≤ Kdet → ∀ (D : ℝ) (J : ℕ) (B C R T F η : ℝ), 0 ≤ B → 0 < η → ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ (rQ : ℕ) (hrQ : 0 < rQ) (hj : jStar ∈ candidateQIndices c L) (take : Fin ((candidateQIndices c L).card*rQ) → Bool) (_hkeep : take ((candidateAllocationOrder c L rQ).symm (candidateRoughSlot c L rQ jStar hrQ hj)) = false) (ξ : ActiveAllocationIndex (candidateAllocationActive c L rQ jStar) → ℝ) (lo hi : ℕ) (aM vM : ℝ), vM ≤ vMax → ∀ (ν : ℝ) (ζ : EuclideanSpace ℝ (Fin 3)), ‖ν‖ ≤ L^T → ‖ζ‖ ≤ L^F → ∀ U V : ℝ, Real.exp (bWindow*L) ≤ U → U ≤ Real.exp L → Real.exp (bWindow*L) ≤ V → V ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kdet : ℤ)) (typeIIAdmissibleDeterminantBound L Kdet : ℤ), k ≠ 0 → ∀ (χ : DirichletCharacter ℂ (2*k.natAbs)) j, j ∈ range (typeIISmoothDyadicCount L) → let Z := typeIISmoothDyadicScale U V (U*L^(-Kdet)) j let P := fun g : candidatePIndices c L => candidatePBand (c*L) g.val let mass := fun g => ∑ p ∈ P g, 1/(p : ℝ) ∀ (probes : candidatePIndices c L → Finset (Fin J)) (r t : Finset (candidatePIndices c L)) (hrt : Disjoint r t), (∀ g ∈ r ∪ t, g.val ∈ candidateBigPIndices c L) → ∀ Q : ℕ, (Q : ℝ) ≤ L^R → physicalCentralHarmonicMoment (ell := 1) P mass probes r t hrt Q (L^(-B)) (L^(-C)) (2*Real.pi*ν+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) Z k L η (D+1) → ‖candidateB0HarmonicCorrelation c L (1/2) rQ jStar (candidateSmallPSet c L (Real.exp (4*L))) take (candidateAllocationFourierTwist c L rQ jStar take ξ) ν Z k (Ioc lo hi) (fun m => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) m : ℂ)) χ ζ‖ ≤ L^(-D) := by obtain ⟨J₀,hbase⟩ := exists_actual_rough_comparison_harmonic_decay_uniform_window hZeta hc hb hγrough hvMax hρ refine ⟨J₀,?_⟩ intro jStar hjStar Kdet hKdet D J B C R T F η hB hη obtain ⟨S₀,hS₀,hcmp⟩ := hbase jStar hjStar Kdet hKdet (D+1) J 1 B C R (Kdet+89) 0 0 (Kdet+89) (max T F+1) (max T F+1) (by decide) hB (by linarith) refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hcmp S hS, eventually_actual_residual_of_central_moment hc hb hKdet (le_max_right R 0) (le_max_right C 0) hη J 1 (D+1), eventually_candidate_raw_average_eq_b0 hc, eventually_actual_harmonic_scale_inputs hb hKdet, eventually_actual_rough_source_factor_properties hc hγrough, eventually_actual_remaining_factor_properties hc, eventually_rough_typeII_restriction_properties hγrough, eventually_ambient_rough_endpoint_group_free hc hγrough, eventually_original_harmonic_modulus_bound hKdet, eventually_original_endpoint_phase_bounds T F, eventually_ge_atTop (2 : ℝ)] with L hcmp hres hraw hscale hfactor hremain hrough hfree hmod hphase hL intro rQ hrQ hj take hkeep ξ lo hi aM vM hvM ν ζ hν hζ U V hUlo hUhi hVlo hVhi k hk hk0 χ j hjd Z P mass probes r t hrt hbig Q hQ hmoment have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith let : NeZero (2*k.natAbs) := ⟨Nat.ne_of_gt (Nat.mul_pos (by decide) (Int.natAbs_pos.mpr hk0))⟩ let pool := (candidatePIndices c L).biUnion (candidatePBand (c*L)) let αM := fun m => (typeIIRestrict (Ioc lo hi) (ambientRoughIntervalTypeIIAlpha γrough L S aM vM) m : ℂ) let α₀ := fun m => αM m*χ (m : ZMod (2*k.natAbs))*typeIIPhase (2*Real.pi*ν-2*Real.pi*ζ 1) m let α₁ := fun m => αM m*χ (m : ZMod (2*k.natAbs))*typeIIPhase (2*Real.pi*ζ 0+2*Real.pi*ν) m let β := fun n => if n ∈ candidateRoughBand c L jStar then (1 : ℂ) else 0 let γ := fun n => conj (candidateResidualPrimeCoefficient c L rQ jStar hrQ hj take hkeep (candidateAllocationFourierTwist c L rQ jStar take ξ) n) have hchar (n : ℕ) : (1 : DirichletCharacter ℂ 1) (n : ZMod 1) = 1 := by rw [Subsingleton.elim (n : ZMod 1) 1, map_one] have hph := hphase ν ζ hν hζ have hkfull : (k.natAbs : ℝ) ≤ L^(Kdet+89) := by have hm := hmod k hk push_cast at hm nlinarith [Nat.cast_nonneg (α := ℝ) k.natAbs] have hEC := hcmp rQ hrQ hj take hkeep ξ lo hi aM vM (2*Real.pi*ν-2*Real.pi*ζ 1) (2*Real.pi*ζ 0+2*Real.pi*ν) (2*k.natAbs) χ hvM (hmod k hk) (hph.2 1).2 (by simpa only [add_comm] using (hph.2 0).1) 0 1 1 (by simp) (by simp) probes r t hrt hbig Q hQ U V hUlo hUhi hVlo hVhi k hk hk0 hkfull j hjd (2*Real.pi*ν+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) (hph.2 2).1 simp only [typeIIPhase_zero,hchar,mul_one] at hEC have hα₀ := hfactor S aM vM (Ioc lo hi) (2*k.natAbs) χ (2*Real.pi*ν-2*Real.pi*ζ 1) have hα₁ := hfactor S aM vM (Ioc lo hi) (2*k.natAbs) χ (2*Real.pi*ζ 0+2*Real.pi*ν) have hβγ := hremain rQ jStar hrQ hj take hkeep ξ (fun _ => 1) (by intro n; simp) have hαrough : ∀ n, ¬ (∀ p : ℕ, p ∈ n.primeFactors → Real.exp (Real.sqrt L) ≤ (p : ℝ)) → α₀ n = 0 := by intro n hn have hz : ambientRoughIntervalTypeIIAlpha γrough L S aM vM n = 0 := by by_contra hne exact hn (fun p hp => (((hrough S (ambientRoughCofactorRange L aM vM) n).2 hne).2 p hp).le) simp only [α₀,αM,typeIIRestrict,hz,ite_self,Complex.ofReal_zero,zero_mul] have hβrough : ∀ n, ¬ (∀ p : ℕ, p ∈ n.primeFactors → Real.exp (Real.sqrt L) ≤ (p : ℝ)) → β n = 0 := by intro n hn have hout : n ∉ candidateRoughBand c L jStar := by intro hm exact hn (fun p hp => ((mem_filter.mp hm).2 p hp).le) exact if_neg hout have hQ' : (Q : ℝ) ≤ L^(max R 0) := hQ.trans (Real.rpow_le_rpow_of_exponent_le hL1 (le_max_left _ _)) have hξ : L^(-(max C 0)) ≤ L^(-C) := Real.rpow_le_rpow_of_exponent_le hL1 (neg_le_neg (le_max_left _ _)) have hR := hres (candidatePIndices c L) (subset_refl _) probes r t hrt Q (L^(-B)) (L^(-C)) (2*Real.pi*ν+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) hQ' hξ U V hUlo hUhi hVlo hVhi k hk j hjd pool (fun g p hp => mem_biUnion.mpr ⟨g.val,g.property,hp⟩) α₀ β γ α₁ β γ (by simpa only [α₀,αM,mul_assoc] using hα₀.1) hβγ.1 hβγ.2.2 (by simpa only [α₁,αM,mul_assoc] using hα₁.1) hβγ.1 hβγ.2.2 hαrough hβrough hmoment have hsc := hscale U V hUlo hUhi hVlo hVhi k hk j hjd have htwist : ∀ p ∈ candidateRoughBand c L jStar, candidateAllocationFourierTwist c L rQ jStar take ξ (candidateRoughSlot c L rQ jStar hrQ hj) p = typeIIPhase 0 p := by intro p _ rw [candidate_rough_slot_allocation_twist_eq_one c L rQ jStar hrQ hj take hkeep ξ p,typeIIPhase_zero] have heq := hraw rQ jStar hrQ hj (Real.exp (4*L)) take hkeep (candidateAllocationFourierTwist c L rQ jStar take ξ) 0 htwist Z k (Ioc lo hi) αM ν χ ζ hsc.1 hsc.2.2.1 hsc.2.2.2 (fun m hm => (Nat.zero_le lo).trans_lt (mem_Ioc.mp hm).1) (by intro m hm; simp only [αM,typeIIRestrict,if_neg hm,Complex.ofReal_zero]) (by intro m _ hm exact (hfree S aM vM m ((typeIIRestrict_complex_ne_zero_iff _ _ _).mp hm).2).2) J probes r t hrt Q (L^(-B)) (L^(-C)) simp only [neg_zero,typeIIPhase_zero] at heq rw [← heq] have hbound := physical_raw_harmonic_two_term_bound P mass probes r t hrt Q (L^(-B)) (L^(-C)) (2*Real.pi*ν+2*Real.pi*ζ 2) (-(2*Real.pi*ν)) Z k pool α₀ β γ α₁ β γ (L^(-(D+1))) (L^(-(D+1))) hR (by simpa only [α₀,α₁,αM,β,γ,pool,mul_assoc] using hEC) apply hbound.trans calc L^(-(D+1))+L^(-(D+1)) = 2*L^(-(D+1)) := by ring _ ≤ L*L^(-(D+1)) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = L^(-D) := by nth_rw 1 [← Real.rpow_one L] rw [← Real.rpow_add hL0] congr 1 ring end Bounty.WeakZeroFree -- Source module: ActualRoughBlockCentral /- Rough blocks from a selected central moment, with the fixed index chosen first. -/ open Finset Filter open scoped Classical namespace Bounty.WeakZeroFree theorem exists_actual_rough_block_of_selected_central_moments (hZeta : PrimitiveZeroFreeRightOf (23 / 24)) {c γ a v : ℝ} (hc : 0 < c) (hγ : 0 < γ) (ha : 0 < a) (hv : v < 1) {r : ℕ} (hr : 6 ≤ r) (hmoment : CandidateSelectedCentralMoments c (min ((1-v)/2) (a/2)) r) : ∃ J₀ : ℕ, ∀ jStar : ℕ, J₀ < jStar → ∀ D : ℝ, ∃ S₀ : ℝ, 0 ≤ S₀ ∧ ∀ S : ℝ, S₀ ≤ S → ∀ᶠ L : ℝ in atTop, ∀ i j : ℕ, let H := ⌊33*Real.exp L⌋₊ let M := dyadicNatBucket (Icc 1 H) i let N := dyadicNatBucket (Icc 1 H) j let α := typeIIRestrict M (ambientRoughIntervalTypeIIAlpha γ L S a v) let β := typeIIRestrict N (ambientRoughTypeIIBeta (Real.exp (a*L)) (Real.exp (v*L))) let B := shiftedTypeIIBilinear (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L (1/2) r jStar) α β B ≠ 0 → |B| ≤ Real.exp L*L^(-D) := by obtain ⟨Jblock,hblock⟩ := exists_actual_rough_block_harmonic_reduction hc hγ ha hv hr obtain ⟨Jb0,hb0⟩ := exists_actual_rough_b0_decay_of_central_moment hZeta hc (lt_min (by linarith : (0 : ℝ) < (1-v)/2) (by linarith : (0 : ℝ) < a/2)) hγ hv (by norm_num : (0 : ℝ) < 1) obtain ⟨Jmoment,hmoment⟩ := hmoment refine ⟨max Jblock (max Jb0 Jmoment),?_⟩ intro jStar hjStar D have hjblock := (le_max_left Jblock (max Jb0 Jmoment)).trans_lt hjStar have hjb0 := ((le_max_left Jb0 Jmoment).trans (le_max_right Jblock (max Jb0 Jmoment))).trans_lt hjStar have hjmoment := ((le_max_right Jb0 Jmoment).trans (le_max_right Jblock (max Jb0 Jmoment))).trans_lt hjStar obtain ⟨T,_hT,K,hK,hblock⟩ := hblock jStar hjblock D obtain ⟨Q,F,_hQ,_hF,hblock⟩ := hblock K le_rfl obtain ⟨J,B,C,R,η,hB,hη,hmoment⟩ := hmoment jStar hjmoment K hK.le Q T F obtain ⟨S₀,hS₀,hb0⟩ := hb0 jStar hjb0 K hK.le Q J B C R T F η hB hη refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hblock S (hS₀.trans hS),hb0 S hS,hmoment, eventually_ambient_rough_active_dyadic_bounds ha hv,eventually_fixed_candidateQ_prefix hc jStar] with L hblock hb0 hmoment hsizes hprefix intro i j dsimp only intro hne apply hblock i j hne intro ν hν take htake ξ _hξ k hk hk0 jd hjd χ ζ hζ have hr0 : 0 < r := by omega have hj : jStar ∈ candidateQIndices c L := hprefix (mem_Icc.mpr ⟨Nat.zero_le _,le_rfl⟩) have hkeep : take ((candidateAllocationOrder c L r).symm (candidateRoughSlot c L r jStar hr0 hj)) = false := by apply htake simp only [candidateAllocationActive,Equiv.apply_symm_apply,candidateRoughSlot, and_self,not_true_eq_false,decide_false] have hsize := hsizes γ S a v le_rfl le_rfl (arithmeticProductWindow 1 (Real.exp L)) (candidateCoefficient c L (1/2) r jStar) ⌊33*Real.exp L⌋₊ i j hne obtain ⟨probes,rP,tP,hrt,hbig,q,hq,hmom⟩ := hmoment hr0 hj take hkeep ξ ν ζ hν hζ (originalDyadicBase i) (originalDyadicBase j) hsize.1 hsize.2.1 hsize.2.2.1 hsize.2.2.2 k hk hk0 jd hjd have htest := hb0 r hr0 hj take hkeep ξ ((2 : ℕ)^i-1) (min ⌊33*Real.exp L⌋₊ ((2 : ℕ)^(i+1)-1)) a v le_rfl ν ζ hν hζ (originalDyadicBase i) (originalDyadicBase j) hsize.1 hsize.2.1 hsize.2.2.1 hsize.2.2.2 k hk hk0 χ jd hjd probes rP tP hrt hbig q hq hmom simpa only [dyadicNatBucket_Icc_eq_Ioc] using htest end Bounty.WeakZeroFree -- Source module: HalfActiveCentralMoments /- The half-active block contract follows from selected central moments. -/ open Finset Filter open scoped Classical namespace Bounty.WeakZeroFree theorem candidate_half_active_blocks_of_selected_central_moments (hZeta : PrimitiveZeroFreeRightOf (23 / 24)) (hmoment : ∀ (c : ℝ) (r : ℕ), 0 < c → 6 ≤ r → (11/5 : ℝ)*(r : ℝ)*c = 1 → ∀ bWindow : ℝ, 0 < bWindow → CandidateSelectedCentralMoments c bWindow r) : CandidateHalfActiveBlockBounds := by intro c r hc hr hcenter D _hD κ b N hκ hκmax hb hbq hN constructor · intro z let a := reciprocalGrid b (1/2-κ) N (z : ℕ) let v := reciprocalGrid b (1/2-κ) N ((z : ℕ)+1) have ha : 0 < a := hb.trans_le (reciprocal_grid_mem hbq.le hN z.isLt.le).1 have hv : v < 1 := lt_of_le_of_lt (reciprocal_grid_mem hbq.le hN (Nat.succ_le_of_lt z.isLt)).2 (by linarith) have hwindow : 0 < min ((1-v)/2) (a/2) := lt_min (by linarith) (by linarith) obtain ⟨J,hblock⟩ := exists_actual_rough_block_of_selected_central_moments hZeta hc ha ha hv hr (hmoment c r hc hr hcenter _ hwindow) refine ⟨J,?_⟩ intro jStar hj obtain ⟨S₀,hS₀,hblock⟩ := hblock jStar hj D refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hblock S hS] with L hblock intro i _hi j _hj exact hblock i j · obtain ⟨J,hblock⟩ := exists_actual_prime_block_of_selected_central_moments hZeta hc hr (hmoment c r hc hr hcenter (1/5) (by norm_num)) refine ⟨J,?_⟩ intro jStar hj obtain ⟨S₀,hS₀,hblock⟩ := hblock jStar hj D refine ⟨S₀,hS₀,?_⟩ intro S hS filter_upwards [hblock S hS] with L hblock intro proxy i _hi j _hj exact hblock κ hκ.le hκmax proxy i j end Bounty.WeakZeroFree namespace Bounty.WeakZeroFree theorem actual_candidate_half_active_blocks_of_selected_central_moments (hmoment : ∀ (c : ℝ) (r : ℕ), 0 < c → 6 ≤ r → (11/5 : ℝ)*(r : ℝ)*c = 1 → ∀ bWindow : ℝ, 0 < bWindow → CandidateSelectedCentralMoments c bWindow r) : CandidateHalfActiveBlockBounds := by exact candidate_half_active_blocks_of_selected_central_moments actual_zero_free hmoment end Bounty.WeakZeroFree end section -- Source module: ConditionalSelectedTarget /- The exact Erdős 1057 target follows once the selected central moments are proved. -/ namespace Bounty.WeakZeroFree theorem target_of_selected_central_moments (hmoment : ∀ (c : ℝ) (r : ℕ), 0 < c → 6 ≤ r → (11/5 : ℝ) * (r : ℝ) * c = 1 → ∀ bWindow : ℝ, 0 < bWindow → CandidateSelectedCentralMoments c bWindow r) : fcTypeOfName% "Erdos1057.erdos_1057" := by exact target_of_actual_zero_free_and_candidate_half_active_blocks (actual_candidate_half_active_blocks_of_selected_central_moments hmoment) end Bounty.WeakZeroFree end section -- Source module: WeakSelectedResidueTransfer /- The exact remaining original residue-model estimate implies the challenge target. -/ open scoped Topology BigOperators Classical -- Source module: CandidateRootReplacement /- The actual candidate prime pools meet every prime and mass hypothesis of finite root replacement at the chosen moment length. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_root_replacement {scale γ E B : ℝ} (hscale : 0 < scale) (hγ : 0 < γ) (hE : 0 ≤ E) (hB : 0 ≤ B) (J ell : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices scale L → let P := fun g : S => candidatePBand (scale * L) g.val let V := fun g : S => ∑ p ∈ P g, 1 / (p : ℝ) ∀ [∀ p : PhysicalPrime P, NeZero p.2.val] (I : Type) (patterns : Finset I) (cuts : I → S → Finset (Fin J)) (bounds : I → ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (cuts i) → ℂ) (D N : ℕ) (z : ℤ), (∀ i ∈ patterns, 0 ≤ bounds i) → (∑ i ∈ patterns, bounds i) ≤ L ^ B → (∀ j i, i ∈ patterns → ∀ x y aux, ‖K j i x y aux‖ ≤ bounds i) → (∀ j < 2 * Nat.ceil (L ^ (13/25 : ℝ)), physicalOperatorStepBound P J ell patterns cuts (k j) ≤ D) → 0 < N → γ * L ≤ Real.log (N : ℝ) → ‖physicalRootMoment V patterns cuts (1/2) ζ k K (Ico z (z + N)) (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1) D - physicalRootResidueModel V patterns cuts (1/2) ζ k K (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1)‖ ≤ Real.exp (-E * (2 * Nat.ceil (L ^ (13/25 : ℝ))) * Real.log L) := by obtain ⟨v, Vmax, hv, hVmax, hpools⟩ := exists_candidate_P_pool_bounds hscale have hC : 0 < (2 : ℝ) / (5 * Real.log 2) := by positivity filter_upwards [hpools, eventually_physical_root_replacement (a := (13/25 : ℝ)) (c := (1/10 : ℝ)) (d := (2/5 : ℝ)) (C := (2 : ℝ) / (5 * Real.log 2)) (V := Vmax) (v := v) (E := E) (γ := γ) (B := B) (q := (1/2 : ℝ)) (by norm_num) (by norm_num) (by norm_num) (by norm_num) hC hVmax hv hE hγ hB (by norm_num) (by norm_num) J ell J] with L hpools hreplace intro S hS P V inst I patterns cuts bounds ζ k K D N z hbounds hsum hK hcut hN hlog have hL : 0 < L := lt_of_lt_of_le zero_lt_one hpools.1 have hceil : 0 < Nat.ceil (L ^ (13/25 : ℝ)) := Nat.ceil_pos.mpr (Real.rpow_pos_of_pos hL _) have hlen : 2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1 + 1 = 2 * Nat.ceil (L ^ (13/25 : ℝ)) := by omega have hdata (g : S) := hpools.2.2.2.2.2 g.val (hS g.property) have hdis : Pairwise (fun g h : S => Disjoint (P g) (P h)) := by intro g h hgh exact hpools.2.2.2.2.1 (Subtype.val_injective.ne hgh) have hcard : (Fintype.card S : ℝ) ≤ (2 / (5 * Real.log 2)) * Real.log L := by have hs : (S.card : ℝ) ≤ ((candidatePIndices scale L).card : ℝ) := by exact_mod_cast card_le_card hS simpa only [Fintype.card_coe] using hs.trans hpools.2.2.2.1 have h := hreplace S P V I patterns cuts bounds ζ k K (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1) D N z hlen hdis (fun g p hp => ((hdata g).2.2 p hp).1) hcard (fun g => (hdata g).1) (fun _ => rfl) (fun g => (hdata g).2.1) (fun g p hp => ((hdata g).2.2 p hp).2.1.le) (fun g p hp => ((hdata g).2.2 p hp).2.2) (fun i _ g => (card_le_univ (cuts i g)).trans_eq (Fintype.card_fin J)) hbounds hsum hK (by simpa only [hlen] using hcut) hN hlog have hlenR : ((2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1 : ℕ) : ℝ) + 1 = 2 * (Nat.ceil (L ^ (13/25 : ℝ)) : ℝ) := by exact_mod_cast hlen simpa only [hlenR] using h end Bounty -- Source module: PhysicalRootBirthAtoms /- The actual reciprocal root birth law has the prime-atom decay required by the common-history high-rank estimate. -/ namespace Bounty theorem physical_root_reciprocal_atom_bound (p : ℕ) {L baseline V vmin : ℝ} (hvmin : 0 < vmin) (hV : vmin ≤ V) (hbase : 1 / 2 ≤ baseline) (hp : Real.exp (L ^ (3/10 : ℝ)) ≤ (p : ℝ)) : ((p : ℝ) * baseline)⁻¹ / V ≤ (2 / vmin) * Real.exp (-(L ^ (3/10 : ℝ))) := by have hb0 : 0 ≤ baseline := by linarith have hden : Real.exp (L ^ (3/10 : ℝ)) * (1/2) * vmin ≤ (p : ℝ) * baseline * V := by calc _ ≤ (p : ℝ) * baseline * vmin := mul_le_mul_of_nonneg_right (mul_le_mul hp hbase (by norm_num) (Nat.cast_nonneg p)) hvmin.le _ ≤ _ := mul_le_mul_of_nonneg_left hV (mul_nonneg (Nat.cast_nonneg p) hb0) calc _ = 1 / ((p : ℝ) * baseline * V) := by simp only [div_eq_mul_inv, mul_inv_rev] ring _ ≤ 1 / (Real.exp (L ^ (3/10 : ℝ)) * (1/2) * vmin) := one_div_le_one_div_of_le (by positivity) hden _ = _ := by rw [Real.exp_neg] field_simp theorem root_birth_rarity_envelope_bounds {L vmin vmax ρ v : ℝ} (hvmin : 0 < vmin) (hρ : 0 < ρ) (hv : 0 ≤ v) : let η := (2 / vmin) * Real.exp (-(L ^ (3/10 : ℝ))) let β := max (2 / vmin) (2 * vmax * v / (ρ * vmin)) * Real.exp (-(L ^ (3/10 : ℝ))) 0 < η ∧ η ≤ β ∧ 0 < β ∧ ∀ q V : ℝ, 0 ≤ q → q ≤ 1 → vmin ≤ V → V ≤ vmax → |(1 - q) * V / ρ| * η * v ≤ β := by intro η β have hη : 0 < η := mul_pos (div_pos (by norm_num) hvmin) (Real.exp_pos _) have hηβ : η ≤ β := mul_le_mul_of_nonneg_right (le_max_left _ _) (Real.exp_pos _).le refine ⟨hη, hηβ, hη.trans_le hηβ, ?_⟩ intro q V hq0 hq1 hVmin hVmax have hV0 : 0 ≤ V := hvmin.le.trans hVmin have hfactor : (1 - q) * V / ρ ≤ vmax / ρ := by apply div_le_div_of_nonneg_right _ hρ.le calc _ ≤ 1 * V := mul_le_mul_of_nonneg_right (by linarith) hV0 _ ≤ vmax := by simpa only [one_mul] using hVmax rw [abs_of_nonneg (div_nonneg (mul_nonneg (sub_nonneg.mpr hq1) hV0) hρ.le)] calc _ ≤ (vmax / ρ) * η * v := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hfactor hη.le) hv _ = (2 * vmax * v / (ρ * vmin)) * Real.exp (-(L ^ (3/10 : ℝ))) := by dsimp only [η] simp only [div_eq_mul_inv, mul_inv_rev] ring _ ≤ β := mul_le_mul_of_nonneg_right (le_max_right _ _) (Real.exp_pos _).le end Bounty -- Source module: CandidateRootBirthAtoms /- The actual candidate big primes and original endpoint baseline satisfy the exponential reciprocal-atom bound at the literal moment length. -/ open Filter namespace Bounty end Bounty -- Source module: RootDyadicLogLower /- An exponential lower bound for a source dyad supplies the logarithmic interval length needed by the finite moment replacement theorem. -/ open Filter namespace Bounty theorem eventually_root_dyadic_log_lower {b : ℝ} (hb : 0 < b) : ∀ᶠ L : ℝ in atTop, ∀ Z : ℝ, Real.exp (b * L) ≤ Z → ∀ i : ℕ, Z / 8 < (2 : ℝ) ^ i → (b / 2) * L ≤ Real.log ((2 : ℕ) ^ i : ℝ) := by filter_upwards [eventually_ge_atTop (2 * Real.log 8 / b)] with L hL intro Z hZ i hi have hbudget : Real.log 8 ≤ (b / 2) * L := by have hh := (div_le_iff₀ hb).mp hL nlinarith have hpow : 0 < (2 : ℝ) ^ i := by positivity have hexp : Real.exp (b * L) ≤ 8 * (2 : ℝ) ^ i := by linarith have hlog := Real.log_le_log (Real.exp_pos _) hexp rw [Real.log_exp, Real.log_mul (by norm_num : (8 : ℝ) ≠ 0) (ne_of_gt hpow)] at hlog push_cast linarith end Bounty -- Source module: ActualRootDyadicLog /- Every source dyad in the original harmonic windows is long enough for the actual finite root replacement, with one uniform threshold. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_actual_root_dyadic_log {b K : ℝ} (hb : 0 < b) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ (G : Type) [Fintype G] [DecidableEq G] (P : G → Finset ℕ) (J ell : ℕ) (probes : G → Finset (Fin J)) (r t : Finset G), (∀ g p, p ∈ P g → p.Prime) → ∀ U W : ℝ, Real.exp (b*L) ≤ U → U ≤ Real.exp L → Real.exp (b*L) ≤ W → W ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ i ∈ (physicalSignedHarmonicPositions (ell := ell) P probes r t (typeIISmoothDyadicScale U W (U*L^(-K)) j) k).image (fun n => n.natAbs.log2), (b/2)*L ≤ Real.log ((2 : ℕ)^i : ℝ) := by filter_upwards [eventually_root_dyadic_log_lower hb, eventually_typeII_harmonic_scale_lower hb hK, eventually_typeII_original_harmonic_shift_small hb hK] with L hlog hscale hshift intro G inst inst' P J ell probes r t hprime U W hUlo hUhi hWlo hWhi k hk j hj i hi have hZ := hscale U W hUlo hWlo j have hZlo : Real.exp (b*L) ≤ typeIISmoothDyadicScale U W (U*L^(-K)) j := by linarith [Real.exp_pos (b*L)] have hZpos : 0 < typeIISmoothDyadicScale U W (U*L^(-K)) j := (Real.exp_pos _).trans_le hZlo exact hlog _ hZlo i (physical_signed_harmonic_dyadic_lower probes r t hprime hZpos k (hshift U W hUlo hUhi hWlo hWhi k hk j hj) hi) end Bounty -- Source module: CandidateSignedDyadicReplacement /- Finite replacement for the literal alternating adjoint/original moment on every dyad occurring in the original harmonic windows. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_signed_dyadic_replacement {scale b Kpow E B : ℝ} (hscale : 0 < scale) (hb : 0 < b) (hKpow : 0 ≤ Kpow) (hE : 0 ≤ E) (hB : 0 ≤ B) (J ell : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices scale L → let P := fun g : S => candidatePBand (scale * L) g.val let V := fun g : S => ∑ p ∈ P g, 1 / (p : ℝ) ∀ [∀ p : PhysicalPrime P, NeZero p.2.val] (probes : S → Finset (Fin J)) (r t : Finset S), ∀ U W : ℝ, Real.exp (b*L) ≤ U → U ≤ Real.exp L → Real.exp (b*L) ≤ W → W ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kpow : ℤ)) (typeIIAdmissibleDeterminantBound L Kpow : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ i ∈ (physicalSignedHarmonicPositions (ell := ell) P probes r t (typeIISmoothDyadicScale U W (U*L^(-Kpow)) j) k).image (fun n => n.natAbs.log2), ∀ (I : Type) (patterns : Finset I) (cuts : I → S → Finset (Fin J)) (bounds : I → ℝ) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (cuts i) → ℂ), (∀ i ∈ patterns, 0 ≤ bounds i) → (∑ i ∈ patterns, bounds i) ≤ L ^ B → (∀ i, i ∈ patterns → ∀ x y aux, ‖K i x y aux‖ ≤ bounds i) → let ζt := fun e a => if e % 2 = 0 then -ζ a else ζ a let kt := fun e (_ : I) => if e % 2 = 0 then -k else k let Kt := fun e a x y aux => if e % 2 = 0 then (starRingEnd ℂ) (K a y x aux) else K a x y aux let D := max 1 (physicalOperatorStepBound P J ell patterns cuts (fun _ => k)) ‖physicalRootMoment V patterns cuts (1/2) ζt kt Kt (physicalDyadicStarts i) (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1) D - physicalRootResidueModel V patterns cuts (1/2) ζt kt Kt (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1)‖ ≤ Real.exp (-E * (2 * Nat.ceil (L ^ (13/25 : ℝ))) * Real.log L) := by filter_upwards [eventually_candidate_root_replacement hscale (by positivity : 0 < b/2) hE hB J ell, eventually_actual_root_dyadic_log hb hKpow] with L hreplace hlog intro S hS P V inst probes r t U W hUlo hUhi hWlo hWhi k hk j hj i hi I patterns cuts bounds ζ K hbounds hsum hK ζt kt Kt D have hprime (g : S) (p : ℕ) (hp : p ∈ P g) : p.Prime := ((mem_dyadicPrimeBand_iff (scale*L) (3/2) (9/5) g.val p).mp hp).1 have hiLog := hlog S P J ell probes r t hprime U W hUlo hUhi hWlo hWhi k hk j hj i hi have hKt : ∀ e a, a ∈ patterns → ∀ x y aux, ‖Kt e a x y aux‖ ≤ bounds a := by intro e a ha x y aux dsimp only [Kt] split_ifs · simpa only [starRingEnd_apply, norm_star] using hK a ha y x aux · exact hK a ha x y aux have hcut : ∀ e < 2 * Nat.ceil (L ^ (13/25 : ℝ)), physicalOperatorStepBound P J ell patterns cuts (kt e) ≤ D := by intro e _ dsimp only [kt, D] by_cases he : e % 2 = 0 · simp only [he, if_true, physical_operator_step_bound_neg] exact le_max_right _ _ · simp only [he, if_false] exact le_max_right _ _ have hstarts : Ico ((2 : ℤ)^i) ((2 : ℤ)^i + ((2^i : ℕ) : ℤ)) = physicalDyadicStarts i := by simp only [physicalDyadicStarts, Nat.cast_pow, Nat.cast_ofNat, pow_succ] congr 1 ring have hiLogNat : (b/2)*L ≤ Real.log ((2^i : ℕ) : ℝ) := by simpa only [Nat.cast_pow, Nat.cast_ofNat] using hiLog have h := hreplace S hS I patterns cuts bounds ζt kt Kt D (2^i) ((2 : ℤ)^i) hbounds hsum hKt hcut (by positivity) hiLogNat simpa only [hstarts] using h end Bounty -- Source module: RootMomentBudget /- Reserve one power of the large parameter for the sum of the finite, cap, and working-scalar errors in the final central moment. -/ namespace Bounty theorem root_three_errors_power_budget {L F : ℝ} (hL : 3 ≤ L) {N : ℕ} (hN : 0 < N) : 3 * L ^ (-(F + 1) * (N : ℝ)) ≤ (L ^ (-F)) ^ N := by have hL0 : 0 < L := by linarith have hLN : (3 : ℝ) ≤ L ^ N := hL.trans (le_self_pow₀ (by linarith : 1 ≤ L) (Nat.ne_zero_of_lt hN)) have hproduct : L ^ (-(F + 1) * (N : ℝ)) * L ^ (N : ℝ) = (L ^ (-F)) ^ N := by rw [← Real.rpow_add hL0, ← Real.rpow_natCast, ← Real.rpow_mul hL0.le] congr 1 ring calc _ ≤ L ^ N * L ^ (-(F + 1) * (N : ℝ)) := mul_le_mul_of_nonneg_right hLN (Real.rpow_nonneg hL0.le _) _ = (L ^ (-F)) ^ N := by rw [mul_comm, ← Real.rpow_natCast, hproduct] theorem root_central_moment_of_three_errors {L F : ℝ} (hL : 3 ≤ L) {N : ℕ} (hN : 0 < N) (moment model : ℂ) (hfinite : ‖moment - model‖ ≤ L ^ (-(F + 1) * (N : ℝ))) (hmodel : ‖model‖ ≤ 2 * L ^ (-(F + 1) * (N : ℝ))) : moment.re ≤ (L ^ (-F)) ^ N := by have hnorm : ‖moment‖ ≤ 3 * L ^ (-(F + 1) * (N : ℝ)) := by calc ‖moment‖ ≤ ‖moment - model‖ + ‖model‖ := norm_le_norm_sub_add _ _ _ ≤ L ^ (-(F + 1) * (N : ℝ)) + 2 * L ^ (-(F + 1) * (N : ℝ)) := add_le_add hfinite hmodel _ = _ := by ring exact (Complex.re_le_norm moment).trans (hnorm.trans (root_three_errors_power_budget hL hN)) theorem root_finite_error_as_power {L F : ℝ} (hL : 0 < L) (N : ℕ) : Real.exp (-F * (N : ℝ) * Real.log L) = L ^ (-F * (N : ℝ)) := by rw [Real.rpow_def_of_pos hL] congr 1 ring end Bounty -- Source module: CandidateSignedCentralMoment /- Only the actual residue-model estimate remains after finite replacement on the original signed dyadic moments. One reserved power absorbs all three errors. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_candidate_signed_central_moment {scale b Kpow E B : ℝ} (hscale : 0 < scale) (hb : 0 < b) (hKpow : 0 ≤ Kpow) (hE : 0 ≤ E) (hB : 0 ≤ B) (J ell : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices scale L → let P := fun g : S => candidatePBand (scale * L) g.val let V := fun g : S => ∑ p ∈ P g, 1 / (p : ℝ) ∀ [∀ p : PhysicalPrime P, NeZero p.2.val] (probes : S → Finset (Fin J)) (r t : Finset S), ∀ U W : ℝ, Real.exp (b*L) ≤ U → U ≤ Real.exp L → Real.exp (b*L) ≤ W → W ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kpow : ℤ)) (typeIIAdmissibleDeterminantBound L Kpow : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ i ∈ (physicalSignedHarmonicPositions (ell := ell) P probes r t (typeIISmoothDyadicScale U W (U*L^(-Kpow)) j) k).image (fun n => n.natAbs.log2), ∀ (I : Type) (patterns : Finset I) (cuts : I → S → Finset (Fin J)) (bounds : I → ℝ) (ζ : I → ℝ) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (cuts i) → ℂ), (∀ i ∈ patterns, 0 ≤ bounds i) → (∑ i ∈ patterns, bounds i) ≤ L ^ B → (∀ i, i ∈ patterns → ∀ x y aux, ‖K i x y aux‖ ≤ bounds i) → let ζt := fun e a => if e % 2 = 0 then -ζ a else ζ a let kt := fun e (_ : I) => if e % 2 = 0 then -k else k let Kt := fun e a x y aux => if e % 2 = 0 then (starRingEnd ℂ) (K a y x aux) else K a x y aux let D := max 1 (physicalOperatorStepBound P J ell patterns cuts (fun _ => k)) let moment := physicalRootMoment V patterns cuts (1/2) ζt kt Kt (physicalDyadicStarts i) (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1) D let model := physicalRootResidueModel V patterns cuts (1/2) ζt kt Kt (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1) ‖model‖ ≤ 2 * L ^ (-(E + 1) * (2 * Nat.ceil (L ^ (13/25 : ℝ)) : ℕ)) → moment.re ≤ (L ^ (-E)) ^ (2 * Nat.ceil (L ^ (13/25 : ℝ))) := by filter_upwards [eventually_candidate_signed_dyadic_replacement hscale hb hKpow (show 0 ≤ E + 1 by linarith) hB J ell, eventually_ge_atTop (3 : ℝ)] with L hreplace hL intro S hS P V inst probes r t U W hUlo hUhi hWlo hWhi k hk j hj i hi I patterns cuts bounds ζ K hbounds hsum hK ζt kt Kt D moment model hmodel have hL0 : 0 < L := by linarith have hN : 0 < 2 * Nat.ceil (L ^ (13/25 : ℝ)) := Nat.mul_pos (by decide) (Nat.ceil_pos.mpr (Real.rpow_pos_of_pos hL0 _)) have hfinite := hreplace S hS probes r t U W hUlo hUhi hWlo hWhi k hk j hj i hi I patterns cuts bounds ζ K hbounds hsum hK have heq : Real.exp (-(E + 1) * (2 * Nat.ceil (L ^ (13/25 : ℝ))) * Real.log L) = L ^ (-(E + 1) * (2 * Nat.ceil (L ^ (13/25 : ℝ)) : ℕ)) := by simpa only [Nat.cast_mul, Nat.cast_ofNat] using root_finite_error_as_power (F := E + 1) hL0 (2 * Nat.ceil (L ^ (13/25 : ℝ))) rw [heq] at hfinite exact root_central_moment_of_three_errors hL hN moment model hfinite hmodel end Bounty -- Source module: PhysicalRootPrimeEnvelope /- The exact original prime kernel has a polynomially summable pattern majorant, uniformly over all candidate probes and all auxiliary labels. -/ open Finset Filter open scoped Classical namespace Bounty theorem physical_root_prime_kernel_norm_le {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) : ‖physicalRootPrimeKernel P V probes r t hrt Q h ξ i L R aux‖ ≤ repeatedBigPrimePatternBound probes r t Q ξ i := by rw [physicalRootPrimeKernel, norm_mul, repeated_big_prime_pattern_weight_norm, one_mul] exact repeated_big_prime_pattern_kernel_norm_le P V probes r t hrt Q h ξ hξ i _ _ aux theorem repeated_big_prime_pattern_bound_sum_le_envelope {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (ξ : ℝ) : (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q ξ i) ≤ repeatedBigFamilyEnvelope (Fintype.card G) J Q ξ := by apply (repeated_big_prime_pattern_bound_sum_le probes r t (fun g => (card_le_univ (probes g)).trans_eq (Fintype.card_fin J)) Q ξ).trans unfold repeatedBigFamilyEnvelope apply add_le_add (le_refl _) apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) apply pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 2) apply Nat.mul_le_mul_left rw [← card_union_of_disjoint hrt] exact card_le_univ _ theorem exists_candidate_root_pattern_power {scale q x : ℝ} (hscale : 0 < scale) (hq : 0 ≤ q) (hx : 0 ≤ x) (J ell : ℕ) : ∃ B : ℝ, 0 ≤ B ∧ ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices scale L → ∀ (probes : S → Finset (Fin J)) (r t : Finset S), Disjoint r t → ∀ (Q : ℕ) (ξ : ℝ), (Q : ℝ) ≤ L ^ q → L ^ (-x) ≤ ξ → (∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, repeatedBigPrimePatternBound probes r t Q ξ i) ≤ L ^ B := by obtain ⟨v, V, _, _, hpools⟩ := exists_candidate_P_pool_bounds hscale let a : ℝ := 2 / (5 * Real.log 2) let d : ℝ := (J : ℝ) * a * Real.log 2 + 4 * q + 2 * x have ha : 0 ≤ a := by dsimp [a]; positivity have hd : 0 ≤ d := by dsimp [d]; positivity refine ⟨d + 1, by linarith, ?_⟩ filter_upwards [hpools, eventually_ge_atTop (2 : ℝ)] with L hpools hL intro S hS probes r t hrt Q ξ hQ hξ have hL0 : 0 < L := by linarith have hcard : (Fintype.card S : ℝ) ≤ a * Real.log L := by simpa only [Fintype.card_coe] using (Nat.cast_le.mpr (card_le_card hS)).trans hpools.2.2.2.1 calc _ ≤ repeatedBigFamilyEnvelope (Fintype.card S) J Q ξ := repeated_big_prime_pattern_bound_sum_le_envelope probes r t hrt Q ξ _ ≤ 2 * L ^ d := repeated_big_family_envelope_le _ J Q (by linarith) ha hq hx hcard hQ hξ _ ≤ L * L ^ d := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = L ^ (d + 1) := by rw [mul_comm, ← Real.rpow_add_one hL0.ne'] end Bounty -- Source module: ActualPrimeCentralMoment /- The actual prime kernel discharges every finite replacement input. The remaining premise is the residue-model estimate for the selected data. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_actual_prime_central_moment {scale b Kpow q x E : ℝ} (hscale : 0 < scale) (hb : 0 < b) (hKpow : 0 ≤ Kpow) (hq : 0 ≤ q) (hx : 0 ≤ x) (hE : 0 ≤ E) (J ell : ℕ) : ∀ᶠ L : ℝ in atTop, ∀ (S : Finset ℕ), S ⊆ candidatePIndices scale L → let P := fun g : S => candidatePBand (scale * L) g.val let V := fun g : S => ∑ p ∈ P g, 1 / (p : ℝ) ∀ [∀ p : PhysicalPrime P, NeZero p.2.val] (probes : S → Finset (Fin J)) (r t : Finset S) (hrt : Disjoint r t) (Q : ℕ) (h ξ ζ : ℝ), (Q : ℝ) ≤ L ^ q → L ^ (-x) ≤ ξ → ∀ U W : ℝ, Real.exp (b*L) ≤ U → U ≤ Real.exp L → Real.exp (b*L) ≤ W → W ≤ Real.exp L → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L Kpow : ℤ)) (typeIIAdmissibleDeterminantBound L Kpow : ℤ), ∀ j ∈ range (typeIISmoothDyadicCount L), ∀ i ∈ (physicalSignedHarmonicPositions (ell := ell) P probes r t (typeIISmoothDyadicScale U W (U*L^(-Kpow)) j) k).image (fun n => n.natAbs.log2), let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) let cuts := repeatedBigPrimePatternCut (ell := ell) probes r t let ζt := fun e (_ : RepeatedBigPrimePatternIndex (ell := ell) probes r t) => if e % 2 = 0 then -ζ else ζ let kt := fun e (_ : RepeatedBigPrimePatternIndex (ell := ell) probes r t) => if e % 2 = 0 then -k else k let Kt := fun e a u v aux => if e % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ a v u aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ a u v aux let D := max 1 (physicalOperatorStepBound P J ell patterns cuts (fun _ => k)) let moment := physicalRootMoment V patterns cuts (1/2) ζt kt Kt (physicalDyadicStarts i) (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1) D let model := physicalRootResidueModel V patterns cuts (1/2) ζt kt Kt (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1) ‖model‖ ≤ 2 * L ^ (-(E + 1) * (2 * Nat.ceil (L ^ (13/25 : ℝ)) : ℕ)) → moment.re ≤ (L ^ (-E)) ^ (2 * Nat.ceil (L ^ (13/25 : ℝ))) := by obtain ⟨B, hB, hbounds⟩ := exists_candidate_root_pattern_power hscale hq hx J ell filter_upwards [hbounds, eventually_candidate_signed_central_moment hscale hb hKpow hE hB J ell, eventually_gt_atTop (0 : ℝ)] with L hbounds hcentral hL intro S hS P V inst probes r t hrt Q h ξ ζ hQ hξ U W hUlo hUhi hWlo hWhi k hk j hj i hi patterns cuts ζt kt Kt D moment model hmodel have hξpos := (Real.rpow_pos_of_pos hL (-x)).trans_le hξ exact hcentral S hS probes r t U W hUlo hUhi hWlo hWhi k hk j hj i hi (RepeatedBigPrimePatternIndex (ell := ell) probes r t) patterns cuts (repeatedBigPrimePatternBound probes r t Q ξ) (fun _ => ζ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ) (fun a _ => repeated_big_prime_pattern_bound_nonneg probes r t Q ξ a) (hbounds S hS probes r t hrt Q ξ hQ hξ) (fun a _ u v aux => physical_root_prime_kernel_norm_le P V probes r t hrt Q h ξ hξpos a u v aux) hmodel end Bounty -- Source module: SelectedResiduePremise /- The explicit remaining original residue-model estimate, with common data chosen before the phase and determinant. -/ open Finset Filter open scoped Classical namespace Bounty def CandidateSelectedResidueBounds (c : ℝ) : Prop := ∀ E z K : ℝ, 0 ≤ E → 0 ≤ z → 0 ≤ K → ∃ (J : ℕ) (w x q : ℝ), 0 ≤ w ∧ 0 ≤ x ∧ 0 ≤ q ∧ ∀ᶠ L : ℝ in atTop, let S := candidatePIndices c L let P := fun g : S => candidatePBand (c * L) g.val let V := fun g : S => ∑ p ∈ P g, 1 / (p : ℝ) ∃ (probes : S → Finset (Fin J)) (r t : Finset S) (hrt : Disjoint r t) (Q : ℕ), (∀ g ∈ r ∪ t, g.val ∈ candidateBigPIndices c L) ∧ (Q : ℝ) ≤ L ^ q ∧ ∀ [∀ p : PhysicalPrime P, NeZero p.2.val], ∀ ζ : ℝ, |ζ| ≤ L ^ z → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), k ≠ 0 → let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := 1) probes r t)) let cuts := repeatedBigPrimePatternCut (ell := 1) probes r t let ζt := fun e (_ : RepeatedBigPrimePatternIndex (ell := 1) probes r t) => if e % 2 = 0 then -ζ else ζ let kt := fun e (_ : RepeatedBigPrimePatternIndex (ell := 1) probes r t) => if e % 2 = 0 then -k else k let Kt := fun e a u v aux => if e % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q (L ^ (-w)) (L ^ (-x)) a v u aux) else physicalRootPrimeKernel P V probes r t hrt Q (L ^ (-w)) (L ^ (-x)) a u v aux ‖physicalRootResidueModel V patterns cuts (1/2) ζt kt Kt (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1)‖ ≤ 2 * L ^ (-(E + 1) * (2 * Nat.ceil (L ^ (13/25 : ℝ)) : ℕ)) end Bounty -- Source module: SelectedCentralFrequency /- Cancellation of the original endpoint frequency in the central Mellin range. -/ open Filter namespace Bounty theorem eventually_original_central_phase_bound (F η : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (ν : ℝ) (ζ : EuclideanSpace ℝ (Fin 3)) (u : ℝ), ‖ζ‖ ≤ L ^ F → ‖u‖ ≤ L ^ η → |-((2 * Real.pi * ν + 2 * Real.pi * ζ 2) + (-(2 * Real.pi * ν))) - 2 * Real.pi * u| ≤ L ^ (max η F + 1) := by filter_upwards [eventually_original_endpoint_phase_bounds η F] with L hL intro ν ζ u hζ hu have he : -((2 * Real.pi * ν + 2 * Real.pi * ζ 2) + (-(2 * Real.pi * ν))) - 2 * Real.pi * u = -(2 * Real.pi * u + 2 * Real.pi * ζ 2) := by ring rw [he, abs_neg] exact ((hL u ζ hu hζ).2 2).1 theorem central_moment_precision_mono {L E F : ℝ} (hL : 1 ≤ L) (hEF : F ≤ E) (n : ℕ) : (L ^ (-E)) ^ n ≤ (L ^ (-F)) ^ n := by exact pow_le_pow_left₀ (Real.rpow_nonneg (by linarith) _) (Real.rpow_le_rpow_of_exponent_le hL (neg_le_neg hEF)) n end Bounty -- Source module: SelectedMomentTransfer /- An explicit uniform original residue-model bound implies the selected central moment contract. -/ open Finset Filter MeasureTheory open scoped Classical namespace Bounty theorem candidate_selected_central_moments_of_residue_bounds {c bWindow : ℝ} (hc : 0 < c) (hb : 0 < bWindow) (rQ : ℕ) (hmodel : CandidateSelectedResidueBounds c) : CandidateSelectedCentralMoments c bWindow rQ := by refine ⟨0, ?_⟩ intro jStar _ Kdet hK D T F let E := max 0 D + 24 let z := max 1 F + 1 have hE : 0 ≤ E := by dsimp [E]; positivity have hz : 0 ≤ z := by dsimp [z]; linarith [le_max_left (1 : ℝ) F] obtain ⟨J, w, x, q, hw, hx, hq, hmodels⟩ := hmodel E z Kdet hE hz hK obtain ⟨v, V, _, _, hpools⟩ := exists_candidate_P_pool_bounds hc refine ⟨J, w, x, q, 1, hw, zero_lt_one, ?_⟩ filter_upwards [hmodels, hpools, eventually_original_central_phase_bound F 1, eventually_actual_prime_central_moment hc hb hK hq hx hE J 1] with L hm hp hphase hactual intro hrQ hj take _ _ ν ζ _ hζ U W hUlo hUhi hWlo hWhi k hk hk0 j hjrange Z P mass let _ : ∀ p : PhysicalPrime P, NeZero p.2.val := fun p => ⟨(((hp.2.2.2.2.2 p.1.val p.1.property).2.2 p.2.val p.2.property).1).ne_zero⟩ obtain ⟨probes, r, t, hrt, Q, hbig, hQ, hbound⟩ := hm refine ⟨probes, r, t, hrt, hbig, Q, hQ, ?_⟩ intro i hi filter_upwards [] with u intro hu let phase := -((2 * Real.pi * ν + 2 * Real.pi * ζ 2) + (-(2 * Real.pi * ν))) - 2 * Real.pi * u have hphase' : |phase| ≤ L ^ z := hphase ν ζ u hζ hu have hmod := hbound phase hphase' k hk hk0 have hmoment := hactual (candidatePIndices c L) (by intro i hi; exact hi) probes r t hrt Q (L ^ (-w)) (L ^ (-x)) phase hQ (le_refl _) U W hUlo hUhi hWlo hWhi k hk j hjrange i hi hmod have hprec : D + 1 + 23 ≤ E := by dsimp [E]; linarith [le_max_right (0 : ℝ) D] exact hmoment.trans (central_moment_precision_mono hp.1 hprec (2 * Nat.ceil (L ^ (13/25 : ℝ)))) end Bounty namespace Bounty.WeakZeroFree theorem target_of_selected_residue_bounds (hmodel : ∀ c : ℝ, 0 < c → CandidateSelectedResidueBounds c) : fcTypeOfName% "Erdos1057.erdos_1057" := by apply target_of_selected_central_moments intro c r hc _ _ bWindow hb exact candidate_selected_central_moments_of_residue_bounds hc hb r (hmodel c hc) end Bounty.WeakZeroFree end section -- Source module: ActualRealizedRootPrimeExports /- Actual realized candidate norms and original root Fourier edge costs. -/ section /- Actual zero-free signed prime norm exports, with one coherent aggregate dependency. -/ section /- Aggregate-compatible signed-prime helper overlay. -/ open scoped Topology BigOperators Classical -- Original module: PhysicalMixedNormConjugation /- Conjugation preserves the real weighted norm and pending symmetry, and commutes with the exact joint endpoint average. -/ open Finset open scoped Classical namespace Bounty theorem clean_active_norm_conj {X : Type*} [Fintype X] (w : X → ℝ) (f : X → ℂ) : cleanActiveNorm w (fun x => (starRingEnd ℂ) (f x)) = cleanActiveNorm w f := by simp only [cleanActiveNorm, starRingEnd_apply, norm_star] theorem physical_small_big_joint_average_conj {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P Z : G → Type*} {J ell : ℕ} {M : G → ℕ} {B : ℕ} (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P Z M B) → ℂ) : physicalSmallBigJointAverage (fun x => (starRingEnd ℂ) (f x)) = fun x => (starRingEnd ℂ) (physicalSmallBigJointAverage f x) := by funext s rw [physical_small_big_joint_average_eq_sum, physical_small_big_joint_average_eq_sum] simp only [map_sum, map_mul, Complex.conj_ofReal] theorem product_memory_symmetric_conj {G : Type*} [DecidableEq G] {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (f : ProductBoundedOrderedState P Z M B → ℂ) (hf : ProductMemorySymmetric f) : ProductMemorySymmetric (fun x => (starRingEnd ℂ) (f x)) := by intro x g τ exact congrArg (starRingEnd ℂ) (hf x g τ) end Bounty -- Original module: PhysicalMixedSignedPrimeAction /- The chronological prime family retains the conjugated, endpoint-swapped kernel at even times. The supplied displacement and residual are unchanged. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} noncomputable def physicalMixedSignedPrimePatternAction (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (time : ℕ) (k : ℤ) (initial : ∀ g, Finset (P g)) (φ : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent (repeatedBigPrimePatternCut probes r t i) k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) := let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ ∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, physicalMixedCoefficientAction (repeatedBigPrimePatternCut probes r t i) k V baseline ρ Vs q initial (fun a s e => (if time % 2 = 0 then (starRingEnd ℂ) (repeatedBigPrimePatternWeight probes r t i * repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i (physicalMixedRepeatedLabels (repeatedBigPrimePatternCut probes r t i) (physicalMixedCoefficientTarget (repeatedBigPrimePatternCut probes r t i) k a s e).2) (physicalMixedRepeatedLabels (repeatedBigPrimePatternCut probes r t i) s.2) a) else repeatedBigPrimePatternWeight probes r t i * repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i (physicalMixedRepeatedLabels (repeatedBigPrimePatternCut probes r t i) s.2) (physicalMixedRepeatedLabels (repeatedBigPrimePatternCut probes r t i) (physicalMixedCoefficientTarget (repeatedBigPrimePatternCut probes r t i) k a s e).2) a) * φ i a s e) f theorem physical_mixed_signed_prime_pattern_action_of_odd (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (time : ℕ) (htime : time % 2 ≠ 0) (k : ℤ) (initial : ∀ g, Finset (P g)) (φ : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent (repeatedBigPrimePatternCut probes r t i) k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : physicalMixedSignedPrimePatternAction V baseline ρ Vs q probes r t hrt Q h ξ time k initial φ f = physicalMixedPrimePatternAction V baseline ρ Vs q probes r t hrt Q h ξ k initial φ f := by simp only [physicalMixedSignedPrimePatternAction, if_neg htime, physicalMixedPrimePatternAction] theorem physical_mixed_signed_prime_pattern_action_of_even (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (time : ℕ) (htime : time % 2 = 0) (k : ℤ) (initial : ∀ g, Finset (P g)) (φ : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent (repeatedBigPrimePatternCut probes r t i) k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : physicalMixedSignedPrimePatternAction V baseline ρ Vs q probes r t hrt Q h ξ time k initial φ f = let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ ∑ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, physicalMixedCoefficientAction (repeatedBigPrimePatternCut probes r t i) k V baseline ρ Vs q initial (fun a s e => (starRingEnd ℂ) (repeatedBigPrimePatternWeight probes r t i * repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i (physicalMixedRepeatedLabels (repeatedBigPrimePatternCut probes r t i) (physicalMixedCoefficientTarget (repeatedBigPrimePatternCut probes r t i) k a s e).2) (physicalMixedRepeatedLabels (repeatedBigPrimePatternCut probes r t i) s.2) a) * φ i a s e) f := by simp only [physicalMixedSignedPrimePatternAction, if_pos htime] end end Bounty -- Original module: PhysicalMixedSignedPrimeNorm /- A uniform projected norm bound for the signed prime family in both time parities. The original auxiliary law, initial exclusion and two endpoint averages are retained. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_mixed_signed_prime_pattern_projected_norm_bound {q vs : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (J B m : ℕ) (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t), (∀ g, (probes g).card ≤ m) → ∀ (Q : ℕ) (h ξ : ℝ), 0 < ξ → ∀ (time : ℕ) (k : ℤ) (initial : ∀ g, Finset (P g)), (∀ s, vs ≤ Vs s) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → ∀ (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → ∀ (φ : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent (repeatedBigPrimePatternCut probes r t i) k a s → ℂ), (∀ i a s e, ‖φ i a s e‖ ≤ 1) → ∀ f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ, (∀ s, ProductMemorySymmetric (fun x => f (s,x))) → let μ := fun g => tiltedPhysicalBirthLaw V g (baseline g) let W := productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)) cleanActiveNorm (physicalSmallBigMeasure Vs W) (physicalSmallBigJointAverage (physicalMixedSignedPrimePatternAction V baseline ρ Vs q probes r t hrt Q h ξ time k initial φ (physicalSmallBigJointAverage f))) ≤ repeatedBigFamilyEnvelope (Fintype.card G) m Q ξ * A ^ Fintype.card S * Real.sqrt (unrestrictedEdgeEnergyBound ρ v vmin vmax (ell + m) ^ Fintype.card G) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := by obtain ⟨A, hA, hbound⟩ := exists_physical_mixed_coefficient_projected_norm_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ intro S G _ dS _ dG cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ J B m V baseline ρ Vs probes r t hrt hp Q h ξ hξ time k initial hVs hMass hbaseline v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi φ hφ f hf μ W let C := repeatedBigPrimePatternCut (ell := ell) probes r t let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ let K := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept let b := repeatedBigPrimePatternBound (ell := ell) probes r t Q ξ let Ψ := fun i a s (e : PhysicalMixedCoefficientEvent (B := B) (C i) k a s) => (if time % 2 = 0 then (starRingEnd ℂ) (repeatedBigPrimePatternWeight probes r t i * K i (physicalMixedRepeatedLabels (C i) (physicalMixedCoefficientTarget (C i) k a s e).2) (physicalMixedRepeatedLabels (C i) s.2) a) else repeatedBigPrimePatternWeight probes r t i * K i (physicalMixedRepeatedLabels (C i) s.2) (physicalMixedRepeatedLabels (C i) (physicalMixedCoefficientTarget (C i) k a s e).2) a) * φ i a s e have hb : ∀ i, 0 ≤ b i := repeated_big_prime_pattern_bound_nonneg probes r t Q ξ have hΨ : ∀ i a s e, ‖Ψ i a s e‖ ≤ b i := by intro i a s e dsimp only [Ψ] split_ifs · rw [norm_mul, starRingEnd_apply, norm_star, norm_mul, repeated_big_prime_pattern_weight_norm, one_mul] exact (mul_le_mul_of_nonneg_right (repeated_big_prime_pattern_kernel_norm_le P V probes r t hrt Q h ξ hξ i _ _ a) (norm_nonneg _)).trans ((mul_le_mul_of_nonneg_left (hφ i a s e) (hb i)).trans_eq (mul_one _)) · rw [norm_mul, norm_mul, repeated_big_prime_pattern_weight_norm, one_mul] exact (mul_le_mul_of_nonneg_right (repeated_big_prime_pattern_kernel_norm_le P V probes r t hrt Q h ξ hξ i _ _ a) (norm_nonneg _)).trans ((mul_le_mul_of_nonneg_left (hφ i a s e) (hb i)).trans_eq (mul_one _)) have hsum : ∑ i, b i ≤ repeatedBigFamilyEnvelope (Fintype.card G) m Q ξ := by apply (repeated_big_prime_pattern_bound_sum_le (ell := ell) probes r t hp Q ξ).trans apply add_le_add le_rfl apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) apply pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 2) apply Nat.mul_le_mul_left rw [← card_union_of_disjoint hrt] exact card_le_univ _ have hμ : ∀ g p, 0 ≤ μ g p := fun g p => tiltedPhysicalBirthLaw_nonneg V g (baseline g) (hvmin.trans_le (hVlo g)).le (fun p => (by norm_num : (0 : ℝ) ≤ 1/2).trans (hbaseline g p).1) p have hW : ∀ x, 0 ≤ W x := productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1) let u := fun i => physicalSmallBigJointAverage (physicalMixedCoefficientAction (C i) k V baseline ρ Vs q initial (Ψ i) (physicalSmallBigJointAverage f)) have heq : physicalSmallBigJointAverage (physicalMixedSignedPrimePatternAction V baseline ρ Vs q probes r t hrt Q h ξ time k initial φ (physicalSmallBigJointAverage f)) = ∑ i, u i := physical_small_big_joint_average_sum _ calc _ = cleanActiveNorm (physicalSmallBigMeasure Vs W) (∑ i, u i) := by congr 1 _ ≤ ∑ i, cleanActiveNorm (physicalSmallBigMeasure Vs W) (u i) := clean_active_norm_sum_le _ (physical_small_big_measure_nonneg Vs (fun s => hvs.trans_le (hVs s)) W hW) univ u _ ≤ ∑ i, b i * A ^ Fintype.card S * Real.sqrt (unrestrictedEdgeEnergyBound ρ v vmin vmax (ell + m) ^ Fintype.card G) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := by apply sum_le_sum intro i _ exact hbound S G Ps P J B (C i) k V baseline ρ Vs initial hVs hMass hbaseline v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi (ell+m) (fun g => Nat.add_le_add_left (repeated_big_prime_pattern_cut_card_le probes r t hp i g) ell) (Ψ i) (b i) (hb i) (hΨ i) f hf _ = (∑ i, b i) * A ^ Fintype.card S * Real.sqrt (unrestrictedEdgeEnergyBound ρ v vmin vmax (ell + m) ^ Fintype.card G) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := by rw [sum_mul, sum_mul, sum_mul] _ ≤ _ := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hsum (pow_nonneg (zero_le_one.trans hA) _)) (Real.sqrt_nonneg _)) (Real.sqrt_nonneg _) end Bounty -- Original module: PhysicalMixedSignedPrimeSymmetry /- Pending-memory symmetry for both chronological prime-kernel orientations. The event factor must be invariant under the actual memory-event reindexing. -/ open Finset Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} [∀ g (p : P g), NeZero p.val] {J ell B : ℕ} theorem physical_mixed_signed_prime_pattern_memory_symmetric (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (time : ℕ) (k : ℤ) (initial : ∀ g, Finset (P g)) (φ : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent (repeatedBigPrimePatternCut probes r t i) k a s → ℂ) (hφ : ∀ i a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalMixedCoefficientEvent (repeatedBigPrimePatternCut probes r t i) k a s), φ i a (s.1, productMemoryReindex s.2 τ) (physicalMixedCoefficientReindex (repeatedBigPrimePatternCut probes r t i) k a s τ e) = φ i a s e) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s,x))) : ∀ s, ProductMemorySymmetric (fun x => physicalMixedSignedPrimePatternAction V baseline ρ Vs q probes r t hrt Q h ξ time k initial φ f (s,x)) := by cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro s x g τ unfold physicalMixedSignedPrimePatternAction simp only [Finset.sum_apply] apply sum_congr rfl intro i _ apply physical_mixed_coefficient_signed_memory_symmetric _ _ _ _ _ _ _ _ _ _ f hf s x g τ intro a y σ e rw [physical_mixed_target_labels_reindex, hφ i a y σ e] rfl variable [DecidableEq S] end end Bounty -- Original module: PhysicalMixedCutTransport /- Exact transport of mixed coefficient rows along equality of their cuts. The original auxiliary labels, events, and arbitrary decorations are retained. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} {C D : G → Finset (Fin J)} def physicalAuxCutTransport (h : C = D) (a : PhysicalAuxLabels P C) : PhysicalAuxLabels P D := h ▸ a def physicalMixedEventCutTransport (h : C = D) (k : ℤ) {a : PhysicalAuxLabels P C} {s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)} (e : PhysicalMixedCoefficientEvent C k a s) : PhysicalMixedCoefficientEvent D k (physicalAuxCutTransport h a) s := by subst D exact e def physicalMixedPhaseCutTransport (h : C = D) (k : ℤ) (φ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent D k a s → ℂ := h ▸ φ omit [Fintype G] [DecidableEq G] in theorem physical_aux_cut_transport_apply (h : C = D) (a : PhysicalAuxLabels P C) (g : G) (j : D g) : physicalAuxCutTransport h a g j = a g ⟨j.val, by rw [h]; exact j.property⟩ := by subst D rfl omit [DecidableEq G] in theorem physical_mixed_phase_cut_transport_apply_reverse (h : C = D) (k : ℤ) (φ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (a : PhysicalAuxLabels P D) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent D k a s) : physicalMixedPhaseCutTransport h k φ a s e = φ (physicalAuxCutTransport h.symm a) s (physicalMixedEventCutTransport h.symm k e) := by subst D rfl omit [DecidableEq G] in theorem physical_mixed_phase_cut_transport_kernel_residual (h : C = D) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P D → ℂ) (ζ θ : ℝ) (k : ℤ) (sourceGate targetGate : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (decoration : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) : physicalMixedPhaseCutTransport h k (fun a s e => K (physicalMixedRepeatedLabels C s.2) (physicalMixedRepeatedLabels C (physicalMixedCoefficientTarget C k a s e).2) (physicalAuxCutTransport h a) * physicalMixedFullResidualPhase C ζ θ k sourceGate targetGate a s e * decoration a s e) = fun a s e => K (physicalMixedRepeatedLabels D s.2) (physicalMixedRepeatedLabels D (physicalMixedCoefficientTarget D k a s e).2) a * physicalMixedFullResidualPhase D ζ θ k sourceGate targetGate a s e * physicalMixedPhaseCutTransport h k decoration a s e := by subst D rfl theorem physical_mixed_coefficient_action_cut_transport (h : C = D) (k : ℤ) (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (initial : ∀ g, Finset (P g)) (φ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : physicalMixedCoefficientAction D k V baseline ρ Vs q initial (physicalMixedPhaseCutTransport h k φ) f = physicalMixedCoefficientAction C k V baseline ρ Vs q initial φ f := by subst D rfl theorem physical_mixed_coefficient_sum_reindex_cut {I K : Type} [Fintype I] [Fintype K] (index : I ≃ K) (cuts : K → G → Finset (Fin J)) (cuts' : I → G → Finset (Fin J)) (hcuts : ∀ i, cuts (index i) = cuts' i) (k : K → ℤ) (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (initial : ∀ g, Finset (P g)) (φ : ∀ i a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent (cuts i) (k i) a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) : (∑ i : K, physicalMixedCoefficientAction (cuts i) (k i) V baseline ρ Vs q initial (φ i) f s) = ∑ i : I, physicalMixedCoefficientAction (cuts' i) (k (index i)) V baseline ρ Vs q initial (physicalMixedPhaseCutTransport (hcuts i) (k (index i)) (φ (index i))) f s := by rw [← index.sum_comp] apply sum_congr rfl intro i _ exact congrFun (physical_mixed_coefficient_action_cut_transport (hcuts i) (k (index i)) V baseline ρ Vs q initial (φ (index i)) f).symm s end end Bounty -- Original module: PhysicalMixedCutReindex /- Transport along an equality of cuts preserves the precise event-factor invariance needed by the signed mixed coefficient action. -/ open scoped Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} [∀ g (p : P g), NeZero p.val] {J ell B : ℕ} {C D : G → Finset (Fin J)} omit [DecidableEq G] [∀ g (p : P g), NeZero p.val] in theorem physical_mixed_phase_cut_transport_reindex (h : C = D) (k : ℤ) (φ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (hφ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalMixedCoefficientEvent C k a s), φ a (s.1, productMemoryReindex s.2 τ) (physicalMixedCoefficientReindex C k a s τ e) = φ a s e) (a : PhysicalAuxLabels P D) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (e : PhysicalMixedCoefficientEvent D k a s) : physicalMixedPhaseCutTransport h k φ a (s.1, productMemoryReindex s.2 τ) (physicalMixedCoefficientReindex D k a s τ e) = physicalMixedPhaseCutTransport h k φ a s e := by subst D exact hφ a s τ e end end Bounty end section /- Complex conjugation of the actual clean row. All real weights, cutoffs, auxiliary labels, and the supplied displacement remain unchanged. -/ open Finset open scoped Classical namespace Bounty theorem physical_return_phase_conj (θ : ℝ) (h : ℤ) : (starRingEnd ℂ) (physicalReturnPhase θ h) = physicalReturnPhase (-θ) h := by unfold physicalReturnPhase rw [← Complex.exp_conj] congr 1 simp only [map_mul, map_ofNat, Complex.conj_ofReal, Complex.conj_I, map_intCast, Complex.ofReal_neg] ring section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} theorem physical_mixed_coefficient_action_conj (C : G → Finset (Fin J)) (k : ℤ) (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (initial : ∀ g, Finset (P g)) (Φ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) : (starRingEnd ℂ) (physicalMixedCoefficientAction C k V baseline ρ Vs q initial Φ f s) = physicalMixedCoefficientAction C k V baseline ρ Vs q initial (fun a y e => (starRingEnd ℂ) (Φ a y e)) (fun y => (starRingEnd ℂ) (f y)) s := by simp only [physicalMixedCoefficientAction, physicalSmallBigFullPhasedAction, physicalSmallBigPhasedAction, map_sum, map_mul, Complex.conj_ofReal, apply_ite, map_zero] omit [DecidableEq G] in theorem physical_mixed_concrete_residual_conj (C : G → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (Fs : ∀ g, Finset (Ps g)) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent C k a s) : (starRingEnd ℂ) (physicalMixedFullResidualPhase C ζ θ k cleanMixedSourceGate (cleanMixedTargetGate Fs) a s e) = physicalMixedFullResidualPhase C (-ζ) (-θ) k cleanMixedSourceGate (cleanMixedTargetGate Fs) a s e := by unfold physicalMixedFullResidualPhase dsimp only split_ifs <;> simp only [map_mul, map_zero, cleanMixedSourceGate_conj, cleanMixedTargetGate_conj, ← physical_phase_reverse, physical_return_phase_conj] end end Bounty end section /- Swapping the two comparison groups is a bijective pattern reindexing. It reverses the kernel endpoints while preserving the original auxiliary labels. -/ open Finset open scoped Classical namespace Bounty noncomputable def repeatedBigPrimePatternSwapEquiv {G : Type} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) : RepeatedBigPrimePatternIndex (ell := ell) probes r t ≃ RepeatedBigPrimePatternIndex (ell := ell) probes t r := Equiv.sumCongr (Equiv.refl Unit) (Equiv.prodComm _ _) theorem repeated_big_aux_cut_swap {G : Type} [DecidableEq G] {J ell : ℕ} (A B : Finset (RepeatedBigFlatIndex G J ell)) : repeatedBigAuxCut B A = repeatedBigAuxCut A B := by funext g simp only [repeatedBigAuxCut, union_comm B A] theorem repeated_big_prime_pattern_swap_cut {G : Type} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) : repeatedBigPrimePatternCut probes t r (repeatedBigPrimePatternSwapEquiv probes r t i) = repeatedBigPrimePatternCut probes r t i := by cases i with | inl u => rfl | inr ab => exact repeated_big_aux_cut_swap ab.1.val ab.2.val theorem repeated_big_prime_pattern_swap_weight {G : Type} [DecidableEq G] {J ell : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) : repeatedBigPrimePatternWeight probes t r (repeatedBigPrimePatternSwapEquiv probes r t i) = repeatedBigPrimePatternWeight probes r t i := by cases i with | inl u => rfl | inr ab => change -(-1 : ℂ) ^ (ab.2.val.card + ab.1.val.card) = -(-1 : ℂ) ^ (ab.1.val.card + ab.2.val.card) rw [Nat.add_comm] theorem repeated_big_aux_split_swap {G : Type} [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hU' : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ B ∪ A) (hAB : Disjoint A B) (a : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : repeatedBigAuxSplitEquiv P B A hU' hAB.symm (physicalAuxCutTransport (repeated_big_aux_cut_swap A B).symm a) = ((repeatedBigAuxSplitEquiv P A B hU hAB a).2, (repeatedBigAuxSplitEquiv P A B hU hAB a).1) := by apply Prod.ext · funext x rcases x with ⟨⟨g, j | j⟩, hx⟩ · change physicalAuxCutTransport (repeated_big_aux_cut_swap A B).symm a g ⟨j, (mem_repeatedBigAuxCut B A g j).mpr (mem_union_left A hx)⟩ = a g ⟨j, (mem_repeatedBigAuxCut A B g j).mpr (mem_union_right A hx)⟩ rw [physical_aux_cut_transport_apply] · exact (hU g j (mem_union_right A hx)).elim · funext x rcases x with ⟨⟨g, j | j⟩, hx⟩ · change physicalAuxCutTransport (repeated_big_aux_cut_swap A B).symm a g ⟨j, (mem_repeatedBigAuxCut B A g j).mpr (mem_union_right B hx)⟩ = a g ⟨j, (mem_repeatedBigAuxCut A B g j).mpr (mem_union_left B hx)⟩ rw [physical_aux_cut_transport_apply] · exact (hU g j (mem_union_left B hx)).elim theorem repeated_big_prime_coefficient_swap {G : Type} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex G J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A ∪ B) (hU' : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ B ∪ A) (hAB : Disjoint A B) (Q : ℕ) (h : ℝ) (keptA keptB : Finset ℤ) (L R : RepeatedBigLists P J ell) (a : PhysicalAuxLabels P (repeatedBigAuxCut A B)) : repeatedBigPrimeCoefficient P V B A hU' hAB.symm Q h keptB keptA L R (physicalAuxCutTransport (repeated_big_aux_cut_swap A B).symm a) = repeatedBigPrimeCoefficient P V A B hU hAB Q h keptA keptB R L a := by unfold repeatedBigPrimeCoefficient rw [repeated_big_aux_split_swap P A B hU hU' hAB a] exact mul_comm _ _ theorem repeated_big_prime_pattern_swap_kernel {G : Type} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h : ℝ) (kept : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (L R : RepeatedBigLists P J ell) (a : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) : repeatedBigPrimePatternKernel P V probes t r hrt.symm Q h kept (repeatedBigPrimePatternSwapEquiv probes r t i) L R (physicalAuxCutTransport (repeated_big_prime_pattern_swap_cut probes r t i).symm a) = repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i R L a := by cases i with | inl u => rfl | inr ab => exact repeated_big_prime_coefficient_swap P V ab.1.val ab.2.val _ _ _ Q h (kept ab.1.val) (kept ab.2.val) L R a theorem repeated_big_prime_pattern_swap_weighted_kernel {G : Type} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h : ℝ) (kept : Finset (RepeatedBigFlatIndex G J ell) → Finset ℤ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (L R : RepeatedBigLists P J ell) (a : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) : repeatedBigPrimePatternWeight probes t r (repeatedBigPrimePatternSwapEquiv probes r t i) * repeatedBigPrimePatternKernel P V probes t r hrt.symm Q h kept (repeatedBigPrimePatternSwapEquiv probes r t i) L R (physicalAuxCutTransport (repeated_big_prime_pattern_swap_cut probes r t i).symm a) = repeatedBigPrimePatternWeight probes r t i * repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i R L a := congrArg₂ (fun z w : ℂ => z * w) (repeated_big_prime_pattern_swap_weight probes r t i) (repeated_big_prime_pattern_swap_kernel P V probes r t hrt Q h kept i L R a) end Bounty end section /- The even full prime row is complex conjugation of the ordinary swapped pattern family. This preserves the supplied displacement, all weights, and gates. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Finset ℕ} {J ell B : ℕ} omit [Fintype G] [DecidableEq G] in private theorem aux_cut_transport_inverse {C D : G → Finset (Fin J)} (h : C = D) (a : PhysicalAuxLabels P C) : physicalAuxCutTransport h.symm (physicalAuxCutTransport h a) = a := by subst D rfl private theorem coefficient_kernel_cut_transport {C D : G → Finset (Fin J)} (hcut : C = D) (k : ℤ) (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (initial : ∀ g, Finset (P g)) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P D → ℂ) (ζ θ : ℝ) (Fs : ∀ g, Finset (Ps g)) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : physicalMixedCoefficientAction C k V baseline ρ Vs q initial (fun a y e => K (physicalMixedRepeatedLabels C y.2) (physicalMixedRepeatedLabels C (physicalMixedCoefficientTarget C k a y e).2) (physicalAuxCutTransport hcut a) * physicalMixedFullResidualPhase C ζ θ k cleanMixedSourceGate (cleanMixedTargetGate Fs) a y e) f = physicalMixedCoefficientAction D k V baseline ρ Vs q initial (fun a y e => K (physicalMixedRepeatedLabels D y.2) (physicalMixedRepeatedLabels D (physicalMixedCoefficientTarget D k a y e).2) a * physicalMixedFullResidualPhase D ζ θ k cleanMixedSourceGate (cleanMixedTargetGate Fs) a y e) f := by subst D rfl theorem physical_mixed_signed_prime_even_eq_conj_swapped (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ : ℝ) (Vs : S → ℝ) (q : ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ ζ θ : ℝ) (time : ℕ) (htime : time % 2 = 0) (k : ℤ) (initial : ∀ g, Finset (P g)) (Fs : ∀ g, Finset (Ps g)) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) : physicalMixedSignedPrimePatternAction V baseline ρ Vs q probes r t hrt Q h ξ time k initial (fun i => physicalMixedFullResidualPhase (repeatedBigPrimePatternCut probes r t i) ζ θ k cleanMixedSourceGate (cleanMixedTargetGate Fs)) f = fun s => (starRingEnd ℂ) (physicalMixedPrimePatternAction V baseline ρ Vs q probes t r hrt.symm Q h ξ k initial (fun i => physicalMixedFullResidualPhase (repeatedBigPrimePatternCut probes t r i) (-ζ) (-θ) k cleanMixedSourceGate (cleanMixedTargetGate Fs)) (fun y => (starRingEnd ℂ) (f y)) s) := by funext s rw [physical_mixed_signed_prime_pattern_action_of_even V baseline ρ Vs q probes r t hrt Q h ξ time htime k initial] symm simp only [physicalMixedPrimePatternAction, Finset.sum_apply, map_sum] rw [← (repeatedBigPrimePatternSwapEquiv (ell := ell) probes r t).sum_comp] apply sum_congr rfl intro i _ rw [physical_mixed_coefficient_action_conj] have hstar (z : ℂ) : (starRingEnd ℂ) ((starRingEnd ℂ) z) = z := star_star z simp only [map_mul, physical_mixed_concrete_residual_conj, neg_neg, hstar] let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ let hcut := repeated_big_prime_pattern_swap_cut (ell := ell) probes r t i let K := fun (L R : RepeatedBigLists P J ell) (a : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) => (starRingEnd ℂ) (repeatedBigPrimePatternWeight probes r t i * repeatedBigPrimePatternKernel P V probes r t hrt Q h kept i R L a) have hK (L R : RepeatedBigLists P J ell) (a : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes t r (repeatedBigPrimePatternSwapEquiv probes r t i))) : (starRingEnd ℂ) (repeatedBigPrimePatternWeight probes t r (repeatedBigPrimePatternSwapEquiv probes r t i)) * (starRingEnd ℂ) (repeatedBigPrimePatternKernel P V probes t r hrt.symm Q h kept (repeatedBigPrimePatternSwapEquiv probes r t i) L R a) = K L R (physicalAuxCutTransport hcut a) := by have hb := repeated_big_prime_pattern_swap_weighted_kernel P V probes r t hrt Q h kept i L R (physicalAuxCutTransport hcut a) rw [aux_cut_transport_inverse] at hb simpa only [K, map_mul] using congrArg (starRingEnd ℂ) hb trans physicalMixedCoefficientAction (repeatedBigPrimePatternCut probes t r (repeatedBigPrimePatternSwapEquiv probes r t i)) k V baseline ρ Vs q initial (fun a y e => K (physicalMixedRepeatedLabels (repeatedBigPrimePatternCut probes t r (repeatedBigPrimePatternSwapEquiv probes r t i)) y.2) (physicalMixedRepeatedLabels (repeatedBigPrimePatternCut probes t r (repeatedBigPrimePatternSwapEquiv probes r t i)) (physicalMixedCoefficientTarget (repeatedBigPrimePatternCut probes t r (repeatedBigPrimePatternSwapEquiv probes r t i)) k a y e).2) (physicalAuxCutTransport hcut a) * physicalMixedFullResidualPhase (repeatedBigPrimePatternCut probes t r (repeatedBigPrimePatternSwapEquiv probes r t i)) ζ θ k cleanMixedSourceGate (cleanMixedTargetGate Fs) a y e) f s · congr 1 funext a y e exact congrArg (fun z : ℂ => z * physicalMixedFullResidualPhase (repeatedBigPrimePatternCut probes t r (repeatedBigPrimePatternSwapEquiv probes r t i)) ζ θ k cleanMixedSourceGate (cleanMixedTargetGate Fs) a y e) (hK _ _ a) · simpa only [K, map_mul] using congrFun (coefficient_kernel_cut_transport hcut k V baseline ρ Vs q initial K ζ θ Fs f) s end end Bounty end section /- The actual candidate full norm bound for both chronological parities. The ordinary analytic bound already includes the dirty contribution. -/ open Finset Filter open scoped Topology BigOperators Classical namespace Bounty.WeakZeroFree end Bounty.WeakZeroFree end end section /- Root Fourier bridge bodies on the coherent actual-Z dependency boundary. -/ section -- Original source module: DeterministicLedgerPhaseMultiplication /- History and current-event phases multiply inside the same deterministic ledger. -/ namespace Bounty section Multiplication variable {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) theorem deterministic_ledger_phase_mul (a b : ∀ k, L → (x : X) → E k x → ℂ) (ks : List K) (l : L) (x : X) (p : FiniteEventPath E target ks x) : deterministicLedgerPhase E target update (fun k l x e => a k l x e * b k l x e) ks l x p = deterministicLedgerPhase E target update a ks l x p * deterministicLedgerPhase E target update b ks l x p := by induction ks generalizing l x with | nil => simp only [deterministicLedgerPhase, mul_one] | cons k ks ih => rcases p with ⟨e, p⟩ simp only [deterministicLedgerPhase, ih] ring theorem deterministic_ledger_phase_mul_local (a : ∀ k, L → (x : X) → E k x → ℂ) (b : ∀ k x, E k x → ℂ) (ks : List K) (l : L) (x : X) (p : FiniteEventPath E target ks x) : deterministicLedgerPhase E target update (fun k l x e => a k l x e * b k x e) ks l x p = deterministicLedgerPhase E target update a ks l x p * finiteEventLocalPhase E target b ks x p := by rw [deterministic_ledger_phase_mul, deterministic_ledger_local_phase] end Multiplication end Bounty end section -- Original source module: PhysicalFullCombinedPhase /- The original birth-history phase and original coefficient share one local phase on the existing deterministic birth ledger. -/ open scoped Classical namespace Bounty section Combined variable {I K : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ζ : K → ℝ) (coeff : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) noncomputable def physicalFullCombinedPhase (tag : Option (I ⊕ K)) (H : (g : Fin N) → Finset (P g)) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent C k tag (H, x)) : ℂ := physicalFullLedgerEventPhase C k ω β ρ V tag (H, x) e * physicalFullKeyCoefficientPhase C k ζ coeff tag x e theorem physical_full_combined_history (steps : List (Option (I ⊕ K))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps x) : deterministicLedgerPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullMixedLedgerUpdate (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (physicalFullCombinedPhase C k ω β ρ V ζ coeff) steps (fullActiveInitialLedger x) x p = physicalFullHistoryPhase C k ω β ρ V steps x p * finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (physicalFullKeyCoefficientPhase C k ζ coeff) steps x p := by unfold physicalFullCombinedPhase physicalFullHistoryPhase exact deterministic_ledger_phase_mul_local _ _ _ _ _ steps (fullActiveInitialLedger x) x p end Combined end Bounty end section -- Original source module: PhysicalRootEffectiveHistory /- The actual root remainder is one deterministic birth-ledger phase, including its original local coefficient. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (ρ : ℝ) noncomputable def physicalRootEffectiveLocalPhase := let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) physicalFullCombinedPhase (I := Fin (n + 2)) (B := B) Cb kb (fun key _ aux => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) aux) β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) noncomputable def physicalRootEffectiveHistory (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x) : ℂ := let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) deterministicLedgerPhase (FullPermutationMixedEvent (fun g (p : P (e.symm g).val) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (Cb key g)) B (fun key _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) (fun key => physicalFullEdgeDelta (Cb key) (kb key)) (fun key => physicalFullEdgeD (Cb key))) (fullPermutationMixedEventTarget (fun g (p : P (e.symm g).val) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (Cb key g)) B (fun key _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) (fun key => physicalFullEdgeDelta (Cb key) (kb key)) (fun key => physicalFullEdgeD (Cb key))) (fullMixedLedgerUpdate (fun g (p : P (e.symm g).val) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (Cb key g)) B (fun key _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) (fun key => physicalFullEdgeDelta (Cb key) (kb key)) (fun key => physicalFullEdgeD (Cb key))) (physicalRootEffectiveLocalPhase (n := n) groups e patterns C hC k V ζ K θ β ρ) (physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2) (fullActiveInitialLedger x) x path theorem physical_root_effective_remainder_history (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x) : physicalRootEffectiveRemainder groups e patterns C hC k pl V ζ K θ β ρ x path = physicalRootEffectiveHistory groups e patterns C hC k V ζ K θ β ρ pl x path := by unfold physicalRootEffectiveRemainder physicalRootEffectiveHistory physicalRootEffectiveLocalPhase physicalEffectivePlanCoefficientPhase dsimp only exact (physical_full_combined_history _ _ _ _ _ _ _ _ _ x path).symm end Root end Bounty end section -- Original source module: PhysicalFullCombinedBirthPhase /- The original combined root phase has exactly the physical birth factor. Its empty-ledger extension is a local coefficient on the original event. -/ open scoped Classical namespace Bounty section Combined variable {I K : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ζ : K → ℝ) (coeff : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) noncomputable def physicalFullCombinedEdgePhase (j : K) (H : (g : Fin N) → Finset (P g)) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullEdgeEvent (C j) (k j) x) : ℂ := physicalFullGlobalEdgePhase (C j) (k j) H (ω j) (fun g p => β g p / V g) ρ V x e * physicalActiveCoefficient (C j) (C j) (C j) (ζ j) (coeff j) (fun g => (x g).1) (fun g => (fullActiveEdgeEventTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun _ => PhysicalAuxLabels P (C j)) (physicalFullEdgeDelta (C j) (k j)) (physicalFullEdgeD (C j)) x e g).1) e.1 theorem physical_full_combined_phase_eq_ledger (tag : Option (I ⊕ K)) (H : (g : Fin N) → Finset (P g)) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent C k tag (H,x)) : physicalFullCombinedPhase C k ω β ρ V ζ coeff tag H x e = fullMixedLedgerPhase (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) (physicalFullCombinedEdgePhase C k ω β ρ V ζ coeff) tag (H,x) e := by cases tag with | none => simp only [physicalFullCombinedPhase, physicalFullKeyCoefficientPhase, mul_one]; rfl | some tag => cases tag with | inl j => simp only [physicalFullCombinedPhase, physicalFullKeyCoefficientPhase, mul_one]; rfl | inr j => rfl theorem physical_full_combined_edge_birth_factor (j : K) (H : (g : Fin N) → Finset (P g)) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullEdgeEvent (C j) (k j) x) : physicalFullCombinedEdgePhase C k ω β ρ V ζ coeff j H x e = (if FullMixedLocalBirthAvoids (J := I) (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) H (some (.inr j)) x e ∧ FullMixedLocalBirthDistinct (J := I) (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) (some (.inr j)) x e then 1 else 0) * physicalFullCombinedEdgePhase C k ω β ρ V ζ coeff j (fun _ => ∅) x e := by erw [full_mixed_edge_birth_avoids_iff, full_mixed_edge_birth_distinct_iff] unfold physicalFullCombinedEdgePhase rw [physical_full_global_birth_factor (C j) (k j) H (ω j) (fun g p => β g p / V g) ρ V x e] rw [mul_assoc] split_ifs <;> rfl end Combined end Bounty end section -- Original source module: PhysicalFullCombinedInduced /- The exact original combined history is the induced physical ledger phase used by the existing common-address forest expansion. -/ open scoped Classical namespace Bounty section Combined variable {I K : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ζ : K → ℝ) (coeff : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) noncomputable def physicalFullCombinedInducedPhase (steps : List (Option (I ⊕ K))) := fullMixedLedgerInducedPhase (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps fullActiveInitialLedger (finiteEventLocalPhase (PhysicalFullLedgerEvent C k) (physicalFullLedgerEventTarget C k) (fullMixedLedgerPhase (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) (physicalFullCombinedEdgePhase C k ω β ρ V ζ coeff)) steps) theorem physical_full_combined_induced (steps : List (Option (I ⊕ K))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps x) : deterministicLedgerPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (fullMixedLedgerUpdate (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j))) (physicalFullCombinedPhase C k ω β ρ V ζ coeff) steps (fullActiveInitialLedger x) x p = physicalFullCombinedInducedPhase C k ω β ρ V ζ coeff steps x p := by have hphase : (fun tag (s : FullMixedLedgerState (fun g (p : P g) => p.val) (M := fun _ => J + ell) B) e => physicalFullCombinedPhase C k ω β ρ V ζ coeff tag s.1 s.2 e) = fullMixedLedgerPhase (J := I) (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) (physicalFullCombinedEdgePhase C k ω β ρ V ζ coeff) := by funext tag s e exact physical_full_combined_phase_eq_ledger C k ω β ρ V ζ coeff tag s.1 s.2 e rw [deterministic_ledger_phase_eq_lifted, hphase] rfl end Combined end Bounty end section -- Original source module: PhysicalRootEffectiveInduced /- The original root remainder is exactly the combined induced phase used by common birth-forest restoration, before small-plan averaging. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (ρ : ℝ) theorem physical_root_effective_remainder_induced (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x) : let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 physicalRootEffectiveRemainder groups e patterns C hC k pl V ζ K θ β ρ x path = physicalFullCombinedInducedPhase Cb kb (fun key _ aux => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) aux) β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) steps x path := by dsimp only rw [physical_root_effective_remainder_history] unfold physicalRootEffectiveHistory physicalRootEffectiveLocalPhase dsimp only exact physical_full_combined_induced _ _ _ _ _ _ _ _ _ x path end Root end Bounty end section -- Original source module: PhysicalFullCombinedForests /- The literal weighted combined phase is restored from common birth forests. Global distinctness is outside the local residual operators. -/ open Finset open scoped Classical namespace Bounty section Combined variable {I K Ω : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (q : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ζ : K → ℝ) (coeff : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (steps : List (Option (I ⊕ K))) theorem physical_full_combined_forest_expansion (paths : Finset Ω) (x : Ω → PhysicalFullBoundedState P J ell B) (p : ∀ a, FullPermutationMixedPath (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) steps (x a)) (hx : ∀ a ∈ paths, FullActiveInjective (x a)) (hcover : ∀ a ∈ paths, FullMixedLedgerCovers (fun g (p : P g) => p.val) B (fullActiveInitialLedger (x a), x a)) (F : Ω → ℂ) (encode : ((g : Fin N) × P g) → ℤ) (hinj : Function.Injective encode) : let sizes := fun g (p : P g) => p.val let shared := fun j g => physicalFullSharedIndices (ell := ell) (C j g) let aux := fun j (_ : SharedActiveLabels (fun g => ↥(P g)) (shared j)) => PhysicalAuxLabels P (C j) let delta := fun j => physicalFullEdgeDelta (C j) (k j) let displacement := fun j => physicalFullEdgeD (C j) (∑ a ∈ paths, F a * (finiteEventPathWeight (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) (fullPermutationMixedEventWeight sizes shared B aux delta displacement ω (fun g p => β g p / V g) q ρ V) steps (x a) (p a) : ℂ) * physicalFullCombinedInducedPhase C k ω β ρ V ζ coeff steps (x a) (p a)) = ∑ code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B steps)), (-1 : ℂ) ^ birthForestRank code * birthForestPathSum paths (fun a => F a * fullMixedCommonResidualWeight sizes shared B aux delta displacement (physicalFullCombinedEdgePhase C k ω β ρ V ζ coeff) ω (fun g p => β g p / V g) q ρ V steps (x a) (p a)) (fun a => fullMixedCommonIndexedPerformed sizes shared B aux delta displacement steps (x a) (p a)) (fun a => fullMixedCommonIndexedValue sizes shared B aux delta displacement steps encode (x a) (p a)) code := by dsimp only exact full_mixed_common_ledger_forest_expansion (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) B (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) (physicalFullCombinedEdgePhase C k ω β ρ V ζ coeff) ω (fun g p => β g p / V g) q ρ V steps (physical_full_combined_edge_birth_factor C k ω β ρ V ζ coeff) paths x p hx hcover F encode hinj end Combined end Bounty end section -- Original source module: PhysicalRootEffectiveForests /- The original fixed-plan root contribution is the exact signed sum of common birth forests. Its local residual has no cumulative ledger argument. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootEffectiveForestAction (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B (physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2)))) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ℂ := let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalFullEdgeDelta (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) (kb key) let displacement := fun key => physicalFullEdgeD (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) let omega := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) a let _ := fullPermutationMixedEventFintype (J := Fin (n + 2)) sizes shared B aux delta displacement let _ := finiteEventPathFintype (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x birthForestPathSum univ (fun path => physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x path * f (finiteEventPathTerminal (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x path) * fullMixedCommonResidualWeight sizes shared B aux delta displacement (physicalFullCombinedEdgePhase Cb kb omega β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ)) omega (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) steps x path) (fullMixedCommonIndexedPerformed sizes shared B aux delta displacement steps x) (fun path i => fullMixedCommonBirthLabel sizes shared B aux delta displacement steps x path (fullMixedCommonBirthOrder (fun _ : Fin M => J + ell) B steps i)) code theorem physical_root_effective_path_sum_forests (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (hinj : Function.Injective encode) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (hx : FullActiveInjective x) (hcover : FullMixedLedgerCovers (fun g (p : P (e.symm g).val) => p.val) B (fullActiveInitialLedger x, x)) : physicalRootEffectivePathSum groups e patterns C hC k pl V q ζ K r θ β retention ρ f x = ∑ code, (-1 : ℂ) ^ birthForestRank code * physicalRootEffectiveForestAction groups e patterns C hC k pl V q ζ K r θ β retention ρ code f x := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalFullEdgeDelta (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) (kb key) let displacement := fun key => physicalFullEdgeD (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) let omega := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) a let _ := fullPermutationMixedEventFintype (J := Fin (n + 2)) sizes shared B aux delta displacement let _ := finiteEventPathFintype (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x let F := fun path : FullPermutationMixedPath sizes shared B aux delta displacement steps x => physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x path * f (finiteEventPathTerminal (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x path) have h := physical_full_combined_forest_expansion Cb kb omega β retention ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) steps univ (fun _ : FullPermutationMixedPath sizes shared B aux delta displacement steps x => x) (fun path => path) (fun _ _ => hx) (fun _ _ => hcover) F encode hinj dsimp only at h calc _ = ∑ path : FullPermutationMixedPath sizes shared B aux delta displacement steps x, F path * (finiteEventPathWeight (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) (fullPermutationMixedEventWeight sizes shared B aux delta displacement omega (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val)) steps x path : ℂ) * physicalFullCombinedInducedPhase Cb kb omega β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) steps x path := by rw [physical_root_effective_path_action] unfold fullPermutationMixedPathAction finiteEventPathAction apply sum_congr · exact congrArg (fun inst : Fintype _ => @Finset.univ _ inst) (Subsingleton.elim _ _) · intro path _ rw [physical_root_effective_phase_factor, physical_root_effective_remainder_induced] dsimp only [F] ring _ = _ := by rw [h] apply sum_congr rfl intro code _ apply congrArg (fun z : ℂ => (-1 : ℂ) ^ birthForestRank code * z) unfold physicalRootEffectiveForestAction birthForestPathSum apply sum_congr rfl intro path _ have hc := optional_forest_encoding_iff (fullMixedCommonIndexedPerformed sizes shared B aux delta displacement steps x path) (fun i => fullMixedCommonBirthLabel sizes shared B aux delta displacement steps x path (fullMixedCommonBirthOrder (fun _ : Fin M => J + ell) B steps i)) (fun _ h => h) encode hinj code change birthForestCompatible _ (fullMixedCommonIndexedValue sizes shared B aux delta displacement steps encode x path) code ↔ _ at hc rw [hc] end Root end Bounty end section -- Original source module: FullMixedCommonShape /- Common birth addresses depend only on the capacities at each stage, not on the decorated edge key or the chosen pattern. -/ namespace Bounty section Shape variable {I K : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) abbrev FullMixedCommonShapeData (N : ℕ) := (n : ℕ) × (Fin n → Fin N → ℕ) def fullMixedCommonShape (steps : List (Option (I ⊕ K))) : FullMixedCommonShapeData N := ⟨steps.length, fun i => fullMixedCommonCapacity M B (steps.get i)⟩ def fullMixedCommonShapeCons (c : Fin N → ℕ) (s : FullMixedCommonShapeData N) : FullMixedCommonShapeData N := ⟨s.1 + 1, Fin.cases c s.2⟩ theorem full_mixed_common_shape_cons (tag : Option (I ⊕ K)) (steps : List (Option (I ⊕ K))) : fullMixedCommonShape M B (tag :: steps) = fullMixedCommonShapeCons (fullMixedCommonCapacity M B tag) (fullMixedCommonShape M B steps) := by apply congrArg (Sigma.mk (steps.length + 1)) funext i refine Fin.cases ?_ (fun j => ?_) i <;> rfl abbrev FullMixedCommonShapeAddress (s : FullMixedCommonShapeData N) := FullMixedCommonInitialAddress M ⊕ ((i : Fin s.1) × ((g : Fin N) × Fin (s.2 i g))) theorem full_mixed_common_address_eq_of_shape {I' K' : Type*} (steps : List (Option (I ⊕ K))) (steps' : List (Option (I' ⊕ K'))) (h : fullMixedCommonShape M B steps = fullMixedCommonShape M B steps') : FullMixedCommonBirthAddress M B steps = FullMixedCommonBirthAddress M B steps' := congrArg (FullMixedCommonShapeAddress M) h end Shape end Bounty end section -- Original source module: PhysicalMixedCommonShape /- Fixing a small plan does not change the common birth-slot shape. -/ namespace Bounty section Shape variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell N : ℕ} (M : Fin N → ℕ) (B : ℕ) theorem physical_mixed_big_common_shape (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ks) : fullMixedCommonShape M B (physicalMixedBigSteps ks L pl) = fullMixedCommonShape M B ks := by induction ks generalizing L with | nil => apply congrArg (Sigma.mk 0) funext i exact Fin.elim0 i | cons tag ks ih => cases tag with | none => rcases pl with ⟨σ, pl⟩ simp only [physicalMixedBigSteps, full_mixed_common_shape_cons] exact congrArg (fullMixedCommonShapeCons (fun _ => 0)) (ih _ pl) | some tag => cases tag with | inl j => simp only [physicalMixedBigSteps, full_mixed_common_shape_cons] exact congrArg (fullMixedCommonShapeCons (fun _ => B)) (ih _ pl) | inr k => rcases pl with ⟨⟨i, R⟩, pl⟩ simp only [physicalMixedBigSteps, full_mixed_common_shape_cons] exact congrArg (fullMixedCommonShapeCons M) (ih _ pl) theorem physical_mixed_big_common_address (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ks) : FullMixedCommonBirthAddress M B (physicalMixedBigSteps ks L pl) = FullMixedCommonBirthAddress M B ks := full_mixed_common_address_eq_of_shape M B _ _ (physical_mixed_big_common_shape M B ks L pl) end Shape end Bounty end section -- Original source module: FullMixedCommonShapeOrder /- The existing chronological enumeration is also a function only of stage capacities. This keeps one forest index through small-plan summation. -/ namespace Bounty section Shape variable {N : ℕ} (M : Fin N → ℕ) abbrev FullMixedCommonShapeLexAddress (s : FullMixedCommonShapeData N) := Lex ((Lex ((g : Fin N) × Fin (M g))) ⊕ (Lex ((i : Fin s.1) × Lex ((g : Fin N) × Fin (s.2 i g))))) def fullMixedCommonShapeLexEquiv (s : FullMixedCommonShapeData N) : FullMixedCommonShapeLexAddress M s ≃ FullMixedCommonShapeAddress M s where toFun a := match ofLex a with | .inl b => .inl (ofLex b) | .inr b => .inr ⟨(ofLex b).1, ofLex (ofLex b).2⟩ invFun a := toLex (match a with | .inl b => .inl (toLex b) | .inr b => .inr (toLex ⟨b.1, toLex b.2⟩)) left_inv a := by cases a <;> rfl right_inv a := by cases a <;> rfl noncomputable def fullMixedCommonShapeOrder (s : FullMixedCommonShapeData N) : Fin (Fintype.card (FullMixedCommonShapeAddress M s)) ≃ FullMixedCommonShapeAddress M s := (Fintype.orderIsoFinOfCardEq (FullMixedCommonShapeLexAddress M s) (Fintype.card_congr (fullMixedCommonShapeLexEquiv M s))).toEquiv.trans (fullMixedCommonShapeLexEquiv M s) theorem full_mixed_common_order_shape {I K : Type*} (B : ℕ) (steps : List (Option (I ⊕ K))) : fullMixedCommonBirthOrder M B steps = fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps) := by unfold fullMixedCommonBirthOrder fullMixedCommonShapeOrder congr 1 apply Equiv.ext intro a cases a <;> rfl end Shape end Bounty end section -- Original source module: PhysicalMixedCommonForests /- The fixed-plan and original schedules use the same forest code space and the same chronological order, preserving each forest rank. -/ open scoped Classical namespace Bounty section Shape variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell N : ℕ} (M : Fin N → ℕ) (B : ℕ) (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ks) theorem physical_mixed_big_common_card : Fintype.card (FullMixedCommonBirthAddress M B (physicalMixedBigSteps ks L pl)) = Fintype.card (FullMixedCommonBirthAddress M B ks) := Fintype.card_congr (Equiv.cast (physical_mixed_big_common_address M B ks L pl)) noncomputable def physicalMixedCommonForestEquiv : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B (physicalMixedBigSteps ks L pl))) ≃ BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B ks)) := Equiv.cast (congrArg BirthForestCode (physical_mixed_big_common_card M B ks L pl)) theorem birth_forest_rank_cast {m n : ℕ} (h : m = n) (code : BirthForestCode m) : birthForestRank ((Equiv.cast (congrArg BirthForestCode h)) code) = birthForestRank code := by cases h rfl theorem physical_mixed_common_forest_rank (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B ks))) : birthForestRank ((physicalMixedCommonForestEquiv M B ks L pl).symm code) = birthForestRank code := birth_forest_rank_cast (physical_mixed_big_common_card M B ks L pl).symm code end Shape end Bounty end section -- Original source module: PhysicalMixedCommonForestSum /- Signed forest reindexing preserves the coefficient before any norm is taken. -/ open scoped Classical namespace Bounty section Shape variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell N : ℕ} (M : Fin N → ℕ) (B : ℕ) (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ks) theorem physical_mixed_common_forest_sum (F : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B (physicalMixedBigSteps ks L pl))) → ℂ) : (∑ code, (-1 : ℂ) ^ birthForestRank code * F code) = ∑ code, (-1 : ℂ) ^ birthForestRank code * F ((physicalMixedCommonForestEquiv M B ks L pl).symm code) := by calc _ = ∑ code, (-1 : ℂ) ^ birthForestRank ((physicalMixedCommonForestEquiv M B ks L pl).symm code) * F ((physicalMixedCommonForestEquiv M B ks L pl).symm code) := (Equiv.sum_comp (physicalMixedCommonForestEquiv M B ks L pl).symm (fun code => (-1 : ℂ) ^ birthForestRank code * F code)).symm _ = _ := by apply Finset.sum_congr rfl intro code _ rw [physical_mixed_common_forest_rank] end Shape end Bounty end section -- Original source module: PhysicalRootCommonForests /- The fixed-plan root forest expansion uses one plan-independent forest index. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) abbrev PhysicalRootCommonForestCode := BirthForestCode (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) noncomputable def physicalRootCommonForestAction (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ℂ := physicalRootEffectiveForestAction groups e patterns C hC k pl V q ζ K r θ β retention ρ ((physicalMixedCommonForestEquiv (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2).symm code) f x theorem physical_root_effective_common_forests (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (hinj : Function.Injective encode) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (hx : FullActiveInjective x) (hcover : FullMixedLedgerCovers (fun g (p : P (e.symm g).val) => p.val) B (fullActiveInitialLedger x, x)) : physicalRootEffectivePathSum groups e patterns C hC k pl V q ζ K r θ β retention ρ f x = ∑ code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B), (-1 : ℂ) ^ birthForestRank code * physicalRootCommonForestAction groups e patterns C hC k pl V q ζ K r θ β retention ρ code f x := by rw [physical_root_effective_path_sum_forests groups e patterns C hC k pl V q ζ K r θ β retention ρ encode hinj f x hx hcover] exact physical_mixed_common_forest_sum (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 (fun code => physicalRootEffectiveForestAction groups e patterns C hC k pl V q ζ K r θ β retention ρ code f x) end Root end Bounty end section -- Original source module: FullMixedShapeStage /- Common forest ownership depends only on the stage-capacity shape. -/ namespace Bounty section Stage variable {N : ℕ} (M : Fin N → ℕ) noncomputable def fullMixedShapeIndexStage (s : FullMixedCommonShapeData N) (i : Fin (Fintype.card (FullMixedCommonShapeAddress M s))) : Fin (s.1 + 1) := match fullMixedCommonShapeOrder M s i with | .inl _ => 0 | .inr a => a.1.succ theorem full_mixed_index_stage_shape {I K : Type*} (B : ℕ) (steps : List (Option (I ⊕ K))) : fullMixedCommonIndexStage M B steps = fullMixedShapeIndexStage M (fullMixedCommonShape M B steps) := by funext i unfold fullMixedCommonIndexStage fullMixedShapeIndexStage rw [full_mixed_common_order_shape] cases fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps) i <;> rfl end Stage end Bounty end section -- Original source module: FullMixedCommonLocalMultiplier /- A common forest operation multiplier reads only the optional prime labels at its own original event slots. -/ open Classical namespace Bounty section Local variable {J K Z : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) noncomputable def fullMixedCommonOwnerLabels (u : Fin steps.length) (label : FullMixedCommonLocalAddress M B (steps.get u) → Option Z) (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) : Option Z := match fullMixedCommonBirthOrder M B steps i with | .inl _ => none | .inr a => if h : a.1 = u then label (cast (congrArg (fun v : Fin steps.length => FullMixedCommonLocalAddress M B (steps.get v)) h) a.2) else none noncomputable def fullMixedCommonLocalOperationMultiplier (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Z → ℤ) (u : Fin steps.length) (label : FullMixedCommonLocalAddress M B (steps.get u) → Option Z) : ℂ := birthForestOperationMultiplier code (fullMixedCommonIndexStage M B steps) θ (fun i => (fullMixedCommonOwnerLabels M B steps u label i).isSome = true) (fun i => ((fullMixedCommonOwnerLabels M B steps u label i).map encode).getD 0) u.succ theorem full_mixed_common_local_multiplier_norm_le (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Z → ℤ) (u : Fin steps.length) (label : FullMixedCommonLocalAddress M B (steps.get u) → Option Z) : ‖fullMixedCommonLocalOperationMultiplier M B steps code θ encode u label‖ ≤ 1 := birthForestOperationMultiplier_norm_le_one _ _ _ _ _ _ theorem full_mixed_common_local_multiplier_untouched (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Z → ℤ) (u : Fin steps.length) (label : FullMixedCommonLocalAddress M B (steps.get u) → Option Z) (hu : u.succ ∉ birthForestAffectedOperations code (fullMixedCommonIndexStage M B steps)) : fullMixedCommonLocalOperationMultiplier M B steps code θ encode u label = 1 := birthForestOperationMultiplier_eq_one _ _ _ _ _ _ hu end Local section Original variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : (g : Fin N) → P g → ℕ) (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) end Original end Bounty end section -- Original source module: FullMixedCommonPathMultiplier /- Each common Fourier operation factor is the exact multiplier of the actual source/event occurrence on the original path. -/ namespace Bounty section Path variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : (g : Fin N) → P g → ℕ) (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) theorem full_mixed_common_owner_labels_on_path (u : Fin steps.length) (i : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) (hi : fullMixedCommonIndexStage M B steps i = u.succ) : let e := finiteEventPathOccurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x p u fullMixedCommonOwnerLabels M B steps u (fullMixedCommonEventBirthLabel n S B A Δ D (steps.get u) e.1 e.2) i = fullMixedCommonBirthLabel n S B A Δ D steps x p (fullMixedCommonBirthOrder M B steps i) := by obtain ⟨a, ha⟩ := (full_mixed_common_index_stage_succ_iff M B steps u i).mp hi dsimp only unfold fullMixedCommonOwnerLabels rw [ha] simp only [cast_eq, full_mixed_common_new_label] exact (full_mixed_common_path_label_occurrence n S B A Δ D steps x p u a).symm theorem full_mixed_common_local_multiplier_on_path (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Sigma P → ℤ) (u : Fin steps.length) : let e := finiteEventPathOccurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x p u fullMixedCommonLocalOperationMultiplier M B steps code θ encode u (fullMixedCommonEventBirthLabel n S B A Δ D (steps.get u) e.1 e.2) = birthForestOperationMultiplier code (fullMixedCommonIndexStage M B steps) θ (fullMixedCommonIndexedPerformed n S B A Δ D steps x p) (fullMixedCommonIndexedValue n S B A Δ D steps encode x p) u.succ := by dsimp only [fullMixedCommonLocalOperationMultiplier] apply birth_forest_operation_multiplier_congr_on_owner · intro i hi change (_ = true) ↔ (_ = true) rw [full_mixed_common_owner_labels_on_path n S B A Δ D steps x p u i hi] · intro i hi rw [full_mixed_common_owner_labels_on_path n S B A Δ D steps x p u i hi] rfl end Path end Bounty end section -- Original source module: FullMixedCommonBoundaryMultiplier /- The common initial-label phase stays at the boundary; all subsequent factors belong to their actual original events. -/ open Finset Classical namespace Bounty section Boundary variable {J K Z : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Z → ℤ) (initial : FullMixedCommonInitialAddress M → Z) noncomputable def fullMixedCommonBoundaryMultiplier : ℂ := birthForestOperationMultiplier code (fullMixedCommonIndexStage M B steps) θ (fun _ => True) (fun i => match fullMixedCommonBirthOrder M B steps i with | .inl a => encode (initial a) | .inr _ => 0) 0 theorem full_mixed_common_boundary_multiplier_norm_le : ‖fullMixedCommonBoundaryMultiplier M B steps code θ encode initial‖ ≤ 1 := birthForestOperationMultiplier_norm_le_one _ _ _ _ _ _ end Boundary section Original variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : (g : Fin N) → P g → ℕ) (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Sigma P → ℤ) theorem full_mixed_common_boundary_multiplier_on_path : fullMixedCommonBoundaryMultiplier M B steps code θ encode (fullMixedCommonInitialPrime x) = birthForestOperationMultiplier code (fullMixedCommonIndexStage M B steps) θ (fullMixedCommonIndexedPerformed n S B A Δ D steps x p) (fullMixedCommonIndexedValue n S B A Δ D steps encode x p) 0 := by apply birth_forest_operation_multiplier_congr_on_owner · intro i hi obtain ⟨a, ha⟩ := (full_mixed_common_index_stage_zero_iff M B steps i).mp hi change True ↔ (fullMixedCommonBirthLabel n S B A Δ D steps x p (fullMixedCommonBirthOrder M B steps i)).isSome = true rw [ha, full_mixed_common_initial_label] simp only [Option.isSome_some] · intro i hi obtain ⟨a, ha⟩ := (full_mixed_common_index_stage_zero_iff M B steps i).mp hi change (match fullMixedCommonBirthOrder M B steps i with | .inl a => encode (fullMixedCommonInitialPrime x a) | .inr _ => 0) = _ unfold fullMixedCommonIndexedValue rw [ha, full_mixed_common_initial_label] rfl theorem full_mixed_common_boundary_event_product : fullMixedCommonBoundaryMultiplier M B steps code θ encode (fullMixedCommonInitialPrime x) * (∏ u : Fin steps.length, let e := finiteEventPathOccurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x p u fullMixedCommonLocalOperationMultiplier M B steps code θ encode u (fullMixedCommonEventBirthLabel n S B A Δ D (steps.get u) e.1 e.2)) = if ∀ i ∈ birthForestTouched code, fullMixedCommonIndexedPerformed n S B A Δ D steps x p i then ∏ i, physicalReturnPhase (birthForestLocalFrequency code θ i) (fullMixedCommonIndexedValue n S B A Δ D steps encode x p i) else 0 := by simp_rw [full_mixed_common_local_multiplier_on_path n S B A Δ D steps x p code θ encode] rw [full_mixed_common_boundary_multiplier_on_path n S B A Δ D steps x p code θ encode, ← Fin.prod_univ_succ] exact birthForestOperationMultiplier_product _ _ _ _ _ end Original end Bounty end section -- Original source module: FullMixedShapeBoundary /- The initial Fourier multiplier depends only on the common birth shape, so fixing a small plan does not change its boundary factor. -/ namespace Bounty section Boundary variable {Z : Type*} {N : ℕ} (M : Fin N → ℕ) noncomputable def fullMixedShapeBoundaryMultiplier (s : FullMixedCommonShapeData N) (code : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M s))) (θ : (Fin (Fintype.card (FullMixedCommonShapeAddress M s)) × Fin (Fintype.card (FullMixedCommonShapeAddress M s))) → ℝ) (encode : Z → ℤ) (initial : FullMixedCommonInitialAddress M → Z) : ℂ := birthForestOperationMultiplier code (fullMixedShapeIndexStage M s) θ (fun _ => True) (fun i => match fullMixedCommonShapeOrder M s i with | .inl a => encode (initial a) | .inr _ => 0) 0 theorem full_mixed_boundary_multiplier_shape {I K : Type*} (B : ℕ) (steps : List (Option (I ⊕ K))) : fullMixedCommonBoundaryMultiplier (Z := Z) M B steps = fullMixedShapeBoundaryMultiplier M (fullMixedCommonShape M B steps) := by funext code θ encode initial unfold fullMixedCommonBoundaryMultiplier fullMixedShapeBoundaryMultiplier rw [full_mixed_index_stage_shape] congr 1 funext i rw [full_mixed_common_order_shape] cases fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps) i <;> rfl end Boundary end Bounty end section -- Original source module: FullMixedShapeLocal /- Local birth multipliers depend on stage capacities and their optional prime labels, with no dependence on the decorated edge key. -/ open Classical namespace Bounty section Local variable {Z : Type*} {N : ℕ} (M : Fin N → ℕ) abbrev FullMixedShapeLocalAddress (s : FullMixedCommonShapeData N) (u : Fin s.1) := (g : Fin N) × Fin (s.2 u g) noncomputable def fullMixedShapeOwnerLabels (s : FullMixedCommonShapeData N) (u : Fin s.1) (label : FullMixedShapeLocalAddress s u → Option Z) (i : Fin (Fintype.card (FullMixedCommonShapeAddress M s))) : Option Z := match fullMixedCommonShapeOrder M s i with | .inl _ => none | .inr a => if h : a.1 = u then label (cast (congrArg (FullMixedShapeLocalAddress s) h) a.2) else none noncomputable def fullMixedShapeLocalOperationMultiplier (s : FullMixedCommonShapeData N) (code : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M s))) (θ : (Fin (Fintype.card (FullMixedCommonShapeAddress M s)) × Fin (Fintype.card (FullMixedCommonShapeAddress M s))) → ℝ) (encode : Z → ℤ) (u : Fin s.1) (label : FullMixedShapeLocalAddress s u → Option Z) : ℂ := birthForestOperationMultiplier code (fullMixedShapeIndexStage M s) θ (fun i => (fullMixedShapeOwnerLabels M s u label i).isSome = true) (fun i => ((fullMixedShapeOwnerLabels M s u label i).map encode).getD 0) u.succ theorem full_mixed_owner_labels_shape {I K : Type*} (B : ℕ) (steps : List (Option (I ⊕ K))) (u : Fin steps.length) (label : FullMixedCommonLocalAddress M B (steps.get u) → Option Z) : fullMixedCommonOwnerLabels M B steps u label = fullMixedShapeOwnerLabels M (fullMixedCommonShape M B steps) u label := by funext i unfold fullMixedCommonOwnerLabels fullMixedShapeOwnerLabels rw [full_mixed_common_order_shape] cases fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps) i with | inl a => rfl | inr a => dsimp only split_ifs <;> first | rfl | contradiction theorem full_mixed_local_multiplier_shape {I K : Type*} (B : ℕ) (steps : List (Option (I ⊕ K))) : fullMixedCommonLocalOperationMultiplier (Z := Z) M B steps = fullMixedShapeLocalOperationMultiplier M (fullMixedCommonShape M B steps) := by funext code θ encode u label unfold fullMixedCommonLocalOperationMultiplier fullMixedShapeLocalOperationMultiplier rw [full_mixed_index_stage_shape, full_mixed_owner_labels_shape] rfl end Local end Bounty end section -- Original source module: BirthFourierCardTransport /- Identical finite birth cardinalities give an exact transport of the Fourier cube, including its integral. -/ open MeasureTheory namespace Bounty def birthFourierFrequencyCast {m n : ℕ} (h : m = n) (θ : (Fin n × Fin n) → ℝ) : (Fin m × Fin m) → ℝ := fun ij => θ (Fin.cast h ij.1, Fin.cast h ij.2) theorem birth_fourier_integral_card_transport {m n : ℕ} (h : m = n) (F : ((Fin m × Fin m) → ℝ) → ℂ) : (∫ θ, F θ ∂birthFourierCubeMeasure (Fin m × Fin m)) = ∫ θ, F (birthFourierFrequencyCast h θ) ∂birthFourierCubeMeasure (Fin n × Fin n) := by cases h rfl end Bounty end section -- Original source module: FullMixedShapeMultiplierCast /- Equal chronological birth shapes transport the code, Fourier frequency, boundary factor, and every local factor together. -/ namespace Bounty section Cast variable {Z : Type*} {N : ℕ} (M : Fin N → ℕ) def fullMixedShapeLocalAddressCast {s t : FullMixedCommonShapeData N} (h : s = t) (u : Fin s.1) : FullMixedShapeLocalAddress s u ≃ FullMixedShapeLocalAddress t (Fin.cast (congrArg Sigma.fst h) u) := by cases h exact Equiv.refl _ theorem full_mixed_shape_boundary_cast {s t : FullMixedCommonShapeData N} (h : s = t) (code : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M t))) (θ : (Fin (Fintype.card (FullMixedCommonShapeAddress M t)) × Fin (Fintype.card (FullMixedCommonShapeAddress M t))) → ℝ) (encode : Z → ℤ) (initial : FullMixedCommonInitialAddress M → Z) : fullMixedShapeBoundaryMultiplier M s (cast (congrArg (fun q => BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M q))) h.symm) code) (birthFourierFrequencyCast (congrArg (fun q => Fintype.card (FullMixedCommonShapeAddress M q)) h) θ) encode initial = fullMixedShapeBoundaryMultiplier M t code θ encode initial := by cases h rfl theorem full_mixed_shape_local_cast {s t : FullMixedCommonShapeData N} (h : s = t) (code : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M t))) (θ : (Fin (Fintype.card (FullMixedCommonShapeAddress M t)) × Fin (Fintype.card (FullMixedCommonShapeAddress M t))) → ℝ) (encode : Z → ℤ) (u : Fin s.1) (label : FullMixedShapeLocalAddress s u → Option Z) : fullMixedShapeLocalOperationMultiplier M s (cast (congrArg (fun q => BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M q))) h.symm) code) (birthFourierFrequencyCast (congrArg (fun q => Fintype.card (FullMixedCommonShapeAddress M q)) h) θ) encode u label = fullMixedShapeLocalOperationMultiplier M t code θ encode (Fin.cast (congrArg Sigma.fst h) u) (fun a => label ((fullMixedShapeLocalAddressCast h u).symm a)) := by cases h rfl end Cast end Bounty end section -- Original source module: PhysicalMixedShapeMultiplier /- The actual decorated big schedule uses the original common boundary and local multipliers after the canonical code and frequency transport. -/ namespace Bounty section Mixed variable {Z : Type*} {S I V K : Type} {Ps : S → Finset ℕ} {J ell N : ℕ} (M : Fin N → ℕ) (B : ℕ) (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ks) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B ks))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B ks)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B ks))) → ℝ) (encode : Z → ℤ) noncomputable def physicalMixedCommonFrequency : (Fin (Fintype.card (FullMixedCommonBirthAddress M B (physicalMixedBigSteps ks L pl))) × Fin (Fintype.card (FullMixedCommonBirthAddress M B (physicalMixedBigSteps ks L pl)))) → ℝ := birthFourierFrequencyCast (physical_mixed_big_common_card M B ks L pl) θ theorem physical_mixed_common_boundary_multiplier (initial : FullMixedCommonInitialAddress M → Z) : fullMixedCommonBoundaryMultiplier M B (physicalMixedBigSteps ks L pl) ((physicalMixedCommonForestEquiv M B ks L pl).symm code) (physicalMixedCommonFrequency M B ks L pl θ) encode initial = fullMixedCommonBoundaryMultiplier M B ks code θ encode initial := by rw [full_mixed_boundary_multiplier_shape, full_mixed_boundary_multiplier_shape] exact full_mixed_shape_boundary_cast M (physical_mixed_big_common_shape M B ks L pl) code θ encode initial end Mixed end Bounty end section -- Original source module: PhysicalMixedBigEventProjection /- A mixed event determines its actual decorated big event at the current small source and target. This projection keeps the original full event. -/ open scoped Classical namespace Bounty section Projection variable {S G I V K : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) abbrev PhysicalMixedDecoratedBigEvent := FullPermutationMixedEvent (J := V) n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) noncomputable def physicalMixedBigEventTag : (tag : Option (V ⊕ K)) → (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) → PhysicalMixedWordEvent n shared B A Δ D tag s → Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)) | none, _, _ => none | some (.inl j), _, _ => some (.inl j) | some (.inr k), s, e => some (.inr (k, e.1, s.1.2, e.2.2.1)) noncomputable def physicalMixedBigEventProjection : (tag : Option (V ⊕ K)) → (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) → (e : PhysicalMixedWordEvent n shared B A Δ D tag s) → PhysicalMixedDecoratedBigEvent n shared B A Δ D (physicalMixedBigEventTag n shared B A Δ D tag s e) s.2 | none, _, e => ULift.up e.2 | some (.inl _), _, e => ULift.up e | some (.inr _), _, e => ⟨e.2.1, e.2.2.2.2⟩ variable (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) end Projection end Bounty end section -- Original source module: PhysicalMixedTagErasure /- Erasing the small-plan decoration recovers each original event tag and preserves its full-slot birth addresses. -/ namespace Bounty section Tags variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell : ℕ} def physicalMixedBigTagErase : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)) → Option (V ⊕ K) | none => none | some (.inl j) => some (.inl j) | some (.inr key) => some (.inr key.1) theorem physical_mixed_big_steps_erase (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ks) : (physicalMixedBigSteps ks L pl).map physicalMixedBigTagErase = ks := by induction ks generalizing L with | nil => rfl | cons tag ks ih => cases tag with | none => rcases pl with ⟨σ, pl⟩ simp only [physicalMixedBigSteps, List.map_cons, physicalMixedBigTagErase, ih] | some tag => cases tag with | inl j => simp only [physicalMixedBigSteps, List.map_cons, physicalMixedBigTagErase] exact congrArg (List.cons (some (.inl j))) (ih L pl) | inr k => rcases pl with ⟨⟨i, R⟩, pl⟩ simp only [physicalMixedBigSteps, List.map_cons, physicalMixedBigTagErase, ih] def physicalMixedTagBirthAddressEquiv {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) : FullMixedCommonLocalAddress M B (physicalMixedBigTagErase tag) ≃ FullMixedCommonLocalAddress M B tag := by cases tag with | none => exact Equiv.refl _ | some tag => cases tag <;> exact Equiv.refl _ end Tags section Events variable {S G I V K : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) omit [Fintype S] in theorem physical_mixed_big_event_tag_erase (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEvent n shared B A Δ D tag s) : physicalMixedBigTagErase (physicalMixedBigEventTag n shared B A Δ D tag s e) = tag := by cases tag with | none => rfl | some tag => cases tag <;> rfl end Events end Bounty end section -- Original source module: PhysicalMixedTagPositions /- Erasing a decorated tag commutes with reading its chronological position, and transports its optional birth labels without change. -/ namespace Bounty theorem list_map_get_cast {α β : Type*} (f : α → β) (xs : List α) (ys : List β) (h : xs.map f = ys) (hlen : xs.length = ys.length) (u : Fin xs.length) : f (xs.get u) = ys.get (Fin.cast hlen u) := by subst ys simp only [List.get_eq_getElem, List.getElem_map] rfl section Tags variable {S I V K Z : Type} {Ps : S → Finset ℕ} {J ell N : ℕ} (M : Fin N → ℕ) (B : ℕ) theorem physical_mixed_big_tag_at_position (ks : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ks) (u : Fin (physicalMixedBigSteps ks L pl).length) : physicalMixedBigTagErase ((physicalMixedBigSteps ks L pl).get u) = ks.get (Fin.cast (congrArg Sigma.fst (physical_mixed_big_common_shape M B ks L pl)) u) := list_map_get_cast physicalMixedBigTagErase _ _ (physical_mixed_big_steps_erase ks L pl) (congrArg Sigma.fst (physical_mixed_big_common_shape M B ks L pl)) u theorem physical_mixed_erased_birth_label_heq (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (label : FullMixedCommonLocalAddress M B tag → Option Z) : HEq label (fun a => label (physicalMixedTagBirthAddressEquiv M B tag a)) := by cases tag with | none => rfl | some tag => cases tag <;> rfl end Tags end Bounty end section -- Original source module: FullMixedCommonTaggedMultiplier /- Known ghost and edge tags retain the exact common forest multiplier at their chronological occurrence. -/ namespace Bounty section Tagged variable {J K Z : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Z → ℤ) (u : Fin steps.length) (tag : Option (J ⊕ K)) (htag : steps.get u = tag) noncomputable def fullMixedCommonTaggedOperationMultiplier (label : FullMixedCommonLocalAddress M B tag → Option Z) : ℂ := fullMixedCommonLocalOperationMultiplier M B steps code θ encode u (fun a => label (cast (congrArg (FullMixedCommonLocalAddress M B) htag) a)) theorem full_mixed_common_tagged_multiplier_norm_le (label : FullMixedCommonLocalAddress M B tag → Option Z) : ‖fullMixedCommonTaggedOperationMultiplier M B steps code θ encode u tag htag label‖ ≤ 1 := full_mixed_common_local_multiplier_norm_le M B steps code θ encode u _ end Tagged section Event variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : (g : Fin N) → P g → ℕ) (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Sigma P → ℤ) (u : Fin steps.length) (tag : Option (J ⊕ K)) (htag : steps.get u = tag) end Event end Bounty end section -- Original source module: FullMixedTaggedShapeTransport /- Tagged local factors transport across equal birth shapes whenever their occurrence and optional-label function agree heterogeneously. -/ namespace Bounty theorem birth_label_precomp_cast_heq {α β : Type} {Z : Type*} (h : α = β) (f : β → Z) : HEq (fun a => f (cast h a)) f := by cases h rfl theorem full_mixed_shape_address_symm_heq {N : ℕ} {s t : FullMixedCommonShapeData N} (h : s = t) (u : Fin s.1) (a : FullMixedShapeLocalAddress t (Fin.cast (congrArg Sigma.fst h) u)) : HEq ((fullMixedShapeLocalAddressCast h u).symm a) a := by cases h rfl section Local variable {Z I K I' K' : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (I ⊕ K))) (steps' : List (Option (I' ⊕ K'))) (h : fullMixedCommonShape M B steps = fullMixedCommonShape M B steps') (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps'))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps')) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps'))) → ℝ) (encode : Z → ℤ) theorem full_mixed_local_multiplier_shape_heq (u : Fin steps.length) (v : Fin steps'.length) (huv : Fin.cast (congrArg Sigma.fst h) u = v) (label : FullMixedCommonLocalAddress M B (steps.get u) → Option Z) (label' : FullMixedCommonLocalAddress M B (steps'.get v) → Option Z) (hl : HEq label label') : fullMixedCommonLocalOperationMultiplier M B steps (cast (congrArg (fun q => BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M q))) h.symm) code) (birthFourierFrequencyCast (congrArg (fun q => Fintype.card (FullMixedCommonShapeAddress M q)) h) θ) encode u label = fullMixedCommonLocalOperationMultiplier M B steps' code θ encode v label' := by subst v rw [full_mixed_local_multiplier_shape, full_mixed_local_multiplier_shape] refine (full_mixed_shape_local_cast M h code θ encode u label).trans ?_ congr 1 funext a exact congr_heq hl (full_mixed_shape_address_symm_heq h u a) theorem full_mixed_tagged_multiplier_shape_heq (u : Fin steps.length) (v : Fin steps'.length) (huv : Fin.cast (congrArg Sigma.fst h) u = v) (tag : Option (I ⊕ K)) (tag' : Option (I' ⊕ K')) (htag : steps.get u = tag) (htag' : steps'.get v = tag') (label : FullMixedCommonLocalAddress M B tag → Option Z) (label' : FullMixedCommonLocalAddress M B tag' → Option Z) (hl : HEq label label') : fullMixedCommonTaggedOperationMultiplier M B steps (cast (congrArg (fun q => BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M q))) h.symm) code) (birthFourierFrequencyCast (congrArg (fun q => Fintype.card (FullMixedCommonShapeAddress M q)) h) θ) encode u tag htag label = fullMixedCommonTaggedOperationMultiplier M B steps' code θ encode v tag' htag' label' := by unfold fullMixedCommonTaggedOperationMultiplier apply full_mixed_local_multiplier_shape_heq M B steps steps' h code θ encode u v huv exact (birth_label_precomp_cast_heq _ label).trans (hl.trans (birth_label_precomp_cast_heq _ label').symm) end Local end Bounty end section -- Original source module: PhysicalSelectedBirthPositions /- Each birth-carrying tag in the actual fine schedule has a unique position. This lets local forest multipliers depend on the original tag. -/ namespace Bounty theorem physical_selected_fine_tag_visit {n : ℕ} (j : Fin (n + 1)) : physicalSelectedFineTag n (4 * j.val) = some (.inl j) := by have hj := j.isLt have hi : 4 * j.val < 4 * n + 1 := by omega have h0 : (4 * j.val) % 4 = 0 := by omega have hd : (4 * j.val) / 4 = j.val := by omega simp only [physicalSelectedFineTag, dif_pos hi, dif_pos h0] apply congrArg (fun k : Fin (n + 1) => some (Sum.inl k)) exact Fin.ext hd theorem physical_selected_fine_tag_edge {n : ℕ} (j : Fin n) : physicalSelectedFineTag n (4 * j.val + 2) = some (.inr j) := by have hj := j.isLt have hi : 4 * j.val + 2 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 2) % 4 = 0 := by omega have h2 : (4 * j.val + 2) % 4 = 2 := by omega have hd : (4 * j.val + 2) / 4 = j.val := by omega simp only [physicalSelectedFineTag, dif_pos hi, dif_neg h0, dif_pos h2] apply congrArg (fun k : Fin n => some (Sum.inr k)) exact Fin.ext hd theorem physical_selected_fine_visit_position {n i : ℕ} (j : Fin (n + 1)) (h : physicalSelectedFineTag n i = some (.inl j)) : i = 4 * j.val := by unfold physicalSelectedFineTag at h split_ifs at h with hi h0 h2 · have hv := congrArg Fin.val (Sum.inl.inj (Option.some.inj h)) dsimp only at hv omega · cases h theorem physical_selected_fine_edge_position {n i : ℕ} (j : Fin n) (h : physicalSelectedFineTag n i = some (.inr j)) : i = 4 * j.val + 2 := by unfold physicalSelectedFineTag at h split_ifs at h with hi h0 h2 · cases h · have hv := congrArg Fin.val (Sum.inr.inj (Option.some.inj h)) dsimp only at hv omega def physicalSelectedVisitPosition {n : ℕ} (j : Fin (n + 1)) : Fin ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)).length := ⟨4 * j.val, by simp only [List.length_map, List.length_range]; omega⟩ def physicalSelectedEdgePosition {n : ℕ} (j : Fin n) : Fin ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)).length := ⟨4 * j.val + 2, by simp only [List.length_map, List.length_range]; omega⟩ theorem physical_selected_visit_get {n : ℕ} (j : Fin (n + 1)) : ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)).get (physicalSelectedVisitPosition j) = some (.inl j) := by simp only [List.get_eq_getElem, List.getElem_map, List.getElem_range, physicalSelectedVisitPosition, physical_selected_fine_tag_visit] theorem physical_selected_edge_get {n : ℕ} (j : Fin n) : ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)).get (physicalSelectedEdgePosition j) = some (.inr j) := by simp only [List.get_eq_getElem, List.getElem_map, List.getElem_range, physicalSelectedEdgePosition, physical_selected_fine_tag_edge] end Bounty end section -- Original source module: FullMixedEmptyMultiplier /- A permutation occurrence has no birth slots and hence no forest factor. -/ open Finset open scoped Classical namespace Bounty section Empty variable {J K Z : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (J ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (u : Fin steps.length) (htag : steps.get u = none) include htag theorem full_mixed_empty_operation_unaffected : u.succ ∉ birthForestAffectedOperations code (fullMixedCommonIndexStage M B steps) := by let _ : DecidableEq (Fin (steps.length + 1)) := fun a b => Classical.propDecidable (a = b) intro h unfold birthForestAffectedOperations at h obtain ⟨i, _, hi⟩ := mem_image.mp h obtain ⟨a, _⟩ := (full_mixed_common_index_stage_succ_iff M B steps u i).mp hi let az : FullMixedCommonLocalAddress (J := J) (K := K) M B none := cast (congrArg (FullMixedCommonLocalAddress M B) htag) a exact Fin.elim0 az.2 theorem full_mixed_empty_operation_multiplier (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Z → ℤ) (label : FullMixedCommonLocalAddress M B (steps.get u) → Option Z) : fullMixedCommonLocalOperationMultiplier M B steps code θ encode u label = 1 := full_mixed_common_local_multiplier_untouched M B steps code θ encode u label (full_mixed_empty_operation_unaffected M B steps code u htag) end Empty end Bounty end section -- Original source module: PhysicalSelectedBirthMultiplier /- The actual fine-schedule forest factor is an ordinary local tag multiplier. Its permutation factors are exactly one. -/ namespace Bounty section Multiplier variable {Z : Type*} {N : ℕ} (M : Fin N → ℕ) (B n : ℕ) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) × Fin (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) → ℝ) (encode : Z → ℤ) noncomputable def physicalSelectedBirthMultiplier : (tag : Option (Fin (n + 1) ⊕ Fin n)) → (FullMixedCommonLocalAddress M B tag → Option Z) → ℂ | none, _ => 1 | some (.inl j), label => fullMixedCommonTaggedOperationMultiplier M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) code θ encode (physicalSelectedVisitPosition j) (some (.inl j)) (physical_selected_visit_get j) label | some (.inr j), label => fullMixedCommonTaggedOperationMultiplier M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) code θ encode (physicalSelectedEdgePosition j) (some (.inr j)) (physical_selected_edge_get j) label theorem physical_selected_birth_multiplier_norm_le (tag : Option (Fin (n + 1) ⊕ Fin n)) (label : FullMixedCommonLocalAddress M B tag → Option Z) : ‖physicalSelectedBirthMultiplier M B n code θ encode tag label‖ ≤ 1 := by cases tag with | none => exact (norm_one : ‖(1 : ℂ)‖ = 1).le | some tag => cases tag with | inl j => exact full_mixed_common_tagged_multiplier_norm_le M B _ code θ encode (physicalSelectedVisitPosition j) _ (physical_selected_visit_get j) label | inr j => exact full_mixed_common_tagged_multiplier_norm_le M B _ code θ encode (physicalSelectedEdgePosition j) _ (physical_selected_edge_get j) label theorem physical_selected_birth_multiplier_tagged (u : Fin ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)).length) (tag : Option (Fin (n + 1) ⊕ Fin n)) (htag : ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)).get u = tag) (label : FullMixedCommonLocalAddress M B tag → Option Z) : physicalSelectedBirthMultiplier M B n code θ encode tag label = fullMixedCommonTaggedOperationMultiplier M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) code θ encode u tag htag label := by cases tag with | none => dsimp only [physicalSelectedBirthMultiplier, fullMixedCommonTaggedOperationMultiplier] exact (full_mixed_empty_operation_multiplier M B _ code u htag θ encode _).symm | some tag => cases tag with | inl j => have hu : u = physicalSelectedVisitPosition j := by apply Fin.ext change u.val = 4 * j.val apply physical_selected_fine_visit_position j simpa only [List.get_eq_getElem, List.getElem_map, List.getElem_range] using htag subst u rfl | inr j => have hu : u = physicalSelectedEdgePosition j := by apply Fin.ext change u.val = 4 * j.val + 2 apply physical_selected_fine_edge_position j simpa only [List.get_eq_getElem, List.getElem_map, List.getElem_range] using htag subst u rfl end Multiplier end Bounty end section -- Original source module: PhysicalSelectedPlannedBirth /- Every fixed-plan birth factor on the actual selected schedule equals the plan-independent multiplier for its original event tag. -/ namespace Bounty section Planned variable {Z S I : Type} {Ps : S → Finset ℕ} {J ell N : ℕ} (M : Fin N → ℕ) (B n : ℕ) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) × Fin (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) → ℝ) (encode : Z → ℤ) theorem physical_selected_planned_birth_multiplier (u : Fin (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl).length) (tag : Option (Fin (n + 1) ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n))) (htag : (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl).get u = tag) (label : FullMixedCommonLocalAddress M B tag → Option Z) : fullMixedCommonTaggedOperationMultiplier M B (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) ((physicalMixedCommonForestEquiv M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl).symm code) (physicalMixedCommonFrequency M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl θ) encode u tag htag label = physicalSelectedBirthMultiplier M B n code θ encode (physicalMixedBigTagErase tag) (fun a => label (physicalMixedTagBirthAddressEquiv M B tag a)) := by let ks := (List.range (4 * n + 1)).map (physicalSelectedFineTag n) let v : Fin ks.length := Fin.cast (congrArg Sigma.fst (physical_mixed_big_common_shape M B ks L pl)) u have hv : ks.get v = physicalMixedBigTagErase tag := by calc _ = physicalMixedBigTagErase ((physicalMixedBigSteps ks L pl).get u) := (physical_mixed_big_tag_at_position M B ks L pl u).symm _ = _ := congrArg physicalMixedBigTagErase htag have h := full_mixed_tagged_multiplier_shape_heq M B (physicalMixedBigSteps ks L pl) ks (physical_mixed_big_common_shape M B ks L pl) code θ encode u v rfl tag (physicalMixedBigTagErase tag) htag hv label (fun a => label (physicalMixedTagBirthAddressEquiv M B tag a)) (physical_mixed_erased_birth_label_heq M B tag label) exact h.trans (physical_selected_birth_multiplier_tagged M B n code θ encode v (physicalMixedBigTagErase tag) hv (fun a => label (physicalMixedTagBirthAddressEquiv M B tag a))).symm end Planned end Bounty end section -- Original source module: FullMixedCommonForestRows /- Common forest Fourier rows have no root-dependent avoidance gate; the initial phase remains a separate boundary multiplier. -/ open Finset Classical namespace Bounty section Phase variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : (g : Fin N) → P g → ℕ) (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (residual : ∀ (tag : Option (J ⊕ K)) s, FullPermutationMixedEvent n S B A Δ D tag s → ℂ) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Sigma P → ℤ) noncomputable def fullMixedCommonForestStagePhase (u : Fin steps.length) (s : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) s) : ℂ := residual (steps.get u) s e * fullMixedCommonLocalOperationMultiplier M B steps code θ encode u (fullMixedCommonEventBirthLabel n S B A Δ D (steps.get u) s e) variable [∀ g, Fintype (P g)] [∀ g p, NeZero (n g p)] [∀ k c, Fintype (A k c)] (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ : ℝ) (V : Fin N → ℝ) end Phase end Bounty end section -- Original source module: PhysicalSelectedDecoratedPhase /- All fixed-plan Fourier factors on the selected schedule are a single ordinary decorated local phase, suitable for small-plan packing. -/ open Finset namespace Bounty section Phase variable {S I : Type} {Ps : S → Finset ℕ} {J ell N n : ℕ} {P : Fin N → Type} (sizes : ∀ g, P g → ℕ) {M : Fin N → ℕ} variable (shared : (PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n)) → ∀ g, Finset (Fin (M g))) (B : ℕ) (aux : ∀ k, SharedActiveLabels P (shared k) → Type) (Δ D : ∀ k c, aux k c → Fin N → ℤ) (residual : ∀ (tag : Option (Fin (n + 1) ⊕ (PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n)))) x, FullPermutationMixedEvent sizes shared B aux Δ D tag x → ℂ) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) × Fin (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) → ℝ) (encode : Sigma P → ℤ) noncomputable def physicalSelectedDecoratedPhase (tag : Option (Fin (n + 1) ⊕ (PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n)))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (sizes g)) M B) (event : FullPermutationMixedEvent sizes shared B aux Δ D tag x) : ℂ := residual tag x event * physicalSelectedBirthMultiplier M B n code θ encode (physicalMixedBigTagErase tag) (fun a => fullMixedCommonEventBirthLabel (J := Fin (n + 1)) (K := (PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n))) (P := P) (M := M) sizes shared B aux Δ D tag x event (physicalMixedTagBirthAddressEquiv M B tag a)) theorem physical_selected_decorated_phase_at_position (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))) (u : Fin (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl).length) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (sizes g)) M B) (event : FullPermutationMixedEvent sizes shared B aux Δ D ((physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl).get u) x) : fullMixedCommonForestStagePhase (J := Fin (n + 1)) (K := (PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n))) (P := P) (M := M) sizes shared B aux Δ D (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) residual ((physicalMixedCommonForestEquiv M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl).symm code) (physicalMixedCommonFrequency M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl θ) encode u x event = physicalSelectedDecoratedPhase sizes shared B aux Δ D residual code θ encode _ x event := by unfold fullMixedCommonForestStagePhase physicalSelectedDecoratedPhase apply congrArg (fun z : ℂ => residual _ x event * z) exact physical_selected_planned_birth_multiplier M B n L pl code θ encode u _ rfl (fullMixedCommonEventBirthLabel (J := Fin (n + 1)) (K := (PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n))) (P := P) (M := M) sizes shared B aux Δ D _ x event) theorem physical_selected_decorated_phase_product (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (sizes g)) M B) (p : FullPermutationMixedPath sizes shared B aux Δ D (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) x) : (∏ u : Fin (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl).length, let event := finiteEventPathOccurrence (FullPermutationMixedEvent sizes shared B aux Δ D) (fullPermutationMixedEventTarget sizes shared B aux Δ D) (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) x p u fullMixedCommonForestStagePhase (J := Fin (n + 1)) (K := (PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n))) (P := P) (M := M) sizes shared B aux Δ D (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) residual ((physicalMixedCommonForestEquiv M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl).symm code) (physicalMixedCommonFrequency M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl θ) encode u event.1 event.2) = finiteEventLocalPhase (FullPermutationMixedEvent sizes shared B aux Δ D) (fullPermutationMixedEventTarget sizes shared B aux Δ D) (physicalSelectedDecoratedPhase sizes shared B aux Δ D residual code θ encode) (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) x p := by rw [finite_event_local_phase_occurrences] apply prod_congr rfl intro u _ exact physical_selected_decorated_phase_at_position sizes shared B aux Δ D residual code θ encode L pl u _ _ end Phase end Bounty end section -- Original source module: FullMixedCommonPhaseProduct /- The exact phase product keeps the common initial phase at the boundary and attaches every later phase to its original event. -/ open Finset Classical namespace Bounty section Product variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : (g : Fin N) → P g → ℕ) (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (J ⊕ K))) (residual : ∀ (tag : Option (J ⊕ K)) s, FullPermutationMixedEvent n S B A Δ D tag s → ℂ) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) → ℝ) (encode : Sigma P → ℤ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) theorem full_mixed_common_phase_product : fullMixedCommonBoundaryMultiplier M B steps code θ encode (fullMixedCommonInitialPrime x) * (∏ u : Fin steps.length, let e := finiteEventPathOccurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x p u fullMixedCommonForestStagePhase n S B A Δ D steps residual code θ encode u e.1 e.2) = finiteEventLocalPhase (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) residual steps x p * (if ∀ i ∈ birthForestTouched code, fullMixedCommonIndexedPerformed n S B A Δ D steps x p i then ∏ i, physicalReturnPhase (birthForestLocalFrequency code θ i) (fullMixedCommonIndexedValue n S B A Δ D steps encode x p i) else 0) := by simp only [fullMixedCommonForestStagePhase] rw [prod_mul_distrib, ← finite_event_local_phase_occurrences] rw [mul_left_comm] rw [full_mixed_common_boundary_event_product n S B A Δ D steps x p code θ encode] end Product end Bounty end section -- Original source module: FullMixedWeightedForestFourier /- Common forest Fourier expansion with an arbitrary path-dependent factor. In particular, the exact small-plan factor stays inside the sum. -/ open Finset Classical MeasureTheory namespace Bounty section Weighted variable {I K Ω : Type*} {N : ℕ} {P : Fin N → Type*} (n : ∀ g, P g → ℕ) {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (I ⊕ K))) theorem full_mixed_weighted_forest_fourier (paths : Finset Ω) (x : Ω → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : ∀ a, FullPermutationMixedPath n S B A Δ D steps (x a)) (F : Ω → ℂ) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (encode : Sigma P → ℤ) : birthForestPathSum paths (fun a => F a * fullMixedCommonResidualWeight n S B A Δ D edgePhase ω μ q ρ V steps (x a) (p a)) (fun a => fullMixedCommonIndexedPerformed n S B A Δ D steps (x a) (p a)) (fun a => fullMixedCommonIndexedValue n S B A Δ D steps encode (x a) (p a)) code = ∫ θ, ∑ a ∈ paths, F a * (finiteEventPathWeight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps (x a) (p a) : ℂ) * fullMixedCommonBoundaryMultiplier M B steps code θ encode (fullMixedCommonInitialPrime (x a)) * (∏ u : Fin steps.length, let event := finiteEventPathOccurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps (x a) (p a) u fullMixedCommonForestStagePhase n S B A Δ D steps (fullMixedBirthResidualPhase n S B A Δ D edgePhase) code θ encode u event.1 event.2) ∂birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps))) := by rw [← birthForestPathSum_fourier_integral] apply integral_congr_ae filter_upwards [] with θ apply sum_congr rfl intro a _ have hp := congrArg (fun z : ℂ => F a * (finiteEventPathWeight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps (x a) (p a) : ℂ) * z) (full_mixed_common_phase_product n S B A Δ D steps (fullMixedBirthResidualPhase n S B A Δ D edgePhase) code θ encode (x a) (p a)) unfold fullMixedCommonResidualWeight split_ifs at hp ⊢ <;> convert hp.symm using 1 <;> ring end Weighted end Bounty end section -- Original source module: BirthForestFourierIntegrable /- Forest Fourier integrands are integrable even with arbitrary finite path weights. This permits the actual small-plan sum inside one integral. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem birth_forest_fourier_integrable {Ω : Type*} {n : ℕ} (paths : Finset Ω) (w : Ω → ℂ) (performed : Ω → Fin n → Prop) (f : Ω → Fin n → ℤ) (code : BirthForestCode n) : Integrable (fun θ : (Fin n × Fin n) → ℝ => ∑ a ∈ paths, if ∀ i ∈ birthForestTouched code, performed a i then w a * ∏ i, physicalReturnPhase (birthForestLocalFrequency code θ i) (f a i) else 0) (birthFourierCubeMeasure (Fin n × Fin n)) := by apply integrable_finsetSum intro a _ by_cases h : ∀ i ∈ birthForestTouched code, performed a i · simp only [if_pos h] have hi := (birth_fourier_cube_phase_integrable (birthForestEdgeDifference code (f a))).const_mul (w a) simpa only [birthForestEdgeDifference_phase_product] using hi · simp only [if_neg h] exact integrable_zero _ _ _ theorem birth_fourier_integrable_card_transport {m n : ℕ} (h : m = n) (F : ((Fin m × Fin m) → ℝ) → ℂ) (hF : Integrable F (birthFourierCubeMeasure (Fin m × Fin m))) : Integrable (fun θ => F (birthFourierFrequencyCast h θ)) (birthFourierCubeMeasure (Fin n × Fin n)) := by cases h exact hF end Bounty end section -- Original source module: FullMixedWeightedFourierIntegrable /- The exact weighted local Fourier sum is integrable, allowing all small-plan and pattern sums to remain inside its common integral. -/ open Finset Classical MeasureTheory namespace Bounty section Weighted variable {I K Ω : Type*} {N : ℕ} {P : Fin N → Type*} (n : ∀ g, P g → ℕ) {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (steps : List (Option (I ⊕ K))) theorem full_mixed_weighted_fourier_integrable (paths : Finset Ω) (x : Ω → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : ∀ a, FullPermutationMixedPath n S B A Δ D steps (x a)) (F : Ω → ℂ) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (encode : Sigma P → ℤ) : Integrable (fun θ => ∑ a ∈ paths, F a * (finiteEventPathWeight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps (x a) (p a) : ℂ) * fullMixedCommonBoundaryMultiplier M B steps code θ encode (fullMixedCommonInitialPrime (x a)) * (∏ u : Fin steps.length, let event := finiteEventPathOccurrence (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps (x a) (p a) u fullMixedCommonForestStagePhase n S B A Δ D steps (fullMixedBirthResidualPhase n S B A Δ D edgePhase) code θ encode u event.1 event.2)) (birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)))) := by have hi := birth_forest_fourier_integrable paths (fun a => F a * fullMixedCommonResidualWeight n S B A Δ D edgePhase ω μ q ρ V steps (x a) (p a)) (fun a => fullMixedCommonIndexedPerformed n S B A Δ D steps (x a) (p a)) (fun a => fullMixedCommonIndexedValue n S B A Δ D steps encode (x a) (p a)) code apply hi.congr filter_upwards [] with θ apply sum_congr rfl intro a _ have hp := congrArg (fun z : ℂ => F a * (finiteEventPathWeight (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventWeight n S B A Δ D ω μ q ρ V) steps (x a) (p a) : ℂ) * z) (full_mixed_common_phase_product n S B A Δ D steps (fullMixedBirthResidualPhase n S B A Δ D edgePhase) code θ encode (x a) (p a)) unfold fullMixedCommonResidualWeight split_ifs at hp ⊢ <;> convert hp.symm using 1 <;> ring end Weighted end Bounty end section -- Original source module: OptionalForestPathEncoding /- An injective integer encoding preserves each optional-label forest path sum, including arbitrary path-dependent weights. -/ open Finset open scoped Classical namespace Bounty theorem optional_forest_path_sum_encoding {Ω α : Type*} {m : ℕ} (paths : Finset Ω) (w : Ω → ℂ) (performed : Ω → Fin m → Prop) (label : Ω → Fin m → Option α) (hp : ∀ a ∈ paths, ∀ i, performed a i → (label a i).isSome = true) (encode : α → ℤ) (hinj : Function.Injective encode) (code : BirthForestCode m) : birthForestPathSum paths w performed label code = birthForestPathSum paths w performed (fun a i => ((label a i).map encode).getD 0) code := by unfold birthForestPathSum apply sum_congr rfl intro a ha rw [optional_forest_encoding_iff (performed a) (label a) (hp a ha) encode hinj code] end Bounty end section -- Original source module: PhysicalSelectedPlanFourier /- Each optional-label forest on an actual fixed small plan has an exact Fourier expansion on the common original cube. The arbitrary path factor stays inside the sum. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Fourier variable {S I Ω : Type} {Ps : S → Finset ℕ} {J ell N n : ℕ} {P : Fin N → Type} (sizes : ∀ g, P g → ℕ) {M : Fin N → ℕ} variable (shared : (PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n)) → ∀ g, Finset (Fin (M g))) (B : ℕ) (aux : ∀ k, SharedActiveLabels P (shared k) → Type) (Δ D : ∀ k c, aux k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (sizes g)) M B) → FullActiveEdgeEvent sizes (shared k) B (aux k) (Δ k) (D k) x → ℂ) (ω : ∀ k c, aux k c → ℝ) (μ : ∀ g, P g → ℝ) (q : Fin (n + 1) → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_selected_plan_forest_fourier (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))) (paths : Finset Ω) (x : Ω → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (sizes g)) M B) (p : ∀ a, FullPermutationMixedPath sizes shared B aux Δ D (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) (x a)) (F : Ω → ℂ) (encode : Sigma P → ℤ) (hinj : Function.Injective encode) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) : let ks := (List.range (4 * n + 1)).map (physicalSelectedFineTag n) let steps := physicalMixedBigSteps ks L pl birthForestPathSum paths (fun a => F a * fullMixedCommonResidualWeight sizes shared B aux Δ D edgePhase ω μ q ρ V steps (x a) (p a)) (fun a => fullMixedCommonIndexedPerformed sizes shared B aux Δ D steps (x a) (p a)) (fun a i => fullMixedCommonBirthLabel sizes shared B aux Δ D steps (x a) (p a) (fullMixedCommonBirthOrder M B steps i)) ((physicalMixedCommonForestEquiv M B ks L pl).symm code) = ∫ θ, ∑ a ∈ paths, F a * (finiteEventPathWeight (FullPermutationMixedEvent sizes shared B aux Δ D) (fullPermutationMixedEventTarget sizes shared B aux Δ D) (fullPermutationMixedEventWeight sizes shared B aux Δ D ω μ q ρ V) steps (x a) (p a) : ℂ) * fullMixedCommonBoundaryMultiplier M B ks code θ encode (fullMixedCommonInitialPrime (x a)) * finiteEventLocalPhase (FullPermutationMixedEvent sizes shared B aux Δ D) (fullPermutationMixedEventTarget sizes shared B aux Δ D) (physicalSelectedDecoratedPhase sizes shared B aux Δ D (fullMixedBirthResidualPhase sizes shared B aux Δ D edgePhase) code θ encode) steps (x a) (p a) ∂birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress M B ks)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B ks))) := by dsimp only have henc := optional_forest_path_sum_encoding paths (fun a => F a * fullMixedCommonResidualWeight sizes shared B aux Δ D edgePhase ω μ q ρ V (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) (x a) (p a)) (fun a => fullMixedCommonIndexedPerformed sizes shared B aux Δ D (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) (x a) (p a)) (fun a i => fullMixedCommonBirthLabel sizes shared B aux Δ D (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) (x a) (p a) (fullMixedCommonBirthOrder M B (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) i)) (fun _ _ _ hi => hi) encode hinj ((physicalMixedCommonForestEquiv M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl).symm code) rw [henc] change birthForestPathSum paths _ _ (fun a => fullMixedCommonIndexedValue sizes shared B aux Δ D (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) encode (x a) (p a)) _ = _ rw [full_mixed_weighted_forest_fourier] rw [birth_fourier_integral_card_transport (physical_mixed_big_common_card M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl)] apply integral_congr_ae filter_upwards [] with θ apply sum_congr rfl intro a _ change _ * fullMixedCommonBoundaryMultiplier M B _ _ (physicalMixedCommonFrequency M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl θ) _ _ * _ = _ rw [physical_mixed_common_boundary_multiplier] congr 1 exact physical_selected_decorated_phase_product sizes shared B aux Δ D (fullMixedBirthResidualPhase sizes shared B aux Δ D edgePhase) code θ encode L pl (x a) (p a) theorem physical_selected_plan_fourier_integrable (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))) (paths : Finset Ω) (x : Ω → ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (sizes g)) M B) (p : ∀ a, FullPermutationMixedPath sizes shared B aux Δ D (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) (x a)) (F : Ω → ℂ) (encode : Sigma P → ℤ) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) : let ks := (List.range (4 * n + 1)).map (physicalSelectedFineTag n) let steps := physicalMixedBigSteps ks L pl Integrable (fun θ => ∑ a ∈ paths, F a * (finiteEventPathWeight (FullPermutationMixedEvent sizes shared B aux Δ D) (fullPermutationMixedEventTarget sizes shared B aux Δ D) (fullPermutationMixedEventWeight sizes shared B aux Δ D ω μ q ρ V) steps (x a) (p a) : ℂ) * fullMixedCommonBoundaryMultiplier M B ks code θ encode (fullMixedCommonInitialPrime (x a)) * finiteEventLocalPhase (FullPermutationMixedEvent sizes shared B aux Δ D) (fullPermutationMixedEventTarget sizes shared B aux Δ D) (physicalSelectedDecoratedPhase sizes shared B aux Δ D (fullMixedBirthResidualPhase sizes shared B aux Δ D edgePhase) code θ encode) steps (x a) (p a)) (birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress M B ks)) × Fin (Fintype.card (FullMixedCommonBirthAddress M B ks)))) := by dsimp only have hn := full_mixed_weighted_fourier_integrable sizes shared B aux Δ D edgePhase ω μ q ρ V (physicalMixedBigSteps ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) paths x p F ((physicalMixedCommonForestEquiv M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl).symm code) encode have hc := birth_fourier_integrable_card_transport (physical_mixed_big_common_card M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl) _ hn apply hc.congr filter_upwards [] with θ apply sum_congr rfl intro a _ change _ * fullMixedCommonBoundaryMultiplier M B _ _ (physicalMixedCommonFrequency M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) L pl θ) _ _ * _ = _ rw [physical_mixed_common_boundary_multiplier] congr 1 exact physical_selected_decorated_phase_product sizes shared B aux Δ D (fullMixedBirthResidualPhase sizes shared B aux Δ D edgePhase) code θ encode L pl (x a) (p a) end Fourier end Bounty end section -- Original source module: PhysicalRootPlanFourier /- The original fixed-plan root forest is the exact common-cube Fourier integral, retaining its actual small-plan factor and original coefficient. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootPlanFourierIntegrand (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ℂ := let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalFullEdgeDelta (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) (kb key) let displacement := fun key => physicalFullEdgeD (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) let omega := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) a let _ := fullPermutationMixedEventFintype (J := Fin (n + 2)) sizes shared B aux delta displacement let _ := finiteEventPathFintype (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x let F := fun path : FullPermutationMixedPath sizes shared B aux delta displacement steps x => physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x path * f (finiteEventPathTerminal (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x path) ∑ path : FullPermutationMixedPath sizes shared B aux delta displacement steps x, F path * (finiteEventPathWeight (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) (fullPermutationMixedEventWeight sizes shared B aux delta displacement omega (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val)) steps x path : ℂ) * fullMixedCommonBoundaryMultiplier (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) code ν encode (fullMixedCommonInitialPrime x) * finiteEventLocalPhase (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) (physicalSelectedDecoratedPhase sizes shared B aux delta displacement (fullMixedBirthResidualPhase sizes shared B aux delta displacement (physicalFullCombinedEdgePhase Cb kb omega β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ))) code ν encode) steps x path theorem physical_root_common_forest_fourier (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (hinj : Function.Injective encode) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : physicalRootCommonForestAction groups e patterns C hC k pl V q ζ K r θ β retention ρ code f x = ∫ ν, physicalRootPlanFourierIntegrand groups e patterns C hC k pl V q ζ K r θ β retention ρ code encode ν f x ∂birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalFullEdgeDelta (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) (kb key) let displacement := fun key => physicalFullEdgeD (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) let omega := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) a let _ := fullPermutationMixedEventFintype (J := Fin (n + 2)) sizes shared B aux delta displacement let _ := finiteEventPathFintype (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x let F := fun path : FullPermutationMixedPath sizes shared B aux delta displacement steps x => physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x path * f (finiteEventPathTerminal (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x path) exact physical_selected_plan_forest_fourier sizes shared B aux delta displacement (physicalFullCombinedEdgePhase Cb kb omega β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ)) omega (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) pl.1 pl.2 univ (fun _ => x) (fun path => path) F encode hinj code end Root end Bounty end section -- Original source module: FullPermutationParameterLedger /- Exact edge-parameter transport preserves the original cumulative birth ledger. Effective local phases therefore pull back to the same raw ledger. -/ open scoped Classical namespace Bounty section Ledger variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, DecidableEq (P g)] (n : ∀ g, P g → ℕ) {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ Δ' D D' : ∀ k c, A k c → Fin N → ℤ) (hΔ : ∀ k, Δ k = Δ' k) (hD : ∀ k c a g p, ((n g p : ℤ) ∣ D k c a g ↔ (n g p : ℤ) ∣ D' k c a g)) theorem full_permutation_parameter_ledger_update (tag : Option (J ⊕ K)) (H : (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag x) : fullMixedLedgerUpdate n S B A Δ' D' tag H x (fullPermutationParameterEventEquiv n S B A Δ Δ' D D' hΔ hD tag x e) = fullMixedLedgerUpdate n S B A Δ D tag H x e := by cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr k => dsimp only [fullMixedLedgerUpdate, fullPermutationParameterEventEquiv] unfold fullEdgeLedgerUpdate erw [full_active_parameter_target] theorem full_permutation_parameter_ledger_phase (phase : ∀ (tag : Option (J ⊕ K)), ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullPermutationMixedEvent n S B A Δ' D' tag x → ℂ) (steps : List (Option (J ⊕ K))) (H : (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FiniteEventPath (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) steps x) : deterministicLedgerPhase (FullPermutationMixedEvent n S B A Δ' D') (fullPermutationMixedEventTarget n S B A Δ' D') (fullMixedLedgerUpdate n S B A Δ' D') phase steps H x (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x p) = deterministicLedgerPhase (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedLedgerUpdate n S B A Δ D) (fun tag H x e => phase tag H x (fullPermutationParameterEventEquiv n S B A Δ Δ' D D' hΔ hD tag x e)) steps H x p := deterministic_ledger_phase_equiv _ _ _ _ id _ _ _ _ (full_permutation_parameter_ledger_update n S B A Δ Δ' D D' hΔ hD) _ _ (fun _ _ _ _ => rfl) steps H x p end Ledger end Bounty end section -- Original source module: PhysicalMixedEffectiveLedger /- The actual mixed-to-effective parameter equivalence preserves the finite-set birth ledger and pulls effective local phases back exactly. -/ open scoped Classical namespace Bounty section Effective variable {S K V : Type} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) (C : K → Fin N → Finset (Fin J)) (d : K → PhysicalSharedLists Ps J) (k : K → ℤ) (B : ℕ) noncomputable def physicalMixedEffectiveBigEventEquiv (tag : Option (V ⊕ K)) (x : PhysicalFullBoundedState P J ell B) : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) tag x ≃ FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key)) tag x := fullPermutationParameterEventEquiv _ _ B _ _ _ _ _ (fun key => funext fun c => funext fun a => funext fun g => physical_mixed_delta_effective_big_step (C key) (d key) (k key) c a g) (fun key c a g p => physical_mixed_dilation_divisibility hPs hP hdis (C key) (d key) c a g p) tag x theorem physical_mixed_effective_big_ledger_phase (phase : ∀ (tag : Option (V ⊕ K)), ((g : Fin N) → Finset (P g)) → (x : PhysicalFullBoundedState P J ell B) → FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key)) tag x → ℂ) (steps : List (Option (V ⊕ K))) (H : (g : Fin N) → Finset (P g)) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) steps x) : deterministicLedgerPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key))) (fullMixedLedgerUpdate (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key))) phase steps H x (physicalMixedEffectiveBigPathEquiv hPs hP hdis C d k B steps x p) = deterministicLedgerPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key))) (fullMixedLedgerUpdate (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key))) (fun tag H x e => phase tag H x (physicalMixedEffectiveBigEventEquiv hPs hP hdis C d k B tag x e)) steps H x p := full_permutation_parameter_ledger_phase _ _ B _ _ _ _ _ (fun key => funext fun c => funext fun a => funext fun g => physical_mixed_delta_effective_big_step (C key) (d key) (k key) c a g) (fun key c a g p => physical_mixed_dilation_divisibility hPs hP hdis (C key) (d key) c a g p) phase steps H x p end Effective end Bounty end section -- Original source module: PhysicalMixedProjectedHistory /- Local decorated big phases, with their actual deterministic state update, pull back through small-plan packing to local mixed-event phases. -/ open scoped Classical namespace Bounty section History variable {S G I V K : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) noncomputable def physicalMixedDecoratedBigTarget := fullPermutationMixedEventTarget (J := V) n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) noncomputable def physicalMixedBigEventPullback {H T : Type*} (F : ∀ tag, H → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → PhysicalMixedDecoratedBigEvent (V := V) (ell := ell) n shared B A Δ D tag x → T) (tag : Option (V ⊕ K)) (h : H) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEvent n shared B A Δ D tag s) : T := F (physicalMixedBigEventTag n shared B A Δ D tag s e) h s.2 (physicalMixedBigEventProjection n shared B A Δ D tag s e) variable (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) {H : Type*} (update : ∀ tag, H → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → PhysicalMixedDecoratedBigEvent (V := V) (ell := ell) n shared B A Δ D tag x → H) (phase : ∀ tag, H → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → PhysicalMixedDecoratedBigEvent (V := V) (ell := ell) n shared B A Δ D tag x → ℂ) theorem physical_mixed_projected_history_pack (ks : List (Option (V ⊕ K))) (h : H) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (z : Σ pl : PhysicalMixedSmallPlan (I := I) ks, PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) : deterministicLedgerPhase (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedBigEventPullback n shared B A Δ D update) (physicalMixedBigEventPullback n shared B A Δ D phase) ks h ((r, L), x) (physicalMixedPathPack n shared B A Δ D kbig ks r L x z) = deterministicLedgerPhase (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) update phase (physicalMixedBigSteps ks L z.1) h x z.2 := by induction ks generalizing h r L x with | nil => rcases z with ⟨⟨⟩, ⟨⟩⟩; rfl | cons tag ks ih => cases tag with | none => rcases z with ⟨⟨σ, pl⟩, ⟨⟨τ⟩, p⟩⟩ dsimp only [physicalMixedPathPack, physicalMixedBigSteps, deterministicLedgerPhase, physicalMixedBigEventPullback, physicalMixedBigEventTag, physicalMixedBigEventProjection] erw [ih] rfl | some tag => cases tag with | inl j => rcases z with ⟨pl, ⟨⟨e⟩, p⟩⟩ dsimp only [physicalMixedPathPack, physicalMixedBigSteps, deterministicLedgerPhase, physicalMixedBigEventPullback, physicalMixedBigEventTag, physicalMixedBigEventProjection] erw [ih] rfl | inr k => rcases z with ⟨⟨⟨i, R⟩, pl⟩, ⟨⟨a, e⟩, p⟩⟩ dsimp only [physicalMixedPathPack, physicalMixedBigSteps, deterministicLedgerPhase, physicalMixedBigEventPullback, physicalMixedBigEventTag, physicalMixedBigEventProjection] erw [ih] rfl theorem physical_mixed_projected_history_unpack (ks : List (Option (V ⊕ K))) (h : H) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FiniteEventPath (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) ks ((r, L), x)) : deterministicLedgerPhase (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedBigEventPullback n shared B A Δ D update) (physicalMixedBigEventPullback n shared B A Δ D phase) ks h ((r, L), x) p = let z := physicalMixedPathUnpack n shared B A Δ D kbig ks r L x p deterministicLedgerPhase (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) update phase (physicalMixedBigSteps ks L z.1) h x z.2 := by have hp := physical_mixed_projected_history_pack n shared B A Δ D kbig update phase ks h r L x (physicalMixedPathUnpack n shared B A Δ D kbig ks r L x p) rw [physical_mixed_path_pack_unpack] at hp exact hp end History end Bounty end section -- Original source module: PhysicalRootPlannedHistory /- The exact root planned remainder uses the original raw birth ledger and local phases transported through the actual effective event equivalence. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootPlannedLocalPhase (tag : Option (Fin (n + 2) ⊕ PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)))) (H : (g : Fin M) → Finset (P (e.symm g).val)) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (event : PhysicalMixedDecoratedBigEvent (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) tag x) : ℂ := physicalRootEffectiveLocalPhase (n := n) groups e patterns C hC k V ζ K θ β ρ tag H x (physicalMixedEffectiveBigEventEquiv hPs hPb hdis (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k (n - key.1.val) key.2.1.val) B tag x event) noncomputable def physicalRootPlannedHistory (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalRootPlannedPath groups e patterns C k pl x) : ℂ := deterministicLedgerPhase (PhysicalMixedDecoratedBigEvent (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val))) (physicalMixedDecoratedBigTarget (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val))) (fullMixedLedgerUpdate (fun g (p : P (e.symm g).val) => p.val) (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => physicalFullSharedIndices (ell := ell) (C key.2.1.val (e.symm g).val)) B (fun key _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val)) (fun key => physicalMixedEdgeDelta (fun g => C key.2.1.val (e.symm g).val) (k (n - key.1.val) key.2.1.val) (physicalSharedPrefix key.2.2.1)) (fun key => physicalMixedEdgeD (fun g => C key.2.1.val (e.symm g).val) (physicalSharedPrefix key.2.2.1))) (physicalRootPlannedLocalPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis) (physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2) (fullActiveInitialLedger x) x path theorem physical_root_planned_remainder_history (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalRootPlannedPath groups e patterns C k pl x) : physicalRootPlannedRemainder groups e patterns C hC k pl V ζ K θ β ρ hPs hPb hdis x path = physicalRootPlannedHistory groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis pl x path := by unfold physicalRootPlannedRemainder rw [physical_root_effective_remainder_history] unfold physicalRootEffectiveHistory physicalRootPlannedHistory physicalRootPlannedLocalPhase physicalMixedDecoratedBigTarget dsimp only exact physical_mixed_effective_big_ledger_phase hPs hPb hdis _ _ _ B _ _ _ x path end Root end Bounty end section -- Original source module: PhysicalMixedProjectedLocal /- Ordinary decorated big-event phases pack through the actual small plan equivalence, without adding a history variable. -/ open scoped Classical namespace Bounty section Local variable {S G I V K : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) noncomputable def physicalMixedBigLocalPullback (phase : ∀ tag, (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → PhysicalMixedDecoratedBigEvent (V := V) (ell := ell) n shared B A Δ D tag x → ℂ) (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEvent n shared B A Δ D tag s) : ℂ := phase (physicalMixedBigEventTag n shared B A Δ D tag s e) s.2 (physicalMixedBigEventProjection n shared B A Δ D tag s e) variable (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (phase : ∀ tag, (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → PhysicalMixedDecoratedBigEvent (V := V) (ell := ell) n shared B A Δ D tag x → ℂ) theorem physical_mixed_projected_local_pack (ks : List (Option (V ⊕ K))) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (z : Σ pl : PhysicalMixedSmallPlan (I := I) ks, PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) : finiteEventLocalPhase (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedBigLocalPullback n shared B A Δ D phase) ks ((r, L), x) (physicalMixedPathPack n shared B A Δ D kbig ks r L x z) = finiteEventLocalPhase (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) phase (physicalMixedBigSteps ks L z.1) x z.2 := by induction ks generalizing r L x with | nil => rcases z with ⟨⟨⟩, ⟨⟩⟩; rfl | cons tag ks ih => cases tag with | none => rcases z with ⟨⟨σ, pl⟩, ⟨⟨τ⟩, p⟩⟩ dsimp only [physicalMixedPathPack, physicalMixedBigSteps, finiteEventLocalPhase, physicalMixedBigLocalPullback, physicalMixedBigEventTag, physicalMixedBigEventProjection] erw [ih] rfl | some tag => cases tag with | inl j => rcases z with ⟨pl, ⟨⟨e⟩, p⟩⟩ dsimp only [physicalMixedPathPack, physicalMixedBigSteps, finiteEventLocalPhase, physicalMixedBigLocalPullback, physicalMixedBigEventTag, physicalMixedBigEventProjection] erw [ih] rfl | inr k => rcases z with ⟨⟨⟨i, R⟩, pl⟩, ⟨⟨a, e⟩, p⟩⟩ dsimp only [physicalMixedPathPack, physicalMixedBigSteps, finiteEventLocalPhase, physicalMixedBigLocalPullback, physicalMixedBigEventTag, physicalMixedBigEventProjection] erw [ih] rfl end Local end Bounty end section -- Original source module: PhysicalRootFourierPhases /- Ordinary local Fourier phases for the exact root coefficient, first on effective events, then on planned events and the actual mixed word. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (ρ : ℝ) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) noncomputable def physicalRootEffectiveFourierPhase := let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalFullEdgeDelta (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) (kb key) let displacement := fun key => physicalFullEdgeD (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) let omega := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) a physicalSelectedDecoratedPhase sizes shared B aux delta displacement (fullMixedBirthResidualPhase sizes shared B aux delta displacement (physicalFullCombinedEdgePhase Cb kb omega β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ))) code ν encode variable (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootPlannedFourierPhase (tag : Option (Fin (n + 2) ⊕ PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)))) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (event : PhysicalMixedDecoratedBigEvent (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) tag x) : ℂ := physicalRootEffectiveFourierPhase (n := n) groups e patterns C hC k V ζ K θ β ρ code encode ν tag x (physicalMixedEffectiveBigEventEquiv hPs hPb hdis (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k (n - key.1.val) key.2.1.val) B tag x event) noncomputable def physicalRootMixedFourierPhase := physicalMixedBigLocalPullback (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (physicalRootPlannedFourierPhase (n := n) groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis) end Root end Bounty end section -- Original source module: PhysicalMixedProjectedRows /- The actual mixed operator word packs exactly into the small-plan sum of original big paths with ordinary decorated local phases. -/ open Finset open scoped Classical namespace Bounty section Rows variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] [Fintype I] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) theorem physical_mixed_projected_rows (phase : ∀ tag, (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → PhysicalMixedDecoratedBigEvent (V := V) (ell := ell) n shared B A Δ D tag x → ℂ) (ks : List (Option (V ⊕ K))) (f : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B → ℂ) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) : let _ := physicalMixedSmallPlanFintype (Ps := Ps) (J := J) (ell := ell) (I := I) ks finiteOperatorListAction (physicalMixedWordRow n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge (physicalMixedBigLocalPullback n shared B A Δ D phase)) ks (fun s => f s.2) ((r, L), x) = ∑ pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks, physicalMixedPlannedBigAction n shared B A Δ D ω μ qghost ρ Vb ks L pl (fun y p => (physicalMixedPlanSmallFactor n shared B A Δ D kbig Vs qedge ks r L pl y p : ℂ) * finiteEventLocalPhase (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) phase (physicalMixedBigSteps ks L pl) y p) f x := by let _ := physicalMixedSmallPlanFintype (Ps := Ps) (J := J) (ell := ell) (I := I) ks rw [physical_mixed_word_eq_original_big_paths] apply sum_congr rfl intro pl _ unfold physicalMixedPlannedBigAction fullPermutationMixedPathAction finiteEventPathAction apply sum_congr rfl intro p _ dsimp only have hp := physical_mixed_projected_local_pack n shared B A Δ D kbig phase ks r L x ⟨pl, p⟩ have ht := physical_mixed_planned_big_terminal n shared B A Δ D kbig ks r L pl x p erw [hp, ht] dsimp only [physicalMixedPlannedBigTerminal] ring end Rows end Bounty end section -- Original source module: PhysicalRootFourierWord /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) noncomputable def physicalRootFourierPlannedAction (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) := let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) physicalMixedPlannedBigAction (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (i : patterns) _ a => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) a) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 (fun y p => (physicalMixedPlanSmallFactor (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 y p : ℂ) * finiteEventLocalPhase (PhysicalMixedDecoratedBigEvent (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val))) (physicalMixedDecoratedBigTarget (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val))) (physicalRootPlannedFourierPhase groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis) (physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2) y p) f noncomputable def physicalRootFourierWord (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ℂ := let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) finiteOperatorListAction (physicalMixedWordRow (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ a => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) a) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) (physicalRootMixedFourierPhase groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (fun s => f s.2) ((physicalGroupResidueVector r, L), x) theorem physical_root_fourier_word_eq_plans (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) physicalRootFourierWord groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν f L x = ∑ sp : PhysicalMixedSmallPlan (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))), physicalRootFourierPlannedAction groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν (L, sp) f x := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) exact physical_mixed_projected_rows (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ a => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) a) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) (physicalRootPlannedFourierPhase groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) f (physicalGroupResidueVector r) L x end Root end Bounty end section -- Original source module: PhysicalMixedBirthHistory /- Mixed events carry the original finite-set birth ledger through their actual decorated big events. No event choices are added. -/ open scoped Classical namespace Bounty section Birth variable {S I V K : Type} [Fintype S] {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} [∀ g, DecidableEq (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) noncomputable def physicalMixedBirthLedgerUpdate := physicalMixedBigEventPullback (V := V) (ell := ell) n shared B A Δ D (fullMixedLedgerUpdate n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a)) variable (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (phase : ∀ tag, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → PhysicalMixedDecoratedBigEvent (V := V) (ell := ell) n shared B A Δ D tag x → ℂ) end Birth end Bounty end section -- Original source module: PhysicalRootMixedHistory /- The actual whole-path root phase is realized by local mixed-event phases on the original deterministic finite-set birth ledger. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootMixedBirthUpdate := physicalMixedBirthLedgerUpdate (V := Fin (n + 2)) (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) noncomputable def physicalRootMixedLocalPhase := physicalMixedBigEventPullback (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (physicalRootPlannedLocalPhase (n := n) groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis) noncomputable def physicalRootMixedHistory (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (path : PhysicalRootMixedPath (n := n) groups e patterns C k s) : ℂ := deterministicLedgerPhase (PhysicalRootMixedEvent groups e patterns C k) (physicalRootMixedTarget groups e patterns C k) (physicalRootMixedBirthUpdate (n := n) groups e patterns C k) (physicalRootMixedLocalPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (fullActiveInitialLedger s.2) s path theorem physical_root_mixed_phase_history (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (path : PhysicalRootMixedPath (n := n) groups e patterns C k s) : physicalRootMixedPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis s path = physicalRootMixedHistory groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis s path := by unfold physicalRootMixedPhase dsimp only erw [physical_root_planned_remainder_history] unfold physicalRootPlannedHistory physicalRootMixedHistory physicalRootMixedBirthUpdate physicalRootMixedLocalPhase physicalMixedBirthLedgerUpdate physicalRootMixedPackingEquiv physicalMixedPathPackingEquiv dsimp only exact (physical_mixed_projected_history_unpack (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) _ _ _ _ _ _ _ path).symm end Root end Bounty end section -- Original source module: PhysicalSelectedBirthExceptions /- A rank-r common forest changes at most 2r original edge factors. Every other selected edge retains its exact untwisted local operator. -/ open Finset open scoped Classical namespace Bounty section Exceptions variable {Z : Type*} {N : ℕ} (M : Fin N → ℕ) (B n : ℕ) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) noncomputable def physicalSelectedAffectedEdges : Finset (Fin n) := univ.filter (fun j => (physicalSelectedEdgePosition j).succ ∈ birthForestAffectedOperations code (fullMixedCommonIndexStage M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) theorem physical_selected_edge_operation_injective : Function.Injective (fun j : Fin n => (physicalSelectedEdgePosition j).succ) := by intro i j h apply Fin.ext have hv := congrArg Fin.val h change 4 * i.val + 2 + 1 = 4 * j.val + 2 + 1 at hv omega theorem physical_selected_affected_edges_card : (physicalSelectedAffectedEdges M B n code).card ≤ 2 * birthForestRank code := by apply le_trans _ (birthForestAffectedOperations_card_le code (fullMixedCommonIndexStage M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) apply card_le_card_of_injOn (fun j : Fin n => (physicalSelectedEdgePosition j).succ) · intro j hj exact (mem_filter.mp hj).2 · exact (physical_selected_edge_operation_injective n).injOn theorem physical_selected_edge_multiplier_untouched (θ : (Fin (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) × Fin (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) → ℝ) (encode : Z → ℤ) (j : Fin n) (hj : j ∉ physicalSelectedAffectedEdges M B n code) (label : FullMixedCommonLocalAddress M B (some (.inr j) : Option (Fin (n + 1) ⊕ Fin n)) → Option Z) : physicalSelectedBirthMultiplier M B n code θ encode (some (.inr j)) label = 1 := by have hu : (physicalSelectedEdgePosition j).succ ∉ birthForestAffectedOperations code (fullMixedCommonIndexStage M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))) := by intro h exact hj (mem_filter.mpr ⟨mem_univ j, h⟩) unfold physicalSelectedBirthMultiplier fullMixedCommonTaggedOperationMultiplier exact full_mixed_common_local_multiplier_untouched M B _ code θ encode (physicalSelectedEdgePosition j) _ hu end Exceptions end Bounty end section -- Original source module: PhysicalRootFourierMultiplier /- Ordinary local Fourier phases for the exact root coefficient, first on effective events, then on planned events and the actual mixed word. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (ρ : ℝ) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) noncomputable def physicalRootEffectiveFourierMultiplier := let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalFullEdgeDelta (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) (kb key) let displacement := fun key => physicalFullEdgeD (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) physicalSelectedDecoratedPhase sizes shared B aux delta displacement (fun _ _ _ => 1) code ν encode variable (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootPlannedFourierMultiplier (tag : Option (Fin (n + 2) ⊕ PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)))) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (event : PhysicalMixedDecoratedBigEvent (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) tag x) : ℂ := physicalRootEffectiveFourierMultiplier (n := n) groups e patterns C k code encode ν tag x (physicalMixedEffectiveBigEventEquiv hPs hPb hdis (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k (n - key.1.val) key.2.1.val) B tag x event) noncomputable def physicalRootMixedFourierMultiplier := physicalMixedBigLocalPullback (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (physicalRootPlannedFourierMultiplier (n := n) groups e patterns C k code encode ν hPs hPb hdis) end Root end Bounty end section -- Original source module: PhysicalRootFourierLocal /- Ordinary local Fourier phases for the exact root coefficient, first on effective events, then on planned events and the actual mixed word. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (ρ : ℝ) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) theorem physical_root_fourier_multiplier_norm_le (tag : Option (Fin (n + 2) ⊕ Fin (n + 1))) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (ev : PhysicalRootMixedEvent groups e patterns C k tag s) : ‖physicalRootMixedFourierMultiplier groups e patterns C k code encode ν hPs hPb hdis tag s ev‖ ≤ 1 := by unfold physicalRootMixedFourierMultiplier physicalMixedBigLocalPullback physicalRootPlannedFourierMultiplier physicalRootEffectiveFourierMultiplier dsimp only [physicalSelectedDecoratedPhase] simp only [one_mul] exact physical_selected_birth_multiplier_norm_le _ _ _ _ _ _ _ _ theorem physical_root_fourier_edge_factor (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (ev : PhysicalRootMixedEvent groups e patterns C k (some (.inr j)) s) : physicalRootMixedFourierPhase groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis (some (.inr j)) s ev = physicalRootMixedLocalPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis (some (.inr j)) (fun _ => ∅) s ev * physicalRootMixedFourierMultiplier groups e patterns C k code encode ν hPs hPb hdis (some (.inr j)) s ev := by unfold physicalRootMixedFourierPhase physicalRootMixedFourierMultiplier physicalMixedBigLocalPullback physicalRootPlannedFourierPhase physicalRootPlannedFourierMultiplier physicalRootEffectiveFourierPhase physicalRootEffectiveFourierMultiplier physicalRootMixedLocalPhase physicalMixedBigEventPullback physicalRootPlannedLocalPhase physicalRootEffectiveLocalPhase dsimp only [physicalSelectedDecoratedPhase] simp only [one_mul] rfl theorem physical_root_fourier_ghost_factor (j : Fin (n + 2)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (ev : PhysicalRootMixedEvent groups e patterns C k (some (.inl j)) s) : physicalRootMixedFourierPhase groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis (some (.inl j)) s ev = physicalRootMixedFourierMultiplier groups e patterns C k code encode ν hPs hPb hdis (some (.inl j)) s ev := by rfl theorem physical_root_fourier_permutation_factor (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (ev : PhysicalRootMixedEvent groups e patterns C k none s) : physicalRootMixedFourierPhase groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis none s ev = 1 := by change (1 : ℂ) * 1 = 1 exact mul_one _ theorem physical_root_fourier_edge_multiplier_untouched (j : Fin (n + 1)) (hj : j ∉ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (ev : PhysicalRootMixedEvent groups e patterns C k (some (.inr j)) s) : physicalRootMixedFourierMultiplier groups e patterns C k code encode ν hPs hPb hdis (some (.inr j)) s ev = 1 := by unfold physicalRootMixedFourierMultiplier physicalMixedBigLocalPullback physicalRootPlannedFourierMultiplier physicalRootEffectiveFourierMultiplier dsimp only [physicalSelectedDecoratedPhase] simp only [one_mul] exact physical_selected_edge_multiplier_untouched _ _ _ code ν encode j hj _ end Root end Bounty end section -- Original source module: PhysicalSelectedOperatorGrouping /- Exact grouping of the selected operator word into ghost visits and edges sandwiched by the two original permutation averages. -/ namespace Bounty theorem finite_operator_list_action_map {I K X : Type*} (row : I → (X → ℂ) → X → ℂ) (tag : K → I) (ks : List K) (f : X → ℂ) : finiteOperatorListAction row (ks.map tag) f = finiteOperatorListAction (fun k => row (tag k)) ks f := by induction ks with | nil => rfl | cons k ks ih => simp only [List.map_cons, finiteOperatorListAction, ih] theorem physical_selected_fine_tag_before_edge {n : ℕ} (j : Fin n) : physicalSelectedFineTag n (4 * j.val + 1) = none := by have hi : 4 * j.val + 1 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 1) % 4 = 0 := by omega have h2 : ¬ (4 * j.val + 1) % 4 = 2 := by omega simp only [physicalSelectedFineTag, dif_pos hi, dif_neg h0, dif_neg h2] theorem physical_selected_fine_tag_after_edge {n : ℕ} (j : Fin n) : physicalSelectedFineTag n (4 * j.val + 3) = none := by have hi : 4 * j.val + 3 < 4 * n + 1 := by omega have h0 : ¬ (4 * j.val + 3) % 4 = 0 := by omega have h2 : ¬ (4 * j.val + 3) % 4 = 2 := by omega simp only [physicalSelectedFineTag, dif_pos hi, dif_neg h0, dif_neg h2] section Grouped variable {X : Type*} {n : ℕ} (row : Option (Fin (n + 1) ⊕ Fin n) → (X → ℂ) → X → ℂ) end Grouped end Bounty end section -- Original source module: PhysicalRootFourierRows /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) noncomputable def physicalRootFourierRow : Option (Fin (n + 2) ⊕ Fin (n + 1)) → (PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) → PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ := let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) physicalMixedWordRow (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ a => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) a) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) (physicalRootMixedFourierPhase groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis) theorem physical_root_fourier_word_rows (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : physicalRootFourierWord groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν f L x = finiteOperatorListAction (physicalRootFourierRow (n := n) groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (fun s => f s.2) ((physicalGroupResidueVector r, L), x) := rfl end Root end Bounty end section -- Original source module: PhysicalMixedRowAverage /- Every row is the actual signed ghost row, the two permutation averages, or the sum of actual mixed full actions over one pattern and one auxiliary. -/ open Finset open scoped Classical namespace Bounty section Rows variable {S G I V K : Type} [Fintype S] [Fintype G] [dG : DecidableEq G] [Fintype I] [dS : DecidableEq S] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) (phase : ∀ tag s, PhysicalMixedWordEvent (ell := ell) n shared B A Δ D tag s → ℂ) theorem physical_mixed_word_row_joint_average (hphase : ∀ s e, phase none s e = 1) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) : physicalMixedWordRow n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase none F s = physicalSmallBigJointAverage F s := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) unfold physicalMixedWordRow finiteLocalPhasedRow rw [physical_small_big_joint_average_eq_sum] let _ := physicalMixedWordEventFintype (ell := ell) (V := V) n shared B A Δ D apply Finset.sum_congr · ext ev exact iff_of_true (@Finset.mem_univ _ _ ev) (@Finset.mem_univ _ _ ev) · intro ev _ simp only [physicalMixedWordWeight, physicalMixedWordTarget] erw [hphase, mul_one] rfl end Rows end Bounty end section -- Original source module: PhysicalRootFourierPermutation /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable [∀ g (p : P (e.symm g).val), NeZero p.val] theorem physical_root_fourier_permutation_row (f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) : physicalRootFourierRow (n := n) groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν none f = physicalSmallBigJointAverage (S := ↥groupsᶜ) (G := Fin M) (Ps := fun s => P s.val) (P := fun g => ↥(P (e.symm g).val)) (Z := fun g => UnrestrictedResidueParticle (fun p : P (e.symm g).val => p.val)) (J := J) (ell := ell) (M := fun _ => J + ell) (B := B) f := by funext s exact physical_mixed_word_row_joint_average (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ a => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) a) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) (physicalRootMixedFourierPhase groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis) (fun y ev => physical_root_fourier_permutation_factor groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis y ev) f s end Root end Bounty end end section /- Root Fourier bridge bodies on the coherent actual-Z dependency boundary. -/ section -- Original source module: PhysicalRootEdgeParameters /- Named actual big-edge data keep dependent root coefficient statements small. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex) (ev : PhysicalRootMixedEvent groups reindex patterns C k (some (.inr j)) s) noncomputable def physicalRootEdgeKey : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) := (j, ev.1, s.1.2, ev.2.2.1) variable (hPs : ∀ (g : ↥groupsᶜ) p, p ∈ P g.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (g : ↥groupsᶜ) (h : Fin M), Disjoint (P g.val) (P (reindex.symm h).val)) noncomputable def physicalRootEffectiveEdgeEvent : PhysicalFullEdgeEvent (fun g => C ev.1.val (reindex.symm g).val) (k (n - j.val) ev.1.val * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ)) s.2 := let key := physicalRootEdgeKey groups reindex patterns C k j s ev let cuts := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C z.2.1.val (reindex.symm g).val let prefixes := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => physicalSharedPrefix z.2.2.1 let steps := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - z.1.val) z.2.1.val physicalMixedEffectiveBigEventEquiv hPs hPb hdis cuts prefixes steps B (some (.inr key) : Option (Fin (n + 2) ⊕ _)) s.2 ⟨ev.2.1, ev.2.2.2.2⟩ noncomputable def physicalRootEffectiveEdgeWeight (V : Fin N → ℝ) (β : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) : ℝ := let cut := fun g => C ev.1.val (reindex.symm g).val let step := k (n - j.val) ev.1.val * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ) fullActiveEdgeEventWeight (fun g (p : P (reindex.symm g).val) => p.val) (fun g => physicalFullSharedIndices (cut g)) B (fun _ => PhysicalAuxLabels (fun g => P (reindex.symm g).val) cut) (physicalFullEdgeDelta cut step) (physicalFullEdgeD cut) (fun _ aux => physicalAuxMass (fun g => V (reindex.symm g).val) cut aux) (fun g p => β g p / V (reindex.symm g).val) ρ (fun g => V (reindex.symm g).val) s.2 (physicalRootEffectiveEdgeEvent groups reindex patterns C k j s ev hPs hPb hdis) end Root end Bounty end section -- Original source module: PhysicalEffectiveCoefficientTransport /- Effective big-event transport preserves the original active endpoints and auxiliary draw used by the full key coefficient. -/ open scoped Classical namespace Bounty section Effective variable {S K V : Type} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) (C : K → Fin N → Finset (Fin J)) (d : K → PhysicalSharedLists Ps J) (k : K → ℤ) (B : ℕ) theorem physical_mixed_effective_big_target (tag : Option (V ⊕ K)) (x : PhysicalFullBoundedState P J ell B) (e : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) tag x) : fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key)) tag x (physicalMixedEffectiveBigEventEquiv hPs hP hdis C d k B tag x e) = fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) tag x e := full_permutation_parameter_target _ _ B _ _ _ _ _ (fun key => funext fun c => funext fun a => funext fun g => physical_mixed_delta_effective_big_step (C key) (d key) (k key) c a g) (fun key c a g p => physical_mixed_dilation_divisibility hPs hP hdis (C key) (d key) c a g p) tag x e theorem physical_mixed_effective_big_auxiliary (key : K) (x : PhysicalFullBoundedState P J ell B) (e : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) (some (.inr key) : Option (V ⊕ K)) x) : (physicalMixedEffectiveBigEventEquiv hPs hP hdis C d k B (some (.inr key) : Option (V ⊕ K)) x e).1 = e.1 := full_active_parameter_auxiliary _ _ B _ _ _ _ _ (funext fun c => funext fun a => funext fun g => physical_mixed_delta_effective_big_step (C key) (d key) (k key) c a g) (fun c a g p => physical_mixed_dilation_divisibility hPs hP hdis (C key) (d key) c a g p) x e theorem physical_mixed_effective_key_coefficient (ζ : K → ℝ) (coeff : ∀ key, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C key) → ℂ) (key : K) (x : PhysicalFullBoundedState P J ell B) (e : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) (some (.inr key) : Option (V ⊕ K)) x) : physicalFullKeyCoefficientPhase C (fun key => k key * (physicalSharedProduct (d key) : ℕ)) ζ coeff (some (.inr key) : Option (V ⊕ K)) x (physicalMixedEffectiveBigEventEquiv hPs hP hdis C d k B (some (.inr key) : Option (V ⊕ K)) x e) = physicalActiveCoefficient (C key) (C key) (C key) (ζ key) (coeff key) (fun g => (x g).1) (fun g => (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) (some (.inr key) : Option (V ⊕ K)) x e g).1) e.1 := by dsimp only [physicalFullKeyCoefficientPhase] rw [physical_mixed_effective_big_target, physical_mixed_effective_big_auxiliary] end Effective end Bounty end section -- Original source module: PhysicalRootEdgeTransport /- The named actual root edge preserves its target and auxiliary draw. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex) (ev : PhysicalRootMixedEvent groups reindex patterns C k (some (.inr j)) s) (hPs : ∀ (g : ↥groupsᶜ) p, p ∈ P g.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (g : ↥groupsᶜ) (h : Fin M), Disjoint (P g.val) (P (reindex.symm h).val)) theorem physical_root_effective_edge_auxiliary : (physicalRootEffectiveEdgeEvent groups reindex patterns C k j s ev hPs hPb hdis).1 = ev.2.1 := by unfold physicalRootEffectiveEdgeEvent exact physical_mixed_effective_big_auxiliary hPs hPb hdis _ _ _ B _ _ _ theorem physical_root_effective_edge_target : let cut := fun g => C ev.1.val (reindex.symm g).val let step := k (n - j.val) ev.1.val fullActiveEdgeEventTarget (fun g (p : P (reindex.symm g).val) => p.val) (fun g => physicalFullSharedIndices (cut g)) B (fun _ => PhysicalAuxLabels (fun g => P (reindex.symm g).val) cut) (physicalFullEdgeDelta cut (step * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ))) (physicalFullEdgeD cut) s.2 (physicalRootEffectiveEdgeEvent groups reindex patterns C k j s ev hPs hPb hdis) = (physicalMixedCoefficientTarget cut step ev.2.1 s ev.2.2).2 := by intro cut step let key := physicalRootEdgeKey groups reindex patterns C k j s ev let cuts := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C z.2.1.val (reindex.symm g).val let prefixes := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => physicalSharedPrefix z.2.2.1 let steps := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - z.1.val) z.2.1.val have ht := physical_mixed_effective_big_target hPs hPb hdis cuts prefixes steps B (some (.inr key) : Option (Fin (n + 2) ⊕ _)) s.2 ⟨ev.2.1, ev.2.2.2.2⟩ exact ht end Root end Bounty end section -- Original source module: PhysicalRootLocalCoefficientTransport /- A root mixed event uses its actual pattern, auxiliary draw, and mixed endpoint. -/ open scoped Classical namespace Bounty theorem physical_root_mixed_local_coefficient_transport {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (reindex.symm g).val)) (j : Fin (n + 1)) (H : (g : Fin M) → Finset (P (reindex.symm g).val)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex) (ev : PhysicalRootMixedEvent groups reindex patterns C k (some (.inr j)) s) : let key : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) := (j, ev.1, s.1.2, ev.2.2.1) let cuts := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C z.2.1.val (reindex.symm g).val let prefixes := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => physicalSharedPrefix z.2.2.1 let steps := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - z.1.val) z.2.1.val let effective := physicalMixedEffectiveBigEventEquiv hPs hPb hdis cuts prefixes steps B (some (.inr key) : Option (Fin (n + 2) ⊕ _)) s.2 ⟨ev.2.1, ev.2.2.2.2⟩ let target := physicalMixedCoefficientTarget (cuts key) (steps key) ev.2.1 s ev.2.2 physicalRootMixedLocalPhase groups reindex patterns C hC k V ζ K θ β ρ hPs hPb hdis (some (.inr j)) H s ev = physicalFullGlobalEdgePhase (cuts key) (steps key * (physicalSharedProduct (prefixes key) : ℕ)) H (fun _ aux => physicalAuxMass (fun g => V (reindex.symm g).val) (cuts key) aux) (fun g p => β g p / V (reindex.symm g).val) ρ (fun g => V (reindex.symm g).val) s.2 effective * physicalActiveCoefficient (cuts key) (cuts key) (cuts key) 0 (physicalRootKeyCoefficient groups reindex patterns C hC ζ k K θ key) (fun g => (s.2 g).1) (fun g => (target.2 g).1) ev.2.1 := by dsimp only [physicalRootMixedLocalPhase, physicalMixedBigEventPullback, physicalMixedBigEventTag, physicalMixedBigEventProjection, physicalRootPlannedLocalPhase, physicalRootEffectiveLocalPhase] rw [physicalFullCombinedPhase] erw [physical_mixed_effective_key_coefficient] rfl end Bounty end section -- Original source module: FullLedgerActualTarget /- Nonzero event weights identify the ledger phase at its actual target. -/ open Finset open scoped Classical namespace Bounty theorem bounded_ledger_phase_at_target {P : Type*} [DecidableEq P] (n : P → ℕ) (Δ D : ℤ) (t B : ℕ) (target : Fin t → P) (H : Finset P) (μ : P → ℝ) (ρ V : ℝ) (s : BoundedOrderedState P (UnrestrictedResidueParticle n) t B) (e : UnrestrictedBoundedEvent n Δ D t B s) (hw : unrestrictedBoundedEventWeight n Δ D μ ρ V t B s e ≠ 0) (ht : (unrestrictedBoundedEventTarget n Δ D t B s e).1 = target) : globalBirthBoundedEdgePhase n Δ D t B target H s e.1 e.2.1 e.2.2.1 e.2.2.2 = if ∀ i, e.2.2.2 i ∉ H then 1 else 0 := by have hout : (unrestrictedEdgeOutput s.1 s.2.2 (unrestrictedResidueSeed n) (unrestrictedResidueTransport n Δ) e.1 e.2.1 e.2.2.1).1 ≤ B := by by_contra h exact hw (by simp only [unrestrictedBoundedEventWeight, h, and_false, if_false]) have ht' : unrestrictedEdgeTarget s.2.2 Sigma.fst e.2.1 e.2.2.1 e.2.2.2 = target := by simpa only [unrestrictedBoundedEventTarget, dif_pos hout] using ht simp only [globalBirthBoundedEdgePhase, ht', true_and] theorem full_ledger_phase_at_target {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : SharedActiveLabels P S → Type*) [∀ c, Fintype (A c)] (Δ D : ∀ c, A c → Fin N → ℤ) (target : (g : Fin N) → Fin (S g)ᶜ.card → P g) (H : (g : Fin N) → Finset (P g)) (ω : ∀ c, A c → ℝ) (μ : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullActiveEdgeEvent n S B A Δ D x) (hw : fullActiveEdgeEventWeight n S B A Δ D ω μ ρ V x e ≠ 0) (ht : ∀ g, ((productActiveMemorySplit S B (fullActiveEdgeEventTarget n S B A Δ D x e)).2 g).1 = target g) : fullEdgeLedgerPhase n S B A Δ D target H x e = if ∀ g i, (e.2 g).2.2.2 i ∉ H g then 1 else 0 := by have he (g : Fin N) : globalBirthBoundedEdgePhase (n g) (Δ (productActiveMemorySplit S B x).1 e.1 g) (D (productActiveMemorySplit S B x).1 e.1 g) (S g)ᶜ.card B (target g) (H g) ((productActiveMemorySplit S B x).2 g) (e.2 g).1 (e.2 g).2.1 (e.2 g).2.2.1 (e.2 g).2.2.2 = if ∀ i, (e.2 g).2.2.2 i ∉ H g then 1 else 0 := by apply bounded_ledger_phase_at_target _ _ _ _ _ _ _ (μ g) ρ (V g) _ _ (full_edge_ledger_local_weight_ne_zero n S B A Δ D ω μ ρ V x e hw g) simpa only [fullActiveEdgeEventTarget, Equiv.apply_symm_apply, unrestrictedJointEventTarget] using ht g unfold fullEdgeLedgerPhase simp_rw [he] by_cases h : ∀ g i, (e.2 g).2.2.2 i ∉ H g · simp only [if_pos h, if_pos (h _), prod_const_one] · rw [if_neg h] obtain ⟨g, hg⟩ := not_forall.mp h exact prod_eq_zero (mem_univ g) (if_neg hg) end Bounty end section -- Original source module: PhysicalEndpointActualTarget /- The physical endpoint sum selects its actual target on contributing events. -/ open Finset open scoped Classical namespace Bounty section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (L R : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset (P g)) (q qR : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : P g => p.val)) B) (ω : ∀ _c : SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) theorem physical_full_edge_phase_at_target (hw : fullActiveEdgeEventWeight (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e ≠ 0) (ht : fullActiveEdgeEventTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) (physicalFullMemoryState C L q) e = physicalFullMemoryState C R qR) : physicalFullEdgePhase C k L R H q e = if physicalListAdmissible C e.1 L R ∧ (∀ g i, (e.2 g).2.2.2 i ∉ H g) then 1 else 0 := by by_cases ha : physicalListAdmissible C e.1 L R · simp only [physicalFullEdgePhase, ha, true_and] apply full_ledger_phase_at_target _ _ _ _ _ _ _ _ ω μ ρ V _ e hw intro g rw [ht, physical_full_memory_state_unshared, physical_full_memory_state_unshared] · simp only [physicalFullEdgePhase, ha, false_and, if_false] theorem physical_full_endpoint_phase_at_target (hw : fullActiveEdgeEventWeight (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e ≠ 0) (ht : fullActiveEdgeEventTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) (physicalFullMemoryState C L q) e = physicalFullMemoryState C R qR) : physicalFullEndpointPhase C k L H q ω μ ρ V e = if physicalListAdmissible C e.1 L R ∧ (∀ g i, (e.2 g).2.2.2 i ∉ H g) then 1 else 0 := by unfold physicalFullEndpointPhase rw [if_neg hw, sum_eq_single R] · exact physical_full_edge_phase_at_target C k L R H q qR ω μ ρ V e hw ht · intro T _ hTR by_contra hn have hy := physical_full_edge_target_of_nonzero C k L T H q ω μ ρ V e hw hn exact hTR (physical_full_state_labels_of_eq C T R _ _ (hy.symm.trans ht)) · simp only [mem_univ, not_true_eq_false, false_implies] end Physical end Bounty end section -- Original source module: PhysicalGlobalActualTarget /- The global physical phase is determined by its actual contributing target. -/ open scoped Classical namespace Bounty section Physical variable {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (H : (g : Fin N) → Finset (P g)) (ω : ∀ _c : SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_full_global_phase_at_target (x : PhysicalFullBoundedState P J ell B) (hx : FullActiveInjective x) (e : PhysicalFullEdgeEvent C k x) (hw : fullActiveEdgeEventWeight (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V x e ≠ 0) (R : PhysicalMarkLists P J ell) (qR : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : P g => p.val)) B) (ht : fullActiveEdgeEventTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x e = physicalFullMemoryState C R qR) : physicalFullGlobalEdgePhase C k H ω μ ρ V x e = if physicalListAdmissible C e.1 (physicalFullStateLabels C x hx) R ∧ (∀ g i, (e.2 g).2.2.2 i ∉ H g) then 1 else 0 := by have hencoded (L : PhysicalMarkLists P J ell) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : P g => p.val)) B) (e : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) (hw : fullActiveEdgeEventWeight (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) e ≠ 0) (ht : fullActiveEdgeEventTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) (physicalFullMemoryState C L q) e = physicalFullMemoryState C R qR) : physicalFullGlobalEdgePhase C k H ω μ ρ V (physicalFullMemoryState C L q) e = if physicalListAdmissible C e.1 L R ∧ (∀ g i, (e.2 g).2.2.2 i ∉ H g) then 1 else 0 := by rw [physical_full_global_edge_phase_encode] exact physical_full_endpoint_phase_at_target C k L R H q qR ω μ ρ V e hw ht have he := hencoded (physicalFullStateLabels C x hx) (fun g => (x g).2) rw [physical_full_state_encode_labels C x hx] at he exact he e hw ht end Physical end Bounty end section -- Original source module: PhysicalSharedTargetCompatibility /- Actual full-state targets preserve the shared physical labels. -/ open Finset namespace Bounty theorem physical_shared_compatible_of_full_memory_state_shared {G : Type*} {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L R : PhysicalMarkLists P J ell) (q r : ∀ g, BoundedOrderedTuple (Z g) B) (hshared : (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C L q)).1 = (productActiveMemorySplit (fun g => physicalFullSharedIndices (C g)) B (physicalFullMemoryState C R r)).1) : physicalSharedCompatible C L R := by classical intro g s hs let j := (physicalFullSlotIndex (ell := ell) (C g)).symm (Sum.inl s) have hj : j ∈ physicalFullSharedIndices (C g) := by apply (physical_full_slot_index_shared_iff (C g) j).mp rw [show physicalFullSlotIndex (C g) j = Sum.inl s from (physicalFullSlotIndex (C g)).apply_symm_apply _] exact (physical_mem_shared_slots_iff (C g) _).mpr ⟨s, hs, rfl⟩ have he := congrFun (congrFun hshared g) ((physicalFullSharedIndices (C g)).equivFin ⟨j, hj⟩) change L g (physicalFullSlotIndex (C g) (((physicalFullSharedIndices (C g)).equivFin.symm ((physicalFullSharedIndices (C g)).equivFin ⟨j, hj⟩)).val)) = R g (physicalFullSlotIndex (C g) (((physicalFullSharedIndices (C g)).equivFin.symm ((physicalFullSharedIndices (C g)).equivFin ⟨j, hj⟩)).val)) at he simpa only [Equiv.symm_apply_apply, j, Equiv.apply_symm_apply] using he theorem physical_full_event_target_shared_compatible {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (x : PhysicalFullBoundedState P J ell B) (hx : FullActiveInjective x) (e : PhysicalFullEdgeEvent C k x) (hy : FullActiveInjective (fullActiveEdgeEventTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x e)) : physicalSharedCompatible C (physicalFullStateLabels C x hx) (physicalFullStateLabels C (fullActiveEdgeEventTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x e) hy) := by apply physical_shared_compatible_of_full_memory_state_shared C _ _ (fun g => (x g).2) (fun g => (fullActiveEdgeEventTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x e g).2) rw [physical_full_state_encode_labels, physical_full_state_encode_labels] exact (fullActiveEdgeEventTarget_shared _ _ _ _ _ _ x e).symm end Bounty end section -- Original source module: PhysicalWeightedActualCoefficient /- Exact weighted removal of the endpoint sum retains the two auxiliary bans. -/ open Finset open scoped Classical namespace Bounty theorem physical_weighted_global_active_coefficient {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (ω : ∀ _c : SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ζ : ℝ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullEdgeEvent C k x) : let y := fullActiveEdgeEventTarget (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) x e let W := fullActiveEdgeEventWeight (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C g)) B (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V x e let source : RepeatedBigLists P J ell := fun g j => (x g).1 ((physicalFullSlotIndex (C g)).symm j) let target : RepeatedBigLists P J ell := fun g j => (y g).1 ((physicalFullSlotIndex (C g)).symm j) let coeff := physicalActiveCoefficient C C C ζ K (fun g => (x g).1) (fun g => (y g).1) e.1 (W : ℂ) * (physicalFullGlobalEdgePhase C k (fun _ => ∅) ω μ ρ V x e * coeff) = (W : ℂ) * ((if repeatedBigAuxAvoids C e.1 source ∧ repeatedBigAuxAvoids C e.1 target then (1 : ℂ) else 0) * coeff) := by intro y W source target coeff by_cases hw : W = 0 · simp only [hw, Complex.ofReal_zero, zero_mul] · by_cases hx : FullActiveInjective x · by_cases hy : FullActiveInjective y · have ht : y = physicalFullMemoryState C (physicalFullStateLabels C y hy) (fun g => (y g).2) := (physical_full_state_encode_labels C y hy).symm have hs := physical_full_event_target_shared_compatible C k x hx e hy have hp := physical_full_global_phase_at_target C k (fun _ => ∅) ω μ ρ V x hx e hw (physicalFullStateLabels C y hy) (fun g => (y g).2) ht have hs' : physicalSharedCompatible C (physicalFullStateLabels C x hx) (physicalFullStateLabels C y hy) := hs have hgate : physicalListAdmissible C e.1 (physicalFullStateLabels C x hx) (physicalFullStateLabels C y hy) ↔ repeatedBigAuxAvoids C e.1 source ∧ repeatedBigAuxAvoids C e.1 target := ⟨fun h => h.2, fun h => ⟨hs', h⟩⟩ have hnone : ∀ g i, (e.2 g).2.2.2 i ∉ (∅ : Finset (P g)) := fun _ _ => Finset.notMem_empty _ have hp' : physicalFullGlobalEdgePhase C k (fun _ => ∅) ω μ ρ V x e = if repeatedBigAuxAvoids C e.1 source ∧ repeatedBigAuxAvoids C e.1 target then (1 : ℂ) else 0 := by simpa only [hnone, not_false_eq_true, forall_true_iff, and_true, hgate] using hp rw [hp'] · have hc : coeff = 0 := by dsimp only [coeff] unfold physicalActiveCoefficient change (∀ g, Function.Injective (x g).1) at hx change ¬ (∀ g, Function.Injective (y g).1) at hy rw [dif_pos hx, dif_neg hy] simp only [hc, mul_zero] · have hc : coeff = 0 := by dsimp only [coeff] unfold physicalActiveCoefficient change ¬ (∀ g, Function.Injective (x g).1) at hx rw [dif_neg hx] simp only [hc, mul_zero] end Bounty end section -- Original source module: PhysicalRootWeightedEmptyCoefficient /- The actual weighted big-edge residual is its exact auxiliary-gated active coefficient. -/ open scoped Classical namespace Bounty theorem physical_root_mixed_weighted_empty_coefficient {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (reindex.symm g).val)) (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex) (ev : PhysicalRootMixedEvent groups reindex patterns C k (some (.inr j)) s) : let cut := fun g => C ev.1.val (reindex.symm g).val let target := physicalMixedCoefficientTarget cut (k (n - j.val) ev.1.val) ev.2.1 s ev.2.2 let W := physicalRootEffectiveEdgeWeight groups reindex patterns C k j s ev hPs hPb hdis V β ρ (W : ℂ) * physicalRootMixedLocalPhase groups reindex patterns C hC k V ζ K θ β ρ hPs hPb hdis (some (.inr j)) (fun _ => ∅) s ev = (W : ℂ) * ((if repeatedBigAuxAvoids cut ev.2.1 (physicalMixedRepeatedLabels cut s.2) ∧ repeatedBigAuxAvoids cut ev.2.1 (physicalMixedRepeatedLabels cut target.2) then (1 : ℂ) else 0) * physicalActiveCoefficient cut cut cut 0 (physicalRootKeyCoefficient groups reindex patterns C hC ζ k K θ (physicalRootEdgeKey groups reindex patterns C k j s ev)) (fun g => (s.2 g).1) (fun g => (target.2 g).1) ev.2.1) := by intro cut target W have ht := physical_root_effective_edge_target groups reindex patterns C k j s ev hPs hPb hdis have ha := physical_root_effective_edge_auxiliary groups reindex patterns C k j s ev hPs hPb hdis have hw := physical_weighted_global_active_coefficient cut (k (n - j.val) ev.1.val * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ)) (fun _ aux => physicalAuxMass (fun g => V (reindex.symm g).val) cut aux) (fun g p => β g p / V (reindex.symm g).val) ρ (fun g => V (reindex.symm g).val) 0 (physicalRootKeyCoefficient groups reindex patterns C hC ζ k K θ (physicalRootEdgeKey groups reindex patterns C k j s ev)) s.2 (physicalRootEffectiveEdgeEvent groups reindex patterns C k j s ev hPs hPb hdis) dsimp only at hw ht rw [ht, ha] at hw rw [physical_root_mixed_local_coefficient_transport] exact hw end Bounty end section -- Original source module: PhysicalCoupledFourierCoefficient /- Exact original coefficient and phase factors after splitting and reindexing groups. -/ open scoped Classical namespace Bounty theorem physical_coupled_fourier_coefficient {G I : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (small : G → Prop) (C : I → G → Finset (Fin J)) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (ζ θ : ℝ) (t : ℕ) (i : I) (Ls Rs : PhysicalMarkLists (fun g : {g // small g} => P g.val) J ell) (aSmall : PhysicalAuxLabels (fun g : {g // small g} => P g.val) (fun g => C i g.val)) (Lb Rb : PhysicalMarkLists (fun g : {g // ¬small g} => P g.val) J ell) (aBig : PhysicalAuxLabels (fun g : {g // ¬small g} => P g.val) (fun g => C i g.val)) : let L := (physicalMarkGroupSplit small P J ell).symm (Ls, Lb) let R := (physicalMarkGroupSplit small P J ell).symm (Rs, Rb) let a := (physicalAuxGroupSplit small P J (C i)).symm (aSmall, aBig) physicalCoupledBigCoefficient small (C i) ζ (physicalLocalFourierCoefficient C k K θ t i) Ls Rs aSmall Lb Rb aBig = K t i L R a * physicalPhase ζ (physicalD (C i) L a) * physicalReturnPhase θ (k t i * (physicalD (C i) L a : ℕ)) := by dsimp only let L := (physicalMarkGroupSplit small P J ell).symm (Ls, Lb) let a := (physicalAuxGroupSplit small P J (C i)).symm (aSmall, aBig) have hL := (physicalMarkGroupSplit small P J ell).apply_symm_apply (Ls, Lb) have ha := (physicalAuxGroupSplit small P J (C i)).apply_symm_apply (aSmall, aBig) have hLs : (fun g : {g // small g} => L g.val) = Ls := congrArg Prod.fst hL have hLb : (fun g : {g // ¬small g} => L g.val) = Lb := congrArg Prod.snd hL have has : (fun g : {g // small g} => a g.val) = aSmall := congrArg Prod.fst ha have hab : (fun g : {g // ¬small g} => a g.val) = aBig := congrArg Prod.snd ha have hD := physical_D_group_split small (C i) a L rw [hLs, hLb, has, hab] at hD change _ = K t i L _ a * physicalPhase ζ (physicalD (C i) L a) * _ unfold physicalCoupledBigCoefficient physicalLocalFourierCoefficient change K t i L _ a * physicalReturnPhase θ (k t i * (physicalD (C i) L a : ℕ)) * physicalPhase ζ _ = _ rw [← hD] ring theorem physical_reindexed_coupled_fourier_coefficient {G H I : Type*} [Fintype G] [Fintype H] {P : G → Finset ℕ} {J ell B : ℕ} (small : G → Prop) (reindex : {g // ¬small g} ≃ H) (C : I → G → Finset (Fin J)) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (ζ θ : ℝ) (t : ℕ) (i : I) (hC : ∀ g, small g → C i g = ∅) (Ls Rs : PhysicalMarkLists (fun g : {g // small g} => P g.val) J ell) (aSmall : PhysicalAuxLabels (fun g : {g // small g} => P g.val) (fun g => C i g.val)) (Lb Rb : PhysicalMarkLists (fun g => P (reindex.symm g).val) J ell) (aBig : PhysicalAuxLabels (fun g => P (reindex.symm g).val) (fun g => C i (reindex.symm g).val)) {Z : H → Type*} (memory : ∀ g, BoundedOrderedTuple (Z g) B) : let Cb := fun g => C i (reindex.symm g).val let Lold := (physicalMarkGroupReindex reindex (fun g => P g.val) J ell).symm Lb let Rold := (physicalMarkGroupReindex reindex (fun g => P g.val) J ell).symm Rb let aold := (physicalAuxGroupReindex reindex (fun g => P g.val) J (fun g => C i g.val)).symm aBig let L := (physicalMarkGroupSplit small P J ell).symm (Ls, Lold) let R := (physicalMarkGroupSplit small P J ell).symm (Rs, Rold) let a := (physicalAuxGroupSplit small P J (C i)).symm (aSmall, aold) let cp := (productActiveMemorySplit (fun g => physicalFullSharedIndices (Cb g)) B (physicalFullMemoryState Cb Lb memory)).1 let d := physicalSharedPrefix Ls physicalGroupReindexedCoefficient reindex (fun g => C i g.val) (physicalCoupledBigCoefficient small (C i) ζ (physicalLocalFourierCoefficient C k K θ t i) Ls Rs aSmall) Lb Rb aBig = K t i L R a * physicalPhase ζ (physicalMixedSharedD Cb d cp aBig) * physicalReturnPhase θ (physicalMixedBigStep Cb (k t i) cp aBig * (physicalSharedProduct d : ℕ)) := by dsimp only let Lold := (physicalMarkGroupReindex reindex (fun g => P g.val) J ell).symm Lb let aold := (physicalAuxGroupReindex reindex (fun g => P g.val) J (fun g => C i g.val)).symm aBig let L := (physicalMarkGroupSplit small P J ell).symm (Ls, Lold) let a := (physicalAuxGroupSplit small P J (C i)).symm (aSmall, aold) have hL := (physicalMarkGroupSplit small P J ell).apply_symm_apply (Ls, Lold) have ha := (physicalAuxGroupSplit small P J (C i)).apply_symm_apply (aSmall, aold) have hLs : (fun g : {g // small g} => L g.val) = Ls := congrArg Prod.fst hL have hLb : (fun g : {g // ¬small g} => L g.val) = Lold := congrArg Prod.snd hL have hab : (fun g : {g // ¬small g} => a g.val) = aold := congrArg Prod.snd ha have hD := physical_mixed_shared_D_reindexed small reindex (C i) hC a L memory rw [hLs, hLb, hab] at hD simp only [Lold, aold, Equiv.apply_symm_apply] at hD unfold physicalGroupReindexedCoefficient rw [physical_coupled_fourier_coefficient, physical_mixed_step_factor, hD] end Bounty end section -- Original source module: PhysicalRootKeyMixedCoefficient /- The actual root key retains precisely the original coefficient and two mixed phases. -/ open scoped Classical namespace Bounty theorem physical_root_key_mixed_coefficient {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (key : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) (Lb Rb : PhysicalMarkLists (fun g => P (reindex.symm g).val) J ell) (aBig : PhysicalAuxLabels (fun g => P (reindex.symm g).val) (fun g => C key.2.1.val (reindex.symm g).val)) {Z : Fin M → Type*} (memory : ∀ g, BoundedOrderedTuple (Z g) B) : let i := key.2.1.val let t := n - key.1.val let Cb := fun g => C i (reindex.symm g).val let Lold := (physicalMarkGroupReindex reindex (fun g => P g.val) J ell).symm Lb let Rold := (physicalMarkGroupReindex reindex (fun g => P g.val) J ell).symm Rb let aold := (physicalAuxGroupReindex reindex (fun g => P g.val) J (fun g => C i g.val)).symm aBig let L := (physicalMarkGroupSplit (fun g => g ∈ groupsᶜ) P J ell).symm (key.2.2.1, Lold) let R := (physicalMarkGroupSplit (fun g => g ∈ groupsᶜ) P J ell).symm (key.2.2.2, Rold) let a := (physicalAuxGroupSplit (fun g => g ∈ groupsᶜ) P J (C i)).symm (physicalEmptyAuxLabels (fun g : ↥groupsᶜ => C i g.val) (hC key.2.1), aold) let cp := (productActiveMemorySplit (fun g => physicalFullSharedIndices (Cb g)) B (physicalFullMemoryState Cb Lb memory)).1 let d := physicalSharedPrefix key.2.2.1 physicalRootKeyCoefficient groups reindex patterns C hC ζ k K θ key Lb Rb aBig = K t i L R a * physicalPhase (ζ t i) (physicalMixedSharedD Cb d cp aBig) * physicalReturnPhase θ (physicalMixedBigStep Cb (k t i) cp aBig * (physicalSharedProduct d : ℕ)) := by have h := physical_reindexed_coupled_fourier_coefficient (fun g => g ∈ groupsᶜ) reindex C k K (ζ (n - key.1.val) key.2.1.val) θ (n - key.1.val) key.2.1.val (fun g hg => hC key.2.1 ⟨g, hg⟩) key.2.2.1 key.2.2.2 (physicalEmptyAuxLabels (fun g : ↥groupsᶜ => C key.2.1.val g.val) (hC key.2.1)) Lb Rb aBig memory dsimp only [physicalRootKeyCoefficient] at h ⊢ convert h using 1 congr <;> exact Subsingleton.elim _ _ end Bounty end section -- Original source module: PhysicalRootKeyProductCoefficient /- The root-key phases use the exact small-prefix product times the big divisor. -/ open scoped Classical namespace Bounty theorem physical_root_key_product_coefficient {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (key : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) (Lb Rb : PhysicalMarkLists (fun g => P (reindex.symm g).val) J ell) (aBig : PhysicalAuxLabels (fun g => P (reindex.symm g).val) (fun g => C key.2.1.val (reindex.symm g).val)) : let i := key.2.1.val let t := n - key.1.val let Cb := fun g => C i (reindex.symm g).val let Lold := (physicalMarkGroupReindex reindex (fun g => P g.val) J ell).symm Lb let Rold := (physicalMarkGroupReindex reindex (fun g => P g.val) J ell).symm Rb let aold := (physicalAuxGroupReindex reindex (fun g => P g.val) J (fun g => C i g.val)).symm aBig let L := (physicalMarkGroupSplit (fun g => g ∈ groupsᶜ) P J ell).symm (key.2.2.1, Lold) let R := (physicalMarkGroupSplit (fun g => g ∈ groupsᶜ) P J ell).symm (key.2.2.2, Rold) let a := (physicalAuxGroupSplit (fun g => g ∈ groupsᶜ) P J (C i)).symm (physicalEmptyAuxLabels (fun g : ↥groupsᶜ => C i g.val) (hC key.2.1), aold) let ds := physicalSharedProduct (physicalSharedPrefix key.2.2.1) physicalRootKeyCoefficient groups reindex patterns C hC ζ k K θ key Lb Rb aBig = K t i L R a * physicalPhase (ζ t i) (ds * physicalD Cb Lb aBig) * physicalReturnPhase θ (k t i * (ds * physicalD Cb Lb aBig : ℕ)) := by let memory : ∀ _g : Fin M, BoundedOrderedTuple Unit 0 := fun _ => ⟨0, fun j => Fin.elim0 j⟩ have h := physical_root_key_mixed_coefficient groups reindex patterns C hC ζ k K θ key Lb Rb aBig memory dsimp only at h ⊢ simpa only [physical_mixed_step_factor, physical_mixed_shared_D_at_state] using h end Bounty end section -- Original source module: RepeatedBigFlatTransport /- Flat prime coordinates and auxiliary cuts under an injective group map. -/ open Finset open scoped Classical namespace Bounty def physicalPrimeFlatEmbedding {G H : Type*} {J ell : ℕ} (e : H ↪ G) : RepeatedBigFlatIndex H J ell ↪ RepeatedBigFlatIndex G J ell := e.sigmaMap (fun _ => Function.Embedding.refl _) theorem repeated_big_aux_cut_map {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (A B : Finset (RepeatedBigFlatIndex H J ell)) (g : H) : repeatedBigAuxCut (A.map (physicalPrimeFlatEmbedding e)) (B.map (physicalPrimeFlatEmbedding e)) (e g) = repeatedBigAuxCut A B g := by ext j rw [mem_repeatedBigAuxCut, mem_repeatedBigAuxCut, ← map_union] change physicalPrimeFlatEmbedding e ⟨g,Sum.inl j⟩ ∈ (A ∪ B).map (physicalPrimeFlatEmbedding e) ↔ _ exact mem_map' _ theorem repeated_big_aux_cut_map_outside {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (A B : Finset (RepeatedBigFlatIndex H J ell)) (g : G) (hg : g ∉ Set.range e) : repeatedBigAuxCut (A.map (physicalPrimeFlatEmbedding e)) (B.map (physicalPrimeFlatEmbedding e)) g = ∅ := by apply eq_empty_iff_forall_notMem.mpr intro j hj rw [mem_repeatedBigAuxCut, ← map_union] at hj obtain ⟨x, _, hx⟩ := mem_map.mp hj exact hg ⟨x.1, congrArg Sigma.fst hx⟩ theorem repeated_big_probe_sigma_map {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r : Finset H) : (r.sigma (repeatedBigPrimeProbeSlots (ell := ell) (fun g => probes (e g)))).map (physicalPrimeFlatEmbedding e) = (r.map e).sigma (repeatedBigPrimeProbeSlots (ell := ell) probes) := by ext x rcases x with ⟨g,s⟩ constructor · intro hx obtain ⟨⟨a,t⟩, hat, hx⟩ := mem_map.mp hx have he : e a = g := congrArg Sigma.fst hx subst g have ht : t = s := congrArg (fun x : RepeatedBigFlatIndex G J ell => x.2) hx subst s exact mem_sigma.mpr ⟨mem_map.mpr ⟨a,(mem_sigma.mp hat).1,rfl⟩,(mem_sigma.mp hat).2⟩ · intro hx obtain ⟨hg,hs⟩ := mem_sigma.mp hx obtain ⟨a,ha,rfl⟩ := mem_map.mp hg exact mem_map.mpr ⟨⟨a,s⟩,mem_sigma.mpr ⟨ha,hs⟩,rfl⟩ end Bounty end section -- Original source module: PhysicalPrimeKernelTransport /- Prime-product cells and their comparison kernel are unchanged by a reindexing of the original prime coordinates. -/ open Finset open scoped BigOperators Classical namespace Bounty theorem prime_product_labels_reindex {I T : Type*} [Fintype I] [Fintype T] (e : I ≃ T) (P : T → Finset ℕ) (x : ∀ j, P j) : (∏ i, (x (e i)).val) = ∏ j, (x j).val := e.prod_comp (fun j => (x j).val) theorem prime_product_weight_reindex {I T : Type*} [Fintype I] [Fintype T] (e : I ≃ T) (P : T → Finset ℕ) (V : T → ℝ) (x : ∀ j, P j) : finiteProductWeight (physicalLabelLaw (P := fun i => P (e i)) (fun i => V (e i))) (fun i => x (e i)) = finiteProductWeight (physicalLabelLaw (P := P) V) x := by change (∏ i, physicalLabelLaw V (e i) (x (e i))) = ∏ j, physicalLabelLaw V j (x j) exact e.prod_comp (fun j => physicalLabelLaw V j (x j)) theorem prime_product_cell_mass_reindex {I T : Type*} [Fintype I] [Fintype T] [DecidableEq I] [DecidableEq T] (e : I ≃ T) (P : T → Finset ℕ) (V : T → ℝ) (h : ℝ) (d : ℤ) : finiteCellMass (finiteProductWeight (physicalLabelLaw (P := fun i => P (e i)) (fun i => V (e i)))) (fun x => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) d = finiteCellMass (finiteProductWeight (physicalLabelLaw (P := P) V)) (fun x => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) d := by unfold finiteCellMass rw [← (Equiv.piCongrLeft (fun j => ↥(P j)) e).symm.sum_comp] apply sum_congr rfl intro x _ change (if upperLogCell h (Real.log (∏ i, (x (e i)).val : ℕ)) = d then finiteProductWeight (physicalLabelLaw (P := fun i => P (e i)) (fun i => V (e i))) (fun i => x (e i)) else 0) = _ rw [prime_product_labels_reindex, prime_product_weight_reindex] theorem prime_product_retained_cells_reindex {I T : Type*} [Fintype I] [Fintype T] [DecidableEq I] [DecidableEq T] (e : I ≃ T) (P : T → Finset ℕ) (V : T → ℝ) (h ξ : ℝ) : primeProductRetainedCells (fun i => P (e i)) (fun i => V (e i)) h ξ = primeProductRetainedCells P V h ξ := by have hocc : finiteOccupiedCells (fun x : (∀ i, P (e i)) => upperLogCell h (Real.log (∏ i, (x i).val : ℕ))) = finiteOccupiedCells (fun x : (∀ j, P j) => upperLogCell h (Real.log (∏ j, (x j).val : ℕ))) := by ext d simp only [finiteOccupiedCells, mem_image, mem_univ, true_and] constructor · rintro ⟨x, hx⟩ refine ⟨Equiv.piCongrLeft (fun j => ↥(P j)) e x, ?_⟩ rw [← prime_product_labels_reindex e P] simpa only [Equiv.piCongrLeft_apply_apply] using hx · rintro ⟨x, hx⟩ exact ⟨fun i => x (e i), by simpa only [prime_product_labels_reindex] using hx⟩ unfold primeProductRetainedCells finiteRetainedCells simp only [hocc, prime_product_cell_mass_reindex] theorem prime_product_ideal_kernel_reindex {I T : Type*} [Fintype I] [Fintype T] [DecidableEq I] [DecidableEq T] (e : I ≃ T) (P : T → Finset ℕ) (V : T → ℝ) (Q : ℕ) (h : ℝ) (kept : Finset ℤ) (x y : ∀ j, P j) : primeProductIdealKernel (fun i => P (e i)) (fun i => V (e i)) Q h kept (fun i => x (e i)) (fun i => y (e i)) = primeProductIdealKernel P V Q h kept x y := by unfold primeProductIdealKernel finiteCellFrameKernel finiteMeasureFrameKernel simp only [prime_product_labels_reindex, prime_product_cell_mass_reindex] theorem prime_product_retained_kernel_reindex {I T : Type*} [Fintype I] [Fintype T] [DecidableEq I] [DecidableEq T] (e : I ≃ T) (P : T → Finset ℕ) (V : T → ℝ) (Q : ℕ) (h ξ : ℝ) (x y : ∀ j, P j) : primeProductIdealKernel (fun i => P (e i)) (fun i => V (e i)) Q h (primeProductRetainedCells (fun i => P (e i)) (fun i => V (e i)) h ξ) (fun i => x (e i)) (fun i => y (e i)) = primeProductIdealKernel P V Q h (primeProductRetainedCells P V h ξ) x y := by rw [prime_product_retained_cells_reindex, prime_product_ideal_kernel_reindex] theorem physical_prime_flat_map_avoids_tail {H G : Type*} [DecidableEq H] [DecidableEq G] {J ell : ℕ} (f : H ↪ G) (A B : Finset (RepeatedBigFlatIndex H J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex H J ell) ∉ A ∪ B) : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex G J ell) ∉ A.map (physicalPrimeFlatEmbedding f) ∪ B.map (physicalPrimeFlatEmbedding f) := by intro g j hj rw [← map_union] at hj rcases mem_map.mp hj with ⟨⟨g', s⟩, hs, he⟩ have he' : s = Sum.inr j := congrArg (fun i : RepeatedBigFlatIndex G J ell => i.2) he subst s exact hU g' j hs noncomputable def physicalPrimeAuxPullback {H G : Type*} [DecidableEq H] [DecidableEq G] {J ell : ℕ} (f : H ↪ G) (P : G → Finset ℕ) (A B : Finset (RepeatedBigFlatIndex H J ell)) (aux : PhysicalAuxLabels P (repeatedBigAuxCut (A.map (physicalPrimeFlatEmbedding f)) (B.map (physicalPrimeFlatEmbedding f)))) : PhysicalAuxLabels (fun g => P (f g)) (repeatedBigAuxCut A B) := fun g j => aux (f g) ⟨j.val, by rw [repeated_big_aux_cut_map]; exact j.property⟩ theorem physical_prime_aux_pullback_split {H G : Type*} [DecidableEq H] [DecidableEq G] {J ell : ℕ} (f : H ↪ G) (P : G → Finset ℕ) (A B : Finset (RepeatedBigFlatIndex H J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex H J ell) ∉ A ∪ B) (hAB : Disjoint A B) (aux : PhysicalAuxLabels P (repeatedBigAuxCut (A.map (physicalPrimeFlatEmbedding f)) (B.map (physicalPrimeFlatEmbedding f)))) : repeatedBigAuxSplitEquiv (fun g => P (f g)) A B hU hAB (physicalPrimeAuxPullback f P A B aux) = (fun i => (repeatedBigAuxSplitEquiv P (A.map (physicalPrimeFlatEmbedding f)) (B.map (physicalPrimeFlatEmbedding f)) (physical_prime_flat_map_avoids_tail f A B hU) ((disjoint_map _).mpr hAB) aux).1 (Finset.equivMap (physicalPrimeFlatEmbedding f) A i), fun i => (repeatedBigAuxSplitEquiv P (A.map (physicalPrimeFlatEmbedding f)) (B.map (physicalPrimeFlatEmbedding f)) (physical_prime_flat_map_avoids_tail f A B hU) ((disjoint_map _).mpr hAB) aux).2 (Finset.equivMap (physicalPrimeFlatEmbedding f) B i)) := by apply Prod.ext · funext i rcases i with ⟨⟨g, j | j⟩, hi⟩ · rfl · exact False.elim (hU g j (mem_union_left B hi)) · funext i rcases i with ⟨⟨g, j | j⟩, hi⟩ · rfl · exact False.elim (hU g j (mem_union_right A hi)) theorem repeated_big_prime_coefficient_map {H G : Type*} [Fintype H] [Fintype G] [DecidableEq H] [DecidableEq G] {J ell : ℕ} (f : H ↪ G) (P : G → Finset ℕ) (V : G → ℝ) (A B : Finset (RepeatedBigFlatIndex H J ell)) (hU : ∀ g (j : Fin ell), (⟨g, Sum.inr j⟩ : RepeatedBigFlatIndex H J ell) ∉ A ∪ B) (hAB : Disjoint A B) (Q : ℕ) (h ξ : ℝ) (source target : RepeatedBigLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigAuxCut (A.map (physicalPrimeFlatEmbedding f)) (B.map (physicalPrimeFlatEmbedding f)))) : repeatedBigPrimeCoefficient (fun g => P (f g)) (fun g => V (f g)) A B hU hAB Q h (primeProductRetainedCells (fun i : A => P (f i.val.1)) (fun i => V (f i.val.1)) h ξ) (primeProductRetainedCells (fun i : B => P (f i.val.1)) (fun i => V (f i.val.1)) h ξ) (fun g => source (f g)) (fun g => target (f g)) (physicalPrimeAuxPullback f P A B aux) = repeatedBigPrimeCoefficient P V (A.map (physicalPrimeFlatEmbedding f)) (B.map (physicalPrimeFlatEmbedding f)) (physical_prime_flat_map_avoids_tail f A B hU) ((disjoint_map _).mpr hAB) Q h (primeProductRetainedCells (fun i : A.map (physicalPrimeFlatEmbedding f) => P i.val.1) (fun i => V i.val.1) h ξ) (primeProductRetainedCells (fun i : B.map (physicalPrimeFlatEmbedding f) => P i.val.1) (fun i => V i.val.1) h ξ) source target aux := by unfold repeatedBigPrimeCoefficient erw [physical_prime_aux_pullback_split] apply congrArg₂ (fun x y : ℂ => x * y) · exact prime_product_retained_kernel_reindex (Finset.equivMap (physicalPrimeFlatEmbedding f) A) (fun i => P i.val.1) (fun i => V i.val.1) Q h ξ (repeatedBigAuxSplitEquiv P (A.map (physicalPrimeFlatEmbedding f)) (B.map (physicalPrimeFlatEmbedding f)) (physical_prime_flat_map_avoids_tail f A B hU) ((disjoint_map _).mpr hAB) aux).1 (finiteCoordinateRestrict (A.map (physicalPrimeFlatEmbedding f)) (repeatedBigFlatEquiv P J ell target)) · exact prime_product_retained_kernel_reindex (Finset.equivMap (physicalPrimeFlatEmbedding f) B) (fun i => P i.val.1) (fun i => V i.val.1) Q h ξ (repeatedBigAuxSplitEquiv P (A.map (physicalPrimeFlatEmbedding f)) (B.map (physicalPrimeFlatEmbedding f)) (physical_prime_flat_map_avoids_tail f A B hU) ((disjoint_map _).mpr hAB) aux).2 (finiteCoordinateRestrict (B.map (physicalPrimeFlatEmbedding f)) (repeatedBigFlatEquiv P J ell source)) end Bounty end section -- Original source module: RepeatedBigPatternTransport /- Exact transport of the raw and comparison pattern family under a group embedding. -/ open Finset open scoped Classical namespace Bounty theorem clean_nonempty_subset_map {X Y : Type*} [DecidableEq X] [DecidableEq Y] (e : X ↪ Y) {U A : Finset X} (hA : A ∈ cleanNonemptySubsets U) : A.map e ∈ cleanNonemptySubsets (U.map e) := by rw [clean_mem_nonempty_subsets] at hA ⊢ exact ⟨fun h => hA.1 ((map_eq_empty.mp h)), map_subset_map.mpr hA.2⟩ noncomputable def repeatedBigPrimePatternPairMap {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r t : Finset H) (ab : RepeatedBigPrimePatternPair (ell := ell) (fun g => probes (e g)) r t) : RepeatedBigPrimePatternPair (ell := ell) probes (r.map e) (t.map e) := (⟨ab.1.val.map (physicalPrimeFlatEmbedding e), by rw [← repeated_big_probe_sigma_map] exact clean_nonempty_subset_map (physicalPrimeFlatEmbedding e) ab.1.property⟩, ⟨ab.2.val.map (physicalPrimeFlatEmbedding e), by rw [← repeated_big_probe_sigma_map] exact clean_nonempty_subset_map (physicalPrimeFlatEmbedding e) ab.2.property⟩) noncomputable def repeatedBigPrimePatternMap {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r t : Finset H) : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e g)) r t → RepeatedBigPrimePatternIndex (ell := ell) probes (r.map e) (t.map e) | .inl u => .inl u | .inr ab => .inr (repeatedBigPrimePatternPairMap e probes r t ab) theorem repeated_big_prime_pattern_map_weight {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r t : Finset H) (i : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e g)) r t) : repeatedBigPrimePatternWeight probes (r.map e) (t.map e) (repeatedBigPrimePatternMap e probes r t i) = repeatedBigPrimePatternWeight (fun g => probes (e g)) r t i := by cases i <;> simp [repeatedBigPrimePatternMap, repeatedBigPrimePatternPairMap, repeatedBigPrimePatternWeight] theorem repeated_big_prime_pattern_map_cut {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r t : Finset H) (i : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e g)) r t) (g : H) : repeatedBigPrimePatternCut probes (r.map e) (t.map e) (repeatedBigPrimePatternMap e probes r t i) (e g) = repeatedBigPrimePatternCut (fun g => probes (e g)) r t i g := by cases i with | inl u => rfl | inr ab => exact repeated_big_aux_cut_map e ab.1.val ab.2.val g theorem repeated_big_prime_pattern_map_cut_outside {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r t : Finset H) (i : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e g)) r t) (g : G) (hg : g ∉ Set.range e) : repeatedBigPrimePatternCut probes (r.map e) (t.map e) (repeatedBigPrimePatternMap e probes r t i) g = ∅ := by cases i with | inl u => rfl | inr ab => exact repeated_big_aux_cut_map_outside e ab.1.val ab.2.val g hg theorem repeated_big_prime_pattern_map_injective {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r t : Finset H) : Function.Injective (repeatedBigPrimePatternMap (ell := ell) e probes r t) := by intro i j hij cases i with | inl u => cases j with | inl v => exact congrArg Sum.inl (Subsingleton.elim u v) | inr ab => simp [repeatedBigPrimePatternMap] at hij | inr ab => cases j with | inl u => simp [repeatedBigPrimePatternMap] at hij | inr cd => apply congrArg Sum.inr have he := Sum.inr.inj hij apply Prod.ext · apply Subtype.ext exact map_injective (physicalPrimeFlatEmbedding e) (congrArg (fun x => x.1.val) he) · apply Subtype.ext exact map_injective (physicalPrimeFlatEmbedding e) (congrArg (fun x => x.2.val) he) theorem repeated_big_prime_pattern_map_surjective {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r t : Finset H) : Function.Surjective (repeatedBigPrimePatternMap (ell := ell) e probes r t) := by intro i cases i with | inl u => exact ⟨.inl u,rfl⟩ | inr ab => have ha := (clean_mem_nonempty_subsets _ _).mp ab.1.property have hb := (clean_mem_nonempty_subsets _ _).mp ab.2.property have ha' : ab.1.val ⊆ (r.sigma (repeatedBigPrimeProbeSlots (ell := ell) (fun g => probes (e g)))).map (physicalPrimeFlatEmbedding e) := by simpa only [repeated_big_probe_sigma_map] using ha.2 have hb' : ab.2.val ⊆ (t.sigma (repeatedBigPrimeProbeSlots (ell := ell) (fun g => probes (e g)))).map (physicalPrimeFlatEmbedding e) := by simpa only [repeated_big_probe_sigma_map] using hb.2 obtain ⟨A,hA,hAe⟩ := subset_map_iff.mp ha' obtain ⟨B,hB,hBe⟩ := subset_map_iff.mp hb' have hAn : A ≠ ∅ := by intro h; exact ha.1 (by simp [hAe,h]) have hBn : B ≠ ∅ := by intro h; exact hb.1 (by simp [hBe,h]) refine ⟨.inr (⟨A,(clean_mem_nonempty_subsets _ _).mpr ⟨hAn,hA⟩⟩, ⟨B,(clean_mem_nonempty_subsets _ _).mpr ⟨hBn,hB⟩⟩),?_⟩ apply congrArg Sum.inr apply Prod.ext · exact Subtype.ext hAe.symm · exact Subtype.ext hBe.symm noncomputable def repeatedBigPrimePatternEquiv {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r t : Finset H) : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e g)) r t ≃ RepeatedBigPrimePatternIndex (ell := ell) probes (r.map e) (t.map e) := Equiv.ofBijective (repeatedBigPrimePatternMap e probes r t) ⟨repeated_big_prime_pattern_map_injective e probes r t, repeated_big_prime_pattern_map_surjective e probes r t⟩ theorem repeated_big_prime_pattern_equiv_apply {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r t : Finset H) (i : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e g)) r t) : repeatedBigPrimePatternEquiv e probes r t i = repeatedBigPrimePatternMap e probes r t i := rfl theorem repeated_big_prime_pattern_equiv_symm_cut {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : H ↪ G) (probes : G → Finset (Fin J)) (r t : Finset H) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map e) (t.map e)) (g : H) : repeatedBigPrimePatternCut (fun g => probes (e g)) r t ((repeatedBigPrimePatternEquiv e probes r t).symm i) g = repeatedBigPrimePatternCut probes (r.map e) (t.map e) i (e g) := by have h := repeated_big_prime_pattern_map_cut e probes r t ((repeatedBigPrimePatternEquiv e probes r t).symm i) g rw [← repeated_big_prime_pattern_equiv_apply, Equiv.apply_symm_apply] at h exact h.symm end Bounty end section -- Original source module: PhysicalPrimeKernelAdjoint /- The even Gram coefficient retains its conjugated, endpoint-swapped kernel. -/ open scoped Classical namespace Bounty end Bounty end section -- Original source module: PhysicalRootPrimeKernelTransport /- The actual signed root prime kernel restricts exactly to its mapped big groups. -/ open scoped Classical namespace Bounty noncomputable def physicalPrimePatternAuxPullback {H G : Type*} [DecidableEq H] [DecidableEq G] {J ell : ℕ} (f : H ↪ G) (P : G → Finset ℕ) (probes : G → Finset (Fin J)) (r t : Finset H) (i : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (f g)) r t) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes (r.map f) (t.map f) (repeatedBigPrimePatternMap f probes r t i))) : PhysicalAuxLabels (fun g => P (f g)) (repeatedBigPrimePatternCut (fun g => probes (f g)) r t i) := fun g j => aux (f g) ⟨j.val, by rw [repeated_big_prime_pattern_map_cut]; exact j.property⟩ theorem repeated_big_prime_pattern_kernel_map {H G : Type*} [Fintype H] [Fintype G] [DecidableEq H] [DecidableEq G] {J ell : ℕ} (f : H ↪ G) (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset H) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (f g)) r t) (source target : RepeatedBigLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes (r.map f) (t.map f) (repeatedBigPrimePatternMap f probes r t i))) : repeatedBigPrimePatternKernel (fun g => P (f g)) (fun g => V (f g)) (fun g => probes (f g)) r t hrt Q h (fun U : Finset (RepeatedBigFlatIndex H J ell) => primeProductRetainedCells (fun j : U => P (f j.val.1)) (fun j => V (f j.val.1)) h ξ) i (fun g => source (f g)) (fun g => target (f g)) (physicalPrimePatternAuxPullback f P probes r t i aux) = repeatedBigPrimePatternKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h (fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ) (repeatedBigPrimePatternMap f probes r t i) source target aux := by cases i with | inl u => rfl | inr ab => have hv := repeated_big_prime_pattern_pair_valid (fun g => probes (f g)) r t hrt ab exact repeated_big_prime_coefficient_map f P V ab.1.val ab.2.val (repeated_big_active_pair_avoids_tail hv.1 hv.2.1) hv.2.2 Q h ξ source target aux theorem physical_root_prime_kernel_map {H G : Type*} [Fintype H] [Fintype G] [DecidableEq H] [DecidableEq G] {J ell : ℕ} (f : H ↪ G) (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset H) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (f g)) r t) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes (r.map f) (t.map f) (repeatedBigPrimePatternMap f probes r t i))) : physicalRootPrimeKernel (fun g => P (f g)) (fun g => V (f g)) (fun g => probes (f g)) r t hrt Q h ξ i (fun g => L (f g)) (fun g => R (f g)) (physicalPrimePatternAuxPullback f P probes r t i aux) = physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (repeatedBigPrimePatternMap f probes r t i) L R aux := by unfold physicalRootPrimeKernel rw [repeated_big_prime_pattern_map_weight] exact congrArg (fun z => repeatedBigPrimePatternWeight (fun g => probes (f g)) r t i * z) (repeated_big_prime_pattern_kernel_map f P V probes r t hrt Q h ξ i (fun g s => L g s) (fun g s => R g s) aux) theorem physical_root_prime_kernel_equiv {H G : Type*} [Fintype H] [Fintype G] [DecidableEq H] [DecidableEq G] {J ell : ℕ} (f : H ↪ G) (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset H) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes (r.map f) (t.map f) i)) : physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i L R aux = physicalRootPrimeKernel (fun g => P (f g)) (fun g => V (f g)) (fun g => probes (f g)) r t hrt Q h ξ ((repeatedBigPrimePatternEquiv f probes r t).symm i) (fun g => L (f g)) (fun g => R (f g)) (fun g j => aux (f g) ⟨j.val, by rw [← repeated_big_prime_pattern_equiv_symm_cut] exact j.property⟩) := by obtain ⟨i, rfl⟩ := repeated_big_prime_pattern_map_surjective f probes r t i have hinv : (repeatedBigPrimePatternEquiv f probes r t).symm (repeatedBigPrimePatternMap f probes r t i) = i := (repeatedBigPrimePatternEquiv f probes r t).symm_apply_apply i have hc (u v : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (f g)) r t) (huv : u = v) (au : PhysicalAuxLabels (fun g => P (f g)) (repeatedBigPrimePatternCut (fun g => probes (f g)) r t u)) (av : PhysicalAuxLabels (fun g => P (f g)) (repeatedBigPrimePatternCut (fun g => probes (f g)) r t v)) (ha : ∀ g (x : ↥(repeatedBigPrimePatternCut (fun g => probes (f g)) r t u g)), au g x = av g ⟨x.val, by rw [← huv]; exact x.property⟩) : physicalRootPrimeKernel (fun g => P (f g)) (fun g => V (f g)) (fun g => probes (f g)) r t hrt Q h ξ u (fun g => L (f g)) (fun g => R (f g)) au = physicalRootPrimeKernel (fun g => P (f g)) (fun g => V (f g)) (fun g => probes (f g)) r t hrt Q h ξ v (fun g => L (f g)) (fun g => R (f g)) av := by subst v apply congrArg (fun a => physicalRootPrimeKernel (fun g => P (f g)) (fun g => V (f g)) (fun g => probes (f g)) r t hrt Q h ξ u (fun g => L (f g)) (fun g => R (f g)) a) funext g x exact ha g x refine (physical_root_prime_kernel_map f P V probes r t hrt Q h ξ i L R aux).symm.trans (hc i _ hinv.symm _ _ ?_) intro g x rfl end Bounty end section -- Original source module: PhysicalMergedBigRestriction /- Restricting merged original labels and auxiliary draws to reindexed big groups. -/ open scoped Classical namespace Bounty theorem physical_merged_mark_reindex {G H : Type*} {P : G → Finset ℕ} {J ell : ℕ} (small : G → Prop) (e : {g // ¬small g} ≃ H) (Ls : PhysicalMarkLists (fun g : {g // small g} => P g.val) J ell) (Lb : PhysicalMarkLists (fun g => P (e.symm g).val) J ell) : (fun g => ((physicalMarkGroupSplit small P J ell).symm (Ls, (physicalMarkGroupReindex e (fun g => P g.val) J ell).symm Lb)) (e.symm g).val) = Lb := by have h := congrArg Prod.snd ((physicalMarkGroupSplit small P J ell).apply_symm_apply (Ls, (physicalMarkGroupReindex e (fun g => P g.val) J ell).symm Lb)) funext g exact (congrFun h (e.symm g)).trans (congrFun ((physicalMarkGroupReindex e (fun g => P g.val) J ell).apply_symm_apply Lb) g) theorem physical_merged_aux_reindex {G H : Type*} {P : G → Finset ℕ} {J : ℕ} (small : G → Prop) (e : {g // ¬small g} ≃ H) (C : G → Finset (Fin J)) (as : PhysicalAuxLabels (fun g : {g // small g} => P g.val) (fun g => C g.val)) (ab : PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C (e.symm g).val)) : (fun g => ((physicalAuxGroupSplit small P J C).symm (as, (physicalAuxGroupReindex e (fun g => P g.val) J (fun g => C g.val)).symm ab)) (e.symm g).val) = ab := by have h := congrArg Prod.snd ((physicalAuxGroupSplit small P J C).apply_symm_apply (as, (physicalAuxGroupReindex e (fun g => P g.val) J (fun g => C g.val)).symm ab)) funext g exact (congrFun h (e.symm g)).trans (congrFun ((physicalAuxGroupReindex e (fun g => P g.val) J (fun g => C g.val)).apply_symm_apply ab) g) end Bounty end section -- Original source module: PhysicalMergedPrimeKernel /- The original prime kernel on merged endpoints is exactly its big-group kernel. -/ open scoped Classical namespace Bounty noncomputable def physicalReindexedBigEmbedding {G H : Type*} (small : G → Prop) (e : {g // ¬small g} ≃ H) : H ↪ G := ⟨fun h => (e.symm h).val, fun _ _ h => e.symm.injective (Subtype.ext h)⟩ theorem physical_root_prime_kernel_merged_equiv {G H : Type*} [Fintype G] [Fintype H] [DecidableEq G] [DecidableEq H] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (small : G → Prop) (e : {g // ¬small g} ≃ H) (probes : G → Finset (Fin J)) (r t : Finset H) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map (physicalReindexedBigEmbedding small e)) (t.map (physicalReindexedBigEmbedding small e))) (Ls Rs : PhysicalMarkLists (fun g : {g // small g} => P g.val) J ell) (Lb Rb : PhysicalMarkLists (fun g => P (e.symm g).val) J ell) (aSmall : PhysicalAuxLabels (fun g : {g // small g} => P g.val) (fun g => repeatedBigPrimePatternCut probes (r.map (physicalReindexedBigEmbedding small e)) (t.map (physicalReindexedBigEmbedding small e)) i g.val)) (aBig : PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => repeatedBigPrimePatternCut probes (r.map (physicalReindexedBigEmbedding small e)) (t.map (physicalReindexedBigEmbedding small e)) i (e.symm g).val)) : let f := physicalReindexedBigEmbedding small e let C := repeatedBigPrimePatternCut probes (r.map f) (t.map f) i let L := (physicalMarkGroupSplit small P J ell).symm (Ls, (physicalMarkGroupReindex e (fun g => P g.val) J ell).symm Lb) let R := (physicalMarkGroupSplit small P J ell).symm (Rs, (physicalMarkGroupReindex e (fun g => P g.val) J ell).symm Rb) let a := (physicalAuxGroupSplit small P J C).symm (aSmall, (physicalAuxGroupReindex e (fun g => P g.val) J (fun g => C g.val)).symm aBig) physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i L R a = physicalRootPrimeKernel (fun g => P (e.symm g).val) (fun g => V (e.symm g).val) (fun g => probes (e.symm g).val) r t hrt Q h ξ ((repeatedBigPrimePatternEquiv f probes r t).symm i) Lb Rb (fun g j => aBig g ⟨j.val, by change j.val ∈ repeatedBigPrimePatternCut probes (r.map f) (t.map f) i (f g) rw [← repeated_big_prime_pattern_equiv_symm_cut] exact j.property⟩) := by dsimp only let f := physicalReindexedBigEmbedding small e let C := repeatedBigPrimePatternCut probes (r.map f) (t.map f) i let L := (physicalMarkGroupSplit small P J ell).symm (Ls, (physicalMarkGroupReindex e (fun g => P g.val) J ell).symm Lb) let R := (physicalMarkGroupSplit small P J ell).symm (Rs, (physicalMarkGroupReindex e (fun g => P g.val) J ell).symm Rb) let a := (physicalAuxGroupSplit small P J C).symm (aSmall, (physicalAuxGroupReindex e (fun g => P g.val) J (fun g => C g.val)).symm aBig) have hm := physical_root_prime_kernel_equiv f P V probes r t hrt Q h ξ i L R a have hL : (fun g => L (f g)) = Lb := physical_merged_mark_reindex small e Ls Lb have hR : (fun g => R (f g)) = Rb := physical_merged_mark_reindex small e Rs Rb rw [hL, hR] at hm rw [hm] congr 1 funext g j exact congrFun (congrFun (physical_merged_aux_reindex small e C aSmall aBig) g) ⟨j.val, by change j.val ∈ repeatedBigPrimePatternCut probes (r.map f) (t.map f) i (f g) rw [← repeated_big_prime_pattern_equiv_symm_cut] exact j.property⟩ end Bounty end section -- Original source module: PhysicalRootPrimeKeyCoefficient /- The chronological root key retains its exact prime kernel, including the conjugated, reversed-endpoint branch, and both original phase factors. -/ open scoped Classical namespace Bounty theorem physical_root_prime_key_coefficient {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (patterns : Finset I) (iota : I → RepeatedBigPrimePatternIndex (ell := ell) probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex))) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, repeatedBigPrimePatternCut probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (iota i.val) g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (θ : ℝ) (key : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) (Lb Rb : PhysicalMarkLists (fun g => P (reindex.symm g).val) J ell) (aBig : PhysicalAuxLabels (fun g => P (reindex.symm g).val) (fun g => repeatedBigPrimePatternCut probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (iota key.2.1.val) (reindex.symm g).val)) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let C := fun i => repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota i) let K := fun (time : ℕ) (i : I) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (iota i) R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (iota i) L R aux let i := key.2.1.val let time := n - key.1.val let smallPattern := (repeatedBigPrimePatternEquiv f probes r t).symm (iota i) let aRestricted : PhysicalAuxLabels (fun g => P (reindex.symm g).val) (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t smallPattern) := fun g j => aBig g ⟨j.val, by change j.val ∈ repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota i) (f g) rw [← repeated_big_prime_pattern_equiv_symm_cut] exact j.property⟩ let kernel := fun L R => physicalRootPrimeKernel (fun g => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) (fun g => probes (reindex.symm g).val) r t hrt Q h ξ smallPattern L R aRestricted let ds := physicalSharedProduct (physicalSharedPrefix key.2.2.1) physicalRootKeyCoefficient groups reindex patterns C hC ζ k K θ key Lb Rb aBig = (if time % 2 = 0 then (starRingEnd ℂ) (kernel Rb Lb) else kernel Lb Rb) * physicalPhase (ζ time i) (ds * physicalD (fun g => C i (reindex.symm g).val) Lb aBig) * physicalReturnPhase θ (k time i * (ds * physicalD (fun g => C i (reindex.symm g).val) Lb aBig : ℕ)) := by dsimp only rw [physical_root_key_product_coefficient] let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let C := fun i => repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota i) let aSmall : PhysicalAuxLabels (fun g : ↥groupsᶜ => P g.val) (fun g => C key.2.1.val g.val) := physicalEmptyAuxLabels (fun g : ↥groupsᶜ => C key.2.1.val g.val) (hC key.2.1) have ho := physical_root_prime_kernel_merged_equiv P V (fun g => g ∈ groupsᶜ) reindex probes r t hrt Q h ξ (iota key.2.1.val) key.2.2.1 key.2.2.2 Lb Rb aSmall aBig have he := physical_root_prime_kernel_merged_equiv P V (fun g => g ∈ groupsᶜ) reindex probes r t hrt Q h ξ (iota key.2.1.val) key.2.2.2 key.2.2.1 Rb Lb aSmall aBig split_ifs · erw [he] · erw [ho] end Bounty end section -- Original source module: PhysicalMixedActiveResidual /- The actual injective endpoint coefficient has precisely the concrete mixed residual. -/ open scoped Classical namespace Bounty theorem physical_mixed_active_coefficient_residual {S : Type} [Fintype S] {N J ell B : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (ζ θ : ℝ) (k : ℤ) (K : RepeatedBigLists P J ell → RepeatedBigLists P J ell → PhysicalAuxLabels P C → ℂ) (a : PhysicalAuxLabels P C) (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)) (e : PhysicalMixedCoefficientEvent C k a s) : let source := physicalMixedRepeatedLabels C s.2 let targetState := physicalMixedCoefficientTarget C k a s e let target := physicalMixedRepeatedLabels C targetState.2 let ds := physicalSharedProduct (physicalSharedPrefix s.1.2) (if repeatedBigAuxAvoids C a source ∧ repeatedBigAuxAvoids C a target then (1 : ℂ) else 0) * physicalActiveCoefficient C C C 0 (fun L R aux => K (fun g j => L g j) (fun g j => R g j) aux * physicalPhase ζ (ds * physicalD C L aux) * physicalReturnPhase θ (k * (ds * physicalD C L aux : ℕ))) (fun g => (s.2 g).1) (fun g => (targetState.2 g).1) a = K source target a * physicalMixedFullResidualPhase C ζ θ k cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) a s e := by dsimp only let y := physicalMixedCoefficientTarget C k a s e by_cases hs : ∀ g, Function.Injective (s.2 g).1 · by_cases ht : ∀ g, Function.Injective (y.2 g).1 · let L := physicalActiveMarkLabels C (fun g => (s.2 g).1) hs have hstate : physicalFullMemoryState C L (fun g => (s.2 g).2) = s.2 := by funext g apply Prod.ext · funext j change (s.2 g).1 ((physicalFullSlotIndex (C g)).symm (physicalFullSlotIndex (C g) j)) = (s.2 g).1 j rw [Equiv.symm_apply_apply] · rfl have hD := physical_mixed_shared_D_at_state C (physicalSharedPrefix s.1.2) L (fun g => (s.2 g).2) a rw [hstate] at hD have hsource : (fun g j => L g j) = physicalMixedRepeatedLabels C s.2 := rfl have htarget : (fun g j => physicalActiveMarkLabels C (fun g => (y.2 g).1) ht g j) = physicalMixedRepeatedLabels C y.2 := rfl change _ = K (physicalMixedRepeatedLabels C s.2) (physicalMixedRepeatedLabels C y.2) a * _ unfold physicalActiveCoefficient rw [dif_pos hs, dif_pos ht, physical_phase_zero_frequency, mul_one] change _ * (K (fun g j => L g j) _ a * _ * _) = _ rw [hsource, htarget, ← hD] unfold physicalMixedFullResidualPhase dsimp only rw [physical_mixed_step_factor] have hsg : cleanMixedSourceGate s = 1 := if_pos hs have htg : cleanMixedTargetGate (fun _ => ∅) y = 1 := if_pos ⟨ht, fun _ _ => Finset.notMem_empty _⟩ change _ = K _ _ a * (if _ then (starRingEnd ℂ) (cleanMixedSourceGate s) * _ * _ * cleanMixedTargetGate (fun _ => ∅) y else 0) rw [hsg, htg, map_one, one_mul, mul_one] split_ifs <;> simp only [one_mul, zero_mul, mul_zero, mul_assoc] · have htg : cleanMixedTargetGate (fun _ => ∅) y = 0 := if_neg (fun h => ht h.1) unfold physicalActiveCoefficient rw [dif_pos hs, dif_neg ht, mul_zero] unfold physicalMixedFullResidualPhase dsimp only change 0 = _ * (if _ then _ * _ * _ * cleanMixedTargetGate (fun _ => ∅) y else 0) rw [htg] split_ifs <;> simp only [mul_zero] · have hsg : cleanMixedSourceGate s = 0 := if_neg hs unfold physicalActiveCoefficient rw [dif_neg hs, mul_zero] unfold physicalMixedFullResidualPhase dsimp only rw [hsg, map_zero, zero_mul, zero_mul, zero_mul] split_ifs <;> simp only [mul_zero] end Bounty end section -- Original source module: PhysicalRootPrimeLocalResidual /- The original weighted root local phase is its signed prime kernel and mixed residual. -/ open scoped Classical namespace Bounty theorem physical_root_prime_weighted_local_residual {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (patterns : Finset I) (iota : I → RepeatedBigPrimePatternIndex (ell := ell) probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex))) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, repeatedBigPrimePatternCut probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (iota i.val) g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (θ : ℝ) (β : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (reindex.symm g).val)) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let C := fun i => repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota i) let K := fun (time : ℕ) (i : I) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (iota i) R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (iota i) L R aux ∀ (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex) (ev : PhysicalRootMixedEvent groups reindex patterns C k (some (.inr j)) s), let cut := fun g => C ev.1.val (reindex.symm g).val let target := physicalMixedCoefficientTarget cut (k (n - j.val) ev.1.val) ev.2.1 s ev.2.2 let W := physicalRootEffectiveEdgeWeight groups reindex patterns C k j s ev hPs hPb hdis V β ρ let time := n - j.val let smallPattern := (repeatedBigPrimePatternEquiv f probes r t).symm (iota ev.1.val) let restrictedAux : PhysicalAuxLabels (fun g => P (reindex.symm g).val) (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t smallPattern) := fun g a => ev.2.1 g ⟨a.val, by change a.val ∈ repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota ev.1.val) (f g) rw [← repeated_big_prime_pattern_equiv_symm_cut] exact a.property⟩ let source := physicalMixedRepeatedLabels cut s.2 let targetLabels := physicalMixedRepeatedLabels cut target.2 let kernel := fun L R => repeatedBigPrimePatternWeight (fun g => probes (reindex.symm g).val) r t smallPattern * repeatedBigPrimePatternKernel (fun g => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) (fun g => probes (reindex.symm g).val) r t hrt Q h (fun U : Finset (RepeatedBigFlatIndex (Fin M) J ell) => primeProductRetainedCells (fun a : U => P (reindex.symm a.val.1).val) (fun a => V (reindex.symm a.val.1).val) h ξ) smallPattern L R restrictedAux let signedKernel := if time % 2 = 0 then (starRingEnd ℂ) (kernel targetLabels source) else kernel source targetLabels (W : ℂ) * physicalRootMixedLocalPhase groups reindex patterns C hC k V ζ K θ β ρ hPs hPb hdis (some (.inr j)) (fun _ => ∅) s ev = (W : ℂ) * (signedKernel * physicalMixedFullResidualPhase cut (ζ time ev.1.val) θ (k time ev.1.val) cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) ev.2.1 s ev.2.2) := by intro f C K j s ev cut target W time smallPattern restrictedAux source targetLabels kernel signedKernel let key := physicalRootEdgeKey groups reindex patterns C k j s ev have hw := physical_root_mixed_weighted_empty_coefficient groups reindex patterns C hC k V ζ K θ β ρ hPs hPb hdis j s ev let kernelAll := fun (L R : RepeatedBigLists (fun g => P (reindex.symm g).val) J ell) (aux : PhysicalAuxLabels (fun g => P (reindex.symm g).val) cut) => let aRestricted : PhysicalAuxLabels (fun g => P (reindex.symm g).val) (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t smallPattern) := fun g a => aux g ⟨a.val, by change a.val ∈ repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota ev.1.val) (f g) rw [← repeated_big_prime_pattern_equiv_symm_cut] exact a.property⟩ let value := fun L R => repeatedBigPrimePatternWeight (fun g => probes (reindex.symm g).val) r t smallPattern * repeatedBigPrimePatternKernel (fun g => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) (fun g => probes (reindex.symm g).val) r t hrt Q h (fun U : Finset (RepeatedBigFlatIndex (Fin M) J ell) => primeProductRetainedCells (fun a : U => P (reindex.symm a.val.1).val) (fun a => V (reindex.symm a.val.1).val) h ξ) smallPattern L R aRestricted if time % 2 = 0 then (starRingEnd ℂ) (value R L) else value L R have hk : physicalRootKeyCoefficient groups reindex patterns C hC ζ k K θ key = fun L R aux => kernelAll (fun g a => L g a) (fun g a => R g a) aux * physicalPhase (ζ time ev.1.val) (physicalSharedProduct (physicalSharedPrefix s.1.2) * physicalD cut L aux) * physicalReturnPhase θ (k time ev.1.val * (physicalSharedProduct (physicalSharedPrefix s.1.2) * physicalD cut L aux : ℕ)) := by funext L R aux exact physical_root_prime_key_coefficient groups reindex V probes r t hrt Q h ξ patterns iota hC ζ k θ key L R aux dsimp only at hw rw [hk] at hw have hr := physical_mixed_active_coefficient_residual cut (ζ time ev.1.val) θ (k time ev.1.val) kernelAll ev.2.1 s ev.2.2 dsimp only at hr rw [hr] at hw exact hw end Bounty end section -- Original source module: PhysicalEffectiveWeightTransport /- Effective big-event transport preserves the exact full event weight. -/ open scoped Classical namespace Bounty section Effective variable {S K V : Type} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) (C : K → Fin N → Finset (Fin J)) (d : K → PhysicalSharedLists Ps J) (k : K → ℤ) (B : ℕ) theorem physical_mixed_effective_big_weight (ω : ∀ key, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C key g)) → PhysicalAuxLabels P (C key) → ℝ) (μ : ∀ g, P g → ℝ) (ρ : ℝ) (Vb : Fin N → ℝ) (key : K) (x : PhysicalFullBoundedState P J ell B) (e : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) (some (.inr key) : Option (V ⊕ K)) x) : fullActiveEdgeEventWeight (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C key g)) B (fun _ => PhysicalAuxLabels P (C key)) (physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (physicalFullEdgeD (C key)) (ω key) μ ρ Vb x (physicalMixedEffectiveBigEventEquiv hPs hP hdis C d k B (some (.inr key) : Option (V ⊕ K)) x e) = fullActiveEdgeEventWeight (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (C key g)) B (fun _ => PhysicalAuxLabels P (C key)) (physicalMixedEdgeDelta (C key) (k key) (d key)) (physicalMixedEdgeD (C key) (d key)) (ω key) μ ρ Vb x e := full_active_parameter_weight _ _ B _ _ _ _ _ (funext fun c => funext fun a => funext fun g => physical_mixed_delta_effective_big_step (C key) (d key) (k key) c a g) (fun c a g p => physical_mixed_dilation_divisibility hPs hP hdis (C key) (d key) c a g p) (ω key) μ ρ Vb x e end Effective end Bounty end section -- Original source module: DeterministicLedgerRows /- A deterministic history phase is exactly a word of local rows on the augmented state. The initial ledger may depend on the starting state. -/ open Finset namespace Bounty end Bounty end section -- Original source module: PhysicalRootMixedLedgerWord /- The literal mixed action is a word of local rows on the original birth ledger. -/ open Finset Classical namespace Bounty section Action variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) end Action end Bounty end section -- Original source module: PhysicalRootMixedWeightTransport /- The original root row retains its small factor under effective big-event transport. -/ open scoped Classical namespace Bounty theorem physical_root_mixed_word_weight_effective {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (β : (g : Fin M) → P (reindex.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (reindex.symm g).val)) (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex) (ev : PhysicalRootMixedEvent groups reindex patterns C k (some (.inr j)) s) : let shared := fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (reindex.symm g).val) let aux := fun (i : patterns) => PhysicalAuxLabels (fun g => P (reindex.symm g).val) (fun g => C i.val (reindex.symm g).val) let Δ := fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (Ps := fun g : ↥groupsᶜ => P g.val) (P := fun g => P (reindex.symm g).val) (ell := ell) (fun g => C i.val (reindex.symm g).val) (k (n-j.val) i.val) let D := fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (Ps := fun g : ↥groupsᶜ => P g.val) (P := fun g => P (reindex.symm g).val) (ell := ell) (fun g => C i.val (reindex.symm g).val) let kbig := fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (P := fun g => P (reindex.symm g).val) (ell := ell) (fun g => C i.val (reindex.symm g).val) (k (n-j.val) i.val) let weights := fun (i : patterns) (_ : SharedActiveLabels (fun g => P (reindex.symm g).val) (shared i)) a => physicalAuxMass (fun g => V (reindex.symm g).val) (fun g => C i.val (reindex.symm g).val) a let key : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) := (j, ev.1, s.1.2, ev.2.2.1) let cuts := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C z.2.1.val (reindex.symm g).val let prefixes := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => physicalSharedPrefix z.2.2.1 let steps := fun z : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n-z.1.val) z.2.1.val let effective := physicalMixedEffectiveBigEventEquiv hPs hPb hdis cuts prefixes steps B (some (.inr key) : Option (Fin (n + 2) ⊕ _)) s.2 ⟨ev.2.1, ev.2.2.2.2⟩ let W := fullActiveEdgeEventWeight (fun g (p : P (reindex.symm g).val) => p.val) (fun g => physicalFullSharedIndices (cuts key g)) B (fun _ => PhysicalAuxLabels (fun g => P (reindex.symm g).val) (cuts key)) (physicalFullEdgeDelta (cuts key) (steps key * (physicalSharedProduct (prefixes key) : ℕ))) (physicalFullEdgeD (cuts key)) (weights ev.1) (fun g p => β g p / V (reindex.symm g).val) ρ (fun g => V (reindex.symm g).val) s.2 effective physicalMixedWordWeight (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (fun g (p : P (reindex.symm g).val) => p.val) shared B aux Δ D kbig weights (fun g p => β g p / V (reindex.symm g).val) retention ρ (fun g => V (reindex.symm g).val) (fun g : ↥groupsᶜ => V g.val) (fun _ => q) (some (.inr j)) s ev = physicalMixedSmallWeight (V := Fin (n + 2)) (fun g (p : P (reindex.symm g).val) => p.val) shared B aux Δ D kbig (fun g : ↥groupsᶜ => V g.val) (fun _ => q) (some (.inr j)) s ev * W := by intro shared aux Δ D kbig weights key cuts prefixes steps effective W have hf := physical_mixed_word_edge_weight_factor (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (fun g (p : P (reindex.symm g).val) => p.val) shared B aux Δ D kbig (fun g : ↥groupsᶜ => V g.val) (fun _ => q) weights (fun g p => β g p / V (reindex.symm g).val) retention ρ (fun g => V (reindex.symm g).val) j s ev apply hf.trans congr 1 exact (physical_mixed_effective_big_weight hPs hPb hdis cuts prefixes steps B (fun z _ a => physicalAuxMass (fun g => V (reindex.symm g).val) (cuts z) a) (fun g p => β g p / V (reindex.symm g).val) ρ (fun g => V (reindex.symm g).val) key s.2 (show FullPermutationMixedEvent _ _ B _ _ _ (some (.inr key) : Option (Fin (n + 2) ⊕ _)) s.2 from ⟨ev.2.1, ev.2.2.2.2⟩)).symm end Bounty end section -- Original source module: PhysicalRootSummedRow /- Exact finite row interfaces for the original root weights. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (β : (g : Fin M) → P (reindex.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootOriginalWeight := physicalMixedWordWeight (Ps := fun g : ↥groupsᶜ => P g.val) (ell := ell) (fun g (p : P (reindex.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (reindex.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (reindex.symm g).val) (fun g => C i.val (reindex.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (reindex.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (reindex.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (reindex.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ a => physicalAuxMass (fun g => V (reindex.symm g).val) (fun g => C i.val (reindex.symm g).val) a) (fun g p => β g p / V (reindex.symm g).val) retention ρ (fun g => V (reindex.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) noncomputable def physicalRootOriginalSmallWeight := physicalMixedSmallWeight (Ps := fun g : ↥groupsᶜ => P g.val) (ell := ell) (V := Fin (n + 2)) (fun g (p : P (reindex.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (reindex.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (reindex.symm g).val) (fun g => C i.val (reindex.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (reindex.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (reindex.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (reindex.symm g).val) (k (n - j.val) i.val)) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) variable [∀ g (p : P (reindex.symm g).val), NeZero p.val] noncomputable def physicalRootOriginalRow (phase : ∀ tag s, PhysicalRootMixedEvent groups reindex patterns C k tag s → ℂ) := physicalMixedWordRow (fun g (p : P (reindex.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (reindex.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (reindex.symm g).val) (fun g => C i.val (reindex.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (reindex.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (reindex.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (reindex.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ a => physicalAuxMass (fun g => V (reindex.symm g).val) (fun g => C i.val (reindex.symm g).val) a) (fun g p => β g p / V (reindex.symm g).val) retention ρ (fun g => V (reindex.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) phase variable (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (reindex.symm g).val)) omit [∀ g (p : P (reindex.symm g).val), NeZero p.val] in theorem physical_root_original_edge_weight_factor (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex) (ev : PhysicalRootMixedEvent groups reindex patterns C k (some (.inr j)) s) : physicalRootOriginalWeight groups reindex patterns C k V q β retention ρ (some (.inr j)) s ev = physicalRootOriginalSmallWeight groups reindex patterns C k V q (some (.inr j)) s ev * physicalRootEffectiveEdgeWeight groups reindex patterns C k j s ev hPs hPb hdis V β ρ := physical_root_mixed_word_weight_effective groups reindex patterns C k V q β retention ρ hPs hPb hdis j s ev theorem physical_root_original_edge_row_congr (φ ψ : ∀ tag s, PhysicalRootMixedEvent groups reindex patterns C k tag s → ℂ) (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex) (hphase : ∀ ev : PhysicalRootMixedEvent groups reindex patterns C k (some (.inr j)) s, (physicalRootEffectiveEdgeWeight groups reindex patterns C k j s ev hPs hPb hdis V β ρ : ℂ) * φ (some (.inr j)) s ev = (physicalRootEffectiveEdgeWeight groups reindex patterns C k j s ev hPs hPb hdis V β ρ : ℂ) * ψ (some (.inr j)) s ev) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ) : physicalRootOriginalRow groups reindex patterns C k V q β retention ρ φ (some (.inr j)) F s = physicalRootOriginalRow groups reindex patterns C k V q β retention ρ ψ (some (.inr j)) F s := by unfold physicalRootOriginalRow physicalMixedWordRow finiteLocalPhasedRow apply Finset.sum_congr rfl intro ev _ change (physicalRootOriginalWeight groups reindex patterns C k V q β retention ρ (some (.inr j)) s ev : ℂ) * φ (some (.inr j)) s ev * _ = (physicalRootOriginalWeight groups reindex patterns C k V q β retention ρ (some (.inr j)) s ev : ℂ) * ψ (some (.inr j)) s ev * _ rw [physical_root_original_edge_weight_factor groups reindex patterns C k V q β retention ρ hPs hPb hdis j s ev] simp only [Complex.ofReal_mul, mul_assoc] rw [← mul_assoc _ (φ (some (.inr j)) s ev), hphase ev, mul_assoc _ (ψ (some (.inr j)) s ev)] end Root end Bounty end section -- Original source module: PhysicalRootPrimeRowPhase /- The signed prime coefficient on each exact original root mixed event. -/ open scoped Classical namespace Bounty noncomputable def physicalRootPrimeRowPhase {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (patterns : Finset I) (iota : I → RepeatedBigPrimePatternIndex (ell := ell) probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex))) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (θ : ℝ) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let C := fun i => repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota i) ∀ tag s, PhysicalRootMixedEvent (P := P) (ell := ell) (n := n) (B := B) groups reindex patterns C k tag s → ℂ := by intro f C tag s ev cases tag with | none => exact 1 | some tag => cases tag with | inl v => exact 1 | inr j => exact let cut := fun g => C ev.1.val (reindex.symm g).val let target := physicalMixedCoefficientTarget cut (k (n - j.val) ev.1.val) ev.2.1 s ev.2.2 let time := n - j.val let smallPattern := (repeatedBigPrimePatternEquiv f probes r t).symm (iota ev.1.val) let restrictedAux : PhysicalAuxLabels (fun g => P (reindex.symm g).val) (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t smallPattern) := fun g a => ev.2.1 g ⟨a.val, by change a.val ∈ repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota ev.1.val) (f g) rw [← repeated_big_prime_pattern_equiv_symm_cut] exact a.property⟩ let source := physicalMixedRepeatedLabels cut s.2 let targetLabels := physicalMixedRepeatedLabels cut target.2 let kernel := fun L R => repeatedBigPrimePatternWeight (fun g => probes (reindex.symm g).val) r t smallPattern * repeatedBigPrimePatternKernel (fun g => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) (fun g => probes (reindex.symm g).val) r t hrt Q h (fun U : Finset (RepeatedBigFlatIndex (Fin M) J ell) => primeProductRetainedCells (fun a : U => P (reindex.symm a.val.1).val) (fun a => V (reindex.symm a.val.1).val) h ξ) smallPattern L R restrictedAux let signedKernel := if time % 2 = 0 then (starRingEnd ℂ) (kernel targetLabels source) else kernel source targetLabels signedKernel * physicalMixedFullResidualPhase cut (ζ time ev.1.val) θ (k time ev.1.val) cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) ev.2.1 s ev.2.2 theorem physical_root_prime_row_phase_weighted {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (patterns : Finset I) (iota : I → RepeatedBigPrimePatternIndex (ell := ell) probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex))) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, repeatedBigPrimePatternCut probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (iota i.val) g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (θ : ℝ) (β : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (reindex.symm g).val)) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let C := fun i => repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota i) let K := fun (time : ℕ) (i : I) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (iota i) R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (iota i) L R aux ∀ (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex) (ev : PhysicalRootMixedEvent groups reindex patterns C k (some (.inr j)) s), let W := physicalRootEffectiveEdgeWeight groups reindex patterns C k j s ev hPs hPb hdis V β ρ (W : ℂ) * physicalRootMixedLocalPhase groups reindex patterns C hC k V ζ K θ β ρ hPs hPb hdis (some (.inr j)) (fun _ => ∅) s ev = (W : ℂ) * physicalRootPrimeRowPhase groups reindex V probes r t hrt Q h ξ patterns iota ζ k θ (some (.inr j)) s ev := by intro f C K j s ev W exact physical_root_prime_weighted_local_residual groups reindex V probes r t hrt Q h ξ patterns iota hC ζ k θ β ρ hPs hPb hdis j s ev theorem physical_root_prime_edge_row_phase {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (patterns : Finset I) (iota : I → RepeatedBigPrimePatternIndex (ell := ell) probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex))) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, repeatedBigPrimePatternCut probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (iota i.val) g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (θ : ℝ) (β : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (reindex.symm g).val)) [∀ g (p : P (reindex.symm g).val), NeZero p.val] (q : ℝ) (retention : Fin (n + 2) → ℝ) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let C := fun i => repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota i) let K := fun (time : ℕ) (i : I) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (iota i) R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (iota i) L R aux ∀ (decoration : ∀ tag s, PhysicalRootMixedEvent groups reindex patterns C k tag s → ℂ) (j : Fin (n + 1)) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex), physicalRootOriginalRow groups reindex patterns C k V q β retention ρ (fun tag y ev => physicalRootMixedLocalPhase groups reindex patterns C hC k V ζ K θ β ρ hPs hPb hdis tag (fun _ => ∅) y ev * decoration tag y ev) (some (.inr j)) F s = physicalRootOriginalRow groups reindex patterns C k V q β retention ρ (fun tag y ev => physicalRootPrimeRowPhase groups reindex V probes r t hrt Q h ξ patterns iota ζ k θ tag y ev * decoration tag y ev) (some (.inr j)) F s := by intro f C K decoration j F s apply physical_root_original_edge_row_congr groups reindex patterns C k V q β retention ρ hPs hPb hdis intro ev rw [← mul_assoc, ← mul_assoc] exact congrArg (fun z => z * decoration (some (.inr j)) s ev) (physical_root_prime_row_phase_weighted groups reindex V probes r t hrt Q h ξ patterns iota hC ζ k θ β ρ hPs hPb hdis j s ev) end Bounty end section -- Original source module: PhysicalRootActionSum /- The original root edge row is exactly the finite sum of the mixed coefficient actions, with the same auxiliary weights and local phase. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_original_edge_row_eq_actions {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (β : (g : Fin M) → P (reindex.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) [∀ g (p : P (reindex.symm g).val), NeZero p.val] (φ : ∀ tag s, PhysicalRootMixedEvent (P := P) (ell := ell) (n := n) (B := B) groups reindex patterns C k tag s → ℂ) (baseline : (g : Fin M) → P (reindex.symm g).val → ℝ) (hμ : ∀ g p, β g p / V (reindex.symm g).val = tiltedPhysicalBirthLaw (P := fun g => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) g (baseline g) p) (j : Fin (n + 1)) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex) : physicalRootOriginalRow groups reindex patterns C k V q β retention ρ φ (some (.inr j)) F s = ∑ i : patterns, physicalMixedCoefficientAction (fun g => C i.val (reindex.symm g).val) (k (n-j.val) i.val) (fun g => V (reindex.symm g).val) baseline ρ (fun a : ↥groupsᶜ => V a.val) q (fun _ => ∅) (fun a y ev => φ (some (.inr j)) y ⟨i,a,ev⟩) F s := by unfold physicalRootOriginalRow rw [physical_mixed_word_row_edge] have hμfun : (fun g p => β g p / V (reindex.symm g).val) = (fun g => tiltedPhysicalBirthLaw (P := fun g => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) g (baseline g)) := by funext g p exact hμ g p rw [hμfun] simp only [physicalMixedCoefficientAction, Finset.notMem_empty, not_false_eq_true, forall_true_iff, if_true] end Bounty end section -- Original source module: PhysicalRootTiltedLaw /- The reciprocal residue coefficient in the original root normalization induces exactly the tilted physical birth law. -/ namespace Bounty theorem physical_root_tilted_birth_law {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (baseline : ∀ g, P g → ℝ) : ∀ g (p : P g), ((p.val : ℝ)*baseline g p)⁻¹ / V g = tiltedPhysicalBirthLaw V g (baseline g) p := by intro g p unfold tiltedPhysicalBirthLaw physicalLabelLaw simp only [div_eq_mul_inv, mul_inv_rev, one_mul] ring end Bounty end section -- Original source module: PhysicalRootPrimeActionSum /- The actual reciprocal residue coefficient identifies the original prime root row with the sum of mixed coefficient actions, retaining every decoration. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_prime_edge_row_eq_actions {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (patterns : Finset I) (iota : I → RepeatedBigPrimePatternIndex (ell := ell) probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex))) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, repeatedBigPrimePatternCut probes (r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex)) (iota i.val) g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (θ : ℝ) (baseline : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (reindex.symm g).val)) [∀ g (p : P (reindex.symm g).val), NeZero p.val] (q : ℝ) (retention : Fin (n + 2) → ℝ) : let β := fun (g : Fin M) (p : P (reindex.symm g).val) => ((p.val : ℝ)*baseline g p)⁻¹ let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let C := fun i => repeatedBigPrimePatternCut probes (r.map f) (t.map f) (iota i) let K := fun (time : ℕ) (i : I) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (iota i) R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ (iota i) L R aux ∀ (decoration : ∀ tag s, PhysicalRootMixedEvent groups reindex patterns C k tag s → ℂ) (j : Fin (n + 1)) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex), physicalRootOriginalRow groups reindex patterns C k V q β retention ρ (fun tag y ev => physicalRootMixedLocalPhase groups reindex patterns C hC k V ζ K θ β ρ hPs hPb hdis tag (fun _ => ∅) y ev * decoration tag y ev) (some (.inr j)) F s = ∑ i : patterns, physicalMixedCoefficientAction (fun g => C i.val (reindex.symm g).val) (k (n-j.val) i.val) (fun g => V (reindex.symm g).val) baseline ρ (fun a : ↥groupsᶜ => V a.val) q (fun _ => ∅) (fun a y ev => physicalRootPrimeRowPhase groups reindex V probes r t hrt Q h ξ patterns iota ζ k θ (some (.inr j)) y ⟨i,a,ev⟩ * decoration (some (.inr j)) y ⟨i,a,ev⟩) F s := by intro β f C K decoration j F s exact (physical_root_prime_edge_row_phase groups reindex V probes r t hrt Q h ξ patterns iota hC ζ k θ β ρ hPs hPb hdis q retention decoration j F s).trans (physical_root_original_edge_row_eq_actions groups reindex patterns C k V q β retention ρ (fun tag y ev => physicalRootPrimeRowPhase groups reindex V probes r t hrt Q h ξ patterns iota ζ k θ tag y ev * decoration tag y ev) baseline (physical_root_tilted_birth_law (P := fun g => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) baseline) j F s) end Bounty end section -- Original source module: PhysicalRootPatternEnumeration /- The full original prime pattern family is exactly the native big-group family. Small groups have empty cuts throughout that family. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalRootPrimeFullPatternEquiv {N M J ell : ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (reindex.symm g).val) r t ≃ ↥(univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f))) := by intro f let e := repeatedBigPrimePatternEquiv (ell := ell) f probes r t exact { toFun := fun i => ⟨e i, mem_univ _⟩ invFun := fun i => e.symm i.val left_inv := fun i => e.symm_apply_apply i right_inv := fun i => Subtype.ext (e.apply_symm_apply i.val) } theorem physical_root_prime_full_pattern_cut {N M J ell : ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (i : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (reindex.symm g).val) r t) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex (fun g => repeatedBigPrimePatternCut probes (r.map f) (t.map f) (physicalRootPrimeFullPatternEquiv groups reindex probes r t i).val (reindex.symm g).val) = repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t i := by intro f funext g exact repeated_big_prime_pattern_map_cut f probes r t i g theorem physical_root_prime_full_pattern_small_cut {N M J ell : ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex ∀ (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) (g : ↥groupsᶜ), repeatedBigPrimePatternCut probes (r.map f) (t.map f) i g.val = ∅ := by intro f i g have hg : g.val ∉ Set.range f := by rintro ⟨j, hj⟩ apply (reindex.symm j).property change f j ∈ groupsᶜ rw [hj] exact g.property have h := repeated_big_prime_pattern_map_cut_outside f probes r t ((repeatedBigPrimePatternEquiv f probes r t).symm i) g.val hg rw [← repeated_big_prime_pattern_equiv_apply, Equiv.apply_symm_apply] at h exact h end Bounty end section -- Original source module: PhysicalRootNativePrimePhase /- The exact full root prime phase, expressed in the native pattern family. The original event decoration is transported, without any matching premise. -/ open Finset open scoped Classical namespace Bounty private theorem aux_index_value_congr {I G : Type} {P : G → Finset ℕ} {J : ℕ} (cuts : I → G → Finset (Fin J)) (F : ∀ i, PhysicalAuxLabels P (cuts i) → ℂ) {i j : I} (hij : i = j) (a : PhysicalAuxLabels P (cuts i)) (b : PhysicalAuxLabels P (cuts j)) (hab : ∀ g (x : cuts i g), a g x = b g ⟨x.val, by rw [← hij]; exact x.property⟩) : F i a = F j b := by subst j apply congrArg (F i) funext g x exact hab g x theorem physical_root_native_prime_phase {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (ζ : ℕ → ℝ) (k : ℕ → ℤ) (θ : ℝ) (j : Fin (n + 1)) (i : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (reindex.symm g).val) r t) : let emb := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let index := physicalRootPrimeFullPatternEquiv (ell := ell) groups reindex probes r t let oldCut := fun g => repeatedBigPrimePatternCut probes (r.map emb) (t.map emb) (index i).val (reindex.symm g).val let nativeCut := repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t i let hcut : oldCut = nativeCut := physical_root_prime_full_pattern_cut groups reindex probes r t i let kernel := fun L R (a : PhysicalAuxLabels (fun g => P (reindex.symm g).val) nativeCut) => let value := fun L R => repeatedBigPrimePatternWeight (fun g => probes (reindex.symm g).val) r t i * repeatedBigPrimePatternKernel (fun g => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) (fun g => probes (reindex.symm g).val) r t hrt Q h (fun U : Finset (RepeatedBigFlatIndex (Fin M) J ell) => primeProductRetainedCells (fun z : U => P (reindex.symm z.val.1).val) (fun z => V (reindex.symm z.val.1).val) h ξ) i L R a if (n - j.val) % 2 = 0 then (starRingEnd ℂ) (value R L) else value L R ∀ (decoration : ∀ a (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex), PhysicalMixedCoefficientEvent oldCut (k (n - j.val)) a s → ℂ), physicalMixedPhaseCutTransport hcut (k (n - j.val)) (fun a s e => physicalRootPrimeRowPhase (P := P) (ell := ell) (n := n) (B := B) groups reindex V probes r t hrt Q h ξ univ id (fun time _ => ζ time) (fun time _ => k time) θ (some (.inr j)) s ⟨index i, a, e⟩ * decoration a s e) = fun a s e => kernel (physicalMixedRepeatedLabels nativeCut s.2) (physicalMixedRepeatedLabels nativeCut (physicalMixedCoefficientTarget nativeCut (k (n - j.val)) a s e).2) a * physicalMixedFullResidualPhase nativeCut (ζ (n - j.val)) θ (k (n - j.val)) cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) a s e * physicalMixedPhaseCutTransport hcut (k (n - j.val)) decoration a s e := by intro emb index oldCut nativeCut hcut kernel decoration let base := fun (p : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (reindex.symm g).val) r t) L R (a : PhysicalAuxLabels (fun g => P (reindex.symm g).val) (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t p)) => repeatedBigPrimePatternWeight (fun g => probes (reindex.symm g).val) r t p * repeatedBigPrimePatternKernel (fun g => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) (fun g => probes (reindex.symm g).val) r t hrt Q h (fun U : Finset (RepeatedBigFlatIndex (Fin M) J ell) => primeProductRetainedCells (fun z : U => P (reindex.symm z.val.1).val) (fun z => V (reindex.symm z.val.1).val) h ξ) p L R a have hphase : (fun a s e => physicalRootPrimeRowPhase (P := P) (ell := ell) (n := n) (B := B) groups reindex V probes r t hrt Q h ξ univ id (fun time _ => ζ time) (fun time _ => k time) θ (some (.inr j)) s ⟨index i, a, e⟩ * decoration a s e) = (fun a s e => kernel (physicalMixedRepeatedLabels oldCut s.2) (physicalMixedRepeatedLabels oldCut (physicalMixedCoefficientTarget oldCut (k (n - j.val)) a s e).2) (physicalAuxCutTransport hcut a) * physicalMixedFullResidualPhase oldCut (ζ (n - j.val)) θ (k (n - j.val)) cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) a s e * decoration a s e) := by funext a s e let p := (repeatedBigPrimePatternEquiv emb probes r t).symm (index i).val have hp : p = i := (repeatedBigPrimePatternEquiv emb probes r t).symm_apply_apply i let a' : PhysicalAuxLabels (fun g => P (reindex.symm g).val) (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t p) := fun g x => a g ⟨x.val, by change x.val ∈ repeatedBigPrimePatternCut probes (r.map emb) (t.map emb) (index i).val (emb g) rw [← repeated_big_prime_pattern_equiv_symm_cut] exact x.property⟩ have hb (L R : RepeatedBigLists (fun g => P (reindex.symm g).val) J ell) : base p L R a' = base i L R (physicalAuxCutTransport hcut a) := by apply aux_index_value_congr (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t) (fun p a => base p L R a) hp a' (physicalAuxCutTransport hcut a) intro g x rw [physical_aux_cut_transport_apply] let L := physicalMixedRepeatedLabels oldCut s.2 let R := physicalMixedRepeatedLabels oldCut (physicalMixedCoefficientTarget oldCut (k (n - j.val)) a s e).2 have hsigned : (if (n - j.val) % 2 = 0 then (starRingEnd ℂ) (base p R L a') else base p L R a') = kernel L R (physicalAuxCutTransport hcut a) := by dsimp only [kernel] split_ifs · exact congrArg (starRingEnd ℂ) (hb R L) · exact hb L R exact congrArg (fun z => z * physicalMixedFullResidualPhase oldCut (ζ (n - j.val)) θ (k (n - j.val)) cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) a s e * decoration a s e) hsigned exact (congrArg (physicalMixedPhaseCutTransport hcut (k (n - j.val))) hphase).trans (physical_mixed_phase_cut_transport_kernel_residual hcut kernel (ζ (n - j.val)) θ (k (n - j.val)) cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) decoration) end Bounty end section -- Original source module: PhysicalRootSignedPrimeAction /- The full original prime-pattern edge row is the native signed prime-family action, with its exact original event decoration and reciprocal birth law. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_full_prime_edge_eq_signed_action {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (ζ : ℕ → ℝ) (k : ℕ → ℤ) (θ : ℝ) (baseline : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (a : ↥groupsᶜ) p, p ∈ P a.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (a : ↥groupsᶜ) (g : Fin M), Disjoint (P a.val) (P (reindex.symm g).val)) [∀ g (p : P (reindex.symm g).val), NeZero p.val] (q : ℝ) (retention : Fin (n + 2) → ℝ) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f))) let C := repeatedBigPrimePatternCut (ell := ell) probes (r.map f) (t.map f) let ζroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => ζ time let kroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => k time let β := fun (g : Fin M) (p : P (reindex.symm g).val) => ((p.val : ℝ)*baseline g p)⁻¹ let hC : ∀ i : patterns, ∀ a : ↥groupsᶜ, C i.val a.val = ∅ := fun i a => physical_root_prime_full_pattern_small_cut groups reindex probes r t i.val a let K := fun (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i L R aux ∀ (decoration : ∀ tag s, PhysicalRootMixedEvent (P := P) (ell := ell) (n := n) (B := B) groups reindex patterns C kroot tag s → ℂ) (j : Fin (n + 1)) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex), physicalRootOriginalRow groups reindex patterns C kroot V q β retention ρ (fun tag y ev => physicalRootMixedLocalPhase groups reindex patterns C hC kroot V ζroot K θ β ρ hPs hPb hdis tag (fun _ => ∅) y ev * decoration tag y ev) (some (.inr j)) F s = physicalMixedSignedPrimePatternAction (fun g => V (reindex.symm g).val) baseline ρ (fun a : ↥groupsᶜ => V a.val) q (fun g => probes (reindex.symm g).val) r t hrt Q h ξ (n-j.val) (k (n-j.val)) (fun _ => ∅) (fun i a y ev => physicalMixedFullResidualPhase (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t i) (ζ (n-j.val)) θ (k (n-j.val)) cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) a y ev * physicalMixedPhaseCutTransport (physical_root_prime_full_pattern_cut groups reindex probes r t i) (k (n-j.val)) (fun a y ev => decoration (some (.inr j)) y ⟨physicalRootPrimeFullPatternEquiv groups reindex probes r t i,a,ev⟩) a y ev) F s := by intro f patterns C ζroot kroot β hC K decoration j F s erw [physical_root_prime_edge_row_eq_actions groups reindex V probes r t hrt Q h ξ patterns id hC ζroot kroot θ baseline ρ hPs hPb hdis q retention decoration j F s] erw [physical_mixed_coefficient_sum_reindex_cut (physicalRootPrimeFullPatternEquiv groups reindex probes r t) (fun i : patterns => fun g => C i.val (reindex.symm g).val) (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t) (fun i => physical_root_prime_full_pattern_cut groups reindex probes r t i) (fun _ => k (n-j.val)) (fun g => V (reindex.symm g).val) baseline ρ (fun a : ↥groupsᶜ => V a.val) q (fun _ => ∅) (fun i a y ev => physicalRootPrimeRowPhase groups reindex V probes r t hrt Q h ξ patterns id ζroot kroot θ (some (.inr j)) y ⟨i,a,ev⟩ * decoration (some (.inr j)) y ⟨i,a,ev⟩) F s] unfold physicalMixedSignedPrimePatternAction simp only [Finset.sum_apply] apply Finset.sum_congr rfl intro i _ apply congrArg (fun phase => physicalMixedCoefficientAction (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t i) (k (n-j.val)) (fun g => V (reindex.symm g).val) baseline ρ (fun a : ↥groupsᶜ => V a.val) q (fun _ => ∅) phase F s) have hphase := physical_root_native_prime_phase groups reindex V probes r t hrt Q h ξ ζ k θ j i (fun a y ev => decoration (some (.inr j)) y ⟨physicalRootPrimeFullPatternEquiv groups reindex probes r t i,a,ev⟩) funext a y ev simpa only [mul_assoc] using congrFun (congrFun (congrFun hphase a) y) ev end Bounty end end section /- Root Fourier bridge bodies on the coherent actual-Z dependency boundary. -/ section -- Original source module: PhysicalRootFourierProjection /- The exact original Fourier edge before its outer and inner projections. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable [∀ g (p : P (e.symm g).val), NeZero p.val] theorem physical_root_fourier_edge_eq_original_row (j : Fin (n + 1)) (f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) : physicalRootFourierRow groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν (some (.inr j)) f = physicalRootOriginalRow groups e patterns C k V q β retention ρ (fun tag s ev => physicalRootMixedLocalPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis tag (fun _ => ∅) s ev * physicalRootMixedFourierMultiplier groups e patterns C k code encode ν hPs hPb hdis tag s ev) (some (.inr j)) f := by funext s unfold physicalRootFourierRow physicalRootOriginalRow physicalMixedWordRow finiteLocalPhasedRow apply Finset.sum_congr rfl intro ev _ rw [physical_root_fourier_edge_factor groups e patterns C hC k V ζ K θ β ρ code encode ν hPs hPb hdis j s ev] end Root end Bounty end section -- Original source module: PhysicalRootProjectedPrimeEdge /- The original projected Fourier prime edge equals the native signed family, with the exact pulled-back Fourier multiplier and both joint averages retained. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_projected_prime_edge_eq_signed_action {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (ζ : ℕ → ℝ) (k : ℕ → ℤ) (θ : ℝ) (baseline : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (a : ↥groupsᶜ) p, p ∈ P a.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (a : ↥groupsᶜ) (g : Fin M), Disjoint (P a.val) (P (reindex.symm g).val)) [∀ g (p : P (reindex.symm g).val), NeZero p.val] (q : ℝ) (retention : Fin (n + 2) → ℝ) (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (reindex.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f))) let C := repeatedBigPrimePatternCut (ell := ell) probes (r.map f) (t.map f) let ζroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => ζ time let kroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => k time let β := fun (g : Fin M) (p : P (reindex.symm g).val) => ((p.val : ℝ)*baseline g p)⁻¹ let hC : ∀ i : patterns, ∀ a : ↥groupsᶜ, C i.val a.val = ∅ := fun i a => physical_root_prime_full_pattern_small_cut groups reindex probes r t i.val a let K := fun (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i L R aux let decoration := physicalRootMixedFourierMultiplier groups reindex patterns C kroot code encode ν hPs hPb hdis let row := physicalRootFourierRow groups reindex patterns C hC kroot V q ζroot K θ β retention ρ hPs hPb hdis code encode ν ∀ (j : Fin (n + 1)) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ), row none (row (some (.inr j)) (row none F)) = physicalSmallBigJointAverage ( physicalMixedSignedPrimePatternAction (fun g => V (reindex.symm g).val) baseline ρ (fun a : ↥groupsᶜ => V a.val) q (fun g => probes (reindex.symm g).val) r t hrt Q h ξ (n-j.val) (k (n-j.val)) (fun _ => ∅) (fun i a y ev => physicalMixedFullResidualPhase (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t i) (ζ (n-j.val)) θ (k (n-j.val)) cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) a y ev * physicalMixedPhaseCutTransport (physical_root_prime_full_pattern_cut groups reindex probes r t i) (k (n-j.val)) (fun a y ev => decoration (some (.inr j)) y ⟨physicalRootPrimeFullPatternEquiv groups reindex probes r t i,a,ev⟩) a y ev) (physicalSmallBigJointAverage F)) := by intro f patterns C ζroot kroot β hC K decoration row j F dsimp only [row] simp only [physical_root_fourier_permutation_row] apply congrArg physicalSmallBigJointAverage rw [physical_root_fourier_edge_eq_original_row] funext s exact physical_root_full_prime_edge_eq_signed_action groups reindex V probes r t hrt Q h ξ ζ k θ baseline ρ hPs hPb hdis q retention decoration j (physicalSmallBigJointAverage F) s end Bounty end section -- Original source module: PhysicalRootUntouchedPrimeEdge /- An unaffected original projected Fourier edge has exactly the native residual; its original Fourier multiplier is one after the exact cut transport. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_untouched_prime_edge_eq_signed_action {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (ζ : ℕ → ℝ) (k : ℕ → ℤ) (θ : ℝ) (baseline : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (a : ↥groupsᶜ) p, p ∈ P a.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (a : ↥groupsᶜ) (g : Fin M), Disjoint (P a.val) (P (reindex.symm g).val)) [∀ g (p : P (reindex.symm g).val), NeZero p.val] (q : ℝ) (retention : Fin (n + 2) → ℝ) (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (reindex.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f))) let C := repeatedBigPrimePatternCut (ell := ell) probes (r.map f) (t.map f) let ζroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => ζ time let kroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => k time let β := fun (g : Fin M) (p : P (reindex.symm g).val) => ((p.val : ℝ)*baseline g p)⁻¹ let hC : ∀ i : patterns, ∀ a : ↥groupsᶜ, C i.val a.val = ∅ := fun i a => physical_root_prime_full_pattern_small_cut groups reindex probes r t i.val a let K := fun (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i L R aux let row := physicalRootFourierRow groups reindex patterns C hC kroot V q ζroot K θ β retention ρ hPs hPb hdis code encode ν ∀ (j : Fin (n + 1)), j ∉ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code → ∀ (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ), row none (row (some (.inr j)) (row none F)) = physicalSmallBigJointAverage ( physicalMixedSignedPrimePatternAction (fun g => V (reindex.symm g).val) baseline ρ (fun a : ↥groupsᶜ => V a.val) q (fun g => probes (reindex.symm g).val) r t hrt Q h ξ (n-j.val) (k (n-j.val)) (fun _ => ∅) (fun i a y ev => physicalMixedFullResidualPhase (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t i) (ζ (n-j.val)) θ (k (n-j.val)) cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) a y ev) (physicalSmallBigJointAverage F)) := by intro f patterns C ζroot kroot β hC K row j hj F refine (physical_root_projected_prime_edge_eq_signed_action groups reindex V probes r t hrt Q h ξ ζ k θ baseline ρ hPs hPb hdis q retention code encode ν j F).trans ?_ apply congrArg physicalSmallBigJointAverage congr 1 funext i a y ev rw [physical_mixed_phase_cut_transport_apply_reverse] erw [physical_root_fourier_edge_multiplier_untouched groups reindex patterns C kroot code encode ν hPs hPb hdis j hj] exact mul_one _ end Bounty end section -- Original source module: PhysicalSelectedFourierObservable /- The selected Fourier factors are observables of fresh edge draws and ordered ghost births, with no access to retained memory ordering. -/ open scoped Classical namespace Bounty section Observable variable {S : Type} {N J ell n B : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) noncomputable def physicalSelectedEdgeFourierObservable (C : Fin N → Finset (Fin J)) (j : Fin n) : PhysicalBareResidueState Ps J ell → PhysicalBareResidueState Ps J ell → (∀ g, Fin (J + ell) → P g) → (∀ g, Fin (J + ell) → P g) → (∀ g, EdgeDrawObservation (P g) (physicalFullSharedIndices (ell := ell) (C g))ᶜ.card) → ℂ := fun _ _ _ _ draw => physicalSelectedBirthMultiplier (fun _ : Fin N => J + ell) B n code ν encode (some (.inr j)) (commonForestEdgeLabels (fun (_ : Fin n) g => physicalFullSharedIndices (ell := ell) (C g)) B j draw) noncomputable def physicalSelectedGhostFourierObservable (j : Fin (n + 1)) : PhysicalBareResidueState Ps J ell → (∀ g, Fin (J + ell) → P g) → (∀ g, FiniteOrderedTuple (UnrestrictedResidueParticle (fun p : P g => p.val))) → ℂ := fun _ _ born => physicalSelectedBirthMultiplier (fun _ : Fin N => J + ell) B n code ν encode (some (.inl j)) (fun a => if h : a.2.val < (born a.1).1 then some ⟨a.1, ((born a.1).2 ⟨a.2.val, h⟩).1⟩ else none) theorem physical_selected_ghost_fourier_observable_norm_le (j : Fin (n + 1)) (s : PhysicalBareResidueState Ps J ell) (active : ∀ g, Fin (J + ell) → P g) (born : ∀ g, FiniteOrderedTuple (UnrestrictedResidueParticle (fun p : P g => p.val))) : ‖physicalSelectedGhostFourierObservable code ν encode j s active born‖ ≤ 1 := physical_selected_birth_multiplier_norm_le _ _ _ _ _ _ _ _ end Observable end Bounty end section -- Original source module: FullPermutationCommonBirth /- The effective-parameter equivalence preserves the actual newly born prime labels, including the common full-slot padding by none. -/ open scoped Classical namespace Bounty section Birth variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : ∀ g, P g → ℕ) {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ Δ' D D' : ∀ k c, A k c → Fin N → ℤ) (hΔ : ∀ k, Δ k = Δ' k) (hD : ∀ k c a g p, ((n g p : ℤ) ∣ D k c a g ↔ (n g p : ℤ) ∣ D' k c a g)) theorem full_permutation_parameter_birth_data (tag : Option (J ⊕ K)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag x) (a : FullMixedLocalBirthAddress S B tag) : fullMixedEventBornData n S B A Δ' D' tag x (fullPermutationParameterEventEquiv n S B A Δ Δ' D D' hΔ hD tag x e) a = fullMixedEventBornData n S B A Δ D tag x e a := by have he : Δ = Δ' := funext hΔ subst Δ' cases tag with | none => exact Fin.elim0 a.2 | some tag => cases tag <;> rfl theorem full_permutation_parameter_birth_label (tag : Option (J ⊕ K)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag x) (a : FullMixedLocalBirthAddress S B tag) : fullMixedEventBirthLabel n S B A Δ' D' tag x (fullPermutationParameterEventEquiv n S B A Δ Δ' D D' hΔ hD tag x e) a = fullMixedEventBirthLabel n S B A Δ D tag x e a := by unfold fullMixedEventBirthLabel rw [full_permutation_parameter_birth_data] theorem full_permutation_parameter_common_birth_label (tag : Option (J ⊕ K)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D tag x) (a : FullMixedCommonLocalAddress M B tag) : fullMixedCommonEventBirthLabel n S B A Δ' D' tag x (fullPermutationParameterEventEquiv n S B A Δ Δ' D D' hΔ hD tag x e) a = fullMixedCommonEventBirthLabel n S B A Δ D tag x e a := by rw [full_mixed_common_event_label_extension, full_mixed_common_event_label_extension] apply congrArg (fun f => optionalBirthExtension (fullMixedCommonLocalEmbedding S B tag) f a) funext b exact full_permutation_parameter_birth_label n S B A Δ Δ' D D' hΔ hD tag x e b end Birth end Bounty end section -- Original source module: FiniteEventOccurrenceEquiv /- Reading the owning event commutes with an exact event-path equivalence. -/ namespace Bounty universe uK uX uY uE uF theorem finite_event_path_occurrence_cast {K : Type uK} {X : Type uX} (E : K → X → Type uE) (t : ∀ k x, E k x → X) (ks : List K) {x y : X} (h : x = y) (p : FiniteEventPath E t ks x) (i : Fin ks.length) : finiteEventPathOccurrence E t ks y (cast (congrArg (FiniteEventPath E t ks) h) p) i = finiteEventPathOccurrence E t ks x p i := by cases h rfl theorem finite_event_path_equiv_occurrence {K : Type uK} {X : Type uX} {Y : Type uY} (E : K → X → Type uE) (F : K → Y → Type uF) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (e : X → Y) (δ : ∀ k x, E k x ≃ F k (e x)) (ht : ∀ k x a, e (t k x a) = u k (e x) (δ k x a)) (ks : List K) (x : X) (p : FiniteEventPath E t ks x) (i : Fin ks.length) : finiteEventPathOccurrence F u ks (e x) (finiteEventPathEquiv E F t u e δ ht ks x p) i = let a := finiteEventPathOccurrence E t ks x p i ⟨e a.1, δ (ks.get i) a.1 a.2⟩ := by induction ks generalizing x with | nil => exact Fin.elim0 i | cons k ks ih => rcases p with ⟨a, p⟩ refine Fin.cases ?_ (fun j => ?_) i · rfl · change finiteEventPathOccurrence F u ks _ (cast (congrArg (FiniteEventPath F u ks) (ht k x a)) (finiteEventPathEquiv E F t u e δ ht ks (t k x a) p)) j = _ rw [finite_event_path_occurrence_cast F u ks (ht k x a)] exact ih _ p j end Bounty end section -- Original source module: FiniteLocalPhaseEquiv /- An exact event equivalence transports the complete ordinary local phase product, including every source state along the path. -/ open Finset namespace Bounty theorem finite_event_local_phase_equiv {K X Y : Type*} (E : K → X → Type*) (F : K → Y → Type*) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (e : X → Y) (δ : ∀ k x, E k x ≃ F k (e x)) (ht : ∀ k x a, e (t k x a) = u k (e x) (δ k x a)) (phase : ∀ k x, E k x → ℂ) (phase' : ∀ k y, F k y → ℂ) (hp : ∀ k x a, phase' k (e x) (δ k x a) = phase k x a) (ks : List K) (x : X) (p : FiniteEventPath E t ks x) : finiteEventLocalPhase F u phase' ks (e x) (finiteEventPathEquiv E F t u e δ ht ks x p) = finiteEventLocalPhase E t phase ks x p := by rw [finite_event_local_phase_occurrences, finite_event_local_phase_occurrences] apply prod_congr rfl intro i _ rw [finite_event_path_equiv_occurrence] exact hp _ _ _ end Bounty end section -- Original source module: PhysicalSelectedParameterPhase /- Effective event parameters preserve the selected Fourier birth factor while the original residual phase is pulled back exactly. -/ namespace Bounty section Parameter variable {S I : Type} {Ps : S → Finset ℕ} {J ell N n : ℕ} {P : Fin N → Type} (sizes : ∀ g, P g → ℕ) {M : Fin N → ℕ} (shared : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n) → ∀ g, Finset (Fin (M g))) (B : ℕ) (aux : ∀ k, SharedActiveLabels P (shared k) → Type) (Δ Δ' D D' : ∀ k c, aux k c → Fin N → ℤ) (hΔ : ∀ k, Δ k = Δ' k) (hD : ∀ k c a g p, ((sizes g p : ℤ) ∣ D k c a g ↔ (sizes g p : ℤ) ∣ D' k c a g)) (residual : ∀ (tag : Option (Fin (n + 1) ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := Fin n))) x, FullPermutationMixedEvent sizes shared B aux Δ' D' tag x → ℂ) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) × Fin (Fintype.card (FullMixedCommonBirthAddress M B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) → ℝ) (encode : Sigma P → ℤ) end Parameter end Bounty end section -- Original source module: PhysicalRootFourierObservable /- Ordinary local Fourier phases for the exact root coefficient, first on effective events, then on planned events and the actual mixed word. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (ρ : ℝ) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) theorem physical_root_fourier_edge_observable (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (ev : PhysicalRootMixedEvent groups e patterns C k (some (.inr j)) s) : physicalRootMixedFourierMultiplier groups e patterns C k code encode ν hPs hPb hdis (some (.inr j)) s ev = physicalMixedCoefficientObservablePhase (fun g => C ev.1.val (e.symm g).val) (k (n - j.val) ev.1.val) ev.2.1 (physicalSelectedEdgeFourierObservable code ν encode (fun g => C ev.1.val (e.symm g).val) j) s ev.2.2 := by unfold physicalRootMixedFourierMultiplier physicalMixedBigLocalPullback physicalRootPlannedFourierMultiplier physicalRootEffectiveFourierMultiplier dsimp only [physicalSelectedDecoratedPhase] simp only [one_mul] unfold physicalMixedEffectiveBigEventEquiv simp_rw [full_permutation_parameter_common_birth_label] dsimp only [physicalMixedBigEventTag, physicalMixedBigEventProjection, physicalMixedBigTagErase, physicalMixedTagBirthAddressEquiv, Equiv.refl_apply] erw [full_mixed_common_edge_labels_eq_observation] rfl theorem physical_root_fourier_ghost_observable (j : Fin (n + 2)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (ev : PhysicalRootMixedEvent groups e patterns C k (some (.inl j)) s) : physicalRootMixedFourierMultiplier groups e patterns C k code encode ν hPs hPb hdis (some (.inl j)) s ev = physicalSmallBigGhostBirthPhase (fun _ : Fin M => J + ell) B (physicalSelectedGhostFourierObservable code ν encode j) s ev := by unfold physicalRootMixedFourierMultiplier physicalMixedBigLocalPullback physicalRootPlannedFourierMultiplier physicalRootEffectiveFourierMultiplier dsimp only [physicalSelectedDecoratedPhase] simp only [one_mul] unfold physicalMixedEffectiveBigEventEquiv simp_rw [full_permutation_parameter_common_birth_label] dsimp only [physicalMixedBigEventTag, physicalMixedBigEventProjection, physicalMixedBigTagErase, physicalMixedTagBirthAddressEquiv, Equiv.refl_apply] erw [full_mixed_common_ghost_labels_eq_observation] rfl end Root end Bounty end section -- Original source module: PhysicalRootFourierReindex /- The actual root Fourier multiplier is invariant under the exact pending-memory event reindexing on each original big edge. -/ open scoped Classical namespace Bounty theorem physical_root_fourier_edge_reindex {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (index : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) [∀ g (p : P (index.symm g).val), NeZero p.val] (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (index.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) (hPs : ∀ (a : ↥groupsᶜ) p, p ∈ P a.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (index.symm g).val → Nat.Prime p) (hdis : ∀ (a : ↥groupsᶜ) (g : Fin M), Disjoint (P a.val) (P (index.symm g).val)) (j : Fin (n + 1)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups index) (τ : ∀ g, Equiv.Perm (Fin (s.2 g).2.1.val)) (ev : PhysicalRootMixedEvent groups index patterns C k (some (.inr j)) s) : physicalRootMixedFourierMultiplier groups index patterns C k code encode ν hPs hPb hdis (some (.inr j)) (s.1, productMemoryReindex s.2 τ) ⟨ev.1, ev.2.1, physicalMixedCoefficientReindex (fun g => C ev.1.val (index.symm g).val) (k (n - j.val) ev.1.val) ev.2.1 s τ ev.2.2⟩ = physicalRootMixedFourierMultiplier groups index patterns C k code encode ν hPs hPb hdis (some (.inr j)) s ev := by refine (physical_root_fourier_edge_observable groups index patterns C k code encode ν hPs hPb hdis j (s.1, productMemoryReindex s.2 τ) ⟨ev.1, ev.2.1, physicalMixedCoefficientReindex (fun g => C ev.1.val (index.symm g).val) (k (n - j.val) ev.1.val) ev.2.1 s τ ev.2.2⟩).trans ?_ exact (physical_mixed_coefficient_observable_reindex (fun g => C ev.1.val (index.symm g).val) (k (n - j.val) ev.1.val) ev.2.1 (physicalSelectedEdgeFourierObservable code ν encode (fun g => C ev.1.val (index.symm g).val) j) s τ ev.2.2).trans (physical_root_fourier_edge_observable groups index patterns C k code encode ν hPs hPb hdis j s ev).symm end Bounty end section -- Original source module: PhysicalRootProjectedPrimeSymmetry /- The exact projected root Fourier prime edge preserves pending-memory symmetry, for both chronological kernel orientations and the original Fourier multiplier. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_projected_prime_edge_memory_symmetric {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (ζ : ℕ → ℝ) (k : ℕ → ℤ) (θ : ℝ) (baseline : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (a : ↥groupsᶜ) p, p ∈ P a.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (a : ↥groupsᶜ) (g : Fin M), Disjoint (P a.val) (P (reindex.symm g).val)) [∀ g (p : P (reindex.symm g).val), NeZero p.val] (q : ℝ) (retention : Fin (n + 2) → ℝ) (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (reindex.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) : let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f))) let C := repeatedBigPrimePatternCut (ell := ell) probes (r.map f) (t.map f) let ζroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => ζ time let kroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => k time let β := fun (g : Fin M) (p : P (reindex.symm g).val) => ((p.val : ℝ)*baseline g p)⁻¹ let hC : ∀ i : patterns, ∀ a : ↥groupsᶜ, C i.val a.val = ∅ := fun i a => physical_root_prime_full_pattern_small_cut groups reindex probes r t i.val a let K := fun (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i L R aux let row := physicalRootFourierRow groups reindex patterns C hC kroot V q ζroot K θ β retention ρ hPs hPb hdis code encode ν ∀ (j : Fin (n + 1)) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s,x))) → ∀ s, ProductMemorySymmetric (fun x => row none (row (some (.inr j)) (row none F)) (s,x)) := by intro f patterns C ζroot kroot β hC K row j F hF have hedge := physical_root_projected_prime_edge_eq_signed_action groups reindex V probes r t hrt Q h ξ ζ k θ baseline ρ hPs hPb hdis q retention code encode ν j F change row none (row (some (.inr j)) (row none F)) = _ at hedge rw [hedge] apply physical_small_big_joint_average_memory_symmetric apply physical_mixed_signed_prime_pattern_memory_symmetric · intro i a y τ ev apply congrArg₂ (fun z w : ℂ => z * w) · exact physical_mixed_concrete_residual_reindex _ (ζ (n-j.val)) θ (k (n-j.val)) (fun _ => ∅) a y τ ev · apply physical_mixed_phase_cut_transport_reindex intro a' y' τ' ev' exact physical_root_fourier_edge_reindex groups reindex patterns C kroot code encode ν hPs hPb hdis j y' τ' ⟨physicalRootPrimeFullPatternEquiv groups reindex probes r t i, a', ev'⟩ · exact physical_small_big_joint_average_memory_symmetric F hF end Bounty end section -- Original source module: PhysicalRootProjectedPrimeNorm /- A uniform bound for every projected original Fourier prime edge, in its actual small-residue and reciprocal-birth measure. The constant is chosen before all root dimensions, prime pools, and Fourier data. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_root_projected_prime_edge_norm_bound {q vs : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ {N M J n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ z : PhysicalPrime (fun a : ↥groupsᶜ => P a.val), NeZero z.2.val] (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin M)) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (ζ : ℕ → ℝ) (k : ℕ → ℤ) (θ : ℝ) (baseline : (g : Fin M) → P (reindex.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (a : ↥groupsᶜ) p, p ∈ P a.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hdis : ∀ (a : ↥groupsᶜ) (g : Fin M), Disjoint (P a.val) (P (reindex.symm g).val)) [∀ g (p : P (reindex.symm g).val), NeZero p.val] (retention : Fin (n + 2) → ℝ) (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (reindex.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ), let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f))) let C := repeatedBigPrimePatternCut (ell := ell) probes (r.map f) (t.map f) let ζroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => ζ time let kroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => k time let β := fun (g : Fin M) (p : P (reindex.symm g).val) => ((p.val : ℝ)*baseline g p)⁻¹ let hC : ∀ i : patterns, ∀ a : ↥groupsᶜ, C i.val a.val = ∅ := fun i a => physical_root_prime_full_pattern_small_cut groups reindex probes r t i.val a let K := fun (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i L R aux let row := physicalRootFourierRow groups reindex patterns C hC kroot V q ζroot K θ β retention ρ hPs hPb hdis code encode ν ∀ (m : ℕ), (∀ g : Fin M, (probes (reindex.symm g).val).card ≤ m) → 0 < ξ → (∀ a : ↥groupsᶜ, vs ≤ V a.val) → (∀ g : Fin M, ∑ p ∈ P (reindex.symm g).val, 1 / (p : ℝ) = V (reindex.symm g).val) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → ∀ (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g : Fin M, vmin ≤ V (reindex.symm g).val) → (∀ g : Fin M, V (reindex.symm g).val ≤ vmax) → ∀ (j : Fin (n + 1)) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s,x))) → let w := physicalSmallBigMeasure (fun a : ↥groupsᶜ => V a.val) (productMemoryWeight (fun g p => β g p / V (reindex.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (reindex.symm g).val))) cleanActiveNorm w (row none (row (some (.inr j)) (row none F))) ≤ repeatedBigFamilyEnvelope M m Q ξ * A ^ groupsᶜ.card * Real.sqrt (unrestrictedEdgeEnergyBound ρ v vmin vmax (ell + m) ^ M) * cleanActiveNorm w F := by obtain ⟨A, hA, hbound⟩ := exists_physical_mixed_signed_prime_pattern_projected_norm_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ intro N M J n B P _ groups reindex _ V probes r t hrt Q h ξ ζ k θ baseline ρ hPs hPb hdis _ retention code encode ν f patterns C ζroot kroot β hC K row m hprobes hξ hVs hmass hbaseline v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi j F hF w let decoration := physicalRootMixedFourierMultiplier groups reindex patterns C kroot code encode ν hPs hPb hdis have hrow := physical_root_projected_prime_edge_eq_signed_action groups reindex V probes r t hrt Q h ξ ζ k θ baseline ρ hPs hPb hdis q retention code encode ν j F change row none (row (some (.inr j)) (row none F)) = _ at hrow rw [hrow] have hμ : (fun (g : Fin M) (p : P (reindex.symm g).val) => β g p / V (reindex.symm g).val) = (fun g => tiltedPhysicalBirthLaw (P := fun g : Fin M => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) g (baseline g)) := by funext g p exact physical_root_tilted_birth_law (fun g => V (reindex.symm g).val) baseline g p dsimp only [w] have hμpoint (g : Fin M) (p : P (reindex.symm g).val) : β g p / V (reindex.symm g).val = tiltedPhysicalBirthLaw (P := fun g : Fin M => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) g (baseline g) p := congrFun (congrFun hμ g) p simp_rw [hμpoint] have hb := hbound ↥groupsᶜ (Fin M) (fun a : ↥groupsᶜ => P a.val) (fun g => P (reindex.symm g).val) J B m (fun g => V (reindex.symm g).val) baseline ρ (fun a : ↥groupsᶜ => V a.val) (fun g => probes (reindex.symm g).val) r t hrt hprobes Q h ξ hξ (n-j.val) (k (n-j.val)) (fun _ => ∅) hVs hmass hbaseline v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi (fun i a y ev => physicalMixedFullResidualPhase (repeatedBigPrimePatternCut (fun g => probes (reindex.symm g).val) r t i) (ζ (n-j.val)) θ (k (n-j.val)) cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) a y ev * physicalMixedPhaseCutTransport (physical_root_prime_full_pattern_cut groups reindex probes r t i) (k (n-j.val)) (fun a y ev => decoration (some (.inr j)) y ⟨physicalRootPrimeFullPatternEquiv groups reindex probes r t i,a,ev⟩) a y ev) (by intro i a y ev apply physical_mixed_concrete_residual_mul_norm_le rw [physical_mixed_phase_cut_transport_apply_reverse] exact physical_root_fourier_multiplier_norm_le groups reindex patterns C kroot code encode ν hPs hPb hdis _ _ _) F hF simpa only [Fintype.card_fin, Fintype.card_coe] using hb end Bounty end end section /- Pool-preserving realizations of the original candidate prime groups. The arithmetic proof follows CandidateOmissionParameters and CandidatePromotionRarity; no state-space transport is required. -/ open Finset Filter open scoped Classical Topology namespace Bounty structure CandidateMixedPoolRealization {S G : Type} (scale L : ℝ) (Ps : S → Finset ℕ) (P : G → Finset ℕ) where smallIndex : S ↪ CandidateSmallGroup scale L bigIndex : G → CandidateBigGroup scale L smallPool_eq : ∀ s, Ps s = candidateSmallPool scale L (smallIndex s) bigPool_eq : ∀ g, P g = candidatePBand (scale * L) (bigIndex g).val theorem eventually_realized_candidate_omission_arithmetic {scale : ℝ} (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S G : Type) [Fintype S] (Ps : S → Finset ℕ) (P : G → Finset ℕ) (_R : CandidateMixedPoolRealization scale L Ps P), (∀ s p, p ∈ Ps s → p.Prime) ∧ Pairwise (fun s t => Disjoint (Ps s) (Ps t)) ∧ ∀ (J : ℕ) (labels : PhysicalMarkLists Ps J ell) (g : G) (p : P g), p.val.Prime ∧ ∀ k : ℤ, k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ¬ (p.val : ℤ) ∣ k ∧ ∀ A : PrimeOmissionChoices (physicalGroupMarks labels) ell, primeOmissionProduct (physicalGroupMarks labels) ell A < p.val := by filter_upwards [eventually_candidate_omission_bounds hscale ell C₂, eventually_gt_atTop (0 : ℝ)] with L hL hpos intro S G _ Ps P R have hsmall (s : S) : (R.smallIndex s).val ∈ candidateSmallPIndices scale L := (R.smallIndex s).property have hbig (g : G) : (R.bigIndex g).val ∈ candidateBigPIndices scale L := (R.bigIndex g).property have hcard : Fintype.card S ≤ (candidateSmallPIndices scale L).card := by simpa only [CandidateSmallGroup, Fintype.card_coe] using Fintype.card_le_of_injective R.smallIndex R.smallIndex.injective refine ⟨?_, ?_, ?_⟩ · intro s p hp rw [R.smallPool_eq s] at hp exact hL.2.2.2.2.1 _ (mem_union_left _ (hsmall s)) p hp · intro s t hst rw [R.smallPool_eq s, R.smallPool_eq t] exact hL.2.2.2.2.2 (fun he => hst (R.smallIndex.injective (Subtype.ext he))) · intro J labels g p have hp : p.val ∈ candidatePBand (scale * L) (R.bigIndex g).val := by rw [← R.bigPool_eq g] exact p.property have hbp := hL.2.2.2.1 _ (hbig g) p.val hp refine ⟨hbp.1, ?_⟩ intro k hk hkb refine ⟨physical_pending_step_not_dvd_of_bounds (Int.natAbs_pos.mpr hk) (hkb.trans_lt hL.2.1) hbp.2.le, ?_⟩ intro A have hb := prime_omission_product_real_le_pow (physicalGroupMarks labels) ell (fun s q hq => hL.2.2.1 _ (hsmall s) q (by change q ∈ candidateSmallPool scale L (R.smallIndex s) rw [← R.smallPool_eq s] exact physical_group_marks_subset labels s hq)) A have hpw : (Real.exp (L ^ (1/5 : ℝ))) ^ (ell * Fintype.card S) ≤ (Real.exp (L ^ (1/5 : ℝ))) ^ (ell * (candidateSmallPIndices scale L).card) := pow_le_pow_right₀ (Real.one_le_exp (Real.rpow_nonneg hpos.le _)) (Nat.mul_le_mul_left ell hcard) exact_mod_cast ((hb.trans hpw).trans_lt hL.1).trans hbp.2 end Bounty end section /- Indicator probability is independent of finite enumeration and decision procedures. This isolates the permutation enumeration transport. -/ open Finset open scoped Classical namespace Bounty theorem uniform_indicator_probability_le_of_fraction {T : Type*} (fa fb : Fintype T) (pred : T → Prop) (d₁ d₂ : DecidablePred pred) {b : ℝ} (h : ((@Finset.filter T pred d₁ (@Finset.univ T fa)).card : ℝ) / (@Fintype.card T fa : ℝ) ≤ b) : (∑ x ∈ @Finset.univ T fb, @ite ℝ (pred x) (d₂ x) (1 / (@Fintype.card T fb : ℝ)) 0) ≤ b := by cases Subsingleton.elim fb fa cases Subsingleton.elim d₁ (fun x => Classical.propDecidable (pred x)) cases Subsingleton.elim d₂ (fun x => Classical.propDecidable (pred x)) exact (le_of_eq (@uniform_indicator_probability_eq T fa pred)).trans h end Bounty end section /- Original candidate omission rarity on arbitrary pool-preserving group indices. This is CandidatePromotionRarity and CandidateMixedReverseRarity with the original finite groups realized directly in the target types. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem eventually_realized_candidate_mixed_eligibility_probability_le {scale : ℝ} (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) (P : G → Finset ℕ) (_R : CandidateMixedPoolRealization scale L Ps P) (J B : ℕ) (M : G → ℕ) (shared : ∀ g, Finset (Fin (M g))) (D_B : SharedActiveLabels (fun g => ↥(P g)) shared → ℕ) (k : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) (fun g => UnrestrictedResidueParticle (fun p : P g => p.val)) M B), productTotalMemory s.2 ≤ B → (∑ σ : PhysicalPermutations S J ell, if physicalSmallBigEligible (fun g (p : P g) => p.val) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) (physicalSmallBigPermutation σ s) then 1 / (Fintype.card (PhysicalPermutations S J ell) : ℝ) else 0) ≤ (B : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ) := by filter_upwards [eventually_realized_candidate_omission_arithmetic hscale ell C₂] with L hL intro S G _ dS _ _ Ps P R J B M shared D_B k hk hkb s hB cases Subsingleton.elim dS (Classical.decEq S) obtain ⟨hPs, hdis, harith⟩ := hL S G Ps P R simp only [physical_small_big_eligible_permute_iff] let pred := fun σ : PhysicalPermutations S J ell => ∃ g, (unrestrictedResidueEligible (fun p : P g => p.val) (-(k * (smallSourcePermutationDilation s.1.2 (D_B (productActiveMemorySplit shared B s.2).1) σ : ℤ))) (smallSourcePermutationDilation s.1.2 (D_B (productActiveMemorySplit shared B s.2).1) σ) (s.2 g).2.2).Nonempty have h := small_source_pending_eligible_fraction_le s.1.2 hPs hdis (fun g (p : P g) => p.val) s.2 (D_B (productActiveMemorySplit shared B s.2).1) k (fun g j => (harith J s.1.2 g ((s.2 g).2.2 j).1).1) (fun g j => ((harith J s.1.2 g ((s.2 g).2.2 j).1).2 k hk hkb).1) (fun g j => ((harith J s.1.2 g ((s.2 g).2.2 j).1).2 k hk hkb).2) change (∑ σ : PhysicalPermutations S J ell, if pred σ then (1 : ℝ) / Fintype.card (PhysicalPermutations S J ell) else 0) ≤ _ exact uniform_indicator_probability_le_of_fraction _ _ pred _ _ (h.trans (div_le_div_of_nonneg_right (Nat.cast_le.mpr hB) (Nat.cast_nonneg _))) theorem eventually_realized_candidate_mixed_reverse_eligibility_probability_le {scale : ℝ} (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) (P : G → Finset ℕ) (_R : CandidateMixedPoolRealization scale L Ps P) (J B : ℕ) (M : G → ℕ) (shared : ∀ g, Finset (Fin (M g))) (D_B : SharedActiveLabels (fun g => ↥(P g)) shared → ℕ) (k : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) (fun g => UnrestrictedResidueParticle (fun p : P g => p.val)) M B), productTotalMemory s.2 ≤ B → (∑ σ : PhysicalPermutations S J ell, if physicalSmallBigEligible (fun g (p : P g) => p.val) shared B (fun d c _ => -(-(k * (D_B c * physicalSharedProduct d : ℕ)))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) (physicalSmallBigPermutation σ s) then 1 / (Fintype.card (PhysicalPermutations S J ell) : ℝ) else 0) ≤ (B : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ) := by filter_upwards [eventually_realized_candidate_mixed_eligibility_probability_le hscale ell C₂] with L hL intro S G _ _ _ _ Ps P R J B M shared D_B k hk hkb s hB have he : (fun (d : PhysicalSharedLists Ps J) (c : SharedActiveLabels (fun g => ↥(P g)) shared) (_ : G) => -(-(k * (D_B c * physicalSharedProduct d : ℕ)))) = (fun d c _ => -((-k) * (D_B c * physicalSharedProduct d : ℕ))) := by funext d c g ring rw [he] exact hL S G Ps P R J B M shared D_B (-k) (neg_ne_zero.mpr hk) (by simpa only [Int.natAbs_neg] using hkb) s hB end Bounty end section /- The exact uniform small-slot average preserves a cap depending only on the big state. Separating this identity keeps full event types opaque. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_average_cap_eq {S X : Type*} [Fintype S] [DecidableEq S] {Ps : S → Finset ℕ} {J ell : ℕ} (f : PhysicalSmallBigState Ps J ell X → ℂ) (cap : X → Prop) (dCap : DecidablePred cap) (hf : ∀ s, f s = @ite ℂ (cap s.2) (dCap s.2) (f s) 0) : physicalSmallBigAverage f = fun s => ∑ σ : PhysicalPermutations S J ell, ((1 / (Fintype.card (PhysicalPermutations S J ell) : ℝ) : ℝ) : ℂ) * (@ite ℂ (cap s.2) (dCap s.2) (f (physicalSmallBigPermutation σ s)) 0) := by funext s rw [physical_small_big_average_uniform (inferInstance)] apply sum_congr rfl intro σ _ apply congrArg (fun z : ℂ => ((1 / (Fintype.card (PhysicalPermutations S J ell) : ℝ) : ℝ) : ℂ) * z) exact hf (physicalSmallBigPermutation σ s) end Bounty end section /- Uniform small-slot averaging of the generic promotion estimate. Only the actual eligibility probability remains as the finite input. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem exists_physical_small_big_uniform_promotion_energy_bound {q vs : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val], ∀ J B : ℕ, ∀ M : G → ℕ, ∀ shared : ∀ g, Finset (Fin (M g)), ∀ D_B : SharedActiveLabels ((fun g => ↥(P g))) shared → ℕ, ∀ k : ℤ, ∀ Vs : S → ℝ, (∀ g, vs ≤ Vs g) → ∀ μ : ∀ g, (fun g => ↥(P g)) g → ℝ, ∀ ρ : ℝ, ∀ V : G → ℝ, ∀ v vmin vmax : ℝ, 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ T : ℕ, (∀ g, (shared g)ᶜ.card ≤ T) → ∀ Φ : ∀ s : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent ((fun g (p : P g) => p.val)) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ))) s → ℂ, ∀ H : ℝ, 0 ≤ H → (∀ s e, ‖Φ s e‖ ≤ H) → ∀ δ : ℝ, 0 ≤ δ → (∀ s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) (fun g => UnrestrictedResidueParticle (fun p : P g => p.val)) M B), productTotalMemory s.2 ≤ B → (∑ σ : PhysicalPermutations S J ell, if physicalSmallBigEligible (fun g (p : P g) => p.val) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) (physicalSmallBigPermutation σ s) then 1 / (Fintype.card (PhysicalPermutations S J ell) : ℝ) else 0) ≤ δ) → ∀ F : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B) → ℂ, (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigAverage (fun s => physicalSmallBigFullPhasedAction ((fun g (p : P g) => p.val)) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) μ ρ V (fun c => k * D_B c) Vs q (fun y e => if ∃ g, (e.2.2 g).2.1.Nonempty then Φ y e else 0) F s)) ≤ δ * (H ^ 2 * (A ^ (2 * (Fintype.card S)) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ (Fintype.card G))) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_promotion_average_energy_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ intro S G _ _ _ _ Ps _ P _ J B M shared D_B k Vs hVs μ ρ V v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht Φ H hH hΦ δ hδ hrare F hF let aux : PhysicalAuxLabels (Ps) (fun _ => (∅ : Finset (Fin J))) := fun _ j => False.elim ((Finset.notMem_empty j.val) j.property) let π : PhysicalPermutations (S) J ell → ℝ := fun _ => 1 / (Fintype.card (PhysicalPermutations (S) J ell) : ℝ) have hπ : ∀ σ, 0 ≤ π σ := fun _ => one_div_nonneg.mpr (Nat.cast_nonneg _) have hπmass : ∑ σ, π σ ≤ 1 := by simp only [π, sum_const, card_univ, nsmul_eq_mul, mul_one_div] exact div_self_le_one _ have h := hbound (S) (G) (PhysicalPermutations (S) J ell) (Ps) ((fun g => ↥(P g))) ((fun g (p : P g) => p.val)) J M shared B (fun _ d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun _ d c _ => (D_B c * physicalSharedProduct d : ℕ)) μ ρ V (fun _ c => k * D_B c) Vs hVs aux v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht π hπ hπmass (fun σ => σ) (fun s => productTotalMemory s.2 ≤ B) (fun _ => Φ) H hH (fun _ => hΦ) δ hδ hrare F hF have he := physical_small_big_average_cap_eq (S := S) (Ps := Ps) (J := J) (ell := ell) (fun s => physicalSmallBigFullPhasedAction (fun g (p : P g) => p.val) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) μ ρ V (fun c => k * D_B c) Vs q (fun y e => if ∃ g, (e.2.2 g).2.1.Nonempty then Φ y e else 0) F s) (fun x => productTotalMemory x ≤ B) (fun x => Classical.propDecidable (productTotalMemory x ≤ B)) (by intro s by_cases hs : productTotalMemory s.2 ≤ B · simp only [hs, if_true] · simp only [hs, if_false] exact physical_small_big_full_phased_zero_above_cap (fun g (p : P g) => p.val) shared B _ _ μ ρ V (fun c => k * D_B c) Vs q _ F s hs) dsimp only [π] at h exact (le_of_eq (congrArg (physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)))) he)).trans h end Bounty end section /- Original proof: CandidateMixedPromotionEnergy.lean. Generalized only to pool-preserving group realizations. -/ /- The actual candidate-pool mixed promotion estimate. The scalar omission probability and all per-choice operator bounds are discharged. A fixed auxiliary draw is absorbed into the arbitrary retained-big-label factor. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem eventually_realized_candidate_mixed_promotion_energy_le {q vs scale : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ᶠ L : ℝ in atTop, ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (_R : CandidateMixedPoolRealization scale L Ps P), ∀ J B : ℕ, ∀ M : G → ℕ, ∀ shared : ∀ g, Finset (Fin (M g)), ∀ D_B : SharedActiveLabels ((fun g => ↥(P g))) shared → ℕ, ∀ k : ℤ, k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ Vs : S → ℝ, (∀ g, vs ≤ Vs g) → ∀ μ : ∀ g, (fun g => ↥(P g)) g → ℝ, ∀ ρ : ℝ, ∀ V : G → ℝ, ∀ v vmin vmax : ℝ, 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ T : ℕ, (∀ g, (shared g)ᶜ.card ≤ T) → ∀ Φ : ∀ s : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent ((fun g (p : P g) => p.val)) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ))) s → ℂ, ∀ H : ℝ, 0 ≤ H → (∀ s e, ‖Φ s e‖ ≤ H) → ∀ F : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B) → ℂ, (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigAverage (fun s => physicalSmallBigFullPhasedAction ((fun g (p : P g) => p.val)) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) μ ρ V (fun c => k * D_B c) Vs q (fun y e => if ∃ g, (e.2.2 g).2.1.Nonempty then Φ y e else 0) F s)) ≤ ((B : ℝ) / (((J + ell).choose ell) ^ (Fintype.card S) : ℕ)) * (H ^ 2 * (A ^ (2 * (Fintype.card S)) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ (Fintype.card G))) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_uniform_promotion_energy_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ filter_upwards [eventually_realized_candidate_mixed_eligibility_probability_le hscale ell C₂] with L hL intro S G _ _ _ _ Ps _ P _ R J B M shared D_B k hk hkbound Vs hVs μ ρ V v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht Φ H hH hΦ F hF exact hbound S G Ps P J B M shared D_B k Vs hVs μ ρ V v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht Φ H hH hΦ ((B : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ)) (div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _)) (hL S G Ps P R J B M shared D_B k hk hkbound) F hF end Bounty end section /- Original proof: CandidateMixedStorageEnergy.lean. Generalized only to pool-preserving group realizations. -/ /- Candidate-prime arithmetic supplies reverse eligibility rarity for the literal mixed storage operator with both small-slot averages. The small measure is the original residue-valid measure, and big labels may repeat. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem eventually_realized_candidate_mixed_storage_energy_le {q vs scale : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ᶠ L : ℝ in atTop, ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (_R : CandidateMixedPoolRealization scale L Ps P), ∀ J B : ℕ, ∀ M : G → ℕ, ∀ shared : ∀ g, Finset (Fin (M g)), ∀ D_B : SharedActiveLabels ((fun g => ↥(P g))) shared → ℕ, ∀ k : ℤ, k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ Vs : S → ℝ, (∀ g, vs ≤ Vs g) → ∀ aux : PhysicalAuxLabels (Ps) (fun _ => (∅ : Finset (Fin J))), ∀ μ : ∀ g, (fun g => ↥(P g)) g → ℝ, ∀ ρ : ℝ, ∀ V : G → ℝ, ∀ v vmin vmax : ℝ, 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ T : ℕ, (∀ g, (shared g)ᶜ.card ≤ T) → ∀ F : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B) → ℂ, (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigAverage (physicalSmallBigStorageAction ((fun g (p : P g) => p.val)) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) μ ρ V (fun c => k * D_B c) Vs q aux (physicalSmallBigAverage F))) ≤ ((B : ℝ) / (((J + ell).choose ell) ^ (Fintype.card S) : ℕ)) * (A ^ (2 * (Fintype.card S)) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ (Fintype.card G)) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨A, hA, hbound⟩ := exists_physical_small_big_storage_sandwich_energy_bound hq0 hq1 hvs ell refine ⟨A, hA, ?_⟩ filter_upwards [eventually_realized_candidate_mixed_reverse_eligibility_probability_le hscale ell C₂] with L hL intro S G _ dS _ dG Ps _ P _ R cases Subsingleton.elim dS (Classical.decEq S) cases Subsingleton.elim dG (Classical.decEq G) intro J B M shared D_B k hk hkbound Vs hVs aux μ ρ V v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht F hF have h := hbound (S) (G) (Ps) ((fun g => ↥(P g))) ((fun g (p : P g) => p.val)) J M shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) μ ρ V (fun c => k * D_B c) Vs hVs aux v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht ((B : ℝ) / (((J + ell).choose ell) ^ (Fintype.card S) : ℕ)) (div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _)) (by intro s hs have hh := hL S G Ps P R J B M shared D_B k hk hkbound s hs refine le_trans (le_of_eq ?_) hh exact uniform_indicator_probability_fintype_eq _ _ _) F hF exact h end Bounty end section /- Original proof: CandidateMixedDirtyEnergy.lean. Generalized only to pool-preserving group realizations. -/ /- The full candidate mixed dirty estimate, with the genuine small-state measure, arbitrary bounded endpoint coefficient, and both small-slot averages. Actual promotion and storage bounds are discharged separately. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem eventually_realized_candidate_mixed_dirty_energy_le {q vs scale : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ᶠ L : ℝ in atTop, ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (_R : CandidateMixedPoolRealization scale L Ps P), ∀ J B : ℕ, ∀ M : G → ℕ, ∀ shared : ∀ g, Finset (Fin (M g)), ∀ D_B : SharedActiveLabels ((fun g => ↥(P g))) shared → ℕ, ∀ k : ℤ, k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ Vs : S → ℝ, (∀ g, vs ≤ Vs g) → ∀ μ : ∀ g, (fun g => ↥(P g)) g → ℝ, ∀ ρ : ℝ, ∀ V : G → ℝ, ∀ v vmin vmax : ℝ, 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ T : ℕ, (∀ g, (shared g)ᶜ.card ≤ T) → ∀ Φ : ∀ s : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent ((fun g (p : P g) => p.val)) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ))) s → ℂ, (∀ s e, ‖Φ s e‖ ≤ 1) → ∀ F : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B) → ℂ, (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigAverage (fun s => physicalSmallBigFullPhasedAction ((fun g (p : P g) => p.val)) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) μ ρ V (fun c => k * D_B c) Vs q (fun y e => if ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅) then Φ y e else 0) (physicalSmallBigAverage F) s)) ≤ 4 * ((B : ℝ) / (((J + ell).choose ell) ^ (Fintype.card S) : ℕ)) * (A ^ (2 * (Fintype.card S)) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ (Fintype.card G)) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨Ap, hAp, hp⟩ := eventually_realized_candidate_mixed_promotion_energy_le hq0 hq1 hvs hscale ell C₂ obtain ⟨As, hAs, hs⟩ := eventually_realized_candidate_mixed_storage_energy_le hq0 hq1 hvs hscale ell C₂ refine ⟨max Ap As, hAp.trans (le_max_left _ _), ?_⟩ filter_upwards [hp, hs] with L hpL hsL intro S G _ _ _ _ Ps _ P _ R J B M shared D_B k hk hkbound Vs hVs μ ρ V v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht Φ hΦ F hF let W : ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B → ℝ := productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)) let env := complexNormEnvelope (physicalSmallBigAverage F) let δ : ℝ := (B : ℝ) / (((J + ell).choose ell) ^ (Fintype.card S) : ℕ) let C : ℝ := unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ (Fintype.card G) let K : ℝ := (max Ap As) ^ (2 * (Fintype.card S)) * C let aux : PhysicalAuxLabels (Ps) (fun _ => (∅ : Finset (Fin J))) := fun _ j => False.elim ((Finset.notMem_empty j.val) j.property) have hVs' : ∀ s, 0 < Vs s := fun s => hvs.trans_le (hVs s) have hW : ∀ x, 0 ≤ W x := productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1) have hδ : 0 ≤ δ := div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _) have hC : 0 ≤ C := pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _ have hmax : 0 ≤ max Ap As := (zero_le_one.trans hAp).trans (le_max_left _ _) have henv : ∀ s, ProductMemorySymmetric (fun x => env (s, x)) := by intro s x g τ exact congrArg (fun z : ℂ => (‖z‖ : ℂ)) (physical_small_big_average_memory_symmetric F hF s x g τ) have henvfix : physicalSmallBigAverage env = env := physical_small_big_average_envelope_fixed F have henvE : physicalSmallBigEnergy Vs W env ≤ physicalSmallBigEnergy Vs W F := physical_small_big_average_envelope_energy_le Vs hVs' W hW F have henv0 : 0 ≤ physicalSmallBigEnergy Vs W env := by rw [← physical_small_big_energy_eq] exact sum_nonneg fun s _ => mul_nonneg (physical_small_big_measure_nonneg Vs hVs' W hW s) (sq_nonneg _) have upgrade (a : ℝ) (ha : 0 ≤ a) (haA : a ≤ max Ap As) (out : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B) → ℂ) (hout : physicalSmallBigEnergy Vs W out ≤ δ * (a ^ (2 * (Fintype.card S)) * C) * physicalSmallBigEnergy Vs W env) : physicalSmallBigEnergy Vs W out ≤ δ * K * physicalSmallBigEnergy Vs W F := by apply hout.trans refine mul_le_mul ?_ henvE henv0 ?_ · exact mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right (pow_le_pow_left₀ ha haA _) hC) hδ · exact mul_nonneg hδ (mul_nonneg (pow_nonneg hmax _) hC) have hprom := hpL S G Ps P R J B M shared D_B k hk hkbound Vs hVs μ ρ V v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht (fun _ _ => 1) 1 zero_le_one (by intros; simp only [norm_one, le_refl]) env henv simp only [one_pow, one_mul] at hprom have hstore := hsL S G Ps P R J B M shared D_B k hk hkbound Vs hVs aux μ ρ V v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht env henv rw [henvfix] at hstore exact physical_small_big_dirty_energy_of_components Vs W hVs' hW F _ _ _ δ K (physical_small_big_averaged_dirty_domination ((fun g (p : P g) => p.val)) shared B (fun d c _ => -(k * (D_B c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B c * physicalSharedProduct d : ℕ)) μ ρ V (fun c => k * D_B c) Vs q aux hVs' hμ hρ0.le (fun g => (hvmin.trans_le (hVlo g)).le) Φ hΦ (physicalSmallBigAverage F)) (upgrade Ap (zero_le_one.trans hAp) (le_max_left _ _) _ hprom) (upgrade As (zero_le_one.trans hAs) (le_max_right _ _) _ hstore) end Bounty end section /- Original proof: CandidateMixedAuxiliaryDirtyEnergy.lean. Generalized only to pool-preserving group realizations. -/ /- Independent auxiliary subprobability averaging of the actual candidate mixed dirty operator. Both small-slot projections and all event masks remain literal, with no per-auxiliary norm hypothesis in the conclusion. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem eventually_realized_candidate_mixed_auxiliary_dirty_energy_le {q vs scale : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ᶠ L : ℝ in atTop, ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (_R : CandidateMixedPoolRealization scale L Ps P), ∀ J B : ℕ, ∀ M : G → ℕ, ∀ shared : ∀ g, Finset (Fin (M g)), ∀ (Q : Type) [Fintype Q], ∀ π : Q → ℝ, (∀ a, 0 ≤ π a) → (∑ a, π a ≤ 1) → ∀ D_B : Q → SharedActiveLabels ((fun g => ↥(P g))) shared → ℕ, ∀ k : ℤ, k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ Vs : S → ℝ, (∀ g, vs ≤ Vs g) → ∀ μ : ∀ g, (fun g => ↥(P g)) g → ℝ, ∀ ρ : ℝ, ∀ V : G → ℝ, ∀ v vmin vmax : ℝ, 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ T : ℕ, (∀ g, (shared g)ᶜ.card ≤ T) → ∀ Φ : ∀ a : Q, ∀ s : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent ((fun g (p : P g) => p.val)) shared B (fun d c _ => -(k * (D_B a c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B a c * physicalSharedProduct d : ℕ))) s → ℂ, (∀ a s e, ‖Φ a s e‖ ≤ 1) → ∀ F : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) M B) → ℂ, (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigAverage (fun s => ∑ a, (π a : ℂ) * physicalSmallBigFullPhasedAction ((fun g (p : P g) => p.val)) shared B (fun d c _ => -(k * (D_B a c * physicalSharedProduct d : ℕ))) (fun d c _ => (D_B a c * physicalSharedProduct d : ℕ)) μ ρ V (fun c => k * D_B a c) Vs q (fun y e => if ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅) then Φ a y e else 0) (physicalSmallBigAverage F) s)) ≤ 4 * ((B : ℝ) / (((J + ell).choose ell) ^ (Fintype.card S) : ℕ)) * (A ^ (2 * (Fintype.card S)) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ (Fintype.card G)) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨A, hA, hbound⟩ := eventually_realized_candidate_mixed_dirty_energy_le hq0 hq1 hvs hscale ell C₂ refine ⟨A, hA, ?_⟩ filter_upwards [hbound] with L hL intro S G _ _ _ _ Ps _ P _ R J B M shared Q _ π hπ hπmass D_B k hk hkbound Vs hVs μ ρ V v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht Φ hΦ F hF rw [physical_small_big_average_weighted_sum] apply physical_small_big_auxiliary_energy_bound Vs (fun s => hvs.trans_le (hVs s)) (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1)) π hπ hπmass _ F _ · exact mul_nonneg (mul_nonneg (by norm_num) (div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _))) (mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) (pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _)) · intro a exact hL S G Ps P R J B M shared (D_B a) k hk hkbound Vs hVs μ ρ V v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht (Φ a) (hΦ a) F hF end Bounty end section /- Original proof: CandidatePhysicalMixedDirtyEnergy.lean. Generalized only to pool-preserving group realizations. -/ /- The candidate mixed dirty estimate with the original physical auxiliary law, concrete mixed displacement and divisor, and tilted physical birth law. Both small-slot projections, endpoint phases, and memory cutoffs are retained. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem eventually_realized_candidate_physical_mixed_dirty_energy_le {q vs scale : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ᶠ L : ℝ in atTop, ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (_R : CandidateMixedPoolRealization scale L Ps P), ∀ J B : ℕ, ∀ C : G → Finset (Fin J), ∀ k : ℤ, k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ Vs : S → ℝ, (∀ g, vs ≤ Vs g) → ∀ V : G → ℝ, ∀ baseline : ∀ g, (fun g => ↥(P g)) g → ℝ, ∀ ρ v vmin vmax : ℝ, 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g : G, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → ∀ T : ℕ, (∀ g, ell + (C g).card ≤ T) → ∀ Φ : ∀ a : PhysicalAuxLabels (P) C, ∀ s : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) (fun _ => J + ell) B), PhysicalSmallBigEvent (PhysicalSmallBigFullEvent ((fun g (p : P g) => p.val)) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c g => physicalMixedEdgeDelta C k d c a g) (fun d c g => physicalMixedEdgeD C d c a g)) s → ℂ, (∀ a s e, ‖Φ a s e‖ ≤ 1) → ∀ F : PhysicalSmallBigState (Ps) J ell (ProductBoundedOrderedState ((fun g => ↥(P g))) (fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) (fun _ => J + ell) B) → ℂ, (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight (P := (fun g => ↥(P g))) (Z := fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) (t := fun _ => J + ell) (B := B) (fun g => tiltedPhysicalBirthLaw (P := P) V g (baseline g)) (fun g => unrestrictedResidueWeight (tiltedPhysicalBirthLaw (P := P) V g (baseline g)))) (physicalSmallBigAverage (fun s => ∑ a, (physicalAuxMass V C a : ℂ) * physicalSmallBigFullPhasedAction ((fun g (p : P g) => p.val)) (fun g => physicalFullSharedIndices (ell := ell) (C g)) B (fun d c g => physicalMixedEdgeDelta C k d c a g) (fun d c g => physicalMixedEdgeD C d c a g) (fun g => tiltedPhysicalBirthLaw (P := P) V g (baseline g)) ρ V (fun c => physicalMixedBigStep C k c a) Vs q (fun y e => if ¬ (∀ g, (e.2.2 g).1 = ∅ ∧ (e.2.2 g).2.1 = ∅) then Φ a y e else 0) (physicalSmallBigAverage F) s)) ≤ 4 * ((B : ℝ) / (((J + ell).choose ell) ^ (Fintype.card S) : ℕ)) * (A ^ (2 * (Fintype.card S)) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ (Fintype.card G)) * physicalSmallBigEnergy Vs (productMemoryWeight (P := (fun g => ↥(P g))) (Z := fun g => UnrestrictedResidueParticle ((fun g (p : P g) => p.val) g)) (t := fun _ => J + ell) (B := B) (fun g => tiltedPhysicalBirthLaw (P := P) V g (baseline g)) (fun g => unrestrictedResidueWeight (tiltedPhysicalBirthLaw (P := P) V g (baseline g)))) F := by obtain ⟨A, hA, hbound⟩ := eventually_realized_candidate_mixed_auxiliary_dirty_energy_le hq0 hq1 hvs hscale ell C₂ refine ⟨A, hA, ?_⟩ filter_upwards [hbound] with L hL intro S G _ _ _ _ Ps _ P _ R J B C k hk hkbound Vs hVs V baseline ρ v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hMass hbaseline T ht have hV : ∀ g, 0 < V g := fun g => hvmin.trans_le (hVlo g) have hμ : ∀ g p, 0 ≤ tiltedPhysicalBirthLaw (P := P) V g (baseline g) p := by intro g p exact tiltedPhysicalBirthLaw_nonneg (P := P) V g (baseline g) (hV g).le (fun p => (by norm_num : (0 : ℝ) ≤ 1 / 2).trans (hbaseline g p).1) p have hmass : ∀ g, ∑ p, tiltedPhysicalBirthLaw (P := P) V g (baseline g) p ≤ 2 := fun g => (tiltedPhysicalBirthLaw_sum_bounds (P := P) V g (baseline g) (hV g) (hMass g) (hbaseline g)).2 have hdelta : physicalMixedEdgeDelta (Ps := Ps) (P := P) (ell := ell) C k = fun d c a _ => -(k * (physicalFullSharedD C c a * physicalSharedProduct d : ℕ)) := by funext d c a g exact physical_mixed_edge_delta_big_first C k d c a g have hdivisor : physicalMixedEdgeD (Ps := Ps) (P := P) (ell := ell) C = fun d c a _ => ((physicalFullSharedD C c a * physicalSharedProduct d : ℕ) : ℤ) := by funext d c a g exact physical_mixed_edge_D_big_first C d c a g rw [hdelta, hdivisor] simp only [physicalMixedBigStep] exact hL S G Ps P R J B (fun _ => J + ell) (fun g => physicalFullSharedIndices (ell := ell) (C g)) (PhysicalAuxLabels (P) C) (physicalAuxMass V C) (physical_aux_mass_nonneg V C (fun g => (hV g).le)) (physical_aux_mass_sum V C hV hMass).le (fun a c => physicalFullSharedD C c a) k hk hkbound Vs hVs (fun g => tiltedPhysicalBirthLaw (P := P) V g (baseline g)) ρ V v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T (fun g => by simpa only [physical_full_unshared_indices_card] using ht g) end Bounty end section /- The actual candidate dirty row in the same two-sided joint projection as the signed prime family. No auxiliary or local norm premise remains. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem eventually_realized_candidate_physical_mixed_dirty_projected_norm_le {q vs scale : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ᶠ L : ℝ in atTop, ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (_R : CandidateMixedPoolRealization scale L Ps P), ∀ J B : ℕ, ∀ (C : G → Finset (Fin J)) (k : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ Vs : S → ℝ, (∀ g, vs ≤ Vs g) → ∀ (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g : G, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → ∀ T : ℕ, (∀ g, ell + (C g).card ≤ T) → ∀ (initial : ∀ g, Finset (P g)) (Ψ : ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent C k a s → ℂ), (∀ a s e, ‖Ψ a s e‖ ≤ 1) → ∀ f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ, (∀ s, ProductMemorySymmetric (fun x => f (s,x))) → let μ := fun g => tiltedPhysicalBirthLaw (P := P) V g (baseline g) let W := productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)) cleanActiveNorm (physicalSmallBigMeasure Vs W) (physicalSmallBigJointAverage (physicalMixedCoefficientAction C k V baseline ρ Vs q initial (physicalMixedDirtyPhase C k Ψ) (physicalSmallBigJointAverage f))) ≤ 2 * Real.sqrt ((B : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ)) * A ^ Fintype.card S * Real.sqrt (unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := by obtain ⟨A, hA, hbound⟩ := eventually_realized_candidate_physical_mixed_dirty_energy_le hq0 hq1 hvs hscale ell C₂ refine ⟨A, hA, ?_⟩ filter_upwards [hbound] with L hL intro S G _ dS _ dG Ps _ P _ R cases Subsingleton.elim dS (Classical.decEq S) cases Subsingleton.elim dG (Classical.decEq G) intro J B C k hk hkbound Vs hVs V baseline ρ v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hMass hbaseline T ht initial Ψ hΨ f hf μ W have hVs0 : ∀ g, 0 < Vs g := fun g => hvs.trans_le (hVs g) have hV : ∀ g, 0 < V g := fun g => hvmin.trans_le (hVlo g) have hμ : ∀ g p, 0 ≤ μ g p := fun g p => tiltedPhysicalBirthLaw_nonneg (P := P) V g (baseline g) (hV g).le (fun p => (by norm_num : (0 : ℝ) ≤ 1/2).trans (hbaseline g p).1) p let fb := physicalSmallBigBigAverage f have hfb : ∀ s, ProductMemorySymmetric (fun x => fb (s,x)) := fun s => fullActiveAverage_symmetric (fun x => f (s,x)) (hf s) let Φ := fun a s (e : PhysicalMixedCoefficientEvent C k a s) => if ∀ g i, (e.2.2 g).2.2.2 i ∉ initial g then Ψ a s e else 0 have hΦ : ∀ a s e, ‖Φ a s e‖ ≤ 1 := by intro a s e dsimp only [Φ] split_ifs · exact hΨ a s e · simp only [norm_zero, zero_le_one] have hc := hL S G Ps P R J B C k hk hkbound Vs hVs V baseline ρ v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hMass hbaseline T ht Φ hΦ fb hfb let u := physicalMixedCoefficientAction C k V baseline ρ Vs q initial (physicalMixedDirtyPhase C k Ψ) (physicalSmallBigJointAverage f) have he : physicalSmallBigEnergy Vs W (physicalSmallBigAverage u) ≤ 4 * ((B : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ)) * (A ^ (2 * Fintype.card S) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) * physicalSmallBigEnergy Vs W fb := by dsimp only [u] rw [physical_mixed_dirty_coefficient_action_eq] exact hc have hin : physicalSmallBigEnergy Vs W fb ≤ physicalSmallBigEnergy Vs W f := by convert physical_small_big_big_average_energy_le Vs hVs0 μ (fun g => unrestrictedResidueWeight (μ g)) hμ (fun g z => hμ g z.1) f using 1 have hout : physicalSmallBigEnergy Vs W (physicalSmallBigJointAverage u) ≤ physicalSmallBigEnergy Vs W (physicalSmallBigAverage u) := by rw [physical_small_big_joint_average_eq_big_small] convert physical_small_big_big_average_energy_le Vs hVs0 μ (fun g => unrestrictedResidueWeight (μ g)) hμ (fun g z => hμ g z.1) (physicalSmallBigAverage u) using 1 let δ : ℝ := (B : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ) let K : ℝ := unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G have hδ : 0 ≤ δ := div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _) have hK : 0 ≤ K := pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmax T) _ have hcoef : 0 ≤ 4 * δ * (A ^ (2 * Fintype.card S) * K) := mul_nonneg (mul_nonneg (by norm_num) hδ) (mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) hK) have henergy := hout.trans (he.trans (mul_le_mul_of_nonneg_left hin hcoef)) have hp : (A ^ Fintype.card S) ^ 2 = A ^ (2 * Fintype.card S) := by rw [← pow_mul, Nat.mul_comm] have hcoefeq : (2 * Real.sqrt δ * A ^ Fintype.card S) ^ 2 * K = 4 * δ * (A ^ (2 * Fintype.card S) * K) := by rw [mul_pow, mul_pow, hp, Real.sq_sqrt hδ] ring apply physical_small_big_norm_le_of_energy Vs W (2 * Real.sqrt δ * A ^ Fintype.card S) K (mul_nonneg (mul_nonneg (by norm_num) (Real.sqrt_nonneg _)) (pow_nonneg (zero_le_one.trans hA) _)) hK f _ rw [hcoefeq] convert henergy using 1 end Bounty end section /- The actual signed prime-family dirty contribution, with both small and big endpoint projections, the original auxiliary law, and a fixed initial fresh-birth gate. The coefficient budget is proved from the prime family. -/ open Finset Filter open scoped Classical Topology namespace Bounty theorem eventually_realized_candidate_physical_mixed_prime_dirty_norm_le {q vs scale : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ᶠ L : ℝ in atTop, ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (_R : CandidateMixedPoolRealization scale L Ps P), ∀ J B m : ℕ, ∀ (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t), (∀ g, (probes g).card ≤ m) → ∀ (Q : ℕ) (h ξ : ℝ), 0 < ξ → ∀ k : ℤ, k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ Vs : S → ℝ, (∀ g, vs ≤ Vs g) → ∀ (V : G → ℝ) (baseline : ∀ g, P g → ℝ) (ρ v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g : G, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → ∀ (initial : ∀ g, Finset (P g)) (φ : ∀ i : RepeatedBigPrimePatternIndex (ell := ell) probes r t, ∀ a (s : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B)), PhysicalMixedCoefficientEvent (repeatedBigPrimePatternCut probes r t i) k a s → ℂ), (∀ i a s e, ‖φ i a s e‖ ≤ 1) → ∀ f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ, (∀ s, ProductMemorySymmetric (fun x => f (s,x))) → let μ := fun g => tiltedPhysicalBirthLaw (P := P) V g (baseline g) let W := productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)) cleanActiveNorm (physicalSmallBigMeasure Vs W) (physicalSmallBigJointAverage (physicalMixedPrimePatternAction V baseline ρ Vs q probes r t hrt Q h ξ k initial (fun i => physicalMixedDirtyPhase (repeatedBigPrimePatternCut probes r t i) k (φ i)) (physicalSmallBigJointAverage f))) ≤ repeatedBigFamilyEnvelope (Fintype.card G) m Q ξ * (2 * Real.sqrt ((B : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ)) * A ^ Fintype.card S * Real.sqrt (unrestrictedEdgeEnergyBound ρ v vmin vmax (ell + m) ^ Fintype.card G)) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := by obtain ⟨A, hA, hbound⟩ := eventually_realized_candidate_physical_mixed_dirty_projected_norm_le hq0 hq1 hvs hscale ell C₂ refine ⟨A, hA, ?_⟩ filter_upwards [hbound] with L hL intro S G _ dS _ dG Ps _ P _ R cases Subsingleton.elim dS (Classical.decEq S) cases Subsingleton.elim dG (Classical.decEq G) intro J B m probes r t hrt hp Q h ξ hξ k hk hkbound Vs hVs V baseline ρ v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hMass hbaseline initial φ hφ f hf μ W have hμ : ∀ g p, 0 ≤ μ g p := fun g p => tiltedPhysicalBirthLaw_nonneg (P := P) V g (baseline g) (hvmin.trans_le (hVlo g)).le (fun p => (by norm_num : (0 : ℝ) ≤ 1/2).trans (hbaseline g p).1) p have hW : ∀ x, 0 ≤ W x := productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1) have hw := physical_small_big_measure_nonneg (P := Ps) (J := J) (ell := ell) Vs (fun s => hvs.trans_le (hVs s)) W hW let cost := 2 * Real.sqrt ((B : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ)) * A ^ Fintype.card S * Real.sqrt (unrestrictedEdgeEnergyBound ρ v vmin vmax (ell + m) ^ Fintype.card G) have hcost : 0 ≤ cost := mul_nonneg (mul_nonneg (mul_nonneg (by norm_num) (Real.sqrt_nonneg _)) (pow_nonneg (zero_le_one.trans hA) _)) (Real.sqrt_nonneg _) have hfinal := physical_mixed_prime_dirty_norm_of_rows V baseline ρ Vs q probes r t hrt hp Q h ξ hξ k initial φ hφ (physicalSmallBigMeasure Vs W) hw cost hcost f (fun C hC Ψ hΨ => hL S G Ps P R J B C k hk hkbound Vs hVs V baseline ρ v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hMass hbaseline (ell+m) (fun g => Nat.add_le_add_left (hC g) ell) initial Ψ hΨ f hf) exact hfinal end Bounty end section /- The actual candidate prime family, with its original fresh-birth gate, auxiliary law, and both full endpoint averages. The clean and dirty bounds are evaluated in the same tilted mixed measure. The analytic input is the proved actual zero-free theorem; no local operator bound is assumed. -/ open Finset Filter open scoped Classical namespace Bounty.WeakZeroFree theorem actual_exists_realized_candidate_physical_mixed_full_norm_bound {qsmall vsmall scale : ℝ} (hq0 : 0 ≤ qsmall) (hq1 : qsmall < 1) (hvs : 0 < vsmall) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (c s z a v D ε E beta tau : ℝ) (m J : ℕ) (_hc : 0 < c) (_hs : 0 ≤ s) (_hz : 0 ≤ z) (_ha : 0 ≤ a) (_hv : 0 < v) (_hD : 0 ≤ D) (_hε : 0 < ε) (_htau : 0 ≤ tau) (_hell : 0 < ell) (_hml : ell ≤ m) (_hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (_hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D), let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (_R : CandidateMixedPoolRealization scale L Ps P), ∀ V : G → ℝ, Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card G : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset G, ∀ hrt : Disjoint r t, beta * Real.log L ≤ (r.card : ℝ) → beta * Real.log L ≤ (t.card : ℝ) → ∀ ζ θ : ℝ, |ζ| ≤ L ^ z → ∀ initial : ∀ g, Finset (P g), (∀ g, (initial g).card ≤ J + ell) → ∀ baseline : ∀ g, P g → ℝ, ∀ T Pmin : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ Pmin → (∀ g (p : P g), Pmin ≤ (p.val : ℝ)) → (∀ g (p : P g), baseline g p = 1 - T / (p.val : ℝ)) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → ∀ (B : ℕ) (k : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ Vs : S → ℝ, (∀ g, vsmall ≤ Vs g) → ∀ ρ u vmax : ℝ, 0 < ρ → ρ < 1 → 1 < u → (∀ g, V g ≤ vmax) → ∀ f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ, (∀ d, ProductMemorySymmetric (fun y => f (d,y))) → let μ := fun g => tiltedPhysicalBirthLaw V g (baseline g) let W := productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)) cleanActiveNorm (physicalSmallBigMeasure Vs W) (physicalSmallBigJointAverage (physicalMixedPrimePatternAction V baseline ρ Vs qsmall probes r t hrt Q h ξ k initial (fun i => physicalMixedFullResidualPhase (repeatedBigPrimePatternCut probes r t i) ζ θ k cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅))) (physicalSmallBigJointAverage f))) ≤ A ^ Fintype.card S * (L ^ (-E) + 2 * repeatedBigFamilyEnvelope (Fintype.card G) m Q ξ * Real.sqrt ((B : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ)) * Real.sqrt (unrestrictedEdgeEnergyBound ρ u v vmax (ell + m) ^ Fintype.card G)) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := by obtain ⟨Ac, hAc, hclean⟩ := _root_.Bounty.WeakZeroFree.exists_physical_mixed_clean_prime_joint_norm_bound qsmall vsmall ell hq0 hq1 hvs obtain ⟨Ad, hAd, hdirty⟩ := eventually_realized_candidate_physical_mixed_prime_dirty_norm_le hq0 hq1 hvs hscale ell C₂ refine ⟨max Ac Ad, hAc.trans (le_max_left _ _), ?_⟩ intro c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap κ s' A₀ q w x filter_upwards [hclean actual_zero_free c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap, hdirty, eventually_gt_atTop (0 : ℝ)] with L hcl hdi hL intro Q h ξ S G _ dS _ dG Ps _ P _ R cases Subsingleton.elim dS (Classical.decEq S) cases Subsingleton.elim dG (Classical.decEq G) intro V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ initial hinitial baseline T Pmin hT hTmax hPmin hpmin hb hbaseline B k hk hkbound Vs hVs ρ u vmax hρ0 hρ1 hu hVhi f hf μ W have hμ : ∀ g p, 0 ≤ μ g p := fun g p => tiltedPhysicalBirthLaw_nonneg V g (baseline g) (hv.trans_le (hV g)).le (fun p => (by norm_num : (0 : ℝ) ≤ 1/2).trans (hbaseline g p).1) p have hW : ∀ y, 0 ≤ W y := productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1) have hVs0 : ∀ g, 0 < Vs g := fun g => hvs.trans_le (hVs g) have hξ : 0 < ξ := Real.rpow_pos_of_pos hL _ have hc0 := hcl P V hdisj hP hmass hV hlog hcard hband probes hp r t hrt hr ht ζ θ hζ initial hinitial baseline T Pmin hT hTmax hPmin hpmin hb S Ps B k μ ρ hμ hρ0.le hρ1.le Vs hVs (fun _ => ∅) f hf have hd0 := hdi S G Ps P R J B m probes r t hrt (fun g => (hp g).le) Q h ξ hξ k hk hkbound Vs hVs V baseline ρ u v vmax hρ0 hρ1 hu hv hV hVhi hmass hbaseline initial (fun i => physicalMixedFullResidualPhase (repeatedBigPrimePatternCut probes r t i) ζ θ k cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅))) (fun i a y e => physical_mixed_concrete_residual_norm_le _ ζ θ k (fun _ => ∅) a y e) f hf let C := repeatedBigPrimePatternCut (ell := ell) probes r t let kept := fun U : Finset (RepeatedBigFlatIndex G J ell) => primeProductRetainedCells (fun j : U => P j.val.1) (fun j => V j.val.1) h ξ let K := repeatedBigPrimePatternKernel P V probes r t hrt Q h kept let clean := physicalSmallBigJointAverage (physicalMixedGatedCleanPatternAction initial V baseline C ζ θ ρ k (fun i a b c => repeatedBigPrimePatternWeight probes r t i * K i a b c) Vs qsmall cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) (physicalSmallBigJointAverage f)) let dirty := physicalSmallBigJointAverage (physicalMixedPrimePatternAction V baseline ρ Vs qsmall probes r t hrt Q h ξ k initial (fun i => physicalMixedDirtyPhase (C i) k (physicalMixedFullResidualPhase (C i) ζ θ k cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)))) (physicalSmallBigJointAverage f)) let δ := (B : ℝ) / (((J + ell).choose ell) ^ Fintype.card S : ℕ) let Ce := unrestrictedEdgeEnergyBound ρ u v vmax (ell + m) ^ Fintype.card G let H := repeatedBigFamilyEnvelope (Fintype.card G) m Q ξ have hc' : cleanActiveNorm (physicalSmallBigMeasure Vs W) clean ≤ Ac ^ Fintype.card S * L ^ (-E) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := by convert hc0 using 1 all_goals rfl have hd' : cleanActiveNorm (physicalSmallBigMeasure Vs W) dirty ≤ H * (2 * Real.sqrt δ * Ad ^ Fintype.card S * Real.sqrt Ce) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := hd0 have heq := physical_mixed_prime_projected_clean_dirty V baseline ρ Vs qsmall probes r t hrt Q h ξ ζ θ k initial cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅)) f have hsum := physical_small_big_clean_rare_norm_le Vs W hVs0 hW f _ clean dirty heq _ _ hc' hd' have hcPow : Ac ^ Fintype.card S ≤ (max Ac Ad) ^ Fintype.card S := pow_le_pow_left₀ (zero_le_one.trans hAc) (le_max_left _ _) _ have hdPow : Ad ^ Fintype.card S ≤ (max Ac Ad) ^ Fintype.card S := pow_le_pow_left₀ (zero_le_one.trans hAd) (le_max_right _ _) _ have hH : 0 ≤ H := repeated_big_family_envelope_nonneg _ _ _ _ have hnorm : 0 ≤ cleanActiveNorm (physicalSmallBigMeasure Vs W) f := Real.sqrt_nonneg _ refine hsum.trans (mul_le_mul_of_nonneg_right ?_ hnorm) calc Ac ^ Fintype.card S * L ^ (-E) + H * (2 * Real.sqrt δ * Ad ^ Fintype.card S * Real.sqrt Ce) ≤ (max Ac Ad) ^ Fintype.card S * L ^ (-E) + H * (2 * Real.sqrt δ * (max Ac Ad) ^ Fintype.card S * Real.sqrt Ce) := add_le_add (mul_le_mul_of_nonneg_right hcPow (Real.rpow_nonneg hL.le _)) (mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hdPow (mul_nonneg (by norm_num) (Real.sqrt_nonneg _))) (Real.sqrt_nonneg _)) hH) _ = _ := by ring end Bounty.WeakZeroFree end section /- Original proof: ActualSignedPrimeFullNorm.lean. Same signed parity argument for realized candidate pools. -/ /- The actual candidate full norm bound for both chronological parities. The ordinary analytic bound already includes the dirty contribution. -/ open Finset Filter open scoped Topology BigOperators Classical namespace Bounty.WeakZeroFree theorem actual_exists_realized_candidate_physical_mixed_signed_full_norm_bound {qsmall vsmall scale : ℝ} (hq0 : 0 ≤ qsmall) (hq1 : qsmall < 1) (hvs : 0 < vsmall) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (c s z a v D ε E beta tau : ℝ) (m J : ℕ) (_hc : 0 < c) (_hs : 0 ≤ s) (_hz : 0 ≤ z) (_ha : 0 ≤ a) (_hv : 0 < v) (_hD : 0 ≤ D) (_hε : 0 < ε) (_htau : 0 ≤ tau) (_hell : 0 < ell) (_hml : ell ≤ m) (_hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (_hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D), let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ (S G : Type) [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Finset ℕ) [∀ g (p : P g), NeZero p.val] (_R : CandidateMixedPoolRealization scale L Ps P), ∀ V : G → ℝ, Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ g p, p ∈ P g → p.Prime ∧ Q < p) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g, v ≤ V g) → (∀ g p, p ∈ P g → Real.log p ≤ L ^ s) → (Fintype.card (G) : ℝ) ≤ a * Real.log L → (∀ g, ∃ a b : ℝ, P g = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) → ∀ r t : Finset (G), ∀ hrt : Disjoint r t, beta * Real.log L ≤ (r.card : ℝ) → beta * Real.log L ≤ (t.card : ℝ) → ∀ ζ θ : ℝ, |ζ| ≤ L ^ z → ∀ initial : ∀ g, Finset (P g), (∀ g, (initial g).card ≤ J + ell) → ∀ baseline : ∀ g, P g → ℝ, ∀ T Pmin : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ Pmin → (∀ g (p : P g), Pmin ≤ (p.val : ℝ)) → (∀ g (p : P g), baseline g p = 1 - T / (p.val : ℝ)) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → ∀ (B time : ℕ) (k : ℤ), k ≠ 0 → (k.natAbs : ℝ) ≤ L ^ C₂ → ∀ Vs : S → ℝ, (∀ g, vsmall ≤ Vs g) → ∀ ρ u vmax : ℝ, 0 < ρ → ρ < 1 → 1 < u → (∀ g, V g ≤ vmax) → ∀ f : PhysicalSmallBigState (Ps) J ell (CleanFullMemoryState P J ell B) → ℂ, (∀ d, ProductMemorySymmetric (fun y => f (d,y))) → let μ := fun g => tiltedPhysicalBirthLaw V g (baseline g) let W := productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)) cleanActiveNorm (physicalSmallBigMeasure Vs W) (physicalSmallBigJointAverage (physicalMixedSignedPrimePatternAction V baseline ρ Vs qsmall probes r t hrt Q h ξ time k initial (fun i => physicalMixedFullResidualPhase (repeatedBigPrimePatternCut probes r t i) ζ θ k cleanMixedSourceGate (cleanMixedTargetGate (fun _ => ∅))) (physicalSmallBigJointAverage f))) ≤ A ^ (Fintype.card S) * (L ^ (-E) + 2 * repeatedBigFamilyEnvelope (Fintype.card G) m Q ξ * Real.sqrt ((B : ℝ) / (((J + ell).choose ell) ^ (Fintype.card S) : ℕ)) * Real.sqrt (unrestrictedEdgeEnergyBound ρ u v vmax (ell + m) ^ (Fintype.card G))) * cleanActiveNorm (physicalSmallBigMeasure Vs W) f := by obtain ⟨A, hA, hbound⟩ := actual_exists_realized_candidate_physical_mixed_full_norm_bound hq0 hq1 hvs hscale ell C₂ refine ⟨A, hA, ?_⟩ intro c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap κ s' A₀ q w x filter_upwards [hbound c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap] with L hL intro Q h ξ S G _ dS _ dG Ps _ P _ R cases Subsingleton.elim dS (Classical.decEq S) cases Subsingleton.elim dG (Classical.decEq G) intro V hdis hprime hmass hV hlog hcard hband probes hprobes have hbase := hL S G Ps P R V hdis hprime hmass hV hlog hcard hband probes hprobes intro r t hrt hr ht ζ θ hζ initial hinitial baseline T Pmin hT hTmax hPmin hPlow hbaseline hbaselineBounds B time k hk hkmax Vs hVs ρ u vmax hρ0 hρ1 hu hVhi f hf μ W by_cases htime : time % 2 = 0 · have hb := hbase t r hrt.symm ht hr (-ζ) (-θ) (by simpa only [abs_neg] using hζ) initial hinitial baseline T Pmin hT hTmax hPmin hPlow hbaseline hbaselineBounds B k hk hkmax Vs hVs ρ u vmax hρ0 hρ1 hu hVhi (fun y => (starRingEnd ℂ) (f y)) (fun d => product_memory_symmetric_conj (fun y => f (d,y)) (hf d)) rw [physical_mixed_signed_prime_even_eq_conj_swapped (htime := htime), ← physical_small_big_joint_average_conj f, physical_small_big_joint_average_conj, clean_active_norm_conj] simpa only [clean_active_norm_conj] using hb · rw [physical_mixed_signed_prime_pattern_action_of_odd (htime := htime)] exact hbase r t hrt hr ht ζ θ hζ initial hinitial baseline T Pmin hT hTmax hPmin hPlow hbaseline hbaselineBounds B k hk hkmax Vs hVs ρ u vmax hρ0 hρ1 hu hVhi f hf end Bounty.WeakZeroFree end section /- The literal root enumeration of the candidate pools supplies the finite pool realization needed by the mixed norm estimates. -/ open Finset open scoped Classical namespace Bounty noncomputable def candidateRootBigGroups {N : ℕ} (scale L : ℝ) (E : Fin N ≃ ↥(candidatePIndices scale L)) : Finset (Fin N) := univ.filter (fun i => (E i).val ∈ candidateBigPIndices scale L) noncomputable def candidateRootPools {N : ℕ} (scale L : ℝ) (E : Fin N ≃ ↥(candidatePIndices scale L)) : Fin N → Finset ℕ := fun i => candidatePBand (scale * L) (E i).val theorem candidate_root_big_groups_mem {N : ℕ} (scale L : ℝ) (E : Fin N ≃ ↥(candidatePIndices scale L)) (i : Fin N) : i ∈ candidateRootBigGroups scale L E ↔ (E i).val ∈ candidateBigPIndices scale L := by simp only [candidateRootBigGroups, mem_filter, mem_univ, true_and] noncomputable def candidateRootMixedPoolRealization {N M : ℕ} (scale L : ℝ) (E : Fin N ≃ ↥(candidatePIndices scale L)) (e : {g // g ∉ (candidateRootBigGroups scale L E)ᶜ} ≃ Fin M) : CandidateMixedPoolRealization scale L (fun a : ↥(candidateRootBigGroups scale L E)ᶜ => candidateRootPools scale L E a.val) (fun g : Fin M => candidateRootPools scale L E (e.symm g).val) where smallIndex := { toFun := fun a => ⟨(E a.val).val, by have hnot : (E a.val).val ∉ candidateBigPIndices scale L := by intro h exact (mem_compl.mp a.property) ((candidate_root_big_groups_mem scale L E a.val).mpr h) have hmem := (E a.val).property change (E a.val).val ∈ candidateSmallPIndices scale L ∪ candidateBigPIndices scale L at hmem exact (mem_union.mp hmem).resolve_right hnot⟩ inj' := by intro a b hab apply Subtype.ext apply E.injective apply Subtype.ext exact congrArg (fun z : CandidateSmallGroup scale L => z.val) hab } bigIndex := fun g => ⟨(E (e.symm g).val).val, by apply (candidate_root_big_groups_mem scale L E (e.symm g).val).mp simpa only [mem_compl, not_not] using (e.symm g).property⟩ smallPool_eq := fun _ => rfl bigPool_eq := fun _ => rfl theorem candidate_root_big_groups_card {N : ℕ} (scale L : ℝ) (E : Fin N ≃ ↥(candidatePIndices scale L)) : (candidateRootBigGroups scale L E).card = (candidateBigPIndices scale L).card := by apply card_bij (fun i _ => (E i).val) · intro i hi exact (candidate_root_big_groups_mem scale L E i).mp hi · intro i _ j _ hij exact E.injective (Subtype.ext hij) · intro j hj refine ⟨E.symm ⟨j, mem_union_right _ hj⟩, ?_, ?_⟩ · apply (candidate_root_big_groups_mem scale L E _).mpr simpa only [Equiv.apply_symm_apply] using hj · simp only [Equiv.apply_symm_apply] theorem candidate_root_small_groups_card {N : ℕ} (scale L : ℝ) (E : Fin N ≃ ↥(candidatePIndices scale L)) (hdis : Disjoint (candidateSmallPIndices scale L) (candidateBigPIndices scale L)) : (candidateRootBigGroups scale L E)ᶜ.card = (candidateSmallPIndices scale L).card := by apply card_bij (fun i _ => (E i).val) · intro i hi have hmem := (E i).property change (E i).val ∈ candidateSmallPIndices scale L ∪ candidateBigPIndices scale L at hmem apply (mem_union.mp hmem).resolve_right intro hb exact (mem_compl.mp hi) ((candidate_root_big_groups_mem scale L E i).mpr hb) · intro i _ j _ hij exact E.injective (Subtype.ext hij) · intro j hj refine ⟨E.symm ⟨j, mem_union_left _ hj⟩, ?_, ?_⟩ · apply mem_compl.mpr intro hb have hb' := (candidate_root_big_groups_mem scale L E _).mp hb simp only [Equiv.apply_symm_apply] at hb' exact disjoint_left.mp hdis hj hb' · simp only [Equiv.apply_symm_apply] end Bounty end section /- The actual signed full norm bound applied to an untouched original root Fourier edge, in its genuine reciprocal-birth measure. -/ open Finset Filter open scoped Topology BigOperators Classical namespace Bounty.WeakZeroFree theorem actual_exists_realized_root_projected_good_norm_bound {qsmall vsmall scale : ℝ} (hq0 : 0 ≤ qsmall) (hq1 : qsmall < 1) (hvs : 0 < vsmall) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (c s z a v D ε E beta tau : ℝ) (m J : ℕ) (_hc : 0 < c) (_hs : 0 ≤ s) (_hz : 0 ≤ z) (_ha : 0 ≤ a) (_hv : 0 < v) (_hD : 0 ≤ D) (_hε : 0 < ε) (_htau : 0 ≤ tau) (_hell : 0 < ell) (_hml : ell ≤ m) (_hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (_hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D), let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {N M n B : ℕ} (P : Fin N → Finset ℕ) [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ z : PhysicalPrime (fun a : ↥groupsᶜ => P a.val), NeZero z.2.val] [∀ g (p : P (reindex.symm g).val), NeZero p.val] (hPs : ∀ (a : ↥groupsᶜ) p, p ∈ P a.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hcross : ∀ (a : ↥groupsᶜ) (g : Fin M), Disjoint (P a.val) (P (reindex.symm g).val)) (_R : CandidateMixedPoolRealization scale L (fun a : ↥groupsᶜ => P a.val) (fun g : Fin M => P (reindex.symm g).val)) (V : Fin N → ℝ), Pairwise (fun g h : Fin M => Disjoint (P (reindex.symm g).val) (P (reindex.symm h).val)) → (∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → p.Prime ∧ Q < p) → (∀ g : Fin M, ∑ p ∈ P (reindex.symm g).val, 1 / (p : ℝ) = V (reindex.symm g).val) → (∀ g : Fin M, v ≤ V (reindex.symm g).val) → (∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Real.log p ≤ L ^ s) → (M : ℝ) ≤ a * Real.log L → (∀ g : Fin M, ∃ a b : ℝ, P (reindex.symm g).val = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : Fin N → Finset (Fin J), (∀ g : Fin M, (probes (reindex.symm g).val).card = m) → ∀ r t : Finset (Fin M), ∀ hrt : Disjoint r t, beta * Real.log L ≤ (r.card : ℝ) → beta * Real.log L ≤ (t.card : ℝ) → ∀ (ζ : ℕ → ℝ) (k : ℕ → ℤ) (θ : ℝ) (j : Fin (n + 1)), |ζ (n-j.val)| ≤ L ^ z → k (n-j.val) ≠ 0 → ((k (n-j.val)).natAbs : ℝ) ≤ L ^ C₂ → ∀ baseline : (g : Fin M) → P (reindex.symm g).val → ℝ, ∀ T Pmin : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ Pmin → (∀ (g : Fin M) (p : P (reindex.symm g).val), Pmin ≤ (p.val : ℝ)) → (∀ (g : Fin M) (p : P (reindex.symm g).val), baseline g p = 1 - T / (p.val : ℝ)) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → (∀ a : ↥groupsᶜ, vsmall ≤ V a.val) → ∀ ρ u vmax : ℝ, 0 < ρ → ρ < 1 → 1 < u → (∀ g : Fin M, V (reindex.symm g).val ≤ vmax) → ∀ (retention : Fin (n + 2) → ℝ) (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (reindex.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ), j ∉ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code → ∀ F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ, (∀ d, ProductMemorySymmetric (fun x => F (d,x))) → let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f))) let C := repeatedBigPrimePatternCut (ell := ell) probes (r.map f) (t.map f) let ζroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => ζ time let kroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => k time let β := fun (g : Fin M) (p : P (reindex.symm g).val) => ((p.val : ℝ)*baseline g p)⁻¹ let hC : ∀ i : patterns, ∀ a : ↥groupsᶜ, C i.val a.val = ∅ := fun i a => physical_root_prime_full_pattern_small_cut groups reindex probes r t i.val a let K := fun (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i L R aux let row := physicalRootFourierRow groups reindex patterns C hC kroot V qsmall ζroot K θ β retention ρ hPs hPb hcross code encode ν let Wroot := physicalSmallBigMeasure (fun a : ↥groupsᶜ => V a.val) (productMemoryWeight (fun g p => β g p / V (reindex.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (reindex.symm g).val))) cleanActiveNorm Wroot (row none (row (some (.inr j)) (row none F))) ≤ A ^ groupsᶜ.card * (L ^ (-E) + 2 * repeatedBigFamilyEnvelope M m Q ξ * Real.sqrt ((B : ℝ) / (((J + ell).choose ell) ^ groupsᶜ.card : ℕ)) * Real.sqrt (unrestrictedEdgeEnergyBound ρ u v vmax (ell + m) ^ M)) * cleanActiveNorm Wroot F := by obtain ⟨A, hA, hbound⟩ := actual_exists_realized_candidate_physical_mixed_signed_full_norm_bound hq0 hq1 hvs hscale ell C₂ refine ⟨A, hA, ?_⟩ intro c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap κ s' A₀ q w x filter_upwards [hbound c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap] with L hL intro Q h ξ N M n B P _ groups reindex _ _ hPs hPb hcross R V hbdis hprime hmass hV hlog hcard hband probes hprobes r t hrt hr ht ζ k θ j hζ hk hkmax baseline T Pmin hT hTmax hPmin hPlow hbaseline hbaselineBounds hVs ρ u vmax hρ0 hρ1 hu hVhi retention code encode ν hj F hF f patterns C ζroot kroot β hC K row Wroot have hb := hL ↥groupsᶜ (Fin M) (fun a : ↥groupsᶜ => P a.val) (fun g => P (reindex.symm g).val) R (fun g => V (reindex.symm g).val) hbdis hprime hmass hV hlog (by simpa only [Fintype.card_fin] using hcard) hband (fun g => probes (reindex.symm g).val) hprobes r t hrt hr ht (ζ (n-j.val)) θ hζ (fun _ => ∅) (fun _ => by simp only [card_empty]; exact Nat.zero_le _) baseline T Pmin hT hTmax hPmin hPlow hbaseline hbaselineBounds B (n-j.val) (k (n-j.val)) hk hkmax (fun a : ↥groupsᶜ => V a.val) hVs ρ u vmax hρ0 hρ1 hu hVhi F hF have hrow := physical_root_untouched_prime_edge_eq_signed_action groups reindex V probes r t hrt Q h ξ ζ k θ baseline ρ hPs hPb hcross qsmall retention code encode ν j hj F change row none (row (some (.inr j)) (row none F)) = _ at hrow rw [hrow] dsimp only [Wroot] have hμpoint (g : Fin M) (p : P (reindex.symm g).val) : β g p / V (reindex.symm g).val = tiltedPhysicalBirthLaw (P := fun g : Fin M => P (reindex.symm g).val) (fun g => V (reindex.symm g).val) g (baseline g) p := physical_root_tilted_birth_law (fun g => V (reindex.symm g).val) baseline g p simp_rw [hμpoint] simpa only [Fintype.card_fin, Fintype.card_coe] using hb end Bounty.WeakZeroFree end section /- The actual projected root edges satisfy the piecewise cost condition used by the Fourier word estimate. Both constants precede all analytic windows and root data, and the excess is explicitly at least the positive decay. -/ open Finset Filter open scoped Topology BigOperators Classical namespace Bounty.WeakZeroFree theorem actual_exists_realized_root_projected_edge_costs {qsmall vsmall scale : ℝ} (hq0 : 0 ≤ qsmall) (hq1 : qsmall < 1) (hvs : 0 < vsmall) (hscale : 0 < scale) (ell : ℕ) (C₂ : ℝ) : ∃ A Cbad : ℝ, 1 ≤ A ∧ 1 ≤ Cbad ∧ ∀ (c s z a v D ε E beta tau : ℝ) (m J : ℕ) (_hc : 0 < c) (_hs : 0 ≤ s) (_hz : 0 ≤ z) (_ha : 0 ≤ a) (_hv : 0 < v) (_hD : 0 ≤ D) (_hε : 0 < ε) (_htau : 0 ≤ tau) (_hell : 0 < ell) (_hml : ell ≤ m) (_hgap : beta * Real.log ((ell : ℝ) ^ ell / (m : ℝ) ^ ell) / 2 ≤ -(E + 2)) (_hDgap : (m : ℝ) * a * Real.log 3 + E + 2 ≤ D), let κ := a * Real.log (primeFiberFactorBound v m) let s' := s + ε let A₀ := D + 2 * (s' + 1) let q := 2 * κ + (s' + 1) + 2 * A₀ + 3 let w := 4 * q + max z q + A₀ + 2 let x := (s' + w + 2) + 2 * A₀ + 2 ∀ᶠ L : ℝ in atTop, let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {N M n B : ℕ} (P : Fin N → Finset ℕ) [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ z : PhysicalPrime (fun a : ↥groupsᶜ => P a.val), NeZero z.2.val] [∀ g (p : P (reindex.symm g).val), NeZero p.val] (hPs : ∀ (a : ↥groupsᶜ) p, p ∈ P a.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hcross : ∀ (a : ↥groupsᶜ) (g : Fin M), Disjoint (P a.val) (P (reindex.symm g).val)) (_R : CandidateMixedPoolRealization scale L (fun a : ↥groupsᶜ => P a.val) (fun g : Fin M => P (reindex.symm g).val)) (V : Fin N → ℝ), Pairwise (fun g h : Fin M => Disjoint (P (reindex.symm g).val) (P (reindex.symm h).val)) → (∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → p.Prime ∧ Q < p) → (∀ g : Fin M, ∑ p ∈ P (reindex.symm g).val, 1 / (p : ℝ) = V (reindex.symm g).val) → (∀ g : Fin M, v ≤ V (reindex.symm g).val) → (∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Real.log p ≤ L ^ s) → (M : ℝ) ≤ a * Real.log L → (∀ g : Fin M, ∃ a b : ℝ, P (reindex.symm g).val = primeBand a b ∧ Real.exp (L ^ c) ≤ a ∧ 0 ≤ b) → ∀ probes : Fin N → Finset (Fin J), (∀ g : Fin M, (probes (reindex.symm g).val).card = m) → ∀ r t : Finset (Fin M), ∀ hrt : Disjoint r t, beta * Real.log L ≤ (r.card : ℝ) → beta * Real.log L ≤ (t.card : ℝ) → ∀ (ζ : ℕ → ℝ) (k : ℕ → ℤ) (θ : ℝ), (∀ j : Fin (n + 1), |ζ (n-j.val)| ≤ L ^ z) → (∀ j : Fin (n + 1), k (n-j.val) ≠ 0) → (∀ j : Fin (n + 1), ((k (n-j.val)).natAbs : ℝ) ≤ L ^ C₂) → ∀ baseline : (g : Fin M) → P (reindex.symm g).val → ℝ, ∀ T Pmin : ℝ, 0 ≤ T → T ≤ L ^ tau → Real.exp (L ^ c) ≤ Pmin → (∀ (g : Fin M) (p : P (reindex.symm g).val), Pmin ≤ (p.val : ℝ)) → (∀ (g : Fin M) (p : P (reindex.symm g).val), baseline g p = 1 - T / (p.val : ℝ)) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → (∀ a : ↥groupsᶜ, vsmall ≤ V a.val) → ∀ ρ u vmax : ℝ, 0 < ρ → ρ < 1 → 1 < u → (∀ g : Fin M, V (reindex.symm g).val ≤ vmax) → ∀ (retention : Fin (n + 2) → ℝ) (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (reindex.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ), let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f))) let C := repeatedBigPrimePatternCut (ell := ell) probes (r.map f) (t.map f) let ζroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => ζ time let kroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) => k time let β := fun (g : Fin M) (p : P (reindex.symm g).val) => ((p.val : ℝ)*baseline g p)⁻¹ let hC : ∀ i : patterns, ∀ a : ↥groupsᶜ, C i.val a.val = ∅ := fun i a => physical_root_prime_full_pattern_small_cut groups reindex probes r t i.val a let K := fun (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map f) (t.map f)) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i L R aux let row := physicalRootFourierRow groups reindex patterns C hC kroot V qsmall ζroot K θ β retention ρ hPs hPb hcross code encode ν let Wroot := physicalSmallBigMeasure (fun a : ↥groupsᶜ => V a.val) (productMemoryWeight (fun g p => β g p / V (reindex.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (reindex.symm g).val))) let decay := A ^ groupsᶜ.card * (L ^ (-E) + 2 * repeatedBigFamilyEnvelope M m Q ξ * Real.sqrt ((B : ℝ) / (((J + ell).choose ell) ^ groupsᶜ.card : ℕ)) * Real.sqrt (unrestrictedEdgeEnergyBound ρ u v vmax (ell + m) ^ M)) let excess := max decay (repeatedBigFamilyEnvelope M m Q ξ * Cbad ^ groupsᶜ.card * Real.sqrt (unrestrictedEdgeEnergyBound ρ u v vmax (ell + m) ^ M)) 0 < decay ∧ decay ≤ excess ∧ ∀ (j : Fin (n + 1)) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups reindex → ℂ), (∀ d, ProductMemorySymmetric (fun x => F (d,x))) → cleanActiveNorm Wroot (row none (row (some (.inr j)) (row none F))) ≤ (if j ∈ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code then excess else decay) * cleanActiveNorm Wroot F := by obtain ⟨A, hA, hgood⟩ := actual_exists_realized_root_projected_good_norm_bound hq0 hq1 hvs hscale ell C₂ obtain ⟨Cbad, hCbad, hbad⟩ := exists_physical_root_projected_prime_edge_norm_bound hq0 hq1 hvs ell refine ⟨A, Cbad, hA, hCbad, ?_⟩ intro c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap κ s' A₀ q w x filter_upwards [hgood c s z a v D ε E beta tau m J hc hs hz ha hv hD hε htau hell hml hgap hDgap, eventually_gt_atTop (0 : ℝ)] with L hL hLpos intro Q h ξ N M n B P _ groups reindex _ _ hPs hPb hcross R V hbdis hprime hmass hV hlog hcard hband probes hprobes r t hrt hr ht ζ k θ hζ hk hkmax baseline T Pmin hT hTmax hPmin hPlow hbaseline hbaselineBounds hVs ρ u vmax hρ0 hρ1 hu hVhi retention code encode ν f patterns C ζroot kroot β hC K row Wroot decay excess have hdecay : 0 < decay := by apply mul_pos (pow_pos (lt_of_lt_of_le zero_lt_one hA) _) apply add_pos_of_pos_of_nonneg (Real.rpow_pos_of_pos hLpos _) exact mul_nonneg (mul_nonneg (mul_nonneg (by norm_num) (repeated_big_family_envelope_nonneg M m Q ξ)) (Real.sqrt_nonneg _)) (Real.sqrt_nonneg _) refine ⟨hdecay, le_max_left _ _, ?_⟩ intro j F hF by_cases hj : j ∈ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code · rw [if_pos hj] have hb := hbad groups reindex V probes r t hrt Q h ξ ζ k θ baseline ρ hPs hPb hcross retention code encode ν m (fun g => (hprobes g).le) (Real.rpow_pos_of_pos hLpos _) hVs hmass hbaselineBounds u v vmax hρ0 hρ1 hu hv hV hVhi j F hF change cleanActiveNorm Wroot (row none (row (some (.inr j)) (row none F))) ≤ (repeatedBigFamilyEnvelope M m Q ξ * Cbad ^ groupsᶜ.card * Real.sqrt (unrestrictedEdgeEnergyBound ρ u v vmax (ell + m) ^ M)) * cleanActiveNorm Wroot F at hb exact hb.trans (mul_le_mul_of_nonneg_right (le_max_right _ _) (Real.sqrt_nonneg _)) · rw [if_neg hj] exact hL P groups reindex hPs hPb hcross R V hbdis hprime hmass hV hlog hcard hband probes hprobes r t hrt hr ht ζ k θ j (hζ j) (hk j) (hkmax j) baseline T Pmin hT hTmax hPmin hPlow hbaseline hbaselineBounds hVs ρ u vmax hρ0 hρ1 hu hVhi retention code encode ν hj F hF end Bounty.WeakZeroFree end end section -- Source module: ActualSelectedInputs /- Coherent actual zero-free inputs and the original selected-residue target. -/ end section -- Source module: ActualSelectedFoundation /- Fixed parameters, finite selections, and original cap estimates in one coherent input environment. -/ open scoped Topology BigOperators Classical -- Source module: MixedFullScalarBudget section /- Absorb the complete clean and dirty prefactor before iterating signed edges. -/ open Finset Filter namespace Bounty theorem exists_candidate_mixed_full_scalar_budget {scale : ℝ} (hs : 0 < scale) (ell : ℕ) (hell : 0 < ell) (J₀ : ℕ) (A C K G : ℝ) (hA : 0 ≤ A) (hK : 0 ≤ K) : ∃ J : ℕ, J₀ ≤ J ∧ ∀ᶠ L : ℝ in atTop, ∀ F : ℝ, F ≤ L^C → A^(candidateSmallPIndices scale L).card * (L^(-(G+candidateMixedRareCostExponent A 1+1)) + 2*F*Real.sqrt ((⌈L^2⌉₊ : ℝ)/ (((J+ell).choose ell)^(candidateSmallPIndices scale L).card : ℕ))* Real.sqrt (K^(candidateBigPIndices scale L).card)) ≤ L^(-G) := by obtain ⟨J,hJ,_,hrare⟩ := exists_candidate_mixed_rare_parameter hs ell hell J₀ A K C G hA hK refine ⟨J,hJ,?_⟩ filter_upwards [hrare,eventually_candidate_mixed_conditioning_cost_le hs, eventually_gt_atTop (0 : ℝ)] with L hr hc hL intro F hF have hAcost : A^(candidateSmallPIndices scale L).card ≤ L^candidateMixedRareCostExponent A 1 := by simpa only [one_pow, Real.sqrt_one, mul_one] using hc A 1 hA (by norm_num) have hclean : A^(candidateSmallPIndices scale L).card * L^(-(G+candidateMixedRareCostExponent A 1+1)) ≤ L^(-(G+1)) := by calc _ ≤ L^candidateMixedRareCostExponent A 1 * L^(-(G+candidateMixedRareCostExponent A 1+1)) := mul_le_mul_of_nonneg_right hAcost (Real.rpow_nonneg hL.le _) _ = _ := by rw [← Real.rpow_add hL]; congr 1; ring have hdirty : A^(candidateSmallPIndices scale L).card * (2*F*Real.sqrt ((⌈L^2⌉₊ : ℝ)/ (((J+ell).choose ell)^(candidateSmallPIndices scale L).card : ℕ))* Real.sqrt (K^(candidateBigPIndices scale L).card)) ≤ 2*L^C*(A^(candidateSmallPIndices scale L).card* Real.sqrt (K^(candidateBigPIndices scale L).card))* Real.sqrt ((⌈L^2⌉₊ : ℝ)/ (((J+ell).choose ell)^(candidateSmallPIndices scale L).card : ℕ)) := by calc _ ≤ A^(candidateSmallPIndices scale L).card * (2*L^C*Real.sqrt ((⌈L^2⌉₊ : ℝ)/ (((J+ell).choose ell)^(candidateSmallPIndices scale L).card : ℕ))* Real.sqrt (K^(candidateBigPIndices scale L).card)) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hF (by norm_num)) (Real.sqrt_nonneg _)) (Real.sqrt_nonneg _)) (pow_nonneg hA _) _ = _ := by ring rw [mul_add] exact (add_le_add hclean hdirty).trans hr.2 end Bounty end -- Source module: RootLowRankBudget section /- One fixed omission parameter controls all costs in the original low-rank word bound. -/ open Finset Filter namespace Bounty theorem exists_candidate_root_low_rank_budget {scale : ℝ} (hs : 0 < scale) (ell : ℕ) (hell : 0 < ell) (J₀ : ℕ) (A Cbad C K Kghost G : ℝ) (hA : 0 ≤ A) (hCbad : 0 ≤ Cbad) (hK : 0 ≤ K) (hKghost : 0 ≤ Kghost) (hG : 0 ≤ G) : ∃ J : ℕ, J₀ ≤ J ∧ ∀ᶠ L : ℝ in atTop, ∀ F : ℝ, 0 ≤ F → F ≤ L^C → ∀ cap : ℕ, cap ≤ Nat.ceil (L^2) → let small := (candidateSmallPIndices scale L).card let big := (candidateBigPIndices scale L).card let decay := A^small * (L^(-(G+candidateMixedRareCostExponent A 1+1)) + 2*F*Real.sqrt ((cap : ℝ)/(((J+ell).choose ell)^small : ℕ))*Real.sqrt (K^big)) decay ≤ L^(-G) ∧ max decay (F*Cbad^small*Real.sqrt (K^big)) ≤ L^(max 0 (C+candidateMixedRareCostExponent Cbad K)) ∧ Real.sqrt (Kghost^big) ≤ L^(max 0 (candidateMixedRareCostExponent 1 Kghost)) ∧ (2 : ℝ)^((J+ell)*big) ≤ L^(max 0 (candidateMixedRareCostExponent 1 ((2 : ℝ)^(2*(J+ell))))) := by obtain ⟨J,hJ,hbudget⟩ := exists_candidate_mixed_full_scalar_budget hs ell hell J₀ A C K G hA hK refine ⟨J,hJ,?_⟩ filter_upwards [hbudget, eventually_candidate_mixed_conditioning_cost_le hs, eventually_ge_atTop (1 : ℝ)] with L hbudget hcost hL intro F hF0 hF cap hcap small big decay have hL0 : 0 < L := zero_lt_one.trans_le hL have hsqrt : Real.sqrt ((cap : ℝ)/(((J+ell).choose ell)^small : ℕ)) ≤ Real.sqrt ((Nat.ceil (L^2) : ℝ)/(((J+ell).choose ell)^small : ℕ)) := by exact Real.sqrt_le_sqrt (div_le_div_of_nonneg_right (Nat.cast_le.mpr hcap) (Nat.cast_nonneg _)) have hdecay : decay ≤ L^(-G) := by apply le_trans ?_ (hbudget F hF) apply mul_le_mul_of_nonneg_left ?_ (pow_nonneg hA _) apply add_le_add (le_refl _) exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hsqrt (by positivity)) (Real.sqrt_nonneg _) have hbad : F*Cbad^small*Real.sqrt (K^big) ≤ L^(C+candidateMixedRareCostExponent Cbad K) := by calc _ = F*(Cbad^small*Real.sqrt (K^big)) := by ring _ ≤ L^C*L^(candidateMixedRareCostExponent Cbad K) := mul_le_mul hF (hcost Cbad K hCbad hK) (mul_nonneg (pow_nonneg hCbad _) (Real.sqrt_nonneg _)) (Real.rpow_nonneg hL0.le _) _ = _ := (Real.rpow_add hL0 _ _).symm have hghost : Real.sqrt (Kghost^big) ≤ L^(candidateMixedRareCostExponent 1 Kghost) := by simpa only [one_pow, one_mul] using hcost 1 Kghost (by norm_num) hKghost have hmass : (2 : ℝ)^((J+ell)*big) ≤ L^(candidateMixedRareCostExponent 1 ((2 : ℝ)^(2*(J+ell)))) := by have hm := hcost 1 ((2 : ℝ)^(2*(J+ell))) (by norm_num) (by positivity) simp only [one_pow, one_mul] at hm have heq : Real.sqrt (((2 : ℝ)^(2*(J+ell)))^big) = (2 : ℝ)^((J+ell)*big) := by rw [← pow_mul, show 2*(J+ell)*big = ((J+ell)*big)*2 by ring, pow_mul, Real.sqrt_sq (by positivity)] rwa [heq] at hm refine ⟨hdecay, max_le ?_ ?_, ?_, ?_⟩ · exact hdecay.trans (Real.rpow_le_rpow_of_exponent_le hL ((neg_nonpos.mpr hG).trans (le_max_left _ _))) · exact hbad.trans (Real.rpow_le_rpow_of_exponent_le hL (le_max_right _ _)) · exact hghost.trans (Real.rpow_le_rpow_of_exponent_le hL (le_max_right _ _)) · exact hmass.trans (Real.rpow_le_rpow_of_exponent_le hL (le_max_right _ _)) end Bounty end -- Source module: RootSelectedFamilyEnvelope section /- A fixed probe count gives a candidate family envelope independent of the omission parameter. -/ open Finset Filter namespace Bounty theorem eventually_candidate_big_family_envelope {scale q x : ℝ} (hs : 0 < scale) (hq : 0 ≤ q) (hx : 0 ≤ x) (m : ℕ) : let a : ℝ := 2 / (5 * Real.log 2) let C : ℝ := (m : ℝ) * a * Real.log 2 + 4*q + 2*x + 1 ∀ᶠ L : ℝ in atTop, ∀ (Q : ℕ) (ξ : ℝ), (Q : ℝ) ≤ L^q → L^(-x) ≤ ξ → 0 ≤ repeatedBigFamilyEnvelope (candidateBigPIndices scale L).card m Q ξ ∧ repeatedBigFamilyEnvelope (candidateBigPIndices scale L).card m Q ξ ≤ L^C := by intro a C obtain ⟨v, V, _, _, hpools⟩ := exists_candidate_P_pool_bounds hs filter_upwards [hpools, eventually_ge_atTop (2 : ℝ)] with L hpools hL intro Q ξ hQ hξ have hL0 : 0 < L := by linarith have ha : 0 ≤ a := by dsimp [a]; positivity have hcard : ((candidateBigPIndices scale L).card : ℝ) ≤ a * Real.log L := by apply (Nat.cast_le.mpr (card_le_card (show candidateBigPIndices scale L ⊆ candidatePIndices scale L from subset_union_right))).trans exact hpools.2.2.2.1 refine ⟨repeated_big_family_envelope_nonneg _ _ _ _, ?_⟩ calc _ ≤ 2 * L^((m : ℝ)*a*Real.log 2 + 4*q + 2*x) := repeated_big_family_envelope_le _ m Q (by linarith) ha hq hx hcard hQ hξ _ ≤ L * L^((m : ℝ)*a*Real.log 2 + 4*q + 2*x) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = L^C := by rw [mul_comm, ← Real.rpow_add_one hL0.ne'] end Bounty end -- Source module: MixedFullParameterOrder section /- The clean accuracy and probe count precede envelope costs and the omission parameter. -/ open Finset Filter namespace Bounty end Bounty end -- Source module: RootSelectedParameterOrder section /- Choose the clean accuracy and frequency exponents before the fixed omission parameter. -/ open Finset Filter namespace Bounty theorem exists_candidate_selected_parameter_order {scale beta : ℝ} (hs : 0 < scale) (hbeta : 0 < beta) (ell : ℕ) (hell : 0 < ell) (A Cbad Ework s z ε ρ u v vmax Kghost : ℝ) (hA : 0 ≤ A) (hCbad : 0 ≤ Cbad) (hEwork : 0 ≤ Ework) (hs' : 0 ≤ s) (hz : 0 ≤ z) (hε : 0 < ε) (hKghost : 0 ≤ Kghost) : let a : ℝ := 2 / (5 * Real.log 2) let Cv := max 0 (candidateMixedRareCostExponent 1 Kghost) let G := Ework + Cv + 2 0 ≤ G ∧ Ework + Cv + 2 ≤ G ∧ ∃ (E : ℝ) (m : ℕ) (D : ℝ), E = G + candidateMixedRareCostExponent A 1 + 1 ∧ ell ≤ m ∧ 0 ≤ D ∧ beta * Real.log ((ell : ℝ)^ell / (m : ℝ)^ell) / 2 ≤ -(E+2) ∧ (m : ℝ)*a*Real.log 3 + E+2 ≤ D ∧ let κ := a * Real.log (primeFiberFactorBound v m) let s₁ := s + ε let A₀ := D + 2*(s₁+1) let q := 2*κ + (s₁+1) + 2*A₀ + 3 let w := 4*q + max z q + A₀ + 2 let x := (s₁+w+2) + 2*A₀ + 2 let C := (m : ℝ)*a*Real.log 2 + 4*q + 2*x + 1 let Kedge := unrestrictedEdgeEnergyBound ρ u v vmax (ell+m) let Ca := max 0 (C + candidateMixedRareCostExponent Cbad Kedge) 0 ≤ q ∧ 0 ≤ w ∧ 0 ≤ x ∧ 0 ≤ C ∧ 0 ≤ Ca ∧ 0 ≤ Cv ∧ ∀ J₀ : ℕ, ∃ J : ℕ, max m J₀ ≤ J ∧ let Ch := max 0 (candidateMixedRareCostExponent 1 ((2 : ℝ)^(2*(J+ell)))) 0 ≤ Ch ∧ ∀ᶠ L : ℝ in atTop, let Q := ⌊L^q⌋₊ let ξ := L^(-x) let small := (candidateSmallPIndices scale L).card let big := (candidateBigPIndices scale L).card let F := repeatedBigFamilyEnvelope big m Q ξ 0 ≤ F ∧ F ≤ L^C ∧ ∀ cap : ℕ, cap ≤ Nat.ceil (L^2) → let decay := A^small * (L^(-E) + 2*F*Real.sqrt ((cap : ℝ)/(((J+ell).choose ell)^small : ℕ))*Real.sqrt (Kedge^big)) decay ≤ L^(-G) ∧ max decay (F*Cbad^small*Real.sqrt (Kedge^big)) ≤ L^Ca ∧ Real.sqrt (Kghost^big) ≤ L^Cv ∧ (2 : ℝ)^((J+ell)*big) ≤ L^Ch := by intro a Cv G have hG : 0 ≤ G := by dsimp [G]; positivity refine ⟨hG,le_rfl,?_⟩ let E := G + candidateMixedRareCostExponent A 1 + 1 have ha : 0 ≤ a := by dsimp [a]; positivity obtain ⟨m,D,hm,hD,hgap,hDgap⟩ := exists_repeated_big_clean_parameters ell hell a E hbeta refine ⟨E,m,D,rfl,hm,hD,hgap,hDgap,?_⟩ intro κ s₁ A₀ q w x C Kedge Ca have hexp := repeated_big_prime_kernel_exponents_nonneg s z a v D ε m hs' hz ha hD hε.le have hq : 0 ≤ q := hexp.2.2.2.1 have hw : 0 ≤ w := hexp.2.2.2.2.1 have hx : 0 ≤ x := hexp.2.2.2.2.2 have hC : 0 ≤ C := by dsimp [C]; positivity refine ⟨hq,hw,hx,hC,le_max_left _ _,le_max_left _ _,?_⟩ intro J₀ have hKedge : 0 ≤ Kedge := unrestrictedEdgeEnergyBound_nonneg ρ u v vmax (ell+m) obtain ⟨J,hJ,hbudget⟩ := exists_candidate_root_low_rank_budget hs ell hell (max m J₀) A Cbad C Kedge Kghost G hA hCbad hKedge hKghost hG refine ⟨J,hJ,?_⟩ intro Ch refine ⟨le_max_left _ _,?_⟩ filter_upwards [hbudget, eventually_candidate_big_family_envelope hs hq hx m, eventually_gt_atTop (0 : ℝ)] with L hbudget hfamily hL intro Q ξ small big F have hF := hfamily Q ξ (Nat.floor_le (Real.rpow_nonneg hL.le _)) le_rfl refine ⟨hF.1,hF.2,?_⟩ intro cap hcap exact hbudget F hF.1 hF.2 cap hcap end Bounty end -- Source module: RootGhostParameters section /- Fixed admissible ghost parameters for the actual one-half endpoint schedule. -/ namespace Bounty theorem root_ghost_scalar_budget {q W vmax : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 3/4) (hvmax : 0 ≤ vmax) (hW0 : 0 ≤ W) (hW : W ≤ 2*vmax+1) : q/(9/10 : ℝ)^2 + (((1-q)*W)/(9/10 : ℝ))/(100*(vmax+1)) ≤ 1 := by have hq : q/(9/10 : ℝ)^2 ≤ 25/27 := by apply (div_le_iff₀ (by norm_num)).2 nlinarith have hmul : (1-q)*W ≤ W := by nlinarith have hterm : (((1-q)*W)/(9/10 : ℝ))/(100*(vmax+1)) ≤ 1/45 := by rw [div_div] apply (div_le_iff₀ (by positivity)).2 nlinarith linarith theorem physical_endpoint_half_schedule_le_three_quarters (edges j : ℕ) : physicalEndpointSchedule (1/2) edges j ≤ (3/4 : ℝ) := by have hs : Real.sqrt (1/2 : ℝ) ≤ 3/4 := by apply (Real.sqrt_le_iff).2 norm_num unfold physicalEndpointSchedule split_ifs · exact hs · norm_num theorem physical_endpoint_half_ghost_budgets {vmax : ℝ} (hvmax : 0 ≤ vmax) (edges : ℕ) : 1 < 100*(vmax+1) ∧ ∀ j : ℕ, physicalEndpointSchedule (1/2) edges j/(9/10 : ℝ)^2 + ((1-physicalEndpointSchedule (1/2) edges j)/(9/10 : ℝ))/(100*(vmax+1)) ≤ 1 ∧ ∀ V : ℝ, 0 ≤ V → V ≤ vmax → physicalEndpointSchedule (1/2) edges j/(9/10 : ℝ)^2 + (((1-physicalEndpointSchedule (1/2) edges j)*(2*V))/(9/10 : ℝ))/(100*(vmax+1)) ≤ 1 := by refine ⟨by linarith, fun j => ?_⟩ have hq0 := (physical_endpoint_schedule_unit (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ) ≤ 1) edges j).1 have hq1 := physical_endpoint_half_schedule_le_three_quarters edges j constructor · simpa only [mul_one] using root_ghost_scalar_budget hq0 hq1 hvmax (show (0 : ℝ) ≤ 1 by norm_num) (show (1 : ℝ) ≤ 2*vmax+1 by linarith) · intro V hV0 hV exact root_ghost_scalar_budget hq0 hq1 hvmax (by positivity) (by linarith) end Bounty end -- Source module: FiniteGroupSplit section /- Two disjoint finite selections each containing at least one quarter of the pool. -/ open Finset namespace Bounty theorem exists_disjoint_quarter_subsets {G : Type*} [DecidableEq G] (s : Finset G) (hs : 2 ≤ s.card) : ∃ r t : Finset G, r ⊆ s ∧ t ⊆ s ∧ Disjoint r t ∧ s.card ≤ 4 * r.card ∧ s.card ≤ 4 * t.card := by obtain ⟨r, hrs, hr⟩ := exists_subset_card_eq (Nat.div_le_self s.card 2) refine ⟨r, s \ r, hrs, sdiff_subset, ?_, ?_, ?_⟩ · exact disjoint_left.mpr (fun _ hi hj => (mem_sdiff.mp hj).2 hi) · omega · rw [card_sdiff_of_subset hrs, hr] omega end Bounty end -- Source module: RootProbeSelection section /- A common initial probe set chosen without reference to any analytic datum. -/ namespace Bounty theorem exists_uniform_card_probes (G : Type*) {m J : ℕ} (hmJ : m ≤ J) : ∃ probes : G → Finset (Fin J), (∀ g, (probes g).card = m) ∧ ∀ g h, probes g = probes h := by refine ⟨fun _ => Finset.univ.map (Fin.castLEEmb hmJ), ?_, ?_⟩ · intro g simp · intro g h rfl end Bounty end -- Source module: CandidateRootSelection section /- Disjoint logarithmically large big-prime group families for the selected root moment. -/ open Filter Finset open scoped Classical namespace Bounty theorem candidate_selection_beta_pos : 0 < (1 / (80 * Real.log 2) : ℝ) := by positivity theorem eventually_candidate_disjoint_big_selections {scale : ℝ} (hscale : 0 < scale) : ∀ᶠ L : ℝ in atTop, ∃ r t : Finset (candidatePIndices scale L), Disjoint r t ∧ (∀ g ∈ r ∪ t, g.val ∈ candidateBigPIndices scale L) ∧ (1 / (80 * Real.log 2)) * Real.log L ≤ (r.card : ℝ) ∧ (1 / (80 * Real.log 2)) * Real.log L ≤ (t.card : ℝ) := by obtain ⟨v, V, _, _, hpool⟩ := exists_candidate_P_pool_bounds hscale filter_upwards [hpool, Real.tendsto_log_atTop.eventually (eventually_ge_atTop (40 * Real.log 2))] with L hpool hlog let emb : (candidateBigPIndices scale L) ↪ (candidatePIndices scale L) := ⟨fun i => ⟨i.val, mem_union_right _ i.property⟩, fun a b h => Subtype.ext (congrArg (fun x : candidatePIndices scale L => x.val) h)⟩ let pool := (candidateBigPIndices scale L).attach.map emb have hcard : pool.card = (candidateBigPIndices scale L).card := by simp [pool] have hmem : ∀ g ∈ pool, g.val ∈ candidateBigPIndices scale L := by intro g hg obtain ⟨i, _, rfl⟩ := mem_map.mp hg exact i.property have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) have hbig := hpool.2.2.1 have htwo : (2 : ℝ) ≤ (pool.card : ℝ) := by rw [hcard] calc 2 = (1 / (20 * Real.log 2)) * (40 * Real.log 2) := by field_simp; ring _ ≤ (1 / (20 * Real.log 2)) * Real.log L := mul_le_mul_of_nonneg_left hlog (by positivity) _ ≤ _ := hbig obtain ⟨r, t, hr, ht, hrt, hrc, htc⟩ := exists_disjoint_quarter_subsets pool (by exact_mod_cast htwo) have hrc' : (pool.card : ℝ) ≤ 4 * (r.card : ℝ) := by exact_mod_cast hrc have htc' : (pool.card : ℝ) ≤ 4 * (t.card : ℝ) := by exact_mod_cast htc have hcoef : (1 / (20 * Real.log 2) : ℝ) = 4 * (1 / (80 * Real.log 2)) := by ring rw [← hcard, hcoef] at hbig refine ⟨r, t, hrt, ?_, ?_, ?_⟩ · intro g hg exact hmem g ((mem_union.mp hg).elim (hr ·) (ht ·)) · nlinarith · nlinarith end Bounty end -- Source module: CandidateBigBandEndpoints section /- Actual endpoint bounds for every selected big candidate band. -/ open Filter Finset namespace Bounty theorem eventually_candidate_big_band_endpoints {scale : ℝ} (hscale : 0 < scale) : ∀ᶠ L : ℝ in atTop, ∀ j ∈ candidateBigPIndices scale L, ∃ a b : ℝ, candidatePBand (scale * L) j = primeBand a b ∧ Real.exp (L ^ (3/10 : ℝ)) ≤ a ∧ b ≤ Real.exp (L ^ (2/5 : ℝ)) ∧ 0 ≤ b := by have hind := eventually_geometric_log_indices_nonneg (α := (3/10 : ℝ)) (β := (2/5 : ℝ)) (c₃ := (3/2 : ℝ)) (c₄ := (9/5 : ℝ)) (by norm_num) (by norm_num) hscale (by norm_num) (by norm_num) filter_upwards [hind, eventually_gt_atTop (0 : ℝ)] with L hind hL intro j hj obtain ⟨hlo, hhi⟩ := dyadic_scale_bounds_of_mem (mul_pos hscale hL) (by norm_num : (0 : ℝ) < 3/2) (by norm_num : (0 : ℝ) < 9/5) (Real.rpow_pos_of_pos hL (3/10 : ℝ)) (Real.rpow_pos_of_pos hL (2/5 : ℝ)) hind.2 hj exact ⟨Real.exp ((3/2) * (scale * L) / 2^j), Real.exp ((9/5) * (scale * L) / 2^j), rfl, Real.exp_le_exp.mpr hlo, Real.exp_le_exp.mpr hhi, (Real.exp_pos _).le⟩ end Bounty end -- Source module: CandidateBigCleanGroups section /- Concrete big-group data for the clean prime row with c=1/4 and s=1/2. -/ open Filter Finset open scoped Classical namespace Bounty end Bounty end -- Source module: RootCapMomentBound section /- A linear working memory cap absorbs sublinear path costs at the original moment power. -/ open Filter namespace Bounty theorem eventually_root_cap_moment_bound {A D : ℝ} (hA : 0 ≤ A) (hD : 0 ≤ D) : ∀ᶠ L : ℝ in atTop, ∀ b lost : ℕ, L ≤ (b : ℝ) → (lost : ℝ) ≤ A*L^(13/25 : ℝ)*Real.log L → ((2 : ℝ)^(b+1-lost))⁻¹ * Real.exp (A*L^(13/25 : ℝ)*Real.log L) ≤ (L^(-D))^(2*Nat.ceil (L^(13/25 : ℝ))) := by have hlog : 0 < Real.log (2 : ℝ) := Real.log_pos (by norm_num) have hC : 0 ≤ A*(1+Real.log 2)+4*D := by positivity filter_upwards [eventually_scaled_log_power hC (by norm_num : (13/25 : ℝ) < 1) hlog, eventually_ge_atTop (1 : ℝ)] with L hbudget hL intro b lost hb hlost rw [Real.rpow_one] at hbudget have hL0 : 0 < L := zero_lt_one.trans_le hL have hlogL : 0 ≤ Real.log L := Real.log_nonneg hL have hP : 1 ≤ L^(13/25 : ℝ) := Real.one_le_rpow hL (by norm_num) have hceil : (Nat.ceil (L^(13/25 : ℝ)) : ℝ) ≤ 2*L^(13/25 : ℝ) := by have h := Nat.ceil_lt_add_one (Real.rpow_nonneg hL0.le (13/25 : ℝ)) linarith have hAge : A ≤ A*(1+Real.log 2)+4*D := by nlinarith have hAX : A*L^(13/25 : ℝ)*Real.log L ≤ L := by calc _ ≤ (A*(1+Real.log 2)+4*D)*L^(13/25 : ℝ)*Real.log L := by gcongr _ ≤ Real.log 2*L := hbudget _ ≤ L := by have htwo : Real.log 2 ≤ 1 := by have h := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 2) linarith nlinarith have hlb : lost ≤ b+1 := by have hle : (lost : ℝ) ≤ b := hlost.trans (hAX.trans hb) exact Nat.le_succ_of_le (by exact_mod_cast hle) have hsub : ((b+1-lost : ℕ) : ℝ) = (b : ℝ)+1-lost := by rw [Nat.cast_sub hlb, Nat.cast_add, Nat.cast_one] have hexp : -(Real.log 2*((b : ℝ)+1-lost)) + A*L^(13/25 : ℝ)*Real.log L ≤ Real.log L*(-D*(2*(Nat.ceil (L^(13/25 : ℝ)) : ℝ))) := by have hneg : -D*(2*(Nat.ceil (L^(13/25 : ℝ)) : ℝ))*Real.log L ≥ -4*D*L^(13/25 : ℝ)*Real.log L := by have hmul := mul_le_mul_of_nonneg_right hceil (mul_nonneg hD hlogL) nlinarith have hbl := mul_le_mul_of_nonneg_left hb hlog.le have hll := mul_le_mul_of_nonneg_left hlost hlog.le nlinarith rw [← Real.rpow_natCast (2 : ℝ) (b+1-lost), Real.rpow_def_of_pos (by norm_num : (0 : ℝ) < 2), ← Real.exp_neg, ← Real.exp_add, hsub] have hright : (L^(-D))^(2*Nat.ceil (L^(13/25 : ℝ))) = Real.exp (Real.log L*(-D*(2*(Nat.ceil (L^(13/25 : ℝ)) : ℝ)))) := by rw [← Real.rpow_natCast (L^(-D)) (2*Nat.ceil (L^(13/25 : ℝ))), ← Real.rpow_mul hL0.le] simpa only [Nat.cast_mul, Nat.cast_ofNat] using (Real.rpow_def_of_pos hL0 (-D*((2*Nat.ceil (L^(13/25 : ℝ)) : ℕ) : ℝ))) rw [hright] apply Real.exp_le_exp.mpr simpa only [Nat.cast_mul, Nat.cast_ofNat] using hexp end Bounty end -- Source module: RootCapEnvelope section /- Scalar polynomial envelopes for the original cap error. -/ /- Fixed per-group costs are polynomial when the number of groups is logarithmic. -/ namespace Bounty theorem constant_pow_le_rpow_of_log_bound {a L C : ℝ} (ha : 1 ≤ a) (hL : 0 < L) (n : ℕ) (hn : (n : ℝ) ≤ C*Real.log L) : a^n ≤ L^(C*Real.log a) := by calc _ = Real.exp (Real.log a*(n : ℝ)) := by rw [← Real.rpow_natCast, Real.rpow_def_of_pos (zero_lt_one.trans_le ha)] _ ≤ Real.exp (Real.log a*(C*Real.log L)) := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left hn (Real.log_nonneg ha)) _ = _ := by rw [Real.rpow_def_of_pos hL]; congr 1; ring end Bounty /- A polynomial cost per step is absorbed at the original moment power. -/ open Filter namespace Bounty theorem eventually_root_cap_polynomial_moment_bound {A C H D : ℝ} (hA : 0 ≤ A) (hH : 0 ≤ H) (hD : 0 ≤ D) : ∀ᶠ L : ℝ in atTop, ∀ b lost n : ℕ, L ≤ (b : ℝ) → (lost : ℝ) ≤ A*L^(13/25 : ℝ)*Real.log L → (n : ℝ) ≤ C*L^(13/25 : ℝ) → ((2 : ℝ)^(b+1-lost))⁻¹ * L^(H*((n : ℝ)+1)) ≤ (L^(-D))^(2*Nat.ceil (L^(13/25 : ℝ))) := by let K := max A (H*(C+1)) have hK : 0 ≤ K := hA.trans (le_max_left _ _) filter_upwards [eventually_root_cap_moment_bound hK hD, eventually_ge_atTop (1 : ℝ)] with L hmain hL intro b lost n hb hlost hn have hL0 : 0 < L := zero_lt_one.trans_le hL have hlog : 0 ≤ Real.log L := Real.log_nonneg hL have hP : 1 ≤ L^(13/25 : ℝ) := Real.one_le_rpow hL (by norm_num) have hlost' : (lost : ℝ) ≤ K*L^(13/25 : ℝ)*Real.log L := by apply hlost.trans exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (le_max_left _ _) (Real.rpow_nonneg hL0.le _)) hlog have hexponent : H*((n : ℝ)+1) ≤ K*L^(13/25 : ℝ) := by have hmul := mul_le_mul_of_nonneg_left (show (n : ℝ)+1 ≤ (C+1)*L^(13/25 : ℝ) by nlinarith) hH have hk := mul_le_mul_of_nonneg_right (le_max_right A (H*(C+1))) (Real.rpow_nonneg hL0.le (13/25 : ℝ)) dsimp only [K] nlinarith have hpower : L^(H*((n : ℝ)+1)) ≤ Real.exp (K*L^(13/25 : ℝ)*Real.log L) := by calc _ = Real.exp (Real.log L*(H*((n : ℝ)+1))) := Real.rpow_def_of_pos hL0 _ _ ≤ Real.exp (Real.log L*(K*L^(13/25 : ℝ))) := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left hexponent hlog) _ = _ := by congr 1; ring exact (mul_le_mul_of_nonneg_left hpower (by positivity)).trans (hmain b lost hb hlost') end Bounty /- Polynomial bounds for the original phase, step-energy product and initial mass. -/ namespace Bounty theorem nonnegative_list_product_le_rpow {α : Type*} {L E : ℝ} (hL : 0 < L) (steps : List α) (f : α → ℝ) (hf : ∀ x ∈ steps, 0 ≤ f x ∧ f x ≤ L^E) : (steps.map f).prod ≤ L^(E*(steps.length : ℝ)) := by induction steps with | nil => simp | cons x xs ih => have hx := hf x (by simp) have hxs : ∀ y ∈ xs, 0 ≤ f y ∧ f y ≤ L^E := fun y hy => hf y (by simp [hy]) have hp : 0 ≤ (xs.map f).prod := by apply List.prod_nonneg intro y hy obtain ⟨z, hz, rfl⟩ := List.mem_map.mp hy exact (hxs z hz).1 simp only [List.map_cons, List.prod_cons, List.length_cons, Nat.cast_add, Nat.cast_one] calc _ ≤ L^E * L^(E*(xs.length : ℝ)) := mul_le_mul hx.2 (ih hxs) hp (Real.rpow_nonneg hL.le E) _ = _ := by rw [← Real.rpow_add hL]; congr 1; ring theorem root_polynomial_energy_envelope {α : Type*} {L B E M H mass : ℝ} (hL : 1 ≤ L) (hB : 0 ≤ B) (hE : 0 ≤ E) (hM : 0 ≤ M) (hH : 0 ≤ H) (hHpow : H ≤ L^B) (hmass : 0 ≤ mass) (hmasspow : mass ≤ L^M) (steps : List α) (f : α → ℝ) (hf : ∀ x ∈ steps, 0 ≤ f x ∧ f x ≤ L^E) : H^steps.length * Real.sqrt (steps.map f).prod * mass ≤ L^((B+E+M)*((steps.length : ℝ)+1)) := by have hL0 : 0 < L := zero_lt_one.trans_le hL have hpow : H^steps.length ≤ L^(B*(steps.length : ℝ)) := by calc _ ≤ (L^B)^steps.length := pow_le_pow_left₀ hH hHpow _ _ = _ := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL0.le] have hprod := nonnegative_list_product_le_rpow hL0 steps f hf have hone : 1 ≤ L^(E*(steps.length : ℝ)) := Real.one_le_rpow hL (mul_nonneg hE (Nat.cast_nonneg _)) have hsqrt : Real.sqrt (steps.map f).prod ≤ L^(E*(steps.length : ℝ)) := (Real.sqrt_le_sqrt hprod).trans (Real.sqrt_le_self_iff.mpr (Or.inr hone)) calc _ ≤ L^(B*(steps.length : ℝ))*L^(E*(steps.length : ℝ))*L^M := mul_le_mul (mul_le_mul hpow hsqrt (Real.sqrt_nonneg _) (Real.rpow_nonneg hL0.le _)) hmasspow hmass (mul_nonneg (Real.rpow_nonneg hL0.le _) (Real.rpow_nonneg hL0.le _)) _ = L^(B*(steps.length : ℝ)+E*(steps.length : ℝ)+M) := by rw [← Real.rpow_add hL0, ← Real.rpow_add hL0] _ ≤ _ := by apply Real.rpow_le_rpow_of_exponent_le hL have hn : 0 ≤ (steps.length : ℝ) := Nat.cast_nonneg _ nlinarith end Bounty /- The original scalar cap error is absorbed once its phase, energies and mass are polynomial. -/ open Filter namespace Bounty theorem eventually_root_cap_weighted_moment_bound {A C B E M D : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hE : 0 ≤ E) (hM : 0 ≤ M) (hD : 0 ≤ D) : ∀ᶠ L : ℝ in atTop, ∀ (b lost : ℕ), L ≤ (b : ℝ) → (lost : ℝ) ≤ A*L^(13/25 : ℝ)*Real.log L → ∀ (α : Type) (steps : List α) (f : α → ℝ), (steps.length : ℝ) ≤ C*L^(13/25 : ℝ) → (∀ x ∈ steps, 0 ≤ f x ∧ f x ≤ L^E) → ∀ H mass : ℝ, 0 ≤ H → H ≤ L^B → 0 ≤ mass → mass ≤ L^M → H^steps.length * ((2 : ℝ)^(b+1-lost))⁻¹ * Real.sqrt (steps.map f).prod * mass ≤ (L^(-D))^(2*Nat.ceil (L^(13/25 : ℝ))) := by filter_upwards [eventually_root_cap_polynomial_moment_bound (C := C) hA (show 0 ≤ B+E+M by positivity) hD, eventually_ge_atTop (1 : ℝ)] with L hbound hL intro b lost hb hlost α steps f hn hf H mass hH hHpow hmass hmasspow have he := root_polynomial_energy_envelope hL hB hE hM hH hHpow hmass hmasspow steps f hf calc _ = ((2 : ℝ)^(b+1-lost))⁻¹ * (H^steps.length * Real.sqrt (steps.map f).prod * mass) := by ring _ ≤ ((2 : ℝ)^(b+1-lost))⁻¹ * L^((B+E+M)*((steps.length : ℝ)+1)) := mul_le_mul_of_nonneg_left he (by positivity) _ ≤ _ := hbound b lost steps.length hb hlost hn end Bounty end -- Source module: PhysicalMixedWordPathsExtra section /- Actual mixed-word paths and their maximum total pending memory. -/ namespace Bounty section variable {H K S G I : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) abbrev PhysicalMixedWordPath (steps : List (Option (H ⊕ K))) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) := FiniteEventPath (PhysicalMixedWordEvent (V := H) (J := J) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) steps s noncomputable def physicalMixedWordPeak (steps : List (Option (H ⊕ K))) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (p : PhysicalMixedWordPath n shared B A Δ D kbig steps s) : ℕ := finiteEventPathMaximum (PhysicalMixedWordEvent (V := H) (J := J) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (fun s => productTotalMemory s.2) steps s p end end Bounty end -- Source module: PhysicalMixedWordPositive section /- Positive comparison rows for actual mixed words, with an explicit pattern sum. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G I : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) noncomputable def physicalMixedWordPositiveWeight (tag : Option (H ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEvent n shared B A Δ D tag s) : ℝ := |physicalMixedWordWeight n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ (match tag with | some (.inl _) => Vghost | _ => Vedge) Vs (fun _ => qsmall) tag s e| omit [∀ g, Fintype (P g)] in theorem physical_mixed_word_edge_weight_nonneg (hVs : ∀ s, 0 < Vs s) (hω : ∀ i a, 0 ≤ ω i a) (hμ : ∀ g p, 0 ≤ μ g p) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ Vedge g) (k : K) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEvent n shared B A Δ D (some (.inr k) : Option (H ⊕ K)) s) : 0 ≤ physicalMixedWordWeight n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ Vedge Vs (fun _ => qsmall) (some (.inr k)) s e := by apply mul_nonneg (hω e.1 e.2.1) apply physical_small_big_positive_weight_nonneg Vs hVs intro r d x ev exact physical_small_big_full_weight_nonneg n (shared e.1) B (fun d c => Δ k e.1 d c e.2.1) (fun d c => D k e.1 d c e.2.1) μ ρ Vedge hμ hρ hV r d x ev variable [Fintype I] [∀ i, Fintype (A i)] [∀ g p, NeZero (n g p)] noncomputable def physicalMixedWordPositiveAction (tag : Option (H ⊕ K)) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) := let _ : ∀ tag s, Fintype (PhysicalMixedWordEvent (V := H) (ell := ell) n shared B A Δ D tag s) := physicalMixedWordEventFintype n shared B A Δ D finiteLocalEventAction (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordPositiveWeight n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall) (physicalMixedWordTarget n shared B A Δ D kbig) tag F theorem physical_mixed_word_positive_edge_eq (hVs : ∀ s, 0 < Vs s) (hω : ∀ i a, 0 ≤ ω i a) (hμ : ∀ g p, 0 ≤ μ g p) (hρ : 0 ≤ ρ) (hV : ∀ g, 0 ≤ Vedge g) (k : K) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) : physicalMixedWordPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall (some (.inr k)) F = fun s => ∑ i, physicalSmallBigPathPositiveAction n shared B A (Δ k) (D k) (kbig k) ω μ qghost ρ Vedge Vghost Vs qsmall (some (.inr i)) F s := by funext s simp_rw [physical_small_big_path_positive_edge_eq n shared B A (Δ k) (D k) (kbig k) ω μ qghost ρ Vedge Vghost Vs qsmall hVs hω hμ hρ hV] unfold physicalMixedWordPositiveAction finiteLocalEventAction dsimp only [physicalMixedWordEventFintype, PhysicalMixedWordEvent, PhysicalMixedWordEdge] simp only [Fintype.sum_sigma] apply sum_congr rfl intro i _ apply sum_congr rfl intro a _ unfold physicalSmallBigFullPhasedAction physicalSmallBigPhasedAction rw [mul_sum] apply sum_congr rfl intro e _ have hw := physical_mixed_word_edge_weight_nonneg n shared B A Δ D kbig ω μ qghost ρ Vedge Vs qsmall hVs hω hμ hρ hV k s ⟨i, a, e⟩ dsimp only [physicalMixedWordPositiveWeight] rw [abs_of_nonneg hw] simp only [physicalMixedWordWeight, physicalMixedWordTarget, Complex.ofReal_mul, mul_one] ring end end Bounty end -- Source module: PhysicalMixedWordVaryingGhost section /- Signed mixed paths with a separate ghost birth parameter. This permits the doubled-ghost comparison while keeping every edge weight unchanged. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G I : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) noncomputable def physicalMixedWordVaryingGhostWeight (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (e : PhysicalMixedWordEvent (V := H) (J := J) (ell := ell) n shared B A Δ D tag s) : ℝ := physicalMixedWordWeight n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ (match tag with | some (.inl _) => Vghost | _ => Vedge) Vs (fun _ => qsmall) tag s e variable [Fintype I] [∀ g p, NeZero (n g p)] [∀ i, Fintype (A i)] noncomputable def physicalMixedWordVaryingGhostAction (steps : List (Option (H ⊕ K))) (phase : ∀ s, PhysicalMixedWordPath n shared B A Δ D kbig steps s → ℂ) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) := let _ : ∀ (tag : Option (H ⊕ K)) s, Fintype (PhysicalMixedWordEvent (V := H) (J := J) (ell := ell) n shared B A Δ D tag s) := physicalMixedWordEventFintype (V := H) (J := J) (ell := ell) n shared B A Δ D finiteEventPathAction (PhysicalMixedWordEvent (V := H) (J := J) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordVaryingGhostWeight n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall) steps phase f theorem physical_mixed_word_varying_ghost_path_norm_le_positive_list (steps : List (Option (H ⊕ K))) (phase : ∀ s, PhysicalMixedWordPath n shared B A Δ D kbig steps s → ℂ) (hphase : ∀ s p, ‖phase s p‖ ≤ 1) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) : ‖physicalMixedWordVaryingGhostAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall steps phase f s‖ ≤ (finiteOperatorListAction (physicalMixedWordPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall) steps (complexNormEnvelope f) s).re := by let _ : ∀ (tag : Option (H ⊕ K)) s, Fintype (PhysicalMixedWordEvent (V := H) (J := J) (ell := ell) n shared B A Δ D tag s) := physicalMixedWordEventFintype (V := H) (J := J) (ell := ell) n shared B A Δ D exact finite_event_path_norm_le_abs_list_re (PhysicalMixedWordEvent (V := H) (J := J) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordVaryingGhostWeight n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall) steps phase hphase f s end end Bounty end -- Source module: PhysicalMixedWordComposition section /- Whole-path energy from positive local mixed-word estimates. -/ open Finset open scoped Classical namespace Bounty theorem physical_mixed_word_varying_ghost_path_energy_of_local {H K S G I : Type} [Fintype S] [Fintype G] [DecidableEq G] [Fintype I] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) (hVs : ∀ s, 0 < Vs s) (hμ : ∀ g p, 0 ≤ μ g p) (C : Option (H ⊕ K) → ℝ) (hC : ∀ tag, 0 ≤ C tag) (hpreserve : ∀ tag (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → ∀ s, ProductMemorySymmetric (fun x => physicalMixedWordPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall tag F (s, x))) (hlocal : ∀ tag (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalMixedWordPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall tag F) ≤ C tag * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F) (steps : List (Option (H ⊕ K))) (phase : ∀ s, PhysicalMixedWordPath n shared B A Δ D kbig steps s → ℂ) (hphase : ∀ s p, ‖phase s p‖ ≤ 1) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s, x))) : physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalMixedWordVaryingGhostAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall steps phase f) ≤ (steps.map C).prod * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by rw [← physical_small_big_energy_eq, ← physical_small_big_energy_eq] apply finiteWeightedEnergy_le_of_envelope_domination (physicalSmallBigMeasure Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)))) (physical_small_big_measure_nonneg Vs hVs _ (productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1))) f _ (finiteOperatorListAction (physicalMixedWordPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall) steps) · intro s exact (physical_mixed_word_varying_ghost_path_norm_le_positive_list n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall steps phase hphase f s).trans (Complex.re_le_norm _) · apply finite_operator_list_energy_le _ (fun F => ∀ s, ProductMemorySymmetric (fun x => F (s, x))) _ hpreserve C hC · intro tag F hF simpa only [physical_small_big_energy_eq] using hlocal tag F hF · intro s exact complexNormEnvelope_memory_symmetric (fun x => f (s, x)) (hf s) end Bounty end -- Source module: PhysicalMixedWordPositiveIdentities section /- The mixed-word ghost and permutation comparisons retain their original rows. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G I : Type} [Fintype S] [Fintype G] [dG : DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) variable [Fintype I] [∀ i, Fintype (A i)] [∀ g p, NeZero (n g p)] theorem physical_mixed_word_positive_ghost_eq (hμ : ∀ g p, 0 ≤ μ g p) (j : H) (hq : 0 ≤ qghost j) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) : physicalMixedWordPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall (some (.inl j)) F = physicalSmallBigGhostAction (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g z => |physicalGhostTermination (n g) (qghost j) ρ z|) (fun g z => |physicalGhostBirth (n g) (qghost j) ρ (Vghost g) z|) (fun g => unrestrictedResidueWeight (μ g)) M B (fun _ _ => 1) F := by funext s rw [physical_small_big_ghost_eq_event_sum] unfold physicalMixedWordPositiveAction finiteLocalEventAction apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ change CoupledGhostEvent M B s.2 at e simp only [physicalMixedWordPositiveWeight, physicalMixedWordWeight, physicalMixedWordTarget, mul_one] rw [coupledGhostJointEventWeight_abs] · intro g z unfold physicalGhostRetention split_ifs · exact div_nonneg hq (sq_nonneg ρ) · exact zero_le_one · intro g z exact hμ g z.1 theorem physical_mixed_word_positive_permutation_eq [dS : DecidableEq S] (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) : physicalMixedWordPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall none F = physicalSmallBigJointAverage F := by cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) funext s rw [physical_small_big_joint_average_eq_sum] unfold physicalMixedWordPositiveAction finiteLocalEventAction apply sum_congr · exact congrArg (fun i : Fintype _ => @Finset.univ _ i) (Subsingleton.elim _ _) · intro e _ change PhysicalPermutations S J ell × FullActiveSlotPermutations M at e dsimp only [physicalMixedWordPositiveWeight, physicalMixedWordWeight, physicalMixedWordTarget] erw [abs_of_nonneg (mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg (Fintype.card (PhysicalPermutations S J ell)))) (fullActivePermutationWeight_nonneg M e.2))] congr 3 end end Bounty end -- Source module: FiniteSumEnergyBound section /- A finite-sum energy bound for combining pattern-indexed operators. -/ open Finset namespace Bounty theorem finite_weighted_energy_sum_le {X I : Type*} [Fintype X] [Fintype I] (w : X → ℝ) (hw : ∀ x, 0 ≤ w x) (F : I → X → ℂ) : finiteWeightedEnergy w (fun x => ∑ i, F i x) ≤ (Fintype.card I : ℝ) * ∑ i, finiteWeightedEnergy w (F i) := by unfold finiteWeightedEnergy calc _ ≤ ∑ x, w x * ((Fintype.card I : ℝ) * ∑ i, ‖F i x‖ ^ 2) := by apply sum_le_sum intro x _ apply mul_le_mul_of_nonneg_left _ (hw x) simpa only [card_univ] using finite_complex_sum_norm_sq_le_card univ (fun i => F i x) _ = _ := by simp_rw [mul_left_comm (w _) (Fintype.card I : ℝ), mul_sum] rw [sum_comm] end Bounty end -- Source module: PhysicalMixedWordLocalEnergy section /- The actual mixed edge gains only the explicit squared pattern count. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_mixed_word_edge_energy_bound {qsmall vs : ℝ} (hq0 : 0 ≤ qsmall) (hq1 : qsmall < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ Ccond : ℝ, 1 ≤ Ccond ∧ ∀ (H K S G I : Type) [Fintype I] [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : G → ℕ) (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ), (∀ s, vs ≤ Vs s) → (∀ k a, 0 ≤ ω k a) → (∀ k, ∑ a, ω k a ≤ 1) → ∀ (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ Vedge g) → (∀ g, Vedge g ≤ vmax) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → ∀ (T : ℕ), (∀ i g, (shared i g)ᶜ.card ≤ T) → ∀ (k : K) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => F (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalMixedWordPositiveAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall (some (.inr k)) F) ≤ (Fintype.card I : ℝ) ^ 2 * (Ccond ^ (2 * Fintype.card S) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by obtain ⟨Ccond, hCcond, hbound⟩ := exists_physical_small_big_path_edge_energy_bound hq0 hq1 hvs ell refine ⟨Ccond, hCcond, ?_⟩ intro H K S G I _ _ dS _ dG cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ n _ J M shared B A _ Δ D kbig ω μ qghost ρ Vedge Vghost Vs hVs hω hωmass v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht k F hF have hVs' : ∀ s, 0 < Vs s := fun s => hvs.trans_le (hVs s) erw [physical_mixed_word_positive_edge_eq n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall hVs' hω hμ hρ0.le (fun g => (hvmin.trans_le (hVlo g)).le) k F] have hs := finite_weighted_energy_sum_le (physicalSmallBigMeasure Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)))) (physical_small_big_measure_nonneg Vs hVs' _ (productMemoryWeight_nonneg μ _ hμ (fun g z => hμ g z.1))) (fun i => physicalSmallBigPathPositiveAction n shared B A (Δ k) (D k) (kbig k) ω μ qghost ρ Vedge Vghost Vs qsmall (some (.inr i)) F) simp only [physical_small_big_energy_eq] at hs refine hs.trans ?_ calc _ ≤ (Fintype.card I : ℝ) * ∑ _i : I, (Ccond ^ (2 * Fintype.card S) * unrestrictedEdgeEnergyBound ρ v vmin vmax T ^ Fintype.card G) * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) F := by apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) apply sum_le_sum intro i _ exact hbound H I S G Ps P n J M shared B A (Δ k) (D k) (kbig k) ω μ qghost ρ Vedge Vghost Vs hVs hω hωmass v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass T ht i F hF _ = _ := by simp only [sum_const, card_univ, nsmul_eq_mul] ring_nf rfl end Bounty end -- Source module: PhysicalMixedWordEnergy section /- Whole-path mixed-word energy with arbitrary bounded phase and terminal memory symmetry. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalMixedWordStepEnergy {H K : Type} (A ρ v vmin vmaxEdge vmaxGhost : ℝ) (T smallGroups bigGroups patternCount : ℕ) : Option (H ⊕ K) → ℝ | none => 1 | some (.inl _) => physicalGhostUniformEnergyBound ρ vmaxGhost v ^ bigGroups | some (.inr _) => (patternCount : ℝ) ^ 2 * (A ^ (2 * smallGroups) * unrestrictedEdgeEnergyBound ρ v vmin vmaxEdge T ^ bigGroups) theorem physical_mixed_word_step_energy_nonneg {H K : Type} (A ρ v vmin vmaxEdge vmaxGhost : ℝ) (T smallGroups bigGroups patternCount : ℕ) (hA : 0 ≤ A) (tag : Option (H ⊕ K)) : 0 ≤ physicalMixedWordStepEnergy A ρ v vmin vmaxEdge vmaxGhost T smallGroups bigGroups patternCount tag := by cases tag with | none => exact zero_le_one | some tag => cases tag with | inl j => exact pow_nonneg (Real.exp_pos _).le _ | inr k => exact mul_nonneg (sq_nonneg _) (mul_nonneg (pow_nonneg hA _) (pow_nonneg (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmaxEdge T) _)) theorem exists_physical_mixed_word_path_energy_bound {qsmall vs : ℝ} (hq0 : 0 ≤ qsmall) (hq1 : qsmall < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ Ccond : ℝ, 1 ≤ Ccond ∧ ∀ (H K S G I : Type) [Fintype I] [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : G → ℕ) (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (Vedge Vghost : G → ℝ) (Vs : S → ℝ), (∀ s, vs ≤ Vs s) → (∀ k a, 0 ≤ ω k a) → (∀ k, ∑ a, ω k a ≤ 1) → ∀ (v vmin vmaxEdge vmaxGhost : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ Vedge g) → (∀ g, Vedge g ≤ vmaxEdge) → (∀ g, 0 ≤ Vghost g) → (∀ g, Vghost g ≤ vmaxGhost) → (∀ g p, 0 < μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → (∀ j, 0 ≤ qghost j) → (∀ j, qghost j ≤ 1) → (∀ j, qghost j / ρ ^ 2 + ((1 - qghost j) / ρ) / v ≤ 1) → (∀ j g, qghost j / ρ ^ 2 + ((1 - qghost j) * Vghost g / ρ) / v ≤ 1) → ∀ (T : ℕ), (∀ k g, (shared k g)ᶜ.card ≤ T) → ∀ (steps : List (Option (H ⊕ K))) (phase : ∀ s, PhysicalMixedWordPath n shared B A Δ D kbig steps s → ℂ), (∀ s p, ‖phase s p‖ ≤ 1) → ∀ (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => f (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalMixedWordVaryingGhostAction n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall steps phase f) ≤ (steps.map (physicalMixedWordStepEnergy Ccond ρ v vmin vmaxEdge vmaxGhost T (Fintype.card S) (Fintype.card G) (Fintype.card I))).prod * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by obtain ⟨Ccond, hCcond, hedge⟩ := exists_physical_mixed_word_edge_energy_bound hq0 hq1 hvs ell refine ⟨Ccond, hCcond, ?_⟩ intro H K S G I _ _ dS _ dG cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ n _ J M shared B A _ Δ D kbig ω μ qghost ρ Vedge Vghost Vs hVs hω hωmass v vmin vmaxEdge vmaxGhost hρ0 hρ1 hv hvmin hVlo hVhi hVg0 hVghi hμ hmass hqg0 hqg1 hD hC T ht steps phase hphase f hf have hVs0 : ∀ s, 0 < Vs s := fun s => hvs.trans_le (hVs s) have hμ0 : ∀ g p, 0 ≤ μ g p := fun g p => (hμ g p).le have hVe0 : ∀ g, 0 ≤ Vedge g := fun g => (hvmin.trans_le (hVlo g)).le apply physical_mixed_word_varying_ghost_path_energy_of_local n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall hVs0 hμ0 (physicalMixedWordStepEnergy Ccond ρ v vmin vmaxEdge vmaxGhost T (Fintype.card S) (Fintype.card G) (Fintype.card I)) (physical_mixed_word_step_energy_nonneg Ccond ρ v vmin vmaxEdge vmaxGhost T (Fintype.card S) (Fintype.card G) (Fintype.card I) (zero_le_one.trans hCcond)) ?_ ?_ steps phase hphase f hf · intro tag F hF cases tag with | none => erw [physical_mixed_word_positive_permutation_eq] exact physical_small_big_joint_average_memory_symmetric F hF | some tag => cases tag with | inl j => erw [physical_mixed_word_positive_ghost_eq n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall hμ0 j (hqg0 j) F] exact physical_small_big_ghost_one_memory_symmetric _ _ _ _ M B F hF | inr k => erw [physical_mixed_word_positive_edge_eq n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall hVs0 hω hμ0 hρ0.le hVe0 k F] intro small x g σ dsimp only apply sum_congr rfl intro i _ exact physical_small_big_path_positive_edge_symmetric n shared B A (Δ k) (D k) (kbig k) ω μ qghost ρ Vedge Vghost Vs qsmall hVs0 hω hμ0 hρ0.le hVe0 i F hF small x g σ · intro tag F hF cases tag with | none => erw [physical_mixed_word_positive_permutation_eq] simp only [physicalMixedWordStepEnergy, one_mul] convert physical_small_big_joint_average_energy_le Vs hVs0 μ (fun g => unrestrictedResidueWeight (μ g)) hμ0 (fun g z => hμ0 g z.1) F using 1 <;> rfl | some tag => cases tag with | inl j => erw [physical_mixed_word_positive_ghost_eq n shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs qsmall hμ0 j (hqg0 j) F] exact physical_small_big_absolute_ghost_energy_le_uniform n Vs hVs0 μ (qghost j) ρ Vghost v vmaxGhost M B hμ hmass (hqg0 j) (hqg1 j) hρ0 hVg0 hVghi (zero_lt_one.trans hv) (hD j) (hC j) F hF | inr k => exact hedge H K S G I Ps P n J M shared B A Δ D kbig ω μ qghost ρ Vedge Vghost Vs hVs hω hωmass v vmin vmaxEdge hρ0 hρ1 hv hvmin hVlo hVhi hμ0 hmass T ht k F hF end Bounty end -- Source module: RootCapCostParameters section /- Concrete group, energy, and mass parameters for the original cap error. -/ /- Fixed group costs and initial masses have polynomial growth. -/ open Finset namespace Bounty theorem root_group_energy_polynomial {L D C P a e g : ℝ} (hL : 1 ≤ L) (hD : 1 ≤ D) (hP : 0 ≤ P) (ha : 0 ≤ a) (haD : a ≤ D) (he : 0 ≤ e) (heD : e ≤ D) (hg : 0 ≤ g) (hgD : g ≤ D) (s m p : ℕ) (hs : (s : ℝ) ≤ C*Real.log L) (hm : (m : ℝ) ≤ C*Real.log L) (hp : (p : ℝ) ≤ L^P) : g^m ≤ L^(2*P+3*C*Real.log D) ∧ (p : ℝ)^2*(a^(2*s)*e^m) ≤ L^(2*P+3*C*Real.log D) := by have hL0 : 0 < L := zero_lt_one.trans_le hL have hCm : 0 ≤ C*Real.log L := (Nat.cast_nonneg m).trans hm have hthree : (m : ℝ) ≤ (3*C)*Real.log L := by nlinarith have htotal : ((2*s+m : ℕ) : ℝ) ≤ (3*C)*Real.log L := by push_cast nlinarith have hbase := constant_pow_le_rpow_of_log_bound hD hL0 (2*s+m) htotal have hgm := constant_pow_le_rpow_of_log_bound hD hL0 m hthree have hplain : L^((3*C)*Real.log D) ≤ L^(2*P+3*C*Real.log D) := Real.rpow_le_rpow_of_exponent_le hL (by nlinarith) constructor · exact (pow_le_pow_left₀ hg hgD m).trans (hgm.trans hplain) · have hp2 : (p : ℝ)^2 ≤ L^(2*P) := by calc _ ≤ (L^P)^2 := pow_le_pow_left₀ (Nat.cast_nonneg p) hp 2 _ = _ := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL0.le]; congr 1; ring have hprod : a^(2*s)*e^m ≤ D^(2*s+m) := by rw [pow_add] exact mul_le_mul (pow_le_pow_left₀ ha haD _) (pow_le_pow_left₀ he heD _) (pow_nonneg he _) (pow_nonneg (zero_le_one.trans hD) _) calc _ ≤ L^(2*P)*L^((3*C)*Real.log D) := mul_le_mul hp2 (hprod.trans hbase) (mul_nonneg (pow_nonneg ha _) (pow_nonneg he _)) (Real.rpow_nonneg hL0.le _) _ = _ := by rw [← Real.rpow_add hL0] theorem root_initial_mass_polynomial {G : Type*} [Fintype G] {L C : ℝ} (hL : 0 < L) (k : ℕ) (mass : G → ℝ) (hmass : ∀ g, 0 ≤ mass g ∧ mass g ≤ 2) (hgroups : (Fintype.card G : ℝ) ≤ C*Real.log L) : (∏ g, mass g^k) ≤ L^((C*(k : ℝ))*Real.log 2) := by have hexp : ((k*Fintype.card G : ℕ) : ℝ) ≤ (C*(k : ℝ))*Real.log L := by push_cast nlinarith [mul_le_mul_of_nonneg_left hgroups (Nat.cast_nonneg k)] calc _ ≤ ∏ _g : G, (2 : ℝ)^k := by apply Finset.prod_le_prod₀ · intro g _; exact pow_nonneg (hmass g).1 k · intro g _; exact pow_le_pow_left₀ (hmass g).1 (hmass g).2 k _ = (2 : ℝ)^(k*Fintype.card G) := by simp [← pow_mul] _ ≤ _ := constant_pow_le_rpow_of_log_bound (by norm_num) hL _ hexp theorem root_moment_length_and_loss {L C : ℝ} (hL : 1 ≤ L) (M T : ℕ) (hM : (M : ℝ) ≤ C*Real.log L) : (4*(2*Nat.ceil (L^(13/25 : ℝ)))+1 : ℕ) ≤ 17*L^(13/25 : ℝ) ∧ ((2*Nat.ceil (L^(13/25 : ℝ))*(T*M) : ℕ) : ℝ) ≤ (4*(T : ℝ)*C)*L^(13/25 : ℝ)*Real.log L := by have hL0 : 0 < L := zero_lt_one.trans_le hL have hP : 1 ≤ L^(13/25 : ℝ) := Real.one_le_rpow hL (by norm_num) have hceil : (Nat.ceil (L^(13/25 : ℝ)) : ℝ) ≤ 2*L^(13/25 : ℝ) := by have h := Nat.ceil_lt_add_one (Real.rpow_nonneg hL0.le (13/25 : ℝ)) linarith constructor · push_cast nlinarith · push_cast have hTm := mul_le_mul_of_nonneg_left hM (Nat.cast_nonneg T) have hfirst := mul_le_mul_of_nonneg_right hceil (mul_nonneg (Nat.cast_nonneg T) (Nat.cast_nonneg M)) have hsecond := mul_le_mul_of_nonneg_left hTm (Real.rpow_nonneg hL0.le (13/25 : ℝ)) nlinarith end Bounty /- Polynomial bounds for the actual mixed-word step energies. -/ namespace Bounty theorem physical_mixed_word_step_energy_polynomial {H K : Type} {L D C P A ρ v vmin vmaxEdge vmaxGhost : ℝ} (hL : 1 ≤ L) (hD : 1 ≤ D) (hC : 0 ≤ C) (hP : 0 ≤ P) (hA : 0 ≤ A) (hAD : A ≤ D) (hghost : physicalGhostUniformEnergyBound ρ vmaxGhost v ≤ D) (T s m p : ℕ) (hedge : unrestrictedEdgeEnergyBound ρ v vmin vmaxEdge T ≤ D) (hs : (s : ℝ) ≤ C*Real.log L) (hm : (m : ℝ) ≤ C*Real.log L) (hp : (p : ℝ) ≤ L^P) (tag : Option (H ⊕ K)) : 0 ≤ physicalMixedWordStepEnergy A ρ v vmin vmaxEdge vmaxGhost T s m p tag ∧ physicalMixedWordStepEnergy A ρ v vmin vmaxEdge vmaxGhost T s m p tag ≤ L^(2*P+3*C*Real.log D) := by refine ⟨physical_mixed_word_step_energy_nonneg A ρ v vmin vmaxEdge vmaxGhost T s m p hA tag, ?_⟩ have hcost := root_group_energy_polynomial hL hD hP hA hAD (unrestrictedEdgeEnergyBound_nonneg ρ v vmin vmaxEdge T) hedge (Real.exp_pos _).le hghost s m p hs hm hp have hlogD : 0 ≤ Real.log D := Real.log_nonneg hD cases tag with | none => exact Real.one_le_rpow hL (by positivity) | some tag => cases tag with | inl j => exact hcost.1 | inr k => exact hcost.2 end Bounty /- Absorption of the actual mixed-word cap cost at the original moment power. -/ open Filter namespace Bounty theorem full_memory_edge_count_le_length {H K : Type*} (steps : List (Option (H ⊕ K))) : fullMemoryEdgeCount steps ≤ steps.length := by induction steps with | nil => simp [fullMemoryEdgeCount] | cons x xs ih => have hx : fullMemoryEdgeIndicator x ≤ 1 := by cases x with | none => simp [fullMemoryEdgeIndicator] | some x => cases x <;> simp [fullMemoryEdgeIndicator] simpa [fullMemoryEdgeCount, List.length_cons, Nat.add_comm] using Nat.add_le_add hx ih theorem eventually_root_mixed_cap_cost_bound {D C P B F A ρ v vmin vmaxEdge vmaxGhost : ℝ} (hD : 1 ≤ D) (hC : 0 ≤ C) (hP : 0 ≤ P) (hB : 0 ≤ B) (hF : 0 ≤ F) (hA : 0 ≤ A) (hAD : A ≤ D) (hghost : physicalGhostUniformEnergyBound ρ vmaxGhost v ≤ D) (T k : ℕ) (hedge : unrestrictedEdgeEnergyBound ρ v vmin vmaxEdge T ≤ D) : ∀ᶠ L : ℝ in atTop, ∀ b s m p : ℕ, L ≤ (b : ℝ) → (s : ℝ) ≤ C*Real.log L → (m : ℝ) ≤ C*Real.log L → (p : ℝ) ≤ L^P → ∀ (H K : Type) (steps : List (Option (H ⊕ K))), (steps.length : ℝ) ≤ 17*L^(13/25 : ℝ) → ∀ phaseBound : ℝ, 0 ≤ phaseBound → phaseBound ≤ L^B → ∀ mass : Fin m → ℝ, (∀ g, 0 ≤ mass g ∧ mass g ≤ 2) → phaseBound^steps.length * ((2 : ℝ)^(b+1-fullMemoryEdgeCount steps*(T*m)))⁻¹ * Real.sqrt (steps.map (physicalMixedWordStepEnergy A ρ v vmin vmaxEdge vmaxGhost T s m p)).prod * (∏ g, mass g^k) ≤ (L^(-F))^(2*Nat.ceil (L^(13/25 : ℝ))) := by have hlogD : 0 ≤ Real.log D := Real.log_nonneg hD have hE : 0 ≤ 2*P+3*C*Real.log D := by positivity have hM : 0 ≤ (C*(k : ℝ))*Real.log 2 := by positivity have hLoss : 0 ≤ 17*(T : ℝ)*C := by positivity filter_upwards [eventually_root_cap_weighted_moment_bound (C := 17) hLoss hB hE hM hF, eventually_ge_atTop (1 : ℝ)] with L hmain hL intro b s m p hb hs hm hp H K steps hlen phaseBound hphase hphasepow mass hmass have hL0 : 0 < L := zero_lt_one.trans_le hL have hmasspow : (∏ g, mass g^k) ≤ L^((C*(k : ℝ))*Real.log 2) := root_initial_mass_polynomial hL0 k mass hmass (by simpa using hm) have hmass0 : 0 ≤ ∏ g, mass g^k := Finset.prod_nonneg fun g _ => pow_nonneg (hmass g).1 k have hcount : (fullMemoryEdgeCount steps : ℝ) ≤ 17*L^(13/25 : ℝ) := (Nat.cast_le.mpr (full_memory_edge_count_le_length steps)).trans hlen have hloss : ((fullMemoryEdgeCount steps*(T*m) : ℕ) : ℝ) ≤ (17*(T : ℝ)*C)*L^(13/25 : ℝ)*Real.log L := by push_cast have hTm := mul_le_mul_of_nonneg_left hm (Nat.cast_nonneg T) have hfirst := mul_le_mul_of_nonneg_right hcount (mul_nonneg (Nat.cast_nonneg T) (Nat.cast_nonneg m)) have hsecond := mul_le_mul_of_nonneg_left hTm (show 0 ≤ 17*L^(13/25 : ℝ) by positivity) nlinarith exact hmain b (fullMemoryEdgeCount steps*(T*m)) hb hloss _ steps _ hlen (fun x _ => physical_mixed_word_step_energy_polynomial hL hD hC hP hA hAD hghost T s m p hedge hs hm hp x) phaseBound (∏ g, mass g^k) hphase hphasepow hmass0 hmasspow end Bounty end -- Source module: PhysicalGroupResidueReadout section /- Exact reindexing of the original selected-group residue average into the residue vectors used by the mixed-state measure. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalGroupResidueVectorEquiv {G : Type*} [Fintype G] (P : G → Finset ℕ) (groups : Finset G) : PhysicalGroupResidues P groups ≃ PhysicalResidues (fun g : ↥groups => P g.val) where toFun := physicalGroupResidueVector invFun r a := r ((physicalPrimeGroupEquiv P groups).symm a) left_inv r := by funext a; rfl right_inv r := by funext a; rfl theorem physical_group_residue_vector_sum {G : Type*} [Fintype G] (P : G → Finset ℕ) (groups : Finset G) [Fintype (PhysicalGroupResidues P groups)] [Fintype (PhysicalResidues (fun g : ↥groups => P g.val))] (F : PhysicalResidues (fun g : ↥groups => P g.val) → ℂ) : (∑ r : PhysicalGroupResidues P groups, F (physicalGroupResidueVector r)) = ∑ r, F r := (physicalGroupResidueVectorEquiv P groups).sum_comp F theorem physical_group_residue_factor_eq {G : Type*} [Fintype G] (P : G → Finset ℕ) (groups : Finset G) : (∏ a : ↥(physicalPrimeGroups P groups), 1 / (a.val.2.val : ℝ)) = ∏ p : PhysicalPrime (fun g : ↥groups => P g.val), 1 / (p.2.val : ℝ) := ((physicalPrimeGroupEquiv P groups).prod_comp (fun a => 1 / (a.val.2.val : ℝ))).symm theorem physical_group_residue_weighted_sum {G : Type*} [Fintype G] (P : G → Finset ℕ) (groups : Finset G) [Fintype (PhysicalGroupResidues P groups)] [Fintype (PhysicalResidues (fun g : ↥groups => P g.val))] (F : PhysicalResidues (fun g : ↥groups => P g.val) → ℂ) : (∑ r : PhysicalGroupResidues P groups, ((∏ a : ↥(physicalPrimeGroups P groups), 1 / (a.val.2.val : ℝ) : ℝ) : ℂ) * F (physicalGroupResidueVector r)) = ∑ r : PhysicalResidues (fun g : ↥groups => P g.val), ((∏ p : PhysicalPrime (fun g : ↥groups => P g.val), 1 / (p.2.val : ℝ) : ℝ) : ℂ) * F r := by rw [physical_group_residue_factor_eq, ← mul_sum, physical_group_residue_vector_sum, mul_sum] end Bounty end -- Source module: MixedInitialVacuumPairing section /- Exact injective initial marks and an arbitrary bounded boundary phase are controlled in the product measure, without imposing symmetry on the phase. -/ open Finset open scoped Classical namespace Bounty theorem mixed_initial_vacuum_pairing_le {T G : Type*} [Fintype T] [Fintype G] [DecidableEq G] {P : G → Finset ℕ} {Z : G → Type*} [∀ g, Fintype (Z g)] {J ell B : ℕ} (C : G → Finset (Fin J)) (ω : T → ℝ) (hω : ∀ t, 0 ≤ ω t) (hωsum : ∑ t, ω t ≤ 1) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (empty : ∀ g, BoundedOrderedTuple (Z g) B) (hempty : ∀ g, (empty g).1.val = 0) (boundary : T → ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B → ℂ) (hb : ∀ t x, ‖boundary t x‖ ≤ 1) (F : T × ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B → ℂ) : ‖∑ t, (ω t : ℂ) * ∑ L : PhysicalMarkLists P J ell, ((∏ g, ∏ i : PhysicalSlots J ell, μ g (L g i) : ℝ) : ℂ) * (boundary t (physicalFullMemoryState C L empty) * F (t, physicalFullMemoryState C L empty))‖ ≤ Real.sqrt (∏ g, (∑ p, μ g p) ^ (J + ell)) * cleanActiveNorm (fun s => ω s.1 * productMemoryWeight μ ν s.2) F := by let mass := ∏ g, (∑ p, μ g p) ^ (J + ell) have hm : 0 ≤ mass := prod_nonneg fun g _ => pow_nonneg (sum_nonneg fun p _ => hμ g p) _ let value := fun t => ∑ L : PhysicalMarkLists P J ell, ((∏ g, ∏ i : PhysicalSlots J ell, μ g (L g i) : ℝ) : ℂ) * (boundary t (physicalFullMemoryState C L empty) * F (t, physicalFullMemoryState C L empty)) have he (t : T) : 0 ≤ finiteWeightedEnergy (productMemoryWeight μ ν) (fun x => F (t, x)) := sum_nonneg fun x _ => mul_nonneg (productMemoryWeight_nonneg μ ν hμ hν x) (sq_nonneg _) have hlocal (t : T) : ‖value t‖ ^ 2 ≤ mass * finiteWeightedEnergy (productMemoryWeight μ ν) (fun x => F (t, x)) := by have henergy := (physical_full_state_energy_le C μ ν hμ hν (fun x => boundary t x * F (t, x))).trans (finiteWeightedEnergy_le_of_norm_le (productMemoryWeight μ ν) (productMemoryWeight_nonneg μ ν hμ hν) (fun x => boundary t x * F (t, x)) (fun x => F (t, x)) (fun x => by rw [norm_mul] exact (mul_le_mul_of_nonneg_right (hb t x) (norm_nonneg _)).trans_eq (one_mul _))) exact (physical_mark_vacuum_pairing_energy_le μ ν hμ hν empty hempty (fun L q => boundary t (physicalFullMemoryState C L q) * F (t, physicalFullMemoryState C L q))).trans ((mul_le_mul_of_nonneg_left henergy (physical_mark_mass_nonneg μ hμ)).trans (mul_le_mul_of_nonneg_right (physical_mark_mass_le μ hμ) (he t))) have henergy : finiteWeightedEnergy (fun s => ω s.1 * productMemoryWeight μ ν s.2) F = ∑ t, ω t * finiteWeightedEnergy (productMemoryWeight μ ν) (fun x => F (t, x)) := by unfold finiteWeightedEnergy rw [Fintype.sum_prod_type] simp only [mul_assoc, mul_sum] have hsq : ‖∑ t, (ω t : ℂ) * value t‖ ^ 2 ≤ mass * finiteWeightedEnergy (fun s => ω s.1 * productMemoryWeight μ ν s.2) F := by refine (finite_weighted_sum_cauchy univ ω (fun t _ => hω t) value).trans ?_ calc (∑ t, ω t) * ∑ t, ω t * ‖value t‖ ^ 2 ≤ ∑ t, ω t * ‖value t‖ ^ 2 := by simpa only [one_mul] using mul_le_mul_of_nonneg_right hωsum (sum_nonneg fun t _ => mul_nonneg (hω t) (sq_nonneg _)) _ ≤ ∑ t, ω t * (mass * finiteWeightedEnergy (productMemoryWeight μ ν) (fun x => F (t, x))) := sum_le_sum fun t _ => mul_le_mul_of_nonneg_left (hlocal t) (hω t) _ = _ := by rw [henergy, mul_sum]; apply sum_congr rfl; intro t _; ring have hs := Real.sqrt_le_sqrt hsq rw [Real.sqrt_sq (norm_nonneg _), Real.sqrt_mul hm] at hs exact hs end Bounty end -- Source module: PhysicalSmallBigVacuumMass section /- The terminal empty-memory vector has only the unrestricted active mass; normalized small residues contribute at most one. -/ open Finset open scoped Classical namespace Bounty theorem finite_product_vacuum_norm {T G : Type*} [Fintype T] [Fintype G] [DecidableEq G] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] (ω : T → ℝ) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (M : G → ℕ) (B : ℕ) : cleanActiveNorm (fun s : T × ProductBoundedOrderedState P Z M B => ω s.1 * productMemoryWeight μ ν s.2) (fun s => fullMemoryVacuum s.2) = Real.sqrt ((∑ t, ω t) * ∏ g, (∑ p, μ g p) ^ M g) := by unfold cleanActiveNorm congr 1 rw [Fintype.sum_prod_type] simp only [mul_assoc, ← mul_sum] change (∑ t, ω t * finiteWeightedEnergy (productMemoryWeight μ ν) (fullMemoryVacuum (M := M) (B := B))) = _ rw [fullMemoryVacuum_energy, sum_mul] theorem physical_small_big_normalized_vacuum_norm_le {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P Z : G → Type*} [∀ g, Fintype (P g)] [∀ g, Fintype (Z g)] {J ell : ℕ} (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (hMass : ∀ s, ∑ p ∈ Ps s, 1 / (p : ℝ) = Vs s) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (hμ : ∀ g p, 0 ≤ μ g p) (M : G → ℕ) (B : ℕ) : cleanActiveNorm (physicalSmallBigNormalizedMeasure (P := Ps) (J := J) (ell := ell) Vs (productMemoryWeight μ ν)) (fun s => fullMemoryVacuum (M := M) (B := B) s.2) ≤ Real.sqrt (∏ g, (∑ p, μ g p) ^ M g) := by change cleanActiveNorm (fun s : PhysicalBareResidueState Ps J ell × ProductBoundedOrderedState P Z M B => physicalResidueInitialMass Vs s.1 * productMemoryWeight μ ν s.2) (fun s => fullMemoryVacuum s.2) ≤ _ rw [finite_product_vacuum_norm (fun s : PhysicalBareResidueState Ps J ell => physicalResidueInitialMass Vs s) μ ν M B] apply Real.sqrt_le_sqrt exact (mul_le_mul_of_nonneg_right (physical_residue_initial_mass_total Vs hVs hMass) (prod_nonneg fun g _ => pow_nonneg (sum_nonneg fun p _ => hμ g p) _)).trans_eq (one_mul _) end Bounty end -- Source module: PhysicalSmallBigInitialReadout section /- The original normalized small-residue average and injective initial big marks admit a scalar readout with one unrestricted active-mass factor. -/ open Finset open scoped Classical namespace Bounty section Readout variable {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Finset ℕ} {Z : G → Type*} [∀ g, Fintype (Z g)] {J ell B : ℕ} (Vs : S → ℝ) (C : G → Finset (Fin J)) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (empty : ∀ g, BoundedOrderedTuple (Z g) B) (boundary : PhysicalBareResidueState Ps J ell → ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) → ℂ) noncomputable def physicalSmallBigInitialReadout : ℂ := ∑ s : PhysicalBareResidueState Ps J ell, (physicalResidueInitialMass Vs s : ℂ) * ∑ L : PhysicalMarkLists P J ell, ((∏ g, ∏ i : PhysicalSlots J ell, μ g (L g i) : ℝ) : ℂ) * (boundary s (physicalFullMemoryState C L empty) * F (s, physicalFullMemoryState C L empty)) theorem physical_small_big_initial_readout_norm_le (hVs : ∀ s, 0 < Vs s) (hMass : ∀ s, ∑ p ∈ Ps s, 1 / (p : ℝ) = Vs s) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (hempty : ∀ g, (empty g).1.val = 0) (hb : ∀ s x, ‖boundary s x‖ ≤ 1) : ‖physicalSmallBigInitialReadout Vs C μ empty boundary F‖ ≤ Real.sqrt (∏ g, (∑ p, μ g p) ^ (J + ell)) * cleanActiveNorm (physicalSmallBigNormalizedMeasure Vs (productMemoryWeight μ ν)) F := mixed_initial_vacuum_pairing_le C (fun s : PhysicalBareResidueState Ps J ell => physicalResidueInitialMass Vs s) (physical_residue_initial_mass_nonneg Vs hVs) (physical_residue_initial_mass_total Vs hVs hMass) μ ν hμ hν empty hempty boundary hb F theorem physical_small_big_initial_readout_operator_bound (hVs : ∀ s, 0 < Vs s) (hMass : ∀ s, ∑ p ∈ Ps s, 1 / (p : ℝ) = Vs s) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (hempty : ∀ g, (empty g).1.val = 0) (hb : ∀ s x, ‖boundary s x‖ ≤ 1) {K : ℝ} (hK : 0 ≤ K) (hF : cleanActiveNorm (physicalSmallBigNormalizedMeasure Vs (productMemoryWeight μ ν)) F ≤ K * cleanActiveNorm (physicalSmallBigNormalizedMeasure (P := Ps) (J := J) (ell := ell) Vs (productMemoryWeight μ ν)) (fun s => fullMemoryVacuum (M := fun _ => J + ell) (B := B) s.2)) : ‖physicalSmallBigInitialReadout Vs C μ empty boundary F‖ ≤ K * ∏ g, (∑ p, μ g p) ^ (J + ell) := by let mass := ∏ g, (∑ p, μ g p) ^ (J + ell) have hm : 0 ≤ mass := prod_nonneg fun g _ => pow_nonneg (sum_nonneg fun p _ => hμ g p) _ have hv := physical_small_big_normalized_vacuum_norm_le (J := J) (ell := ell) Vs hVs hMass μ ν hμ (fun _ => J + ell) B have h := physical_small_big_initial_readout_norm_le Vs C μ ν empty boundary F hVs hMass hμ hν hempty hb refine h.trans ((mul_le_mul_of_nonneg_left hF (Real.sqrt_nonneg _)).trans ?_) calc _ ≤ Real.sqrt mass * (K * Real.sqrt mass) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hv hK) (Real.sqrt_nonneg _) _ = K * mass := by nlinarith [Real.sq_sqrt hm] end Readout end Bounty end -- Source module: PhysicalResidueComplexReadout section /- The exact complex readout of a function supported on valid small residue/mark states, retaining the original uniform residue factor. -/ open Finset open scoped Classical namespace Bounty theorem physical_residue_complex_sum_of_supported {S : Type*} [Fintype S] [DecidableEq S] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (F : PhysicalResidues P → PhysicalMarkLists P J ell → ℂ) (hF : ∀ r L, ¬ physicalResidueMarksValid r L → F r L = 0) : (∑ s : PhysicalBareResidueState P J ell, (physicalResidueInitialMass V s : ℂ) * F s.1 s.2) = (physicalStateMass V J ell : ℂ) * ∑ r : PhysicalResidues P, ((∏ p : PhysicalPrime P, 1 / (p.2.val : ℝ) : ℝ) : ℂ) * ∑ L : PhysicalMarkLists P J ell, F r L := by have hpoint (r : PhysicalResidues P) (L : PhysicalMarkLists P J ell) : (physicalResidueInitialMass V (r, L) : ℂ) * F r L = (physicalStateMass V J ell : ℂ) * (((∏ p : PhysicalPrime P, 1 / (p.2.val : ℝ) : ℝ) : ℂ) * F r L) := by by_cases h : physicalResidueMarksValid r L · rw [physical_residue_initial_mass_of_valid V r L h, Complex.ofReal_mul, mul_assoc] · rw [hF r L h, mul_zero, mul_zero, mul_zero] rw [Fintype.sum_prod_type] simp only [hpoint, mul_sum] end Bounty end -- Source module: PhysicalSmallBigRawReadout section /- The original normalized small-residue average and injective initial big marks admit a scalar readout with one unrestricted active-mass factor. -/ open Finset open scoped Classical namespace Bounty section Readout variable {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Finset ℕ} {Z : G → Type*} [∀ g, Fintype (Z g)] {J ell B : ℕ} (Vs : S → ℝ) (C : G → Finset (Fin J)) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (empty : ∀ g, BoundedOrderedTuple (Z g) B) (boundary : PhysicalBareResidueState Ps J ell → ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) → ℂ) omit [∀ g, Fintype (Z g)] in theorem physical_small_big_initial_readout_eq_raw (hF : ∀ r L x, ¬ physicalResidueMarksValid r L → F ((r, L), x) = 0) : physicalSmallBigInitialReadout Vs C μ empty boundary F = (physicalStateMass Vs J ell : ℂ) * ∑ r : PhysicalResidues Ps, ((∏ p : PhysicalPrime Ps, 1 / (p.2.val : ℝ) : ℝ) : ℂ) * ∑ Ls : PhysicalMarkLists Ps J ell, ∑ Lb : PhysicalMarkLists P J ell, ((∏ g, ∏ i : PhysicalSlots J ell, μ g (Lb g i) : ℝ) : ℂ) * (boundary (r, Ls) (physicalFullMemoryState C Lb empty) * F ((r, Ls), physicalFullMemoryState C Lb empty)) := by unfold physicalSmallBigInitialReadout refine physical_residue_complex_sum_of_supported Vs (fun r Ls => ∑ Lb : PhysicalMarkLists P J ell, ((∏ g, ∏ i : PhysicalSlots J ell, μ g (Lb g i) : ℝ) : ℂ) * (boundary (r, Ls) (physicalFullMemoryState C Lb empty) * F ((r, Ls), physicalFullMemoryState C Lb empty))) ?_ intro r L h apply sum_eq_zero intro Lb _ rw [hF r L _ h, mul_zero, mul_zero] end Readout end Bounty end -- Source module: PhysicalRootScalarReadout section /- The normalized original root scalar is its exact mixed-state readout. -/ open Finset Classical namespace Bounty section Scalar variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) noncomputable def physicalRootScalarVectorAction (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) : ℂ := physicalRootMixedAction (n := n) groups e patterns C hC k V q ζ K ((physicalGroupResidueVectorEquiv P groupsᶜ).symm s.1.1) θ (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ (fun (s : ↥groupsᶜ) => hP s.val) (fun (g : Fin M) => hP (e.symm g).val) (physical_root_group_pools_disjoint groups e hdis) fullMemoryVacuum s.1.2 s.2 theorem physical_root_mixed_scalar_average_eq_readout (hF : ∀ r L x, ¬ physicalResidueMarksValid r L → physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis ((r, L), x) = 0) : letI : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) (∑ r : PhysicalGroupResidues P groupsᶜ, ((∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ) : ℝ) : ℂ) * physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis) = physicalSmallBigInitialReadout (fun s : ↥groupsᶜ => V s.val) (fun _ : Fin M => ∅) (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩ / V (e.symm g).val) (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B) (fun _ _ => 1) (physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis) := by let : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) let ψ : PhysicalResidues (fun s : ↥groupsᶜ => P s.val) → ℂ := fun r => (physicalStateMass (fun s : ↥groupsᶜ => V s.val) J ell : ℂ) * ∑ Ls : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell, ∑ Lb : PhysicalMarkLists (fun g : Fin M => P (e.symm g).val) J ell, ((∏ g, ∏ i : PhysicalSlots J ell, β ⟨(e.symm g).val, Lb g i⟩ / V (e.symm g).val : ℝ) : ℂ) * physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis ((r, Ls), physicalFullMemoryState (fun _ : Fin M => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B)) calc _ = ∑ r : PhysicalResidues (fun s : ↥groupsᶜ => P s.val), ((∏ p : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), 1 / (p.2.val : ℝ) : ℝ) : ℂ) * ψ r := physical_group_residue_weighted_sum P groupsᶜ ψ _ = _ := by rw [physical_small_big_initial_readout_eq_raw _ _ _ _ _ _ hF] dsimp only [ψ] simp only [one_mul] conv_rhs => rw [mul_sum] apply sum_congr rfl intro r _ exact mul_left_comm _ _ _ end Scalar end Bounty end -- Source module: PhysicalRootCapAction section /- The original root scalar vector uses the genuine mixed word at every cap. -/ open Finset Classical namespace Bounty section Scalar variable {I : Type} {N M J ell n b B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) theorem physical_root_scalar_vector_action_unfold (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) : letI : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis s = physicalMixedWordPathAction (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalRootMixedPhase groups e patterns C hC k V ζ K θ (fun g p => β ⟨(e.symm g).val, p⟩) ρ (fun s => hP s.val) (fun g => hP (e.symm g).val) (physical_root_group_pools_disjoint groups e hdis)) (fun s => fullMemoryVacuum s.2) s := by let : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) unfold physicalRootScalarVectorAction physicalRootMixedAction dsimp only have hr : physicalGroupResidueVector ((physicalGroupResidueVectorEquiv P groupsᶜ).symm s.1.1) = s.1.1 := (physicalGroupResidueVectorEquiv P groupsᶜ).apply_symm_apply s.1.1 rw [hr] end Scalar end Bounty end -- Source module: PhysicalFullPhaseCap section /- Exact cap coherence of physical edge phases and original coefficients on nonzero support. -/ open Finset open scoped Classical namespace Bounty section Edge variable {N J ell b B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (h : b ≤ B) (L R : PhysicalMarkLists P J ell) (H : (g : Fin N) → Finset (P g)) (q : (g : Fin N) → BoundedOrderedTuple (UnrestrictedResidueParticle (fun p : P g => p.val)) b) variable (ω : ∀ _c : SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_full_endpoint_phase_cap (a : PhysicalFullEdgeEvent C k (physicalFullMemoryState C L q)) (hw : fullActiveEdgeEventWeight (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) b (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V (physicalFullMemoryState C L q) a ≠ 0) : physicalFullEndpointPhase C k L H (fun g => boundedMemoryCapEmbed h (q g)) ω μ ρ V a = physicalFullEndpointPhase C k L H q ω μ ρ V a := by have hb := fullActiveEdgeEventWeight_cap_of_ne_zero (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) h (physicalFullMemoryState C L q) ω μ ρ V a hw have hwB := ne_of_eq_of_ne hb.symm hw unfold physicalFullEndpointPhase erw [if_neg hwB, if_neg hw] rfl end Edge section Global variable {N J ell b B : ℕ} {P : Fin N → Finset ℕ} (C : Fin N → Finset (Fin J)) (k : ℤ) (h : b ≤ B) (H : (g : Fin N) → Finset (P g)) (ω : ∀ _c : SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C g)), PhysicalAuxLabels P C → ℝ) (μ : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem physical_full_global_edge_phase_cap (x : PhysicalFullBoundedState P J ell b) (a : PhysicalFullEdgeEvent C k x) (hw : fullActiveEdgeEventWeight (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C g)) b (fun _ => PhysicalAuxLabels P C) (physicalFullEdgeDelta C k) (physicalFullEdgeD C) ω μ ρ V x a ≠ 0) : physicalFullGlobalEdgePhase C k H ω μ ρ V (productStateCapEmbed h x) a = physicalFullGlobalEdgePhase C k H ω μ ρ V x a := by by_cases hx : FullActiveInjective x · obtain ⟨⟨L, q⟩, hL⟩ := (physicalFullStateEquiv C).surjective ⟨x, hx⟩ have he : physicalFullMemoryState C L q = x := congrArg Subtype.val hL subst x change physicalFullGlobalEdgePhase C k H ω μ ρ V (physicalFullMemoryState C L (fun g => boundedMemoryCapEmbed h (q g))) a = _ exact (physical_full_global_edge_phase_encode (B := B) C k H ω μ ρ V L (fun g => boundedMemoryCapEmbed h (q g)) a).trans ((physical_full_endpoint_phase_cap C k h L H q ω μ ρ V a hw).trans (physical_full_global_edge_phase_encode (B := b) C k H ω μ ρ V L q a).symm) · have hxB : ¬ FullActiveInjective (productStateCapEmbed h x) := hx unfold physicalFullGlobalEdgePhase erw [dif_neg hxB, dif_neg hx] end Global section Combined variable {I K : Type} {N J ell b B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (h : b ≤ B) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ζ : K → ℝ) (coeff : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (retention : I → ℝ) theorem physical_full_key_coefficient_phase_cap (tag : Option (I ⊕ K)) (x : PhysicalFullBoundedState P J ell b) (a : PhysicalFullLedgerEvent C k tag ((fun _ => ∅), x)) (hw : fullPermutationMixedEventWeight (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) b (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ω (fun g p => β g p / V g) retention ρ V tag x a ≠ 0) : physicalFullKeyCoefficientPhase C k ζ coeff tag (productStateCapEmbed h x) (fullPermutationMixedEventCapEmbed (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) h tag x a) = physicalFullKeyCoefficientPhase C k ζ coeff tag x a := by cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => dsimp only [physicalFullKeyCoefficientPhase, fullPermutationMixedEventCapEmbed] have ht := fullActiveEdgeEventTarget_cap_of_weight_ne_zero (fun g (p : P g) => p.val) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) (fun _ => PhysicalAuxLabels P (C j)) (physicalFullEdgeDelta (C j) (k j)) (physicalFullEdgeD (C j)) h x (ω j) (fun g p => β g p / V g) ρ V a hw exact congrArg (fun y : PhysicalFullBoundedState P J ell B => physicalActiveCoefficient (C j) (C j) (C j) (ζ j) (coeff j) (fun g => (x g).1) (fun g => (y g).1) a.1) ht.symm end Combined end Bounty end -- Source module: PhysicalFullLedgerPhaseCap section /- Exact phase and ledger transport with all original event data retained. -/ open scoped Classical namespace Bounty section Ledger variable {I K : Type} {N J ell b B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (h : b ≤ B) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (retention : I → ℝ) theorem physical_full_ledger_event_phase_cap (tag : Option (I ⊕ K)) (H : (g : Fin N) → Finset (P g)) (x : PhysicalFullBoundedState P J ell b) (a : PhysicalFullLedgerEvent C k tag (H, x)) (hw : fullPermutationMixedEventWeight (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) b (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ω (fun g p => β g p / V g) retention ρ V tag x a ≠ 0) : physicalFullLedgerEventPhase C k ω β ρ V tag (H, productStateCapEmbed h x) (fullPermutationMixedEventCapEmbed (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) h tag x a) = physicalFullLedgerEventPhase C k ω β ρ V tag (H, x) a := by cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => exact physical_full_global_edge_phase_cap (C j) (k j) h H (ω j) (fun g p => β g p / V g) ρ V x a hw theorem physical_full_combined_phase_cap (ζ : K → ℝ) (coeff : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (tag : Option (I ⊕ K)) (H : (g : Fin N) → Finset (P g)) (x : PhysicalFullBoundedState P J ell b) (a : PhysicalFullLedgerEvent C k tag (H, x)) (hw : fullPermutationMixedEventWeight (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) b (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) ω (fun g p => β g p / V g) retention ρ V tag x a ≠ 0) : physicalFullCombinedPhase C k ω β ρ V ζ coeff tag H (productStateCapEmbed h x) (fullPermutationMixedEventCapEmbed (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalFullEdgeDelta (C j) (k j)) (fun j => physicalFullEdgeD (C j)) h tag x a) = physicalFullCombinedPhase C k ω β ρ V ζ coeff tag H x a := by unfold physicalFullCombinedPhase rw [physical_full_ledger_event_phase_cap C k h ω β ρ V retention tag H x a hw, physical_full_key_coefficient_phase_cap C k h ω β ρ V ζ coeff retention tag x a hw] end Ledger section Update variable {I K : Type} {N b B : ℕ} {P : Fin N → Type} [∀ g, DecidableEq (P g)] (n : ∀ g, P g → ℕ) {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (A : ∀ k, SharedActiveLabels P (S k) → Type) (Δ D : ∀ k c, A k c → Fin N → ℤ) (h : b ≤ B) (ω : ∀ k c, A k c → ℝ) (μ : ∀ g, P g → ℝ) (q : I → ℝ) (ρ : ℝ) (V : Fin N → ℝ) theorem full_mixed_ledger_update_cap (tag : Option (I ⊕ K)) (H : (g : Fin N) → Finset (P g)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b) (a : FullPermutationMixedEvent n S b A Δ D tag x) (hw : fullPermutationMixedEventWeight n S b A Δ D ω μ q ρ V tag x a ≠ 0) : fullMixedLedgerUpdate n S B A Δ D tag H (productStateCapEmbed h x) (fullPermutationMixedEventCapEmbed n S A Δ D h tag x a) = fullMixedLedgerUpdate n S b A Δ D tag H x a := by cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => dsimp only [fullMixedLedgerUpdate, fullPermutationMixedEventCapEmbed] unfold fullEdgeLedgerUpdate rw [← fullActiveEdgeEventTarget_cap_of_weight_ne_zero n (S j) (A j) (Δ j) (D j) h x (ω j) μ ρ V a hw] rfl end Update end Bounty end -- Source module: FullParameterCap section /- Effective parameter transport commutes with the literal memory-cap embedding. -/ open scoped Classical namespace Bounty section Parameter variable {I K G : Type*} {P : G → Type*} (n : ∀ g, P g → ℕ) {M : G → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ Δ' D D' : ∀ k c, A k c → G → ℤ) (hΔ : ∀ k, Δ k = Δ' k) (hD : ∀ k c a g p, ((n g p : ℤ) ∣ D k c a g ↔ (n g p : ℤ) ∣ D' k c a g)) {b B : ℕ} (h : b ≤ B) theorem full_permutation_parameter_event_cap (tag : Option (I ⊕ K)) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b) (a : FullPermutationMixedEvent n S b A Δ D tag x) : fullPermutationParameterEventEquiv n S B A Δ Δ' D D' hΔ hD tag (productStateCapEmbed h x) (fullPermutationMixedEventCapEmbed n S A Δ D h tag x a) = fullPermutationMixedEventCapEmbed n S A Δ' D' h tag x (fullPermutationParameterEventEquiv n S b A Δ Δ' D D' hΔ hD tag x a) := by have he : Δ = Δ' := funext hΔ subst Δ' cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => rfl end Parameter end Bounty end -- Source module: PhysicalEffectivePhaseCap section /- Exact phase and ledger transport with all original event data retained. -/ open scoped Classical namespace Bounty section Effective variable {S K I : Type} [Fintype S] {N J ell b B : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) (C : K → Fin N → Finset (Fin J)) (d : K → PhysicalSharedLists Ps J) (k : K → ℤ) (h : b ≤ B) (ω : ∀ j, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (retention : I → ℝ) (ζ : K → ℝ) (coeff : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) theorem physical_effective_combined_phase_cap (tag : Option (I ⊕ K)) (H : (g : Fin N) → Finset (P g)) (x : PhysicalFullBoundedState P J ell b) (a : FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) b (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalMixedEdgeDelta (C j) (k j) (d j)) (fun j => physicalMixedEdgeD (C j) (d j)) tag x) (hw : fullPermutationMixedEventWeight (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) b (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalMixedEdgeDelta (C j) (k j) (d j)) (fun j => physicalMixedEdgeD (C j) (d j)) ω (fun g p => β g p / V g) retention ρ V tag x a ≠ 0) : physicalFullCombinedPhase C (fun j => k j * (physicalSharedProduct (d j) : ℕ)) ω β ρ V ζ coeff tag H (productStateCapEmbed h x) (physicalMixedEffectiveBigEventEquiv hPs hP hdis C d k B tag (productStateCapEmbed h x) (fullPermutationMixedEventCapEmbed (fun g (p : P g) => p.val) (fun j g => physicalFullSharedIndices (ell := ell) (C j g)) (fun j _ => PhysicalAuxLabels P (C j)) (fun j => physicalMixedEdgeDelta (C j) (k j) (d j)) (fun j => physicalMixedEdgeD (C j) (d j)) h tag x a)) = physicalFullCombinedPhase C (fun j => k j * (physicalSharedProduct (d j) : ℕ)) ω β ρ V ζ coeff tag H x (physicalMixedEffectiveBigEventEquiv hPs hP hdis C d k b tag x a) := by unfold physicalMixedEffectiveBigEventEquiv rw [full_permutation_parameter_event_cap] apply physical_full_combined_phase_cap C (fun j => k j * (physicalSharedProduct (d j) : ℕ)) h ω β ρ V retention ζ coeff tag H x rw [full_permutation_parameter_weight] exact hw end Effective end Bounty end -- Source module: PhysicalMixedProjectionSupport section /- Exact phase and ledger transport with all original event data retained. -/ open scoped Classical namespace Bounty section Projection variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) theorem physical_mixed_big_projection_weight_ne_zero (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (a : PhysicalMixedWordEvent n shared B A Δ D tag s) (hw : physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge tag s a ≠ 0) : fullPermutationMixedEventWeight n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key => ω key.2.1) μ qghost ρ Vb (physicalMixedBigEventTag n shared B A Δ D tag s a) s.2 (physicalMixedBigEventProjection n shared B A Δ D tag s a) ≠ 0 := by cases tag with | none => exact (mul_ne_zero_iff.mp hw).2 | some tag => cases tag with | inl j => exact hw | inr k => erw [physical_mixed_word_edge_weight_factor] at hw exact (mul_ne_zero_iff.mp hw).2 end Projection end Bounty end -- Source module: PhysicalMixedWordCapSupport section /- Supported event transport preserves every small coordinate while changing the big-memory cap. Target agreement is asserted only at nonzero weight. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G I : Type} [Fintype S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) {b B : ℕ} (h : b ≤ B) def physicalMixedWordCapEmbed (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) : PhysicalMixedWordEvent n shared b A Δ D tag s → PhysicalMixedWordEvent n shared B A Δ D tag (physicalSmallBigCapEmbed h s) := match tag with | none => id | some (.inl _) => coupledGhostEventCapEmbed h s.2 | some (.inr k) => fun e => ⟨e.1, e.2.1, (e.2.2.1, fullActiveEdgeEventCapEquiv n (shared e.1) (fun _ => Unit) (fun c _ => Δ k e.1 (physicalSharedPrefix s.1.2) c e.2.1) (fun c _ => D k e.1 (physicalSharedPrefix s.1.2) c e.2.1) h s.2 e.2.2.2)⟩ omit [Fintype S] [Fintype G] [DecidableEq G] [∀ g, Fintype (P g)] in theorem physicalMixedWordCapEmbed_injective (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) : Function.Injective (physicalMixedWordCapEmbed n shared A Δ D h tag s) := by cases tag with | none => exact Function.injective_id | some tag => cases tag with | inl j => exact coupledGhostEventCapEmbed_injective h s.2 | inr k => intro e f he exact he variable (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) omit [∀ g, Fintype (P g)] in theorem physicalMixedWordCapEmbed_target (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (e : PhysicalMixedWordEvent n shared b A Δ D tag s) (hw : physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge tag s e ≠ 0) : physicalMixedWordTarget n shared B A Δ D kbig tag (physicalSmallBigCapEmbed h s) (physicalMixedWordCapEmbed n shared A Δ D h tag s e) = physicalSmallBigCapEmbed h (physicalMixedWordTarget n shared b A Δ D kbig tag s e) := by cases tag with | none => rfl | some tag => cases tag with | inl j => exact Prod.ext rfl (coupledGhostEventCapEmbed_target_of_ne_zero h (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g => physicalGhostTermination (n g) (qghost j) ρ) (fun g => physicalGhostBirth (n g) (qghost j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) s.2 e hw) | inr k => have hb : fullActiveEdgeEventWeight n (shared e.1) b (fun _ => Unit) (fun c _ => Δ k e.1 (physicalSharedPrefix s.1.2) c e.2.1) (fun c _ => D k e.1 (physicalSharedPrefix s.1.2) c e.2.1) (fun _ _ => 1) μ ρ V s.2 e.2.2.2 ≠ 0 := by intro hz apply hw simp only [physicalMixedWordWeight, physicalSmallBigPositiveWeight, physicalSmallBigFullWeight, hz, mul_zero, ite_self] exact Prod.ext rfl ((fullActiveEdgeEventTarget_cap_of_weight_ne_zero n (shared e.1) (fun _ => Unit) (fun c _ => Δ k e.1 (physicalSharedPrefix s.1.2) c e.2.1) (fun c _ => D k e.1 (physicalSharedPrefix s.1.2) c e.2.1) h s.2 (fun _ _ => 1) μ ρ V e.2.2.2 hb).symm) omit [∀ g, Fintype (P g)] in theorem physicalMixedWordCapEmbed_weight (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (hs : productTotalMemory s.2 ≤ b) (e : PhysicalMixedWordEvent n shared b A Δ D tag s) : physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge tag s e = if productTotalMemory (physicalMixedWordTarget n shared B A Δ D kbig tag (physicalSmallBigCapEmbed h s) (physicalMixedWordCapEmbed n shared A Δ D h tag s e)).2 ≤ b then physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ V Vs qedge tag (physicalSmallBigCapEmbed h s) (physicalMixedWordCapEmbed n shared A Δ D h tag s e) else 0 := by cases tag with | none => change _ = if productTotalMemory (fullActivePermutation e.2 (productStateCapEmbed h s.2)) ≤ b then _ else _ rw [fullActivePermutation_total_memory, productStateCapEmbed_totalMemory, if_pos hs] rfl | some tag => cases tag with | inl j => exact coupledGhostEventCapEmbed_weight h (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g => physicalGhostTermination (n g) (qghost j) ρ) (fun g => physicalGhostBirth (n g) (qghost j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) s.2 hs e | inr k => have he := fullActiveEdgeEventWeight_cap n (shared e.1) (fun _ => Unit) (fun c _ => Δ k e.1 (physicalSharedPrefix s.1.2) c e.2.1) (fun c _ => D k e.1 (physicalSharedPrefix s.1.2) c e.2.1) h s.2 (fun _ _ => 1) μ ρ V hs e.2.2.2 dsimp only [physicalMixedWordWeight, physicalMixedWordTarget, physicalSmallBigTarget, physicalSmallBigFullTarget, physicalSmallBigPositiveWeight, physicalSmallBigFullWeight, physicalMixedWordCapEmbed, physicalSmallBigCapEmbed] rw [he] (split_ifs <;> simp_all only [mul_zero]); rfl omit [∀ g, Fintype (P g)] in theorem physicalMixedWordCapEmbed_surjective_of_ne_zero (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (e : PhysicalMixedWordEvent n shared B A Δ D tag (physicalSmallBigCapEmbed h s)) (hw : physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ V Vs qedge tag (physicalSmallBigCapEmbed h s) e ≠ 0) (ht : productTotalMemory (physicalMixedWordTarget n shared B A Δ D kbig tag (physicalSmallBigCapEmbed h s) e).2 ≤ b) : ∃ d : PhysicalMixedWordEvent n shared b A Δ D tag s, physicalMixedWordCapEmbed n shared A Δ D h tag s d = e := by cases tag with | none => exact ⟨e, rfl⟩ | some tag => cases tag with | inl j => exact coupledGhostEventCapEmbed_surjective_of_ne_zero h (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g => physicalGhostTermination (n g) (qghost j) ρ) (fun g => physicalGhostBirth (n g) (qghost j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) s.2 e hw ht | inr k => exact ⟨e, rfl⟩ omit [∀ g, Fintype (P g)] in theorem physicalMixedWord_supported_target (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (hs : productTotalMemory s.2 ≤ b) (e : PhysicalMixedWordEvent n shared b A Δ D tag s) (hw : physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge tag s e ≠ 0) : productTotalMemory (physicalMixedWordTarget n shared b A Δ D kbig tag s e).2 ≤ b := by cases tag with | none => exact (fullActivePermutation_total_memory e.2 s.2).le.trans hs | some tag => cases tag with | inl j => exact (coupledGhostJointEventWeight_support (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g => physicalGhostTermination (n g) (qghost j) ρ) (fun g => physicalGhostBirth (n g) (qghost j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) s.2 e hw).1.2 | inr k => have hb : fullActiveEdgeEventWeight n (shared e.1) b (fun _ => Unit) (fun c _ => Δ k e.1 (physicalSharedPrefix s.1.2) c e.2.1) (fun c _ => D k e.1 (physicalSharedPrefix s.1.2) c e.2.1) (fun _ _ => 1) μ ρ V s.2 e.2.2.2 ≠ 0 := by intro hz apply hw simp only [physicalMixedWordWeight, physicalSmallBigPositiveWeight, physicalSmallBigFullWeight, hz, mul_zero, ite_self] rw [fullActiveEdgeEventWeight_full_caps] at hb by_contra ht exact hb (if_neg (fun hc => ht hc.2)) omit [∀ g, Fintype (P g)] in theorem physicalMixedWordCapEmbed_support (k : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (hs : productTotalMemory s.2 ≤ b) (e : PhysicalMixedWordEvent n shared b A Δ D k s) : physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge k s e ≠ 0 ↔ physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ V Vs qedge k (physicalSmallBigCapEmbed h s) (physicalMixedWordCapEmbed n shared A Δ D h k s e) ≠ 0 ∧ productTotalMemory (physicalMixedWordTarget n shared B A Δ D kbig k (physicalSmallBigCapEmbed h s) (physicalMixedWordCapEmbed n shared A Δ D h k s e)).2 ≤ b := by rw [physicalMixedWordCapEmbed_weight n shared A Δ D h kbig ω μ qghost ρ V Vs qedge k s hs e] split_ifs <;> simp_all omit [∀ g, Fintype (P g)] in theorem physicalMixedWordCapEmbed_weight_of_ne_zero (k : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (hs : productTotalMemory s.2 ≤ b) (e : PhysicalMixedWordEvent n shared b A Δ D k s) (hw : physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge k s e ≠ 0) : physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ V Vs qedge k (physicalSmallBigCapEmbed h s) (physicalMixedWordCapEmbed n shared A Δ D h k s e) = physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge k s e := by have ht := ((physicalMixedWordCapEmbed_support n shared A Δ D h kbig ω μ qghost ρ V Vs qedge k s hs e).mp hw).2 exact ((physicalMixedWordCapEmbed_weight n shared A Δ D h kbig ω μ qghost ρ V Vs qedge k s hs e).trans (if_pos ht)).symm noncomputable def physicalMixedWordCapSupportEquiv (k : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (hs : productTotalMemory s.2 ≤ b) : {e : PhysicalMixedWordEvent n shared b A Δ D k s // physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge k s e ≠ 0} ≃ {e : PhysicalMixedWordEvent n shared B A Δ D k (physicalSmallBigCapEmbed h s) // physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ V Vs qedge k (physicalSmallBigCapEmbed h s) e ≠ 0 ∧ productTotalMemory (physicalMixedWordTarget n shared B A Δ D kbig k (physicalSmallBigCapEmbed h s) e).2 ≤ b} := Equiv.ofBijective (fun e => ⟨physicalMixedWordCapEmbed n shared A Δ D h k s e.val, (physicalMixedWordCapEmbed_support n shared A Δ D h kbig ω μ qghost ρ V Vs qedge k s hs e.val).mp e.property⟩) ⟨by intro e f hef apply Subtype.ext exact physicalMixedWordCapEmbed_injective n shared A Δ D h k s (congrArg Subtype.val hef), by intro e obtain ⟨d, hd⟩ := physicalMixedWordCapEmbed_surjective_of_ne_zero n shared A Δ D h kbig ω μ qghost ρ V Vs qedge k s e.val e.property.1 e.property.2 have hw := (physicalMixedWordCapEmbed_support n shared A Δ D h kbig ω μ qghost ρ V Vs qedge k s hs d).mpr (by simpa only [hd] using e.property) exact ⟨⟨d, hw⟩, Subtype.ext hd⟩⟩ omit [∀ g, Fintype (P g)] in theorem physicalMixedWordCapSupportEquiv_target (k : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (hs : productTotalMemory s.2 ≤ b) (e : {e : PhysicalMixedWordEvent n shared b A Δ D k s // physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge k s e ≠ 0}) : physicalSmallBigCapEmbed h (physicalMixedWordTarget n shared b A Δ D kbig k s e.val) = physicalMixedWordTarget n shared B A Δ D kbig k (physicalSmallBigCapEmbed h s) (physicalMixedWordCapSupportEquiv n shared A Δ D h kbig ω μ qghost ρ V Vs qedge k s hs e).val := by exact (physicalMixedWordCapEmbed_target n shared A Δ D h kbig ω μ qghost ρ V Vs qedge k s e.val e.property).symm omit [∀ g, Fintype (P g)] in theorem physicalMixedWordCapSupportEquiv_weight (k : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (hs : productTotalMemory s.2 ≤ b) (e : {e : PhysicalMixedWordEvent n shared b A Δ D k s // physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge k s e ≠ 0}) : physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ V Vs qedge k (physicalSmallBigCapEmbed h s) (physicalMixedWordCapSupportEquiv n shared A Δ D h kbig ω μ qghost ρ V Vs qedge k s hs e).val = physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge k s e.val := by exact physicalMixedWordCapEmbed_weight_of_ne_zero n shared A Δ D h kbig ω μ qghost ρ V Vs qedge k s hs e.val e.property end end Bounty end -- Source module: PhysicalRootLocalPhaseCap section /- Exact phase and ledger transport with all original event data retained. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n b B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (h : b ≤ B) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootMixedCapWeight := physicalMixedWordWeight (Ps := fun s : ↥groupsᶜ => P s.val) (ell := ell) (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) theorem physical_root_mixed_local_phase_cap (tag : Option (Fin (n + 2) ⊕ Fin (n + 1))) (H : (g : Fin M) → Finset (P (e.symm g).val)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e) (a : PhysicalRootMixedEvent groups e patterns C k tag s) (hw : physicalRootMixedCapWeight groups e patterns C k V q β retention ρ tag s a ≠ 0) : physicalRootMixedLocalPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis tag H (physicalSmallBigCapEmbed h s) (physicalMixedWordCapEmbed (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) h tag s a) = physicalRootMixedLocalPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis tag H s a := by have hp := physical_mixed_big_projection_weight_ne_zero (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) b (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) tag s a hw cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => exact physical_effective_combined_phase_cap hPs hPb hdis (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val) (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => physicalSharedPrefix key.2.2.1) (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val) h (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val) aux) β ρ (fun g => V (e.symm g).val) retention (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) _ H s.2 _ hp theorem physical_root_mixed_birth_update_cap (tag : Option (Fin (n + 2) ⊕ Fin (n + 1))) (H : (g : Fin M) → Finset (P (e.symm g).val)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e) (a : PhysicalRootMixedEvent groups e patterns C k tag s) (hw : physicalRootMixedCapWeight groups e patterns C k V q β retention ρ tag s a ≠ 0) : physicalRootMixedBirthUpdate (n := n) groups e patterns C k tag H (physicalSmallBigCapEmbed h s) (physicalMixedWordCapEmbed (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) h tag s a) = physicalRootMixedBirthUpdate (n := n) groups e patterns C k tag H s a := by have hp := physical_mixed_big_projection_weight_ne_zero (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) b (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) tag s a hw cases tag with | none => rfl | some tag => cases tag with | inl j => rfl | inr j => exact full_mixed_ledger_update_cap (fun g (p : P (e.symm g).val) => p.val) (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => physicalFullSharedIndices (ell := ell) (C key.2.1.val (e.symm g).val)) (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) _ => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val)) (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) => physicalMixedEdgeDelta (fun g => C key.2.1.val (e.symm g).val) (k (n - key.1.val) key.2.1.val) (physicalSharedPrefix key.2.2.1)) (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) => physicalMixedEdgeD (fun g => C key.2.1.val (e.symm g).val) (physicalSharedPrefix key.2.2.1)) h (fun (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) _ H s.2 _ hp end Root end Bounty end -- Source module: DeterministicLedgerCapTransport section /- Exact phase and ledger transport with all original event data retained. -/ open scoped Classical namespace Bounty theorem deterministic_ledger_phase_invariant_equiv {K L X Y : Type*} (E : K → X → Type*) (F : K → Y → Type*) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (e : X → Y) (P : X → Prop) (closed : ∀ k x, P x → ∀ a, P (t k x a)) (δ : ∀ k x, P x → E k x ≃ F k (e x)) (ht : ∀ k x (hx : P x) a, e (t k x a) = u k (e x) (δ k x hx a)) (v : ∀ k, L → (x : X) → E k x → L) (w : ∀ k, L → (y : Y) → F k y → L) (hv : ∀ k l x (hx : P x) a, w k l (e x) (δ k x hx a) = v k l x a) (phase : ∀ k, L → (x : X) → E k x → ℂ) (phase' : ∀ k, L → (y : Y) → F k y → ℂ) (hp : ∀ k l x (hx : P x) a, phase' k l (e x) (δ k x hx a) = phase k l x a) (ks : List K) (l : L) (x : X) (hx : P x) (p : FiniteEventPath E t ks x) : deterministicLedgerPhase F u w phase' ks l (e x) (finiteInvariantPathEquiv E F t u e P closed δ ht ks x hx p) = deterministicLedgerPhase E t v phase ks l x p := by induction ks generalizing l x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ change phase' k l (e x) (δ k x hx a) * deterministicLedgerPhase F u w phase' ks (w k l (e x) (δ k x hx a)) _ (cast (congrArg (FiniteEventPath F u ks) (ht k x hx a)) (finiteInvariantPathEquiv E F t u e P closed δ ht ks (t k x a) (closed k x hx a) p)) = _ rw [hp, hv, deterministic_ledger_phase_cast F u w phase' ks _ (ht k x hx a), ih] rfl theorem deterministic_ledger_phase_selected_forget {K L X : Type*} (E : K → X → Type*) (t : ∀ k x, E k x → X) (Q : ∀ k x, E k x → Prop) (v : ∀ k, L → (x : X) → E k x → L) (phase : ∀ k, L → (x : X) → E k x → ℂ) (ks : List K) (l : L) (x : X) (p : FiniteEventPath (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) ks x) : deterministicLedgerPhase E t v phase ks l x (finiteSelectedPathForget E t Q ks x p) = deterministicLedgerPhase (FiniteSelectedEvent E Q) (finiteSelectedTarget E t Q) (fun k l x a => v k l x a.val) (fun k l x a => phase k l x a.val) ks l x p := by induction ks generalizing l x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ exact congrArg (phase k l x a.val * ·) (ih _ _ p) theorem deterministic_ledger_phase_nonzero_lift {K L X : Type*} (E : K → X → Type*) (t : ∀ k x, E k x → X) (w : ∀ k x, E k x → ℝ) (v : ∀ k, L → (x : X) → E k x → L) (phase : ∀ k, L → (x : X) → E k x → ℂ) (ks : List K) (l : L) (x : X) (p : FiniteEventPath E t ks x) (hp : finiteEventPathWeight E t w ks x p ≠ 0) : deterministicLedgerPhase (FiniteNonzeroEvent E w) (finiteNonzeroTarget E t w) (fun k l x a => v k l x a.val) (fun k l x a => phase k l x a.val) ks l x (finiteNonzeroPathLift E t w ks x p hp) = deterministicLedgerPhase E t v phase ks l x p := by induction ks generalizing l x with | nil => rfl | cons k ks ih => rcases p with ⟨a, p⟩ exact congrArg (phase k l x a * ·) (ih _ _ p (mul_ne_zero_iff.mp hp).2) theorem finite_supported_path_phase_ledger {K L X Y : Type*} (E : K → X → Type*) (F : K → Y → Type*) (t : ∀ k x, E k x → X) (u : ∀ k y, F k y → Y) (weight : ∀ k x, E k x → ℝ) (Q : ∀ k y, F k y → Prop) (e : X → Y) (P : X → Prop) (closed : ∀ k x, P x → ∀ a : FiniteNonzeroEvent E weight k x, P (t k x a.val)) (δ : ∀ k x, P x → FiniteNonzeroEvent E weight k x ≃ FiniteSelectedEvent F Q k (e x)) (ht : ∀ k x (hx : P x) a, e (t k x a.val) = u k (e x) (δ k x hx a).val) (v : ∀ k, L → (x : X) → E k x → L) (w : ∀ k, L → (y : Y) → F k y → L) (hv : ∀ k l x (hx : P x) a, w k l (e x) (δ k x hx a).val = v k l x a.val) (phase : ∀ k, L → (x : X) → E k x → ℂ) (phase' : ∀ k, L → (y : Y) → F k y → ℂ) (hphase : ∀ k l x (hx : P x) a, phase' k l (e x) (δ k x hx a).val = phase k l x a.val) (ks : List K) (l : L) (x : X) (hx : P x) (p : FiniteEventPath E t ks x) (hp : finiteEventPathWeight E t weight ks x p ≠ 0) : finiteSupportedPathPhase E F t u weight Q e P closed δ ht ks (fun y p => deterministicLedgerPhase F u w phase' ks l y p) x p = deterministicLedgerPhase E t v phase ks l x p := by unfold finiteSupportedPathPhase rw [dif_pos hx, dif_pos hp] dsimp only erw [deterministic_ledger_phase_selected_forget] erw [deterministic_ledger_phase_invariant_equiv (FiniteNonzeroEvent E weight) (FiniteSelectedEvent F Q) (finiteNonzeroTarget E t weight) (finiteSelectedTarget F u Q) e P closed δ ht (fun k l x a => v k l x a.val) (fun k l y a => w k l y a.val) hv (fun k l x a => phase k l x a.val) (fun k l y a => phase' k l y a.val) hphase] exact deterministic_ledger_phase_nonzero_lift E t weight v phase ks l x p hp end Bounty end -- Source module: PhysicalMixedWordCapTransport section /- Exact moving-small-state transport between big-memory caps. -/ open Finset Classical namespace Bounty section variable {H K S G I : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] [DecidableEq G] [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) {b B : ℕ} (h : b ≤ B) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) noncomputable def physicalMixedWordCapPhase (steps : List (Option (H ⊕ K))) (phase : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → ℂ) : ∀ s, PhysicalMixedWordPath (ell := ell) n shared b A Δ D kbig steps s → ℂ := finiteSupportedPathPhase (PhysicalMixedWordEvent (V := H) (ell := ell) n shared b A Δ D) (PhysicalMixedWordEvent (V := H) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared b A Δ D kbig) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge) (finiteSafeEventPredicate (PhysicalMixedWordEvent (V := H) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ V Vs qedge) (fun s => productTotalMemory s.2) b) (physicalSmallBigCapEmbed h) (fun s => productTotalMemory s.2 ≤ b) (fun k s hs e => physicalMixedWord_supported_target n shared A Δ D kbig ω μ qghost ρ V Vs qedge k s hs e.val e.property) (physicalMixedWordCapSupportEquiv n shared A Δ D h kbig ω μ qghost ρ V Vs qedge) (physicalMixedWordCapSupportEquiv_target n shared A Δ D h kbig ω μ qghost ρ V Vs qedge) steps phase variable [Fintype I] [∀ g p, NeZero (n g p)] [∀ i, Fintype (A i)] theorem physical_mixed_word_cap_path_action (steps : List (Option (H ⊕ K))) (phase : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → ℂ) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (hs : productTotalMemory s.2 ≤ b) : physicalMixedWordPathAction n shared b A Δ D kbig ω μ qghost ρ V Vs qedge steps (physicalMixedWordCapPhase n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase) (fun s => f (physicalSmallBigCapEmbed h s)) s = physicalMixedWordPathAction n shared B A Δ D kbig ω μ qghost ρ V Vs qedge steps (fun s p => if physicalMixedWordPeak n shared B A Δ D kbig steps s p ≤ b then phase s p else 0) f (physicalSmallBigCapEmbed h s) := by let _ : ∀ (k : Option (H ⊕ K)) s, Fintype (PhysicalMixedWordEvent (V := H) (ell := ell) n shared b A Δ D k s) := physicalMixedWordEventFintype (V := H) (ell := ell) n shared b A Δ D let _ : ∀ (k : Option (H ⊕ K)) s, Fintype (PhysicalMixedWordEvent (V := H) (ell := ell) n shared B A Δ D k s) := physicalMixedWordEventFintype (V := H) (ell := ell) n shared B A Δ D exact finite_safe_path_action_transport (PhysicalMixedWordEvent (V := H) (ell := ell) n shared b A Δ D) (PhysicalMixedWordEvent (V := H) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared b A Δ D kbig) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordWeight n shared b A Δ D kbig ω μ qghost ρ V Vs qedge) (physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ V Vs qedge) (fun s => productTotalMemory s.2) b (physicalSmallBigCapEmbed h) (fun s => productTotalMemory s.2 ≤ b) (fun k s hs e => physicalMixedWord_supported_target n shared A Δ D kbig ω μ qghost ρ V Vs qedge k s hs e.val e.property) (physicalMixedWordCapSupportEquiv n shared A Δ D h kbig ω μ qghost ρ V Vs qedge) (physicalMixedWordCapSupportEquiv_target n shared A Δ D h kbig ω μ qghost ρ V Vs qedge) (physicalMixedWordCapSupportEquiv_weight n shared A Δ D h kbig ω μ qghost ρ V Vs qedge) steps phase f s hs hs end end Bounty end -- Source module: PhysicalRootMixedPhaseCap section /- The genuine root mixed phase commutes with increasing memory caps on its original nonzero support. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n b B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (h : b ≤ B) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootTransportedMixedPhase := physicalMixedWordCapPhase (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) h (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalRootMixedPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis) theorem physical_root_mixed_phase_cap (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e) (hs : productTotalMemory s.2 ≤ b) (path : PhysicalRootMixedPath (n := n) groups e patterns C k s) (hw : finiteEventPathWeight (PhysicalRootMixedEvent (B := b) groups e patterns C k) (physicalRootMixedTarget (B := b) groups e patterns C k) (physicalRootMixedCapWeight groups e patterns C k V q β retention ρ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) s path ≠ 0) : physicalRootTransportedMixedPhase groups e patterns C hC k h V q ζ K θ β retention ρ hPs hPb hdis s path = physicalRootMixedPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis s path := by have hh := finite_supported_path_phase_ledger (PhysicalRootMixedEvent (B := b) groups e patterns C k) (PhysicalRootMixedEvent (B := B) groups e patterns C k) (physicalRootMixedTarget (B := b) groups e patterns C k) (physicalRootMixedTarget (B := B) groups e patterns C k) (physicalRootMixedCapWeight groups e patterns C k V q β retention ρ) (finiteSafeEventPredicate (PhysicalRootMixedEvent (B := B) groups e patterns C k) (physicalRootMixedTarget (B := B) groups e patterns C k) (physicalRootMixedCapWeight groups e patterns C k V q β retention ρ (B := B)) (fun t => productTotalMemory t.2) b) (physicalSmallBigCapEmbed h) (fun t => productTotalMemory t.2 ≤ b) (fun tag t ht a => physicalMixedWord_supported_target (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) tag t ht a.val a.property) (physicalMixedWordCapSupportEquiv (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) h (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q)) (physicalMixedWordCapSupportEquiv_target (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) h (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q)) (physicalRootMixedBirthUpdate (n := n) groups e patterns C k (B := b)) (physicalRootMixedBirthUpdate (n := n) groups e patterns C k (B := B)) (fun tag H t _ a => physical_root_mixed_birth_update_cap groups e patterns C k h V q β retention ρ tag H t a.val a.property) (physicalRootMixedLocalPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis (B := b)) (physicalRootMixedLocalPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis (B := B)) (fun tag H t _ a => physical_root_mixed_local_phase_cap groups e patterns C hC k h V q ζ K θ β retention ρ hPs hPb hdis tag H t a.val a.property) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (fullActiveInitialLedger s.2) s hs path hw unfold physicalRootTransportedMixedPhase physicalMixedWordCapPhase finiteSupportedPathPhase erw [dif_pos hs, dif_pos hw] dsimp only erw [physical_root_mixed_phase_history, physical_root_mixed_phase_history] unfold physicalRootMixedHistory unfold finiteSupportedPathPhase at hh erw [dif_pos hs, dif_pos hw] at hh exact hh theorem physical_root_mixed_phase_cap_weighted (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e) (hs : productTotalMemory s.2 ≤ b) (path : PhysicalRootMixedPath (n := n) groups e patterns C k s) : (finiteEventPathWeight (PhysicalRootMixedEvent (B := b) groups e patterns C k) (physicalRootMixedTarget (B := b) groups e patterns C k) (physicalRootMixedCapWeight groups e patterns C k V q β retention ρ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) s path : ℂ) * physicalRootTransportedMixedPhase groups e patterns C hC k h V q ζ K θ β retention ρ hPs hPb hdis s path = (finiteEventPathWeight (PhysicalRootMixedEvent (B := b) groups e patterns C k) (physicalRootMixedTarget (B := b) groups e patterns C k) (physicalRootMixedCapWeight groups e patterns C k V q β retention ρ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) s path : ℂ) * physicalRootMixedPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis s path := by by_cases hw : finiteEventPathWeight (PhysicalRootMixedEvent (B := b) groups e patterns C k) (physicalRootMixedTarget (B := b) groups e patterns C k) (physicalRootMixedCapWeight groups e patterns C k V q β retention ρ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) s path = 0 · simp only [hw, Complex.ofReal_zero, zero_mul] · rw [physical_root_mixed_phase_cap groups e patterns C hC k h V q ζ K θ β retention ρ hPs hPb hdis s hs path hw] theorem physical_root_mixed_phase_cap_action [∀ tag s, Fintype (PhysicalRootMixedEvent (P := P) (ell := ell) (n := n) (B := b) groups e patterns C k tag s)] (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e) (hs : productTotalMemory s.2 ≤ b) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e → ℂ) : finiteEventPathAction (PhysicalRootMixedEvent (P := P) (ell := ell) (n := n) (B := b) groups e patterns C k) (physicalRootMixedTarget (B := b) groups e patterns C k) (physicalRootMixedCapWeight groups e patterns C k V q β retention ρ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalRootTransportedMixedPhase groups e patterns C hC k h V q ζ K θ β retention ρ hPs hPb hdis) F s = finiteEventPathAction (PhysicalRootMixedEvent (P := P) (ell := ell) (n := n) (B := b) groups e patterns C k) (physicalRootMixedTarget (B := b) groups e patterns C k) (physicalRootMixedCapWeight groups e patterns C k V q β retention ρ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalRootMixedPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis) F s := by unfold finiteEventPathAction apply Finset.sum_congr rfl intro path _ exact congrArg (fun z : ℂ => z * F (finiteEventPathTerminal (PhysicalRootMixedEvent (P := P) (ell := ell) (n := n) (B := b) groups e patterns C k) (physicalRootMixedTarget (B := b) groups e patterns C k) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) s path)) (physical_root_mixed_phase_cap_weighted groups e patterns C hC k h V q ζ K θ β retention ρ hPs hPb hdis s hs path) end Root end Bounty end -- Source module: PhysicalMixedCapEnvelope section /- A bounded original path phase is normalized without changing the cap comparison. -/ open Finset open scoped Classical namespace Bounty section variable {H K S G I : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] [DecidableEq G] [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) {b B : ℕ} (h : b ≤ B) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) variable [Fintype I] [∀ g p, NeZero (n g p)] [∀ i, Fintype (A i)] noncomputable def physicalMixedWordCapDifferenceValue (steps : List (Option (H ⊕ K))) (phase : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → ℂ) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) : ℂ := physicalMixedWordPathAction n shared B A Δ D kbig ω μ qghost ρ V Vs qedge steps phase f (physicalSmallBigCapEmbed h s) - physicalMixedWordPathAction n shared b A Δ D kbig ω μ qghost ρ V Vs qedge steps (physicalMixedWordCapPhase n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase) (fun x => f (physicalSmallBigCapEmbed h x)) s theorem physical_mixed_word_cap_difference_normalize (steps : List (Option (H ⊕ K))) (phase : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → ℂ) (c : ℝ) (hphase : ∀ s p, ‖phase s p‖ ≤ c) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) : physicalMixedWordCapDifferenceValue n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase f s = (c : ℂ) * physicalMixedWordCapDifferenceValue n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps (fun s p => phase s p / (c : ℂ)) f s := by let : ∀ (tag : Option (H ⊕ K)) s, Fintype (PhysicalMixedWordEvent (V := H) (J := J) (ell := ell) n shared B A Δ D tag s) := physicalMixedWordEventFintype (V := H) (J := J) (ell := ell) n shared B A Δ D let : ∀ (tag : Option (H ⊕ K)) s, Fintype (PhysicalMixedWordEvent (V := H) (J := J) (ell := ell) n shared b A Δ D tag s) := physicalMixedWordEventFintype (V := H) (J := J) (ell := ell) n shared b A Δ D have hp : physicalMixedWordCapPhase n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase = fun s p => (c : ℂ) * physicalMixedWordCapPhase n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps (fun s p => phase s p / (c : ℂ)) s p := by funext s p exact (by unfold physicalMixedWordCapPhase finiteSupportedPathPhase split_ifs · exact (real_bound_mul_div_eq (hphase _ _)).symm · simp only [mul_zero] · simp only [mul_zero] ) unfold physicalMixedWordCapDifferenceValue rw [hp] unfold physicalMixedWordPathAction rw [finite_event_path_phase_normalize _ _ _ _ phase c hphase, finite_event_path_phase_mul] ring variable [∀ p : PhysicalPrime Ps, NeZero p.2.val] theorem physical_mixed_word_cap_energy_envelope (steps : List (Option (H ⊕ K))) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (L : ℕ) (Denergy : ℝ) (henergy : ∀ phase : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → ℂ, (∀ s p, ‖phase s p‖ ≤ 1) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun s => if productTotalMemory s.2 ≤ L then physicalMixedWordCapDifferenceValue n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase f s else 0) ≤ Denergy) (phase : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → ℂ) (c : ℝ) (hc : 0 ≤ c) (hphase : ∀ s p, ‖phase s p‖ ≤ c) : physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun s => if productTotalMemory s.2 ≤ L then physicalMixedWordCapDifferenceValue n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase f s else 0) ≤ c ^ 2 * Denergy := by have he := henergy (fun s p => phase s p / (c : ℂ)) (fun s p => norm_div_real_bound_le_one hc (hphase s p)) have hfun : (fun s => if productTotalMemory s.2 ≤ L then physicalMixedWordCapDifferenceValue n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase f s else 0) = fun s => (c : ℂ) * (if productTotalMemory s.2 ≤ L then physicalMixedWordCapDifferenceValue n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps (fun s p => phase s p / (c : ℂ)) f s else 0) := by funext s split_ifs · exact physical_mixed_word_cap_difference_normalize n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase c hphase f s · simp only [mul_zero] rw [hfun, ← physical_small_big_energy_eq, finiteWeightedEnergy_const_mul, physical_small_big_energy_eq, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hc] exact mul_le_mul_of_nonneg_left he (sq_nonneg c) end end Bounty end -- Source module: PhysicalRootCapActionCoherence section /- The genuine root vector difference is the cap-transport difference on supported sources. -/ open Finset Classical namespace Bounty section Scalar variable {I : Type} {N M J ell n b B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) theorem physical_root_scalar_cap_difference_eq (h : b ≤ B) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e) (hs : productTotalMemory s.2 ≤ b) : letI : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis (physicalSmallBigCapEmbed h s) - physicalRootScalarVectorAction (n := n) (B := b) groups e patterns C hC V q ζ k K θ β ρ hP hdis s = physicalMixedWordCapDifferenceValue (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) h (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalRootMixedPhase (B := B) groups e patterns C hC k V ζ K θ (fun g p => β ⟨(e.symm g).val, p⟩) ρ (fun s => hP s.val) (fun g => hP (e.symm g).val) (physical_root_group_pools_disjoint groups e hdis)) (fun s => fullMemoryVacuum s.2) s := by let : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let : ∀ tag s, Fintype (PhysicalRootMixedEvent (P := P) (ell := ell) (n := n) (B := b) groups e patterns C k tag s) := physicalMixedWordEventFintype (ell := ell) (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) b (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) rw [physical_root_scalar_vector_action_unfold, physical_root_scalar_vector_action_unfold] unfold physicalMixedWordCapDifferenceValue congr 1 exact (physical_root_mixed_phase_cap_action groups e patterns C hC k h V q ζ K θ (fun g p => β ⟨(e.symm g).val, p⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ (fun s => hP s.val) (fun g => hP (e.symm g).val) (physical_root_group_pools_disjoint groups e hdis) s hs (fun t => fullMemoryVacuum t.2)).symm end Scalar end Bounty end -- Source module: PhysicalCapPhaseNorm section /- Norm bounds for the unchanged original root phase, with its birth ledger and coefficients. -/ open Finset open scoped Classical namespace Bounty theorem deterministic_ledger_phase_norm_bound {K L X : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ k, L → (x : X) → E k x → L) (phase : ∀ k, L → (x : X) → E k x → ℂ) (H : ℝ) (hH : 0 ≤ H) (hphase : ∀ k l x e, ‖phase k l x e‖ ≤ H) (ks : List K) (l : L) (x : X) (p : FiniteEventPath E target ks x) : ‖deterministicLedgerPhase E target update phase ks l x p‖ ≤ H ^ ks.length := by induction ks generalizing l x with | nil => simp only [deterministicLedgerPhase, norm_one, List.length_nil, pow_zero, le_refl] | cons k ks ih => rcases p with ⟨e, p⟩ simp only [deterministicLedgerPhase, norm_mul, List.length_cons, pow_succ] calc _ ≤ H * H ^ ks.length := mul_le_mul (hphase k l x e) (ih _ _ p) (norm_nonneg _) hH _ = _ := mul_comm _ _ theorem physical_active_coefficient_norm_bound {N J ell : ℕ} {P : Fin N → Finset ℕ} (before after C : Fin N → Finset (Fin J)) (ζ : ℝ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (H : ℝ) (hH : 0 ≤ H) (hK : ∀ L R a, ‖K L R a‖ ≤ H) (s t : (g : Fin N) → Fin (J + ell) → ↥(P g)) (a : PhysicalAuxLabels P C) : ‖physicalActiveCoefficient before after C ζ K s t a‖ ≤ H := by unfold physicalActiveCoefficient split_ifs · rw [norm_mul, physical_phase_norm, mul_one] exact hK _ _ _ all_goals simpa only [norm_zero] using hH section Combined variable {I K : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : K → Fin N → Finset (Fin J)) (k : K → ℤ) (ω : ∀ j, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C j g)) → PhysicalAuxLabels P (C j) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ζ : K → ℝ) (coeff : ∀ j, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C j) → ℂ) (H : ℝ) (hH : 1 ≤ H) (hcoeff : ∀ j L R a, ‖coeff j L R a‖ ≤ H) include hH hcoeff in theorem physical_full_key_coefficient_norm_bound (tag : Option (I ⊕ K)) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent C k tag (fullActiveInitialLedger x, x)) : ‖physicalFullKeyCoefficientPhase C k ζ coeff tag x e‖ ≤ H := by cases tag with | none => simpa only [physicalFullKeyCoefficientPhase, norm_one] using hH | some tag => cases tag with | inl j => simpa only [physicalFullKeyCoefficientPhase, norm_one] using hH | inr j => exact physical_active_coefficient_norm_bound _ _ _ _ _ H (le_trans zero_le_one hH) (hcoeff j) _ _ _ include hH hcoeff in theorem physical_full_combined_phase_norm_bound (tag : Option (I ⊕ K)) (ledger : (g : Fin N) → Finset (P g)) (x : PhysicalFullBoundedState P J ell B) (e : PhysicalFullLedgerEvent C k tag (ledger, x)) : ‖physicalFullCombinedPhase C k ω β ρ V ζ coeff tag ledger x e‖ ≤ H := by rw [physicalFullCombinedPhase, norm_mul] exact (mul_le_mul (physical_full_ledger_event_phase_norm_le C k ω β ρ V tag (ledger, x) e) (physical_full_key_coefficient_norm_bound C k ζ coeff H hH hcoeff tag x e) (norm_nonneg _) zero_le_one).trans_eq (one_mul H) end Combined section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) theorem physical_root_key_coefficient_norm_bound (H : ℝ) (hK : ∀ t < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K t i L R a‖ ≤ H) (key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) (L R : PhysicalMarkLists (fun g => P (e.symm g).val) J ell) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val)) : ‖physicalRootKeyCoefficient groups e patterns C hC ζ k K θ key L R a‖ ≤ H := by unfold physicalRootKeyCoefficient physicalGroupReindexedCoefficient physicalCoupledBigCoefficient physicalLocalFourierCoefficient simp only [norm_mul, physical_phase_norm, mul_one] have hp : ∀ θ h, ‖physicalReturnPhase θ h‖ = 1 := by intro θ h unfold physicalReturnPhase simp [Complex.norm_exp, Complex.mul_re] rw [hp, mul_one] exact hK _ (by omega) _ key.2.1.property _ _ _ theorem physical_root_mixed_local_phase_norm_bound (H : ℝ) (hH : 1 ≤ H) (hK : ∀ t < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K t i L R a‖ ≤ H) : ∀ tag ledger x event, ‖physicalRootMixedLocalPhase (n := n) (B := B) groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis tag ledger x event‖ ≤ H := by intro tag ledger x event unfold physicalRootMixedLocalPhase physicalMixedBigEventPullback physicalRootPlannedLocalPhase physicalRootEffectiveLocalPhase dsimp only apply physical_full_combined_phase_norm_bound · exact hH · intro key L R a exact physical_root_key_coefficient_norm_bound groups e patterns C hC k ζ K θ H hK key L R a theorem physical_root_mixed_phase_norm_bound (H : ℝ) (hH : 1 ≤ H) (hK : ∀ t < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K t i L R a‖ ≤ H) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (path : PhysicalRootMixedPath (n := n) groups e patterns C k s) : ‖physicalRootMixedPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis s path‖ ≤ H ^ (4 * (n + 1) + 1) := by rw [physical_root_mixed_phase_history] unfold physicalRootMixedHistory have h := deterministic_ledger_phase_norm_bound (PhysicalRootMixedEvent groups e patterns C k) (physicalRootMixedTarget groups e patterns C k) (physicalRootMixedBirthUpdate (n := n) groups e patterns C k) (physicalRootMixedLocalPhase groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis) H (le_trans zero_le_one hH) (physical_root_mixed_local_phase_norm_bound groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis H hH hK) _ (fullActiveInitialLedger s.2) s path simpa only [List.length_map, List.length_range] using h end Root end Bounty end -- Source module: PhysicalMixedWordCapDifference section /- Exact moving-small-state transport between big-memory caps. -/ open Finset Classical namespace Bounty section variable {H K S G I : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] [DecidableEq G] [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) {b B : ℕ} (h : b ≤ B) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) variable [Fintype I] [∀ g p, NeZero (n g p)] [∀ i, Fintype (A i)] (steps : List (Option (H ⊕ K))) (phase : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → ℂ) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) theorem physical_mixed_word_cap_difference (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) (hs : productTotalMemory s.2 ≤ b) : physicalMixedWordPathAction n shared B A Δ D kbig ω μ qghost ρ V Vs qedge steps phase f (physicalSmallBigCapEmbed h s) - physicalMixedWordPathAction n shared b A Δ D kbig ω μ qghost ρ V Vs qedge steps (physicalMixedWordCapPhase n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase) (fun s => f (physicalSmallBigCapEmbed h s)) s = physicalMixedWordPathAction n shared B A Δ D kbig ω μ qghost ρ V Vs qedge steps (fun s p => if b < physicalMixedWordPeak n shared B A Δ D kbig steps s p then phase s p else 0) f (physicalSmallBigCapEmbed h s) := by rw [physical_mixed_word_cap_path_action n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase f s hs] let _ : ∀ (k : Option (H ⊕ K)) s, Fintype (PhysicalMixedWordEvent (V := H) (ell := ell) n shared B A Δ D k s) := physicalMixedWordEventFintype (V := H) (ell := ell) n shared B A Δ D exact finite_event_path_action_sub_safe (PhysicalMixedWordEvent (V := H) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ V Vs qedge) (fun s => productTotalMemory s.2) b steps phase f (physicalSmallBigCapEmbed h s) theorem physical_mixed_word_cap_difference_mask (inputCap : ℕ) (hIb : inputCap ≤ b) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b)) : (if productTotalMemory s.2 ≤ inputCap then physicalMixedWordPathAction n shared B A Δ D kbig ω μ qghost ρ V Vs qedge steps phase f (physicalSmallBigCapEmbed h s) - physicalMixedWordPathAction n shared b A Δ D kbig ω μ qghost ρ V Vs qedge steps (physicalMixedWordCapPhase n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase) (fun s => f (physicalSmallBigCapEmbed h s)) s else 0) = physicalMixedWordPathAction n shared B A Δ D kbig ω μ qghost ρ V Vs qedge steps (fun s p => if productTotalMemory s.2 ≤ inputCap ∧ b < physicalMixedWordPeak n shared B A Δ D kbig steps s p then phase s p else 0) f (physicalSmallBigCapEmbed h s) := by by_cases hs : productTotalMemory s.2 ≤ inputCap · rw [if_pos hs, physical_mixed_word_cap_difference n shared A Δ D h kbig ω μ qghost ρ V Vs qedge steps phase f s (hs.trans hIb)] unfold physicalMixedWordPathAction finiteEventPathAction apply sum_congr rfl intro p _ simp only [physicalSmallBigCapEmbed, productStateCapEmbed_totalMemory, hs, true_and] rfl · rw [if_neg hs] unfold physicalMixedWordPathAction finiteEventPathAction simp only [physicalSmallBigCapEmbed, productStateCapEmbed_totalMemory, hs, false_and, if_false, mul_zero, zero_mul, sum_const_zero] end end Bounty end -- Source module: PhysicalMixedWordBirthGrowth section /- Exact ghost-birth counts and memory growth for paths with moving small states. -/ open Finset Classical namespace Bounty section variable {H K S G I : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] [DecidableEq G] [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) def physicalMixedWordEventBirthCount : ∀ (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)), PhysicalMixedWordEvent n shared B A Δ D tag s → ℕ | none, _, _ => 0 | some (.inl _), _, e => ∑ g, (e g).1.val | some (.inr _), _, _ => 0 noncomputable def physicalMixedWordPathBirthCount (steps : List (Option (H ⊕ K))) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (p : PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s) : ℕ := finiteEventPathCount (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordEventBirthCount n shared B A Δ D) steps s p omit [DecidableEq G] [∀ g, Fintype (P g)] in theorem physical_mixed_word_event_memory_le (T : ℕ) (ht : ∀ k g, (shared k g)ᶜ.card ≤ T) (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (e : PhysicalMixedWordEvent n shared B A Δ D tag s) : productTotalMemory (physicalMixedWordTarget n shared B A Δ D kbig tag s e).2 ≤ productTotalMemory s.2 + physicalMixedWordEventBirthCount n shared B A Δ D tag s e + fullMemoryEdgeIndicator tag * (T * Fintype.card G) := by cases tag with | none => simpa only [physicalMixedWordTarget, physicalMixedWordEventBirthCount, fullMemoryEdgeIndicator, Nat.add_zero, Nat.zero_mul] using (fullActivePermutation_total_memory e.2 s.2).le | some tag => cases tag with | inl j => exact (coupledGhostJointEventTarget_memory_le M B s.2 e).trans (by simp only [physicalMixedWordEventBirthCount, fullMemoryEdgeIndicator, Nat.zero_mul, Nat.add_zero, le_refl]) | inr k => have he := fullActiveEdgeEventTarget_memory_le n (fun _ : Unit => shared e.1) B (fun _ _ => Unit) (fun _ c _ => Δ k e.1 (physicalSharedPrefix s.1.2) c e.2.1) (fun _ c _ => D k e.1 (physicalSharedPrefix s.1.2) c e.2.1) () s.2 e.2.2.2 have hc : (∑ g, (shared e.1 g)ᶜ.card) ≤ T * Fintype.card G := by calc _ ≤ ∑ _g : G, T := sum_le_sum fun g _ => ht e.1 g _ = _ := by simp only [sum_const, card_univ, smul_eq_mul, mul_comm] exact he.trans (by simpa only [physicalMixedWordEventBirthCount, fullMemoryEdgeIndicator, Nat.add_zero, Nat.one_mul] using Nat.add_le_add_left hc (productTotalMemory s.2)) omit [DecidableEq G] [∀ g, Fintype (P g)] in theorem physical_mixed_word_path_peak_le (T : ℕ) (ht : ∀ k g, (shared k g)ᶜ.card ≤ T) (steps : List (Option (H ⊕ K))) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (p : PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s) : physicalMixedWordPeak n shared B A Δ D kbig steps s p ≤ productTotalMemory s.2 + physicalMixedWordPathBirthCount n shared B A Δ D kbig steps s p + fullMemoryEdgeCount steps * (T * Fintype.card G) := by induction steps generalizing s with | nil => simp only [physicalMixedWordPeak, finiteEventPathMaximum, physicalMixedWordPathBirthCount, finiteEventPathCount, fullMemoryEdgeCount, List.map_nil, List.sum_nil, Nat.add_zero, Nat.zero_mul, le_refl] | cons tag steps ih => rcases p with ⟨e, p⟩ have he := physical_mixed_word_event_memory_le n shared B A Δ D kbig T ht tag s e have hp := ih (physicalMixedWordTarget n shared B A Δ D kbig tag s e) p change max (productTotalMemory s.2) (physicalMixedWordPeak n shared B A Δ D kbig steps _ p) ≤ productTotalMemory s.2 + (physicalMixedWordEventBirthCount n shared B A Δ D tag s e + physicalMixedWordPathBirthCount n shared B A Δ D kbig steps _ p) + (fullMemoryEdgeIndicator tag + fullMemoryEdgeCount steps) * (T * Fintype.card G) rw [add_mul] omega omit [DecidableEq G] [∀ g, Fintype (P g)] in theorem physical_mixed_word_exceeds_implies_births (T : ℕ) (ht : ∀ k g, (shared k g)ᶜ.card ≤ T) (steps : List (Option (H ⊕ K))) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (p : PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s) (threshold : ℕ) (hlarge : threshold < physicalMixedWordPeak n shared B A Δ D kbig steps s p) : threshold + 1 - productTotalMemory s.2 - fullMemoryEdgeCount steps * (T * Fintype.card G) ≤ physicalMixedWordPathBirthCount n shared B A Δ D kbig steps s p := by have he := physical_mixed_word_path_peak_le n shared B A Δ D kbig T ht steps s p omega end end Bounty end -- Source module: PhysicalMixedWordBirthTail section /- Exact marking of ghost births with moving small states. Edge weights, residue shifts, and all cap indicators are unchanged. -/ open Finset Classical namespace Bounty section variable {H K S G I : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] [DecidableEq G] [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qsmall a : ℝ) omit [∀ g, Fintype (P g)] in theorem physical_mixed_word_ghost_scale_event (tag : Option (H ⊕ K)) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (e : PhysicalMixedWordEvent n shared B A Δ D tag s) : physicalMixedWordVaryingGhostWeight n shared B A Δ D kbig ω μ qghost ρ V (fun g => a * V g) Vs qsmall tag s e = a ^ physicalMixedWordEventBirthCount n shared B A Δ D tag s e * physicalMixedWordWeight n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) tag s e := by cases tag with | none => simp only [physicalMixedWordVaryingGhostWeight, physicalMixedWordEventBirthCount, pow_zero, one_mul] | some tag => cases tag with | inl j => change coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g => physicalGhostTermination (n g) (qghost j) ρ) (fun g z => physicalGhostBirth (n g) (qghost j) ρ (a * V g) z) (fun g => unrestrictedResidueWeight (μ g)) M B s.2 e = a ^ (∑ g, (e g).1.val) * coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g => physicalGhostTermination (n g) (qghost j) ρ) (fun g => physicalGhostBirth (n g) (qghost j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) M B s.2 e simp_rw [physicalGhostBirth_scale] exact coupledGhostJointEventWeight_birth_scale (fun g => physicalGhostRetention (n g) (qghost j) ρ) (fun g => physicalGhostTermination (n g) (qghost j) ρ) (fun g => physicalGhostBirth (n g) (qghost j) ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) a M B s.2 e | inr k => simp only [physicalMixedWordVaryingGhostWeight, physicalMixedWordEventBirthCount, pow_zero, one_mul] omit [∀ g, Fintype (P g)] in theorem physical_mixed_word_ghost_scale_path (steps : List (Option (H ⊕ K))) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (p : PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s) : finiteEventPathWeight (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordVaryingGhostWeight n shared B A Δ D kbig ω μ qghost ρ V (fun g => a * V g) Vs qsmall) steps s p = a ^ physicalMixedWordPathBirthCount n shared B A Δ D kbig steps s p * finiteEventPathWeight (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordWeight n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall)) steps s p := finite_event_path_weight_eq_pow_mul (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordWeight n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall)) (physicalMixedWordVaryingGhostWeight n shared B A Δ D kbig ω μ qghost ρ V (fun g => a * V g) Vs qsmall) (physicalMixedWordEventBirthCount n shared B A Δ D) a (physical_mixed_word_ghost_scale_event n shared B A Δ D kbig ω μ qghost ρ V Vs qsmall a) steps s p end end Bounty /- Exact exponential extraction for any whole-path mask forcing births. -/ open Finset Classical namespace Bounty section variable {H K S G I : Type} {Ps : S → Finset ℕ} {P : G → Type} [Fintype S] [Fintype G] [DecidableEq G] [Fintype I] [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ) (qsmall : ℝ) (steps : List (Option (H ⊕ K))) (allowed : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → Prop) (phase : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → ℂ) theorem physical_mixed_word_birth_tail_action (a : ℝ) (ha : 0 < a) (r : ℕ) (hallowed : ∀ s p, allowed s p → r ≤ physicalMixedWordPathBirthCount n shared B A Δ D kbig steps s p) (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) : physicalMixedWordPathAction n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps (fun s p => if allowed s p then phase s p else 0) f s = (((a ^ r)⁻¹ : ℝ) : ℂ) * physicalMixedWordVaryingGhostAction n shared B A Δ D kbig ω μ qghost ρ V (fun g => a * V g) Vs qsmall steps (fun s p => countTailPhase a r (physicalMixedWordPathBirthCount n shared B A Δ D kbig steps s p) (if allowed s p then phase s p else 0)) f s := by let _ : ∀ (tag : Option (H ⊕ K)) s, Fintype (PhysicalMixedWordEvent (V := H) (ell := ell) n shared B A Δ D tag s) := physicalMixedWordEventFintype n shared B A Δ D have he := finite_event_path_counted_tail_eq (PhysicalMixedWordEvent (V := H) (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordWeight n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall)) (physicalMixedWordVaryingGhostWeight n shared B A Δ D kbig ω μ qghost ρ V (fun g => a * V g) Vs qsmall) steps (physicalMixedWordPathBirthCount n shared B A Δ D kbig steps) ha (physical_mixed_word_ghost_scale_path n shared B A Δ D kbig ω μ qghost ρ V Vs qsmall a steps) r (fun s p => if allowed s p then phase s p else 0) f s have hphase : (fun s p => if r ≤ physicalMixedWordPathBirthCount n shared B A Δ D kbig steps s p then (if allowed s p then phase s p else 0) else 0) = (fun s p => if allowed s p then phase s p else 0) := by funext s p by_cases h : allowed s p · simp only [h, if_true, hallowed s p h] · simp only [h, if_false, ite_self] rw [hphase] at he exact he omit [Fintype I] [∀ g p, NeZero (n g p)] [∀ i, Fintype (A i)] [DecidableEq G] [∀ g, Fintype (P g)] in theorem physical_mixed_word_birth_tail_phase_norm (a : ℝ) (ha : 1 ≤ a) (r : ℕ) (hphase : ∀ s p, ‖phase s p‖ ≤ 1) (s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B)) (p : PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s) : ‖countTailPhase a r (physicalMixedWordPathBirthCount n shared B A Δ D kbig steps s p) (if allowed s p then phase s p else 0)‖ ≤ 1 := by apply countTailPhase_norm_le_one ha split_ifs · exact hphase s p · simp only [norm_zero, zero_le_one] end end Bounty end -- Source module: PhysicalMixedWordCapEnergy section /- Actual cap truncation on the genuine mixed state, including moving small labels and residues. The only symmetry assumption is on the terminal test's big pending-memory coordinates. All path masks remain inside the phase. -/ open Finset Classical namespace Bounty theorem exists_physical_mixed_word_cap_difference_energy_bound {qsmall vs : ℝ} (hq0 : 0 ≤ qsmall) (hq1 : qsmall < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ Ccond : ℝ, 1 ≤ Ccond ∧ ∀ (H K S G Pat : Type) [Fintype Pat] [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] (Ps : S → Finset ℕ) [∀ p : PhysicalPrime Ps, NeZero p.2.val] (P : G → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : G → ℕ) (shared : Pat → ∀ g, Finset (Fin (M g))) (b B : ℕ) (h : b ≤ B) (A : Pat → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : H → ℝ) (ρ : ℝ) (V : G → ℝ) (Vs : S → ℝ), (∀ s, vs ≤ Vs s) → (∀ k a, 0 ≤ ω k a) → (∀ k, ∑ a, ω k a ≤ 1) → ∀ (v vmin vmax : ℝ), 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V g) → (∀ g, V g ≤ vmax) → (∀ g p, 0 < μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → (∀ j, 0 ≤ qghost j) → (∀ j, qghost j ≤ 1) → (∀ j, qghost j / ρ ^ 2 + ((1 - qghost j) / ρ) / v ≤ 1) → (∀ j g, qghost j / ρ ^ 2 + ((1 - qghost j) * (2 * V g) / ρ) / v ≤ 1) → ∀ (T : ℕ), (∀ k g, (shared k g)ᶜ.card ≤ T) → ∀ (steps : List (Option (H ⊕ K))) (I : ℕ), I ≤ b → ∀ (phase : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → ℂ), (∀ s p, ‖phase s p‖ ≤ 1) → ∀ (f : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → ℂ), (∀ s, ProductMemorySymmetric (fun x => f (s, x))) → physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (fun s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b) => if productTotalMemory s.2 ≤ I then physicalMixedWordPathAction n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps phase f (physicalSmallBigCapEmbed h s) - physicalMixedWordPathAction n shared b A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps (physicalMixedWordCapPhase n shared A Δ D h kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps phase) (fun x => f (physicalSmallBigCapEmbed h x)) s else 0) ≤ ((2 : ℝ) ^ (b + 1 - I - fullMemoryEdgeCount steps * (T * Fintype.card G)))⁻¹ ^ 2 * (steps.map (physicalMixedWordStepEnergy Ccond ρ v vmin vmax (2 * vmax) T (Fintype.card S) (Fintype.card G) (Fintype.card Pat))).prod * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by obtain ⟨Ccond, hCcond, henergy⟩ := exists_physical_mixed_word_path_energy_bound hq0 hq1 hvs ell refine ⟨Ccond, hCcond, ?_⟩ intro H K S G Pat _ _ dS _ dG cases Subsingleton.elim dS (Classical.typeDecidableEq S) cases Subsingleton.elim dG (Classical.typeDecidableEq G) intro Ps _ P _ n _ J M shared b B h A _ Δ D kbig ω μ qghost ρ V Vs hVs hω hωmass v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass hqg0 hqg1 hD hC T ht steps I hIb phase hphase f hf have hVs0 : ∀ s, 0 < Vs s := fun s => hvs.trans_le (hVs s) let r := b + 1 - I - fullMemoryEdgeCount steps * (T * Fintype.card G) let allowed : ∀ s, PhysicalMixedWordPath (ell := ell) n shared B A Δ D kbig steps s → Prop := fun s p => productTotalMemory s.2 ≤ I ∧ b < physicalMixedWordPeak n shared B A Δ D kbig steps s p have hallowed : ∀ s p, allowed s p → r ≤ physicalMixedWordPathBirthCount n shared B A Δ D kbig steps s p := by intro s p hp have hg := physical_mixed_word_exceeds_implies_births n shared B A Δ D kbig T ht steps s p b hp.2 dsimp only [allowed] at hp dsimp only [r] omega let χ := fun s p => countTailPhase 2 r (physicalMixedWordPathBirthCount n shared B A Δ D kbig steps s p) (if allowed s p then phase s p else 0) have hχ : ∀ s p, ‖χ s p‖ ≤ 1 := by intro s p apply countTailPhase_norm_le_one (by norm_num) split_ifs · exact hphase s p · simp only [norm_zero, zero_le_one] have he := henergy H K S G Pat Ps P n J M shared B A Δ D kbig ω μ qghost ρ V (fun g => 2 * V g) Vs hVs hω hωmass v vmin vmax (2 * vmax) hρ0 hρ1 hv hvmin hVlo hVhi (fun g => mul_nonneg (by norm_num) (hvmin.trans_le (hVlo g)).le) (fun g => mul_le_mul_of_nonneg_left (hVhi g) (by norm_num)) hμ hmass hqg0 hqg1 hD hC T ht steps χ hχ f hf have heq : physicalMixedWordPathAction n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps (fun s p => if allowed s p then phase s p else 0) f = fun s => ((((2 : ℝ) ^ r)⁻¹ : ℝ) : ℂ) * physicalMixedWordVaryingGhostAction n shared B A Δ D kbig ω μ qghost ρ V (fun g => 2 * V g) Vs qsmall steps χ f s := by funext s have hh := physical_mixed_word_birth_tail_action n shared B A Δ D kbig ω μ qghost ρ V Vs qsmall steps allowed phase 2 (by norm_num) r hallowed f s convert hh using 1 · apply congrArg (fun ψ => physicalMixedWordPathAction n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps ψ f s) funext y p split_ifs <;> rfl · apply congrArg (fun ψ => ((((2 : ℝ) ^ r)⁻¹ : ℝ) : ℂ) * physicalMixedWordVaryingGhostAction n shared B A Δ D kbig ω μ qghost ρ V (fun g => 2 * V g) Vs qsmall steps ψ f s) funext y p dsimp only [χ] split_ifs <;> rfl have htail : physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalMixedWordPathAction n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps (fun s p => if allowed s p then phase s p else 0) f) ≤ ((2 : ℝ) ^ r)⁻¹ ^ 2 * (steps.map (physicalMixedWordStepEnergy Ccond ρ v vmin vmax (2 * vmax) T (Fintype.card S) (Fintype.card G) (Fintype.card Pat))).prod * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by rw [heq, ← physical_small_big_energy_eq, finiteWeightedEnergy_const_mul, physical_small_big_energy_eq] have hc : ‖((((2 : ℝ) ^ r)⁻¹ : ℝ) : ℂ)‖ = ((2 : ℝ) ^ r)⁻¹ := by rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (by positivity)] rw [hc, mul_assoc] exact mul_le_mul_of_nonneg_left he (sq_nonneg _) have hdiff : (fun s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M b) => if productTotalMemory s.2 ≤ I then physicalMixedWordPathAction n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps phase f (physicalSmallBigCapEmbed h s) - physicalMixedWordPathAction n shared b A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps (physicalMixedWordCapPhase n shared A Δ D h kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps phase) (fun x => f (physicalSmallBigCapEmbed h x)) s else 0) = (fun s => physicalMixedWordPathAction n shared B A Δ D kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps (fun y p => if allowed y p then phase y p else 0) f (physicalSmallBigCapEmbed h s)) := by funext s exact physical_mixed_word_cap_difference_mask n shared A Δ D h kbig (fun i _ => ω i) μ qghost ρ V Vs (fun _ => qsmall) steps phase f I hIb s erw [hdiff] exact (physical_small_big_cap_pullback_energy_le h Vs hVs0 μ (fun g => unrestrictedResidueWeight (μ g)) (fun g p => (hμ g p).le) (fun g z => (hμ g z.1).le) _).trans htail end Bounty end -- Source module: PhysicalRootCapEnergy section /- Quantitative cap truncation for the unchanged original root scalar vector. -/ open Finset open scoped Classical namespace Bounty noncomputable def physicalMixedCapConditioningConstant (q vs : ℝ) (ell : ℕ) (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) : ℝ := Classical.choose (exists_physical_mixed_word_cap_difference_energy_bound hq0 hq1 hvs ell) theorem physical_mixed_cap_conditioning_constant_ge_one (q vs : ℝ) (ell : ℕ) (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) : 1 ≤ physicalMixedCapConditioningConstant q vs ell hq0 hq1 hvs := (Classical.choose_spec (exists_physical_mixed_word_cap_difference_energy_bound hq0 hq1 hvs ell)).1 section Scalar variable {I : Type} {N M J ell n b B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) theorem physical_root_scalar_cap_energy_bound (h : b ≤ B) (vs : ℝ) (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hVs : ∀ s : ↥groupsᶜ, vs ≤ V s.val) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (v vmin vmax : ℝ) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g : Fin M, vmin ≤ V (e.symm g).val) (hVhi : ∀ g : Fin M, V (e.symm g).val ≤ vmax) (hμ : ∀ (g : Fin M) (p : P (e.symm g).val), 0 < β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (hmass : ∀ g : Fin M, ∑ p : P (e.symm g).val, β ⟨(e.symm g).val, p⟩ / V (e.symm g).val ≤ 2) (hqg0 : ∀ j : Fin (n + 2), 0 ≤ physicalEndpointSchedule q (n + 1) j.val) (hqg1 : ∀ j : Fin (n + 2), physicalEndpointSchedule q (n + 1) j.val ≤ 1) (hD : ∀ j : Fin (n + 2), physicalEndpointSchedule q (n + 1) j.val / ρ ^ 2 + ((1 - physicalEndpointSchedule q (n + 1) j.val) / ρ) / v ≤ 1) (hCghost : ∀ (j : Fin (n + 2)) (g : Fin M), physicalEndpointSchedule q (n + 1) j.val / ρ ^ 2 + ((1 - physicalEndpointSchedule q (n + 1) j.val) * (2 * V (e.symm g).val) / ρ) / v ≤ 1) (T : ℕ) (hT : ∀ (i : patterns) (g : Fin M), (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) (H : ℝ) (hH : 1 ≤ H) (hK : ∀ t < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K t i L R a‖ ≤ H) : letI : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) letI : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) physicalSmallBigEnergy (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val))) (fun s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e => if productTotalMemory s.2 ≤ 0 then physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis (physicalSmallBigCapEmbed h s) - physicalRootScalarVectorAction (n := n) (B := b) groups e patterns C hC V q ζ k K θ β ρ hP hdis s else 0) ≤ (H ^ (4 * (n + 1) + 1)) ^ 2 * ((((2 : ℝ) ^ (b + 1 - fullMemoryEdgeCount ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) * (T * M)))⁻¹) ^ 2 * (((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))).map (physicalMixedWordStepEnergy (physicalMixedCapConditioningConstant q vs ell hq0 hq1 hvs) ρ v vmin vmax (2 * vmax) T (Fintype.card ↥groupsᶜ) M (Fintype.card ↥patterns))).prod) * (physicalSmallBigEnergy (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val))) (fun s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e => fullMemoryVacuum s.2)) := by let : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) let : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) have hcore := (Classical.choose_spec (exists_physical_mixed_word_cap_difference_energy_bound hq0 hq1 hvs ell)).2 have henergy := fun phase hphase => hcore (Fin (n + 2)) (Fin (n + 1)) (↥groupsᶜ) (Fin M) (↥patterns) (fun s : ↥groupsᶜ => P s.val) (fun g => ↥(P (e.symm g).val)) (fun g (p : P (e.symm g).val) => p.val) J (fun _ => J + ell) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) b B h (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) hVs (fun i a => physical_aux_mass_nonneg _ _ (fun g => (hV (e.symm g).val).le) a) (fun i => (physical_aux_mass_sum _ _ (fun g => hV (e.symm g).val) (fun g => hMass (e.symm g).val)).le) v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass hqg0 hqg1 hD hCghost T hT ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) 0 (Nat.zero_le b) phase hphase (fun t => fullMemoryVacuum t.2) (fun _ => fullMemoryVacuum_symmetric) have he := physical_mixed_word_cap_energy_envelope (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) h (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (fun t => fullMemoryVacuum t.2) 0 ((((2 : ℝ) ^ (b + 1 - fullMemoryEdgeCount ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) * (T * M)))⁻¹) ^ 2 * (((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))).map (physicalMixedWordStepEnergy (physicalMixedCapConditioningConstant q vs ell hq0 hq1 hvs) ρ v vmin vmax (2 * vmax) T (Fintype.card ↥groupsᶜ) M (Fintype.card ↥patterns))).prod * (physicalSmallBigEnergy (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val))) (fun s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e => fullMemoryVacuum s.2))) (by intro phase hphase; simpa only [Nat.sub_zero, Fintype.card_fin, physicalMixedCapConditioningConstant, physicalMixedWordCapDifferenceValue] using henergy phase hphase) (physicalRootMixedPhase (B := B) groups e patterns C hC k V ζ K θ (fun g p => β ⟨(e.symm g).val, p⟩) ρ (fun s => hP s.val) (fun g => hP (e.symm g).val) (physical_root_group_pools_disjoint groups e hdis)) (H ^ (4 * (n + 1) + 1)) (pow_nonneg (zero_le_one.trans hH) _) (physical_root_mixed_phase_norm_bound groups e patterns C hC k V ζ K θ (fun g p => β ⟨(e.symm g).val, p⟩) ρ (fun s => hP s.val) (fun g => hP (e.symm g).val) (physical_root_group_pools_disjoint groups e hdis) H hH hK) have hfun : (fun s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e => if productTotalMemory s.2 ≤ 0 then physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis (physicalSmallBigCapEmbed h s) - physicalRootScalarVectorAction (n := n) (B := b) groups e patterns C hC V q ζ k K θ β ρ hP hdis s else 0) = (fun s => if productTotalMemory s.2 ≤ 0 then physicalMixedWordCapDifferenceValue (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) h (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalRootMixedPhase (B := B) groups e patterns C hC k V ζ K θ (fun g p => β ⟨(e.symm g).val, p⟩) ρ (fun s => hP s.val) (fun g => hP (e.symm g).val) (physical_root_group_pools_disjoint groups e hdis)) (fun t => fullMemoryVacuum t.2) s else 0) := by funext s split_ifs with hs · exact physical_root_scalar_cap_difference_eq groups e patterns C hC V q ζ k K θ β ρ hP hdis h s (hs.trans (Nat.zero_le b)) · rfl rw [hfun] simpa only [mul_assoc] using he end Scalar end Bounty end -- Source module: PhysicalCapNormalizedEnergy section /- The same small-residue normalization transports energy between distinct memory caps. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_big_normalized_cross_energy_le {S X Y : Type*} [Fintype S] [DecidableEq S] [Fintype X] [Fintype Y] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (WX : X → ℝ) (WY : Y → ℝ) (F : PhysicalSmallBigState P J ell X → ℂ) (output : PhysicalSmallBigState P J ell Y → ℂ) (K : ℝ) (h : physicalSmallBigEnergy V WY output ≤ K * physicalSmallBigEnergy V WX F) : finiteWeightedEnergy (physicalSmallBigNormalizedMeasure V WY) output ≤ K * finiteWeightedEnergy (physicalSmallBigNormalizedMeasure V WX) F := by rw [physical_small_big_normalized_energy_eq, physical_small_big_normalized_energy_eq] calc _ ≤ (∏ p : PhysicalPrime P, (1 : ℝ) / p.2.val) * (K * physicalSmallBigEnergy V WX F) := mul_le_mul_of_nonneg_left h (physical_small_residue_factor_pos (P := P)).le _ = _ := by ring theorem physical_small_big_normalized_cross_norm_le {S X Y : Type*} [Fintype S] [DecidableEq S] [Fintype X] [Fintype Y] {P : S → Finset ℕ} [∀ p : PhysicalPrime P, NeZero p.2.val] {J ell : ℕ} (V : S → ℝ) (WX : X → ℝ) (WY : Y → ℝ) (F : PhysicalSmallBigState P J ell X → ℂ) (output : PhysicalSmallBigState P J ell Y → ℂ) (H K : ℝ) (hH : 0 ≤ H) (hK : 0 ≤ K) (h : physicalSmallBigEnergy V WY output ≤ H ^ 2 * K * physicalSmallBigEnergy V WX F) : cleanActiveNorm (physicalSmallBigNormalizedMeasure V WY) output ≤ H * Real.sqrt K * cleanActiveNorm (physicalSmallBigNormalizedMeasure V WX) F := by have he := physical_small_big_normalized_cross_energy_le V WX WY F output (H ^ 2 * K) h have hs := Real.sqrt_le_sqrt he rw [Real.sqrt_mul (mul_nonneg (sq_nonneg H) hK), Real.sqrt_mul (sq_nonneg H), Real.sqrt_sq hH] at hs exact hs end Bounty end -- Source module: PhysicalCapInitialReadout section /- A cap-error energy bound gives the original normalized initial readout estimate. -/ open Finset open scoped Classical namespace Bounty section Readout variable {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Finset ℕ} {Z : G → Type*} [∀ g, Fintype (Z g)] {J ell b B : ℕ} (Vs : S → ℝ) (C : G → Finset (Fin J)) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (empty : ∀ g, BoundedOrderedTuple (Z g) b) (boundary : PhysicalBareResidueState Ps J ell → ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) b → ℂ) (output : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) b) → ℂ) theorem physical_cap_initial_readout_le_of_energy (hVs : ∀ s, 0 < Vs s) (hMass : ∀ s, ∑ p ∈ Ps s, 1 / (p : ℝ) = Vs s) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (hempty : ∀ g, (empty g).1.val = 0) (hb : ∀ s x, ‖boundary s x‖ ≤ 1) (H K : ℝ) (hH : 0 ≤ H) (hK : 0 ≤ K) (he : physicalSmallBigEnergy Vs (productMemoryWeight μ ν) output ≤ H ^ 2 * K * physicalSmallBigEnergy Vs (productMemoryWeight μ ν) (fun s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) => fullMemoryVacuum s.2)) : ‖physicalSmallBigInitialReadout Vs C μ empty boundary output‖ ≤ H * Real.sqrt K * ∏ g, (∑ p, μ g p) ^ (J + ell) := by let mass := ∏ g, (∑ p, μ g p) ^ (J + ell) have hm : 0 ≤ mass := prod_nonneg fun g _ => pow_nonneg (sum_nonneg fun p _ => hμ g p) _ have hn := physical_small_big_normalized_cross_norm_le Vs (productMemoryWeight μ ν) (productMemoryWeight μ ν) (fun s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) => fullMemoryVacuum s.2) output H K hH hK he have hv := physical_small_big_normalized_vacuum_norm_le (J := J) (ell := ell) Vs hVs hMass μ ν hμ (fun _ => J + ell) B have hr := physical_small_big_initial_readout_norm_le Vs C μ ν empty boundary output hVs hMass hμ hν hempty hb refine hr.trans ((mul_le_mul_of_nonneg_left hn (Real.sqrt_nonneg _)).trans ?_) calc _ ≤ Real.sqrt mass * (H * Real.sqrt K * Real.sqrt mass) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hv (mul_nonneg hH (Real.sqrt_nonneg K))) (Real.sqrt_nonneg mass) _ = H * Real.sqrt K * (Real.sqrt mass) ^ 2 := by ring _ = H * Real.sqrt K * mass := by rw [Real.sq_sqrt hm] omit [∀ g, Fintype (Z g)] in theorem physical_cap_initial_readout_mask (hempty : ∀ g, (empty g).1.val = 0) (I : ℕ) : physicalSmallBigInitialReadout Vs C μ empty boundary (fun s => if productTotalMemory s.2 ≤ I then output s else 0) = physicalSmallBigInitialReadout Vs C μ empty boundary output := by unfold physicalSmallBigInitialReadout apply sum_congr rfl intro s _ congr 1 apply sum_congr rfl intro L _ have ht : productTotalMemory (physicalFullMemoryState C L empty) ≤ I := by simp only [physical_full_memory_state_total, hempty, sum_const_zero, Nat.zero_le] dsimp only rw [if_pos ht] theorem physical_cap_initial_readout_le_of_masked_energy (hVs : ∀ s, 0 < Vs s) (hMass : ∀ s, ∑ p ∈ Ps s, 1 / (p : ℝ) = Vs s) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (hempty : ∀ g, (empty g).1.val = 0) (hb : ∀ s x, ‖boundary s x‖ ≤ 1) (H K : ℝ) (hH : 0 ≤ H) (hK : 0 ≤ K) (I : ℕ) (he : physicalSmallBigEnergy Vs (productMemoryWeight μ ν) (fun s => if productTotalMemory s.2 ≤ I then output s else 0) ≤ H ^ 2 * K * physicalSmallBigEnergy Vs (productMemoryWeight μ ν) (fun s : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) => fullMemoryVacuum s.2)) : ‖physicalSmallBigInitialReadout Vs C μ empty boundary output‖ ≤ H * Real.sqrt K * ∏ g, (∑ p, μ g p) ^ (J + ell) := by rw [← physical_cap_initial_readout_mask Vs C μ empty boundary output hempty I] exact physical_cap_initial_readout_le_of_energy Vs C μ ν empty boundary (fun s => if productTotalMemory s.2 ≤ I then output s else 0) hVs hMass hμ hν hempty hb H K hH hK he end Readout end Bounty end -- Source module: PhysicalMixedPathSupport section /- Invalid source states have zero weight on every path containing an edge, so arbitrary whole-path decorations retain the same support. -/ open Finset open scoped Classical namespace Bounty section Paths variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] [Fintype I] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) omit [Fintype I] [∀ g, Fintype (P g)] [∀ i, Fintype (A i)] [∀ g p, NeZero (n g p)] in theorem physical_mixed_word_path_weight_invalid (tags : List (Option (V ⊕ K))) (hedge : ∃ k, some (.inr k) ∈ tags) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (p : FiniteEventPath (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) tags s) (h : ¬ physicalResidueMarksValid s.1.1 s.1.2) : finiteEventPathWeight (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge) tags s p = 0 := by induction tags generalizing s with | nil => rcases hedge with ⟨k, hk⟩ exact False.elim (List.not_mem_nil hk) | cons tag tags ih => rcases p with ⟨ev, p⟩ cases tag with | none => rcases hedge with ⟨k, hk⟩ have hmem := (List.mem_cons.mp hk).resolve_left (by intro hbad; cases hbad) have ht : ¬ physicalResidueMarksValid (physicalMixedWordTarget n shared B A Δ D kbig none s ev).1.1 (physicalMixedWordTarget n shared B A Δ D kbig none s ev).1.2 := by change ¬ physicalResidueMarksValid s.1.1 (physicalPermuteLabels ev.1 s.1.2) rwa [physical_residue_marks_valid_permute] exact mul_eq_zero_of_right _ (ih ⟨k, hmem⟩ _ p ht) | some tag => cases tag with | inl j => rcases hedge with ⟨k, hk⟩ have hmem := (List.mem_cons.mp hk).resolve_left (by intro hbad; cases hbad) exact mul_eq_zero_of_right _ (ih ⟨k, hmem⟩ _ p h) | inr k => simp only [finiteEventPathWeight, physicalMixedWordWeight, physicalSmallBigPositiveWeight, physicalResidueVertexWeight, if_neg h, zero_mul, mul_zero, ite_self] theorem physical_mixed_word_path_action_invalid (tags : List (Option (V ⊕ K))) (hedge : ∃ k, some (.inr k) ∈ tags) (pathPhase : ∀ s, FiniteEventPath (PhysicalMixedWordEvent (ell := ell) n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) tags s → ℂ) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (h : ¬ physicalResidueMarksValid s.1.1 s.1.2) : physicalMixedWordPathAction n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge tags pathPhase F s = 0 := by unfold physicalMixedWordPathAction finiteEventPathAction apply sum_eq_zero intro p _ rw [physical_mixed_word_path_weight_invalid n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge tags hedge s p h] simp only [Complex.ofReal_zero, zero_mul] end Paths end Bounty end -- Source module: PhysicalRootCapSourceSupport section /- Invalid small sources vanish for the genuine whole-path root phase at every cap. -/ open Finset open scoped Classical namespace Bounty section Action variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) theorem physical_root_mixed_action_invalid (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (hinvalid : ¬ physicalResidueMarksValid (physicalGroupResidueVector r) L) : physicalRootMixedAction groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis f L x = 0 := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) unfold physicalRootMixedAction dsimp only apply physical_mixed_word_path_action_invalid · refine ⟨(0 : Fin (n + 1)), List.mem_map.mpr ⟨2, ?_, ?_⟩⟩ · simp only [List.mem_range]; omega · simpa using physical_selected_fine_tag_edge (0 : Fin (n + 1)) · exact hinvalid end Action section Scalar variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) theorem physical_root_scalar_vector_action_invalid (r : PhysicalResidues (fun s : ↥groupsᶜ => P s.val)) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (hinvalid : ¬ physicalResidueMarksValid r L) : physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis ((r, L), x) = 0 := by unfold physicalRootScalarVectorAction apply physical_root_mixed_action_invalid change ¬ physicalResidueMarksValid ((physicalGroupResidueVectorEquiv P groupsᶜ) ((physicalGroupResidueVectorEquiv P groupsᶜ).symm r)) L simpa only [Equiv.apply_symm_apply] using hinvalid end Scalar end Bounty end -- Source module: PhysicalCapReadoutAlgebra section /- Exact initial-readout subtraction and transport between empty-memory caps. -/ open Finset open scoped Classical namespace Bounty section variable {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Finset ℕ} {Z : G → Type*} {J ell b B : ℕ} (Vs : S → ℝ) (C : G → Finset (Fin J)) (μ : ∀ g, P g → ℝ) theorem physical_small_big_initial_readout_sub (empty : ∀ g, BoundedOrderedTuple (Z g) b) (boundary : PhysicalBareResidueState Ps J ell → ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) b → ℂ) (F G : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) b) → ℂ) : physicalSmallBigInitialReadout Vs C μ empty boundary (fun s => F s - G s) = physicalSmallBigInitialReadout Vs C μ empty boundary F - physicalSmallBigInitialReadout Vs C μ empty boundary G := by simp only [physicalSmallBigInitialReadout, mul_sub, sum_sub_distrib] theorem physical_small_big_initial_readout_cap_pullback (h : b ≤ B) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) → ℂ) : physicalSmallBigInitialReadout Vs C μ (fun g => fullEmptyBoundedMemory (Z g) b) (fun _ _ => 1) (fun s => F (physicalSmallBigCapEmbed h s)) = physicalSmallBigInitialReadout Vs C μ (fun g => fullEmptyBoundedMemory (Z g) B) (fun _ _ => 1) F := rfl theorem physical_small_big_initial_readout_cap_sub (h : b ≤ B) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) → ℂ) (G : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) b) → ℂ) : physicalSmallBigInitialReadout Vs C μ (fun g => fullEmptyBoundedMemory (Z g) b) (fun _ _ => 1) (fun s => F (physicalSmallBigCapEmbed h s) - G s) = physicalSmallBigInitialReadout Vs C μ (fun g => fullEmptyBoundedMemory (Z g) B) (fun _ _ => 1) F - physicalSmallBigInitialReadout Vs C μ (fun g => fullEmptyBoundedMemory (Z g) b) (fun _ _ => 1) G := by rw [physical_small_big_initial_readout_sub, physical_small_big_initial_readout_cap_pullback] end end Bounty end -- Source module: PhysicalRootCapScalarDifference section /- The exact original normalized root scalar difference is a mixed cap readout. -/ open Finset Classical namespace Bounty section Scalar variable {I : Type} {N M J ell n b B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) noncomputable def physicalRootNormalizedMixedScalar : ℂ := ∑ r : PhysicalGroupResidues P groupsᶜ, ((∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ) : ℝ) : ℂ) * physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis theorem physical_root_normalized_mixed_scalar_eq_readout : letI : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) physicalRootNormalizedMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis = physicalSmallBigInitialReadout (fun s : ↥groupsᶜ => V s.val) (fun _ : Fin M => ∅) (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩ / V (e.symm g).val) (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B) (fun _ _ => 1) (physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis) := by exact physical_root_mixed_scalar_average_eq_readout groups e patterns C hC V q ζ k K θ β ρ hP hdis (physical_root_scalar_vector_action_invalid groups e patterns C hC V q ζ k K θ β ρ hP hdis) theorem physical_root_normalized_mixed_scalar_cap_sub (h : b ≤ B) : letI : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) physicalRootNormalizedMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis - physicalRootNormalizedMixedScalar (n := n) (B := b) groups e patterns C hC V q ζ k K θ β ρ hP hdis = physicalSmallBigInitialReadout (fun s : ↥groupsᶜ => V s.val) (fun _ : Fin M => ∅) (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩ / V (e.symm g).val) (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) b) (fun _ _ => 1) (fun s => physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis (physicalSmallBigCapEmbed h s) - physicalRootScalarVectorAction (n := n) (B := b) groups e patterns C hC V q ζ k K θ β ρ hP hdis s) := by let : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) have hlarge := physical_root_normalized_mixed_scalar_eq_readout (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis have hsmall := physical_root_normalized_mixed_scalar_eq_readout (P := P) (J := J) (ell := ell) (n := n) (B := b) groups e patterns C hC V q ζ k K θ β ρ hP hdis exact (congrArg₂ (fun x y : ℂ => x - y) hlarge hsmall).trans (physical_small_big_initial_readout_cap_sub (S := ↥groupsᶜ) (Ps := fun s : ↥groupsᶜ => P s.val) (P := fun g : Fin M => P (e.symm g).val) (Z := fun g : Fin M => UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) (J := J) (ell := ell) (b := b) (B := B) (fun s : ↥groupsᶜ => V s.val) (fun _ : Fin M => ∅) (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩ / V (e.symm g).val) h (physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis) (physicalRootScalarVectorAction (n := n) (B := b) groups e patterns C hC V q ζ k K θ β ρ hP hdis)).symm end Scalar end Bounty end -- Source module: PhysicalRootCapScalarBound section /- The unchanged normalized root scalar obeys the quantitative memory-cap bound. -/ open Finset open scoped Classical namespace Bounty section Scalar variable {I : Type} {N M J ell n b B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) theorem physical_root_normalized_mixed_scalar_cap_bound (h : b ≤ B) (vs : ℝ) (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hVs : ∀ s : ↥groupsᶜ, vs ≤ V s.val) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (v vmin vmax : ℝ) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hVlo : ∀ g : Fin M, vmin ≤ V (e.symm g).val) (hVhi : ∀ g : Fin M, V (e.symm g).val ≤ vmax) (hμ : ∀ (g : Fin M) (p : P (e.symm g).val), 0 < β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (hmass : ∀ g : Fin M, ∑ p : P (e.symm g).val, β ⟨(e.symm g).val, p⟩ / V (e.symm g).val ≤ 2) (hqg0 : ∀ j : Fin (n + 2), 0 ≤ physicalEndpointSchedule q (n + 1) j.val) (hqg1 : ∀ j : Fin (n + 2), physicalEndpointSchedule q (n + 1) j.val ≤ 1) (hD : ∀ j : Fin (n + 2), physicalEndpointSchedule q (n + 1) j.val / ρ ^ 2 + ((1 - physicalEndpointSchedule q (n + 1) j.val) / ρ) / v ≤ 1) (hCghost : ∀ (j : Fin (n + 2)) (g : Fin M), physicalEndpointSchedule q (n + 1) j.val / ρ ^ 2 + ((1 - physicalEndpointSchedule q (n + 1) j.val) * (2 * V (e.symm g).val) / ρ) / v ≤ 1) (T : ℕ) (hT : ∀ (i : patterns) (g : Fin M), (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) (H : ℝ) (hH : 1 ≤ H) (hK : ∀ t < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K t i L R a‖ ≤ H) : ‖physicalRootNormalizedMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis - physicalRootNormalizedMixedScalar (n := n) (B := b) groups e patterns C hC V q ζ k K θ β ρ hP hdis‖ ≤ H ^ (4 * (n + 1) + 1) * ((2 : ℝ) ^ (b + 1 - fullMemoryEdgeCount ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) * (T * M)))⁻¹ * Real.sqrt ((((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))).map (physicalMixedWordStepEnergy (physicalMixedCapConditioningConstant q vs ell hq0 hq1 hvs) ρ v vmin vmax (2 * vmax) T (Fintype.card ↥groupsᶜ) M (Fintype.card ↥patterns))).prod) * ∏ g : Fin M, (∑ p : P (e.symm g).val, β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) ^ (J + ell) := by let : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) let : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let steps := (List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)) let E := (steps.map (physicalMixedWordStepEnergy (physicalMixedCapConditioningConstant q vs ell hq0 hq1 hvs) ρ v vmin vmax (2 * vmax) T (Fintype.card ↥groupsᶜ) M (Fintype.card ↥patterns))).prod let loss := ((2 : ℝ) ^ (b + 1 - fullMemoryEdgeCount steps * (T * M)))⁻¹ have hE : 0 ≤ E := by apply List.prod_nonneg intro x hx obtain ⟨tag, _, rfl⟩ := List.mem_map.mp hx exact physical_mixed_word_step_energy_nonneg _ _ _ _ _ _ _ _ _ _ (zero_le_one.trans (physical_mixed_cap_conditioning_constant_ge_one q vs ell hq0 hq1 hvs)) tag have hloss : 0 ≤ loss := inv_nonneg.mpr (pow_nonneg (by norm_num) _) have he := physical_root_scalar_cap_energy_bound groups e patterns C hC V q ζ k K θ β ρ hP hdis h vs hq0 hq1 hvs hVs hV hMass v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass hqg0 hqg1 hD hCghost T hT H hH hK have hr := physical_cap_initial_readout_le_of_masked_energy (J := J) (ell := ell) (b := b) (B := B) (fun s : ↥groupsᶜ => V s.val) (fun _ : Fin M => ∅) (fun (g : Fin M) (p : P (e.symm g).val) => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β ⟨(e.symm g).val, p⟩ / V (e.symm g).val)) (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) b) (fun _ _ => 1) (fun s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e => physicalRootScalarVectorAction (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis (physicalSmallBigCapEmbed h s) - physicalRootScalarVectorAction (n := n) (B := b) groups e patterns C hC V q ζ k K θ β ρ hP hdis s) (fun s => hV s.val) (fun s => hMass s.val) (fun g p => (hμ g p).le) (fun g z => (hμ g z.1).le) (fun _ => rfl) (by intro s x; simp only [norm_one, le_refl]) (H ^ (4 * (n + 1) + 1)) (loss ^ 2 * E) (pow_nonneg (zero_le_one.trans hH) _) (mul_nonneg (sq_nonneg loss) hE) 0 he apply (congrArg norm (physical_root_normalized_mixed_scalar_cap_sub groups e patterns C hC V q ζ k K θ β ρ hP hdis h)).le.trans simpa only [Real.sqrt_mul (sq_nonneg loss), Real.sqrt_sq hloss, mul_assoc] using hr end Scalar end Bounty end -- Source module: OriginalRootCapError section /- The original scalar cap error decays at the original root-moment power. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_original_root_scalar_cap_error {q vs ρ v vmin vmax CG PG HG F : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hCG : 0 ≤ CG) (hPG : 0 ≤ PG) (hHG : 0 ≤ HG) (hF : 0 ≤ F) (J ell T : ℕ) : ∀ᶠ L : ℝ in atTop, let n := 2*Nat.ceil (L^(13/25 : ℝ))-1 ∀ (I : Type) (N M b B : ℕ) (P : Fin N → Finset ℕ) [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))), L ≤ (b : ℝ) → b ≤ B → (Fintype.card ↥groupsᶜ : ℝ) ≤ CG*Real.log L → (M : ℝ) ≤ CG*Real.log L → (Fintype.card ↥patterns : ℝ) ≤ L^PG → (∀ s : ↥groupsᶜ, vs ≤ V s.val) → (∀ g, 0 < V g) → (∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g) → 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g : Fin M, vmin ≤ V (e.symm g).val) → (∀ g : Fin M, V (e.symm g).val ≤ vmax) → (∀ (g : Fin M) (p : P (e.symm g).val), 0 < β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) → (∀ g : Fin M, ∑ p : P (e.symm g).val, β ⟨(e.symm g).val, p⟩ / V (e.symm g).val ≤ 2) → (∀ j : Fin (n+2), 0 ≤ physicalEndpointSchedule q (n+1) j.val) → (∀ j : Fin (n+2), physicalEndpointSchedule q (n+1) j.val ≤ 1) → (∀ j : Fin (n+2), physicalEndpointSchedule q (n+1) j.val / ρ^2 + ((1-physicalEndpointSchedule q (n+1) j.val)/ρ)/v ≤ 1) → (∀ (j : Fin (n+2)) (g : Fin M), physicalEndpointSchedule q (n+1) j.val / ρ^2 + ((1-physicalEndpointSchedule q (n+1) j.val)*(2*V (e.symm g).val)/ρ)/v ≤ 1) → (∀ (i : patterns) (g : Fin M), (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) → ∀ H : ℝ, 1 ≤ H → H ≤ L^HG → (∀ t < n+1, ∀ i ∈ patterns, ∀ L R a, ‖K t i L R a‖ ≤ H) → ‖physicalRootNormalizedMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis - physicalRootNormalizedMixedScalar (n := n) (B := b) groups e patterns C hC V q ζ k K θ β ρ hP hdis‖ ≤ (L^(-F))^(2*Nat.ceil (L^(13/25 : ℝ))) := by let A := physicalMixedCapConditioningConstant q vs ell hq0 hq1 hvs let D := max 1 (max A (max (physicalGhostUniformEnergyBound ρ (2*vmax) v) (unrestrictedEdgeEnergyBound ρ v vmin vmax T))) have hD : 1 ≤ D := le_max_left _ _ have hA : 0 ≤ A := zero_le_one.trans (physical_mixed_cap_conditioning_constant_ge_one q vs ell hq0 hq1 hvs) have hAD : A ≤ D := (le_max_left _ _).trans (le_max_right _ _) have hgD : physicalGhostUniformEnergyBound ρ (2*vmax) v ≤ D := ((le_max_left _ _).trans (le_max_right _ _)).trans (le_max_right _ _) have heD : unrestrictedEdgeEnergyBound ρ v vmin vmax T ≤ D := ((le_max_right _ _).trans (le_max_right _ _)).trans (le_max_right _ _) filter_upwards [eventually_root_mixed_cap_cost_bound hD hCG hPG hHG hF hA hAD hgD T (J+ell) heD, eventually_ge_atTop (1 : ℝ)] with L hcost hL intro n I N M b B P _ groups e patterns C hC V ζ k K θ β hP hdis hb hbb hs hm hp hVs hV hMass hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass hqg0 hqg1 hDghost hCghost hT H hH hHpow hK have hpower : 1 ≤ L^(13/25 : ℝ) := Real.one_le_rpow hL (by norm_num) have hr : 1 ≤ Nat.ceil (L^(13/25 : ℝ)) := by have h := hpower.trans (Nat.le_ceil (L^(13/25 : ℝ))) exact_mod_cast h have hn : n+1 = 2*Nat.ceil (L^(13/25 : ℝ)) := by dsimp only [n]; omega let steps := (List.range (4*(n+1)+1)).map (physicalSelectedFineTag (n+1)) have hlen : (steps.length : ℝ) ≤ 17*L^(13/25 : ℝ) := by simpa only [steps, List.length_map, List.length_range, hn] using (root_moment_length_and_loss hL M T hm).1 have hbound := hcost b (Fintype.card ↥groupsᶜ) M (Fintype.card ↥patterns) hb hs hm hp _ _ steps hlen H (zero_le_one.trans hH) hHpow (fun g : Fin M => ∑ p : P (e.symm g).val, β ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun g => ⟨sum_nonneg (fun p _ => (hμ g p).le), hmass g⟩) apply (physical_root_normalized_mixed_scalar_cap_bound groups e patterns C hC V q ζ k K θ β ρ hP hdis hbb vs hq0 hq1 hvs hVs hV hMass v vmin vmax hρ0 hρ1 hv hvmin hVlo hVhi hμ hmass hqg0 hqg1 hDghost hCghost T hT H hH hK).trans simpa only [steps, List.length_map, List.length_range, A] using hbound end Bounty end end section -- Source module: ActualSelectedResidueCore /- Original-data residue interfaces, reindexing, and finite endpoint bounds. -/ open scoped Topology BigOperators Classical -- Source module: PhysicalRootMixedForests section /- The original mixed root action is a signed sum of common forests, with the entire small-plan and signed pattern sum inside each forest term. -/ open Finset Classical namespace Bounty section Action variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootMixedForestAction (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ℂ := let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) ∑ sp : PhysicalMixedSmallPlan (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))), physicalRootCommonForestAction groups e patterns C hC k (L, sp) V q ζ K r θ β retention ρ code f x include hPs hPb hdis in theorem physical_root_mixed_action_forests (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (hinj : Function.Injective encode) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (hx : FullActiveInjective x) (hcover : FullMixedLedgerCovers (fun g (p : P (e.symm g).val) => p.val) B (fullActiveInitialLedger x, x)) : physicalRootMixedAction groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis f L x = ∑ code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B), (-1 : ℂ) ^ birthForestRank code * physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code f L x := by let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) rw [physical_root_mixed_action_eq_plan_sum] simp_rw [physical_root_effective_common_forests groups e patterns C hC k _ V q ζ K r θ β retention ρ encode hinj f x hx hcover] rw [sum_comm] apply sum_congr rfl intro code _ unfold physicalRootMixedForestAction rw [mul_sum] end Action end Bounty end -- Source module: PhysicalRootForestScalar section /- The literal original root scalar, including initial mark weights, is a signed common-forest sum. -/ open Finset Classical namespace Bounty section Scalar variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) noncomputable def physicalRootForestScalar : ℂ := (physicalStateMass (fun s : ↥groupsᶜ => V s.val) J ell : ℂ) * ∑ Ls : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell, ∑ Lb : PhysicalMarkLists (fun g => P (e.symm g).val) J ell, ((∏ g, ∏ s : PhysicalSlots J ell, β ⟨(e.symm g).val, Lb g s⟩ / V (e.symm g).val : ℝ) : ℂ) * ∑ code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B), (-1 : ℂ) ^ birthForestRank code * physicalRootMixedForestAction (n := n) groups e patterns C hC k V q ζ K r θ (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ code fullMemoryVacuum Ls (physicalFullMemoryState (fun _ => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B)) theorem physical_root_mixed_scalar_forests (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (hinj : Function.Injective encode) : physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis = physicalRootForestScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ := by unfold physicalRootMixedScalar physicalRootForestScalar congr 1 apply sum_congr rfl intro Ls _ apply sum_congr rfl intro Lb _ congr 1 apply physical_root_mixed_action_forests _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ encode hinj · exact physical_full_state_injective _ _ _ · exact physical_full_empty_initial_ledger_covers _ _ end Scalar end Bounty end -- Source module: PhysicalSmallBigReadoutNorm section /- Passing an operator estimate to the original normalized readout does not introduce a factor for the number of small residue classes. -/ open Finset open scoped Classical namespace Bounty section Readout variable {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Finset ℕ} {Z : G → Type*} [∀ g, Fintype (Z g)] {J ell B : ℕ} (Vs : S → ℝ) (C : G → Finset (Fin J)) (μ : ∀ g, P g → ℝ) (ν : ∀ g, Z g → ℝ) (empty : ∀ g, BoundedOrderedTuple (Z g) B) (boundary : PhysicalBareResidueState Ps J ell → ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) → ℂ) theorem physical_small_big_readout_of_unnormalized_norm (hVs : ∀ s, 0 < Vs s) (hMass : ∀ s, ∑ p ∈ Ps s, 1 / (p : ℝ) = Vs s) (hμ : ∀ g p, 0 ≤ μ g p) (hν : ∀ g z, 0 ≤ ν g z) (hempty : ∀ g, (empty g).1.val = 0) (hb : ∀ s x, ‖boundary s x‖ ≤ 1) {K : ℝ} (hK : 0 ≤ K) (hF : cleanActiveNorm (physicalSmallBigMeasure Vs (productMemoryWeight μ ν)) F ≤ K * cleanActiveNorm (physicalSmallBigMeasure (P := Ps) (J := J) (ell := ell) Vs (productMemoryWeight μ ν)) (fun s => fullMemoryVacuum (M := fun _ => J + ell) (B := B) s.2)) : ‖physicalSmallBigInitialReadout Vs C μ empty boundary F‖ ≤ K * ∏ g, (∑ p, μ g p) ^ (J + ell) := by apply physical_small_big_initial_readout_operator_bound Vs C μ ν empty boundary F hVs hMass hμ hν hempty hb hK rw [physical_small_big_normalized_norm_eq, physical_small_big_normalized_norm_eq] calc _ ≤ Real.sqrt (∏ p : PhysicalPrime Ps, (1 : ℝ) / p.2.val) * (K * cleanActiveNorm (physicalSmallBigMeasure Vs (productMemoryWeight μ ν)) (fun s => fullMemoryVacuum (M := fun _ => J + ell) (B := B) s.2)) := mul_le_mul_of_nonneg_left hF (Real.sqrt_nonneg _) _ = _ := by ring end Readout end Bounty end -- Source module: PhysicalRootFourierReadout section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) noncomputable def physicalRootFourierVectorAction (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ := finiteOperatorListAction (physicalRootFourierRow groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (fun s => f s.2) noncomputable def physicalRootFourierBoundary (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ℂ := fullMixedCommonBoundaryMultiplier (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) code ν encode (fullMixedCommonInitialPrime x) omit [∀ z : PhysicalPrime P, NeZero z.2.val] in theorem physical_root_fourier_boundary_norm_le (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ‖physicalRootFourierBoundary groups e code encode ν x‖ ≤ 1 := full_mixed_common_boundary_multiplier_norm_le _ _ _ _ _ _ _ variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] noncomputable def physicalRootFourierReadout : ℂ := physicalSmallBigInitialReadout (fun s : ↥groupsᶜ => V s.val) (fun _ : Fin M => ∅) (fun g p => β g p / V (e.symm g).val) (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B) (fun _ => physicalRootFourierBoundary groups e code encode ν) (physicalRootFourierVectorAction groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν fullMemoryVacuum) variable [∀ g (z : P (e.symm g).val), NeZero z.val] theorem physical_root_fourier_readout_norm_le (hVs : ∀ s : ↥groupsᶜ, 0 < V s.val) (hMass : ∀ s : ↥groupsᶜ, ∑ p ∈ P s.val, 1 / (p : ℝ) = V s.val) (hμ : ∀ g p, 0 ≤ β g p / V (e.symm g).val) {bound : ℝ} (hbound : 0 ≤ bound) (hF : cleanActiveNorm (physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val)))) (physicalRootFourierVectorAction groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν fullMemoryVacuum) ≤ bound * cleanActiveNorm (physicalSmallBigMeasure (P := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val)))) (fun s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e => fullMemoryVacuum s.2)) : ‖physicalRootFourierReadout groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν‖ ≤ bound * ∏ g, (∑ p, β g p / V (e.symm g).val) ^ (J + ell) := by apply physical_small_big_readout_of_unnormalized_norm (fun s : ↥groupsᶜ => V s.val) (fun _ : Fin M => ∅) (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val)) _ _ _ hVs hMass hμ · intro g z exact hμ g z.1 · intro g rfl · intro s x exact physical_root_fourier_boundary_norm_le groups e code encode ν x · exact hbound · exact hF end Root end Bounty end -- Source module: PhysicalMixedWordSupport section /- An actual edge annihilates invalid small source states. Ghosts and permutations preserve this support, with arbitrary local decorations. -/ open Finset open scoped Classical namespace Bounty section Support variable {S G I V K : Type} [Fintype S] [Fintype G] [DecidableEq G] [Fintype I] {Ps : S → Finset ℕ} {P : G → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) (phase : ∀ tag s, PhysicalMixedWordEvent (ell := ell) n shared B A Δ D tag s → ℂ) theorem physical_mixed_word_row_edge_invalid (k : K) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (h : ¬ physicalResidueMarksValid s.1.1 s.1.2) : physicalMixedWordRow n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase (some (.inr k)) F s = 0 := by unfold physicalMixedWordRow finiteLocalPhasedRow apply sum_eq_zero intro e _ simp only [physicalMixedWordWeight, physicalSmallBigPositiveWeight, physicalResidueVertexWeight, if_neg h, zero_mul, mul_zero, ite_self, Complex.ofReal_zero] theorem physical_mixed_word_row_preserves_valid_support (tag : Option (V ⊕ K)) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) (hF : ∀ s, ¬ physicalResidueMarksValid s.1.1 s.1.2 → F s = 0) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (h : ¬ physicalResidueMarksValid s.1.1 s.1.2) : physicalMixedWordRow n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase tag F s = 0 := by cases tag with | none => unfold physicalMixedWordRow finiteLocalPhasedRow apply sum_eq_zero intro e _ rw [hF _ (by change ¬ physicalResidueMarksValid s.1.1 (physicalPermuteLabels e.1 s.1.2) rwa [physical_residue_marks_valid_permute])] exact mul_zero _ | some tag => cases tag with | inl j => unfold physicalMixedWordRow finiteLocalPhasedRow apply sum_eq_zero intro e _ rw [hF (physicalMixedWordTarget n shared B A Δ D kbig (some (.inl j)) s e) h] exact mul_zero _ | inr k => exact physical_mixed_word_row_edge_invalid n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase k F s h theorem physical_mixed_word_action_invalid (tags : List (Option (V ⊕ K))) (hedge : ∃ k, some (.inr k) ∈ tags) (F : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B → ℂ) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (h : ¬ physicalResidueMarksValid s.1.1 s.1.2) : finiteOperatorListAction (physicalMixedWordRow n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase) tags F s = 0 := by induction tags generalizing s with | nil => rcases hedge with ⟨k, hk⟩ exact False.elim (List.not_mem_nil hk) | cons tag tags ih => rcases hedge with ⟨k, hk⟩ rcases List.mem_cons.mp hk with heq | hmem · subst tag exact physical_mixed_word_row_edge_invalid n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase k _ s h · exact physical_mixed_word_row_preserves_valid_support n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge phase tag _ (fun t ht => ih ⟨k, hmem⟩ t ht) s h end Support end Bounty end -- Source module: PhysicalRootFourierSupport section /- The exact original Fourier word has valid small source support. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) theorem physical_root_fourier_word_invalid (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (h : ¬ physicalResidueMarksValid (physicalGroupResidueVector r) L) : physicalRootFourierWord groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν f L x = 0 := by unfold physicalRootFourierWord apply @physical_mixed_word_action_invalid ↥groupsᶜ (Fin M) ↥patterns (Fin (n + 2)) (Fin (n + 1)) _ _ _ _ (fun a : ↥groupsᶜ => P a.val) (fun g => ↥(P (e.symm g).val)) _ (fun _ p => p.val) (fun g p => inferInstanceAs (NeZero (⟨(e.symm g).val, p⟩ : PhysicalPrime P).2.val)) · refine ⟨⟨0, Nat.zero_lt_succ n⟩, List.mem_map.mpr ⟨2, ?_, ?_⟩⟩ · apply List.mem_range.mpr omega · have hi : 2 < 4 * (n + 1) + 1 := by omega simp only [physicalSelectedFineTag, dif_pos hi] rfl · exact h end Root end Bounty end -- Source module: PhysicalRootFourierAction section /- The initial common Fourier factor is a boundary multiplier outside the exact effective root path action. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootEffectiveFourierAction (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ℂ := let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalFullEdgeDelta (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) (kb key) let displacement := fun key => physicalFullEdgeD (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) let omega := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) a let _ := fullPermutationMixedEventFintype (J := Fin (n + 2)) sizes shared B aux delta displacement let _ := finiteEventPathFintype (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x fullPermutationMixedPathAction sizes shared B aux delta displacement omega (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) steps (fun y path => physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 y path * finiteEventLocalPhase (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) (physicalRootEffectiveFourierPhase groups e patterns C hC k V ζ K θ β ρ code encode ν) steps y path) f x theorem physical_root_plan_fourier_action (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : physicalRootPlanFourierIntegrand groups e patterns C hC k pl V q ζ K r θ β retention ρ code encode ν f x = fullMixedCommonBoundaryMultiplier (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) code ν encode (fullMixedCommonInitialPrime x) * physicalRootEffectiveFourierAction groups e patterns C hC k pl V q ζ K r θ β retention ρ code encode ν f x := by unfold physicalRootPlanFourierIntegrand physicalRootEffectiveFourierAction fullPermutationMixedPathAction finiteEventPathAction physicalRootEffectiveFourierPhase dsimp only rw [mul_sum] apply sum_congr rfl intro path _ ring end Root end Bounty end -- Source module: PhysicalRootPlanIntegrable section /- Integrability of the literal root Fourier integrand retains the exact path-dependent small-plan factor. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) theorem physical_root_plan_fourier_integrable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : Integrable (fun ν => physicalRootPlanFourierIntegrand groups e patterns C hC k pl V q ζ K r θ β retention ρ code encode ν f x) (birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))))) := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalFullEdgeDelta (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) (kb key) let displacement := fun key => physicalFullEdgeD (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) let omega := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) a let _ := fullPermutationMixedEventFintype (J := Fin (n + 2)) sizes shared B aux delta displacement let _ := finiteEventPathFintype (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x let F := fun path : FullPermutationMixedPath sizes shared B aux delta displacement steps x => physicalEffectivePlanSmallFactor (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 x path * f (finiteEventPathTerminal (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) steps x path) exact physical_selected_plan_fourier_integrable sizes shared B aux delta displacement (physicalFullCombinedEdgePhase Cb kb omega β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ)) omega (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) pl.1 pl.2 univ (fun _ => x) (fun path => path) F encode code end Root end Bounty end -- Source module: PhysicalRootMixedFourier section /- The original root forest action places its complete small-plan sum inside the common Fourier integral. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootMixedFourierIntegrand (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ℂ := let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) ∑ sp : PhysicalMixedSmallPlan (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))), physicalRootPlanFourierIntegrand groups e patterns C hC k (L, sp) V q ζ K r θ β retention ρ code encode ν f x theorem physical_root_mixed_forest_fourier (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (hinj : Function.Injective encode) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code f L x = ∫ ν, physicalRootMixedFourierIntegrand groups e patterns C hC k V q ζ K r θ β retention ρ code encode ν f L x ∂birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) := by let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) dsimp only [physicalRootMixedForestAction, physicalRootMixedFourierIntegrand] rw [integral_finsetSum] · apply sum_congr rfl intro sp _ exact physical_root_common_forest_fourier groups e patterns C hC k (L, sp) V q ζ K r θ β retention ρ code encode hinj f x · intro sp _ exact physical_root_plan_fourier_integrable groups e patterns C hC k (L, sp) V q ζ K r θ β retention ρ code encode f x end Root end Bounty end -- Source module: PhysicalMixedEffectiveLocal section /- The actual physical effective-parameter equivalence transports arbitrary ordinary local phases to the original big-event paths. -/ namespace Bounty section Effective variable {S K V : Type} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) (C : K → Fin N → Finset (Fin J)) (d : K → PhysicalSharedLists Ps J) (k : K → ℤ) (B : ℕ) theorem physical_mixed_effective_big_local_phase (phase : ∀ (tag : Option (V ⊕ K)), (x : PhysicalFullBoundedState P J ell B) → FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key)) tag x → ℂ) (steps : List (Option (V ⊕ K))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) steps x) : finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key))) phase steps x (physicalMixedEffectiveBigPathEquiv hPs hP hdis C d k B steps x p) = finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key))) (fun tag x e => phase tag x (physicalMixedEffectiveBigEventEquiv hPs hP hdis C d k B tag x e)) steps x p := by unfold physicalMixedEffectiveBigPathEquiv physicalMixedEffectiveBigEventEquiv exact finite_event_local_phase_equiv _ _ _ _ id _ _ _ _ (fun _ _ _ => rfl) steps x p end Effective end Bounty end -- Source module: PhysicalMixedEffectiveLocalAction section /- Exact transport of the original planned action, retaining its small factor and an arbitrary effective local phase at every event. -/ open scoped Classical namespace Bounty theorem physical_mixed_effective_local_action {S I V K : Type} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} [∀ g, ∀ p : P g, NeZero p.val] (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) (C : I → Fin N → Finset (Fin J)) (k : K → I → ℤ) (B : ℕ) (ω : ∀ i, SharedActiveLabels (fun g => P g) (fun g => physicalFullSharedIndices (ell := ell) (C i g)) → PhysicalAuxLabels P (C i) → ℝ) (μ : ∀ g, P g → ℝ) (q : V → ℝ) (ρ : ℝ) (Vb : Fin N → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) (ks : List (Option (V ⊕ K))) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) ks) : let Cb := fun z : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => C z.2.1 let db := fun z : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => physicalSharedPrefix z.2.2.1 let kb := fun z : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => k z.1 z.2.1 let steps := physicalMixedBigSteps ks L pl ∀ (phase : ∀ (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))), (x : PhysicalFullBoundedState P J ell B) → FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun z g => physicalFullSharedIndices (ell := ell) (Cb z g)) B (fun z _ => PhysicalAuxLabels P (Cb z)) (fun z => physicalFullEdgeDelta (Cb z) (kb z * (physicalSharedProduct (db z) : ℕ))) (fun z => physicalFullEdgeD (Cb z)) tag x → ℂ) (f : PhysicalFullBoundedState P J ell B → ℂ), physicalMixedPlannedBigAction (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i => physicalMixedEdgeDelta (C i) (k t i)) (fun _ i => physicalMixedEdgeD (C i)) ω μ q ρ Vb ks L pl (fun x p => (physicalMixedPlanSmallFactor (fun g (p : P g) => p.val) (fun i g => physicalFullSharedIndices (ell := ell) (C i g)) B (fun i => PhysicalAuxLabels P (C i)) (fun t i => physicalMixedEdgeDelta (C i) (k t i)) (fun _ i => physicalMixedEdgeD (C i)) (fun t i => physicalMixedBigStep (C i) (k t i)) Vs qedge ks r L pl x p : ℂ) * finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun z g => physicalFullSharedIndices (ell := ell) (Cb z g)) B (fun z _ => PhysicalAuxLabels P (Cb z)) (fun z => physicalMixedEdgeDelta (Cb z) (kb z) (db z)) (fun z => physicalMixedEdgeD (Cb z) (db z))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun z g => physicalFullSharedIndices (ell := ell) (Cb z g)) B (fun z _ => PhysicalAuxLabels P (Cb z)) (fun z => physicalMixedEdgeDelta (Cb z) (kb z) (db z)) (fun z => physicalMixedEdgeD (Cb z) (db z))) (fun tag x e => phase tag x (physicalMixedEffectiveBigEventEquiv hPs hP hdis Cb db kb B tag x e)) steps x p) f = fullPermutationMixedPathAction (fun g (p : P g) => p.val) (fun z g => physicalFullSharedIndices (ell := ell) (Cb z g)) B (fun z _ => PhysicalAuxLabels P (Cb z)) (fun z => physicalFullEdgeDelta (Cb z) (kb z * (physicalSharedProduct (db z) : ℕ))) (fun z => physicalFullEdgeD (Cb z)) (fun z => ω z.2.1) μ q ρ Vb steps (fun x p => physicalEffectivePlanSmallFactor C k B Vs qedge ks r L pl x p * finiteEventLocalPhase (FullPermutationMixedEvent (fun g (p : P g) => p.val) (fun z g => physicalFullSharedIndices (ell := ell) (Cb z g)) B (fun z _ => PhysicalAuxLabels P (Cb z)) (fun z => physicalFullEdgeDelta (Cb z) (kb z * (physicalSharedProduct (db z) : ℕ))) (fun z => physicalFullEdgeD (Cb z))) (fullPermutationMixedEventTarget (fun g (p : P g) => p.val) (fun z g => physicalFullSharedIndices (ell := ell) (Cb z g)) B (fun z _ => PhysicalAuxLabels P (Cb z)) (fun z => physicalFullEdgeDelta (Cb z) (kb z * (physicalSharedProduct (db z) : ℕ))) (fun z => physicalFullEdgeD (Cb z))) phase steps x p) f := by intro Cb db kb steps phase f refine (physical_mixed_planned_effective_action hPs hP hdis C k B ω μ q ρ Vb ks L pl _ f).trans ?_ apply congrArg (fun phase' => fullPermutationMixedPathAction (fun g (p : P g) => p.val) (fun z g => physicalFullSharedIndices (ell := ell) (Cb z g)) B (fun z _ => PhysicalAuxLabels P (Cb z)) (fun z => physicalFullEdgeDelta (Cb z) (kb z * (physicalSharedProduct (db z) : ℕ))) (fun z => physicalFullEdgeD (Cb z)) (fun z => ω z.2.1) μ q ρ Vb steps phase' f) funext x p rw [physical_mixed_plan_small_factor_effective_pullback C k B hPs hP hdis] congr 1 have h := physical_mixed_effective_big_local_phase hPs hP hdis Cb db kb B phase steps x ((physicalMixedEffectiveBigPathEquiv hPs hP hdis Cb db kb B steps x).symm p) simpa only [Equiv.apply_symm_apply] using h.symm end Bounty end -- Source module: PhysicalRootFourierComposition section /- The original root forest is an integral of the actual mixed operator word, with its exact initial boundary multiplier and original coefficients. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) theorem physical_root_fourier_planned_eq_effective (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : physicalRootFourierPlannedAction groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν pl f x = physicalRootEffectiveFourierAction groups e patterns C hC k pl V q ζ K r θ β retention ρ code encode ν f x := by let _ : ∀ g (z : P (e.symm g).val), NeZero z.val := fun g z => inferInstanceAs (NeZero (⟨(e.symm g).val, z⟩ : PhysicalPrime P).2.val) have h := physical_mixed_effective_local_action hPs hPb hdis (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B (fun (i : patterns) _ a => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) a) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 (physicalRootEffectiveFourierPhase groups e patterns C hC k V ζ K θ β ρ code encode ν) f exact congrFun h x theorem physical_root_mixed_fourier_word (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : physicalRootMixedFourierIntegrand groups e patterns C hC k V q ζ K r θ β retention ρ code encode ν f L x = fullMixedCommonBoundaryMultiplier (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) code ν encode (fullMixedCommonInitialPrime x) * physicalRootFourierWord groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν f L x := by let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) unfold physicalRootMixedFourierIntegrand rw [physical_root_fourier_word_eq_plans, mul_sum] apply sum_congr rfl intro sp _ rw [physical_root_plan_fourier_action, physical_root_fourier_planned_eq_effective] theorem physical_root_forest_eq_integral_word (hinj : Function.Injective encode) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code f L x = ∫ ν, fullMixedCommonBoundaryMultiplier (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) code ν encode (fullMixedCommonInitialPrime x) * physicalRootFourierWord groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν f L x ∂birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) := by rw [physical_root_mixed_forest_fourier groups e patterns C hC k V q ζ K r θ β retention ρ code encode hinj f L x] apply MeasureTheory.integral_congr_ae filter_upwards [] with ν exact physical_root_mixed_fourier_word groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν f L x end Root end Bounty end -- Source module: PhysicalRootFourierVectorSupport section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) theorem physical_root_fourier_vector_invalid (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (r : PhysicalResidues (fun s : ↥groupsᶜ => P s.val)) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (h : ¬ physicalResidueMarksValid r L) : physicalRootFourierVectorAction groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν f ((r, L), x) = 0 := by have hv : physicalGroupResidueVector ((physicalGroupResidueVectorEquiv P groupsᶜ).symm r) = r := (physicalGroupResidueVectorEquiv P groupsᶜ).apply_symm_apply r have hz := physical_root_fourier_word_invalid groups e patterns C hC k V q ζ K ((physicalGroupResidueVectorEquiv P groupsᶜ).symm r) θ β retention ρ hPs hPb hdis code encode ν f L x (by simpa only [hv] using h) rw [physical_root_fourier_word_rows, hv] at hz exact hz include hPs hPb hdis in theorem physical_root_mixed_forest_invalid (hinj : Function.Injective encode) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (h : ¬ physicalResidueMarksValid (physicalGroupResidueVector r) L) : physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code f L x = 0 := by rw [physical_root_forest_eq_integral_word groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode hinj f L x] simp only [physical_root_fourier_word_invalid groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode _ f L x h, mul_zero, MeasureTheory.integral_zero] end Root end Bounty end -- Source module: PhysicalRootInitialScalar section /- The original weighted scalar, including the full small-residue average, is a normalized initial readout whenever the integrand has its true support. -/ open Finset open scoped Classical namespace Bounty section Scalar variable {N M J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) noncomputable def physicalRootInitialScalar (F : PhysicalGroupResidues P groupsᶜ → PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell → PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) : ℂ := ∑ r : PhysicalGroupResidues P groupsᶜ, ((∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ) : ℝ) : ℂ) * ((physicalStateMass (fun s : ↥groupsᶜ => V s.val) J ell : ℂ) * ∑ Ls : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell, ∑ Lb : PhysicalMarkLists (fun g => P (e.symm g).val) J ell, ((∏ g, ∏ i : PhysicalSlots J ell, β g (Lb g i) / V (e.symm g).val : ℝ) : ℂ) * F r Ls (physicalFullMemoryState (fun _ : Fin M => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B))) variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] theorem physical_root_initial_scalar_eq_readout (boundary : PhysicalBareResidueState (fun s : ↥groupsᶜ => P s.val) J ell → PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) (hF : ∀ r L x, ¬ physicalResidueMarksValid r L → F ((r, L), x) = 0) : physicalRootInitialScalar groups e V β (fun r L x => boundary (physicalGroupResidueVector r, L) x * F ((physicalGroupResidueVector r, L), x)) = physicalSmallBigInitialReadout (fun s : ↥groupsᶜ => V s.val) (fun _ : Fin M => ∅) (fun g p => β g p / V (e.symm g).val) (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B) boundary F := by let ψ : PhysicalResidues (fun s : ↥groupsᶜ => P s.val) → ℂ := fun r => (physicalStateMass (fun s : ↥groupsᶜ => V s.val) J ell : ℂ) * ∑ Ls : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell, ∑ Lb : PhysicalMarkLists (fun g => P (e.symm g).val) J ell, ((∏ g, ∏ i : PhysicalSlots J ell, β g (Lb g i) / V (e.symm g).val : ℝ) : ℂ) * (boundary (r, Ls) (physicalFullMemoryState (fun _ : Fin M => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B)) * F ((r, Ls), physicalFullMemoryState (fun _ : Fin M => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B))) calc _ = ∑ r : PhysicalResidues (fun s : ↥groupsᶜ => P s.val), ((∏ p : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), 1 / (p.2.val : ℝ) : ℝ) : ℂ) * ψ r := physical_group_residue_weighted_sum P groupsᶜ ψ _ = _ := by rw [physical_small_big_initial_readout_eq_raw _ _ _ _ _ _ hF] dsimp only [ψ] conv_rhs => rw [mul_sum] apply sum_congr rfl intro r _ exact mul_left_comm _ _ _ end Scalar end Bounty end -- Source module: PhysicalRootInitialIntegral section /- The original weighted scalar, including the full small-residue average, is a normalized initial readout whenever the integrand has its true support. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Scalar variable {N M J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) theorem physical_root_initial_scalar_integral {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (F : Ω → PhysicalGroupResidues P groupsᶜ → PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell → PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (hF : ∀ r L x, Integrable (fun ω => F ω r L x) μ) : (∫ ω, physicalRootInitialScalar groups e V β (F ω) ∂μ) = physicalRootInitialScalar groups e V β (fun r L x => ∫ ω, F ω r L x ∂μ) := by unfold physicalRootInitialScalar rw [integral_finsetSum] · apply sum_congr rfl intro r _ rw [integral_const_mul, integral_const_mul, integral_finsetSum] · congr 2 apply sum_congr rfl intro Ls _ rw [integral_finsetSum] · apply sum_congr rfl intro Lb _ exact integral_const_mul _ _ · intro Lb _ exact (hF r Ls _).const_mul _ · intro Ls _ exact integrable_finsetSum _ (fun Lb _ => (hF r Ls _).const_mul _) · intro r _ exact (integrable_finsetSum _ (fun Ls _ => integrable_finsetSum _ (fun Lb _ => (hF r Ls _).const_mul _))).const_mul _ |>.const_mul _ end Scalar end Bounty end -- Source module: PhysicalRootMixedIntegrable section /- The original root forest action places its complete small-plan sum inside the common Fourier integral. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) theorem physical_root_mixed_fourier_integrable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : Integrable (fun ν => physicalRootMixedFourierIntegrand groups e patterns C hC k V q ζ K r θ β retention ρ code encode ν f L x) (birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))))) := by let _ := physicalMixedSmallPlanFintype (Ps := (fun s : ↥groupsᶜ => P s.val)) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) unfold physicalRootMixedFourierIntegrand apply integrable_finsetSum intro sp _ exact physical_root_plan_fourier_integrable groups e patterns C hC k (L, sp) V q ζ K r θ β retention ρ code encode f x end Root end Bounty end -- Source module: PhysicalRootWordIntegrable section /- The original root forest is an integral of the actual mixed operator word, with its exact initial boundary multiplier and original coefficients. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) theorem physical_root_fourier_word_integrable (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : Integrable (fun ν => fullMixedCommonBoundaryMultiplier (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) code ν encode (fullMixedCommonInitialPrime x) * physicalRootFourierWord groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν f L x) (birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))))) := by have h := physical_root_mixed_fourier_integrable groups e patterns C hC k V q ζ K r θ β retention ρ code encode f L x exact h.congr (Filter.Eventually.of_forall fun ν => physical_root_mixed_fourier_word groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν f L x) end Root end Bounty end -- Source module: PhysicalRootForestContribution section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) noncomputable def physicalRootForestContribution : ℂ := physicalRootInitialScalar groups e V β (fun r L x => physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code fullMemoryVacuum L x) noncomputable def physicalRootFourierContribution : ℂ := physicalRootInitialScalar groups e V β (fun r L x => physicalRootFourierBoundary groups e code encode ν x * physicalRootFourierWord groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode ν fullMemoryVacuum L x) theorem physical_root_forest_contribution_integral (hinj : Function.Injective encode) : physicalRootForestContribution groups e patterns C hC k V q ζ K θ β retention ρ code = ∫ ν, physicalRootFourierContribution groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν ∂birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) := by unfold physicalRootForestContribution physicalRootFourierContribution rw [physical_root_initial_scalar_integral] · congr 1 funext r L x exact physical_root_forest_eq_integral_word groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode hinj fullMemoryVacuum L x · intro r L x exact physical_root_fourier_word_integrable groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code encode fullMemoryVacuum L x variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] theorem physical_root_fourier_contribution_eq_readout : physicalRootFourierContribution groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν = physicalRootFourierReadout groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν := by exact physical_root_initial_scalar_eq_readout groups e V β (fun _ => physicalRootFourierBoundary groups e code encode ν) (physicalRootFourierVectorAction groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν fullMemoryVacuum) (physical_root_fourier_vector_invalid groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν fullMemoryVacuum) theorem physical_root_forest_contribution_norm_le (hinj : Function.Injective encode) {bound : ℝ} (hbound : ∀ ν, ‖physicalRootFourierReadout groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν‖ ≤ bound) : ‖physicalRootForestContribution groups e patterns C hC k V q ζ K θ β retention ρ code‖ ≤ bound := by let _ : IsProbabilityMeasure (birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))))) := birthFourierCubeMeasure_probability _ rw [physical_root_forest_contribution_integral groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode hinj] simpa using norm_integral_le_of_norm_le_const (μ := birthFourierCubeMeasure (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))))) (Filter.Eventually.of_forall fun ν => (congrArg norm (physical_root_fourier_contribution_eq_readout groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν)).trans_le (hbound ν)) end Root end Bounty end -- Source module: PhysicalRootInitialLinear section /- The original weighted scalar, including the full small-residue average, is a normalized initial readout whenever the integrand has its true support. -/ open Finset open scoped Classical namespace Bounty section Scalar variable {N M J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) theorem physical_root_initial_scalar_add (F G : PhysicalGroupResidues P groupsᶜ → PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell → PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) : physicalRootInitialScalar groups e V β (fun r L x => F r L x + G r L x) = physicalRootInitialScalar groups e V β F + physicalRootInitialScalar groups e V β G := by simp only [physicalRootInitialScalar, mul_add, sum_add_distrib] theorem physical_root_initial_scalar_const_mul (c : ℂ) (F : PhysicalGroupResidues P groupsᶜ → PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell → PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) : physicalRootInitialScalar groups e V β (fun r L x => c * F r L x) = c * physicalRootInitialScalar groups e V β F := by have hm (a b : ℂ) : a * (c * b) = c * (a * b) := mul_left_comm a c b simp only [physicalRootInitialScalar, hm, ← mul_sum] theorem physical_root_initial_scalar_finset_sum {T : Type*} (s : Finset T) (F : T → PhysicalGroupResidues P groupsᶜ → PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell → PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) : physicalRootInitialScalar groups e V β (fun r L x => ∑ t ∈ s, F t r L x) = ∑ t ∈ s, physicalRootInitialScalar groups e V β (F t) := by induction s using Finset.induction_on with | empty => simp only [sum_empty, physicalRootInitialScalar, mul_zero, sum_const_zero] | @insert t s ht ih => simp only [sum_insert ht] rw [physical_root_initial_scalar_add, ih] theorem physical_root_initial_scalar_weighted_sum {T : Type*} [Fintype T] (a : T → ℂ) (F : T → PhysicalGroupResidues P groupsᶜ → PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell → PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) : physicalRootInitialScalar groups e V β (fun r L x => ∑ t, a t * F t r L x) = ∑ t, a t * physicalRootInitialScalar groups e V β (F t) := by rw [physical_root_initial_scalar_finset_sum] apply sum_congr rfl intro t _ exact physical_root_initial_scalar_const_mul groups e V β (a t) (F t) end Scalar end Bounty end -- Source module: PhysicalRootOriginalForestSum section /- The literal original root scalar, including initial mark weights, is a signed common-forest sum. -/ open Finset Classical namespace Bounty section Scalar variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) theorem physical_root_original_scalar_forest_sum (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (hinj : Function.Injective encode) : (∑ r : PhysicalGroupResidues P groupsᶜ, ((∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ) : ℝ) : ℂ) * physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis) = ∑ code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B), (-1 : ℂ) ^ birthForestRank code * physicalRootForestContribution groups e patterns C hC k V q ζ K θ (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ code := by calc _ = ∑ r : PhysicalGroupResidues P groupsᶜ, ((∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ) : ℝ) : ℂ) * physicalRootForestScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ := by apply sum_congr rfl intro r _ rw [physical_root_mixed_scalar_forests groups e patterns C hC V q ζ k K r θ β ρ hP hdis encode hinj] _ = _ := by exact physical_root_initial_scalar_weighted_sum groups e V (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩) (fun code => (-1 : ℂ) ^ birthForestRank code) (fun code r L x => physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ (fun (g : Fin M) (z : P (e.symm g).val) => β ⟨(e.symm g).val, z⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ code fullMemoryVacuum L x) end Scalar end Bounty end -- Source module: PhysicalRootTwoRegime section /- The two rank regimes bound the actual original averaged root scalar, with a threshold uniform over all finite root data satisfying the budgets. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_physical_root_scalar_two_regime {a c budget E G Cv Ca dimension Ch : ℝ} (ha : 0 < a) (hc : 0 < c) (hbudget : 0 ≤ budget) (hE : 0 ≤ E) (hdimension : 0 ≤ dimension) (hD : 0 ≤ G + Ca + dimension) (hgain : E + Cv + 2 ≤ G) : ∀ᶠ L : ℝ in atTop, ∀ (I : Type) (N M J ell n B : ℕ) (P : Fin N → Finset ℕ) [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (patterns : Finset I) (cuts : I → Fin N → Finset (Fin J)) (hcuts : ∀ i : patterns, ∀ g : ↥groupsᶜ, cuts i.val g.val = ∅) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (cuts i) → ℂ) (θ : ℝ) (beta : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (_hinj : Function.Injective encode), let m := Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))) let F : BirthForestCode m → ℂ := fun code => physicalRootForestContribution groups e patterns cuts hcuts k V q ζ K θ (fun (g : Fin M) (p : P (e.symm g).val) => beta ⟨(e.symm g).val, p⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ code L ^ a ≤ ((n + 1 : ℕ) : ℝ) → ∀ b H A ε : ℝ, L ^ c ≤ b → (m : ℝ) ≤ L ^ dimension → 0 ≤ H → H ≤ L ^ Ch → 0 ≤ A → A ≤ L ^ (budget * (((n + 1 : ℕ) : ℝ) + 1)) → 0 ≤ ε → (m : ℝ) ^ 2 * ε ≤ Real.exp (-b) → let cutoff := Nat.ceil (((2 * budget + (E + 1) + 1) * ((n + 1 : ℕ) : ℝ) * Real.log L) / b) (∀ code, birthForestRank code < cutoff → ‖F code‖ ≤ H * L ^ ((-G + Cv) * ((n + 1 : ℕ) : ℝ) + Cv + 2 * birthForestRank code * (G + Ca))) → (∀ code, cutoff ≤ birthForestRank code → ‖F code‖ ≤ A * ε ^ birthForestRank code) → ‖∑ r : PhysicalGroupResidues P groupsᶜ, ((∏ p : ↥(physicalPrimeGroups P groupsᶜ), 1 / (p.val.2.val : ℝ) : ℝ) : ℂ) * physicalRootMixedScalar (n := n) (B := B) groups e patterns cuts hcuts V q ζ k K r θ beta ρ hP hdis‖ ≤ L ^ (-(E * ((n + 1 : ℕ) : ℝ))) := by filter_upwards [eventually_birthForest_two_regime_power_saving ha hc hbudget hE hdimension hD hgain] with L hL intro I N M J ell n B P inst groups e V patterns cuts hcuts q ζ k K θ beta ρ hP hdis encode hinj m F hN b H A ε hb hm hH hHb hA hAb hε hεb cutoff hlow hhigh have hbound := hL (n + 1) m hN b H A ε hb hm hH hHb hA hAb hε hεb F hlow hhigh rw [physical_root_original_scalar_forest_sum groups e patterns cuts hcuts V q ζ k K θ beta ρ hP hdis encode hinj] exact hbound end Bounty end -- Source module: PhysicalRootNormalizedIntegral section /- Exact commutation of the normalized small-residue sum with interval integration. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Scalar variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) theorem physical_root_normalized_mixed_scalar_integral (a c : ℝ) (hint : ∀ r : PhysicalGroupResidues P groupsᶜ, IntervalIntegrable (fun θ => physicalRootMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis) volume a c) : (∫ θ in a..c, physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis) = ∑ r : PhysicalGroupResidues P groupsᶜ, ((∏ p : ↥(physicalPrimeGroups P groupsᶜ), 1 / (p.val.2.val : ℝ) : ℝ) : ℂ) * ∫ θ in a..c, physicalRootMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis := by unfold physicalRootNormalizedMixedScalar rw [intervalIntegral.integral_finsetSum (fun r _ => (hint r).const_mul _)] apply Finset.sum_congr rfl intro r _ exact intervalIntegral.integral_const_mul _ _ end Scalar end Bounty end -- Source module: PhysicalRootScalarRho section /- At a saturated memory cap, the original root scalar is independent of the nonzero auxiliary ghost parameter, also after normalized residue averaging. -/ open Finset open scoped Classical namespace Bounty section Scalar variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : PhysicalPrime P → ℝ) (ρ ρ' : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) theorem physical_root_mixed_scalar_rho_eq (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (hV : ∀ g, V g ≠ 0) (hρ : ρ ≠ 0) (hρ' : ρ' ≠ 0) (hB : (physicalPrimeGroups P groups).card ≤ B) (hq : 0 ≤ q) : physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis = physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ' hP hdis := by exact (physical_root_small_plan_eq_mixed_scalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis hk hV hρ hB hq).symm.trans (physical_root_small_plan_eq_mixed_scalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ' hP hdis hk hV hρ' hB hq) theorem physical_root_normalized_mixed_scalar_rho_eq (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (hV : ∀ g, V g ≠ 0) (hρ : ρ ≠ 0) (hρ' : ρ' ≠ 0) (hB : (physicalPrimeGroups P groups).card ≤ B) (hq : 0 ≤ q) : physicalRootNormalizedMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ hP hdis = physicalRootNormalizedMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K θ β ρ' hP hdis := by unfold physicalRootNormalizedMixedScalar apply sum_congr rfl intro r _ exact congrArg (fun z : ℂ => ((∏ a : ↥(physicalPrimeGroups P groupsᶜ), 1 / (a.val.2.val : ℝ) : ℝ) : ℂ) * z) (physical_root_mixed_scalar_rho_eq groups e patterns C hC V q ζ k K r θ β ρ ρ' hP hdis hk hV hρ hρ' hB hq) end Scalar end Bounty end -- Source module: PhysicalRootThetaRegularity section /- Theta regularity for the original mixed root scalar and its exact weighted small-residue average, obtained from the finite small-plan representation. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section SmallPlan variable {I : Type} {N J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (β : PhysicalPrime P → ℝ) (B : ℕ) (r : PhysicalGroupResidues P groupsᶜ) theorem physical_root_mixed_path_integrand_theta_continuous (L : PhysicalMarkLists P J ell) (p : Fin (n + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : Continuous (fun θ : ℝ => physicalRootMixedPathIntegrand groups patterns C V q ζ k K β B r θ L p) := by unfold physicalRootMixedPathIntegrand exact ((continuous_const.mul (physical_memory_fourier_walk_scalar_continuous V patterns C ζ k K (finitePathLabels p) (finitePathMarks L p) (n + 1))).mul continuous_const).mul continuous_const theorem physical_root_small_plan_sum_theta_continuous (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) : Continuous (fun θ : ℝ => physicalRootSmallPlanSum (n := n) groups patterns C hC V q ζ k K β B r θ) := by unfold physicalRootSmallPlanSum physicalRootSmallPlanSumCore apply continuous_finsetSum intro x _ exact physical_root_mixed_path_integrand_theta_continuous groups patterns C V q ζ k K β B r _ _ end SmallPlan section Scalar variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (β : PhysicalPrime P → ℝ) (ρ : ℝ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (hV : ∀ g, V g ≠ 0) (hρ : ρ ≠ 0) (hB : (physicalPrimeGroups P groups).card ≤ B) (hq : 0 ≤ q) include hk hV hρ hB hq theorem physical_root_mixed_scalar_theta_continuous (r : PhysicalGroupResidues P groupsᶜ) : Continuous (fun θ : ℝ => physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis) := by apply (physical_root_small_plan_sum_theta_continuous groups patterns C V q ζ k K β B r hC).congr intro θ exact physical_root_small_plan_eq_mixed_scalar groups e patterns C hC V q ζ k K r θ β ρ hP hdis hk hV hρ hB hq theorem physical_root_mixed_scalar_theta_intervalIntegrable (r : PhysicalGroupResidues P groupsᶜ) (a b : ℝ) : IntervalIntegrable (fun θ : ℝ => physicalRootMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K r θ β ρ hP hdis) volume a b := (physical_root_mixed_scalar_theta_continuous groups e patterns C hC V q ζ k K β ρ hP hdis hk hV hρ hB hq r).intervalIntegrable a b end Scalar end Bounty end -- Source module: PhysicalRootNormalizedIntegralFormula section /- The original residue model is exactly the baseline product times the integral of the original normalized root scalar at any nonzero auxiliary ghost parameter. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_root_residue_model_normalized_mixed_integral {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (q : ℝ) (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (hV : ∀ g, 0 < V g) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (baseline : PhysicalPrime P → ℝ) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → baseline a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → baseline a ≠ 0) (B : ℕ) (hB : (physicalPrimeGroups P groups).card ≤ B) (ρ : ℝ) (hρ : ρ ≠ 0) : physicalRootResidueModel V patterns C q ζ k K n = (∏ a ∈ physicalPrimeGroups P groups, baseline a : ℝ) * ∫ θ : ℝ in (0 : ℝ)..1, physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) ρ hP hdis := by refine (physical_root_residue_model_mixed_action groups e V patterns C hC q hq ζ k K hV hP hdis hk baseline hb hb0 B hB).trans ?_ apply congrArg (fun z : ℂ => ((∏ a ∈ physicalPrimeGroups P groups, baseline a : ℝ) : ℂ) * z) trans (∫ θ : ℝ in (0 : ℝ)..1, physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) 1 hP hdis) · exact (physical_root_normalized_mixed_scalar_integral (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) 1 hP hdis 0 1 (fun r => physical_root_mixed_scalar_theta_intervalIntegrable (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) 1 hP hdis hk (fun g => ne_of_gt (hV g)) one_ne_zero hB hq r 0 1)).symm · apply congrArg (fun f : ℝ → ℂ => ∫ θ : ℝ in (0 : ℝ)..1, f θ) funext θ exact physical_root_normalized_mixed_scalar_rho_eq (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) 1 ρ hP hdis hk (fun g => ne_of_gt (hV g)) one_ne_zero hρ hB hq end Bounty end -- Source module: PhysicalRootThetaNorm section /- The unit theta interval and the endpoint baseline preserve a uniform bound. -/ open Finset MeasureTheory open scoped Classical namespace Bounty theorem physical_root_theta_integral_norm_le (F : ℝ → ℂ) (A t : ℝ) (ht0 : 0 ≤ t) (ht1 : t ≤ 1) (hF : ∀ θ ∈ Set.Icc (0 : ℝ) 1, ‖F θ‖ ≤ A) : ‖(t : ℂ) * ∫ θ : ℝ in (0 : ℝ)..1, F θ‖ ≤ A := by calc _ = t * ‖∫ θ : ℝ in (0 : ℝ)..1, F θ‖ := by rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg ht0] _ ≤ 1 * ‖∫ θ : ℝ in (0 : ℝ)..1, F θ‖ := mul_le_mul_of_nonneg_right ht1 (norm_nonneg _) _ = ‖∫ θ : ℝ in (0 : ℝ)..1, F θ‖ := one_mul _ _ ≤ A := by simpa only [sub_zero, abs_one, mul_one] using (intervalIntegral.norm_integral_le_of_norm_le_const (a := (0 : ℝ)) (b := 1) (fun θ hθ => hF θ (by have hθ' : θ ∈ Set.Ioc (0 : ℝ) 1 := by simpa only [Set.uIoc_of_le zero_le_one] using hθ exact ⟨hθ'.1.le, hθ'.2⟩))) theorem physical_root_endpoint_baseline_product_bounds {N : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (q : ℝ) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (n : ℕ) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hsize : ∀ a : PhysicalPrime P, a.1 ∈ groups → 2 * (n + 2) ≤ a.2.val) : 0 < ∏ a ∈ physicalPrimeGroups P groups, physicalEndpointBaseline q (n + 1) a.2.val ∧ (∏ a ∈ physicalPrimeGroups P groups, physicalEndpointBaseline q (n + 1) a.2.val) ≤ 1 := by classical apply memory_baseline_prod_bounds intro a ha apply physical_endpoint_baseline_bounds hq0 hq1 (n + 1) a.2.val (hP a.1 a.2.val a.2.property).pos have hag : a.1 ∈ groups := by simpa only [physicalPrimeGroups, mem_filter, mem_univ, true_and] using ha simpa only [Nat.add_assoc] using hsize a hag end Bounty end -- Source module: PhysicalRootNormalizedIntegralNorm section /- A uniform bound on the exact normalized root scalar bounds the residue model. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Model variable {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} [∀ a : PhysicalPrime P, NeZero a.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (q : ℝ) (hq : 0 ≤ q) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (hV : ∀ g, 0 < V g) (hP : ∀ g a, a ∈ P g → Nat.Prime a) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (hk : ∀ t < n + 1, ∀ i ∈ patterns, ∀ g a, a ∈ P g → ¬ (a : ℤ) ∣ k t i) (baseline : PhysicalPrime P → ℝ) (hb : ∀ a : PhysicalPrime P, a.1 ∈ groups → baseline a = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / a.2.val) (B : ℕ) (hB : (physicalPrimeGroups P groups).card ≤ B) (ρ : ℝ) (hρ : ρ ≠ 0) include hq hV hk hb hB hρ theorem physical_root_residue_model_norm_le_of_normalized_mixed_scalar (hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → baseline a ≠ 0) (hprod0 : 0 ≤ ∏ a ∈ physicalPrimeGroups P groups, baseline a) (hprod1 : (∏ a ∈ physicalPrimeGroups P groups, baseline a) ≤ 1) (A : ℝ) (hscalar : ∀ θ ∈ Set.Icc (0 : ℝ) 1, ‖physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) ρ hP hdis‖ ≤ A) : ‖physicalRootResidueModel V patterns C q ζ k K n‖ ≤ A := by rw [physical_root_residue_model_normalized_mixed_integral groups e V patterns C hC q hq ζ k K hV hP hdis hk baseline hb hb0 B hB ρ hρ] exact physical_root_theta_integral_norm_le _ A _ hprod0 hprod1 hscalar theorem physical_root_residue_model_norm_le_of_large_primes (hq1 : q ≤ 1) (hsize : ∀ a : PhysicalPrime P, a.1 ∈ groups → 2 * (n + 2) ≤ a.2.val) (A : ℝ) (hscalar : ∀ θ ∈ Set.Icc (0 : ℝ) 1, ‖physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) ρ hP hdis‖ ≤ A) : ‖physicalRootResidueModel V patterns C q ζ k K n‖ ≤ A := by classical have hb0 : ∀ a : PhysicalPrime P, a.1 ∈ groups → baseline a ≠ 0 := by intro a ha rw [hb a ha] change physicalEndpointBaseline q (n + 1) a.2.val ≠ 0 exact ne_of_gt (physical_endpoint_baseline_pos hq hq1 (n + 1) a.2.val (hP a.1 a.2.val a.2.property).pos (hsize a ha)) have hprod : (∏ a ∈ physicalPrimeGroups P groups, baseline a) = ∏ a ∈ physicalPrimeGroups P groups, physicalEndpointBaseline q (n + 1) a.2.val := by apply prod_congr rfl intro a ha apply hb a simpa only [physicalPrimeGroups, mem_filter, mem_univ, true_and] using ha have hbounds := physical_root_endpoint_baseline_product_bounds groups q hq hq1 n hP hsize rw [← hprod] at hbounds exact physical_root_residue_model_norm_le_of_normalized_mixed_scalar groups e V patterns C hC q hq ζ k K hV hP hdis hk baseline hb B hB ρ hρ hb0 hbounds.1.le hbounds.2 A hscalar theorem physical_root_residue_model_norm_le_of_working_cap (hq1 : q ≤ 1) (hsize : ∀ a : PhysicalPrime P, a.1 ∈ groups → 2 * (n + 2) ≤ a.2.val) (b : ℕ) (capError workingBound : ℝ) (hcap : ∀ θ ∈ Set.Icc (0 : ℝ) 1, ‖physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) ρ hP hdis - physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := b) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) ρ hP hdis‖ ≤ capError) (hworking : ∀ θ ∈ Set.Icc (0 : ℝ) 1, ‖physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := b) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) ρ hP hdis‖ ≤ workingBound) : ‖physicalRootResidueModel V patterns C q ζ k K n‖ ≤ capError + workingBound := by apply physical_root_residue_model_norm_le_of_large_primes groups e V patterns C hC q hq ζ k K hV hP hdis hk baseline hb B hB ρ hρ hq1 hsize intro θ hθ have htriangle := norm_add_le (physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := B) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) ρ hP hdis - physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := b) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) ρ hP hdis) (physicalRootNormalizedMixedScalar (P := P) (J := J) (ell := ell) (n := n) (B := b) groups e patterns C hC V q ζ k K θ (fun a => ((a.2.val : ℝ) * baseline a)⁻¹) ρ hP hdis) rw [sub_add_cancel] at htriangle exact htriangle.trans (add_le_add (hcap θ hθ) (hworking θ hθ)) end Model end Bounty end -- Source module: PhysicalRootResidueTwoRegime section /- The two forest regimes and the original-cap comparison give the literal residue-model bound, uniformly over all root data after the threshold. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_physical_root_residue_two_regime {budget E G Cv Ca Ch : ℝ} (hbudget : 0 ≤ budget) (hE : 0 ≤ E) (hD : 0 ≤ G + Ca + 6) (hgain : E + 1 + Cv + 2 ≤ G) : ∀ᶠ L : ℝ in atTop, ∀ (I : Type) (N M J ell n b B : ℕ) (P : Fin N → Finset ℕ) [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (_hV : ∀ g, 0 < V g) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (_hk : ∀ time < n + 1, ∀ i ∈ patterns, ∀ g p, p ∈ P g → ¬ (p : ℤ) ∣ k time i) (baseline : PhysicalPrime P → ℝ) (_hb : ∀ p : PhysicalPrime P, p.1 ∈ groups → baseline p = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / p.2.val) (_hB : (physicalPrimeGroups P groups).card ≤ B) (ρ : ℝ) (_hρ : ρ ≠ 0) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (_hinj : Function.Injective encode), let beta := fun p : PhysicalPrime P => ((p.2.val : ℝ) * baseline p)⁻¹ let m := Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) b ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))) let F := fun (θ : ℝ) (code : BirthForestCode m) => physicalRootForestContribution groups e patterns C hC k V q ζ K θ (fun (g : Fin M) (p : P (e.symm g).val) => beta ⟨(e.symm g).val, p⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ code let err := L ^ (-((E + 1) * ((n + 1 : ℕ) : ℝ))) 0 ≤ q → q ≤ 1 → (∀ p : PhysicalPrime P, p.1 ∈ groups → 2 * (n + 2) ≤ p.2.val) → L ^ (1/2 : ℝ) ≤ ((n + 1 : ℕ) : ℝ) → (m : ℝ) ≤ L ^ (6 : ℝ) → ∀ H A ε : ℝ, 0 ≤ H → H ≤ L ^ Ch → 0 ≤ A → A ≤ L ^ (budget * (((n + 1 : ℕ) : ℝ) + 1)) → 0 ≤ ε → (m : ℝ) ^ 2 * ε ≤ Real.exp (-(L ^ (1/4 : ℝ))) → let cutoff := Nat.ceil (((2 * budget + ((E + 1) + 1) + 1) * ((n + 1 : ℕ) : ℝ) * Real.log L) / L ^ (1/4 : ℝ)) (∀ θ ∈ Set.Icc (0 : ℝ) 1, ∀ code, birthForestRank code < cutoff → ‖F θ code‖ ≤ H * L ^ ((-G + Cv) * ((n + 1 : ℕ) : ℝ) + Cv + 2 * birthForestRank code * (G + Ca))) → (∀ θ ∈ Set.Icc (0 : ℝ) 1, ∀ code, cutoff ≤ birthForestRank code → ‖F θ code‖ ≤ A * ε ^ birthForestRank code) → (∀ θ ∈ Set.Icc (0 : ℝ) 1, ‖physicalRootNormalizedMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K θ beta ρ hP hdis - physicalRootNormalizedMixedScalar (n := n) (B := b) groups e patterns C hC V q ζ k K θ beta ρ hP hdis‖ ≤ err) → ‖physicalRootResidueModel V patterns C q ζ k K n‖ ≤ 2 * err := by filter_upwards [eventually_physical_root_scalar_two_regime (a := 1/2) (c := 1/4) (dimension := 6) (Ch := Ch) (by norm_num) (by norm_num) hbudget (by linarith : 0 ≤ E + 1) (by norm_num) hD hgain] with L hscalar intro I N M J ell n b B P _ groups e V patterns C hC q ζ k K hV hP hdis hk baseline hb hB ρ hρ encode hinj beta m F err hq0 hq1 hsize hN hm H A ε hH hHb hA hAb hε hεb cutoff hlow hhigh hcap have hworking : ∀ θ ∈ Set.Icc (0 : ℝ) 1, ‖physicalRootNormalizedMixedScalar (n := n) (B := b) groups e patterns C hC V q ζ k K θ beta ρ hP hdis‖ ≤ err := by intro θ hθ exact hscalar I N M J ell n b P groups e V patterns C hC q ζ k K θ beta ρ hP hdis encode hinj hN (L ^ (1/4 : ℝ)) H A ε le_rfl hm hH hHb hA hAb hε hεb (hlow θ hθ) (hhigh θ hθ) have h := physical_root_residue_model_norm_le_of_working_cap groups e V patterns C hC q hq0 ζ k K hV hP hdis hk baseline hb B hB ρ hρ hq1 hsize b err err hcap hworking simpa only [two_mul] using h end Bounty end -- Source module: PhysicalRootFourierGhost section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable [∀ g (p : P (e.symm g).val), NeZero p.val] theorem physical_root_fourier_ghost_row (j : Fin (n + 2)) (f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) : physicalRootFourierRow groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν (some (.inl j)) f = physicalSmallBigGhostAction (fun g => physicalGhostRetention (fun p : P (e.symm g).val => p.val) (retention j) ρ) (fun g => physicalGhostTermination (fun p : P (e.symm g).val => p.val) (retention j) ρ) (fun g => physicalGhostBirth (fun p : P (e.symm g).val => p.val) (retention j) ρ (V (e.symm g).val)) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val)) (fun _ : Fin M => J + ell) B (physicalSmallBigGhostBirthPhase (fun _ : Fin M => J + ell) B (physicalSelectedGhostFourierObservable code ν encode j)) f := by funext s unfold physicalRootFourierRow rw [physical_mixed_word_row_ghost] unfold physicalSmallBigGhostAction rw [coupled_ghost_cutoff_eq_joint_event_sum] apply Finset.sum_congr · ext ev simp only [Finset.mem_univ] · intro ev _ erw [physical_root_fourier_ghost_factor, physical_root_fourier_ghost_observable] theorem physical_root_fourier_ghost_row_symmetric (j : Fin (n + 2)) (f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s, x))) : ∀ s, ProductMemorySymmetric (fun x => physicalRootFourierRow groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν (some (.inl j)) f (s, x)) := by rw [physical_root_fourier_ghost_row] exact physical_small_big_ghost_birth_memory_symmetric _ _ _ _ _ _ _ f hf end Root end Bounty end -- Source module: PhysicalSelectedGhostFourierEnergy section /- The actual selected ghost Fourier phase satisfies the original ghost energy estimate on the genuine mixed small/big measure. -/ open scoped Classical namespace Bounty section Ghost variable {S : Type} [Fintype S] {N J ell n B : ℕ} {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : Fin N → Finset ℕ} [∀ g (p : P g), NeZero p.val] (Vs : S → ℝ) (hVs : ∀ s, 0 < Vs s) (μ : ∀ g, P g → ℝ) (q ρ : ℝ) (V : Fin N → ℝ) (v vmax : ℝ) (hμ : ∀ g p, 0 < μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hρ : 0 < ρ) (hV : ∀ g, 0 ≤ V g) (hVmax : ∀ g, V g ≤ vmax) (hv : 0 < v) (hD : q / ρ ^ 2 + ((1 - q) / ρ) / v ≤ 1) (hC : ∀ g, q / ρ ^ 2 + ((1 - q) * V g / ρ) / v ≤ 1) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B ((List.range (4 * n + 1)).map (physicalSelectedFineTag n))))) → ℝ) (encode : ((g : Fin N) × P g) → ℤ) (j : Fin (n + 1)) (f : PhysicalSmallBigState Ps J ell (CleanFullMemoryState P J ell B) → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s, x))) include hVs hμ hmass hq0 hq1 hρ hV hVmax hv hD hC hf in theorem physical_selected_ghost_fourier_energy_le : physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) (physicalSmallBigGhostAction (fun g => physicalGhostRetention (fun p : P g => p.val) q ρ) (fun g => physicalGhostTermination (fun p : P g => p.val) q ρ) (fun g => physicalGhostBirth (fun p : P g => p.val) q ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) (fun _ : Fin N => J + ell) B (physicalSmallBigGhostBirthPhase (fun _ : Fin N => J + ell) B (physicalSelectedGhostFourierObservable code ν encode j)) f) ≤ physicalGhostUniformEnergyBound ρ vmax v ^ N * physicalSmallBigEnergy Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g))) f := by simpa only [Fintype.card_fin] using physical_small_big_ghost_phase_energy_le_uniform (fun g (p : P g) => p.val) Vs hVs μ q ρ V v vmax (fun _ : Fin N => J + ell) B hμ hmass hq0 hq1 hρ hV hVmax hv hD hC (physicalSmallBigGhostBirthPhase (fun _ : Fin N => J + ell) B (physicalSelectedGhostFourierObservable code ν encode j)) (fun s e => physical_selected_ghost_fourier_observable_norm_le code ν encode j s.1 (fun g => (s.2 g).1) (fun g => ⟨(e g).1.val, (e g).2.2⟩)) f hf include hVs hμ hmass hq0 hq1 hρ hV hVmax hv hD hC hf in theorem physical_selected_ghost_fourier_norm_le : cleanActiveNorm (physicalSmallBigMeasure Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)))) (physicalSmallBigGhostAction (fun g => physicalGhostRetention (fun p : P g => p.val) q ρ) (fun g => physicalGhostTermination (fun p : P g => p.val) q ρ) (fun g => physicalGhostBirth (fun p : P g => p.val) q ρ (V g)) (fun g => unrestrictedResidueWeight (μ g)) (fun _ : Fin N => J + ell) B (physicalSmallBigGhostBirthPhase (fun _ : Fin N => J + ell) B (physicalSelectedGhostFourierObservable code ν encode j)) f) ≤ Real.sqrt (physicalGhostUniformEnergyBound ρ vmax v ^ N) * cleanActiveNorm (physicalSmallBigMeasure Vs (productMemoryWeight μ (fun g => unrestrictedResidueWeight (μ g)))) f := by have h := physical_selected_ghost_fourier_energy_le Vs hVs μ q ρ V v vmax hμ hmass hq0 hq1 hρ hV hVmax hv hD hC code ν encode j f hf have hs := Real.sqrt_le_sqrt h have hK : 0 ≤ physicalGhostUniformEnergyBound ρ vmax v ^ N := pow_nonneg (Real.exp_pos _).le _ rwa [Real.sqrt_mul hK, physical_small_big_sqrt_energy_eq_norm, physical_small_big_sqrt_energy_eq_norm] at hs end Ghost end Bounty end -- Source module: PhysicalRootSelectedGhostNorm section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty theorem clean_active_norm_fintype_eq {X : Type*} (a b : Fintype X) (w : X → ℝ) (f : X → ℂ) : @cleanActiveNorm X a w f = @cleanActiveNorm X b w f := by cases Subsingleton.elim a b rfl section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable [∀ g (p : P (e.symm g).val), NeZero p.val] variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] (hVs : ∀ s : ↥groupsᶜ, 0 < V s.val) (v vmax : ℝ) (hμ : ∀ g p, 0 < β g p / V (e.symm g).val) (hmass : ∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) (hρ : 0 < ρ) (hV : ∀ g : Fin M, 0 ≤ V (e.symm g).val) (hVmax : ∀ g : Fin M, V (e.symm g).val ≤ vmax) (hv : 0 < v) omit [∀ z : PhysicalPrime P, NeZero z.2.val] in include hVs hμ hmass hρ hV hVmax hv in theorem physical_root_selected_ghost_norm_le (j : Fin (n + 2)) (hq0 : 0 ≤ retention j) (hq1 : retention j ≤ 1) (hD : retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) (hbirth : ∀ g : Fin M, retention j / ρ ^ 2 + ((1 - retention j) * V (e.symm g).val / ρ) / v ≤ 1) (f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s, x))) : cleanActiveNorm (physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val)))) (physicalSmallBigGhostAction (fun g => physicalGhostRetention (fun p : P (e.symm g).val => p.val) (retention j) ρ) (fun g => physicalGhostTermination (fun p : P (e.symm g).val => p.val) (retention j) ρ) (fun g => physicalGhostBirth (fun p : P (e.symm g).val => p.val) (retention j) ρ (V (e.symm g).val)) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val)) (fun _ : Fin M => J + ell) B (physicalSmallBigGhostBirthPhase (fun _ : Fin M => J + ell) B (physicalSelectedGhostFourierObservable code ν encode j)) f) ≤ Real.sqrt (physicalGhostUniformEnergyBound ρ vmax v ^ M) * cleanActiveNorm (physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val)))) f := by convert physical_selected_ghost_fourier_norm_le (S := ↥groupsᶜ) (Ps := fun s => P s.val) (P := fun g => P (e.symm g).val) (N := M) (n := n + 1) (J := J) (ell := ell) (B := B) (fun s : ↥groupsᶜ => V s.val) hVs (fun g p => β g p / V (e.symm g).val) (retention j) ρ (fun g => V (e.symm g).val) v vmax hμ hmass hq0 hq1 hρ hV hVmax hv hD hbirth code ν encode j f hf using 1 · exact clean_active_norm_fintype_eq _ _ _ _ · apply congrArg (fun y : ℝ => Real.sqrt (physicalGhostUniformEnergyBound ρ vmax v ^ M) * y) exact clean_active_norm_fintype_eq _ _ _ _ end Root end Bounty end -- Source module: PhysicalRootFourierGhostNorm section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable [∀ g (p : P (e.symm g).val), NeZero p.val] variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] (hVs : ∀ s : ↥groupsᶜ, 0 < V s.val) (v vmax : ℝ) (hμ : ∀ g p, 0 < β g p / V (e.symm g).val) (hmass : ∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) (hρ : 0 < ρ) (hV : ∀ g : Fin M, 0 ≤ V (e.symm g).val) (hVmax : ∀ g : Fin M, V (e.symm g).val ≤ vmax) (hv : 0 < v) include hVs hμ hmass hρ hV hVmax hv in theorem physical_root_fourier_ghost_row_norm_le (j : Fin (n + 2)) (hq0 : 0 ≤ retention j) (hq1 : retention j ≤ 1) (hD : retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) (hbirth : ∀ g : Fin M, retention j / ρ ^ 2 + ((1 - retention j) * V (e.symm g).val / ρ) / v ≤ 1) (f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) (hf : ∀ s, ProductMemorySymmetric (fun x => f (s, x))) : cleanActiveNorm (physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val)))) (physicalRootFourierRow groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν (some (.inl j)) f) ≤ Real.sqrt (physicalGhostUniformEnergyBound ρ vmax v ^ M) * cleanActiveNorm (physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val)))) f := by let w : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℝ := physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val))) have heq := physical_root_fourier_ghost_row (n := n) (J := J) (ell := ell) (B := B) groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν j f have hg := physical_root_selected_ghost_norm_le groups e V β retention ρ code encode ν hVs v vmax hμ hmass hρ hV hVmax hv j hq0 hq1 hD hbirth f hf exact (congrArg (cleanActiveNorm w) heq).le.trans hg end Root end Bounty end -- Source module: PhysicalSelectedInterleaving section /- The original selected word alternates visits with fully projected edges, including its final visit. -/ namespace Bounty section Operators variable {X : Type*} {n : ℕ} (row : Option (Fin (n + 1) ⊕ Fin n) → (X → ℂ) → X → ℂ) noncomputable def physicalSelectedVisitOperator (i : ℕ) (f : X → ℂ) : X → ℂ := if h : i < n + 1 then row (some (.inl ⟨i, h⟩)) f else f noncomputable def physicalSelectedEdgeOperator (i : ℕ) (f : X → ℂ) : X → ℂ := if h : i < n then row none (row (some (.inr ⟨i, h⟩)) (row none f)) else f theorem physical_selected_operator_word_interleaved (f : X → ℂ) : finiteOperatorListAction row ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) f = finiteRowComposition (S := fun _ => X) (fun i u => physicalSelectedVisitOperator row i (physicalSelectedEdgeOperator row i u)) n (physicalSelectedVisitOperator row n f) := by have hcut (i : ℕ) : finiteRowBlockCut (fun _ => 4) i = 4 * i := by induction i with | zero => rfl | succ i ih => simp only [finiteRowBlockCut, ih]; omega have hlast : row (physicalSelectedFineTag n (4 * n)) f = physicalSelectedVisitOperator row n f := by have ht := physical_selected_fine_tag_visit (Fin.last n) change physicalSelectedFineTag n (4 * n) = some (.inl (Fin.last n)) at ht rw [ht] simp only [physicalSelectedVisitOperator, Nat.lt_succ_self, dif_pos] rfl rw [finite_operator_list_action_map, ← finite_row_composition_eq_operator_list, finite_row_composition_succ, hlast] have hg := finite_row_grouped_composition (S := fun _ => X) (fun i => row (physicalSelectedFineTag n i)) (fun _ => 4) n (physicalSelectedVisitOperator row n f) rw [hcut n] at hg rw [← hg] apply finite_row_composition_congr_before intro i hi u unfold finiteRowGrouped rw [hcut i] change row (physicalSelectedFineTag n (4 * i)) (row (physicalSelectedFineTag n (4 * i + 1)) (row (physicalSelectedFineTag n (4 * i + 2)) (row (physicalSelectedFineTag n (4 * i + 3)) u))) = _ rw [physical_selected_fine_tag_visit (⟨i, by omega⟩ : Fin (n + 1)), physical_selected_fine_tag_before_edge (⟨i, hi⟩ : Fin n), physical_selected_fine_tag_edge (⟨i, hi⟩ : Fin n), physical_selected_fine_tag_after_edge (⟨i, hi⟩ : Fin n)] simp only [physicalSelectedVisitOperator, physicalSelectedEdgeOperator, dif_pos hi, dif_pos (show i < n + 1 by omega)] end Operators end Bounty end -- Source module: SelectedWordNorm section /- Norm propagation across every original selected edge, with loss charged only to the deduplicated exceptional edges and all visits included. -/ open Finset open scoped Classical namespace Bounty theorem finite_row_function_norm_le {X : Type*} (normFn : (X → ℂ) → ℝ) (S : (X → ℂ) → Prop) (row : ℕ → (X → ℂ) → X → ℂ) (c : ℕ → ℝ) (n : ℕ) (hc : ∀ i < n, 0 ≤ c i) (hpres : ∀ i < n, ∀ f, S f → S (row i f)) (hrow : ∀ i < n, ∀ f, S f → normFn (row i f) ≤ c i * normFn f) (f : X → ℂ) (hf : S f) : S (finiteRowComposition (S := fun _ => X) row n f) ∧ normFn (finiteRowComposition (S := fun _ => X) row n f) ≤ (∏ i ∈ range n, c i) * normFn f := by induction n generalizing f with | zero => simpa only [finiteRowComposition, range_zero, prod_empty, one_mul] using And.intro hf (le_refl _) | succ n ih => have h := ih (fun i hi => hc i (Nat.lt_succ_of_lt hi)) (fun i hi => hpres i (Nat.lt_succ_of_lt hi)) (fun i hi => hrow i (Nat.lt_succ_of_lt hi)) (row n f) (hpres n (Nat.lt_succ_self n) f hf) refine ⟨h.1, h.2.trans ?_⟩ rw [prod_range_succ, mul_assoc] exact mul_le_mul_of_nonneg_left (hrow n (Nat.lt_succ_self n) f hf) (prod_nonneg fun i hi => hc i (Nat.lt_succ_of_lt (mem_range.mp hi))) theorem function_interleaved_norm_le {X : Type*} (normFn : (X → ℂ) → ℝ) (S : (X → ℂ) → Prop) (E G : ℕ → (X → ℂ) → X → ℂ) (c : ℕ → ℝ) (n : ℕ) {M : ℝ} (hM : 0 ≤ M) (hc : ∀ i < n, 0 ≤ c i) (hEpres : ∀ i < n, ∀ f, S f → S (E i f)) (hGpres : ∀ i ≤ n, ∀ f, S f → S (G i f)) (hE : ∀ i < n, ∀ f, S f → normFn (E i f) ≤ c i * normFn f) (hG : ∀ i ≤ n, ∀ f, S f → normFn (G i f) ≤ M * normFn f) (f : X → ℂ) (hf : S f) : S (finiteRowComposition (S := fun _ => X) (fun i u => G i (E i u)) n (G n f)) ∧ normFn (finiteRowComposition (S := fun _ => X) (fun i u => G i (E i u)) n (G n f)) ≤ M ^ (n + 1) * (∏ i ∈ range n, c i) * normFn f := by have h := finite_row_function_norm_le normFn S (fun i u => G i (E i u)) (fun i => M * c i) n (fun i hi => mul_nonneg hM (hc i hi)) (fun i hi u hu => hGpres i (Nat.le_of_lt hi) _ (hEpres i hi u hu)) (fun i hi u hu => (hG i (Nat.le_of_lt hi) _ (hEpres i hi u hu)).trans (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (hE i hi u hu) hM)) (G n f) (hGpres n le_rfl f hf) refine ⟨h.1, h.2.trans ?_⟩ calc (∏ i ∈ range n, M * c i) * normFn (G n f) ≤ (∏ i ∈ range n, M * c i) * (M * normFn f) := mul_le_mul_of_nonneg_left (hG n le_rfl f hf) (prod_nonneg fun i hi => mul_nonneg hM (hc i (mem_range.mp hi))) _ = _ := by rw [prod_mul_distrib] simp only [prod_const, card_range, pow_succ] ring theorem selected_word_low_rank_norm_le {X : Type*} {n : ℕ} (normFn : (X → ℂ) → ℝ) (hnorm : ∀ f, 0 ≤ normFn f) (S : (X → ℂ) → Prop) (row : Option (Fin (n + 1) ⊕ Fin n) → (X → ℂ) → X → ℂ) (bad : Finset (Fin n)) (r : ℕ) {q A M : ℝ} (hq : 0 < q) (hA : q ≤ A) (hM : 0 ≤ M) (hbad : bad.card ≤ 2 * r) (hEpres : ∀ j : Fin n, ∀ f, S f → S (row none (row (some (.inr j)) (row none f)))) (hGpres : ∀ j : Fin (n + 1), ∀ f, S f → S (row (some (.inl j)) f)) (hE : ∀ j : Fin n, ∀ f, S f → normFn (row none (row (some (.inr j)) (row none f))) ≤ (if j ∈ bad then A else q) * normFn f) (hG : ∀ j : Fin (n + 1), ∀ f, S f → normFn (row (some (.inl j)) f) ≤ M * normFn f) (f : X → ℂ) (hf : S f) : S (finiteOperatorListAction row ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) f) ∧ normFn (finiteOperatorListAction row ((List.range (4 * n + 1)).map (physicalSelectedFineTag n)) f) ≤ (M ^ (n + 1) * q ^ n * (A / q) ^ (2 * r)) * normFn f := by let c : ℕ → ℝ := fun i => if i ∈ bad.image Fin.val then A else q have hc (i : Fin n) : c i.val = if i ∈ bad then A else q := by simp only [c, mem_image, Fin.val_inj, exists_eq_right] have h := function_interleaved_norm_le normFn S (physicalSelectedEdgeOperator row) (physicalSelectedVisitOperator row) c n hM (fun _ _ => ite_nonneg (hq.le.trans hA) hq.le) (fun i hi u hu => by simpa only [physicalSelectedEdgeOperator, dif_pos hi] using hEpres ⟨i, hi⟩ u hu) (fun i hi u hu => by simpa only [physicalSelectedVisitOperator, dif_pos (Nat.lt_succ_of_le hi)] using hGpres ⟨i, Nat.lt_succ_of_le hi⟩ u hu) (fun i hi u hu => by simpa only [physicalSelectedEdgeOperator, dif_pos hi, hc ⟨i, hi⟩] using hE ⟨i, hi⟩ u hu) (fun i hi u hu => by simpa only [physicalSelectedVisitOperator, dif_pos (Nat.lt_succ_of_le hi)] using hG ⟨i, Nat.lt_succ_of_le hi⟩ u hu) f hf rw [← physical_selected_operator_word_interleaved] at h have hprod : (∏ i ∈ range n, c i) = q ^ n * (A / q) ^ bad.card := by rw [← Fin.prod_univ_eq_prod_range] simp_rw [hc] exact edge_scalar_product_eq bad hq.ne' refine ⟨h.1, h.2.trans ?_⟩ rw [hprod, ← mul_assoc] apply mul_le_mul_of_nonneg_right _ (hnorm f) apply mul_le_mul_of_nonneg_left _ (mul_nonneg (pow_nonneg hM _) (pow_nonneg hq.le _)) exact pow_le_pow_right₀ ((le_div_iff₀ hq).mpr (by simpa only [one_mul] using hA)) hbad end Bounty end -- Source module: PhysicalRootFourierNorm section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) theorem physical_root_fourier_word_norm_le (normFn : (PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) → ℝ) (hnorm : ∀ f, 0 ≤ normFn f) (S : (PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) → Prop) {decay excess visit : ℝ} (hdecay : 0 < decay) (hexcess : decay ≤ excess) (hvisit : 0 ≤ visit) : let row := physicalRootFourierRow groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν let bad := physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code (∀ j : Fin (n + 1), ∀ f, S f → S (row none (row (some (.inr j)) (row none f)))) → (∀ j : Fin (n + 2), ∀ f, S f → S (row (some (.inl j)) f)) → (∀ j : Fin (n + 1), ∀ f, S f → normFn (row none (row (some (.inr j)) (row none f))) ≤ (if j ∈ bad then excess else decay) * normFn f) → (∀ j : Fin (n + 2), ∀ f, S f → normFn (row (some (.inl j)) f) ≤ visit * normFn f) → ∀ f, S f → S (finiteOperatorListAction row ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) f) ∧ normFn (finiteOperatorListAction row ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) f) ≤ (visit ^ (n + 2) * decay ^ (n + 1) * (excess / decay) ^ (2 * birthForestRank code)) * normFn f := by intro row bad hEpres hGpres hE hG f hf exact selected_word_low_rank_norm_le normFn hnorm S row bad (birthForestRank code) hdecay hexcess hvisit (physical_selected_affected_edges_card _ _ _ code) hEpres hGpres hE hG f hf end Root end Bounty end -- Source module: PhysicalRootFourierEvolution section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable [∀ g (p : P (e.symm g).val), NeZero p.val] variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] (hVs : ∀ s : ↥groupsᶜ, 0 < V s.val) (v vmax : ℝ) (hμ : ∀ g p, 0 < β g p / V (e.symm g).val) (hmass : ∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) (hρ : 0 < ρ) (hV : ∀ g : Fin M, 0 ≤ V (e.symm g).val) (hVmax : ∀ g : Fin M, V (e.symm g).val ≤ vmax) (hv : 0 < v) include hVs hμ hmass hρ hV hVmax hv in theorem physical_root_fourier_evolution_norm_le (hret0 : ∀ j, 0 ≤ retention j) (hret1 : ∀ j, retention j ≤ 1) (hD : ∀ j, retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) (hbirth : ∀ j (g : Fin M), retention j / ρ ^ 2 + ((1 - retention j) * V (e.symm g).val / ρ) / v ≤ 1) {decay excess : ℝ} (hdecay : 0 < decay) (hexcess : decay ≤ excess) : let row := physicalRootFourierRow groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν let w : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℝ := physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val))) let symmetric := fun f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ => ∀ s, ProductMemorySymmetric (fun x => f (s, x)) (∀ j : Fin (n + 1), ∀ f, symmetric f → symmetric (row none (row (some (.inr j)) (row none f)))) → (∀ j : Fin (n + 1), ∀ f, symmetric f → cleanActiveNorm w (row none (row (some (.inr j)) (row none f))) ≤ (if j ∈ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code then excess else decay) * cleanActiveNorm w f) → ∀ f, symmetric f → symmetric (finiteOperatorListAction row ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) f) ∧ cleanActiveNorm w (finiteOperatorListAction row ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) f) ≤ (Real.sqrt (physicalGhostUniformEnergyBound ρ vmax v ^ M) ^ (n + 2) * decay ^ (n + 1) * (excess / decay) ^ (2 * birthForestRank code)) * cleanActiveNorm w f := by intro row w symmetric hEpres hE f hf exact physical_root_fourier_word_norm_le groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν (cleanActiveNorm w) (fun _ => Real.sqrt_nonneg _) symmetric hdecay hexcess (Real.sqrt_nonneg _) hEpres (fun j u hu => physical_root_fourier_ghost_row_symmetric groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν j u hu) hE (fun j u hu => physical_root_fourier_ghost_row_norm_le groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν hVs v vmax hμ hmass hρ hV hVmax hv j (hret0 j) (hret1 j) (hD j) (hbirth j) u hu) f hf end Root end Bounty end -- Source module: PhysicalRootFourierLowRank section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable [∀ g (p : P (e.symm g).val), NeZero p.val] variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] (hVs : ∀ s : ↥groupsᶜ, 0 < V s.val) (v vmax : ℝ) (hμ : ∀ g p, 0 < β g p / V (e.symm g).val) (hmass : ∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) (hρ : 0 < ρ) (hV : ∀ g : Fin M, 0 ≤ V (e.symm g).val) (hVmax : ∀ g : Fin M, V (e.symm g).val ≤ vmax) (hv : 0 < v) include hVs hμ hmass hρ hV hVmax hv in theorem physical_root_fourier_low_rank_readout_le (hMass : ∀ s : ↥groupsᶜ, ∑ p ∈ P s.val, 1 / (p : ℝ) = V s.val) (hret0 : ∀ j, 0 ≤ retention j) (hret1 : ∀ j, retention j ≤ 1) (hD : ∀ j, retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) (hbirth : ∀ j (g : Fin M), retention j / ρ ^ 2 + ((1 - retention j) * V (e.symm g).val / ρ) / v ≤ 1) {decay excess : ℝ} (hdecay : 0 < decay) (hexcess : decay ≤ excess) : let row := physicalRootFourierRow groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν let w : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℝ := physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val))) let symmetric := fun f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ => ∀ s, ProductMemorySymmetric (fun x => f (s, x)) (∀ j : Fin (n + 1), ∀ f, symmetric f → symmetric (row none (row (some (.inr j)) (row none f)))) → (∀ j : Fin (n + 1), ∀ f, symmetric f → cleanActiveNorm w (row none (row (some (.inr j)) (row none f))) ≤ (if j ∈ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code then excess else decay) * cleanActiveNorm w f) → ‖physicalRootFourierReadout groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν‖ ≤ (Real.sqrt (physicalGhostUniformEnergyBound ρ vmax v ^ M) ^ (n + 2) * decay ^ (n + 1) * (excess / decay) ^ (2 * birthForestRank code)) * ∏ g, (∑ p, β g p / V (e.symm g).val) ^ (J + ell) := by intro row w symmetric hEpres hE have hEv := physical_root_fourier_evolution_norm_le groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν hVs v vmax hμ hmass hρ hV hVmax hv hret0 hret1 hD hbirth hdecay hexcess hEpres hE (fun s => fullMemoryVacuum s.2) (fun _ => fullMemoryVacuum_symmetric) apply physical_root_fourier_readout_norm_le groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν hVs hMass (fun g p => (hμ g p).le) · exact mul_nonneg (mul_nonneg (pow_nonneg (Real.sqrt_nonneg _) _) (pow_nonneg hdecay.le _)) (pow_nonneg (div_nonneg (hdecay.le.trans hexcess) hdecay.le) _) · exact hEv.2 end Root end Bounty end -- Source module: PhysicalRootForestLowRank section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable [∀ g (p : P (e.symm g).val), NeZero p.val] variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] (hVs : ∀ s : ↥groupsᶜ, 0 < V s.val) (v vmax : ℝ) (hμ : ∀ g p, 0 < β g p / V (e.symm g).val) (hmass : ∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) (hρ : 0 < ρ) (hV : ∀ g : Fin M, 0 ≤ V (e.symm g).val) (hVmax : ∀ g : Fin M, V (e.symm g).val ≤ vmax) (hv : 0 < v) include hVs hμ hmass hρ hV hVmax hv in theorem physical_root_low_rank_forest_contribution_le (hinj : Function.Injective encode) (hMass : ∀ s : ↥groupsᶜ, ∑ p ∈ P s.val, 1 / (p : ℝ) = V s.val) (hret0 : ∀ j, 0 ≤ retention j) (hret1 : ∀ j, retention j ≤ 1) (hD : ∀ j, retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) (hbirth : ∀ j (g : Fin M), retention j / ρ ^ 2 + ((1 - retention j) * V (e.symm g).val / ρ) / v ≤ 1) {decay excess : ℝ} (hdecay : 0 < decay) (hexcess : decay ≤ excess) : let row := physicalRootFourierRow groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode let w : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℝ := physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val))) let symmetric := fun f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ => ∀ s, ProductMemorySymmetric (fun x => f (s, x)) (∀ ν, ∀ j : Fin (n + 1), ∀ f, symmetric f → symmetric (row ν none (row ν (some (.inr j)) (row ν none f)))) → (∀ ν, ∀ j : Fin (n + 1), ∀ f, symmetric f → cleanActiveNorm w (row ν none (row ν (some (.inr j)) (row ν none f))) ≤ (if j ∈ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code then excess else decay) * cleanActiveNorm w f) → ‖physicalRootForestContribution groups e patterns C hC k V q ζ K θ β retention ρ code‖ ≤ (Real.sqrt (physicalGhostUniformEnergyBound ρ vmax v ^ M) ^ (n + 2) * decay ^ (n + 1) * (excess / decay) ^ (2 * birthForestRank code)) * ∏ g, (∑ p, β g p / V (e.symm g).val) ^ (J + ell) := by intro row w symmetric hEpres hE apply physical_root_forest_contribution_norm_le groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode hinj intro ν exact physical_root_fourier_low_rank_readout_le groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode ν hVs v vmax hμ hmass hρ hV hVmax hv hMass hret0 hret1 hD hbirth hdecay hexcess (hEpres ν) (hE ν) end Root end Bounty end -- Source module: RootLowRankPower section /- The exact low-rank word cost has the exponent required by the finite forest head estimate. -/ namespace Bounty theorem root_low_rank_cost_power_le {L visit mass H G Ca Cv : ℝ} (N r : ℕ) (hL : 0 < L) (hvisit : 0 ≤ visit) (hv : visit ≤ L ^ Cv) (hmass : 0 ≤ mass) (hM : mass ≤ H) : (visit ^ (N + 1) * (L ^ (-G)) ^ N * (L ^ Ca / L ^ (-G)) ^ (2 * r)) * mass ≤ H * L ^ ((-G + Cv) * N + Cv + 2 * r * (G + Ca)) := by have hq : 0 ≤ (L ^ (-G)) ^ N := pow_nonneg (Real.rpow_pos_of_pos hL _).le _ have ha : 0 ≤ (L ^ Ca / L ^ (-G)) ^ (2 * r) := pow_nonneg (div_nonneg (Real.rpow_pos_of_pos hL _).le (Real.rpow_pos_of_pos hL _).le) _ have hc : visit ^ (N + 1) * (L ^ (-G)) ^ N * (L ^ Ca / L ^ (-G)) ^ (2 * r) ≤ (L ^ Cv) ^ (N + 1) * (L ^ (-G)) ^ N * (L ^ Ca / L ^ (-G)) ^ (2 * r) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hvisit hv _) hq) ha have hp (a : ℝ) (k : ℕ) : (L ^ a) ^ k = L ^ (a * k) := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL.le] calc _ ≤ ((L ^ Cv) ^ (N + 1) * (L ^ (-G)) ^ N * (L ^ Ca / L ^ (-G)) ^ (2 * r)) * H := mul_le_mul hc hM hmass (mul_nonneg (mul_nonneg (pow_nonneg (Real.rpow_pos_of_pos hL _).le _) hq) ha) _ = L ^ (Cv * (N + 1 : ℕ) + (-G) * N + (Ca - (-G)) * (2 * r : ℕ)) * H := by rw [← Real.rpow_sub hL, hp, hp, hp, ← Real.rpow_add hL, ← Real.rpow_add hL] _ = _ := by rw [mul_comm] congr 2 push_cast ring end Bounty end -- Source module: PhysicalRootLowRankPower section /- Convert the actual Fourier edge costs to the exact polynomial low-rank exponent used by the common-forest two-regime estimate. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable [∀ g (p : P (e.symm g).val), NeZero p.val] variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] (hVs : ∀ s : ↥groupsᶜ, 0 < V s.val) (v vmax : ℝ) (hμ : ∀ g p, 0 < β g p / V (e.symm g).val) (hmass : ∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) (hρ : 0 < ρ) (hV : ∀ g : Fin M, 0 ≤ V (e.symm g).val) (hVmax : ∀ g : Fin M, V (e.symm g).val ≤ vmax) (hv : 0 < v) include hVs hμ hmass hρ hV hVmax hv in theorem physical_root_low_rank_forest_contribution_power_le (hinj : Function.Injective encode) (hMass : ∀ s : ↥groupsᶜ, ∑ p ∈ P s.val, 1 / (p : ℝ) = V s.val) (hret0 : ∀ j, 0 ≤ retention j) (hret1 : ∀ j, retention j ≤ 1) (hD : ∀ j, retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) (hbirth : ∀ j (g : Fin M), retention j / ρ ^ 2 + ((1 - retention j) * V (e.symm g).val / ρ) / v ≤ 1) {L G Ca Cv H decay excess : ℝ} (hL : 1 ≤ L) (hexponent : 0 ≤ G + Ca) (hdecay : decay ≤ L ^ (-G)) (hexcess : excess ≤ L ^ Ca) (hvisit : Real.sqrt (physicalGhostUniformEnergyBound ρ vmax v ^ M) ≤ L ^ Cv) (hinitial : (∏ g, (∑ p, β g p / V (e.symm g).val) ^ (J + ell)) ≤ H) : let row := physicalRootFourierRow groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode let w : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℝ := physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => β g p / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (e.symm g).val))) let symmetric := fun f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ => ∀ s, ProductMemorySymmetric (fun x => f (s, x)) (∀ ν, ∀ j : Fin (n + 1), ∀ f, symmetric f → symmetric (row ν none (row ν (some (.inr j)) (row ν none f)))) → (∀ ν, ∀ j : Fin (n + 1), ∀ f, symmetric f → cleanActiveNorm w (row ν none (row ν (some (.inr j)) (row ν none f))) ≤ (if j ∈ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code then excess else decay) * cleanActiveNorm w f) → ‖physicalRootForestContribution groups e patterns C hC k V q ζ K θ β retention ρ code‖ ≤ H * L ^ ((-G + Cv) * ((n + 1 : ℕ) : ℝ) + Cv + 2 * birthForestRank code * (G + Ca)) := by intro row w symmetric hEpres hE have hL0 : 0 < L := zero_lt_one.trans_le hL have horder : L ^ (-G) ≤ L ^ Ca := Real.rpow_le_rpow_of_exponent_le hL (by linarith) have hword := physical_root_low_rank_forest_contribution_le groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode hVs v vmax hμ hmass hρ hV hVmax hv hinj hMass hret0 hret1 hD hbirth (Real.rpow_pos_of_pos hL0 (-G)) horder hEpres (fun ν j f hf => (hE ν j f hf).trans (mul_le_mul_of_nonneg_right (by by_cases hj : j ∈ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) B (n + 1) code · simpa only [if_pos hj] using hexcess · simpa only [if_neg hj] using hdecay) (Real.sqrt_nonneg _))) have hm0 : 0 ≤ ∏ g, (∑ p, β g p / V (e.symm g).val) ^ (J + ell) := prod_nonneg (fun g _ => pow_nonneg (sum_nonneg (fun p _ => (hμ g p).le)) _) exact hword.trans (root_low_rank_cost_power_le (n + 1) (birthForestRank code) hL0 (Real.sqrt_nonneg _) hvisit hm0 hinitial) end Root end Bounty end -- Source module: PhysicalRootResidueEdgeCosts section /- Explicit projected edge costs, the high-rank estimate, and the cap comparison give the literal original residue-model bound. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_physical_root_residue_of_edge_costs {budget E G Cv Ca Ch : ℝ} (hbudget : 0 ≤ budget) (hE : 0 ≤ E) (hD : 0 ≤ G + Ca + 6) (hgain : E + 1 + Cv + 2 ≤ G) : ∀ᶠ L : ℝ in atTop, ∀ (I : Type) (N M J ell n b B : ℕ) (P : Fin N → Finset ℕ) [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (_hV : ∀ g, 0 < V g) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (_hk : ∀ time < n + 1, ∀ i ∈ patterns, ∀ g p, p ∈ P g → ¬ (p : ℤ) ∣ k time i) (baseline : PhysicalPrime P → ℝ) (_hb : ∀ p : PhysicalPrime P, p.1 ∈ groups → baseline p = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / p.2.val) (_hB : (physicalPrimeGroups P groups).card ≤ B) (ρ : ℝ) (_hρ : ρ ≠ 0) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (_hinj : Function.Injective encode), let beta := fun p : PhysicalPrime P => ((p.2.val : ℝ) * baseline p)⁻¹ let m := Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) b ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))) let F := fun (θ : ℝ) (code : BirthForestCode m) => physicalRootForestContribution groups e patterns C hC k V q ζ K θ (fun (g : Fin M) (p : P (e.symm g).val) => beta ⟨(e.symm g).val, p⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ code let err := L ^ (-((E + 1) * ((n + 1 : ℕ) : ℝ))) 0 ≤ q → q ≤ 1 → (∀ p : PhysicalPrime P, p.1 ∈ groups → 2 * (n + 2) ≤ p.2.val) → L ^ (1/2 : ℝ) ≤ ((n + 1 : ℕ) : ℝ) → (m : ℝ) ≤ L ^ (6 : ℝ) → ∀ H A ε : ℝ, 0 ≤ H → H ≤ L ^ Ch → 0 ≤ A → A ≤ L ^ (budget * (((n + 1 : ℕ) : ℝ) + 1)) → 0 ≤ ε → (m : ℝ) ^ 2 * ε ≤ Real.exp (-(L ^ (1/4 : ℝ))) → let cutoff := Nat.ceil (((2 * budget + ((E + 1) + 1) + 1) * ((n + 1 : ℕ) : ℝ) * Real.log L) / L ^ (1/4 : ℝ)) ∀ v vmax decay excess : ℝ, (∀ g p, 0 < beta ⟨(e.symm g).val, p⟩ / V (e.symm g).val) → (∀ g, ∑ p, beta ⟨(e.symm g).val, p⟩ / V (e.symm g).val ≤ 2) → 0 < ρ → 0 < v → (∀ g : Fin M, V (e.symm g).val ≤ vmax) → (∀ s : ↥groupsᶜ, ∑ p ∈ P s.val, 1 / (p : ℝ) = V s.val) → (∀ j : Fin (n + 2), 0 ≤ physicalEndpointSchedule q (n + 1) j.val) → (∀ j : Fin (n + 2), physicalEndpointSchedule q (n + 1) j.val ≤ 1) → (∀ j : Fin (n + 2), physicalEndpointSchedule q (n + 1) j.val / ρ ^ 2 + ((1 - physicalEndpointSchedule q (n + 1) j.val) / ρ) / v ≤ 1) → (∀ (j : Fin (n + 2)) (g : Fin M), physicalEndpointSchedule q (n + 1) j.val / ρ ^ 2 + ((1 - physicalEndpointSchedule q (n + 1) j.val) * V (e.symm g).val / ρ) / v ≤ 1) → 0 ≤ G + Ca → decay ≤ L ^ (-G) → excess ≤ L ^ Ca → Real.sqrt (physicalGhostUniformEnergyBound ρ vmax v ^ M) ≤ L ^ Cv → (∏ g, (∑ p, beta ⟨(e.symm g).val, p⟩ / V (e.symm g).val) ^ (J + ell)) ≤ H → let : ∀ g (p : P (e.symm g).val), NeZero p.val := fun g p => inferInstanceAs (NeZero (⟨(e.symm g).val, p⟩ : PhysicalPrime P).2.val) let : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) let hPs := fun (s : ↥groupsᶜ) p hp => hP s.val p hp let hPb := fun (g : Fin M) p hp => hP (e.symm g).val p hp let hcross : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val) := fun s g => hdis (by intro he; exact (e.symm g).property (he ▸ s.property)) let row := fun θ (code : BirthForestCode m) => physicalRootFourierRow groups e patterns C hC k V q ζ K θ (fun (g : Fin M) (p : P (e.symm g).val) => beta ⟨(e.symm g).val, p⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ hPs hPb hcross code encode let w := physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => beta ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => beta ⟨(e.symm g).val, p⟩ / V (e.symm g).val))) let symmetric := fun f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e → ℂ => ∀ s, ProductMemorySymmetric (fun x => f (s, x)) (∀ θ ∈ Set.Icc (0 : ℝ) 1, ∀ code ν, ∀ j : Fin (n + 1), ∀ f, symmetric f → symmetric (row θ code ν none (row θ code ν (some (.inr j)) (row θ code ν none f)))) → (∀ θ ∈ Set.Icc (0 : ℝ) 1, ∀ code ν, ∀ j : Fin (n + 1), ∀ f, symmetric f → cleanActiveNorm w (row θ code ν none (row θ code ν (some (.inr j)) (row θ code ν none f))) ≤ (if j ∈ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) b (n + 1) code then excess else decay) * cleanActiveNorm w f) → (∀ θ ∈ Set.Icc (0 : ℝ) 1, ∀ code, cutoff ≤ birthForestRank code → ‖F θ code‖ ≤ A * ε ^ birthForestRank code) → (∀ θ ∈ Set.Icc (0 : ℝ) 1, ‖physicalRootNormalizedMixedScalar (n := n) (B := B) groups e patterns C hC V q ζ k K θ beta ρ hP hdis - physicalRootNormalizedMixedScalar (n := n) (B := b) groups e patterns C hC V q ζ k K θ beta ρ hP hdis‖ ≤ err) → ‖physicalRootResidueModel V patterns C q ζ k K n‖ ≤ 2 * err := by filter_upwards [eventually_physical_root_residue_two_regime (Ch := Ch) hbudget hE hD hgain, eventually_ge_atTop (1 : ℝ)] with L hmodel hL intro I N M J ell n b B P _ groups e V patterns C hC q ζ k K hV hP hdis hk baseline hb hB ρ hρ encode hinj beta m F err hq0 hq1 hsize hN hm H A ε hH hHb hA hAb hε hεb cutoff v vmax decay excess hμ hmass hρ0 hv hVmax hSmallMass hret0 hret1 hDghost hbirth hexponent hdecay hexcess hvisit hinitial instBig instSmall hPs hPb hcross row w symmetric hEpres hEdge hhigh hcap let : ∀ g (p : P (e.symm g).val), NeZero p.val := fun g p => inferInstanceAs (NeZero (⟨(e.symm g).val, p⟩ : PhysicalPrime P).2.val) let : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) apply hmodel I N M J ell n b B P groups e V patterns C hC q ζ k K hV hP hdis hk baseline hb hB ρ hρ encode hinj hq0 hq1 hsize hN hm H A ε hH hHb hA hAb hε hεb _ hhigh hcap intro θ hθ code _ exact physical_root_low_rank_forest_contribution_power_le groups e patterns C hC k V q ζ K θ (fun (g : Fin M) (p : P (e.symm g).val) => beta ⟨(e.symm g).val, p⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ hPs hPb hcross code encode (fun s => hV s.val) v vmax hμ hmass hρ0 (fun g => (hV (e.symm g).val).le) hVmax hv hinj hSmallMass hret0 hret1 hDghost hbirth hL hexponent hdecay hexcess hvisit hinitial (hEpres θ hθ code) (hEdge θ hθ code) end Bounty end -- Source module: PhysicalRootResidueCap section /- The original-cap comparison is discharged from explicit polynomial budgets, leaving the edge costs and high-rank forest estimate. -/ open Finset Filter open scoped Classical namespace Bounty theorem eventually_physical_root_residue_of_edge_costs_and_cap {budget E G Cv Ca Ch q vs ρ v vmin vmax CG PG HG : ℝ} (hbudget : 0 ≤ budget) (hE : 0 ≤ E) (hD : 0 ≤ G + Ca + 6) (hgain : E + 1 + Cv + 2 ≤ G) (hq0 : 0 ≤ q) (hq1 : q < 1) (hvs : 0 < vs) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hCG : 0 ≤ CG) (hPG : 0 ≤ PG) (hHG : 0 ≤ HG) (J ell T : ℕ) : ∀ᶠ L : ℝ in atTop, let n := 2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1 ∀ (I : Type) (N M b B : ℕ) (P : Fin N → Finset ℕ) [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (_hV : ∀ g, 0 < V g) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : Pairwise (fun g h => Disjoint (P g) (P h))) (_hk : ∀ time < n + 1, ∀ i ∈ patterns, ∀ g p, p ∈ P g → ¬ (p : ℤ) ∣ k time i) (baseline : PhysicalPrime P → ℝ) (_hb : ∀ p : PhysicalPrime P, p.1 ∈ groups → baseline p = 1 - (∑ j ∈ range (n + 2), (1 - physicalEndpointSchedule q (n + 1) j)) / p.2.val) (_hB : (physicalPrimeGroups P groups).card ≤ B) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (_hinj : Function.Injective encode), let beta := fun p : PhysicalPrime P => ((p.2.val : ℝ) * baseline p)⁻¹ let m := Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) b ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))) let F := fun (θ : ℝ) (code : BirthForestCode m) => physicalRootForestContribution groups e patterns C hC k V q ζ K θ (fun (g : Fin M) (p : P (e.symm g).val) => beta ⟨(e.symm g).val, p⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ code let err := L ^ (-((E + 1) * ((n + 1 : ℕ) : ℝ))) (∀ p : PhysicalPrime P, p.1 ∈ groups → 2 * (n + 2) ≤ p.2.val) → L ^ (1/2 : ℝ) ≤ ((n + 1 : ℕ) : ℝ) → (m : ℝ) ≤ L ^ (6 : ℝ) → ∀ H A ε : ℝ, 0 ≤ H → H ≤ L ^ Ch → 0 ≤ A → A ≤ L ^ (budget * (((n + 1 : ℕ) : ℝ) + 1)) → 0 ≤ ε → (m : ℝ) ^ 2 * ε ≤ Real.exp (-(L ^ (1/4 : ℝ))) → let cutoff := Nat.ceil (((2 * budget + ((E + 1) + 1) + 1) * ((n + 1 : ℕ) : ℝ) * Real.log L) / L ^ (1/4 : ℝ)) ∀ decay excess : ℝ, (∀ g p, 0 < beta ⟨(e.symm g).val, p⟩ / V (e.symm g).val) → (∀ g, ∑ p, beta ⟨(e.symm g).val, p⟩ / V (e.symm g).val ≤ 2) → (∀ g : Fin M, V (e.symm g).val ≤ vmax) → (∀ s : ↥groupsᶜ, ∑ p ∈ P s.val, 1 / (p : ℝ) = V s.val) → (∀ j : Fin (n + 2), 0 ≤ physicalEndpointSchedule q (n + 1) j.val) → (∀ j : Fin (n + 2), physicalEndpointSchedule q (n + 1) j.val ≤ 1) → (∀ j : Fin (n + 2), physicalEndpointSchedule q (n + 1) j.val / ρ ^ 2 + ((1 - physicalEndpointSchedule q (n + 1) j.val) / ρ) / v ≤ 1) → (∀ (j : Fin (n + 2)) (g : Fin M), physicalEndpointSchedule q (n + 1) j.val / ρ ^ 2 + ((1 - physicalEndpointSchedule q (n + 1) j.val) * V (e.symm g).val / ρ) / v ≤ 1) → 0 ≤ G + Ca → decay ≤ L ^ (-G) → excess ≤ L ^ Ca → Real.sqrt (physicalGhostUniformEnergyBound ρ vmax v ^ M) ≤ L ^ Cv → (∏ g, (∑ p, beta ⟨(e.symm g).val, p⟩ / V (e.symm g).val) ^ (J + ell)) ≤ H → let : ∀ g (p : P (e.symm g).val), NeZero p.val := fun g p => inferInstanceAs (NeZero (⟨(e.symm g).val, p⟩ : PhysicalPrime P).2.val) let : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) let hPs := fun (s : ↥groupsᶜ) p hp => hP s.val p hp let hPb := fun (g : Fin M) p hp => hP (e.symm g).val p hp let hcross : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val) := fun s g => hdis (by intro he; exact (e.symm g).property (he ▸ s.property)) let row := fun θ (code : BirthForestCode m) => physicalRootFourierRow groups e patterns C hC k V q ζ K θ (fun (g : Fin M) (p : P (e.symm g).val) => beta ⟨(e.symm g).val, p⟩) (fun j => physicalEndpointSchedule q (n + 1) j.val) ρ hPs hPb hcross code encode let w := physicalSmallBigMeasure (fun s : ↥groupsᶜ => V s.val) (productMemoryWeight (fun g p => beta ⟨(e.symm g).val, p⟩ / V (e.symm g).val) (fun g => unrestrictedResidueWeight (fun p => beta ⟨(e.symm g).val, p⟩ / V (e.symm g).val))) let symmetric := fun f : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := b) groups e → ℂ => ∀ s, ProductMemorySymmetric (fun x => f (s, x)) (∀ θ ∈ Set.Icc (0 : ℝ) 1, ∀ code ν, ∀ j : Fin (n + 1), ∀ f, symmetric f → symmetric (row θ code ν none (row θ code ν (some (.inr j)) (row θ code ν none f)))) → (∀ θ ∈ Set.Icc (0 : ℝ) 1, ∀ code ν, ∀ j : Fin (n + 1), ∀ f, symmetric f → cleanActiveNorm w (row θ code ν none (row θ code ν (some (.inr j)) (row θ code ν none f))) ≤ (if j ∈ physicalSelectedAffectedEdges (fun _ : Fin M => J + ell) b (n + 1) code then excess else decay) * cleanActiveNorm w f) → (∀ θ ∈ Set.Icc (0 : ℝ) 1, ∀ code, cutoff ≤ birthForestRank code → ‖F θ code‖ ≤ A * ε ^ birthForestRank code) → L ≤ (b : ℝ) → b ≤ B → (Fintype.card ↥groupsᶜ : ℝ) ≤ CG * Real.log L → (M : ℝ) ≤ CG * Real.log L → (Fintype.card ↥patterns : ℝ) ≤ L ^ PG → (∀ s : ↥groupsᶜ, vs ≤ V s.val) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g : Fin M, vmin ≤ V (e.symm g).val) → (∀ (j : Fin (n + 2)) (g : Fin M), physicalEndpointSchedule q (n + 1) j.val / ρ ^ 2 + ((1 - physicalEndpointSchedule q (n + 1) j.val) * (2 * V (e.symm g).val) / ρ) / v ≤ 1) → (∀ (i : patterns) (g : Fin M), (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) → ∀ Hkernel : ℝ, 1 ≤ Hkernel → Hkernel ≤ L ^ HG → (∀ time < n + 1, ∀ i ∈ patterns, ∀ U W aux, ‖K time i U W aux‖ ≤ Hkernel) → ‖physicalRootResidueModel V patterns C q ζ k K n‖ ≤ 2 * err := by filter_upwards [eventually_physical_root_residue_of_edge_costs (Ch := Ch) hbudget hE hD hgain, eventually_original_root_scalar_cap_error (ρ := ρ) (v := v) (vmin := vmin) (vmax := vmax) hq0 hq1 hvs hCG hPG hHG (by linarith : 0 ≤ E + 1) J ell T, eventually_ge_atTop (1 : ℝ)] with L hmodel hcap hL intro n I N M b B P _ groups e V patterns C hC ζ k K hV hP hdis hk baseline hb hB encode hinj beta m F err hsize hN hm H A ε hH hHb hA hAb hε hεb cutoff decay excess hμ hmass hVmax hSmallMass hret0 hret1 hDghost hbirth hexponent hdecay hexcess hvisit hinitial instBig instSmall hPs hPb hcross row w symmetric hEpres hEdge hhigh hbL hbB hsmallLog hbigLog hpatterns hVs hMass hVmin hCghost hT Hkernel hHkernel hHkernelPow hK have hceil : 1 ≤ Nat.ceil (L ^ (13/25 : ℝ)) := by have hpow : 1 ≤ L ^ (13/25 : ℝ) := Real.one_le_rpow hL (by norm_num) have hh := hpow.trans (Nat.le_ceil (L ^ (13/25 : ℝ))) exact_mod_cast hh have hn : n + 1 = 2 * Nat.ceil (L ^ (13/25 : ℝ)) := by dsimp only [n]; omega have hL0 : 0 < L := zero_lt_one.trans_le hL have hpower : (L ^ (-(E + 1))) ^ (2 * Nat.ceil (L ^ (13/25 : ℝ))) = err := by dsimp only [err] rw [hn, ← Real.rpow_natCast, ← Real.rpow_mul hL0.le] congr 1 ring apply hmodel I N M J ell n b B P groups e V patterns C hC q ζ k K hV hP hdis hk baseline hb hB ρ hρ0.ne' encode hinj hq0 hq1.le hsize hN hm H A ε hH hHb hA hAb hε hεb v vmax decay excess hμ hmass hρ0 (zero_lt_one.trans hv) hVmax hSmallMass hret0 hret1 hDghost hbirth hexponent hdecay hexcess hvisit hinitial hEpres hEdge hhigh intro θ _ exact (hcap I N M b B P groups e patterns C hC V ζ k K θ beta hP hdis hbL hbB hsmallLog hbigLog hpatterns hVs hV hMass hρ0 hρ1 hv hvmin hVmin hVmax hμ hmass hret0 hret1 hDghost hCghost hT Hkernel hHkernel hHkernelPow hK).trans_eq hpower end Bounty end -- Source module: SmallCompletionRow section /- Uniform positive row bounds for the actual small-completion kernel. The translated residue may depend arbitrarily on the big event. -/ open Finset open scoped Classical namespace Bounty theorem physical_small_vertex_le_one {G : Type*} [Fintype G] {P : G → Finset ℕ} {J ell : ℕ} (L : PhysicalMarkLists P J ell) {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (r : PhysicalResidues P) : physicalResidueVertexWeight L q r ≤ 1 := by unfold physicalResidueVertexWeight split_ifs · exact prod_le_one₀ (fun _ _ => pow_nonneg hq0 _) (fun _ _ => pow_le_one₀ hq0 hq1) · exact zero_le_one theorem exists_physical_small_completion_row_bound {qmax v : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hv : 0 < v) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] (P : G → Finset ℕ) (J : ℕ) (V : G → ℝ), (∀ g, v ≤ V g) → ∀ (q : ℝ), 0 ≤ q → q ≤ qmax → ∀ (r r' : PhysicalResidues P) (L : PhysicalMarkLists P J ell), (∑ R : PhysicalMarkLists P J ell, if physicalSharedPrefix L = physicalSharedPrefix R then physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell * (physicalResidueVertexWeight L q r * physicalResidueVertexWeight R q r') else 0) ≤ A ^ Fintype.card G := by obtain ⟨A, hA, hbound⟩ := exists_small_completion_energy_bound hqmax0 hqmax1 hv ell refine ⟨A, hA, ?_⟩ intro G _ P J V hV q hq0 hqmax r r' L let C := physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell let d := physicalSharedPrefix L let F := (univ : Finset (PhysicalMarkLists P J ell)).filter (fun R => physicalResidueMarksValid r' R ∧ physicalSharedPrefix R = d) let w := ∏ g, q ^ (physicalResidueOmega P g r' - (J + ell)) have hC : 0 ≤ C := (physical_completion_mass_pos V _ ell (fun g => hv.trans_le (hV g))).le have hleft1 : physicalResidueVertexWeight L q r ≤ 1 := physical_small_vertex_le_one L hq0 (hqmax.trans hqmax1.le) r have hsum : (∑ R : PhysicalMarkLists P J ell, if physicalSharedPrefix L = physicalSharedPrefix R then C * (physicalResidueVertexWeight L q r * physicalResidueVertexWeight R q r') else 0) = C * physicalResidueVertexWeight L q r * w * (F.card : ℝ) := by calc _ = ∑ R ∈ F, C * physicalResidueVertexWeight L q r * w := by rw [sum_filter] apply sum_congr rfl intro R _ simp only [physicalResidueVertexWeight, d, w] by_cases hp : physicalSharedPrefix L = physicalSharedPrefix R · by_cases hr : physicalResidueMarksValid r' R · simp only [hp, hr, if_true, and_self, mul_assoc] · simp only [hp, hr, if_true, if_false, false_and, mul_zero] · have hp' : ¬physicalSharedPrefix R = physicalSharedPrefix L := Ne.symm hp simp only [hp, hp', if_false, and_false] _ = _ := by rw [sum_const, nsmul_eq_mul]; ring rw [show (∑ R : PhysicalMarkLists P J ell, if physicalSharedPrefix L = physicalSharedPrefix R then physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell * (physicalResidueVertexWeight L q r * physicalResidueVertexWeight R q r') else 0) = C * physicalResidueVertexWeight L q r * w * (F.card : ℝ) from hsum] by_cases hF : F.Nonempty · obtain ⟨R, hR⟩ := hF have hvalid : physicalResidueMarksValid r' R := (mem_filter.mp hR).2.1 have hd : physicalResidueSharedValid r' d := by rw [← (mem_filter.mp hR).2.2] exact physical_shared_prefix_valid r' ⟨R, hvalid⟩ have hc : (F.card : ℝ) = ∏ g, ((physicalResidueOmega P g r' - J).descFactorial ell : ℝ) := by have hc := physical_residue_shared_filter_card P J ell r' d rw [if_pos hd] at hc exact_mod_cast hc have hw : w ≤ ∏ g, qmax ^ (physicalResidueOmega P g r' - (J + ell)) := by apply prod_le_prod₀ · intro g _ exact pow_nonneg hq0 _ · intro g _ exact pow_le_pow_left₀ hq0 hqmax _ calc _ ≤ C * 1 * (∏ g, qmax ^ (physicalResidueOmega P g r' - (J + ell))) * (F.card : ℝ) := by gcongr _ = C * (∏ g, qmax ^ (physicalResidueOmega P g r' - (J + ell))) * (∏ g, ((physicalResidueOmega P g r' - J).descFactorial ell : ℝ)) := by rw [hc, mul_one] _ ≤ _ := hbound G J V hV (fun g => physicalResidueOmega P g r') (physical_residue_slots_le_omega P J ell r' ⟨R, hvalid⟩) · rw [not_nonempty_iff_eq_empty.mp hF, card_empty, Nat.cast_zero, mul_zero] exact pow_nonneg (zero_le_one.trans hA) _ end Bounty end -- Source module: SmallCompletionSelectedRow section /- Summing the genuine small kernel preserves every nonnegative selector on the big event, including the causal birth-forest selector. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_small_selected_row_bound {qmax v : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hv : 0 < v) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (G : Type) [Fintype G] (P : G → Finset ℕ) (J : ℕ) (V : G → ℝ), (∀ g, v ≤ V g) → ∀ (q : ℝ), 0 ≤ q → q ≤ qmax → ∀ (E : Type) [Fintype E] (r : PhysicalResidues P) (r' : E → PhysicalResidues P) (L : PhysicalMarkLists P J ell) (selector : E → ℝ), (∀ e, 0 ≤ selector e) → (∑ e : E, ∑ R : PhysicalMarkLists P J ell, (if physicalSharedPrefix L = physicalSharedPrefix R then physicalCompletionMass V (fun _ => (∅ : Finset (Fin J))) ell * (physicalResidueVertexWeight L q r * physicalResidueVertexWeight R q (r' e)) else 0) * selector e) ≤ A ^ Fintype.card G * ∑ e : E, selector e := by obtain ⟨A, hA, hrow⟩ := exists_physical_small_completion_row_bound hqmax0 hqmax1 hv ell refine ⟨A, hA, ?_⟩ intro G _ P J V hV q hq0 hqmax E _ r r' L selector hselector rw [mul_sum] apply sum_le_sum intro e _ rw [← sum_mul] exact mul_le_mul_of_nonneg_right (hrow G P J V hV q hq0 hqmax r (r' e) L) (hselector e) end Bounty end -- Source module: SmallBigSelectedRow section /- The original mixed edge preserves any nonnegative big-event selector when its outgoing small marks are summed. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_small_big_selected_row_bound {qmax v : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hv : 0 < v) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (S X : Type) [Fintype S] (Ps : S → Finset ℕ) (J : ℕ) (Vs : S → ℝ), (∀ g, v ≤ Vs g) → ∀ (q : ℝ), Real.sqrt q ≤ qmax → ∀ (E : PhysicalSharedLists Ps J → X → Type) [∀ d x, Fintype (E d x)] (a : PhysicalResidues Ps → ∀ d x, E d x → ℝ) (k : X → ℤ) (s : PhysicalSmallBigState Ps J ell X) (selector : E (physicalSharedPrefix s.1.2) s.2 → ℝ), (∀ e, 0 ≤ selector e) → (∑ e : PhysicalSmallBigEvent E s, |physicalSmallBigPositiveWeight Vs q E a k s e| * selector e.2) ≤ A ^ Fintype.card S * ∑ e : E (physicalSharedPrefix s.1.2) s.2, |a s.1.1 (physicalSharedPrefix s.1.2) s.2 e| * selector e := by obtain ⟨A, hA, hrow⟩ := exists_physical_small_selected_row_bound hqmax0 hqmax1 hv ell refine ⟨A, hA, ?_⟩ intro S X _ Ps J Vs hVs q hq E _ a k s selector hselector have hVs0 : ∀ g, 0 < Vs g := fun g => hv.trans_le (hVs g) have hC : 0 ≤ physicalCompletionMass Vs (fun _ => (∅ : Finset (Fin J))) ell := (physical_completion_mass_pos Vs _ ell hVs0).le have hnonneg (R : PhysicalMarkLists Ps J ell) : 0 ≤ physicalCompletionMass Vs (fun _ => (∅ : Finset (Fin J))) ell * (physicalResidueVertexWeight s.1.2 (Real.sqrt q) s.1.1 * physicalResidueVertexWeight R (Real.sqrt q) (physicalTranslateResidues s.1.1 (k s.2 * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ)))) := mul_nonneg hC (mul_nonneg (physical_residue_vertex_weight_nonneg _ (Real.sqrt_nonneg q) _) (physical_residue_vertex_weight_nonneg _ (Real.sqrt_nonneg q) _)) have hb := hrow S Ps J Vs hVs (Real.sqrt q) (Real.sqrt_nonneg q) hq (E (physicalSharedPrefix s.1.2) s.2) s.1.1 (fun _ => physicalTranslateResidues s.1.1 (k s.2 * (physicalSharedProduct (physicalSharedPrefix s.1.2) : ℕ))) s.1.2 (fun e => |a s.1.1 (physicalSharedPrefix s.1.2) s.2 e| * selector e) (fun e => mul_nonneg (abs_nonneg _) (hselector e)) refine le_trans (le_of_eq ?_) hb rw [show (∑ e : PhysicalSmallBigEvent E s, |physicalSmallBigPositiveWeight Vs q E a k s e| * selector e.2) = ∑ R : PhysicalMarkLists Ps J ell, ∑ e : E (physicalSharedPrefix s.1.2) s.2, |physicalSmallBigPositiveWeight Vs q E a k s (R, e)| * selector e by exact Fintype.sum_prod_type _] rw [sum_comm] apply sum_congr rfl intro e _ apply sum_congr rfl intro R _ unfold physicalSmallBigPositiveWeight split_ifs · rw [abs_mul, abs_of_nonneg (hnonneg R), mul_assoc] · simp only [abs_zero, zero_mul] end Bounty end -- Source module: PhysicalMixedSelectedEdgeRow section /- Selected rows of the literal original mixed edge. The outgoing small marks are summed while every pattern, auxiliary and big-event selector stays. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_mixed_selected_edge_row_bound {qmax vs : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ C : ℝ, 1 ≤ C ∧ ∀ (S G I V K : Type) [Fintype S] [Fintype G] [DecidableEq G] [Fintype I] (Ps : S → Finset ℕ) (P : G → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : G → ℕ) (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : G → ℝ) (Vs : S → ℝ) (qedge : K → ℝ), (∀ s, vs ≤ Vs s) → ∀ (k : K), Real.sqrt (qedge k) ≤ qmax → ∀ (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (selector : ∀ i a, PhysicalSmallBigFullEvent n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a) (physicalSharedPrefix s.1.2) s.2 → ℝ), (∀ i a e, 0 ≤ selector i a e) → (∑ e : PhysicalMixedWordEdge n shared B A Δ D k s, |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge (some (.inr k)) s e| * selector e.1 e.2.1 e.2.2.2) ≤ C ^ Fintype.card S * ∑ i, ∑ a, |ω i (productActiveMemorySplit (shared i) B s.2).1 a| * ∑ e : PhysicalSmallBigFullEvent n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a) (physicalSharedPrefix s.1.2) s.2, |physicalSmallBigFullWeight n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a) μ ρ Vb s.1.1 (physicalSharedPrefix s.1.2) s.2 e| * selector i a e := by obtain ⟨C, hC, hrow⟩ := exists_physical_small_big_selected_row_bound hqmax0 hqmax1 hvs ell refine ⟨C, hC, ?_⟩ intro S G I V K _ _ _ _ Ps P _ n _ J M shared B A _ Δ D kbig ω μ qghost ρ Vb Vs qedge hVs k hq s selector hselector rw [show (∑ e : PhysicalMixedWordEdge n shared B A Δ D k s, |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge (some (.inr k)) s e| * selector e.1 e.2.1 e.2.2.2) = ∑ i, ∑ a, ∑ e : PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a)) s, |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge (some (.inr k)) s ⟨i,a,e⟩| * selector i a e.2 by exact (Fintype.sum_sigma _).trans (sum_congr rfl fun _ _ => Fintype.sum_sigma _)] rw [mul_sum] apply sum_le_sum intro i _ rw [mul_sum] apply sum_le_sum intro a _ have hb := hrow S (ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) Ps J Vs hVs (qedge k) hq (PhysicalSmallBigFullEvent n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a)) (physicalSmallBigFullWeight n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a) μ ρ Vb) (fun x => kbig k i (productActiveMemorySplit (shared i) B x).1 a) s (selector i a) (hselector i a) calc _ = |ω i (productActiveMemorySplit (shared i) B s.2).1 a| * ∑ e : PhysicalSmallBigEvent (PhysicalSmallBigFullEvent n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a)) s, |physicalSmallBigPositiveWeight Vs (qedge k) _ (physicalSmallBigFullWeight n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a) μ ρ Vb) (fun x => kbig k i (productActiveMemorySplit (shared i) B x).1 a) s e| * selector i a e.2 := by rw [mul_sum] apply sum_congr rfl intro e _ simp only [physicalMixedWordWeight, abs_mul, mul_assoc] _ ≤ |ω i (productActiveMemorySplit (shared i) B s.2).1 a| * (C ^ Fintype.card S * _) := mul_le_mul_of_nonneg_left hb (abs_nonneg _) _ = _ := by ring end Bounty end -- Source module: FullMixedShapeHistory section /- Causal common-forest history is determined by the capacity shape and the current optional birth labels, not by the decorated event key. -/ open scoped Classical namespace Bounty section Shape variable {Z : Type*} {N : ℕ} (M : Fin N → ℕ) noncomputable def fullMixedShapeHistoryWrite (s : FullMixedCommonShapeData N) (u : Fin s.1) (label : FullMixedShapeLocalAddress s u → Option Z) (history : Fin (Fintype.card (FullMixedCommonShapeAddress M s)) → Option Z) (i : Fin (Fintype.card (FullMixedCommonShapeAddress M s))) : Option Z := match fullMixedCommonShapeOrder M s i with | .inl _ => history i | .inr a => if h : a.1 = u then label (cast (congrArg (FullMixedShapeLocalAddress s) h) a.2) else history i noncomputable def fullMixedShapeHistoryGain (s : FullMixedCommonShapeData N) (code : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M s))) (u : Fin s.1) (label : FullMixedShapeLocalAddress s u → Option Z) (history : Fin (Fintype.card (FullMixedCommonShapeAddress M s)) → Option Z) : ℝ := if birthForestStageCondition (fullMixedShapeIndexStage M s) u.succ (fullMixedShapeHistoryWrite M s u label history) code then 1 else 0 theorem full_mixed_shape_history_write_heq {s t : FullMixedCommonShapeData N} (h : s = t) {u : Fin s.1} {v : Fin t.1} (huv : HEq u v) {label : FullMixedShapeLocalAddress s u → Option Z} {label' : FullMixedShapeLocalAddress t v → Option Z} (hl : HEq label label') {history : Fin (Fintype.card (FullMixedCommonShapeAddress M s)) → Option Z} {history' : Fin (Fintype.card (FullMixedCommonShapeAddress M t)) → Option Z} (hh : HEq history history') : HEq (fullMixedShapeHistoryWrite M s u label history) (fullMixedShapeHistoryWrite M t v label' history') := by cases h cases eq_of_heq huv cases eq_of_heq hl cases eq_of_heq hh rfl theorem full_mixed_shape_history_gain_eq {s t : FullMixedCommonShapeData N} (h : s = t) {code : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M s))} {code' : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M t))} (hc : HEq code code') {u : Fin s.1} {v : Fin t.1} (huv : HEq u v) {label : FullMixedShapeLocalAddress s u → Option Z} {label' : FullMixedShapeLocalAddress t v → Option Z} (hl : HEq label label') {history : Fin (Fintype.card (FullMixedCommonShapeAddress M s)) → Option Z} {history' : Fin (Fintype.card (FullMixedCommonShapeAddress M t)) → Option Z} (hh : HEq history history') : fullMixedShapeHistoryGain M s code u label history = fullMixedShapeHistoryGain M t code' v label' history' := by cases h cases eq_of_heq hc cases eq_of_heq huv cases eq_of_heq hl cases eq_of_heq hh rfl end Shape section Original variable {I K : Type*} {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ D : ∀ k c, A k c → Fin N → ℤ) (steps : List (Option (I ⊕ K))) theorem full_mixed_common_history_write_shape (u : Fin steps.length) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) x) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : fullMixedCommonHistoryWrite n S B A Δ D steps u x e history = fullMixedShapeHistoryWrite M (fullMixedCommonShape M B steps) u (fullMixedCommonEventBirthLabel n S B A Δ D (steps.get u) x e) history := by funext i unfold fullMixedCommonHistoryWrite fullMixedCommonAddressWrite fullMixedShapeHistoryWrite rw [full_mixed_common_order_shape] cases h : fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps) i with | inl a => dsimp only have hi : (fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps)).symm (.inl a) = i := by rw [← h] exact (fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps)).symm_apply_apply i exact congrArg history hi | inr a => dsimp only have hi : (fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps)).symm (.inr a) = i := by rw [← h] exact (fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps)).symm_apply_apply i split_ifs <;> first | rfl | contradiction | exact congrArg history hi theorem full_mixed_common_history_gain_shape (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (u : Fin steps.length) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : FullPermutationMixedEvent n S B A Δ D (steps.get u) x) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : fullMixedCommonForestHistoryGain n S B A Δ D steps code u.val (steps.get u) x e history = fullMixedShapeHistoryGain M (fullMixedCommonShape M B steps) code u (fullMixedCommonEventBirthLabel n S B A Δ D (steps.get u) x e) history := by rw [full_mixed_common_forest_history_gain_owner, full_mixed_common_history_write_shape, full_mixed_index_stage_shape] rfl end Original end Bounty end -- Source module: PhysicalCommonHistoryGain section /- The common forest history on the original schedule, evaluated on a current decorated big event. Outgoing small marks do not affect this gain. -/ open scoped Classical namespace Bounty section History variable {S I V K : Type} {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) noncomputable def physicalDecoratedCommonLocalLabel (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalMixedDecoratedBigEvent n shared B A Δ D tag x) : FullMixedCommonLocalAddress M B (physicalMixedBigTagErase tag) → Option (Sigma P) := fun a => fullMixedCommonEventBirthLabel n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) tag x e (physicalMixedTagBirthAddressEquiv M B tag a) noncomputable def physicalDecoratedCommonHistoryWrite (steps : List (Option (V ⊕ K))) (t : ℕ) (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalMixedDecoratedBigEvent n shared B A Δ D tag x) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P) := if ht : t < steps.length then if htag : physicalMixedBigTagErase tag = steps.get ⟨t, ht⟩ then fullMixedShapeHistoryWrite M (fullMixedCommonShape M B steps) ⟨t, ht⟩ (fun a => physicalDecoratedCommonLocalLabel n shared B A Δ D tag x e (cast (congrArg (FullMixedCommonLocalAddress M B) htag.symm) a)) history else history else history noncomputable def physicalDecoratedCommonHistoryGain (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (t : ℕ) (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalMixedDecoratedBigEvent n shared B A Δ D tag x) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : ℝ := if ht : t < steps.length then if physicalMixedBigTagErase tag = steps.get ⟨t, ht⟩ then if birthForestStageCondition (fullMixedCommonIndexStage M B steps) (Fin.succ ⟨t, ht⟩) (physicalDecoratedCommonHistoryWrite n shared B A Δ D steps t tag x e history) code then 1 else 0 else 0 else 0 theorem physical_decorated_common_history_write_owner (steps : List (Option (V ⊕ K))) (u : Fin steps.length) (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (htag : physicalMixedBigTagErase tag = steps.get u) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalMixedDecoratedBigEvent n shared B A Δ D tag x) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : physicalDecoratedCommonHistoryWrite n shared B A Δ D steps u.val tag x e history = fullMixedShapeHistoryWrite M (fullMixedCommonShape M B steps) u (fun a => physicalDecoratedCommonLocalLabel n shared B A Δ D tag x e (cast (congrArg (FullMixedCommonLocalAddress M B) htag.symm) a)) history := by unfold physicalDecoratedCommonHistoryWrite rw [dif_pos u.isLt] exact dif_pos htag theorem physical_decorated_common_history_gain_owner (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (u : Fin steps.length) (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (htag : physicalMixedBigTagErase tag = steps.get u) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalMixedDecoratedBigEvent n shared B A Δ D tag x) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : physicalDecoratedCommonHistoryGain n shared B A Δ D steps code u.val tag x e history = fullMixedShapeHistoryGain M (fullMixedCommonShape M B steps) code u (fun a => physicalDecoratedCommonLocalLabel n shared B A Δ D tag x e (cast (congrArg (FullMixedCommonLocalAddress M B) htag.symm) a)) history := by unfold physicalDecoratedCommonHistoryGain rw [dif_pos u.isLt, if_pos htag, physical_decorated_common_history_write_owner n shared B A Δ D steps u tag htag, full_mixed_index_stage_shape] rfl theorem physical_decorated_common_history_gain_nonneg (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (t : ℕ) (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalMixedDecoratedBigEvent n shared B A Δ D tag x) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : 0 ≤ physicalDecoratedCommonHistoryGain n shared B A Δ D steps code t tag x e history := by unfold physicalDecoratedCommonHistoryGain split_ifs <;> norm_num end History end Bounty end -- Source module: FullMixedShapeHistorySeed section /- Initial common birth histories depend only on the common capacity shape. -/ namespace Bounty section Seed variable {N : ℕ} {P : Fin N → Type*} {M : Fin N → ℕ} (n : ∀ g, P g → ℕ) (B : ℕ) noncomputable def fullMixedShapeHistorySeed (shape : FullMixedCommonShapeData N) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonShapeAddress M shape)) → Option (Sigma P)) (i : Fin (Fintype.card (FullMixedCommonShapeAddress M shape))) : Option (Sigma P) := match fullMixedCommonShapeOrder M shape i with | .inl a => some (fullMixedCommonInitialPrime x a) | .inr _ => history i theorem full_mixed_shape_history_seed_heq {shape shape' : FullMixedCommonShapeData N} (h : shape = shape') (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) {history : Fin (Fintype.card (FullMixedCommonShapeAddress M shape)) → Option (Sigma P)} {history' : Fin (Fintype.card (FullMixedCommonShapeAddress M shape')) → Option (Sigma P)} (hh : HEq history history') : HEq (fullMixedShapeHistorySeed n B shape x history) (fullMixedShapeHistorySeed n B shape' x history') := by cases h cases eq_of_heq hh rfl theorem full_mixed_common_history_seed_shape {I K : Type*} (steps : List (Option (I ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : fullMixedCommonHistorySeed n B steps x history = fullMixedShapeHistorySeed n B (fullMixedCommonShape M B steps) x history := by funext i unfold fullMixedCommonHistorySeed fullMixedShapeHistorySeed rw [full_mixed_common_order_shape] cases fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps) i <;> rfl end Seed end Bounty end -- Source module: PhysicalPlanHistoryTransport section /- Equal common shapes identify the fixed-plan history with the original schedule history, including the actual optional prime labels. -/ namespace Bounty section Transport variable {S I V K : Type} {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) noncomputable def physicalDecoratedPlanHistoryUpdate (tags : List (Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)))) := fullMixedCommonStepHistoryUpdate n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) tags noncomputable def physicalDecoratedPlanHistoryGain (tags : List (Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B tags))) := fullMixedCommonForestHistoryGain n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) tags code variable (tags : List (Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)))) (steps : List (Option (V ⊕ K))) (hshape : fullMixedCommonShape M B tags = fullMixedCommonShape M B steps) (u : Fin tags.length) (v : Fin steps.length) (huv : HEq u v) (htag : physicalMixedBigTagErase (tags.get u) = steps.get v) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (e : PhysicalMixedDecoratedBigEvent n shared B A Δ D (tags.get u) x) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B tags)) → Option (Sigma P)) (history' : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (hh : HEq history history') include hshape huv htag hh in theorem physical_plan_history_update_heq : HEq (physicalDecoratedPlanHistoryUpdate n shared B A Δ D tags u.val (tags.get u) x e history) (physicalDecoratedCommonHistoryWrite n shared B A Δ D steps v.val (tags.get u) x e history') := by unfold physicalDecoratedPlanHistoryUpdate rw [full_mixed_common_step_history_update_owner, full_mixed_common_history_write_shape, physical_decorated_common_history_write_owner n shared B A Δ D steps v (tags.get u) htag] apply full_mixed_shape_history_write_heq M hshape huv _ hh exact (physical_mixed_erased_birth_label_heq M B (tags.get u) _).trans (birth_label_precomp_cast_heq _ (physicalDecoratedCommonLocalLabel n shared B A Δ D (tags.get u) x e)).symm include hshape huv htag hh in theorem physical_plan_history_gain_eq (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B tags))) (code' : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (hc : HEq code code') : physicalDecoratedPlanHistoryGain n shared B A Δ D tags code u.val (tags.get u) x e history = physicalDecoratedCommonHistoryGain n shared B A Δ D steps code' v.val (tags.get u) x e history' := by unfold physicalDecoratedPlanHistoryGain rw [full_mixed_common_history_gain_shape, physical_decorated_common_history_gain_owner n shared B A Δ D steps code' v (tags.get u) htag] apply full_mixed_shape_history_gain_eq M hshape hc huv _ hh exact (physical_mixed_erased_birth_label_heq M B (tags.get u) _).trans (birth_label_precomp_cast_heq _ (physicalDecoratedCommonLocalLabel n shared B A Δ D (tags.get u) x e)).symm end Transport end Bounty end -- Source module: FullMixedShapeSelectedCount section /- Selected child counts, like the history itself, depend only on the common birth shape and the transported forest code. -/ open scoped Classical namespace Bounty section Count variable {N : ℕ} (M : Fin N → ℕ) def fullMixedShapeBirthGroup (shape : FullMixedCommonShapeData N) : FullMixedCommonShapeAddress M shape → Fin N | .inl a => a.1 | .inr a => a.2.1 noncomputable def fullMixedShapeSelectedCount (shape : FullMixedCommonShapeData N) (code : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M shape))) (u : Fin shape.1) (g : Fin N) : ℕ := (Finset.univ.filter (fun i => fullMixedShapeIndexStage M shape i = u.succ ∧ fullMixedShapeBirthGroup M shape (fullMixedCommonShapeOrder M shape i) = g ∧ code i ≠ none)).card theorem full_mixed_shape_selected_count_heq {shape shape' : FullMixedCommonShapeData N} (h : shape = shape') {code : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M shape))} {code' : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M shape'))} (hc : HEq code code') {u : Fin shape.1} {v : Fin shape'.1} (huv : HEq u v) (g : Fin N) : fullMixedShapeSelectedCount M shape code u g = fullMixedShapeSelectedCount M shape' code' v g := by cases h cases eq_of_heq hc cases eq_of_heq huv rfl theorem full_mixed_common_selected_count_shape {I K : Type*} (B : ℕ) (steps : List (Option (I ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (u : Fin steps.length) (g : Fin N) : fullMixedCommonSelectedCount M B steps code u g = fullMixedShapeSelectedCount M (fullMixedCommonShape M B steps) code u g := by unfold fullMixedCommonSelectedCount fullMixedShapeSelectedCount congr 2 funext i rw [full_mixed_index_stage_shape, full_mixed_common_order_shape] cases fullMixedCommonShapeOrder M (fullMixedCommonShape M B steps) i <;> rfl end Count end Bounty end -- Source module: PhysicalDecoratedSelectedRow section /- The uniform big-event row bound on the original common history. The current pattern and small prefix remain parameters of the actual kernel. -/ open Finset open scoped Classical namespace Bounty section Row variable {S I V K : Type} {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (q : V → ℝ) (ρ v vmin : ℝ) (Vb η : Fin N → ℝ) (β : ℝ) noncomputable abbrev physicalDecoratedBigEventFintype := fullPermutationMixedEventFintype (J := V) n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) noncomputable def physicalDecoratedBigWeight := fullPermutationMixedEventWeight (J := V) n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => ω key.2.1 c a) μ q ρ Vb omit [∀ g, DecidableEq (P g)] in theorem physical_decorated_length_row_factor (T : ℕ) (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) : fullMixedLengthRowFactor μ q ρ v vmin Vb T tag = fullMixedLengthRowFactor μ q ρ v vmin Vb T (physicalMixedBigTagErase tag) := by cases tag with | none => rfl | some tag => cases tag <;> rfl theorem physical_decorated_common_owner_row_le (hω : ∀ i c a, 0 ≤ ω i c a) (hωmass : ∀ i c, ∑ a, ω i c a ≤ 1) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (hη : ∀ g, 0 ≤ η g) (hμatom : ∀ g p, μ g p ≤ η g) (hghostAtom : ∀ j g, (|(1 - q j) * Vb g / ρ| * η g) * v ≤ β) (hedgeAtom : ∀ g, η g ≤ β) (hq0 : ∀ j, 0 ≤ q j) (hq1 : ∀ j, q j ≤ 1) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : ∀ g, vmin ≤ Vb g) (hD : ∀ j, q j / ρ ^ 2 + ((1 - q j) / ρ) / v ≤ 1) (T : ℕ) (ht : ∀ i g, (shared i g)ᶜ.card ≤ T) (tags : List (Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)))) (steps : List (Option (V ⊕ K))) (hshape : fullMixedCommonShape M B tags = fullMixedCommonShape M B steps) (u : Fin tags.length) (u' : Fin steps.length) (huu' : HEq u u') (htag : physicalMixedBigTagErase (tags.get u) = steps.get u') (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B tags))) (code' : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (hc : HEq code code') (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B tags)) → Option (Sigma P)) (history' : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (hh : HEq history history') : let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D (∑ e : PhysicalMixedDecoratedBigEvent n shared B A Δ D (tags.get u) x, |physicalDecoratedBigWeight n shared B A Δ D ω μ q ρ Vb (tags.get u) x e| * physicalDecoratedCommonHistoryGain n shared B A Δ D steps code' u'.val (tags.get u) x e history' * productLengthLyapunov v (physicalMixedDecoratedBigTarget n shared B A Δ D (tags.get u) x e)) ≤ (β ^ (∑ g, fullMixedCommonSelectedCount M B steps code' u' g) * fullMixedLengthRowFactor μ q ρ v vmin Vb T (steps.get u')) * productLengthLyapunov v x := by let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D have hb := full_mixed_common_owner_stage_row_le n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => ω key.2.1 c a) μ q ρ v vmin Vb η β tags code (fun key => hω key.2.1) (fun key => hωmass key.2.1) hμ hmass hη hμatom hghostAtom hedgeAtom hq0 hq1 hρ0 hρ1 hv hvmin hV hD T (fun key => ht key.2.1) u (tags.get u) rfl x history have hg : ∀ e, physicalDecoratedPlanHistoryGain n shared B A Δ D tags code u.val (tags.get u) x e history = physicalDecoratedCommonHistoryGain n shared B A Δ D steps code' u'.val (tags.get u) x e history' := fun e => physical_plan_history_gain_eq n shared B A Δ D tags steps hshape u u' huu' htag x e history history' hh code code' hc have hcount : ∀ g, fullMixedCommonSelectedCount M B tags code u g = fullMixedCommonSelectedCount M B steps code' u' g := by intro g rw [full_mixed_common_selected_count_shape, full_mixed_common_selected_count_shape] exact full_mixed_shape_selected_count_heq M hshape hc huu' g change (∑ e, |physicalDecoratedBigWeight n shared B A Δ D ω μ q ρ Vb (tags.get u) x e| * physicalDecoratedPlanHistoryGain n shared B A Δ D tags code u.val (tags.get u) x e history * productLengthLyapunov v (physicalMixedDecoratedBigTarget n shared B A Δ D (tags.get u) x e)) ≤ _ at hb simp_rw [hg] at hb simpa only [hcount, physical_decorated_length_row_factor μ q ρ v vmin Vb, htag] using hb end Row end Bounty end -- Source module: FiniteRowReindex section /- Elementary finite-row reindexing, independent of event implementation types. -/ open Finset namespace Bounty theorem finite_sum_sigma_any {A : Type*} {E : A → Type*} [Fintype A] [∀ a, Fintype (E a)] (inst : Fintype (Sigma E)) (f : Sigma E → ℝ) : @Finset.sum (Sigma E) ℝ _ (@Finset.univ _ inst) f = ∑ a, ∑ e : E a, f ⟨a,e⟩ := by have hi : inst = (Sigma.instFintype : Fintype (Sigma E)) := Subsingleton.elim _ _ rw [hi] exact Fintype.sum_sigma f theorem finite_sum_ulift_any {A : Type*} [Fintype A] (inst : Fintype (ULift A)) (f : ULift A → ℝ) : (∑ a : A, f (ULift.up a)) = @Finset.sum (ULift A) ℝ _ (@Finset.univ _ inst) f := by let _ := inst exact (Equiv.ulift.symm.sum_comp f) theorem finite_abs_aux_unit_row {A : Type*} {E : A → Type*} [Fintype A] [∀ a, Fintype (E a)] (inst : Fintype (Sigma E)) (w : A → ℝ) (v : ∀ a, E a → ℝ) (f : Sigma E → ℝ) : @Finset.sum (Sigma E) ℝ _ (@Finset.univ _ inst) (fun e => |w e.1 * v e.1 e.2| * f e) = ∑ a : A, |w a| * ∑ e : (Σ _u : Unit, E a), |1 * v a e.2| * f ⟨a,e.2⟩ := by rw [finite_sum_sigma_any] simp only [Fintype.sum_sigma, Fintype.sum_unique, one_mul, abs_mul, mul_sum, mul_assoc] end Bounty end -- Source module: PhysicalDecoratedEdgeReindex section /- Removing the auxiliary singleton from the literal big edge preserves any selector on the retained decorated big event. -/ open Finset open scoped Classical namespace Bounty section Reindex variable {S I V K : Type} {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (q : V → ℝ) (ρ : ℝ) (Vb : Fin N → ℝ) theorem physical_decorated_edge_row_reindex (k : K) (i : I) (L : PhysicalMarkLists Ps J ell) (r : PhysicalResidues Ps) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (selector : PhysicalMixedDecoratedBigEvent (V := V) n shared B A Δ D (some (.inr (k, i, L, L))) x → ℝ) : let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D (∑ e : PhysicalMixedDecoratedBigEvent (V := V) n shared B A Δ D (some (.inr (k, i, L, L))) x, |physicalDecoratedBigWeight n shared B A Δ D ω μ q ρ Vb (some (.inr (k, i, L, L))) x e| * selector e) = ∑ a : A i, |ω i (productActiveMemorySplit (shared i) B x).1 a| * ∑ e : PhysicalSmallBigFullEvent n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a) (physicalSharedPrefix L) x, |physicalSmallBigFullWeight n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a) μ ρ Vb r (physicalSharedPrefix L) x e| * selector ⟨a, e.2⟩ := by let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D exact finite_abs_aux_unit_row _ (fun a => ω i (productActiveMemorySplit (shared i) B x).1 a) (fun a e => unrestrictedJointCutoffEventWeight n (Δ k i (physicalSharedPrefix L) (productActiveMemorySplit (shared i) B x).1 a) (D k i (physicalSharedPrefix L) (productActiveMemorySplit (shared i) B x).1 a) μ ρ Vb (fun g => (shared i g)ᶜ.card) B (productActiveMemorySplit (shared i) B x).2 e) selector end Reindex end Bounty end -- Source module: PhysicalMixedHistoryGain section /- The original mixed history is evaluated on the actual retained big event. -/ namespace Bounty section Gain variable {S I V K : Type} {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) noncomputable def physicalMixedCommonHistoryGain (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (t : ℕ) (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEvent n shared B A Δ D tag s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : ℝ := physicalMixedBigEventPullback n shared B A Δ D (fun tag history x e => physicalDecoratedCommonHistoryGain n shared B A Δ D steps code t tag x e history) tag history s e theorem physical_mixed_common_history_gain_nonneg (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (t : ℕ) (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEvent n shared B A Δ D tag s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : 0 ≤ physicalMixedCommonHistoryGain n shared B A Δ D steps code t tag s e history := physical_decorated_common_history_gain_nonneg n shared B A Δ D steps code t _ _ _ _ theorem physical_mixed_common_history_gain_edge (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (t : ℕ) (k : K) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEdge n shared B A Δ D k s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : physicalMixedCommonHistoryGain n shared B A Δ D steps code t (some (.inr k)) s e history = physicalDecoratedCommonHistoryGain n shared B A Δ D steps code t (some (.inr (k, e.1, s.1.2, s.1.2))) s.2 ⟨e.2.1, e.2.2.2.2⟩ history := by rfl end Gain end Bounty end -- Source module: PhysicalMixedSelectedHistoryEdge section /- The complete small ledger can be summed in a chronological selected edge row, retaining the actual forest history and all big events. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_mixed_history_edge_bound {qmax vs : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ C : ℝ, 1 ≤ C ∧ ∀ (S I V K : Type) (N : ℕ) [Fintype S] [Fintype I] (Ps : S → Finset ℕ) (P : Fin N → Type) [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : Fin N → ℕ) (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : Fin N → ℝ) (Vs : S → ℝ) (qedge : K → ℝ), (∀ s, vs ≤ Vs s) → ∀ (k : K), Real.sqrt (qedge k) ≤ qmax → ∀ (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (t : ℕ) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (v : ℝ), 0 ≤ v → ∀ bound : ℝ, (let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D ∀ i : I, (∑ e : PhysicalMixedDecoratedBigEvent (V := V) n shared B A Δ D (some (.inr (k, i, s.1.2, s.1.2))) s.2, |physicalDecoratedBigWeight n shared B A Δ D ω μ qghost ρ Vb (some (.inr (k, i, s.1.2, s.1.2))) s.2 e| * physicalDecoratedCommonHistoryGain n shared B A Δ D steps code t (some (.inr (k, i, s.1.2, s.1.2))) s.2 e history * productLengthLyapunov v (physicalMixedDecoratedBigTarget (V := V) n shared B A Δ D (some (.inr (k, i, s.1.2, s.1.2))) s.2 e)) ≤ bound) → (∑ e : PhysicalMixedWordEdge n shared B A Δ D k s, |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge (some (.inr k)) s e| * physicalMixedCommonHistoryGain n shared B A Δ D steps code t (some (.inr k)) s e history * productLengthLyapunov v (physicalMixedWordTarget (V := V) n shared B A Δ D kbig (some (.inr k)) s e).2) ≤ C ^ Fintype.card S * ((Fintype.card I : ℝ) * bound) := by obtain ⟨C, hC, hrow⟩ := exists_physical_mixed_selected_edge_row_bound hqmax0 hqmax1 hvs ell refine ⟨C, hC, ?_⟩ intro S I V K N _ _ Ps P _ n _ J M shared B A _ Δ D kbig ω μ qghost ρ Vb Vs qedge hVs k hq s steps code t history v hv bound hbig let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D let selector := fun (i : I) (a : A i) (e : PhysicalSmallBigFullEvent n (shared i) B (fun d c => Δ k i d c a) (fun d c => D k i d c a) (physicalSharedPrefix s.1.2) s.2) => physicalDecoratedCommonHistoryGain n shared B A Δ D steps code t (some (.inr (k, i, s.1.2, s.1.2))) s.2 ⟨a, e.2⟩ history * productLengthLyapunov v (physicalMixedDecoratedBigTarget (V := V) n shared B A Δ D (some (.inr (k, i, s.1.2, s.1.2))) s.2 ⟨a, e.2⟩) have hsel : ∀ i a e, 0 ≤ selector i a e := by intro i a e exact mul_nonneg (physical_decorated_common_history_gain_nonneg n shared B A Δ D steps code t _ _ _ _) (productLengthLyapunov_nonneg hv _) have hs := hrow S (Fin N) I V K Ps P n J M shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge hVs k hq s selector hsel have hleft : (∑ e : PhysicalMixedWordEdge n shared B A Δ D k s, |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge (some (.inr k)) s e| * physicalMixedCommonHistoryGain n shared B A Δ D steps code t (some (.inr k)) s e history * productLengthLyapunov v (physicalMixedWordTarget (V := V) n shared B A Δ D kbig (some (.inr k)) s e).2) = ∑ e : PhysicalMixedWordEdge n shared B A Δ D k s, |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge (some (.inr k)) s e| * selector e.1 e.2.1 e.2.2.2 := by apply sum_congr rfl intro e _ rw [physical_mixed_common_history_gain_edge] exact mul_assoc _ _ _ rw [hleft] refine hs.trans (mul_le_mul_of_nonneg_left ?_ (pow_nonneg (le_trans (by norm_num) hC) _)) calc _ = ∑ i : I, ∑ e : PhysicalMixedDecoratedBigEvent (V := V) n shared B A Δ D (some (.inr (k, i, s.1.2, s.1.2))) s.2, |physicalDecoratedBigWeight n shared B A Δ D ω μ qghost ρ Vb (some (.inr (k, i, s.1.2, s.1.2))) s.2 e| * physicalDecoratedCommonHistoryGain n shared B A Δ D steps code t (some (.inr (k, i, s.1.2, s.1.2))) s.2 e history * productLengthLyapunov v (physicalMixedDecoratedBigTarget (V := V) n shared B A Δ D (some (.inr (k, i, s.1.2, s.1.2))) s.2 e) := by apply sum_congr rfl intro i _ symm simp_rw [mul_assoc] exact physical_decorated_edge_row_reindex n shared B A Δ D ω μ qghost ρ Vb k i s.1.2 s.1.1 s.2 _ _ ≤ ∑ _i : I, bound := sum_le_sum (fun i _ => hbig i) _ = _ := by simp end Bounty end -- Source module: FullMixedShapeMap section /- Relabeling ghost and edge keys preserves the chronological common birth shape and its selected child counts. -/ namespace Bounty section Map variable {I K I' K' : Type*} {N : ℕ} (M : Fin N → ℕ) (B : ℕ) (f : I → I') (g : K → K') theorem full_mixed_common_shape_map (steps : List (Option (I ⊕ K))) : fullMixedCommonShape M B (steps.map (Option.map (Sum.map f g))) = fullMixedCommonShape M B steps := by induction steps with | nil => apply congrArg (Sigma.mk 0) funext u exact Fin.elim0 u | cons tag steps ih => simp only [List.map_cons, full_mixed_common_shape_cons, ih] cases tag with | none => rfl | some tag => cases tag <;> rfl end Map end Bounty end -- Source module: PhysicalHistoryTemplate section /- A fixed pattern and current small prefix provide a representative big schedule with exactly the original common birth shape. -/ namespace Bounty section Template variable {S I V K : Type} {Ps : S → Finset ℕ} {J ell N : ℕ} (M : Fin N → ℕ) (B : ℕ) (i : I) (L : PhysicalMarkLists Ps J ell) def physicalHistoryTemplateTag : Option (V ⊕ K) → Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)) := Option.map (Sum.map id (fun k => (k, i, L, L))) theorem physical_history_template_tag_erase (tag : Option (V ⊕ K)) : physicalMixedBigTagErase (physicalHistoryTemplateTag i L tag) = tag := by cases tag with | none => rfl | some tag => cases tag <;> rfl def physicalHistoryTemplateSteps (steps : List (Option (V ⊕ K))) := steps.map (physicalHistoryTemplateTag i L) theorem physical_history_template_shape (steps : List (Option (V ⊕ K))) : fullMixedCommonShape M B (physicalHistoryTemplateSteps i L steps) = fullMixedCommonShape M B steps := full_mixed_common_shape_map M B id (fun k => (k, i, L, L)) steps theorem physical_history_template_length (steps : List (Option (V ⊕ K))) : (physicalHistoryTemplateSteps i L steps).length = steps.length := List.length_map _ theorem physical_history_template_position (steps : List (Option (V ⊕ K))) (u : Fin steps.length) : (physicalHistoryTemplateSteps i L steps).get (Fin.cast (physical_history_template_length i L steps).symm u) = physicalHistoryTemplateTag i L (steps.get u) := by simp only [physicalHistoryTemplateSteps, List.get_eq_getElem, List.getElem_map] rfl end Template end Bounty end -- Source module: PhysicalHistoryTemplateRow section /- A current pattern and small prefix can be inserted into the uniform big row without changing the original history, code or selected-child count. -/ open Finset open scoped Classical namespace Bounty section TemplateRow variable {S I V K : Type} {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (q : V → ℝ) (ρ v vmin : ℝ) (Vb η : Fin N → ℝ) (β : ℝ) theorem physical_history_template_owner_row_le (hω : ∀ i c a, 0 ≤ ω i c a) (hωmass : ∀ i c, ∑ a, ω i c a ≤ 1) (hμ : ∀ g p, 0 ≤ μ g p) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (hη : ∀ g, 0 ≤ η g) (hμatom : ∀ g p, μ g p ≤ η g) (hghostAtom : ∀ j g, (|(1 - q j) * Vb g / ρ| * η g) * v ≤ β) (hedgeAtom : ∀ g, η g ≤ β) (hq0 : ∀ j, 0 ≤ q j) (hq1 : ∀ j, q j ≤ 1) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 1 < v) (hvmin : 0 < vmin) (hV : ∀ g, vmin ≤ Vb g) (hD : ∀ j, q j / ρ ^ 2 + ((1 - q j) / ρ) / v ≤ 1) (T : ℕ) (ht : ∀ i g, (shared i g)ᶜ.card ≤ T) (i : I) (L : PhysicalMarkLists Ps J ell) (steps : List (Option (V ⊕ K))) (u : Fin steps.length) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D (∑ e : PhysicalMixedDecoratedBigEvent n shared B A Δ D (physicalHistoryTemplateTag i L (steps.get u)) x, |physicalDecoratedBigWeight n shared B A Δ D ω μ q ρ Vb (physicalHistoryTemplateTag i L (steps.get u)) x e| * physicalDecoratedCommonHistoryGain n shared B A Δ D steps code u.val (physicalHistoryTemplateTag i L (steps.get u)) x e history * productLengthLyapunov v (physicalMixedDecoratedBigTarget n shared B A Δ D (physicalHistoryTemplateTag i L (steps.get u)) x e)) ≤ (β ^ (∑ g, fullMixedCommonSelectedCount M B steps code u g) * fullMixedLengthRowFactor μ q ρ v vmin Vb T (steps.get u)) * productLengthLyapunov v x := by let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D let tags := physicalHistoryTemplateSteps i L steps have hs := physical_history_template_shape M B i L steps have hlen := physical_history_template_length i L steps let uold := Fin.cast hlen.symm u have hu : HEq uold u := (Fin.heq_ext_iff hlen).2 rfl have htag : physicalMixedBigTagErase (tags.get uold) = steps.get u := by rw [physical_history_template_position, physical_history_template_tag_erase] let oldcode := cast (congrArg (fun s => BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M s))) hs.symm) code let oldhistory := cast (congrArg (fun s => Fin (Fintype.card (FullMixedCommonShapeAddress M s)) → Option (Sigma P)) hs.symm) history have hc : HEq oldcode code := cast_heq _ _ have hh : HEq oldhistory history := cast_heq _ _ have hb := physical_decorated_common_owner_row_le n shared B A Δ D ω μ q ρ v vmin Vb η β hω hωmass hμ hmass hη hμatom hghostAtom hedgeAtom hq0 hq1 hρ0 hρ1 hv hvmin hV hD T ht tags steps hs uold u hu htag oldcode code hc x oldhistory history hh let row (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) : ℝ := ∑ e : PhysicalMixedDecoratedBigEvent n shared B A Δ D tag x, |physicalDecoratedBigWeight n shared B A Δ D ω μ q ρ Vb tag x e| * physicalDecoratedCommonHistoryGain n shared B A Δ D steps code u.val tag x e history * productLengthLyapunov v (physicalMixedDecoratedBigTarget n shared B A Δ D tag x e) change row (tags.get uold) ≤ _ at hb change row (physicalHistoryTemplateTag i L (steps.get u)) ≤ _ have htag' : tags.get uold = physicalHistoryTemplateTag i L (steps.get u) := physical_history_template_position i L steps u rwa [htag'] at hb end TemplateRow end Bounty end -- Source module: PhysicalMixedNonedgeRows section /- Permutation and ghost events leave no additional small completion sum. Their literal selected rows equal the corresponding big-event row. -/ open Finset open scoped Classical namespace Bounty section Nonedge variable {S I V K : Type} [Fintype S] {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (q : V → ℝ) (ρ : ℝ) (Vb : Fin N → ℝ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (Vs : S → ℝ) (qedge : K → ℝ) theorem physical_mixed_ghost_selected_row_eq (j : V) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (selector : PhysicalMixedDecoratedBigEvent (Ps := Ps) (J := J) (ell := ell) n shared B A Δ D (some (.inl j)) s.2 → ℝ) : let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D (∑ e : CoupledGhostEvent M B s.2, |physicalMixedWordWeight n shared B A Δ D kbig ω μ q ρ Vb Vs qedge (some (.inl j)) s e| * selector (ULift.up e)) = ∑ e : PhysicalMixedDecoratedBigEvent (Ps := Ps) (J := J) (ell := ell) n shared B A Δ D (some (.inl j)) s.2, |physicalDecoratedBigWeight n shared B A Δ D ω μ q ρ Vb (some (.inl j)) s.2 e| * selector e := by let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D simp only [physicalMixedWordWeight, physicalDecoratedBigWeight, fullPermutationMixedEventWeight, fullMixedMemoryEventWeight] exact finite_sum_ulift_any (A := CoupledGhostEvent M B s.2) _ (fun e => |coupledGhostJointEventWeight (fun g => physicalGhostRetention (n g) (q j) ρ) (fun g => physicalGhostTermination (n g) (q j) ρ) (fun g => physicalGhostBirth (n g) (q j) ρ (Vb g)) (fun g => unrestrictedResidueWeight (μ g)) M B s.2 e.down| * selector e) theorem physical_mixed_permutation_selected_row_eq (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (selector : PhysicalMixedDecoratedBigEvent (V := V) (Ps := Ps) (J := J) (ell := ell) n shared B A Δ D none s.2 → ℝ) : let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D (∑ e : PhysicalPermutations S J ell × FullActiveSlotPermutations M, |physicalMixedWordWeight n shared B A Δ D kbig ω μ q ρ Vb Vs qedge none s e| * selector (ULift.up e.2)) = ∑ e : PhysicalMixedDecoratedBigEvent (V := V) (Ps := Ps) (J := J) (ell := ell) n shared B A Δ D none s.2, |physicalDecoratedBigWeight n shared B A Δ D ω μ q ρ Vb none s.2 e| * selector e := by let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D have hc : (Fintype.card (PhysicalPermutations S J ell) : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero simp only [physicalMixedWordWeight, physicalDecoratedBigWeight, fullPermutationMixedEventWeight, Fintype.sum_prod_type, abs_mul, abs_inv, Nat.abs_cast, mul_assoc, ← mul_sum, sum_const, nsmul_eq_mul, card_univ] rw [← mul_assoc, inv_mul_cancel₀ hc, one_mul] exact finite_sum_ulift_any (A := FullActiveSlotPermutations M) _ (fun e => |fullActivePermutationWeight M e.down| * selector e) end Nonedge end Bounty end -- Source module: PhysicalMixedForestRowFactor section /- The small-ledger row cost is paid once per original edge. Forest rank still supplies one full rarity factor per selected child. -/ open Finset open scoped Classical namespace Bounty def physicalMixedSmallRowFactor {V K : Type*} (C : ℝ) (smallGroups patterns : ℕ) : Option (V ⊕ K) → ℝ | none => 1 | some (.inl _) => 1 | some (.inr _) => C ^ smallGroups * patterns theorem physical_mixed_small_row_factor_nonneg {V K : Type*} {C : ℝ} (hC : 0 ≤ C) (smallGroups patterns : ℕ) (tag : Option (V ⊕ K)) : 0 ≤ physicalMixedSmallRowFactor C smallGroups patterns tag := by cases tag with | none => exact zero_le_one | some tag => cases tag with | inl _ => exact zero_le_one | inr _ => exact mul_nonneg (pow_nonneg hC _) (Nat.cast_nonneg _) section Product variable {V K : Type*} {N : ℕ} {P : Fin N → Type*} [∀ g, Fintype (P g)] (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (μ : ∀ g, P g → ℝ) (q : V → ℝ) (ρ v vmin : ℝ) (Vb : Fin N → ℝ) (T : ℕ) (β C : ℝ) (smallGroups patterns : ℕ) noncomputable def physicalMixedCommonForestRowFactor (t : ℕ) (tag : Option (V ⊕ K)) : ℝ := physicalMixedSmallRowFactor C smallGroups patterns tag * fullMixedCommonForestRowFactor M B steps code μ q ρ v vmin Vb T β t tag theorem physical_mixed_common_forest_row_factor_nonneg (hβ : 0 ≤ β) (hC : 0 ≤ C) (hρ : ρ < 1) (hv : 0 ≤ v) (t : ℕ) (tag : Option (V ⊕ K)) : 0 ≤ physicalMixedCommonForestRowFactor M B steps code μ q ρ v vmin Vb T β C smallGroups patterns t tag := mul_nonneg (physical_mixed_small_row_factor_nonneg hC _ _ _) (full_mixed_common_forest_row_factor_nonneg M B steps code μ q ρ v vmin Vb T β hβ hρ hv t tag) theorem physical_mixed_common_forest_row_factor_product (hcode : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) : finiteEventIndexedProduct (physicalMixedCommonForestRowFactor M B steps code μ q ρ v vmin Vb T β C smallGroups patterns) 0 steps = β ^ birthForestRank code * (steps.map (physicalMixedSmallRowFactor C smallGroups patterns)).prod * (steps.map (fullMixedLengthRowFactor μ q ρ v vmin Vb T)).prod := by rw [finite_event_indexed_product_eq_prod] simp only [Nat.zero_add, physicalMixedCommonForestRowFactor, fullMixedCommonForestRowFactor, prod_mul_distrib, prod_pow_eq_pow_sum, full_mixed_common_selected_at_sum M B steps code hcode] rw [← List.prod_ofFn, ← List.prod_ofFn] have hs : (List.ofFn fun x => physicalMixedSmallRowFactor C smallGroups patterns (steps.get x)) = steps.map (physicalMixedSmallRowFactor C smallGroups patterns) := by apply List.ext_get · simp · intro n hn hm simp have hb : (List.ofFn fun x => fullMixedLengthRowFactor μ q ρ v vmin Vb T (steps.get x)) = steps.map (fullMixedLengthRowFactor μ q ρ v vmin Vb T) := by apply List.ext_get · simp · intro n hn hm simp rw [hs, hb] ring end Product end Bounty end -- Source module: PhysicalMixedOwnerRows section /- Uniform chronological rows for the literal original mixed word. The small completion cost is independent of J and the history retains all births. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_mixed_owner_row_bound {qmax vs : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ C : ℝ, 1 ≤ C ∧ ∀ (S I V K : Type) (N : ℕ) [Fintype S] [Fintype I] (Ps : S → Finset ℕ) (P : Fin N → Type) [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : Fin N → ℕ) (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : Fin N → ℝ) (Vs : S → ℝ) (qedge : K → ℝ), (∀ s, vs ≤ Vs s) → (∀ k, Real.sqrt (qedge k) ≤ qmax) → ∀ (_i0 : I) (v vmin : ℝ) (η : Fin N → ℝ) (β : ℝ) (T : ℕ), (∀ i c a, 0 ≤ ω i c a) → (∀ i c, ∑ a, ω i c a ≤ 1) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → (∀ g, 0 ≤ η g) → (∀ g p, μ g p ≤ η g) → (∀ j g, (|(1 - qghost j) * Vb g / ρ| * η g) * v ≤ β) → (∀ g, η g ≤ β) → (∀ j, 0 ≤ qghost j) → (∀ j, qghost j ≤ 1) → 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ Vb g) → (∀ j, qghost j / ρ ^ 2 + ((1 - qghost j) / ρ) / v ≤ 1) → (∀ i g, (shared i g)ᶜ.card ≤ T) → ∀ (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (u : Fin steps.length) (tag : Option (V ⊕ K)), steps.get u = tag → ∀ (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)), let _ := physicalMixedWordEventFintype (V := V) (ell := ell) n shared B A Δ D (∑ e : PhysicalMixedWordEvent n shared B A Δ D tag s, |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge tag s e| * physicalMixedCommonHistoryGain n shared B A Δ D steps code u.val tag s e history * productLengthLyapunov v (physicalMixedWordTarget n shared B A Δ D kbig tag s e).2) ≤ physicalMixedCommonForestRowFactor M B steps code μ qghost ρ v vmin Vb T β C (Fintype.card S) (Fintype.card I) u.val tag * productLengthLyapunov v s.2 := by obtain ⟨C, hC, hmix⟩ := exists_physical_mixed_history_edge_bound hqmax0 hqmax1 hvs ell refine ⟨C, hC, ?_⟩ intro S I V K N _ _ Ps P _ _ n _ J M shared B A _ Δ D kbig ω μ qghost ρ Vb Vs qedge hVs hqedge i0 v vmin η β T hω hωmass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht steps code u tag htag s history let _ := physicalMixedWordEventFintype (V := V) (ell := ell) n shared B A Δ D let _ := physicalDecoratedBigEventFintype (V := V) (ell := ell) n shared B A Δ D let bigrow (tag : Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K))) : ℝ := ∑ e : PhysicalMixedDecoratedBigEvent n shared B A Δ D tag s.2, |physicalDecoratedBigWeight n shared B A Δ D ω μ qghost ρ Vb tag s.2 e| * physicalDecoratedCommonHistoryGain n shared B A Δ D steps code u.val tag s.2 e history * productLengthLyapunov v (physicalMixedDecoratedBigTarget n shared B A Δ D tag s.2 e) have hbig (i : I) : (∑ e : PhysicalMixedDecoratedBigEvent n shared B A Δ D (physicalHistoryTemplateTag i s.1.2 tag) s.2, |physicalDecoratedBigWeight n shared B A Δ D ω μ qghost ρ Vb (physicalHistoryTemplateTag i s.1.2 tag) s.2 e| * physicalDecoratedCommonHistoryGain n shared B A Δ D steps code u.val (physicalHistoryTemplateTag i s.1.2 tag) s.2 e history * productLengthLyapunov v (physicalMixedDecoratedBigTarget n shared B A Δ D (physicalHistoryTemplateTag i s.1.2 tag) s.2 e)) ≤ (β ^ (∑ g, fullMixedCommonSelectedCount M B steps code u g) * fullMixedLengthRowFactor μ qghost ρ v vmin Vb T tag) * productLengthLyapunov v s.2 := by subst tag exact physical_history_template_owner_row_le n shared B A Δ D ω μ qghost ρ v vmin Vb η β hω hωmass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD T ht i s.1.2 steps u code s.2 history cases tag with | none => have hb := hbig i0 change bigrow none ≤ _ at hb have heq := physical_mixed_permutation_selected_row_eq n shared B A Δ D ω μ qghost ρ Vb kbig Vs qedge s (fun e => physicalDecoratedCommonHistoryGain n shared B A Δ D steps code u.val none s.2 e history * productLengthLyapunov v (physicalMixedDecoratedBigTarget n shared B A Δ D none s.2 e)) simp only [← mul_assoc] at heq change _ = bigrow none at heq exact heq.le.trans (by simpa only [physicalMixedCommonForestRowFactor, physicalMixedSmallRowFactor, fullMixedCommonForestRowFactor, full_mixed_common_selected_at_owner, one_mul] using hb) | some tag => cases tag with | inl j => have hb := hbig i0 change bigrow (some (.inl j)) ≤ _ at hb have heq := physical_mixed_ghost_selected_row_eq n shared B A Δ D ω μ qghost ρ Vb kbig Vs qedge j s (fun e => physicalDecoratedCommonHistoryGain n shared B A Δ D steps code u.val (some (.inl j)) s.2 e history * productLengthLyapunov v (physicalMixedDecoratedBigTarget n shared B A Δ D (some (.inl j)) s.2 e)) simp only [← mul_assoc] at heq change _ = bigrow (some (.inl j)) at heq exact heq.le.trans (by simpa only [physicalMixedCommonForestRowFactor, physicalMixedSmallRowFactor, fullMixedCommonForestRowFactor, full_mixed_common_selected_at_owner, one_mul] using hb) | inr k => have hb := hmix S I V K N Ps P n J M shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge hVs k (hqedge k) s steps code u.val history v (zero_lt_one.trans hv).le ((β ^ (∑ g, fullMixedCommonSelectedCount M B steps code u g) * fullMixedLengthRowFactor μ qghost ρ v vmin Vb T (some (.inr k))) * productLengthLyapunov v s.2) (fun i => hbig i) refine hb.trans_eq ?_ simp only [physicalMixedCommonForestRowFactor, physicalMixedSmallRowFactor, fullMixedCommonForestRowFactor, full_mixed_common_selected_at_owner] ring end Bounty end -- Source module: PhysicalMixedHistorySchedule section /- The pulled-back common history vanishes away from the original clock. -/ namespace Bounty section Schedule variable {S I V K : Type} {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (t : ℕ) (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEvent n shared B A Δ D tag s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) theorem physical_mixed_common_history_gain_after (ht : ¬t < steps.length) : physicalMixedCommonHistoryGain n shared B A Δ D steps code t tag s e history = 0 := by unfold physicalMixedCommonHistoryGain physicalMixedBigEventPullback physicalDecoratedCommonHistoryGain dsimp only rw [dif_neg ht] theorem physical_mixed_common_history_gain_other (ht : t < steps.length) (htag : tag ≠ steps.get ⟨t, ht⟩) : physicalMixedCommonHistoryGain n shared B A Δ D steps code t tag s e history = 0 := by unfold physicalMixedCommonHistoryGain physicalMixedBigEventPullback physicalDecoratedCommonHistoryGain dsimp only rw [dif_pos ht, physical_mixed_big_event_tag_erase, if_neg htag] end Schedule end Bounty end -- Source module: PhysicalMixedHistoryIntegral section /- Chronological selected rows iterate on the original mixed paths, with all small factors retained and the full forest-rank rarity power. -/ open Finset open scoped Classical namespace Bounty section Integral variable {S I V K : Type} [Fintype S] [Fintype I] {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} [∀ g, Fintype (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : Fin N → ℝ) (Vs : S → ℝ) (qedge : K → ℝ) (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) noncomputable def physicalMixedCommonHistoryUpdate (t : ℕ) (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (e : PhysicalMixedWordEvent n shared B A Δ D tag s) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) := physicalMixedBigEventPullback n shared B A Δ D (fun tag history x e => physicalDecoratedCommonHistoryWrite n shared B A Δ D steps t tag x e history) tag history s e variable (v vmin β C : ℝ) (T : ℕ) noncomputable def physicalMixedHistoryRow (t : ℕ) (tag : Option (V ⊕ K)) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) : ℝ := let _ := physicalMixedWordEventFintype (V := V) (ell := ell) n shared B A Δ D ∑ e : PhysicalMixedWordEvent n shared B A Δ D tag s, |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge tag s e| * physicalMixedCommonHistoryGain n shared B A Δ D steps code t tag s e history * productLengthLyapunov v (physicalMixedWordTarget n shared B A Δ D kbig tag s e).2 theorem physical_mixed_history_integral_le_rank (hβ : 0 ≤ β) (hC : 0 ≤ C) (hρ : ρ < 1) (hv : 0 ≤ v) (hcode : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) (howner : ∀ (u : Fin steps.length) (tag : Option (V ⊕ K)), steps.get u = tag → ∀ s history, physicalMixedHistoryRow (ell := ell) n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge steps code v u.val tag s history ≤ physicalMixedCommonForestRowFactor M B steps code μ qghost ρ v vmin Vb T β C (Fintype.card S) (Fintype.card I) u.val tag * productLengthLyapunov v s.2) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (F : FiniteEventPath (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) steps s → ℝ) {L : ℝ} (hL : 0 ≤ L) (hF : ∀ p, F p ≤ L * productLengthLyapunov v (finiteEventPathTerminal (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) steps s p).2) : let _ := physicalMixedWordEventFintype (V := V) (ell := ell) n shared B A Δ D finiteEventPathIntegral (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (fun tag s e => |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge tag s e|) steps s (fun p => finiteEventHistoryFactor (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedCommonHistoryUpdate n shared B A Δ D steps) (physicalMixedCommonHistoryGain n shared B A Δ D steps code) 0 steps s p history * F p) ≤ β ^ birthForestRank code * (steps.map (physicalMixedSmallRowFactor C (Fintype.card S) (Fintype.card I))).prod * (steps.map (fullMixedLengthRowFactor μ qghost ρ v vmin Vb T)).prod * (L * productLengthLyapunov v s.2) := by let _ := physicalMixedWordEventFintype (V := V) (ell := ell) n shared B A Δ D have hfactor := physical_mixed_common_forest_row_factor_nonneg M B steps code μ qghost ρ v vmin Vb T β C (Fintype.card S) (Fintype.card I) hβ hC hρ hv have hrow : ∀ t tag s history, physicalMixedHistoryRow (ell := ell) n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge steps code v t tag s history ≤ physicalMixedCommonForestRowFactor M B steps code μ qghost ρ v vmin Vb T β C (Fintype.card S) (Fintype.card I) t tag * productLengthLyapunov v s.2 := by intro t tag s history have hn := mul_nonneg (hfactor t tag) (productLengthLyapunov_nonneg hv s.2) by_cases ht : t < steps.length · by_cases htag : steps.get ⟨t, ht⟩ = tag · exact howner ⟨t, ht⟩ tag htag s history · have hz : ∀ e, physicalMixedCommonHistoryGain n shared B A Δ D steps code t tag s e history = 0 := fun e => physical_mixed_common_history_gain_other n shared B A Δ D steps code t tag s e history ht (Ne.symm htag) simpa only [physicalMixedHistoryRow, hz, mul_zero, zero_mul, sum_const_zero] using hn · have hz : ∀ e, physicalMixedCommonHistoryGain n shared B A Δ D steps code t tag s e history = 0 := fun e => physical_mixed_common_history_gain_after n shared B A Δ D steps code t tag s e history ht simpa only [physicalMixedHistoryRow, hz, mul_zero, zero_mul, sum_const_zero] using hn have hb := finite_event_history_integral_le_rows (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (fun tag s e => |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge tag s e|) (physicalMixedCommonHistoryUpdate n shared B A Δ D steps) (physicalMixedCommonHistoryGain n shared B A Δ D steps code) (fun _ _ _ => abs_nonneg _) (physical_mixed_common_history_gain_nonneg n shared B A Δ D steps code) (fun s => productLengthLyapunov v s.2) (physicalMixedCommonForestRowFactor M B steps code μ qghost ρ v vmin Vb T β C (Fintype.card S) (Fintype.card I)) hfactor hrow 0 steps s history F hL hF rw [physical_mixed_common_forest_row_factor_product M B steps code μ qghost ρ v vmin Vb T β C (Fintype.card S) (Fintype.card I) hcode] at hb exact hb end Integral end Bounty end -- Source module: PhysicalMixedActualHistoryBound section /- A genuine original mixed-path rank bound from the arithmetic atom and small-completion assumptions, with no remaining row-bound hypothesis. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_mixed_history_integral_bound {qmax vs : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ C : ℝ, 1 ≤ C ∧ ∀ (S I V K : Type) (N : ℕ) [Fintype S] [Fintype I] (Ps : S → Finset ℕ) (P : Fin N → Type) [∀ g, Fintype (P g)] [∀ g, DecidableEq (P g)] (n : ∀ g, P g → ℕ) [∀ g p, NeZero (n g p)] (J : ℕ) (M : Fin N → ℕ) (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) [∀ i, Fintype (A i)] (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (ω : ∀ i, SharedActiveLabels P (shared i) → A i → ℝ) (μ : ∀ g, P g → ℝ) (qghost : V → ℝ) (ρ : ℝ) (Vb : Fin N → ℝ) (Vs : S → ℝ) (qedge : K → ℝ), (∀ s, vs ≤ Vs s) → (∀ k, Real.sqrt (qedge k) ≤ qmax) → ∀ (_i0 : I) (v vmin : ℝ) (η : Fin N → ℝ) (β : ℝ) (T : ℕ), (∀ i c a, 0 ≤ ω i c a) → (∀ i c, ∑ a, ω i c a ≤ 1) → (∀ g p, 0 ≤ μ g p) → (∀ g, ∑ p, μ g p ≤ 2) → (∀ g, 0 ≤ η g) → (∀ g p, μ g p ≤ η g) → (∀ j g, (|(1 - qghost j) * Vb g / ρ| * η g) * v ≤ β) → (∀ g, η g ≤ β) → (∀ j, 0 ≤ qghost j) → (∀ j, qghost j ≤ 1) → 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ Vb g) → (∀ j, qghost j / ρ ^ 2 + ((1 - qghost j) / ρ) / v ≤ 1) → (∀ i g, (shared i g)ᶜ.card ≤ T) → 0 ≤ β → ∀ (steps : List (Option (V ⊕ K))) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (_hcode : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) (s : PhysicalMixedWordState (Ps := Ps) (J := J) (ell := ell) (M := M) n B) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (F : FiniteEventPath (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) steps s → ℝ) (Lbound : ℝ), 0 ≤ Lbound → (∀ p, F p ≤ Lbound * productLengthLyapunov v (finiteEventPathTerminal (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) steps s p).2) → let _ := physicalMixedWordEventFintype (V := V) (ell := ell) n shared B A Δ D finiteEventPathIntegral (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (fun tag s e => |physicalMixedWordWeight n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge tag s e|) steps s (fun p => finiteEventHistoryFactor (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (physicalMixedCommonHistoryUpdate n shared B A Δ D steps) (physicalMixedCommonHistoryGain n shared B A Δ D steps code) 0 steps s p history * F p) ≤ β ^ birthForestRank code * (steps.map (physicalMixedSmallRowFactor C (Fintype.card S) (Fintype.card I))).prod * (steps.map (fullMixedLengthRowFactor μ qghost ρ v vmin Vb T)).prod * (Lbound * productLengthLyapunov v s.2) := by obtain ⟨C, hC, howner⟩ := exists_physical_mixed_owner_row_bound hqmax0 hqmax1 hvs ell refine ⟨C, hC, ?_⟩ intro S I V K N _ _ Ps P _ _ n _ J M shared B A _ Δ D kbig ω μ qghost ρ Vb Vs qedge hVs hqedge i0 v vmin η β T hω hωmass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hβ steps code hcode s history F Lbound hL hF exact physical_mixed_history_integral_le_rank n shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge steps code v vmin β C T hβ (le_trans zero_le_one hC) hρ1 (zero_lt_one.trans hv).le hcode (fun u tag htag s history => howner S I V K N Ps P n J M shared B A Δ D kbig ω μ qghost ρ Vb Vs qedge hVs hqedge i0 v vmin η β T hω hωmass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht steps code u tag htag s history) s history F hL hF end Bounty end -- Source module: PhysicalRootHistoryIntegral section /- The original root data in the absolute common-history integral. -/ open Finset open scoped Classical namespace Bounty section Integral variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ g (p : P (e.symm g).val), NeZero p.val] (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootHistoryIntegral (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (history : Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) → Option ((g : Fin M) × P (e.symm g).val)) (F : PhysicalRootMixedPath (n := n) groups e patterns C k s → ℝ) : ℝ := @finiteEventPathIntegral _ _ (PhysicalRootMixedEvent groups e patterns C k) (physicalMixedWordEventFintype (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val))) (physicalRootMixedTarget groups e patterns C k) (fun tag s ev => |physicalMixedWordWeight (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) tag s ev|) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) s (fun p => finiteEventHistoryFactor (PhysicalRootMixedEvent groups e patterns C k) (physicalRootMixedTarget groups e patterns C k) (physicalMixedCommonHistoryUpdate (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))) (physicalMixedCommonHistoryGain (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) code) 0 ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) s p history * F p) end Integral end Bounty end -- Source module: PhysicalRootScaledHistoryBound section /- Original history integration with an arbitrary nonnegative terminal bound. The small-row constant is independent of that bound and the mark count. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_root_scaled_history_integral_bound {qmax vs : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (I : Type) (N M J n B : ℕ) (P : Fin N → Finset ℕ) (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ g (p : P (e.symm g).val), NeZero p.val] (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ), (∀ s : ↥groupsᶜ, vs ≤ V s.val) → Real.sqrt q ≤ qmax → ∀ (_i0 : patterns) (v vmin : ℝ) (η : Fin M → ℝ) (τ : ℝ) (T : ℕ), (∀ g, ∑ p ∈ P (e.symm g).val, 1 / (p : ℝ) = V (e.symm g).val) → (∀ g p, 0 ≤ β g p / V (e.symm g).val) → (∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) → (∀ g, 0 ≤ η g) → (∀ g p, β g p / V (e.symm g).val ≤ η g) → (∀ j g, (|(1 - retention j) * V (e.symm g).val / ρ| * η g) * v ≤ τ) → (∀ g, η g ≤ τ) → (∀ j, 0 ≤ retention j) → (∀ j, retention j ≤ 1) → 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V (e.symm g).val) → (∀ j, retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) → (∀ (i : patterns) g, (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) → 0 ≤ τ → ∀ (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)), (∀ i, fullMixedCommonIndexStage (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) i = 0 → code i = none) → ∀ (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (history : Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) → Option ((g : Fin M) × P (e.symm g).val)) (F : PhysicalRootMixedPath (n := n) groups e patterns C k s → ℝ) (Lbound : ℝ), 0 ≤ Lbound → (∀ p, F p ≤ Lbound) → physicalRootHistoryIntegral groups e patterns C k V q β retention ρ code s history F ≤ τ ^ birthForestRank code * (((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))).map (physicalMixedSmallRowFactor A groupsᶜ.card patterns.card)).prod * (((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))).map (fullMixedLengthRowFactor (fun g p => β g p / V (e.symm g).val) retention ρ v vmin (fun g => V (e.symm g).val) T)).prod * (Lbound * productLengthLyapunov v s.2) := by obtain ⟨A, hA, hbound⟩ := exists_physical_mixed_history_integral_bound hqmax0 hqmax1 hvs ell refine ⟨A, hA, ?_⟩ intro I N M J n B P groups e _ patterns C k V q β retention ρ hVs hq i0 v vmin η τ T hMass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hτ code hcode s history F Lbound hL hF have hVpos : ∀ g, 0 < V (e.symm g).val := fun g => hvmin.trans_le (hV g) have h := hbound ↥groupsᶜ ↥patterns (Fin (n + 2)) (Fin (n + 1)) M (fun s => P s.val) (fun g => ↥(P (e.symm g).val)) (fun g (p : P (e.symm g).val) => p.val) J (fun _ => J + ell) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) hVs (fun _ => hq) i0 v vmin η τ T (fun i _ a => physical_aux_mass_nonneg _ _ (fun g => (hVpos g).le) a) (fun i _ => (physical_aux_mass_sum _ _ hVpos hMass).le) hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hτ ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) code hcode s history F Lbound hL (fun p => (hF p).trans (by simpa only [mul_one] using mul_le_mul_of_nonneg_left (productLengthLyapunov_one_le hv.le _) hL)) simp only [Fintype.card_coe] at h convert h using 1 rfl end Bounty end -- Source module: PhysicalRootForestData section /- The exact local residual on an original root mixed path. Small-prime factors are deliberately retained in the original real path weight. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) noncomputable def physicalRootEffectiveForestResidual (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalEffectivePlannedBigPath (fun (i : patterns) g => C i.val (e.symm g).val) (fun (j : Fin (n + 1)) (i : patterns) => k (n - j.val) i.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 x) : ℂ := let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalFullEdgeDelta (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) (kb key) let displacement := fun key => physicalFullEdgeD (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) let omega := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) a finiteEventLocalPhase (FullPermutationMixedEvent sizes shared B aux delta displacement) (fullPermutationMixedEventTarget sizes shared B aux delta displacement) (fullMixedBirthResidualPhase sizes shared B aux delta displacement (physicalFullCombinedEdgePhase Cb kb omega β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ))) steps x path variable (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) noncomputable def physicalRootForestResidual (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (path : PhysicalRootMixedPath (n := n) groups e patterns C k s) : ℂ := let z := physicalRootMixedPackingEquiv groups e patterns C k s.1.1 s.1.2 s.2 path physicalRootEffectiveForestResidual groups e patterns C hC k (s.1.2, z.1) V ζ K θ β ρ s.2 (physicalRootPlannedEffectiveEquiv groups e patterns C k hPs hPb hdis (s.1.2, z.1) s.2 z.2) noncomputable def physicalRootForestHistoryFactor (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (path : PhysicalRootMixedPath (n := n) groups e patterns C k s) : ℝ := let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val) let aux := fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val) let delta := fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val) let displacement := fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val) let steps := (List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)) finiteEventHistoryFactor (PhysicalRootMixedEvent groups e patterns C k) (physicalRootMixedTarget groups e patterns C k) (physicalMixedCommonHistoryUpdate sizes shared B aux delta displacement steps) (physicalMixedCommonHistoryGain sizes shared B aux delta displacement steps code) 0 steps s path (fullMixedCommonHistorySeed sizes B steps s.2 (fun _ => none)) noncomputable def physicalRootForestOriginalWeight (tag : Option (Fin (n + 2) ⊕ Fin (n + 1))) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (event : PhysicalRootMixedEvent groups e patterns C k tag s) : ℝ := physicalMixedWordWeight (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) tag s event end Root end Bounty end -- Source module: IndexedHistoryRelation section /- Chronological history comparisons need update agreement only at the actual scheduled tag. This permits fixed-plan histories to share one original clock. -/ namespace Bounty theorem finite_event_history_factor_rel_on {K X H H' : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ (_t : ℕ) k x, E k x → H → H) (update' : ∀ (_t : ℕ) k x, E k x → H' → H') (gain : ∀ (_t : ℕ) k x, E k x → H → ℝ) (gain' : ∀ (_t : ℕ) k x, E k x → H' → ℝ) (R : H → H' → Prop) (Good : ℕ → K → Prop) (hupdate : ∀ t k x e h h', Good t k → R h h' → R (update t k x e h) (update' t k x e h')) (hgain : ∀ t k x e h h', Good t k → R h h' → gain t k x e h = gain' t k x e h') (t : ℕ) (ks : List K) (hks : ∀ u : Fin ks.length, Good (t + u.val) (ks.get u)) (x : X) (p : FiniteEventPath E target ks x) (h : H) (h' : H') (hh : R h h') : finiteEventHistoryFactor E target update gain t ks x p h = finiteEventHistoryFactor E target update' gain' t ks x p h' := by induction ks generalizing t x h h' with | nil => rfl | cons k ks ih => rcases p with ⟨e,p⟩ have hk : Good t k := by simpa using hks ⟨0, by simp⟩ have htail : ∀ u : Fin ks.length, Good (t + 1 + u.val) (ks.get u) := by intro u simpa [Nat.add_assoc, Nat.add_comm, Nat.add_left_comm] using hks u.succ simp only [finiteEventHistoryFactor] rw [hgain t k x e h h' hk hh] exact congrArg (gain' t k x e h' * ·) (ih (t + 1) htail _ p _ _ (hupdate t k x e h h' hk hh)) end Bounty end -- Source module: PhysicalPlanHistoryFactor section /- The original common history and the fixed small-plan history give exactly the same causal factor along every decorated big path. -/ namespace Bounty section Factor variable {S I V K : Type} {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) theorem physical_plan_common_history_factor (tags : List (Option (V ⊕ PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K)))) (steps : List (Option (V ⊕ K))) (hshape : fullMixedCommonShape M B tags = fullMixedCommonShape M B steps) (htags : ∀ u : Fin tags.length, physicalMixedBigTagErase (tags.get u) = steps.get (Fin.cast (congrArg Sigma.fst hshape) u)) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B tags))) (code' : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (hc : HEq code code') (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FiniteEventPath (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) tags x) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B tags)) → Option (Sigma P)) (history' : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (hh : HEq history history') : finiteEventHistoryFactor (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) (physicalDecoratedPlanHistoryUpdate n shared B A Δ D tags) (physicalDecoratedPlanHistoryGain n shared B A Δ D tags code) 0 tags x p history = finiteEventHistoryFactor (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) (physicalDecoratedCommonHistoryWrite n shared B A Δ D steps) (physicalDecoratedCommonHistoryGain n shared B A Δ D steps code') 0 tags x p history' := by refine finite_event_history_factor_rel_on (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) (physicalDecoratedPlanHistoryUpdate n shared B A Δ D tags) (physicalDecoratedCommonHistoryWrite n shared B A Δ D steps) (physicalDecoratedPlanHistoryGain n shared B A Δ D tags code) (physicalDecoratedCommonHistoryGain n shared B A Δ D steps code') (fun h h' => HEq h h') (fun t tag => ∃ u : Fin tags.length, u.val = t ∧ tags.get u = tag) ?_ ?_ 0 tags ?_ x p history history' hh · intro t tag x e h h' ht hh rcases ht with ⟨u, rfl, rfl⟩ have huv : HEq u (Fin.cast (congrArg Sigma.fst hshape) u) := (Fin.heq_ext_iff (congrArg Sigma.fst hshape)).2 rfl exact physical_plan_history_update_heq n shared B A Δ D tags steps hshape u (Fin.cast (congrArg Sigma.fst hshape) u) huv (htags u) x e h h' hh · intro t tag x e h h' ht hh rcases ht with ⟨u, rfl, rfl⟩ have huv : HEq u (Fin.cast (congrArg Sigma.fst hshape) u) := (Fin.heq_ext_iff (congrArg Sigma.fst hshape)).2 rfl exact physical_plan_history_gain_eq n shared B A Δ D tags steps hshape u (Fin.cast (congrArg Sigma.fst hshape) u) huv (htags u) x e h h' hh code code' hc · intro u exact ⟨u, (Nat.zero_add _).symm, rfl⟩ end Factor end Bounty end -- Source module: PhysicalPlanHistoryMask section /- Exact compatibility masks can be evaluated by the single original schedule history even after fixing a small plan. -/ open scoped Classical namespace Bounty section Mask variable {S I V K : Type} {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) theorem physical_plan_common_history_mask (steps : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) steps) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (hcode : ∀ i, fullMixedCommonIndexStage M B (physicalMixedBigSteps steps L pl) i = 0 → (physicalMixedCommonForestEquiv M B steps L pl).symm code i = none) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FiniteEventPath (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) (physicalMixedBigSteps steps L pl) x) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B (physicalMixedBigSteps steps L pl))) → Option (Sigma P)) (history' : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (hh : HEq history history') : finiteEventHistoryFactor (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) (physicalDecoratedCommonHistoryWrite n shared B A Δ D steps) (physicalDecoratedCommonHistoryGain n shared B A Δ D steps code) 0 (physicalMixedBigSteps steps L pl) x p (fullMixedCommonHistorySeed n B steps x history') = if birthForestCompatible (fun i => fullMixedCommonBirthPerformed n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (physicalMixedBigSteps steps L pl) x p (fullMixedCommonBirthOrder M B (physicalMixedBigSteps steps L pl) i)) (fun i => fullMixedCommonBirthLabel n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (physicalMixedBigSteps steps L pl) x p (fullMixedCommonBirthOrder M B (physicalMixedBigSteps steps L pl) i)) ((physicalMixedCommonForestEquiv M B steps L pl).symm code) then 1 else 0 := by have hs := physical_mixed_big_common_shape M B steps L pl have hc : HEq ((physicalMixedCommonForestEquiv M B steps L pl).symm code) code := cast_heq _ code have hhseed : HEq (fullMixedCommonHistorySeed n B (physicalMixedBigSteps steps L pl) x history) (fullMixedCommonHistorySeed n B steps x history') := by rw [full_mixed_common_history_seed_shape, full_mixed_common_history_seed_shape] exact full_mixed_shape_history_seed_heq n B hs x hh have hfactor := physical_plan_common_history_factor n shared B A Δ D (physicalMixedBigSteps steps L pl) steps hs (physical_mixed_big_tag_at_position M B steps L pl) ((physicalMixedCommonForestEquiv M B steps L pl).symm code) code hc x p (fullMixedCommonHistorySeed n B (physicalMixedBigSteps steps L pl) x history) (fullMixedCommonHistorySeed n B steps x history') hhseed rw [← hfactor] exact full_mixed_common_forest_history_factor n _ B _ _ _ (physicalMixedBigSteps steps L pl) _ hcode x p history end Mask end Bounty end -- Source module: IndexedHistoryPacking section /- Time-indexed real history factors commute with the original small-plan packing. The small ledger and all big path choices remain unchanged. -/ open scoped Classical namespace Bounty theorem finite_event_history_factor_eq_complex_ledger {K X H : Type*} (E : K → X → Type*) (target : ∀ k x, E k x → X) (update : ∀ (_t : ℕ) k x, E k x → H → H) (gain : ∀ (_t : ℕ) k x, E k x → H → ℝ) (t : ℕ) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) (h : H) : (finiteEventHistoryFactor E target update gain t steps x p h : ℂ) = deterministicLedgerPhase E target (fun k (th : ℕ × H) x e => (th.1 + 1, update th.1 k x e th.2)) (fun k (th : ℕ × H) x e => (gain th.1 k x e th.2 : ℂ)) steps (t, h) x p := by induction steps generalizing t x h with | nil => rfl | cons k steps ih => rcases p with ⟨e, p⟩ simp only [finiteEventHistoryFactor, deterministicLedgerPhase, Complex.ofReal_mul] exact congrArg ((gain t k x e h : ℂ) * ·) (ih (t + 1) _ p _) section Packing variable {S G I V K H : Type} [Fintype S] {Ps : S → Finset ℕ} {P : G → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : G → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → G → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (update : ∀ (_t : ℕ) tag, (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → PhysicalMixedDecoratedBigEvent (V := V) (ell := ell) n shared B A Δ D tag x → H → H) (gain : ∀ (_t : ℕ) tag, (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → PhysicalMixedDecoratedBigEvent (V := V) (ell := ell) n shared B A Δ D tag x → H → ℝ) theorem physical_mixed_indexed_history_pack (t : ℕ) (ks : List (Option (V ⊕ K))) (h : H) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (z : Σ pl : PhysicalMixedSmallPlan (I := I) ks, PhysicalMixedPlannedBigPath n shared B A Δ D ks L pl x) : finiteEventHistoryFactor (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (fun t tag s e h => physicalMixedBigEventPullback n shared B A Δ D (fun tag h x e => update t tag x e h) tag h s e) (fun t tag s e h => physicalMixedBigEventPullback n shared B A Δ D (fun tag h x e => gain t tag x e h) tag h s e) t ks ((r, L), x) (physicalMixedPathPack n shared B A Δ D kbig ks r L x z) h = finiteEventHistoryFactor (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) update gain t (physicalMixedBigSteps ks L z.1) x z.2 h := by apply Complex.ofReal_injective rw [finite_event_history_factor_eq_complex_ledger] exact (physical_mixed_projected_history_pack n shared B A Δ D kbig (fun tag (th : ℕ × H) x e => (th.1 + 1, update th.1 tag x e th.2)) (fun tag (th : ℕ × H) x e => (gain th.1 tag x e th.2 : ℂ)) ks (t, h) r L x z).trans (finite_event_history_factor_eq_complex_ledger (PhysicalMixedDecoratedBigEvent n shared B A Δ D) (physicalMixedDecoratedBigTarget n shared B A Δ D) update gain t (physicalMixedBigSteps ks L z.1) x z.2 h).symm end Packing end Bounty end -- Source module: PhysicalCommonHistoryPacking section /- The exact original mixed path and the fixed small-plan path have the same seeded forest-history factor. Every outgoing small choice remains in the path. -/ namespace Bounty section Packing variable {S I V K : Type} [Fintype S] {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) end Packing end Bounty end -- Source module: FullMixedShapeInitialCondition section /- The no-initial-child condition transports with the common forest code. -/ namespace Bounty theorem full_mixed_shape_initial_condition_iff {N : ℕ} (M : Fin N → ℕ) {shape shape' : FullMixedCommonShapeData N} (hs : shape = shape') {code : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M shape))} {code' : BirthForestCode (Fintype.card (FullMixedCommonShapeAddress M shape'))} (hc : HEq code code') : (∀ i, fullMixedShapeIndexStage M shape i = 0 → code i = none) ↔ (∀ i, fullMixedShapeIndexStage M shape' i = 0 → code' i = none) := by cases hs cases eq_of_heq hc rfl theorem physical_mixed_plan_initial_condition_iff {S I V K : Type} {Ps : S → Finset ℕ} {J ell N : ℕ} (M : Fin N → ℕ) (B : ℕ) (steps : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (I := I) steps) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) : (∀ i, fullMixedCommonIndexStage M B (physicalMixedBigSteps steps L pl) i = 0 → ((physicalMixedCommonForestEquiv M B steps L pl).symm code) i = none) ↔ (∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) := by rw [full_mixed_index_stage_shape, full_mixed_index_stage_shape] exact full_mixed_shape_initial_condition_iff M (physical_mixed_big_common_shape M B steps L pl) (cast_heq _ code) end Bounty end -- Source module: PhysicalMixedPackedHistoryMask section /- The original mixed path carries exactly the compatibility mask of its fixed small-plan path, with the original common forest code and history. -/ open scoped Classical namespace Bounty section PackedMask variable {S I V K : Type} [Fintype S] {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) theorem physical_mixed_packed_history_mask (steps : List (Option (V ⊕ K))) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (z : Σ pl : PhysicalMixedSmallPlan (I := I) steps, PhysicalMixedPlannedBigPath n shared B A Δ D steps L pl x) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) (hcode : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) (history : Fin (Fintype.card (FullMixedCommonBirthAddress M B (physicalMixedBigSteps steps L z.1))) → Option (Sigma P)) (history' : Fin (Fintype.card (FullMixedCommonBirthAddress M B steps)) → Option (Sigma P)) (hh : HEq history history') : finiteEventHistoryFactor (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (fun t tag s e h => physicalMixedBigEventPullback n shared B A Δ D (fun tag h x e => physicalDecoratedCommonHistoryWrite n shared B A Δ D steps t tag x e h) tag h s e) (physicalMixedCommonHistoryGain n shared B A Δ D steps code) 0 steps ((r, L), x) (physicalMixedPathPack n shared B A Δ D kbig steps r L x z) (fullMixedCommonHistorySeed n B steps x history') = if birthForestCompatible (fun i => fullMixedCommonBirthPerformed n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (physicalMixedBigSteps steps L z.1) x z.2 (fullMixedCommonBirthOrder M B (physicalMixedBigSteps steps L z.1) i)) (fun i => fullMixedCommonBirthLabel n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (physicalMixedBigSteps steps L z.1) x z.2 (fullMixedCommonBirthOrder M B (physicalMixedBigSteps steps L z.1) i)) ((physicalMixedCommonForestEquiv M B steps L z.1).symm code) then 1 else 0 := by have hplan := (physical_mixed_plan_initial_condition_iff M B steps L z.1 code).2 hcode have hpack := physical_mixed_indexed_history_pack n shared B A Δ D kbig (physicalDecoratedCommonHistoryWrite n shared B A Δ D steps) (physicalDecoratedCommonHistoryGain n shared B A Δ D steps code) 0 steps (fullMixedCommonHistorySeed n B steps x history') r L x z exact hpack.trans (physical_plan_common_history_mask n shared B A Δ D steps L z.1 code hplan x z.2 history history' hh) end PackedMask end Bounty end -- Source module: PhysicalPackedHistoryZeroSeed section /- The exact packed forest mask with the empty common history. -/ open scoped Classical namespace Bounty section ZeroSeed variable {S I V K : Type} [Fintype S] {N : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Type} (n : ∀ g, P g → ℕ) {J ell : ℕ} {M : Fin N → ℕ} (shared : I → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : I → Type) (Δ D : ∀ _k : K, ∀ i, PhysicalSharedLists Ps J → SharedActiveLabels P (shared i) → A i → Fin N → ℤ) (kbig : ∀ _k : K, ∀ i, SharedActiveLabels P (shared i) → A i → ℤ) (steps : List (Option (V ⊕ K))) (r : PhysicalResidues Ps) (L : PhysicalMarkLists Ps J ell) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (z : Σ pl : PhysicalMixedSmallPlan (I := I) steps, PhysicalMixedPlannedBigPath n shared B A Δ D steps L pl x) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) theorem physical_mixed_packed_history_zero_seed (hcode : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) : finiteEventHistoryFactor (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (fun t tag s e h => physicalMixedBigEventPullback n shared B A Δ D (fun tag h x e => physicalDecoratedCommonHistoryWrite n shared B A Δ D steps t tag x e h) tag h s e) (physicalMixedCommonHistoryGain n shared B A Δ D steps code) 0 steps ((r, L), x) (physicalMixedPathPack n shared B A Δ D kbig steps r L x z) (fullMixedCommonHistorySeed n B steps x (fun _ => none)) = if birthForestCompatible (fun i => fullMixedCommonBirthPerformed n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (physicalMixedBigSteps steps L z.1) x z.2 (fullMixedCommonBirthOrder M B (physicalMixedBigSteps steps L z.1) i)) (fun i => fullMixedCommonBirthLabel n (fun key : PhysicalMixedBigKey (Ps := Ps) (J := J) (ell := ell) (I := I) (K := K) => shared key.2.1) B (fun key _ => A key.2.1) (fun key c a => Δ key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (fun key c a => D key.1 key.2.1 (physicalSharedPrefix key.2.2.1) c a) (physicalMixedBigSteps steps L z.1) x z.2 (fullMixedCommonBirthOrder M B (physicalMixedBigSteps steps L z.1) i)) ((physicalMixedCommonForestEquiv M B steps L z.1).symm code) then 1 else 0 := by have hnone (a b : ℕ) (h : a = b) : HEq (fun _ : Fin a => (none : Option (Sigma P))) (fun _ : Fin b => (none : Option (Sigma P))) := by subst b rfl exact physical_mixed_packed_history_mask n shared B A Δ D kbig steps r L x z code hcode (fun _ => none) (fun _ => none) (hnone _ _ (physical_mixed_big_common_card M B steps L z.1)) theorem physical_mixed_packed_history_zero_seed_nonneg (hcode : ∀ i, fullMixedCommonIndexStage M B steps i = 0 → code i = none) : 0 ≤ finiteEventHistoryFactor (PhysicalMixedWordEvent n shared B A Δ D) (physicalMixedWordTarget n shared B A Δ D kbig) (fun t tag s e h => physicalMixedBigEventPullback n shared B A Δ D (fun tag h x e => physicalDecoratedCommonHistoryWrite n shared B A Δ D steps t tag x e h) tag h s e) (physicalMixedCommonHistoryGain n shared B A Δ D steps code) 0 steps ((r, L), x) (physicalMixedPathPack n shared B A Δ D kbig steps r L x z) (fullMixedCommonHistorySeed n B steps x (fun _ => none)) := by rw [physical_mixed_packed_history_zero_seed n shared B A Δ D kbig steps r L x z code hcode] split_ifs <;> norm_num end ZeroSeed end Bounty end -- Source module: PhysicalRootForestPacking section /- Packing identities for the unchanged root residual and common-history mask. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) variable (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) theorem physical_root_forest_residual_pack (r0 : PhysicalResidues (fun t : ↥groupsᶜ => P t.val)) (L : PhysicalMarkLists (fun t : ↥groupsᶜ => P t.val) J ell) (sp : PhysicalMixedSmallPlan (Ps := fun t : ↥groupsᶜ => P t.val) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalRootPlannedPath groups e patterns C k (L, sp) x) : physicalRootForestResidual groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis ((r0, L), x) ((physicalRootMixedPackingEquiv groups e patterns C k r0 L x).symm ⟨sp, path⟩) = physicalRootEffectiveForestResidual groups e patterns C hC k (L, sp) V ζ K θ β ρ x (physicalRootPlannedEffectiveEquiv groups e patterns C k hPs hPb hdis (L, sp) x path) := by unfold physicalRootForestResidual have h := (physicalRootMixedPackingEquiv groups e patterns C k r0 L x).apply_symm_apply ⟨sp, path⟩ exact congrArg (fun z : Σ sp : PhysicalMixedSmallPlan (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))), PhysicalRootPlannedPath groups e patterns C k (L, sp) x => physicalRootEffectiveForestResidual groups e patterns C hC k (L, z.1) V ζ K θ β ρ x (physicalRootPlannedEffectiveEquiv groups e patterns C k hPs hPb hdis (L, z.1) x z.2)) h theorem physical_root_forest_history_nonneg (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (hcode : ∀ i, fullMixedCommonIndexStage (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) i = 0 → code i = none) (s : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e) (path : PhysicalRootMixedPath (n := n) groups e patterns C k s) : 0 ≤ physicalRootForestHistoryFactor groups e patterns C k code s path := by let z := physicalRootMixedPackingEquiv groups e patterns C k s.1.1 s.1.2 s.2 path have h := physical_mixed_packed_history_zero_seed_nonneg (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) s.1.1 s.1.2 s.2 z code hcode change 0 ≤ physicalRootForestHistoryFactor groups e patterns C k code s ((physicalRootMixedPackingEquiv groups e patterns C k s.1.1 s.1.2 s.2).symm z) at h have hz : (physicalRootMixedPackingEquiv groups e patterns C k s.1.1 s.1.2 s.2).symm z = path := (physicalRootMixedPackingEquiv groups e patterns C k s.1.1 s.1.2 s.2).symm_apply_apply path rw [hz] at h exact h end Root end Bounty end -- Source module: FullPermutationCommonPathBirth section /- Effective parameters preserve every initial and event birth label on the actual path. -/ open scoped Classical namespace Bounty section Birth variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : ∀ g, P g → ℕ) {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ Δ' D D' : ∀ k c, A k c → Fin N → ℤ) (hΔ : ∀ k, Δ k = Δ' k) (hD : ∀ k c a g p, ((n g p : ℤ) ∣ D k c a g ↔ (n g p : ℤ) ∣ D' k c a g)) theorem full_permutation_parameter_common_path_label (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) (a : FullMixedCommonStepAddress M B steps) : fullMixedCommonPathBirthLabel n S B A Δ' D' steps x (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x p) a = fullMixedCommonPathBirthLabel n S B A Δ D steps x p a := by rcases a with ⟨i, a⟩ rw [full_mixed_common_path_label_occurrence, full_mixed_common_path_label_occurrence] have hh := finite_event_path_equiv_occurrence (FullPermutationMixedEvent n S B A Δ D) (FullPermutationMixedEvent n S B A Δ' D') (fullPermutationMixedEventTarget n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ' D') id (fullPermutationParameterEventEquiv n S B A Δ Δ' D D' hΔ hD) (fun tag x e => (full_permutation_parameter_target n S B A Δ Δ' D D' hΔ hD tag x e).symm) steps x p i change finiteEventPathOccurrence _ _ steps x (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x p) i = _ at hh rw [hh] dsimp only exact full_permutation_parameter_common_birth_label n S B A Δ Δ' D D' hΔ hD _ _ _ a theorem full_permutation_parameter_common_total_label (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) (a : FullMixedCommonBirthAddress M B steps) : fullMixedCommonBirthLabel n S B A Δ' D' steps x (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x p) a = fullMixedCommonBirthLabel n S B A Δ D steps x p a := by cases a with | inl a => rfl | inr a => exact full_permutation_parameter_common_path_label n S B A Δ Δ' D D' hΔ hD steps x p a end Birth end Bounty end -- Source module: PhysicalEffectiveForestMask section /- Effective parameters preserve the full forest compatibility mask, including performed guards and the original prime labels. -/ namespace Bounty section Parameters variable {J K : Type*} {N : ℕ} {P : Fin N → Type*} (n : ∀ g, P g → ℕ) {M : Fin N → ℕ} (S : K → ∀ g, Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type*) (Δ Δ' D D' : ∀ k c, A k c → Fin N → ℤ) (hΔ : ∀ k, Δ k = Δ' k) (hD : ∀ k c a g p, ((n g p : ℤ) ∣ D k c a g ↔ (n g p : ℤ) ∣ D' k c a g)) theorem full_permutation_parameter_forest_compatible (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress M B steps))) : birthForestCompatible (fullMixedCommonIndexedPerformed n S B A Δ' D' steps x (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x p)) (fun i => fullMixedCommonBirthLabel n S B A Δ' D' steps x (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x p) (fullMixedCommonBirthOrder M B steps i)) code ↔ birthForestCompatible (fullMixedCommonIndexedPerformed n S B A Δ D steps x p) (fun i => fullMixedCommonBirthLabel n S B A Δ D steps x p (fullMixedCommonBirthOrder M B steps i)) code := by have hl : (fun i => fullMixedCommonBirthLabel n S B A Δ' D' steps x (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x p) (fullMixedCommonBirthOrder M B steps i)) = (fun i => fullMixedCommonBirthLabel n S B A Δ D steps x p (fullMixedCommonBirthOrder M B steps i)) := by funext i exact full_permutation_parameter_common_total_label n S B A Δ Δ' D D' hΔ hD steps x p (fullMixedCommonBirthOrder M B steps i) have hp : fullMixedCommonIndexedPerformed n S B A Δ' D' steps x (fullPermutationParameterPathEquiv n S B A Δ Δ' D D' hΔ hD steps x p) = fullMixedCommonIndexedPerformed n S B A Δ D steps x p := by funext i exact congrArg (fun z : Option (Sigma P) => z.isSome = true) (congrFun hl i) rw [hl, hp] end Parameters section Physical variable {S K V : Type*} [Fintype S] {N J ell : ℕ} {Ps : S → Finset ℕ} {P : Fin N → Finset ℕ} (hPs : ∀ s p, p ∈ Ps s → Nat.Prime p) (hP : ∀ g p, p ∈ P g → Nat.Prime p) (hdis : ∀ s g, Disjoint (Ps s) (P g)) (C : K → Fin N → Finset (Fin J)) (d : K → PhysicalSharedLists Ps J) (k : K → ℤ) (B : ℕ) theorem physical_mixed_effective_forest_compatible (steps : List (Option (V ⊕ K))) (x : PhysicalFullBoundedState P J ell B) (p : FullPermutationMixedPath (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) steps x) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin N => J + ell) B steps))) : birthForestCompatible (fullMixedCommonIndexedPerformed (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key)) steps x (physicalMixedEffectiveBigPathEquiv hPs hP hdis C d k B steps x p)) (fun i => fullMixedCommonBirthLabel (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalFullEdgeDelta (C key) (k key * (physicalSharedProduct (d key) : ℕ))) (fun key => physicalFullEdgeD (C key)) steps x (physicalMixedEffectiveBigPathEquiv hPs hP hdis C d k B steps x p) (fullMixedCommonBirthOrder (fun _ : Fin N => J + ell) B steps i)) code ↔ birthForestCompatible (fullMixedCommonIndexedPerformed (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) steps x p) (fun i => fullMixedCommonBirthLabel (fun g (p : P g) => p.val) (fun key g => physicalFullSharedIndices (ell := ell) (C key g)) B (fun key _ => PhysicalAuxLabels P (C key)) (fun key => physicalMixedEdgeDelta (C key) (k key) (d key)) (fun key => physicalMixedEdgeD (C key) (d key)) steps x p (fullMixedCommonBirthOrder (fun _ : Fin N => J + ell) B steps i)) code := by exact full_permutation_parameter_forest_compatible _ _ B _ _ _ _ _ (fun key => funext fun c => funext fun a => funext fun g => physical_mixed_delta_effective_big_step (C key) (d key) (k key) c a g) (fun key c a g p => physical_mixed_dilation_divisibility hPs hP hdis (C key) (d key) c a g p) steps x p code end Physical end Bounty end -- Source module: PhysicalRootForestPlanned section /- The fixed-plan root forest is the original planned big action, retaining its exact small factor, compatibility mask, and effective residual. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) noncomputable def physicalRootPlannedForestCompatible (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B (physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2)))) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (path : PhysicalRootPlannedPath groups e patterns C k pl x) : Prop := let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let db := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => physicalSharedPrefix key.2.2.1 let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalMixedEdgeDelta (Cb key) (kb key) (db key) let displacement := fun key => physicalMixedEdgeD (Cb key) (db key) birthForestCompatible (fullMixedCommonIndexedPerformed sizes shared B aux delta displacement steps x path) (fun i => fullMixedCommonBirthLabel sizes shared B aux delta displacement steps x path (fullMixedCommonBirthOrder (fun _ : Fin M => J + ell) B steps i)) code variable [∀ z : PhysicalPrime P, NeZero z.2.val] [∀ g (p : P (e.symm g).val), NeZero p.val] (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) theorem physical_root_effective_forest_eq_planned_action (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) (code : BirthForestCode (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B (physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2)))) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : physicalRootEffectiveForestAction groups e patterns C hC k pl V q ζ K r θ β retention ρ code f x = physicalMixedPlannedBigAction (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (i : patterns) _ a => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) a) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 (fun y path => (physicalMixedPlanSmallFactor (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) pl.1 pl.2 y path : ℂ) * (if physicalRootPlannedForestCompatible groups e patterns C k pl code y path then 1 else 0) * physicalRootEffectiveForestResidual groups e patterns C hC k pl V ζ K θ β ρ y (physicalRootPlannedEffectiveEquiv groups e patterns C k hPs hPb hdis pl y path)) f x := by rw [physical_mixed_planned_effective_action hPs hPb hdis] dsimp only unfold physicalRootEffectiveForestAction fullPermutationMixedPathAction finiteEventPathAction birthForestPathSum dsimp only apply Finset.sum_congr · exact congrArg (fun inst : Fintype _ => @Finset.univ _ inst) (Subsingleton.elim _ _) · intro path _ rw [physical_mixed_plan_small_factor_effective_pullback] have hmask := physical_mixed_effective_forest_compatible hPs hPb hdis (fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val) (fun key => physicalSharedPrefix key.2.2.1) (fun key => k (n - key.1.val) key.2.1.val) B (physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2) x ((physicalRootPlannedEffectiveEquiv groups e patterns C k hPs hPb hdis pl x).symm path) code simp only [physicalRootPlannedEffectiveEquiv, Equiv.apply_symm_apply] at hmask ⊢ unfold physicalRootPlannedForestCompatible dsimp only rw [← hmask] unfold fullMixedCommonResidualWeight physicalRootEffectiveForestResidual dsimp only split_ifs <;> ring end Root end Bounty end -- Source module: FinitePathMaskedNorm section /- Absolute domination of a real-masked complex path action, with all original path weights retained inside the integral. -/ open scoped Classical namespace Bounty theorem finite_event_path_action_mask_norm_le {K X : Type} (E : K → X → Type) [∀ k x, Fintype (E k x)] (target : ∀ k x, E k x → X) (weight : ∀ k x, E k x → ℝ) (steps : List K) (mask : ∀ x, FiniteEventPath E target steps x → ℝ) (residual : ∀ x, FiniteEventPath E target steps x → ℂ) (f : X → ℂ) (x : X) (hmask : ∀ p, 0 ≤ mask x p) : ‖finiteEventPathAction E target weight steps (fun x p => (mask x p : ℂ) * residual x p) f x‖ ≤ finiteEventPathIntegral E target (fun k x e => |weight k x e|) steps x (fun p => mask x p * (‖residual x p‖ * ‖f (finiteEventPathTerminal E target steps x p)‖)) := by unfold finiteEventPathAction finiteEventPathIntegral refine (norm_sum_le _ _).trans ?_ apply Finset.sum_le_sum intro p _ simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hmask p), ← finite_event_path_weight_abs] exact le_of_eq (by ring) end Bounty end -- Source module: PhysicalRootForestIntegral section /- Exact original forest-to-history action and absolute integral domination. -/ open Finset open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ z : PhysicalPrime P, NeZero z.2.val] [∀ g (p : P (e.symm g).val), NeZero p.val] (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (pl : PhysicalRootSmallPlan (P := P) (J := J) (ell := ell) (n := n) groups patterns) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) variable (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) theorem physical_root_mixed_forest_eq_history_action (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (hcode : ∀ i, fullMixedCommonIndexStage (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) i = 0 → code i = none) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code f L x = @finiteEventPathAction _ _ (PhysicalRootMixedEvent groups e patterns C k) (physicalMixedWordEventFintype (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val))) (physicalRootMixedTarget groups e patterns C k) (physicalRootForestOriginalWeight groups e patterns C k V q β retention ρ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (fun s p => (physicalRootForestHistoryFactor groups e patterns C k code s p : ℂ) * physicalRootForestResidual groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis s p) (fun s => f s.2) ((physicalGroupResidueVector r, L), x) := by symm unfold physicalRootMixedForestAction change physicalMixedWordPathAction (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (i : patterns) _ aux => physicalAuxMass (fun g => V (e.symm g).val) (fun g => C i.val (e.symm g).val) aux) (fun g p => β g p / V (e.symm g).val) retention ρ (fun g => V (e.symm g).val) (fun s : ↥groupsᶜ => V s.val) (fun _ => q) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (fun s p => (physicalRootForestHistoryFactor groups e patterns C k code s p : ℂ) * physicalRootForestResidual groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis s p) (fun s => f s.2) ((physicalGroupResidueVector r, L), x) = _ rw [physical_mixed_paths_eq_original_big_paths] apply Finset.sum_congr rfl intro sp _ unfold physicalRootCommonForestAction rw [physical_root_effective_forest_eq_planned_action groups e patterns C hC k (L, sp) V q ζ K r θ β retention ρ hPs hPb hdis] unfold physicalMixedPlannedBigAction fullPermutationMixedPathAction finiteEventPathAction apply Finset.sum_congr · exact congrArg (fun inst : Fintype _ => @Finset.univ _ inst) (Subsingleton.elim _ _) · intro path _ dsimp only have hm := physical_mixed_packed_history_zero_seed (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) L x ⟨sp, path⟩ code hcode change physicalRootForestHistoryFactor groups e patterns C k code ((physicalGroupResidueVector r, L), x) ((physicalRootMixedPackingEquiv groups e patterns C k (physicalGroupResidueVector r) L x).symm ⟨sp, path⟩) = if physicalRootPlannedForestCompatible groups e patterns C k (L, sp) ((physicalMixedCommonForestEquiv (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) L sp).symm code) x path then 1 else 0 at hm have hr := physical_root_forest_residual_pack groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis (physicalGroupResidueVector r) L sp x path have ht := physical_mixed_planned_big_terminal (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedBigStep (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalGroupResidueVector r) L sp x path change _ = _ at hr erw [hm, hr, ht] dsimp only [physicalMixedPlannedBigTerminal] split_ifs <;> simp only [Complex.ofReal_one, Complex.ofReal_zero, mul_one, mul_zero, zero_mul] ring theorem physical_root_mixed_forest_norm_le_history_integral (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (hcode : ∀ i, fullMixedCommonIndexStage (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) i = 0 → code i = none) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) : ‖physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code f L x‖ ≤ physicalRootHistoryIntegral groups e patterns C k V q β retention ρ code ((physicalGroupResidueVector r, L), x) (fullMixedCommonHistorySeed (fun g (p : P (e.symm g).val) => p.val) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) x (fun _ => none)) (fun p => ‖physicalRootForestResidual groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis ((physicalGroupResidueVector r, L), x) p‖ * ‖f (finiteEventPathTerminal (PhysicalRootMixedEvent groups e patterns C k) (physicalRootMixedTarget groups e patterns C k) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) ((physicalGroupResidueVector r, L), x) p).2‖) := by rw [physical_root_mixed_forest_eq_history_action groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code hcode] exact @finite_event_path_action_mask_norm_le _ _ (PhysicalRootMixedEvent groups e patterns C k) (physicalMixedWordEventFintype (fun g (p : P (e.symm g).val) => p.val) (fun (i : patterns) g => physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val)) B (fun (i : patterns) => PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C i.val (e.symm g).val)) (fun (j : Fin (n + 1)) (i : patterns) => physicalMixedEdgeDelta (fun g => C i.val (e.symm g).val) (k (n - j.val) i.val)) (fun (_ : Fin (n + 1)) (i : patterns) => physicalMixedEdgeD (fun g => C i.val (e.symm g).val))) (physicalRootMixedTarget groups e patterns C k) (physicalRootForestOriginalWeight groups e patterns C k V q β retention ρ) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) (physicalRootForestHistoryFactor groups e patterns C k code) (physicalRootForestResidual groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis) (fun s => f s.2) ((physicalGroupResidueVector r, L), x) (physical_root_forest_history_nonneg groups e patterns C k code hcode ((physicalGroupResidueVector r, L), x)) end Root end Bounty end -- Source module: PhysicalRootCoefficientBound section /- Unit bounds for the original root coefficient. The local Fourier factors have modulus one; no small-group weight is included in, or removed from, this coefficient. The active-endpoint gates and birth-ledger gates are retained. -/ open scoped Classical namespace Bounty end Bounty end -- Source module: PhysicalRootCoefficientEnvelope section /- General coefficient envelopes preserve the original phases and gates. -/ open scoped Classical namespace Bounty theorem physical_active_coefficient_norm_le_envelope {N J ell : ℕ} {P : Fin N → Finset ℕ} (before after C : Fin N → Finset (Fin J)) (ζ : ℝ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (H : ℝ) (hH : 0 ≤ H) (hK : ∀ L R a, ‖K L R a‖ ≤ H) (s t : (g : Fin N) → Fin (J + ell) → ↥(P g)) (a : PhysicalAuxLabels P C) : ‖physicalActiveCoefficient before after C ζ K s t a‖ ≤ H := by unfold physicalActiveCoefficient split_ifs · rw [norm_mul, physical_phase_norm, mul_one] exact hK _ _ _ all_goals simpa only [norm_zero] using hH theorem physical_full_combined_edge_phase_norm_le_envelope {I : Type} {N J ell B : ℕ} {P : Fin N → Finset ℕ} (C : I → Fin N → Finset (Fin J)) (k : I → ℤ) (ω : ∀ i, SharedActiveLabels (fun g => ↥(P g)) (fun g => physicalFullSharedIndices (ell := ell) (C i g)) → PhysicalAuxLabels P (C i) → ℝ) (β : (g : Fin N) → P g → ℝ) (ρ : ℝ) (V : Fin N → ℝ) (ζ : I → ℝ) (coeff : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (H : ℝ) (hH : 0 ≤ H) (hcoeff : ∀ i L R a, ‖coeff i L R a‖ ≤ H) (i : I) (ledger : (g : Fin N) → Finset (P g)) (x : PhysicalFullBoundedState P J ell B) (ev : PhysicalFullEdgeEvent (C i) (k i) x) : ‖physicalFullCombinedEdgePhase C k ω β ρ V ζ coeff i ledger x ev‖ ≤ H := by rw [physicalFullCombinedEdgePhase, norm_mul] simpa only [one_mul] using mul_le_mul (physical_full_global_edge_phase_norm_le _ _ _ _ _ _ _ _ _) (physical_active_coefficient_norm_le_envelope _ _ _ _ _ H hH (hcoeff i) _ _ _) (norm_nonneg _) (show (0 : ℝ) ≤ 1 by norm_num) theorem physical_root_key_coefficient_norm_le_envelope {I : Type} {N M J ell n : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (H : ℝ) (hK : ∀ time < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K time i L R a‖ ≤ H) (key : PhysicalMixedBigKey (Ps := fun g : ↥groupsᶜ => P g.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1))) (L R : PhysicalMarkLists (fun g => P (e.symm g).val) J ell) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (fun g => C key.2.1.val (e.symm g).val)) : ‖physicalRootKeyCoefficient groups e patterns C hC ζ k K θ key L R a‖ ≤ H := by simp only [physicalRootKeyCoefficient, physicalGroupReindexedCoefficient, physicalCoupledBigCoefficient, physicalLocalFourierCoefficient, norm_mul, physical_phase_norm, physicalReturnPhase_norm, mul_one] exact hK _ (Nat.lt_succ_of_le (Nat.sub_le _ _)) _ key.2.1.property _ _ _ end Bounty end -- Source module: PhysicalSelectedSmallRowProduct section /- The original small-row cost is paid exactly once per selected edge. -/ namespace Bounty theorem physical_block_small_row_product {V K : Type} (A : ℝ) (smallGroups patterns : ℕ) (bs : List (V × K)) (last : V) : ((physicalBlockFineSteps bs last).map (physicalMixedSmallRowFactor A smallGroups patterns)).prod = (A ^ smallGroups * patterns) ^ bs.length := by induction bs with | nil => simp [physicalBlockFineSteps, physicalMixedSmallRowFactor] | cons b bs ih => simpa [physicalBlockFineSteps, physicalMixedSmallRowFactor, pow_succ, mul_comm] using congrArg (fun x : ℝ => (A ^ smallGroups * patterns) * x) ih theorem physical_selected_small_row_product (A : ℝ) (smallGroups patterns n : ℕ) : (((List.range (4 * n + 1)).map (physicalSelectedFineTag n)).map (physicalMixedSmallRowFactor A smallGroups patterns)).prod = (A ^ smallGroups * patterns) ^ n := by rw [physical_selected_fine_block_schedule] simpa using physical_block_small_row_product A smallGroups patterns (List.ofFn (fun j : Fin n => (j.castSucc, j))) (Fin.last n) end Bounty end -- Source module: FullMixedResidualEnvelope section /- A local coefficient envelope is charged exactly on the big-edge tags. Permutation and ghost tags retain their unit contribution. -/ namespace Bounty theorem finite_event_local_phase_norm_le_product {K X : Type} (E : K → X → Type) (target : ∀ k x, E k x → X) (phase : ∀ k x, E k x → ℂ) (b : K → ℝ) (hb : ∀ k, 0 ≤ b k) (hphase : ∀ k x e, ‖phase k x e‖ ≤ b k) (steps : List K) (x : X) (p : FiniteEventPath E target steps x) : ‖finiteEventLocalPhase E target phase steps x p‖ ≤ (steps.map b).prod := by induction steps generalizing x with | nil => simp only [finiteEventLocalPhase, norm_one, List.map_nil, List.prod_nil, le_refl] | cons k ks ih => rcases p with ⟨e, p⟩ simp only [finiteEventLocalPhase, norm_mul, List.map_cons, List.prod_cons] exact mul_le_mul (hphase k x e) (ih _ p) (norm_nonneg _) (hb k) section Residual variable {J K : Type} {N : ℕ} {P : Fin N → Type} (n : (g : Fin N) → P g → ℕ) {M : Fin N → ℕ} (S : K → (g : Fin N) → Finset (Fin (M g))) (B : ℕ) (A : ∀ k, SharedActiveLabels P (S k) → Type) (Δ D : ∀ k c, A k c → Fin N → ℤ) (edgePhase : ∀ k, ((g : Fin N) → Finset (P g)) → (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) → FullActiveEdgeEvent n (S k) B (A k) (Δ k) (D k) x → ℂ) theorem full_mixed_common_residual_path_norm_le_envelope (H : ℝ) (hH : 0 ≤ H) (hphase : ∀ k x e, ‖edgePhase k (fun _ => ∅) x e‖ ≤ H) (steps : List (Option (J ⊕ K))) (x : ProductBoundedOrderedState P (fun g => UnrestrictedResidueParticle (n g)) M B) (p : FullPermutationMixedPath n S B A Δ D steps x) : ‖finiteEventLocalPhase (FullPermutationMixedEvent n S B A Δ D) (fullPermutationMixedEventTarget n S B A Δ D) (fullMixedBirthResidualPhase n S B A Δ D edgePhase) steps x p‖ ≤ (steps.map (physicalMixedSmallRowFactor H 1 1)).prod := by apply finite_event_local_phase_norm_le_product · exact physical_mixed_small_row_factor_nonneg hH 1 1 · intro tag y e cases tag with | none => exact le_of_eq (norm_one : ‖(1 : ℂ)‖ = 1) | some tag => cases tag with | inl j => exact le_of_eq (norm_one : ‖(1 : ℂ)‖ = 1) | inr k => simpa only [fullMixedBirthResidualPhase, physicalMixedSmallRowFactor, pow_one, Nat.cast_one, mul_one] using hphase k y e end Residual theorem physical_mixed_planned_envelope_product {S I V K : Type} {Ps : S → Finset ℕ} {J ell : ℕ} (H : ℝ) (steps : List (Option (V ⊕ K))) (L : PhysicalMarkLists Ps J ell) (pl : PhysicalMixedSmallPlan (Ps := Ps) (J := J) (ell := ell) (I := I) steps) : ((physicalMixedBigSteps steps L pl).map (physicalMixedSmallRowFactor H 1 1)).prod = (steps.map (physicalMixedSmallRowFactor H 1 1)).prod := by have h := congrArg (fun ks : List (Option (V ⊕ K)) => (ks.map (physicalMixedSmallRowFactor H 1 1)).prod) (physical_mixed_big_steps_tags steps L pl) rw [List.map_map] at h convert h using 2 apply List.map_congr_left intro tag _ cases tag with | none => rfl | some tag => cases tag <;> rfl end Bounty end -- Source module: PhysicalRootForestResidualEnvelope section /- An envelope H is paid exactly n+1 times in the original root residual. All small-group factors remain in the original mixed path weight. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (ρ : ℝ) (H : ℝ) (hH : 0 ≤ H) (hK : ∀ time < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K time i L R a‖ ≤ H) include hH hK in theorem physical_root_effective_forest_residual_norm_le_envelope : ∀ pl x path, ‖physicalRootEffectiveForestResidual (n := n) (B := B) groups e patterns C hC k pl V ζ K θ β ρ x path‖ ≤ H ^ (n + 1) := by intro pl x path let Cb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => fun g => C key.2.1.val (e.symm g).val let kb := fun key : PhysicalMixedBigKey (Ps := fun s : ↥groupsᶜ => P s.val) (J := J) (ell := ell) (I := patterns) (K := Fin (n + 1)) => k (n - key.1.val) key.2.1.val * (physicalSharedProduct (physicalSharedPrefix key.2.2.1) : ℕ) let steps := physicalMixedBigSteps ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) pl.1 pl.2 let sizes := fun g (p : P (e.symm g).val) => p.val let shared := fun key g => physicalFullSharedIndices (ell := ell) (Cb key g) let aux := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) => PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key) let delta := fun key => physicalFullEdgeDelta (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) (kb key) let displacement := fun key => physicalFullEdgeD (P := fun g => P (e.symm g).val) (ell := ell) (Cb key) let omega := fun key (_ : SharedActiveLabels (fun g => ↥(P (e.symm g).val)) (shared key)) (a : PhysicalAuxLabels (fun g => P (e.symm g).val) (Cb key)) => physicalAuxMass (fun g => V (e.symm g).val) (Cb key) a have hphase : ∀ key y ev, ‖physicalFullCombinedEdgePhase (B := B) Cb kb omega β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) key (fun _ => ∅) y ev‖ ≤ H := by intro key y ev exact physical_full_combined_edge_phase_norm_le_envelope Cb kb omega β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ) H hH (physical_root_key_coefficient_norm_le_envelope groups e patterns C hC ζ k K θ H hK) key (fun _ => ∅) y ev have h := full_mixed_common_residual_path_norm_le_envelope sizes shared B aux delta displacement (physicalFullCombinedEdgePhase (B := B) Cb kb omega β ρ (fun g => V (e.symm g).val) (fun _ => 0) (physicalRootKeyCoefficient groups e patterns C hC ζ k K θ)) H hH hphase steps x path have hp : (steps.map (physicalMixedSmallRowFactor H 1 1)).prod = H ^ (n + 1) := by dsimp only [steps] rw [physical_mixed_planned_envelope_product, physical_selected_small_row_product] simp only [pow_one, Nat.cast_one, mul_one] exact h.trans_eq hp variable (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) include hH hK in theorem physical_root_forest_residual_norm_le_envelope : ∀ s path, ‖physicalRootForestResidual (n := n) (B := B) groups e patterns C hC k V ζ K θ β ρ hPs hPb hdis s path‖ ≤ H ^ (n + 1) := by intro s path unfold physicalRootForestResidual exact physical_root_effective_forest_residual_norm_le_envelope groups e patterns C hC k V ζ K θ β ρ H hH hK _ _ _ end Root end Bounty end -- Source module: PhysicalRootForestEnvelopeRankBound section /- Full rank decay for the original root action with a uniform coefficient envelope H. Its cost is paid once per actual edge. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_root_forest_envelope_rank_bound {qmax vs : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (I : Type) (N M J n B : ℕ) (P : Fin N → Finset ℕ) (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ z : PhysicalPrime P, NeZero z.2.val] [∀ g (p : P (e.symm g).val), NeZero p.val] (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ), (∀ s : ↥groupsᶜ, vs ≤ V s.val) → Real.sqrt q ≤ qmax → ∀ (_i0 : patterns) (v vmin : ℝ) (η : Fin M → ℝ) (τ : ℝ) (T : ℕ), (∀ g, ∑ p ∈ P (e.symm g).val, 1 / (p : ℝ) = V (e.symm g).val) → (∀ g p, 0 ≤ β g p / V (e.symm g).val) → (∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) → (∀ g, 0 ≤ η g) → (∀ g p, β g p / V (e.symm g).val ≤ η g) → (∀ j g, (|(1 - retention j) * V (e.symm g).val / ρ| * η g) * v ≤ τ) → (∀ g, η g ≤ τ) → (∀ j, 0 ≤ retention j) → (∀ j, retention j ≤ 1) → 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V (e.symm g).val) → (∀ j, retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) → (∀ (i : patterns) g, (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) → 0 ≤ τ → ∀ (H : ℝ), 1 ≤ H → ∀ (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ), (∀ time < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K time i L R a‖ ≤ H) → (∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) → (∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) → (∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) → ∀ (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)), (∀ i, fullMixedCommonIndexStage (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) i = 0 → code i = none) → ∀ (r : PhysicalGroupResidues P groupsᶜ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ), (∀ y, ‖f y‖ ≤ 1) → ‖physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code f L x‖ ≤ τ ^ birthForestRank code * (((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))).map (physicalMixedSmallRowFactor A groupsᶜ.card patterns.card)).prod * (((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))).map (fullMixedLengthRowFactor (fun g p => β g p / V (e.symm g).val) retention ρ v vmin (fun g => V (e.symm g).val) T)).prod * (H ^ (n + 1) * productLengthLyapunov v x) := by obtain ⟨A, hA, hbound⟩ := exists_physical_root_scaled_history_integral_bound hqmax0 hqmax1 hvs ell refine ⟨A, hA, ?_⟩ intro I N M J n B P groups e _ _ patterns C hC k V q β retention ρ hVs hq i0 v vmin η τ T hMass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hτ H hH ζ K θ hK hPs hPb hdis code hcode r L x f hf apply (physical_root_mixed_forest_norm_le_history_integral groups e patterns C hC k V q ζ K r θ β retention ρ hPs hPb hdis code hcode f L x).trans apply hbound I N M J n B P groups e patterns C k V q β retention ρ hVs hq i0 v vmin η τ T hMass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hτ code hcode · exact pow_nonneg (zero_le_one.trans hH) _ · intro path simpa only [mul_one] using mul_le_mul (physical_root_forest_residual_norm_le_envelope groups e patterns C hC k V ζ K θ β ρ H (zero_le_one.trans hH) hK hPs hPb hdis _ path) (hf _) (norm_nonneg _) (pow_nonneg (zero_le_one.trans hH) (n + 1)) end Bounty end -- Source module: PhysicalRootForestInitialZero section /- An initial child link cannot occur in a compatible forest when the original initial active labels are injective. -/ open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : PhysicalGroupResidues P groupsᶜ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) theorem physical_root_mixed_forest_eq_zero_of_initial_child (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (hbad : ¬ ∀ i, fullMixedCommonIndexStage (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) i = 0 → code i = none) (f : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (x : PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B) (hx : FullActiveInjective x) : physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code f L x = 0 := by unfold physicalRootMixedForestAction apply Finset.sum_eq_zero intro sp _ unfold physicalRootCommonForestAction physicalRootEffectiveForestAction birthForestPathSum dsimp only apply Finset.sum_eq_zero intro path _ apply if_neg intro hc apply hbad apply (physical_mixed_plan_initial_condition_iff (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) L sp code).mp exact full_mixed_common_compatible_initial_child_none (fun g (p : P (e.symm g).val) => p.val) _ B _ _ _ _ x path hx _ hc end Root end Bounty end -- Source module: PhysicalRootHistoryBoundary section /- The original empty-memory boundary contributes no length factor. -/ open Finset open scoped Classical namespace Bounty theorem full_memory_vacuum_norm_le_one {G : Type*} {P Z : G → Type*} {M : G → ℕ} {B : ℕ} (s : ProductBoundedOrderedState P Z M B) : ‖fullMemoryVacuum s‖ ≤ 1 := by unfold fullMemoryVacuum split <;> simp theorem physical_full_empty_length_lyapunov {G : Type*} [Fintype G] {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (C : G → Finset (Fin J)) (L : PhysicalMarkLists P J ell) (v : ℝ) : productLengthLyapunov v (physicalFullMemoryState C L (fun g => fullEmptyBoundedMemory (Z g) B)) = 1 := by apply productLengthLyapunov_empty simp only [physical_full_memory_state_total, fullEmptyBoundedMemory, sum_const_zero] end Bounty end -- Source module: PhysicalRootEmptyForestEnvelope section /- Every original root forest at empty memory with a coefficient envelope. The restored H^(n+1) cost does not alter the full rank decay. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_root_empty_forest_envelope_rank_bound {qmax vs : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (I : Type) (N M J n B : ℕ) (P : Fin N → Finset ℕ) (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ z : PhysicalPrime P, NeZero z.2.val] (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ), (∀ s : ↥groupsᶜ, vs ≤ V s.val) → Real.sqrt q ≤ qmax → ∀ (_i0 : patterns) (v vmin : ℝ) (η : Fin M → ℝ) (τ : ℝ) (T : ℕ), (∀ g, ∑ p ∈ P (e.symm g).val, 1 / (p : ℝ) = V (e.symm g).val) → (∀ g p, 0 ≤ β g p / V (e.symm g).val) → (∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) → (∀ g, 0 ≤ η g) → (∀ g p, β g p / V (e.symm g).val ≤ η g) → (∀ j g, (|(1 - retention j) * V (e.symm g).val / ρ| * η g) * v ≤ τ) → (∀ g, η g ≤ τ) → (∀ j, 0 ≤ retention j) → (∀ j, retention j ≤ 1) → 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V (e.symm g).val) → (∀ j, retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) → (∀ (i : patterns) g, (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) → 0 ≤ τ → ∀ (H : ℝ), 1 ≤ H → ∀ (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ), (∀ time < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K time i L R a‖ ≤ H) → (∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) → (∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) → (∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) → ∀ (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)), ∀ (r : PhysicalGroupResidues P groupsᶜ) (L : PhysicalMarkLists (fun s : ↥groupsᶜ => P s.val) J ell) (Lb : PhysicalMarkLists (fun g => P (e.symm g).val) J ell), ‖physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code fullMemoryVacuum L (physicalFullMemoryState (fun _ : Fin M => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun p : P (e.symm g).val => p.val)) B))‖ ≤ τ ^ birthForestRank code * (A ^ groupsᶜ.card * (patterns.card : ℝ)) ^ (n + 1) * (((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))).map (fullMixedLengthRowFactor (fun g p => β g p / V (e.symm g).val) retention ρ v vmin (fun g => V (e.symm g).val) T)).prod * H ^ (n + 1) := by obtain ⟨A, hA, hbound⟩ := exists_physical_root_forest_envelope_rank_bound hqmax0 hqmax1 hvs ell refine ⟨A, hA, ?_⟩ intro I N M J n B P groups e _ patterns C hC k V q β retention ρ hVs hq i0 v vmin η τ T hMass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hτ H hH ζ K θ hK hPs hPb hdis code r L Lb by_cases hcode : ∀ i, fullMixedCommonIndexStage (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))) i = 0 → code i = none · have h := @hbound I N M J n B P groups e inferInstance (fun g p => inferInstanceAs (NeZero (⟨(e.symm g).val, p⟩ : PhysicalPrime P).2.val)) patterns C hC k V q β retention ρ hVs hq i0 v vmin η τ T hMass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hτ H hH ζ K θ hK hPs hPb hdis code hcode r L (physicalFullMemoryState (fun _ : Fin M => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun p : P (e.symm g).val => p.val)) B)) fullMemoryVacuum full_memory_vacuum_norm_le_one simpa only [physical_full_empty_length_lyapunov, mul_one, physical_selected_small_row_product] using h · rw [physical_root_mixed_forest_eq_zero_of_initial_child groups e patterns C hC k V q ζ K r θ β retention ρ code hcode fullMemoryVacuum L _ (physical_full_state_injective _ Lb _), norm_zero] apply mul_nonneg · apply mul_nonneg · exact mul_nonneg (pow_nonneg hτ _) (pow_nonneg (mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) (Nat.cast_nonneg _)) _) · apply List.prod_nonneg intro a ha obtain ⟨tag, _, rfl⟩ := List.mem_map.mp ha exact fullMixedLengthRowFactor_nonneg _ _ _ _ _ _ _ hρ1 (zero_lt_one.trans hv).le tag · exact pow_nonneg (zero_le_one.trans hH) _ end Bounty end -- Source module: PhysicalSmallBigBoundedReadout section /- A bound at the actual initial injective marks passes directly to the normalized scalar. This also covers pointwise high-rank forest estimates. -/ open Finset open scoped Classical namespace Bounty section Readout variable {S G : Type*} [Fintype S] [DecidableEq S] [Fintype G] [DecidableEq G] {Ps : S → Finset ℕ} [∀ p : PhysicalPrime Ps, NeZero p.2.val] {P : G → Finset ℕ} {Z : G → Type*} {J ell B : ℕ} (Vs : S → ℝ) (C : G → Finset (Fin J)) (μ : ∀ g, P g → ℝ) (empty : ∀ g, BoundedOrderedTuple (Z g) B) (boundary : PhysicalBareResidueState Ps J ell → ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B → ℂ) (F : PhysicalSmallBigState Ps J ell (ProductBoundedOrderedState (fun g => ↥(P g)) Z (fun _ => J + ell) B) → ℂ) theorem physical_small_big_initial_readout_of_pointwise_bound (hVs : ∀ s, 0 < Vs s) (hMass : ∀ s, ∑ p ∈ Ps s, 1 / (p : ℝ) = Vs s) (hμ : ∀ g p, 0 ≤ μ g p) {bound : ℝ} (hbound : 0 ≤ bound) (hF : ∀ s L, ‖boundary s (physicalFullMemoryState C L empty) * F (s, physicalFullMemoryState C L empty)‖ ≤ bound) : ‖physicalSmallBigInitialReadout Vs C μ empty boundary F‖ ≤ bound * ∏ g, (∑ p, μ g p) ^ (J + ell) := by let mass := ∏ g, (∑ p, μ g p) ^ (J + ell) have hm : 0 ≤ mass := prod_nonneg fun g _ => pow_nonneg (sum_nonneg fun p _ => hμ g p) _ have hb (s : PhysicalBareResidueState Ps J ell) : ‖∑ L : PhysicalMarkLists P J ell, ((∏ g, ∏ i : PhysicalSlots J ell, μ g (L g i) : ℝ) : ℂ) * (boundary s (physicalFullMemoryState C L empty) * F (s, physicalFullMemoryState C L empty))‖ ≤ bound * mass := by calc _ ≤ ∑ L : PhysicalMarkLists P J ell, (∏ g, ∏ i : PhysicalSlots J ell, μ g (L g i)) * bound := by apply (norm_sum_le _ _).trans apply sum_le_sum intro L _ have hw : 0 ≤ ∏ g, ∏ i : PhysicalSlots J ell, μ g (L g i) := prod_nonneg fun g _ => prod_nonneg fun i _ => hμ g (L g i) rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hw] exact mul_le_mul_of_nonneg_left (hF s L) hw _ = bound * physicalMarkMass (J := J) (ell := ell) μ := by rw [← sum_mul] exact mul_comm _ _ _ ≤ bound * mass := mul_le_mul_of_nonneg_left (physical_mark_mass_le μ hμ) hbound unfold physicalSmallBigInitialReadout calc _ ≤ ∑ s : PhysicalBareResidueState Ps J ell, physicalResidueInitialMass Vs s * (bound * mass) := by apply (norm_sum_le _ _).trans apply sum_le_sum intro s _ have hs := physical_residue_initial_mass_nonneg Vs hVs s rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hs] exact mul_le_mul_of_nonneg_left (hb s) hs _ = (∑ s : PhysicalBareResidueState Ps J ell, physicalResidueInitialMass Vs s) * (bound * mass) := (sum_mul _ _ _).symm _ ≤ 1 * (bound * mass) := mul_le_mul_of_nonneg_right (physical_residue_initial_mass_total Vs hVs hMass) (mul_nonneg hbound hm) _ = bound * mass := one_mul _ end Readout end Bounty end -- Source module: PhysicalRootBoundedInitial section /- The original weighted scalar, including the full small-residue average, is a normalized initial readout whenever the integrand has its true support. -/ open Finset open scoped Classical namespace Bounty section Scalar variable {N M J ell B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (V : Fin N → ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] theorem physical_root_initial_scalar_of_pointwise_bound (hVs : ∀ s : ↥groupsᶜ, 0 < V s.val) (hMass : ∀ s : ↥groupsᶜ, ∑ p ∈ P s.val, 1 / (p : ℝ) = V s.val) (hμ : ∀ g p, 0 ≤ β g p / V (e.symm g).val) (boundary : PhysicalBareResidueState (fun s : ↥groupsᶜ => P s.val) J ell → PhysicalFullBoundedState (fun g => P (e.symm g).val) J ell B → ℂ) (F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ) (hF : ∀ r L x, ¬ physicalResidueMarksValid r L → F ((r, L), x) = 0) {bound : ℝ} (hbound : 0 ≤ bound) (hpoint : ∀ s L, ‖boundary s (physicalFullMemoryState (fun _ : Fin M => ∅) L (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B)) * F (s, physicalFullMemoryState (fun _ : Fin M => ∅) L (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B))‖ ≤ bound) : ‖physicalRootInitialScalar groups e V β (fun r L x => boundary (physicalGroupResidueVector r, L) x * F ((physicalGroupResidueVector r, L), x))‖ ≤ bound * ∏ g, (∑ p, β g p / V (e.symm g).val) ^ (J + ell) := by rw [physical_root_initial_scalar_eq_readout groups e V β boundary F hF] exact physical_small_big_initial_readout_of_pointwise_bound (fun s : ↥groupsᶜ => V s.val) (fun _ : Fin M => ∅) (fun g p => β g p / V (e.symm g).val) _ boundary F hVs hMass hμ hbound hpoint end Scalar end Bounty end -- Source module: PhysicalRootForestPointwise section /- The actual local root Fourier word is the exact sum over its original planned big actions, with every small factor and coefficient retained. -/ open Finset MeasureTheory open scoped Classical namespace Bounty section Root variable {I : Type} {N M J ell n B : ℕ} {P : Fin N → Finset ℕ} [∀ z : PhysicalPrime P, NeZero z.2.val] (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ) (hPs : ∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) (hdis : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) variable (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ) variable [∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val] include hPs hPb hdis in theorem physical_root_forest_contribution_of_pointwise_bound (hinj : Function.Injective encode) (hVs : ∀ s : ↥groupsᶜ, 0 < V s.val) (hMass : ∀ s : ↥groupsᶜ, ∑ p ∈ P s.val, 1 / (p : ℝ) = V s.val) (hμ : ∀ g p, 0 ≤ β g p / V (e.symm g).val) {bound : ℝ} (hbound : 0 ≤ bound) (hpoint : ∀ r Ls Lb, ‖physicalRootMixedForestAction groups e patterns C hC k V q ζ K r θ β retention ρ code fullMemoryVacuum Ls (physicalFullMemoryState (fun _ : Fin M => ∅) Lb (fun g => fullEmptyBoundedMemory (UnrestrictedResidueParticle (fun z : P (e.symm g).val => z.val)) B))‖ ≤ bound) : ‖physicalRootForestContribution groups e patterns C hC k V q ζ K θ β retention ρ code‖ ≤ bound * ∏ g, (∑ p, β g p / V (e.symm g).val) ^ (J + ell) := by let F : PhysicalRootMixedState (P := P) (J := J) (ell := ell) (B := B) groups e → ℂ := fun s => physicalRootMixedForestAction groups e patterns C hC k V q ζ K ((physicalGroupResidueVectorEquiv P groupsᶜ).symm s.1.1) θ β retention ρ code fullMemoryVacuum s.1.2 s.2 have hF : ∀ r L x, ¬ physicalResidueMarksValid r L → F ((r, L), x) = 0 := by intro r L x hr have hv : physicalGroupResidueVector ((physicalGroupResidueVectorEquiv P groupsᶜ).symm r) = r := (physicalGroupResidueVectorEquiv P groupsᶜ).apply_symm_apply r exact physical_root_mixed_forest_invalid groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode hinj fullMemoryVacuum ((physicalGroupResidueVectorEquiv P groupsᶜ).symm r) L x (by simpa only [hv] using hr) have h := physical_root_initial_scalar_of_pointwise_bound groups e V β hVs hMass hμ (fun _ _ => 1) F hF hbound (fun s L => by simpa only [one_mul] using hpoint ((physicalGroupResidueVectorEquiv P groupsᶜ).symm s.1) s.2 L) have hr (r : PhysicalGroupResidues P groupsᶜ) : (physicalGroupResidueVectorEquiv P groupsᶜ).symm (physicalGroupResidueVector r) = r := (physicalGroupResidueVectorEquiv P groupsᶜ).symm_apply_apply r simpa only [physicalRootForestContribution, F, one_mul, hr] using h end Root end Bounty end -- Source module: PhysicalRootHighRankContribution section /- The exact empty-memory high-rank estimate transfers to the original normalized forest contribution with only its initial big-state mass. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_root_high_rank_contribution_bound {qmax vs : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (I : Type) (N M J n B : ℕ) (P : Fin N → Finset ℕ) (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ z : PhysicalPrime P, NeZero z.2.val] (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ), (∀ s : ↥groupsᶜ, vs ≤ V s.val) → Real.sqrt q ≤ qmax → ∀ (_i0 : patterns) (v vmin : ℝ) (η : Fin M → ℝ) (τ : ℝ) (T : ℕ), (∀ g, ∑ p ∈ P (e.symm g).val, 1 / (p : ℝ) = V (e.symm g).val) → (∀ g p, 0 ≤ β g p / V (e.symm g).val) → (∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) → (∀ g, 0 ≤ η g) → (∀ g p, β g p / V (e.symm g).val ≤ η g) → (∀ j g, (|(1 - retention j) * V (e.symm g).val / ρ| * η g) * v ≤ τ) → (∀ g, η g ≤ τ) → (∀ j, 0 ≤ retention j) → (∀ j, retention j ≤ 1) → 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V (e.symm g).val) → (∀ j, retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) → (∀ (i : patterns) g, (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) → 0 ≤ τ → ∀ (H : ℝ), 1 ≤ H → ∀ (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ), (∀ time < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K time i L R a‖ ≤ H) → (∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) → (∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) → (∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) → (∀ s : ↥groupsᶜ, ∑ p ∈ P s.val, 1 / (p : ℝ) = V s.val) → ∀ (encode : ((g : Fin M) × P (e.symm g).val) → ℤ), Function.Injective encode → ∀ (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)), ‖physicalRootForestContribution groups e patterns C hC k V q ζ K θ β retention ρ code‖ ≤ (τ ^ birthForestRank code * (A ^ groupsᶜ.card * (patterns.card : ℝ)) ^ (n + 1) * (((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))).map (fullMixedLengthRowFactor (fun g p => β g p / V (e.symm g).val) retention ρ v vmin (fun g => V (e.symm g).val) T)).prod * H ^ (n + 1)) * ∏ g, (∑ p, β g p / V (e.symm g).val) ^ (J + ell) := by obtain ⟨A, hA, hbound⟩ := exists_physical_root_empty_forest_envelope_rank_bound hqmax0 hqmax1 hvs ell refine ⟨A, hA, ?_⟩ intro I N M J n B P groups e _ patterns C hC k V q β retention ρ hVs hq i0 v vmin η τ T hMass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hτ H hH ζ K θ hK hPs hPb hdis hSmallMass encode hinj code let : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inferInstanceAs (NeZero (⟨z.1.val, z.2⟩ : PhysicalPrime P).2.val) have hpoint := @hbound I N M J n B P groups e inferInstance patterns C hC k V q β retention ρ hVs hq i0 v vmin η τ T hMass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hτ H hH ζ K θ hK hPs hPb hdis code apply physical_root_forest_contribution_of_pointwise_bound groups e patterns C hC k V q ζ K θ β retention ρ hPs hPb hdis code encode hinj (fun s => hvs.trans_le (hVs s)) hSmallMass hμ _ hpoint apply mul_nonneg · apply mul_nonneg · exact mul_nonneg (pow_nonneg hτ _) (pow_nonneg (mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) (Nat.cast_nonneg _)) _) · apply List.prod_nonneg intro a ha obtain ⟨tag, _, rfl⟩ := List.mem_map.mp ha exact fullMixedLengthRowFactor_nonneg _ _ _ _ _ _ _ hρ1 (zero_lt_one.trans hv).le tag · exact pow_nonneg (zero_le_one.trans hH) _ end Bounty end -- Source module: RootHighRankRowProduct section /- Uniform fixed-base bounds for the exact big-state row product retained by the original high-rank forest estimate. -/ open Finset namespace Bounty theorem full_mixed_length_row_factor_le_uniform {J K G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin vmax : ℝ) (V : G → ℝ) (T : ℕ) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (hq0 : ∀ j, 0 ≤ q j) (hq1 : ∀ j, q j ≤ 1) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 0 ≤ v) (hV0 : ∀ g, 0 ≤ V g) (hVmax : ∀ g, V g ≤ vmax) {A : ℝ} (hA : 1 ≤ A) (hghost : Real.exp (2 * vmax * v / ρ) ≤ A) (hedge : unrestrictedEdgeRowBound ρ v vmin T ≤ A) (tag : Option (J ⊕ K)) : fullMixedLengthRowFactor μ q ρ v vmin V T tag ≤ A ^ Fintype.card G := by cases tag with | none => exact one_le_pow₀ hA | some tag => cases tag with | inl j => change (∏ g, Real.exp ((|(1 - q j) * V g / ρ| * ∑ p, μ g p) * v)) ≤ _ calc _ ≤ ∏ _g : G, A := by apply prod_le_prod₀ (fun _ _ => (Real.exp_pos _).le) intro g _ apply le_trans (Real.exp_le_exp.mpr ?_) hghost have hbase0 : 0 ≤ (1 - q j) * V g / ρ := div_nonneg (mul_nonneg (sub_nonneg.mpr (hq1 j)) (hV0 g)) hρ0.le have hbase : |(1 - q j) * V g / ρ| ≤ vmax / ρ := by rw [abs_of_nonneg hbase0] apply div_le_div_of_nonneg_right _ hρ0.le calc (1 - q j) * V g ≤ 1 * V g := mul_le_mul_of_nonneg_right (by linarith [hq0 j]) (hV0 g) _ ≤ vmax := by simpa only [one_mul] using hVmax g calc _ ≤ (|(1 - q j) * V g / ρ| * 2) * v := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hmass g) (abs_nonneg _)) hv _ ≤ ((vmax / ρ) * 2) * v := by gcongr _ = _ := by ring _ = A ^ Fintype.card G := by simp | inr k => exact pow_le_pow_left₀ (unrestricted_edge_row_bound_nonneg hρ1 hv T) hedge _ theorem full_mixed_length_row_product_le_uniform {J K G : Type*} [Fintype G] {P : G → Type*} [∀ g, Fintype (P g)] (μ : ∀ g, P g → ℝ) (q : J → ℝ) (ρ v vmin vmax : ℝ) (V : G → ℝ) (T : ℕ) (hmass : ∀ g, ∑ p, μ g p ≤ 2) (hq0 : ∀ j, 0 ≤ q j) (hq1 : ∀ j, q j ≤ 1) (hρ0 : 0 < ρ) (hρ1 : ρ < 1) (hv : 0 ≤ v) (hV0 : ∀ g, 0 ≤ V g) (hVmax : ∀ g, V g ≤ vmax) {A : ℝ} (hA : 1 ≤ A) (hghost : Real.exp (2 * vmax * v / ρ) ≤ A) (hedge : unrestrictedEdgeRowBound ρ v vmin T ≤ A) (steps : List (Option (J ⊕ K))) : (steps.map (fullMixedLengthRowFactor μ q ρ v vmin V T)).prod ≤ (A ^ Fintype.card G) ^ steps.length := by induction steps with | nil => simp | cons tag steps ih => simp only [List.map_cons, List.prod_cons, List.length_cons, pow_succ] rw [mul_comm ((A ^ Fintype.card G) ^ steps.length)] apply mul_le_mul (full_mixed_length_row_factor_le_uniform μ q ρ v vmin vmax V T hmass hq0 hq1 hρ0 hρ1 hv hV0 hVmax hA hghost hedge tag) ih · exact List.prod_nonneg (fun x hx => by obtain ⟨tag, _, rfl⟩ := List.mem_map.mp hx exact fullMixedLengthRowFactor_nonneg μ q ρ v vmin V T hρ1 hv tag) · exact pow_nonneg (zero_le_one.trans hA) _ end Bounty end -- Source module: RootHighRankCostPower section /- Polynomial budgets for the exact high-rank row product and the remaining coefficient and initial-mass factors. -/ namespace Bounty theorem root_high_rank_row_power_le {L C A : ℝ} (M N : ℕ) (hL : 1 ≤ L) (hC : 0 ≤ C) (hA : 1 ≤ A) (hM : (M : ℝ) ≤ C * Real.log L) : (A ^ M) ^ (4 * N + 1) ≤ L ^ ((4 * C * Real.log A) * ((N : ℝ) + 1)) := by have hL0 : 0 < L := zero_lt_one.trans_le hL have hA0 : 0 ≤ A := zero_le_one.trans hA have hb := repeated_big_group_energy_cost_le M hL0 hA0 hM rw [max_eq_right hA] at hb have hlogA : 0 ≤ Real.log A := Real.log_nonneg hA calc _ ≤ (L ^ (C * Real.log A)) ^ (4 * N + 1) := pow_le_pow_left₀ (pow_nonneg hA0 M) hb _ _ = L ^ ((C * Real.log A) * (4 * N + 1 : ℕ)) := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL0.le] _ ≤ _ := by apply Real.rpow_le_rpow_of_exponent_le hL push_cast nlinarith [mul_nonneg hC hlogA] theorem root_high_rank_total_cost_power_le {L C D E coeff rows mass : ℝ} (N : ℕ) (hL : 1 ≤ L) (hC : 0 ≤ C) (hE : 0 ≤ E) (hcoeff0 : 0 ≤ coeff) (hrows0 : 0 ≤ rows) (hmass0 : 0 ≤ mass) (hcoeff : coeff ≤ L ^ C) (hrows : rows ≤ L ^ (D * ((N : ℝ) + 1))) (hmass : mass ≤ L ^ E) : (coeff ^ N * rows) * mass ≤ L ^ ((C + D + E) * ((N : ℝ) + 1)) := by have hL0 : 0 < L := zero_lt_one.trans_le hL calc _ ≤ ((L ^ C) ^ N * L ^ (D * ((N : ℝ) + 1))) * L ^ E := mul_le_mul (mul_le_mul (pow_le_pow_left₀ hcoeff0 hcoeff N) hrows hrows0 (pow_nonneg (Real.rpow_nonneg hL0.le _) N)) hmass hmass0 (mul_nonneg (pow_nonneg (Real.rpow_nonneg hL0.le _) N) (Real.rpow_nonneg hL0.le _)) _ = L ^ (C * N + D * ((N : ℝ) + 1) + E) := by rw [← Real.rpow_natCast, ← Real.rpow_mul hL0.le, ← Real.rpow_add hL0, ← Real.rpow_add hL0] _ ≤ _ := by apply Real.rpow_le_rpow_of_exponent_le hL nlinarith [mul_nonneg hE (Nat.cast_nonneg N : (0 : ℝ) ≤ N)] end Bounty end -- Source module: RootHighRankEnvelopePower section /- The coefficient envelope, row cost, and initial mass share one polynomial budget without changing the rank decay. -/ namespace Bounty theorem root_high_rank_envelope_cost_power_le {L C D E coeff envelope rows mass tau : ℝ} (N rank : ℕ) (hL : 1 ≤ L) (hC : 0 ≤ C) (hE : 0 ≤ E) (hcoeff0 : 0 ≤ coeff) (henvelope0 : 0 ≤ envelope) (hrows0 : 0 ≤ rows) (hmass0 : 0 ≤ mass) (htau : 0 ≤ tau) (hcoeff : coeff * envelope ≤ L ^ C) (hrows : rows ≤ L ^ (D * ((N : ℝ) + 1))) (hmass : mass ≤ L ^ E) : (tau ^ rank * coeff ^ N * rows * envelope ^ N) * mass ≤ L ^ ((C + D + E) * ((N : ℝ) + 1)) * tau ^ rank := by calc _ = (((coeff * envelope) ^ N * rows) * mass) * tau ^ rank := by rw [mul_pow] ring _ ≤ _ := mul_le_mul_of_nonneg_right (root_high_rank_total_cost_power_le N hL hC hE (mul_nonneg hcoeff0 henvelope0) hrows0 hmass0 hcoeff hrows hmass) (pow_nonneg htau rank) end Bounty end -- Source module: PhysicalRootHighRankPower section /- The original high-rank forest contribution has a polynomial prefactor and retains the full rank power of the rare-birth bound. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_root_high_rank_contribution_power_le {qmax vs : ℝ} (hqmax0 : 0 ≤ qmax) (hqmax1 : qmax < 1) (hvs : 0 < vs) (ell : ℕ) : ∃ A : ℝ, 1 ≤ A ∧ ∀ (I : Type) (N M J n B : ℕ) (P : Fin N → Finset ℕ) (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ z : PhysicalPrime P, NeZero z.2.val] (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (q : ℝ) (β : (g : Fin M) → P (e.symm g).val → ℝ) (retention : Fin (n + 2) → ℝ) (ρ : ℝ), (∀ s : ↥groupsᶜ, vs ≤ V s.val) → Real.sqrt q ≤ qmax → ∀ (_i0 : patterns) (v vmin : ℝ) (η : Fin M → ℝ) (τ : ℝ) (T : ℕ), (∀ g, ∑ p ∈ P (e.symm g).val, 1 / (p : ℝ) = V (e.symm g).val) → (∀ g p, 0 ≤ β g p / V (e.symm g).val) → (∀ g, ∑ p, β g p / V (e.symm g).val ≤ 2) → (∀ g, 0 ≤ η g) → (∀ g p, β g p / V (e.symm g).val ≤ η g) → (∀ j g, (|(1 - retention j) * V (e.symm g).val / ρ| * η g) * v ≤ τ) → (∀ g, η g ≤ τ) → (∀ j, 0 ≤ retention j) → (∀ j, retention j ≤ 1) → 0 < ρ → ρ < 1 → 1 < v → 0 < vmin → (∀ g, vmin ≤ V (e.symm g).val) → (∀ j, retention j / ρ ^ 2 + ((1 - retention j) / ρ) / v ≤ 1) → (∀ (i : patterns) g, (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) → 0 ≤ τ → ∀ (H : ℝ), 1 ≤ H → ∀ (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (θ : ℝ), (∀ time < n + 1, ∀ i ∈ patterns, ∀ L R a, ‖K time i L R a‖ ≤ H) → (∀ (s : ↥groupsᶜ) p, p ∈ P s.val → Nat.Prime p) → (∀ (g : Fin M) p, p ∈ P (e.symm g).val → Nat.Prime p) → (∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val)) → (∀ s : ↥groupsᶜ, ∑ p ∈ P s.val, 1 / (p : ℝ) = V s.val) → ∀ (encode : ((g : Fin M) × P (e.symm g).val) → ℤ), Function.Injective encode → ∀ (L Cgroup Ccoeff Ch Arow vmax : ℝ), 1 ≤ L → 0 ≤ Cgroup → 0 ≤ Ccoeff → 0 ≤ Ch → 1 ≤ Arow → Real.exp (2 * vmax * v / ρ) ≤ Arow → unrestrictedEdgeRowBound ρ v vmin T ≤ Arow → (∀ g : Fin M, V (e.symm g).val ≤ vmax) → (M : ℝ) ≤ Cgroup * Real.log L → (A ^ groupsᶜ.card * (patterns.card : ℝ)) * H ≤ L ^ Ccoeff → (∏ g, (∑ p, β g p / V (e.symm g).val) ^ (J + ell)) ≤ L ^ Ch → ∀ (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B)), ‖physicalRootForestContribution groups e patterns C hC k V q ζ K θ β retention ρ code‖ ≤ L ^ ((Ccoeff + 4 * Cgroup * Real.log Arow + Ch) * (((n + 1 : ℕ) : ℝ) + 1)) * τ ^ birthForestRank code := by obtain ⟨A, hA, hbound⟩ := exists_physical_root_high_rank_contribution_bound hqmax0 hqmax1 hvs ell refine ⟨A, hA, ?_⟩ intro I N M J n B P groups e _ patterns C hC k V q β retention ρ hVs hq i0 v vmin η τ T hMass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hτ H hH ζ K θ hK hPs hPb hdis hSmallMass encode hinj L Cgroup Ccoeff Ch Arow vmax hL hCgroup hCcoeff hCh hArow hrowghost hrowedge hVmax hM hcoeff hInitial code let steps := (List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)) let rows := (steps.map (fullMixedLengthRowFactor (fun g p => β g p / V (e.symm g).val) retention ρ v vmin (fun g => V (e.symm g).val) T)).prod have hrows0 : 0 ≤ rows := by apply List.prod_nonneg intro a ha obtain ⟨tag, _, rfl⟩ := List.mem_map.mp ha exact fullMixedLengthRowFactor_nonneg _ _ _ _ _ _ _ hρ1 (zero_lt_one.trans hv).le tag have hrow1 : rows ≤ (Arow ^ M) ^ (4 * (n + 1) + 1) := by have hh := full_mixed_length_row_product_le_uniform (fun g p => β g p / V (e.symm g).val) retention ρ v vmin vmax (fun g => V (e.symm g).val) T hmass hq0 hq1 hρ0 hρ1 (zero_lt_one.trans hv).le (fun g => (hvmin.trans_le (hV g)).le) hVmax hArow hrowghost hrowedge steps simpa only [steps, List.length_map, List.length_range, Fintype.card_fin] using hh have hrows := hrow1.trans (root_high_rank_row_power_le M (n + 1) hL hCgroup hArow hM) have hcost := root_high_rank_envelope_cost_power_le (n + 1) (birthForestRank code) hL hCcoeff hCh (mul_nonneg (pow_nonneg (zero_le_one.trans hA) _) (Nat.cast_nonneg _)) (zero_le_one.trans hH) hrows0 (prod_nonneg (fun g _ => pow_nonneg (sum_nonneg (fun p _ => hμ g p)) _)) hτ hcoeff hrows hInitial exact (@hbound I N M J n B P groups e inferInstance patterns C hC k V q β retention ρ hVs hq i0 v vmin η τ T hMass hμ hmass hη hμatom hghost hedge hq0 hq1 hρ0 hρ1 hv hvmin hV hD ht hτ H hH ζ K θ hK hPs hPb hdis hSmallMass encode hinj code).trans hcost end Bounty end -- Source module: RootPrimePatternPower section /- The literal pattern count and high-rank coefficient prefactor have fixed polynomial costs for logarithmically many root groups. -/ open Finset open scoped Classical namespace Bounty theorem repeated_big_prime_pattern_card_power {G : Type*} [Fintype G] [DecidableEq G] {J ell m : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (hp : ∀ g, (probes g).card ≤ m) {L a : ℝ} (hL : 2 ≤ L) (ha : 0 ≤ a) (hgroups : (Fintype.card G : ℝ) ≤ a * Real.log L) : (Fintype.card (RepeatedBigPrimePatternIndex (ell := ell) probes r t) : ℝ) ≤ L ^ ((m : ℝ) * a * Real.log 2 + 1) := by have hL0 : 0 < L := by linarith have hL1 : 1 ≤ L := by linarith have hcard : Fintype.card (RepeatedBigPrimePatternIndex (ell := ell) probes r t) ≤ 1 + 2 ^ (m * Fintype.card G) := by simpa only [RepeatedBigPrimePatternIndex, Fintype.card_sum, Fintype.card_unit] using Nat.add_le_add_left (repeated_big_prime_pattern_pair_card_le_groups (ell := ell) probes r t hrt hp) 1 have hcardR : (Fintype.card (RepeatedBigPrimePatternIndex (ell := ell) probes r t) : ℝ) ≤ 1 + (2 : ℝ) ^ (m * Fintype.card G) := by exact_mod_cast hcard have hpow := repeated_big_log_count_pow_le (L := L) (a := a) (b := 2) m (Fintype.card G) hL0 (by norm_num) hgroups have he : 0 ≤ (m : ℝ) * a * Real.log 2 := by positivity have hone : 1 ≤ L ^ ((m : ℝ) * a * Real.log 2) := Real.one_le_rpow hL1 he calc _ ≤ 1 + L ^ ((m : ℝ) * a * Real.log 2) := hcardR.trans (add_le_add (le_refl _) hpow) _ ≤ 2 * L ^ ((m : ℝ) * a * Real.log 2) := by linarith _ ≤ L * L ^ ((m : ℝ) * a * Real.log 2) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = _ := by rw [mul_comm, ← Real.rpow_add_one hL0.ne'] theorem root_prime_high_rank_coefficient_power {G : Type*} [Fintype G] [DecidableEq G] {J ell m : ℕ} (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (hp : ∀ g, (probes g).card ≤ m) (small : ℕ) {L a A H C : ℝ} (hL : 2 ≤ L) (ha : 0 ≤ a) (hA : 1 ≤ A) (hH0 : 0 ≤ H) (hgroups : (Fintype.card G : ℝ) ≤ a * Real.log L) (hsmall : (small : ℝ) ≤ a * Real.log L) (hH : H ≤ L ^ C) : (A ^ small * (Fintype.card (RepeatedBigPrimePatternIndex (ell := ell) probes r t) : ℝ)) * H ≤ L ^ (a * Real.log A + ((m : ℝ) * a * Real.log 2 + 1) + C) := by have hL0 : 0 < L := by linarith have hbase := repeated_big_group_energy_cost_le small hL0 (zero_le_one.trans hA) hsmall rw [max_eq_right hA] at hbase have hpatterns := repeated_big_prime_pattern_card_power (ell := ell) probes r t hrt hp hL ha hgroups calc _ ≤ (L ^ (a * Real.log A) * L ^ ((m : ℝ) * a * Real.log 2 + 1)) * L ^ C := mul_le_mul (mul_le_mul hbase hpatterns (Nat.cast_nonneg _) (Real.rpow_nonneg hL0.le _)) hH hH0 (mul_nonneg (Real.rpow_nonneg hL0.le _) (Real.rpow_nonneg hL0.le _)) _ = _ := by rw [← Real.rpow_add hL0, ← Real.rpow_add hL0] end Bounty end -- Source module: PhysicalRootPrimeUniform section /- A single positive envelope bounds every literal alternating prime kernel, including the even-time adjoint. -/ open Finset open scoped Classical namespace Bounty theorem repeated_big_family_envelope_ge_one (s m Q : ℕ) (ξ : ℝ) : 1 ≤ repeatedBigFamilyEnvelope s m Q ξ := by unfold repeatedBigFamilyEnvelope have h : 0 ≤ (2 : ℝ) ^ (m * s) * (((Q * Q : ℕ) : ℝ) / ξ) ^ 2 := by positivity linarith theorem physical_root_alternating_prime_kernel_norm_le_family {G : Type*} [Fintype G] [DecidableEq G] {J ell : ℕ} (P : G → Finset ℕ) (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (hξ : 0 < ξ) (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (L R : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (repeatedBigPrimePatternCut probes r t i)) : ‖if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i R L aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ i L R aux‖ ≤ repeatedBigFamilyEnvelope (Fintype.card G) J Q ξ := by have hsum : repeatedBigPrimePatternBound probes r t Q ξ i ≤ repeatedBigFamilyEnvelope (Fintype.card G) J Q ξ := by apply le_trans (single_le_sum (fun j _ => repeated_big_prime_pattern_bound_nonneg probes r t Q ξ j) (mem_univ i)) exact repeated_big_prime_pattern_bound_sum_le_envelope probes r t hrt Q ξ split_ifs · simpa only [starRingEnd_apply, norm_star] using (physical_root_prime_kernel_norm_le P V probes r t hrt Q h ξ hξ i R L aux).trans hsum · exact (physical_root_prime_kernel_norm_le P V probes r t hrt Q h ξ hξ i L R aux).trans hsum end Bounty end -- Source module: PhysicalGroupResidueProducts section /- Reindexing physical groups preserves the exact product of local residue averages. -/ open Finset open scoped Classical namespace Bounty theorem physical_pool_expectation_group_reindex {G H : Type*} [Fintype G] [Fintype H] [DecidableEq G] [DecidableEq H] (e : G ≃ H) (P : G → Finset ℕ) (J ell : ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] [∀ p : PhysicalPrime (fun h => P (e.symm h)), NeZero p.2.val] (visits : Finset ℕ) (L : ℕ → PhysicalMarkLists P J ell) (offset : ℕ → ℤ) (η : ℕ → ℝ) : poolPathResidueExpectation (fun v : PhysicalPrime (fun h => P (e.symm h)) => v.2.val) univ visits (fun v => visits.filter (fun j => v ∈ physicalMarkedPrimes (physicalMarkGroupReindex e P J ell (L j)))) (fun v j => -(offset j : ZMod v.2.val)) η = poolPathResidueExpectation (fun v : PhysicalPrime P => v.2.val) univ visits (fun v => visits.filter (fun j => v ∈ physicalMarkedPrimes (L j))) (fun v j => -(offset j : ZMod v.2.val)) η := by let : ∀ (g : G) (p : P g), NeZero p.val := fun g p => inferInstanceAs (NeZero (⟨g, p⟩ : PhysicalPrime P).2.val) unfold poolPathResidueExpectation simp only [Fintype.prod_sigma, mem_physical_marked_primes] exact Equiv.prod_comp e.symm (fun g : G => ∏ p : P g, (∑ z : ZMod p.val, activeResidueWeight visits (visits.filter (fun j => p.val ∈ physicalGroupMarks (L j) g)) (fun j => -(offset j : ZMod p.val)) η z) / (p.val : ℝ)) end Bounty end -- Source module: PhysicalFinitePathGroupReindex section /- Reindexing the original finite paths preserves every label, offset and coefficient. -/ open Finset open scoped Classical namespace Bounty section Reindex variable {G H I : Type*} (e : G ≃ H) (P : G → Finset ℕ) (J ell : ℕ) (patterns : Finset I) (C : I → G → Finset (Fin J)) def physicalFinitePathGroupReindex (r : ℕ) : (Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) ≃ (Fin (r + 1) → PhysicalEdgeLabels (fun h => P (e.symm h)) J ell patterns (fun i h => C i (e.symm h)) × PhysicalMarkLists (fun h => P (e.symm h)) J ell) := Equiv.piCongrRight (fun _ => Equiv.prodCongr (physicalEdgeGroupReindex e P J ell patterns C) (physicalMarkGroupReindex e P J ell)) theorem physical_finite_path_labels_group_reindex (r : ℕ) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : finitePathLabels (physicalFinitePathGroupReindex e P J ell patterns C r p) = fun j => physicalEdgeGroupReindex e P J ell patterns C (finitePathLabels p j) := by funext j unfold finitePathLabels split <;> rfl theorem physical_finite_path_marks_group_reindex (r : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : finitePathMarks (physicalMarkGroupReindex e P J ell L) (physicalFinitePathGroupReindex e P J ell patterns C r p) = fun j => physicalMarkGroupReindex e P J ell (finitePathMarks L p j) := by funext j cases j with | zero => rfl | succ j => simp only [finitePathMarks] split_ifs <;> rfl variable [Fintype G] [Fintype H] theorem physical_bare_offset_group_reindex (k : ℕ → I → ℤ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges j : ℕ) : physicalBareOffset (fun i h => C i (e.symm h)) k (fun t => physicalEdgeGroupReindex e P J ell patterns C (a t)) (fun t => physicalMarkGroupReindex e P J ell (L t)) edges j = physicalBareOffset C k a L edges j := by induction j with | zero => rfl | succ j ih => simp only [physicalBareOffset, ih, physical_bare_step_group_reindex] variable [DecidableEq G] [DecidableEq H] theorem physical_bare_walk_scalar_group_reindex (V : G → ℝ) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (a : ℕ → PhysicalEdgeLabels P J ell patterns C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) : physicalBareWalkScalar (fun h => V (e.symm h)) patterns (fun i h => C i (e.symm h)) ζ (fun t i => physicalGroupReindexedCoefficient e (C i) (K t i)) (fun t => physicalEdgeGroupReindex e P J ell patterns C (a t)) (fun t => physicalMarkGroupReindex e P J ell (L t)) edges = physicalBareWalkScalar V patterns C ζ K a L edges := by unfold physicalBareWalkScalar apply prod_congr rfl intro j _ exact physical_bare_labeled_group_reindex e P J ell patterns C V (ζ _) (K _) _ _ _ theorem physical_finite_return_scalar_group_reindex (V : G → ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : physicalFiniteReturnScalar (fun h => V (e.symm h)) patterns (fun i h => C i (e.symm h)) ζ k (fun t i => physicalGroupReindexedCoefficient e (C i) (K t i)) r (physicalMarkGroupReindex e P J ell L) (physicalFinitePathGroupReindex e P J ell patterns C r p) = physicalFiniteReturnScalar V patterns C ζ k K r L p := by unfold physicalFiniteReturnScalar physicalBareReturnScalar rw [physical_finite_path_labels_group_reindex, physical_finite_path_marks_group_reindex, physical_bare_offset_group_reindex, physical_bare_walk_scalar_group_reindex] end Reindex end Bounty end -- Source module: PhysicalFiniteVertexGroupReindex section /- The original finite-path residue expectation is unchanged by group reindexing. -/ open Finset open scoped Classical namespace Bounty theorem physical_finite_vertex_expectation_group_reindex {G H I : Type*} [Fintype G] [Fintype H] [DecidableEq G] [DecidableEq H] (e : G ≃ H) (P : G → Finset ℕ) (J ell : ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] [∀ p : PhysicalPrime (fun h => P (e.symm h)), NeZero p.2.val] (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (k : ℕ → I → ℤ) (r : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell patterns C × PhysicalMarkLists P J ell) : physicalFiniteVertexExpectation (fun i h => C i (e.symm h)) q k r (physicalMarkGroupReindex e P J ell L) (physicalFinitePathGroupReindex e P J ell patterns C r p) = physicalFiniteVertexExpectation C q k r L p := by simp only [physicalFiniteVertexExpectation, physical_finite_path_labels_group_reindex, physical_finite_path_marks_group_reindex, physical_bare_offset_group_reindex] exact physical_pool_expectation_group_reindex e P J ell (range (r + 2)) (finitePathMarks L p) (physicalBareOffset C k (finitePathLabels p) (finitePathMarks L p) (r + 1)) (fun j => 1 - physicalEndpointSchedule q (r + 1) j) end Bounty end -- Source module: PhysicalRootResidueGroupReindex section /- The original residue model is invariant under an equivalence of its group index. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_residue_model_group_reindex {G H I : Type*} [Fintype G] [Fintype H] [DecidableEq G] [DecidableEq H] (e : G ≃ H) (P : G → Finset ℕ) (J ell : ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] [∀ p : PhysicalPrime (fun h => P (e.symm h)), NeZero p.2.val] (V : G → ℝ) (patterns : Finset I) (C : I → G → Finset (Fin J)) (q : ℝ) (ζ : ℕ → I → ℝ) (k : ℕ → I → ℤ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (r : ℕ) : physicalRootResidueModel (fun h => V (e.symm h)) patterns (fun i h => C i (e.symm h)) q ζ k (fun t i => physicalGroupReindexedCoefficient e (C i) (K t i)) r = physicalRootResidueModel V patterns C q ζ k K r := by let _ : Fintype (PhysicalEdgeLabels P J ell patterns C) := inferInstance let _ : Fintype (PhysicalEdgeLabels (fun h => P (e.symm h)) J ell patterns (fun i h => C i (e.symm h))) := inferInstance unfold physicalRootResidueModel rw [physical_state_mass_group_reindex] apply congrArg (fun z : ℂ => (physicalStateMass V J ell : ℂ) * z) rw [← Equiv.sum_comp (physicalMarkGroupReindex e P J ell)] apply sum_congr rfl intro L _ rw [← Equiv.sum_comp (physicalFinitePathGroupReindex e P J ell patterns C r)] apply sum_congr rfl intro p _ rw [physical_finite_return_scalar_group_reindex, physical_finite_vertex_expectation_group_reindex] end Bounty end -- Source module: PhysicalPatternReindex section /- Exact transport of auxiliary labels and original edges under a pattern equivalence. -/ open Finset open scoped Classical namespace Bounty section Aux variable {G : Type*} (P : G → Finset ℕ) {J : ℕ} (C C' : G → Finset (Fin J)) (hC : ∀ g, C' g = C g) def physicalAuxCutEquiv : PhysicalAuxLabels P C ≃ PhysicalAuxLabels P C' where toFun a g j := a g ⟨j.val, by simpa only [hC g] using j.property⟩ invFun a g j := a g ⟨j.val, by simpa only [hC g] using j.property⟩ left_inv a := by funext g j; rfl right_inv a := by funext g j; rfl theorem physical_D_aux_cut_equiv [Fintype G] {ell : ℕ} (L : PhysicalMarkLists P J ell) (a : PhysicalAuxLabels P C) : physicalD C' L (physicalAuxCutEquiv P C C' hC a) = physicalD C L a := by have he : C' = C := funext hC subst C' rfl theorem physical_bare_pattern_aux_cut_equiv [Fintype G] [DecidableEq G] {ell : ℕ} (V : G → ℝ) (ζ ζ' : ℝ) (hζ : ζ' = ζ) (K : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C → ℂ) (K' : PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P C' → ℂ) (hK : ∀ L R a, K' L R (physicalAuxCutEquiv P C C' hC a) = K L R a) (a : PhysicalAuxLabels P C) (L R : PhysicalMarkLists P J ell) : physicalBarePatternScalar V C' ζ' K' (physicalAuxCutEquiv P C C' hC a) L R = physicalBarePatternScalar V C ζ K a L R := by have he : C' = C := funext hC subst C' subst ζ' have heK : K' = K := by funext L R a exact hK L R a rw [heK] rfl end Aux section Pattern variable {G I I' : Type*} [Fintype I] [Fintype I'] (f : I ≃ I') (P : G → Finset ℕ) (J ell : ℕ) (C : I → G → Finset (Fin J)) (C' : I' → G → Finset (Fin J)) (hC : ∀ i g, C' (f i) g = C i g) def physicalPatternSubtypeEquiv : ↥(univ : Finset I) ≃ ↥(univ : Finset I') where toFun i := ⟨f i.val, mem_univ _⟩ invFun i := ⟨f.symm i.val, mem_univ _⟩ left_inv i := by apply Subtype.ext; exact f.symm_apply_apply i.val right_inv i := by apply Subtype.ext; exact f.apply_symm_apply i.val def physicalEdgePatternEquiv : PhysicalEdgeLabels P J ell univ C ≃ PhysicalEdgeLabels P J ell univ C' := Equiv.prodCongr (Equiv.refl _) (Equiv.prodCongr (Equiv.refl _) (Equiv.sigmaCongr (physicalPatternSubtypeEquiv f) (fun i => physicalAuxCutEquiv P (C i.val) (C' (f i.val)) (hC i.val)))) theorem physical_bare_step_pattern_equiv [Fintype G] (k : I → ℤ) (k' : I' → ℤ) (hk : ∀ i, k' (f i) = k i) (a : PhysicalEdgeLabels P J ell univ C) (L : PhysicalMarkLists P J ell) : physicalBareStep C' k' (physicalEdgePatternEquiv f P J ell C C' hC a) L = physicalBareStep C k a L := by change k' (f a.2.2.1.val) * (physicalD (C' (f a.2.2.1.val)) (physicalPermuteLabels a.1 L) (physicalAuxCutEquiv P (C a.2.2.1.val) (C' (f a.2.2.1.val)) (hC a.2.2.1.val) a.2.2.2) : ℕ) = _ rw [hk, physical_D_aux_cut_equiv] rfl theorem physical_bare_labeled_scalar_pattern_equiv [Fintype G] [DecidableEq G] (V : G → ℝ) (ζ : I → ℝ) (ζ' : I' → ℝ) (hζ : ∀ i, ζ' (f i) = ζ i) (K : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (K' : ∀ i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C' i) → ℂ) (hK : ∀ i L R a, K' (f i) L R (physicalAuxCutEquiv P (C i) (C' (f i)) (hC i) a) = K i L R a) (a : PhysicalEdgeLabels P J ell univ C) (L R : PhysicalMarkLists P J ell) : physicalBareLabeledScalar V univ C' ζ' K' (physicalEdgePatternEquiv f P J ell C C' hC a) L R = physicalBareLabeledScalar V univ C ζ K a L R := by unfold physicalBareLabeledScalar congr 1 exact physical_bare_pattern_aux_cut_equiv P _ _ (hC a.2.2.1.val) V _ _ (hζ a.2.2.1.val) _ _ (hK a.2.2.1.val) _ _ _ end Pattern end Bounty end -- Source module: PhysicalRootResiduePatternReindex section /- Exact reindexing of the pattern sum in the original root residue model. -/ open Finset open scoped Classical namespace Bounty section Reindex variable {G I I' : Type*} [Fintype I] [Fintype I'] (f : I ≃ I') (P : G → Finset ℕ) (J ell : ℕ) (C : I → G → Finset (Fin J)) (C' : I' → G → Finset (Fin J)) (hC : ∀ i g, C' (f i) g = C i g) def physicalFinitePathPatternEquiv (r : ℕ) : (Fin (r + 1) → PhysicalEdgeLabels P J ell univ C × PhysicalMarkLists P J ell) ≃ (Fin (r + 1) → PhysicalEdgeLabels P J ell univ C' × PhysicalMarkLists P J ell) := Equiv.piCongrRight (fun _ => Equiv.prodCongr (physicalEdgePatternEquiv f P J ell C C' hC) (Equiv.refl _)) theorem physical_finite_path_labels_pattern_equiv (r : ℕ) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell univ C × PhysicalMarkLists P J ell) : finitePathLabels (physicalFinitePathPatternEquiv f P J ell C C' hC r p) = fun j => physicalEdgePatternEquiv f P J ell C C' hC (finitePathLabels p j) := by funext j unfold finitePathLabels split <;> rfl theorem physical_finite_path_marks_pattern_equiv (r : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell univ C × PhysicalMarkLists P J ell) : finitePathMarks L (physicalFinitePathPatternEquiv f P J ell C C' hC r p) = finitePathMarks L p := by funext j cases j with | zero => rfl | succ j => simp only [finitePathMarks] split_ifs <;> rfl variable [Fintype G] theorem physical_bare_offset_pattern_equiv (k : ℕ → I → ℤ) (k' : ℕ → I' → ℤ) (hk : ∀ t i, k' t (f i) = k t i) (a : ℕ → PhysicalEdgeLabels P J ell univ C) (L : ℕ → PhysicalMarkLists P J ell) (edges j : ℕ) : physicalBareOffset C' k' (fun t => physicalEdgePatternEquiv f P J ell C C' hC (a t)) L edges j = physicalBareOffset C k a L edges j := by induction j with | zero => rfl | succ j ih => simp only [physicalBareOffset, ih, physical_bare_step_pattern_equiv f P J ell C C' hC _ _ (hk _)] variable [DecidableEq G] theorem physical_bare_walk_scalar_pattern_equiv (V : G → ℝ) (ζ : ℕ → I → ℝ) (ζ' : ℕ → I' → ℝ) (hζ : ∀ t i, ζ' t (f i) = ζ t i) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (K' : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C' i) → ℂ) (hK : ∀ t i L R a, K' t (f i) L R (physicalAuxCutEquiv P (C i) (C' (f i)) (hC i) a) = K t i L R a) (a : ℕ → PhysicalEdgeLabels P J ell univ C) (L : ℕ → PhysicalMarkLists P J ell) (edges : ℕ) : physicalBareWalkScalar V univ C' ζ' K' (fun t => physicalEdgePatternEquiv f P J ell C C' hC (a t)) L edges = physicalBareWalkScalar V univ C ζ K a L edges := by unfold physicalBareWalkScalar apply prod_congr rfl intro j _ exact physical_bare_labeled_scalar_pattern_equiv f P J ell C C' hC V _ _ (hζ _) _ _ (hK _) _ _ _ theorem physical_finite_return_scalar_pattern_equiv (V : G → ℝ) (ζ : ℕ → I → ℝ) (ζ' : ℕ → I' → ℝ) (hζ : ∀ t i, ζ' t (f i) = ζ t i) (k : ℕ → I → ℤ) (k' : ℕ → I' → ℤ) (hk : ∀ t i, k' t (f i) = k t i) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (K' : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C' i) → ℂ) (hK : ∀ t i L R a, K' t (f i) L R (physicalAuxCutEquiv P (C i) (C' (f i)) (hC i) a) = K t i L R a) (r : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell univ C × PhysicalMarkLists P J ell) : physicalFiniteReturnScalar V univ C' ζ' k' K' r L (physicalFinitePathPatternEquiv f P J ell C C' hC r p) = physicalFiniteReturnScalar V univ C ζ k K r L p := by unfold physicalFiniteReturnScalar physicalBareReturnScalar rw [physical_finite_path_labels_pattern_equiv, physical_finite_path_marks_pattern_equiv, physical_bare_offset_pattern_equiv f P J ell C C' hC k k' hk, physical_bare_walk_scalar_pattern_equiv f P J ell C C' hC V ζ ζ' hζ K K' hK] variable [∀ p : PhysicalPrime P, NeZero p.2.val] theorem physical_finite_vertex_expectation_pattern_equiv (q : ℝ) (k : ℕ → I → ℤ) (k' : ℕ → I' → ℤ) (hk : ∀ t i, k' t (f i) = k t i) (r : ℕ) (L : PhysicalMarkLists P J ell) (p : Fin (r + 1) → PhysicalEdgeLabels P J ell univ C × PhysicalMarkLists P J ell) : physicalFiniteVertexExpectation C' q k' r L (physicalFinitePathPatternEquiv f P J ell C C' hC r p) = physicalFiniteVertexExpectation C q k r L p := by unfold physicalFiniteVertexExpectation simp only [physical_finite_path_labels_pattern_equiv, physical_finite_path_marks_pattern_equiv, physical_bare_offset_pattern_equiv f P J ell C C' hC k k' hk] theorem physical_root_residue_model_pattern_equiv (V : G → ℝ) (q : ℝ) (ζ : ℕ → I → ℝ) (ζ' : ℕ → I' → ℝ) (hζ : ∀ t i, ζ' t (f i) = ζ t i) (k : ℕ → I → ℤ) (k' : ℕ → I' → ℤ) (hk : ∀ t i, k' t (f i) = k t i) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (K' : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C' i) → ℂ) (hK : ∀ t i L R a, K' t (f i) L R (physicalAuxCutEquiv P (C i) (C' (f i)) (hC i) a) = K t i L R a) (r : ℕ) : physicalRootResidueModel V univ C' q ζ' k' K' r = physicalRootResidueModel V univ C q ζ k K r := by let _ : Fintype (PhysicalEdgeLabels P J ell univ C) := inferInstance let _ : Fintype (PhysicalEdgeLabels P J ell univ C') := inferInstance unfold physicalRootResidueModel apply congrArg (fun z : ℂ => (physicalStateMass V J ell : ℂ) * z) apply sum_congr rfl intro L _ rw [← Equiv.sum_comp (physicalFinitePathPatternEquiv f P J ell C C' hC r)] apply sum_congr rfl intro p _ rw [physical_finite_return_scalar_pattern_equiv f P J ell C C' hC V ζ ζ' hζ k k' hk K K' hK, physical_finite_vertex_expectation_pattern_equiv f P J ell C C' hC q k k' hk] end Reindex end Bounty end -- Source module: PhysicalRootPrimeGroupReindex section /- Group reindexing of the original root prime kernel, with the original pattern index retained at the outer interface. -/ open scoped Classical namespace Bounty section Reindex variable {G H : Type*} [Fintype G] [Fintype H] [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : G ≃ H) (P : G → Finset ℕ) (probes : G → Finset (Fin J)) (r t : Finset H) noncomputable def physicalRootPrimeGroupAux (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map e.symm.toEmbedding) (t.map e.symm.toEmbedding)) (a : PhysicalAuxLabels (fun g => P (e.symm g)) (fun g => repeatedBigPrimePatternCut probes (r.map e.symm.toEmbedding) (t.map e.symm.toEmbedding) i (e.symm g))) : PhysicalAuxLabels (fun g => P (e.symm g)) (repeatedBigPrimePatternCut (fun g => probes (e.symm g)) r t ((repeatedBigPrimePatternEquiv e.symm.toEmbedding probes r t).symm i)) := fun g j => a g ⟨j.val, by exact (congrArg (fun s : Finset (Fin J) => j.val ∈ s) (repeated_big_prime_pattern_equiv_symm_cut e.symm.toEmbedding probes r t i g)).mp j.property⟩ theorem physical_group_reindexed_root_prime_kernel (V : G → ℝ) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes (r.map e.symm.toEmbedding) (t.map e.symm.toEmbedding)) (L R : PhysicalMarkLists (fun g => P (e.symm g)) J ell) (a : PhysicalAuxLabels (fun g => P (e.symm g)) (fun g => repeatedBigPrimePatternCut probes (r.map e.symm.toEmbedding) (t.map e.symm.toEmbedding) i (e.symm g))) : physicalGroupReindexedCoefficient e (repeatedBigPrimePatternCut probes (r.map e.symm.toEmbedding) (t.map e.symm.toEmbedding) i) (physicalRootPrimeKernel P V probes (r.map e.symm.toEmbedding) (t.map e.symm.toEmbedding) ((Finset.disjoint_map e.symm.toEmbedding).mpr hrt) Q h ξ i) L R a = physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) r t hrt Q h ξ ((repeatedBigPrimePatternEquiv e.symm.toEmbedding probes r t).symm i) L R (physicalRootPrimeGroupAux e P probes r t i a) := by let C := repeatedBigPrimePatternCut probes (r.map e.symm.toEmbedding) (t.map e.symm.toEmbedding) i have hL : (fun g => ((physicalMarkGroupReindex e P J ell).symm L) (e.symm g)) = L := (physicalMarkGroupReindex e P J ell).apply_symm_apply L have hR : (fun g => ((physicalMarkGroupReindex e P J ell).symm R) (e.symm g)) = R := (physicalMarkGroupReindex e P J ell).apply_symm_apply R have ha : (fun g => ((physicalAuxGroupReindex e P J C).symm a) (e.symm g)) = a := (physicalAuxGroupReindex e P J C).apply_symm_apply a have hk := physical_root_prime_kernel_equiv e.symm.toEmbedding P V probes r t hrt Q h ξ i ((physicalMarkGroupReindex e P J ell).symm L) ((physicalMarkGroupReindex e P J ell).symm R) ((physicalAuxGroupReindex e P J C).symm a) unfold physicalGroupReindexedCoefficient refine hk.trans ?_ simp only [Equiv.toEmbedding_apply] rw [hL, hR] apply congrArg (physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) r t hrt Q h ξ ((repeatedBigPrimePatternEquiv e.symm.toEmbedding probes r t).symm i) L R) funext g j exact congrFun (congrFun ha g) ⟨j.val, by exact (congrArg (fun s : Finset (Fin J) => j.val ∈ s) (repeated_big_prime_pattern_equiv_symm_cut e.symm.toEmbedding probes r t i g)).mp j.property⟩ end Reindex end Bounty end -- Source module: PhysicalRootPrimeOriginalGroupReindex section /- The kernel bridge with arbitrary original group subsets. All inverse-map equalities and dependent pattern casts are discharged in this module. -/ open scoped Classical namespace Bounty section Maps variable {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : G ≃ H) (probes : G → Finset (Fin J)) (rG tG : Finset G) (rH tH : Finset H) (hr : rH.map e.symm.toEmbedding = rG) (ht : tH.map e.symm.toEmbedding = tG) noncomputable def physicalRootPrimePatternEquivOfMaps : RepeatedBigPrimePatternIndex (ell := ell) probes rG tG ≃ RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e.symm g)) rH tH := by subst rG subst tG exact (repeatedBigPrimePatternEquiv e.symm.toEmbedding probes rH tH).symm theorem physical_root_prime_pattern_equiv_of_maps_cut (i : RepeatedBigPrimePatternIndex (ell := ell) probes rG tG) (g : H) : repeatedBigPrimePatternCut (fun g => probes (e.symm g)) rH tH (physicalRootPrimePatternEquivOfMaps e probes rG tG rH tH hr ht i) g = repeatedBigPrimePatternCut probes rG tG i (e.symm g) := by subst rG subst tG exact repeated_big_prime_pattern_equiv_symm_cut e.symm.toEmbedding probes rH tH i g noncomputable def physicalRootPrimeAuxOfMaps (P : G → Finset ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes rG tG) (a : PhysicalAuxLabels (fun g => P (e.symm g)) (fun g => repeatedBigPrimePatternCut probes rG tG i (e.symm g))) : PhysicalAuxLabels (fun g => P (e.symm g)) (repeatedBigPrimePatternCut (fun g => probes (e.symm g)) rH tH (physicalRootPrimePatternEquivOfMaps e probes rG tG rH tH hr ht i)) := fun g j => a g ⟨j.val, by exact (congrArg (fun s : Finset (Fin J) => j.val ∈ s) (physical_root_prime_pattern_equiv_of_maps_cut e probes rG tG rH tH hr ht i g)).mp j.property⟩ theorem physical_group_reindexed_root_prime_kernel_of_maps [Fintype G] [Fintype H] (P : G → Finset ℕ) (V : G → ℝ) (hrtG : Disjoint rG tG) (hrtH : Disjoint rH tH) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes rG tG) (L R : PhysicalMarkLists (fun g => P (e.symm g)) J ell) (a : PhysicalAuxLabels (fun g => P (e.symm g)) (fun g => repeatedBigPrimePatternCut probes rG tG i (e.symm g))) : physicalGroupReindexedCoefficient e (repeatedBigPrimePatternCut probes rG tG i) (physicalRootPrimeKernel P V probes rG tG hrtG Q h ξ i) L R a = physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) rH tH hrtH Q h ξ (physicalRootPrimePatternEquivOfMaps e probes rG tG rH tH hr ht i) L R (physicalRootPrimeAuxOfMaps e probes rG tG rH tH hr ht P i a) := by subst rG subst tG exact physical_group_reindexed_root_prime_kernel e P probes rH tH V hrtH Q h ξ i L R a end Maps section Original variable {G H : Type*} [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : G ≃ H) (probes : G → Finset (Fin J)) (r t : Finset G) noncomputable def physicalRootPrimeGroupPattern : RepeatedBigPrimePatternIndex (ell := ell) probes r t ≃ RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) := physicalRootPrimePatternEquivOfMaps e probes r t (r.map e.toEmbedding) (t.map e.toEmbedding) (by simp [Finset.map_map]) (by simp [Finset.map_map]) noncomputable def physicalRootPrimeGroupOriginalAux (P : G → Finset ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (a : PhysicalAuxLabels (fun g => P (e.symm g)) (fun g => repeatedBigPrimePatternCut probes r t i (e.symm g))) : PhysicalAuxLabels (fun g => P (e.symm g)) (repeatedBigPrimePatternCut (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) (physicalRootPrimeGroupPattern e probes r t i)) := physicalRootPrimeAuxOfMaps e probes r t (r.map e.toEmbedding) (t.map e.toEmbedding) (by simp [Finset.map_map]) (by simp [Finset.map_map]) P i a theorem physical_root_prime_group_pattern_cut (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (g : H) : repeatedBigPrimePatternCut (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) (physicalRootPrimeGroupPattern e probes r t i) g = repeatedBigPrimePatternCut probes r t i (e.symm g) := physical_root_prime_pattern_equiv_of_maps_cut e probes r t (r.map e.toEmbedding) (t.map e.toEmbedding) (by simp [Finset.map_map]) (by simp [Finset.map_map]) i g theorem physical_group_reindexed_root_prime_kernel_original [Fintype G] [Fintype H] (P : G → Finset ℕ) (V : G → ℝ) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (L R : PhysicalMarkLists (fun g => P (e.symm g)) J ell) (a : PhysicalAuxLabels (fun g => P (e.symm g)) (fun g => repeatedBigPrimePatternCut probes r t i (e.symm g))) : physicalGroupReindexedCoefficient e (repeatedBigPrimePatternCut probes r t i) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i) L R a = physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) ((Finset.disjoint_map e.toEmbedding).mpr hrt) Q h ξ (physicalRootPrimeGroupPattern e probes r t i) L R (physicalRootPrimeGroupOriginalAux e probes r t P i a) := physical_group_reindexed_root_prime_kernel_of_maps e probes r t (r.map e.toEmbedding) (t.map e.toEmbedding) (by simp [Finset.map_map]) (by simp [Finset.map_map]) P V hrt ((Finset.disjoint_map e.toEmbedding).mpr hrt) Q h ξ i L R a end Original end Bounty end -- Source module: PhysicalRootAlternatingGroupReindex section /- The alternating adjoint convention of the actual residual survives group reindexing without changing its outer pattern index. -/ open scoped Classical namespace Bounty theorem physical_group_reindexed_alternating_root_prime_kernel {G H : Type*} [Fintype G] [Fintype H] [DecidableEq G] [DecidableEq H] {J ell : ℕ} (e : G ≃ H) (P : G → Finset ℕ) (probes : G → Finset (Fin J)) (r t : Finset G) (V : G → ℝ) (hrt : Disjoint r t) (Q : ℕ) (h ξ : ℝ) (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (L R : PhysicalMarkLists (fun g => P (e.symm g)) J ell) (a : PhysicalAuxLabels (fun g => P (e.symm g)) (fun g => repeatedBigPrimePatternCut probes r t i (e.symm g))) : physicalGroupReindexedCoefficient e (repeatedBigPrimePatternCut probes r t i) (fun x y aux => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i y x aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ i x y aux) L R a = if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) ((Finset.disjoint_map e.toEmbedding).mpr hrt) Q h ξ (physicalRootPrimeGroupPattern e probes r t i) R L (physicalRootPrimeGroupOriginalAux e probes r t P i a)) else physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) ((Finset.disjoint_map e.toEmbedding).mpr hrt) Q h ξ (physicalRootPrimeGroupPattern e probes r t i) L R (physicalRootPrimeGroupOriginalAux e probes r t P i a) := by by_cases ht : time % 2 = 0 · simp only [ht, if_true] exact congrArg (starRingEnd ℂ) (physical_group_reindexed_root_prime_kernel_original e probes r t P V hrt Q h ξ i R L a) · simp only [ht, if_false] exact physical_group_reindexed_root_prime_kernel_original e probes r t P V hrt Q h ξ i L R a end Bounty end -- Source module: PhysicalRootPrimeResidueReindex section /- The literal alternating prime-kernel residue model is unchanged by numbering its groups and transporting its full pattern sum. -/ open Finset open scoped Classical namespace Bounty theorem physical_root_prime_residue_model_group_reindex {G H : Type*} [Fintype G] [Fintype H] [DecidableEq G] [DecidableEq H] (e : G ≃ H) (P : G → Finset ℕ) (J ell : ℕ) [∀ p : PhysicalPrime P, NeZero p.2.val] [∀ p : PhysicalPrime (fun g => P (e.symm g)), NeZero p.2.val] (V : G → ℝ) (probes : G → Finset (Fin J)) (r t : Finset G) (hrt : Disjoint r t) (Q : ℕ) (h ξ q : ℝ) (ζ : ℕ → ℝ) (k : ℕ → ℤ) (n : ℕ) : physicalRootResidueModel V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) q (fun time _ => ζ time) (fun time _ => k time) (fun time i x y aux => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i y x aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ i x y aux) n = physicalRootResidueModel (fun g => V (e.symm g)) (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding))) (repeatedBigPrimePatternCut (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding)) q (fun time _ => ζ time) (fun time _ => k time) (fun time i x y aux => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) ((Finset.disjoint_map e.toEmbedding).mpr hrt) Q h ξ i y x aux) else physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) ((Finset.disjoint_map e.toEmbedding).mpr hrt) Q h ξ i x y aux) n := by let C0 := repeatedBigPrimePatternCut (ell := ell) probes r t let C1 := repeatedBigPrimePatternCut (ell := ell) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) let K0 := fun (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) (x y : PhysicalMarkLists P J ell) (aux : PhysicalAuxLabels P (C0 i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i y x aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ i x y aux let K1 := fun (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding)) (x y : PhysicalMarkLists (fun g => P (e.symm g)) J ell) (aux : PhysicalAuxLabels (fun g => P (e.symm g)) (C1 i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) ((Finset.disjoint_map e.toEmbedding).mpr hrt) Q h ξ i y x aux) else physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) ((Finset.disjoint_map e.toEmbedding).mpr hrt) Q h ξ i x y aux change physicalRootResidueModel V univ C0 q (fun time _ => ζ time) (fun time _ => k time) K0 n = physicalRootResidueModel (fun g => V (e.symm g)) univ C1 q (fun time _ => ζ time) (fun time _ => k time) K1 n rw [← physical_root_residue_model_group_reindex e P J ell V univ C0 q (fun time _ => ζ time) (fun time _ => k time) K0 n] symm apply physical_root_residue_model_pattern_equiv (physicalRootPrimeGroupPattern e probes r t) (fun g => P (e.symm g)) J ell (fun i g => C0 i (e.symm g)) C1 (physical_root_prime_group_pattern_cut e probes r t) (fun g => V (e.symm g)) q (fun time _ => ζ time) (fun time _ => ζ time) (fun _ _ => rfl) (fun time _ => k time) (fun time _ => k time) (fun _ _ => rfl) (fun time i => physicalGroupReindexedCoefficient e (C0 i) (K0 time i)) K1 intro time i x y aux have haux : physicalAuxCutEquiv (fun g => P (e.symm g)) (fun g => C0 i (e.symm g)) (C1 ((physicalRootPrimeGroupPattern e probes r t) i)) (physical_root_prime_group_pattern_cut e probes r t i) aux = physicalRootPrimeGroupOriginalAux e probes r t P i aux := by funext g j rfl rw [haux] exact (physical_group_reindexed_alternating_root_prime_kernel e P probes r t V hrt Q h ξ time i x y aux).symm theorem physical_root_prime_residue_model_finset_reindex (S : Finset ℕ) (P : S → Finset ℕ) (J ell : ℕ) [inst : ∀ p : PhysicalPrime P, NeZero p.2.val] (V : S → ℝ) (probes : S → Finset (Fin J)) (r t : Finset S) (hrt : Disjoint r t) (Q : ℕ) (h ξ q : ℝ) (ζ : ℕ → ℝ) (k : ℕ → ℤ) (n : ℕ) : let e : S ≃ Fin S.card := Fintype.equivFinOfCardEq (Fintype.card_coe S) letI : ∀ p : PhysicalPrime (fun g => P (e.symm g)), NeZero p.2.val := fun p => inst ⟨e.symm p.1, p.2⟩ physicalRootResidueModel V (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) probes r t)) (repeatedBigPrimePatternCut probes r t) q (fun time _ => ζ time) (fun time _ => k time) (fun time i x y aux => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h ξ i y x aux) else physicalRootPrimeKernel P V probes r t hrt Q h ξ i x y aux) n = physicalRootResidueModel (fun g => V (e.symm g)) (univ : Finset (RepeatedBigPrimePatternIndex (ell := ell) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding))) (repeatedBigPrimePatternCut (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding)) q (fun time _ => ζ time) (fun time _ => k time) (fun time i x y aux => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) ((Finset.disjoint_map e.toEmbedding).mpr hrt) Q h ξ i y x aux) else physicalRootPrimeKernel (fun g => P (e.symm g)) (fun g => V (e.symm g)) (fun g => probes (e.symm g)) (r.map e.toEmbedding) (t.map e.toEmbedding) ((Finset.disjoint_map e.toEmbedding).mpr hrt) Q h ξ i x y aux) n := by let e : S ≃ Fin S.card := Fintype.equivFinOfCardEq (Fintype.card_coe S) let : ∀ p : PhysicalPrime (fun g => P (e.symm g)), NeZero p.2.val := fun p => inst ⟨e.symm p.1, p.2⟩ exact physical_root_prime_residue_model_group_reindex e P J ell V probes r t hrt Q h ξ q ζ k n end Bounty end -- Source module: PhysicalRootEndpointWeights section /- Exact normalized endpoint weights are positive and have group mass at most two. -/ open Finset open scoped Classical namespace Bounty section Weights variable {G : Type*} {P : G → Finset ℕ} (V : G → ℝ) (q : ℝ) (edges : ℕ) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (hV : ∀ g, 0 < V g) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hsize : ∀ g (p : P g), 2 * (edges + 1) ≤ p.val) include hq0 hq1 hV hsize theorem physical_root_endpoint_weight_pos (g : G) (p : P g) : 0 < ((p.val : ℝ) * physicalEndpointBaseline q edges p.val)⁻¹ / V g := by exact physical_endpoint_beta_pos V q edges hq0 hq1 g (hV g) p (by have := hsize g p; omega) (hsize g p) include hMass theorem physical_root_endpoint_weight_sum_bounds (g : G) : 1 ≤ ∑ p : P g, ((p.val : ℝ) * physicalEndpointBaseline q edges p.val)⁻¹ / V g ∧ (∑ p : P g, ((p.val : ℝ) * physicalEndpointBaseline q edges p.val)⁻¹ / V g) ≤ 2 := by exact physical_endpoint_beta_mass_bounds V q edges hq0 hq1 g (hV g) (hMass g) (fun p => by have := hsize g p; omega) (hsize g) theorem physical_root_endpoint_weight_sum_le_two (g : G) : (∑ p : P g, ((p.val : ℝ) * physicalEndpointBaseline q edges p.val)⁻¹ / V g) ≤ 2 := (physical_root_endpoint_weight_sum_bounds V q edges hq0 hq1 hV hMass hsize g).2 end Weights end Bounty end -- Source module: PhysicalRootBigSubsetPullback section /- Every subset of the selected big groups has an exact pullback to their finite index. -/ open Finset open scoped Classical namespace Bounty section Pullback variable {G H : Type*} [Fintype G] [Fintype H] [DecidableEq G] (groups : Finset G) (e : {g // g ∉ groupsᶜ} ≃ H) theorem physical_reindexed_big_univ_map : (univ : Finset H).map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) e) = groups := by ext g constructor · intro hg obtain ⟨h, _, hh⟩ := mem_map.mp hg have hm : (e.symm h).val ∈ groups := by simpa only [mem_compl, not_not] using (e.symm h).property change (e.symm h).val = g at hh exact hh ▸ hm · intro hg let g' : {g // g ∉ groupsᶜ} := ⟨g, by simpa only [mem_compl, not_not] using hg⟩ refine mem_map.mpr ⟨e g', mem_univ _, ?_⟩ change (e.symm (e g')).val = g rw [e.symm_apply_apply] theorem physical_reindexed_big_subsets_pullback (rN tN : Finset G) (hrN : rN ⊆ groups) (htN : tN ⊆ groups) (hrt : Disjoint rN tN) : ∃ r t : Finset H, r.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) e) = rN ∧ t.map (physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) e) = tN ∧ r.card = rN.card ∧ t.card = tN.card ∧ Disjoint r t := by let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) e have hu : (univ : Finset H).map f = groups := physical_reindexed_big_univ_map groups e have hr' : rN ⊆ (univ : Finset H).map f := by simpa only [hu] using hrN have ht' : tN ⊆ (univ : Finset H).map f := by simpa only [hu] using htN obtain ⟨r, _, hr⟩ := subset_map_iff.mp hr' obtain ⟨t, _, ht⟩ := subset_map_iff.mp ht' refine ⟨r, t, hr.symm, ht.symm, ?_, ?_, ?_⟩ · rw [hr, card_map] · rw [ht, card_map] · apply (disjoint_map f).mp simpa only [← hr, ← ht] using hrt end Pullback end Bounty end -- Source module: RootGhostLowRank section /- The fixed damping and tilt also satisfy the ordinary low-rank birth inequality. -/ namespace Bounty theorem physical_endpoint_half_low_rank_ghost_budgets {vmax : ℝ} (hvmax : 0 ≤ vmax) (edges : ℕ) : 1 < 100*(vmax+1) ∧ ∀ j : ℕ, physicalEndpointSchedule (1/2) edges j/(9/10 : ℝ)^2 + ((1-physicalEndpointSchedule (1/2) edges j)/(9/10 : ℝ))/(100*(vmax+1)) ≤ 1 ∧ ∀ V : ℝ, 0 ≤ V → V ≤ vmax → physicalEndpointSchedule (1/2) edges j/(9/10 : ℝ)^2 + (((1-physicalEndpointSchedule (1/2) edges j)*V)/(9/10 : ℝ))/(100*(vmax+1)) ≤ 1 := by obtain ⟨hu, h⟩ := physical_endpoint_half_ghost_budgets hvmax edges refine ⟨hu, fun j => ⟨(h j).1, ?_⟩⟩ intro V hV0 hV have hhalf0 : 0 ≤ V/2 := by positivity have hhalf : V/2 ≤ vmax := by linarith have htwo : 2*(V/2) = V := by ring simpa only [htwo] using (h j).2 (V/2) hhalf0 hhalf end Bounty end -- Source module: CandidateRootPrimeAvoidance section /- No candidate prime divides a nonzero original determinant shift once the common large parameter is sufficiently large. -/ open Finset Filter namespace Bounty theorem eventually_candidate_root_prime_avoidance {scale K : ℝ} (hscale : 0 < scale) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ i ∈ candidatePIndices scale L, ∀ p ∈ candidatePBand (scale * L) i, ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), k ≠ 0 → ¬ (p : ℤ) ∣ k := by obtain ⟨v, V, _, _, hpools⟩ := exists_candidate_P_pool_bounds hscale filter_upwards [hpools, eventually_ge_atTop (3 : ℝ), eventually_mul_rpow_log_add_le_rpow (a := 0) (b := 1/10) (c := 1) (by norm_num) (by norm_num) zero_lt_one (K+88) (Real.log 3)] with L hpools hL hlog intro i hi p hp k hk hk0 hdiv have hL0 : 0 < L := by linarith have hprime := ((hpools.2.2.2.2.2 i hi).2.2 p hp).2.1 have hexp : 3 * L ^ (K+88) ≤ Real.exp (L ^ (1/10 : ℝ)) := by calc _ = Real.exp ((K+88)*Real.log L+Real.log 3) := by rw [Real.exp_add, mul_comm (K+88) (Real.log L), ← Real.rpow_def_of_pos hL0, Real.exp_log (by norm_num : (0 : ℝ) < 3)] ring _ ≤ _ := Real.exp_le_exp.mpr (by simpa only [Real.rpow_zero, mul_one, one_mul] using hlog) have hdet := determinant_bound_le_three_rpow_public (by linarith : 1 ≤ L) hK have hkdet : |(k : ℝ)| ≤ (typeIIAdmissibleDeterminantBound L K : ℝ) := by apply abs_le.mpr constructor · exact_mod_cast (mem_Icc.mp hk).1 · exact_mod_cast (mem_Icc.mp hk).2 have hkprime : |(k : ℝ)| < (p : ℝ) := hkdet.trans_lt ((hdet.trans hexp).trans_lt hprime) have hkprimeZ : |k| < (p : ℤ) := by exact_mod_cast hkprime have hpdvd : (p : ℤ) ∣ |k| := (dvd_abs (p : ℤ) k).mpr hdiv exact (not_le_of_gt hkprimeZ) (Int.le_of_dvd (abs_pos.mpr hk0) hpdvd) end Bounty end -- Source module: RootBirthRarityGap section /- A fixed exponential prime-atom bound absorbs the square of the actual polynomial birth dimension with a smaller stretched-exponential exponent. -/ open Filter namespace Bounty theorem eventually_root_birth_rarity_gap (C : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ m : ℕ, (m : ℝ) ≤ L ^ 6 → ∀ β : ℝ, 0 ≤ β → β ≤ C * Real.exp (-(L ^ (3/10 : ℝ))) → (m : ℝ) ^ 2 * β ≤ Real.exp (-(L ^ (1/4 : ℝ))) := by let D := max C 1 have hD : 0 < D := lt_of_lt_of_le zero_lt_one (le_max_right C 1) filter_upwards [eventually_gt_atTop (0 : ℝ), eventually_mul_rpow_log_add_le_rpow (a := 0) (b := 1/4) (c := 1) (by norm_num) (by norm_num) zero_lt_one 12 (Real.log D), eventually_mul_rpow_add_le_mul_rpow (a := 1/4) (b := 3/10) (c := 1) (by norm_num) (by norm_num) zero_lt_one 2 0] with L hL hlog hpower simp only [Real.rpow_zero, mul_one, one_mul] at hlog simp only [add_zero, one_mul] at hpower have hexp : D * L ^ 12 * Real.exp (-(L ^ (3/10 : ℝ))) ≤ Real.exp (-(L ^ (1/4 : ℝ))) := by have he : Real.exp (Real.log D + 12 * Real.log L - L ^ (3/10 : ℝ)) = D * L ^ 12 * Real.exp (-(L ^ (3/10 : ℝ))) := by rw [sub_eq_add_neg, Real.exp_add, Real.exp_add, Real.exp_log hD] congr 2 rw [show (12 : ℝ) = (12 : ℕ) by norm_num, Real.exp_nat_mul, Real.exp_log hL] rw [← he] exact Real.exp_le_exp.mpr (by linarith) intro m hm β hβ hβC have hm2 : (m : ℝ) ^ 2 ≤ L ^ 12 := by have hp := pow_le_pow_left₀ (Nat.cast_nonneg m) hm 2 simpa only [← pow_mul] using hp have hβD : β ≤ D * Real.exp (-(L ^ (3/10 : ℝ))) := hβC.trans (mul_le_mul_of_nonneg_right (le_max_left C 1) (Real.exp_pos _).le) calc _ ≤ L ^ 12 * β := mul_le_mul_of_nonneg_right hm2 hβ _ ≤ L ^ 12 * (D * Real.exp (-(L ^ (3/10 : ℝ)))) := mul_le_mul_of_nonneg_left hβD (pow_nonneg hL.le _) _ = D * L ^ 12 * Real.exp (-(L ^ (3/10 : ℝ))) := by ring _ ≤ _ := hexp end Bounty end -- Source module: PhysicalSelectedBirthCount section /- The actual selected-word birth allocation has polynomial dimension when its cap, slot count, group count, and edge count do. -/ open scoped Classical namespace Bounty theorem physical_selected_birth_card_polynomial (M T B N : ℕ) {L : ℝ} (hL : 4 ≤ L) (hM : (M : ℝ) ≤ L) (hT : (T : ℝ) ≤ L) (hB : (B : ℝ) ≤ L ^ 2) (hN : (N : ℝ) ≤ L) : (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => T) B ((List.range (4 * N + 1)).map (physicalSelectedFineTag N))) : ℝ) ≤ L ^ 6 := by have hL0 : 0 ≤ L := by linarith have hL1 : 1 ≤ L := by linarith have hLL : L ≤ L ^ 2 := by nlinarith have hmax : max (B : ℝ) (T : ℝ) ≤ L ^ 2 := max_le hB (hT.trans hLL) have hc := full_mixed_common_birth_card_le (fun _ : Fin M => T) B T (fun _ => le_rfl) ((List.range (4 * N + 1)).map (physicalSelectedFineTag N)) simp only [List.length_map, List.length_range] at hc have hc' : (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => T) B ((List.range (4 * N + 1)).map (physicalSelectedFineTag N))) : ℝ) ≤ (M : ℝ) * T + (4 * (N : ℝ) + 1) * ((M : ℝ) * max (B : ℝ) (T : ℝ)) := by exact_mod_cast hc have hprod : (M : ℝ) * T ≤ L * L := mul_le_mul hM hT (Nat.cast_nonneg _) hL0 have hfac : (M : ℝ) * max (B : ℝ) (T : ℝ) ≤ L * L ^ 2 := mul_le_mul hM hmax (le_max_of_le_left (Nat.cast_nonneg _)) hL0 have hlen : 4 * (N : ℝ) + 1 ≤ 5 * L := by linarith have hterm : (4 * (N : ℝ) + 1) * ((M : ℝ) * max (B : ℝ) (T : ℝ)) ≤ (5 * L) * (L * L ^ 2) := mul_le_mul hlen hfac (mul_nonneg (Nat.cast_nonneg _) (le_max_of_le_left (Nat.cast_nonneg _))) (by positivity) have h24 : L ^ 2 ≤ L ^ 4 := by calc L ^ 2 = 1 * L ^ 2 := by ring _ ≤ L ^ 2 * L ^ 2 := mul_le_mul_of_nonneg_right (by nlinarith) (sq_nonneg L) _ = L ^ 4 := by ring have h46 : 6 * L ^ 4 ≤ L ^ 6 := by calc _ ≤ L ^ 2 * L ^ 4 := mul_le_mul_of_nonneg_right (by nlinarith) (pow_nonneg hL0 4) _ = _ := by ring exact hc'.trans ((add_le_add hprod hterm).trans (by nlinarith)) end Bounty end -- Source module: PhysicalSelectedBirthAsymptotics section /- The literal moment schedule and a linear working cap have polynomially many common birth addresses, uniformly over logarithmically many groups. -/ open Filter namespace Bounty theorem eventually_physical_selected_birth_card_polynomial (T : ℕ) (C : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ M N B : ℕ, (M : ℝ) ≤ C * Real.log L → (N : ℝ) ≤ 2 * (Nat.ceil (L ^ (13/25 : ℝ)) : ℝ) + 1 → (B : ℝ) ≤ L ^ 2 → (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => T) B ((List.range (4 * N + 1)).map (physicalSelectedFineTag N))) : ℝ) ≤ L ^ 6 := by filter_upwards [eventually_ge_atTop (4 : ℝ), eventually_ge_atTop (T : ℝ), eventually_log_times_rpow_lt (a := 0) (b := 1) zero_lt_one C, eventually_repeated_big_visit_density_le (alpha := 13/25) (tau := 1) zero_lt_one (by norm_num)] with L hL hT hgroups hedges intro M N B hM hN hB have hM' : C * Real.log L < L := by simpa only [Real.rpow_zero, Real.rpow_one, mul_one] using hgroups have hN' : (N : ℝ) ≤ L := by simpa only [Real.rpow_one] using hedges N hN exact physical_selected_birth_card_polynomial M T B N hL (hM.trans hM'.le) hT hB hN' theorem eventually_root_birth_card_linear_cap (J ell : ℕ) (C : ℝ) : ∀ᶠ L : ℝ in atTop, ∀ M : ℕ, (M : ℝ) ≤ C * Real.log L → (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) (Nat.ceil L) ((List.range (4 * (2 * Nat.ceil (L ^ (13/25 : ℝ))) + 1)).map (physicalSelectedFineTag (2 * Nat.ceil (L ^ (13/25 : ℝ)))))) : ℝ) ≤ L ^ 6 := by filter_upwards [eventually_physical_selected_birth_card_polynomial (J + ell) C, eventually_ge_atTop (4 : ℝ)] with L hcount hL intro M hM apply hcount M (2 * Nat.ceil (L ^ (13/25 : ℝ))) (Nat.ceil L) hM · push_cast linarith · have hceil := Nat.ceil_lt_add_one (by linarith : 0 ≤ L) nlinarith end Bounty end -- Source module: CandidateRootBirthRarity section /- Actual candidate root atoms and the original endpoint schedule supply one common rarity parameter, including the required forest dimension loss. -/ open Filter namespace Bounty end Bounty end end section -- Source module: ActualCandidateNumberedInputs /- Actual numbered candidate input estimates in the common residue environment. -/ open scoped Topology BigOperators Classical -- Source module: CandidateNumberedPoolBounds section /- Uniform candidate-pool facts after an arbitrary finite enumeration. -/ open Filter Finset open scoped Classical namespace Bounty structure CandidateNumberedPoolBounds (scale L vmin vmax : ℝ) {N M : ℕ} (P : Fin N → Finset ℕ) (groups : Finset (Fin N)) (reindex : {g // g ∉ groupsᶜ} ≃ Fin M) : Prop where one_le : 1 ≤ L small_card : groupsᶜ.card = (candidateSmallPIndices scale L).card big_card : M = (candidateBigPIndices scale L).card disjoint : Pairwise (fun i j => Disjoint (P i) (P j)) mass_lower : ∀ i, vmin ≤ ∑ p ∈ P i, 1 / (p : ℝ) mass_upper : ∀ i, (∑ p ∈ P i, 1 / (p : ℝ)) ≤ vmax prime : ∀ i p, p ∈ P i → p.Prime big_card_le : (M : ℝ) ≤ (2 / (5 * Real.log 2)) * Real.log L big_band : ∀ g : Fin M, ∃ a b : ℝ, P (reindex.symm g).val = primeBand a b ∧ Real.exp (L ^ (1/4 : ℝ)) ≤ a ∧ 0 ≤ b big_log : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Real.log (p : ℝ) ≤ L ^ (1/2 : ℝ) big_lower : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Real.exp (L ^ (1/4 : ℝ)) ≤ (p : ℝ) theorem exists_candidate_numbered_pool_bounds {scale : ℝ} (hscale : 0 < scale) : ∃ vmin vmax : ℝ, 0 < vmin ∧ 0 < vmax ∧ ∀ᶠ L : ℝ in atTop, ∀ {N M : ℕ} (E : Fin N ≃ ↥(candidatePIndices scale L)) (e : {g // g ∉ (candidateRootBigGroups scale L E)ᶜ} ≃ Fin M), CandidateNumberedPoolBounds scale L vmin vmax (candidateRootPools scale L E) (candidateRootBigGroups scale L E) e := by obtain ⟨vmin,vmax,hvmin,hvmax,hpool⟩ := exists_candidate_P_pool_bounds hscale refine ⟨vmin,vmax,hvmin,hvmax,?_⟩ filter_upwards [hpool, eventually_candidate_big_band_endpoints hscale, eventually_candidate_small_big_indices_disjoint hscale] with L hp hb hd intro N M E e let P := candidateRootPools scale L E let groups := candidateRootBigGroups scale L E have hM : M = (candidateBigPIndices scale L).card := by have hc := Fintype.card_congr e have hce : Fintype.card {g // g ∉ groupsᶜ} = groups.card := by simp only [mem_compl, not_not, Fintype.card_coe] rw [Fintype.card_fin] at hc exact hc.symm.trans (hce.trans (candidate_root_big_groups_card scale L E)) have hbig (g : Fin M) : (E (e.symm g).val).val ∈ candidateBigPIndices scale L := by apply (candidate_root_big_groups_mem scale L E _).mp simpa only [mem_compl, not_not] using (e.symm g).property have hlo : Real.exp (L ^ (1/4 : ℝ)) ≤ Real.exp (L ^ (3/10 : ℝ)) := Real.exp_le_exp.mpr (Real.rpow_le_rpow_of_exponent_le hp.1 (by norm_num)) have hhi : Real.exp (L ^ (2/5 : ℝ)) ≤ Real.exp (L ^ (1/2 : ℝ)) := Real.exp_le_exp.mpr (Real.rpow_le_rpow_of_exponent_le hp.1 (by norm_num)) refine ⟨hp.1, candidate_root_small_groups_card scale L E hd, hM, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ · intro i j hij exact hp.2.2.2.2.1 (fun h => hij (E.injective (Subtype.ext h))) · intro i exact (hp.2.2.2.2.2 (E i).val (E i).property).1 · intro i exact (hp.2.2.2.2.2 (E i).val (E i).property).2.1 · intro i p hpi exact ((hp.2.2.2.2.2 (E i).val (E i).property).2.2 p hpi).1 · rw [hM] have hc : ((candidateBigPIndices scale L).card : ℝ) ≤ ((candidatePIndices scale L).card : ℝ) := by exact_mod_cast card_le_card (show candidateBigPIndices scale L ⊆ candidatePIndices scale L from subset_union_right) exact hc.trans hp.2.2.2.1 · intro g obtain ⟨a,b,heq,ha,_,hb0⟩ := hb _ (hbig g) exact ⟨a,b,heq,hlo.trans ha,hb0⟩ · intro g p hpg obtain ⟨a,b,heq,ha,hbhi,hb0⟩ := hb _ (hbig g) change p ∈ candidatePBand (scale * L) (E (e.symm g).val).val at hpg rw [heq] at hpg obtain ⟨hprime,_,hpb⟩ := (mem_primeBand_iff ((Real.exp_pos _).le.trans ha) hb0 p).mp hpg calc Real.log (p : ℝ) ≤ Real.log (Real.exp (L ^ (1/2 : ℝ))) := Real.log_le_log (by exact_mod_cast hprime.pos) (hpb.trans (hbhi.trans hhi)) _ = _ := Real.log_exp _ · intro g p hpg obtain ⟨a,b,heq,ha,_,hb0⟩ := hb _ (hbig g) change p ∈ candidatePBand (scale * L) (E (e.symm g).val).val at hpg rw [heq] at hpg exact (hlo.trans ha).trans ((mem_primeBand_iff ((Real.exp_pos _).le.trans ha) hb0 p).mp hpg).2.1.le end Bounty end -- Source module: CandidateNumberedProjectedCosts section /- The literal projected root edges for the actual numbered candidate pool. -/ open Finset Filter open scoped Topology BigOperators Classical namespace Bounty def CandidateNumberedProjectedEdgeCosts (scale L vmin vmax A Cbad E z C₂ tau q w x : ℝ) (m J : ℕ) : Prop := let Q := ⌊L ^ q⌋₊ let h := L ^ (-w) let ξ := L ^ (-x) ∀ {N M n B : ℕ} (index : Fin N ≃ ↥(candidatePIndices scale L)), let P := candidateRootPools scale L index let groups := candidateRootBigGroups scale L index ∀ (reindex : {g // g ∉ groupsᶜ} ≃ Fin M), ∀ [∀ z : PhysicalPrime P, NeZero z.2.val] [∀ z : PhysicalPrime (fun a : ↥groupsᶜ => P a.val), NeZero z.2.val] [∀ g (p : P (reindex.symm g).val), NeZero p.val], ∀ (hPs : ∀ (a : ↥groupsᶜ) p, p ∈ P a.val → Nat.Prime p) (hPb : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → Nat.Prime p) (hcross : ∀ (a : ↥groupsᶜ) (g : Fin M), Disjoint (P a.val) (P (reindex.symm g).val)), let V := fun i => ∑ p ∈ P i, 1 / (p : ℝ) ∀ probes : Fin N → Finset (Fin J), (∀ g : Fin M, (probes (reindex.symm g).val).card = m) → ∀ r t : Finset (Fin M), ∀ hrt : Disjoint r t, (1 / (80 * Real.log 2)) * Real.log L ≤ (r.card : ℝ) → (1 / (80 * Real.log 2)) * Real.log L ≤ (t.card : ℝ) → ∀ (ζ : ℕ → ℝ) (k : ℕ → ℤ) (θ : ℝ), (∀ j : Fin (n + 1), |ζ (n-j.val)| ≤ L ^ z) → (∀ j : Fin (n + 1), k (n-j.val) ≠ 0) → (∀ j : Fin (n + 1), ((k (n-j.val)).natAbs : ℝ) ≤ L ^ C₂) → ∀ baseline : (g : Fin M) → P (reindex.symm g).val → ℝ, ∀ T : ℝ, 0 ≤ T → T ≤ L ^ tau → (∀ (g : Fin M) (p : P (reindex.symm g).val), baseline g p = 1 - T / (p.val : ℝ)) → (∀ g p, 1 / 2 ≤ baseline g p ∧ baseline g p ≤ 1) → ∀ (retention : Fin (n + 2) → ℝ) (code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := 1) (n := n) (B := B)) (encode : ((g : Fin M) × P (reindex.symm g).val) → ℤ) (ν : (Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + 1) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1))))) × Fin (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + 1) B ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))))) → ℝ), let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := 1) probes (r.map f) (t.map f))) let C := repeatedBigPrimePatternCut (ell := 1) probes (r.map f) (t.map f) let ζroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := 1) probes (r.map f) (t.map f)) => ζ time let kroot := fun time (_ : RepeatedBigPrimePatternIndex (ell := 1) probes (r.map f) (t.map f)) => k time let β := fun (g : Fin M) (p : P (reindex.symm g).val) => ((p.val : ℝ)*baseline g p)⁻¹ let hC : ∀ i : patterns, ∀ a : ↥groupsᶜ, C i.val a.val = ∅ := fun i a => physical_root_prime_full_pattern_small_cut groups reindex probes r t i.val a let K := fun (time : ℕ) (i : RepeatedBigPrimePatternIndex (ell := 1) probes (r.map f) (t.map f)) (L R : PhysicalMarkLists P J 1) (aux : PhysicalAuxLabels P (C i)) => if time % 2 = 0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i R L aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((Finset.disjoint_map f).mpr hrt) Q h ξ i L R aux let row := physicalRootFourierRow groups reindex patterns C hC kroot V (1/2) ζroot K θ β retention (9/10) hPs hPb hcross code encode ν let Wroot := physicalSmallBigMeasure (fun a : ↥groupsᶜ => V a.val) (productMemoryWeight (fun g p => β g p / V (reindex.symm g).val) (fun g => unrestrictedResidueWeight (fun p => β g p / V (reindex.symm g).val))) let decay := A ^ groupsᶜ.card * (L ^ (-E) + 2 * repeatedBigFamilyEnvelope M m Q ξ * Real.sqrt ((B : ℝ) / (((J + 1).choose 1) ^ groupsᶜ.card : ℕ)) * Real.sqrt (unrestrictedEdgeEnergyBound (9/10) (100*(vmax+1)) vmin vmax (1 + m) ^ M)) let excess := max decay (repeatedBigFamilyEnvelope M m Q ξ * Cbad ^ groupsᶜ.card * Real.sqrt (unrestrictedEdgeEnergyBound (9/10) (100*(vmax+1)) vmin vmax (1 + m) ^ M)) 0 < decay ∧ decay ≤ excess ∧ ∀ (j : Fin (n + 1)) (F : PhysicalRootMixedState (P := P) (J := J) (ell := 1) (B := B) groups reindex → ℂ), (∀ d, ProductMemorySymmetric (fun x => F (d,x))) → cleanActiveNorm Wroot (row none (row (some (.inr j)) (row none F))) ≤ (if j ∈ physicalSelectedAffectedEdges (fun _ : Fin M => J + 1) B (n + 1) code then excess else decay) * cleanActiveNorm Wroot F theorem exists_candidate_numbered_projected_edge_costs {scale : ℝ} (hscale : 0 < scale) : ∃ vmin vmax : ℝ, 0 < vmin ∧ 0 < vmax ∧ (∀ᶠ L : ℝ in atTop, ∀ {N M : ℕ} (index : Fin N ≃ ↥(candidatePIndices scale L)) (reindex : {g // g ∉ (candidateRootBigGroups scale L index)ᶜ} ≃ Fin M), CandidateNumberedPoolBounds scale L vmin vmax (candidateRootPools scale L index) (candidateRootBigGroups scale L index) reindex) ∧ ∀ C₂ : ℝ, ∃ A Cbad : ℝ, 1 ≤ A ∧ 1 ≤ Cbad ∧ ∀ (E D z tau : ℝ) (m J : ℕ), 0 ≤ D → 0 ≤ z → 0 ≤ tau → 1 ≤ m → (1 / (80 * Real.log 2)) * Real.log (((1 : ℕ) : ℝ)^1 / (m : ℝ)^1) / 2 ≤ -(E+2) → (m : ℝ)*(2 / (5 * Real.log 2))*Real.log 3+E+2 ≤ D → let κ := (2 / (5 * Real.log 2)) * Real.log (primeFiberFactorBound vmin m) let s₁ : ℝ := 1/2+1/2 let A₀ := D+2*(s₁+1) let q := 2*κ+(s₁+1)+2*A₀+3 let w := 4*q+max z q+A₀+2 let x := (s₁+w+2)+2*A₀+2 ∀ᶠ L : ℝ in atTop, CandidateNumberedProjectedEdgeCosts scale L vmin vmax A Cbad E z C₂ tau q w x m J := by obtain ⟨vmin,vmax,hvmin,hvmax,hpool⟩ := exists_candidate_numbered_pool_bounds hscale refine ⟨vmin,vmax,hvmin,hvmax,hpool,?_⟩ intro C₂ obtain ⟨A,Cbad,hA,hCbad,hcost⟩ := WeakZeroFree.actual_exists_realized_root_projected_edge_costs (qsmall := (1/2 : ℝ)) (by norm_num) (by norm_num) hvmin hscale 1 C₂ refine ⟨A,Cbad,hA,hCbad,?_⟩ intro E D z tau m J hD hz htau hm hgap hDgap κ s₁ A₀ q w x have ha : (0 : ℝ) ≤ 2 / (5 * Real.log 2) := by positivity have hactual := hcost (1/4) (1/2) z (2/(5*Real.log 2)) vmin D (1/2) E (1/(80*Real.log 2)) tau m J (by norm_num) (by norm_num) hz ha hvmin hD (by norm_num) htau (by norm_num) hm hgap hDgap filter_upwards [hactual,hpool, eventually_mul_rpow_le_exp_rpow q 2 (c := (1/4 : ℝ)) (by norm_num)] with L hc hp hq let Q := ⌊L ^ q⌋₊ intro N M n B index P groups reindex _ _ _ hPs hPb hcross V probes hprobes r t hrt hr ht ζ k θ hζ hk hkmax baseline T hT hTmax hbaseline hbaselineBounds have hd := hp index reindex have hLpos : 0 < L := lt_of_lt_of_le zero_lt_one hd.one_le have hinj : Function.Injective (fun g : Fin M => (reindex.symm g).val) := by intro g h heq exact reindex.symm.injective (Subtype.ext heq) have hbdis : Pairwise (fun g h : Fin M => Disjoint (P (reindex.symm g).val) (P (reindex.symm h).val)) := hd.disjoint.comp_of_injective hinj have hprime : ∀ (g : Fin M) p, p ∈ P (reindex.symm g).val → p.Prime ∧ Q < p := by intro g p hp refine ⟨hd.prime _ p hp, ?_⟩ have hpow : 0 < L^q := Real.rpow_pos_of_pos hLpos _ have hfloor : (Q : ℝ) ≤ L^q := Nat.floor_le hpow.le have hlow := hd.big_lower g p hp have hlt : (Q : ℝ) < (p : ℝ) := by linarith exact_mod_cast hlt exact hc P groups reindex hPs hPb hcross (candidateRootMixedPoolRealization scale L index reindex) V hbdis hprime (fun _ => rfl) (fun g => hd.mass_lower _) hd.big_log hd.big_card_le hd.big_band probes hprobes r t hrt hr ht ζ k θ hζ hk hkmax baseline T (Real.exp (L^(1/4 : ℝ))) hT hTmax le_rfl (fun g p => hd.big_lower g p.val p.property) hbaseline hbaselineBounds (fun a => hd.mass_lower a.val) (9/10) (100*(vmax+1)) vmax (by norm_num) (by norm_num) (by linarith) (fun g => hd.mass_upper _) end Bounty end -- Source module: CandidateNumberedEdgeParameters section /- Fix all candidate edge exponents before the eventual scale and root data. -/ open Filter Finset namespace Bounty theorem exists_candidate_numbered_edge_parameter_order {scale : ℝ} (hscale : 0 < scale) : ∃ vmin vmax : ℝ, 0 < vmin ∧ 0 < vmax ∧ (∀ᶠ L : ℝ in atTop, ∀ {N M : ℕ} (index : Fin N ≃ ↥(candidatePIndices scale L)) (reindex : {g // g ∉ (candidateRootBigGroups scale L index)ᶜ} ≃ Fin M), CandidateNumberedPoolBounds scale L vmin vmax (candidateRootPools scale L index) (candidateRootBigGroups scale L index) reindex) ∧ ∀ C₂ : ℝ, ∃ A Cbad : ℝ, 1 ≤ A ∧ 1 ≤ Cbad ∧ let Kghost := physicalGhostUniformEnergyBound (9/10) vmax (100*(vmax+1)) ∀ Etarget z tau : ℝ, 0 ≤ Etarget → 0 ≤ z → 0 ≤ tau → let a : ℝ := 2 / (5 * Real.log 2) let Cv := max 0 (candidateMixedRareCostExponent 1 Kghost) let G := Etarget + 1 + Cv + 2 0 ≤ G ∧ Etarget + 1 + Cv + 2 ≤ G ∧ ∃ (E : ℝ) (m : ℕ) (D : ℝ), E = G + candidateMixedRareCostExponent A 1 + 1 ∧ 1 ≤ m ∧ 0 ≤ D ∧ (1 / (80 * Real.log 2)) * Real.log (((1 : ℕ) : ℝ)^1 / (m : ℝ)^1) / 2 ≤ -(E+2) ∧ (m : ℝ)*a*Real.log 3 + E+2 ≤ D ∧ let κ := a * Real.log (primeFiberFactorBound vmin m) let s₁ := (1/2 : ℝ) + 1/2 let A₀ := D + 2*(s₁+1) let q := 2*κ + (s₁+1) + 2*A₀ + 3 let w := 4*q + max z q + A₀ + 2 let x := (s₁+w+2) + 2*A₀ + 2 let C := (m : ℝ)*a*Real.log 2 + 4*q + 2*x + 1 let Kedge := unrestrictedEdgeEnergyBound (9/10) (100*(vmax+1)) vmin vmax (1+m) let Ca := max 0 (C + candidateMixedRareCostExponent Cbad Kedge) 0 ≤ q ∧ 0 ≤ w ∧ 0 ≤ x ∧ 0 ≤ C ∧ 0 ≤ Ca ∧ 0 ≤ Cv ∧ ∀ J₀ : ℕ, ∃ J : ℕ, max m J₀ ≤ J ∧ let Ch := max 0 (candidateMixedRareCostExponent 1 ((2 : ℝ)^(2*(J+1)))) 0 ≤ Ch ∧ ∀ᶠ L : ℝ in atTop, CandidateNumberedProjectedEdgeCosts scale L vmin vmax A Cbad E z C₂ tau q w x m J ∧ let Q := ⌊L^q⌋₊ let ξ := L^(-x) let small := (candidateSmallPIndices scale L).card let big := (candidateBigPIndices scale L).card let F := repeatedBigFamilyEnvelope big m Q ξ 0 ≤ F ∧ F ≤ L^C ∧ ∀ cap : ℕ, cap ≤ Nat.ceil (L^2) → let decay := A^small * (L^(-E) + 2*F*Real.sqrt ((cap : ℝ)/(((J+1).choose 1)^small : ℕ))*Real.sqrt (Kedge^big)) decay ≤ L^(-G) ∧ max decay (F*Cbad^small*Real.sqrt (Kedge^big)) ≤ L^Ca ∧ Real.sqrt (Kghost^big) ≤ L^Cv ∧ (2 : ℝ)^((J+1)*big) ≤ L^Ch := by obtain ⟨vmin,vmax,hvmin,hvmax,hpool,hcost⟩ := exists_candidate_numbered_projected_edge_costs hscale refine ⟨vmin,vmax,hvmin,hvmax,hpool,?_⟩ intro C₂ obtain ⟨A,Cbad,hA,hCbad,hcost⟩ := hcost C₂ refine ⟨A,Cbad,hA,hCbad,?_⟩ intro Kghost Etarget z tau hEt hz ht a Cv G have hKghost : 0 ≤ Kghost := (Real.exp_pos _).le have hs := exists_candidate_selected_parameter_order hscale candidate_selection_beta_pos 1 (by norm_num) A Cbad (Etarget+1) (1/2) z (1/2) (9/10) (100*(vmax+1)) vmin vmax Kghost (by linarith) (by linarith) (by linarith) (by norm_num) hz (by norm_num) hKghost obtain ⟨hG,hgain,E,m,D,hE,hm,hD,hgap,hDgap,hs⟩ := hs refine ⟨hG,hgain,E,m,D,hE,hm,hD,hgap,hDgap,?_⟩ intro κ s₁ A₀ q w x C Kedge Ca obtain ⟨hq,hw,hx,hC,hCa,hCv,hs⟩ := hs refine ⟨hq,hw,hx,hC,hCa,hCv,?_⟩ intro J₀ obtain ⟨J,hJ,hCh,hbudget⟩ := hs J₀ refine ⟨J,hJ,hCh,?_⟩ exact (hcost E D z tau m J hD hz ht hm hgap hDgap).and hbudget end Bounty end end section -- Source module: ActualSelectedHighRank /- The actual half-endpoint high-rank estimate in the common candidate environment. -/ open scoped Topology BigOperators Classical -- Source module: ActualRootHalfParameters section /- The literal half-endpoint weights supply the mass, atom, and ghost hypotheses of the original high-rank forest estimate. -/ open scoped BigOperators Classical namespace Bounty theorem actual_root_half_parameters {G : Type*} (P : G → Finset ℕ) (V : G → ℝ) (edges : ℕ) (L vmin vmax : ℝ) (hvmin : 0 < vmin) (hvmax : 0 ≤ vmax) (hVmin : ∀ g, vmin ≤ V g) (hVmax : ∀ g, V g ≤ vmax) (hMass : ∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) (hsize : ∀ g (p : P g), 2 * (edges + 1) ≤ p.val) (hprime : ∀ g (p : P g), Real.exp (L ^ (3/10 : ℝ)) ≤ (p.val : ℝ)) : let v := 100 * (vmax + 1) let η := (2 / vmin) * Real.exp (-(L ^ (3/10 : ℝ))) let ε := max (2 / vmin) (2 * vmax * v / ((9/10 : ℝ) * vmin)) * Real.exp (-(L ^ (3/10 : ℝ))) 1 < v ∧ 0 < η ∧ η ≤ ε ∧ 0 < ε ∧ (∀ g (p : P g), 0 < ((p.val : ℝ) * physicalEndpointBaseline (1/2) edges p.val)⁻¹ / V g ∧ ((p.val : ℝ) * physicalEndpointBaseline (1/2) edges p.val)⁻¹ / V g ≤ η) ∧ (∀ g, (∑ p : P g, ((p.val : ℝ) * physicalEndpointBaseline (1/2) edges p.val)⁻¹ / V g) ≤ 2) ∧ (∀ j : ℕ, 0 ≤ physicalEndpointSchedule (1/2) edges j ∧ physicalEndpointSchedule (1/2) edges j ≤ 1 ∧ physicalEndpointSchedule (1/2) edges j / (9/10 : ℝ)^2 + ((1 - physicalEndpointSchedule (1/2) edges j) / (9/10 : ℝ)) / v ≤ 1 ∧ ∀ g, physicalEndpointSchedule (1/2) edges j / (9/10 : ℝ)^2 + (((1 - physicalEndpointSchedule (1/2) edges j) * V g) / (9/10 : ℝ)) / v ≤ 1 ∧ physicalEndpointSchedule (1/2) edges j / (9/10 : ℝ)^2 + (((1 - physicalEndpointSchedule (1/2) edges j) * (2 * V g)) / (9/10 : ℝ)) / v ≤ 1) ∧ (∀ (j : ℕ) g, |(1 - physicalEndpointSchedule (1/2) edges j) * V g / (9/10 : ℝ)| * η * v ≤ ε) := by intro v η ε have hq0 : (0 : ℝ) ≤ 1/2 := by norm_num have hq1 : (1/2 : ℝ) ≤ 1 := by norm_num have hVpos : ∀ g, 0 < V g := fun g => hvmin.trans_le (hVmin g) have hv : 1 < v := by dsimp only [v]; linarith have hr := root_birth_rarity_envelope_bounds (L := L) (vmax := vmax) (ρ := (9/10 : ℝ)) (v := v) hvmin (by norm_num) (by linarith) have hs (j : ℕ) := physical_endpoint_schedule_unit hq0 hq1 edges j have hghost := physical_endpoint_half_ghost_budgets hvmax edges refine ⟨hv, hr.1, hr.2.1, hr.2.2.1, ?_, ?_, ?_, ?_⟩ · intro g p refine ⟨physical_root_endpoint_weight_pos V (1/2) edges hq0 hq1 hVpos hsize g p, ?_⟩ have hp0 : 0 < p.val := by have := hsize g p; omega exact physical_root_reciprocal_atom_bound p.val hvmin (hVmin g) (physical_endpoint_baseline_bounds hq0 hq1 edges p.val hp0 (hsize g p)).1 (hprime g p) · exact physical_root_endpoint_weight_sum_le_two V (1/2) edges hq0 hq1 hVpos hMass hsize · intro j refine ⟨(hs j).1, (hs j).2, (hghost.2 j).1, ?_⟩ intro g refine ⟨?_, (hghost.2 j).2 (V g) (hVpos g).le (hVmax g)⟩ exact root_ghost_scalar_budget (hs j).1 (physical_endpoint_half_schedule_le_three_quarters edges j) hvmax (hVpos g).le ((hVmax g).trans (by linarith)) · intro j g exact hr.2.2.2 _ (V g) (hs j).1 (hs j).2 (hVmin g) (hVmax g) end Bounty end -- Source module: ActualRootHalfRankPower section /- The original forest contribution for the literal half-endpoint law has a polynomial prefactor and the explicit prime-atom rarity power. -/ open Finset open scoped Classical namespace Bounty theorem exists_physical_root_half_high_rank_power {vs vmin vmax : ℝ} (hvs : 0 < vs) (hvmin : 0 < vmin) (hvmax : 0 ≤ vmax) (ell : ℕ) : ∃ Ahi : ℝ, 1 ≤ Ahi ∧ ∀ (I : Type) (N M J n B : ℕ) (P : Fin N → Finset ℕ) (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ z : PhysicalPrime P, NeZero z.2.val] (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (_i0 : patterns) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ) (encode : ((g : Fin M) × P (e.symm g).val) → ℤ), Function.Injective encode → ∀ (L Cgroup Ccoeff Arow Hkernel : ℝ) (T : ℕ), 1 ≤ L → 0 ≤ Cgroup → 0 ≤ Ccoeff → 1 ≤ Arow → 1 ≤ Hkernel → Real.exp (2 * vmax * (100 * (vmax + 1)) / (9/10 : ℝ)) ≤ Arow → unrestrictedEdgeRowBound (9/10) (100 * (vmax + 1)) vmin T ≤ Arow → (∀ s : ↥groupsᶜ, vs ≤ V s.val) → (∀ g : Fin M, vmin ≤ V (e.symm g).val) → (∀ g : Fin M, V (e.symm g).val ≤ vmax) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g p, p ∈ P g → Nat.Prime p) → Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ (g : Fin M) (p : P (e.symm g).val), 2 * (n + 2) ≤ p.val) → (∀ (g : Fin M) (p : P (e.symm g).val), Real.exp (L ^ (3/10 : ℝ)) ≤ (p.val : ℝ)) → (∀ (i : patterns) (g : Fin M), (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) → (M : ℝ) ≤ Cgroup * Real.log L → (Ahi ^ groupsᶜ.card * (patterns.card : ℝ)) * Hkernel ≤ L ^ Ccoeff → (∀ time < n + 1, ∀ i ∈ patterns, ∀ U W aux, ‖K time i U W aux‖ ≤ Hkernel) → let budget := Ccoeff + 4 * Cgroup * Real.log Arow + (Cgroup * ((J + ell : ℕ) : ℝ)) * Real.log 2 let ε := max (2 / vmin) (2 * vmax * (100 * (vmax + 1)) / ((9/10 : ℝ) * vmin)) * Real.exp (-(L ^ (3/10 : ℝ))) 0 ≤ budget ∧ 0 < ε ∧ ∀ θ : ℝ, ∀ code : PhysicalRootCommonForestCode (M := M) (J := J) (ell := ell) (n := n) (B := B), ‖physicalRootForestContribution groups e patterns C hC k V (1/2) ζ K θ (fun (g : Fin M) (p : P (e.symm g).val) => ((p.val : ℝ) * physicalEndpointBaseline (1/2) (n + 1) p.val)⁻¹) (fun j => physicalEndpointSchedule (1/2) (n + 1) j.val) (9/10) code‖ ≤ L ^ (budget * (((n + 1 : ℕ) : ℝ) + 1)) * ε ^ birthForestRank code := by obtain ⟨Ahi, hAhi, hbound⟩ := exists_physical_root_high_rank_contribution_power_le (qmax := (3/4 : ℝ)) (vs := vs) (by norm_num) (by norm_num) hvs ell refine ⟨Ahi, hAhi, ?_⟩ intro I N M J n B P groups e _ patterns C hC k V i0 ζ K encode hinj L Cgroup Ccoeff Arow Hkernel T hL hCgroup hCcoeff hArow hHkernel hrowghost hrowedge hVs hVmin hVmax hMass hP hdis hsize hprime hT hM hcoeff hK budget ε let v := 100 * (vmax + 1) let η := (2 / vmin) * Real.exp (-(L ^ (3/10 : ℝ))) let β := fun (g : Fin M) (p : P (e.symm g).val) => ((p.val : ℝ) * physicalEndpointBaseline (1/2) (n + 1) p.val)⁻¹ let retention : Fin (n + 2) → ℝ := fun j => physicalEndpointSchedule (1/2) (n + 1) j.val obtain ⟨hv, hη, hηε, hε, hμ, hmass, hret, hghost⟩ := actual_root_half_parameters (fun g : Fin M => P (e.symm g).val) (fun g => V (e.symm g).val) (n + 1) L vmin vmax hvmin hvmax hVmin hVmax (fun g => hMass (e.symm g).val) hsize hprime have hCh : 0 ≤ (Cgroup * ((J + ell : ℕ) : ℝ)) * Real.log 2 := by positivity have hbudget : 0 ≤ budget := by dsimp only [budget] exact add_nonneg (add_nonneg hCcoeff (mul_nonneg (mul_nonneg (by norm_num) hCgroup) (Real.log_nonneg hArow))) hCh refine ⟨hbudget, hε, ?_⟩ intro θ code have hInitial : (∏ g, (∑ p, β g p / V (e.symm g).val) ^ (J + ell)) ≤ L ^ ((Cgroup * ((J + ell : ℕ) : ℝ)) * Real.log 2) := by apply root_initial_mass_polynomial (zero_lt_one.trans_le hL) (J + ell) (fun g => ∑ p, β g p / V (e.symm g).val) · intro g exact ⟨sum_nonneg (fun p _ => (hμ g p).1.le), hmass g⟩ · simpa only [Fintype.card_fin] using hM have hcross : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (e.symm g).val) := fun s g => hdis (by intro he; exact (e.symm g).property (he ▸ s.property)) have hsqrt : Real.sqrt (1/2 : ℝ) ≤ 3/4 := by apply (Real.sqrt_le_iff).2 norm_num exact @hbound I N M J n B P groups e inferInstance patterns C hC k V (1/2) β retention (9/10) hVs hsqrt i0 v vmin (fun _ => η) ε T (fun g => hMass (e.symm g).val) (fun g p => (hμ g p).1.le) hmass (fun _ => hη.le) (fun g p => (hμ g p).2) (fun j g => hghost j.val g) (fun _ => hηε) (fun j => (hret j.val).1) (fun j => (hret j.val).2.1) (by norm_num) (by norm_num) hv hvmin hVmin (fun j => (hret j.val).2.2.1) hT hε.le Hkernel hHkernel ζ K θ hK (fun s p hp => hP s.val p hp) (fun g p hp => hP (e.symm g).val p hp) hcross (fun s => hMass s.val) encode hinj L Cgroup Ccoeff ((Cgroup * ((J + ell : ℕ) : ℝ)) * Real.log 2) Arow vmax hL hCgroup hCcoeff hCh hArow hrowghost hrowedge hVmax hM hcoeff hInitial code end Bounty end -- Source module: ActualRootHalfRarity section /- Prime size and birth-address rarity for the literal half-schedule length. -/ open Filter namespace Bounty theorem eventually_actual_root_half_prime_size : ∀ᶠ L : ℝ in atTop, ∀ p : ℕ, Real.exp (L ^ (3/10 : ℝ)) ≤ (p : ℝ) → 2 * (2 * Nat.ceil (L ^ (13/25 : ℝ)) + 1) ≤ p := by filter_upwards [eventually_gt_atTop (0 : ℝ), eventually_repeated_big_visit_density_le (alpha := 13/25) (tau := 1) zero_lt_one (by norm_num), eventually_mul_rpow_log_add_le_rpow (a := 0) (b := 3/10) (c := 1) (by norm_num) (by norm_num) zero_lt_one 1 (Real.log 2)] with L hL hlength hlog intro p hp have hlen : ((2 * Nat.ceil (L ^ (13/25 : ℝ)) + 1 : ℕ) : ℝ) ≤ L := by have ht := hlength (2 * (Nat.ceil (L ^ (13/25 : ℝ)) : ℝ) + 1) le_rfl simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one, Real.rpow_one] using ht have hexp : 2 * L ≤ Real.exp (L ^ (3/10 : ℝ)) := by calc 2 * L = Real.exp (Real.log L + Real.log 2) := by rw [Real.exp_add, Real.exp_log hL, Real.exp_log (by norm_num : (0 : ℝ) < 2)] ring _ ≤ _ := Real.exp_le_exp.mpr (by simpa only [Real.rpow_zero, mul_one, one_mul] using hlog) exact_mod_cast (mul_le_mul_of_nonneg_left hlen (by norm_num : (0 : ℝ) ≤ 2)).trans (hexp.trans hp) theorem actual_root_half_length_succ {L : ℝ} (hL : 0 < L) : (2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1) + 1 = 2 * Nat.ceil (L ^ (13/25 : ℝ)) := by have hceil : 0 < Nat.ceil (L ^ (13/25 : ℝ)) := Nat.ceil_pos.mpr (Real.rpow_pos_of_pos hL _) omega theorem eventually_actual_root_half_birth_rarity (J ell : ℕ) (Cgroup C : ℝ) (hC : 0 ≤ C) : ∀ᶠ L : ℝ in atTop, let n := 2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1 ∀ M : ℕ, (M : ℝ) ≤ Cgroup * Real.log L → (Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) (Nat.ceil L) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))) : ℝ) ^ 2 * (C * Real.exp (-(L ^ (3/10 : ℝ)))) ≤ Real.exp (-(L ^ (1/4 : ℝ))) := by filter_upwards [eventually_gt_atTop (0 : ℝ), eventually_root_birth_card_linear_cap J ell Cgroup, eventually_root_birth_rarity_gap C] with L hL hcount hgap dsimp only rw [actual_root_half_length_succ hL] intro M hM exact hgap _ (hcount M hM) _ (mul_nonneg hC (Real.exp_pos _).le) le_rfl end Bounty end -- Source module: RootFiniteIntegerEncoding section /- Any finite root-label type has an injective integer encoding. -/ namespace Bounty theorem exists_root_finite_integer_encoding (α : Type*) [Fintype α] : ∃ encode : α → ℤ, Function.Injective encode := by refine ⟨fun a => ((Fintype.equivFin α) a).val, ?_⟩ intro a b h apply (Fintype.equivFin α).injective apply Fin.ext exact Int.ofNat.inj h end Bounty end -- Source module: ActualRootHalfHighRank section /- The literal half-endpoint moment schedule supplies the high-rank callback and the birth-dimension rarity bound for the residue estimate. -/ open Finset Filter open scoped Classical namespace Bounty theorem exists_actual_root_half_high_rank_callback {vs vmin vmax : ℝ} (hvs : 0 < vs) (hvmin : 0 < vmin) (hvmax : 0 ≤ vmax) (ell : ℕ) : ∃ Ahi : ℝ, 1 ≤ Ahi ∧ ∀ (J T : ℕ) (Cgroup Ccoeff Arow : ℝ), 0 ≤ Cgroup → 0 ≤ Ccoeff → 1 ≤ Arow → Real.exp (2 * vmax * (100 * (vmax + 1)) / (9/10 : ℝ)) ≤ Arow → unrestrictedEdgeRowBound (9/10) (100 * (vmax + 1)) vmin T ≤ Arow → ∀ᶠ L : ℝ in atTop, let n := 2 * Nat.ceil (L ^ (13/25 : ℝ)) - 1 let ε := max (2 / vmin) (2 * vmax * (100 * (vmax + 1)) / ((9/10 : ℝ) * vmin)) * Real.exp (-(L ^ (3/10 : ℝ))) let budget := Ccoeff + 4 * Cgroup * Real.log Arow + (Cgroup * ((J + ell : ℕ) : ℝ)) * Real.log 2 ∀ (I : Type) (N M : ℕ) (P : Fin N → Finset ℕ) (groups : Finset (Fin N)) (e : {g // g ∉ groupsᶜ} ≃ Fin M) [∀ z : PhysicalPrime P, NeZero z.2.val] (patterns : Finset I) (C : I → Fin N → Finset (Fin J)) (hC : ∀ i : patterns, ∀ g : ↥groupsᶜ, C i.val g.val = ∅) (k : ℕ → I → ℤ) (V : Fin N → ℝ) (_i0 : patterns) (ζ : ℕ → I → ℝ) (K : ∀ (_ : ℕ) i, PhysicalMarkLists P J ell → PhysicalMarkLists P J ell → PhysicalAuxLabels P (C i) → ℂ), ∀ Hkernel : ℝ, 1 ≤ Hkernel → (∀ s : ↥groupsᶜ, vs ≤ V s.val) → (∀ g : Fin M, vmin ≤ V (e.symm g).val) → (∀ g : Fin M, V (e.symm g).val ≤ vmax) → (∀ g, ∑ p ∈ P g, 1 / (p : ℝ) = V g) → (∀ g p, p ∈ P g → Nat.Prime p) → Pairwise (fun g h => Disjoint (P g) (P h)) → (∀ (g : Fin M) (p : P (e.symm g).val), Real.exp (L ^ (3/10 : ℝ)) ≤ (p.val : ℝ)) → (∀ (i : patterns) (g : Fin M), (physicalFullSharedIndices (ell := ell) (C i.val (e.symm g).val))ᶜ.card ≤ T) → (M : ℝ) ≤ Cgroup * Real.log L → (Ahi ^ groupsᶜ.card * (patterns.card : ℝ)) * Hkernel ≤ L ^ Ccoeff → (∀ time < n + 1, ∀ i ∈ patterns, ∀ U W aux, ‖K time i U W aux‖ ≤ Hkernel) → let m := Fintype.card (FullMixedCommonBirthAddress (fun _ : Fin M => J + ell) (Nat.ceil L) ((List.range (4 * (n + 1) + 1)).map (physicalSelectedFineTag (n + 1)))) 0 ≤ budget ∧ 0 < ε ∧ (m : ℝ) ≤ L ^ (6 : ℝ) ∧ (m : ℝ) ^ 2 * ε ≤ Real.exp (-(L ^ (1/4 : ℝ))) ∧ ∀ θ : ℝ, ∀ code : BirthForestCode m, ‖physicalRootForestContribution groups e patterns C hC k V (1/2) ζ K θ (fun (g : Fin M) (p : P (e.symm g).val) => ((p.val : ℝ) * physicalEndpointBaseline (1/2) (n + 1) p.val)⁻¹) (fun j => physicalEndpointSchedule (1/2) (n + 1) j.val) (9/10) code‖ ≤ L ^ (budget * (((n + 1 : ℕ) : ℝ) + 1)) * ε ^ birthForestRank code := by obtain ⟨Ahi, hAhi, hbound⟩ := exists_physical_root_half_high_rank_power hvs hvmin hvmax ell refine ⟨Ahi, hAhi, ?_⟩ intro J T Cgroup Ccoeff Arow hCgroup hCcoeff hArow hrowghost hrowedge let rarity := max (2 / vmin) (2 * vmax * (100 * (vmax + 1)) / ((9/10 : ℝ) * vmin)) have hrarity : 0 ≤ rarity := by exact le_trans (by positivity : (0 : ℝ) ≤ 2 / vmin) (le_max_left _ _) filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_actual_root_half_prime_size, eventually_actual_root_half_birth_rarity J ell Cgroup rarity hrarity, eventually_root_birth_card_linear_cap J ell Cgroup] with L hL hsizeL hrare hcount intro n ε budget I N M P groups e _ patterns C hC k V i0 ζ K Hkernel hHkernel hVs hVmin hVmax hMass hP hdis hprime hT hM hcoeff hK m have hn : n + 1 = 2 * Nat.ceil (L ^ (13/25 : ℝ)) := actual_root_half_length_succ (zero_lt_one.trans_le hL) have hsize : ∀ (g : Fin M) (p : P (e.symm g).val), 2 * (n + 2) ≤ p.val := by intro g p have hh := hsizeL p.val (hprime g p) have hstep : n + 2 = 2 * Nat.ceil (L ^ (13/25 : ℝ)) + 1 := by omega simpa only [hstep] using hh obtain ⟨encode, hinj⟩ := exists_root_finite_integer_encoding ((g : Fin M) × P (e.symm g).val) have hpower := @hbound I N M J n (Nat.ceil L) P groups e inferInstance patterns C hC k V i0 ζ K encode hinj L Cgroup Ccoeff Arow Hkernel T hL hCgroup hCcoeff hArow hHkernel hrowghost hrowedge hVs hVmin hVmax hMass hP hdis hsize hprime hT hM hcoeff hK refine ⟨hpower.1, hpower.2.1, ?_, ?_, hpower.2.2⟩ · dsimp only [m] rw [hn] exact (hcount M hM).trans_eq (Real.rpow_natCast L 6).symm · exact hrare M hM end Bounty end end section -- Source module: ActualErdos1057Target /- The exact challenge target, using the actual candidate residue bound. -/ open scoped Topology BigOperators Classical -- Source module: CandidateNumberedResidueTransfer section /- Finite selections and exact group reindexing recover the original selected model. -/ open Finset Filter open scoped Classical namespace Bounty def CandidateUniformNumberedResidueBounds (scale : ℝ) : Prop := ∀ E z K : ℝ, 0 ≤ E → 0 ≤ z → 0 ≤ K → ∃ (m J : ℕ) (w x q : ℝ), m ≤ J ∧ 0 ≤ w ∧ 0 ≤ x ∧ 0 ≤ q ∧ ∀ᶠ L : ℝ in atTop, ∀ {N : ℕ} (index : Fin N ≃ ↥(candidatePIndices scale L)), let P := candidateRootPools scale L index let V := fun g => ∑ p ∈ P g, 1/(p : ℝ) ∀ (probes : Fin N → Finset (Fin J)), (∀ g, (probes g).card = m) → ∀ r t : Finset (Fin N), ∀ hrt : Disjoint r t, r ⊆ candidateRootBigGroups scale L index → t ⊆ candidateRootBigGroups scale L index → (1/(80*Real.log 2))*Real.log L ≤ (r.card : ℝ) → (1/(80*Real.log 2))*Real.log L ≤ (t.card : ℝ) → ∀ [∀ p : PhysicalPrime P, NeZero p.2.val], ∀ ζ : ℝ, |ζ| ≤ L^z → ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), k ≠ 0 → let Q := ⌊L^q⌋₊ let patterns := (univ : Finset (RepeatedBigPrimePatternIndex (ell := 1) probes r t)) let cuts := repeatedBigPrimePatternCut (ell := 1) probes r t let ζt := fun time (_ : RepeatedBigPrimePatternIndex (ell := 1) probes r t) => if time%2=0 then -ζ else ζ let kt := fun time (_ : RepeatedBigPrimePatternIndex (ell := 1) probes r t) => if time%2=0 then -k else k let Kt := fun time a u v aux => if time%2=0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q (L^(-w)) (L^(-x)) a v u aux) else physicalRootPrimeKernel P V probes r t hrt Q (L^(-w)) (L^(-x)) a u v aux ‖physicalRootResidueModel V patterns cuts (1/2) ζt kt Kt (2*Nat.ceil (L^(13/25 : ℝ))-1)‖ ≤ 2*L^(-(E+1)*(2*Nat.ceil (L^(13/25 : ℝ)) : ℕ)) theorem candidate_selected_residue_bounds_of_uniform_numbered {scale : ℝ} (hscale : 0 < scale) (h : CandidateUniformNumberedResidueBounds scale) : CandidateSelectedResidueBounds scale := by intro E z K hE hz hK obtain ⟨m,J,w,x,q,hmJ,hw,hx,hq,hnum⟩ := h E z K hE hz hK refine ⟨J,w,x,q,hw,hx,hq,?_⟩ filter_upwards [hnum,eventually_candidate_disjoint_big_selections hscale, eventually_ge_atTop (1 : ℝ)] with L hnum hselect hL intro S P V obtain ⟨r,t,hrt,hbig,hr,ht⟩ := hselect obtain ⟨probes,hprobes,_⟩ := exists_uniform_card_probes S hmJ let Q := ⌊L^q⌋₊ refine ⟨probes,r,t,hrt,Q,hbig,Nat.floor_le (Real.rpow_nonneg (by linarith) _),?_⟩ intro inst ζ hζ k hk hk0 let e : S ≃ Fin S.card := Fintype.equivFinOfCardEq (Fintype.card_coe S) let : ∀ p : PhysicalPrime (candidateRootPools scale L e.symm), NeZero p.2.val := fun p => inst ⟨e.symm p.1,p.2⟩ have hrbig : r.map e.toEmbedding ⊆ candidateRootBigGroups scale L e.symm := by intro g hg obtain ⟨i,hi,rfl⟩ := mem_map.mp hg apply (candidate_root_big_groups_mem scale L e.symm _).mpr simpa only [Equiv.toEmbedding_apply, Equiv.symm_apply_apply] using hbig i (mem_union_left _ hi) have htbig : t.map e.toEmbedding ⊆ candidateRootBigGroups scale L e.symm := by intro g hg obtain ⟨i,hi,rfl⟩ := mem_map.mp hg apply (candidate_root_big_groups_mem scale L e.symm _).mpr simpa only [Equiv.toEmbedding_apply, Equiv.symm_apply_apply] using hbig i (mem_union_right _ hi) have hn := hnum e.symm (fun g => probes (e.symm g)) (fun g => hprobes _) (r.map e.toEmbedding) (t.map e.toEmbedding) ((disjoint_map e.toEmbedding).mpr hrt) hrbig htbig (by simpa only [card_map] using hr) (by simpa only [card_map] using ht) ζ hζ k hk hk0 have heq := physical_root_prime_residue_model_finset_reindex S P J 1 V probes r t hrt Q (L^(-w)) (L^(-x)) (1/2) (fun time => if time%2=0 then -ζ else ζ) (fun time => if time%2=0 then -k else k) (2*Nat.ceil (L^(13/25 : ℝ))-1) dsimp only at heq exact (congrArg (fun z : ℂ => ‖z‖) heq).le.trans hn end Bounty end -- Source module: CandidateOriginalSchedules section /- Original determinant and alternating schedules at the selected moment length. -/ open Filter Finset namespace Bounty theorem original_determinant_natAbs_le {L K : ℝ} (hL : 3 ≤ L) (hK : 0 ≤ K) {k : ℤ} (hk : k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ)) : (k.natAbs : ℝ) ≤ L ^ (K+89) := by have hL0 : 0 < L := by linarith have hkabs : |k| ≤ (typeIIAdmissibleDeterminantBound L K : ℤ) := abs_le.mpr (mem_Icc.mp hk) have hknat : k.natAbs ≤ typeIIAdmissibleDeterminantBound L K := by rw [← Int.natCast_natAbs] at hkabs exact_mod_cast hkabs calc _ ≤ (typeIIAdmissibleDeterminantBound L K : ℝ) := by exact_mod_cast hknat _ ≤ 3 * L^(K+88) := determinant_bound_le_three_rpow_public (by linarith) hK _ ≤ L * L^(K+88) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = L^(K+89) := by rw [mul_comm, ← Real.rpow_add_one hL0.ne']; congr 1; ring theorem original_alternating_schedule_bounds {L K z ζ : ℝ} (hL : 3 ≤ L) (hK : 0 ≤ K) (hζ : |ζ| ≤ L^z) {k : ℤ} (hk : k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ)) (hk0 : k ≠ 0) (time : ℕ) : |if time%2=0 then -ζ else ζ| ≤ L^z ∧ (if time%2=0 then -k else k) ≠ 0 ∧ ((if time%2=0 then -k else k).natAbs : ℝ) ≤ L^(K+89) := by have hkn := original_determinant_natAbs_le hL hK hk split_ifs <;> simpa only [abs_neg, neg_ne_zero, Int.natAbs_neg] using And.intro hζ (And.intro hk0 hkn) theorem eventually_original_root_length_data : ∀ᶠ L : ℝ in atTop, let n := 2*Nat.ceil (L^(13/25 : ℝ))-1 n+1 = 2*Nat.ceil (L^(13/25 : ℝ)) ∧ L^(1/2 : ℝ) ≤ ((n+1 : ℕ) : ℝ) ∧ ((n+2 : ℕ) : ℝ) ≤ L ∧ 0 ≤ ∑ j ∈ range (n+2), (1-physicalEndpointSchedule (1/2) (n+1) j) ∧ (∑ j ∈ range (n+2), (1-physicalEndpointSchedule (1/2) (n+1) j)) ≤ L ∧ L ≤ (Nat.ceil L : ℝ) ∧ Nat.ceil L ≤ Nat.ceil (L^2) := by filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_repeated_big_visit_density_le (alpha := 13/25) (tau := 1) zero_lt_one (by norm_num)] with L hL hlength intro n have hpow : 1 ≤ L^(13/25 : ℝ) := Real.one_le_rpow hL (by norm_num) have hceil : 1 ≤ Nat.ceil (L^(13/25 : ℝ)) := by exact_mod_cast hpow.trans (Nat.le_ceil _) have hn : n+1 = 2*Nat.ceil (L^(13/25 : ℝ)) := by dsimp [n]; omega have hn2 : ((n+2 : ℕ) : ℝ) ≤ L := by have hh := hlength (2*(Nat.ceil (L^(13/25 : ℝ)) : ℝ)+1) le_rfl rw [show n+2 = 2*Nat.ceil (L^(13/25 : ℝ))+1 by omega] simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one, Real.rpow_one] using hh refine ⟨hn, ?_, hn2, ?_, ?_, Nat.le_ceil _, ?_⟩ · calc _ ≤ L^(13/25 : ℝ) := Real.rpow_le_rpow_of_exponent_le hL (by norm_num) _ ≤ (Nat.ceil (L^(13/25 : ℝ)) : ℝ) := Nat.le_ceil _ _ ≤ ((n+1 : ℕ) : ℝ) := by rw [hn]; push_cast; nlinarith [show (0 : ℝ) ≤ (Nat.ceil (L^(13/25 : ℝ)) : ℝ) from Nat.cast_nonneg _] · exact physical_endpoint_damping_sum_nonneg (by norm_num) (by norm_num) (n+1) · exact (physical_endpoint_damping_sum_le (by norm_num) (by norm_num) (n+1)).trans (by push_cast at hn2 ⊢; linarith) · exact Nat.ceil_mono (by nlinarith) end Bounty end -- Source module: CandidateNumberedBaseline section /- The literal endpoint baseline meets the scalar model's positive-mass hypotheses. -/ open Filter Finset namespace Bounty theorem eventually_candidate_numbered_baseline_data {scale vmin vmax : ℝ} (hvmin : 0 < vmin) : ∀ᶠ L : ℝ in atTop, ∀ {N M : ℕ} (index : Fin N ≃ ↥(candidatePIndices scale L)) (reindex : {g // g ∉ (candidateRootBigGroups scale L index)ᶜ} ≃ Fin M), let P := candidateRootPools scale L index let groups := candidateRootBigGroups scale L index CandidateNumberedPoolBounds scale L vmin vmax P groups reindex → let n := 2*Nat.ceil (L^(13/25 : ℝ))-1 let V := fun i => ∑ p ∈ P i, 1/(p : ℝ) let beta := fun (g : Fin M) (p : P (reindex.symm g).val) => ((p.val : ℝ)*physicalEndpointBaseline (1/2) (n+1) p.val)⁻¹ / V (reindex.symm g).val (∀ (g : Fin M) (p : P (reindex.symm g).val), 2*(n+2) ≤ p.val) ∧ (∀ (g : Fin M) (p : P (reindex.symm g).val), 1/2 ≤ physicalEndpointBaseline (1/2) (n+1) p.val ∧ physicalEndpointBaseline (1/2) (n+1) p.val ≤ 1) ∧ (∀ g p, 0 < beta g p) ∧ (∀ g, (∑ p, beta g p) ≤ 2) ∧ ∀ J : ℕ, (∏ g, (∑ p, beta g p)^(J+1)) ≤ (2 : ℝ)^((J+1)*M) := by filter_upwards [eventually_original_root_length_data, eventually_mul_rpow_le_exp_rpow 1 2 (c := (1/4 : ℝ)) (by norm_num)] with L hlen hexp intro N M index reindex P groups hd n V beta have hsize : ∀ (g : Fin M) (p : P (reindex.symm g).val), 2*(n+2) ≤ p.val := by intro g p have hlow := hd.big_lower g p.val p.property have hn : ((n+2 : ℕ) : ℝ) ≤ L := hlen.2.2.1 simp only [Real.rpow_one] at hexp have hh : (2 : ℝ)*((n+2 : ℕ) : ℝ) ≤ (p.val : ℝ) := by linarith exact_mod_cast hh have hbase : ∀ (g : Fin M) (p : P (reindex.symm g).val), 1/2 ≤ physicalEndpointBaseline (1/2) (n+1) p.val ∧ physicalEndpointBaseline (1/2) (n+1) p.val ≤ 1 := by intro g p exact physical_endpoint_baseline_bounds (by norm_num) (by norm_num) (n+1) p.val (hd.prime _ p.val p.property).pos (by simpa only [Nat.add_assoc] using hsize g p) have hpos : ∀ g p, 0 < beta g p := by intro g p exact physical_endpoint_beta_pos (P := fun g : Fin M => P (reindex.symm g).val) (fun g : Fin M => V (reindex.symm g).val) (1/2) (n+1) (by norm_num) (by norm_num) g (hvmin.trans_le (hd.mass_lower _)) p (hd.prime _ p.val p.property).pos (by simpa only [Nat.add_assoc] using hsize g p) have hmass : ∀ g, (∑ p, beta g p) ≤ 2 := by intro g exact (physical_endpoint_beta_mass_bounds (P := fun g : Fin M => P (reindex.symm g).val) (fun g : Fin M => V (reindex.symm g).val) (1/2) (n+1) (by norm_num) (by norm_num) g (hvmin.trans_le (hd.mass_lower _)) rfl (fun p => (hd.prime _ p.val p.property).pos) (by simpa only [Nat.add_assoc] using hsize g)).2 refine ⟨hsize,hbase,hpos,hmass,?_⟩ intro J calc _ ≤ ∏ _g : Fin M, (2 : ℝ)^(J+1) := by apply Finset.prod_le_prod₀ · intro g _ exact pow_nonneg (sum_nonneg (fun p _ => (hpos g p).le)) _ · intro g _ exact pow_le_pow_left₀ (sum_nonneg (fun p _ => (hpos g p).le)) (hmass g) _ _ = _ := by simp only [prod_const, card_univ, Fintype.card_fin, ← pow_mul] theorem eventually_candidate_numbered_group_card {scale : ℝ} (hscale : 0 < scale) : ∀ᶠ L : ℝ in atTop, ∀ {N : ℕ} (_index : Fin N ≃ ↥(candidatePIndices scale L)), (N : ℝ) ≤ (2/(5*Real.log 2))*Real.log L ∧ ∀ groups : Finset (Fin N), (Fintype.card ↥groupsᶜ : ℝ) ≤ (2/(5*Real.log 2))*Real.log L := by obtain ⟨v,V,_,_,hp⟩ := exists_candidate_P_pool_bounds hscale filter_upwards [hp] with L hp intro N index have hcard : N = (candidatePIndices scale L).card := by simpa only [Fintype.card_fin, Fintype.card_coe] using Fintype.card_congr index have hn : (N : ℝ) ≤ (2/(5*Real.log 2))*Real.log L := by rw [hcard] exact hp.2.2.2.1 refine ⟨hn,?_⟩ intro groups apply le_trans _ hn have hh : Fintype.card ↥groupsᶜ ≤ N := by simpa only [Fintype.card_coe, Fintype.card_fin] using card_le_univ groupsᶜ exact_mod_cast hh end Bounty end -- Source module: CandidateNumberedPrimeData section /- Strong big-prime size and all-pool determinant avoidance after numbering. -/ open Finset Filter namespace Bounty theorem eventually_candidate_numbered_prime_data {scale K : ℝ} (hscale : 0 < scale) (hK : 0 ≤ K) : ∀ᶠ L : ℝ in atTop, ∀ {N M : ℕ} (index : Fin N ≃ ↥(candidatePIndices scale L)) (reindex : {g // g ∉ (candidateRootBigGroups scale L index)ᶜ} ≃ Fin M), let P := candidateRootPools scale L index (∀ (g : Fin M) (p : P (reindex.symm g).val), Real.exp (L^(3/10 : ℝ)) ≤ (p.val : ℝ)) ∧ ∀ k ∈ Icc (-(typeIIAdmissibleDeterminantBound L K : ℤ)) (typeIIAdmissibleDeterminantBound L K : ℤ), k ≠ 0 → ∀ time (g : Fin N) p, p ∈ P g → ¬ (p : ℤ) ∣ (if time%2=0 then -k else k) := by obtain ⟨_,_,_,_,hbig⟩ := eventually_candidate_P_groups (α := (3/10 : ℝ)) (β := (2/5 : ℝ)) hscale (by norm_num) (by norm_num) (by norm_num) filter_upwards [hbig,eventually_candidate_root_prime_avoidance hscale hK] with L hb hk intro N M index reindex P refine ⟨?_,?_⟩ · intro g p have hg : (index (reindex.symm g).val).val ∈ candidateBigPIndices scale L := by apply (candidate_root_big_groups_mem scale L index _).mp simpa only [mem_compl, not_not] using (reindex.symm g).property exact ((hb.2.2.2 _ hg).2.2 p.val p.property).2.1.le · intro k hmem hk0 time g p hp have hh := hk (index g).val (index g).property p hp k hmem hk0 split_ifs <;> simpa only [dvd_neg] using hh end Bounty end -- Source module: CandidateRootFullEnvelope section /- A common polynomial bound for the full pattern count and every signed kernel. -/ open Finset open scoped Classical namespace Bounty theorem candidate_root_full_kernel_envelope {L a q x : ℝ} (hL : 2 ≤ L) (ha : 0 ≤ a) (hq : 0 ≤ q) (hx : 0 ≤ x) {N J ell : ℕ} (hN : (N : ℝ) ≤ a*Real.log L) (P : Fin N → Finset ℕ) (V : Fin N → ℝ) (probes : Fin N → Finset (Fin J)) (r t : Finset (Fin N)) (hrt : Disjoint r t) (Q : ℕ) (hQ : (Q : ℝ) ≤ L^q) (h : ℝ) : let C := (J : ℝ)*a*Real.log 2+4*q+2*x+1 let H := repeatedBigFamilyEnvelope N J Q (L^(-x)) 0 ≤ C ∧ 1 ≤ H ∧ H ≤ L^C ∧ ∀ time (i : RepeatedBigPrimePatternIndex (ell := ell) probes r t) U W aux, ‖if time%2=0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes r t hrt Q h (L^(-x)) i W U aux) else physicalRootPrimeKernel P V probes r t hrt Q h (L^(-x)) i U W aux‖ ≤ H := by intro C H have hL0 : 0 < L := by linarith have henv (Q' : ℕ) (ξ : ℝ) (hQ' : (Q' : ℝ) ≤ L^q) (hξ : L^(-x) ≤ ξ) : repeatedBigFamilyEnvelope N J Q' ξ ≤ L^C := by calc _ ≤ 2*L^((J : ℝ)*a*Real.log 2+4*q+2*x) := repeated_big_family_envelope_le N J Q' (by linarith) ha hq hx hN hQ' hξ _ ≤ L*L^((J : ℝ)*a*Real.log 2+4*q+2*x) := mul_le_mul_of_nonneg_right hL (Real.rpow_nonneg hL0.le _) _ = L^C := by rw [mul_comm, ← Real.rpow_add_one hL0.ne'] refine ⟨by dsimp [C]; positivity, repeated_big_family_envelope_ge_one N J Q _, henv Q _ hQ le_rfl, ?_⟩ intro time i U W aux simpa only [Fintype.card_fin] using physical_root_alternating_prime_kernel_norm_le_family P V probes r t hrt Q h (L^(-x)) (Real.rpow_pos_of_pos hL0 _) time i U W aux end Bounty end -- Source module: CandidateActualResidue section /- The actual candidate prime pool satisfies the selected original residue estimate. -/ open Filter Finset open scoped Classical namespace Bounty theorem candidate_uniform_numbered_residue_bounds {scale : ℝ} (hscale : 0 < scale) : CandidateUniformNumberedResidueBounds scale := by intro Et z K hEt hz hK obtain ⟨vmin,vmax,hvmin,hvmax,hpool,horder⟩ := exists_candidate_numbered_edge_parameter_order hscale obtain ⟨A,Cbad,hA,hCbad,horder⟩ := horder (K+89) obtain ⟨hG,hgain,E,m,D,hE,hm,hD,hgap,hDgap,hq,hw,hx,hC,hCa,hCv,hJ⟩ := horder Et z 1 hEt hz zero_le_one let a : ℝ := 2/(5*Real.log 2) let u := 100*(vmax+1) let Kghost := physicalGhostUniformEnergyBound (9/10) vmax u let Cv := max 0 (candidateMixedRareCostExponent 1 Kghost) let G := Et+1+Cv+2 let κ := a*Real.log (primeFiberFactorBound vmin m) let A₀ := D+2*((1/2 : ℝ)+1/2+1) let q := 2*κ+((1/2 : ℝ)+1/2+1)+2*A₀+3 let w := 4*q+max z q+A₀+2 let x := ((1/2 : ℝ)+1/2+w+2)+2*A₀+2 let C := (m : ℝ)*a*Real.log 2+4*q+2*x+1 let Kedge := unrestrictedEdgeEnergyBound (9/10) u vmin vmax (1+m) let Ca := max 0 (C+candidateMixedRareCostExponent Cbad Kedge) have hG0 : 0 ≤ G := hG have hCa0 : 0 ≤ Ca := hCa have hGC0 : 0 ≤ G+Ca := add_nonneg hG0 hCa0 obtain ⟨J,hJ,hCh,hbudget⟩ := hJ 0 let Ch := max 0 (candidateMixedRareCostExponent 1 ((2 : ℝ)^(2*(J+1)))) have hmJ : m ≤ J := (le_max_left _ _).trans hJ obtain ⟨Ahi,hAhi,hhigh⟩ := exists_actual_root_half_high_rank_callback hvmin hvmin hvmax.le 1 let PG := (m : ℝ)*a*Real.log 2+1 let HG := (J : ℝ)*a*Real.log 2+4*q+2*x+1 let Ccoeff := a*Real.log Ahi+PG+HG let Arow := max 1 (max (Real.exp (2*vmax*u/(9/10 : ℝ))) (unrestrictedEdgeRowBound (9/10) u vmin (1+m))) let budget := Ccoeff+4*a*Real.log Arow+(a*((J+1 : ℕ) : ℝ))*Real.log 2 have ha : 0 ≤ a := by dsimp [a]; positivity have hPG : 0 ≤ PG := by dsimp [PG]; positivity have hHG : 0 ≤ HG := by dsimp [HG]; positivity have hCcoeff : 0 ≤ Ccoeff := by exact add_nonneg (add_nonneg (mul_nonneg ha (Real.log_nonneg hAhi)) hPG) hHG have hArow : 1 ≤ Arow := le_max_left _ _ have hrowghost : Real.exp (2*vmax*u/(9/10 : ℝ)) ≤ Arow := (le_max_left _ _).trans (le_max_right _ _) have hrowedge : unrestrictedEdgeRowBound (9/10) u vmin (1+m) ≤ Arow := (le_max_right _ _).trans (le_max_right _ _) have hb : 0 ≤ budget := by exact add_nonneg (add_nonneg hCcoeff (mul_nonneg (mul_nonneg (by norm_num) ha) (Real.log_nonneg hArow))) (mul_nonneg (mul_nonneg ha (Nat.cast_nonneg _)) (by positivity)) have hu : 1 < u := by dsimp [u]; linarith have hmodel := eventually_physical_root_residue_of_edge_costs_and_cap (budget := budget) (E := Et) (G := G) (Cv := Cv) (Ca := Ca) (Ch := Ch) (q := (1/2 : ℝ)) (vs := vmin) (ρ := (9/10 : ℝ)) (v := u) (vmin := vmin) (vmax := vmax) (CG := a) (PG := PG) (HG := HG) hb hEt (add_nonneg hGC0 (by norm_num)) hgain (by norm_num) (by norm_num) hvmin (by norm_num) (by norm_num) hu hvmin ha hPG hHG J 1 (1+m) refine ⟨m,J,w,x,q,hmJ,hw,hx,hq,?_⟩ filter_upwards [hbudget,hpool,hmodel, hhigh J (1+m) a Ccoeff Arow ha hCcoeff hArow hrowghost hrowedge, eventually_original_root_length_data, eventually_candidate_numbered_baseline_data (scale := scale) (vmax := vmax) hvmin, eventually_candidate_numbered_group_card hscale, eventually_candidate_numbered_prime_data hscale hK, eventually_ge_atTop (3 : ℝ)] with L hbudget hpool hmodel hhigh hlength hbase hcount hprime hL intro N index P V probes hprobes rN tN hrtN hrN htN hrsize htsize inst ζ hζ k hk hk0 let groups := candidateRootBigGroups scale L index let M := groups.card let reindex : {g // g ∉ groupsᶜ} ≃ Fin M := Fintype.equivFinOfCardEq (by simp only [mem_compl, not_not, Fintype.card_coe, M]) have hd := hpool index reindex obtain ⟨r,t,hr,ht,hrcard,htcard,hrt⟩ := physical_reindexed_big_subsets_pullback groups reindex rN tN hrN htN hrtN subst rN subst tN let f := physicalReindexedBigEmbedding (fun g => g ∈ groupsᶜ) reindex let I := RepeatedBigPrimePatternIndex (ell := 1) probes (r.map f) (t.map f) let patterns : Finset I := univ let cuts := repeatedBigPrimePatternCut (ell := 1) probes (r.map f) (t.map f) have hcut : ∀ i : patterns, ∀ s : ↥groupsᶜ, cuts i.val s.val = ∅ := fun i s => physical_root_prime_full_pattern_small_cut groups reindex probes r t i.val s let n := 2*Nat.ceil (L^(13/25 : ℝ))-1 let Q := ⌊L^q⌋₊ let ζt := fun time => if time%2=0 then -ζ else ζ let kt := fun time => if time%2=0 then -k else k let ζroot := fun time (_ : I) => ζt time let kroot := fun time (_ : I) => kt time let Kt := fun time (i : I) (U W : PhysicalMarkLists P J 1) (aux : PhysicalAuxLabels P (cuts i)) => if time%2=0 then (starRingEnd ℂ) (physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((disjoint_map f).mpr hrt) Q (L^(-w)) (L^(-x)) i W U aux) else physicalRootPrimeKernel P V probes (r.map f) (t.map f) ((disjoint_map f).mpr hrt) Q (L^(-w)) (L^(-x)) i U W aux let baseline := fun p : PhysicalPrime P => physicalEndpointBaseline (1/2) (n+1) p.2.val let b := Nat.ceil L let B := max (physicalPrimeGroups P groups).card b let Hkernel := repeatedBigFamilyEnvelope N J Q (L^(-x)) let eps := max (2/vmin) (2*vmax*u/((9/10 : ℝ)*vmin))*Real.exp (-(L^(3/10 : ℝ))) let Afore := L^(budget*(((n+1 : ℕ) : ℝ)+1)) let Hinitial := (2 : ℝ)^((J+1)*M) let F := repeatedBigFamilyEnvelope M m Q (L^(-x)) let decay := A^groupsᶜ.card*(L^(-E)+2*F*Real.sqrt ((b : ℝ)/(((J+1).choose 1)^groupsᶜ.card : ℕ))*Real.sqrt (Kedge^M)) let excess := max decay (F*Cbad^groupsᶜ.card*Real.sqrt (Kedge^M)) have hL0 : 0 < L := by linarith have hL2 : 2 ≤ L := by linarith have hn : n+1 = 2*Nat.ceil (L^(13/25 : ℝ)) := hlength.1 have hv : ∀ g, 0 < V g := fun g => hvmin.trans_le (hd.mass_lower g) have hMass : ∀ g, ∑ p ∈ P g, 1/(p : ℝ) = V g := fun _ => rfl have hN : (N : ℝ) ≤ a*Real.log L := (hcount index).1 have hsmall : (Fintype.card ↥groupsᶜ : ℝ) ≤ a*Real.log L := (hcount index).2 groups have hQ : (Q : ℝ) ≤ L^q := Nat.floor_le (Real.rpow_nonneg hL0.le _) have hkernel := candidate_root_full_kernel_envelope (ell := 1) hL2 ha hq hx hN P V probes (r.map f) (t.map f) ((disjoint_map f).mpr hrt) Q hQ (L^(-w)) have hHkernel : 1 ≤ Hkernel := hkernel.2.1 have hHkernelPow : Hkernel ≤ L^HG := hkernel.2.2.1 have hKbound : ∀ time < n+1, ∀ i ∈ patterns, ∀ U W aux, ‖Kt time i U W aux‖ ≤ Hkernel := fun time _ i _ U W aux => hkernel.2.2.2 time i U W aux have hpatterns : (Fintype.card ↥patterns : ℝ) ≤ L^PG := by simpa only [patterns, Fintype.card_coe, card_univ] using repeated_big_prime_pattern_card_power (ell := 1) probes (r.map f) (t.map f) ((disjoint_map f).mpr hrt) (fun g => (hprobes g).le) hL2 ha (by simpa only [Fintype.card_fin] using hN) have hcoeff : (Ahi^groupsᶜ.card*(patterns.card : ℝ))*Hkernel ≤ L^Ccoeff := by simpa only [patterns, card_univ, Fintype.card_coe] using root_prime_high_rank_coefficient_power (ell := 1) probes (r.map f) (t.map f) ((disjoint_map f).mpr hrt) (fun g => (hprobes g).le) groupsᶜ.card hL2 ha hAhi (zero_le_one.trans hHkernel) (by simpa only [Fintype.card_fin] using hN) (by simpa only [Fintype.card_coe] using hsmall) hHkernelPow have hT : ∀ (i : patterns) (g : Fin M), (physicalFullSharedIndices (ell := 1) (cuts i.val (reindex.symm g).val))ᶜ.card ≤ 1+m := by intro i g rw [physical_full_unshared_indices_card] exact Nat.add_le_add_left (repeated_big_prime_pattern_cut_card_le probes (r.map f) (t.map f) (fun g => (hprobes g).le) i.val (reindex.symm g).val) 1 have hrare := hhigh I N M P groups reindex patterns cuts hcut kroot V ⟨Sum.inl (), mem_univ _⟩ ζroot Kt Hkernel hHkernel (fun s => hd.mass_lower s.val) (fun g => hd.mass_lower _) (fun g => hd.mass_upper _) hMass hd.prime hd.disjoint (hprime index reindex).1 hT hd.big_card_le hcoeff hKbound have hbas := hbase index reindex hd let : ∀ g (p : P (reindex.symm g).val), NeZero p.val := fun g p => inst ⟨(reindex.symm g).val,p⟩ let : ∀ z : PhysicalPrime (fun s : ↥groupsᶜ => P s.val), NeZero z.2.val := fun z => inst ⟨z.1.val,z.2⟩ let hPs := fun (s : ↥groupsᶜ) p hp => hd.prime s.val p hp let hPb := fun (g : Fin M) p hp => hd.prime (reindex.symm g).val p hp have hcross : ∀ (s : ↥groupsᶜ) (g : Fin M), Disjoint (P s.val) (P (reindex.symm g).val) := fun s g => hd.disjoint (by intro he; exact (reindex.symm g).property (he ▸ s.property)) obtain ⟨encode,hinj⟩ := exists_root_finite_integer_encoding ((g : Fin M) × P (reindex.symm g).val) have hcost := hbudget.1 (N := N) (M := M) (n := n) (B := b) index reindex hPs hPb hcross probes (fun g => hprobes _) r t hrt (by simpa only [card_map] using hrsize) (by simpa only [card_map] using htsize) ζt kt have hsmallcard : groupsᶜ.card = (candidateSmallPIndices scale L).card := hd.small_card have hnum := hbudget.2.2.2 b hlength.2.2.2.2.2.2 have hdecay : decay ≤ L^(-G) := by simpa only [decay,F,Kedge,b,hsmallcard,hd.big_card] using hnum.1 have hexcess : excess ≤ L^Ca := by simpa only [excess,decay,F,Kedge,b,hsmallcard,hd.big_card] using hnum.2.1 have hvisit : Real.sqrt (Kghost^M) ≤ L^Cv := by simpa only [hd.big_card] using hnum.2.2.1 have hinitial : Hinitial ≤ L^Ch := by simpa only [Hinitial,hd.big_card] using hnum.2.2.2 have hghost := physical_endpoint_half_low_rank_ghost_budgets hvmax.le (n+1) have hghost2 := physical_endpoint_half_ghost_budgets hvmax.le (n+1) have hresult := hmodel I N M b B P groups reindex V patterns cuts hcut ζroot kroot Kt hv hd.prime hd.disjoint (fun time _ i _ g p hp => (hprime index reindex).2 k hk hk0 time g p hp) baseline (fun p _ => rfl) (le_max_left _ _) encode hinj (fun p hp => by have hg : p.1 ∉ groupsᶜ := by simpa only [mem_compl, not_not] using hp have hh := hbas.1 (reindex ⟨p.1,hg⟩) change ∀ p' : P (reindex.symm (reindex ⟨p.1,hg⟩)).val, 2*(n+2) ≤ p'.val at hh rw [reindex.symm_apply_apply] at hh exact hh p.2) hlength.2.1 hrare.2.2.1 Hinitial Afore eps (by positivity) hinitial (Real.rpow_nonneg hL0.le _) le_rfl hrare.2.1.le hrare.2.2.2.1 decay excess hbas.2.2.1 hbas.2.2.2.1 (fun g => hd.mass_upper _) (fun _ => rfl) (fun j => (physical_endpoint_schedule_unit (by norm_num) (by norm_num) (n+1) j.val).1) (fun j => (physical_endpoint_schedule_unit (by norm_num) (by norm_num) (n+1) j.val).2) (fun j => (hghost.2 j.val).1) (fun j g => (hghost.2 j.val).2 _ (hv _).le (hd.mass_upper _)) hGC0 hdecay hexcess hvisit (hbas.2.2.2.2 J) (fun θ _ code ν j F hF => physical_root_projected_prime_edge_memory_symmetric groups reindex V probes r t hrt Q (L^(-w)) (L^(-x)) ζt kt θ (fun g p => baseline ⟨(reindex.symm g).val,p⟩) (9/10) hPs hPb hcross (1/2) (fun j => physicalEndpointSchedule (1/2) (n+1) j.val) code encode ν j F hF) (fun θ _ code ν j F hF => (hcost θ (fun j => (original_alternating_schedule_bounds hL hK hζ hk hk0 (n-j.val)).1) (fun j => (original_alternating_schedule_bounds hL hK hζ hk hk0 (n-j.val)).2.1) (fun j => (original_alternating_schedule_bounds hL hK hζ hk hk0 (n-j.val)).2.2) (fun g p => baseline ⟨(reindex.symm g).val,p⟩) (∑ j ∈ range (n+2), (1-physicalEndpointSchedule (1/2) (n+1) j)) hlength.2.2.2.1 (by simpa only [Real.rpow_one] using hlength.2.2.2.2.1) (fun _ _ => rfl) hbas.2.1 (fun j => physicalEndpointSchedule (1/2) (n+1) j.val) code encode ν).2.2 j F hF) (fun θ _ code _ => hrare.2.2.2.2 θ code) hlength.2.2.2.2.2.1 (le_max_right _ _) hsmall hd.big_card_le hpatterns (fun s => hd.mass_lower s.val) hMass (fun g => hd.mass_lower _) (fun j g => (hghost2.2 j.val).2 _ (hv _).le (hd.mass_upper _)) hT Hkernel hHkernel hHkernelPow hKbound have hn' : 2*Nat.ceil (L^(13/25 : ℝ))-1+1 = 2*Nat.ceil (L^(13/25 : ℝ)) := hn simpa only [hn',neg_mul] using hresult theorem candidate_selected_residue_bounds {scale : ℝ} (hscale : 0 < scale) : CandidateSelectedResidueBounds scale := candidate_selected_residue_bounds_of_uniform_numbered hscale (candidate_uniform_numbered_residue_bounds hscale) end Bounty end namespace Bounty theorem target : fcTypeOfName% "Erdos1057.erdos_1057" := by apply WeakZeroFree.target_of_selected_residue_bounds intro c hc exact candidate_selected_residue_bounds hc end Bounty end namespace Bounty